diff --git a/.changeset/config.json b/.changeset/config.json new file mode 100644 index 000000000..91b6a9512 --- /dev/null +++ b/.changeset/config.json @@ -0,0 +1,11 @@ +{ + "$schema": "https://unpkg.com/@changesets/config@3.0.0/schema.json", + "changelog": "@changesets/cli/changelog", + "commit": false, + "fixed": [], + "linked": [], + "access": "restricted", + "baseBranch": "main", + "updateInternalDependencies": "patch", + "ignore": [] +} diff --git a/.env.example b/.env.example deleted file mode 100644 index 031a45459..000000000 --- a/.env.example +++ /dev/null @@ -1,6 +0,0 @@ -MNEMONIC= -ETHERSCAN_API_KEY= -INFURA_KEY= -ADDRESS_BOOK="addresses.json" -GRAPH_CONFIG=""graph.config.yml"" -PROVIDER_URL="http://localhost:8545" \ No newline at end of file diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index 02127cba1..000000000 --- a/.eslintignore +++ /dev/null @@ -1,7 +0,0 @@ -build/ -cache/ -coverage/ -node_modules/ -truffle.js -cache/ -dist/ diff --git a/.eslintrc b/.eslintrc deleted file mode 100644 index 89b53531b..000000000 --- a/.eslintrc +++ /dev/null @@ -1,19 +0,0 @@ -{ - "parser": "@typescript-eslint/parser", - "parserOptions": { - "ecmaVersion": 2020, - "sourceType": "module" - }, - "extends": ["plugin:@typescript-eslint/recommended", "plugin:prettier/recommended"], - "rules": { - "prefer-const": "warn", - "no-extra-semi": "off", - "@typescript-eslint/no-extra-semi": "off", - "@typescript-eslint/no-inferrable-types": "warn", - "@typescript-eslint/no-empty-function": "warn", - "no-only-tests/no-only-tests": "error" - }, - "plugins": [ - "no-only-tests" - ] -} diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml new file mode 100644 index 000000000..686ca6b33 --- /dev/null +++ b/.github/actions/setup/action.yml @@ -0,0 +1,22 @@ +name: Setup + +runs: + using: composite + + steps: + - name: Install Foundry + uses: foundry-rs/foundry-toolchain@v1 + - name: Enable Corepack + shell: bash + run: corepack enable + - name: Install Node.js + uses: actions/setup-node@v4 + with: + node-version: 22 + cache: 'pnpm' + - name: Set up pnpm via Corepack + shell: bash + run: corepack prepare pnpm@9.0.6 --activate + - name: Install dependencies + shell: bash + run: pnpm install --frozen-lockfile diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000..203a65d80 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,25 @@ +name: Build + +env: + CI: true + STUDIO_API_KEY: ${{ secrets.STUDIO_API_KEY }} + +on: + push: + branches: "*" + pull_request: + branches: "*" + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: recursive + - name: Set up environment + uses: ./.github/actions/setup + - name: Build + run: pnpm build || pnpm build \ No newline at end of file diff --git a/.github/workflows/ci-contracts.yml b/.github/workflows/ci-contracts.yml new file mode 100644 index 000000000..8d4bcbb42 --- /dev/null +++ b/.github/workflows/ci-contracts.yml @@ -0,0 +1,42 @@ +name: CI - packages/contracts + +env: + CI: true + +on: + push: + branches: "*" + paths: + - packages/contracts/** + pull_request: + branches: "*" + paths: + - packages/contracts/** + workflow_dispatch: + +jobs: + test-ci: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: recursive + - name: Set up environment + uses: ./.github/actions/setup + - name: Build + run: | + pushd packages/contracts + pnpm build || pnpm build + - name: Run tests + run: | + pushd packages/contracts + pnpm test:coverage + - name: Upload coverage report + uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: ./packages/contracts/coverage.json + flags: unittests + name: graphprotocol-contracts + fail_ci_if_error: true diff --git a/.github/workflows/ci-data-edge.yml b/.github/workflows/ci-data-edge.yml new file mode 100644 index 000000000..6e313eaf1 --- /dev/null +++ b/.github/workflows/ci-data-edge.yml @@ -0,0 +1,30 @@ +name: CI - packages/data-edge + +env: + CI: true + +on: + push: + branches: "*" + paths: + - packages/data-edge/** + pull_request: + branches: "*" + paths: + - packages/data-edge/** + workflow_dispatch: + +jobs: + test-ci: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Set up environment + uses: ./.github/actions/setup + - name: Build + run: | + pushd packages/data-edge + pnpm build + - name: Run tests + run: pnpm test \ No newline at end of file diff --git a/.github/workflows/ci-hardhat-graph-protocol.yml b/.github/workflows/ci-hardhat-graph-protocol.yml new file mode 100644 index 000000000..f63c8b974 --- /dev/null +++ b/.github/workflows/ci-hardhat-graph-protocol.yml @@ -0,0 +1,51 @@ +name: CI - packages/toolshed + +env: + CI: true + +on: + push: + branches: "*" + paths: + - packages/toolshed/** + pull_request: + branches: "*" + paths: + - packages/toolshed/** + workflow_dispatch: + +jobs: + test-ci: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: recursive + - name: Set up environment + uses: ./.github/actions/setup + - name: Build contracts + run: | + pushd packages/contracts + pnpm build + popd + - name: Build horizon + run: | + pushd packages/horizon + pnpm build + popd + - name: Build subgraph service + run: | + pushd packages/subgraph-service + pnpm build + popd + - name: Build toolshed + run: | + pushd packages/toolshed + pnpm build + popd + - name: Build hardhat-graph-protocol + run: | + pushd packages/hardhat-graph-protocol + pnpm build + popd \ No newline at end of file diff --git a/.github/workflows/ci-horizon.yml b/.github/workflows/ci-horizon.yml new file mode 100644 index 000000000..7352dedb2 --- /dev/null +++ b/.github/workflows/ci-horizon.yml @@ -0,0 +1,55 @@ +name: CI - packages/horizon + +env: + CI: true + +on: + push: + branches: "*" + paths: + - packages/horizon/** + pull_request: + branches: "*" + paths: + - packages/horizon/** + workflow_dispatch: + +jobs: + test-ci: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: recursive + - name: Set up environment + uses: ./.github/actions/setup + - name: Build contracts + run: | + pushd packages/contracts + pnpm build + popd + - name: Build horizon + run: | + pushd packages/horizon + pnpm build + popd + - name: Build subgraph service + run: | + pushd packages/subgraph-service + pnpm build + popd + - name: Build toolshed + run: | + pushd packages/toolshed + pnpm build + popd + - name: Build hardhat-graph-protocol + run: | + pushd packages/hardhat-graph-protocol + pnpm build + popd + - name: Run tests + run: | + pushd packages/horizon + pnpm test \ No newline at end of file diff --git a/.github/workflows/ci-subgraph-service.yml b/.github/workflows/ci-subgraph-service.yml new file mode 100644 index 000000000..b9bb6d3d6 --- /dev/null +++ b/.github/workflows/ci-subgraph-service.yml @@ -0,0 +1,55 @@ +name: CI - packages/subgraph-service + +env: + CI: true + +on: + push: + branches: "*" + paths: + - packages/subgraph-service/** + pull_request: + branches: "*" + paths: + - packages/subgraph-service/** + workflow_dispatch: + +jobs: + test-ci: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: recursive + - name: Set up environment + uses: ./.github/actions/setup + - name: Build contracts + run: | + pushd packages/contracts + pnpm build + popd + - name: Build horizon + run: | + pushd packages/horizon + pnpm build + popd + - name: Build subgraph service + run: | + pushd packages/subgraph-service + pnpm build + popd + - name: Build toolshed + run: | + pushd packages/toolshed + pnpm build + popd + - name: Build hardhat-graph-protocol + run: | + pushd packages/hardhat-graph-protocol + pnpm build + popd + - name: Run tests + run: | + pushd packages/subgraph-service + pnpm test \ No newline at end of file diff --git a/.github/workflows/ci-token-dist.yml b/.github/workflows/ci-token-dist.yml new file mode 100644 index 000000000..1931b45a1 --- /dev/null +++ b/.github/workflows/ci-token-dist.yml @@ -0,0 +1,35 @@ +name: CI - packages/token-distribution + +env: + CI: true + STUDIO_API_KEY: ${{ secrets.STUDIO_API_KEY }} + +on: + push: + branches: "*" + paths: + - packages/token-distribution/** + pull_request: + branches: "*" + paths: + - packages/token-distribution/** + workflow_dispatch: + +jobs: + test-ci: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: recursive + - name: Set up environment + uses: ./.github/actions/setup + - name: Build + run: | + pushd packages/token-distribution + pnpm build + - name: Run tests + run: | + pushd packages/token-distribution + pnpm test \ No newline at end of file diff --git a/.github/workflows/ci-toolshed.yml b/.github/workflows/ci-toolshed.yml new file mode 100644 index 000000000..85df34016 --- /dev/null +++ b/.github/workflows/ci-toolshed.yml @@ -0,0 +1,46 @@ +name: CI - packages/toolshed + +env: + CI: true + +on: + push: + branches: "*" + paths: + - packages/toolshed/** + pull_request: + branches: "*" + paths: + - packages/toolshed/** + workflow_dispatch: + +jobs: + test-ci: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: recursive + - name: Set up environment + uses: ./.github/actions/setup + - name: Build contracts + run: | + pushd packages/contracts + pnpm build + popd + - name: Build horizon + run: | + pushd packages/horizon + pnpm build + popd + - name: Build subgraph service + run: | + pushd packages/subgraph-service + pnpm build + popd + - name: Build toolshed + run: | + pushd packages/toolshed + pnpm build + popd \ No newline at end of file diff --git a/.github/workflows/npmpublish.yml b/.github/workflows/npmpublish.yml deleted file mode 100644 index 61193192f..000000000 --- a/.github/workflows/npmpublish.yml +++ /dev/null @@ -1,47 +0,0 @@ -# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created -# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages - -name: Node.js Package - -on: - release: - types: [created] - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 - with: - node-version: 12 - - run: npm ci - - run: npm test - - publish-npm: - needs: build - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 - with: - node-version: 12 - registry-url: https://registry.npmjs.org/ - - run: npm ci - - run: npm publish --access=restricted - env: - NODE_AUTH_TOKEN: ${{secrets.npm_token}} - - publish-gpr: - needs: build - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 - with: - node-version: 12 - registry-url: https://npm.pkg.github.com/ - - run: npm ci - - run: npm publish --access=restricted - env: - NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/npmtest.yml b/.github/workflows/npmtest.yml deleted file mode 100644 index 79f35d549..000000000 --- a/.github/workflows/npmtest.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Node.js CI - -on: - push: - branches: [dev] - pull_request: - branches: [dev] - -jobs: - build: - runs-on: ubuntu-latest - - strategy: - matrix: - node-version: [14.x] - - steps: - - uses: actions/checkout@v2 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node-version }} - - run: yarn install --non-interactive --frozen-lockfile - env: - NODE_AUTH_TOKEN: ${{secrets.npm_token}} - - run: yarn test diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 000000000..40981fd3f --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,36 @@ +name: Publish package to NPM + +on: + workflow_dispatch: + inputs: + package: + description: 'Package to publish' + required: true + type: choice + options: + - contracts + - sdk + tag: + description: 'Tag to publish' + required: true + type: string + default: latest + +jobs: + publish: + name: Publish package + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: recursive + - name: Set up environment + uses: ./.github/actions/setup + - name: Set npm token for publishing + run: pnpm config set //registry.npmjs.org/:_authToken ${{ secrets.GRAPHPROTOCOL_NPM_TOKEN }} + - name: Publish 🚀 + shell: bash + run: | + pushd packages/${{ inputs.package }} + pnpm publish --tag ${{ inputs.tag }} --access public --no-git-checks \ No newline at end of file diff --git a/.github/workflows/verifydeployed.yml b/.github/workflows/verifydeployed.yml new file mode 100644 index 000000000..b726814cb --- /dev/null +++ b/.github/workflows/verifydeployed.yml @@ -0,0 +1,70 @@ +name: Verify deployed contracts + +on: + workflow_dispatch: + inputs: + contracts: + description: 'List of deployed contracts to verify (space delimited)' + required: true + type: string + network: + description: 'Network where the contracts are deployed' + required: true + type: choice + default: mainnet + options: + - mainnet + - arbitrum-one + - goerli + - arbitrum-goerli + +jobs: + build: + name: Compile contracts + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + submodules: recursive + - name: Set up environment + uses: ./.github/actions/setup + + - name: Build + run: | + pushd packages/contracts + pnpm build || pnpm build + + - name: Save build artifacts + uses: actions/upload-artifact@v3 + with: + name: contract-artifacts + path: | + packages/contracts/build + packages/contracts/cache/*.json + + verify: + name: Verify deployments + runs-on: ubuntu-latest + needs: build + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Set up environment + uses: ./.github/actions/setup + - name: Build + run: | + pushd packages/contracts + pnpm build || pnpm build + - name: Get build artifacts + uses: actions/download-artifact@v3 + with: + name: contract-artifacts + + - name: Verify contracts on Defender + run: cd packages/contracts && pnpm hardhat --network ${{ inputs.network }} verify-defender ${{ inputs.contracts }} + env: + DEFENDER_API_KEY: "${{ secrets.DEFENDER_API_KEY }}" + DEFENDER_API_SECRET: "${{ secrets.DEFENDER_API_SECRET }}" + INFURA_KEY: "${{ secrets.INFURA_KEY }}" + WORKFLOW_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" diff --git a/.gitignore b/.gitignore index 85b7e1e54..4743fd6a6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,17 +1,31 @@ -# Ignore zeppelin contracts -node_modules/ +# Logs +yarn-debug.log* +yarn-error.log* +node.log -# Ignore build stuff -cache/ -build/ -dist/ +# Dependency directories +node_modules/ -# Coverage tests -coverage/ +# Yarn +.yarn/ +!.yarn/patches +!.yarn/releases +!.yarn/plugins +!.yarn/sdks +!.yarn/versions -# Hardhat cache +# Hardhat artifacts +artifacts/ +cache/ cached/ +# Build artifacts +dist/ +build/ +typechain/ +typechain-types/ +deployments/hardhat/ + # Ignore solc bin output bin/ @@ -20,5 +34,38 @@ bin/ .DS_Store .vscode -# Sliter -/reports +# Coverage and other reports +coverage/ +reports/ +coverage.json +lcov.info + +# Local test files +addresses-local.json +localNetwork.json +arbitrum-addresses-local.json +tx-*.log +addresses-fork.json +addresses-hardhat.json +addresses-localhost.json +addresses-local-network.json +# Keys +.keystore + +# Forge artifacts +cache_forge + +# Graph client +.graphclient + +tx-builder-*.json +!tx-builder-template.json + +# Hardhat Ignition +**/chain-31337/ +**/chain-1337/ +**/horizon-localhost/ +**/horizon-hardhat/ +**/subgraph-service-localhost/ +**/subgraph-service-hardhat/ +!**/ignition/**/artifacts/ diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000..8cd5a0672 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,12 @@ +[submodule "packages/subgraph-service/lib/forge-std"] + path = packages/subgraph-service/lib/forge-std + url = https://github.com/foundry-rs/forge-std +[submodule "packages/horizon/lib/forge-std"] + path = packages/horizon/lib/forge-std + url = https://github.com/foundry-rs/forge-std +[submodule "packages/horizon/lib/openzeppelin-foundry-upgrades"] + path = packages/horizon/lib/openzeppelin-foundry-upgrades + url = https://github.com/OpenZeppelin/openzeppelin-foundry-upgrades +[submodule "packages/subgraph-service/lib/openzeppelin-foundry-upgrades"] + path = packages/subgraph-service/lib/openzeppelin-foundry-upgrades + url = https://github.com/OpenZeppelin/openzeppelin-foundry-upgrades diff --git a/.husky/commit-msg b/.husky/commit-msg new file mode 100755 index 000000000..fe4c17a22 --- /dev/null +++ b/.husky/commit-msg @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +npx --no-install commitlint --edit "" diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 000000000..aa9adeab4 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,22 @@ +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" + +# contracts +pushd packages/contracts +npx --no-install lint-staged +popd + +# subgraph service +pushd packages/subgraph-service +npx --no-install lint-staged +popd + +# data-edge +pushd packages/data-edge +npx --no-install lint-staged +popd + +# graph horizon +pushd packages/horizon +npx --no-install lint-staged +popd diff --git a/.prettierignore b/.prettierignore deleted file mode 100644 index 8b1378917..000000000 --- a/.prettierignore +++ /dev/null @@ -1 +0,0 @@ - diff --git a/.prettierrc.json b/.prettierrc.json deleted file mode 100644 index 4f12c5ed0..000000000 --- a/.prettierrc.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "printWidth": 100, - "useTabs": false, - "bracketSpacing": true, - "overrides": [ - { - "files": "*.js", - "options": { - "semi": false, - "trailingComma": "all", - "tabWidth": 2, - "singleQuote": true, - "explicitTypes": "always" - } - }, - { - "files": "*.ts", - "options": { - "semi": false, - "trailingComma": "all", - "tabWidth": 2, - "singleQuote": true, - "explicitTypes": "always" - } - }, - { - "files": "*.sol", - "options": { - "tabWidth": 4, - "singleQuote": false, - "explicitTypes": "always" - } - } - ] -} diff --git a/.solcover.js b/.solcover.js deleted file mode 100644 index 747f078e5..000000000 --- a/.solcover.js +++ /dev/null @@ -1,10 +0,0 @@ -const skipFiles = ['bancor', 'ens', 'erc1056'] - -module.exports = { - providerOptions: { - mnemonic: 'myth like bonus scare over problem client lizard pioneer submit female collect', - network_id: 1337, - }, - skipFiles, - istanbulFolder: './reports/coverage', -} diff --git a/.soliumignore b/.soliumignore deleted file mode 100644 index 186ef362e..000000000 --- a/.soliumignore +++ /dev/null @@ -1,12 +0,0 @@ -node_modules - -contracts/bancor -contracts/discovery/erc1056 -contracts/token/IGraphToken.sol -contracts/upgrades/GraphProxy.sol -contracts/rewards/RewardsManager.sol -contracts/tests/RewardsManagerMock.sol -contracts/tests/ens -contracts/curation/IGraphCurationToken.sol -contracts/staking/libs/LibFixedMath.sol -contracts/tests/testnet/GSRManager.sol diff --git a/.soliumrc.json b/.soliumrc.json deleted file mode 100644 index 9532f241f..000000000 --- a/.soliumrc.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "extends": "solium:recommended", - "plugins": ["security"], - "rules": { - "no-experimental": ["off"], - "quotes": ["error", "double"], - "linebreak-style": ["error", "unix"], - "security/no-inline-assembly": ["off"], - "security/no-low-level-calls": ["off"] - } -} diff --git a/DEPLOYMENT.md b/DEPLOYMENT.md deleted file mode 100644 index a863e106c..000000000 --- a/DEPLOYMENT.md +++ /dev/null @@ -1,109 +0,0 @@ -## Deploying the Solidity Smart Contracts - -### Running - -A CLI in `cli/cli.ts` deploys the contracts to the specified network when used with the `migrate` command. - -This script accepts multiple commands that you can print using: - -``` -cli/cli.ts --help -``` - -For convenience, the script can also be used as a hardhat command with `hardhat migrate` and it can be also run with: - -``` -yarn deploy -``` - -The **migrate** command will: - -- Read contracts configuration from a file. -- Parse command-line options to select which network to deploy and the wallet to use. -- Check if contracts were already deployed and skip them. -- Deploy the contracts and wait for each transaction to be mined. -- Write an address book file with the deployed contracts data. - -The script accepts multiple parameters that allow to override default values, print the available options with: - -``` -yarn deploy -- --help -``` - -NOTE: Please run `yarn build` at least once before running migrate as this command relies on artifacts produced in the compilation process. - -### Networks - -By default, `yarn deploy` will deploy the contracts to a localhost instance of a development network. - -To deploy to a different network execute: - -``` -yarn deploy -- --network {networkName} - -# Example -yarn deploy -- --network kovan -``` - -The network must be configured in the `hardhat.config.ts` as explained in https://hardhat.org/config. - -To deploy using your own wallet add the HD Wallet Config to the `hardhat.config.ts` file according to https://hardhat.org/config/#hd-wallet-config. - -### Configuration - -A configuration file called `graph.config.yml` contains the parameters needed to deploy the contracts. Please edit these params as you see fit. - -You can use a different set of configuration options by specifying the file location in the command line: - -``` -yarn deploy -- --graph-config another-graph.config.yml -``` - -Rules: - -- Under the `contracts` key every contract configuration is defined by its name. -- Every key under a contract name are parameters sent in the contract constructor in the order they are declared. -- YAML anchors can be used to set common values like \*governor. -- A special key called `__calls` let you define a list of parameters that will be set at the end of all the contracts deployment by calling the function defined in the `fn` key. -- The configuration file can set a parameter to a value read from the AddressBook by using `${{ContractName.AttributeName}}`. For example `${{GraphToken.address}}`. - -Example: - -[https://github.com/graphprotocol/contracts/blob/master/graph.config.yml](https://github.com/graphprotocol/contracts/blob/master/graph.config.yml) - -### Address book - -After running the migrate script it will print debugging information on the console and the resulting contract information will be saved on the `addresses.json` file. - -The upmost key of that file is the **chainID**. This allows to accommodate the deployment information of multiple networks in the same address book. - -For each contract deployed, the address book will contain: - -- Contract address. -- Constructor arguments. -- Creation code hash. -- Runtime code hash. -- Transaction hash of the deployment. - -### Order of deployment - -Some contracts require the address from previously deployed contracts. For that reason, the order of deployment is as below: - -- Controller -- EpochManager -- GNS -- GraphToken -- ServiceRegistry -- Curation -- RewardManager -- Staking -- DisputeManager - -### Deploying a new testnet - -1. Make sure contracts are up to date as you please. -2. `yarn deploy-rinkeby` to deploy to Rinkeby. This will create new contracts with new addresses in `addresses.json`. -3. Update the `package.json` and `package-lock.json` files with the new package version and publish a new npm package with `npm publish`. You can dry-run the files to be uploaded by running `npm publish --dry-run`. -4. Merge this update into master, branch off and save for whatever version of the testnet is going on, and then tag this on the github repo, pointing to your branch (ex. at `testnet-phase-1` branch). This way we can always get the contract code for testnet, while continuing to do work on mainnet. -5. Pull the updated package into the subgraph, and other apps that depend on the package.json. -6. Send tokens to the whole team using `./cli/cli.ts airdrop` diff --git a/LICENSE b/LICENSE index 0cc620d5c..947d07ab5 100644 --- a/LICENSE +++ b/LICENSE @@ -1,18 +1,342 @@ -Copyright 2020 The Graph Foundation - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + +Copyright (C) 1989, 1991 Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. + + Preamble + +The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + +When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + +To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + +For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + +We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + +Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + +Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + +The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + +0. This License applies to any program or other work which contains + a notice placed by the copyright holder saying it may be distributed + under the terms of this General Public License. The "Program", below, + refers to any such program or work, and a "work based on the Program" + means either the Program or any derivative work under copyright law: + that is to say, a work containing the Program or a portion of it, + either verbatim or with modifications and/or translated into another + language. (Hereinafter, translation is included without limitation in + the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + +1. You may copy and distribute verbatim copies of the Program's + source code as you receive it, in any medium, provided that you + conspicuously and appropriately publish on each copy an appropriate + copyright notice and disclaimer of warranty; keep intact all the + notices that refer to this License and to the absence of any warranty; + and give any other recipients of the Program a copy of this License + along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + +2. You may modify your copy or copies of the Program or any portion + of it, thus forming a work based on the Program, and copy and + distribute such modifications or work under the terms of Section 1 + above, provided that you also meet all of these conditions: + + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + +3. You may copy and distribute the Program (or a work based on it, + under Section 2) in object code or executable form under the terms of + Sections 1 and 2 above provided that you also do one of the following: + + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + +4. You may not copy, modify, sublicense, or distribute the Program + except as expressly provided under this License. Any attempt + otherwise to copy, modify, sublicense or distribute the Program is + void, and will automatically terminate your rights under this License. + However, parties who have received copies, or rights, from you under + this License will not have their licenses terminated so long as such + parties remain in full compliance. + +5. You are not required to accept this License, since you have not + signed it. However, nothing else grants you permission to modify or + distribute the Program or its derivative works. These actions are + prohibited by law if you do not accept this License. Therefore, by + modifying or distributing the Program (or any work based on the + Program), you indicate your acceptance of this License to do so, and + all its terms and conditions for copying, distributing or modifying + the Program or works based on it. + +6. Each time you redistribute the Program (or any work based on the + Program), the recipient automatically receives a license from the + original licensor to copy, distribute or modify the Program subject to + these terms and conditions. You may not impose any further + restrictions on the recipients' exercise of the rights granted herein. + You are not responsible for enforcing compliance by third parties to + this License. + +7. If, as a consequence of a court judgment or allegation of patent + infringement or for any other reason (not limited to patent issues), + conditions are imposed on you (whether by court order, agreement or + otherwise) that contradict the conditions of this License, they do not + excuse you from the conditions of this License. If you cannot + distribute so as to satisfy simultaneously your obligations under this + License and any other pertinent obligations, then as a consequence you + may not distribute the Program at all. For example, if a patent + license would not permit royalty-free redistribution of the Program by + all those who receive copies directly or indirectly through you, then + the only way you could satisfy both it and this License would be to + refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + +8. If the distribution and/or use of the Program is restricted in + certain countries either by patents or by copyrighted interfaces, the + original copyright holder who places the Program under this License + may add an explicit geographical distribution limitation excluding + those countries, so that distribution is permitted only in or among + countries not thus excluded. In such case, this License incorporates + the limitation as if written in the body of this License. + +9. The Free Software Foundation may publish revised and/or new versions + of the General Public License from time to time. Such new versions will + be similar in spirit to the present version, but may differ in detail to + address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + +10. If you wish to incorporate parts of the Program into other free + programs whose distribution conditions are different, write to the author + to ask for permission. For software which is copyrighted by the Free + Software Foundation, write to the Free Software Foundation; we sometimes + make exceptions for this. Our decision will be guided by the two goals + of preserving the free status of all derivatives of our free software and + of promoting the sharing and reuse of software generally. + + NO WARRANTY + +11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY + FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN + OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES + PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED + OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS + TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE + PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, + REPAIR OR CORRECTION. + +12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING + WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR + REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, + INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING + OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED + TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY + YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER + PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE + POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + +To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + +Yoyodyne, Inc., hereby disclaims all copyright interest in the program +`Gnomovision' (which makes passes at compilers) written by James Hacker. + +, 1 April 1989 +Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/README.md b/README.md index ac8a68f5e..50f334c45 100644 --- a/README.md +++ b/README.md @@ -1,88 +1,139 @@ -# Graph Protocol Solidity Smart Contracts +

+ The Graph +

-![Version Badge](https://img.shields.io/badge/version-1.0.0-lightgrey.svg) +

The Graph Protocol

+

A decentralized network for querying and indexing blockchain data.

-## Contracts +

+ + Build + + + CI-Contracts + +

-This repository contains The Graph Protocol solidity contracts. It is based on the -[PRD outlined here](https://www.notion.so/thegraph/Public-Network-Contracts-PRD-5eb8466aa4b44a1da7f16a28acd6674f), -There are many other smaller, more detailed PRDs that these contracts implement, that can also be -found on notion. +

+ Packages • + Development • + Docs • + Contributing • + Security • + License +

-The contracts enable a staking protocol build on top of Ethereum, using The Graph Network Token -(GRT). The network enables a decentralized network of Graph Nodes -to index and serve queries for subgraphs. -[Graph node's repository can be found here](https://github.com/graphprotocol/graph-node). +--- -The Graph Network enables smart contract development to happen alongside subgraph development. -It is a new and improved way to develop dapps. It allows developers to move some logic into the -subgraph for resolving data based on events, or past storage data on Ethereum. Therefore, -the contracts and the subgraph rely on each other, to show to end users the current data and state -of The Graph Network. +[The Graph](https://thegraph.com/) is an indexing protocol for querying networks like Ethereum, IPFS, Polygon, and other blockchains. Anyone can build and Publish open APIs, called subgraphs, making data easily accessible. -### Contracts Testing +## Packages -Testing is done with the following stack: +This repository is a pnpm workspaces monorepo containing the following packages: -- Waffle -- Hardhat -- Typescript -- Ethers +| Package | Latest version | Description | +| --- | --- | --- | +| [contracts](./packages/contracts) | [![npm version](https://badge.fury.io/js/@graphprotocol%2Fcontracts.svg)](https://badge.fury.io/js/@graphprotocol%2Fcontracts) | Contracts enabling the open and permissionless decentralized network known as The Graph protocol. | +| [eslint-graph-config](./packages/eslint-graph-config) | - | Shared linting and formatting rules for TypeScript projects. | +| [horizon](./packages/horizon) | - | Contracts for Graph Horizon, the next iteration of The Graph protocol. | +| [sdk](./packages/sdk) | [![npm version](https://badge.fury.io/js/@graphprotocol%2Fsdk.svg)](https://badge.fury.io/js/@graphprotocol%2Fsdk) | TypeScript based SDK to interact with the protocol contracts | +| [solhint-graph-config](./packages/solhint-graph-config) | - | Shared linting and formatting rules for Solidity projects. | +| [solhint-plugin-graph](./packages/solhint-plugin-graph) | - | Plugin for Solhint with specific Graph linting rules. | +| [subgraph-service](./packages/subgraph-service) | - | Contracts for the Subgraph data service in Graph Horizon. | +| [token-distribution](./packages/token-distribution) | [![npm version](https://badge.fury.io/js/@graphprotocol%2Ftoken-distribution.svg)](https://badge.fury.io/js/@graphprotocol%2Ftoken-distribution) | Contracts managing token locks for network participants | -To test all files, use `yarn test`. To test a single file run: -`npx hardhat test test/.ts`. -### Contract addresses +## Development -Currently we are running our testnet on Rinkeby. Contract addresses can be found in this repository at -`./addresses.json`. However, addresses should be obtained from the NPM Package. +### Setup +To set up this project you'll need [git](https://git-scm.com) and [pnpm](https://pnpm.io/) installed. -### Deploying Contracts +From your command line: -In order to run deployments, see `./DEPLOYMENT.md`. We use a custom deployment script, which -allowed us to completely remove `truffle` as a dependency. +```bash +# Clone this repository +$ git clone https://github.com/graphprotocol/contracts -## Subgraph +# Go into the repository +$ cd contracts -The subgraph repository can be [found here](https://github.com/graphprotocol/graph-network-subgraph). +# Install dependencies +$ pnpm install -Great care must be taken to ensure all the code and data the subgraph refers to is in sync with -the current contracts on the correct network. For tracking all of this, we have an NPM package. +# Build projects +$ pnpm build +``` -The addresses -for the subgraph need to be the most up to date. This includes grabbing the latest ABIs and -typechain bindings, as well as pointing the addresses in the subgraph manifest to the latest -addresses. You can find the latest subgraph addresses in `addresses.json`, and they are also -in the NPM package. +### Versioning and publishing packages -Currently the contracts are being tested on Rinkeby. We test on ganache as well. We used to use -Kovan, but it is somewhat deprecated. +We use [changesets](https://github.com/changesets/changesets) to manage package versioning, this ensures that all packages are versioned together in a consistent manner and helps with generating changelogs. -## NPM package +#### Step 1: Creating a changeset -The NPM package will be release in versions, and the version will be coordinated to be the same -version as the contracts and the subgraph. Anyone wanting to tie into the graph network contracts -or subgraph should install the npm package into their repository, and refer to the same version -number for the contracts and subgraph. +A changeset is a file that describes the changes that have been made to the packages in the repository. To create a changeset, run the following command from the root of the repository: -**New development work on the contracts and subgraph will be merged to master. Thus, when developing** -**on the network, you should not rely on the master code as it might break between the subgraph repo** -**and the contracts repo. Please use a version that is tagged.** +```bash +$ pnpm changeset +``` -The NPM package will contain the following files/information: +Changeset files are stored in the `.changeset` directory until they are packaged into a release. You can commit these files and even merge them into your main branch without publishing a release. -- The contracts -- The ABIs for those contracts -- The typechain autogenerated functions. These are typescript functions that are created based off - the ABIs, and are very useful for their type checking and the fact they are tied to a version -- The deployed addresses for each network, the date of deployment, and the commit hash. -- Metadata JSON objects for Graph Account and Subgraph metadata - **This is the only place you should grab contract addresses from.** +#### Step 2: Creating a package release -We will also release versions for specific releases, such as `@graphprotocol/contracts@beta`. +When you are ready to create a new package release, run the following command to package all changesets, this will also bump package versions and dependencies: -# Copyright +```bash +$ pnpm changeset version +``` -Copyright © 2020 The Graph Foundation +### Step 3: Tagging the release -Licensed under [MIT license](LICENSE). +__Note__: this step is meant to be run on the main branch. + +After creating a package release, you will need to tag the release commit with the version number. To do this, run the following command from the root of the repository: + +```bash +$ pnpm changeset tag +$ git push --follow-tags +``` + +#### Step 4: Publishing a package release + +__Note__: this step is meant to be run on the main branch. + +Packages are published and distributed via NPM. To publish a package, run the following command from the root of the repository: + +```bash +# Publish the packages +$ pnpm changeset publish + +# Alternatively use +$ pnpm publish --recursive +``` + +Alternatively, there is a GitHub action that can be manually triggered to publish a package. + +## Documentation + +> Coming soon + +For now, each package has its own README with more specific documentation you can check out. + +## Contributing + +Contributions are welcomed and encouraged! You can do so by: + +- Creating an issue +- Opening a PR + +If you are opening a PR, it is a good idea to first go to [The Graph Discord](https://discord.com/invite/vtvv7FP) or [The Graph Forum](https://forum.thegraph.com/) and discuss your idea! Discussions on the forum or Discord are another great way to contribute. + +## Security + +If you find a bug or security issue please go through the official channel, [The Graph Security Bounties on Immunefi](https://immunefi.com/bounty/thegraph/). Responsible disclosure procedures must be followed to receive bounties. + +## License + +Copyright © 2021 The Graph Foundation + +Licensed under [GPL license](LICENSE). diff --git a/addresses.json b/addresses.json deleted file mode 100644 index 1da7d83c4..000000000 --- a/addresses.json +++ /dev/null @@ -1,588 +0,0 @@ -{ - "1": { - "IENS": { - "address": "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e" - }, - "IEthereumDIDRegistry": { - "address": "0xdCa7EF03e98e0DC2B855bE647C39ABe984fcF21B" - }, - "GraphProxyAdmin": { - "address": "0xF3B000a6749259539aF4E49f24EEc74Ea0e71430", - "creationCodeHash": "0x26a6f47e71ad242e264768571ce7223bf5a86fd0113ab6cb8200f65820232904", - "runtimeCodeHash": "0xd5330527cfb09df657adc879d8ad704ce6b8d5917265cabbd3eb073d1399f122", - "txHash": "0xc5fe1a9f70e3cc4d286e19e3ee8ee9a0639c7415aea22a3f308951abf300382c" - }, - "BancorFormula": { - "address": "0xd0C61e8F15d9deF697E1100663eD7dA74d3727dC", - "creationCodeHash": "0x17f6de9ab8a9bcf03a548c01d620a32caf1f29be8d90a9688ebee54295f857ef", - "runtimeCodeHash": "0x97a57f69b0029383398d02587a3a357168950d61622fe9f9710bf02b59740d63", - "txHash": "0xcd0e28e7d328ff306bb1f2079e594ff9d04d09f21bc5f978b790c8d44b02055a" - }, - "Controller": { - "address": "0x24CCD4D3Ac8529fF08c58F74ff6755036E616117", - "creationCodeHash": "0x7f37a1844c38fffd5390d2114804ffc4e5cf66dfb5c7bd67a32a4f5d10eebd2d", - "runtimeCodeHash": "0x929c62381fbed59483f832611752177cc2642e1e35fedeeb6cd9703e278448a0", - "txHash": "0x12b13ed4ac6fee14335be09df76171b26223d870977524cfdce46c11112a5c04" - }, - "EpochManager": { - "address": "0x64F990Bf16552A693dCB043BB7bf3866c5E05DdB", - "initArgs": [ - { - "name": "controller", - "value": "0x24CCD4D3Ac8529fF08c58F74ff6755036E616117" - }, - { - "name": "lengthInBlocks", - "value": 6646 - } - ], - "creationCodeHash": "0xa02709eb59b9cca8bee1271845b42db037dc1d042dad93410ba532d378a7c79f", - "runtimeCodeHash": "0xdb307489fd9a4a438b5b48909e12020b209280ad777561c0a7451655db097e75", - "txHash": "0x9116a77a4e87eb3fe28514a26b1a6e3ee5ce982f9df3c18aadfc36d4f7f050e7", - "proxy": true, - "implementation": { - "address": "0x3fab259F2392F733c60C19492B5678E5D2D2Ee31", - "creationCodeHash": "0xf03074bb7f026a2574b6ffb5d0f63f0c4fee81e004e1c46ef262dd5802d3384f", - "runtimeCodeHash": "0x0d078a0bf778c6c713c46979ac668161a0a0466356252e47082f80912e4495b2", - "txHash": "0x730141db9a1dc5c9429f7543442e34e9eb994610e2ceabdedb6d322e1bedf2aa" - } - }, - "GraphToken": { - "address": "0xc944E90C64B2c07662A292be6244BDf05Cda44a7", - "constructorArgs": [ - { - "name": "initialSupply", - "value": "10000000000000000000000000000" - } - ], - "creationCodeHash": "0x30da7a30d71fbd41d3327e4d0183401f257af3e905a0c68ebfd18b590b27b530", - "runtimeCodeHash": "0xb964f76194a04272e7582382a4d6bd6271bbb90deb5c1fd3ae3913504ea3a830", - "txHash": "0x079625b9f58a40f1948b396b7007d09ff4aa193d7ec798923910fc179294cab8" - }, - "ServiceRegistry": { - "address": "0xaD0C9DaCf1e515615b0581c8D7E295E296Ec26E6", - "initArgs": [ - { - "name": "controller", - "value": "0x24CCD4D3Ac8529fF08c58F74ff6755036E616117" - } - ], - "creationCodeHash": "0xa02709eb59b9cca8bee1271845b42db037dc1d042dad93410ba532d378a7c79f", - "runtimeCodeHash": "0xdb307489fd9a4a438b5b48909e12020b209280ad777561c0a7451655db097e75", - "txHash": "0x94cbb1d3863e33bf92acc6fab534c5ce63a9d1347958a323ae496b06f710f042", - "proxy": true, - "implementation": { - "address": "0x866232Ec9a9F918a821eBa561Cc5FC960Ef5B3aa", - "creationCodeHash": "0xf5fa541b43d15fade518feb63a95a73b9c67626108ead259e444af3a7ae1804f", - "runtimeCodeHash": "0x9856d2c2985f410f2f77e456fe6163827ea5251eb5e3f3768d3d4f8868187882", - "txHash": "0xdf811598fbfbc487b16b5bb3444ed47ae3107d3dcde8dbd770e8810315f942b5" - } - }, - "Curation": { - "address": "0x8FE00a685Bcb3B2cc296ff6FfEaB10acA4CE1538", - "initArgs": [ - { - "name": "controller", - "value": "0x24CCD4D3Ac8529fF08c58F74ff6755036E616117" - }, - { - "name": "bondingCurve", - "value": "0xd0C61e8F15d9deF697E1100663eD7dA74d3727dC" - }, - { - "name": "reserveRatio", - "value": 500000 - }, - { - "name": "curationTaxPercentage", - "value": 25000 - }, - { - "name": "minimumCurationDeposit", - "value": "1000000000000000000" - } - ], - "creationCodeHash": "0xa02709eb59b9cca8bee1271845b42db037dc1d042dad93410ba532d378a7c79f", - "runtimeCodeHash": "0xdb307489fd9a4a438b5b48909e12020b209280ad777561c0a7451655db097e75", - "txHash": "0x64d8d94e21f1923bd1793011ba28f24befd57b511622920716238b05595dac7d", - "proxy": true, - "implementation": { - "address": "0x6D2b24947680FCE35D5C9dD6a4E32649f12C176C", - "creationCodeHash": "0xc2cd643f03276d83683181a440107e4d8302f5adbf6ee4b0e84d231a488f0efb", - "runtimeCodeHash": "0xe8c368487594eec5451e6524f281c4c36dc0eef4435cd138f056fc56ba8c7ded", - "txHash": "0x98047232feb728594e7676092015a7fb9e4a0b7b6ae5aad2ebad7d1653ce7df8" - } - }, - "GNS": { - "address": "0xaDcA0dd4729c8BA3aCf3E99F3A9f471EF37b6825", - "initArgs": [ - { - "name": "controller", - "value": "0x24CCD4D3Ac8529fF08c58F74ff6755036E616117" - }, - { - "name": "bondingCurve", - "value": "0xd0C61e8F15d9deF697E1100663eD7dA74d3727dC" - }, - { - "name": "didRegistry", - "value": "0xdca7ef03e98e0dc2b855be647c39abe984fcf21b" - } - ], - "creationCodeHash": "0xa02709eb59b9cca8bee1271845b42db037dc1d042dad93410ba532d378a7c79f", - "runtimeCodeHash": "0xdb307489fd9a4a438b5b48909e12020b209280ad777561c0a7451655db097e75", - "txHash": "0x7ef90b0477e5c5d05bbd203af7d2bf15224640204e12abb07331df11425d2d00", - "proxy": true, - "implementation": { - "address": "0x28037b93702335E55fe6319e1C144B8A4d05DAEB", - "creationCodeHash": "0x94893fd38fff869e917edd9efecfbec10407d1484572b7dce9455fa88898c310", - "runtimeCodeHash": "0xd3367702add6bae5bbe1d8048cb34975ca8b53b560603b07694f1679a1418b24", - "txHash": "0x2b997e8470285c174732616c9977b13ad99959a7ea83c39d2647675853389f23" - } - }, - "Staking": { - "address": "0xF55041E37E12cD407ad00CE2910B8269B01263b9", - "initArgs": [ - { - "name": "controller", - "value": "0x24CCD4D3Ac8529fF08c58F74ff6755036E616117" - }, - { - "name": "minimumIndexerStake", - "value": "100000000000000000000000" - }, - { - "name": "thawingPeriod", - "value": 186092 - }, - { - "name": "protocolPercentage", - "value": 10000 - }, - { - "name": "curationPercentage", - "value": 100000 - }, - { - "name": "channelDisputeEpochs", - "value": 7 - }, - { - "name": "maxAllocationEpochs", - "value": 28 - }, - { - "name": "delegationUnbondingPeriod", - "value": 28 - }, - { - "name": "delegationRatio", - "value": 16 - }, - { - "name": "rebateAlphaNumerator", - "value": 77 - }, - { - "name": "rebateAlphaDenominator", - "value": 100 - } - ], - "creationCodeHash": "0xa02709eb59b9cca8bee1271845b42db037dc1d042dad93410ba532d378a7c79f", - "runtimeCodeHash": "0xdb307489fd9a4a438b5b48909e12020b209280ad777561c0a7451655db097e75", - "txHash": "0x6c92edf1c385983d57be0635cf40e1d1068d778edecf2be1631f51556c731af7", - "proxy": true, - "implementation": { - "address": "0x99660F23DAed72b92DE9A6431cE3C75c5427C602", - "creationCodeHash": "0xf216cc3aabb90fe6fb08dee63495cb39a61210f2c71e5fa1ffe8b041e20c2de4", - "runtimeCodeHash": "0xf10108b81764e0bb1bc1352ebb0e4bc252d20356e9c84bba09cd7a5c47c61969", - "txHash": "0x039091242d80032988a92636f30d81bc305ccc79d938fc140229c32f80b9b6d6", - "libraries": { - "LibCobbDouglas": "0x5Fd49E0c441A9Bd0b950E841f6F2d5fB22722568" - } - } - }, - "RewardsManager": { - "address": "0x9Ac758AB77733b4150A901ebd659cbF8cB93ED66", - "initArgs": [ - { - "name": "controller", - "value": "0x24CCD4D3Ac8529fF08c58F74ff6755036E616117" - }, - { - "name": "issuanceRate", - "value": "1000000012184945188" - } - ], - "creationCodeHash": "0xa02709eb59b9cca8bee1271845b42db037dc1d042dad93410ba532d378a7c79f", - "runtimeCodeHash": "0xdb307489fd9a4a438b5b48909e12020b209280ad777561c0a7451655db097e75", - "txHash": "0xd3a4d1b3e250e606f56417fd6e43d35bc794e793b1c5be4ffbecc3a43ca1b7b6", - "proxy": true, - "implementation": { - "address": "0xdBAfB0D805Df2A8017D87E1fb7C474DE7a301ceb", - "creationCodeHash": "0xf0732a52ccfb4fd2b4330415e37f88f4df821928e840d5aeeac3f23c4487b656", - "runtimeCodeHash": "0xd5d8d1983bac7fe7e78dbcf9818ce62af6ec94124bf930b0c0eafc2abcbd51eb", - "txHash": "0xa311c71cac9534b99b1564191778dd20c33eecb13ecc63c354fc11288629f9a0" - } - }, - "DisputeManager": { - "address": "0x97307b963662cCA2f7eD50e38dCC555dfFc4FB0b", - "initArgs": [ - { - "name": "controller", - "value": "0x24CCD4D3Ac8529fF08c58F74ff6755036E616117" - }, - { - "name": "arbitrator", - "value": "0xE1FDD398329C6b74C14cf19100316f0826a492d3" - }, - { - "name": "minimumDeposit", - "value": "10000000000000000000000" - }, - { - "name": "fishermanRewardPercentage", - "value": 500000 - }, - { - "name": "slashingPercentage", - "value": 25000 - } - ], - "creationCodeHash": "0xa02709eb59b9cca8bee1271845b42db037dc1d042dad93410ba532d378a7c79f", - "runtimeCodeHash": "0xdb307489fd9a4a438b5b48909e12020b209280ad777561c0a7451655db097e75", - "txHash": "0x90cd5852f5824f76d93814ffea26040ff503c81a84c4430e3688f219f9b48465", - "proxy": true, - "implementation": { - "address": "0x9C837aC7818D9d2653061579d479Cf691056517f", - "creationCodeHash": "0xde135df3aa4ce1144b2d623f42af601290c8c9838a7ecffb7e084cfd860d66e5", - "runtimeCodeHash": "0x126ff82d91cc4a00987d757db8d244edafb91507197b052441dcc94230e4b6ce", - "txHash": "0x3df6cec81fa4ebed4c7c4575c3cb645378f89ff38fcd547307d9a26820579617" - } - }, - "AllocationExchange": { - "address": "0x4a53cf3b3EdA545dc61dee0cA21eA8996C94385f", - "initArgs": [ - { - "name": "graphToken", - "value": "0xc944e90c64b2c07662a292be6244bdf05cda44a7" - }, - { - "name": "staking", - "value": "0xf55041e37e12cd407ad00ce2910b8269b01263b9" - }, - { - "name": "governor", - "value": "0x74db79268e63302d3fc69fb5a7627f7454a41732" - }, - { - "name": "authority", - "value": "0x79fd74da4c906509862c8fe93e87a9602e370bc4" - } - ], - "creationCodeHash": "0x1c7b0d7e81fc15f8ccc5b159e2cedb1f152653ebbce895b59eb74a1b26826fda", - "runtimeCodeHash": "0xa63c77e0724a5f679660358452e388f60379f1331e74542afb1436ffb213b960", - "txHash": "0x2ecd036c562f2503af9eaa1a9bca3729bd31ec8a91677530eefbecb398b793ba" - } - }, - "4": { - "IENS": { - "address": "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e" - }, - "IEthereumDIDRegistry": { - "address": "0xdCa7EF03e98e0DC2B855bE647C39ABe984fcF21B" - }, - "EpochManager": { - "address": "0x23090b246Ad47dB85352b666cAff36760D087a69", - "initArgs": [ - { - "name": "controller", - "value": "0x23B1aD50996ff1b21552cDD6430868D60bF342c5" - }, - { - "name": "lengthInBlocks", - "value": 1108 - } - ], - "creationCodeHash": "0xa02709eb59b9cca8bee1271845b42db037dc1d042dad93410ba532d378a7c79f", - "runtimeCodeHash": "0xdb307489fd9a4a438b5b48909e12020b209280ad777561c0a7451655db097e75", - "txHash": "0xcf271ece428e4e0539337bc2eb79c97a9d5337fae86d76f824ce6f92abb367ae", - "proxy": true, - "implementation": { - "address": "0x5fDB51B4126D28b176AC1FE41dd47f72F047eF63", - "creationCodeHash": "0xf03074bb7f026a2574b6ffb5d0f63f0c4fee81e004e1c46ef262dd5802d3384f", - "runtimeCodeHash": "0x0d078a0bf778c6c713c46979ac668161a0a0466356252e47082f80912e4495b2", - "txHash": "0xcc086cfaa1441412731ca073dfa68ca76d634b129b416dc75af7cea1b5292e52" - } - }, - "GraphToken": { - "address": "0x54Fe55d5d255b8460fB3Bc52D5D676F9AE5697CD", - "constructorArgs": [ - { - "name": "initialSupply", - "value": "10000000000000000000000000000" - } - ], - "creationCodeHash": "0x30da7a30d71fbd41d3327e4d0183401f257af3e905a0c68ebfd18b590b27b530", - "runtimeCodeHash": "0xb964f76194a04272e7582382a4d6bd6271bbb90deb5c1fd3ae3913504ea3a830", - "txHash": "0xfd3da9962b88397134b71259287bb056b60cdd092f91c114dcd7c794e6237c78" - }, - "ServiceRegistry": { - "address": "0xB2cD4D1205A55303ef0DeC2e4EfB5338f9c182bc", - "initArgs": [ - { - "name": "controller", - "value": "0x23B1aD50996ff1b21552cDD6430868D60bF342c5" - } - ], - "creationCodeHash": "0xa02709eb59b9cca8bee1271845b42db037dc1d042dad93410ba532d378a7c79f", - "runtimeCodeHash": "0xdb307489fd9a4a438b5b48909e12020b209280ad777561c0a7451655db097e75", - "txHash": "0x230cde8f618e46f42299e19dced8dcbe1f99b4ee8423441fc7572dea0f457935", - "proxy": true, - "implementation": { - "address": "0x4BaED79823A50c2b3387211f178235FEe8Cc7Ab7", - "creationCodeHash": "0xf5fa541b43d15fade518feb63a95a73b9c67626108ead259e444af3a7ae1804f", - "runtimeCodeHash": "0x9856d2c2985f410f2f77e456fe6163827ea5251eb5e3f3768d3d4f8868187882", - "txHash": "0xd17bdc8e05933c7146105e0e22ab5390677544cad224eb0dcd56c8088585d29a" - } - }, - "Curation": { - "address": "0x5cCaB32d30Ca0969a8f3D495e1F67b3A90d39b14", - "initArgs": [ - { - "name": "controller", - "value": "0x23B1aD50996ff1b21552cDD6430868D60bF342c5" - }, - { - "name": "bondingCurve", - "value": "0xB4B6857dFcE1a31851c0fAde87E94Fc05053916D" - }, - { - "name": "reserveRatio", - "value": 500000 - }, - { - "name": "curationTaxPercentage", - "value": 25000 - }, - { - "name": "minimumCurationDeposit", - "value": "1000000000000000000" - } - ], - "creationCodeHash": "0xa02709eb59b9cca8bee1271845b42db037dc1d042dad93410ba532d378a7c79f", - "runtimeCodeHash": "0xdb307489fd9a4a438b5b48909e12020b209280ad777561c0a7451655db097e75", - "txHash": "0x1d8707dc7b85d4fc7fe83819acc40b8e4b3ad0b3e8257a44edcc8fb587768dfb", - "proxy": true, - "implementation": { - "address": "0x3a40BC3B3b8bFE9526DfA55D9F2Cb09A24527040", - "creationCodeHash": "0xc2cd643f03276d83683181a440107e4d8302f5adbf6ee4b0e84d231a488f0efb", - "runtimeCodeHash": "0xe8c368487594eec5451e6524f281c4c36dc0eef4435cd138f056fc56ba8c7ded", - "txHash": "0x39e96512da6cbddf67331581c73ee8bde7a60a5ef27ebea775de063481c2693a" - } - }, - "GNS": { - "address": "0x4beb7299221807Cd47C2fa118c597C51Cc2fEC99", - "initArgs": [ - { - "name": "controller", - "value": "0x23B1aD50996ff1b21552cDD6430868D60bF342c5" - }, - { - "name": "bondingCurve", - "value": "0xB4B6857dFcE1a31851c0fAde87E94Fc05053916D" - }, - { - "name": "didRegistry", - "value": "0xdca7ef03e98e0dc2b855be647c39abe984fcf21b" - } - ], - "creationCodeHash": "0xa02709eb59b9cca8bee1271845b42db037dc1d042dad93410ba532d378a7c79f", - "runtimeCodeHash": "0xdb307489fd9a4a438b5b48909e12020b209280ad777561c0a7451655db097e75", - "txHash": "0x4b3882c3ed81f8b937f207e303d7c16074369da9c72e47212c8004ed799332d7", - "proxy": true, - "implementation": { - "address": "0xF3aDb841d6cE401b96D52AB3aDd1dc6B5d91C267", - "creationCodeHash": "0x94893fd38fff869e917edd9efecfbec10407d1484572b7dce9455fa88898c310", - "runtimeCodeHash": "0xd3367702add6bae5bbe1d8048cb34975ca8b53b560603b07694f1679a1418b24", - "txHash": "0x7509e3c6a415d971341256ab20f451e975d75f0a3db77ba26852bdaa9da0ab69" - } - }, - "RewardsManager": { - "address": "0x460cA3721131BC978e3CF3A49EfC545A2901A828", - "initArgs": [ - { - "name": "controller", - "value": "0x23B1aD50996ff1b21552cDD6430868D60bF342c5" - }, - { - "name": "issuanceRate", - "value": "1000000012184945188" - } - ], - "creationCodeHash": "0xa02709eb59b9cca8bee1271845b42db037dc1d042dad93410ba532d378a7c79f", - "runtimeCodeHash": "0xdb307489fd9a4a438b5b48909e12020b209280ad777561c0a7451655db097e75", - "txHash": "0xfff3ccaaeb64a173f9461416d6e3f37ae1e6d8beaeb17ca1e23c264c1d3bbc02", - "proxy": true, - "implementation": { - "address": "0x95A8223A914B875A85c50744b2529948674DDAbB", - "creationCodeHash": "0x99b681cf09ba7672e2018c0bde42e6a55886783140067798b2567edbe4901248", - "runtimeCodeHash": "0x8690d32e55efa3c662499914e9d7f2bc8a8976fcb97b75af62dfcfe26796b00f", - "txHash": "0xd302689147cb809b846f5be91d97932fcd4a6cb5d51ea9f2ae5d1774758c515e" - } - }, - "Staking": { - "address": "0x2d44C0e097F6cD0f514edAC633d82E01280B4A5c", - "initArgs": [ - { - "name": "controller", - "value": "0x23B1aD50996ff1b21552cDD6430868D60bF342c5" - }, - { - "name": "minimumIndexerStake", - "value": "100000000000000000000000" - }, - { - "name": "thawingPeriod", - "value": 6646 - }, - { - "name": "protocolPercentage", - "value": 10000 - }, - { - "name": "curationPercentage", - "value": 100000 - }, - { - "name": "channelDisputeEpochs", - "value": 2 - }, - { - "name": "maxAllocationEpochs", - "value": 6 - }, - { - "name": "delegationUnbondingPeriod", - "value": 6 - }, - { - "name": "delegationRatio", - "value": 16 - }, - { - "name": "rebateAlphaNumerator", - "value": 77 - }, - { - "name": "rebateAlphaDenominator", - "value": 100 - } - ], - "creationCodeHash": "0xa02709eb59b9cca8bee1271845b42db037dc1d042dad93410ba532d378a7c79f", - "runtimeCodeHash": "0xdb307489fd9a4a438b5b48909e12020b209280ad777561c0a7451655db097e75", - "txHash": "0x9febc188c44c0d9b1162c100833e59e72c1795d999c2ff906f723bfca118c12d", - "proxy": true, - "implementation": { - "address": "0x87E71E61edcA08cF2E601f6428216C40Ca83FDbC", - "creationCodeHash": "0xba1d87a98bc359a5eb14e96faad5ed8310fa56af89a12e3279ca8d8869d8e33b", - "runtimeCodeHash": "0xba1d87a98bc359a5eb14e96faad5ed8310fa56af89a12e3279ca8d8869d8e33b", - "txHash": "0xa9f323e151b92ccbe9729f63c723620cd07c51ff6093397e5c4e6b5861ce77f1", - "libraries": { - "LibCobbDouglas": "0x6EA2FD86890BAC2e6b34432b5c6d85354aad764F" - } - } - }, - "DisputeManager": { - "address": "0x4e4B04008C0f7875CDe80e7546d8b3b03Cf1eCf1", - "initArgs": [ - { - "name": "controller", - "value": "0x23B1aD50996ff1b21552cDD6430868D60bF342c5" - }, - { - "name": "arbitrator", - "value": "0xE1FDD398329C6b74C14cf19100316f0826a492d3" - }, - { - "name": "minimumDeposit", - "value": "10000000000000000000000" - }, - { - "name": "fishermanRewardPercentage", - "value": 500000 - }, - { - "name": "slashingPercentage", - "value": 25000 - } - ], - "creationCodeHash": "0xa02709eb59b9cca8bee1271845b42db037dc1d042dad93410ba532d378a7c79f", - "runtimeCodeHash": "0xdb307489fd9a4a438b5b48909e12020b209280ad777561c0a7451655db097e75", - "txHash": "0xb629195f313e8214e48f5a3fc741072d710f9f9ed6079331908341761f582760", - "proxy": true, - "implementation": { - "address": "0x9CD121b6018A78c08Fc72b9948A6a43E6CEfBC07", - "creationCodeHash": "0x7508a0ca0cb8f88ef54aa2cd1a464dc93a51b5cf500f763f7192a704985d91f3", - "runtimeCodeHash": "0xc8f0b38c011925dbf847c05e73e2b23e8e14553121d58600173ba61731b0a807", - "txHash": "0x7679f2bfab93883af93bdf1166a42d1b3a87c1cbb3fb3cff5c7f860644409fd5" - } - }, - "BancorFormula": { - "address": "0xB4B6857dFcE1a31851c0fAde87E94Fc05053916D", - "creationCodeHash": "0x17f6de9ab8a9bcf03a548c01d620a32caf1f29be8d90a9688ebee54295f857ef", - "runtimeCodeHash": "0x97a57f69b0029383398d02587a3a357168950d61622fe9f9710bf02b59740d63", - "txHash": "0x6cf07aed737aee71fa67c40864495124d7c6c6f203c3ed482cbdcc12f998dbb1" - }, - "Controller": { - "address": "0x23B1aD50996ff1b21552cDD6430868D60bF342c5", - "creationCodeHash": "0x7f37a1844c38fffd5390d2114804ffc4e5cf66dfb5c7bd67a32a4f5d10eebd2d", - "runtimeCodeHash": "0x929c62381fbed59483f832611752177cc2642e1e35fedeeb6cd9703e278448a0", - "txHash": "0x8cbcfe1f800f88c501f8bdeab8aaf36134e88757c28cbbe74d58c13be36832da" - }, - "GraphProxyAdmin": { - "address": "0xC96d71957bbB06f75e1b0ae9d22AC751BE14975C", - "creationCodeHash": "0x26a6f47e71ad242e264768571ce7223bf5a86fd0113ab6cb8200f65820232904", - "runtimeCodeHash": "0xd5330527cfb09df657adc879d8ad704ce6b8d5917265cabbd3eb073d1399f122", - "txHash": "0xca463b34d7967c4351d24b2af779817bd1da75e53a48957cfa32abd1ebf3a56c" - }, - "GraphGovernance": { - "address": "0x47241861A3918eaa9097c0345bb5A91660D7AEE1", - "initArgs": ["0x1679a1d1caf1252ba43fb8fc17ebf914a0c725ae"], - "creationCodeHash": "0xa02709eb59b9cca8bee1271845b42db037dc1d042dad93410ba532d378a7c79f", - "runtimeCodeHash": "0xdb307489fd9a4a438b5b48909e12020b209280ad777561c0a7451655db097e75", - "txHash": "0x5101e33eb13504780b225a2557a7062bef93cada0838937e02e879fb3d5c2c01", - "proxy": true, - "implementation": { - "address": "0xa96F8468362e6A109ABFaAF6BBfDa303347B450e", - "creationCodeHash": "0x5bd7ee7fbf6eb49914ffc91c747d18c0909ca18c495a8b163499ebfdd82b29d2", - "runtimeCodeHash": "0xd77099bdfc3f66aec158303be46e92f8e434271d6b0c7643753cd8ac96b460b9", - "txHash": "0xb12705249777b5d955dd25ea7aebf46c5d1e3062b10bc9a0a5755b40f55e11e9" - } - }, - "AllocationExchange": { - "address": "0x58ce0a0f41449e349c1a91dd9f3d9286bf32c161", - "initArgs": [ - { - "name": "graphToken", - "value": "0x54fe55d5d255b8460fb3bc52d5d676f9ae5697cd" - }, - { - "name": "staking", - "value": "0x2d44c0e097f6cd0f514edac633d82e01280b4a5c" - }, - { - "name": "governor", - "value": "0x87d11bd744b882b7bc5a6b5450cba8c35d90eb10" - }, - { - "name": "authority", - "value": "0x2c0c3c48190d7c69f469eb586aa75e4705cfa203" - } - ], - "creationCodeHash": "0x2f052eda2faa00c8dd54ec9bffab95be79075e528f24c3fa9f722c77dcc26d20", - "runtimeCodeHash": "0xec837eb756268aa8a18c5d3182a5c2bf89bd0369f1de07ffa33b1ec5d3bef41a", - "txHash": "0x359cf3945b2584f45633c6f6f37ce5a46129b462232107bb29c456d7fdcb66d0" - } - } -} diff --git a/cli/README.md b/cli/README.md deleted file mode 100644 index d191ca802..000000000 --- a/cli/README.md +++ /dev/null @@ -1,52 +0,0 @@ -# CLI - -## Setup - -These are convenience commands for interacting with the contracts. - -The CLI expect a `.env` file with the following setup: - -``` -MNEMONIC= -ETHERSCAN_API_KEY= -INFURA_KEY= -ADDRESS_BOOK="addresses.json" -GRAPH_CONFIG=""graph.config.yml"" -PROVIDER_URL="http://localhost:8545" -``` - -Also, run the following to create the proper typescript bindings for each contract: - -```sh -yarn build -``` - -## Usage - -Run the CLI with `./cli/cli.ts` from the project root folder. - -If will print a help with the available commands and parameters. - -## Organization - -The CLI is organized around commands and subcommands. These commands are defined in the `commands/` folder. - -Under the `commands/` there is one file per general command and a folder called `contracts` holding the commands for particular contract interactions. - -- `/cli` - - This folder is a CLI that allows for deploying contracts to ethereum networks. It uses yargs - - `/cli/cli.ts` - - This is the main entry point for the CLI. - - `/cli/commands/contracts` - - This has functions to call the contract functions directly to interact on chain. - - `/cli/commands/scenarios` - - This is where scenarios live. Scenarios are pre-planned interactions of many txs on chain. - They are useful for populating data in our contracts to see the subgraph, or to simulate - real world scenarios on chain - - There are also single files that provide a command for the CLI, which are: - - `deploy.ts` - helper to deploy a single contract. - - `migrate.ts` - helper to migrate all contracts for a new network on chain. - - `protocol.ts` - list, set or get any protocol parameter on any contract. - - `airdrop.ts` - distribute tokens to multiple addresses. - - `verify.ts` - verify a contract is on chain. - - `upgrade.ts` - helper to upgrade a proxy to use a new implementation. diff --git a/cli/address-book.ts b/cli/address-book.ts deleted file mode 100644 index 39818c82a..000000000 --- a/cli/address-book.ts +++ /dev/null @@ -1,66 +0,0 @@ -import fs from 'fs' -import { constants } from 'ethers' - -const { AddressZero } = constants - -export type AddressBookEntry = { - address: string - constructorArgs?: Array - initArgs?: Array - creationCodeHash?: string - runtimeCodeHash?: string - txHash?: string - proxy?: boolean - implementation?: AddressBookEntry - libraries?: { [libraryName: string]: string } -} - -export type AddressBookJson = { - [chainId: string]: { - [contractName: string]: AddressBookEntry - } -} - -export interface AddressBook { - listEntries: () => Array - getEntry: (contractName: string) => AddressBookEntry - setEntry: (contractName: string, entry: AddressBookEntry) => void -} - -export const getAddressBook = (path: string, chainId: string): AddressBook => { - if (!path) throw new Error(`A path the the address book file is required.`) - if (!chainId) throw new Error(`A chainId is required.`) - - const addressBook = JSON.parse(fs.readFileSync(path, 'utf8') || '{}') as AddressBookJson - - if (!addressBook[chainId]) { - addressBook[chainId] = {} - } - - const listEntries = (): Array => { - return Object.keys(addressBook[chainId]) - } - - const getEntry = (contractName: string): AddressBookEntry => { - try { - return addressBook[chainId][contractName] - } catch (e) { - return { address: AddressZero } - } - } - - const setEntry = (contractName: string, entry: AddressBookEntry): void => { - addressBook[chainId][contractName] = entry - try { - fs.writeFileSync(path, JSON.stringify(addressBook, null, 2)) - } catch (e) { - console.log(`Error saving artifacts: ${e.message}`) - } - } - - return { - listEntries, - getEntry, - setEntry, - } -} diff --git a/cli/artifacts.ts b/cli/artifacts.ts deleted file mode 100644 index 35ddc7738..000000000 --- a/cli/artifacts.ts +++ /dev/null @@ -1,23 +0,0 @@ -import path from 'path' -import { Artifacts } from 'hardhat/internal/artifacts' -import { LinkReferences } from 'hardhat/types' -import { utils } from 'ethers' - -type Abi = Array - -type Artifact = { - contractName: string - abi: Abi - bytecode: string - deployedBytecode: string - linkReferences?: LinkReferences - deployedLinkReferences?: LinkReferences -} - -const ARTIFACTS_PATH = path.resolve('build/contracts') - -const artifacts = new Artifacts(ARTIFACTS_PATH) - -export const loadArtifact = (name: string): Artifact => { - return artifacts.readArtifactSync(name) -} diff --git a/cli/cli.ts b/cli/cli.ts deleted file mode 100755 index 102c52937..000000000 --- a/cli/cli.ts +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env ts-node -import * as dotenv from 'dotenv' -import yargs from 'yargs' - -import { deployCommand } from './commands/deploy' -import { migrateCommand } from './commands/migrate' -import { proxyCommand } from './commands/proxy' -import { protocolCommand } from './commands/protocol' -import { contractsCommand } from './commands/contracts' -import { simulationCommand } from './commands/simulations' -import { airdropCommand } from './commands/airdrop' - -import { cliOpts } from './defaults' - -dotenv.config() - -yargs - .env(true) - .option('a', cliOpts.addressBook) - .option('m', cliOpts.mnemonic) - .option('p', cliOpts.providerUrl) - .option('n', cliOpts.accountNumber) - .command(deployCommand) - .command(migrateCommand) - .command(proxyCommand) - .command(protocolCommand) - .command(contractsCommand) - .command(simulationCommand) - .command(airdropCommand) - .demandCommand(1, 'Choose a command from the above list') - .help().argv diff --git a/cli/commands/airdrop.ts b/cli/commands/airdrop.ts deleted file mode 100644 index 980acc773..000000000 --- a/cli/commands/airdrop.ts +++ /dev/null @@ -1,294 +0,0 @@ -import inquirer from 'inquirer' -import fs from 'fs' -import PQueue from 'p-queue' -import yargs, { Argv } from 'yargs' -import { parseGRT, formatGRT } from '@graphprotocol/common-ts' - -import { utils, BigNumber, Contract } from 'ethers' -import { NonceManager } from '@ethersproject/experimental' - -import { logger } from '../logging' -import { sendTransaction } from '../network' -import { loadEnv, CLIArgs, CLIEnvironment } from '../env' - -const { getAddress } = utils - -const DISPERSE_CONTRACT_ADDRESS = { - 1: '0xD152f549545093347A162Dce210e7293f1452150', - 4: '0xD152f549545093347A162Dce210e7293f1452150', - 1337: '0xD152f549545093347A162Dce210e7293f1452150', -} - -const DISPERSE_CONTRACT_ABI = [ - { - constant: false, - inputs: [ - { name: 'token', type: 'address' }, - { name: 'recipients', type: 'address[]' }, - { name: 'values', type: 'uint256[]' }, - ], - name: 'disperseTokenSimple', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { name: 'token', type: 'address' }, - { name: 'recipients', type: 'address[]' }, - { name: 'values', type: 'uint256[]' }, - ], - name: 'disperseToken', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { name: 'recipients', type: 'address[]' }, - { name: 'values', type: 'uint256[]' }, - ], - name: 'disperseEther', - outputs: [], - payable: true, - stateMutability: 'payable', - type: 'function', - }, -] - -interface AirdropRecipient { - address: string - amount: BigNumber - txHash?: string -} - -const sure = async (message = 'Are you sure?'): Promise => { - // Warn about changing ownership - const res = await inquirer.prompt({ - name: 'confirm', - type: 'confirm', - message, - }) - if (!res.confirm) { - logger.info('Cancelled') - return false - } - return true -} - -const getDisperseContract = (chainID: number, provider) => { - return new Contract(DISPERSE_CONTRACT_ADDRESS[chainID], DISPERSE_CONTRACT_ABI, provider) -} - -const loadRecipients = (path: string): Array => { - const data = fs.readFileSync(path, 'utf8') - const lines = data.split('\n').map((e) => e.trim()) - - const results: Array = [] - for (const line of lines) { - const [address, amount, txHash] = line.split(',').map((e) => e.trim()) - - // Skip any empty value - if (!address) continue - - // Test for zero amount and fail - const weiAmount = parseGRT(amount) - if (weiAmount.eq(0)) { - logger.crit(`Error loading address "${address}" - amount is zero`) - process.exit(0) - } - - // Validate address format - try { - getAddress(address) - } catch (err) { - // Full stop on error - logger.crit(`Error loading address "${address}" please review the input file`) - process.exit(1) - } - results.push({ address, amount: weiAmount, txHash }) - } - return results -} - -const sumTotalAmount = (recipients: Array): BigNumber => { - let total = BigNumber.from(0) - for (const recipient of recipients) { - total = total.add(recipient.amount) - } - return total -} - -const saveResumeList = (path: string, txHash: string, recipients: Array) => { - for (const recipient of recipients) { - const line = [recipient.address, formatGRT(recipient.amount), txHash].join(',') + '\n' - fs.writeFileSync(path, line, { - flag: 'a+', - }) - } -} - -const loadResumeList = (path: string): Array => { - try { - return loadRecipients(path) - } catch (err) { - if (err.code === 'ENOENT') { - logger.warn('No existing resumefile, one will be created') - return [] - } else { - throw err - } - } -} - -const createBatches = ( - items: Array, - batchSize = 10, -): Array> => { - const remainingItems = Object.assign([], items) - const batches = [] - while (remainingItems.length > 0) { - const batchItems = remainingItems.splice(0, batchSize) - batches.push(batchItems) - if (batchItems.length < batchSize) { - break - } - } - return batches -} - -export const airdrop = async (cli: CLIEnvironment, cliArgs: CLIArgs): Promise => { - const graphToken = cli.contracts.GraphToken - - // Load data - const resumeList = loadResumeList(cliArgs.resumefile).map((r) => r.address) - const recipients = loadRecipients(cliArgs.recipients).filter( - (r) => !resumeList.includes(r.address), - ) - const totalAmount = sumTotalAmount(recipients) - - // Summary - logger.info(`# Batch Size: ${cliArgs.batchSize}`) - logger.info(`# Concurrency: ${cliArgs.concurrency}`) - logger.info(`> Token: ${graphToken.address}`) - logger.info(`> Distributing: ${formatGRT(totalAmount)} tokens (${totalAmount} wei)`) - logger.info(`> Resumelist: ${resumeList.length} addresses`) - logger.info(`> Recipients: ${recipients.length} addresses\n`) - - // Validity check - if (totalAmount.eq(0)) { - logger.crit('Cannot proceed with a distribution of zero tokens') - process.exit(1) - } - - // Load airdrop contract - const disperseContract = getDisperseContract(cli.chainId, cli.wallet.provider) - if (!disperseContract.address) { - logger.crit('Disperse contract not found. Please review your network settings.') - process.exit(1) - } - - // Confirmation - logger.info('Are you sure you want to proceed with the distribution?') - if (!(await sure())) { - process.exit(1) - } - - // Approve - logger.info('## Token approval') - const allowance = ( - await graphToken.functions['allowance'](cli.wallet.address, disperseContract.address) - )[0] - if (allowance.gte(totalAmount)) { - logger.info('Already have enough allowance, no need to approve more...') - } else { - logger.info( - `Approve disperse:${disperseContract.address} for ${formatGRT( - totalAmount, - )} tokens (${totalAmount} wei)`, - ) - await sendTransaction(cli.wallet, graphToken, 'approve', [ - disperseContract.address, - totalAmount, - ]) - } - - // Distribute - logger.info('## Distribution') - const queue = new PQueue({ concurrency: cliArgs.concurrency }) - const recipientsBatches = createBatches(recipients, cliArgs.batchSize) - const nonceManager = new NonceManager(cli.wallet) // Use NonceManager to send concurrent txs - - let batchNum = 0 - let recipientsCount = 0 - for (const batch of recipientsBatches) { - queue.add(async () => { - const addressList = batch.map((r) => r.address) - const amountList = batch.map((r) => r.amount) - - recipientsCount += addressList.length - batchNum++ - logger.info(`Sending batch #${batchNum} : ${recipientsCount}/${recipients.length}`) - for (const recipient of batch) { - logger.info( - ` > Transferring ${recipient.address} => ${formatGRT(recipient.amount)} (${ - recipient.amount - } wei)`, - ) - } - try { - const receipt = await sendTransaction(nonceManager, disperseContract, 'disperseToken', [ - graphToken.address, - addressList, - amountList, - ]) - saveResumeList(cliArgs.resumefile, receipt.transactionHash, batch) - } catch (err) { - logger.error(`Failed to send #${batchNum}`, err) - } - }) - } - await queue.onIdle() -} - -export const airdropCommand = { - command: 'airdrop', - describe: 'Airdrop tokens', - builder: (yargs: Argv): yargs.Argv => { - return yargs - .option('recipients', { - description: 'Path to the file with information for the airdrop. CSV file address,amount', - type: 'string', - requiresArg: true, - demandOption: true, - }) - .option('resumefile', { - description: - 'Path to the file used for resuming. Stores results with CSV format: address,amount,txHash', - type: 'string', - requiresArg: true, - demandOption: true, - }) - .option('batch-size', { - description: 'Number of addresses to send in a single transaction', - type: 'number', - requiresArg: true, - demandOption: true, - default: 100, - }) - .option('concurrency', { - description: 'Number of simultaneous transfers', - type: 'number', - requiresArg: true, - demandOption: false, - default: 1, - }) - }, - handler: async (argv: CLIArgs): Promise => { - return airdrop(await loadEnv(argv), argv) - }, -} diff --git a/cli/commands/contracts/any.ts b/cli/commands/contracts/any.ts deleted file mode 100644 index 647f71c87..000000000 --- a/cli/commands/contracts/any.ts +++ /dev/null @@ -1,59 +0,0 @@ -import yargs, { Argv } from 'yargs' -import { ContractFunction } from 'ethers' - -import { logger } from '../../logging' -import { getContractAt, sendTransaction } from '../../network' -import { loadEnv, CLIArgs, CLIEnvironment } from '../../env' - -export const any = async (cli: CLIEnvironment, cliArgs: CLIArgs): Promise => { - const contract = cliArgs.contract - const func = cliArgs.func - const addressEntry = cli.addressBook.getEntry(contract) - const params = cliArgs.params ? cliArgs.params.toString().split(',') : [] - const attachedContract = getContractAt(contract, addressEntry.address).connect(cli.wallet) - - if (cliArgs.type == 'get') { - logger.info(`Getting ${func}...`) - const contractFn: ContractFunction = attachedContract.functions[func] - const value = await contractFn(...params) - logger.info(`${func} = ${value}`) - } else if (cliArgs.type == 'set') { - logger.info(`Setting ${func}...`) - await sendTransaction(cli.wallet, attachedContract, func, params) - } -} - -export const anyCommand = { - command: 'any', - describe: 'Call a getter or a setter, on any contract', - builder: (yargs: Argv): yargs.Argv => { - return yargs - .option('type', { - description: 'Choose get or set', - type: 'string', - requiresArg: true, - demandOption: true, - }) - .option('contract', { - description: 'Name of contract, case sensitive', - type: 'string', - requiresArg: true, - demandOption: true, - }) - .option('func', { - description: 'Name of function', - type: 'string', - requiresArg: true, - demandOption: true, - }) - .option('params', { - description: 'All parameters, comma separated', - type: 'string', - requiresArg: true, - demandOption: false, - }) - }, - handler: async (argv: CLIArgs): Promise => { - return any(await loadEnv(argv), argv) - }, -} diff --git a/cli/commands/contracts/curation.ts b/cli/commands/contracts/curation.ts deleted file mode 100644 index 2c5abe7c6..000000000 --- a/cli/commands/contracts/curation.ts +++ /dev/null @@ -1,86 +0,0 @@ -import yargs, { Argv } from 'yargs' -import { parseGRT } from '@graphprotocol/common-ts' - -import { logger } from '../../logging' -import { sendTransaction } from '../../network' -import { loadEnv, CLIArgs, CLIEnvironment } from '../../env' - -export const mint = async (cli: CLIEnvironment, cliArgs: CLIArgs): Promise => { - const subgraphID = cliArgs.subgraphID - const amount = parseGRT(cliArgs.amount) - - const curation = cli.contracts.Curation - const graphToken = cli.contracts.GraphToken - - logger.info('First calling approve() to ensure curation contract can call transferFrom()...') - await sendTransaction(cli.wallet, graphToken, 'approve', [curation.address, amount]) - logger.info(`Signaling on ${subgraphID} with ${cliArgs.amount} tokens...`) - await sendTransaction(cli.wallet, curation, 'mint', [subgraphID, amount, 0], { - gasLimit: 2000000, - }) -} -export const burn = async (cli: CLIEnvironment, cliArgs: CLIArgs): Promise => { - const subgraphID = cliArgs.subgraphID - const amount = parseGRT(cliArgs.amount) - const curation = cli.contracts.Curation - - logger.info(`Burning signal on ${subgraphID} with ${cliArgs.amount} tokens...`) - await sendTransaction(cli.wallet, curation, 'burn', [subgraphID, amount, 0]) -} - -export const curationCommand = { - command: 'curation', - describe: 'Curation contract calls', - builder: (yargs: Argv): yargs.Argv => { - return yargs - .command({ - command: 'mint', - describe: 'Mint signal for a subgraph deployment', - builder: (yargs: Argv) => { - return yargs - .option('s', { - alias: 'subgraphID', - description: 'The subgraph deployment ID being curated on', - type: 'string', - requiresArg: true, - demandOption: true, - }) - .option('amount', { - description: 'Amount of tokens being signaled. CLI converts to a BN with 10^18', - type: 'string', - requiresArg: true, - demandOption: true, - }) - }, - handler: async (argv: CLIArgs): Promise => { - return mint(await loadEnv(argv), argv) - }, - }) - .command({ - command: 'burn', - describe: 'Burn signal of a subgraph deployment', - builder: (yargs: Argv) => { - return yargs - .option('s', { - alias: 'subgraphID', - description: 'The subgraph deployment ID being curated on', - type: 'string', - requiresArg: true, - demandOption: true, - }) - .option('amount', { - description: 'Amount of shares being redeemed. CLI converts to a BN with 10^18', - type: 'string', - requiresArg: true, - demandOption: true, - }) - }, - handler: async (argv: CLIArgs): Promise => { - return burn(await loadEnv(argv), argv) - }, - }) - }, - handler: (): void => { - yargs.showHelp() - }, -} diff --git a/cli/commands/contracts/disputeManager.ts b/cli/commands/contracts/disputeManager.ts deleted file mode 100644 index 2a2c5ed69..000000000 --- a/cli/commands/contracts/disputeManager.ts +++ /dev/null @@ -1,240 +0,0 @@ -import yargs, { Argv } from 'yargs' -import { constants, utils, Wallet } from 'ethers' -import { createAttestation, Attestation, Receipt } from '@graphprotocol/common-ts' - -import { logger } from '../../logging' -import { sendTransaction, getChainID, getProvider, toGRT, randomHexBytes } from '../../network' -import { loadEnv, CLIArgs, CLIEnvironment } from '../../env' - -const { HashZero } = constants -const { defaultAbiCoder: abi, arrayify, concat, hexlify } = utils - -interface ChannelKey { - privKey: string - pubKey: string - address: string -} - -async function buildAttestation(receipt: Receipt, signer: string, disputeManagerAddress: string) { - const attestation = await createAttestation(signer, getChainID(), disputeManagerAddress, receipt) - return attestation -} - -export const deriveChannelKey = (): ChannelKey => { - const w = Wallet.createRandom() - return { privKey: w.privateKey, pubKey: w.publicKey, address: utils.computeAddress(w.publicKey) } -} - -function encodeAttestation(attestation: Attestation): string { - const data = arrayify( - abi.encode( - ['bytes32', 'bytes32', 'bytes32'], - [attestation.requestCID, attestation.responseCID, attestation.subgraphDeploymentID], - ), - ) - const sig = concat([ - arrayify(hexlify(attestation.v)), - arrayify(attestation.r), - arrayify(attestation.s), - ]) - return hexlify(concat([data, sig])) -} - -async function setupIndexer( - cli: CLIEnvironment, - cliArgs: CLIArgs, - indexerChannelKey: ChannelKey, - receipt: Receipt, - accountIndex: number, -) { - const indexer = Wallet.fromMnemonic(cliArgs.mnemonic, `m/44'/60'/0'/0/${accountIndex}`).connect( - getProvider(cliArgs.providerUrl), - ) - - const grt = cli.contracts.GraphToken - const staking = cli.contracts.Staking - - const indexerTokens = toGRT('100000') - const indexerAllocatedTokens = toGRT('10000') - const metadata = HashZero - - logger.info('Transferring tokens to the indexer...') - await sendTransaction(cli.wallet, grt, 'transfer', [indexer.address, indexerTokens]) - logger.info('Approving the staking address to pull tokens...') - await sendTransaction(cli.wallet, grt, 'approve', [staking.address, indexerTokens]) - logger.info('Staking...') - await sendTransaction(cli.wallet, staking, 'stake', [indexerTokens]) - logger.info('Allocating...') - await sendTransaction(cli.wallet, staking, 'allocate', [ - receipt.subgraphDeploymentID, - indexerAllocatedTokens, - indexerChannelKey.address, - metadata, - ]) -} - -// This just creates any query dispute conflict to test the subgraph, no real data is sent -export const createTestQueryDisputeConflict = async ( - cli: CLIEnvironment, - cliArgs: CLIArgs, -): Promise => { - // Derive some channel keys for each indexer used to sign attestations - const indexer1ChannelKey = deriveChannelKey() - const indexer2ChannelKey = deriveChannelKey() - - // Create an attesation receipt for the dispute - const receipt: Receipt = { - requestCID: randomHexBytes(), - responseCID: randomHexBytes(), - subgraphDeploymentID: randomHexBytes(), - } - - const receipt1 = receipt - const receipt2 = { ...receipt1, responseCID: randomHexBytes() } - - await setupIndexer(cli, cliArgs, indexer1ChannelKey, receipt1, 1) - await setupIndexer(cli, cliArgs, indexer2ChannelKey, receipt2, 2) - - const disputeManager = cli.contracts.DisputeManager - const disputeManagerAddr = disputeManager.address - - const attestation1 = await buildAttestation( - receipt1, - indexer1ChannelKey.privKey, - disputeManagerAddr, - ) - const attestation2 = await buildAttestation( - receipt2, - indexer2ChannelKey.privKey, - disputeManagerAddr, - ) - - logger.info(`Creating conflicting attestations...`) - await sendTransaction(cli.wallet, disputeManager, 'createQueryDisputeConflict', [ - encodeAttestation(attestation1), - encodeAttestation(attestation2), - ]) -} - -// This just creates any indexing dispute to test the subgraph, no real data is sent -export const createTestIndexingDispute = async ( - cli: CLIEnvironment, - cliArgs: CLIArgs, -): Promise => { - // Derive some channel keys for each indexer used to sign attestations - const indexerChannelKey = deriveChannelKey() - - // Create an attesation receipt for the dispute - const receipt: Receipt = { - requestCID: randomHexBytes(), - responseCID: randomHexBytes(), - subgraphDeploymentID: randomHexBytes(), - } - - await setupIndexer(cli, cliArgs, indexerChannelKey, receipt, 0) - - // min deposit is 100 GRT, so we do 1000 for safe measure - const deposit = toGRT('1000') - const disputeManager = cli.contracts.DisputeManager - const grt = cli.contracts.GraphToken - - logger.info('Approving the dispute address to pull tokens...') - await sendTransaction(cli.wallet, grt, 'approve', [disputeManager.address, deposit]) - - logger.info(`Creating indexing dispute...`) - await sendTransaction(cli.wallet, disputeManager, 'createIndexingDispute', [ - indexerChannelKey.address, - deposit, - ]) -} - -export const accept = async (cli: CLIEnvironment, cliArgs: CLIArgs): Promise => { - const disputeManager = cli.contracts.DisputeManager - const disputeID = cliArgs.disputeID - logger.info(`Accepting...`) - await sendTransaction(cli.wallet, disputeManager, 'acceptDispute', ...[disputeID]) -} - -export const reject = async (cli: CLIEnvironment, cliArgs: CLIArgs): Promise => { - const disputeManager = cli.contracts.DisputeManager - const disputeID = cliArgs.disputeID - logger.info(`Rejecting...`) - await sendTransaction(cli.wallet, disputeManager, 'rejectDispute', ...[disputeID]) -} - -export const draw = async (cli: CLIEnvironment, cliArgs: CLIArgs): Promise => { - const disputeManager = cli.contracts.DisputeManager - const disputeID = cliArgs.disputeID - logger.info(`Drawing...`) - await sendTransaction(cli.wallet, disputeManager, 'drawDispute', ...[disputeID]) -} - -export const disputeManagerCommand = { - command: 'disputeManager', - describe: 'Dispute manager calls', - builder: (yargs: Argv): yargs.Argv => { - return yargs - .command({ - command: 'query-dispute-conflict-test', - describe: 'Just create any query dispute to test the subgraph', - handler: async (argv: CLIArgs): Promise => { - return createTestQueryDisputeConflict(await loadEnv(argv), argv) - }, - }) - .command({ - command: 'indexing-dispute-test', - describe: 'Just create any query dispute to test the subgraph', - handler: async (argv: CLIArgs): Promise => { - return createTestIndexingDispute(await loadEnv(argv), argv) - }, - }) - .command({ - command: 'accept', - describe: 'Accept a dispute', - builder: (yargs: Argv) => { - return yargs.option('disputeID', { - description: 'The Dispute ID in question', - type: 'string', - requiresArg: true, - demandOption: true, - }) - }, - handler: async (argv: CLIArgs): Promise => { - return accept(await loadEnv(argv), argv) - }, - }) - .command({ - command: 'reject', - describe: 'Reject a dispute', - builder: (yargs: Argv) => { - return yargs.option('disputeID', { - description: 'The Dispute ID in question', - type: 'string', - requiresArg: true, - demandOption: true, - }) - }, - handler: async (argv: CLIArgs): Promise => { - return reject(await loadEnv(argv), argv) - }, - }) - .command({ - command: 'draw', - describe: 'Draw a dispute', - builder: (yargs: Argv) => { - return yargs.option('disputeID', { - description: 'The Dispute ID in question', - type: 'string', - requiresArg: true, - demandOption: true, - }) - }, - handler: async (argv: CLIArgs): Promise => { - return draw(await loadEnv(argv), argv) - }, - }) - }, - handler: (): void => { - yargs.showHelp() - }, -} diff --git a/cli/commands/contracts/ens.ts b/cli/commands/contracts/ens.ts deleted file mode 100644 index 48a990d0f..000000000 --- a/cli/commands/contracts/ens.ts +++ /dev/null @@ -1,74 +0,0 @@ -import yargs, { Argv } from 'yargs' -import { utils } from 'ethers' - -import { sendTransaction } from '../../network' -import { loadEnv, CLIArgs, CLIEnvironment } from '../../env' -import { logger } from '../../logging' - -export const registerTestName = async (cli: CLIEnvironment, cliArgs: CLIArgs): Promise => { - const name = cliArgs.name - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const testRegistrar = (cli.contracts as any).ITestRegistrar - const normalizedName = name.toLowerCase() - const labelNameFull = `${normalizedName}.${'eth'}` - const labelHashFull = utils.namehash(labelNameFull) - const label = utils.keccak256(utils.toUtf8Bytes(normalizedName)) - logger.info(`Namehash for ${labelNameFull}: ${labelHashFull}`) - logger.info(`Registering ${name} with ${cli.walletAddress} on the test registrar`) - await sendTransaction(cli.wallet, testRegistrar, 'register', [label, cli.walletAddress]) -} -export const checkOwner = async (cli: CLIEnvironment, cliArgs: CLIArgs): Promise => { - const name = cliArgs.name - const ens = cli.contracts.IENS - const node = nameToNode(name) - const res = await ens.owner(node) - logger.info(`owner = ${res}`) -} - -export const nameToNode = (name: string): string => { - const node = utils.namehash(`${name}.eth`) - logger.info(`Name: ${name}`) - logger.info(`Node: ${node}`) - return node -} - -export const ensCommand = { - command: 'ens', - describe: 'ENS contract calls', - builder: (yargs: Argv): yargs.Argv => { - return yargs - .command({ - command: 'registerTestName', - describe: 'Register a name on the test registrar', - builder: (yargs: Argv) => { - return yargs.option('name', { - description: 'Name being registered', - type: 'string', - requiresArg: true, - demandOption: true, - }) - }, - handler: async (argv: CLIArgs): Promise => { - return registerTestName(await loadEnv(argv), argv) - }, - }) - .command({ - command: 'checkOwner', - describe: 'Check the owner of a name', - builder: (yargs: Argv) => { - return yargs.option('name', { - description: 'Name being checked', - type: 'string', - requiresArg: true, - demandOption: true, - }) - }, - handler: async (argv: CLIArgs): Promise => { - return checkOwner(await loadEnv(argv), argv) - }, - }) - }, - handler: (): void => { - yargs.showHelp() - }, -} diff --git a/cli/commands/contracts/ethereumDIDRegistry.ts b/cli/commands/contracts/ethereumDIDRegistry.ts deleted file mode 100644 index e9c85a9c3..000000000 --- a/cli/commands/contracts/ethereumDIDRegistry.ts +++ /dev/null @@ -1,89 +0,0 @@ -import * as fs from 'fs' -import yargs, { Argv } from 'yargs' - -import { IPFS } from '../../helpers' -import { sendTransaction } from '../../network' -import { loadEnv, CLIArgs, CLIEnvironment } from '../../env' -import { jsonToAccountMetadata } from '../../metadata' -import { logger } from '../../logging' - -const handleAccountMetadata = async (ipfs: string, path: string): Promise => { - const metadata = jsonToAccountMetadata(JSON.parse(fs.readFileSync(__dirname + path).toString())) - logger.info('Meta data:') - logger.info(' Code Repository: ', metadata.codeRepository || '') - logger.info(' Description: ', metadata.description || '') - logger.info(' Image: ', metadata.image || '') - logger.info(' Name: ', metadata.name || '') - logger.info(' Website: ', metadata.website || '') - logger.info(' Display name: ', metadata.displayName || '') - - const ipfsClient = IPFS.createIpfsClient(ipfs) - logger.info('\nUpload JSON meta data to IPFS...') - const result = await ipfsClient.add(Buffer.from(JSON.stringify(metadata))) - const metaHash = result[0].hash - try { - const data = JSON.parse(await ipfsClient.cat(metaHash)) - if (JSON.stringify(data) !== JSON.stringify(metadata)) { - throw new Error(`Original meta data and uploaded data are not identical`) - } - } catch (e) { - throw new Error(`Failed to retrieve and parse JSON meta data after uploading: ${e.message}`) - } - logger.info(`Upload metadata successful: ${metaHash}\n`) - return IPFS.ipfsHashToBytes32(metaHash) -} - -export const setAttribute = async (cli: CLIEnvironment, cliArgs: CLIArgs): Promise => { - const metadataPath = cliArgs.metadataPath - const ipfsEndpoint = cliArgs.ipfs - const ethereumDIDRegistry = cli.contracts.IEthereumDIDRegistry - // const name comes from: keccak256("GRAPH NAME SERVICE") - const name = '0x72abcb436eed911d1b6046bbe645c235ec3767c842eb1005a6da9326c2347e4c' - const metaHashBytes = await handleAccountMetadata(ipfsEndpoint, metadataPath) - - logger.info(`Setting attribute on ethereum DID registry ...`) - await sendTransaction(cli.wallet, ethereumDIDRegistry, 'setAttribute', [ - cli.walletAddress, - name, - metaHashBytes, - 0, - ]) -} - -export const ethereumDIDRegistryCommand = { - command: 'ethereumDIDRegistry', - describe: 'Calls into the Ethereum DID Registry Contract', - builder: (yargs: Argv): yargs.Argv => { - return yargs.command({ - command: 'setAttribute', - describe: 'Set metadata for graph account', - builder: (yargs: Argv) => { - return yargs - .option('i', { - alias: 'ipfs', - description: 'IPFS endpoint where file is being uploaded', - type: 'string', - requiresArg: true, - demandOption: true, - }) - .option('metadataPath', { - description: `filepath to metadata with the JSON format:\n - "codeRepository": "github.com/davekaj", - "description": "Dave Kajpusts graph account", - "image": "http://localhost:8080/ipfs/QmTFK5DZc58XrTqhuuDTYoaq29ndnwoHX5TAW1bZr5EMpq", - "name": "Dave Kajpust", - "website": "https://kajpust.com/"`, - type: 'string', - requiresArg: true, - demandOption: true, - }) - }, - handler: async (argv: CLIArgs): Promise => { - return setAttribute(await loadEnv(argv), argv) - }, - }) - }, - handler: (): void => { - yargs.showHelp() - }, -} diff --git a/cli/commands/contracts/gns.ts b/cli/commands/contracts/gns.ts deleted file mode 100644 index fec65debc..000000000 --- a/cli/commands/contracts/gns.ts +++ /dev/null @@ -1,371 +0,0 @@ -import yargs, { Argv } from 'yargs' -import { parseGRT } from '@graphprotocol/common-ts' - -import { logger } from '../../logging' -import { sendTransaction } from '../../network' -import { loadEnv, CLIArgs, CLIEnvironment } from '../../env' -import { nameToNode } from './ens' -import { IPFS, pinMetadataToIPFS } from '../../helpers' - -export const setDefaultName = async (cli: CLIEnvironment, cliArgs: CLIArgs): Promise => { - const graphAccount = cliArgs.graphAccount - const name = cliArgs.name - const nameSystem = 0 // 0 == ens - const node = nameToNode(name) - const gns = cli.contracts.GNS - - logger.info(`Setting default name as ${name} for ${graphAccount}...`) - await sendTransaction(cli.wallet, gns, 'setDefaultName', [graphAccount, nameSystem, node, name]) -} - -export const publishNewSubgraph = async (cli: CLIEnvironment, cliArgs: CLIArgs): Promise => { - const ipfs = cliArgs.ipfs - const graphAccount = cliArgs.graphAccount - const subgraphDeploymentID = cliArgs.subgraphDeploymentID - const versionPath = cliArgs.versionPath - const subgraphPath = cliArgs.subgraphPath - - const subgraphDeploymentIDBytes = IPFS.ipfsHashToBytes32(subgraphDeploymentID) - const versionHashBytes = await pinMetadataToIPFS(ipfs, 'version', versionPath) - const subgraphHashBytes = await pinMetadataToIPFS(ipfs, 'subgraph', subgraphPath) - const gns = cli.contracts.GNS - - logger.info(`Publishing new subgraph for ${graphAccount}`) - await sendTransaction(cli.wallet, gns, 'publishNewSubgraph', [ - graphAccount, - subgraphDeploymentIDBytes, - versionHashBytes, - subgraphHashBytes, - ]) -} - -export const publishNewVersion = async (cli: CLIEnvironment, cliArgs: CLIArgs): Promise => { - const ipfs = cliArgs.ipfs - const graphAccount = cliArgs.graphAccount - const subgraphDeploymentID = cliArgs.subgraphDeploymentID - const versionPath = cliArgs.versionPath - const subgraphNumber = cliArgs.subgraphNumber - - const subgraphDeploymentIDBytes = IPFS.ipfsHashToBytes32(subgraphDeploymentID) - const versionHashBytes = await pinMetadataToIPFS(ipfs, 'version', versionPath) - const gns = cli.contracts.GNS - - logger.info(`Publishing new subgraph version for ${graphAccount}`) - await sendTransaction(cli.wallet, gns, 'publishNewVersion', [ - graphAccount, - subgraphNumber, - subgraphDeploymentIDBytes, - versionHashBytes, - ]) -} - -export const deprecate = async (cli: CLIEnvironment, cliArgs: CLIArgs): Promise => { - const graphAccount = cliArgs.graphAccount - const subgraphNumber = cliArgs.subgraphNumber - const gns = cli.contracts.GNS - logger.info(`Deprecating subgraph ${graphAccount}-${subgraphNumber}...`) - await sendTransaction(cli.wallet, gns, 'deprecate', [graphAccount, subgraphNumber]) -} - -export const updateSubgraphMetadata = async ( - cli: CLIEnvironment, - cliArgs: CLIArgs, -): Promise => { - const ipfs = cliArgs.ipfs - const graphAccount = cliArgs.graphAccount - const subgraphNumber = cliArgs.subgraphNumber - const subgraphPath = cliArgs.subgraphPath - const subgraphHashBytes = await pinMetadataToIPFS(ipfs, 'subgraph', subgraphPath) - const gns = cli.contracts.GNS - - logger.info(`Updating subgraph metadata for ${graphAccount}-${subgraphNumber}...`) - await sendTransaction(cli.wallet, gns, 'updateSubgraphMetadata', [ - graphAccount, - subgraphNumber, - subgraphHashBytes, - ]) -} - -export const mintNSignal = async (cli: CLIEnvironment, cliArgs: CLIArgs): Promise => { - const graphAccount = cliArgs.graphAccount - const subgraphNumber = cliArgs.subgraphNumber - const tokens = parseGRT(cliArgs.tokens) - const gns = cli.contracts.GNS - - logger.info(`Minting nSignal for ${graphAccount}-${subgraphNumber}...`) - await sendTransaction(cli.wallet, gns, 'mintNSignal', [graphAccount, subgraphNumber, tokens]) -} - -export const burnNSignal = async (cli: CLIEnvironment, cliArgs: CLIArgs): Promise => { - const graphAccount = cliArgs.graphAccount - const subgraphNumber = cliArgs.subgraphNumber - const nSignal = cliArgs.nSignal - const gns = cli.contracts.GNS - - logger.info(`Burning nSignal from ${graphAccount}-${subgraphNumber}...`) - await sendTransaction(cli.wallet, gns, 'burnNSignal', [graphAccount, subgraphNumber, nSignal]) -} - -export const withdrawGRT = async (cli: CLIEnvironment, cliArgs: CLIArgs): Promise => { - const graphAccount = cliArgs.graphAccount - const subgraphNumber = cliArgs.subgraphNumber - const gns = cli.contracts.GNS - - logger.info(`Withdrawing locked GRT from subgraph ${graphAccount}-${subgraphNumber}...`) - await sendTransaction(cli.wallet, gns, 'withdrawGRT', [graphAccount, subgraphNumber]) -} - -export const gnsCommand = { - command: 'gns', - describe: 'GNS contract calls', - builder: (yargs: Argv): yargs.Argv => { - return yargs - .command({ - command: 'setDefaultName', - describe: 'Set default name for the graph explorer', - builder: (yargs: Argv) => { - return yargs - .option('graphAccount', { - description: 'Graph account getting its name set', - type: 'string', - requiresArg: true, - demandOption: true, - }) - .option('name', { - description: 'Name on ENS being registered', - type: 'string', - requiresArg: true, - demandOption: true, - }) - }, - handler: async (argv: CLIArgs): Promise => { - return setDefaultName(await loadEnv(argv), argv) - }, - }) - .command({ - command: 'publishNewSubgraph', - describe: 'Publish a new subgraph to the GNS', - builder: (yargs: Argv) => { - return yargs - .option('ipfs', { - description: 'ipfs endpoint. ex. https://api.thegraph.com/ipfs/', - type: 'string', - requiresArg: true, - demandOption: true, - }) - .option('graphAccount', { - description: 'graph account address', - type: 'string', - requiresArg: true, - demandOption: true, - }) - .option('subgraphDeploymentID', { - description: 'subgraph deployment ID in base58', - type: 'string', - requiresArg: true, - demandOption: true, - }) - .option('versionPath', { - description: ` filepath to metadata. With JSON format:\n - "description": "", - "label": ""`, - type: 'string', - requiresArg: true, - demandOption: true, - }) - .option('subgraphPath', { - description: ` filepath to metadata. With JSON format:\n - "description": "", - "displayName": "", - "image": "", - "codeRepository": "", - "website": "",`, - type: 'string', - requiresArg: true, - demandOption: true, - }) - }, - handler: async (argv: CLIArgs): Promise => { - return publishNewSubgraph(await loadEnv(argv), argv) - }, - }) - .command({ - command: 'publishNewVersion', - describe: 'Withdraw unlocked GRT', - builder: (yargs: Argv) => { - return yargs - .option('ipfs', { - description: 'ipfs endpoint. ex. https://api.thegraph.com/ipfs/', - type: 'string', - requiresArg: true, - demandOption: true, - }) - .option('graphAccount', { - description: 'graph account address', - type: 'string', - requiresArg: true, - demandOption: true, - }) - .option('subgraphDeploymentID', { - description: 'subgraph deployment ID in base58', - type: 'string', - requiresArg: true, - demandOption: true, - }) - .option('versionPath', { - description: ` filepath to metadata. With JSON format:\n - "description": "", - "label": ""`, - type: 'string', - requiresArg: true, - demandOption: true, - }) - .option('subgraphNumber', { - description: 'subgraph number the account is updating', - type: 'number', - requiresArg: true, - demandOption: true, - }) - }, - handler: async (argv: CLIArgs): Promise => { - return publishNewVersion(await loadEnv(argv), argv) - }, - }) - .command({ - command: 'deprecate', - describe: 'Deprecate a subgraph', - builder: (yargs: Argv) => { - return yargs - .option('graphAccount', { - description: 'graph account address', - type: 'string', - requiresArg: true, - demandOption: true, - }) - .option('subgraphNumber', { - description: 'subgraph number the account is deprecating', - type: 'string', - requiresArg: true, - demandOption: true, - }) - }, - handler: async (argv: CLIArgs): Promise => { - return deprecate(await loadEnv(argv), argv) - }, - }) - .command({ - command: 'updateSubgraphMetadata', - describe: 'Update a subgraphs metadata', - builder: (yargs: Argv) => { - return yargs - .option('graphAccount', { - description: 'graph account address', - type: 'string', - requiresArg: true, - demandOption: true, - }) - .option('subgraphNumber', { - description: 'subgraph number to update', - type: 'string', - requiresArg: true, - demandOption: true, - }) - .option('subgraphPath', { - description: ` filepath to metadata. With JSON format:\n - "description": "", - "displayName": "", - "image": "", - "codeRepository": "", - "website": "",`, - type: 'string', - requiresArg: true, - demandOption: true, - }) - }, - handler: async (argv: CLIArgs): Promise => { - return updateSubgraphMetadata(await loadEnv(argv), argv) - }, - }) - .command({ - command: 'mintNSignal', - describe: 'Mint Name Signal by depositing tokens', - builder: (yargs: Argv) => { - return yargs - .option('graphAccount', { - description: 'graph account address', - type: 'string', - requiresArg: true, - demandOption: true, - }) - .option('subgraphNumber', { - description: 'subgraph number of the name signal', - type: 'string', - requiresArg: true, - demandOption: true, - }) - .option('tokens', { - description: 'Amount of tokens to deposit', - type: 'string', - requiresArg: true, - demandOption: true, - }) - }, - handler: async (argv: CLIArgs): Promise => { - return mintNSignal(await loadEnv(argv), argv) - }, - }) - .command({ - command: 'burnNSignal', - describe: 'Burn Name Signal and receive tokens', - builder: (yargs: Argv) => { - return yargs - .option('graphAccount', { - description: 'graph account address', - type: 'string', - requiresArg: true, - demandOption: true, - }) - .option('subgraphNumber', { - description: 'subgraph number of the name signal', - type: 'string', - requiresArg: true, - demandOption: true, - }) - .option('nSignal', { - description: 'Amount of nSignal to burn', - type: 'string', - requiresArg: true, - demandOption: true, - }) - }, - handler: async (argv: CLIArgs): Promise => { - return burnNSignal(await loadEnv(argv), argv) - }, - }) - .command({ - command: 'withdrawGRT', - describe: 'Withdraw GRT from a deprecated subgraph', - builder: (yargs: Argv) => { - return yargs - .option('graphAccount', { - description: 'graph account address', - type: 'string', - requiresArg: true, - demandOption: true, - }) - .option('subgraphNumber', { - description: 'subgraph number to withdraw from', - type: 'string', - requiresArg: true, - demandOption: true, - }) - }, - handler: async (argv: CLIArgs): Promise => { - return withdrawGRT(await loadEnv(argv), argv) - }, - }) - }, - handler: (): void => { - yargs.showHelp() - }, -} diff --git a/cli/commands/contracts/governance.ts b/cli/commands/contracts/governance.ts deleted file mode 100644 index 412171ede..000000000 --- a/cli/commands/contracts/governance.ts +++ /dev/null @@ -1,121 +0,0 @@ -import yargs, { Argv } from 'yargs' - -import { sendTransaction } from '../../network' -import { loadEnv, CLIArgs, CLIEnvironment } from '../../env' -import { logger } from '../../logging' - -export const createProposal = async (cli: CLIEnvironment, cliArgs: CLIArgs): Promise => { - const id = cliArgs.id - const votes = cliArgs.votes - const metadata = cliArgs.metadata - const resolution = cliArgs.resolution - const governance = cli.contracts.GraphGovernance - - logger.info(`Creating proposal ${id}...`) - await sendTransaction(cli.wallet, governance, 'createProposal', [id, votes, metadata, resolution]) -} - -export const upgradeProposal = async (cli: CLIEnvironment, cliArgs: CLIArgs): Promise => { - const id = cliArgs.id - const votes = cliArgs.votes - const metadata = cliArgs.metadata - const resolution = cliArgs.resolution - const governance = cli.contracts.GraphGovernance - - logger.info(`Upgrade proposal ${id}...`) - await sendTransaction(cli.wallet, governance, 'upgradeProposal', [ - id, - votes, - metadata, - resolution, - ]) -} - -export const governanceCommand = { - command: 'governance', - describe: 'Graph governance contract calls', - builder: (yargs: Argv): yargs.Argv => { - return yargs - .command({ - command: 'createProposal', - describe: 'Create a proposal', - builder: (yargs: Argv): yargs.Argv => { - return yargs - .option('id', { - description: 'Proposal ID', - type: 'string', - requiresArg: true, - demandOption: true, - }) - .option('votes', { - description: 'IPFS hash in bytes32', - type: 'string', - requiresArg: true, - demandOption: true, - }) - .option('metadata', { - description: 'IPFS hash in bytes32', - type: 'string', - requiresArg: true, - demandOption: true, - }) - .option('resolution', { - description: 'Resolution. 1 = Accepted, 2 = Rejected ', - type: 'number', - requiresArg: true, - demandOption: true, - }) - .option('b', { - alias: 'build-tx', - description: - 'Build the acceptProxy tx and print it. Then use tx data with a multisig', - }) - }, - handler: async (argv: CLIArgs): Promise => { - return createProposal(await loadEnv(argv), argv) - }, - }) - .command({ - command: 'upgradeProposal', - describe: 'Upgrade a proposal', - builder: (yargs: Argv): yargs.Argv => { - return yargs - .option('id', { - description: 'Proposal ID', - type: 'string', - requiresArg: true, - demandOption: true, - }) - .option('votes', { - description: 'IPFS hash in bytes32', - type: 'string', - requiresArg: true, - demandOption: true, - }) - .option('metadata', { - description: 'IPFS hash in bytes32', - type: 'string', - requiresArg: true, - demandOption: true, - }) - .option('resolution', { - description: 'Resolution. 1 = Accepted, 2 = Rejected ', - type: 'number', - requiresArg: true, - demandOption: true, - }) - .option('b', { - alias: 'build-tx', - description: - 'Build the acceptProxy tx and print it. Then use tx data with a multisig', - }) - }, - handler: async (argv: CLIArgs): Promise => { - return upgradeProposal(await loadEnv(argv), argv) - }, - }) - }, - handler: (): void => { - yargs.showHelp() - }, -} diff --git a/cli/commands/contracts/graphToken.ts b/cli/commands/contracts/graphToken.ts deleted file mode 100644 index 4d295b60e..000000000 --- a/cli/commands/contracts/graphToken.ts +++ /dev/null @@ -1,165 +0,0 @@ -import yargs, { Argv } from 'yargs' -import { parseGRT } from '@graphprotocol/common-ts' - -import { logger } from '../../logging' -import { sendTransaction } from '../../network' -import { loadEnv, CLIArgs, CLIEnvironment } from '../../env' - -export const mint = async (cli: CLIEnvironment, cliArgs: CLIArgs): Promise => { - const amount = parseGRT(cliArgs.amount) - const account = cliArgs.account - const graphToken = cli.contracts.GraphToken - - logger.info(`Minting ${cliArgs.amount} tokens for user ${account}...`) - await sendTransaction(cli.wallet, graphToken, 'mint', [account, amount]) -} - -export const burn = async (cli: CLIEnvironment, cliArgs: CLIArgs): Promise => { - const amount = parseGRT(cliArgs.amount) - const graphToken = cli.contracts.GraphToken - - logger.info(`Burning ${cliArgs.amount} tokens...`) - await sendTransaction(cli.wallet, graphToken, 'burn', [amount]) -} - -export const transfer = async (cli: CLIEnvironment, cliArgs: CLIArgs): Promise => { - const amount = parseGRT(cliArgs.amount) - const account = cliArgs.account - const graphToken = cli.contracts.GraphToken - - logger.info(`Transferring ${cliArgs.amount} tokens to user ${account}...`) - await sendTransaction(cli.wallet, graphToken, 'transfer', [account, amount]) -} - -export const approve = async (cli: CLIEnvironment, cliArgs: CLIArgs): Promise => { - const amount = parseGRT(cliArgs.amount) - const account = cliArgs.account - const graphToken = cli.contracts.GraphToken - - logger.info(`Approving ${cliArgs.amount} tokens for user ${account} to spend...`) - await sendTransaction(cli.wallet, graphToken, 'approve', [account, amount]) -} - -export const allowance = async (cli: CLIEnvironment, cliArgs: CLIArgs): Promise => { - const account = cliArgs.account - const spender = cliArgs.spender - const graphToken = cli.contracts.GraphToken - - logger.info(`Checking ${account} allowance set for spender ${spender}...`) - const res = await graphToken.allowance(account, spender) - logger.info(`allowance = ${res}`) -} - -export const graphTokenCommand = { - command: 'graphToken', - describe: 'Graph Token contract calls', - builder: (yargs: Argv): yargs.Argv => { - return yargs - .command({ - command: 'mint', - describe: 'Mint GRT', - builder: (yargs: Argv) => { - return yargs - .option('account', { - description: 'The account getting sent minted GRT', - type: 'string', - requiresArg: true, - demandOption: true, - }) - .option('amount', { - description: 'Amount of tokens. CLI converts to a BN with 10^18', - type: 'string', - requiresArg: true, - demandOption: true, - }) - }, - handler: async (argv: CLIArgs): Promise => { - return mint(await loadEnv(argv), argv) - }, - }) - .command({ - command: 'burn', - describe: 'Burn GRT', - builder: (yargs: Argv) => { - return yargs.option('amount', { - description: 'Amount of tokens. CLI converts to a BN with 10^18', - type: 'string', - requiresArg: true, - demandOption: true, - }) - }, - handler: async (argv: CLIArgs): Promise => { - return burn(await loadEnv(argv), argv) - }, - }) - .command({ - command: 'transfer', - describe: 'Transfer GRT', - builder: (yargs: Argv) => { - return yargs - .option('account', { - description: 'The account receiving GRT', - type: 'string', - requiresArg: true, - demandOption: true, - }) - .option('amount', { - description: 'Amount of tokens. CLI converts to a BN with 10^18', - type: 'string', - requiresArg: true, - demandOption: true, - }) - }, - handler: async (argv: CLIArgs): Promise => { - return transfer(await loadEnv(argv), argv) - }, - }) - .command({ - command: 'approve', - describe: 'Approve GRT', - builder: (yargs: Argv) => { - return yargs - .option('account', { - description: 'The account being approved as a spender', - type: 'string', - requiresArg: true, - demandOption: true, - }) - .option('amount', { - description: 'Amount of tokens. CLI converts to a BN with 10^18', - type: 'string', - requiresArg: true, - demandOption: true, - }) - }, - handler: async (argv: CLIArgs): Promise => { - return approve(await loadEnv(argv), argv) - }, - }) - .command({ - command: 'allowance', - describe: 'Check GRT allowance', - builder: (yargs: Argv) => { - return yargs - .option('account', { - description: 'The account who gave an allowance', - type: 'string', - requiresArg: true, - demandOption: true, - }) - .option('spender', { - description: 'The spender', - type: 'string', - requiresArg: true, - demandOption: true, - }) - }, - handler: async (argv: CLIArgs): Promise => { - return allowance(await loadEnv(argv), argv) - }, - }) - }, - handler: (): void => { - yargs.showHelp() - }, -} diff --git a/cli/commands/contracts/gsr-gdai.ts b/cli/commands/contracts/gsr-gdai.ts deleted file mode 100644 index 850b6eec5..000000000 --- a/cli/commands/contracts/gsr-gdai.ts +++ /dev/null @@ -1,204 +0,0 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ -import yargs, { Argv } from 'yargs' -import { parseGRT } from '@graphprotocol/common-ts' - -import { logger } from '../../logging' -import { sendTransaction } from '../../network' -import { loadEnv, CLIArgs, CLIEnvironment } from '../../env' - -export const setGSR = async (cli: CLIEnvironment, cliArgs: CLIArgs): Promise => { - const account = cliArgs.account - const gdai = (cli.contracts as any).GDAI - - logger.info(`Setting GSR to ${account}...`) - await sendTransaction(cli.wallet, gdai, 'setGSR', [account]) -} - -export const setRate = async (cli: CLIEnvironment, cliArgs: CLIArgs): Promise => { - const amount = parseGRT(cliArgs.amount) - const gsr = (cli.contracts as any).GSRManager - - logger.info(`Setting rate to ${amount}...`) - await sendTransaction(cli.wallet, gsr, 'setRate', [amount]) -} - -export const join = async (cli: CLIEnvironment, cliArgs: CLIArgs): Promise => { - const amount = parseGRT(cliArgs.amount) - const gsr = (cli.contracts as any).GSRManager - - logger.info(`Reminder - you must call approve on the GSR before`) - logger.info(`Joining GSR with ${cliArgs.amount} tokens...`) - await sendTransaction(cli.wallet, gsr, 'join', [amount]) -} - -export const mint = async (cli: CLIEnvironment, cliArgs: CLIArgs): Promise => { - const amount = parseGRT(cliArgs.amount) - const account = cliArgs.account - const gdai = (cli.contracts as any).GDAI - - logger.info(`Minting ${cliArgs.amount} GDAI for user ${account}...`) - await sendTransaction(cli.wallet, gdai, 'mint', [account, amount]) -} - -export const burn = async (cli: CLIEnvironment, cliArgs: CLIArgs): Promise => { - const amount = parseGRT(cliArgs.amount) - const gdai = (cli.contracts as any).GDAI - - logger.info(`Burning ${cliArgs.amount} GDAI...`) - await sendTransaction(cli.wallet, gdai, 'burn', [amount]) -} - -export const transfer = async (cli: CLIEnvironment, cliArgs: CLIArgs): Promise => { - const amount = parseGRT(cliArgs.amount) - const account = cliArgs.account - const gdai = (cli.contracts as any).GDAI - - logger.info(`Transferring ${cliArgs.amount} tokens to user ${account}...`) - await sendTransaction(cli.wallet, gdai, 'transfer', [account, amount]) -} - -export const approve = async (cli: CLIEnvironment, cliArgs: CLIArgs): Promise => { - const amount = parseGRT(cliArgs.amount) - const account = cliArgs.account - const gdai = (cli.contracts as any).GDAI - - logger.info(`Approving ${cliArgs.amount} GDAI for user ${account} to spend...`) - await sendTransaction(cli.wallet, gdai, 'approve', [account, amount]) -} - -export const gdaiCommand = { - command: 'gdai', - describe: 'GDAI and GSR contract calls', - builder: (yargs: Argv): yargs.Argv => { - return yargs - .command({ - command: 'mint', - describe: 'Mint GRT', - builder: (yargs: Argv) => { - return yargs - .option('account', { - description: 'The account getting sent minted GDAI', - type: 'string', - requiresArg: true, - demandOption: true, - }) - .option('amount', { - description: 'Amount of tokens. CLI converts to a BN with 10^18', - type: 'string', - requiresArg: true, - demandOption: true, - }) - }, - handler: async (argv: CLIArgs): Promise => { - return mint(await loadEnv(argv), argv) - }, - }) - .command({ - command: 'setGSR', - describe: 'Set GSR for GDAI', - builder: (yargs: Argv) => { - return yargs.option('account', { - description: 'The GSR account address', - type: 'string', - requiresArg: true, - demandOption: true, - }) - }, - handler: async (argv: CLIArgs): Promise => { - return setGSR(await loadEnv(argv), argv) - }, - }) - .command({ - command: 'setRate', - describe: 'Set savings rate', - builder: (yargs: Argv) => { - return yargs.option('amount', { - description: 'Savings rate. Pass as 1.0000... - (10^18) applied by cli', - type: 'string', - requiresArg: true, - demandOption: true, - }) - }, - handler: async (argv: CLIArgs): Promise => { - return setRate(await loadEnv(argv), argv) - }, - }) - .command({ - command: 'join', - describe: 'Join GSR with an amount of tokens', - builder: (yargs: Argv) => { - return yargs.option('amount', { - description: 'Amount of tokens. CLI converts to a BN with 10^18', - type: 'string', - requiresArg: true, - demandOption: true, - }) - }, - handler: async (argv: CLIArgs): Promise => { - return join(await loadEnv(argv), argv) - }, - }) - .command({ - command: 'burn', - describe: 'Burn GDAI', - builder: (yargs: Argv) => { - return yargs.option('amount', { - description: 'Amount of tokens. CLI converts to a BN with 10^18', - type: 'string', - requiresArg: true, - demandOption: true, - }) - }, - handler: async (argv: CLIArgs): Promise => { - return burn(await loadEnv(argv), argv) - }, - }) - .command({ - command: 'transfer', - describe: 'Transfer GDAI', - builder: (yargs: Argv) => { - return yargs - .option('account', { - description: 'The account receiving GDAI', - type: 'string', - requiresArg: true, - demandOption: true, - }) - .option('amount', { - description: 'Amount of tokens. CLI converts to a BN with 10^18', - type: 'string', - requiresArg: true, - demandOption: true, - }) - }, - handler: async (argv: CLIArgs): Promise => { - return transfer(await loadEnv(argv), argv) - }, - }) - .command({ - command: 'approve', - describe: 'Approve GDAI', - builder: (yargs: Argv) => { - return yargs - .option('account', { - description: 'The account being approved as a spender', - type: 'string', - requiresArg: true, - demandOption: true, - }) - .option('amount', { - description: 'Amount of tokens. CLI converts to a BN with 10^18', - type: 'string', - requiresArg: true, - demandOption: true, - }) - }, - handler: async (argv: CLIArgs): Promise => { - return approve(await loadEnv(argv), argv) - }, - }) - }, - handler: (): void => { - yargs.showHelp() - }, -} diff --git a/cli/commands/contracts/index.ts b/cli/commands/contracts/index.ts deleted file mode 100644 index e230d4f9b..000000000 --- a/cli/commands/contracts/index.ts +++ /dev/null @@ -1,36 +0,0 @@ -import yargs, { Argv, command } from 'yargs' - -import { curationCommand } from './curation' -import { serviceRegistryCommand } from './serviceRegistry' -import { ensCommand } from './ens' -import { ethereumDIDRegistryCommand } from './ethereumDIDRegistry' -import { gnsCommand } from './gns' -import { graphTokenCommand } from './graphToken' -import { gdaiCommand } from './gsr-gdai' -import { stakingCommand } from './staking' -import { anyCommand } from './any' -import { governanceCommand } from './governance' - -import { disputeManagerCommand } from './disputeManager' - -export const contractsCommand = { - command: 'contracts', - describe: 'Contract calls for all contracts', - builder: (yargs: Argv): yargs.Argv => { - return yargs - .command(curationCommand) - .command(serviceRegistryCommand) - .command(ensCommand) - .command(ethereumDIDRegistryCommand) - .command(gnsCommand) - .command(graphTokenCommand) - .command(gdaiCommand) - .command(stakingCommand) - .command(anyCommand) - .command(disputeManagerCommand) - .command(governanceCommand) - }, - handler: (): void => { - yargs.showHelp() - }, -} diff --git a/cli/commands/contracts/serviceRegistry.ts b/cli/commands/contracts/serviceRegistry.ts deleted file mode 100644 index 541c340aa..000000000 --- a/cli/commands/contracts/serviceRegistry.ts +++ /dev/null @@ -1,62 +0,0 @@ -import yargs, { Argv } from 'yargs' - -import { logger } from '../../logging' -import { sendTransaction } from '../../network' -import { loadEnv, CLIArgs, CLIEnvironment } from '../../env' - -export const register = async (cli: CLIEnvironment, cliArgs: CLIArgs): Promise => { - const url = cliArgs.url - const geoHash = cliArgs.geoHash - const serviceRegistry = cli.contracts.ServiceRegistry - - logger.info(`Registering indexer ${cli.walletAddress} with url ${url} and geoHash ${geoHash}`) - await sendTransaction(cli.wallet, serviceRegistry, 'register', [url, geoHash]) -} -export const unregister = async (cli: CLIEnvironment): Promise => { - const serviceRegistry = cli.contracts.ServiceRegistry - - logger.info(`Unregistering indexer ${cli.walletAddress}`) - await sendTransaction(cli.wallet, serviceRegistry, 'unregister') -} - -export const serviceRegistryCommand = { - command: 'serviceRegistry', - describe: 'Service Registry contract calls', - builder: (yargs: Argv): yargs.Argv => { - return yargs - .command({ - command: 'register', - describe: 'Register an indexer in the service registry', - builder: (yargs: Argv) => { - return yargs - .option('u', { - alias: 'url', - description: 'URL of the indexer', - type: 'string', - requiresArg: true, - demandOption: true, - }) - .option('g', { - alias: 'geoHash', - description: 'GeoHash of the indexer', - type: 'string', - requiresArg: true, - demandOption: true, - }) - }, - handler: async (argv: CLIArgs): Promise => { - return register(await loadEnv(argv), argv) - }, - }) - .command({ - command: 'unregister', - describe: 'Unregister an indexer in the service registry', - handler: async (argv: CLIArgs): Promise => { - return unregister(await loadEnv(argv)) - }, - }) - }, - handler: (): void => { - yargs.showHelp() - }, -} diff --git a/cli/commands/contracts/staking.ts b/cli/commands/contracts/staking.ts deleted file mode 100644 index 5fa4ae563..000000000 --- a/cli/commands/contracts/staking.ts +++ /dev/null @@ -1,391 +0,0 @@ -import yargs, { Argv } from 'yargs' -import { parseGRT } from '@graphprotocol/common-ts' - -import { logger } from '../../logging' -import { sendTransaction } from '../../network' -import { loadEnv, CLIArgs, CLIEnvironment } from '../../env' - -export const stake = async (cli: CLIEnvironment, cliArgs: CLIArgs): Promise => { - const amount = parseGRT(cliArgs.amount) - const staking = cli.contracts.Staking - - logger.info(`Staking ${cliArgs.amount} tokens...`) - await sendTransaction(cli.wallet, staking, 'stake', [amount]) -} - -export const unstake = async (cli: CLIEnvironment, cliArgs: CLIArgs): Promise => { - const amount = parseGRT(cliArgs.amount) - const staking = cli.contracts.Staking - - logger.info(`Unstaking ${cliArgs.amount} tokens...`) - await sendTransaction(cli.wallet, staking, 'unstake', [amount]) -} - -export const withdraw = async (cli: CLIEnvironment, cliArgs: CLIArgs): Promise => { - const staking = cli.contracts.Staking - - logger.info(`Withdrawing ${cliArgs.amount} tokens...`) - await sendTransaction(cli.wallet, staking, 'withdraw') -} - -export const allocate = async (cli: CLIEnvironment, cliArgs: CLIArgs): Promise => { - const subgraphDeploymentID = cliArgs.subgraphDeploymentID - const amount = parseGRT(cliArgs.amount) - const allocationID = cliArgs.allocationID - const metadata = cliArgs.metadata - const staking = cli.contracts.Staking - - logger.info(`Allocating ${cliArgs.amount} tokens on ${subgraphDeploymentID}...`) - await sendTransaction(cli.wallet, staking, 'allocate', [ - subgraphDeploymentID, - amount, - allocationID, - metadata, - ]) -} - -export const closeAllocation = async (cli: CLIEnvironment, cliArgs: CLIArgs): Promise => { - const allocationID = cliArgs.allocationID - const staking = cli.contracts.Staking - - logger.info(`Closing allocation with allocationID ${allocationID}...`) - await sendTransaction(cli.wallet, staking, 'close', [allocationID]) -} - -export const collect = async (): Promise => { - logger.info( - `COLLECT NOT IMPLEMENTED. NORMALLY CALLED FROM PROXY ACCOUNT. plan is to - implement this in the near future when we start adding some more - functionality to the CLI and supporting scripts`, - ) -} - -export const claim = async (cli: CLIEnvironment, cliArgs: CLIArgs): Promise => { - const channelID = cliArgs.channelID - const restake = cliArgs.restake - const staking = cli.contracts.Staking - - logger.info(`Claiming on ${channelID} with restake = ${restake}...`) - await sendTransaction(cli.wallet, staking, 'claim', [channelID, restake]) -} - -export const delegate = async (cli: CLIEnvironment, cliArgs: CLIArgs): Promise => { - const indexer = cliArgs.indexer - const amount = parseGRT(cliArgs.amount) - const staking = cli.contracts.Staking - - logger.info(`Delegating ${cliArgs.amount} tokens to indexer ${indexer}...`) - await sendTransaction(cli.wallet, staking, 'delegate', [indexer, amount]) -} - -export const undelegate = async (cli: CLIEnvironment, cliArgs: CLIArgs): Promise => { - const indexer = cliArgs.indexer - const amount = parseGRT(cliArgs.amount) - const staking = cli.contracts.Staking - - logger.info(`Undelegating ${cliArgs.amount} tokens from indexer ${indexer}...`) - await sendTransaction(cli.wallet, staking, 'undelegate', [indexer, amount]) -} - -export const withdrawDelegated = async (cli: CLIEnvironment, cliArgs: CLIArgs): Promise => { - const indexer = cliArgs.indexer - const newIndexer = cliArgs.newIndexer - const staking = cli.contracts.Staking - - if (newIndexer != '0x0000000000000000000000000000000000000000') { - logger.info(`Withdrawing from ${indexer} to new indexer ${newIndexer}...`) - } else { - logger.info(`Withdrawing from ${indexer} without restaking`) - } - await sendTransaction(cli.wallet, staking, 'withdrawDelegated', [indexer, newIndexer]) -} - -export const setDelegationParameters = async ( - cli: CLIEnvironment, - cliArgs: CLIArgs, -): Promise => { - const indexingRewardCut = cliArgs.indexingRewardCut - const queryFeeCut = cliArgs.queryFeeCut - const cooldownBlocks = cliArgs.cooldownBlocks - const staking = cli.contracts.Staking - - logger.info(`Setting the following delegation parameters for indexer ${cli.walletAddress} - indexingRewardCut = ${indexingRewardCut} - queryFeeCut = ${queryFeeCut} - cooldownBlocks = ${cooldownBlocks} - `) - await sendTransaction(cli.wallet, staking, 'setDelegationParameters', [ - indexingRewardCut, - queryFeeCut, - cooldownBlocks, - ]) -} -export const setOperator = async (cli: CLIEnvironment, cliArgs: CLIArgs): Promise => { - const operator = cliArgs.operator - const allowed = cliArgs.allowed - const staking = cli.contracts.Staking - logger.info(`Setting operator ${operator} to ${allowed} for account ${cli.walletAddress}`) - await sendTransaction(cli.wallet, staking, 'setOperator', [operator, allowed]) -} - -export const stakingCommand = { - command: 'staking', - describe: 'Staking contract calls', - builder: (yargs: Argv): yargs.Argv => { - return yargs - .command({ - command: 'stake', - describe: 'Stake GRT', - builder: (yargs: Argv) => { - return yargs.option('amount', { - description: 'Amount of tokens to stake. CLI converts to a BN with 10^18', - type: 'string', - requiresArg: true, - demandOption: true, - }) - }, - handler: async (argv: CLIArgs): Promise => { - return stake(await loadEnv(argv), argv) - }, - }) - .command({ - command: 'unstake', - describe: 'Unstake GRT', - builder: (yargs: Argv) => { - return yargs.option('amount', { - description: 'Amount of tokens to unstake. CLI converts to a BN with 10^18', - type: 'string', - requiresArg: true, - demandOption: true, - }) - }, - handler: async (argv: CLIArgs): Promise => { - return unstake(await loadEnv(argv), argv) - }, - }) - .command({ - command: 'withdraw', - describe: 'Withdraw unlocked GRT', - handler: async (argv: CLIArgs): Promise => { - return withdraw(await loadEnv(argv), argv) - }, - }) - .command({ - command: 'allocate', - describe: 'Allocate GRT on a subgraph deployment', - builder: (yargs: Argv) => { - return yargs - .option('subgraphDeploymentID', { - description: 'The subgraph deployment ID being allocated on', - type: 'string', - requiresArg: true, - demandOption: true, - }) - .option('amount', { - description: 'Amount of tokens being allocated. CLI converts to a BN with 10^18', - type: 'string', - requiresArg: true, - demandOption: true, - }) - .option('allocationID', { - description: 'Address used by the indexer as destination of funds of state channel', - type: 'string', - requiresArg: true, - demandOption: true, - }) - .option('metadata', { - description: 'IPFS hash of the metadata for the allocation', - type: 'string', - requiresArg: true, - demandOption: true, - }) - }, - handler: async (argv: CLIArgs): Promise => { - return allocate(await loadEnv(argv), argv) - }, - }) - .command({ - command: 'close-allocation', - describe: 'Close an allocation', - builder: (yargs: Argv) => { - return yargs.option('channelID', { - description: 'The channel / allocation being closed', - type: 'string', - requiresArg: true, - demandOption: true, - }) - }, - handler: async (argv: CLIArgs): Promise => { - return closeAllocation(await loadEnv(argv), argv) - }, - }) - .command({ - command: 'collect', - describe: 'Channel proxy calls this to collect GRT', - builder: (yargs: Argv) => { - return yargs - .option('channelID', { - description: 'ID of the channel we are collecting funds from', - type: 'string', - requiresArg: true, - demandOption: true, - }) - .option('amount', { - description: 'Token amount to withdraw', - type: 'string', - requiresArg: true, - demandOption: true, - }) - .option('from', { - description: 'Multisig channel address that triggered the withdrawal', - type: 'string', - requiresArg: true, - demandOption: true, - }) - }, - handler: async (): Promise => { - return collect() - }, - }) - .command({ - command: 'claim', - describe: 'Claim GRT', - builder: (yargs: Argv) => { - return yargs - .option('channelID', { - description: 'ID of the channel we are claiming funds from', - type: 'string', - requiresArg: true, - demandOption: true, - }) - .option('restake', { - description: 'True if you are restaking the fees, rather than withdrawing', - type: 'boolean', - requiresArg: true, - demandOption: true, - }) - }, - handler: async (argv: CLIArgs): Promise => { - return claim(await loadEnv(argv), argv) - }, - }) - .command({ - command: 'delegate', - describe: 'Delegate GRT', - builder: (yargs: Argv) => { - return yargs - .option('indexer', { - description: 'Indexer being delegated to', - type: 'string', - requiresArg: true, - demandOption: true, - }) - .option('amount', { - description: 'Amount of tokens. CLI converts to a BN with 10^18', - type: 'string', - requiresArg: true, - demandOption: true, - }) - }, - handler: async (argv: CLIArgs): Promise => { - return delegate(await loadEnv(argv), argv) - }, - }) - .command({ - command: 'undelegate', - describe: 'Undelegate GRT', - builder: (yargs: Argv) => { - return yargs - .option('indexer', { - description: 'Indexer being undelegated on', - type: 'string', - requiresArg: true, - demandOption: true, - }) - .option('amount', { - description: 'Amount of tokens. CLI converts to a BN with 10^18', - type: 'string', - requiresArg: true, - demandOption: true, - }) - }, - handler: async (argv: CLIArgs): Promise => { - return undelegate(await loadEnv(argv), argv) - }, - }) - .command({ - command: 'withdrawDelegated', - describe: 'Withdrawn unlocked delegated GRT', - builder: (yargs: Argv) => { - return yargs - .option('indexer', { - description: 'Indexer being withdrawn from to', - type: 'string', - requiresArg: true, - demandOption: true, - }) - .option('newIndexer', { - description: - 'New indexer being delegated to. if address(0) it will return the tokens', - type: 'string', - requiresArg: true, - demandOption: true, - }) - }, - handler: async (argv: CLIArgs): Promise => { - return withdrawDelegated(await loadEnv(argv), argv) - }, - }) - .command({ - command: 'setDelegationParameters', - describe: 'Sets the delegation parameters for an indexer', - builder: (yargs: Argv) => { - return yargs - .option('indexingRewardCut', { - description: 'Percentage of indexing rewards left for delegators', - type: 'number', - requiresArg: true, - demandOption: true, - }) - .option('queryFeeCut', { - description: 'Percentage of query fees left for delegators', - type: 'number', - requiresArg: true, - demandOption: true, - }) - .option('cooldownBlocks', { - description: 'Period that need to pass to update delegation parameters', - type: 'number', - }) - }, - handler: async (argv: CLIArgs): Promise => { - return setDelegationParameters(await loadEnv(argv), argv) - }, - }) - .command({ - command: 'setOperator', - describe: 'Set the operator for a graph account', - builder: (yargs: Argv) => { - return yargs - .option('operator', { - description: 'Address of the operator', - type: 'string', - requiresArg: true, - demandOption: true, - }) - .option('allowed', { - description: 'Set to true to be an operator, false to revoke', - type: 'boolean', - requiresArg: true, - demandOption: true, - }) - }, - handler: async (argv: CLIArgs): Promise => { - return setOperator(await loadEnv(argv), argv) - }, - }) - }, - handler: (): void => { - yargs.showHelp() - }, -} diff --git a/cli/commands/deploy.ts b/cli/commands/deploy.ts deleted file mode 100644 index 48def9a84..000000000 --- a/cli/commands/deploy.ts +++ /dev/null @@ -1,97 +0,0 @@ -import yargs, { Argv } from 'yargs' - -import { - getContractAt, - deployContract, - deployContractAndSave, - deployContractWithProxy, - deployContractWithProxyAndSave, -} from '../network' -import { loadEnv, CLIArgs, CLIEnvironment } from '../env' -import { logger } from '../logging' - -export const deploy = async (cli: CLIEnvironment, cliArgs: CLIArgs): Promise => { - const contractName = cliArgs.contract - const initArgs = cliArgs.init - const deployType = cliArgs.type - const buildAcceptProxyTx = cliArgs.buildTx - - // Deploy contract - const contractArgs = initArgs ? initArgs.split(',') : [] - switch (deployType) { - case 'deploy': - logger.info(`Deploying contract ${contractName}...`) - await deployContract(contractName, contractArgs, cli.wallet) - break - case 'deploy-save': - logger.info(`Deploying contract ${contractName} and saving to address book...`) - await deployContractAndSave(contractName, contractArgs, cli.wallet, cli.addressBook) - break - case 'deploy-with-proxy': - // Get the GraphProxyAdmin to own the GraphProxy for this contract - const proxyAdminEntry = cli.addressBook.getEntry('GraphProxyAdmin') - if (!proxyAdminEntry) { - throw new Error('GraphProxyAdmin not detected in the config, must be deployed first!') - } - const proxyAdmin = getContractAt('GraphProxyAdmin', proxyAdminEntry.address) - - logger.info(`Deploying contract ${contractName} with proxy ...`) - await deployContractWithProxy( - proxyAdmin, - contractName, - contractArgs, - cli.wallet, - buildAcceptProxyTx, - ) - break - case 'deploy-with-proxy-save': - logger.info(`Deploying contract ${contractName} with proxy and saving to address book...`) - await deployContractWithProxyAndSave( - contractName, - contractArgs, - cli.wallet, - cli.addressBook, - buildAcceptProxyTx, - ) - break - default: - logger.error('Please provide the correct option for deploy type') - } -} - -export const deployCommand = { - command: 'deploy', - describe: 'Deploy contract', - builder: (yargs: Argv): yargs.Argv => { - return yargs - .option('x', { - alias: 'init', - description: 'Init arguments as comma-separated values', - type: 'string', - requiresArg: true, - }) - .option('c', { - alias: 'contract', - description: 'Contract name to deploy', - type: 'string', - requiresArg: true, - demandOption: true, - }) - .option('t', { - alias: 'type', - description: 'Choose deploy, deploy-save, deploy-with-proxy, deploy-with-proxy-save', - type: 'string', - requiresArg: true, - demandOption: true, - }) - .option('b', { - alias: 'build-tx', - description: 'Build the acceptProxy tx and print it. Then use tx data with a multisig', - default: false, - type: 'boolean', - }) - }, - handler: async (argv: CLIArgs): Promise => { - return deploy(await loadEnv(argv), argv) - }, -} diff --git a/cli/commands/migrate.ts b/cli/commands/migrate.ts deleted file mode 100644 index 9a77ca78c..000000000 --- a/cli/commands/migrate.ts +++ /dev/null @@ -1,140 +0,0 @@ -import { constants, utils } from 'ethers' -import yargs, { Argv } from 'yargs' - -import { logger } from '../logging' -import { loadCallParams, readConfig, getContractConfig } from '../config' -import { cliOpts } from '../defaults' -import { - isContractDeployed, - deployContractAndSave, - deployContractWithProxyAndSave, - sendTransaction, -} from '../network' -import { loadEnv, CLIArgs, CLIEnvironment } from '../env' - -const { EtherSymbol } = constants -const { formatEther } = utils - -// Contracts are deployed in the order defined in this list -const allContracts = [ - 'GraphProxyAdmin', - 'BancorFormula', - 'Controller', - 'EpochManager', - 'GraphToken', - 'ServiceRegistry', - 'Curation', - 'GNS', - 'Staking', - 'RewardsManager', - 'DisputeManager', -] - -export const migrate = async (cli: CLIEnvironment, cliArgs: CLIArgs): Promise => { - const graphConfigPath = cliArgs.graphConfig - const force = cliArgs.force - const contractName = cliArgs.contract - - logger.info(`>>> Migrating contracts <<<\n`) - - const graphConfig = readConfig(graphConfigPath) - - //////////////////////////////////////// - // Deploy contracts - - // Filter contracts to be deployed - if (contractName && !allContracts.includes(contractName)) { - logger.error(`Contract ${contractName} not found in address book`) - return - } - const deployContracts = contractName ? [contractName] : allContracts - const pendingContractCalls = [] - - logger.info(`>>> Contracts deployment\n`) - for (const name of deployContracts) { - // Get address book info - const addressEntry = cli.addressBook.getEntry(name) - const savedAddress = addressEntry && addressEntry.address - - logger.info(`= Deploy: ${name}`) - - // Check if contract already deployed - const isDeployed = await isContractDeployed( - name, - savedAddress, - cli.addressBook, - cli.wallet.provider, - ) - if (!force && isDeployed) { - logger.info(`${name} is up to date, no action required`) - logger.info(`Address: ${savedAddress}\n`) - continue - } - - // Get config and deploy contract - const contractConfig = getContractConfig(graphConfig, cli.addressBook, name) - const deployFn = contractConfig.proxy ? deployContractWithProxyAndSave : deployContractAndSave - const contract = await deployFn( - name, - contractConfig.params.map((a) => a.value), // keep only the values - cli.wallet, - cli.addressBook, - ) - logger.info('') - - // Defer contract calls after deploying every contract - if (contractConfig.calls) { - pendingContractCalls.push({ name, contract, calls: contractConfig.calls }) - } - } - logger.info('Contract deployments done! Contract calls are next') - - //////////////////////////////////////// - // Run contracts calls - - logger.info('') - logger.info(`>>> Contracts calls\n`) - if (pendingContractCalls.length > 0) { - for (const entry of pendingContractCalls) { - if (entry.calls.length == 0) continue - - logger.info(`= Config: ${entry.name}`) - for (const call of entry.calls) { - logger.info(`\n* Calling ${call.fn}:`) - await sendTransaction( - cli.wallet, - entry.contract, - call.fn, - loadCallParams(call.params, cli.addressBook), - ) - } - logger.info('') - } - } else { - logger.info('Nothing to do') - } - - //////////////////////////////////////// - // Print summary - logger.info('') - logger.info(`>>> Summary\n`) - logger.info('All done!') - const spent = formatEther(cli.balance.sub(await cli.wallet.getBalance())) - const nTx = (await cli.wallet.getTransactionCount()) - cli.nonce - logger.info(`Sent ${nTx} transaction${nTx === 1 ? '' : 's'} & spent ${EtherSymbol} ${spent}`) -} - -export const migrateCommand = { - command: 'migrate', - describe: 'Migrate contracts', - builder: (yargs: Argv): yargs.Argv => { - return yargs.option('c', cliOpts.graphConfig).option('n', { - alias: 'contract', - description: 'Contract name to deploy (all if not set)', - type: 'string', - }) - }, - handler: async (argv: CLIArgs): Promise => { - return migrate(await loadEnv(argv), argv) - }, -} diff --git a/cli/commands/protocol/get.ts b/cli/commands/protocol/get.ts deleted file mode 100644 index 836a6ff73..000000000 --- a/cli/commands/protocol/get.ts +++ /dev/null @@ -1,92 +0,0 @@ -import yargs, { Argv } from 'yargs' - -import { logger } from '../../logging' -import { getContractAt } from '../../network' -import { loadEnv, CLIArgs, CLIEnvironment } from '../../env' -import { ContractFunction } from 'ethers' - -import { ProtocolFunction } from './index' - -export const gettersList = { - // Staking - 'staking-slasher': { contract: 'Staking', name: 'slashers' }, - 'staking-thawing-period': { contract: 'Staking', name: 'thawingPeriod' }, - 'staking-dispute-epochs': { contract: 'Staking', name: 'channelDisputeEpochs' }, - 'staking-max-allocation-epochs': { contract: 'Staking', name: 'maxAllocationEpochs' }, - 'staking-delegation-ratio': { contract: 'Staking', name: 'delegationRatio' }, - 'staking-delegation-parameters-cooldown': { - contract: 'Staking', - name: 'delegationParametersCooldown', - }, - 'staking-delegation-unbonding-period': { contract: 'Staking', name: 'delegationUnbondingPeriod' }, - 'protocol-percentage': { contract: 'Staking', name: 'protocolPercentage' }, - // Curation - 'curation-reserve-ratio': { contract: 'Curation', name: 'defaultReserveRatio' }, - 'curation-percentage': { contract: 'Staking', name: 'curationPercentage' }, - 'curation-minimum-deposit': { contract: 'Curation', name: 'minimumCurationDeposit' }, - 'curation-tax-percentage': { contract: 'Curation', name: 'curationTaxPercentage' }, - 'curation-bonding-curve': { contract: 'Curation', name: 'bondingCurve' }, - // Disputes - 'disputes-arbitrator': { contract: 'DisputeManager', name: 'arbitrator' }, - 'disputes-minimum-deposit': { contract: 'DisputeManager', name: 'minimumDeposit' }, - 'disputes-reward-percentage': { contract: 'DisputeManager', name: 'fishermanRewardPercentage' }, - 'disputes-slashing-percentage': { contract: 'DisputeManager', name: 'slashingPercentage' }, - // Epochs - 'epochs-length': { contract: 'EpochManager', name: 'epochLength' }, - 'epochs-current': { contract: 'EpochManager', name: 'currentEpoch' }, - // Rewards - 'rewards-issuance-rate': { contract: 'RewardsManager', name: 'issuanceRate' }, - // GNS - 'gns-bonding-curve': { contract: 'GNS', name: 'bondingCurve' }, - 'gns-owner-tax-percentage': { contract: 'GNS', name: 'ownerTaxPercentage' }, - // Token - 'token-governor': { contract: 'GraphToken', name: 'governor' }, - 'token-supply': { contract: 'GraphToken', name: 'totalSupply' }, - // Controller - 'controller-governor': { contract: 'Controller', name: 'governor' }, - 'controller-get-contract-proxy': { contract: 'Controller', name: 'getContractProxy' }, - 'controller-get-paused': { contract: 'Controller', name: 'paused' }, - 'controller-get-partial-paused': { contract: 'Controller', name: 'partialPaused' }, - 'controller-get-pause-guardian': { contract: 'Controller', name: 'pauseGuardian' }, -} - -const buildHelp = () => { - let help = '$0 protocol get [params]\n\nGraph protocol configuration\n\nCommands:\n\n' - for (const entry of Object.keys(gettersList)) { - help += ' $0 protocol get ' + entry + ' [params]\n' - } - return help -} - -export const getProtocolParam = async (cli: CLIEnvironment, cliArgs: CLIArgs): Promise => { - logger.info(`Getting ${cliArgs.fn}...`) - - const fn: ProtocolFunction = gettersList[cliArgs.fn] - if (!fn) { - logger.error(`Command ${cliArgs.fn} does not exist`) - return - } - - const addressEntry = cli.addressBook.getEntry(fn.contract) - - // Parse params - const params = cliArgs.params ? cliArgs.params.toString().split(',') : [] - - // Send tx - const contract = getContractAt(fn.contract, addressEntry.address).connect(cli.wallet) - const contractFn: ContractFunction = contract.functions[fn.name] - - const [value] = await contractFn(...params) - logger.info(`${fn.name} = ${value}`) -} - -export const getCommand = { - command: 'get [params]', - describe: 'Get network parameter', - builder: (yargs: Argv): yargs.Argv => { - return yargs.usage(buildHelp()) - }, - handler: async (argv: CLIArgs): Promise => { - return getProtocolParam(await loadEnv(argv), argv) - }, -} diff --git a/cli/commands/protocol/index.ts b/cli/commands/protocol/index.ts deleted file mode 100644 index 69ca4e4c2..000000000 --- a/cli/commands/protocol/index.ts +++ /dev/null @@ -1,25 +0,0 @@ -import yargs, { Argv } from 'yargs' - -import { listCommand } from './list' -import { getCommand } from './get' -import { setCommand } from './set' - -export interface ProtocolFunction { - contract: string - name: string -} - -// TODO: print help with fn signature -// TODO: list address-book -// TODO: add gas price - -export const protocolCommand = { - command: 'protocol', - describe: 'Graph protocol configuration', - builder: (yargs: Argv): yargs.Argv => { - return yargs.command(getCommand).command(setCommand).command(listCommand) - }, - handler: (): void => { - yargs.showHelp() - }, -} diff --git a/cli/commands/protocol/list.ts b/cli/commands/protocol/list.ts deleted file mode 100644 index 228151e04..000000000 --- a/cli/commands/protocol/list.ts +++ /dev/null @@ -1,83 +0,0 @@ -import Table from 'cli-table' - -import { loadEnv, CLIArgs, CLIEnvironment } from '../../env' -import { logger } from '../../logging' -import { ContractFunction } from 'ethers' - -import { gettersList } from './get' - -const contractNames = [ - 'Controller', - 'GraphToken', - 'EpochManager', - 'Staking', - 'Curation', - 'DisputeManager', - 'RewardsManager', - 'GNS', -] - -export const listProtocolParams = async (cli: CLIEnvironment): Promise => { - logger.info(`>>> Protocol Configuration <<<\n`) - - for (const contractName of contractNames) { - const table = new Table({ - head: [contractName, 'Value'], - colWidths: [30, 50], - }) - - const contract = cli.contracts[contractName] - table.push(['* address', contract.address]) - - const req = [] - for (const fn of Object.values(gettersList)) { - if (fn.contract != contractName) continue - - const contract = cli.contracts[fn.contract] - if (contract.interface.getFunction(fn.name).inputs.length == 0) { - const contractFn: ContractFunction = contract.functions[fn.name] - req.push( - contractFn().then((values) => { - let [value] = values - if (typeof value === 'object') { - value = value.toString() - } - table.push([fn.name, value]) - }), - ) - } - } - await Promise.all(req) - logger.info(table.toString()) - } - - // Verify controllers - logger.info(`\n>>> Contracts Controller <<<\n`) - - const controller = cli.contracts['Controller'] - for (const contractName of contractNames) { - if (contractName === 'Controller') continue - - const contract = cli.contracts[contractName] - const contractFn = contract.functions['controller'] - - if (contractFn) { - const addr = await contractFn().then((values) => values[0]) - if (addr === controller.address) { - logger.info(contractName) - } else { - logger.error(`${contractName} : ${addr} should be ${controller.address}`) - } - } else { - logger.info(contractName) - } - } -} - -export const listCommand = { - command: 'list', - describe: 'List protocol parameters', - handler: async (argv: CLIArgs): Promise => { - return listProtocolParams(await loadEnv(argv)) - }, -} diff --git a/cli/commands/protocol/set.ts b/cli/commands/protocol/set.ts deleted file mode 100644 index 2ca96280a..000000000 --- a/cli/commands/protocol/set.ts +++ /dev/null @@ -1,95 +0,0 @@ -import yargs, { Argv } from 'yargs' - -import { logger } from '../../logging' -import { getContractAt, sendTransaction } from '../../network' -import { loadEnv, CLIArgs, CLIEnvironment } from '../../env' - -import { ProtocolFunction } from './index' - -export const settersList = { - // Staking - 'staking-slasher': { contract: 'Staking', name: 'setSlasher' }, - 'staking-thawing-period': { contract: 'Staking', name: 'setThawingPeriod' }, - 'staking-dispute-epochs': { contract: 'Staking', name: 'setChannelDisputeEpochs' }, - 'staking-max-allocation-epochs': { contract: 'Staking', name: 'setMaxAllocationEpochs' }, - 'staking-protocol-percentage': { contract: 'Staking', name: 'setProtocolPercentage' }, - 'staking-delegation-ratio': { contract: 'Staking', name: 'setDelegationRatio' }, - 'staking-delegation-parameters-cooldown': { - contract: 'Staking', - name: 'setDelegationParametersCooldown', - }, - 'staking-delegation-unbonding-period': { - contract: 'Staking', - name: 'setDelegationUnbondingPeriod', - }, - // Curation - 'curation-reserve-ratio': { contract: 'Curation', name: 'setDefaultReserveRatio' }, - 'curation-percentage': { contract: 'Staking', name: 'setCurationPercentage' }, - 'curation-minimum-deposit': { contract: 'Curation', name: 'setMinimumCurationDeposit' }, - 'curation-tax-percentage': { contract: 'Curation', name: 'setCurationTaxPercentage' }, - // Disputes - 'disputes-arbitrator': { contract: 'DisputeManager', name: 'setArbitrator' }, - 'disputes-minimum-deposit': { contract: 'DisputeManager', name: 'setMinimumDeposit' }, - 'disputes-reward-percentage': { - contract: 'DisputeManager', - name: 'setFishermanRewardPercentage', - }, - 'disputes-slashing-percentage': { contract: 'DisputeManager', name: 'setSlashingPercentage' }, - // Epochs - 'epochs-length': { contract: 'EpochManager', name: 'setEpochLength' }, - // Rewards - 'rewards-issuance-rate': { contract: 'RewardsManager', name: 'setIssuanceRate' }, - // GNS - 'gns-owner-tax-percentage': { contract: 'GNS', name: 'setOwnerTaxPercentage' }, - // Token - 'token-transfer-governor': { contract: 'GraphToken', name: 'transferOwnership' }, - 'token-accept-governor': { contract: 'GraphToken', name: 'acceptOwnership' }, - 'token-add-minter': { contract: 'GraphToken', name: 'addMinter' }, - 'token-remove-minter': { contract: 'GraphToken', name: 'removeMinter' }, - 'token-mint': { contract: 'GraphToken', name: 'mint' }, - // Controller - 'controller-transfer-governor': { contract: 'Controller', name: 'transferOwnership' }, - 'controller-accept-governor': { contract: 'Controller', name: 'acceptOwnership' }, - 'controller-set-contract-proxy': { contract: 'Controller', name: 'setContractProxy' }, - 'controller-set-paused': { contract: 'Controller', name: 'setPaused' }, - 'controller-set-partial-paused': { contract: 'Controller', name: 'setPartialPaused' }, - 'controller-set-pause-guardian': { contract: 'Controller', name: 'setPauseGuardian' }, -} - -const buildHelp = () => { - let help = '$0 protocol set \n\nGraph protocol configuration\n\nCommands:\n\n' - for (const entry of Object.keys(settersList)) { - help += ' $0 protocol set ' + entry + ' \n' - } - return help -} - -export const setProtocolParam = async (cli: CLIEnvironment, cliArgs: CLIArgs): Promise => { - logger.info(`Setting ${cliArgs.fn}...`) - - const fn: ProtocolFunction = settersList[cliArgs.fn] - if (!fn) { - logger.error(`Command ${cliArgs.fn} does not exist`) - return - } - - const addressEntry = cli.addressBook.getEntry(fn.contract) - - // Parse params - const params = cliArgs.params.toString().split(',') - - // Send tx - const contract = getContractAt(fn.contract, addressEntry.address).connect(cli.wallet) - await sendTransaction(cli.wallet, contract, fn.name, params) -} - -export const setCommand = { - command: 'set ', - describe: 'Set protocol parameter', - builder: (yargs: Argv): yargs.Argv => { - return yargs.usage(buildHelp()) - }, - handler: async (argv: CLIArgs): Promise => { - return setProtocolParam(await loadEnv(argv), argv) - }, -} diff --git a/cli/commands/proxy/admin.ts b/cli/commands/proxy/admin.ts deleted file mode 100644 index ca782068e..000000000 --- a/cli/commands/proxy/admin.ts +++ /dev/null @@ -1,76 +0,0 @@ -import inquirer from 'inquirer' -import yargs, { Argv } from 'yargs' - -import { logger } from '../../logging' -import { getContractAt, sendTransaction } from '../../network' -import { loadEnv, CLIArgs, CLIEnvironment } from '../../env' - -export const setProxyAdmin = async (cli: CLIEnvironment, cliArgs: CLIArgs): Promise => { - const contractName = cliArgs.contract - const adminAddress = cliArgs.admin - - logger.info(`Set proxy admin for contract ${contractName} to ${adminAddress}`) - - // Warn about changing ownership - const res = await inquirer.prompt({ - name: 'confirm', - type: 'confirm', - message: `Are you sure to set the admin to ${adminAddress}?`, - }) - if (!res.confirm) { - logger.info('Cancelled') - return - } - - // Get address book info - const addressEntry = cli.addressBook.getEntry(contractName) - const savedAddress = addressEntry && addressEntry.address - - if (!savedAddress) { - logger.error(`Contract ${contractName} not found in address book`) - return - } - - // Only work with addresses deployed with a proxy - if (!addressEntry.proxy) { - logger.error(`Contract ${contractName} was not deployed using a proxy`) - return - } - - // Get the proxy admin - const proxyAdminEntry = cli.addressBook.getEntry('GraphProxyAdmin') - if (!proxyAdminEntry || !proxyAdminEntry.address) { - logger.crit('Missing GraphProxyAdmin configuration') - return - } - const proxyAdmin = getContractAt('GraphProxyAdmin', proxyAdminEntry.address).connect(cli.wallet) - - // Change proxy admin - await sendTransaction(cli.wallet, proxyAdmin, 'changeProxyAdmin', [ - addressEntry.address, - adminAddress, - ]) - logger.info('Done') -} - -export const setAdminCommand = { - command: 'set-admin', - describe: 'Set proxy admin', - builder: (yargs: Argv): yargs.Argv => { - return yargs - .option('admin', { - description: 'Address of the new admin', - type: 'string', - requiresArg: true, - }) - .option('contract', { - description: 'Contract name to set admin', - type: 'string', - requiresArg: true, - }) - .demandOption(['admin', 'contract']) - }, - handler: async (argv: CLIArgs): Promise => { - return setProxyAdmin(await loadEnv(argv), argv) - }, -} diff --git a/cli/commands/proxy/index.ts b/cli/commands/proxy/index.ts deleted file mode 100644 index 99dfc18d2..000000000 --- a/cli/commands/proxy/index.ts +++ /dev/null @@ -1,16 +0,0 @@ -import yargs, { Argv } from 'yargs' - -import { setAdminCommand } from './admin' -import { listCommand } from './list' -import { upgradeCommand } from './upgrade' - -export const proxyCommand = { - command: 'proxy', - describe: 'Manage proxy contracts', - builder: (yargs: Argv): yargs.Argv => { - return yargs.command(listCommand).command(upgradeCommand).command(setAdminCommand) - }, - handler: (): void => { - yargs.showHelp() - }, -} diff --git a/cli/commands/proxy/list.ts b/cli/commands/proxy/list.ts deleted file mode 100644 index f20ae59ae..000000000 --- a/cli/commands/proxy/list.ts +++ /dev/null @@ -1,45 +0,0 @@ -import Table from 'cli-table' - -import { logger } from '../../logging' -import { getContractAt } from '../../network' -import { loadEnv, CLIArgs, CLIEnvironment } from '../../env' - -export const listProxies = async (cli: CLIEnvironment): Promise => { - logger.info(`Listing proxies...`) - const table = new Table({ - head: ['Contract', 'Proxy', 'Implementation', 'Admin'], - colWidths: [20, 45, 45, 45], - }) - - // Get the proxy admin - const proxyAdminEntry = cli.addressBook.getEntry('GraphProxyAdmin') - if (!proxyAdminEntry || !proxyAdminEntry.address) { - logger.crit('Missing GraphProxyAdmin configuration') - return - } - const proxyAdmin = getContractAt('GraphProxyAdmin', proxyAdminEntry.address).connect(cli.wallet) - - // Scan every proxy and get current admin and implementation - for (const contractName of cli.addressBook.listEntries()) { - const addressEntry = cli.addressBook.getEntry(contractName) - if (addressEntry.proxy) { - try { - const implementationAddress = await proxyAdmin.getProxyImplementation(addressEntry.address) - const adminAddress = await proxyAdmin.getProxyAdmin(addressEntry.address) - table.push([contractName, addressEntry.address, implementationAddress, adminAddress]) - } catch { - table.push([contractName, addressEntry.address, '', '']) - } - } - } - - logger.info(table.toString()) -} - -export const listCommand = { - command: 'list', - describe: 'List deployed proxies', - handler: async (argv: CLIArgs): Promise => { - return listProxies(await loadEnv(argv)) - }, -} diff --git a/cli/commands/proxy/upgrade.ts b/cli/commands/proxy/upgrade.ts deleted file mode 100644 index df90047ca..000000000 --- a/cli/commands/proxy/upgrade.ts +++ /dev/null @@ -1,160 +0,0 @@ -import yargs, { Argv } from 'yargs' - -import { logger } from '../../logging' -import { getContractAt, isContractDeployed, sendTransaction } from '../../network' -import { loadEnv, CLIArgs, CLIEnvironment } from '../../env' - -export const upgradeProxy = async (cli: CLIEnvironment, cliArgs: CLIArgs): Promise => { - const contractName = cliArgs.contract - const implAddress = cliArgs.impl - const initArgs = cliArgs.init - const buildAcceptProxyTx = cliArgs.buildTx - - logger.info(`Upgrading contract ${contractName}...`) - - // Get address book info - const addressEntry = cli.addressBook.getEntry(contractName) - const savedAddress = addressEntry && addressEntry.address - - if (!savedAddress) { - logger.error(`Contract ${contractName} not found in address book`) - return - } - - // Only work with addresses deployed with a proxy - if (!addressEntry.proxy) { - logger.error(`Contract ${contractName} was not deployed using a proxy`) - return - } - - // Check if contract already deployed - const isDeployed = await isContractDeployed( - contractName, - savedAddress, - cli.addressBook, - cli.wallet.provider, - false, - ) - if (!isDeployed) { - logger.error( - `Proxy for ${contractName} was not deployed, please run migrate to deploy all contracts`, - ) - return - } - - // Get the proxy admin - const proxyAdminEntry = cli.addressBook.getEntry('GraphProxyAdmin') - if (!proxyAdminEntry || !proxyAdminEntry.address) { - logger.crit('Missing GraphProxyAdmin configuration') - return - } - const proxyAdmin = getContractAt('GraphProxyAdmin', proxyAdminEntry.address).connect(cli.wallet) - - // Get the current proxy and the new implementation contract - const proxy = getContractAt('GraphProxy', addressEntry.address).connect(cli.wallet) - const contract = getContractAt(contractName, implAddress).connect(cli.wallet) - - // Check if implementation already set - const currentImpl = await proxyAdmin.getProxyImplementation(proxy.address) - if (currentImpl === implAddress) { - logger.error( - `Contract ${implAddress} is already the current implementation for proxy ${proxy.address}`, - ) - return - } - - // Upgrade to new implementation - if (buildAcceptProxyTx) { - logger.info( - ` - Copy this data in the gnosis multisig UI, or a similar app and call upgrade() - You must call upgrade() BEFORE calling acceptProxy() - - contract address: ${proxyAdmin.address} - proxy: ${proxy.address} - implementation: ${implAddress} - `, - ) - if (initArgs) { - const initTx = await contract.populateTransaction.initialize(...initArgs.split(',')) - logger.info( - ` - Copy this data in the gnosis multisig UI, or a similar app and call acceptProxyAndCall() - - contract address: ${proxyAdmin.address} - implementation: ${contract.address} - proxy: ${proxy.address} - data: ${initTx.data} - `, - ) - } else { - logger.info( - ` - Copy this data in the gnosis multisig UI, or a similar app and call acceptProxy() - - contract address: ${proxyAdmin.address} - implementation: ${contract.address} - proxy: ${proxy.address} - `, - ) - } - } else { - const receipt = await sendTransaction(cli.wallet, proxyAdmin, 'upgrade', [ - proxy.address, - implAddress, - ]) - if (receipt.status == 1) { - logger.info('> upgrade() tx successful!') - } else { - logger.info('> upgrade() tx failed!') - return - } - - // Accept upgrade from the implementation - if (initArgs) { - const initTx = await contract.populateTransaction.initialize(...initArgs.split(',')) - await sendTransaction(cli.wallet, proxyAdmin, 'acceptProxyAndCall', [ - implAddress, - proxy.address, - initTx.data, - ]) - } else { - await sendTransaction(cli.wallet, proxyAdmin, 'acceptProxy', [implAddress, proxy.address]) - } - } - - // TODO - // -- update address book entry -} - -export const upgradeCommand = { - command: 'upgrade', - describe: 'Upgrade a proxy contract implementation', - builder: (yargs: Argv): yargs.Argv => { - return yargs - .option('impl', { - description: 'Address of the contract implementation', - type: 'string', - requiresArg: true, - demandOption: true, - }) - .option('init', { - description: 'Init arguments as comma-separated values', - type: 'string', - requiresArg: true, - }) - .option('contract', { - description: 'Contract name to upgrade', - type: 'string', - requiresArg: true, - demandOption: true, - }) - .option('b', { - alias: 'build-tx', - description: 'Build the acceptProxy tx and print it. Then use tx data with a multisig', - }) - }, - handler: async (argv: CLIArgs): Promise => { - return upgradeProxy(await loadEnv(argv), argv) - }, -} diff --git a/cli/commands/simulations/baseSimulation.ts b/cli/commands/simulations/baseSimulation.ts deleted file mode 100755 index c0002987f..000000000 --- a/cli/commands/simulations/baseSimulation.ts +++ /dev/null @@ -1,339 +0,0 @@ -// #!/usr/bin/env ts-node -// import * as dotenv from 'dotenv' - -// import { Wallet, utils } from 'ethers' - -// TODO - uncomment and rebuild this all, most the functions have been renamed, so it needs -// a full overhaul - -// import { -// ConnectedCuration, -// ConnectedGNS, -// ConnectedGraphToken, -// ConnectedENS, -// ConnectedEthereumDIDRegistry, -// ConnectedServiceRegistry, -// ConnectedStaking, -// } from '../../../contracts/connectedContracts' -// import { connectContracts } from '../../../contracts/connectedNetwork' -// import { AccountMetadata, SubgraphMetadata } from '../../../mockData/metadataHelpers' -// import * as AccountDatas from '../../../mockData/account-metadata/accountMetadatas' -// import * as SubgraphDatas from '../../../mockData/subgraph-metadata/subgraphMetadatas' -// import { -// userAccounts, -// proxyAccounts, -// channelAccounts, -// executeTransaction, -// checkGovernor, -// mockChannelPubKeys, -// mockDeploymentIDsBase58, -// mockDeploymentIDsBytes32, -// } from '../../../contracts/helpers' - -// dotenv.config() -// const accountMetadatas = AccountDatas.default -// const subgraphMetadatas = SubgraphDatas.default - -// // Send ETH to accounts that will act as indexers, curators, etc, to interact with the contracts -// const sendEth = async ( -// network: string, -// governor: Wallet, -// signers: Array, -// proxies: Array, -// amount: string, -// ) => { -// console.log('Sending ETH...') -// checkGovernor(governor.address, network) -// const amountEther = utils.parseEther(amount) -// for (let i = 1; i < signers.length; i++) { -// const data = { -// to: signers[i].address, -// value: amountEther, -// } -// await executeTransaction(governor.sendTransaction(data), network) -// } -// for (let i = 0; i < proxies.length; i++) { -// const data = { -// to: proxies[i].address, -// value: amountEther, -// } -// await executeTransaction(governor.sendTransaction(data), network) -// } -// } - -// // Send GRT to accounts that will act as indexers, curators, etc, to interact with the contracts -// const populateGraphToken = async ( -// network: string, -// signers: Array, -// proxies: Array, -// amount: string, -// ) => { -// console.log('Running graph token contract calls...') -// const graphToken = new ConnectedGraphToken(network, signers[0]) // defaults to governor -// console.log('Sending GRT to indexers, curators, and proxies...') -// for (let i = 0; i < signers.length; i++) { -// await executeTransaction(graphToken.transferWithDecimals(signers[i].address, amount), network) -// await executeTransaction(graphToken.transferWithDecimals(proxies[i].address, amount), network) -// } -// } - -// // Call set attribute for the signers -// const populateEthereumDIDRegistry = async (network: string, signers: Array) => { -// console.log('Running did registry contract calls...') -// let i = 0 -// for (const account in accountMetadatas) { -// const edr = new ConnectedEthereumDIDRegistry(network, signers[i]) -// const name = accountMetadatas[account].name -// console.log( -// `Calling setAttribute on DID registry for ${name} and account ${edr.configuredWallet.address} ...`, -// ) -// const ipfs = 'https://api.thegraph.com/ipfs/' -// await executeTransaction( -// edr.pinIPFSAndSetAttribute(ipfs, accountMetadatas[account] as AccountMetadata), -// network, -// ) -// i++ -// } -// } - -// // Register ENS names for the signers -// // Do this manually, in the Rinkeby UI. No need to test it multiple times - -// // Publish 10 subgraphs -// // Publish new versions for them all -// // Deprecate 1 -// const populateGNS = async (network: string, signers: Array) => { -// console.log('Running GNS contract calls...') -// let i = 0 -// for (const subgraph in subgraphMetadatas) { -// const gns = new ConnectedGNS(network, signers[i]) -// const ipfs = 'https://api.thegraph.com/ipfs/' -// let name = subgraphMetadatas[subgraph].displayName -// // edge case - graph is only ens name that doesn't match display name in mock data -// if (name == 'The Graph') name = 'graphprotocol' -// const nameIdentifier = utils.namehash(`${name}.test`) -// console.log(`Publishing ${name} for ${gns.configuredWallet.address} on GNS ...`) -// await executeTransaction( -// gns.pinIPFSAndNewSubgraph( -// ipfs, -// gns.configuredWallet.address, -// mockDeploymentIDsBase58[i], -// nameIdentifier, -// name, -// subgraphMetadatas[subgraph] as SubgraphMetadata, -// ), -// network, -// ) -// console.log(`Updating version of ${name} for ${gns.configuredWallet.address} on GNS ...`) -// await executeTransaction( -// gns.pinIPFSAndNewVersion( -// ipfs, -// gns.configuredWallet.address, -// mockDeploymentIDsBase58[i], -// nameIdentifier, -// name, -// subgraphMetadatas[subgraph] as SubgraphMetadata, -// '0', // TODO, only works on the first run right now, make more robust -// ), -// network, -// ) -// i++ -// } - -// // Deprecation one subgraph for account 5 -// const gns = new ConnectedGNS(network, signers[5]) -// await executeTransaction(gns.gns.deprecate(gns.configuredWallet.address, '0'), network) -// } - -// // Each GraphAccount curates on their own -// // Then we signal on a few to make them higher, and see bonding curves in action -// // Then we run some redeems -// const populateCuration = async (network: string, signers: Array) => { -// console.log('Running curation contract calls...') -// const signalAmount = '5000' -// const signalAmountBig = '10000' -// const totalAmount = '25000' -// for (let i = 0; i < signers.length; i++) { -// const curation = new ConnectedCuration(network, signers[i]) -// const connectedGT = new ConnectedGraphToken(network, signers[i]) -// console.log('First calling approve() to ensure curation contract can call transferFrom()...') -// await executeTransaction( -// connectedGT.approveWithDecimals(curation.contract.address, totalAmount), -// network, -// ) -// console.log('Now calling multiple signal() txs on curation...') -// await executeTransaction( -// curation.signalWithDecimals(mockDeploymentIDsBytes32[i], signalAmount), -// network, -// ) -// await executeTransaction( -// curation.signalWithDecimals(mockDeploymentIDsBytes32[0], signalAmount), -// network, -// ) -// await executeTransaction( -// curation.signalWithDecimals(mockDeploymentIDsBytes32[1], signalAmount), -// network, -// ) -// await executeTransaction( -// curation.signalWithDecimals(mockDeploymentIDsBytes32[2], signalAmountBig), -// network, -// ) -// } -// const redeemAmount = '1' // Redeeming SHARES/Signal, NOT tokens. 1 share can be a lot of tokens -// console.log('Running redeem transactions...') -// for (let i = 0; i < signers.length / 2; i++) { -// const curation = new ConnectedCuration(network, signers[i]) -// await executeTransaction( -// curation.redeemWithDecimals(mockDeploymentIDsBytes32[1], redeemAmount), -// network, -// ) -// } -// } - -// // Register 10 indexers -// // Unregister them all -// // Register all 10 again -// const populateServiceRegistry = async (network: string, signers: Array) => { -// console.log('Running service registry contract calls...') -// // Lat = 43.651 Long = -79.382, resolves to the geohash dpz83d (downtown toronto) -// // TODO = implement GEOHASH in the exportable code. For now, we just use 10 geohashes -// const geoHashes: Array = [ -// 'dpz83d', -// 'dpz83a', -// 'dpz83b', -// 'dpz83c', -// 'dpz83e', -// 'dpz83f', -// 'dpz83g', -// 'dpz83h', -// 'dpz83i', -// 'dpz83j', -// ] - -// const urls: Array = [ -// 'https://indexer1.com', -// 'https://indexer2.com', -// 'https://indexer3.com', -// 'https://indexer4.com', -// 'https://indexer5.com', -// 'https://indexer6.com', -// 'https://indexer7.com', -// 'https://indexer8.com', -// 'https://indexer9.com', -// 'https://indexer10.com', -// ] - -// for (let i = 0; i < signers.length; i++) { -// const serviceRegistry = new ConnectedServiceRegistry(network, signers[i]) -// console.log(`Registering an indexer in the service registry...`) -// await executeTransaction(serviceRegistry.contract.register(urls[i], geoHashes[i]), network) -// if (i < 2) { -// // Just need to test a few -// console.log(`Unregistering a few to test...`) -// await executeTransaction(serviceRegistry.contract.unregister(), network) -// console.log(`Re-registering them...`) -// await executeTransaction(serviceRegistry.contract.register(urls[i], geoHashes[i]), network) -// } -// } -// } - -// // Deposit for 10 users -// // Set thawing period to 0 -// // Unstake for a few users, then withdraw -// // Set epochs to one block -// // Create 10 allocations -// // Close 5 allocations (Close is called by the proxies) -// // Set back thawing period and epoch manager to default -// const populateStaking = async (network: string, signers: Array, proxies: Array) => { -// console.log('Running staking contract calls...') -// checkGovernor(signers[0].address, network) -// const networkContracts = await connectContracts(signers[0], network) -// const epochManager = networkContracts.epochManager -// const stakeAmount = '10000' - -// for (let i = 0; i < signers.length; i++) { -// const staking = new ConnectedStaking(network, signers[i]) -// const connectedGT = new ConnectedGraphToken(network, signers[i]) -// console.log( -// 'First calling approve() to ensure staking contract can call transferFrom() from the stakers...', -// ) -// await executeTransaction( -// connectedGT.approveWithDecimals(staking.contract.address, stakeAmount), -// network, -// ) -// console.log('Now calling stake()...') -// await executeTransaction(staking.stakeWithDecimals(stakeAmount), network) -// } - -// console.log('Calling governor function to set epoch length to 1...') -// await executeTransaction(epochManager.setEpochLength(1), network) -// console.log('Calling governor function to set thawing period to 0...') -// await executeTransaction(networkContracts.staking.setThawingPeriod(0), network) -// console.log('Approve, stake extra, initialize unstake and withdraw for 3 signers...') -// for (let i = 0; i < 3; i++) { -// const staking = new ConnectedStaking(network, signers[i]) -// const connectedGT = new ConnectedGraphToken(network, signers[i]) -// await executeTransaction( -// connectedGT.approveWithDecimals(staking.contract.address, stakeAmount), -// network, -// ) -// await executeTransaction(staking.stakeWithDecimals(stakeAmount), network) -// await executeTransaction(staking.unstakeWithDecimals(stakeAmount), network) -// await executeTransaction(staking.contract.withdraw(), network) -// } - -// console.log('Create 10 allocations...') -// for (let i = 0; i < signers.length; i++) { -// const staking = new ConnectedStaking(network, signers[i]) -// await executeTransaction( -// staking.allocateWithDecimals( -// stakeAmount, -// '0', -// proxies[i].address, -// mockDeploymentIDsBytes32[i], -// mockChannelPubKeys[i], -// ), -// network, -// ) -// } - -// console.log('Run Epoch....') -// await executeTransaction(epochManager.runEpoch(), network) -// console.log('Close 5 allocations...') -// for (let i = 0; i < 5; i++) { -// // Note that the array of proxy wallets is used, not the signers -// const connectedGT = new ConnectedGraphToken(network, proxies[i]) -// const staking = new ConnectedStaking(network, proxies[i]) -// console.log( -// 'First calling approve() to ensure staking contract can call transferFrom() from the proxies...', -// ) -// await executeTransaction( -// connectedGT.approveWithDecimals(staking.contract.address, stakeAmount), -// network, -// ) -// console.log('Settling a channel...') -// await executeTransaction(staking.closeWithDecimals(stakeAmount), network) -// } -// const defaultThawingPeriod = 20 -// const defaultEpochLength = 5760 -// console.log('Setting epoch length back to default') -// await executeTransaction(epochManager.setEpochLength(defaultEpochLength), network) -// console.log('Setting back the thawing period to default') -// await executeTransaction(networkContracts.staking.setThawingPeriod(defaultThawingPeriod), network) -// } - -// const baseSimulation = async (mnemonic: string, provider: string, network: string): Promise => { -// const users = userAccounts(mnemonic, provider) -// const proxies = proxyAccounts(mnemonic, provider) -// const channels = channelAccounts(mnemonic, provider) -// const governor = signers[0] -// // await sendEth(network, governor, userAccounts, proxyAccounts, '0.25') // only use at the start. TODO - make this a cli option or something -// await populateGraphToken(network, users, proxies, '100000') // only use at the start. TODO - make this a cli option or something -// await populateEthereumDIDRegistry(network, users) -// await populateGNS(network, users) -// await populateCuration(network, users) -// await populateServiceRegistry(network, users) -// await populateStaking(network, users, proxies) -// } - -export const baseSimulation = async (): Promise => {} diff --git a/cli/commands/simulations/curatorSimulation.ts b/cli/commands/simulations/curatorSimulation.ts deleted file mode 100644 index f3f182c9b..000000000 --- a/cli/commands/simulations/curatorSimulation.ts +++ /dev/null @@ -1,173 +0,0 @@ -import { parseGRT, formatGRT } from '@graphprotocol/common-ts' -import yargs, { Argv } from 'yargs' - -import { logger } from '../../logging' -import { sendTransaction } from '../../network' -import { loadEnv, CLIArgs, CLIEnvironment } from '../../env' -import { parseCreateSubgraphsCSV, CurateSimulationTransaction, parseUnsignalCSV } from './parseCSV' -import { pinMetadataToIPFS, IPFS } from '../../helpers' -import { BigNumber } from 'ethers' - -export const toBN = (value: string | number): BigNumber => BigNumber.from(value) - -const createSubgraphs = async ( - cli: CLIEnvironment, - txData: CurateSimulationTransaction[], -): Promise => { - const gns = cli.contracts.GNS - const ipfs = 'https://api.thegraph.com/ipfs/' - const graphAccount = cli.walletAddress - const versionPath = '/mockData/version-metadata/firstVersion.json' - const versionHashBytes = await pinMetadataToIPFS(ipfs, 'version', versionPath) - - for (let i = 0; i < txData.length; i++) { - const subgraph = txData[i] - const subgraphDeploymentIDBytes = IPFS.ipfsHashToBytes32(subgraph.subgraphID) - const subgraphHashBytes = await pinMetadataToIPFS( - ipfs, - 'subgraph', - undefined, - subgraph.subgraph, - ) - logger.info(`Publishing new subgraph: ${subgraph.subgraph.displayName}`) - logger.info(` Sender: ${cli.wallet.address}`) - logger.info(` Graph Account: ${graphAccount}`) - logger.info(` Subgraph Deployment ID: ${subgraphDeploymentIDBytes}`) - logger.info(` Version Hash: ${versionHashBytes}`) - logger.info(` Subgraph Hash: ${subgraphHashBytes}`) - - await sendTransaction(cli.wallet, gns, 'publishNewSubgraph', [ - graphAccount, - subgraphDeploymentIDBytes, - versionHashBytes, - subgraphHashBytes, - ]) - } -} - -// Curates on a list on subgraph, from an imported csv file -const curateOnSubgraphs = async ( - cli: CLIEnvironment, - txData: CurateSimulationTransaction[], - firstSubgraphNumber: number, -): Promise => { - for (let i = 0; i < txData.length; i++) { - const subgraph = txData[i] - const graphAccount = cli.walletAddress - const tokens = parseGRT(subgraph.signal) - const minNSignal = parseGRT(`0`) - const gns = cli.contracts.GNS - - logger.info(`Minting nSignal for ${graphAccount}-${firstSubgraphNumber}...`) - // TODO - this fails on gas estimate, might need to hardcode it in, but this happens for other funcs too - await sendTransaction(cli.wallet, gns, 'mintNSignal', [ - graphAccount, - firstSubgraphNumber, - tokens, - minNSignal, - ]) - firstSubgraphNumber++ - } -} - -const create = async (cli: CLIEnvironment, cliArgs: CLIArgs): Promise => { - const txData = parseCreateSubgraphsCSV(__dirname + cliArgs.path) - logger.info(`Running create for ${txData.length} subgraphs`) - await createSubgraphs(cli, txData) -} - -const signal = async (cli: CLIEnvironment, cliArgs: CLIArgs): Promise => { - // First approve the GNS - const maxUint = '115792089237316195423570985008687907853269984665640564039457584007913129639935' - const gnsAddr = cli.contracts.GNS.address - const graphToken = cli.contracts.GraphToken - - logger.info(`Approving MAX tokens for user GNS to spend on behalf of ${cli.walletAddress}...`) - await sendTransaction(cli.wallet, graphToken, 'approve', [gnsAddr, maxUint]) - - const txData = parseCreateSubgraphsCSV(__dirname + cliArgs.path) - logger.info(`Running signal for ${txData.length} subgraphs`) - await curateOnSubgraphs(cli, txData, cliArgs.firstSubgraphNumber) -} - -const unsignal = async (cli: CLIEnvironment, cliArgs: CLIArgs): Promise => { - const txData = parseUnsignalCSV(__dirname + cliArgs.path) - const gns = cli.contracts.GNS - - logger.info(`Burning nSignal for ${txData.length} accounts...`) - for (let i = 0; i < txData.length; i++) { - logger.info(`Getting nSignal balance...`) - const nBalance = toBN( - (await gns.getCuratorNSignal(cli.walletAddress, i, cli.walletAddress)).toString(), - ) - const burnPercent = toBN(txData[i].amount) - const burnAmount = nBalance.mul(burnPercent).div(toBN(100)) - - const account = txData[i].account - const subgraphNumber = txData[i].subgraphNumber - logger.info(`Burning ${formatGRT(burnAmount)} nSignal for ${account}-${subgraphNumber}...`) - await sendTransaction(cli.wallet, gns, 'burnNSignal', [account, subgraphNumber, burnAmount, 0]) - } -} -export const curatorSimulationCommand = { - command: 'curatorSimulation', - describe: 'Simulates creating multiple subgraphs and then curating on them, from a csv file', - builder: (yargs: Argv): yargs.Argv => { - return yargs - .command({ - command: 'create', - describe: 'Create and signal on subgraphs by reading data from a csv file', - builder: (yargs: Argv) => { - return yargs.option('path', { - description: 'Path of the csv file relative to this folder', - type: 'string', - requiresArg: true, - demandOption: true, - }) - }, - handler: async (argv: CLIArgs): Promise => { - return create(await loadEnv(argv), argv) - }, - }) - .command({ - command: 'signal', - describe: 'Signal on a bunch of subgraphs by reading data from a CSV', - builder: (yargs: Argv) => { - return yargs - .option('path', { - description: 'Path of the csv file relative to this folder', - type: 'string', - requiresArg: true, - demandOption: true, - }) - .option('firstSubgraphNumber', { - description: 'First subgraph to be newly curated', - type: 'number', - requiresArg: true, - demandOption: true, - }) - }, - handler: async (argv: CLIArgs): Promise => { - return signal(await loadEnv(argv), argv) - }, - }) - .command({ - command: 'unsignal', - describe: 'Unsignal on a bunch of subgraphs by reading data from a CSV', - builder: (yargs: Argv) => { - return yargs.option('path', { - description: 'Path of the csv file relative to this folder', - type: 'string', - requiresArg: true, - demandOption: true, - }) - }, - handler: async (argv: CLIArgs): Promise => { - return unsignal(await loadEnv(argv), argv) - }, - }) - }, - handler: (): void => { - yargs.showHelp() - }, -} diff --git a/cli/commands/simulations/index.ts b/cli/commands/simulations/index.ts deleted file mode 100644 index 24660fa4f..000000000 --- a/cli/commands/simulations/index.ts +++ /dev/null @@ -1,13 +0,0 @@ -import yargs, { Argv } from 'yargs' -import { curatorSimulationCommand } from './curatorSimulation' - -export const simulationCommand = { - command: 'simulation', - describe: 'Run a simulation', - builder: (yargs: Argv): yargs.Argv => { - return yargs.command(curatorSimulationCommand) - }, - handler: (): void => { - yargs.showHelp() - }, -} diff --git a/cli/commands/simulations/parseCSV.ts b/cli/commands/simulations/parseCSV.ts deleted file mode 100644 index d1b614a36..000000000 --- a/cli/commands/simulations/parseCSV.ts +++ /dev/null @@ -1,65 +0,0 @@ -import fs from 'fs' -// import { utils } from 'ethers' - -import { SubgraphMetadata } from '../../metadata' - -export interface CurateSimulationTransaction { - subgraphID: string - signal: string - subgraph: SubgraphMetadata -} - -// Parses a CSV where the titles are ordered like so: -// displayName,description,subgraphID,signal,codeRepository,image,website -export function parseCreateSubgraphsCSV(path: string): Array { - const data = fs.readFileSync(path, 'utf8') - const subgraphs = data.split('\n').map((e) => e.trim()) - const txData: Array = [] - for (let i = 1; i < subgraphs.length; i++) { - // skip the csv title line by starting at 1 - const csvSubgraph = subgraphs[i] - - const [displayName, description, subgraphID, signal, codeRepository, image, website] = - csvSubgraph.split(',').map((e) => e.trim()) - const subgraph: SubgraphMetadata = { - description: description, - displayName: displayName, - image: image, - codeRepository: codeRepository, - website: website, - } - - const curateData: CurateSimulationTransaction = { - subgraphID: subgraphID, - signal: signal, - subgraph: subgraph, - } - txData.push(curateData) - } - return txData -} - -export interface UnsignalTransaction { - account: string - subgraphNumber: string - amount: string -} - -// Parses a CSV for unsignalling -export function parseUnsignalCSV(path: string): Array { - const data = fs.readFileSync(path, 'utf8') - const subgraphs = data.split('\n').map((e) => e.trim()) - const txData: Array = [] - for (let i = 1; i < subgraphs.length; i++) { - // skip the csv title line by starting at 1 - const csvData = subgraphs[i] - const [account, subgraphNumber, amount] = csvData.split(',').map((e) => e.trim()) - const data: UnsignalTransaction = { - account: account, - subgraphNumber: subgraphNumber, - amount: amount, - } - txData.push(data) - } - return txData -} diff --git a/cli/config.ts b/cli/config.ts deleted file mode 100644 index e99ee6f57..000000000 --- a/cli/config.ts +++ /dev/null @@ -1,95 +0,0 @@ -import fs from 'fs' -import YAML from 'yaml' - -import { AddressBook } from './address-book' - -const ABRefMatcher = /\${{([A-Z]\w.+)}}/ - -type ContractParam = { name: string; value: string } -type ContractCall = { fn: string; params: Array } -type ContractCallParam = string | number -interface ContractConfig { - params: Array - calls: Array - proxy: boolean -} - -function parseConfigValue(value: string, addressBook: AddressBook) { - if (isAddressBookRef(value)) { - return parseAddressBookRef(addressBook, value) - } - return value -} - -function isAddressBookRef(value: string): boolean { - return ABRefMatcher.test(value) -} - -function parseAddressBookRef(addressBook: AddressBook, value: string): string { - const ref: string = ABRefMatcher.exec(value as string)[1] - const [contractName, contractAttr] = ref.split('.') - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const entry = addressBook.getEntry(contractName) as { [key: string]: any } - return entry[contractAttr] -} - -// eslint-disable-next-line @typescript-eslint/no-explicit-any -export function readConfig(path: string): any { - const file = fs.readFileSync(path, 'utf8') - return YAML.parse(file) -} - -export function loadCallParams( - values: Array, - addressBook: AddressBook, -): Array { - return values.map((value) => parseConfigValue(value as string, addressBook)) -} - -export function getContractConfig( - config: any, - addressBook: AddressBook, - name: string, -): ContractConfig { - const contractConfig = config.contracts[name] || {} - const contractParams: Array = [] - const contractCalls: Array = [] - let proxy = false - - const optsList = Object.entries(contractConfig) as Array> - for (const [name, value] of optsList) { - // Process constructor params - if (name.startsWith('init')) { - const initList = Object.entries(contractConfig.init) as Array> - for (const [initName, initValue] of initList) { - contractParams.push({ name: initName, value: parseConfigValue(initValue, addressBook) } as { - name: string - value: string - }) - } - continue - } - - // Process contract calls - if (name.startsWith('calls')) { - for (const entry of contractConfig.calls) { - const fn = entry['fn'] - const params = Object.values(entry).slice(1) as Array // skip fn - contractCalls.push({ fn, params }) - } - continue - } - - // Process proxy - if (name.startsWith('proxy')) { - proxy = Boolean(value) - continue - } - } - - return { - params: contractParams, - calls: contractCalls, - proxy, - } -} diff --git a/cli/contracts.ts b/cli/contracts.ts deleted file mode 100644 index 187ae8e97..000000000 --- a/cli/contracts.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { providers, Signer } from 'ethers' - -import { AddressBook } from './address-book' -import { logger } from './logging' -import { getContractAt } from './network' - -import { EpochManager } from '../build/types/EpochManager' -import { DisputeManager } from '../build/types/DisputeManager' -import { Staking } from '../build/types/Staking' -import { ServiceRegistry } from '../build/types/ServiceRegistry' -import { Curation } from '../build/types/Curation' -import { RewardsManager } from '../build/types/RewardsManager' -import { GNS } from '../build/types/GNS' -import { GraphProxyAdmin } from '../build/types/GraphProxyAdmin' -import { GraphToken } from '../build/types/GraphToken' -import { Controller } from '../build/types/Controller' -import { BancorFormula } from '../build/types/BancorFormula' -import { IENS } from '../build/types/IENS' -import { IEthereumDIDRegistry } from '../build/types/IEthereumDIDRegistry' -import { GraphGovernance } from '../build/types/GraphGovernance' - -export interface NetworkContracts { - EpochManager: EpochManager - DisputeManager: DisputeManager - Staking: Staking - ServiceRegistry: ServiceRegistry - Curation: Curation - RewardsManager: RewardsManager - GNS: GNS - GraphProxyAdmin: GraphProxyAdmin - GraphToken: GraphToken - Controller: Controller - BancorFormula: BancorFormula - IENS: IENS - IEthereumDIDRegistry: IEthereumDIDRegistry - GraphGovernance: GraphGovernance -} - -export const loadContracts = ( - addressBook: AddressBook, - signerOrProvider?: Signer | providers.Provider, -): NetworkContracts => { - const contracts = {} - for (const contractName of addressBook.listEntries()) { - const contractEntry = addressBook.getEntry(contractName) - try { - const contract = getContractAt(contractName, contractEntry.address) - contracts[contractName] = contract - if (signerOrProvider) { - contracts[contractName] = contracts[contractName].connect(signerOrProvider) - } - } catch (err) { - logger.warn(`Could not load contract ${contractName} - ${err.message}`) - } - } - return contracts as NetworkContracts -} diff --git a/cli/defaults.ts b/cli/defaults.ts deleted file mode 100644 index c63decc81..000000000 --- a/cli/defaults.ts +++ /dev/null @@ -1,58 +0,0 @@ -import { Options } from 'yargs' -import { Overrides } from 'ethers' - -export const local = { - mnemonic: 'myth like bonus scare over problem client lizard pioneer submit female collect', - providerUrl: 'http://localhost:8545', - addressBookPath: './addresses.json', - graphConfigPath: './graph.config.yml', - accountNumber: '0', -} -export const defaultOverrides: Overrides = { - // gasPrice: utils.parseUnits('25', 'gwei'), // auto - // gasLimit: 2000000, // auto -} - -export const cliOpts = { - addressBook: { - alias: 'address-book', - description: 'The path to your address book file', - type: 'string', - group: 'Config', - default: local.addressBookPath, - }, - graphConfig: { - alias: 'graph-config', - description: 'The path to the config file', - type: 'string', - group: 'Config', - default: local.graphConfigPath, - }, - providerUrl: { - alias: 'provider-url', - description: 'The URL of an Ethereum provider', - type: 'string', - group: 'Ethereum', - default: local.providerUrl, - }, - mnemonic: { - alias: 'mnemonic', - description: 'The mnemonic for an account which will pay for gas', - type: 'string', - group: 'Ethereum', - default: local.mnemonic, - }, - accountNumber: { - alias: 'account-number', - description: 'The account number of the mnemonic', - type: 'string', - group: 'Ethereum', - default: local.accountNumber, - }, - force: { - alias: 'force', - description: "Deploy contract even if it's already deployed", - type: 'boolean', - default: false, - }, -} as { [key: string]: Options } diff --git a/cli/env.ts b/cli/env.ts deleted file mode 100644 index 7af11c79c..000000000 --- a/cli/env.ts +++ /dev/null @@ -1,64 +0,0 @@ -import { utils, BigNumber, Wallet, Overrides } from 'ethers' -import { Argv } from 'yargs' - -import { logger } from './logging' -import { getAddressBook, AddressBook } from './address-book' -import { defaultOverrides } from './defaults' -import { getProvider } from './utils' -import { loadContracts, NetworkContracts } from './contracts' - -const { formatEther } = utils - -// eslint-disable-next-line @typescript-eslint/no-explicit-any -export type CLIArgs = { [key: string]: any } & Argv['argv'] - -export interface CLIEnvironment { - balance: BigNumber - chainId: number - nonce: number - walletAddress: string - wallet: Wallet - addressBook: AddressBook - contracts: NetworkContracts - argv: CLIArgs -} - -export const displayGasOverrides = (): Overrides => { - const r = { gasPrice: 'auto', gasLimit: 'auto', ...defaultOverrides } - if (r['gasPrice']) { - r['gasPrice'] = r['gasPrice'].toString() - } - return r -} - -export const loadEnv = async (argv: CLIArgs, wallet?: Wallet): Promise => { - if (!wallet) { - wallet = Wallet.fromMnemonic(argv.mnemonic, `m/44'/60'/0'/0/${argv.accountNumber}`).connect( - getProvider(argv.providerUrl), - ) - } - - const balance = await wallet.getBalance() - const chainId = (await wallet.provider.getNetwork()).chainId - const nonce = await wallet.getTransactionCount() - const walletAddress = await wallet.getAddress() - const addressBook = getAddressBook(argv.addressBook, chainId.toString()) - const contracts = loadContracts(addressBook, wallet) - - logger.info(`Preparing contracts on chain id: ${chainId}`) - logger.info( - `Connected Wallet: address=${walletAddress} nonce=${nonce} balance=${formatEther(balance)}\n`, - ) - logger.info('Gas settings:', displayGasOverrides(), '\n') - - return { - balance, - chainId, - nonce, - walletAddress, - wallet, - addressBook, - contracts, - argv, - } -} diff --git a/cli/helpers.ts b/cli/helpers.ts deleted file mode 100644 index 17dd9a04b..000000000 --- a/cli/helpers.ts +++ /dev/null @@ -1,219 +0,0 @@ -import fs from 'fs' -import * as dotenv from 'dotenv' - -import { utils, providers, Wallet } from 'ethers' -import ipfsHttpClient from 'ipfs-http-client' - -import * as bs58 from 'bs58' - -import { logger } from './logging' - -import { - SubgraphMetadata, - VersionMetadata, - jsonToSubgraphMetadata, - jsonToVersionMetadata, -} from './metadata' - -dotenv.config() - -export class IPFS { - static createIpfsClient(node: string): typeof ipfsHttpClient { - let url: URL - try { - url = new URL(node) - } catch (e) { - throw new Error( - `Invalid IPFS URL: ${node}. ` + - `The URL must be of the following format: http(s)://host[:port]/[path]`, - ) - } - - return ipfsHttpClient({ - protocol: url.protocol.replace(/[:]+$/, ''), - host: url.hostname, - 'api-path': url.pathname.replace(/\/$/, '') + '/api/v0/', - }) - } - - static ipfsHashToBytes32(hash: string): string { - const hashBytes = bs58.decode(hash).slice(2) - return utils.hexlify(hashBytes) - } -} - -export const pinMetadataToIPFS = async ( - ipfs: string, - type: string, - path?: string, // Only pass path or metadata, not both - metadata?: SubgraphMetadata | VersionMetadata, -): Promise => { - if (metadata == undefined && path != undefined) { - if (type == 'subgraph') { - metadata = jsonToSubgraphMetadata(JSON.parse(fs.readFileSync(__dirname + path).toString())) - logger.info('Meta data:') - logger.info(' Subgraph Description: ', metadata.description) - logger.info(' Subgraph Display Name: ', metadata.displayName) - logger.info(' Subgraph Image: ', metadata.image) - logger.info(' Subgraph Code Repository: ', metadata.codeRepository) - logger.info(' Subgraph Website: ', metadata.website) - } else if (type == 'version') { - metadata = jsonToVersionMetadata(JSON.parse(fs.readFileSync(__dirname + path).toString())) - logger.info('Meta data:') - logger.info(' Version Description: ', metadata.description) - logger.info(' Version Label: ', metadata.label) - } - } - - const ipfsClient = new ipfsHttpClient(ipfs + 'api/v0') - let result - logger.info(`\nUpload JSON meta data for ${type} to IPFS...`) - try { - result = await ipfsClient.add(Buffer.from(JSON.stringify(metadata))) - } catch (e) { - logger.error(`Failed to upload to IPFS: ${e}`) - return - } - - const metaHash = result.path - - // TODO - maybe add this back in. ipfs-http-client was updated, so it broke - // try { - // const data = await ipfsClient.cat(metaHash) - // if (JSON.stringify(data) !== JSON.stringify(metadata)) { - // throw new Error(`Original meta data and uploaded data are not identical`) - // } - // } catch (e) { - // throw new Error(`Failed to retrieve and parse JSON meta data after uploading: ${e.message}`) - // } - logger.info(`Upload metadata successful: ${metaHash}\n`) - return IPFS.ipfsHashToBytes32(metaHash) -} - -export const mockDeploymentIDsBase58: Array = [ - 'Qmb7e8bYoj93F9u33R3JY1H764626C8KHUgWMeVjWPiwdD', //compound - 'QmXenxBqM7uBbRq6y7EAcy86mfcaBkWE53Tz53H3dVeeit', //used synthetix - 'QmY8Uzg61ttrogeTyCKLcDDR4gKNK44g9qkGDqeProkSHE', //ens - 'QmRkqEVeZ8bRmMfvBHJvoB4NbnPgXNcuszLZWNNF49skY8', //livepeer - 'Qmb3hd2hYd2nWFgcmRswykF1dUBSrDUrinYCgN1dmE1tNy', //maker - 'QmcqrL62BHSasBsk47tNT1G66BHbaANwY213cX841NWE61', //melon - 'QmTXzATwNfgGVukV1fX2T6xw9f6LAYRVWpsdXyRWzUR2H9', // moloch - 'QmNoMRb9c5nGi5gETeyeAc7V14XvubAMAA7sxEJzsXnpTF', //used aave - 'QmUVKS3W7G7Kog6pGq2ttZtXfE89pRvw45vEJM2YEYwpQz', //thegraph - 'QmNPKaPqgTqKdCv2k3SF9vAhbHo4PVb2cKx2Gs4PzNQkZx', //uniswap -] - -export const mockDeploymentIDsBytes32: Array = [ - IPFS.ipfsHashToBytes32(mockDeploymentIDsBase58[1]), - IPFS.ipfsHashToBytes32(mockDeploymentIDsBase58[0]), - IPFS.ipfsHashToBytes32(mockDeploymentIDsBase58[0]), - IPFS.ipfsHashToBytes32(mockDeploymentIDsBase58[0]), - IPFS.ipfsHashToBytes32(mockDeploymentIDsBase58[0]), - IPFS.ipfsHashToBytes32(mockDeploymentIDsBase58[0]), - IPFS.ipfsHashToBytes32(mockDeploymentIDsBase58[0]), - IPFS.ipfsHashToBytes32(mockDeploymentIDsBase58[0]), - IPFS.ipfsHashToBytes32(mockDeploymentIDsBase58[0]), - IPFS.ipfsHashToBytes32(mockDeploymentIDsBase58[0]), -] - -export const mockChannelPubKeys: Array = [ - '0x0456708870bfd5d8fc956fe33285dcf59b075cd7a25a21ee00834e480d3754bcda180e670145a290bb4bebca8e105ea7776a7b39e16c4df7d4d1083260c6f05d50', - '0x0456708870bfd5d8fc956fe33285dcf59b075cd7a25a21ee00834e480d3754bcda180e670145a290bb4bebca8e105ea7776a7b39e16c4df7d4d1083260c6f05d51', - '0x0456708870bfd5d8fc956fe33285dcf59b075cd7a25a21ee00834e480d3754bcda180e670145a290bb4bebca8e105ea7776a7b39e16c4df7d4d1083260c6f05d52', - '0x0456708870bfd5d8fc956fe33285dcf59b075cd7a25a21ee00834e480d3754bcda180e670145a290bb4bebca8e105ea7776a7b39e16c4df7d4d1083260c6f05d53', - '0x0456708870bfd5d8fc956fe33285dcf59b075cd7a25a21ee00834e480d3754bcda180e670145a290bb4bebca8e105ea7776a7b39e16c4df7d4d1083260c6f05d54', - '0x0456708870bfd5d8fc956fe33285dcf59b075cd7a25a21ee00834e480d3754bcda180e670145a290bb4bebca8e105ea7776a7b39e16c4df7d4d1083260c6f05d55', - '0x0456708870bfd5d8fc956fe33285dcf59b075cd7a25a21ee00834e480d3754bcda180e670145a290bb4bebca8e105ea7776a7b39e16c4df7d4d1083260c6f05d56', - '0x0456708870bfd5d8fc956fe33285dcf59b075cd7a25a21ee00834e480d3754bcda180e670145a290bb4bebca8e105ea7776a7b39e16c4df7d4d1083260c6f05d57', - '0x0456708870bfd5d8fc956fe33285dcf59b075cd7a25a21ee00834e480d3754bcda180e670145a290bb4bebca8e105ea7776a7b39e16c4df7d4d1083260c6f05d58', - '0x0456708870bfd5d8fc956fe33285dcf59b075cd7a25a21ee00834e480d3754bcda180e670145a290bb4bebca8e105ea7776a7b39e16c4df7d4d1083260c6f05d59', -] - -// Creates an array of wallets connected to a provider -const configureWallets = ( - mnemonic: string, - providerEndpoint: string, - count: number, -): Array => { - const signers: Array = [] - for (let i = 0; i < count; i++) { - signers.push(configureWallet(mnemonic, providerEndpoint, i.toString())) - } - logger.info(`Created ${count} wallets!`) - return signers -} - -const DEFAULT_MNEMONIC = - 'myth like bonus scare over problem client lizard pioneer submit female collect' -const GANACHE_ENDPOINT = 'http://localhost:8545' - -export const configureGanacheWallet = (): Wallet => { - return configureWallet(DEFAULT_MNEMONIC, GANACHE_ENDPOINT) -} - -// Create a single wallet connected to a provider -export const configureWallet = ( - mnemonic: string, - providerEndpoint: string, - index = '0', -): Wallet => { - if (mnemonic == undefined) { - throw new Error(`Please set a mnemonic in a .env file at the root of the project`) - } - const wallet = Wallet.fromMnemonic(mnemonic, `m/44'/60'/0'/0/${index}`) - const eth = new providers.JsonRpcProvider(providerEndpoint) - return wallet.connect(eth) -} - -// User accounts used are always 0 to 10 -export const userAccounts = (mnemonic: string, provider: string): Array => { - return configureWallets(mnemonic, provider, 10) -} - -/* Proxy accounts used are always 10 to 20. - Addresses below: - 0x853d474EB22701b94910f275CdB57A62c4B2db7E - 0x2A7f74f2F90d34eceE06E6196D3da7B8FcA02fa2 - 0x048CdeADbcb9E493D19b48eB7B693DC056Fd2036 - 0xD03a084A951B42bEb1a30232B8f738AB288256fa - 0xEF99F3f68Dc194a3720b374c2e3AC56beF8d8D61 - 0x1A8f34607F6495f7E3bF6ee7553C12602B826D7A - 0xEAaeC61E782992f85cCc096a16Fc9C74EfaA5355 - 0xf7c0e78323Fcb0532cEa23d99B63C729e178568A - 0xF6cAdFc68B855e2944f27C5DF4a66c52B24d2d94 - 0x4cc6B907c7Bf1480426075e832Dc35bBC7264077 -*/ -export const proxyAccounts = (mnemonic: string, provider: string): Array => { - const wallets = configureWallets(mnemonic, provider, 20) - return wallets.slice(10, 20) -} - -/* Channel accounts used are always 20 to 30. - Addresses below: - 0x73f0bd80493BEA09BAFAFCdc6E71A9569eAcA0aB - 0xeD12E3068Cdb1F9afD7A038c5a7B1a9b66C5986B - 0x3796d3711070222d49EE6207Fe1cd4b2fcAD0663 - 0xfBD176446f56c0a52f44c5bfC24d339fF4B09470 - 0xbe45140e5783c8F5fA5123fDcC74D209f3c9155b - 0x2084259748B13F800B6aE0b7A33c87e49546BfD8 - 0x81A90593786e6d0fC9cF29C9842Bca4Ab2f1bEb7 - 0xA3e182b8CaC70b43c84a437a4F1774447505EA40 - 0x082b1536F8C9b0Ca3198a911c4934e456C2f7c32 - 0xBA6D2612dEA713e61a7c22E691af4eaea46aCf75 - - Uncompressed public keys below: - 0x04e8c44ab3118e5ca2e470ff20556bb6b470a5265ca0992e82e9a26cf332d87cf6e3add759bd4ed23277fadc46dd9b79fbcce33314cb4a48687830f6a524ebb998 - 0x04c10f828e7ee0cc03dfed95bb8497de9d5366c6b13d9524ef8bcabdd5b1f58f1a38de3332e16a124da62ac298ed1cbfc6d867576635a0151c55ac3d9c84778f1c - 0x04d51dc84783a733fbe1ab91255d8fcd0195c8a03937dd6791426142de8e8da6eb5519cab9730648e3c3dac51bc0865347d80860b7c707944a051e0896cbc7b632 - 0x04dc700c3efcb80c151de25ae5ffa417f2556b5b3a0c9edba771febfdd9f8ea82943f62709942ea23185771b96c976cbb709e307130b4ea343b1888ef200166cce - 0x04185736d5509a687f0b64dd5caf4497443650d67708138daff1ccf3aa900d936cd399a25a58951f3801dfb61f81d48b396e49296bcac67ca35aed5e65fd5e65ed - 0x04f4fd3d15f633540db5fd5f69f3a83b5f9a43b258c0855e8f87dd586e9fd33fb06d72fbfad9fd90c1fd59eccf6589099403583cfb89604eb1b0eb472e61f5fefe - 0x04a880416006af0996a76e1b5d6171c005009d55bd7af8ed78b2af6bfbfafdff755c68f0e32e49ca0627acceec1611d5521dde7b90076c4ba1894e3dfb53c01ffd - 0x047da2b532a32e1f87b570a4675e71fa9a794c43cda4562d1e9c55975534b335f00c8ac1006b7b303d4e72189af7caa70112eff9b47bfe00e37b4d832fcc716b50 - 0x04cc3c74d466211b119217e97806f8ec5f09d865940c99effaae967dc67e282ff09aa1900fdb14865f8e3323cac75d6f193fa85b5c732b742163d1d83d699c04a3 - 0x04c9558bb809ed4c65cce849db4337c29b6c72bec97bb6a600a8af7fc72ded8486ae3a76916e424c9cef6e40721f9c8b265056862897afad7cc859b8e34d4dbc95 -*/ -export const channelAccounts = (mnemonic: string, provider: string): Array => { - const wallets = configureWallets(mnemonic, provider, 30) - return wallets.slice(20, 30) -} diff --git a/cli/index.ts b/cli/index.ts deleted file mode 100644 index 66eb53068..000000000 --- a/cli/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import * as network from './network' - -export { network } diff --git a/cli/logging.ts b/cli/logging.ts deleted file mode 100644 index 40bb65784..000000000 --- a/cli/logging.ts +++ /dev/null @@ -1,18 +0,0 @@ -import winston, { format } from 'winston' - -// const fullFormatter = format.combine( -// format.timestamp({ format: 'YYYY-MM-DD HH:mm:ss.SSS' }), -// format.colorize(), -// format.printf( -// ({ level, message, label, timestamp }) => `${timestamp} ${label || '-'} ${level}: ${message}`, -// ), -// ) - -export const logger: winston.Logger = winston.createLogger({ - level: 'info', - format: format.combine( - format.colorize(), - format.printf(({ message }) => `${message}`), - ), - transports: [new winston.transports.Console({ level: 'info' })], -}) diff --git a/cli/metadata.ts b/cli/metadata.ts deleted file mode 100644 index 96b74068c..000000000 --- a/cli/metadata.ts +++ /dev/null @@ -1,68 +0,0 @@ -interface AccountMetadata { - codeRepository: string - description: string - image: string - name: string - website: string - displayName -} - -interface SubgraphMetadata { - description: string - displayName: string - image: string - codeRepository: string - website: string -} - -interface VersionMetadata { - label: string - description: string -} - -const jsonToSubgraphMetadata = (json): SubgraphMetadata => { - const subgraphMetadata: SubgraphMetadata = { - description: checkString(json.description), - displayName: checkString(json.displayName), - image: checkString(json.image), - codeRepository: checkString(json.codeRepository), - website: checkString(json.website), - } - return subgraphMetadata -} - -const jsonToVersionMetadata = (json): VersionMetadata => { - const subgraphMetadata: VersionMetadata = { - label: checkString(json.label), - description: checkString(json.description), - } - return subgraphMetadata -} - -const jsonToAccountMetadata = (json): AccountMetadata => { - const accountMetadata: AccountMetadata = { - codeRepository: checkString(json.codeRepository), - description: checkString(json.description), - image: checkString(json.image), - name: checkString(json.name), - website: checkString(json.website), - displayName: checkString(json.displayName), - } - return accountMetadata -} - -const checkString = (field): string => { - if (typeof field != 'string') { - throw Error('Metadata field is incorrect for one or more files') - } - return field -} - -export { - AccountMetadata, - SubgraphMetadata, - VersionMetadata, - jsonToSubgraphMetadata, - jsonToVersionMetadata, - jsonToAccountMetadata, -} diff --git a/cli/mockData/account-metadata/accountMetadatas.ts b/cli/mockData/account-metadata/accountMetadatas.ts deleted file mode 100644 index 8567a1c38..000000000 --- a/cli/mockData/account-metadata/accountMetadatas.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { jsonToAccountMetadata } from '../metadataHelpers' - -import compound from './compound.json' -import decentraland from './decentraland.json' -import ens from './ens.json' -import livepeer from './livepeer.json' -import maker from './maker.json' -import melon from './melon.json' -import moloch from './moloch.json' -import origin from './origin.json' -import thegraph from './thegraph.json' -import uniswap from './uniswap.json' - -const compoundAccountMetadata = jsonToAccountMetadata(compound) -const decentralandAccountMetadata = jsonToAccountMetadata(decentraland) -const ensAccountMetadata = jsonToAccountMetadata(ens) -const livepeerAccountMetadata = jsonToAccountMetadata(livepeer) -const makerAccountMetadata = jsonToAccountMetadata(maker) -const melonAccountMetadata = jsonToAccountMetadata(melon) -const molochAccountMetadata = jsonToAccountMetadata(moloch) -const originAccountMetadata = jsonToAccountMetadata(origin) -const thegraphAccountMetadata = jsonToAccountMetadata(thegraph) -const uniswapAccountMetadata = jsonToAccountMetadata(uniswap) - -export default { - compoundAccountMetadata, - decentralandAccountMetadata, - ensAccountMetadata, - livepeerAccountMetadata, - makerAccountMetadata, - melonAccountMetadata, - molochAccountMetadata, - originAccountMetadata, - thegraphAccountMetadata, - uniswapAccountMetadata, -} diff --git a/cli/mockData/account-metadata/compound.json b/cli/mockData/account-metadata/compound.json deleted file mode 100644 index cf8420ab0..000000000 --- a/cli/mockData/account-metadata/compound.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "codeRepository": "github.com/compound-finance", - "description": "Compound developer", - "image": "https://api.thegraph.com/ipfs/api/v0/cat?arg=QmQyA3o9G72wcAKfGhQSFkspCLMRXUtyidxNCc4tJjCwTW", - "name": "Compound developer", - "website": "https://compound.finance", - "isOrganization": true -} \ No newline at end of file diff --git a/cli/mockData/account-metadata/decentraland.json b/cli/mockData/account-metadata/decentraland.json deleted file mode 100644 index c6ec1dcc9..000000000 --- a/cli/mockData/account-metadata/decentraland.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "codeRepository": "github.com/Decentraland", - "description": "Decentraland developer", - "image": "https://api.thegraph.com/ipfs/api/v0/cat?arg=QmQyA3o9G72wcAKfGhQSFkspCLMRXUtyidxNCc4tJjCwTW", - "name": "Decentraland developer", - "website": "https://decentraland.io", - "isOrganization": true -} \ No newline at end of file diff --git a/cli/mockData/account-metadata/ens.json b/cli/mockData/account-metadata/ens.json deleted file mode 100644 index 2eab8c069..000000000 --- a/cli/mockData/account-metadata/ens.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "codeRepository": "github.com/ensdomains", - "description": "ENS developer", - "image": "https://api.thegraph.com/ipfs/api/v0/cat?arg=QmQyA3o9G72wcAKfGhQSFkspCLMRXUtyidxNCc4tJjCwTW", - "name": "ENS developer", - "website": "https://ens.domains/", - "isOrganization": true -} \ No newline at end of file diff --git a/cli/mockData/account-metadata/livepeer.json b/cli/mockData/account-metadata/livepeer.json deleted file mode 100644 index 8c696bc0b..000000000 --- a/cli/mockData/account-metadata/livepeer.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "codeRepository": "github.com/adam", - "description": "Adam", - "image": "https://api.thegraph.com/ipfs/api/v0/cat?arg=QmQyA3o9G72wcAKfGhQSFkspCLMRXUtyidxNCc4tJjCwTW", - "name": "Adam", - "website": "https://adam.com/", - "isOrganization": true -} \ No newline at end of file diff --git a/cli/mockData/account-metadata/maker.json b/cli/mockData/account-metadata/maker.json deleted file mode 100644 index 6e5355364..000000000 --- a/cli/mockData/account-metadata/maker.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "codeRepository": "github.com/makerdao", - "description": "Maker dev", - "image": "https://api.thegraph.com/ipfs/api/v0/cat?arg=QmQyA3o9G72wcAKfGhQSFkspCLMRXUtyidxNCc4tJjCwTW", - "name": "Maker deve", - "website": "https://maker.io/", - "isOrganization": true -} \ No newline at end of file diff --git a/cli/mockData/account-metadata/melon.json b/cli/mockData/account-metadata/melon.json deleted file mode 100644 index 653bf2302..000000000 --- a/cli/mockData/account-metadata/melon.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "codeRepository": "github.com/melon", - "description": "Melon developer", - "image": "https://api.thegraph.com/ipfs/api/v0/cat?arg=QmQyA3o9G72wcAKfGhQSFkspCLMRXUtyidxNCc4tJjCwTW", - "name": "Melon developer", - "website": "https://melon.finance/", - "isOrganization": true -} \ No newline at end of file diff --git a/cli/mockData/account-metadata/moloch.json b/cli/mockData/account-metadata/moloch.json deleted file mode 100644 index f2aaee112..000000000 --- a/cli/mockData/account-metadata/moloch.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "codeRepository": "github.com/molochcrypto", - "description": "Moloch dev", - "image": "https://api.thegraph.com/ipfs/api/v0/cat?arg=QmQyA3o9G72wcAKfGhQSFkspCLMRXUtyidxNCc4tJjCwTW", - "name": "Moloch dev", - "website": "https://moloch.io/", - "isOrganization": true -} \ No newline at end of file diff --git a/cli/mockData/account-metadata/origin.json b/cli/mockData/account-metadata/origin.json deleted file mode 100644 index a8887c84a..000000000 --- a/cli/mockData/account-metadata/origin.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "codeRepository": "github.com/origin-dev", - "description": "Origin dev", - "image": "https://api.thegraph.com/ipfs/api/v0/cat?arg=QmQyA3o9G72wcAKfGhQSFkspCLMRXUtyidxNCc4tJjCwTW", - "name": "Origin dev", - "website": "https://origin-dev.io", - "isOrganization": true -} \ No newline at end of file diff --git a/cli/mockData/account-metadata/thegraph.json b/cli/mockData/account-metadata/thegraph.json deleted file mode 100644 index 34e91862b..000000000 --- a/cli/mockData/account-metadata/thegraph.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "codeRepository": "github.com/davekaj", - "description": "Dave Kajpusts graph account", - "image": "https://api.thegraph.com/ipfs/api/v0/cat?arg=QmQyA3o9G72wcAKfGhQSFkspCLMRXUtyidxNCc4tJjCwTW", - "name": "Dave Kajpust", - "website": "https://kajpust.com/", - "isOrganization": true -} \ No newline at end of file diff --git a/cli/mockData/account-metadata/uniswap.json b/cli/mockData/account-metadata/uniswap.json deleted file mode 100644 index 26b0bbd66..000000000 --- a/cli/mockData/account-metadata/uniswap.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "codeRepository": "github.com/ian", - "description": "Ian", - "image": "https://api.thegraph.com/ipfs/api/v0/cat?arg=QmQyA3o9G72wcAKfGhQSFkspCLMRXUtyidxNCc4tJjCwTW", - "name": "Ian", - "website": "https://ian.com", - "isOrganization": true -} \ No newline at end of file diff --git a/cli/mockData/bulkPhaseData/phase1-signalling.csv b/cli/mockData/bulkPhaseData/phase1-signalling.csv deleted file mode 100644 index 4d3d26c9a..000000000 --- a/cli/mockData/bulkPhaseData/phase1-signalling.csv +++ /dev/null @@ -1,17 +0,0 @@ -displayName,description,subgraphID,signal,codeRepository,image,website -Uniswap V2,Uniswap V2,QmWTrJJ9W8h3JE19FhCzzPYsJ2tgXZCdUqnbyuo64ToTBN,"1000000",https://github.com/uniswap/uniswap-v2-subgraph,https://api.thegraph.com/ipfs/api/v0/cat?arg=QmWQn64mrw9eVBfau2TxknR8bQNs4BkCy7mUi9UaZG9ofs, -Synthetix Rates,Synthetix Rates,QmdbHP5ALcHda6UdCtZLYEwQJo7xTKKgUXMwMLLiCspYFE,"1000000",https://github.com/Synthetixio/synthetix-subgraph,https://storage.googleapis.com/subgraph-images/1599682669782SNX%20(2).png, -Balancer,Balancer,QmXorTXBbcJ9YHH8YKjdz5KxVENz43fdXxciFHZHvi8m6c,"900000",https://github.com/balancer-labs/balancer-subgraph,https://storage.googleapis.com/subgraph-images/1582850720988pebbles-padcircle-white.256w.png, -Curve,Curve,QmNs5fU6VkyGUsaNsa5sUHEKpzCA5AZWKJG8LaBrcCRpmW,"900000",,https://storage.googleapis.com/subgraph-images/default/sg-4.png, -UMA,UMA,QmdJjt7nX7bZraGLRb93eJMQ9ND4SwoFQtA934N3FdxMBs,"800000",https://github.com/protofire/uma-subgraph ,https://storage.googleapis.com/subgraph-images/1594053638802910-uma-project.png, -Aave,Aave,QmU3qzWocSGuywhLonGiYmv22XS5sHatfEBp3vrJrRGdD6,"800000",https://github.com/aave/aave-protocol/tree/master/thegraph,https://storage.googleapis.com/subgraph-images/1578403270665sticker_aave_telegram.png, -Mintbase,Mintbase,QmW5UcMhXwXrMqRpTdT3MKB7HYDxbsp5oe9Atkuh4sgAA5,"800000",https://github.com/Mintbase/graph-mint-factory,https://storage.googleapis.com/subgraph-images/1573754371189logo-solo-white.png, -Known Origin,Known Origin,QmUxpVrcmXRmJgi8CMXu8JPHABspnoaewQjDujc17bkGqR,"800000",https://github.com/knownorigin/known-origin-subgraph ,https://storage.googleapis.com/subgraph-images/1575098880182440px_LogoIcn.png, -Opyn,Opyn,QmNVmy3hA6JVqZfMGoQc68GsB9GzGiEVLjhR1pHLY2xwuS,"700000",,https://storage.googleapis.com/subgraph-images/1581473209487Opyn2.png, -Protocol Multy Raw,Protocol Multy Raw,QmaTCNvS72s7gULbrnKE9D4WaDA3HBD7yXUA9d2wGJUXHQ,"600000",https://github.com/graphprotocol/aave-protocol,https://storage.googleapis.com/subgraph-images/1590485690460sticker_aave_telegram.png, -Keeper DAO,Keeper DAO,QmW6BrjSMPUSjMApTNYZShHi9XShgziC5YppGvqyjjAAX1,"500000",,https://storage.googleapis.com/subgraph-images/default/sg-2.png, -Token Sets,Token Sets,QmZ6noN8Ek4dPpyvmSv4AdAtefVWtUsopBc8hFKFiWo1Uw,"500000",https://github.com/GraphiteTools/tokensets-subgraph ,https://storage.googleapis.com/subgraph-images/1586498344313tokensets.png, -Synthetix Exchanges,Synthetix Exchanges,QmNmLRx82a8FEvVr3aBahEReAj3fN4JSmHG2ufTEVwVR7z,"450000",https://github.com/Synthetixio/synthetix-subgraph,https://storage.googleapis.com/subgraph-images/1569869352912Slack___jordan___Synthetix.jpg, -Compound,Compound,QmdYA3zCs27962HNchhcjJbyfT3hZtLhANJuo1BsMv5YTs,"400000",https://github.com/GraphiteTools/compound-subgraph ,https://storage.googleapis.com/subgraph-images/1586460211036compound.png, -MStable,MStable,QmWNP1jqMZm61G8FbsLzi9Mnii5qRXbkadBxXVHZPqzKri,"300000",https://gitlab.com/mstable/mstable-graph,https://storage.googleapis.com/subgraph-images/1586091586012mstable_logo_circle_m_black.jpg, -Tellor,Tellor,QmbBHyLRN97BssF7w6MnULW92f7iaM7vX7fnNU6wDDj3fc,"300000",,https://storage.googleapis.com/subgraph-images/default/sg-9.png, diff --git a/cli/mockData/bulkPhaseData/phase1-unsignal.csv b/cli/mockData/bulkPhaseData/phase1-unsignal.csv deleted file mode 100644 index 5ec780c64..000000000 --- a/cli/mockData/bulkPhaseData/phase1-unsignal.csv +++ /dev/null @@ -1,19 +0,0 @@ -Account,Subgraph Number,Amount (percentage) -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,0,10 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,1,20 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,2,100 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,3,40 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,4,50 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,5,70 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,6,12 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,7,88 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,8,17 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,9,23 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,10,45 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,11,55 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,12,65 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,13,99 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,14,1 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,15,2 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,16,30 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,17,44 \ No newline at end of file diff --git a/cli/mockData/bulkPhaseData/phase2-signalling.csv b/cli/mockData/bulkPhaseData/phase2-signalling.csv deleted file mode 100644 index 6ac55752b..000000000 --- a/cli/mockData/bulkPhaseData/phase2-signalling.csv +++ /dev/null @@ -1,88 +0,0 @@ -displayName,description,subgraphID,signal,codeRepository,image -Uniswap V2,historical data and analytics for Uniswap V2,QmWTrJJ9W8h3JE19FhCzzPYsJ2tgXZCdUqnbyuo64ToTBN,1010000,https://github.com/uniswap/uniswap-v2-subgraph,https://storage.googleapis.com/subgraph-images/1591820950702256x256_App_Icon_Gradient.png -Ethereum Blocks,Indexing all Ethereum Block data,QmNtTKStPBm3bnghvyKLNY5B8etER8CG9ei9m7APT1kdx6,75514,https://github.com/blocklytics/ethereum-blocks,https://storage.googleapis.com/subgraph-images/1579070275738ethereum_logo_square.png -Brightid Honey Faucet Xdai,Subgraph for BrightId Honey Faucet on xDai,QmYMUQESxrhz7UkwnshnCEbprLWQbZVPyNd3jFggS8FAtK,71722,,https://storage.googleapis.com/subgraph-images/default/sg-9.png -LINKUSD,Subgraph for LINKUSD,Qmbpwh32waJ21xgYLBw9ZV9v5ikehANXqQTaxErii7ypbT,210447,,https://storage.googleapis.com/subgraph-images/default/sg-3.png -Balancer,Generalized AMM and portfolio manager,QmbS7vmAWXJqsJEnAbvNSBYQXxCUmZWHFQygHPbyb3vy3N,58478,,https://storage.googleapis.com/subgraph-images/1582850720988pebbles-padcircle-white.256w.png -Synthetix Rates,Rate updates from Synthetix,QmPYVDfyyQ72dwr4HPG8JC1SZGvLhewMTqfDwByH6M1dPa,554340,,https://storage.googleapis.com/subgraph-images/1569418199094Pasted_Image_9_25_19__9_29_AM.jpg -SakeSwap Subgraph V2,Analytics for SakeSwap,QmcAGrSedyweWQhKCbdMUxbX2ddMiSJwWRRc3NcDtoXnDE,38619,https://github.com/therealsakeswap/sakeswap-subgraph-univ2,https://storage.googleapis.com/subgraph-images/default/sg-8.png -Opyn,Opyn Mainnet Subgraph,QmNVmy3hA6JVqZfMGoQc68GsB9GzGiEVLjhR1pHLY2xwuS,1221,https://https://github.com/aparnakr/OpynGraph,https://storage.googleapis.com/subgraph-images/1581473209487Opyn.png -Curve,Trades and liquidity details for Curve.fi DeFi platform,QmVaFg6W4vofpNSsMNVx1SNDn4n8bQm9ou95JH6FDiKqQ1,132196,,https://storage.googleapis.com/subgraph-images/default/sg-4.png -Uniswap,Uniswap is a decentralized protocol for automated token exchange on Ethereum.,QmRuorV4Ck1sVdpfpAAwfYXnf3cfSkbDwZvvzWud9SH8Dg,19564,,https://storage.googleapis.com/subgraph-images/1548114951622uniswap.png -Gringotts,Gringotts Wizarding Bank,QmPmPrNHGkWZLMuXiNf59odjxSAwMBciMNNenf9MSqyBfy,584040,,https://storage.googleapis.com/subgraph-images/1601451095309gringotts.jpg -Mintbase,All stores and those stores tokens,QmW5UcMhXwXrMqRpTdT3MKB7HYDxbsp5oe9Atkuh4sgAA5,17572,https://github.com/Mintbase/graph-mint-factory,https://storage.googleapis.com/subgraph-images/1573754371189logo-solo-white.png -Aragon Conviction Voting Xdai,Conviction voting subgraph Xdai,QmWPnuoYxQrb8Hc5MNZboRmyAqjYhV5B8ndgyHywUptcRV,1306,,https://storage.googleapis.com/subgraph-images/default/sg-5.png -Aavegotchi Aragon,Aavegotchi Bonding Curve,QmY6Si48nCutHkofaXDL1mJd4XUxs2SCPeo4G6CT661z4P,12224,,https://storage.googleapis.com/subgraph-images/default/sg-7.png -SushiSwap Subgraph Fork,A fork of Uniswap subgraph to test things out,QmPSzSpAHozDWgqsa9FMKk2qd1xrhEZJfhGxskgz4b8HoQ,11808,,https://storage.googleapis.com/subgraph-images/default/sg-3.png -Known Origin,KnownOrigin artwork listings,QmTFeK8XKtA6hm2nZ8ectqyqTmx1ga8qiMpxQyyxfBrduv,227640,https://github.com/knownorigin/known-origin-subgraph,https://storage.googleapis.com/subgraph-images/1575098880182440px_LogoIcn.png -mStable protocol,Mint redeem and save mStable assets with this data,QmWNP1jqMZm61G8FbsLzi9Mnii5qRXbkadBxXVHZPqzKri,8821,,https://storage.googleapis.com/subgraph-images/1586091586012mstable_logo_circle_m_black.jpg -Token Sets,Crypto management made easy,QmZ6noN8Ek4dPpyvmSv4AdAtefVWtUsopBc8hFKFiWo1Uw,8002,https://github.com/Destiner/TokenSets-subgraph,https://storage.googleapis.com/subgraph-images/1569163566860TokenSets.png -UMA,UMA Subgraph,QmVviUCWpxxZuwekyHe87vspJsaugG1KDkfqEwjm3788ku,5781,https://github.com/protofire/uma-subgraph,https://storage.googleapis.com/subgraph-images/1601561900375DsMClZnT_400x400.jpg -Synthetix Exchanges,A subgraph on all exchanges in Synthetix,QmX9CNPbbYoFGvucHzNJkjTAMGKNWzUSFveWmgdoB6WVJm,5441,https://github.com/Synthetixio/synthetix-subgraph,https://storage.googleapis.com/subgraph-images/1569869352912Slack___jordan___Synthetix.jpg -Bancor V2,Bancor v2,QmbykNCTDoRx5NMgJgoXY7YARoV3xTRNfs4cWifsc3fm7u,5390,,https://storage.googleapis.com/subgraph-images/default/sg-1.png -Protocol,Aave's Protocol subgraph(legacy),QmU3qzWocSGuywhLonGiYmv22XS5sHatfEBp3vrJrRGdD6,5182,https://github.com/aave/aave-protocol/tree/master/thegraph,https://storage.googleapis.com/subgraph-images/1578403270665sticker_aave_telegram.png -Try Second Graph,mooniswap 2,QmQgmUrUKBkQfsKdNNnfcUpUxRvyrX27W4knuhn4q6GfpH,40420,,https://storage.googleapis.com/subgraph-images/default/sg-2.png -exchange,exchange,QmWpFQJWVBkzTfabZL5DxnAvdhjP5FjbBW87jP2XcjyuUb,3990,,https://storage.googleapis.com/subgraph-images/default/sg-3.png -Protocol Multy Raw,Aave protocol subgraph with all pools data,QmS8ZBEgXisX7yEm8daSQmmVkwQ6wH6WU1B4nBkYKrjHo2,3679,https://github.com/graphprotocol/aave-protocol,https://storage.googleapis.com/subgraph-images/1590485690460sticker_aave_telegram.png -Xdai Blocks,All the blocks on Xdai,QmVxQBxjdswNYNmz2ocSDknkbnCwvQLJd1onxwuHtuoumd,3338,,https://storage.googleapis.com/subgraph-images/default/sg-1.png -SushiSwap,Swap data from sushiswap,QmUmgYJL3yp7EiSgxQ3zVxmDMJn3ZXDnYZWija4BWciEvu,2930,,https://storage.googleapis.com/subgraph-images/default/sg-7.png -Marketplace,Decentraland's Marketplace,QmXdZDKnDX2o9qfupGDTXFM1xxspndHrHAGpbkWAPMs6Qk,2773,https://github.com/decentraland/marketplace,https://storage.googleapis.com/subgraph-images/1578327676983color.png -KeeperDAO,KeeperDAO,QmW6BrjSMPUSjMApTNYZShHi9XShgziC5YppGvqyjjAAX1,2546,,https://storage.googleapis.com/subgraph-images/default/sg-2.png -Multisig Mainnet,Multisig (network: Mainnet),Qmd8JSo29vQX3iP45JMVEL2zQJ6bQEMkqnWsoW3eRjMJEn,2528,,https://storage.googleapis.com/subgraph-images/default/sg-8.png -Unlock,Unlock on mainnet,QmR2uzq3Tt3htYTmefFwJ6eX2aYySY6ZRZkW9LZG39Byrh,2521,https://github.com/unlock-protocol/unlock-subgraph,https://storage.googleapis.com/subgraph-images/1569531464009unlock.png -Miniswap,MiniSwap provides a decentralised platform.,QmZ4fvpTgWCL3oQbf7uzy9bszotLTxv6pGbYfGk7VopTst,2373,,https://storage.googleapis.com/subgraph-images/1601020924950MIniswap600.png -Easy Staking,EasyStaking,QmfVC5EMxkkyh6tLt94o8Kh239WVNppDP6jLJncviCSK4k,2314,,https://storage.googleapis.com/subgraph-images/default/sg-4.png -RenVM,RenVM graph explorer,QmP595e8r4VRPcKG5bfHUSN4ybbYnZkjgYkSHjfDw5YshY,2114,https://github.com/renproject/renvm-subgraph,https://storage.googleapis.com/subgraph-images/1590115100825icon-white.png -Livepeer,A protocol for affordable and reliable video encoding.,QmaEsTQhqGfZMjHYpNxmcxU3pD4GbAU6u5F8AqePeQumYv,2067,https://github.com/livepeer/livepeerjs/tree/master/packages/subgraph,https://storage.googleapis.com/subgraph-images/1565207456060livepeer.png -Ephimera,Ephimera,QmNkNBJKGzN65UtD3PKC2zV7EeHrHtWZsRErRsxyq55xw1,2015,,https://storage.googleapis.com/subgraph-images/default/sg-9.png -thelao1,lao,QmXAkoTqZZus7qd6JJ7dycKPwYWQuBu1raPBNfhq59gaGL,1915,,https://storage.googleapis.com/subgraph-images/default/sg-5.png -Tellor Dispute V2,tellor dispute center v2,QmfCaCcQnfBWXgCpbtf9kKWosVqUbeGLfEomYVJkMBqKj9,1601,,https://storage.googleapis.com/subgraph-images/default/sg-5.png -KeeperDAO Staging,KeeperDAO staging environment,QmTnwP1Bs61Bpb2GNBjYBFmVreZzDx3xDowQGGC63WxsWF,1564,,https://storage.googleapis.com/subgraph-images/default/sg-5.png -NIFTEX Uniswap Graph,NIFTEX Uniswap Pools Data,QmdoMvZbk2YDyDVQjhS73RfqymffMxz4EW1uS9RhEEfqog,1558,,https://storage.googleapis.com/subgraph-images/default/sg-5.png -Cream Swap V2,Crypto Rules Everything Around Me C.R.E.A.M.,QmcPSRpF28QSWpgAgNPFVyiGYd75L5aSrKGLXhmaFW5bSK,1403,,https://storage.googleapis.com/subgraph-images/1602679008376CREAM_transparent_Secondary_straight_color.png -LINKUSD rinkeby,LINKUSD on Rinkeby,QmYefoMwvtKYPQVrZZRTaVeX1K2CP51Eft8E7Dt8LeCRsa,1181,,https://storage.googleapis.com/subgraph-images/default/sg-5.png -Prod,2nd Layer Protocol Embedding Smart Contracts into HTTP Links,QmQhuSbS2J5DzbHVFNLKYqFJDS9hhLxyWys6uGZDamhPeD,1176,https://github.com/2key/2key-subgraphs,https://storage.googleapis.com/subgraph-images/15644936648972key-white-bg.gif -Flamingo NFT,Flamingo NFT (mainnet),Qma3LJSzh4q5RGS5inHMLiGCBVTQ16PnGeRJscCDcQsWkH,1163,,https://storage.googleapis.com/subgraph-images/default/sg-7.png -Stake Subgraph V2,Stake Subgraph V2,QmUEfxv9AQmn1BoAr8C56Z3oALGrEkG7V2doGjYDpVuBH5,1115,,https://storage.googleapis.com/subgraph-images/default/sg-2.png -Oneinchswapped3,Stats,QmcYkKNVBW67p9UWFMEcETWjgKqjnJ1nupPmJQoaLPW7CU,1087,,https://storage.googleapis.com/subgraph-images/default/sg-10.png -Honey Pot Xdai,Honey pot subgraph for xdai network,QmRQJBmUh1vxp184FScwLeKviNXiazbxWKRBWkeh1HXhVw,974,,https://storage.googleapis.com/subgraph-images/1601582404472bee.png -Try Graph,test,Qmd3yXPzi3cRBW8assGLHDi65s6EZagparh55fZ2FGP7Tf,943,,https://storage.googleapis.com/subgraph-images/default/sg-8.png -Sablier,Mainnet subgraph,QmamoWRdcCzkgYDXLFzxdoejzCJMvJYfdNwQorWU4B4Rtg,398000,,https://storage.googleapis.com/subgraph-images/1573584068471icon_spaced_gradient_2.png -Balancer Beta,Balancer,QmXPQBpRJ8Vjut71DyYWst8VkCbhdKCAJ9f4q3BWboXd87,765,,https://storage.googleapis.com/subgraph-images/default/sg-1.png -Circlesxdai,Circles subgraph for The Graph to fastly query available data in the Circles UBI ecosystem,QmVRkGqh7mCsZdgfMGQDLUjTYDbR6u51jWCTsG2mj8wLHf,728,,https://storage.googleapis.com/subgraph-images/16006014343575qr4Cm5q_400x400.jpg -Keeper Pool Mainnet,Keeper Pool Related Data in Mainnet Network,QmX28DCsTkd9TWLssR1YRwBr6weQ61t5VTnHimff1zZMCT,728,,https://storage.googleapis.com/subgraph-images/default/sg-5.png -Uniswap,Subgraph to organize Uniswap transaction data,QmQ2Hm4EqUycftdZqmMftgghZ8DpsbUh3T6FHkEvBMp1Yr,136400,https://github.com/graphprotocol/uniswap-subgraph,https://storage.googleapis.com/subgraph-images/1548114951622uniswap.png -v8_12_exp_xdai,arc index xdai,QmSZ6wNaTQdCCqsfPNPrCXq9oGLKt7rRE3cHYWDjiTksjq,636,,https://storage.googleapis.com/subgraph-images/default/sg-2.png -Mint Factory,Capture all the sub contracts,QmYUdKTsNe9fDuWZMeXTAF7tKosSuokzgauHQSEUUU89B1,619,https://github.com/Mintbase/graph-mint-factory,https://storage.googleapis.com/subgraph-images/1573378599056logo-solo-white.png -Staging,2nd Layer Protocol Embedding Smart Contracts into HTTP Links,QmVivTDmJMXJXyJcjcFDV2NLqf27xMzedXmCvmFcPdFoco,573,https://github.com/2key/2key-subgraphs,https://storage.googleapis.com/subgraph-images/15644935789752Key_Logo_Final Formats-FIX_LightGreen.png -Purple Warlock Staging,A graph for the demo,QmSgYxcy6AJ41ZdvmVgdZYEU4yzeccZeCQK8QNn75X5wtL,109600,,https://storage.googleapis.com/subgraph-images/default/sg-2.png -Pollen,Pollen is a fully decentralized DAO-governed DeFi Asset Pool,QmeHPFWH8qmEBpzZRTzjEa7vajnbGQZ2SzJ8v6fkA6W9nX,541,https://github.com/PollenDeFi/pollen-subgraph,https://storage.googleapis.com/subgraph-images/1595078030985logo192.png -v39_8,arc index mainnet,QmWex7boz79MGkYmcLbjDg4N13kLsLQAtTfLyjcz6RgJ9i,475,,https://storage.googleapis.com/subgraph-images/default/sg-4.png -ENS,A secure & decentralized way to address resources on and off the blockchain using simple human-readable names. Access domains and transfer history.,QmY8Uzg61ttrogeTyCKLcDDR4gKNK44g9qkGDqeProkSHE,456,,https://storage.googleapis.com/subgraph-images/1548795052635ENS_Logo_WHITE.png -Gotchiv1,Gotchi test 1 on rinkeby,QmNVAQpyWNiHQrmvXLQSCG7PLDEUcQ9Ay3nU9j5ppTgFFU,447,,https://storage.googleapis.com/subgraph-images/default/sg-6.png -Yearn Vault ROI Dev,Development subgraph for yearn vault ROI,Qmdab4gjWa1yCACgAAcWjab2c16oqmPo6j5WtZjZ21UxcZ,9614,,https://storage.googleapis.com/subgraph-images/default/sg-5.png -Pooltogether,Records data for PoolTogether,QmecFPxMeFeHETwJdrivTNecBTCko5nyRGgidRrVp4BSfc,437,https://github.com/pooltogether/pooltogether-subgraph,https://storage.googleapis.com/subgraph-images/1599758845172pooltogether-purple-mark@2x.png -Cream Swap Beta,Crypto Rules Everything Around Me C.R.E.A.M.,QmREAAZS5ZB5nAABCutPRVBGVgaVHz21e1miwWXnpGZm51,404,https://github.com/CreamFi/balancer-subgraph,https://storage.googleapis.com/subgraph-images/1599400535254CREAM_transparent_Secondary_straight_color.png -mStable Governance,mStable Governance Subgraph,QmdXYzFaj3nqURSpx7jWvkiYnzVaMobTnQfXzPYYjnYLqv,396,,https://storage.googleapis.com/subgraph-images/1599839414747mta.png -Develop,2nd Layer Protocol Embedding Smart Contracts into HTTP Links,QmafKiDwT7EBJYL9y3rdfnBFUWzkGNytoGzUsiJAxePnLm,383,https://github.com/2key/2key-subgraphs,https://storage.googleapis.com/subgraph-images/15644929968952key_logo_final_formats-fixv2_samlil_1_copy_3__1___2_.png -ptf vesting,PTF Vesting,QmdTVBZyFKcRQRHW7U8ph9Mt4oDBvBrD679FxWQQGiUoJF,356,,https://storage.googleapis.com/subgraph-images/1600677311813Bull BW.png -Uniswap,Uniswap data importer for Unspent.io,QmRpG1kMLJxnruvCScfs4JYPeHJEnJk1ZsEdhpfqaGPUHs,351,,https://storage.googleapis.com/subgraph-images/default/sg-6.png -F8N XDai,Subgraph for xDai,QmYnxSNW9iDPNvHQyP5HZsMsn7chXeKKY7yaQ1uSBvyx28,347,,https://storage.googleapis.com/subgraph-images/default/sg-10.png -Mooniswap,stat for mooniswap,QmUBFkuoDzxHx2EPxwGQdBwshqTF79fzKQnXjTRNVHwg6e,26,,https://storage.googleapis.com/subgraph-images/default/sg-4.png -Circles,Subgraph for Circles community currency,QmcyT4SWn7ctMsm1avAV3jnmCL7u3ZK93XrxcJJJt7hUF5,340,https://github.com/CirclesUBI/circles-subgraph/,https://storage.googleapis.com/subgraph-images/1595251875896circleslogo.jpg -AirSwap,Trading history indexers delegates and more.,QmZ28XHpz1BNhR5jU2ABCqo2PqHutAPE8woaW1tYdDFDqV,51150,https://github.com/airswap/airswap-protocols,https://storage.googleapis.com/subgraph-images/158680119781426823563.png -protocol,Gnosis Protocol,QmQrapV3GN6GnkMByUbf6Xrw1xVqSNAbQtNkXsy6xKAs15,328,https://github.com/gnosis/dex-subgraph,https://storage.googleapis.com/subgraph-images/1585926751418Gnosis_protocol_2019_logo_all_rgb_orange.png -Swap Subgraph,Swap Subgraph for Crypto.com DeFi,QmXhAzDVyYnxSLaeLGDpN941WJ3tyatqhyxh9ScwM82cgJ,325,,https://storage.googleapis.com/subgraph-images/default/sg-6.png -chapter2,To Assist Uniswap2,QmXRD5WZYtVERWkTpFvmqWGkpbbQ1KmsLUgCiRckkNmSJp,302,https://github.com/???,https://storage.googleapis.com/subgraph-images/1601209694793test.jpg -Protocol Raw,Aave protocol data in small units,QmNQz8mhUnkAcfDDEuKZaVdBwffZtYfoUtbQ9NYpaSS1QH,275,https://github.com/aave/aave-protocol/tree/master/thegraph,https://storage.googleapis.com/subgraph-images/1579854627676sticker_aave_telegram.png -Aragon Voting Mainnet,Subgraph for Aragon Connect Voting,QmZ92X4yhsjb7hnttAQMHeG1mH9C2SbLmiSGirHpU74iLW,233,https://github.com/aragon/connect,https://storage.googleapis.com/subgraph-images/1591893467064aralogo1.png -Nifty Ink,A subgraph for nifty.ink (in development),QmS8beCgmU8JLgXCTn7jxkCRtZ5p5mirh1Npcuk7RrBmNJ,226,,https://storage.googleapis.com/subgraph-images/1600381719322party-dinosaur.gif -Nifty Ink Main,Mainnet Nifty Ink Subgraph,Qma7vTnYU9V5FuZhAgwo9zw289KAD8mh4JKMMtMZP8nSVT,222,,https://storage.googleapis.com/subgraph-images/default/sg-7.png -Protocol Multy Kovan Raw,Aave protocol subgraph with all pools data,QmPrz3AMvEJR5dbaxHWvDawJQBFWYRTuSHp5rdrQowSayj,219,https://github.com/graphprotocol/aave-protocol,https://storage.googleapis.com/subgraph-images/1590485671765sticker_aave_telegram.png -Curve VotingEscrow Mainnet,Curve VotingEscrow Mainnet subgraph,QmXwR6LiGaP9yYTsSq8wGUS91Bqat7dStDsuH2XSoeKctY,213,,https://storage.googleapis.com/subgraph-images/default/sg-9.png -Chapter3,Miniswap mainnet channel,QmYPh4BHfJRszYBP7tnPFPHpKf2DdyHAtgRbE8PAnU1fZN,20100,https://github.com/???,https://storage.googleapis.com/subgraph-images/1601393873317zz.jpg -LAND Manager,LAND permissions with a timestamp,QmZWZWLQqY7FqsjjTsShheSZDSmj1Q3RLogNSwME3yep4Q,200,https://github.com/nicosantangelo/watchtower,https://storage.googleapis.com/subgraph-images/1590095332591dlc.png -Always For Sale Gallery,Always for sale art gallery,QmWNcVnVeLHW2QzbUvgEycYdPCNEict1Kd7n9p8ywNPTqD,187,,https://storage.googleapis.com/subgraph-images/default/sg-4.png -NexusMutualTVL,tvl for nexus mutual,QmSErYUZkNj4jy7vVYAZikPdXnbjWS3kW1GWZ9Ff29bKSU,186,,https://storage.googleapis.com/subgraph-images/default/sg-2.png -mStable protocol ropsten,A subgraph for mStable's testnet,QmPNCGkzNffdimLqmchcf7EdT5UwwDjkVcUpgwivkt8RtH,184,,https://storage.googleapis.com/subgraph-images/1590589045486mstable_logo_circle_m_black.jpg -Compound V2,A protocol for algorithmic efficient Money Markets.,QmTN6gMCBCYTgbis33eSvr6sLsQoQ3R6a2KzR7CqmMABQP,182000,,https://storage.googleapis.com/subgraph-images/1573145149921compound.png \ No newline at end of file diff --git a/cli/mockData/bulkPhaseData/phase2.2-signaling.csv b/cli/mockData/bulkPhaseData/phase2.2-signaling.csv deleted file mode 100644 index c7952beda..000000000 --- a/cli/mockData/bulkPhaseData/phase2.2-signaling.csv +++ /dev/null @@ -1,66 +0,0 @@ -displayName,description,subgraphID,signal,codeRepository,image,website -Uniswap V2,historical data and analytics for Uniswap V2,QmWTrJJ9W8h3JE19FhCzzPYsJ2tgXZCdUqnbyuo64ToTBN,22149244,https://github.com/uniswap/uniswap-v2-subgraph,https://storage.googleapis.com/subgraph-images/1591820950702256x256_App_Icon_Gradient.png, -Ethereum Blocks,Indexing all Ethereum Block data,QmNtTKStPBm3bnghvyKLNY5B8etER8CG9ei9m7APT1kdx6,22149244,https://github.com/blocklytics/ethereum-blocks,https://storage.googleapis.com/subgraph-images/1579070275738ethereum_logo_square.png, -LINKUSD,Subgraph for LINKUSD,Qmbpwh32waJ21xgYLBw9ZV9v5ikehANXqQTaxErii7ypbT,41529833,,https://storage.googleapis.com/subgraph-images/default/sg-3.png, -Synthetix Rates,Rate updates from Synthetix,QmPYVDfyyQ72dwr4HPG8JC1SZGvLhewMTqfDwByH6M1dPa,27686555,,https://storage.googleapis.com/subgraph-images/1569418199094Pasted_Image_9_25_19__9_29_AM.jpg, -SakeSwap Subgraph V2,Analytics for SakeSwap,QmcAGrSedyweWQhKCbdMUxbX2ddMiSJwWRRc3NcDtoXnDE,11074622,https://github.com/therealsakeswap/sakeswap-subgraph-univ2,https://storage.googleapis.com/subgraph-images/default/sg-8.png, -Balancer,Generalized AMM and portfolio manager,QmbS7vmAWXJqsJEnAbvNSBYQXxCUmZWHFQygHPbyb3vy3N,41529833,,https://storage.googleapis.com/subgraph-images/1582850720988pebbles-padcircle-white.256w.png, -Gringotts,Gringotts Wizarding Bank,QmPmPrNHGkWZLMuXiNf59odjxSAwMBciMNNenf9MSqyBfy,3599252,,https://storage.googleapis.com/subgraph-images/1601451095309gringotts.jpg, -SushiSwap Subgraph Fork,A fork of Uniswap subgraph to test things out,QmPSzSpAHozDWgqsa9FMKk2qd1xrhEZJfhGxskgz4b8HoQ,276865,,https://storage.googleapis.com/subgraph-images/default/sg-3.png, -Token Sets,Crypto management made easy,QmZ6noN8Ek4dPpyvmSv4AdAtefVWtUsopBc8hFKFiWo1Uw,6921638,https://github.com/Destiner/TokenSets-subgraph,https://storage.googleapis.com/subgraph-images/1569163566860TokenSets.png, -Mstable,Stable coin protocol,QmWNP1jqMZm61G8FbsLzi9Mnii5qRXbkadBxXVHZPqzKri,16611933,,, -Mintbase,All stores and those stores tokens,QmW5UcMhXwXrMqRpTdT3MKB7HYDxbsp5oe9Atkuh4sgAA5,6921638,https://github.com/Mintbase/graph-mint-factory,https://storage.googleapis.com/subgraph-images/1573754371189logo-solo-white.png, -Bancor V2,Bancor v2,QmbykNCTDoRx5NMgJgoXY7YARoV3xTRNfs4cWifsc3fm7u,276865,,https://storage.googleapis.com/subgraph-images/default/sg-1.png, -Uniswap V2,Uniswap V2 - lutter,QmXKwSEMirgWVn41nRzkT3hpUBw29cp619Gx58XW6mPhZP,2768655,,, -Livepeer,A protocol for affordable and reliable video encoding.,QmaEsTQhqGfZMjHYpNxmcxU3pD4GbAU6u5F8AqePeQumYv,4152983,https://github.com/livepeer/livepeerjs/tree/master/packages/subgraph,https://storage.googleapis.com/subgraph-images/1565207456060livepeer.png, -NIFTEX Uniswap Graph,NIFTEX Uniswap Pools Data,QmdoMvZbk2YDyDVQjhS73RfqymffMxz4EW1uS9RhEEfqog,2768655,,https://storage.googleapis.com/subgraph-images/default/sg-5.png, -RenVM,RenVM graph explorer,QmP595e8r4VRPcKG5bfHUSN4ybbYnZkjgYkSHjfDw5YshY,2768655,https://github.com/renproject/renvm-subgraph,https://storage.googleapis.com/subgraph-images/1590115100825icon-white.png, -Miniswap,MiniSwap provides a decentralised platform.,QmZ4fvpTgWCL3oQbf7uzy9bszotLTxv6pGbYfGk7VopTst,2768655,,https://storage.googleapis.com/subgraph-images/1601020924950MIniswap600.png, -Flamingo NFT,Flamingo NFT (mainnet),Qma3LJSzh4q5RGS5inHMLiGCBVTQ16PnGeRJscCDcQsWkH,2768655,,https://storage.googleapis.com/subgraph-images/default/sg-7.png, -Uniswap,Uniswap is a decentralized protocol for automated token exchange on Ethereum.,QmRuorV4Ck1sVdpfpAAwfYXnf3cfSkbDwZvvzWud9SH8Dg,1384327,,https://storage.googleapis.com/subgraph-images/1548114951622uniswap.png, -Try Second Graph,mooniswap 2,QmQgmUrUKBkQfsKdNNnfcUpUxRvyrX27W4knuhn4q6GfpH,1384327,,https://storage.googleapis.com/subgraph-images/default/sg-2.png, -Oneinchswapped3,Stats,QmcYkKNVBW67p9UWFMEcETWjgKqjnJ1nupPmJQoaLPW7CU,1384327,,https://storage.googleapis.com/subgraph-images/default/sg-10.png, -Cream Swap V2,"Crypto Rules Everything Around Me C.R.E.A.M.",QmcPSRpF28QSWpgAgNPFVyiGYd75L5aSrKGLXhmaFW5bSK,1384327,,https://storage.googleapis.com/subgraph-images/1602679008376CREAM_transparent_Secondary_straight_color.png, -Easy Staking,EasyStaking,QmfVC5EMxkkyh6tLt94o8Kh239WVNppDP6jLJncviCSK4k,1384327,,https://storage.googleapis.com/subgraph-images/default/sg-4.png, -Try Graph,test,Qmd3yXPzi3cRBW8assGLHDi65s6EZagparh55fZ2FGP7Tf,1384327,,https://storage.googleapis.com/subgraph-images/default/sg-8.png, -Sablier,Mainnet subgraph,QmamoWRdcCzkgYDXLFzxdoejzCJMvJYfdNwQorWU4B4Rtg,1938058,,https://storage.googleapis.com/subgraph-images/1573584068471icon_spaced_gradient_2.png, -Keeper Pool Mainnet,Keeper Pool Related Data in Mainnet Network,QmX28DCsTkd9TWLssR1YRwBr6weQ61t5VTnHimff1zZMCT,1107462,,https://storage.googleapis.com/subgraph-images/default/sg-5.png, -Prod,2nd Layer Protocol Embedding Smart Contracts into HTTP Links,QmQhuSbS2J5DzbHVFNLKYqFJDS9hhLxyWys6uGZDamhPeD,1661193,https://github.com/2key/2key-subgraphs,https://storage.googleapis.com/subgraph-images/15644936648972key-white-bg.gif, -exchange,exchange,QmWpFQJWVBkzTfabZL5DxnAvdhjP5FjbBW87jP2XcjyuUb,1107462,,https://storage.googleapis.com/subgraph-images/default/sg-3.png, -Pooltogether,Records data for PoolTogether,QmecFPxMeFeHETwJdrivTNecBTCko5nyRGgidRrVp4BSfc,1107462,https://github.com/pooltogether/pooltogether-subgraph,https://storage.googleapis.com/subgraph-images/1599758845172pooltogether-purple-mark@2x.png, -SushiSwap,Swap data from sushiswap,QmUmgYJL3yp7EiSgxQ3zVxmDMJn3ZXDnYZWija4BWciEvu,830596,,https://storage.googleapis.com/subgraph-images/default/sg-7.png, -Aave Protocol,Aave's Protocol subgraph(legacy),QmU3qzWocSGuywhLonGiYmv22XS5sHatfEBp3vrJrRGdD6,830596,https://github.com/aave/aave-protocol/tree/master/thegraph,https://storage.googleapis.com/subgraph-images/1578403270665sticker_aave_telegram.png, -KeeperDAO Staging,KeeperDAO staging environment,QmTnwP1Bs61Bpb2GNBjYBFmVreZzDx3xDowQGGC63WxsWF,830596,,https://storage.googleapis.com/subgraph-images/default/sg-5.png, -Balancer Beta,Balancer,QmXPQBpRJ8Vjut71DyYWst8VkCbhdKCAJ9f4q3BWboXd87,553731,,https://storage.googleapis.com/subgraph-images/default/sg-1.png, -KeeperDAO,KeeperDAO,QmW6BrjSMPUSjMApTNYZShHi9XShgziC5YppGvqyjjAAX1,553731,,https://storage.googleapis.com/subgraph-images/default/sg-2.png, -Aave Protocol Raw,Aave protocol data in small units,QmNQz8mhUnkAcfDDEuKZaVdBwffZtYfoUtbQ9NYpaSS1QH,692163,https://github.com/aave/aave-protocol/tree/master/thegraph,https://storage.googleapis.com/subgraph-images/1579854627676sticker_aave_telegram.png, -NexusMutualTVL,tvl for nexus mutual,QmSErYUZkNj4jy7vVYAZikPdXnbjWS3kW1GWZ9Ff29bKSU,553731,,https://storage.googleapis.com/subgraph-images/default/sg-2.png, -Uniswap,Subgraph to organize Uniswap transaction data,QmQ2Hm4EqUycftdZqmMftgghZ8DpsbUh3T6FHkEvBMp1Yr,553731,https://github.com/graphprotocol/uniswap-subgraph,https://storage.googleapis.com/subgraph-images/1548114951622uniswap.png, -Curve VotingEscrow Mainnet,Curve VotingEscrow Mainnet subgraph,QmXwR6LiGaP9yYTsSq8wGUS91Bqat7dStDsuH2XSoeKctY,276865,,https://storage.googleapis.com/subgraph-images/default/sg-9.png, -Nifty Ink Main,Mainnet Nifty Ink Subgraph,Qma7vTnYU9V5FuZhAgwo9zw289KAD8mh4JKMMtMZP8nSVT,553731,,https://storage.googleapis.com/subgraph-images/default/sg-7.png, -Aave protocol multi-raw,Aave raw subgraph,QmU2AuSzxAWQfZ8dxvAbyZ9kGf87DPinxeJRHPY4JTvbTf,276865,,, -Chapter3,Miniswap mainnet channel,QmYPh4BHfJRszYBP7tnPFPHpKf2DdyHAtgRbE8PAnU1fZN,276865,https://github.com/???,https://storage.googleapis.com/subgraph-images/1601393873317zz.jpg, -Curve,Trades and liquidity details for Curve.fi DeFi platform,QmVaFg6W4vofpNSsMNVx1SNDn4n8bQm9ou95JH6FDiKqQ1,553731,,https://storage.googleapis.com/subgraph-images/default/sg-4.png, -Protocol Multy Raw,Aave protocol subgraph with all pools data,QmS8ZBEgXisX7yEm8daSQmmVkwQ6wH6WU1B4nBkYKrjHo2,276865,https://github.com/graphprotocol/aave-protocol,https://storage.googleapis.com/subgraph-images/1590485690460sticker_aave_telegram.png, -Gnosis protocol,Gnosis Protocol,QmQrapV3GN6GnkMByUbf6Xrw1xVqSNAbQtNkXsy6xKAs15,276865,https://github.com/gnosis/dex-subgraph,https://storage.googleapis.com/subgraph-images/1585926751418Gnosis_protocol_2019_logo_all_rgb_orange.png, -Mooniswap,stat for mooniswap,QmUBFkuoDzxHx2EPxwGQdBwshqTF79fzKQnXjTRNVHwg6e,138432,,https://storage.googleapis.com/subgraph-images/default/sg-4.png, -Marketplace,Decentraland's Marketplace,QmXdZDKnDX2o9qfupGDTXFM1xxspndHrHAGpbkWAPMs6Qk,138432,https://github.com/decentraland/marketplace,https://storage.googleapis.com/subgraph-images/1578327676983color.png, -Swap Subgraph,Swap Subgraph for Crypto.com DeFi,QmXhAzDVyYnxSLaeLGDpN941WJ3tyatqhyxh9ScwM82cgJ,138432,,https://storage.googleapis.com/subgraph-images/default/sg-6.png, -Known Origin,KnownOrigin artwork listings,QmTFeK8XKtA6hm2nZ8ectqyqTmx1ga8qiMpxQyyxfBrduv,130126,https://github.com/knownorigin/known-origin-subgraph,https://storage.googleapis.com/subgraph-images/1575098880182440px_LogoIcn.png, -Known Origin 2,Known Origin 2,QmXQdKGK1GFioQBuEPGSbugJkdfh35owJpiujgAZA1yXeg,55373,,, -Balancer Beta,Balancer beta,QmSvK3A8LU4p87sxskbsScovTKVUNt873ZgGMXWG1aMJaZ,41529,,, -Cream Swap Beta,"Crypto Rules Everything Around Me C.R.E.A.M.",QmREAAZS5ZB5nAABCutPRVBGVgaVHz21e1miwWXnpGZm51,27686,https://github.com/CreamFi/balancer-subgraph,https://storage.googleapis.com/subgraph-images/1599400535254CREAM_transparent_Secondary_straight_color.png, -mStable Governance,mStable Governance Subgraph,QmdXYzFaj3nqURSpx7jWvkiYnzVaMobTnQfXzPYYjnYLqv,27686,,https://storage.googleapis.com/subgraph-images/1599839414747mta.png, -Synthetix Exchanges,A subgraph on all exchanges in Synthetix,QmX9CNPbbYoFGvucHzNJkjTAMGKNWzUSFveWmgdoB6WVJm,27686,https://github.com/Synthetixio/synthetix-subgraph,https://storage.googleapis.com/subgraph-images/1569869352912Slack___jordan___Synthetix.jpg, -Uniswap V2,Piouls uniswap,Qmb6iDb7A8DHox3cLThFXkBbzKfBx8BbLjZwQTzspLWXG1,27686,,, -v39_8,arc index mainnet,QmWex7boz79MGkYmcLbjDg4N13kLsLQAtTfLyjcz6RgJ9i,13843,,https://storage.googleapis.com/subgraph-images/default/sg-4.png, -Yearn Vault ROI Dev,Development subgraph for yearn vault ROI,Qmdab4gjWa1yCACgAAcWjab2c16oqmPo6j5WtZjZ21UxcZ,13843,,https://storage.googleapis.com/subgraph-images/default/sg-5.png, -Compound V2,"A protocol for algorithmic efficient Money Markets.",QmTN6gMCBCYTgbis33eSvr6sLsQoQ3R6a2KzR7CqmMABQP,13843,,https://storage.googleapis.com/subgraph-images/1573145149921compound.png, -Opyn,Opyn Mainnet Subgraph,QmNVmy3hA6JVqZfMGoQc68GsB9GzGiEVLjhR1pHLY2xwuS,8305,https://https://github.com/aparnakr/OpynGraph,, -Uniswap,Uniswap data importer for Unspent.io,QmRpG1kMLJxnruvCScfs4JYPeHJEnJk1ZsEdhpfqaGPUHs,8305,,https://storage.googleapis.com/subgraph-images/default/sg-6.png, -ENS,"A secure & decentralized way to address resources on and off the blockchain using simple human-readable names. Access domains and transfer history.",QmY8Uzg61ttrogeTyCKLcDDR4gKNK44g9qkGDqeProkSHE,5537,,https://storage.googleapis.com/subgraph-images/1548795052635ENS_Logo_WHITE.png, -UMA,UMA Subgraph,QmVviUCWpxxZuwekyHe87vspJsaugG1KDkfqEwjm3788ku,5537,https://github.com/protofire/uma-subgraph,https://storage.googleapis.com/subgraph-images/1601561900375DsMClZnT_400x400.jpg, -AirSwap,"Trading history indexers delegates and more.",QmZ28XHpz1BNhR5jU2ABCqo2PqHutAPE8woaW1tYdDFDqV,2768,https://github.com/airswap/airswap-protocols,https://storage.googleapis.com/subgraph-images/158680119781426823563.png, -Aavegotchi Aragon,Aavegotchi Bonding Curve,QmY6Si48nCutHkofaXDL1mJd4XUxs2SCPeo4G6CT661z4P,2768,,https://storage.googleapis.com/subgraph-images/default/sg-7.png, -Unlock,Unlock on mainnet,QmR2uzq3Tt3htYTmefFwJ6eX2aYySY6ZRZkW9LZG39Byrh,1384,https://github.com/unlock-protocol/unlock-subgraph,https://storage.googleapis.com/subgraph-images/1569531464009unlock.png, -Tellor Dispute V2,tellor dispute center v2,QmfCaCcQnfBWXgCpbtf9kKWosVqUbeGLfEomYVJkMBqKj9,1384,,https://storage.googleapis.com/subgraph-images/default/sg-5.png, \ No newline at end of file diff --git a/cli/mockData/bulkPhaseData/phase2.2-unsignal.csv b/cli/mockData/bulkPhaseData/phase2.2-unsignal.csv deleted file mode 100644 index 3dc36230e..000000000 --- a/cli/mockData/bulkPhaseData/phase2.2-unsignal.csv +++ /dev/null @@ -1,66 +0,0 @@ -Account,Subgraph Number,Amount (percentage) -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,0,50 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,1,50 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,2,50 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,3,50 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,4,50 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,5,50 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,6,50 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,7,50 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,8,50 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,9,50 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,10,50 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,11,50 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,12,50 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,13,50 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,14,50 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,15,50 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,16,50 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,17,50 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,18,50 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,19,50 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,20,50 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,21,50 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,22,50 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,23,50 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,24,50 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,25,50 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,26,50 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,27,50 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,28,50 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,29,50 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,30,50 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,31,50 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,32,50 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,33,50 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,34,50 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,35,50 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,36,50 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,37,50 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,38,50 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,39,50 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,40,50 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,41,50 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,42,50 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,43,50 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,44,50 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,45,50 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,46,50 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,47,50 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,48,50 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,49,50 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,50,50 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,51,50 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,52,50 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,53,50 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,54,50 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,55,50 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,56,50 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,57,50 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,58,50 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,59,50 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,60,50 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,61,50 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,62,50 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,63,50 -0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9,64,50 \ No newline at end of file diff --git a/cli/mockData/subgraph-metadata/compound.json b/cli/mockData/subgraph-metadata/compound.json deleted file mode 100644 index 0f8b08a6b..000000000 --- a/cli/mockData/subgraph-metadata/compound.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "description": "Compound is an open-source protocol for algorithmic, efficient Money Markets on the Ethereum blockchain.", - "displayName": "Compound", - "image": "https://api.thegraph.com/ipfs/api/v0/cat?arg=QmeMR3qK7wfAuSns4PpdFVZZcsCoLa7wEPQbrZTBQNKGWq", - "codeRepository": "https://github.com/graphprotocol/compound-V2-subgraph", - "website": "https://compound.finance/" -} \ No newline at end of file diff --git a/cli/mockData/subgraph-metadata/decentraland.json b/cli/mockData/subgraph-metadata/decentraland.json deleted file mode 100644 index 94d3937b4..000000000 --- a/cli/mockData/subgraph-metadata/decentraland.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "description": "A decentralized virtual world that runs on open standards. Find districts, parcels, auctions, and more.", - "displayName": "Decentraland", - "image": "https://api.thegraph.com/ipfs/api/v0/cat?arg=QmVMtgVvEJLqmH3PZzcYVp5t8ni1v61e2M1rDVkcRo9WCz", - "codeRepository": "https://github.com/graphprotocol/decentraland-subgraph", - "website": "https://decentraland.org/" -} \ No newline at end of file diff --git a/cli/mockData/subgraph-metadata/ens.json b/cli/mockData/subgraph-metadata/ens.json deleted file mode 100644 index 874f60ff9..000000000 --- a/cli/mockData/subgraph-metadata/ens.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "description": "A secure & decentralized way to address resources on and off the blockchain using simple, human-readable names. Access domains and transfer history.", - "displayName": "ENS", - "image": "https://api.thegraph.com/ipfs/api/v0/cat?arg=QmUqD4MMAXQvbNX3FbWNP43gmDFFdQPmQrn8CT9kNEb7Rs", - "codeRepository": "https://github.com/ensdomains/ens-subgraph", - "website": "https://ens.domains/" -} \ No newline at end of file diff --git a/cli/mockData/subgraph-metadata/ipfsHashes.txt b/cli/mockData/subgraph-metadata/ipfsHashes.txt deleted file mode 100644 index 944bb1179..000000000 --- a/cli/mockData/subgraph-metadata/ipfsHashes.txt +++ /dev/null @@ -1,10 +0,0 @@ -Uniswap Image: QmSaK8PKxNWPv3QMMdjp8bYvQxnpU277DowPMwCUr7dAxS -Compound Image: QmeMR3qK7wfAuSns4PpdFVZZcsCoLa7wEPQbrZTBQNKGWq -Decentraland Image: QmVMtgVvEJLqmH3PZzcYVp5t8ni1v61e2M1rDVkcRo9WCz -ENS Image: QmUqD4MMAXQvbNX3FbWNP43gmDFFdQPmQrn8CT9kNEb7Rs -Livepeer Image: QmcTyMcTpkSrRs8Q7tUBPqA6ektwL7x5DEZCsEpoveXxe1 -Maker Image: QmdJ2g7fbk1XDh24NBCwWNSUZ8jY1XxpG9ukXhLAhanP6C -Melon Image: QmQpuowYwm5c7XYXmEbSGsP6EqTU7vEWBJGN3NhJLQZ7wq -Moloch Image: QmSLfbgC7wrmufnr4ekLJtzYT1YfoQFPRsFpCRrHsxr8ED -Origin Image: QmdNkVFiDjStPhCgQfnLUg8agwCK5yQQfmfivyeJJHDeDf -The Graph Image: QmTFK5DZc58XrTqhuuDTYoaq29ndnwoHX5TAW1bZr5EMpq diff --git a/cli/mockData/subgraph-metadata/ipfsUpload.txt b/cli/mockData/subgraph-metadata/ipfsUpload.txt deleted file mode 100644 index 0a6272db4..000000000 --- a/cli/mockData/subgraph-metadata/ipfsUpload.txt +++ /dev/null @@ -1,10 +0,0 @@ -QmSaK8PKxNWPv3QMMdjp8bYvQxnpU277DowPMwCUr7dAxS -QmeMR3qK7wfAuSns4PpdFVZZcsCoLa7wEPQbrZTBQNKGWq -QmVMtgVvEJLqmH3PZzcYVp5t8ni1v61e2M1rDVkcRo9WCz -QmUqD4MMAXQvbNX3FbWNP43gmDFFdQPmQrn8CT9kNEb7Rs -QmcTyMcTpkSrRs8Q7tUBPqA6ektwL7x5DEZCsEpoveXxe1 -QmdJ2g7fbk1XDh24NBCwWNSUZ8jY1XxpG9ukXhLAhanP6C -QmQpuowYwm5c7XYXmEbSGsP6EqTU7vEWBJGN3NhJLQZ7wq -QmSLfbgC7wrmufnr4ekLJtzYT1YfoQFPRsFpCRrHsxr8ED -QmdNkVFiDjStPhCgQfnLUg8agwCK5yQQfmfivyeJJHDeDf -QmTFK5DZc58XrTqhuuDTYoaq29ndnwoHX5TAW1bZr5EMpq diff --git a/cli/mockData/subgraph-metadata/livepeer.json b/cli/mockData/subgraph-metadata/livepeer.json deleted file mode 100644 index 5070b566f..000000000 --- a/cli/mockData/subgraph-metadata/livepeer.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "description": "A protocol for affordable and reliable video encoding. Find transcoders, staking rounds, and rewards.", - "displayName": "Livepeer", - "image": "https://api.thegraph.com/ipfs/api/v0/cat?arg=QmcTyMcTpkSrRs8Q7tUBPqA6ektwL7x5DEZCsEpoveXxe1", - "codeRepository": "https://github.com/livepeer/livepeerjs/tree/master/packages/subgraph", - "website": "https://livepeer.org/" -} \ No newline at end of file diff --git a/cli/mockData/subgraph-metadata/maker.json b/cli/mockData/subgraph-metadata/maker.json deleted file mode 100644 index 2a57ccb03..000000000 --- a/cli/mockData/subgraph-metadata/maker.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "description": "Maker is a protocol for collateralized stable coin creation.", - "displayName": "Maker", - "image": "https://api.thegraph.com/ipfs/api/v0/cat?arg=QmdJ2g7fbk1XDh24NBCwWNSUZ8jY1XxpG9ukXhLAhanP6C", - "codeRepository": "https://github.com/makerdao", - "website": "https://makerdao.com/en/" -} \ No newline at end of file diff --git a/cli/mockData/subgraph-metadata/melon.json b/cli/mockData/subgraph-metadata/melon.json deleted file mode 100644 index 0a8ec7675..000000000 --- a/cli/mockData/subgraph-metadata/melon.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "description": "Technology operated and regulated funds.", - "displayName": "Melon", - "image": "https://api.thegraph.com/ipfs/api/v0/cat?arg=QmQpuowYwm5c7XYXmEbSGsP6EqTU7vEWBJGN3NhJLQZ7wq", - "codeRepository": "https://github.com/melonproject/melon-subgraph", - "website": "https://melonport.com" -} \ No newline at end of file diff --git a/cli/mockData/subgraph-metadata/moloch.json b/cli/mockData/subgraph-metadata/moloch.json deleted file mode 100644 index 63e6ffabe..000000000 --- a/cli/mockData/subgraph-metadata/moloch.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "description": "Decentralized asset allocation", - "displayName": "Moloch", - "image": "https://api.thegraph.com/ipfs/api/v0/cat?arg=QmSLfbgC7wrmufnr4ekLJtzYT1YfoQFPRsFpCRrHsxr8ED", - "codeRepository": "https://github.com/MolochVentures/moloch-monorepo/", - "website": "https://molochdao.com/" -} \ No newline at end of file diff --git a/cli/mockData/subgraph-metadata/origin.json b/cli/mockData/subgraph-metadata/origin.json deleted file mode 100644 index 345d999fd..000000000 --- a/cli/mockData/subgraph-metadata/origin.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "description": "Origin is a protocol for creating peer-to-peer marketplaces using the Ethereum blockchain and IPFS.", - "displayName": "Origin", - "image": "https://api.thegraph.com/ipfs/api/v0/cat?arg=QmdNkVFiDjStPhCgQfnLUg8agwCK5yQQfmfivyeJJHDeDf", - "codeRepository": "https://github.com/graphprotocol/origin-subgraph", - "website": "https://www.originprotocol.com/en" -} \ No newline at end of file diff --git a/cli/mockData/subgraph-metadata/subgraph-images/compound.png b/cli/mockData/subgraph-metadata/subgraph-images/compound.png deleted file mode 100644 index 5402694b7..000000000 Binary files a/cli/mockData/subgraph-metadata/subgraph-images/compound.png and /dev/null differ diff --git a/cli/mockData/subgraph-metadata/subgraph-images/decentraland.jpeg b/cli/mockData/subgraph-metadata/subgraph-images/decentraland.jpeg deleted file mode 100644 index bda473c64..000000000 Binary files a/cli/mockData/subgraph-metadata/subgraph-images/decentraland.jpeg and /dev/null differ diff --git a/cli/mockData/subgraph-metadata/subgraph-images/ens.jpeg b/cli/mockData/subgraph-metadata/subgraph-images/ens.jpeg deleted file mode 100644 index 7a45c295e..000000000 Binary files a/cli/mockData/subgraph-metadata/subgraph-images/ens.jpeg and /dev/null differ diff --git a/cli/mockData/subgraph-metadata/subgraph-images/eth.png b/cli/mockData/subgraph-metadata/subgraph-images/eth.png deleted file mode 100644 index 3dbd86d79..000000000 Binary files a/cli/mockData/subgraph-metadata/subgraph-images/eth.png and /dev/null differ diff --git a/cli/mockData/subgraph-metadata/subgraph-images/livepeer.png b/cli/mockData/subgraph-metadata/subgraph-images/livepeer.png deleted file mode 100644 index 3b6af8f07..000000000 Binary files a/cli/mockData/subgraph-metadata/subgraph-images/livepeer.png and /dev/null differ diff --git a/cli/mockData/subgraph-metadata/subgraph-images/maker.jpeg b/cli/mockData/subgraph-metadata/subgraph-images/maker.jpeg deleted file mode 100644 index 544d1f7f5..000000000 Binary files a/cli/mockData/subgraph-metadata/subgraph-images/maker.jpeg and /dev/null differ diff --git a/cli/mockData/subgraph-metadata/subgraph-images/melon.png b/cli/mockData/subgraph-metadata/subgraph-images/melon.png deleted file mode 100644 index 9cbb8f514..000000000 Binary files a/cli/mockData/subgraph-metadata/subgraph-images/melon.png and /dev/null differ diff --git a/cli/mockData/subgraph-metadata/subgraph-images/moloch.jpeg b/cli/mockData/subgraph-metadata/subgraph-images/moloch.jpeg deleted file mode 100644 index d2ab14a47..000000000 Binary files a/cli/mockData/subgraph-metadata/subgraph-images/moloch.jpeg and /dev/null differ diff --git a/cli/mockData/subgraph-metadata/subgraph-images/origin.png b/cli/mockData/subgraph-metadata/subgraph-images/origin.png deleted file mode 100644 index a13e2313a..000000000 Binary files a/cli/mockData/subgraph-metadata/subgraph-images/origin.png and /dev/null differ diff --git a/cli/mockData/subgraph-metadata/subgraph-images/thegraph.jpeg b/cli/mockData/subgraph-metadata/subgraph-images/thegraph.jpeg deleted file mode 100644 index f2c7618e8..000000000 Binary files a/cli/mockData/subgraph-metadata/subgraph-images/thegraph.jpeg and /dev/null differ diff --git a/cli/mockData/subgraph-metadata/subgraph-images/uniswap.jpeg b/cli/mockData/subgraph-metadata/subgraph-images/uniswap.jpeg deleted file mode 100644 index c98eeb55d..000000000 Binary files a/cli/mockData/subgraph-metadata/subgraph-images/uniswap.jpeg and /dev/null differ diff --git a/cli/mockData/subgraph-metadata/subgraphMetadatas.ts b/cli/mockData/subgraph-metadata/subgraphMetadatas.ts deleted file mode 100644 index ee9fc05b7..000000000 --- a/cli/mockData/subgraph-metadata/subgraphMetadatas.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { jsonToSubgraphMetadata } from '../metadataHelpers' - -import compound from './compound.json' -import decentraland from './decentraland.json' -import ens from './ens.json' -import livepeer from './livepeer.json' -import maker from './maker.json' -import melon from './melon.json' -import moloch from './moloch.json' -import origin from './origin.json' -import thegraph from './thegraph.json' -import uniswap from './uniswap.json' - -const compoundMetadata = jsonToSubgraphMetadata(compound) -const decentralandMetadata = jsonToSubgraphMetadata(decentraland) -const ensMetadata = jsonToSubgraphMetadata(ens) -const livepeerMetadata = jsonToSubgraphMetadata(livepeer) -const makerMetadata = jsonToSubgraphMetadata(maker) -const melonMetadata = jsonToSubgraphMetadata(melon) -const molochMetadata = jsonToSubgraphMetadata(moloch) -const originMetadata = jsonToSubgraphMetadata(origin) -const thegraphMetadata = jsonToSubgraphMetadata(thegraph) -const uniswapMetadata = jsonToSubgraphMetadata(uniswap) - -export default { - compoundMetadata, - decentralandMetadata, - ensMetadata, - livepeerMetadata, - makerMetadata, - melonMetadata, - molochMetadata, - originMetadata, - thegraphMetadata, - uniswapMetadata, -} diff --git a/cli/mockData/subgraph-metadata/thegraph.json b/cli/mockData/subgraph-metadata/thegraph.json deleted file mode 100644 index b27787011..000000000 --- a/cli/mockData/subgraph-metadata/thegraph.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "description": "Scalable queries for a decentralized future.", - "displayName": "The Graph", - "image": "https://api.thegraph.com/ipfs/api/v0/cat?arg=QmTFK5DZc58XrTqhuuDTYoaq29ndnwoHX5TAW1bZr5EMpq", - "codeRepository": "https://github.com/graphprotocol/graph-network-subgraph", - "website": "https://thegraph.com/" -} \ No newline at end of file diff --git a/cli/mockData/subgraph-metadata/uniswap.json b/cli/mockData/subgraph-metadata/uniswap.json deleted file mode 100644 index 3f32c02d7..000000000 --- a/cli/mockData/subgraph-metadata/uniswap.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "description": "The subgraph tracks event based data, which updates each exchange to index the live data. It also stores historical data entities, which can be used, and queried to build historical data, which can be used for charts.", - "displayName": "Uniswap", - "image": "https://api.thegraph.com/ipfs/api/v0/cat?arg=QmSaK8PKxNWPv3QMMdjp8bYvQxnpU277DowPMwCUr7dAxS", - "codeRepository": "https://github.com/graphprotocol/uniswap-subgraph", - "website": "https://uniswap.info/" -} \ No newline at end of file diff --git a/cli/mockData/version-metadata/firstVersion.json b/cli/mockData/version-metadata/firstVersion.json deleted file mode 100644 index af2d5eb1f..000000000 --- a/cli/mockData/version-metadata/firstVersion.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "label": "v0.0.1", - "description": "First subgraph version" -} \ No newline at end of file diff --git a/cli/mockData/version-metadata/secondVersion.json b/cli/mockData/version-metadata/secondVersion.json deleted file mode 100644 index 26542b202..000000000 --- a/cli/mockData/version-metadata/secondVersion.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "label": "v0.2.0", - "description": "Second Version" -} \ No newline at end of file diff --git a/cli/mockData/version-metadata/versionMetadatas.ts b/cli/mockData/version-metadata/versionMetadatas.ts deleted file mode 100644 index 7ab789d0a..000000000 --- a/cli/mockData/version-metadata/versionMetadatas.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { jsonToVersionMetadata } from '../../metadataHelpers' - -import first from './firstVersion.json' -import second from './secondVersion.json' - -const firstVersion = jsonToVersionMetadata(first) -const secondVersion = jsonToVersionMetadata(second) - -export default { - firstVersion, - secondVersion, -} diff --git a/cli/network.ts b/cli/network.ts deleted file mode 100644 index dc83a9837..000000000 --- a/cli/network.ts +++ /dev/null @@ -1,369 +0,0 @@ -import { LinkReferences } from 'hardhat/types' - -import { - providers, - utils, - Contract, - ContractFactory, - ContractTransaction, - Signer, - Overrides, - BigNumber, -} from 'ethers' - -import { logger } from './logging' -import { AddressBook } from './address-book' -import { loadArtifact } from './artifacts' -import { defaultOverrides } from './defaults' - -const { keccak256, randomBytes, parseUnits, hexlify } = utils - -export const randomHexBytes = (n = 32): string => hexlify(randomBytes(n)) -export const toGRT = (value: string | number): BigNumber => { - return parseUnits(typeof value === 'number' ? value.toString() : value, '18') -} -export const getProvider = (providerUrl: string, network?: number): providers.JsonRpcProvider => - new providers.JsonRpcProvider(providerUrl, network) - -export const getChainID = (): number => { - return 4 // Only works for rinkeby right now -} - -const hash = (input: string): string => keccak256(`0x${input.replace(/^0x/, '')}`) - -type ContractParam = string | BigNumber | number -type DeployResult = { - contract: Contract - creationCodeHash: string - runtimeCodeHash: string - txHash: string - libraries?: { [libraryName: string]: string } -} - -// Simple sanity checks to make sure contracts from our address book have been deployed -export const isContractDeployed = async ( - name: string, - address: string | undefined, - addressBook: AddressBook, - provider: providers.Provider, - checkCreationCode = true, -): Promise => { - logger.info(`Checking for valid ${name} contract...`) - if (!address || address === '') { - logger.warn('This contract is not in our address book.') - return false - } - - const addressEntry = addressBook.getEntry(name) - - // If the contract is behind a proxy we check the Proxy artifact instead - const artifact = addressEntry.proxy === true ? loadArtifact('GraphProxy') : loadArtifact(name) - - if (checkCreationCode) { - const savedCreationCodeHash = addressEntry.creationCodeHash - const creationCodeHash = hash(artifact.bytecode) - if (!savedCreationCodeHash || savedCreationCodeHash !== creationCodeHash) { - logger.warn(`creationCodeHash in our address book doesn't match ${name} artifacts`) - logger.info(`${savedCreationCodeHash} !== ${creationCodeHash}`) - return false - } - } - - const savedRuntimeCodeHash = addressEntry.runtimeCodeHash - const runtimeCodeHash = hash(await provider.getCode(address)) - if (runtimeCodeHash === hash('0x00') || runtimeCodeHash === hash('0x')) { - logger.warn('No runtimeCode exists at the address in our address book') - return false - } - if (savedRuntimeCodeHash !== runtimeCodeHash) { - logger.warn(`runtimeCodeHash for ${address} does not match what's in our address book`) - logger.info(`${savedRuntimeCodeHash} !== ${runtimeCodeHash}`) - return false - } - return true -} - -export const waitTransaction = async ( - sender: Signer, - tx: ContractTransaction, -): Promise => { - const receipt = await sender.provider.waitForTransaction(tx.hash) - const networkName = (await sender.provider.getNetwork()).name - if (networkName === 'kovan' || networkName === 'rinkeby') { - receipt.status // 1 = success, 0 = failure - ? logger.info(`Transaction succeeded: 'https://${networkName}.etherscan.io/tx/${tx.hash}'`) - : logger.warn(`Transaction failed: 'https://${networkName}.etherscan.io/tx/${tx.hash}'`) - } else { - receipt.status - ? logger.info(`Transaction succeeded: ${tx.hash}`) - : logger.warn(`Transaction failed: ${tx.hash}`) - } - return receipt -} - -export const sendTransaction = async ( - sender: Signer, - contract: Contract, - fn: string, - // eslint-disable-next-line @typescript-eslint/no-explicit-any - params?: Array, - overrides?: Overrides, -): Promise => { - // Setup overrides - if (overrides) { - params.push(overrides) - } else { - params.push(defaultOverrides) - } - - // Send transaction - const tx: ContractTransaction = await contract.connect(sender).functions[fn](...params) - if (tx === undefined) { - logger.error( - `It appears the function does not exist on this contract, or you have the wrong contract address`, - ) - throw new Error('Transaction error') - } - logger.info( - `> Sent transaction ${fn}: [${params.slice(0, -1)}] \n contract: ${ - contract.address - }\n txHash: ${tx.hash}`, - ) - - // Wait for transaction to be mined - return waitTransaction(sender, tx) -} - -export const getContractFactory = ( - name: string, - libraries?: { [libraryName: string]: string }, -): ContractFactory => { - const artifact = loadArtifact(name) - // Fixup libraries - if (libraries && Object.keys(libraries).length > 0) { - artifact.bytecode = linkLibraries(artifact, libraries) - } - return new ContractFactory(artifact.abi, artifact.bytecode) -} - -export const getContractAt = ( - name: string, - address: string, - signerOrProvider?: Signer | providers.Provider, -): Contract => { - return new Contract(address, loadArtifact(name).abi, signerOrProvider) -} - -export const deployProxy = async ( - implementationAddress: string, - proxyAdminAddress: string, - sender: Signer, - overrides?: Overrides, -): Promise => { - return deployContract( - 'GraphProxy', - [implementationAddress, proxyAdminAddress], - sender, - false, - overrides, - ) -} - -export const deployContract = async ( - name: string, - args: Array, - sender: Signer, - autolink = true, - overrides?: Overrides, -): Promise => { - // This function will autolink, that means it will automatically deploy external libraries - // and link them to the contract - const libraries = {} - if (autolink) { - const artifact = loadArtifact(name) - if (artifact.linkReferences && Object.keys(artifact.linkReferences).length > 0) { - for (const fileReferences of Object.values(artifact.linkReferences)) { - for (const libName of Object.keys(fileReferences)) { - const deployResult = await deployContract(libName, [], sender, false, overrides) - libraries[libName] = deployResult.contract.address - } - } - } - } - - // Deploy - const factory = getContractFactory(name, libraries) - const contract = await factory.connect(sender).deploy(...args) - const txHash = contract.deployTransaction.hash - logger.info(`> Deploy ${name}, txHash: ${txHash}`) - await sender.provider.waitForTransaction(txHash) - - // Receipt - const creationCodeHash = hash(factory.bytecode) - const runtimeCodeHash = hash(await sender.provider.getCode(contract.address)) - logger.info('= CreationCodeHash: ', creationCodeHash) - logger.info('= RuntimeCodeHash: ', runtimeCodeHash) - logger.info(`${name} has been deployed to address: ${contract.address}`) - - return { contract, creationCodeHash, runtimeCodeHash, txHash, libraries } -} - -export const deployContractWithProxy = async ( - proxyAdmin: Contract, - name: string, - args: Array, - sender: Signer, - buildAcceptProxyTx = false, - overrides?: Overrides, -): Promise => { - // Deploy implementation - const { contract } = await deployContract(name, [], sender, true, overrides) - - // Wrap implementation with proxy - const proxy = await wrapContractWithProxy( - proxyAdmin, - contract, - args, - sender, - buildAcceptProxyTx, - overrides, - ) - - // Use interface of contract but with the proxy address - return contract.attach(proxy.address) -} - -export const wrapContractWithProxy = async ( - proxyAdmin: Contract, - contract: Contract, - args: Array, - sender: Signer, - buildAcceptProxyTx = false, - overrides?: Overrides, -): Promise => { - // Deploy proxy - const { contract: proxy } = await deployProxy( - contract.address, - proxyAdmin.address, - sender, - overrides, - ) - - // Implementation accepts upgrade - const initTx = args ? await contract.populateTransaction.initialize(...args) : null - const acceptFunctionName = initTx ? 'acceptProxyAndCall' : 'acceptProxy' - const acceptFunctionParams = initTx - ? [contract.address, proxy.address, initTx.data] - : [contract.address, proxy.address] - if (buildAcceptProxyTx) { - logger.info( - ` - Copy this data in the Gnosis Multisig UI, or a similar app and call ${acceptFunctionName} - -------------------------------------------------------------------------------------- - > Contract Address: ${proxyAdmin.address} - > Implementation: ${contract.address} - > Proxy: ${proxy.address} - > Data: ${initTx && initTx.data} - `, - ) - } else { - await sendTransaction(sender, proxyAdmin, acceptFunctionName, acceptFunctionParams) - } - - return proxy -} - -export const deployContractAndSave = async ( - name: string, - args: Array, - sender: Signer, - addressBook: AddressBook, -): Promise => { - // Deploy the contract - const deployResult = await deployContract(name, args, sender) - - // Save address entry - addressBook.setEntry(name, { - address: deployResult.contract.address, - constructorArgs: args.length === 0 ? undefined : args.map((e) => e.toString()), - creationCodeHash: deployResult.creationCodeHash, - runtimeCodeHash: deployResult.runtimeCodeHash, - txHash: deployResult.txHash, - libraries: - deployResult.libraries && Object.keys(deployResult.libraries).length > 0 - ? deployResult.libraries - : undefined, - }) - logger.info('> Contract saved to address book') - - return deployResult.contract -} - -export const deployContractWithProxyAndSave = async ( - name: string, - args: Array, - sender: Signer, - addressBook: AddressBook, - buildAcceptProxyTx?: boolean, -): Promise => { - // Get the GraphProxyAdmin to own the GraphProxy for this contract - const proxyAdminEntry = addressBook.getEntry('GraphProxyAdmin') - if (!proxyAdminEntry) { - throw new Error('GraphProxyAdmin not detected in the config, must be deployed first!') - } - const proxyAdmin = getContractAt('GraphProxyAdmin', proxyAdminEntry.address) - - // Deploy implementation - const contract = await deployContractAndSave(name, [], sender, addressBook) - - // Wrap implementation with proxy - const proxy = await wrapContractWithProxy(proxyAdmin, contract, args, sender, buildAcceptProxyTx) - - // Overwrite address entry with proxy - const artifact = loadArtifact('GraphProxy') - const contractEntry = addressBook.getEntry(name) - addressBook.setEntry(name, { - address: proxy.address, - initArgs: args.length === 0 ? undefined : args.map((e) => e.toString()), - creationCodeHash: hash(artifact.bytecode), - runtimeCodeHash: hash(await sender.provider.getCode(proxy.address)), - txHash: proxy.deployTransaction.hash, - proxy: true, - implementation: contractEntry, - }) - logger.info('> Contract saved to address book') - - // Use interface of contract but with the proxy address - return contract.attach(proxy.address) -} - -export const linkLibraries = ( - artifact: { - bytecode: string - linkReferences?: LinkReferences - }, - libraries?: { [libraryName: string]: string }, -): string => { - let bytecode = artifact.bytecode - - if (libraries) { - if (artifact.linkReferences) { - for (const fileReferences of Object.values(artifact.linkReferences)) { - for (const [libName, fixups] of Object.entries(fileReferences)) { - const addr = libraries[libName] - if (addr === undefined) { - continue - } - - for (const fixup of fixups) { - bytecode = - bytecode.substr(0, 2 + fixup.start * 2) + - addr.substr(2) + - bytecode.substr(2 + (fixup.start + fixup.length) * 2) - } - } - } - } - } - return bytecode -} diff --git a/cli/utils.ts b/cli/utils.ts deleted file mode 100644 index a11e40f4e..000000000 --- a/cli/utils.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { Contract, Wallet, providers } from 'ethers' - -import { loadArtifact } from './artifacts' - -export const contractAt = ( - contractName: string, - contractAddress: string, - wallet: Wallet, -): Contract => { - return new Contract(contractAddress, loadArtifact(contractName).abi, wallet.provider) -} - -export const getProvider = (providerUrl: string, network?: number): providers.JsonRpcProvider => - new providers.JsonRpcProvider(providerUrl, network) diff --git a/commitlint.config.js b/commitlint.config.js new file mode 100644 index 000000000..4fedde6da --- /dev/null +++ b/commitlint.config.js @@ -0,0 +1 @@ +module.exports = { extends: ['@commitlint/config-conventional'] } diff --git a/contracts/.gitattributes b/contracts/.gitattributes deleted file mode 100644 index 52031de51..000000000 --- a/contracts/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -*.sol linguist-language=Solidity diff --git a/contracts/curation/Curation.sol b/contracts/curation/Curation.sol deleted file mode 100644 index ebad1afb0..000000000 --- a/contracts/curation/Curation.sol +++ /dev/null @@ -1,466 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.7.3; - -import "@openzeppelin/contracts/math/SafeMath.sol"; - -import "../bancor/BancorFormula.sol"; -import "../upgrades/GraphUpgradeable.sol"; - -import "./CurationStorage.sol"; -import "./ICuration.sol"; -import "./GraphCurationToken.sol"; - -/** - * @title Curation contract - * @dev Allows curators to signal on subgraph deployments that might be relevant to indexers by - * staking Graph Tokens (GRT). Additionally, curators earn fees from the Query Market related to the - * subgraph deployment they curate. - * A curators deposit goes to a curation pool along with the deposits of other curators, - * only one such pool exists for each subgraph deployment. - * The contract mints Graph Curation Shares (GCS) according to a bonding curve for each individual - * curation pool where GRT is deposited. - * Holders can burn GCS using this contract to get GRT tokens back according to the - * bonding curve. - */ -contract Curation is CurationV1Storage, GraphUpgradeable, ICuration { - using SafeMath for uint256; - - // 100% in parts per million - uint32 private constant MAX_PPM = 1000000; - - // Amount of signal you get with your minimum token deposit - uint256 private constant SIGNAL_PER_MINIMUM_DEPOSIT = 1e18; // 1 signal as 18 decimal number - - // -- Events -- - - /** - * @dev Emitted when `curator` deposited `tokens` on `subgraphDeploymentID` as curation signal. - * The `curator` receives `signal` amount according to the curation pool bonding curve. - * An amount of `curationTax` will be collected and burned. - */ - event Signalled( - address indexed curator, - bytes32 indexed subgraphDeploymentID, - uint256 tokens, - uint256 signal, - uint256 curationTax - ); - - /** - * @dev Emitted when `curator` burned `signal` for a `subgraphDeploymentID`. - * The curator will receive `tokens` according to the value of the bonding curve. - */ - event Burned( - address indexed curator, - bytes32 indexed subgraphDeploymentID, - uint256 tokens, - uint256 signal - ); - - /** - * @dev Emitted when `tokens` amount were collected for `subgraphDeploymentID` as part of fees - * distributed by an indexer from query fees received from state channels. - */ - event Collected(bytes32 indexed subgraphDeploymentID, uint256 tokens); - - /** - * @dev Initialize this contract. - */ - function initialize( - address _controller, - address _bondingCurve, - uint32 _defaultReserveRatio, - uint32 _curationTaxPercentage, - uint256 _minimumCurationDeposit - ) external onlyImpl { - Managed._initialize(_controller); - - require(_bondingCurve != address(0), "Bonding curve must be set"); - bondingCurve = _bondingCurve; - - // Settings - _setDefaultReserveRatio(_defaultReserveRatio); - _setCurationTaxPercentage(_curationTaxPercentage); - _setMinimumCurationDeposit(_minimumCurationDeposit); - } - - /** - * @dev Set the default reserve ratio percentage for a curation pool. - * @notice Update the default reserver ratio to `_defaultReserveRatio` - * @param _defaultReserveRatio Reserve ratio (in PPM) - */ - function setDefaultReserveRatio(uint32 _defaultReserveRatio) external override onlyGovernor { - _setDefaultReserveRatio(_defaultReserveRatio); - } - - /** - * @dev Internal: Set the default reserve ratio percentage for a curation pool. - * @notice Update the default reserver ratio to `_defaultReserveRatio` - * @param _defaultReserveRatio Reserve ratio (in PPM) - */ - function _setDefaultReserveRatio(uint32 _defaultReserveRatio) private { - // Reserve Ratio must be within 0% to 100% (inclusive, in PPM) - require(_defaultReserveRatio > 0, "Default reserve ratio must be > 0"); - require( - _defaultReserveRatio <= MAX_PPM, - "Default reserve ratio cannot be higher than MAX_PPM" - ); - - defaultReserveRatio = _defaultReserveRatio; - emit ParameterUpdated("defaultReserveRatio"); - } - - /** - * @dev Set the minimum deposit amount for curators. - * @notice Update the minimum deposit amount to `_minimumCurationDeposit` - * @param _minimumCurationDeposit Minimum amount of tokens required deposit - */ - function setMinimumCurationDeposit(uint256 _minimumCurationDeposit) - external - override - onlyGovernor - { - _setMinimumCurationDeposit(_minimumCurationDeposit); - } - - /** - * @dev Internal: Set the minimum deposit amount for curators. - * @notice Update the minimum deposit amount to `_minimumCurationDeposit` - * @param _minimumCurationDeposit Minimum amount of tokens required deposit - */ - function _setMinimumCurationDeposit(uint256 _minimumCurationDeposit) private { - require(_minimumCurationDeposit > 0, "Minimum curation deposit cannot be 0"); - - minimumCurationDeposit = _minimumCurationDeposit; - emit ParameterUpdated("minimumCurationDeposit"); - } - - /** - * @dev Set the curation tax percentage to charge when a curator deposits GRT tokens. - * @param _percentage Curation tax percentage charged when depositing GRT tokens - */ - function setCurationTaxPercentage(uint32 _percentage) external override onlyGovernor { - _setCurationTaxPercentage(_percentage); - } - - /** - * @dev Internal: Set the curation tax percentage to charge when a curator deposits GRT tokens. - * @param _percentage Curation tax percentage charged when depositing GRT tokens - */ - function _setCurationTaxPercentage(uint32 _percentage) private { - require( - _percentage <= MAX_PPM, - "Curation tax percentage must be below or equal to MAX_PPM" - ); - - _curationTaxPercentage = _percentage; - emit ParameterUpdated("curationTaxPercentage"); - } - - /** - * @dev Assign Graph Tokens collected as curation fees to the curation pool reserve. - * This function can only be called by the Staking contract and will do the bookeeping of - * transferred tokens into this contract. - * @param _subgraphDeploymentID SubgraphDeployment where funds should be allocated as reserves - * @param _tokens Amount of Graph Tokens to add to reserves - */ - function collect(bytes32 _subgraphDeploymentID, uint256 _tokens) external override { - // Only Staking contract is authorized as caller - require(msg.sender == address(staking()), "Caller must be the staking contract"); - - // Must be curated to accept tokens - require( - isCurated(_subgraphDeploymentID), - "Subgraph deployment must be curated to collect fees" - ); - - // Collect new funds into reserve - CurationPool storage curationPool = pools[_subgraphDeploymentID]; - curationPool.tokens = curationPool.tokens.add(_tokens); - - emit Collected(_subgraphDeploymentID, _tokens); - } - - /** - * @dev Deposit Graph Tokens in exchange for signal of a SubgraphDeployment curation pool. - * @param _subgraphDeploymentID Subgraph deployment pool from where to mint signal - * @param _tokensIn Amount of Graph Tokens to deposit - * @param _signalOutMin Expected minimum amount of signal to receive - * @return Signal minted and deposit tax - */ - function mint( - bytes32 _subgraphDeploymentID, - uint256 _tokensIn, - uint256 _signalOutMin - ) external override notPartialPaused returns (uint256, uint256) { - // Need to deposit some funds - require(_tokensIn > 0, "Cannot deposit zero tokens"); - - // Exchange GRT tokens for GCS of the subgraph pool - (uint256 signalOut, uint256 curationTax) = tokensToSignal(_subgraphDeploymentID, _tokensIn); - - // Slippage protection - require(signalOut >= _signalOutMin, "Slippage protection"); - - address curator = msg.sender; - CurationPool storage curationPool = pools[_subgraphDeploymentID]; - - // If it hasn't been curated before then initialize the curve - if (!isCurated(_subgraphDeploymentID)) { - // Initialize - curationPool.reserveRatio = defaultReserveRatio; - - // If no signal token for the pool - create one - if (address(curationPool.gcs) == address(0)) { - // TODO: Use a minimal proxy to reduce gas cost - // https://github.com/graphprotocol/contracts/issues/405 - // --abarmat-- 20201113 - curationPool.gcs = IGraphCurationToken( - address(new GraphCurationToken(address(this))) - ); - } - } - - // Trigger update rewards calculation snapshot - _updateRewards(_subgraphDeploymentID); - - // Transfer tokens from the curator to this contract - // This needs to happen after _updateRewards snapshot as that function - // is using balanceOf(curation) - IGraphToken graphToken = graphToken(); - require( - graphToken.transferFrom(curator, address(this), _tokensIn), - "Cannot transfer tokens to deposit" - ); - - // Burn withdrawal fees - if (curationTax > 0) { - graphToken.burn(curationTax); - } - - // Update curation pool - curationPool.tokens = curationPool.tokens.add(_tokensIn.sub(curationTax)); - curationPool.gcs.mint(curator, signalOut); - - emit Signalled(curator, _subgraphDeploymentID, _tokensIn, signalOut, curationTax); - - return (signalOut, curationTax); - } - - /** - * @dev Return an amount of signal to get tokens back. - * @notice Burn _signal from the SubgraphDeployment curation pool - * @param _subgraphDeploymentID SubgraphDeployment the curator is returning signal - * @param _signalIn Amount of signal to return - * @param _tokensOutMin Expected minimum amount of tokens to receive - * @return Tokens returned - */ - function burn( - bytes32 _subgraphDeploymentID, - uint256 _signalIn, - uint256 _tokensOutMin - ) external override notPartialPaused returns (uint256) { - address curator = msg.sender; - - // Validations - require(_signalIn > 0, "Cannot burn zero signal"); - require( - getCuratorSignal(curator, _subgraphDeploymentID) >= _signalIn, - "Cannot burn more signal than you own" - ); - - // Get the amount of tokens to refund based on returned signal - uint256 tokensOut = signalToTokens(_subgraphDeploymentID, _signalIn); - - // Slippage protection - require(tokensOut >= _tokensOutMin, "Slippage protection"); - - // Trigger update rewards calculation - _updateRewards(_subgraphDeploymentID); - - // Update curation pool - CurationPool storage curationPool = pools[_subgraphDeploymentID]; - curationPool.tokens = curationPool.tokens.sub(tokensOut); - curationPool.gcs.burnFrom(curator, _signalIn); - - // If all signal burnt delete the curation pool - if (getCurationPoolSignal(_subgraphDeploymentID) == 0) { - delete pools[_subgraphDeploymentID]; - } - - // Return the tokens to the curator - require(graphToken().transfer(curator, tokensOut), "Error sending curator tokens"); - - emit Burned(curator, _subgraphDeploymentID, tokensOut, _signalIn); - - return tokensOut; - } - - /** - * @dev Check if any GRT tokens are deposited for a SubgraphDeployment. - * @param _subgraphDeploymentID SubgraphDeployment to check if curated - * @return True if curated - */ - function isCurated(bytes32 _subgraphDeploymentID) public override view returns (bool) { - return pools[_subgraphDeploymentID].tokens > 0; - } - - /** - * @dev Get the amount of signal a curator has in a curation pool. - * @param _curator Curator owning the signal tokens - * @param _subgraphDeploymentID Subgraph deployment curation pool - * @return Amount of signal owned by a curator for the subgraph deployment - */ - function getCuratorSignal(address _curator, bytes32 _subgraphDeploymentID) - public - override - view - returns (uint256) - { - if (address(pools[_subgraphDeploymentID].gcs) == address(0)) { - return 0; - } - return pools[_subgraphDeploymentID].gcs.balanceOf(_curator); - } - - /** - * @dev Get the amount of signal in a curation pool. - * @param _subgraphDeploymentID Subgraph deployment curation poool - * @return Amount of signal minted for the subgraph deployment - */ - function getCurationPoolSignal(bytes32 _subgraphDeploymentID) - public - override - view - returns (uint256) - { - if (address(pools[_subgraphDeploymentID].gcs) == address(0)) { - return 0; - } - return pools[_subgraphDeploymentID].gcs.totalSupply(); - } - - /** - * @dev Get the amount of token reserves in a curation pool. - * @param _subgraphDeploymentID Subgraph deployment curation poool - * @return Amount of token reserves in the curation pool - */ - function getCurationPoolTokens(bytes32 _subgraphDeploymentID) - external - override - view - returns (uint256) - { - return pools[_subgraphDeploymentID].tokens; - } - - /** - * @dev Get curation tax percentage - * @return Amount the curation tax percentage in PPM - */ - function curationTaxPercentage() external override view returns (uint32) { - return _curationTaxPercentage; - } - - /** - * @dev Calculate amount of signal that can be bought with tokens in a curation pool. - * This function considers and excludes the deposit tax. - * @param _subgraphDeploymentID Subgraph deployment to mint signal - * @param _tokensIn Amount of tokens used to mint signal - * @return Amount of signal that can be bought and tokens subtracted for the tax - */ - function tokensToSignal(bytes32 _subgraphDeploymentID, uint256 _tokensIn) - public - override - view - returns (uint256, uint256) - { - uint256 curationTax = _tokensIn.mul(uint256(_curationTaxPercentage)).div(MAX_PPM); - uint256 signalOut = _tokensToSignal(_subgraphDeploymentID, _tokensIn.sub(curationTax)); - return (signalOut, curationTax); - } - - /** - * @dev Calculate amount of signal that can be bought with tokens in a curation pool. - * @param _subgraphDeploymentID Subgraph deployment to mint signal - * @param _tokensIn Amount of tokens used to mint signal - * @return Amount of signal that can be bought with tokens - */ - function _tokensToSignal(bytes32 _subgraphDeploymentID, uint256 _tokensIn) - private - view - returns (uint256) - { - // Get curation pool tokens and signal - CurationPool memory curationPool = pools[_subgraphDeploymentID]; - - // Init curation pool - if (curationPool.tokens == 0) { - require( - _tokensIn >= minimumCurationDeposit, - "Curation deposit is below minimum required" - ); - return - BancorFormula(bondingCurve) - .calculatePurchaseReturn( - SIGNAL_PER_MINIMUM_DEPOSIT, - minimumCurationDeposit, - defaultReserveRatio, - _tokensIn.sub(minimumCurationDeposit) - ) - .add(SIGNAL_PER_MINIMUM_DEPOSIT); - } - - return - BancorFormula(bondingCurve).calculatePurchaseReturn( - getCurationPoolSignal(_subgraphDeploymentID), - curationPool.tokens, - curationPool.reserveRatio, - _tokensIn - ); - } - - /** - * @dev Calculate number of tokens to get when burning signal from a curation pool. - * @param _subgraphDeploymentID Subgraph deployment to burn signal - * @param _signalIn Amount of signal to burn - * @return Amount of tokens to get for an amount of signal - */ - function signalToTokens(bytes32 _subgraphDeploymentID, uint256 _signalIn) - public - override - view - returns (uint256) - { - CurationPool memory curationPool = pools[_subgraphDeploymentID]; - uint256 curationPoolSignal = getCurationPoolSignal(_subgraphDeploymentID); - require( - curationPool.tokens > 0, - "Subgraph deployment must be curated to perform calculations" - ); - require( - curationPoolSignal >= _signalIn, - "Signal must be above or equal to signal issued in the curation pool" - ); - - return - BancorFormula(bondingCurve).calculateSaleReturn( - curationPoolSignal, - curationPool.tokens, - curationPool.reserveRatio, - _signalIn - ); - } - - /** - * @dev Triggers an update of rewards due to a change in signal. - * @param _subgraphDeploymentID Subgraph deployment updated - */ - function _updateRewards(bytes32 _subgraphDeploymentID) private { - IRewardsManager rewardsManager = rewardsManager(); - if (address(rewardsManager) != address(0)) { - rewardsManager.onSubgraphSignalUpdate(_subgraphDeploymentID); - } - } -} diff --git a/contracts/curation/CurationStorage.sol b/contracts/curation/CurationStorage.sol deleted file mode 100644 index 0fbc60bae..000000000 --- a/contracts/curation/CurationStorage.sol +++ /dev/null @@ -1,29 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.7.3; - -import "./ICuration.sol"; -import "../governance/Managed.sol"; - -contract CurationV1Storage is Managed { - // -- State -- - - // Tax charged when curator deposit funds - // Parts per million. (Allows for 4 decimal points, 999,999 = 99.9999%) - uint32 internal _curationTaxPercentage; - - // Default reserve ratio to configure curator shares bonding curve - // Parts per million. (Allows for 4 decimal points, 999,999 = 99.9999%) - uint32 public defaultReserveRatio; - - // Minimum amount allowed to be deposited by curators to initialize a pool - // This is the `startPoolBalance` for the bonding curve - uint256 public minimumCurationDeposit; - - // Bonding curve formula - address public bondingCurve; - - // Mapping of subgraphDeploymentID => CurationPool - // There is only one CurationPool per SubgraphDeploymentID - mapping(bytes32 => ICuration.CurationPool) public pools; -} diff --git a/contracts/curation/GraphCurationToken.sol b/contracts/curation/GraphCurationToken.sol deleted file mode 100644 index dbe9fee32..000000000 --- a/contracts/curation/GraphCurationToken.sol +++ /dev/null @@ -1,43 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.7.3; - -import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; - -import "../governance/Governed.sol"; - -/** - * @title GraphCurationToken contract - * @dev This is the implementation of the Curation ERC20 token (GCS). - * GCS are created for each subgraph deployment curated in the Curation contract. - * The Curation contract is the owner of GCS tokens and the only one allowed to mint or - * burn them. GCS tokens are transferrable and their holders can do any action allowed - * in a standard ERC20 token implementation except for burning them. - */ -contract GraphCurationToken is ERC20, Governed { - /** - * @dev Graph Curation Token Contract Constructor. - * @param _owner Address of the contract issuing this token - */ - constructor(address _owner) ERC20("Graph Curation Share", "GCS") { - Governed._initialize(_owner); - } - - /** - * @dev Mint new tokens. - * @param _to Address to send the newly minted tokens - * @param _amount Amount of tokens to mint - */ - function mint(address _to, uint256 _amount) public onlyGovernor { - _mint(_to, _amount); - } - - /** - * @dev Burn tokens from an address. - * @param _account Address from where tokens will be burned - * @param _amount Amount of tokens to burn - */ - function burnFrom(address _account, uint256 _amount) public onlyGovernor { - _burn(_account, _amount); - } -} diff --git a/contracts/curation/ICuration.sol b/contracts/curation/ICuration.sol deleted file mode 100644 index 829288766..000000000 --- a/contracts/curation/ICuration.sol +++ /dev/null @@ -1,64 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.7.3; - -import "./IGraphCurationToken.sol"; - -interface ICuration { - // -- Pool -- - - struct CurationPool { - uint256 tokens; // GRT Tokens stored as reserves for the subgraph deployment - uint32 reserveRatio; // Ratio for the bonding curve - IGraphCurationToken gcs; // Curation token contract for this curation pool - } - - // -- Configuration -- - - function setDefaultReserveRatio(uint32 _defaultReserveRatio) external; - - function setMinimumCurationDeposit(uint256 _minimumCurationDeposit) external; - - function setCurationTaxPercentage(uint32 _percentage) external; - - // -- Curation -- - - function mint( - bytes32 _subgraphDeploymentID, - uint256 _tokensIn, - uint256 _signalOutMin - ) external returns (uint256, uint256); - - function burn( - bytes32 _subgraphDeploymentID, - uint256 _signalIn, - uint256 _tokensOutMin - ) external returns (uint256); - - function collect(bytes32 _subgraphDeploymentID, uint256 _tokens) external; - - // -- Getters -- - - function isCurated(bytes32 _subgraphDeploymentID) external view returns (bool); - - function getCuratorSignal(address _curator, bytes32 _subgraphDeploymentID) - external - view - returns (uint256); - - function getCurationPoolSignal(bytes32 _subgraphDeploymentID) external view returns (uint256); - - function getCurationPoolTokens(bytes32 _subgraphDeploymentID) external view returns (uint256); - - function tokensToSignal(bytes32 _subgraphDeploymentID, uint256 _tokensIn) - external - view - returns (uint256, uint256); - - function signalToTokens(bytes32 _subgraphDeploymentID, uint256 _signalIn) - external - view - returns (uint256); - - function curationTaxPercentage() external view returns (uint32); -} diff --git a/contracts/curation/IGraphCurationToken.sol b/contracts/curation/IGraphCurationToken.sol deleted file mode 100644 index 9421120b6..000000000 --- a/contracts/curation/IGraphCurationToken.sol +++ /dev/null @@ -1,11 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.7.3; - -import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; - -interface IGraphCurationToken is IERC20 { - function burnFrom(address _account, uint256 _amount) external; - - function mint(address _to, uint256 _amount) external; -} diff --git a/contracts/discovery/GNS.sol b/contracts/discovery/GNS.sol deleted file mode 100644 index 4cbdc768c..000000000 --- a/contracts/discovery/GNS.sol +++ /dev/null @@ -1,704 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.7.3; -pragma experimental ABIEncoderV2; - -import "@openzeppelin/contracts/math/SafeMath.sol"; - -import "../bancor/BancorFormula.sol"; -import "../upgrades/GraphUpgradeable.sol"; - -import "./IGNS.sol"; -import "./GNSStorage.sol"; - -/** - * @title GNS - * @dev The Graph Name System contract provides a decentralized naming system for subgraphs - * used in the scope of the Graph Network. It translates subgraph names into subgraph versions. - * Each version is associated with a Subgraph Deployment. The contract has no knowledge of - * human-readable names. All human readable names emitted in events. - */ -contract GNS is GNSV1Storage, GraphUpgradeable, IGNS { - using SafeMath for uint256; - - uint256 private constant MAX_UINT256 = 2**256 - 1; - - // 100% in parts per million - uint32 private constant MAX_PPM = 1000000; - - // Equates to Connector weight on bancor formula to be CW = 1 - uint32 private constant defaultReserveRatio = 1000000; - - // -- Events -- - - /** - * @dev Emitted when graph account sets its default name - */ - event SetDefaultName( - address indexed graphAccount, - uint256 nameSystem, // only ENS for now - bytes32 nameIdentifier, - string name - ); - - /** - * @dev Emitted when graph account sets a subgraphs metadata on IPFS - */ - event SubgraphMetadataUpdated( - address indexed graphAccount, - uint256 indexed subgraphNumber, - bytes32 subgraphMetadata - ); - - /** - * @dev Emitted when a `graph account` publishes a `subgraph` with a `version`. - * Every time this event is emitted, indicates a new version has been created. - * The event also emits a `metadataHash` with subgraph details and version details. - */ - event SubgraphPublished( - address indexed graphAccount, - uint256 indexed subgraphNumber, - bytes32 indexed subgraphDeploymentID, - bytes32 versionMetadata - ); - - /** - * @dev Emitted when a graph account deprecated one of its subgraphs - */ - event SubgraphDeprecated(address indexed graphAccount, uint256 indexed subgraphNumber); - - /** - * @dev Emitted when a graphAccount creates an nSignal bonding curve that - * points to a subgraph deployment - */ - event NameSignalEnabled( - address indexed graphAccount, - uint256 indexed subgraphNumber, - bytes32 indexed subgraphDeploymentID, - uint32 reserveRatio - ); - - /** - * @dev Emitted when a name curator deposits its vSignal into an nSignal curve to mint nSignal - */ - event NSignalMinted( - address indexed graphAccount, - uint256 indexed subgraphNumber, - address indexed nameCurator, - uint256 nSignalCreated, - uint256 vSignalCreated, - uint256 tokensDeposited - ); - - /** - * @dev Emitted when a name curator burns its nSignal, which in turn burns - * the vSignal, and receives GRT - */ - event NSignalBurned( - address indexed graphAccount, - uint256 indexed subgraphNumber, - address indexed nameCurator, - uint256 nSignalBurnt, - uint256 vSignalBurnt, - uint256 tokensReceived - ); - - /** - * @dev Emitted when a graph account upgrades its nSignal curve to point to a new - * subgraph deployment, burning all the old vSignal and depositing the GRT into the - * new vSignal curve, creating new nSignal - */ - event NameSignalUpgrade( - address indexed graphAccount, - uint256 indexed subgraphNumber, - uint256 newVSignalCreated, - uint256 tokensSignalled, - bytes32 indexed subgraphDeploymentID - ); - - /** - * @dev Emitted when an nSignal curve has been permanently disabled - */ - event NameSignalDisabled( - address indexed graphAccount, - uint256 indexed subgraphNumber, - uint256 withdrawableGRT - ); - - /** - * @dev Emitted when a nameCurator withdraws its GRT from a deprecated name signal pool - */ - event GRTWithdrawn( - address indexed graphAccount, - uint256 indexed subgraphNumber, - address indexed nameCurator, - uint256 nSignalBurnt, - uint256 withdrawnGRT - ); - - /** - @dev Modifier that allows a function to be called by owner of a graph account - @param _graphAccount Address of the graph account - */ - modifier onlyGraphAccountOwner(address _graphAccount) { - address graphAccountOwner = erc1056Registry.identityOwner(_graphAccount); - require(graphAccountOwner == msg.sender, "GNS: Only graph account owner can call"); - _; - } - - /** - * @dev Initialize this contract. - */ - function initialize( - address _controller, - address _bondingCurve, - address _didRegistry - ) external onlyImpl { - Managed._initialize(_controller); - - bondingCurve = _bondingCurve; - erc1056Registry = IEthereumDIDRegistry(_didRegistry); - - // Settings - _setOwnerTaxPercentage(500000); - } - - /** - * @dev Approve curation contract to pull funds. - */ - function approveAll() external override { - graphToken().approve(address(curation()), MAX_UINT256); - } - - /** - * @dev Set the owner fee percentage. This is used to prevent a subgraph owner to drain all - * the name curators tokens while upgrading or deprecating and is configurable in parts per hundred. - * @param _ownerTaxPercentage Owner tax percentage - */ - function setOwnerTaxPercentage(uint32 _ownerTaxPercentage) external override onlyGovernor { - _setOwnerTaxPercentage(_ownerTaxPercentage); - } - - /** - * @dev Internal: Set the owner tax percentage. This is used to prevent a subgraph owner to drain all - * the name curators tokens while upgrading or deprecating and is configurable in parts per hundred. - * @param _ownerTaxPercentage Owner tax percentage - */ - function _setOwnerTaxPercentage(uint32 _ownerTaxPercentage) private { - require(_ownerTaxPercentage <= MAX_PPM, "Owner tax must be MAX_PPM or less"); - ownerTaxPercentage = _ownerTaxPercentage; - emit ParameterUpdated("ownerTaxPercentage"); - } - - /** - * @dev Allows a graph account to set a default name - * @param _graphAccount Account that is setting its name - * @param _nameSystem Name system account already has ownership of a name in - * @param _nameIdentifier The unique identifier that is used to identify the name in the system - * @param _name The name being set as default - */ - function setDefaultName( - address _graphAccount, - uint8 _nameSystem, - bytes32 _nameIdentifier, - string calldata _name - ) external override onlyGraphAccountOwner(_graphAccount) { - emit SetDefaultName(_graphAccount, _nameSystem, _nameIdentifier, _name); - } - - /** - * @dev Allows a graph account update the metadata of a subgraph they have published - * @param _graphAccount Account that owns the subgraph - * @param _subgraphNumber Subgraph number - * @param _subgraphMetadata IPFS hash for the subgraph metadata - */ - function updateSubgraphMetadata( - address _graphAccount, - uint256 _subgraphNumber, - bytes32 _subgraphMetadata - ) public override onlyGraphAccountOwner(_graphAccount) { - emit SubgraphMetadataUpdated(_graphAccount, _subgraphNumber, _subgraphMetadata); - } - - /** - * @dev Allows a graph account to publish a new subgraph, which means a new subgraph number - * will be used. - * @param _graphAccount Account that is publishing the subgraph - * @param _subgraphDeploymentID Subgraph deployment ID of the version, linked to the name - * @param _versionMetadata IPFS hash for the subgraph version metadata - * @param _subgraphMetadata IPFS hash for the subgraph metadata - */ - function publishNewSubgraph( - address _graphAccount, - bytes32 _subgraphDeploymentID, - bytes32 _versionMetadata, - bytes32 _subgraphMetadata - ) external override notPaused onlyGraphAccountOwner(_graphAccount) { - uint256 subgraphNumber = graphAccountSubgraphNumbers[_graphAccount]; - _publishVersion(_graphAccount, subgraphNumber, _subgraphDeploymentID, _versionMetadata); - graphAccountSubgraphNumbers[_graphAccount] = graphAccountSubgraphNumbers[_graphAccount].add( - 1 - ); - updateSubgraphMetadata(_graphAccount, subgraphNumber, _subgraphMetadata); - _enableNameSignal(_graphAccount, subgraphNumber); - } - - /** - * @dev Allows a graph account to publish a new version of its subgraph. - * Version is derived from the occurrence of SubgraphPublished being emitted. - * The first time SubgraphPublished is called would be Version 0 - * @param _graphAccount Account that is publishing the subgraph - * @param _subgraphNumber Subgraph number for the account - * @param _subgraphDeploymentID Subgraph deployment ID of the version, linked to the name - * @param _versionMetadata IPFS hash for the subgraph version metadata - */ - function publishNewVersion( - address _graphAccount, - uint256 _subgraphNumber, - bytes32 _subgraphDeploymentID, - bytes32 _versionMetadata - ) external override notPaused onlyGraphAccountOwner(_graphAccount) { - require( - isPublished(_graphAccount, _subgraphNumber), - "GNS: Cannot update version if not published, or has been deprecated" - ); - bytes32 oldSubgraphDeploymentID = subgraphs[_graphAccount][_subgraphNumber]; - require( - _subgraphDeploymentID != oldSubgraphDeploymentID, - "GNS: Cannot publish a new version with the same subgraph deployment ID" - ); - - _publishVersion(_graphAccount, _subgraphNumber, _subgraphDeploymentID, _versionMetadata); - _upgradeNameSignal(_graphAccount, _subgraphNumber, _subgraphDeploymentID); - } - - /** - * @dev Private function used by both external publishing functions - * @param _graphAccount Account that is publishing the subgraph - * @param _subgraphNumber Subgraph number for the account - * @param _subgraphDeploymentID Subgraph deployment ID of the version, linked to the name - * @param _versionMetadata IPFS hash for the subgraph version metadata - */ - function _publishVersion( - address _graphAccount, - uint256 _subgraphNumber, - bytes32 _subgraphDeploymentID, - bytes32 _versionMetadata - ) private { - require(_subgraphDeploymentID != 0, "GNS: Cannot set deploymentID to 0 in publish"); - - // Stores a subgraph deployment ID, which indicates a version has been created - subgraphs[_graphAccount][_subgraphNumber] = _subgraphDeploymentID; - - // Emit version and name data - emit SubgraphPublished( - _graphAccount, - _subgraphNumber, - _subgraphDeploymentID, - _versionMetadata - ); - } - - /** - * @dev Deprecate a subgraph. Can only be done by the graph account owner. - * @param _graphAccount Account that is deprecating the subgraph - * @param _subgraphNumber Subgraph number for the account - */ - function deprecateSubgraph(address _graphAccount, uint256 _subgraphNumber) - external - override - notPaused - onlyGraphAccountOwner(_graphAccount) - { - require( - isPublished(_graphAccount, _subgraphNumber), - "GNS: Cannot deprecate a subgraph which does not exist" - ); - - delete subgraphs[_graphAccount][_subgraphNumber]; - emit SubgraphDeprecated(_graphAccount, _subgraphNumber); - - _disableNameSignal(_graphAccount, _subgraphNumber); - } - - /** - * @dev Enable name signal on a graph accounts numbered subgraph, which points to a subgraph - * deployment - * @param _graphAccount Graph account enabling name signal - * @param _subgraphNumber Subgraph number being used - */ - function _enableNameSignal(address _graphAccount, uint256 _subgraphNumber) private { - NameCurationPool storage namePool = nameSignals[_graphAccount][_subgraphNumber]; - namePool.subgraphDeploymentID = subgraphs[_graphAccount][_subgraphNumber]; - namePool.reserveRatio = defaultReserveRatio; - - emit NameSignalEnabled( - _graphAccount, - _subgraphNumber, - namePool.subgraphDeploymentID, - namePool.reserveRatio - ); - } - - /** - * @dev Update a name signal on a graph accounts numbered subgraph - * @param _graphAccount Graph account updating name signal - * @param _subgraphNumber Subgraph number being used - * @param _newSubgraphDeploymentID Deployment ID being upgraded to - */ - function _upgradeNameSignal( - address _graphAccount, - uint256 _subgraphNumber, - bytes32 _newSubgraphDeploymentID - ) private { - // This is to prevent the owner from front running its name curators signal by posting - // its own signal ahead, bringing the name curators in, and dumping on them - ICuration curation = curation(); - require( - !curation.isCurated(_newSubgraphDeploymentID), - "GNS: Owner cannot point to a subgraphID that has been pre-curated" - ); - - NameCurationPool storage namePool = nameSignals[_graphAccount][_subgraphNumber]; - require( - namePool.nSignal > 0, - "GNS: There must be nSignal on this subgraph for curve math to work" - ); - require(namePool.disabled == false, "GNS: Cannot be disabled"); - - // Burn all version signal in the name pool for tokens - uint256 tokens = curation.burn(namePool.subgraphDeploymentID, namePool.vSignal, 0); - - // Take the owner cut of the curation tax, add it to the total - uint32 curationTaxPercentage = curation.curationTaxPercentage(); - uint256 tokensWithTax = _chargeOwnerTax(tokens, _graphAccount, curationTaxPercentage); - - // Update pool: constant nSignal, vSignal can change - namePool.subgraphDeploymentID = _newSubgraphDeploymentID; - (namePool.vSignal, ) = curation.mint(namePool.subgraphDeploymentID, tokensWithTax, 0); - - emit NameSignalUpgrade( - _graphAccount, - _subgraphNumber, - namePool.vSignal, - tokensWithTax, - _newSubgraphDeploymentID - ); - } - - /** - * @dev Allow a name curator to mint some nSignal by depositing GRT - * @param _graphAccount Subgraph owner - * @param _subgraphNumber Subgraph owners subgraph number - * @param _tokensIn The amount of tokens the nameCurator wants to deposit - * @param _nSignalOutMin Expected minimum amount of name signal to receive - */ - function mintNSignal( - address _graphAccount, - uint256 _subgraphNumber, - uint256 _tokensIn, - uint256 _nSignalOutMin - ) external override notPartialPaused { - // Pool checks - NameCurationPool storage namePool = nameSignals[_graphAccount][_subgraphNumber]; - require(namePool.disabled == false, "GNS: Cannot be disabled"); - require( - namePool.subgraphDeploymentID != 0, - "GNS: Must deposit on a name signal that exists" - ); - - // Pull tokens from sender - require( - graphToken().transferFrom(msg.sender, address(this), _tokensIn), - "GNS: Cannot transfer tokens to mint n signal" - ); - - // Get name signal to mint for tokens deposited - (uint256 vSignal, ) = curation().mint(namePool.subgraphDeploymentID, _tokensIn, 0); - uint256 nSignal = vSignalToNSignal(_graphAccount, _subgraphNumber, vSignal); - - // Slippage protection - require(nSignal >= _nSignalOutMin, "GNS: Slippage protection"); - - // Update pools - namePool.vSignal = namePool.vSignal.add(vSignal); - namePool.nSignal = namePool.nSignal.add(nSignal); - namePool.curatorNSignal[msg.sender] = namePool.curatorNSignal[msg.sender].add(nSignal); - - emit NSignalMinted(_graphAccount, _subgraphNumber, msg.sender, nSignal, vSignal, _tokensIn); - } - - /** - * @dev Allow a nameCurator to burn some of its nSignal and get GRT in return - * @param _graphAccount Subgraph owner - * @param _subgraphNumber Subgraph owners subgraph number which was curated on by nameCurators - * @param _nSignal The amount of nSignal the nameCurator wants to burn - * @param _tokensOutMin Expected minimum amount of tokens to receive - */ - function burnNSignal( - address _graphAccount, - uint256 _subgraphNumber, - uint256 _nSignal, - uint256 _tokensOutMin - ) external override notPartialPaused { - // Pool checks - NameCurationPool storage namePool = nameSignals[_graphAccount][_subgraphNumber]; - require(namePool.disabled == false, "GNS: Cannot be disabled"); - - // Curator balance checks - uint256 curatorNSignal = namePool.curatorNSignal[msg.sender]; - require( - _nSignal <= curatorNSignal, - "GNS: Curator cannot withdraw more nSignal than they have" - ); - - // Get tokens for name signal amount to burn - uint256 vSignal = nSignalToVSignal(_graphAccount, _subgraphNumber, _nSignal); - uint256 tokens = curation().burn(namePool.subgraphDeploymentID, vSignal, _tokensOutMin); - - // Update pools - namePool.vSignal = namePool.vSignal.sub(vSignal); - namePool.nSignal = namePool.nSignal.sub(_nSignal); - namePool.curatorNSignal[msg.sender] = namePool.curatorNSignal[msg.sender].sub(_nSignal); - - // Return the tokens to the nameCurator - require( - graphToken().transfer(msg.sender, tokens), - "GNS: Error sending nameCurators tokens" - ); - - emit NSignalBurned(_graphAccount, _subgraphNumber, msg.sender, _nSignal, vSignal, tokens); - } - - /** - * @dev Owner disables the subgraph. This means the subgraph-number combination can no longer - * be used for name signal. The nSignal curve is destroyed, the vSignal is burned, and the GNS - * contract holds the GRT from burning the vSignal, which all curators can withdraw manually. - * @param _graphAccount Account that is deprecating its name curation - * @param _subgraphNumber Subgraph number - */ - function _disableNameSignal(address _graphAccount, uint256 _subgraphNumber) private { - NameCurationPool storage namePool = nameSignals[_graphAccount][_subgraphNumber]; - - // If no nSignal, then no need to burn vSignal - if (namePool.nSignal != 0) { - namePool.withdrawableGRT = curation().burn( - namePool.subgraphDeploymentID, - namePool.vSignal, - 0 - ); - namePool.vSignal = 0; - } - - // Set the NameCurationPool fields to make it disabled - namePool.disabled = true; - - emit NameSignalDisabled(_graphAccount, _subgraphNumber, namePool.withdrawableGRT); - } - - /** - * @dev When the subgraph curve is disabled, all nameCurators can call this function and - * withdraw the GRT they are entitled for its original deposit of vSignal - * @param _graphAccount Subgraph owner - * @param _subgraphNumber Subgraph owners subgraph number which was curated on by nameCurators - */ - function withdraw(address _graphAccount, uint256 _subgraphNumber) - external - override - notPartialPaused - { - // Pool checks - NameCurationPool storage namePool = nameSignals[_graphAccount][_subgraphNumber]; - require(namePool.disabled == true, "GNS: Name bonding curve must be disabled first"); - require(namePool.withdrawableGRT > 0, "GNS: No more GRT to withdraw"); - - // Curator balance checks - uint256 curatorNSignal = namePool.curatorNSignal[msg.sender]; - require(curatorNSignal > 0, "GNS: Curator must have some nSignal to withdraw GRT"); - - // Get curator share of tokens to be withdrawn - uint256 tokensOut = curatorNSignal.mul(namePool.withdrawableGRT).div(namePool.nSignal); - namePool.curatorNSignal[msg.sender] = 0; - namePool.nSignal = namePool.nSignal.sub(curatorNSignal); - namePool.withdrawableGRT = namePool.withdrawableGRT.sub(tokensOut); - - require( - graphToken().transfer(msg.sender, tokensOut), - "GNS: Error withdrawing tokens for nameCurator" - ); - - emit GRTWithdrawn(_graphAccount, _subgraphNumber, msg.sender, curatorNSignal, tokensOut); - } - - /** - * @dev Calculate tax that owner will have to cover for upgrading or deprecating. - * @param _tokens Tokens that were received from deprecating the old subgraph - * @param _owner Subgraph owner - * @param _curationTaxPercentage Tax percentage on curation deposits from Curation contract - * @return Total tokens that will be sent to curation, _tokens + ownerTax - */ - function _chargeOwnerTax( - uint256 _tokens, - address _owner, - uint32 _curationTaxPercentage - ) private returns (uint256) { - if (_curationTaxPercentage == 0 || ownerTaxPercentage == 0) { - return 0; - } - - // Tax on the total bonding curve funds - uint256 taxOnOriginal = _tokens.mul(_curationTaxPercentage).div(MAX_PPM); - // Total after the tax - uint256 totalWithoutOwnerTax = _tokens.sub(taxOnOriginal); - // The portion of tax that the owner will pay - uint256 ownerTax = taxOnOriginal.mul(ownerTaxPercentage).div(MAX_PPM); - - uint256 totalWithOwnerTax = totalWithoutOwnerTax.add(ownerTax); - - // The total after tax, plus owner partial repay, divided by - // the tax, to adjust it slightly upwards. ex: - // 100 GRT, 5 GRT Tax, owner pays 100% --> 5 GRT - // To get 100 in the protocol after tax, Owner deposits - // ~5.26, as ~105.26 * .95 = 100 - uint256 totalAdjustedUp = totalWithOwnerTax.mul(MAX_PPM).div( - uint256(MAX_PPM).sub(uint256(_curationTaxPercentage)) - ); - - uint256 ownerTaxAdjustedUp = totalAdjustedUp.sub(_tokens); - - // Get the owner of the subgraph to reimburse the curation tax - require( - graphToken().transferFrom(_owner, address(this), ownerTaxAdjustedUp), - "GNS: Error reimbursing curation tax" - ); - return totalAdjustedUp; - } - - /** - * @dev Calculate name signal to be returned for an amount of tokens. - * @param _graphAccount Subgraph owner - * @param _subgraphNumber Subgraph owners subgraph number which was curated on by nameCurators - * @param _tokensIn Tokens being exchanged for name signal - * @return Amount of name signal and curation tax - */ - function tokensToNSignal( - address _graphAccount, - uint256 _subgraphNumber, - uint256 _tokensIn - ) - public - override - view - returns ( - uint256, - uint256, - uint256 - ) - { - NameCurationPool storage namePool = nameSignals[_graphAccount][_subgraphNumber]; - (uint256 vSignal, uint256 curationTax) = curation().tokensToSignal( - namePool.subgraphDeploymentID, - _tokensIn - ); - uint256 nSignal = vSignalToNSignal(_graphAccount, _subgraphNumber, vSignal); - return (vSignal, nSignal, curationTax); - } - - /** - * @dev Calculate tokens returned for an amount of name signal. - * @param _graphAccount Subgraph owner - * @param _subgraphNumber Subgraph owners subgraph number which was curated on by nameCurators - * @param _nSignalIn Name signal being exchanged for tokens - * @return Amount of tokens returned for an amount of nSignal - */ - function nSignalToTokens( - address _graphAccount, - uint256 _subgraphNumber, - uint256 _nSignalIn - ) public override view returns (uint256, uint256) { - NameCurationPool storage namePool = nameSignals[_graphAccount][_subgraphNumber]; - uint256 vSignal = nSignalToVSignal(_graphAccount, _subgraphNumber, _nSignalIn); - uint256 tokensOut = curation().signalToTokens(namePool.subgraphDeploymentID, vSignal); - return (vSignal, tokensOut); - } - - /** - * @dev Calculate nSignal to be returned for an amount of vSignal. - * @param _graphAccount Subgraph owner - * @param _subgraphNumber Subgraph owners subgraph number which was curated on by nameCurators - * @param _vSignalIn Amount of vSignal to exchange for name signal - * @return Amount of nSignal that can be bought - */ - function vSignalToNSignal( - address _graphAccount, - uint256 _subgraphNumber, - uint256 _vSignalIn - ) public override view returns (uint256) { - NameCurationPool storage namePool = nameSignals[_graphAccount][_subgraphNumber]; - - // Handle initialization by using 1:1 version to name signal - if (namePool.vSignal == 0) { - return _vSignalIn; - } - - return - BancorFormula(bondingCurve).calculatePurchaseReturn( - namePool.nSignal, - namePool.vSignal, - namePool.reserveRatio, - _vSignalIn - ); - } - - /** - * @dev Calculate vSignal to be returned for an amount of name signal. - * @param _graphAccount Subgraph owner - * @param _subgraphNumber Subgraph owners subgraph number which was curated on by nameCurators - * @param _nSignalIn Name signal being exchanged for vSignal - * @return Amount of vSignal that can be returned - */ - function nSignalToVSignal( - address _graphAccount, - uint256 _subgraphNumber, - uint256 _nSignalIn - ) public override view returns (uint256) { - NameCurationPool storage namePool = nameSignals[_graphAccount][_subgraphNumber]; - return - BancorFormula(bondingCurve).calculateSaleReturn( - namePool.nSignal, - namePool.vSignal, - namePool.reserveRatio, - _nSignalIn - ); - } - - /** - * @dev Get the amount of name signal a curator has on a name pool. - * @param _graphAccount Subgraph owner - * @param _subgraphNumber Subgraph owners subgraph number which was curated on by nameCurators - * @param _curator Curator to look up to see n signal balance - * @return Amount of name signal owned by a curator for the name pool - */ - function getCuratorNSignal( - address _graphAccount, - uint256 _subgraphNumber, - address _curator - ) public override view returns (uint256) { - return nameSignals[_graphAccount][_subgraphNumber].curatorNSignal[_curator]; - } - - /** - * @dev Return whether a subgraph name is published. - * @param _graphAccount Account being checked - * @param _subgraphNumber Subgraph number being checked for publishing - * @return Return true if subgraph is currently published - */ - function isPublished(address _graphAccount, uint256 _subgraphNumber) - public - override - view - returns (bool) - { - return subgraphs[_graphAccount][_subgraphNumber] != 0; - } -} diff --git a/contracts/discovery/GNSStorage.sol b/contracts/discovery/GNSStorage.sol deleted file mode 100644 index 0ad8514b2..000000000 --- a/contracts/discovery/GNSStorage.sol +++ /dev/null @@ -1,34 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.7.3; -pragma experimental ABIEncoderV2; - -import "../governance/Managed.sol"; - -import "./erc1056/IEthereumDIDRegistry.sol"; - -import "./IGNS.sol"; - -contract GNSV1Storage is Managed { - // -- State -- - - // In parts per hundred - uint32 public ownerTaxPercentage; - - // Bonding curve formula - address public bondingCurve; - - // graphAccountID => subgraphNumber => subgraphDeploymentID - // subgraphNumber = A number associated to a graph accounts deployed subgraph. This - // is used to point to a subgraphID (graphAccountID + subgraphNumber) - mapping(address => mapping(uint256 => bytes32)) public subgraphs; - - // graphAccountID => subgraph deployment counter - mapping(address => uint256) public graphAccountSubgraphNumbers; - - // graphAccountID => subgraphNumber => NameCurationPool - mapping(address => mapping(uint256 => IGNS.NameCurationPool)) public nameSignals; - - // ERC-1056 contract reference - IEthereumDIDRegistry public erc1056Registry; -} diff --git a/contracts/discovery/IGNS.sol b/contracts/discovery/IGNS.sol deleted file mode 100644 index 3eb764993..000000000 --- a/contracts/discovery/IGNS.sol +++ /dev/null @@ -1,116 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.7.3; - -interface IGNS { - // -- Pool -- - - struct NameCurationPool { - uint256 vSignal; // The token of the subgraph deployment bonding curve - uint256 nSignal; // The token of the name curation bonding curve - mapping(address => uint256) curatorNSignal; - bytes32 subgraphDeploymentID; - uint32 reserveRatio; - bool disabled; - uint256 withdrawableGRT; - } - - // -- Configuration -- - - function approveAll() external; - - function setOwnerTaxPercentage(uint32 _ownerTaxPercentage) external; - - // -- Publishing -- - - function setDefaultName( - address _graphAccount, - uint8 _nameSystem, - bytes32 _nameIdentifier, - string calldata _name - ) external; - - function updateSubgraphMetadata( - address _graphAccount, - uint256 _subgraphNumber, - bytes32 _subgraphMetadata - ) external; - - function publishNewSubgraph( - address _graphAccount, - bytes32 _subgraphDeploymentID, - bytes32 _versionMetadata, - bytes32 _subgraphMetadata - ) external; - - function publishNewVersion( - address _graphAccount, - uint256 _subgraphNumber, - bytes32 _subgraphDeploymentID, - bytes32 _versionMetadata - ) external; - - function deprecateSubgraph(address _graphAccount, uint256 _subgraphNumber) external; - - // -- Curation -- - - function mintNSignal( - address _graphAccount, - uint256 _subgraphNumber, - uint256 _tokensIn, - uint256 _nSignalOutMin - ) external; - - function burnNSignal( - address _graphAccount, - uint256 _subgraphNumber, - uint256 _nSignal, - uint256 _tokensOutMin - ) external; - - function withdraw(address _graphAccount, uint256 _subgraphNumber) external; - - // -- Getters -- - - function tokensToNSignal( - address _graphAccount, - uint256 _subgraphNumber, - uint256 _tokensIn - ) - external - view - returns ( - uint256, - uint256, - uint256 - ); - - function nSignalToTokens( - address _graphAccount, - uint256 _subgraphNumber, - uint256 _nSignalIn - ) external view returns (uint256, uint256); - - function vSignalToNSignal( - address _graphAccount, - uint256 _subgraphNumber, - uint256 _vSignalIn - ) external view returns (uint256); - - function nSignalToVSignal( - address _graphAccount, - uint256 _subgraphNumber, - uint256 _nSignalIn - ) external view returns (uint256); - - function getCuratorNSignal( - address _graphAccount, - uint256 _subgraphNumber, - address _curator - ) external view returns (uint256); - - function isPublished(address _graphAccount, uint256 _subgraphNumber) - external - view - returns (bool); -} diff --git a/contracts/discovery/IServiceRegistry.sol b/contracts/discovery/IServiceRegistry.sol deleted file mode 100644 index e1a9868c9..000000000 --- a/contracts/discovery/IServiceRegistry.sol +++ /dev/null @@ -1,24 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.7.3; - -interface IServiceRegistry { - struct IndexerService { - string url; - string geohash; - } - - function register(string calldata _url, string calldata _geohash) external; - - function registerFor( - address _indexer, - string calldata _url, - string calldata _geohash - ) external; - - function unregister() external; - - function unregisterFor(address _indexer) external; - - function isRegistered(address _indexer) external view returns (bool); -} diff --git a/contracts/discovery/erc1056/IEthereumDIDRegistry.sol b/contracts/discovery/erc1056/IEthereumDIDRegistry.sol deleted file mode 100644 index 24ac21c51..000000000 --- a/contracts/discovery/erc1056/IEthereumDIDRegistry.sol +++ /dev/null @@ -1,14 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 - -pragma solidity ^0.7.3; - -interface IEthereumDIDRegistry { - function identityOwner(address identity) external view returns (address); - - function setAttribute( - address identity, - bytes32 name, - bytes calldata value, - uint256 validity - ) external; -} diff --git a/contracts/disputes/DisputeManager.sol b/contracts/disputes/DisputeManager.sol deleted file mode 100644 index 16c7bce4b..000000000 --- a/contracts/disputes/DisputeManager.sol +++ /dev/null @@ -1,805 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.7.3; -pragma experimental ABIEncoderV2; - -import "@openzeppelin/contracts/math/SafeMath.sol"; -import "@openzeppelin/contracts/cryptography/ECDSA.sol"; - -import "../governance/Managed.sol"; -import "../upgrades/GraphUpgradeable.sol"; -import "../utils/TokenUtils.sol"; - -import "./DisputeManagerStorage.sol"; -import "./IDisputeManager.sol"; - -/* - * @title DisputeManager - * @notice Provides a way to align the incentives of participants by having slashing as deterrent - * for incorrect behaviour. - * - * There are two types of disputes that can be created: Query disputes and Indexing disputes. - * - * Query Disputes: - * Graph nodes receive queries and return responses with signed receipts called attestations. - * An attestation can be disputed if the consumer thinks the query response was invalid. - * Indexers use the derived private key for an allocation to sign attestations. - * - * Indexing Disputes: - * Indexers present a Proof of Indexing (POI) when they close allocations to prove - * they were indexing a subgraph. The Staking contract emits that proof with the format - * keccak256(indexer.address, POI). - * Any challenger can dispute the validity of a POI by submitting a dispute to this contract - * along with a deposit. - * - * Arbitration: - * Disputes can only be accepted, rejected or drawn by the arbitrator role that can be delegated - * to a EOA or DAO. - */ -contract DisputeManager is DisputeManagerV1Storage, GraphUpgradeable, IDisputeManager { - using SafeMath for uint256; - - // -- EIP-712 -- - - bytes32 private constant DOMAIN_TYPE_HASH = - keccak256( - "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract,bytes32 salt)" - ); - bytes32 private constant DOMAIN_NAME_HASH = keccak256("Graph Protocol"); - bytes32 private constant DOMAIN_VERSION_HASH = keccak256("0"); - bytes32 private constant DOMAIN_SALT = - 0xa070ffb1cd7409649bf77822cce74495468e06dbfaef09556838bf188679b9c2; - bytes32 private constant RECEIPT_TYPE_HASH = - keccak256("Receipt(bytes32 requestCID,bytes32 responseCID,bytes32 subgraphDeploymentID)"); - - // -- Constants -- - - // Attestation size is the sum of the receipt (96) + signature (65) - uint256 private constant ATTESTATION_SIZE_BYTES = RECEIPT_SIZE_BYTES + SIG_SIZE_BYTES; - uint256 private constant RECEIPT_SIZE_BYTES = 96; - - uint256 private constant SIG_R_LENGTH = 32; - uint256 private constant SIG_S_LENGTH = 32; - uint256 private constant SIG_V_LENGTH = 1; - uint256 private constant SIG_R_OFFSET = RECEIPT_SIZE_BYTES; - uint256 private constant SIG_S_OFFSET = RECEIPT_SIZE_BYTES + SIG_R_LENGTH; - uint256 private constant SIG_V_OFFSET = RECEIPT_SIZE_BYTES + SIG_R_LENGTH + SIG_S_LENGTH; - uint256 private constant SIG_SIZE_BYTES = SIG_R_LENGTH + SIG_S_LENGTH + SIG_V_LENGTH; - - uint256 private constant UINT8_BYTE_LENGTH = 1; - uint256 private constant BYTES32_BYTE_LENGTH = 32; - - uint256 private constant MAX_PPM = 1000000; // 100% in parts per million - - // -- Events -- - - /** - * @dev Emitted when a query dispute is created for `subgraphDeploymentID` and `indexer` - * by `fisherman`. - * The event emits the amount of `tokens` deposited by the fisherman and `attestation` submitted. - */ - event QueryDisputeCreated( - bytes32 indexed disputeID, - address indexed indexer, - address indexed fisherman, - uint256 tokens, - bytes32 subgraphDeploymentID, - bytes attestation - ); - - /** - * @dev Emitted when an indexing dispute is created for `allocationID` and `indexer` - * by `fisherman`. - * The event emits the amount of `tokens` deposited by the fisherman. - */ - event IndexingDisputeCreated( - bytes32 indexed disputeID, - address indexed indexer, - address indexed fisherman, - uint256 tokens, - address allocationID - ); - - /** - * @dev Emitted when arbitrator accepts a `disputeID` to `indexer` created by `fisherman`. - * The event emits the amount `tokens` transferred to the fisherman, the deposit plus reward. - */ - event DisputeAccepted( - bytes32 indexed disputeID, - address indexed indexer, - address indexed fisherman, - uint256 tokens - ); - - /** - * @dev Emitted when arbitrator rejects a `disputeID` for `indexer` created by `fisherman`. - * The event emits the amount `tokens` burned from the fisherman deposit. - */ - event DisputeRejected( - bytes32 indexed disputeID, - address indexed indexer, - address indexed fisherman, - uint256 tokens - ); - - /** - * @dev Emitted when arbitrator draw a `disputeID` for `indexer` created by `fisherman`. - * The event emits the amount `tokens` used as deposit and returned to the fisherman. - */ - event DisputeDrawn( - bytes32 indexed disputeID, - address indexed indexer, - address indexed fisherman, - uint256 tokens - ); - - /** - * @dev Emitted when two disputes are in conflict to link them. - * This event will be emitted after each DisputeCreated event is emitted - * for each of the individual disputes. - */ - event DisputeLinked(bytes32 indexed disputeID1, bytes32 indexed disputeID2); - - // -- Modifiers -- - - function _onlyArbitrator() internal view { - require(msg.sender == arbitrator, "Caller is not the Arbitrator"); - } - - /** - * @dev Check if the caller is the arbitrator. - */ - modifier onlyArbitrator { - _onlyArbitrator(); - _; - } - - // -- Functions -- - - /** - * @dev Initialize this contract. - * @param _arbitrator Arbitrator role - * @param _minimumDeposit Minimum deposit required to create a Dispute - * @param _fishermanRewardPercentage Percent of slashed funds for fisherman (ppm) - * @param _qrySlashingPercentage Percentage of indexer stake slashed for query disputes (ppm) - * @param _idxSlashingPercentage Percentage of indexer stake slashed for indexing disputes (ppm) - */ - function initialize( - address _controller, - address _arbitrator, - uint256 _minimumDeposit, - uint32 _fishermanRewardPercentage, - uint32 _qrySlashingPercentage, - uint32 _idxSlashingPercentage - ) external onlyImpl { - Managed._initialize(_controller); - - // Settings - _setArbitrator(_arbitrator); - _setMinimumDeposit(_minimumDeposit); - _setFishermanRewardPercentage(_fishermanRewardPercentage); - _setSlashingPercentage(_qrySlashingPercentage, _idxSlashingPercentage); - - // EIP-712 domain separator - DOMAIN_SEPARATOR = keccak256( - abi.encode( - DOMAIN_TYPE_HASH, - DOMAIN_NAME_HASH, - DOMAIN_VERSION_HASH, - _getChainID(), - address(this), - DOMAIN_SALT - ) - ); - } - - /** - * @dev Set the arbitrator address. - * @notice Update the arbitrator to `_arbitrator` - * @param _arbitrator The address of the arbitration contract or party - */ - function setArbitrator(address _arbitrator) external override onlyGovernor { - _setArbitrator(_arbitrator); - } - - /** - * @dev Internal: Set the arbitrator address. - * @notice Update the arbitrator to `_arbitrator` - * @param _arbitrator The address of the arbitration contract or party - */ - function _setArbitrator(address _arbitrator) private { - require(_arbitrator != address(0), "Arbitrator must be set"); - arbitrator = _arbitrator; - emit ParameterUpdated("arbitrator"); - } - - /** - * @dev Set the minimum deposit required to create a dispute. - * @notice Update the minimum deposit to `_minimumDeposit` Graph Tokens - * @param _minimumDeposit The minimum deposit in Graph Tokens - */ - function setMinimumDeposit(uint256 _minimumDeposit) external override onlyGovernor { - _setMinimumDeposit(_minimumDeposit); - } - - /** - * @dev Internal: Set the minimum deposit required to create a dispute. - * @notice Update the minimum deposit to `_minimumDeposit` Graph Tokens - * @param _minimumDeposit The minimum deposit in Graph Tokens - */ - function _setMinimumDeposit(uint256 _minimumDeposit) private { - require(_minimumDeposit > 0, "Minimum deposit must be set"); - minimumDeposit = _minimumDeposit; - emit ParameterUpdated("minimumDeposit"); - } - - /** - * @dev Set the percent reward that the fisherman gets when slashing occurs. - * @notice Update the reward percentage to `_percentage` - * @param _percentage Reward as a percentage of indexer stake - */ - function setFishermanRewardPercentage(uint32 _percentage) external override onlyGovernor { - _setFishermanRewardPercentage(_percentage); - } - - /** - * @dev Internal: Set the percent reward that the fisherman gets when slashing occurs. - * @notice Update the reward percentage to `_percentage` - * @param _percentage Reward as a percentage of indexer stake - */ - function _setFishermanRewardPercentage(uint32 _percentage) private { - // Must be within 0% to 100% (inclusive) - require(_percentage <= MAX_PPM, "Reward percentage must be below or equal to MAX_PPM"); - fishermanRewardPercentage = _percentage; - emit ParameterUpdated("fishermanRewardPercentage"); - } - - /** - * @dev Set the percentage used for slashing indexers. - * @param _qryPercentage Percentage slashing for query disputes - * @param _idxPercentage Percentage slashing for indexing disputes - */ - function setSlashingPercentage(uint32 _qryPercentage, uint32 _idxPercentage) - external - override - onlyGovernor - { - _setSlashingPercentage(_qryPercentage, _idxPercentage); - } - - /** - * @dev Internal: Set the percentage used for slashing indexers. - * @param _qryPercentage Percentage slashing for query disputes - * @param _idxPercentage Percentage slashing for indexing disputes - */ - function _setSlashingPercentage(uint32 _qryPercentage, uint32 _idxPercentage) private { - // Must be within 0% to 100% (inclusive) - require( - _qryPercentage <= MAX_PPM && _idxPercentage <= MAX_PPM, - "Slashing percentage must be below or equal to MAX_PPM" - ); - qrySlashingPercentage = _qryPercentage; - idxSlashingPercentage = _idxPercentage; - emit ParameterUpdated("qrySlashingPercentage"); - emit ParameterUpdated("idxSlashingPercentage"); - } - - /** - * @dev Return whether a dispute exists or not. - * @notice Return if dispute with ID `_disputeID` exists - * @param _disputeID True if dispute already exists - */ - function isDisputeCreated(bytes32 _disputeID) public view override returns (bool) { - return disputes[_disputeID].fisherman != address(0); - } - - /** - * @dev Get the message hash that an indexer used to sign the receipt. - * Encodes a receipt using a domain separator, as described on - * https://github.com/ethereum/EIPs/blob/master/EIPS/eip-712.md#specification. - * @notice Return the message hash used to sign the receipt - * @param _receipt Receipt returned by indexer and submitted by fisherman - * @return Message hash used to sign the receipt - */ - function encodeHashReceipt(Receipt memory _receipt) public view override returns (bytes32) { - return - keccak256( - abi.encodePacked( - "\x19\x01", // EIP-191 encoding pad, EIP-712 version 1 - DOMAIN_SEPARATOR, - keccak256( - abi.encode( - RECEIPT_TYPE_HASH, - _receipt.requestCID, - _receipt.responseCID, - _receipt.subgraphDeploymentID - ) // EIP 712-encoded message hash - ) - ) - ); - } - - /** - * @dev Returns if two attestations are conflicting. - * Everything must match except for the responseID. - * @param _attestation1 Attestation - * @param _attestation2 Attestation - * @return True if the two attestations are conflicting - */ - function areConflictingAttestations( - Attestation memory _attestation1, - Attestation memory _attestation2 - ) public pure override returns (bool) { - return (_attestation1.requestCID == _attestation2.requestCID && - _attestation1.subgraphDeploymentID == _attestation2.subgraphDeploymentID && - _attestation1.responseCID != _attestation2.responseCID); - } - - /** - * @dev Returns the indexer that signed an attestation. - * @param _attestation Attestation - * @return Indexer address - */ - function getAttestationIndexer(Attestation memory _attestation) - public - view - override - returns (address) - { - // Get attestation signer. Indexers signs with the allocationID - address allocationID = _recoverAttestationSigner(_attestation); - - IStaking.Allocation memory alloc = staking().getAllocation(allocationID); - require(alloc.indexer != address(0), "Indexer cannot be found for the attestation"); - require( - alloc.subgraphDeploymentID == _attestation.subgraphDeploymentID, - "Allocation and attestation subgraphDeploymentID must match" - ); - return alloc.indexer; - } - - /** - * @dev Create a query dispute for the arbitrator to resolve. - * This function is called by a fisherman that will need to `_deposit` at - * least `minimumDeposit` GRT tokens. - * @param _attestationData Attestation bytes submitted by the fisherman - * @param _deposit Amount of tokens staked as deposit - */ - function createQueryDispute(bytes calldata _attestationData, uint256 _deposit) - external - override - returns (bytes32) - { - // Get funds from submitter - _pullSubmitterDeposit(_deposit); - - // Create a dispute - return - _createQueryDisputeWithAttestation( - msg.sender, - _deposit, - _parseAttestation(_attestationData), - _attestationData - ); - } - - /** - * @dev Create query disputes for two conflicting attestations. - * A conflicting attestation is a proof presented by two different indexers - * where for the same request on a subgraph the response is different. - * For this type of dispute the submitter is not required to present a deposit - * as one of the attestation is considered to be right. - * Two linked disputes will be created and if the arbitrator resolve one, the other - * one will be automatically resolved. - * @param _attestationData1 First attestation data submitted - * @param _attestationData2 Second attestation data submitted - * @return DisputeID1, DisputeID2 - */ - function createQueryDisputeConflict( - bytes calldata _attestationData1, - bytes calldata _attestationData2 - ) external override returns (bytes32, bytes32) { - address fisherman = msg.sender; - - // Parse each attestation - Attestation memory attestation1 = _parseAttestation(_attestationData1); - Attestation memory attestation2 = _parseAttestation(_attestationData2); - - // Test that attestations are conflicting - require( - areConflictingAttestations(attestation1, attestation2), - "Attestations must be in conflict" - ); - - // Create the disputes - // The deposit is zero for conflicting attestations - bytes32 dID1 = - _createQueryDisputeWithAttestation(fisherman, 0, attestation1, _attestationData1); - bytes32 dID2 = - _createQueryDisputeWithAttestation(fisherman, 0, attestation2, _attestationData2); - - // Store the linked disputes to be resolved - disputes[dID1].relatedDisputeID = dID2; - disputes[dID2].relatedDisputeID = dID1; - - // Emit event that links the two created disputes - emit DisputeLinked(dID1, dID2); - - return (dID1, dID2); - } - - /** - * @dev Create a query dispute passing the parsed attestation. - * To be used in createQueryDispute() and createQueryDisputeConflict() - * to avoid calling parseAttestation() multiple times - * `_attestationData` is only passed to be emitted - * @param _fisherman Creator of dispute - * @param _deposit Amount of tokens staked as deposit - * @param _attestation Attestation struct parsed from bytes - * @param _attestationData Attestation bytes submitted by the fisherman - * @return DisputeID - */ - function _createQueryDisputeWithAttestation( - address _fisherman, - uint256 _deposit, - Attestation memory _attestation, - bytes memory _attestationData - ) private returns (bytes32) { - // Get the indexer that signed the attestation - address indexer = getAttestationIndexer(_attestation); - - // The indexer is disputable - require(staking().getIndexerStakedTokens(indexer) > 0, "Dispute indexer has no stake"); - - // Create a disputeID - bytes32 disputeID = - keccak256( - abi.encodePacked( - _attestation.requestCID, - _attestation.responseCID, - _attestation.subgraphDeploymentID, - indexer, - _fisherman - ) - ); - - // Only one dispute for a (indexer, subgraphDeploymentID) at a time - require(!isDisputeCreated(disputeID), "Dispute already created"); - - // Store dispute - disputes[disputeID] = Dispute( - indexer, - _fisherman, - _deposit, - 0, // no related dispute, - DisputeType.QueryDispute - ); - - emit QueryDisputeCreated( - disputeID, - indexer, - _fisherman, - _deposit, - _attestation.subgraphDeploymentID, - _attestationData - ); - - return disputeID; - } - - /** - * @dev Create an indexing dispute for the arbitrator to resolve. - * The disputes are created in reference to an allocationID - * This function is called by a challenger that will need to `_deposit` at - * least `minimumDeposit` GRT tokens. - * @param _allocationID The allocation to dispute - * @param _deposit Amount of tokens staked as deposit - */ - function createIndexingDispute(address _allocationID, uint256 _deposit) - external - override - returns (bytes32) - { - // Get funds from submitter - _pullSubmitterDeposit(_deposit); - - // Create a dispute - return _createIndexingDisputeWithAllocation(msg.sender, _deposit, _allocationID); - } - - /** - * @dev Create indexing dispute internal function. - * @param _fisherman The challenger creating the dispute - * @param _deposit Amount of tokens staked as deposit - * @param _allocationID Allocation disputed - */ - - function _createIndexingDisputeWithAllocation( - address _fisherman, - uint256 _deposit, - address _allocationID - ) private returns (bytes32) { - // Create a disputeID - bytes32 disputeID = keccak256(abi.encodePacked(_allocationID)); - - // Only one dispute for an allocationID at a time - require(!isDisputeCreated(disputeID), "Dispute already created"); - - // Allocation must exist - IStaking staking = staking(); - IStaking.Allocation memory alloc = staking.getAllocation(_allocationID); - require(alloc.indexer != address(0), "Dispute allocation must exist"); - - // The indexer must be disputable - require(staking.getIndexerStakedTokens(alloc.indexer) > 0, "Dispute indexer has no stake"); - - // Store dispute - disputes[disputeID] = Dispute( - alloc.indexer, - _fisherman, - _deposit, - 0, - DisputeType.IndexingDispute - ); - - emit IndexingDisputeCreated(disputeID, alloc.indexer, _fisherman, _deposit, _allocationID); - - return disputeID; - } - - /** - * @dev The arbitrator accepts a dispute as being valid. - * This function will revert if the indexer is not slashable, whether because it does not have - * any stake available or the slashing percentage is configured to be zero. In those cases - * a dispute must be resolved using drawDispute or rejectDispute. - * @notice Accept a dispute with ID `_disputeID` - * @param _disputeID ID of the dispute to be accepted - */ - function acceptDispute(bytes32 _disputeID) external override onlyArbitrator { - Dispute memory dispute = _resolveDispute(_disputeID); - - // Slash - (, uint256 tokensToReward) = - _slashIndexer(dispute.indexer, dispute.fisherman, dispute.disputeType); - - // Give the fisherman their deposit back - TokenUtils.pushTokens(graphToken(), dispute.fisherman, dispute.deposit); - - // Resolve the conflicting dispute if any - _resolveDisputeInConflict(dispute); - - emit DisputeAccepted( - _disputeID, - dispute.indexer, - dispute.fisherman, - dispute.deposit.add(tokensToReward) - ); - } - - /** - * @dev The arbitrator rejects a dispute as being invalid. - * @notice Reject a dispute with ID `_disputeID` - * @param _disputeID ID of the dispute to be rejected - */ - function rejectDispute(bytes32 _disputeID) external override onlyArbitrator { - Dispute memory dispute = _resolveDispute(_disputeID); - - // Handle conflicting dispute if any - require( - !_isDisputeInConflict(dispute), - "Dispute for conflicting attestation, must accept the related ID to reject" - ); - - // Burn the fisherman's deposit - TokenUtils.burnTokens(graphToken(), dispute.deposit); - - emit DisputeRejected(_disputeID, dispute.indexer, dispute.fisherman, dispute.deposit); - } - - /** - * @dev The arbitrator draws dispute. - * @notice Ignore a dispute with ID `_disputeID` - * @param _disputeID ID of the dispute to be disregarded - */ - function drawDispute(bytes32 _disputeID) external override onlyArbitrator { - Dispute memory dispute = _resolveDispute(_disputeID); - - // Return deposit to the fisherman - TokenUtils.pushTokens(graphToken(), dispute.fisherman, dispute.deposit); - - // Resolve the conflicting dispute if any - _resolveDisputeInConflict(dispute); - - emit DisputeDrawn(_disputeID, dispute.indexer, dispute.fisherman, dispute.deposit); - } - - /** - * @dev Resolve a dispute by removing it from storage and returning a memory copy. - * @param _disputeID ID of the dispute to resolve - * @return Dispute - */ - function _resolveDispute(bytes32 _disputeID) private returns (Dispute memory) { - require(isDisputeCreated(_disputeID), "Dispute does not exist"); - - Dispute memory dispute = disputes[_disputeID]; - - // Resolve dispute - delete disputes[_disputeID]; // Re-entrancy - - return dispute; - } - - /** - * @dev Returns whether the dispute is for a conflicting attestation or not. - * @param _dispute Dispute - * @return True conflicting attestation dispute - */ - function _isDisputeInConflict(Dispute memory _dispute) private pure returns (bool) { - return _dispute.relatedDisputeID != 0; - } - - /** - * @dev Resolve the conflicting dispute if there is any for the one passed to this function. - * @param _dispute Dispute - * @return True if resolved - */ - function _resolveDisputeInConflict(Dispute memory _dispute) private returns (bool) { - if (_isDisputeInConflict(_dispute)) { - bytes32 relatedDisputeID = _dispute.relatedDisputeID; - delete disputes[relatedDisputeID]; - return true; - } - return false; - } - - /** - * @dev Pull deposit from submitter account. - * @param _deposit Amount of tokens to deposit - */ - function _pullSubmitterDeposit(uint256 _deposit) private { - // Ensure that fisherman has staked at least the minimum amount - require(_deposit >= minimumDeposit, "Dispute deposit is under minimum required"); - - // Transfer tokens to deposit from fisherman to this contract - TokenUtils.pullTokens(graphToken(), msg.sender, _deposit); - } - - /** - * @dev Make the staking contract slash the indexer and reward the challenger. - * Give the challenger a reward equal to the fishermanRewardPercentage of slashed amount - * @param _indexer Address of the indexer - * @param _challenger Address of the challenger - * @param _disputeType Type of dispute - * @return slashAmount Dispute slash amount - * @return rewardsAmount Dispute rewards amount - */ - function _slashIndexer( - address _indexer, - address _challenger, - DisputeType _disputeType - ) private returns (uint256 slashAmount, uint256 rewardsAmount) { - IStaking staking = staking(); - - // Get slashable amount for indexer - uint256 slashableAmount = staking.getIndexerStakedTokens(_indexer); // slashable tokens - - // Get slash amount - slashAmount = _getSlashingPercentageForDisputeType(_disputeType).mul(slashableAmount).div( - MAX_PPM - ); - require(slashAmount > 0, "Dispute has zero tokens to slash"); - - // Get rewards amount - rewardsAmount = uint256(fishermanRewardPercentage).mul(slashAmount).div(MAX_PPM); - - // Have staking contract slash the indexer and reward the fisherman - // Give the fisherman a reward equal to the fishermanRewardPercentage of slashed amount - staking.slash(_indexer, slashAmount, rewardsAmount, _challenger); - } - - /** - * @dev Recover the signer address of the `_attestation`. - * @param _disputeType Dispute type - * @return Slashing percentage to use for the dispute type - */ - function _getSlashingPercentageForDisputeType(DisputeType _disputeType) - private - view - returns (uint256) - { - if (_disputeType == DisputeType.QueryDispute) return uint256(qrySlashingPercentage); - if (_disputeType == DisputeType.IndexingDispute) return uint256(idxSlashingPercentage); - return 0; - } - - /** - * @dev Recover the signer address of the `_attestation`. - * @param _attestation The attestation struct - * @return Signer address - */ - function _recoverAttestationSigner(Attestation memory _attestation) - private - view - returns (address) - { - // Obtain the hash of the fully-encoded message, per EIP-712 encoding - Receipt memory receipt = - Receipt( - _attestation.requestCID, - _attestation.responseCID, - _attestation.subgraphDeploymentID - ); - bytes32 messageHash = encodeHashReceipt(receipt); - - // Obtain the signer of the fully-encoded EIP-712 message hash - // NOTE: The signer of the attestation is the indexer that served the request - return - ECDSA.recover( - messageHash, - abi.encodePacked(_attestation.r, _attestation.s, _attestation.v) - ); - } - - /** - * @dev Get the running network chain ID - * @return The chain ID - */ - function _getChainID() private pure returns (uint256) { - uint256 id; - assembly { - id := chainid() - } - return id; - } - - /** - * @dev Parse the bytes attestation into a struct from `_data`. - * @return Attestation struct - */ - function _parseAttestation(bytes memory _data) private pure returns (Attestation memory) { - // Check attestation data length - require(_data.length == ATTESTATION_SIZE_BYTES, "Attestation must be 161 bytes long"); - - // Decode receipt - (bytes32 requestCID, bytes32 responseCID, bytes32 subgraphDeploymentID) = - abi.decode(_data, (bytes32, bytes32, bytes32)); - - // Decode signature - // Signature is expected to be in the order defined in the Attestation struct - bytes32 r = _toBytes32(_data, SIG_R_OFFSET); - bytes32 s = _toBytes32(_data, SIG_S_OFFSET); - uint8 v = _toUint8(_data, SIG_V_OFFSET); - - return Attestation(requestCID, responseCID, subgraphDeploymentID, r, s, v); - } - - /** - * @dev Parse a uint8 from `_bytes` starting at offset `_start`. - * @return uint8 value - */ - function _toUint8(bytes memory _bytes, uint256 _start) private pure returns (uint8) { - require(_bytes.length >= (_start + UINT8_BYTE_LENGTH), "Bytes: out of bounds"); - uint8 tempUint; - - assembly { - tempUint := mload(add(add(_bytes, 0x1), _start)) - } - - return tempUint; - } - - /** - * @dev Parse a bytes32 from `_bytes` starting at offset `_start`. - * @return bytes32 value - */ - function _toBytes32(bytes memory _bytes, uint256 _start) private pure returns (bytes32) { - require(_bytes.length >= (_start + BYTES32_BYTE_LENGTH), "Bytes: out of bounds"); - bytes32 tempBytes32; - - assembly { - tempBytes32 := mload(add(add(_bytes, 0x20), _start)) - } - - return tempBytes32; - } -} diff --git a/contracts/disputes/DisputeManagerStorage.sol b/contracts/disputes/DisputeManagerStorage.sol deleted file mode 100644 index f9f328c19..000000000 --- a/contracts/disputes/DisputeManagerStorage.sol +++ /dev/null @@ -1,34 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.7.3; - -import "../governance/Managed.sol"; - -import "./IDisputeManager.sol"; - -contract DisputeManagerV1Storage is Managed { - // -- State -- - - bytes32 internal DOMAIN_SEPARATOR; - - // The arbitrator is solely in control of arbitrating disputes - address public arbitrator; - - // Minimum deposit required to create a Dispute - uint256 public minimumDeposit; - - // -- Slot 0xf - // Percentage of indexer slashed funds to assign as a reward to fisherman in successful dispute - // Parts per million. (Allows for 4 decimal points, 999,999 = 99.9999%) - uint32 public fishermanRewardPercentage; - - // Percentage of indexer stake to slash on disputes - // Parts per million. (Allows for 4 decimal points, 999,999 = 99.9999%) - uint32 public qrySlashingPercentage; - uint32 public idxSlashingPercentage; - - // -- Slot 0x10 - // Disputes created : disputeID => Dispute - // disputeID - check creation functions to see how disputeID is built - mapping(bytes32 => IDisputeManager.Dispute) public disputes; -} diff --git a/contracts/disputes/IDisputeManager.sol b/contracts/disputes/IDisputeManager.sol deleted file mode 100644 index 99a8b8d0d..000000000 --- a/contracts/disputes/IDisputeManager.sol +++ /dev/null @@ -1,82 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.7.3; -pragma experimental ABIEncoderV2; - -interface IDisputeManager { - // -- Dispute -- - - enum DisputeType { Null, IndexingDispute, QueryDispute } - - // Disputes contain info necessary for the Arbitrator to verify and resolve - struct Dispute { - address indexer; - address fisherman; - uint256 deposit; - bytes32 relatedDisputeID; - DisputeType disputeType; - } - - // -- Attestation -- - - // Receipt content sent from indexer in response to request - struct Receipt { - bytes32 requestCID; - bytes32 responseCID; - bytes32 subgraphDeploymentID; - } - - // Attestation sent from indexer in response to a request - struct Attestation { - bytes32 requestCID; - bytes32 responseCID; - bytes32 subgraphDeploymentID; - bytes32 r; - bytes32 s; - uint8 v; - } - - // -- Configuration -- - - function setArbitrator(address _arbitrator) external; - - function setMinimumDeposit(uint256 _minimumDeposit) external; - - function setFishermanRewardPercentage(uint32 _percentage) external; - - function setSlashingPercentage(uint32 _qryPercentage, uint32 _idxPercentage) external; - - // -- Getters -- - - function isDisputeCreated(bytes32 _disputeID) external view returns (bool); - - function encodeHashReceipt(Receipt memory _receipt) external view returns (bytes32); - - function areConflictingAttestations( - Attestation memory _attestation1, - Attestation memory _attestation2 - ) external pure returns (bool); - - function getAttestationIndexer(Attestation memory _attestation) external view returns (address); - - // -- Dispute -- - - function createQueryDispute(bytes calldata _attestationData, uint256 _deposit) - external - returns (bytes32); - - function createQueryDisputeConflict( - bytes calldata _attestationData1, - bytes calldata _attestationData2 - ) external returns (bytes32, bytes32); - - function createIndexingDispute(address _allocationID, uint256 _deposit) - external - returns (bytes32); - - function acceptDispute(bytes32 _disputeID) external; - - function rejectDispute(bytes32 _disputeID) external; - - function drawDispute(bytes32 _disputeID) external; -} diff --git a/contracts/governance/Controller.sol b/contracts/governance/Controller.sol deleted file mode 100644 index 0f095eb5f..000000000 --- a/contracts/governance/Controller.sol +++ /dev/null @@ -1,136 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.7.3; - -import "./IController.sol"; -import "./IManaged.sol"; -import "./Governed.sol"; -import "./Pausable.sol"; - -/** - * @title Graph Controller contract - * @dev Controller is a registry of contracts for convenience. Inspired by Livepeer: - * https://github.com/livepeer/protocol/blob/streamflow/contracts/Controller.sol - */ -contract Controller is Governed, Pausable, IController { - // Track contract ids to contract proxy address - mapping(bytes32 => address) private registry; - - event SetContractProxy(bytes32 indexed id, address contractAddress); - - /** - * @dev Contract constructor. - */ - constructor() { - Governed._initialize(msg.sender); - - _setPaused(true); - } - - /** - * @dev Check if the caller is the governor or pause guardian. - */ - modifier onlyGovernorOrGuardian { - require( - msg.sender == governor || msg.sender == pauseGuardian, - "Only Governor or Guardian can call" - ); - _; - } - - /** - * @notice Getter to access governor - */ - function getGovernor() external override view returns (address) { - return governor; - } - - // -- Registry -- - - /** - * @notice Register contract id and mapped address - * @param _id Contract id (keccak256 hash of contract name) - * @param _contractAddress Contract address - */ - function setContractProxy(bytes32 _id, address _contractAddress) - external - override - onlyGovernor - { - require(_contractAddress != address(0), "Contract address must be set"); - registry[_id] = _contractAddress; - emit SetContractProxy(_id, _contractAddress); - } - - /** - * @notice Unregister a contract address - * @param _id Contract id (keccak256 hash of contract name) - */ - function unsetContractProxy(bytes32 _id) - external - override - onlyGovernor - { - registry[_id] = address(0); - emit SetContractProxy(_id, address(0)); - } - - /** - * @notice Get contract proxy address by its id - * @param _id Contract id - */ - function getContractProxy(bytes32 _id) public override view returns (address) { - return registry[_id]; - } - - /** - * @notice Update contract's controller - * @param _id Contract id (keccak256 hash of contract name) - * @param _controller Controller address - */ - function updateController(bytes32 _id, address _controller) external override onlyGovernor { - require(_controller != address(0), "Controller must be set"); - return IManaged(registry[_id]).setController(_controller); - } - - // -- Pausing -- - - /** - * @notice Change the partial paused state of the contract - * Partial pause is intended as a partial pause of the protocol - */ - function setPartialPaused(bool _partialPaused) external override onlyGovernorOrGuardian { - _setPartialPaused(_partialPaused); - } - - /** - * @notice Change the paused state of the contract - * Full pause most of protocol functions - */ - function setPaused(bool _paused) external override onlyGovernorOrGuardian { - _setPaused(_paused); - } - - /** - * @notice Change the Pause Guardian - * @param _newPauseGuardian The address of the new Pause Guardian - */ - function setPauseGuardian(address _newPauseGuardian) external override onlyGovernor { - require(_newPauseGuardian != address(0), "PauseGuardian must be set"); - _setPauseGuardian(_newPauseGuardian); - } - - /** - * @notice Getter to access paused - */ - function paused() external override view returns (bool) { - return _paused; - } - - /** - * @notice Getter to access partial pause status - */ - function partialPaused() external override view returns (bool) { - return _partialPaused; - } -} diff --git a/contracts/governance/Governed.sol b/contracts/governance/Governed.sol deleted file mode 100644 index fbd04bf36..000000000 --- a/contracts/governance/Governed.sol +++ /dev/null @@ -1,68 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.7.3; - -/** - * @title Graph Governance contract - * @dev All contracts that will be owned by a Governor entity should extend this contract. - */ -contract Governed { - // -- State -- - - address public governor; - address public pendingGovernor; - - // -- Events -- - - event NewPendingOwnership(address indexed from, address indexed to); - event NewOwnership(address indexed from, address indexed to); - - /** - * @dev Check if the caller is the governor. - */ - modifier onlyGovernor { - require(msg.sender == governor, "Only Governor can call"); - _; - } - - /** - * @dev Initialize the governor to the contract caller. - */ - function _initialize(address _initGovernor) internal { - governor = _initGovernor; - } - - /** - * @dev Admin function to begin change of governor. The `_newGovernor` must call - * `acceptOwnership` to finalize the transfer. - * @param _newGovernor Address of new `governor` - */ - function transferOwnership(address _newGovernor) external onlyGovernor { - require(_newGovernor != address(0), "Governor must be set"); - - address oldPendingGovernor = pendingGovernor; - pendingGovernor = _newGovernor; - - emit NewPendingOwnership(oldPendingGovernor, pendingGovernor); - } - - /** - * @dev Admin function for pending governor to accept role and update governor. - * This function must called by the pending governor. - */ - function acceptOwnership() external { - require( - pendingGovernor != address(0) && msg.sender == pendingGovernor, - "Caller must be pending governor" - ); - - address oldGovernor = governor; - address oldPendingGovernor = pendingGovernor; - - governor = pendingGovernor; - pendingGovernor = address(0); - - emit NewOwnership(oldGovernor, governor); - emit NewPendingOwnership(oldPendingGovernor, pendingGovernor); - } -} diff --git a/contracts/governance/GraphGovernance.sol b/contracts/governance/GraphGovernance.sol deleted file mode 100644 index 89bc3a4bd..000000000 --- a/contracts/governance/GraphGovernance.sol +++ /dev/null @@ -1,110 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.7.3; - -import "../upgrades/GraphUpgradeable.sol"; - -import "./GraphGovernanceStorage.sol"; - -/** - * @title Graph Governance Contract - * @notice Governance contract used to inscribe Graph Council and community votes. - */ -contract GraphGovernance is GraphGovernanceV1Storage, GraphUpgradeable, IGraphGovernance { - // -- Events -- - - /** - * @dev Emitted when `governor` calls createProposal() - */ - event ProposalCreated( - bytes32 indexed proposalId, - bytes32 votes, - bytes32 metadata, - ProposalResolution resolution - ); - /** - * @dev Emitted when `governor` calls updateProposal() - */ - event ProposalUpdated( - bytes32 indexed proposalId, - bytes32 votes, - bytes32 metadata, - ProposalResolution resolution - ); - - /** - * @notice Initialize this contract. - */ - function initialize(address _governor) public onlyImpl { - require(_governor != address(0), "governor != 0"); - Governed._initialize(_governor); - emit NewOwnership(address(0), _governor); - } - - // -- Proposals -- - - /** - * @notice Return whether the proposal is created. - * @param _proposalId Proposal identifier - * @return True if the proposal is already created - */ - function isProposalCreated(bytes32 _proposalId) public view override returns (bool) { - return proposals[_proposalId].votes != 0; - } - - /** - * @notice Updates an existing on chain proposal that links to a Graph Governance Proposal (GGP) - * IPFS hashes are base58 decoded, and have the first two bytes 'Qm' cut off to fit in bytes32 - * @param _proposalId Proposal identifier. This is an IPFS hash to the content of the GGP - * @param _votes An IPFS hash of the collection of signatures for each vote of the GGP. - * @param _metadata A bytes32 field to attach metadata to the proposal if needed - * @param _resolution Resolution choice, either Accepted or Rejected - */ - function createProposal( - bytes32 _proposalId, - bytes32 _votes, - bytes32 _metadata, - ProposalResolution _resolution - ) external override onlyGovernor { - require(_proposalId != 0x0, "!proposalId"); - require(_votes != 0x0, "!votes"); - require(_resolution != ProposalResolution.Null, "!resolved"); - require(!isProposalCreated(_proposalId), "proposed"); - - proposals[_proposalId] = Proposal({ - votes: _votes, - metadata: _metadata, - resolution: _resolution - }); - emit ProposalCreated(_proposalId, _votes, _metadata, _resolution); - } - - /** - * @notice Updates an existing on chain proposal that links to a Graph Governance Proposal (GGP) - * IPFS hashes are base58 decoded, and have the first two bytes 'Qm' cut off to fit in bytes32 - * The council has full power to create and vote on proposals - thus updated proposals can - * change past votes, metadata, and even resolutions if necessary. - * @param _proposalId Proposal identifier. This is an IPFS hash to the content of the GGP - * @param _votes An IPFS hash of the collection of signatures for each vote of the GGP. - * @param _metadata A bytes32 field to attach metadata to the proposal if needed - * @param _resolution Resolution choice, either Accepted or Rejected - */ - function updateProposal( - bytes32 _proposalId, - bytes32 _votes, - bytes32 _metadata, - ProposalResolution _resolution - ) external override onlyGovernor { - require(_proposalId != 0x0, "!proposalId"); - require(_votes != 0x0, "!votes"); - require(_resolution != ProposalResolution.Null, "!resolved"); - require(isProposalCreated(_proposalId), "!proposed"); - - proposals[_proposalId] = Proposal({ - votes: _votes, - metadata: _metadata, - resolution: _resolution - }); - emit ProposalUpdated(_proposalId, _votes, _metadata, _resolution); - } -} diff --git a/contracts/governance/GraphGovernanceStorage.sol b/contracts/governance/GraphGovernanceStorage.sol deleted file mode 100644 index f05a4c070..000000000 --- a/contracts/governance/GraphGovernanceStorage.sol +++ /dev/null @@ -1,21 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.7.3; - -import "./Governed.sol"; -import "./IGraphGovernance.sol"; - -contract GraphGovernanceV1Storage is Governed { - // Graph Governance Proposal storage struct (GGP) - struct Proposal { - bytes32 votes; // IPFS hash of signed votes - bytes32 metadata; // Additional info that can be linked - IGraphGovernance.ProposalResolution resolution; - } - - // -- State -- - - // Proposals are identified by a base58 decoded IPFS Hash used as proposalId - // The `proposalId` must link to the content of the proposal - mapping(bytes32 => Proposal) public proposals; -} diff --git a/contracts/governance/IGraphGovernance.sol b/contracts/governance/IGraphGovernance.sol deleted file mode 100644 index 0205f1e0d..000000000 --- a/contracts/governance/IGraphGovernance.sol +++ /dev/null @@ -1,49 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.7.3; - -interface IGraphGovernance { - /** - * @dev The three states of a Proposal. Null can never be set. - */ - enum ProposalResolution { Null, Accepted, Rejected } - - // -- Proposals -- - - /** - * @notice Return whether the proposal is created. - * @param _proposalId Proposal identifier - * @return True if the proposal is already created - */ - function isProposalCreated(bytes32 _proposalId) external view returns (bool); - - /** - * @notice Updates an existing on chain proposal that links to a Graph Governance Proposal (GGP) - * IPFS hashes are base58 decoded, and have the first two bytes 'Qm' cut off to fit in bytes32 - * @param _proposalId Proposal identifier. This is an IPFS hash to the content of the GGP - * @param _votes An IPFS hash of the collection of signatures for each vote of the GGP. - * @param _metadata A bytes32 field to attach metadata to the proposal if needed - * @param _resolution Resolution choice, either Accepted or Rejected - */ - function createProposal( - bytes32 _proposalId, - bytes32 _votes, - bytes32 _metadata, - ProposalResolution _resolution - ) external; - - /** - * @notice Updates an existing on chain proposal that links to a Graph Governance Proposal (GGP) - * IPFS hashes are base58 decoded, and have the first two bytes 'Qm' cut off to fit in bytes32 - * @param _proposalId Proposal identifier. This is an IPFS hash to the content of the GGP - * @param _votes An IPFS hash of the collection of signatures for each vote of the GGP. - * @param _metadata A bytes32 field to attach metadata to the proposal if needed - * @param _resolution Resolution choice, either Accepted or Rejected - */ - function updateProposal( - bytes32 _proposalId, - bytes32 _votes, - bytes32 _metadata, - ProposalResolution _resolution - ) external; -} diff --git a/contracts/governance/IManaged.sol b/contracts/governance/IManaged.sol deleted file mode 100644 index 4b6cb7175..000000000 --- a/contracts/governance/IManaged.sol +++ /dev/null @@ -1,7 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.7.3; - -interface IManaged { - function setController(address _controller) external; -} diff --git a/contracts/governance/Managed.sol b/contracts/governance/Managed.sol deleted file mode 100644 index 9cba7ced1..000000000 --- a/contracts/governance/Managed.sol +++ /dev/null @@ -1,186 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.7.3; - -import "./IController.sol"; - -import "../curation/ICuration.sol"; -import "../epochs/IEpochManager.sol"; -import "../rewards/IRewardsManager.sol"; -import "../staking/IStaking.sol"; -import "../token/IGraphToken.sol"; - -/** - * @title Graph Managed contract - * @dev The Managed contract provides an interface to interact with the Controller. - * It also provides local caching for contract addresses. This mechanism relies on calling the - * public `syncAllContracts()` function whenever a contract changes in the controller. - * - * Inspired by Livepeer: - * https://github.com/livepeer/protocol/blob/streamflow/contracts/Controller.sol - */ -contract Managed { - // -- State -- - - // Controller that contract is registered with - IController public controller; - mapping(bytes32 => address) private addressCache; - uint256[10] private __gap; - - // -- Events -- - - event ParameterUpdated(string param); - event SetController(address controller); - - /** - * @dev Emitted when contract with `nameHash` is synced to `contractAddress`. - */ - event ContractSynced(bytes32 indexed nameHash, address contractAddress); - - // -- Modifiers -- - - function _notPartialPaused() internal view { - require(!controller.paused(), "Paused"); - require(!controller.partialPaused(), "Partial-paused"); - } - - function _notPaused() internal view { - require(!controller.paused(), "Paused"); - } - - function _onlyGovernor() internal view { - require(msg.sender == controller.getGovernor(), "Caller must be Controller governor"); - } - - function _onlyController() internal view { - require(msg.sender == address(controller), "Caller must be Controller"); - } - - modifier notPartialPaused { - _notPartialPaused(); - _; - } - - modifier notPaused { - _notPaused(); - _; - } - - // Check if sender is controller. - modifier onlyController() { - _onlyController(); - _; - } - - // Check if sender is the governor. - modifier onlyGovernor() { - _onlyGovernor(); - _; - } - - // -- Functions -- - - /** - * @dev Initialize the controller. - */ - function _initialize(address _controller) internal { - _setController(_controller); - } - - /** - * @notice Set Controller. Only callable by current controller. - * @param _controller Controller contract address - */ - function setController(address _controller) external onlyController { - _setController(_controller); - } - - /** - * @dev Set controller. - * @param _controller Controller contract address - */ - function _setController(address _controller) internal { - require(_controller != address(0), "Controller must be set"); - controller = IController(_controller); - emit SetController(_controller); - } - - /** - * @dev Return Curation interface. - * @return Curation contract registered with Controller - */ - function curation() internal view returns (ICuration) { - return ICuration(_resolveContract(keccak256("Curation"))); - } - - /** - * @dev Return EpochManager interface. - * @return Epoch manager contract registered with Controller - */ - function epochManager() internal view returns (IEpochManager) { - return IEpochManager(_resolveContract(keccak256("EpochManager"))); - } - - /** - * @dev Return RewardsManager interface. - * @return Rewards manager contract registered with Controller - */ - function rewardsManager() internal view returns (IRewardsManager) { - return IRewardsManager(_resolveContract(keccak256("RewardsManager"))); - } - - /** - * @dev Return Staking interface. - * @return Staking contract registered with Controller - */ - function staking() internal view returns (IStaking) { - return IStaking(_resolveContract(keccak256("Staking"))); - } - - /** - * @dev Return GraphToken interface. - * @return Graph token contract registered with Controller - */ - function graphToken() internal view returns (IGraphToken) { - return IGraphToken(_resolveContract(keccak256("GraphToken"))); - } - - /** - * @dev Resolve a contract address from the cache or the Controller if not found. - * @return Address of the contract - */ - function _resolveContract(bytes32 _nameHash) internal view returns (address) { - address contractAddress = addressCache[_nameHash]; - if (contractAddress == address(0)) { - contractAddress = controller.getContractProxy(_nameHash); - } - return contractAddress; - } - - /** - * @dev Cache a contract address from the Controller registry. - * @param _name Name of the contract to sync into the cache - */ - function _syncContract(string memory _name) internal { - bytes32 nameHash = keccak256(abi.encodePacked(_name)); - address contractAddress = controller.getContractProxy(nameHash); - if (addressCache[nameHash] != contractAddress) { - addressCache[nameHash] = contractAddress; - emit ContractSynced(nameHash, contractAddress); - } - } - - /** - * @dev Sync protocol contract addresses from the Controller registry. - * This function will cache all the contracts using the latest addresses - * Anyone can call the function whenever a Proxy contract change in the - * controller to ensure the protocol is using the latest version - */ - function syncAllContracts() external { - _syncContract("Curation"); - _syncContract("EpochManager"); - _syncContract("RewardsManager"); - _syncContract("Staking"); - _syncContract("GraphToken"); - } -} diff --git a/contracts/governance/Pausable.sol b/contracts/governance/Pausable.sol deleted file mode 100644 index 6235d51e3..000000000 --- a/contracts/governance/Pausable.sol +++ /dev/null @@ -1,60 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.7.3; - -contract Pausable { - // Partial paused paused exit and enter functions for GRT, but not internal - // functions, such as allocating - bool internal _partialPaused; - // Paused will pause all major protocol functions - bool internal _paused; - - // Time last paused for both pauses - uint256 public lastPausePartialTime; - uint256 public lastPauseTime; - - // Pause guardian is a separate entity from the governor that can pause - address public pauseGuardian; - - event PartialPauseChanged(bool isPaused); - event PauseChanged(bool isPaused); - event NewPauseGuardian(address indexed oldPauseGuardian, address indexed pauseGuardian); - - /** - * @notice Change the partial paused state of the contract - */ - function _setPartialPaused(bool _toPause) internal { - if (_toPause == _partialPaused) { - return; - } - _partialPaused = _toPause; - if (_partialPaused) { - lastPausePartialTime = block.timestamp; - } - emit PartialPauseChanged(_partialPaused); - } - - /** - * @notice Change the paused state of the contract - */ - function _setPaused(bool _toPause) internal { - if (_toPause == _paused) { - return; - } - _paused = _toPause; - if (_paused) { - lastPauseTime = block.timestamp; - } - emit PauseChanged(_paused); - } - - /** - * @notice Change the Pause Guardian - * @param newPauseGuardian The address of the new Pause Guardian - */ - function _setPauseGuardian(address newPauseGuardian) internal { - address oldPauseGuardian = pauseGuardian; - pauseGuardian = newPauseGuardian; - emit NewPauseGuardian(oldPauseGuardian, pauseGuardian); - } -} diff --git a/contracts/rewards/IRewardsManager.sol b/contracts/rewards/IRewardsManager.sol deleted file mode 100644 index 2a3651c65..000000000 --- a/contracts/rewards/IRewardsManager.sol +++ /dev/null @@ -1,60 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.7.3; - -interface IRewardsManager { - /** - * @dev Stores accumulated rewards and snapshots related to a particular SubgraphDeployment. - */ - struct Subgraph { - uint256 accRewardsForSubgraph; - uint256 accRewardsForSubgraphSnapshot; - uint256 accRewardsPerSignalSnapshot; - uint256 accRewardsPerAllocatedToken; - } - - // -- Params -- - - function setIssuanceRate(uint256 _issuanceRate) external; - - // -- Denylist -- - - function setSubgraphAvailabilityOracle(address _subgraphAvailabilityOracle) external; - - function setDenied(bytes32 _subgraphDeploymentID, bool _deny) external; - - function setDeniedMany(bytes32[] calldata _subgraphDeploymentID, bool[] calldata _deny) - external; - - function isDenied(bytes32 _subgraphDeploymentID) external view returns (bool); - - // -- Getters -- - - function getNewRewardsPerSignal() external view returns (uint256); - - function getAccRewardsPerSignal() external view returns (uint256); - - function getAccRewardsForSubgraph(bytes32 _subgraphDeploymentID) - external - view - returns (uint256); - - function getAccRewardsPerAllocatedToken(bytes32 _subgraphDeploymentID) - external - view - returns (uint256, uint256); - - function getRewards(address _allocationID) external view returns (uint256); - - // -- Updates -- - - function updateAccRewardsPerSignal() external returns (uint256); - - function takeRewards(address _allocationID) external returns (uint256); - - // -- Hooks -- - - function onSubgraphSignalUpdate(bytes32 _subgraphDeploymentID) external returns (uint256); - - function onSubgraphAllocationUpdate(bytes32 _subgraphDeploymentID) external returns (uint256); -} diff --git a/contracts/rewards/RewardsManager.sol b/contracts/rewards/RewardsManager.sol deleted file mode 100644 index d8a11c7e9..000000000 --- a/contracts/rewards/RewardsManager.sol +++ /dev/null @@ -1,456 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.7.3; -pragma experimental ABIEncoderV2; - -import "@openzeppelin/contracts/math/SafeMath.sol"; - -import "../upgrades/GraphUpgradeable.sol"; - -import "./RewardsManagerStorage.sol"; -import "./IRewardsManager.sol"; - -contract RewardsManager is RewardsManagerV1Storage, GraphUpgradeable, IRewardsManager { - using SafeMath for uint256; - - uint256 private constant TOKEN_DECIMALS = 1e18; - uint256 private constant MIN_ISSUANCE_RATE = 1e18; - - // -- Events -- - - /** - * @dev Emitted when rewards are assigned to an indexer. - */ - event RewardsAssigned( - address indexed indexer, - address indexed allocationID, - uint256 epoch, - uint256 amount - ); - - /** - * @dev Emitted when rewards are denied to an indexer. - */ - event RewardsDenied(address indexed indexer, address indexed allocationID, uint256 epoch); - - /** - * @dev Emitted when a subgraph is denied for claiming rewards. - */ - event RewardsDenylistUpdated(bytes32 indexed subgraphDeploymentID, uint256 sinceBlock); - - // -- Modifiers -- - - modifier onlySubgraphAvailabilityOracle() { - require( - msg.sender == address(subgraphAvailabilityOracle), - "Caller must be the subgraph availability oracle" - ); - _; - } - - /** - * @dev Initialize this contract. - */ - function initialize(address _controller, uint256 _issuanceRate) external onlyImpl { - Managed._initialize(_controller); - - // Settings - _setIssuanceRate(_issuanceRate); - } - - /** - * @dev Sets the issuance rate. - * The issuance rate is defined as a percentage increase of the total supply per block. - * This means that it needs to be greater than 1.0, any number under 1.0 is not - * allowed and an issuance rate of 1.0 means no issuance. - * To accommodate a high precision the issuance rate is expressed in wei. - * @param _issuanceRate Issuance rate expressed in wei - */ - function setIssuanceRate(uint256 _issuanceRate) external override onlyGovernor { - _setIssuanceRate(_issuanceRate); - } - - /** - * @dev Sets the issuance rate. - * @param _issuanceRate Issuance rate - */ - function _setIssuanceRate(uint256 _issuanceRate) private { - require(_issuanceRate >= MIN_ISSUANCE_RATE, "Issuance rate under minimum allowed"); - - // Called since `issuance rate` will change - updateAccRewardsPerSignal(); - - issuanceRate = _issuanceRate; - emit ParameterUpdated("issuanceRate"); - } - - /** - * @dev Sets the subgraph oracle allowed to denegate distribution of rewards to subgraphs. - * @param _subgraphAvailabilityOracle Address of the subgraph availability oracle - */ - function setSubgraphAvailabilityOracle(address _subgraphAvailabilityOracle) - external - override - onlyGovernor - { - subgraphAvailabilityOracle = _subgraphAvailabilityOracle; - emit ParameterUpdated("subgraphAvailabilityOracle"); - } - - /** - * @dev Denies to claim rewards for a subgraph. - * NOTE: Can only be called by the subgraph availability oracle - * @param _subgraphDeploymentID Subgraph deployment ID - * @param _deny Whether to set the subgraph as denied for claiming rewards or not - */ - function setDenied(bytes32 _subgraphDeploymentID, bool _deny) - external - override - onlySubgraphAvailabilityOracle - { - _setDenied(_subgraphDeploymentID, _deny); - } - - /** - * @dev Denies to claim rewards for multiple subgraph. - * NOTE: Can only be called by the subgraph availability oracle - * @param _subgraphDeploymentID Array of subgraph deployment ID - * @param _deny Array of denied status for claiming rewards for each subgraph - */ - function setDeniedMany(bytes32[] calldata _subgraphDeploymentID, bool[] calldata _deny) - external - override - onlySubgraphAvailabilityOracle - { - require(_subgraphDeploymentID.length == _deny.length, "!length"); - for (uint256 i = 0; i < _subgraphDeploymentID.length; i++) { - _setDenied(_subgraphDeploymentID[i], _deny[i]); - } - } - - /** - * @dev Internal: Denies to claim rewards for a subgraph. - * @param _subgraphDeploymentID Subgraph deployment ID - * @param _deny Whether to set the subgraph as denied for claiming rewards or not - */ - function _setDenied(bytes32 _subgraphDeploymentID, bool _deny) private { - uint256 sinceBlock = _deny ? block.number : 0; - denylist[_subgraphDeploymentID] = sinceBlock; - emit RewardsDenylistUpdated(_subgraphDeploymentID, sinceBlock); - } - - /** - * @dev Tells if subgraph is in deny list - * @param _subgraphDeploymentID Subgraph deployment ID to check - */ - function isDenied(bytes32 _subgraphDeploymentID) public override view returns (bool) { - return denylist[_subgraphDeploymentID] > 0; - } - - /** - * @dev Gets the issuance of rewards per signal since last updated. - * - * Compound interest formula: `a = p(1 + r/n)^nt` - * The formula is simplified with `n = 1` as we apply the interest once every time step. - * The `r` is passed with +1 included. So for 10% instead of 0.1 it is 1.1 - * The simplified formula is `a = p * r^t` - * - * Notation: - * t: time steps are in blocks since last updated - * p: total supply of GRT tokens - * a: inflated amount of total supply for the period `t` when interest `r` is applied - * x: newly accrued rewards token for the period `t` - * - * @return newly accrued rewards per signal since last update - */ - function getNewRewardsPerSignal() public override view returns (uint256) { - // Calculate time steps - uint256 t = block.number.sub(accRewardsPerSignalLastBlockUpdated); - // Optimization to skip calculations if zero time steps elapsed - if (t == 0) { - return 0; - } - - // Zero issuance under a rate of 1.0 - if (issuanceRate <= MIN_ISSUANCE_RATE) { - return 0; - } - - // Zero issuance if no signalled tokens - IGraphToken graphToken = graphToken(); - uint256 signalledTokens = graphToken.balanceOf(address(curation())); - if (signalledTokens == 0) { - return 0; - } - - uint256 r = issuanceRate; - uint256 p = graphToken.totalSupply(); - uint256 a = p.mul(_pow(r, t, TOKEN_DECIMALS)).div(TOKEN_DECIMALS); - - // New issuance of tokens during time steps - uint256 x = a.sub(p); - - // Get the new issuance per signalled token - // We multiply the decimals to keep the precision as fixed-point number - return x.mul(TOKEN_DECIMALS).div(signalledTokens); - } - - /** - * @dev Gets the currently accumulated rewards per signal. - */ - function getAccRewardsPerSignal() public override view returns (uint256) { - return accRewardsPerSignal.add(getNewRewardsPerSignal()); - } - - /** - * @dev Gets the accumulated rewards for the subgraph. - * @param _subgraphDeploymentID Subgraph deployment - * @return Accumulated rewards for subgraph - */ - function getAccRewardsForSubgraph(bytes32 _subgraphDeploymentID) - public - override - view - returns (uint256) - { - Subgraph storage subgraph = subgraphs[_subgraphDeploymentID]; - - uint256 newRewardsPerSignal = getAccRewardsPerSignal().sub( - subgraph.accRewardsPerSignalSnapshot - ); - uint256 subgraphSignalledTokens = curation().getCurationPoolTokens(_subgraphDeploymentID); - uint256 newRewards = newRewardsPerSignal.mul(subgraphSignalledTokens).div(TOKEN_DECIMALS); - return subgraph.accRewardsForSubgraph.add(newRewards); - } - - /** - * @dev Gets the accumulated rewards per allocated token for the subgraph. - * @param _subgraphDeploymentID Subgraph deployment - * @return Accumulated rewards per allocated token for the subgraph - * @return Accumulated rewards for subgraph - */ - function getAccRewardsPerAllocatedToken(bytes32 _subgraphDeploymentID) - public - override - view - returns (uint256, uint256) - { - Subgraph storage subgraph = subgraphs[_subgraphDeploymentID]; - - uint256 accRewardsForSubgraph = getAccRewardsForSubgraph(_subgraphDeploymentID); - uint256 newRewardsForSubgraph = accRewardsForSubgraph.sub( - subgraph.accRewardsForSubgraphSnapshot - ); - - uint256 subgraphAllocatedTokens = staking().getSubgraphAllocatedTokens( - _subgraphDeploymentID - ); - if (subgraphAllocatedTokens == 0) { - return (0, accRewardsForSubgraph); - } - - uint256 newRewardsPerAllocatedToken = newRewardsForSubgraph.mul(TOKEN_DECIMALS).div( - subgraphAllocatedTokens - ); - return ( - subgraph.accRewardsPerAllocatedToken.add(newRewardsPerAllocatedToken), - accRewardsForSubgraph - ); - } - - /** - * @dev Updates the accumulated rewards per signal and save checkpoint block number. - * Must be called before `issuanceRate` or `total signalled GRT` changes - * Called from the Curation contract on mint() and burn() - * @return Accumulated rewards per signal - */ - function updateAccRewardsPerSignal() public override returns (uint256) { - accRewardsPerSignal = getAccRewardsPerSignal(); - accRewardsPerSignalLastBlockUpdated = block.number; - return accRewardsPerSignal; - } - - /** - * @dev Triggers an update of rewards for a subgraph. - * Must be called before `signalled GRT` on a subgraph changes. - * Note: Hook called from the Curation contract on mint() and burn() - * @param _subgraphDeploymentID Subgraph deployment - * @return Accumulated rewards for subgraph - */ - function onSubgraphSignalUpdate(bytes32 _subgraphDeploymentID) - external - override - returns (uint256) - { - // Called since `total signalled GRT` will change - updateAccRewardsPerSignal(); - - // Updates the accumulated rewards for a subgraph - Subgraph storage subgraph = subgraphs[_subgraphDeploymentID]; - subgraph.accRewardsForSubgraph = getAccRewardsForSubgraph(_subgraphDeploymentID); - subgraph.accRewardsPerSignalSnapshot = accRewardsPerSignal; - return subgraph.accRewardsForSubgraph; - } - - /** - * @dev Triggers an update of rewards for a subgraph. - * Must be called before allocation on a subgraph changes. - * NOTE: Hook called from the Staking contract on allocate() and close() - * - * @param _subgraphDeploymentID Subgraph deployment - * @return Accumulated rewards per allocated token for a subgraph - */ - function onSubgraphAllocationUpdate(bytes32 _subgraphDeploymentID) - public - override - returns (uint256) - { - Subgraph storage subgraph = subgraphs[_subgraphDeploymentID]; - ( - uint256 accRewardsPerAllocatedToken, - uint256 accRewardsForSubgraph - ) = getAccRewardsPerAllocatedToken(_subgraphDeploymentID); - subgraph.accRewardsPerAllocatedToken = accRewardsPerAllocatedToken; - subgraph.accRewardsForSubgraphSnapshot = accRewardsForSubgraph; - return subgraph.accRewardsPerAllocatedToken; - } - - /** - * @dev Calculate current rewards for a given allocation on demand. - * @param _allocationID Allocation - * @return Rewards amount for an allocation - */ - function getRewards(address _allocationID) external override view returns (uint256) { - IStaking.Allocation memory alloc = staking().getAllocation(_allocationID); - - (uint256 accRewardsPerAllocatedToken, ) = getAccRewardsPerAllocatedToken( - alloc.subgraphDeploymentID - ); - return - _calcRewards( - alloc.tokens, - alloc.accRewardsPerAllocatedToken, - accRewardsPerAllocatedToken - ); - } - - /** - * @dev Calculate current rewards for a given allocation. - * @param _tokens Tokens allocated - * @param _startAccRewardsPerAllocatedToken Allocation start accumulated rewards - * @param _endAccRewardsPerAllocatedToken Allocation end accumulated rewards - * @return Rewards amount - */ - function _calcRewards( - uint256 _tokens, - uint256 _startAccRewardsPerAllocatedToken, - uint256 _endAccRewardsPerAllocatedToken - ) private pure returns (uint256) { - uint256 newAccrued = _endAccRewardsPerAllocatedToken.sub(_startAccRewardsPerAllocatedToken); - return newAccrued.mul(_tokens).div(TOKEN_DECIMALS); - } - - /** - * @dev Pull rewards from the contract for a particular allocation. - * This function can only be called by the Staking contract. - * This function will mint the necessary tokens to reward based on the inflation calculation. - * @param _allocationID Allocation - * @return Assigned rewards amount - */ - function takeRewards(address _allocationID) external override returns (uint256) { - // Only Staking contract is authorized as caller - IStaking staking = staking(); - require(msg.sender == address(staking), "Caller must be the staking contract"); - - IStaking.Allocation memory alloc = staking.getAllocation(_allocationID); - uint256 accRewardsPerAllocatedToken = onSubgraphAllocationUpdate( - alloc.subgraphDeploymentID - ); - - // Do not do rewards on denied subgraph deployments ID - if (isDenied(alloc.subgraphDeploymentID)) { - emit RewardsDenied(alloc.indexer, _allocationID, alloc.closedAtEpoch); - return 0; - } - - // Calculate rewards accrued by this allocation - uint256 rewards = _calcRewards( - alloc.tokens, - alloc.accRewardsPerAllocatedToken, - accRewardsPerAllocatedToken - ); - if (rewards > 0) { - // Mint directly to staking contract for the reward amount - // The staking contract will do bookkeeping of the reward and - // assign in proportion to each stakeholder incentive - graphToken().mint(address(staking), rewards); - } - - emit RewardsAssigned(alloc.indexer, _allocationID, alloc.closedAtEpoch, rewards); - - return rewards; - } - - /** - * @dev Raises x to the power of n with scaling factor of base. - * Based on: https://github.com/makerdao/dss/blob/master/src/pot.sol#L81 - * @param x Base of the exponentiation - * @param n Exponent - * @param base Scaling factor - * @return z Exponential of n with base x - */ - function _pow( - uint256 x, - uint256 n, - uint256 base - ) private pure returns (uint256 z) { - assembly { - switch x - case 0 { - switch n - case 0 { - z := base - } - default { - z := 0 - } - } - default { - switch mod(n, 2) - case 0 { - z := base - } - default { - z := x - } - let half := div(base, 2) // for rounding. - for { - n := div(n, 2) - } n { - n := div(n, 2) - } { - let xx := mul(x, x) - if iszero(eq(div(xx, x), x)) { - revert(0, 0) - } - let xxRound := add(xx, half) - if lt(xxRound, xx) { - revert(0, 0) - } - x := div(xxRound, base) - if mod(n, 2) { - let zx := mul(z, x) - if and(iszero(iszero(x)), iszero(eq(div(zx, x), z))) { - revert(0, 0) - } - let zxRound := add(zx, half) - if lt(zxRound, zx) { - revert(0, 0) - } - z := div(zxRound, base) - } - } - } - } - } -} diff --git a/contracts/rewards/RewardsManagerStorage.sol b/contracts/rewards/RewardsManagerStorage.sol deleted file mode 100644 index 1a411ec9b..000000000 --- a/contracts/rewards/RewardsManagerStorage.sol +++ /dev/null @@ -1,23 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.7.3; - -import "./IRewardsManager.sol"; -import "../governance/Managed.sol"; - -contract RewardsManagerV1Storage is Managed { - // -- State -- - - uint256 public issuanceRate; - uint256 public accRewardsPerSignal; - uint256 public accRewardsPerSignalLastBlockUpdated; - - // Address of role allowed to deny rewards on subgraphs - address public subgraphAvailabilityOracle; - - // Subgraph related rewards: subgraph deployment ID => subgraph rewards - mapping(bytes32 => IRewardsManager.Subgraph) public subgraphs; - - // Subgraph denylist : subgraph deployment ID => block when added or zero (if not denied) - mapping(bytes32 => uint256) public denylist; -} diff --git a/contracts/staking/IStaking.sol b/contracts/staking/IStaking.sol deleted file mode 100644 index 78c431b2c..000000000 --- a/contracts/staking/IStaking.sol +++ /dev/null @@ -1,154 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity >=0.6.12 <0.8.0; -pragma experimental ABIEncoderV2; - -import "./IStakingData.sol"; - -interface IStaking is IStakingData { - // -- Allocation Data -- - - /** - * @dev Possible states an allocation can be - * States: - * - Null = indexer == address(0) - * - Active = not Null && tokens > 0 - * - Closed = Active && closedAtEpoch != 0 - * - Finalized = Closed && closedAtEpoch + channelDisputeEpochs > now() - * - Claimed = not Null && tokens == 0 - */ - enum AllocationState { Null, Active, Closed, Finalized, Claimed } - - // -- Configuration -- - - function setMinimumIndexerStake(uint256 _minimumIndexerStake) external; - - function setThawingPeriod(uint32 _thawingPeriod) external; - - function setCurationPercentage(uint32 _percentage) external; - - function setProtocolPercentage(uint32 _percentage) external; - - function setChannelDisputeEpochs(uint32 _channelDisputeEpochs) external; - - function setMaxAllocationEpochs(uint32 _maxAllocationEpochs) external; - - function setRebateRatio(uint32 _alphaNumerator, uint32 _alphaDenominator) external; - - function setDelegationRatio(uint32 _delegationRatio) external; - - function setDelegationParameters( - uint32 _indexingRewardCut, - uint32 _queryFeeCut, - uint32 _cooldownBlocks - ) external; - - function setDelegationParametersCooldown(uint32 _blocks) external; - - function setDelegationUnbondingPeriod(uint32 _delegationUnbondingPeriod) external; - - function setDelegationTaxPercentage(uint32 _percentage) external; - - function setSlasher(address _slasher, bool _allowed) external; - - function setAssetHolder(address _assetHolder, bool _allowed) external; - - // -- Operation -- - - function setOperator(address _operator, bool _allowed) external; - - function isOperator(address _operator, address _indexer) external view returns (bool); - - // -- Staking -- - - function stake(uint256 _tokens) external; - - function stakeTo(address _indexer, uint256 _tokens) external; - - function unstake(uint256 _tokens) external; - - function slash( - address _indexer, - uint256 _tokens, - uint256 _reward, - address _beneficiary - ) external; - - function withdraw() external; - - function setRewardsDestination(address _destination) external; - - // -- Delegation -- - - function delegate(address _indexer, uint256 _tokens) external returns (uint256); - - function undelegate(address _indexer, uint256 _shares) external returns (uint256); - - function withdrawDelegated(address _indexer, address _newIndexer) external returns (uint256); - - // -- Channel management and allocations -- - - function allocate( - bytes32 _subgraphDeploymentID, - uint256 _tokens, - address _allocationID, - bytes32 _metadata, - bytes calldata _proof - ) external; - - function allocateFrom( - address _indexer, - bytes32 _subgraphDeploymentID, - uint256 _tokens, - address _allocationID, - bytes32 _metadata, - bytes calldata _proof - ) external; - - function closeAllocation(address _allocationID, bytes32 _poi) external; - - function closeAllocationMany(CloseAllocationRequest[] calldata _requests) external; - - function closeAndAllocate( - address _oldAllocationID, - bytes32 _poi, - address _indexer, - bytes32 _subgraphDeploymentID, - uint256 _tokens, - address _allocationID, - bytes32 _metadata, - bytes calldata _proof - ) external; - - function collect(uint256 _tokens, address _allocationID) external; - - function claim(address _allocationID, bool _restake) external; - - function claimMany(address[] calldata _allocationID, bool _restake) external; - - // -- Getters and calculations -- - - function hasStake(address _indexer) external view returns (bool); - - function getIndexerStakedTokens(address _indexer) external view returns (uint256); - - function getIndexerCapacity(address _indexer) external view returns (uint256); - - function getAllocation(address _allocationID) external view returns (Allocation memory); - - function getAllocationState(address _allocationID) external view returns (AllocationState); - - function isAllocation(address _allocationID) external view returns (bool); - - function getSubgraphAllocatedTokens(bytes32 _subgraphDeploymentID) - external - view - returns (uint256); - - function getDelegation(address _indexer, address _delegator) - external - view - returns (Delegation memory); - - function isDelegator(address _indexer, address _delegator) external view returns (bool); -} diff --git a/contracts/staking/IStakingData.sol b/contracts/staking/IStakingData.sol deleted file mode 100644 index a0bd2ab46..000000000 --- a/contracts/staking/IStakingData.sol +++ /dev/null @@ -1,54 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity >=0.6.12 <0.8.0; - -interface IStakingData { - /** - * @dev Allocate GRT tokens for the purpose of serving queries of a subgraph deployment - * An allocation is created in the allocate() function and consumed in claim() - */ - struct Allocation { - address indexer; - bytes32 subgraphDeploymentID; - uint256 tokens; // Tokens allocated to a SubgraphDeployment - uint256 createdAtEpoch; // Epoch when it was created - uint256 closedAtEpoch; // Epoch when it was closed - uint256 collectedFees; // Collected fees for the allocation - uint256 effectiveAllocation; // Effective allocation when closed - uint256 accRewardsPerAllocatedToken; // Snapshot used for reward calc - } - - /** - * @dev Represents a request to close an allocation with a specific proof of indexing. - * This is passed when calling closeAllocationMany to define the closing parameters for - * each allocation. - */ - struct CloseAllocationRequest { - address allocationID; - bytes32 poi; - } - - // -- Delegation Data -- - - /** - * @dev Delegation pool information. One per indexer. - */ - struct DelegationPool { - uint32 cooldownBlocks; // Blocks to wait before updating parameters - uint32 indexingRewardCut; // in PPM - uint32 queryFeeCut; // in PPM - uint256 updatedAtBlock; // Block when the pool was last updated - uint256 tokens; // Total tokens as pool reserves - uint256 shares; // Total shares minted in the pool - mapping(address => Delegation) delegators; // Mapping of delegator => Delegation - } - - /** - * @dev Individual delegation data of a delegator in a pool. - */ - struct Delegation { - uint256 shares; // Shares owned by a delegator in the pool - uint256 tokensLocked; // Tokens locked for undelegation - uint256 tokensLockedUntil; // Block when locked tokens can be withdrawn - } -} diff --git a/contracts/staking/Staking.sol b/contracts/staking/Staking.sol deleted file mode 100644 index 36a8a0f69..000000000 --- a/contracts/staking/Staking.sol +++ /dev/null @@ -1,1627 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.7.3; -pragma experimental ABIEncoderV2; - -import "@openzeppelin/contracts/cryptography/ECDSA.sol"; - -import "../upgrades/GraphUpgradeable.sol"; -import "../utils/TokenUtils.sol"; - -import "./IStaking.sol"; -import "./StakingStorage.sol"; -import "./libs/MathUtils.sol"; -import "./libs/Rebates.sol"; -import "./libs/Stakes.sol"; - -/** - * @title Staking contract - */ -contract Staking is StakingV2Storage, GraphUpgradeable, IStaking { - using SafeMath for uint256; - using Stakes for Stakes.Indexer; - using Rebates for Rebates.Pool; - - // 100% in parts per million - uint32 private constant MAX_PPM = 1000000; - - // -- Events -- - - /** - * @dev Emitted when `indexer` update the delegation parameters for its delegation pool. - */ - event DelegationParametersUpdated( - address indexed indexer, - uint32 indexingRewardCut, - uint32 queryFeeCut, - uint32 cooldownBlocks - ); - - /** - * @dev Emitted when `indexer` stake `tokens` amount. - */ - event StakeDeposited(address indexed indexer, uint256 tokens); - - /** - * @dev Emitted when `indexer` unstaked and locked `tokens` amount `until` block. - */ - event StakeLocked(address indexed indexer, uint256 tokens, uint256 until); - - /** - * @dev Emitted when `indexer` withdrew `tokens` staked. - */ - event StakeWithdrawn(address indexed indexer, uint256 tokens); - - /** - * @dev Emitted when `indexer` was slashed for a total of `tokens` amount. - * Tracks `reward` amount of tokens given to `beneficiary`. - */ - event StakeSlashed( - address indexed indexer, - uint256 tokens, - uint256 reward, - address beneficiary - ); - - /** - * @dev Emitted when `delegator` delegated `tokens` to the `indexer`, the delegator - * gets `shares` for the delegation pool proportionally to the tokens staked. - */ - event StakeDelegated( - address indexed indexer, - address indexed delegator, - uint256 tokens, - uint256 shares - ); - - /** - * @dev Emitted when `delegator` undelegated `tokens` from `indexer`. - * Tokens get locked for withdrawal after a period of time. - */ - event StakeDelegatedLocked( - address indexed indexer, - address indexed delegator, - uint256 tokens, - uint256 shares, - uint256 until - ); - - /** - * @dev Emitted when `delegator` withdrew delegated `tokens` from `indexer`. - */ - event StakeDelegatedWithdrawn( - address indexed indexer, - address indexed delegator, - uint256 tokens - ); - - /** - * @dev Emitted when `indexer` allocated `tokens` amount to `subgraphDeploymentID` - * during `epoch`. - * `allocationID` indexer derived address used to identify the allocation. - * `metadata` additional information related to the allocation. - */ - event AllocationCreated( - address indexed indexer, - bytes32 indexed subgraphDeploymentID, - uint256 epoch, - uint256 tokens, - address indexed allocationID, - bytes32 metadata - ); - - /** - * @dev Emitted when `indexer` collected `tokens` amount in `epoch` for `allocationID`. - * These funds are related to `subgraphDeploymentID`. - * The `from` value is the sender of the collected funds. - */ - event AllocationCollected( - address indexed indexer, - bytes32 indexed subgraphDeploymentID, - uint256 epoch, - uint256 tokens, - address indexed allocationID, - address from, - uint256 curationFees, - uint256 rebateFees - ); - - /** - * @dev Emitted when `indexer` close an allocation in `epoch` for `allocationID`. - * An amount of `tokens` get unallocated from `subgraphDeploymentID`. - * The `effectiveAllocation` are the tokens allocated from creation to closing. - * This event also emits the POI (proof of indexing) submitted by the indexer. - * `isDelegator` is true if the sender was one of the indexer's delegators. - */ - event AllocationClosed( - address indexed indexer, - bytes32 indexed subgraphDeploymentID, - uint256 epoch, - uint256 tokens, - address indexed allocationID, - uint256 effectiveAllocation, - address sender, - bytes32 poi, - bool isDelegator - ); - - /** - * @dev Emitted when `indexer` claimed a rebate on `subgraphDeploymentID` during `epoch` - * related to the `forEpoch` rebate pool. - * The rebate is for `tokens` amount and `unclaimedAllocationsCount` are left for claim - * in the rebate pool. `delegationFees` collected and sent to delegation pool. - */ - event RebateClaimed( - address indexed indexer, - bytes32 indexed subgraphDeploymentID, - address indexed allocationID, - uint256 epoch, - uint256 forEpoch, - uint256 tokens, - uint256 unclaimedAllocationsCount, - uint256 delegationFees - ); - - /** - * @dev Emitted when `caller` set `slasher` address as `allowed` to slash stakes. - */ - event SlasherUpdate(address indexed caller, address indexed slasher, bool allowed); - - /** - * @dev Emitted when `caller` set `assetHolder` address as `allowed` to send funds - * to staking contract. - */ - event AssetHolderUpdate(address indexed caller, address indexed assetHolder, bool allowed); - - /** - * @dev Emitted when `indexer` set `operator` access. - */ - event SetOperator(address indexed indexer, address indexed operator, bool allowed); - - /** - * @dev Emitted when `indexer` set an address to receive rewards. - */ - event SetRewardsDestination(address indexed indexer, address indexed destination); - - /** - * @dev Check if the caller is the slasher. - */ - modifier onlySlasher { - require(slashers[msg.sender] == true, "!slasher"); - _; - } - - /** - * @dev Check if the caller is authorized (indexer or operator) - */ - function _isAuth(address _indexer) private view returns (bool) { - return msg.sender == _indexer || isOperator(msg.sender, _indexer) == true; - } - - /** - * @dev Initialize this contract. - */ - function initialize( - address _controller, - uint256 _minimumIndexerStake, - uint32 _thawingPeriod, - uint32 _protocolPercentage, - uint32 _curationPercentage, - uint32 _channelDisputeEpochs, - uint32 _maxAllocationEpochs, - uint32 _delegationUnbondingPeriod, - uint32 _delegationRatio, - uint32 _rebateAlphaNumerator, - uint32 _rebateAlphaDenominator - ) external onlyImpl { - Managed._initialize(_controller); - - // Settings - _setMinimumIndexerStake(_minimumIndexerStake); - _setThawingPeriod(_thawingPeriod); - - _setProtocolPercentage(_protocolPercentage); - _setCurationPercentage(_curationPercentage); - - _setChannelDisputeEpochs(_channelDisputeEpochs); - _setMaxAllocationEpochs(_maxAllocationEpochs); - - _setDelegationUnbondingPeriod(_delegationUnbondingPeriod); - _setDelegationRatio(_delegationRatio); - _setDelegationParametersCooldown(0); - _setDelegationTaxPercentage(0); - - _setRebateRatio(_rebateAlphaNumerator, _rebateAlphaDenominator); - } - - /** - * @dev Set the minimum indexer stake required to. - * @param _minimumIndexerStake Minimum indexer stake - */ - function setMinimumIndexerStake(uint256 _minimumIndexerStake) external override onlyGovernor { - _setMinimumIndexerStake(_minimumIndexerStake); - } - - /** - * @dev Internal: Set the minimum indexer stake required. - * @param _minimumIndexerStake Minimum indexer stake - */ - function _setMinimumIndexerStake(uint256 _minimumIndexerStake) private { - require(_minimumIndexerStake > 0, "!minimumIndexerStake"); - minimumIndexerStake = _minimumIndexerStake; - emit ParameterUpdated("minimumIndexerStake"); - } - - /** - * @dev Set the thawing period for unstaking. - * @param _thawingPeriod Period in blocks to wait for token withdrawals after unstaking - */ - function setThawingPeriod(uint32 _thawingPeriod) external override onlyGovernor { - _setThawingPeriod(_thawingPeriod); - } - - /** - * @dev Internal: Set the thawing period for unstaking. - * @param _thawingPeriod Period in blocks to wait for token withdrawals after unstaking - */ - function _setThawingPeriod(uint32 _thawingPeriod) private { - require(_thawingPeriod > 0, "!thawingPeriod"); - thawingPeriod = _thawingPeriod; - emit ParameterUpdated("thawingPeriod"); - } - - /** - * @dev Set the curation percentage of query fees sent to curators. - * @param _percentage Percentage of query fees sent to curators - */ - function setCurationPercentage(uint32 _percentage) external override onlyGovernor { - _setCurationPercentage(_percentage); - } - - /** - * @dev Internal: Set the curation percentage of query fees sent to curators. - * @param _percentage Percentage of query fees sent to curators - */ - function _setCurationPercentage(uint32 _percentage) private { - // Must be within 0% to 100% (inclusive) - require(_percentage <= MAX_PPM, ">percentage"); - curationPercentage = _percentage; - emit ParameterUpdated("curationPercentage"); - } - - /** - * @dev Set a protocol percentage to burn when collecting query fees. - * @param _percentage Percentage of query fees to burn as protocol fee - */ - function setProtocolPercentage(uint32 _percentage) external override onlyGovernor { - _setProtocolPercentage(_percentage); - } - - /** - * @dev Internal: Set a protocol percentage to burn when collecting query fees. - * @param _percentage Percentage of query fees to burn as protocol fee - */ - function _setProtocolPercentage(uint32 _percentage) private { - // Must be within 0% to 100% (inclusive) - require(_percentage <= MAX_PPM, ">percentage"); - protocolPercentage = _percentage; - emit ParameterUpdated("protocolPercentage"); - } - - /** - * @dev Set the period in epochs that need to pass before fees in rebate pool can be claimed. - * @param _channelDisputeEpochs Period in epochs - */ - function setChannelDisputeEpochs(uint32 _channelDisputeEpochs) external override onlyGovernor { - _setChannelDisputeEpochs(_channelDisputeEpochs); - } - - /** - * @dev Internal: Set the period in epochs that need to pass before fees in rebate pool can be claimed. - * @param _channelDisputeEpochs Period in epochs - */ - function _setChannelDisputeEpochs(uint32 _channelDisputeEpochs) private { - require(_channelDisputeEpochs > 0, "!channelDisputeEpochs"); - channelDisputeEpochs = _channelDisputeEpochs; - emit ParameterUpdated("channelDisputeEpochs"); - } - - /** - * @dev Set the max time allowed for indexers stake on allocations. - * @param _maxAllocationEpochs Allocation duration limit in epochs - */ - function setMaxAllocationEpochs(uint32 _maxAllocationEpochs) external override onlyGovernor { - _setMaxAllocationEpochs(_maxAllocationEpochs); - } - - /** - * @dev Internal: Set the max time allowed for indexers stake on allocations. - * @param _maxAllocationEpochs Allocation duration limit in epochs - */ - function _setMaxAllocationEpochs(uint32 _maxAllocationEpochs) private { - maxAllocationEpochs = _maxAllocationEpochs; - emit ParameterUpdated("maxAllocationEpochs"); - } - - /** - * @dev Set the rebate ratio (fees to allocated stake). - * @param _alphaNumerator Numerator of `alpha` in the cobb-douglas function - * @param _alphaDenominator Denominator of `alpha` in the cobb-douglas function - */ - function setRebateRatio(uint32 _alphaNumerator, uint32 _alphaDenominator) - external - override - onlyGovernor - { - _setRebateRatio(_alphaNumerator, _alphaDenominator); - } - - /** - * @dev Set the rebate ratio (fees to allocated stake). - * @param _alphaNumerator Numerator of `alpha` in the cobb-douglas function - * @param _alphaDenominator Denominator of `alpha` in the cobb-douglas function - */ - function _setRebateRatio(uint32 _alphaNumerator, uint32 _alphaDenominator) private { - require(_alphaNumerator > 0 && _alphaDenominator > 0, "!alpha"); - alphaNumerator = _alphaNumerator; - alphaDenominator = _alphaDenominator; - emit ParameterUpdated("rebateRatio"); - } - - /** - * @dev Set the delegation ratio. - * If set to 10 it means the indexer can use up to 10x the indexer staked amount - * from their delegated tokens - * @param _delegationRatio Delegation capacity multiplier - */ - function setDelegationRatio(uint32 _delegationRatio) external override onlyGovernor { - _setDelegationRatio(_delegationRatio); - } - - /** - * @dev Internal: Set the delegation ratio. - * If set to 10 it means the indexer can use up to 10x the indexer staked amount - * from their delegated tokens - * @param _delegationRatio Delegation capacity multiplier - */ - function _setDelegationRatio(uint32 _delegationRatio) private { - delegationRatio = _delegationRatio; - emit ParameterUpdated("delegationRatio"); - } - - /** - * @dev Set the delegation parameters for the caller. - * @param _indexingRewardCut Percentage of indexing rewards left for delegators - * @param _queryFeeCut Percentage of query fees left for delegators - * @param _cooldownBlocks Period that need to pass to update delegation parameters - */ - function setDelegationParameters( - uint32 _indexingRewardCut, - uint32 _queryFeeCut, - uint32 _cooldownBlocks - ) public override { - _setDelegationParameters(msg.sender, _indexingRewardCut, _queryFeeCut, _cooldownBlocks); - } - - /** - * @dev Set the delegation parameters for a particular indexer. - * @param _indexer Indexer to set delegation parameters - * @param _indexingRewardCut Percentage of indexing rewards left for delegators - * @param _queryFeeCut Percentage of query fees left for delegators - * @param _cooldownBlocks Period that need to pass to update delegation parameters - */ - function _setDelegationParameters( - address _indexer, - uint32 _indexingRewardCut, - uint32 _queryFeeCut, - uint32 _cooldownBlocks - ) private { - // Incentives must be within bounds - require(_queryFeeCut <= MAX_PPM, ">queryFeeCut"); - require(_indexingRewardCut <= MAX_PPM, ">indexingRewardCut"); - - // Cooldown period set by indexer cannot be below protocol global setting - require(_cooldownBlocks >= delegationParametersCooldown, " 0, "!delegationUnbondingPeriod"); - delegationUnbondingPeriod = _delegationUnbondingPeriod; - emit ParameterUpdated("delegationUnbondingPeriod"); - } - - /** - * @dev Set a delegation tax percentage to burn when delegated funds are deposited. - * @param _percentage Percentage of delegated tokens to burn as delegation tax - */ - function setDelegationTaxPercentage(uint32 _percentage) external override onlyGovernor { - _setDelegationTaxPercentage(_percentage); - } - - /** - * @dev Internal: Set a delegation tax percentage to burn when delegated funds are deposited. - * @param _percentage Percentage of delegated tokens to burn as delegation tax - */ - function _setDelegationTaxPercentage(uint32 _percentage) private { - // Must be within 0% to 100% (inclusive) - require(_percentage <= MAX_PPM, ">percentage"); - delegationTaxPercentage = _percentage; - emit ParameterUpdated("delegationTaxPercentage"); - } - - /** - * @dev Set or unset an address as allowed slasher. - * @param _slasher Address of the party allowed to slash indexers - * @param _allowed True if slasher is allowed - */ - function setSlasher(address _slasher, bool _allowed) external override onlyGovernor { - require(_slasher != address(0), "!slasher"); - slashers[_slasher] = _allowed; - emit SlasherUpdate(msg.sender, _slasher, _allowed); - } - - /** - * @dev Set an address as allowed asset holder. - * @param _assetHolder Address of allowed source for state channel funds - * @param _allowed True if asset holder is allowed - */ - function setAssetHolder(address _assetHolder, bool _allowed) external override onlyGovernor { - require(_assetHolder != address(0), "!assetHolder"); - assetHolders[_assetHolder] = _allowed; - emit AssetHolderUpdate(msg.sender, _assetHolder, _allowed); - } - - /** - * @dev Return if allocationID is used. - * @param _allocationID Address used as signer by the indexer for an allocation - * @return True if allocationID already used - */ - function isAllocation(address _allocationID) external view override returns (bool) { - return _getAllocationState(_allocationID) != AllocationState.Null; - } - - /** - * @dev Getter that returns if an indexer has any stake. - * @param _indexer Address of the indexer - * @return True if indexer has staked tokens - */ - function hasStake(address _indexer) external view override returns (bool) { - return stakes[_indexer].tokensStaked > 0; - } - - /** - * @dev Return the allocation by ID. - * @param _allocationID Address used as allocation identifier - * @return Allocation data - */ - function getAllocation(address _allocationID) - external - view - override - returns (Allocation memory) - { - return allocations[_allocationID]; - } - - /** - * @dev Return the current state of an allocation. - * @param _allocationID Address used as the allocation identifier - * @return AllocationState - */ - function getAllocationState(address _allocationID) - external - view - override - returns (AllocationState) - { - return _getAllocationState(_allocationID); - } - - /** - * @dev Return the total amount of tokens allocated to subgraph. - * @param _subgraphDeploymentID Address used as the allocation identifier - * @return Total tokens allocated to subgraph - */ - function getSubgraphAllocatedTokens(bytes32 _subgraphDeploymentID) - external - view - override - returns (uint256) - { - return subgraphAllocations[_subgraphDeploymentID]; - } - - /** - * @dev Return the delegation from a delegator to an indexer. - * @param _indexer Address of the indexer where funds have been delegated - * @param _delegator Address of the delegator - * @return Delegation data - */ - function getDelegation(address _indexer, address _delegator) - external - view - override - returns (Delegation memory) - { - return delegationPools[_indexer].delegators[_delegator]; - } - - /** - * @dev Return whether the delegator has delegated to the indexer. - * @param _indexer Address of the indexer where funds have been delegated - * @param _delegator Address of the delegator - * @return True if delegator of indexer - */ - function isDelegator(address _indexer, address _delegator) public view override returns (bool) { - return delegationPools[_indexer].delegators[_delegator].shares > 0; - } - - /** - * @dev Get the total amount of tokens staked by the indexer. - * @param _indexer Address of the indexer - * @return Amount of tokens staked by the indexer - */ - function getIndexerStakedTokens(address _indexer) external view override returns (uint256) { - return stakes[_indexer].tokensStaked; - } - - /** - * @dev Get the total amount of tokens available to use in allocations. - * This considers the indexer stake and delegated tokens according to delegation ratio - * @param _indexer Address of the indexer - * @return Amount of tokens staked by the indexer - */ - function getIndexerCapacity(address _indexer) public view override returns (uint256) { - Stakes.Indexer memory indexerStake = stakes[_indexer]; - uint256 tokensDelegated = delegationPools[_indexer].tokens; - - uint256 tokensDelegatedCap = indexerStake.tokensSecureStake().mul(uint256(delegationRatio)); - uint256 tokensDelegatedCapacity = MathUtils.min(tokensDelegated, tokensDelegatedCap); - - return indexerStake.tokensAvailableWithDelegation(tokensDelegatedCapacity); - } - - /** - * @dev Returns amount of delegated tokens ready to be withdrawn after unbonding period. - * @param _delegation Delegation of tokens from delegator to indexer - * @return Amount of tokens to withdraw - */ - function getWithdraweableDelegatedTokens(Delegation memory _delegation) - public - view - returns (uint256) - { - // There must be locked tokens and period passed - uint256 currentEpoch = epochManager().currentEpoch(); - if (_delegation.tokensLockedUntil > 0 && currentEpoch >= _delegation.tokensLockedUntil) { - return _delegation.tokensLocked; - } - return 0; - } - - /** - * @dev Authorize or unauthorize an address to be an operator. - * @param _operator Address to authorize - * @param _allowed Whether authorized or not - */ - function setOperator(address _operator, bool _allowed) external override { - require(_operator != msg.sender, "operator == sender"); - operatorAuth[msg.sender][_operator] = _allowed; - emit SetOperator(msg.sender, _operator, _allowed); - } - - /** - * @dev Return true if operator is allowed for indexer. - * @param _operator Address of the operator - * @param _indexer Address of the indexer - */ - function isOperator(address _operator, address _indexer) public view override returns (bool) { - return operatorAuth[_indexer][_operator]; - } - - /** - * @dev Deposit tokens on the indexer stake. - * @param _tokens Amount of tokens to stake - */ - function stake(uint256 _tokens) external override { - stakeTo(msg.sender, _tokens); - } - - /** - * @dev Deposit tokens on the indexer stake. - * @param _indexer Address of the indexer - * @param _tokens Amount of tokens to stake - */ - function stakeTo(address _indexer, uint256 _tokens) public override notPartialPaused { - require(_tokens > 0, "!tokens"); - - // Ensure minimum stake - require( - stakes[_indexer].tokensSecureStake().add(_tokens) >= minimumIndexerStake, - "!minimumIndexerStake" - ); - - // Transfer tokens to stake from caller to this contract - TokenUtils.pullTokens(graphToken(), msg.sender, _tokens); - - // Stake the transferred tokens - _stake(_indexer, _tokens); - } - - /** - * @dev Unstake tokens from the indexer stake, lock them until thawing period expires. - * @param _tokens Amount of tokens to unstake - */ - function unstake(uint256 _tokens) external override notPartialPaused { - address indexer = msg.sender; - Stakes.Indexer storage indexerStake = stakes[indexer]; - - require(_tokens > 0, "!tokens"); - require(indexerStake.tokensStaked > 0, "!stake"); - require(indexerStake.tokensAvailable() >= _tokens, "!stake-avail"); - - // Ensure minimum stake - uint256 newStake = indexerStake.tokensSecureStake().sub(_tokens); - require(newStake == 0 || newStake >= minimumIndexerStake, "!minimumIndexerStake"); - - // Before locking more tokens, withdraw any unlocked ones - uint256 tokensToWithdraw = indexerStake.tokensWithdrawable(); - if (tokensToWithdraw > 0) { - _withdraw(indexer); - } - - indexerStake.lockTokens(_tokens, thawingPeriod); - - emit StakeLocked(indexer, indexerStake.tokensLocked, indexerStake.tokensLockedUntil); - } - - /** - * @dev Withdraw indexer tokens once the thawing period has passed. - */ - function withdraw() external override notPaused { - _withdraw(msg.sender); - } - - /** - * @dev Set the destination where to send rewards. - * @param _destination Rewards destination address. If set to zero, rewards will be restaked - */ - function setRewardsDestination(address _destination) external override { - rewardsDestination[msg.sender] = _destination; - emit SetRewardsDestination(msg.sender, _destination); - } - - /** - * @dev Slash the indexer stake. Delegated tokens are not subject to slashing. - * Can only be called by the slasher role. - * @param _indexer Address of indexer to slash - * @param _tokens Amount of tokens to slash from the indexer stake - * @param _reward Amount of reward tokens to send to a beneficiary - * @param _beneficiary Address of a beneficiary to receive a reward for the slashing - */ - function slash( - address _indexer, - uint256 _tokens, - uint256 _reward, - address _beneficiary - ) external override onlySlasher notPartialPaused { - Stakes.Indexer storage indexerStake = stakes[_indexer]; - - // Only able to slash a non-zero number of tokens - require(_tokens > 0, "!tokens"); - - // Rewards comes from tokens slashed balance - require(_tokens >= _reward, "rewards>slash"); - - // Cannot slash stake of an indexer without any or enough stake - require(indexerStake.tokensStaked > 0, "!stake"); - require(_tokens <= indexerStake.tokensStaked, "slash>stake"); - - // Validate beneficiary of slashed tokens - require(_beneficiary != address(0), "!beneficiary"); - - // Slashing more tokens than freely available (over allocation condition) - // Unlock locked tokens to avoid the indexer to withdraw them - if (_tokens > indexerStake.tokensAvailable() && indexerStake.tokensLocked > 0) { - uint256 tokensOverAllocated = _tokens.sub(indexerStake.tokensAvailable()); - uint256 tokensToUnlock = MathUtils.min(tokensOverAllocated, indexerStake.tokensLocked); - indexerStake.unlockTokens(tokensToUnlock); - } - - // Remove tokens to slash from the stake - indexerStake.release(_tokens); - - // -- Interactions -- - - IGraphToken graphToken = graphToken(); - - // Set apart the reward for the beneficiary and burn remaining slashed stake - TokenUtils.burnTokens(graphToken, _tokens.sub(_reward)); - - // Give the beneficiary a reward for slashing - TokenUtils.pushTokens(graphToken, _beneficiary, _reward); - - emit StakeSlashed(_indexer, _tokens, _reward, _beneficiary); - } - - /** - * @dev Delegate tokens to an indexer. - * @param _indexer Address of the indexer to delegate tokens to - * @param _tokens Amount of tokens to delegate - * @return Amount of shares issued of the delegation pool - */ - function delegate(address _indexer, uint256 _tokens) - external - override - notPartialPaused - returns (uint256) - { - address delegator = msg.sender; - - // Transfer tokens to delegate to this contract - TokenUtils.pullTokens(graphToken(), delegator, _tokens); - - // Update state - return _delegate(delegator, _indexer, _tokens); - } - - /** - * @dev Undelegate tokens from an indexer. - * @param _indexer Address of the indexer where tokens had been delegated - * @param _shares Amount of shares to return and undelegate tokens - * @return Amount of tokens returned for the shares of the delegation pool - */ - function undelegate(address _indexer, uint256 _shares) - external - override - notPartialPaused - returns (uint256) - { - return _undelegate(msg.sender, _indexer, _shares); - } - - /** - * @dev Withdraw delegated tokens once the unbonding period has passed. - * @param _indexer Withdraw available tokens delegated to indexer - * @param _delegateToIndexer Re-delegate to indexer address if non-zero, withdraw if zero address - */ - function withdrawDelegated(address _indexer, address _delegateToIndexer) - external - override - notPaused - returns (uint256) - { - return _withdrawDelegated(msg.sender, _indexer, _delegateToIndexer); - } - - /** - * @dev Allocate available tokens to a subgraph deployment. - * @param _subgraphDeploymentID ID of the SubgraphDeployment where tokens will be allocated - * @param _tokens Amount of tokens to allocate - * @param _allocationID The allocation identifier - * @param _metadata IPFS hash for additional information about the allocation - * @param _proof A 65-bytes Ethereum signed message of `keccak256(indexerAddress,allocationID)` - */ - function allocate( - bytes32 _subgraphDeploymentID, - uint256 _tokens, - address _allocationID, - bytes32 _metadata, - bytes calldata _proof - ) external override notPaused { - _allocate(msg.sender, _subgraphDeploymentID, _tokens, _allocationID, _metadata, _proof); - } - - /** - * @dev Allocate available tokens to a subgraph deployment. - * @param _indexer Indexer address to allocate funds from. - * @param _subgraphDeploymentID ID of the SubgraphDeployment where tokens will be allocated - * @param _tokens Amount of tokens to allocate - * @param _allocationID The allocation identifier - * @param _metadata IPFS hash for additional information about the allocation - * @param _proof A 65-bytes Ethereum signed message of `keccak256(indexerAddress,allocationID)` - */ - function allocateFrom( - address _indexer, - bytes32 _subgraphDeploymentID, - uint256 _tokens, - address _allocationID, - bytes32 _metadata, - bytes calldata _proof - ) external override notPaused { - _allocate(_indexer, _subgraphDeploymentID, _tokens, _allocationID, _metadata, _proof); - } - - /** - * @dev Close an allocation and free the staked tokens. - * To be eligible for rewards a proof of indexing must be presented. - * Presenting a bad proof is subject to slashable condition. - * To opt out for rewards set _poi to 0x0 - * @param _allocationID The allocation identifier - * @param _poi Proof of indexing submitted for the allocated period - */ - function closeAllocation(address _allocationID, bytes32 _poi) external override notPaused { - _closeAllocation(_allocationID, _poi); - } - - /** - * @dev Close multiple allocations and free the staked tokens. - * To be eligible for rewards a proof of indexing must be presented. - * Presenting a bad proof is subject to slashable condition. - * To opt out for rewards set _poi to 0x0 - * @param _requests An array of CloseAllocationRequest - */ - function closeAllocationMany(CloseAllocationRequest[] calldata _requests) - external - override - notPaused - { - for (uint256 i = 0; i < _requests.length; i++) { - _closeAllocation(_requests[i].allocationID, _requests[i].poi); - } - } - - /** - * @dev Close and allocate. This will perform a close and then create a new Allocation - * atomically on the same transaction. - * @param _closingAllocationID The identifier of the allocation to be closed - * @param _poi Proof of indexing submitted for the allocated period - * @param _indexer Indexer address to allocate funds from. - * @param _subgraphDeploymentID ID of the SubgraphDeployment where tokens will be allocated - * @param _tokens Amount of tokens to allocate - * @param _allocationID The allocation identifier - * @param _metadata IPFS hash for additional information about the allocation - * @param _proof A 65-bytes Ethereum signed message of `keccak256(indexerAddress,allocationID)` - */ - function closeAndAllocate( - address _closingAllocationID, - bytes32 _poi, - address _indexer, - bytes32 _subgraphDeploymentID, - uint256 _tokens, - address _allocationID, - bytes32 _metadata, - bytes calldata _proof - ) external override notPaused { - _closeAllocation(_closingAllocationID, _poi); - _allocate(_indexer, _subgraphDeploymentID, _tokens, _allocationID, _metadata, _proof); - } - - /** - * @dev Collect query fees from state channels and assign them to an allocation. - * Funds received are only accepted from a valid sender. - * To avoid reverting on the withdrawal from channel flow this function will: - * 1) Accept calls with zero tokens. - * 2) Accept calls after an allocation passed the dispute period, in that case, all - * the received tokens are burned. - * @param _tokens Amount of tokens to collect - * @param _allocationID Allocation where the tokens will be assigned - */ - function collect(uint256 _tokens, address _allocationID) external override { - // Allocation identifier validation - require(_allocationID != address(0), "!alloc"); - - // The contract caller must be an authorized asset holder - require(assetHolders[msg.sender] == true, "!assetHolder"); - - // Allocation must exist - AllocationState allocState = _getAllocationState(_allocationID); - require(allocState != AllocationState.Null, "!collect"); - - // Get allocation - Allocation storage alloc = allocations[_allocationID]; - uint256 queryFees = _tokens; - uint256 curationFees = 0; - bytes32 subgraphDeploymentID = alloc.subgraphDeploymentID; - - // Process query fees only if non-zero amount - if (queryFees > 0) { - // Pull tokens to collect from the authorized sender - IGraphToken graphToken = graphToken(); - TokenUtils.pullTokens(graphToken, msg.sender, _tokens); - - // -- Collect protocol tax -- - // If the Allocation is not active or closed we are going to charge a 100% protocol tax - uint256 usedProtocolPercentage = - (allocState == AllocationState.Active || allocState == AllocationState.Closed) - ? protocolPercentage - : MAX_PPM; - uint256 protocolTax = _collectTax(graphToken, queryFees, usedProtocolPercentage); - queryFees = queryFees.sub(protocolTax); - - // -- Collect curation fees -- - // Only if the subgraph deployment is curated - curationFees = _collectCurationFees( - graphToken, - subgraphDeploymentID, - queryFees, - curationPercentage - ); - queryFees = queryFees.sub(curationFees); - - // Add funds to the allocation - alloc.collectedFees = alloc.collectedFees.add(queryFees); - - // When allocation is closed redirect funds to the rebate pool - // This way we can keep collecting tokens even after the allocation is closed and - // before it gets to the finalized state. - if (allocState == AllocationState.Closed) { - Rebates.Pool storage rebatePool = rebates[alloc.closedAtEpoch]; - rebatePool.fees = rebatePool.fees.add(queryFees); - } - } - - emit AllocationCollected( - alloc.indexer, - subgraphDeploymentID, - epochManager().currentEpoch(), - _tokens, - _allocationID, - msg.sender, - curationFees, - queryFees - ); - } - - /** - * @dev Claim tokens from the rebate pool. - * @param _allocationID Allocation from where we are claiming tokens - * @param _restake True if restake fees instead of transfer to indexer - */ - function claim(address _allocationID, bool _restake) external override notPaused { - _claim(_allocationID, _restake); - } - - /** - * @dev Claim tokens from the rebate pool for many allocations. - * @param _allocationID Array of allocations from where we are claiming tokens - * @param _restake True if restake fees instead of transfer to indexer - */ - function claimMany(address[] calldata _allocationID, bool _restake) - external - override - notPaused - { - for (uint256 i = 0; i < _allocationID.length; i++) { - _claim(_allocationID[i], _restake); - } - } - - /** - * @dev Stake tokens on the indexer. - * This function does not check minimum indexer stake requirement to allow - * to be called by functions that increase the stake when collecting rewards - * without reverting - * @param _indexer Address of staking party - * @param _tokens Amount of tokens to stake - */ - function _stake(address _indexer, uint256 _tokens) private { - // Deposit tokens into the indexer stake - stakes[_indexer].deposit(_tokens); - - // Initialize the delegation pool the first time - if (delegationPools[_indexer].updatedAtBlock == 0) { - _setDelegationParameters(_indexer, MAX_PPM, MAX_PPM, delegationParametersCooldown); - } - - emit StakeDeposited(_indexer, _tokens); - } - - /** - * @dev Withdraw indexer tokens once the thawing period has passed. - * @param _indexer Address of indexer to withdraw funds from - */ - function _withdraw(address _indexer) private { - // Get tokens available for withdraw and update balance - uint256 tokensToWithdraw = stakes[_indexer].withdrawTokens(); - require(tokensToWithdraw > 0, "!tokens"); - - // Return tokens to the indexer - TokenUtils.pushTokens(graphToken(), _indexer, tokensToWithdraw); - - emit StakeWithdrawn(_indexer, tokensToWithdraw); - } - - /** - * @dev Allocate available tokens to a subgraph deployment. - * @param _indexer Indexer address to allocate funds from. - * @param _subgraphDeploymentID ID of the SubgraphDeployment where tokens will be allocated - * @param _tokens Amount of tokens to allocate - * @param _allocationID The allocationID will work to identify collected funds related to this allocation - * @param _metadata Metadata related to the allocation - * @param _proof A 65-bytes Ethereum signed message of `keccak256(indexerAddress,allocationID)` - */ - function _allocate( - address _indexer, - bytes32 _subgraphDeploymentID, - uint256 _tokens, - address _allocationID, - bytes32 _metadata, - bytes calldata _proof - ) private { - require(_isAuth(_indexer), "!auth"); - - // Only allocations with a non-zero token amount are allowed - require(_tokens > 0, "!tokens"); - - // Check allocation - require(_allocationID != address(0), "!alloc"); - require(_getAllocationState(_allocationID) == AllocationState.Null, "!null"); - - // Caller must prove that they own the private key for the allocationID adddress - // The proof is an Ethereum signed message of KECCAK256(indexerAddress,allocationID) - bytes32 messageHash = keccak256(abi.encodePacked(_indexer, _allocationID)); - bytes32 digest = ECDSA.toEthSignedMessageHash(messageHash); - require(ECDSA.recover(digest, _proof) == _allocationID, "!proof"); - - // Needs to have free capacity not used for other purposes to allocate - require(getIndexerCapacity(_indexer) >= _tokens, "!capacity"); - - // Creates an allocation - // Allocation identifiers are not reused - // The assetHolder address can send collected funds to the allocation - Allocation memory alloc = - Allocation( - _indexer, - _subgraphDeploymentID, - _tokens, // Tokens allocated - epochManager().currentEpoch(), // createdAtEpoch - 0, // closedAtEpoch - 0, // Initialize collected fees - 0, // Initialize effective allocation - _updateRewards(_subgraphDeploymentID) // Initialize accumulated rewards per stake allocated - ); - allocations[_allocationID] = alloc; - - // Mark allocated tokens as used - stakes[_indexer].allocate(alloc.tokens); - - // Track total allocations per subgraph - // Used for rewards calculations - subgraphAllocations[alloc.subgraphDeploymentID] = subgraphAllocations[ - alloc.subgraphDeploymentID - ] - .add(alloc.tokens); - - emit AllocationCreated( - _indexer, - _subgraphDeploymentID, - alloc.createdAtEpoch, - alloc.tokens, - _allocationID, - _metadata - ); - } - - /** - * @dev Close an allocation and free the staked tokens. - * @param _allocationID The allocation identifier - * @param _poi Proof of indexing submitted for the allocated period - */ - function _closeAllocation(address _allocationID, bytes32 _poi) private { - // Allocation must exist and be active - AllocationState allocState = _getAllocationState(_allocationID); - require(allocState == AllocationState.Active, "!active"); - - // Get allocation - Allocation memory alloc = allocations[_allocationID]; - - // Validate that an allocation cannot be closed before one epoch - alloc.closedAtEpoch = epochManager().currentEpoch(); - uint256 epochs = MathUtils.diffOrZero(alloc.closedAtEpoch, alloc.createdAtEpoch); - require(epochs > 0, " maxAllocationEpochs) { - require(isIndexer || isDelegator(alloc.indexer, msg.sender), "!auth-or-del"); - } else { - require(isIndexer, "!auth"); - } - - // Calculate effective allocation for the amount of epochs it remained allocated - alloc.effectiveAllocation = _getEffectiveAllocation( - maxAllocationEpochs, - alloc.tokens, - epochs - ); - - // Close the allocation and start counting a period to settle remaining payments from - // state channels. - allocations[_allocationID].closedAtEpoch = alloc.closedAtEpoch; - allocations[_allocationID].effectiveAllocation = alloc.effectiveAllocation; - - // Account collected fees and effective allocation in rebate pool for the epoch - Rebates.Pool storage rebatePool = rebates[alloc.closedAtEpoch]; - if (!rebatePool.exists()) { - rebatePool.init(alphaNumerator, alphaDenominator); - } - rebatePool.addToPool(alloc.collectedFees, alloc.effectiveAllocation); - - // Distribute rewards if proof of indexing was presented by the indexer or operator - if (isIndexer && _poi != 0) { - _distributeRewards(_allocationID, alloc.indexer); - } else { - _updateRewards(alloc.subgraphDeploymentID); - } - - // Free allocated tokens from use - stakes[alloc.indexer].unallocate(alloc.tokens); - - // Track total allocations per subgraph - // Used for rewards calculations - subgraphAllocations[alloc.subgraphDeploymentID] = subgraphAllocations[ - alloc.subgraphDeploymentID - ] - .sub(alloc.tokens); - - emit AllocationClosed( - alloc.indexer, - alloc.subgraphDeploymentID, - alloc.closedAtEpoch, - alloc.tokens, - _allocationID, - alloc.effectiveAllocation, - msg.sender, - _poi, - !isIndexer - ); - } - - /** - * @dev Claim tokens from the rebate pool. - * @param _allocationID Allocation from where we are claiming tokens - * @param _restake True if restake fees instead of transfer to indexer - */ - function _claim(address _allocationID, bool _restake) private { - // Funds can only be claimed after a period of time passed since allocation was closed - AllocationState allocState = _getAllocationState(_allocationID); - require(allocState == AllocationState.Finalized, "!finalized"); - - // Get allocation - Allocation memory alloc = allocations[_allocationID]; - - // Only the indexer or operator can decide if to restake - bool restake = _isAuth(alloc.indexer) ? _restake : false; - - // Process rebate reward - Rebates.Pool storage rebatePool = rebates[alloc.closedAtEpoch]; - uint256 tokensToClaim = rebatePool.redeem(alloc.collectedFees, alloc.effectiveAllocation); - - // Add delegation rewards to the delegation pool - uint256 delegationRewards = _collectDelegationQueryRewards(alloc.indexer, tokensToClaim); - tokensToClaim = tokensToClaim.sub(delegationRewards); - - // Purge allocation data except for: - // - indexer: used in disputes and to avoid reusing an allocationID - // - subgraphDeploymentID: used in disputes - allocations[_allocationID].tokens = 0; // This avoid collect(), close() and claim() to be called - allocations[_allocationID].createdAtEpoch = 0; - allocations[_allocationID].closedAtEpoch = 0; - allocations[_allocationID].collectedFees = 0; - allocations[_allocationID].effectiveAllocation = 0; - allocations[_allocationID].accRewardsPerAllocatedToken = 0; - - // -- Interactions -- - - IGraphToken graphToken = graphToken(); - - // When all allocations processed then burn unclaimed fees and prune rebate pool - if (rebatePool.unclaimedAllocationsCount == 0) { - TokenUtils.burnTokens(graphToken, rebatePool.unclaimedFees()); - delete rebates[alloc.closedAtEpoch]; - } - - // When there are tokens to claim from the rebate pool, transfer or restake - _sendRewards(graphToken, tokensToClaim, alloc.indexer, restake); - - emit RebateClaimed( - alloc.indexer, - alloc.subgraphDeploymentID, - _allocationID, - epochManager().currentEpoch(), - alloc.closedAtEpoch, - tokensToClaim, - rebatePool.unclaimedAllocationsCount, - delegationRewards - ); - } - - /** - * @dev Delegate tokens to an indexer. - * @param _delegator Address of the delegator - * @param _indexer Address of the indexer to delegate tokens to - * @param _tokens Amount of tokens to delegate - * @return Amount of shares issued of the delegation pool - */ - function _delegate( - address _delegator, - address _indexer, - uint256 _tokens - ) private returns (uint256) { - // Only delegate a non-zero amount of tokens - require(_tokens > 0, "!tokens"); - // Only delegate to non-empty address - require(_indexer != address(0), "!indexer"); - // Only delegate to staked indexer - require(stakes[_indexer].tokensStaked > 0, "!stake"); - - // Get the delegation pool of the indexer - DelegationPool storage pool = delegationPools[_indexer]; - Delegation storage delegation = pool.delegators[_delegator]; - - // Collect delegation tax - uint256 delegationTax = _collectTax(graphToken(), _tokens, delegationTaxPercentage); - uint256 delegatedTokens = _tokens.sub(delegationTax); - - // Calculate shares to issue - uint256 shares = - (pool.tokens == 0) - ? delegatedTokens - : delegatedTokens.mul(pool.shares).div(pool.tokens); - - // Update the delegation pool - pool.tokens = pool.tokens.add(delegatedTokens); - pool.shares = pool.shares.add(shares); - - // Update the delegation - delegation.shares = delegation.shares.add(shares); - - emit StakeDelegated(_indexer, _delegator, delegatedTokens, shares); - - return shares; - } - - /** - * @dev Undelegate tokens from an indexer. - * @param _delegator Address of the delegator - * @param _indexer Address of the indexer where tokens had been delegated - * @param _shares Amount of shares to return and undelegate tokens - * @return Amount of tokens returned for the shares of the delegation pool - */ - function _undelegate( - address _delegator, - address _indexer, - uint256 _shares - ) private returns (uint256) { - // Can only undelegate a non-zero amount of shares - require(_shares > 0, "!shares"); - - // Get the delegation pool of the indexer - DelegationPool storage pool = delegationPools[_indexer]; - Delegation storage delegation = pool.delegators[_delegator]; - - // Delegator need to have enough shares in the pool to undelegate - require(delegation.shares >= _shares, "!shares-avail"); - - // Withdraw tokens if available - if (getWithdraweableDelegatedTokens(delegation) > 0) { - _withdrawDelegated(_delegator, _indexer, address(0)); - } - - // Calculate tokens to get in exchange for the shares - uint256 tokens = _shares.mul(pool.tokens).div(pool.shares); - - // Update the delegation pool - pool.tokens = pool.tokens.sub(tokens); - pool.shares = pool.shares.sub(_shares); - - // Update the delegation - delegation.shares = delegation.shares.sub(_shares); - delegation.tokensLocked = delegation.tokensLocked.add(tokens); - delegation.tokensLockedUntil = epochManager().currentEpoch().add(delegationUnbondingPeriod); - - emit StakeDelegatedLocked( - _indexer, - _delegator, - tokens, - _shares, - delegation.tokensLockedUntil - ); - - return tokens; - } - - /** - * @dev Withdraw delegated tokens once the unbonding period has passed. - * @param _delegator Delegator that is withdrawing tokens - * @param _indexer Withdraw available tokens delegated to indexer - * @param _delegateToIndexer Re-delegate to indexer address if non-zero, withdraw if zero address - */ - function _withdrawDelegated( - address _delegator, - address _indexer, - address _delegateToIndexer - ) private returns (uint256) { - // Get the delegation pool of the indexer - DelegationPool storage pool = delegationPools[_indexer]; - Delegation storage delegation = pool.delegators[_delegator]; - - // Validation - uint256 tokensToWithdraw = getWithdraweableDelegatedTokens(delegation); - require(tokensToWithdraw > 0, "!tokens"); - - // Reset lock - delegation.tokensLocked = 0; - delegation.tokensLockedUntil = 0; - - emit StakeDelegatedWithdrawn(_indexer, _delegator, tokensToWithdraw); - - // -- Interactions -- - - if (_delegateToIndexer != address(0)) { - // Re-delegate tokens to a new indexer - _delegate(_delegator, _delegateToIndexer, tokensToWithdraw); - } else { - // Return tokens to the delegator - TokenUtils.pushTokens(graphToken(), _delegator, tokensToWithdraw); - } - - return tokensToWithdraw; - } - - /** - * @dev Collect the delegation rewards for query fees. - * This function will assign the collected fees to the delegation pool. - * @param _indexer Indexer to which the tokens to distribute are related - * @param _tokens Total tokens received used to calculate the amount of fees to collect - * @return Amount of delegation rewards - */ - function _collectDelegationQueryRewards(address _indexer, uint256 _tokens) - private - returns (uint256) - { - uint256 delegationRewards = 0; - DelegationPool storage pool = delegationPools[_indexer]; - if (pool.tokens > 0 && pool.queryFeeCut < MAX_PPM) { - uint256 indexerCut = uint256(pool.queryFeeCut).mul(_tokens).div(MAX_PPM); - delegationRewards = _tokens.sub(indexerCut); - pool.tokens = pool.tokens.add(delegationRewards); - } - return delegationRewards; - } - - /** - * @dev Collect the delegation rewards for indexing. - * This function will assign the collected fees to the delegation pool. - * @param _indexer Indexer to which the tokens to distribute are related - * @param _tokens Total tokens received used to calculate the amount of fees to collect - * @return Amount of delegation rewards - */ - function _collectDelegationIndexingRewards(address _indexer, uint256 _tokens) - private - returns (uint256) - { - uint256 delegationRewards = 0; - DelegationPool storage pool = delegationPools[_indexer]; - if (pool.tokens > 0 && pool.indexingRewardCut < MAX_PPM) { - uint256 indexerCut = uint256(pool.indexingRewardCut).mul(_tokens).div(MAX_PPM); - delegationRewards = _tokens.sub(indexerCut); - pool.tokens = pool.tokens.add(delegationRewards); - } - return delegationRewards; - } - - /** - * @dev Collect the curation fees for a subgraph deployment from an amount of tokens. - * This function transfer curation fees to the Curation contract by calling Curation.collect - * @param _graphToken Token to collect - * @param _subgraphDeploymentID Subgraph deployment to which the curation fees are related - * @param _tokens Total tokens received used to calculate the amount of fees to collect - * @param _curationPercentage Percentage of tokens to collect as fees - * @return Amount of curation fees - */ - function _collectCurationFees( - IGraphToken _graphToken, - bytes32 _subgraphDeploymentID, - uint256 _tokens, - uint256 _curationPercentage - ) private returns (uint256) { - if (_tokens == 0) { - return 0; - } - - ICuration curation = curation(); - bool isCurationEnabled = _curationPercentage > 0 && address(curation) != address(0); - - if (isCurationEnabled && curation.isCurated(_subgraphDeploymentID)) { - uint256 curationFees = uint256(_curationPercentage).mul(_tokens).div(MAX_PPM); - if (curationFees > 0) { - // Transfer and call collect() - // This function transfer tokens to a trusted protocol contracts - // Then we call collect() to do the transfer bookeeping - TokenUtils.pushTokens(_graphToken, address(curation), curationFees); - curation.collect(_subgraphDeploymentID, curationFees); - } - return curationFees; - } - return 0; - } - - /** - * @dev Collect tax to burn for an amount of tokens. - * @param _graphToken Token to burn - * @param _tokens Total tokens received used to calculate the amount of tax to collect - * @param _percentage Percentage of tokens to burn as tax - * @return Amount of tax charged - */ - function _collectTax( - IGraphToken _graphToken, - uint256 _tokens, - uint256 _percentage - ) private returns (uint256) { - uint256 tax = uint256(_percentage).mul(_tokens).div(MAX_PPM); - TokenUtils.burnTokens(_graphToken, tax); // Burn tax if any - return tax; - } - - /** - * @dev Return the current state of an allocation - * @param _allocationID Allocation identifier - * @return AllocationState - */ - function _getAllocationState(address _allocationID) private view returns (AllocationState) { - Allocation storage alloc = allocations[_allocationID]; - - if (alloc.indexer == address(0)) { - return AllocationState.Null; - } - if (alloc.tokens == 0) { - return AllocationState.Claimed; - } - - uint256 closedAtEpoch = alloc.closedAtEpoch; - if (closedAtEpoch == 0) { - return AllocationState.Active; - } - - uint256 epochs = epochManager().epochsSince(closedAtEpoch); - if (epochs >= channelDisputeEpochs) { - return AllocationState.Finalized; - } - return AllocationState.Closed; - } - - /** - * @dev Get the effective stake allocation considering epochs from allocation to closing. - * @param _maxAllocationEpochs Max amount of epochs to cap the allocated stake - * @param _tokens Amount of tokens allocated - * @param _numEpochs Number of epochs that passed from allocation to closing - * @return Effective allocated tokens across epochs - */ - function _getEffectiveAllocation( - uint256 _maxAllocationEpochs, - uint256 _tokens, - uint256 _numEpochs - ) private pure returns (uint256) { - bool shouldCap = _maxAllocationEpochs > 0 && _numEpochs > _maxAllocationEpochs; - return _tokens.mul((shouldCap) ? _maxAllocationEpochs : _numEpochs); - } - - /** - * @dev Triggers an update of rewards due to a change in allocations. - * @param _subgraphDeploymentID Subgraph deployment updated - */ - function _updateRewards(bytes32 _subgraphDeploymentID) private returns (uint256) { - IRewardsManager rewardsManager = rewardsManager(); - if (address(rewardsManager) == address(0)) { - return 0; - } - return rewardsManager.onSubgraphAllocationUpdate(_subgraphDeploymentID); - } - - /** - * @dev Assign rewards for the closed allocation to indexer and delegators. - * @param _allocationID Allocation - */ - function _distributeRewards(address _allocationID, address _indexer) private { - IRewardsManager rewardsManager = rewardsManager(); - if (address(rewardsManager) == address(0)) { - return; - } - - // Automatically triggers update of rewards snapshot as allocation will change - // after this call. Take rewards mint tokens for the Staking contract to distribute - // between indexer and delegators - uint256 totalRewards = rewardsManager.takeRewards(_allocationID); - if (totalRewards == 0) { - return; - } - - // Calculate delegation rewards and add them to the delegation pool - uint256 delegationRewards = _collectDelegationIndexingRewards(_indexer, totalRewards); - uint256 indexerRewards = totalRewards.sub(delegationRewards); - - // Send the indexer rewards - _sendRewards( - graphToken(), - indexerRewards, - _indexer, - rewardsDestination[_indexer] == address(0) - ); - } - - /** - * @dev Send rewards to the appropiate destination. - * @param _graphToken Graph token - * @param _amount Number of rewards tokens - * @param _beneficiary Address of the beneficiary of rewards - * @param _restake Whether to restake or not - */ - function _sendRewards( - IGraphToken _graphToken, - uint256 _amount, - address _beneficiary, - bool _restake - ) private { - if (_amount == 0) return; - - if (_restake) { - // Restake to place fees into the indexer stake - _stake(_beneficiary, _amount); - } else { - // Transfer funds to the beneficiary's designated rewards destination if set - address destination = rewardsDestination[_beneficiary]; - TokenUtils.pushTokens( - _graphToken, - destination == address(0) ? _beneficiary : destination, - _amount - ); - } - } -} diff --git a/contracts/staking/StakingStorage.sol b/contracts/staking/StakingStorage.sol deleted file mode 100644 index 691cab9a6..000000000 --- a/contracts/staking/StakingStorage.sol +++ /dev/null @@ -1,89 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.7.3; - -import "../governance/Managed.sol"; - -import "./IStakingData.sol"; -import "./libs/Rebates.sol"; -import "./libs/Stakes.sol"; - -contract StakingV1Storage is Managed { - // -- Staking -- - - // Minimum amount of tokens an indexer needs to stake - uint256 public minimumIndexerStake; - - // Time in blocks to unstake - uint32 public thawingPeriod; // in blocks - - // Percentage of fees going to curators - // Parts per million. (Allows for 4 decimal points, 999,999 = 99.9999%) - uint32 public curationPercentage; - - // Percentage of fees burned as protocol fee - // Parts per million. (Allows for 4 decimal points, 999,999 = 99.9999%) - uint32 public protocolPercentage; - - // Period for allocation to be finalized - uint32 public channelDisputeEpochs; - - // Maximum allocation time - uint32 public maxAllocationEpochs; - - // Rebate ratio - uint32 public alphaNumerator; - uint32 public alphaDenominator; - - // Indexer stakes : indexer => Stake - mapping(address => Stakes.Indexer) public stakes; - - // Allocations : allocationID => Allocation - mapping(address => IStakingData.Allocation) public allocations; - - // Subgraph Allocations: subgraphDeploymentID => tokens - mapping(bytes32 => uint256) public subgraphAllocations; - - // Rebate pools : epoch => Pool - mapping(uint256 => Rebates.Pool) public rebates; - - // -- Slashing -- - - // List of addresses allowed to slash stakes - mapping(address => bool) public slashers; - - // -- Delegation -- - - // Set the delegation capacity multiplier defined by the delegation ratio - // If delegation ratio is 100, and an Indexer has staked 5 GRT, - // then they can use up to 500 GRT from the delegated stake - uint32 public delegationRatio; - - // Time in blocks an indexer needs to wait to change delegation parameters - uint32 public delegationParametersCooldown; - - // Time in epochs a delegator needs to wait to withdraw delegated stake - uint32 public delegationUnbondingPeriod; // in epochs - - // Percentage of tokens to tax a delegation deposit - // Parts per million. (Allows for 4 decimal points, 999,999 = 99.9999%) - uint32 public delegationTaxPercentage; - - // Delegation pools : indexer => DelegationPool - mapping(address => IStakingData.DelegationPool) public delegationPools; - - // -- Operators -- - - // Operator auth : indexer => operator - mapping(address => mapping(address => bool)) public operatorAuth; - - // -- Asset Holders -- - - // Allowed AssetHolders: assetHolder => is allowed - mapping(address => bool) public assetHolders; -} - -contract StakingV2Storage is StakingV1Storage { - // Destination of accrued rewards : beneficiary => rewards destination - mapping(address => address) public rewardsDestination; -} diff --git a/contracts/staking/libs/Cobbs.sol b/contracts/staking/libs/Cobbs.sol deleted file mode 100644 index 766225eac..000000000 --- a/contracts/staking/libs/Cobbs.sol +++ /dev/null @@ -1,92 +0,0 @@ -/* - - Copyright 2019 ZeroEx Intl. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -*/ - -// SPDX-License-Identifier: Apache-2.0 - -pragma solidity ^0.7.3; -pragma experimental ABIEncoderV2; - -import "./LibFixedMath.sol"; - -library LibCobbDouglas { - /// @dev The cobb-douglas function used to compute fee-based rewards for - /// staking pools in a given epoch. This function does not perform - /// bounds checking on the inputs, but the following conditions - /// need to be true: - /// 0 <= fees / totalFees <= 1 - /// 0 <= stake / totalStake <= 1 - /// 0 <= alphaNumerator / alphaDenominator <= 1 - /// @param totalRewards collected over an epoch. - /// @param fees Fees attributed to the the staking pool. - /// @param totalFees Total fees collected across all pools that earned rewards. - /// @param stake Stake attributed to the staking pool. - /// @param totalStake Total stake across all pools that earned rewards. - /// @param alphaNumerator Numerator of `alpha` in the cobb-douglas function. - /// @param alphaDenominator Denominator of `alpha` in the cobb-douglas - /// function. - /// @return rewards Rewards owed to the staking pool. - function cobbDouglas( - uint256 totalRewards, - uint256 fees, - uint256 totalFees, - uint256 stake, - uint256 totalStake, - uint32 alphaNumerator, - uint32 alphaDenominator - ) public pure returns (uint256 rewards) { - int256 feeRatio = LibFixedMath.toFixed(fees, totalFees); - int256 stakeRatio = LibFixedMath.toFixed(stake, totalStake); - if (feeRatio == 0 || stakeRatio == 0) { - return rewards = 0; - } - // The cobb-doublas function has the form: - // `totalRewards * feeRatio ^ alpha * stakeRatio ^ (1-alpha)` - // This is equivalent to: - // `totalRewards * stakeRatio * e^(alpha * (ln(feeRatio / stakeRatio)))` - // However, because `ln(x)` has the domain of `0 < x < 1` - // and `exp(x)` has the domain of `x < 0`, - // and fixed-point math easily overflows with multiplication, - // we will choose the following if `stakeRatio > feeRatio`: - // `totalRewards * stakeRatio / e^(alpha * (ln(stakeRatio / feeRatio)))` - - // Compute - // `e^(alpha * ln(feeRatio/stakeRatio))` if feeRatio <= stakeRatio - // or - // `e^(alpa * ln(stakeRatio/feeRatio))` if feeRatio > stakeRatio - int256 n = feeRatio <= stakeRatio - ? LibFixedMath.div(feeRatio, stakeRatio) - : LibFixedMath.div(stakeRatio, feeRatio); - n = LibFixedMath.exp( - LibFixedMath.mulDiv( - LibFixedMath.ln(n), - int256(alphaNumerator), - int256(alphaDenominator) - ) - ); - // Compute - // `totalRewards * n` if feeRatio <= stakeRatio - // or - // `totalRewards / n` if stakeRatio > feeRatio - // depending on the choice we made earlier. - n = feeRatio <= stakeRatio - ? LibFixedMath.mul(stakeRatio, n) - : LibFixedMath.div(stakeRatio, n); - // Multiply the above with totalRewards. - rewards = LibFixedMath.uintMul(n, totalRewards); - } -} diff --git a/contracts/staking/libs/LibFixedMath.sol b/contracts/staking/libs/LibFixedMath.sol deleted file mode 100644 index 91c3c772c..000000000 --- a/contracts/staking/libs/LibFixedMath.sol +++ /dev/null @@ -1,413 +0,0 @@ -/* - - Copyright 2017 Bprotocol Foundation, 2019 ZeroEx Intl. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -*/ - -// SPDX-License-Identifier: Apache-2.0 - -pragma solidity ^0.7.3; - -// solhint-disable indent -/// @dev Signed, fixed-point, 127-bit precision math library. -library LibFixedMath { - // 1 - int256 private constant FIXED_1 = int256( - 0x0000000000000000000000000000000080000000000000000000000000000000 - ); - // 2**255 - int256 private constant MIN_FIXED_VAL = int256( - 0x8000000000000000000000000000000000000000000000000000000000000000 - ); - // 1^2 (in fixed-point) - int256 private constant FIXED_1_SQUARED = int256( - 0x4000000000000000000000000000000000000000000000000000000000000000 - ); - // 1 - int256 private constant LN_MAX_VAL = FIXED_1; - // e ^ -63.875 - int256 private constant LN_MIN_VAL = int256( - 0x0000000000000000000000000000000000000000000000000000000733048c5a - ); - // 0 - int256 private constant EXP_MAX_VAL = 0; - // -63.875 - int256 private constant EXP_MIN_VAL = -int256( - 0x0000000000000000000000000000001ff0000000000000000000000000000000 - ); - - /// @dev Get one as a fixed-point number. - function one() internal pure returns (int256 f) { - f = FIXED_1; - } - - /// @dev Returns the addition of two fixed point numbers, reverting on overflow. - function add(int256 a, int256 b) internal pure returns (int256 c) { - c = _add(a, b); - } - - /// @dev Returns the addition of two fixed point numbers, reverting on overflow. - function sub(int256 a, int256 b) internal pure returns (int256 c) { - if (b == MIN_FIXED_VAL) { - revert("out-of-bounds"); - } - c = _add(a, -b); - } - - /// @dev Returns the multiplication of two fixed point numbers, reverting on overflow. - function mul(int256 a, int256 b) internal pure returns (int256 c) { - c = _mul(a, b) / FIXED_1; - } - - /// @dev Returns the division of two fixed point numbers. - function div(int256 a, int256 b) internal pure returns (int256 c) { - c = _div(_mul(a, FIXED_1), b); - } - - /// @dev Performs (a * n) / d, without scaling for precision. - function mulDiv( - int256 a, - int256 n, - int256 d - ) internal pure returns (int256 c) { - c = _div(_mul(a, n), d); - } - - /// @dev Returns the unsigned integer result of multiplying a fixed-point - /// number with an integer, reverting if the multiplication overflows. - /// Negative results are clamped to zero. - function uintMul(int256 f, uint256 u) internal pure returns (uint256) { - if (int256(u) < int256(0)) { - revert("out-of-bounds"); - } - int256 c = _mul(f, int256(u)); - if (c <= 0) { - return 0; - } - return uint256(uint256(c) >> 127); - } - - /// @dev Returns the absolute value of a fixed point number. - function abs(int256 f) internal pure returns (int256 c) { - if (f == MIN_FIXED_VAL) { - revert("out-of-bounds"); - } - if (f >= 0) { - c = f; - } else { - c = -f; - } - } - - /// @dev Returns 1 / `x`, where `x` is a fixed-point number. - function invert(int256 f) internal pure returns (int256 c) { - c = _div(FIXED_1_SQUARED, f); - } - - /// @dev Convert signed `n` / 1 to a fixed-point number. - function toFixed(int256 n) internal pure returns (int256 f) { - f = _mul(n, FIXED_1); - } - - /// @dev Convert signed `n` / `d` to a fixed-point number. - function toFixed(int256 n, int256 d) internal pure returns (int256 f) { - f = _div(_mul(n, FIXED_1), d); - } - - /// @dev Convert unsigned `n` / 1 to a fixed-point number. - /// Reverts if `n` is too large to fit in a fixed-point number. - function toFixed(uint256 n) internal pure returns (int256 f) { - if (int256(n) < int256(0)) { - revert("out-of-bounds"); - } - f = _mul(int256(n), FIXED_1); - } - - /// @dev Convert unsigned `n` / `d` to a fixed-point number. - /// Reverts if `n` / `d` is too large to fit in a fixed-point number. - function toFixed(uint256 n, uint256 d) internal pure returns (int256 f) { - if (int256(n) < int256(0)) { - revert("out-of-bounds"); - } - if (int256(d) < int256(0)) { - revert("out-of-bounds"); - } - f = _div(_mul(int256(n), FIXED_1), int256(d)); - } - - /// @dev Convert a fixed-point number to an integer. - function toInteger(int256 f) internal pure returns (int256 n) { - return f / FIXED_1; - } - - /// @dev Get the natural logarithm of a fixed-point number 0 < `x` <= LN_MAX_VAL - function ln(int256 x) internal pure returns (int256 r) { - if (x > LN_MAX_VAL) { - revert("out-of-bounds"); - } - if (x <= 0) { - revert("too-small"); - } - if (x == FIXED_1) { - return 0; - } - if (x <= LN_MIN_VAL) { - return EXP_MIN_VAL; - } - - int256 y; - int256 z; - int256 w; - - // Rewrite the input as a quotient of negative natural exponents and a single residual q, such that 1 < q < 2 - // For example: log(0.3) = log(e^-1 * e^-0.25 * 1.0471028872385522) - // = 1 - 0.25 - log(1 + 0.0471028872385522) - // e ^ -32 - if (x <= int256(0x00000000000000000000000000000000000000000001c8464f76164760000000)) { - r -= int256(0x0000000000000000000000000000001000000000000000000000000000000000); // - 32 - x = - (x * FIXED_1) / - int256(0x00000000000000000000000000000000000000000001c8464f76164760000000); // / e ^ -32 - } - // e ^ -16 - if (x <= int256(0x00000000000000000000000000000000000000f1aaddd7742e90000000000000)) { - r -= int256(0x0000000000000000000000000000000800000000000000000000000000000000); // - 16 - x = - (x * FIXED_1) / - int256(0x00000000000000000000000000000000000000f1aaddd7742e90000000000000); // / e ^ -16 - } - // e ^ -8 - if (x <= int256(0x00000000000000000000000000000000000afe10820813d78000000000000000)) { - r -= int256(0x0000000000000000000000000000000400000000000000000000000000000000); // - 8 - x = - (x * FIXED_1) / - int256(0x00000000000000000000000000000000000afe10820813d78000000000000000); // / e ^ -8 - } - // e ^ -4 - if (x <= int256(0x0000000000000000000000000000000002582ab704279ec00000000000000000)) { - r -= int256(0x0000000000000000000000000000000200000000000000000000000000000000); // - 4 - x = - (x * FIXED_1) / - int256(0x0000000000000000000000000000000002582ab704279ec00000000000000000); // / e ^ -4 - } - // e ^ -2 - if (x <= int256(0x000000000000000000000000000000001152aaa3bf81cc000000000000000000)) { - r -= int256(0x0000000000000000000000000000000100000000000000000000000000000000); // - 2 - x = - (x * FIXED_1) / - int256(0x000000000000000000000000000000001152aaa3bf81cc000000000000000000); // / e ^ -2 - } - // e ^ -1 - if (x <= int256(0x000000000000000000000000000000002f16ac6c59de70000000000000000000)) { - r -= int256(0x0000000000000000000000000000000080000000000000000000000000000000); // - 1 - x = - (x * FIXED_1) / - int256(0x000000000000000000000000000000002f16ac6c59de70000000000000000000); // / e ^ -1 - } - // e ^ -0.5 - if (x <= int256(0x000000000000000000000000000000004da2cbf1be5828000000000000000000)) { - r -= int256(0x0000000000000000000000000000000040000000000000000000000000000000); // - 0.5 - x = - (x * FIXED_1) / - int256(0x000000000000000000000000000000004da2cbf1be5828000000000000000000); // / e ^ -0.5 - } - // e ^ -0.25 - if (x <= int256(0x0000000000000000000000000000000063afbe7ab2082c000000000000000000)) { - r -= int256(0x0000000000000000000000000000000020000000000000000000000000000000); // - 0.25 - x = - (x * FIXED_1) / - int256(0x0000000000000000000000000000000063afbe7ab2082c000000000000000000); // / e ^ -0.25 - } - // e ^ -0.125 - if (x <= int256(0x0000000000000000000000000000000070f5a893b608861e1f58934f97aea57d)) { - r -= int256(0x0000000000000000000000000000000010000000000000000000000000000000); // - 0.125 - x = - (x * FIXED_1) / - int256(0x0000000000000000000000000000000070f5a893b608861e1f58934f97aea57d); // / e ^ -0.125 - } - // `x` is now our residual in the range of 1 <= x <= 2 (or close enough). - - // Add the taylor series for log(1 + z), where z = x - 1 - z = y = x - FIXED_1; - w = (y * y) / FIXED_1; - r += (z * (0x100000000000000000000000000000000 - y)) / 0x100000000000000000000000000000000; - z = (z * w) / FIXED_1; // add y^01 / 01 - y^02 / 02 - r += (z * (0x0aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - y)) / 0x200000000000000000000000000000000; - z = (z * w) / FIXED_1; // add y^03 / 03 - y^04 / 04 - r += (z * (0x099999999999999999999999999999999 - y)) / 0x300000000000000000000000000000000; - z = (z * w) / FIXED_1; // add y^05 / 05 - y^06 / 06 - r += (z * (0x092492492492492492492492492492492 - y)) / 0x400000000000000000000000000000000; - z = (z * w) / FIXED_1; // add y^07 / 07 - y^08 / 08 - r += (z * (0x08e38e38e38e38e38e38e38e38e38e38e - y)) / 0x500000000000000000000000000000000; - z = (z * w) / FIXED_1; // add y^09 / 09 - y^10 / 10 - r += (z * (0x08ba2e8ba2e8ba2e8ba2e8ba2e8ba2e8b - y)) / 0x600000000000000000000000000000000; - z = (z * w) / FIXED_1; // add y^11 / 11 - y^12 / 12 - r += (z * (0x089d89d89d89d89d89d89d89d89d89d89 - y)) / 0x700000000000000000000000000000000; - z = (z * w) / FIXED_1; // add y^13 / 13 - y^14 / 14 - r += (z * (0x088888888888888888888888888888888 - y)) / 0x800000000000000000000000000000000; // add y^15 / 15 - y^16 / 16 - } - - /// @dev Compute the natural exponent for a fixed-point number EXP_MIN_VAL <= `x` <= 1 - function exp(int256 x) internal pure returns (int256 r) { - if (x < EXP_MIN_VAL) { - // Saturate to zero below EXP_MIN_VAL. - return 0; - } - if (x == 0) { - return FIXED_1; - } - if (x > EXP_MAX_VAL) { - revert("out-of-bounds"); - } - - // Rewrite the input as a product of natural exponents and a - // single residual q, where q is a number of small magnitude. - // For example: e^-34.419 = e^(-32 - 2 - 0.25 - 0.125 - 0.044) - // = e^-32 * e^-2 * e^-0.25 * e^-0.125 * e^-0.044 - // -> q = -0.044 - - // Multiply with the taylor series for e^q - int256 y; - int256 z; - // q = x % 0.125 (the residual) - z = y = x % 0x0000000000000000000000000000000010000000000000000000000000000000; - z = (z * y) / FIXED_1; - r += z * 0x10e1b3be415a0000; // add y^02 * (20! / 02!) - z = (z * y) / FIXED_1; - r += z * 0x05a0913f6b1e0000; // add y^03 * (20! / 03!) - z = (z * y) / FIXED_1; - r += z * 0x0168244fdac78000; // add y^04 * (20! / 04!) - z = (z * y) / FIXED_1; - r += z * 0x004807432bc18000; // add y^05 * (20! / 05!) - z = (z * y) / FIXED_1; - r += z * 0x000c0135dca04000; // add y^06 * (20! / 06!) - z = (z * y) / FIXED_1; - r += z * 0x0001b707b1cdc000; // add y^07 * (20! / 07!) - z = (z * y) / FIXED_1; - r += z * 0x000036e0f639b800; // add y^08 * (20! / 08!) - z = (z * y) / FIXED_1; - r += z * 0x00000618fee9f800; // add y^09 * (20! / 09!) - z = (z * y) / FIXED_1; - r += z * 0x0000009c197dcc00; // add y^10 * (20! / 10!) - z = (z * y) / FIXED_1; - r += z * 0x0000000e30dce400; // add y^11 * (20! / 11!) - z = (z * y) / FIXED_1; - r += z * 0x000000012ebd1300; // add y^12 * (20! / 12!) - z = (z * y) / FIXED_1; - r += z * 0x0000000017499f00; // add y^13 * (20! / 13!) - z = (z * y) / FIXED_1; - r += z * 0x0000000001a9d480; // add y^14 * (20! / 14!) - z = (z * y) / FIXED_1; - r += z * 0x00000000001c6380; // add y^15 * (20! / 15!) - z = (z * y) / FIXED_1; - r += z * 0x000000000001c638; // add y^16 * (20! / 16!) - z = (z * y) / FIXED_1; - r += z * 0x0000000000001ab8; // add y^17 * (20! / 17!) - z = (z * y) / FIXED_1; - r += z * 0x000000000000017c; // add y^18 * (20! / 18!) - z = (z * y) / FIXED_1; - r += z * 0x0000000000000014; // add y^19 * (20! / 19!) - z = (z * y) / FIXED_1; - r += z * 0x0000000000000001; // add y^20 * (20! / 20!) - r = r / 0x21c3677c82b40000 + y + FIXED_1; // divide by 20! and then add y^1 / 1! + y^0 / 0! - - // Multiply with the non-residual terms. - x = -x; - // e ^ -32 - if ((x & int256(0x0000000000000000000000000000001000000000000000000000000000000000)) != 0) { - r = - (r * int256(0x00000000000000000000000000000000000000f1aaddd7742e56d32fb9f99744)) / - int256(0x0000000000000000000000000043cbaf42a000812488fc5c220ad7b97bf6e99e); // * e ^ -32 - } - // e ^ -16 - if ((x & int256(0x0000000000000000000000000000000800000000000000000000000000000000)) != 0) { - r = - (r * int256(0x00000000000000000000000000000000000afe10820813d65dfe6a33c07f738f)) / - int256(0x000000000000000000000000000005d27a9f51c31b7c2f8038212a0574779991); // * e ^ -16 - } - // e ^ -8 - if ((x & int256(0x0000000000000000000000000000000400000000000000000000000000000000)) != 0) { - r = - (r * int256(0x0000000000000000000000000000000002582ab704279e8efd15e0265855c47a)) / - int256(0x0000000000000000000000000000001b4c902e273a58678d6d3bfdb93db96d02); // * e ^ -8 - } - // e ^ -4 - if ((x & int256(0x0000000000000000000000000000000200000000000000000000000000000000)) != 0) { - r = - (r * int256(0x000000000000000000000000000000001152aaa3bf81cb9fdb76eae12d029571)) / - int256(0x00000000000000000000000000000003b1cc971a9bb5b9867477440d6d157750); // * e ^ -4 - } - // e ^ -2 - if ((x & int256(0x0000000000000000000000000000000100000000000000000000000000000000)) != 0) { - r = - (r * int256(0x000000000000000000000000000000002f16ac6c59de6f8d5d6f63c1482a7c86)) / - int256(0x000000000000000000000000000000015bf0a8b1457695355fb8ac404e7a79e3); // * e ^ -2 - } - // e ^ -1 - if ((x & int256(0x0000000000000000000000000000000080000000000000000000000000000000)) != 0) { - r = - (r * int256(0x000000000000000000000000000000004da2cbf1be5827f9eb3ad1aa9866ebb3)) / - int256(0x00000000000000000000000000000000d3094c70f034de4b96ff7d5b6f99fcd8); // * e ^ -1 - } - // e ^ -0.5 - if ((x & int256(0x0000000000000000000000000000000040000000000000000000000000000000)) != 0) { - r = - (r * int256(0x0000000000000000000000000000000063afbe7ab2082ba1a0ae5e4eb1b479dc)) / - int256(0x00000000000000000000000000000000a45af1e1f40c333b3de1db4dd55f29a7); // * e ^ -0.5 - } - // e ^ -0.25 - if ((x & int256(0x0000000000000000000000000000000020000000000000000000000000000000)) != 0) { - r = - (r * int256(0x0000000000000000000000000000000070f5a893b608861e1f58934f97aea57d)) / - int256(0x00000000000000000000000000000000910b022db7ae67ce76b441c27035c6a1); // * e ^ -0.25 - } - // e ^ -0.125 - if ((x & int256(0x0000000000000000000000000000000010000000000000000000000000000000)) != 0) { - r = - (r * int256(0x00000000000000000000000000000000783eafef1c0a8f3978c7f81824d62ebf)) / - int256(0x0000000000000000000000000000000088415abbe9a76bead8d00cf112e4d4a8); // * e ^ -0.125 - } - } - - /// @dev Returns the multiplication two numbers, reverting on overflow. - function _mul(int256 a, int256 b) private pure returns (int256 c) { - if (a == 0) { - return 0; - } - c = a * b; - if (c / a != b || c / b != a) { - revert("overflow"); - } - } - - /// @dev Returns the division of two numbers, reverting on division by zero. - function _div(int256 a, int256 b) private pure returns (int256 c) { - if (b == 0) { - revert("overflow"); - } - if (a == MIN_FIXED_VAL && b == -1) { - revert("overflow"); - } - c = a / b; - } - - /// @dev Adds two numbers, reverting on overflow. - function _add(int256 a, int256 b) private pure returns (int256 c) { - c = a + b; - if ((a < 0 && b < 0 && c > a) || (a > 0 && b > 0 && c < a)) { - revert("overflow"); - } - } -} diff --git a/contracts/staking/libs/MathUtils.sol b/contracts/staking/libs/MathUtils.sol deleted file mode 100644 index d0953ba2a..000000000 --- a/contracts/staking/libs/MathUtils.sol +++ /dev/null @@ -1,45 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.7.3; - -import "@openzeppelin/contracts/math/SafeMath.sol"; - -/** - * @title MathUtils Library - * @notice A collection of functions to perform math operations - */ -library MathUtils { - using SafeMath for uint256; - - /** - * @dev Calculates the weighted average of two values pondering each of these - * values based on configured weights. The contribution of each value N is - * weightN/(weightA + weightB). - * @param valueA The amount for value A - * @param weightA The weight to use for value A - * @param valueB The amount for value B - * @param weightB The weight to use for value B - */ - function weightedAverage( - uint256 valueA, - uint256 weightA, - uint256 valueB, - uint256 weightB - ) internal pure returns (uint256) { - return valueA.mul(weightA).add(valueB.mul(weightB)).div(weightA.add(weightB)); - } - - /** - * @dev Returns the minimum of two numbers. - */ - function min(uint256 x, uint256 y) internal pure returns (uint256) { - return x <= y ? x : y; - } - - /** - * @dev Returns the difference between two numbers or zero if negative. - */ - function diffOrZero(uint256 x, uint256 y) internal pure returns (uint256) { - return (x > y) ? x.sub(y) : 0; - } -} diff --git a/contracts/staking/libs/Rebates.sol b/contracts/staking/libs/Rebates.sol deleted file mode 100644 index 4c5341ffa..000000000 --- a/contracts/staking/libs/Rebates.sol +++ /dev/null @@ -1,113 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.7.3; -pragma experimental ABIEncoderV2; - -import "@openzeppelin/contracts/math/SafeMath.sol"; - -import "./Cobbs.sol"; - -/** - * @title A collection of data structures and functions to manage Rebates - * Used for low-level state changes, require() conditions should be evaluated - * at the caller function scope. - */ -library Rebates { - using SafeMath for uint256; - - // Tracks stats for allocations closed on a particular epoch for claiming - // The pool also keeps tracks of total query fees collected and stake used - // Only one rebate pool exists per epoch - struct Pool { - uint256 fees; // total query fees in the rebate pool - uint256 effectiveAllocatedStake; // total effective allocation of stake - uint256 claimedRewards; // total claimed rewards from the rebate pool - uint32 unclaimedAllocationsCount; // amount of unclaimed allocations - uint32 alphaNumerator; // numerator of `alpha` in the cobb-douglas function - uint32 alphaDenominator; // denominator of `alpha` in the cobb-douglas function - } - - /** - * @dev Init the rebate pool with the rebate ratio. - * @param _alphaNumerator Numerator of `alpha` in the cobb-douglas function - * @param _alphaDenominator Denominator of `alpha` in the cobb-douglas function - */ - function init( - Rebates.Pool storage pool, - uint32 _alphaNumerator, - uint32 _alphaDenominator - ) internal { - pool.alphaNumerator = _alphaNumerator; - pool.alphaDenominator = _alphaDenominator; - } - - /** - * @dev Return true if the rebate pool was already initialized. - */ - function exists(Rebates.Pool storage pool) internal view returns (bool) { - return pool.effectiveAllocatedStake > 0; - } - - /** - * @dev Return the amount of unclaimed fees. - */ - function unclaimedFees(Rebates.Pool storage pool) internal view returns (uint256) { - return pool.fees.sub(pool.claimedRewards); - } - - /** - * @dev Deposit tokens into the rebate pool. - * @param _indexerFees Amount of fees collected in tokens - * @param _indexerEffectiveAllocatedStake Effective stake allocated by indexer for a period of epochs - */ - function addToPool( - Rebates.Pool storage pool, - uint256 _indexerFees, - uint256 _indexerEffectiveAllocatedStake - ) internal { - pool.fees = pool.fees.add(_indexerFees); - pool.effectiveAllocatedStake = pool.effectiveAllocatedStake.add( - _indexerEffectiveAllocatedStake - ); - pool.unclaimedAllocationsCount += 1; - } - - /** - * @dev Redeem tokens from the rebate pool. - * @param _indexerFees Amount of fees collected in tokens - * @param _indexerEffectiveAllocatedStake Effective stake allocated by indexer for a period of epochs - * @return Amount of reward tokens according to Cobb-Douglas rebate formula - */ - function redeem( - Rebates.Pool storage pool, - uint256 _indexerFees, - uint256 _indexerEffectiveAllocatedStake - ) internal returns (uint256) { - uint256 rebateReward = 0; - - // Calculate the rebate rewards for the indexer - if (pool.fees > 0) { - rebateReward = LibCobbDouglas.cobbDouglas( - pool.fees, // totalRewards - _indexerFees, - pool.fees, - _indexerEffectiveAllocatedStake, - pool.effectiveAllocatedStake, - pool.alphaNumerator, - pool.alphaDenominator - ); - - // Under NO circumstance we will reward more than total fees in the pool - uint256 _unclaimedFees = pool.fees.sub(pool.claimedRewards); - if (rebateReward > _unclaimedFees) { - rebateReward = _unclaimedFees; - } - } - - // Update pool state - pool.unclaimedAllocationsCount -= 1; - pool.claimedRewards = pool.claimedRewards.add(rebateReward); - - return rebateReward; - } -} diff --git a/contracts/staking/libs/Stakes.sol b/contracts/staking/libs/Stakes.sol deleted file mode 100644 index 9cfc99337..000000000 --- a/contracts/staking/libs/Stakes.sol +++ /dev/null @@ -1,196 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.7.3; -pragma experimental ABIEncoderV2; - -import "@openzeppelin/contracts/math/SafeMath.sol"; - -import "./MathUtils.sol"; - -/** - * @title A collection of data structures and functions to manage the Indexer Stake state. - * Used for low-level state changes, require() conditions should be evaluated - * at the caller function scope. - */ -library Stakes { - using SafeMath for uint256; - using Stakes for Stakes.Indexer; - - struct Indexer { - uint256 tokensStaked; // Tokens on the indexer stake (staked by the indexer) - uint256 tokensAllocated; // Tokens used in allocations - uint256 tokensLocked; // Tokens locked for withdrawal subject to thawing period - uint256 tokensLockedUntil; // Block when locked tokens can be withdrawn - } - - /** - * @dev Deposit tokens to the indexer stake. - * @param stake Stake data - * @param _tokens Amount of tokens to deposit - */ - function deposit(Stakes.Indexer storage stake, uint256 _tokens) internal { - stake.tokensStaked = stake.tokensStaked.add(_tokens); - } - - /** - * @dev Release tokens from the indexer stake. - * @param stake Stake data - * @param _tokens Amount of tokens to release - */ - function release(Stakes.Indexer storage stake, uint256 _tokens) internal { - stake.tokensStaked = stake.tokensStaked.sub(_tokens); - } - - /** - * @dev Allocate tokens from the main stack to a SubgraphDeployment. - * @param stake Stake data - * @param _tokens Amount of tokens to allocate - */ - function allocate(Stakes.Indexer storage stake, uint256 _tokens) internal { - stake.tokensAllocated = stake.tokensAllocated.add(_tokens); - } - - /** - * @dev Unallocate tokens from a SubgraphDeployment back to the main stack. - * @param stake Stake data - * @param _tokens Amount of tokens to unallocate - */ - function unallocate(Stakes.Indexer storage stake, uint256 _tokens) internal { - stake.tokensAllocated = stake.tokensAllocated.sub(_tokens); - } - - /** - * @dev Lock tokens until a thawing period pass. - * @param stake Stake data - * @param _tokens Amount of tokens to unstake - * @param _period Period in blocks that need to pass before withdrawal - */ - function lockTokens( - Stakes.Indexer storage stake, - uint256 _tokens, - uint256 _period - ) internal { - // Take into account period averaging for multiple unstake requests - uint256 lockingPeriod = _period; - if (stake.tokensLocked > 0) { - lockingPeriod = MathUtils.weightedAverage( - MathUtils.diffOrZero(stake.tokensLockedUntil, block.number), // Remaining thawing period - stake.tokensLocked, // Weighted by remaining unstaked tokens - _period, // Thawing period - _tokens // Weighted by new tokens to unstake - ); - } - - // Update balances - stake.tokensLocked = stake.tokensLocked.add(_tokens); - stake.tokensLockedUntil = block.number.add(lockingPeriod); - } - - /** - * @dev Unlock tokens. - * @param stake Stake data - * @param _tokens Amount of tokens to unkock - */ - function unlockTokens(Stakes.Indexer storage stake, uint256 _tokens) internal { - stake.tokensLocked = stake.tokensLocked.sub(_tokens); - if (stake.tokensLocked == 0) { - stake.tokensLockedUntil = 0; - } - } - - /** - * @dev Take all tokens out from the locked stake for withdrawal. - * @param stake Stake data - * @return Amount of tokens being withdrawn - */ - function withdrawTokens(Stakes.Indexer storage stake) internal returns (uint256) { - // Calculate tokens that can be released - uint256 tokensToWithdraw = stake.tokensWithdrawable(); - - if (tokensToWithdraw > 0) { - // Reset locked tokens - stake.unlockTokens(tokensToWithdraw); - - // Decrease indexer stake - stake.release(tokensToWithdraw); - } - - return tokensToWithdraw; - } - - /** - * @dev Return the amount of tokens used in allocations and locked for withdrawal. - * @param stake Stake data - * @return Token amount - */ - function tokensUsed(Stakes.Indexer memory stake) internal pure returns (uint256) { - return stake.tokensAllocated.add(stake.tokensLocked); - } - - /** - * @dev Return the amount of tokens staked not considering the ones that are already going - * through the thawing period or are ready for withdrawal. We call it secure stake because - * it is not subject to change by a withdraw call from the indexer. - * @param stake Stake data - * @return Token amount - */ - function tokensSecureStake(Stakes.Indexer memory stake) internal pure returns (uint256) { - return stake.tokensStaked.sub(stake.tokensLocked); - } - - /** - * @dev Tokens free balance on the indexer stake that can be used for any purpose. - * Any token that is allocated cannot be used as well as tokens that are going through the - * thawing period or are withdrawable - * Calc: tokensStaked - tokensAllocated - tokensLocked - * @param stake Stake data - * @return Token amount - */ - function tokensAvailable(Stakes.Indexer memory stake) internal pure returns (uint256) { - return stake.tokensAvailableWithDelegation(0); - } - - /** - * @dev Tokens free balance on the indexer stake that can be used for allocations. - * This function accepts a parameter for extra delegated capacity that takes into - * account delegated tokens - * @param stake Stake data - * @param _delegatedCapacity Amount of tokens used from delegators to calculate availability - * @return Token amount - */ - function tokensAvailableWithDelegation(Stakes.Indexer memory stake, uint256 _delegatedCapacity) - internal - pure - returns (uint256) - { - uint256 tokensCapacity = stake.tokensStaked.add(_delegatedCapacity); - uint256 _tokensUsed = stake.tokensUsed(); - // If more tokens are used than the current capacity, the indexer is overallocated. - // This means the indexer doesn't have available capacity to create new allocations. - // We can reach this state when the indexer has funds allocated and then any - // of these conditions happen: - // - The delegationCapacity ratio is reduced. - // - The indexer stake is slashed. - // - A delegator removes enough stake. - if (_tokensUsed > tokensCapacity) { - // Indexer stake is over allocated: return 0 to avoid stake to be used until - // the overallocation is restored by staking more tokens, unallocating tokens - // or using more delegated funds - return 0; - } - return tokensCapacity.sub(_tokensUsed); - } - - /** - * @dev Tokens available for withdrawal after thawing period. - * @param stake Stake data - * @return Token amount - */ - function tokensWithdrawable(Stakes.Indexer memory stake) internal view returns (uint256) { - // No tokens to withdraw before locking period - if (stake.tokensLockedUntil == 0 || block.number < stake.tokensLockedUntil) { - return 0; - } - return stake.tokensLocked; - } -} diff --git a/contracts/statechannels/AllocationExchange.sol b/contracts/statechannels/AllocationExchange.sol deleted file mode 100644 index c98c79691..000000000 --- a/contracts/statechannels/AllocationExchange.sol +++ /dev/null @@ -1,155 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.7.3; -pragma experimental ABIEncoderV2; - -import "@openzeppelin/contracts/cryptography/ECDSA.sol"; - -import "../governance/Governed.sol"; -import "../staking/IStaking.sol"; -import "../token/IGraphToken.sol"; - -/** - * @title Allocation Exchange - * @dev This contract holds tokens that anyone with a voucher signed by the - * authority can redeem. The contract validates if the voucher presented is valid - * and then sends tokens to the Staking contract by calling the collect() function - * passing the voucher allocationID. The contract enforces that only one voucher for - * an allocationID can be redeemed. - * Only governance can change the authority. - */ -contract AllocationExchange is Governed { - // An allocation voucher represents a signed message that allows - // redeeming an amount of funds from this contract and collect - // them as part of an allocation - struct AllocationVoucher { - address allocationID; - uint256 amount; - bytes signature; // 65 bytes - } - - // -- Constants -- - - uint256 private constant MAX_UINT256 = 2**256 - 1; - uint256 private constant SIGNATURE_LENGTH = 65; - - // -- State -- - - IStaking private immutable staking; - IGraphToken private immutable graphToken; - address public authority; - mapping(address => bool) public allocationsRedeemed; - - // -- Events - - event AuthoritySet(address indexed account); - event AllocationRedeemed(address indexed allocationID, uint256 amount); - event TokensWithdrawn(address indexed to, uint256 amount); - - // -- Functions - - constructor( - IGraphToken _graphToken, - IStaking _staking, - address _governor, - address _authority - ) { - Governed._initialize(_governor); - - graphToken = _graphToken; - staking = _staking; - _setAuthority(_authority); - } - - /** - * @notice Approve the staking contract to pull any amount of tokens from this contract. - * @dev Increased gas efficiency instead of approving on each voucher redeem - */ - function approveAll() external { - graphToken.approve(address(staking), MAX_UINT256); - } - - /** - * @notice Withdraw tokens held in the contract. - * @dev Only the governor can withdraw - * @param _to Destination to send the tokens - * @param _amount Amount of tokens to withdraw - */ - function withdraw(address _to, uint256 _amount) external onlyGovernor { - require(_to != address(0), "Exchange: empty destination"); - require(_amount != 0, "Exchange: empty amount"); - require(graphToken.transfer(_to, _amount), "Exchange: cannot transfer"); - emit TokensWithdrawn(_to, _amount); - } - - /** - * @notice Set the authority allowed to sign vouchers. - * @dev Only the governor can set the authority - * @param _authority Address of the signing authority - */ - function setAuthority(address _authority) external onlyGovernor { - _setAuthority(_authority); - } - - /** - * @notice Set the authority allowed to sign vouchers. - * @param _authority Address of the signing authority - */ - function _setAuthority(address _authority) private { - require(_authority != address(0), "Exchange: empty authority"); - authority = _authority; - emit AuthoritySet(authority); - } - - /** - * @notice Redeem a voucher signed by the authority. No voucher double spending is allowed. - * @dev The voucher must be signed using an Ethereum signed message - * @param _voucher Voucher data - */ - function redeem(AllocationVoucher memory _voucher) external { - _redeem(_voucher); - } - - /** - * @notice Redeem multiple vouchers. - * @dev Each voucher must be signed using an Ethereum signed message - * @param _vouchers An array of vouchers - */ - function redeemMany(AllocationVoucher[] memory _vouchers) external { - for (uint256 i = 0; i < _vouchers.length; i++) { - _redeem(_vouchers[i]); - } - } - - /** - * @notice Redeem a voucher signed by the authority. No voucher double spending is allowed. - * @dev The voucher must be signed using an Ethereum signed message - * @param _voucher Voucher data - */ - function _redeem(AllocationVoucher memory _voucher) private { - require(_voucher.amount > 0, "Exchange: zero tokens voucher"); - require(_voucher.signature.length == SIGNATURE_LENGTH, "Exchange: invalid signature"); - - // Already redeemed check - require( - !allocationsRedeemed[_voucher.allocationID], - "Exchange: allocation already redeemed" - ); - - // Signature check - bytes32 messageHash = keccak256(abi.encodePacked(_voucher.allocationID, _voucher.amount)); - require( - authority == ECDSA.recover(messageHash, _voucher.signature), - "Exchange: invalid signer" - ); - - // Mark allocation as collected - allocationsRedeemed[_voucher.allocationID] = true; - - // Make the staking contract collect funds from this contract - // The Staking contract will validate if the allocation is valid - staking.collect(_voucher.amount, _voucher.allocationID); - - emit AllocationRedeemed(_voucher.allocationID, _voucher.amount); - } -} diff --git a/contracts/statechannels/GRTWithdrawHelper.sol b/contracts/statechannels/GRTWithdrawHelper.sol deleted file mode 100644 index c34b66558..000000000 --- a/contracts/statechannels/GRTWithdrawHelper.sol +++ /dev/null @@ -1,97 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.7.3; -pragma experimental ABIEncoderV2; - -import "../token/IGraphToken.sol"; - -import "./WithdrawHelper.sol"; - -/** - * @title WithdrawHelper contract for GRT tokens - * @notice This contract encodes the logic that connects the transfer of funds from a - * Channel Multisig to the protocol in the context of a withdrawal. - * A Channel Multisig will atomically transfer the tokens to the WithdrawHelper and then - * these tokens will get pulled from the Staking contract using the `allocationID` passed - * in the `callData` of the WithdrawCommitment. - * Tokens transferred are associated to a particular allocation in the Staking contract. - * This contract is not meant to hold funds, as they can be stolen by presenting a - * handcrafted WithdrawalCommitment. - */ -contract GRTWithdrawHelper is WithdrawHelper { - struct CollectData { - address staking; - address allocationID; - address returnAddress; - } - - bytes4 private constant APPROVE_SELECTOR = bytes4(keccak256("approve(address,uint256)")); - bytes4 private constant COLLECT_SELECTOR = bytes4(keccak256("collect(uint256,address)")); - - // -- State -- - - address public immutable tokenAddress; - - /** - * @notice Contract constructor. - * @param _tokenAddress Token address to use for transfers - */ - constructor(address _tokenAddress) { - tokenAddress = _tokenAddress; - } - - /** - * @notice Returns the ABI encoded representation of a CollectData struct. - * @param _collectData CollectData struct with information about how to collect funds - */ - function getCallData(CollectData calldata _collectData) public pure returns (bytes memory) { - return abi.encode(_collectData); - } - - /** - * @notice Execute hook used by a channel to send funds to the protocol. - * @param _wd WithdrawData struct for the withdrawal commitment - * @param _actualAmount Amount to transfer to the Staking contract - */ - function execute(WithdrawData calldata _wd, uint256 _actualAmount) external override { - require(_wd.assetId == tokenAddress, "GRTWithdrawHelper: !token"); - - // Decode and validate collect data - CollectData memory collectData = abi.decode(_wd.callData, (CollectData)); - require(collectData.staking != address(0), "GRTWithdrawHelper: !staking"); - require(collectData.allocationID != address(0), "GRTWithdrawHelper: !allocationID"); - require(collectData.returnAddress != address(0), "GRTWithdrawHelper: !returnAddress"); - - // Approve the staking contract to pull the transfer amount - (bool success1, ) = - tokenAddress.call( - abi.encodeWithSelector(APPROVE_SELECTOR, collectData.staking, _actualAmount) - ); - - // If the call fails return the funds to the return address and bail - if (!success1) { - _sendTokens(collectData.returnAddress, _actualAmount); - return; - } - - // Call the Staking contract to collect funds from this contract - (bool success2, ) = - collectData.staking.call( - abi.encodeWithSelector(COLLECT_SELECTOR, _actualAmount, collectData.allocationID) - ); - - // If the call fails return the funds to the return address - if (!success2) { - _sendTokens(collectData.returnAddress, _actualAmount); - } - } - - /** - * @notice Send tokens out of the contract. - * @param _to Destination address - * @param _amount Amount to transfer - */ - function _sendTokens(address _to, uint256 _amount) private { - IGraphToken(tokenAddress).transfer(_to, _amount); - } -} diff --git a/contracts/statechannels/ICMCWithdraw.sol b/contracts/statechannels/ICMCWithdraw.sol deleted file mode 100644 index f45828b50..000000000 --- a/contracts/statechannels/ICMCWithdraw.sol +++ /dev/null @@ -1,24 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED - -pragma solidity ^0.7.3; -pragma experimental ABIEncoderV2; - -struct WithdrawData { - address channelAddress; - address assetId; - address payable recipient; - uint256 amount; - uint256 nonce; - address callTo; - bytes callData; -} - -interface ICMCWithdraw { - function getWithdrawalTransactionRecord(WithdrawData calldata wd) external view returns (bool); - - function withdraw( - WithdrawData calldata wd, - bytes calldata aliceSignature, - bytes calldata bobSignature - ) external; -} diff --git a/contracts/statechannels/WithdrawHelper.sol b/contracts/statechannels/WithdrawHelper.sol deleted file mode 100644 index e36b5f7b9..000000000 --- a/contracts/statechannels/WithdrawHelper.sol +++ /dev/null @@ -1,10 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED - -pragma solidity ^0.7.3; -pragma experimental ABIEncoderV2; - -import "./ICMCWithdraw.sol"; - -interface WithdrawHelper { - function execute(WithdrawData calldata wd, uint256 actualAmount) external; -} diff --git a/contracts/tests/GovernedMock.sol b/contracts/tests/GovernedMock.sol deleted file mode 100644 index 8f127983b..000000000 --- a/contracts/tests/GovernedMock.sol +++ /dev/null @@ -1,14 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.7.3; - -import "../governance/Governed.sol"; - -/** - * @title GovernedMock contract - */ -contract GovernedMock is Governed { - constructor() { - Governed._initialize(msg.sender); - } -} diff --git a/contracts/tests/RebatePoolMock.sol b/contracts/tests/RebatePoolMock.sol deleted file mode 100644 index 9c5fd7c99..000000000 --- a/contracts/tests/RebatePoolMock.sol +++ /dev/null @@ -1,66 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.7.3; -pragma experimental ABIEncoderV2; - -import "../staking/libs/Rebates.sol"; -import "../staking/libs/Cobbs.sol"; - -// Mock contract used for testing rebates -contract RebatePoolMock { - using Rebates for Rebates.Pool; - - // -- State -- - - uint32 public alphaNumerator; - uint32 public alphaDenominator; - - Rebates.Pool public rebatePool; - - // -- Events -- - - event Redeemed(uint256 value); - - // Set the alpha for rebates - function setRebateRatio(uint32 _alphaNumerator, uint32 _alphaDenominator) external { - rebatePool.init(_alphaNumerator, _alphaDenominator); - } - - // Add fees and stake to the rebate pool - function add(uint256 _indexerFees, uint256 _indexerAllocatedStake) external { - rebatePool.addToPool(_indexerFees, _indexerAllocatedStake); - } - - // Remove rewards from rebate pool - function pop(uint256 _indexerFees, uint256 _indexerAllocatedStake) external returns (uint256) { - uint256 value = rebatePool.redeem(_indexerFees, _indexerAllocatedStake); - emit Redeemed(value); - return value; - } - - // Stub to test the cobb-douglas formula directly - function cobbDouglas( - uint256 _totalRewards, - uint256 _fees, - uint256 _totalFees, - uint256 _stake, - uint256 _totalStake, - uint32 _alphaNumerator, - uint32 _alphaDenominator - ) external pure returns (uint256) { - if (_totalFees == 0) { - return 0; - } - - return - LibCobbDouglas.cobbDouglas( - _totalRewards, - _fees, - _totalFees, - _stake, - _totalStake, - _alphaNumerator, - _alphaDenominator - ); - } -} diff --git a/contracts/tests/RewardsManagerMock.sol b/contracts/tests/RewardsManagerMock.sol deleted file mode 100644 index dcc15476c..000000000 --- a/contracts/tests/RewardsManagerMock.sol +++ /dev/null @@ -1,68 +0,0 @@ -pragma solidity ^0.7.3; -pragma experimental ABIEncoderV2; - -// Mock contract used for testing rewards -contract RewardsManagerMock { - /** - * @dev Raises x to the power of n with scaling factor of base. - * Based on: https://github.com/makerdao/dss/blob/master/src/pot.sol#L81 - * @param x Base of the exponentiation - * @param n Exponent - * @param base Scaling factor - * @return z Exponential of n with base x - */ - function pow( - uint256 x, - uint256 n, - uint256 base - ) public pure returns (uint256 z) { - assembly { - switch x - case 0 { - switch n - case 0 { - z := base - } - default { - z := 0 - } - } - default { - switch mod(n, 2) - case 0 { - z := base - } - default { - z := x - } - let half := div(base, 2) // for rounding. - for { - n := div(n, 2) - } n { - n := div(n, 2) - } { - let xx := mul(x, x) - if iszero(eq(div(xx, x), x)) { - revert(0, 0) - } - let xxRound := add(xx, half) - if lt(xxRound, xx) { - revert(0, 0) - } - x := div(xxRound, base) - if mod(n, 2) { - let zx := mul(z, x) - if and(iszero(iszero(x)), iszero(eq(div(zx, x), z))) { - revert(0, 0) - } - let zxRound := add(zx, half) - if lt(zxRound, zx) { - revert(0, 0) - } - z := div(zxRound, base) - } - } - } - } - } -} diff --git a/contracts/tests/ens/IENS.sol b/contracts/tests/ens/IENS.sol deleted file mode 100644 index b109a70f1..000000000 --- a/contracts/tests/ens/IENS.sol +++ /dev/null @@ -1,15 +0,0 @@ -pragma solidity ^0.7.3; - -// Needed for abi and typechain in the npm package -interface IENS { - function owner(bytes32 node) external view returns (address); - - // Must call setRecord, not setOwner, We must namehash it ourselves as well - function setSubnodeRecord( - bytes32 node, - bytes32 label, - address owner, - address resolver, - uint64 ttl - ) external; -} diff --git a/contracts/tests/ens/IPublicResolver.sol b/contracts/tests/ens/IPublicResolver.sol deleted file mode 100644 index 2f1255eac..000000000 --- a/contracts/tests/ens/IPublicResolver.sol +++ /dev/null @@ -1,12 +0,0 @@ -pragma solidity ^0.7.3; - -// Needed for abi and typechain in the npm package -interface IPublicResolver { - function text(bytes32 node, string calldata key) external view returns (string memory); - - function setText( - bytes32 node, - string calldata key, - string calldata value - ) external; -} diff --git a/contracts/tests/testnet/GDAI.sol b/contracts/tests/testnet/GDAI.sol deleted file mode 100644 index b972324ba..000000000 --- a/contracts/tests/testnet/GDAI.sol +++ /dev/null @@ -1,47 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.7.3; - -import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; -import "@openzeppelin/contracts/token/ERC20/ERC20Burnable.sol"; - -import "../../governance/Governed.sol"; - -/** - * @title Graph Testnet stablecoin contract - * @dev This is the implementation of an ERC20 stablecoin used for experiments on testnet. - */ -contract GDAI is Governed, ERC20, ERC20Burnable { - address public GSR; - - /** - * @dev GDAI constructor. - */ - constructor() ERC20("Graph DAI", "GDAI") { - Governed._initialize(msg.sender); - - // The Governor is sent all tokens - _mint(msg.sender, 100000000 ether); // 100,000,000 GDAI - } - - /** - * @dev Check if the caller is the governor. - */ - modifier onlyGovernorOrGSR { - require(msg.sender == governor || msg.sender == GSR, "Only Governor or GSR can call"); - _; - } - - function setGSR(address _GSR) external onlyGovernor { - GSR = _GSR; - } - - /** - * @dev Mint new tokens. - * @param _to Address to send the newly minted tokens - * @param _amount Amount of tokens to mint - */ - function mint(address _to, uint256 _amount) external onlyGovernorOrGSR { - _mint(_to, _amount); - } -} diff --git a/contracts/tests/testnet/GSRManager.sol b/contracts/tests/testnet/GSRManager.sol deleted file mode 100644 index 39b7d73d0..000000000 --- a/contracts/tests/testnet/GSRManager.sol +++ /dev/null @@ -1,157 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.7.3; - -import "../../governance/Governed.sol"; -import "./GDAI.sol"; - -/** - * @title Graph Saving Rate contract - * Heavily influenced by Maker DAI savings rate - * https://github.com/makerdao/dss/blob/master/src/pot.sol - * @dev This contracts receives GDAI deposits and provides an interests rate for use in testnet. - */ - -contract GSRManager is Governed { - using SafeMath for uint256; - - uint256 private constant ISSUANCE_RATE_DECIMALS = 1e18; - uint256 public savingsRate; // savings rate being earned (dsr in DSR) - uint256 public reserves; // total interest bearing GDAI (Pie in DSR) - uint256 public cumulativeInterestRate; // cumulative interest rate of the contract (chi in DSR) - uint256 public lastDripTime; // Last time drip was called (rho in DSR) - mapping(address => uint256) public balances; // balance of interest bearing GDAI (pie in DSR) - GDAI public token; // GDAI - - event SetRate(uint256 newRate); - event Drip(uint256 cumulativeInterestRate, uint256 lastDripTime); - event Join(address indexed account, uint256 gdai, uint256 gsrBalance); - event Exit(address indexed account, uint256 gsrBalance, uint256 gdai); - - /** - * @dev Graph Saving Rate constructor. - */ - constructor(uint256 _savingsRate, address _gdai) { - require(_savingsRate != 0, "Savings rate can't be zero"); - Governed._initialize(msg.sender); - cumulativeInterestRate = ISSUANCE_RATE_DECIMALS; - lastDripTime = block.timestamp; - savingsRate = _savingsRate; - token = GDAI(_gdai); - } - - // Governance sets savings rate - function setRate(uint256 _newRate) external onlyGovernor { - require(_newRate != 0, "Savings rate can't be zero"); - drip(); - savingsRate = _newRate; - emit SetRate(savingsRate); - } - - // Update the rate and mint tokens - // We enforce drip to always be called by all state changing functions. Lessens require statements - function drip() public returns (uint256 updatedRate) { - updatedRate = calcUpdatedRate(); - uint256 rateDifference = updatedRate.sub(cumulativeInterestRate); - cumulativeInterestRate = updatedRate; - lastDripTime = block.timestamp; - token.mint(address(this), reserves.mul(rateDifference).div(ISSUANCE_RATE_DECIMALS)); - emit Drip(cumulativeInterestRate, lastDripTime); - } - - // Someone enters - function join(uint256 _amount) external { - drip(); - uint256 savingsBalance = _amount.mul(ISSUANCE_RATE_DECIMALS).div(cumulativeInterestRate); - balances[msg.sender] = balances[msg.sender].add(savingsBalance); - reserves = reserves.add(savingsBalance); - token.transferFrom(msg.sender, address(this), _amount); - emit Join(msg.sender, _amount, savingsBalance); - } - - // Someone exits - function exit(uint256 _amount) external { - drip(); - balances[msg.sender] = balances[msg.sender].sub(_amount); - uint256 withdrawnAmount = _amount.mul(cumulativeInterestRate).div(ISSUANCE_RATE_DECIMALS); - reserves = reserves.sub(_amount); - token.transfer(msg.sender, withdrawnAmount); - emit Exit(msg.sender, _amount, withdrawnAmount); - } - - // Calculate the new cumulative interest rate - function calcUpdatedRate() public view returns (uint256 updatedRate) { - updatedRate = cumulativeInterestRate - .mul(_pow(savingsRate, block.timestamp - lastDripTime, ISSUANCE_RATE_DECIMALS)) - .div(ISSUANCE_RATE_DECIMALS); - } - - // Calculate the total balance a user would have if they withdrew - function calcReturn(address _account) external view returns (uint256 totalBalance) { - uint256 updatedRate = calcUpdatedRate(); - totalBalance = balances[_account].mul(updatedRate).div(ISSUANCE_RATE_DECIMALS); - } - - /** TODO - have a math library and use it here and in RewardsMAnager - * @dev Raises x to the power of n with scaling factor of base. - * Based on: https://github.com/makerdao/dss/blob/master/src/pot.sol#L81 - * @param x Base of the exponentiation - * @param n Exponent - * @param base Scaling factor - * @return z Exponential of n with base x - */ - function _pow( - uint256 x, - uint256 n, - uint256 base - ) internal pure returns (uint256 z) { - assembly { - switch x - case 0 { - switch n - case 0 { - z := base - } - default { - z := 0 - } - } - default { - switch mod(n, 2) - case 0 { - z := base - } - default { - z := x - } - let half := div(base, 2) // for rounding. - for { - n := div(n, 2) - } n { - n := div(n, 2) - } { - let xx := mul(x, x) - if iszero(eq(div(xx, x), x)) { - revert(0, 0) - } - let xxRound := add(xx, half) - if lt(xxRound, xx) { - revert(0, 0) - } - x := div(xxRound, base) - if mod(n, 2) { - let zx := mul(z, x) - if and(iszero(iszero(x)), iszero(eq(div(zx, x), z))) { - revert(0, 0) - } - let zxRound := add(zx, half) - if lt(zxRound, zx) { - revert(0, 0) - } - z := div(zxRound, base) - } - } - } - } - } -} diff --git a/contracts/token/IGraphToken.sol b/contracts/token/IGraphToken.sol deleted file mode 100644 index 336202455..000000000 --- a/contracts/token/IGraphToken.sol +++ /dev/null @@ -1,35 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.7.3; - -import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; - -interface IGraphToken is IERC20 { - // -- Mint and Burn -- - - function burn(uint256 amount) external; - - function mint(address _to, uint256 _amount) external; - - // -- Mint Admin -- - - function addMinter(address _account) external; - - function removeMinter(address _account) external; - - function renounceMinter() external; - - function isMinter(address _account) external view returns (bool); - - // -- Permit -- - - function permit( - address _owner, - address _spender, - uint256 _value, - uint256 _deadline, - uint8 _v, - bytes32 _r, - bytes32 _s - ) external; -} diff --git a/contracts/upgrades/GraphProxy.sol b/contracts/upgrades/GraphProxy.sol deleted file mode 100644 index 2e576d6a7..000000000 --- a/contracts/upgrades/GraphProxy.sol +++ /dev/null @@ -1,202 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.7.3; - -import "@openzeppelin/contracts/utils/Address.sol"; - -import "./GraphProxyStorage.sol"; - -/** - * @title Graph Proxy - * @dev Graph Proxy contract used to delegate call implementation contracts and support upgrades. - * This contract should NOT define storage as it is managed by GraphProxyStorage. - * This contract implements a proxy that is upgradeable by an admin. - * https://docs.openzeppelin.com/upgrades-plugins/1.x/proxies#transparent-proxies-and-function-clashes - */ -contract GraphProxy is GraphProxyStorage { - /** - * @dev Modifier used internally that will delegate the call to the implementation unless - * the sender is the admin. - */ - modifier ifAdmin() { - if (msg.sender == _admin()) { - _; - } else { - _fallback(); - } - } - - /** - * @dev Modifier used internally that will delegate the call to the implementation unless - * the sender is the admin or pending implementation. - */ - modifier ifAdminOrPendingImpl() { - if (msg.sender == _admin() || msg.sender == _pendingImplementation()) { - _; - } else { - _fallback(); - } - } - - /** - * @dev Contract constructor. - * @param _impl Address of the initial implementation - * @param _admin Address of the proxy admin - */ - constructor(address _impl, address _admin) { - assert(ADMIN_SLOT == bytes32(uint256(keccak256("eip1967.proxy.admin")) - 1)); - assert( - IMPLEMENTATION_SLOT == bytes32(uint256(keccak256("eip1967.proxy.implementation")) - 1) - ); - assert( - PENDING_IMPLEMENTATION_SLOT == - bytes32(uint256(keccak256("eip1967.proxy.pendingImplementation")) - 1) - ); - - _setAdmin(_admin); - _setPendingImplementation(_impl); - } - - /** - * @dev Returns the current admin. - * - * NOTE: Only the admin and implementation can call this function. - * - * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the - * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. - * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103` - */ - function admin() external ifAdminOrPendingImpl returns (address) { - return _admin(); - } - - /** - * @dev Returns the current implementation. - * - * NOTE: Only the admin can call this function. - * - * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the - * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. - * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc` - */ - function implementation() external ifAdminOrPendingImpl returns (address) { - return _implementation(); - } - - /** - * @dev Returns the current pending implementation. - * - * NOTE: Only the admin can call this function. - * - * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the - * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. - * `0x9e5eddc59e0b171f57125ab86bee043d9128098c3a6b9adb4f2e86333c2f6f8c` - */ - function pendingImplementation() external ifAdminOrPendingImpl returns (address) { - return _pendingImplementation(); - } - - /** - * @dev Changes the admin of the proxy. - * - * NOTE: Only the admin can call this function. - */ - function setAdmin(address _newAdmin) external ifAdmin { - require(_newAdmin != address(0), "Cannot change the admin of a proxy to the zero address"); - _setAdmin(_newAdmin); - } - - /** - * @dev Upgrades to a new implementation contract. - * @param _newImplementation Address of implementation contract - * - * NOTE: Only the admin can call this function. - */ - function upgradeTo(address _newImplementation) external ifAdmin { - _setPendingImplementation(_newImplementation); - } - - /** - * @dev Admin function for new implementation to accept its role as implementation. - */ - function acceptUpgrade() external ifAdminOrPendingImpl { - _acceptUpgrade(); - } - - /** - * @dev Admin function for new implementation to accept its role as implementation. - */ - function acceptUpgradeAndCall(bytes calldata data) external ifAdminOrPendingImpl { - _acceptUpgrade(); - // solhint-disable-next-line avoid-low-level-calls - (bool success, ) = _implementation().delegatecall(data); - require(success); - } - - /** - * @dev Admin function for new implementation to accept its role as implementation. - */ - function _acceptUpgrade() internal { - address _pendingImplementation = _pendingImplementation(); - require(Address.isContract(_pendingImplementation), "Implementation must be a contract"); - require( - _pendingImplementation != address(0) && msg.sender == _pendingImplementation, - "Caller must be the pending implementation" - ); - - _setImplementation(_pendingImplementation); - _setPendingImplementation(address(0)); - } - - /** - * @dev Delegates the current call to implementation. - * This function does not return to its internal call site, it will return directly to the - * external caller. - */ - function _fallback() internal { - require(msg.sender != _admin(), "Cannot fallback to proxy target"); - - assembly { - // (a) get free memory pointer - let ptr := mload(0x40) - - // (b) get address of the implementation - let impl := and(sload(IMPLEMENTATION_SLOT), 0xffffffffffffffffffffffffffffffffffffffff) - - // (1) copy incoming call data - calldatacopy(ptr, 0, calldatasize()) - - // (2) forward call to logic contract - let result := delegatecall(gas(), impl, ptr, calldatasize(), 0, 0) - let size := returndatasize() - - // (3) retrieve return data - returndatacopy(ptr, 0, size) - - // (4) forward return data back to caller - switch result - case 0 { - revert(ptr, size) - } - default { - return(ptr, size) - } - } - } - - /** - * @dev Fallback function that delegates calls to implementation. Will run if no other - * function in the contract matches the call data. - */ - fallback() external payable { - _fallback(); - } - - /** - * @dev Fallback function that delegates calls to implementation. Will run if call data - * is empty. - */ - receive() external payable { - _fallback(); - } -} diff --git a/contracts/upgrades/GraphProxyAdmin.sol b/contracts/upgrades/GraphProxyAdmin.sol deleted file mode 100644 index f198871da..000000000 --- a/contracts/upgrades/GraphProxyAdmin.sol +++ /dev/null @@ -1,104 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.7.3; - -import "../governance/Governed.sol"; - -import "./IGraphProxy.sol"; -import "./GraphUpgradeable.sol"; - -/** - * @title GraphProxyAdmin - * @dev This is the owner of upgradeable proxy contracts. - * Proxy contracts use a TransparentProxy pattern, any admin related call - * like upgrading a contract or changing the admin needs to be send through - * this contract. - */ -contract GraphProxyAdmin is Governed { - - /** - * @dev Contract constructor. - */ - constructor() { - Governed._initialize(msg.sender); - } - - /** - * @dev Returns the current implementation of a proxy. - * This is needed because only the proxy admin can query it. - * @return The address of the current implementation of the proxy. - */ - function getProxyImplementation(IGraphProxy _proxy) public view returns (address) { - // We need to manually run the static call since the getter cannot be flagged as view - // bytes4(keccak256("implementation()")) == 0x5c60da1b - (bool success, bytes memory returndata) = address(_proxy).staticcall(hex"5c60da1b"); - require(success); - return abi.decode(returndata, (address)); - } - - /** - * @dev Returns the pending implementation of a proxy. - * This is needed because only the proxy admin can query it. - * @return The address of the pending implementation of the proxy. - */ - function getProxyPendingImplementation(IGraphProxy _proxy) public view returns (address) { - // We need to manually run the static call since the getter cannot be flagged as view - // bytes4(keccak256("pendingImplementation()")) == 0x396f7b23 - (bool success, bytes memory returndata) = address(_proxy).staticcall(hex"396f7b23"); - require(success); - return abi.decode(returndata, (address)); - } - - /** - * @dev Returns the admin of a proxy. Only the admin can query it. - * @return The address of the current admin of the proxy. - */ - function getProxyAdmin(IGraphProxy _proxy) public view returns (address) { - // We need to manually run the static call since the getter cannot be flagged as view - // bytes4(keccak256("admin()")) == 0xf851a440 - (bool success, bytes memory returndata) = address(_proxy).staticcall(hex"f851a440"); - require(success); - return abi.decode(returndata, (address)); - } - - /** - * @dev Changes the admin of a proxy. - * @param _proxy Proxy to change admin. - * @param _newAdmin Address to transfer proxy administration to. - */ - function changeProxyAdmin(IGraphProxy _proxy, address _newAdmin) public onlyGovernor { - _proxy.setAdmin(_newAdmin); - } - - /** - * @dev Upgrades a proxy to the newest implementation of a contract. - * @param _proxy Proxy to be upgraded. - * @param _implementation the address of the Implementation. - */ - function upgrade(IGraphProxy _proxy, address _implementation) public onlyGovernor { - _proxy.upgradeTo(_implementation); - } - - /** - * @dev Accepts a proxy. - * @param _implementation Address of the implementation accepting the proxy. - * @param _proxy Address of the proxy being accepted. - */ - function acceptProxy(GraphUpgradeable _implementation, IGraphProxy _proxy) public onlyGovernor { - _implementation.acceptProxy(_proxy); - } - - /** - * @dev Accepts a proxy and call a function on the implementation. - * @param _implementation Address of the implementation accepting the proxy. - * @param _proxy Address of the proxy being accepted. - * @param _data Encoded function to call on the implementation after accepting the proxy. - */ - function acceptProxyAndCall( - GraphUpgradeable _implementation, - IGraphProxy _proxy, - bytes calldata _data - ) external onlyGovernor { - _implementation.acceptProxyAndCall(_proxy, _data); - } -} diff --git a/contracts/upgrades/GraphProxyStorage.sol b/contracts/upgrades/GraphProxyStorage.sol deleted file mode 100644 index a4ed5494d..000000000 --- a/contracts/upgrades/GraphProxyStorage.sol +++ /dev/null @@ -1,140 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.7.3; - -/** - * @title Graph Proxy Storage - * @dev Contract functions related to getting and setting proxy storage. - * This contract does not actually define state variables managed by the compiler - * but uses fixed slot locations. - */ -contract GraphProxyStorage { - /** - * @dev Storage slot with the address of the current implementation. - * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is - * validated in the constructor. - */ - bytes32 - internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; - - /** - * @dev Storage slot with the address of the pending implementation. - * This is the keccak-256 hash of "eip1967.proxy.pendingImplementation" subtracted by 1, and is - * validated in the constructor. - */ - bytes32 - internal constant PENDING_IMPLEMENTATION_SLOT = 0x9e5eddc59e0b171f57125ab86bee043d9128098c3a6b9adb4f2e86333c2f6f8c; - - /** - * @dev Storage slot with the admin of the contract. - * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is - * validated in the constructor. - */ - bytes32 - internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103; - - /** - * @dev Emitted when pendingImplementation is changed. - */ - event PendingImplementationUpdated( - address indexed oldPendingImplementation, - address indexed newPendingImplementation - ); - - /** - * @dev Emitted when pendingImplementation is accepted, - * which means contract implementation is updated. - */ - event ImplementationUpdated( - address indexed oldImplementation, - address indexed newImplementation - ); - - /** - * @dev Emitted when the admin account has changed. - */ - event AdminUpdated(address indexed oldAdmin, address indexed newAdmin); - - /** - * @dev Modifier to check whether the `msg.sender` is the admin. - */ - modifier onlyAdmin() { - require(msg.sender == _admin(), "Caller must be admin"); - _; - } - - /** - * @return adm The admin slot. - */ - function _admin() internal view returns (address adm) { - bytes32 slot = ADMIN_SLOT; - assembly { - adm := sload(slot) - } - } - - /** - * @dev Sets the address of the proxy admin. - * @param _newAdmin Address of the new proxy admin - */ - function _setAdmin(address _newAdmin) internal { - bytes32 slot = ADMIN_SLOT; - assembly { - sstore(slot, _newAdmin) - } - - emit AdminUpdated(_admin(), _newAdmin); - } - - /** - * @dev Returns the current implementation. - * @return impl Address of the current implementation - */ - function _implementation() internal view returns (address impl) { - bytes32 slot = IMPLEMENTATION_SLOT; - assembly { - impl := sload(slot) - } - } - - /** - * @dev Returns the current pending implementation. - * @return impl Address of the current pending implementation - */ - function _pendingImplementation() internal view returns (address impl) { - bytes32 slot = PENDING_IMPLEMENTATION_SLOT; - assembly { - impl := sload(slot) - } - } - - /** - * @dev Sets the implementation address of the proxy. - * @param _newImplementation Address of the new implementation - */ - function _setImplementation(address _newImplementation) internal { - address oldImplementation = _implementation(); - - bytes32 slot = IMPLEMENTATION_SLOT; - assembly { - sstore(slot, _newImplementation) - } - - emit ImplementationUpdated(oldImplementation, _newImplementation); - } - - /** - * @dev Sets the pending implementation address of the proxy. - * @param _newImplementation Address of the new pending implementation - */ - function _setPendingImplementation(address _newImplementation) internal { - address oldPendingImplementation = _pendingImplementation(); - - bytes32 slot = PENDING_IMPLEMENTATION_SLOT; - assembly { - sstore(slot, _newImplementation) - } - - emit PendingImplementationUpdated(oldPendingImplementation, _newImplementation); - } -} diff --git a/contracts/upgrades/GraphUpgradeable.sol b/contracts/upgrades/GraphUpgradeable.sol deleted file mode 100644 index 580065e2c..000000000 --- a/contracts/upgrades/GraphUpgradeable.sol +++ /dev/null @@ -1,65 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.7.3; - -import "./IGraphProxy.sol"; - -/** - * @title Graph Upgradeable - * @dev This contract is intended to be inherited from upgradeable contracts. - */ -contract GraphUpgradeable { - /** - * @dev Storage slot with the address of the current implementation. - * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is - * validated in the constructor. - */ - bytes32 - internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; - - /** - * @dev Check if the caller is the proxy admin. - */ - modifier onlyProxyAdmin(IGraphProxy _proxy) { - require(msg.sender == _proxy.admin(), "Caller must be the proxy admin"); - _; - } - - /** - * @dev Check if the caller is the implementation. - */ - modifier onlyImpl { - require(msg.sender == _implementation(), "Caller must be the implementation"); - _; - } - - /** - * @dev Returns the current implementation. - * @return impl Address of the current implementation - */ - function _implementation() internal view returns (address impl) { - bytes32 slot = IMPLEMENTATION_SLOT; - assembly { - impl := sload(slot) - } - } - - /** - * @dev Accept to be an implementation of proxy. - */ - function acceptProxy(IGraphProxy _proxy) external onlyProxyAdmin(_proxy) { - _proxy.acceptUpgrade(); - } - - /** - * @dev Accept to be an implementation of proxy and then call a function from the new - * implementation as specified by `_data`, which should be an encoded function call. This is - * useful to initialize new storage variables in the proxied contract. - */ - function acceptProxyAndCall(IGraphProxy _proxy, bytes calldata _data) - external - onlyProxyAdmin(_proxy) - { - _proxy.acceptUpgradeAndCall(_data); - } -} diff --git a/contracts/utils/TokenUtils.sol b/contracts/utils/TokenUtils.sol deleted file mode 100644 index a645d9422..000000000 --- a/contracts/utils/TokenUtils.sol +++ /dev/null @@ -1,50 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.7.3; - -import "../token/IGraphToken.sol"; - -library TokenUtils { - /** - * @dev Pull tokens from an address to this contract. - * @param _graphToken Token to transfer - * @param _from Address sending the tokens - * @param _amount Amount of tokens to transfer - */ - function pullTokens( - IGraphToken _graphToken, - address _from, - uint256 _amount - ) internal { - if (_amount > 0) { - require(_graphToken.transferFrom(_from, address(this), _amount), "!transfer"); - } - } - - /** - * @dev Push tokens from this contract to a receiving address. - * @param _graphToken Token to transfer - * @param _to Address receiving the tokens - * @param _amount Amount of tokens to transfer - */ - function pushTokens( - IGraphToken _graphToken, - address _to, - uint256 _amount - ) internal { - if (_amount > 0) { - require(_graphToken.transfer(_to, _amount), "!transfer"); - } - } - - /** - * @dev Burn tokens held by this contract. - * @param _graphToken Token to burn - * @param _amount Amount of tokens to burn - */ - function burnTokens(IGraphToken _graphToken, uint256 _amount) internal { - if (_amount > 0) { - _graphToken.burn(_amount); - } - } -} diff --git a/graph.config.yml b/graph.config.yml deleted file mode 100644 index 7eb2faccd..000000000 --- a/graph.config.yml +++ /dev/null @@ -1,92 +0,0 @@ -general: - arbitrator: &arbitrator "0xE1FDD398329C6b74C14cf19100316f0826a492d3" - -contracts: - Controller: - calls: - - fn: "setContractProxy" - id: "0xe6876326c1291dfcbbd3864a6816d698cd591defc7aa2153d7f9c4c04016c89f" # keccak256('Curation') - contractAddress: "${{Curation.address}}" - - fn: "setContractProxy" - id: "0x39605a6c26a173774ca666c67ef70cf491880e5d3d6d0ca66ec0a31034f15ea3" # keccak256('GNS') - contractAddress: "${{GNS.address}}" - - fn: "setContractProxy" - id: "0xf942813d07d17b56de9a9afc8de0ced6e8c053bbfdcc87b7badea4ddcf27c307" # keccak256('DisputeManager') - contractAddress: "${{DisputeManager.address}}" - - fn: "setContractProxy" - id: "0xc713c3df6d14cdf946460395d09af88993ee2b948b1a808161494e32c5f67063" # keccak256('EpochManager') - contractAddress: "${{EpochManager.address}}" - - fn: "setContractProxy" - id: "0x966f1e8d8d8014e05f6ec4a57138da9be1f7c5a7f802928a18072f7c53180761" # keccak256('RewardsManager') - contractAddress: "${{RewardsManager.address}}" - - fn: "setContractProxy" - id: "0x1df41cd916959d1163dc8f0671a666ea8a3e434c13e40faef527133b5d167034" # keccak256('Staking') - contractAddress: "${{Staking.address}}" - - fn: "setContractProxy" - id: "0x45fc200c7e4544e457d3c5709bfe0d520442c30bbcbdaede89e8d4a4bbc19247" # keccak256('GraphToken') - contractAddress: "${{GraphToken.address}}" - ServiceRegistry: - proxy: true - init: - controller: "${{Controller.address}}" - EpochManager: - proxy: true - init: - controller: "${{Controller.address}}" - lengthInBlocks: 1108 # 4 hours (in 13 second blocks) - GraphToken: - init: - initialSupply: "10000000000000000000000000000" # 10,000,000,000 GRT - calls: - - fn: "addMinter" - minter: "${{RewardsManager.address}}" - Curation: - proxy: true - init: - controller: "${{Controller.address}}" - bondingCurve: "${{BancorFormula.address}}" - reserveRatio: 500000 # 50% (parts per million) - curationTaxPercentage: 25000 # 2.5% (parts per million) - minimumCurationDeposit: "1000000000000000000" # 1 GRT - DisputeManager: - proxy: true - init: - controller: "${{Controller.address}}" - arbitrator: *arbitrator - minimumDeposit: "10000000000000000000000" # 10,000 GRT (in wei) - fishermanRewardPercentage: 500000 # 50% (parts per million) - idxSlashingPercentage: 25000 # 2.5% (parts per million) - qrySlashingPercentage: 5000 # 0.5% (parts per million) - GNS: - proxy: true - init: - controller: "${{Controller.address}}" - bondingCurve: "${{BancorFormula.address}}" - didRegistry: "0xdca7ef03e98e0dc2b855be647c39abe984fcf21b" - calls: - - fn: "approveAll" - Staking: - proxy: true - init: - controller: "${{Controller.address}}" - minimumIndexerStake: "100000000000000000000000" # 100,000 GRT (in wei) - thawingPeriod: 6646 # 10 days (in blocks) - protocolPercentage: 10000 # 1% (parts per million) - curationPercentage: 100000 # 10% (parts per million) - channelDisputeEpochs: 2 # (in epochs) - maxAllocationEpochs: 6 # Based on epoch length this is 28 days (in epochs) - delegationUnbondingPeriod: 6 # Based on epoch length this is 28 days (in epochs) - delegationRatio: 16 # 16x (delegated stake to indexer stake multiplier) - rebateAlphaNumerator: 77 # rebateAlphaNumerator / rebateAlphaDenominator - rebateAlphaDenominator: 100 # rebateAlphaNumerator / rebateAlphaDenominator - calls: - - fn: "setDelegationTaxPercentage" - delegationTaxPercentage: 5000 # 0.5% (parts per million) - - fn: "setSlasher" - slasher: "${{DisputeManager.address}}" - allowed: true - RewardsManager: - proxy: true - init: - controller: "${{Controller.address}}" - issuanceRate: "1000000012184945188" # 3% annual rate (per block increase of total supply, blocks in a year = 365*60*60*24/13) \ No newline at end of file diff --git a/hardhat.config.ts b/hardhat.config.ts deleted file mode 100644 index 4900ee8c6..000000000 --- a/hardhat.config.ts +++ /dev/null @@ -1,151 +0,0 @@ -import path from 'path' -import fs from 'fs' -import * as dotenv from 'dotenv' - -import 'hardhat/types/runtime' -import { HardhatUserConfig } from 'hardhat/types' - -dotenv.config() - -// Plugins - -import '@nomiclabs/hardhat-ethers' -import '@nomiclabs/hardhat-etherscan' -import '@nomiclabs/hardhat-waffle' -import 'hardhat-abi-exporter' -import 'hardhat-gas-reporter' -import 'hardhat-contract-sizer' -import '@tenderly/hardhat-tenderly' -import '@openzeppelin/hardhat-upgrades' -import '@typechain/hardhat' - -// TODO: Not supported for now in hardhat -// usePlugin('solidity-coverage') - -// Tasks - -const SKIP_LOAD = process.env.SKIP_LOAD === 'true' - -if (!SKIP_LOAD) { - ;['contracts', 'misc', 'query', 'deployment'].forEach((folder) => { - const tasksPath = path.join(__dirname, 'tasks', folder) - fs.readdirSync(tasksPath) - .filter((pth) => pth.includes('.ts')) - .forEach((task) => { - require(`${tasksPath}/${task}`) - }) - }) -} - -// Networks - -interface NetworkConfig { - network: string - chainId: number - url?: string - gas?: number | 'auto' - gasPrice?: number | 'auto' -} - -const networkConfigs: NetworkConfig[] = [ - { network: 'mainnet', chainId: 1 }, - { network: 'rinkeby', chainId: 4 }, - { network: 'kovan', chainId: 42 }, -] - -function getAccountMnemonic() { - return process.env.MNEMONIC || '' -} - -function getDefaultProviderURL(network: string) { - return `https://${network}.infura.io/v3/${process.env.INFURA_KEY}` -} - -function setupNetworkProviders(hardhatConfig) { - for (const netConfig of networkConfigs) { - hardhatConfig.networks[netConfig.network] = { - chainId: netConfig.chainId, - url: netConfig.url ? netConfig.url : getDefaultProviderURL(netConfig.network), - gas: netConfig.gas || 'auto', - gasPrice: netConfig.gasPrice || 'auto', - accounts: { - mnemonic: getAccountMnemonic(), - }, - } - } -} - -// Config - -const DEFAULT_TEST_MNEMONIC = - 'myth like bonus scare over problem client lizard pioneer submit female collect' - -const config: HardhatUserConfig = { - paths: { - sources: './contracts', - tests: './test', - artifacts: './build/contracts', - }, - solidity: { - compilers: [ - { - version: '0.7.4', - settings: { - optimizer: { - enabled: true, - runs: 200, - }, - }, - }, - ], - }, - defaultNetwork: 'hardhat', - networks: { - hardhat: { - chainId: 1337, - loggingEnabled: false, - gas: 12000000, - gasPrice: 'auto', - blockGasLimit: 12000000, - accounts: { - mnemonic: DEFAULT_TEST_MNEMONIC, - }, - }, - ganache: { - chainId: 1337, - url: 'http://localhost:8545', - gasPrice: 300000000000, // 300 gwei - }, - }, - etherscan: { - apiKey: process.env.ETHERSCAN_API_KEY, - }, - gasReporter: { - enabled: process.env.REPORT_GAS ? true : false, - showTimeSpent: true, - currency: 'USD', - outputFile: 'reports/gas-report.log', - }, - typechain: { - outDir: 'build/types', - target: 'ethers-v5', - }, - abiExporter: { - path: './build/abis', - clear: false, - flat: true, - }, - tenderly: { - project: 'graph-network', - username: 'abarmat', - }, - contractSizer: { - alphaSort: true, - runOnCompile: false, - disambiguatePaths: false, - }, -} - -setupNetworkProviders(config) - -export default config diff --git a/package.json b/package.json index e6fe77a67..7fd279609 100644 --- a/package.json +++ b/package.json @@ -1,133 +1,21 @@ { - "name": "@graphprotocol/contracts", - "version": "1.4.0", - "description": "Contracts for the Graph Protocol", - "directories": { - "test": "test" - }, - "files": [ - "dist/**/*", - "README.md", - "LICENSE", - "addresses.json" - ], - "dependencies": { - "ethers": "^5.1.3" - }, - "devDependencies": { - "@ethersproject/contracts": "^5.1.1", - "@ethersproject/experimental": "^5.1.2", - "@ethersproject/transactions": "^5.1.1", - "@graphprotocol/common-ts": "^1.6.0", - "@nomiclabs/hardhat-ethers": "^2.0.2", - "@nomiclabs/hardhat-etherscan": "^2.1.1", - "@nomiclabs/hardhat-waffle": "^2.0.1", - "@openzeppelin/contracts": "^3.4.1", - "@openzeppelin/hardhat-upgrades": "^1.6.0", - "@tenderly/hardhat-tenderly": "^1.0.11", - "@typechain/ethers-v5": "^7.0.0", - "@typechain/hardhat": "^2.0.0", - "@types/bs58": "^4.0.1", - "@types/dotenv": "^8.2.0", - "@types/inquirer": "^7.3.1", - "@types/minimist": "^1.2.1", - "@types/mocha": "^8.2.2", - "@types/node": "^15.0.1", - "@types/winston": "^2.4.4", - "@types/yargs": "^16.0.0", - "@typescript-eslint/eslint-plugin": "^4.0.0", - "@typescript-eslint/parser": "^4.0.0", - "@typescript-eslint/typescript-estree": "^4.0.0", - "axios": "^0.21.1", - "bignumber.js": "^9.0.0", - "chai": "^4.3.4", - "cli-table": "^0.3.6", - "dotenv": "^9.0.0", - "eslint": "^7.24.0", - "eslint-config-prettier": "^8.3.0", - "eslint-config-standard": "^16.0.0", - "eslint-plugin-import": "^2.22.0", - "eslint-plugin-mocha-no-only": "^1.1.1", - "eslint-plugin-no-only-tests": "^2.4.0", - "eslint-plugin-node": "^11.1.0", - "eslint-plugin-prettier": "^3.4.0", - "eslint-plugin-promise": "^5.0.0", - "eslint-plugin-standard": "^4.1.0", - "ethereum-waffle": "^3.3.0", - "ethlint": "^1.2.5", - "hardhat": "^2.2.0", - "hardhat-abi-exporter": "^2.2.0", - "hardhat-contract-sizer": "^2.0.3", - "hardhat-gas-reporter": "^1.0.4", - "husky": "^4.3.8", - "inquirer": "^8.0.0", - "ipfs-http-client": "47.0.1", - "lint-staged": "^10.5.4", - "minimist": "^1.2.5", - "p-queue": "^6.6.1", - "prettier": "^2.2.1", - "prettier-plugin-solidity": "^1.0.0-beta.9", - "solidity-coverage": "^0.7.16", - "ts-generator": "^0.1.1", - "ts-node": "^9.1.1", - "typechain": "^5.0.0", - "typescript": "^4.2.4", - "winston": "^3.3.3", - "yaml": "^1.10.2", - "yargs": "^17.0.0", - "yargs-parser": "^13.1.2" - }, + "name": "@graphprotocol/contracts-monorepo", + "private": true, + "description": "Contracts monorepo for The Graph protocol", + "license": "GPL-2.0-or-later", + "repository": "git@github.com:graphprotocol/contracts.git", + "author": "The Graph team", + "packageManager": "pnpm@9.0.6+sha1.648f6014eb363abb36618f2ba59282a9eeb3e879", "scripts": { - "prepublishOnly": "scripts/prepublish", - "build": "SKIP_LOAD=true scripts/build", - "clean": "rm -rf build/ cache/ dist/", - "compile": "hardhat compile", - "deploy": "scripts/predeploy && hardhat migrate", - "deploy-ganache": "yarn deploy -- --force", - "deploy-ganache-manual": "yarn deploy -- --network ganache --force", - "deploy-rinkeby": "yarn deploy -- --force --network rinkeby", - "predeploy": "scripts/predeploy", - "test": "scripts/test", - "test:gas": "RUN_EVM=true REPORT_GAS=true scripts/test", - "test:coverage": "scripts/coverage", - "lint": "yarn lint:ts && yarn lint:sol", - "lint:fix": "yarn lint:ts:fix && yarn lint:sol:fix", - "lint:ts": "eslint '*/**/*.{js,ts}'", - "lint:ts:fix": "eslint '*/**/*.{js,ts}' --fix", - "lint:sol": "solium --dir ./contracts", - "lint:sol:fix": "solium --dir ./contracts --fix", - "prettier": "yarn prettier:ts && yarn prettier:sol", - "prettier:ts": "prettier --write 'test/**/*.ts'", - "prettier:sol": "prettier --write 'contracts/*.sol'", - "analyze": "scripts/analyze", - "flatten": "scripts/flatten", - "typechain": "hardhat typechain", - "verify": "hardhat verify", - "size": "hardhat size-contracts" - }, - "lint-staged": { - "contracts/*.sol": [ - "prettier --write" - ], - "test/**/*.ts": [ - "prettier --write" - ] + "postinstall": "husky install", + "clean": "pnpm -r --parallel --reporter=append-only run clean", + "clean:all": "pnpm clean && rm -rf node_modules packages/*/node_modules", + "build": "chmod +x ./scripts/build && ./scripts/build" }, - "husky": { - "hooks": { - "pre-commit": "lint-staged", - "pre-push": "git diff HEAD --quiet && yarn lint && yarn test" - } - }, - "repository": { - "type": "git", - "url": "git+https://github.com/graphprotocol/contracts.git" - }, - "author": "TheGraph Team", - "license": "MIT", - "bugs": { - "url": "https://github.com/graphprotocol/contracts/issues" - }, - "homepage": "https://github.com/graphprotocol/contracts#readme", - "types": "dist/types/index.d.ts" + "devDependencies": { + "@changesets/cli": "^2.27.1", + "@commitlint/cli": "^18.4.3", + "@commitlint/config-conventional": "^18.4.3", + "husky": "^8.0.3" + } } diff --git a/packages/contracts/.env.example b/packages/contracts/.env.example new file mode 100644 index 000000000..31f125024 --- /dev/null +++ b/packages/contracts/.env.example @@ -0,0 +1,7 @@ +MNEMONIC= +ETHERSCAN_API_KEY= +ARBISCAN_API_KEY= +INFURA_KEY= +ADDRESS_BOOK="addresses.json" +GRAPH_CONFIG="config/graph.mainnet.yml" +PROVIDER_URL="http://127.0.0.1:8545" \ No newline at end of file diff --git a/packages/contracts/.mocharc.json b/packages/contracts/.mocharc.json new file mode 100644 index 000000000..79ba35ddf --- /dev/null +++ b/packages/contracts/.mocharc.json @@ -0,0 +1,5 @@ +{ + "require": "ts-node/register/files", + "ignore": ["test/fixture-projects/**/*"], + "timeout": 6000 +} diff --git a/packages/contracts/.solcover.js b/packages/contracts/.solcover.js new file mode 100644 index 000000000..8c5efb96b --- /dev/null +++ b/packages/contracts/.solcover.js @@ -0,0 +1,11 @@ +const skipFiles = ['bancor', 'ens', 'erc1056', 'arbitrum', 'tests/arbitrum'] + +module.exports = { + providerOptions: { + mnemonic: 'myth like bonus scare over problem client lizard pioneer submit female collect', + network_id: 1337, + }, + skipFiles, + istanbulFolder: './reports/coverage', + configureYulOptimizer: true, +} diff --git a/packages/contracts/CHANGELOG.md b/packages/contracts/CHANGELOG.md new file mode 100644 index 000000000..2e99896ed --- /dev/null +++ b/packages/contracts/CHANGELOG.md @@ -0,0 +1,75 @@ +# @graphprotocol/contracts + +## 7.1.2 + +### Patch Changes + +- chore: fix package visibility + +## 7.1.1 + +### Patch Changes + +- Fix IServiceRegistry import in subgraph service toolshed deployment + +## 7.1.0 + +### Minor Changes + +- Publish entire build folder for contracts package + +## 6.3.0 + +### Minor Changes + +- Remove restriction that prevented closing allocations older than 1 epoch. + +## 6.2.1 + +### Patch Changes + +- Round up when calculating curation tax +- Round up when calculating consecutive stake thawing periods + +## 6.2.0 + +### Minor Changes + +- Update implementation addresses with GGP 31, 34 and 35 + +### Patch Changes + +- 554af2c: feat(utils): add utility to parse subgraph ids +- Updated dependencies [554af2c] +- Updated dependencies [c5641c5] + - @graphprotocol/sdk@0.5.0 + +## 6.1.3 + +### Patch Changes + +- Ensure globbing is enabled in prepack + +## 6.1.2 + +### Patch Changes + +- Correctly pass ts file list to tsc in prepack + +## 6.1.1 + +### Patch Changes + +- Use prepack to correctly prepare outputs for the published package + +## 6.1.0 + +### Minor Changes + +- Introduce changesets for versioning +- Add new staging implementations including GGPs 31, 34 and 35 +- Add new testnet implementations including GGPs 31, 34 and 35 + +### Patch Changes + +- Fixes for verifyAll and bridge:send-to-l2 hardhat tasks diff --git a/packages/contracts/DEPLOYMENT.md b/packages/contracts/DEPLOYMENT.md new file mode 100644 index 000000000..941162d84 --- /dev/null +++ b/packages/contracts/DEPLOYMENT.md @@ -0,0 +1,141 @@ +## Deploying the Solidity Smart Contracts +### Running + +Deploy functionality exists in `cli/cli.ts`. You can deploy the contracts to the specified network +when used with the `migrate` command. This script accepts multiple commands that you can print using: + +```bash +cli/cli.ts --help +``` + +For convenience, the script can also be used as a hardhat command with `hardhat migrate` and it can be also run with: + +``` +pnpm deploy +``` + +The **migrate** command will: + +- Read contracts configuration from a file. +- Parse command-line options to select which network to deploy and the wallet to use. +- Check if contracts were already deployed and skip them. +- Deploy the contracts and wait for each transaction to be mined. +- Write an address book file with the deployed contracts data. + +The script accepts multiple parameters that allow to override default values, print the available options with: + +``` +pnpm deploy -- --help +``` + +NOTE: Please run `pnpm build` at least once before running migrate as this command relies on artifacts produced in the compilation process. + +### Networks + +By default, `pnpm deploy` will deploy the contracts to a localhost instance of a development network. + +To deploy to a different network execute: + +``` +pnpm deploy -- --network {networkName} + +# Example +pnpm deploy -- --network goerli +``` + +The network must be configured in the `hardhat.config.ts` as explained in https://hardhat.org/config. + +To deploy using your own wallet add the HD Wallet Config to the `hardhat.config.ts` file according to https://hardhat.org/config/#hd-wallet-config. + +### Configuration + +A configuration file called `graph..yml` located in the `config` folder contains the parameters needed to deploy the contracts. Please edit these params as you see fit. + +You can use a different set of configuration options by specifying the file location in the command line: + +``` +pnpm deploy -- --graph-config another-graph.mainnet.yml +``` + +Rules: + +- Under the `contracts` key every contract configuration is defined by its name. +- Every key under a contract name are parameters sent in the contract constructor in the order they are declared. +- YAML anchors can be used to set common values like \*governor. +- A special key called `__calls` let you define a list of parameters that will be set at the end of all the contracts deployment by calling the function defined in the `fn` key. +- The configuration file can set a parameter to a value read from the AddressBook by using `${{ContractName.AttributeName}}`. For example `${{GraphToken.address}}`. + +Example: + +[https://github.com/graphprotocol/contracts/blob/master/config/graph.mainnet.yml](https://github.com/graphprotocol/contracts/blob/master/config/graph.mainnet.yml) + +### Address book + +After running the migrate script it will print debugging information on the console and the resulting contract information will be saved on the `addresses.json` file. + +The upmost key of that file is the **chainID**. This allows to accommodate the deployment information of multiple networks in the same address book. + +For each contract deployed, the address book will contain: + +- Contract address. +- Constructor arguments. +- Creation code hash. +- Runtime code hash. +- Transaction hash of the deployment. + +### Order of deployment + +Some contracts require the address from previously deployed contracts. For that reason, the order of deployment is as below: + +- Controller +- EpochManager +- GNS +- GraphToken +- ServiceRegistry +- Curation +- RewardManager +- Staking +- DisputeManager + +### Deploying a new testnet + +1. Make sure contracts are up to date as you please. +2. `pnpm deploy-goerli` to deploy to Goerli. This will create new contracts with new addresses in `addresses.json`. +3. Update the `package.json` and `package-lock.json` files with the new package version and publish a new npm package with `npm publish`. You can dry-run the files to be uploaded by running `npm publish --dry-run`. +4. Merge this update into master, branch off and save for whatever version of the testnet is going on, and then tag this on the github repo, pointing to your branch (ex. at `testnet-phase-1` branch). This way we can always get the contract code for testnet, while continuing to do work on mainnet. +5. Pull the updated package into the subgraph, and other apps that depend on the package.json. +6. Send tokens to the whole team using `./cli/cli.ts airdrop` + +## Verifying the deployed smart contracts + +Deployed smart contracts can be verified on etherscan and sourcify using built-in commands. + +### Etherscan + +[Etherscan](https://etherscan.io/) verification can be performed by using the [hardhat-etherscan](https://hardhat.org/hardhat-runner/plugins/nomiclabs-hardhat-etherscan) plugin. __Note__: ensure you have set a valid `ETHERSCAN_API_KEY` in the `.env` file. + +- To verify a single contract, run: + + ```bash + npx hardhat verify --network {networkName} --contract {FullyQualifiedContractName} {contractAddress} {constructorInitParams} + ``` + +- To verify all contracts on the address book, run: + ```bash + npx hardhat verifyAll --network {networkName} --graph-config {graphConfigFile} + ``` + +### Sourcify + +Additionally you can verify contracts on [Sourcify](https://sourcify.dev/). + +- To verify a single contract, run: + + ```bash + npx hardhat sourcify --network {networkName} --contract {FullyQualifiedContractName} {contractAddress} + ``` + +- To verify all contracts on the address book, run: + ```bash + npx hardhat sourcifyAll --network {networkName} + ``` diff --git a/packages/contracts/README.md b/packages/contracts/README.md new file mode 100644 index 000000000..847edc359 --- /dev/null +++ b/packages/contracts/README.md @@ -0,0 +1,131 @@ +![License: GPL](https://img.shields.io/badge/license-GPLv2-blue) +![Version Badge](https://img.shields.io/badge/version-1.14.0-lightgrey.svg) +![CI Status](https://github.com/graphprotocol/contracts/actions/workflows/npmtest.yml/badge.svg) +[![codecov](https://codecov.io/gh/graphprotocol/contracts/branch/dev/graph/badge.svg?token=S8JWGR9SBN)](https://codecov.io/gh/graphprotocol/contracts) + +# Graph Protocol Contracts + +The Graph Protocol Smart Contracts are a set of Solidity contracts that exist on the Ethereum Blockchain. The contracts enable an open and permissionless decentralized network that coordinates [Graph Nodes](https://github.com/graphprotocol/graph-node) to Index any subgraph that is added to the network. Graph Nodes then provide queries to users for those Subgraphs. Users pay for queries with the Graph Token (GRT). + +The protocol allows Indexers to Stake, Delegators to Delegate, and Curators to Signal on Subgraphs. The Signal informs Indexers which Subgraphs they should index. + +You can learn more by heading to [the documentation](https://thegraph.com/docs/about/introduction), or checking out some of the [blog posts on the protocol](https://thegraph.com/blog/the-graph-network-in-depth-part-1). + +# Contracts + +The contracts are upgradable, following the [Open Zeppelin Proxy Upgrade Pattern](https://docs.openzeppelin.com/upgrades-plugins/1.x/proxies). Each contract will be explained in brief detail below. + +**_Curation_** + +> Allows Curators to Signal GRT towards a Subgraph Deployment they want indexed on The Graph. Curators are often Subgraph Developers, but anyone can participate. Curators also receive a portion of the query fees that are earned on the Subgraph. Signaled GRT goes into a bonding curve, which returns a Graph Curation Share (GCS) to the Curator. + +**_Graph Name Service (GNS)_** + +> Wraps around the Curation contract to provide pooling of Curator Signaled tokens towards a single Subgraph. This allows an owner to deploy a Subgraph, and upgrade their Subgraph to a new version. The upgrade will move all Curator tokens to a new Subgraph Deployment with a new bonding curve. + +**_Service Registry_** + +> Allows Indexers to tell the network the location of their node. This allows end users to choose a node close to themselves, lowering the latency for queries. + +**_Dispute Manager_** + +> Provides a way for Indexers to be slashed or incorrect or malicious behaviour. There are two types of disputes: _Query Disputes_ and _Indexing Disputes_. + +**_Epoch Manager_** + +> Keeps track of protocol Epochs. Epochs are configured to be a certain block length, which is configurable by The Governor. + +**_Controller_** + +> The Controller is a contract that has a registry of all protocol contract addresses. It also is the owner of all the contracts. The owner of the Controller is The Governor, which makes The Governor the address that can configure the whole protocol. The Governor is [The Graph Council](https://thegraph.com/blog/introducing-the-graph-council). + +**_Rewards Manager_** + +> Tracks how inflationary GRT rewards should be handed out. It relies on the Curation contract and the Staking contract. Signaled GRT in Curation determine what percentage of inflationary tokens go towards each subgraph. Each Subgraph can have multiple Indexers Staked on it. Thus, the total rewards for the Subgraph are split up for each Indexer based on much they have Staked on that Subgraph. + +**_Staking_** + +> The Staking contract allows Indexers to Stake on Subgraphs. Indexers Stake by creating Allocations on a Subgraph. It also allows Delegators to Delegate towards an Indexer. The contract also contains the slashing functionality. + +**_Graph Token_** + +> An ERC-20 token (GRT) that is used as a work token to power the network incentives. The token is inflationary. + +# NPM package + +The [NPM package](https://www.npmjs.com/package/@graphprotocol/contracts) contains contract interfaces and addresses for the testnet and mainnet. It also contains [typechain](https://github.com/ethereum-ts/TypeChain) generated objects to easily interact with the contracts. This allows for anyone to install the package in their repository and interact with the protocol. It is updated and released whenever a change to the contracts occurs. + +``` +pnpm add @graphprotocol/contracts +``` + +# Contract Addresses + +The testnet runs on Goerli, while mainnet is on Ethereum Mainnet. The addresses for both of these can be found in `./addresses.json`. + +# Local Setup + +To setup the contracts locally, checkout the `dev` branch, then run: + +```bash +pnpm +pnpm build +``` + +# Testing + +For testing details see [TESTING.md](./TESTING.md). + +# Deploying Contracts + +In order to run deployments, see [DEPLOYMENT.md](./DEPLOYMENT.md). + +# Interacting with the contracts + +There are three ways to interact with the contracts through this repo: + +### Hardhat + +The most straightforward way to interact with the contracts is through the hardhat console. We have extended the hardhat runtime environment to include all of the contracts. This makes it easy to run the console with autocomplete for all contracts and all functions. It is a quick and easy way to read and write to the contracts. + +``` +# A console to interact with testnet contracts +npx hardhat console --network goerli +``` + +### Hardhat Tasks + +There are hardhat tasks under the `/tasks` folder. Most tasks are for complex queries to get back data from the protocol. + +### CLI + +There is a CLI that can be used to read or write to the contracts. It includes scripts to help with deployment. + +## Environment + +When running the Hardhat console or tasks you can set what network and accounts to use when sending transactions. + +### Network + +Selecting a network requires just passing `--network ` when running Hardhat. It's important that the network exists in the Hardhat configuration file. + +_There is a special network called `localhost` that connects it to a node running on localhost._ + +### Accounts + +The accounts used depends on a few environment variables: + +- If MNEMONIC is set you will have available the set of addresses derived from the seed. +- If PRIVATE_KEY is set, just that account is imported. MNEMONIC always takes precedence over PRIVATE_KEY. +- If no MNEMONIC or PRIVATE_KEY is set it will use the remote accounts from the provider node. +- You can always get an account using `ethers.getSigner(
)` + +Considerations when forking a chain: + +- When running on the `localhost` network it will use by default a deterministic seed for testing purposes. If you want to connect to a local node that is forking while retaining the capability to impersonate accounts or use local accounts you need to set the FORK=true environment variable. + +# Copyright + +Copyright © 2021 The Graph Foundation + +Licensed under [GPL license](LICENSE). diff --git a/packages/contracts/TESTING.md b/packages/contracts/TESTING.md new file mode 100644 index 000000000..ab13287bc --- /dev/null +++ b/packages/contracts/TESTING.md @@ -0,0 +1,99 @@ +# Testing + +Testing is done with the following stack: + +- [Hardhat](https://hardhat.org/) +- [Typescript](https://www.typescriptlang.org/) +- [Ethers](https://docs.ethers.io/v5/) + +## Unit testing + +To test all the smart contracts, use `pnpm test`. +To test a single file run: `npx hardhat test test/.ts` + +## E2E Testing + +End to end tests are also available and can be run against a local network or a live network. These can be useful to validate that a protocol deployment is configured and working as expected. + +There are several types of e2e tests which can be run separately: +- **deployment/config** + - Test the configuration of deployed contracts (parameters that don't change over time). + - Can be run against any network at any time and the tests should pass. + - Only read only interactions with the blockchain. + - Example: a test validating the curation default reserve ratio matches the value in the graph config file. +- **deployment/init** + - Test the initialization of deployed contracts (parameters that change with protocol usage). + - Can be run against a "fresh" protocol deployment. Running these tests against a protocol with pre-existing state will probably fail. + - Only read only interactions with the blockchain. + - Example: a test validating that the GRT total supply equals 10B, this is only true on a freshly deployed protocol until the first allocation is closed and protocol issuance kicks in. +- **scenarios** + - Test the execution of common protocol actions. + - Can be run against any network at any time and the tests should pass. + - Read and write interactions with the blockchain. _Requires an account with sufficient balance!_ + - Example: a test validating that a user can add signal to a subgraph. + +### Hardhat local node (L1) + +It can be useful to run E2E tests against a fresh protocol deployment on L1, this can be done with the following: + +```bash +L1_NETWORK=localhost pnpm test:e2e +``` + +The command will: +- start a hardhat local node +- deploy the L1 protocol +- configure the new L1 deployment +- Run all L1 e2e tests + +### Arbitrum Nitro testnodes (L1/L2) + +If you want to test the protocol on an L1/L2 setup, you can run: + +```bash +L1_NETWORK=localnitrol1 L2_NETWORK=localnitrol2 pnpm test:e2e +``` + +In this case the command will: +- deploy the L1 protocol +- configure the new L1 deployment +- deploy the L2 protocol +- configure the new L2 deployment +- configure the L1/L2 bridge +- Run all L1 e2e tests +- Run all L2 e2e tests + +Note that you'll need to setup the testnodes before running the tests. See [Quick Setup](https://github.com/edgeandnode/nitro#quick-setup) for details on how to do this. + +### Other networks + +To run tests against a live testnet or even mainnet run: + +```bash +# All e2e tests +ARBITRUM_ADDRESS_BOOK= npx hardhat e2e --network --l1-graph-config config/graph..yml --l2-graph-config config/graph..yml + +# Only deployment config tests +ARBITRUM_ADDRESS_BOOK= npx hardhat e2e:config --network --l1-graph-config config/graph..yml --l2-graph-config config/graph..yml + +# Only deployment init tests +ARBITRUM_ADDRESS_BOOK= npx hardhat e2e:init --network --l1-graph-config config/graph..yml --l2-graph-config config/graph..yml + +# Only a specific scenario +npx hardhat e2e:scenario --network --graph-config config/graph..yml +``` + +Note that this command will only run the tests so you need to be sure the protocol is already deployed and the graph config file and address book files are up to date. + +### How to add scenarios + +Scenarios are defined by an optional script and a test file: + +- Optional ts script + - The objective of this script is to perform actions on the protocol to advance it's state to the desired one. + - Should follow hardhat script convention. + - Should be named test/e2e/scenarios/{scenario-name}.ts. + - They run before the test file. +- Test file + - Should be named test/e2e/scenarios/{scenario-name}.test.ts. + - Standard chai/mocha/hardhat/ethers test file. \ No newline at end of file diff --git a/packages/contracts/addresses-staging.json b/packages/contracts/addresses-staging.json new file mode 100644 index 000000000..5bf3369ef --- /dev/null +++ b/packages/contracts/addresses-staging.json @@ -0,0 +1,448 @@ +{ + "421614": { + "GraphProxyAdmin": { + "address": "0xC8621C8Aa286Aac28551565C4c2E367F5b5De583", + "creationCodeHash": "0x68b304ac6bce7380d5e0f6b14a122f628bffebcc75f8205cb60f0baf578b79c3", + "runtimeCodeHash": "0x8d9ba87a745cf82ab407ebabe6c1490197084d320efb6c246d94bcc80e804417", + "txHash": "0x2b9ffd8b4062728da184f0545906af12ded857b323ba8379894c69a6758bc2d1" + }, + "Controller": { + "address": "0x1eB3dC938d1Bc573D657d3cF05F48523773EADd3", + "creationCodeHash": "0x5bde9a87bc4e8dd24d41900f0a19321c1dc6d3373d51bba093b130bb5b80a677", + "runtimeCodeHash": "0x7f0479db1d60ecf6295d92ea2359ebdd223640795613558b0594680f5d4922c9", + "txHash": "0x5fbc3b23ea4bfc9fa34c7cd112723fcbc7614af03f0fd42a170b6ab397d8505f" + }, + "EpochManager": { + "address": "0x969A82ca85Efc62Cca8e88D64f74Ef89C002AE62", + "initArgs": ["0x1eB3dC938d1Bc573D657d3cF05F48523773EADd3", "554"], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0xa30e76aa2e1581d19dec1e5ef419ded2f8b21e250fe52670bff6b28d20cf23d8", + "proxy": true, + "implementation": { + "address": "0x9D2FC0A47081faDA1a981E1e2bfcdCE600254914", + "creationCodeHash": "0x46f6e557c33712422a496a5955626504bfabefc242ef8eacea07324427baf467", + "runtimeCodeHash": "0x3a5ccaf8a8f67fa727849a5636d46b92a29f9838c14cca20a15fdef0e8f78c61", + "txHash": "0x3b6627842e8f2a1e19a793ebade4f7489b5bef7d9bb8a62f103fe2c6f4eda23f" + } + }, + "L2GraphToken": { + "address": "0x9975A2a0bFf669c69b2fEF885C94A5bfCffB8626", + "initArgs": ["0xadE6B8EB69a49B56929C1d4F4b428d791861dB6f"], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0x9b0d13fb3dc313881f0b17b1a44ba08faeced2dbaddb94993d4f157dc835c0b8", + "proxy": true, + "implementation": { + "address": "0xa567c06921c80f8f23E64D2FeD2EdaAafC87b8D6", + "creationCodeHash": "0x6c4146427aafa7375a569154be95c8c931bf83aab0315706dd78bdf79c889e4c", + "runtimeCodeHash": "0x004371d1d80011906953dcba17c648503fc94b94e1e0365c8d8c706ff91f93e9", + "txHash": "0x6dafb8c05dac61c35ce97605643da00293317d1087dec05c79ffeb5275900126" + } + }, + "GraphCurationToken": { + "address": "0xf3172c87417d2E07806F278Da87bB7dc22E55E92", + "creationCodeHash": "0x1ee42ee271cefe20c33c0de904501e618ac4b56debca67c634d0564cecea9ff2", + "runtimeCodeHash": "0x340e8f378c0117b300f3ec255bc5c3a273f9ab5bd2940fa8eb3b5065b21f86dc", + "txHash": "0xf6b46423a006f6c9edb38aacae40dcf0e417345c53d59a6693e83623e9cccac4" + }, + "ServiceRegistry": { + "address": "0x174ED56255FdB19754834eB11C116c288288c23F", + "initArgs": ["0x1eB3dC938d1Bc573D657d3cF05F48523773EADd3"], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0xe23b2ce8024d8a603a617f7f685b298a1079f3e0fecd2ef3f47fe5200dd062f2", + "proxy": true, + "implementation": { + "address": "0xF3d33Cf20628EF30220ab7DAA151c45dC600d4BD", + "creationCodeHash": "0x0fdb1360692ba7459a580610706838c1d9dbffa2117a5c9433ca4ce3491e9b35", + "runtimeCodeHash": "0x3f99c39e90540c307e0a38ecbe501a3bb47f9916319179491214e07c55319666", + "txHash": "0xb52b836c1d4555a0f6cc08f9c18f9df1e382dddba4522d5ecfcbd637a6c76685" + } + }, + "L2Curation": { + "address": "0xddd1ab948602a365dE04E7153EbC2D401Be550C7", + "initArgs": [ + "0x1eB3dC938d1Bc573D657d3cF05F48523773EADd3", + "0xf3172c87417d2E07806F278Da87bB7dc22E55E92", + "10000", + "1" + ], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0x9346e8c6133211590867ebe9bee37efb44f52175ee7ce498a57a78d1223e6357", + "proxy": true, + "implementation": { + "address": "0x60d946bCAC1bcd99dA79cdd37bd4cAAb1f739A1F", + "creationCodeHash": "0x2287d9023bf7d91e688e1eb029eff7657ef3b87e37b5222b01fd50985d0928f9", + "runtimeCodeHash": "0xd799b2b74e9634d6b6ef15b5710409264bed04a60f9519b9d8f05ac183199d16", + "txHash": "0xae41519e9620042b88b76a39fec00946a17cf41d47b659351a967cc86dbc1b53" + } + }, + "SubgraphNFTDescriptor": { + "address": "0x98EC4455196901C129Fa518Caea96Ab03A713c82", + "creationCodeHash": "0xf16e8ff11d852eea165195ac9e0dfa00f98e48f6ce3c77c469c7df9bf195b651", + "runtimeCodeHash": "0x39583196f2bcb85789b6e64692d8c0aa56f001c46f0ca3d371abbba2c695860f", + "txHash": "0x3841019cc9e64ec50446a93d2c59a21ea579533c289d944a7cf17197427ddb1a" + }, + "SubgraphNFT": { + "address": "0xB4C1c4998f547679841714ae3E2241543b52Ca85", + "constructorArgs": ["0xadE6B8EB69a49B56929C1d4F4b428d791861dB6f"], + "creationCodeHash": "0xc1e58864302084de282dffe54c160e20dd96c6cfff45e00e6ebfc15e04136982", + "runtimeCodeHash": "0x7216e736a8a8754e88688fbf5c0c7e9caf35c55ecc3a0c5a597b951c56cf7458", + "txHash": "0x36a456898f3addfa9e4eb459fd79862216012639360d69574b0fec06bce56fe2" + }, + "L2GNS": { + "address": "0xE0e09986912E7723c28Cc81c01c0B6b2789B7ff7", + "initArgs": [ + "0x1eB3dC938d1Bc573D657d3cF05F48523773EADd3", + "0xB4C1c4998f547679841714ae3E2241543b52Ca85" + ], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0xbd2d3f6d4fee611c5f090da74c1abcb83274fc9deb3e57f9903ce6e6eb7c3d2c", + "proxy": true, + "implementation": { + "address": "0x5792f9a70DE8c58D8df1A03E6CEc72fe1e14fc4B", + "creationCodeHash": "0xd71f45e6c194920a26f90fcec96d8c3375f02c5aef8ad90c1be24e906ffe8342", + "runtimeCodeHash": "0x68ec24512fedb866d7ba7ba6c02160317d0ca34eaacd23bddcc62d2cbcd9869c", + "txHash": "0x1b9b13111d5647b8f3f73567c00d81abc95296fb885c346a454df4f80d3cda23" + } + }, + "StakingExtension": { + "address": "0x36C27F2DFa4F3bAF609d8E53D7Dd1A5e64eA9266", + "creationCodeHash": "0x7ae74140871330ecabb7040182dc8288c2c84693393a519230036f39c2281138", + "runtimeCodeHash": "0x4994aa74e9e29c36a8158af690a245ccd1cf4d955223e5fcb1ca62810b37ed57", + "txHash": "0xe96b9221e789496baf1718190c05e54d5d4a96049acfca0158f836d0f464849f" + }, + "L2Staking": { + "address": "0x3fC01c0E957Ca1c8C7E94Edd4497A6d6B1ED9b73", + "initArgs": [ + "0x1eB3dC938d1Bc573D657d3cF05F48523773EADd3", + "100000000000000000000000", + "6646", + "10000", + "100000", + "8", + "12", + "16", + "100,100,60,100", + "0x9291448138A18CE5329470417AE5f3cba1D974Ed" + ], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0x5ae51383f5ad1e434a78c2a6d5393d497be315c40287d827c63c4ca48cc66aca", + "proxy": true, + "implementation": { + "address": "0x0a6b1efb7b2e9A27Cf7C5ED1bdF1Bd03bF8F5600", + "creationCodeHash": "0x60bc1fda6913ef750a1d931e87068d0f6cd62b8b42a4fff13b304b9c0c278557", + "runtimeCodeHash": "0xd8bbd97b94f8ac45a479c55c0416e7b0ebef6a99da8ef7580bebaaad1d8d74d9", + "txHash": "0x5d9276e47f3d1fa1fe5c6d826534722aa73d47f5a114e844de73a3cf0cb22d6b", + "libraries": { + "LibExponential": "0xb7fB963257d4f31F88021d2D7Ee53688e38A0938" + } + } + }, + "RewardsManager": { + "address": "0x00b9d319E3D09E83c62f453B44354049Dd93a345", + "initArgs": ["0x1eB3dC938d1Bc573D657d3cF05F48523773EADd3"], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0x6f29e2f24dcdcbf5ed62e64434a1cd421b095d6199e7beb609de240986b1c066", + "proxy": true, + "implementation": { + "address": "0xc29119C524BDad22AC9dc19318Dc3a68EA636A86", + "creationCodeHash": "0x5e2ca01e204a1bd3a41a73ebe9a43679155351c96a6dc59d44e02c6dd0e5bed4", + "runtimeCodeHash": "0x64f77ec9ceffb764ff8677bae252f065fb04ef6974816002d979517ea8616cf7", + "txHash": "0xfc21ca24c15671457e93825936dab630e065c0794e9f6eaca4973452a3673435" + } + }, + "DisputeManager": { + "address": "0xdF0e0BAC295754207E6F36d6C90326d18354a1f0", + "initArgs": [ + "0x1eB3dC938d1Bc573D657d3cF05F48523773EADd3", + "0x1726A5d52e279d02ff4732eCeB2D67BFE5Add328", + "10000000000000000000000", + "500000", + "25000", + "25000" + ], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0x466f67046c81847e5d7746471ebbd255ab721c7ee85e85520254513b10745e7b", + "proxy": true, + "implementation": { + "address": "0x800C6152ae29C39B7fA4d40079017140d3A81fB4", + "creationCodeHash": "0xce4c47d94a33d69e03d607dd13a9ad1ed7fa730ef4a2308eb56ddd646ebaa0aa", + "runtimeCodeHash": "0x18d4a1659ccecede3d4d305ef1db4653d8f3dcbd4012f4e52200ae9f0c6c322c", + "txHash": "0x245066977ce08f06ce90add71cdf1c366bd9c8c0cb08fd6998a8ca2ac8758185" + } + }, + "AllocationExchange": { + "address": "0xa79F0861a0Bf975a6a7859Bd27C5f85AfAb559b3", + "constructorArgs": [ + "0x9975A2a0bFf669c69b2fEF885C94A5bfCffB8626", + "0x3fC01c0E957Ca1c8C7E94Edd4497A6d6B1ED9b73", + "0x72ee30d43Fb5A90B3FE983156C5d2fBE6F6d07B3", + "0x49D4CFC037430cA9355B422bAeA7E9391e1d3215" + ], + "creationCodeHash": "0x9731f46fbd12dbfbb066e0c291551ef1854cb54dd651632abb37322f6437ac18", + "runtimeCodeHash": "0xf2371afaa31bdaae67f43a2a0f85eae64bed2bbf5df117d7c68b74a64f1d3ece", + "txHash": "0x848b9f43ec851f6509443ba67c43e8d6748ceea8f6d60087ae98576aca5a4a4f" + }, + "L2GraphTokenGateway": { + "address": "0xDDE8A47Eb0394f3c7D5d143d6bCE9Dd0Ee0f6617", + "initArgs": ["0x1eB3dC938d1Bc573D657d3cF05F48523773EADd3"], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0x74179b89785ffbdbae2cc61161e1addc69c243dabd298796eb6ebc4299908e8e", + "proxy": true, + "implementation": { + "address": "0x748def5e70F69bBFD0770f2d1dE44e860e8759F4", + "creationCodeHash": "0x0190953f43ab8d61923de0edd8f8d28da4e12a90330f0030b19a497496c36039", + "runtimeCodeHash": "0xd853da2001c213dd00d674114c254f18a7b5a36aabc5452fb492b9b4faf2faa9", + "txHash": "0xf868871475dc711c5c03818b16a922f740bc2fc314d24586df2255161a907422" + } + }, + "SubgraphAvailabilityManager": { + "address": "0xF00AA63f1a8eE67BAD135759eC7a6542b1d56a8f", + "constructorArgs": [ + "0x72ee30d43Fb5A90B3FE983156C5d2fBE6F6d07B3", + "0x00b9d319E3D09E83c62f453B44354049Dd93a345", + "3", + "300", + [ + "0xb4d396a40BB976118Bb2c9DB9C5539e65c7Fe64A", + "0x633259dB4A33DB664d4C3Fa57BEc45E5030131E2", + "0x9FC436A69E290227b99A9CE0468a1b9D73068E80", + "0xC9b90ab0B9cA63fDBfB46f66BE813ea94561614d", + "0xf3B8F917EcFA569089CF6A0988F9a9F5155cEF83" + ] + ], + "creationCodeHash": "0xc34842fa42ee2f21e3a435b52fa69a122a5de795448faa890fbc63d4838f45da", + "runtimeCodeHash": "0xe6c0ccd0b0514dd55e58806b1c84f09805dd6202985722579c11d7e252df6b8d", + "txHash": "0x5c1dd91c76e547fe31a5df822353b50e93eb795b915aac0ea8f8364229e9c29c" + } + }, + "11155111": { + "GraphProxyAdmin": { + "address": "0x6f1F77Cc8Ee39f45CCd25B4EccE2cedB47ccb8bF", + "creationCodeHash": "0x68b304ac6bce7380d5e0f6b14a122f628bffebcc75f8205cb60f0baf578b79c3", + "runtimeCodeHash": "0x8d9ba87a745cf82ab407ebabe6c1490197084d320efb6c246d94bcc80e804417", + "txHash": "0xb195b1b16aa45669da0b4b530d0561ebad1b458011128d98f0c8f2974ea221d7" + }, + "BancorFormula": { + "address": "0x959f6d7Af76e22fF2459990e257eeD96ce2c99B4", + "creationCodeHash": "0x7ae36017eddb326ddd79c7363781366121361d42fdb201cf57c57424eede46f4", + "runtimeCodeHash": "0xed6701e196ad93718e28c2a2a44d110d9e9906085bcfe4faf4f6604b08f0116c", + "txHash": "0x57a4c36f7e36f3959d8ed517d2ca3d7a161aba5076b059e03efc291ff48e70be" + }, + "Controller": { + "address": "0x030C73c651445310bcc568449E956e2A976F1a29", + "creationCodeHash": "0x5bde9a87bc4e8dd24d41900f0a19321c1dc6d3373d51bba093b130bb5b80a677", + "runtimeCodeHash": "0x7f0479db1d60ecf6295d92ea2359ebdd223640795613558b0594680f5d4922c9", + "txHash": "0x8630416fb4633b3498962e8b4b824d25007664c7ed71eed170ef1c90eabb0c0f" + }, + "EpochManager": { + "address": "0x7783C76139371E38c0631073B51F3110Cb3A5822", + "initArgs": ["0x030C73c651445310bcc568449E956e2A976F1a29", "554"], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0xf2dbef208ce21665b5e707ad8ef45a2df2d3f45ffdc31a69c22c70a74c712295", + "proxy": true, + "implementation": { + "address": "0xB0f81EcE835C1b13C18973e9fFEbb6787765157D", + "creationCodeHash": "0x46f6e557c33712422a496a5955626504bfabefc242ef8eacea07324427baf467", + "runtimeCodeHash": "0x3a5ccaf8a8f67fa727849a5636d46b92a29f9838c14cca20a15fdef0e8f78c61", + "txHash": "0x80e35b38cf3153e08cbfd576d370f43ed4c3a6e7b48057c46201f6d2bf829d13" + } + }, + "GraphToken": { + "address": "0xf67bE354953C7ccA1B92F3F489a4774dc856062e", + "constructorArgs": ["10000000000000000000000000000"], + "creationCodeHash": "0x9c50586e9e305b3a299f1cdf92ca9bb04fad5f43b5e0f7505054d79783fd8b69", + "runtimeCodeHash": "0xfe612acbb09bdb23fe60014e890054621fd34d74bf12bd94fb73351d474cd641", + "txHash": "0x03ca50bc408a3f974d535f5de3aef23d4840324e0d9da4dc3348d8c8a5d70b7b" + }, + "GraphCurationToken": { + "address": "0xD432feaf373aaBC8ffAbaC66FEB753f2F531fAD2", + "creationCodeHash": "0x1ee42ee271cefe20c33c0de904501e618ac4b56debca67c634d0564cecea9ff2", + "runtimeCodeHash": "0x340e8f378c0117b300f3ec255bc5c3a273f9ab5bd2940fa8eb3b5065b21f86dc", + "txHash": "0x4f9de94c643a64ed245cc921e0cb7ff4175be4506fdba53b136c2a4c9109bde1" + }, + "ServiceRegistry": { + "address": "0x8E4dF72703Cd2b74e25fFE01C492F4b7F5D6Cdc4", + "initArgs": ["0x030C73c651445310bcc568449E956e2A976F1a29"], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0xe748f733b11d532a266ea2ffe0a671fb329e60ca7dc6d74e33fe8e6f173fed4c", + "proxy": true, + "implementation": { + "address": "0x7f3d488ccaEE5153955F321654A88F19a48AD5Ba", + "creationCodeHash": "0x0fdb1360692ba7459a580610706838c1d9dbffa2117a5c9433ca4ce3491e9b35", + "runtimeCodeHash": "0x3f99c39e90540c307e0a38ecbe501a3bb47f9916319179491214e07c55319666", + "txHash": "0x1c0e82fc0aa229f9fea138e714da90a560ea6e84c106d2a74905979cc265d998" + } + }, + "Curation": { + "address": "0x6E5Aef53761D4591947A757781f68df91031C29B", + "initArgs": [ + "0x030C73c651445310bcc568449E956e2A976F1a29", + "0x959f6d7Af76e22fF2459990e257eeD96ce2c99B4", + "0xD432feaf373aaBC8ffAbaC66FEB753f2F531fAD2", + "500000", + "10000", + "1000000000000000000" + ], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0x2cbe736f1afb13a6b7d12fa191d3d5ab40d39fe07465e2c188223dcca28b7c48", + "proxy": true, + "implementation": { + "address": "0x1B22551D83f2C3850D4715d979AD0186d9fbd4D8", + "creationCodeHash": "0x664014c4a6cde182892a64e4e86424567fcd478489bbcab9368f7fb970be02f5", + "runtimeCodeHash": "0x66925e4da1aacafc21adda65172c907eb7719d0dcce003d041e67f0369c064fd", + "txHash": "0xbd65e43da71ee9efb7865b77afc6d546be5320685b6b99956d28ccf0a7a44e6a" + } + }, + "SubgraphNFTDescriptor": { + "address": "0xad6bb620CA8f2e92Dfb34Bca6fE40acD101A175E", + "creationCodeHash": "0xf16e8ff11d852eea165195ac9e0dfa00f98e48f6ce3c77c469c7df9bf195b651", + "runtimeCodeHash": "0x39583196f2bcb85789b6e64692d8c0aa56f001c46f0ca3d371abbba2c695860f", + "txHash": "0xf690f7e5d0df4b2ce0b528097f0bae96ed6e420bc382229f8a15b810ab4aa0ad" + }, + "SubgraphNFT": { + "address": "0x0d12A34c88D2753f6523E5Ac5942a0c7b60d1448", + "constructorArgs": ["0x559081D91F5Ff43dfE51A07C216F8E6893805B35"], + "creationCodeHash": "0xc1e58864302084de282dffe54c160e20dd96c6cfff45e00e6ebfc15e04136982", + "runtimeCodeHash": "0x7216e736a8a8754e88688fbf5c0c7e9caf35c55ecc3a0c5a597b951c56cf7458", + "txHash": "0xf8d71e696a453d28aad2949d5c502bfb00a70350c52fd74fb8f2416b62e39da6" + }, + "L1GNS": { + "address": "0x4A952e8eF0373471ac44F71b540BE9164430E8Eb", + "initArgs": [ + "0x030C73c651445310bcc568449E956e2A976F1a29", + "0x0d12A34c88D2753f6523E5Ac5942a0c7b60d1448" + ], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0x779bb878b6a8d2f741650e02d53ae5b89a85e326aa25d49866f9914dc5794132", + "proxy": true, + "implementation": { + "address": "0xC9845CbC22F782c7397A6b4DfF7E739dD2364FB8", + "creationCodeHash": "0x36331afa041aa06c3c5beda1287c183e6193d65a6b61e34aaedb2929e9843bda", + "runtimeCodeHash": "0x5876f25be6e6ac09fd495aa04d88fa911d27d1c9e7359d87aaf84b9be2c49faa", + "txHash": "0x93e673dee281a86c99809d65c61e73bf30336b533023b30177d55671f1975f21" + } + }, + "StakingExtension": { + "address": "0xE792fa7bfF436Fbe9Ea6569201009061938d4e93", + "creationCodeHash": "0x8de9e9fe7e46fd75fee0be1fa10bc1c250532991c123db106bb3bad01ac9046b", + "runtimeCodeHash": "0xa9215542f24456fb4c63cc8684699255f85d29a0cf611d3dc7191b1445716376", + "txHash": "0x965bfbdd003a8069fd67461bccb69130da7f3efab5aa879b41cc4c7d1755939b" + }, + "L1Staking": { + "address": "0xBDEA90C996E9b92240fbef95989e51F86045afDb", + "initArgs": [ + "0x030C73c651445310bcc568449E956e2A976F1a29", + "100000000000000000000000", + "6646", + "10000", + "100000", + "4", + "12", + "16", + "100,100,60,100", + "0xE792fa7bfF436Fbe9Ea6569201009061938d4e93" + ], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0x35abe8a983f99476858fe5278a3ce2d5975b2c731ac89772cfbe2d2442acd21c", + "proxy": true, + "implementation": { + "address": "0x775e5672eE18eFA0fCc8C3F4C261bD3B61004897", + "creationCodeHash": "0xf885b3ef0b27a702c25eed9c767fe15d26bde96c0b343b8119a7fe02653d99c6", + "runtimeCodeHash": "0x5ac75f1f9973309e604d60ffa33d435af80792c80231fc0c06903e5c0331f7ac", + "txHash": "0xb4e0b72af1e712382581c3e5c5f246837f27e7a5cfb276d547c421eb2ebc8563", + "libraries": { + "LibExponential": "0x2a05d2c9fB1A9FD0d398c2DF778a6D249B532D44" + } + } + }, + "RewardsManager": { + "address": "0x9a86322dEa5136C74ee6d1b06F4Ab9A6bB2724E0", + "initArgs": ["0x030C73c651445310bcc568449E956e2A976F1a29"], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0xea65aa3f292c4fca982f39b5ae5d16ba9eea02f97d8ea787af4b0f11fa8695dc", + "proxy": true, + "implementation": { + "address": "0x3b54eA540EdC2266E811B4bb6ae1791b0685f75A", + "creationCodeHash": "0x5e2ca01e204a1bd3a41a73ebe9a43679155351c96a6dc59d44e02c6dd0e5bed4", + "runtimeCodeHash": "0x64f77ec9ceffb764ff8677bae252f065fb04ef6974816002d979517ea8616cf7", + "txHash": "0x7028376b813772e89872eec90206449473cccd1f59c0dd8272ecbdc869e04f92" + } + }, + "DisputeManager": { + "address": "0xF5a7aA8793445B4803b617b4199540248D1Eef53", + "initArgs": [ + "0x030C73c651445310bcc568449E956e2A976F1a29", + "0xd6ff9e98F0Fd99ccB658832F586e23F4D8Cb8Bad", + "10000000000000000000000", + "500000", + "25000", + "25000" + ], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0x979eacdafc53c91ed0f9f8078f2d4ab4a4e29fffc61add01982d4adcd14dccfd", + "proxy": true, + "implementation": { + "address": "0x98F352c0e7f31Bb9ac636F097C0d018719F72D28", + "creationCodeHash": "0xc57491ef973583304f2d179445a0cd0983c88abe321536195aa10b6602c72c05", + "runtimeCodeHash": "0x08740630f1836c12c860f717f40eeec7b4c08cb8a950f842f11fb200a3541cfd", + "txHash": "0x27f125ca77a7ceb5041d77cef5644f2bd72025b4b66898b185f6556860d72d50" + } + }, + "AllocationExchange": { + "address": "0x154E65F44918DC96ef95f15844C2f79883e11aa2", + "constructorArgs": [ + "0xf67bE354953C7ccA1B92F3F489a4774dc856062e", + "0xBDEA90C996E9b92240fbef95989e51F86045afDb", + "0x4EBf30832eC2db76aE228D5d239083B59f530d1f", + "0x840daec5dF962D49cf2EFd789c4E40A7b7e0117D" + ], + "creationCodeHash": "0x9731f46fbd12dbfbb066e0c291551ef1854cb54dd651632abb37322f6437ac18", + "runtimeCodeHash": "0x21a000835d92d4f79f062f56f02ef1618ede7a56796be7bea068a517424fc7fc", + "txHash": "0x4b6b89d10cbe3fd28dffe2411cf9e109df759e6e9e3232cb7a7f1ec91f5a05db" + }, + "L1GraphTokenGateway": { + "address": "0xd0eA0904cdb34AC4b624280f17b67DaFe57615E4", + "initArgs": ["0x030C73c651445310bcc568449E956e2A976F1a29"], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0x14f23e307d5ab1b6b550060dfac81974ae6a207429ad625ecd60a16fd9586df4", + "proxy": true, + "implementation": { + "address": "0xc7d4754CEbD240ec2b235d0B219a79039F536F2A", + "creationCodeHash": "0xf50c33e5a6f5c8e88485a922a1d5f2f46da965d180964d0e4a7852f97c59ce9d", + "runtimeCodeHash": "0x4e0d0eb1bafca40ef18c6f5ebe5ec408eaa00511b4e27ee508417e2bf90acc49", + "txHash": "0xc621dc678ab55ccbdf8bcdd93c24e756159574cd775fc6acfe3ffb8bf1831445" + } + }, + "BridgeEscrow": { + "address": "0x0d2692b5438EdE62ADEB83E22a8F2C45379d2C14", + "initArgs": ["0x030C73c651445310bcc568449E956e2A976F1a29"], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0x6b4884c0bb94e8d7ab97fce14f2555235a89d0b7ec394c61b71431b5c97523e9", + "proxy": true, + "implementation": { + "address": "0x3BB0742F6B0569576A259115068cFF5EF67cdba8", + "creationCodeHash": "0xa45cfc3fe7161765a1fb0b967bfc9f5c158cb3aa43f3556c4a5cc6a6bdb1d0ef", + "runtimeCodeHash": "0x3cb8a7336234c7826c8f5a437ad2c6615c2e4b4201096a49cb6876264ac47182", + "txHash": "0xf0765b7fe12702a7de3644bb1bcd6549bce1b8b738f2136e94bf39d10521b3e3" + } + } + } +} diff --git a/packages/contracts/addresses.json b/packages/contracts/addresses.json new file mode 100644 index 000000000..f9c7a1f71 --- /dev/null +++ b/packages/contracts/addresses.json @@ -0,0 +1,1491 @@ +{ + "1": { + "IENS": { + "address": "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e" + }, + "IEthereumDIDRegistry": { + "address": "0xdCa7EF03e98e0DC2B855bE647C39ABe984fcF21B" + }, + "GraphProxyAdmin": { + "address": "0xF3B000a6749259539aF4E49f24EEc74Ea0e71430", + "creationCodeHash": "0x26a6f47e71ad242e264768571ce7223bf5a86fd0113ab6cb8200f65820232904", + "runtimeCodeHash": "0xd5330527cfb09df657adc879d8ad704ce6b8d5917265cabbd3eb073d1399f122", + "txHash": "0xc5fe1a9f70e3cc4d286e19e3ee8ee9a0639c7415aea22a3f308951abf300382c" + }, + "BancorFormula": { + "address": "0xd0C61e8F15d9deF697E1100663eD7dA74d3727dC", + "creationCodeHash": "0x17f6de9ab8a9bcf03a548c01d620a32caf1f29be8d90a9688ebee54295f857ef", + "runtimeCodeHash": "0x97a57f69b0029383398d02587a3a357168950d61622fe9f9710bf02b59740d63", + "txHash": "0xcd0e28e7d328ff306bb1f2079e594ff9d04d09f21bc5f978b790c8d44b02055a" + }, + "Controller": { + "address": "0x24CCD4D3Ac8529fF08c58F74ff6755036E616117", + "creationCodeHash": "0x7f37a1844c38fffd5390d2114804ffc4e5cf66dfb5c7bd67a32a4f5d10eebd2d", + "runtimeCodeHash": "0x929c62381fbed59483f832611752177cc2642e1e35fedeeb6cd9703e278448a0", + "txHash": "0x12b13ed4ac6fee14335be09df76171b26223d870977524cfdce46c11112a5c04" + }, + "EpochManager": { + "address": "0x64F990Bf16552A693dCB043BB7bf3866c5E05DdB", + "initArgs": [ + { + "name": "controller", + "value": "0x24CCD4D3Ac8529fF08c58F74ff6755036E616117" + }, + { + "name": "lengthInBlocks", + "value": 6646 + } + ], + "creationCodeHash": "0xa02709eb59b9cca8bee1271845b42db037dc1d042dad93410ba532d378a7c79f", + "runtimeCodeHash": "0xdb307489fd9a4a438b5b48909e12020b209280ad777561c0a7451655db097e75", + "txHash": "0x9116a77a4e87eb3fe28514a26b1a6e3ee5ce982f9df3c18aadfc36d4f7f050e7", + "proxy": true, + "implementation": { + "address": "0x3fab259F2392F733c60C19492B5678E5D2D2Ee31", + "creationCodeHash": "0xf03074bb7f026a2574b6ffb5d0f63f0c4fee81e004e1c46ef262dd5802d3384f", + "runtimeCodeHash": "0x0d078a0bf778c6c713c46979ac668161a0a0466356252e47082f80912e4495b2", + "txHash": "0x730141db9a1dc5c9429f7543442e34e9eb994610e2ceabdedb6d322e1bedf2aa" + } + }, + "GraphToken": { + "address": "0xc944E90C64B2c07662A292be6244BDf05Cda44a7", + "constructorArgs": [ + { + "name": "initialSupply", + "value": "10000000000000000000000000000" + } + ], + "creationCodeHash": "0x30da7a30d71fbd41d3327e4d0183401f257af3e905a0c68ebfd18b590b27b530", + "runtimeCodeHash": "0xb964f76194a04272e7582382a4d6bd6271bbb90deb5c1fd3ae3913504ea3a830", + "txHash": "0x079625b9f58a40f1948b396b7007d09ff4aa193d7ec798923910fc179294cab8" + }, + "ServiceRegistry": { + "address": "0xaD0C9DaCf1e515615b0581c8D7E295E296Ec26E6", + "initArgs": [ + { + "name": "controller", + "value": "0x24CCD4D3Ac8529fF08c58F74ff6755036E616117" + } + ], + "creationCodeHash": "0xa02709eb59b9cca8bee1271845b42db037dc1d042dad93410ba532d378a7c79f", + "runtimeCodeHash": "0xdb307489fd9a4a438b5b48909e12020b209280ad777561c0a7451655db097e75", + "txHash": "0x94cbb1d3863e33bf92acc6fab534c5ce63a9d1347958a323ae496b06f710f042", + "proxy": true, + "implementation": { + "address": "0x866232Ec9a9F918a821eBa561Cc5FC960Ef5B3aa", + "creationCodeHash": "0xf5fa541b43d15fade518feb63a95a73b9c67626108ead259e444af3a7ae1804f", + "runtimeCodeHash": "0x9856d2c2985f410f2f77e456fe6163827ea5251eb5e3f3768d3d4f8868187882", + "txHash": "0xdf811598fbfbc487b16b5bb3444ed47ae3107d3dcde8dbd770e8810315f942b5" + } + }, + "GraphCurationToken": { + "address": "0xb2E26f17Aea8eFA534e15Bde5C79c25D0C3dfa2e", + "creationCodeHash": "0x7e9a56b6fc05d428d1c1116eaa88a658f05487b493d847bfe5c69e35ec34f092", + "runtimeCodeHash": "0x587f9d4e9ecf9e7048d9f42f027957ca34ee6a95ca37d9758d8cd0ee16e89818", + "txHash": "0x68eb11f4d6eaec5036c97b4c6102a509ac31933f1fe011f275b3e5fee30b6590" + }, + "Curation": { + "address": "0x8FE00a685Bcb3B2cc296ff6FfEaB10acA4CE1538", + "initArgs": [ + { + "name": "controller", + "value": "0x24CCD4D3Ac8529fF08c58F74ff6755036E616117" + }, + { + "name": "bondingCurve", + "value": "0xd0C61e8F15d9deF697E1100663eD7dA74d3727dC" + }, + { + "name": "reserveRatio", + "value": 500000 + }, + { + "name": "curationTaxPercentage", + "value": 25000 + }, + { + "name": "minimumCurationDeposit", + "value": "1000000000000000000" + } + ], + "creationCodeHash": "0xa02709eb59b9cca8bee1271845b42db037dc1d042dad93410ba532d378a7c79f", + "runtimeCodeHash": "0xdb307489fd9a4a438b5b48909e12020b209280ad777561c0a7451655db097e75", + "txHash": "0x64d8d94e21f1923bd1793011ba28f24befd57b511622920716238b05595dac7d", + "proxy": true, + "implementation": { + "address": "0xDeb46851907fd85DD475780CcE2eE0D67c969825", + "creationCodeHash": "0x32ec24cd745738aea9b8cb693d4a20f3cf219226da985ab92d270d3e0b5f7f65", + "runtimeCodeHash": "0xfc0db997a425bc44ee6d6f1e2fd6471227489a22c94f1b358b900134e7ce6308", + "txHash": "0xe95fd068849d1c9f49fbeadb3e7618e1748cc581406d7fdf15204a49d90d2f02" + } + }, + "L1GNS": { + "address": "0xaDcA0dd4729c8BA3aCf3E99F3A9f471EF37b6825", + "initArgs": [ + { + "name": "controller", + "value": "0x24CCD4D3Ac8529fF08c58F74ff6755036E616117" + }, + { + "name": "bondingCurve", + "value": "0xd0C61e8F15d9deF697E1100663eD7dA74d3727dC" + }, + { + "name": "didRegistry", + "value": "0xdca7ef03e98e0dc2b855be647c39abe984fcf21b" + } + ], + "creationCodeHash": "0xa02709eb59b9cca8bee1271845b42db037dc1d042dad93410ba532d378a7c79f", + "runtimeCodeHash": "0xdb307489fd9a4a438b5b48909e12020b209280ad777561c0a7451655db097e75", + "txHash": "0x7ef90b0477e5c5d05bbd203af7d2bf15224640204e12abb07331df11425d2d00", + "proxy": true, + "implementation": { + "address": "0x83A5B6C542aB20436087Fc79724bdF06ea80f836", + "creationCodeHash": "0xc34de4bdb2c1f364bc3aed96ac77248518578af009a60597835325c0346cc639", + "runtimeCodeHash": "0x134ddad3a28975b2b246e41fc21f647a0b6a6c47d170aea23c9d9ef295cfdd01", + "txHash": "0x0c26745e6d492737a64c253f2384bb2af1ec63a64088799b208e3f0563a528ce" + } + }, + "L1Staking": { + "address": "0xF55041E37E12cD407ad00CE2910B8269B01263b9", + "initArgs": [ + { + "name": "controller", + "value": "0x24CCD4D3Ac8529fF08c58F74ff6755036E616117" + }, + { + "name": "minimumIndexerStake", + "value": "100000000000000000000000" + }, + { + "name": "thawingPeriod", + "value": 186092 + }, + { + "name": "protocolPercentage", + "value": 10000 + }, + { + "name": "curationPercentage", + "value": 100000 + }, + { + "name": "channelDisputeEpochs", + "value": 7 + }, + { + "name": "maxAllocationEpochs", + "value": 28 + }, + { + "name": "delegationUnbondingPeriod", + "value": 28 + }, + { + "name": "delegationRatio", + "value": 16 + }, + { + "name": "rebateAlphaNumerator", + "value": 77 + }, + { + "name": "rebateAlphaDenominator", + "value": 100 + } + ], + "creationCodeHash": "0xa02709eb59b9cca8bee1271845b42db037dc1d042dad93410ba532d378a7c79f", + "runtimeCodeHash": "0xdb307489fd9a4a438b5b48909e12020b209280ad777561c0a7451655db097e75", + "txHash": "0x6c92edf1c385983d57be0635cf40e1d1068d778edecf2be1631f51556c731af7", + "proxy": true, + "implementation": { + "address": "0x20a14D78848BC8B3F3d4B77239F2adC3C0259A10", + "creationCodeHash": "0x2f3c1dcd9c0abbafd708a5ba243e4afaa115a18f7a4a7db9728cc75e8a8c48fb", + "runtimeCodeHash": "0x4c9896765a37b29d0de3a6f37df1903f7efe1f62e937cb31fdfedd8be7f3008e", + "txHash": "0x6c096b17b867db5775e8d300f0469dec888dde8dbcee03a2294383e23150fbe5", + "libraries": { + "LibExponential": "0xD0AAe7a0A6Ae551DCA969183e1bB376F8a455Ea1" + } + } + }, + "RewardsManager": { + "address": "0x9Ac758AB77733b4150A901ebd659cbF8cB93ED66", + "initArgs": [ + { + "name": "controller", + "value": "0x24CCD4D3Ac8529fF08c58F74ff6755036E616117" + }, + { + "name": "issuanceRate", + "value": "1000000012184945188" + } + ], + "creationCodeHash": "0xa02709eb59b9cca8bee1271845b42db037dc1d042dad93410ba532d378a7c79f", + "runtimeCodeHash": "0xdb307489fd9a4a438b5b48909e12020b209280ad777561c0a7451655db097e75", + "txHash": "0xd3a4d1b3e250e606f56417fd6e43d35bc794e793b1c5be4ffbecc3a43ca1b7b6", + "proxy": true, + "implementation": { + "address": "0xD92944C84826Be7d1D168B239D30AF4583E085e5", + "creationCodeHash": "0x59c1680da2d19124daaf95fd66acc5eae68e6f46dfe2ff0b3ccb777daf9949b2", + "runtimeCodeHash": "0xe33080183ec49ab1ec8d78b80b90158f0f3ac6f2deedf6115a32a9d11d3e4d9b", + "txHash": "0x55256a323baca3666f9c9f4e4141f037aecd7c5110b7db1a3f3ab28802c8dd48" + } + }, + "DisputeManager": { + "address": "0x97307b963662cCA2f7eD50e38dCC555dfFc4FB0b", + "initArgs": [ + { + "name": "controller", + "value": "0x24CCD4D3Ac8529fF08c58F74ff6755036E616117" + }, + { + "name": "arbitrator", + "value": "0xE1FDD398329C6b74C14cf19100316f0826a492d3" + }, + { + "name": "minimumDeposit", + "value": "10000000000000000000000" + }, + { + "name": "fishermanRewardPercentage", + "value": 500000 + }, + { + "name": "slashingPercentage", + "value": 25000 + } + ], + "creationCodeHash": "0xa02709eb59b9cca8bee1271845b42db037dc1d042dad93410ba532d378a7c79f", + "runtimeCodeHash": "0xdb307489fd9a4a438b5b48909e12020b209280ad777561c0a7451655db097e75", + "txHash": "0x90cd5852f5824f76d93814ffea26040ff503c81a84c4430e3688f219f9b48465", + "proxy": true, + "implementation": { + "address": "0x444c138bf2b151f28a713b0ee320240365a5bfc2", + "creationCodeHash": "0xc00c4702d9683f70a90f0b73ce1842e66fa4c26b2cf75fb486a016bb7bac2102", + "runtimeCodeHash": "0x2bb6445bf9e12618423efe9ef64d05e14d283979829e751cd24685c1440c403f", + "txHash": "0x413cd4f8e9e70ad482500772c1f13b0be48deb42d7f2d0d5a74b56d5a6bd8a4d" + } + }, + "AllocationExchange": { + "address": "0x4a53cf3b3EdA545dc61dee0cA21eA8996C94385f", + "initArgs": [ + { + "name": "graphToken", + "value": "0xc944e90c64b2c07662a292be6244bdf05cda44a7" + }, + { + "name": "staking", + "value": "0xf55041e37e12cd407ad00ce2910b8269b01263b9" + }, + { + "name": "governor", + "value": "0x74db79268e63302d3fc69fb5a7627f7454a41732" + }, + { + "name": "authority", + "value": "0x79fd74da4c906509862c8fe93e87a9602e370bc4" + } + ], + "creationCodeHash": "0x1c7b0d7e81fc15f8ccc5b159e2cedb1f152653ebbce895b59eb74a1b26826fda", + "runtimeCodeHash": "0xa63c77e0724a5f679660358452e388f60379f1331e74542afb1436ffb213b960", + "txHash": "0x2ecd036c562f2503af9eaa1a9bca3729bd31ec8a91677530eefbecb398b793ba" + }, + "SubgraphNFTDescriptor": { + "address": "0x8F0B7e136891e8Bad6aa4Abcb64EeeFE29dC2Af0", + "creationCodeHash": "0x7ac0757e66857e512df199569ee11c47a61b00a8d812469b79afa5dafa98c0ed", + "runtimeCodeHash": "0x9a34ad6b202bdfa95ea85654ea2e0dd40a4b8b10847f1c3d3d805fa95a078a3d", + "txHash": "0x77d98358726575ae044ac988b98b63f537951ccae2010e7177c4a7833dce9158" + }, + "SubgraphNFT": { + "address": "0x24e36639b3A3aaA9c928a8A6f12d34F942f1ab67", + "creationCodeHash": "0x8c9929ec6293458209f9cbadd96821604765e3656fe3c7b289b99194ede15336", + "runtimeCodeHash": "0x6309a51754b6bec245685c7a81059dc28e3756f1045f18d059abc9294f454a6a", + "txHash": "0x106c31f2c24a5285c47a766422823766f1c939034513e85613d70d99ef697173" + }, + "BridgeEscrow": { + "address": "0x36aFF7001294daE4C2ED4fDEfC478a00De77F090", + "initArgs": ["0x24CCD4D3Ac8529fF08c58F74ff6755036E616117"], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0x218aff2c804dd3dfe5064b08cab83ffb37382ca2aea1a225c2ead02ec99f38b5", + "proxy": true, + "implementation": { + "address": "0xBcD54513aa593646d72aEA31406c633C235Ad6EA", + "creationCodeHash": "0x6a1fc897c0130a1c99221cde1938d247de13a0861111ac47ad81c691f323df1a", + "runtimeCodeHash": "0xc8e31a4ebea0c3e43ceece974071ba0b6db2bed6725190795e07a2d369d2a8ab", + "txHash": "0x92908e33b54f59ec13a0f7bd29b818c421742294b9974d73859e0bde871bafb9" + } + }, + "L1GraphTokenGateway": { + "address": "0x01cDC91B0A9bA741903aA3699BF4CE31d6C5cC06", + "initArgs": ["0x24CCD4D3Ac8529fF08c58F74ff6755036E616117"], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0xd327568a286d6fcda1a6b78a14c87d660523a6900be901d6a7fbc2504faff64b", + "proxy": true, + "implementation": { + "address": "0xD41ca6A1d034D178c196DFa916f22f7D1a1B8222", + "creationCodeHash": "0x7d6f46e4801d562a8c6fc37779711cce39b3544ea62c6c6517d4b06e8604e38c", + "runtimeCodeHash": "0xa0c0a37340ee949d31c3d41b642c507c58f225c09da9ae3d378e5148cd27081a", + "txHash": "0x25f4234807c7f09b813d4e413311bbe440c8257bc050c71678f63a7abc6e643e" + } + }, + "StakingExtension": { + "address": "0xA479c00cDa8C07bce458D7a826C7b091672EB92C", + "creationCodeHash": "0xe23c59dbfb94b0cf7ef58f654b905977624ce57eaae2fce692edb28ca3f1b3ba", + "runtimeCodeHash": "0xca8ad20187bc87e0e04a15184f529787dd23a0095047d411e1b271617a951c49", + "txHash": "0x13cd940ba9c8dd576f9f311e805539792f4caa88ada5a1b516355edabc776dd8" + } + }, + "5": { + "GraphProxyAdmin": { + "address": "0x6D47902c3358E0BCC06171DE935cB23D8E276fdd", + "creationCodeHash": "0x8b9a4c23135748eb0e4d0e743f7276d86264ace935d23f9aadcfccd64b482055", + "runtimeCodeHash": "0x47aa67e4a85090fe7324268b55fb7b320ee7a8937f2ad02480b71d4bb3332b13", + "txHash": "0xd4be829c13c741b8b56ca5ee7d98d86237ce44df7c11eff73df26cd87d5cab94" + }, + "BancorFormula": { + "address": "0x2DFDC3e11E035dD96A4aB30Ef67fab4Fb6EC01f2", + "creationCodeHash": "0x7ae36017eddb326ddd79c7363781366121361d42fdb201cf57c57424eede46f4", + "runtimeCodeHash": "0xed6701e196ad93718e28c2a2a44d110d9e9906085bcfe4faf4f6604b08f0116c", + "txHash": "0x97ca33e6e7d1d7d62bdec4827f208076922d9c42bf149693b36ab91429e65740" + }, + "Controller": { + "address": "0x48eD7AfbaB432d1Fc6Ea84EEC70E745d9DAcaF3B", + "creationCodeHash": "0x4f2082404e96b71282e9d7a8b7efd0f34996b5edac6711095911d36a57637c88", + "runtimeCodeHash": "0xe31d064a2db44ac10d41d74265b7d4482f86ee95644b9745c04f9fc91006906d", + "txHash": "0x8087bd10cc8d456a7b573bc30308785342db2b90d80f3a750931ab9cf5273b83" + }, + "EpochManager": { + "address": "0x03541c5cd35953CD447261122F93A5E7b812D697", + "initArgs": ["0x48eD7AfbaB432d1Fc6Ea84EEC70E745d9DAcaF3B", "554"], + "creationCodeHash": "0x25a7b6cafcebb062169bc25fca9bcce8f23bd7411235859229ae3cc99b9a7d58", + "runtimeCodeHash": "0xaf2d63813a0e5059f63ec46e1b280eb9d129d5ad548f0cdd1649d9798fde10b6", + "txHash": "0xb1c6189514b52091e35c0349dff29357a2572cd9c2f9ad7f623b2b24252826d1", + "proxy": true, + "implementation": { + "address": "0xb6a641879F195448F3Da10fF3b3C4541808a9342", + "creationCodeHash": "0x729aca90fcffdeede93bc42a6e089a93085ec04133e965cf0291cf6245880595", + "runtimeCodeHash": "0xce525d338b6ed471eeb36d2927a26608cca2d5cfe52bd0585945eacc55b525cf", + "txHash": "0x139630c31b6a5799231572aa0b555a44209acd79fb3df98832d80cf9a1013b58" + } + }, + "GraphToken": { + "address": "0x5c946740441C12510a167B447B7dE565C20b9E3C", + "constructorArgs": ["10000000000000000000000000000"], + "creationCodeHash": "0xa749ef173d768ffe0786529cd23238bc525f4a621a91303d8fb176533c18cec2", + "runtimeCodeHash": "0xe584408c8e04a6200bc7a50816343585ad80f699bd394b89bb96964dbc1a2a92", + "txHash": "0x0639808a47da8a5270bc89eb3009c7d29167c8f32f015648920ec5d114225540" + }, + "GraphCurationToken": { + "address": "0x8bEd0a89F18a801Da9dEA994D475DEa74f75A059", + "creationCodeHash": "0x8c076dacbf98f839a0ff25c197eafc836fc3fc1ee5183c7f157acec17678a641", + "runtimeCodeHash": "0xad138b4c4f34501f83aea6c03a49c103a9115526c993860a9acbd6caeaaf0d64", + "txHash": "0xc09739affd3d9dd43f690d3a487b1c149ad8aa50164995cfbc9de73914ff278a" + }, + "ServiceRegistry": { + "address": "0x7CF8aD279E9F26b7DAD2Be452A74068536C8231F", + "initArgs": ["0x48eD7AfbaB432d1Fc6Ea84EEC70E745d9DAcaF3B"], + "creationCodeHash": "0x25a7b6cafcebb062169bc25fca9bcce8f23bd7411235859229ae3cc99b9a7d58", + "runtimeCodeHash": "0xaf2d63813a0e5059f63ec46e1b280eb9d129d5ad548f0cdd1649d9798fde10b6", + "txHash": "0xf250ef40f4172e54b96047a59cfd7fc35ffabe14484ff1d518e0262195895282", + "proxy": true, + "implementation": { + "address": "0xdC7Fb3a43B9e069df5F07eDc835f60dAc3fD40BA", + "creationCodeHash": "0x45f56a7ad420cd11a8585594fb29121747d87d412161c8779ea36dfd34a48e88", + "runtimeCodeHash": "0x26aceabe83e2b757b2f000e185017528cdde2323c2129fd612180ac3192adfda", + "txHash": "0x2fdb5fa641f707809322107573ce7799711e125cc781aade99fd2948455847ab" + } + }, + "Curation": { + "address": "0xE59B4820dDE28D2c235Bd9A73aA4e8716Cb93E9B", + "initArgs": [ + "0x48eD7AfbaB432d1Fc6Ea84EEC70E745d9DAcaF3B", + "0x2DFDC3e11E035dD96A4aB30Ef67fab4Fb6EC01f2", + "0x8bEd0a89F18a801Da9dEA994D475DEa74f75A059", + "500000", + "10000", + "1000000000000000000" + ], + "creationCodeHash": "0x25a7b6cafcebb062169bc25fca9bcce8f23bd7411235859229ae3cc99b9a7d58", + "runtimeCodeHash": "0xaf2d63813a0e5059f63ec46e1b280eb9d129d5ad548f0cdd1649d9798fde10b6", + "txHash": "0xf1b1f0f28b80068bcc9fd6ef475be6324a8b23cbdb792f7344f05ce00aa997d7", + "proxy": true, + "implementation": { + "address": "0x2b757ad83e4ed51ecae8d4dc9ade8e3fa29f7bdc", + "creationCodeHash": "0xde37904a7c087e05dc5f84e46a7ff35e1f75f013db373c72715d81d21921de4a", + "runtimeCodeHash": "0x867f82ea221eee52ee0db10a2b49ed8051f4ffc4069238d01f8a0110798a51ef", + "txHash": "0x928ed1d624aecbfdb60d5840c2b9cc81573b9dbe3ec96cf6d86dc8194cb7fdac" + } + }, + "SubgraphNFTDescriptor": { + "address": "0xE7e406b4Bfce0B78A751712BFEb1D6B0ce60e8fb", + "creationCodeHash": "0xf16e8ff11d852eea165195ac9e0dfa00f98e48f6ce3c77c469c7df9bf195b651", + "runtimeCodeHash": "0x39583196f2bcb85789b6e64692d8c0aa56f001c46f0ca3d371abbba2c695860f", + "txHash": "0xffee21f6616abd4ffdab0b930dbf44d2ba381a08c3c834798df464fd85e8047e" + }, + "SubgraphNFT": { + "address": "0x083318049968F20EfaEA48b0978EC57bbb0ECbcE", + "constructorArgs": ["0xEfc519BEd6a43a14f1BBBbA9e796C4931f7A5540"], + "creationCodeHash": "0x5de044b15df24beb8781d1ebe71f01301a6b8985183f37eb8d599aa4059a1d3e", + "runtimeCodeHash": "0x6a7751298d6ffdbcf421a3b72faab5b7d425884b04757303123758dbcfb21dfa", + "txHash": "0x8884b65a236c188e4c61cf9593be2f67b27e4f80785939336d659866cfd97aec" + }, + "L1GNS": { + "address": "0x065611D3515325aE6fe14f09AEe5Aa2C0a1f0CA7", + "initArgs": [ + "0x48eD7AfbaB432d1Fc6Ea84EEC70E745d9DAcaF3B", + "0x2DFDC3e11E035dD96A4aB30Ef67fab4Fb6EC01f2", + "0x083318049968F20EfaEA48b0978EC57bbb0ECbcE" + ], + "creationCodeHash": "0x25a7b6cafcebb062169bc25fca9bcce8f23bd7411235859229ae3cc99b9a7d58", + "runtimeCodeHash": "0xaf2d63813a0e5059f63ec46e1b280eb9d129d5ad548f0cdd1649d9798fde10b6", + "txHash": "0x0149f062893acb0eafcbf67acc99da99e03aab3ee2b6b40fbe523d91e0fcecd1", + "proxy": true, + "implementation": { + "address": "0xa95ee5A5f6b45Fcf85A7fa0714f462472C467818", + "creationCodeHash": "0x2e71e4aefc1e678cb9c71882c1da67fc640389337a7d6ae43f78d0f13294594a", + "runtimeCodeHash": "0xde0e02c6a36a90e11c768f40a81430b7e9cda261aa6dada14eaad392d42efc21", + "txHash": "0xbc6e9171943020d30c22197282311f003e79374e6eeeaab9c360942bdf4193f4" + } + }, + "L1Staking": { + "address": "0x35e3Cb6B317690d662160d5d02A5b364578F62c9", + "initArgs": [ + "0x48eD7AfbaB432d1Fc6Ea84EEC70E745d9DAcaF3B", + "100000000000000000000000", + "6646", + "10000", + "100000", + "2", + "4", + "12", + "16", + "77", + "100" + ], + "creationCodeHash": "0x25a7b6cafcebb062169bc25fca9bcce8f23bd7411235859229ae3cc99b9a7d58", + "runtimeCodeHash": "0xaf2d63813a0e5059f63ec46e1b280eb9d129d5ad548f0cdd1649d9798fde10b6", + "txHash": "0x1960be49029284756037cf3ee8afe9eeaba93de4ba84875c5eefd5d2289903bd", + "proxy": true, + "implementation": { + "address": "0x475e6b44ad3F570907C234A7084df5Df65c7430C", + "creationCodeHash": "0x665ac0b452b51bf138cc1ab67e642a06874e754081432ea0fe3dd093c0eef145", + "runtimeCodeHash": "0x1f4490e6582f31ac25b22700b5704b893b9d7641ece59f7f911856f979f0b672", + "txHash": "0x509f8956d8e7a18c37838d9468e1c424558b1af3080087834da3244fa50cba2a", + "libraries": { + "LibExponential": "0xEB421FC914f8e898711974f13F194BCd21e51433" + } + } + }, + "RewardsManager": { + "address": "0x1246D7c4c903fDd6147d581010BD194102aD4ee2", + "initArgs": ["0x48eD7AfbaB432d1Fc6Ea84EEC70E745d9DAcaF3B", "1000000012184945188"], + "creationCodeHash": "0x25a7b6cafcebb062169bc25fca9bcce8f23bd7411235859229ae3cc99b9a7d58", + "runtimeCodeHash": "0xaf2d63813a0e5059f63ec46e1b280eb9d129d5ad548f0cdd1649d9798fde10b6", + "txHash": "0x108efecde4422dacf6ec7a07884cab214ba0a441fc73a6ad82ceb5c73e1c9334", + "proxy": true, + "implementation": { + "address": "0x295b26b449C533bd1831FF7d14c151C95a380e5e", + "creationCodeHash": "0x59c1680da2d19124daaf95fd66acc5eae68e6f46dfe2ff0b3ccb777daf9949b2", + "runtimeCodeHash": "0xe33080183ec49ab1ec8d78b80b90158f0f3ac6f2deedf6115a32a9d11d3e4d9b", + "txHash": "0x112a3c4447e16a75d1ceda6b475df1bdec8353c24de7282f333e734f93da85cc" + } + }, + "DisputeManager": { + "address": "0x8c344366D9269174F10bB588F16945eb47f78dc9", + "initArgs": [ + "0x48eD7AfbaB432d1Fc6Ea84EEC70E745d9DAcaF3B", + "0xFD01aa87BeB04D0ac764FC298aCFd05FfC5439cD", + "10000000000000000000000", + "500000", + "25000", + "25000" + ], + "creationCodeHash": "0x25a7b6cafcebb062169bc25fca9bcce8f23bd7411235859229ae3cc99b9a7d58", + "runtimeCodeHash": "0xaf2d63813a0e5059f63ec46e1b280eb9d129d5ad548f0cdd1649d9798fde10b6", + "txHash": "0xe93eba1bda0d262efabbc05d4e01b9ee197f22dd4f798e4c5fc5b1b9c137428e", + "proxy": true, + "implementation": { + "address": "0x476F0b8e5F952f0740aD3b0cb50648a7496c8388", + "creationCodeHash": "0x5b73c9b910d66426fd965ac3110e9debda1d81134c0354a7af8ec1f2ebd765f6", + "runtimeCodeHash": "0xcaf3547f0d675a1e1d2f887cf4666410bc3b084e65ad283ed3f1ff2b1bccc113", + "txHash": "0x6a90b5e2d5dcae2c94fe518ce7f6fb2ffc11e562b9feac6464dcb32e1e90c039" + } + }, + "AllocationExchange": { + "address": "0x67FBea097202f46D601D7C937b5DBb615659aDF2", + "constructorArgs": [ + "0x5c946740441C12510a167B447B7dE565C20b9E3C", + "0x35e3Cb6B317690d662160d5d02A5b364578F62c9", + "0xf1135bFF22512FF2A585b8d4489426CE660f204c", + "0x52e498aE9B8A5eE2A5Cd26805F06A9f29A7F489F" + ], + "creationCodeHash": "0x97714e1a80674ab0af90a10f2c7156cc92794ef81565fe9c7c35ecbe0025cc08", + "runtimeCodeHash": "0x5c20792fefe71126668be8ab19ab26cdb8ab9a6f73efbfa1d90f91e26459fa67", + "txHash": "0x87b35e5289792800832902206cf0ee4b9900e4d38089bd6634d10ea78729bf54" + }, + "IENS": { + "address": "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e" + }, + "IEthereumDIDRegistry": { + "address": "0xdCa7EF03e98e0DC2B855bE647C39ABe984fcF21B" + }, + "BridgeEscrow": { + "address": "0x8e4145358af77516B886D865e2EcacC0Fd832B75", + "initArgs": ["0x48eD7AfbaB432d1Fc6Ea84EEC70E745d9DAcaF3B"], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0x190ea3c8f731a77a8fd1cbce860f9561f233adeafe559b33201b7d21ccd298cf", + "proxy": true, + "implementation": { + "address": "0xDD569E05D54fBF5d02fE4a26aC03Ea00317A0A2e", + "creationCodeHash": "0x6a1fc897c0130a1c99221cde1938d247de13a0861111ac47ad81c691f323df1a", + "runtimeCodeHash": "0xc8e31a4ebea0c3e43ceece974071ba0b6db2bed6725190795e07a2d369d2a8ab", + "txHash": "0x369038dcc8d8e70d40782dd761a82cc453c7a4f1939284c724a5a72119e3e566" + } + }, + "L1GraphTokenGateway": { + "address": "0xc82fF7b51c3e593D709BA3dE1b3a0d233D1DEca1", + "initArgs": ["0x48eD7AfbaB432d1Fc6Ea84EEC70E745d9DAcaF3B"], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0x4a06731591df5c5f77c11bf8df7851234873eb6727fbbc93f5595a223f7cf3fc", + "proxy": true, + "implementation": { + "address": "0x9e8bab937Cac7c359F5e92248d10C613B3Cd7B8b", + "creationCodeHash": "0x7d6f46e4801d562a8c6fc37779711cce39b3544ea62c6c6517d4b06e8604e38c", + "runtimeCodeHash": "0xa0c0a37340ee949d31c3d41b642c507c58f225c09da9ae3d378e5148cd27081a", + "txHash": "0x517794503416be02d916d289f4e7510359d17567bec987da99319e27e5f40fc1" + } + }, + "StakingExtension": { + "address": "0x163203D9fae9eB88a8B3a11B1778710D6F855907", + "creationCodeHash": "0xe23c59dbfb94b0cf7ef58f654b905977624ce57eaae2fce692edb28ca3f1b3ba", + "runtimeCodeHash": "0xca8ad20187bc87e0e04a15184f529787dd23a0095047d411e1b271617a951c49", + "txHash": "0x20a0c0f2a26258e1c63f33f3a5651580bb74ea4bf0e66076ebbdda4fa41d5955" + } + }, + "42161": { + "GraphProxyAdmin": { + "address": "0x2983936aC20202a6555993448E0d5654AC8Ca5fd", + "creationCodeHash": "0x68b304ac6bce7380d5e0f6b14a122f628bffebcc75f8205cb60f0baf578b79c3", + "runtimeCodeHash": "0x8d9ba87a745cf82ab407ebabe6c1490197084d320efb6c246d94bcc80e804417", + "txHash": "0x3ff82c38ec0e08e8f4194689188edcc1e8acb1f231c14cce8f0223f4dfc6cb76" + }, + "BancorFormula": { + "address": "0xA489FDc65229D6225014C0b357BCD19af6f00eE9", + "creationCodeHash": "0x7ae36017eddb326ddd79c7363781366121361d42fdb201cf57c57424eede46f4", + "runtimeCodeHash": "0xed6701e196ad93718e28c2a2a44d110d9e9906085bcfe4faf4f6604b08f0116c", + "txHash": "0xb2bb14ba3cbd1bb31b08b86aced469745f9888710254bb3baed047f435e788c0" + }, + "Controller": { + "address": "0x0a8491544221dd212964fbb96487467291b2C97e", + "creationCodeHash": "0x798f913fbaa1b2547c917e3dc31679089ab27cba442c511c159803acdba28c15", + "runtimeCodeHash": "0x00ae0824f79c4e48d2d23a8d4e6d075f04f44f3ea30a4f4305c345bb98117c62", + "txHash": "0x2a9d5744ad0e5e2e6bb6733ae890702fed2bce906e4e8b1cc50d2d3912c58d18" + }, + "EpochManager": { + "address": "0x5A843145c43d328B9bB7a4401d94918f131bB281", + "initArgs": ["0x0a8491544221dd212964fbb96487467291b2C97e", "6646"], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0x4c70b8a56278452898d9eb23787a977d38141ebe48c79417c3acf6748ff921cf", + "proxy": true, + "implementation": { + "address": "0xeEDEdb3660154f439D93bfF612f7902edf07b848", + "creationCodeHash": "0x83bc0b08dbe1a9259666ec209f06223863f7bb9cfbf917a2d4b795c771a727fe", + "runtimeCodeHash": "0xed60261c6dc84ebc16830c36f3ee370a92802601d5a2fe1c3c19f5120dcbc2eb", + "txHash": "0x64fac1c567b7be735084b337a1e4ea9b990a8ffee8190485dc9b8dfcc257146c" + } + }, + "L2GraphToken": { + "address": "0x9623063377AD1B27544C965cCd7342f7EA7e88C7", + "initArgs": ["0x4528FD7868c91Ef64B9907450Ee8d82dC639612c"], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0x8465190df853c05bbdec00ba6b66139be0e5663fd5b740bdd464ad7409ce2100", + "proxy": true, + "implementation": { + "address": "0xaFFCb96181D920FE8C0Af046C49B2c9eC98b28df", + "creationCodeHash": "0x6c4146427aafa7375a569154be95c8c931bf83aab0315706dd78bdf79c889e4c", + "runtimeCodeHash": "0x004371d1d80011906953dcba17c648503fc94b94e1e0365c8d8c706ff91f93e9", + "txHash": "0xbd7d146ce80831ed7643e9f5b5a84737da354994ae080cb3d7ff7bbc3e696b3d" + } + }, + "GraphCurationToken": { + "address": "0x47a0d56ea574419B524285d52fFe7198297D209c", + "creationCodeHash": "0x1ee42ee271cefe20c33c0de904501e618ac4b56debca67c634d0564cecea9ff2", + "runtimeCodeHash": "0x340e8f378c0117b300f3ec255bc5c3a273f9ab5bd2940fa8eb3b5065b21f86dc", + "txHash": "0x382568f1871a3d57f4d3787b255a2364e9926cb6770fdca3cde6cb04b577ecd5" + }, + "ServiceRegistry": { + "address": "0x072884c745c0A23144753335776c99BE22588f8A", + "initArgs": ["0x0a8491544221dd212964fbb96487467291b2C97e"], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0x54b1da3f2fdd2327abe01f75ac38a670ee16d3f47bc58641ddaef04f0b9d0f78", + "proxy": true, + "implementation": { + "address": "0xD32569dA3B89b040A0589B5b8D2c721a68472ff3", + "creationCodeHash": "0x50808e8cce93cf78a23c9e6dd7984356bd2bd93be30b358982909140dd61f6ff", + "runtimeCodeHash": "0xaef79c87f7e80107c0dc568cf1f8950459b5174ee3aa565ec487556a655e71db", + "txHash": "0xca363c6bc841b43bd896b6d2098434679884d200a28013dedb48a2c95028ce40" + } + }, + "L2Curation": { + "address": "0x22d78fb4bc72e191C765807f8891B5e1785C8014", + "initArgs": [ + "0x0a8491544221dd212964fbb96487467291b2C97e", + "0xA489FDc65229D6225014C0b357BCD19af6f00eE9", + "0x47a0d56ea574419B524285d52fFe7198297D209c", + "1000000", + "10000", + "1000000000000000000" + ], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0x8f856e2090af3243349199f7991e01b1c28de7b70b0185d2370d8ada5ce9c97b", + "proxy": true, + "implementation": { + "address": "0x41Ad970e071aadbE098c17aDFCff2fF3105456Ae", + "creationCodeHash": "0x2c7b48c311e8f0cb03513d4ca4c0010132d7402f1aabb1dd65f28cdcf07255ba", + "runtimeCodeHash": "0xa750bd231f2b1ec9ffaeef4de79eddbde8aca9bdbf4c9125424eea644bf27aff", + "txHash": "0x7b03bc16b3af6a650ff866311b1f580936e8b7264ddb4c6348fb824c508d1dcb" + } + }, + "SubgraphNFTDescriptor": { + "address": "0x96cce9b6489744630A058324FB22e7CD02815ebe", + "creationCodeHash": "0xf16e8ff11d852eea165195ac9e0dfa00f98e48f6ce3c77c469c7df9bf195b651", + "runtimeCodeHash": "0x39583196f2bcb85789b6e64692d8c0aa56f001c46f0ca3d371abbba2c695860f", + "txHash": "0xbb01566726e1d58825cf7aa2860f0f571ff47f92b3837aad0e73e7791fbca48c" + }, + "SubgraphNFT": { + "address": "0x3FbD54f0cc17b7aE649008dEEA12ed7D2622B23f", + "constructorArgs": ["0x4528FD7868c91Ef64B9907450Ee8d82dC639612c"], + "creationCodeHash": "0xc1e58864302084de282dffe54c160e20dd96c6cfff45e00e6ebfc15e04136982", + "runtimeCodeHash": "0x7216e736a8a8754e88688fbf5c0c7e9caf35c55ecc3a0c5a597b951c56cf7458", + "txHash": "0x4334bd64938c1c5c604bde96467a8601875046569f738e6860851594c91681ff" + }, + "L2GNS": { + "address": "0xec9A7fb6CbC2E41926127929c2dcE6e9c5D33Bec", + "initArgs": [ + "0x0a8491544221dd212964fbb96487467291b2C97e", + "0xA489FDc65229D6225014C0b357BCD19af6f00eE9", + "0x3FbD54f0cc17b7aE649008dEEA12ed7D2622B23f" + ], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0xf7f2747d1aafd1684ffee7316e727475249cd358af559c6234089b72ffc25f5d", + "proxy": true, + "implementation": { + "address": "0x9B81c7C5A21E65b849FD487540B0A82d3b97b2c7", + "creationCodeHash": "0xd71f45e6c194920a26f90fcec96d8c3375f02c5aef8ad90c1be24e906ffe8342", + "runtimeCodeHash": "0x68ec24512fedb866d7ba7ba6c02160317d0ca34eaacd23bddcc62d2cbcd9869c", + "txHash": "0xfaecc9eb83958359f7440b3dbe1747c2191590acbbde920f191c94352cc0b6d7" + } + }, + "L2Staking": { + "address": "0x00669A4CF01450B64E8A2A20E9b1FCB71E61eF03", + "initArgs": [ + "0x0a8491544221dd212964fbb96487467291b2C97e", + "100000000000000000000000", + "186092", + "10000", + "100000", + "7", + "28", + "28", + "16", + "77", + "100" + ], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0xa33c0d58ddaed7e3f7381a33e3d5f63e39219863019f00d54ce2fd2446076ac7", + "proxy": true, + "implementation": { + "address": "0x0Dae36adCbE384a31309269448E09465B2288429", + "creationCodeHash": "0x7bd2944ba001c51a42d88f89b10eb894e11be62ee96e76331309ff6a8e9b20ff", + "runtimeCodeHash": "0x0808fafef220cfddb64a51f680a18e455d5b7c6b9c0c7aad8f8067f4775dd204", + "txHash": "0x6bdee0f03f74df2b7e6141075b06a88b201cbc78a131aa0fe6bb1ef1da1e2dc1", + "libraries": { + "LibExponential": "0x6F436161bBa439FB7D0A6192D22dd8fcE4C26Fb5" + } + } + }, + "RewardsManager": { + "address": "0x971B9d3d0Ae3ECa029CAB5eA1fB0F72c85e6a525", + "initArgs": ["0x0a8491544221dd212964fbb96487467291b2C97e"], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0x222e14cb6f49e3e7b76f6a523c1a3c24f96402676be8662bf1b94bb2250ddd0f", + "proxy": true, + "implementation": { + "address": "0x5912Afc5E0f430B0F84b792E9C7CC892b4bE6Bdb", + "creationCodeHash": "0x59c1680da2d19124daaf95fd66acc5eae68e6f46dfe2ff0b3ccb777daf9949b2", + "runtimeCodeHash": "0xe33080183ec49ab1ec8d78b80b90158f0f3ac6f2deedf6115a32a9d11d3e4d9b", + "txHash": "0x4ac3d936067601dab0ccab5ccd544edbe8457b56c43c6e2f370d33acdb806d19" + } + }, + "DisputeManager": { + "address": "0x0Ab2B043138352413Bb02e67E626a70320E3BD46", + "initArgs": [ + "0x0a8491544221dd212964fbb96487467291b2C97e", + "0x113DC95e796836b8F0Fa71eE7fB42f221740c3B0", + "10000000000000000000000", + "500000", + "25000", + "25000" + ], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0x68f08fe0a1179170c8b4c7542725d71432b4171604d7456dff824e0ec1c6cdb9", + "proxy": true, + "implementation": { + "address": "0x358bCB57F9893188c1f5CA4e3390C8E84dAAD9B9", + "creationCodeHash": "0xce4c47d94a33d69e03d607dd13a9ad1ed7fa730ef4a2308eb56ddd646ebaa0aa", + "runtimeCodeHash": "0x18d4a1659ccecede3d4d305ef1db4653d8f3dcbd4012f4e52200ae9f0c6c322c", + "txHash": "0xc6b7c7ac5e1b800326fdc99a12262a1528f46fbd0881b5869d7c5a1709c6e0ce" + } + }, + "AllocationExchange": { + "address": "0x993F00C98D1678371a7b261Ed0E0D4b6F42d9aEE", + "constructorArgs": [ + "0x9623063377AD1B27544C965cCd7342f7EA7e88C7", + "0x00669A4CF01450B64E8A2A20E9b1FCB71E61eF03", + "0x270Ea4ea9e8A699f8fE54515E3Bb2c418952623b", + "0x79f2212de27912bCb25a452fC102C85c142E3eE3" + ], + "creationCodeHash": "0x96c5b59557c161d80f1617775a7b9537a89b0ecf2258598b3a37724be91ae80a", + "runtimeCodeHash": "0xc86fd1d67a0db0aed4cb310f977ebf3e70865e2095a167f4a103c3792146027c", + "txHash": "0x2bad6b8e5eda0026c8c38a70b925bbedd6a617a1e06952fb30e427fdbc592422" + }, + "L2GraphTokenGateway": { + "address": "0x65E1a5e8946e7E87d9774f5288f41c30a99fD302", + "initArgs": ["0x0a8491544221dd212964fbb96487467291b2C97e"], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0x50816047ea926423ec02b6b89efb96efcd3d7e7028ea7cf82c3da9fd1bf3869e", + "proxy": true, + "implementation": { + "address": "0x6f37b2AF8A0Cc74f1bFddf2E9302Cb226710127F", + "creationCodeHash": "0xbd52455bd8b14bfc27af623388fe2f9e06ddd4c4be3fc06c51558a912de91770", + "runtimeCodeHash": "0x29e47f693053f978d6b2ac0a327319591bf5b5e8a6e6c0744b8afcc0250bf667", + "txHash": "0x0eaa9d03982b88e765262a15b95548cb688ce9337a48460f39e55f8850690cbe" + } + }, + "EthereumDIDRegistry": { + "address": "0xa9AEb1c6f14f4244547B9a0946C485DA99047638", + "creationCodeHash": "0x20cd202f7991716a84c097da5fbd365fd27f7f35f241f82c529ad7aba18b814b", + "runtimeCodeHash": "0x5f396ffd54b6cd6b3faded0f366c5d7e148cc54743926061be2dfd12a75391de", + "txHash": "0xdd23b546fa3b6be0cea2339abe3023a082153693fbc7bf1bc86d190165823b39" + }, + "IEthereumDIDRegistry": { + "address": "0xa9AEb1c6f14f4244547B9a0946C485DA99047638" + }, + "StakingExtension": { + "address": "0x3bE385576d7C282070Ad91BF94366de9f9ba3571", + "constructorArgs": [], + "creationCodeHash": "0xbfc20ab9b880712ab90b5dec9d2a14c724b0bf7c20f02ede8ea76610bd41b6ef", + "runtimeCodeHash": "0xd7fdd744c7a88993435a2978876b1e4341c5e0fb4d611011bb56e8738ab2485d", + "txHash": "0xcc449d1ca1007fba76b25e987ea0d39164acf4027c10c40bd669ede1c65dc569" + }, + "SubgraphAvailabilityManager": { + "address": "0x1cB555359319A94280aCf85372Ac2323AaE2f5fd", + "constructorArgs": [ + "0x8C6de8F8D562f3382417340A6994601eE08D3809", + "0x971B9d3d0Ae3ECa029CAB5eA1fB0F72c85e6a525", + "3", + "300", + [ + "0xdcAA0a094F2Eb7cF7f73248EE64217D59B7B938d", + "0xBD9dc46cb1dd9F31dCbF0617c2Dd5f77A21dB8e8", + "0x16eAd4088d4308a7A4E0F7a1455ed56CDf1AC8AA", + "0x61923453906Eadc15fc1F610B8D1b67bc27658c2", + "0x10eb33C5E2fb6c7a37B110Cc4930d03A9e4C4D09" + ] + ], + "creationCodeHash": "0xc34842fa42ee2f21e3a435b52fa69a122a5de795448faa890fbc63d4838f45da", + "runtimeCodeHash": "0x52fcfd39c6ab3cf5ed4a736bc38eb1153d73c8cf1ca9e23370badc7843467ab4", + "txHash": "0x2eb44036d157e39c56377403029aebde4961028b404fc8c3f4cadc0f299d06dd" + } + }, + "421613": { + "GraphProxyAdmin": { + "address": "0x4037466bb242f51575d32E8B1be693b3E5Cd1386", + "creationCodeHash": "0x68b304ac6bce7380d5e0f6b14a122f628bffebcc75f8205cb60f0baf578b79c3", + "runtimeCodeHash": "0x8d9ba87a745cf82ab407ebabe6c1490197084d320efb6c246d94bcc80e804417", + "txHash": "0x9c4d5f8c0ab5a5bc36b0a063ab1ff04372ce7d917c0b200b94544b5da4f0230d" + }, + "BancorFormula": { + "address": "0x71319060b9fdeD6174b6368bE04F9A1b7c9aCe48", + "creationCodeHash": "0x7ae36017eddb326ddd79c7363781366121361d42fdb201cf57c57424eede46f4", + "runtimeCodeHash": "0xed6701e196ad93718e28c2a2a44d110d9e9906085bcfe4faf4f6604b08f0116c", + "txHash": "0x7fe8cabb7a4fe56311591aa8d68d6c82cb0d5c232fc5aaf28bed4d1ece0e42e5" + }, + "Controller": { + "address": "0x7f734E995010Aa8d28b912703093d532C37b6EAb", + "creationCodeHash": "0x798f913fbaa1b2547c917e3dc31679089ab27cba442c511c159803acdba28c15", + "runtimeCodeHash": "0x00ae0824f79c4e48d2d23a8d4e6d075f04f44f3ea30a4f4305c345bb98117c62", + "txHash": "0x6213da3e6367ef47cd6e1fe23e4d83296f16153a64236a5c91f865f2ec84c089" + }, + "EpochManager": { + "address": "0x8ECedc7631f4616D7f4074f9fC9D0368674794BE", + "initArgs": ["0x7f734E995010Aa8d28b912703093d532C37b6EAb", "554"], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0x62b0d6b8556be9443397ad1f6030fdc47b1a4a3ebcc63f34cdf4091420aec84b", + "proxy": true, + "implementation": { + "address": "0xAaB195Ed1B445A2A0E357494d9036bC746227AE2", + "creationCodeHash": "0x83bc0b08dbe1a9259666ec209f06223863f7bb9cfbf917a2d4b795c771a727fe", + "runtimeCodeHash": "0xed60261c6dc84ebc16830c36f3ee370a92802601d5a2fe1c3c19f5120dcbc2eb", + "txHash": "0xd4f8780490f63432580e3dd5b2b4d9b39e904e8b4ac5cfd23540658cbafe449d" + } + }, + "L2GraphToken": { + "address": "0x18C924BD5E8b83b47EFaDD632b7178E2Fd36073D", + "initArgs": ["0xEfc519BEd6a43a14f1BBBbA9e796C4931f7A5540"], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0x7ec14b524141af953959b537c1acbea9b49b12ee906563a6172123b09ab3d1f6", + "proxy": true, + "implementation": { + "address": "0x5dcAcF820D7b9F0640e8a23a5a857675A774C34a", + "creationCodeHash": "0x6c4146427aafa7375a569154be95c8c931bf83aab0315706dd78bdf79c889e4c", + "runtimeCodeHash": "0x004371d1d80011906953dcba17c648503fc94b94e1e0365c8d8c706ff91f93e9", + "txHash": "0xb748498a2ebc90e20dc8da981be832f4e00f08ea9ff289880738705e45d6aeca" + } + }, + "GraphCurationToken": { + "address": "0x2B757ad83e4ed51ecaE8D4dC9AdE8E3Fa29F7BdC", + "creationCodeHash": "0x1ee42ee271cefe20c33c0de904501e618ac4b56debca67c634d0564cecea9ff2", + "runtimeCodeHash": "0x340e8f378c0117b300f3ec255bc5c3a273f9ab5bd2940fa8eb3b5065b21f86dc", + "txHash": "0x1aa753cd01fa4505c71f6866dae35faee723d181141ed91b6e5cf3082ee90f9b" + }, + "ServiceRegistry": { + "address": "0x07ECDD4278D83Cd2425cA86256634f666b659e53", + "initArgs": ["0x7f734E995010Aa8d28b912703093d532C37b6EAb"], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0x8a13420fdc91139297ab1497fbf5b443c156bbc7b9d2a1ac97fb9f23abde2723", + "proxy": true, + "implementation": { + "address": "0xd18D4B4e84eA4713E04060c93bD079A974BE6C4a", + "creationCodeHash": "0x50808e8cce93cf78a23c9e6dd7984356bd2bd93be30b358982909140dd61f6ff", + "runtimeCodeHash": "0xaef79c87f7e80107c0dc568cf1f8950459b5174ee3aa565ec487556a655e71db", + "txHash": "0x2d6043d89a5f5c4f3d0df0f50264ab7efebc898be0b5d358a00715ba9f657a89" + } + }, + "L2Curation": { + "address": "0x7080AAcC4ADF4b1E72615D6eb24CDdE40a04f6Ca", + "initArgs": [ + "0x7f734E995010Aa8d28b912703093d532C37b6EAb", + "0x71319060b9fdeD6174b6368bE04F9A1b7c9aCe48", + "0x2B757ad83e4ed51ecaE8D4dC9AdE8E3Fa29F7BdC", + "1000000", + "10000", + "1000000000000000000" + ], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0x2e5744fa4eca56cf6902e27fcc0509487f39bdb0d29b9eb0181db986235289a0", + "proxy": true, + "implementation": { + "address": "0xDA6c9d39b49c3d41CaC2030c6B75b40Efea09817", + "creationCodeHash": "0xa5fa77df71a72c5aadba812345978c291c5fa1a3a23129b6eba3a38ac85d8b5d", + "runtimeCodeHash": "0x1d265e9f658778b48a0247cfef79bfc9304d1faa1f1e085f2fea85629f68e2d5", + "txHash": "0x815eda87a2599d6f2c7458c7b164e7307d05018f0dd72073a50971d424313377" + } + }, + "SubgraphNFTDescriptor": { + "address": "0x30545f313bD2eb0F85E4f808Ae4D2C016efE78b2", + "creationCodeHash": "0xf16e8ff11d852eea165195ac9e0dfa00f98e48f6ce3c77c469c7df9bf195b651", + "runtimeCodeHash": "0x39583196f2bcb85789b6e64692d8c0aa56f001c46f0ca3d371abbba2c695860f", + "txHash": "0x060839a09e89cbd47adbb8c04cc76b21a00785600a4e8b44939dd928391777e1" + }, + "SubgraphNFT": { + "address": "0x5571D8FE183AD1367dF21eE9968690f0Eabdc593", + "constructorArgs": ["0xEfc519BEd6a43a14f1BBBbA9e796C4931f7A5540"], + "creationCodeHash": "0xc1e58864302084de282dffe54c160e20dd96c6cfff45e00e6ebfc15e04136982", + "runtimeCodeHash": "0x7216e736a8a8754e88688fbf5c0c7e9caf35c55ecc3a0c5a597b951c56cf7458", + "txHash": "0xc11917ffedda6867648fa2cb62cca1df3c0ed485a0a0885284e93a2c5d33455c" + }, + "L2GNS": { + "address": "0x6bf9104e054537301cC23A1023Ca30A6Df79eB21", + "initArgs": [ + "0x7f734E995010Aa8d28b912703093d532C37b6EAb", + "0x71319060b9fdeD6174b6368bE04F9A1b7c9aCe48", + "0x5571D8FE183AD1367dF21eE9968690f0Eabdc593" + ], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0x3c2509730e06249d970818319bb507185d4fdea13d5600cef87928a718950c19", + "proxy": true, + "implementation": { + "address": "0x80A6500EFD52C66820dB0E8014088B4eBf8B8f52", + "creationCodeHash": "0xd2aa0d4e2d6ca8d0b2067d249d3202a340b13291a65e23c46f5c04df703bfc0e", + "runtimeCodeHash": "0xa88669e10cde56141250596f6f034629b1bf55086a3ed21ebb0e2bd3b3fca991", + "txHash": "0x3bb004adf949e9c896e85f6e3124ecea0c223470e3a091e42539613d52679c4d" + } + }, + "L2Staking": { + "address": "0xcd549d0C43d915aEB21d3a331dEaB9B7aF186D26", + "initArgs": [ + "0x7f734E995010Aa8d28b912703093d532C37b6EAb", + "100000000000000000000000", + "6646", + "10000", + "100000", + "2", + "4", + "12", + "16", + "77", + "100" + ], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0xc98ebdd0a80b97ef8f6305903ef6496a7781db76a5b1b3c3c3b2b10dbd9a7af5", + "proxy": true, + "implementation": { + "address": "0x75CeE6C9EE7c03Ba7cAd82E98FFB57672d7caeBc", + "creationCodeHash": "0x3fd633cabdb4545d667b8e188b5fe8b6326bfd4a8809908f77b7e447c46a22e8", + "runtimeCodeHash": "0x54ba28cc34f7e24b9e1a8e8595f9ecfe4bb7ad70c226444b7a9aa3d26589bbc7", + "txHash": "0x357ab1915642f845527a136aa654c0c18cb43dbb79d4fe297fdf8210fb30082e", + "libraries": { + "LibExponential": "0xdE74fcD55A1E3829EC4FE934f5776bC14bc99917" + } + } + }, + "RewardsManager": { + "address": "0x5F06ABd1CfAcF7AE99530D7Fed60E085f0B15e8D", + "initArgs": ["0x7f734E995010Aa8d28b912703093d532C37b6EAb"], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0xd4cfa95475e9e867fb24babd6a00a5b6b01d2267533e2412986aa1ff94d51c02", + "proxy": true, + "implementation": { + "address": "0x87f2fAb2C8c422AE0f866D004207fa65bdfD2df2", + "creationCodeHash": "0x59c1680da2d19124daaf95fd66acc5eae68e6f46dfe2ff0b3ccb777daf9949b2", + "runtimeCodeHash": "0xe33080183ec49ab1ec8d78b80b90158f0f3ac6f2deedf6115a32a9d11d3e4d9b", + "txHash": "0xac157ea27b57c36ae336768aef9cd8f74d39b13ff621cd18683db544804b5a3c" + } + }, + "DisputeManager": { + "address": "0x16DEF7E0108A5467A106dbD7537f8591f470342E", + "initArgs": [ + "0x7f734E995010Aa8d28b912703093d532C37b6EAb", + "0xF89688d5d44d73cc4dE880857A3940487076e5A4", + "10000000000000000000000", + "500000", + "25000", + "25000" + ], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0x70188c9243c2226ac793ac8c0a9eecd76c9b44e53f7f6f97fa177a34808421a0", + "proxy": true, + "implementation": { + "address": "0x39aEdA1d6ea3B62b76C7c439beBfFCb5369a175C", + "creationCodeHash": "0x2e77ad7a1627b6e04bece0fe18b3ab543ef4a2d6914f2e5e640b2c8175aca3a8", + "runtimeCodeHash": "0x0186afe711eff4ceea28620d091e3c6034fd15be05894119c74a38b020e3a554", + "txHash": "0x4efbd28e55866c0292309964f47bd805922ad417e5980e14e055ad693024582d" + } + }, + "AllocationExchange": { + "address": "0x61809D6Cde07f27D2fcDCb67a42d0Af1988Be5e8", + "constructorArgs": [ + "0x18C924BD5E8b83b47EFaDD632b7178E2Fd36073D", + "0xcd549d0C43d915aEB21d3a331dEaB9B7aF186D26", + "0x05F359b1319f1Ca9b799CB6386F31421c2c49dBA", + "0xD06f366678AE139a94b2AaC2913608De568F1D03" + ], + "creationCodeHash": "0x96c5b59557c161d80f1617775a7b9537a89b0ecf2258598b3a37724be91ae80a", + "runtimeCodeHash": "0xed3d9cce65ddfa8a237d4d7d294ffdb13a082e0adcda3bbd313029cfae1365f3", + "txHash": "0x1df63329a21dca69d20e03c076dd89c350970d35319eeefab028cebbc78d29dc" + }, + "L2GraphTokenGateway": { + "address": "0xef2757855d2802bA53733901F90C91645973f743", + "initArgs": ["0x7f734E995010Aa8d28b912703093d532C37b6EAb"], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0x47bde4e3ad0bc077897a3de65058c4b7dd710aa447ec25942f716321cbdc590d", + "proxy": true, + "implementation": { + "address": "0xc68cd0d2ca533232Fd86D6e48b907338B2E0a74A", + "creationCodeHash": "0xbd52455bd8b14bfc27af623388fe2f9e06ddd4c4be3fc06c51558a912de91770", + "runtimeCodeHash": "0x29e47f693053f978d6b2ac0a327319591bf5b5e8a6e6c0744b8afcc0250bf667", + "txHash": "0xf68a5e1e516ee9a646f19bbe4d58336fdfcf5fc859f84cdac5e68b00bcd3a09a" + } + }, + "IEthereumDIDRegistry": { + "address": "0x8FFfcD6a85D29E9C33517aaf60b16FE4548f517E" + }, + "StakingExtension": { + "address": "0x5c54fB391003bef3002A79C656a29F09C59E2795", + "creationCodeHash": "0xe23c59dbfb94b0cf7ef58f654b905977624ce57eaae2fce692edb28ca3f1b3ba", + "runtimeCodeHash": "0xca8ad20187bc87e0e04a15184f529787dd23a0095047d411e1b271617a951c49", + "txHash": "0x69eca0ff395bb348cc8d29bb1681afe24515f618bce9a093ad5a02140e15b867" + } + }, + "421614": { + "GraphProxyAdmin": { + "address": "0x7474a6cc5fAeDEc620Db0fa8E4da6eD58477042C", + "creationCodeHash": "0x68b304ac6bce7380d5e0f6b14a122f628bffebcc75f8205cb60f0baf578b79c3", + "runtimeCodeHash": "0x8d9ba87a745cf82ab407ebabe6c1490197084d320efb6c246d94bcc80e804417", + "txHash": "0x71b6defab0d3d7b711b7f6769f20a8c85bc9686eb5939b2a86dfaf587fceab17" + }, + "Controller": { + "address": "0x9DB3ee191681f092607035d9BDA6e59FbEaCa695", + "creationCodeHash": "0x5bde9a87bc4e8dd24d41900f0a19321c1dc6d3373d51bba093b130bb5b80a677", + "runtimeCodeHash": "0x7f0479db1d60ecf6295d92ea2359ebdd223640795613558b0594680f5d4922c9", + "txHash": "0xf7b4faa14f9d29bb62dec73fd163d1253184233012bcadf7ae78af7995017f29" + }, + "EpochManager": { + "address": "0x88b3C7f37253bAA1A9b95feAd69bD5320585826D", + "initArgs": ["0x9DB3ee191681f092607035d9BDA6e59FbEaCa695", "554"], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0x587ea6f421a08ab3a390103f63daba0529901f2e662ca7f6fe575674a439fa79", + "proxy": true, + "implementation": { + "address": "0x646627fa39ec6f6E757Cb4189bC54c92FFBb71da", + "creationCodeHash": "0x9947bd0a1f46027123b8fb4aec8b11af540aea587eb79642475d57b4e347078f", + "runtimeCodeHash": "0xe45a27197726de0e3149014823794708edd432ee56ec8358554c0d2365674ca0", + "txHash": "0x82653a0bd83e0541379b920415af94e4be1d732dfab720e5dead839062781c07" + } + }, + "L2GraphToken": { + "address": "0xf8c05dCF59E8B28BFD5eed176C562bEbcfc7Ac04", + "initArgs": ["0xadE6B8EB69a49B56929C1d4F4b428d791861dB6f"], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0xbb27939a4e4b5d92da8a10add4b7d0126e907da30b07b5f3d439f1c32a6c8e2c", + "proxy": true, + "implementation": { + "address": "0x4cf968bA38b43dd10be114daa7959C1b369479e5", + "creationCodeHash": "0x6c4146427aafa7375a569154be95c8c931bf83aab0315706dd78bdf79c889e4c", + "runtimeCodeHash": "0x004371d1d80011906953dcba17c648503fc94b94e1e0365c8d8c706ff91f93e9", + "txHash": "0x3fab5697addf0c0e16b8e2249f2b833c6f256e699b293d184089c96de8deaa44" + } + }, + "GraphCurationToken": { + "address": "0x00FBd5D46FFAc54862c1Dd27BE08924BB17f5CDa", + "creationCodeHash": "0x1ee42ee271cefe20c33c0de904501e618ac4b56debca67c634d0564cecea9ff2", + "runtimeCodeHash": "0x340e8f378c0117b300f3ec255bc5c3a273f9ab5bd2940fa8eb3b5065b21f86dc", + "txHash": "0x045d64dc3ebb7ae6c4976854ce0a797a04524d22a6ef5f526bfc27f744bc68e5" + }, + "ServiceRegistry": { + "address": "0x888541878CbDDEd880Cd58c728f1Af5C47343F86", + "initArgs": ["0x9DB3ee191681f092607035d9BDA6e59FbEaCa695"], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0xdaa1228e8cd8569c1e5562b63d2fd89caf897ab67da05922636d3309b838e289", + "proxy": true, + "implementation": { + "address": "0x05E732280bf9F37054346Cb83f5Fd58C5B44F6A8", + "creationCodeHash": "0xec9cb879003a06609541ad87efd4bc5dfc8ea60e4e77cfa5ae2cb5208742e7bc", + "runtimeCodeHash": "0x5161b534164413a88d851832f9c9d1dd1bca32fe2bbb62bb35d112c1dc8b69ab", + "txHash": "0xe1fce867f5dd708e60518b7f257fdbcb28f460d1e3b82045b82d03e64345b210" + } + }, + "L2Curation": { + "address": "0xDe761f075200E75485F4358978FB4d1dC8644FD5", + "initArgs": [ + "0x9DB3ee191681f092607035d9BDA6e59FbEaCa695", + "0x00FBd5D46FFAc54862c1Dd27BE08924BB17f5CDa", + "10000", + "1" + ], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0xe9298239bcb3c386cf66e6dd493cf6e7cdd9771c65fa2225e0b34d17550d6805", + "proxy": true, + "implementation": { + "address": "0xd90022aB67920212D0F902F5c427DE82732DE136", + "creationCodeHash": "0x2287d9023bf7d91e688e1eb029eff7657ef3b87e37b5222b01fd50985d0928f9", + "runtimeCodeHash": "0xd799b2b74e9634d6b6ef15b5710409264bed04a60f9519b9d8f05ac183199d16", + "txHash": "0x436bcf91fed712dc8d54f449726b2078fb63cd770f90b492a9622efac5817762" + } + }, + "SubgraphNFTDescriptor": { + "address": "0x4032F7B6b27FfC9862106f826379DaB1716C71d7", + "creationCodeHash": "0xf16e8ff11d852eea165195ac9e0dfa00f98e48f6ce3c77c469c7df9bf195b651", + "runtimeCodeHash": "0x39583196f2bcb85789b6e64692d8c0aa56f001c46f0ca3d371abbba2c695860f", + "txHash": "0xb7e7aeeecc693f34f491b01c56950533119810a4e3e2642081efc127f11cb782" + }, + "SubgraphNFT": { + "address": "0xF21Df5BbA7EB9b54D8F60C560aFb9bA63e6aED1A", + "constructorArgs": ["0xadE6B8EB69a49B56929C1d4F4b428d791861dB6f"], + "creationCodeHash": "0xc1e58864302084de282dffe54c160e20dd96c6cfff45e00e6ebfc15e04136982", + "runtimeCodeHash": "0x7216e736a8a8754e88688fbf5c0c7e9caf35c55ecc3a0c5a597b951c56cf7458", + "txHash": "0x1309c1caea76f4014ba612de092cc746816119b1440d635d11b6bc7e361a32b0" + }, + "L2GNS": { + "address": "0x3133948342F35b8699d8F94aeE064AbB76eDe965", + "initArgs": [ + "0x9DB3ee191681f092607035d9BDA6e59FbEaCa695", + "0xF21Df5BbA7EB9b54D8F60C560aFb9bA63e6aED1A" + ], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0x137140783a99a3e9a60048d607124626ca87e2b972e8cc05efb41ac87c3cbcc4", + "proxy": true, + "implementation": { + "address": "0x00CBF5024d454255577Bf2b0fB6A43328a6828c9", + "creationCodeHash": "0xd71f45e6c194920a26f90fcec96d8c3375f02c5aef8ad90c1be24e906ffe8342", + "runtimeCodeHash": "0x68ec24512fedb866d7ba7ba6c02160317d0ca34eaacd23bddcc62d2cbcd9869c", + "txHash": "0x54619944731edec530b7b0cd587f9c2faae332aa1671fe5e8d7e7e5c7e291a77" + } + }, + "StakingExtension": { + "address": "0x05709dd705A5674346B7206a2bC657C8bAb3301B", + "creationCodeHash": "0x7ae74140871330ecabb7040182dc8288c2c84693393a519230036f39c2281138", + "runtimeCodeHash": "0x4994aa74e9e29c36a8158af690a245ccd1cf4d955223e5fcb1ca62810b37ed57", + "txHash": "0xbe1ff9cb949a53209b778708265740dfa2a08a93cfce4c897a53989a5d93f8c1" + }, + "L2Staking": { + "address": "0x865365C425f3A593Ffe698D9c4E6707D14d51e08", + "initArgs": [ + "0x9DB3ee191681f092607035d9BDA6e59FbEaCa695", + "100000000000000000000000", + "6646", + "10000", + "100000", + "8", + "12", + "16", + "100,100,60,100", + "0x876fB4B13D7Ed146757D3664B7E962b36936001C" + ], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0x326cf1f2849da4bb4d7e39f2783779e3c99fa48e4ee8ef004cfdd50c62e775df", + "proxy": true, + "implementation": { + "address": "0x64Ed77b164d3B22339DA4DB6d56a1C1d8A051c0A", + "creationCodeHash": "0x56a3dd587f3f4ae38dd782e9c35125fa7015c708394950de90bc190204502438", + "runtimeCodeHash": "0x9040ccf84a89ba2e7a32eb297f0da148827e7e272b20d9e57b1acf749baa35da", + "txHash": "0xbfec14a2dd1a571612076b71b4f2e78ea18f95d7d80e14cd1456ecaa7466db54", + "libraries": { + "LibExponential": "0x413d16eF53d3dd8b7e769570115ee5419CF77C98" + } + } + }, + "RewardsManager": { + "address": "0x1F49caE7669086c8ba53CC35d1E9f80176d67E79", + "initArgs": ["0x9DB3ee191681f092607035d9BDA6e59FbEaCa695"], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0xd8765fb87e11e8d41951f9071188b888829022a889cf66fdc2357f1f9f15c8e2", + "proxy": true, + "implementation": { + "address": "0x714B54e5249C90414fecA240e2F5B618C243F0aE", + "creationCodeHash": "0x59c1680da2d19124daaf95fd66acc5eae68e6f46dfe2ff0b3ccb777daf9949b2", + "runtimeCodeHash": "0xe33080183ec49ab1ec8d78b80b90158f0f3ac6f2deedf6115a32a9d11d3e4d9b", + "txHash": "0x8192f6c0e63a9beede3b025878af6a49367564c8bc32cb11a64f5f1e8351c7cd" + } + }, + "DisputeManager": { + "address": "0x7C9B82717f9433932507dF6EdA93A9678b258698", + "initArgs": [ + "0x9DB3ee191681f092607035d9BDA6e59FbEaCa695", + "0xF89688d5d44d73cc4dE880857A3940487076e5A4", + "10000000000000000000000", + "500000", + "25000", + "25000" + ], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0xb3764f4b576b46ee8dc6cbf680cad650b3ba80aa93dc6cf099862cfe8efc8a68", + "proxy": true, + "implementation": { + "address": "0x887aC2f58D62Ac86d4E9aEc07c953991e3ca1bA3", + "creationCodeHash": "0xce4c47d94a33d69e03d607dd13a9ad1ed7fa730ef4a2308eb56ddd646ebaa0aa", + "runtimeCodeHash": "0x18d4a1659ccecede3d4d305ef1db4653d8f3dcbd4012f4e52200ae9f0c6c322c", + "txHash": "0x59d99afb9cefbb5c2275d9ac2d7230ac7f4a4cfb2440636408988a66075c032a" + } + }, + "AllocationExchange": { + "address": "0x9BD4FBDa981D628AbA16F261f810dD59E5bAf9eA", + "constructorArgs": [ + "0xf8c05dCF59E8B28BFD5eed176C562bEbcfc7Ac04", + "0x865365C425f3A593Ffe698D9c4E6707D14d51e08", + "0x72ee30d43Fb5A90B3FE983156C5d2fBE6F6d07B3", + "0x49D4CFC037430cA9355B422bAeA7E9391e1d3215" + ], + "creationCodeHash": "0x2963baeedb2d0f5a95fa41f6c89e48e5bf177ca439379fc6becd54870d330ab0", + "runtimeCodeHash": "0xd8b53b3f65b49198d35392e0fd11da229a40d15a96151bca2976cbbe36b909d5", + "txHash": "0xa1a9410662d43463c39802e887f33a1401ed0fc35bf22c5be275e62141eae442" + }, + "L2GraphTokenGateway": { + "address": "0xB24Ce0f8c18c4DdDa584A7EeC132F49C966813bb", + "initArgs": ["0x9DB3ee191681f092607035d9BDA6e59FbEaCa695"], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0x90949db305a73b85e7208aa6b8d03c5181945eedc3df38e90f215a0dec8b02ae", + "proxy": true, + "implementation": { + "address": "0x3C2eB5E561f70c0573E5f6c92358e988E32cb5eC", + "creationCodeHash": "0x90253be19d23d542b29e95e6faf52304fcff91b21edfdb5f79e165051740d1ab", + "runtimeCodeHash": "0x3a7fab6792b4dad58c7b59da19c5b65b3985d1be77024a9f86cb135965e9b462", + "txHash": "0x78ff2e39d5c33ddfb89b1dbee89bdbc24452843a051f860c94e4e9dd75ded9c3" + } + }, + "EthereumDIDRegistry": { + "address": "0xF5f4cA61481558709AFa94AdEDa7B5F180f4AD59", + "creationCodeHash": "0x20cd202f7991716a84c097da5fbd365fd27f7f35f241f82c529ad7aba18b814b", + "runtimeCodeHash": "0x5f396ffd54b6cd6b3faded0f366c5d7e148cc54743926061be2dfd12a75391de", + "txHash": "0x2cefbc169b8ae51c263d0298956d86a397b05f11f076b71c918551f63fe33784" + }, + "SubgraphAvailabilityManager": { + "address": "0x71D9aE967d1f31fbbD1817150902de78f8f2f73E", + "constructorArgs": [ + "0x72ee30d43Fb5A90B3FE983156C5d2fBE6F6d07B3", + "0x1F49caE7669086c8ba53CC35d1E9f80176d67E79", + "3", + "300", + [ + "0x5e4e823Ed094c035133eEC5Ec0d08ae1Af04e9Fa", + "0x5aeE4c46cF9260E85E630ca7d9D757D5D5DbaFD6", + "0x7369Cf2a917296c36f506144f3dE552403d1e1f1", + "0x1e1f84c07e0471fc979f6f08228b0bd34cda9e54", + "0x711aEA1f358DFAf74D34B4B525F9190e631F406C" + ] + ], + "creationCodeHash": "0xc34842fa42ee2f21e3a435b52fa69a122a5de795448faa890fbc63d4838f45da", + "runtimeCodeHash": "0x3907d0fe5a1fa28fee51100e57a3b193dfcee6720163067011e787262b1749bb", + "txHash": "0xb00751b4dc1c0603fe1b8b9ae9de8840ad1c29b42489c5bb267d80b10ae44ef0" + } + }, + "11155111": { + "GraphProxyAdmin": { + "address": "0xe2011488ea6B02692Ee58717698aecDdfBf4756F", + "creationCodeHash": "0x68b304ac6bce7380d5e0f6b14a122f628bffebcc75f8205cb60f0baf578b79c3", + "runtimeCodeHash": "0x8d9ba87a745cf82ab407ebabe6c1490197084d320efb6c246d94bcc80e804417", + "txHash": "0x104f9104e7364f3605b1522c017aa8302344a689c059e58ad43c6cc6cd9f4e2a" + }, + "BancorFormula": { + "address": "0x56b9f17D3Ca520b229F56D13a988dFAE9924C91E", + "creationCodeHash": "0x7ae36017eddb326ddd79c7363781366121361d42fdb201cf57c57424eede46f4", + "runtimeCodeHash": "0xed6701e196ad93718e28c2a2a44d110d9e9906085bcfe4faf4f6604b08f0116c", + "txHash": "0xb32bbff4bdf106e1f02ea826c0c412d66e2e081acd43aaba5f75676c28f969a2" + }, + "Controller": { + "address": "0xf53B3910ecaeED1Aac4Bb5Ba9840d25E36e52b7C", + "creationCodeHash": "0x5bde9a87bc4e8dd24d41900f0a19321c1dc6d3373d51bba093b130bb5b80a677", + "runtimeCodeHash": "0x7f0479db1d60ecf6295d92ea2359ebdd223640795613558b0594680f5d4922c9", + "txHash": "0xe9ab682c6d6b68d5f99d5253c8a6201f9b9f352dac337579d8ddeff6d9738f50" + }, + "EpochManager": { + "address": "0x3C39036a76104D7c6D3eF13a21477C0fE23A3Aa2", + "initArgs": ["0xf53B3910ecaeED1Aac4Bb5Ba9840d25E36e52b7C", "554"], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0xc44a6798882df720a50df98fa0daa3ad32641afc18cb054047a44bcbf5e54dae", + "proxy": true, + "implementation": { + "address": "0xA1af9300209cc60de6Ce39752d57F04AB7E29432", + "creationCodeHash": "0x9947bd0a1f46027123b8fb4aec8b11af540aea587eb79642475d57b4e347078f", + "runtimeCodeHash": "0xe45a27197726de0e3149014823794708edd432ee56ec8358554c0d2365674ca0", + "txHash": "0x5f8205a69175903cafb8d688578c01b2fbcdaf970102194994851af7d2ace4d8" + } + }, + "GraphToken": { + "address": "0xCA59cCeb39bE1808d7aA607153f4A5062daF3a83", + "constructorArgs": ["10000000000000000000000000000"], + "creationCodeHash": "0x9c50586e9e305b3a299f1cdf92ca9bb04fad5f43b5e0f7505054d79783fd8b69", + "runtimeCodeHash": "0xfe612acbb09bdb23fe60014e890054621fd34d74bf12bd94fb73351d474cd641", + "txHash": "0xe034493538c9604e629129ede83a4298ec9fd97d5c8b2e1be67c01877464effe" + }, + "GraphCurationToken": { + "address": "0xE04cE530c532538F1F63cA911849925425C2A1Aa", + "creationCodeHash": "0x1ee42ee271cefe20c33c0de904501e618ac4b56debca67c634d0564cecea9ff2", + "runtimeCodeHash": "0x340e8f378c0117b300f3ec255bc5c3a273f9ab5bd2940fa8eb3b5065b21f86dc", + "txHash": "0xe5684e296859ae9ef5662ef1a16d520e201253d51d8068ddb07c94aa17b1f217" + }, + "ServiceRegistry": { + "address": "0x0Ee47634c94E6606f67301b3A868319073CB0FC2", + "initArgs": ["0xf53B3910ecaeED1Aac4Bb5Ba9840d25E36e52b7C"], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0xe60ff360c1a53a81aea3c26213a41c3335bd9e93928df504276e69911255bbb7", + "proxy": true, + "implementation": { + "address": "0xe4484C9c5F18482d4c2E2f3BB0639f092922D97a", + "creationCodeHash": "0xec9cb879003a06609541ad87efd4bc5dfc8ea60e4e77cfa5ae2cb5208742e7bc", + "runtimeCodeHash": "0x5161b534164413a88d851832f9c9d1dd1bca32fe2bbb62bb35d112c1dc8b69ab", + "txHash": "0x5dead3a8e67425b461bf0167bbe6a1e48232d1ce04d213c7e8ed173cff4019b8" + } + }, + "Curation": { + "address": "0x77A6e5F2f13218B33A97Aec56d591dB18D60FFb1", + "initArgs": [ + "0xf53B3910ecaeED1Aac4Bb5Ba9840d25E36e52b7C", + "0x56b9f17D3Ca520b229F56D13a988dFAE9924C91E", + "0xE04cE530c532538F1F63cA911849925425C2A1Aa", + "500000", + "10000", + "1000000000000000000" + ], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0x5cd28f416034ea0fe8dcf3fe31661128a7103678ce60f1385ff843cc7b3314f8", + "proxy": true, + "implementation": { + "address": "0x54C6639e45F9Eb5Ab55A370d4071e77e5f1b9FF6", + "creationCodeHash": "0x666b377dfbba2be2e9cda6f1a1297819aae39b6571935a9f65314435f1cbd943", + "runtimeCodeHash": "0xbca44d6f233be6574d7db9cf0d0db09697d9ad6f36e69d5d9e22ad7004e83c51", + "txHash": "0x92bb03a530c6a3d33974c783bc3560a3e3c68910a48c951029d052d4234c02bd" + } + }, + "SubgraphNFTDescriptor": { + "address": "0xC9b2011A082d75c01C5C3eEA132f29ebaD182BD5", + "creationCodeHash": "0xf16e8ff11d852eea165195ac9e0dfa00f98e48f6ce3c77c469c7df9bf195b651", + "runtimeCodeHash": "0x39583196f2bcb85789b6e64692d8c0aa56f001c46f0ca3d371abbba2c695860f", + "txHash": "0xd191fe32ca3538322628fcea353becca0eee1e4855c265552a54682e1c44541f" + }, + "SubgraphNFT": { + "address": "0x120005c38D2624Ef70185fEf3a051Dd57b27a491", + "constructorArgs": ["0x559081D91F5Ff43dfE51A07C216F8E6893805B35"], + "creationCodeHash": "0xc1e58864302084de282dffe54c160e20dd96c6cfff45e00e6ebfc15e04136982", + "runtimeCodeHash": "0x7216e736a8a8754e88688fbf5c0c7e9caf35c55ecc3a0c5a597b951c56cf7458", + "txHash": "0x67192875a3b846c1ff81e5fcaa5fde0f9948834bec3b11fef4d5bb2ab4226fa2" + }, + "L1GNS": { + "address": "0x5461D48556B94e7fdD8ED5A8f865Ba4F1A3b5454", + "initArgs": [ + "0xf53B3910ecaeED1Aac4Bb5Ba9840d25E36e52b7C", + "0x120005c38D2624Ef70185fEf3a051Dd57b27a491" + ], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0xf92078845db80bcb42a1cf8d8fe230a9e3c86cc6f66e15c8a81368e5fad42885", + "proxy": true, + "implementation": { + "address": "0x4Ac3832d773FE6B6dcC8EB6241B83212F1a55096", + "creationCodeHash": "0xad517d289662731ecf3e0341e1612dc51bd6b63993f78057e17e1f9654740879", + "runtimeCodeHash": "0x3143b8a44a2a8e6590a85580ddf69baf87012d8865fa20fac25bbdfda5d5648e", + "txHash": "0x999f9af5e1e25a4558a315ebe76e7808bf0afa99fc97694a01c73d0a1eef060a" + } + }, + "StakingExtension": { + "address": "0x3fF97b5bdC1D46B0bbD1a3166F232683470a0ce3", + "creationCodeHash": "0xe23c59dbfb94b0cf7ef58f654b905977624ce57eaae2fce692edb28ca3f1b3ba", + "runtimeCodeHash": "0xca8ad20187bc87e0e04a15184f529787dd23a0095047d411e1b271617a951c49", + "txHash": "0x060e4f03881b4e1cf03be197ec3533b43a1a550a74f8adbdaba829f867a761ae" + }, + "L1Staking": { + "address": "0x14e9B07Dc56A0B03ac8A58453B5cCCB289d6ec90", + "initArgs": [ + "0xf53B3910ecaeED1Aac4Bb5Ba9840d25E36e52b7C", + "100000000000000000000000", + "6646", + "10000", + "100000", + "4", + "12", + "16", + "100,100,60,100", + "0x3fF97b5bdC1D46B0bbD1a3166F232683470a0ce3" + ], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0xe766e786e2d2f1c0af821c785178915e98f4251832bf523540d0e4ff93212a6f", + "proxy": true, + "implementation": { + "address": "0x88aec82f14002a56014819f4e23a22eB32F528b1", + "creationCodeHash": "0x8244555e05aae22fb53a3c3f8717b83d26306748faccc9e9828d43ceaa4b9e67", + "runtimeCodeHash": "0x33ecbc61c2f077b9cc37d5f3d4f6863f576e31ffaa310630ec0a89dd9a8fa940", + "txHash": "0xa56f2052e6c761c12a24459949320e5c11c56219c00a78821505f35bd023c573", + "libraries": { + "LibExponential": "0xc63d7df28b01e6f20b17834B106948baEbF04441" + } + } + }, + "RewardsManager": { + "address": "0x175f483AfAB4Fc52A6E07F9e9d46C90eB95941b5", + "initArgs": ["0xf53B3910ecaeED1Aac4Bb5Ba9840d25E36e52b7C"], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0x6b128afe0d58657c7df7ef6d86a997d3767b166afb671406999ccc69d6c72a61", + "proxy": true, + "implementation": { + "address": "0x3a7382e41d56f6085fcdE56546884ecfcCe8e949", + "creationCodeHash": "0x59c1680da2d19124daaf95fd66acc5eae68e6f46dfe2ff0b3ccb777daf9949b2", + "runtimeCodeHash": "0xe33080183ec49ab1ec8d78b80b90158f0f3ac6f2deedf6115a32a9d11d3e4d9b", + "txHash": "0x3666a68a84e1e2175e45862da197a122439c6f3d7c35f795914bd52fc0c1da3b" + } + }, + "DisputeManager": { + "address": "0x1Da0DF3435cde4199650D35690E3B0885dfc38B1", + "initArgs": [ + "0xf53B3910ecaeED1Aac4Bb5Ba9840d25E36e52b7C", + "0xd6ff9e98F0Fd99ccB658832F586e23F4D8Cb8Bad", + "10000000000000000000000", + "500000", + "25000", + "25000" + ], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0xd19578ab4bc280cfc890cc2f9b29bc57a8153cc879bbd22ab4202197078286ab", + "proxy": true, + "implementation": { + "address": "0x38d343aBB283452a6855572F6343193A8799Ef7e", + "creationCodeHash": "0x9d7257851678e3a0bd8ef74c219c314de490ebe91e6263129a3030d841dfc74b", + "runtimeCodeHash": "0xe490c3ae892d23d6ebed61a6081d70045ee6618f5196f25c28e6d7d66f798fee", + "txHash": "0xe6a215fe9ed86e23b7fad7b40938500ba64292f5c17b771ace1b00d4d2cd8c25" + } + }, + "AllocationExchange": { + "address": "0xd49670f70f68F7dc62c8B287F6388d250C5487E2", + "constructorArgs": [ + "0xCA59cCeb39bE1808d7aA607153f4A5062daF3a83", + "0x14e9B07Dc56A0B03ac8A58453B5cCCB289d6ec90", + "0x4EBf30832eC2db76aE228D5d239083B59f530d1f", + "0x840daec5dF962D49cf2EFd789c4E40A7b7e0117D" + ], + "creationCodeHash": "0x2963baeedb2d0f5a95fa41f6c89e48e5bf177ca439379fc6becd54870d330ab0", + "runtimeCodeHash": "0x9463db858ad818a01e751412460a5c8e6b249dd92ec564a7d0ef9663eaad3e33", + "txHash": "0x760473d4ea2805869979650079788d553dc9fe8e871764ea1c994c194239bf3e" + }, + "L1GraphTokenGateway": { + "address": "0x549DCB0b510Ee7C8d6E8e346ab9aC75E22DD78B3", + "initArgs": ["0xf53B3910ecaeED1Aac4Bb5Ba9840d25E36e52b7C"], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0x098fb600073aa336154343c9f6f565e190e28792a357c69235b06fc86e2bc9fe", + "proxy": true, + "implementation": { + "address": "0xF1De736CcBb1a37591f7fCA4CA415932a4a8d632", + "creationCodeHash": "0xf21eb0fd5bf5a54dd522b653f6c1da315876355e1e90fedeb08b1fe94f1b54d9", + "runtimeCodeHash": "0xe2964bc67225afc1c732a4216824911ad847bbe8f2188c835e25c2b255c69685", + "txHash": "0xcadae13c0f824e387a3ae07f6929258d5540b3e909f231bba6aca7f70d0558be" + } + }, + "BridgeEscrow": { + "address": "0x428Ab6E9EeF41Dc5098a34a6993Cdd5Be5BA24a6", + "initArgs": ["0xf53B3910ecaeED1Aac4Bb5Ba9840d25E36e52b7C"], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0xb4a922195600c6291cd485f1e98d0bb1f1c25673759015f512e16f53ab9e7665", + "proxy": true, + "implementation": { + "address": "0x4F1aBAa9ec53c2E5d4902Edd099C74B2d8a0aAdD", + "creationCodeHash": "0x27276d0e03aa52bfd4664ca5608cb3fac28fa42034c0d859d06dbc4174342192", + "runtimeCodeHash": "0x796b2cef94bab38e2cc4f82fef882d4c3441ef229329468d46fa72e1fd74be4a", + "txHash": "0xbadc145e826c54b4a4a0263701a29d6ecd11f8c6533c0d8e1cfe5422321d55f6" + } + }, + "EthereumDIDRegistry": { + "address": "0xDe57D27e530c99bDa15Fe231B8C632E4a37E7343", + "creationCodeHash": "0x20cd202f7991716a84c097da5fbd365fd27f7f35f241f82c529ad7aba18b814b", + "runtimeCodeHash": "0x5f396ffd54b6cd6b3faded0f366c5d7e148cc54743926061be2dfd12a75391de", + "txHash": "0x8f3c9ae70242ed54c51a8f22c8d97f3ebc34cd65ccc4cc87054637b47610cf3a" + } + } +} diff --git a/packages/contracts/arbitrum-addresses.json b/packages/contracts/arbitrum-addresses.json new file mode 100644 index 000000000..92c63a498 --- /dev/null +++ b/packages/contracts/arbitrum-addresses.json @@ -0,0 +1,55 @@ +{ + "source": "https://developer.offchainlabs.com/docs/useful_addresses", + "1": { + "L1GatewayRouter": { + "address": "0x72Ce9c846789fdB6fC1f34aC4AD25Dd9ef7031ef" + }, + "IInbox": { + "address": "0x4Dbd4fc535Ac27206064B68FfCf827b0A60BAB3f" + } + }, + "4": { + "L1GatewayRouter": { + "address": "0x70C143928eCfFaf9F5b406f7f4fC28Dc43d68380" + }, + "IInbox": { + "address": "0x578BAde599406A8fE3d24Fd7f7211c0911F5B29e" + } + }, + "5": { + "L1GatewayRouter": { + "address": "0x4c7708168395aEa569453Fc36862D2ffcDaC588c" + }, + "IInbox": { + "address": "0x6BEbC4925716945D46F0Ec336D5C2564F419682C" + } + }, + "42161": { + "L2GatewayRouter": { + "address": "0x5288c571Fd7aD117beA99bF60FE0846C4E84F933" + } + }, + "421611": { + "L2GatewayRouter": { + "address": "0x9413AD42910c1eA60c737dB5f58d1C504498a3cD" + } + }, + "421613": { + "L2GatewayRouter": { + "address": "0xE5B9d8d42d656d1DcB8065A6c012FE3780246041" + } + }, + "421614": { + "L2GatewayRouter": { + "address": "0x9fDD1C4E4AA24EEc1d913FABea925594a20d43C7" + } + }, + "11155111": { + "L1GatewayRouter": { + "address": "0xcE18836b233C83325Cc8848CA4487e94C6288264" + }, + "IInbox": { + "address": "0xaAe29B0366299461418F5324a79Afc425BE5ae21" + } + } +} diff --git a/packages/contracts/audits/ConsenSysDiligence/2021-05-graph-initial-review.pdf b/packages/contracts/audits/ConsenSysDiligence/2021-05-graph-initial-review.pdf new file mode 100644 index 000000000..b1a4c0615 Binary files /dev/null and b/packages/contracts/audits/ConsenSysDiligence/2021-05-graph-initial-review.pdf differ diff --git a/packages/contracts/audits/ConsenSysDiligence/2021-08-staking-multicall-and-delegation-fixes.pdf b/packages/contracts/audits/ConsenSysDiligence/2021-08-staking-multicall-and-delegation-fixes.pdf new file mode 100644 index 000000000..96c8d92ab Binary files /dev/null and b/packages/contracts/audits/ConsenSysDiligence/2021-08-staking-multicall-and-delegation-fixes.pdf differ diff --git a/packages/contracts/audits/ConsenSysDiligence/2022-01-graph-pr527-audit.pdf b/packages/contracts/audits/ConsenSysDiligence/2022-01-graph-pr527-audit.pdf new file mode 100644 index 000000000..3740a34e9 Binary files /dev/null and b/packages/contracts/audits/ConsenSysDiligence/2022-01-graph-pr527-audit.pdf differ diff --git a/packages/contracts/audits/ConsenSysDiligence/2022-03-graph-altruistic-alloc-and-query-versioning.pdf b/packages/contracts/audits/ConsenSysDiligence/2022-03-graph-altruistic-alloc-and-query-versioning.pdf new file mode 100644 index 000000000..cb9f1329f Binary files /dev/null and b/packages/contracts/audits/ConsenSysDiligence/2022-03-graph-altruistic-alloc-and-query-versioning.pdf differ diff --git a/packages/contracts/audits/OpenZeppelin/2020-08-graph-protocol.pdf b/packages/contracts/audits/OpenZeppelin/2020-08-graph-protocol.pdf new file mode 100644 index 000000000..dc0266c0c Binary files /dev/null and b/packages/contracts/audits/OpenZeppelin/2020-08-graph-protocol.pdf differ diff --git a/packages/contracts/audits/OpenZeppelin/2021-04-graph-addresses-cache-audit.pdf b/packages/contracts/audits/OpenZeppelin/2021-04-graph-addresses-cache-audit.pdf new file mode 100644 index 000000000..e74cf68e9 Binary files /dev/null and b/packages/contracts/audits/OpenZeppelin/2021-04-graph-addresses-cache-audit.pdf differ diff --git a/packages/contracts/audits/OpenZeppelin/2021-04-graph-governance-upgrade-audit.pdf b/packages/contracts/audits/OpenZeppelin/2021-04-graph-governance-upgrade-audit.pdf new file mode 100644 index 000000000..4e5145470 Binary files /dev/null and b/packages/contracts/audits/OpenZeppelin/2021-04-graph-governance-upgrade-audit.pdf differ diff --git a/packages/contracts/audits/OpenZeppelin/2021-04-graph-rewardsmanager-upgrade-audit.pdf b/packages/contracts/audits/OpenZeppelin/2021-04-graph-rewardsmanager-upgrade-audit.pdf new file mode 100644 index 000000000..d8e3d71d2 Binary files /dev/null and b/packages/contracts/audits/OpenZeppelin/2021-04-graph-rewardsmanager-upgrade-audit.pdf differ diff --git a/packages/contracts/audits/OpenZeppelin/2021-04-graph-slashing-upgrade-audit.pdf b/packages/contracts/audits/OpenZeppelin/2021-04-graph-slashing-upgrade-audit.pdf new file mode 100644 index 000000000..aa0e8b90e Binary files /dev/null and b/packages/contracts/audits/OpenZeppelin/2021-04-graph-slashing-upgrade-audit.pdf differ diff --git a/packages/contracts/audits/OpenZeppelin/2021-04-graph-staking-bugfix-2-audit.pdf b/packages/contracts/audits/OpenZeppelin/2021-04-graph-staking-bugfix-2-audit.pdf new file mode 100644 index 000000000..eaeeaa768 Binary files /dev/null and b/packages/contracts/audits/OpenZeppelin/2021-04-graph-staking-bugfix-2-audit.pdf differ diff --git a/packages/contracts/audits/OpenZeppelin/2021-04-graph-staking-bugfix-audit-1.pdf b/packages/contracts/audits/OpenZeppelin/2021-04-graph-staking-bugfix-audit-1.pdf new file mode 100644 index 000000000..39693f29a Binary files /dev/null and b/packages/contracts/audits/OpenZeppelin/2021-04-graph-staking-bugfix-audit-1.pdf differ diff --git a/packages/contracts/audits/OpenZeppelin/2021-08-graph-gns-audit.pdf b/packages/contracts/audits/OpenZeppelin/2021-08-graph-gns-audit.pdf new file mode 100644 index 000000000..ff358f78e Binary files /dev/null and b/packages/contracts/audits/OpenZeppelin/2021-08-graph-gns-audit.pdf differ diff --git a/packages/contracts/audits/OpenZeppelin/2021-11-graph-curation-minimal-proxy.pdf b/packages/contracts/audits/OpenZeppelin/2021-11-graph-curation-minimal-proxy.pdf new file mode 100644 index 000000000..8d0f16bff Binary files /dev/null and b/packages/contracts/audits/OpenZeppelin/2021-11-graph-curation-minimal-proxy.pdf differ diff --git a/packages/contracts/audits/OpenZeppelin/2021-11-graph-gns-transferrable-owner.pdf b/packages/contracts/audits/OpenZeppelin/2021-11-graph-gns-transferrable-owner.pdf new file mode 100644 index 000000000..5bd846e55 Binary files /dev/null and b/packages/contracts/audits/OpenZeppelin/2021-11-graph-gns-transferrable-owner.pdf differ diff --git a/packages/contracts/audits/OpenZeppelin/2021-12-graph-rewards-signal-threshold.pdf b/packages/contracts/audits/OpenZeppelin/2021-12-graph-rewards-signal-threshold.pdf new file mode 100644 index 000000000..0c1add753 Binary files /dev/null and b/packages/contracts/audits/OpenZeppelin/2021-12-graph-rewards-signal-threshold.pdf differ diff --git a/packages/contracts/audits/OpenZeppelin/2022-07-graph-arbitrum-bridge-audit.pdf b/packages/contracts/audits/OpenZeppelin/2022-07-graph-arbitrum-bridge-audit.pdf new file mode 100644 index 000000000..850c9a80b Binary files /dev/null and b/packages/contracts/audits/OpenZeppelin/2022-07-graph-arbitrum-bridge-audit.pdf differ diff --git a/packages/contracts/audits/OpenZeppelin/2022-07-pr552-summary.pdf b/packages/contracts/audits/OpenZeppelin/2022-07-pr552-summary.pdf new file mode 100644 index 000000000..d77364c2a Binary files /dev/null and b/packages/contracts/audits/OpenZeppelin/2022-07-pr552-summary.pdf differ diff --git a/packages/contracts/audits/OpenZeppelin/2022-07-pr568-summary.pdf b/packages/contracts/audits/OpenZeppelin/2022-07-pr568-summary.pdf new file mode 100644 index 000000000..fb01c454a Binary files /dev/null and b/packages/contracts/audits/OpenZeppelin/2022-07-pr568-summary.pdf differ diff --git a/packages/contracts/audits/OpenZeppelin/2022-07-pr569-summary.pdf b/packages/contracts/audits/OpenZeppelin/2022-07-pr569-summary.pdf new file mode 100644 index 000000000..e40726fc9 Binary files /dev/null and b/packages/contracts/audits/OpenZeppelin/2022-07-pr569-summary.pdf differ diff --git a/packages/contracts/audits/OpenZeppelin/2022-07-pr571-summary.pdf b/packages/contracts/audits/OpenZeppelin/2022-07-pr571-summary.pdf new file mode 100644 index 000000000..80fddb783 Binary files /dev/null and b/packages/contracts/audits/OpenZeppelin/2022-07-pr571-summary.pdf differ diff --git a/packages/contracts/audits/OpenZeppelin/2022-09-graph-drip-keeper-reward-audit.pdf b/packages/contracts/audits/OpenZeppelin/2022-09-graph-drip-keeper-reward-audit.pdf new file mode 100644 index 000000000..de1b2ffbb Binary files /dev/null and b/packages/contracts/audits/OpenZeppelin/2022-09-graph-drip-keeper-reward-audit.pdf differ diff --git a/packages/contracts/audits/OpenZeppelin/2023-05-staking-vesting-l2.pdf b/packages/contracts/audits/OpenZeppelin/2023-05-staking-vesting-l2.pdf new file mode 100644 index 000000000..98c35a1f0 Binary files /dev/null and b/packages/contracts/audits/OpenZeppelin/2023-05-staking-vesting-l2.pdf differ diff --git a/packages/contracts/audits/OpenZeppelin/2023-06-graph-exponential-rebates.pdf b/packages/contracts/audits/OpenZeppelin/2023-06-graph-exponential-rebates.pdf new file mode 100644 index 000000000..ad8a2bbab Binary files /dev/null and b/packages/contracts/audits/OpenZeppelin/2023-06-graph-exponential-rebates.pdf differ diff --git a/packages/contracts/audits/OpenZeppelin/2023-08-dispute-manager-status.pdf b/packages/contracts/audits/OpenZeppelin/2023-08-dispute-manager-status.pdf new file mode 100644 index 000000000..e5030fcdf Binary files /dev/null and b/packages/contracts/audits/OpenZeppelin/2023-08-dispute-manager-status.pdf differ diff --git a/packages/contracts/audits/OpenZeppelin/2023-11-permissionless-payers.pdf b/packages/contracts/audits/OpenZeppelin/2023-11-permissionless-payers.pdf new file mode 100644 index 000000000..3a37b9158 Binary files /dev/null and b/packages/contracts/audits/OpenZeppelin/2023-11-permissionless-payers.pdf differ diff --git a/packages/contracts/audits/OpenZeppelin/2023-11-remove-delegation-parameters-cooldown.pdf b/packages/contracts/audits/OpenZeppelin/2023-11-remove-delegation-parameters-cooldown.pdf new file mode 100644 index 000000000..d99daa31f Binary files /dev/null and b/packages/contracts/audits/OpenZeppelin/2023-11-remove-delegation-parameters-cooldown.pdf differ diff --git a/packages/contracts/audits/OpenZeppelin/2024-02-graph-availability-manager-minimum-allocation-removal.pdf b/packages/contracts/audits/OpenZeppelin/2024-02-graph-availability-manager-minimum-allocation-removal.pdf new file mode 100644 index 000000000..d41a64e75 Binary files /dev/null and b/packages/contracts/audits/OpenZeppelin/2024-02-graph-availability-manager-minimum-allocation-removal.pdf differ diff --git a/packages/contracts/audits/OpenZeppelin/2024-02-subgraph-availability-manager-and-minimum-allocation-duration-removal.pdf b/packages/contracts/audits/OpenZeppelin/2024-02-subgraph-availability-manager-and-minimum-allocation-duration-removal.pdf new file mode 100644 index 000000000..d41a64e75 Binary files /dev/null and b/packages/contracts/audits/OpenZeppelin/2024-02-subgraph-availability-manager-and-minimum-allocation-duration-removal.pdf differ diff --git a/packages/contracts/audits/Trust/2023-02-operator-decentralization-pr749.pdf b/packages/contracts/audits/Trust/2023-02-operator-decentralization-pr749.pdf new file mode 100644 index 000000000..ebfe2ba98 Binary files /dev/null and b/packages/contracts/audits/Trust/2023-02-operator-decentralization-pr749.pdf differ diff --git a/packages/contracts/config/graph.arbitrum-goerli.yml b/packages/contracts/config/graph.arbitrum-goerli.yml new file mode 100644 index 000000000..ec7167713 --- /dev/null +++ b/packages/contracts/config/graph.arbitrum-goerli.yml @@ -0,0 +1,152 @@ +general: + arbitrator: &arbitrator "0xF89688d5d44d73cc4dE880857A3940487076e5A4" # Arbitration Council (TODO: update) + governor: &governor "0x5CeeeE16F30357d49c50bcd7F520ca6527cf388a" # Graph Council (TODO: update) + authority: &authority "0xac01B0b3B2Dc5D8E0D484c02c4d077C15C96a7b4" # Authority that signs payment vouchers + availabilityOracle: &availabilityOracle "0xa99a56fa38a6b9553853c84e11458aeccdad509b" # Subgraph Availability Oracle (TODO: update) + pauseGuardian: &pauseGuardian "0x4B6C90B9fE29dfa521188B6547989C23d613b79B" # Protocol pause guardian (TODO: update) + allocationExchangeOwner: &allocationExchangeOwner "0x05F359b1319f1Ca9b799CB6386F31421c2c49dBA" # Allocation Exchange owner (TODO: update) + +contracts: + Controller: + calls: + - fn: "setContractProxy" + id: "0xe6876326c1291dfcbbd3864a6816d698cd591defc7aa2153d7f9c4c04016c89f" # keccak256('Curation') + contractAddress: "${{L2Curation.address}}" + - fn: "setContractProxy" + id: "0x39605a6c26a173774ca666c67ef70cf491880e5d3d6d0ca66ec0a31034f15ea3" # keccak256('GNS') + contractAddress: "${{L2GNS.address}}" + - fn: "setContractProxy" + id: "0xf942813d07d17b56de9a9afc8de0ced6e8c053bbfdcc87b7badea4ddcf27c307" # keccak256('DisputeManager') + contractAddress: "${{DisputeManager.address}}" + - fn: "setContractProxy" + id: "0xc713c3df6d14cdf946460395d09af88993ee2b948b1a808161494e32c5f67063" # keccak256('EpochManager') + contractAddress: "${{EpochManager.address}}" + - fn: "setContractProxy" + id: "0x966f1e8d8d8014e05f6ec4a57138da9be1f7c5a7f802928a18072f7c53180761" # keccak256('RewardsManager') + contractAddress: "${{RewardsManager.address}}" + - fn: "setContractProxy" + id: "0x1df41cd916959d1163dc8f0671a666ea8a3e434c13e40faef527133b5d167034" # keccak256('Staking') + contractAddress: "${{L2Staking.address}}" + - fn: "setContractProxy" + id: "0x45fc200c7e4544e457d3c5709bfe0d520442c30bbcbdaede89e8d4a4bbc19247" # keccak256('GraphToken') + contractAddress: "${{L2GraphToken.address}}" + - fn: "setContractProxy" + id: "0xd362cac9cb75c10d67bcc0b7eeb0b1ef48bb5420b556c092d4fd7f758816fcf0" # keccak256('GraphTokenGateway') + contractAddress: "${{L2GraphTokenGateway.address}}" + - fn: "setPauseGuardian" + pauseGuardian: *pauseGuardian + - fn: "transferOwnership" + owner: *governor + GraphProxyAdmin: + calls: + - fn: "transferOwnership" + owner: *governor + ServiceRegistry: + proxy: true + init: + controller: "${{Controller.address}}" + calls: + - fn: "syncAllContracts" + EpochManager: + proxy: true + init: + controller: "${{Controller.address}}" + lengthInBlocks: 554 # length in hours = lengthInBlocks*13/60/60 (~13 second blocks) + L2GraphToken: + proxy: true + init: + owner: "${{Env.deployer}}" + calls: + - fn: "addMinter" + minter: "${{RewardsManager.address}}" + - fn: "renounceMinter" + - fn: "transferOwnership" + owner: *governor + L2Curation: + proxy: true + init: + controller: "${{Controller.address}}" + curationTokenMaster: "${{GraphCurationToken.address}}" + curationTaxPercentage: 10000 # in parts per million + minimumCurationDeposit: "1" # in wei + calls: + - fn: "syncAllContracts" + DisputeManager: + proxy: true + init: + controller: "${{Controller.address}}" + arbitrator: *arbitrator + minimumDeposit: "10000000000000000000000" # in wei + fishermanRewardPercentage: 500000 # in parts per million + idxSlashingPercentage: 25000 # in parts per million + qrySlashingPercentage: 25000 # in parts per million + calls: + - fn: "syncAllContracts" + L2GNS: + proxy: true + init: + controller: "${{Controller.address}}" + subgraphNFT: "${{SubgraphNFT.address}}" + calls: + - fn: "approveAll" + - fn: "syncAllContracts" + SubgraphNFT: + init: + governor: "${{Env.deployer}}" + calls: + - fn: "setTokenDescriptor" + tokenDescriptor: "${{SubgraphNFTDescriptor.address}}" + - fn: "setMinter" + minter: "${{L2GNS.address}}" + - fn: "transferOwnership" + owner: *governor + L2Staking: + proxy: true + init: + controller: "${{Controller.address}}" + minimumIndexerStake: "100000000000000000000000" # in wei + thawingPeriod: 6646 # in blocks + protocolPercentage: 10000 # in parts per million + curationPercentage: 100000 # in parts per million + maxAllocationEpochs: 8 # in epochs + delegationUnbondingPeriod: 12 # in epochs + delegationRatio: 16 # delegated stake to indexer stake multiplier + rebateParameters: + alphaNumerator: 100 # alphaNumerator / alphaDenominator + alphaDenominator: 100 # alphaNumerator / alphaDenominator + lambdaNumerator: 60 # lambdaNumerator / lambdaDenominator + lambdaDenominator: 100 # lambdaNumerator / lambdaDenominator + extensionImpl: "${{StakingExtension.address}}" + calls: + - fn: "setDelegationTaxPercentage" + delegationTaxPercentage: 5000 # parts per million + - fn: "setSlasher" + slasher: "${{DisputeManager.address}}" + allowed: true + - fn: "syncAllContracts" + RewardsManager: + proxy: true + init: + controller: "${{Controller.address}}" + calls: + - fn: "setIssuancePerBlock" + issuancePerBlock: "6036500000000000000" # per block increase of total supply, blocks in a year = 365*60*60*24/12 + - fn: "setSubgraphAvailabilityOracle" + subgraphAvailabilityOracle: *availabilityOracle + - fn: "syncAllContracts" + AllocationExchange: + init: + graphToken: "${{L2GraphToken.address}}" + staking: "${{L2Staking.address}}" + governor: *allocationExchangeOwner + authority: *authority + calls: + - fn: "approveAll" + L2GraphTokenGateway: + proxy: true + init: + controller: "${{Controller.address}}" + calls: + - fn: "syncAllContracts" + - fn: "setPauseGuardian" + pauseGuardian: *pauseGuardian diff --git a/packages/contracts/config/graph.arbitrum-hardhat.yml b/packages/contracts/config/graph.arbitrum-hardhat.yml new file mode 100644 index 000000000..ec4a161b1 --- /dev/null +++ b/packages/contracts/config/graph.arbitrum-hardhat.yml @@ -0,0 +1,163 @@ +general: + arbitrator: &arbitrator "0xFFcf8FDEE72ac11b5c542428B35EEF5769C409f0" # Arbitration Council + governor: &governor "0x22d491Bde2303f2f43325b2108D26f1eAbA1e32b" # Graph Council + authority: &authority "0xE11BA2b4D45Eaed5996Cd0823791E0C93114882d" # Authority that signs payment vouchers + availabilityOracles: &availabilityOracles # Subgraph Availability Oracles + - "0xd03ea8624C8C5987235048901fB614fDcA89b117" + - "0xd03ea8624C8C5987235048901fB614fDcA89b117" + - "0xd03ea8624C8C5987235048901fB614fDcA89b117" + - "0xd03ea8624C8C5987235048901fB614fDcA89b117" + - "0xd03ea8624C8C5987235048901fB614fDcA89b117" + pauseGuardian: &pauseGuardian "0x95cED938F7991cd0dFcb48F0a06a40FA1aF46EBC" # Protocol pause guardian + allocationExchangeOwner: &allocationExchangeOwner "0x3E5e9111Ae8eB78Fe1CC3bb8915d5D461F3Ef9A9" # Allocation Exchange owner + +contracts: + Controller: + calls: + - fn: "setContractProxy" + id: "0xe6876326c1291dfcbbd3864a6816d698cd591defc7aa2153d7f9c4c04016c89f" # keccak256('Curation') + contractAddress: "${{L2Curation.address}}" + - fn: "setContractProxy" + id: "0x39605a6c26a173774ca666c67ef70cf491880e5d3d6d0ca66ec0a31034f15ea3" # keccak256('GNS') + contractAddress: "${{L2GNS.address}}" + - fn: "setContractProxy" + id: "0xf942813d07d17b56de9a9afc8de0ced6e8c053bbfdcc87b7badea4ddcf27c307" # keccak256('DisputeManager') + contractAddress: "${{DisputeManager.address}}" + - fn: "setContractProxy" + id: "0xc713c3df6d14cdf946460395d09af88993ee2b948b1a808161494e32c5f67063" # keccak256('EpochManager') + contractAddress: "${{EpochManager.address}}" + - fn: "setContractProxy" + id: "0x966f1e8d8d8014e05f6ec4a57138da9be1f7c5a7f802928a18072f7c53180761" # keccak256('RewardsManager') + contractAddress: "${{RewardsManager.address}}" + - fn: "setContractProxy" + id: "0x1df41cd916959d1163dc8f0671a666ea8a3e434c13e40faef527133b5d167034" # keccak256('Staking') + contractAddress: "${{L2Staking.address}}" + - fn: "setContractProxy" + id: "0x45fc200c7e4544e457d3c5709bfe0d520442c30bbcbdaede89e8d4a4bbc19247" # keccak256('GraphToken') + contractAddress: "${{L2GraphToken.address}}" + - fn: "setContractProxy" + id: "0xd362cac9cb75c10d67bcc0b7eeb0b1ef48bb5420b556c092d4fd7f758816fcf0" # keccak256('GraphTokenGateway') + contractAddress: "${{L2GraphTokenGateway.address}}" + - fn: "setPauseGuardian" + pauseGuardian: *pauseGuardian + - fn: "transferOwnership" + owner: *governor + GraphProxyAdmin: + calls: + - fn: "transferOwnership" + owner: *governor + ServiceRegistry: + proxy: true + init: + controller: "${{Controller.address}}" + calls: + - fn: "syncAllContracts" + EpochManager: + proxy: true + init: + controller: "${{Controller.address}}" + lengthInBlocks: 60 # length in hours = lengthInBlocks*13/60/60 (~13 second blocks) + L2GraphToken: + proxy: true + init: + owner: "${{Env.deployer}}" + calls: + - fn: "addMinter" + minter: "${{RewardsManager.address}}" + - fn: "transferOwnership" + owner: *governor + L2Curation: + proxy: true + init: + controller: "${{Controller.address}}" + curationTokenMaster: "${{GraphCurationToken.address}}" + curationTaxPercentage: 0 # in parts per million + minimumCurationDeposit: "1" # in wei + calls: + - fn: "syncAllContracts" + DisputeManager: + proxy: true + init: + controller: "${{Controller.address}}" + arbitrator: *arbitrator + minimumDeposit: "100000000000000000000" # in wei + fishermanRewardPercentage: 1000 # in parts per million + qrySlashingPercentage: 1000 # in parts per million + idxSlashingPercentage: 100000 # in parts per million + calls: + - fn: "syncAllContracts" + L2GNS: + proxy: true + init: + controller: "${{Controller.address}}" + subgraphNFT: "${{SubgraphNFT.address}}" + calls: + - fn: "approveAll" + - fn: "syncAllContracts" + SubgraphNFT: + init: + governor: "${{Env.deployer}}" + calls: + - fn: "setTokenDescriptor" + tokenDescriptor: "${{SubgraphNFTDescriptor.address}}" + - fn: "setMinter" + minter: "${{L2GNS.address}}" + - fn: "transferOwnership" + owner: *governor + L2Staking: + proxy: true + init: + controller: "${{Controller.address}}" + minimumIndexerStake: "10000000000000000000" # in wei + thawingPeriod: 20 # in blocks + protocolPercentage: 0 # in parts per million + curationPercentage: 0 # in parts per million + maxAllocationEpochs: 5 # in epochs + delegationUnbondingPeriod: 1 # in epochs + delegationRatio: 16 # delegated stake to indexer stake multiplier + rebateParameters: + alphaNumerator: 100 # alphaNumerator / alphaDenominator + alphaDenominator: 100 # alphaNumerator / alphaDenominator + lambdaNumerator: 60 # lambdaNumerator / lambdaDenominator + lambdaDenominator: 100 # lambdaNumerator / lambdaDenominator + extensionImpl: "${{StakingExtension.address}}" + calls: + - fn: "setDelegationTaxPercentage" + delegationTaxPercentage: 0 # parts per million + - fn: "setSlasher" + slasher: "${{DisputeManager.address}}" + allowed: true + - fn: "syncAllContracts" + RewardsManager: + proxy: true + init: + controller: "${{Controller.address}}" + calls: + - fn: "setIssuancePerBlock" + issuancePerBlock: "114155251141552511415" # per block increase of total supply, blocks in a year = 365*60*60*24/12 + - fn: "setSubgraphAvailabilityOracle" + subgraphAvailabilityOracle: "${{SubgraphAvailabilityManager.address}}" + - fn: "syncAllContracts" + AllocationExchange: + init: + graphToken: "${{L2GraphToken.address}}" + staking: "${{L2Staking.address}}" + governor: *allocationExchangeOwner + authority: *authority + calls: + - fn: "approveAll" + L2GraphTokenGateway: + proxy: true + init: + controller: "${{Controller.address}}" + calls: + - fn: "syncAllContracts" + - fn: "setPauseGuardian" + pauseGuardian: *pauseGuardian + SubgraphAvailabilityManager: + init: + governor: *governor + rewardsManager: "${{RewardsManager.address}}" + executionThreshold: 5 + voteTimeLimit: 300 + oracles: *availabilityOracles diff --git a/packages/contracts/config/graph.arbitrum-localhost.yml b/packages/contracts/config/graph.arbitrum-localhost.yml new file mode 100644 index 000000000..62598a07c --- /dev/null +++ b/packages/contracts/config/graph.arbitrum-localhost.yml @@ -0,0 +1,164 @@ +general: + arbitrator: &arbitrator "0x4237154FE0510FdE3575656B60c68a01B9dCDdF8" # Arbitration Council + governor: &governor "0x1257227a2ECA34834940110f7B5e341A5143A2c4" # Graph Council + authority: &authority "0x12B8D08b116E1E3cc29eE9Cf42bB0AA8129C3215" # Authority that signs payment vouchers + availabilityOracles: &availabilityOracles # Subgraph Availability Oracles + - "0x7694a48065f063a767a962610C6717c59F36b445" + - "0x7694a48065f063a767a962610C6717c59F36b445" + - "0x7694a48065f063a767a962610C6717c59F36b445" + - "0x7694a48065f063a767a962610C6717c59F36b445" + - "0x7694a48065f063a767a962610C6717c59F36b445" + pauseGuardian: &pauseGuardian "0x601060e0DC5349AA55EC73df5A58cB0FC1cD2e3C" # Protocol pause guardian + allocationExchangeOwner: &allocationExchangeOwner "0xbD38F7b67a591A5cc7D642e1026E5095B819d952" # Allocation Exchange owner + +contracts: + Controller: + calls: + - fn: "setContractProxy" + id: "0xe6876326c1291dfcbbd3864a6816d698cd591defc7aa2153d7f9c4c04016c89f" # keccak256('Curation') + contractAddress: "${{L2Curation.address}}" + - fn: "setContractProxy" + id: "0x39605a6c26a173774ca666c67ef70cf491880e5d3d6d0ca66ec0a31034f15ea3" # keccak256('GNS') + contractAddress: "${{L2GNS.address}}" + - fn: "setContractProxy" + id: "0xf942813d07d17b56de9a9afc8de0ced6e8c053bbfdcc87b7badea4ddcf27c307" # keccak256('DisputeManager') + contractAddress: "${{DisputeManager.address}}" + - fn: "setContractProxy" + id: "0xc713c3df6d14cdf946460395d09af88993ee2b948b1a808161494e32c5f67063" # keccak256('EpochManager') + contractAddress: "${{EpochManager.address}}" + - fn: "setContractProxy" + id: "0x966f1e8d8d8014e05f6ec4a57138da9be1f7c5a7f802928a18072f7c53180761" # keccak256('RewardsManager') + contractAddress: "${{RewardsManager.address}}" + - fn: "setContractProxy" + id: "0x1df41cd916959d1163dc8f0671a666ea8a3e434c13e40faef527133b5d167034" # keccak256('Staking') + contractAddress: "${{L2Staking.address}}" + - fn: "setContractProxy" + id: "0x45fc200c7e4544e457d3c5709bfe0d520442c30bbcbdaede89e8d4a4bbc19247" # keccak256('GraphToken') + contractAddress: "${{L2GraphToken.address}}" + - fn: "setContractProxy" + id: "0xd362cac9cb75c10d67bcc0b7eeb0b1ef48bb5420b556c092d4fd7f758816fcf0" # keccak256('GraphTokenGateway') + contractAddress: "${{L2GraphTokenGateway.address}}" + - fn: "setPauseGuardian" + pauseGuardian: *pauseGuardian + - fn: "transferOwnership" + owner: *governor + GraphProxyAdmin: + calls: + - fn: "transferOwnership" + owner: *governor + ServiceRegistry: + proxy: true + init: + controller: "${{Controller.address}}" + calls: + - fn: "syncAllContracts" + EpochManager: + proxy: true + init: + controller: "${{Controller.address}}" + lengthInBlocks: 554 # length in hours = lengthInBlocks*13/60/60 (~13 second blocks) + L2GraphToken: + proxy: true + init: + owner: "${{Env.deployer}}" + calls: + - fn: "addMinter" + minter: "${{RewardsManager.address}}" + - fn: "renounceMinter" + - fn: "transferOwnership" + owner: *governor + L2Curation: + proxy: true + init: + controller: "${{Controller.address}}" + curationTokenMaster: "${{GraphCurationToken.address}}" + curationTaxPercentage: 10000 # in parts per million + minimumCurationDeposit: "1" # in wei + calls: + - fn: "syncAllContracts" + DisputeManager: + proxy: true + init: + controller: "${{Controller.address}}" + arbitrator: *arbitrator + minimumDeposit: "10000000000000000000000" # in wei + fishermanRewardPercentage: 500000 # in parts per million + idxSlashingPercentage: 25000 # in parts per million + qrySlashingPercentage: 25000 # in parts per million + calls: + - fn: "syncAllContracts" + L2GNS: + proxy: true + init: + controller: "${{Controller.address}}" + subgraphNFT: "${{SubgraphNFT.address}}" + calls: + - fn: "approveAll" + - fn: "syncAllContracts" + SubgraphNFT: + init: + governor: "${{Env.deployer}}" + calls: + - fn: "setTokenDescriptor" + tokenDescriptor: "${{SubgraphNFTDescriptor.address}}" + - fn: "setMinter" + minter: "${{L2GNS.address}}" + - fn: "transferOwnership" + owner: *governor + L2Staking: + proxy: true + init: + controller: "${{Controller.address}}" + minimumIndexerStake: "100000000000000000000000" # in wei + thawingPeriod: 6646 # in blocks + protocolPercentage: 10000 # in parts per million + curationPercentage: 100000 # in parts per million + maxAllocationEpochs: 4 # in epochs + delegationUnbondingPeriod: 12 # in epochs + delegationRatio: 16 # delegated stake to indexer stake multiplier + rebateParameters: + alphaNumerator: 100 # alphaNumerator / alphaDenominator + alphaDenominator: 100 # alphaNumerator / alphaDenominator + lambdaNumerator: 60 # lambdaNumerator / lambdaDenominator + lambdaDenominator: 100 # lambdaNumerator / lambdaDenominator + extensionImpl: "${{StakingExtension.address}}" + calls: + - fn: "setDelegationTaxPercentage" + delegationTaxPercentage: 5000 # parts per million + - fn: "setSlasher" + slasher: "${{DisputeManager.address}}" + allowed: true + - fn: "syncAllContracts" + RewardsManager: + proxy: true + init: + controller: "${{Controller.address}}" + calls: + - fn: "setIssuancePerBlock" + issuancePerBlock: "6036500000000000000" # per block increase of total supply, blocks in a year = 365*60*60*24/12 + - fn: "setSubgraphAvailabilityOracle" + subgraphAvailabilityOracle: "${{SubgraphAvailabilityManager.address}}" + - fn: "syncAllContracts" + AllocationExchange: + init: + graphToken: "${{L2GraphToken.address}}" + staking: "${{L2Staking.address}}" + governor: *allocationExchangeOwner + authority: *authority + calls: + - fn: "approveAll" + L2GraphTokenGateway: + proxy: true + init: + controller: "${{Controller.address}}" + calls: + - fn: "syncAllContracts" + - fn: "setPauseGuardian" + pauseGuardian: *pauseGuardian + SubgraphAvailabilityManager: + init: + governor: *governor + rewardsManager: "${{RewardsManager.address}}" + executionThreshold: 5 + voteTimeLimit: 300 + oracles: *availabilityOracles diff --git a/packages/contracts/config/graph.arbitrum-one.yml b/packages/contracts/config/graph.arbitrum-one.yml new file mode 100644 index 000000000..f9dae1862 --- /dev/null +++ b/packages/contracts/config/graph.arbitrum-one.yml @@ -0,0 +1,152 @@ +general: + arbitrator: &arbitrator "0x113DC95e796836b8F0Fa71eE7fB42f221740c3B0" # Arbitration Council + governor: &governor "0x8C6de8F8D562f3382417340A6994601eE08D3809" # Graph Council + authority: &authority "0x4a06858f104B2aB1e1185AB7E09F7B5d3b700479" # Authority that signs payment vouchers + availabilityOracle: &availabilityOracle "0x1BEB2266f264Cebd9C6FBE1ceB394a8d944401c1" # Subgraph Availability Oracle + pauseGuardian: &pauseGuardian "0xB0aD33a21b98bCA1761729A105e2E34e27153aAE" # Protocol pause guardian + allocationExchangeOwner: &allocationExchangeOwner "0x270Ea4ea9e8A699f8fE54515E3Bb2c418952623b" # Allocation Exchange owner + +contracts: + Controller: + calls: + - fn: "setContractProxy" + id: "0xe6876326c1291dfcbbd3864a6816d698cd591defc7aa2153d7f9c4c04016c89f" # keccak256('Curation') + contractAddress: "${{L2Curation.address}}" + - fn: "setContractProxy" + id: "0x39605a6c26a173774ca666c67ef70cf491880e5d3d6d0ca66ec0a31034f15ea3" # keccak256('GNS') + contractAddress: "${{L2GNS.address}}" + - fn: "setContractProxy" + id: "0xf942813d07d17b56de9a9afc8de0ced6e8c053bbfdcc87b7badea4ddcf27c307" # keccak256('DisputeManager') + contractAddress: "${{DisputeManager.address}}" + - fn: "setContractProxy" + id: "0xc713c3df6d14cdf946460395d09af88993ee2b948b1a808161494e32c5f67063" # keccak256('EpochManager') + contractAddress: "${{EpochManager.address}}" + - fn: "setContractProxy" + id: "0x966f1e8d8d8014e05f6ec4a57138da9be1f7c5a7f802928a18072f7c53180761" # keccak256('RewardsManager') + contractAddress: "${{RewardsManager.address}}" + - fn: "setContractProxy" + id: "0x1df41cd916959d1163dc8f0671a666ea8a3e434c13e40faef527133b5d167034" # keccak256('Staking') + contractAddress: "${{L2Staking.address}}" + - fn: "setContractProxy" + id: "0x45fc200c7e4544e457d3c5709bfe0d520442c30bbcbdaede89e8d4a4bbc19247" # keccak256('GraphToken') + contractAddress: "${{L2GraphToken.address}}" + - fn: "setContractProxy" + id: "0xd362cac9cb75c10d67bcc0b7eeb0b1ef48bb5420b556c092d4fd7f758816fcf0" # keccak256('GraphTokenGateway') + contractAddress: "${{L2GraphTokenGateway.address}}" + - fn: "setPauseGuardian" + pauseGuardian: *pauseGuardian + - fn: "transferOwnership" + owner: *governor + GraphProxyAdmin: + calls: + - fn: "transferOwnership" + owner: *governor + ServiceRegistry: + proxy: true + init: + controller: "${{Controller.address}}" + calls: + - fn: "syncAllContracts" + EpochManager: + proxy: true + init: + controller: "${{Controller.address}}" + lengthInBlocks: 6646 # length in hours = lengthInBlocks*13/60/60 (~13 second blocks) + L2GraphToken: + proxy: true + init: + owner: "${{Env.deployer}}" + calls: + - fn: "addMinter" + minter: "${{RewardsManager.address}}" + - fn: "renounceMinter" + - fn: "transferOwnership" + owner: *governor + L2Curation: + proxy: true + init: + controller: "${{Controller.address}}" + curationTokenMaster: "${{GraphCurationToken.address}}" + curationTaxPercentage: 10000 # in parts per million + minimumCurationDeposit: "1" # in wei + calls: + - fn: "syncAllContracts" + DisputeManager: + proxy: true + init: + controller: "${{Controller.address}}" + arbitrator: *arbitrator + minimumDeposit: "10000000000000000000000" # in wei + fishermanRewardPercentage: 500000 # in parts per million + idxSlashingPercentage: 25000 # in parts per million + qrySlashingPercentage: 25000 # in parts per million + calls: + - fn: "syncAllContracts" + L2GNS: + proxy: true + init: + controller: "${{Controller.address}}" + subgraphNFT: "${{SubgraphNFT.address}}" + calls: + - fn: "approveAll" + - fn: "syncAllContracts" + SubgraphNFT: + init: + governor: "${{Env.deployer}}" + calls: + - fn: "setTokenDescriptor" + tokenDescriptor: "${{SubgraphNFTDescriptor.address}}" + - fn: "setMinter" + minter: "${{L2GNS.address}}" + - fn: "transferOwnership" + owner: *governor + L2Staking: + proxy: true + init: + controller: "${{Controller.address}}" + minimumIndexerStake: "100000000000000000000000" # in wei + thawingPeriod: 186092 # in blocks + protocolPercentage: 10000 # in parts per million + curationPercentage: 100000 # in parts per million + maxAllocationEpochs: 28 # in epochs + delegationUnbondingPeriod: 28 # in epochs + delegationRatio: 16 # delegated stake to indexer stake multiplier + rebateParameters: + alphaNumerator: 100 # alphaNumerator / alphaDenominator + alphaDenominator: 100 # alphaNumerator / alphaDenominator + lambdaNumerator: 60 # lambdaNumerator / lambdaDenominator + lambdaDenominator: 100 # lambdaNumerator / lambdaDenominator + extensionImpl: "${{StakingExtension.address}}" + calls: + - fn: "setDelegationTaxPercentage" + delegationTaxPercentage: 5000 # parts per million + - fn: "setSlasher" + slasher: "${{DisputeManager.address}}" + allowed: true + - fn: "syncAllContracts" + RewardsManager: + proxy: true + init: + controller: "${{Controller.address}}" + calls: + - fn: "setIssuancePerBlock" + issuancePerBlock: "6036500000000000000" # per block increase of total supply, blocks in a year = 365*60*60*24/12 + - fn: "setSubgraphAvailabilityOracle" + subgraphAvailabilityOracle: *availabilityOracle + - fn: "syncAllContracts" + AllocationExchange: + init: + graphToken: "${{L2GraphToken.address}}" + staking: "${{L2Staking.address}}" + governor: *allocationExchangeOwner + authority: *authority + calls: + - fn: "approveAll" + L2GraphTokenGateway: + proxy: true + init: + controller: "${{Controller.address}}" + calls: + - fn: "syncAllContracts" + - fn: "setPauseGuardian" + pauseGuardian: *pauseGuardian diff --git a/packages/contracts/config/graph.arbitrum-sepolia.yml b/packages/contracts/config/graph.arbitrum-sepolia.yml new file mode 100644 index 000000000..c5fe97010 --- /dev/null +++ b/packages/contracts/config/graph.arbitrum-sepolia.yml @@ -0,0 +1,163 @@ +general: + arbitrator: &arbitrator "0x1726A5d52e279d02ff4732eCeB2D67BFE5Add328" # EOA (TODO: update to a multisig) + governor: &governor "0x72ee30d43Fb5A90B3FE983156C5d2fBE6F6d07B3" # EOA (TODO: update to a multisig) + authority: &authority "0x49D4CFC037430cA9355B422bAeA7E9391e1d3215" # Authority that signs payment vouchers + availabilityOracles: &availabilityOracles # Array of Subgraph Availability Oracles + - "0x5e4e823Ed094c035133eEC5Ec0d08ae1Af04e9Fa" + - "0x5aeE4c46cF9260E85E630ca7d9D757D5D5DbaFD6" + - "0x7369Cf2a917296c36f506144f3dE552403d1e1f1" + - "0x1e1f84c07e0471fc979f6f08228b0bd34cda9e54" + - "0x711aEA1f358DFAf74D34B4B525F9190e631F406C" + pauseGuardian: &pauseGuardian "0xa0444508232dA3FA6C2f96a5f105f3f0cc0d20D7" # Protocol pause guardian + allocationExchangeOwner: &allocationExchangeOwner "0x72ee30d43Fb5A90B3FE983156C5d2fBE6F6d07B3" # Allocation Exchange owner + +contracts: + Controller: + calls: + - fn: "setContractProxy" + id: "0xe6876326c1291dfcbbd3864a6816d698cd591defc7aa2153d7f9c4c04016c89f" # keccak256('Curation') + contractAddress: "${{L2Curation.address}}" + - fn: "setContractProxy" + id: "0x39605a6c26a173774ca666c67ef70cf491880e5d3d6d0ca66ec0a31034f15ea3" # keccak256('GNS') + contractAddress: "${{L2GNS.address}}" + - fn: "setContractProxy" + id: "0xf942813d07d17b56de9a9afc8de0ced6e8c053bbfdcc87b7badea4ddcf27c307" # keccak256('DisputeManager') + contractAddress: "${{DisputeManager.address}}" + - fn: "setContractProxy" + id: "0xc713c3df6d14cdf946460395d09af88993ee2b948b1a808161494e32c5f67063" # keccak256('EpochManager') + contractAddress: "${{EpochManager.address}}" + - fn: "setContractProxy" + id: "0x966f1e8d8d8014e05f6ec4a57138da9be1f7c5a7f802928a18072f7c53180761" # keccak256('RewardsManager') + contractAddress: "${{RewardsManager.address}}" + - fn: "setContractProxy" + id: "0x1df41cd916959d1163dc8f0671a666ea8a3e434c13e40faef527133b5d167034" # keccak256('Staking') + contractAddress: "${{L2Staking.address}}" + - fn: "setContractProxy" + id: "0x45fc200c7e4544e457d3c5709bfe0d520442c30bbcbdaede89e8d4a4bbc19247" # keccak256('GraphToken') + contractAddress: "${{L2GraphToken.address}}" + - fn: "setContractProxy" + id: "0xd362cac9cb75c10d67bcc0b7eeb0b1ef48bb5420b556c092d4fd7f758816fcf0" # keccak256('GraphTokenGateway') + contractAddress: "${{L2GraphTokenGateway.address}}" + - fn: "setPauseGuardian" + pauseGuardian: *pauseGuardian + - fn: "transferOwnership" + owner: *governor + GraphProxyAdmin: + calls: + - fn: "transferOwnership" + owner: *governor + ServiceRegistry: + proxy: true + init: + controller: "${{Controller.address}}" + calls: + - fn: "syncAllContracts" + EpochManager: + proxy: true + init: + controller: "${{Controller.address}}" + lengthInBlocks: 554 # length in hours = lengthInBlocks*13/60/60 (~13 second blocks) + L2GraphToken: + proxy: true + init: + owner: "${{Env.deployer}}" + calls: + - fn: "addMinter" + minter: "${{RewardsManager.address}}" + - fn: "transferOwnership" + owner: *governor + L2Curation: + proxy: true + init: + controller: "${{Controller.address}}" + curationTokenMaster: "${{GraphCurationToken.address}}" + curationTaxPercentage: 10000 # in parts per million + minimumCurationDeposit: "1" # in wei + calls: + - fn: "syncAllContracts" + DisputeManager: + proxy: true + init: + controller: "${{Controller.address}}" + arbitrator: *arbitrator + minimumDeposit: "10000000000000000000000" # in wei + fishermanRewardPercentage: 500000 # in parts per million + idxSlashingPercentage: 25000 # in parts per million + qrySlashingPercentage: 25000 # in parts per million + calls: + - fn: "syncAllContracts" + L2GNS: + proxy: true + init: + controller: "${{Controller.address}}" + subgraphNFT: "${{SubgraphNFT.address}}" + calls: + - fn: "approveAll" + - fn: "syncAllContracts" + SubgraphNFT: + init: + governor: "${{Env.deployer}}" + calls: + - fn: "setTokenDescriptor" + tokenDescriptor: "${{SubgraphNFTDescriptor.address}}" + - fn: "setMinter" + minter: "${{L2GNS.address}}" + - fn: "transferOwnership" + owner: *governor + L2Staking: + proxy: true + init: + controller: "${{Controller.address}}" + minimumIndexerStake: "100000000000000000000000" # in wei + thawingPeriod: 6646 # in blocks + protocolPercentage: 10000 # in parts per million + curationPercentage: 100000 # in parts per million + maxAllocationEpochs: 8 # in epochs + delegationUnbondingPeriod: 12 # in epochs + delegationRatio: 16 # delegated stake to indexer stake multiplier + rebateParameters: + alphaNumerator: 100 # alphaNumerator / alphaDenominator + alphaDenominator: 100 # alphaNumerator / alphaDenominator + lambdaNumerator: 60 # lambdaNumerator / lambdaDenominator + lambdaDenominator: 100 # lambdaNumerator / lambdaDenominator + extensionImpl: "${{StakingExtension.address}}" + calls: + - fn: "setDelegationTaxPercentage" + delegationTaxPercentage: 5000 # parts per million + - fn: "setSlasher" + slasher: "${{DisputeManager.address}}" + allowed: true + - fn: "syncAllContracts" + RewardsManager: + proxy: true + init: + controller: "${{Controller.address}}" + calls: + - fn: "setIssuancePerBlock" + issuancePerBlock: "6036500000000000000" # per block increase of total supply, blocks in a year = 365*60*60*24/12 + - fn: "setSubgraphAvailabilityOracle" + subgraphAvailabilityOracle: "${{SubgraphAvailabilityManager.address}}" + - fn: "syncAllContracts" + AllocationExchange: + init: + graphToken: "${{L2GraphToken.address}}" + staking: "${{L2Staking.address}}" + governor: *allocationExchangeOwner + authority: *authority + calls: + - fn: "approveAll" + L2GraphTokenGateway: + proxy: true + init: + controller: "${{Controller.address}}" + calls: + - fn: "syncAllContracts" + - fn: "setPauseGuardian" + pauseGuardian: *pauseGuardian + SubgraphAvailabilityManager: + init: + governor: *governor + rewardsManager: "${{RewardsManager.address}}" + executionThreshold: 5 + voteTimeLimit: 300 + oracles: *availabilityOracles diff --git a/packages/contracts/config/graph.goerli.yml b/packages/contracts/config/graph.goerli.yml new file mode 100644 index 000000000..d09610334 --- /dev/null +++ b/packages/contracts/config/graph.goerli.yml @@ -0,0 +1,161 @@ +general: + arbitrator: &arbitrator "0xFD01aa87BeB04D0ac764FC298aCFd05FfC5439cD" # Arbitration Council + governor: &governor "0xf1135bFF22512FF2A585b8d4489426CE660f204c" # Graph Council + authority: &authority "0x52e498aE9B8A5eE2A5Cd26805F06A9f29A7F489F" # Authority that signs payment vouchers + availabilityOracle: &availabilityOracle "0xDC6785e39Cba34A6d258148e3E83E24285118796" # Subgraph Availability Oracle + pauseGuardian: &pauseGuardian "0x6855D551CaDe60754D145fb5eDCD90912D860262" # Protocol pause guardian + allocationExchangeOwner: &allocationExchangeOwner "0xf1135bFF22512FF2A585b8d4489426CE660f204c" # Allocation Exchange owner + +contracts: + Controller: + calls: + - fn: "setContractProxy" + id: "0xe6876326c1291dfcbbd3864a6816d698cd591defc7aa2153d7f9c4c04016c89f" # keccak256('Curation') + contractAddress: "${{Curation.address}}" + - fn: "setContractProxy" + id: "0x39605a6c26a173774ca666c67ef70cf491880e5d3d6d0ca66ec0a31034f15ea3" # keccak256('GNS') + contractAddress: "${{L1GNS.address}}" + - fn: "setContractProxy" + id: "0xf942813d07d17b56de9a9afc8de0ced6e8c053bbfdcc87b7badea4ddcf27c307" # keccak256('DisputeManager') + contractAddress: "${{DisputeManager.address}}" + - fn: "setContractProxy" + id: "0xc713c3df6d14cdf946460395d09af88993ee2b948b1a808161494e32c5f67063" # keccak256('EpochManager') + contractAddress: "${{EpochManager.address}}" + - fn: "setContractProxy" + id: "0x966f1e8d8d8014e05f6ec4a57138da9be1f7c5a7f802928a18072f7c53180761" # keccak256('RewardsManager') + contractAddress: "${{RewardsManager.address}}" + - fn: "setContractProxy" + id: "0x1df41cd916959d1163dc8f0671a666ea8a3e434c13e40faef527133b5d167034" # keccak256('Staking') + contractAddress: "${{L1Staking.address}}" + - fn: "setContractProxy" + id: "0x45fc200c7e4544e457d3c5709bfe0d520442c30bbcbdaede89e8d4a4bbc19247" # keccak256('GraphToken') + contractAddress: "${{GraphToken.address}}" + - fn: "setContractProxy" + id: "0xd362cac9cb75c10d67bcc0b7eeb0b1ef48bb5420b556c092d4fd7f758816fcf0" # keccak256('GraphTokenGateway') + contractAddress: "${{L1GraphTokenGateway.address}}" + - fn: "setPauseGuardian" + pauseGuardian: *pauseGuardian + - fn: "transferOwnership" + owner: *governor + GraphProxyAdmin: + calls: + - fn: "transferOwnership" + owner: *governor + ServiceRegistry: + proxy: true + init: + controller: "${{Controller.address}}" + calls: + - fn: "syncAllContracts" + EpochManager: + proxy: true + init: + controller: "${{Controller.address}}" + lengthInBlocks: 554 # length in hours = lengthInBlocks*13/60/60 (~13 second blocks) + GraphToken: + init: + initialSupply: "10000000000000000000000000000" # in wei + calls: + - fn: "addMinter" + minter: "${{RewardsManager.address}}" + - fn: "addMinter" + minter: "${{L1GraphTokenGateway.address}}" + - fn: "renounceMinter" + - fn: "transferOwnership" + owner: *governor + Curation: + proxy: true + init: + controller: "${{Controller.address}}" + bondingCurve: "${{BancorFormula.address}}" + curationTokenMaster: "${{GraphCurationToken.address}}" + reserveRatio: 500000 # in parts per million + curationTaxPercentage: 10000 # in parts per million + minimumCurationDeposit: "1000000000000000000" # in wei + calls: + - fn: "syncAllContracts" + DisputeManager: + proxy: true + init: + controller: "${{Controller.address}}" + arbitrator: *arbitrator + minimumDeposit: "10000000000000000000000" # in wei + fishermanRewardPercentage: 500000 # in parts per million + idxSlashingPercentage: 25000 # in parts per million + qrySlashingPercentage: 25000 # in parts per million + calls: + - fn: "syncAllContracts" + L1GNS: + proxy: true + init: + controller: "${{Controller.address}}" + subgraphNFT: "${{SubgraphNFT.address}}" + calls: + - fn: "approveAll" + - fn: "syncAllContracts" + SubgraphNFT: + init: + governor: "${{Env.deployer}}" + calls: + - fn: "setTokenDescriptor" + tokenDescriptor: "${{SubgraphNFTDescriptor.address}}" + - fn: "setMinter" + minter: "${{L1GNS.address}}" + - fn: "transferOwnership" + owner: *governor + L1Staking: + proxy: true + init: + controller: "${{Controller.address}}" + minimumIndexerStake: "100000000000000000000000" # in wei + thawingPeriod: 6646 # in blocks + protocolPercentage: 10000 # in parts per million + curationPercentage: 100000 # in parts per million + maxAllocationEpochs: 4 # in epochs + delegationUnbondingPeriod: 12 # in epochs + delegationRatio: 16 # delegated stake to indexer stake multiplier + rebateParameters: + alphaNumerator: 100 # alphaNumerator / alphaDenominator + alphaDenominator: 100 # alphaNumerator / alphaDenominator + lambdaNumerator: 60 # lambdaNumerator / lambdaDenominator + lambdaDenominator: 100 # lambdaNumerator / lambdaDenominator + extensionImpl: "${{StakingExtension.address}}" + calls: + - fn: "setDelegationTaxPercentage" + delegationTaxPercentage: 5000 # parts per million + - fn: "setSlasher" + slasher: "${{DisputeManager.address}}" + allowed: true + - fn: "syncAllContracts" + RewardsManager: + proxy: true + init: + controller: "${{Controller.address}}" + calls: + - fn: "setIssuancePerBlock" + issuancePerBlock: "114693500000000000000" # per block increase of total supply, blocks in a year = 365*60*60*24/12 + - fn: "setSubgraphAvailabilityOracle" + subgraphAvailabilityOracle: *availabilityOracle + - fn: "syncAllContracts" + AllocationExchange: + init: + graphToken: "${{GraphToken.address}}" + staking: "${{L1Staking.address}}" + governor: *allocationExchangeOwner + authority: *authority + calls: + - fn: "approveAll" + L1GraphTokenGateway: + proxy: true + init: + controller: "${{Controller.address}}" + calls: + - fn: "syncAllContracts" + - fn: "setPauseGuardian" + pauseGuardian: *pauseGuardian + BridgeEscrow: + proxy: true + init: + controller: "${{Controller.address}}" + calls: + - fn: "syncAllContracts" diff --git a/packages/contracts/config/graph.hardhat.yml b/packages/contracts/config/graph.hardhat.yml new file mode 100644 index 000000000..47b069aad --- /dev/null +++ b/packages/contracts/config/graph.hardhat.yml @@ -0,0 +1,160 @@ +general: + arbitrator: &arbitrator "0xFFcf8FDEE72ac11b5c542428B35EEF5769C409f0" # Arbitration Council + governor: &governor "0x22d491Bde2303f2f43325b2108D26f1eAbA1e32b" # Governor Council + authority: &authority "0xE11BA2b4D45Eaed5996Cd0823791E0C93114882d" # Authority that signs payment vouchers + availabilityOracle: &availabilityOracle "0xd03ea8624C8C5987235048901fB614fDcA89b117" # Subgraph Availability Oracle + pauseGuardian: &pauseGuardian "0x95cED938F7991cd0dFcb48F0a06a40FA1aF46EBC" # Protocol pause guardian + allocationExchangeOwner: &allocationExchangeOwner "0x3E5e9111Ae8eB78Fe1CC3bb8915d5D461F3Ef9A9" # Allocation Exchange owner + +contracts: + Controller: + calls: + - fn: "setContractProxy" + id: "0xe6876326c1291dfcbbd3864a6816d698cd591defc7aa2153d7f9c4c04016c89f" # keccak256('Curation') + contractAddress: "${{Curation.address}}" + - fn: "setContractProxy" + id: "0x39605a6c26a173774ca666c67ef70cf491880e5d3d6d0ca66ec0a31034f15ea3" # keccak256('GNS') + contractAddress: "${{L1GNS.address}}" + - fn: "setContractProxy" + id: "0xf942813d07d17b56de9a9afc8de0ced6e8c053bbfdcc87b7badea4ddcf27c307" # keccak256('DisputeManager') + contractAddress: "${{DisputeManager.address}}" + - fn: "setContractProxy" + id: "0xc713c3df6d14cdf946460395d09af88993ee2b948b1a808161494e32c5f67063" # keccak256('EpochManager') + contractAddress: "${{EpochManager.address}}" + - fn: "setContractProxy" + id: "0x966f1e8d8d8014e05f6ec4a57138da9be1f7c5a7f802928a18072f7c53180761" # keccak256('RewardsManager') + contractAddress: "${{RewardsManager.address}}" + - fn: "setContractProxy" + id: "0x1df41cd916959d1163dc8f0671a666ea8a3e434c13e40faef527133b5d167034" # keccak256('Staking') + contractAddress: "${{L1Staking.address}}" + - fn: "setContractProxy" + id: "0x45fc200c7e4544e457d3c5709bfe0d520442c30bbcbdaede89e8d4a4bbc19247" # keccak256('GraphToken') + contractAddress: "${{GraphToken.address}}" + - fn: "setContractProxy" + id: "0xd362cac9cb75c10d67bcc0b7eeb0b1ef48bb5420b556c092d4fd7f758816fcf0" # keccak256('GraphTokenGateway') + contractAddress: "${{L1GraphTokenGateway.address}}" + - fn: "setPauseGuardian" + pauseGuardian: *pauseGuardian + - fn: "transferOwnership" + owner: *governor + GraphProxyAdmin: + calls: + - fn: "transferOwnership" + owner: *governor + ServiceRegistry: + proxy: true + init: + controller: "${{Controller.address}}" + calls: + - fn: "syncAllContracts" + EpochManager: + proxy: true + init: + controller: "${{Controller.address}}" + lengthInBlocks: 60 # length in hours = lengthInBlocks*13/60/60 (~13 second blocks) + GraphToken: + init: + initialSupply: "10000000000000000000000000000" # in wei + calls: + - fn: "addMinter" + minter: "${{RewardsManager.address}}" + - fn: "addMinter" + minter: "${{L1GraphTokenGateway.address}}" + - fn: "transferOwnership" + owner: *governor + Curation: + proxy: true + init: + controller: "${{Controller.address}}" + bondingCurve: "${{BancorFormula.address}}" + curationTokenMaster: "${{GraphCurationToken.address}}" + reserveRatio: 500000 # in parts per million + curationTaxPercentage: 0 # in parts per million + minimumCurationDeposit: "100000000000000000000" # in wei + calls: + - fn: "syncAllContracts" + DisputeManager: + proxy: true + init: + controller: "${{Controller.address}}" + arbitrator: *arbitrator + minimumDeposit: "100000000000000000000" # in wei + fishermanRewardPercentage: 1000 # in parts per million + qrySlashingPercentage: 1000 # in parts per million + idxSlashingPercentage: 100000 # in parts per million + calls: + - fn: "syncAllContracts" + L1GNS: + proxy: true + init: + controller: "${{Controller.address}}" + subgraphNFT: "${{SubgraphNFT.address}}" + calls: + - fn: "approveAll" + - fn: "syncAllContracts" + SubgraphNFT: + init: + governor: "${{Env.deployer}}" + calls: + - fn: "setTokenDescriptor" + tokenDescriptor: "${{SubgraphNFTDescriptor.address}}" + - fn: "setMinter" + minter: "${{L1GNS.address}}" + - fn: "transferOwnership" + owner: *governor + L1Staking: + proxy: true + init: + controller: "${{Controller.address}}" + minimumIndexerStake: "10000000000000000000" # in wei + thawingPeriod: 20 # in blocks + protocolPercentage: 0 # in parts per million + curationPercentage: 0 # in parts per million + maxAllocationEpochs: 5 # in epochs + delegationUnbondingPeriod: 1 # in epochs + delegationRatio: 16 # delegated stake to indexer stake multiplier + rebateParameters: + alphaNumerator: 100 # alphaNumerator / alphaDenominator + alphaDenominator: 100 # alphaNumerator / alphaDenominator + lambdaNumerator: 60 # lambdaNumerator / lambdaDenominator + lambdaDenominator: 100 # lambdaNumerator / lambdaDenominator + extensionImpl: "${{StakingExtension.address}}" + calls: + - fn: "setDelegationTaxPercentage" + delegationTaxPercentage: 0 # parts per million + - fn: "setSlasher" + slasher: "${{DisputeManager.address}}" + allowed: true + - fn: "syncAllContracts" + RewardsManager: + proxy: true + init: + controller: "${{Controller.address}}" + calls: + - fn: "setIssuancePerBlock" + issuancePerBlock: "114155251141552511415" # per block increase of total supply, blocks in a year = 365*60*60*24/12 + - fn: "setSubgraphAvailabilityOracle" + subgraphAvailabilityOracle: *availabilityOracle + - fn: "syncAllContracts" + AllocationExchange: + init: + graphToken: "${{GraphToken.address}}" + staking: "${{L1Staking.address}}" + governor: *allocationExchangeOwner + authority: *authority + calls: + - fn: "approveAll" + L1GraphTokenGateway: + proxy: true + init: + controller: "${{Controller.address}}" + calls: + - fn: "syncAllContracts" + - fn: "setPauseGuardian" + pauseGuardian: *pauseGuardian + BridgeEscrow: + proxy: true + init: + controller: "${{Controller.address}}" + calls: + - fn: "syncAllContracts" diff --git a/packages/contracts/config/graph.localhost.yml b/packages/contracts/config/graph.localhost.yml new file mode 100644 index 000000000..423052b98 --- /dev/null +++ b/packages/contracts/config/graph.localhost.yml @@ -0,0 +1,161 @@ +general: + arbitrator: &arbitrator "0xFFcf8FDEE72ac11b5c542428B35EEF5769C409f0" # Arbitration Council + governor: &governor "0x22d491Bde2303f2f43325b2108D26f1eAbA1e32b" # Governor Council + authority: &authority "0xE11BA2b4D45Eaed5996Cd0823791E0C93114882d" # Authority that signs payment vouchers + availabilityOracle: &availabilityOracle "0xd03ea8624C8C5987235048901fB614fDcA89b117" # Subgraph Availability Oracle + pauseGuardian: &pauseGuardian "0x95cED938F7991cd0dFcb48F0a06a40FA1aF46EBC" # Protocol pause guardian + allocationExchangeOwner: &allocationExchangeOwner "0x3E5e9111Ae8eB78Fe1CC3bb8915d5D461F3Ef9A9" # Allocation Exchange owner + +contracts: + Controller: + calls: + - fn: "setContractProxy" + id: "0xe6876326c1291dfcbbd3864a6816d698cd591defc7aa2153d7f9c4c04016c89f" # keccak256('Curation') + contractAddress: "${{Curation.address}}" + - fn: "setContractProxy" + id: "0x39605a6c26a173774ca666c67ef70cf491880e5d3d6d0ca66ec0a31034f15ea3" # keccak256('GNS') + contractAddress: "${{L1GNS.address}}" + - fn: "setContractProxy" + id: "0xf942813d07d17b56de9a9afc8de0ced6e8c053bbfdcc87b7badea4ddcf27c307" # keccak256('DisputeManager') + contractAddress: "${{DisputeManager.address}}" + - fn: "setContractProxy" + id: "0xc713c3df6d14cdf946460395d09af88993ee2b948b1a808161494e32c5f67063" # keccak256('EpochManager') + contractAddress: "${{EpochManager.address}}" + - fn: "setContractProxy" + id: "0x966f1e8d8d8014e05f6ec4a57138da9be1f7c5a7f802928a18072f7c53180761" # keccak256('RewardsManager') + contractAddress: "${{RewardsManager.address}}" + - fn: "setContractProxy" + id: "0x1df41cd916959d1163dc8f0671a666ea8a3e434c13e40faef527133b5d167034" # keccak256('Staking') + contractAddress: "${{L1Staking.address}}" + - fn: "setContractProxy" + id: "0x45fc200c7e4544e457d3c5709bfe0d520442c30bbcbdaede89e8d4a4bbc19247" # keccak256('GraphToken') + contractAddress: "${{GraphToken.address}}" + - fn: "setContractProxy" + id: "0xd362cac9cb75c10d67bcc0b7eeb0b1ef48bb5420b556c092d4fd7f758816fcf0" # keccak256('GraphTokenGateway') + contractAddress: "${{L1GraphTokenGateway.address}}" + - fn: "setPauseGuardian" + pauseGuardian: *pauseGuardian + - fn: "transferOwnership" + owner: *governor + GraphProxyAdmin: + calls: + - fn: "transferOwnership" + owner: *governor + ServiceRegistry: + proxy: true + init: + controller: "${{Controller.address}}" + calls: + - fn: "syncAllContracts" + EpochManager: + proxy: true + init: + controller: "${{Controller.address}}" + lengthInBlocks: 554 # length in hours = lengthInBlocks*13/60/60 (~13 second blocks) + GraphToken: + init: + initialSupply: "10000000000000000000000000000" # in wei + calls: + - fn: "addMinter" + minter: "${{RewardsManager.address}}" + - fn: "addMinter" + minter: "${{L1GraphTokenGateway.address}}" + - fn: "renounceMinter" + - fn: "transferOwnership" + owner: *governor + Curation: + proxy: true + init: + controller: "${{Controller.address}}" + bondingCurve: "${{BancorFormula.address}}" + curationTokenMaster: "${{GraphCurationToken.address}}" + reserveRatio: 500000 # in parts per million + curationTaxPercentage: 10000 # in parts per million + minimumCurationDeposit: "1000000000000000000" # in wei + calls: + - fn: "syncAllContracts" + DisputeManager: + proxy: true + init: + controller: "${{Controller.address}}" + arbitrator: *arbitrator + minimumDeposit: "10000000000000000000000" # in wei + fishermanRewardPercentage: 500000 # in parts per million + idxSlashingPercentage: 25000 # in parts per million + qrySlashingPercentage: 25000 # in parts per million + calls: + - fn: "syncAllContracts" + L1GNS: + proxy: true + init: + controller: "${{Controller.address}}" + subgraphNFT: "${{SubgraphNFT.address}}" + calls: + - fn: "approveAll" + - fn: "syncAllContracts" + SubgraphNFT: + init: + governor: "${{Env.deployer}}" + calls: + - fn: "setTokenDescriptor" + tokenDescriptor: "${{SubgraphNFTDescriptor.address}}" + - fn: "setMinter" + minter: "${{L1GNS.address}}" + - fn: "transferOwnership" + owner: *governor + L1Staking: + proxy: true + init: + controller: "${{Controller.address}}" + minimumIndexerStake: "100000000000000000000000" # in wei + thawingPeriod: 6646 # in blocks + protocolPercentage: 10000 # in parts per million + curationPercentage: 100000 # in parts per million + maxAllocationEpochs: 4 # in epochs + delegationUnbondingPeriod: 12 # in epochs + delegationRatio: 16 # delegated stake to indexer stake multiplier + rebateParameters: + alphaNumerator: 100 # alphaNumerator / alphaDenominator + alphaDenominator: 100 # alphaNumerator / alphaDenominator + lambdaNumerator: 60 # lambdaNumerator / lambdaDenominator + lambdaDenominator: 100 # lambdaNumerator / lambdaDenominator + extensionImpl: "${{StakingExtension.address}}" + calls: + - fn: "setDelegationTaxPercentage" + delegationTaxPercentage: 5000 # parts per million + - fn: "setSlasher" + slasher: "${{DisputeManager.address}}" + allowed: true + - fn: "syncAllContracts" + RewardsManager: + proxy: true + init: + controller: "${{Controller.address}}" + calls: + - fn: "setIssuancePerBlock" + issuancePerBlock: "114693500000000000000" # per block increase of total supply, blocks in a year = 365*60*60*24/12 + - fn: "setSubgraphAvailabilityOracle" + subgraphAvailabilityOracle: *availabilityOracle + - fn: "syncAllContracts" + AllocationExchange: + init: + graphToken: "${{GraphToken.address}}" + staking: "${{L1Staking.address}}" + governor: *allocationExchangeOwner + authority: *authority + calls: + - fn: "approveAll" + L1GraphTokenGateway: + proxy: true + init: + controller: "${{Controller.address}}" + calls: + - fn: "syncAllContracts" + - fn: "setPauseGuardian" + pauseGuardian: *pauseGuardian + BridgeEscrow: + proxy: true + init: + controller: "${{Controller.address}}" + calls: + - fn: "syncAllContracts" diff --git a/packages/contracts/config/graph.mainnet.yml b/packages/contracts/config/graph.mainnet.yml new file mode 100644 index 000000000..ff2c9124f --- /dev/null +++ b/packages/contracts/config/graph.mainnet.yml @@ -0,0 +1,161 @@ +general: + arbitrator: &arbitrator "0xE1FDD398329C6b74C14cf19100316f0826a492d3" # Arbitration Council + governor: &governor "0x48301Fe520f72994d32eAd72E2B6A8447873CF50" # Graph Council + authority: &authority "0xF994fB0f5c06B31E364B868886140cC30A7fcF15" # Authority that signs payment vouchers + availabilityOracle: &availabilityOracle "0xE24f399999D47D276Da88FAa7646e2C597822333" # Subgraph Availability Oracle + pauseGuardian: &pauseGuardian "0x8290362Aba20D17c51995085369E001Bad99B21c" # Protocol pause guardian + allocationExchangeOwner: &allocationExchangeOwner "0x74Db79268e63302d3FC69FB5a7627F7454a41732" # Allocation Exchange owner + +contracts: + Controller: + calls: + - fn: "setContractProxy" + id: "0xe6876326c1291dfcbbd3864a6816d698cd591defc7aa2153d7f9c4c04016c89f" # keccak256('Curation') + contractAddress: "${{Curation.address}}" + - fn: "setContractProxy" + id: "0x39605a6c26a173774ca666c67ef70cf491880e5d3d6d0ca66ec0a31034f15ea3" # keccak256('GNS') + contractAddress: "${{L1GNS.address}}" + - fn: "setContractProxy" + id: "0xf942813d07d17b56de9a9afc8de0ced6e8c053bbfdcc87b7badea4ddcf27c307" # keccak256('DisputeManager') + contractAddress: "${{DisputeManager.address}}" + - fn: "setContractProxy" + id: "0xc713c3df6d14cdf946460395d09af88993ee2b948b1a808161494e32c5f67063" # keccak256('EpochManager') + contractAddress: "${{EpochManager.address}}" + - fn: "setContractProxy" + id: "0x966f1e8d8d8014e05f6ec4a57138da9be1f7c5a7f802928a18072f7c53180761" # keccak256('RewardsManager') + contractAddress: "${{RewardsManager.address}}" + - fn: "setContractProxy" + id: "0x1df41cd916959d1163dc8f0671a666ea8a3e434c13e40faef527133b5d167034" # keccak256('Staking') + contractAddress: "${{L1Staking.address}}" + - fn: "setContractProxy" + id: "0x45fc200c7e4544e457d3c5709bfe0d520442c30bbcbdaede89e8d4a4bbc19247" # keccak256('GraphToken') + contractAddress: "${{GraphToken.address}}" + - fn: "setContractProxy" + id: "0xd362cac9cb75c10d67bcc0b7eeb0b1ef48bb5420b556c092d4fd7f758816fcf0" # keccak256('GraphTokenGateway') + contractAddress: "${{L1GraphTokenGateway.address}}" + - fn: "setPauseGuardian" + pauseGuardian: *pauseGuardian + - fn: "transferOwnership" + owner: *governor + GraphProxyAdmin: + calls: + - fn: "transferOwnership" + owner: *governor + ServiceRegistry: + proxy: true + init: + controller: "${{Controller.address}}" + calls: + - fn: "syncAllContracts" + EpochManager: + proxy: true + init: + controller: "${{Controller.address}}" + lengthInBlocks: 6646 # length in hours = lengthInBlocks*13/60/60 (~13 second blocks) + GraphToken: + init: + initialSupply: "10000000000000000000000000000" # in wei + calls: + - fn: "addMinter" + minter: "${{RewardsManager.address}}" + - fn: "addMinter" + minter: "${{L1GraphTokenGateway.address}}" + - fn: "renounceMinter" + - fn: "transferOwnership" + owner: *governor + Curation: + proxy: true + init: + controller: "${{Controller.address}}" + bondingCurve: "${{BancorFormula.address}}" + curationTokenMaster: "${{GraphCurationToken.address}}" + reserveRatio: 500000 # in parts per million + curationTaxPercentage: 10000 # in parts per million + minimumCurationDeposit: "1000000000000000000" # in wei + calls: + - fn: "syncAllContracts" + DisputeManager: + proxy: true + init: + controller: "${{Controller.address}}" + arbitrator: *arbitrator + minimumDeposit: "10000000000000000000000" # in wei + fishermanRewardPercentage: 500000 # in parts per million + idxSlashingPercentage: 25000 # in parts per million + qrySlashingPercentage: 25000 # in parts per million + calls: + - fn: "syncAllContracts" + L1GNS: + proxy: true + init: + controller: "${{Controller.address}}" + subgraphNFT: "${{SubgraphNFT.address}}" + calls: + - fn: "approveAll" + - fn: "syncAllContracts" + SubgraphNFT: + init: + governor: "${{Env.deployer}}" + calls: + - fn: "setTokenDescriptor" + tokenDescriptor: "${{SubgraphNFTDescriptor.address}}" + - fn: "setMinter" + minter: "${{L1GNS.address}}" + - fn: "transferOwnership" + owner: *governor + L1Staking: + proxy: true + init: + controller: "${{Controller.address}}" + minimumIndexerStake: "100000000000000000000000" # in wei + thawingPeriod: 186092 # in blocks + protocolPercentage: 10000 # in parts per million + curationPercentage: 100000 # in parts per million + maxAllocationEpochs: 28 # in epochs + delegationUnbondingPeriod: 28 # in epochs + delegationRatio: 16 # delegated stake to indexer stake multiplier + rebateParameters: + alphaNumerator: 100 # alphaNumerator / alphaDenominator + alphaDenominator: 100 # alphaNumerator / alphaDenominator + lambdaNumerator: 60 # lambdaNumerator / lambdaDenominator + lambdaDenominator: 100 # lambdaNumerator / lambdaDenominator + extensionImpl: "${{StakingExtension.address}}" + calls: + - fn: "setDelegationTaxPercentage" + delegationTaxPercentage: 5000 # parts per million + - fn: "setSlasher" + slasher: "${{DisputeManager.address}}" + allowed: true + - fn: "syncAllContracts" + RewardsManager: + proxy: true + init: + controller: "${{Controller.address}}" + calls: + - fn: "setIssuancePerBlock" + issuancePerBlock: "114693500000000000000" # per block increase of total supply, blocks in a year = 365*60*60*24/12 + - fn: "setSubgraphAvailabilityOracle" + subgraphAvailabilityOracle: *availabilityOracle + - fn: "syncAllContracts" + AllocationExchange: + init: + graphToken: "${{GraphToken.address}}" + staking: "${{L1Staking.address}}" + governor: *allocationExchangeOwner + authority: *authority + calls: + - fn: "approveAll" + L1GraphTokenGateway: + proxy: true + init: + controller: "${{Controller.address}}" + calls: + - fn: "syncAllContracts" + - fn: "setPauseGuardian" + pauseGuardian: *pauseGuardian + BridgeEscrow: + proxy: true + init: + controller: "${{Controller.address}}" + calls: + - fn: "syncAllContracts" diff --git a/packages/contracts/config/graph.sepolia.yml b/packages/contracts/config/graph.sepolia.yml new file mode 100644 index 000000000..d830cd9d9 --- /dev/null +++ b/packages/contracts/config/graph.sepolia.yml @@ -0,0 +1,161 @@ +general: + arbitrator: &arbitrator "0xd6ff9e98F0Fd99ccB658832F586e23F4D8Cb8Bad" # Arbitration Council + governor: &governor "0x4EBf30832eC2db76aE228D5d239083B59f530d1f" # Graph Council + authority: &authority "0x840daec5dF962D49cf2EFd789c4E40A7b7e0117D" # Authority that signs payment vouchers + availabilityOracle: &availabilityOracle "0x840daec5dF962D49cf2EFd789c4E40A7b7e0117D" # Subgraph Availability Oracle + pauseGuardian: &pauseGuardian "0x382688E15Cc894D04cf3313b26a4F2c93C8fDe06" # Protocol pause guardian + allocationExchangeOwner: &allocationExchangeOwner "0x4EBf30832eC2db76aE228D5d239083B59f530d1f" # Allocation Exchange owner + +contracts: + Controller: + calls: + - fn: "setContractProxy" + id: "0xe6876326c1291dfcbbd3864a6816d698cd591defc7aa2153d7f9c4c04016c89f" # keccak256('Curation') + contractAddress: "${{Curation.address}}" + - fn: "setContractProxy" + id: "0x39605a6c26a173774ca666c67ef70cf491880e5d3d6d0ca66ec0a31034f15ea3" # keccak256('GNS') + contractAddress: "${{L1GNS.address}}" + - fn: "setContractProxy" + id: "0xf942813d07d17b56de9a9afc8de0ced6e8c053bbfdcc87b7badea4ddcf27c307" # keccak256('DisputeManager') + contractAddress: "${{DisputeManager.address}}" + - fn: "setContractProxy" + id: "0xc713c3df6d14cdf946460395d09af88993ee2b948b1a808161494e32c5f67063" # keccak256('EpochManager') + contractAddress: "${{EpochManager.address}}" + - fn: "setContractProxy" + id: "0x966f1e8d8d8014e05f6ec4a57138da9be1f7c5a7f802928a18072f7c53180761" # keccak256('RewardsManager') + contractAddress: "${{RewardsManager.address}}" + - fn: "setContractProxy" + id: "0x1df41cd916959d1163dc8f0671a666ea8a3e434c13e40faef527133b5d167034" # keccak256('Staking') + contractAddress: "${{L1Staking.address}}" + - fn: "setContractProxy" + id: "0x45fc200c7e4544e457d3c5709bfe0d520442c30bbcbdaede89e8d4a4bbc19247" # keccak256('GraphToken') + contractAddress: "${{GraphToken.address}}" + - fn: "setContractProxy" + id: "0xd362cac9cb75c10d67bcc0b7eeb0b1ef48bb5420b556c092d4fd7f758816fcf0" # keccak256('GraphTokenGateway') + contractAddress: "${{L1GraphTokenGateway.address}}" + - fn: "setPauseGuardian" + pauseGuardian: *pauseGuardian + - fn: "transferOwnership" + owner: *governor + GraphProxyAdmin: + calls: + - fn: "transferOwnership" + owner: *governor + ServiceRegistry: + proxy: true + init: + controller: "${{Controller.address}}" + calls: + - fn: "syncAllContracts" + EpochManager: + proxy: true + init: + controller: "${{Controller.address}}" + lengthInBlocks: 554 # length in hours = lengthInBlocks*13/60/60 (~13 second blocks) + GraphToken: + init: + initialSupply: "10000000000000000000000000000" # in wei + calls: + - fn: "addMinter" + minter: "${{RewardsManager.address}}" + - fn: "addMinter" + minter: "${{L1GraphTokenGateway.address}}" + - fn: "renounceMinter" + - fn: "transferOwnership" + owner: *governor + Curation: + proxy: true + init: + controller: "${{Controller.address}}" + bondingCurve: "${{BancorFormula.address}}" + curationTokenMaster: "${{GraphCurationToken.address}}" + reserveRatio: 500000 # in parts per million + curationTaxPercentage: 10000 # in parts per million + minimumCurationDeposit: "1000000000000000000" # in wei + calls: + - fn: "syncAllContracts" + DisputeManager: + proxy: true + init: + controller: "${{Controller.address}}" + arbitrator: *arbitrator + minimumDeposit: "10000000000000000000000" # in wei + fishermanRewardPercentage: 500000 # in parts per million + idxSlashingPercentage: 25000 # in parts per million + qrySlashingPercentage: 25000 # in parts per million + calls: + - fn: "syncAllContracts" + L1GNS: + proxy: true + init: + controller: "${{Controller.address}}" + subgraphNFT: "${{SubgraphNFT.address}}" + calls: + - fn: "approveAll" + - fn: "syncAllContracts" + SubgraphNFT: + init: + governor: "${{Env.deployer}}" + calls: + - fn: "setTokenDescriptor" + tokenDescriptor: "${{SubgraphNFTDescriptor.address}}" + - fn: "setMinter" + minter: "${{L1GNS.address}}" + - fn: "transferOwnership" + owner: *governor + L1Staking: + proxy: true + init: + controller: "${{Controller.address}}" + minimumIndexerStake: "100000000000000000000000" # in wei + thawingPeriod: 6646 # in blocks + protocolPercentage: 10000 # in parts per million + curationPercentage: 100000 # in parts per million + maxAllocationEpochs: 4 # in epochs + delegationUnbondingPeriod: 12 # in epochs + delegationRatio: 16 # delegated stake to indexer stake multiplier + rebateParameters: + alphaNumerator: 100 # alphaNumerator / alphaDenominator + alphaDenominator: 100 # alphaNumerator / alphaDenominator + lambdaNumerator: 60 # lambdaNumerator / lambdaDenominator + lambdaDenominator: 100 # lambdaNumerator / lambdaDenominator + extensionImpl: "${{StakingExtension.address}}" + calls: + - fn: "setDelegationTaxPercentage" + delegationTaxPercentage: 5000 # parts per million + - fn: "setSlasher" + slasher: "${{DisputeManager.address}}" + allowed: true + - fn: "syncAllContracts" + RewardsManager: + proxy: true + init: + controller: "${{Controller.address}}" + calls: + - fn: "setIssuancePerBlock" + issuancePerBlock: "114693500000000000000" # per block increase of total supply, blocks in a year = 365*60*60*24/12 + - fn: "setSubgraphAvailabilityOracle" + subgraphAvailabilityOracle: *availabilityOracle + - fn: "syncAllContracts" + AllocationExchange: + init: + graphToken: "${{GraphToken.address}}" + staking: "${{L1Staking.address}}" + governor: *allocationExchangeOwner + authority: *authority + calls: + - fn: "approveAll" + L1GraphTokenGateway: + proxy: true + init: + controller: "${{Controller.address}}" + calls: + - fn: "syncAllContracts" + - fn: "setPauseGuardian" + pauseGuardian: *pauseGuardian + BridgeEscrow: + proxy: true + init: + controller: "${{Controller.address}}" + calls: + - fn: "syncAllContracts" diff --git a/.gitattributes b/packages/contracts/contracts/.gitattributes similarity index 100% rename from .gitattributes rename to packages/contracts/contracts/.gitattributes diff --git a/packages/contracts/contracts/arbitrum/AddressAliasHelper.sol b/packages/contracts/contracts/arbitrum/AddressAliasHelper.sol new file mode 100644 index 000000000..740b70361 --- /dev/null +++ b/packages/contracts/contracts/arbitrum/AddressAliasHelper.sol @@ -0,0 +1,46 @@ +// SPDX-License-Identifier: Apache-2.0 + +/* + * Copyright 2019-2021, Offchain Labs, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Originally copied from: + * https://github.com/OffchainLabs/arbitrum/tree/84e64dee6ee82adbf8ec34fd4b86c207a61d9007/packages/arb-bridge-eth + * + * MODIFIED from Offchain Labs' implementation: + * - Changed solidity version to 0.7.6 (pablo@edgeandnode.com) + * + */ + +pragma solidity ^0.7.6; + +library AddressAliasHelper { + uint160 constant offset = uint160(0x1111000000000000000000000000000000001111); + + /// @notice Utility function that converts the address in the L1 that submitted a tx to + /// the inbox to the msg.sender viewed in the L2 + /// @param l1Address the address in the L1 that triggered the tx to L2 + /// @return l2Address L2 address as viewed in msg.sender + function applyL1ToL2Alias(address l1Address) internal pure returns (address l2Address) { + l2Address = address(uint160(l1Address) + offset); + } + + /// @notice Utility function that converts the msg.sender viewed in the L2 to the + /// address in the L1 that submitted a tx to the inbox + /// @param l2Address L2 address as viewed in msg.sender + /// @return l1Address the address in the L1 that triggered the tx to L2 + function undoL1ToL2Alias(address l2Address) internal pure returns (address l1Address) { + l1Address = address(uint160(l2Address) - offset); + } +} diff --git a/packages/contracts/contracts/arbitrum/Arbitrum.md b/packages/contracts/contracts/arbitrum/Arbitrum.md new file mode 100644 index 000000000..abc87553e --- /dev/null +++ b/packages/contracts/contracts/arbitrum/Arbitrum.md @@ -0,0 +1,5 @@ +# Arbitrum contracts + +These contracts have been copied from the [Arbitrum repo](https://github.com/OffchainLabs/arbitrum). + +They are also available as part of the npm packages [arb-bridge-eth](https://www.npmjs.com/package/arb-bridge-eth) and [arb-bridge-peripherals](https://www.npmjs.com/package/arb-bridge-peripherals). The reason for copying them rather than installing those packages is the contracts only support Solidity `^0.6.11`, so we had to change the version to `^0.7.6` for it to be compatible with our other contracts. diff --git a/packages/contracts/contracts/arbitrum/IArbToken.sol b/packages/contracts/contracts/arbitrum/IArbToken.sol new file mode 100644 index 000000000..d7d5a2d8c --- /dev/null +++ b/packages/contracts/contracts/arbitrum/IArbToken.sol @@ -0,0 +1,47 @@ +// SPDX-License-Identifier: Apache-2.0 + +/* + * Copyright 2020, Offchain Labs, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Originally copied from: + * https://github.com/OffchainLabs/arbitrum/tree/e3a6307ad8a2dc2cad35728a2a9908cfd8dd8ef9/packages/arb-bridge-peripherals + * + * MODIFIED from Offchain Labs' implementation: + * - Changed solidity version to 0.7.6 (pablo@edgeandnode.com) + * + */ + +/** + * @title Minimum expected interface for L2 token that interacts with the L2 token bridge (this is the interface necessary + * for a custom token that interacts with the bridge, see TestArbCustomToken.sol for an example implementation). + */ +pragma solidity ^0.7.6; + +interface IArbToken { + /** + * @notice should increase token supply by amount, and should (probably) only be callable by the L1 bridge. + */ + function bridgeMint(address account, uint256 amount) external; + + /** + * @notice should decrease token supply by amount, and should (probably) only be callable by the L1 bridge. + */ + function bridgeBurn(address account, uint256 amount) external; + + /** + * @return address of layer 1 token + */ + function l1Address() external view returns (address); +} diff --git a/packages/contracts/contracts/arbitrum/IBridge.sol b/packages/contracts/contracts/arbitrum/IBridge.sol new file mode 100644 index 000000000..536ee075b --- /dev/null +++ b/packages/contracts/contracts/arbitrum/IBridge.sol @@ -0,0 +1,72 @@ +// SPDX-License-Identifier: Apache-2.0 + +/* + * Copyright 2021, Offchain Labs, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Originally copied from: + * https://github.com/OffchainLabs/arbitrum/tree/e3a6307ad8a2dc2cad35728a2a9908cfd8dd8ef9/packages/arb-bridge-eth + * + * MODIFIED from Offchain Labs' implementation: + * - Changed solidity version to 0.7.6 (pablo@edgeandnode.com) + * + */ + +pragma solidity ^0.7.6; + +interface IBridge { + event MessageDelivered( + uint256 indexed messageIndex, + bytes32 indexed beforeInboxAcc, + address inbox, + uint8 kind, + address sender, + bytes32 messageDataHash + ); + + event BridgeCallTriggered(address indexed outbox, address indexed destAddr, uint256 amount, bytes data); + + event InboxToggle(address indexed inbox, bool enabled); + + event OutboxToggle(address indexed outbox, bool enabled); + + function deliverMessageToInbox( + uint8 kind, + address sender, + bytes32 messageDataHash + ) external payable returns (uint256); + + function executeCall( + address destAddr, + uint256 amount, + bytes calldata data + ) external returns (bool success, bytes memory returnData); + + // These are only callable by the admin + function setInbox(address inbox, bool enabled) external; + + function setOutbox(address inbox, bool enabled) external; + + // View functions + + function activeOutbox() external view returns (address); + + function allowedInboxes(address inbox) external view returns (bool); + + function allowedOutboxes(address outbox) external view returns (bool); + + function inboxAccs(uint256 index) external view returns (bytes32); + + function messageCount() external view returns (uint256); +} diff --git a/packages/contracts/contracts/arbitrum/IInbox.sol b/packages/contracts/contracts/arbitrum/IInbox.sol new file mode 100644 index 000000000..a9315bbf8 --- /dev/null +++ b/packages/contracts/contracts/arbitrum/IInbox.sol @@ -0,0 +1,88 @@ +// SPDX-License-Identifier: Apache-2.0 + +/* + * Copyright 2021, Offchain Labs, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Originally copied from: + * https://github.com/OffchainLabs/arbitrum/tree/e3a6307ad8a2dc2cad35728a2a9908cfd8dd8ef9/packages/arb-bridge-eth + * + * MODIFIED from Offchain Labs' implementation: + * - Changed solidity version to 0.7.6 (pablo@edgeandnode.com) + * + */ + +pragma solidity ^0.7.6; + +import "./IBridge.sol"; +import "./IMessageProvider.sol"; + +interface IInbox is IMessageProvider { + function sendL2Message(bytes calldata messageData) external returns (uint256); + + function sendUnsignedTransaction( + uint256 maxGas, + uint256 gasPriceBid, + uint256 nonce, + address destAddr, + uint256 amount, + bytes calldata data + ) external returns (uint256); + + function sendContractTransaction( + uint256 maxGas, + uint256 gasPriceBid, + address destAddr, + uint256 amount, + bytes calldata data + ) external returns (uint256); + + function sendL1FundedUnsignedTransaction( + uint256 maxGas, + uint256 gasPriceBid, + uint256 nonce, + address destAddr, + bytes calldata data + ) external payable returns (uint256); + + function sendL1FundedContractTransaction( + uint256 maxGas, + uint256 gasPriceBid, + address destAddr, + bytes calldata data + ) external payable returns (uint256); + + function createRetryableTicket( + address destAddr, + uint256 arbTxCallValue, + uint256 maxSubmissionCost, + address submissionRefundAddress, + address valueRefundAddress, + uint256 maxGas, + uint256 gasPriceBid, + bytes calldata data + ) external payable returns (uint256); + + function depositEth(uint256 maxSubmissionCost) external payable returns (uint256); + + function bridge() external view returns (IBridge); + + function pauseCreateRetryables() external; + + function unpauseCreateRetryables() external; + + function startRewriteAddress() external; + + function stopRewriteAddress() external; +} diff --git a/packages/contracts/contracts/arbitrum/IMessageProvider.sol b/packages/contracts/contracts/arbitrum/IMessageProvider.sol new file mode 100644 index 000000000..8fbfdb171 --- /dev/null +++ b/packages/contracts/contracts/arbitrum/IMessageProvider.sol @@ -0,0 +1,32 @@ +// SPDX-License-Identifier: Apache-2.0 + +/* + * Copyright 2021, Offchain Labs, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Originally copied from: + * https://github.com/OffchainLabs/arbitrum/tree/e3a6307ad8a2dc2cad35728a2a9908cfd8dd8ef9/packages/arb-bridge-eth + * + * MODIFIED from Offchain Labs' implementation: + * - Changed solidity version to 0.7.6 (pablo@edgeandnode.com) + * + */ + +pragma solidity ^0.7.6; + +interface IMessageProvider { + event InboxMessageDelivered(uint256 indexed messageNum, bytes data); + + event InboxMessageDeliveredFromOrigin(uint256 indexed messageNum); +} diff --git a/packages/contracts/contracts/arbitrum/IOutbox.sol b/packages/contracts/contracts/arbitrum/IOutbox.sol new file mode 100644 index 000000000..2e4f05bd5 --- /dev/null +++ b/packages/contracts/contracts/arbitrum/IOutbox.sol @@ -0,0 +1,57 @@ +// SPDX-License-Identifier: Apache-2.0 + +/* + * Copyright 2021, Offchain Labs, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Originally copied from: + * https://github.com/OffchainLabs/arbitrum/tree/e3a6307ad8a2dc2cad35728a2a9908cfd8dd8ef9/packages/arb-bridge-eth + * + * MODIFIED from Offchain Labs' implementation: + * - Changed solidity version to 0.7.6 (pablo@edgeandnode.com) + * + */ + +pragma solidity ^0.7.6; + +interface IOutbox { + event OutboxEntryCreated( + uint256 indexed batchNum, + uint256 outboxEntryIndex, + bytes32 outputRoot, + uint256 numInBatch + ); + event OutBoxTransactionExecuted( + address indexed destAddr, + address indexed l2Sender, + uint256 indexed outboxEntryIndex, + uint256 transactionIndex + ); + + function l2ToL1Sender() external view returns (address); + + function l2ToL1Block() external view returns (uint256); + + function l2ToL1EthBlock() external view returns (uint256); + + function l2ToL1Timestamp() external view returns (uint256); + + function l2ToL1BatchNum() external view returns (uint256); + + function l2ToL1OutputId() external view returns (bytes32); + + function processOutgoingMessages(bytes calldata sendsData, uint256[] calldata sendLengths) external; + + function outboxEntryExists(uint256 batchNum) external view returns (bool); +} diff --git a/packages/contracts/contracts/arbitrum/ITokenGateway.sol b/packages/contracts/contracts/arbitrum/ITokenGateway.sol new file mode 100644 index 000000000..3b12e578e --- /dev/null +++ b/packages/contracts/contracts/arbitrum/ITokenGateway.sol @@ -0,0 +1,74 @@ +// SPDX-License-Identifier: Apache-2.0 + +/* + * Copyright 2020, Offchain Labs, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Originally copied from: + * https://github.com/OffchainLabs/arbitrum/tree/e3a6307ad8a2dc2cad35728a2a9908cfd8dd8ef9/packages/arb-bridge-peripherals + * + * MODIFIED from Offchain Labs' implementation: + * - Changed solidity version to 0.7.6 (pablo@edgeandnode.com) + * + */ + +pragma solidity ^0.7.6 || 0.8.27; + +interface ITokenGateway { + /// @notice event deprecated in favor of DepositInitiated and WithdrawalInitiated + // event OutboundTransferInitiated( + // address token, + // address indexed _from, + // address indexed _to, + // uint256 indexed _transferId, + // uint256 _amount, + // bytes _data + // ); + + /// @notice event deprecated in favor of DepositFinalized and WithdrawalFinalized + // event InboundTransferFinalized( + // address token, + // address indexed _from, + // address indexed _to, + // uint256 indexed _transferId, + // uint256 _amount, + // bytes _data + // ); + + function outboundTransfer( + address token, + address to, + uint256 amunt, + uint256 maxas, + uint256 gasPiceBid, + bytes calldata data + ) external payable returns (bytes memory); + + function finalizeInboundTransfer( + address token, + address from, + address to, + uint256 amount, + bytes calldata data + ) external payable; + + /** + * @notice Calculate the address used when bridging an ERC20 token + * @dev the L1 and L2 address oracles may not always be in sync. + * For example, a custom token may have been registered but not deployed or the contract self destructed. + * @param l1ERC20 address of L1 token + * @return L2 address of a bridged ERC20 token + */ + function calculateL2TokenAddress(address l1ERC20) external view returns (address); +} diff --git a/packages/contracts/contracts/arbitrum/L1ArbitrumMessenger.sol b/packages/contracts/contracts/arbitrum/L1ArbitrumMessenger.sol new file mode 100644 index 000000000..839e1930b --- /dev/null +++ b/packages/contracts/contracts/arbitrum/L1ArbitrumMessenger.sol @@ -0,0 +1,103 @@ +// SPDX-License-Identifier: Apache-2.0 + +/* + * Copyright 2020, Offchain Labs, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Originally copied from: + * https://github.com/OffchainLabs/arbitrum/tree/e3a6307ad8a2dc2cad35728a2a9908cfd8dd8ef9/packages/arb-bridge-peripherals + * + * MODIFIED from Offchain Labs' implementation: + * - Changed solidity version to 0.7.6 (pablo@edgeandnode.com) + * + */ + +pragma solidity ^0.7.6; + +import "./IInbox.sol"; +import "./IOutbox.sol"; + +/// @notice L1 utility contract to assist with L1 <=> L2 interactions +/// @dev this is an abstract contract instead of library so the functions can be easily overridden when testing +abstract contract L1ArbitrumMessenger { + event TxToL2(address indexed _from, address indexed _to, uint256 indexed _seqNum, bytes _data); + + struct L2GasParams { + uint256 _maxSubmissionCost; + uint256 _maxGas; + uint256 _gasPriceBid; + } + + function sendTxToL2( + address _inbox, + address _to, + address _user, + uint256 _l1CallValue, + uint256 _l2CallValue, + L2GasParams memory _l2GasParams, + bytes memory _data + ) internal virtual returns (uint256) { + // alternative function entry point when struggling with the stack size + return + sendTxToL2( + _inbox, + _to, + _user, + _l1CallValue, + _l2CallValue, + _l2GasParams._maxSubmissionCost, + _l2GasParams._maxGas, + _l2GasParams._gasPriceBid, + _data + ); + } + + function sendTxToL2( + address _inbox, + address _to, + address _user, + uint256 _l1CallValue, + uint256 _l2CallValue, + uint256 _maxSubmissionCost, + uint256 _maxGas, + uint256 _gasPriceBid, + bytes memory _data + ) internal virtual returns (uint256) { + uint256 seqNum = IInbox(_inbox).createRetryableTicket{ value: _l1CallValue }( + _to, + _l2CallValue, + _maxSubmissionCost, + _user, + _user, + _maxGas, + _gasPriceBid, + _data + ); + emit TxToL2(_user, _to, seqNum, _data); + return seqNum; + } + + function getBridge(address _inbox) internal view virtual returns (IBridge) { + return IInbox(_inbox).bridge(); + } + + /// @dev the l2ToL1Sender behaves as the tx.origin, the msg.sender should be validated to protect against reentrancies + function getL2ToL1Sender(address _inbox) internal view virtual returns (address) { + IOutbox outbox = IOutbox(getBridge(_inbox).activeOutbox()); + address l2ToL1Sender = outbox.l2ToL1Sender(); + + require(l2ToL1Sender != address(0), "NO_SENDER"); + return l2ToL1Sender; + } +} diff --git a/packages/contracts/contracts/arbitrum/L2ArbitrumMessenger.sol b/packages/contracts/contracts/arbitrum/L2ArbitrumMessenger.sol new file mode 100644 index 000000000..e34a29262 --- /dev/null +++ b/packages/contracts/contracts/arbitrum/L2ArbitrumMessenger.sol @@ -0,0 +1,47 @@ +// SPDX-License-Identifier: Apache-2.0 + +/* + * Copyright 2020, Offchain Labs, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Originally copied from: + * https://github.com/OffchainLabs/arbitrum/tree/e3a6307ad8a2dc2cad35728a2a9908cfd8dd8ef9/packages/arb-bridge-peripherals + * + * MODIFIED from Offchain Labs' implementation: + * - Changed solidity version to 0.7.6 (pablo@edgeandnode.com) + * + */ + +pragma solidity ^0.7.6; + +import "arbos-precompiles/arbos/builtin/ArbSys.sol"; + +/// @notice L2 utility contract to assist with L1 <=> L2 interactions +/// @dev this is an abstract contract instead of library so the functions can be easily overridden when testing +abstract contract L2ArbitrumMessenger { + address internal constant ARB_SYS_ADDRESS = address(100); + + event TxToL1(address indexed _from, address indexed _to, uint256 indexed _id, bytes _data); + + function sendTxToL1( + uint256 _l1CallValue, + address _from, + address _to, + bytes memory _data + ) internal virtual returns (uint256) { + uint256 _id = ArbSys(ARB_SYS_ADDRESS).sendTxToL1{ value: _l1CallValue }(_to, _data); + emit TxToL1(_from, _to, _id, _data); + return _id; + } +} diff --git a/packages/contracts/contracts/arbitrum/README.md b/packages/contracts/contracts/arbitrum/README.md new file mode 100644 index 000000000..abc87553e --- /dev/null +++ b/packages/contracts/contracts/arbitrum/README.md @@ -0,0 +1,5 @@ +# Arbitrum contracts + +These contracts have been copied from the [Arbitrum repo](https://github.com/OffchainLabs/arbitrum). + +They are also available as part of the npm packages [arb-bridge-eth](https://www.npmjs.com/package/arb-bridge-eth) and [arb-bridge-peripherals](https://www.npmjs.com/package/arb-bridge-peripherals). The reason for copying them rather than installing those packages is the contracts only support Solidity `^0.6.11`, so we had to change the version to `^0.7.6` for it to be compatible with our other contracts. diff --git a/contracts/bancor/BancorFormula.sol b/packages/contracts/contracts/bancor/BancorFormula.sol similarity index 95% rename from contracts/bancor/BancorFormula.sol rename to packages/contracts/contracts/bancor/BancorFormula.sol index e325b40a0..689eebaba 100644 --- a/contracts/bancor/BancorFormula.sol +++ b/packages/contracts/contracts/bancor/BancorFormula.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: Apache-2.0 -pragma solidity ^0.7.3; +pragma solidity ^0.7.6; import "@openzeppelin/contracts/math/SafeMath.sol"; @@ -324,9 +324,7 @@ contract BancorFormula { uint256 _amount ) public view returns (uint256) { // validate input - require( - _supply > 0 && _reserveBalance > 0 && _totalRatio > 1 && _totalRatio <= MAX_RATIO * 2 - ); + require(_supply > 0 && _reserveBalance > 0 && _totalRatio > 1 && _totalRatio <= MAX_RATIO * 2); // special case for 0 amount if (_amount == 0) return 0; @@ -364,11 +362,7 @@ contract BancorFormula { ) public view returns (uint256) { // validate input require( - _supply > 0 && - _reserveBalance > 0 && - _totalRatio > 1 && - _totalRatio <= MAX_RATIO * 2 && - _amount <= _supply + _supply > 0 && _reserveBalance > 0 && _totalRatio > 1 && _totalRatio <= MAX_RATIO * 2 && _amount <= _supply ); // special case for 0 amount @@ -407,12 +401,7 @@ contract BancorFormula { * This functions assumes that "_expN < 2 ^ 256 / log(MAX_NUM - 1)", otherwise the multiplication should be replaced with a "safeMul". * Since we rely on unsigned-integer arithmetic and "base < 1" ==> "log(base) < 0", this function does not support "_baseN < _baseD". */ - function power( - uint256 _baseN, - uint256 _baseD, - uint32 _expN, - uint32 _expD - ) internal view returns (uint256, uint8) { + function power(uint256 _baseN, uint256 _baseD, uint32 _expN, uint32 _expD) internal view returns (uint256, uint8) { require(_baseN < MAX_NUM); uint256 baseLog; @@ -428,10 +417,7 @@ contract BancorFormula { return (optimalExp(baseLogTimesExp), MAX_PRECISION); } else { uint8 precision = findPositionInMaxExpArray(baseLogTimesExp); - return ( - generalExp(baseLogTimesExp >> (MAX_PRECISION - precision), precision), - precision - ); + return (generalExp(baseLogTimesExp >> (MAX_PRECISION - precision), precision), precision); } } @@ -642,37 +628,21 @@ contract BancorFormula { z = y = x - FIXED_1; w = (y * y) / FIXED_1; - res += - (z * (0x100000000000000000000000000000000 - y)) / - 0x100000000000000000000000000000000; + res += (z * (0x100000000000000000000000000000000 - y)) / 0x100000000000000000000000000000000; z = (z * w) / FIXED_1; // add y^01 / 01 - y^02 / 02 - res += - (z * (0x0aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - y)) / - 0x200000000000000000000000000000000; + res += (z * (0x0aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - y)) / 0x200000000000000000000000000000000; z = (z * w) / FIXED_1; // add y^03 / 03 - y^04 / 04 - res += - (z * (0x099999999999999999999999999999999 - y)) / - 0x300000000000000000000000000000000; + res += (z * (0x099999999999999999999999999999999 - y)) / 0x300000000000000000000000000000000; z = (z * w) / FIXED_1; // add y^05 / 05 - y^06 / 06 - res += - (z * (0x092492492492492492492492492492492 - y)) / - 0x400000000000000000000000000000000; + res += (z * (0x092492492492492492492492492492492 - y)) / 0x400000000000000000000000000000000; z = (z * w) / FIXED_1; // add y^07 / 07 - y^08 / 08 - res += - (z * (0x08e38e38e38e38e38e38e38e38e38e38e - y)) / - 0x500000000000000000000000000000000; + res += (z * (0x08e38e38e38e38e38e38e38e38e38e38e - y)) / 0x500000000000000000000000000000000; z = (z * w) / FIXED_1; // add y^09 / 09 - y^10 / 10 - res += - (z * (0x08ba2e8ba2e8ba2e8ba2e8ba2e8ba2e8b - y)) / - 0x600000000000000000000000000000000; + res += (z * (0x08ba2e8ba2e8ba2e8ba2e8ba2e8ba2e8b - y)) / 0x600000000000000000000000000000000; z = (z * w) / FIXED_1; // add y^11 / 11 - y^12 / 12 - res += - (z * (0x089d89d89d89d89d89d89d89d89d89d89 - y)) / - 0x700000000000000000000000000000000; + res += (z * (0x089d89d89d89d89d89d89d89d89d89d89 - y)) / 0x700000000000000000000000000000000; z = (z * w) / FIXED_1; // add y^13 / 13 - y^14 / 14 - res += - (z * (0x088888888888888888888888888888888 - y)) / - 0x800000000000000000000000000000000; // add y^15 / 15 - y^16 / 16 + res += (z * (0x088888888888888888888888888888888 - y)) / 0x800000000000000000000000000000000; // add y^15 / 15 - y^16 / 16 return res; } diff --git a/packages/contracts/contracts/base/IMulticall.sol b/packages/contracts/contracts/base/IMulticall.sol new file mode 100644 index 000000000..10f7fa469 --- /dev/null +++ b/packages/contracts/contracts/base/IMulticall.sol @@ -0,0 +1,17 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.7.6 || 0.8.27; +pragma abicoder v2; + +/** + * @title Multicall interface + * @notice Enables calling multiple methods in a single call to the contract + */ +interface IMulticall { + /** + * @notice Call multiple functions in the current contract and return the data from all of them if they all succeed + * @param data The encoded function data for each of the calls to make to this contract + * @return results The results from each of the calls passed in via data + */ + function multicall(bytes[] calldata data) external returns (bytes[] memory results); +} diff --git a/packages/contracts/contracts/base/Multicall.sol b/packages/contracts/contracts/base/Multicall.sol new file mode 100644 index 000000000..49111840d --- /dev/null +++ b/packages/contracts/contracts/base/Multicall.sol @@ -0,0 +1,34 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.7.6; +pragma abicoder v2; + +import "./IMulticall.sol"; + +// Inspired by https://github.com/Uniswap/uniswap-v3-periphery/blob/main/contracts/base/Multicall.sol +// Note: Removed payable from the multicall + +/** + * @title Multicall + * @notice Enables calling multiple methods in a single call to the contract + */ +abstract contract Multicall is IMulticall { + /// @inheritdoc IMulticall + function multicall(bytes[] calldata data) external override returns (bytes[] memory results) { + results = new bytes[](data.length); + for (uint256 i = 0; i < data.length; i++) { + (bool success, bytes memory result) = address(this).delegatecall(data[i]); + + if (!success) { + // Next 5 lines from https://ethereum.stackexchange.com/a/83577 + if (result.length < 68) revert(); + assembly { + result := add(result, 0x04) + } + revert(abi.decode(result, (string))); + } + + results[i] = result; + } + } +} diff --git a/packages/contracts/contracts/curation/Curation.sol b/packages/contracts/contracts/curation/Curation.sol new file mode 100644 index 000000000..e289d048c --- /dev/null +++ b/packages/contracts/contracts/curation/Curation.sol @@ -0,0 +1,429 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.7.6; +pragma abicoder v2; + +import { AddressUpgradeable } from "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol"; +import { SafeMathUpgradeable } from "@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol"; +import { ClonesUpgradeable } from "@openzeppelin/contracts-upgradeable/proxy/ClonesUpgradeable.sol"; + +import { BancorFormula } from "../bancor/BancorFormula.sol"; +import { GraphUpgradeable } from "../upgrades/GraphUpgradeable.sol"; +import { TokenUtils } from "../utils/TokenUtils.sol"; +import { IRewardsManager } from "../rewards/IRewardsManager.sol"; +import { Managed } from "../governance/Managed.sol"; +import { IGraphToken } from "../token/IGraphToken.sol"; +import { CurationV2Storage } from "./CurationStorage.sol"; +import { ICuration } from "./ICuration.sol"; +import { IGraphCurationToken } from "./IGraphCurationToken.sol"; + +/** + * @title Curation contract + * @dev Allows curators to signal on subgraph deployments that might be relevant to indexers by + * staking Graph Tokens (GRT). Additionally, curators earn fees from the Query Market related to the + * subgraph deployment they curate. + * A curators deposit goes to a curation pool along with the deposits of other curators, + * only one such pool exists for each subgraph deployment. + * The contract mints Graph Curation Shares (GCS) according to a bonding curve for each individual + * curation pool where GRT is deposited. + * Holders can burn GCS using this contract to get GRT tokens back according to the + * bonding curve. + */ +contract Curation is CurationV2Storage, GraphUpgradeable { + using SafeMathUpgradeable for uint256; + + /// @dev 100% in parts per million + uint32 private constant MAX_PPM = 1000000; + + /// @dev Amount of signal you get with your minimum token deposit + uint256 private constant SIGNAL_PER_MINIMUM_DEPOSIT = 1e18; // 1 signal as 18 decimal number + + // -- Events -- + + /** + * @dev Emitted when `curator` deposited `tokens` on `subgraphDeploymentID` as curation signal. + * The `curator` receives `signal` amount according to the curation pool bonding curve. + * An amount of `curationTax` will be collected and burned. + */ + event Signalled( + address indexed curator, + bytes32 indexed subgraphDeploymentID, + uint256 tokens, + uint256 signal, + uint256 curationTax + ); + + /** + * @dev Emitted when `curator` burned `signal` for a `subgraphDeploymentID`. + * The curator will receive `tokens` according to the value of the bonding curve. + */ + event Burned(address indexed curator, bytes32 indexed subgraphDeploymentID, uint256 tokens, uint256 signal); + + /** + * @dev Emitted when `tokens` amount were collected for `subgraphDeploymentID` as part of fees + * distributed by an indexer from query fees received from state channels. + */ + event Collected(bytes32 indexed subgraphDeploymentID, uint256 tokens); + + /** + * @notice Initialize this contract. + * @param _controller Address of the controller contract that manages this contract + * @param _bondingCurve Address of the bonding curve contract (e.g. a BancorFormula) + * @param _curationTokenMaster Address of the master copy to use for curation tokens + * @param _defaultReserveRatio Default reserve ratio for a curation pool in PPM + * @param _curationTaxPercentage Percentage of curation tax to charge when depositing GRT tokens + * @param _minimumCurationDeposit Minimum amount of tokens that can be deposited on a new subgraph deployment + */ + function initialize( + address _controller, + address _bondingCurve, + address _curationTokenMaster, + uint32 _defaultReserveRatio, + uint32 _curationTaxPercentage, + uint256 _minimumCurationDeposit + ) external onlyImpl initializer { + Managed._initialize(_controller); + + require(_bondingCurve != address(0), "Bonding curve must be set"); + bondingCurve = _bondingCurve; + + // Settings + _setDefaultReserveRatio(_defaultReserveRatio); + _setCurationTaxPercentage(_curationTaxPercentage); + _setMinimumCurationDeposit(_minimumCurationDeposit); + _setCurationTokenMaster(_curationTokenMaster); + } + + /** + * @dev Set the default reserve ratio percentage for a curation pool. + * @notice Update the default reserve ratio to `_defaultReserveRatio` + * @param _defaultReserveRatio Reserve ratio (in PPM) + */ + function setDefaultReserveRatio(uint32 _defaultReserveRatio) external override onlyGovernor { + _setDefaultReserveRatio(_defaultReserveRatio); + } + + /** + * @dev Set the minimum deposit amount for curators. + * @notice Update the minimum deposit amount to `_minimumCurationDeposit` + * @param _minimumCurationDeposit Minimum amount of tokens required deposit + */ + function setMinimumCurationDeposit(uint256 _minimumCurationDeposit) external override onlyGovernor { + _setMinimumCurationDeposit(_minimumCurationDeposit); + } + + /** + * @notice Set the curation tax percentage to charge when a curator deposits GRT tokens. + * @param _percentage Curation tax percentage charged when depositing GRT tokens + */ + function setCurationTaxPercentage(uint32 _percentage) external override onlyGovernor { + _setCurationTaxPercentage(_percentage); + } + + /** + * @notice Set the master copy to use as clones for the curation token. + * @param _curationTokenMaster Address of implementation contract to use for curation tokens + */ + function setCurationTokenMaster(address _curationTokenMaster) external override onlyGovernor { + _setCurationTokenMaster(_curationTokenMaster); + } + + /** + * @notice Assign Graph Tokens collected as curation fees to the curation pool reserve. + * @dev This function can only be called by the Staking contract and will do the bookkeeping of + * transferred tokens into this contract. + * @param _subgraphDeploymentID SubgraphDeployment where funds should be allocated as reserves + * @param _tokens Amount of Graph Tokens to add to reserves + */ + function collect(bytes32 _subgraphDeploymentID, uint256 _tokens) external override { + // Only Staking contract is authorized as caller + require(msg.sender == address(staking()), "Caller must be the staking contract"); + + // Must be curated to accept tokens + require(isCurated(_subgraphDeploymentID), "Subgraph deployment must be curated to collect fees"); + + // Collect new funds into reserve + CurationPool storage curationPool = pools[_subgraphDeploymentID]; + curationPool.tokens = curationPool.tokens.add(_tokens); + + emit Collected(_subgraphDeploymentID, _tokens); + } + + /** + * @notice Deposit Graph Tokens in exchange for signal of a SubgraphDeployment curation pool. + * @param _subgraphDeploymentID Subgraph deployment pool from where to mint signal + * @param _tokensIn Amount of Graph Tokens to deposit + * @param _signalOutMin Expected minimum amount of signal to receive + * @return Amount of signal minted + * @return Amount of curation tax burned + */ + function mint( + bytes32 _subgraphDeploymentID, + uint256 _tokensIn, + uint256 _signalOutMin + ) external override notPartialPaused returns (uint256, uint256) { + // Need to deposit some funds + require(_tokensIn != 0, "Cannot deposit zero tokens"); + + // Exchange GRT tokens for GCS of the subgraph pool + (uint256 signalOut, uint256 curationTax) = tokensToSignal(_subgraphDeploymentID, _tokensIn); + + // Slippage protection + require(signalOut >= _signalOutMin, "Slippage protection"); + + address curator = msg.sender; + CurationPool storage curationPool = pools[_subgraphDeploymentID]; + + // If it hasn't been curated before then initialize the curve + if (!isCurated(_subgraphDeploymentID)) { + curationPool.reserveRatio = defaultReserveRatio; + + // If no signal token for the pool - create one + if (address(curationPool.gcs) == address(0)) { + // Use a minimal proxy to reduce gas cost + IGraphCurationToken gcs = IGraphCurationToken(ClonesUpgradeable.clone(curationTokenMaster)); + gcs.initialize(address(this)); + curationPool.gcs = gcs; + } + } + + // Trigger update rewards calculation snapshot + _updateRewards(_subgraphDeploymentID); + + // Transfer tokens from the curator to this contract + // Burn the curation tax + // NOTE: This needs to happen after _updateRewards snapshot as that function + // is using balanceOf(curation) + IGraphToken _graphToken = graphToken(); + TokenUtils.pullTokens(_graphToken, curator, _tokensIn); + TokenUtils.burnTokens(_graphToken, curationTax); + + // Update curation pool + curationPool.tokens = curationPool.tokens.add(_tokensIn.sub(curationTax)); + curationPool.gcs.mint(curator, signalOut); + + emit Signalled(curator, _subgraphDeploymentID, _tokensIn, signalOut, curationTax); + + return (signalOut, curationTax); + } + + /** + * @dev Return an amount of signal to get tokens back. + * @notice Burn _signal from the SubgraphDeployment curation pool + * @param _subgraphDeploymentID SubgraphDeployment the curator is returning signal + * @param _signalIn Amount of signal to return + * @param _tokensOutMin Expected minimum amount of tokens to receive + * @return Tokens returned + */ + function burn( + bytes32 _subgraphDeploymentID, + uint256 _signalIn, + uint256 _tokensOutMin + ) external override notPartialPaused returns (uint256) { + address curator = msg.sender; + + // Validations + require(_signalIn != 0, "Cannot burn zero signal"); + require(getCuratorSignal(curator, _subgraphDeploymentID) >= _signalIn, "Cannot burn more signal than you own"); + + // Get the amount of tokens to refund based on returned signal + uint256 tokensOut = signalToTokens(_subgraphDeploymentID, _signalIn); + + // Slippage protection + require(tokensOut >= _tokensOutMin, "Slippage protection"); + + // Trigger update rewards calculation + _updateRewards(_subgraphDeploymentID); + + // Update curation pool + CurationPool storage curationPool = pools[_subgraphDeploymentID]; + curationPool.tokens = curationPool.tokens.sub(tokensOut); + curationPool.gcs.burnFrom(curator, _signalIn); + + // If all signal burnt delete the curation pool except for the + // curation token contract to avoid recreating it on a new mint + if (getCurationPoolSignal(_subgraphDeploymentID) == 0) { + curationPool.tokens = 0; + curationPool.reserveRatio = 0; + } + + // Return the tokens to the curator + TokenUtils.pushTokens(graphToken(), curator, tokensOut); + + emit Burned(curator, _subgraphDeploymentID, tokensOut, _signalIn); + + return tokensOut; + } + + /** + * @notice Get the amount of token reserves in a curation pool. + * @param _subgraphDeploymentID Subgraph deployment curation pool + * @return Amount of token reserves in the curation pool + */ + function getCurationPoolTokens(bytes32 _subgraphDeploymentID) external view override returns (uint256) { + return pools[_subgraphDeploymentID].tokens; + } + + /** + * @notice Check if any GRT tokens are deposited for a SubgraphDeployment. + * @param _subgraphDeploymentID SubgraphDeployment to check if curated + * @return True if curated, false otherwise + */ + function isCurated(bytes32 _subgraphDeploymentID) public view override returns (bool) { + return pools[_subgraphDeploymentID].tokens != 0; + } + + /** + * @notice Get the amount of signal a curator has in a curation pool. + * @param _curator Curator owning the signal tokens + * @param _subgraphDeploymentID Subgraph deployment curation pool + * @return Amount of signal owned by a curator for the subgraph deployment + */ + function getCuratorSignal(address _curator, bytes32 _subgraphDeploymentID) public view override returns (uint256) { + IGraphCurationToken gcs = pools[_subgraphDeploymentID].gcs; + return (address(gcs) == address(0)) ? 0 : gcs.balanceOf(_curator); + } + + /** + * @notice Get the amount of signal in a curation pool. + * @param _subgraphDeploymentID Subgraph deployment curation pool + * @return Amount of signal minted for the subgraph deployment + */ + function getCurationPoolSignal(bytes32 _subgraphDeploymentID) public view override returns (uint256) { + IGraphCurationToken gcs = pools[_subgraphDeploymentID].gcs; + return (address(gcs) == address(0)) ? 0 : gcs.totalSupply(); + } + + /** + * @notice Calculate amount of signal that can be bought with tokens in a curation pool. + * This function considers and excludes the deposit tax. + * @param _subgraphDeploymentID Subgraph deployment to mint signal + * @param _tokensIn Amount of tokens used to mint signal + * @return Amount of signal that can be bought + * @return Amount of tokens that will be burned as curation tax + */ + function tokensToSignal( + bytes32 _subgraphDeploymentID, + uint256 _tokensIn + ) public view override returns (uint256, uint256) { + // NOTE: We're aware that this function rounds down and tax can be 0 for small amounts + // of tokens but since minimumCurationDeposit is 1 GRT tax will always be greater than 0. + uint256 curationTax = _tokensIn.mul(uint256(curationTaxPercentage)).div(MAX_PPM); + uint256 signalOut = _tokensToSignal(_subgraphDeploymentID, _tokensIn.sub(curationTax)); + return (signalOut, curationTax); + } + + /** + * @dev Calculate amount of signal that can be bought with tokens in a curation pool. + * @param _subgraphDeploymentID Subgraph deployment to mint signal + * @param _tokensIn Amount of tokens used to mint signal + * @return Amount of signal that can be bought with tokens + */ + function _tokensToSignal(bytes32 _subgraphDeploymentID, uint256 _tokensIn) private view returns (uint256) { + // Get curation pool tokens and signal + CurationPool memory curationPool = pools[_subgraphDeploymentID]; + + // Init curation pool + if (curationPool.tokens == 0) { + require(_tokensIn >= minimumCurationDeposit, "Curation deposit is below minimum required"); + return + BancorFormula(bondingCurve) + .calculatePurchaseReturn( + SIGNAL_PER_MINIMUM_DEPOSIT, + minimumCurationDeposit, + defaultReserveRatio, + _tokensIn.sub(minimumCurationDeposit) + ) + .add(SIGNAL_PER_MINIMUM_DEPOSIT); + } + + return + BancorFormula(bondingCurve).calculatePurchaseReturn( + getCurationPoolSignal(_subgraphDeploymentID), + curationPool.tokens, + curationPool.reserveRatio, + _tokensIn + ); + } + + /** + * @notice Calculate number of tokens to get when burning signal from a curation pool. + * @param _subgraphDeploymentID Subgraph deployment to burn signal + * @param _signalIn Amount of signal to burn + * @return Amount of tokens to get for the specified amount of signal + */ + function signalToTokens(bytes32 _subgraphDeploymentID, uint256 _signalIn) public view override returns (uint256) { + CurationPool memory curationPool = pools[_subgraphDeploymentID]; + uint256 curationPoolSignal = getCurationPoolSignal(_subgraphDeploymentID); + require(curationPool.tokens != 0, "Subgraph deployment must be curated to perform calculations"); + require(curationPoolSignal >= _signalIn, "Signal must be above or equal to signal issued in the curation pool"); + + return + BancorFormula(bondingCurve).calculateSaleReturn( + curationPoolSignal, + curationPool.tokens, + curationPool.reserveRatio, + _signalIn + ); + } + + /** + * @dev Internal: Set the default reserve ratio percentage for a curation pool. + * @notice Update the default reserver ratio to `_defaultReserveRatio` + * @param _defaultReserveRatio Reserve ratio (in PPM) + */ + function _setDefaultReserveRatio(uint32 _defaultReserveRatio) private { + // Reserve Ratio must be within 0% to 100% (inclusive, in PPM) + require(_defaultReserveRatio != 0, "Default reserve ratio must be > 0"); + require(_defaultReserveRatio <= MAX_PPM, "Default reserve ratio cannot be higher than MAX_PPM"); + + defaultReserveRatio = _defaultReserveRatio; + emit ParameterUpdated("defaultReserveRatio"); + } + + /** + * @dev Internal: Set the minimum deposit amount for curators. + * @notice Update the minimum deposit amount to `_minimumCurationDeposit` + * @param _minimumCurationDeposit Minimum amount of tokens required deposit + */ + function _setMinimumCurationDeposit(uint256 _minimumCurationDeposit) private { + require(_minimumCurationDeposit != 0, "Minimum curation deposit cannot be 0"); + + minimumCurationDeposit = _minimumCurationDeposit; + emit ParameterUpdated("minimumCurationDeposit"); + } + + /** + * @dev Internal: Set the curation tax percentage (in PPM) to charge when a curator deposits GRT tokens. + * @param _percentage Curation tax charged when depositing GRT tokens in PPM + */ + function _setCurationTaxPercentage(uint32 _percentage) private { + require(_percentage <= MAX_PPM, "Curation tax percentage must be below or equal to MAX_PPM"); + + curationTaxPercentage = _percentage; + emit ParameterUpdated("curationTaxPercentage"); + } + + /** + * @dev Internal: Set the master copy to use as clones for the curation token. + * @param _curationTokenMaster Address of implementation contract to use for curation tokens + */ + function _setCurationTokenMaster(address _curationTokenMaster) private { + require(_curationTokenMaster != address(0), "Token master must be non-empty"); + require(AddressUpgradeable.isContract(_curationTokenMaster), "Token master must be a contract"); + + curationTokenMaster = _curationTokenMaster; + emit ParameterUpdated("curationTokenMaster"); + } + + /** + * @dev Triggers an update of rewards due to a change in signal. + * @param _subgraphDeploymentID Subgraph deployment updated + */ + function _updateRewards(bytes32 _subgraphDeploymentID) private { + IRewardsManager rewardsManager = rewardsManager(); + if (address(rewardsManager) != address(0)) { + rewardsManager.onSubgraphSignalUpdate(_subgraphDeploymentID); + } + } +} diff --git a/packages/contracts/contracts/curation/CurationStorage.sol b/packages/contracts/contracts/curation/CurationStorage.sol new file mode 100644 index 000000000..12f5b255b --- /dev/null +++ b/packages/contracts/contracts/curation/CurationStorage.sol @@ -0,0 +1,83 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.7.6; + +import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol"; + +import { ICuration } from "./ICuration.sol"; +import { IGraphCurationToken } from "./IGraphCurationToken.sol"; +import { Managed } from "../governance/Managed.sol"; + +/** + * @title Curation Storage version 1 + * @dev This contract holds the first version of the storage variables + * for the Curation and L2Curation contracts. + * When adding new variables, create a new version that inherits this and update + * the contracts to use the new version instead. + */ +abstract contract CurationV1Storage is Managed, ICuration { + // -- Pool -- + + /** + * @dev CurationPool structure that holds the pool's state + * for a particular subgraph deployment. + */ + struct CurationPool { + uint256 tokens; // GRT Tokens stored as reserves for the subgraph deployment + uint32 reserveRatio; // Ratio for the bonding curve, unused and deprecated in L2 where it will always be 100% but appear as 0 + IGraphCurationToken gcs; // Curation token contract for this curation pool + } + + // -- State -- + + /// Tax charged when curators deposit funds. + /// Parts per million. (Allows for 4 decimal points, 999,999 = 99.9999%) + uint32 public override curationTaxPercentage; + + /// Default reserve ratio to configure curator shares bonding curve + /// Parts per million. (Allows for 4 decimal points, 999,999 = 99.9999%). + /// Unused in L2. + uint32 public defaultReserveRatio; + + /// Master copy address that holds implementation of curation token. + /// @dev This is used as the target for GraphCurationToken clones. + address public curationTokenMaster; + + /// Minimum amount allowed to be deposited by curators to initialize a pool + /// @dev This is the `startPoolBalance` for the bonding curve + uint256 public minimumCurationDeposit; + + /// Bonding curve library + /// Unused in L2. + address public bondingCurve; + + /// @dev Mapping of subgraphDeploymentID => CurationPool + /// There is only one CurationPool per SubgraphDeploymentID + mapping(bytes32 => CurationPool) public pools; +} + +/** + * @title Curation Storage version 2 + * @dev This contract holds the second version of the storage variables + * for the Curation and L2Curation contracts. + * It doesn't add new variables at this contract's level, but adds the Initializable + * contract to the inheritance chain, which includes storage variables. + * When adding new variables, create a new version that inherits this and update + * the contracts to use the new version instead. + */ +abstract contract CurationV2Storage is CurationV1Storage, Initializable { + // Nothing here, just adding Initializable +} + +/** + * @title Curation Storage version 3 + * @dev This contract holds the third version of the storage variables + * for the Curation and L2Curation contracts. + * It adds a new variable subgraphService to the storage. + * When adding new variables, create a new version that inherits this and update + * the contracts to use the new version instead. + */ +abstract contract CurationV3Storage is CurationV2Storage { + // Address of the subgraph service + address public subgraphService; +} diff --git a/packages/contracts/contracts/curation/GraphCurationToken.sol b/packages/contracts/contracts/curation/GraphCurationToken.sol new file mode 100644 index 000000000..78b721e1b --- /dev/null +++ b/packages/contracts/contracts/curation/GraphCurationToken.sol @@ -0,0 +1,48 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.7.6; + +import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol"; + +import "../governance/Governed.sol"; + +/** + * @title GraphCurationToken contract + * @dev This is the implementation of the Curation ERC20 token (GCS). + * + * GCS are created for each subgraph deployment curated in the Curation contract. + * The Curation contract is the owner of GCS tokens and the only one allowed to mint or + * burn them. GCS tokens are transferrable and their holders can do any action allowed + * in a standard ERC20 token implementation except for burning them. + * + * This contract is meant to be used as the implementation for Minimal Proxy clones for + * gas-saving purposes. + */ +contract GraphCurationToken is ERC20Upgradeable, Governed { + /** + * @dev Graph Curation Token Contract initializer. + * @param _owner Address of the contract issuing this token + */ + function initialize(address _owner) external initializer { + Governed._initialize(_owner); + ERC20Upgradeable.__ERC20_init("Graph Curation Share", "GCS"); + } + + /** + * @dev Mint new tokens. + * @param _to Address to send the newly minted tokens + * @param _amount Amount of tokens to mint + */ + function mint(address _to, uint256 _amount) public onlyGovernor { + _mint(_to, _amount); + } + + /** + * @dev Burn tokens from an address. + * @param _account Address from where tokens will be burned + * @param _amount Amount of tokens to burn + */ + function burnFrom(address _account, uint256 _amount) public onlyGovernor { + _burn(_account, _amount); + } +} diff --git a/packages/contracts/contracts/curation/ICuration.sol b/packages/contracts/contracts/curation/ICuration.sol new file mode 100644 index 000000000..4f2c2bac5 --- /dev/null +++ b/packages/contracts/contracts/curation/ICuration.sol @@ -0,0 +1,123 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.7.6 || 0.8.27; + +/** + * @title Curation Interface + * @dev Interface for the Curation contract (and L2Curation too) + */ +interface ICuration { + // -- Configuration -- + + /** + * @notice Update the default reserve ratio to `_defaultReserveRatio` + * @param _defaultReserveRatio Reserve ratio (in PPM) + */ + function setDefaultReserveRatio(uint32 _defaultReserveRatio) external; + + /** + * @notice Update the minimum deposit amount needed to intialize a new subgraph + * @param _minimumCurationDeposit Minimum amount of tokens required deposit + */ + function setMinimumCurationDeposit(uint256 _minimumCurationDeposit) external; + + /** + * @notice Set the curation tax percentage to charge when a curator deposits GRT tokens. + * @param _percentage Curation tax percentage charged when depositing GRT tokens + */ + function setCurationTaxPercentage(uint32 _percentage) external; + + /** + * @notice Set the master copy to use as clones for the curation token. + * @param _curationTokenMaster Address of implementation contract to use for curation tokens + */ + function setCurationTokenMaster(address _curationTokenMaster) external; + + // -- Curation -- + + /** + * @notice Deposit Graph Tokens in exchange for signal of a SubgraphDeployment curation pool. + * @param _subgraphDeploymentID Subgraph deployment pool from where to mint signal + * @param _tokensIn Amount of Graph Tokens to deposit + * @param _signalOutMin Expected minimum amount of signal to receive + * @return Amount of signal minted + * @return Amount of curation tax burned + */ + function mint( + bytes32 _subgraphDeploymentID, + uint256 _tokensIn, + uint256 _signalOutMin + ) external returns (uint256, uint256); + + /** + * @notice Burn _signal from the SubgraphDeployment curation pool + * @param _subgraphDeploymentID SubgraphDeployment the curator is returning signal + * @param _signalIn Amount of signal to return + * @param _tokensOutMin Expected minimum amount of tokens to receive + * @return Tokens returned + */ + function burn(bytes32 _subgraphDeploymentID, uint256 _signalIn, uint256 _tokensOutMin) external returns (uint256); + + /** + * @notice Assign Graph Tokens collected as curation fees to the curation pool reserve. + * @param _subgraphDeploymentID SubgraphDeployment where funds should be allocated as reserves + * @param _tokens Amount of Graph Tokens to add to reserves + */ + function collect(bytes32 _subgraphDeploymentID, uint256 _tokens) external; + + // -- Getters -- + + /** + * @notice Check if any GRT tokens are deposited for a SubgraphDeployment. + * @param _subgraphDeploymentID SubgraphDeployment to check if curated + * @return True if curated, false otherwise + */ + function isCurated(bytes32 _subgraphDeploymentID) external view returns (bool); + + /** + * @notice Get the amount of signal a curator has in a curation pool. + * @param _curator Curator owning the signal tokens + * @param _subgraphDeploymentID Subgraph deployment curation pool + * @return Amount of signal owned by a curator for the subgraph deployment + */ + function getCuratorSignal(address _curator, bytes32 _subgraphDeploymentID) external view returns (uint256); + + /** + * @notice Get the amount of signal in a curation pool. + * @param _subgraphDeploymentID Subgraph deployment curation pool + * @return Amount of signal minted for the subgraph deployment + */ + function getCurationPoolSignal(bytes32 _subgraphDeploymentID) external view returns (uint256); + + /** + * @notice Get the amount of token reserves in a curation pool. + * @param _subgraphDeploymentID Subgraph deployment curation pool + * @return Amount of token reserves in the curation pool + */ + function getCurationPoolTokens(bytes32 _subgraphDeploymentID) external view returns (uint256); + + /** + * @notice Calculate amount of signal that can be bought with tokens in a curation pool. + * This function considers and excludes the deposit tax. + * @param _subgraphDeploymentID Subgraph deployment to mint signal + * @param _tokensIn Amount of tokens used to mint signal + * @return Amount of signal that can be bought + * @return Amount of tokens that will be burned as curation tax + */ + function tokensToSignal(bytes32 _subgraphDeploymentID, uint256 _tokensIn) external view returns (uint256, uint256); + + /** + * @notice Calculate number of tokens to get when burning signal from a curation pool. + * @param _subgraphDeploymentID Subgraph deployment to burn signal + * @param _signalIn Amount of signal to burn + * @return Amount of tokens to get for the specified amount of signal + */ + function signalToTokens(bytes32 _subgraphDeploymentID, uint256 _signalIn) external view returns (uint256); + + /** + * @notice Tax charged when curators deposit funds. + * Parts per million. (Allows for 4 decimal points, 999,999 = 99.9999%) + * @return Curation tax percentage expressed in PPM + */ + function curationTaxPercentage() external view returns (uint32); +} diff --git a/packages/contracts/contracts/curation/IGraphCurationToken.sol b/packages/contracts/contracts/curation/IGraphCurationToken.sol new file mode 100644 index 000000000..43679aba6 --- /dev/null +++ b/packages/contracts/contracts/curation/IGraphCurationToken.sol @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.7.6; + +import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; + +interface IGraphCurationToken is IERC20Upgradeable { + function initialize(address _owner) external; + + function burnFrom(address _account, uint256 _amount) external; + + function mint(address _to, uint256 _amount) external; +} diff --git a/packages/contracts/contracts/discovery/GNS.sol b/packages/contracts/contracts/discovery/GNS.sol new file mode 100644 index 000000000..3cbb9ca8a --- /dev/null +++ b/packages/contracts/contracts/discovery/GNS.sol @@ -0,0 +1,824 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.7.6; +pragma abicoder v2; + +import { SafeMathUpgradeable } from "@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol"; +import { AddressUpgradeable } from "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol"; + +import { Multicall } from "../base/Multicall.sol"; +import { GraphUpgradeable } from "../upgrades/GraphUpgradeable.sol"; +import { TokenUtils } from "../utils/TokenUtils.sol"; +import { ICuration } from "../curation/ICuration.sol"; +import { Managed } from "../governance/Managed.sol"; +import { ISubgraphNFT } from "./ISubgraphNFT.sol"; + +import { IGNS } from "./IGNS.sol"; +import { GNSV3Storage } from "./GNSStorage.sol"; + +/** + * @title GNS + * @dev The Graph Name System contract provides a decentralized naming system for subgraphs + * used in the scope of the Graph Network. It translates Subgraphs into Subgraph Versions. + * Each version is associated with a Subgraph Deployment. The contract has no knowledge of + * human-readable names. All human readable names emitted in events. + * The contract implements a multicall behaviour to support batching multiple calls in a single + * transaction. + */ +abstract contract GNS is GNSV3Storage, GraphUpgradeable, IGNS, Multicall { + using SafeMathUpgradeable for uint256; + + // -- Constants -- + + /// @dev 100% in parts per million + uint32 private constant MAX_PPM = 1000000; + + /// @dev Equates to Connector weight on bancor formula to be CW = 1 + uint32 internal immutable fixedReserveRatio = MAX_PPM; + + // -- Events -- + + /// @dev Emitted when the subgraph NFT contract is updated + event SubgraphNFTUpdated(address subgraphNFT); + + /** + * @dev Emitted when graph account sets its default name + */ + event SetDefaultName( + address indexed graphAccount, + uint256 nameSystem, // only ENS for now + bytes32 nameIdentifier, + string name + ); + + /** + * @dev Emitted when the subgraph metadata is updated. + */ + event SubgraphMetadataUpdated(uint256 indexed subgraphID, bytes32 subgraphMetadata); + + /** + * @dev Emitted when a subgraph version is updated. + */ + event SubgraphVersionUpdated( + uint256 indexed subgraphID, + bytes32 indexed subgraphDeploymentID, + bytes32 versionMetadata + ); + + /** + * @dev Emitted when a curator mints signal. + */ + event SignalMinted( + uint256 indexed subgraphID, + address indexed curator, + uint256 nSignalCreated, + uint256 vSignalCreated, + uint256 tokensDeposited + ); + + /** + * @dev Emitted when a curator burns signal. + */ + event SignalBurned( + uint256 indexed subgraphID, + address indexed curator, + uint256 nSignalBurnt, + uint256 vSignalBurnt, + uint256 tokensReceived + ); + + /** + * @dev Emitted when a curator transfers signal. + */ + event SignalTransferred( + uint256 indexed subgraphID, + address indexed from, + address indexed to, + uint256 nSignalTransferred + ); + + /** + * @dev Emitted when a subgraph is created. + */ + event SubgraphPublished(uint256 indexed subgraphID, bytes32 indexed subgraphDeploymentID, uint32 reserveRatio); + + /** + * @dev Emitted when a subgraph is upgraded to point to a new + * subgraph deployment, burning all the old vSignal and depositing the GRT into the + * new vSignal curve. + */ + event SubgraphUpgraded( + uint256 indexed subgraphID, + uint256 vSignalCreated, + uint256 tokensSignalled, + bytes32 indexed subgraphDeploymentID + ); + + /** + * @dev Emitted when a subgraph is deprecated. + */ + event SubgraphDeprecated(uint256 indexed subgraphID, uint256 withdrawableGRT); + + /** + * @dev Emitted when a curator withdraws GRT from a deprecated subgraph + */ + event GRTWithdrawn(uint256 indexed subgraphID, address indexed curator, uint256 nSignalBurnt, uint256 withdrawnGRT); + + /** + * @dev Emitted when the counterpart (L1/L2) GNS address is updated + */ + event CounterpartGNSAddressUpdated(address _counterpart); + + // -- Modifiers -- + + /** + * @dev Emitted when a legacy subgraph is claimed + */ + event LegacySubgraphClaimed(address indexed graphAccount, uint256 subgraphNumber); + + /** + * @dev Modifier that allows only a subgraph operator to be the caller + */ + modifier onlySubgraphAuth(uint256 _subgraphID) { + require(ownerOf(_subgraphID) == msg.sender, "GNS: Must be authorized"); + _; + } + + // -- Functions -- + + /** + * @notice Initialize the GNS contract. + * @param _controller Address of the Controller contract that manages this contract + * @param _subgraphNFT Address of the Subgraph NFT contract + */ + function initialize(address _controller, address _subgraphNFT) external onlyImpl initializer { + Managed._initialize(_controller); + + // Settings + _setOwnerTaxPercentage(500000); + _setSubgraphNFT(_subgraphNFT); + } + + /** + * @notice Approve curation contract to pull funds. + */ + function approveAll() external override { + graphToken().approve(address(curation()), type(uint256).max); + } + + // -- Config -- + + /** + * @notice Set the owner fee percentage. This is used to prevent a subgraph owner to drain all + * the name curators tokens while upgrading or deprecating and is configurable in parts per million. + * @param _ownerTaxPercentage Owner tax percentage + */ + function setOwnerTaxPercentage(uint32 _ownerTaxPercentage) external override onlyGovernor { + _setOwnerTaxPercentage(_ownerTaxPercentage); + } + + /** + * @notice Set the NFT registry contract + * NOTE: Calling this function will break the ownership model unless + * it is replaced with a fully migrated version of the NFT contract state + * Use with care. + * @param _subgraphNFT Address of the ERC721 contract + */ + function setSubgraphNFT(address _subgraphNFT) external onlyGovernor { + _setSubgraphNFT(_subgraphNFT); + } + + /** + * @notice Set the counterpart (L1/L2) GNS address + * @param _counterpart Owner tax percentage + */ + function setCounterpartGNSAddress(address _counterpart) external onlyGovernor { + counterpartGNSAddress = _counterpart; + emit CounterpartGNSAddressUpdated(_counterpart); + } + + // -- Actions -- + + /** + * @notice Allows a graph account to set a default name + * @param _graphAccount Account that is setting its name + * @param _nameSystem Name system account already has ownership of a name in + * @param _nameIdentifier The unique identifier that is used to identify the name in the system + * @param _name The name being set as default + */ + function setDefaultName( + address _graphAccount, + uint8 _nameSystem, + bytes32 _nameIdentifier, + string calldata _name + ) external override { + require(_graphAccount == msg.sender, "GNS: Only you can set your name"); + emit SetDefaultName(_graphAccount, _nameSystem, _nameIdentifier, _name); + } + + /** + * @notice Allows a subgraph owner to update the metadata of a subgraph they have published + * @param _subgraphID Subgraph ID + * @param _subgraphMetadata IPFS hash for the subgraph metadata + */ + function updateSubgraphMetadata( + uint256 _subgraphID, + bytes32 _subgraphMetadata + ) external override onlySubgraphAuth(_subgraphID) { + _setSubgraphMetadata(_subgraphID, _subgraphMetadata); + } + + /** + * @notice Publish a new subgraph. + * @param _subgraphDeploymentID Subgraph deployment for the subgraph + * @param _versionMetadata IPFS hash for the subgraph version metadata + * @param _subgraphMetadata IPFS hash for the subgraph metadata + */ + function publishNewSubgraph( + bytes32 _subgraphDeploymentID, + bytes32 _versionMetadata, + bytes32 _subgraphMetadata + ) external override notPaused { + // Subgraph deployment must be non-empty + require(_subgraphDeploymentID != 0, "GNS: Cannot set deploymentID to 0 in publish"); + + // Init the subgraph + address subgraphOwner = msg.sender; + uint256 subgraphID = _nextSubgraphID(subgraphOwner); + SubgraphData storage subgraphData = _getSubgraphData(subgraphID); + subgraphData.subgraphDeploymentID = _subgraphDeploymentID; + subgraphData.__DEPRECATED_reserveRatio = fixedReserveRatio; + + // Mint the NFT. Use the subgraphID as tokenID. + // This function will check the if tokenID already exists. + _mintNFT(subgraphOwner, subgraphID); + emit SubgraphPublished(subgraphID, _subgraphDeploymentID, fixedReserveRatio); + + // Set the token metadata + _setSubgraphMetadata(subgraphID, _subgraphMetadata); + + emit SubgraphVersionUpdated(subgraphID, _subgraphDeploymentID, _versionMetadata); + } + + /** + * @notice Publish a new version of an existing subgraph. + * @param _subgraphID Subgraph ID + * @param _subgraphDeploymentID Subgraph deployment ID of the new version + * @param _versionMetadata IPFS hash for the subgraph version metadata + */ + function publishNewVersion( + uint256 _subgraphID, + bytes32 _subgraphDeploymentID, + bytes32 _versionMetadata + ) external virtual override notPaused onlySubgraphAuth(_subgraphID) { + // Perform the upgrade from the current subgraph deployment to the new one. + // This involves burning all signal from the old deployment and using the funds to buy + // from the new deployment. + // This will also make the change to target to the new deployment. + + // Subgraph check + SubgraphData storage subgraphData = _getSubgraphOrRevert(_subgraphID); + + // New subgraph deployment must be non-empty + require(_subgraphDeploymentID != 0, "GNS: Cannot set deploymentID to 0 in publish"); + + // New subgraph deployment must be different than current + require( + _subgraphDeploymentID != subgraphData.subgraphDeploymentID, + "GNS: Cannot publish a new version with the same subgraph deployment ID" + ); + + // This is to prevent the owner from front running its name curators signal by posting + // its own signal ahead, bringing the name curators in, and dumping on them + ICuration curation = curation(); + require( + !curation.isCurated(_subgraphDeploymentID), + "GNS: Owner cannot point to a subgraphID that has been pre-curated" + ); + + // Move all signal from previous version to new version + // NOTE: We will only do this as long as there is signal on the subgraph + if (subgraphData.nSignal != 0) { + // Burn all version signal in the name pool for tokens (w/no slippage protection) + // Sell all signal from the old deployment + uint256 tokens = curation.burn(subgraphData.subgraphDeploymentID, subgraphData.vSignal, 0); + + // Take the owner cut of the curation tax, add it to the total + // Upgrade is only callable by the owner, we assume then that msg.sender = owner + address subgraphOwner = msg.sender; + uint256 tokensWithTax = _chargeOwnerTax(tokens, subgraphOwner, curation.curationTaxPercentage()); + + // Update pool: constant nSignal, vSignal can change (w/no slippage protection) + // Buy all signal from the new deployment + (subgraphData.vSignal, ) = curation.mint(_subgraphDeploymentID, tokensWithTax, 0); + + emit SubgraphUpgraded(_subgraphID, subgraphData.vSignal, tokensWithTax, _subgraphDeploymentID); + } + + // Update target deployment + subgraphData.subgraphDeploymentID = _subgraphDeploymentID; + + emit SubgraphVersionUpdated(_subgraphID, _subgraphDeploymentID, _versionMetadata); + } + + /** + * @notice Deprecate a subgraph. The bonding curve is destroyed, the vSignal is burned, and the GNS + * contract holds the GRT from burning the vSignal, which all curators can withdraw manually. + * Can only be done by the subgraph owner. + * @param _subgraphID Subgraph ID + */ + function deprecateSubgraph(uint256 _subgraphID) external override notPaused onlySubgraphAuth(_subgraphID) { + // Subgraph check + SubgraphData storage subgraphData = _getSubgraphOrRevert(_subgraphID); + + // Burn signal only if it has any available + if (subgraphData.nSignal != 0) { + subgraphData.withdrawableGRT = curation().burn(subgraphData.subgraphDeploymentID, subgraphData.vSignal, 0); + } + + // Deprecate the subgraph and do cleanup + subgraphData.disabled = true; + subgraphData.vSignal = 0; + subgraphData.__DEPRECATED_reserveRatio = 0; + // NOTE: We don't reset the following variable as we use it to test if the Subgraph was ever created + // subgraphData.subgraphDeploymentID = 0; + + // Burn the NFT + _burnNFT(_subgraphID); + + emit SubgraphDeprecated(_subgraphID, subgraphData.withdrawableGRT); + } + + /** + * @notice Deposit GRT into a subgraph and mint signal. + * @param _subgraphID Subgraph ID + * @param _tokensIn The amount of tokens the nameCurator wants to deposit + * @param _nSignalOutMin Expected minimum amount of name signal to receive + */ + function mintSignal( + uint256 _subgraphID, + uint256 _tokensIn, + uint256 _nSignalOutMin + ) external override notPartialPaused { + // Subgraph checks + SubgraphData storage subgraphData = _getSubgraphOrRevert(_subgraphID); + + // Pull tokens from sender + address curator = msg.sender; + TokenUtils.pullTokens(graphToken(), curator, _tokensIn); + + // Get name signal to mint for tokens deposited + (uint256 vSignal, ) = curation().mint(subgraphData.subgraphDeploymentID, _tokensIn, 0); + uint256 nSignal = vSignalToNSignal(_subgraphID, vSignal); + + // Slippage protection + require(nSignal >= _nSignalOutMin, "GNS: Slippage protection"); + + // Update pools + subgraphData.vSignal = subgraphData.vSignal.add(vSignal); + subgraphData.nSignal = subgraphData.nSignal.add(nSignal); + subgraphData.curatorNSignal[curator] = subgraphData.curatorNSignal[curator].add(nSignal); + + emit SignalMinted(_subgraphID, curator, nSignal, vSignal, _tokensIn); + } + + /** + * @notice Burn signal for a subgraph and return the GRT. + * @param _subgraphID Subgraph ID + * @param _nSignal The amount of nSignal the nameCurator wants to burn + * @param _tokensOutMin Expected minimum amount of tokens to receive + */ + function burnSignal( + uint256 _subgraphID, + uint256 _nSignal, + uint256 _tokensOutMin + ) external override notPartialPaused { + // Subgraph checks + SubgraphData storage subgraphData = _getSubgraphOrRevert(_subgraphID); + + // Curator balance checks + address curator = msg.sender; + uint256 curatorNSignal = subgraphData.curatorNSignal[curator]; + require(_nSignal <= curatorNSignal, "GNS: Curator cannot withdraw more nSignal than they have"); + + // Get tokens for name signal amount to burn + uint256 vSignal = nSignalToVSignal(_subgraphID, _nSignal); + uint256 tokens = curation().burn(subgraphData.subgraphDeploymentID, vSignal, _tokensOutMin); + + // Update pools + subgraphData.vSignal = subgraphData.vSignal.sub(vSignal); + subgraphData.nSignal = subgraphData.nSignal.sub(_nSignal); + subgraphData.curatorNSignal[curator] = subgraphData.curatorNSignal[curator].sub(_nSignal); + + // Return the tokens to the nameCurator + require(graphToken().transfer(curator, tokens), "GNS: Error sending tokens"); + + emit SignalBurned(_subgraphID, curator, _nSignal, vSignal, tokens); + } + + /** + * @notice Move subgraph signal from sender to `_recipient` + * @param _subgraphID Subgraph ID + * @param _recipient Address to send the signal to + * @param _amount The amount of nSignal to transfer + */ + function transferSignal( + uint256 _subgraphID, + address _recipient, + uint256 _amount + ) external override notPartialPaused { + require(_recipient != address(0), "GNS: Curator cannot transfer to the zero address"); + + // Subgraph checks + SubgraphData storage subgraphData = _getSubgraphOrRevert(_subgraphID); + + // Balance checks + address curator = msg.sender; + uint256 curatorBalance = subgraphData.curatorNSignal[curator]; + require(curatorBalance >= _amount, "GNS: Curator transfer amount exceeds balance"); + + // Move the signal + subgraphData.curatorNSignal[curator] = subgraphData.curatorNSignal[curator].sub(_amount); + subgraphData.curatorNSignal[_recipient] = subgraphData.curatorNSignal[_recipient].add(_amount); + + emit SignalTransferred(_subgraphID, curator, _recipient, _amount); + } + + /** + * @notice Withdraw tokens from a deprecated subgraph. + * When the subgraph is deprecated, any curator can call this function and + * withdraw the GRT they are entitled for its original deposit + * @param _subgraphID Subgraph ID + */ + function withdraw(uint256 _subgraphID) external override notPartialPaused { + // Subgraph validations + SubgraphData storage subgraphData = _getSubgraphData(_subgraphID); + require(subgraphData.disabled == true, "GNS: Must be disabled first"); + require(subgraphData.withdrawableGRT != 0, "GNS: No more GRT to withdraw"); + + // Curator validations + address curator = msg.sender; + uint256 curatorNSignal = subgraphData.curatorNSignal[curator]; + require(curatorNSignal != 0, "GNS: No signal to withdraw GRT"); + + // Get curator share of tokens to be withdrawn + uint256 tokensOut = curatorNSignal.mul(subgraphData.withdrawableGRT).div(subgraphData.nSignal); + subgraphData.curatorNSignal[curator] = 0; + subgraphData.nSignal = subgraphData.nSignal.sub(curatorNSignal); + subgraphData.withdrawableGRT = subgraphData.withdrawableGRT.sub(tokensOut); + + // Return tokens to the curator + TokenUtils.pushTokens(graphToken(), curator, tokensOut); + + emit GRTWithdrawn(_subgraphID, curator, curatorNSignal, tokensOut); + } + + /** + * @notice Create subgraphID for legacy subgraph and mint ownership NFT. + * @param _graphAccount Account that created the subgraph + * @param _subgraphNumber The sequence number of the created subgraph + * @param _subgraphMetadata IPFS hash for the subgraph metadata + */ + function migrateLegacySubgraph(address _graphAccount, uint256 _subgraphNumber, bytes32 _subgraphMetadata) external { + // Must be an existing legacy subgraph + bool legacySubgraphExists = legacySubgraphData[_graphAccount][_subgraphNumber].subgraphDeploymentID != 0; + require(legacySubgraphExists == true, "GNS: Subgraph does not exist"); + + // Must not be a claimed subgraph + uint256 subgraphID = _buildLegacySubgraphID(_graphAccount, _subgraphNumber); + require(legacySubgraphKeys[subgraphID].account == address(0), "GNS: Subgraph was already claimed"); + + // Store a reference for a legacy subgraph + legacySubgraphKeys[subgraphID] = IGNS.LegacySubgraphKey({ + account: _graphAccount, + accountSeqID: _subgraphNumber + }); + + // Delete state for legacy subgraph + legacySubgraphs[_graphAccount][_subgraphNumber] = 0; + + // Mint the NFT and send to owner + // The subgraph owner is the graph account that created it + _mintNFT(_graphAccount, subgraphID); + emit LegacySubgraphClaimed(_graphAccount, _subgraphNumber); + + // Set the token metadata + _setSubgraphMetadata(subgraphID, _subgraphMetadata); + } + + /** + * @notice Return the total signal on the subgraph. + * @param _subgraphID Subgraph ID + * @return Total signal on the subgraph + */ + function subgraphSignal(uint256 _subgraphID) external view override returns (uint256) { + return _getSubgraphData(_subgraphID).nSignal; + } + + /** + * @notice Return the total tokens on the subgraph at current value. + * @param _subgraphID Subgraph ID + * @return Total tokens on the subgraph + */ + function subgraphTokens(uint256 _subgraphID) external view override returns (uint256) { + uint256 signal = _getSubgraphData(_subgraphID).nSignal; + if (signal != 0) { + (, uint256 tokens) = nSignalToTokens(_subgraphID, signal); + return tokens; + } + return 0; + } + + /** + * @notice Return whether a subgraph is a legacy subgraph (created before subgraph NFTs). + * @param _subgraphID Subgraph ID + * @return Return true if subgraph is a legacy subgraph + */ + function isLegacySubgraph(uint256 _subgraphID) external view override returns (bool) { + (address account, ) = getLegacySubgraphKey(_subgraphID); + return account != address(0); + } + + /** + * @notice Calculate subgraph signal to be returned for an amount of tokens. + * @param _subgraphID Subgraph ID + * @param _tokensIn Tokens being exchanged for subgraph signal + * @return Amount of subgraph signal and curation tax + */ + function tokensToNSignal( + uint256 _subgraphID, + uint256 _tokensIn + ) public view override returns (uint256, uint256, uint256) { + SubgraphData storage subgraphData = _getSubgraphData(_subgraphID); + (uint256 vSignal, uint256 curationTax) = curation().tokensToSignal( + subgraphData.subgraphDeploymentID, + _tokensIn + ); + uint256 nSignal = vSignalToNSignal(_subgraphID, vSignal); + return (vSignal, nSignal, curationTax); + } + + /** + * @notice Calculate tokens returned for an amount of subgraph signal. + * @param _subgraphID Subgraph ID + * @param _nSignalIn Subgraph signal being exchanged for tokens + * @return Amount of tokens returned for an amount of subgraph signal + */ + function nSignalToTokens(uint256 _subgraphID, uint256 _nSignalIn) public view override returns (uint256, uint256) { + // Get subgraph or revert if not published + // It does not make sense to convert signal from a disabled or non-existing one + SubgraphData storage subgraphData = _getSubgraphOrRevert(_subgraphID); + uint256 vSignal = nSignalToVSignal(_subgraphID, _nSignalIn); + uint256 tokensOut = curation().signalToTokens(subgraphData.subgraphDeploymentID, vSignal); + return (vSignal, tokensOut); + } + + /** + * @notice Calculate subgraph signal to be returned for an amount of subgraph deployment signal. + * @param _subgraphID Subgraph ID + * @param _vSignalIn Amount of subgraph deployment signal to exchange for subgraph signal + * @return Amount of subgraph signal that can be bought + */ + function vSignalToNSignal(uint256 _subgraphID, uint256 _vSignalIn) public view override returns (uint256) { + SubgraphData storage subgraphData = _getSubgraphData(_subgraphID); + + // Handle initialization by using 1:1 version to name signal + if (subgraphData.vSignal == 0) { + return _vSignalIn; + } + + return subgraphData.nSignal.mul(_vSignalIn).div(subgraphData.vSignal); + } + + /** + * @notice Calculate subgraph deployment signal to be returned for an amount of subgraph signal. + * @param _subgraphID Subgraph ID + * @param _nSignalIn Subgraph signal being exchanged for subgraph deployment signal + * @return Amount of subgraph deployment signal that can be returned + */ + function nSignalToVSignal(uint256 _subgraphID, uint256 _nSignalIn) public view override returns (uint256) { + SubgraphData storage subgraphData = _getSubgraphData(_subgraphID); + return subgraphData.vSignal.mul(_nSignalIn).div(subgraphData.nSignal); + } + + /** + * @notice Get the amount of subgraph signal a curator has. + * @param _subgraphID Subgraph ID + * @param _curator Curator address + * @return Amount of subgraph signal owned by a curator + */ + function getCuratorSignal(uint256 _subgraphID, address _curator) public view override returns (uint256) { + return _getSubgraphData(_subgraphID).curatorNSignal[_curator]; + } + + /** + * @notice Return whether a subgraph is published. + * @param _subgraphID Subgraph ID + * @return Return true if subgraph is currently published + */ + function isPublished(uint256 _subgraphID) public view override returns (bool) { + return _isPublished(_getSubgraphData(_subgraphID)); + } + + /** + * @notice Returns account and sequence ID for a legacy subgraph (created before subgraph NFTs). + * @param _subgraphID Subgraph ID + * @return account Account that created the subgraph (or 0 if it's not a legacy subgraph) + * @return seqID Sequence number for the subgraph + */ + function getLegacySubgraphKey(uint256 _subgraphID) public view override returns (address account, uint256 seqID) { + LegacySubgraphKey storage legacySubgraphKey = legacySubgraphKeys[_subgraphID]; + account = legacySubgraphKey.account; + seqID = legacySubgraphKey.accountSeqID; + } + + /** + * @notice Return the owner of a subgraph. + * @param _tokenID Subgraph ID + * @return Owner address + */ + function ownerOf(uint256 _tokenID) public view override returns (address) { + return subgraphNFT.ownerOf(_tokenID); + } + + /** + * @dev Calculate tax that owner will have to cover for upgrading or deprecating. + * @param _tokens Tokens that were received from deprecating the old subgraph + * @param _owner Subgraph owner + * @param _curationTaxPercentage Tax percentage on curation deposits from Curation contract + * @return Total tokens that will be sent to curation, _tokens + ownerTax + */ + function _chargeOwnerTax( + uint256 _tokens, + address _owner, + uint32 _curationTaxPercentage + ) internal returns (uint256) { + // If curation or owner tax are zero, we don't need to charge owner tax + // so the amount of tokens to signal will remain the same. + // Note if owner tax is zero but curation tax is nonzero, the curation tax + // will still be charged (in Curation or L2Curation) - this function just calculates + // the owner's additional tax. + if (_curationTaxPercentage == 0 || ownerTaxPercentage == 0) { + return _tokens; + } + + // Tax on the total bonding curve funds + uint256 taxOnOriginal = _tokens.mul(_curationTaxPercentage).div(MAX_PPM); + // Total after the tax + uint256 totalWithoutOwnerTax = _tokens.sub(taxOnOriginal); + // The portion of tax that the owner will pay + uint256 ownerTax = taxOnOriginal.mul(ownerTaxPercentage).div(MAX_PPM); + + uint256 totalWithOwnerTax = totalWithoutOwnerTax.add(ownerTax); + + // The total after tax, plus owner partial repay, divided by + // the tax, to adjust it slightly upwards. ex: + // 100 GRT, 5 GRT Tax, owner pays 100% --> 5 GRT + // To get 100 in the protocol after tax, Owner deposits + // ~5.26, as ~105.26 * .95 = 100 + uint256 totalAdjustedUp = totalWithOwnerTax.mul(MAX_PPM).div( + uint256(MAX_PPM).sub(uint256(_curationTaxPercentage)) + ); + + uint256 ownerTaxAdjustedUp = totalAdjustedUp.sub(_tokens); + + // Get the owner of the subgraph to reimburse the curation tax + TokenUtils.pullTokens(graphToken(), _owner, ownerTaxAdjustedUp); + + return totalAdjustedUp; + } + + /** + * @dev Return the next subgraphID given the account that is creating the subgraph. + * NOTE: This function updates the sequence ID for the account + * @return Sequence ID for the account + */ + function _nextSubgraphID(address _account) internal returns (uint256) { + return _buildSubgraphID(_account, _nextAccountSeqID(_account)); + } + + /** + * @dev Return a new consecutive sequence ID for an account and update to the next value. + * NOTE: This function updates the sequence ID for the account + * @return Sequence ID for the account + */ + function _nextAccountSeqID(address _account) internal returns (uint256) { + uint256 seqID = nextAccountSeqID[_account]; + nextAccountSeqID[_account] = nextAccountSeqID[_account].add(1); + return seqID; + } + + /** + * @dev Mint the NFT for the subgraph. + * @param _owner Owner address + * @param _tokenID Subgraph ID + */ + function _mintNFT(address _owner, uint256 _tokenID) internal { + subgraphNFT.mint(_owner, _tokenID); + } + + /** + * @dev Burn the NFT for the subgraph. + * @param _tokenID Subgraph ID + */ + function _burnNFT(uint256 _tokenID) internal { + subgraphNFT.burn(_tokenID); + } + + /** + * @dev Set the subgraph metadata. + * @param _tokenID Subgraph ID + * @param _subgraphMetadata IPFS hash of the subgraph metadata + */ + function _setSubgraphMetadata(uint256 _tokenID, bytes32 _subgraphMetadata) internal { + subgraphNFT.setSubgraphMetadata(_tokenID, _subgraphMetadata); + + // Even if the following event is emitted in the NFT we emit it here to facilitate + // subgraph indexing + emit SubgraphMetadataUpdated(_tokenID, _subgraphMetadata); + } + + /** + * @dev Get subgraph data. + * This function will first look for a v1 subgraph and return it if found. + * @param _subgraphID Subgraph ID + * @return Subgraph Data + */ + function _getSubgraphData(uint256 _subgraphID) internal view virtual returns (SubgraphData storage) { + // If there is a legacy subgraph created return it + LegacySubgraphKey storage legacySubgraphKey = legacySubgraphKeys[_subgraphID]; + if (legacySubgraphKey.account != address(0)) { + return legacySubgraphData[legacySubgraphKey.account][legacySubgraphKey.accountSeqID]; + } + // Return new subgraph type + return subgraphs[_subgraphID]; + } + + /** + * @dev Return whether a subgraph is published. + * @param _subgraphData Subgraph Data + * @return Return true if subgraph is currently published + */ + function _isPublished(SubgraphData storage _subgraphData) internal view returns (bool) { + return _subgraphData.subgraphDeploymentID != 0 && _subgraphData.disabled == false; + } + + /** + * @dev Return the subgraph data or revert if not published or deprecated. + * @param _subgraphID Subgraph ID + * @return Subgraph Data + */ + function _getSubgraphOrRevert(uint256 _subgraphID) internal view returns (SubgraphData storage) { + SubgraphData storage subgraphData = _getSubgraphData(_subgraphID); + require(_isPublished(subgraphData) == true, "GNS: Must be active"); + return subgraphData; + } + + /** + * @dev Build a subgraph ID based on the account creating it and a sequence number for that account. + * Only used for legacy subgraphs being migrated, as new ones will also use the chainid. + * Subgraph ID is the keccak hash of account+seqID + * @return Subgraph ID + */ + function _buildLegacySubgraphID(address _account, uint256 _seqID) internal pure returns (uint256) { + return uint256(keccak256(abi.encodePacked(_account, _seqID))); + } + + /** + * @dev Build a subgraph ID based on the account creating it and a sequence number for that account. + * Subgraph ID is the keccak hash of account+seqID + * @return Subgraph ID + */ + function _buildSubgraphID(address _account, uint256 _seqID) internal pure returns (uint256) { + uint256 chainId; + // Too bad solidity 0.7.6 still doesn't have block.chainid + // solhint-disable-next-line no-inline-assembly + assembly { + chainId := chainid() + } + return uint256(keccak256(abi.encodePacked(_account, _seqID, chainId))); + } + + /** + * @dev Internal: Set the owner tax percentage. This is used to prevent a subgraph owner to drain all + * the name curators tokens while upgrading or deprecating and is configurable in parts per million. + * @param _ownerTaxPercentage Owner tax percentage + */ + function _setOwnerTaxPercentage(uint32 _ownerTaxPercentage) private { + require(_ownerTaxPercentage <= MAX_PPM, "Owner tax must be MAX_PPM or less"); + ownerTaxPercentage = _ownerTaxPercentage; + emit ParameterUpdated("ownerTaxPercentage"); + } + + /** + * @dev Internal: Set the NFT registry contract + * @param _subgraphNFT Address of the ERC721 contract + */ + function _setSubgraphNFT(address _subgraphNFT) private { + require(_subgraphNFT != address(0), "NFT address cant be zero"); + require(AddressUpgradeable.isContract(_subgraphNFT), "NFT must be valid"); + + subgraphNFT = ISubgraphNFT(_subgraphNFT); + emit SubgraphNFTUpdated(_subgraphNFT); + } +} diff --git a/packages/contracts/contracts/discovery/GNSStorage.sol b/packages/contracts/contracts/discovery/GNSStorage.sol new file mode 100644 index 000000000..80122c9ba --- /dev/null +++ b/packages/contracts/contracts/discovery/GNSStorage.sol @@ -0,0 +1,75 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.7.6; +pragma abicoder v2; + +import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol"; +import { Managed } from "../governance/Managed.sol"; + +import { IEthereumDIDRegistry } from "./erc1056/IEthereumDIDRegistry.sol"; +import { IGNS } from "./IGNS.sol"; +import { ISubgraphNFT } from "./ISubgraphNFT.sol"; + +/** + * @title GNSV1Storage + * @notice This contract holds all the storage variables for the GNS contract, version 1 + */ +abstract contract GNSV1Storage is Managed { + // -- State -- + + /// Percentage of curation tax that must be paid by the owner, in parts per million. + uint32 public ownerTaxPercentage; + + /// @dev [DEPRECATED] Bonding curve formula. + address private __DEPRECATED_bondingCurve; // solhint-disable-line var-name-mixedcase + + /// @dev Stores what subgraph deployment a particular legacy subgraph targets. + /// A subgraph is defined by (graphAccountID, subgraphNumber). + /// A subgraph can target one subgraph deployment (bytes32 hash). + /// (graphAccountID, subgraphNumber) => subgraphDeploymentID + mapping(address => mapping(uint256 => bytes32)) internal legacySubgraphs; + + /// Every time an account creates a subgraph it increases a per-account sequence ID. + /// account => seqID + mapping(address => uint256) public nextAccountSeqID; + + /// Stores all the signal deposited on a legacy subgraph. + /// (graphAccountID, subgraphNumber) => SubgraphData + mapping(address => mapping(uint256 => IGNS.SubgraphData)) public legacySubgraphData; + + /// @dev [DEPRECATED] ERC-1056 contract reference. + /// This contract was used for managing identities. + IEthereumDIDRegistry private __DEPRECATED_erc1056Registry; // solhint-disable-line var-name-mixedcase +} + +/** + * @title GNSV2Storage + * @notice This contract holds all the storage variables for the GNS contract, version 2 + */ +abstract contract GNSV2Storage is GNSV1Storage { + /// Stores the account and seqID for a legacy subgraph that has been migrated. + /// Use it whenever a legacy (v1) subgraph NFT was claimed to maintain compatibility. + /// Keep a reference from subgraphID => (graphAccount, subgraphNumber) + mapping(uint256 => IGNS.LegacySubgraphKey) public legacySubgraphKeys; + + /// Store data for all NFT-based (v2) subgraphs. + /// subgraphID => SubgraphData + mapping(uint256 => IGNS.SubgraphData) public subgraphs; + + /// Contract that represents subgraph ownership through an NFT + ISubgraphNFT public subgraphNFT; +} + +/** + * @title GNSV3Storage + * @notice This contract holds all the storage variables for the base GNS contract, version 3. + * @dev Note that this is the first version that includes a storage gap - if adding + * future versions, make sure to move the gap to the new version and + * reduce the size of the gap accordingly. + */ +abstract contract GNSV3Storage is GNSV2Storage, Initializable { + /// Address of the counterpart GNS contract (L1GNS/L2GNS) + address public counterpartGNSAddress; + /// @dev Gap to allow adding variables in future upgrades (since L1GNS and L2GNS have their own storage as well) + uint256[50] private __gap; +} diff --git a/packages/contracts/contracts/discovery/IGNS.sol b/packages/contracts/contracts/discovery/IGNS.sol new file mode 100644 index 000000000..70b366d9b --- /dev/null +++ b/packages/contracts/contracts/discovery/IGNS.sol @@ -0,0 +1,218 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.7.6 || 0.8.27; + +/** + * @title Interface for GNS + */ +interface IGNS { + // -- Pool -- + + /** + * @dev The SubgraphData struct holds information about subgraphs + * and their signal; both nSignal (i.e. name signal at the GNS level) + * and vSignal (i.e. version signal at the Curation contract level) + */ + struct SubgraphData { + uint256 vSignal; // The token of the subgraph-deployment bonding curve + uint256 nSignal; // The token of the subgraph bonding curve + mapping(address => uint256) curatorNSignal; + bytes32 subgraphDeploymentID; + uint32 __DEPRECATED_reserveRatio; // solhint-disable-line var-name-mixedcase + bool disabled; + uint256 withdrawableGRT; + } + + /** + * @dev The LegacySubgraphKey struct holds the account and sequence ID + * used to generate subgraph IDs in legacy subgraphs. + */ + struct LegacySubgraphKey { + address account; + uint256 accountSeqID; + } + + // -- Configuration -- + + /** + * @notice Approve curation contract to pull funds. + */ + function approveAll() external; + + /** + * @notice Set the owner fee percentage. This is used to prevent a subgraph owner to drain all + * the name curators tokens while upgrading or deprecating and is configurable in parts per million. + * @param _ownerTaxPercentage Owner tax percentage + */ + function setOwnerTaxPercentage(uint32 _ownerTaxPercentage) external; + + // -- Publishing -- + + /** + * @notice Allows a graph account to set a default name + * @param _graphAccount Account that is setting its name + * @param _nameSystem Name system account already has ownership of a name in + * @param _nameIdentifier The unique identifier that is used to identify the name in the system + * @param _name The name being set as default + */ + function setDefaultName( + address _graphAccount, + uint8 _nameSystem, + bytes32 _nameIdentifier, + string calldata _name + ) external; + + /** + * @notice Allows a subgraph owner to update the metadata of a subgraph they have published + * @param _subgraphID Subgraph ID + * @param _subgraphMetadata IPFS hash for the subgraph metadata + */ + function updateSubgraphMetadata(uint256 _subgraphID, bytes32 _subgraphMetadata) external; + + /** + * @notice Publish a new subgraph. + * @param _subgraphDeploymentID Subgraph deployment for the subgraph + * @param _versionMetadata IPFS hash for the subgraph version metadata + * @param _subgraphMetadata IPFS hash for the subgraph metadata + */ + function publishNewSubgraph( + bytes32 _subgraphDeploymentID, + bytes32 _versionMetadata, + bytes32 _subgraphMetadata + ) external; + + /** + * @notice Publish a new version of an existing subgraph. + * @param _subgraphID Subgraph ID + * @param _subgraphDeploymentID Subgraph deployment ID of the new version + * @param _versionMetadata IPFS hash for the subgraph version metadata + */ + function publishNewVersion(uint256 _subgraphID, bytes32 _subgraphDeploymentID, bytes32 _versionMetadata) external; + + /** + * @notice Deprecate a subgraph. The bonding curve is destroyed, the vSignal is burned, and the GNS + * contract holds the GRT from burning the vSignal, which all curators can withdraw manually. + * Can only be done by the subgraph owner. + * @param _subgraphID Subgraph ID + */ + function deprecateSubgraph(uint256 _subgraphID) external; + + // -- Curation -- + + /** + * @notice Deposit GRT into a subgraph and mint signal. + * @param _subgraphID Subgraph ID + * @param _tokensIn The amount of tokens the nameCurator wants to deposit + * @param _nSignalOutMin Expected minimum amount of name signal to receive + */ + function mintSignal(uint256 _subgraphID, uint256 _tokensIn, uint256 _nSignalOutMin) external; + + /** + * @notice Burn signal for a subgraph and return the GRT. + * @param _subgraphID Subgraph ID + * @param _nSignal The amount of nSignal the nameCurator wants to burn + * @param _tokensOutMin Expected minimum amount of tokens to receive + */ + function burnSignal(uint256 _subgraphID, uint256 _nSignal, uint256 _tokensOutMin) external; + + /** + * @notice Move subgraph signal from sender to `_recipient` + * @param _subgraphID Subgraph ID + * @param _recipient Address to send the signal to + * @param _amount The amount of nSignal to transfer + */ + function transferSignal(uint256 _subgraphID, address _recipient, uint256 _amount) external; + + /** + * @notice Withdraw tokens from a deprecated subgraph. + * When the subgraph is deprecated, any curator can call this function and + * withdraw the GRT they are entitled for its original deposit + * @param _subgraphID Subgraph ID + */ + function withdraw(uint256 _subgraphID) external; + + // -- Getters -- + + /** + * @notice Return the owner of a subgraph. + * @param _tokenID Subgraph ID + * @return Owner address + */ + function ownerOf(uint256 _tokenID) external view returns (address); + + /** + * @notice Return the total signal on the subgraph. + * @param _subgraphID Subgraph ID + * @return Total signal on the subgraph + */ + function subgraphSignal(uint256 _subgraphID) external view returns (uint256); + + /** + * @notice Return the total tokens on the subgraph at current value. + * @param _subgraphID Subgraph ID + * @return Total tokens on the subgraph + */ + function subgraphTokens(uint256 _subgraphID) external view returns (uint256); + + /** + * @notice Calculate subgraph signal to be returned for an amount of tokens. + * @param _subgraphID Subgraph ID + * @param _tokensIn Tokens being exchanged for subgraph signal + * @return Amount of subgraph signal and curation tax + */ + function tokensToNSignal(uint256 _subgraphID, uint256 _tokensIn) external view returns (uint256, uint256, uint256); + + /** + * @notice Calculate tokens returned for an amount of subgraph signal. + * @param _subgraphID Subgraph ID + * @param _nSignalIn Subgraph signal being exchanged for tokens + * @return Amount of tokens returned for an amount of subgraph signal + */ + function nSignalToTokens(uint256 _subgraphID, uint256 _nSignalIn) external view returns (uint256, uint256); + + /** + * @notice Calculate subgraph signal to be returned for an amount of subgraph deployment signal. + * @param _subgraphID Subgraph ID + * @param _vSignalIn Amount of subgraph deployment signal to exchange for subgraph signal + * @return Amount of subgraph signal that can be bought + */ + function vSignalToNSignal(uint256 _subgraphID, uint256 _vSignalIn) external view returns (uint256); + + /** + * @notice Calculate subgraph deployment signal to be returned for an amount of subgraph signal. + * @param _subgraphID Subgraph ID + * @param _nSignalIn Subgraph signal being exchanged for subgraph deployment signal + * @return Amount of subgraph deployment signal that can be returned + */ + function nSignalToVSignal(uint256 _subgraphID, uint256 _nSignalIn) external view returns (uint256); + + /** + * @notice Get the amount of subgraph signal a curator has. + * @param _subgraphID Subgraph ID + * @param _curator Curator address + * @return Amount of subgraph signal owned by a curator + */ + function getCuratorSignal(uint256 _subgraphID, address _curator) external view returns (uint256); + + /** + * @notice Return whether a subgraph is published. + * @param _subgraphID Subgraph ID + * @return Return true if subgraph is currently published + */ + function isPublished(uint256 _subgraphID) external view returns (bool); + + /** + * @notice Return whether a subgraph is a legacy subgraph (created before subgraph NFTs). + * @param _subgraphID Subgraph ID + * @return Return true if subgraph is a legacy subgraph + */ + function isLegacySubgraph(uint256 _subgraphID) external view returns (bool); + + /** + * @notice Returns account and sequence ID for a legacy subgraph (created before subgraph NFTs). + * @param _subgraphID Subgraph ID + * @return account Account that created the subgraph (or 0 if it's not a legacy subgraph) + * @return seqID Sequence number for the subgraph + */ + function getLegacySubgraphKey(uint256 _subgraphID) external view returns (address account, uint256 seqID); +} diff --git a/packages/contracts/contracts/discovery/IServiceRegistry.sol b/packages/contracts/contracts/discovery/IServiceRegistry.sol new file mode 100644 index 000000000..724f7bebe --- /dev/null +++ b/packages/contracts/contracts/discovery/IServiceRegistry.sol @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.7.6 || 0.8.27; + +interface IServiceRegistry { + struct IndexerService { + string url; + string geohash; + } + + function register(string calldata _url, string calldata _geohash) external; + + function registerFor(address _indexer, string calldata _url, string calldata _geohash) external; + + function unregister() external; + + function unregisterFor(address _indexer) external; + + function isRegistered(address _indexer) external view returns (bool); +} diff --git a/packages/contracts/contracts/discovery/ISubgraphNFT.sol b/packages/contracts/contracts/discovery/ISubgraphNFT.sol new file mode 100644 index 000000000..6cef69297 --- /dev/null +++ b/packages/contracts/contracts/discovery/ISubgraphNFT.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.7.6 || 0.8.27; + +import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; + +interface ISubgraphNFT is IERC721 { + // -- Config -- + + function setMinter(address _minter) external; + + function setTokenDescriptor(address _tokenDescriptor) external; + + function setBaseURI(string memory _baseURI) external; + + // -- Actions -- + + function mint(address _to, uint256 _tokenId) external; + + function burn(uint256 _tokenId) external; + + function setSubgraphMetadata(uint256 _tokenId, bytes32 _subgraphMetadata) external; + + function tokenURI(uint256 _tokenId) external view returns (string memory); +} diff --git a/packages/contracts/contracts/discovery/ISubgraphNFTDescriptor.sol b/packages/contracts/contracts/discovery/ISubgraphNFTDescriptor.sol new file mode 100644 index 000000000..cd0785dcb --- /dev/null +++ b/packages/contracts/contracts/discovery/ISubgraphNFTDescriptor.sol @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.7.6; + +/// @title Describes subgraph NFT tokens via URI +interface ISubgraphNFTDescriptor { + /// @notice Produces the URI describing a particular token ID for a Subgraph + /// @dev Note this URI may be data: URI with the JSON contents directly inlined + /// @param _minter Address of the allowed minter + /// @param _tokenId The ID of the subgraph NFT for which to produce a description, which may not be valid + /// @param _baseURI The base URI that could be prefixed to the final URI + /// @param _subgraphMetadata Subgraph metadata set for the subgraph + /// @return The URI of the ERC721-compliant metadata + function tokenURI( + address _minter, + uint256 _tokenId, + string calldata _baseURI, + bytes32 _subgraphMetadata + ) external view returns (string memory); +} diff --git a/packages/contracts/contracts/discovery/L1GNS.sol b/packages/contracts/contracts/discovery/L1GNS.sol new file mode 100644 index 000000000..31e9b0fb3 --- /dev/null +++ b/packages/contracts/contracts/discovery/L1GNS.sol @@ -0,0 +1,181 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.7.6; +pragma abicoder v2; + +import { SafeMathUpgradeable } from "@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol"; + +import { GNS } from "./GNS.sol"; + +import { ITokenGateway } from "../arbitrum/ITokenGateway.sol"; +import { IL2GNS } from "../l2/discovery/IL2GNS.sol"; +import { IGraphToken } from "../token/IGraphToken.sol"; +import { L1GNSV1Storage } from "./L1GNSStorage.sol"; + +/** + * @title L1GNS + * @dev The Graph Name System contract provides a decentralized naming system for subgraphs + * used in the scope of the Graph Network. It translates Subgraphs into Subgraph Versions. + * Each version is associated with a Subgraph Deployment. The contract has no knowledge of + * human-readable names. All human readable names emitted in events. + * The contract implements a multicall behaviour to support batching multiple calls in a single + * transaction. + * This L1GNS variant includes some functions to allow transferring subgraphs to L2. + */ +contract L1GNS is GNS, L1GNSV1Storage { + using SafeMathUpgradeable for uint256; + + /// @dev Emitted when a subgraph was sent to L2 through the bridge + event SubgraphSentToL2( + uint256 indexed _subgraphID, + address indexed _l1Owner, + address indexed _l2Owner, + uint256 _tokens + ); + + /// @dev Emitted when a curator's balance for a subgraph was sent to L2 + event CuratorBalanceSentToL2( + uint256 indexed _subgraphID, + address indexed _l1Curator, + address indexed _l2Beneficiary, + uint256 _tokens + ); + + /** + * @notice Send a subgraph's data and tokens to L2. + * Use the Arbitrum SDK to estimate the L2 retryable ticket parameters. + * Note that any L2 gas/fee refunds will be lost, so the function only accepts + * the exact amount of ETH to cover _maxSubmissionCost + _maxGas * _gasPriceBid. + * @param _subgraphID Subgraph ID + * @param _l2Owner Address that will own the subgraph in L2 (could be the L1 owner, but could be different if the L1 owner is an L1 contract) + * @param _maxGas Max gas to use for the L2 retryable ticket + * @param _gasPriceBid Gas price bid for the L2 retryable ticket + * @param _maxSubmissionCost Max submission cost for the L2 retryable ticket + */ + function sendSubgraphToL2( + uint256 _subgraphID, + address _l2Owner, + uint256 _maxGas, + uint256 _gasPriceBid, + uint256 _maxSubmissionCost + ) external payable notPartialPaused { + require(!subgraphTransferredToL2[_subgraphID], "ALREADY_DONE"); + require(msg.value == _maxSubmissionCost.add(_maxGas.mul(_gasPriceBid)), "INVALID_ETH_VALUE"); + + SubgraphData storage subgraphData = _getSubgraphOrRevert(_subgraphID); + // This is just like onlySubgraphAuth, but we want it to run after the subgraphTransferredToL2 check + // to revert with a nicer message in that case: + require(ownerOf(_subgraphID) == msg.sender, "GNS: Must be authorized"); + subgraphTransferredToL2[_subgraphID] = true; + + uint256 curationTokens = curation().burn(subgraphData.subgraphDeploymentID, subgraphData.vSignal, 0); + subgraphData.disabled = true; + subgraphData.vSignal = 0; + + // We send only the subgraph owner's tokens and nsignal to L2, + // and for everyone else we set the withdrawableGRT so that they can choose + // to withdraw or transfer their signal. + uint256 ownerNSignal = subgraphData.curatorNSignal[msg.sender]; + uint256 totalSignal = subgraphData.nSignal; + + // Get owner share of tokens to be sent to L2 + uint256 tokensForL2 = ownerNSignal.mul(curationTokens).div(totalSignal); + // This leaves the subgraph as if it was deprecated, + // so other curators can withdraw: + subgraphData.curatorNSignal[msg.sender] = 0; + subgraphData.nSignal = totalSignal.sub(ownerNSignal); + subgraphData.withdrawableGRT = curationTokens.sub(tokensForL2); + + bytes memory extraData = abi.encode(uint8(IL2GNS.L1MessageCodes.RECEIVE_SUBGRAPH_CODE), _subgraphID, _l2Owner); + + _sendTokensAndMessageToL2GNS(tokensForL2, _maxGas, _gasPriceBid, _maxSubmissionCost, extraData); + + subgraphData.__DEPRECATED_reserveRatio = 0; + _burnNFT(_subgraphID); + emit SubgraphSentToL2(_subgraphID, msg.sender, _l2Owner, tokensForL2); + } + + /** + * @notice Send the balance for a curator's signal in a subgraph that was + * transferred to L2, using the L1GraphTokenGateway. + * The balance will be claimed for a beneficiary address, as this method can be + * used by curators that use a contract address in L1 that may not exist in L2. + * This will set the curator's signal on L1 to zero, so the caller must ensure + * that the retryable ticket is redeemed before expiration, or the signal will be lost. + * It is up to the caller to verify that the subgraph transfer was finished in L2, + * but if it wasn't, the tokens will be sent to the beneficiary in L2. + * Note that any L2 gas/fee refunds will be lost, so the function only accepts + * the exact amount of ETH to cover _maxSubmissionCost + _maxGas * _gasPriceBid. + * @dev Use the Arbitrum SDK to estimate the L2 retryable ticket parameters. + * @param _subgraphID Subgraph ID + * @param _beneficiary Address that will receive the tokens in L2 + * @param _maxGas Max gas to use for the L2 retryable ticket + * @param _gasPriceBid Gas price bid for the L2 retryable ticket + * @param _maxSubmissionCost Max submission cost for the L2 retryable ticket + */ + function sendCuratorBalanceToBeneficiaryOnL2( + uint256 _subgraphID, + address _beneficiary, + uint256 _maxGas, + uint256 _gasPriceBid, + uint256 _maxSubmissionCost + ) external payable notPartialPaused { + require(subgraphTransferredToL2[_subgraphID], "!TRANSFERRED"); + require(msg.value == _maxSubmissionCost.add(_maxGas.mul(_gasPriceBid)), "INVALID_ETH_VALUE"); + // The Arbitrum bridge will check this too, we just check here for an early exit + require(_maxSubmissionCost != 0, "NO_SUBMISSION_COST"); + + SubgraphData storage subgraphData = _getSubgraphData(_subgraphID); + uint256 curatorNSignal = subgraphData.curatorNSignal[msg.sender]; + require(curatorNSignal != 0, "NO_SIGNAL"); + uint256 subgraphNSignal = subgraphData.nSignal; + require(subgraphNSignal != 0, "NO_SUBGRAPH_SIGNAL"); + + uint256 withdrawableGRT = subgraphData.withdrawableGRT; + uint256 tokensForL2 = curatorNSignal.mul(withdrawableGRT).div(subgraphNSignal); + bytes memory extraData = abi.encode( + uint8(IL2GNS.L1MessageCodes.RECEIVE_CURATOR_BALANCE_CODE), + _subgraphID, + _beneficiary + ); + + // Set the subgraph as if the curator had withdrawn their tokens + subgraphData.curatorNSignal[msg.sender] = 0; + subgraphData.nSignal = subgraphNSignal.sub(curatorNSignal); + subgraphData.withdrawableGRT = withdrawableGRT.sub(tokensForL2); + + // Send the tokens and data to L2 using the L1GraphTokenGateway + _sendTokensAndMessageToL2GNS(tokensForL2, _maxGas, _gasPriceBid, _maxSubmissionCost, extraData); + emit CuratorBalanceSentToL2(_subgraphID, msg.sender, _beneficiary, tokensForL2); + } + + /** + * @notice Sends a message to the L2GNS with some extra data, + * also sending some tokens, using the L1GraphTokenGateway. + * @param _tokens Amount of tokens to send to L2 + * @param _maxGas Max gas to use for the L2 retryable ticket + * @param _gasPriceBid Gas price bid for the L2 retryable ticket + * @param _maxSubmissionCost Max submission cost for the L2 retryable ticket + * @param _extraData Extra data for the callhook on L2GNS + */ + function _sendTokensAndMessageToL2GNS( + uint256 _tokens, + uint256 _maxGas, + uint256 _gasPriceBid, + uint256 _maxSubmissionCost, + bytes memory _extraData + ) internal { + bytes memory data = abi.encode(_maxSubmissionCost, _extraData); + IGraphToken grt = graphToken(); + ITokenGateway gateway = graphTokenGateway(); + grt.approve(address(gateway), _tokens); + gateway.outboundTransfer{ value: msg.value }( + address(grt), + counterpartGNSAddress, + _tokens, + _maxGas, + _gasPriceBid, + data + ); + } +} diff --git a/packages/contracts/contracts/discovery/L1GNSStorage.sol b/packages/contracts/contracts/discovery/L1GNSStorage.sol new file mode 100644 index 000000000..557814513 --- /dev/null +++ b/packages/contracts/contracts/discovery/L1GNSStorage.sol @@ -0,0 +1,17 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.7.6; +pragma abicoder v2; + +/** + * @title L1GNSV1Storage + * @notice This contract holds all the L1-specific storage variables for the L1GNS contract, version 1 + * @dev When adding new versions, make sure to move the gap to the new version and + * reduce the size of the gap accordingly. + */ +abstract contract L1GNSV1Storage { + /// True for subgraph IDs that have been transferred to L2 + mapping(uint256 => bool) public subgraphTransferredToL2; + /// @dev Storage gap to keep storage slots fixed in future versions + uint256[50] private __gap; +} diff --git a/contracts/discovery/ServiceRegistry.sol b/packages/contracts/contracts/discovery/ServiceRegistry.sol similarity index 87% rename from contracts/discovery/ServiceRegistry.sol rename to packages/contracts/contracts/discovery/ServiceRegistry.sol index 7fe93045b..1eb1393d3 100644 --- a/contracts/discovery/ServiceRegistry.sol +++ b/packages/contracts/contracts/discovery/ServiceRegistry.sol @@ -1,7 +1,7 @@ -// SPDX-License-Identifier: MIT +// SPDX-License-Identifier: GPL-2.0-or-later -pragma solidity ^0.7.3; -pragma experimental ABIEncoderV2; +pragma solidity ^0.7.6; +pragma abicoder v2; import "../governance/Managed.sol"; import "../upgrades/GraphUpgradeable.sol"; @@ -49,11 +49,7 @@ contract ServiceRegistry is ServiceRegistryV1Storage, GraphUpgradeable, IService * @param _url URL of the indexer service * @param _geohash Geohash of the indexer service location */ - function registerFor( - address _indexer, - string calldata _url, - string calldata _geohash - ) external override { + function registerFor(address _indexer, string calldata _url, string calldata _geohash) external override { _register(_indexer, _url, _geohash); } @@ -63,11 +59,7 @@ contract ServiceRegistry is ServiceRegistryV1Storage, GraphUpgradeable, IService * @param _url URL of the indexer service * @param _geohash Geohash of the indexer service location */ - function _register( - address _indexer, - string calldata _url, - string calldata _geohash - ) private { + function _register(address _indexer, string calldata _url, string calldata _geohash) private { require(_isAuth(_indexer), "!auth"); require(bytes(_url).length > 0, "Service must specify a URL"); @@ -107,7 +99,7 @@ contract ServiceRegistry is ServiceRegistryV1Storage, GraphUpgradeable, IService * @dev Return the registration status of an indexer service * @return True if the indexer service is registered */ - function isRegistered(address _indexer) public override view returns (bool) { + function isRegistered(address _indexer) public view override returns (bool) { return bytes(services[_indexer].url).length > 0; } } diff --git a/contracts/discovery/ServiceRegistryStorage.sol b/packages/contracts/contracts/discovery/ServiceRegistryStorage.sol similarity index 75% rename from contracts/discovery/ServiceRegistryStorage.sol rename to packages/contracts/contracts/discovery/ServiceRegistryStorage.sol index f0ad6f078..1cd484970 100644 --- a/contracts/discovery/ServiceRegistryStorage.sol +++ b/packages/contracts/contracts/discovery/ServiceRegistryStorage.sol @@ -1,6 +1,6 @@ -// SPDX-License-Identifier: MIT +// SPDX-License-Identifier: GPL-2.0-or-later -pragma solidity ^0.7.3; +pragma solidity ^0.7.6; import "../governance/Managed.sol"; diff --git a/packages/contracts/contracts/discovery/SubgraphNFT.sol b/packages/contracts/contracts/discovery/SubgraphNFT.sol new file mode 100644 index 000000000..3c514718c --- /dev/null +++ b/packages/contracts/contracts/discovery/SubgraphNFT.sol @@ -0,0 +1,152 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.7.6; + +import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; +import "@openzeppelin/contracts/utils/Address.sol"; + +import "../governance/Governed.sol"; +import "../libraries/HexStrings.sol"; +import "./ISubgraphNFT.sol"; +import "./ISubgraphNFTDescriptor.sol"; + +/// @title NFT that represents ownership of a Subgraph +contract SubgraphNFT is Governed, ERC721, ISubgraphNFT { + // -- State -- + + address public minter; + ISubgraphNFTDescriptor public tokenDescriptor; + mapping(uint256 => bytes32) private _subgraphMetadataHashes; + + // -- Events -- + + event MinterUpdated(address minter); + event TokenDescriptorUpdated(address tokenDescriptor); + event SubgraphMetadataUpdated(uint256 indexed tokenID, bytes32 subgraphURI); + + // -- Modifiers -- + + modifier onlyMinter() { + require(msg.sender == minter, "Must be a minter"); + _; + } + + constructor(address _governor) ERC721("Subgraph", "SG") { + _initialize(_governor); + } + + // -- Config -- + + /** + * @notice Set the minter allowed to perform actions on the NFT. + * @dev Minter can mint, burn and update the metadata + * @param _minter Address of the allowed minter + */ + function setMinter(address _minter) external override onlyGovernor { + _setMinter(_minter); + } + + /** + * @notice Internal: Set the minter allowed to perform actions on the NFT. + * @dev Minter can mint, burn and update the metadata. Can be set to zero. + * @param _minter Address of the allowed minter + */ + function _setMinter(address _minter) internal { + minter = _minter; + emit MinterUpdated(_minter); + } + + /** + * @notice Set the token descriptor contract. + * @dev Token descriptor can be zero. If set, it must be a contract. + * @param _tokenDescriptor Address of the contract that creates the NFT token URI + */ + function setTokenDescriptor(address _tokenDescriptor) external override onlyGovernor { + _setTokenDescriptor(_tokenDescriptor); + } + + /** + * @dev Internal: Set the token descriptor contract used to create the ERC-721 metadata URI. + * @param _tokenDescriptor Address of the contract that creates the NFT token URI + */ + function _setTokenDescriptor(address _tokenDescriptor) internal { + require( + _tokenDescriptor == address(0) || Address.isContract(_tokenDescriptor), + "NFT: Invalid token descriptor" + ); + tokenDescriptor = ISubgraphNFTDescriptor(_tokenDescriptor); + emit TokenDescriptorUpdated(_tokenDescriptor); + } + + /** + * @notice Set the base URI. + * @dev Can be set to empty. + * @param _baseURI Base URI to use to build the token URI + */ + function setBaseURI(string memory _baseURI) external override onlyGovernor { + _setBaseURI(_baseURI); + } + + // -- Minter actions -- + + /** + * @notice Mint `_tokenId` and transfers it to `_to`. + * @dev `tokenId` must not exist and `to` cannot be the zero address. + * @param _to Address receiving the minted NFT + * @param _tokenId ID of the NFT + */ + function mint(address _to, uint256 _tokenId) external override onlyMinter { + _mint(_to, _tokenId); + } + + /** + * @notice Burn `_tokenId`. + * @dev The approval is cleared when the token is burned. + * @param _tokenId ID of the NFT + */ + function burn(uint256 _tokenId) external override onlyMinter { + _burn(_tokenId); + } + + /** + * @notice Set the metadata for a subgraph represented by `_tokenId`. + * @dev `_tokenId` must exist. + * @param _tokenId ID of the NFT + * @param _subgraphMetadata IPFS hash for the metadata + */ + function setSubgraphMetadata(uint256 _tokenId, bytes32 _subgraphMetadata) external override onlyMinter { + require(_exists(_tokenId), "ERC721Metadata: URI set of nonexistent token"); + _subgraphMetadataHashes[_tokenId] = _subgraphMetadata; + emit SubgraphMetadataUpdated(_tokenId, _subgraphMetadata); + } + + // -- NFT display -- + + /// @inheritdoc ERC721 + function tokenURI(uint256 _tokenId) public view override(ERC721, ISubgraphNFT) returns (string memory) { + require(_exists(_tokenId), "ERC721Metadata: URI query for nonexistent token"); + + // Delegates rendering of the metadata to the token descriptor if existing + // This allows for some flexibility in adapting the token URI + if (address(tokenDescriptor) != address(0)) { + return tokenDescriptor.tokenURI(minter, _tokenId, baseURI(), _subgraphMetadataHashes[_tokenId]); + } + + // Default token URI + uint256 metadata = uint256(_subgraphMetadataHashes[_tokenId]); + + string memory _subgraphURI = metadata > 0 ? HexStrings.toString(metadata) : ""; + string memory base = baseURI(); + + // If there is no base URI, return the token URI. + if (bytes(base).length == 0) { + return _subgraphURI; + } + // If both are set, concatenate the baseURI and tokenURI (via abi.encodePacked). + if (bytes(_subgraphURI).length > 0) { + return string(abi.encodePacked(base, _subgraphURI)); + } + // If there is a baseURI but no tokenURI, concatenate the tokenID to the baseURI. + return string(abi.encodePacked(base, HexStrings.toString(_tokenId))); + } +} diff --git a/packages/contracts/contracts/discovery/SubgraphNFTDescriptor.sol b/packages/contracts/contracts/discovery/SubgraphNFTDescriptor.sol new file mode 100644 index 000000000..81f6da696 --- /dev/null +++ b/packages/contracts/contracts/discovery/SubgraphNFTDescriptor.sol @@ -0,0 +1,23 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.7.6; + +import "../libraries/Base58Encoder.sol"; +import "./ISubgraphNFTDescriptor.sol"; + +/// @title Describes subgraph NFT tokens via URI +contract SubgraphNFTDescriptor is ISubgraphNFTDescriptor { + /// @inheritdoc ISubgraphNFTDescriptor + function tokenURI( + address /* _minter */, + uint256 /* _tokenId */, + string calldata _baseURI, + bytes32 _subgraphMetadata + ) external pure override returns (string memory) { + bytes memory b58 = Base58Encoder.encode(abi.encodePacked(Base58Encoder.sha256MultiHash, _subgraphMetadata)); + if (bytes(_baseURI).length == 0) { + return string(b58); + } + return string(abi.encodePacked(_baseURI, b58)); + } +} diff --git a/contracts/discovery/erc1056/EthereumDIDRegistry.sol b/packages/contracts/contracts/discovery/erc1056/EthereumDIDRegistry.sol similarity index 78% rename from contracts/discovery/erc1056/EthereumDIDRegistry.sol rename to packages/contracts/contracts/discovery/erc1056/EthereumDIDRegistry.sol index d48b966f8..e8545dd4a 100644 --- a/contracts/discovery/erc1056/EthereumDIDRegistry.sol +++ b/packages/contracts/contracts/discovery/erc1056/EthereumDIDRegistry.sol @@ -10,7 +10,7 @@ As well as all testnets // SPDX-License-Identifier: Apache-2.0 -pragma solidity ^0.7.3; +pragma solidity ^0.7.6; contract EthereumDIDRegistry { mapping(address => address) public owners; @@ -62,21 +62,13 @@ contract EthereumDIDRegistry { return signer; } - function validDelegate( - address identity, - bytes32 delegateType, - address delegate - ) public view returns (bool) { + function validDelegate(address identity, bytes32 delegateType, address delegate) public view returns (bool) { uint256 validity = delegates[identity][keccak256(abi.encode(delegateType))][delegate]; /* solium-disable-next-line security/no-block-members*/ return (validity > block.timestamp); } - function changeOwner( - address identity, - address actor, - address newOwner - ) internal onlyOwner(identity, actor) { + function changeOwner(address identity, address actor, address newOwner) internal onlyOwner(identity, actor) { owners[identity] = newOwner; emit DIDOwnerChanged(identity, newOwner, changed[identity]); changed[identity] = block.number; @@ -86,13 +78,7 @@ contract EthereumDIDRegistry { changeOwner(identity, msg.sender, newOwner); } - function changeOwnerSigned( - address identity, - uint8 sigV, - bytes32 sigR, - bytes32 sigS, - address newOwner - ) public { + function changeOwnerSigned(address identity, uint8 sigV, bytes32 sigR, bytes32 sigS, address newOwner) public { bytes32 hash = keccak256( abi.encodePacked( bytes1(0x19), @@ -115,9 +101,7 @@ contract EthereumDIDRegistry { uint256 validity ) internal onlyOwner(identity, actor) { /* solium-disable-next-line security/no-block-members*/ - delegates[identity][keccak256(abi.encode(delegateType))][delegate] = - block.timestamp + - validity; + delegates[identity][keccak256(abi.encode(delegateType))][delegate] = block.timestamp + validity; emit DIDDelegateChanged( identity, delegateType, @@ -129,12 +113,7 @@ contract EthereumDIDRegistry { changed[identity] = block.number; } - function addDelegate( - address identity, - bytes32 delegateType, - address delegate, - uint256 validity - ) public { + function addDelegate(address identity, bytes32 delegateType, address delegate, uint256 validity) public { addDelegate(identity, msg.sender, delegateType, delegate, validity); } @@ -160,13 +139,7 @@ contract EthereumDIDRegistry { validity ) ); - addDelegate( - identity, - checkSignature(identity, sigV, sigR, sigS, hash), - delegateType, - delegate, - validity - ); + addDelegate(identity, checkSignature(identity, sigV, sigR, sigS, hash), delegateType, delegate, validity); } function revokeDelegate( @@ -178,21 +151,11 @@ contract EthereumDIDRegistry { /* solium-disable-next-line security/no-block-members*/ delegates[identity][keccak256(abi.encode(delegateType))][delegate] = block.timestamp; /* solium-disable-next-line security/no-block-members*/ - emit DIDDelegateChanged( - identity, - delegateType, - delegate, - block.timestamp, - changed[identity] - ); + emit DIDDelegateChanged(identity, delegateType, delegate, block.timestamp, changed[identity]); changed[identity] = block.number; } - function revokeDelegate( - address identity, - bytes32 delegateType, - address delegate - ) public { + function revokeDelegate(address identity, bytes32 delegateType, address delegate) public { revokeDelegate(identity, msg.sender, delegateType, delegate); } @@ -216,12 +179,7 @@ contract EthereumDIDRegistry { delegate ) ); - revokeDelegate( - identity, - checkSignature(identity, sigV, sigR, sigS, hash), - delegateType, - delegate - ); + revokeDelegate(identity, checkSignature(identity, sigV, sigR, sigS, hash), delegateType, delegate); } function setAttribute( @@ -232,22 +190,11 @@ contract EthereumDIDRegistry { uint256 validity ) internal onlyOwner(identity, actor) { /* solium-disable-next-line security/no-block-members*/ - emit DIDAttributeChanged( - identity, - name, - value, - block.timestamp + validity, - changed[identity] - ); + emit DIDAttributeChanged(identity, name, value, block.timestamp + validity, changed[identity]); changed[identity] = block.number; } - function setAttribute( - address identity, - bytes32 name, - bytes memory value, - uint256 validity - ) public { + function setAttribute(address identity, bytes32 name, bytes memory value, uint256 validity) public { setAttribute(identity, msg.sender, name, value, validity); } @@ -273,13 +220,7 @@ contract EthereumDIDRegistry { validity ) ); - setAttribute( - identity, - checkSignature(identity, sigV, sigR, sigS, hash), - name, - value, - validity - ); + setAttribute(identity, checkSignature(identity, sigV, sigR, sigS, hash), name, value, validity); } function revokeAttribute( @@ -292,11 +233,7 @@ contract EthereumDIDRegistry { changed[identity] = block.number; } - function revokeAttribute( - address identity, - bytes32 name, - bytes memory value - ) public { + function revokeAttribute(address identity, bytes32 name, bytes memory value) public { revokeAttribute(identity, msg.sender, name, value); } diff --git a/packages/contracts/contracts/discovery/erc1056/IEthereumDIDRegistry.sol b/packages/contracts/contracts/discovery/erc1056/IEthereumDIDRegistry.sol new file mode 100644 index 000000000..8de69f304 --- /dev/null +++ b/packages/contracts/contracts/discovery/erc1056/IEthereumDIDRegistry.sol @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: Apache-2.0 + +pragma solidity ^0.7.6; + +interface IEthereumDIDRegistry { + function identityOwner(address identity) external view returns (address); + + function setAttribute(address identity, bytes32 name, bytes calldata value, uint256 validity) external; +} diff --git a/packages/contracts/contracts/disputes/DisputeManager.sol b/packages/contracts/contracts/disputes/DisputeManager.sol new file mode 100644 index 000000000..013a21b03 --- /dev/null +++ b/packages/contracts/contracts/disputes/DisputeManager.sol @@ -0,0 +1,760 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.7.6; +pragma abicoder v2; + +import "@openzeppelin/contracts/math/SafeMath.sol"; +import "@openzeppelin/contracts/cryptography/ECDSA.sol"; + +import "../governance/Managed.sol"; +import "../upgrades/GraphUpgradeable.sol"; +import "../utils/TokenUtils.sol"; + +import "./DisputeManagerStorage.sol"; +import "./IDisputeManager.sol"; + +/* + * @title DisputeManager + * @notice Provides a way to align the incentives of participants by having slashing as deterrent + * for incorrect behaviour. + * + * There are two types of disputes that can be created: Query disputes and Indexing disputes. + * + * Query Disputes: + * Graph nodes receive queries and return responses with signed receipts called attestations. + * An attestation can be disputed if the consumer thinks the query response was invalid. + * Indexers use the derived private key for an allocation to sign attestations. + * + * Indexing Disputes: + * Indexers present a Proof of Indexing (POI) when they close allocations to prove + * they were indexing a subgraph. The Staking contract emits that proof with the format + * keccak256(indexer.address, POI). + * Any challenger can dispute the validity of a POI by submitting a dispute to this contract + * along with a deposit. + * + * Arbitration: + * Disputes can only be accepted, rejected or drawn by the arbitrator role that can be delegated + * to a EOA or DAO. + */ +contract DisputeManager is DisputeManagerV1Storage, GraphUpgradeable, IDisputeManager { + using SafeMath for uint256; + + // -- EIP-712 -- + + bytes32 private constant DOMAIN_TYPE_HASH = + keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract,bytes32 salt)"); + bytes32 private constant DOMAIN_NAME_HASH = keccak256("Graph Protocol"); + bytes32 private constant DOMAIN_VERSION_HASH = keccak256("0"); + bytes32 private constant DOMAIN_SALT = 0xa070ffb1cd7409649bf77822cce74495468e06dbfaef09556838bf188679b9c2; + bytes32 private constant RECEIPT_TYPE_HASH = + keccak256("Receipt(bytes32 requestCID,bytes32 responseCID,bytes32 subgraphDeploymentID)"); + + // -- Constants -- + + // Attestation size is the sum of the receipt (96) + signature (65) + uint256 private constant ATTESTATION_SIZE_BYTES = RECEIPT_SIZE_BYTES + SIG_SIZE_BYTES; + uint256 private constant RECEIPT_SIZE_BYTES = 96; + + uint256 private constant SIG_R_LENGTH = 32; + uint256 private constant SIG_S_LENGTH = 32; + uint256 private constant SIG_V_LENGTH = 1; + uint256 private constant SIG_R_OFFSET = RECEIPT_SIZE_BYTES; + uint256 private constant SIG_S_OFFSET = RECEIPT_SIZE_BYTES + SIG_R_LENGTH; + uint256 private constant SIG_V_OFFSET = RECEIPT_SIZE_BYTES + SIG_R_LENGTH + SIG_S_LENGTH; + uint256 private constant SIG_SIZE_BYTES = SIG_R_LENGTH + SIG_S_LENGTH + SIG_V_LENGTH; + + uint256 private constant UINT8_BYTE_LENGTH = 1; + uint256 private constant BYTES32_BYTE_LENGTH = 32; + + uint256 private constant MAX_PPM = 1000000; // 100% in parts per million + + // -- Events -- + + /** + * @dev Emitted when a query dispute is created for `subgraphDeploymentID` and `indexer` + * by `fisherman`. + * The event emits the amount of `tokens` deposited by the fisherman and `attestation` submitted. + */ + event QueryDisputeCreated( + bytes32 indexed disputeID, + address indexed indexer, + address indexed fisherman, + uint256 tokens, + bytes32 subgraphDeploymentID, + bytes attestation + ); + + /** + * @dev Emitted when an indexing dispute is created for `allocationID` and `indexer` + * by `fisherman`. + * The event emits the amount of `tokens` deposited by the fisherman. + */ + event IndexingDisputeCreated( + bytes32 indexed disputeID, + address indexed indexer, + address indexed fisherman, + uint256 tokens, + address allocationID + ); + + /** + * @dev Emitted when arbitrator accepts a `disputeID` to `indexer` created by `fisherman`. + * The event emits the amount `tokens` transferred to the fisherman, the deposit plus reward. + */ + event DisputeAccepted( + bytes32 indexed disputeID, + address indexed indexer, + address indexed fisherman, + uint256 tokens + ); + + /** + * @dev Emitted when arbitrator rejects a `disputeID` for `indexer` created by `fisherman`. + * The event emits the amount `tokens` burned from the fisherman deposit. + */ + event DisputeRejected( + bytes32 indexed disputeID, + address indexed indexer, + address indexed fisherman, + uint256 tokens + ); + + /** + * @dev Emitted when arbitrator draw a `disputeID` for `indexer` created by `fisherman`. + * The event emits the amount `tokens` used as deposit and returned to the fisherman. + */ + event DisputeDrawn(bytes32 indexed disputeID, address indexed indexer, address indexed fisherman, uint256 tokens); + + /** + * @dev Emitted when two disputes are in conflict to link them. + * This event will be emitted after each DisputeCreated event is emitted + * for each of the individual disputes. + */ + event DisputeLinked(bytes32 indexed disputeID1, bytes32 indexed disputeID2); + + // -- Modifiers -- + + function _onlyArbitrator() internal view { + require(msg.sender == arbitrator, "Caller is not the Arbitrator"); + } + + /** + * @dev Check if the caller is the arbitrator. + */ + modifier onlyArbitrator() { + _onlyArbitrator(); + _; + } + + modifier onlyPendingDispute(bytes32 _disputeID) { + require(isDisputeCreated(_disputeID), "Dispute does not exist"); + require(disputes[_disputeID].status == IDisputeManager.DisputeStatus.Pending, "Dispute must be pending"); + _; + } + + // -- Functions -- + + /** + * @dev Initialize this contract. + * @param _arbitrator Arbitrator role + * @param _minimumDeposit Minimum deposit required to create a Dispute + * @param _fishermanRewardPercentage Percent of slashed funds for fisherman (ppm) + * @param _qrySlashingPercentage Percentage of indexer stake slashed for query disputes (ppm) + * @param _idxSlashingPercentage Percentage of indexer stake slashed for indexing disputes (ppm) + */ + function initialize( + address _controller, + address _arbitrator, + uint256 _minimumDeposit, + uint32 _fishermanRewardPercentage, + uint32 _qrySlashingPercentage, + uint32 _idxSlashingPercentage + ) external onlyImpl { + Managed._initialize(_controller); + + // Settings + _setArbitrator(_arbitrator); + _setMinimumDeposit(_minimumDeposit); + _setFishermanRewardPercentage(_fishermanRewardPercentage); + _setSlashingPercentage(_qrySlashingPercentage, _idxSlashingPercentage); + + // EIP-712 domain separator + DOMAIN_SEPARATOR = keccak256( + abi.encode( + DOMAIN_TYPE_HASH, + DOMAIN_NAME_HASH, + DOMAIN_VERSION_HASH, + _getChainID(), + address(this), + DOMAIN_SALT + ) + ); + } + + /** + * @dev Set the arbitrator address. + * @notice Update the arbitrator to `_arbitrator` + * @param _arbitrator The address of the arbitration contract or party + */ + function setArbitrator(address _arbitrator) external override onlyGovernor { + _setArbitrator(_arbitrator); + } + + /** + * @dev Internal: Set the arbitrator address. + * @notice Update the arbitrator to `_arbitrator` + * @param _arbitrator The address of the arbitration contract or party + */ + function _setArbitrator(address _arbitrator) private { + require(_arbitrator != address(0), "Arbitrator must be set"); + arbitrator = _arbitrator; + emit ParameterUpdated("arbitrator"); + } + + /** + * @dev Set the minimum deposit required to create a dispute. + * @notice Update the minimum deposit to `_minimumDeposit` Graph Tokens + * @param _minimumDeposit The minimum deposit in Graph Tokens + */ + function setMinimumDeposit(uint256 _minimumDeposit) external override onlyGovernor { + _setMinimumDeposit(_minimumDeposit); + } + + /** + * @dev Internal: Set the minimum deposit required to create a dispute. + * @notice Update the minimum deposit to `_minimumDeposit` Graph Tokens + * @param _minimumDeposit The minimum deposit in Graph Tokens + */ + function _setMinimumDeposit(uint256 _minimumDeposit) private { + require(_minimumDeposit > 0, "Minimum deposit must be set"); + minimumDeposit = _minimumDeposit; + emit ParameterUpdated("minimumDeposit"); + } + + /** + * @dev Set the percent reward that the fisherman gets when slashing occurs. + * @notice Update the reward percentage to `_percentage` + * @param _percentage Reward as a percentage of indexer stake + */ + function setFishermanRewardPercentage(uint32 _percentage) external override onlyGovernor { + _setFishermanRewardPercentage(_percentage); + } + + /** + * @dev Internal: Set the percent reward that the fisherman gets when slashing occurs. + * @notice Update the reward percentage to `_percentage` + * @param _percentage Reward as a percentage of indexer stake + */ + function _setFishermanRewardPercentage(uint32 _percentage) private { + // Must be within 0% to 100% (inclusive) + require(_percentage <= MAX_PPM, "Reward percentage must be below or equal to MAX_PPM"); + fishermanRewardPercentage = _percentage; + emit ParameterUpdated("fishermanRewardPercentage"); + } + + /** + * @dev Set the percentage used for slashing indexers. + * @param _qryPercentage Percentage slashing for query disputes + * @param _idxPercentage Percentage slashing for indexing disputes + */ + function setSlashingPercentage(uint32 _qryPercentage, uint32 _idxPercentage) external override onlyGovernor { + _setSlashingPercentage(_qryPercentage, _idxPercentage); + } + + /** + * @dev Internal: Set the percentage used for slashing indexers. + * @param _qryPercentage Percentage slashing for query disputes + * @param _idxPercentage Percentage slashing for indexing disputes + */ + function _setSlashingPercentage(uint32 _qryPercentage, uint32 _idxPercentage) private { + // Must be within 0% to 100% (inclusive) + require( + _qryPercentage <= MAX_PPM && _idxPercentage <= MAX_PPM, + "Slashing percentage must be below or equal to MAX_PPM" + ); + qrySlashingPercentage = _qryPercentage; + idxSlashingPercentage = _idxPercentage; + emit ParameterUpdated("qrySlashingPercentage"); + emit ParameterUpdated("idxSlashingPercentage"); + } + + /** + * @dev Return whether a dispute exists or not. + * @notice Return if dispute with ID `_disputeID` exists + * @param _disputeID True if dispute already exists + */ + function isDisputeCreated(bytes32 _disputeID) public view override returns (bool) { + return disputes[_disputeID].status != DisputeStatus.Null; + } + + /** + * @dev Get the message hash that an indexer used to sign the receipt. + * Encodes a receipt using a domain separator, as described on + * https://github.com/ethereum/EIPs/blob/master/EIPS/eip-712.md#specification. + * @notice Return the message hash used to sign the receipt + * @param _receipt Receipt returned by indexer and submitted by fisherman + * @return Message hash used to sign the receipt + */ + function encodeHashReceipt(Receipt memory _receipt) public view override returns (bytes32) { + return + keccak256( + abi.encodePacked( + "\x19\x01", // EIP-191 encoding pad, EIP-712 version 1 + DOMAIN_SEPARATOR, + keccak256( + abi.encode( + RECEIPT_TYPE_HASH, + _receipt.requestCID, + _receipt.responseCID, + _receipt.subgraphDeploymentID + ) // EIP 712-encoded message hash + ) + ) + ); + } + + /** + * @dev Returns if two attestations are conflicting. + * Everything must match except for the responseID. + * @param _attestation1 Attestation + * @param _attestation2 Attestation + * @return True if the two attestations are conflicting + */ + function areConflictingAttestations( + Attestation memory _attestation1, + Attestation memory _attestation2 + ) public pure override returns (bool) { + return (_attestation1.requestCID == _attestation2.requestCID && + _attestation1.subgraphDeploymentID == _attestation2.subgraphDeploymentID && + _attestation1.responseCID != _attestation2.responseCID); + } + + /** + * @dev Returns the indexer that signed an attestation. + * @param _attestation Attestation + * @return Indexer address + */ + function getAttestationIndexer(Attestation memory _attestation) public view override returns (address) { + // Get attestation signer. Indexers signs with the allocationID + address allocationID = _recoverAttestationSigner(_attestation); + + IStaking.Allocation memory alloc = staking().getAllocation(allocationID); + require(alloc.indexer != address(0), "Indexer cannot be found for the attestation"); + require( + alloc.subgraphDeploymentID == _attestation.subgraphDeploymentID, + "Allocation and attestation subgraphDeploymentID must match" + ); + return alloc.indexer; + } + + /** + * @dev Create a query dispute for the arbitrator to resolve. + * This function is called by a fisherman that will need to `_deposit` at + * least `minimumDeposit` GRT tokens. + * @param _attestationData Attestation bytes submitted by the fisherman + * @param _deposit Amount of tokens staked as deposit + */ + function createQueryDispute(bytes calldata _attestationData, uint256 _deposit) external override returns (bytes32) { + // Get funds from submitter + _pullSubmitterDeposit(_deposit); + + // Create a dispute + return + _createQueryDisputeWithAttestation( + msg.sender, + _deposit, + _parseAttestation(_attestationData), + _attestationData + ); + } + + /** + * @dev Create query disputes for two conflicting attestations. + * A conflicting attestation is a proof presented by two different indexers + * where for the same request on a subgraph the response is different. + * For this type of dispute the submitter is not required to present a deposit + * as one of the attestation is considered to be right. + * Two linked disputes will be created and if the arbitrator resolve one, the other + * one will be automatically resolved. + * @param _attestationData1 First attestation data submitted + * @param _attestationData2 Second attestation data submitted + * @return DisputeID1, DisputeID2 + */ + function createQueryDisputeConflict( + bytes calldata _attestationData1, + bytes calldata _attestationData2 + ) external override returns (bytes32, bytes32) { + address fisherman = msg.sender; + + // Parse each attestation + Attestation memory attestation1 = _parseAttestation(_attestationData1); + Attestation memory attestation2 = _parseAttestation(_attestationData2); + + // Test that attestations are conflicting + require(areConflictingAttestations(attestation1, attestation2), "Attestations must be in conflict"); + + // Create the disputes + // The deposit is zero for conflicting attestations + bytes32 dID1 = _createQueryDisputeWithAttestation(fisherman, 0, attestation1, _attestationData1); + bytes32 dID2 = _createQueryDisputeWithAttestation(fisherman, 0, attestation2, _attestationData2); + + // Store the linked disputes to be resolved + disputes[dID1].relatedDisputeID = dID2; + disputes[dID2].relatedDisputeID = dID1; + + // Emit event that links the two created disputes + emit DisputeLinked(dID1, dID2); + + return (dID1, dID2); + } + + /** + * @dev Create a query dispute passing the parsed attestation. + * To be used in createQueryDispute() and createQueryDisputeConflict() + * to avoid calling parseAttestation() multiple times + * `_attestationData` is only passed to be emitted + * @param _fisherman Creator of dispute + * @param _deposit Amount of tokens staked as deposit + * @param _attestation Attestation struct parsed from bytes + * @param _attestationData Attestation bytes submitted by the fisherman + * @return DisputeID + */ + function _createQueryDisputeWithAttestation( + address _fisherman, + uint256 _deposit, + Attestation memory _attestation, + bytes memory _attestationData + ) private returns (bytes32) { + // Get the indexer that signed the attestation + address indexer = getAttestationIndexer(_attestation); + + // The indexer is disputable + require(staking().getIndexerStakedTokens(indexer) > 0, "Dispute indexer has no stake"); + + // Create a disputeID + bytes32 disputeID = keccak256( + abi.encodePacked( + _attestation.requestCID, + _attestation.responseCID, + _attestation.subgraphDeploymentID, + indexer, + _fisherman + ) + ); + + // Only one dispute for a (indexer, subgraphDeploymentID) at a time + require(!isDisputeCreated(disputeID), "Dispute already created"); + + // Store dispute + disputes[disputeID] = Dispute( + indexer, + _fisherman, + _deposit, + 0, // no related dispute, + DisputeType.QueryDispute, + IDisputeManager.DisputeStatus.Pending + ); + + emit QueryDisputeCreated( + disputeID, + indexer, + _fisherman, + _deposit, + _attestation.subgraphDeploymentID, + _attestationData + ); + + return disputeID; + } + + /** + * @dev Create an indexing dispute for the arbitrator to resolve. + * The disputes are created in reference to an allocationID + * This function is called by a challenger that will need to `_deposit` at + * least `minimumDeposit` GRT tokens. + * @param _allocationID The allocation to dispute + * @param _deposit Amount of tokens staked as deposit + */ + function createIndexingDispute(address _allocationID, uint256 _deposit) external override returns (bytes32) { + // Get funds from submitter + _pullSubmitterDeposit(_deposit); + + // Create a dispute + return _createIndexingDisputeWithAllocation(msg.sender, _deposit, _allocationID); + } + + /** + * @dev Create indexing dispute internal function. + * @param _fisherman The challenger creating the dispute + * @param _deposit Amount of tokens staked as deposit + * @param _allocationID Allocation disputed + */ + + function _createIndexingDisputeWithAllocation( + address _fisherman, + uint256 _deposit, + address _allocationID + ) private returns (bytes32) { + // Create a disputeID + bytes32 disputeID = keccak256(abi.encodePacked(_allocationID)); + + // Only one dispute for an allocationID at a time + require(!isDisputeCreated(disputeID), "Dispute already created"); + + // Allocation must exist + IStaking staking = staking(); + IStaking.Allocation memory alloc = staking.getAllocation(_allocationID); + require(alloc.indexer != address(0), "Dispute allocation must exist"); + + // The indexer must be disputable + require(staking.getIndexerStakedTokens(alloc.indexer) > 0, "Dispute indexer has no stake"); + + // Store dispute + disputes[disputeID] = Dispute( + alloc.indexer, + _fisherman, + _deposit, + 0, + DisputeType.IndexingDispute, + IDisputeManager.DisputeStatus.Pending + ); + + emit IndexingDisputeCreated(disputeID, alloc.indexer, _fisherman, _deposit, _allocationID); + + return disputeID; + } + + /** + * @dev The arbitrator accepts a dispute as being valid. + * This function will revert if the indexer is not slashable, whether because it does not have + * any stake available or the slashing percentage is configured to be zero. In those cases + * a dispute must be resolved using drawDispute or rejectDispute. + * @notice Accept a dispute with ID `_disputeID` + * @param _disputeID ID of the dispute to be accepted + */ + function acceptDispute(bytes32 _disputeID) external override onlyArbitrator onlyPendingDispute(_disputeID) { + Dispute storage dispute = disputes[_disputeID]; + + // store the dispute status + dispute.status = IDisputeManager.DisputeStatus.Accepted; + + // Slash + (, uint256 tokensToReward) = _slashIndexer(dispute.indexer, dispute.fisherman, dispute.disputeType); + + // Give the fisherman their deposit back + TokenUtils.pushTokens(graphToken(), dispute.fisherman, dispute.deposit); + + if (_isDisputeInConflict(dispute)) { + rejectDispute(dispute.relatedDisputeID); + } + + emit DisputeAccepted(_disputeID, dispute.indexer, dispute.fisherman, dispute.deposit.add(tokensToReward)); + } + + /** + * @dev The arbitrator rejects a dispute as being invalid. + * @notice Reject a dispute with ID `_disputeID` + * @param _disputeID ID of the dispute to be rejected + */ + function rejectDispute(bytes32 _disputeID) public override onlyArbitrator onlyPendingDispute(_disputeID) { + Dispute storage dispute = disputes[_disputeID]; + + // store dispute status + dispute.status = IDisputeManager.DisputeStatus.Rejected; + + // Handle conflicting dispute if any + require( + !_isDisputeInConflict(dispute), + "Dispute for conflicting attestation, must accept the related ID to reject" + ); + + // Burn the fisherman's deposit + TokenUtils.burnTokens(graphToken(), dispute.deposit); + + emit DisputeRejected(_disputeID, dispute.indexer, dispute.fisherman, dispute.deposit); + } + + /** + * @dev The arbitrator draws dispute. + * @notice Ignore a dispute with ID `_disputeID` + * @param _disputeID ID of the dispute to be disregarded + */ + function drawDispute(bytes32 _disputeID) external override onlyArbitrator onlyPendingDispute(_disputeID) { + Dispute storage dispute = disputes[_disputeID]; + + // Return deposit to the fisherman + TokenUtils.pushTokens(graphToken(), dispute.fisherman, dispute.deposit); + + // resolve related dispute if any + _drawDisputeInConflict(dispute); + + // store dispute status + dispute.status = IDisputeManager.DisputeStatus.Drawn; + + emit DisputeDrawn(_disputeID, dispute.indexer, dispute.fisherman, dispute.deposit); + } + + /** + * @dev Returns whether the dispute is for a conflicting attestation or not. + * @param _dispute Dispute + * @return True conflicting attestation dispute + */ + function _isDisputeInConflict(Dispute memory _dispute) private view returns (bool) { + bytes32 relatedID = _dispute.relatedDisputeID; + // this is so the check returns false when rejecting the related dispute. + return relatedID != 0 && disputes[relatedID].status == IDisputeManager.DisputeStatus.Pending; + } + + /** + * @dev Resolve the conflicting dispute if there is any for the one passed to this function. + * @param _dispute Dispute + * @return True if resolved + */ + function _drawDisputeInConflict(Dispute memory _dispute) private returns (bool) { + if (_isDisputeInConflict(_dispute)) { + bytes32 relatedDisputeID = _dispute.relatedDisputeID; + Dispute storage relatedDispute = disputes[relatedDisputeID]; + relatedDispute.status = IDisputeManager.DisputeStatus.Drawn; + return true; + } + return false; + } + + /** + * @dev Pull deposit from submitter account. + * @param _deposit Amount of tokens to deposit + */ + function _pullSubmitterDeposit(uint256 _deposit) private { + // Ensure that fisherman has staked at least the minimum amount + require(_deposit >= minimumDeposit, "Dispute deposit is under minimum required"); + + // Transfer tokens to deposit from fisherman to this contract + TokenUtils.pullTokens(graphToken(), msg.sender, _deposit); + } + + /** + * @dev Make the staking contract slash the indexer and reward the challenger. + * Give the challenger a reward equal to the fishermanRewardPercentage of slashed amount + * @param _indexer Address of the indexer + * @param _challenger Address of the challenger + * @param _disputeType Type of dispute + * @return slashAmount Dispute slash amount + * @return rewardsAmount Dispute rewards amount + */ + function _slashIndexer( + address _indexer, + address _challenger, + DisputeType _disputeType + ) private returns (uint256 slashAmount, uint256 rewardsAmount) { + IStaking staking = staking(); + + // Get slashable amount for indexer + uint256 slashableAmount = staking.getIndexerStakedTokens(_indexer); // slashable tokens + + // Get slash amount + slashAmount = _getSlashingPercentageForDisputeType(_disputeType).mul(slashableAmount).div(MAX_PPM); + require(slashAmount > 0, "Dispute has zero tokens to slash"); + + // Get rewards amount + rewardsAmount = uint256(fishermanRewardPercentage).mul(slashAmount).div(MAX_PPM); + + // Have staking contract slash the indexer and reward the fisherman + // Give the fisherman a reward equal to the fishermanRewardPercentage of slashed amount + staking.slash(_indexer, slashAmount, rewardsAmount, _challenger); + } + + /** + * @dev Return the slashing percentage for the dispute type. + * @param _disputeType Dispute type + * @return Slashing percentage to use for the dispute type + */ + function _getSlashingPercentageForDisputeType(DisputeType _disputeType) private view returns (uint256) { + if (_disputeType == DisputeType.QueryDispute) return uint256(qrySlashingPercentage); + if (_disputeType == DisputeType.IndexingDispute) return uint256(idxSlashingPercentage); + return 0; + } + + /** + * @dev Recover the signer address of the `_attestation`. + * @param _attestation The attestation struct + * @return Signer address + */ + function _recoverAttestationSigner(Attestation memory _attestation) private view returns (address) { + // Obtain the hash of the fully-encoded message, per EIP-712 encoding + Receipt memory receipt = Receipt( + _attestation.requestCID, + _attestation.responseCID, + _attestation.subgraphDeploymentID + ); + bytes32 messageHash = encodeHashReceipt(receipt); + + // Obtain the signer of the fully-encoded EIP-712 message hash + // NOTE: The signer of the attestation is the indexer that served the request + return ECDSA.recover(messageHash, abi.encodePacked(_attestation.r, _attestation.s, _attestation.v)); + } + + /** + * @dev Get the running network chain ID + * @return The chain ID + */ + function _getChainID() private pure returns (uint256) { + uint256 id; + assembly { + id := chainid() + } + return id; + } + + /** + * @dev Parse the bytes attestation into a struct from `_data`. + * @return Attestation struct + */ + function _parseAttestation(bytes memory _data) private pure returns (Attestation memory) { + // Check attestation data length + require(_data.length == ATTESTATION_SIZE_BYTES, "Attestation must be 161 bytes long"); + + // Decode receipt + (bytes32 requestCID, bytes32 responseCID, bytes32 subgraphDeploymentID) = abi.decode( + _data, + (bytes32, bytes32, bytes32) + ); + + // Decode signature + // Signature is expected to be in the order defined in the Attestation struct + bytes32 r = _toBytes32(_data, SIG_R_OFFSET); + bytes32 s = _toBytes32(_data, SIG_S_OFFSET); + uint8 v = _toUint8(_data, SIG_V_OFFSET); + + return Attestation(requestCID, responseCID, subgraphDeploymentID, r, s, v); + } + + /** + * @dev Parse a uint8 from `_bytes` starting at offset `_start`. + * @return uint8 value + */ + function _toUint8(bytes memory _bytes, uint256 _start) private pure returns (uint8) { + require(_bytes.length >= (_start + UINT8_BYTE_LENGTH), "Bytes: out of bounds"); + uint8 tempUint; + + assembly { + tempUint := mload(add(add(_bytes, 0x1), _start)) + } + + return tempUint; + } + + /** + * @dev Parse a bytes32 from `_bytes` starting at offset `_start`. + * @return bytes32 value + */ + function _toBytes32(bytes memory _bytes, uint256 _start) private pure returns (bytes32) { + require(_bytes.length >= (_start + BYTES32_BYTE_LENGTH), "Bytes: out of bounds"); + bytes32 tempBytes32; + + assembly { + tempBytes32 := mload(add(add(_bytes, 0x20), _start)) + } + + return tempBytes32; + } +} diff --git a/packages/contracts/contracts/disputes/DisputeManagerStorage.sol b/packages/contracts/contracts/disputes/DisputeManagerStorage.sol new file mode 100644 index 000000000..4df6e0ae6 --- /dev/null +++ b/packages/contracts/contracts/disputes/DisputeManagerStorage.sol @@ -0,0 +1,34 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.7.6; + +import "../governance/Managed.sol"; + +import "./IDisputeManager.sol"; + +contract DisputeManagerV1Storage is Managed { + // -- State -- + + bytes32 internal DOMAIN_SEPARATOR; + + // The arbitrator is solely in control of arbitrating disputes + address public arbitrator; + + // Minimum deposit required to create a Dispute + uint256 public minimumDeposit; + + // -- Slot 0xf + // Percentage of indexer slashed funds to assign as a reward to fisherman in successful dispute + // Parts per million. (Allows for 4 decimal points, 999,999 = 99.9999%) + uint32 public fishermanRewardPercentage; + + // Percentage of indexer stake to slash on disputes + // Parts per million. (Allows for 4 decimal points, 999,999 = 99.9999%) + uint32 public qrySlashingPercentage; + uint32 public idxSlashingPercentage; + + // -- Slot 0x10 + // Disputes created : disputeID => Dispute + // disputeID - check creation functions to see how disputeID is built + mapping(bytes32 => IDisputeManager.Dispute) public disputes; +} diff --git a/packages/contracts/contracts/disputes/IDisputeManager.sol b/packages/contracts/contracts/disputes/IDisputeManager.sol new file mode 100644 index 000000000..e42386941 --- /dev/null +++ b/packages/contracts/contracts/disputes/IDisputeManager.sol @@ -0,0 +1,91 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity >=0.6.12 <0.8.0 || 0.8.27; +pragma abicoder v2; + +interface IDisputeManager { + // -- Dispute -- + + enum DisputeType { + Null, + IndexingDispute, + QueryDispute + } + + enum DisputeStatus { + Null, + Accepted, + Rejected, + Drawn, + Pending + } + + // Disputes contain info necessary for the Arbitrator to verify and resolve + struct Dispute { + address indexer; + address fisherman; + uint256 deposit; + bytes32 relatedDisputeID; + DisputeType disputeType; + DisputeStatus status; + } + + // -- Attestation -- + + // Receipt content sent from indexer in response to request + struct Receipt { + bytes32 requestCID; + bytes32 responseCID; + bytes32 subgraphDeploymentID; + } + + // Attestation sent from indexer in response to a request + struct Attestation { + bytes32 requestCID; + bytes32 responseCID; + bytes32 subgraphDeploymentID; + bytes32 r; + bytes32 s; + uint8 v; + } + + // -- Configuration -- + + function setArbitrator(address _arbitrator) external; + + function setMinimumDeposit(uint256 _minimumDeposit) external; + + function setFishermanRewardPercentage(uint32 _percentage) external; + + function setSlashingPercentage(uint32 _qryPercentage, uint32 _idxPercentage) external; + + // -- Getters -- + + function isDisputeCreated(bytes32 _disputeID) external view returns (bool); + + function encodeHashReceipt(Receipt memory _receipt) external view returns (bytes32); + + function areConflictingAttestations( + Attestation memory _attestation1, + Attestation memory _attestation2 + ) external pure returns (bool); + + function getAttestationIndexer(Attestation memory _attestation) external view returns (address); + + // -- Dispute -- + + function createQueryDispute(bytes calldata _attestationData, uint256 _deposit) external returns (bytes32); + + function createQueryDisputeConflict( + bytes calldata _attestationData1, + bytes calldata _attestationData2 + ) external returns (bytes32, bytes32); + + function createIndexingDispute(address _allocationID, uint256 _deposit) external returns (bytes32); + + function acceptDispute(bytes32 _disputeID) external; + + function rejectDispute(bytes32 _disputeID) external; + + function drawDispute(bytes32 _disputeID) external; +} diff --git a/contracts/epochs/EpochManager.sol b/packages/contracts/contracts/epochs/EpochManager.sol similarity index 81% rename from contracts/epochs/EpochManager.sol rename to packages/contracts/contracts/epochs/EpochManager.sol index b80d5bf2a..281b63896 100644 --- a/contracts/epochs/EpochManager.sol +++ b/packages/contracts/contracts/epochs/EpochManager.sol @@ -1,6 +1,6 @@ -// SPDX-License-Identifier: MIT +// SPDX-License-Identifier: GPL-2.0-or-later -pragma solidity ^0.7.3; +pragma solidity ^0.7.6; import "@openzeppelin/contracts/math/SafeMath.sol"; @@ -29,7 +29,9 @@ contract EpochManager is EpochManagerV1Storage, GraphUpgradeable, IEpochManager Managed._initialize(_controller); - lastLengthUpdateEpoch = 0; + // NOTE: We make the first epoch to be one instead of zero to avoid any issue + // with composing contracts that may use zero as an empty value + lastLengthUpdateEpoch = 1; lastLengthUpdateBlock = blockNum(); epochLength = _epochLength; @@ -71,7 +73,7 @@ contract EpochManager is EpochManagerV1Storage, GraphUpgradeable, IEpochManager * @dev Return true if the current epoch has already run. * @return Return true if current epoch is the last epoch that has run */ - function isCurrentEpochRun() public override view returns (bool) { + function isCurrentEpochRun() public view override returns (bool) { return lastRunEpoch == currentEpoch(); } @@ -79,7 +81,7 @@ contract EpochManager is EpochManagerV1Storage, GraphUpgradeable, IEpochManager * @dev Return current block number. * @return Block number */ - function blockNum() public override view returns (uint256) { + function blockNum() public view override returns (uint256) { return block.number; } @@ -87,14 +89,11 @@ contract EpochManager is EpochManagerV1Storage, GraphUpgradeable, IEpochManager * @dev Return blockhash for a block. * @return BlockHash for `_block` number */ - function blockHash(uint256 _block) external override view returns (bytes32) { + function blockHash(uint256 _block) external view override returns (bytes32) { uint256 currentBlock = blockNum(); require(_block < currentBlock, "Can only retrieve past block hashes"); - require( - currentBlock < 256 || _block >= currentBlock - 256, - "Can only retrieve hashes for last 256 blocks" - ); + require(currentBlock < 256 || _block >= currentBlock - 256, "Can only retrieve hashes for last 256 blocks"); return blockhash(_block); } @@ -103,7 +102,7 @@ contract EpochManager is EpochManagerV1Storage, GraphUpgradeable, IEpochManager * @dev Return the current epoch, it may have not been run yet. * @return The current epoch based on epoch length */ - function currentEpoch() public override view returns (uint256) { + function currentEpoch() public view override returns (uint256) { return lastLengthUpdateEpoch.add(epochsSinceUpdate()); } @@ -111,7 +110,7 @@ contract EpochManager is EpochManagerV1Storage, GraphUpgradeable, IEpochManager * @dev Return block where the current epoch started. * @return The block number when the current epoch started */ - function currentEpochBlock() public override view returns (uint256) { + function currentEpochBlock() public view override returns (uint256) { return lastLengthUpdateBlock.add(epochsSinceUpdate().mul(epochLength)); } @@ -119,7 +118,7 @@ contract EpochManager is EpochManagerV1Storage, GraphUpgradeable, IEpochManager * @dev Return the number of blocks that passed since current epoch started. * @return Blocks that passed since start of epoch */ - function currentEpochBlockSinceStart() external override view returns (uint256) { + function currentEpochBlockSinceStart() external view override returns (uint256) { return blockNum() - currentEpochBlock(); } @@ -128,7 +127,7 @@ contract EpochManager is EpochManagerV1Storage, GraphUpgradeable, IEpochManager * @param _epoch Epoch to use as since epoch value * @return Number of epochs and current epoch */ - function epochsSince(uint256 _epoch) external override view returns (uint256) { + function epochsSince(uint256 _epoch) external view override returns (uint256) { uint256 epoch = currentEpoch(); return _epoch < epoch ? epoch.sub(_epoch) : 0; } @@ -137,7 +136,7 @@ contract EpochManager is EpochManagerV1Storage, GraphUpgradeable, IEpochManager * @dev Return number of epochs passed since last epoch length update. * @return The number of epoch that passed since last epoch length update */ - function epochsSinceUpdate() public override view returns (uint256) { + function epochsSinceUpdate() public view override returns (uint256) { return blockNum().sub(lastLengthUpdateBlock).div(epochLength); } } diff --git a/contracts/epochs/EpochManagerStorage.sol b/packages/contracts/contracts/epochs/EpochManagerStorage.sol similarity index 84% rename from contracts/epochs/EpochManagerStorage.sol rename to packages/contracts/contracts/epochs/EpochManagerStorage.sol index 66ada49e8..5f8599434 100644 --- a/contracts/epochs/EpochManagerStorage.sol +++ b/packages/contracts/contracts/epochs/EpochManagerStorage.sol @@ -1,6 +1,6 @@ -// SPDX-License-Identifier: MIT +// SPDX-License-Identifier: GPL-2.0-or-later -pragma solidity ^0.7.3; +pragma solidity ^0.7.6; import "../governance/Managed.sol"; diff --git a/contracts/epochs/IEpochManager.sol b/packages/contracts/contracts/epochs/IEpochManager.sol similarity index 90% rename from contracts/epochs/IEpochManager.sol rename to packages/contracts/contracts/epochs/IEpochManager.sol index 564f656f3..c65280d59 100644 --- a/contracts/epochs/IEpochManager.sol +++ b/packages/contracts/contracts/epochs/IEpochManager.sol @@ -1,6 +1,6 @@ -// SPDX-License-Identifier: MIT +// SPDX-License-Identifier: GPL-2.0-or-later -pragma solidity ^0.7.3; +pragma solidity ^0.7.6 || 0.8.27; interface IEpochManager { // -- Configuration -- diff --git a/packages/contracts/contracts/gateway/BridgeEscrow.sol b/packages/contracts/contracts/gateway/BridgeEscrow.sol new file mode 100644 index 000000000..3c0fa5c1a --- /dev/null +++ b/packages/contracts/contracts/gateway/BridgeEscrow.sol @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.7.6; + +import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol"; + +import { GraphUpgradeable } from "../upgrades/GraphUpgradeable.sol"; +import { Managed } from "../governance/Managed.sol"; +import { IGraphToken } from "../token/IGraphToken.sol"; + +/** + * @title Bridge Escrow + * @dev This contracts acts as a gateway for an L2 bridge (or several). It simply holds GRT and has + * a set of spenders that can transfer the tokens; the L1 side of each L2 bridge has to be + * approved as a spender. + */ +contract BridgeEscrow is Initializable, GraphUpgradeable, Managed { + /** + * @notice Initialize the BridgeEscrow contract. + * @param _controller Address of the Controller that manages this contract + */ + function initialize(address _controller) external onlyImpl initializer { + Managed._initialize(_controller); + } + + /** + * @notice Approve a spender (i.e. a bridge that manages the GRT funds held by the escrow) + * @param _spender Address of the spender that will be approved + */ + function approveAll(address _spender) external onlyGovernor { + graphToken().approve(_spender, type(uint256).max); + } + + /** + * @notice Revoke a spender (i.e. a bridge that will no longer manage the GRT funds held by the escrow) + * @param _spender Address of the spender that will be revoked + */ + function revokeAll(address _spender) external onlyGovernor { + graphToken().approve(_spender, 0); + } +} diff --git a/packages/contracts/contracts/gateway/GraphTokenGateway.sol b/packages/contracts/contracts/gateway/GraphTokenGateway.sol new file mode 100644 index 000000000..fb992afc2 --- /dev/null +++ b/packages/contracts/contracts/gateway/GraphTokenGateway.sol @@ -0,0 +1,67 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.7.6; + +import { GraphUpgradeable } from "../upgrades/GraphUpgradeable.sol"; +import { ITokenGateway } from "../arbitrum/ITokenGateway.sol"; +import { Pausable } from "../governance/Pausable.sol"; +import { Managed } from "../governance/Managed.sol"; + +/** + * @title L1/L2 Graph Token Gateway + * @dev This includes everything that's shared between the L1 and L2 sides of the bridge. + */ +abstract contract GraphTokenGateway is GraphUpgradeable, Pausable, Managed, ITokenGateway { + /// @dev Storage gap added in case we need to add state variables to this contract + uint256[50] private __gap; + + /** + * @dev Check if the caller is the Controller's governor or this contract's pause guardian. + */ + modifier onlyGovernorOrGuardian() { + require(msg.sender == controller.getGovernor() || msg.sender == pauseGuardian, "Only Governor or Guardian"); + _; + } + + /** + * @notice Change the Pause Guardian for this contract + * @param _newPauseGuardian The address of the new Pause Guardian + */ + function setPauseGuardian(address _newPauseGuardian) external onlyGovernor { + require(_newPauseGuardian != address(0), "PauseGuardian must be set"); + _setPauseGuardian(_newPauseGuardian); + } + + /** + * @notice Change the paused state of the contract + * @param _newPaused New value for the pause state (true means the transfers will be paused) + */ + function setPaused(bool _newPaused) external onlyGovernorOrGuardian { + if (!_newPaused) { + _checksBeforeUnpause(); + } + _setPaused(_newPaused); + } + + /** + * @notice Getter to access paused state of this contract + * @return True if the contract is paused, false otherwise + */ + function paused() external view returns (bool) { + return _paused; + } + + /** + * @dev Override the default pausing from Managed to allow pausing this + * particular contract instead of pausing from the Controller. + */ + function _notPaused() internal view override { + require(!_paused, "Paused (contract)"); + } + + /** + * @dev Runs state validation before unpausing, reverts if + * something is not set properly + */ + function _checksBeforeUnpause() internal view virtual; +} diff --git a/packages/contracts/contracts/gateway/ICallhookReceiver.sol b/packages/contracts/contracts/gateway/ICallhookReceiver.sol new file mode 100644 index 000000000..8d003cb76 --- /dev/null +++ b/packages/contracts/contracts/gateway/ICallhookReceiver.sol @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +/** + * @title Interface for contracts that can receive callhooks through the Arbitrum GRT bridge + * @dev Any contract that can receive a callhook on L2, sent through the bridge from L1, must + * be allowlisted by the governor, but also implement this interface that contains + * the function that will actually be called by the L2GraphTokenGateway. + */ +pragma solidity ^0.7.6 || 0.8.27; + +interface ICallhookReceiver { + /** + * @notice Receive tokens with a callhook from the bridge + * @param _from Token sender in L1 + * @param _amount Amount of tokens that were transferred + * @param _data ABI-encoded callhook data + */ + function onTokenTransfer(address _from, uint256 _amount, bytes calldata _data) external; +} diff --git a/packages/contracts/contracts/gateway/L1GraphTokenGateway.sol b/packages/contracts/contracts/gateway/L1GraphTokenGateway.sol new file mode 100644 index 000000000..7fad927ad --- /dev/null +++ b/packages/contracts/contracts/gateway/L1GraphTokenGateway.sol @@ -0,0 +1,464 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.7.6; +pragma abicoder v2; + +import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol"; +import { AddressUpgradeable } from "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol"; +import { SafeMathUpgradeable } from "@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol"; + +import { L1ArbitrumMessenger } from "../arbitrum/L1ArbitrumMessenger.sol"; +import { IBridge } from "../arbitrum/IBridge.sol"; +import { IInbox } from "../arbitrum/IInbox.sol"; +import { IOutbox } from "../arbitrum/IOutbox.sol"; +import { ITokenGateway } from "../arbitrum/ITokenGateway.sol"; +import { Managed } from "../governance/Managed.sol"; +import { GraphTokenGateway } from "./GraphTokenGateway.sol"; +import { IGraphToken } from "../token/IGraphToken.sol"; + +/** + * @title L1 Graph Token Gateway Contract + * @dev Provides the L1 side of the Ethereum-Arbitrum GRT bridge. Sends GRT to the L2 chain + * by escrowing them and sending a message to the L2 gateway, and receives tokens from L2 by + * releasing them from escrow. + * Based on Offchain Labs' reference implementation and Livepeer's arbitrum-lpt-bridge + * (See: https://github.com/OffchainLabs/arbitrum/tree/master/packages/arb-bridge-peripherals/contracts/tokenbridge + * and https://github.com/livepeer/arbitrum-lpt-bridge) + */ +contract L1GraphTokenGateway is Initializable, GraphTokenGateway, L1ArbitrumMessenger { + using SafeMathUpgradeable for uint256; + + /// Address of the Graph Token contract on L2 + address public l2GRT; + /// Address of the Arbitrum Inbox + address public inbox; + /// Address of the Arbitrum Gateway Router on L1 + address public l1Router; + /// Address of the L2GraphTokenGateway on L2 that is the counterpart of this gateway + address public l2Counterpart; + /// Address of the BridgeEscrow contract that holds the GRT in the bridge + address public escrow; + /// Addresses for which this mapping is true are allowed to send callhooks in outbound transfers + mapping(address => bool) public callhookAllowlist; + /// Total amount minted from L2 + uint256 public totalMintedFromL2; + /// Accumulated allowance for tokens minted from L2 at lastL2MintAllowanceUpdateBlock + uint256 public accumulatedL2MintAllowanceSnapshot; + /// Block at which new L2 allowance starts accumulating + uint256 public lastL2MintAllowanceUpdateBlock; + /// New L2 mint allowance per block + uint256 public l2MintAllowancePerBlock; + + /// Emitted when an outbound transfer is initiated, i.e. tokens are deposited from L1 to L2 + event DepositInitiated( + address l1Token, + address indexed from, + address indexed to, + uint256 indexed sequenceNumber, + uint256 amount + ); + + /// Emitted when an incoming transfer is finalized, i.e tokens are withdrawn from L2 to L1 + event WithdrawalFinalized( + address l1Token, + address indexed from, + address indexed to, + uint256 indexed exitNum, + uint256 amount + ); + + /// Emitted when the Arbitrum Inbox and Gateway Router addresses have been updated + event ArbitrumAddressesSet(address inbox, address l1Router); + /// Emitted when the L2 GRT address has been updated + event L2TokenAddressSet(address l2GRT); + /// Emitted when the counterpart L2GraphTokenGateway address has been updated + event L2CounterpartAddressSet(address l2Counterpart); + /// Emitted when the escrow address has been updated + event EscrowAddressSet(address escrow); + /// Emitted when an address is added to the callhook allowlist + event AddedToCallhookAllowlist(address newAllowlisted); + /// Emitted when an address is removed from the callhook allowlist + event RemovedFromCallhookAllowlist(address notAllowlisted); + /// Emitted when the L2 mint allowance per block is updated + event L2MintAllowanceUpdated( + uint256 accumulatedL2MintAllowanceSnapshot, + uint256 l2MintAllowancePerBlock, + uint256 lastL2MintAllowanceUpdateBlock + ); + /// Emitted when tokens are minted due to an incoming transfer from L2 + event TokensMintedFromL2(uint256 amount); + + /** + * @dev Allows a function to be called only by the gateway's L2 counterpart. + * The message will actually come from the Arbitrum Bridge, but the Outbox + * can tell us who the sender from L2 is. + */ + modifier onlyL2Counterpart() { + require(inbox != address(0), "INBOX_NOT_SET"); + require(l2Counterpart != address(0), "L2_COUNTERPART_NOT_SET"); + + // a message coming from the counterpart gateway was executed by the bridge + IBridge bridge = IInbox(inbox).bridge(); + require(msg.sender == address(bridge), "NOT_FROM_BRIDGE"); + + // and the outbox reports that the L2 address of the sender is the counterpart gateway + address l2ToL1Sender = IOutbox(bridge.activeOutbox()).l2ToL1Sender(); + require(l2ToL1Sender == l2Counterpart, "ONLY_COUNTERPART_GATEWAY"); + _; + } + + /** + * @notice Initialize the L1GraphTokenGateway contract. + * @dev The contract will be paused. + * Note some parameters have to be set separately as they are generally + * not expected to be available at initialization time: + * - inbox and l1Router using setArbitrumAddresses + * - l2GRT using setL2TokenAddress + * - l2Counterpart using setL2CounterpartAddress + * - escrow using setEscrowAddress + * - allowlisted callhook callers using addToCallhookAllowlist + * - pauseGuardian using setPauseGuardian + * @param _controller Address of the Controller that manages this contract + */ + function initialize(address _controller) external onlyImpl initializer { + Managed._initialize(_controller); + _paused = true; + } + + /** + * @notice Sets the addresses for L1 contracts provided by Arbitrum + * @param _inbox Address of the Inbox that is part of the Arbitrum Bridge + * @param _l1Router Address of the Gateway Router + */ + function setArbitrumAddresses(address _inbox, address _l1Router) external onlyGovernor { + require(_inbox != address(0), "INVALID_INBOX"); + require(_l1Router != address(0), "INVALID_L1_ROUTER"); + require(!callhookAllowlist[_l1Router], "ROUTER_CANT_BE_ALLOWLISTED"); + require(AddressUpgradeable.isContract(_inbox), "INBOX_MUST_BE_CONTRACT"); + require(AddressUpgradeable.isContract(_l1Router), "ROUTER_MUST_BE_CONTRACT"); + inbox = _inbox; + l1Router = _l1Router; + emit ArbitrumAddressesSet(_inbox, _l1Router); + } + + /** + * @notice Sets the address of the L2 Graph Token + * @param _l2GRT Address of the GRT contract on L2 + */ + function setL2TokenAddress(address _l2GRT) external onlyGovernor { + require(_l2GRT != address(0), "INVALID_L2_GRT"); + l2GRT = _l2GRT; + emit L2TokenAddressSet(_l2GRT); + } + + /** + * @notice Sets the address of the counterpart gateway on L2 + * @param _l2Counterpart Address of the corresponding L2GraphTokenGateway on Arbitrum + */ + function setL2CounterpartAddress(address _l2Counterpart) external onlyGovernor { + require(_l2Counterpart != address(0), "INVALID_L2_COUNTERPART"); + l2Counterpart = _l2Counterpart; + emit L2CounterpartAddressSet(_l2Counterpart); + } + + /** + * @notice Sets the address of the escrow contract on L1 + * @param _escrow Address of the BridgeEscrow + */ + function setEscrowAddress(address _escrow) external onlyGovernor { + require(_escrow != address(0), "INVALID_ESCROW"); + require(AddressUpgradeable.isContract(_escrow), "MUST_BE_CONTRACT"); + escrow = _escrow; + emit EscrowAddressSet(_escrow); + } + + /** + * @notice Adds an address to the callhook allowlist. + * This address will be allowed to include callhooks when transferring tokens. + * @param _newAllowlisted Address to add to the allowlist + */ + function addToCallhookAllowlist(address _newAllowlisted) external onlyGovernor { + require(_newAllowlisted != address(0), "INVALID_ADDRESS"); + require(_newAllowlisted != l1Router, "CANT_ALLOW_ROUTER"); + require(AddressUpgradeable.isContract(_newAllowlisted), "MUST_BE_CONTRACT"); + require(!callhookAllowlist[_newAllowlisted], "ALREADY_ALLOWLISTED"); + callhookAllowlist[_newAllowlisted] = true; + emit AddedToCallhookAllowlist(_newAllowlisted); + } + + /** + * @notice Removes an address from the callhook allowlist. + * This address will no longer be allowed to include callhooks when transferring tokens. + * @param _notAllowlisted Address to remove from the allowlist + */ + function removeFromCallhookAllowlist(address _notAllowlisted) external onlyGovernor { + require(_notAllowlisted != address(0), "INVALID_ADDRESS"); + require(callhookAllowlist[_notAllowlisted], "NOT_ALLOWLISTED"); + callhookAllowlist[_notAllowlisted] = false; + emit RemovedFromCallhookAllowlist(_notAllowlisted); + } + + /** + * @dev Updates the L2 mint allowance per block + * It is meant to be called _after_ the issuancePerBlock is updated in L2. + * The caller should provide the new issuance per block and the block at which it was updated, + * the function will automatically compute the values so that the bridge's mint allowance + * correctly tracks the maximum rewards minted in L2. + * @param _l2IssuancePerBlock New issuancePerBlock that has been set in L2 + * @param _updateBlockNum L1 Block number at which issuancePerBlock was updated in L2 + */ + function updateL2MintAllowance(uint256 _l2IssuancePerBlock, uint256 _updateBlockNum) external onlyGovernor { + require(_updateBlockNum < block.number, "BLOCK_MUST_BE_PAST"); + require(_updateBlockNum > lastL2MintAllowanceUpdateBlock, "BLOCK_MUST_BE_INCREMENTING"); + accumulatedL2MintAllowanceSnapshot = accumulatedL2MintAllowanceAtBlock(_updateBlockNum); + lastL2MintAllowanceUpdateBlock = _updateBlockNum; + l2MintAllowancePerBlock = _l2IssuancePerBlock; + emit L2MintAllowanceUpdated( + accumulatedL2MintAllowanceSnapshot, + l2MintAllowancePerBlock, + lastL2MintAllowanceUpdateBlock + ); + } + + /** + * @dev Manually sets the parameters used to compute the L2 mint allowance + * The use of this function is not recommended, use updateL2MintAllowance instead; + * this one is only meant to be used as a backup recovery if a previous call to + * updateL2MintAllowance was done with incorrect values. + * @param _accumulatedL2MintAllowanceSnapshot Accumulated L2 mint allowance at L1 block _lastL2MintAllowanceUpdateBlock + * @param _l2MintAllowancePerBlock L2 issuance per block since block number _lastL2MintAllowanceUpdateBlock + * @param _lastL2MintAllowanceUpdateBlock L1 Block number at which issuancePerBlock was last updated in L2 + */ + function setL2MintAllowanceParametersManual( + uint256 _accumulatedL2MintAllowanceSnapshot, + uint256 _l2MintAllowancePerBlock, + uint256 _lastL2MintAllowanceUpdateBlock + ) external onlyGovernor { + require(_lastL2MintAllowanceUpdateBlock < block.number, "BLOCK_MUST_BE_PAST"); + accumulatedL2MintAllowanceSnapshot = _accumulatedL2MintAllowanceSnapshot; + l2MintAllowancePerBlock = _l2MintAllowancePerBlock; + lastL2MintAllowanceUpdateBlock = _lastL2MintAllowanceUpdateBlock; + emit L2MintAllowanceUpdated( + accumulatedL2MintAllowanceSnapshot, + l2MintAllowancePerBlock, + lastL2MintAllowanceUpdateBlock + ); + } + + /** + * @notice Creates and sends a retryable ticket to transfer GRT to L2 using the Arbitrum Inbox. + * The tokens are escrowed by the gateway until they are withdrawn back to L1. + * The ticket must be redeemed on L2 to receive tokens at the specified address. + * Note that the caller must previously allow the gateway to spend the specified amount of GRT. + * @dev maxGas and gasPriceBid must be set using Arbitrum's NodeInterface.estimateRetryableTicket method. + * Also note that allowlisted senders (some protocol contracts) can include additional calldata + * for a callhook to be executed on the L2 side when the tokens are received. In this case, the L2 transaction + * can revert if the callhook reverts, potentially locking the tokens on the bridge if the callhook + * never succeeds. This requires extra care when adding contracts to the allowlist, but is necessary to ensure that + * the tickets can be retried in the case of a temporary failure, and to ensure the atomicity of callhooks + * with token transfers. + * @param _l1Token L1 Address of the GRT contract (needed for compatibility with Arbitrum Gateway Router) + * @param _to Recipient address on L2 + * @param _amount Amount of tokens to transfer + * @param _maxGas Gas limit for L2 execution of the ticket + * @param _gasPriceBid Price per gas on L2 + * @param _data Encoded maxSubmissionCost and sender address along with additional calldata + * @return Sequence number of the retryable ticket created by Inbox + */ + function outboundTransfer( + address _l1Token, + address _to, + uint256 _amount, + uint256 _maxGas, + uint256 _gasPriceBid, + bytes calldata _data + ) external payable override notPaused returns (bytes memory) { + IGraphToken token = graphToken(); + require(_amount != 0, "INVALID_ZERO_AMOUNT"); + require(_l1Token == address(token), "TOKEN_NOT_GRT"); + require(_to != address(0), "INVALID_DESTINATION"); + + // nested scopes to avoid stack too deep errors + address from; + uint256 seqNum; + { + uint256 maxSubmissionCost; + bytes memory outboundCalldata; + { + bytes memory extraData; + (from, maxSubmissionCost, extraData) = _parseOutboundData(_data); + require(extraData.length == 0 || callhookAllowlist[msg.sender] == true, "CALL_HOOK_DATA_NOT_ALLOWED"); + require(maxSubmissionCost != 0, "NO_SUBMISSION_COST"); + outboundCalldata = getOutboundCalldata(_l1Token, from, _to, _amount, extraData); + } + { + L2GasParams memory gasParams = L2GasParams(maxSubmissionCost, _maxGas, _gasPriceBid); + // transfer tokens to escrow + token.transferFrom(from, escrow, _amount); + seqNum = sendTxToL2(inbox, l2Counterpart, from, msg.value, 0, gasParams, outboundCalldata); + } + } + emit DepositInitiated(_l1Token, from, _to, seqNum, _amount); + + return abi.encode(seqNum); + } + + /** + * @notice Receives withdrawn tokens from L2 + * The equivalent tokens are released from escrow and sent to the destination. + * @dev can only accept transactions coming from the L2 GRT Gateway. + * The last parameter is unused but kept for compatibility with Arbitrum gateways, + * and the encoded exitNum is assumed to be 0. + * @param _l1Token L1 Address of the GRT contract (needed for compatibility with Arbitrum Gateway Router) + * @param _from Address of the sender + * @param _to Recipient address on L1 + * @param _amount Amount of tokens transferred + */ + function finalizeInboundTransfer( + address _l1Token, + address _from, + address _to, + uint256 _amount, + bytes calldata // _data, contains exitNum, unused by this contract + ) external payable override notPaused onlyL2Counterpart { + IGraphToken token = graphToken(); + require(_l1Token == address(token), "TOKEN_NOT_GRT"); + + uint256 escrowBalance = token.balanceOf(escrow); + if (_amount > escrowBalance) { + // This will revert if trying to mint more than allowed + _mintFromL2(_amount.sub(escrowBalance)); + } + token.transferFrom(escrow, _to, _amount); + + emit WithdrawalFinalized(_l1Token, _from, _to, 0, _amount); + } + + /** + * @notice Calculate the L2 address of a bridged token + * @dev In our case, this would only work for GRT. + * @param _l1ERC20 address of L1 GRT contract + * @return L2 address of the bridged GRT token + */ + function calculateL2TokenAddress(address _l1ERC20) external view override returns (address) { + IGraphToken token = graphToken(); + if (_l1ERC20 != address(token)) { + return address(0); + } + return l2GRT; + } + + /** + * @notice Get the address of the L2GraphTokenGateway + * @dev This is added for compatibility with the Arbitrum Router's + * gateway registration process. + * @return Address of the L2 gateway connected to this gateway + */ + function counterpartGateway() external view returns (address) { + return l2Counterpart; + } + + /** + * @notice Creates calldata required to create a retryable ticket + * @dev encodes the target function with its params which + * will be called on L2 when the retryable ticket is redeemed + * @param _l1Token Address of the Graph token contract on L1 + * @param _from Address on L1 from which we're transferring tokens + * @param _to Address on L2 to which we're transferring tokens + * @param _amount Amount of GRT to transfer + * @param _data Additional call data for the L2 transaction, which must be empty unless the caller is allowlisted + * @return Encoded calldata (including function selector) for the L2 transaction + */ + function getOutboundCalldata( + address _l1Token, + address _from, + address _to, + uint256 _amount, + bytes memory _data + ) public pure returns (bytes memory) { + return + abi.encodeWithSelector( + ITokenGateway.finalizeInboundTransfer.selector, + _l1Token, + _from, + _to, + _amount, + _data + ); + } + + /** + * @dev Runs state validation before unpausing, reverts if + * something is not set properly + */ + function _checksBeforeUnpause() internal view override { + require(inbox != address(0), "INBOX_NOT_SET"); + require(l1Router != address(0), "ROUTER_NOT_SET"); + require(l2Counterpart != address(0), "L2_COUNTERPART_NOT_SET"); + require(escrow != address(0), "ESCROW_NOT_SET"); + } + + /** + * @notice Decodes calldata required for transfer of tokens to L2 + * @dev Data must include maxSubmissionCost, extraData can be left empty. When the router + * sends an outbound message, data also contains the from address. + * @param _data encoded callhook data + * @return Sender of the tx + * @return Base ether value required to keep retryable ticket alive + * @return Additional data sent to L2 + */ + function _parseOutboundData(bytes calldata _data) private view returns (address, uint256, bytes memory) { + address from; + uint256 maxSubmissionCost; + bytes memory extraData; + if (msg.sender == l1Router) { + // Data encoded by the Gateway Router includes the sender address + (from, extraData) = abi.decode(_data, (address, bytes)); + } else { + from = msg.sender; + extraData = _data; + } + // User-encoded data contains the max retryable ticket submission cost + // and additional L2 calldata + (maxSubmissionCost, extraData) = abi.decode(extraData, (uint256, bytes)); + return (from, maxSubmissionCost, extraData); + } + + /** + * @dev Get the accumulated L2 mint allowance at a particular block number + * @param _blockNum Block at which allowance will be computed + * @return The accumulated GRT amount that can be minted from L2 at the specified block + */ + function accumulatedL2MintAllowanceAtBlock(uint256 _blockNum) public view returns (uint256) { + require(_blockNum >= lastL2MintAllowanceUpdateBlock, "INVALID_BLOCK_FOR_MINT_ALLOWANCE"); + return + accumulatedL2MintAllowanceSnapshot.add( + l2MintAllowancePerBlock.mul(_blockNum.sub(lastL2MintAllowanceUpdateBlock)) + ); + } + + /** + * @dev Mint new L1 tokens coming from L2 + * This will check if the amount to mint is within the L2's mint allowance, and revert otherwise. + * The tokens will be sent to the bridge escrow (from where they will then be sent to the destinatary + * of the current inbound transfer). + * @param _amount Number of tokens to mint + */ + function _mintFromL2(uint256 _amount) internal { + // If we're trying to mint more than allowed, something's gone terribly wrong + // (either the L2 issuance is wrong, or the Arbitrum bridge has been compromised) + require(_l2MintAmountAllowed(_amount), "INVALID_L2_MINT_AMOUNT"); + totalMintedFromL2 = totalMintedFromL2.add(_amount); + graphToken().mint(escrow, _amount); + emit TokensMintedFromL2(_amount); + } + + /** + * @dev Check if minting a certain amount of tokens from L2 is within allowance + * @param _amount Number of tokens that would be minted + * @return true if minting those tokens is allowed, or false if it would be over allowance + */ + function _l2MintAmountAllowed(uint256 _amount) internal view returns (bool) { + return (totalMintedFromL2.add(_amount) <= accumulatedL2MintAllowanceAtBlock(block.number)); + } +} diff --git a/packages/contracts/contracts/governance/Controller.sol b/packages/contracts/contracts/governance/Controller.sol new file mode 100644 index 000000000..707a27fff --- /dev/null +++ b/packages/contracts/contracts/governance/Controller.sol @@ -0,0 +1,131 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.7.6 || 0.8.27; + +import { IController } from "./IController.sol"; +import { IManaged } from "./IManaged.sol"; +import { Governed } from "./Governed.sol"; +import { Pausable } from "./Pausable.sol"; + +/** + * @title Graph Controller contract + * @dev Controller is a registry of contracts for convenience. Inspired by Livepeer: + * https://github.com/livepeer/protocol/blob/streamflow/contracts/Controller.sol + */ +contract Controller is Governed, Pausable, IController { + /// @dev Track contract ids to contract proxy address + mapping(bytes32 => address) private _registry; + + /// Emitted when the proxy address for a protocol contract has been set + event SetContractProxy(bytes32 indexed id, address contractAddress); + + /** + * @notice Controller contract constructor. + */ + constructor() { + Governed._initialize(msg.sender); + + _setPaused(true); + } + + /** + * @dev Check if the caller is the governor or pause guardian. + */ + modifier onlyGovernorOrGuardian() { + require(msg.sender == governor || msg.sender == pauseGuardian, "Only Governor or Guardian can call"); + _; + } + + /** + * @notice Getter to access governor + */ + function getGovernor() external view override returns (address) { + return governor; + } + + // -- Registry -- + + /** + * @notice Register contract id and mapped address + * @param _id Contract id (keccak256 hash of contract name) + * @param _contractAddress Contract address + */ + function setContractProxy(bytes32 _id, address _contractAddress) external override onlyGovernor { + require(_contractAddress != address(0), "Contract address must be set"); + _registry[_id] = _contractAddress; + emit SetContractProxy(_id, _contractAddress); + } + + /** + * @notice Unregister a contract address + * @param _id Contract id (keccak256 hash of contract name) + */ + function unsetContractProxy(bytes32 _id) external override onlyGovernor { + _registry[_id] = address(0); + emit SetContractProxy(_id, address(0)); + } + + /** + * @notice Get contract proxy address by its id + * @param _id Contract id + * @return Address of the proxy contract for the provided id + */ + function getContractProxy(bytes32 _id) external view override returns (address) { + return _registry[_id]; + } + + /** + * @notice Update contract's controller + * @param _id Contract id (keccak256 hash of contract name) + * @param _controller Controller address + */ + function updateController(bytes32 _id, address _controller) external override onlyGovernor { + require(_controller != address(0), "Controller must be set"); + return IManaged(_registry[_id]).setController(_controller); + } + + // -- Pausing -- + + /** + * @notice Change the partial paused state of the contract + * Partial pause is intended as a partial pause of the protocol + * @param _toPartialPause True if the contracts should be (partially) paused, false otherwise + */ + function setPartialPaused(bool _toPartialPause) external override onlyGovernorOrGuardian { + _setPartialPaused(_toPartialPause); + } + + /** + * @notice Change the paused state of the contract + * Full pause most of protocol functions + * @param _toPause True if the contracts should be paused, false otherwise + */ + function setPaused(bool _toPause) external override onlyGovernorOrGuardian { + _setPaused(_toPause); + } + + /** + * @notice Change the Pause Guardian + * @param _newPauseGuardian The address of the new Pause Guardian + */ + function setPauseGuardian(address _newPauseGuardian) external override onlyGovernor { + require(_newPauseGuardian != address(0), "PauseGuardian must be set"); + _setPauseGuardian(_newPauseGuardian); + } + + /** + * @notice Getter to access paused + * @return True if the contracts are paused, false otherwise + */ + function paused() external view override returns (bool) { + return _paused; + } + + /** + * @notice Getter to access partial pause status + * @return True if the contracts are partially paused, false otherwise + */ + function partialPaused() external view override returns (bool) { + return _partialPaused; + } +} diff --git a/packages/contracts/contracts/governance/Governed.sol b/packages/contracts/contracts/governance/Governed.sol new file mode 100644 index 000000000..76a3247dd --- /dev/null +++ b/packages/contracts/contracts/governance/Governed.sol @@ -0,0 +1,74 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.7.6 || 0.8.27; + +/** + * @title Graph Governance contract + * @dev All contracts that will be owned by a Governor entity should extend this contract. + */ +abstract contract Governed { + // -- State -- + + /// Address of the governor + address public governor; + /// Address of the new governor that is pending acceptance + address public pendingGovernor; + + // -- Events -- + + /// Emitted when a new owner/governor has been set, but is pending acceptance + event NewPendingOwnership(address indexed from, address indexed to); + /// Emitted when a new owner/governor has accepted their role + event NewOwnership(address indexed from, address indexed to); + + /** + * @dev Check if the caller is the governor. + */ + modifier onlyGovernor() { + require(msg.sender == governor, "Only Governor can call"); + _; + } + + /** + * @dev Initialize the governor for this contract + * @param _initGovernor Address of the governor + */ + function _initialize(address _initGovernor) internal { + governor = _initGovernor; + } + + /** + * @notice Admin function to begin change of governor. The `_newGovernor` must call + * `acceptOwnership` to finalize the transfer. + * @param _newGovernor Address of new `governor` + */ + function transferOwnership(address _newGovernor) external onlyGovernor { + require(_newGovernor != address(0), "Governor must be set"); + + address oldPendingGovernor = pendingGovernor; + pendingGovernor = _newGovernor; + + emit NewPendingOwnership(oldPendingGovernor, pendingGovernor); + } + + /** + * @notice Admin function for pending governor to accept role and update governor. + * This function must called by the pending governor. + */ + function acceptOwnership() external { + address oldPendingGovernor = pendingGovernor; + + require( + oldPendingGovernor != address(0) && msg.sender == oldPendingGovernor, + "Caller must be pending governor" + ); + + address oldGovernor = governor; + + governor = oldPendingGovernor; + pendingGovernor = address(0); + + emit NewOwnership(oldGovernor, governor); + emit NewPendingOwnership(oldPendingGovernor, pendingGovernor); + } +} diff --git a/contracts/governance/IController.sol b/packages/contracts/contracts/governance/IController.sol similarity index 90% rename from contracts/governance/IController.sol rename to packages/contracts/contracts/governance/IController.sol index 8f6895ff6..6ab72010e 100644 --- a/contracts/governance/IController.sol +++ b/packages/contracts/contracts/governance/IController.sol @@ -1,6 +1,6 @@ -// SPDX-License-Identifier: MIT +// SPDX-License-Identifier: GPL-2.0-or-later -pragma solidity >=0.6.12 <0.8.0; +pragma solidity ^0.7.6 || 0.8.27; interface IController { function getGovernor() external view returns (address); diff --git a/packages/contracts/contracts/governance/IManaged.sol b/packages/contracts/contracts/governance/IManaged.sol new file mode 100644 index 000000000..ff6625d81 --- /dev/null +++ b/packages/contracts/contracts/governance/IManaged.sol @@ -0,0 +1,32 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.7.6 || 0.8.27; + +import { IController } from "./IController.sol"; + +/** + * @title Managed Interface + * @dev Interface for contracts that can be managed by a controller. + */ +interface IManaged { + /** + * @notice Set the controller that manages this contract + * @dev Only the current controller can set a new controller + * @param _controller Address of the new controller + */ + function setController(address _controller) external; + + /** + * @notice Sync protocol contract addresses from the Controller registry + * @dev This function will cache all the contracts using the latest addresses. + * Anyone can call the function whenever a Proxy contract change in the + * controller to ensure the protocol is using the latest version. + */ + function syncAllContracts() external; + + /** + * @notice Get the Controller that manages this contract + * @return The Controller as an IController interface + */ + function controller() external view returns (IController); +} diff --git a/packages/contracts/contracts/governance/Managed.sol b/packages/contracts/contracts/governance/Managed.sol new file mode 100644 index 000000000..fb65e71b9 --- /dev/null +++ b/packages/contracts/contracts/governance/Managed.sol @@ -0,0 +1,243 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.7.6; + +import { IController } from "./IController.sol"; + +import { ICuration } from "../curation/ICuration.sol"; +import { IEpochManager } from "../epochs/IEpochManager.sol"; +import { IRewardsManager } from "../rewards/IRewardsManager.sol"; +import { IStaking } from "../staking/IStaking.sol"; +import { IStakingBase } from "../staking/IStakingBase.sol"; +import { IGraphToken } from "../token/IGraphToken.sol"; +import { ITokenGateway } from "../arbitrum/ITokenGateway.sol"; +import { IGNS } from "../discovery/IGNS.sol"; + +import { IManaged } from "./IManaged.sol"; + +/** + * @title Graph Managed contract + * @dev The Managed contract provides an interface to interact with the Controller. + * It also provides local caching for contract addresses. This mechanism relies on calling the + * public `syncAllContracts()` function whenever a contract changes in the controller. + * + * Inspired by Livepeer: + * https://github.com/livepeer/protocol/blob/streamflow/contracts/Controller.sol + */ +abstract contract Managed is IManaged { + // -- State -- + + /// Controller that manages this contract + IController public override controller; + /// @dev Cache for the addresses of the contracts retrieved from the controller + mapping(bytes32 => address) private _addressCache; + /// @dev Gap for future storage variables + uint256[10] private __gap; + + // Immutables + bytes32 private immutable CURATION = keccak256("Curation"); + bytes32 private immutable EPOCH_MANAGER = keccak256("EpochManager"); + bytes32 private immutable REWARDS_MANAGER = keccak256("RewardsManager"); + bytes32 private immutable STAKING = keccak256("Staking"); + bytes32 private immutable GRAPH_TOKEN = keccak256("GraphToken"); + bytes32 private immutable GRAPH_TOKEN_GATEWAY = keccak256("GraphTokenGateway"); + bytes32 private immutable GNS = keccak256("GNS"); + + // -- Events -- + + /// Emitted when a contract parameter has been updated + event ParameterUpdated(string param); + /// Emitted when the controller address has been set + event SetController(address controller); + + /// Emitted when contract with `nameHash` is synced to `contractAddress`. + event ContractSynced(bytes32 indexed nameHash, address contractAddress); + + // -- Modifiers -- + + /** + * @dev Revert if the controller is paused or partially paused + */ + function _notPartialPaused() internal view { + require(!controller.paused(), "Paused"); + require(!controller.partialPaused(), "Partial-paused"); + } + + /** + * @dev Revert if the controller is paused + */ + function _notPaused() internal view virtual { + require(!controller.paused(), "Paused"); + } + + /** + * @dev Revert if the caller is not the governor + */ + function _onlyGovernor() internal view { + require(msg.sender == controller.getGovernor(), "Only Controller governor"); + } + + /** + * @dev Revert if the caller is not the Controller + */ + function _onlyController() internal view { + require(msg.sender == address(controller), "Caller must be Controller"); + } + + /** + * @dev Revert if the controller is paused or partially paused + */ + modifier notPartialPaused() { + _notPartialPaused(); + _; + } + + /** + * @dev Revert if the controller is paused + */ + modifier notPaused() { + _notPaused(); + _; + } + + /** + * @dev Revert if the caller is not the Controller + */ + modifier onlyController() { + _onlyController(); + _; + } + + /** + * @dev Revert if the caller is not the governor + */ + modifier onlyGovernor() { + _onlyGovernor(); + _; + } + + // -- Functions -- + + /** + * @dev Initialize a Managed contract + * @param _controller Address for the Controller that manages this contract + */ + function _initialize(address _controller) internal { + _setController(_controller); + } + + /** + * @notice Set Controller. Only callable by current controller. + * @param _controller Controller contract address + */ + function setController(address _controller) external override onlyController { + _setController(_controller); + } + + /** + * @dev Set controller. + * @param _controller Controller contract address + */ + function _setController(address _controller) internal { + require(_controller != address(0), "Controller must be set"); + controller = IController(_controller); + emit SetController(_controller); + } + + /** + * @dev Return Curation interface + * @return Curation contract registered with Controller + */ + function curation() internal view returns (ICuration) { + return ICuration(_resolveContract(CURATION)); + } + + /** + * @dev Return EpochManager interface + * @return Epoch manager contract registered with Controller + */ + function epochManager() internal view returns (IEpochManager) { + return IEpochManager(_resolveContract(EPOCH_MANAGER)); + } + + /** + * @dev Return RewardsManager interface + * @return Rewards manager contract registered with Controller + */ + function rewardsManager() internal view returns (IRewardsManager) { + return IRewardsManager(_resolveContract(REWARDS_MANAGER)); + } + + /** + * @dev Return Staking interface + * @return Staking contract registered with Controller + */ + function staking() internal view returns (IStaking) { + return IStaking(_resolveContract(STAKING)); + } + + /** + * @dev Return GraphToken interface + * @return Graph token contract registered with Controller + */ + function graphToken() internal view returns (IGraphToken) { + return IGraphToken(_resolveContract(GRAPH_TOKEN)); + } + + /** + * @dev Return GraphTokenGateway (L1 or L2) interface + * @return Graph token gateway contract registered with Controller + */ + function graphTokenGateway() internal view returns (ITokenGateway) { + return ITokenGateway(_resolveContract(GRAPH_TOKEN_GATEWAY)); + } + + /** + * @dev Return GNS (L1 or L2) interface. + * @return Address of the GNS contract registered with Controller, as an IGNS interface. + */ + function gns() internal view returns (IGNS) { + return IGNS(_resolveContract(GNS)); + } + + /** + * @dev Resolve a contract address from the cache or the Controller if not found. + * @param _nameHash keccak256 hash of the contract name + * @return Address of the contract + */ + function _resolveContract(bytes32 _nameHash) internal view returns (address) { + address contractAddress = _addressCache[_nameHash]; + if (contractAddress == address(0)) { + contractAddress = controller.getContractProxy(_nameHash); + } + return contractAddress; + } + + /** + * @dev Cache a contract address from the Controller registry. + * @param _nameHash keccak256 hash of the name of the contract to sync into the cache + */ + function _syncContract(bytes32 _nameHash) internal { + address contractAddress = controller.getContractProxy(_nameHash); + if (_addressCache[_nameHash] != contractAddress) { + _addressCache[_nameHash] = contractAddress; + emit ContractSynced(_nameHash, contractAddress); + } + } + + /** + * @notice Sync protocol contract addresses from the Controller registry + * @dev This function will cache all the contracts using the latest addresses + * Anyone can call the function whenever a Proxy contract change in the + * controller to ensure the protocol is using the latest version + */ + function syncAllContracts() external override { + _syncContract(CURATION); + _syncContract(EPOCH_MANAGER); + _syncContract(REWARDS_MANAGER); + _syncContract(STAKING); + _syncContract(GRAPH_TOKEN); + _syncContract(GRAPH_TOKEN_GATEWAY); + _syncContract(GNS); + } +} diff --git a/packages/contracts/contracts/governance/Pausable.sol b/packages/contracts/contracts/governance/Pausable.sol new file mode 100644 index 000000000..2bc1795cd --- /dev/null +++ b/packages/contracts/contracts/governance/Pausable.sol @@ -0,0 +1,71 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.7.6 || 0.8.27; + +abstract contract Pausable { + /** + * @dev "Partial paused" pauses exit and enter functions for GRT, but not internal + * functions, such as allocating + */ + bool internal _partialPaused; + /** + * @dev Paused will pause all major protocol functions + */ + bool internal _paused; + + /// Timestamp for the last time the partial pause was set + uint256 public lastPartialPauseTime; + /// Timestamp for the last time the full pause was set + uint256 public lastPauseTime; + + /// Pause guardian is a separate entity from the governor that can + /// pause and unpause the protocol, fully or partially + address public pauseGuardian; + + /// Emitted when the partial pause state changed + event PartialPauseChanged(bool isPaused); + /// Emitted when the full pause state changed + event PauseChanged(bool isPaused); + /// Emitted when the pause guardian is changed + event NewPauseGuardian(address indexed oldPauseGuardian, address indexed pauseGuardian); + + /** + * @dev Change the partial paused state of the contract + * @param _toPartialPause New value for the partial pause state (true means the contracts will be partially paused) + */ + function _setPartialPaused(bool _toPartialPause) internal { + if (_toPartialPause == _partialPaused) { + return; + } + _partialPaused = _toPartialPause; + if (_partialPaused) { + lastPartialPauseTime = block.timestamp; + } + emit PartialPauseChanged(_partialPaused); + } + + /** + * @dev Change the paused state of the contract + * @param _toPause New value for the pause state (true means the contracts will be paused) + */ + function _setPaused(bool _toPause) internal { + if (_toPause == _paused) { + return; + } + _paused = _toPause; + if (_paused) { + lastPauseTime = block.timestamp; + } + emit PauseChanged(_paused); + } + + /** + * @dev Change the Pause Guardian + * @param newPauseGuardian The address of the new Pause Guardian + */ + function _setPauseGuardian(address newPauseGuardian) internal { + address oldPauseGuardian = pauseGuardian; + pauseGuardian = newPauseGuardian; + emit NewPauseGuardian(oldPauseGuardian, newPauseGuardian); + } +} diff --git a/packages/contracts/contracts/l2/curation/IL2Curation.sol b/packages/contracts/contracts/l2/curation/IL2Curation.sol new file mode 100644 index 000000000..7f93f9603 --- /dev/null +++ b/packages/contracts/contracts/l2/curation/IL2Curation.sol @@ -0,0 +1,46 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.7.6 || 0.8.27; + +/** + * @title Interface of the L2 Curation contract. + */ +interface IL2Curation { + /** + * @notice Set the subgraph service address. + * @param _subgraphService Address of the SubgraphService contract + */ + function setSubgraphService(address _subgraphService) external; + + /** + * @notice Deposit Graph Tokens in exchange for signal of a SubgraphDeployment curation pool. + * @dev This function charges no tax and can only be called by GNS in specific scenarios (for now + * only during an L1-L2 transfer). + * @param _subgraphDeploymentID Subgraph deployment pool from where to mint signal + * @param _tokensIn Amount of Graph Tokens to deposit + * @return Signal minted + */ + function mintTaxFree(bytes32 _subgraphDeploymentID, uint256 _tokensIn) external returns (uint256); + + /** + * @notice Calculate amount of signal that can be bought with tokens in a curation pool, + * without accounting for curation tax. + * @param _subgraphDeploymentID Subgraph deployment for which to mint signal + * @param _tokensIn Amount of tokens used to mint signal + * @return Amount of signal that can be bought + */ + function tokensToSignalNoTax(bytes32 _subgraphDeploymentID, uint256 _tokensIn) external view returns (uint256); + + /** + * @notice Calculate the amount of tokens that would be recovered if minting signal with + * the input tokens and then burning it. This can be used to compute rounding error. + * This function does not account for curation tax. + * @param _subgraphDeploymentID Subgraph deployment for which to mint signal + * @param _tokensIn Amount of tokens used to mint signal + * @return Amount of tokens that would be recovered after minting and burning signal + */ + function tokensToSignalToTokensNoTax( + bytes32 _subgraphDeploymentID, + uint256 _tokensIn + ) external view returns (uint256); +} diff --git a/packages/contracts/contracts/l2/curation/L2Curation.sol b/packages/contracts/contracts/l2/curation/L2Curation.sol new file mode 100644 index 000000000..f6d64209b --- /dev/null +++ b/packages/contracts/contracts/l2/curation/L2Curation.sol @@ -0,0 +1,502 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.7.6; +pragma abicoder v2; + +import { AddressUpgradeable } from "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol"; +import { SafeMathUpgradeable } from "@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol"; +import { ClonesUpgradeable } from "@openzeppelin/contracts-upgradeable/proxy/ClonesUpgradeable.sol"; + +import { GraphUpgradeable } from "../../upgrades/GraphUpgradeable.sol"; +import { TokenUtils } from "../../utils/TokenUtils.sol"; +import { IRewardsManager } from "../../rewards/IRewardsManager.sol"; +import { Managed } from "../../governance/Managed.sol"; +import { IGraphToken } from "../../token/IGraphToken.sol"; +import { CurationV3Storage } from "../../curation/CurationStorage.sol"; +import { IGraphCurationToken } from "../../curation/IGraphCurationToken.sol"; +import { IL2Curation } from "./IL2Curation.sol"; + +/** + * @title L2Curation contract + * @dev Allows curators to signal on subgraph deployments that might be relevant to indexers by + * staking Graph Tokens (GRT). Additionally, curators earn fees from the Query Market related to the + * subgraph deployment they curate. + * A curators deposit goes to a curation pool along with the deposits of other curators, + * only one such pool exists for each subgraph deployment. + * The contract mints Graph Curation Shares (GCS) according to a (flat) bonding curve for each individual + * curation pool where GRT is deposited. + * Holders can burn GCS using this contract to get GRT tokens back according to the + * bonding curve. + */ +contract L2Curation is CurationV3Storage, GraphUpgradeable, IL2Curation { + using SafeMathUpgradeable for uint256; + + /// @dev 100% in parts per million + uint32 private constant MAX_PPM = 1000000; + + /// @dev Amount of signal you get with your minimum token deposit + uint256 private constant SIGNAL_PER_MINIMUM_DEPOSIT = 1; // 1e-18 signal as 18 decimal number + + /// @dev Reserve ratio for all subgraphs set to 100% for a flat bonding curve + uint32 private immutable fixedReserveRatio = MAX_PPM; + + // -- Events -- + + /** + * @dev Emitted when `curator` deposited `tokens` on `subgraphDeploymentID` as curation signal. + * The `curator` receives `signal` amount according to the curation pool bonding curve. + * An amount of `curationTax` will be collected and burned. + */ + event Signalled( + address indexed curator, + bytes32 indexed subgraphDeploymentID, + uint256 tokens, + uint256 signal, + uint256 curationTax + ); + + /** + * @dev Emitted when `curator` burned `signal` for a `subgraphDeploymentID`. + * The curator will receive `tokens` according to the value of the bonding curve. + */ + event Burned(address indexed curator, bytes32 indexed subgraphDeploymentID, uint256 tokens, uint256 signal); + + /** + * @dev Emitted when `tokens` amount were collected for `subgraphDeploymentID` as part of fees + * distributed by an indexer from query fees received from state channels. + */ + event Collected(bytes32 indexed subgraphDeploymentID, uint256 tokens); + + /** + * @dev Emitted when the subgraph service is set. + */ + event SubgraphServiceSet(address indexed newSubgraphService); + + /** + * @dev Modifier for functions that can only be called by the GNS contract + */ + modifier onlyGNS() { + require(msg.sender == address(gns()), "Only the GNS can call this"); + _; + } + + /** + * @notice Initialize the L2Curation contract + * @param _controller Controller contract that manages this contract + * @param _curationTokenMaster Address of the GraphCurationToken master copy + * @param _curationTaxPercentage Percentage of curation tax to be collected + * @param _minimumCurationDeposit Minimum amount of tokens that can be deposited as curation signal + */ + function initialize( + address _controller, + address _curationTokenMaster, + uint32 _curationTaxPercentage, + uint256 _minimumCurationDeposit + ) external onlyImpl initializer { + Managed._initialize(_controller); + + // For backwards compatibility: + defaultReserveRatio = fixedReserveRatio; + emit ParameterUpdated("defaultReserveRatio"); + _setCurationTaxPercentage(_curationTaxPercentage); + _setMinimumCurationDeposit(_minimumCurationDeposit); + _setCurationTokenMaster(_curationTokenMaster); + } + + /** + * @notice Set the default reserve ratio - not implemented in L2 + * @dev We only keep this for compatibility with ICuration + */ + function setDefaultReserveRatio(uint32) external view override onlyGovernor { + revert("Not implemented in L2"); + } + + /** + * @dev Set the minimum deposit amount for curators. + * @notice Update the minimum deposit amount to `_minimumCurationDeposit` + * @param _minimumCurationDeposit Minimum amount of tokens required deposit + */ + function setMinimumCurationDeposit(uint256 _minimumCurationDeposit) external override onlyGovernor { + _setMinimumCurationDeposit(_minimumCurationDeposit); + } + + /** + * @notice Set the curation tax percentage to charge when a curator deposits GRT tokens. + * @param _percentage Curation tax percentage charged when depositing GRT tokens + */ + function setCurationTaxPercentage(uint32 _percentage) external override onlyGovernor { + _setCurationTaxPercentage(_percentage); + } + + /** + * @notice Set the master copy to use as clones for the curation token. + * @param _curationTokenMaster Address of implementation contract to use for curation tokens + */ + function setCurationTokenMaster(address _curationTokenMaster) external override onlyGovernor { + _setCurationTokenMaster(_curationTokenMaster); + } + + /** + * @notice Set the subgraph service address + * @param _subgraphService Address of the subgraph service contract + */ + function setSubgraphService(address _subgraphService) external override onlyGovernor { + subgraphService = _subgraphService; + emit SubgraphServiceSet(_subgraphService); + } + + /** + * @notice Assign Graph Tokens collected as curation fees to the curation pool reserve. + * @dev This function can only be called by the Staking contract and will do the Bookkeeping of + * transferred tokens into this contract. + * @param _subgraphDeploymentID SubgraphDeployment where funds should be allocated as reserves + * @param _tokens Amount of Graph Tokens to add to reserves + */ + function collect(bytes32 _subgraphDeploymentID, uint256 _tokens) external override { + // Only SubgraphService or Staking contract are authorized as caller + require(msg.sender == subgraphService || msg.sender == address(staking()), "Caller must be the subgraph service or staking contract"); + + // Must be curated to accept tokens + require(isCurated(_subgraphDeploymentID), "Subgraph deployment must be curated to collect fees"); + + // Collect new funds into reserve + CurationPool storage curationPool = pools[_subgraphDeploymentID]; + curationPool.tokens = curationPool.tokens.add(_tokens); + + emit Collected(_subgraphDeploymentID, _tokens); + } + + /** + * @notice Deposit Graph Tokens in exchange for signal of a SubgraphDeployment curation pool. + * @param _subgraphDeploymentID Subgraph deployment pool from where to mint signal + * @param _tokensIn Amount of Graph Tokens to deposit + * @param _signalOutMin Expected minimum amount of signal to receive + * @return Signal minted and deposit tax + */ + function mint( + bytes32 _subgraphDeploymentID, + uint256 _tokensIn, + uint256 _signalOutMin + ) external override notPartialPaused returns (uint256, uint256) { + // Need to deposit some funds + require(_tokensIn != 0, "Cannot deposit zero tokens"); + + // Exchange GRT tokens for GCS of the subgraph pool + (uint256 signalOut, uint256 curationTax) = tokensToSignal(_subgraphDeploymentID, _tokensIn); + + // Slippage protection + require(signalOut >= _signalOutMin, "Slippage protection"); + + address curator = msg.sender; + CurationPool storage curationPool = pools[_subgraphDeploymentID]; + + // If it hasn't been curated before then initialize the curve + if (!isCurated(_subgraphDeploymentID)) { + // Note we don't set the reserveRatio to save the gas + // cost, but in the pools() getter we'll inject the value. + + // If no signal token for the pool - create one + if (address(curationPool.gcs) == address(0)) { + // Use a minimal proxy to reduce gas cost + IGraphCurationToken gcs = IGraphCurationToken(ClonesUpgradeable.clone(curationTokenMaster)); + gcs.initialize(address(this)); + curationPool.gcs = gcs; + } + } + + // Trigger update rewards calculation snapshot + _updateRewards(_subgraphDeploymentID); + + // Transfer tokens from the curator to this contract + // Burn the curation tax + // NOTE: This needs to happen after _updateRewards snapshot as that function + // is using balanceOf(curation) + IGraphToken _graphToken = graphToken(); + TokenUtils.pullTokens(_graphToken, curator, _tokensIn); + TokenUtils.burnTokens(_graphToken, curationTax); + + // Update curation pool + curationPool.tokens = curationPool.tokens.add(_tokensIn.sub(curationTax)); + curationPool.gcs.mint(curator, signalOut); + + emit Signalled(curator, _subgraphDeploymentID, _tokensIn, signalOut, curationTax); + + return (signalOut, curationTax); + } + + /** + * @notice Deposit Graph Tokens in exchange for signal of a SubgraphDeployment curation pool. + * @dev This function charges no tax and can only be called by GNS in specific scenarios (for now + * only during an L1-L2 transfer). + * @param _subgraphDeploymentID Subgraph deployment pool from where to mint signal + * @param _tokensIn Amount of Graph Tokens to deposit + * @return Signal minted + */ + function mintTaxFree( + bytes32 _subgraphDeploymentID, + uint256 _tokensIn + ) external override notPartialPaused onlyGNS returns (uint256) { + // Need to deposit some funds + require(_tokensIn != 0, "Cannot deposit zero tokens"); + + // Exchange GRT tokens for GCS of the subgraph pool (no tax) + uint256 signalOut = _tokensToSignal(_subgraphDeploymentID, _tokensIn); + + address curator = msg.sender; + CurationPool storage curationPool = pools[_subgraphDeploymentID]; + + // If it hasn't been curated before then initialize the curve + if (!isCurated(_subgraphDeploymentID)) { + // Note we don't set the reserveRatio to save the gas + // cost, but in the pools() getter we'll inject the value. + + // If no signal token for the pool - create one + if (address(curationPool.gcs) == address(0)) { + // Use a minimal proxy to reduce gas cost + IGraphCurationToken gcs = IGraphCurationToken(ClonesUpgradeable.clone(curationTokenMaster)); + gcs.initialize(address(this)); + curationPool.gcs = gcs; + } + } + + // Trigger update rewards calculation snapshot + _updateRewards(_subgraphDeploymentID); + + // Transfer tokens from the curator to this contract + // NOTE: This needs to happen after _updateRewards snapshot as that function + // is using balanceOf(curation) + IGraphToken _graphToken = graphToken(); + TokenUtils.pullTokens(_graphToken, curator, _tokensIn); + + // Update curation pool + curationPool.tokens = curationPool.tokens.add(_tokensIn); + curationPool.gcs.mint(curator, signalOut); + + emit Signalled(curator, _subgraphDeploymentID, _tokensIn, signalOut, 0); + + return signalOut; + } + + /** + * @dev Return an amount of signal to get tokens back. + * @notice Burn _signalIn from the SubgraphDeployment curation pool + * @param _subgraphDeploymentID SubgraphDeployment for which the curator is returning signal + * @param _signalIn Amount of signal to return + * @param _tokensOutMin Expected minimum amount of tokens to receive + * @return Amount of tokens returned to the sender + */ + function burn( + bytes32 _subgraphDeploymentID, + uint256 _signalIn, + uint256 _tokensOutMin + ) external override notPartialPaused returns (uint256) { + address curator = msg.sender; + + // Validations + require(_signalIn != 0, "Cannot burn zero signal"); + require(getCuratorSignal(curator, _subgraphDeploymentID) >= _signalIn, "Cannot burn more signal than you own"); + + // Get the amount of tokens to refund based on returned signal + uint256 tokensOut = signalToTokens(_subgraphDeploymentID, _signalIn); + + // Slippage protection + require(tokensOut >= _tokensOutMin, "Slippage protection"); + + // Trigger update rewards calculation + _updateRewards(_subgraphDeploymentID); + + // Update curation pool + CurationPool storage curationPool = pools[_subgraphDeploymentID]; + curationPool.tokens = curationPool.tokens.sub(tokensOut); + curationPool.gcs.burnFrom(curator, _signalIn); + + // If all signal burnt delete the curation pool except for the + // curation token contract to avoid recreating it on a new mint + if (getCurationPoolSignal(_subgraphDeploymentID) == 0) { + curationPool.tokens = 0; + } + + // Return the tokens to the curator + TokenUtils.pushTokens(graphToken(), curator, tokensOut); + + emit Burned(curator, _subgraphDeploymentID, tokensOut, _signalIn); + + return tokensOut; + } + + /** + * @notice Get the amount of token reserves in a curation pool. + * @param _subgraphDeploymentID Subgraph deployment curation pool + * @return Amount of token reserves in the curation pool + */ + function getCurationPoolTokens(bytes32 _subgraphDeploymentID) external view override returns (uint256) { + return pools[_subgraphDeploymentID].tokens; + } + + /** + * @notice Check if any GRT tokens are deposited for a SubgraphDeployment. + * @param _subgraphDeploymentID SubgraphDeployment to check if curated + * @return True if curated + */ + function isCurated(bytes32 _subgraphDeploymentID) public view override returns (bool) { + return pools[_subgraphDeploymentID].tokens != 0; + } + + /** + * @notice Get the amount of signal a curator has in a curation pool. + * @param _curator Curator owning the signal tokens + * @param _subgraphDeploymentID Subgraph deployment curation pool + * @return Amount of signal owned by a curator for the subgraph deployment + */ + function getCuratorSignal(address _curator, bytes32 _subgraphDeploymentID) public view override returns (uint256) { + IGraphCurationToken gcs = pools[_subgraphDeploymentID].gcs; + return (address(gcs) == address(0)) ? 0 : gcs.balanceOf(_curator); + } + + /** + * @notice Get the amount of signal in a curation pool. + * @param _subgraphDeploymentID Subgraph deployment curation pool + * @return Amount of signal minted for the subgraph deployment + */ + function getCurationPoolSignal(bytes32 _subgraphDeploymentID) public view override returns (uint256) { + IGraphCurationToken gcs = pools[_subgraphDeploymentID].gcs; + return (address(gcs) == address(0)) ? 0 : gcs.totalSupply(); + } + + /** + * @notice Calculate amount of signal that can be bought with tokens in a curation pool. + * This function considers and excludes the deposit tax. + * @param _subgraphDeploymentID Subgraph deployment to mint signal + * @param _tokensIn Amount of tokens used to mint signal + * @return Amount of signal that can be bought + * @return Amount of GRT that would be subtracted as curation tax + */ + function tokensToSignal( + bytes32 _subgraphDeploymentID, + uint256 _tokensIn + ) public view override returns (uint256, uint256) { + // Calculate tokens after tax first, subtract that from the tokens in + // to get the curation tax to avoid rounding down to zero. + uint256 tokensAfterCurationTax = uint256(MAX_PPM).sub(curationTaxPercentage).mul(_tokensIn).div(MAX_PPM); + uint256 curationTax = _tokensIn.sub(tokensAfterCurationTax); + uint256 signalOut = _tokensToSignal(_subgraphDeploymentID, tokensAfterCurationTax); + return (signalOut, curationTax); + } + + /** + * @notice Calculate amount of signal that can be bought with tokens in a curation pool, + * without accounting for curation tax. + * @param _subgraphDeploymentID Subgraph deployment to mint signal + * @param _tokensIn Amount of tokens used to mint signal + * @return Amount of signal that can be bought + */ + function tokensToSignalNoTax( + bytes32 _subgraphDeploymentID, + uint256 _tokensIn + ) public view override returns (uint256) { + return _tokensToSignal(_subgraphDeploymentID, _tokensIn); + } + + /** + * @notice Calculate the amount of tokens that would be recovered if minting signal with + * the input tokens and then burning it. This can be used to compute rounding error. + * This function does not account for curation tax. + * @param _subgraphDeploymentID Subgraph deployment for which to mint signal + * @param _tokensIn Amount of tokens used to mint signal + * @return Amount of tokens that would be recovered after minting and burning signal + */ + function tokensToSignalToTokensNoTax( + bytes32 _subgraphDeploymentID, + uint256 _tokensIn + ) external view override returns (uint256) { + require(_tokensIn != 0, "Can't calculate with 0 tokens"); + uint256 signal = _tokensToSignal(_subgraphDeploymentID, _tokensIn); + CurationPool memory curationPool = pools[_subgraphDeploymentID]; + uint256 poolSignalAfter = getCurationPoolSignal(_subgraphDeploymentID).add(signal); + uint256 poolTokensAfter = curationPool.tokens.add(_tokensIn); + return poolTokensAfter.mul(signal).div(poolSignalAfter); + } + + /** + * @notice Calculate number of tokens to get when burning signal from a curation pool. + * @param _subgraphDeploymentID Subgraph deployment for which to burn signal + * @param _signalIn Amount of signal to burn + * @return Amount of tokens to get for an amount of signal + */ + function signalToTokens(bytes32 _subgraphDeploymentID, uint256 _signalIn) public view override returns (uint256) { + CurationPool memory curationPool = pools[_subgraphDeploymentID]; + uint256 curationPoolSignal = getCurationPoolSignal(_subgraphDeploymentID); + require(curationPool.tokens != 0, "Subgraph deployment must be curated to perform calculations"); + require(curationPoolSignal >= _signalIn, "Signal must be above or equal to signal issued in the curation pool"); + + return curationPool.tokens.mul(_signalIn).div(curationPoolSignal); + } + + /** + * @dev Internal: Set the minimum deposit amount for curators. + * Update the minimum deposit amount to `_minimumCurationDeposit` + * @param _minimumCurationDeposit Minimum amount of tokens required deposit + */ + function _setMinimumCurationDeposit(uint256 _minimumCurationDeposit) private { + require(_minimumCurationDeposit != 0, "Minimum curation deposit cannot be 0"); + + minimumCurationDeposit = _minimumCurationDeposit; + emit ParameterUpdated("minimumCurationDeposit"); + } + + /** + * @dev Internal: Set the curation tax percentage to charge when a curator deposits GRT tokens. + * @param _percentage Curation tax percentage charged when depositing GRT tokens + */ + function _setCurationTaxPercentage(uint32 _percentage) private { + require(_percentage <= MAX_PPM, "Curation tax percentage must be below or equal to MAX_PPM"); + + curationTaxPercentage = _percentage; + emit ParameterUpdated("curationTaxPercentage"); + } + + /** + * @dev Internal: Set the master copy to use as clones for the curation token. + * @param _curationTokenMaster Address of implementation contract to use for curation tokens + */ + function _setCurationTokenMaster(address _curationTokenMaster) private { + require(_curationTokenMaster != address(0), "Token master must be non-empty"); + require(AddressUpgradeable.isContract(_curationTokenMaster), "Token master must be a contract"); + + curationTokenMaster = _curationTokenMaster; + emit ParameterUpdated("curationTokenMaster"); + } + + /** + * @dev Triggers an update of rewards due to a change in signal. + * @param _subgraphDeploymentID Subgraph deployment updated + */ + function _updateRewards(bytes32 _subgraphDeploymentID) private { + IRewardsManager rewardsManager = rewardsManager(); + if (address(rewardsManager) != address(0)) { + rewardsManager.onSubgraphSignalUpdate(_subgraphDeploymentID); + } + } + + /** + * @dev Calculate amount of signal that can be bought with tokens in a curation pool. + * @param _subgraphDeploymentID Subgraph deployment to mint signal + * @param _tokensIn Amount of tokens used to mint signal + * @return Amount of signal that can be bought with tokens + */ + function _tokensToSignal(bytes32 _subgraphDeploymentID, uint256 _tokensIn) private view returns (uint256) { + // Get curation pool tokens and signal + CurationPool memory curationPool = pools[_subgraphDeploymentID]; + + // Init curation pool + if (curationPool.tokens == 0) { + require(_tokensIn >= minimumCurationDeposit, "Curation deposit is below minimum required"); + return + SIGNAL_PER_MINIMUM_DEPOSIT.add( + SIGNAL_PER_MINIMUM_DEPOSIT.mul(_tokensIn.sub(minimumCurationDeposit)).div(minimumCurationDeposit) + ); + } + + return getCurationPoolSignal(_subgraphDeploymentID).mul(_tokensIn).div(curationPool.tokens); + } +} diff --git a/packages/contracts/contracts/l2/discovery/IL2GNS.sol b/packages/contracts/contracts/l2/discovery/IL2GNS.sol new file mode 100644 index 000000000..a24216fbb --- /dev/null +++ b/packages/contracts/contracts/l2/discovery/IL2GNS.sol @@ -0,0 +1,56 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.7.6 || 0.8.27; + +import { ICallhookReceiver } from "../../gateway/ICallhookReceiver.sol"; + +/** + * @title Interface for the L2GNS contract. + */ +interface IL2GNS is ICallhookReceiver { + enum L1MessageCodes { + RECEIVE_SUBGRAPH_CODE, + RECEIVE_CURATOR_BALANCE_CODE + } + + /** + * @dev The SubgraphL2TransferData struct holds information + * about a subgraph related to its transfer from L1 to L2. + */ + struct SubgraphL2TransferData { + uint256 tokens; // GRT that will be sent to L2 to mint signal + mapping(address => bool) curatorBalanceClaimed; // True for curators whose balance has been claimed in L2 + bool l2Done; // Transfer finished on L2 side + uint256 subgraphReceivedOnL2BlockNumber; // Block number when the subgraph was received on L2 + } + + /** + * @notice Finish a subgraph transfer from L1. + * The subgraph must have been previously sent through the bridge + * using the sendSubgraphToL2 function on L1GNS. + * @param _l2SubgraphID Subgraph ID in L2 (aliased from the L1 subgraph ID) + * @param _subgraphDeploymentID Latest subgraph deployment to assign to the subgraph + * @param _subgraphMetadata IPFS hash of the subgraph metadata + * @param _versionMetadata IPFS hash of the version metadata + */ + function finishSubgraphTransferFromL1( + uint256 _l2SubgraphID, + bytes32 _subgraphDeploymentID, + bytes32 _subgraphMetadata, + bytes32 _versionMetadata + ) external; + + /** + * @notice Return the aliased L2 subgraph ID from a transferred L1 subgraph ID + * @param _l1SubgraphID L1 subgraph ID + * @return L2 subgraph ID + */ + function getAliasedL2SubgraphID(uint256 _l1SubgraphID) external pure returns (uint256); + + /** + * @notice Return the unaliased L1 subgraph ID from a transferred L2 subgraph ID + * @param _l2SubgraphID L2 subgraph ID + * @return L1subgraph ID + */ + function getUnaliasedL1SubgraphID(uint256 _l2SubgraphID) external pure returns (uint256); +} diff --git a/packages/contracts/contracts/l2/discovery/L2GNS.sol b/packages/contracts/contracts/l2/discovery/L2GNS.sol new file mode 100644 index 000000000..34d47d400 --- /dev/null +++ b/packages/contracts/contracts/l2/discovery/L2GNS.sol @@ -0,0 +1,321 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.7.6; +pragma abicoder v2; + +import { SafeMathUpgradeable } from "@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol"; + +import { GNS } from "../../discovery/GNS.sol"; +import { ICuration } from "../../curation/ICuration.sol"; +import { IL2GNS } from "./IL2GNS.sol"; +import { L2GNSV1Storage } from "./L2GNSStorage.sol"; + +import { IL2Curation } from "../curation/IL2Curation.sol"; + +/** + * @title L2GNS + * @dev The Graph Name System contract provides a decentralized naming system for subgraphs + * used in the scope of the Graph Network. It translates Subgraphs into Subgraph Versions. + * Each version is associated with a Subgraph Deployment. The contract has no knowledge of + * human-readable names. All human readable names emitted in events. + * The contract implements a multicall behaviour to support batching multiple calls in a single + * transaction. + * This particular contract is meant to be deployed in L2, and includes helper functions to + * receive subgraphs that are transferred from L1. + */ +contract L2GNS is GNS, L2GNSV1Storage, IL2GNS { + using SafeMathUpgradeable for uint256; + + /// Offset added to an L1 subgraph ID to compute the L2 subgraph ID alias + uint256 public constant SUBGRAPH_ID_ALIAS_OFFSET = + uint256(0x1111000000000000000000000000000000000000000000000000000000001111); + + /// Maximum rounding error when receiving signal tokens from L1, in parts-per-million. + /// If the error from minting signal is above this, tokens will be sent back to the curator. + uint256 public constant MAX_ROUNDING_ERROR = 1000; + + /// @dev 100% expressed in parts-per-million + uint256 private constant MAX_PPM = 1000000; + + /// @dev Emitted when a subgraph is received from L1 through the bridge + event SubgraphReceivedFromL1( + uint256 indexed _l1SubgraphID, + uint256 indexed _l2SubgraphID, + address indexed _owner, + uint256 _tokens + ); + /// @dev Emitted when a subgraph transfer from L1 is finalized, so the subgraph is published on L2 + event SubgraphL2TransferFinalized(uint256 indexed _l2SubgraphID); + /// @dev Emitted when the L1 balance for a curator has been claimed + event CuratorBalanceReceived( + uint256 indexed _l1SubgraphId, + uint256 indexed _l2SubgraphID, + address indexed _l2Curator, + uint256 _tokens + ); + /// @dev Emitted when the L1 balance for a curator has been returned to the beneficiary. + /// This can happen if the subgraph transfer was not finished when the curator's tokens arrived. + event CuratorBalanceReturnedToBeneficiary( + uint256 indexed _l1SubgraphID, + address indexed _l2Curator, + uint256 _tokens + ); + + /** + * @dev Checks that the sender is the L2GraphTokenGateway as configured on the Controller. + */ + modifier onlyL2Gateway() { + require(msg.sender == address(graphTokenGateway()), "ONLY_GATEWAY"); + _; + } + + /** + * @notice Receive tokens with a callhook from the bridge. + * The callhook will receive a subgraph or a curator's balance from L1. The _data parameter + * must contain the ABI encoding of: + * (uint8 code, uint256 subgraphId, address beneficiary) + * Where `code` is one of the codes defined in IL2GNS.L1MessageCodes. + * If the code is RECEIVE_SUBGRAPH_CODE, the beneficiary is the address of the + * owner of the subgraph on L2. + * If the code is RECEIVE_CURATOR_BALANCE_CODE, then the beneficiary is the + * address of the curator in L2. In this case, If the subgraph transfer was never finished + * (or the subgraph doesn't exist), the tokens will be sent to the curator. + * @dev This function is called by the L2GraphTokenGateway contract. + * @param _from Token sender in L1 (must be the L1GNS) + * @param _amount Amount of tokens that were transferred + * @param _data ABI-encoded callhook data + */ + function onTokenTransfer( + address _from, + uint256 _amount, + bytes calldata _data + ) external override notPartialPaused onlyL2Gateway { + require(_from == counterpartGNSAddress, "ONLY_L1_GNS_THROUGH_BRIDGE"); + (uint8 code, uint256 l1SubgraphID, address beneficiary) = abi.decode(_data, (uint8, uint256, address)); + + if (code == uint8(L1MessageCodes.RECEIVE_SUBGRAPH_CODE)) { + _receiveSubgraphFromL1(l1SubgraphID, beneficiary, _amount); + } else if (code == uint8(L1MessageCodes.RECEIVE_CURATOR_BALANCE_CODE)) { + _mintSignalFromL1(l1SubgraphID, beneficiary, _amount); + } else { + revert("INVALID_CODE"); + } + } + + /** + * @notice Finish a subgraph transfer from L1. + * The subgraph must have been previously sent through the bridge + * using the sendSubgraphToL2 function on L1GNS. + * @param _l2SubgraphID Subgraph ID (aliased from the L1 subgraph ID) + * @param _subgraphDeploymentID Latest subgraph deployment to assign to the subgraph + * @param _subgraphMetadata IPFS hash of the subgraph metadata + * @param _versionMetadata IPFS hash of the version metadata + */ + function finishSubgraphTransferFromL1( + uint256 _l2SubgraphID, + bytes32 _subgraphDeploymentID, + bytes32 _subgraphMetadata, + bytes32 _versionMetadata + ) external override notPartialPaused onlySubgraphAuth(_l2SubgraphID) { + IL2GNS.SubgraphL2TransferData storage transferData = subgraphL2TransferData[_l2SubgraphID]; + SubgraphData storage subgraphData = _getSubgraphData(_l2SubgraphID); + require(transferData.subgraphReceivedOnL2BlockNumber != 0, "INVALID_SUBGRAPH"); + require(!transferData.l2Done, "ALREADY_DONE"); + transferData.l2Done = true; + + // New subgraph deployment must be non-empty + require(_subgraphDeploymentID != 0, "GNS: deploymentID != 0"); + + IL2Curation curation = IL2Curation(address(curation())); + + uint256 vSignal; + uint256 nSignal; + uint256 roundingError; + uint256 tokens = transferData.tokens; + { + // This can't revert because the bridge ensures that _tokensIn is > 0, + // and the minimum curation in L2 is 1 wei GRT + uint256 tokensAfter = curation.tokensToSignalToTokensNoTax(_subgraphDeploymentID, tokens); + roundingError = tokens.sub(tokensAfter).mul(MAX_PPM).div(tokens); + } + if (roundingError <= MAX_ROUNDING_ERROR) { + vSignal = curation.mintTaxFree(_subgraphDeploymentID, tokens); + nSignal = vSignalToNSignal(_l2SubgraphID, vSignal); + emit SignalMinted(_l2SubgraphID, msg.sender, nSignal, vSignal, tokens); + emit SubgraphUpgraded(_l2SubgraphID, vSignal, tokens, _subgraphDeploymentID); + } else { + graphToken().transfer(msg.sender, tokens); + emit CuratorBalanceReturnedToBeneficiary(getUnaliasedL1SubgraphID(_l2SubgraphID), msg.sender, tokens); + emit SubgraphUpgraded(_l2SubgraphID, vSignal, 0, _subgraphDeploymentID); + } + + subgraphData.disabled = false; + subgraphData.vSignal = vSignal; + subgraphData.nSignal = nSignal; + subgraphData.curatorNSignal[msg.sender] = nSignal; + subgraphData.subgraphDeploymentID = _subgraphDeploymentID; + // Set the token metadata + _setSubgraphMetadata(_l2SubgraphID, _subgraphMetadata); + emit SubgraphPublished(_l2SubgraphID, _subgraphDeploymentID, fixedReserveRatio); + emit SubgraphVersionUpdated(_l2SubgraphID, _subgraphDeploymentID, _versionMetadata); + emit SubgraphL2TransferFinalized(_l2SubgraphID); + } + + /** + * @notice Publish a new version of an existing subgraph. + * @dev This is the same as the one in the base GNS, but skips the check for + * a subgraph to not be pre-curated, as the reserve ratio in L2 is set to 1, + * which prevents the risk of rug-pulling. + * @param _subgraphID Subgraph ID + * @param _subgraphDeploymentID Subgraph deployment ID of the new version + * @param _versionMetadata IPFS hash for the subgraph version metadata + */ + function publishNewVersion( + uint256 _subgraphID, + bytes32 _subgraphDeploymentID, + bytes32 _versionMetadata + ) external override notPaused onlySubgraphAuth(_subgraphID) { + // Perform the upgrade from the current subgraph deployment to the new one. + // This involves burning all signal from the old deployment and using the funds to buy + // from the new deployment. + // This will also make the change to target to the new deployment. + + // Subgraph check + SubgraphData storage subgraphData = _getSubgraphOrRevert(_subgraphID); + + // New subgraph deployment must be non-empty + require(_subgraphDeploymentID != 0, "GNS: Cannot set deploymentID to 0 in publish"); + + // New subgraph deployment must be different than current + require( + _subgraphDeploymentID != subgraphData.subgraphDeploymentID, + "GNS: Cannot publish a new version with the same subgraph deployment ID" + ); + + ICuration curation = curation(); + + // Move all signal from previous version to new version + // NOTE: We will only do this as long as there is signal on the subgraph + if (subgraphData.nSignal != 0) { + // Burn all version signal in the name pool for tokens (w/no slippage protection) + // Sell all signal from the old deployment + uint256 tokens = curation.burn(subgraphData.subgraphDeploymentID, subgraphData.vSignal, 0); + + // Take the owner cut of the curation tax, add it to the total + // Upgrade is only callable by the owner, we assume then that msg.sender = owner + address subgraphOwner = msg.sender; + uint256 tokensWithTax = _chargeOwnerTax(tokens, subgraphOwner, curation.curationTaxPercentage()); + + // Update pool: constant nSignal, vSignal can change (w/no slippage protection) + // Buy all signal from the new deployment + (subgraphData.vSignal, ) = curation.mint(_subgraphDeploymentID, tokensWithTax, 0); + + emit SubgraphUpgraded(_subgraphID, subgraphData.vSignal, tokensWithTax, _subgraphDeploymentID); + } + + // Update target deployment + subgraphData.subgraphDeploymentID = _subgraphDeploymentID; + + emit SubgraphVersionUpdated(_subgraphID, _subgraphDeploymentID, _versionMetadata); + } + + /** + * @notice Return the aliased L2 subgraph ID from a transferred L1 subgraph ID + * @param _l1SubgraphID L1 subgraph ID + * @return L2 subgraph ID + */ + function getAliasedL2SubgraphID(uint256 _l1SubgraphID) public pure override returns (uint256) { + return _l1SubgraphID + SUBGRAPH_ID_ALIAS_OFFSET; + } + + /** + * @notice Return the unaliased L1 subgraph ID from a transferred L2 subgraph ID + * @param _l2SubgraphID L2 subgraph ID + * @return L1subgraph ID + */ + function getUnaliasedL1SubgraphID(uint256 _l2SubgraphID) public pure override returns (uint256) { + return _l2SubgraphID - SUBGRAPH_ID_ALIAS_OFFSET; + } + + /** + * @dev Receive a subgraph from L1. + * This function will initialize a subgraph received through the bridge, + * and store the transfer data so that it's finalized later using finishSubgraphTransferFromL1. + * @param _l1SubgraphID Subgraph ID in L1 (will be aliased) + * @param _subgraphOwner Owner of the subgraph + * @param _tokens Tokens to be deposited in the subgraph + */ + function _receiveSubgraphFromL1(uint256 _l1SubgraphID, address _subgraphOwner, uint256 _tokens) internal { + uint256 l2SubgraphID = getAliasedL2SubgraphID(_l1SubgraphID); + SubgraphData storage subgraphData = _getSubgraphData(l2SubgraphID); + IL2GNS.SubgraphL2TransferData storage transferData = subgraphL2TransferData[l2SubgraphID]; + + subgraphData.__DEPRECATED_reserveRatio = fixedReserveRatio; + // The subgraph will be disabled until finishSubgraphTransferFromL1 is called + subgraphData.disabled = true; + + transferData.tokens = _tokens; + transferData.subgraphReceivedOnL2BlockNumber = block.number; + + // Mint the NFT. Use the subgraphID as tokenID. + // This function will check the if tokenID already exists. + // Note we do this here so that we can later do the onlySubgraphAuth + // check in finishSubgraphTransferFromL1. + _mintNFT(_subgraphOwner, l2SubgraphID); + + emit SubgraphReceivedFromL1(_l1SubgraphID, l2SubgraphID, _subgraphOwner, _tokens); + } + + /** + * @notice Deposit GRT into a subgraph and mint signal, using tokens received from L1. + * If the subgraph transfer was never finished (or the subgraph doesn't exist), the tokens will be sent to the curator. + * @dev This looks a lot like GNS.mintSignal, but doesn't pull the tokens from the + * curator and has no slippage protection. + * @param _l1SubgraphID Subgraph ID in L1 (will be aliased) + * @param _curator Curator address + * @param _tokensIn The amount of tokens the nameCurator wants to deposit + */ + function _mintSignalFromL1(uint256 _l1SubgraphID, address _curator, uint256 _tokensIn) internal { + uint256 l2SubgraphID = getAliasedL2SubgraphID(_l1SubgraphID); + IL2GNS.SubgraphL2TransferData storage transferData = subgraphL2TransferData[l2SubgraphID]; + SubgraphData storage subgraphData = _getSubgraphData(l2SubgraphID); + + IL2Curation curation = IL2Curation(address(curation())); + uint256 roundingError; + if (transferData.l2Done && !subgraphData.disabled) { + // This can't revert because the bridge ensures that _tokensIn is > 0, + // and the minimum curation in L2 is 1 wei GRT + uint256 tokensAfter = curation.tokensToSignalToTokensNoTax(subgraphData.subgraphDeploymentID, _tokensIn); + roundingError = _tokensIn.sub(tokensAfter).mul(MAX_PPM).div(_tokensIn); + } + // If subgraph transfer wasn't finished, we should send the tokens to the curator + if (!transferData.l2Done || subgraphData.disabled || roundingError > MAX_ROUNDING_ERROR) { + graphToken().transfer(_curator, _tokensIn); + emit CuratorBalanceReturnedToBeneficiary(_l1SubgraphID, _curator, _tokensIn); + } else { + // Get name signal to mint for tokens deposited + uint256 vSignal = curation.mintTaxFree(subgraphData.subgraphDeploymentID, _tokensIn); + uint256 nSignal = vSignalToNSignal(l2SubgraphID, vSignal); + + // Update pools + subgraphData.vSignal = subgraphData.vSignal.add(vSignal); + subgraphData.nSignal = subgraphData.nSignal.add(nSignal); + subgraphData.curatorNSignal[_curator] = subgraphData.curatorNSignal[_curator].add(nSignal); + + emit SignalMinted(l2SubgraphID, _curator, nSignal, vSignal, _tokensIn); + emit CuratorBalanceReceived(_l1SubgraphID, l2SubgraphID, _curator, _tokensIn); + } + } + + /** + * @dev Get subgraph data. + * Since there are no legacy subgraphs in L2, we override the base + * GNS method to save us the step of checking for legacy subgraphs. + * @param _subgraphID Subgraph ID + * @return Subgraph Data + */ + function _getSubgraphData(uint256 _subgraphID) internal view override returns (SubgraphData storage) { + // Return new subgraph type + return subgraphs[_subgraphID]; + } +} diff --git a/packages/contracts/contracts/l2/discovery/L2GNSStorage.sol b/packages/contracts/contracts/l2/discovery/L2GNSStorage.sol new file mode 100644 index 000000000..f658c49d9 --- /dev/null +++ b/packages/contracts/contracts/l2/discovery/L2GNSStorage.sol @@ -0,0 +1,18 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.7.6; +pragma abicoder v2; + +import { IL2GNS } from "./IL2GNS.sol"; + +/** + * @title L2GNSV1Storage + * @notice This contract holds all the L2-specific storage variables for the L2GNS contract, version 1 + * @dev + */ +abstract contract L2GNSV1Storage { + /// Data for subgraph transfer from L1 to L2 + mapping(uint256 => IL2GNS.SubgraphL2TransferData) public subgraphL2TransferData; + /// @dev Storage gap to keep storage slots fixed in future versions + uint256[50] private __gap; +} diff --git a/packages/contracts/contracts/l2/gateway/L2GraphTokenGateway.sol b/packages/contracts/contracts/l2/gateway/L2GraphTokenGateway.sol new file mode 100644 index 000000000..be8f212b8 --- /dev/null +++ b/packages/contracts/contracts/l2/gateway/L2GraphTokenGateway.sol @@ -0,0 +1,290 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.7.6; +pragma abicoder v2; + +import { ReentrancyGuardUpgradeable } from "@openzeppelin/contracts-upgradeable/utils/ReentrancyGuardUpgradeable.sol"; +import { SafeMathUpgradeable } from "@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol"; + +import { L2ArbitrumMessenger } from "../../arbitrum/L2ArbitrumMessenger.sol"; +import { AddressAliasHelper } from "../../arbitrum/AddressAliasHelper.sol"; +import { ITokenGateway } from "../../arbitrum/ITokenGateway.sol"; +import { Managed } from "../../governance/Managed.sol"; +import { GraphTokenGateway } from "../../gateway/GraphTokenGateway.sol"; +import { ICallhookReceiver } from "../../gateway/ICallhookReceiver.sol"; +import { L2GraphToken } from "../token/L2GraphToken.sol"; + +/** + * @title L2 Graph Token Gateway Contract + * @dev Provides the L2 side of the Ethereum-Arbitrum GRT bridge. Receives GRT from the L1 chain + * and mints them on the L2 side. Sends GRT back to L1 by burning them on the L2 side. + * Based on Offchain Labs' reference implementation and Livepeer's arbitrum-lpt-bridge + * (See: https://github.com/OffchainLabs/arbitrum/tree/master/packages/arb-bridge-peripherals/contracts/tokenbridge + * and https://github.com/livepeer/arbitrum-lpt-bridge) + */ +contract L2GraphTokenGateway is GraphTokenGateway, L2ArbitrumMessenger, ReentrancyGuardUpgradeable { + using SafeMathUpgradeable for uint256; + + /// Address of the Graph Token contract on L1 + address public l1GRT; + /// Address of the L1GraphTokenGateway that is the counterpart of this gateway on L1 + address public l1Counterpart; + /// Address of the Arbitrum Gateway Router on L2 + address public l2Router; + + /// @dev Calldata included in an outbound transfer, stored as a structure for convenience and stack depth + struct OutboundCalldata { + address from; + bytes extraData; + } + + /// Emitted when an incoming transfer is finalized, i.e. tokens were deposited from L1 to L2 + event DepositFinalized(address indexed l1Token, address indexed from, address indexed to, uint256 amount); + + /// Emitted when an outbound transfer is initiated, i.e. tokens are being withdrawn from L2 back to L1 + event WithdrawalInitiated( + address l1Token, + address indexed from, + address indexed to, + uint256 indexed l2ToL1Id, + uint256 exitNum, + uint256 amount + ); + + /// Emitted when the Arbitrum Gateway Router address on L2 has been updated + event L2RouterSet(address l2Router); + /// Emitted when the L1 Graph Token address has been updated + event L1TokenAddressSet(address l1GRT); + /// Emitted when the address of the counterpart gateway on L1 has been updated + event L1CounterpartAddressSet(address l1Counterpart); + + /** + * @dev Checks that the sender is the L2 alias of the counterpart + * gateway on L1. + */ + modifier onlyL1Counterpart() { + require(msg.sender == AddressAliasHelper.applyL1ToL2Alias(l1Counterpart), "ONLY_COUNTERPART_GATEWAY"); + _; + } + + /** + * @notice Initialize the L2GraphTokenGateway contract. + * @dev The contract will be paused. + * Note some parameters have to be set separately as they are generally + * not expected to be available at initialization time: + * - l2Router using setL2Router + * - l1GRT using setL1TokenAddress + * - l1Counterpart using setL1CounterpartAddress + * - pauseGuardian using setPauseGuardian + * @param _controller Address of the Controller that manages this contract + */ + function initialize(address _controller) external onlyImpl initializer { + Managed._initialize(_controller); + _paused = true; + __ReentrancyGuard_init(); + } + + /** + * @notice Sets the address of the Arbitrum Gateway Router on L2 + * @param _l2Router Address of the L2 Router (provided by Arbitrum) + */ + function setL2Router(address _l2Router) external onlyGovernor { + require(_l2Router != address(0), "INVALID_L2_ROUTER"); + l2Router = _l2Router; + emit L2RouterSet(_l2Router); + } + + /** + * @notice Sets the address of the Graph Token on L1 + * @param _l1GRT L1 address of the Graph Token contract + */ + function setL1TokenAddress(address _l1GRT) external onlyGovernor { + require(_l1GRT != address(0), "INVALID_L1_GRT"); + l1GRT = _l1GRT; + emit L1TokenAddressSet(_l1GRT); + } + + /** + * @notice Sets the address of the counterpart gateway on L1 + * @param _l1Counterpart Address of the L1GraphTokenGateway on L1 + */ + function setL1CounterpartAddress(address _l1Counterpart) external onlyGovernor { + require(_l1Counterpart != address(0), "INVALID_L1_COUNTERPART"); + l1Counterpart = _l1Counterpart; + emit L1CounterpartAddressSet(_l1Counterpart); + } + + /** + * @notice Burns L2 tokens and initiates a transfer to L1. + * The tokens will be received on L1 only after the wait period (7 days) is over, + * and will require an Outbox.executeTransaction to finalize. + * @dev no additional callhook data is allowed + * @param _l1Token L1 Address of GRT (needed for compatibility with Arbitrum Gateway Router) + * @param _to Recipient address on L1 + * @param _amount Amount of tokens to burn + * @param _data Contains sender and additional data to send to L1 + * @return ID of the withdraw tx + */ + function outboundTransfer( + address _l1Token, + address _to, + uint256 _amount, + bytes calldata _data + ) external returns (bytes memory) { + return outboundTransfer(_l1Token, _to, _amount, 0, 0, _data); + } + + /** + * @notice Receives token amount from L1 and mints the equivalent tokens to the receiving address + * @dev Only accepts transactions from the L1 GRT Gateway. + * The function is payable for ITokenGateway compatibility, but msg.value must be zero. + * Note that allowlisted senders (some protocol contracts) can include additional calldata + * for a callhook to be executed on the L2 side when the tokens are received. In this case, the L2 transaction + * can revert if the callhook reverts, potentially locking the tokens on the bridge if the callhook + * never succeeds. This requires extra care when adding contracts to the allowlist, but is necessary to ensure that + * the tickets can be retried in the case of a temporary failure, and to ensure the atomicity of callhooks + * with token transfers. + * @param _l1Token L1 Address of GRT + * @param _from Address of the sender on L1 + * @param _to Recipient address on L2 + * @param _amount Amount of tokens transferred + * @param _data Extra callhook data, only used when the sender is allowlisted + */ + function finalizeInboundTransfer( + address _l1Token, + address _from, + address _to, + uint256 _amount, + bytes calldata _data + ) external payable override nonReentrant notPaused onlyL1Counterpart { + require(_l1Token == l1GRT, "TOKEN_NOT_GRT"); + require(msg.value == 0, "INVALID_NONZERO_VALUE"); + + L2GraphToken(calculateL2TokenAddress(l1GRT)).bridgeMint(_to, _amount); + + if (_data.length > 0) { + ICallhookReceiver(_to).onTokenTransfer(_from, _amount, _data); + } + + emit DepositFinalized(_l1Token, _from, _to, _amount); + } + + /** + * @notice Burns L2 tokens and initiates a transfer to L1. + * The tokens will be available on L1 only after the wait period (7 days) is over, + * and will require an Outbox.executeTransaction to finalize. + * Note that the caller must previously allow the gateway to spend the specified amount of GRT. + * @dev no additional callhook data is allowed. The two unused params are needed + * for compatibility with Arbitrum's gateway router. + * The function is payable for ITokenGateway compatibility, but msg.value must be zero. + * @param _l1Token L1 Address of GRT (needed for compatibility with Arbitrum Gateway Router) + * @param _to Recipient address on L1 + * @param _amount Amount of tokens to burn + * @param _data Contains sender and additional data (always empty) to send to L1 + * @return ID of the withdraw transaction + */ + function outboundTransfer( + address _l1Token, + address _to, + uint256 _amount, + uint256, // unused on L2 + uint256, // unused on L2 + bytes calldata _data + ) public payable override nonReentrant notPaused returns (bytes memory) { + require(_l1Token == l1GRT, "TOKEN_NOT_GRT"); + require(_amount != 0, "INVALID_ZERO_AMOUNT"); + require(msg.value == 0, "INVALID_NONZERO_VALUE"); + require(_to != address(0), "INVALID_DESTINATION"); + + OutboundCalldata memory outboundCalldata; + + (outboundCalldata.from, outboundCalldata.extraData) = _parseOutboundData(_data); + require(outboundCalldata.extraData.length == 0, "CALL_HOOK_DATA_NOT_ALLOWED"); + + // from needs to approve this contract to burn the amount first + L2GraphToken(calculateL2TokenAddress(l1GRT)).bridgeBurn(outboundCalldata.from, _amount); + + uint256 id = sendTxToL1( + 0, + outboundCalldata.from, + l1Counterpart, + getOutboundCalldata(_l1Token, outboundCalldata.from, _to, _amount, outboundCalldata.extraData) + ); + + // we don't need to track exitNums (b/c we have no fast exits) so we always use 0 + emit WithdrawalInitiated(_l1Token, outboundCalldata.from, _to, id, 0, _amount); + + return abi.encode(id); + } + + /** + * @notice Calculate the L2 address of a bridged token + * @dev In our case, this would only work for GRT. + * @param l1ERC20 address of L1 GRT contract + * @return L2 address of the bridged GRT token + */ + function calculateL2TokenAddress(address l1ERC20) public view override returns (address) { + if (l1ERC20 != l1GRT) { + return address(0); + } + return address(graphToken()); + } + + /** + * @notice Creates calldata required to send tx to L1 + * @dev encodes the target function with its params which + * will be called on L1 when the message is received on L1 + * @param _token Address of the token on L1 + * @param _from Address of the token sender on L2 + * @param _to Address to which we're sending tokens on L1 + * @param _amount Amount of GRT to transfer + * @param _data Additional calldata for the transaction + * @return Calldata for a transaction sent to L1 + */ + function getOutboundCalldata( + address _token, + address _from, + address _to, + uint256 _amount, + bytes memory _data + ) public pure returns (bytes memory) { + return + abi.encodeWithSelector( + ITokenGateway.finalizeInboundTransfer.selector, + _token, + _from, + _to, + _amount, + abi.encode(0, _data) // we don't need to track exitNums (b/c we have no fast exits) so we always use 0 + ); + } + + /** + * @dev Runs state validation before unpausing, reverts if + * something is not set properly + */ + function _checksBeforeUnpause() internal view override { + require(l2Router != address(0), "L2_ROUTER_NOT_SET"); + require(l1Counterpart != address(0), "L1_COUNTERPART_NOT_SET"); + require(l1GRT != address(0), "L1_GRT_NOT_SET"); + } + + /** + * @notice Decodes calldata required for transfer of tokens to L1 + * @dev extraData can be left empty + * @param _data Encoded callhook data + * @return Sender of the tx + * @return Any other data sent to L1 + */ + function _parseOutboundData(bytes calldata _data) private view returns (address, bytes memory) { + address from; + bytes memory extraData; + if (msg.sender == l2Router) { + (from, extraData) = abi.decode(_data, (address, bytes)); + } else { + from = msg.sender; + extraData = _data; + } + return (from, extraData); + } +} diff --git a/packages/contracts/contracts/l2/staking/IL2Staking.sol b/packages/contracts/contracts/l2/staking/IL2Staking.sol new file mode 100644 index 000000000..4b7748e31 --- /dev/null +++ b/packages/contracts/contracts/l2/staking/IL2Staking.sol @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity >=0.6.12 <0.8.0; +pragma abicoder v2; + +import { IStaking } from "../../staking/IStaking.sol"; +import { IL2StakingBase } from "./IL2StakingBase.sol"; +import { IL2StakingTypes } from "./IL2StakingTypes.sol"; + +/** + * @title Interface for the L2 Staking contract + * @notice This is the interface that should be used when interacting with the L2 Staking contract. + * It extends the IStaking interface with the functions that are specific to L2, adding the callhook receiver + * to receive transferred stake and delegation from L1. + * @dev Note that L2Staking doesn't actually inherit this interface. This is because of + * the custom setup of the Staking contract where part of the functionality is implemented + * in a separate contract (StakingExtension) to which calls are delegated through the fallback function. + */ +interface IL2Staking is IStaking, IL2StakingBase, IL2StakingTypes {} diff --git a/packages/contracts/contracts/l2/staking/IL2StakingBase.sol b/packages/contracts/contracts/l2/staking/IL2StakingBase.sol new file mode 100644 index 000000000..f5c33c2d0 --- /dev/null +++ b/packages/contracts/contracts/l2/staking/IL2StakingBase.sol @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.7.6 || 0.8.27; + +import { ICallhookReceiver } from "../../gateway/ICallhookReceiver.sol"; + +/** + * @title Base interface for the L2Staking contract. + * @notice This interface is used to define the callhook receiver interface that is implemented by L2Staking. + * @dev Note it includes only the L2-specific functionality, not the full IStaking interface. + */ +interface IL2StakingBase is ICallhookReceiver { + event TransferredDelegationReturnedToDelegator(address indexed indexer, address indexed delegator, uint256 amount); +} diff --git a/packages/contracts/contracts/l2/staking/IL2StakingTypes.sol b/packages/contracts/contracts/l2/staking/IL2StakingTypes.sol new file mode 100644 index 000000000..500694e89 --- /dev/null +++ b/packages/contracts/contracts/l2/staking/IL2StakingTypes.sol @@ -0,0 +1,22 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.7.6 || 0.8.27; + +interface IL2StakingTypes { + /// @dev Message codes for the L1 -> L2 bridge callhook + enum L1MessageCodes { + RECEIVE_INDEXER_STAKE_CODE, + RECEIVE_DELEGATION_CODE + } + + /// @dev Encoded message struct when receiving indexer stake through the bridge + struct ReceiveIndexerStakeData { + address indexer; + } + + /// @dev Encoded message struct when receiving delegation through the bridge + struct ReceiveDelegationData { + address indexer; + address delegator; + } +} diff --git a/packages/contracts/contracts/l2/staking/L2Staking.sol b/packages/contracts/contracts/l2/staking/L2Staking.sol new file mode 100644 index 000000000..f1fcdeb70 --- /dev/null +++ b/packages/contracts/contracts/l2/staking/L2Staking.sol @@ -0,0 +1,144 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.7.6; +pragma abicoder v2; + +import { SafeMath } from "@openzeppelin/contracts/math/SafeMath.sol"; +import { Staking } from "../../staking/Staking.sol"; +import { IL2StakingBase } from "./IL2StakingBase.sol"; +import { IL2Staking } from "./IL2Staking.sol"; +import { Stakes } from "../../staking/libs/Stakes.sol"; +import { IStakes } from "../../staking/libs/IStakes.sol"; +import { IL2StakingTypes } from "./IL2StakingTypes.sol"; + +/** + * @title L2Staking contract + * @dev This contract is the L2 variant of the Staking contract. It adds a function + * to receive an indexer's stake or delegation from L1. Note that this contract inherits Staking, + * which uses a StakingExtension contract to implement the full IStaking interface through delegatecalls. + */ +contract L2Staking is Staking, IL2StakingBase { + using SafeMath for uint256; + using Stakes for IStakes.Indexer; + + /// @dev Minimum amount of tokens that can be delegated + uint256 private constant MINIMUM_DELEGATION = 1e18; + + /** + * @dev Emitted when `delegator` delegated `tokens` to the `indexer`, the delegator + * gets `shares` for the delegation pool proportionally to the tokens staked. + * This is copied from IStakingExtension, but we can't inherit from it because we + * don't implement the full interface here. + */ + event StakeDelegated(address indexed indexer, address indexed delegator, uint256 tokens, uint256 shares); + + /** + * @dev Checks that the sender is the L2GraphTokenGateway as configured on the Controller. + */ + modifier onlyL2Gateway() { + require(msg.sender == address(graphTokenGateway()), "ONLY_GATEWAY"); + _; + } + + /** + * @notice Receive ETH into the L2Staking contract: this will always revert + * @dev This function is only here to prevent ETH from being sent to the contract + */ + receive() external payable { + revert("RECEIVE_ETH_NOT_ALLOWED"); + } + + /** + * @notice Receive tokens with a callhook from the bridge. + * @dev The encoded _data can contain information about an indexer's stake + * or a delegator's delegation. + * See L1MessageCodes in IL2Staking for the supported messages. + * @param _from Token sender in L1 + * @param _amount Amount of tokens that were transferred + * @param _data ABI-encoded callhook data which must include a uint8 code and either a ReceiveIndexerStakeData or ReceiveDelegationData struct. + */ + function onTokenTransfer( + address _from, + uint256 _amount, + bytes calldata _data + ) external override notPartialPaused onlyL2Gateway { + require(_from == counterpartStakingAddress, "ONLY_L1_STAKING_THROUGH_BRIDGE"); + (uint8 code, bytes memory functionData) = abi.decode(_data, (uint8, bytes)); + + if (code == uint8(IL2StakingTypes.L1MessageCodes.RECEIVE_INDEXER_STAKE_CODE)) { + IL2StakingTypes.ReceiveIndexerStakeData memory indexerData = abi.decode( + functionData, + (IL2StakingTypes.ReceiveIndexerStakeData) + ); + _receiveIndexerStake(_amount, indexerData); + } else if (code == uint8(IL2StakingTypes.L1MessageCodes.RECEIVE_DELEGATION_CODE)) { + IL2StakingTypes.ReceiveDelegationData memory delegationData = abi.decode( + functionData, + (IL2StakingTypes.ReceiveDelegationData) + ); + _receiveDelegation(_amount, delegationData); + } else { + revert("INVALID_CODE"); + } + } + + /** + * @dev Receive an Indexer's stake from L1. + * The specified amount is added to the indexer's stake; the indexer's + * address is specified in the _indexerData struct. + * @param _amount Amount of tokens that were transferred + * @param _indexerData struct containing the indexer's address + */ + function _receiveIndexerStake( + uint256 _amount, + IL2StakingTypes.ReceiveIndexerStakeData memory _indexerData + ) internal { + address _indexer = _indexerData.indexer; + // Deposit tokens into the indexer stake + __stakes[_indexer].deposit(_amount); + + // Initialize the delegation pool the first time + if (__delegationPools[_indexer].updatedAtBlock == 0) { + _setDelegationParameters(_indexer, MAX_PPM, MAX_PPM); + } + + emit StakeDeposited(_indexer, _amount); + } + + /** + * @dev Receive a Delegator's delegation from L1. + * The specified amount is added to the delegator's delegation; the delegator's + * address and the indexer's address are specified in the _delegationData struct. + * Note that no delegation tax is applied here. + * @param _amount Amount of tokens that were transferred + * @param _delegationData struct containing the delegator's address and the indexer's address + */ + function _receiveDelegation( + uint256 _amount, + IL2StakingTypes.ReceiveDelegationData memory _delegationData + ) internal { + // Get the delegation pool of the indexer + DelegationPool storage pool = __delegationPools[_delegationData.indexer]; + Delegation storage delegation = pool.delegators[_delegationData.delegator]; + + // Calculate shares to issue (without applying any delegation tax) + uint256 shares = (pool.tokens == 0) ? _amount : _amount.mul(pool.shares).div(pool.tokens); + + if (shares == 0 || _amount < MINIMUM_DELEGATION) { + // If no shares would be issued (probably a rounding issue or attack), + // or if the amount is under the minimum delegation (which could be part of a rounding attack), + // return the tokens to the delegator + graphToken().transfer(_delegationData.delegator, _amount); + emit TransferredDelegationReturnedToDelegator(_delegationData.indexer, _delegationData.delegator, _amount); + } else { + // Update the delegation pool + pool.tokens = pool.tokens.add(_amount); + pool.shares = pool.shares.add(shares); + + // Update the individual delegation + delegation.shares = delegation.shares.add(shares); + + emit StakeDelegated(_delegationData.indexer, _delegationData.delegator, _amount, shares); + } + } +} diff --git a/packages/contracts/contracts/l2/token/GraphTokenUpgradeable.sol b/packages/contracts/contracts/l2/token/GraphTokenUpgradeable.sol new file mode 100644 index 000000000..0f5cf0ecb --- /dev/null +++ b/packages/contracts/contracts/l2/token/GraphTokenUpgradeable.sol @@ -0,0 +1,205 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.7.6; + +import { ERC20BurnableUpgradeable } from "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20BurnableUpgradeable.sol"; +import { ECDSAUpgradeable } from "@openzeppelin/contracts-upgradeable/cryptography/ECDSAUpgradeable.sol"; + +import { GraphUpgradeable } from "../../upgrades/GraphUpgradeable.sol"; +import { Governed } from "../../governance/Governed.sol"; + +/** + * @title GraphTokenUpgradeable contract + * @dev This is the implementation of the ERC20 Graph Token. + * The implementation exposes a permit() function to allow for a spender to send a signed message + * and approve funds to a spender following EIP2612 to make integration with other contracts easier. + * + * The token is initially owned by the deployer address that can mint tokens to create the initial + * distribution. For convenience, an initial supply can be passed in the constructor that will be + * assigned to the deployer. + * + * The governor can add contracts allowed to mint indexing rewards. + * + * Note this is an exact copy of the original GraphToken contract, but using + * initializer functions and upgradeable OpenZeppelin contracts instead of + * the original's constructor + non-upgradeable approach. + */ +abstract contract GraphTokenUpgradeable is GraphUpgradeable, Governed, ERC20BurnableUpgradeable { + // -- EIP712 -- + // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-712.md#definition-of-domainseparator + + /// @dev Hash of the EIP-712 Domain type + bytes32 private immutable DOMAIN_TYPE_HASH = + keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract,bytes32 salt)"); + /// @dev Hash of the EIP-712 Domain name + bytes32 private immutable DOMAIN_NAME_HASH = keccak256("Graph Token"); + /// @dev Hash of the EIP-712 Domain version + bytes32 private immutable DOMAIN_VERSION_HASH = keccak256("0"); + /// @dev EIP-712 Domain salt + bytes32 private immutable DOMAIN_SALT = 0xe33842a7acd1d5a1d28f25a931703e5605152dc48d64dc4716efdae1f5659591; // Randomly generated salt + /// @dev Hash of the EIP-712 permit type + bytes32 private immutable PERMIT_TYPEHASH = + keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"); + + // -- State -- + + /// @dev EIP-712 Domain separator + bytes32 private DOMAIN_SEPARATOR; // solhint-disable-line var-name-mixedcase + /// @dev Addresses for which this mapping is true are allowed to mint tokens + mapping(address => bool) private _minters; + /// Nonces for permit signatures for each token holder + mapping(address => uint256) public nonces; + /// @dev Storage gap added in case we need to add state variables to this contract + uint256[47] private __gap; + + // -- Events -- + + /// Emitted when a new minter is added + event MinterAdded(address indexed account); + /// Emitted when a minter is removed + event MinterRemoved(address indexed account); + + /// @dev Reverts if the caller is not an authorized minter + modifier onlyMinter() { + require(isMinter(msg.sender), "Only minter can call"); + _; + } + + /** + * @notice Approve token allowance by validating a message signed by the holder. + * @param _owner Address of the token holder + * @param _spender Address of the approved spender + * @param _value Amount of tokens to approve the spender + * @param _deadline Expiration time of the signed permit (if zero, the permit will never expire, so use with caution) + * @param _v Signature recovery id + * @param _r Signature r value + * @param _s Signature s value + */ + function permit( + address _owner, + address _spender, + uint256 _value, + uint256 _deadline, + uint8 _v, + bytes32 _r, + bytes32 _s + ) external { + require(_deadline == 0 || block.timestamp <= _deadline, "GRT: expired permit"); + bytes32 digest = keccak256( + abi.encodePacked( + "\x19\x01", + DOMAIN_SEPARATOR, + keccak256(abi.encode(PERMIT_TYPEHASH, _owner, _spender, _value, nonces[_owner], _deadline)) + ) + ); + + address recoveredAddress = ECDSAUpgradeable.recover(digest, _v, _r, _s); + require(_owner == recoveredAddress, "GRT: invalid permit"); + + nonces[_owner] = nonces[_owner] + 1; + _approve(_owner, _spender, _value); + } + + /** + * @notice Add a new minter. + * @param _account Address of the minter + */ + function addMinter(address _account) external onlyGovernor { + require(_account != address(0), "INVALID_MINTER"); + _addMinter(_account); + } + + /** + * @notice Remove a minter. + * @param _account Address of the minter + */ + function removeMinter(address _account) external onlyGovernor { + require(isMinter(_account), "NOT_A_MINTER"); + _removeMinter(_account); + } + + /** + * @notice Renounce being a minter. + */ + function renounceMinter() external { + require(isMinter(msg.sender), "NOT_A_MINTER"); + _removeMinter(msg.sender); + } + + /** + * @notice Mint new tokens. + * @param _to Address to send the newly minted tokens + * @param _amount Amount of tokens to mint + */ + function mint(address _to, uint256 _amount) external onlyMinter { + _mint(_to, _amount); + } + + /** + * @notice Return if the `_account` is a minter or not. + * @param _account Address to check + * @return True if the `_account` is minter + */ + function isMinter(address _account) public view returns (bool) { + return _minters[_account]; + } + + /** + * @dev Graph Token Contract initializer. + * @param _owner Owner of this contract, who will hold the initial supply and will be a minter + * @param _initialSupply Initial supply of GRT + */ + function _initialize(address _owner, uint256 _initialSupply) internal { + __ERC20_init("Graph Token", "GRT"); + Governed._initialize(_owner); + + // The Governor has the initial supply of tokens + _mint(_owner, _initialSupply); + + // The Governor is the default minter + _addMinter(_owner); + + // EIP-712 domain separator + DOMAIN_SEPARATOR = keccak256( + abi.encode( + DOMAIN_TYPE_HASH, + DOMAIN_NAME_HASH, + DOMAIN_VERSION_HASH, + _getChainID(), + address(this), + DOMAIN_SALT + ) + ); + } + + /** + * @dev Add a new minter. + * @param _account Address of the minter + */ + function _addMinter(address _account) private { + _minters[_account] = true; + emit MinterAdded(_account); + } + + /** + * @dev Remove a minter. + * @param _account Address of the minter + */ + function _removeMinter(address _account) private { + _minters[_account] = false; + emit MinterRemoved(_account); + } + + /** + * @dev Get the running network chain ID. + * @return The chain ID + */ + function _getChainID() private pure returns (uint256) { + uint256 id; + // solhint-disable-next-line no-inline-assembly + assembly { + id := chainid() + } + return id; + } +} diff --git a/packages/contracts/contracts/l2/token/L2GraphToken.sol b/packages/contracts/contracts/l2/token/L2GraphToken.sol new file mode 100644 index 000000000..639444870 --- /dev/null +++ b/packages/contracts/contracts/l2/token/L2GraphToken.sol @@ -0,0 +1,90 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.7.6; + +import { GraphTokenUpgradeable } from "./GraphTokenUpgradeable.sol"; +import { IArbToken } from "../../arbitrum/IArbToken.sol"; + +/** + * @title L2 Graph Token Contract + * @dev Provides the L2 version of the GRT token, meant to be minted/burned + * through the L2GraphTokenGateway. + */ +contract L2GraphToken is GraphTokenUpgradeable, IArbToken { + /// Address of the gateway (on L2) that is allowed to mint tokens + address public gateway; + /// Address of the corresponding Graph Token contract on L1 + address public override l1Address; + + /// Emitted when the bridge / gateway has minted new tokens, i.e. tokens were transferred to L2 + event BridgeMinted(address indexed account, uint256 amount); + /// Emitted when the bridge / gateway has burned tokens, i.e. tokens were transferred back to L1 + event BridgeBurned(address indexed account, uint256 amount); + /// Emitted when the address of the gateway has been updated + event GatewaySet(address gateway); + /// Emitted when the address of the Graph Token contract on L1 has been updated + event L1AddressSet(address l1Address); + + /** + * @dev Checks that the sender is the L2 gateway from the L1/L2 token bridge + */ + modifier onlyGateway() { + require(msg.sender == gateway, "NOT_GATEWAY"); + _; + } + + /** + * @notice L2 Graph Token Contract initializer. + * @dev Note some parameters have to be set separately as they are generally + * not expected to be available at initialization time: + * - gateway using setGateway + * - l1Address using setL1Address + * @param _owner Governance address that owns this contract + */ + function initialize(address _owner) external onlyImpl initializer { + require(_owner != address(0), "Owner must be set"); + // Initial supply hard coded to 0 as tokens are only supposed + // to be minted through the bridge. + GraphTokenUpgradeable._initialize(_owner, 0); + } + + /** + * @notice Sets the address of the L2 gateway allowed to mint tokens + * @param _gw Address for the L2GraphTokenGateway that will be allowed to mint tokens + */ + function setGateway(address _gw) external onlyGovernor { + require(_gw != address(0), "INVALID_GATEWAY"); + gateway = _gw; + emit GatewaySet(_gw); + } + + /** + * @notice Sets the address of the counterpart token on L1 + * @param _addr Address for the GraphToken contract on L1 + */ + function setL1Address(address _addr) external onlyGovernor { + require(_addr != address(0), "INVALID_L1_ADDRESS"); + l1Address = _addr; + emit L1AddressSet(_addr); + } + + /** + * @notice Increases token supply, only callable by the L1/L2 bridge (when tokens are transferred to L2) + * @param _account Address to credit with the new tokens + * @param _amount Number of tokens to mint + */ + function bridgeMint(address _account, uint256 _amount) external override onlyGateway { + _mint(_account, _amount); + emit BridgeMinted(_account, _amount); + } + + /** + * @notice Decreases token supply, only callable by the L1/L2 bridge (when tokens are transferred to L1). + * @param _account Address from which to extract the tokens + * @param _amount Number of tokens to burn + */ + function bridgeBurn(address _account, uint256 _amount) external override onlyGateway { + burnFrom(_account, _amount); + emit BridgeBurned(_account, _amount); + } +} diff --git a/packages/contracts/contracts/libraries/Base58Encoder.sol b/packages/contracts/contracts/libraries/Base58Encoder.sol new file mode 100644 index 000000000..9af197855 --- /dev/null +++ b/packages/contracts/contracts/libraries/Base58Encoder.sol @@ -0,0 +1,58 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.7.6; + +/// @title Base58Encoder +/// @author Original author - Martin Lundfall (martin.lundfall@gmail.com) +/// Based on https://github.com/MrChico/verifyIPFS +library Base58Encoder { + bytes constant sha256MultiHash = hex"1220"; + bytes constant ALPHABET = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"; + + /// @dev Converts hex string to base 58 + function encode(bytes memory source) internal pure returns (bytes memory) { + if (source.length == 0) return new bytes(0); + uint8[] memory digits = new uint8[](64); + digits[0] = 0; + uint8 digitlength = 1; + for (uint256 i = 0; i < source.length; ++i) { + uint256 carry = uint8(source[i]); + for (uint256 j = 0; j < digitlength; ++j) { + carry += uint256(digits[j]) * 256; + digits[j] = uint8(carry % 58); + carry = carry / 58; + } + + while (carry > 0) { + digits[digitlength] = uint8(carry % 58); + digitlength++; + carry = carry / 58; + } + } + return toAlphabet(reverse(truncate(digits, digitlength))); + } + + function truncate(uint8[] memory array, uint8 length) internal pure returns (uint8[] memory) { + uint8[] memory output = new uint8[](length); + for (uint256 i = 0; i < length; i++) { + output[i] = array[i]; + } + return output; + } + + function reverse(uint8[] memory input) internal pure returns (uint8[] memory) { + uint8[] memory output = new uint8[](input.length); + for (uint256 i = 0; i < input.length; i++) { + output[i] = input[input.length - 1 - i]; + } + return output; + } + + function toAlphabet(uint8[] memory indices) internal pure returns (bytes memory) { + bytes memory output = new bytes(indices.length); + for (uint256 i = 0; i < indices.length; i++) { + output[i] = ALPHABET[indices[i]]; + } + return output; + } +} diff --git a/packages/contracts/contracts/libraries/HexStrings.sol b/packages/contracts/contracts/libraries/HexStrings.sol new file mode 100644 index 000000000..4842883a9 --- /dev/null +++ b/packages/contracts/contracts/libraries/HexStrings.sol @@ -0,0 +1,36 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.7.6; + +/// @title HexStrings +/// Based on https://github.com/OpenZeppelin/openzeppelin-contracts/blob/8dd744fc1843d285c38e54e9d439dea7f6b93495/contracts/utils/Strings.sol +library HexStrings { + bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; + + /// @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. + function toString(uint256 value) internal pure returns (string memory) { + if (value == 0) { + return "0x00"; + } + uint256 temp = value; + uint256 length = 0; + while (temp != 0) { + length++; + temp >>= 8; + } + return toHexString(value, length); + } + + /// @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. + function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { + bytes memory buffer = new bytes(2 * length + 2); + buffer[0] = "0"; + buffer[1] = "x"; + for (uint256 i = 2 * length + 1; i > 1; --i) { + buffer[i] = _HEX_SYMBOLS[value & 0xf]; + value >>= 4; + } + require(value == 0, "Strings: hex length insufficient"); + return string(buffer); + } +} diff --git a/packages/contracts/contracts/payments/AllocationExchange.sol b/packages/contracts/contracts/payments/AllocationExchange.sol new file mode 100644 index 000000000..3a05112fe --- /dev/null +++ b/packages/contracts/contracts/payments/AllocationExchange.sol @@ -0,0 +1,162 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.7.6; +pragma abicoder v2; + +import "@openzeppelin/contracts/cryptography/ECDSA.sol"; +import "@openzeppelin/contracts/utils/Address.sol"; + +import "../governance/Governed.sol"; +import "../staking/IStaking.sol"; +import "../token/IGraphToken.sol"; + +/** + * @title Allocation Exchange + * @dev This contract holds tokens that anyone with a voucher signed by the + * authority can redeem. The contract validates if the voucher presented is valid + * and then sends tokens to the Staking contract by calling the collect() function + * passing the voucher allocationID. The contract enforces that only one voucher for + * an allocationID can be redeemed. + * Only governance can change the authority. + */ +contract AllocationExchange is Governed { + // An allocation voucher represents a signed message that allows + // redeeming an amount of funds from this contract and collect + // them as part of an allocation + struct AllocationVoucher { + address allocationID; + uint256 amount; + bytes signature; // 65 bytes + } + + // -- Constants -- + + uint256 private constant MAX_UINT256 = 2 ** 256 - 1; + uint256 private constant SIGNATURE_LENGTH = 65; + + // -- State -- + + IStaking private immutable staking; + IGraphToken private immutable graphToken; + mapping(address => bool) public authority; + mapping(address => bool) public allocationsRedeemed; + + // -- Events + + event AuthoritySet(address indexed account, bool authorized); + event AllocationRedeemed(address indexed allocationID, uint256 amount); + event TokensWithdrawn(address indexed to, uint256 amount); + + // -- Functions + + /** + * @notice Contract constructor. + * @param _graphToken Address of the GRT token + * @param _staking Address of the protocol Staking contract + * @param _governor Account capable of withdrawing funds and setting the authority + * @param _authority Account that can sign the vouchers that this contract will redeem + */ + constructor(IGraphToken _graphToken, IStaking _staking, address _governor, address _authority) { + require(_governor != address(0), "Exchange: governor must be set"); + Governed._initialize(_governor); + + graphToken = _graphToken; + staking = _staking; + _setAuthority(_authority, true); + } + + /** + * @notice Approve the staking contract to pull any amount of tokens from this contract. + * @dev Increased gas efficiency instead of approving on each voucher redeem + */ + function approveAll() external { + graphToken.approve(address(staking), MAX_UINT256); + } + + /** + * @notice Withdraw tokens held in the contract. + * @dev Only the governor can withdraw + * @param _to Destination to send the tokens + * @param _amount Amount of tokens to withdraw + */ + function withdraw(address _to, uint256 _amount) external onlyGovernor { + require(_to != address(0), "Exchange: empty destination"); + require(_amount != 0, "Exchange: empty amount"); + require(graphToken.transfer(_to, _amount), "Exchange: cannot transfer"); + emit TokensWithdrawn(_to, _amount); + } + + /** + * @notice Set the authority allowed to sign vouchers. + * @dev Only the governor can set the authority + * @param _authority Address of the signing authority + * @param _authorized True if the authority is authorized to sign vouchers, false to unset + */ + function setAuthority(address _authority, bool _authorized) external onlyGovernor { + _setAuthority(_authority, _authorized); + } + + /** + * @notice Set the authority allowed to sign vouchers. + * @param _authority Address of the signing authority + * @param _authorized True if the authority is authorized to sign vouchers, false to unset + */ + function _setAuthority(address _authority, bool _authorized) private { + require(_authority != address(0), "Exchange: empty authority"); + // This will help catch some operational errors but not all. + // The validation will fail under the following conditions: + // - a contract in construction + // - an address where a contract will be created + // - an address where a contract lived, but was destroyed + require(!Address.isContract(_authority), "Exchange: authority must be EOA"); + authority[_authority] = _authorized; + emit AuthoritySet(_authority, _authorized); + } + + /** + * @notice Redeem a voucher signed by the authority. No voucher double spending is allowed. + * @dev The voucher must be signed using an Ethereum signed message + * @param _voucher Voucher data + */ + function redeem(AllocationVoucher memory _voucher) external { + _redeem(_voucher); + } + + /** + * @notice Redeem multiple vouchers. + * @dev Each voucher must be signed using an Ethereum signed message + * @param _vouchers An array of vouchers + */ + function redeemMany(AllocationVoucher[] memory _vouchers) external { + for (uint256 i = 0; i < _vouchers.length; i++) { + _redeem(_vouchers[i]); + } + } + + /** + * @notice Redeem a voucher signed by the authority. No voucher double spending is allowed. + * @dev The voucher must be signed using an Ethereum signed message + * @param _voucher Voucher data + */ + function _redeem(AllocationVoucher memory _voucher) private { + require(_voucher.amount > 0, "Exchange: zero tokens voucher"); + require(_voucher.signature.length == SIGNATURE_LENGTH, "Exchange: invalid signature"); + + // Already redeemed check + require(!allocationsRedeemed[_voucher.allocationID], "Exchange: allocation already redeemed"); + + // Signature check + bytes32 messageHash = keccak256(abi.encodePacked(_voucher.allocationID, _voucher.amount)); + address voucherSigner = ECDSA.recover(messageHash, _voucher.signature); + require(authority[voucherSigner], "Exchange: invalid signer"); + + // Mark allocation as collected + allocationsRedeemed[_voucher.allocationID] = true; + + // Make the staking contract collect funds from this contract + // The Staking contract will validate if the allocation is valid + staking.collect(_voucher.amount, _voucher.allocationID); + + emit AllocationRedeemed(_voucher.allocationID, _voucher.amount); + } +} diff --git a/packages/contracts/contracts/rewards/IRewardsIssuer.sol b/packages/contracts/contracts/rewards/IRewardsIssuer.sol new file mode 100644 index 000000000..2a18b6e3c --- /dev/null +++ b/packages/contracts/contracts/rewards/IRewardsIssuer.sol @@ -0,0 +1,37 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.7.6 || 0.8.27; + +interface IRewardsIssuer { + /** + * @dev Get allocation data to calculate rewards issuance + * + * @param allocationId The allocation Id + * @return isActive Whether the allocation is active or not + * @return indexer The indexer address + * @return subgraphDeploymentId Subgraph deployment id for the allocation + * @return tokens Amount of allocated tokens + * @return accRewardsPerAllocatedToken Rewards snapshot + * @return accRewardsPending Snapshot of accumulated rewards from previous allocation resizing, pending to be claimed + */ + function getAllocationData( + address allocationId + ) + external + view + returns ( + bool isActive, + address indexer, + bytes32 subgraphDeploymentId, + uint256 tokens, + uint256 accRewardsPerAllocatedToken, + uint256 accRewardsPending + ); + + /** + * @notice Return the total amount of tokens allocated to subgraph. + * @param _subgraphDeploymentId Deployment Id for the subgraph + * @return Total tokens allocated to subgraph + */ + function getSubgraphAllocatedTokens(bytes32 _subgraphDeploymentId) external view returns (uint256); +} diff --git a/packages/contracts/contracts/rewards/IRewardsManager.sol b/packages/contracts/contracts/rewards/IRewardsManager.sol new file mode 100644 index 000000000..b31064d1b --- /dev/null +++ b/packages/contracts/contracts/rewards/IRewardsManager.sol @@ -0,0 +1,57 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.7.6 || 0.8.27; + +interface IRewardsManager { + /** + * @dev Stores accumulated rewards and snapshots related to a particular SubgraphDeployment. + */ + struct Subgraph { + uint256 accRewardsForSubgraph; + uint256 accRewardsForSubgraphSnapshot; + uint256 accRewardsPerSignalSnapshot; + uint256 accRewardsPerAllocatedToken; + } + + // -- Config -- + + function setIssuancePerBlock(uint256 _issuancePerBlock) external; + + function setMinimumSubgraphSignal(uint256 _minimumSubgraphSignal) external; + + function setSubgraphService(address _subgraphService) external; + + // -- Denylist -- + + function setSubgraphAvailabilityOracle(address _subgraphAvailabilityOracle) external; + + function setDenied(bytes32 _subgraphDeploymentID, bool _deny) external; + + function isDenied(bytes32 _subgraphDeploymentID) external view returns (bool); + + // -- Getters -- + + function getNewRewardsPerSignal() external view returns (uint256); + + function getAccRewardsPerSignal() external view returns (uint256); + + function getAccRewardsForSubgraph(bytes32 _subgraphDeploymentID) external view returns (uint256); + + function getAccRewardsPerAllocatedToken(bytes32 _subgraphDeploymentID) external view returns (uint256, uint256); + + function getRewards(address _rewardsIssuer, address _allocationID) external view returns (uint256); + + function calcRewards(uint256 _tokens, uint256 _accRewardsPerAllocatedToken) external pure returns (uint256); + + // -- Updates -- + + function updateAccRewardsPerSignal() external returns (uint256); + + function takeRewards(address _allocationID) external returns (uint256); + + // -- Hooks -- + + function onSubgraphSignalUpdate(bytes32 _subgraphDeploymentID) external returns (uint256); + + function onSubgraphAllocationUpdate(bytes32 _subgraphDeploymentID) external returns (uint256); +} diff --git a/packages/contracts/contracts/rewards/RewardsManager.sol b/packages/contracts/contracts/rewards/RewardsManager.sol new file mode 100644 index 000000000..54dbead81 --- /dev/null +++ b/packages/contracts/contracts/rewards/RewardsManager.sol @@ -0,0 +1,427 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.7.6; +pragma abicoder v2; + +import "../upgrades/GraphUpgradeable.sol"; +import "../staking/libs/MathUtils.sol"; + +import "./RewardsManagerStorage.sol"; + +/** + * @title Rewards Manager Contract + * @dev Tracks how inflationary GRT rewards should be handed out. Relies on the Curation contract + * and the Staking contract. Signaled GRT in Curation determine what percentage of the tokens go + * towards each subgraph. Then each Subgraph can have multiple Indexers Staked on it. Thus, the + * total rewards for the Subgraph are split up for each Indexer based on much they have Staked on + * that Subgraph. + * + * Note: + * The contract provides getter functions to query the state of accrued rewards: + * - getAccRewardsPerSignal + * - getAccRewardsForSubgraph + * - getAccRewardsPerAllocatedToken + * - getRewards + * These functions may overestimate the actual rewards due to changes in the total supply + * until the actual takeRewards function is called. + */ +contract RewardsManager is RewardsManagerV5Storage, GraphUpgradeable, IRewardsManager { + using SafeMath for uint256; + + uint256 private constant FIXED_POINT_SCALING_FACTOR = 1e18; + + // -- Events -- + + /** + * @dev Emitted when rewards are assigned to an indexer. + * @dev We use the Horizon prefix to change the event signature which makes network subgraph development much easier + */ + event HorizonRewardsAssigned(address indexed indexer, address indexed allocationID, uint256 amount); + + /** + * @dev Emitted when rewards are denied to an indexer. + */ + event RewardsDenied(address indexed indexer, address indexed allocationID); + + /** + * @dev Emitted when a subgraph is denied for claiming rewards. + */ + event RewardsDenylistUpdated(bytes32 indexed subgraphDeploymentID, uint256 sinceBlock); + + /** + * @dev Emitted when the subgraph service is set + */ + event SubgraphServiceSet(address indexed oldSubgraphService, address indexed newSubgraphService); + + // -- Modifiers -- + + modifier onlySubgraphAvailabilityOracle() { + require(msg.sender == address(subgraphAvailabilityOracle), "Caller must be the subgraph availability oracle"); + _; + } + + /** + * @dev Initialize this contract. + */ + function initialize(address _controller) external onlyImpl { + Managed._initialize(_controller); + } + + // -- Config -- + + /** + * @dev Sets the GRT issuance per block. + * The issuance is defined as a fixed amount of rewards per block in GRT. + * Whenever this function is called in layer 2, the updateL2MintAllowance function + * _must_ be called on the L1GraphTokenGateway in L1, to ensure the bridge can mint the + * right amount of tokens. + * @param _issuancePerBlock Issuance expressed in GRT per block (scaled by 1e18) + */ + function setIssuancePerBlock(uint256 _issuancePerBlock) external override onlyGovernor { + _setIssuancePerBlock(_issuancePerBlock); + } + + /** + * @dev Sets the GRT issuance per block. + * The issuance is defined as a fixed amount of rewards per block in GRT. + * @param _issuancePerBlock Issuance expressed in GRT per block (scaled by 1e18) + */ + function _setIssuancePerBlock(uint256 _issuancePerBlock) private { + // Called since `issuance per block` will change + updateAccRewardsPerSignal(); + + issuancePerBlock = _issuancePerBlock; + emit ParameterUpdated("issuancePerBlock"); + } + + /** + * @dev Sets the subgraph oracle allowed to denegate distribution of rewards to subgraphs. + * @param _subgraphAvailabilityOracle Address of the subgraph availability oracle + */ + function setSubgraphAvailabilityOracle(address _subgraphAvailabilityOracle) external override onlyGovernor { + subgraphAvailabilityOracle = _subgraphAvailabilityOracle; + emit ParameterUpdated("subgraphAvailabilityOracle"); + } + + /** + * @dev Sets the minimum signaled tokens on a subgraph to start accruing rewards. + * @dev Can be set to zero which means that this feature is not being used. + * @param _minimumSubgraphSignal Minimum signaled tokens + */ + function setMinimumSubgraphSignal(uint256 _minimumSubgraphSignal) external override { + // Caller can be the SAO or the governor + require( + msg.sender == address(subgraphAvailabilityOracle) || msg.sender == controller.getGovernor(), + "Not authorized" + ); + minimumSubgraphSignal = _minimumSubgraphSignal; + emit ParameterUpdated("minimumSubgraphSignal"); + } + + function setSubgraphService(address _subgraphService) external override onlyGovernor { + address oldSubgraphService = address(subgraphService); + subgraphService = IRewardsIssuer(_subgraphService); + emit SubgraphServiceSet(oldSubgraphService, _subgraphService); + } + + // -- Denylist -- + + /** + * @dev Denies to claim rewards for a subgraph. + * NOTE: Can only be called by the subgraph availability oracle + * @param _subgraphDeploymentID Subgraph deployment ID + * @param _deny Whether to set the subgraph as denied for claiming rewards or not + */ + function setDenied(bytes32 _subgraphDeploymentID, bool _deny) external override onlySubgraphAvailabilityOracle { + _setDenied(_subgraphDeploymentID, _deny); + } + + /** + * @dev Internal: Denies to claim rewards for a subgraph. + * @param _subgraphDeploymentID Subgraph deployment ID + * @param _deny Whether to set the subgraph as denied for claiming rewards or not + */ + function _setDenied(bytes32 _subgraphDeploymentID, bool _deny) private { + uint256 sinceBlock = _deny ? block.number : 0; + denylist[_subgraphDeploymentID] = sinceBlock; + emit RewardsDenylistUpdated(_subgraphDeploymentID, sinceBlock); + } + + /** + * @dev Tells if subgraph is in deny list + * @param _subgraphDeploymentID Subgraph deployment ID to check + * @return Whether the subgraph is denied for claiming rewards or not + */ + function isDenied(bytes32 _subgraphDeploymentID) public view override returns (bool) { + return denylist[_subgraphDeploymentID] > 0; + } + + // -- Getters -- + + /** + * @dev Gets the issuance of rewards per signal since last updated. + * + * Linear formula: `x = r * t` + * + * Notation: + * t: time steps are in blocks since last updated + * x: newly accrued rewards tokens for the period `t` + * + * @return newly accrued rewards per signal since last update, scaled by FIXED_POINT_SCALING_FACTOR + */ + function getNewRewardsPerSignal() public view override returns (uint256) { + // Calculate time steps + uint256 t = block.number.sub(accRewardsPerSignalLastBlockUpdated); + // Optimization to skip calculations if zero time steps elapsed + if (t == 0) { + return 0; + } + // ...or if issuance is zero + if (issuancePerBlock == 0) { + return 0; + } + + // Zero issuance if no signalled tokens + IGraphToken graphToken = graphToken(); + uint256 signalledTokens = graphToken.balanceOf(address(curation())); + if (signalledTokens == 0) { + return 0; + } + + uint256 x = issuancePerBlock.mul(t); + + // Get the new issuance per signalled token + // We multiply the decimals to keep the precision as fixed-point number + return x.mul(FIXED_POINT_SCALING_FACTOR).div(signalledTokens); + } + + /** + * @dev Gets the currently accumulated rewards per signal. + * @return Currently accumulated rewards per signal + */ + function getAccRewardsPerSignal() public view override returns (uint256) { + return accRewardsPerSignal.add(getNewRewardsPerSignal()); + } + + /** + * @dev Gets the accumulated rewards for the subgraph. + * @param _subgraphDeploymentID Subgraph deployment + * @return Accumulated rewards for subgraph + */ + function getAccRewardsForSubgraph(bytes32 _subgraphDeploymentID) public view override returns (uint256) { + Subgraph storage subgraph = subgraphs[_subgraphDeploymentID]; + + // Get tokens signalled on the subgraph + uint256 subgraphSignalledTokens = curation().getCurationPoolTokens(_subgraphDeploymentID); + + // Only accrue rewards if over a threshold + uint256 newRewards = (subgraphSignalledTokens >= minimumSubgraphSignal) // Accrue new rewards since last snapshot + ? getAccRewardsPerSignal().sub(subgraph.accRewardsPerSignalSnapshot).mul(subgraphSignalledTokens).div( + FIXED_POINT_SCALING_FACTOR + ) + : 0; + return subgraph.accRewardsForSubgraph.add(newRewards); + } + + /** + * @dev Gets the accumulated rewards per allocated token for the subgraph. + * @param _subgraphDeploymentID Subgraph deployment + * @return Accumulated rewards per allocated token for the subgraph + * @return Accumulated rewards for subgraph + */ + function getAccRewardsPerAllocatedToken( + bytes32 _subgraphDeploymentID + ) public view override returns (uint256, uint256) { + Subgraph storage subgraph = subgraphs[_subgraphDeploymentID]; + + uint256 accRewardsForSubgraph = getAccRewardsForSubgraph(_subgraphDeploymentID); + uint256 newRewardsForSubgraph = MathUtils.diffOrZero( + accRewardsForSubgraph, + subgraph.accRewardsForSubgraphSnapshot + ); + + // There are two contributors to subgraph allocated tokens: + // - the legacy allocations on the legacy staking contract + // - the new allocations on the subgraph service + uint256 subgraphAllocatedTokens = 0; + address[2] memory rewardsIssuers = [address(staking()), address(subgraphService)]; + for (uint256 i = 0; i < rewardsIssuers.length; i++) { + if (rewardsIssuers[i] != address(0)) { + subgraphAllocatedTokens += IRewardsIssuer(rewardsIssuers[i]).getSubgraphAllocatedTokens( + _subgraphDeploymentID + ); + } + } + + if (subgraphAllocatedTokens == 0) { + return (0, accRewardsForSubgraph); + } + + uint256 newRewardsPerAllocatedToken = newRewardsForSubgraph.mul(FIXED_POINT_SCALING_FACTOR).div( + subgraphAllocatedTokens + ); + return (subgraph.accRewardsPerAllocatedToken.add(newRewardsPerAllocatedToken), accRewardsForSubgraph); + } + + // -- Updates -- + + /** + * @dev Updates the accumulated rewards per signal and save checkpoint block number. + * Must be called before `issuancePerBlock` or `total signalled GRT` changes + * Called from the Curation contract on mint() and burn() + * @return Accumulated rewards per signal + */ + function updateAccRewardsPerSignal() public override returns (uint256) { + accRewardsPerSignal = getAccRewardsPerSignal(); + accRewardsPerSignalLastBlockUpdated = block.number; + return accRewardsPerSignal; + } + + /** + * @dev Triggers an update of rewards for a subgraph. + * Must be called before `signalled GRT` on a subgraph changes. + * Note: Hook called from the Curation contract on mint() and burn() + * @param _subgraphDeploymentID Subgraph deployment + * @return Accumulated rewards for subgraph + */ + function onSubgraphSignalUpdate(bytes32 _subgraphDeploymentID) external override returns (uint256) { + // Called since `total signalled GRT` will change + updateAccRewardsPerSignal(); + + // Updates the accumulated rewards for a subgraph + Subgraph storage subgraph = subgraphs[_subgraphDeploymentID]; + subgraph.accRewardsForSubgraph = getAccRewardsForSubgraph(_subgraphDeploymentID); + subgraph.accRewardsPerSignalSnapshot = accRewardsPerSignal; + return subgraph.accRewardsForSubgraph; + } + + /** + * @dev Triggers an update of rewards for a subgraph. + * Must be called before allocation on a subgraph changes. + * NOTE: Hook called from the Staking contract on allocate() and close() + * + * @param _subgraphDeploymentID Subgraph deployment + * @return Accumulated rewards per allocated token for a subgraph + */ + function onSubgraphAllocationUpdate(bytes32 _subgraphDeploymentID) public override returns (uint256) { + Subgraph storage subgraph = subgraphs[_subgraphDeploymentID]; + (uint256 accRewardsPerAllocatedToken, uint256 accRewardsForSubgraph) = getAccRewardsPerAllocatedToken( + _subgraphDeploymentID + ); + subgraph.accRewardsPerAllocatedToken = accRewardsPerAllocatedToken; + subgraph.accRewardsForSubgraphSnapshot = accRewardsForSubgraph; + return subgraph.accRewardsPerAllocatedToken; + } + + /** + * @dev Calculate current rewards for a given allocation on demand. + * The allocation could be a legacy allocation or a new subgraph service allocation. + * Returns 0 if the allocation is not active. + * @param _allocationID Allocation + * @return Rewards amount for an allocation + */ + function getRewards(address _rewardsIssuer, address _allocationID) external view override returns (uint256) { + require( + _rewardsIssuer == address(staking()) || _rewardsIssuer == address(subgraphService), + "Not a rewards issuer" + ); + + ( + bool isActive, + , + bytes32 subgraphDeploymentId, + uint256 tokens, + uint256 alloAccRewardsPerAllocatedToken, + uint256 accRewardsPending + ) = IRewardsIssuer(_rewardsIssuer).getAllocationData(_allocationID); + + if (!isActive) { + return 0; + } + + (uint256 accRewardsPerAllocatedToken, ) = getAccRewardsPerAllocatedToken(subgraphDeploymentId); + return + accRewardsPending.add(_calcRewards(tokens, alloAccRewardsPerAllocatedToken, accRewardsPerAllocatedToken)); + } + + /** + * @dev Calculate rewards for a given accumulated rewards per allocated token. + * @param _tokens Tokens allocated + * @param _accRewardsPerAllocatedToken Allocation accumulated rewards per token + * @return Rewards amount + */ + function calcRewards( + uint256 _tokens, + uint256 _accRewardsPerAllocatedToken + ) external pure override returns (uint256) { + return _accRewardsPerAllocatedToken.mul(_tokens).div(FIXED_POINT_SCALING_FACTOR); + } + + /** + * @dev Calculate current rewards for a given allocation. + * @param _tokens Tokens allocated + * @param _startAccRewardsPerAllocatedToken Allocation start accumulated rewards + * @param _endAccRewardsPerAllocatedToken Allocation end accumulated rewards + * @return Rewards amount + */ + function _calcRewards( + uint256 _tokens, + uint256 _startAccRewardsPerAllocatedToken, + uint256 _endAccRewardsPerAllocatedToken + ) private pure returns (uint256) { + uint256 newAccrued = _endAccRewardsPerAllocatedToken.sub(_startAccRewardsPerAllocatedToken); + return newAccrued.mul(_tokens).div(FIXED_POINT_SCALING_FACTOR); + } + + /** + * @dev Pull rewards from the contract for a particular allocation. + * This function can only be called by an authorized rewards issuer which are + * the staking contract (for legacy allocations), and the subgraph service (for new allocations). + * This function will mint the necessary tokens to reward based on the inflation calculation. + * Mints 0 tokens if the allocation is not active. + * @param _allocationID Allocation + * @return Assigned rewards amount + */ + function takeRewards(address _allocationID) external override returns (uint256) { + address rewardsIssuer = msg.sender; + require( + rewardsIssuer == address(staking()) || rewardsIssuer == address(subgraphService), + "Caller must be a rewards issuer" + ); + + ( + bool isActive, + address indexer, + bytes32 subgraphDeploymentID, + uint256 tokens, + uint256 accRewardsPerAllocatedToken, + uint256 accRewardsPending + ) = IRewardsIssuer(rewardsIssuer).getAllocationData(_allocationID); + + uint256 updatedAccRewardsPerAllocatedToken = onSubgraphAllocationUpdate(subgraphDeploymentID); + + // Do not do rewards on denied subgraph deployments ID + if (isDenied(subgraphDeploymentID)) { + emit RewardsDenied(indexer, _allocationID); + return 0; + } + + uint256 rewards = 0; + if (isActive) { + // Calculate rewards accrued by this allocation + rewards = accRewardsPending.add( + _calcRewards(tokens, accRewardsPerAllocatedToken, updatedAccRewardsPerAllocatedToken) + ); + if (rewards > 0) { + // Mint directly to rewards issuer for the reward amount + // The rewards issuer contract will do bookkeeping of the reward and + // assign in proportion to each stakeholder incentive + graphToken().mint(rewardsIssuer, rewards); + } + } + + emit HorizonRewardsAssigned(indexer, _allocationID, rewards); + + return rewards; + } +} diff --git a/packages/contracts/contracts/rewards/RewardsManagerStorage.sol b/packages/contracts/contracts/rewards/RewardsManagerStorage.sol new file mode 100644 index 000000000..ded325593 --- /dev/null +++ b/packages/contracts/contracts/rewards/RewardsManagerStorage.sol @@ -0,0 +1,44 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.7.6 || 0.8.27; + +import "./IRewardsManager.sol"; +import "../governance/Managed.sol"; +import { IRewardsIssuer } from "./IRewardsIssuer.sol"; + +contract RewardsManagerV1Storage is Managed { + // -- State -- + + uint256 private __DEPRECATED_issuanceRate; // solhint-disable-line var-name-mixedcase + uint256 public accRewardsPerSignal; + uint256 public accRewardsPerSignalLastBlockUpdated; + + // Address of role allowed to deny rewards on subgraphs + address public subgraphAvailabilityOracle; + + // Subgraph related rewards: subgraph deployment ID => subgraph rewards + mapping(bytes32 => IRewardsManager.Subgraph) public subgraphs; + + // Subgraph denylist : subgraph deployment ID => block when added or zero (if not denied) + mapping(bytes32 => uint256) public denylist; +} + +contract RewardsManagerV2Storage is RewardsManagerV1Storage { + // Minimum amount of signaled tokens on a subgraph required to accrue rewards + uint256 public minimumSubgraphSignal; +} + +contract RewardsManagerV3Storage is RewardsManagerV2Storage { + // Snapshot of the total supply of GRT when accRewardsPerSignal was last updated + uint256 private __DEPRECATED_tokenSupplySnapshot; // solhint-disable-line var-name-mixedcase +} + +contract RewardsManagerV4Storage is RewardsManagerV3Storage { + // GRT issued for indexer rewards per block + uint256 public issuancePerBlock; +} + +contract RewardsManagerV5Storage is RewardsManagerV4Storage { + // Address of the subgraph service + IRewardsIssuer public subgraphService; +} diff --git a/packages/contracts/contracts/rewards/SubgraphAvailabilityManager.sol b/packages/contracts/contracts/rewards/SubgraphAvailabilityManager.sol new file mode 100644 index 000000000..a8e3d0e30 --- /dev/null +++ b/packages/contracts/contracts/rewards/SubgraphAvailabilityManager.sol @@ -0,0 +1,237 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.7.6; + +import { Governed } from "../governance/Governed.sol"; +import { IRewardsManager } from "../rewards/IRewardsManager.sol"; + +/** + * @title Subgraph Availability Manager + * @dev Manages the availability of subgraphs by allowing oracles to vote on whether + * a subgraph should be denied rewards or not. When enough oracles have voted to deny or + * allow rewards for a subgraph, it calls the RewardsManager Contract to set the correct + * state. The oracles and the execution threshold are set at deployment time. + * Only governance can update the oracles and voteTimeLimit. + * Governor can transfer ownership to a new governor. + */ +contract SubgraphAvailabilityManager is Governed { + // -- Immutable -- + + /// @notice Number of oracles + uint256 public constant NUM_ORACLES = 5; + + /// @notice Number of votes required to execute a deny or allow call to the RewardsManager + uint256 public immutable executionThreshold; + + /// @dev Address of the RewardsManager contract + IRewardsManager private immutable rewardsManager; + + // -- State -- + + /// @dev Nonce for generating votes on subgraph deployment IDs. + /// Increased whenever oracles or voteTimeLimit change, to invalidate old votes. + uint256 public currentNonce; + + /// @notice Time limit for a vote to be valid + uint256 public voteTimeLimit; + + /// @notice Array of oracle addresses + address[NUM_ORACLES] public oracles; + + /// @notice Mapping of current nonce to subgraph deployment ID to an array of timestamps of last deny vote + /// currentNonce => subgraphDeploymentId => timestamp[oracleIndex] + mapping(uint256 => mapping(bytes32 => uint256[NUM_ORACLES])) public lastDenyVote; + + /// @notice Mapping of current nonce to subgraph deployment ID to an array of timestamp of last allow vote + /// currentNonce => subgraphDeploymentId => timestamp[oracleIndex] + mapping(uint256 => mapping(bytes32 => uint256[NUM_ORACLES])) public lastAllowVote; + + // -- Events -- + + /** + * @dev Emitted when an oracle is set + * @param index Index of the oracle + * @param oracle Address of the oracle + */ + event OracleSet(uint256 indexed index, address indexed oracle); + + /** + * @dev Emitted when the vote time limit is set + * @param voteTimeLimit Vote time limit in seconds + */ + event VoteTimeLimitSet(uint256 voteTimeLimit); + + /** + * @dev Emitted when an oracle votes to deny or allow a subgraph + * @param subgraphDeploymentID Subgraph deployment ID + * @param deny True to deny, false to allow + * @param oracleIndex Index of the oracle voting + * @param timestamp Timestamp of the vote + */ + event OracleVote(bytes32 indexed subgraphDeploymentID, bool deny, uint256 indexed oracleIndex, uint256 timestamp); + + // -- Modifiers -- + + modifier onlyOracle(uint256 _oracleIndex) { + require(_oracleIndex < NUM_ORACLES, "SAM: index out of bounds"); + require(msg.sender == oracles[_oracleIndex], "SAM: caller must be oracle"); + _; + } + + // -- Constructor -- + + /** + * @dev Contract constructor + * @param _governor Account that can set or remove oracles and set the vote time limit + * @param _rewardsManager Address of the RewardsManager contract + * @param _executionThreshold Number of votes required to execute a deny or allow call to the RewardsManager + * @param _voteTimeLimit Vote time limit in seconds + * @param _oracles Array of oracle addresses, must be NUM_ORACLES in length. + */ + constructor( + address _governor, + address _rewardsManager, + uint256 _executionThreshold, + uint256 _voteTimeLimit, + address[NUM_ORACLES] memory _oracles + ) { + require(_governor != address(0), "SAM: governor must be set"); + require(_rewardsManager != address(0), "SAM: rewardsManager must be set"); + require(_executionThreshold >= (NUM_ORACLES / 2) + 1, "SAM: executionThreshold too low"); + require(_executionThreshold <= NUM_ORACLES, "SAM: executionThreshold too high"); + + // Oracles should not be address zero + for (uint256 i; i < _oracles.length; i++) { + address oracle = _oracles[i]; + require(oracle != address(0), "SAM: oracle cannot be address zero"); + oracles[i] = oracle; + emit OracleSet(i, oracle); + } + + Governed._initialize(_governor); + rewardsManager = IRewardsManager(_rewardsManager); + + executionThreshold = _executionThreshold; + voteTimeLimit = _voteTimeLimit; + } + + // -- Functions -- + + /** + * @dev Set the vote time limit. Refreshes all existing votes by incrementing the current nonce. + * @param _voteTimeLimit Vote time limit in seconds + */ + function setVoteTimeLimit(uint256 _voteTimeLimit) external onlyGovernor { + voteTimeLimit = _voteTimeLimit; + currentNonce++; + emit VoteTimeLimitSet(_voteTimeLimit); + } + + /** + * @dev Set oracle address with index. Refreshes all existing votes by incrementing the current nonce. + * @param _index Index of the oracle + * @param _oracle Address of the oracle + */ + function setOracle(uint256 _index, address _oracle) external onlyGovernor { + require(_index < NUM_ORACLES, "SAM: index out of bounds"); + require(_oracle != address(0), "SAM: oracle cannot be address zero"); + + oracles[_index] = _oracle; + // Increment the current nonce to refresh all existing votes for subgraph deployment IDs + currentNonce++; + + emit OracleSet(_index, _oracle); + } + + /** + * @dev Vote deny or allow for a subgraph. + * NOTE: Can only be called by an oracle. + * @param _subgraphDeploymentID Subgraph deployment ID + * @param _deny True to deny, false to allow + * @param _oracleIndex Index of the oracle voting + */ + function vote(bytes32 _subgraphDeploymentID, bool _deny, uint256 _oracleIndex) external onlyOracle(_oracleIndex) { + _vote(_subgraphDeploymentID, _deny, _oracleIndex); + } + + /** + * @dev Vote deny or allow for many subgraphs. + * NOTE: Can only be called by an oracle. + * @param _subgraphDeploymentID Array of subgraph deployment IDs + * @param _deny Array of booleans, true to deny, false to allow + * @param _oracleIndex Index of the oracle voting + */ + function voteMany( + bytes32[] calldata _subgraphDeploymentID, + bool[] calldata _deny, + uint256 _oracleIndex + ) external onlyOracle(_oracleIndex) { + require(_subgraphDeploymentID.length == _deny.length, "!length"); + for (uint256 i; i < _subgraphDeploymentID.length; i++) { + _vote(_subgraphDeploymentID[i], _deny[i], _oracleIndex); + } + } + + /** + * @dev Vote deny or allow for a subgraph. + * When oracles cast their votes we store the timestamp of the vote. + * Check if the execution threshold has been reached for a subgraph. + * If execution threshold is reached we call the RewardsManager to set the correct state. + * @param _subgraphDeploymentID Subgraph deployment ID + * @param _deny True to deny, false to allow + * @param _oracleIndex Index of the oracle voting + */ + function _vote(bytes32 _subgraphDeploymentID, bool _deny, uint256 _oracleIndex) private { + uint256 timestamp = block.timestamp; + + if (_deny) { + lastDenyVote[currentNonce][_subgraphDeploymentID][_oracleIndex] = timestamp; + // clear opposite vote for a subgraph deployment if it exists + lastAllowVote[currentNonce][_subgraphDeploymentID][_oracleIndex] = 0; + } else { + lastAllowVote[currentNonce][_subgraphDeploymentID][_oracleIndex] = timestamp; + // clear opposite vote for a subgraph deployment if it exists + lastDenyVote[currentNonce][_subgraphDeploymentID][_oracleIndex] = 0; + } + + emit OracleVote(_subgraphDeploymentID, _deny, _oracleIndex, timestamp); + + // check if execution threshold is reached, if it is call the RewardsManager + if (checkVotes(_subgraphDeploymentID, _deny)) { + rewardsManager.setDenied(_subgraphDeploymentID, _deny); + } + } + + /** + * @dev Check if the execution threshold has been reached for a subgraph. + * For a vote to be valid it needs to be within the vote time limit. + * @param _subgraphDeploymentID Subgraph deployment ID + * @param _deny True to deny, false to allow + * @return True if execution threshold is reached + */ + function checkVotes(bytes32 _subgraphDeploymentID, bool _deny) public view returns (bool) { + uint256 votes; + + // timeframe for a vote to be valid + uint256 voteTimeValidity = block.timestamp - voteTimeLimit; + + // corresponding votes based on _deny for a subgraph deployment + uint256[NUM_ORACLES] storage lastVoteForSubgraph = _deny + ? lastDenyVote[currentNonce][_subgraphDeploymentID] + : lastAllowVote[currentNonce][_subgraphDeploymentID]; + + for (uint256 i; i < NUM_ORACLES; i++) { + // check if vote is within the vote time limit + if (lastVoteForSubgraph[i] > voteTimeValidity) { + votes++; + } + + // check if execution threshold is reached + if (votes == executionThreshold) { + return true; + } + } + + return false; + } +} diff --git a/packages/contracts/contracts/staking/IL1GraphTokenLockTransferTool.sol b/packages/contracts/contracts/staking/IL1GraphTokenLockTransferTool.sol new file mode 100644 index 000000000..b935682b9 --- /dev/null +++ b/packages/contracts/contracts/staking/IL1GraphTokenLockTransferTool.sol @@ -0,0 +1,30 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity >=0.6.12 <0.8.0; +pragma abicoder v2; + +/** + * @title Interface for the L1GraphTokenLockTransferTool contract + * @dev This interface defines the function to get the L2 wallet address for a given L1 token lock wallet. + * The Transfer Tool contract is implemented in the token-distribution repo: https://github.com/graphprotocol/token-distribution/pull/64 + * and is only included here to provide support in L1Staking for the transfer of stake and delegation + * owned by token lock contracts. See GIP-0046 for details: https://forum.thegraph.com/t/4023 + */ +interface IL1GraphTokenLockTransferTool { + /** + * @notice Pulls ETH from an L1 wallet's account to use for L2 ticket gas. + * @dev This function is only callable by the staking contract. + * @param _l1Wallet Address of the L1 token lock wallet + * @param _amount Amount of ETH to pull from the transfer tool contract + */ + function pullETH(address _l1Wallet, uint256 _amount) external; + + /** + * @notice Get the L2 token lock wallet address for a given L1 token lock wallet + * @dev In the actual L1GraphTokenLockTransferTool contract, this is simply the default getter for a public mapping variable. + * @param _l1Wallet Address of the L1 token lock wallet + * @return Address of the L2 token lock wallet if the wallet has an L2 counterpart, or address zero if + * the wallet doesn't have an L2 counterpart (or is not known to be a token lock wallet). + */ + function l2WalletAddress(address _l1Wallet) external view returns (address); +} diff --git a/packages/contracts/contracts/staking/IL1Staking.sol b/packages/contracts/contracts/staking/IL1Staking.sol new file mode 100644 index 000000000..a93cec246 --- /dev/null +++ b/packages/contracts/contracts/staking/IL1Staking.sol @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity >=0.6.12 <0.8.0; +pragma abicoder v2; + +import { IStaking } from "./IStaking.sol"; +import { IL1StakingBase } from "./IL1StakingBase.sol"; + +/** + * @title Interface for the L1 Staking contract + * @notice This is the interface that should be used when interacting with the L1 Staking contract. + * It extends the IStaking interface with the functions that are specific to L1, adding the transfer tools + * to send stake and delegation to L2. + * @dev Note that L1Staking doesn't actually inherit this interface. This is because of + * the custom setup of the Staking contract where part of the functionality is implemented + * in a separate contract (StakingExtension) to which calls are delegated through the fallback function. + */ +interface IL1Staking is IStaking, IL1StakingBase { + // Nothing to see here +} diff --git a/packages/contracts/contracts/staking/IL1StakingBase.sol b/packages/contracts/contracts/staking/IL1StakingBase.sol new file mode 100644 index 000000000..fad2136c2 --- /dev/null +++ b/packages/contracts/contracts/staking/IL1StakingBase.sol @@ -0,0 +1,148 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity >=0.6.12 <0.8.0; +pragma abicoder v2; + +import { IL1GraphTokenLockTransferTool } from "./IL1GraphTokenLockTransferTool.sol"; + +/** + * @title Base interface for the L1Staking contract. + * @notice This interface is used to define the transfer tools that are implemented in L1Staking. + * @dev Note it includes only the L1-specific functionality, not the full IStaking interface. + */ +interface IL1StakingBase { + /// @dev Emitted when an indexer transfers their stake to L2. + /// This can happen several times as indexers can transfer partial stake. + event IndexerStakeTransferredToL2( + address indexed indexer, + address indexed l2Indexer, + uint256 transferredStakeTokens + ); + + /// @dev Emitted when a delegator transfers their delegation to L2 + event DelegationTransferredToL2( + address indexed delegator, + address indexed l2Delegator, + address indexed indexer, + address l2Indexer, + uint256 transferredDelegationTokens + ); + + /// @dev Emitted when the L1GraphTokenLockTransferTool is set + event L1GraphTokenLockTransferToolSet(address l1GraphTokenLockTransferTool); + + /// @dev Emitted when a delegator unlocks their tokens ahead of time because the indexer has transferred to L2 + event StakeDelegatedUnlockedDueToL2Transfer(address indexed indexer, address indexed delegator); + + /** + * @notice Set the L1GraphTokenLockTransferTool contract address + * @dev This function can only be called by the governor. + * @param _l1GraphTokenLockTransferTool Address of the L1GraphTokenLockTransferTool contract + */ + function setL1GraphTokenLockTransferTool(IL1GraphTokenLockTransferTool _l1GraphTokenLockTransferTool) external; + + /** + * @notice Send an indexer's stake to L2. + * @dev This function can only be called by the indexer (not an operator). + * It will validate that the remaining stake is sufficient to cover all the allocated + * stake, so the indexer might have to close some allocations before transferring. + * It will also check that the indexer's stake is not locked for withdrawal. + * Since the indexer address might be an L1-only contract, the function takes a beneficiary + * address that will be the indexer's address in L2. + * The caller must provide an amount of ETH to use for the L2 retryable ticket, that + * must be at least `_maxSubmissionCost + _gasPriceBid * _maxGas`. + * @param _l2Beneficiary Address of the indexer in L2. If the indexer has previously transferred stake, this must match the previously-used value. + * @param _amount Amount of stake GRT to transfer to L2 + * @param _maxGas Max gas to use for the L2 retryable ticket + * @param _gasPriceBid Gas price bid for the L2 retryable ticket + * @param _maxSubmissionCost Max submission cost for the L2 retryable ticket + */ + function transferStakeToL2( + address _l2Beneficiary, + uint256 _amount, + uint256 _maxGas, + uint256 _gasPriceBid, + uint256 _maxSubmissionCost + ) external payable; + + /** + * @notice Send an indexer's stake to L2, from a GraphTokenLockWallet vesting contract. + * @dev This function can only be called by the indexer (not an operator). + * It will validate that the remaining stake is sufficient to cover all the allocated + * stake, so the indexer might have to close some allocations before transferring. + * It will also check that the indexer's stake is not locked for withdrawal. + * The L2 beneficiary for the stake will be determined by calling the L1GraphTokenLockTransferTool contract, + * so the caller must have previously transferred tokens through that first + * (see GIP-0046 for details: https://forum.thegraph.com/t/4023). + * The ETH for the L2 gas will be pulled from the L1GraphTokenLockTransferTool, so the owner of + * the GraphTokenLockWallet must have previously deposited at least `_maxSubmissionCost + _gasPriceBid * _maxGas` + * ETH into the L1GraphTokenLockTransferTool contract (using its depositETH function). + * @param _amount Amount of stake GRT to transfer to L2 + * @param _maxGas Max gas to use for the L2 retryable ticket + * @param _gasPriceBid Gas price bid for the L2 retryable ticket + * @param _maxSubmissionCost Max submission cost for the L2 retryable ticket + */ + function transferLockedStakeToL2( + uint256 _amount, + uint256 _maxGas, + uint256 _gasPriceBid, + uint256 _maxSubmissionCost + ) external; + + /** + * @notice Send a delegator's delegated tokens to L2 + * @dev This function can only be called by the delegator. + * This function will validate that the indexer has transferred their stake using transferStakeToL2, + * and that the delegation is not locked for undelegation. + * Since the delegator's address might be an L1-only contract, the function takes a beneficiary + * address that will be the delegator's address in L2. + * The caller must provide an amount of ETH to use for the L2 retryable ticket, that + * must be at least `_maxSubmissionCost + _gasPriceBid * _maxGas`. + * @param _indexer Address of the indexer (in L1, before transferring to L2) + * @param _l2Beneficiary Address of the delegator in L2 + * @param _maxGas Max gas to use for the L2 retryable ticket + * @param _gasPriceBid Gas price bid for the L2 retryable ticket + * @param _maxSubmissionCost Max submission cost for the L2 retryable ticket + */ + function transferDelegationToL2( + address _indexer, + address _l2Beneficiary, + uint256 _maxGas, + uint256 _gasPriceBid, + uint256 _maxSubmissionCost + ) external payable; + + /** + * @notice Send a delegator's delegated tokens to L2, for a GraphTokenLockWallet vesting contract + * @dev This function can only be called by the delegator. + * This function will validate that the indexer has transferred their stake using transferStakeToL2, + * and that the delegation is not locked for undelegation. + * The L2 beneficiary for the delegation will be determined by calling the L1GraphTokenLockTransferTool contract, + * so the caller must have previously transferred tokens through that first + * (see GIP-0046 for details: https://forum.thegraph.com/t/4023). + * The ETH for the L2 gas will be pulled from the L1GraphTokenLockTransferTool, so the owner of + * the GraphTokenLockWallet must have previously deposited at least `_maxSubmissionCost + _gasPriceBid * _maxGas` + * ETH into the L1GraphTokenLockTransferTool contract (using its depositETH function). + * @param _indexer Address of the indexer (in L1, before transferring to L2) + * @param _maxGas Max gas to use for the L2 retryable ticket + * @param _gasPriceBid Gas price bid for the L2 retryable ticket + * @param _maxSubmissionCost Max submission cost for the L2 retryable ticket + */ + function transferLockedDelegationToL2( + address _indexer, + uint256 _maxGas, + uint256 _gasPriceBid, + uint256 _maxSubmissionCost + ) external; + + /** + * @notice Unlock a delegator's delegated tokens, if the indexer has transferred to L2 + * @dev This function can only be called by the delegator. + * This function will validate that the indexer has transferred their stake using transferStakeToL2, + * and that the indexer has no remaining stake in L1. + * The tokens must previously be locked for undelegation by calling `undelegate()`, + * and can be withdrawn with `withdrawDelegated()` immediately after calling this. + * @param _indexer Address of the indexer (in L1, before transferring to L2) + */ + function unlockDelegationToTransferredIndexer(address _indexer) external; +} diff --git a/packages/contracts/contracts/staking/IStaking.sol b/packages/contracts/contracts/staking/IStaking.sol new file mode 100644 index 000000000..3673c480b --- /dev/null +++ b/packages/contracts/contracts/staking/IStaking.sol @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity >=0.6.12 <0.8.0 || 0.8.27; +pragma abicoder v2; + +import { IStakingBase } from "./IStakingBase.sol"; +import { IStakingExtension } from "./IStakingExtension.sol"; +import { IMulticall } from "../base/IMulticall.sol"; +import { IManaged } from "../governance/IManaged.sol"; + +/** + * @title Interface for the Staking contract + * @notice This is the interface that should be used when interacting with the Staking contract. + * @dev Note that Staking doesn't actually inherit this interface. This is because of + * the custom setup of the Staking contract where part of the functionality is implemented + * in a separate contract (StakingExtension) to which calls are delegated through the fallback function. + */ +interface IStaking is IStakingBase, IStakingExtension, IMulticall, IManaged { + // Nothing to see here +} diff --git a/packages/contracts/contracts/staking/IStakingBase.sol b/packages/contracts/contracts/staking/IStakingBase.sol new file mode 100644 index 000000000..588144b2a --- /dev/null +++ b/packages/contracts/contracts/staking/IStakingBase.sol @@ -0,0 +1,400 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity >=0.6.12 <0.8.0 || 0.8.27; +pragma abicoder v2; + +import { IStakingData } from "./IStakingData.sol"; + +/** + * @title Base interface for the Staking contract. + * @dev This interface includes only what's implemented in the base Staking contract. + * It does not include the L1 and L2 specific functionality. It also does not include + * several functions that are implemented in the StakingExtension contract, and are called + * via delegatecall through the fallback function. See IStaking.sol for an interface + * that includes the full functionality. + */ +interface IStakingBase is IStakingData { + /** + * @dev Emitted when `indexer` stakes `tokens` amount. + */ + event StakeDeposited(address indexed indexer, uint256 tokens); + + /** + * @dev Emitted when `indexer` unstaked and locked `tokens` amount until `until` block. + */ + event StakeLocked(address indexed indexer, uint256 tokens, uint256 until); + + /** + * @dev Emitted when `indexer` withdrew `tokens` staked. + */ + event StakeWithdrawn(address indexed indexer, uint256 tokens); + + /** + * @dev Emitted when `indexer` allocated `tokens` amount to `subgraphDeploymentID` + * during `epoch`. + * `allocationID` indexer derived address used to identify the allocation. + * `metadata` additional information related to the allocation. + */ + event AllocationCreated( + address indexed indexer, + bytes32 indexed subgraphDeploymentID, + uint256 epoch, + uint256 tokens, + address indexed allocationID, + bytes32 metadata + ); + + /** + * @dev Emitted when `indexer` close an allocation in `epoch` for `allocationID`. + * An amount of `tokens` get unallocated from `subgraphDeploymentID`. + * This event also emits the POI (proof of indexing) submitted by the indexer. + * `isPublic` is true if the sender was someone other than the indexer. + */ + event AllocationClosed( + address indexed indexer, + bytes32 indexed subgraphDeploymentID, + uint256 epoch, + uint256 tokens, + address indexed allocationID, + address sender, + bytes32 poi, + bool isPublic + ); + + /** + * @dev Emitted when `indexer` collects a rebate on `subgraphDeploymentID` for `allocationID`. + * `epoch` is the protocol epoch the rebate was collected on + * The rebate is for `tokens` amount which are being provided by `assetHolder`; `queryFees` + * is the amount up for rebate after `curationFees` are distributed and `protocolTax` is burnt. + * `queryRebates` is the amount distributed to the `indexer` with `delegationFees` collected + * and sent to the delegation pool. + */ + event RebateCollected( + address assetHolder, + address indexed indexer, + bytes32 indexed subgraphDeploymentID, + address indexed allocationID, + uint256 epoch, + uint256 tokens, + uint256 protocolTax, + uint256 curationFees, + uint256 queryFees, + uint256 queryRebates, + uint256 delegationRewards + ); + + /** + * @dev Emitted when `indexer` update the delegation parameters for its delegation pool. + */ + event DelegationParametersUpdated( + address indexed indexer, + uint32 indexingRewardCut, + uint32 queryFeeCut, + uint32 __DEPRECATED_cooldownBlocks // solhint-disable-line var-name-mixedcase + ); + + /** + * @dev Emitted when `indexer` set `operator` access. + */ + event SetOperator(address indexed indexer, address indexed operator, bool allowed); + + /** + * @dev Emitted when `indexer` set an address to receive rewards. + */ + event SetRewardsDestination(address indexed indexer, address indexed destination); + + /** + * @dev Emitted when `extensionImpl` was set as the address of the StakingExtension contract + * to which extended functionality is delegated. + */ + event ExtensionImplementationSet(address indexed extensionImpl); + + /** + * @dev Possible states an allocation can be. + * States: + * - Null = indexer == address(0) + * - Active = not Null && tokens > 0 + * - Closed = Active && closedAtEpoch != 0 + */ + enum AllocationState { + Null, + Active, + Closed + } + + /** + * @notice Initialize this contract. + * @param _controller Address of the controller that manages this contract + * @param _minimumIndexerStake Minimum amount of tokens that an indexer must stake + * @param _thawingPeriod Number of blocks that tokens get locked after unstaking + * @param _protocolPercentage Percentage of query fees that are burned as protocol fee (in PPM) + * @param _curationPercentage Percentage of query fees that are given to curators (in PPM) + * @param _maxAllocationEpochs The maximum number of epochs that an allocation can be active + * @param _delegationUnbondingPeriod The period in epochs that tokens get locked after undelegating + * @param _delegationRatio The ratio between an indexer's own stake and the delegation they can use + * @param _rebatesParameters Alpha and lambda parameters for rebates function + * @param _extensionImpl Address of the StakingExtension implementation + */ + function initialize( + address _controller, + uint256 _minimumIndexerStake, + uint32 _thawingPeriod, + uint32 _protocolPercentage, + uint32 _curationPercentage, + uint32 _maxAllocationEpochs, + uint32 _delegationUnbondingPeriod, + uint32 _delegationRatio, + RebatesParameters calldata _rebatesParameters, + address _extensionImpl + ) external; + + /** + * @notice Set the address of the StakingExtension implementation. + * @dev This function can only be called by the governor. + * @param _extensionImpl Address of the StakingExtension implementation + */ + function setExtensionImpl(address _extensionImpl) external; + + /** + * @notice Set the address of the counterpart (L1 or L2) staking contract. + * @dev This function can only be called by the governor. + * @param _counterpart Address of the counterpart staking contract in the other chain, without any aliasing. + */ + function setCounterpartStakingAddress(address _counterpart) external; + + /** + * @notice Set the minimum stake needed to be an Indexer + * @dev This function can only be called by the governor. + * @param _minimumIndexerStake Minimum amount of tokens that an indexer must stake + */ + function setMinimumIndexerStake(uint256 _minimumIndexerStake) external; + + /** + * @notice Set the number of blocks that tokens get locked after unstaking + * @dev This function can only be called by the governor. + * @param _thawingPeriod Number of blocks that tokens get locked after unstaking + */ + function setThawingPeriod(uint32 _thawingPeriod) external; + + /** + * @notice Set the curation percentage of query fees sent to curators. + * @dev This function can only be called by the governor. + * @param _percentage Percentage of query fees sent to curators + */ + function setCurationPercentage(uint32 _percentage) external; + + /** + * @notice Set a protocol percentage to burn when collecting query fees. + * @dev This function can only be called by the governor. + * @param _percentage Percentage of query fees to burn as protocol fee + */ + function setProtocolPercentage(uint32 _percentage) external; + + /** + * @notice Set the max time allowed for indexers to allocate on a subgraph + * before others are allowed to close the allocation. + * @dev This function can only be called by the governor. + * @param _maxAllocationEpochs Allocation duration limit in epochs + */ + function setMaxAllocationEpochs(uint32 _maxAllocationEpochs) external; + + /** + * @notice Set the rebate parameters + * @dev This function can only be called by the governor. + * @param _alphaNumerator Numerator of `alpha` + * @param _alphaDenominator Denominator of `alpha` + * @param _lambdaNumerator Numerator of `lambda` + * @param _lambdaDenominator Denominator of `lambda` + */ + function setRebateParameters( + uint32 _alphaNumerator, + uint32 _alphaDenominator, + uint32 _lambdaNumerator, + uint32 _lambdaDenominator + ) external; + + /** + * @notice Authorize or unauthorize an address to be an operator for the caller. + * @param _operator Address to authorize or unauthorize + * @param _allowed Whether the operator is authorized or not + */ + function setOperator(address _operator, bool _allowed) external; + + /** + * @notice Deposit tokens on the indexer's stake. + * The amount staked must be over the minimumIndexerStake. + * @param _tokens Amount of tokens to stake + */ + function stake(uint256 _tokens) external; + + /** + * @notice Deposit tokens on the Indexer stake, on behalf of the Indexer. + * The amount staked must be over the minimumIndexerStake. + * @param _indexer Address of the indexer + * @param _tokens Amount of tokens to stake + */ + function stakeTo(address _indexer, uint256 _tokens) external; + + /** + * @notice Unstake tokens from the indexer stake, lock them until the thawing period expires. + * @dev NOTE: The function accepts an amount greater than the currently staked tokens. + * If that happens, it will try to unstake the max amount of tokens it can. + * The reason for this behaviour is to avoid time conditions while the transaction + * is in flight. + * @param _tokens Amount of tokens to unstake + */ + function unstake(uint256 _tokens) external; + + /** + * @notice Withdraw indexer tokens once the thawing period has passed. + */ + function withdraw() external; + + /** + * @notice Set the destination where to send rewards for an indexer. + * @param _destination Rewards destination address. If set to zero, rewards will be restaked + */ + function setRewardsDestination(address _destination) external; + + /** + * @notice Set the delegation parameters for the caller. + * @param _indexingRewardCut Percentage of indexing rewards left for the indexer + * @param _queryFeeCut Percentage of query fees left for the indexer + */ + function setDelegationParameters( + uint32 _indexingRewardCut, + uint32 _queryFeeCut, + uint32 // _cooldownBlocks, deprecated + ) external; + + /** + * @notice Allocate available tokens to a subgraph deployment. + * @param _subgraphDeploymentID ID of the SubgraphDeployment where tokens will be allocated + * @param _tokens Amount of tokens to allocate + * @param _allocationID The allocation identifier + * @param _metadata IPFS hash for additional information about the allocation + * @param _proof A 65-bytes Ethereum signed message of `keccak256(indexerAddress,allocationID)` + */ + function allocate( + bytes32 _subgraphDeploymentID, + uint256 _tokens, + address _allocationID, + bytes32 _metadata, + bytes calldata _proof + ) external; + + /** + * @notice Allocate available tokens to a subgraph deployment from and indexer's stake. + * The caller must be the indexer or the indexer's operator. + * @param _indexer Indexer address to allocate funds from. + * @param _subgraphDeploymentID ID of the SubgraphDeployment where tokens will be allocated + * @param _tokens Amount of tokens to allocate + * @param _allocationID The allocation identifier + * @param _metadata IPFS hash for additional information about the allocation + * @param _proof A 65-bytes Ethereum signed message of `keccak256(indexerAddress,allocationID)` + */ + function allocateFrom( + address _indexer, + bytes32 _subgraphDeploymentID, + uint256 _tokens, + address _allocationID, + bytes32 _metadata, + bytes calldata _proof + ) external; + + /** + * @notice Close an allocation and free the staked tokens. + * To be eligible for rewards a proof of indexing must be presented. + * Presenting a bad proof is subject to slashable condition. + * To opt out of rewards set _poi to 0x0 + * @param _allocationID The allocation identifier + * @param _poi Proof of indexing submitted for the allocated period + */ + function closeAllocation(address _allocationID, bytes32 _poi) external; + + /** + * @notice Collect query fees from state channels and assign them to an allocation. + * Funds received are only accepted from a valid sender. + * @dev To avoid reverting on the withdrawal from channel flow this function will: + * 1) Accept calls with zero tokens. + * 2) Accept calls after an allocation passed the dispute period, in that case, all + * the received tokens are burned. + * @param _tokens Amount of tokens to collect + * @param _allocationID Allocation where the tokens will be assigned + */ + function collect(uint256 _tokens, address _allocationID) external; + + /** + * @notice Return true if operator is allowed for indexer. + * @param _operator Address of the operator + * @param _indexer Address of the indexer + * @return True if operator is allowed for indexer, false otherwise + */ + function isOperator(address _operator, address _indexer) external view returns (bool); + + /** + * @notice Getter that returns if an indexer has any stake. + * @param _indexer Address of the indexer + * @return True if indexer has staked tokens + */ + function hasStake(address _indexer) external view returns (bool); + + /** + * @notice Get the total amount of tokens staked by the indexer. + * @param _indexer Address of the indexer + * @return Amount of tokens staked by the indexer + */ + function getIndexerStakedTokens(address _indexer) external view returns (uint256); + + /** + * @notice Get the total amount of tokens available to use in allocations. + * This considers the indexer stake and delegated tokens according to delegation ratio + * @param _indexer Address of the indexer + * @return Amount of tokens available to allocate including delegation + */ + function getIndexerCapacity(address _indexer) external view returns (uint256); + + /** + * @notice Return the allocation by ID. + * @param _allocationID Address used as allocation identifier + * @return Allocation data + */ + function getAllocation(address _allocationID) external view returns (Allocation memory); + + /** + * @dev New function to get the allocation data for the rewards manager + * @dev Note that this is only to make tests pass, as the staking contract with + * this changes will never get deployed. HorizonStaking is taking it's place. + */ + function getAllocationData( + address _allocationID + ) external view returns (bool, address, bytes32, uint256, uint256, uint256); + + /** + * @dev New function to get the allocation active status for the rewards manager + * @dev Note that this is only to make tests pass, as the staking contract with + * this changes will never get deployed. HorizonStaking is taking it's place. + */ + function isActiveAllocation(address _allocationID) external view returns (bool); + + /** + * @notice Return the current state of an allocation + * @param _allocationID Allocation identifier + * @return AllocationState enum with the state of the allocation + */ + function getAllocationState(address _allocationID) external view returns (AllocationState); + + /** + * @notice Return if allocationID is used. + * @param _allocationID Address used as signer by the indexer for an allocation + * @return True if allocationID already used + */ + function isAllocation(address _allocationID) external view returns (bool); + + /** + * @notice Return the total amount of tokens allocated to subgraph. + * @param _subgraphDeploymentID Deployment ID for the subgraph + * @return Total tokens allocated to subgraph + */ + function getSubgraphAllocatedTokens(bytes32 _subgraphDeploymentID) external view returns (uint256); +} diff --git a/packages/contracts/contracts/staking/IStakingData.sol b/packages/contracts/contracts/staking/IStakingData.sol new file mode 100644 index 000000000..149e3b8a6 --- /dev/null +++ b/packages/contracts/contracts/staking/IStakingData.sol @@ -0,0 +1,59 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity >=0.6.12 <0.8.0 || 0.8.27; + +/** + * @title Staking Data interface + * @dev This interface defines some structures used by the Staking contract. + */ +interface IStakingData { + /** + * @dev Allocate GRT tokens for the purpose of serving queries of a subgraph deployment + * An allocation is created in the allocate() function and closed in closeAllocation() + */ + struct Allocation { + address indexer; + bytes32 subgraphDeploymentID; + uint256 tokens; // Tokens allocated to a SubgraphDeployment + uint256 createdAtEpoch; // Epoch when it was created + uint256 closedAtEpoch; // Epoch when it was closed + uint256 collectedFees; // Collected fees for the allocation + uint256 __DEPRECATED_effectiveAllocation; // solhint-disable-line var-name-mixedcase + uint256 accRewardsPerAllocatedToken; // Snapshot used for reward calc + uint256 distributedRebates; // Collected rebates that have been rebated + } + + // -- Delegation Data -- + + /** + * @dev Delegation pool information. One per indexer. + */ + struct DelegationPool { + uint32 __DEPRECATED_cooldownBlocks; // solhint-disable-line var-name-mixedcase + uint32 indexingRewardCut; // in PPM + uint32 queryFeeCut; // in PPM + uint256 updatedAtBlock; // Block when the pool was last updated + uint256 tokens; // Total tokens as pool reserves + uint256 shares; // Total shares minted in the pool + mapping(address => Delegation) delegators; // Mapping of delegator => Delegation + } + + /** + * @dev Individual delegation data of a delegator in a pool. + */ + struct Delegation { + uint256 shares; // Shares owned by a delegator in the pool + uint256 tokensLocked; // Tokens locked for undelegation + uint256 tokensLockedUntil; // Epoch when locked tokens can be withdrawn + } + + /** + * @dev Rebates parameters. Used to avoid stack too deep errors in Staking initialize function. + */ + struct RebatesParameters { + uint32 alphaNumerator; + uint32 alphaDenominator; + uint32 lambdaNumerator; + uint32 lambdaDenominator; + } +} diff --git a/packages/contracts/contracts/staking/IStakingExtension.sol b/packages/contracts/contracts/staking/IStakingExtension.sol new file mode 100644 index 000000000..9a998aac5 --- /dev/null +++ b/packages/contracts/contracts/staking/IStakingExtension.sol @@ -0,0 +1,292 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity >=0.6.12 <0.8.0 || 0.8.27; +pragma abicoder v2; + +import { IStakingData } from "./IStakingData.sol"; +import { IStakes } from "./libs/IStakes.sol"; + +/** + * @title Interface for the StakingExtension contract + * @dev This interface defines the events and functions implemented + * in the StakingExtension contract, which is used to extend the functionality + * of the Staking contract while keeping it within the 24kB mainnet size limit. + * In particular, this interface includes delegation functions and various storage + * getters. + */ +interface IStakingExtension is IStakingData { + /** + * @dev DelegationPool struct as returned by delegationPools(), since + * the original DelegationPool in IStakingData.sol contains a nested mapping. + */ + struct DelegationPoolReturn { + uint32 __DEPRECATED_cooldownBlocks; // solhint-disable-line var-name-mixedcase + uint32 indexingRewardCut; // in PPM + uint32 queryFeeCut; // in PPM + uint256 updatedAtBlock; // Block when the pool was last updated + uint256 tokens; // Total tokens as pool reserves + uint256 shares; // Total shares minted in the pool + } + + /** + * @dev Emitted when `delegator` delegated `tokens` to the `indexer`, the delegator + * gets `shares` for the delegation pool proportionally to the tokens staked. + */ + event StakeDelegated(address indexed indexer, address indexed delegator, uint256 tokens, uint256 shares); + + /** + * @dev Emitted when `delegator` undelegated `tokens` from `indexer`. + * Tokens get locked for withdrawal after a period of time. + */ + event StakeDelegatedLocked( + address indexed indexer, + address indexed delegator, + uint256 tokens, + uint256 shares, + uint256 until + ); + + /** + * @dev Emitted when `delegator` withdrew delegated `tokens` from `indexer`. + */ + event StakeDelegatedWithdrawn(address indexed indexer, address indexed delegator, uint256 tokens); + + /** + * @dev Emitted when `indexer` was slashed for a total of `tokens` amount. + * Tracks `reward` amount of tokens given to `beneficiary`. + */ + event StakeSlashed(address indexed indexer, uint256 tokens, uint256 reward, address beneficiary); + + /** + * @dev Emitted when `caller` set `slasher` address as `allowed` to slash stakes. + */ + event SlasherUpdate(address indexed caller, address indexed slasher, bool allowed); + + /** + * @notice Set the delegation ratio. + * If set to 10 it means the indexer can use up to 10x the indexer staked amount + * from their delegated tokens + * @dev This function is only callable by the governor + * @param _delegationRatio Delegation capacity multiplier + */ + function setDelegationRatio(uint32 _delegationRatio) external; + + /** + * @notice Set the time, in epochs, a Delegator needs to wait to withdraw tokens after undelegating. + * @dev This function is only callable by the governor + * @param _delegationUnbondingPeriod Period in epochs to wait for token withdrawals after undelegating + */ + function setDelegationUnbondingPeriod(uint32 _delegationUnbondingPeriod) external; + + /** + * @notice Set a delegation tax percentage to burn when delegated funds are deposited. + * @dev This function is only callable by the governor + * @param _percentage Percentage of delegated tokens to burn as delegation tax, expressed in parts per million + */ + function setDelegationTaxPercentage(uint32 _percentage) external; + + /** + * @notice Set or unset an address as allowed slasher. + * @dev This function can only be called by the governor. + * @param _slasher Address of the party allowed to slash indexers + * @param _allowed True if slasher is allowed + */ + function setSlasher(address _slasher, bool _allowed) external; + + /** + * @notice Delegate tokens to an indexer. + * @param _indexer Address of the indexer to which tokens are delegated + * @param _tokens Amount of tokens to delegate + * @return Amount of shares issued from the delegation pool + */ + function delegate(address _indexer, uint256 _tokens) external returns (uint256); + + /** + * @notice Undelegate tokens from an indexer. Tokens will be locked for the unbonding period. + * @param _indexer Address of the indexer to which tokens had been delegated + * @param _shares Amount of shares to return and undelegate tokens + * @return Amount of tokens returned for the shares of the delegation pool + */ + function undelegate(address _indexer, uint256 _shares) external returns (uint256); + + /** + * @notice Withdraw undelegated tokens once the unbonding period has passed, and optionally + * re-delegate to a new indexer. + * @param _indexer Withdraw available tokens delegated to indexer + * @param _newIndexer Re-delegate to indexer address if non-zero, withdraw if zero address + */ + function withdrawDelegated(address _indexer, address _newIndexer) external returns (uint256); + + /** + * @notice Slash the indexer stake. Delegated tokens are not subject to slashing. + * @dev Can only be called by the slasher role. + * @param _indexer Address of indexer to slash + * @param _tokens Amount of tokens to slash from the indexer stake + * @param _reward Amount of reward tokens to send to a beneficiary + * @param _beneficiary Address of a beneficiary to receive a reward for the slashing + */ + function slash(address _indexer, uint256 _tokens, uint256 _reward, address _beneficiary) external; + + /** + * @notice Return the delegation from a delegator to an indexer. + * @param _indexer Address of the indexer where funds have been delegated + * @param _delegator Address of the delegator + * @return Delegation data + */ + function getDelegation(address _indexer, address _delegator) external view returns (Delegation memory); + + /** + * @notice Return whether the delegator has delegated to the indexer. + * @param _indexer Address of the indexer where funds have been delegated + * @param _delegator Address of the delegator + * @return True if delegator has tokens delegated to the indexer + */ + function isDelegator(address _indexer, address _delegator) external view returns (bool); + + /** + * @notice Returns amount of delegated tokens ready to be withdrawn after unbonding period. + * @param _delegation Delegation of tokens from delegator to indexer + * @return Amount of tokens to withdraw + */ + function getWithdraweableDelegatedTokens(Delegation memory _delegation) external view returns (uint256); + + /** + * @notice Getter for the delegationRatio, i.e. the delegation capacity multiplier: + * If delegation ratio is 100, and an Indexer has staked 5 GRT, + * then they can use up to 500 GRT from the delegated stake + * @return Delegation ratio + */ + function delegationRatio() external view returns (uint32); + + /** + * @notice Getter for delegationUnbondingPeriod: + * Time in epochs a delegator needs to wait to withdraw delegated stake + * @return Delegation unbonding period in epochs + */ + function delegationUnbondingPeriod() external view returns (uint32); + + /** + * @notice Getter for delegationTaxPercentage: + * Percentage of tokens to tax a delegation deposit, expressed in parts per million + * @return Delegation tax percentage in parts per million + */ + function delegationTaxPercentage() external view returns (uint32); + + /** + * @notice Getter for delegationPools[_indexer]: + * gets the delegation pool structure for a particular indexer. + * @param _indexer Address of the indexer for which to query the delegation pool + * @return Delegation pool as a DelegationPoolReturn struct + */ + function delegationPools(address _indexer) external view returns (DelegationPoolReturn memory); + + /** + * @notice Getter for operatorAuth[_indexer][_maybeOperator]: + * returns true if the operator is authorized to operate on behalf of the indexer. + * @param _indexer The indexer address for which to query authorization + * @param _maybeOperator The address that may or may not be an operator + * @return True if the operator is authorized to operate on behalf of the indexer + */ + function operatorAuth(address _indexer, address _maybeOperator) external view returns (bool); + + /** + * @notice Getter for rewardsDestination[_indexer]: + * returns the address where the indexer's rewards are sent. + * @param _indexer The indexer address for which to query the rewards destination + * @return The address where the indexer's rewards are sent, zero if none is set in which case rewards are re-staked + */ + function rewardsDestination(address _indexer) external view returns (address); + + /** + * @notice Getter for subgraphAllocations[_subgraphDeploymentId]: + * returns the amount of tokens allocated to a subgraph deployment. + * @param _subgraphDeploymentId The subgraph deployment for which to query the allocations + * @return The amount of tokens allocated to the subgraph deployment + */ + function subgraphAllocations(bytes32 _subgraphDeploymentId) external view returns (uint256); + + /** + * @notice Getter for slashers[_maybeSlasher]: + * returns true if the address is a slasher, i.e. an entity that can slash indexers + * @param _maybeSlasher Address for which to check the slasher role + * @return True if the address is a slasher + */ + function slashers(address _maybeSlasher) external view returns (bool); + + /** + * @notice Getter for minimumIndexerStake: the minimum + * amount of GRT that an indexer needs to stake. + * @return Minimum indexer stake in GRT + */ + function minimumIndexerStake() external view returns (uint256); + + /** + * @notice Getter for thawingPeriod: the time in blocks an + * indexer needs to wait to unstake tokens. + * @return Thawing period in blocks + */ + function thawingPeriod() external view returns (uint32); + + /** + * @notice Getter for curationPercentage: the percentage of + * query fees that are distributed to curators. + * @return Curation percentage in parts per million + */ + function curationPercentage() external view returns (uint32); + + /** + * @notice Getter for protocolPercentage: the percentage of + * query fees that are burned as protocol fees. + * @return Protocol percentage in parts per million + */ + function protocolPercentage() external view returns (uint32); + + /** + * @notice Getter for maxAllocationEpochs: the maximum time in epochs + * that an allocation can be open before anyone is allowed to close it. This + * also caps the effective allocation when sending the allocation's query fees + * to the rebate pool. + * @return Maximum allocation period in epochs + */ + function maxAllocationEpochs() external view returns (uint32); + + /** + * @notice Getter for the numerator of the rebates alpha parameter + * @return Alpha numerator + */ + function alphaNumerator() external view returns (uint32); + + /** + * @notice Getter for the denominator of the rebates alpha parameter + * @return Alpha denominator + */ + function alphaDenominator() external view returns (uint32); + + /** + * @notice Getter for the numerator of the rebates lambda parameter + * @return Lambda numerator + */ + function lambdaNumerator() external view returns (uint32); + + /** + * @notice Getter for the denominator of the rebates lambda parameter + * @return Lambda denominator + */ + function lambdaDenominator() external view returns (uint32); + + /** + * @notice Getter for stakes[_indexer]: + * gets the stake information for an indexer as a IStakes.Indexer struct. + * @param _indexer Indexer address for which to query the stake information + * @return Stake information for the specified indexer, as a IStakes.Indexer struct + */ + function stakes(address _indexer) external view returns (IStakes.Indexer memory); + + /** + * @notice Getter for allocations[_allocationID]: + * gets an allocation's information as an IStakingData.Allocation struct. + * @param _allocationID Allocation ID for which to query the allocation information + * @return The specified allocation, as an IStakingData.Allocation struct + */ + function allocations(address _allocationID) external view returns (IStakingData.Allocation memory); +} diff --git a/packages/contracts/contracts/staking/L1Staking.sol b/packages/contracts/contracts/staking/L1Staking.sol new file mode 100644 index 000000000..78ce8bc63 --- /dev/null +++ b/packages/contracts/contracts/staking/L1Staking.sol @@ -0,0 +1,384 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.7.6; +pragma abicoder v2; + +import { SafeMath } from "@openzeppelin/contracts/math/SafeMath.sol"; + +import { ITokenGateway } from "../arbitrum/ITokenGateway.sol"; +import { Staking } from "./Staking.sol"; +import { Stakes } from "./libs/Stakes.sol"; +import { IStakes } from "./libs/IStakes.sol"; +import { IStakingData } from "./IStakingData.sol"; +import { L1StakingV1Storage } from "./L1StakingStorage.sol"; +import { IGraphToken } from "../token/IGraphToken.sol"; +import { IL1StakingBase } from "./IL1StakingBase.sol"; +import { MathUtils } from "./libs/MathUtils.sol"; +import { IL1GraphTokenLockTransferTool } from "./IL1GraphTokenLockTransferTool.sol"; +import { IL2StakingTypes } from "../l2/staking/IL2StakingTypes.sol"; + +/** + * @title L1Staking contract + * @dev This contract is the L1 variant of the Staking contract. It adds functions + * to send an indexer's stake to L2, and to send delegation to L2 as well. + */ +contract L1Staking is Staking, L1StakingV1Storage, IL1StakingBase { + using Stakes for IStakes.Indexer; + using SafeMath for uint256; + + /** + * @notice Receive ETH into the Staking contract + * @dev Only the L1GraphTokenLockTransferTool can send ETH, as part of the + * transfer of stake/delegation for vesting lock wallets. + */ + receive() external payable { + require(msg.sender == address(l1GraphTokenLockTransferTool), "Only transfer tool can send ETH"); + } + + /** + * @notice Set the L1GraphTokenLockTransferTool contract address + * @dev This function can only be called by the governor. + * @param _l1GraphTokenLockTransferTool Address of the L1GraphTokenLockTransferTool contract + */ + function setL1GraphTokenLockTransferTool( + IL1GraphTokenLockTransferTool _l1GraphTokenLockTransferTool + ) external override onlyGovernor { + l1GraphTokenLockTransferTool = _l1GraphTokenLockTransferTool; + emit L1GraphTokenLockTransferToolSet(address(_l1GraphTokenLockTransferTool)); + } + + /** + * @notice Send an indexer's stake to L2. + * @dev This function can only be called by the indexer (not an operator). + * It will validate that the remaining stake is sufficient to cover all the allocated + * stake, so the indexer might have to close some allocations before transferring. + * It will also check that the indexer's stake is not locked for withdrawal. + * Since the indexer address might be an L1-only contract, the function takes a beneficiary + * address that will be the indexer's address in L2. + * The caller must provide an amount of ETH to use for the L2 retryable ticket, that + * must be at _exactly_ `_maxSubmissionCost + _gasPriceBid * _maxGas`. + * Any refunds for the submission fee or L2 gas will be lost. + * @param _l2Beneficiary Address of the indexer in L2. If the indexer has previously transferred stake, this must match the previously-used value. + * @param _amount Amount of stake GRT to transfer to L2 + * @param _maxGas Max gas to use for the L2 retryable ticket + * @param _gasPriceBid Gas price bid for the L2 retryable ticket + * @param _maxSubmissionCost Max submission cost for the L2 retryable ticket + */ + function transferStakeToL2( + address _l2Beneficiary, + uint256 _amount, + uint256 _maxGas, + uint256 _gasPriceBid, + uint256 _maxSubmissionCost + ) external payable override notPartialPaused { + require(msg.value == _maxSubmissionCost.add(_gasPriceBid.mul(_maxGas)), "INVALID_ETH_AMOUNT"); + _transferStakeToL2(msg.sender, _l2Beneficiary, _amount, _maxGas, _gasPriceBid, _maxSubmissionCost, msg.value); + } + + /** + * @notice Send an indexer's stake to L2, from a GraphTokenLockWallet vesting contract. + * @dev This function can only be called by the indexer (not an operator). + * It will validate that the remaining stake is sufficient to cover all the allocated + * stake, so the indexer might have to close some allocations before transferring. + * It will also check that the indexer's stake is not locked for withdrawal. + * The L2 beneficiary for the stake will be determined by calling the L1GraphTokenLockTransferTool contract, + * so the caller must have previously transferred tokens through that first + * (see GIP-0046 for details: https://forum.thegraph.com/t/4023). + * The ETH for the L2 gas will be pulled from the L1GraphTokenLockTransferTool, so the owner of + * the GraphTokenLockWallet must have previously deposited at least `_maxSubmissionCost + _gasPriceBid * _maxGas` + * ETH into the L1GraphTokenLockTransferTool contract (using its depositETH function). + * Any refunds for the submission fee or L2 gas will be lost. + * @param _amount Amount of stake GRT to transfer to L2 + * @param _maxGas Max gas to use for the L2 retryable ticket + * @param _gasPriceBid Gas price bid for the L2 retryable ticket + * @param _maxSubmissionCost Max submission cost for the L2 retryable ticket + */ + function transferLockedStakeToL2( + uint256 _amount, + uint256 _maxGas, + uint256 _gasPriceBid, + uint256 _maxSubmissionCost + ) external override notPartialPaused { + address l2Beneficiary = l1GraphTokenLockTransferTool.l2WalletAddress(msg.sender); + require(l2Beneficiary != address(0), "LOCK NOT TRANSFERRED"); + uint256 balance = address(this).balance; + uint256 ethAmount = _maxSubmissionCost.add(_maxGas.mul(_gasPriceBid)); + l1GraphTokenLockTransferTool.pullETH(msg.sender, ethAmount); + require(address(this).balance == balance.add(ethAmount), "ETH TRANSFER FAILED"); + _transferStakeToL2(msg.sender, l2Beneficiary, _amount, _maxGas, _gasPriceBid, _maxSubmissionCost, ethAmount); + } + + /** + * @notice Send a delegator's delegated tokens to L2 + * @dev This function can only be called by the delegator. + * This function will validate that the indexer has transferred their stake using transferStakeToL2, + * and that the delegation is not locked for undelegation. + * Since the delegator's address might be an L1-only contract, the function takes a beneficiary + * address that will be the delegator's address in L2. + * The caller must provide an amount of ETH to use for the L2 retryable ticket, that + * must be _exactly_ `_maxSubmissionCost + _gasPriceBid * _maxGas`. + * Any refunds for the submission fee or L2 gas will be lost. + * @param _indexer Address of the indexer (in L1, before transferring to L2) + * @param _l2Beneficiary Address of the delegator in L2 + * @param _maxGas Max gas to use for the L2 retryable ticket + * @param _gasPriceBid Gas price bid for the L2 retryable ticket + * @param _maxSubmissionCost Max submission cost for the L2 retryable ticket + */ + function transferDelegationToL2( + address _indexer, + address _l2Beneficiary, + uint256 _maxGas, + uint256 _gasPriceBid, + uint256 _maxSubmissionCost + ) external payable override notPartialPaused { + require(msg.value == _maxSubmissionCost.add(_gasPriceBid.mul(_maxGas)), "INVALID_ETH_AMOUNT"); + _transferDelegationToL2( + msg.sender, + _indexer, + _l2Beneficiary, + _maxGas, + _gasPriceBid, + _maxSubmissionCost, + msg.value + ); + } + + /** + * @notice Send a delegator's delegated tokens to L2, for a GraphTokenLockWallet vesting contract + * @dev This function can only be called by the delegator. + * This function will validate that the indexer has transferred their stake using transferStakeToL2, + * and that the delegation is not locked for undelegation. + * The L2 beneficiary for the delegation will be determined by calling the L1GraphTokenLockTransferTool contract, + * so the caller must have previously transferred tokens through that first + * (see GIP-0046 for details: https://forum.thegraph.com/t/4023). + * The ETH for the L2 gas will be pulled from the L1GraphTokenLockTransferTool, so the owner of + * the GraphTokenLockWallet must have previously deposited at least `_maxSubmissionCost + _gasPriceBid * _maxGas` + * ETH into the L1GraphTokenLockTransferTool contract (using its depositETH function). + * Any refunds for the submission fee or L2 gas will be lost. + * @param _indexer Address of the indexer (in L1, before transferring to L2) + * @param _maxGas Max gas to use for the L2 retryable ticket + * @param _gasPriceBid Gas price bid for the L2 retryable ticket + * @param _maxSubmissionCost Max submission cost for the L2 retryable ticket + */ + function transferLockedDelegationToL2( + address _indexer, + uint256 _maxGas, + uint256 _gasPriceBid, + uint256 _maxSubmissionCost + ) external override notPartialPaused { + address l2Beneficiary = l1GraphTokenLockTransferTool.l2WalletAddress(msg.sender); + require(l2Beneficiary != address(0), "LOCK NOT TRANSFERRED"); + uint256 balance = address(this).balance; + uint256 ethAmount = _maxSubmissionCost.add(_maxGas.mul(_gasPriceBid)); + l1GraphTokenLockTransferTool.pullETH(msg.sender, ethAmount); + require(address(this).balance == balance.add(ethAmount), "ETH TRANSFER FAILED"); + _transferDelegationToL2( + msg.sender, + _indexer, + l2Beneficiary, + _maxGas, + _gasPriceBid, + _maxSubmissionCost, + ethAmount + ); + } + + /** + * @notice Unlock a delegator's delegated tokens, if the indexer has transferred to L2 + * @dev This function can only be called by the delegator. + * This function will validate that the indexer has transferred their stake using transferStakeToL2, + * and that the indexer has no remaining stake in L1. + * The tokens must previously be locked for undelegation by calling `undelegate()`, + * and can be withdrawn with `withdrawDelegated()` immediately after calling this. + * @param _indexer Address of the indexer (in L1, before transferring to L2) + */ + function unlockDelegationToTransferredIndexer(address _indexer) external override notPartialPaused { + require( + indexerTransferredToL2[_indexer] != address(0) && __stakes[_indexer].tokensStaked == 0, + "indexer not transferred" + ); + + Delegation storage delegation = __delegationPools[_indexer].delegators[msg.sender]; + require(delegation.tokensLocked != 0, "! locked"); + + // Unlock the delegation + delegation.tokensLockedUntil = epochManager().currentEpoch(); + + // After this, the delegator should be able to withdraw in the current block + emit StakeDelegatedUnlockedDueToL2Transfer(_indexer, msg.sender); + } + + /** + * @dev Implements sending an indexer's stake to L2. + * This function can only be called by the indexer (not an operator). + * It will validate that the remaining stake is sufficient to cover all the allocated + * stake, so the indexer might have to close some allocations before transferring. + * It will also check that the indexer's stake is not locked for withdrawal. + * Since the indexer address might be an L1-only contract, the function takes a beneficiary + * address that will be the indexer's address in L2. + * @param _l2Beneficiary Address of the indexer in L2. If the indexer has previously transferred stake, this must match the previously-used value. + * @param _amount Amount of stake GRT to transfer to L2 + * @param _maxGas Max gas to use for the L2 retryable ticket + * @param _gasPriceBid Gas price bid for the L2 retryable ticket + * @param _maxSubmissionCost Max submission cost for the L2 retryable ticket + * @param _ethAmount Amount of ETH to send with the retryable ticket + */ + function _transferStakeToL2( + address _indexer, + address _l2Beneficiary, + uint256 _amount, + uint256 _maxGas, + uint256 _gasPriceBid, + uint256 _maxSubmissionCost, + uint256 _ethAmount + ) internal { + IStakes.Indexer storage indexerStake = __stakes[_indexer]; + require(indexerStake.tokensStaked != 0, "tokensStaked == 0"); + // Indexers shouldn't be trying to withdraw tokens before transferring to L2. + // Allowing this would complicate our accounting so we require that they have no + // tokens locked for withdrawal. + require(indexerStake.tokensLocked == 0, "tokensLocked != 0"); + + require(_l2Beneficiary != address(0), "l2Beneficiary == 0"); + if (indexerTransferredToL2[_indexer] != address(0)) { + require(indexerTransferredToL2[_indexer] == _l2Beneficiary, "l2Beneficiary != previous"); + } else { + indexerTransferredToL2[_indexer] = _l2Beneficiary; + require(_amount >= __minimumIndexerStake, "!minimumIndexerStake sent"); + } + // Ensure minimum stake + indexerStake.tokensStaked = indexerStake.tokensStaked.sub(_amount); + require( + indexerStake.tokensStaked == 0 || indexerStake.tokensStaked >= __minimumIndexerStake, + "!minimumIndexerStake remaining" + ); + + IStakingData.DelegationPool storage delegationPool = __delegationPools[_indexer]; + + if (indexerStake.tokensStaked == 0) { + // require that no allocations are open + require(indexerStake.tokensAllocated == 0, "allocated"); + } else { + // require that the indexer has enough stake to cover all allocations + uint256 tokensDelegatedCap = indexerStake.tokensStaked.mul(uint256(__delegationRatio)); + uint256 tokensDelegatedCapacity = MathUtils.min(delegationPool.tokens, tokensDelegatedCap); + require( + indexerStake.tokensUsed() <= indexerStake.tokensStaked.add(tokensDelegatedCapacity), + "! allocation capacity" + ); + } + + IL2StakingTypes.ReceiveIndexerStakeData memory functionData; + functionData.indexer = _l2Beneficiary; + + bytes memory extraData = abi.encode( + uint8(IL2StakingTypes.L1MessageCodes.RECEIVE_INDEXER_STAKE_CODE), + abi.encode(functionData) + ); + + _sendTokensAndMessageToL2Staking(_amount, _maxGas, _gasPriceBid, _maxSubmissionCost, _ethAmount, extraData); + + emit IndexerStakeTransferredToL2(_indexer, _l2Beneficiary, _amount); + } + + /** + * @dev Implements sending a delegator's delegated tokens to L2. + * This function can only be called by the delegator. + * This function will validate that the indexer has transferred their stake using transferStakeToL2, + * and that the delegation is not locked for undelegation. + * Since the delegator's address might be an L1-only contract, the function takes a beneficiary + * address that will be the delegator's address in L2. + * @param _indexer Address of the indexer (in L1, before transferring to L2) + * @param _l2Beneficiary Address of the delegator in L2 + * @param _maxGas Max gas to use for the L2 retryable ticket + * @param _gasPriceBid Gas price bid for the L2 retryable ticket + * @param _maxSubmissionCost Max submission cost for the L2 retryable ticket + * @param _ethAmount Amount of ETH to send with the retryable ticket + */ + function _transferDelegationToL2( + address _delegator, + address _indexer, + address _l2Beneficiary, + uint256 _maxGas, + uint256 _gasPriceBid, + uint256 _maxSubmissionCost, + uint256 _ethAmount + ) internal { + require(_l2Beneficiary != address(0), "l2Beneficiary == 0"); + require(indexerTransferredToL2[_indexer] != address(0), "indexer not transferred"); + + // Get the delegation pool of the indexer + DelegationPool storage pool = __delegationPools[_indexer]; + Delegation storage delegation = pool.delegators[_delegator]; + + // Check that the delegation is not locked for undelegation + require(delegation.tokensLocked == 0, "tokensLocked != 0"); + require(delegation.shares != 0, "delegation == 0"); + // Calculate tokens to get in exchange for the shares + uint256 tokensToSend = delegation.shares.mul(pool.tokens).div(pool.shares); + + // Update the delegation pool + pool.tokens = pool.tokens.sub(tokensToSend); + pool.shares = pool.shares.sub(delegation.shares); + + // Update the delegation + delegation.shares = 0; + bytes memory extraData; + { + IL2StakingTypes.ReceiveDelegationData memory functionData; + functionData.indexer = indexerTransferredToL2[_indexer]; + functionData.delegator = _l2Beneficiary; + extraData = abi.encode( + uint8(IL2StakingTypes.L1MessageCodes.RECEIVE_DELEGATION_CODE), + abi.encode(functionData) + ); + } + + _sendTokensAndMessageToL2Staking( + tokensToSend, + _maxGas, + _gasPriceBid, + _maxSubmissionCost, + _ethAmount, + extraData + ); + emit DelegationTransferredToL2( + _delegator, + _l2Beneficiary, + _indexer, + indexerTransferredToL2[_indexer], + tokensToSend + ); + } + + /** + * @dev Sends a message to the L2Staking with some extra data, + * also sending some tokens, using the L1GraphTokenGateway. + * @param _tokens Amount of tokens to send to L2 + * @param _maxGas Max gas to use for the L2 retryable ticket + * @param _gasPriceBid Gas price bid for the L2 retryable ticket + * @param _maxSubmissionCost Max submission cost for the L2 retryable ticket + * @param _value Amount of ETH to send with the message + * @param _extraData Extra data for the callhook on L2Staking + */ + function _sendTokensAndMessageToL2Staking( + uint256 _tokens, + uint256 _maxGas, + uint256 _gasPriceBid, + uint256 _maxSubmissionCost, + uint256 _value, + bytes memory _extraData + ) internal { + IGraphToken grt = graphToken(); + ITokenGateway gateway = graphTokenGateway(); + grt.approve(address(gateway), _tokens); + gateway.outboundTransfer{ value: _value }( + address(grt), + counterpartStakingAddress, + _tokens, + _maxGas, + _gasPriceBid, + abi.encode(_maxSubmissionCost, _extraData) + ); + } +} diff --git a/packages/contracts/contracts/staking/L1StakingStorage.sol b/packages/contracts/contracts/staking/L1StakingStorage.sol new file mode 100644 index 000000000..bd7a7f0ee --- /dev/null +++ b/packages/contracts/contracts/staking/L1StakingStorage.sol @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.7.6; +pragma abicoder v2; + +import { IL1GraphTokenLockTransferTool } from "./IL1GraphTokenLockTransferTool.sol"; + +/** + * @title L1StakingV1Storage + * @notice This contract holds all the L1-specific storage variables for the L1Staking contract, version 1 + * @dev When adding new versions, make sure to move the gap to the new version and + * reduce the size of the gap accordingly. + */ +abstract contract L1StakingV1Storage { + /// If an indexer has transferred to L2, this mapping will hold the indexer's address in L2 + mapping(address => address) public indexerTransferredToL2; + /// @dev For locked indexers/delegations, this contract holds the mapping of L1 to L2 addresses + IL1GraphTokenLockTransferTool internal l1GraphTokenLockTransferTool; + /// @dev Storage gap to keep storage slots fixed in future versions + uint256[50] private __gap; +} diff --git a/packages/contracts/contracts/staking/Staking.sol b/packages/contracts/contracts/staking/Staking.sol new file mode 100644 index 000000000..c61fe0ded --- /dev/null +++ b/packages/contracts/contracts/staking/Staking.sol @@ -0,0 +1,1043 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.7.6; +pragma abicoder v2; + +import { SafeMath } from "@openzeppelin/contracts/math/SafeMath.sol"; +import { ECDSA } from "@openzeppelin/contracts/cryptography/ECDSA.sol"; + +import { Multicall } from "../base/Multicall.sol"; +import { GraphUpgradeable } from "../upgrades/GraphUpgradeable.sol"; +import { TokenUtils } from "../utils/TokenUtils.sol"; +import { IGraphToken } from "../token/IGraphToken.sol"; +import { IStakingBase } from "./IStakingBase.sol"; +import { StakingV4Storage } from "./StakingStorage.sol"; +import { MathUtils } from "./libs/MathUtils.sol"; +import { Stakes } from "./libs/Stakes.sol"; +import { IStakes } from "./libs/IStakes.sol"; +import { Managed } from "../governance/Managed.sol"; +import { ICuration } from "../curation/ICuration.sol"; +import { IRewardsManager } from "../rewards/IRewardsManager.sol"; +import { StakingExtension } from "./StakingExtension.sol"; +import { LibExponential } from "./libs/Exponential.sol"; + +/** + * @title Base Staking contract + * @dev The Staking contract allows Indexers to Stake on Subgraphs. Indexers Stake by creating + * Allocations on a Subgraph. It also allows Delegators to Delegate towards an Indexer. The + * contract also has the slashing functionality. + * The contract is abstract as the implementation that is deployed depends on each layer: L1Staking on mainnet + * and L2Staking on Arbitrum. + * Note that this contract delegates part of its functionality to a StakingExtension contract. + * This is due to the 24kB contract size limit on Ethereum. + */ +abstract contract Staking is StakingV4Storage, GraphUpgradeable, IStakingBase, Multicall { + using SafeMath for uint256; + using Stakes for IStakes.Indexer; + + /// @dev 100% in parts per million + uint32 internal constant MAX_PPM = 1000000; + + // -- Events are declared in IStakingBase -- // + + /** + * @notice Delegates the current call to the StakingExtension implementation. + * @dev This function does not return to its internal call site, it will return directly to the + * external caller. + */ + // solhint-disable-next-line payable-fallback, no-complex-fallback + fallback() external { + require(_implementation() != address(0), "only through proxy"); + // solhint-disable-next-line no-inline-assembly + assembly { + // (a) get free memory pointer + let ptr := mload(0x40) + + // (b) get address of the implementation + // CAREFUL here: this only works because extensionImpl is the first variable in this slot + // (otherwise we may have to apply an offset) + let impl := and(sload(extensionImpl.slot), 0xffffffffffffffffffffffffffffffffffffffff) + + // (1) copy incoming call data + calldatacopy(ptr, 0, calldatasize()) + + // (2) forward call to logic contract + let result := delegatecall(gas(), impl, ptr, calldatasize(), 0, 0) + let size := returndatasize() + + // (3) retrieve return data + returndatacopy(ptr, 0, size) + + // (4) forward return data back to caller + switch result + case 0 { + revert(ptr, size) + } + default { + return(ptr, size) + } + } + } + + /** + * @notice Initialize this contract. + * @param _controller Address of the controller that manages this contract + * @param _minimumIndexerStake Minimum amount of tokens that an indexer must stake + * @param _thawingPeriod Number of epochs that tokens get locked after unstaking + * @param _protocolPercentage Percentage of query fees that are burned as protocol fee (in PPM) + * @param _curationPercentage Percentage of query fees that are given to curators (in PPM) + * @param _maxAllocationEpochs The maximum number of epochs that an allocation can be active + * @param _delegationUnbondingPeriod The period in epochs that tokens get locked after undelegating + * @param _delegationRatio The ratio between an indexer's own stake and the delegation they can use + * @param _rebatesParameters Alpha and lambda parameters for rebates function + * @param _extensionImpl Address of the StakingExtension implementation + */ + function initialize( + address _controller, + uint256 _minimumIndexerStake, + uint32 _thawingPeriod, + uint32 _protocolPercentage, + uint32 _curationPercentage, + uint32 _maxAllocationEpochs, + uint32 _delegationUnbondingPeriod, + uint32 _delegationRatio, + RebatesParameters calldata _rebatesParameters, + address _extensionImpl + ) external override onlyImpl { + Managed._initialize(_controller); + + // Settings + + _setMinimumIndexerStake(_minimumIndexerStake); + _setThawingPeriod(_thawingPeriod); + + _setProtocolPercentage(_protocolPercentage); + _setCurationPercentage(_curationPercentage); + + _setMaxAllocationEpochs(_maxAllocationEpochs); + + _setRebateParameters( + _rebatesParameters.alphaNumerator, + _rebatesParameters.alphaDenominator, + _rebatesParameters.lambdaNumerator, + _rebatesParameters.lambdaDenominator + ); + + extensionImpl = _extensionImpl; + + // solhint-disable-next-line avoid-low-level-calls + (bool success, ) = extensionImpl.delegatecall( + abi.encodeWithSelector( + StakingExtension.initialize.selector, + _delegationUnbondingPeriod, + 0, + _delegationRatio, + 0 + ) + ); + require(success, "Extension init failed"); + emit ExtensionImplementationSet(_extensionImpl); + } + + /** + * @notice Set the address of the StakingExtension implementation. + * @dev This function can only be called by the governor. + * @param _extensionImpl Address of the StakingExtension implementation + */ + function setExtensionImpl(address _extensionImpl) external override onlyGovernor { + extensionImpl = _extensionImpl; + emit ExtensionImplementationSet(_extensionImpl); + } + + /** + * @notice Set the address of the counterpart (L1 or L2) staking contract. + * @dev This function can only be called by the governor. + * @param _counterpart Address of the counterpart staking contract in the other chain, without any aliasing. + */ + function setCounterpartStakingAddress(address _counterpart) external override onlyGovernor { + counterpartStakingAddress = _counterpart; + emit ParameterUpdated("counterpartStakingAddress"); + } + + /** + * @notice Set the minimum stake required to be an indexer. + * @param _minimumIndexerStake Minimum indexer stake + */ + function setMinimumIndexerStake(uint256 _minimumIndexerStake) external override onlyGovernor { + _setMinimumIndexerStake(_minimumIndexerStake); + } + + /** + * @notice Set the thawing period for unstaking. + * @param _thawingPeriod Period in blocks to wait for token withdrawals after unstaking + */ + function setThawingPeriod(uint32 _thawingPeriod) external override onlyGovernor { + _setThawingPeriod(_thawingPeriod); + } + + /** + * @notice Set the curation percentage of query fees sent to curators. + * @param _percentage Percentage of query fees sent to curators + */ + function setCurationPercentage(uint32 _percentage) external override onlyGovernor { + _setCurationPercentage(_percentage); + } + + /** + * @notice Set a protocol percentage to burn when collecting query fees. + * @param _percentage Percentage of query fees to burn as protocol fee + */ + function setProtocolPercentage(uint32 _percentage) external override onlyGovernor { + _setProtocolPercentage(_percentage); + } + + /** + * @notice Set the max time allowed for indexers to allocate on a subgraph + * before others are allowed to close the allocation. + * @param _maxAllocationEpochs Allocation duration limit in epochs + */ + function setMaxAllocationEpochs(uint32 _maxAllocationEpochs) external override onlyGovernor { + _setMaxAllocationEpochs(_maxAllocationEpochs); + } + + /** + * @dev Set the rebate parameters. + * @param _alphaNumerator Numerator of `alpha` in the rebates function + * @param _alphaDenominator Denominator of `alpha` in the rebates function + * @param _lambdaNumerator Numerator of `lambda` in the rebates function + * @param _lambdaDenominator Denominator of `lambda` in the rebates function + */ + function setRebateParameters( + uint32 _alphaNumerator, + uint32 _alphaDenominator, + uint32 _lambdaNumerator, + uint32 _lambdaDenominator + ) external override onlyGovernor { + _setRebateParameters(_alphaNumerator, _alphaDenominator, _lambdaNumerator, _lambdaDenominator); + } + + /** + * @notice Authorize or unauthorize an address to be an operator for the caller. + * @param _operator Address to authorize or unauthorize + * @param _allowed Whether the operator is authorized or not + */ + function setOperator(address _operator, bool _allowed) external override { + require(_operator != msg.sender, "operator == sender"); + __operatorAuth[msg.sender][_operator] = _allowed; + emit SetOperator(msg.sender, _operator, _allowed); + } + + /** + * @notice Deposit tokens on the indexer's stake. + * The amount staked must be over the minimumIndexerStake. + * @param _tokens Amount of tokens to stake + */ + function stake(uint256 _tokens) external override { + stakeTo(msg.sender, _tokens); + } + + /** + * @notice Unstake tokens from the indexer stake, lock them until the thawing period expires. + * @dev NOTE: The function accepts an amount greater than the currently staked tokens. + * If that happens, it will try to unstake the max amount of tokens it can. + * The reason for this behaviour is to avoid time conditions while the transaction + * is in flight. + * @param _tokens Amount of tokens to unstake + */ + function unstake(uint256 _tokens) external override notPartialPaused { + address indexer = msg.sender; + IStakes.Indexer storage indexerStake = __stakes[indexer]; + + require(indexerStake.tokensStaked > 0, "!stake"); + + // Tokens to lock is capped to the available tokens + uint256 tokensToLock = MathUtils.min(indexerStake.tokensAvailable(), _tokens); + require(tokensToLock > 0, "!stake-avail"); + + // Ensure minimum stake + uint256 newStake = indexerStake.tokensSecureStake().sub(tokensToLock); + require(newStake == 0 || newStake >= __minimumIndexerStake, "!minimumIndexerStake"); + + // Before locking more tokens, withdraw any unlocked ones if possible + uint256 tokensToWithdraw = indexerStake.tokensWithdrawable(); + if (tokensToWithdraw > 0) { + _withdraw(indexer); + } + + // Update the indexer stake locking tokens + indexerStake.lockTokens(tokensToLock, __thawingPeriod); + + emit StakeLocked(indexer, indexerStake.tokensLocked, indexerStake.tokensLockedUntil); + } + + /** + * @notice Withdraw indexer tokens once the thawing period has passed. + */ + function withdraw() external override notPaused { + _withdraw(msg.sender); + } + + /** + * @notice Set the destination where to send rewards for an indexer. + * @param _destination Rewards destination address. If set to zero, rewards will be restaked + */ + function setRewardsDestination(address _destination) external override { + __rewardsDestination[msg.sender] = _destination; + emit SetRewardsDestination(msg.sender, _destination); + } + + /** + * @notice Allocate available tokens to a subgraph deployment. + * @param _subgraphDeploymentID ID of the SubgraphDeployment where tokens will be allocated + * @param _tokens Amount of tokens to allocate + * @param _allocationID The allocation identifier + * @param _metadata IPFS hash for additional information about the allocation + * @param _proof A 65-bytes Ethereum signed message of `keccak256(indexerAddress,allocationID)` + */ + function allocate( + bytes32 _subgraphDeploymentID, + uint256 _tokens, + address _allocationID, + bytes32 _metadata, + bytes calldata _proof + ) external override notPaused { + _allocate(msg.sender, _subgraphDeploymentID, _tokens, _allocationID, _metadata, _proof); + } + + /** + * @notice Allocate available tokens to a subgraph deployment from and indexer's stake. + * The caller must be the indexer or the indexer's operator. + * @param _indexer Indexer address to allocate funds from. + * @param _subgraphDeploymentID ID of the SubgraphDeployment where tokens will be allocated + * @param _tokens Amount of tokens to allocate + * @param _allocationID The allocation identifier + * @param _metadata IPFS hash for additional information about the allocation + * @param _proof A 65-bytes Ethereum signed message of `keccak256(indexerAddress,allocationID)` + */ + function allocateFrom( + address _indexer, + bytes32 _subgraphDeploymentID, + uint256 _tokens, + address _allocationID, + bytes32 _metadata, + bytes calldata _proof + ) external override notPaused { + _allocate(_indexer, _subgraphDeploymentID, _tokens, _allocationID, _metadata, _proof); + } + + /** + * @notice Close an allocation and free the staked tokens. + * To be eligible for rewards a proof of indexing must be presented. + * Presenting a bad proof is subject to slashable condition. + * To opt out of rewards set _poi to 0x0 + * @param _allocationID The allocation identifier + * @param _poi Proof of indexing submitted for the allocated period + */ + function closeAllocation(address _allocationID, bytes32 _poi) external override notPaused { + _closeAllocation(_allocationID, _poi); + } + + /** + * @dev Collect and rebate query fees from state channels to the indexer + * To avoid reverting on the withdrawal from channel flow this function will accept calls with zero tokens. + * We use an exponential rebate formula to calculate the amount of tokens to rebate to the indexer. + * This implementation allows collecting multiple times on the same allocation, keeping track of the + * total amount rebated, the total amount collected and compensating the indexer for the difference. + * @param _tokens Amount of tokens to collect + * @param _allocationID Allocation where the tokens will be assigned + */ + function collect(uint256 _tokens, address _allocationID) external override { + // Allocation identifier validation + require(_allocationID != address(0), "!alloc"); + + // Allocation must exist + AllocationState allocState = _getAllocationState(_allocationID); + require(allocState != AllocationState.Null, "!collect"); + + // If the query fees are zero, we don't want to revert + // but we also don't need to do anything, so just return + if (_tokens == 0) { + return; + } + + Allocation storage alloc = __allocations[_allocationID]; + bytes32 subgraphDeploymentID = alloc.subgraphDeploymentID; + + uint256 queryFees = _tokens; // Tokens collected from the channel + uint256 protocolTax = 0; // Tokens burnt as protocol tax + uint256 curationFees = 0; // Tokens distributed to curators as curation fees + uint256 queryRebates = 0; // Tokens to distribute to indexer + uint256 delegationRewards = 0; // Tokens to distribute to delegators + + { + // -- Pull tokens from the sender -- + IGraphToken graphToken = graphToken(); + TokenUtils.pullTokens(graphToken, msg.sender, queryFees); + + // -- Collect protocol tax -- + protocolTax = _collectTax(graphToken, queryFees, __protocolPercentage); + queryFees = queryFees.sub(protocolTax); + + // -- Collect curation fees -- + // Only if the subgraph deployment is curated + curationFees = _collectCurationFees(graphToken, subgraphDeploymentID, queryFees, __curationPercentage); + queryFees = queryFees.sub(curationFees); + + // -- Process rebate reward -- + // Using accumulated fees and subtracting previously distributed rebates + // allows for multiple vouchers to be collected while following the rebate formula + alloc.collectedFees = alloc.collectedFees.add(queryFees); + + // No rebates if indexer has no stake or if lambda is zero + uint256 newRebates = (alloc.tokens == 0 || __lambdaNumerator == 0) + ? 0 + : LibExponential.exponentialRebates( + alloc.collectedFees, + alloc.tokens, + __alphaNumerator, + __alphaDenominator, + __lambdaNumerator, + __lambdaDenominator + ); + + // -- Ensure rebates to distribute are within bounds -- + // Indexers can become under or over rebated if rebate parameters (alpha, lambda) + // change between successive collect calls for the same allocation + + // Ensure rebates to distribute are not negative (indexer is over-rebated) + queryRebates = MathUtils.diffOrZero(newRebates, alloc.distributedRebates); + + // Ensure rebates to distribute are not greater than available (indexer is under-rebated) + queryRebates = MathUtils.min(queryRebates, queryFees); + + // -- Burn rebates remanent -- + TokenUtils.burnTokens(graphToken, queryFees.sub(queryRebates)); + + // -- Distribute rebates -- + if (queryRebates > 0) { + alloc.distributedRebates = alloc.distributedRebates.add(queryRebates); + + // -- Collect delegation rewards into the delegation pool -- + delegationRewards = _collectDelegationQueryRewards(alloc.indexer, queryRebates); + queryRebates = queryRebates.sub(delegationRewards); + + // -- Transfer or restake rebates -- + _sendRewards( + graphToken, + queryRebates, + alloc.indexer, + __rewardsDestination[alloc.indexer] == address(0) + ); + } + } + + emit RebateCollected( + msg.sender, + alloc.indexer, + subgraphDeploymentID, + _allocationID, + epochManager().currentEpoch(), + _tokens, + protocolTax, + curationFees, + queryFees, + queryRebates, + delegationRewards + ); + } + + /** + * @notice Return if allocationID is used. + * @param _allocationID Address used as signer by the indexer for an allocation + * @return True if allocationID already used + */ + function isAllocation(address _allocationID) external view override returns (bool) { + return _getAllocationState(_allocationID) != AllocationState.Null; + } + + /** + * @notice Getter that returns if an indexer has any stake. + * @param _indexer Address of the indexer + * @return True if indexer has staked tokens + */ + function hasStake(address _indexer) external view override returns (bool) { + return __stakes[_indexer].tokensStaked > 0; + } + + /** + * @notice Return the allocation by ID. + * @param _allocationID Address used as allocation identifier + * @return Allocation data + */ + function getAllocation(address _allocationID) external view override returns (Allocation memory) { + return __allocations[_allocationID]; + } + + /** + * @dev New function to get the allocation data for the rewards manager + * @dev Note that this is only to make tests pass, as the staking contract with + * this changes will never get deployed. HorizonStaking is taking it's place. + */ + function getAllocationData( + address _allocationID + ) external view override returns (bool, address, bytes32, uint256, uint256, uint256) { + Allocation memory alloc = __allocations[_allocationID]; + bool isActive = _getAllocationState(_allocationID) == AllocationState.Active; + + return ( + isActive, + alloc.indexer, + alloc.subgraphDeploymentID, + alloc.tokens, + alloc.accRewardsPerAllocatedToken, + 0 + ); + } + + /** + * @dev New function to get the allocation active status for the rewards manager + * @dev Note that this is only to make tests pass, as the staking contract with + * this changes will never get deployed. HorizonStaking is taking it's place. + */ + function isActiveAllocation(address _allocationID) external view override returns (bool) { + return _getAllocationState(_allocationID) == AllocationState.Active; + } + + /** + * @notice Return the current state of an allocation + * @param _allocationID Allocation identifier + * @return AllocationState enum with the state of the allocation + */ + function getAllocationState(address _allocationID) external view override returns (AllocationState) { + return _getAllocationState(_allocationID); + } + + /** + * @notice Return the total amount of tokens allocated to subgraph. + * @param _subgraphDeploymentID Deployment ID for the subgraph + * @return Total tokens allocated to subgraph + */ + function getSubgraphAllocatedTokens(bytes32 _subgraphDeploymentID) external view override returns (uint256) { + return __subgraphAllocations[_subgraphDeploymentID]; + } + + /** + * @notice Get the total amount of tokens staked by the indexer. + * @param _indexer Address of the indexer + * @return Amount of tokens staked by the indexer + */ + function getIndexerStakedTokens(address _indexer) external view override returns (uint256) { + return __stakes[_indexer].tokensStaked; + } + + /** + * @notice Deposit tokens on the Indexer stake, on behalf of the Indexer. + * The amount staked must be over the minimumIndexerStake. + * @param _indexer Address of the indexer + * @param _tokens Amount of tokens to stake + */ + function stakeTo(address _indexer, uint256 _tokens) public override notPartialPaused { + require(_tokens > 0, "!tokens"); + + // Transfer tokens to stake from caller to this contract + TokenUtils.pullTokens(graphToken(), msg.sender, _tokens); + + // Stake the transferred tokens + _stake(_indexer, _tokens); + } + + /** + * @notice Set the delegation parameters for the caller. + * @param _indexingRewardCut Percentage of indexing rewards left for the indexer + * @param _queryFeeCut Percentage of query fees left for the indexer + */ + function setDelegationParameters( + uint32 _indexingRewardCut, + uint32 _queryFeeCut, + uint32 // _cooldownBlocks, deprecated + ) public override { + _setDelegationParameters(msg.sender, _indexingRewardCut, _queryFeeCut); + } + + /** + * @notice Get the total amount of tokens available to use in allocations. + * This considers the indexer stake and delegated tokens according to delegation ratio + * @param _indexer Address of the indexer + * @return Amount of tokens available to allocate including delegation + */ + function getIndexerCapacity(address _indexer) public view override returns (uint256) { + IStakes.Indexer memory indexerStake = __stakes[_indexer]; + uint256 tokensDelegated = __delegationPools[_indexer].tokens; + + uint256 tokensDelegatedCap = indexerStake.tokensSecureStake().mul(uint256(__delegationRatio)); + uint256 tokensDelegatedCapacity = MathUtils.min(tokensDelegated, tokensDelegatedCap); + + return indexerStake.tokensAvailableWithDelegation(tokensDelegatedCapacity); + } + + /** + * @notice Return true if operator is allowed for indexer. + * @param _operator Address of the operator + * @param _indexer Address of the indexer + * @return True if operator is allowed for indexer, false otherwise + */ + function isOperator(address _operator, address _indexer) public view override returns (bool) { + return __operatorAuth[_indexer][_operator]; + } + + /** + * @dev Internal: Set the minimum indexer stake required. + * @param _minimumIndexerStake Minimum indexer stake + */ + function _setMinimumIndexerStake(uint256 _minimumIndexerStake) private { + require(_minimumIndexerStake > 0, "!minimumIndexerStake"); + __minimumIndexerStake = _minimumIndexerStake; + emit ParameterUpdated("minimumIndexerStake"); + } + + /** + * @dev Internal: Set the thawing period for unstaking. + * @param _thawingPeriod Period in blocks to wait for token withdrawals after unstaking + */ + function _setThawingPeriod(uint32 _thawingPeriod) private { + require(_thawingPeriod > 0, "!thawingPeriod"); + __thawingPeriod = _thawingPeriod; + emit ParameterUpdated("thawingPeriod"); + } + + /** + * @dev Internal: Set the curation percentage of query fees sent to curators. + * @param _percentage Percentage of query fees sent to curators + */ + function _setCurationPercentage(uint32 _percentage) private { + // Must be within 0% to 100% (inclusive) + require(_percentage <= MAX_PPM, ">percentage"); + __curationPercentage = _percentage; + emit ParameterUpdated("curationPercentage"); + } + + /** + * @dev Internal: Set a protocol percentage to burn when collecting query fees. + * @param _percentage Percentage of query fees to burn as protocol fee + */ + function _setProtocolPercentage(uint32 _percentage) private { + // Must be within 0% to 100% (inclusive) + require(_percentage <= MAX_PPM, ">percentage"); + __protocolPercentage = _percentage; + emit ParameterUpdated("protocolPercentage"); + } + + /** + * @dev Internal: Set the max time allowed for indexers stake on allocations. + * @param _maxAllocationEpochs Allocation duration limit in epochs + */ + function _setMaxAllocationEpochs(uint32 _maxAllocationEpochs) private { + __maxAllocationEpochs = _maxAllocationEpochs; + emit ParameterUpdated("maxAllocationEpochs"); + } + + /** + * @dev Set the rebate parameters. + * @param _alphaNumerator Numerator of `alpha` in the rebates function + * @param _alphaDenominator Denominator of `alpha` in the rebates function + * @param _lambdaNumerator Numerator of `lambda` in the rebates function + * @param _lambdaDenominator Denominator of `lambda` in the rebates function + */ + function _setRebateParameters( + uint32 _alphaNumerator, + uint32 _alphaDenominator, + uint32 _lambdaNumerator, + uint32 _lambdaDenominator + ) private { + require(_alphaDenominator > 0, "!alphaDenominator"); + require(_lambdaNumerator > 0, "!lambdaNumerator"); + require(_lambdaDenominator > 0, "!lambdaDenominator"); + __alphaNumerator = _alphaNumerator; + __alphaDenominator = _alphaDenominator; + __lambdaNumerator = _lambdaNumerator; + __lambdaDenominator = _lambdaDenominator; + emit ParameterUpdated("rebateParameters"); + } + + /** + * @dev Set the delegation parameters for a particular indexer. + * @param _indexer Indexer to set delegation parameters + * @param _indexingRewardCut Percentage of indexing rewards left for delegators + * @param _queryFeeCut Percentage of query fees left for delegators + */ + function _setDelegationParameters(address _indexer, uint32 _indexingRewardCut, uint32 _queryFeeCut) internal { + // Incentives must be within bounds + require(_queryFeeCut <= MAX_PPM, ">queryFeeCut"); + require(_indexingRewardCut <= MAX_PPM, ">indexingRewardCut"); + + DelegationPool storage pool = __delegationPools[_indexer]; + + // Update delegation params + pool.indexingRewardCut = _indexingRewardCut; + pool.queryFeeCut = _queryFeeCut; + pool.updatedAtBlock = block.number; + + emit DelegationParametersUpdated(_indexer, _indexingRewardCut, _queryFeeCut, 0); + } + + /** + * @dev Stake tokens on the indexer. + * This function does not check minimum indexer stake requirement to allow + * to be called by functions that increase the stake when collecting rewards + * without reverting + * @param _indexer Address of staking party + * @param _tokens Amount of tokens to stake + */ + function _stake(address _indexer, uint256 _tokens) internal { + // Ensure minimum stake + require(__stakes[_indexer].tokensSecureStake().add(_tokens) >= __minimumIndexerStake, "!minimumIndexerStake"); + + // Deposit tokens into the indexer stake + __stakes[_indexer].deposit(_tokens); + + // Initialize the delegation pool the first time + if (__delegationPools[_indexer].updatedAtBlock == 0) { + _setDelegationParameters(_indexer, MAX_PPM, MAX_PPM); + } + + emit StakeDeposited(_indexer, _tokens); + } + + /** + * @dev Withdraw indexer tokens once the thawing period has passed. + * @param _indexer Address of indexer to withdraw funds from + */ + function _withdraw(address _indexer) private { + // Get tokens available for withdraw and update balance + uint256 tokensToWithdraw = __stakes[_indexer].withdrawTokens(); + require(tokensToWithdraw > 0, "!tokens"); + + // Return tokens to the indexer + TokenUtils.pushTokens(graphToken(), _indexer, tokensToWithdraw); + + emit StakeWithdrawn(_indexer, tokensToWithdraw); + } + + /** + * @dev Allocate available tokens to a subgraph deployment. + * @param _indexer Indexer address to allocate funds from. + * @param _subgraphDeploymentID ID of the SubgraphDeployment where tokens will be allocated + * @param _tokens Amount of tokens to allocate + * @param _allocationID The allocationID will work to identify collected funds related to this allocation + * @param _metadata Metadata related to the allocation + * @param _proof A 65-bytes Ethereum signed message of `keccak256(indexerAddress,allocationID)` + */ + function _allocate( + address _indexer, + bytes32 _subgraphDeploymentID, + uint256 _tokens, + address _allocationID, + bytes32 _metadata, + bytes calldata _proof + ) private { + require(_isAuth(_indexer), "!auth"); + + // Check allocation + require(_allocationID != address(0), "!alloc"); + require(_getAllocationState(_allocationID) == AllocationState.Null, "!null"); + + // Caller must prove that they own the private key for the allocationID address + // The proof is an Ethereum signed message of KECCAK256(indexerAddress,allocationID) + bytes32 messageHash = keccak256(abi.encodePacked(_indexer, _allocationID)); + bytes32 digest = ECDSA.toEthSignedMessageHash(messageHash); + require(ECDSA.recover(digest, _proof) == _allocationID, "!proof"); + + require(__stakes[_indexer].tokensSecureStake() >= __minimumIndexerStake, "!minimumIndexerStake"); + if (_tokens > 0) { + // Needs to have free capacity not used for other purposes to allocate + require(getIndexerCapacity(_indexer) >= _tokens, "!capacity"); + } + + // Creates an allocation + // Allocation identifiers are not reused + // Anyone can send collected funds to the allocation using collect() + Allocation memory alloc = Allocation( + _indexer, + _subgraphDeploymentID, + _tokens, // Tokens allocated + epochManager().currentEpoch(), // createdAtEpoch + 0, // closedAtEpoch + 0, // Initialize collected fees + 0, // Initialize effective allocation (DEPRECATED) + (_tokens > 0) ? _updateRewards(_subgraphDeploymentID) : 0, // Initialize accumulated rewards per stake allocated + 0 // Initialize distributed rebates + ); + __allocations[_allocationID] = alloc; + + // -- Rewards Distribution -- + + // Process non-zero-allocation rewards tracking + if (_tokens > 0) { + // Mark allocated tokens as used + __stakes[_indexer].allocate(alloc.tokens); + + // Track total allocations per subgraph + // Used for rewards calculations + __subgraphAllocations[alloc.subgraphDeploymentID] = __subgraphAllocations[alloc.subgraphDeploymentID].add( + alloc.tokens + ); + } + + emit AllocationCreated( + _indexer, + _subgraphDeploymentID, + alloc.createdAtEpoch, + alloc.tokens, + _allocationID, + _metadata + ); + } + + /** + * @dev Close an allocation and free the staked tokens. + * @param _allocationID The allocation identifier + * @param _poi Proof of indexing submitted for the allocated period + */ + function _closeAllocation(address _allocationID, bytes32 _poi) private { + // Allocation must exist and be active + AllocationState allocState = _getAllocationState(_allocationID); + require(allocState == AllocationState.Active, "!active"); + + // Get allocation + Allocation memory alloc = __allocations[_allocationID]; + + alloc.closedAtEpoch = epochManager().currentEpoch(); + + // Allocation duration in epochs + uint256 epochs = MathUtils.diffOrZero(alloc.closedAtEpoch, alloc.createdAtEpoch); + + // Indexer or operator can close an allocation + // Anyone is allowed to close ONLY under two concurrent conditions + // - After maxAllocationEpochs passed + // - When the allocation is for non-zero amount of tokens + bool isIndexerOrOperator = _isAuth(alloc.indexer); + if (epochs <= __maxAllocationEpochs || alloc.tokens == 0) { + require(isIndexerOrOperator, "!auth"); + } + + // -- Rewards Distribution -- + + // Process non-zero-allocation rewards tracking + if (alloc.tokens > 0) { + // Distribute rewards if proof of indexing was presented by the indexer or operator + // and the allocation is at least one epoch old (most indexed chains require the EBO + // posting epoch block numbers to produce a valid POI which happens once per epoch) + if (isIndexerOrOperator && _poi != 0 && epochs > 0) { + _distributeRewards(_allocationID, alloc.indexer); + } else { + _updateRewards(alloc.subgraphDeploymentID); + } + + // Free allocated tokens from use + __stakes[alloc.indexer].unallocate(alloc.tokens); + + // Track total allocations per subgraph + // Used for rewards calculations + __subgraphAllocations[alloc.subgraphDeploymentID] = __subgraphAllocations[alloc.subgraphDeploymentID].sub( + alloc.tokens + ); + } + + // Close the allocation + // Note that this breaks CEI pattern. We update after the rewards distribution logic as it expects the allocation + // to still be active. There shouldn't be reentrancy risk here as all internal calls are to trusted contracts. + __allocations[_allocationID].closedAtEpoch = alloc.closedAtEpoch; + + emit AllocationClosed( + alloc.indexer, + alloc.subgraphDeploymentID, + alloc.closedAtEpoch, + alloc.tokens, + _allocationID, + msg.sender, + _poi, + !isIndexerOrOperator + ); + } + + /** + * @dev Collect the delegation rewards for query fees. + * This function will assign the collected fees to the delegation pool. + * @param _indexer Indexer to which the tokens to distribute are related + * @param _tokens Total tokens received used to calculate the amount of fees to collect + * @return Amount of delegation rewards + */ + function _collectDelegationQueryRewards(address _indexer, uint256 _tokens) private returns (uint256) { + uint256 delegationRewards = 0; + DelegationPool storage pool = __delegationPools[_indexer]; + if (pool.tokens > 0 && pool.queryFeeCut < MAX_PPM) { + uint256 indexerCut = uint256(pool.queryFeeCut).mul(_tokens).div(MAX_PPM); + delegationRewards = _tokens.sub(indexerCut); + pool.tokens = pool.tokens.add(delegationRewards); + } + return delegationRewards; + } + + /** + * @dev Collect the delegation rewards for indexing. + * This function will assign the collected fees to the delegation pool. + * @param _indexer Indexer to which the tokens to distribute are related + * @param _tokens Total tokens received used to calculate the amount of fees to collect + * @return Amount of delegation rewards + */ + function _collectDelegationIndexingRewards(address _indexer, uint256 _tokens) private returns (uint256) { + uint256 delegationRewards = 0; + DelegationPool storage pool = __delegationPools[_indexer]; + if (pool.tokens > 0 && pool.indexingRewardCut < MAX_PPM) { + uint256 indexerCut = uint256(pool.indexingRewardCut).mul(_tokens).div(MAX_PPM); + delegationRewards = _tokens.sub(indexerCut); + pool.tokens = pool.tokens.add(delegationRewards); + } + return delegationRewards; + } + + /** + * @dev Collect the curation fees for a subgraph deployment from an amount of tokens. + * This function transfer curation fees to the Curation contract by calling Curation.collect + * @param _graphToken Token to collect + * @param _subgraphDeploymentID Subgraph deployment to which the curation fees are related + * @param _tokens Total tokens received used to calculate the amount of fees to collect + * @param _curationPercentage Percentage of tokens to collect as fees + * @return Amount of curation fees + */ + function _collectCurationFees( + IGraphToken _graphToken, + bytes32 _subgraphDeploymentID, + uint256 _tokens, + uint256 _curationPercentage + ) private returns (uint256) { + if (_tokens == 0) { + return 0; + } + + ICuration curation = curation(); + bool isCurationEnabled = _curationPercentage > 0 && address(curation) != address(0); + + if (isCurationEnabled && curation.isCurated(_subgraphDeploymentID)) { + // Calculate the tokens after curation fees first, and subtact that, + // to prevent curation fees from rounding down to zero + uint256 tokensAfterCurationFees = uint256(MAX_PPM).sub(_curationPercentage).mul(_tokens).div(MAX_PPM); + uint256 curationFees = _tokens.sub(tokensAfterCurationFees); + if (curationFees > 0) { + // Transfer and call collect() + // This function transfer tokens to a trusted protocol contracts + // Then we call collect() to do the transfer Bookkeeping + rewardsManager().onSubgraphSignalUpdate(_subgraphDeploymentID); + TokenUtils.pushTokens(_graphToken, address(curation), curationFees); + curation.collect(_subgraphDeploymentID, curationFees); + } + return curationFees; + } + return 0; + } + + /** + * @dev Collect tax to burn for an amount of tokens. + * @param _graphToken Token to burn + * @param _tokens Total tokens received used to calculate the amount of tax to collect + * @param _percentage Percentage of tokens to burn as tax + * @return Amount of tax charged + */ + function _collectTax(IGraphToken _graphToken, uint256 _tokens, uint256 _percentage) private returns (uint256) { + // Calculate tokens after tax first, and subtract that, + // to prevent the tax from rounding down to zero + uint256 tokensAfterTax = uint256(MAX_PPM).sub(_percentage).mul(_tokens).div(MAX_PPM); + uint256 tax = _tokens.sub(tokensAfterTax); + TokenUtils.burnTokens(_graphToken, tax); // Burn tax if any + return tax; + } + + /** + * @dev Triggers an update of rewards due to a change in allocations. + * @param _subgraphDeploymentID Subgraph deployment updated + * @return Accumulated rewards per allocated token for the subgraph deployment + */ + function _updateRewards(bytes32 _subgraphDeploymentID) private returns (uint256) { + IRewardsManager rewardsManager = rewardsManager(); + if (address(rewardsManager) == address(0)) { + return 0; + } + return rewardsManager.onSubgraphAllocationUpdate(_subgraphDeploymentID); + } + + /** + * @dev Assign rewards for the closed allocation to indexer and delegators. + * @param _allocationID Allocation + * @param _indexer Address of the indexer that did the allocation + */ + function _distributeRewards(address _allocationID, address _indexer) private { + IRewardsManager rewardsManager = rewardsManager(); + if (address(rewardsManager) == address(0)) { + return; + } + + // Automatically triggers update of rewards snapshot as allocation will change + // after this call. Take rewards mint tokens for the Staking contract to distribute + // between indexer and delegators + uint256 totalRewards = rewardsManager.takeRewards(_allocationID); + if (totalRewards == 0) { + return; + } + + // Calculate delegation rewards and add them to the delegation pool + uint256 delegationRewards = _collectDelegationIndexingRewards(_indexer, totalRewards); + uint256 indexerRewards = totalRewards.sub(delegationRewards); + + // Send the indexer rewards + _sendRewards(graphToken(), indexerRewards, _indexer, __rewardsDestination[_indexer] == address(0)); + } + + /** + * @dev Send rewards to the appropriate destination. + * @param _graphToken Graph token + * @param _amount Number of rewards tokens + * @param _beneficiary Address of the beneficiary of rewards + * @param _restake Whether to restake or not + */ + function _sendRewards(IGraphToken _graphToken, uint256 _amount, address _beneficiary, bool _restake) private { + if (_amount == 0) return; + + if (_restake) { + // Restake to place fees into the indexer stake + _stake(_beneficiary, _amount); + } else { + // Transfer funds to the beneficiary's designated rewards destination if set + address destination = __rewardsDestination[_beneficiary]; + TokenUtils.pushTokens(_graphToken, destination == address(0) ? _beneficiary : destination, _amount); + } + } + + /** + * @dev Check if the caller is authorized to operate on behalf of + * an indexer (i.e. the caller is the indexer or an operator) + * @param _indexer Indexer address + * @return True if the caller is authorized to operate on behalf of the indexer + */ + function _isAuth(address _indexer) private view returns (bool) { + return msg.sender == _indexer || isOperator(msg.sender, _indexer) == true; + } + + /** + * @dev Return the current state of an allocation + * @param _allocationID Allocation identifier + * @return AllocationState enum with the state of the allocation + */ + function _getAllocationState(address _allocationID) private view returns (AllocationState) { + Allocation storage alloc = __allocations[_allocationID]; + + if (alloc.indexer == address(0)) { + return AllocationState.Null; + } + + if (alloc.createdAtEpoch != 0 && alloc.closedAtEpoch == 0) { + return AllocationState.Active; + } + + return AllocationState.Closed; + } +} diff --git a/packages/contracts/contracts/staking/StakingExtension.sol b/packages/contracts/contracts/staking/StakingExtension.sol new file mode 100644 index 000000000..b06fbe894 --- /dev/null +++ b/packages/contracts/contracts/staking/StakingExtension.sol @@ -0,0 +1,584 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.7.6; +pragma abicoder v2; + +import { SafeMath } from "@openzeppelin/contracts/math/SafeMath.sol"; +import { StakingV4Storage } from "./StakingStorage.sol"; +import { IStakingExtension } from "./IStakingExtension.sol"; +import { TokenUtils } from "../utils/TokenUtils.sol"; +import { IGraphToken } from "../token/IGraphToken.sol"; +import { GraphUpgradeable } from "../upgrades/GraphUpgradeable.sol"; +import { IStakes } from "./libs/IStakes.sol"; +import { Stakes } from "./libs/Stakes.sol"; +import { IStakingData } from "./IStakingData.sol"; +import { MathUtils } from "./libs/MathUtils.sol"; + +/** + * @title StakingExtension contract + * @dev This contract provides the logic to manage delegations and other Staking + * extension features (e.g. storage getters). It is meant to be called through delegatecall from the + * Staking contract, and is only kept separate to keep the Staking contract size + * within limits. + */ +contract StakingExtension is StakingV4Storage, GraphUpgradeable, IStakingExtension { + using SafeMath for uint256; + using Stakes for IStakes.Indexer; + + /// @dev 100% in parts per million + uint32 private constant MAX_PPM = 1000000; + /// @dev Minimum amount of tokens that can be delegated + uint256 private constant MINIMUM_DELEGATION = 1e18; + + /** + * @dev Check if the caller is the slasher. + */ + modifier onlySlasher() { + require(__slashers[msg.sender] == true, "!slasher"); + _; + } + + /** + * @notice Initialize the StakingExtension contract + * @dev This function is meant to be delegatecalled from the Staking contract's + * initialize() function, so it uses the same access control check to ensure it is + * being called by the Staking implementation as part of the proxy upgrade process. + * @param _delegationUnbondingPeriod Delegation unbonding period in blocks + * @param _delegationRatio Delegation capacity multiplier (e.g. 10 means 10x the indexer stake) + * @param _delegationTaxPercentage Percentage of delegated tokens to burn as delegation tax, expressed in parts per million + */ + function initialize( + uint32 _delegationUnbondingPeriod, + uint32, //_cooldownBlocks, deprecated + uint32 _delegationRatio, + uint32 _delegationTaxPercentage + ) external onlyImpl { + _setDelegationUnbondingPeriod(_delegationUnbondingPeriod); + _setDelegationRatio(_delegationRatio); + _setDelegationTaxPercentage(_delegationTaxPercentage); + } + + /** + * @notice Set a delegation tax percentage to burn when delegated funds are deposited. + * @dev This function is only callable by the governor + * @param _percentage Percentage of delegated tokens to burn as delegation tax, expressed in parts per million + */ + function setDelegationTaxPercentage(uint32 _percentage) external override onlyGovernor { + _setDelegationTaxPercentage(_percentage); + } + + /** + * @notice Set the delegation ratio. + * If set to 10 it means the indexer can use up to 10x the indexer staked amount + * from their delegated tokens + * @dev This function is only callable by the governor + * @param _delegationRatio Delegation capacity multiplier + */ + function setDelegationRatio(uint32 _delegationRatio) external override onlyGovernor { + _setDelegationRatio(_delegationRatio); + } + + /** + * @notice Set the time, in epochs, a Delegator needs to wait to withdraw tokens after undelegating. + * @dev This function is only callable by the governor + * @param _delegationUnbondingPeriod Period in epochs to wait for token withdrawals after undelegating + */ + function setDelegationUnbondingPeriod(uint32 _delegationUnbondingPeriod) external override onlyGovernor { + _setDelegationUnbondingPeriod(_delegationUnbondingPeriod); + } + + /** + * @notice Set or unset an address as allowed slasher. + * @param _slasher Address of the party allowed to slash indexers + * @param _allowed True if slasher is allowed + */ + function setSlasher(address _slasher, bool _allowed) external override onlyGovernor { + require(_slasher != address(0), "!slasher"); + __slashers[_slasher] = _allowed; + emit SlasherUpdate(msg.sender, _slasher, _allowed); + } + + /** + * @notice Delegate tokens to an indexer. + * @param _indexer Address of the indexer to which tokens are delegated + * @param _tokens Amount of tokens to delegate + * @return Amount of shares issued from the delegation pool + */ + function delegate(address _indexer, uint256 _tokens) external override notPartialPaused returns (uint256) { + address delegator = msg.sender; + + // Transfer tokens to delegate to this contract + TokenUtils.pullTokens(graphToken(), delegator, _tokens); + + // Update state + return _delegate(delegator, _indexer, _tokens); + } + + /** + * @notice Undelegate tokens from an indexer. Tokens will be locked for the unbonding period. + * @param _indexer Address of the indexer to which tokens had been delegated + * @param _shares Amount of shares to return and undelegate tokens + * @return Amount of tokens returned for the shares of the delegation pool + */ + function undelegate(address _indexer, uint256 _shares) external override notPartialPaused returns (uint256) { + return _undelegate(msg.sender, _indexer, _shares); + } + + /** + * @notice Withdraw undelegated tokens once the unbonding period has passed, and optionally + * re-delegate to a new indexer. + * @param _indexer Withdraw available tokens delegated to indexer + * @param _newIndexer Re-delegate to indexer address if non-zero, withdraw if zero address + */ + function withdrawDelegated(address _indexer, address _newIndexer) external override notPaused returns (uint256) { + return _withdrawDelegated(msg.sender, _indexer, _newIndexer); + } + + /** + * @notice Slash the indexer stake. Delegated tokens are not subject to slashing. + * @dev Can only be called by the slasher role. + * @param _indexer Address of indexer to slash + * @param _tokens Amount of tokens to slash from the indexer stake + * @param _reward Amount of reward tokens to send to a beneficiary + * @param _beneficiary Address of a beneficiary to receive a reward for the slashing + */ + function slash( + address _indexer, + uint256 _tokens, + uint256 _reward, + address _beneficiary + ) external override onlySlasher notPartialPaused { + IStakes.Indexer storage indexerStake = __stakes[_indexer]; + + // Only able to slash a non-zero number of tokens + require(_tokens > 0, "!tokens"); + + // Rewards comes from tokens slashed balance + require(_tokens >= _reward, "rewards>slash"); + + // Cannot slash stake of an indexer without any or enough stake + require(indexerStake.tokensStaked > 0, "!stake"); + require(_tokens <= indexerStake.tokensStaked, "slash>stake"); + + // Validate beneficiary of slashed tokens + require(_beneficiary != address(0), "!beneficiary"); + + // Slashing more tokens than freely available (over allocation condition) + // Unlock locked tokens to avoid the indexer to withdraw them + if (_tokens > indexerStake.tokensAvailable() && indexerStake.tokensLocked > 0) { + uint256 tokensOverAllocated = _tokens.sub(indexerStake.tokensAvailable()); + uint256 tokensToUnlock = MathUtils.min(tokensOverAllocated, indexerStake.tokensLocked); + indexerStake.unlockTokens(tokensToUnlock); + } + + // Remove tokens to slash from the stake + indexerStake.release(_tokens); + + // -- Interactions -- + + IGraphToken graphToken = graphToken(); + + // Set apart the reward for the beneficiary and burn remaining slashed stake + TokenUtils.burnTokens(graphToken, _tokens.sub(_reward)); + + // Give the beneficiary a reward for slashing + TokenUtils.pushTokens(graphToken, _beneficiary, _reward); + + emit StakeSlashed(_indexer, _tokens, _reward, _beneficiary); + } + + /** + * @notice Return the delegation from a delegator to an indexer. + * @param _indexer Address of the indexer where funds have been delegated + * @param _delegator Address of the delegator + * @return Delegation data + */ + function getDelegation(address _indexer, address _delegator) external view override returns (Delegation memory) { + return __delegationPools[_indexer].delegators[_delegator]; + } + + /** + * @notice Getter for the delegationRatio, i.e. the delegation capacity multiplier: + * If delegation ratio is 100, and an Indexer has staked 5 GRT, + * then they can use up to 500 GRT from the delegated stake + * @return Delegation ratio + */ + function delegationRatio() external view override returns (uint32) { + return __delegationRatio; + } + + /** + * @notice Getter for delegationUnbondingPeriod: + * Time in epochs a delegator needs to wait to withdraw delegated stake + * @return Delegation unbonding period in epochs + */ + function delegationUnbondingPeriod() external view override returns (uint32) { + return __delegationUnbondingPeriod; + } + + /** + * @notice Getter for delegationTaxPercentage: + * Percentage of tokens to tax a delegation deposit, expressed in parts per million + * @return Delegation tax percentage in parts per million + */ + function delegationTaxPercentage() external view override returns (uint32) { + return __delegationTaxPercentage; + } + + /** + * @notice Getter for delegationPools[_indexer]: + * gets the delegation pool structure for a particular indexer. + * @param _indexer Address of the indexer for which to query the delegation pool + * @return Delegation pool as a DelegationPoolReturn struct + */ + function delegationPools(address _indexer) external view override returns (DelegationPoolReturn memory) { + DelegationPool storage pool = __delegationPools[_indexer]; + return + DelegationPoolReturn( + 0, // Blocks to wait before updating parameters (deprecated) + pool.indexingRewardCut, // in PPM + pool.queryFeeCut, // in PPM + pool.updatedAtBlock, // Block when the pool was last updated + pool.tokens, // Total tokens as pool reserves + pool.shares // Total shares minted in the pool + ); + } + + /** + * @notice Getter for rewardsDestination[_indexer]: + * returns the address where the indexer's rewards are sent. + * @param _indexer The indexer address for which to query the rewards destination + * @return The address where the indexer's rewards are sent, zero if none is set in which case rewards are re-staked + */ + function rewardsDestination(address _indexer) external view override returns (address) { + return __rewardsDestination[_indexer]; + } + + /** + * @notice Getter for operatorAuth[_indexer][_maybeOperator]: + * returns true if the operator is authorized to operate on behalf of the indexer. + * @param _indexer The indexer address for which to query authorization + * @param _maybeOperator The address that may or may not be an operator + * @return True if the operator is authorized to operate on behalf of the indexer + */ + function operatorAuth(address _indexer, address _maybeOperator) external view override returns (bool) { + return __operatorAuth[_indexer][_maybeOperator]; + } + + /** + * @notice Getter for subgraphAllocations[_subgraphDeploymentId]: + * returns the amount of tokens allocated to a subgraph deployment. + * @param _subgraphDeploymentId The subgraph deployment for which to query the allocations + * @return The amount of tokens allocated to the subgraph deployment + */ + function subgraphAllocations(bytes32 _subgraphDeploymentId) external view override returns (uint256) { + return __subgraphAllocations[_subgraphDeploymentId]; + } + + /** + * @notice Getter for slashers[_maybeSlasher]: + * returns true if the address is a slasher, i.e. an entity that can slash indexers + * @param _maybeSlasher Address for which to check the slasher role + * @return True if the address is a slasher + */ + function slashers(address _maybeSlasher) external view override returns (bool) { + return __slashers[_maybeSlasher]; + } + + /** + * @notice Getter for minimumIndexerStake: the minimum + * amount of GRT that an indexer needs to stake. + * @return Minimum indexer stake in GRT + */ + function minimumIndexerStake() external view override returns (uint256) { + return __minimumIndexerStake; + } + + /** + * @notice Getter for thawingPeriod: the time in blocks an + * indexer needs to wait to unstake tokens. + * @return Thawing period in blocks + */ + function thawingPeriod() external view override returns (uint32) { + return __thawingPeriod; + } + + /** + * @notice Getter for curationPercentage: the percentage of + * query fees that are distributed to curators. + * @return Curation percentage in parts per million + */ + function curationPercentage() external view override returns (uint32) { + return __curationPercentage; + } + + /** + * @notice Getter for protocolPercentage: the percentage of + * query fees that are burned as protocol fees. + * @return Protocol percentage in parts per million + */ + function protocolPercentage() external view override returns (uint32) { + return __protocolPercentage; + } + + /** + * @notice Getter for maxAllocationEpochs: the maximum time in epochs + * that an allocation can be open before anyone is allowed to close it. This + * also caps the effective allocation when sending the allocation's query fees + * to the rebate pool. + * @return Maximum allocation period in epochs + */ + function maxAllocationEpochs() external view override returns (uint32) { + return __maxAllocationEpochs; + } + + /** + * @notice Getter for the numerator of the rebates alpha parameter + * @return Alpha numerator + */ + function alphaNumerator() external view override returns (uint32) { + return __alphaNumerator; + } + + /** + * @notice Getter for the denominator of the rebates alpha parameter + * @return Alpha denominator + */ + function alphaDenominator() external view override returns (uint32) { + return __alphaDenominator; + } + + /** + * @notice Getter for the numerator of the rebates lambda parameter + * @return Lambda numerator + */ + function lambdaNumerator() external view override returns (uint32) { + return __lambdaNumerator; + } + + /** + * @notice Getter for the denominator of the rebates lambda parameter + * @return Lambda denominator + */ + function lambdaDenominator() external view override returns (uint32) { + return __lambdaDenominator; + } + + /** + * @notice Getter for stakes[_indexer]: + * gets the stake information for an indexer as an IStakes.Indexer struct. + * @param _indexer Indexer address for which to query the stake information + * @return Stake information for the specified indexer, as an IStakes.Indexer struct + */ + function stakes(address _indexer) external view override returns (IStakes.Indexer memory) { + return __stakes[_indexer]; + } + + /** + * @notice Getter for allocations[_allocationID]: + * gets an allocation's information as an IStakingData.Allocation struct. + * @param _allocationID Allocation ID for which to query the allocation information + * @return The specified allocation, as an IStakingData.Allocation struct + */ + function allocations(address _allocationID) external view override returns (IStakingData.Allocation memory) { + return __allocations[_allocationID]; + } + + /** + * @notice Return whether the delegator has delegated to the indexer. + * @param _indexer Address of the indexer where funds have been delegated + * @param _delegator Address of the delegator + * @return True if delegator has tokens delegated to the indexer + */ + function isDelegator(address _indexer, address _delegator) public view override returns (bool) { + return __delegationPools[_indexer].delegators[_delegator].shares > 0; + } + + /** + * @notice Returns amount of delegated tokens ready to be withdrawn after unbonding period. + * @param _delegation Delegation of tokens from delegator to indexer + * @return Amount of tokens to withdraw + */ + function getWithdraweableDelegatedTokens(Delegation memory _delegation) public view override returns (uint256) { + // There must be locked tokens and period passed + uint256 currentEpoch = epochManager().currentEpoch(); + if (_delegation.tokensLockedUntil > 0 && currentEpoch >= _delegation.tokensLockedUntil) { + return _delegation.tokensLocked; + } + return 0; + } + + /** + * @dev Internal: Set a delegation tax percentage to burn when delegated funds are deposited. + * @param _percentage Percentage of delegated tokens to burn as delegation tax + */ + function _setDelegationTaxPercentage(uint32 _percentage) private { + // Must be within 0% to 100% (inclusive) + require(_percentage <= MAX_PPM, ">percentage"); + __delegationTaxPercentage = _percentage; + emit ParameterUpdated("delegationTaxPercentage"); + } + + /** + * @dev Internal: Set the delegation ratio. + * If set to 10 it means the indexer can use up to 10x the indexer staked amount + * from their delegated tokens + * @param _delegationRatio Delegation capacity multiplier + */ + function _setDelegationRatio(uint32 _delegationRatio) private { + __delegationRatio = _delegationRatio; + emit ParameterUpdated("delegationRatio"); + } + + /** + * @dev Internal: Set the period for undelegation of stake from indexer. + * @param _delegationUnbondingPeriod Period in epochs to wait for token withdrawals after undelegating + */ + function _setDelegationUnbondingPeriod(uint32 _delegationUnbondingPeriod) private { + require(_delegationUnbondingPeriod > 0, "!delegationUnbondingPeriod"); + __delegationUnbondingPeriod = _delegationUnbondingPeriod; + emit ParameterUpdated("delegationUnbondingPeriod"); + } + + /** + * @dev Delegate tokens to an indexer. + * @param _delegator Address of the delegator + * @param _indexer Address of the indexer to delegate tokens to + * @param _tokens Amount of tokens to delegate + * @return Amount of shares issued of the delegation pool + */ + function _delegate(address _delegator, address _indexer, uint256 _tokens) private returns (uint256) { + // Only allow delegations over a minimum, to prevent rounding attacks + require(_tokens >= MINIMUM_DELEGATION, "!minimum-delegation"); + // Only delegate to non-empty address + require(_indexer != address(0), "!indexer"); + // Only delegate to staked indexer + require(__stakes[_indexer].tokensStaked > 0, "!stake"); + + // Get the delegation pool of the indexer + DelegationPool storage pool = __delegationPools[_indexer]; + Delegation storage delegation = pool.delegators[_delegator]; + + // Collect delegation tax + uint256 delegationTax = _collectTax(graphToken(), _tokens, __delegationTaxPercentage); + uint256 delegatedTokens = _tokens.sub(delegationTax); + + // Calculate shares to issue + uint256 shares = (pool.tokens == 0) ? delegatedTokens : delegatedTokens.mul(pool.shares).div(pool.tokens); + require(shares > 0, "!shares"); + + // Update the delegation pool + pool.tokens = pool.tokens.add(delegatedTokens); + pool.shares = pool.shares.add(shares); + + // Update the individual delegation + delegation.shares = delegation.shares.add(shares); + + emit StakeDelegated(_indexer, _delegator, delegatedTokens, shares); + + return shares; + } + + /** + * @dev Undelegate tokens from an indexer. + * @param _delegator Address of the delegator + * @param _indexer Address of the indexer where tokens had been delegated + * @param _shares Amount of shares to return and undelegate tokens + * @return Amount of tokens returned for the shares of the delegation pool + */ + function _undelegate(address _delegator, address _indexer, uint256 _shares) private returns (uint256) { + // Can only undelegate a non-zero amount of shares + require(_shares > 0, "!shares"); + + // Get the delegation pool of the indexer + DelegationPool storage pool = __delegationPools[_indexer]; + Delegation storage delegation = pool.delegators[_delegator]; + + // Delegator need to have enough shares in the pool to undelegate + require(delegation.shares >= _shares, "!shares-avail"); + + // Withdraw tokens if available + if (getWithdraweableDelegatedTokens(delegation) > 0) { + _withdrawDelegated(_delegator, _indexer, address(0)); + } + + uint256 poolTokens = pool.tokens; + uint256 poolShares = pool.shares; + + // Calculate tokens to get in exchange for the shares + uint256 tokens = _shares.mul(poolTokens).div(poolShares); + + // Update the delegation pool + poolTokens = poolTokens.sub(tokens); + poolShares = poolShares.sub(_shares); + pool.tokens = poolTokens; + pool.shares = poolShares; + + // Update the delegation + delegation.shares = delegation.shares.sub(_shares); + // Enforce more than the minimum delegation is left, + // to prevent rounding attacks + if (delegation.shares > 0) { + uint256 remainingDelegation = delegation.shares.mul(poolTokens).div(poolShares); + require(remainingDelegation >= MINIMUM_DELEGATION, "!minimum-delegation"); + } + delegation.tokensLocked = delegation.tokensLocked.add(tokens); + delegation.tokensLockedUntil = epochManager().currentEpoch().add(__delegationUnbondingPeriod); + + emit StakeDelegatedLocked(_indexer, _delegator, tokens, _shares, delegation.tokensLockedUntil); + + return tokens; + } + + /** + * @dev Withdraw delegated tokens once the unbonding period has passed. + * @param _delegator Delegator that is withdrawing tokens + * @param _indexer Withdraw available tokens delegated to indexer + * @param _delegateToIndexer Re-delegate to indexer address if non-zero, withdraw if zero address + * @return Amount of tokens withdrawn or re-delegated + */ + function _withdrawDelegated( + address _delegator, + address _indexer, + address _delegateToIndexer + ) private returns (uint256) { + // Get the delegation pool of the indexer + DelegationPool storage pool = __delegationPools[_indexer]; + Delegation storage delegation = pool.delegators[_delegator]; + + // Validation + uint256 tokensToWithdraw = getWithdraweableDelegatedTokens(delegation); + require(tokensToWithdraw > 0, "!tokens"); + + // Reset lock + delegation.tokensLocked = 0; + delegation.tokensLockedUntil = 0; + + emit StakeDelegatedWithdrawn(_indexer, _delegator, tokensToWithdraw); + + // -- Interactions -- + + if (_delegateToIndexer != address(0)) { + // Re-delegate tokens to a new indexer + _delegate(_delegator, _delegateToIndexer, tokensToWithdraw); + } else { + // Return tokens to the delegator + TokenUtils.pushTokens(graphToken(), _delegator, tokensToWithdraw); + } + + return tokensToWithdraw; + } + + /** + * @dev Collect tax to burn for an amount of tokens. + * @param _graphToken Token to burn + * @param _tokens Total tokens received used to calculate the amount of tax to collect + * @param _percentage Percentage of tokens to burn as tax + * @return Amount of tax charged + */ + function _collectTax(IGraphToken _graphToken, uint256 _tokens, uint256 _percentage) private returns (uint256) { + uint256 tax = uint256(_percentage).mul(_tokens).div(MAX_PPM); + TokenUtils.burnTokens(_graphToken, tax); // Burn tax if any + return tax; + } +} diff --git a/packages/contracts/contracts/staking/StakingStorage.sol b/packages/contracts/contracts/staking/StakingStorage.sol new file mode 100644 index 000000000..949a63614 --- /dev/null +++ b/packages/contracts/contracts/staking/StakingStorage.sol @@ -0,0 +1,131 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.7.6; + +import { Managed } from "../governance/Managed.sol"; + +import { IStakingData } from "./IStakingData.sol"; +import { IStakes } from "./libs/IStakes.sol"; + +/** + * @title StakingV1Storage + * @notice This contract holds all the storage variables for the Staking contract, version 1 + * @dev Note that we use a double underscore prefix for variable names; this prefix identifies + * variables that used to be public but are now internal, getters can be found on StakingExtension.sol. + */ +// solhint-disable-next-line max-states-count +contract StakingV1Storage is Managed { + // -- Staking -- + + /// @dev Minimum amount of tokens an indexer needs to stake + uint256 internal __minimumIndexerStake; + + /// @dev Time in blocks to unstake + uint32 internal __thawingPeriod; // in blocks + + /// @dev Percentage of fees going to curators + /// Parts per million. (Allows for 4 decimal points, 999,999 = 99.9999%) + uint32 internal __curationPercentage; + + /// @dev Percentage of fees burned as protocol fee + /// Parts per million. (Allows for 4 decimal points, 999,999 = 99.9999%) + uint32 internal __protocolPercentage; + + /// @dev Period for allocation to be finalized + uint32 private __DEPRECATED_channelDisputeEpochs; // solhint-disable-line var-name-mixedcase + + /// @dev Maximum allocation time + uint32 internal __maxAllocationEpochs; + + /// @dev Rebate alpha numerator + // Originally used for Cobb-Douglas rebates, now used for exponential rebates + uint32 internal __alphaNumerator; + + /// @dev Rebate alpha denominator + // Originally used for Cobb-Douglas rebates, now used for exponential rebates + uint32 internal __alphaDenominator; + + /// @dev Indexer stakes : indexer => Stake + mapping(address => IStakes.Indexer) internal __stakes; + + /// @dev Allocations : allocationID => Allocation + mapping(address => IStakingData.Allocation) internal __allocations; + + /// @dev Subgraph Allocations: subgraphDeploymentID => tokens + mapping(bytes32 => uint256) internal __subgraphAllocations; + + // Rebate pools : epoch => Pool + mapping(uint256 => uint256) private __DEPRECATED_rebates; // solhint-disable-line var-name-mixedcase + + // -- Slashing -- + + /// @dev List of addresses allowed to slash stakes + mapping(address => bool) internal __slashers; + + // -- Delegation -- + + /// @dev Set the delegation capacity multiplier defined by the delegation ratio + /// If delegation ratio is 100, and an Indexer has staked 5 GRT, + /// then they can use up to 500 GRT from the delegated stake + uint32 internal __delegationRatio; + + /// @dev Time in blocks an indexer needs to wait to change delegation parameters (deprecated) + uint32 internal __DEPRECATED_delegationParametersCooldown; // solhint-disable-line var-name-mixedcase + + /// @dev Time in epochs a delegator needs to wait to withdraw delegated stake + uint32 internal __delegationUnbondingPeriod; // in epochs + + /// @dev Percentage of tokens to tax a delegation deposit + /// Parts per million. (Allows for 4 decimal points, 999,999 = 99.9999%) + uint32 internal __delegationTaxPercentage; + + /// @dev Delegation pools : indexer => DelegationPool + mapping(address => IStakingData.DelegationPool) internal __delegationPools; + + // -- Operators -- + + /// @dev Operator auth : indexer => operator => is authorized + mapping(address => mapping(address => bool)) internal __operatorAuth; + + // -- Asset Holders -- + + /// @dev DEPRECATED: Allowed AssetHolders: assetHolder => is allowed + mapping(address => bool) private __DEPRECATED_assetHolders; // solhint-disable-line var-name-mixedcase +} + +/** + * @title StakingV2Storage + * @notice This contract holds all the storage variables for the Staking contract, version 2 + * @dev Note that we use a double underscore prefix for variable names; this prefix identifies + * variables that used to be public but are now internal, getters can be found on StakingExtension.sol. + */ +contract StakingV2Storage is StakingV1Storage { + /// @dev Destination of accrued rewards : beneficiary => rewards destination + mapping(address => address) internal __rewardsDestination; +} + +/** + * @title StakingV3Storage + * @notice This contract holds all the storage variables for the base Staking contract, version 3. + */ +contract StakingV3Storage is StakingV2Storage { + /// @dev Address of the counterpart Staking contract on L1/L2 + address internal counterpartStakingAddress; + /// @dev Address of the StakingExtension implementation + address internal extensionImpl; +} + +/** + * @title StakingV4Storage + * @notice This contract holds all the storage variables for the base Staking contract, version 4. + * @dev Note that it includes a storage gap - if adding future versions, make sure to move the gap + * to the new version and reduce the size of the gap accordingly. + */ +contract StakingV4Storage is StakingV3Storage { + // Additional rebate parameters for exponential rebates + uint32 internal __lambdaNumerator; + uint32 internal __lambdaDenominator; + + /// @dev Gap to allow adding variables in future upgrades (since L1Staking and L2Staking can have their own storage as well) + uint256[50] private __gap; +} diff --git a/packages/contracts/contracts/staking/libs/Exponential.sol b/packages/contracts/contracts/staking/libs/Exponential.sol new file mode 100644 index 000000000..c9370342e --- /dev/null +++ b/packages/contracts/contracts/staking/libs/Exponential.sol @@ -0,0 +1,62 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.7.6; + +import { LibFixedMath } from "./LibFixedMath.sol"; + +/** + * @title LibExponential library + * @notice A library to compute query fee rebates using an exponential formula + */ +library LibExponential { + /// @dev Maximum value of the exponent for which to compute the exponential before clamping to zero. + uint32 private constant MAX_EXPONENT = 15; + + /// @dev The exponential formula used to compute fee-based rewards for + /// staking pools in a given epoch. This function does not perform + /// bounds checking on the inputs, but the following conditions + /// need to be true: + /// 0 <= alphaNumerator / alphaDenominator <= 1 + /// 0 < lambdaNumerator / lambdaDenominator + /// The exponential rebates function has the form: + /// `(1 - alpha * exp ^ (-lambda * stake / fees)) * fees` + /// @param fees Fees generated by indexer in the staking pool. + /// @param stake Stake attributed to the indexer in the staking pool. + /// @param alphaNumerator Numerator of `alpha` in the rebates function. + /// @param alphaDenominator Denominator of `alpha` in the rebates function. + /// @param lambdaNumerator Numerator of `lambda` in the rebates function. + /// @param lambdaDenominator Denominator of `lambda` in the rebates function. + /// @return rewards Rewards owed to the staking pool. + function exponentialRebates( + uint256 fees, + uint256 stake, + uint32 alphaNumerator, + uint32 alphaDenominator, + uint32 lambdaNumerator, + uint32 lambdaDenominator + ) public pure returns (uint256) { + // If alpha is zero indexer gets 100% fees rebate + int256 alpha = LibFixedMath.toFixed(int32(alphaNumerator), int32(alphaDenominator)); + if (alpha == 0) { + return fees; + } + + // No rebates if no fees... + if (fees == 0) { + return 0; + } + + // Award all fees as rebate if the exponent is too large + int256 lambda = LibFixedMath.toFixed(int32(lambdaNumerator), int32(lambdaDenominator)); + int256 exponent = LibFixedMath.mulDiv(lambda, int256(stake), int256(fees)); + if (LibFixedMath.toInteger(exponent) > MAX_EXPONENT) { + return fees; + } + + // Compute `1 - alpha * exp ^(-exponent)` + int256 factor = LibFixedMath.sub(LibFixedMath.one(), LibFixedMath.mul(alpha, LibFixedMath.exp(-exponent))); + + // Weight the fees by the factor + return LibFixedMath.uintMul(factor, fees); + } +} diff --git a/packages/contracts/contracts/staking/libs/IStakes.sol b/packages/contracts/contracts/staking/libs/IStakes.sol new file mode 100644 index 000000000..701336409 --- /dev/null +++ b/packages/contracts/contracts/staking/libs/IStakes.sol @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.7.6 || 0.8.27; +pragma abicoder v2; + +interface IStakes { + struct Indexer { + uint256 tokensStaked; // Tokens on the indexer stake (staked by the indexer) + uint256 tokensAllocated; // Tokens used in allocations + uint256 tokensLocked; // Tokens locked for withdrawal subject to thawing period + uint256 tokensLockedUntil; // Block when locked tokens can be withdrawn + } +} diff --git a/packages/contracts/contracts/staking/libs/LibFixedMath.sol b/packages/contracts/contracts/staking/libs/LibFixedMath.sol new file mode 100644 index 000000000..ae8c9b69e --- /dev/null +++ b/packages/contracts/contracts/staking/libs/LibFixedMath.sol @@ -0,0 +1,382 @@ +/* + + Copyright 2017 Bprotocol Foundation, 2019 ZeroEx Intl. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +*/ + +// SPDX-License-Identifier: Apache-2.0 + +pragma solidity ^0.7.6; + +// solhint-disable indent +/// @dev Signed, fixed-point, 127-bit precision math library. +library LibFixedMath { + // 1 + int256 private constant FIXED_1 = int256(0x0000000000000000000000000000000080000000000000000000000000000000); + // 2**255 + int256 private constant MIN_FIXED_VAL = int256(0x8000000000000000000000000000000000000000000000000000000000000000); + // 1^2 (in fixed-point) + int256 private constant FIXED_1_SQUARED = + int256(0x4000000000000000000000000000000000000000000000000000000000000000); + // 1 + int256 private constant LN_MAX_VAL = FIXED_1; + // e ^ -63.875 + int256 private constant LN_MIN_VAL = int256(0x0000000000000000000000000000000000000000000000000000000733048c5a); + // 0 + int256 private constant EXP_MAX_VAL = 0; + // -63.875 + int256 private constant EXP_MIN_VAL = -int256(0x0000000000000000000000000000001ff0000000000000000000000000000000); + + /// @dev Get one as a fixed-point number. + function one() internal pure returns (int256 f) { + f = FIXED_1; + } + + /// @dev Returns the addition of two fixed point numbers, reverting on overflow. + function add(int256 a, int256 b) internal pure returns (int256 c) { + c = _add(a, b); + } + + /// @dev Returns the addition of two fixed point numbers, reverting on overflow. + function sub(int256 a, int256 b) internal pure returns (int256 c) { + if (b == MIN_FIXED_VAL) { + revert("out-of-bounds"); + } + c = _add(a, -b); + } + + /// @dev Returns the multiplication of two fixed point numbers, reverting on overflow. + function mul(int256 a, int256 b) internal pure returns (int256 c) { + c = _mul(a, b) / FIXED_1; + } + + /// @dev Returns the division of two fixed point numbers. + function div(int256 a, int256 b) internal pure returns (int256 c) { + c = _div(_mul(a, FIXED_1), b); + } + + /// @dev Performs (a * n) / d, without scaling for precision. + function mulDiv(int256 a, int256 n, int256 d) internal pure returns (int256 c) { + c = _div(_mul(a, n), d); + } + + /// @dev Returns the unsigned integer result of multiplying a fixed-point + /// number with an integer, reverting if the multiplication overflows. + /// Negative results are clamped to zero. + function uintMul(int256 f, uint256 u) internal pure returns (uint256) { + if (int256(u) < int256(0)) { + revert("out-of-bounds"); + } + int256 c = _mul(f, int256(u)); + if (c <= 0) { + return 0; + } + return uint256(uint256(c) >> 127); + } + + /// @dev Returns the absolute value of a fixed point number. + function abs(int256 f) internal pure returns (int256 c) { + if (f == MIN_FIXED_VAL) { + revert("out-of-bounds"); + } + if (f >= 0) { + c = f; + } else { + c = -f; + } + } + + /// @dev Returns 1 / `x`, where `x` is a fixed-point number. + function invert(int256 f) internal pure returns (int256 c) { + c = _div(FIXED_1_SQUARED, f); + } + + /// @dev Convert signed `n` / 1 to a fixed-point number. + function toFixed(int256 n) internal pure returns (int256 f) { + f = _mul(n, FIXED_1); + } + + /// @dev Convert signed `n` / `d` to a fixed-point number. + function toFixed(int256 n, int256 d) internal pure returns (int256 f) { + f = _div(_mul(n, FIXED_1), d); + } + + /// @dev Convert unsigned `n` / 1 to a fixed-point number. + /// Reverts if `n` is too large to fit in a fixed-point number. + function toFixed(uint256 n) internal pure returns (int256 f) { + if (int256(n) < int256(0)) { + revert("out-of-bounds"); + } + f = _mul(int256(n), FIXED_1); + } + + /// @dev Convert unsigned `n` / `d` to a fixed-point number. + /// Reverts if `n` / `d` is too large to fit in a fixed-point number. + function toFixed(uint256 n, uint256 d) internal pure returns (int256 f) { + if (int256(n) < int256(0)) { + revert("out-of-bounds"); + } + if (int256(d) < int256(0)) { + revert("out-of-bounds"); + } + f = _div(_mul(int256(n), FIXED_1), int256(d)); + } + + /// @dev Convert a fixed-point number to an integer. + function toInteger(int256 f) internal pure returns (int256 n) { + return f / FIXED_1; + } + + /// @dev Get the natural logarithm of a fixed-point number 0 < `x` <= LN_MAX_VAL + function ln(int256 x) internal pure returns (int256 r) { + if (x > LN_MAX_VAL) { + revert("out-of-bounds"); + } + if (x <= 0) { + revert("too-small"); + } + if (x == FIXED_1) { + return 0; + } + if (x <= LN_MIN_VAL) { + return EXP_MIN_VAL; + } + + int256 y; + int256 z; + int256 w; + + // Rewrite the input as a quotient of negative natural exponents and a single residual q, such that 1 < q < 2 + // For example: log(0.3) = log(e^-1 * e^-0.25 * 1.0471028872385522) + // = 1 - 0.25 - log(1 + 0.0471028872385522) + // e ^ -32 + if (x <= int256(0x00000000000000000000000000000000000000000001c8464f76164760000000)) { + r -= int256(0x0000000000000000000000000000001000000000000000000000000000000000); // - 32 + x = (x * FIXED_1) / int256(0x00000000000000000000000000000000000000000001c8464f76164760000000); // / e ^ -32 + } + // e ^ -16 + if (x <= int256(0x00000000000000000000000000000000000000f1aaddd7742e90000000000000)) { + r -= int256(0x0000000000000000000000000000000800000000000000000000000000000000); // - 16 + x = (x * FIXED_1) / int256(0x00000000000000000000000000000000000000f1aaddd7742e90000000000000); // / e ^ -16 + } + // e ^ -8 + if (x <= int256(0x00000000000000000000000000000000000afe10820813d78000000000000000)) { + r -= int256(0x0000000000000000000000000000000400000000000000000000000000000000); // - 8 + x = (x * FIXED_1) / int256(0x00000000000000000000000000000000000afe10820813d78000000000000000); // / e ^ -8 + } + // e ^ -4 + if (x <= int256(0x0000000000000000000000000000000002582ab704279ec00000000000000000)) { + r -= int256(0x0000000000000000000000000000000200000000000000000000000000000000); // - 4 + x = (x * FIXED_1) / int256(0x0000000000000000000000000000000002582ab704279ec00000000000000000); // / e ^ -4 + } + // e ^ -2 + if (x <= int256(0x000000000000000000000000000000001152aaa3bf81cc000000000000000000)) { + r -= int256(0x0000000000000000000000000000000100000000000000000000000000000000); // - 2 + x = (x * FIXED_1) / int256(0x000000000000000000000000000000001152aaa3bf81cc000000000000000000); // / e ^ -2 + } + // e ^ -1 + if (x <= int256(0x000000000000000000000000000000002f16ac6c59de70000000000000000000)) { + r -= int256(0x0000000000000000000000000000000080000000000000000000000000000000); // - 1 + x = (x * FIXED_1) / int256(0x000000000000000000000000000000002f16ac6c59de70000000000000000000); // / e ^ -1 + } + // e ^ -0.5 + if (x <= int256(0x000000000000000000000000000000004da2cbf1be5828000000000000000000)) { + r -= int256(0x0000000000000000000000000000000040000000000000000000000000000000); // - 0.5 + x = (x * FIXED_1) / int256(0x000000000000000000000000000000004da2cbf1be5828000000000000000000); // / e ^ -0.5 + } + // e ^ -0.25 + if (x <= int256(0x0000000000000000000000000000000063afbe7ab2082c000000000000000000)) { + r -= int256(0x0000000000000000000000000000000020000000000000000000000000000000); // - 0.25 + x = (x * FIXED_1) / int256(0x0000000000000000000000000000000063afbe7ab2082c000000000000000000); // / e ^ -0.25 + } + // e ^ -0.125 + if (x <= int256(0x0000000000000000000000000000000070f5a893b608861e1f58934f97aea57d)) { + r -= int256(0x0000000000000000000000000000000010000000000000000000000000000000); // - 0.125 + x = (x * FIXED_1) / int256(0x0000000000000000000000000000000070f5a893b608861e1f58934f97aea57d); // / e ^ -0.125 + } + // `x` is now our residual in the range of 1 <= x <= 2 (or close enough). + + // Add the taylor series for log(1 + z), where z = x - 1 + z = y = x - FIXED_1; + w = (y * y) / FIXED_1; + r += (z * (0x100000000000000000000000000000000 - y)) / 0x100000000000000000000000000000000; + z = (z * w) / FIXED_1; // add y^01 / 01 - y^02 / 02 + r += (z * (0x0aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - y)) / 0x200000000000000000000000000000000; + z = (z * w) / FIXED_1; // add y^03 / 03 - y^04 / 04 + r += (z * (0x099999999999999999999999999999999 - y)) / 0x300000000000000000000000000000000; + z = (z * w) / FIXED_1; // add y^05 / 05 - y^06 / 06 + r += (z * (0x092492492492492492492492492492492 - y)) / 0x400000000000000000000000000000000; + z = (z * w) / FIXED_1; // add y^07 / 07 - y^08 / 08 + r += (z * (0x08e38e38e38e38e38e38e38e38e38e38e - y)) / 0x500000000000000000000000000000000; + z = (z * w) / FIXED_1; // add y^09 / 09 - y^10 / 10 + r += (z * (0x08ba2e8ba2e8ba2e8ba2e8ba2e8ba2e8b - y)) / 0x600000000000000000000000000000000; + z = (z * w) / FIXED_1; // add y^11 / 11 - y^12 / 12 + r += (z * (0x089d89d89d89d89d89d89d89d89d89d89 - y)) / 0x700000000000000000000000000000000; + z = (z * w) / FIXED_1; // add y^13 / 13 - y^14 / 14 + r += (z * (0x088888888888888888888888888888888 - y)) / 0x800000000000000000000000000000000; // add y^15 / 15 - y^16 / 16 + } + + /// @dev Compute the natural exponent for a fixed-point number EXP_MIN_VAL <= `x` <= 1 + function exp(int256 x) internal pure returns (int256 r) { + if (x < EXP_MIN_VAL) { + // Saturate to zero below EXP_MIN_VAL. + return 0; + } + if (x == 0) { + return FIXED_1; + } + if (x > EXP_MAX_VAL) { + revert("out-of-bounds"); + } + + // Rewrite the input as a product of natural exponents and a + // single residual q, where q is a number of small magnitude. + // For example: e^-34.419 = e^(-32 - 2 - 0.25 - 0.125 - 0.044) + // = e^-32 * e^-2 * e^-0.25 * e^-0.125 * e^-0.044 + // -> q = -0.044 + + // Multiply with the taylor series for e^q + int256 y; + int256 z; + // q = x % 0.125 (the residual) + z = y = x % 0x0000000000000000000000000000000010000000000000000000000000000000; + z = (z * y) / FIXED_1; + r += z * 0x10e1b3be415a0000; // add y^02 * (20! / 02!) + z = (z * y) / FIXED_1; + r += z * 0x05a0913f6b1e0000; // add y^03 * (20! / 03!) + z = (z * y) / FIXED_1; + r += z * 0x0168244fdac78000; // add y^04 * (20! / 04!) + z = (z * y) / FIXED_1; + r += z * 0x004807432bc18000; // add y^05 * (20! / 05!) + z = (z * y) / FIXED_1; + r += z * 0x000c0135dca04000; // add y^06 * (20! / 06!) + z = (z * y) / FIXED_1; + r += z * 0x0001b707b1cdc000; // add y^07 * (20! / 07!) + z = (z * y) / FIXED_1; + r += z * 0x000036e0f639b800; // add y^08 * (20! / 08!) + z = (z * y) / FIXED_1; + r += z * 0x00000618fee9f800; // add y^09 * (20! / 09!) + z = (z * y) / FIXED_1; + r += z * 0x0000009c197dcc00; // add y^10 * (20! / 10!) + z = (z * y) / FIXED_1; + r += z * 0x0000000e30dce400; // add y^11 * (20! / 11!) + z = (z * y) / FIXED_1; + r += z * 0x000000012ebd1300; // add y^12 * (20! / 12!) + z = (z * y) / FIXED_1; + r += z * 0x0000000017499f00; // add y^13 * (20! / 13!) + z = (z * y) / FIXED_1; + r += z * 0x0000000001a9d480; // add y^14 * (20! / 14!) + z = (z * y) / FIXED_1; + r += z * 0x00000000001c6380; // add y^15 * (20! / 15!) + z = (z * y) / FIXED_1; + r += z * 0x000000000001c638; // add y^16 * (20! / 16!) + z = (z * y) / FIXED_1; + r += z * 0x0000000000001ab8; // add y^17 * (20! / 17!) + z = (z * y) / FIXED_1; + r += z * 0x000000000000017c; // add y^18 * (20! / 18!) + z = (z * y) / FIXED_1; + r += z * 0x0000000000000014; // add y^19 * (20! / 19!) + z = (z * y) / FIXED_1; + r += z * 0x0000000000000001; // add y^20 * (20! / 20!) + r = r / 0x21c3677c82b40000 + y + FIXED_1; // divide by 20! and then add y^1 / 1! + y^0 / 0! + + // Multiply with the non-residual terms. + x = -x; + // e ^ -32 + if ((x & int256(0x0000000000000000000000000000001000000000000000000000000000000000)) != 0) { + r = + (r * int256(0x00000000000000000000000000000000000000f1aaddd7742e56d32fb9f99744)) / + int256(0x0000000000000000000000000043cbaf42a000812488fc5c220ad7b97bf6e99e); // * e ^ -32 + } + // e ^ -16 + if ((x & int256(0x0000000000000000000000000000000800000000000000000000000000000000)) != 0) { + r = + (r * int256(0x00000000000000000000000000000000000afe10820813d65dfe6a33c07f738f)) / + int256(0x000000000000000000000000000005d27a9f51c31b7c2f8038212a0574779991); // * e ^ -16 + } + // e ^ -8 + if ((x & int256(0x0000000000000000000000000000000400000000000000000000000000000000)) != 0) { + r = + (r * int256(0x0000000000000000000000000000000002582ab704279e8efd15e0265855c47a)) / + int256(0x0000000000000000000000000000001b4c902e273a58678d6d3bfdb93db96d02); // * e ^ -8 + } + // e ^ -4 + if ((x & int256(0x0000000000000000000000000000000200000000000000000000000000000000)) != 0) { + r = + (r * int256(0x000000000000000000000000000000001152aaa3bf81cb9fdb76eae12d029571)) / + int256(0x00000000000000000000000000000003b1cc971a9bb5b9867477440d6d157750); // * e ^ -4 + } + // e ^ -2 + if ((x & int256(0x0000000000000000000000000000000100000000000000000000000000000000)) != 0) { + r = + (r * int256(0x000000000000000000000000000000002f16ac6c59de6f8d5d6f63c1482a7c86)) / + int256(0x000000000000000000000000000000015bf0a8b1457695355fb8ac404e7a79e3); // * e ^ -2 + } + // e ^ -1 + if ((x & int256(0x0000000000000000000000000000000080000000000000000000000000000000)) != 0) { + r = + (r * int256(0x000000000000000000000000000000004da2cbf1be5827f9eb3ad1aa9866ebb3)) / + int256(0x00000000000000000000000000000000d3094c70f034de4b96ff7d5b6f99fcd8); // * e ^ -1 + } + // e ^ -0.5 + if ((x & int256(0x0000000000000000000000000000000040000000000000000000000000000000)) != 0) { + r = + (r * int256(0x0000000000000000000000000000000063afbe7ab2082ba1a0ae5e4eb1b479dc)) / + int256(0x00000000000000000000000000000000a45af1e1f40c333b3de1db4dd55f29a7); // * e ^ -0.5 + } + // e ^ -0.25 + if ((x & int256(0x0000000000000000000000000000000020000000000000000000000000000000)) != 0) { + r = + (r * int256(0x0000000000000000000000000000000070f5a893b608861e1f58934f97aea57d)) / + int256(0x00000000000000000000000000000000910b022db7ae67ce76b441c27035c6a1); // * e ^ -0.25 + } + // e ^ -0.125 + if ((x & int256(0x0000000000000000000000000000000010000000000000000000000000000000)) != 0) { + r = + (r * int256(0x00000000000000000000000000000000783eafef1c0a8f3978c7f81824d62ebf)) / + int256(0x0000000000000000000000000000000088415abbe9a76bead8d00cf112e4d4a8); // * e ^ -0.125 + } + } + + /// @dev Returns the multiplication two numbers, reverting on overflow. + function _mul(int256 a, int256 b) private pure returns (int256 c) { + if (a == 0 || b == 0) { + return 0; + } + c = a * b; + if (c / a != b || c / b != a) { + revert("overflow"); + } + } + + /// @dev Returns the division of two numbers, reverting on division by zero. + function _div(int256 a, int256 b) private pure returns (int256 c) { + if (b == 0) { + revert("overflow"); + } + if (a == MIN_FIXED_VAL && b == -1) { + revert("overflow"); + } + c = a / b; + } + + /// @dev Adds two numbers, reverting on overflow. + function _add(int256 a, int256 b) private pure returns (int256 c) { + c = a + b; + if ((a < 0 && b < 0 && c > a) || (a > 0 && b > 0 && c < a)) { + revert("overflow"); + } + } +} diff --git a/packages/contracts/contracts/staking/libs/MathUtils.sol b/packages/contracts/contracts/staking/libs/MathUtils.sol new file mode 100644 index 000000000..0fb20389a --- /dev/null +++ b/packages/contracts/contracts/staking/libs/MathUtils.sol @@ -0,0 +1,46 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.7.6; + +import "@openzeppelin/contracts/math/SafeMath.sol"; + +/** + * @title MathUtils Library + * @notice A collection of functions to perform math operations + */ +library MathUtils { + using SafeMath for uint256; + + /** + * @dev Calculates the weighted average of two values pondering each of these + * values based on configured weights. The contribution of each value N is + * weightN/(weightA + weightB). The calculation rounds up to ensure the result + * is always greater than the smallest of the two values. + * @param valueA The amount for value A + * @param weightA The weight to use for value A + * @param valueB The amount for value B + * @param weightB The weight to use for value B + */ + function weightedAverageRoundingUp( + uint256 valueA, + uint256 weightA, + uint256 valueB, + uint256 weightB + ) internal pure returns (uint256) { + return valueA.mul(weightA).add(valueB.mul(weightB)).add(weightA.add(weightB).sub(1)).div(weightA.add(weightB)); + } + + /** + * @dev Returns the minimum of two numbers. + */ + function min(uint256 x, uint256 y) internal pure returns (uint256) { + return x <= y ? x : y; + } + + /** + * @dev Returns the difference between two numbers or zero if negative. + */ + function diffOrZero(uint256 x, uint256 y) internal pure returns (uint256) { + return (x > y) ? x.sub(y) : 0; + } +} diff --git a/packages/contracts/contracts/staking/libs/Stakes.sol b/packages/contracts/contracts/staking/libs/Stakes.sol new file mode 100644 index 000000000..b09101032 --- /dev/null +++ b/packages/contracts/contracts/staking/libs/Stakes.sol @@ -0,0 +1,185 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.7.6; +pragma abicoder v2; + +import "@openzeppelin/contracts/math/SafeMath.sol"; + +import "./MathUtils.sol"; +import "./IStakes.sol"; + +/** + * @title A collection of data structures and functions to manage the Indexer Stake state. + * Used for low-level state changes, require() conditions should be evaluated + * at the caller function scope. + */ +library Stakes { + using SafeMath for uint256; + using Stakes for IStakes.Indexer; + + /** + * @dev Deposit tokens to the indexer stake. + * @param stake Stake data + * @param _tokens Amount of tokens to deposit + */ + function deposit(IStakes.Indexer storage stake, uint256 _tokens) internal { + stake.tokensStaked = stake.tokensStaked.add(_tokens); + } + + /** + * @dev Release tokens from the indexer stake. + * @param stake Stake data + * @param _tokens Amount of tokens to release + */ + function release(IStakes.Indexer storage stake, uint256 _tokens) internal { + stake.tokensStaked = stake.tokensStaked.sub(_tokens); + } + + /** + * @dev Allocate tokens from the main stack to a SubgraphDeployment. + * @param stake Stake data + * @param _tokens Amount of tokens to allocate + */ + function allocate(IStakes.Indexer storage stake, uint256 _tokens) internal { + stake.tokensAllocated = stake.tokensAllocated.add(_tokens); + } + + /** + * @dev Unallocate tokens from a SubgraphDeployment back to the main stack. + * @param stake Stake data + * @param _tokens Amount of tokens to unallocate + */ + function unallocate(IStakes.Indexer storage stake, uint256 _tokens) internal { + stake.tokensAllocated = stake.tokensAllocated.sub(_tokens); + } + + /** + * @dev Lock tokens until a thawing period pass. + * @param stake Stake data + * @param _tokens Amount of tokens to unstake + * @param _period Period in blocks that need to pass before withdrawal + */ + function lockTokens(IStakes.Indexer storage stake, uint256 _tokens, uint256 _period) internal { + // Take into account period averaging for multiple unstake requests + uint256 lockingPeriod = _period; + if (stake.tokensLocked > 0) { + lockingPeriod = MathUtils.weightedAverageRoundingUp( + MathUtils.diffOrZero(stake.tokensLockedUntil, block.number), // Remaining thawing period + stake.tokensLocked, // Weighted by remaining unstaked tokens + _period, // Thawing period + _tokens // Weighted by new tokens to unstake + ); + } + + // Update balances + stake.tokensLocked = stake.tokensLocked.add(_tokens); + stake.tokensLockedUntil = block.number.add(lockingPeriod); + } + + /** + * @dev Unlock tokens. + * @param stake Stake data + * @param _tokens Amount of tokens to unlock + */ + function unlockTokens(IStakes.Indexer storage stake, uint256 _tokens) internal { + stake.tokensLocked = stake.tokensLocked.sub(_tokens); + if (stake.tokensLocked == 0) { + stake.tokensLockedUntil = 0; + } + } + + /** + * @dev Take all tokens out from the locked stake for withdrawal. + * @param stake Stake data + * @return Amount of tokens being withdrawn + */ + function withdrawTokens(IStakes.Indexer storage stake) internal returns (uint256) { + // Calculate tokens that can be released + uint256 tokensToWithdraw = stake.tokensWithdrawable(); + + if (tokensToWithdraw > 0) { + // Reset locked tokens + stake.unlockTokens(tokensToWithdraw); + + // Decrease indexer stake + stake.release(tokensToWithdraw); + } + + return tokensToWithdraw; + } + + /** + * @dev Return the amount of tokens used in allocations and locked for withdrawal. + * @param stake Stake data + * @return Token amount + */ + function tokensUsed(IStakes.Indexer memory stake) internal pure returns (uint256) { + return stake.tokensAllocated.add(stake.tokensLocked); + } + + /** + * @dev Return the amount of tokens staked not considering the ones that are already going + * through the thawing period or are ready for withdrawal. We call it secure stake because + * it is not subject to change by a withdraw call from the indexer. + * @param stake Stake data + * @return Token amount + */ + function tokensSecureStake(IStakes.Indexer memory stake) internal pure returns (uint256) { + return stake.tokensStaked.sub(stake.tokensLocked); + } + + /** + * @dev Tokens free balance on the indexer stake that can be used for any purpose. + * Any token that is allocated cannot be used as well as tokens that are going through the + * thawing period or are withdrawable + * Calc: tokensStaked - tokensAllocated - tokensLocked + * @param stake Stake data + * @return Token amount + */ + function tokensAvailable(IStakes.Indexer memory stake) internal pure returns (uint256) { + return stake.tokensAvailableWithDelegation(0); + } + + /** + * @dev Tokens free balance on the indexer stake that can be used for allocations. + * This function accepts a parameter for extra delegated capacity that takes into + * account delegated tokens + * @param stake Stake data + * @param _delegatedCapacity Amount of tokens used from delegators to calculate availability + * @return Token amount + */ + function tokensAvailableWithDelegation( + IStakes.Indexer memory stake, + uint256 _delegatedCapacity + ) internal pure returns (uint256) { + uint256 tokensCapacity = stake.tokensStaked.add(_delegatedCapacity); + uint256 _tokensUsed = stake.tokensUsed(); + // If more tokens are used than the current capacity, the indexer is overallocated. + // This means the indexer doesn't have available capacity to create new allocations. + // We can reach this state when the indexer has funds allocated and then any + // of these conditions happen: + // - The delegationCapacity ratio is reduced. + // - The indexer stake is slashed. + // - A delegator removes enough stake. + if (_tokensUsed > tokensCapacity) { + // Indexer stake is over allocated: return 0 to avoid stake to be used until + // the overallocation is restored by staking more tokens, unallocating tokens + // or using more delegated funds + return 0; + } + return tokensCapacity.sub(_tokensUsed); + } + + /** + * @dev Tokens available for withdrawal after thawing period. + * @param stake Stake data + * @return Token amount + */ + function tokensWithdrawable(IStakes.Indexer memory stake) internal view returns (uint256) { + // No tokens to withdraw before locking period + if (stake.tokensLockedUntil == 0 || block.number < stake.tokensLockedUntil) { + return 0; + } + return stake.tokensLocked; + } +} diff --git a/packages/contracts/contracts/tests/CallhookReceiverMock.sol b/packages/contracts/contracts/tests/CallhookReceiverMock.sol new file mode 100644 index 000000000..e2418f3c8 --- /dev/null +++ b/packages/contracts/contracts/tests/CallhookReceiverMock.sol @@ -0,0 +1,28 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.7.6; + +import "../gateway/ICallhookReceiver.sol"; + +/** + * @title GovernedMock contract + */ +contract CallhookReceiverMock is ICallhookReceiver { + event TransferReceived(address from, uint256 amount, uint256 foo, uint256 bar); + + /** + * @dev Receive tokens with a callhook from the bridge + * Expects two uint256 values encoded in _data. + * Reverts if the first of these values is zero. + * @param _from Token sender in L1 + * @param _amount Amount of tokens that were transferred + * @param _data ABI-encoded callhook data + */ + function onTokenTransfer(address _from, uint256 _amount, bytes calldata _data) external override { + uint256 foo; + uint256 bar; + (foo, bar) = abi.decode(_data, (uint256, uint256)); + require(foo != 0, "FOO_IS_ZERO"); + emit TransferReceived(_from, _amount, foo, bar); + } +} diff --git a/packages/contracts/contracts/tests/GovernedMock.sol b/packages/contracts/contracts/tests/GovernedMock.sol new file mode 100644 index 000000000..cc908287b --- /dev/null +++ b/packages/contracts/contracts/tests/GovernedMock.sol @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.7.6; + +import "../governance/Governed.sol"; + +/** + * @title GovernedMock contract + */ +contract GovernedMock is Governed { + constructor() { + Governed._initialize(msg.sender); + } +} diff --git a/packages/contracts/contracts/tests/L1GraphTokenLockTransferToolBadMock.sol b/packages/contracts/contracts/tests/L1GraphTokenLockTransferToolBadMock.sol new file mode 100644 index 000000000..f540b1b96 --- /dev/null +++ b/packages/contracts/contracts/tests/L1GraphTokenLockTransferToolBadMock.sol @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.7.6; +pragma experimental ABIEncoderV2; + +contract L1GraphTokenLockTransferToolBadMock { + mapping(address => address) public l2WalletAddress; + + function setL2WalletAddress(address _l1Address, address _l2Address) external { + l2WalletAddress[_l1Address] = _l2Address; + } + + // Sends 1 wei less than requested + function pullETH(address _l1Wallet, uint256 _amount) external { + require(l2WalletAddress[_l1Wallet] != address(0), "L1GraphTokenLockTransferToolMock: unknown L1 wallet"); + (bool success, ) = payable(msg.sender).call{ value: _amount - 1 }(""); + require(success, "L1GraphTokenLockTransferToolMock: ETH pull failed"); + } +} diff --git a/packages/contracts/contracts/tests/L1GraphTokenLockTransferToolMock.sol b/packages/contracts/contracts/tests/L1GraphTokenLockTransferToolMock.sol new file mode 100644 index 000000000..a1321d62f --- /dev/null +++ b/packages/contracts/contracts/tests/L1GraphTokenLockTransferToolMock.sol @@ -0,0 +1,18 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.7.6; +pragma experimental ABIEncoderV2; + +contract L1GraphTokenLockTransferToolMock { + mapping(address => address) public l2WalletAddress; + + function setL2WalletAddress(address _l1Address, address _l2Address) external { + l2WalletAddress[_l1Address] = _l2Address; + } + + function pullETH(address _l1Wallet, uint256 _amount) external { + require(l2WalletAddress[_l1Wallet] != address(0), "L1GraphTokenLockTransferToolMock: unknown L1 wallet"); + (bool success, ) = payable(msg.sender).call{ value: _amount }(""); + require(success, "L1GraphTokenLockTransferToolMock: ETH pull failed"); + } +} diff --git a/packages/contracts/contracts/tests/LegacyGNSMock.sol b/packages/contracts/contracts/tests/LegacyGNSMock.sol new file mode 100644 index 000000000..b2b4088b9 --- /dev/null +++ b/packages/contracts/contracts/tests/LegacyGNSMock.sol @@ -0,0 +1,45 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.7.6; +pragma abicoder v2; + +import { L1GNS } from "../discovery/L1GNS.sol"; +import { IGNS } from "../discovery/IGNS.sol"; + +/** + * @title LegacyGNSMock contract + * @dev This is used to test the migration of legacy subgraphs to NFT-based subgraphs and transferring them to L2 + */ +contract LegacyGNSMock is L1GNS { + /** + * @notice Create a mock legacy subgraph (owned by the msg.sender) + * @param subgraphNumber Number of the subgraph (sequence ID for the account) + * @param subgraphDeploymentID Subgraph deployment ID + */ + function createLegacySubgraph(uint256 subgraphNumber, bytes32 subgraphDeploymentID) external { + SubgraphData storage subgraphData = legacySubgraphData[msg.sender][subgraphNumber]; + legacySubgraphs[msg.sender][subgraphNumber] = subgraphDeploymentID; + subgraphData.subgraphDeploymentID = subgraphDeploymentID; + subgraphData.nSignal = 1000; // Mock value + } + + /** + * @notice Get the subgraph deployment ID for a subgraph + * @param subgraphID Subgraph ID + * @return subgraphDeploymentID Subgraph deployment ID + */ + function getSubgraphDeploymentID(uint256 subgraphID) external view returns (bytes32 subgraphDeploymentID) { + IGNS.SubgraphData storage subgraph = _getSubgraphData(subgraphID); + subgraphDeploymentID = subgraph.subgraphDeploymentID; + } + + /** + * @notice Get the nSignal for a subgraph + * @param subgraphID Subgraph ID + * @return nSignal The subgraph's nSignal + */ + function getSubgraphNSignal(uint256 subgraphID) external view returns (uint256 nSignal) { + IGNS.SubgraphData storage subgraph = _getSubgraphData(subgraphID); + nSignal = subgraph.nSignal; + } +} diff --git a/packages/contracts/contracts/tests/arbitrum/BridgeMock.sol b/packages/contracts/contracts/tests/arbitrum/BridgeMock.sol new file mode 100644 index 000000000..77be89b4e --- /dev/null +++ b/packages/contracts/contracts/tests/arbitrum/BridgeMock.sol @@ -0,0 +1,118 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.7.6; + +import "../../arbitrum/IBridge.sol"; + +/** + * @title Arbitrum Bridge mock contract + * @dev This contract implements Arbitrum's IBridge interface for testing purposes + */ +contract BridgeMock is IBridge { + // Address of the (mock) Arbitrum Inbox + address public inbox; + // Address of the (mock) Arbitrum Outbox + address public outbox; + // Index of the next message on the inbox messages array + uint256 public messageIndex; + // Inbox messages array + bytes32[] public override inboxAccs; + + /** + * @dev Deliver a message to the inbox. The encoded message will be + * added to the inbox array, and messageIndex will be incremented. + * @param _kind Type of the message + * @param _sender Address that is sending the message + * @param _messageDataHash keccak256 hash of the message data + * @return The next index for the inbox array + */ + function deliverMessageToInbox( + uint8 _kind, + address _sender, + bytes32 _messageDataHash + ) external payable override returns (uint256) { + messageIndex = messageIndex + 1; + inboxAccs.push(keccak256(abi.encodePacked(inbox, _kind, _sender, _messageDataHash))); + emit MessageDelivered(messageIndex, inboxAccs[messageIndex - 1], msg.sender, _kind, _sender, _messageDataHash); + return messageIndex; + } + + /** + * @dev Executes an L1 function call incoing from L2. This can only be called + * by the Outbox. + * @param _destAddr Contract to call + * @param _amount ETH value to send + * @param _data Calldata for the function call + * @return True if the call was successful, false otherwise + * @return Return data from the call + */ + function executeCall( + address _destAddr, + uint256 _amount, + bytes calldata _data + ) external override returns (bool, bytes memory) { + require(outbox == msg.sender, "NOT_FROM_OUTBOX"); + bool success; + bytes memory returnData; + + // solhint-disable-next-line avoid-low-level-calls + (success, returnData) = _destAddr.call{ value: _amount }(_data); + emit BridgeCallTriggered(msg.sender, _destAddr, _amount, _data); + return (success, returnData); + } + + /** + * @dev Set the address of the inbox. Anyone can call this, because it's a mock. + * @param _inbox Address of the inbox + * @param _enabled Enable the inbox (ignored) + */ + function setInbox(address _inbox, bool _enabled) external override { + inbox = _inbox; + emit InboxToggle(inbox, _enabled); + } + + /** + * @dev Set the address of the outbox. Anyone can call this, because it's a mock. + * @param _outbox Address of the outbox + * @param _enabled Enable the outbox (ignored) + */ + function setOutbox(address _outbox, bool _enabled) external override { + outbox = _outbox; + emit OutboxToggle(outbox, _enabled); + } + + // View functions + + /** + * @dev Getter for the active outbox (in this case there's only one) + */ + function activeOutbox() external view override returns (address) { + return outbox; + } + + /** + * @dev Getter for whether an address is an allowed inbox (in this case there's only one) + * @param _inbox Address to check + * @return True if the address is the allowed inbox, false otherwise + */ + function allowedInboxes(address _inbox) external view override returns (bool) { + return _inbox == inbox; + } + + /** + * @dev Getter for whether an address is an allowed outbox (in this case there's only one) + * @param _outbox Address to check + * @return True if the address is the allowed outbox, false otherwise + */ + function allowedOutboxes(address _outbox) external view override returns (bool) { + return _outbox == outbox; + } + + /** + * @dev Getter for the count of messages in the inboxAccs + * @return Number of messages in inboxAccs + */ + function messageCount() external view override returns (uint256) { + return inboxAccs.length; + } +} diff --git a/packages/contracts/contracts/tests/arbitrum/InboxMock.sol b/packages/contracts/contracts/tests/arbitrum/InboxMock.sol new file mode 100644 index 000000000..57af6941c --- /dev/null +++ b/packages/contracts/contracts/tests/arbitrum/InboxMock.sol @@ -0,0 +1,190 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.7.6; + +import "../../arbitrum/IInbox.sol"; +import "../../arbitrum/AddressAliasHelper.sol"; + +/** + * @title Arbitrum Inbox mock contract + * @dev This contract implements (a subset of) Arbitrum's IInbox interface for testing purposes + */ +contract InboxMock is IInbox { + // Type indicator for a standard L2 message + uint8 internal constant L2_MSG = 3; + // Type indicator for a retryable ticket message + // solhint-disable-next-line const-name-snakecase + uint8 internal constant L1MessageType_submitRetryableTx = 9; + // Address of the Bridge (mock) contract + IBridge public override bridge; + + /** + * @dev Send a message to L2 (by delivering it to the Bridge) + * @param _messageData Encoded data to send in the message + * @return message number returned by the inbox + */ + function sendL2Message(bytes calldata _messageData) external override returns (uint256) { + uint256 msgNum = deliverToBridge(L2_MSG, msg.sender, keccak256(_messageData)); + emit InboxMessageDelivered(msgNum, _messageData); + return msgNum; + } + + /** + * @dev Set the address of the (mock) bridge + * @param _bridge Address of the bridge + */ + function setBridge(address _bridge) external { + bridge = IBridge(_bridge); + } + + /** + * @dev Unimplemented in this mock + */ + function sendUnsignedTransaction( + uint256, + uint256, + uint256, + address, + uint256, + bytes calldata + ) external pure override returns (uint256) { + revert("Unimplemented"); + } + + /** + * @dev Unimplemented in this mock + */ + function sendContractTransaction( + uint256, + uint256, + address, + uint256, + bytes calldata + ) external pure override returns (uint256) { + revert("Unimplemented"); + } + + /** + * @dev Unimplemented in this mock + */ + function sendL1FundedUnsignedTransaction( + uint256, + uint256, + uint256, + address, + bytes calldata + ) external payable override returns (uint256) { + revert("Unimplemented"); + } + + /** + * @dev Unimplemented in this mock + */ + function sendL1FundedContractTransaction( + uint256, + uint256, + address, + bytes calldata + ) external payable override returns (uint256) { + revert("Unimplemented"); + } + + /** + * @dev Creates a retryable ticket for an L2 transaction + * @param _destAddr Address of the contract to call in L2 + * @param _arbTxCallValue Callvalue to use in the L2 transaction + * @param _maxSubmissionCost Max cost of submitting the ticket, in Wei + * @param _submissionRefundAddress L2 address to refund for any remaining value from the submission cost + * @param _valueRefundAddress L2 address to refund if the ticket times out or gets cancelled + * @param _maxGas Max gas for the L2 transcation + * @param _gasPriceBid Gas price bid on L2 + * @param _data Encoded calldata for the L2 transaction (including function selector) + * @return message number returned by the bridge + */ + function createRetryableTicket( + address _destAddr, + uint256 _arbTxCallValue, + uint256 _maxSubmissionCost, + address _submissionRefundAddress, + address _valueRefundAddress, + uint256 _maxGas, + uint256 _gasPriceBid, + bytes calldata _data + ) external payable override returns (uint256) { + _submissionRefundAddress = AddressAliasHelper.applyL1ToL2Alias(_submissionRefundAddress); + _valueRefundAddress = AddressAliasHelper.applyL1ToL2Alias(_valueRefundAddress); + return + _deliverMessage( + L1MessageType_submitRetryableTx, + msg.sender, + abi.encodePacked( + uint256(uint160(bytes20(_destAddr))), + _arbTxCallValue, + msg.value, + _maxSubmissionCost, + uint256(uint160(bytes20(_submissionRefundAddress))), + uint256(uint160(bytes20(_valueRefundAddress))), + _maxGas, + _gasPriceBid, + _data.length, + _data + ) + ); + } + + function depositEth(uint256) external payable override returns (uint256) { + revert("Unimplemented"); + } + + /** + * @dev Unimplemented in this mock + */ + function pauseCreateRetryables() external pure override { + revert("Unimplemented"); + } + + /** + * @dev Unimplemented in this mock + */ + function unpauseCreateRetryables() external pure override { + revert("Unimplemented"); + } + + /** + * @dev Unimplemented in this mock + */ + function startRewriteAddress() external pure override { + revert("Unimplemented"); + } + + /** + * @dev Unimplemented in this mock + */ + function stopRewriteAddress() external pure override { + revert("Unimplemented"); + } + + /** + * @dev Deliver a message to the bridge + * @param _kind Type of the message + * @param _sender Address that is sending the message + * @param _messageData Encoded message data + * @return Message number returned by the bridge + */ + function _deliverMessage(uint8 _kind, address _sender, bytes memory _messageData) internal returns (uint256) { + uint256 msgNum = deliverToBridge(_kind, _sender, keccak256(_messageData)); + emit InboxMessageDelivered(msgNum, _messageData); + return msgNum; + } + + /** + * @dev Deliver a message to the bridge + * @param _kind Type of the message + * @param _sender Address that is sending the message + * @param _messageDataHash keccak256 hash of the encoded message data + * @return Message number returned by the bridge + */ + function deliverToBridge(uint8 _kind, address _sender, bytes32 _messageDataHash) internal returns (uint256) { + return bridge.deliverMessageToInbox{ value: msg.value }(_kind, _sender, _messageDataHash); + } +} diff --git a/packages/contracts/contracts/tests/arbitrum/OutboxMock.sol b/packages/contracts/contracts/tests/arbitrum/OutboxMock.sol new file mode 100644 index 000000000..92b9bb246 --- /dev/null +++ b/packages/contracts/contracts/tests/arbitrum/OutboxMock.sol @@ -0,0 +1,153 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.7.6; + +import "../../arbitrum/IOutbox.sol"; +import "../../arbitrum/IBridge.sol"; + +/** + * @title Arbitrum Outbox mock contract + * @dev This contract implements (a subset of) Arbitrum's IOutbox interface for testing purposes + */ +contract OutboxMock is IOutbox { + // Context of an L2-to-L1 function call + struct L2ToL1Context { + uint128 l2Block; + uint128 l1Block; + uint128 timestamp; + uint128 batchNum; + bytes32 outputId; + address sender; + } + // Context of the current L2-to-L1 function call (set and cleared in each transaction) + L2ToL1Context internal context; + + // Address of the (mock) Arbitrum Bridge + IBridge public bridge; + + /** + * @dev Set the address of the (mock) bridge + * @param _bridge Address of the bridge + */ + function setBridge(address _bridge) external { + bridge = IBridge(_bridge); + } + + /** + * @dev Getter for the L2 sender of the current incoming message + */ + function l2ToL1Sender() external view override returns (address) { + return context.sender; + } + + /** + * @dev Getter for the L2 block of the current incoming message + */ + function l2ToL1Block() external view override returns (uint256) { + return context.l2Block; + } + + /** + * @dev Getter for the L1 block of the current incoming message + */ + function l2ToL1EthBlock() external view override returns (uint256) { + return context.l1Block; + } + + /** + * @dev Getter for the L1 timestamp of the current incoming message + */ + function l2ToL1Timestamp() external view override returns (uint256) { + return context.timestamp; + } + + /** + * @dev Getter for the L2 batch number of the current incoming message + */ + function l2ToL1BatchNum() external view override returns (uint256) { + return context.batchNum; + } + + /** + * @dev Getter for the output ID of the current incoming message + */ + function l2ToL1OutputId() external view override returns (bytes32) { + return context.outputId; + } + + /** + * @dev Unimplemented in this mock + */ + function processOutgoingMessages(bytes calldata, uint256[] calldata) external pure override { + revert("Unimplemented"); + } + + /** + * @dev Check whether an outbox entry for a message exists. + * This mock returns always true. + */ + function outboxEntryExists(uint256) external pure override returns (bool) { + return true; + } + + /** + * @notice (Mock) Executes a messages in an Outbox entry. + * @dev This mocks what has to be called when finalizing an L2 to L1 transfer. + * In our mock scenario, we don't validate and execute unconditionally. + * @param _batchNum Index of OutboxEntry in outboxEntries array + * @param _l2Sender sender of original message (i.e., caller of ArbSys.sendTxToL1) + * @param _destAddr destination address for L1 contract call + * @param _l2Block l2 block number at which sendTxToL1 call was made + * @param _l1Block l1 block number at which sendTxToL1 call was made + * @param _l2Timestamp l2 Timestamp at which sendTxToL1 call was made + * @param _amount value in L1 message in wei + * @param _calldataForL1 abi-encoded L1 message data + */ + function executeTransaction( + uint256 _batchNum, + bytes32[] calldata, // proof + uint256, // index + address _l2Sender, + address _destAddr, + uint256 _l2Block, + uint256 _l1Block, + uint256 _l2Timestamp, + uint256 _amount, + bytes calldata _calldataForL1 + ) external virtual { + bytes32 outputId; + + context = L2ToL1Context({ + sender: _l2Sender, + l2Block: uint128(_l2Block), + l1Block: uint128(_l1Block), + timestamp: uint128(_l2Timestamp), + batchNum: uint128(_batchNum), + outputId: outputId + }); + + // set and reset vars around execution so they remain valid during call + executeBridgeCall(_destAddr, _amount, _calldataForL1); + } + + /** + * @dev Execute an L2-to-L1 function call by calling the bridge + * @param _destAddr Address of the contract to call + * @param _amount Callvalue for the function call + * @param _data Calldata for the function call + */ + function executeBridgeCall(address _destAddr, uint256 _amount, bytes memory _data) internal { + (bool success, bytes memory returndata) = bridge.executeCall(_destAddr, _amount, _data); + if (!success) { + if (returndata.length > 0) { + // solhint-disable-next-line no-inline-assembly + assembly { + let returndata_size := mload(returndata) + revert(add(32, returndata), returndata_size) + } + } else { + revert("BRIDGE_CALL_FAILED"); + } + } + } +} diff --git a/packages/contracts/contracts/tests/ens/IENS.sol b/packages/contracts/contracts/tests/ens/IENS.sol new file mode 100644 index 000000000..f03cb651c --- /dev/null +++ b/packages/contracts/contracts/tests/ens/IENS.sol @@ -0,0 +1,9 @@ +pragma solidity ^0.7.6; + +// Needed for abi and typechain in the npm package +interface IENS { + function owner(bytes32 node) external view returns (address); + + // Must call setRecord, not setOwner, We must namehash it ourselves as well + function setSubnodeRecord(bytes32 node, bytes32 label, address owner, address resolver, uint64 ttl) external; +} diff --git a/packages/contracts/contracts/tests/ens/IPublicResolver.sol b/packages/contracts/contracts/tests/ens/IPublicResolver.sol new file mode 100644 index 000000000..06ce2243b --- /dev/null +++ b/packages/contracts/contracts/tests/ens/IPublicResolver.sol @@ -0,0 +1,8 @@ +pragma solidity ^0.7.6; + +// Needed for abi and typechain in the npm package +interface IPublicResolver { + function text(bytes32 node, string calldata key) external view returns (string memory); + + function setText(bytes32 node, string calldata key, string calldata value) external; +} diff --git a/contracts/tests/ens/ITestRegistrar.sol b/packages/contracts/contracts/tests/ens/ITestRegistrar.sol similarity index 79% rename from contracts/tests/ens/ITestRegistrar.sol rename to packages/contracts/contracts/tests/ens/ITestRegistrar.sol index f2d8454e8..8a795cc85 100644 --- a/contracts/tests/ens/ITestRegistrar.sol +++ b/packages/contracts/contracts/tests/ens/ITestRegistrar.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.7.3; +pragma solidity ^0.7.6; interface ITestRegistrar { function register(bytes32 label, address owner) external; diff --git a/contracts/token/GraphToken.sol b/packages/contracts/contracts/token/GraphToken.sol similarity index 86% rename from contracts/token/GraphToken.sol rename to packages/contracts/contracts/token/GraphToken.sol index fa9736724..53496b9a5 100644 --- a/contracts/token/GraphToken.sol +++ b/packages/contracts/contracts/token/GraphToken.sol @@ -1,6 +1,6 @@ -// SPDX-License-Identifier: MIT +// SPDX-License-Identifier: GPL-2.0-or-later -pragma solidity ^0.7.3; +pragma solidity ^0.7.6; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20Burnable.sol"; @@ -28,16 +28,13 @@ contract GraphToken is Governed, ERC20, ERC20Burnable { // -- EIP712 -- // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-712.md#definition-of-domainseparator - bytes32 private constant DOMAIN_TYPE_HASH = keccak256( - "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract,bytes32 salt)" - ); + bytes32 private constant DOMAIN_TYPE_HASH = + keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract,bytes32 salt)"); bytes32 private constant DOMAIN_NAME_HASH = keccak256("Graph Token"); bytes32 private constant DOMAIN_VERSION_HASH = keccak256("0"); - bytes32 - private constant DOMAIN_SALT = 0x51f3d585afe6dfeb2af01bba0889a36c1db03beec88c6a4d0c53817069026afa; // Randomly generated salt - bytes32 private constant PERMIT_TYPEHASH = keccak256( - "Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)" - ); + bytes32 private constant DOMAIN_SALT = 0x51f3d585afe6dfeb2af01bba0889a36c1db03beec88c6a4d0c53817069026afa; // Randomly generated salt + bytes32 private constant PERMIT_TYPEHASH = + keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"); // -- State -- @@ -104,16 +101,7 @@ contract GraphToken is Governed, ERC20, ERC20Burnable { abi.encodePacked( "\x19\x01", DOMAIN_SEPARATOR, - keccak256( - abi.encode( - PERMIT_TYPEHASH, - _owner, - _spender, - _value, - nonces[_owner], - _deadline - ) - ) + keccak256(abi.encode(PERMIT_TYPEHASH, _owner, _spender, _value, nonces[_owner], _deadline)) ) ); nonces[_owner] = nonces[_owner].add(1); diff --git a/packages/contracts/contracts/token/IGraphToken.sol b/packages/contracts/contracts/token/IGraphToken.sol new file mode 100644 index 000000000..df3b7643f --- /dev/null +++ b/packages/contracts/contracts/token/IGraphToken.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.7.6 || 0.8.27; + +import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; + +interface IGraphToken is IERC20 { + // -- Mint and Burn -- + + function burn(uint256 amount) external; + + function burnFrom(address _from, uint256 amount) external; + + function mint(address _to, uint256 _amount) external; + + // -- Mint Admin -- + + function addMinter(address _account) external; + + function removeMinter(address _account) external; + + function renounceMinter() external; + + function isMinter(address _account) external view returns (bool); + + // -- Permit -- + + function permit( + address _owner, + address _spender, + uint256 _value, + uint256 _deadline, + uint8 _v, + bytes32 _r, + bytes32 _s + ) external; + + // -- Allowance -- + + function increaseAllowance(address spender, uint256 addedValue) external returns (bool); + + function decreaseAllowance(address spender, uint256 subtractedValue) external returns (bool); +} diff --git a/packages/contracts/contracts/upgrades/GraphProxy.sol b/packages/contracts/contracts/upgrades/GraphProxy.sol new file mode 100644 index 000000000..d6fbfac7f --- /dev/null +++ b/packages/contracts/contracts/upgrades/GraphProxy.sol @@ -0,0 +1,204 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.7.6 || 0.8.27; + +import { GraphProxyStorage } from "./GraphProxyStorage.sol"; + +import { IGraphProxy } from "./IGraphProxy.sol"; + +/** + * @title Graph Proxy + * @dev Graph Proxy contract used to delegate call implementation contracts and support upgrades. + * This contract should NOT define storage as it is managed by GraphProxyStorage. + * This contract implements a proxy that is upgradeable by an admin. + * https://docs.openzeppelin.com/upgrades-plugins/1.x/proxies#transparent-proxies-and-function-clashes + */ +contract GraphProxy is GraphProxyStorage, IGraphProxy { + /** + * @dev Modifier used internally that will delegate the call to the implementation unless + * the sender is the admin. + */ + modifier ifAdmin() { + if (msg.sender == _getAdmin()) { + _; + } else { + _fallback(); + } + } + + /** + * @dev Modifier used internally that will delegate the call to the implementation unless + * the sender is the admin or pending implementation. + */ + modifier ifAdminOrPendingImpl() { + if (msg.sender == _getAdmin() || msg.sender == _getPendingImplementation()) { + _; + } else { + _fallback(); + } + } + + /** + * @notice GraphProxy contract constructor. + * @param _impl Address of the initial implementation + * @param _admin Address of the proxy admin + */ + constructor(address _impl, address _admin) { + assert(ADMIN_SLOT == bytes32(uint256(keccak256("eip1967.proxy.admin")) - 1)); + assert(IMPLEMENTATION_SLOT == bytes32(uint256(keccak256("eip1967.proxy.implementation")) - 1)); + assert(PENDING_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256("eip1967.proxy.pendingImplementation")) - 1)); + + _setAdmin(_admin); + _setPendingImplementation(_impl); + } + + /** + * @notice Fallback function that delegates calls to implementation. Will run if call data + * is empty. + */ + receive() external payable { + _fallback(); + } + + /** + * @notice Fallback function that delegates calls to implementation. Will run if no other + * function in the contract matches the call data. + */ + fallback() external payable { + _fallback(); + } + + /** + * @notice Get the current admin + * + * @dev NOTE: Only the admin and implementation can call this function. + * + * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the + * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. + * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103` + * + * @return The address of the current admin + */ + function admin() external override ifAdminOrPendingImpl returns (address) { + return _getAdmin(); + } + + /** + * @notice Get the current implementation. + * + * @dev NOTE: Only the admin can call this function. + * + * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the + * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. + * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc` + * + * @return The address of the current implementation for this proxy + */ + function implementation() external override ifAdminOrPendingImpl returns (address) { + return _getImplementation(); + } + + /** + * @notice Get the current pending implementation. + * + * @dev NOTE: Only the admin can call this function. + * + * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the + * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. + * `0x9e5eddc59e0b171f57125ab86bee043d9128098c3a6b9adb4f2e86333c2f6f8c` + * + * @return The address of the current pending implementation for this proxy + */ + function pendingImplementation() external override ifAdminOrPendingImpl returns (address) { + return _getPendingImplementation(); + } + + /** + * @notice Changes the admin of the proxy. + * + * @dev NOTE: Only the admin can call this function. + * + * @param _newAdmin Address of the new admin + */ + function setAdmin(address _newAdmin) external override ifAdmin { + require(_newAdmin != address(0), "Admin cant be the zero address"); + _setAdmin(_newAdmin); + } + + /** + * @notice Upgrades to a new implementation contract. + * @dev NOTE: Only the admin can call this function. + * @param _newImplementation Address of implementation contract + */ + function upgradeTo(address _newImplementation) external override ifAdmin { + _setPendingImplementation(_newImplementation); + } + + /** + * @notice Admin function for new implementation to accept its role as implementation. + */ + function acceptUpgrade() external override ifAdminOrPendingImpl { + _acceptUpgrade(); + } + + /** + * @notice Admin function for new implementation to accept its role as implementation, + * calling a function on the new implementation. + * @param data Calldata (including selector) for the function to delegatecall into the implementation + */ + function acceptUpgradeAndCall(bytes calldata data) external override ifAdminOrPendingImpl { + _acceptUpgrade(); + // solhint-disable-next-line avoid-low-level-calls + (bool success, ) = _getImplementation().delegatecall(data); + require(success, "Impl call failed"); + } + + /** + * @dev Admin function for new implementation to accept its role as implementation. + */ + function _acceptUpgrade() internal { + address _pendingImplementation = _getPendingImplementation(); + require(_pendingImplementation != address(0), "Impl cannot be zero address"); + require(msg.sender == _pendingImplementation, "Only pending implementation"); + + _setImplementation(_pendingImplementation); + _setPendingImplementation(address(0)); + } + + /** + * @dev Delegates the current call to implementation. + * This function does not return to its internal call site, it will return directly to the + * external caller. + */ + function _fallback() internal { + require(msg.sender != _getAdmin(), "Cannot fallback to proxy target"); + + // solhint-disable-next-line no-inline-assembly + assembly { + // (a) get free memory pointer + let ptr := mload(0x40) + + // (b) get address of the implementation + let impl := and(sload(IMPLEMENTATION_SLOT), 0xffffffffffffffffffffffffffffffffffffffff) + + // (1) copy incoming call data + calldatacopy(ptr, 0, calldatasize()) + + // (2) forward call to logic contract + let result := delegatecall(gas(), impl, ptr, calldatasize(), 0, 0) + let size := returndatasize() + + // (3) retrieve return data + returndatacopy(ptr, 0, size) + + // (4) forward return data back to caller + switch result + case 0 { + revert(ptr, size) + } + default { + return(ptr, size) + } + } + } +} diff --git a/packages/contracts/contracts/upgrades/GraphProxyAdmin.sol b/packages/contracts/contracts/upgrades/GraphProxyAdmin.sol new file mode 100644 index 000000000..db8e9dcb3 --- /dev/null +++ b/packages/contracts/contracts/upgrades/GraphProxyAdmin.sol @@ -0,0 +1,106 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.7.6 || 0.8.27; + +import { Governed } from "../governance/Governed.sol"; + +import { IGraphProxy } from "./IGraphProxy.sol"; +import { GraphUpgradeable } from "./GraphUpgradeable.sol"; + +/** + * @title GraphProxyAdmin + * @dev This is the owner of upgradeable proxy contracts. + * Proxy contracts use a TransparentProxy pattern, any admin related call + * like upgrading a contract or changing the admin needs to be send through + * this contract. + */ +contract GraphProxyAdmin is Governed { + /** + * @notice Contract constructor. + */ + constructor() { + Governed._initialize(msg.sender); + } + + /** + * @notice Returns the current implementation of a proxy. + * @dev This is needed because only the proxy admin can query it. + * @param _proxy Address of the proxy for which to get the implementation. + * @return The address of the current implementation of the proxy. + */ + function getProxyImplementation(IGraphProxy _proxy) external view returns (address) { + // We need to manually run the static call since the getter cannot be flagged as view + // bytes4(keccak256("implementation()")) == 0x5c60da1b + (bool success, bytes memory returndata) = address(_proxy).staticcall(hex"5c60da1b"); + require(success, "Proxy impl call failed"); + return abi.decode(returndata, (address)); + } + + /** + * @notice Returns the pending implementation of a proxy. + * @dev This is needed because only the proxy admin can query it. + * @param _proxy Address of the proxy for which to get the pending implementation. + * @return The address of the pending implementation of the proxy. + */ + function getProxyPendingImplementation(IGraphProxy _proxy) external view returns (address) { + // We need to manually run the static call since the getter cannot be flagged as view + // bytes4(keccak256("pendingImplementation()")) == 0x396f7b23 + (bool success, bytes memory returndata) = address(_proxy).staticcall(hex"396f7b23"); + require(success, "Proxy pendingImpl call failed"); + return abi.decode(returndata, (address)); + } + + /** + * @notice Returns the admin of a proxy. Only the admin can query it. + * @param _proxy Address of the proxy for which to get the admin. + * @return The address of the current admin of the proxy. + */ + function getProxyAdmin(IGraphProxy _proxy) external view returns (address) { + // We need to manually run the static call since the getter cannot be flagged as view + // bytes4(keccak256("admin()")) == 0xf851a440 + (bool success, bytes memory returndata) = address(_proxy).staticcall(hex"f851a440"); + require(success, "Proxy admin call failed"); + return abi.decode(returndata, (address)); + } + + /** + * @notice Changes the admin of a proxy. + * @param _proxy Proxy to change admin. + * @param _newAdmin Address to transfer proxy administration to. + */ + function changeProxyAdmin(IGraphProxy _proxy, address _newAdmin) external onlyGovernor { + _proxy.setAdmin(_newAdmin); + } + + /** + * @notice Upgrades a proxy to the newest implementation of a contract. + * @param _proxy Proxy to be upgraded. + * @param _implementation the address of the Implementation. + */ + function upgrade(IGraphProxy _proxy, address _implementation) external onlyGovernor { + _proxy.upgradeTo(_implementation); + } + + /** + * @notice Accepts a proxy. + * @param _implementation Address of the implementation accepting the proxy. + * @param _proxy Address of the proxy being accepted. + */ + function acceptProxy(GraphUpgradeable _implementation, IGraphProxy _proxy) external onlyGovernor { + _implementation.acceptProxy(_proxy); + } + + /** + * @notice Accepts a proxy and call a function on the implementation. + * @param _implementation Address of the implementation accepting the proxy. + * @param _proxy Address of the proxy being accepted. + * @param _data Encoded function to call on the implementation after accepting the proxy. + */ + function acceptProxyAndCall( + GraphUpgradeable _implementation, + IGraphProxy _proxy, + bytes calldata _data + ) external onlyGovernor { + _implementation.acceptProxyAndCall(_proxy, _data); + } +} diff --git a/packages/contracts/contracts/upgrades/GraphProxyStorage.sol b/packages/contracts/contracts/upgrades/GraphProxyStorage.sol new file mode 100644 index 000000000..7871e4996 --- /dev/null +++ b/packages/contracts/contracts/upgrades/GraphProxyStorage.sol @@ -0,0 +1,142 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.7.6 || 0.8.27; + +/** + * @title Graph Proxy Storage + * @dev Contract functions related to getting and setting proxy storage. + * This contract does not actually define state variables managed by the compiler + * but uses fixed slot locations. + */ +abstract contract GraphProxyStorage { + /** + * @dev Storage slot with the address of the current implementation. + * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is + * validated in the constructor. + */ + bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; + + /** + * @dev Storage slot with the address of the pending implementation. + * This is the keccak-256 hash of "eip1967.proxy.pendingImplementation" subtracted by 1, and is + * validated in the constructor. + */ + bytes32 internal constant PENDING_IMPLEMENTATION_SLOT = + 0x9e5eddc59e0b171f57125ab86bee043d9128098c3a6b9adb4f2e86333c2f6f8c; + + /** + * @dev Storage slot with the admin of the contract. + * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is + * validated in the constructor. + */ + bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103; + + /** + * @dev Emitted when pendingImplementation is changed. + */ + event PendingImplementationUpdated( + address indexed oldPendingImplementation, + address indexed newPendingImplementation + ); + + /** + * @dev Emitted when pendingImplementation is accepted, + * which means contract implementation is updated. + */ + event ImplementationUpdated(address indexed oldImplementation, address indexed newImplementation); + + /** + * @dev Emitted when the admin account has changed. + */ + event AdminUpdated(address indexed oldAdmin, address indexed newAdmin); + + /** + * @dev Modifier to check whether the `msg.sender` is the admin. + */ + modifier onlyAdmin() { + require(msg.sender == _getAdmin(), "Caller must be admin"); + _; + } + + /** + * @return adm The admin slot. + */ + function _getAdmin() internal view returns (address adm) { + bytes32 slot = ADMIN_SLOT; + // solhint-disable-next-line no-inline-assembly + assembly { + adm := sload(slot) + } + } + + /** + * @dev Sets the address of the proxy admin. + * @param _newAdmin Address of the new proxy admin + */ + function _setAdmin(address _newAdmin) internal { + address oldAdmin = _getAdmin(); + bytes32 slot = ADMIN_SLOT; + // solhint-disable-next-line no-inline-assembly + assembly { + sstore(slot, _newAdmin) + } + + emit AdminUpdated(oldAdmin, _newAdmin); + } + + /** + * @dev Returns the current implementation. + * @return impl Address of the current implementation + */ + function _getImplementation() internal view returns (address impl) { + bytes32 slot = IMPLEMENTATION_SLOT; + // solhint-disable-next-line no-inline-assembly + assembly { + impl := sload(slot) + } + } + + /** + * @dev Returns the current pending implementation. + * @return impl Address of the current pending implementation + */ + function _getPendingImplementation() internal view returns (address impl) { + bytes32 slot = PENDING_IMPLEMENTATION_SLOT; + // solhint-disable-next-line no-inline-assembly + assembly { + impl := sload(slot) + } + } + + /** + * @dev Sets the implementation address of the proxy. + * @param _newImplementation Address of the new implementation + */ + function _setImplementation(address _newImplementation) internal { + address oldImplementation = _getImplementation(); + + bytes32 slot = IMPLEMENTATION_SLOT; + // solhint-disable-next-line no-inline-assembly + assembly { + sstore(slot, _newImplementation) + } + + emit ImplementationUpdated(oldImplementation, _newImplementation); + } + + /** + * @dev Sets the pending implementation address of the proxy. + * @param _newImplementation Address of the new pending implementation + */ + function _setPendingImplementation(address _newImplementation) internal { + address oldPendingImplementation = _getPendingImplementation(); + + bytes32 slot = PENDING_IMPLEMENTATION_SLOT; + // solhint-disable-next-line no-inline-assembly + assembly { + sstore(slot, _newImplementation) + } + + emit PendingImplementationUpdated(oldPendingImplementation, _newImplementation); + } +} diff --git a/packages/contracts/contracts/upgrades/GraphUpgradeable.sol b/packages/contracts/contracts/upgrades/GraphUpgradeable.sol new file mode 100644 index 000000000..60dfbe888 --- /dev/null +++ b/packages/contracts/contracts/upgrades/GraphUpgradeable.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.7.6 || 0.8.27; + +import { IGraphProxy } from "./IGraphProxy.sol"; + +/** + * @title Graph Upgradeable + * @dev This contract is intended to be inherited from upgradeable contracts. + */ +abstract contract GraphUpgradeable { + /** + * @dev Storage slot with the address of the current implementation. + * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is + * validated in the constructor. + */ + bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; + + /** + * @dev Check if the caller is the proxy admin. + */ + modifier onlyProxyAdmin(IGraphProxy _proxy) { + require(msg.sender == _proxy.admin(), "Caller must be the proxy admin"); + _; + } + + /** + * @dev Check if the caller is the implementation. + */ + modifier onlyImpl() { + require(msg.sender == _implementation(), "Only implementation"); + _; + } + + /** + * @dev Returns the current implementation. + * @return impl Address of the current implementation + */ + function _implementation() internal view returns (address impl) { + bytes32 slot = IMPLEMENTATION_SLOT; + // solhint-disable-next-line no-inline-assembly + assembly { + impl := sload(slot) + } + } + + /** + * @notice Accept to be an implementation of proxy. + * @param _proxy Proxy to accept + */ + function acceptProxy(IGraphProxy _proxy) external onlyProxyAdmin(_proxy) { + _proxy.acceptUpgrade(); + } + + /** + * @notice Accept to be an implementation of proxy and then call a function from the new + * implementation as specified by `_data`, which should be an encoded function call. This is + * useful to initialize new storage variables in the proxied contract. + * @param _proxy Proxy to accept + * @param _data Calldata for the initialization function call (including selector) + */ + function acceptProxyAndCall(IGraphProxy _proxy, bytes calldata _data) external onlyProxyAdmin(_proxy) { + _proxy.acceptUpgradeAndCall(_data); + } +} diff --git a/contracts/upgrades/IGraphProxy.sol b/packages/contracts/contracts/upgrades/IGraphProxy.sol similarity index 84% rename from contracts/upgrades/IGraphProxy.sol rename to packages/contracts/contracts/upgrades/IGraphProxy.sol index 7f1dcca13..4f501ed7c 100644 --- a/contracts/upgrades/IGraphProxy.sol +++ b/packages/contracts/contracts/upgrades/IGraphProxy.sol @@ -1,6 +1,6 @@ -// SPDX-License-Identifier: MIT +// SPDX-License-Identifier: GPL-2.0-or-later -pragma solidity ^0.7.3; +pragma solidity ^0.7.6 || 0.8.27; interface IGraphProxy { function admin() external returns (address); diff --git a/packages/contracts/contracts/utils/TokenUtils.sol b/packages/contracts/contracts/utils/TokenUtils.sol new file mode 100644 index 000000000..fb125613a --- /dev/null +++ b/packages/contracts/contracts/utils/TokenUtils.sol @@ -0,0 +1,48 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.7.6 || 0.8.27; + +import "../token/IGraphToken.sol"; + +/** + * @title TokenUtils library + * @notice This library contains utility functions for handling tokens (transfers and burns). + * It is specifically adapted for the GraphToken, so does not need to handle edge cases + * for other tokens. + */ +library TokenUtils { + /** + * @dev Pull tokens from an address to this contract. + * @param _graphToken Token to transfer + * @param _from Address sending the tokens + * @param _amount Amount of tokens to transfer + */ + function pullTokens(IGraphToken _graphToken, address _from, uint256 _amount) internal { + if (_amount > 0) { + require(_graphToken.transferFrom(_from, address(this), _amount), "!transfer"); + } + } + + /** + * @dev Push tokens from this contract to a receiving address. + * @param _graphToken Token to transfer + * @param _to Address receiving the tokens + * @param _amount Amount of tokens to transfer + */ + function pushTokens(IGraphToken _graphToken, address _to, uint256 _amount) internal { + if (_amount > 0) { + require(_graphToken.transfer(_to, _amount), "!transfer"); + } + } + + /** + * @dev Burn tokens held by this contract. + * @param _graphToken Token to burn + * @param _amount Amount of tokens to burn + */ + function burnTokens(IGraphToken _graphToken, uint256 _amount) internal { + if (_amount > 0) { + _graphToken.burn(_amount); + } + } +} diff --git a/packages/contracts/eslint.config.js b/packages/contracts/eslint.config.js new file mode 100644 index 000000000..566196117 --- /dev/null +++ b/packages/contracts/eslint.config.js @@ -0,0 +1,19 @@ +const config = require('eslint-graph-config') + +module.exports = [ + ...config.default, + { + rules: { + '@typescript-eslint/no-unsafe-assignment': 'off', + '@typescript-eslint/no-var-requires': 'off', + '@typescript-eslint/no-unsafe-call': 'off', + '@typescript-eslint/no-unsafe-member-access': 'off', + '@typescript-eslint/no-unsafe-argument': 'off', + '@typescript-eslint/no-unsafe-return': 'off', + '@typescript-eslint/no-redundant-type-constituents': 'off', + }, + }, + { + ignores: ['**/reports/*'], + }, +] diff --git a/packages/contracts/hardhat.config.ts b/packages/contracts/hardhat.config.ts new file mode 100644 index 000000000..cdc054482 --- /dev/null +++ b/packages/contracts/hardhat.config.ts @@ -0,0 +1,243 @@ +import path from 'path' +import fs from 'fs' +import * as dotenv from 'dotenv' +import { execSync } from 'child_process' + +import { HardhatUserConfig } from 'hardhat/types' + +dotenv.config() + +// Plugins +import '@nomiclabs/hardhat-ethers' +import '@nomiclabs/hardhat-etherscan' +import '@nomiclabs/hardhat-waffle' +import 'hardhat-abi-exporter' +import 'hardhat-gas-reporter' +import 'hardhat-contract-sizer' +import 'hardhat-tracer' +import '@tenderly/hardhat-tenderly' +import '@openzeppelin/hardhat-upgrades' +import '@openzeppelin/hardhat-defender' +import '@typechain/hardhat' +import 'solidity-coverage' +import 'hardhat-storage-layout' + +// Tasks + +const SKIP_LOAD = process.env.SKIP_LOAD === 'true' + +function loadTasks() { + require('@graphprotocol/sdk/gre') + ;['contract', 'bridge', 'deployment', 'migrate', 'verify', 'e2e'].forEach((folder) => { + const tasksPath = path.join(__dirname, 'tasks', folder) + fs.readdirSync(tasksPath) + .filter(pth => pth.includes('.ts')) + .forEach((task) => { + require(`${tasksPath}/${task}`) + }) + }) +} + +if (fs.existsSync(path.join(__dirname, 'build', 'types'))) { + loadTasks() +} else if (!SKIP_LOAD) { + execSync('pnpm build', { stdio: 'inherit' }) + loadTasks() +} + +// Networks + +interface NetworkConfig { + network: string + chainId: number + url?: string + gas?: number | 'auto' + gasPrice?: number | 'auto' + graphConfig?: string +} + +const networkConfigs: NetworkConfig[] = [ + { network: 'mainnet', chainId: 1, graphConfig: 'config/graph.mainnet.yml' }, + { network: 'rinkeby', chainId: 4, graphConfig: 'config/graph.rinkeby.yml' }, + { network: 'goerli', chainId: 5, graphConfig: 'config/graph.goerli.yml' }, + { network: 'kovan', chainId: 42 }, + { network: 'arbitrum-rinkeby', chainId: 421611, url: 'https://rinkeby.arbitrum.io/rpc' }, + { network: 'sepolia', chainId: 11155111, graphConfig: 'config/graph.sepolia.yml' }, + { + network: 'arbitrum-one', + chainId: 42161, + url: 'https://arb1.arbitrum.io/rpc', + graphConfig: 'config/graph.arbitrum-one.yml', + }, + { + network: 'arbitrum-goerli', + chainId: 421613, + url: 'https://goerli-rollup.arbitrum.io/rpc', + graphConfig: 'config/graph.arbitrum-goerli.yml', + }, + { + network: 'arbitrum-sepolia', + chainId: 421614, + url: 'https://sepolia-rollup.arbitrum.io/rpcblock', + graphConfig: 'config/graph.arbitrum-sepolia.yml', + }, +] + +function getAccountsKeys() { + if (process.env.MNEMONIC) return { mnemonic: process.env.MNEMONIC } + if (process.env.PRIVATE_KEY) return [process.env.PRIVATE_KEY] + return 'remote' +} + +function getDefaultProviderURL(network: string) { + return `https://${network}.infura.io/v3/${process.env.INFURA_KEY}` +} + +function setupNetworkProviders(hardhatConfig) { + for (const netConfig of networkConfigs) { + hardhatConfig.networks[netConfig.network] = { + chainId: netConfig.chainId, + url: netConfig.url ? netConfig.url : getDefaultProviderURL(netConfig.network), + gas: netConfig.gas || 'auto', + gasPrice: netConfig.gasPrice || 'auto', + accounts: getAccountsKeys(), + } + if (netConfig.graphConfig) { + hardhatConfig.networks[netConfig.network].graphConfig = netConfig.graphConfig + } + } +} + +// Config + +const DEFAULT_TEST_MNEMONIC + = 'myth like bonus scare over problem client lizard pioneer submit female collect' + +const DEFAULT_L2_TEST_MNEMONIC + = 'urge never interest human any economy gentle canvas anxiety pave unlock find' + +const config: HardhatUserConfig = { + paths: { + sources: './contracts', + tests: './test/unit', + artifacts: './build/contracts', + }, + solidity: { + compilers: [ + { + version: '0.7.6', + settings: { + optimizer: { + enabled: true, + runs: 200, + }, + metadata: { + useLiteralContent: true, + }, + outputSelection: { + '*': { + '*': ['storageLayout', 'metadata'], + }, + }, + }, + }, + ], + }, + defaultNetwork: 'hardhat', + networks: { + hardhat: { + chainId: 1337, + loggingEnabled: false, + gas: 12000000, + gasPrice: 'auto', + initialBaseFeePerGas: 0, + blockGasLimit: 12000000, + accounts: { + mnemonic: DEFAULT_TEST_MNEMONIC, + }, + hardfork: 'london', + }, + localhost: { + chainId: 1337, + url: 'http://127.0.0.1:8545', + accounts: + process.env.FORK === 'true' ? getAccountsKeys() : { mnemonic: DEFAULT_TEST_MNEMONIC }, + graphConfig: 'config/graph.localhost.yml', + addressBook: 'addresses-local.json', + }, + localnitrol1: { + chainId: 1337, + url: 'http://127.0.0.1:8545', + accounts: { mnemonic: DEFAULT_TEST_MNEMONIC }, + graphConfig: 'config/graph.localhost.yml', + }, + localnitrol2: { + chainId: 412346, + url: 'http://127.0.0.1:8547', + accounts: { mnemonic: DEFAULT_L2_TEST_MNEMONIC }, + graphConfig: 'config/graph.arbitrum-localhost.yml', + }, + }, + graph: { + addressBook: process.env.ADDRESS_BOOK ?? 'addresses.json', + l1GraphConfig: process.env.L1_GRAPH_CONFIG ?? 'config/graph.mainnet.yml', + l2GraphConfig: process.env.L2_GRAPH_CONFIG ?? 'config/graph.arbitrum-one.yml', + fork: process.env.FORK === 'true', + disableSecureAccounts: process.env.DISABLE_SECURE_ACCOUNTS === 'true', + }, + etherscan: { + apiKey: { + mainnet: process.env.ETHERSCAN_API_KEY, + rinkeby: process.env.ETHERSCAN_API_KEY, + goerli: process.env.ETHERSCAN_API_KEY, + kovan: process.env.ETHERSCAN_API_KEY, + sepolia: process.env.ETHERSCAN_API_KEY, + arbitrumOne: process.env.ARBISCAN_API_KEY, + arbitrumGoerli: process.env.ARBISCAN_API_KEY, + arbitrumSepolia: process.env.ARBISCAN_API_KEY, + }, + customChains: [ + { + network: 'arbitrumSepolia', + chainId: 421614, + urls: { + apiURL: 'https://api-sepolia.arbiscan.io/api', + browserURL: 'https://sepolia.arbiscan.io', + }, + }, + ], + }, + gasReporter: { + enabled: process.env.REPORT_GAS ? true : false, + showTimeSpent: true, + currency: 'USD', + outputFile: 'reports/gas-report.log', + }, + typechain: { + outDir: 'build/types', + target: 'ethers-v5', + }, + abiExporter: { + path: './build/abis', + clear: true, + flat: true, + runOnCompile: true, + }, + tenderly: { + project: 'graph-network', + username: 'graphprotocol', + }, + contractSizer: { + alphaSort: true, + runOnCompile: false, + disambiguatePaths: false, + }, + defender: { + apiKey: process.env.DEFENDER_API_KEY, + apiSecret: process.env.DEFENDER_API_SECRET, + }, +} + +setupNetworkProviders(config) + +export default config diff --git a/index.d.ts b/packages/contracts/index.d.ts similarity index 100% rename from index.d.ts rename to packages/contracts/index.d.ts diff --git a/packages/contracts/package.json b/packages/contracts/package.json new file mode 100644 index 000000000..b18665f61 --- /dev/null +++ b/packages/contracts/package.json @@ -0,0 +1,139 @@ +{ + "name": "@graphprotocol/contracts", + "version": "7.1.2", + "publishConfig": { + "access": "public" + }, + "description": "Contracts for the Graph Protocol", + "directories": { + "test": "test" + }, + "main": "dist/types/index.js", + "types": "build/types/index.d.ts", + "files": [ + "dist/**/*", + "build/**/*", + "README.md", + "addresses.json" + ], + "devDependencies": { + "@arbitrum/sdk": "~3.1.13", + "@defi-wonderland/smock": "~2.3.0", + "@ethersproject/abi": "^5.8.0", + "@ethersproject/abstract-provider": "^5.8.0", + "@ethersproject/bytes": "^5.8.0", + "@ethersproject/experimental": "^5.6.0", + "@ethersproject/providers": "^5.8.0", + "@graphprotocol/common-ts": "^1.8.3", + "@graphprotocol/sdk": "0.5.4", + "@nomicfoundation/hardhat-network-helpers": "^1.0.0", + "@nomiclabs/hardhat-ethers": "^2.2.3", + "@nomiclabs/hardhat-etherscan": "^3.1.7", + "@nomiclabs/hardhat-waffle": "2.0.3", + "@openzeppelin/contracts": "^3.4.1", + "@openzeppelin/contracts-upgradeable": "3.4.2", + "@openzeppelin/hardhat-defender": "^1.8.1", + "@openzeppelin/hardhat-upgrades": "^1.6.0", + "@tenderly/hardhat-tenderly": "1.0.13", + "@typechain/ethers-v5": "^7.0.0", + "@typechain/hardhat": "^2.0.0", + "@types/bs58": "^4.0.1", + "@types/chai": "4.3.4", + "@types/chai-as-promised": "^7.1.5", + "@types/glob": "^7.2.0", + "@types/inquirer": "^7.3.1", + "@types/minimist": "^1.2.1", + "@types/mocha": "^8.2.2", + "@types/node": "^20.9.0", + "@types/sinon-chai": "^3.2.12", + "@types/winston": "^2.4.4", + "@types/yargs": "^16.0.0", + "@urql/core": "^2.1.3", + "arbos-precompiles": "^1.0.2", + "axios": "^1.8.4", + "bignumber.js": "9.1.2", + "chai": "4.3.4", + "chai-as-promised": "^7.1.1", + "cli-table": "^0.3.6", + "console-table-printer": "^2.11.1", + "dotenv": "^9.0.0", + "eslint": "^8.57.0", + "eslint-graph-config": "workspace:^0.0.1", + "ethereum-waffle": "^3.2.0", + "ethers": "^5.7.2", + "form-data": "^4.0.0", + "glob": "^8.0.3", + "graphql-tag": "^2.12.4", + "hardhat": "~2.14.0", + "hardhat-abi-exporter": "^2.2.0", + "hardhat-contract-sizer": "^2.0.3", + "hardhat-gas-reporter": "^1.0.4", + "hardhat-secure-accounts": "0.0.5", + "hardhat-storage-layout": "0.1.6", + "hardhat-tracer": "^1.0.0-alpha.6", + "inquirer": "^8.0.0", + "ipfs-http-client": "47.0.1", + "isomorphic-fetch": "^3.0.0", + "lint-staged": "^10.5.4", + "p-queue": "^6.6.1", + "prettier": "^3.2.5", + "prettier-plugin-solidity": "^1.3.1", + "solhint": "^4.1.1", + "solhint-graph-config": "workspace:^0.0.1", + "solhint-plugin-graph": "workspace:^0.0.1", + "solidity-coverage": "^0.7.16", + "ts-node": "^10.9.1", + "typechain": "^5.0.0", + "typescript": "^5.2.2", + "winston": "^3.3.3", + "yaml": "^1.10.2", + "yargs": "^17.0.0" + }, + "scripts": { + "prepack": "SKIP_LOAD=true scripts/build", + "build": "SKIP_LOAD=true scripts/build", + "clean": "rm -rf build/ cache/ dist/", + "compile": "hardhat compile", + "deploy": "pnpm predeploy && pnpm build && hardhat migrate", + "deploy-localhost": "pnpm build && hardhat migrate --force --skip-confirmation --disable-secure-accounts --network localhost --graph-config config/graph.localhost.yml --address-book addresses-local.json", + "predeploy": "scripts/predeploy", + "test": "scripts/test", + "test:e2e": "scripts/e2e", + "test:gas": "RUN_EVM=true REPORT_GAS=true scripts/test", + "test:coverage": "scripts/coverage", + "test:upgrade": "scripts/upgrade", + "lint": "pnpm lint:ts && pnpm lint:sol", + "lint:ts": "eslint '**/*.{js,ts}' --fix", + "lint:sol": "prettier --write 'contracts/**/*.sol' && solhint --fix --noPrompt contracts/**/*.sol --config solhint.config.js", + "analyze": "scripts/analyze", + "myth": "scripts/myth", + "flatten": "scripts/flatten && scripts/clean", + "typechain": "hardhat typechain", + "verify": "hardhat verify", + "size": "hardhat size-contracts" + }, + "lint-staged": { + "contracts/**/*.sol": [ + "pnpm lint:sol" + ], + "**/*.ts": [ + "pnpm lint:ts" + ], + "**/*.js": [ + "pnpm lint:ts" + ], + "**/*.json": [ + "pnpm lint:ts" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/graphprotocol/contracts.git" + }, + "author": "The Graph Team", + "license": "GPL-2.0-or-later", + "bugs": { + "url": "https://github.com/graphprotocol/contracts/issues" + }, + "homepage": "https://github.com/graphprotocol/contracts#readme" +} \ No newline at end of file diff --git a/packages/contracts/prettier.config.js b/packages/contracts/prettier.config.js new file mode 100644 index 000000000..5b8e866f2 --- /dev/null +++ b/packages/contracts/prettier.config.js @@ -0,0 +1,2 @@ +const prettierGraphConfig = require('solhint-graph-config/prettier') +module.exports = prettierGraphConfig diff --git a/packages/contracts/scripts/analyze b/packages/contracts/scripts/analyze new file mode 100755 index 000000000..5592f92aa --- /dev/null +++ b/packages/contracts/scripts/analyze @@ -0,0 +1,31 @@ +#!/bin/bash + +## Before running: +# This tool requires to have solc installed. +# Ensure that you have the binaries installed by pip3 in your path. +# Install: +# - https://github.com/crytic/slither#how-to-install +# Usage: +# - https://github.com/crytic/slither/wiki/Usage + +mkdir -p reports + +pip3 install --user slither-analyzer && \ +pnpm build && \ + +echo "Analyzing contracts..." +slither . \ + --hardhat-ignore-compile \ + --hardhat-artifacts-directory ./build/contracts \ + --sarif - \ + --filter-paths "contracts/bancor/.*|contracts/tests/.*|contracts/staking/libs/Exponential.*|contracts/staking/libs/LibFixedMath.*|contracts/staking/libs/MathUtils.*" \ + --exclude-dependencies \ + --exclude similar-names,naming-convention \ + --disable-color \ + &> reports/analyzer-report.sarif && \ +echo "Slither report generated at ./reports/analyzer-report.sarif" +echo "Checking ERC compliance..." +slither-check-erc build/flatten/GraphToken.sol GraphToken &> reports/analyzer-report-erc.log +echo "Compliance report generated at ./reports/analyzer-report-erc.log" + +echo "Done!" diff --git a/packages/contracts/scripts/build b/packages/contracts/scripts/build new file mode 100755 index 000000000..ee830bddf --- /dev/null +++ b/packages/contracts/scripts/build @@ -0,0 +1,17 @@ +#!/bin/bash + +TYPECHAIN_DIR=dist/types + +set -eo pipefail + +# Build contracts +pnpm clean +pnpm compile +tsc + +# Copy types and abis to distribution folder +cp -R build/types/* dist/build/types +cp -R build/abis/ dist/build/abis + +# Move compiled types ts +mv dist/build/types dist/types \ No newline at end of file diff --git a/packages/contracts/scripts/clean b/packages/contracts/scripts/clean new file mode 100755 index 000000000..28becb233 --- /dev/null +++ b/packages/contracts/scripts/clean @@ -0,0 +1,29 @@ +#!/bin/bash + +OUT_DIR="build/flatten" + +mkdir -p ${OUT_DIR} + +echo "Cleaning flattened contracts..." + +FLATTENED_FILES=( + "$OUT_DIR/Controller.sol" + "$OUT_DIR/GNS.sol" + "$OUT_DIR/ServiceRegistry.sol" + "$OUT_DIR/Curation.sol" + "$OUT_DIR/GraphCurationToken.sol" + "$OUT_DIR/Staking.sol" + "$OUT_DIR/RewardsManager.sol" + "$OUT_DIR/GraphToken.sol" + "$OUT_DIR/EpochManager.sol" + "$OUT_DIR/GraphProxy.sol" +) + +for path in ${FLATTENED_FILES[@]}; do + echo "Clean > ${path}" + sed -i \ + -e "s|pragma solidity.*||g" \ + -e "s|// SPDX-License-Identifier:.*||g" \ + -e 's|pragma abicoder v2;|//pragma abicoder v2;|g' \ + -e '1s|^|pragma abicoder v2;\n|' $path +done diff --git a/packages/contracts/scripts/coverage b/packages/contracts/scripts/coverage new file mode 100755 index 000000000..767ff0cd7 --- /dev/null +++ b/packages/contracts/scripts/coverage @@ -0,0 +1,13 @@ +#!/bin/bash + +set -eo pipefail + +pnpm build + +echo {} > addresses-local.json + +DISABLE_SECURE_ACCOUNTS=true \ +L1_GRAPH_CONFIG=config/graph.hardhat.yml \ +L2_GRAPH_CONFIG=config/graph.arbitrum-hardhat.yml \ +ADDRESS_BOOK=addresses-local.json \ + npx hardhat coverage $@ diff --git a/packages/contracts/scripts/e2e b/packages/contracts/scripts/e2e new file mode 100755 index 000000000..98978ccc3 --- /dev/null +++ b/packages/contracts/scripts/e2e @@ -0,0 +1,193 @@ +#!/bin/bash + +set -eo pipefail +source $(pwd)/scripts/evm + +### > SCRIPT CONFIG < +# Allow overriding config +ADDRESS_BOOK=${ADDRESS_BOOK:-"addresses-local.json"} +ARBITRUM_ADDRESS_BOOK=${ARBITRUM_ADDRESS_BOOK:-"arbitrum-addresses-local.json"} +ARBITRUM_DEPLOYMENT_FILE=${ARBITRUM_DEPLOYMENT_FILE:-"localNetwork.json"} + +L1_NETWORK=${L1_NETWORK} +L2_NETWORK=${L2_NETWORK} + +L1_GRAPH_CONFIG=${L1_GRAPH_CONFIG:-"config/graph.localhost.yml"} +L2_GRAPH_CONFIG=${L2_GRAPH_CONFIG:-"config/graph.arbitrum-localhost.yml"} + +echo "Running e2e tests" +echo "- Using address book: $ADDRESS_BOOK" + +if [[ -n "$L1_NETWORK" ]]; then + echo "- Using L1 network: $L1_NETWORK" + echo "- Using L1 config: $L1_GRAPH_CONFIG" +else + echo "- No L1_NETWORK provided, skipping L1 tests" +fi + +if [[ -n "$L2_NETWORK" ]]; then + echo "- Using L2 network: $L2_NETWORK" + echo "- Using L2 config: $L2_GRAPH_CONFIG" + echo "- Using arbitrum address book: $ARBITRUM_ADDRESS_BOOK" + echo "- Using arbitrum deployment file: $ARBITRUM_DEPLOYMENT_FILE" +else + echo "- No L2_NETWORK provided, skipping L2 tests" +fi + +if [[ -z "$L1_NETWORK" ]] && [[ -z "$L2_NETWORK" ]]; then + echo "Must specify one of L1_NETWORK or L2_NETWORK!" + exit 0 +fi + +if [[ "$L1_NETWORK" == "$L2_NETWORK" ]]; then + echo "L1_NETWORK and L2_NETWORK must be different networks!" + exit 0 +fi + +### > SCRIPT AUX FUNCTIONS < +function deploy() { + local NETWORK=$1 + local GRAPH_CONFIG=$2 + local ADDRESS_BOOK=$3 + + echo "Deploying protocol on $NETWORK" + + # Fund accounts if using nitro test nodes + if [[ "$NETWORK" == *"localnitro"* ]]; then + npx hardhat migrate:nitro:fund-accounts --network "$NETWORK" --graph-config "$GRAPH_CONFIG" --disable-secure-accounts + fi + + # Deploy protocol + npx hardhat migrate \ + --network "$NETWORK" \ + --disable-secure-accounts \ + --skip-confirmation \ + --force \ + --graph-config "$GRAPH_CONFIG" \ + --address-book "$ADDRESS_BOOK" +} + +function configure_bridge () { + local L1_NETWORK=$1 + local L1_GRAPH_CONFIG=$2 + local L2_NETWORK=$3 + local L2_GRAPH_CONFIG=$4 + local ADDRESS_BOOK=$5 + local ARBITRUM_ADDRESS_BOOK=$6 + local ARBITRUM_DEPLOYMENT_FILE=$7 + + # Copy required arbitrum contract addresses to the local arbitrum address book + if [[ "$L1_NETWORK" == *"localnitro"* ]]; then + npx hardhat migrate:nitro:address-book --deployment-file "$ARBITRUM_DEPLOYMENT_FILE" --arbitrum-address-book "$ARBITRUM_ADDRESS_BOOK" + fi + + npx hardhat migrate:bridge --network "$L1_NETWORK" --l1-graph-config "$L1_GRAPH_CONFIG" --l2-graph-config "$L2_GRAPH_CONFIG" --address-book "$ADDRESS_BOOK" --arbitrum-address-book "$ARBITRUM_ADDRESS_BOOK" --disable-secure-accounts +} + +function test_e2e () { + local NETWORK=$1 + local L1_GRAPH_CONFIG=$2 + local L2_GRAPH_CONFIG=$3 + local ADDRESS_BOOK=$4 + local SKIP_BRIDGE_TESTS=$5 + + if [[ -z "$SKIP_BRIDGE_TESTS" ]]; then + npx hardhat e2e --network "$NETWORK" --l1-graph-config "$L1_GRAPH_CONFIG" --l2-graph-config "$L2_GRAPH_CONFIG" --address-book "$ADDRESS_BOOK" + else + npx hardhat e2e --network "$NETWORK" --l1-graph-config "$L1_GRAPH_CONFIG" --l2-graph-config "$L2_GRAPH_CONFIG" --address-book "$ADDRESS_BOOK" --skip-bridge + fi +} + +function test_e2e_scenarios () { + local NETWORK=$1 + local L1_GRAPH_CONFIG=$2 + local L2_GRAPH_CONFIG=$3 + local ADDRESS_BOOK=$4 + + npx hardhat e2e:scenario create-subgraphs --network "$NETWORK" --l1-graph-config "$L1_GRAPH_CONFIG" --l2-graph-config "$L2_GRAPH_CONFIG" --address-book "$ADDRESS_BOOK" --disable-secure-accounts + npx hardhat e2e:scenario open-allocations --network "$NETWORK" --l1-graph-config "$L1_GRAPH_CONFIG" --l2-graph-config "$L2_GRAPH_CONFIG" --address-book "$ADDRESS_BOOK" --disable-secure-accounts + + # skip close-allocations for arbitrum testnodes as we can't advance epoch + if [[ "$NETWORK" != *"localnitro"* ]]; then + npx hardhat e2e:scenario close-allocations --network "$NETWORK" --l1-graph-config "$L1_GRAPH_CONFIG" --l2-graph-config "$L2_GRAPH_CONFIG" --address-book "$ADDRESS_BOOK" --disable-secure-accounts + fi +} + +function test_e2e_scenarios_bridge () { + local NETWORK=$1 + local L1_GRAPH_CONFIG=$2 + local L2_GRAPH_CONFIG=$3 + local ADDRESS_BOOK=$4 + + npx hardhat e2e:scenario send-grt-to-l2 --network "$NETWORK" --l1-graph-config "$L1_GRAPH_CONFIG" --l2-graph-config "$L2_GRAPH_CONFIG" --address-book "$ADDRESS_BOOK" --disable-secure-accounts +} + + +### > SCRIPT START < ### +## SETUP +# Compile contracts +pnpm build + +# Start evm +if [[ "$L1_NETWORK" == "localhost" || "$L2_NETWORK" == "localhost" ]]; then + evm_kill + evm_start +fi + +# Create address book if needed +if [[ ! -f "$ADDRESS_BOOK" ]]; then + echo '{}' > "$ADDRESS_BOOK" +fi + +# Reset arbitrum address book (just in case the deployment changed) +if [[ -f "$ARBITRUM_ADDRESS_BOOK" ]]; then + rm "$ARBITRUM_ADDRESS_BOOK" +fi +echo '{}' > "$ARBITRUM_ADDRESS_BOOK" + +# Reset arbitrum address book (just in case the deployment changed) +if [[ -f "$ARBITRUM_DEPLOYMENT_FILE" ]]; then + rm "$ARBITRUM_DEPLOYMENT_FILE" +fi + +## DEPLOY +# Deploy L1 +if [[ -n "$L1_NETWORK" ]]; then + deploy "$L1_NETWORK" "$L1_GRAPH_CONFIG" "$ADDRESS_BOOK" +fi + +# Deploy L2 +if [[ -n "$L2_NETWORK" ]]; then + deploy "$L2_NETWORK" "$L2_GRAPH_CONFIG" "$ADDRESS_BOOK" +fi + +# Configure bridge +if [[ -n "$L1_NETWORK" ]] && [[ -n "$L2_NETWORK" ]]; then + configure_bridge "$L1_NETWORK" "$L1_GRAPH_CONFIG" "$L2_NETWORK" "$L2_GRAPH_CONFIG" "$ADDRESS_BOOK" "$ARBITRUM_ADDRESS_BOOK" "$ARBITRUM_DEPLOYMENT_FILE" +fi + +## TEST +# Run e2e tests +if [[ -z "$L2_NETWORK" ]]; then + test_e2e "$L1_NETWORK" "$L1_GRAPH_CONFIG" "$L2_GRAPH_CONFIG" "$ADDRESS_BOOK" true +else + test_e2e "$L1_NETWORK" "$L1_GRAPH_CONFIG" "$L2_GRAPH_CONFIG" "$ADDRESS_BOOK" + test_e2e "$L2_NETWORK" "$L1_GRAPH_CONFIG" "$L2_GRAPH_CONFIG" "$ADDRESS_BOOK" +fi + +# Run scenario tests +test_e2e_scenarios "$L1_NETWORK" "$L1_GRAPH_CONFIG" "$L2_GRAPH_CONFIG" "$ADDRESS_BOOK" +if [[ -n "$L2_NETWORK" ]]; then + test_e2e_scenarios_bridge "$L1_NETWORK" "$L1_GRAPH_CONFIG" "$L2_GRAPH_CONFIG" "$ADDRESS_BOOK" + test_e2e_scenarios "$L2_NETWORK" "$L1_GRAPH_CONFIG" "$L2_GRAPH_CONFIG" "$ADDRESS_BOOK" +fi + +## Cleanup +# Exit error mode so the evm instance always gets killed +if [[ "$L1_NETWORK" == "localhost" || "$L2_NETWORK" == "localhost" ]]; then + set +e + result=0 + + evm_kill + exit $result +fi diff --git a/packages/contracts/scripts/evm b/packages/contracts/scripts/evm new file mode 100644 index 000000000..acbc07b80 --- /dev/null +++ b/packages/contracts/scripts/evm @@ -0,0 +1,65 @@ +#!/bin/bash + +TESTRPC_PORT=${TESTRPC_PORT:-8545} +MAX_RETRIES=120 + +evm_running() { + lsof -i:$TESTRPC_PORT -t > /dev/null +} + +evm_ping() { + PORT=$1 + curl --location --request POST "localhost:$PORT/" \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "jsonrpc":"2.0", + "method":"web3_clientVersion", + "params":[], + "id":1 + }' +} + +evm_automine() { + curl --location --request POST "localhost:$TESTRPC_PORT/" \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "jsonrpc":"2.0", + "method":"evm_setAutomine", + "params":[true], + "id":1 + }' + echo +} + +evm_start() { + local FORK_URL=$1 + local FORK_BLOCK_NUMBER="$2" + echo "Starting our own evm instance at port $TESTRPC_PORT" + if [[ -n "$FORK_URL" ]]; then + if [[ "$FORK_BLOCK_NUMBER" == "latest" ]]; then + npx hardhat node --port "$TESTRPC_PORT" --fork "$FORK_URL" > /dev/null & + else + npx hardhat node --port "$TESTRPC_PORT" --fork "$FORK_URL" --fork-block-number "$FORK_BLOCK_NUMBER" > /dev/null & + fi + else + npx hardhat node --port "$TESTRPC_PORT" > /dev/null & + fi + retries=0 + while ! evm_ping $TESTRPC_PORT; do + ((retries=retries+1)) + if [ $retries -gt $MAX_RETRIES ]; then + echo "Timeout waiting for evm instance" + exit 1 + fi + sleep 1 + done + + echo -e "\nEVM instance is ready" +} + +evm_kill() { + if evm_running; then + echo "Killing evm instance at port $TESTRPC_PORT" + kill -9 $(lsof -i:$TESTRPC_PORT -t) + fi +} diff --git a/packages/contracts/scripts/flatten b/packages/contracts/scripts/flatten new file mode 100755 index 000000000..da0eb50e1 --- /dev/null +++ b/packages/contracts/scripts/flatten @@ -0,0 +1,30 @@ +#!/bin/bash + +OUT_DIR="build/flatten" + +mkdir -p ${OUT_DIR} + +echo "Flattening contracts..." + +FILES=( + "contracts/governance/Controller.sol" + "contracts/discovery/GNS.sol" + "contracts/discovery/ServiceRegistry.sol" + "contracts/curation/Curation.sol" + "contracts/curation/GraphCurationToken.sol" + "contracts/staking/Staking.sol" + "contracts/rewards/RewardsManager.sol" + "contracts/token/GraphToken.sol" + "contracts/epochs/EpochManager.sol" + "contracts/upgrades/GraphProxy.sol" +) + +for path in ${FILES[@]}; do + IFS='/' + parts=( $path ) + name=${parts[${#parts[@]}-1]} + echo "Flatten > ${name}" + hardhat flatten "${path}" > "${OUT_DIR}/${name}" +done + +echo "Done!" diff --git a/packages/contracts/scripts/myth b/packages/contracts/scripts/myth new file mode 100755 index 000000000..5c4907e60 --- /dev/null +++ b/packages/contracts/scripts/myth @@ -0,0 +1,35 @@ +#!/bin/bash + +## Before running: +# This tool requires to have solc installed. +# Ensure that you have the binaries installed by pip3 in your path. +# Install: +# - https://github.com/ConsenSys/mythril#installation-and-setup +# Usage: +# - https://github.com/ConsenSys/mythril#usage + +pip3 install --user mythril && \ +pnpm build && \ +mkdir -p reports/myth + +echo "Myth Analysis..." + +start_time="$(date -u +%s)" + +for filename in build/flatten/*.sol; do + step_start_time="$(date -u +%s)" + echo "Scanning $filename ..." + myth analyze \ + --parallel-solving \ + --execution-timeout 30 \ + --solver-timeout 6000 \ + -o markdown "$filename" \ + &> "reports/myth/$(basename "$filename" .sol)-report.md" && \ + + end_time="$(date -u +%s)" + total_elapsed="$(($end_time-$start_time))" + step_elapsed="$(($end_time-$step_start_time))" + echo "> Took $step_elapsed seconds. Total elapsed: $total_elapsed seconds." +done + +echo "Done!" \ No newline at end of file diff --git a/packages/contracts/scripts/ops/20240208-migrate-legacy-subgraphs/data.json b/packages/contracts/scripts/ops/20240208-migrate-legacy-subgraphs/data.json new file mode 100644 index 000000000..9ec23ad5b --- /dev/null +++ b/packages/contracts/scripts/ops/20240208-migrate-legacy-subgraphs/data.json @@ -0,0 +1,342 @@ +{ + "data": { + "subgraphs": [ + { + "id": "HXFFyPyPtUrBC78p2bntnQu7rXPKo79GA5wQQ2YxLtTE", + "owner": { + "id": "0x4bb4c1b0745ef7b4642feeccd0740dec417ca0a0" + }, + "subgraphNumber": "3", + "metadataHash": "0x8cf2627713b50bce6551ad0451f73517cf731431daecd557114cc3cd6d0e1a4a" + }, + { + "id": "2Kr8drrtxmCN7vbpD6NYHSkNTNBv5pQRVtSNi4m4UvRF", + "owner": { + "id": "0xbeb1faa6e7e39c7d9bdab03a7a362fe9d73d7c61" + }, + "subgraphNumber": "0", + "metadataHash": "0x0c4b3bea53d0f01dd74d57ce5408aaadba15df4077cc3dc38085dd3796eeda03" + }, + { + "id": "2qdAX71bB2DfXbNKgpTv3b5gY4EnfYNQVpL71o7e7nEz", + "owner": { + "id": "0xefe232372e2e30951fa90d7a800d5938eedc935d" + }, + "subgraphNumber": "0", + "metadataHash": "0x5998fe5b6e689794aebf986beac1557367cba0f18d666bf8ec3aa037e6f08877" + }, + { + "id": "ba7J1xjrWGhVk5Hbonf42Fv6B9MZdzs6pN3nzeRfYzY", + "owner": { + "id": "0xadafc1e419d03c84661b00c022ecd0101f190172" + }, + "subgraphNumber": "0", + "metadataHash": "0xc0e9a91e403be87c55494a6e74f493a3da829cc9cd0bc603472212cb68641f3b" + }, + { + "id": "HJxHihBy3o1na3FDuMBPXL9ytwgP64wu3wDWZGWst3w2", + "owner": { + "id": "0x33d0d63a1f0da691b283aedd29875afeaf98e6ba" + }, + "subgraphNumber": "1", + "metadataHash": "0x2f44901f32e2d14363a5237687b8daa8e724e359df8378e997c84f1c387bc32d" + }, + { + "id": "Druh8CtrwDPwwWNdG2FPEZUeR3XP39BzvJ6QW2cZUX1N", + "owner": { + "id": "0x9f9b34c201efe888b02fdcab52422199957a0407" + }, + "subgraphNumber": "1", + "metadataHash": "0x2f44901f32e2d14363a5237687b8daa8e724e359df8378e997c84f1c387bc32d" + }, + { + "id": "DncWyiEVwDE7RDgDgbWupaqwLvnKC78xHVyRCc6Ys6M4", + "owner": { + "id": "0x33d0d63a1f0da691b283aedd29875afeaf98e6ba" + }, + "subgraphNumber": "0", + "metadataHash": "0x2f44901f32e2d14363a5237687b8daa8e724e359df8378e997c84f1c387bc32d" + }, + { + "id": "6N1FHPcJ1sQCBzmWrrNntLibGRvGHJiWWFRY7LJcmtHJ", + "owner": { + "id": "0x9f9b34c201efe888b02fdcab52422199957a0407" + }, + "subgraphNumber": "0", + "metadataHash": "0x2f44901f32e2d14363a5237687b8daa8e724e359df8378e997c84f1c387bc32d" + }, + { + "id": "okz4sT96je97dMiAJtPYmkBwDN9rov9mcMYTPskGtrq", + "owner": { + "id": "0x534a9ac3d3401f80800375680bded6a84137d296" + }, + "subgraphNumber": "4", + "metadataHash": "0xff8e9977885ae9aad139fcb0eefe78ab66ff374f86d491e878006c7d2a1c0070" + }, + { + "id": "HNWN5ymGqWGpvBbYFRyebhdGeSac3CDEssY3dpoMKgdK", + "owner": { + "id": "0xa508c16666c5b8981fa46eb32784fccc01942a71" + }, + "subgraphNumber": "0", + "metadataHash": "0xbf9b4090ff738cb433e532263065756284dc57c4092ef377f52a445e3322976d" + }, + { + "id": "Gv1rewdMuEeDQ9sWsWMjJfwKWrTxo5e19vgxr1br7Ut4", + "owner": { + "id": "0x673b6e9fe607f6ddf4a4f25b386b846c5c82995e" + }, + "subgraphNumber": "0", + "metadataHash": "0xddb85d0e63098b79b4340052b866c4d8eb638a81d74c6e135c979d23f4d1e93f" + }, + { + "id": "GNpbzUsp352dYJwP7jEL7yRJqA7uf4zfoLAHk5PiMMJu", + "owner": { + "id": "0xde0c83462a75036b74928865941b97d83a4bc994" + }, + "subgraphNumber": "0", + "metadataHash": "0x67e55fbda97b73cdb4a92f475568f27f054c6e97e8286c51256a79df9d3eb826" + }, + { + "id": "Fzw1DXaBaSeBAqg4R6qa8KZDTp7j1jpNhfAP9fpHkCGb", + "owner": { + "id": "0x9e795fc1c644ecad8031ed52856fd64b65a678ac" + }, + "subgraphNumber": "0", + "metadataHash": "0xa035f76b2dc73756a5209382a1fbf22fc714027d687439a478f7e1d38aba22ec" + }, + { + "id": "FTTVbaL4HBzjhzgstyLEhN3WrjEMDB8owqfLARNtJ2FX", + "owner": { + "id": "0xefe232372e2e30951fa90d7a800d5938eedc935d" + }, + "subgraphNumber": "4", + "metadataHash": "0x5998fe5b6e689794aebf986beac1557367cba0f18d666bf8ec3aa037e6f08877" + }, + { + "id": "EtGRQWQruHSy9sZUHwX4FKXQPT3p15xsV6Bx3Pt5LMHU", + "owner": { + "id": "0x03c65e533cc73cc65cd71a0cb65efa4b11e74c22" + }, + "subgraphNumber": "3", + "metadataHash": "0x3b9721ef654fc1de4fb3654d8b27eb152face455c64bab02011e417575cc1077" + }, + { + "id": "EsEnqMt8GrWXSWjdkTphcauCRvcyC1eC4U9sdBRZEB84", + "owner": { + "id": "0x5991a31ab4095cb5470a5bd532e02568393b06d5" + }, + "subgraphNumber": "1", + "metadataHash": "0x56899ebbe432ee9fe47db5fe709b0c47ef0e0fbe3cc5a7fde97861b0ff37cb41" + }, + { + "id": "E1vew3qN9voUJCmkPWUubQBBppiBuC2f3T2Exh2CsyDH", + "owner": { + "id": "0xefe232372e2e30951fa90d7a800d5938eedc935d" + }, + "subgraphNumber": "2", + "metadataHash": "0x5998fe5b6e689794aebf986beac1557367cba0f18d666bf8ec3aa037e6f08877" + }, + { + "id": "Dz55sRXXemD3QUos3orXQWm5GQs3ACECGDbE86ZVsyrG", + "owner": { + "id": "0x03c65e533cc73cc65cd71a0cb65efa4b11e74c22" + }, + "subgraphNumber": "4", + "metadataHash": "0x5998fe5b6e689794aebf986beac1557367cba0f18d666bf8ec3aa037e6f08877" + }, + { + "id": "DSpmdAKr3pzkcU5R6NgreBsYabdkY9C5ocBbP9Sk4FAA", + "owner": { + "id": "0x5ca1ea5549e4e7cb64ae35225e11865d2572b3f9" + }, + "subgraphNumber": "0", + "metadataHash": "0x7369f32b51f12127e0591f079c99f6b997d90aecbd938270c0d0ecf902edfb2a" + }, + { + "id": "CvkpgHJW4ApYwYX831M8GpN472FbnhGKjdL2ERT5wie9", + "owner": { + "id": "0x9d196973c0c5bd65ccfb797a2c23eb5c1faba7ab" + }, + "subgraphNumber": "1", + "metadataHash": "0x82a07620f76548e3d7b38b468b9b67b2e9355a3dcef48ac1a4ebf96eb588685e" + }, + { + "id": "BM3vXF5bRFy4NRYrYirEnkfNsi3veUetKrqvqxmwMPSP", + "owner": { + "id": "0x03c65e533cc73cc65cd71a0cb65efa4b11e74c22" + }, + "subgraphNumber": "0", + "metadataHash": "0xbd37407528628edbdc2703dd0297097e41bb95b101c382d6f8fddcd8f15df58a" + }, + { + "id": "B39LecV8UELFUxULRswPhcifsZWJ6qaLL29cGYMcCK4s", + "owner": { + "id": "0x534a9ac3d3401f80800375680bded6a84137d296" + }, + "subgraphNumber": "3", + "metadataHash": "0xeeee64a3f268f229331f0088d0ef92b65257eee2a50492ed763dd21254c00799" + }, + { + "id": "A4xtyhChUywTCww37fFBtjd1poY2kHtMNu2fwKuxSSB", + "owner": { + "id": "0xa508c16666c5b8981fa46eb32784fccc01942a71" + }, + "subgraphNumber": "2", + "metadataHash": "0x7a7ca98b60850593645a9348d47143c7f550e790e48e51c4820baddd92319d35" + }, + { + "id": "9xL1fnWqqQ4QjC9Z33hTXkgPBZAHU14Tzqzf5mEtDbxM", + "owner": { + "id": "0xefe232372e2e30951fa90d7a800d5938eedc935d" + }, + "subgraphNumber": "3", + "metadataHash": "0x5998fe5b6e689794aebf986beac1557367cba0f18d666bf8ec3aa037e6f08877" + }, + { + "id": "9js1z4GHLYQuGQ6yGs9SdcCRUDTCXBLKY7e37KFUKRre", + "owner": { + "id": "0x69aa76325b4890f0fa9b44f4d99d56f3834738b4" + }, + "subgraphNumber": "0", + "metadataHash": "0xcaf93a686e6b7f7d1b78543ffc512d4046b493b4d125dc3c6fc5469c4af57d70" + }, + { + "id": "9EjsLLp4Ti39xUfZE1Xzz6bjwuzJSc3tVb3FvYxugq65", + "owner": { + "id": "0x03c65e533cc73cc65cd71a0cb65efa4b11e74c22" + }, + "subgraphNumber": "2", + "metadataHash": "0x3b9721ef654fc1de4fb3654d8b27eb152face455c64bab02011e417575cc1077" + }, + { + "id": "8mteqsnKePqyqAXVb6e6KkcBqJpR3tjwPacgP1jSmxSE", + "owner": { + "id": "0x5991a31ab4095cb5470a5bd532e02568393b06d5" + }, + "subgraphNumber": "3", + "metadataHash": "0x7876a5e7860a6abe0acebdde502d39b180856c41163d536fa632725f1f58cd3b" + }, + { + "id": "7Y8ZaLST7xYVcVZsVRiRw2xhnDe9C62nLmLQpxffPVj", + "owner": { + "id": "0xefe232372e2e30951fa90d7a800d5938eedc935d" + }, + "subgraphNumber": "6", + "metadataHash": "0xbdfd81ed973596a181375b4e3c69d5a1fe52d2c41a07ec0ba5621a1e2bd35ddb" + }, + { + "id": "7fspzcqYDgVF1gV7VxyA2k833EmhYqnsgRvXk9YAEPT4", + "owner": { + "id": "0xa508c16666c5b8981fa46eb32784fccc01942a71" + }, + "subgraphNumber": "1", + "metadataHash": "0x7400f53d252f899ec54094484d9dc3102e38147755f7dbf9ddb3ad4e9487acb9" + }, + { + "id": "7Ew6SQmN1Xdjk5YEonqYAaT1v2HikNa92VZUQPpJ2QvX", + "owner": { + "id": "0x534a9ac3d3401f80800375680bded6a84137d296" + }, + "subgraphNumber": "5", + "metadataHash": "0x54bc59114d36eaec4ff6a196c6e40a33d4eca894c514f9b127238424a4188274" + }, + { + "id": "6SVLBaaAcujGWswitHpLixkgjQVZugrQHj8AihGJgFgD", + "owner": { + "id": "0xfcb576bc8ee187945fa00f0daa7bbe9c1b51b0c9" + }, + "subgraphNumber": "2", + "metadataHash": "0x7aba482a8b8b809d890f865548b5a2a194271ca9afcb0f5e47a604a286f4d9aa" + }, + { + "id": "6bsUMv2twT2SA9RCToCBDXfStADVvDh2nvEmSuX4F8kc", + "owner": { + "id": "0x0b1302c23d9eb4b42a74cbefc4f9b3081ff1bf18" + }, + "subgraphNumber": "0", + "metadataHash": "0xfa65e518e90b49586e173e29ae25202995c400ee021353d90c42b682c34494d6" + }, + { + "id": "6AmTt2V2PQiKJuHF6X1ySjJpNTuwzvUTmUQRYL74eFxT", + "owner": { + "id": "0xefe232372e2e30951fa90d7a800d5938eedc935d" + }, + "subgraphNumber": "5", + "metadataHash": "0x5998fe5b6e689794aebf986beac1557367cba0f18d666bf8ec3aa037e6f08877" + }, + { + "id": "5vhK8XAGXiK4zwGPcN2C63TjhAHtqyqoUcS6RGR5H86i", + "owner": { + "id": "0x673b6e9fe607f6ddf4a4f25b386b846c5c82995e" + }, + "subgraphNumber": "3", + "metadataHash": "0xddb85d0e63098b79b4340052b866c4d8eb638a81d74c6e135c979d23f4d1e93f" + }, + { + "id": "5qyjWvZ1FLwAsBeJvPuyvhBddJDavKYyyjdXQZ28REAJ", + "owner": { + "id": "0xf556322b497b475d535d0d4048f56c092a0ea3ad" + }, + "subgraphNumber": "1", + "metadataHash": "0x9bdee2ed59fcf9532df294d9b07fa1ef3c127a144658c35fa3c1d9fee4f7cc2a" + }, + { + "id": "57MzWCjGmKWrUYGHgEVne3ieFCXnwAUHKKDLXm4mJPJb", + "owner": { + "id": "0x03c65e533cc73cc65cd71a0cb65efa4b11e74c22" + }, + "subgraphNumber": "6", + "metadataHash": "0x5998fe5b6e689794aebf986beac1557367cba0f18d666bf8ec3aa037e6f08877" + }, + { + "id": "4MQwNPuso8ABKHhddwUmJCaPqg2w4Vst6B2pPr21Ygn9", + "owner": { + "id": "0xefe232372e2e30951fa90d7a800d5938eedc935d" + }, + "subgraphNumber": "1", + "metadataHash": "0x5998fe5b6e689794aebf986beac1557367cba0f18d666bf8ec3aa037e6f08877" + }, + { + "id": "47BEnfQFYjURYjD8r2JNoFjXkYHTqJ3xfcnrKUrbnTiq", + "owner": { + "id": "0x534a9ac3d3401f80800375680bded6a84137d296" + }, + "subgraphNumber": "2", + "metadataHash": "0xba7ebef4cc835813d6bdd70b2ee4db65594898e57e3412197964bd30b383e5fb" + }, + { + "id": "3zULJJdf5s9d87rn5aDgoT4pE5Uih3z6SAEumXy1dQqv", + "owner": { + "id": "0x03c65e533cc73cc65cd71a0cb65efa4b11e74c22" + }, + "subgraphNumber": "1", + "metadataHash": "0x45926246b7a13663ccacd05331419b7c2519bbc8b8bb6be89ab285022eb6e557" + }, + { + "id": "3sHuzLagq1T5yYrsctLtz7QdcNAGsdsodHk7j3g2mrVV", + "owner": { + "id": "0x03c65e533cc73cc65cd71a0cb65efa4b11e74c22" + }, + "subgraphNumber": "5", + "metadataHash": "0x5998fe5b6e689794aebf986beac1557367cba0f18d666bf8ec3aa037e6f08877" + }, + { + "id": "3caWu7riX9kGBe2zmXVc4V8vQQ5U1c3QAjzeSGNT7Jo", + "owner": { + "id": "0x072e829ff4e1c9bdb95acaf947f8ec262ecdf92f" + }, + "subgraphNumber": "0", + "metadataHash": "0x7f6fe58ac5f0c86007d61813897fcdb956f3f71e816f105b18f22cde4213ca20" + }, + { + "id": "2qbnVdk8RfatovF1sogHzH1eZ52DoziY6d7qR5KHzk8X", + "owner": { + "id": "0xc320812b4bbb7f2369ee1316fd703de403ad0d2e" + }, + "subgraphNumber": "0", + "metadataHash": "0xd9ff52d1ac82d8ebe295ee1bf3fd0f352eacb134039af2464342a7285cf0d921" + } + ] + } +} diff --git a/packages/contracts/scripts/ops/20240208-migrate-legacy-subgraphs/migrate.ts b/packages/contracts/scripts/ops/20240208-migrate-legacy-subgraphs/migrate.ts new file mode 100644 index 000000000..9e2cbdcba --- /dev/null +++ b/packages/contracts/scripts/ops/20240208-migrate-legacy-subgraphs/migrate.ts @@ -0,0 +1,63 @@ +import hre from 'hardhat' +import data from './data.json' +import { confirm, subgraphIdToHex } from '@graphprotocol/sdk' +import { BigNumber, ethers } from 'ethers' + +async function main() { + const graph = hre.graph() + const deployer = await graph.getDeployer() + + // First estimate cost + const gasEstimate = await data.data.subgraphs.reduce(async (acc, subgraph) => { + return (await acc).add( + await graph.contracts.L1GNS.connect(deployer).estimateGas.migrateLegacySubgraph( + subgraph.owner.id, + subgraph.subgraphNumber, + subgraph.metadataHash, + ), + ) + }, Promise.resolve(BigNumber.from(0))) + const gasPrice = await graph.provider.getGasPrice() + const cost = ethers.utils.formatEther(gasEstimate.mul(gasPrice)) + + // Ask for confirmation + if ( + !(await confirm( + `This script will migrate ${data.data.subgraphs.length} legacy subgraphs, with an approximate cost of ${cost} Ξ. Are you sure you want to continue?`, + false, + )) + ) + return + + // do it + for (const subgraph of data.data.subgraphs) { + console.log(`Migrating legacy subgraph ${subgraph.owner.id}/${subgraph.subgraphNumber}...`) + + const legacyKey = await graph.contracts.L1GNS.legacySubgraphKeys(subgraphIdToHex(subgraph.id)) + if (legacyKey.account !== ethers.constants.AddressZero) { + console.log(` - Already migrated, skipping`) + continue + } + try { + const tx = await graph.contracts.L1GNS.connect(deployer).migrateLegacySubgraph( + subgraph.owner.id, + subgraph.subgraphNumber, + subgraph.metadataHash, + ) + const receipt = await tx.wait() + if (receipt.status == 1) { + console.log(` ✔ Migration succeeded!`) + } else { + console.log(` ✖ Migration failed!`) + console.log(receipt) + } + } catch (error) { + console.log(error) + } + } +} + +main().catch((error) => { + console.error(error) + process.exitCode = 1 +}) diff --git a/scripts/ops/parseTestnetAddresses.ts b/packages/contracts/scripts/ops/parseTestnetAddresses.ts similarity index 83% rename from scripts/ops/parseTestnetAddresses.ts rename to packages/contracts/scripts/ops/parseTestnetAddresses.ts index 96ad27be4..921859368 100755 --- a/scripts/ops/parseTestnetAddresses.ts +++ b/packages/contracts/scripts/ops/parseTestnetAddresses.ts @@ -16,18 +16,18 @@ interface TeamMember { export const teamAddresses: Array = [] -async function main() { +function main() { const data = fs.readFileSync('indexers.csv', 'utf8') - const entries = data.split('\n').map((e) => e.trim()) + const entries = data.split('\n').map(e => e.trim()) for (const entry of entries) { if (!entry) continue - const [name, address] = entry.split(',').map((e) => e.trim()) + const [name, address] = entry.split(',').map(e => e.trim()) // Verify address try { getAddress(address.trim()) - } catch (err) { + } catch (_) { console.log('Invalid', name, address) process.exit(1) } diff --git a/packages/contracts/scripts/ops/testDisputeConflict/acceptDispute.ts b/packages/contracts/scripts/ops/testDisputeConflict/acceptDispute.ts new file mode 100644 index 000000000..013daec30 --- /dev/null +++ b/packages/contracts/scripts/ops/testDisputeConflict/acceptDispute.ts @@ -0,0 +1,20 @@ +import { Wallet } from 'ethers' +import hre from 'hardhat' + +async function main() { + const graph = hre.graph() + const arbitratorPrivateKey = process.env.ARBITRATOR_PRIVATE_KEY + const arbitrator = new Wallet(arbitratorPrivateKey, graph.provider) + console.log('Arbitrator:', arbitrator.address) + + const disputeId = '0x35e6e68aa71ee59cb710d8005563d63d644f11f2eee879eca9bc22f523c9fade' + console.log('Dispute ID:', disputeId) + + // Accept dispute + await graph.contracts.DisputeManager.connect(arbitrator).acceptDispute(disputeId) +} + +main().catch((error) => { + console.error(error) + process.exitCode = 1 +}) diff --git a/packages/contracts/scripts/ops/testDisputeConflict/createDispute.ts b/packages/contracts/scripts/ops/testDisputeConflict/createDispute.ts new file mode 100644 index 000000000..26df99a4a --- /dev/null +++ b/packages/contracts/scripts/ops/testDisputeConflict/createDispute.ts @@ -0,0 +1,51 @@ +import { + GraphChainId, + buildAttestation, + encodeAttestation, + randomHexBytes, +} from '@graphprotocol/sdk' +import hre from 'hardhat' + +async function main() { + const graph = hre.graph() + const deployer = await graph.getDeployer() + const [indexer] = await graph.getTestAccounts() + const indexerChannelPrivKey = '0x82226c70efbe0d9525a5f9dc85c29b11fed1f46798a416b7626e21fdd6518d08' + + console.log('Deployer:', deployer.address) + console.log('Indexer:', indexer.address) + + const receipt = { + requestCID: '0x8bec406793c8e1c5d4bd4e059833e95b7a9aeed6a118cbe335a79735836f9ff7', + responseCID: '0xbdfc41643b5ff8d55f6cdb50f05575e1fdf177fa54d98cae1b9c76d8b360ff57', + subgraphDeploymentID: '0xa3bfbfc6f53fd8a61b78e0b9a90c7fbe9ff290cba87b045bc476137fb2963cf9', + } + const receipt2 = { ...receipt, responseCID: randomHexBytes() } + + const attestation1 = await buildAttestation( + receipt, + indexerChannelPrivKey, + graph.contracts.DisputeManager.address, + graph.chainId as GraphChainId, + ) + const attestation2 = await buildAttestation( + receipt2, + indexerChannelPrivKey, + graph.contracts.DisputeManager.address, + graph.chainId as GraphChainId, + ) + + console.log('Attestation 1:', attestation1) + console.log('Attestation 2:', attestation2) + + // Create dispute + await graph.contracts.DisputeManager.connect(deployer).createQueryDisputeConflict( + encodeAttestation(attestation1), + encodeAttestation(attestation2), + ) +} + +main().catch((error) => { + console.error(error) + process.exitCode = 1 +}) diff --git a/packages/contracts/scripts/ops/testDisputeConflict/setupIndexer.ts b/packages/contracts/scripts/ops/testDisputeConflict/setupIndexer.ts new file mode 100644 index 000000000..9d2cd0ede --- /dev/null +++ b/packages/contracts/scripts/ops/testDisputeConflict/setupIndexer.ts @@ -0,0 +1,40 @@ +import { allocateFrom, deriveChannelKey, randomHexBytes, stake, toGRT } from '@graphprotocol/sdk' +import hre, { ethers } from 'hardhat' + +async function main() { + const graph = hre.graph() + const deployer = await graph.getDeployer() + const [indexer] = await graph.getTestAccounts() + + console.log('Deployer:', deployer.address) + console.log('Indexer:', indexer.address) + + const receipt = { + requestCID: '0x8bec406793c8e1c5d4bd4e059833e95b7a9aeed6a118cbe335a79735836f9ff7', + responseCID: '0xbdfc41643b5ff8d55f6cdb50f05575e1fdf177fa54d98cae1b9c76d8b360ff57', + subgraphDeploymentID: '0xa3bfbfc6f53fd8a61b78e0b9a90c7fbe9ff290cba87b045bc476137fb2963cf9', + } + + console.log('Receipt requestCID:', receipt.requestCID) + console.log('Receipt response CID:', receipt.responseCID) + console.log('Receipt subgraphDeploymentID:', receipt.subgraphDeploymentID) + + const indexerChannelKey = deriveChannelKey() + console.log('Indexer channel key:', indexerChannelKey.address) + console.log('Indexer channel key privKey:', indexerChannelKey.privKey) + + // Set up indexer + await deployer.sendTransaction({ value: toGRT('0.05'), to: indexer.address }) + await graph.contracts.GraphToken.connect(deployer).transfer(indexer.address, toGRT('100000')) + await stake(graph.contracts, indexer, { amount: toGRT('100000') }) + await allocateFrom(graph.contracts, indexer, { + channelKey: indexerChannelKey, + amount: toGRT('100000'), + subgraphDeploymentID: receipt.subgraphDeploymentID, + }) +} + +main().catch((error) => { + console.error(error) + process.exitCode = 1 +}) diff --git a/packages/contracts/scripts/predeploy b/packages/contracts/scripts/predeploy new file mode 100755 index 000000000..864cebe6a --- /dev/null +++ b/packages/contracts/scripts/predeploy @@ -0,0 +1,10 @@ +#!/bin/bash + +cat addresses.json | + jq '."1"."IENS".address = "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"' | + jq '."5"."IENS".address = "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"' | + jq '."1"."IEthereumDIDRegistry".address = "0xdCa7EF03e98e0DC2B855bE647C39ABe984fcF21B"' | + jq '."5"."IEthereumDIDRegistry".address = "0xdCa7EF03e98e0DC2B855bE647C39ABe984fcF21B"' | + jq '."42161"."IEthereumDIDRegistry".address = "0xa9AEb1c6f14f4244547B9a0946C485DA99047638"' | + jq '."421613"."IEthereumDIDRegistry".address = "0x8FFfcD6a85D29E9C33517aaf60b16FE4548f517E"' > addresses.json.tmp +mv addresses.json.tmp addresses.json diff --git a/packages/contracts/scripts/test b/packages/contracts/scripts/test new file mode 100755 index 000000000..c5f76b708 --- /dev/null +++ b/packages/contracts/scripts/test @@ -0,0 +1,43 @@ +#!/bin/bash + +set -eo pipefail +source $(pwd)/scripts/evm + +### Setup EVM + +# Ensure we compiled sources +pnpm build + +### Cleanup +function cleanup() { + if [ "$RUN_EVM" = true ]; then + evm_kill + fi +} +trap cleanup EXIT + +# Gas reporter needs to run in its own evm instance +if [ "$RUN_EVM" = true ]; then + evm_kill + evm_start + sleep 5 +fi + +### Main + +# Init address book +echo {} > addresses-local.json + +mkdir -p reports + +# Run using the standalone evm instance +DISABLE_SECURE_ACCOUNTS=true \ +L1_GRAPH_CONFIG=config/graph.hardhat.yml \ +L2_GRAPH_CONFIG=config/graph.arbitrum-hardhat.yml \ +ADDRESS_BOOK=addresses-local.json \ + npx hardhat test --network hardhat $@ + +if [ "$REPORT_GAS" = true ]; then + cat reports/gas-report.log + echo "" # Gas report doesn't have a newline at the end +fi diff --git a/packages/contracts/scripts/upgrade b/packages/contracts/scripts/upgrade new file mode 100755 index 000000000..c5b62d29f --- /dev/null +++ b/packages/contracts/scripts/upgrade @@ -0,0 +1,101 @@ +#!/bin/bash + +set -eo pipefail +source $(pwd)/scripts/evm + +print_separator() { + echo -e "\n############################################################################################" + echo "# $1" + echo "############################################################################################" +} + +### > SCRIPT CONFIG < +FORK_URL=${FORK_URL} +FORK_BLOCK_NUMBER=${FORK_BLOCK_NUMBER:-"latest"} +CHAIN_ID=${CHAIN_ID} + +NETWORK=${NETWORK:-"mainnet"} +ADDRESS_BOOK=${ADDRESS_BOOK:-"addresses.json"} +GRAPH_CONFIG=${GRAPH_CONFIG:-"config/graph.mainnet.yml"} +CONTRACT_NAME=${CONTRACT_NAME} +UPGRADE_NAME=${UPGRADE_NAME} + +if [[ -z "$FORK_URL" ]]; then + if [[ -n "$INFURA_KEY" ]]; then + FORK_URL="https://mainnet.infura.io/v3/$INFURA_KEY" + else + echo "Must specify FORK_URL or INFURA_KEY!" + exit 0 + fi +fi + +if [[ -z "$CHAIN_ID" ]]; then + echo "Must specify CHAIN_ID you are forking from!" + exit 0 +fi + +if [[ -z "$CONTRACT_NAME" ]]; then + echo "Must specify CONTRACT_NAME to upgrade!" + exit 0 +fi + +if [[ -z "$UPGRADE_NAME" ]]; then + echo "Must specify UPGRADE_NAME to upgrade!" + exit 0 +fi + +print_separator "Running upgrade tests with config" +echo "- Using forking URL: $FORK_URL" +echo "- Forking from chain id: $CHAIN_ID" +echo "- Fork block number: $FORK_BLOCK_NUMBER" +echo "- Upgrading contract: $CONTRACT_NAME" +echo "- Upgrade name: $UPGRADE_NAME" + +### > SCRIPT START < ### +## SETUP +# Compile contracts +print_separator "Building contracts" +pnpm build + +# Build fork address book with actual contract addresses from the forked chain +jq "{\"$CHAIN_ID\"} + {"\"1337\"": .\"$CHAIN_ID\"} | del(.\"$CHAIN_ID\")" $ADDRESS_BOOK > addresses-fork.json + +# Start evm - fork it! +print_separator "Starting forked chain" +evm_kill +evm_start "$FORK_URL" "$FORK_BLOCK_NUMBER" +evm_automine + +# Run pre-upgrade scripts +print_separator "Running pre-upgrade scripts and tests" +FORK=true npx hardhat e2e:upgrade "$UPGRADE_NAME" \ + --network localhost \ + --graph-config "${GRAPH_CONFIG}" \ + --address-book addresses-fork.json \ + --disable-secure-accounts + +# Run upgrade +print_separator "Upgrading contract" +FORK=true npx hardhat contract:upgrade \ + --network localhost \ + --graph-config "${GRAPH_CONFIG}" \ + --address-book addresses-fork.json \ + --contract "${CONTRACT_NAME}" \ + --disable-secure-accounts + +# Run post-upgrade scripts +print_separator "Running post-upgrade scripts and tests" +FORK=true npx hardhat e2e:upgrade "$UPGRADE_NAME" \ + --network localhost \ + --graph-config "${GRAPH_CONFIG}" \ + --address-book addresses-fork.json \ + --disable-secure-accounts \ + --post + +# Kill evm +print_separator "Clean up" +read -p "Upgrade test finished! Do you want to keep the evm running? (y/N) " yn +if [[ $yn != "y" ]]; then + evm_kill +fi + diff --git a/packages/contracts/slither.config.json b/packages/contracts/slither.config.json new file mode 100644 index 000000000..dca997f8c --- /dev/null +++ b/packages/contracts/slither.config.json @@ -0,0 +1,6 @@ +{ + "hardhat_artifacts_directory": "./build/contracts", + "filter_paths": "contracts/bancor/.*|contracts/tests/.*|contracts/staking/libs/Exponential.*|contracts/staking/libs/LibFixedMath.*|contracts/staking/libs/MathUtils.*", + "detectors_to_exclude": "similar-names,naming-convention", + "exclude_dependencies": true +} diff --git a/packages/contracts/solhint.config.js b/packages/contracts/solhint.config.js new file mode 100644 index 000000000..b8e918530 --- /dev/null +++ b/packages/contracts/solhint.config.js @@ -0,0 +1,28 @@ +module.exports = { + plugins: ['graph'], + extends: 'solhint:recommended', + rules: { + // best practices + 'no-empty-blocks': 'off', + 'constructor-syntax': 'warn', + + // style rules + 'private-vars-leading-underscore': 'off', // see graph/leading-underscore + 'const-name-snakecase': 'warn', + 'named-parameters-mapping': 'warn', + 'imports-on-top': 'warn', + 'ordering': 'warn', + 'visibility-modifier-order': 'warn', + + // miscellaneous + 'quotes': ['error', 'double'], + + // security + 'compiler-version': ['off'], + 'func-visibility': ['warn', { ignoreConstructors: true }], + 'not-rely-on-time': 'off', + + // graph + // 'graph/leading-underscore': 'warn', // Contracts were originally written with a different style + }, +} diff --git a/packages/contracts/tasks/bridge/deposits.ts b/packages/contracts/tasks/bridge/deposits.ts new file mode 100644 index 000000000..b8a7838fc --- /dev/null +++ b/packages/contracts/tasks/bridge/deposits.ts @@ -0,0 +1,93 @@ +import { greTask } from '@graphprotocol/sdk/gre' +import { ethers } from 'ethers' +import { Table } from 'console-table-printer' +import { L1ToL2MessageStatus } from '@arbitrum/sdk' +import { getL1ToL2MessageStatus } from '@graphprotocol/sdk' + +interface PrintEvent { + blockNumber: string + tx: string + amount: string + status: string +} + +greTask('bridge:deposits', 'List deposits initiated on L1GraphTokenGateway') + .addOptionalParam('startBlock', 'Start block for the search') + .addOptionalParam('endBlock', 'End block for the search') + .setAction(async (taskArgs, hre) => { + console.log('> L1GraphTokenGateway deposits') + + const graph = hre.graph(taskArgs) + const gateway = graph.l1.contracts.L1GraphTokenGateway + console.log(`Tracking 'DepositInitiated' events on ${gateway.address}`) + + const startBlock = taskArgs.startBlock ? parseInt(taskArgs.startBlock) : 0 + const endBlock = taskArgs.endBlock ? parseInt(taskArgs.endBlock) : 'latest' + console.log(`Searching blocks from block ${startBlock} to block ${endBlock}`) + + const events = await Promise.all( + ( + await gateway.queryFilter(gateway.filters.DepositInitiated(), startBlock, endBlock) + ).map(async e => ({ + blockNumber: `${e.blockNumber} (${new Date( + (await graph.l1.provider.getBlock(e.blockNumber)).timestamp * 1000, + ).toLocaleString()})`, + tx: `${e.transactionHash} ${e.args.from} -> ${e.args.to}`, + amount: ethers.utils.formatEther(e.args.amount), + status: emojifyRetryableStatus( + await getL1ToL2MessageStatus(e.transactionHash, graph.l1.provider, graph.l2.provider), + ), + })), + ) + + const total = events.reduce( + (acc, e) => acc.add(ethers.utils.parseEther(e.amount)), + ethers.BigNumber.from(0), + ) + console.log( + `Found ${events.length} deposits with a total of ${ethers.utils.formatEther(total)} GRT`, + ) + + console.log( + 'L1 to L2 message status reference: 🚧 = not yet created, ❌ = creation failed, ⚠️ = funds deposited on L2, ✅ = redeemed, ⌛ = expired', + ) + + printEvents(events) + }) + +function printEvents(events: PrintEvent[]) { + const tablePrinter = new Table({ + charLength: { '🚧': 2, '✅': 2, '⚠️': 1, '⌛': 2, '❌': 2 }, + columns: [ + { name: 'status', color: 'green', alignment: 'center' }, + { name: 'blockNumber', color: 'green', alignment: 'center' }, + { + name: 'tx', + color: 'green', + alignment: 'center', + maxLen: 88, + }, + { name: 'amount', color: 'green', alignment: 'center' }, + ], + }) + + events.map(e => tablePrinter.addRow(e)) + tablePrinter.printTable() +} + +function emojifyRetryableStatus(status: L1ToL2MessageStatus): string { + switch (status) { + case L1ToL2MessageStatus.NOT_YET_CREATED: + return '🚧' + case L1ToL2MessageStatus.CREATION_FAILED: + return '❌' + case L1ToL2MessageStatus.FUNDS_DEPOSITED_ON_L2: + return '⚠️ ' + case L1ToL2MessageStatus.REDEEMED: + return '✅' + case L1ToL2MessageStatus.EXPIRED: + return '⌛' + default: + return '❌' + } +} diff --git a/packages/contracts/tasks/bridge/to-l2.ts b/packages/contracts/tasks/bridge/to-l2.ts new file mode 100644 index 000000000..8f05aac87 --- /dev/null +++ b/packages/contracts/tasks/bridge/to-l2.ts @@ -0,0 +1,52 @@ +import { BigNumber } from 'ethers' +import { greTask } from '@graphprotocol/sdk/gre' +import { sendToL2 } from '@graphprotocol/sdk' +import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers' + +greTask('bridge:send-to-l2', 'Bridge GRT tokens from L1 to L2') + .addParam('amount', 'Amount of tokens to bridge') + .addOptionalParam( + 'sender', + 'Address of the sender, must be managed by the provider node. L1 deployer if empty.', + ) + .addOptionalParam('recipient', 'Receiving address in L2. Same to L1 address if empty.') + .addOptionalParam( + 'deploymentFile', + 'Nitro testnode deployment file. Must specify if using nitro test nodes.', + ) + .setAction(async (taskArgs, hre) => { + console.log('> Sending GRT to L2') + const graph = hre.graph(taskArgs) + + // If local, add nitro test node networks to sdk + if (taskArgs.deploymentFile) { + console.log('> Adding nitro test node network to sdk') + await hre.run('migrate:nitro:register', { deploymentFile: taskArgs.deploymentFile }) + } + + // Get the sender, use L1 deployer if not provided + const sender = taskArgs.sender + ? await SignerWithAddress.create(graph.l1.provider.getSigner(taskArgs.sender)) + : await graph.l1.getDeployer() + console.log(`> Using wallet ${sender.address}`) + + // Patch sendToL2 opts + taskArgs.l2Provider = graph.l2.provider + taskArgs.amount = hre.ethers.utils.parseEther(taskArgs.amount) // sendToL2 expects amount in GRT + + // L2 provider gas limit estimation has been hit or miss in CI, 400k should be more than enough + if (process.env.CI) { + taskArgs.maxGas = BigNumber.from('400000') + } + + await sendToL2(graph.contracts, sender, { + l2Provider: graph.l2.provider, + amount: taskArgs.amount, + recipient: taskArgs.recipient, + maxGas: taskArgs.maxGas, + gasPriceBid: taskArgs.gasPriceBid, + maxSubmissionCost: taskArgs.maxSubmissionCost, + }) + + console.log('Done!') + }) diff --git a/packages/contracts/tasks/bridge/withdrawals.ts b/packages/contracts/tasks/bridge/withdrawals.ts new file mode 100644 index 000000000..d36511813 --- /dev/null +++ b/packages/contracts/tasks/bridge/withdrawals.ts @@ -0,0 +1,89 @@ +import { ethers } from 'ethers' +import { Table } from 'console-table-printer' +import { L2ToL1MessageStatus } from '@arbitrum/sdk' +import { greTask } from '@graphprotocol/sdk/gre' +import { getL2ToL1MessageStatus } from '@graphprotocol/sdk' + +interface PrintEvent { + blockNumber: string + tx: string + amount: string + status: string +} + +greTask('bridge:withdrawals', 'List withdrawals initiated on L2GraphTokenGateway') + .addOptionalParam('startBlock', 'Start block for the search') + .addOptionalParam('endBlock', 'End block for the search') + .setAction(async (taskArgs, hre) => { + console.log('> L2GraphTokenGateway withdrawals') + + const graph = hre.graph(taskArgs) + const gateway = graph.l2.contracts.L2GraphTokenGateway + console.log(`Tracking 'WithdrawalInitiated' events on ${gateway.address}`) + + const startBlock = taskArgs.startBlock ? parseInt(taskArgs.startBlock) : 0 + const endBlock = taskArgs.endBlock ? parseInt(taskArgs.endBlock) : 'latest' + console.log(`Searching blocks from block ${startBlock} to block ${endBlock}`) + + const events = await Promise.all( + ( + await gateway.queryFilter(gateway.filters.WithdrawalInitiated(), startBlock, endBlock) + ).map(async e => ({ + blockNumber: `${e.blockNumber} (${new Date( + (await graph.l2.provider.getBlock(e.blockNumber)).timestamp * 1000, + ).toLocaleString()})`, + tx: `${e.transactionHash} ${e.args.from} -> ${e.args.to}`, + amount: ethers.utils.formatEther(e.args.amount), + status: emojifyL2ToL1Status( + await getL2ToL1MessageStatus(e.transactionHash, graph.l1.provider, graph.l2.provider), + ), + })), + ) + + const total = events.reduce( + (acc, e) => acc.add(ethers.utils.parseEther(e.amount)), + ethers.BigNumber.from(0), + ) + console.log( + `Found ${events.length} withdrawals for a total of ${ethers.utils.formatEther(total)} GRT`, + ) + + console.log( + 'L2 to L1 message status reference: 🚧 = unconfirmed, ⚠️ = confirmed, ✅ = executed', + ) + + printEvents(events) + }) + +function printEvents(events: PrintEvent[]) { + const tablePrinter = new Table({ + charLength: { '🚧': 2, '✅': 2, '⚠️': 1, '❌': 2 }, + columns: [ + { name: 'status', color: 'green', alignment: 'center' }, + { name: 'blockNumber', color: 'green' }, + { + name: 'tx', + color: 'green', + alignment: 'center', + maxLen: 88, + }, + { name: 'amount', color: 'green' }, + ], + }) + + events.map(e => tablePrinter.addRow(e)) + tablePrinter.printTable() +} + +function emojifyL2ToL1Status(status: L2ToL1MessageStatus): string { + switch (status) { + case L2ToL1MessageStatus.UNCONFIRMED: + return '🚧' + case L2ToL1MessageStatus.CONFIRMED: + return '⚠️ ' + case L2ToL1MessageStatus.EXECUTED: + return '✅' + default: + return '❌' + } +} diff --git a/packages/contracts/tasks/contract/deploy.ts b/packages/contracts/tasks/contract/deploy.ts new file mode 100644 index 000000000..33de96863 --- /dev/null +++ b/packages/contracts/tasks/contract/deploy.ts @@ -0,0 +1,43 @@ +import { confirm, deploy, DeployType } from '@graphprotocol/sdk' +import { greTask } from '@graphprotocol/sdk/gre' + +greTask('contract:deploy', 'Deploy a contract') + .addPositionalParam('contract', 'Name of the contract to deploy') + .addOptionalPositionalParam( + 'init', + 'Initialization arguments for the contract constructor. Provide arguments as comma-separated values', + ) + .addParam('deployType', 'Choose deploy, deploy-save, deploy-with-proxy, deploy-with-proxy-save') + .addFlag('skipConfirmation', 'Skip confirmation prompt on write actions') + .addFlag('buildAcceptTx', '...') + .setAction(async (taskArgs, hre) => { + const graph = hre.graph(taskArgs) + const deployer = await graph.getDeployer() + + if (!Object.values(DeployType).includes(taskArgs.deployType)) { + throw new Error(`Deploy type ${taskArgs.deployType} not supported`) + } + + console.log(`Deploying ${taskArgs.contract}...`) + console.log(`Init: ${taskArgs.init}`) + console.log(`Deploy type: ${taskArgs.deployType}`) + console.log(`Deployer: ${deployer.address}`) + console.log(`Chain ID: ${graph.chainId}`) + + const sure = await confirm( + `Are you sure to deploy ${taskArgs.contract}?`, + taskArgs.skipConfirmation, + ) + if (!sure) return + + const deployment = await deploy( + taskArgs.deployType, + deployer, + { + name: taskArgs.contract, + args: taskArgs.init?.split(',') || [], + }, + graph.addressBook, + ) + console.log(`Contract deployed at ${deployment.contract.address}`) + }) diff --git a/packages/contracts/tasks/contract/upgrade.ts b/packages/contracts/tasks/contract/upgrade.ts new file mode 100644 index 000000000..6825ba06a --- /dev/null +++ b/packages/contracts/tasks/contract/upgrade.ts @@ -0,0 +1,39 @@ +import { greTask } from '@graphprotocol/sdk/gre' +import { deploy, DeployType, GraphNetworkAddressBook } from '@graphprotocol/sdk' + +greTask('contract:upgrade', 'Upgrades a contract') + .addParam('contract', 'Name of the contract to upgrade') + .addOptionalVariadicPositionalParam( + 'init', + 'Initialization arguments for the contract constructor', + ) + .setAction(async (taskArgs, hre) => { + const graph = hre.graph(taskArgs) + + const { GraphProxyAdmin } = graph.contracts + const { governor } = await graph.getNamedAccounts() + const deployer = await graph.getDeployer() + + const contract = graph.contracts[taskArgs.contract] + if (!contract) { + throw new Error(`Contract ${taskArgs.contract} not found in address book`) + } + console.log(`Upgrading ${taskArgs.contract}...`) + + // Deploy new implementation + const { contract: implementation } = await deploy( + DeployType.DeployImplementationAndSave, + deployer, + { + name: taskArgs.contract, + args: taskArgs.init || [], + }, + new GraphNetworkAddressBook(taskArgs.addressBook, graph.chainId), + ) + console.log(`New implementation deployed at ${implementation.address}`) + + // Upgrade proxy and accept implementation + await GraphProxyAdmin.connect(governor).upgrade(contract.address, implementation.address) + await GraphProxyAdmin.connect(governor).acceptProxy(implementation.address, contract.address) + console.log(`Proxy upgraded to ${implementation.address}`) + }) diff --git a/packages/contracts/tasks/deployment/config.ts b/packages/contracts/tasks/deployment/config.ts new file mode 100644 index 000000000..76192b1c3 --- /dev/null +++ b/packages/contracts/tasks/deployment/config.ts @@ -0,0 +1,53 @@ +import { + confirm, + GraphNetworkConfigContractList, + GraphNetworkConfigGeneralParams, + updateContractParams, + updateGeneralParams, + writeConfig, +} from '@graphprotocol/sdk' +import { greTask } from '@graphprotocol/sdk/gre' + +greTask('update-config', 'Update graph config parameters with onchain data') + .addFlag('dryRun', 'Only print the changes, don\'t write them to the config file') + .addFlag('skipConfirmation', 'Skip confirmation prompt on write actions.') + .setAction(async (taskArgs, hre) => { + const networkName = hre.network.name + const configFile = taskArgs.graphConfig + const dryRun = taskArgs.dryRun + const skipConfirmation = taskArgs.skipConfirmation + + console.log('## Update graph config ##') + console.log(`Network: ${networkName}`) + console.log(`Config file: ${configFile}\n`) + + // Prompt to avoid accidentally overwriting the config file with data from another network + if (!configFile.includes(networkName)) { + const sure = await confirm( + `Config file ${configFile} doesn't match 'graph..yml'. Are you sure you want to continue?`, + skipConfirmation, + ) + if (!sure) return + } + + const { graphConfig, contracts } = hre.graph({ graphConfig: configFile }) + + // general parameters + console.log(`> General`) + for (const param of GraphNetworkConfigGeneralParams) { + await updateGeneralParams(contracts, param, graphConfig) + } + + // contracts parameters + for (const contract of GraphNetworkConfigContractList) { + console.log(`> ${contract.name}`) + await updateContractParams(contracts, contract, graphConfig) + } + + if (dryRun) { + console.log('\n Dry run enabled, printing changes to console (no files updated)\n') + console.log(graphConfig.toString()) + } else { + writeConfig(configFile, graphConfig.toString()) + } + }) diff --git a/packages/contracts/tasks/e2e/e2e.ts b/packages/contracts/tasks/e2e/e2e.ts new file mode 100644 index 000000000..43f23ad1e --- /dev/null +++ b/packages/contracts/tasks/e2e/e2e.ts @@ -0,0 +1,158 @@ +import { HardhatRuntimeEnvironment, TaskArguments } from 'hardhat/types' +import { TASK_TEST } from 'hardhat/builtin-tasks/task-names' +import glob from 'glob' +import fs from 'fs' +import { runScriptWithHardhat } from 'hardhat/internal/util/scripts-runner' +import { isGraphL1ChainId } from '@graphprotocol/sdk' +import { greTask } from '@graphprotocol/sdk/gre' + +const CONFIG_TESTS = 'test/e2e/deployment/config/**/*.test.ts' +const INIT_TESTS = 'test/e2e/deployment/init/**/*.test.ts' + +// Built-in test & run tasks don't support GRE arguments +// so we pass them by overriding GRE config object +const setGraphConfig = (args: TaskArguments, hre: HardhatRuntimeEnvironment) => { + const greArgs = [ + 'graphConfig', + 'l1GraphConfig', + 'l2GraphConfig', + 'addressBook', + 'disableSecureAccounts', + 'fork', + ] + + for (const arg of greArgs) { + if (args[arg]) { + if (arg === 'graphConfig') { + const l1 = isGraphL1ChainId(hre.config.networks[hre.network.name].chainId) + hre.config.graph[l1 ? 'l1GraphConfig' : 'l2GraphConfig'] = args[arg] + } else { + hre.config.graph[arg] = args[arg] + } + } + } +} + +greTask('e2e', 'Run all e2e tests') + .addFlag('skipBridge', 'Skip bridge tests') + .setAction(async (args, hre: HardhatRuntimeEnvironment) => { + let testFiles = [ + ...new glob.GlobSync(CONFIG_TESTS).found, + ...new glob.GlobSync(INIT_TESTS).found, + ] + + if (args.skipBridge) { + testFiles = testFiles.filter(file => !/l1|l2/.test(file)) + } + + // Disable secure accounts, we don't need them for this task + hre.config.graph.disableSecureAccounts = true + + setGraphConfig(args, hre) + await hre.run(TASK_TEST, { + testFiles: testFiles, + }) + }) + +greTask('e2e:config', 'Run deployment configuration e2e tests').setAction( + async (args, hre: HardhatRuntimeEnvironment) => { + const files = new glob.GlobSync(CONFIG_TESTS).found + + // Disable secure accounts, we don't need them for this task + hre.config.graph.disableSecureAccounts = true + + setGraphConfig(args, hre) + await hre.run(TASK_TEST, { + testFiles: files, + }) + }, +) + +greTask('e2e:init', 'Run deployment initialization e2e tests').setAction( + async (args, hre: HardhatRuntimeEnvironment) => { + const files = new glob.GlobSync(INIT_TESTS).found + + // Disable secure accounts, we don't need them for this task + hre.config.graph.disableSecureAccounts = true + + setGraphConfig(args, hre) + await hre.run(TASK_TEST, { + testFiles: files, + }) + }, +) + +greTask('e2e:scenario', 'Run scenario scripts and e2e tests') + .addPositionalParam('scenario', 'Name of the scenario to run') + .addFlag('skipScript', 'Don\'t run scenario script') + .setAction(async (args, hre: HardhatRuntimeEnvironment) => { + setGraphConfig(args, hre) + + const script = `test/e2e/scenarios/${args.scenario}.ts` + const test = `test/e2e/scenarios/${args.scenario}.test.ts` + + console.log(`> Running scenario: ${args.scenario}`) + console.log(`- script file: ${script}`) + console.log(`- test file: ${test}`) + + if (!args.skipScript) { + if (fs.existsSync(script)) { + await runScriptWithHardhat(hre.hardhatArguments, script, [ + args.addressBook, + args.graphConfig, + args.l1GraphConfig, + args.l2GraphConfig, + args.disableSecureAccounts, + ]) + } else { + console.log(`No script found for scenario ${args.scenario}`) + } + } + + if (fs.existsSync(test)) { + await hre.run(TASK_TEST, { + testFiles: [test], + }) + } else { + throw new Error(`No test found for scenario ${args.scenario}`) + } + }) + +greTask('e2e:upgrade', 'Run upgrade tests') + .addPositionalParam('upgrade', 'Name of the upgrade to run') + .addFlag('post', 'Wether to run pre/post upgrade scripts') + .setAction(async (args, hre: HardhatRuntimeEnvironment) => { + setGraphConfig(args, hre) + await runUpgrade(args, hre, args.post ? 'post' : 'pre') + }) + +// eslint-disable-next-line @typescript-eslint/no-explicit-any +async function runUpgrade(args: { [key: string]: any }, hre: HardhatRuntimeEnvironment, type: 'pre' | 'post') { + const script = `test/e2e/upgrades/${args.upgrade}/${type}-upgrade.ts` + const test = `test/e2e/upgrades/${args.upgrade}/${type}-upgrade.test.ts` + + console.log(`> Running ${type}-upgrade: ${args.upgrade}`) + console.log(`- script file: ${script}`) + console.log(`- test file: ${test}`) + + // Run script + if (fs.existsSync(script)) { + console.log(`> Running ${type}-upgrade script: ${script}`) + await runScriptWithHardhat(hre.hardhatArguments, script, [ + args.addressBook, + args.graphConfig, + args.l1GraphConfig, + args.l2GraphConfig, + args.disableSecureAccounts, + args.fork, + ]) + } + + // Run test + if (fs.existsSync(test)) { + console.log(`> Running ${type}-upgrade test: ${test}`) + await hre.run(TASK_TEST, { + testFiles: [test], + }) + } +} diff --git a/packages/contracts/tasks/migrate/bridge.ts b/packages/contracts/tasks/migrate/bridge.ts new file mode 100644 index 000000000..85f710d2a --- /dev/null +++ b/packages/contracts/tasks/migrate/bridge.ts @@ -0,0 +1,37 @@ +import { greTask } from '@graphprotocol/sdk/gre' +import { configureL1Bridge, configureL2Bridge, setPausedBridge } from '@graphprotocol/sdk' + +greTask('migrate:bridge', 'Configure and unpause bridge') + .addOptionalParam( + 'arbitrumAddressBook', + 'The path to the address book file for Arbitrum deployments', + './arbitrum-addresses.json', + ) + .setAction(async (taskArgs, hre) => { + const graph = hre.graph(taskArgs) + const { governor: l1Governor } = await graph.l1.getNamedAccounts() + const { governor: l2Governor } = await graph.l2.getNamedAccounts() + + await configureL1Bridge(graph.l1.contracts, l1Governor, { + l2GRTAddress: graph.l2.contracts.GraphToken.address, + l2GRTGatewayAddress: graph.l2.contracts.L2GraphTokenGateway.address, + l2GNSAddress: graph.l2.contracts.L2GNS.address, + l2StakingAddress: graph.l2.contracts.L2Staking.address, + arbAddressBookPath: taskArgs.arbitrumAddressBook, + chainId: graph.l1.chainId, + }) + + await configureL2Bridge(graph.l2.contracts, l2Governor, { + l1GRTAddress: graph.l1.contracts.GraphToken.address, + l1GRTGatewayAddress: graph.l1.contracts.L1GraphTokenGateway.address, + l1GNSAddress: graph.l1.contracts.L1GNS.address, + l1StakingAddress: graph.l1.contracts.L1Staking.address, + arbAddressBookPath: taskArgs.arbitrumAddressBook, + chainId: graph.l2.chainId, + }) + + await setPausedBridge(graph.l1.contracts, l1Governor, { paused: false }) + await setPausedBridge(graph.l2.contracts, l2Governor, { paused: false }) + + console.log('Done!') + }) diff --git a/packages/contracts/tasks/migrate/nitro.ts b/packages/contracts/tasks/migrate/nitro.ts new file mode 100644 index 000000000..a399b5002 --- /dev/null +++ b/packages/contracts/tasks/migrate/nitro.ts @@ -0,0 +1,74 @@ +import { subtask, task } from 'hardhat/config' +import fs from 'fs' +import { execSync } from 'child_process' +import { greTask } from '@graphprotocol/sdk/gre' +import { helpers } from '@graphprotocol/sdk' + +greTask( + 'migrate:nitro:fund-accounts', + 'Funds protocol accounts on Arbitrum Nitro testnodes', +).setAction(async (taskArgs, hre) => { + const graph = hre.graph(taskArgs) + await helpers.fundLocalAccounts( + [await graph.getDeployer(), ...(await graph.getAllAccounts())], + graph.provider, + ) +}) + +// Arbitrum SDK does not support Nitro testnodes out of the box +// This adds the testnodes to the SDK configuration +subtask('migrate:nitro:register', 'Adds nitro testnodes to SDK config') + .addParam('deploymentFile', 'The testnode deployment file to use', 'localNetwork.json') + // eslint-disable-next-line @typescript-eslint/require-await + .setAction(async (taskArgs): Promise => { + helpers.addLocalNetwork(taskArgs.deploymentFile) + }) + +subtask('migrate:nitro:deployment-file', 'Fetches nitro deployment file from a local testnode') + .addParam( + 'deploymentFile', + 'Path to the file where to deployment file will be saved', + 'localNetwork.json', + ) + // eslint-disable-next-line @typescript-eslint/require-await + .setAction(async (taskArgs) => { + console.log(`Attempting to fetch deployment file from testnode...`) + + const command = `docker container cp $(docker ps -alqf "name=tokenbridge" --format "{{.ID}}"):/workspace/localNetwork.json .` + const stdOut = execSync(command) + console.log(stdOut.toString()) + + if (!fs.existsSync(taskArgs.deploymentFile)) { + throw new Error(`Unable to fetch deployment file: ${taskArgs.deploymentFile}`) + } + console.log(`Deployment file saved to ${taskArgs.deploymentFile}`) + }) + +// Read arbitrum contract addresses from deployment file and write them to the address book +task('migrate:nitro:address-book', 'Write arbitrum addresses to address book') + .addParam('deploymentFile', 'The testnode deployment file to use') + .addParam('arbitrumAddressBook', 'Arbitrum address book file') + .setAction(async (taskArgs, hre) => { + if (!fs.existsSync(taskArgs.deploymentFile)) { + await hre.run('migrate:nitro:deployment-file', taskArgs) + } + const deployment = JSON.parse(fs.readFileSync(taskArgs.deploymentFile, 'utf-8')) + + const addressBook = { + 1337: { + L1GatewayRouter: { + address: deployment.l2Network.tokenBridge.l1GatewayRouter, + }, + IInbox: { + address: deployment.l2Network.ethBridge.inbox, + }, + }, + 412346: { + L2GatewayRouter: { + address: deployment.l2Network.tokenBridge.l2GatewayRouter, + }, + }, + } + + fs.writeFileSync(taskArgs.arbitrumAddressBook, JSON.stringify(addressBook)) + }) diff --git a/packages/contracts/tasks/migrate/protocol.ts b/packages/contracts/tasks/migrate/protocol.ts new file mode 100644 index 000000000..38664a573 --- /dev/null +++ b/packages/contracts/tasks/migrate/protocol.ts @@ -0,0 +1,25 @@ +import { deployGraphNetwork, GraphChainId } from '@graphprotocol/sdk' +import { greTask } from '@graphprotocol/sdk/gre' + +greTask('migrate', 'Deploy protocol contracts') + .addFlag('skipConfirmation', 'Skip confirmation prompt on write actions') + .addFlag('skipPostDeploy', 'Skip accepting ownership and unpausing protocol after deploying') + .addFlag('force', 'Deploy contract even if its already deployed') + .addFlag('buildAcceptTx', '...') + .setAction(async (taskArgs, hre) => { + const graph = hre.graph(taskArgs) + + await deployGraphNetwork( + taskArgs.addressBook, + taskArgs.graphConfig, + graph.chainId as GraphChainId, // TODO: fix type + await graph.getDeployer(), + graph.provider, + { + governor: taskArgs.skipPostDeploy ? undefined : (await graph.getNamedAccounts()).governor, + forceDeploy: taskArgs.force, + skipConfirmation: taskArgs.skipConfirmation, + buildAcceptTx: taskArgs.buildAcceptTx, + }, + ) + }) diff --git a/tasks/test-upgrade.ts b/packages/contracts/tasks/test-upgrade.ts similarity index 95% rename from tasks/test-upgrade.ts rename to packages/contracts/tasks/test-upgrade.ts index c00254c44..911d2ac75 100644 --- a/tasks/test-upgrade.ts +++ b/packages/contracts/tasks/test-upgrade.ts @@ -1,5 +1,4 @@ import fs from 'fs' - import { task } from 'hardhat/config' function saveProxyAddresses(data) { @@ -18,14 +17,14 @@ interface UpgradeableContract { const UPGRADEABLE_CONTRACTS: UpgradeableContract[] = [ { name: 'EpochManager' }, { name: 'Curation' }, - { name: 'Staking', libraries: ['LibCobbDouglas'] }, + { name: 'Staking', libraries: ['LibExponential'] }, { name: 'DisputeManager' }, { name: 'RewardsManager' }, { name: 'ServiceRegistry' }, ] task('test:upgrade-setup', 'Deploy contracts using an OZ proxy').setAction( - async (taskArgs, hre) => { + async (_, hre) => { const contractAddresses = {} for (const upgradeableContract of UPGRADEABLE_CONTRACTS) { // Deploy libraries diff --git a/packages/contracts/tasks/verify/defender.ts b/packages/contracts/tasks/verify/defender.ts new file mode 100644 index 000000000..24ad83f59 --- /dev/null +++ b/packages/contracts/tasks/verify/defender.ts @@ -0,0 +1,109 @@ +import { execSync } from 'child_process' +import { task } from 'hardhat/config' +import { HardhatRuntimeEnvironment as HRE } from 'hardhat/types' +import { constants } from 'ethers' +import { appendFileSync } from 'fs' +import type { VerificationResponse } from '@openzeppelin/hardhat-defender/dist/verify-deployment' +import { GraphNetworkContractName, isGraphNetworkContractName } from '@graphprotocol/sdk' + +async function main( + args: { referenceUrl?: string, contracts: GraphNetworkContractName[] }, + hre: HRE, +) { + const { referenceUrl, contracts } = args + const { defender, network, graph } = hre + const summaryPath = process.env.GITHUB_STEP_SUMMARY + if (summaryPath) appendFileSync(summaryPath, `# Contracts deployment verification\n\n`) + + const workflowUrl + = referenceUrl + || process.env.WORKFLOW_URL + || execSync(`git config --get remote.origin.url`).toString().trim() + const addressBook = graph().addressBook + const errs = [] + + for (const contractName of contracts) { + if (!isGraphNetworkContractName(contractName)) { + throw new Error(`Invalid contract name: ${contractName as string}`) + } + const entry = addressBook.getEntry(contractName) + if (!entry || entry.address === constants.AddressZero) { + errs.push([contractName, { message: `Entry not found on address book.` }]) + continue + } + + const addressToVerify = entry.implementation?.address ?? entry.address + console.error(`Verifying artifact for ${contractName} at ${addressToVerify}`) + + try { + const response = await defender.verifyDeployment(addressToVerify, contractName, workflowUrl) + console.error(`Bytecode match for ${contractName} is ${response.matchType}`) + if (summaryPath) { + appendFileSync( + summaryPath, + `- ${contractName} at ${etherscanLink(network.name, addressToVerify)} is ${ + response.matchType + } ${emojiForMatch(response.matchType)}\n`, + ) + } + if (response.matchType === 'NO_MATCH') { + errs.push([contractName, { message: `No bytecode match.` }]) + } + } catch (err) { + if (summaryPath) { + appendFileSync( + summaryPath, + `- ${contractName} at ${etherscanLink( + network.name, + addressToVerify, + )} failed to verify :x:\n`, + ) + } + console.error(`Error verifying artifact: ${err.message}`) + errs.push([contractName, err]) + } + } + + if (errs.length > 0) { + throw new Error( + `Some verifications failed:\n${errs + .map(([name, err]) => ` ${name}: ${err.message}`) + .join('\n')}`, + ) + } +} + +function etherscanLink(network: string, address: string): string { + switch (network) { + case 'mainnet': + return `[\`${address}\`](https://etherscan.io/address/${address})` + case 'arbitrum-one': + return `[\`${address}\`](https://arbiscan.io/address/${address})` + case 'goerli': + return `[\`${address}\`](https://goerli.etherscan.io/address/${address})` + case 'arbitrum-goerli': + return `[\`${address}\`](https://goerli.arbiscan.io/address/${address})` + default: + return `\`${address}\`` + } +} + +function emojiForMatch(matchType: VerificationResponse['matchType']): string { + switch (matchType) { + case 'EXACT': + return ':heavy_check_mark:' + case 'PARTIAL': + return ':warning:' + case 'NO_MATCH': + return ':x:' + } +} + +task('verify-defender') + .addVariadicPositionalParam('contracts', 'List of contracts to verify') + .addOptionalParam( + 'referenceUrl', + 'URL to link to for artifact verification (defaults to $WORKFLOW_URL or the remote.origin.url of the repository)', + ) + .setDescription('Verifies deployed implementations on Defender') + .setAction(main) diff --git a/packages/contracts/tasks/verify/sourcify.ts b/packages/contracts/tasks/verify/sourcify.ts new file mode 100644 index 000000000..027885006 --- /dev/null +++ b/packages/contracts/tasks/verify/sourcify.ts @@ -0,0 +1,78 @@ +/* eslint-disable no-secrets/no-secrets */ +/* eslint-disable @typescript-eslint/no-explicit-any */ +import axios from 'axios' +import FormData from 'form-data' +import { HardhatRuntimeEnvironment } from 'hardhat/types' +import { Readable } from 'stream' + +// Inspired by: +// - https://github.com/wighawag/hardhat-deploy/blob/9c8cd433a37188e793181b727222e2d22aef34b0/src/sourcify.ts +// - https://github.com/zoey-t/hardhat-sourcify/blob/26f10a08eb6cf97700c78989bf42b009c9cb3275/src/sourcify.ts +export async function submitSourcesToSourcify( + hre: HardhatRuntimeEnvironment, + contract: { + source: string + name: string + address: string + fqn: string + }, +): Promise { + const chainId = hre.network.config.chainId + const sourcifyUrl = 'https://sourcify.dev/server/' + + // Get contract metadata + const contractBuildInfo = await hre.artifacts.getBuildInfo(contract.fqn) + const contractMetadata = ( + contractBuildInfo.output.contracts[contract.source][contract.name] as any + ).metadata + + if (contractMetadata === undefined) { + console.error( + `Contract ${contract.name} was deployed without saving metadata. Cannot submit to sourcify, skipping.`, + ) + return + } + + // Check if contract already verified + try { + const checkResponse = await axios.get( + `${sourcifyUrl}checkByAddresses?addresses=${contract.address.toLowerCase()}&chainIds=${chainId}`, + ) + const { data: checkData } = checkResponse + if (checkData[0].status === 'perfect') { + console.log(`already verified: ${contract.name} (${contract.address}), skipping.`) + return + } + } catch (e) { + console.error(((e).response && JSON.stringify((e).response.data)) || e) + } + + console.log(`verifying ${contract.name} (${contract.address} on chain ${chainId}) ...`) + + // Build form data + const formData = new FormData() + formData.append('address', contract.address) + formData.append('chain', chainId) + + const fileStream = new Readable() + fileStream.push(contractMetadata) + fileStream.push(null) + formData.append('files', fileStream) + + // Verify contract + try { + const submissionResponse = await axios.post(sourcifyUrl, formData, { + headers: formData.getHeaders(), + }) + const { status } = submissionResponse.data.result[0] + if (status === 'perfect') { + console.log(` => contract ${contract.name} is now verified`) + } else if (status === 'partial') { + console.log(` => contract ${contract.name} is partially verified`) + } else { + console.error(` => contract ${contract.name} is not verified`) + } + } catch (e) { + console.error(((e).response && JSON.stringify((e).response.data)) || e) + } +} diff --git a/packages/contracts/tasks/verify/verify.ts b/packages/contracts/tasks/verify/verify.ts new file mode 100644 index 000000000..451409e12 --- /dev/null +++ b/packages/contracts/tasks/verify/verify.ts @@ -0,0 +1,147 @@ +import { task } from 'hardhat/config' +import * as types from 'hardhat/internal/core/params/argumentTypes' +import { submitSourcesToSourcify } from './sourcify' +import { isFullyQualifiedName, parseFullyQualifiedName } from 'hardhat/utils/contract-names' +import { TASK_COMPILE } from 'hardhat/builtin-tasks/task-names' +import { greTask } from '@graphprotocol/sdk/gre' +import fs from 'fs' +import path from 'path' +import { HardhatRuntimeEnvironment } from 'hardhat/types/runtime' +import { getContractConfig, readConfig } from '@graphprotocol/sdk' + +task('sourcify', 'Verifies contract on sourcify') + .addPositionalParam('address', 'Address of the smart contract to verify', undefined, types.string) + .addParam('contract', 'Fully qualified name of the contract to verify.', undefined, types.string) + .setAction(async (args, hre) => { + if (!isFullyQualifiedName(args.contract)) { + throw new Error('Invalid fully qualified name of the contract.') + } + + const { contractName, sourceName: contractSource } = parseFullyQualifiedName(args.contract) + + if (!fs.existsSync(contractSource)) { + throw new Error(`Contract source ${contractSource} not found.`) + } + + await hre.run(TASK_COMPILE) + await submitSourcesToSourcify(hre, { + source: contractSource, + name: contractName, + address: args.address, + fqn: args.contract, + }) + }) + +greTask('sourcifyAll', 'Verifies all contracts on sourcify').setAction(async (_args, hre) => { + const chainId = hre.network.config.chainId + const chainName = hre.network.name + + if (!chainId || !chainName) { + throw new Error('Cannot verify contracts without a network') + } + console.log(`> Verifying all contracts on chain ${chainName}[${chainId}]...`) + const { addressBook } = hre.graph({ addressBook: _args.addressBook }) + + for (const contractName of addressBook.listEntries()) { + console.log(`\n> Verifying contract ${contractName}...`) + + const contractPath = getContractPath(contractName) + if (contractPath) { + const contract = addressBook.getEntry(contractName) + if (contract.implementation) { + console.log('Contract is upgradeable, verifying proxy...') + + await hre.run('sourcify', { + address: contract.address, + contract: 'contracts/upgrades/GraphProxy.sol:GraphProxy', + }) + } + + // Verify implementation + await hre.run('sourcify', { + address: contract.implementation?.address ?? contract.address, + contract: `${contractPath}:${contractName}`, + }) + } else { + console.log(`Contract ${contractName} not found.`) + } + } +}) + +greTask('verifyAll', 'Verifies all contracts on etherscan').setAction(async (args, hre) => { + const chainId = hre.network.config.chainId + const chainName = hre.network.name + + if (!chainId || !chainName) { + throw new Error('Cannot verify contracts without a network') + } + + console.log(`> Verifying all contracts on chain ${chainName}[${chainId}]...`) + const { addressBook, getDeployer } = hre.graph({ + addressBook: args.addressBook, + graphConfig: args.graphConfig, + }) + const graphConfig = readConfig(args.graphConfig, false) + const deployer = (await getDeployer()).address + for (const contractName of addressBook.listEntries()) { + console.log(`\n> Verifying contract ${contractName}...`) + + const contractConfig = getContractConfig(graphConfig, addressBook, contractName, deployer) + const contractPath = getContractPath(contractName) + const constructorParams = contractConfig.params.map(p => p.value.toString()) + + if (contractPath) { + const contract = addressBook.getEntry(contractName) + + if (contract.implementation) { + console.log('Contract is upgradeable, verifying proxy...') + const proxyAdmin = addressBook.getEntry('GraphProxyAdmin') + + // Verify proxy + await safeVerify(hre, { + address: contract.address, + contract: 'contracts/upgrades/GraphProxy.sol:GraphProxy', + constructorArgsParams: [contract.implementation.address, proxyAdmin.address], + }) + } + + // Verify implementation + console.log('Verifying implementation...') + await safeVerify(hre, { + address: contract.implementation?.address ?? contract.address, + contract: `${contractPath}:${contractName}`, + constructorArgsParams: contract.implementation ? [] : constructorParams, + }) + } else { + console.log(`Contract ${contractName} not found.`) + } + } +}) + +// etherscan API throws errors if the contract is already verified +async function safeVerify(hre: HardhatRuntimeEnvironment, taskArguments: unknown): Promise { + try { + await hre.run('verify', taskArguments) + } catch (error) { + console.log(error.message) + } +} + +function getContractPath(contract: string): string | undefined { + const files = readDirRecursive('contracts/') + return files.find(f => path.basename(f) === `${contract}.sol`) +} + +function readDirRecursive(dir: string, allFiles: string[] = []) { + const files = fs.readdirSync(dir) + + for (const file of files) { + if (fs.statSync(path.join(dir, file)).isDirectory()) { + allFiles = readDirRecursive(path.join(dir, file), allFiles) + } else { + allFiles.push(path.join(dir, file)) + } + } + + return allFiles +} diff --git a/packages/contracts/test/unit/curation/configuration.test.ts b/packages/contracts/test/unit/curation/configuration.test.ts new file mode 100644 index 000000000..8e4695234 --- /dev/null +++ b/packages/contracts/test/unit/curation/configuration.test.ts @@ -0,0 +1,137 @@ +import hre from 'hardhat' +import { expect } from 'chai' +import { constants } from 'ethers' + +import { NetworkFixture } from '../lib/fixtures' +import { GraphNetworkContracts, randomAddress, toBN } from '@graphprotocol/sdk' + +import type { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers' + +const { AddressZero } = constants + +const MAX_PPM = 1000000 + +describe('Curation:Config', () => { + let me: SignerWithAddress + let governor: SignerWithAddress + + let fixture: NetworkFixture + + let contracts: GraphNetworkContracts + + const graph = hre.graph() + const defaults = graph.graphConfig.defaults + + before(async function () { + [me] = await graph.getTestAccounts() + ;({ governor } = await graph.getNamedAccounts()) + fixture = new NetworkFixture(graph.provider) + contracts = await fixture.load(governor) + }) + + beforeEach(async function () { + await fixture.setUp() + }) + + afterEach(async function () { + await fixture.tearDown() + }) + + describe('defaultReserveRatio', function () { + it('should set `defaultReserveRatio`', async function () { + // Set right in the constructor + expect(await contracts.Curation.defaultReserveRatio()).eq(defaults.curation.reserveRatio) + + // Can set if allowed + const newValue = toBN('100') + await contracts.Curation.connect(governor).setDefaultReserveRatio(newValue) + expect(await contracts.Curation.defaultReserveRatio()).eq(newValue) + }) + + it('reject set `defaultReserveRatio` if out of bounds', async function () { + const tx1 = contracts.Curation.connect(governor).setDefaultReserveRatio(0) + await expect(tx1).revertedWith('Default reserve ratio must be > 0') + + const tx2 = contracts.Curation.connect(governor).setDefaultReserveRatio(MAX_PPM + 1) + await expect(tx2).revertedWith('Default reserve ratio cannot be higher than MAX_PPM') + }) + + it('reject set `defaultReserveRatio` if not allowed', async function () { + const tx = contracts.Curation.connect(me).setDefaultReserveRatio( + defaults.curation.reserveRatio, + ) + await expect(tx).revertedWith('Only Controller governor') + }) + }) + + describe('minimumCurationDeposit', function () { + it('should set `minimumCurationDeposit`', async function () { + // Set right in the constructor + expect(await contracts.Curation.minimumCurationDeposit()).eq( + defaults.curation.minimumCurationDeposit, + ) + + // Can set if allowed + const newValue = toBN('100') + await contracts.Curation.connect(governor).setMinimumCurationDeposit(newValue) + expect(await contracts.Curation.minimumCurationDeposit()).eq(newValue) + }) + + it('reject set `minimumCurationDeposit` if out of bounds', async function () { + const tx = contracts.Curation.connect(governor).setMinimumCurationDeposit(0) + await expect(tx).revertedWith('Minimum curation deposit cannot be 0') + }) + + it('reject set `minimumCurationDeposit` if not allowed', async function () { + const tx = contracts.Curation.connect(me).setMinimumCurationDeposit( + defaults.curation.minimumCurationDeposit, + ) + await expect(tx).revertedWith('Only Controller governor') + }) + }) + + describe('curationTaxPercentage', function () { + it('should set `curationTaxPercentage`', async function () { + const curationTaxPercentage = defaults.curation.curationTaxPercentage + + // Set new value + await contracts.Curation.connect(governor).setCurationTaxPercentage(0) + await contracts.Curation.connect(governor).setCurationTaxPercentage(curationTaxPercentage) + }) + + it('reject set `curationTaxPercentage` if out of bounds', async function () { + const tx = contracts.Curation.connect(governor).setCurationTaxPercentage(MAX_PPM + 1) + await expect(tx).revertedWith('Curation tax percentage must be below or equal to MAX_PPM') + }) + + it('reject set `curationTaxPercentage` if not allowed', async function () { + const tx = contracts.Curation.connect(me).setCurationTaxPercentage(0) + await expect(tx).revertedWith('Only Controller governor') + }) + }) + + describe('curationTokenMaster', function () { + it('should set `curationTokenMaster`', async function () { + const newCurationTokenMaster = contracts.Curation.address + await contracts.Curation.connect(governor).setCurationTokenMaster(newCurationTokenMaster) + }) + + it('reject set `curationTokenMaster` to empty value', async function () { + const newCurationTokenMaster = AddressZero + const tx = contracts.Curation.connect(governor).setCurationTokenMaster(newCurationTokenMaster) + await expect(tx).revertedWith('Token master must be non-empty') + }) + + it('reject set `curationTokenMaster` to non-contract', async function () { + const newCurationTokenMaster = randomAddress() + const tx = contracts.Curation.connect(governor).setCurationTokenMaster(newCurationTokenMaster) + await expect(tx).revertedWith('Token master must be a contract') + }) + + it('reject set `curationTokenMaster` if not allowed', async function () { + const newCurationTokenMaster = contracts.Curation.address + const tx = contracts.Curation.connect(me).setCurationTokenMaster(newCurationTokenMaster) + await expect(tx).revertedWith('Only Controller governor') + }) + }) +}) diff --git a/packages/contracts/test/unit/curation/curation.test.ts b/packages/contracts/test/unit/curation/curation.test.ts new file mode 100644 index 000000000..ee8e30bd7 --- /dev/null +++ b/packages/contracts/test/unit/curation/curation.test.ts @@ -0,0 +1,640 @@ +import hre from 'hardhat' +import { expect } from 'chai' +import { BigNumber, Event, utils } from 'ethers' + +import { NetworkFixture } from '../lib/fixtures' +import { parseEther } from 'ethers/lib/utils' +import { + formatGRT, + GraphNetworkContracts, + helpers, + randomHexBytes, + toBN, + toGRT, +} from '@graphprotocol/sdk' +import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers' + +const MAX_PPM = 1000000 + +const chunkify = (total: BigNumber, maxChunks = 10): Array => { + const chunks = [] + while (total.gt(0) && maxChunks > 0) { + const m = 1000000 + const p = Math.floor(Math.random() * m) + const n = total.mul(p).div(m) + chunks.push(n) + total = total.sub(n) + maxChunks-- + } + if (total.gt(0)) { + chunks.push(total) + } + return chunks as BigNumber[] +} + +const toFloat = (n: BigNumber) => parseFloat(formatGRT(n)) +const toRound = (n: number) => n.toFixed(12) + +describe('Curation', () => { + let me: SignerWithAddress + let governor: SignerWithAddress + let curator: SignerWithAddress + let stakingMock: SignerWithAddress + let gnsImpersonator: SignerWithAddress + + let fixture: NetworkFixture + + let contracts: GraphNetworkContracts + + const graph = hre.graph() + + // Test values + const signalAmountFor1000Tokens = toGRT('3.162277660168379331') + const subgraphDeploymentID = randomHexBytes() + const curatorTokens = toGRT('1000000000') + const tokensToDeposit = toGRT('1000') + const tokensToCollect = toGRT('2000') + + async function calcBondingCurve( + supply: BigNumber, + reserveBalance: BigNumber, + reserveRatio: number, + depositAmount: BigNumber, + ): Promise { + // Handle the initialization of the bonding curve + if (supply.eq(0)) { + const minDeposit = await contracts.Curation.minimumCurationDeposit() + if (depositAmount.lt(minDeposit)) { + throw new Error('deposit must be above minimum') + } + const defaultReserveRatio = await contracts.Curation.defaultReserveRatio() + const minSupply = toGRT('1') + return ( + (await calcBondingCurve( + minSupply, + minDeposit, + defaultReserveRatio, + depositAmount.sub(minDeposit), + )) + toFloat(minSupply) + ) + } + // Calculate bonding curve in the test + return ( + toFloat(supply) + * ((1 + toFloat(depositAmount) / toFloat(reserveBalance)) ** (reserveRatio / 1000000) - 1) + ) + } + + const shouldMint = async (tokensToDeposit: BigNumber, expectedSignal: BigNumber) => { + // Before state + const beforeTokenTotalSupply = await contracts.GraphToken.totalSupply() + const beforeCuratorTokens = await contracts.GraphToken.balanceOf(curator.address) + const beforeCuratorSignal = await contracts.Curation.getCuratorSignal( + curator.address, + subgraphDeploymentID, + ) + const beforePool = await contracts.Curation.pools(subgraphDeploymentID) + const beforePoolSignal = await contracts.Curation.getCurationPoolSignal(subgraphDeploymentID) + const beforeTotalTokens = await contracts.GraphToken.balanceOf(contracts.Curation.address) + + // Calculations + const curationTaxPercentage = await contracts.Curation.curationTaxPercentage() + const curationTax = tokensToDeposit.mul(toBN(curationTaxPercentage)).div(toBN(MAX_PPM)) + + // Curate + const tx = contracts.Curation.connect(curator).mint(subgraphDeploymentID, tokensToDeposit, 0) + await expect(tx) + .emit(contracts.Curation, 'Signalled') + .withArgs(curator.address, subgraphDeploymentID, tokensToDeposit, expectedSignal, curationTax) + + // After state + const afterTokenTotalSupply = await contracts.GraphToken.totalSupply() + const afterCuratorTokens = await contracts.GraphToken.balanceOf(curator.address) + const afterCuratorSignal = await contracts.Curation.getCuratorSignal( + curator.address, + subgraphDeploymentID, + ) + const afterPool = await contracts.Curation.pools(subgraphDeploymentID) + const afterPoolSignal = await contracts.Curation.getCurationPoolSignal(subgraphDeploymentID) + const afterTotalTokens = await contracts.GraphToken.balanceOf(contracts.Curation.address) + + // Curator balance updated + expect(afterCuratorTokens).eq(beforeCuratorTokens.sub(tokensToDeposit)) + expect(afterCuratorSignal).eq(beforeCuratorSignal.add(expectedSignal)) + // Allocated and balance updated + expect(afterPool.tokens).eq(beforePool.tokens.add(tokensToDeposit.sub(curationTax))) + expect(afterPoolSignal).eq(beforePoolSignal.add(expectedSignal)) + expect(afterPool.reserveRatio).eq(await contracts.Curation.defaultReserveRatio()) + // Contract balance updated + expect(afterTotalTokens).eq(beforeTotalTokens.add(tokensToDeposit.sub(curationTax))) + // Total supply is reduced to curation tax burning + expect(afterTokenTotalSupply).eq(beforeTokenTotalSupply.sub(curationTax)) + } + + const shouldBurn = async (signalToRedeem: BigNumber, expectedTokens: BigNumber) => { + // Before balances + const beforeTokenTotalSupply = await contracts.GraphToken.totalSupply() + const beforeCuratorTokens = await contracts.GraphToken.balanceOf(curator.address) + const beforeCuratorSignal = await contracts.Curation.getCuratorSignal( + curator.address, + subgraphDeploymentID, + ) + const beforePool = await contracts.Curation.pools(subgraphDeploymentID) + const beforePoolSignal = await contracts.Curation.getCurationPoolSignal(subgraphDeploymentID) + const beforeTotalTokens = await contracts.GraphToken.balanceOf(contracts.Curation.address) + + // Redeem + const tx = contracts.Curation.connect(curator).burn(subgraphDeploymentID, signalToRedeem, 0) + await expect(tx) + .emit(contracts.Curation, 'Burned') + .withArgs(curator.address, subgraphDeploymentID, expectedTokens, signalToRedeem) + + // After balances + const afterTokenTotalSupply = await contracts.GraphToken.totalSupply() + const afterCuratorTokens = await contracts.GraphToken.balanceOf(curator.address) + const afterCuratorSignal = await contracts.Curation.getCuratorSignal( + curator.address, + subgraphDeploymentID, + ) + const afterPool = await contracts.Curation.pools(subgraphDeploymentID) + const afterPoolSignal = await contracts.Curation.getCurationPoolSignal(subgraphDeploymentID) + const afterTotalTokens = await contracts.GraphToken.balanceOf(contracts.Curation.address) + + // Curator balance updated + expect(afterCuratorTokens).eq(beforeCuratorTokens.add(expectedTokens)) + expect(afterCuratorSignal).eq(beforeCuratorSignal.sub(signalToRedeem)) + // Curation balance updated + expect(afterPool.tokens).eq(beforePool.tokens.sub(expectedTokens)) + expect(afterPoolSignal).eq(beforePoolSignal.sub(signalToRedeem)) + // Contract balance updated + expect(afterTotalTokens).eq(beforeTotalTokens.sub(expectedTokens)) + // Total supply is conserved + expect(afterTokenTotalSupply).eq(beforeTokenTotalSupply) + } + + const shouldCollect = async (tokensToCollect: BigNumber) => { + // Before state + const beforePool = await contracts.Curation.pools(subgraphDeploymentID) + const beforeTotalBalance = await contracts.GraphToken.balanceOf(contracts.Curation.address) + + // Source of tokens must be the staking for this to work + await contracts.GraphToken.connect(stakingMock).transfer( + contracts.Curation.address, + tokensToCollect, + ) + const tx = contracts.Curation.connect(stakingMock).collect( + subgraphDeploymentID, + tokensToCollect, + ) + await expect(tx) + .emit(contracts.Curation, 'Collected') + .withArgs(subgraphDeploymentID, tokensToCollect) + + // After state + const afterPool = await contracts.Curation.pools(subgraphDeploymentID) + const afterTotalBalance = await contracts.GraphToken.balanceOf(contracts.Curation.address) + + // State updated + expect(afterPool.tokens).eq(beforePool.tokens.add(tokensToCollect)) + expect(afterTotalBalance).eq(beforeTotalBalance.add(tokensToCollect)) + } + + before(async function () { + // Use stakingMock so we can call collect + [me, curator, stakingMock] = await graph.getTestAccounts() + ;({ governor } = await graph.getNamedAccounts()) + + fixture = new NetworkFixture(graph.provider) + contracts = await fixture.load(governor) + + gnsImpersonator = await helpers.impersonateAccount(contracts.GNS.address) + await helpers.setBalance(contracts.GNS.address, parseEther('1')) + // Give some funds to the curator and GNS impersonator and approve the curation contract + await contracts.GraphToken.connect(governor).mint(curator.address, curatorTokens) + await contracts.GraphToken.connect(curator).approve(contracts.Curation.address, curatorTokens) + await contracts.GraphToken.connect(governor).mint(contracts.GNS.address, curatorTokens) + await contracts.GraphToken.connect(gnsImpersonator).approve( + contracts.Curation.address, + curatorTokens, + ) + + // Give some funds to the staking contract and approve the curation contract + await contracts.GraphToken.connect(governor).mint(stakingMock.address, tokensToCollect) + await contracts.GraphToken.connect(stakingMock).approve( + contracts.Curation.address, + tokensToCollect, + ) + }) + + beforeEach(async function () { + await fixture.setUp() + }) + + afterEach(async function () { + await fixture.tearDown() + }) + + describe('bonding curve', function () { + const tokensToDeposit = curatorTokens + + it('reject convert signal to tokens if subgraph deployment not initted', async function () { + const tx = contracts.Curation.signalToTokens(subgraphDeploymentID, toGRT('100')) + await expect(tx).revertedWith('Subgraph deployment must be curated to perform calculations') + }) + + it('convert signal to tokens', async function () { + // Curate + await contracts.Curation.connect(curator).mint(subgraphDeploymentID, tokensToDeposit, 0) + + // Conversion + const signal = await contracts.Curation.getCurationPoolSignal(subgraphDeploymentID) + const expectedTokens = await contracts.Curation.signalToTokens(subgraphDeploymentID, signal) + expect(expectedTokens).eq(tokensToDeposit) + }) + + it('convert signal to tokens (with curation tax)', async function () { + // Set curation tax + const curationTaxPercentage = 50000 // 5% + await contracts.Curation.connect(governor).setCurationTaxPercentage(curationTaxPercentage) + + // Curate + const expectedCurationTax = tokensToDeposit.mul(curationTaxPercentage).div(MAX_PPM) + const { 1: curationTax } = await contracts.Curation.tokensToSignal( + subgraphDeploymentID, + tokensToDeposit, + ) + await contracts.Curation.connect(curator).mint(subgraphDeploymentID, tokensToDeposit, 0) + + // Conversion + const signal = await contracts.Curation.getCurationPoolSignal(subgraphDeploymentID) + const tokens = await contracts.Curation.signalToTokens(subgraphDeploymentID, signal) + expect(tokens).eq(tokensToDeposit.sub(expectedCurationTax)) + expect(expectedCurationTax).eq(curationTax) + }) + + it('convert tokens to signal', async function () { + // Conversion + const tokens = toGRT('1000') + const { 0: signal } = await contracts.Curation.tokensToSignal(subgraphDeploymentID, tokens) + expect(signal).eq(signalAmountFor1000Tokens) + }) + + it('convert tokens to signal if non-curated subgraph', async function () { + // Conversion + const nonCuratedSubgraphDeploymentID = randomHexBytes() + const tokens = toGRT('1') + const tx = contracts.Curation.tokensToSignal(nonCuratedSubgraphDeploymentID, tokens) + await expect(tx).revertedWith('Curation deposit is below minimum required') + }) + }) + + describe('curate', function () { + it('reject deposit below minimum tokens required', async function () { + const tokensToDeposit = (await contracts.Curation.minimumCurationDeposit()).sub(toBN(1)) + const tx = contracts.Curation.connect(curator).mint(subgraphDeploymentID, tokensToDeposit, 0) + await expect(tx).revertedWith('Curation deposit is below minimum required') + }) + + it('should deposit on a subgraph deployment', async function () { + const tokensToDeposit = await contracts.Curation.minimumCurationDeposit() + const expectedSignal = toGRT('1') + await shouldMint(tokensToDeposit, expectedSignal) + }) + + it('should get signal according to bonding curve', async function () { + const tokensToDeposit = toGRT('1000') + const expectedSignal = signalAmountFor1000Tokens + await shouldMint(tokensToDeposit, expectedSignal) + }) + + it('should get signal according to bonding curve (and account for curation tax)', async function () { + // Set curation tax + await contracts.Curation.connect(governor).setCurationTaxPercentage(50000) // 5% + + // Mint + const tokensToDeposit = toGRT('1000') + const { 0: expectedSignal } = await contracts.Curation.tokensToSignal( + subgraphDeploymentID, + tokensToDeposit, + ) + await shouldMint(tokensToDeposit, expectedSignal) + }) + + it('should revert curate if over slippage', async function () { + const tokensToDeposit = toGRT('1000') + const expectedSignal = signalAmountFor1000Tokens + const tx = contracts.Curation.connect(curator).mint( + subgraphDeploymentID, + tokensToDeposit, + expectedSignal.add(1), + ) + await expect(tx).revertedWith('Slippage protection') + }) + }) + + describe('collect', function () { + context('> not curated', function () { + it('reject collect tokens distributed to the curation pool', async function () { + // Source of tokens must be the staking for this to work + await contracts.Controller.connect(governor).setContractProxy( + utils.id('Staking'), + stakingMock.address, + ) + await contracts.Curation.connect(governor).syncAllContracts() // call sync because we change the proxy for staking + + const tx = contracts.Curation.connect(stakingMock).collect( + subgraphDeploymentID, + tokensToCollect, + ) + await expect(tx).revertedWith('Subgraph deployment must be curated to collect fees') + }) + }) + + context('> curated', function () { + beforeEach(async function () { + await contracts.Curation.connect(curator).mint(subgraphDeploymentID, toGRT('1000'), 0) + }) + + it('reject collect tokens distributed from invalid address', async function () { + const tx = contracts.Curation.connect(me).collect(subgraphDeploymentID, tokensToCollect) + await expect(tx).revertedWith('Caller must be the staking contract') + }) + + it('should collect tokens distributed to the curation pool', async function () { + await contracts.Controller.connect(governor).setContractProxy( + utils.id('Staking'), + stakingMock.address, + ) + await contracts.Curation.connect(governor).syncAllContracts() // call sync because we change the proxy for staking + + await shouldCollect(toGRT('1')) + await shouldCollect(toGRT('10')) + await shouldCollect(toGRT('100')) + await shouldCollect(toGRT('200')) + await shouldCollect(toGRT('500.25')) + }) + + it('should collect tokens and then unsignal all', async function () { + await contracts.Controller.connect(governor).setContractProxy( + utils.id('Staking'), + stakingMock.address, + ) + await contracts.Curation.connect(governor).syncAllContracts() // call sync because we change the proxy for staking + + // Collect increase the pool reserves + await shouldCollect(toGRT('100')) + + // When we burn signal we should get more tokens than initially curated + const signalToRedeem = await contracts.Curation.getCuratorSignal( + curator.address, + subgraphDeploymentID, + ) + await shouldBurn(signalToRedeem, toGRT('1100')) + }) + + it('should collect tokens and then unsignal multiple times', async function () { + await contracts.Controller.connect(governor).setContractProxy( + utils.id('Staking'), + stakingMock.address, + ) + await contracts.Curation.connect(governor).syncAllContracts() // call sync because we change the proxy for staking + + // Collect increase the pool reserves + const tokensToCollect = toGRT('100') + await shouldCollect(tokensToCollect) + + // Unsignal partially + const signalOutRemainder = toGRT(1) + const signalOutPartial = ( + await contracts.Curation.getCuratorSignal(curator.address, subgraphDeploymentID) + ).sub(signalOutRemainder) + const tx1 = await contracts.Curation.connect(curator).burn( + subgraphDeploymentID, + signalOutPartial, + 0, + ) + const r1 = await tx1.wait() + const event1 = contracts.Curation.interface.parseLog(r1.events[2]).args + const tokensOut1 = event1.tokens + + // Collect increase the pool reserves + await shouldCollect(tokensToCollect) + + // Unsignal the rest + const tx2 = await contracts.Curation.connect(curator).burn( + subgraphDeploymentID, + signalOutRemainder, + 0, + ) + const r2 = await tx2.wait() + const event2 = contracts.Curation.interface.parseLog(r2.events[2]).args + const tokensOut2 = event2.tokens + + expect(tokensOut1.add(tokensOut2)).eq(toGRT('1000').add(tokensToCollect.mul(2))) + }) + }) + }) + + describe('burn', function () { + beforeEach(async function () { + await contracts.Curation.connect(curator).mint(subgraphDeploymentID, tokensToDeposit, 0) + }) + + it('reject redeem more than a curator owns', async function () { + const tx = contracts.Curation.connect(me).burn(subgraphDeploymentID, toGRT('1'), 0) + await expect(tx).revertedWith('Cannot burn more signal than you own') + }) + + it('reject redeem zero signal', async function () { + const tx = contracts.Curation.connect(me).burn(subgraphDeploymentID, toGRT('0'), 0) + await expect(tx).revertedWith('Cannot burn zero signal') + }) + + it('should allow to redeem *partially*', async function () { + // Redeem just one signal + const signalToRedeem = toGRT('1') + const expectedTokens = toGRT('532.455532033675866536') + await shouldBurn(signalToRedeem, expectedTokens) + }) + + it('should allow to redeem *fully*', async function () { + // Get all signal of the curator + const signalToRedeem = await contracts.Curation.getCuratorSignal( + curator.address, + subgraphDeploymentID, + ) + const expectedTokens = tokensToDeposit + await shouldBurn(signalToRedeem, expectedTokens) + }) + + it('should allow to redeem back below minimum deposit', async function () { + // Redeem "almost" all signal + const signal = await contracts.Curation.getCuratorSignal( + curator.address, + subgraphDeploymentID, + ) + const signalToRedeem = signal.sub(toGRT('0.000001')) + const expectedTokens = await contracts.Curation.signalToTokens( + subgraphDeploymentID, + signalToRedeem, + ) + await shouldBurn(signalToRedeem, expectedTokens) + + // The pool should have less tokens that required by minimumCurationDeposit + const afterPool = await contracts.Curation.pools(subgraphDeploymentID) + expect(afterPool.tokens).lt(await contracts.Curation.minimumCurationDeposit()) + + // Should be able to deposit more after being under minimumCurationDeposit + const tokensToDeposit = toGRT('1') + const { 0: expectedSignal } = await contracts.Curation.tokensToSignal( + subgraphDeploymentID, + tokensToDeposit, + ) + await shouldMint(tokensToDeposit, expectedSignal) + }) + + it('should revert redeem if over slippage', async function () { + const signalToRedeem = await contracts.Curation.getCuratorSignal( + curator.address, + subgraphDeploymentID, + ) + const expectedTokens = tokensToDeposit + + const tx = contracts.Curation.connect(curator).burn( + subgraphDeploymentID, + signalToRedeem, + expectedTokens.add(1), + ) + await expect(tx).revertedWith('Slippage protection') + }) + + it('should not re-deploy the curation token when signal is reset', async function () { + const beforeSubgraphPool = await contracts.Curation.pools(subgraphDeploymentID) + + // Burn all the signal + const signalToRedeem = await contracts.Curation.getCuratorSignal( + curator.address, + subgraphDeploymentID, + ) + const expectedTokens = tokensToDeposit + await shouldBurn(signalToRedeem, expectedTokens) + + // Mint again on the same subgraph + await contracts.Curation.connect(curator).mint(subgraphDeploymentID, tokensToDeposit, 0) + + // Check state + const afterSubgraphPool = await contracts.Curation.pools(subgraphDeploymentID) + expect(afterSubgraphPool.gcs).eq(beforeSubgraphPool.gcs) + }) + }) + + describe('conservation', function () { + it('should match multiple deposits and redeems back to initial state', async function () { + this.timeout(60000) // increase timeout for test runner + + const totalDeposits = toGRT('1000000000') + + // Signal multiple times + let totalSignal = toGRT('0') + for (const tokensToDeposit of chunkify(totalDeposits, 10)) { + const tx = await contracts.Curation.connect(curator).mint( + subgraphDeploymentID, + tokensToDeposit, + 0, + ) + const receipt = await tx.wait() + const event: Event = receipt.events.pop() + const signal = event.args['signal'] + totalSignal = totalSignal.add(signal) + } + + // Redeem signal multiple times + let totalTokens = toGRT('0') + for (const signalToRedeem of chunkify(totalSignal, 10)) { + const tx = await contracts.Curation.connect(curator).burn( + subgraphDeploymentID, + signalToRedeem, + 0, + ) + const receipt = await tx.wait() + const event: Event = receipt.events.pop() + const tokens = event.args['tokens'] + totalTokens = totalTokens.add(tokens) + // console.log('<', formatEther(signalToRedeem), '=', formatEther(tokens)) + } + + // Conservation of work + const afterPool = await contracts.Curation.pools(subgraphDeploymentID) + const afterPoolSignal = await contracts.Curation.getCurationPoolSignal(subgraphDeploymentID) + expect(afterPool.tokens).eq(toGRT('0')) + expect(afterPoolSignal).eq(toGRT('0')) + expect(await contracts.Curation.isCurated(subgraphDeploymentID)).eq(false) + expect(totalDeposits).eq(totalTokens) + }) + }) + + describe('multiple minting', function () { + it('should mint less signal every time due to the bonding curve', async function () { + const tokensToDepositMany = [ + toGRT('1000'), // should mint if we start with number above minimum deposit + toGRT('1000'), // every time it should mint less GCS due to bonding curve... + toGRT('1000'), + toGRT('1000'), + toGRT('2000'), + toGRT('2000'), + toGRT('123'), + toGRT('1'), // should mint below minimum deposit + ] + for (const tokensToDeposit of tokensToDepositMany) { + const expectedSignal = await calcBondingCurve( + await contracts.Curation.getCurationPoolSignal(subgraphDeploymentID), + await contracts.Curation.getCurationPoolTokens(subgraphDeploymentID), + await contracts.Curation.defaultReserveRatio(), + tokensToDeposit, + ) + + const tx = await contracts.Curation.connect(curator).mint( + subgraphDeploymentID, + tokensToDeposit, + 0, + ) + const receipt = await tx.wait() + const event: Event = receipt.events.pop() + const signal = event.args['signal'] + expect(toRound(expectedSignal)).eq(toRound(toFloat(signal))) + } + }) + + it('should mint when using the edge case of linear function', async function () { + this.timeout(60000) // increase timeout for test runner + + // Setup edge case like linear function: 1 GRT = 1 GCS + await contracts.Curation.connect(governor).setMinimumCurationDeposit(toGRT('1')) + await contracts.Curation.connect(governor).setDefaultReserveRatio(1000000) + + const tokensToDepositMany = [ + toGRT('1000'), // should mint if we start with number above minimum deposit + toGRT('1000'), // every time it should mint less GCS due to bonding curve... + toGRT('1000'), + toGRT('1000'), + toGRT('2000'), + toGRT('2000'), + toGRT('123'), + toGRT('1'), // should mint below minimum deposit + ] + + // Mint multiple times + for (const tokensToDeposit of tokensToDepositMany) { + const tx = await contracts.Curation.connect(curator).mint( + subgraphDeploymentID, + tokensToDeposit, + 0, + ) + const receipt = await tx.wait() + const event: Event = receipt.events.pop() + const signal = event.args['signal'] + expect(tokensToDeposit).eq(signal) // we compare 1:1 ratio + } + }) + }) +}) diff --git a/test/disputes/common.ts b/packages/contracts/test/unit/disputes/common.ts similarity index 95% rename from test/disputes/common.ts rename to packages/contracts/test/unit/disputes/common.ts index 37d77fd5a..f72f3c6cf 100644 --- a/test/disputes/common.ts +++ b/packages/contracts/test/unit/disputes/common.ts @@ -16,7 +16,7 @@ export interface Dispute { export function createQueryDisputeID( attestation: Attestation, indexerAddress: string, - submitterAddress: string, + fishermanAddress: string, ): string { return solidityKeccak256( ['bytes32', 'bytes32', 'bytes32', 'address', 'address'], @@ -25,7 +25,7 @@ export function createQueryDisputeID( attestation.responseCID, attestation.subgraphDeploymentID, indexerAddress, - submitterAddress, + fishermanAddress, ], ) } diff --git a/packages/contracts/test/unit/disputes/configuration.test.ts b/packages/contracts/test/unit/disputes/configuration.test.ts new file mode 100644 index 000000000..eeebb0731 --- /dev/null +++ b/packages/contracts/test/unit/disputes/configuration.test.ts @@ -0,0 +1,137 @@ +import hre from 'hardhat' +import { constants } from 'ethers' +import { expect } from 'chai' + +import { DisputeManager } from '../../../build/types/DisputeManager' + +import { NetworkFixture } from '../lib/fixtures' +import { GraphNetworkContracts, toBN } from '@graphprotocol/sdk' +import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers' + +const { AddressZero } = constants + +const MAX_PPM = 1000000 + +describe('DisputeManager:Config', () => { + let me: SignerWithAddress + let governor: SignerWithAddress + let arbitrator: SignerWithAddress + + const graph = hre.graph() + const defaults = graph.graphConfig.defaults + let fixture: NetworkFixture + + let contracts: GraphNetworkContracts + let disputeManager: DisputeManager + + before(async function () { + [me] = await graph.getTestAccounts() + ;({ governor, arbitrator } = await graph.getNamedAccounts()) + + fixture = new NetworkFixture(graph.provider) + contracts = await fixture.load(governor) + disputeManager = contracts.DisputeManager as DisputeManager + }) + + beforeEach(async function () { + await fixture.setUp() + }) + + afterEach(async function () { + await fixture.tearDown() + }) + + describe('configuration', () => { + describe('arbitrator', function () { + it('should set `arbitrator`', async function () { + // Set right in the constructor + expect(await disputeManager.arbitrator()).eq(arbitrator.address) + + // Can set if allowed + await disputeManager.connect(governor).setArbitrator(me.address) + expect(await disputeManager.arbitrator()).eq(me.address) + }) + + it('reject set `arbitrator` if not allowed', async function () { + const tx = disputeManager.connect(me).setArbitrator(arbitrator.address) + await expect(tx).revertedWith('Only Controller governor') + }) + + it('reject set `arbitrator` to address zero', async function () { + const tx = disputeManager.connect(governor).setArbitrator(AddressZero) + await expect(tx).revertedWith('Arbitrator must be set') + }) + }) + + describe('minimumDeposit', function () { + it('should set `minimumDeposit`', async function () { + const oldValue = defaults.dispute.minimumDeposit + const newValue = toBN('1') + + // Set right in the constructor + expect(await disputeManager.minimumDeposit()).eq(oldValue) + + // Set new value + await disputeManager.connect(governor).setMinimumDeposit(newValue) + expect(await disputeManager.minimumDeposit()).eq(newValue) + }) + + it('reject set `minimumDeposit` if not allowed', async function () { + const newValue = toBN('1') + const tx = disputeManager.connect(me).setMinimumDeposit(newValue) + await expect(tx).revertedWith('Only Controller governor') + }) + }) + + describe('fishermanRewardPercentage', function () { + it('should set `fishermanRewardPercentage`', async function () { + const newValue = defaults.dispute.fishermanRewardPercentage + + // Set right in the constructor + expect(await disputeManager.fishermanRewardPercentage()).eq(newValue) + + // Set new value + await disputeManager.connect(governor).setFishermanRewardPercentage(0) + await disputeManager.connect(governor).setFishermanRewardPercentage(newValue) + }) + + it('reject set `fishermanRewardPercentage` if out of bounds', async function () { + const tx = disputeManager.connect(governor).setFishermanRewardPercentage(MAX_PPM + 1) + await expect(tx).revertedWith('Reward percentage must be below or equal to MAX_PPM') + }) + + it('reject set `fishermanRewardPercentage` if not allowed', async function () { + const tx = disputeManager.connect(me).setFishermanRewardPercentage(50) + await expect(tx).revertedWith('Only Controller governor') + }) + }) + + describe('slashingPercentage', function () { + it('should set `slashingPercentage`', async function () { + const qryNewValue = defaults.dispute.qrySlashingPercentage + const idxNewValue = defaults.dispute.idxSlashingPercentage + + // Set right in the constructor + expect(await disputeManager.qrySlashingPercentage()).eq(qryNewValue) + expect(await disputeManager.idxSlashingPercentage()).eq(idxNewValue) + + // Set new value + await disputeManager.connect(governor).setSlashingPercentage(0, 0) + await disputeManager.connect(governor).setSlashingPercentage(qryNewValue, idxNewValue) + }) + + it('reject set `slashingPercentage` if out of bounds', async function () { + const tx1 = disputeManager.connect(governor).setSlashingPercentage(0, MAX_PPM + 1) + await expect(tx1).revertedWith('Slashing percentage must be below or equal to MAX_PPM') + + const tx2 = disputeManager.connect(governor).setSlashingPercentage(MAX_PPM + 1, 0) + await expect(tx2).revertedWith('Slashing percentage must be below or equal to MAX_PPM') + }) + + it('reject set `slashingPercentage` if not allowed', async function () { + const tx = disputeManager.connect(me).setSlashingPercentage(50, 50) + await expect(tx).revertedWith('Only Controller governor') + }) + }) + }) +}) diff --git a/packages/contracts/test/unit/disputes/poi.test.ts b/packages/contracts/test/unit/disputes/poi.test.ts new file mode 100644 index 000000000..aa5c888c1 --- /dev/null +++ b/packages/contracts/test/unit/disputes/poi.test.ts @@ -0,0 +1,258 @@ +import hre from 'hardhat' +import { expect } from 'chai' +import { utils } from 'ethers' + +import { DisputeManager } from '../../../build/types/DisputeManager' +import { EpochManager } from '../../../build/types/EpochManager' +import { GraphToken } from '../../../build/types/GraphToken' +import { IStaking } from '../../../build/types/IStaking' + +import { NetworkFixture } from '../lib/fixtures' + +import { MAX_PPM } from './common' +import { + deriveChannelKey, + GraphNetworkContracts, + helpers, + randomHexBytes, + toBN, + toGRT, +} from '@graphprotocol/sdk' +import type { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers' + +const { keccak256 } = utils + +describe('DisputeManager:POI', () => { + let governor: SignerWithAddress + let arbitrator: SignerWithAddress + let indexer: SignerWithAddress + let rewardsDestination: SignerWithAddress + let fisherman: SignerWithAddress + let assetHolder: SignerWithAddress + + const graph = hre.graph() + + let fixture: NetworkFixture + + let contracts: GraphNetworkContracts + let disputeManager: DisputeManager + let epochManager: EpochManager + let grt: GraphToken + let staking: IStaking + + // Derive some channel keys for each indexer used to sign attestations + const indexerChannelKey = deriveChannelKey() + + // Test values + const fishermanTokens = toGRT('100000') + const fishermanDeposit = toGRT('1000') + const indexerTokens = toGRT('100000') + const indexerAllocatedTokens = toGRT('10000') + const allocationID = indexerChannelKey.address + const subgraphDeploymentID = randomHexBytes(32) + const metadata = randomHexBytes(32) + const poi = randomHexBytes(32) // proof of indexing + + async function calculateSlashConditions(indexerAddress: string) { + const idxSlashingPercentage = await disputeManager.idxSlashingPercentage() + const fishermanRewardPercentage = await disputeManager.fishermanRewardPercentage() + const stakeAmount = await staking.getIndexerStakedTokens(indexerAddress) + const slashAmount = stakeAmount.mul(idxSlashingPercentage).div(toBN(MAX_PPM)) + const rewardsAmount = slashAmount.mul(fishermanRewardPercentage).div(toBN(MAX_PPM)) + + return { slashAmount, rewardsAmount } + } + + async function setupIndexers() { + // Dispute manager is allowed to slash + await staking.connect(governor).setSlasher(disputeManager.address, true) + + // Stake & allocate + const indexerList = [ + { account: indexer, allocationID: indexerChannelKey.address, channelKey: indexerChannelKey }, + ] + for (const activeIndexer of indexerList) { + const { channelKey, allocationID, account: indexerAccount } = activeIndexer + + // Give some funds to the indexer + await grt.connect(governor).mint(indexerAccount.address, indexerTokens) + await grt.connect(indexerAccount).approve(staking.address, indexerTokens) + + // Indexer stake funds + await staking.connect(indexerAccount).stake(indexerTokens) + await staking + .connect(indexerAccount) + .allocateFrom( + indexerAccount.address, + subgraphDeploymentID, + indexerAllocatedTokens, + allocationID, + metadata, + await channelKey.generateProof(indexerAccount.address), + ) + } + } + + before(async function () { + [indexer, fisherman, assetHolder, rewardsDestination] = await graph.getTestAccounts() + ;({ governor, arbitrator } = await graph.getNamedAccounts()) + + fixture = new NetworkFixture(graph.provider) + contracts = await fixture.load(governor) + disputeManager = contracts.DisputeManager as DisputeManager + epochManager = contracts.EpochManager as EpochManager + grt = contracts.GraphToken as GraphToken + staking = contracts.Staking as IStaking + + // Give some funds to the fisherman + await grt.connect(governor).mint(fisherman.address, fishermanTokens) + await grt.connect(fisherman).approve(disputeManager.address, fishermanTokens) + }) + + beforeEach(async function () { + await fixture.setUp() + }) + + afterEach(async function () { + await fixture.tearDown() + }) + + describe('disputes', function () { + it('reject create a dispute if allocation does not exist', async function () { + const invalidAllocationID = randomHexBytes(20) + + // Create dispute + const tx = disputeManager + .connect(fisherman) + .createIndexingDispute(invalidAllocationID, fishermanDeposit) + await expect(tx).revertedWith('Dispute allocation must exist') + }) + + it('reject create a dispute if indexer below stake', async function () { + // This tests reproduce the case when someones present a dispute for + // an indexer that is under the minimum required staked amount + + const indexerCollectedTokens = toGRT('10') + + // Give some funds to the indexer + await grt.connect(governor).mint(indexer.address, indexerTokens) + await grt.connect(indexer).approve(staking.address, indexerTokens) + + // Give some funds to the channel + await grt.connect(governor).mint(assetHolder.address, indexerCollectedTokens) + await grt.connect(assetHolder).approve(staking.address, indexerCollectedTokens) + + // Set the thawing period to one to make the test easier + await staking.connect(governor).setThawingPeriod(toBN('1')) + + // Indexer stake funds, allocate, close, unstake and withdraw the stake fully + await staking.connect(indexer).stake(indexerTokens) + const tx1 = await staking + .connect(indexer) + .allocateFrom( + indexer.address, + subgraphDeploymentID, + indexerAllocatedTokens, + allocationID, + metadata, + await indexerChannelKey.generateProof(indexer.address), + ) + const receipt1 = await tx1.wait() + const event1 = staking.interface.parseLog(receipt1.logs[0]).args + await helpers.mineEpoch(epochManager) // wait the required one epoch to close allocation + // set rewards destination so collected query fees are not added to indexer balance + await staking.connect(indexer).setRewardsDestination(rewardsDestination.address) + await staking.connect(assetHolder).collect(indexerCollectedTokens, event1.allocationID) + await staking.connect(indexer).closeAllocation(event1.allocationID, poi) + await staking.connect(indexer).unstake(indexerTokens) + await helpers.mine() // pass thawing period + await staking.connect(indexer).withdraw() + + // Create dispute + const tx = disputeManager + .connect(fisherman) + .createIndexingDispute(event1.allocationID, fishermanDeposit) + await expect(tx).revertedWith('Dispute indexer has no stake') + }) + + context('> when indexer is staked', function () { + beforeEach(async function () { + await setupIndexers() + }) + + it('should create a dispute', async function () { + // Create dispute + const tx = disputeManager + .connect(fisherman) + .createIndexingDispute(allocationID, fishermanDeposit) + await expect(tx) + .emit(disputeManager, 'IndexingDisputeCreated') + .withArgs( + keccak256(allocationID), + indexer.address, + fisherman.address, + fishermanDeposit, + allocationID, + ) + }) + + context('> when dispute is created', function () { + // NOTE: other dispute resolution paths are tested in query.test.ts + + beforeEach(async function () { + // Create dispute + await disputeManager + .connect(fisherman) + .createIndexingDispute(allocationID, fishermanDeposit) + }) + + it('reject create duplicated dispute', async function () { + const tx = disputeManager + .connect(fisherman) + .createIndexingDispute(allocationID, fishermanDeposit) + await expect(tx).revertedWith('Dispute already created') + }) + + describe('accept a dispute', function () { + it('should resolve dispute, slash indexer and reward the fisherman', async function () { + const disputeID = keccak256(allocationID) + + // Before state + const beforeIndexerStake = await staking.getIndexerStakedTokens(indexer.address) + const beforeFishermanBalance = await grt.balanceOf(fisherman.address) + const beforeTotalSupply = await grt.totalSupply() + + // Calculations + const { slashAmount, rewardsAmount } = await calculateSlashConditions(indexer.address) + + // Perform transaction (accept) + const tx = disputeManager.connect(arbitrator).acceptDispute(disputeID) + await expect(tx) + .emit(disputeManager, 'DisputeAccepted') + .withArgs( + disputeID, + indexer.address, + fisherman.address, + fishermanDeposit.add(rewardsAmount), + ) + + // After state + const afterFishermanBalance = await grt.balanceOf(fisherman.address) + const afterIndexerStake = await staking.getIndexerStakedTokens(indexer.address) + const afterTotalSupply = await grt.totalSupply() + + // Fisherman reward properly assigned + deposit returned + expect(afterFishermanBalance).eq( + beforeFishermanBalance.add(fishermanDeposit).add(rewardsAmount), + ) + // Indexer slashed + expect(afterIndexerStake).eq(beforeIndexerStake.sub(slashAmount)) + // Slashed funds burned + const tokensToBurn = slashAmount.sub(rewardsAmount) + expect(afterTotalSupply).eq(beforeTotalSupply.sub(tokensToBurn)) + }) + }) + }) + }) + }) +}) diff --git a/test/disputes/query.test.ts b/packages/contracts/test/unit/disputes/query.test.ts similarity index 75% rename from test/disputes/query.test.ts rename to packages/contracts/test/unit/disputes/query.test.ts index 02aef61a3..6bf9fe0b8 100644 --- a/test/disputes/query.test.ts +++ b/packages/contracts/test/unit/disputes/query.test.ts @@ -1,48 +1,50 @@ +import hre from 'hardhat' import { expect } from 'chai' import { constants } from 'ethers' import { createAttestation, Receipt } from '@graphprotocol/common-ts' -import { DisputeManager } from '../../build/types/DisputeManager' -import { EpochManager } from '../../build/types/EpochManager' -import { GraphToken } from '../../build/types/GraphToken' -import { Staking } from '../../build/types/Staking' +import { DisputeManager } from '../../../build/types/DisputeManager' +import { EpochManager } from '../../../build/types/EpochManager' +import { GraphToken } from '../../../build/types/GraphToken' +import { IStaking } from '../../../build/types/IStaking' import { NetworkFixture } from '../lib/fixtures' + +import { createQueryDisputeID, Dispute, encodeAttestation, MAX_PPM } from './common' import { - advanceBlock, - advanceToNextEpoch, deriveChannelKey, - getAccounts, - getChainID, + GraphNetworkContracts, + helpers, randomHexBytes, toBN, toGRT, - Account, -} from '../lib/testHelpers' +} from '@graphprotocol/sdk' -import { Dispute, createQueryDisputeID, encodeAttestation, MAX_PPM } from './common' +import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers' -const { AddressZero, HashZero } = constants +const { HashZero } = constants const NON_EXISTING_DISPUTE_ID = randomHexBytes() -describe('DisputeManager:Query', async () => { - let me: Account - let other: Account - let governor: Account - let arbitrator: Account - let indexer: Account - let indexer2: Account - let fisherman: Account - let fisherman2: Account - let assetHolder: Account - +describe('DisputeManager:Query', () => { + let me: SignerWithAddress + let governor: SignerWithAddress + let arbitrator: SignerWithAddress + let indexer: SignerWithAddress + let indexer2: SignerWithAddress + let rewardsDestination: SignerWithAddress + let fisherman: SignerWithAddress + let fisherman2: SignerWithAddress + let assetHolder: SignerWithAddress + + const graph = hre.graph() let fixture: NetworkFixture + let contracts: GraphNetworkContracts let disputeManager: DisputeManager let epochManager: EpochManager let grt: GraphToken - let staking: Staking + let staking: IStaking // Derive some channel keys for each indexer used to sign attestations const indexer1ChannelKey = deriveChannelKey() @@ -68,9 +70,10 @@ describe('DisputeManager:Query', async () => { async function buildAttestation(receipt: Receipt, signer: string) { const attestation = await createAttestation( signer, - await getChainID(), + graph.chainId, disputeManager.address, receipt, + '0', ) return attestation } @@ -87,7 +90,7 @@ describe('DisputeManager:Query', async () => { async function setupIndexers() { // Dispute manager is allowed to slash - await staking.connect(governor.signer).setSlasher(disputeManager.address, true) + await staking.connect(governor).setSlasher(disputeManager.address, true) // Stake const indexerList = [ @@ -106,14 +109,15 @@ describe('DisputeManager:Query', async () => { const { channelKey, allocationID, account: indexerAccount } = activeIndexer // Give some funds to the indexer - await grt.connect(governor.signer).mint(indexerAccount.address, indexerTokens) - await grt.connect(indexerAccount.signer).approve(staking.address, indexerTokens) + await grt.connect(governor).mint(indexerAccount.address, indexerTokens) + await grt.connect(indexerAccount).approve(staking.address, indexerTokens) // Indexer stake funds - await staking.connect(indexerAccount.signer).stake(indexerTokens) + await staking.connect(indexerAccount).stake(indexerTokens) await staking - .connect(indexerAccount.signer) - .allocate( + .connect(indexerAccount) + .allocateFrom( + indexerAccount.address, dispute.receipt.subgraphDeploymentID, indexerAllocatedTokens, allocationID, @@ -124,25 +128,23 @@ describe('DisputeManager:Query', async () => { } before(async function () { - ;[me, other, governor, arbitrator, indexer, indexer2, fisherman, fisherman2, assetHolder] = - await getAccounts() + [me, indexer, indexer2, fisherman, fisherman2, assetHolder, rewardsDestination] + = await graph.getTestAccounts() + ;({ governor, arbitrator } = await graph.getNamedAccounts()) - fixture = new NetworkFixture() - ;({ disputeManager, epochManager, grt, staking } = await fixture.load( - governor.signer, - other.signer, - arbitrator.signer, - )) + fixture = new NetworkFixture(graph.provider) + contracts = await fixture.load(governor) + disputeManager = contracts.DisputeManager as DisputeManager + epochManager = contracts.EpochManager as EpochManager + grt = contracts.GraphToken as GraphToken + staking = contracts.Staking as IStaking // Give some funds to the fisherman for (const dst of [fisherman, fisherman2]) { - await grt.connect(governor.signer).mint(dst.address, fishermanTokens) - await grt.connect(dst.signer).approve(disputeManager.address, fishermanTokens) + await grt.connect(governor).mint(dst.address, fishermanTokens) + await grt.connect(dst).approve(disputeManager.address, fishermanTokens) } - // Allow the asset holder - await staking.connect(governor.signer).setAssetHolder(assetHolder.address, true) - // Create an attestation const attestation = await buildAttestation(receipt, indexer1ChannelKey.privKey) @@ -168,7 +170,7 @@ describe('DisputeManager:Query', async () => { it('reject create a dispute if attestation does not refer to valid indexer', async function () { // Create dispute const tx = disputeManager - .connect(fisherman.signer) + .connect(fisherman) .createQueryDispute(dispute.encodedAttestation, fishermanDeposit) await expect(tx).revertedWith('Indexer cannot be found for the attestation') }) @@ -180,21 +182,22 @@ describe('DisputeManager:Query', async () => { const indexerCollectedTokens = toGRT('10') // Give some funds to the indexer - await grt.connect(governor.signer).mint(indexer.address, indexerTokens) - await grt.connect(indexer.signer).approve(staking.address, indexerTokens) + await grt.connect(governor).mint(indexer.address, indexerTokens) + await grt.connect(indexer).approve(staking.address, indexerTokens) // Give some funds to the channel - await grt.connect(governor.signer).mint(assetHolder.address, indexerCollectedTokens) - await grt.connect(assetHolder.signer).approve(staking.address, indexerCollectedTokens) + await grt.connect(governor).mint(assetHolder.address, indexerCollectedTokens) + await grt.connect(assetHolder).approve(staking.address, indexerCollectedTokens) // Set the thawing period to zero to make the test easier - await staking.connect(governor.signer).setThawingPeriod(toBN('1')) + await staking.connect(governor).setThawingPeriod(toBN('1')) // Indexer stake funds, allocate, close allocation, unstake and withdraw the stake fully - await staking.connect(indexer.signer).stake(indexerTokens) + await staking.connect(indexer).stake(indexerTokens) const tx1 = await staking - .connect(indexer.signer) - .allocate( + .connect(indexer) + .allocateFrom( + indexer.address, dispute.receipt.subgraphDeploymentID, indexerAllocatedTokens, indexer1ChannelKey.address, @@ -203,16 +206,18 @@ describe('DisputeManager:Query', async () => { ) const receipt1 = await tx1.wait() const event1 = staking.interface.parseLog(receipt1.logs[0]).args - await advanceToNextEpoch(epochManager) // wait the required one epoch to close allocation - await staking.connect(assetHolder.signer).collect(indexerCollectedTokens, event1.allocationID) - await staking.connect(indexer.signer).closeAllocation(event1.allocationID, poi) - await staking.connect(indexer.signer).unstake(indexerTokens) - await advanceBlock() // pass thawing period - await staking.connect(indexer.signer).withdraw() + await helpers.mineEpoch(epochManager) // wait the required one epoch to close allocation + // set rewards destination so collected query fees are not added to indexer balance + await staking.connect(indexer).setRewardsDestination(rewardsDestination.address) + await staking.connect(assetHolder).collect(indexerCollectedTokens, event1.allocationID) + await staking.connect(indexer).closeAllocation(event1.allocationID, poi) + await staking.connect(indexer).unstake(indexerTokens) + await helpers.mine() // pass thawing period + await staking.connect(indexer).withdraw() // Create dispute const tx = disputeManager - .connect(fisherman.signer) + .connect(fisherman) .createQueryDispute(dispute.encodedAttestation, fishermanDeposit) await expect(tx).revertedWith('Dispute indexer has no stake') }) @@ -230,7 +235,7 @@ describe('DisputeManager:Query', async () => { // Create invalid dispute as deposit is below minimum const tx = disputeManager - .connect(fisherman.signer) + .connect(fisherman) .createQueryDispute(dispute.encodedAttestation, belowMinimumDeposit) await expect(tx).revertedWith('Dispute deposit is under minimum required') }) @@ -238,7 +243,7 @@ describe('DisputeManager:Query', async () => { it('should create a dispute', async function () { // Create dispute const tx = disputeManager - .connect(fisherman.signer) + .connect(fisherman) .createQueryDispute(dispute.encodedAttestation, fishermanDeposit) await expect(tx) .emit(disputeManager, 'QueryDisputeCreated') @@ -255,25 +260,21 @@ describe('DisputeManager:Query', async () => { describe('accept a dispute', function () { it('reject to accept a non-existing dispute', async function () { - const tx = disputeManager - .connect(arbitrator.signer) - .acceptDispute(NON_EXISTING_DISPUTE_ID) + const tx = disputeManager.connect(arbitrator).acceptDispute(NON_EXISTING_DISPUTE_ID) await expect(tx).revertedWith('Dispute does not exist') }) }) describe('reject a dispute', function () { it('reject to reject a non-existing dispute', async function () { - const tx = disputeManager - .connect(arbitrator.signer) - .rejectDispute(NON_EXISTING_DISPUTE_ID) + const tx = disputeManager.connect(arbitrator).rejectDispute(NON_EXISTING_DISPUTE_ID) await expect(tx).revertedWith('Dispute does not exist') }) }) describe('draw a dispute', function () { it('reject to draw a non-existing dispute', async function () { - const tx = disputeManager.connect(arbitrator.signer).drawDispute(NON_EXISTING_DISPUTE_ID) + const tx = disputeManager.connect(arbitrator).drawDispute(NON_EXISTING_DISPUTE_ID) await expect(tx).revertedWith('Dispute does not exist') }) }) @@ -282,7 +283,7 @@ describe('DisputeManager:Query', async () => { beforeEach(async function () { // Create dispute await disputeManager - .connect(fisherman.signer) + .connect(fisherman) .createQueryDispute(dispute.encodedAttestation, fishermanDeposit) }) @@ -300,7 +301,7 @@ describe('DisputeManager:Query', async () => { // Create dispute const tx = disputeManager - .connect(fisherman.signer) + .connect(fisherman) .createQueryDispute(newDispute.encodedAttestation, fishermanDeposit) await expect(tx) .emit(disputeManager, 'QueryDisputeCreated') @@ -316,13 +317,13 @@ describe('DisputeManager:Query', async () => { it('should create dispute as long as it is from different fisherman', async function () { await disputeManager - .connect(fisherman2.signer) + .connect(fisherman2) .createQueryDispute(dispute.encodedAttestation, fishermanDeposit) }) it('reject create duplicated dispute', async function () { const tx = disputeManager - .connect(fisherman.signer) + .connect(fisherman) .createQueryDispute(dispute.encodedAttestation, fishermanDeposit) await expect(tx).revertedWith('Dispute already created') }) @@ -330,24 +331,22 @@ describe('DisputeManager:Query', async () => { describe('accept a dispute', function () { it('reject to accept a dispute if not the arbitrator', async function () { - const tx = disputeManager.connect(me.signer).acceptDispute(dispute.id) + const tx = disputeManager.connect(me).acceptDispute(dispute.id) await expect(tx).revertedWith('Caller is not the Arbitrator') }) it('reject to accept a dispute if not slasher', async function () { // Dispute manager is not allowed to slash - await staking.connect(governor.signer).setSlasher(disputeManager.address, false) + await staking.connect(governor).setSlasher(disputeManager.address, false) // Perform transaction (accept) - const tx = disputeManager.connect(arbitrator.signer).acceptDispute(dispute.id) + const tx = disputeManager.connect(arbitrator).acceptDispute(dispute.id) await expect(tx).revertedWith('!slasher') }) it('reject to accept a dispute if zero tokens to slash', async function () { - await disputeManager - .connect(governor.signer) - .setSlashingPercentage(toBN('0'), toBN('0')) - const tx = disputeManager.connect(arbitrator.signer).acceptDispute(dispute.id) + await disputeManager.connect(governor).setSlashingPercentage(toBN('0'), toBN('0')) + const tx = disputeManager.connect(arbitrator).acceptDispute(dispute.id) await expect(tx).revertedWith('Dispute has zero tokens to slash') }) @@ -361,7 +360,7 @@ describe('DisputeManager:Query', async () => { const { slashAmount, rewardsAmount } = await calculateSlashConditions(indexer.address) // Perform transaction (accept) - const tx = disputeManager.connect(arbitrator.signer).acceptDispute(dispute.id) + const tx = disputeManager.connect(arbitrator).acceptDispute(dispute.id) await expect(tx) .emit(disputeManager, 'DisputeAccepted') .withArgs( @@ -388,9 +387,9 @@ describe('DisputeManager:Query', async () => { }) }) - describe('reject a dispute', async function () { + describe('reject a dispute', function () { it('reject to reject a dispute if not the arbitrator', async function () { - const tx = disputeManager.connect(me.signer).rejectDispute(dispute.id) + const tx = disputeManager.connect(me).rejectDispute(dispute.id) await expect(tx).revertedWith('Caller is not the Arbitrator') }) @@ -400,7 +399,7 @@ describe('DisputeManager:Query', async () => { const beforeTotalSupply = await grt.totalSupply() // Perform transaction (reject) - const tx = disputeManager.connect(arbitrator.signer).rejectDispute(dispute.id) + const tx = disputeManager.connect(arbitrator).rejectDispute(dispute.id) await expect(tx) .emit(disputeManager, 'DisputeRejected') .withArgs(dispute.id, dispute.indexerAddress, fisherman.address, fishermanDeposit) @@ -417,9 +416,9 @@ describe('DisputeManager:Query', async () => { }) }) - describe('draw a dispute', async function () { + describe('draw a dispute', function () { it('reject to draw a dispute if not the arbitrator', async function () { - const tx = disputeManager.connect(me.signer).drawDispute(dispute.id) + const tx = disputeManager.connect(me).drawDispute(dispute.id) await expect(tx).revertedWith('Caller is not the Arbitrator') }) @@ -428,7 +427,7 @@ describe('DisputeManager:Query', async () => { const beforeFishermanBalance = await grt.balanceOf(fisherman.address) // Perform transaction (draw) - const tx = disputeManager.connect(arbitrator.signer).drawDispute(dispute.id) + const tx = disputeManager.connect(arbitrator).drawDispute(dispute.id) await expect(tx) .emit(disputeManager, 'DisputeDrawn') .withArgs(dispute.id, dispute.indexerAddress, fisherman.address, fishermanDeposit) @@ -465,7 +464,7 @@ describe('DisputeManager:Query', async () => { it('reject if attestations are not in conflict', async function () { const [attestation1, attestation2] = await getIndependentAttestations() const tx = disputeManager - .connect(fisherman.signer) + .connect(fisherman) .createQueryDisputeConflict( encodeAttestation(attestation1), encodeAttestation(attestation2), @@ -478,7 +477,7 @@ describe('DisputeManager:Query', async () => { const dID1 = createQueryDisputeID(attestation1, indexer.address, fisherman.address) const dID2 = createQueryDisputeID(attestation2, indexer2.address, fisherman.address) const tx = disputeManager - .connect(fisherman.signer) + .connect(fisherman) .createQueryDisputeConflict( encodeAttestation(attestation1), encodeAttestation(attestation2), @@ -497,7 +496,7 @@ describe('DisputeManager:Query', async () => { const dID1 = createQueryDisputeID(attestation1, indexer.address, fisherman.address) const dID2 = createQueryDisputeID(attestation2, indexer2.address, fisherman.address) const tx = disputeManager - .connect(fisherman.signer) + .connect(fisherman) .createQueryDisputeConflict( encodeAttestation(attestation1), encodeAttestation(attestation2), @@ -510,17 +509,19 @@ describe('DisputeManager:Query', async () => { // Setup const [dID1, dID2] = await setupConflictingDisputes() // Do - await disputeManager.connect(arbitrator.signer).acceptDispute(dID1) + await disputeManager.connect(arbitrator).acceptDispute(dID1) // Check + const mainDispute = await disputeManager.disputes(dID1) + expect(mainDispute.status).to.eq(1) // 1 = DisputeStatus.Accepted const relatedDispute = await disputeManager.disputes(dID2) - expect(relatedDispute.indexer).eq(AddressZero) + expect(relatedDispute.status).to.eq(2) // 2 = DisputeStatus.Rejected }) it('should not allow to reject, user need to accept the related dispute ID to reject it', async function () { // Setup const [dID1] = await setupConflictingDisputes() // Do - const tx = disputeManager.connect(arbitrator.signer).rejectDispute(dID1) + const tx = disputeManager.connect(arbitrator).rejectDispute(dID1) await expect(tx).revertedWith( 'Dispute for conflicting attestation, must accept the related ID to reject', ) @@ -530,10 +531,10 @@ describe('DisputeManager:Query', async () => { // Setup const [dID1, dID2] = await setupConflictingDisputes() // Do - await disputeManager.connect(arbitrator.signer).drawDispute(dID1) + await disputeManager.connect(arbitrator).drawDispute(dID1) // Check const relatedDispute = await disputeManager.disputes(dID2) - expect(relatedDispute.indexer).eq(AddressZero) + expect(relatedDispute.status).not.eq(4) // 4 = DisputeStatus.Pending }) }) }) diff --git a/packages/contracts/test/unit/epochs.test.ts b/packages/contracts/test/unit/epochs.test.ts new file mode 100644 index 000000000..951114dfd --- /dev/null +++ b/packages/contracts/test/unit/epochs.test.ts @@ -0,0 +1,175 @@ +import hre from 'hardhat' +import { expect } from 'chai' +import { BigNumber } from 'ethers' + +import { EpochManager } from '../../build/types/EpochManager' + +import { deploy, DeployType, helpers, toBN } from '@graphprotocol/sdk' +import type { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers' + +describe('EpochManager', () => { + const graph = hre.graph() + const defaults = graph.graphConfig.defaults + let me: SignerWithAddress + let governor: SignerWithAddress + + let epochManager: EpochManager + + const epochLength: BigNumber = toBN('3') + + before(async function () { + [me, governor] = await graph.getTestAccounts() + ;({ governor } = await graph.getNamedAccounts()) + }) + + beforeEach(async function () { + const { contract: controller } = await deploy( + DeployType.DeployAndSave, + governor, + { + name: 'Controller', + }, + graph.addressBook, + ) + await deploy( + DeployType.DeployAndSave, + governor, + { + name: 'GraphProxyAdmin', + }, + graph.addressBook, + ) + const epochManagerResult = await deploy( + DeployType.DeployWithProxy, + governor, + { + name: 'EpochManager', + args: [controller.address, defaults.epochs.lengthInBlocks], + }, + graph.addressBook, + { + name: 'GraphProxy', + }, + ) + epochManager = epochManagerResult.contract as EpochManager + }) + + describe('configuration', () => { + it('should set `epochLength', async function () { + // Set right in the constructor + expect(await epochManager.epochLength()).eq(defaults.epochs.lengthInBlocks) + + // Update and check new value + const newEpochLength = toBN('4') + const currentEpoch = await epochManager.currentEpoch() + const tx = epochManager.connect(governor).setEpochLength(newEpochLength) + await expect(tx) + .emit(epochManager, 'EpochLengthUpdate') + .withArgs(currentEpoch, newEpochLength) + expect(await epochManager.epochLength()).eq(newEpochLength) + }) + + it('reject set `epochLength` if zero', async function () { + // Update and check new value + const newEpochLength = toBN('0') + const tx = epochManager.connect(governor).setEpochLength(newEpochLength) + await expect(tx).revertedWith('Epoch length cannot be 0') + }) + }) + + describe('epoch lifecycle', function () { + // Use epochs every three blocks + // Blocks -> (1,2,3)(4,5,6)(7,8,9) + // Epochs -> 1 2 3 + beforeEach(async function () { + await epochManager.connect(governor).setEpochLength(epochLength) + }) + + describe('calculations', () => { + it('first epoch should be 1', async function () { + const currentEpoch = await epochManager.currentEpoch() + expect(currentEpoch).eq(1) + }) + + it('should return correct block number', async function () { + const currentBlock = await helpers.latestBlock() + expect(await epochManager.blockNum()).eq(currentBlock) + }) + + it('should return same starting block if we stay on the same epoch', async function () { + // Move right to the start of a new epoch + const blocksSinceEpochStart = await epochManager.currentEpochBlockSinceStart() + const blocksToNextEpoch = epochLength.sub(blocksSinceEpochStart) + await helpers.mineUpTo((await epochManager.blockNum()).add(blocksToNextEpoch)) + + const beforeCurrentEpochBlock = await epochManager.currentEpochBlock() + + // Advance block - will not jump to next epoch + await helpers.mine() + + const afterCurrentEpochBlock = await epochManager.currentEpochBlock() + expect(afterCurrentEpochBlock).equal(beforeCurrentEpochBlock) + }) + + it('should return next starting block if we move to the next epoch', async function () { + const beforeCurrentEpochBlock = await epochManager.currentEpochBlock() + + // Advance blocks to move to the next epoch + await helpers.mineUpTo(beforeCurrentEpochBlock.add(epochLength)) + + const afterCurrentEpochBlock = await epochManager.currentEpochBlock() + expect(afterCurrentEpochBlock).not.eq(beforeCurrentEpochBlock) + }) + + it('should return next epoch if advance > epochLength', async function () { + const nextEpoch = (await epochManager.currentEpoch()).add(toBN('1')) + + // Advance blocks and move to the next epoch + const currentEpochBlock = await epochManager.currentEpochBlock() + await helpers.mineUpTo(currentEpochBlock.add(epochLength)) + + const afterCurrentEpoch = await epochManager.currentEpoch() + expect(afterCurrentEpoch).eq(nextEpoch) + }) + }) + + describe('progression', () => { + beforeEach(async function () { + const currentEpochBlock = await epochManager.currentEpochBlock() + await helpers.mineUpTo(currentEpochBlock.add(epochLength)) + }) + + context('> epoch not run', function () { + it('should return that current epoch is not run', async function () { + expect(await epochManager.isCurrentEpochRun()).eq(false) + }) + + it('should run new epoch', async function () { + // Run epoch + const currentEpoch = await epochManager.currentEpoch() + const tx = epochManager.connect(me).runEpoch() + await expect(tx).emit(epochManager, 'EpochRun').withArgs(currentEpoch, me.address) + + // State + const lastRunEpoch = await epochManager.lastRunEpoch() + expect(lastRunEpoch).eq(currentEpoch) + }) + }) + + context('> epoch run', function () { + beforeEach(async function () { + await epochManager.runEpoch() + }) + + it('should return current epoch is already run', async function () { + expect(await epochManager.isCurrentEpochRun()).eq(true) + }) + + it('reject run new epoch', async function () { + const tx = epochManager.runEpoch() + await expect(tx).revertedWith('Current epoch already run') + }) + }) + }) + }) +}) diff --git a/packages/contracts/test/unit/gateway/bridgeEscrow.test.ts b/packages/contracts/test/unit/gateway/bridgeEscrow.test.ts new file mode 100644 index 000000000..5e8954659 --- /dev/null +++ b/packages/contracts/test/unit/gateway/bridgeEscrow.test.ts @@ -0,0 +1,82 @@ +import hre from 'hardhat' +import { expect } from 'chai' +import { BigNumber } from 'ethers' + +import { GraphToken } from '../../../build/types/GraphToken' +import { BridgeEscrow } from '../../../build/types/BridgeEscrow' + +import { NetworkFixture } from '../lib/fixtures' + +import { GraphNetworkContracts, toGRT } from '@graphprotocol/sdk' +import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers' + +describe('BridgeEscrow', () => { + const graph = hre.graph() + let governor: SignerWithAddress + let tokenReceiver: SignerWithAddress + let spender: SignerWithAddress + + let fixture: NetworkFixture + + let contracts: GraphNetworkContracts + let grt: GraphToken + let bridgeEscrow: BridgeEscrow + + const nTokens = toGRT('1000') + + before(async function () { + [tokenReceiver, spender] = await graph.getTestAccounts() + ;({ governor } = await graph.getNamedAccounts()) + + fixture = new NetworkFixture(graph.provider) + contracts = await fixture.load(governor) + grt = contracts.GraphToken as GraphToken + bridgeEscrow = contracts.BridgeEscrow as BridgeEscrow + + // Give some funds to the Escrow + await grt.connect(governor).mint(bridgeEscrow.address, nTokens) + }) + + beforeEach(async function () { + await fixture.setUp() + }) + + afterEach(async function () { + await fixture.tearDown() + }) + + describe('approveAll', function () { + it('cannot be called by someone other than the governor', async function () { + const tx = bridgeEscrow.connect(tokenReceiver).approveAll(spender.address) + await expect(tx).revertedWith('Only Controller governor') + }) + it('allows a spender to transfer GRT held by the contract', async function () { + expect(await grt.allowance(bridgeEscrow.address, spender.address)).eq(0) + const tx = grt + .connect(spender) + .transferFrom(bridgeEscrow.address, tokenReceiver.address, nTokens) + await expect(tx).revertedWith('ERC20: transfer amount exceeds allowance') + await bridgeEscrow.connect(governor).approveAll(spender.address) + await expect( + grt.connect(spender).transferFrom(bridgeEscrow.address, tokenReceiver.address, nTokens), + ).to.emit(grt, 'Transfer') + expect(await grt.balanceOf(tokenReceiver.address)).to.eq(nTokens) + }) + }) + + describe('revokeAll', function () { + it('cannot be called by someone other than the governor', async function () { + const tx = bridgeEscrow.connect(tokenReceiver).revokeAll(spender.address) + await expect(tx).revertedWith('Only Controller governor') + }) + it('revokes a spender\'s permission to transfer GRT held by the contract', async function () { + await bridgeEscrow.connect(governor).approveAll(spender.address) + await bridgeEscrow.connect(governor).revokeAll(spender.address) + // We shouldn't be able to transfer _anything_ + const tx = grt + .connect(spender) + .transferFrom(bridgeEscrow.address, tokenReceiver.address, BigNumber.from('1')) + await expect(tx).revertedWith('ERC20: transfer amount exceeds allowance') + }) + }) +}) diff --git a/packages/contracts/test/unit/gateway/l1GraphTokenGateway.test.ts b/packages/contracts/test/unit/gateway/l1GraphTokenGateway.test.ts new file mode 100644 index 000000000..a811c2966 --- /dev/null +++ b/packages/contracts/test/unit/gateway/l1GraphTokenGateway.test.ts @@ -0,0 +1,938 @@ +import hre from 'hardhat' +import { expect } from 'chai' +import { constants, Signer, utils, Wallet } from 'ethers' + +import { GraphToken } from '../../../build/types/GraphToken' +import { BridgeMock } from '../../../build/types/BridgeMock' +import { InboxMock } from '../../../build/types/InboxMock' +import { OutboxMock } from '../../../build/types/OutboxMock' +import { L1GraphTokenGateway } from '../../../build/types/L1GraphTokenGateway' +import { L2GraphToken, L2GraphTokenGateway } from '../../../build/types' +import { BridgeEscrow } from '../../../build/types/BridgeEscrow' + +import { NetworkFixture } from '../lib/fixtures' + +import { applyL1ToL2Alias, GraphNetworkContracts, helpers, toBN, toGRT } from '@graphprotocol/sdk' +import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers' + +const { AddressZero } = constants + +describe('L1GraphTokenGateway', () => { + const graph = hre.graph() + let governor: SignerWithAddress + let tokenSender: SignerWithAddress + let l2Receiver: SignerWithAddress + let pauseGuardian: SignerWithAddress + + let fixture: NetworkFixture + let grt: GraphToken + let l1GraphTokenGateway: L1GraphTokenGateway + let bridgeEscrow: BridgeEscrow + + let bridgeMock: BridgeMock + let inboxMock: InboxMock + let outboxMock: OutboxMock + let routerMock: Wallet + let l2GRTMock: L2GraphToken + let l2GRTGatewayMock: L2GraphTokenGateway + + let fixtureContracts: GraphNetworkContracts + let l2MockContracts: GraphNetworkContracts + + const senderTokens = toGRT('1000') + const maxGas = toBN('1000000') + const maxSubmissionCost = toBN('7') + const gasPriceBid = toBN('2') + const defaultEthValue = maxSubmissionCost.add(maxGas.mul(gasPriceBid)) + const emptyCallHookData = '0x' + const defaultData = utils.defaultAbiCoder.encode( + ['uint256', 'bytes'], + [maxSubmissionCost, emptyCallHookData], + ) + const defaultDataNoSubmissionCost = utils.defaultAbiCoder.encode( + ['uint256', 'bytes'], + [toBN(0), emptyCallHookData], + ) + const notEmptyCallHookData = '0x12' + const defaultDataWithNotEmptyCallHookData = utils.defaultAbiCoder.encode( + ['uint256', 'bytes'], + [maxSubmissionCost, notEmptyCallHookData], + ) + + before(async function () { + [tokenSender, l2Receiver] = await graph.getTestAccounts() + ;({ governor, pauseGuardian } = await graph.getNamedAccounts()) + + fixture = new NetworkFixture(graph.provider) + + // Deploy L1 + fixtureContracts = await fixture.load(governor) + grt = fixtureContracts.GraphToken as GraphToken + l1GraphTokenGateway = fixtureContracts.L1GraphTokenGateway as L1GraphTokenGateway + bridgeEscrow = fixtureContracts.BridgeEscrow as BridgeEscrow + + // Deploy L1 arbitrum bridge + // @ts-expect-error sdk deprecation + ;({ bridgeMock, inboxMock, outboxMock, routerMock } = await fixture.loadL1ArbitrumBridge( + governor, + )) + + // Deploy L2 mock + l2MockContracts = await fixture.loadMock(true) + l2GRTMock = l2MockContracts.L2GraphToken as L2GraphToken + l2GRTGatewayMock = l2MockContracts.L2GraphTokenGateway as L2GraphTokenGateway + + // Give some funds to the token sender/router mock + await grt.connect(governor).mint(tokenSender.address, senderTokens) + await helpers.setBalance(routerMock.address, utils.parseEther('1')) + }) + + beforeEach(async function () { + await fixture.setUp() + }) + + afterEach(async function () { + await fixture.tearDown() + }) + + context('> immediately after deploy', function () { + describe('calculateL2TokenAddress', function () { + it('should return address zero as it was not set', async function () { + expect(await l1GraphTokenGateway.calculateL2TokenAddress(grt.address)).eq(AddressZero) + }) + }) + + describe('outboundTransfer', function () { + it('reverts because it is paused', async function () { + const tx = l1GraphTokenGateway + .connect(tokenSender) + .outboundTransfer( + grt.address, + l2Receiver.address, + toGRT('10'), + maxGas, + gasPriceBid, + defaultData, + { + value: defaultEthValue, + }, + ) + await expect(tx).revertedWith('Paused (contract)') + }) + }) + + describe('finalizeInboundTransfer', function () { + it('revert because it is paused', async function () { + const tx = l1GraphTokenGateway + .connect(tokenSender) + .finalizeInboundTransfer( + grt.address, + l2Receiver.address, + tokenSender.address, + toGRT('10'), + defaultData, + ) + await expect(tx).revertedWith('Paused (contract)') + }) + }) + + describe('setArbitrumAddresses', function () { + it('is not callable by addreses that are not the governor', async function () { + const tx = l1GraphTokenGateway + .connect(tokenSender) + .setArbitrumAddresses(inboxMock.address, routerMock.address) + await expect(tx).revertedWith('Only Controller governor') + }) + it('rejects setting an EOA as router or inbox', async function () { + let tx = l1GraphTokenGateway + .connect(governor) + .setArbitrumAddresses(tokenSender.address, routerMock.address) + await expect(tx).revertedWith('INBOX_MUST_BE_CONTRACT') + tx = l1GraphTokenGateway + .connect(governor) + .setArbitrumAddresses(inboxMock.address, tokenSender.address) + await expect(tx).revertedWith('ROUTER_MUST_BE_CONTRACT') + }) + it('sets inbox and router address', async function () { + const tx = l1GraphTokenGateway + .connect(governor) + .setArbitrumAddresses(inboxMock.address, routerMock.address) + await expect(tx) + .emit(l1GraphTokenGateway, 'ArbitrumAddressesSet') + .withArgs(inboxMock.address, routerMock.address) + expect(await l1GraphTokenGateway.l1Router()).eq(routerMock.address) + expect(await l1GraphTokenGateway.inbox()).eq(inboxMock.address) + }) + }) + + describe('setL2TokenAddress', function () { + it('is not callable by addreses that are not the governor', async function () { + const tx = l1GraphTokenGateway.connect(tokenSender).setL2TokenAddress(l2GRTMock.address) + await expect(tx).revertedWith('Only Controller governor') + }) + it('sets l2GRT', async function () { + const tx = l1GraphTokenGateway.connect(governor).setL2TokenAddress(l2GRTMock.address) + await expect(tx).emit(l1GraphTokenGateway, 'L2TokenAddressSet').withArgs(l2GRTMock.address) + expect(await l1GraphTokenGateway.l2GRT()).eq(l2GRTMock.address) + }) + }) + + describe('setL2CounterpartAddress', function () { + it('is not callable by addreses that are not the governor', async function () { + const tx = l1GraphTokenGateway + .connect(tokenSender) + .setL2CounterpartAddress(l2GRTGatewayMock.address) + await expect(tx).revertedWith('Only Controller governor') + }) + it('sets l2Counterpart which can be queried with counterpartGateway()', async function () { + const tx = l1GraphTokenGateway + .connect(governor) + .setL2CounterpartAddress(l2GRTGatewayMock.address) + await expect(tx) + .emit(l1GraphTokenGateway, 'L2CounterpartAddressSet') + .withArgs(l2GRTGatewayMock.address) + expect(await l1GraphTokenGateway.l2Counterpart()).eq(l2GRTGatewayMock.address) + expect(await l1GraphTokenGateway.counterpartGateway()).eq(l2GRTGatewayMock.address) + }) + }) + describe('setEscrowAddress', function () { + it('is not callable by addreses that are not the governor', async function () { + const tx = l1GraphTokenGateway.connect(tokenSender).setEscrowAddress(bridgeEscrow.address) + await expect(tx).revertedWith('Only Controller governor') + }) + it('sets escrow', async function () { + const tx = l1GraphTokenGateway.connect(governor).setEscrowAddress(bridgeEscrow.address) + await expect(tx) + .emit(l1GraphTokenGateway, 'EscrowAddressSet') + .withArgs(bridgeEscrow.address) + expect(await l1GraphTokenGateway.escrow()).eq(bridgeEscrow.address) + }) + }) + describe('addToCallhookAllowlist', function () { + it('is not callable by addreses that are not the governor', async function () { + const tx = l1GraphTokenGateway + .connect(tokenSender) + .addToCallhookAllowlist(fixtureContracts.RewardsManager.address) + await expect(tx).revertedWith('Only Controller governor') + expect( + await l1GraphTokenGateway.callhookAllowlist(fixtureContracts.RewardsManager.address), + ).eq(false) + }) + it('rejects adding an EOA to the callhook allowlist', async function () { + const tx = l1GraphTokenGateway.connect(governor).addToCallhookAllowlist(tokenSender.address) + await expect(tx).revertedWith('MUST_BE_CONTRACT') + }) + it('adds an address to the callhook allowlist', async function () { + const tx = l1GraphTokenGateway + .connect(governor) + .addToCallhookAllowlist(fixtureContracts.RewardsManager.address) + await expect(tx) + .emit(l1GraphTokenGateway, 'AddedToCallhookAllowlist') + .withArgs(fixtureContracts.RewardsManager.address) + expect( + await l1GraphTokenGateway.callhookAllowlist(fixtureContracts.RewardsManager.address), + ).eq(true) + }) + }) + describe('removeFromCallhookAllowlist', function () { + it('is not callable by addreses that are not the governor', async function () { + await l1GraphTokenGateway + .connect(governor) + .addToCallhookAllowlist(fixtureContracts.RewardsManager.address) + const tx = l1GraphTokenGateway + .connect(tokenSender) + .removeFromCallhookAllowlist(fixtureContracts.RewardsManager.address) + await expect(tx).revertedWith('Only Controller governor') + expect( + await l1GraphTokenGateway.callhookAllowlist(fixtureContracts.RewardsManager.address), + ).eq(true) + }) + it('removes an address from the callhook allowlist', async function () { + await l1GraphTokenGateway + .connect(governor) + .addToCallhookAllowlist(fixtureContracts.RewardsManager.address) + const tx = l1GraphTokenGateway + .connect(governor) + .removeFromCallhookAllowlist(fixtureContracts.RewardsManager.address) + await expect(tx) + .emit(l1GraphTokenGateway, 'RemovedFromCallhookAllowlist') + .withArgs(fixtureContracts.RewardsManager.address) + expect( + await l1GraphTokenGateway.callhookAllowlist(fixtureContracts.RewardsManager.address), + ).eq(false) + }) + }) + describe('Pausable behavior', () => { + it('cannot be paused or unpaused by someone other than governor or pauseGuardian', async () => { + let tx = l1GraphTokenGateway.connect(tokenSender).setPaused(false) + await expect(tx).revertedWith('Only Governor or Guardian') + tx = l1GraphTokenGateway.connect(tokenSender).setPaused(true) + await expect(tx).revertedWith('Only Governor or Guardian') + }) + it('cannot be unpaused if some state variables are not set', async function () { + let tx = l1GraphTokenGateway.connect(governor).setPaused(false) + await expect(tx).revertedWith('INBOX_NOT_SET') + await l1GraphTokenGateway + .connect(governor) + .setArbitrumAddresses(inboxMock.address, routerMock.address) + tx = l1GraphTokenGateway.connect(governor).setPaused(false) + await expect(tx).revertedWith('L2_COUNTERPART_NOT_SET') + await l1GraphTokenGateway + .connect(governor) + .setL2CounterpartAddress(l2GRTGatewayMock.address) + tx = l1GraphTokenGateway.connect(governor).setPaused(false) + await expect(tx).revertedWith('ESCROW_NOT_SET') + }) + it('can be paused and unpaused by the governor', async function () { + await fixture.configureL1Bridge(governor, fixtureContracts, l2MockContracts) + let tx = l1GraphTokenGateway.connect(governor).setPaused(true) + await expect(tx).emit(l1GraphTokenGateway, 'PauseChanged').withArgs(true) + expect(await l1GraphTokenGateway.paused()).eq(true) + tx = l1GraphTokenGateway.connect(governor).setPaused(false) + await expect(tx).emit(l1GraphTokenGateway, 'PauseChanged').withArgs(false) + expect(await l1GraphTokenGateway.paused()).eq(false) + }) + describe('setPauseGuardian', function () { + it('cannot be called by someone other than governor', async function () { + const tx = l1GraphTokenGateway + .connect(tokenSender) + .setPauseGuardian(pauseGuardian.address) + await expect(tx).revertedWith('Only Controller governor') + }) + it('sets a new pause guardian', async function () { + const currentPauseGuardian = await l1GraphTokenGateway.pauseGuardian() + const tx = l1GraphTokenGateway.connect(governor).setPauseGuardian(pauseGuardian.address) + await expect(tx) + .emit(l1GraphTokenGateway, 'NewPauseGuardian') + .withArgs(currentPauseGuardian, pauseGuardian.address) + }) + it('allows a pause guardian to pause and unpause', async function () { + await fixture.configureL1Bridge(governor, fixtureContracts, l2MockContracts) + await l1GraphTokenGateway.connect(governor).setPauseGuardian(pauseGuardian.address) + let tx = l1GraphTokenGateway.connect(pauseGuardian).setPaused(true) + await expect(tx).emit(l1GraphTokenGateway, 'PauseChanged').withArgs(true) + expect(await l1GraphTokenGateway.paused()).eq(true) + tx = l1GraphTokenGateway.connect(pauseGuardian).setPaused(false) + await expect(tx).emit(l1GraphTokenGateway, 'PauseChanged').withArgs(false) + expect(await l1GraphTokenGateway.paused()).eq(false) + }) + }) + }) + }) + + context('> after configuring and unpausing', function () { + const createMsgData = function (callHookData: string) { + const selector = l1GraphTokenGateway.interface.getSighash('finalizeInboundTransfer') + const params = utils.defaultAbiCoder.encode( + ['address', 'address', 'address', 'uint256', 'bytes'], + [grt.address, tokenSender.address, l2Receiver.address, toGRT('10'), callHookData], + ) + const outboundData = utils.hexlify(utils.concat([selector, params])) + + const msgData = utils.solidityPack( + [ + 'uint256', + 'uint256', + 'uint256', + 'uint256', + 'uint256', + 'uint256', + 'uint256', + 'uint256', + 'uint256', + 'bytes', + ], + [ + toBN(l2GRTGatewayMock.address), + toBN('0'), + defaultEthValue, + maxSubmissionCost, + applyL1ToL2Alias(tokenSender.address), + applyL1ToL2Alias(tokenSender.address), + maxGas, + gasPriceBid, + utils.hexDataLength(outboundData), + outboundData, + ], + ) + return msgData + } + const createInboxAccsEntry = function (msgDataHash: string) { + // The real bridge would emit the InboxAccs entry that came before this one, but our mock + // emits this, making it easier for us to validate here that all the parameters we sent are correct + const expectedInboxAccsEntry = utils.keccak256( + utils.solidityPack( + ['address', 'uint8', 'address', 'bytes32'], + [inboxMock.address, 9, l1GraphTokenGateway.address, msgDataHash], + ), + ) + return expectedInboxAccsEntry + } + const testValidOutboundTransfer = async function ( + signer: Signer, + data: string, + callHookData: string, + ) { + const tx = l1GraphTokenGateway + .connect(signer) + .outboundTransfer(grt.address, l2Receiver.address, toGRT('10'), maxGas, gasPriceBid, data, { + value: defaultEthValue, + }) + // Our bridge mock returns an incrementing seqNum starting at 1 + const expectedSeqNum = 1 + await expect(tx) + .emit(l1GraphTokenGateway, 'DepositInitiated') + .withArgs(grt.address, tokenSender.address, l2Receiver.address, expectedSeqNum, toGRT('10')) + + const msgData = createMsgData(callHookData) + const msgDataHash = utils.keccak256(msgData) + const expectedInboxAccsEntry = createInboxAccsEntry(msgDataHash) + + await expect(tx).emit(inboxMock, 'InboxMessageDelivered').withArgs(1, msgData) + await expect(tx) + .emit(bridgeMock, 'MessageDelivered') + .withArgs( + expectedSeqNum, + expectedInboxAccsEntry, + inboxMock.address, + 9, + l1GraphTokenGateway.address, + msgDataHash, + ) + const escrowBalance = await grt.balanceOf(bridgeEscrow.address) + const senderBalance = await grt.balanceOf(tokenSender.address) + expect(escrowBalance).eq(toGRT('10')) + expect(senderBalance).eq(toGRT('990')) + } + before(async function () { + await fixture.configureL1Bridge(governor, fixtureContracts, l2MockContracts) + }) + + describe('updateL2MintAllowance', function () { + it('rejects calls that are not from the governor', async function () { + const tx = l1GraphTokenGateway + .connect(pauseGuardian.address) + .updateL2MintAllowance(toGRT('1'), await helpers.latestBlock()) + await expect(tx).revertedWith('Only Controller governor') + }) + it('does not allow using a future or current block number', async function () { + const issuancePerBlock = toGRT('120') + let issuanceUpdatedAtBlock = (await helpers.latestBlock()) + 2 + const tx1 = l1GraphTokenGateway + .connect(governor) + .updateL2MintAllowance(issuancePerBlock, issuanceUpdatedAtBlock) + await expect(tx1).revertedWith('BLOCK_MUST_BE_PAST') + issuanceUpdatedAtBlock = (await helpers.latestBlock()) + 1 // This will be block.number in our next tx + const tx2 = l1GraphTokenGateway + .connect(governor) + .updateL2MintAllowance(issuancePerBlock, issuanceUpdatedAtBlock) + await expect(tx2).revertedWith('BLOCK_MUST_BE_PAST') + issuanceUpdatedAtBlock = await helpers.latestBlock() // This will be block.number-1 in our next tx + const tx3 = l1GraphTokenGateway + .connect(governor) + .updateL2MintAllowance(issuancePerBlock, issuanceUpdatedAtBlock) + await expect(tx3) + .emit(l1GraphTokenGateway, 'L2MintAllowanceUpdated') + .withArgs(toGRT('0'), issuancePerBlock, issuanceUpdatedAtBlock) + }) + it('does not allow using a block number lower than or equal to the previous one', async function () { + const issuancePerBlock = toGRT('120') + const issuanceUpdatedAtBlock = await helpers.latestBlock() + const tx1 = l1GraphTokenGateway + .connect(governor) + .updateL2MintAllowance(issuancePerBlock, issuanceUpdatedAtBlock) + await expect(tx1) + .emit(l1GraphTokenGateway, 'L2MintAllowanceUpdated') + .withArgs(toGRT('0'), issuancePerBlock, issuanceUpdatedAtBlock) + const tx2 = l1GraphTokenGateway + .connect(governor) + .updateL2MintAllowance(issuancePerBlock, issuanceUpdatedAtBlock) + await expect(tx2).revertedWith('BLOCK_MUST_BE_INCREMENTING') + const tx3 = l1GraphTokenGateway + .connect(governor) + .updateL2MintAllowance(issuancePerBlock, issuanceUpdatedAtBlock - 1) + await expect(tx3).revertedWith('BLOCK_MUST_BE_INCREMENTING') + const tx4 = l1GraphTokenGateway + .connect(governor) + .updateL2MintAllowance(issuancePerBlock, issuanceUpdatedAtBlock + 1) + await expect(tx4) + .emit(l1GraphTokenGateway, 'L2MintAllowanceUpdated') + .withArgs(issuancePerBlock, issuancePerBlock, issuanceUpdatedAtBlock + 1) + }) + it('updates the snapshot and issuance to follow a new linear function, accumulating up to the specified block', async function () { + const issuancePerBlock = toGRT('120') + const issuanceUpdatedAtBlock = (await helpers.latestBlock()) - 2 + const tx1 = l1GraphTokenGateway + .connect(governor) + .updateL2MintAllowance(issuancePerBlock, issuanceUpdatedAtBlock) + await expect(tx1) + .emit(l1GraphTokenGateway, 'L2MintAllowanceUpdated') + .withArgs(toGRT('0'), issuancePerBlock, issuanceUpdatedAtBlock) + // Now the mint allowance should be issuancePerBlock * 3 + expect( + await l1GraphTokenGateway.accumulatedL2MintAllowanceAtBlock(await helpers.latestBlock()), + ).to.eq(issuancePerBlock.mul(3)) + expect(await l1GraphTokenGateway.accumulatedL2MintAllowanceSnapshot()).to.eq(0) + expect(await l1GraphTokenGateway.l2MintAllowancePerBlock()).to.eq(issuancePerBlock) + expect(await l1GraphTokenGateway.lastL2MintAllowanceUpdateBlock()).to.eq( + issuanceUpdatedAtBlock, + ) + + await helpers.mine(10) + + const newIssuancePerBlock = toGRT('200') + const newIssuanceUpdatedAtBlock = (await helpers.latestBlock()) - 1 + + const expectedAccumulatedSnapshot = issuancePerBlock.mul( + newIssuanceUpdatedAtBlock - issuanceUpdatedAtBlock, + ) + const tx2 = l1GraphTokenGateway + .connect(governor) + .updateL2MintAllowance(newIssuancePerBlock, newIssuanceUpdatedAtBlock) + await expect(tx2) + .emit(l1GraphTokenGateway, 'L2MintAllowanceUpdated') + .withArgs(expectedAccumulatedSnapshot, newIssuancePerBlock, newIssuanceUpdatedAtBlock) + + expect( + await l1GraphTokenGateway.accumulatedL2MintAllowanceAtBlock(await helpers.latestBlock()), + ).to.eq(expectedAccumulatedSnapshot.add(newIssuancePerBlock.mul(2))) + expect(await l1GraphTokenGateway.accumulatedL2MintAllowanceSnapshot()).to.eq( + expectedAccumulatedSnapshot, + ) + expect(await l1GraphTokenGateway.l2MintAllowancePerBlock()).to.eq(newIssuancePerBlock) + expect(await l1GraphTokenGateway.lastL2MintAllowanceUpdateBlock()).to.eq( + newIssuanceUpdatedAtBlock, + ) + }) + }) + describe('setL2MintAllowanceParametersManual', function () { + it('rejects calls that are not from the governor', async function () { + const tx = l1GraphTokenGateway + .connect(pauseGuardian.address) + .setL2MintAllowanceParametersManual(toGRT('0'), toGRT('1'), await helpers.latestBlock()) + await expect(tx).revertedWith('Only Controller governor') + }) + it('does not allow using a future or current block number', async function () { + const issuancePerBlock = toGRT('120') + let issuanceUpdatedAtBlock = (await helpers.latestBlock()) + 2 + const tx1 = l1GraphTokenGateway + .connect(governor) + .setL2MintAllowanceParametersManual(toGRT('0'), issuancePerBlock, issuanceUpdatedAtBlock) + await expect(tx1).revertedWith('BLOCK_MUST_BE_PAST') + issuanceUpdatedAtBlock = (await helpers.latestBlock()) + 1 // This will be block.number in our next tx + const tx2 = l1GraphTokenGateway + .connect(governor) + .setL2MintAllowanceParametersManual(toGRT('0'), issuancePerBlock, issuanceUpdatedAtBlock) + await expect(tx2).revertedWith('BLOCK_MUST_BE_PAST') + issuanceUpdatedAtBlock = await helpers.latestBlock() // This will be block.number-1 in our next tx + const tx3 = l1GraphTokenGateway + .connect(governor) + .setL2MintAllowanceParametersManual(toGRT('0'), issuancePerBlock, issuanceUpdatedAtBlock) + await expect(tx3) + .emit(l1GraphTokenGateway, 'L2MintAllowanceUpdated') + .withArgs(toGRT('0'), issuancePerBlock, issuanceUpdatedAtBlock) + }) + it('updates the snapshot and issuance to follow a new linear function, manually setting the snapshot value', async function () { + const issuancePerBlock = toGRT('120') + const issuanceUpdatedAtBlock = (await helpers.latestBlock()) - 2 + const snapshotValue = toGRT('10') + const tx1 = l1GraphTokenGateway + .connect(governor) + .setL2MintAllowanceParametersManual( + snapshotValue, + issuancePerBlock, + issuanceUpdatedAtBlock, + ) + await expect(tx1) + .emit(l1GraphTokenGateway, 'L2MintAllowanceUpdated') + .withArgs(snapshotValue, issuancePerBlock, issuanceUpdatedAtBlock) + // Now the mint allowance should be 10 + issuancePerBlock * 3 + expect( + await l1GraphTokenGateway.accumulatedL2MintAllowanceAtBlock(await helpers.latestBlock()), + ).to.eq(snapshotValue.add(issuancePerBlock.mul(3))) + expect(await l1GraphTokenGateway.accumulatedL2MintAllowanceSnapshot()).to.eq(snapshotValue) + expect(await l1GraphTokenGateway.l2MintAllowancePerBlock()).to.eq(issuancePerBlock) + expect(await l1GraphTokenGateway.lastL2MintAllowanceUpdateBlock()).to.eq( + issuanceUpdatedAtBlock, + ) + + await helpers.mine(10) + + const newIssuancePerBlock = toGRT('200') + const newIssuanceUpdatedAtBlock = (await helpers.latestBlock()) - 1 + const newSnapshotValue = toGRT('10') + + const tx2 = l1GraphTokenGateway + .connect(governor) + .setL2MintAllowanceParametersManual( + newSnapshotValue, + newIssuancePerBlock, + newIssuanceUpdatedAtBlock, + ) + await expect(tx2) + .emit(l1GraphTokenGateway, 'L2MintAllowanceUpdated') + .withArgs(newSnapshotValue, newIssuancePerBlock, newIssuanceUpdatedAtBlock) + + expect( + await l1GraphTokenGateway.accumulatedL2MintAllowanceAtBlock(await helpers.latestBlock()), + ).to.eq(newSnapshotValue.add(newIssuancePerBlock.mul(2))) + expect(await l1GraphTokenGateway.accumulatedL2MintAllowanceSnapshot()).to.eq( + newSnapshotValue, + ) + expect(await l1GraphTokenGateway.l2MintAllowancePerBlock()).to.eq(newIssuancePerBlock) + expect(await l1GraphTokenGateway.lastL2MintAllowanceUpdateBlock()).to.eq( + newIssuanceUpdatedAtBlock, + ) + }) + }) + describe('calculateL2TokenAddress', function () { + it('returns the L2 token address', async function () { + expect(await l1GraphTokenGateway.calculateL2TokenAddress(grt.address)).eq(l2GRTMock.address) + }) + it('returns the zero address if the input is any other address', async function () { + expect(await l1GraphTokenGateway.calculateL2TokenAddress(tokenSender.address)).eq( + AddressZero, + ) + }) + }) + + describe('outboundTransfer', function () { + it('reverts when called with the wrong token address', async function () { + const tx = l1GraphTokenGateway + .connect(tokenSender) + .outboundTransfer( + tokenSender.address, + l2Receiver.address, + toGRT('10'), + maxGas, + gasPriceBid, + defaultData, + { + value: defaultEthValue, + }, + ) + await expect(tx).revertedWith('TOKEN_NOT_GRT') + }) + it('puts tokens in escrow and creates a retryable ticket', async function () { + await grt.connect(tokenSender).approve(l1GraphTokenGateway.address, toGRT('10')) + await testValidOutboundTransfer(tokenSender, defaultData, emptyCallHookData) + }) + it('decodes the sender address from messages sent by the router', async function () { + await grt.connect(tokenSender).approve(l1GraphTokenGateway.address, toGRT('10')) + const routerEncodedData = utils.defaultAbiCoder.encode( + ['address', 'bytes'], + [tokenSender.address, defaultData], + ) + await testValidOutboundTransfer(routerMock, routerEncodedData, emptyCallHookData) + }) + it('reverts when called with no submission cost', async function () { + await grt.connect(tokenSender).approve(l1GraphTokenGateway.address, toGRT('10')) + const tx = l1GraphTokenGateway + .connect(tokenSender) + .outboundTransfer( + grt.address, + l2Receiver.address, + toGRT('10'), + maxGas, + gasPriceBid, + defaultDataNoSubmissionCost, + { + value: defaultEthValue, + }, + ) + await expect(tx).revertedWith('NO_SUBMISSION_COST') + }) + it('reverts when called with nonempty calldata, if the sender is not allowlisted', async function () { + await grt.connect(tokenSender).approve(l1GraphTokenGateway.address, toGRT('10')) + const tx = l1GraphTokenGateway + .connect(tokenSender) + .outboundTransfer( + grt.address, + l2Receiver.address, + toGRT('10'), + maxGas, + gasPriceBid, + defaultDataWithNotEmptyCallHookData, + { + value: defaultEthValue, + }, + ) + await expect(tx).revertedWith('CALL_HOOK_DATA_NOT_ALLOWED') + }) + it('allows sending nonempty calldata, if the sender is allowlisted', async function () { + // Make the sender a contract so that it can be allowed to send callhooks + await helpers.setCode(tokenSender.address, '0x1234') + await l1GraphTokenGateway.connect(governor).addToCallhookAllowlist(tokenSender.address) + await grt.connect(tokenSender).approve(l1GraphTokenGateway.address, toGRT('10')) + await testValidOutboundTransfer( + tokenSender, + defaultDataWithNotEmptyCallHookData, + notEmptyCallHookData, + ) + }) + it('reverts when the sender does not have enough GRT', async function () { + await grt.connect(tokenSender).approve(l1GraphTokenGateway.address, toGRT('1001')) + const tx = l1GraphTokenGateway + .connect(tokenSender) + .outboundTransfer( + grt.address, + l2Receiver.address, + toGRT('1001'), + maxGas, + gasPriceBid, + defaultData, + { + value: defaultEthValue, + }, + ) + await expect(tx).revertedWith('ERC20: transfer amount exceeds balance') + }) + }) + + describe('finalizeInboundTransfer', function () { + it('reverts when called by an account that is not the bridge', async function () { + const tx = l1GraphTokenGateway + .connect(tokenSender) + .finalizeInboundTransfer( + grt.address, + l2Receiver.address, + tokenSender.address, + toGRT('10'), + defaultData, + ) + await expect(tx).revertedWith('NOT_FROM_BRIDGE') + }) + it('reverts when called by the bridge, but the tx was not started by the L2 gateway', async function () { + const encodedCalldata = l1GraphTokenGateway.interface.encodeFunctionData( + 'finalizeInboundTransfer', + [ + grt.address, + l2Receiver.address, + tokenSender.address, + toGRT('10'), + utils.defaultAbiCoder.encode(['uint256', 'bytes'], [0, []]), + ], + ) + // The real outbox would require a proof, which would + // validate that the tx was initiated by the L2 gateway but our mock + // just executes unconditionally + const tx = outboxMock.connect(tokenSender).executeTransaction( + toBN('0'), + [], + toBN('0'), + l2Receiver.address, // Note this is not l2GRTGatewayMock + l1GraphTokenGateway.address, + toBN('1337'), + await helpers.latestBlock(), + toBN('133701337'), + toBN('0'), + encodedCalldata, + ) + await expect(tx).revertedWith('ONLY_COUNTERPART_GATEWAY') + }) + it('reverts if the gateway does not have tokens or allowance', async function () { + // This scenario should never really happen, but we still + // test that the gateway reverts in this case + const encodedCalldata = l1GraphTokenGateway.interface.encodeFunctionData( + 'finalizeInboundTransfer', + [ + grt.address, + l2Receiver.address, + tokenSender.address, + toGRT('10'), + utils.defaultAbiCoder.encode(['uint256', 'bytes'], [0, []]), + ], + ) + // The real outbox would require a proof, which would + // validate that the tx was initiated by the L2 gateway but our mock + // just executes unconditionally + const tx = outboxMock + .connect(tokenSender) + .executeTransaction( + toBN('0'), + [], + toBN('0'), + l2GRTGatewayMock.address, + l1GraphTokenGateway.address, + toBN('1337'), + await helpers.latestBlock(), + toBN('133701337'), + toBN('0'), + encodedCalldata, + ) + await expect(tx).revertedWith('INVALID_L2_MINT_AMOUNT') + }) + it('reverts if the gateway is revoked from escrow', async function () { + await grt.connect(tokenSender).approve(l1GraphTokenGateway.address, toGRT('10')) + await testValidOutboundTransfer(tokenSender, defaultData, emptyCallHookData) + // At this point, the gateway holds 10 GRT in escrow + // But we revoke the gateway's permission to move the funds: + await bridgeEscrow.connect(governor).revokeAll(l1GraphTokenGateway.address) + const encodedCalldata = l1GraphTokenGateway.interface.encodeFunctionData( + 'finalizeInboundTransfer', + [ + grt.address, + l2Receiver.address, + tokenSender.address, + toGRT('8'), + utils.defaultAbiCoder.encode(['uint256', 'bytes'], [0, []]), + ], + ) + // The real outbox would require a proof, which would + // validate that the tx was initiated by the L2 gateway but our mock + // just executes unconditionally + const tx = outboxMock + .connect(tokenSender) + .executeTransaction( + toBN('0'), + [], + toBN('0'), + l2GRTGatewayMock.address, + l1GraphTokenGateway.address, + toBN('1337'), + await helpers.latestBlock(), + toBN('133701337'), + toBN('0'), + encodedCalldata, + ) + await expect(tx).revertedWith('ERC20: transfer amount exceeds allowance') + }) + it('sends tokens out of escrow', async function () { + await grt.connect(tokenSender).approve(l1GraphTokenGateway.address, toGRT('10')) + await testValidOutboundTransfer(tokenSender, defaultData, emptyCallHookData) + // At this point, the gateway holds 10 GRT in escrow + const encodedCalldata = l1GraphTokenGateway.interface.encodeFunctionData( + 'finalizeInboundTransfer', + [ + grt.address, + l2Receiver.address, + tokenSender.address, + toGRT('8'), + utils.defaultAbiCoder.encode(['uint256', 'bytes'], [0, []]), + ], + ) + // The real outbox would require a proof, which would + // validate that the tx was initiated by the L2 gateway but our mock + // just executes unconditionally + const tx = outboxMock + .connect(tokenSender) + .executeTransaction( + toBN('0'), + [], + toBN('0'), + l2GRTGatewayMock.address, + l1GraphTokenGateway.address, + toBN('1337'), + await helpers.latestBlock(), + toBN('133701337'), + toBN('0'), + encodedCalldata, + ) + await expect(tx) + .emit(l1GraphTokenGateway, 'WithdrawalFinalized') + .withArgs(grt.address, l2Receiver.address, tokenSender.address, toBN('0'), toGRT('8')) + const escrowBalance = await grt.balanceOf(bridgeEscrow.address) + const senderBalance = await grt.balanceOf(tokenSender.address) + expect(escrowBalance).eq(toGRT('2')) + expect(senderBalance).eq(toGRT('998')) + }) + it('mints tokens up to the L2 mint allowance', async function () { + await grt.connect(tokenSender).approve(l1GraphTokenGateway.address, toGRT('10')) + await testValidOutboundTransfer(tokenSender, defaultData, emptyCallHookData) + + // Start accruing L2 mint allowance at 2 GRT per block + await l1GraphTokenGateway + .connect(governor) + .updateL2MintAllowance(toGRT('2'), await helpers.latestBlock()) + await helpers.mine(2) + // Now it's been three blocks since the lastL2MintAllowanceUpdateBlock, so + // there should be 8 GRT allowed to be minted from L2 in the next block. + + // At this point, the gateway holds 10 GRT in escrow + const encodedCalldata = l1GraphTokenGateway.interface.encodeFunctionData( + 'finalizeInboundTransfer', + [ + grt.address, + l2Receiver.address, + tokenSender.address, + toGRT('18'), + utils.defaultAbiCoder.encode(['uint256', 'bytes'], [0, []]), + ], + ) + // The real outbox would require a proof, which would + // validate that the tx was initiated by the L2 gateway but our mock + // just executes unconditionally + const tx = outboxMock + .connect(tokenSender) + .executeTransaction( + toBN('0'), + [], + toBN('0'), + l2GRTGatewayMock.address, + l1GraphTokenGateway.address, + toBN('1337'), + await helpers.latestBlock(), + toBN('133701337'), + toBN('0'), + encodedCalldata, + ) + await expect(tx) + .emit(l1GraphTokenGateway, 'WithdrawalFinalized') + .withArgs(grt.address, l2Receiver.address, tokenSender.address, toBN('0'), toGRT('18')) + .emit(l1GraphTokenGateway, 'TokensMintedFromL2') + .withArgs(toGRT('8')) + expect(await l1GraphTokenGateway.totalMintedFromL2()).to.eq(toGRT('8')) + expect( + await l1GraphTokenGateway.accumulatedL2MintAllowanceAtBlock(await helpers.latestBlock()), + ).to.eq(toGRT('8')) + + const escrowBalance = await grt.balanceOf(bridgeEscrow.address) + const senderBalance = await grt.balanceOf(tokenSender.address) + expect(escrowBalance).eq(toGRT('0')) + expect(senderBalance).eq(toGRT('1008')) + }) + it('reverts if the amount to mint is over the allowance', async function () { + await grt.connect(tokenSender).approve(l1GraphTokenGateway.address, toGRT('10')) + await testValidOutboundTransfer(tokenSender, defaultData, emptyCallHookData) + + // Start accruing L2 mint allowance at 2 GRT per block + await l1GraphTokenGateway + .connect(governor) + .updateL2MintAllowance(toGRT('2'), await helpers.latestBlock()) + await helpers.mine(2) + // Now it's been three blocks since the lastL2MintAllowanceUpdateBlock, so + // there should be 8 GRT allowed to be minted from L2 in the next block. + + // At this point, the gateway holds 10 GRT in escrow + const encodedCalldata = l1GraphTokenGateway.interface.encodeFunctionData( + 'finalizeInboundTransfer', + [ + grt.address, + l2Receiver.address, + tokenSender.address, + toGRT('18.001'), + utils.defaultAbiCoder.encode(['uint256', 'bytes'], [0, []]), + ], + ) + // The real outbox would require a proof, which would + // validate that the tx was initiated by the L2 gateway but our mock + // just executes unconditionally + const tx = outboxMock + .connect(tokenSender) + .executeTransaction( + toBN('0'), + [], + toBN('0'), + l2GRTGatewayMock.address, + l1GraphTokenGateway.address, + toBN('1337'), + await helpers.latestBlock(), + toBN('133701337'), + toBN('0'), + encodedCalldata, + ) + await expect(tx).revertedWith('INVALID_L2_MINT_AMOUNT') + }) + }) + }) +}) diff --git a/packages/contracts/test/unit/gns.test.ts b/packages/contracts/test/unit/gns.test.ts new file mode 100644 index 000000000..3a8e9dbca --- /dev/null +++ b/packages/contracts/test/unit/gns.test.ts @@ -0,0 +1,1671 @@ +import hre from 'hardhat' +import { expect } from 'chai' +import { BigNumber, ContractTransaction, ethers, Event } from 'ethers' +import { defaultAbiCoder } from 'ethers/lib/utils' +import { formatGRT, SubgraphDeploymentID } from '@graphprotocol/common-ts' + +import { LegacyGNSMock } from '../../build/types/LegacyGNSMock' +import { GraphToken } from '../../build/types/GraphToken' +import { Curation } from '../../build/types/Curation' + +import { NetworkFixture } from './lib/fixtures' +import { Controller } from '../../build/types/Controller' +import { L1GNS } from '../../build/types/L1GNS' +import { L1GraphTokenGateway } from '../../build/types/L1GraphTokenGateway' +import { + AccountDefaultName, + burnSignal, + createDefaultName, + deprecateSubgraph, + mintSignal, + publishNewSubgraph, + publishNewVersion, +} from './lib/gnsUtils' +import { + buildLegacySubgraphId, + buildSubgraph, + buildSubgraphId, + deploy, + DeployType, + GraphNetworkContracts, + helpers, + loadContractAt, + PublishSubgraph, + randomHexBytes, + Subgraph, + toBN, + toGRT, +} from '@graphprotocol/sdk' +import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers' +import { L2GNS, L2GraphTokenGateway, SubgraphNFT } from '../../build/types' + +const { AddressZero, HashZero } = ethers.constants + +// Utils +const toFloat = (n: BigNumber) => parseFloat(formatGRT(n)) +const toRound = (n: number) => n.toFixed(12) + +describe('L1GNS', () => { + const graph = hre.graph({ addressBook: 'addresses-local.json' }) + + let me: SignerWithAddress + let other: SignerWithAddress + let another: SignerWithAddress + let governor: SignerWithAddress + + let fixture: NetworkFixture + let l2MockContracts: GraphNetworkContracts + + let l2GNSMock: L2GNS + let l2GRTGatewayMock: L2GraphTokenGateway + + let gns: L1GNS + let legacyGNSMock: LegacyGNSMock + let grt: GraphToken + let curation: Curation + let controller: Controller + let subgraphNFT: SubgraphNFT + let l1GraphTokenGateway: L1GraphTokenGateway + + const tokens1000 = toGRT('1000') + const tokens10000 = toGRT('10000') + const tokens100000 = toGRT('100000') + const curationTaxPercentage = 50000 + + let newSubgraph0: PublishSubgraph + let newSubgraph1: PublishSubgraph + let defaultName: AccountDefaultName + + async function calcGNSBondingCurve( + gnsSupply: BigNumber, // nSignal + gnsReserveBalance: BigNumber, // vSignal + depositAmount: BigNumber, // GRT deposited + subgraphID: string, + ): Promise { + const signal = await curation.getCurationPoolSignal(subgraphID) + const curationTokens = await curation.getCurationPoolTokens(subgraphID) + const curationReserveRatio = await curation.defaultReserveRatio() + const expectedSignal = await calcCurationBondingCurve( + signal, + curationTokens, + curationReserveRatio, + depositAmount, + ) + const expectedSignalBN = toGRT(String(expectedSignal.toFixed(18))) + + // Handle the initialization of the bonding curve + if (gnsSupply.eq(0)) { + return expectedSignal + } + // Since we known CW = 1, we can do the simplified formula of: + return (toFloat(gnsSupply) * toFloat(expectedSignalBN)) / toFloat(gnsReserveBalance) + } + + async function calcCurationBondingCurve( + supply: BigNumber, + reserveBalance: BigNumber, + reserveRatio: number, + depositAmount: BigNumber, + ): Promise { + // Handle the initialization of the bonding curve + const minSupply = toGRT('1') + if (supply.eq(0)) { + const minDeposit = await curation.minimumCurationDeposit() + if (depositAmount.lt(minDeposit)) { + throw new Error('deposit must be above minimum') + } + return ( + (await calcCurationBondingCurve( + minSupply, + minDeposit, + reserveRatio, + depositAmount.sub(minDeposit), + )) + toFloat(minSupply) + ) + } + // Calculate bonding curve in the test + return ( + toFloat(supply) + * ((1 + toFloat(depositAmount) / toFloat(reserveBalance)) ** (reserveRatio / 1000000) - 1) + ) + } + + const transferSignal = async ( + subgraphID: string, + owner: SignerWithAddress, + recipient: SignerWithAddress, + amount: BigNumber, + ): Promise => { + // Before state + const beforeOwnerNSignal = await gns.getCuratorSignal(subgraphID, owner.address) + const beforeRecipientNSignal = await gns.getCuratorSignal(subgraphID, recipient.address) + + // Transfer + const tx = gns.connect(owner).transferSignal(subgraphID, recipient.address, amount) + + await expect(tx) + .emit(gns, 'SignalTransferred') + .withArgs(subgraphID, owner.address, recipient.address, amount) + + // After state + const afterOwnerNSignal = await gns.getCuratorSignal(subgraphID, owner.address) + const afterRecipientNSignal = await gns.getCuratorSignal(subgraphID, recipient.address) + + // Check state + expect(afterOwnerNSignal).eq(beforeOwnerNSignal.sub(amount)) + expect(afterRecipientNSignal).eq(beforeRecipientNSignal.add(amount)) + + return tx + } + + const withdraw = async ( + account: SignerWithAddress, + subgraphID: string, + ): Promise => { + // Before state + const beforeCuratorNSignal = await gns.getCuratorSignal(subgraphID, account.address) + const beforeSubgraph = await gns.subgraphs(subgraphID) + const beforeGNSBalance = await grt.balanceOf(gns.address) + const tokensEstimate = beforeSubgraph.withdrawableGRT + .mul(beforeCuratorNSignal) + .div(beforeSubgraph.nSignal) + + // Send tx + const tx = gns.connect(account).withdraw(subgraphID) + await expect(tx) + .emit(gns, 'GRTWithdrawn') + .withArgs(subgraphID, account.address, beforeCuratorNSignal, tokensEstimate) + + // curator nSignal should be updated + const afterCuratorNSignal = await gns.getCuratorSignal(subgraphID, account.address) + expect(afterCuratorNSignal).eq(toBN(0)) + + // overall n signal should be updated + const afterSubgraph = await gns.subgraphs(subgraphID) + expect(afterSubgraph.nSignal).eq(beforeSubgraph.nSignal.sub(beforeCuratorNSignal)) + + // Token balance should be updated + const afterGNSBalance = await grt.balanceOf(gns.address) + expect(afterGNSBalance).eq(beforeGNSBalance.sub(tokensEstimate)) + + return tx + } + const deployLegacyGNSMock = async (): Promise => { + const { contract: subgraphDescriptor } = await deploy(DeployType.Deploy, governor, { + name: 'SubgraphNFTDescriptor', + }) + const { contract: subgraphNFT } = await deploy(DeployType.Deploy, governor, { + name: 'SubgraphNFT', + args: [governor.address], + }) + + // Deploy + const deployResult = await deploy( + DeployType.DeployWithProxy, + governor, + { name: 'LegacyGNSMock', args: [controller.address, subgraphNFT.address] }, + graph.addressBook, + { + name: 'GraphProxy', + }, + ) + legacyGNSMock = deployResult.contract as LegacyGNSMock + + // Post-config + await subgraphNFT.connect(governor).setMinter(legacyGNSMock.address) + await subgraphNFT.connect(governor).setTokenDescriptor(subgraphDescriptor.address) + await legacyGNSMock.connect(governor).syncAllContracts() + await legacyGNSMock.connect(governor).approveAll() + await l1GraphTokenGateway.connect(governor).addToCallhookAllowlist(legacyGNSMock.address) + await legacyGNSMock.connect(governor).setCounterpartGNSAddress(l2GNSMock.address) + } + + before(async function () { + [me, other, governor, another] = await graph.getTestAccounts() + + fixture = new NetworkFixture(graph.provider) + + // Deploy L1 + const fixtureContracts = await fixture.load(governor) + grt = fixtureContracts.GraphToken as GraphToken + curation = fixtureContracts.Curation as Curation + gns = fixtureContracts.GNS as L1GNS + controller = fixtureContracts.Controller as Controller + l1GraphTokenGateway = fixtureContracts.L1GraphTokenGateway as L1GraphTokenGateway + subgraphNFT = fixtureContracts.SubgraphNFT as SubgraphNFT + + // Deploy L1 arbitrum bridge + await fixture.loadL1ArbitrumBridge(governor) + + // Deploy L2 mock + l2MockContracts = await fixture.loadMock(true) + l2GNSMock = l2MockContracts.L2GNS as L2GNS + l2GRTGatewayMock = l2MockContracts.L2GraphTokenGateway as L2GraphTokenGateway + + // Configure graph bridge + await fixture.configureL1Bridge(governor, fixtureContracts, l2MockContracts) + + newSubgraph0 = buildSubgraph() + newSubgraph1 = buildSubgraph() + defaultName = createDefaultName('graph') + // Give some funds to the signers and approve gns contract to use funds on signers behalf + await grt.connect(governor).mint(me.address, tokens100000) + await grt.connect(governor).mint(other.address, tokens100000) + await grt.connect(governor).mint(another.address, tokens100000) + await grt.connect(me).approve(gns.address, tokens100000) + await grt.connect(me).approve(curation.address, tokens100000) + await grt.connect(other).approve(gns.address, tokens100000) + await grt.connect(other).approve(curation.address, tokens100000) + await grt.connect(another).approve(gns.address, tokens100000) + await grt.connect(another).approve(curation.address, tokens100000) + // Update curation tax to test the functionality of it in disableNameSignal() + await curation.connect(governor).setCurationTaxPercentage(curationTaxPercentage) + + // Deploying a GNS mock with support for legacy subgraphs + await deployLegacyGNSMock() + await grt.connect(me).approve(legacyGNSMock.address, tokens100000) + }) + + beforeEach(async function () { + await fixture.setUp() + }) + + afterEach(async function () { + await fixture.tearDown() + }) + + describe('Configuration', function () { + describe('setOwnerTaxPercentage', function () { + const newValue = 10 + + it('should set `ownerTaxPercentage`', async function () { + // Can set if allowed + await gns.connect(governor).setOwnerTaxPercentage(newValue) + expect(await gns.ownerTaxPercentage()).eq(newValue) + }) + + it('reject set `ownerTaxPercentage` if out of bounds', async function () { + const tx = gns.connect(governor).setOwnerTaxPercentage(1000001) + await expect(tx).revertedWith('Owner tax must be MAX_PPM or less') + }) + + it('reject set `ownerTaxPercentage` if not allowed', async function () { + const tx = gns.connect(me).setOwnerTaxPercentage(newValue) + await expect(tx).revertedWith('Only Controller governor') + }) + }) + + describe('setCounterpartGNSAddress', function () { + it('should set `counterpartGNSAddress`', async function () { + // Can set if allowed + const newValue = other.address + const tx = gns.connect(governor).setCounterpartGNSAddress(newValue) + await expect(tx).emit(gns, 'CounterpartGNSAddressUpdated').withArgs(newValue) + expect(await gns.counterpartGNSAddress()).eq(newValue) + }) + + it('reject set `counterpartGNSAddress` if not allowed', async function () { + const newValue = other.address + const tx = gns.connect(me).setCounterpartGNSAddress(newValue) + await expect(tx).revertedWith('Only Controller governor') + }) + }) + + describe('setSubgraphNFT', function () { + it('should set `setSubgraphNFT`', async function () { + const newValue = gns.address // I just use any contract address + const tx = gns.connect(governor).setSubgraphNFT(newValue) + await expect(tx).emit(gns, 'SubgraphNFTUpdated').withArgs(newValue) + expect(await gns.subgraphNFT()).eq(newValue) + }) + + it('revert set to empty address', async function () { + const tx = gns.connect(governor).setSubgraphNFT(AddressZero) + await expect(tx).revertedWith('NFT address cant be zero') + }) + + it('revert set to non-contract', async function () { + const tx = gns.connect(governor).setSubgraphNFT(randomHexBytes(20)) + await expect(tx).revertedWith('NFT must be valid') + }) + }) + }) + + describe('Publishing names and versions', function () { + describe('setDefaultName', function () { + it('setDefaultName emits the event', async function () { + const tx = gns + .connect(me) + .setDefaultName(me.address, 0, defaultName.nameIdentifier, defaultName.name) + await expect(tx) + .emit(gns, 'SetDefaultName') + .withArgs(me.address, 0, defaultName.nameIdentifier, defaultName.name) + }) + + it('setDefaultName fails if not owner', async function () { + const tx = gns + .connect(other) + .setDefaultName(me.address, 0, defaultName.nameIdentifier, defaultName.name) + await expect(tx).revertedWith('GNS: Only you can set your name') + }) + }) + + describe('updateSubgraphMetadata', function () { + let subgraph: Subgraph + + beforeEach(async function () { + subgraph = await publishNewSubgraph(me, newSubgraph0, gns, graph.chainId) + }) + + it('updateSubgraphMetadata emits the event', async function () { + const tx = gns + .connect(me) + .updateSubgraphMetadata(subgraph.id, newSubgraph0.subgraphMetadata) + await expect(tx) + .emit(gns, 'SubgraphMetadataUpdated') + .withArgs(subgraph.id, newSubgraph0.subgraphMetadata) + }) + + it('updateSubgraphMetadata fails if not owner', async function () { + const tx = gns + .connect(other) + .updateSubgraphMetadata(subgraph.id, newSubgraph0.subgraphMetadata) + await expect(tx).revertedWith('GNS: Must be authorized') + }) + }) + + describe('isPublished', function () { + it('should return if the subgraph is published', async function () { + const subgraphID = await buildSubgraphId(me.address, toBN(0), graph.chainId) + expect(await gns.isPublished(subgraphID)).eq(false) + await publishNewSubgraph(me, newSubgraph0, gns, graph.chainId) + expect(await gns.isPublished(subgraphID)).eq(true) + }) + }) + + describe('publishNewSubgraph', function () { + it('should publish a new subgraph and first version with it', async function () { + await publishNewSubgraph(me, newSubgraph0, gns, graph.chainId) + }) + + it('should publish a new subgraph with an incremented value', async function () { + const subgraph1 = await publishNewSubgraph(me, newSubgraph0, gns, graph.chainId) + const subgraph2 = await publishNewSubgraph(me, newSubgraph1, gns, graph.chainId) + expect(subgraph1.id).not.eq(subgraph2.id) + }) + + it('should prevent subgraphDeploymentID of 0 to be used', async function () { + const tx = gns + .connect(me) + .publishNewSubgraph(HashZero, newSubgraph0.versionMetadata, newSubgraph0.subgraphMetadata) + await expect(tx).revertedWith('GNS: Cannot set deploymentID to 0 in publish') + }) + }) + + describe('publishNewVersion', function () { + let subgraph: Subgraph + + beforeEach(async () => { + subgraph = await publishNewSubgraph(me, newSubgraph0, gns, graph.chainId) + await mintSignal(me, subgraph.id, tokens10000, gns, curation) + }) + + it('should publish a new version on an existing subgraph', async function () { + await publishNewVersion(me, subgraph.id, newSubgraph1, gns, curation) + }) + + it('should publish a new version on an existing subgraph when owner tax is zero', async function () { + await gns.connect(governor).setOwnerTaxPercentage(0) + await publishNewVersion(me, subgraph.id, newSubgraph1, gns, curation) + }) + + it('should publish a new version on an existing subgraph when curation tax percentage is zero', async function () { + await curation.connect(governor).setCurationTaxPercentage(0) + await publishNewVersion(me, subgraph.id, newSubgraph1, gns, curation) + }) + + it('should publish a new version on an existing subgraph with no current signal', async function () { + const emptySignalSubgraph = await publishNewSubgraph( + me, + buildSubgraph(), + gns, + graph.chainId, + ) + await publishNewVersion(me, emptySignalSubgraph.id, newSubgraph1, gns, curation) + }) + + it('should reject a new version with the same subgraph deployment ID', async function () { + const tx = gns + .connect(me) + .publishNewVersion( + subgraph.id, + newSubgraph0.subgraphDeploymentID, + newSubgraph0.versionMetadata, + ) + await expect(tx).revertedWith( + 'GNS: Cannot publish a new version with the same subgraph deployment ID', + ) + }) + + it('should reject publishing a version to a subgraph that does not exist', async function () { + const tx = gns + .connect(me) + .publishNewVersion( + randomHexBytes(32), + newSubgraph1.subgraphDeploymentID, + newSubgraph1.versionMetadata, + ) + await expect(tx).revertedWith('ERC721: owner query for nonexistent token') + }) + + it('reject if not the owner', async function () { + const tx = gns + .connect(other) + .publishNewVersion( + subgraph.id, + newSubgraph1.subgraphDeploymentID, + newSubgraph1.versionMetadata, + ) + await expect(tx).revertedWith('GNS: Must be authorized') + }) + + it('should fail when upgrade tries to point to a pre-curated', async function () { + // Curate directly to the deployment + await curation.connect(me).mint(newSubgraph1.subgraphDeploymentID, tokens1000, 0) + + // Target a pre-curated subgraph deployment + const tx = gns + .connect(me) + .publishNewVersion( + subgraph.id, + newSubgraph1.subgraphDeploymentID, + newSubgraph1.versionMetadata, + ) + await expect(tx).revertedWith( + 'GNS: Owner cannot point to a subgraphID that has been pre-curated', + ) + }) + + it('should upgrade version when there is no signal with no signal migration', async function () { + await burnSignal(me, subgraph.id, gns, curation) + const tx = gns + .connect(me) + .publishNewVersion( + subgraph.id, + newSubgraph1.subgraphDeploymentID, + newSubgraph1.versionMetadata, + ) + await expect(tx) + .emit(gns, 'SubgraphVersionUpdated') + .withArgs(subgraph.id, newSubgraph1.subgraphDeploymentID, newSubgraph1.versionMetadata) + }) + + it('should fail when subgraph is deprecated', async function () { + await deprecateSubgraph(me, subgraph.id, gns, curation, grt) + const tx = gns + .connect(me) + .publishNewVersion( + subgraph.id, + newSubgraph1.subgraphDeploymentID, + newSubgraph1.versionMetadata, + ) + // NOTE: deprecate burns the Subgraph NFT, when someone wants to publish a new version it won't find it + await expect(tx).revertedWith('ERC721: owner query for nonexistent token') + }) + }) + describe('subgraphTokens', function () { + it('should return the correct number of tokens for a subgraph', async function () { + const subgraph = await publishNewSubgraph(me, newSubgraph0, gns, graph.chainId) + const taxForMe = ( + await curation.tokensToSignal(subgraph.subgraphDeploymentID, tokens10000) + )[1] + await mintSignal(me, subgraph.id, tokens10000, gns, curation) + const taxForOther = ( + await curation.tokensToSignal(subgraph.subgraphDeploymentID, tokens1000) + )[1] + await mintSignal(other, subgraph.id, tokens1000, gns, curation) + expect(await gns.subgraphTokens(subgraph.id)).eq( + tokens10000.add(tokens1000).sub(taxForMe).sub(taxForOther), + ) + }) + }) + describe('subgraphSignal', function () { + it('should return the correct amount of signal for a subgraph', async function () { + const subgraph = await publishNewSubgraph(me, newSubgraph0, gns, graph.chainId) + const vSignalForMe = ( + await curation.tokensToSignal(subgraph.subgraphDeploymentID, tokens10000) + )[0] + await mintSignal(me, subgraph.id, tokens10000, gns, curation) + const vSignalForOther = ( + await curation.tokensToSignal(subgraph.subgraphDeploymentID, tokens1000) + )[0] + await mintSignal(other, subgraph.id, tokens1000, gns, curation) + const expectedSignal = await gns.vSignalToNSignal( + subgraph.id, + vSignalForMe.add(vSignalForOther), + ) + expect(await gns.subgraphSignal(subgraph.id)).eq(expectedSignal) + }) + }) + describe('deprecateSubgraph', function () { + let subgraph: Subgraph + + beforeEach(async () => { + subgraph = await publishNewSubgraph(me, newSubgraph0, gns, graph.chainId) + await mintSignal(me, subgraph.id, tokens10000, gns, curation) + }) + + it('should deprecate a subgraph', async function () { + await deprecateSubgraph(me, subgraph.id, gns, curation, grt) + }) + + it('should prevent a deprecated subgraph from being republished', async function () { + await deprecateSubgraph(me, subgraph.id, gns, curation, grt) + const tx = gns + .connect(me) + .publishNewVersion( + subgraph.id, + newSubgraph1.subgraphDeploymentID, + newSubgraph1.versionMetadata, + ) + // NOTE: deprecate burns the Subgraph NFT, when someone wants to publish a new version it won't find it + await expect(tx).revertedWith('ERC721: owner query for nonexistent token') + }) + + it('reject if the subgraph does not exist', async function () { + const subgraphID = randomHexBytes(32) + const tx = gns.connect(me).deprecateSubgraph(subgraphID) + await expect(tx).revertedWith('ERC721: owner query for nonexistent token') + }) + + it('reject deprecate if not the owner', async function () { + const tx = gns.connect(other).deprecateSubgraph(subgraph.id) + await expect(tx).revertedWith('GNS: Must be authorized') + }) + }) + }) + + describe('Curating on names', function () { + describe('mintSignal()', function () { + it('should deposit into the name signal curve', async function () { + const subgraph = await publishNewSubgraph(me, newSubgraph0, gns, graph.chainId) + await mintSignal(other, subgraph.id, tokens10000, gns, curation) + }) + + it('should fail when name signal is disabled', async function () { + const subgraph = await publishNewSubgraph(me, newSubgraph0, gns, graph.chainId) + await deprecateSubgraph(me, subgraph.id, gns, curation, grt) + const tx = gns.connect(me).mintSignal(subgraph.id, tokens1000, 0) + await expect(tx).revertedWith('GNS: Must be active') + }) + + it('should fail if you try to deposit on a non existing name', async function () { + const subgraphID = randomHexBytes(32) + const tx = gns.connect(me).mintSignal(subgraphID, tokens1000, 0) + await expect(tx).revertedWith('GNS: Must be active') + }) + + it('reject minting if under slippage', async function () { + // First publish the subgraph + const subgraph = await publishNewSubgraph(me, newSubgraph0, gns, graph.chainId) + + // Set slippage to be 1 less than expected result to force reverting + const { 1: expectedNSignal } = await gns.tokensToNSignal(subgraph.id, tokens1000) + const tx = gns.connect(me).mintSignal(subgraph.id, tokens1000, expectedNSignal.add(1)) + await expect(tx).revertedWith('Slippage protection') + }) + }) + + describe('burnSignal()', function () { + let subgraph: Subgraph + + beforeEach(async () => { + subgraph = await publishNewSubgraph(me, newSubgraph0, gns, graph.chainId) + await mintSignal(other, subgraph.id, tokens10000, gns, curation) + }) + + it('should withdraw from the name signal curve', async function () { + await burnSignal(other, subgraph.id, gns, curation) + }) + + it('should fail when name signal is disabled', async function () { + await deprecateSubgraph(me, subgraph.id, gns, curation, grt) + // just test 1 since it will fail + const tx = gns.connect(me).burnSignal(subgraph.id, 1, 0) + await expect(tx).revertedWith('GNS: Must be active') + }) + + it('should fail when the curator tries to withdraw more nSignal than they have', async function () { + const tx = gns.connect(me).burnSignal( + subgraph.id, + // 1000000 * 10^18 nSignal is a lot, and will cause fail + toBN('1000000000000000000000000'), + 0, + ) + await expect(tx).revertedWith('GNS: Curator cannot withdraw more nSignal than they have') + }) + + it('reject burning if under slippage', async function () { + // Get current curator name signal + const curatorNSignal = await gns.getCuratorSignal(subgraph.id, other.address) + + // Withdraw + const { 1: expectedTokens } = await gns.nSignalToTokens(subgraph.id, curatorNSignal) + + // Force a revert by asking 1 more token than the function will return + const tx = gns.connect(other).burnSignal(subgraph.id, curatorNSignal, expectedTokens.add(1)) + await expect(tx).revertedWith('Slippage protection') + }) + }) + + describe('transferSignal()', function () { + let subgraph: Subgraph + let otherNSignal: BigNumber + + beforeEach(async () => { + subgraph = await publishNewSubgraph(me, newSubgraph0, gns, graph.chainId) + await mintSignal(other, subgraph.id, tokens10000, gns, curation) + otherNSignal = await gns.getCuratorSignal(subgraph.id, other.address) + }) + + it('should transfer signal from one curator to another', async function () { + await transferSignal(subgraph.id, other, another, otherNSignal) + }) + it('should fail when transferring to zero address', async function () { + const tx = gns + .connect(other) + .transferSignal(subgraph.id, ethers.constants.AddressZero, otherNSignal) + await expect(tx).revertedWith('GNS: Curator cannot transfer to the zero address') + }) + it('should fail when name signal is disabled', async function () { + await deprecateSubgraph(me, subgraph.id, gns, curation, grt) + const tx = gns.connect(other).transferSignal(subgraph.id, another.address, otherNSignal) + await expect(tx).revertedWith('GNS: Must be active') + }) + it('should fail if you try to transfer on a non existing name', async function () { + const subgraphID = randomHexBytes(32) + const tx = gns.connect(other).transferSignal(subgraphID, another.address, otherNSignal) + await expect(tx).revertedWith('GNS: Must be active') + }) + it('should fail when the curator tries to transfer more signal than they have', async function () { + const tx = gns + .connect(other) + .transferSignal(subgraph.id, another.address, otherNSignal.add(otherNSignal)) + await expect(tx).revertedWith('GNS: Curator transfer amount exceeds balance') + }) + }) + describe('withdraw()', function () { + let subgraph: Subgraph + + beforeEach(async () => { + subgraph = await publishNewSubgraph(me, newSubgraph0, gns, graph.chainId) + await mintSignal(other, subgraph.id, tokens10000, gns, curation) + }) + + it('should withdraw GRT from a disabled name signal', async function () { + await deprecateSubgraph(me, subgraph.id, gns, curation, grt) + await withdraw(other, subgraph.id) + }) + + it('should fail if not disabled', async function () { + const tx = gns.connect(other).withdraw(subgraph.id) + await expect(tx).revertedWith('GNS: Must be disabled first') + }) + + it('should fail when there is no more GRT to withdraw', async function () { + await deprecateSubgraph(me, subgraph.id, gns, curation, grt) + await withdraw(other, subgraph.id) + const tx = gns.connect(other).withdraw(subgraph.id) + await expect(tx).revertedWith('GNS: No more GRT to withdraw') + }) + + it('should fail if the curator has no nSignal', async function () { + await deprecateSubgraph(me, subgraph.id, gns, curation, grt) + const tx = gns.connect(me).withdraw(subgraph.id) + await expect(tx).revertedWith('GNS: No signal to withdraw GRT') + }) + }) + + describe('multiple minting', function () { + it('should mint less signal every time due to the bonding curve', async function () { + const tokensToDepositMany = [ + toGRT('1000'), // should mint if we start with number above minimum deposit + toGRT('1000'), // every time it should mint less GCS due to bonding curve... + toGRT('1.06'), // should mint minimum deposit including tax + toGRT('1000'), + toGRT('1000'), + toGRT('2000'), + toGRT('2000'), + toGRT('123'), + ] + const subgraph = await publishNewSubgraph(me, newSubgraph0, gns, graph.chainId) + + // State updated + const curationTaxPercentage = await curation.curationTaxPercentage() + + for (const tokensToDeposit of tokensToDepositMany) { + const beforeSubgraph = await gns.subgraphs(subgraph.id) + expect(newSubgraph0.subgraphDeploymentID).eq(beforeSubgraph.subgraphDeploymentID) + + const curationTax = toBN(curationTaxPercentage).mul(tokensToDeposit).div(toBN(1000000)) + const expectedNSignal = await calcGNSBondingCurve( + beforeSubgraph.nSignal, + beforeSubgraph.vSignal, + tokensToDeposit.sub(curationTax), + beforeSubgraph.subgraphDeploymentID, + ) + const tx = await mintSignal(me, subgraph.id, tokensToDeposit, gns, curation) + const receipt = await tx.wait() + const event: Event = receipt.events.pop() + const nSignalCreated = event.args['nSignalCreated'] + expect(toRound(expectedNSignal)).eq(toRound(toFloat(nSignalCreated))) + } + }) + + it('should mint when using the edge case of linear function', async function () { + // Setup edge case like linear function: 1 vSignal = 1 nSignal = 1 token + await curation.connect(governor).setMinimumCurationDeposit(toGRT('1')) + await curation.connect(governor).setDefaultReserveRatio(1000000) + // note - reserve ratio is already set to 1000000 in GNS + + const tokensToDepositMany = [ + toGRT('1000'), // should mint if we start with number above minimum deposit + toGRT('1000'), // every time it should mint less GCS due to bonding curve... + toGRT('1000'), + toGRT('1000'), + toGRT('2000'), + toGRT('2000'), + toGRT('123'), + toGRT('1'), // should mint below minimum deposit + ] + + const subgraph = await publishNewSubgraph(me, newSubgraph0, gns, graph.chainId) + + // State updated + for (const tokensToDeposit of tokensToDepositMany) { + await mintSignal(me, subgraph.id, tokensToDeposit, gns, curation) + } + }) + }) + }) + + describe('Two named subgraphs point to the same subgraph deployment ID', function () { + it('handle initialization under minimum signal values', async function () { + await curation.connect(governor).setMinimumCurationDeposit(toGRT('1')) + + // Publish a named subgraph-0 -> subgraphDeployment0 + const subgraph0 = await publishNewSubgraph(me, newSubgraph0, gns, graph.chainId) + // Curate on the first subgraph + await gns.connect(me).mintSignal(subgraph0.id, toGRT('90000'), 0) + + // Publish a named subgraph-1 -> subgraphDeployment0 + const subgraph1 = await publishNewSubgraph(me, newSubgraph0, gns, graph.chainId) + // Curate on the second subgraph should work + await gns.connect(me).mintSignal(subgraph1.id, toGRT('10'), 0) + }) + }) + + describe('batch calls', function () { + it('should publish new subgraph and mint signal in single transaction', async function () { + // Create a subgraph + const tx1 = await gns.populateTransaction.publishNewSubgraph( + newSubgraph0.subgraphDeploymentID, + newSubgraph0.versionMetadata, + newSubgraph0.subgraphMetadata, + ) + // Curate on the subgraph + const subgraphID = await buildSubgraphId( + me.address, + await gns.nextAccountSeqID(me.address), + graph.chainId, + ) + const tx2 = await gns.populateTransaction.mintSignal(subgraphID, toGRT('90000'), 0) + + // Batch send transaction + await gns.connect(me).multicall([tx1.data, tx2.data]) + }) + + it('should revert if batching a call to non-authorized function', async function () { + // Call a forbidden function + const tx1 = await gns.populateTransaction.setOwnerTaxPercentage(100) + + // Create a subgraph + const tx2 = await gns.populateTransaction.publishNewSubgraph( + newSubgraph0.subgraphDeploymentID, + newSubgraph0.versionMetadata, + newSubgraph0.subgraphMetadata, + ) + + // Batch send transaction + const tx = gns.connect(me).multicall([tx1.data, tx2.data]) + await expect(tx).revertedWith('Only Controller governor') + }) + + it('should revert if batching a call to initialize', async function () { + // Call a forbidden function + const tx1 = await gns.populateTransaction.initialize(me.address, me.address) + + // Create a subgraph + const tx2 = await gns.populateTransaction.publishNewSubgraph( + newSubgraph0.subgraphDeploymentID, + newSubgraph0.versionMetadata, + newSubgraph0.subgraphMetadata, + ) + + // Batch send transaction + const tx = gns.connect(me).multicall([tx1.data, tx2.data]) + await expect(tx).revertedWith('Only implementation') + }) + + it('should revert if trying to call a private function', async function () { + // Craft call a private function + const hash = ethers.utils.id('_setOwnerTaxPercentage(uint32)') + const functionHash = hash.slice(0, 10) + const calldata = ethers.utils.arrayify( + ethers.utils.defaultAbiCoder.encode(['uint32'], ['100']), + ) + const bogusPayload = ethers.utils.concat([functionHash, calldata]) + + // Create a subgraph + const tx2 = await gns.populateTransaction.publishNewSubgraph( + newSubgraph0.subgraphDeploymentID, + newSubgraph0.versionMetadata, + newSubgraph0.subgraphMetadata, + ) + + // Batch send transaction + const tx = gns.connect(me).multicall([bogusPayload, tx2.data]) + await expect(tx).revertedWith('') + }) + }) + + describe('NFT descriptor', function () { + it('cannot be minted by an account that is not the minter (i.e. GNS)', async function () { + const tx = subgraphNFT.connect(me).mint(me.address, 1) + await expect(tx).revertedWith('Must be a minter') + }) + it('cannot be burned by an account that is not the minter (i.e. GNS)', async function () { + const tx = subgraphNFT.connect(me).burn(1) + await expect(tx).revertedWith('Must be a minter') + }) + it('with token descriptor', async function () { + const subgraph0 = await publishNewSubgraph(me, newSubgraph0, gns, graph.chainId) + + const tokenURI = await subgraphNFT.connect(me).tokenURI(subgraph0.id) + + const sub = new SubgraphDeploymentID(newSubgraph0.subgraphMetadata) + expect(sub.ipfsHash).eq(tokenURI) + }) + + it('with token descriptor and baseURI', async function () { + const subgraph0 = await publishNewSubgraph(me, newSubgraph0, gns, graph.chainId) + + await subgraphNFT.connect(governor).setBaseURI('ipfs://') + const tokenURI = await subgraphNFT.connect(me).tokenURI(subgraph0.id) + + const sub = new SubgraphDeploymentID(newSubgraph0.subgraphMetadata) + expect('ipfs://' + sub.ipfsHash).eq(tokenURI) + }) + + it('without token descriptor', async function () { + const subgraph0 = await publishNewSubgraph(me, newSubgraph0, gns, graph.chainId) + + await subgraphNFT.connect(governor).setTokenDescriptor(AddressZero) + const tokenURI = await subgraphNFT.connect(me).tokenURI(subgraph0.id) + + const sub = new SubgraphDeploymentID(newSubgraph0.subgraphMetadata) + expect(sub.bytes32).eq(tokenURI) + }) + + it('without token descriptor and baseURI', async function () { + const subgraph0 = await publishNewSubgraph(me, newSubgraph0, gns, graph.chainId) + + await subgraphNFT.connect(governor).setTokenDescriptor(AddressZero) + await subgraphNFT.connect(governor).setBaseURI('ipfs://') + const tokenURI = await subgraphNFT.connect(me).tokenURI(subgraph0.id) + + const sub = new SubgraphDeploymentID(newSubgraph0.subgraphMetadata) + expect('ipfs://' + sub.bytes32).eq(tokenURI) + }) + + it('without token descriptor and 0x0 metadata', async function () { + const newSubgraphNoMetadata = buildSubgraph() + newSubgraphNoMetadata.subgraphMetadata = HashZero + const subgraph0 = await publishNewSubgraph(me, newSubgraphNoMetadata, gns, graph.chainId) + + await subgraphNFT.connect(governor).setTokenDescriptor(AddressZero) + await subgraphNFT.connect(governor).setBaseURI('ipfs://') + const tokenURI = await subgraphNFT.connect(me).tokenURI(subgraph0.id) + expect('ipfs://' + subgraph0.id).eq(tokenURI) + }) + }) + describe('Legacy subgraph migration', function () { + it('migrates a legacy subgraph', async function () { + const seqID = toBN('2') + await legacyGNSMock.connect(me).createLegacySubgraph(seqID, newSubgraph0.subgraphDeploymentID) + const tx = legacyGNSMock + .connect(me) + .migrateLegacySubgraph(me.address, seqID, newSubgraph0.subgraphMetadata) + await expect(tx).emit(legacyGNSMock, ' LegacySubgraphClaimed').withArgs(me.address, seqID) + const expectedSubgraphID = buildLegacySubgraphId(me.address, seqID) + const migratedSubgraphDeploymentID = await legacyGNSMock.getSubgraphDeploymentID( + expectedSubgraphID, + ) + const migratedNSignal = await legacyGNSMock.getSubgraphNSignal(expectedSubgraphID) + expect(migratedSubgraphDeploymentID).eq(newSubgraph0.subgraphDeploymentID) + expect(migratedNSignal).eq(toBN('1000')) + + const subgraphNFTAddress = await legacyGNSMock.subgraphNFT() + const subgraphNFT = loadContractAt('SubgraphNFT', subgraphNFTAddress) + const tokenURI = await subgraphNFT.connect(me).tokenURI(expectedSubgraphID) + + const sub = new SubgraphDeploymentID(newSubgraph0.subgraphMetadata) + expect(sub.ipfsHash).eq(tokenURI) + }) + it('refuses to migrate an already migrated subgraph', async function () { + const seqID = toBN('2') + await legacyGNSMock.connect(me).createLegacySubgraph(seqID, newSubgraph0.subgraphDeploymentID) + let tx = legacyGNSMock + .connect(me) + .migrateLegacySubgraph(me.address, seqID, newSubgraph0.subgraphMetadata) + await expect(tx).emit(legacyGNSMock, ' LegacySubgraphClaimed').withArgs(me.address, seqID) + tx = legacyGNSMock + .connect(me) + .migrateLegacySubgraph(me.address, seqID, newSubgraph0.subgraphMetadata) + await expect(tx).revertedWith('GNS: Subgraph was already claimed') + }) + }) + describe('Legacy subgraph view functions', function () { + it('isLegacySubgraph returns whether a subgraph is legacy or not', async function () { + const seqID = toBN('2') + const subgraphId = buildLegacySubgraphId(me.address, seqID) + await legacyGNSMock.connect(me).createLegacySubgraph(seqID, newSubgraph0.subgraphDeploymentID) + await legacyGNSMock + .connect(me) + .migrateLegacySubgraph(me.address, seqID, newSubgraph0.subgraphMetadata) + + expect(await legacyGNSMock.isLegacySubgraph(subgraphId)).eq(true) + + const subgraph0 = await publishNewSubgraph(me, newSubgraph0, legacyGNSMock, graph.chainId) + expect(await legacyGNSMock.isLegacySubgraph(subgraph0.id)).eq(false) + }) + it('getLegacySubgraphKey returns the account and seqID for a legacy subgraph', async function () { + const seqID = toBN('2') + const subgraphId = buildLegacySubgraphId(me.address, seqID) + await legacyGNSMock.connect(me).createLegacySubgraph(seqID, newSubgraph0.subgraphDeploymentID) + await legacyGNSMock + .connect(me) + .migrateLegacySubgraph(me.address, seqID, newSubgraph0.subgraphMetadata) + const [account, id] = await legacyGNSMock.getLegacySubgraphKey(subgraphId) + expect(account).eq(me.address) + expect(id).eq(seqID) + }) + it('getLegacySubgraphKey returns zero values for a non-legacy subgraph', async function () { + const subgraph0 = await publishNewSubgraph(me, newSubgraph0, legacyGNSMock, graph.chainId) + const [account, id] = await legacyGNSMock.getLegacySubgraphKey(subgraph0.id) + expect(account).eq(AddressZero) + expect(id).eq(toBN('0')) + }) + }) + describe('Subgraph transfer to L2', function () { + const publishAndCurateOnSubgraph = async function (): Promise { + // Publish a named subgraph-0 -> subgraphDeployment0 + const subgraph0 = await publishNewSubgraph(me, newSubgraph0, gns, graph.chainId) + // Curate on the subgraph + await gns.connect(me).mintSignal(subgraph0.id, toGRT('90000'), 0) + // Add an additional curator that is not the owner + await gns.connect(other).mintSignal(subgraph0.id, toGRT('10000'), 0) + return subgraph0 + } + + const publishCurateAndSendSubgraph = async function ( + beforeTransferCallback?: (subgraphID: string) => Promise, + ): Promise { + const subgraph0 = await publishAndCurateOnSubgraph() + + if (beforeTransferCallback != null) { + await beforeTransferCallback(subgraph0.id) + } + + const maxSubmissionCost = toBN('100') + const maxGas = toBN('10') + const gasPriceBid = toBN('20') + + const subgraphBefore = await gns.subgraphs(subgraph0.id) + const curatedTokens = await gns.subgraphTokens(subgraph0.id) + const beforeOwnerSignal = await gns.getCuratorSignal(subgraph0.id, me.address) + const expectedSentToL2 = beforeOwnerSignal.mul(curatedTokens).div(subgraphBefore.nSignal) + + const tx = gns + .connect(me) + .sendSubgraphToL2(subgraph0.id, me.address, maxGas, gasPriceBid, maxSubmissionCost, { + value: maxSubmissionCost.add(maxGas.mul(gasPriceBid)), + }) + + await expect(tx) + .emit(gns, 'SubgraphSentToL2') + .withArgs(subgraph0.id, me.address, me.address, expectedSentToL2) + return subgraph0 + } + const publishAndCurateOnLegacySubgraph = async function (seqID: BigNumber): Promise { + await legacyGNSMock.connect(me).createLegacySubgraph(seqID, newSubgraph0.subgraphDeploymentID) + // The legacy subgraph must be claimed + const migrateTx = legacyGNSMock + .connect(me) + .migrateLegacySubgraph(me.address, seqID, newSubgraph0.subgraphMetadata) + await expect(migrateTx) + .emit(legacyGNSMock, ' LegacySubgraphClaimed') + .withArgs(me.address, seqID) + const subgraphID = buildLegacySubgraphId(me.address, seqID) + + // Curate on the subgraph + await legacyGNSMock.connect(me).mintSignal(subgraphID, toGRT('10000'), 0) + + return subgraphID + } + + describe('sendSubgraphToL2', function () { + it('sends tokens and calldata to L2 through the GRT bridge, for a desired L2 owner', async function () { + const subgraph0 = await publishAndCurateOnSubgraph() + + const curatedTokens = await grt.balanceOf(curation.address) + const subgraphBefore = await gns.subgraphs(subgraph0.id) + + const beforeOwnerSignal = await gns.getCuratorSignal(subgraph0.id, me.address) + + const maxSubmissionCost = toBN('100') + const maxGas = toBN('10') + const gasPriceBid = toBN('20') + const tx = gns + .connect(me) + .sendSubgraphToL2(subgraph0.id, other.address, maxGas, gasPriceBid, maxSubmissionCost, { + value: maxSubmissionCost.add(maxGas.mul(gasPriceBid)), + }) + const expectedSentToL2 = beforeOwnerSignal.mul(curatedTokens).div(subgraphBefore.nSignal) + await expect(tx) + .emit(gns, 'SubgraphSentToL2') + .withArgs(subgraph0.id, me.address, other.address, expectedSentToL2) + + const expectedRemainingTokens = curatedTokens.sub(expectedSentToL2) + const subgraphAfter = await gns.subgraphs(subgraph0.id) + expect(subgraphAfter.vSignal).eq(0) + expect(await grt.balanceOf(gns.address)).eq(expectedRemainingTokens) + expect(subgraphAfter.disabled).eq(true) + expect(subgraphAfter.withdrawableGRT).eq(expectedRemainingTokens) + + const transferred = await gns.subgraphTransferredToL2(subgraph0.id) + expect(transferred).eq(true) + + const expectedCallhookData = defaultAbiCoder.encode( + ['uint8', 'uint256', 'address'], + [toBN(0), subgraph0.id, other.address], // code = 0 means RECEIVE_SUBGRAPH_CODE + ) + const expectedL2Data = await l1GraphTokenGateway.getOutboundCalldata( + grt.address, + gns.address, + l2GNSMock.address, + expectedSentToL2, + expectedCallhookData, + ) + await expect(tx) + .emit(l1GraphTokenGateway, 'TxToL2') + .withArgs(gns.address, l2GRTGatewayMock.address, toBN(1), expectedL2Data) + }) + it('sends tokens and calldata for a legacy subgraph to L2 through the GRT bridge', async function () { + const seqID = toBN('2') + const subgraphID = await publishAndCurateOnLegacySubgraph(seqID) + + const subgraphBefore = await legacyGNSMock.legacySubgraphData(me.address, seqID) + const curatedTokens = await legacyGNSMock.subgraphTokens(subgraphID) + const beforeOwnerSignal = await legacyGNSMock.getCuratorSignal(subgraphID, me.address) + const expectedSentToL2 = beforeOwnerSignal.mul(curatedTokens).div(subgraphBefore.nSignal) + + const maxSubmissionCost = toBN('100') + const maxGas = toBN('10') + const gasPriceBid = toBN('20') + const tx = legacyGNSMock + .connect(me) + .sendSubgraphToL2(subgraphID, other.address, maxGas, gasPriceBid, maxSubmissionCost, { + value: maxSubmissionCost.add(maxGas.mul(gasPriceBid)), + }) + await expect(tx) + .emit(legacyGNSMock, 'SubgraphSentToL2') + .withArgs(subgraphID, me.address, other.address, expectedSentToL2) + + const expectedRemainingTokens = curatedTokens.sub(expectedSentToL2) + const subgraphAfter = await legacyGNSMock.legacySubgraphData(me.address, seqID) + expect(subgraphAfter.vSignal).eq(0) + expect(await grt.balanceOf(legacyGNSMock.address)).eq(expectedRemainingTokens) + expect(subgraphAfter.disabled).eq(true) + expect(subgraphAfter.withdrawableGRT).eq(expectedRemainingTokens) + + const transferred = await legacyGNSMock.subgraphTransferredToL2(subgraphID) + expect(transferred).eq(true) + + const expectedCallhookData = defaultAbiCoder.encode( + ['uint8', 'uint256', 'address'], + [toBN(0), subgraphID, other.address], // code = 0 means RECEIVE_SUBGRAPH_CODE + ) + + const expectedL2Data = await l1GraphTokenGateway.getOutboundCalldata( + grt.address, + legacyGNSMock.address, + l2GNSMock.address, + expectedSentToL2, + expectedCallhookData, + ) + await expect(tx) + .emit(l1GraphTokenGateway, 'TxToL2') + .withArgs(legacyGNSMock.address, l2GRTGatewayMock.address, toBN(1), expectedL2Data) + }) + it('rejects calls from someone who is not the subgraph owner', async function () { + const subgraph0 = await publishAndCurateOnSubgraph() + + const maxSubmissionCost = toBN('100') + const maxGas = toBN('10') + const gasPriceBid = toBN('20') + const tx = gns + .connect(other) + .sendSubgraphToL2(subgraph0.id, other.address, maxGas, gasPriceBid, maxSubmissionCost, { + value: maxSubmissionCost.add(maxGas.mul(gasPriceBid)), + }) + await expect(tx).revertedWith('GNS: Must be authorized') + }) + it('rejects calls for a subgraph that was already sent', async function () { + const subgraph0 = await publishAndCurateOnSubgraph() + + const subgraphBefore = await gns.subgraphs(subgraph0.id) + const curatedTokens = await gns.subgraphTokens(subgraph0.id) + const beforeOwnerSignal = await gns.getCuratorSignal(subgraph0.id, me.address) + const expectedSentToL2 = beforeOwnerSignal.mul(curatedTokens).div(subgraphBefore.nSignal) + + const maxSubmissionCost = toBN('100') + const maxGas = toBN('10') + const gasPriceBid = toBN('20') + const tx = gns + .connect(me) + .sendSubgraphToL2(subgraph0.id, me.address, maxGas, gasPriceBid, maxSubmissionCost, { + value: maxSubmissionCost.add(maxGas.mul(gasPriceBid)), + }) + await expect(tx) + .emit(gns, 'SubgraphSentToL2') + .withArgs(subgraph0.id, me.address, me.address, expectedSentToL2) + + const tx2 = gns + .connect(me) + .sendSubgraphToL2(subgraph0.id, me.address, maxGas, gasPriceBid, maxSubmissionCost, { + value: maxSubmissionCost.add(maxGas.mul(gasPriceBid)), + }) + await expect(tx2).revertedWith('ALREADY_DONE') + }) + it('rejects a call for a subgraph that is deprecated', async function () { + const subgraph0 = await publishAndCurateOnSubgraph() + + await gns.connect(me).deprecateSubgraph(subgraph0.id) + + const maxSubmissionCost = toBN('100') + const maxGas = toBN('10') + const gasPriceBid = toBN('20') + const tx = gns + .connect(me) + .sendSubgraphToL2(subgraph0.id, me.address, maxGas, gasPriceBid, maxSubmissionCost, { + value: maxSubmissionCost.add(maxGas.mul(gasPriceBid)), + }) + + await expect(tx).revertedWith('GNS: Must be active') + }) + it('rejects a call for a subgraph that does not exist', async function () { + const subgraphId = await buildSubgraphId(me.address, toBN(100), graph.chainId) + + const maxSubmissionCost = toBN('100') + const maxGas = toBN('10') + const gasPriceBid = toBN('20') + const tx = gns + .connect(me) + .sendSubgraphToL2(subgraphId, me.address, maxGas, gasPriceBid, maxSubmissionCost, { + value: maxSubmissionCost.add(maxGas.mul(gasPriceBid)), + }) + + await expect(tx).revertedWith('GNS: Must be active') + }) + it('rejects calls with more ETH than maxSubmissionCost + maxGas * gasPriceBid', async function () { + const subgraph0 = await publishAndCurateOnSubgraph() + + const maxSubmissionCost = toBN('100') + const maxGas = toBN('10') + const gasPriceBid = toBN('20') + const tx = gns + .connect(me) + .sendSubgraphToL2(subgraph0.id, me.address, maxGas, gasPriceBid, maxSubmissionCost, { + value: maxSubmissionCost.add(maxGas.mul(gasPriceBid)).add(toBN('1')), + }) + await expect(tx).revertedWith('INVALID_ETH_VALUE') + }) + it('does not allow curators to burn signal after sending', async function () { + const subgraph0 = await publishAndCurateOnSubgraph() + + const subgraphBefore = await gns.subgraphs(subgraph0.id) + const curatedTokens = await gns.subgraphTokens(subgraph0.id) + const beforeOwnerSignal = await gns.getCuratorSignal(subgraph0.id, me.address) + const expectedSentToL2 = beforeOwnerSignal.mul(curatedTokens).div(subgraphBefore.nSignal) + + const maxSubmissionCost = toBN('100') + const maxGas = toBN('10') + const gasPriceBid = toBN('20') + const tx = gns + .connect(me) + .sendSubgraphToL2(subgraph0.id, me.address, maxGas, gasPriceBid, maxSubmissionCost, { + value: maxSubmissionCost.add(maxGas.mul(gasPriceBid)), + }) + await expect(tx) + .emit(gns, 'SubgraphSentToL2') + .withArgs(subgraph0.id, me.address, me.address, expectedSentToL2) + + const tx2 = gns.connect(me).burnSignal(subgraph0.id, toBN(1), toGRT('0')) + await expect(tx2).revertedWith('GNS: Must be active') + const tx3 = gns.connect(other).burnSignal(subgraph0.id, toBN(1), toGRT('0')) + await expect(tx3).revertedWith('GNS: Must be active') + }) + it('does not allow curators to transfer signal after sending', async function () { + const subgraph0 = await publishAndCurateOnSubgraph() + + const subgraphBefore = await gns.subgraphs(subgraph0.id) + const curatedTokens = await gns.subgraphTokens(subgraph0.id) + const beforeOwnerSignal = await gns.getCuratorSignal(subgraph0.id, me.address) + const expectedSentToL2 = beforeOwnerSignal.mul(curatedTokens).div(subgraphBefore.nSignal) + + const maxSubmissionCost = toBN('100') + const maxGas = toBN('10') + const gasPriceBid = toBN('20') + const tx = gns + .connect(me) + .sendSubgraphToL2(subgraph0.id, me.address, maxGas, gasPriceBid, maxSubmissionCost, { + value: maxSubmissionCost.add(maxGas.mul(gasPriceBid)), + }) + await expect(tx) + .emit(gns, 'SubgraphSentToL2') + .withArgs(subgraph0.id, me.address, me.address, expectedSentToL2) + + const tx2 = gns.connect(me).transferSignal(subgraph0.id, other.address, toBN(1)) + await expect(tx2).revertedWith('GNS: Must be active') + const tx3 = gns.connect(other).transferSignal(subgraph0.id, me.address, toBN(1)) + await expect(tx3).revertedWith('GNS: Must be active') + }) + it('does not allow the owner to withdraw GRT after sending', async function () { + const subgraph0 = await publishAndCurateOnSubgraph() + + const subgraphBefore = await gns.subgraphs(subgraph0.id) + const curatedTokens = await gns.subgraphTokens(subgraph0.id) + const beforeOwnerSignal = await gns.getCuratorSignal(subgraph0.id, me.address) + const expectedSentToL2 = beforeOwnerSignal.mul(curatedTokens).div(subgraphBefore.nSignal) + + const maxSubmissionCost = toBN('100') + const maxGas = toBN('10') + const gasPriceBid = toBN('20') + const tx = gns + .connect(me) + .sendSubgraphToL2(subgraph0.id, me.address, maxGas, gasPriceBid, maxSubmissionCost, { + value: maxSubmissionCost.add(maxGas.mul(gasPriceBid)), + }) + await expect(tx) + .emit(gns, 'SubgraphSentToL2') + .withArgs(subgraph0.id, me.address, me.address, expectedSentToL2) + + const tx2 = gns.connect(me).withdraw(subgraph0.id) + await expect(tx2).revertedWith('GNS: No signal to withdraw GRT') + }) + it('allows a curator that is not the owner to withdraw GRT after sending', async function () { + const subgraph0 = await publishAndCurateOnSubgraph() + + const subgraphBefore = await gns.subgraphs(subgraph0.id) + const curatedTokens = await gns.subgraphTokens(subgraph0.id) + const beforeOwnerSignal = await gns.getCuratorSignal(subgraph0.id, me.address) + const expectedSentToL2 = beforeOwnerSignal.mul(curatedTokens).div(subgraphBefore.nSignal) + const beforeOtherSignal = await gns.getCuratorSignal(subgraph0.id, other.address) + + const maxSubmissionCost = toBN('100') + const maxGas = toBN('10') + const gasPriceBid = toBN('20') + const tx = gns + .connect(me) + .sendSubgraphToL2(subgraph0.id, me.address, maxGas, gasPriceBid, maxSubmissionCost, { + value: maxSubmissionCost.add(maxGas.mul(gasPriceBid)), + }) + await expect(tx) + .emit(gns, 'SubgraphSentToL2') + .withArgs(subgraph0.id, me.address, me.address, expectedSentToL2) + + const remainingTokens = (await gns.subgraphs(subgraph0.id)).withdrawableGRT + const tx2 = gns.connect(other).withdraw(subgraph0.id) + await expect(tx2) + .emit(gns, 'GRTWithdrawn') + .withArgs(subgraph0.id, other.address, beforeOtherSignal, remainingTokens) + }) + }) + describe('sendCuratorBalanceToBeneficiaryOnL2', function () { + it('sends a transaction with a curator balance to the L2GNS using the L1 gateway', async function () { + const subgraph0 = await publishCurateAndSendSubgraph() + const afterSubgraph = await gns.subgraphs(subgraph0.id) + const curatorTokens = afterSubgraph.withdrawableGRT + + const expectedCallhookData = defaultAbiCoder.encode( + ['uint8', 'uint256', 'address'], + [toBN(1), subgraph0.id, another.address], // code = 1 means RECEIVE_CURATOR_BALANCE_CODE + ) + const expectedL2Data = await l1GraphTokenGateway.getOutboundCalldata( + grt.address, + gns.address, + l2GNSMock.address, + curatorTokens, + expectedCallhookData, + ) + + const maxSubmissionCost = toBN('100') + const maxGas = toBN('10') + const gasPriceBid = toBN('20') + + const tx = gns + .connect(other) + .sendCuratorBalanceToBeneficiaryOnL2( + subgraph0.id, + another.address, + maxGas, + gasPriceBid, + maxSubmissionCost, + { + value: maxSubmissionCost.add(maxGas.mul(gasPriceBid)), + }, + ) + + // seqNum (third argument in the event) is 2, because number 1 was when the subgraph was sent to L2 + await expect(tx) + .emit(l1GraphTokenGateway, 'TxToL2') + .withArgs(gns.address, l2GRTGatewayMock.address, toBN('2'), expectedL2Data) + await expect(tx) + .emit(gns, 'CuratorBalanceSentToL2') + .withArgs(subgraph0.id, other.address, another.address, curatorTokens) + }) + it('sets the curator signal to zero so it cannot be called twice', async function () { + const subgraph0 = await publishCurateAndSendSubgraph() + const afterSubgraph = await gns.subgraphs(subgraph0.id) + const curatorTokens = afterSubgraph.withdrawableGRT + + const expectedCallhookData = defaultAbiCoder.encode( + ['uint8', 'uint256', 'address'], + [toBN(1), subgraph0.id, other.address], // code = 1 means RECEIVE_CURATOR_BALANCE_CODE + ) + const expectedL2Data = await l1GraphTokenGateway.getOutboundCalldata( + grt.address, + gns.address, + l2GNSMock.address, + curatorTokens, + expectedCallhookData, + ) + + const maxSubmissionCost = toBN('100') + const maxGas = toBN('10') + const gasPriceBid = toBN('20') + + const tx = gns + .connect(other) + .sendCuratorBalanceToBeneficiaryOnL2( + subgraph0.id, + other.address, + maxGas, + gasPriceBid, + maxSubmissionCost, + { + value: maxSubmissionCost.add(maxGas.mul(gasPriceBid)), + }, + ) + + // seqNum (third argument in the event) is 2, because number 1 was when the subgraph was sent to L2 + await expect(tx) + .emit(l1GraphTokenGateway, 'TxToL2') + .withArgs(gns.address, l2GRTGatewayMock.address, toBN('2'), expectedL2Data) + + const tx2 = gns + .connect(other) + .sendCuratorBalanceToBeneficiaryOnL2( + subgraph0.id, + other.address, + maxGas, + gasPriceBid, + maxSubmissionCost, + { + value: maxSubmissionCost.add(maxGas.mul(gasPriceBid)), + }, + ) + await expect(tx2).revertedWith('NO_SIGNAL') + }) + it('sets the curator signal to zero so they cannot withdraw', async function () { + const subgraph0 = await publishCurateAndSendSubgraph(async (_subgraphId) => { + // We add another curator before transferring, so the the subgraph doesn't + // run out of withdrawable GRT and we can test that it denies the specific curator + // because they have sent their signal to L2, not because the subgraph is out of GRT. + await gns.connect(another).mintSignal(_subgraphId, toGRT('1000'), toBN(0)) + }) + + const maxSubmissionCost = toBN('100') + const maxGas = toBN('10') + const gasPriceBid = toBN('20') + + await gns + .connect(other) + .sendCuratorBalanceToBeneficiaryOnL2( + subgraph0.id, + other.address, + maxGas, + gasPriceBid, + maxSubmissionCost, + { + value: maxSubmissionCost.add(maxGas.mul(gasPriceBid)), + }, + ) + + const tx = gns.connect(other).withdraw(subgraph0.id) + await expect(tx).revertedWith('GNS: No signal to withdraw GRT') + }) + it('gives each curator an amount of tokens proportional to their nSignal', async function () { + let beforeOtherNSignal: BigNumber + let beforeAnotherNSignal: BigNumber + const subgraph0 = await publishCurateAndSendSubgraph(async (subgraphID) => { + beforeOtherNSignal = await gns.getCuratorSignal(subgraphID, other.address) + await gns.connect(another).mintSignal(subgraphID, toGRT('10000'), 0) + beforeAnotherNSignal = await gns.getCuratorSignal(subgraphID, another.address) + }) + const afterSubgraph = await gns.subgraphs(subgraph0.id) + + // Compute how much is owed to each curator + const curator1Tokens = beforeOtherNSignal + .mul(afterSubgraph.withdrawableGRT) + .div(afterSubgraph.nSignal) + const curator2Tokens = beforeAnotherNSignal + .mul(afterSubgraph.withdrawableGRT) + .div(afterSubgraph.nSignal) + + const expectedCallhookData1 = defaultAbiCoder.encode( + ['uint8', 'uint256', 'address'], + [toBN(1), subgraph0.id, other.address], // code = 1 means RECEIVE_CURATOR_BALANCE_CODE + ) + const expectedCallhookData2 = defaultAbiCoder.encode( + ['uint8', 'uint256', 'address'], + [toBN(1), subgraph0.id, another.address], // code = 1 means RECEIVE_CURATOR_BALANCE_CODE + ) + const expectedL2Data1 = await l1GraphTokenGateway.getOutboundCalldata( + grt.address, + gns.address, + l2GNSMock.address, + curator1Tokens, + expectedCallhookData1, + ) + + const maxSubmissionCost = toBN('100') + const maxGas = toBN('10') + const gasPriceBid = toBN('20') + + const tx = gns + .connect(other) + .sendCuratorBalanceToBeneficiaryOnL2( + subgraph0.id, + other.address, + maxGas, + gasPriceBid, + maxSubmissionCost, + { + value: maxSubmissionCost.add(maxGas.mul(gasPriceBid)), + }, + ) + + // seqNum (third argument in the event) is 2, because number 1 was when the subgraph was sent to L2 + await expect(tx) + .emit(l1GraphTokenGateway, 'TxToL2') + .withArgs(gns.address, l2GRTGatewayMock.address, toBN('2'), expectedL2Data1) + + // Accept slight numerical errors given how we compute the amount of tokens to send + const curator2TokensUpdated = (await gns.subgraphs(subgraph0.id)).withdrawableGRT + expect(toRound(toFloat(curator2TokensUpdated))).to.equal(toRound(toFloat(curator2Tokens))) + const expectedL2Data2 = await l1GraphTokenGateway.getOutboundCalldata( + grt.address, + gns.address, + l2GNSMock.address, + curator2TokensUpdated, + expectedCallhookData2, + ) + const tx2 = gns + .connect(another) + .sendCuratorBalanceToBeneficiaryOnL2( + subgraph0.id, + another.address, + maxGas, + gasPriceBid, + maxSubmissionCost, + { + value: maxSubmissionCost.add(maxGas.mul(gasPriceBid)), + }, + ) + // seqNum (third argument in the event) is 3 now + await expect(tx2) + .emit(l1GraphTokenGateway, 'TxToL2') + .withArgs(gns.address, l2GRTGatewayMock.address, toBN('3'), expectedL2Data2) + }) + it('rejects calls for a subgraph that was not sent to L2', async function () { + const subgraph0 = await publishAndCurateOnSubgraph() + + const maxSubmissionCost = toBN('100') + const maxGas = toBN('10') + const gasPriceBid = toBN('20') + + const tx = gns + .connect(me) + .sendCuratorBalanceToBeneficiaryOnL2( + subgraph0.id, + other.address, + maxGas, + gasPriceBid, + maxSubmissionCost, + { + value: maxSubmissionCost.add(maxGas.mul(gasPriceBid)), + }, + ) + + await expect(tx).revertedWith('!TRANSFERRED') + }) + + it('rejects calls for a subgraph that was deprecated', async function () { + const subgraph0 = await publishAndCurateOnSubgraph() + + await helpers.mine(256) + await gns.connect(me).deprecateSubgraph(subgraph0.id) + + const maxSubmissionCost = toBN('100') + const maxGas = toBN('10') + const gasPriceBid = toBN('20') + + const tx = gns + .connect(me) + .sendCuratorBalanceToBeneficiaryOnL2( + subgraph0.id, + other.address, + maxGas, + gasPriceBid, + maxSubmissionCost, + { + value: maxSubmissionCost.add(maxGas.mul(gasPriceBid)), + }, + ) + + await expect(tx).revertedWith('!TRANSFERRED') + }) + it('rejects calls with zero maxSubmissionCost', async function () { + const subgraph0 = await publishCurateAndSendSubgraph() + + const maxSubmissionCost = toBN('0') + const maxGas = toBN('10') + const gasPriceBid = toBN('20') + + const tx = gns + .connect(me) + .sendCuratorBalanceToBeneficiaryOnL2( + subgraph0.id, + other.address, + maxGas, + gasPriceBid, + maxSubmissionCost, + { + value: maxSubmissionCost.add(maxGas.mul(gasPriceBid)), + }, + ) + + await expect(tx).revertedWith('NO_SUBMISSION_COST') + }) + it('rejects calls with more ETH than maxSubmissionCost + maxGas * gasPriceBid', async function () { + const subgraph0 = await publishCurateAndSendSubgraph() + + const maxSubmissionCost = toBN('100') + const maxGas = toBN('10') + const gasPriceBid = toBN('20') + + const tx = gns + .connect(me) + .sendCuratorBalanceToBeneficiaryOnL2( + subgraph0.id, + other.address, + maxGas, + gasPriceBid, + maxSubmissionCost, + { + value: maxSubmissionCost.add(maxGas.mul(gasPriceBid)).add(toBN('1')), + }, + ) + + await expect(tx).revertedWith('INVALID_ETH_VALUE') + }) + it('rejects calls if the curator has withdrawn the GRT', async function () { + const subgraph0 = await publishCurateAndSendSubgraph() + + await gns.connect(other).withdraw(subgraph0.id) + + const maxSubmissionCost = toBN('100') + const maxGas = toBN('10') + const gasPriceBid = toBN('20') + + const tx = gns + .connect(other) + .sendCuratorBalanceToBeneficiaryOnL2( + subgraph0.id, + another.address, + maxGas, + gasPriceBid, + maxSubmissionCost, + { + value: maxSubmissionCost.add(maxGas.mul(gasPriceBid)), + }, + ) + + // seqNum (third argument in the event) is 2, because number 1 was when the subgraph was sent to L2 + await expect(tx).revertedWith('NO_SIGNAL') + }) + }) + }) +}) diff --git a/packages/contracts/test/unit/governance/controller.test.ts b/packages/contracts/test/unit/governance/controller.test.ts new file mode 100644 index 000000000..692b1013b --- /dev/null +++ b/packages/contracts/test/unit/governance/controller.test.ts @@ -0,0 +1,145 @@ +import hre from 'hardhat' +import { expect } from 'chai' +import { constants, utils } from 'ethers' + +import { Controller } from '../../../build/types/Controller' +import { EpochManager } from '../../../build/types/EpochManager' + +import { NetworkFixture } from '../lib/fixtures' +import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers' +import { GraphNetworkContracts } from '@graphprotocol/sdk' + +const { AddressZero } = constants + +describe('Managed', () => { + const graph = hre.graph() + let me: SignerWithAddress + let governor: SignerWithAddress + let mockController: SignerWithAddress + let newMockEpochManager: SignerWithAddress + + let fixture: NetworkFixture + + let contracts: GraphNetworkContracts + let epochManager: EpochManager + let controller: Controller + + before(async function () { + [me, mockController, newMockEpochManager] = await graph.getTestAccounts() + ;({ governor } = await graph.getNamedAccounts()) + // We just run the fixures to set up a contract with Managed, as this + // is cleaner and easier for us to test + fixture = new NetworkFixture(graph.provider) + contracts = await fixture.load(governor) + epochManager = contracts.EpochManager as EpochManager + controller = contracts.Controller as Controller + }) + + beforeEach(async function () { + await fixture.setUp() + }) + + afterEach(async function () { + await fixture.tearDown() + }) + + describe('setContractProxy()', function () { + it('should set contract proxy and test get contract proxy', async function () { + // Set right in the constructor + expect(await epochManager.controller()).eq(controller.address) + + // Test the controller + const id = utils.id('EpochManager') + const tx = controller.connect(governor).setContractProxy(id, newMockEpochManager.address) + await expect(tx) + .emit(controller, 'SetContractProxy') + .withArgs(id, newMockEpochManager.address) + expect(await controller.getContractProxy(id)).eq(newMockEpochManager.address) + }) + + it('reject set contract proxy to address zero', async function () { + const id = utils.id('EpochManager') + const tx = controller.connect(governor).setContractProxy(id, AddressZero) + await expect(tx).revertedWith('Contract address must be set') + }) + + it('reject set contract proxy if not governor', async function () { + const id = utils.id('EpochManager') + const tx = controller.connect(me).setContractProxy(id, newMockEpochManager.address) + await expect(tx).revertedWith('Only Governor can call') + }) + }) + + describe('unsetContractProxy()', function () { + it('should unset contract proxy', async function () { + // Set contract + const id = utils.id('EpochManager') + await controller.connect(governor).setContractProxy(id, newMockEpochManager.address) + expect(await controller.getContractProxy(id)).eq(newMockEpochManager.address) + + // Unset contract + const tx = controller.connect(governor).unsetContractProxy(id) + await expect(tx).emit(controller, 'SetContractProxy').withArgs(id, AddressZero) + expect(await controller.getContractProxy(id)).eq(AddressZero) + }) + + it('reject to call if not authorized caller', async function () { + // Unset contract + const id = utils.id('EpochManager') + const tx = controller.connect(me).unsetContractProxy(id) + await expect(tx).revertedWith('Only Governor can call') + }) + }) + + describe('updateController()', function () { + it('should update controller on a manager', async function () { + const tx = controller + .connect(governor) + .updateController(utils.id('EpochManager'), mockController.address) + await expect(tx).emit(epochManager, 'SetController').withArgs(mockController.address) + expect(await epochManager.controller()).eq(mockController.address) + }) + + it('should fail updating controller when not called by governor', async function () { + const tx = controller + .connect(me) + .updateController(utils.id('EpochManager'), mockController.address) + await expect(tx).revertedWith('Only Governor can call') + }) + + it('reject update controller to address zero', async function () { + const tx = controller + .connect(governor) + .updateController(utils.id('EpochManager'), AddressZero) + await expect(tx).revertedWith('Controller must be set') + }) + }) + + describe('setController()', function () { + it('should fail setting controller when not called from Controller', async function () { + const tx = epochManager.connect(me).setController(mockController.address) + await expect(tx).revertedWith('Caller must be Controller') + }) + }) + + describe('setPauseGuardian()', function () { + it('should set the pause guardian', async function () { + const tx = controller.connect(governor).setPauseGuardian(me.address) + const currentPauseGuardian = await controller.pauseGuardian() + await expect(tx) + .emit(controller, 'NewPauseGuardian') + .withArgs(currentPauseGuardian, me.address) + expect(await controller.pauseGuardian()).eq(me.address) + }) + + it('reject to call if not authorized caller', async function () { + const tx = controller.connect(me).setPauseGuardian(me.address) + await expect(tx).revertedWith('Only Governor can call') + }) + + it('reject set pause guardian to address zero', async function () { + const tx = controller.connect(governor).setPauseGuardian(AddressZero) + await expect(tx).revertedWith('PauseGuardian must be set') + }) + }) +}) diff --git a/packages/contracts/test/unit/governance/governed.test.ts b/packages/contracts/test/unit/governance/governed.test.ts new file mode 100644 index 000000000..fb94b343a --- /dev/null +++ b/packages/contracts/test/unit/governance/governed.test.ts @@ -0,0 +1,47 @@ +import { expect } from 'chai' +import hre from 'hardhat' +import '@nomiclabs/hardhat-ethers' + +import { Governed } from '../../../build/types/Governed' +import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers' + +const { ethers } = hre +const { AddressZero } = ethers.constants + +describe('Governed', () => { + const graph = hre.graph() + let me: SignerWithAddress + let governor: SignerWithAddress + + let governed: Governed + + beforeEach(async function () { + [me, governor] = await graph.getTestAccounts() + + const factory = await ethers.getContractFactory('GovernedMock') + governed = (await factory.connect(governor).deploy()) as Governed + }) + + it('should reject transfer if not allowed', async function () { + const tx = governed.connect(me).transferOwnership(me.address) + await expect(tx).revertedWith('Only Governor can call') + }) + + it('should transfer and accept', async function () { + // Transfer ownership + const tx1 = governed.connect(governor).transferOwnership(me.address) + await expect(tx1).emit(governed, 'NewPendingOwnership').withArgs(AddressZero, me.address) + + // Reject accept if not the pending governor + await expect(governed.connect(governor).acceptOwnership()).revertedWith( + 'Caller must be pending governor', + ) + + // Accept ownership + const tx2 = governed.connect(me).acceptOwnership() + await expect(tx2).emit(governed, 'NewOwnership').withArgs(governor.address, me.address) + + // Clean pending governor + expect(await governed.pendingGovernor()).eq(AddressZero) + }) +}) diff --git a/packages/contracts/test/unit/governance/pausing.test.ts b/packages/contracts/test/unit/governance/pausing.test.ts new file mode 100644 index 000000000..a604f899b --- /dev/null +++ b/packages/contracts/test/unit/governance/pausing.test.ts @@ -0,0 +1,113 @@ +import hre from 'hardhat' +import { expect } from 'chai' + +import { Controller } from '../../../build/types/Controller' +import { IStaking } from '../../../build/types/IStaking' + +import { NetworkFixture } from '../lib/fixtures' +import { GraphNetworkContracts, toGRT } from '@graphprotocol/sdk' +import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers' + +describe('Pausing', () => { + const graph = hre.graph() + let me: SignerWithAddress + let governor: SignerWithAddress + let guardian: SignerWithAddress + + let fixture: NetworkFixture + + let contracts: GraphNetworkContracts + let staking: IStaking + let controller: Controller + + const setPartialPause = async (account: SignerWithAddress, setValue: boolean) => { + const tx = controller.connect(account).setPartialPaused(setValue) + await expect(tx).emit(controller, 'PartialPauseChanged').withArgs(setValue) + expect(await controller.partialPaused()).eq(setValue) + } + const setPause = async (account: SignerWithAddress, setValue: boolean) => { + const tx = controller.connect(account).setPaused(setValue) + await expect(tx).emit(controller, 'PauseChanged').withArgs(setValue) + expect(await controller.paused()).eq(setValue) + } + before(async function () { + [me] = await graph.getTestAccounts() + ;({ governor, pauseGuardian: guardian } = await graph.getNamedAccounts()) + fixture = new NetworkFixture(graph.provider) + contracts = await fixture.load(governor) + staking = contracts.Staking as IStaking + controller = contracts.Controller as Controller + }) + + beforeEach(async function () { + await fixture.setUp() + }) + + afterEach(async function () { + await fixture.tearDown() + }) + it('should set pause guardian', async function () { + const currentGuardian = await controller.pauseGuardian() + expect(await controller.pauseGuardian()).eq(currentGuardian) + const tx = controller.connect(governor).setPauseGuardian(guardian.address) + await expect(tx) + .emit(controller, 'NewPauseGuardian') + .withArgs(currentGuardian, guardian.address) + expect(await controller.pauseGuardian()).eq(guardian.address) + }) + it('should fail pause guardian when not governor', async function () { + const tx = controller.connect(me).setPauseGuardian(guardian.address) + await expect(tx).revertedWith('Only Governor can call') + }) + it('should set partialPaused and unset from governor and guardian', async function () { + expect(await controller.partialPaused()).eq(false) + // Governor set + await setPartialPause(governor, true) + // Governor unset + await setPartialPause(governor, false) + + await controller.connect(governor).setPauseGuardian(guardian.address) + // Guardian set + await setPartialPause(guardian, true) + // Guardian unset + await setPartialPause(guardian, false) + }) + it('should fail partial pause if not guardian or governor', async function () { + const tx = controller.connect(me).setPartialPaused(true) + await expect(tx).revertedWith('Only Governor or Guardian can call') + }) + it('should check that a function fails when partialPause is set', async function () { + await setPartialPause(governor, true) + + const tokensToStake = toGRT('100') + const tx = staking.connect(me).stake(tokensToStake) + await expect(tx).revertedWith('Partial-paused') + }) + it('should set pause and unset from governor and guardian', async function () { + expect(await controller.paused()).eq(false) + // Governor set + await setPause(governor, true) + // Governor unset + await setPause(governor, false) + + await controller.connect(governor).setPauseGuardian(guardian.address) + // Guardian set + await setPause(guardian, true) + // Guardian unset + await setPause(guardian, false) + }) + it('should fail pause if not guardian or governor', async function () { + const tx = controller.connect(me).setPaused(true) + await expect(tx).revertedWith('Only Governor or Guardian can call') + }) + it('should check that a function fails when pause is set', async function () { + await setPause(governor, true) + + const tokensToStake = toGRT('100') + const tx1 = staking.connect(me).stake(tokensToStake) + await expect(tx1).revertedWith('Paused') + + const tx2 = staking.connect(me).withdraw() + await expect(tx2).revertedWith('Paused') + }) +}) diff --git a/packages/contracts/test/unit/graphToken.test.ts b/packages/contracts/test/unit/graphToken.test.ts new file mode 100644 index 000000000..b42274ac4 --- /dev/null +++ b/packages/contracts/test/unit/graphToken.test.ts @@ -0,0 +1,5 @@ +import { grtTests } from './lib/graphTokenTests' + +describe('GraphToken', () => { + grtTests.bind(this)(false) +}) diff --git a/packages/contracts/test/unit/l2/l2Curation.test.ts b/packages/contracts/test/unit/l2/l2Curation.test.ts new file mode 100644 index 000000000..1e056f6a1 --- /dev/null +++ b/packages/contracts/test/unit/l2/l2Curation.test.ts @@ -0,0 +1,845 @@ +import hre from 'hardhat' +import { expect } from 'chai' +import { BigNumber, constants, Event, Signer, utils } from 'ethers' + +import { L2Curation } from '../../../build/types/L2Curation' +import { GraphToken } from '../../../build/types/GraphToken' +import { Controller } from '../../../build/types/Controller' + +import { NetworkFixture } from '../lib/fixtures' +import { GNS } from '../../../build/types/GNS' +import { parseEther } from 'ethers/lib/utils' +import { + formatGRT, + GraphNetworkContracts, + helpers, + randomAddress, + randomHexBytes, + toBN, + toGRT, +} from '@graphprotocol/sdk' +import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers' + +const { AddressZero } = constants + +const MAX_PPM = 1000000 + +const chunkify = (total: BigNumber, maxChunks = 10): Array => { + const chunks: BigNumber[] = [] + while (total.gt(0) && maxChunks > 0) { + const m = 1000000 + const p = Math.floor(Math.random() * m) + const n = total.mul(p).div(m) + chunks.push(n) + total = total.sub(n) + maxChunks-- + } + if (total.gt(0)) { + chunks.push(total) + } + return chunks +} + +const toFloat = (n: BigNumber) => parseFloat(formatGRT(n)) +const toRound = (n: number) => n.toPrecision(11) + +describe('L2Curation:Config', () => { + const graph = hre.graph() + const defaults = graph.graphConfig.defaults + let me: SignerWithAddress + let governor: SignerWithAddress + + let fixture: NetworkFixture + + let contracts: GraphNetworkContracts + let curation: L2Curation + + before(async function () { + [me] = await graph.getTestAccounts() + ;({ governor } = await graph.getNamedAccounts()) + + fixture = new NetworkFixture(graph.provider) + contracts = await fixture.load(governor, true) + curation = contracts.L2Curation as L2Curation + }) + + beforeEach(async function () { + await fixture.setUp() + }) + + afterEach(async function () { + await fixture.tearDown() + }) + + describe('defaultReserveRatio', function () { + it('should be fixed to MAX_PPM', async function () { + // Set right in the constructor + expect(await curation.connect(me).defaultReserveRatio()).eq(MAX_PPM) + }) + it('cannot be changed because the setter is not implemented', async function () { + const tx = curation.connect(governor).setDefaultReserveRatio(10) + await expect(tx).revertedWith('Not implemented in L2') + }) + }) + + describe('minimumCurationDeposit', function () { + it('should set `minimumCurationDeposit`', async function () { + // Set right in the constructor + expect(await curation.minimumCurationDeposit()).eq(defaults.curation.l2MinimumCurationDeposit) + + // Can set if allowed + const newValue = toBN('100') + await curation.connect(governor).setMinimumCurationDeposit(newValue) + expect(await curation.minimumCurationDeposit()).eq(newValue) + }) + + it('reject set `minimumCurationDeposit` if out of bounds', async function () { + const tx = curation.connect(governor).setMinimumCurationDeposit(0) + await expect(tx).revertedWith('Minimum curation deposit cannot be 0') + }) + + it('reject set `minimumCurationDeposit` if not allowed', async function () { + const tx = curation + .connect(me) + .setMinimumCurationDeposit(defaults.curation.minimumCurationDeposit) + await expect(tx).revertedWith('Only Controller governor') + }) + }) + + describe('curationTaxPercentage', function () { + it('should set `curationTaxPercentage`', async function () { + const curationTaxPercentage = defaults.curation.curationTaxPercentage + + // Set new value + await curation.connect(governor).setCurationTaxPercentage(0) + await curation.connect(governor).setCurationTaxPercentage(curationTaxPercentage) + }) + + it('reject set `curationTaxPercentage` if out of bounds', async function () { + const tx = curation.connect(governor).setCurationTaxPercentage(MAX_PPM + 1) + await expect(tx).revertedWith('Curation tax percentage must be below or equal to MAX_PPM') + }) + + it('reject set `curationTaxPercentage` if not allowed', async function () { + const tx = curation.connect(me).setCurationTaxPercentage(0) + await expect(tx).revertedWith('Only Controller governor') + }) + }) + + describe('curationTokenMaster', function () { + it('should set `curationTokenMaster`', async function () { + const newCurationTokenMaster = curation.address + await curation.connect(governor).setCurationTokenMaster(newCurationTokenMaster) + }) + + it('reject set `curationTokenMaster` to empty value', async function () { + const newCurationTokenMaster = AddressZero + const tx = curation.connect(governor).setCurationTokenMaster(newCurationTokenMaster) + await expect(tx).revertedWith('Token master must be non-empty') + }) + + it('reject set `curationTokenMaster` to non-contract', async function () { + const newCurationTokenMaster = randomAddress() + const tx = curation.connect(governor).setCurationTokenMaster(newCurationTokenMaster) + await expect(tx).revertedWith('Token master must be a contract') + }) + + it('reject set `curationTokenMaster` if not allowed', async function () { + const newCurationTokenMaster = curation.address + const tx = curation.connect(me).setCurationTokenMaster(newCurationTokenMaster) + await expect(tx).revertedWith('Only Controller governor') + }) + }) + + describe('subgraphService', function () { + it('should set `subgraphService`', async function () { + const newSubgraphService = randomAddress() + await curation.connect(governor).setSubgraphService(newSubgraphService) + expect(await curation.subgraphService()).eq(newSubgraphService) + }) + + it('reject set `subgraphService` if not allowed', async function () { + const newSubgraphService = randomAddress() + const tx = curation.connect(me).setSubgraphService(newSubgraphService) + await expect(tx).revertedWith('Only Controller governor') + }) + }) +}) + +describe('L2Curation', () => { + const graph = hre.graph() + let me: SignerWithAddress + let governor: SignerWithAddress + let curator: SignerWithAddress + let stakingMock: SignerWithAddress + let subgraphService: SignerWithAddress + let gnsImpersonator: Signer + + let fixture: NetworkFixture + + let contracts: GraphNetworkContracts + let curation: L2Curation + let grt: GraphToken + let controller: Controller + let gns: GNS + + // Test values + const signalAmountFor1000Tokens = toGRT('1000.0') + const signalAmountForMinimumCuration = toBN('1') + const subgraphDeploymentID = randomHexBytes() + const curatorTokens = toGRT('1000000000') + const tokensToDeposit = toGRT('1000') + const tokensToCollect = toGRT('2000') + + async function calcLinearBondingCurve( + supply: BigNumber, + reserveBalance: BigNumber, + depositAmount: BigNumber, + ): Promise { + // Handle the initialization of the bonding curve + if (supply.eq(0)) { + const minDeposit = await curation.minimumCurationDeposit() + if (depositAmount.lt(minDeposit)) { + throw new Error('deposit must be above minimum') + } + const minSupply = signalAmountForMinimumCuration + return ( + (await calcLinearBondingCurve(minSupply, minDeposit, depositAmount.sub(minDeposit))) + + toFloat(minSupply) + ) + } + // Calculate bonding curve in the test + return toFloat(supply) * (toFloat(depositAmount) / toFloat(reserveBalance)) + } + + const shouldMint = async (tokensToDeposit: BigNumber, expectedSignal: BigNumber) => { + // Before state + const beforeTokenTotalSupply = await grt.totalSupply() + const beforeCuratorTokens = await grt.balanceOf(curator.address) + const beforeCuratorSignal = await curation.getCuratorSignal( + curator.address, + subgraphDeploymentID, + ) + const beforePool = await curation.pools(subgraphDeploymentID) + const beforePoolSignal = await curation.getCurationPoolSignal(subgraphDeploymentID) + const beforeTotalTokens = await grt.balanceOf(curation.address) + + // Calculations + const curationTaxPercentage = await curation.curationTaxPercentage() + const curationTax = tokensToDeposit.mul(toBN(curationTaxPercentage)).div(toBN(MAX_PPM)) + + // Curate + const tx = curation.connect(curator).mint(subgraphDeploymentID, tokensToDeposit, 0) + await expect(tx) + .emit(curation, 'Signalled') + .withArgs(curator.address, subgraphDeploymentID, tokensToDeposit, expectedSignal, curationTax) + + // After state + const afterTokenTotalSupply = await grt.totalSupply() + const afterCuratorTokens = await grt.balanceOf(curator.address) + const afterCuratorSignal = await curation.getCuratorSignal( + curator.address, + subgraphDeploymentID, + ) + const afterPool = await curation.pools(subgraphDeploymentID) + const afterPoolSignal = await curation.getCurationPoolSignal(subgraphDeploymentID) + const afterTotalTokens = await grt.balanceOf(curation.address) + + // Curator balance updated + expect(afterCuratorTokens).eq(beforeCuratorTokens.sub(tokensToDeposit)) + expect(afterCuratorSignal).eq(beforeCuratorSignal.add(expectedSignal)) + // Allocated and balance updated + expect(afterPool.tokens).eq(beforePool.tokens.add(tokensToDeposit.sub(curationTax))) + expect(afterPoolSignal).eq(beforePoolSignal.add(expectedSignal)) + // Pool reserveRatio is deprecated and therefore always zero in L2 + expect(afterPool.reserveRatio).eq(0) + // Contract balance updated + expect(afterTotalTokens).eq(beforeTotalTokens.add(tokensToDeposit.sub(curationTax))) + // Total supply is reduced to curation tax burning + expect(afterTokenTotalSupply).eq(beforeTokenTotalSupply.sub(curationTax)) + } + + const shouldMintTaxFree = async (tokensToDeposit: BigNumber, expectedSignal: BigNumber) => { + // Before state + const beforeTokenTotalSupply = await grt.totalSupply() + const beforeCuratorTokens = await grt.balanceOf(gns.address) + const beforeCuratorSignal = await curation.getCuratorSignal(gns.address, subgraphDeploymentID) + const beforePool = await curation.pools(subgraphDeploymentID) + const beforePoolSignal = await curation.getCurationPoolSignal(subgraphDeploymentID) + const beforeTotalTokens = await grt.balanceOf(curation.address) + + // Curate + const tx = curation.connect(gnsImpersonator).mintTaxFree(subgraphDeploymentID, tokensToDeposit) + await expect(tx) + .emit(curation, 'Signalled') + .withArgs(gns.address, subgraphDeploymentID, tokensToDeposit, expectedSignal, 0) + + // After state + const afterTokenTotalSupply = await grt.totalSupply() + const afterCuratorTokens = await grt.balanceOf(gns.address) + const afterCuratorSignal = await curation.getCuratorSignal(gns.address, subgraphDeploymentID) + const afterPool = await curation.pools(subgraphDeploymentID) + const afterPoolSignal = await curation.getCurationPoolSignal(subgraphDeploymentID) + const afterTotalTokens = await grt.balanceOf(curation.address) + + // Curator balance updated + expect(afterCuratorTokens).eq(beforeCuratorTokens.sub(tokensToDeposit)) + expect(afterCuratorSignal).eq(beforeCuratorSignal.add(expectedSignal)) + // Allocated and balance updated + expect(afterPool.tokens).eq(beforePool.tokens.add(tokensToDeposit)) + expect(afterPoolSignal).eq(beforePoolSignal.add(expectedSignal)) + // Pool reserveRatio is deprecated and therefore always zero in L2 + expect(afterPool.reserveRatio).eq(0) + // Contract balance updated + expect(afterTotalTokens).eq(beforeTotalTokens.add(tokensToDeposit)) + // Total supply is reduced to curation tax burning + expect(afterTokenTotalSupply).eq(beforeTokenTotalSupply) + } + + const shouldBurn = async (signalToRedeem: BigNumber, expectedTokens: BigNumber) => { + // Before balances + const beforeTokenTotalSupply = await grt.totalSupply() + const beforeCuratorTokens = await grt.balanceOf(curator.address) + const beforeCuratorSignal = await curation.getCuratorSignal( + curator.address, + subgraphDeploymentID, + ) + const beforePool = await curation.pools(subgraphDeploymentID) + const beforePoolSignal = await curation.getCurationPoolSignal(subgraphDeploymentID) + const beforeTotalTokens = await grt.balanceOf(curation.address) + + // Redeem + const tx = curation.connect(curator).burn(subgraphDeploymentID, signalToRedeem, 0) + await expect(tx) + .emit(curation, 'Burned') + .withArgs(curator.address, subgraphDeploymentID, expectedTokens, signalToRedeem) + + // After balances + const afterTokenTotalSupply = await grt.totalSupply() + const afterCuratorTokens = await grt.balanceOf(curator.address) + const afterCuratorSignal = await curation.getCuratorSignal( + curator.address, + subgraphDeploymentID, + ) + const afterPool = await curation.pools(subgraphDeploymentID) + const afterPoolSignal = await curation.getCurationPoolSignal(subgraphDeploymentID) + const afterTotalTokens = await grt.balanceOf(curation.address) + + // Curator balance updated + expect(afterCuratorTokens).eq(beforeCuratorTokens.add(expectedTokens)) + expect(afterCuratorSignal).eq(beforeCuratorSignal.sub(signalToRedeem)) + // Curation balance updated + expect(afterPool.tokens).eq(beforePool.tokens.sub(expectedTokens)) + expect(afterPoolSignal).eq(beforePoolSignal.sub(signalToRedeem)) + // Contract balance updated + expect(afterTotalTokens).eq(beforeTotalTokens.sub(expectedTokens)) + // Total supply is conserved + expect(afterTokenTotalSupply).eq(beforeTokenTotalSupply) + } + + const shouldCollect = async (tokensToCollect: BigNumber, signer: SignerWithAddress = stakingMock) => { + // Before state + const beforePool = await curation.pools(subgraphDeploymentID) + const beforeTotalBalance = await grt.balanceOf(curation.address) + + // Source of tokens must be the staking for this to work + await grt.connect(signer).transfer(curation.address, tokensToCollect) + const tx = curation.connect(signer).collect(subgraphDeploymentID, tokensToCollect) + await expect(tx).emit(curation, 'Collected').withArgs(subgraphDeploymentID, tokensToCollect) + + // After state + const afterPool = await curation.pools(subgraphDeploymentID) + const afterTotalBalance = await grt.balanceOf(curation.address) + + // State updated + expect(afterPool.tokens).eq(beforePool.tokens.add(tokensToCollect)) + expect(afterTotalBalance).eq(beforeTotalBalance.add(tokensToCollect)) + } + + before(async function () { + // Use stakingMock so we can call collect + [me, curator, stakingMock, subgraphService] = await graph.getTestAccounts() + ;({ governor } = await graph.getNamedAccounts()) + fixture = new NetworkFixture(graph.provider) + contracts = await fixture.load(governor, true) + curation = contracts.Curation as L2Curation + grt = contracts.GraphToken as GraphToken + controller = contracts.Controller as Controller + gns = contracts.GNS as GNS + + gnsImpersonator = await helpers.impersonateAccount(gns.address) + await helpers.setBalance(gns.address, parseEther('1')) + // Give some funds to the curator and GNS impersonator and approve the curation contract + await grt.connect(governor).mint(curator.address, curatorTokens) + await grt.connect(curator).approve(curation.address, curatorTokens) + await grt.connect(governor).mint(gns.address, curatorTokens) + await grt.connect(gnsImpersonator).approve(curation.address, curatorTokens) + + // Give some funds to the staking contract and approve the curation contract + await grt.connect(governor).mint(stakingMock.address, tokensToCollect) + await grt.connect(stakingMock).approve(curation.address, tokensToCollect) + }) + + beforeEach(async function () { + await fixture.setUp() + }) + + afterEach(async function () { + await fixture.tearDown() + }) + + describe('bonding curve', function () { + const tokensToDeposit = curatorTokens + + it('reject convert signal to tokens if subgraph deployment not initted', async function () { + const tx = curation.signalToTokens(subgraphDeploymentID, toGRT('100')) + await expect(tx).revertedWith('Subgraph deployment must be curated to perform calculations') + }) + + it('convert signal to tokens', async function () { + // Curate + await curation.connect(curator).mint(subgraphDeploymentID, tokensToDeposit, 0) + + // Conversion + const signal = await curation.getCurationPoolSignal(subgraphDeploymentID) + const expectedTokens = await curation.signalToTokens(subgraphDeploymentID, signal) + expect(expectedTokens).eq(tokensToDeposit) + }) + + it('convert signal to tokens (with curation tax)', async function () { + // Set curation tax + const curationTaxPercentage = 50000 // 5% + await curation.connect(governor).setCurationTaxPercentage(curationTaxPercentage) + + // Curate + const expectedCurationTax = tokensToDeposit.mul(curationTaxPercentage).div(MAX_PPM) + const { 1: curationTax } = await curation.tokensToSignal( + subgraphDeploymentID, + tokensToDeposit, + ) + await curation.connect(curator).mint(subgraphDeploymentID, tokensToDeposit, 0) + + // Conversion + const signal = await curation.getCurationPoolSignal(subgraphDeploymentID) + const tokens = await curation.signalToTokens(subgraphDeploymentID, signal) + expect(tokens).eq(tokensToDeposit.sub(expectedCurationTax)) + expect(expectedCurationTax).eq(curationTax) + }) + + it('convert tokens to signal', async function () { + // Conversion + const tokens = toGRT('1000') + const { 0: signal } = await curation.tokensToSignal(subgraphDeploymentID, tokens) + expect(signal).eq(signalAmountFor1000Tokens) + }) + + it('convert tokens to signal if non-curated subgraph', async function () { + // Conversion + const nonCuratedSubgraphDeploymentID = randomHexBytes() + const tokens = toGRT('0') + const tx = curation.tokensToSignal(nonCuratedSubgraphDeploymentID, tokens) + await expect(tx).revertedWith('Curation deposit is below minimum required') + }) + }) + + describe('curate', function () { + it('reject deposit below minimum tokens required', async function () { + // Set the minimum to a value greater than 1 so that we can test + await curation.connect(governor).setMinimumCurationDeposit(toBN('2')) + const tokensToDeposit = (await curation.minimumCurationDeposit()).sub(toBN(1)) + const tx = curation.connect(curator).mint(subgraphDeploymentID, tokensToDeposit, 0) + await expect(tx).revertedWith('Curation deposit is below minimum required') + }) + + it('should deposit on a subgraph deployment', async function () { + const tokensToDeposit = await curation.minimumCurationDeposit() + const expectedSignal = signalAmountForMinimumCuration // tax = 0 due to rounding + await shouldMint(tokensToDeposit, expectedSignal) + }) + + it('should get signal according to bonding curve', async function () { + const tokensToDeposit = toGRT('1000') + const expectedSignal = signalAmountFor1000Tokens + await shouldMint(tokensToDeposit, expectedSignal) + }) + + it('should get signal according to bonding curve (and account for curation tax)', async function () { + // Set curation tax + await curation.connect(governor).setCurationTaxPercentage(50000) // 5% + + // Mint + const tokensToDeposit = toGRT('1000') + const { 0: expectedSignal } = await curation.tokensToSignal( + subgraphDeploymentID, + tokensToDeposit, + ) + await shouldMint(tokensToDeposit, expectedSignal) + }) + + it('should revert curate if over slippage', async function () { + const tokensToDeposit = toGRT('1000') + const expectedSignal = signalAmountFor1000Tokens + const tx = curation + .connect(curator) + .mint(subgraphDeploymentID, tokensToDeposit, expectedSignal.add(1)) + await expect(tx).revertedWith('Slippage protection') + }) + + it('should pay a minimum of 1 wei GRT in tax when depositing small amounts', async function () { + // Set minimum curation deposit + await contracts.Curation.connect(governor).setMinimumCurationDeposit('1') + + // Set curation tax to 1% + await contracts.Curation.connect(governor).setCurationTaxPercentage(10000) + + // Deposit a small amount where tax would be less than 1 wei + const tokensToDeposit = '99' + + const expectedTokens = '98' + const expectedSignal = '98' + const expectedTax = 1 + + const tx = contracts.Curation.connect(curator).mint( + subgraphDeploymentID, + tokensToDeposit, + expectedSignal, + ) + + await expect(tx) + .emit(contracts.Curation, 'Signalled') + .withArgs( + curator.address, + subgraphDeploymentID, + tokensToDeposit, + expectedSignal, + expectedTax, + ) + + const burnTx = contracts.Curation.connect(curator).burn( + subgraphDeploymentID, + expectedSignal, + expectedTokens, + ) + + await expect(burnTx) + .emit(contracts.Curation, 'Burned') + .withArgs(curator.address, subgraphDeploymentID, expectedTokens, expectedSignal) + }) + }) + + describe('curate tax free (from GNS)', function () { + it('can not be called by anyone other than GNS', async function () { + const tokensToDeposit = await curation.minimumCurationDeposit() + const tx = curation.connect(curator).mintTaxFree(subgraphDeploymentID, tokensToDeposit) + await expect(tx).revertedWith('Only the GNS can call this') + }) + + it('reject deposit below minimum tokens required', async function () { + // Set the minimum to a value greater than 1 so that we can test + await curation.connect(governor).setMinimumCurationDeposit(toBN('2')) + const tokensToDeposit = (await curation.minimumCurationDeposit()).sub(toBN(1)) + const tx = curation + .connect(gnsImpersonator) + .mintTaxFree(subgraphDeploymentID, tokensToDeposit) + await expect(tx).revertedWith('Curation deposit is below minimum required') + }) + + it('should deposit on a subgraph deployment', async function () { + const tokensToDeposit = await curation.minimumCurationDeposit() + const expectedSignal = signalAmountForMinimumCuration + await shouldMintTaxFree(tokensToDeposit, expectedSignal) + }) + + it('should get signal according to bonding curve', async function () { + const tokensToDeposit = toGRT('1000') + const expectedSignal = signalAmountFor1000Tokens + await shouldMintTaxFree(tokensToDeposit, expectedSignal) + }) + + it('should get signal according to bonding curve (and with zero tax)', async function () { + // Set curation tax + await curation.connect(governor).setCurationTaxPercentage(50000) // 5% + + // Mint + const tokensToDeposit = toGRT('1000') + const expectedSignal = await curation.tokensToSignalNoTax( + subgraphDeploymentID, + tokensToDeposit, + ) + await shouldMintTaxFree(tokensToDeposit, expectedSignal) + }) + }) + + describe('collect', function () { + context('> not curated', function () { + it('reject collect tokens distributed to the curation pool', async function () { + // Source of tokens must be the staking for this to work + await controller + .connect(governor) + .setContractProxy(utils.id('Staking'), stakingMock.address) + await curation.connect(governor).syncAllContracts() // call sync because we change the proxy for staking + + const tx = curation.connect(stakingMock).collect(subgraphDeploymentID, tokensToCollect) + await expect(tx).revertedWith('Subgraph deployment must be curated to collect fees') + }) + }) + + context('> curated', function () { + beforeEach(async function () { + await curation.connect(curator).mint(subgraphDeploymentID, toGRT('1000'), 0) + }) + + it('reject collect tokens distributed from invalid address', async function () { + const tx = curation.connect(me).collect(subgraphDeploymentID, tokensToCollect) + await expect(tx).revertedWith('Caller must be the subgraph service or staking contract') + }) + + it('should collect tokens distributed to the curation pool from staking contract', async function () { + await controller + .connect(governor) + .setContractProxy(utils.id('Staking'), stakingMock.address) + await curation.connect(governor).syncAllContracts() // call sync because we change the proxy for staking + + await shouldCollect(toGRT('1')) + await shouldCollect(toGRT('10')) + await shouldCollect(toGRT('100')) + await shouldCollect(toGRT('200')) + await shouldCollect(toGRT('500.25')) + }) + + it('should collect tokens distributed to the curation pool from subgraph service address', async function () { + await grt.connect(governor).mint(subgraphService.address, tokensToCollect) + await curation.connect(governor).setSubgraphService(subgraphService.address) + await shouldCollect(toGRT('1'), subgraphService) + await shouldCollect(toGRT('10'), subgraphService) + await shouldCollect(toGRT('100'), subgraphService) + await shouldCollect(toGRT('200'), subgraphService) + await shouldCollect(toGRT('500.25'), subgraphService) + }) + + it('should collect tokens and then unsignal all', async function () { + await controller + .connect(governor) + .setContractProxy(utils.id('Staking'), stakingMock.address) + await curation.connect(governor).syncAllContracts() // call sync because we change the proxy for staking + + // Collect increase the pool reserves + await shouldCollect(toGRT('100')) + + // When we burn signal we should get more tokens than initially curated + const signalToRedeem = await curation.getCuratorSignal( + curator.address, + subgraphDeploymentID, + ) + await shouldBurn(signalToRedeem, toGRT('1100')) + }) + + it('should collect tokens and then unsignal multiple times', async function () { + await controller + .connect(governor) + .setContractProxy(utils.id('Staking'), stakingMock.address) + await curation.connect(governor).syncAllContracts() // call sync because we change the proxy for staking + + // Collect increase the pool reserves + const tokensToCollect = toGRT('100') + await shouldCollect(tokensToCollect) + + // Unsignal partially + const signalOutRemainder = toGRT(1) + const signalOutPartial = ( + await curation.getCuratorSignal(curator.address, subgraphDeploymentID) + ).sub(signalOutRemainder) + const tx1 = await curation.connect(curator).burn(subgraphDeploymentID, signalOutPartial, 0) + const r1 = await tx1.wait() + const event1 = curation.interface.parseLog(r1.events[2]).args + const tokensOut1 = event1.tokens + + // Collect increase the pool reserves + await shouldCollect(tokensToCollect) + + // Unsignal the rest + const tx2 = await curation + .connect(curator) + .burn(subgraphDeploymentID, signalOutRemainder, 0) + const r2 = await tx2.wait() + const event2 = curation.interface.parseLog(r2.events[2]).args + const tokensOut2 = event2.tokens + + expect(tokensOut1.add(tokensOut2)).eq(toGRT('1000').add(tokensToCollect.mul(2))) + }) + }) + }) + + describe('burn', function () { + beforeEach(async function () { + await curation.connect(curator).mint(subgraphDeploymentID, tokensToDeposit, 0) + }) + + it('reject redeem more than a curator owns', async function () { + const tx = curation.connect(me).burn(subgraphDeploymentID, toGRT('1'), 0) + await expect(tx).revertedWith('Cannot burn more signal than you own') + }) + + it('reject redeem zero signal', async function () { + const tx = curation.connect(me).burn(subgraphDeploymentID, toGRT('0'), 0) + await expect(tx).revertedWith('Cannot burn zero signal') + }) + + it('should allow to redeem *partially*', async function () { + // Redeem just one signal + const signalToRedeem = toGRT('1') + const expectedTokens = toGRT('1') + await shouldBurn(signalToRedeem, expectedTokens) + }) + + it('should allow to redeem *fully*', async function () { + // Get all signal of the curator + const signalToRedeem = await curation.getCuratorSignal(curator.address, subgraphDeploymentID) + const expectedTokens = tokensToDeposit + await shouldBurn(signalToRedeem, expectedTokens) + }) + + it('should allow to redeem back below minimum deposit', async function () { + // Set the minimum to a value greater than 1 so that we can test + await curation.connect(governor).setMinimumCurationDeposit(toGRT('1')) + + // Redeem "almost" all signal + const signal = await curation.getCuratorSignal(curator.address, subgraphDeploymentID) + const signalToRedeem = signal.sub(toGRT('0.000001')) + const expectedTokens = await curation.signalToTokens(subgraphDeploymentID, signalToRedeem) + await shouldBurn(signalToRedeem, expectedTokens) + + // The pool should have less tokens that required by minimumCurationDeposit + const afterPool = await curation.pools(subgraphDeploymentID) + expect(afterPool.tokens).lt(await curation.minimumCurationDeposit()) + + // Should be able to deposit more after being under minimumCurationDeposit + const tokensToDeposit = toGRT('1') + const { 0: expectedSignal } = await curation.tokensToSignal( + subgraphDeploymentID, + tokensToDeposit, + ) + await shouldMint(tokensToDeposit, expectedSignal) + }) + + it('should revert redeem if over slippage', async function () { + const signalToRedeem = await curation.getCuratorSignal(curator.address, subgraphDeploymentID) + const expectedTokens = tokensToDeposit + + const tx = curation + .connect(curator) + .burn(subgraphDeploymentID, signalToRedeem, expectedTokens.add(1)) + await expect(tx).revertedWith('Slippage protection') + }) + + it('should not re-deploy the curation token when signal is reset', async function () { + const beforeSubgraphPool = await curation.pools(subgraphDeploymentID) + + // Burn all the signal + const signalToRedeem = await curation.getCuratorSignal(curator.address, subgraphDeploymentID) + const expectedTokens = tokensToDeposit + await shouldBurn(signalToRedeem, expectedTokens) + + // Mint again on the same subgraph + await curation.connect(curator).mint(subgraphDeploymentID, tokensToDeposit, 0) + + // Check state + const afterSubgraphPool = await curation.pools(subgraphDeploymentID) + expect(afterSubgraphPool.gcs).eq(beforeSubgraphPool.gcs) + }) + }) + + describe('conservation', function () { + it('should match multiple deposits and redeems back to initial state', async function () { + this.timeout(60000) // increase timeout for test runner + + const totalDeposits = toGRT('1000000000') + + // Signal multiple times + let totalSignal = toGRT('0') + for (const tokensToDeposit of chunkify(totalDeposits, 10)) { + const tx = await curation.connect(curator).mint(subgraphDeploymentID, tokensToDeposit, 0) + const receipt = await tx.wait() + const event: Event = receipt.events.pop() + const signal = event.args['signal'] + totalSignal = totalSignal.add(signal) + } + + // Redeem signal multiple times + let totalTokens = toGRT('0') + for (const signalToRedeem of chunkify(totalSignal, 10)) { + const tx = await curation.connect(curator).burn(subgraphDeploymentID, signalToRedeem, 0) + const receipt = await tx.wait() + const event: Event = receipt.events.pop() + const tokens = event.args['tokens'] + totalTokens = totalTokens.add(tokens) + // console.log('<', formatEther(signalToRedeem), '=', formatEther(tokens)) + } + + // Conservation of work + const afterPool = await curation.pools(subgraphDeploymentID) + const afterPoolSignal = await curation.getCurationPoolSignal(subgraphDeploymentID) + expect(afterPool.tokens).eq(toGRT('0')) + expect(afterPoolSignal).eq(toGRT('0')) + expect(await curation.isCurated(subgraphDeploymentID)).eq(false) + expect(totalDeposits).eq(totalTokens) + }) + }) + + describe('multiple minting', function () { + it('should mint the same signal every time due to the flat bonding curve', async function () { + const tokensToDepositMany = [ + toGRT('1000'), // should mint if we start with number above minimum deposit + toGRT('1000'), // every time it should mint the same GCS due to bonding curve! + toGRT('1000'), + toGRT('1000'), + toGRT('2000'), + toGRT('2000'), + toGRT('123'), + toGRT('1'), // should mint below minimum deposit + ] + for (const tokensToDeposit of tokensToDepositMany) { + const expectedSignal = await calcLinearBondingCurve( + await curation.getCurationPoolSignal(subgraphDeploymentID), + await curation.getCurationPoolTokens(subgraphDeploymentID), + tokensToDeposit, + ) + // SIGNAL_PER_MINIMUM_DEPOSIT should always give the same ratio + expect(tokensToDeposit.div(toGRT(expectedSignal))).eq(1) + + const tx = await curation.connect(curator).mint(subgraphDeploymentID, tokensToDeposit, 0) + const receipt = await tx.wait() + const event: Event = receipt.events.pop() + const signal = event.args['signal'] + expect(toRound(toFloat(toBN(signal)))).eq(toRound(expectedSignal)) + } + }) + + it('should mint when using a different ratio between GRT and signal', async function () { + this.timeout(60000) // increase timeout for test runner + + // Setup edge case with 1 GRT = 1 wei signal + await curation.connect(governor).setMinimumCurationDeposit(toGRT('1')) + + const tokensToDepositMany = [ + toGRT('1000'), // should mint if we start with number above minimum deposit + toGRT('1000'), // every time it should mint proportionally the same GCS due to linear bonding curve... + toGRT('1000'), + toGRT('1000'), + toGRT('2000'), + toGRT('2000'), + toGRT('123'), + toGRT('1'), + ] + + // Mint multiple times + for (const tokensToDeposit of tokensToDepositMany) { + const tx = await curation.connect(curator).mint(subgraphDeploymentID, tokensToDeposit, 0) + const receipt = await tx.wait() + const event: Event = receipt.events.pop() + const signal = event.args['signal'] + expect(tokensToDeposit).eq(signal.mul(toGRT('1'))) // we compare 1 GRT : 1 wei ratio + } + }) + }) +}) diff --git a/packages/contracts/test/unit/l2/l2GNS.test.ts b/packages/contracts/test/unit/l2/l2GNS.test.ts new file mode 100644 index 000000000..317b50598 --- /dev/null +++ b/packages/contracts/test/unit/l2/l2GNS.test.ts @@ -0,0 +1,950 @@ +/* eslint-disable no-secrets/no-secrets */ +import hre from 'hardhat' +import { expect } from 'chai' +import { BigNumber, ContractTransaction, ethers } from 'ethers' +import { defaultAbiCoder, parseEther } from 'ethers/lib/utils' + +import { NetworkFixture } from '../lib/fixtures' + +import { L2GNS } from '../../../build/types/L2GNS' +import { L2GraphTokenGateway } from '../../../build/types/L2GraphTokenGateway' +import { + burnSignal, + DEFAULT_RESERVE_RATIO, + deprecateSubgraph, + mintSignal, + publishNewSubgraph, + publishNewVersion, +} from '../lib/gnsUtils' +import { L2Curation } from '../../../build/types/L2Curation' +import { GraphToken } from '../../../build/types/GraphToken' +import { + buildSubgraph, + buildSubgraphId, + deriveChannelKey, + GraphNetworkContracts, + helpers, + PublishSubgraph, + randomHexBytes, + Subgraph, + toBN, + toGRT, +} from '@graphprotocol/sdk' +import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers' +import { IL2Staking } from '../../../build/types/IL2Staking' +import { L1GNS, L1GraphTokenGateway } from '../../../build/types' + +const { HashZero } = ethers.constants + +interface L1SubgraphParams { + l1SubgraphId: string + curatedTokens: BigNumber + subgraphMetadata: string + versionMetadata: string +} + +describe('L2GNS', () => { + const graph = hre.graph() + let me: SignerWithAddress + let attacker: SignerWithAddress + let other: SignerWithAddress + let governor: SignerWithAddress + let fixture: NetworkFixture + + let fixtureContracts: GraphNetworkContracts + let l1MockContracts: GraphNetworkContracts + let l1GRTMock: GraphToken + let l1GNSMock: L1GNS + let l1GRTGatewayMock: L1GraphTokenGateway + let l2GraphTokenGateway: L2GraphTokenGateway + let gns: L2GNS + let curation: L2Curation + let grt: GraphToken + let staking: IL2Staking + + let newSubgraph0: PublishSubgraph + let newSubgraph1: PublishSubgraph + + const tokens1000 = toGRT('1000') + const tokens10000 = toGRT('10000') + const tokens100000 = toGRT('100000') + const curationTaxPercentage = 50000 + + const gatewayFinalizeTransfer = async function ( + from: string, + to: string, + amount: BigNumber, + callhookData: string, + ): Promise { + const l1GRTGatewayMockL2Alias = await helpers.getL2SignerFromL1(l1GRTGatewayMock.address) + // Eth for gas: + await helpers.setBalance(await l1GRTGatewayMockL2Alias.getAddress(), parseEther('1')) + + const tx = l2GraphTokenGateway + .connect(l1GRTGatewayMockL2Alias) + .finalizeInboundTransfer(l1GRTMock.address, from, to, amount, callhookData) + return tx + } + + const defaultL1SubgraphParams = async function (): Promise { + return { + l1SubgraphId: await buildSubgraphId(me.address, toBN('1'), graph.chainId), + curatedTokens: toGRT('1337'), + subgraphMetadata: randomHexBytes(), + versionMetadata: randomHexBytes(), + } + } + const transferMockSubgraphFromL1 = async function ( + l1SubgraphId: string, + curatedTokens: BigNumber, + subgraphMetadata: string, + versionMetadata: string, + ) { + const callhookData = defaultAbiCoder.encode( + ['uint8', 'uint256', 'address'], + [toBN(0), l1SubgraphId, me.address], + ) + await gatewayFinalizeTransfer(l1GNSMock.address, gns.address, curatedTokens, callhookData) + + const l2SubgraphId = await gns.getAliasedL2SubgraphID(l1SubgraphId) + await gns + .connect(me) + .finishSubgraphTransferFromL1( + l2SubgraphId, + newSubgraph0.subgraphDeploymentID, + subgraphMetadata, + versionMetadata, + ) + } + + before(async function () { + newSubgraph0 = buildSubgraph() + ;[me, attacker, other] = await graph.getTestAccounts() + ;({ governor } = await graph.getNamedAccounts()) + + fixture = new NetworkFixture(graph.provider) + + // Deploy L2 + fixtureContracts = await fixture.load(governor, true) + l2GraphTokenGateway = fixtureContracts.L2GraphTokenGateway as L2GraphTokenGateway + gns = fixtureContracts.L2GNS as L2GNS + staking = fixtureContracts.L2Staking as unknown as IL2Staking + curation = fixtureContracts.L2Curation as L2Curation + grt = fixtureContracts.GraphToken as GraphToken + + // Deploy L1 mock + l1MockContracts = await fixture.loadMock(false) + l1GRTMock = l1MockContracts.GraphToken as GraphToken + l1GNSMock = l1MockContracts.L1GNS as L1GNS + l1GRTGatewayMock = l1MockContracts.L1GraphTokenGateway as L1GraphTokenGateway + + // Deploy L2 arbitrum bridge + await fixture.loadL2ArbitrumBridge(governor) + + // Configure L2 bridge + await fixture.configureL2Bridge(governor, fixtureContracts, l1MockContracts) + + await grt.connect(governor).mint(me.address, toGRT('10000')) + }) + + beforeEach(async function () { + await fixture.setUp() + }) + + afterEach(async function () { + await fixture.tearDown() + }) + + // Adapted from the L1 GNS tests but allowing curating to a pre-curated subgraph deployment + describe('publishNewVersion', function () { + let subgraph: Subgraph + + beforeEach(async () => { + newSubgraph0 = buildSubgraph() + newSubgraph1 = buildSubgraph() + // Give some funds to the signers and approve gns contract to use funds on signers behalf + await grt.connect(governor).mint(me.address, tokens100000) + await grt.connect(governor).mint(other.address, tokens100000) + await grt.connect(me).approve(gns.address, tokens100000) + await grt.connect(me).approve(curation.address, tokens100000) + await grt.connect(other).approve(gns.address, tokens100000) + await grt.connect(other).approve(curation.address, tokens100000) + // Update curation tax to test the functionality of it in disableNameSignal() + await curation.connect(governor).setCurationTaxPercentage(curationTaxPercentage) + subgraph = await publishNewSubgraph(me, newSubgraph0, gns, graph.chainId) + await mintSignal(me, subgraph.id, tokens10000, gns, curation) + }) + + it('should publish a new version on an existing subgraph', async function () { + await publishNewVersion(me, subgraph.id, newSubgraph1, gns, curation) + }) + + it('should publish a new version on an existing subgraph when owner tax is zero', async function () { + await gns.connect(governor).setOwnerTaxPercentage(0) + await publishNewVersion(me, subgraph.id, newSubgraph1, gns, curation) + }) + + it('should publish a new version on an existing subgraph with no current signal', async function () { + const emptySignalSubgraph = await publishNewSubgraph(me, buildSubgraph(), gns, graph.chainId) + await publishNewVersion(me, emptySignalSubgraph.id, newSubgraph1, gns, curation) + }) + + it('should reject a new version with the same subgraph deployment ID', async function () { + const tx = gns + .connect(me) + .publishNewVersion( + subgraph.id, + newSubgraph0.subgraphDeploymentID, + newSubgraph0.versionMetadata, + ) + await expect(tx).revertedWith( + 'GNS: Cannot publish a new version with the same subgraph deployment ID', + ) + }) + + it('should reject publishing a version to a subgraph that does not exist', async function () { + const tx = gns + .connect(me) + .publishNewVersion( + randomHexBytes(32), + newSubgraph1.subgraphDeploymentID, + newSubgraph1.versionMetadata, + ) + await expect(tx).revertedWith('ERC721: owner query for nonexistent token') + }) + + it('reject if not the owner', async function () { + const tx = gns + .connect(other) + .publishNewVersion( + subgraph.id, + newSubgraph1.subgraphDeploymentID, + newSubgraph1.versionMetadata, + ) + await expect(tx).revertedWith('GNS: Must be authorized') + }) + + it('should NOT fail when upgrade tries to point to a pre-curated', async function () { + // Curate directly to the deployment + await curation.connect(me).mint(newSubgraph1.subgraphDeploymentID, tokens1000, 0) + + await publishNewVersion(me, subgraph.id, newSubgraph1, gns, curation) + }) + + it('should upgrade version when there is no signal with no signal migration', async function () { + await burnSignal(me, subgraph.id, gns, curation) + const tx = gns + .connect(me) + .publishNewVersion( + subgraph.id, + newSubgraph1.subgraphDeploymentID, + newSubgraph1.versionMetadata, + ) + await expect(tx) + .emit(gns, 'SubgraphVersionUpdated') + .withArgs(subgraph.id, newSubgraph1.subgraphDeploymentID, newSubgraph1.versionMetadata) + }) + + it('should fail when subgraph is deprecated', async function () { + await deprecateSubgraph(me, subgraph.id, gns, curation, grt) + const tx = gns + .connect(me) + .publishNewVersion( + subgraph.id, + newSubgraph1.subgraphDeploymentID, + newSubgraph1.versionMetadata, + ) + // NOTE: deprecate burns the Subgraph NFT, when someone wants to publish a new version it won't find it + await expect(tx).revertedWith('ERC721: owner query for nonexistent token') + }) + }) + + describe('receiving a subgraph from L1 (onTokenTransfer)', function () { + it('cannot be called by someone other than the L2GraphTokenGateway', async function () { + const { l1SubgraphId, curatedTokens } = await defaultL1SubgraphParams() + const callhookData = defaultAbiCoder.encode( + ['uint8', 'uint256', 'address'], + [toBN(0), l1SubgraphId, me.address], + ) + const tx = gns.connect(me).onTokenTransfer(l1GNSMock.address, curatedTokens, callhookData) + await expect(tx).revertedWith('ONLY_GATEWAY') + }) + it('rejects calls if the L1 sender is not the L1GNS', async function () { + const { l1SubgraphId, curatedTokens } = await defaultL1SubgraphParams() + const callhookData = defaultAbiCoder.encode( + ['uint8', 'uint256', 'address'], + [toBN(0), l1SubgraphId, me.address], + ) + const tx = gatewayFinalizeTransfer(me.address, gns.address, curatedTokens, callhookData) + + await expect(tx).revertedWith('ONLY_L1_GNS_THROUGH_BRIDGE') + }) + it('creates a subgraph in a disabled state', async function () { + const { l1SubgraphId, curatedTokens } = await defaultL1SubgraphParams() + const callhookData = defaultAbiCoder.encode( + ['uint8', 'uint256', 'address'], + [toBN(0), l1SubgraphId, me.address], + ) + const tx = gatewayFinalizeTransfer( + l1GNSMock.address, + gns.address, + curatedTokens, + callhookData, + ) + + const l2SubgraphId = await gns.getAliasedL2SubgraphID(l1SubgraphId) + + await expect(tx) + .emit(l2GraphTokenGateway, 'DepositFinalized') + .withArgs(l1GRTMock.address, l1GNSMock.address, gns.address, curatedTokens) + await expect(tx) + .emit(gns, 'SubgraphReceivedFromL1') + .withArgs(l1SubgraphId, l2SubgraphId, me.address, curatedTokens) + + const transferData = await gns.subgraphL2TransferData(l2SubgraphId) + const subgraphData = await gns.subgraphs(l2SubgraphId) + + expect(transferData.tokens).eq(curatedTokens) + expect(transferData.l2Done).eq(false) + expect(transferData.subgraphReceivedOnL2BlockNumber).eq(await helpers.latestBlock()) + + expect(subgraphData.vSignal).eq(0) + expect(subgraphData.nSignal).eq(0) + expect(subgraphData.subgraphDeploymentID).eq(HashZero) + expect(subgraphData.__DEPRECATED_reserveRatio).eq(DEFAULT_RESERVE_RATIO) + expect(subgraphData.disabled).eq(true) + expect(subgraphData.withdrawableGRT).eq(0) // Important so that it's not the same as a deprecated subgraph! + + expect(await gns.ownerOf(l2SubgraphId)).eq(me.address) + }) + it('does not conflict with a locally created subgraph', async function () { + const l2Subgraph = await publishNewSubgraph(me, newSubgraph0, gns, graph.chainId) + + const { l1SubgraphId, curatedTokens } = await defaultL1SubgraphParams() + const callhookData = defaultAbiCoder.encode( + ['uint8', 'uint256', 'address'], + [toBN(0), l1SubgraphId, me.address], + ) + const tx = gatewayFinalizeTransfer( + l1GNSMock.address, + gns.address, + curatedTokens, + callhookData, + ) + + const l2SubgraphId = await gns.getAliasedL2SubgraphID(l1SubgraphId) + + await expect(tx) + .emit(l2GraphTokenGateway, 'DepositFinalized') + .withArgs(l1GRTMock.address, l1GNSMock.address, gns.address, curatedTokens) + await expect(tx) + .emit(gns, 'SubgraphReceivedFromL1') + .withArgs(l1SubgraphId, l2SubgraphId, me.address, curatedTokens) + + const transferData = await gns.subgraphL2TransferData(l2SubgraphId) + const subgraphData = await gns.subgraphs(l2SubgraphId) + + expect(transferData.tokens).eq(curatedTokens) + expect(transferData.l2Done).eq(false) + expect(transferData.subgraphReceivedOnL2BlockNumber).eq(await helpers.latestBlock()) + + expect(subgraphData.vSignal).eq(0) + expect(subgraphData.nSignal).eq(0) + expect(subgraphData.subgraphDeploymentID).eq(HashZero) + expect(subgraphData.__DEPRECATED_reserveRatio).eq(DEFAULT_RESERVE_RATIO) + expect(subgraphData.disabled).eq(true) + expect(subgraphData.withdrawableGRT).eq(0) // Important so that it's not the same as a deprecated subgraph! + + expect(await gns.ownerOf(l2SubgraphId)).eq(me.address) + + expect(l2Subgraph.id).not.eq(l2SubgraphId) + const l2SubgraphData = await gns.subgraphs(l2Subgraph.id) + expect(l2SubgraphData.vSignal).eq(0) + expect(l2SubgraphData.nSignal).eq(0) + expect(l2SubgraphData.subgraphDeploymentID).eq(l2Subgraph.subgraphDeploymentID) + expect(l2SubgraphData.__DEPRECATED_reserveRatio).eq(DEFAULT_RESERVE_RATIO) + expect(l2SubgraphData.disabled).eq(false) + expect(l2SubgraphData.withdrawableGRT).eq(0) + }) + }) + + describe('finishing a subgraph transfer from L1', function () { + it('publishes the transferred subgraph and mints signal with no tax', async function () { + const { l1SubgraphId, curatedTokens, subgraphMetadata, versionMetadata } + = await defaultL1SubgraphParams() + const callhookData = defaultAbiCoder.encode( + ['uint8', 'uint256', 'address'], + [toBN(0), l1SubgraphId, me.address], + ) + await gatewayFinalizeTransfer(l1GNSMock.address, gns.address, curatedTokens, callhookData) + // Calculate expected signal before minting + const expectedSignal = await curation.tokensToSignalNoTax( + newSubgraph0.subgraphDeploymentID, + curatedTokens, + ) + const l2SubgraphId = await gns.getAliasedL2SubgraphID(l1SubgraphId) + const tx = gns + .connect(me) + .finishSubgraphTransferFromL1( + l2SubgraphId, + newSubgraph0.subgraphDeploymentID, + subgraphMetadata, + versionMetadata, + ) + await expect(tx) + .emit(gns, 'SubgraphPublished') + .withArgs(l2SubgraphId, newSubgraph0.subgraphDeploymentID, DEFAULT_RESERVE_RATIO) + await expect(tx).emit(gns, 'SubgraphMetadataUpdated').withArgs(l2SubgraphId, subgraphMetadata) + await expect(tx) + .emit(gns, 'SubgraphUpgraded') + .withArgs(l2SubgraphId, expectedSignal, curatedTokens, newSubgraph0.subgraphDeploymentID) + await expect(tx) + .emit(gns, 'SubgraphVersionUpdated') + .withArgs(l2SubgraphId, newSubgraph0.subgraphDeploymentID, versionMetadata) + await expect(tx).emit(gns, 'SubgraphL2TransferFinalized').withArgs(l2SubgraphId) + + const subgraphAfter = await gns.subgraphs(l2SubgraphId) + const transferDataAfter = await gns.subgraphL2TransferData(l2SubgraphId) + expect(subgraphAfter.vSignal).eq(expectedSignal) + expect(transferDataAfter.l2Done).eq(true) + expect(subgraphAfter.disabled).eq(false) + expect(subgraphAfter.subgraphDeploymentID).eq(newSubgraph0.subgraphDeploymentID) + const expectedNSignal = await gns.vSignalToNSignal(l2SubgraphId, expectedSignal) + expect(await gns.getCuratorSignal(l2SubgraphId, me.address)).eq(expectedNSignal) + await expect(tx) + .emit(gns, 'SignalMinted') + .withArgs(l2SubgraphId, me.address, expectedNSignal, expectedSignal, curatedTokens) + }) + it('protects the owner against a rounding attack', async function () { + const { l1SubgraphId, curatedTokens, subgraphMetadata, versionMetadata } + = await defaultL1SubgraphParams() + const collectTokens = curatedTokens.mul(20) + + await staking.connect(governor).setCurationPercentage(100000) + + // Set up an indexer account with some stake + await grt.connect(governor).mint(attacker.address, toGRT('1000000')) + // Curate 1 wei GRT by minting 1 GRT and burning most of it + await grt.connect(attacker).approve(curation.address, toBN(1)) + await curation.connect(attacker).mint(newSubgraph0.subgraphDeploymentID, toBN(1), 0) + + // Check this actually gave us 1 wei signal + expect(await curation.getCurationPoolTokens(newSubgraph0.subgraphDeploymentID)).eq(1) + await grt.connect(attacker).approve(staking.address, toGRT('1000000')) + await staking.connect(attacker).stake(toGRT('100000')) + const channelKey = deriveChannelKey() + // Allocate to the same deployment ID + await staking + .connect(attacker) + .allocateFrom( + attacker.address, + newSubgraph0.subgraphDeploymentID, + toGRT('100000'), + channelKey.address, + randomHexBytes(32), + await channelKey.generateProof(attacker.address), + ) + // Spoof some query fees, 10% of which will go to the Curation pool + await staking.connect(attacker).collect(collectTokens, channelKey.address) + // The curation pool now has 1 wei shares and a lot of tokens, so the rounding attack is prepared + // But L2GNS will protect the owner by sending the tokens + const callhookData = defaultAbiCoder.encode( + ['uint8', 'uint256', 'address'], + [toBN(0), l1SubgraphId, me.address], + ) + await gatewayFinalizeTransfer(l1GNSMock.address, gns.address, curatedTokens, callhookData) + + const l2SubgraphId = await gns.getAliasedL2SubgraphID(l1SubgraphId) + const tx = gns + .connect(me) + .finishSubgraphTransferFromL1( + l2SubgraphId, + newSubgraph0.subgraphDeploymentID, + subgraphMetadata, + versionMetadata, + ) + await expect(tx) + .emit(gns, 'SubgraphPublished') + .withArgs(l2SubgraphId, newSubgraph0.subgraphDeploymentID, DEFAULT_RESERVE_RATIO) + await expect(tx).emit(gns, 'SubgraphMetadataUpdated').withArgs(l2SubgraphId, subgraphMetadata) + await expect(tx).emit(gns, 'CuratorBalanceReturnedToBeneficiary') + await expect(tx) + .emit(gns, 'SubgraphUpgraded') + .withArgs(l2SubgraphId, 0, 0, newSubgraph0.subgraphDeploymentID) + await expect(tx) + .emit(gns, 'SubgraphVersionUpdated') + .withArgs(l2SubgraphId, newSubgraph0.subgraphDeploymentID, versionMetadata) + await expect(tx).emit(gns, 'SubgraphL2TransferFinalized').withArgs(l2SubgraphId) + }) + it('cannot be called by someone other than the subgraph owner', async function () { + const { l1SubgraphId, curatedTokens, subgraphMetadata, versionMetadata } + = await defaultL1SubgraphParams() + const callhookData = defaultAbiCoder.encode( + ['uint8', 'uint256', 'address'], + [toBN(0), l1SubgraphId, me.address], + ) + await gatewayFinalizeTransfer(l1GNSMock.address, gns.address, curatedTokens, callhookData) + const l2SubgraphId = await gns.getAliasedL2SubgraphID(l1SubgraphId) + const tx = gns + .connect(other) + .finishSubgraphTransferFromL1( + l2SubgraphId, + newSubgraph0.subgraphDeploymentID, + subgraphMetadata, + versionMetadata, + ) + await expect(tx).revertedWith('GNS: Must be authorized') + }) + it('rejects calls for a subgraph that does not exist', async function () { + const l1SubgraphId = await buildSubgraphId(me.address, toBN('1'), graph.chainId) + const metadata = randomHexBytes() + const l2SubgraphId = await gns.getAliasedL2SubgraphID(l1SubgraphId) + const tx = gns + .connect(me) + .finishSubgraphTransferFromL1( + l2SubgraphId, + newSubgraph0.subgraphDeploymentID, + metadata, + metadata, + ) + await expect(tx).revertedWith('ERC721: owner query for nonexistent token') + }) + it('rejects calls for a subgraph that was not transferred from L1', async function () { + const l2Subgraph = await publishNewSubgraph(me, newSubgraph0, gns, graph.chainId) + const metadata = randomHexBytes() + + const tx = gns + .connect(me) + .finishSubgraphTransferFromL1( + l2Subgraph.id, + newSubgraph0.subgraphDeploymentID, + metadata, + metadata, + ) + await expect(tx).revertedWith('INVALID_SUBGRAPH') + }) + it('accepts calls to a pre-curated subgraph deployment', async function () { + const { l1SubgraphId, curatedTokens, subgraphMetadata, versionMetadata } + = await defaultL1SubgraphParams() + const callhookData = defaultAbiCoder.encode( + ['uint8', 'uint256', 'address'], + [toBN(0), l1SubgraphId, me.address], + ) + await gatewayFinalizeTransfer(l1GNSMock.address, gns.address, curatedTokens, callhookData) + const l2SubgraphId = await gns.getAliasedL2SubgraphID(l1SubgraphId) + + // Calculate expected signal before minting + const expectedSignal = await curation.tokensToSignalNoTax( + newSubgraph0.subgraphDeploymentID, + curatedTokens, + ) + await grt.connect(me).approve(curation.address, toGRT('100')) + await curation.connect(me).mint(newSubgraph0.subgraphDeploymentID, toGRT('100'), toBN('0')) + + expect(await curation.getCurationPoolTokens(newSubgraph0.subgraphDeploymentID)).eq( + toGRT('100'), + ) + const tx = gns + .connect(me) + .finishSubgraphTransferFromL1( + l2SubgraphId, + newSubgraph0.subgraphDeploymentID, + subgraphMetadata, + versionMetadata, + ) + await expect(tx) + .emit(gns, 'SubgraphPublished') + .withArgs(l2SubgraphId, newSubgraph0.subgraphDeploymentID, DEFAULT_RESERVE_RATIO) + await expect(tx).emit(gns, 'SubgraphMetadataUpdated').withArgs(l2SubgraphId, subgraphMetadata) + await expect(tx) + .emit(gns, 'SubgraphUpgraded') + .withArgs(l2SubgraphId, expectedSignal, curatedTokens, newSubgraph0.subgraphDeploymentID) + await expect(tx) + .emit(gns, 'SubgraphVersionUpdated') + .withArgs(l2SubgraphId, newSubgraph0.subgraphDeploymentID, versionMetadata) + await expect(tx).emit(gns, 'SubgraphL2TransferFinalized').withArgs(l2SubgraphId) + + const subgraphAfter = await gns.subgraphs(l2SubgraphId) + const transferDataAfter = await gns.subgraphL2TransferData(l2SubgraphId) + expect(subgraphAfter.vSignal).eq(expectedSignal) + expect(transferDataAfter.l2Done).eq(true) + expect(subgraphAfter.disabled).eq(false) + expect(subgraphAfter.subgraphDeploymentID).eq(newSubgraph0.subgraphDeploymentID) + expect(await curation.getCurationPoolTokens(newSubgraph0.subgraphDeploymentID)).eq( + toGRT('100').add(curatedTokens), + ) + }) + it('rejects calls if the subgraph deployment ID is zero', async function () { + const metadata = randomHexBytes() + const { l1SubgraphId, curatedTokens } = await defaultL1SubgraphParams() + const callhookData = defaultAbiCoder.encode( + ['uint8', 'uint256', 'address'], + [toBN(0), l1SubgraphId, me.address], + ) + await gatewayFinalizeTransfer(l1GNSMock.address, gns.address, curatedTokens, callhookData) + const l2SubgraphId = await gns.getAliasedL2SubgraphID(l1SubgraphId) + const tx = gns + .connect(me) + .finishSubgraphTransferFromL1(l2SubgraphId, HashZero, metadata, metadata) + await expect(tx).revertedWith('GNS: deploymentID != 0') + }) + it('rejects calls if the subgraph transfer was already finished', async function () { + const metadata = randomHexBytes() + const { l1SubgraphId, curatedTokens } = await defaultL1SubgraphParams() + const callhookData = defaultAbiCoder.encode( + ['uint8', 'uint256', 'address'], + [toBN(0), l1SubgraphId, me.address], + ) + await gatewayFinalizeTransfer(l1GNSMock.address, gns.address, curatedTokens, callhookData) + const l2SubgraphId = await gns.getAliasedL2SubgraphID(l1SubgraphId) + await gns + .connect(me) + .finishSubgraphTransferFromL1( + l2SubgraphId, + newSubgraph0.subgraphDeploymentID, + metadata, + metadata, + ) + + const tx = gns + .connect(me) + .finishSubgraphTransferFromL1( + l2SubgraphId, + newSubgraph0.subgraphDeploymentID, + metadata, + metadata, + ) + await expect(tx).revertedWith('ALREADY_DONE') + }) + }) + describe('claiming a curator balance with a message from L1 (onTokenTransfer)', function () { + it('assigns a curator balance to a beneficiary', async function () { + const l1GNSMockL2Alias = await helpers.getL2SignerFromL1(l1GNSMock.address) + // Eth for gas: + await helpers.setBalance(await l1GNSMockL2Alias.getAddress(), parseEther('1')) + + const { l1SubgraphId, curatedTokens, subgraphMetadata, versionMetadata } + = await defaultL1SubgraphParams() + await transferMockSubgraphFromL1( + l1SubgraphId, + curatedTokens, + subgraphMetadata, + versionMetadata, + ) + const l2SubgraphId = await gns.getAliasedL2SubgraphID(l1SubgraphId) + const l2OwnerSignalBefore = await gns.getCuratorSignal(l2SubgraphId, me.address) + + const newCuratorTokens = toGRT('10') + const callhookData = defaultAbiCoder.encode( + ['uint8', 'uint256', 'address'], + [toBN(1), l1SubgraphId, other.address], + ) + const tx = await gatewayFinalizeTransfer( + l1GNSMock.address, + gns.address, + newCuratorTokens, + callhookData, + ) + + await expect(tx) + .emit(gns, 'CuratorBalanceReceived') + .withArgs(l1SubgraphId, l2SubgraphId, other.address, newCuratorTokens) + + const l2NewCuratorSignal = await gns.getCuratorSignal(l2SubgraphId, other.address) + const expectedNewCuratorSignal = await gns.vSignalToNSignal( + l2SubgraphId, + await curation.tokensToSignalNoTax(newSubgraph0.subgraphDeploymentID, newCuratorTokens), + ) + const l2OwnerSignalAfter = await gns.getCuratorSignal(l2SubgraphId, me.address) + expect(l2OwnerSignalAfter).eq(l2OwnerSignalBefore) + expect(l2NewCuratorSignal).eq(expectedNewCuratorSignal) + }) + it('adds the signal to any existing signal for the beneficiary', async function () { + const l1GNSMockL2Alias = await helpers.getL2SignerFromL1(l1GNSMock.address) + // Eth for gas: + await helpers.setBalance(await l1GNSMockL2Alias.getAddress(), parseEther('1')) + + const { l1SubgraphId, curatedTokens, subgraphMetadata, versionMetadata } + = await defaultL1SubgraphParams() + await transferMockSubgraphFromL1( + l1SubgraphId, + curatedTokens, + subgraphMetadata, + versionMetadata, + ) + + const l2SubgraphId = await gns.getAliasedL2SubgraphID(l1SubgraphId) + await grt.connect(governor).mint(other.address, toGRT('10')) + await grt.connect(other).approve(gns.address, toGRT('10')) + await gns.connect(other).mintSignal(l2SubgraphId, toGRT('10'), toBN(0)) + const prevSignal = await gns.getCuratorSignal(l2SubgraphId, other.address) + + const newCuratorTokens = toGRT('10') + const callhookData = defaultAbiCoder.encode( + ['uint8', 'uint256', 'address'], + [toBN(1), l1SubgraphId, other.address], + ) + const tx = await gatewayFinalizeTransfer( + l1GNSMock.address, + gns.address, + newCuratorTokens, + callhookData, + ) + + await expect(tx) + .emit(gns, 'CuratorBalanceReceived') + .withArgs(l1SubgraphId, l2SubgraphId, other.address, newCuratorTokens) + + const expectedNewCuratorSignal = await gns.vSignalToNSignal( + l2SubgraphId, + await curation.tokensToSignalNoTax(newSubgraph0.subgraphDeploymentID, newCuratorTokens), + ) + const l2CuratorBalance = await gns.getCuratorSignal(l2SubgraphId, other.address) + expect(l2CuratorBalance).eq(prevSignal.add(expectedNewCuratorSignal)) + }) + it('cannot be called by someone other than the L2GraphTokenGateway', async function () { + const { l1SubgraphId, curatedTokens, subgraphMetadata, versionMetadata } + = await defaultL1SubgraphParams() + await transferMockSubgraphFromL1( + l1SubgraphId, + curatedTokens, + subgraphMetadata, + versionMetadata, + ) + const callhookData = defaultAbiCoder.encode( + ['uint8', 'uint256', 'address'], + [toBN(1), l1SubgraphId, me.address], + ) + const tx = gns.connect(me).onTokenTransfer(l1GNSMock.address, toGRT('1'), callhookData) + await expect(tx).revertedWith('ONLY_GATEWAY') + }) + it('rejects calls if the L1 sender is not the L1GNS', async function () { + const { l1SubgraphId, curatedTokens, subgraphMetadata, versionMetadata } + = await defaultL1SubgraphParams() + await transferMockSubgraphFromL1( + l1SubgraphId, + curatedTokens, + subgraphMetadata, + versionMetadata, + ) + const callhookData = defaultAbiCoder.encode( + ['uint8', 'uint256', 'address'], + [toBN(1), l1SubgraphId, me.address], + ) + const tx = gatewayFinalizeTransfer(me.address, gns.address, toGRT('1'), callhookData) + + await expect(tx).revertedWith('ONLY_L1_GNS_THROUGH_BRIDGE') + }) + it('if a subgraph does not exist, it returns the tokens to the beneficiary', async function () { + const l1GNSMockL2Alias = await helpers.getL2SignerFromL1(l1GNSMock.address) + // Eth for gas: + await helpers.setBalance(await l1GNSMockL2Alias.getAddress(), parseEther('1')) + + const { l1SubgraphId } = await defaultL1SubgraphParams() + + const callhookData = defaultAbiCoder.encode( + ['uint8', 'uint256', 'address'], + [toBN(1), l1SubgraphId, me.address], + ) + const curatorTokensBefore = await grt.balanceOf(me.address) + const gnsBalanceBefore = await grt.balanceOf(gns.address) + const tx = gatewayFinalizeTransfer(l1GNSMock.address, gns.address, toGRT('1'), callhookData) + await expect(tx) + .emit(gns, 'CuratorBalanceReturnedToBeneficiary') + .withArgs(l1SubgraphId, me.address, toGRT('1')) + const curatorTokensAfter = await grt.balanceOf(me.address) + expect(curatorTokensAfter).eq(curatorTokensBefore.add(toGRT('1'))) + const gnsBalanceAfter = await grt.balanceOf(gns.address) + // gatewayFinalizeTransfer will mint the tokens that are sent to the curator, + // so the GNS balance should be the same + expect(gnsBalanceAfter).eq(gnsBalanceBefore) + }) + it('for an L2-native subgraph, it sends the tokens to the beneficiary', async function () { + // This should never really happen unless there's a clash in subgraph IDs (which should + // also never happen), but we test it anyway to ensure it's a well-defined behavior + const l1GNSMockL2Alias = await helpers.getL2SignerFromL1(l1GNSMock.address) + // Eth for gas: + await helpers.setBalance(await l1GNSMockL2Alias.getAddress(), parseEther('1')) + + const l2Subgraph = await publishNewSubgraph(me, newSubgraph0, gns, graph.chainId) + + const callhookData = defaultAbiCoder.encode( + ['uint8', 'uint256', 'address'], + [toBN(1), l2Subgraph.id, me.address], + ) + const curatorTokensBefore = await grt.balanceOf(me.address) + const gnsBalanceBefore = await grt.balanceOf(gns.address) + const tx = gatewayFinalizeTransfer(l1GNSMock.address, gns.address, toGRT('1'), callhookData) + await expect(tx) + .emit(gns, 'CuratorBalanceReturnedToBeneficiary') + .withArgs(l2Subgraph.id, me.address, toGRT('1')) + const curatorTokensAfter = await grt.balanceOf(me.address) + expect(curatorTokensAfter).eq(curatorTokensBefore.add(toGRT('1'))) + const gnsBalanceAfter = await grt.balanceOf(gns.address) + // gatewayFinalizeTransfer will mint the tokens that are sent to the curator, + // so the GNS balance should be the same + expect(gnsBalanceAfter).eq(gnsBalanceBefore) + }) + it('if a subgraph transfer was not finished, it returns the tokens to the beneficiary', async function () { + const l1GNSMockL2Alias = await helpers.getL2SignerFromL1(l1GNSMock.address) + // Eth for gas: + await helpers.setBalance(await l1GNSMockL2Alias.getAddress(), parseEther('1')) + + const { l1SubgraphId, curatedTokens } = await defaultL1SubgraphParams() + const callhookDataSG = defaultAbiCoder.encode( + ['uint8', 'uint256', 'address'], + [toBN(0), l1SubgraphId, me.address], + ) + await gatewayFinalizeTransfer(l1GNSMock.address, gns.address, curatedTokens, callhookDataSG) + + // At this point the SG exists, but transfer is not finished + + const callhookData = defaultAbiCoder.encode( + ['uint8', 'uint256', 'address'], + [toBN(1), l1SubgraphId, me.address], + ) + const curatorTokensBefore = await grt.balanceOf(me.address) + const gnsBalanceBefore = await grt.balanceOf(gns.address) + const tx = gatewayFinalizeTransfer(l1GNSMock.address, gns.address, toGRT('1'), callhookData) + await expect(tx) + .emit(gns, 'CuratorBalanceReturnedToBeneficiary') + .withArgs(l1SubgraphId, me.address, toGRT('1')) + const curatorTokensAfter = await grt.balanceOf(me.address) + expect(curatorTokensAfter).eq(curatorTokensBefore.add(toGRT('1'))) + const gnsBalanceAfter = await grt.balanceOf(gns.address) + // gatewayFinalizeTransfer will mint the tokens that are sent to the curator, + // so the GNS balance should be the same + expect(gnsBalanceAfter).eq(gnsBalanceBefore) + }) + + it('protects the curator against a rounding attack', async function () { + // Transfer a subgraph from L1 with only 1 wei GRT of curated signal + const { l1SubgraphId, subgraphMetadata, versionMetadata } = await defaultL1SubgraphParams() + const curatedTokens = toBN('1') + await transferMockSubgraphFromL1( + l1SubgraphId, + curatedTokens, + subgraphMetadata, + versionMetadata, + ) + // Prepare the rounding attack by setting up an indexer and collecting a lot of query fees + const curatorTokens = toGRT('10000') + const collectTokens = curatorTokens.mul(20) + await staking.connect(governor).setCurationPercentage(100000) + // Set up an indexer account with some stake + await grt.connect(governor).mint(attacker.address, toGRT('1000000')) + + await grt.connect(attacker).approve(staking.address, toGRT('1000000')) + await staking.connect(attacker).stake(toGRT('100000')) + const channelKey = deriveChannelKey() + // Allocate to the same deployment ID + await staking + .connect(attacker) + .allocateFrom( + attacker.address, + newSubgraph0.subgraphDeploymentID, + toGRT('100000'), + channelKey.address, + randomHexBytes(32), + await channelKey.generateProof(attacker.address), + ) + // Spoof some query fees, 10% of which will go to the Curation pool + await staking.connect(attacker).collect(collectTokens, channelKey.address) + + const callhookData = defaultAbiCoder.encode( + ['uint8', 'uint256', 'address'], + [toBN(1), l1SubgraphId, me.address], + ) + const curatorTokensBefore = await grt.balanceOf(me.address) + const gnsBalanceBefore = await grt.balanceOf(gns.address) + const tx = gatewayFinalizeTransfer( + l1GNSMock.address, + gns.address, + curatorTokens, + callhookData, + ) + await expect(tx) + .emit(gns, 'CuratorBalanceReturnedToBeneficiary') + .withArgs(l1SubgraphId, me.address, curatorTokens) + const curatorTokensAfter = await grt.balanceOf(me.address) + expect(curatorTokensAfter).eq(curatorTokensBefore.add(curatorTokens)) + const gnsBalanceAfter = await grt.balanceOf(gns.address) + // gatewayFinalizeTransfer will mint the tokens that are sent to the curator, + // so the GNS balance should be the same + expect(gnsBalanceAfter).eq(gnsBalanceBefore) + }) + + it('if a subgraph was deprecated after transfer, it returns the tokens to the beneficiary', async function () { + const l1GNSMockL2Alias = await helpers.getL2SignerFromL1(l1GNSMock.address) + // Eth for gas: + await helpers.setBalance(await l1GNSMockL2Alias.getAddress(), parseEther('1')) + + const { l1SubgraphId, curatedTokens, subgraphMetadata, versionMetadata } + = await defaultL1SubgraphParams() + await transferMockSubgraphFromL1( + l1SubgraphId, + curatedTokens, + subgraphMetadata, + versionMetadata, + ) + const l2SubgraphId = await gns.getAliasedL2SubgraphID(l1SubgraphId) + await gns.connect(me).deprecateSubgraph(l2SubgraphId) + + // SG was transferred, but is deprecated now! + + const callhookData = defaultAbiCoder.encode( + ['uint8', 'uint256', 'address'], + [toBN(1), l1SubgraphId, me.address], + ) + const curatorTokensBefore = await grt.balanceOf(me.address) + const gnsBalanceBefore = await grt.balanceOf(gns.address) + const tx = gatewayFinalizeTransfer(l1GNSMock.address, gns.address, toGRT('1'), callhookData) + await expect(tx) + .emit(gns, 'CuratorBalanceReturnedToBeneficiary') + .withArgs(l1SubgraphId, me.address, toGRT('1')) + const curatorTokensAfter = await grt.balanceOf(me.address) + expect(curatorTokensAfter).eq(curatorTokensBefore.add(toGRT('1'))) + const gnsBalanceAfter = await grt.balanceOf(gns.address) + // gatewayFinalizeTransfer will mint the tokens that are sent to the curator, + // so the GNS balance should be the same + expect(gnsBalanceAfter).eq(gnsBalanceBefore) + }) + }) + describe('onTokenTransfer with invalid codes', function () { + it('reverts', async function () { + // This should never really happen unless the Arbitrum bridge is compromised, + // so we test it anyway to ensure it's a well-defined behavior. + // code 2 does not exist: + const callhookData = defaultAbiCoder.encode( + ['uint8', 'uint256', 'address'], + [toBN(2), toBN(1337), me.address], + ) + const tx = gatewayFinalizeTransfer(l1GNSMock.address, gns.address, toGRT('1'), callhookData) + await expect(tx).revertedWith('INVALID_CODE') + }) + }) + describe('getAliasedL2SubgraphID', function () { + it('returns the L2 subgraph ID that is the L1 subgraph ID with an offset', async function () { + const l1SubgraphId = ethers.BigNumber.from( + '68799548758199140224151701590582019137924969401915573086349306511960790045480', + ) + const l2SubgraphId = await gns.getAliasedL2SubgraphID(l1SubgraphId) + const offset = ethers.BigNumber.from( + '0x1111000000000000000000000000000000000000000000000000000000001111', + ) + const base = ethers.constants.MaxUint256.add(1) + const expectedL2SubgraphId = l1SubgraphId.add(offset).mod(base) + expect(l2SubgraphId).eq(expectedL2SubgraphId) + }) + it('wraps around MAX_UINT256 in case of overflow', async function () { + const l1SubgraphId = ethers.constants.MaxUint256 + const l2SubgraphId = await gns.getAliasedL2SubgraphID(l1SubgraphId) + const offset = ethers.BigNumber.from( + '0x1111000000000000000000000000000000000000000000000000000000001111', + ) + const base = ethers.constants.MaxUint256.add(1) + const expectedL2SubgraphId = l1SubgraphId.add(offset).mod(base) + expect(l2SubgraphId).eq(expectedL2SubgraphId) + }) + }) +}) diff --git a/packages/contracts/test/unit/l2/l2GraphToken.test.ts b/packages/contracts/test/unit/l2/l2GraphToken.test.ts new file mode 100644 index 000000000..5ae4ef4d8 --- /dev/null +++ b/packages/contracts/test/unit/l2/l2GraphToken.test.ts @@ -0,0 +1,111 @@ +import hre from 'hardhat' +import { expect } from 'chai' + +import { L2GraphToken } from '../../../build/types/L2GraphToken' + +import { grtTests } from '../lib/graphTokenTests' +import { NetworkFixture } from '../lib/fixtures' +import { GraphNetworkContracts, toGRT } from '@graphprotocol/sdk' +import type { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers' + +describe('L2GraphToken', () => { + describe('Base GRT behavior', () => { + grtTests.bind(this)(true) + }) + describe('Extended L2 behavior', () => { + const graph = hre.graph() + let mockL2Gateway: SignerWithAddress + let mockL1GRT: SignerWithAddress + let governor: SignerWithAddress + let user: SignerWithAddress + + let contracts: GraphNetworkContracts + let fixture: NetworkFixture + let grt: L2GraphToken + + before(async function () { + [mockL1GRT, mockL2Gateway, user] = await graph.getTestAccounts() + ;({ governor } = await graph.getNamedAccounts()) + fixture = new NetworkFixture(graph.provider) + contracts = await fixture.load(governor, true) + grt = contracts.L2GraphToken as L2GraphToken + }) + + beforeEach(async function () { + await fixture.setUp() + }) + + afterEach(async function () { + await fixture.tearDown() + }) + + describe('setGateway', function () { + it('cannot be called by someone who is not the governor', async function () { + const tx = grt.connect(mockL2Gateway).setGateway(mockL2Gateway.address) + await expect(tx).revertedWith('Only Governor can call') + }) + it('sets the L2 Gateway address when called by the governor', async function () { + const tx = grt.connect(governor).setGateway(mockL2Gateway.address) + await expect(tx).emit(grt, 'GatewaySet').withArgs(mockL2Gateway.address) + expect(await grt.gateway()).eq(mockL2Gateway.address) + }) + }) + describe('setL1Address', function () { + it('cannot be called by someone who is not the governor', async function () { + const tx = grt.connect(mockL2Gateway).setL1Address(mockL1GRT.address) + await expect(tx).revertedWith('Only Governor can call') + }) + it('sets the L1 GRT address when called by the governor', async function () { + const tx = grt.connect(governor).setL1Address(mockL1GRT.address) + await expect(tx).emit(grt, 'L1AddressSet').withArgs(mockL1GRT.address) + expect(await grt.l1Address()).eq(mockL1GRT.address) + }) + }) + describe('bridge minting and burning', function () { + beforeEach(async function () { + // Configure the l1Address and gateway + await grt.connect(governor).setL1Address(mockL1GRT.address) + await grt.connect(governor).setGateway(mockL2Gateway.address) + }) + describe('bridgeMint', function () { + it('cannot be called by someone who is not the gateway', async function () { + const tx = grt.connect(governor).bridgeMint(user.address, toGRT('100')) + await expect(tx).revertedWith('NOT_GATEWAY') + }) + it('mints GRT into a destination account', async function () { + const tx = grt.connect(mockL2Gateway).bridgeMint(user.address, toGRT('100')) + await expect(tx).emit(grt, 'BridgeMinted').withArgs(user.address, toGRT('100')) + expect(await grt.balanceOf(user.address)).eq(toGRT('100')) + }) + }) + describe('bridgeBurn', function () { + it('cannot be called by someone who is not the gateway', async function () { + const tx = grt.connect(governor).bridgeBurn(user.address, toGRT('100')) + await expect(tx).revertedWith('NOT_GATEWAY') + }) + it('requires approval for burning', async function () { + await grt.connect(mockL2Gateway).bridgeMint(user.address, toGRT('100')) + const tx = grt.connect(mockL2Gateway).bridgeBurn(user.address, toGRT('20')) + await expect(tx).revertedWith('ERC20: burn amount exceeds allowance') + }) + it('fails if the user does not have enough funds', async function () { + await grt.connect(mockL2Gateway).bridgeMint(user.address, toGRT('10')) + await grt.connect(user).approve(mockL2Gateway.address, toGRT('20')) + const tx = grt.connect(mockL2Gateway).bridgeBurn(user.address, toGRT('20')) + await expect(tx).revertedWith('ERC20: burn amount exceeds balance') + }) + it('burns GRT from an account when approved', async function () { + await grt.connect(mockL2Gateway).bridgeMint(user.address, toGRT('100')) + await grt.connect(user).approve(mockL2Gateway.address, toGRT('20')) + const tx = grt.connect(mockL2Gateway).bridgeBurn(user.address, toGRT('20')) + await expect(tx).emit(grt, 'BridgeBurned').withArgs(user.address, toGRT('20')) + expect(await grt.balanceOf(user.address)).eq(toGRT('80')) + }) + }) + it('does not allow the bridge to mint as a regular minter', async function () { + const tx = grt.connect(mockL2Gateway).mint(user.address, toGRT('100')) + await expect(tx).revertedWith('Only minter can call') + }) + }) + }) +}) diff --git a/packages/contracts/test/unit/l2/l2GraphTokenGateway.test.ts b/packages/contracts/test/unit/l2/l2GraphTokenGateway.test.ts new file mode 100644 index 000000000..a80c5da26 --- /dev/null +++ b/packages/contracts/test/unit/l2/l2GraphTokenGateway.test.ts @@ -0,0 +1,441 @@ +import hre from 'hardhat' +import { expect, use } from 'chai' +import { constants, ContractTransaction, Signer, utils, Wallet } from 'ethers' + +import { L2GraphToken } from '../../../build/types/L2GraphToken' +import { L2GraphTokenGateway } from '../../../build/types/L2GraphTokenGateway' +import { CallhookReceiverMock } from '../../../build/types/CallhookReceiverMock' + +import { NetworkFixture } from '../lib/fixtures' + +import { FakeContract, smock } from '@defi-wonderland/smock' + +use(smock.matchers) + +import { RewardsManager } from '../../../build/types/RewardsManager' +import { deploy, DeployType, GraphNetworkContracts, helpers, toBN, toGRT } from '@graphprotocol/sdk' +import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers' +import { GraphToken, L1GraphTokenGateway } from '../../../build/types' + +const { AddressZero } = constants + +describe('L2GraphTokenGateway', () => { + const graph = hre.graph() + let me: SignerWithAddress + let governor: SignerWithAddress + let tokenSender: SignerWithAddress + let l1Receiver: SignerWithAddress + let l2Receiver: SignerWithAddress + let pauseGuardian: SignerWithAddress + let fixture: NetworkFixture + let arbSysMock: FakeContract + + let fixtureContracts: GraphNetworkContracts + let l1MockContracts: GraphNetworkContracts + let l1GRTMock: GraphToken + let l1GRTGatewayMock: L1GraphTokenGateway + let routerMock: Wallet + + let grt: L2GraphToken + let l2GraphTokenGateway: L2GraphTokenGateway + let callhookReceiverMock: CallhookReceiverMock + let rewardsManager: RewardsManager + + const senderTokens = toGRT('1000') + const defaultData = '0x' + const defaultDataWithNotEmptyCallHookData = utils.defaultAbiCoder.encode( + ['uint256', 'uint256'], + [toBN('1337'), toBN('42')], + ) + + before(async function () { + [me, governor, tokenSender, l1Receiver, l2Receiver, pauseGuardian] + = await graph.getTestAccounts() + + fixture = new NetworkFixture(graph.provider) + + // Deploy L2 + fixtureContracts = await fixture.load(governor, true) + grt = fixtureContracts.GraphToken as L2GraphToken + l2GraphTokenGateway = fixtureContracts.L2GraphTokenGateway as L2GraphTokenGateway + rewardsManager = fixtureContracts.RewardsManager as RewardsManager + + // Deploy L2 arbitrum bridge + ;({ routerMock } = await fixture.loadL2ArbitrumBridge(governor)) + + // Deploy L1 mock + l1MockContracts = await fixture.loadMock(false) + l1GRTMock = l1MockContracts.GraphToken as GraphToken + l1GRTGatewayMock = l1MockContracts.L1GraphTokenGateway as L1GraphTokenGateway + + callhookReceiverMock = ( + await deploy(DeployType.Deploy, governor, { + name: 'CallhookReceiverMock', + }) + ).contract as CallhookReceiverMock + + // Give some funds to the token sender and router mock + await grt.connect(governor).mint(tokenSender.address, senderTokens) + await helpers.setBalance(routerMock.address, utils.parseEther('1')) + }) + + beforeEach(async function () { + await fixture.setUp() + // Thanks to Livepeer: https://github.com/livepeer/arbitrum-lpt-bridge/blob/main/test/unit/L2/l2LPTGateway.test.ts#L86 + arbSysMock = await smock.fake('ArbSys', { + address: '0x0000000000000000000000000000000000000064', + }) + arbSysMock.sendTxToL1.returns(1) + }) + + afterEach(async function () { + await fixture.tearDown() + }) + + context('> immediately after deploy', function () { + describe('calculateL2TokenAddress', function () { + it('should return the zero address', async function () { + expect(await l2GraphTokenGateway.calculateL2TokenAddress(grt.address)).eq(AddressZero) + }) + }) + + describe('outboundTransfer', function () { + it('reverts because it is paused', async function () { + const tx = l2GraphTokenGateway + .connect(tokenSender)['outboundTransfer(address,address,uint256,bytes)']( + grt.address, + l1Receiver.address, + toGRT('10'), + defaultData, + ) + await expect(tx).revertedWith('Paused (contract)') + }) + }) + + describe('finalizeInboundTransfer', function () { + it('revert because it is paused', async function () { + const tx = l2GraphTokenGateway + .connect(tokenSender) + .finalizeInboundTransfer( + grt.address, + tokenSender.address, + l1Receiver.address, + toGRT('10'), + defaultData, + ) + await expect(tx).revertedWith('Paused (contract)') + }) + }) + + describe('setL2Router', function () { + it('is not callable by addreses that are not the governor', async function () { + const tx = l2GraphTokenGateway.connect(tokenSender).setL2Router(routerMock.address) + await expect(tx).revertedWith('Only Controller governor') + }) + it('sets router address', async function () { + const tx = l2GraphTokenGateway.connect(governor).setL2Router(routerMock.address) + await expect(tx).emit(l2GraphTokenGateway, 'L2RouterSet').withArgs(routerMock.address) + expect(await l2GraphTokenGateway.l2Router()).eq(routerMock.address) + }) + }) + + describe('setL1TokenAddress', function () { + it('is not callable by addreses that are not the governor', async function () { + const tx = l2GraphTokenGateway.connect(tokenSender).setL1TokenAddress(l1GRTMock.address) + await expect(tx).revertedWith('Only Controller governor') + }) + it('sets l2GRT', async function () { + const tx = l2GraphTokenGateway.connect(governor).setL1TokenAddress(l1GRTMock.address) + await expect(tx).emit(l2GraphTokenGateway, 'L1TokenAddressSet').withArgs(l1GRTMock.address) + expect(await l2GraphTokenGateway.l1GRT()).eq(l1GRTMock.address) + }) + }) + + describe('setL1CounterpartAddress', function () { + it('is not callable by addreses that are not the governor', async function () { + const tx = l2GraphTokenGateway + .connect(tokenSender) + .setL1CounterpartAddress(l1GRTGatewayMock.address) + await expect(tx).revertedWith('Only Controller governor') + }) + it('sets L1Counterpart', async function () { + const tx = l2GraphTokenGateway + .connect(governor) + .setL1CounterpartAddress(l1GRTGatewayMock.address) + await expect(tx) + .emit(l2GraphTokenGateway, 'L1CounterpartAddressSet') + .withArgs(l1GRTGatewayMock.address) + expect(await l2GraphTokenGateway.l1Counterpart()).eq(l1GRTGatewayMock.address) + }) + }) + describe('Pausable behavior', () => { + it('cannot be paused or unpaused by someone other than governor or pauseGuardian', async () => { + let tx = l2GraphTokenGateway.connect(tokenSender).setPaused(false) + await expect(tx).revertedWith('Only Governor or Guardian') + tx = l2GraphTokenGateway.connect(tokenSender).setPaused(true) + await expect(tx).revertedWith('Only Governor or Guardian') + }) + it('cannot be paused if some state variables are not set', async function () { + let tx = l2GraphTokenGateway.connect(governor).setPaused(false) + await expect(tx).revertedWith('L2_ROUTER_NOT_SET') + await l2GraphTokenGateway.connect(governor).setL2Router(routerMock.address) + tx = l2GraphTokenGateway.connect(governor).setPaused(false) + await expect(tx).revertedWith('L1_COUNTERPART_NOT_SET') + await l2GraphTokenGateway + .connect(governor) + .setL1CounterpartAddress(l1GRTGatewayMock.address) + tx = l2GraphTokenGateway.connect(governor).setPaused(false) + await expect(tx).revertedWith('L1_GRT_NOT_SET') + }) + it('can be paused and unpaused by the governor', async function () { + await fixture.configureL2Bridge(governor, fixtureContracts, l1MockContracts) + let tx = l2GraphTokenGateway.connect(governor).setPaused(true) + await expect(tx).emit(l2GraphTokenGateway, 'PauseChanged').withArgs(true) + expect(await l2GraphTokenGateway.paused()).eq(true) + tx = l2GraphTokenGateway.connect(governor).setPaused(false) + await expect(tx).emit(l2GraphTokenGateway, 'PauseChanged').withArgs(false) + expect(await l2GraphTokenGateway.paused()).eq(false) + }) + describe('setPauseGuardian', function () { + it('cannot be called by someone other than governor', async function () { + const tx = l2GraphTokenGateway + .connect(tokenSender) + .setPauseGuardian(pauseGuardian.address) + await expect(tx).revertedWith('Only Controller governor') + }) + it('sets a new pause guardian', async function () { + const currentPauseGuardian = await l2GraphTokenGateway.pauseGuardian() + const tx = l2GraphTokenGateway.connect(governor).setPauseGuardian(pauseGuardian.address) + await expect(tx) + .emit(l2GraphTokenGateway, 'NewPauseGuardian') + .withArgs(currentPauseGuardian, pauseGuardian.address) + }) + it('allows a pause guardian to pause and unpause', async function () { + await fixture.configureL2Bridge(governor, fixtureContracts, l1MockContracts) + await l2GraphTokenGateway.connect(governor).setPauseGuardian(pauseGuardian.address) + let tx = l2GraphTokenGateway.connect(pauseGuardian).setPaused(true) + await expect(tx).emit(l2GraphTokenGateway, 'PauseChanged').withArgs(true) + expect(await l2GraphTokenGateway.paused()).eq(true) + tx = l2GraphTokenGateway.connect(pauseGuardian).setPaused(false) + await expect(tx).emit(l2GraphTokenGateway, 'PauseChanged').withArgs(false) + expect(await l2GraphTokenGateway.paused()).eq(false) + }) + }) + }) + }) + + context('> after configuring and unpausing', function () { + const testValidOutboundTransfer = async function (signer: Signer, data: string) { + const tx = l2GraphTokenGateway + .connect(signer)['outboundTransfer(address,address,uint256,bytes)']( + l1GRTMock.address, + l1Receiver.address, + toGRT('10'), + data, + ) + const expectedId = 1 + await expect(tx) + .emit(l2GraphTokenGateway, 'WithdrawalInitiated') + .withArgs( + l1GRTMock.address, + tokenSender.address, + l1Receiver.address, + expectedId, + 0, + toGRT('10'), + ) + + // Should use the L1 Gateway's interface, but both come from ITokenGateway + const calldata = l2GraphTokenGateway.interface.encodeFunctionData('finalizeInboundTransfer', [ + l1GRTMock.address, + tokenSender.address, + l1Receiver.address, + toGRT('10'), + utils.defaultAbiCoder.encode(['uint256', 'bytes'], [0, []]), + ]) + await expect(tx) + .emit(l2GraphTokenGateway, 'TxToL1') + .withArgs(tokenSender.address, l1GRTGatewayMock.address, 1, calldata) + + // For some reason the call count doesn't work properly, + // and each function call is counted 12 times. + // Possibly related to https://github.com/defi-wonderland/smock/issues/85 ? + // expect(arbSysMock.sendTxToL1).to.have.been.calledOnce + expect(arbSysMock.sendTxToL1).to.have.been.calledWith(l1GRTGatewayMock.address, calldata) + const senderBalance = await grt.balanceOf(tokenSender.address) + expect(senderBalance).eq(toGRT('990')) + } + before(async function () { + await fixture.configureL2Bridge(governor, fixtureContracts, l1MockContracts) + }) + + describe('calculateL2TokenAddress', function () { + it('returns the L2 token address', async function () { + expect(await l2GraphTokenGateway.calculateL2TokenAddress(l1GRTMock.address)).eq(grt.address) + }) + it('returns the zero address if the input is any other address', async function () { + expect(await l2GraphTokenGateway.calculateL2TokenAddress(tokenSender.address)).eq( + AddressZero, + ) + }) + }) + + describe('outboundTransfer', function () { + it('reverts when called with the wrong token address', async function () { + const tx = l2GraphTokenGateway + .connect(tokenSender)['outboundTransfer(address,address,uint256,bytes)']( + tokenSender.address, + l1Receiver.address, + toGRT('10'), + defaultData, + ) + await expect(tx).revertedWith('TOKEN_NOT_GRT') + }) + it('burns tokens and triggers an L1 call', async function () { + await grt.connect(tokenSender).approve(l2GraphTokenGateway.address, toGRT('10')) + await testValidOutboundTransfer(tokenSender, defaultData) + }) + it('decodes the sender address from messages sent by the router', async function () { + await grt.connect(tokenSender).approve(l2GraphTokenGateway.address, toGRT('10')) + const routerEncodedData = utils.defaultAbiCoder.encode( + ['address', 'bytes'], + [tokenSender.address, defaultData], + ) + await testValidOutboundTransfer(routerMock, routerEncodedData) + }) + it('reverts when called with nonempty calldata', async function () { + await grt.connect(tokenSender).approve(l2GraphTokenGateway.address, toGRT('10')) + const tx = l2GraphTokenGateway + .connect(tokenSender)['outboundTransfer(address,address,uint256,bytes)']( + l1GRTMock.address, + l1Receiver.address, + toGRT('10'), + defaultDataWithNotEmptyCallHookData, + ) + await expect(tx).revertedWith('CALL_HOOK_DATA_NOT_ALLOWED') + }) + it('reverts when the sender does not have enough GRT', async function () { + await grt.connect(tokenSender).approve(l2GraphTokenGateway.address, toGRT('1001')) + const tx = l2GraphTokenGateway + .connect(tokenSender)['outboundTransfer(address,address,uint256,bytes)']( + l1GRTMock.address, + l1Receiver.address, + toGRT('1001'), + defaultData, + ) + await expect(tx).revertedWith('ERC20: burn amount exceeds balance') + }) + }) + + describe('finalizeInboundTransfer', function () { + const testValidFinalizeTransfer = async function ( + data: string, + to?: string, + ): Promise { + to = to ?? l2Receiver.address + const l1GRTGatewayMockL2Alias = await helpers.getL2SignerFromL1(l1GRTGatewayMock.address) + await me.sendTransaction({ + to: await l1GRTGatewayMockL2Alias.getAddress(), + value: utils.parseUnits('1', 'ether'), + }) + const tx = l2GraphTokenGateway + .connect(l1GRTGatewayMockL2Alias) + .finalizeInboundTransfer(l1GRTMock.address, tokenSender.address, to, toGRT('10'), data) + await expect(tx) + .emit(l2GraphTokenGateway, 'DepositFinalized') + .withArgs(l1GRTMock.address, tokenSender.address, to, toGRT('10')) + + await expect(tx).emit(grt, 'BridgeMinted').withArgs(to, toGRT('10')) + + // Unchanged + const senderBalance = await grt.balanceOf(tokenSender.address) + expect(senderBalance).eq(toGRT('1000')) + // 10 newly minted GRT + const receiverBalance = await grt.balanceOf(to) + expect(receiverBalance).eq(toGRT('10')) + return tx + } + it('reverts when called by an account that is not the gateway', async function () { + const tx = l2GraphTokenGateway + .connect(tokenSender) + .finalizeInboundTransfer( + l1GRTMock.address, + tokenSender.address, + l2Receiver.address, + toGRT('10'), + defaultData, + ) + await expect(tx).revertedWith('ONLY_COUNTERPART_GATEWAY') + }) + it('reverts when called by an account that is the gateway but without the L2 alias', async function () { + const impersonatedGateway = await helpers.impersonateAccount(l1GRTGatewayMock.address) + const tx = l2GraphTokenGateway + .connect(impersonatedGateway) + .finalizeInboundTransfer( + l1GRTMock.address, + tokenSender.address, + l2Receiver.address, + toGRT('10'), + defaultData, + ) + await expect(tx).revertedWith('ONLY_COUNTERPART_GATEWAY') + }) + it('mints and sends tokens when called by the aliased gateway', async function () { + await testValidFinalizeTransfer(defaultData) + }) + it('calls a callhook if the transfer includes calldata', async function () { + const tx = await testValidFinalizeTransfer( + defaultDataWithNotEmptyCallHookData, + callhookReceiverMock.address, + ) + // Emitted by the callhook: + await expect(tx) + .emit(callhookReceiverMock, 'TransferReceived') + .withArgs(tokenSender.address, toGRT('10'), toBN('1337'), toBN('42')) + }) + it('reverts if a callhook reverts', async function () { + // The 0 will make the callhook revert (see CallhookReceiverMock.sol) + const callHookData = utils.defaultAbiCoder.encode( + ['uint256', 'uint256'], + [toBN('0'), toBN('42')], + ) + const l1GRTGatewayMockL2Alias = await helpers.getL2SignerFromL1(l1GRTGatewayMock.address) + await me.sendTransaction({ + to: await l1GRTGatewayMockL2Alias.getAddress(), + value: utils.parseUnits('1', 'ether'), + }) + const tx = l2GraphTokenGateway + .connect(l1GRTGatewayMockL2Alias) + .finalizeInboundTransfer( + l1GRTMock.address, + tokenSender.address, + callhookReceiverMock.address, + toGRT('10'), + callHookData, + ) + await expect(tx).revertedWith('FOO_IS_ZERO') + }) + it('reverts if trying to call a callhook in a contract that does not implement onTokenTransfer', async function () { + const callHookData = utils.defaultAbiCoder.encode(['uint256'], [toBN('0')]) + const l1GRTGatewayMockL2Alias = await helpers.getL2SignerFromL1(l1GRTGatewayMock.address) + await me.sendTransaction({ + to: await l1GRTGatewayMockL2Alias.getAddress(), + value: utils.parseUnits('1', 'ether'), + }) + // RewardsManager does not implement onTokenTransfer, so this will fail + const tx = l2GraphTokenGateway + .connect(l1GRTGatewayMockL2Alias) + .finalizeInboundTransfer( + l1GRTMock.address, + tokenSender.address, + rewardsManager.address, + toGRT('10'), + callHookData, + ) + await expect(tx).revertedWith( + 'function selector was not recognized and there\'s no fallback function', + ) + }) + }) + }) +}) diff --git a/packages/contracts/test/unit/l2/l2Staking.test.ts b/packages/contracts/test/unit/l2/l2Staking.test.ts new file mode 100644 index 000000000..7728c2f94 --- /dev/null +++ b/packages/contracts/test/unit/l2/l2Staking.test.ts @@ -0,0 +1,441 @@ +import hre from 'hardhat' +import { expect } from 'chai' +import { BigNumber, ContractTransaction, ethers } from 'ethers' +import { defaultAbiCoder, parseEther } from 'ethers/lib/utils' + +import { NetworkFixture } from '../lib/fixtures' + +import { IL2Staking } from '../../../build/types/IL2Staking' +import { L2GraphTokenGateway } from '../../../build/types/L2GraphTokenGateway' +import { GraphToken } from '../../../build/types/GraphToken' +import { + deriveChannelKey, + GraphNetworkContracts, + helpers, + randomHexBytes, + toBN, + toGRT, +} from '@graphprotocol/sdk' +import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers' +import { EpochManager, L1GNS, L1GraphTokenGateway, L1Staking } from '../../../build/types' + +const { AddressZero } = ethers.constants + +const subgraphDeploymentID = randomHexBytes() +const channelKey = deriveChannelKey() +const allocationID = channelKey.address +const metadata = randomHexBytes(32) + +describe('L2Staking', () => { + const graph = hre.graph() + let me: SignerWithAddress + let other: SignerWithAddress + let governor: SignerWithAddress + + let fixture: NetworkFixture + + let fixtureContracts: GraphNetworkContracts + let l1MockContracts: GraphNetworkContracts + let l1GRTMock: GraphToken + let l1StakingMock: L1Staking + let l1GNSMock: L1GNS + let l1GRTGatewayMock: L1GraphTokenGateway + let l2GraphTokenGateway: L2GraphTokenGateway + let staking: IL2Staking + let grt: GraphToken + + const tokens10k = toGRT('10000') + const tokens100k = toGRT('100000') + const tokens1m = toGRT('1000000') + + // Allocate with test values + const allocate = async (tokens: BigNumber) => { + return staking + .connect(me) + .allocateFrom( + me.address, + subgraphDeploymentID, + tokens, + allocationID, + metadata, + await channelKey.generateProof(me.address), + ) + } + + const gatewayFinalizeTransfer = async function ( + from: string, + to: string, + amount: BigNumber, + callhookData: string, + ): Promise { + const mockL1GatewayL2Alias = await helpers.getL2SignerFromL1(l1GRTGatewayMock.address) + // Eth for gas: + await helpers.setBalance(await mockL1GatewayL2Alias.getAddress(), parseEther('1')) + + const tx = l2GraphTokenGateway + .connect(mockL1GatewayL2Alias) + .finalizeInboundTransfer(l1GRTMock.address, from, to, amount, callhookData) + return tx + } + + before(async function () { + [me, other] = await graph.getTestAccounts() + ;({ governor } = await graph.getNamedAccounts()) + + fixture = new NetworkFixture(graph.provider) + + // Deploy L2 + fixtureContracts = await fixture.load(governor, true) + grt = fixtureContracts.GraphToken as GraphToken + staking = fixtureContracts.Staking as IL2Staking + l2GraphTokenGateway = fixtureContracts.L2GraphTokenGateway as L2GraphTokenGateway + + // Deploy L1 mock + l1MockContracts = await fixture.loadMock(false) + l1GRTMock = l1MockContracts.GraphToken as GraphToken + l1StakingMock = l1MockContracts.L1Staking as L1Staking + l1GNSMock = l1MockContracts.L1GNS as L1GNS + l1GRTGatewayMock = l1MockContracts.L1GraphTokenGateway as L1GraphTokenGateway + + // Deploy L2 arbitrum bridge + await fixture.loadL2ArbitrumBridge(governor) + + // Configure L2 bridge + await fixture.configureL2Bridge(governor, fixtureContracts, l1MockContracts) + + await grt.connect(governor).mint(me.address, tokens1m) + await grt.connect(me).approve(staking.address, tokens1m) + await grt.connect(governor).mint(other.address, tokens1m) + await grt.connect(other).approve(staking.address, tokens1m) + }) + + beforeEach(async function () { + await fixture.setUp() + }) + + afterEach(async function () { + await fixture.tearDown() + }) + + describe('receive()', function () { + it('should not allow receiving ETH', async function () { + const tx = me.sendTransaction({ + to: staking.address, + value: parseEther('1'), + }) + await expect(tx).revertedWith('RECEIVE_ETH_NOT_ALLOWED') + }) + }) + describe('receiving indexer stake from L1 (onTokenTransfer)', function () { + it('cannot be called by someone other than the L2GraphTokenGateway', async function () { + const functionData = defaultAbiCoder.encode(['tuple(address)'], [[me.address]]) + + const callhookData = defaultAbiCoder.encode( + ['uint8', 'bytes'], + [toBN(0), functionData], // code = 1 means RECEIVE_INDEXER_CODE + ) + const tx = staking.connect(me).onTokenTransfer(l1GNSMock.address, tokens100k, callhookData) + await expect(tx).revertedWith('ONLY_GATEWAY') + }) + it('rejects calls if the L1 sender is not the L1Staking', async function () { + const functionData = defaultAbiCoder.encode(['tuple(address)'], [[me.address]]) + + const callhookData = defaultAbiCoder.encode( + ['uint8', 'bytes'], + [toBN(0), functionData], // code = 1 means RECEIVE_INDEXER_CODE + ) + const tx = gatewayFinalizeTransfer(me.address, staking.address, tokens100k, callhookData) + + await expect(tx).revertedWith('ONLY_L1_STAKING_THROUGH_BRIDGE') + }) + it('adds stake to a new indexer', async function () { + const functionData = defaultAbiCoder.encode(['tuple(address)'], [[me.address]]) + + const callhookData = defaultAbiCoder.encode( + ['uint8', 'bytes'], + [toBN(0), functionData], // code = 1 means RECEIVE_INDEXER_CODE + ) + const tx = gatewayFinalizeTransfer( + l1StakingMock.address, + staking.address, + tokens100k, + callhookData, + ) + + await expect(tx) + .emit(l2GraphTokenGateway, 'DepositFinalized') + .withArgs(l1GRTMock.address, l1StakingMock.address, staking.address, tokens100k) + await expect(tx).emit(staking, 'StakeDeposited').withArgs(me.address, tokens100k) + expect(await staking.getIndexerStakedTokens(me.address)).to.equal(tokens100k) + const delegationPool = await staking.delegationPools(me.address) + expect(delegationPool.indexingRewardCut).eq(toBN(1000000)) // 1 in PPM + expect(delegationPool.queryFeeCut).eq(toBN(1000000)) // 1 in PPM + }) + it('adds stake to an existing indexer that was already transferred', async function () { + const functionData = defaultAbiCoder.encode(['tuple(address)'], [[me.address]]) + + const callhookData = defaultAbiCoder.encode( + ['uint8', 'bytes'], + [toBN(0), functionData], // code = 1 means RECEIVE_INDEXER_CODE + ) + await gatewayFinalizeTransfer( + l1StakingMock.address, + staking.address, + tokens100k, + callhookData, + ) + const tx = gatewayFinalizeTransfer( + l1StakingMock.address, + staking.address, + tokens100k, + callhookData, + ) + + await expect(tx) + .emit(l2GraphTokenGateway, 'DepositFinalized') + .withArgs(l1GRTMock.address, l1StakingMock.address, staking.address, tokens100k) + await expect(tx).emit(staking, 'StakeDeposited').withArgs(me.address, tokens100k) + expect(await staking.getIndexerStakedTokens(me.address)).to.equal(tokens100k.add(tokens100k)) + }) + it('adds stake to an existing indexer that was staked in L2 (without changing delegation params)', async function () { + const functionData = defaultAbiCoder.encode(['tuple(address)'], [[me.address]]) + + const callhookData = defaultAbiCoder.encode( + ['uint8', 'bytes'], + [toBN(0), functionData], // code = 1 means RECEIVE_INDEXER_CODE + ) + await staking.connect(me).stake(tokens100k) + await staking.connect(me).setDelegationParameters(1000, 1000, 1000) + const tx = gatewayFinalizeTransfer( + l1StakingMock.address, + staking.address, + tokens100k, + callhookData, + ) + + await expect(tx) + .emit(l2GraphTokenGateway, 'DepositFinalized') + .withArgs(l1GRTMock.address, l1StakingMock.address, staking.address, tokens100k) + await expect(tx).emit(staking, 'StakeDeposited').withArgs(me.address, tokens100k) + expect(await staking.getIndexerStakedTokens(me.address)).to.equal(tokens100k.add(tokens100k)) + const delegationPool = await staking.delegationPools(me.address) + expect(delegationPool.indexingRewardCut).eq(toBN(1000)) + expect(delegationPool.queryFeeCut).eq(toBN(1000)) + }) + }) + + describe('receiving delegation from L1 (onTokenTransfer)', function () { + it('adds delegation for a new delegator', async function () { + await staking.connect(me).stake(tokens100k) + + const functionData = defaultAbiCoder.encode( + ['tuple(address,address)'], + [[me.address, other.address]], + ) + + const callhookData = defaultAbiCoder.encode( + ['uint8', 'bytes'], + [toBN(1), functionData], // code = 1 means RECEIVE_DELEGATION_CODE + ) + const tx = gatewayFinalizeTransfer( + l1StakingMock.address, + staking.address, + tokens10k, + callhookData, + ) + + await expect(tx) + .emit(l2GraphTokenGateway, 'DepositFinalized') + .withArgs(l1GRTMock.address, l1StakingMock.address, staking.address, tokens10k) + const expectedShares = tokens10k + await expect(tx) + .emit(staking, 'StakeDelegated') + .withArgs(me.address, other.address, tokens10k, expectedShares) + const delegation = await staking.getDelegation(me.address, other.address) + expect(delegation.shares).to.equal(expectedShares) + }) + it('adds delegation for an existing delegator', async function () { + await staking.connect(me).stake(tokens100k) + await staking.connect(other).delegate(me.address, tokens10k) + + const functionData = defaultAbiCoder.encode( + ['tuple(address,address)'], + [[me.address, other.address]], + ) + + const callhookData = defaultAbiCoder.encode( + ['uint8', 'bytes'], + [toBN(1), functionData], // code = 1 means RECEIVE_DELEGATION_CODE + ) + const tx = gatewayFinalizeTransfer( + l1StakingMock.address, + staking.address, + tokens10k, + callhookData, + ) + + await expect(tx) + .emit(l2GraphTokenGateway, 'DepositFinalized') + .withArgs(l1GRTMock.address, l1StakingMock.address, staking.address, tokens10k) + const expectedNewShares = tokens10k + const expectedTotalShares = tokens10k.mul(2) + await expect(tx) + .emit(staking, 'StakeDelegated') + .withArgs(me.address, other.address, tokens10k, expectedNewShares) + const delegation = await staking.getDelegation(me.address, other.address) + expect(delegation.shares).to.equal(expectedTotalShares) + }) + it('returns delegation to the delegator if it would produce no shares', async function () { + await fixtureContracts.RewardsManager.connect(governor).setIssuancePerBlock(toGRT('114')) + + await staking.connect(me).stake(tokens100k) + // Initialize the delegation pool to allow delegating less than 1 GRT + await staking.connect(me).delegate(me.address, tokens10k) + + await staking.connect(me).setDelegationParameters(1000, 1000, 1000) + await grt.connect(me).approve(fixtureContracts.Curation.address, tokens10k) + await fixtureContracts.Curation.connect(me).mint(subgraphDeploymentID, tokens10k, 0) + + await allocate(tokens100k) + await helpers.mineEpoch(fixtureContracts.EpochManager as EpochManager) + await helpers.mineEpoch(fixtureContracts.EpochManager as EpochManager) + await staking.connect(me).closeAllocation(allocationID, randomHexBytes(32)) + // Now there are some rewards sent to delegation pool, so 1 weiGRT is less than 1 share + + const functionData = defaultAbiCoder.encode( + ['tuple(address,address)'], + [[me.address, other.address]], + ) + + const callhookData = defaultAbiCoder.encode( + ['uint8', 'bytes'], + [toBN(1), functionData], // code = 1 means RECEIVE_DELEGATION_CODE + ) + const delegatorGRTBalanceBefore = await grt.balanceOf(other.address) + const tx = gatewayFinalizeTransfer( + l1StakingMock.address, + staking.address, + toBN(1), // Less than 1 share! + callhookData, + ) + + await expect(tx) + .emit(l2GraphTokenGateway, 'DepositFinalized') + .withArgs(l1GRTMock.address, l1StakingMock.address, staking.address, toBN(1)) + const delegation = await staking.getDelegation(me.address, other.address) + await expect(tx) + .emit(staking, 'TransferredDelegationReturnedToDelegator') + .withArgs(me.address, other.address, toBN(1)) + + expect(delegation.shares).to.equal(0) + const delegatorGRTBalanceAfter = await grt.balanceOf(other.address) + expect(delegatorGRTBalanceAfter.sub(delegatorGRTBalanceBefore)).to.equal(toBN(1)) + }) + it('returns delegation to the delegator if it initializes the pool with less than the minimum delegation', async function () { + await fixtureContracts.RewardsManager.connect(governor).setIssuancePerBlock(toGRT('114')) + + await staking.connect(me).stake(tokens100k) + + await staking.connect(me).setDelegationParameters(1000, 1000, 1000) + await grt.connect(me).approve(fixtureContracts.Curation.address, tokens10k) + await fixtureContracts.Curation.connect(me).mint(subgraphDeploymentID, tokens10k, 0) + + await allocate(tokens100k) + await helpers.mineEpoch(fixtureContracts.EpochManager as EpochManager, 2) + await staking.connect(me).closeAllocation(allocationID, randomHexBytes(32)) + // Now there are some rewards sent to delegation pool, so 1 weiGRT is less than 1 share + + const functionData = defaultAbiCoder.encode( + ['tuple(address,address)'], + [[me.address, other.address]], + ) + + const callhookData = defaultAbiCoder.encode( + ['uint8', 'bytes'], + [toBN(1), functionData], // code = 1 means RECEIVE_DELEGATION_CODE + ) + const delegatorGRTBalanceBefore = await grt.balanceOf(other.address) + const tx = gatewayFinalizeTransfer( + l1StakingMock.address, + staking.address, + toGRT('0.1'), // Less than 1 GRT! + callhookData, + ) + + await expect(tx) + .emit(l2GraphTokenGateway, 'DepositFinalized') + .withArgs(l1GRTMock.address, l1StakingMock.address, staking.address, toGRT('0.1')) + const delegation = await staking.getDelegation(me.address, other.address) + await expect(tx) + .emit(staking, 'TransferredDelegationReturnedToDelegator') + .withArgs(me.address, other.address, toGRT('0.1')) + + expect(delegation.shares).to.equal(0) + const delegatorGRTBalanceAfter = await grt.balanceOf(other.address) + expect(delegatorGRTBalanceAfter.sub(delegatorGRTBalanceBefore)).to.equal(toGRT('0.1')) + }) + it('returns delegation under the minimum if the pool is initialized', async function () { + await staking.connect(me).stake(tokens100k) + + // Initialize the delegation pool to allow delegating less than 1 GRT + await staking.connect(me).delegate(me.address, tokens10k) + + const functionData = defaultAbiCoder.encode( + ['tuple(address,address)'], + [[me.address, other.address]], + ) + + const callhookData = defaultAbiCoder.encode( + ['uint8', 'bytes'], + [toBN(1), functionData], // code = 1 means RECEIVE_DELEGATION_CODE + ) + const delegatorGRTBalanceBefore = await grt.balanceOf(other.address) + const tx = gatewayFinalizeTransfer( + l1StakingMock.address, + staking.address, + toGRT('0.1'), + callhookData, + ) + + await expect(tx) + .emit(l2GraphTokenGateway, 'DepositFinalized') + .withArgs(l1GRTMock.address, l1StakingMock.address, staking.address, toGRT('0.1')) + + const delegation = await staking.getDelegation(me.address, other.address) + await expect(tx) + .emit(staking, 'TransferredDelegationReturnedToDelegator') + .withArgs(me.address, other.address, toGRT('0.1')) + + expect(delegation.shares).to.equal(0) + const delegatorGRTBalanceAfter = await grt.balanceOf(other.address) + expect(delegatorGRTBalanceAfter.sub(delegatorGRTBalanceBefore)).to.equal(toGRT('0.1')) + }) + }) + describe('onTokenTransfer with invalid messages', function () { + it('reverts if the code is invalid', async function () { + // This should never really happen unless the Arbitrum bridge is compromised, + // so we test it anyway to ensure it's a well-defined behavior. + // code 2 does not exist: + const callhookData = defaultAbiCoder.encode(['uint8', 'bytes'], [toBN(2), '0x12345678']) + const tx = gatewayFinalizeTransfer( + l1StakingMock.address, + staking.address, + toGRT('1'), + callhookData, + ) + await expect(tx).revertedWith('INVALID_CODE') + }) + it('reverts if the message encoding is invalid', async function () { + // This should never really happen unless the Arbitrum bridge is compromised, + // so we test it anyway to ensure it's a well-defined behavior. + const callhookData = defaultAbiCoder.encode(['address', 'uint128'], [AddressZero, toBN(2)]) + const tx = gatewayFinalizeTransfer( + l1StakingMock.address, + staking.address, + toGRT('1'), + callhookData, + ) + await expect(tx).reverted // abi.decode will fail with no reason + }) + }) +}) diff --git a/packages/contracts/test/unit/lib/fixtures.ts b/packages/contracts/test/unit/lib/fixtures.ts new file mode 100644 index 000000000..f65ed5230 --- /dev/null +++ b/packages/contracts/test/unit/lib/fixtures.ts @@ -0,0 +1,150 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ +import { providers, Wallet } from 'ethers' + +import { Controller } from '../../../build/types/Controller' +import { DisputeManager } from '../../../build/types/DisputeManager' +import { EpochManager } from '../../../build/types/EpochManager' +import { GraphToken } from '../../../build/types/GraphToken' +import { Curation } from '../../../build/types/Curation' +import { L2Curation } from '../../../build/types/L2Curation' +import { L1GNS } from '../../../build/types/L1GNS' +import { L2GNS } from '../../../build/types/L2GNS' +import { IL1Staking } from '../../../build/types/IL1Staking' +import { IL2Staking } from '../../../build/types/IL2Staking' +import { RewardsManager } from '../../../build/types/RewardsManager' +import { ServiceRegistry } from '../../../build/types/ServiceRegistry' +import { GraphProxyAdmin } from '../../../build/types/GraphProxyAdmin' +import { L1GraphTokenGateway } from '../../../build/types/L1GraphTokenGateway' +import { BridgeEscrow } from '../../../build/types/BridgeEscrow' +import { L2GraphTokenGateway } from '../../../build/types/L2GraphTokenGateway' +import { L2GraphToken } from '../../../build/types/L2GraphToken' +import { LibExponential } from '../../../build/types/LibExponential' +import { + configureL1Bridge, + configureL2Bridge, + deployGraphNetwork, + deployMockGraphNetwork, + GraphNetworkContracts, + helpers, +} from '@graphprotocol/sdk' +import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers' + +export interface L1FixtureContracts { + controller: Controller + disputeManager: DisputeManager + epochManager: EpochManager + grt: GraphToken + curation: Curation + gns: L1GNS + staking: IL1Staking + libExponential: LibExponential + rewardsManager: RewardsManager + serviceRegistry: ServiceRegistry + proxyAdmin: GraphProxyAdmin + l1GraphTokenGateway: L1GraphTokenGateway + bridgeEscrow: BridgeEscrow +} + +export interface L2FixtureContracts { + controller: Controller + disputeManager: DisputeManager + epochManager: EpochManager + grt: L2GraphToken + curation: L2Curation + gns: L2GNS + staking: IL2Staking + libExponential: LibExponential + rewardsManager: RewardsManager + serviceRegistry: ServiceRegistry + proxyAdmin: GraphProxyAdmin + l2GraphTokenGateway: L2GraphTokenGateway +} + +export interface L2BridgeMocks { + l2GRTMock: Wallet + l2GRTGatewayMock: Wallet + l2GNSMock: Wallet + l2StakingMock: Wallet +} + +export class NetworkFixture { + lastSnapshot: any + constructor(public provider: providers.Provider) {} + + async load(deployer: SignerWithAddress, l2Deploy?: boolean): Promise { + return await deployGraphNetwork( + './addresses-local.json', + l2Deploy ? './config/graph.arbitrum-hardhat.yml' : './config/graph.hardhat.yml', + 1337, + deployer, + this.provider, + { + governor: deployer, + skipConfirmation: true, + forceDeploy: true, + l2Deploy: l2Deploy, + enableTxLogging: false, + }, + ) + } + + async loadMock(l2Deploy: boolean): Promise { + return await deployMockGraphNetwork(l2Deploy) + } + + async loadL1ArbitrumBridge(deployer: SignerWithAddress): Promise { + return await helpers.deployL1MockBridge( + deployer, + 'arbitrum-addresses-local.json', + this.provider, + ) + } + + async loadL2ArbitrumBridge(deployer: SignerWithAddress): Promise { + return await helpers.deployL2MockBridge( + deployer, + 'arbitrum-addresses-local.json', + this.provider, + ) + } + + async configureL1Bridge( + deployer: SignerWithAddress, + l1FixtureContracts: GraphNetworkContracts, + l2MockContracts: GraphNetworkContracts, + ): Promise { + await configureL1Bridge(l1FixtureContracts, deployer, { + l2GRTAddress: l2MockContracts.L2GraphToken.address, + l2GRTGatewayAddress: l2MockContracts.L2GraphTokenGateway.address, + l2GNSAddress: l2MockContracts.L2GNS.address, + l2StakingAddress: l2MockContracts.L2Staking.address, + arbAddressBookPath: './arbitrum-addresses-local.json', + chainId: 1337, + }) + await l1FixtureContracts.L1GraphTokenGateway.connect(deployer).setPaused(false) + } + + async configureL2Bridge( + deployer: SignerWithAddress, + l2FixtureContracts: GraphNetworkContracts, + l1MockContracts: GraphNetworkContracts, + ): Promise { + await configureL2Bridge(l2FixtureContracts, deployer, { + l1GRTAddress: l1MockContracts.GraphToken.address, + l1GRTGatewayAddress: l1MockContracts.L1GraphTokenGateway.address, + l1GNSAddress: l1MockContracts.L1GNS.address, + l1StakingAddress: l1MockContracts.L1Staking.address, + arbAddressBookPath: './arbitrum-addresses-local.json', + chainId: 412346, + }) + await l2FixtureContracts.L2GraphTokenGateway.connect(deployer).setPaused(false) + } + + async setUp(): Promise { + this.lastSnapshot = await helpers.takeSnapshot() + } + + async tearDown(): Promise { + await helpers.restoreSnapshot(this.lastSnapshot) + } +} diff --git a/packages/contracts/test/unit/lib/gnsUtils.ts b/packages/contracts/test/unit/lib/gnsUtils.ts new file mode 100644 index 000000000..402e0325a --- /dev/null +++ b/packages/contracts/test/unit/lib/gnsUtils.ts @@ -0,0 +1,299 @@ +import { BigNumber, ContractTransaction } from 'ethers' +import { namehash } from 'ethers/lib/utils' +import { Curation } from '../../../build/types/Curation' +import { L1GNS } from '../../../build/types/L1GNS' +import { L2GNS } from '../../../build/types/L2GNS' +import { expect } from 'chai' +import { L2Curation } from '../../../build/types/L2Curation' +import { GraphToken } from '../../../build/types/GraphToken' +import { L2GraphToken } from '../../../build/types/L2GraphToken' +import { buildSubgraphId, PublishSubgraph, Subgraph, toBN } from '@graphprotocol/sdk' +import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers' + +// Entities +export interface AccountDefaultName { + name: string + nameIdentifier: string +} + +export const DEFAULT_RESERVE_RATIO = 1000000 + +export const createDefaultName = (name: string): AccountDefaultName => { + return { + name: name, + nameIdentifier: namehash(name), + } +} + +export const getTokensAndVSignal = async ( + subgraphDeploymentID: string, + curation: Curation | L2Curation, +): Promise> => { + const curationPool = await curation.pools(subgraphDeploymentID) + const vSignal = await curation.getCurationPoolSignal(subgraphDeploymentID) + return [curationPool.tokens, vSignal] +} + +export const publishNewSubgraph = async ( + account: SignerWithAddress, + newSubgraph: PublishSubgraph, + gns: L1GNS | L2GNS, + chainId: number, +): Promise => { + const subgraphID = await buildSubgraphId( + account.address, + await gns.nextAccountSeqID(account.address), + chainId, + ) + + // Send tx + const tx = gns + .connect(account) + .publishNewSubgraph( + newSubgraph.subgraphDeploymentID, + newSubgraph.versionMetadata, + newSubgraph.subgraphMetadata, + ) + + // Check events + await expect(tx) + .emit(gns, 'SubgraphPublished') + .withArgs(subgraphID, newSubgraph.subgraphDeploymentID, DEFAULT_RESERVE_RATIO) + .emit(gns, 'SubgraphMetadataUpdated') + .withArgs(subgraphID, newSubgraph.subgraphMetadata) + .emit(gns, 'SubgraphVersionUpdated') + .withArgs(subgraphID, newSubgraph.subgraphDeploymentID, newSubgraph.versionMetadata) + + // Check state + const subgraph = await gns.subgraphs(subgraphID) + expect(subgraph.vSignal).eq(0) + expect(subgraph.nSignal).eq(0) + expect(subgraph.subgraphDeploymentID).eq(newSubgraph.subgraphDeploymentID) + expect(subgraph.__DEPRECATED_reserveRatio).eq(DEFAULT_RESERVE_RATIO) + expect(subgraph.disabled).eq(false) + expect(subgraph.withdrawableGRT).eq(0) + + // Check NFT issuance + const owner = await gns.ownerOf(subgraphID) + expect(owner).eq(account.address) + + // TODO: properly type this + return { ...subgraph, id: subgraphID } as unknown as Subgraph +} + +export const publishNewVersion = async ( + account: SignerWithAddress, + subgraphID: string, + newSubgraph: PublishSubgraph, + gns: L1GNS | L2GNS, + curation: Curation | L2Curation, +) => { + // Before state + const ownerTaxPercentage = await gns.ownerTaxPercentage() + const curationTaxPercentage = await curation.curationTaxPercentage() + const beforeSubgraph = await gns.subgraphs(subgraphID) + + // Check what selling all nSignal, which == selling all vSignal, should return for tokens + // NOTE - no tax on burning on nSignal + const tokensReceivedEstimate = beforeSubgraph.nSignal.gt(0) + ? (await gns.nSignalToTokens(subgraphID, beforeSubgraph.nSignal))[1] + : toBN(0) + // Example: + // Deposit 100, 5 is taxed, 95 GRT in curve + // Upgrade - calculate 5% tax on 95 --> 4.75 GRT + // Multiple by ownerPercentage --> 50% * 4.75 = 2.375 GRT + // Owner adds 2.375 to 90.25, we deposit 92.625 GRT into the curve + // Divide this by 0.95 to get exactly 97.5 total tokens to be deposited + + // nSignalToTokens returns the amount of tokens with tax removed + // already. So we must add in the tokens removed + const MAX_PPM = 1000000 + const taxOnOriginal = tokensReceivedEstimate.mul(curationTaxPercentage).div(MAX_PPM) + const totalWithoutOwnerTax = tokensReceivedEstimate.sub(taxOnOriginal) + const ownerTax = taxOnOriginal.mul(ownerTaxPercentage).div(MAX_PPM) + const totalWithOwnerTax = totalWithoutOwnerTax.add(ownerTax) + const totalAdjustedUp = totalWithOwnerTax.mul(MAX_PPM).div(MAX_PPM - curationTaxPercentage) + + // Re-estimate amount of signal to get considering the owner tax paid by the owner + + const { 0: newVSignalEstimate, 1: newCurationTaxEstimate } = beforeSubgraph.nSignal.gt(0) + ? await curation.tokensToSignal(newSubgraph.subgraphDeploymentID, totalAdjustedUp) + : [toBN(0), toBN(0)] + + // Check the vSignal of the new curation curve, and tokens, before upgrading + const [beforeTokensNewCurve, beforeVSignalNewCurve] = await getTokensAndVSignal( + newSubgraph.subgraphDeploymentID, + curation, + ) + // Send tx + const tx = gns + .connect(account) + .publishNewVersion(subgraphID, newSubgraph.subgraphDeploymentID, newSubgraph.versionMetadata) + const txResult = expect(tx) + .emit(gns, 'SubgraphVersionUpdated') + .withArgs(subgraphID, newSubgraph.subgraphDeploymentID, newSubgraph.versionMetadata) + + // Only emits this event if there was actual signal to upgrade + if (beforeSubgraph.nSignal.gt(0)) { + await txResult + .emit(gns, 'SubgraphUpgraded') + .withArgs(subgraphID, newVSignalEstimate, totalAdjustedUp, newSubgraph.subgraphDeploymentID) + } + await txResult + + // Check curation vSignal old are set to zero + const [afterTokensOldCuration, afterVSignalOldCuration] = await getTokensAndVSignal( + beforeSubgraph.subgraphDeploymentID, + curation, + ) + expect(afterTokensOldCuration).eq(0) + expect(afterVSignalOldCuration).eq(0) + + // Check the vSignal of the new curation curve, and tokens + const [afterTokensNewCurve, afterVSignalNewCurve] = await getTokensAndVSignal( + newSubgraph.subgraphDeploymentID, + curation, + ) + expect(afterTokensNewCurve).eq( + beforeTokensNewCurve.add(totalAdjustedUp).sub(newCurationTaxEstimate), + ) + expect(afterVSignalNewCurve).eq(beforeVSignalNewCurve.add(newVSignalEstimate)) + + // Check the nSignal pool + const afterSubgraph = await gns.subgraphs(subgraphID) + expect(afterSubgraph.vSignal) + .eq(afterVSignalNewCurve.sub(beforeVSignalNewCurve)) + .eq(newVSignalEstimate) + expect(afterSubgraph.nSignal).eq(beforeSubgraph.nSignal) // should not change + expect(afterSubgraph.subgraphDeploymentID).eq(newSubgraph.subgraphDeploymentID) + + // Check NFT should not change owner + const owner = await gns.ownerOf(subgraphID) + expect(owner).eq(account.address) + + return tx +} + +export const mintSignal = async ( + account: SignerWithAddress, + subgraphID: string, + tokensIn: BigNumber, + gns: L1GNS | L2GNS, + curation: Curation | L2Curation, +): Promise => { + // Before state + const beforeSubgraph = await gns.subgraphs(subgraphID) + const [beforeTokens, beforeVSignal] = await getTokensAndVSignal( + beforeSubgraph.subgraphDeploymentID, + curation, + ) + + // Deposit + const { + 0: vSignalExpected, + 1: nSignalExpected, + 2: curationTax, + } = await gns.tokensToNSignal(subgraphID, tokensIn) + const tx = gns.connect(account).mintSignal(subgraphID, tokensIn, 0) + await expect(tx) + .emit(gns, 'SignalMinted') + .withArgs(subgraphID, account.address, nSignalExpected, vSignalExpected, tokensIn) + + // After state + const afterSubgraph = await gns.subgraphs(subgraphID) + const [afterTokens, afterVSignal] = await getTokensAndVSignal( + afterSubgraph.subgraphDeploymentID, + curation, + ) + + // Check state + expect(afterTokens).eq(beforeTokens.add(tokensIn.sub(curationTax))) + expect(afterVSignal).eq(beforeVSignal.add(vSignalExpected)) + expect(afterSubgraph.nSignal).eq(beforeSubgraph.nSignal.add(nSignalExpected)) + expect(afterSubgraph.vSignal).eq(beforeVSignal.add(vSignalExpected)) + + return tx +} + +export const burnSignal = async ( + account: SignerWithAddress, + subgraphID: string, + gns: L1GNS | L2GNS, + curation: Curation | L2Curation, +): Promise => { + // Before state + const beforeSubgraph = await gns.subgraphs(subgraphID) + const [beforeTokens, beforeVSignal] = await getTokensAndVSignal( + beforeSubgraph.subgraphDeploymentID, + curation, + ) + const beforeUsersNSignal = await gns.getCuratorSignal(subgraphID, account.address) + + // Withdraw + const { 0: vSignalExpected, 1: tokensExpected } = await gns.nSignalToTokens( + subgraphID, + beforeUsersNSignal, + ) + + // Send tx + const tx = gns.connect(account).burnSignal(subgraphID, beforeUsersNSignal, 0) + await expect(tx) + .emit(gns, 'SignalBurned') + .withArgs(subgraphID, account.address, beforeUsersNSignal, vSignalExpected, tokensExpected) + + // After state + const afterSubgraph = await gns.subgraphs(subgraphID) + const [afterTokens, afterVSignalCuration] = await getTokensAndVSignal( + afterSubgraph.subgraphDeploymentID, + curation, + ) + + // Check state + expect(afterTokens).eq(beforeTokens.sub(tokensExpected)) + expect(afterVSignalCuration).eq(beforeVSignal.sub(vSignalExpected)) + expect(afterSubgraph.nSignal).eq(beforeSubgraph.nSignal.sub(beforeUsersNSignal)) + + return tx +} + +export const deprecateSubgraph = async ( + account: SignerWithAddress, + subgraphID: string, + gns: L1GNS | L2GNS, + curation: Curation | L2Curation, + grt: GraphToken | L2GraphToken, +) => { + // Before state + const beforeSubgraph = await gns.subgraphs(subgraphID) + const [beforeTokens] = await getTokensAndVSignal(beforeSubgraph.subgraphDeploymentID, curation) + + // We can use the whole amount, since in this test suite all vSignal is used to be staked on nSignal + const ownerBalanceBefore = await grt.balanceOf(account.address) + + // Send tx + const tx = gns.connect(account).deprecateSubgraph(subgraphID) + await expect(tx).emit(gns, 'SubgraphDeprecated').withArgs(subgraphID, beforeTokens) + + // After state + const afterSubgraph = await gns.subgraphs(subgraphID) + // Check marked as deprecated + expect(afterSubgraph.disabled).eq(true) + // Signal for the deployment must be all burned + expect(afterSubgraph.vSignal.eq(toBN('0'))) + // Cleanup reserve ratio + expect(afterSubgraph.__DEPRECATED_reserveRatio).eq(0) + // Should be equal since owner pays curation tax + expect(afterSubgraph.withdrawableGRT).eq(beforeTokens) + + // Check balance of GNS increased by curation tax from owner being added + const afterGNSBalance = await grt.balanceOf(gns.address) + expect(afterGNSBalance).eq(afterSubgraph.withdrawableGRT) + // Check that the owner balance decreased by the curation tax + const ownerBalanceAfter = await grt.balanceOf(account.address) + expect(ownerBalanceBefore.eq(ownerBalanceAfter)) + + // Check NFT was burned + await expect(gns.ownerOf(subgraphID)).revertedWith('ERC721: owner query for nonexistent token') + + return tx +} diff --git a/packages/contracts/test/unit/lib/graphTokenTests.ts b/packages/contracts/test/unit/lib/graphTokenTests.ts new file mode 100644 index 000000000..299458080 --- /dev/null +++ b/packages/contracts/test/unit/lib/graphTokenTests.ts @@ -0,0 +1,246 @@ +import hre from 'hardhat' +import { expect } from 'chai' +import { BigNumber, constants, ethers, Signature, Wallet } from 'ethers' + +import { L2GraphToken } from '../../../build/types/L2GraphToken' +import { GraphToken } from '../../../build/types/GraphToken' +import { GraphNetworkContracts, Permit, signPermit, toBN, toGRT } from '@graphprotocol/sdk' +import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers' +import { NetworkFixture } from './fixtures' + +const { AddressZero, MaxUint256 } = constants + +const L1SALT = '0x51f3d585afe6dfeb2af01bba0889a36c1db03beec88c6a4d0c53817069026afa' +const L2SALT = '0xe33842a7acd1d5a1d28f25a931703e5605152dc48d64dc4716efdae1f5659591' + +export function grtTests(isL2: boolean): void { + let me: Wallet + let other: Wallet + let governor: SignerWithAddress + let salt: string + let fixture: NetworkFixture + let fixtureContracts: GraphNetworkContracts + + const graph = hre.graph() + + const mePrivateKey = '0x4f3edf983ac636a65a842ce7c78d9aa706d3b113bce9c46f30d7d21715b23b1d' + const otherPrivateKey = '0x6cbed15c793ce57650b9877cf6fa156fbef513c4e6134f022a85b1ffdd59b2a1' + + let grt: GraphToken | L2GraphToken + + async function permitMaxOK(): Promise { + return permitOK(MaxUint256) + } + + async function permitOK(value: BigNumber): Promise { + const nonce = await grt.nonces(me.address) + return { + owner: me.address, + spender: other.address, + value: value, + nonce: nonce, + deadline: toBN('0'), + } + } + + async function permitExpired(): Promise { + const permit = await permitMaxOK() + permit.deadline = toBN('1') + return permit + } + + async function permitDeny(): Promise { + const permit = await permitMaxOK() + permit.value = toBN('0') + return permit + } + + function createPermitTransaction(permit: Permit, signer: string, salt: string) { + const signature: Signature = signPermit(signer, graph.chainId, grt.address, permit, salt) + const wallet = new ethers.Wallet(signer, graph.provider) + return grt + .connect(wallet) + .permit( + permit.owner, + permit.spender, + permit.value, + permit.deadline, + signature.v, + signature.r, + signature.s, + ) + } + + before(async function () { + ({ governor } = await graph.getNamedAccounts()) + me = new ethers.Wallet(mePrivateKey, graph.provider) + other = new ethers.Wallet(otherPrivateKey, graph.provider) + + fixture = new NetworkFixture(graph.provider) + fixtureContracts = await fixture.load(governor, isL2) + grt = fixtureContracts.GraphToken as GraphToken + salt = isL2 ? L2SALT : L1SALT + + // Mint some tokens + const tokens = toGRT('10000') + await grt.connect(governor).mint(me.address, tokens) + }) + + describe('permit', function () { + it('should permit max token allowance', async function () { + // Allow to transfer tokens + const tokensToApprove = toGRT('1000') + const permit = await permitOK(tokensToApprove) + const tx = createPermitTransaction(permit, mePrivateKey, salt) + await expect(tx).emit(grt, 'Approval').withArgs(permit.owner, permit.spender, tokensToApprove) + + // Allowance updated + const allowance = await grt.allowance(me.address, other.address) + expect(allowance).eq(tokensToApprove) + + // Transfer tokens should work + const tokens = toGRT('100') + await grt.connect(other).transferFrom(me.address, other.address, tokens) + }) + + it('should permit max token allowance', async function () { + // Allow to transfer tokens + const permit = await permitMaxOK() + const tx = createPermitTransaction(permit, mePrivateKey, salt) + await expect(tx).emit(grt, 'Approval').withArgs(permit.owner, permit.spender, MaxUint256) + + // Allowance updated + const allowance = await grt.allowance(me.address, other.address) + expect(allowance).eq(MaxUint256) + + // Transfer tokens should work + const tokens = toGRT('100') + await grt.connect(other).transferFrom(me.address, other.address, tokens) + }) + + it('reject to transfer more tokens than approved by permit', async function () { + // Allow to transfer tokens + const tokensToApprove = toGRT('1000') + const permit = await permitOK(tokensToApprove) + await createPermitTransaction(permit, mePrivateKey, salt) + + // Should not transfer more than approved + const tooManyTokens = toGRT('1001') + const tx = grt.connect(other).transferFrom(me.address, other.address, tooManyTokens) + await expect(tx).revertedWith('ERC20: transfer amount exceeds allowance') + + // Should transfer up to the approved amount + await grt.connect(other).transferFrom(me.address, other.address, tokensToApprove) + }) + + it('reject use two permits with same nonce', async function () { + // Allow to transfer tokens + const permit = await permitMaxOK() + await createPermitTransaction(permit, mePrivateKey, salt) + + // Try to re-use the permit + const tx = createPermitTransaction(permit, mePrivateKey, salt) + await expect(tx).revertedWith('GRT: invalid permit') + }) + + it('reject use expired permit', async function () { + const permit = await permitExpired() + const tx = createPermitTransaction(permit, mePrivateKey, salt) + await expect(tx).revertedWith('GRT: expired permit') + }) + + it('reject permit if holder address does not match', async function () { + const permit = await permitMaxOK() + const tx = createPermitTransaction(permit, otherPrivateKey, salt) + await expect(tx).revertedWith('GRT: invalid permit') + }) + + it('should deny transfer from if permit was denied', async function () { + // Allow to transfer tokens + const permit1 = await permitMaxOK() + await createPermitTransaction(permit1, mePrivateKey, salt) + + // Deny transfer tokens + const permit2 = await permitDeny() + await createPermitTransaction(permit2, mePrivateKey, salt) + + // Allowance updated + const allowance = await grt.allowance(me.address, other.address) + expect(allowance).eq(toBN('0')) + + // Try to transfer without permit should fail + const tokens = toGRT('100') + const tx = grt.connect(other).transferFrom(me.address, other.address, tokens) + await expect(tx).revertedWith('ERC20: transfer amount exceeds allowance') + }) + }) + + describe('mint', function () { + describe('mint', function () { + it('reject mint if not minter', async function () { + const tx = grt.connect(me).mint(me.address, toGRT('100')) + await expect(tx).revertedWith('Only minter can call') + }) + }) + + describe('addMinter', function () { + it('reject add a new minter if not allowed', async function () { + const tx = grt.connect(me).addMinter(me.address) + await expect(tx).revertedWith('Only Governor can call') + }) + + it('should add a new minter', async function () { + expect(await grt.isMinter(me.address)).eq(false) + const tx = grt.connect(governor).addMinter(me.address) + await expect(tx).emit(grt, 'MinterAdded').withArgs(me.address) + expect(await grt.isMinter(me.address)).eq(true) + }) + }) + + context('> when is minter', function () { + beforeEach(async function () { + await grt.connect(governor).addMinter(me.address) + expect(await grt.isMinter(me.address)).eq(true) + }) + + describe('mint', function () { + it('should mint', async function () { + const beforeTokens = await grt.balanceOf(me.address) + + const tokensToMint = toGRT('100') + const tx = grt.connect(me).mint(me.address, tokensToMint) + await expect(tx).emit(grt, 'Transfer').withArgs(AddressZero, me.address, tokensToMint) + + const afterTokens = await grt.balanceOf(me.address) + expect(afterTokens).eq(beforeTokens.add(tokensToMint)) + }) + + it('should mint if governor', async function () { + const tokensToMint = toGRT('100') + await grt.connect(governor).mint(me.address, tokensToMint) + }) + }) + + describe('removeMinter', function () { + it('reject remove a minter if not allowed', async function () { + const tx = grt.connect(me).removeMinter(me.address) + await expect(tx).revertedWith('Only Governor can call') + }) + + it('should remove a minter', async function () { + const tx = grt.connect(governor).removeMinter(me.address) + await expect(tx).emit(grt, 'MinterRemoved').withArgs(me.address) + expect(await grt.isMinter(me.address)).eq(false) + }) + }) + + describe('renounceMinter', function () { + it('should renounce to be a minter', async function () { + const tx = grt.connect(me).renounceMinter() + await expect(tx).emit(grt, 'MinterRemoved').withArgs(me.address) + expect(await grt.isMinter(me.address)).eq(false) + }) + }) + }) + }) +} diff --git a/packages/contracts/test/unit/payments/allocationExchange.test.ts b/packages/contracts/test/unit/payments/allocationExchange.test.ts new file mode 100644 index 000000000..500cb8c0a --- /dev/null +++ b/packages/contracts/test/unit/payments/allocationExchange.test.ts @@ -0,0 +1,292 @@ +import hre from 'hardhat' +import { expect } from 'chai' +import { BigNumber, constants, Wallet } from 'ethers' + +import { AllocationExchange } from '../../../build/types/AllocationExchange' +import { GraphToken } from '../../../build/types/GraphToken' +import { IStaking } from '../../../build/types/IStaking' + +import { NetworkFixture } from '../lib/fixtures' +import { arrayify, joinSignature, SigningKey, solidityKeccak256 } from 'ethers/lib/utils' +import { + deriveChannelKey, + GraphNetworkContracts, + helpers, + randomAddress, + randomHexBytes, + toGRT, +} from '@graphprotocol/sdk' +import type { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers' +import { EpochManager } from '../../../build/types/EpochManager' + +const { AddressZero, MaxUint256 } = constants + +interface Voucher { + allocationID: string + amount: BigNumber + signature: string +} + +describe('AllocationExchange', () => { + let governor: SignerWithAddress + let allocationExchangeOwner: SignerWithAddress + let indexer: SignerWithAddress + let authority: Wallet + + let fixture: NetworkFixture + + let contracts: GraphNetworkContracts + let grt: GraphToken + let staking: IStaking + let allocationExchange: AllocationExchange + let epochManager: EpochManager + + const graph = hre.graph() + + function createVoucher( + allocationID: string, + amount: BigNumber, + signerKey: string, + ): Voucher { + const messageHash = solidityKeccak256(['address', 'uint256'], [allocationID, amount]) + const messageHashBytes = arrayify(messageHash) + const key = new SigningKey(signerKey) + const signature = key.signDigest(messageHashBytes) + return { + allocationID, + amount, + signature: joinSignature(signature), + } + } + + before(async function () { + [indexer] = await graph.getTestAccounts() + ;({ governor, allocationExchangeOwner } = await graph.getNamedAccounts()) + authority = Wallet.createRandom() + + fixture = new NetworkFixture(graph.provider) + contracts = await fixture.load(governor) + allocationExchange = contracts.AllocationExchange as AllocationExchange + grt = contracts.GraphToken as GraphToken + staking = contracts.Staking as IStaking + epochManager = contracts.EpochManager as EpochManager + + // Give some funds to the indexer and approve staking contract to use funds on indexer behalf + const indexerTokens = toGRT('100000') + await grt.connect(governor).mint(indexer.address, indexerTokens) + await grt.connect(indexer).approve(staking.address, indexerTokens) + + // Give some funds to the AllocationExchange + const exchangeTokens = toGRT('2000') + await grt.connect(governor).mint(allocationExchange.address, exchangeTokens) + + // Ensure the exchange is correctly setup + await allocationExchange.connect(allocationExchangeOwner).setAuthority(authority.address, true) + await allocationExchange.connect(allocationExchangeOwner).approveAll() + }) + + beforeEach(async function () { + await fixture.setUp() + }) + + afterEach(async function () { + await fixture.tearDown() + }) + + async function setupAllocation(): Promise { + // Generate test data + const channelKey = deriveChannelKey() + const allocationID = channelKey.address + const subgraphDeploymentID = randomHexBytes(32) + const metadata = randomHexBytes(32) + + // Setup staking + const stakeTokens = toGRT('100000') + await staking.connect(indexer).stake(stakeTokens) + await staking + .connect(indexer) + .allocateFrom( + indexer.address, + subgraphDeploymentID, + stakeTokens, + allocationID, + metadata, + await channelKey.generateProof(indexer.address), + ) + return allocationID + } + + describe('config', function () { + it('should set an authority', async function () { + // Set authority + const newAuthority = randomAddress() + const tx1 = allocationExchange + .connect(allocationExchangeOwner) + .setAuthority(newAuthority, true) + await expect(tx1).emit(allocationExchange, 'AuthoritySet').withArgs(newAuthority, true) + expect(await allocationExchange.authority(newAuthority)).eq(true) + + // Unset authority + const tx2 = allocationExchange + .connect(allocationExchangeOwner) + .setAuthority(newAuthority, false) + await expect(tx2).emit(allocationExchange, 'AuthoritySet').withArgs(newAuthority, false) + expect(await allocationExchange.authority(newAuthority)).eq(false) + }) + + it('reject set an authority if not allowed', async function () { + const newAuthority = randomAddress() + const tx = allocationExchange.connect(indexer).setAuthority(newAuthority, true) + await expect(tx).revertedWith('Only Governor can call') + }) + + it('reject set an empty authority', async function () { + const newAuthority = AddressZero + const tx = allocationExchange + .connect(allocationExchangeOwner) + .setAuthority(newAuthority, true) + await expect(tx).revertedWith('Exchange: empty authority') + }) + + it('should allow to approve all tokens to staking contract', async function () { + await allocationExchange.connect(allocationExchangeOwner).approveAll() + const allowance = await grt.allowance(allocationExchange.address, staking.address) + expect(allowance).eq(MaxUint256) + }) + }) + + describe('withdraw funds', function () { + it('should withdraw to destination', async function () { + const beforeExchangeBalance = await grt.balanceOf(allocationExchange.address) + + const destinationAddress = randomAddress() + const amount = toGRT('1000') + const tx = allocationExchange + .connect(allocationExchangeOwner) + .withdraw(destinationAddress, amount) + await expect(tx) + .emit(allocationExchange, 'TokensWithdrawn') + .withArgs(destinationAddress, amount) + + const afterExchangeBalance = await grt.balanceOf(allocationExchange.address) + const afterDestinationBalance = await grt.balanceOf(destinationAddress) + + expect(afterExchangeBalance).eq(beforeExchangeBalance.sub(amount)) + expect(afterDestinationBalance).eq(amount) + }) + + it('reject withdraw zero amount', async function () { + const destinationAddress = randomAddress() + const amount = toGRT('0') + const tx = allocationExchange + .connect(allocationExchangeOwner) + .withdraw(destinationAddress, amount) + await expect(tx).revertedWith('Exchange: empty amount') + }) + + it('reject withdraw to zero destination', async function () { + const destinationAddress = AddressZero + const amount = toGRT('1000') + const tx = allocationExchange + .connect(allocationExchangeOwner) + .withdraw(destinationAddress, amount) + await expect(tx).revertedWith('Exchange: empty destination') + }) + + it('reject withdraw if not allowed', async function () { + const destinationAddress = randomAddress() + const amount = toGRT('1000') + const tx = allocationExchange.connect(indexer.address).withdraw(destinationAddress, amount) + await expect(tx).revertedWith('Only Governor can call') + }) + }) + + describe('redeem vouchers', function () { + it('redeem a voucher', async function () { + const beforeExchangeBalance = await grt.balanceOf(allocationExchange.address) + + // Setup an active allocation + const allocationID = await setupAllocation() + await helpers.mineEpoch(epochManager) + + // Initiate a withdrawal + const actualAmount = toGRT('2000') // <- withdraw amount + const voucher = createVoucher(allocationID, actualAmount, authority.privateKey) + const tx = allocationExchange.connect(allocationExchangeOwner).redeem(voucher) + await expect(tx) + .emit(allocationExchange, 'AllocationRedeemed') + .withArgs(allocationID, actualAmount) + + // Allocation must have collected the withdrawn tokens + const allocation = await staking.allocations(allocationID) + expect(allocation.collectedFees).eq(actualAmount) + + // AllocationExchange should have less funds + const afterExchangeBalance = await grt.balanceOf(allocationExchange.address) + expect(afterExchangeBalance).eq(beforeExchangeBalance.sub(actualAmount)) + }) + + it('reject double spending of a voucher', async function () { + // Setup an active allocation + const allocationID = await setupAllocation() + await helpers.mineEpoch(epochManager) + + // Initiate a withdrawal + const actualAmount = toGRT('2000') // <- withdraw amount + const voucher = createVoucher(allocationID, actualAmount, authority.privateKey) + + // First redeem + await allocationExchange.connect(allocationExchangeOwner).redeem(voucher) + + // Double spend the same voucher! + await expect( + allocationExchange.connect(allocationExchangeOwner).redeem(voucher), + ).revertedWith('Exchange: allocation already redeemed') + }) + + it('reject redeem voucher for invalid allocation', async function () { + // Use an invalid allocation + const allocationID = '0xfefefefefefefefefefefefefefefefefefefefe' + + // Ensure the exchange is correctly setup + await allocationExchange + .connect(allocationExchangeOwner) + .setAuthority(authority.address, true) + await allocationExchange.connect(allocationExchangeOwner).approveAll() + + // Initiate a withdrawal + const actualAmount = toGRT('2000') // <- withdraw amount + const voucher = createVoucher(allocationID, actualAmount, authority.privateKey) + const tx = allocationExchange.connect(allocationExchangeOwner).redeem(voucher) + await expect(tx).revertedWith('!collect') + }) + + it('reject redeem voucher not signed by the authority', async function () { + // Initiate a withdrawal + const actualAmount = toGRT('2000') // <- withdraw amount + const voucher = createVoucher( + randomAddress(), + actualAmount, + Wallet.createRandom().privateKey, // <-- signed by anon + ) + const tx = allocationExchange.connect(allocationExchangeOwner).redeem(voucher) + await expect(tx).revertedWith('Exchange: invalid signer') + }) + + it('reject redeem voucher with empty amount', async function () { + // Initiate a withdrawal + const actualAmount = toGRT('0') // <- withdraw amount + const voucher = createVoucher(randomAddress(), actualAmount, authority.privateKey) + const tx = allocationExchange.connect(allocationExchangeOwner).redeem(voucher) + await expect(tx).revertedWith('Exchange: zero tokens voucher') + }) + + it('reject redeem voucher with invalid signature', async function () { + const actualAmount = toGRT('2000') // <- withdraw amount + const voucher = createVoucher(randomAddress(), actualAmount, authority.privateKey) + voucher.signature = '0x1234' + const tx = allocationExchange.connect(allocationExchangeOwner).redeem(voucher) + await expect(tx).revertedWith('Exchange: invalid signature') + }) + }) +}) diff --git a/packages/contracts/test/unit/rewards/rewards.test.ts b/packages/contracts/test/unit/rewards/rewards.test.ts new file mode 100644 index 000000000..57458f2b1 --- /dev/null +++ b/packages/contracts/test/unit/rewards/rewards.test.ts @@ -0,0 +1,1065 @@ +import hre from 'hardhat' +import { expect } from 'chai' +import { BigNumber, constants } from 'ethers' +import { BigNumber as BN } from 'bignumber.js' + +import { NetworkFixture } from '../lib/fixtures' + +import { Curation } from '../../../build/types/Curation' +import { EpochManager } from '../../../build/types/EpochManager' +import { GraphToken } from '../../../build/types/GraphToken' +import { RewardsManager } from '../../../build/types/RewardsManager' +import { IStaking } from '../../../build/types/IStaking' +import { impersonateAccount, setBalance } from '@nomicfoundation/hardhat-network-helpers' + +import { + deriveChannelKey, + formatGRT, + GraphNetworkContracts, + helpers, + randomHexBytes, + toBN, + toGRT, +} from '@graphprotocol/sdk' +import type { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers' + +const MAX_PPM = 1000000 + +const { HashZero, WeiPerEther } = constants + +const toRound = (n: BigNumber) => formatGRT(n.add(toGRT('0.5'))).split('.')[0] + +describe('Rewards', () => { + const graph = hre.graph() + let delegator: SignerWithAddress + let governor: SignerWithAddress + let curator1: SignerWithAddress + let curator2: SignerWithAddress + let indexer1: SignerWithAddress + let indexer2: SignerWithAddress + let oracle: SignerWithAddress + let assetHolder: SignerWithAddress + + let fixture: NetworkFixture + + let contracts: GraphNetworkContracts + let grt: GraphToken + let curation: Curation + let epochManager: EpochManager + let staking: IStaking + let rewardsManager: RewardsManager + + // Derive some channel keys for each indexer used to sign attestations + const channelKey1 = deriveChannelKey() + const channelKey2 = deriveChannelKey() + const channelKeyNull = deriveChannelKey() + + const subgraphDeploymentID1 = randomHexBytes() + const subgraphDeploymentID2 = randomHexBytes() + + const allocationID1 = channelKey1.address + const allocationID2 = channelKey2.address + const allocationIDNull = channelKeyNull.address + + const metadata = HashZero + + const ISSUANCE_RATE_PERIODS = 4 // blocks required to issue 800 GRT rewards + const ISSUANCE_PER_BLOCK = toBN('200000000000000000000') // 200 GRT every block + + // Core formula that gets accumulated rewards per signal for a period of time + const getRewardsPerSignal = (k: BN, t: BN, s: BN): string => { + if (s.eq(0)) { + return '0' + } + return k.times(t).div(s).toPrecision(18).toString() + } + + // Tracks the accumulated rewards as totalSignalled or supply changes across snapshots + class RewardsTracker { + totalSignalled = BigNumber.from(0) + lastUpdatedBlock = 0 + accumulated = BigNumber.from(0) + + static async create() { + const tracker = new RewardsTracker() + await tracker.snapshot() + return tracker + } + + async snapshot() { + this.accumulated = this.accumulated.add(await this.accrued()) + this.totalSignalled = await grt.balanceOf(curation.address) + this.lastUpdatedBlock = await helpers.latestBlock() + return this + } + + async elapsedBlocks() { + const currentBlock = await helpers.latestBlock() + return currentBlock - this.lastUpdatedBlock + } + + async accrued() { + const nBlocks = await this.elapsedBlocks() + return this.accruedByElapsed(nBlocks) + } + + accruedByElapsed(nBlocks: BigNumber | number) { + const n = getRewardsPerSignal( + new BN(ISSUANCE_PER_BLOCK.toString()), + new BN(nBlocks.toString()), + new BN(this.totalSignalled.toString()), + ) + return toGRT(n) + } + } + + // Test accumulated rewards per signal + const shouldGetNewRewardsPerSignal = async (nBlocks = ISSUANCE_RATE_PERIODS) => { + // -- t0 -- + const tracker = await RewardsTracker.create() + + // Jump + await helpers.mine(nBlocks) + + // -- t1 -- + + // Contract calculation + const contractAccrued = await rewardsManager.getNewRewardsPerSignal() + // Local calculation + const expectedAccrued = await tracker.accrued() + + // Check + expect(toRound(expectedAccrued)).eq(toRound(contractAccrued)) + return expectedAccrued + } + + before(async function () { + [delegator, curator1, curator2, indexer1, indexer2, oracle, assetHolder] + = await graph.getTestAccounts() + ;({ governor } = await graph.getNamedAccounts()) + + fixture = new NetworkFixture(graph.provider) + contracts = await fixture.load(governor) + grt = contracts.GraphToken as GraphToken + curation = contracts.Curation as Curation + epochManager = contracts.EpochManager as EpochManager + staking = contracts.Staking as IStaking + rewardsManager = contracts.RewardsManager as RewardsManager + + // 200 GRT per block + await rewardsManager.connect(governor).setIssuancePerBlock(ISSUANCE_PER_BLOCK) + + // Distribute test funds + for (const wallet of [indexer1, indexer2, curator1, curator2, assetHolder]) { + await grt.connect(governor).mint(wallet.address, toGRT('1000000')) + await grt.connect(wallet).approve(staking.address, toGRT('1000000')) + await grt.connect(wallet).approve(curation.address, toGRT('1000000')) + } + }) + + beforeEach(async function () { + await fixture.setUp() + }) + + afterEach(async function () { + await fixture.tearDown() + }) + + describe('configuration', function () { + describe('issuance per block update', function () { + it('reject set issuance per block if unauthorized', async function () { + const tx = rewardsManager.connect(indexer1).setIssuancePerBlock(toGRT('1.025')) + await expect(tx).revertedWith('Only Controller governor') + }) + + it('should set issuance rate to minimum allowed (0)', async function () { + const newIssuancePerBlock = toGRT('0') + await rewardsManager.connect(governor).setIssuancePerBlock(newIssuancePerBlock) + expect(await rewardsManager.issuancePerBlock()).eq(newIssuancePerBlock) + }) + + it('should set issuance rate', async function () { + const newIssuancePerBlock = toGRT('100.025') + await rewardsManager.connect(governor).setIssuancePerBlock(newIssuancePerBlock) + expect(await rewardsManager.issuancePerBlock()).eq(newIssuancePerBlock) + expect(await rewardsManager.accRewardsPerSignalLastBlockUpdated()).eq( + await helpers.latestBlock(), + ) + }) + }) + + describe('subgraph availability service', function () { + it('reject set subgraph oracle if unauthorized', async function () { + const tx = rewardsManager.connect(indexer1).setSubgraphAvailabilityOracle(oracle.address) + await expect(tx).revertedWith('Only Controller governor') + }) + + it('should set subgraph oracle if governor', async function () { + await rewardsManager.connect(governor).setSubgraphAvailabilityOracle(oracle.address) + expect(await rewardsManager.subgraphAvailabilityOracle()).eq(oracle.address) + }) + + it('reject to deny subgraph if not the oracle', async function () { + const tx = rewardsManager.connect(governor).setDenied(subgraphDeploymentID1, true) + await expect(tx).revertedWith('Caller must be the subgraph availability oracle') + }) + + it('should deny subgraph', async function () { + await rewardsManager.connect(governor).setSubgraphAvailabilityOracle(oracle.address) + + const tx = rewardsManager.connect(oracle).setDenied(subgraphDeploymentID1, true) + const blockNum = await helpers.latestBlock() + await expect(tx) + .emit(rewardsManager, 'RewardsDenylistUpdated') + .withArgs(subgraphDeploymentID1, blockNum + 1) + expect(await rewardsManager.isDenied(subgraphDeploymentID1)).eq(true) + }) + }) + }) + + context('issuing rewards', function () { + beforeEach(async function () { + // 5% minute rate (4 blocks) + await rewardsManager.connect(governor).setIssuancePerBlock(ISSUANCE_PER_BLOCK) + }) + + describe('getNewRewardsPerSignal', function () { + it('accrued per signal when no tokens signalled', async function () { + // When there is no tokens signalled no rewards are accrued + await helpers.mineEpoch(epochManager) + const accrued = await rewardsManager.getNewRewardsPerSignal() + expect(accrued).eq(0) + }) + + it('accrued per signal when tokens signalled', async function () { + // Update total signalled + const tokensToSignal = toGRT('1000') + await curation.connect(curator1).mint(subgraphDeploymentID1, tokensToSignal, 0) + + // Check + await shouldGetNewRewardsPerSignal() + }) + + it('accrued per signal when signalled tokens w/ many subgraphs', async function () { + // Update total signalled + await curation.connect(curator1).mint(subgraphDeploymentID1, toGRT('1000'), 0) + + // Check + await shouldGetNewRewardsPerSignal() + + // Update total signalled + await curation.connect(curator2).mint(subgraphDeploymentID2, toGRT('250'), 0) + + // Check + await shouldGetNewRewardsPerSignal() + }) + }) + + describe('updateAccRewardsPerSignal', function () { + it('update the accumulated rewards per signal state', async function () { + // Update total signalled + await curation.connect(curator1).mint(subgraphDeploymentID1, toGRT('1000'), 0) + // Snapshot + const tracker = await RewardsTracker.create() + + // Update + await rewardsManager.connect(governor).updateAccRewardsPerSignal() + const contractAccrued = await rewardsManager.accRewardsPerSignal() + + // Check + const expectedAccrued = await tracker.accrued() + expect(toRound(expectedAccrued)).eq(toRound(contractAccrued)) + }) + + it('update the accumulated rewards per signal state after many blocks', async function () { + // Update total signalled + await curation.connect(curator1).mint(subgraphDeploymentID1, toGRT('1000'), 0) + // Snapshot + const tracker = await RewardsTracker.create() + + // Jump + await helpers.mine(ISSUANCE_RATE_PERIODS) + + // Update + await rewardsManager.connect(governor).updateAccRewardsPerSignal() + const contractAccrued = await rewardsManager.accRewardsPerSignal() + + // Check + const expectedAccrued = await tracker.accrued() + expect(toRound(expectedAccrued)).eq(toRound(contractAccrued)) + }) + }) + + describe('getAccRewardsForSubgraph', function () { + it('accrued for each subgraph', async function () { + // Curator1 - Update total signalled + const signalled1 = toGRT('1500') + await curation.connect(curator1).mint(subgraphDeploymentID1, signalled1, 0) + const tracker1 = await RewardsTracker.create() + + // Curator2 - Update total signalled + const signalled2 = toGRT('500') + await curation.connect(curator2).mint(subgraphDeploymentID2, signalled2, 0) + + // Snapshot + const tracker2 = await RewardsTracker.create() + await tracker1.snapshot() + + // Jump + await helpers.mine(ISSUANCE_RATE_PERIODS) + + // Snapshot + await tracker1.snapshot() + await tracker2.snapshot() + + // Calculate rewards + const rewardsPerSignal1 = tracker1.accumulated + const rewardsPerSignal2 = tracker2.accumulated + const expectedRewardsSG1 = rewardsPerSignal1.mul(signalled1).div(WeiPerEther) + const expectedRewardsSG2 = rewardsPerSignal2.mul(signalled2).div(WeiPerEther) + + // Get rewards from contract + const contractRewardsSG1 = await rewardsManager.getAccRewardsForSubgraph( + subgraphDeploymentID1, + ) + const contractRewardsSG2 = await rewardsManager.getAccRewardsForSubgraph( + subgraphDeploymentID2, + ) + + // Check + expect(toRound(expectedRewardsSG1)).eq(toRound(contractRewardsSG1)) + expect(toRound(expectedRewardsSG2)).eq(toRound(contractRewardsSG2)) + }) + }) + + describe('onSubgraphSignalUpdate', function () { + it('update the accumulated rewards for subgraph state', async function () { + // Update total signalled + const signalled1 = toGRT('1500') + await curation.connect(curator1).mint(subgraphDeploymentID1, signalled1, 0) + // Snapshot + const tracker1 = await RewardsTracker.create() + + // Jump + await helpers.mine(ISSUANCE_RATE_PERIODS) + + // Update + await rewardsManager.connect(governor).onSubgraphSignalUpdate(subgraphDeploymentID1) + + // Check + const contractRewardsSG1 = (await rewardsManager.subgraphs(subgraphDeploymentID1)) + .accRewardsForSubgraph + const rewardsPerSignal1 = await tracker1.accrued() + const expectedRewardsSG1 = rewardsPerSignal1.mul(signalled1).div(WeiPerEther) + expect(toRound(expectedRewardsSG1)).eq(toRound(contractRewardsSG1)) + + const contractAccrued = await rewardsManager.accRewardsPerSignal() + const expectedAccrued = await tracker1.accrued() + expect(toRound(expectedAccrued)).eq(toRound(contractAccrued)) + + const contractBlockUpdated = await rewardsManager.accRewardsPerSignalLastBlockUpdated() + const expectedBlockUpdated = await helpers.latestBlock() + expect(expectedBlockUpdated).eq(contractBlockUpdated) + }) + }) + + describe('getAccRewardsPerAllocatedToken', function () { + it('accrued per allocated token', async function () { + // Update total signalled + const signalled1 = toGRT('1500') + await curation.connect(curator1).mint(subgraphDeploymentID1, signalled1, 0) + + // Allocate + const tokensToAllocate = toGRT('12500') + await staking.connect(indexer1).stake(tokensToAllocate) + await staking + .connect(indexer1) + .allocateFrom( + indexer1.address, + subgraphDeploymentID1, + tokensToAllocate, + allocationID1, + metadata, + await channelKey1.generateProof(indexer1.address), + ) + + // Jump + await helpers.mine(ISSUANCE_RATE_PERIODS) + + // Check + const sg1 = await rewardsManager.subgraphs(subgraphDeploymentID1) + // We trust this function because it was individually tested in previous test + const accRewardsForSubgraphSG1 = await rewardsManager.getAccRewardsForSubgraph( + subgraphDeploymentID1, + ) + const accruedRewardsSG1 = accRewardsForSubgraphSG1.sub(sg1.accRewardsForSubgraphSnapshot) + const expectedRewardsAT1 = accruedRewardsSG1.mul(WeiPerEther).div(tokensToAllocate) + const contractRewardsAT1 = ( + await rewardsManager.getAccRewardsPerAllocatedToken(subgraphDeploymentID1) + )[0] + expect(expectedRewardsAT1).eq(contractRewardsAT1) + }) + }) + + describe('onSubgraphAllocationUpdate', function () { + it('update the accumulated rewards for allocated tokens state', async function () { + // Update total signalled + const signalled1 = toGRT('1500') + await curation.connect(curator1).mint(subgraphDeploymentID1, signalled1, 0) + + // Allocate + const tokensToAllocate = toGRT('12500') + await staking.connect(indexer1).stake(tokensToAllocate) + await staking + .connect(indexer1) + .allocateFrom( + indexer1.address, + subgraphDeploymentID1, + tokensToAllocate, + allocationID1, + metadata, + await channelKey1.generateProof(indexer1.address), + ) + + // Jump + await helpers.mine(ISSUANCE_RATE_PERIODS) + + // Prepare expected results + const expectedSubgraphRewards = toGRT('1400') // 7 blocks since signaling to when we do getAccRewardsForSubgraph + const expectedRewardsAT = toGRT('0.08') // allocated during 5 blocks: 1000 GRT, divided by 12500 allocated tokens + + // Update + await rewardsManager.connect(governor).onSubgraphAllocationUpdate(subgraphDeploymentID1) + + // Check on demand results saved + const subgraph = await rewardsManager.subgraphs(subgraphDeploymentID1) + const contractSubgraphRewards = await rewardsManager.getAccRewardsForSubgraph( + subgraphDeploymentID1, + ) + const contractRewardsAT = subgraph.accRewardsPerAllocatedToken + + expect(toRound(expectedSubgraphRewards)).eq(toRound(contractSubgraphRewards)) + expect(toRound(expectedRewardsAT.mul(1000))).eq(toRound(contractRewardsAT.mul(1000))) + }) + }) + + describe('getRewards', function () { + it('calculate rewards using the subgraph signalled + allocated tokens', async function () { + // Update total signalled + const signalled1 = toGRT('1500') + await curation.connect(curator1).mint(subgraphDeploymentID1, signalled1, 0) + + // Allocate + const tokensToAllocate = toGRT('12500') + await staking.connect(indexer1).stake(tokensToAllocate) + await staking + .connect(indexer1) + .allocateFrom( + indexer1.address, + subgraphDeploymentID1, + tokensToAllocate, + allocationID1, + metadata, + await channelKey1.generateProof(indexer1.address), + ) + + // Jump + await helpers.mine(ISSUANCE_RATE_PERIODS) + + // Rewards + const contractRewards = await rewardsManager.getRewards(staking.address, allocationID1) + + // We trust using this function in the test because we tested it + // standalone in a previous test + const contractRewardsAT1 = ( + await rewardsManager.getAccRewardsPerAllocatedToken(subgraphDeploymentID1) + )[0] + + const expectedRewards = contractRewardsAT1.mul(tokensToAllocate).div(WeiPerEther) + expect(expectedRewards).eq(contractRewards) + }) + it('rewards should be zero if the allocation is closed', async function () { + // Update total signalled + const signalled1 = toGRT('1500') + await curation.connect(curator1).mint(subgraphDeploymentID1, signalled1, 0) + + // Allocate + const tokensToAllocate = toGRT('12500') + await staking.connect(indexer1).stake(tokensToAllocate) + await staking + .connect(indexer1) + .allocateFrom( + indexer1.address, + subgraphDeploymentID1, + tokensToAllocate, + allocationID1, + metadata, + await channelKey1.generateProof(indexer1.address), + ) + + // Jump + await helpers.mine(ISSUANCE_RATE_PERIODS) + await helpers.mineEpoch(epochManager) + + // Close allocation + await staking.connect(indexer1).closeAllocation(allocationID1, randomHexBytes()) + + // Rewards + const contractRewards = await rewardsManager.getRewards(staking.address, allocationID1) + expect(contractRewards).eq(BigNumber.from(0)) + }) + it('rewards should be zero if the allocation does not exist', async function () { + // Rewards + const contractRewards = await rewardsManager.getRewards(staking.address, allocationIDNull) + expect(contractRewards).eq(BigNumber.from(0)) + }) + }) + + describe('takeRewards', function () { + interface DelegationParameters { + indexingRewardCut: BigNumber + queryFeeCut: BigNumber + cooldownBlocks: number + } + + async function setupIndexerAllocation() { + // Setup + await epochManager.connect(governor).setEpochLength(10) + + // Update total signalled + const signalled1 = toGRT('1500') + await curation.connect(curator1).mint(subgraphDeploymentID1, signalled1, 0) + + // Allocate + const tokensToAllocate = toGRT('12500') + await staking.connect(indexer1).stake(tokensToAllocate) + await staking + .connect(indexer1) + .allocateFrom( + indexer1.address, + subgraphDeploymentID1, + tokensToAllocate, + allocationID1, + metadata, + await channelKey1.generateProof(indexer1.address), + ) + } + + async function setupIndexerAllocationSignalingAfter() { + // Setup + await epochManager.connect(governor).setEpochLength(10) + + // Allocate + const tokensToAllocate = toGRT('12500') + await staking.connect(indexer1).stake(tokensToAllocate) + await staking + .connect(indexer1) + .allocateFrom( + indexer1.address, + subgraphDeploymentID1, + tokensToAllocate, + allocationID1, + metadata, + await channelKey1.generateProof(indexer1.address), + ) + + // Update total signalled + const signalled1 = toGRT('1500') + await curation.connect(curator1).mint(subgraphDeploymentID1, signalled1, 0) + } + + async function setupIndexerAllocationWithDelegation( + tokensToDelegate: BigNumber, + delegationParams: DelegationParameters, + ) { + const tokensToAllocate = toGRT('12500') + + // Setup + await epochManager.connect(governor).setEpochLength(10) + + // Transfer some funds from the curator, I don't want to mint new tokens + await grt.connect(curator1).transfer(delegator.address, tokensToDelegate) + await grt.connect(delegator).approve(staking.address, tokensToDelegate) + + // Stake and set delegation parameters + await staking.connect(indexer1).stake(tokensToAllocate) + await staking + .connect(indexer1) + .setDelegationParameters( + delegationParams.indexingRewardCut, + delegationParams.queryFeeCut, + 0, + ) + + // Delegate + await staking.connect(delegator).delegate(indexer1.address, tokensToDelegate) + + // Update total signalled + const signalled1 = toGRT('1500') + await curation.connect(curator1).mint(subgraphDeploymentID1, signalled1, 0) + + // Allocate + await staking + .connect(indexer1) + .allocateFrom( + indexer1.address, + subgraphDeploymentID1, + tokensToAllocate, + allocationID1, + metadata, + await channelKey1.generateProof(indexer1.address), + ) + } + + it('should distribute rewards on closed allocation and stake', async function () { + // Align with the epoch boundary + await helpers.mineEpoch(epochManager) + // Setup + await setupIndexerAllocation() + + // Jump + await helpers.mineEpoch(epochManager) + + // Before state + const beforeTokenSupply = await grt.totalSupply() + const beforeIndexer1Stake = await staking.getIndexerStakedTokens(indexer1.address) + const beforeIndexer1Balance = await grt.balanceOf(indexer1.address) + const beforeStakingBalance = await grt.balanceOf(staking.address) + + // All the rewards in this subgraph go to this allocation. + // Rewards per token will be (issuancePerBlock * nBlocks) / allocatedTokens + // The first snapshot is after allocating, that is 2 blocks after the signal is minted. + // The final snapshot is when we close the allocation, that happens 9 blocks after signal is minted. + // So the rewards will be ((issuancePerBlock * 7) / allocatedTokens) * allocatedTokens + const expectedIndexingRewards = toGRT('1400') + + // Close allocation. At this point rewards should be collected for that indexer + const tx = await staking.connect(indexer1).closeAllocation(allocationID1, randomHexBytes()) + const receipt = await tx.wait() + const event = rewardsManager.interface.parseLog(receipt.logs[1]).args + expect(event.indexer).eq(indexer1.address) + expect(event.allocationID).eq(allocationID1) + expect(toRound(event.amount)).eq(toRound(expectedIndexingRewards)) + + // After state + const afterTokenSupply = await grt.totalSupply() + const afterIndexer1Stake = await staking.getIndexerStakedTokens(indexer1.address) + const afterIndexer1Balance = await grt.balanceOf(indexer1.address) + const afterStakingBalance = await grt.balanceOf(staking.address) + + // Check that rewards are put into indexer stake + const expectedIndexerStake = beforeIndexer1Stake.add(expectedIndexingRewards) + const expectedTokenSupply = beforeTokenSupply.add(expectedIndexingRewards) + // Check stake should have increased with the rewards staked + expect(toRound(afterIndexer1Stake)).eq(toRound(expectedIndexerStake)) + // Check indexer balance remains the same + expect(afterIndexer1Balance).eq(beforeIndexer1Balance) + // Check indexing rewards are kept in the staking contract + expect(toRound(afterStakingBalance)).eq( + toRound(beforeStakingBalance.add(expectedIndexingRewards)), + ) + // Check that tokens have been minted + expect(toRound(afterTokenSupply)).eq(toRound(expectedTokenSupply)) + }) + + it('does not revert with an underflow if the minimum signal changes', async function () { + // Align with the epoch boundary + await helpers.mineEpoch(epochManager) + // Setup + await setupIndexerAllocation() + + await rewardsManager.connect(governor).setMinimumSubgraphSignal(toGRT(14000)) + + // Jump + await helpers.mineEpoch(epochManager) + + // Close allocation. At this point rewards should be collected for that indexer + const tx = staking.connect(indexer1).closeAllocation(allocationID1, randomHexBytes()) + await expect(tx) + .emit(rewardsManager, 'HorizonRewardsAssigned') + .withArgs(indexer1.address, allocationID1, toBN(0)) + }) + + it('does not revert with an underflow if the minimum signal changes, and signal came after allocation', async function () { + // Align with the epoch boundary + await helpers.mineEpoch(epochManager) + // Setup + await setupIndexerAllocationSignalingAfter() + + await rewardsManager.connect(governor).setMinimumSubgraphSignal(toGRT(14000)) + + // Jump + await helpers.mineEpoch(epochManager) + + // Close allocation. At this point rewards should be collected for that indexer + const tx = staking.connect(indexer1).closeAllocation(allocationID1, randomHexBytes()) + await expect(tx) + .emit(rewardsManager, 'HorizonRewardsAssigned') + .withArgs(indexer1.address, allocationID1, toBN(0)) + }) + + it('does not revert if signal was already under minimum', async function () { + await rewardsManager.connect(governor).setMinimumSubgraphSignal(toGRT(2000)) + // Align with the epoch boundary + await helpers.mineEpoch(epochManager) + // Setup + await setupIndexerAllocation() + + // Jump + await helpers.mineEpoch(epochManager) + // Close allocation. At this point rewards should be collected for that indexer + const tx = staking.connect(indexer1).closeAllocation(allocationID1, randomHexBytes()) + + await expect(tx) + .emit(rewardsManager, 'HorizonRewardsAssigned') + .withArgs(indexer1.address, allocationID1, toBN(0)) + }) + + it('should distribute rewards on closed allocation and send to destination', async function () { + const destinationAddress = randomHexBytes(20) + await staking.connect(indexer1).setRewardsDestination(destinationAddress) + + // Align with the epoch boundary + await helpers.mineEpoch(epochManager) + // Setup + await setupIndexerAllocation() + + // Jump + await helpers.mineEpoch(epochManager) + + // Before state + const beforeTokenSupply = await grt.totalSupply() + const beforeIndexer1Stake = await staking.getIndexerStakedTokens(indexer1.address) + const beforeDestinationBalance = await grt.balanceOf(destinationAddress) + const beforeStakingBalance = await grt.balanceOf(staking.address) + + // All the rewards in this subgraph go to this allocation. + // Rewards per token will be (issuancePerBlock * nBlocks) / allocatedTokens + // The first snapshot is after allocating, that is 2 blocks after the signal is minted. + // The final snapshot is when we close the allocation, that happens 9 blocks after signal is minted. + // So the rewards will be ((issuancePerBlock * 7) / allocatedTokens) * allocatedTokens + const expectedIndexingRewards = toGRT('1400') + + // Close allocation. At this point rewards should be collected for that indexer + const tx = await staking.connect(indexer1).closeAllocation(allocationID1, randomHexBytes()) + const receipt = await tx.wait() + const event = rewardsManager.interface.parseLog(receipt.logs[1]).args + expect(event.indexer).eq(indexer1.address) + expect(event.allocationID).eq(allocationID1) + expect(toRound(event.amount)).eq(toRound(expectedIndexingRewards)) + + // After state + const afterTokenSupply = await grt.totalSupply() + const afterIndexer1Stake = await staking.getIndexerStakedTokens(indexer1.address) + const afterDestinationBalance = await grt.balanceOf(destinationAddress) + const afterStakingBalance = await grt.balanceOf(staking.address) + + // Check that rewards are properly assigned + const expectedIndexerStake = beforeIndexer1Stake + const expectedTokenSupply = beforeTokenSupply.add(expectedIndexingRewards) + // Check stake should not have changed + expect(toRound(afterIndexer1Stake)).eq(toRound(expectedIndexerStake)) + // Check indexing rewards are received by the rewards destination + expect(toRound(afterDestinationBalance)).eq( + toRound(beforeDestinationBalance.add(expectedIndexingRewards)), + ) + // Check indexing rewards were not sent to the staking contract + expect(afterStakingBalance).eq(beforeStakingBalance) + // Check that tokens have been minted + expect(toRound(afterTokenSupply)).eq(toRound(expectedTokenSupply)) + }) + + it('should distribute rewards on closed allocation w/delegators', async function () { + // Setup + const delegationParams = { + indexingRewardCut: toBN('823000'), // 82.30% + queryFeeCut: toBN('80000'), // 8% + cooldownBlocks: 0, + } + const tokensToDelegate = toGRT('2000') + + // Align with the epoch boundary + await helpers.mineEpoch(epochManager) + // Setup the allocation and delegators + await setupIndexerAllocationWithDelegation(tokensToDelegate, delegationParams) + + // Jump + await helpers.mineEpoch(epochManager) + + // Before state + const beforeTokenSupply = await grt.totalSupply() + const beforeDelegationPool = await staking.delegationPools(indexer1.address) + const beforeIndexer1Stake = await staking.getIndexerStakedTokens(indexer1.address) + + // Close allocation. At this point rewards should be collected for that indexer + await staking.connect(indexer1).closeAllocation(allocationID1, randomHexBytes()) + + // After state + const afterTokenSupply = await grt.totalSupply() + const afterDelegationPool = await staking.delegationPools(indexer1.address) + const afterIndexer1Stake = await staking.getIndexerStakedTokens(indexer1.address) + + // Check that rewards are put into indexer stake (only indexer cut) + // Check that rewards are put into delegators pool accordingly + + // All the rewards in this subgraph go to this allocation. + // Rewards per token will be (issuancePerBlock * nBlocks) / allocatedTokens + // The first snapshot is after allocating, that is 1 block after the signal is minted. + // The final snapshot is when we close the allocation, that happens 4 blocks after signal is minted. + // So the rewards will be ((issuancePerBlock * 3) / allocatedTokens) * allocatedTokens + const expectedIndexingRewards = toGRT('600') + // Calculate delegators cut + const indexerRewards = delegationParams.indexingRewardCut + .mul(expectedIndexingRewards) + .div(toBN(MAX_PPM)) + // Calculate indexer cut + const delegatorsRewards = expectedIndexingRewards.sub(indexerRewards) + // Check + const expectedIndexerStake = beforeIndexer1Stake.add(indexerRewards) + const expectedDelegatorsPoolTokens = beforeDelegationPool.tokens.add(delegatorsRewards) + const expectedTokenSupply = beforeTokenSupply.add(expectedIndexingRewards) + expect(toRound(afterIndexer1Stake)).eq(toRound(expectedIndexerStake)) + expect(toRound(afterDelegationPool.tokens)).eq(toRound(expectedDelegatorsPoolTokens)) + // Check that tokens have been minted + expect(toRound(afterTokenSupply)).eq(toRound(expectedTokenSupply)) + }) + + it('should deny rewards if subgraph on denylist', async function () { + // Setup + await rewardsManager.connect(governor).setSubgraphAvailabilityOracle(governor.address) + await rewardsManager.connect(governor).setDenied(subgraphDeploymentID1, true) + await setupIndexerAllocation() + + // Jump + await helpers.mineEpoch(epochManager) + + // Close allocation. At this point rewards should be collected for that indexer + const tx = staking.connect(indexer1).closeAllocation(allocationID1, randomHexBytes()) + await expect(tx) + .emit(rewardsManager, 'RewardsDenied') + .withArgs(indexer1.address, allocationID1) + }) + + it('should not distribute rewards if allocation is not active', async function () { + // Setup + await setupIndexerAllocation() + + // Jump and close allocation + await helpers.mineEpoch(epochManager) + await staking.connect(indexer1).closeAllocation(allocationID1, randomHexBytes()) + + // Jump some more + await helpers.mineEpoch(epochManager, 10) + + // Impersonate staking contract + await impersonateAccount(staking.address) + const impersonatedStaking = await hre.ethers.getSigner(staking.address) + await setBalance(staking.address, toGRT('1000000')) + + // Distribute rewards + const tx = await rewardsManager.connect(impersonatedStaking).takeRewards(allocationID1) + const receipt = await tx.wait() + const event = rewardsManager.interface.parseLog(receipt.logs[0]).args + expect(event.indexer).eq(indexer1.address) + expect(event.allocationID).eq(allocationID1) + expect(toRound(event.amount)).eq(toRound(BigNumber.from(0))) + }) + }) + }) + + describe('edge scenarios', function () { + it('close allocation on a subgraph that no longer have signal', async function () { + // Update total signalled + const signalled1 = toGRT('1500') + await curation.connect(curator1).mint(subgraphDeploymentID1, signalled1, 0) + + // Allocate + const tokensToAllocate = toGRT('12500') + await staking.connect(indexer1).stake(tokensToAllocate) + await staking + .connect(indexer1) + .allocateFrom( + indexer1.address, + subgraphDeploymentID1, + tokensToAllocate, + allocationID1, + metadata, + await channelKey1.generateProof(indexer1.address), + ) + + // Jump + await helpers.mineEpoch(epochManager) + + // Remove all signal from the subgraph + const curatorShares = await curation.getCuratorSignal(curator1.address, subgraphDeploymentID1) + await curation.connect(curator1).burn(subgraphDeploymentID1, curatorShares, 0) + + // Close allocation. At this point rewards should be collected for that indexer + await staking.connect(indexer1).closeAllocation(allocationID1, randomHexBytes()) + }) + }) + + describe('multiple allocations', function () { + it('two allocations in the same block with a GRT burn in the middle should succeed', async function () { + // If rewards are not monotonically increasing, this can trigger + // a subtraction overflow error as seen in mainnet tx: + // 0xb6bf7bbc446720a7409c482d714aebac239dd62e671c3c94f7e93dd3a61835ab + await helpers.mineEpoch(epochManager) + + // Setup + await epochManager.connect(governor).setEpochLength(10) + + // Update total signalled + const signalled1 = toGRT('1500') + await curation.connect(curator1).mint(subgraphDeploymentID1, signalled1, 0) + + // Stake + const tokensToStake = toGRT('12500') + await staking.connect(indexer1).stake(tokensToStake) + + // Allocate simultaneously, burning in the middle + const tokensToAlloc = toGRT('5000') + await helpers.setAutoMine(false) + const tx1 = await staking + .connect(indexer1) + .allocateFrom( + indexer1.address, + subgraphDeploymentID1, + tokensToAlloc, + allocationID1, + metadata, + await channelKey1.generateProof(indexer1.address), + ) + const tx2 = await grt.connect(indexer1).burn(toGRT(1)) + const tx3 = await staking + .connect(indexer1) + .allocateFrom( + indexer1.address, + subgraphDeploymentID1, + tokensToAlloc, + allocationID2, + metadata, + await channelKey2.generateProof(indexer1.address), + ) + + await helpers.mine() + await helpers.setAutoMine(true) + + await expect(tx1).emit(staking, 'AllocationCreated') + await expect(tx2).emit(grt, 'Transfer') + await expect(tx3).emit(staking, 'AllocationCreated') + }) + it('two simultanous-similar allocations should get same amount of rewards', async function () { + await helpers.mineEpoch(epochManager) + + // Setup + await epochManager.connect(governor).setEpochLength(10) + + // Update total signalled + const signalled1 = toGRT('1500') + await curation.connect(curator1).mint(subgraphDeploymentID1, signalled1, 0) + + // Stake + const tokensToStake = toGRT('12500') + await staking.connect(indexer1).stake(tokensToStake) + + // Allocate simultaneously + const tokensToAlloc = toGRT('5000') + const tx1 = await staking.populateTransaction.allocateFrom( + indexer1.address, + subgraphDeploymentID1, + tokensToAlloc, + allocationID1, + metadata, + await channelKey1.generateProof(indexer1.address), + ) + const tx2 = await staking.populateTransaction.allocateFrom( + indexer1.address, + subgraphDeploymentID1, + tokensToAlloc, + allocationID2, + metadata, + await channelKey2.generateProof(indexer1.address), + ) + await staking.connect(indexer1).multicall([tx1.data, tx2.data]) + + // Jump + await helpers.mineEpoch(epochManager) + + // Close allocations simultaneously + const tx3 = await staking.populateTransaction.closeAllocation(allocationID1, randomHexBytes()) + const tx4 = await staking.populateTransaction.closeAllocation(allocationID2, randomHexBytes()) + const tx5 = await staking.connect(indexer1).multicall([tx3.data, tx4.data]) + + // Both allocations should receive the same amount of rewards + const receipt = await tx5.wait() + const event1 = rewardsManager.interface.parseLog(receipt.logs[1]).args + const event2 = rewardsManager.interface.parseLog(receipt.logs[5]).args + expect(event1.amount).eq(event2.amount) + }) + }) + + describe('rewards progression when collecting query fees', function () { + it('collect query fees with two subgraphs and one allocation', async function () { + async function getRewardsAccrual(subgraphs) { + const [sg1, sg2] = await Promise.all( + subgraphs.map(sg => rewardsManager.getAccRewardsForSubgraph(sg)), + ) + return { + sg1, + sg2, + all: sg1.add(sg2), + } + } + + // set curation percentage + await staking.connect(governor).setCurationPercentage(100000) + + // allow the asset holder + const tokensToCollect = toGRT('10000') + + // signal in two subgraphs in the same block + const subgraphs = [subgraphDeploymentID1, subgraphDeploymentID2] + for (const sub of subgraphs) { + await curation.connect(curator1).mint(sub, toGRT('1500'), 0) + } + + // snapshot block before any accrual (we substract 1 because accrual starts after the first mint happens) + const b1 = await epochManager.blockNum().then(x => x.toNumber() - 1) + + // allocate + const tokensToAllocate = toGRT('12500') + await staking + .connect(indexer1) + .multicall([ + await staking.populateTransaction.stake(tokensToAllocate).then(tx => tx.data), + await staking.populateTransaction + .allocateFrom( + indexer1.address, + subgraphDeploymentID1, + tokensToAllocate, + allocationID1, + metadata, + await channelKey1.generateProof(indexer1.address), + ) + .then(tx => tx.data), + ]) + + // move time fwd + await helpers.mineEpoch(epochManager) + + // collect funds into staking for that sub + await staking.connect(assetHolder).collect(tokensToCollect, allocationID1) + + // check rewards diff + await rewardsManager.getRewards(staking.address, allocationID1).then(formatGRT) + + await helpers.mine() + const accrual = await getRewardsAccrual(subgraphs) + const b2 = await epochManager.blockNum().then(x => x.toNumber()) + + // round comparison because there is a small precision error due to dividing and accrual per signal + expect(toRound(accrual.all)).eq(toRound(ISSUANCE_PER_BLOCK.mul(b2 - b1))) + }) + }) +}) diff --git a/packages/contracts/test/unit/rewards/subgraphAvailability.test.ts b/packages/contracts/test/unit/rewards/subgraphAvailability.test.ts new file mode 100644 index 000000000..93352a5b1 --- /dev/null +++ b/packages/contracts/test/unit/rewards/subgraphAvailability.test.ts @@ -0,0 +1,460 @@ +import hre from 'hardhat' +import { expect } from 'chai' +import { constants } from 'ethers' + +import { ethers } from 'hardhat' + +import type { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers' + +import { SubgraphAvailabilityManager } from '../../../build/types/SubgraphAvailabilityManager' +import { IRewardsManager } from '../../../build/types/IRewardsManager' + +import { NetworkFixture } from '../lib/fixtures' + +import { + deploy, + DeployType, + GraphNetworkContracts, + randomAddress, + randomHexBytes, +} from '@graphprotocol/sdk' + +const { AddressZero } = constants + +describe('SubgraphAvailabilityManager', () => { + const graph = hre.graph() + let me: SignerWithAddress + let governor: SignerWithAddress + + let oracles: string[] + let oracleOne: SignerWithAddress + let oracleTwo: SignerWithAddress + let oracleThree: SignerWithAddress + let oracleFour: SignerWithAddress + let oracleFive: SignerWithAddress + + let newOracle: SignerWithAddress + + let fixture: NetworkFixture + + const executionThreshold = '3' + const voteTimeLimit = '5' // 5 seconds + + let contracts: GraphNetworkContracts + let rewardsManager: IRewardsManager + let subgraphAvailabilityManager: SubgraphAvailabilityManager + + const subgraphDeploymentID1 = randomHexBytes() + const subgraphDeploymentID2 = randomHexBytes() + const subgraphDeploymentID3 = randomHexBytes() + + before(async () => { + [me, oracleOne, oracleTwo, oracleThree, oracleFour, oracleFive, newOracle] + = await graph.getTestAccounts() + ;({ governor } = await graph.getNamedAccounts()) + + oracles = [ + oracleOne.address, + oracleTwo.address, + oracleThree.address, + oracleFour.address, + oracleFive.address, + ] + + fixture = new NetworkFixture(graph.provider) + contracts = await fixture.load(governor) + rewardsManager = contracts.RewardsManager as IRewardsManager + const deployResult = await deploy(DeployType.Deploy, governor, { + name: 'SubgraphAvailabilityManager', + args: [governor.address, rewardsManager.address, executionThreshold, voteTimeLimit, oracles], + }) + subgraphAvailabilityManager = deployResult.contract as SubgraphAvailabilityManager + + await rewardsManager + .connect(governor) + .setSubgraphAvailabilityOracle(subgraphAvailabilityManager.address) + }) + + beforeEach(async function () { + await fixture.setUp() + }) + + afterEach(async function () { + await fixture.tearDown() + }) + + describe('deployment', () => { + it('should deploy', function () { + expect(subgraphAvailabilityManager.address).to.be.properAddress + }) + + it('should revert if oracles array is less than 5', async () => { + await expect( + deploy(DeployType.Deploy, governor, { + name: 'SubgraphAvailabilityManager', + args: [ + governor.address, + rewardsManager.address, + executionThreshold, + voteTimeLimit, + [oracleOne.address, oracleTwo.address, oracleThree.address, oracleFour.address], + ], + }), + ).to.be.reverted + }) + + it('should revert if an oracle is address zero', async () => { + await expect( + deploy(DeployType.Deploy, governor, { + name: 'SubgraphAvailabilityManager', + args: [ + governor.address, + rewardsManager.address, + executionThreshold, + voteTimeLimit, + [ + AddressZero, + oracleTwo.address, + oracleThree.address, + oracleFour.address, + oracleFive.address, + ], + ], + }), + ).to.be.revertedWith('SAM: oracle cannot be address zero') + }) + + it('should revert if governor is address zero', async () => { + await expect( + deploy(DeployType.Deploy, governor, { + name: 'SubgraphAvailabilityManager', + args: [AddressZero, rewardsManager.address, executionThreshold, voteTimeLimit, oracles], + }), + ).to.be.revertedWith('SAM: governor must be set') + }) + + it('should revert if rewardsManager is address zero', async () => { + await expect( + deploy(DeployType.Deploy, governor, { + name: 'SubgraphAvailabilityManager', + args: [governor.address, AddressZero, executionThreshold, voteTimeLimit, oracles], + }), + ).to.be.revertedWith('SAM: rewardsManager must be set') + }) + + it('should revert if executionThreshold is too low', async () => { + await expect( + deploy(DeployType.Deploy, governor, { + name: 'SubgraphAvailabilityManager', + args: [governor.address, rewardsManager.address, '2', voteTimeLimit, oracles], + }), + ).to.be.revertedWith('SAM: executionThreshold too low') + }) + + it('should revert if executionThreshold is too high', async () => { + await expect( + deploy(DeployType.Deploy, governor, { + name: 'SubgraphAvailabilityManager', + args: [governor.address, rewardsManager.address, '6', voteTimeLimit, oracles], + }), + ).to.be.revertedWith('SAM: executionThreshold too high') + }) + }) + + describe('initializer', () => { + it('should init governor', async () => { + expect(await subgraphAvailabilityManager.governor()).to.be.equal(governor.address) + }) + + it('should init executionThreshold', async () => { + expect(await subgraphAvailabilityManager.executionThreshold()).to.be.equal(executionThreshold) + }) + + it('should init voteTimeLimit', async () => { + expect(await subgraphAvailabilityManager.voteTimeLimit()).to.be.equal(voteTimeLimit) + }) + + it('should init oracles', async () => { + for (let i = 0; i < oracles.length; i++) { + expect(await subgraphAvailabilityManager.oracles(i)).to.be.equal(oracles[i]) + } + }) + }) + + describe('set vote limit', function () { + it('sets voteTimeLimit successfully', async () => { + const newVoteTimeLimit = 10 + await expect(subgraphAvailabilityManager.connect(governor).setVoteTimeLimit(newVoteTimeLimit)) + .emit(subgraphAvailabilityManager, 'VoteTimeLimitSet') + .withArgs(newVoteTimeLimit) + expect(await subgraphAvailabilityManager.voteTimeLimit()).to.be.equal(newVoteTimeLimit) + }) + + it('should fail if not called by governor', async () => { + const newVoteTimeLimit = 10 + await expect( + subgraphAvailabilityManager.connect(me).setVoteTimeLimit(newVoteTimeLimit), + ).to.be.revertedWith('Only Governor can call') + }) + }) + + describe('set oracles', () => { + it('sets an oracle successfully', async () => { + const oracle = randomAddress() + await expect(subgraphAvailabilityManager.connect(governor).setOracle(0, oracle)) + .emit(subgraphAvailabilityManager, 'OracleSet') + .withArgs(0, oracle) + expect(await subgraphAvailabilityManager.oracles(0)).to.be.equal(oracle) + }) + + it('should fail if not called by governor', async () => { + const oracle = randomAddress() + await expect(subgraphAvailabilityManager.connect(me).setOracle(0, oracle)).to.be.revertedWith( + 'Only Governor can call', + ) + }) + + it('should fail if setting oracle to address zero', async () => { + await expect( + subgraphAvailabilityManager.connect(governor).setOracle(0, AddressZero), + ).to.revertedWith('SAM: oracle cannot be address zero') + }) + + it('should fail if index is out of bounds', async () => { + const oracle = randomAddress() + await expect( + subgraphAvailabilityManager.connect(governor).setOracle(5, oracle), + ).to.be.revertedWith('SAM: index out of bounds') + }) + }) + + describe('voting', function () { + it('votes denied successfully', async () => { + const denied = true + const tx = await subgraphAvailabilityManager + .connect(oracleOne) + .vote(subgraphDeploymentID1, denied, 0) + const timestamp = (await ethers.provider.getBlock('latest')).timestamp + await expect(tx) + .to.emit(subgraphAvailabilityManager, 'OracleVote') + .withArgs(subgraphDeploymentID1, denied, 0, timestamp) + }) + + it('should fail if not called by oracle', async () => { + const denied = true + await expect( + subgraphAvailabilityManager.connect(me).vote(subgraphDeploymentID1, denied, 0), + ).to.be.revertedWith('SAM: caller must be oracle') + }) + + it('should fail if index is out of bounds', async () => { + const denied = true + await expect( + subgraphAvailabilityManager.connect(oracleOne).vote(subgraphDeploymentID1, denied, 5), + ).to.be.revertedWith('SAM: index out of bounds') + }) + + it('should fail if oracle used an incorrect index', async () => { + const denied = true + await expect( + subgraphAvailabilityManager.connect(oracleOne).vote(subgraphDeploymentID1, denied, 1), + ).to.be.revertedWith('SAM: caller must be oracle') + }) + + it('should still be allowed if only one oracle has voted', async () => { + const denied = true + const tx = await subgraphAvailabilityManager + .connect(oracleOne) + .vote(subgraphDeploymentID1, denied, 0) + await expect(tx).to.emit(subgraphAvailabilityManager, 'OracleVote') + expect(await rewardsManager.isDenied(subgraphDeploymentID1)).to.be.false + }) + + it('should be denied or allowed if majority of oracles have voted', async () => { + // 3/5 oracles vote denied = true + let denied = true + await subgraphAvailabilityManager.connect(oracleOne).vote(subgraphDeploymentID1, denied, 0) + await subgraphAvailabilityManager.connect(oracleTwo).vote(subgraphDeploymentID1, denied, 1) + const tx = await subgraphAvailabilityManager + .connect(oracleThree) + .vote(subgraphDeploymentID1, denied, 2) + await expect(tx) + .to.emit(rewardsManager, 'RewardsDenylistUpdated') + .withArgs(subgraphDeploymentID1, tx.blockNumber) + + // check events order + const receipt = await tx.wait() + expect(receipt.events[0].event).to.be.equal('OracleVote') + const rewardsManangerEvent = rewardsManager.interface.parseLog(receipt.logs[1]).name + expect(rewardsManangerEvent).to.be.equal('RewardsDenylistUpdated') + + // check that subgraph is denied + expect(await rewardsManager.isDenied(subgraphDeploymentID1)).to.be.true + + // 3/5 oracles vote denied = false + denied = false + await subgraphAvailabilityManager.connect(oracleOne).vote(subgraphDeploymentID1, denied, 0) + await subgraphAvailabilityManager.connect(oracleTwo).vote(subgraphDeploymentID1, denied, 1) + await subgraphAvailabilityManager.connect(oracleThree).vote(subgraphDeploymentID1, denied, 2) + + // check that subgraph is not denied + expect(await rewardsManager.isDenied(subgraphDeploymentID1)).to.be.false + }) + + it('should not be denied if the same oracle votes three times', async () => { + const denied = true + await subgraphAvailabilityManager.connect(oracleOne).vote(subgraphDeploymentID1, denied, 0) + await subgraphAvailabilityManager.connect(oracleOne).vote(subgraphDeploymentID1, denied, 0) + await subgraphAvailabilityManager.connect(oracleOne).vote(subgraphDeploymentID1, denied, 0) + + expect(await rewardsManager.isDenied(subgraphDeploymentID1)).to.be.false + }) + + it('should not be denied if voteTimeLimit has passed and not enough oracles have voted', async () => { + // 2/3 oracles vote denied = true + const denied = true + await subgraphAvailabilityManager.connect(oracleOne).vote(subgraphDeploymentID1, denied, 0) + await subgraphAvailabilityManager.connect(oracleTwo).vote(subgraphDeploymentID1, denied, 1) + + // increase time by 6 seconds + await ethers.provider.send('evm_increaseTime', [6]) + // last oracle votes denied = true + const tx = await subgraphAvailabilityManager + .connect(oracleThree) + .vote(subgraphDeploymentID1, denied, 2) + await expect(tx).to.not.emit(rewardsManager, 'RewardsDenylistUpdated') + + // subgraph state didn't change because enough time has passed so that + // previous votes are no longer valid + expect(await rewardsManager.isDenied(subgraphDeploymentID1)).to.be.false + }) + + it('clears opposite vote when voting', async () => { + const denied = true + await subgraphAvailabilityManager.connect(oracleOne).vote(subgraphDeploymentID1, denied, 0) + await subgraphAvailabilityManager.connect(oracleTwo).vote(subgraphDeploymentID1, denied, 1) + await subgraphAvailabilityManager.connect(oracleThree).vote(subgraphDeploymentID1, denied, 2) + + // 3/5 oracles vote denied = true so subgraph is denied + expect(await rewardsManager.isDenied(subgraphDeploymentID1)).to.be.true + + // oracleOne changes its vote to denied = false + await subgraphAvailabilityManager.connect(oracleOne).vote(subgraphDeploymentID1, false, 0) + + // last deny vote should be 0 for oracleOne + expect( + await subgraphAvailabilityManager.lastDenyVote(0, subgraphDeploymentID1, 0), + ).to.be.equal(0) + + // executionThreshold isn't met now since oracleOne changed its vote + expect(await subgraphAvailabilityManager.checkVotes(subgraphDeploymentID1, denied)).to.be + .false + + // subgraph is still denied in rewards manager because only one oracle changed its vote + expect(await rewardsManager.isDenied(subgraphDeploymentID1)).to.be.true + }) + }) + + describe('vote many', function () { + it('votes many successfully', async () => { + const subgraphs = [subgraphDeploymentID1, subgraphDeploymentID2, subgraphDeploymentID3] + const denied = [true, false, true] + const tx = await subgraphAvailabilityManager.connect(oracleOne).voteMany(subgraphs, denied, 0) + const timestamp = (await ethers.provider.getBlock('latest')).timestamp + await expect(tx) + .to.emit(subgraphAvailabilityManager, 'OracleVote') + .withArgs(subgraphDeploymentID1, true, 0, timestamp) + await expect(tx) + .to.emit(subgraphAvailabilityManager, 'OracleVote') + .withArgs(subgraphDeploymentID2, false, 0, timestamp) + await expect(tx) + .to.emit(subgraphAvailabilityManager, 'OracleVote') + .withArgs(subgraphDeploymentID3, true, 0, timestamp) + }) + + it('should change subgraph state if majority of oracles have voted', async () => { + const subgraphs = [subgraphDeploymentID1, subgraphDeploymentID2, subgraphDeploymentID3] + const denied = [true, false, true] + // 3/5 oracles vote denied = true + await subgraphAvailabilityManager.connect(oracleOne).voteMany(subgraphs, denied, 0) + await subgraphAvailabilityManager.connect(oracleTwo).voteMany(subgraphs, denied, 1) + + const tx = await subgraphAvailabilityManager + .connect(oracleThree) + .voteMany(subgraphs, denied, 2) + + await expect(tx) + .to.emit(rewardsManager, 'RewardsDenylistUpdated') + .withArgs(subgraphDeploymentID1, tx.blockNumber) + await expect(tx) + .to.emit(rewardsManager, 'RewardsDenylistUpdated') + .withArgs(subgraphDeploymentID2, 0) + await expect(tx) + .to.emit(rewardsManager, 'RewardsDenylistUpdated') + .withArgs(subgraphDeploymentID3, tx.blockNumber) + + // check that subgraphs are denied + expect(await rewardsManager.isDenied(subgraphDeploymentID1)).to.be.true + expect(await rewardsManager.isDenied(subgraphDeploymentID2)).to.be.false + expect(await rewardsManager.isDenied(subgraphDeploymentID3)).to.be.true + }) + + it('should fail if not called by oracle', async () => { + const subgraphs = [subgraphDeploymentID1, subgraphDeploymentID2, subgraphDeploymentID3] + const denied = [true, false, true] + await expect( + subgraphAvailabilityManager.connect(me).voteMany(subgraphs, denied, 0), + ).to.be.revertedWith('SAM: caller must be oracle') + }) + + it('should fail if index is out of bounds', async () => { + const subgraphs = [subgraphDeploymentID1, subgraphDeploymentID2, subgraphDeploymentID3] + const denied = [true, false, true] + await expect( + subgraphAvailabilityManager.connect(oracleOne).voteMany(subgraphs, denied, 5), + ).to.be.revertedWith('SAM: index out of bounds') + }) + + it('should fail if oracle used an incorrect index', async () => { + const subgraphs = [subgraphDeploymentID1, subgraphDeploymentID2, subgraphDeploymentID3] + const denied = [true, false, true] + await expect( + subgraphAvailabilityManager.connect(oracleOne).voteMany(subgraphs, denied, 1), + ).to.be.revertedWith('SAM: caller must be oracle') + }) + }) + + describe('refreshing votes', () => { + it('should refresh votes if an oracle is replaced', async () => { + const denied = true + // 2/3 oracles vote denied = true + await subgraphAvailabilityManager.connect(oracleOne).vote(subgraphDeploymentID1, denied, 0) + await subgraphAvailabilityManager.connect(oracleTwo).vote(subgraphDeploymentID1, denied, 1) + + // replace oracleOne with a new oracle + await subgraphAvailabilityManager.connect(governor).setOracle(2, newOracle.address) + + // new oracle votes denied = true + await subgraphAvailabilityManager.connect(newOracle).vote(subgraphDeploymentID1, denied, 2) + + // subgraph shouldn't be denied because setting a new oracle should refresh the votes + expect(await rewardsManager.isDenied(subgraphDeploymentID1)).to.be.false + }) + + it('should refresh votes if voteTimeLimit changes', async () => { + const denied = true + // 2/3 oracles vote denied = true + await subgraphAvailabilityManager.connect(oracleOne).vote(subgraphDeploymentID1, denied, 0) + await subgraphAvailabilityManager.connect(oracleTwo).vote(subgraphDeploymentID1, denied, 1) + + // change voteTimeLimit to 10 seconds + await subgraphAvailabilityManager.connect(governor).setVoteTimeLimit(10) + + // last oracle votes denied = true + await subgraphAvailabilityManager.connect(oracleThree).vote(subgraphDeploymentID1, denied, 2) + + // subgraph shouldn't be denied because voteTimeLimit should refresh the votes + expect(await rewardsManager.isDenied(subgraphDeploymentID1)).to.be.false + }) + }) +}) diff --git a/packages/contracts/test/unit/serviceRegisty.test.ts b/packages/contracts/test/unit/serviceRegisty.test.ts new file mode 100644 index 000000000..e268a369a --- /dev/null +++ b/packages/contracts/test/unit/serviceRegisty.test.ts @@ -0,0 +1,142 @@ +import hre from 'hardhat' +import { expect } from 'chai' + +import { ServiceRegistry } from '../../build/types/ServiceRegistry' +import { IStaking } from '../../build/types/IStaking' + +import { NetworkFixture } from './lib/fixtures' +import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers' +import { GraphNetworkContracts } from '@graphprotocol/sdk' + +describe('ServiceRegistry', () => { + const graph = hre.graph() + let governor: SignerWithAddress + let indexer: SignerWithAddress + let operator: SignerWithAddress + + let fixture: NetworkFixture + + let contracts: GraphNetworkContracts + let serviceRegistry: ServiceRegistry + let staking: IStaking + + const shouldRegister = async (url: string, geohash: string) => { + // Register the indexer service + const tx = serviceRegistry.connect(indexer).register(url, geohash) + await expect(tx) + .emit(serviceRegistry, 'ServiceRegistered') + .withArgs(indexer.address, url, geohash) + + // Updated state + const indexerService = await serviceRegistry.services(indexer.address) + expect(indexerService.url).eq(url) + expect(indexerService.geohash).eq(geohash) + } + + before(async function () { + [governor, indexer, operator] = await graph.getTestAccounts() + ;({ governor } = await graph.getNamedAccounts()) + fixture = new NetworkFixture(graph.provider) + contracts = await fixture.load(governor) + serviceRegistry = contracts.ServiceRegistry as ServiceRegistry + staking = contracts.Staking as IStaking + }) + + beforeEach(async function () { + await fixture.setUp() + }) + + afterEach(async function () { + await fixture.tearDown() + }) + + describe('register', function () { + const url = 'https://192.168.2.1/' + const geo = '69y7hdrhm6mp' + + it('should allow registering', async function () { + await shouldRegister(url, geo) + }) + + it('should allow registering with a very long string', async function () { + const url = 'https://' + 'a'.repeat(125) + '.com' + await shouldRegister(url, geo) + }) + + it('should allow updating a registration', async function () { + const [url1, geohash1] = ['https://thegraph.com', '69y7hdrhm6mp'] + const [url2, geohash2] = ['https://192.168.0.1', 'dr5regw2z6y'] + await shouldRegister(url1, geohash1) + await shouldRegister(url2, geohash2) + }) + + it('reject registering empty URL', async function () { + const tx = serviceRegistry.connect(indexer).register('', '') + await expect(tx).revertedWith('Service must specify a URL') + }) + + describe('operator', function () { + it('reject register from unauthorized operator', async function () { + const tx = serviceRegistry + .connect(operator) + .registerFor(indexer.address, 'http://thegraph.com', '') + await expect(tx).revertedWith('!auth') + }) + + it('should register from operator', async function () { + // Auth and register + await staking.connect(indexer).setOperator(operator.address, true) + await serviceRegistry.connect(operator).registerFor(indexer.address, url, geo) + + // Updated state + const indexerService = await serviceRegistry.services(indexer.address) + expect(indexerService.url).eq(url) + expect(indexerService.geohash).eq(geo) + }) + }) + }) + + describe('unregister', function () { + const url = 'https://192.168.2.1/' + const geo = '69y7hdrhm6mp' + + it('should unregister existing registration', async function () { + // Register the indexer service + await serviceRegistry.connect(indexer).register(url, geo) + + // Unregister the indexer service + const tx = serviceRegistry.connect(indexer).unregister() + await expect(tx).emit(serviceRegistry, 'ServiceUnregistered').withArgs(indexer.address) + }) + + it('reject unregister non-existing registration', async function () { + const tx = serviceRegistry.connect(indexer).unregister() + await expect(tx).revertedWith('Service already unregistered') + }) + + describe('operator', function () { + it('reject unregister from unauthorized operator', async function () { + // Register the indexer service + await serviceRegistry.connect(indexer).register(url, geo) + + // Unregister + const tx = serviceRegistry.connect(operator).unregisterFor(indexer.address) + await expect(tx).revertedWith('!auth') + }) + + it('should unregister from operator', async function () { + // Register the indexer service + await serviceRegistry.connect(indexer).register(url, geo) + + // Auth and unregister + await staking.connect(indexer).setOperator(operator.address, true) + await serviceRegistry.connect(operator).unregisterFor(indexer.address) + + // Updated state + const indexerService = await serviceRegistry.services(indexer.address) + expect(indexerService.url).eq('') + expect(indexerService.geohash).eq('') + }) + }) + }) +}) diff --git a/packages/contracts/test/unit/staking/allocation.test.ts b/packages/contracts/test/unit/staking/allocation.test.ts new file mode 100644 index 000000000..baed926c1 --- /dev/null +++ b/packages/contracts/test/unit/staking/allocation.test.ts @@ -0,0 +1,1053 @@ +import hre from 'hardhat' +import { expect } from 'chai' +import { BigNumber, constants, Contract, PopulatedTransaction } from 'ethers' + +import { Curation } from '../../../build/types/Curation' +import { EpochManager } from '../../../build/types/EpochManager' +import { GraphToken } from '../../../build/types/GraphToken' +import { IStaking } from '../../../build/types/IStaking' +import { LibExponential } from '../../../build/types/LibExponential' + +import { NetworkFixture } from '../lib/fixtures' +import { + deriveChannelKey, + GraphNetworkContracts, + helpers, + isGraphL1ChainId, + randomHexBytes, + toBN, + toGRT, +} from '@graphprotocol/sdk' +import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers' +import { IRewardsManager } from '../../../build/types' + +const { AddressZero } = constants + +const MAX_PPM = toBN('1000000') +const toPercentage = (ppm: BigNumber) => ppm.mul(100).div(MAX_PPM).toNumber() + +enum AllocationState { + Null, + Active, + Closed, +} + +const ABI_LIB_EXPONENTIAL = [ + { + inputs: [ + { + internalType: 'uint256', + name: 'fees', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'stake', + type: 'uint256', + }, + { + internalType: 'uint32', + name: 'alphaNumerator', + type: 'uint32', + }, + { + internalType: 'uint32', + name: 'alphaDenominator', + type: 'uint32', + }, + { + internalType: 'uint32', + name: 'lambdaNumerator', + type: 'uint32', + }, + { + internalType: 'uint32', + name: 'lambdaDenominator', + type: 'uint32', + }, + ], + name: 'exponentialRebates', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'pure', + type: 'function', + }, +] + +describe('Staking:Allocation', () => { + const graph = hre.graph({ addressBook: 'addresses-local.json' }) + let me: SignerWithAddress + let governor: SignerWithAddress + let indexer: SignerWithAddress + let delegator: SignerWithAddress + let assetHolder: SignerWithAddress + + let fixture: NetworkFixture + + let contracts: GraphNetworkContracts + let curation: Curation + let epochManager: EpochManager + let grt: GraphToken + let staking: IStaking + let rewardsManager: IRewardsManager + let libExponential: LibExponential + + // Test values + + const indexerTokens = toGRT('1000') + const tokensToStake = toGRT('100') + const tokensToDelegate = toGRT('10') + const tokensToAllocate = toGRT('100') + const tokensToCollect = toGRT('100') + const subgraphDeploymentID = randomHexBytes() + const channelKey = deriveChannelKey() + const allocationID = channelKey.address + const anotherChannelKey = deriveChannelKey() + const anotherAllocationID = anotherChannelKey.address + const metadata = randomHexBytes(32) + const poi = randomHexBytes() + + // Helpers + + const allocate = async (tokens: BigNumber, _allocationID?: string, _proof?: string) => { + return staking + .connect(indexer) + .allocateFrom( + indexer.address, + subgraphDeploymentID, + tokens, + _allocationID ?? allocationID, + metadata, + _proof ?? (await channelKey.generateProof(indexer.address)), + ) + } + + const shouldAllocate = async (tokensToAllocate: BigNumber) => { + // Advance epoch to prevent epoch jumping mid test + await helpers.mineEpoch(epochManager) + + // Before state + const beforeStake = await staking.stakes(indexer.address) + + // Allocate + const currentEpoch = await epochManager.currentEpoch() + const tx = allocate(tokensToAllocate) + await expect(tx) + .emit(staking, 'AllocationCreated') + .withArgs( + indexer.address, + subgraphDeploymentID, + currentEpoch, + tokensToAllocate, + allocationID, + metadata, + ) + + // After state + const afterStake = await staking.stakes(indexer.address) + const afterAlloc = await staking.getAllocation(allocationID) + const afterState = await staking.getAllocationState(allocationID) + + // Stake updated + expect(afterStake.tokensAllocated).eq(beforeStake.tokensAllocated.add(tokensToAllocate)) + // Allocation updated + expect(afterAlloc.indexer).eq(indexer.address) + expect(afterAlloc.subgraphDeploymentID).eq(subgraphDeploymentID) + expect(afterAlloc.tokens).eq(tokensToAllocate) + expect(afterAlloc.createdAtEpoch).eq(currentEpoch) + expect(afterAlloc.collectedFees).eq(toGRT('0')) + expect(afterAlloc.closedAtEpoch).eq(toBN('0')) + expect(afterState).to.eq(AllocationState.Active) + } + + // This function tests collect with state updates + const shouldCollect = async ( + tokensToCollect: BigNumber, + options: { + allocationID?: string + expectEvent?: boolean + } = {}, + ): Promise<{ queryRebates: BigNumber, queryFeesBurnt: BigNumber }> => { + const expectEvent = options.expectEvent ?? true + const alloID = options.allocationID ?? allocationID + const alloStateBefore = await staking.getAllocationState(alloID) + // Should have a particular state before collecting + expect(alloStateBefore).to.be.oneOf([AllocationState.Active, AllocationState.Closed]) + + // Before state + const beforeTokenSupply = await grt.totalSupply() + const beforePool = await curation.pools(subgraphDeploymentID) + const beforeAlloc = await staking.getAllocation(alloID) + const beforeIndexerBalance = await grt.balanceOf(indexer.address) + const beforeStake = await staking.stakes(indexer.address) + const beforeDelegationPool = await staking.delegationPools(indexer.address) + + // Advance blocks to get the allocation in epoch where it can be closed + await helpers.mineEpoch(epochManager) + + // Collect fees and calculate expected results + let rebateFees = tokensToCollect + const protocolPercentage = await staking.protocolPercentage() + const protocolFees = rebateFees.mul(protocolPercentage).div(MAX_PPM) + rebateFees = rebateFees.sub(protocolFees) + + const curationPercentage = await staking.curationPercentage() + const curationFees = rebateFees.mul(curationPercentage).div(MAX_PPM) + rebateFees = rebateFees.sub(curationFees) + + const queryFees = tokensToCollect.sub(protocolFees).sub(curationFees) + + const [alphaNumerator, alphaDenominator, lambdaNumerator, lambdaDenominator] + = await Promise.all([ + staking.alphaNumerator(), + staking.alphaDenominator(), + staking.lambdaNumerator(), + staking.lambdaDenominator(), + ]) + const accumulatedRebates = await libExponential.exponentialRebates( + queryFees.add(beforeAlloc.collectedFees), + beforeAlloc.tokens, + alphaNumerator, + alphaDenominator, + lambdaNumerator, + lambdaDenominator, + ) + let queryRebates = beforeAlloc.distributedRebates.gt(accumulatedRebates) + ? BigNumber.from(0) + : accumulatedRebates.sub(beforeAlloc.distributedRebates) + queryRebates = queryRebates.gt(queryFees) ? queryFees : queryRebates + const queryFeesBurnt = queryFees.sub(queryRebates) + + const indexerCut = queryRebates.mul(beforeDelegationPool.queryFeeCut).div(MAX_PPM) + const delegationRewards = queryRebates.sub(indexerCut) + queryRebates = queryRebates.sub(delegationRewards) + + // Collect tokens from allocation + const tx = staking.connect(assetHolder).collect(tokensToCollect, alloID) + if (expectEvent) { + await expect(tx) + .emit(staking, 'RebateCollected') + .withArgs( + assetHolder.address, + indexer.address, + subgraphDeploymentID, + alloID, + await epochManager.currentEpoch(), + tokensToCollect, + protocolFees, + curationFees, + queryFees, + queryRebates, + delegationRewards, + ) + } else { + await expect(tx).to.not.be.reverted + await expect(tx).to.not.emit(staking, 'RebateCollected') + } + + // After state + const afterTokenSupply = await grt.totalSupply() + const afterPool = await curation.pools(subgraphDeploymentID) + const afterAlloc = await staking.getAllocation(alloID) + const afterIndexerBalance = await grt.balanceOf(indexer.address) + const afterStake = await staking.stakes(indexer.address) + const alloStateAfter = await staking.getAllocationState(alloID) + + // Check that protocol fees are burnt + expect(afterTokenSupply).eq(beforeTokenSupply.sub(protocolFees).sub(queryFeesBurnt)) + + // Check that collected tokens are correctly distributed for rebating + tax + curators + // tokensToCollect = queryFees + protocolFees + curationFees + expect(tokensToCollect).eq(queryFees.add(protocolFees).add(curationFees)) + + // Check that queryFees are distributed + // queryFees = queryRebates + queryFeesBurnt + delegationRewards + expect(queryFees).eq(queryRebates.add(queryFeesBurnt).add(delegationRewards)) + + // Check that curation reserves increased for the SubgraphDeployment + expect(afterPool.tokens).eq(beforePool.tokens.add(curationFees)) + + // Verify allocation struct + expect(afterAlloc.tokens).eq(beforeAlloc.tokens) + expect(afterAlloc.createdAtEpoch).eq(beforeAlloc.createdAtEpoch) + expect(afterAlloc.closedAtEpoch).eq(beforeAlloc.closedAtEpoch) + expect(afterAlloc.accRewardsPerAllocatedToken).eq(beforeAlloc.accRewardsPerAllocatedToken) + expect(afterAlloc.collectedFees).eq(beforeAlloc.collectedFees.add(queryFees)) + expect(afterAlloc.distributedRebates).eq( + beforeAlloc.distributedRebates.add(queryRebates).add(delegationRewards), + ) + expect(alloStateAfter).eq(alloStateBefore) + + // // Funds distributed to indexer or restaked + const restake = (await staking.rewardsDestination(indexer.address)) === AddressZero + if (restake) { + expect(afterIndexerBalance).eq(beforeIndexerBalance) + // Next invariant is only true if there are no delegation rewards (which is true in this case) + expect(afterStake.tokensStaked).eq(beforeStake.tokensStaked.add(queryRebates)) + } else { + expect(afterIndexerBalance).eq(beforeIndexerBalance.add(queryRebates)) + expect(afterStake.tokensStaked).eq(beforeStake.tokensStaked) + } + + return { queryRebates, queryFeesBurnt } + } + + const shouldCollectMultiple = async (collections: BigNumber[]) => { + // Perform the multiple collections on currently open allocation + const totalTokensToCollect = collections.reduce((a, b) => a.add(b), BigNumber.from(0)) + let rebatedAmountMultiple = BigNumber.from(0) + for (const collect of collections) { + rebatedAmountMultiple = rebatedAmountMultiple.add((await shouldCollect(collect)).queryRebates) + } + + // Reset rebates state by closing allocation, advancing epoch and opening a new allocation + await staking.connect(indexer).closeAllocation(allocationID, poi) + await helpers.mineEpoch(epochManager) + await allocate( + tokensToAllocate, + anotherAllocationID, + await anotherChannelKey.generateProof(indexer.address), + ) + + // Collect `tokensToCollect` with a single voucher + const rebatedAmountFull = ( + await shouldCollect(totalTokensToCollect, { allocationID: anotherAllocationID }) + ).queryRebates + + // Check rebated amounts match, allow a small error margin of 5 wei + // Due to rounding it's not possible to guarantee an exact match in case of multiple collections + expect(rebatedAmountMultiple.sub(rebatedAmountFull)).lt(5) + } + + const shouldCloseAllocation = async () => { + // Before state + const beforeStake = await staking.stakes(indexer.address) + const beforeAlloc = await staking.getAllocation(allocationID) + const beforeAlloState = await staking.getAllocationState(allocationID) + expect(beforeAlloState).eq(AllocationState.Active) + + // Move at least one epoch to be able to close + await helpers.mineEpoch(epochManager) + await helpers.mineEpoch(epochManager) + + // Calculations + const currentEpoch = await epochManager.currentEpoch() + + // Close allocation + const tx = staking.connect(indexer).closeAllocation(allocationID, poi) + await expect(tx) + .emit(staking, 'AllocationClosed') + .withArgs( + indexer.address, + subgraphDeploymentID, + currentEpoch, + beforeAlloc.tokens, + allocationID, + indexer.address, + poi, + false, + ) + + // After state + const afterStake = await staking.stakes(indexer.address) + const afterAlloc = await staking.getAllocation(allocationID) + const afterAlloState = await staking.getAllocationState(allocationID) + + // Stake updated + expect(afterStake.tokensAllocated).eq(beforeStake.tokensAllocated.sub(beforeAlloc.tokens)) + // Allocation updated + expect(afterAlloc.closedAtEpoch).eq(currentEpoch) + // State progressed + expect(afterAlloState).eq(AllocationState.Closed) + } + // -- Tests -- + + before(async function () { + [me, indexer, delegator, assetHolder] = await graph.getTestAccounts() + ;({ governor } = await graph.getNamedAccounts()) + + fixture = new NetworkFixture(graph.provider) + contracts = await fixture.load(governor) + curation = contracts.Curation as Curation + epochManager = contracts.EpochManager as EpochManager + grt = contracts.GraphToken as GraphToken + staking = contracts.Staking as IStaking + rewardsManager = contracts.RewardsManager as IRewardsManager + + const stakingName = isGraphL1ChainId(graph.chainId) ? 'L1Staking' : 'L2Staking' + const entry = graph.addressBook.getEntry(stakingName) + + libExponential = new Contract( + entry.implementation.libraries.LibExponential, + ABI_LIB_EXPONENTIAL, + graph.provider, + ) as LibExponential + + // Give some funds to the indexer and approve staking contract to use funds on indexer behalf + await grt.connect(governor).mint(indexer.address, indexerTokens) + await grt.connect(indexer).approve(staking.address, indexerTokens) + + // Give some funds to the delegator and approve staking contract to use funds on delegator behalf + await grt.connect(governor).mint(delegator.address, tokensToDelegate) + await grt.connect(delegator).approve(staking.address, tokensToDelegate) + }) + + beforeEach(async function () { + await fixture.setUp() + }) + + afterEach(async function () { + await fixture.tearDown() + }) + + describe('operators', function () { + it('should set operator', async function () { + // Before state + const beforeOperator = await staking.operatorAuth(indexer.address, me.address) + + // Set operator + const tx = staking.connect(indexer).setOperator(me.address, true) + await expect(tx).emit(staking, 'SetOperator').withArgs(indexer.address, me.address, true) + + // After state + const afterOperator = await staking.operatorAuth(indexer.address, me.address) + + // State updated + expect(beforeOperator).eq(false) + expect(afterOperator).eq(true) + }) + + it('should unset operator', async function () { + await staking.connect(indexer).setOperator(me.address, true) + + // Before state + const beforeOperator = await staking.operatorAuth(indexer.address, me.address) + + // Set operator + const tx = staking.connect(indexer).setOperator(me.address, false) + await expect(tx).emit(staking, 'SetOperator').withArgs(indexer.address, me.address, false) + + // After state + const afterOperator = await staking.operatorAuth(indexer.address, me.address) + + // State updated + expect(beforeOperator).eq(true) + expect(afterOperator).eq(false) + }) + it('should reject setting the operator to the msg.sender', async function () { + await expect(staking.connect(indexer).setOperator(indexer.address, true)).to.be.revertedWith( + 'operator == sender', + ) + }) + }) + + describe('rewardsDestination', function () { + it('should set rewards destination', async function () { + // Before state + const beforeDestination = await staking.rewardsDestination(indexer.address) + + // Set + const tx = staking.connect(indexer).setRewardsDestination(me.address) + await expect(tx).emit(staking, 'SetRewardsDestination').withArgs(indexer.address, me.address) + + // After state + const afterDestination = await staking.rewardsDestination(indexer.address) + + // State updated + expect(beforeDestination).eq(AddressZero) + expect(afterDestination).eq(me.address) + + // Must be able to set back to zero + await staking.connect(indexer).setRewardsDestination(AddressZero) + expect(await staking.rewardsDestination(indexer.address)).eq(AddressZero) + }) + }) + + /** + * Allocate + */ + describe('allocate', function () { + it('reject allocate with invalid allocationID', async function () { + const tx = staking + .connect(indexer) + .allocateFrom( + indexer.address, + subgraphDeploymentID, + tokensToAllocate, + AddressZero, + metadata, + randomHexBytes(20), + ) + await expect(tx).revertedWith('!alloc') + }) + + it('reject allocate if no tokens staked', async function () { + const tx = allocate(toBN('1')) + await expect(tx).revertedWith('!minimumIndexerStake') + }) + + it('reject allocate zero tokens if no minimum stake', async function () { + const tx = allocate(toBN('0')) + await expect(tx).revertedWith('!minimumIndexerStake') + }) + + context('> when staked', function () { + beforeEach(async function () { + await staking.connect(indexer).stake(tokensToStake) + }) + + it('reject allocate more than available tokens', async function () { + const tokensOverCapacity = tokensToStake.add(toBN('1')) + const tx = allocate(tokensOverCapacity) + await expect(tx).revertedWith('!capacity') + }) + + it('should allocate', async function () { + await helpers.mineEpoch(epochManager) + await shouldAllocate(tokensToAllocate) + }) + + it('should allow allocation of zero tokens', async function () { + const zeroTokens = toGRT('0') + const tx = allocate(zeroTokens) + await tx + }) + + it('should allocate on behalf of indexer', async function () { + const proof = await channelKey.generateProof(indexer.address) + + // Reject to allocate if the address is not operator + const tx1 = staking + .connect(me) + .allocateFrom( + indexer.address, + subgraphDeploymentID, + tokensToAllocate, + allocationID, + metadata, + proof, + ) + await expect(tx1).revertedWith('!auth') + + // Should allocate if given operator auth + await staking.connect(indexer).setOperator(me.address, true) + await staking + .connect(me) + .allocateFrom( + indexer.address, + subgraphDeploymentID, + tokensToAllocate, + allocationID, + metadata, + proof, + ) + }) + + it('reject allocate reusing an allocation ID', async function () { + await helpers.mineEpoch(epochManager) + const someTokensToAllocate = toGRT('10') + await shouldAllocate(someTokensToAllocate) + const tx = allocate(someTokensToAllocate) + await expect(tx).revertedWith('!null') + }) + + describe('reject allocate on invalid proof', function () { + it('invalid message', async function () { + const invalidProof = await channelKey.generateProof(randomHexBytes(20)) + const tx = staking + .connect(indexer) + .allocateFrom( + indexer.address, + subgraphDeploymentID, + tokensToAllocate, + indexer.address, + metadata, + invalidProof, + ) + await expect(tx).revertedWith('!proof') + }) + + it('invalid proof signature format', async function () { + const tx = staking + .connect(indexer) + .allocateFrom( + indexer.address, + subgraphDeploymentID, + tokensToAllocate, + indexer.address, + metadata, + randomHexBytes(32), + ) + await expect(tx).revertedWith('ECDSA: invalid signature length') + }) + }) + }) + }) + + /** + * Collect + */ + describe('collect', function () { + beforeEach(async function () { + // Create the allocation + await staking.connect(indexer).stake(tokensToStake) + await helpers.mineEpoch(epochManager) + await allocate(tokensToAllocate) + + // Add some signal to the subgraph to enable curation fees + const tokensToSignal = toGRT('100') + await grt.connect(governor).mint(me.address, tokensToSignal) + await grt.connect(me).approve(curation.address, tokensToSignal) + await curation.connect(me).mint(subgraphDeploymentID, tokensToSignal, 0) + + // Fund asset holder wallet + const tokensToFund = toGRT('100000') + await grt.connect(governor).mint(assetHolder.address, tokensToFund) + await grt.connect(assetHolder).approve(staking.address, tokensToFund) + }) + + // * Test with different curation fees and protocol tax + for (const params of [ + { curationPercentage: toBN('0'), protocolPercentage: toBN('0'), queryFeeCut: toBN('0') }, + { curationPercentage: toBN('0'), protocolPercentage: toBN('100000'), queryFeeCut: toBN('0') }, + { curationPercentage: toBN('200000'), protocolPercentage: toBN('0'), queryFeeCut: toBN('0') }, + { + curationPercentage: toBN('200000'), + protocolPercentage: toBN('100000'), + queryFeeCut: toBN('950000'), + }, + ]) { + context( + `> with ${toPercentage(params.curationPercentage)}% curationFees, ${toPercentage( + params.protocolPercentage, + )}% protocolTax and ${toPercentage(params.queryFeeCut)}% queryFeeCut`, + function () { + beforeEach(async function () { + // Set a protocol fee percentage + await staking.connect(governor).setProtocolPercentage(params.protocolPercentage) + + // Set a curation fee percentage + await staking.connect(governor).setCurationPercentage(params.curationPercentage) + + // Setup delegation + await staking.connect(governor).setDelegationRatio(10) // 1:10 delegation capacity + await staking + .connect(indexer) + .setDelegationParameters(toBN('800000'), params.queryFeeCut, 5) + await staking.connect(delegator).delegate(indexer.address, tokensToDelegate) + }) + + it('should collect funds from asset holder (restake=true)', async function () { + await shouldCollect(tokensToCollect) + }) + + it('should collect funds from asset holder (restake=false)', async function () { + // Set a random rewards destination address + await staking.connect(governor).setRewardsDestination(me.address) + await shouldCollect(tokensToCollect) + }) + + it('should collect funds on both active and closed allocations', async function () { + // Collect from active allocation + await shouldCollect(tokensToCollect) + + // Close allocation + await staking.connect(indexer).closeAllocation(allocationID, poi) + + // Collect from closed allocation + await shouldCollect(tokensToCollect) + }) + + it('should collect zero tokens', async function () { + await shouldCollect(toGRT('0'), { expectEvent: false }) + }) + + it('should allow multiple collections on the same allocation', async function () { + // Collect `tokensToCollect` with 4 different vouchers + // This can represent vouchers not necessarily from the same gateway + const splitCollect = tokensToCollect.div(4) + await shouldCollectMultiple(Array(4).fill(splitCollect)) + }) + + it('should allow multiple collections on the same allocation (edge case 1: small then big)', async function () { + // Collect `tokensToCollect` with 2 vouchers, one small and then one big + const smallCollect = tokensToCollect.div(100) + const bigCollect = tokensToCollect.sub(smallCollect) + await shouldCollectMultiple([smallCollect, bigCollect]) + }) + + it('should allow multiple collections on the same allocation (edge case 2: big then small)', async function () { + // Collect `tokensToCollect` with 2 vouchers, one big and then one small + const smallCollect = tokensToCollect.div(100) + const bigCollect = tokensToCollect.sub(smallCollect) + await shouldCollectMultiple([bigCollect, smallCollect]) + }) + }, + ) + } + + it('reject collect if invalid collection', async function () { + const tx = staking.connect(indexer).collect(tokensToCollect, AddressZero) + await expect(tx).revertedWith('!alloc') + }) + + it('reject collect if allocation does not exist', async function () { + const invalidAllocationID = randomHexBytes(20) + const tx = staking.connect(assetHolder).collect(tokensToCollect, invalidAllocationID) + await expect(tx).revertedWith('!collect') + }) + + it('should get no rebates if allocated stake is zero', async function () { + // Create an allocation with no stake + await staking.connect(indexer).stake(tokensToStake) + await allocate( + BigNumber.from(0), + anotherAllocationID, + await anotherChannelKey.generateProof(indexer.address), + ) + + // Collect from closed allocation, should get no rebates + const rebates = await shouldCollect(tokensToCollect, { allocationID: anotherAllocationID }) + expect(rebates.queryRebates).eq(BigNumber.from(0)) + expect(rebates.queryFeesBurnt).eq(tokensToCollect) + }) + + it('should resolve over-rebated scenarios correctly', async function () { + // Set up a new allocation with `tokensToAllocate` staked + await staking.connect(indexer).stake(tokensToStake) + await allocate( + tokensToAllocate, + anotherAllocationID, + await anotherChannelKey.generateProof(indexer.address), + ) + + // Set initial rebate parameters, α = 0, λ = 1 + await staking.connect(governor).setRebateParameters(0, 1, 1, 1) + + // Collection amounts + const firstTokensToCollect = tokensToAllocate.mul(8).div(10) // q1 < sij + const secondTokensToCollect = tokensToAllocate.div(10) // q2 small amount, second collect should get "negative rebates" + const thirdTokensToCollect = tokensToAllocate.mul(3) // q3 big amount so we get rebates again + + // First collection + // Indexer gets 100% of the query fees due to α = 0 + const firstRebates = await shouldCollect(firstTokensToCollect, { + allocationID: anotherAllocationID, + }) + expect(firstRebates.queryRebates).eq(firstTokensToCollect) + expect(firstRebates.queryFeesBurnt).eq(BigNumber.from(0)) + + // Update rebate parameters, α = 1, λ = 1 + await staking.connect(governor).setRebateParameters(1, 1, 1, 1) + + // Second collection + // Indexer gets 0% of the query fees + // Parameters changed so now they are over-rebated and should get "negative rebates", instead they get 0 + const secondRebates = await shouldCollect(secondTokensToCollect, { + allocationID: anotherAllocationID, + }) + expect(secondRebates.queryRebates).eq(BigNumber.from(0)) + expect(secondRebates.queryFeesBurnt).eq(secondTokensToCollect) + + // Third collection + // Previous collection plus this new one tip the balance and indexer is no longer over-rebated + // They get rebates and burn again + const thirdRebates = await shouldCollect(thirdTokensToCollect, { + allocationID: anotherAllocationID, + }) + expect(thirdRebates.queryRebates).gt(BigNumber.from(0)) + expect(thirdRebates.queryFeesBurnt).gt(BigNumber.from(0)) + }) + + it('should resolve under-rebated scenarios correctly', async function () { + // Set up a new allocation with `tokensToAllocate` staked + await staking.connect(indexer).stake(tokensToStake) + await allocate( + tokensToAllocate, + anotherAllocationID, + await anotherChannelKey.generateProof(indexer.address), + ) + + // Set initial rebate parameters, α = 1, λ = 1 + await staking.connect(governor).setRebateParameters(1, 1, 1, 1) + + // Collection amounts + const firstTokensToCollect = tokensToAllocate + const secondTokensToCollect = tokensToAllocate + const thirdTokensToCollect = tokensToAllocate.mul(50) + + // First collection + // Indexer gets rebates and burn + const firstRebates = await shouldCollect(firstTokensToCollect, { + allocationID: anotherAllocationID, + }) + expect(firstRebates.queryRebates).gt(BigNumber.from(0)) + expect(firstRebates.queryFeesBurnt).gt(BigNumber.from(0)) + + // Update rebate parameters, α = 0.1, λ = 1 + await staking.connect(governor).setRebateParameters(1, 10, 1, 1) + + // Second collection + // Indexer gets 100% of the query fees + // Parameters changed so now they are under-rebated and should get more than the available amount but we cap it + const secondRebates = await shouldCollect(secondTokensToCollect, { + allocationID: anotherAllocationID, + }) + expect(secondRebates.queryRebates).eq(secondTokensToCollect) + expect(secondRebates.queryFeesBurnt).eq(BigNumber.from(0)) + + // Third collection + // Previous collection plus this new one tip the balance and indexer is no longer under-rebated + // They get rebates and burn again + const thirdRebates = await shouldCollect(thirdTokensToCollect, { + allocationID: anotherAllocationID, + }) + expect(thirdRebates.queryRebates).gt(BigNumber.from(0)) + expect(thirdRebates.queryFeesBurnt).gt(BigNumber.from(0)) + }) + + it('should collect zero tokens', async function () { + await shouldCollect(toGRT('0'), { expectEvent: false }) + }) + + it('should get stuck under-rebated if alpha is changed to zero', async function () { + // Set up a new allocation with `tokensToAllocate` staked + await staking.connect(indexer).stake(tokensToStake) + await allocate( + tokensToAllocate, + anotherAllocationID, + await anotherChannelKey.generateProof(indexer.address), + ) + + // Set initial rebate parameters, α = 1, λ = 1 + await staking.connect(governor).setRebateParameters(1, 1, 1, 1) + + // First collection + // Indexer gets rebates and burn + const firstRebates = await shouldCollect(tokensToCollect, { + allocationID: anotherAllocationID, + }) + expect(firstRebates.queryRebates).gt(BigNumber.from(0)) + expect(firstRebates.queryFeesBurnt).gt(BigNumber.from(0)) + + // Update rebate parameters, α = 0, λ = 1 + await staking.connect(governor).setRebateParameters(0, 1, 1, 1) + + // Successive collections + // Indexer gets 100% of the query fees + // Parameters changed so now they are under-rebated and should get more than the available amount but we cap it + // Distributed amount will never catch up due to the initial collection which was less than 100% + for (const _i of [...Array(10).keys()]) { + const succesiveRebates = await shouldCollect(tokensToCollect, { + allocationID: anotherAllocationID, + }) + expect(succesiveRebates.queryRebates).eq(tokensToCollect) + expect(succesiveRebates.queryFeesBurnt).eq(BigNumber.from(0)) + } + }) + }) + + /** + * Close allocation + */ + describe('closeAllocation', function () { + beforeEach(async function () { + // Stake and allocate + await staking.connect(indexer).stake(tokensToStake) + }) + + for (const tokensToAllocate of [toBN(100), toBN(0)]) { + context(`> with ${tokensToAllocate.toString()} allocated tokens`, function () { + beforeEach(async function () { + // Advance to next epoch to avoid creating the allocation + // right at the epoch boundary, which would mess up the tests. + await helpers.mineEpoch(epochManager) + + // Allocate + await allocate(tokensToAllocate) + }) + + it('reject close a non-existing allocation', async function () { + const invalidAllocationID = randomHexBytes(20) + const tx = staking.connect(indexer).closeAllocation(invalidAllocationID, poi) + await expect(tx).revertedWith('!active') + }) + + it('allow close before one epoch has passed', async function () { + const currentEpoch = await epochManager.currentEpoch() + const beforeAlloc = await staking.getAllocation(allocationID) + + const tx = staking.connect(indexer).closeAllocation(allocationID, poi) + await expect(tx) + .emit(staking, 'AllocationClosed') + .withArgs( + indexer.address, + subgraphDeploymentID, + currentEpoch, + beforeAlloc.tokens, + allocationID, + indexer.address, + poi, + false, + ) + await expect(tx).not.to.emit(rewardsManager, 'HorizonRewardsAssigned') + }) + + it('reject close if not the owner of allocation', async function () { + // Move at least one epoch to be able to close + await helpers.mineEpoch(epochManager) + + // Close allocation + const tx = staking.connect(me).closeAllocation(allocationID, poi) + await expect(tx).revertedWith('!auth') + }) + + it('reject close if allocation is already closed', async function () { + // Move at least one epoch to be able to close + await helpers.mineEpoch(epochManager) + + // First closing + await staking.connect(indexer).closeAllocation(allocationID, poi) + + // Second closing + const tx = staking.connect(indexer).closeAllocation(allocationID, poi) + await expect(tx).revertedWith('!active') + }) + + it('should close an allocation', async function () { + await shouldCloseAllocation() + }) + + it('should close an allocation (by operator)', async function () { + // Move at least one epoch to be able to close + await helpers.mineEpoch(epochManager) + await helpers.mineEpoch(epochManager) + + // Reject to close if the address is not operator + const tx1 = staking.connect(me).closeAllocation(allocationID, poi) + await expect(tx1).revertedWith('!auth') + + // Should close if given operator auth + await staking.connect(indexer).setOperator(me.address, true) + await staking.connect(me).closeAllocation(allocationID, poi) + }) + + it('should close an allocation (by public) only if allocation is non-zero', async function () { + // Reject to close if public address and under max allocation epochs + const tx1 = staking.connect(me).closeAllocation(allocationID, poi) + await expect(tx1).revertedWith('!auth') + + // Move max allocation epochs to close by delegator + const maxAllocationEpochs = await staking.maxAllocationEpochs() + await helpers.mineEpoch(epochManager, maxAllocationEpochs + 1) + + // Closing should only be possible if allocated tokens > 0 + const alloc = await staking.getAllocation(allocationID) + if (alloc.tokens.gt(0)) { + // Calculations + const beforeAlloc = await staking.getAllocation(allocationID) + const currentEpoch = await epochManager.currentEpoch() + + // Setup + await grt.connect(governor).mint(me.address, toGRT('1')) + await grt.connect(me).approve(staking.address, toGRT('1')) + + // Should close by public + const tx = staking.connect(me).closeAllocation(allocationID, poi) + await expect(tx) + .emit(staking, 'AllocationClosed') + .withArgs( + indexer.address, + subgraphDeploymentID, + currentEpoch, + beforeAlloc.tokens, + allocationID, + me.address, + poi, + true, + ) + } else { + // closing by the public on a zero allocation is not authorized + const tx = staking.connect(me).closeAllocation(allocationID, poi) + await expect(tx).revertedWith('!auth') + } + }) + + it('should close many allocations in batch', async function () { + // Setup a second allocation + await staking.connect(indexer).stake(tokensToStake) + const channelKey2 = deriveChannelKey() + const allocationID2 = channelKey2.address + await staking + .connect(indexer) + .allocate( + subgraphDeploymentID, + tokensToAllocate, + allocationID2, + metadata, + await channelKey2.generateProof(indexer.address), + ) + + // Move at least one epoch to be able to close + await helpers.mineEpoch(epochManager) + await helpers.mineEpoch(epochManager) + + // Close multiple allocations in one tx + const requests = await Promise.all( + [ + { + allocationID: allocationID, + poi: poi, + }, + { + allocationID: allocationID2, + poi: poi, + }, + ].map(({ allocationID, poi }) => + staking.connect(indexer).populateTransaction.closeAllocation(allocationID, poi), + ), + ).then(e => e.map((e: PopulatedTransaction) => e.data)) + await staking.connect(indexer).multicall(requests) + }) + }) + } + }) + + describe('closeAndAllocate', function () { + beforeEach(async function () { + // Stake and allocate + await staking.connect(indexer).stake(tokensToAllocate) + await allocate(tokensToAllocate) + }) + + it('should close and create a new allocation', async function () { + // Move at least one epoch to be able to close + await helpers.mineEpoch(epochManager) + + // Close and allocate + const newChannelKey = deriveChannelKey() + const newAllocationID = newChannelKey.address + + // Close multiple allocations in one tx + const requests = await Promise.all([ + staking.connect(indexer).populateTransaction.closeAllocation(allocationID, poi), + staking + .connect(indexer) + .populateTransaction.allocateFrom( + indexer.address, + subgraphDeploymentID, + tokensToAllocate, + newAllocationID, + metadata, + await newChannelKey.generateProof(indexer.address), + ), + ]).then(e => e.map((e: PopulatedTransaction) => e.data)) + await staking.connect(indexer).multicall(requests) + }) + }) +}) diff --git a/packages/contracts/test/unit/staking/configuration.test.ts b/packages/contracts/test/unit/staking/configuration.test.ts new file mode 100644 index 000000000..9257ef4a7 --- /dev/null +++ b/packages/contracts/test/unit/staking/configuration.test.ts @@ -0,0 +1,224 @@ +import hre from 'hardhat' +import { expect } from 'chai' +import { ethers } from 'hardhat' +import { constants } from 'ethers' + +import { IStaking } from '../../../build/types/IStaking' + +import { NetworkFixture } from '../lib/fixtures' +import { GraphProxyAdmin } from '../../../build/types/GraphProxyAdmin' +import { deploy, DeployType, GraphNetworkContracts, toBN, toGRT } from '@graphprotocol/sdk' +import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers' + +const { AddressZero } = constants + +const MAX_PPM = toBN('1000000') + +describe('Staking:Config', () => { + const graph = hre.graph() + + let me: SignerWithAddress + let other: SignerWithAddress + let governor: SignerWithAddress + + let fixture: NetworkFixture + + let contracts: GraphNetworkContracts + let staking: IStaking + let proxyAdmin: GraphProxyAdmin + + before(async function () { + [me, other] = await graph.getTestAccounts() + ;({ governor } = await graph.getNamedAccounts()) + + fixture = new NetworkFixture(graph.provider) + contracts = await fixture.load(governor) + staking = contracts.Staking as IStaking + proxyAdmin = contracts.GraphProxyAdmin as GraphProxyAdmin + }) + + beforeEach(async function () { + await fixture.setUp() + }) + + afterEach(async function () { + await fixture.tearDown() + }) + + describe('minimumIndexerStake', function () { + it('should set `minimumIndexerStake`', async function () { + const oldValue = toGRT('10') + const newValue = toGRT('100') + + // Set right in the constructor + expect(await staking.minimumIndexerStake()).eq(oldValue) + + // Set new value + await staking.connect(governor).setMinimumIndexerStake(newValue) + expect(await staking.minimumIndexerStake()).eq(newValue) + }) + + it('reject set `minimumIndexerStake` if not allowed', async function () { + const newValue = toGRT('100') + const tx = staking.connect(me).setMinimumIndexerStake(newValue) + await expect(tx).revertedWith('Only Controller governor') + }) + + it('reject set `minimumIndexerStake` to zero', async function () { + const tx = staking.connect(governor).setMinimumIndexerStake(0) + await expect(tx).revertedWith('!minimumIndexerStake') + }) + }) + + describe('setSlasher', function () { + it('should set `slasher`', async function () { + expect(await staking.slashers(me.address)).eq(false) + + await staking.connect(governor).setSlasher(me.address, true) + expect(await staking.slashers(me.address)).eq(true) + + await staking.connect(governor).setSlasher(me.address, false) + expect(await staking.slashers(me.address)).eq(false) + }) + + it('reject set `slasher` if not allowed', async function () { + const tx = staking.connect(other).setSlasher(me.address, true) + await expect(tx).revertedWith('Only Controller governor') + }) + + it('reject set `slasher` for zero', async function () { + const tx = staking.connect(governor).setSlasher(AddressZero, true) + await expect(tx).revertedWith('!slasher') + }) + }) + + describe('curationPercentage', function () { + it('should set `curationPercentage`', async function () { + const newValue = toBN('5') + await staking.connect(governor).setCurationPercentage(newValue) + expect(await staking.curationPercentage()).eq(newValue) + }) + + it('reject set `curationPercentage` if out of bounds', async function () { + const newValue = MAX_PPM.add(toBN('1')) + const tx = staking.connect(governor).setCurationPercentage(newValue) + await expect(tx).revertedWith('>percentage') + }) + + it('reject set `curationPercentage` if not allowed', async function () { + const tx = staking.connect(other).setCurationPercentage(50) + await expect(tx).revertedWith('Only Controller governor') + }) + }) + + describe('protocolPercentage', function () { + it('should set `protocolPercentage`', async function () { + for (const newValue of [toBN('0'), toBN('5'), MAX_PPM]) { + await staking.connect(governor).setProtocolPercentage(newValue) + expect(await staking.protocolPercentage()).eq(newValue) + } + }) + + it('reject set `protocolPercentage` if out of bounds', async function () { + const newValue = MAX_PPM.add(toBN('1')) + const tx = staking.connect(governor).setProtocolPercentage(newValue) + await expect(tx).revertedWith('>percentage') + }) + + it('reject set `protocolPercentage` if not allowed', async function () { + const tx = staking.connect(other).setProtocolPercentage(50) + await expect(tx).revertedWith('Only Controller governor') + }) + }) + + describe('maxAllocationEpochs', function () { + it('should set `maxAllocationEpochs`', async function () { + const newValue = toBN('5') + await staking.connect(governor).setMaxAllocationEpochs(newValue) + expect(await staking.maxAllocationEpochs()).eq(newValue) + }) + + it('reject set `maxAllocationEpochs` if not allowed', async function () { + const newValue = toBN('5') + const tx = staking.connect(other).setMaxAllocationEpochs(newValue) + await expect(tx).revertedWith('Only Controller governor') + }) + }) + + describe('thawingPeriod', function () { + it('should set `thawingPeriod`', async function () { + const newValue = toBN('5') + await staking.connect(governor).setThawingPeriod(newValue) + expect(await staking.thawingPeriod()).eq(newValue) + }) + + it('reject set `thawingPeriod` if not allowed', async function () { + const newValue = toBN('5') + const tx = staking.connect(other).setThawingPeriod(newValue) + await expect(tx).revertedWith('Only Controller governor') + }) + + it('reject set `thawingPeriod` to zero', async function () { + const tx = staking.connect(governor).setThawingPeriod(0) + await expect(tx).revertedWith('!thawingPeriod') + }) + }) + + describe('rebateParameters', function () { + it('should be setup on init', async function () { + expect(await staking.alphaNumerator()).eq(toBN(100)) + expect(await staking.alphaDenominator()).eq(toBN(100)) + expect(await staking.lambdaNumerator()).eq(toBN(60)) + expect(await staking.lambdaDenominator()).eq(toBN(100)) + }) + + it('should set `rebateParameters`', async function () { + await staking.connect(governor).setRebateParameters(5, 6, 7, 8) + expect(await staking.alphaNumerator()).eq(toBN(5)) + expect(await staking.alphaDenominator()).eq(toBN(6)) + expect(await staking.lambdaNumerator()).eq(toBN(7)) + expect(await staking.lambdaDenominator()).eq(toBN(8)) + }) + + it('reject set `rebateParameters` if out of bounds', async function () { + const tx2 = staking.connect(governor).setRebateParameters(1, 0, 1, 1) + await expect(tx2).revertedWith('!alphaDenominator') + + const tx3 = staking.connect(governor).setRebateParameters(1, 1, 0, 1) + await expect(tx3).revertedWith('!lambdaNumerator') + + const tx4 = staking.connect(governor).setRebateParameters(1, 1, 1, 0) + await expect(tx4).revertedWith('!lambdaDenominator') + }) + + it('reject set `rebateParameters` if not allowed', async function () { + const tx = staking.connect(other).setRebateParameters(1, 1, 1, 1) + await expect(tx).revertedWith('Only Controller governor') + }) + }) + + describe('Staking and StakingExtension', function () { + it('does not allow calling the fallback from the Staking implementation', async function () { + const impl = await proxyAdmin.getProxyImplementation(staking.address) + + const factory = await ethers.getContractFactory('StakingExtension') + const implAsStaking = factory.attach(impl) as IStaking + const tx = implAsStaking.connect(other).setDelegationRatio(50) + await expect(tx).revertedWith('only through proxy') + }) + it('can set the staking extension implementation with setExtensionImpl', async function () { + const newImpl = await deploy(DeployType.Deploy, governor, { + name: 'StakingExtension', + }) + const tx = await staking.connect(governor).setExtensionImpl(newImpl.contract.address) + await expect(tx) + .emit(staking, 'ExtensionImplementationSet') + .withArgs(newImpl.contract.address) + }) + it('rejects calls to setExtensionImpl from non-governor', async function () { + const newImpl = await deploy(DeployType.Deploy, governor, { name: 'StakingExtension' }) + const tx = staking.connect(other).setExtensionImpl(newImpl.contract.address) + await expect(tx).revertedWith('Only Controller governor') + }) + }) +}) diff --git a/packages/contracts/test/unit/staking/delegation.test.ts b/packages/contracts/test/unit/staking/delegation.test.ts new file mode 100644 index 000000000..15b174976 --- /dev/null +++ b/packages/contracts/test/unit/staking/delegation.test.ts @@ -0,0 +1,614 @@ +import hre from 'hardhat' +import { expect } from 'chai' +import { BigNumber, constants } from 'ethers' + +import { EpochManager } from '../../../build/types/EpochManager' +import { GraphToken } from '../../../build/types/GraphToken' +import { IStaking } from '../../../build/types/IStaking' + +import { NetworkFixture } from '../lib/fixtures' +import { + deriveChannelKey, + GraphNetworkContracts, + helpers, + randomHexBytes, + toBN, + toGRT, +} from '@graphprotocol/sdk' +import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers' + +const { AddressZero, HashZero } = constants +const MAX_PPM = toBN('1000000') +const tokensToCollect = toGRT('50000000000000000000') + +describe('Staking::Delegation', () => { + const graph = hre.graph() + let me: SignerWithAddress + let delegator: SignerWithAddress + let delegator2: SignerWithAddress + let governor: SignerWithAddress + let indexer: SignerWithAddress + let indexer2: SignerWithAddress + let assetHolder: SignerWithAddress + + let fixture: NetworkFixture + + let contracts: GraphNetworkContracts + let epochManager: EpochManager + let grt: GraphToken + let staking: IStaking + + // Test values + const poi = randomHexBytes() + const metadata = HashZero + + async function shouldDelegate(sender: SignerWithAddress, tokens: BigNumber) { + // Before state + const beforeTotalSupply = await grt.totalSupply() + const beforePool = await staking.delegationPools(indexer.address) + const beforeDelegation = await staking.getDelegation(indexer.address, sender.address) + const beforeShares = beforeDelegation.shares + const beforeTokens = beforePool.shares.gt(0) + ? beforeShares.mul(beforePool.tokens).div(beforePool.shares) + : toBN(0) + + // Get current delegation tax percentage for deposits + const delegationTaxPercentage = BigNumber.from(await staking.delegationTaxPercentage()) + const delegationTax = delegationTaxPercentage.mul(tokens).div(MAX_PPM) + const delegatedTokens = tokens.sub(delegationTax) + + // Calculate shares to receive + const shares = beforePool.tokens.eq(toBN('0')) + ? delegatedTokens + : delegatedTokens.mul(beforePool.tokens).div(beforePool.shares) + + // Delegate + const tx = staking.connect(sender).delegate(indexer.address, tokens) + await expect(tx) + .emit(staking, 'StakeDelegated') + .withArgs(indexer.address, sender.address, delegatedTokens, shares) + + // After state + const afterTotalSupply = await grt.totalSupply() + const afterPool = await staking.delegationPools(indexer.address) + const afterDelegation = await staking.getDelegation(indexer.address, sender.address) + const afterShares = afterDelegation.shares + const afterTokens = afterPool.shares.gt(0) + ? afterShares.mul(afterPool.tokens).div(afterPool.shares) + : toBN(0) + + // State updated + expect(afterPool.tokens).eq(beforePool.tokens.add(delegatedTokens)) + expect(afterPool.shares).eq(beforePool.shares.add(shares)) + expect(afterShares).eq(beforeShares.add(shares)) + expect(afterTokens).eq(beforeTokens.add(delegatedTokens)) + expect(afterTotalSupply).eq(beforeTotalSupply.sub(delegationTax)) + } + + async function shouldUndelegate(sender: SignerWithAddress, shares: BigNumber) { + // Before state + const beforePool = await staking.delegationPools(indexer.address) + const beforeDelegation = await staking.getDelegation(indexer.address, sender.address) + const beforeShares = beforeDelegation.shares + const beforeTokens = beforePool.shares.gt(0) + ? beforeShares.mul(beforePool.tokens).div(beforePool.shares) + : toBN(0) + const beforeDelegatorBalance = await grt.balanceOf(sender.address) + const tokensToWithdraw = await staking.getWithdraweableDelegatedTokens(beforeDelegation) + + // Calculate tokens to receive + const tokens = shares.mul(beforePool.shares).div(beforePool.tokens) + + // Undelegate + const currentEpoch = await epochManager.currentEpoch() + const delegationUnbondingPeriod = await staking.delegationUnbondingPeriod() + const tokensLockedUntil = currentEpoch.add(delegationUnbondingPeriod) + + const tx = staking.connect(sender).undelegate(indexer.address, shares) + await expect(tx) + .emit(staking, 'StakeDelegatedLocked') + .withArgs(indexer.address, sender.address, tokens, shares, tokensLockedUntil) + + // After state + const afterPool = await staking.delegationPools(indexer.address) + const afterDelegation = await staking.getDelegation(indexer.address, sender.address) + const afterShares = afterDelegation.shares + const afterTokens = afterPool.shares.gt(0) + ? afterShares.mul(afterPool.tokens).div(afterPool.shares) + : toBN(0) + const afterDelegatorBalance = await grt.balanceOf(sender.address) + + // State updated + expect(afterPool.tokens).eq(beforePool.tokens.sub(tokens)) + expect(afterPool.shares).eq(beforePool.shares.sub(shares)) + expect(afterShares).eq(beforeShares.sub(shares)) + expect(afterTokens).eq(beforeTokens.sub(tokens)) + + // Undelegated funds must be put on lock + expect(afterDelegation.tokensLocked).eq( + beforeDelegation.tokensLocked.add(tokens).sub(tokensToWithdraw), + ) + expect(afterDelegation.tokensLockedUntil).eq(tokensLockedUntil) + // Delegator see balance increased only if there were tokens to withdraw + expect(afterDelegatorBalance).eq(beforeDelegatorBalance.add(tokensToWithdraw)) + } + + async function shouldWithdrawDelegated( + sender: SignerWithAddress, + redelegateTo: string, + tokens: BigNumber, + ) { + // Before state + const beforePool = await staking.delegationPools(indexer2.address) + const beforeDelegation = await staking.getDelegation(indexer2.address, sender.address) + const beforeShares = beforeDelegation.shares + const beforeTokens = beforePool.shares.gt(0) + ? beforeShares.mul(beforePool.tokens).div(beforePool.shares) + : toBN(0) + const beforeBalance = await grt.balanceOf(delegator.address) + + // Calculate shares to receive + const shares = beforePool.tokens.eq(toBN('0')) + ? tokens + : tokens.mul(beforePool.tokens).div(beforePool.shares) + + // Withdraw + const tx = staking.connect(delegator).withdrawDelegated(indexer.address, redelegateTo) + await expect(tx) + .emit(staking, 'StakeDelegatedWithdrawn') + .withArgs(indexer.address, delegator.address, tokens) + + // After state + const afterPool = await staking.delegationPools(indexer2.address) + const afterDelegation = await staking.getDelegation(indexer2.address, sender.address) + const afterShares = afterDelegation.shares + const afterTokens = afterPool.shares.gt(0) + ? afterShares.mul(afterPool.tokens).div(afterPool.shares) + : toBN(0) + const afterBalance = await grt.balanceOf(delegator.address) + + // State updated + expect(afterDelegation.tokensLocked).eq(toGRT('0')) + expect(afterDelegation.tokensLockedUntil).eq(toBN('0')) + // Redelegation vs transfer + if (redelegateTo === AddressZero) { + expect(afterBalance).eq(beforeBalance.add(tokens)) + } else { + expect(afterBalance).eq(beforeBalance) + expect(afterPool.tokens).eq(beforePool.tokens.add(tokens)) + expect(afterPool.shares).eq(beforePool.shares.add(shares)) + expect(afterShares).eq(beforeShares.add(shares)) + expect(afterTokens).eq(beforeTokens.add(tokens)) + } + } + + before(async function () { + [me, delegator, delegator2, governor, indexer, indexer2, assetHolder] + = await graph.getTestAccounts() + ;({ governor } = await graph.getNamedAccounts()) + + fixture = new NetworkFixture(graph.provider) + contracts = await fixture.load(governor) + epochManager = contracts.EpochManager as EpochManager + grt = contracts.GraphToken as GraphToken + staking = contracts.Staking as IStaking + + // Distribute test funds + for (const wallet of [delegator, delegator2]) { + await grt.connect(governor).mint(wallet.address, toGRT('10000000000000000000')) + await grt.connect(wallet).approve(staking.address, toGRT('10000000000000000000')) + } + + // Distribute test funds + for (const wallet of [me, indexer, indexer2]) { + await grt.connect(governor).mint(wallet.address, toGRT('1000000')) + await grt.connect(wallet).approve(staking.address, toGRT('1000000')) + } + await grt.connect(governor).mint(assetHolder.address, tokensToCollect) + await grt.connect(assetHolder).approve(staking.address, tokensToCollect) + }) + + beforeEach(async function () { + await fixture.setUp() + }) + + afterEach(async function () { + await fixture.tearDown() + }) + + describe('configuration', function () { + describe('delegationRatio', function () { + const delegationRatio = 5 + + it('should set `delegationRatio`', async function () { + await staking.connect(governor).setDelegationRatio(delegationRatio) + expect(await staking.delegationRatio()).eq(delegationRatio) + }) + + it('reject set `delegationRatio` if not allowed', async function () { + const tx = staking.connect(me).setDelegationRatio(delegationRatio) + await expect(tx).revertedWith('Only Controller governor') + }) + }) + + describe('delegationTaxPercentage', function () { + it('should set `delegationTaxPercentage`', async function () { + for (const newValue of [toBN('0'), toBN('5'), MAX_PPM]) { + await staking.connect(governor).setDelegationTaxPercentage(newValue) + expect(await staking.delegationTaxPercentage()).eq(newValue) + } + }) + + it('reject set `delegationTaxPercentage` if out of bounds', async function () { + const newValue = MAX_PPM.add(toBN('1')) + const tx = staking.connect(governor).setDelegationTaxPercentage(newValue) + await expect(tx).revertedWith('>percentage') + }) + + it('reject set `delegationTaxPercentage` if not allowed', async function () { + const tx = staking.connect(me).setDelegationTaxPercentage(50) + await expect(tx).revertedWith('Only Controller governor') + }) + }) + + describe('delegationParameters', function () { + const indexingRewardCut = toBN('50000') + const queryFeeCut = toBN('80000') + + it('reject to set parameters out of bound', async function () { + // Indexing reward out of bounds + const tx1 = staking + .connect(indexer) + .setDelegationParameters(MAX_PPM.add('1'), queryFeeCut, 0) + await expect(tx1).revertedWith('>indexingRewardCut') + + // Query fee out of bounds + const tx2 = staking + .connect(indexer) + .setDelegationParameters(indexingRewardCut, MAX_PPM.add('1'), 0) + await expect(tx2).revertedWith('>queryFeeCut') + }) + + it('should set parameters', async function () { + // Set parameters + const tx = staking + .connect(indexer) + .setDelegationParameters(indexingRewardCut, queryFeeCut, 0) + await expect(tx) + .emit(staking, 'DelegationParametersUpdated') + .withArgs(indexer.address, indexingRewardCut, queryFeeCut, 0) + + // State updated + const params = await staking.delegationPools(indexer.address) + expect(params.indexingRewardCut).eq(indexingRewardCut) + expect(params.queryFeeCut).eq(queryFeeCut) + expect(params.updatedAtBlock).eq(await helpers.latestBlock()) + }) + + it('should init delegation parameters on first stake', async function () { + // Before + const beforeParams = await staking.delegationPools(indexer.address) + expect(beforeParams.indexingRewardCut).eq(0) + expect(beforeParams.queryFeeCut).eq(0) + expect(beforeParams.updatedAtBlock).eq(0) + + // Indexer stake tokens + const tx = staking.connect(indexer).stake(toGRT('200')) + await expect(tx) + .emit(staking, 'DelegationParametersUpdated') + .withArgs(indexer.address, MAX_PPM, MAX_PPM, 0) + + // State updated + const afterParams = await staking.delegationPools(indexer.address) + expect(afterParams.indexingRewardCut).eq(MAX_PPM) + expect(afterParams.queryFeeCut).eq(MAX_PPM) + expect(afterParams.updatedAtBlock).eq(await helpers.latestBlock()) + }) + + it('should init delegation parameters on first stake using stakeTo()', async function () { + // Before + const beforeParams = await staking.delegationPools(indexer.address) + expect(beforeParams.indexingRewardCut).eq(0) + expect(beforeParams.queryFeeCut).eq(0) + expect(beforeParams.updatedAtBlock).eq(0) + + // Indexer stake tokens + const tx = staking.connect(me).stakeTo(indexer.address, toGRT('200')) + await expect(tx) + .emit(staking, 'DelegationParametersUpdated') + .withArgs(indexer.address, MAX_PPM, MAX_PPM, 0) + + // State updated + const afterParams = await staking.delegationPools(indexer.address) + expect(afterParams.indexingRewardCut).eq(MAX_PPM) + expect(afterParams.queryFeeCut).eq(MAX_PPM) + expect(afterParams.updatedAtBlock).eq(await helpers.latestBlock()) + }) + }) + }) + + describe('lifecycle', function () { + beforeEach(async function () { + // Stake some funds as indexer + await staking.connect(indexer).stake(toGRT('1000')) + }) + + describe('delegate', function () { + it('reject delegate with zero tokens', async function () { + const tokensToDelegate = toGRT('0') + const tx = staking.connect(delegator).delegate(indexer.address, tokensToDelegate) + await expect(tx).revertedWith('!minimum-delegation') + }) + + it('reject delegate with less than 1 GRT when the pool is not initialized', async function () { + const tokensToDelegate = toGRT('0.5') + const tx = staking.connect(delegator).delegate(indexer.address, tokensToDelegate) + await expect(tx).revertedWith('!minimum-delegation') + }) + + it('reject delegating under 1 GRT when the pool is initialized', async function () { + await shouldDelegate(delegator, toGRT('1')) + const tokensToDelegate = toGRT('0.5') + const tx = staking.connect(delegator).delegate(indexer.address, tokensToDelegate) + await expect(tx).revertedWith('!minimum-delegation') + }) + + it('reject delegate to empty address', async function () { + const tokensToDelegate = toGRT('100') + const tx = staking.connect(delegator).delegate(AddressZero, tokensToDelegate) + await expect(tx).revertedWith('!indexer') + }) + + it('reject delegate to non-staked indexer', async function () { + const tokensToDelegate = toGRT('100') + const tx = staking.connect(delegator).delegate(me.address, tokensToDelegate) + await expect(tx).revertedWith('!stake') + }) + + it('should delegate tokens and account shares proportionally', async function () { + // Multiple delegations should work + await shouldDelegate(delegator, toGRT('1234')) + await shouldDelegate(delegator, toGRT('100')) + await shouldDelegate(delegator, toGRT('50')) + await shouldDelegate(delegator, toGRT('25')) + await shouldDelegate(delegator, toGRT('10')) + await shouldDelegate(delegator, toGRT('1')) + + // Delegation by other delegator + await shouldDelegate(delegator2, toGRT('5000')) + }) + + it('should delegate a high amount of tokens', async function () { + await shouldDelegate(delegator, toGRT('100')) + await shouldDelegate(delegator, toGRT('1000000000000000000')) + }) + + describe('delegation tax', function () { + it('should delegate and burn delegation deposit tax (0.0001%)', async function () { + await staking.connect(governor).setDelegationTaxPercentage(1) + await shouldDelegate(delegator, toGRT('10000000')) + }) + + it('should delegate and burn delegation deposit tax (1%)', async function () { + await staking.connect(governor).setDelegationTaxPercentage(10000) + await shouldDelegate(delegator, toGRT('10000000')) + }) + + it('reject delegate with delegation deposit tax (100%)', async function () { + await staking.connect(governor).setDelegationTaxPercentage(1000000) + const tx = staking.connect(delegator).delegate(indexer.address, toGRT('10000000')) + await expect(tx).revertedWith('!shares') + }) + }) + }) + + describe('undelegate', function () { + it('reject to undelegate zero shares', async function () { + const tx = staking.connect(delegator).undelegate(indexer.address, toGRT('0')) + await expect(tx).revertedWith('!shares') + }) + + it('reject to undelegate more shares than owned', async function () { + const tx = staking.connect(delegator).undelegate(indexer.address, toGRT('100')) + await expect(tx).revertedWith('!shares-avail') + }) + + it('should exchange delegation pool shares for tokens', async function () { + const tokens = toGRT('100') + + // Have two parties that delegated tokens to the same indexer + await shouldDelegate(delegator, tokens) + await shouldDelegate(delegator2, tokens) + + // Delegate half of the delegated funds + await shouldUndelegate(delegator, tokens.div(toBN('2'))) + }) + + it('should undelegate properly when multiple delegations', async function () { + this.timeout(60000) // increase timeout for test runner + + // Use long enough epochs to avoid jumping to the next epoch involuntarily on our test + await epochManager.connect(governor).setEpochLength(toBN((60 * 60) / 15)) + + await shouldDelegate(delegator, toGRT('1234')) + await shouldDelegate(delegator, toGRT('100')) + await shouldDelegate(delegator, toGRT('50')) + await shouldDelegate(delegator2, toGRT('50')) + + await shouldUndelegate(delegator, toGRT('1')) + await shouldUndelegate(delegator2, toGRT('50')) + await helpers.mineEpoch(epochManager) + await shouldUndelegate(delegator, toGRT('25')) + }) + + it('should undelegate and withdraw freed tokens from unbonding period', async function () { + await staking.connect(governor).setDelegationUnbondingPeriod('2') + await shouldDelegate(delegator, toGRT('100')) + await shouldUndelegate(delegator, toGRT('50')) + await helpers.mineEpoch(epochManager) // epoch 1 + await helpers.mineEpoch(epochManager) // epoch 2 + await shouldUndelegate(delegator, toGRT('10')) + }) + + it('reject undelegate if remaining tokens are less than the minimum', async function () { + await shouldDelegate(delegator, toGRT('100')) + const tx = staking.connect(delegator).undelegate(indexer.address, toGRT('99.5')) + await expect(tx).revertedWith('!minimum-delegation') + }) + }) + + describe('withdraw', function () { + it('reject withdraw if no funds available', async function () { + const tx = staking.connect(delegator).withdrawDelegated(indexer.address, AddressZero) + await expect(tx).revertedWith('!tokens') + }) + + it('reject withdraw before unbonding period', async function () { + await staking.connect(governor).setDelegationUnbondingPeriod('2') + await shouldDelegate(delegator, toGRT('1000')) + await shouldUndelegate(delegator, toGRT('100')) + + // Withdraw + const tx = staking.connect(delegator).withdrawDelegated(indexer.address, AddressZero) + await expect(tx).revertedWith('!tokens') + }) + + it('should withdraw after waiting an unbonding period', async function () { + const tokensToWithdraw = toGRT('100') + + // Setup + await staking.connect(governor).setDelegationUnbondingPeriod('2') + await shouldDelegate(delegator, toGRT('1000')) + await shouldUndelegate(delegator, tokensToWithdraw) + await helpers.mineEpoch(epochManager) // epoch 1 + await helpers.mineEpoch(epochManager) // epoch 2 + + // Withdraw + await shouldWithdrawDelegated(delegator, AddressZero, tokensToWithdraw) + }) + + it('should withdraw after waiting an unbonding period (with redelegation)', async function () { + const tokensToWithdraw = toGRT('100') + + // Setup + await staking.connect(governor).setDelegationUnbondingPeriod('2') + await shouldDelegate(delegator, toGRT('1000')) + await shouldUndelegate(delegator, tokensToWithdraw) + await helpers.mineEpoch(epochManager) // epoch 1 + await helpers.mineEpoch(epochManager) // epoch 2 + + // We stake on indexer2 so the delegator is able to re-delegate to it + // if we didn't do it, it will revert because of indexer2 not havings stake + await staking.connect(indexer2).stake(toGRT('1000')) + // Withdraw + await shouldWithdrawDelegated(delegator, indexer2.address, tokensToWithdraw) + }) + }) + }) + + describe('use of delegated funds', function () { + // Test values + const tokensToStake = toGRT('200') + const tokensToAllocate = toGRT('2000') + const tokensToDelegate = toGRT('1800') + const subgraphDeploymentID = randomHexBytes() + const channelKey = deriveChannelKey() + const allocationID = channelKey.address + + const setupAllocation = async (tokens: BigNumber) => { + return staking + .connect(indexer) + .allocateFrom( + indexer.address, + subgraphDeploymentID, + tokens, + allocationID, + metadata, + await channelKey.generateProof(indexer.address), + ) + } + + beforeEach(async function () { + // Indexer stake tokens + await staking.connect(indexer).stake(tokensToStake) + }) + + it('revert allocate when capacity is not enough', async function () { + // 1:2 delegation capacity + await staking.connect(governor).setDelegationRatio(2) + + // Delegate + await staking.connect(delegator).delegate(indexer.address, tokensToDelegate) + + // Staked: 200 + // Delegated: 1800 + // Capacity: 200 + min(200*2, 1800) = 600 + const tx = setupAllocation(tokensToAllocate) + await expect(tx).revertedWith('!capacity') + }) + + it('should allocate using full delegation capacity', async function () { + // 1:10 delegation capacity + await staking.connect(governor).setDelegationRatio(10) + + // Delegate + await staking.connect(delegator).delegate(indexer.address, tokensToDelegate) + + // Staked: 200 + // Delegated: 1800 + // Capacity: 200 + min(200*10, 1800) = 2000 + await setupAllocation(tokensToAllocate) + + // State updated + const alloc = await staking.getAllocation(allocationID) + expect(alloc.tokens).eq(tokensToAllocate) + }) + + it('should account delegation for indexer capacity properly', async function () { + // 1:10 delegation capacity + await staking.connect(governor).setDelegationRatio(10) + + // Delegate + await staking.connect(delegator).delegate(indexer.address, tokensToDelegate) + + // If we unstake all, the indexer capacity should go to zero + // Should not be able to use delegated tokens + await staking.connect(indexer).unstake(tokensToStake) + expect(await staking.getIndexerCapacity(indexer.address)).eq(0) + }) + + it('revert if it cannot assign the smallest amount of shares', async function () { + // Init the delegation pool + await shouldDelegate(delegator, toGRT('1')) + const tokensToAllocate = toGRT('1') + // Collect funds thru full allocation cycle + // Set rebate alpha to 0 to ensure all fees are collected + await staking.connect(governor).setRebateParameters(0, 1, 1, 1) + await staking.connect(governor).setDelegationRatio(10) + await staking.connect(indexer).setDelegationParameters(0, 0, 0) + await setupAllocation(tokensToAllocate) + await helpers.mineEpoch(epochManager) + await staking.connect(assetHolder).collect(tokensToCollect, allocationID) + await helpers.mineEpoch(epochManager) + await staking.connect(indexer).closeAllocation(allocationID, poi) + // We've callected 5e18 GRT (a ridiculous amount), + // which means the price of a share is now 5 GRT + + // Delegate with such small amount of tokens (1 GRT) that we do not have enough precision + // to even assign 1 share + const tx = staking.connect(delegator).delegate(indexer.address, toGRT('1')) + await expect(tx).revertedWith('!shares') + }) + }) + describe('isDelegator', function () { + it('should return true if the address is a delegator', async function () { + await staking.connect(indexer).stake(toGRT('1000')) + await shouldDelegate(delegator, toGRT('1')) + expect(await staking.isDelegator(indexer.address, delegator.address)).eq(true) + }) + + it('should return false if the address is not a delegator', async function () { + expect(await staking.isDelegator(indexer.address, delegator.address)).eq(false) + }) + }) +}) diff --git a/packages/contracts/test/unit/staking/l2Transfer.test.ts b/packages/contracts/test/unit/staking/l2Transfer.test.ts new file mode 100644 index 000000000..271161226 --- /dev/null +++ b/packages/contracts/test/unit/staking/l2Transfer.test.ts @@ -0,0 +1,1008 @@ +import hre from 'hardhat' +import { expect } from 'chai' +import { BigNumber, constants } from 'ethers' +import { defaultAbiCoder, parseEther } from 'ethers/lib/utils' + +import { GraphToken } from '../../../build/types/GraphToken' +import { IL1Staking } from '../../../build/types/IL1Staking' +import { IController } from '../../../build/types/IController' +import { L1GraphTokenGateway } from '../../../build/types/L1GraphTokenGateway' +import { L1GraphTokenLockTransferToolMock } from '../../../build/types/L1GraphTokenLockTransferToolMock' +import { L1GraphTokenLockTransferToolBadMock } from '../../../build/types/L1GraphTokenLockTransferToolBadMock' + +import { NetworkFixture } from '../lib/fixtures' + +import { + deploy, + DeployType, + deriveChannelKey, + GraphNetworkContracts, + helpers, + randomHexBytes, + toBN, + toGRT, +} from '@graphprotocol/sdk' +import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers' +import { L2GraphTokenGateway, L2Staking } from '../../../build/types' + +const { AddressZero } = constants + +describe('L1Staking:L2Transfer', () => { + const graph = hre.graph() + let governor: SignerWithAddress + let indexer: SignerWithAddress + let l2Indexer: SignerWithAddress + let delegator: SignerWithAddress + let l2Delegator: SignerWithAddress + + let fixture: NetworkFixture + let fixtureContracts: GraphNetworkContracts + let l2MockContracts: GraphNetworkContracts + + let l2StakingMock: L2Staking + let l2GRTGatewayMock: L2GraphTokenGateway + + let grt: GraphToken + let staking: IL1Staking + let controller: IController + let l1GraphTokenGateway: L1GraphTokenGateway + let l1GraphTokenLockTransferTool: L1GraphTokenLockTransferToolMock + let l1GraphTokenLockTransferToolBad: L1GraphTokenLockTransferToolBadMock + + // Test values + const indexerTokens = toGRT('10000000') + const delegatorTokens = toGRT('1000000') + const tokensToStake = toGRT('200000') + const subgraphDeploymentID = randomHexBytes() + const channelKey = deriveChannelKey() + const allocationID = channelKey.address + const metadata = randomHexBytes(32) + const minimumIndexerStake = toGRT('100000') + const delegationTaxPPM = 10000 // 1% + // Dummy L2 gas values + const maxGas = toBN('1000000') + const gasPriceBid = toBN('1000000000') + const maxSubmissionCost = toBN('1000000000') + + // Allocate with test values + const allocate = async (tokens: BigNumber) => { + return staking + .connect(indexer) + .allocateFrom( + indexer.address, + subgraphDeploymentID, + tokens, + allocationID, + metadata, + await channelKey.generateProof(indexer.address), + ) + } + + before(async function () { + [indexer, delegator, l2Indexer, l2Delegator] = await graph.getTestAccounts() + ;({ governor } = await graph.getNamedAccounts()) + + fixture = new NetworkFixture(graph.provider) + + // Deploy L1 + fixtureContracts = await fixture.load(governor) + grt = fixtureContracts.GraphToken as GraphToken + staking = fixtureContracts.L1Staking as unknown as IL1Staking + l1GraphTokenGateway = fixtureContracts.L1GraphTokenGateway as L1GraphTokenGateway + controller = fixtureContracts.Controller as IController + + // Deploy L1 arbitrum bridge + await fixture.loadL1ArbitrumBridge(governor) + + // Deploy L2 mock + l2MockContracts = await fixture.loadMock(true) + l2StakingMock = l2MockContracts.L2Staking as L2Staking + l2GRTGatewayMock = l2MockContracts.L2GraphTokenGateway as L2GraphTokenGateway + + // Configure graph bridge + await fixture.configureL1Bridge(governor, fixtureContracts, l2MockContracts) + + l1GraphTokenLockTransferTool = ( + await deploy(DeployType.Deploy, governor, { + name: 'L1GraphTokenLockTransferToolMock', + }) + ).contract as L1GraphTokenLockTransferToolMock + + l1GraphTokenLockTransferToolBad = ( + await deploy(DeployType.Deploy, governor, { name: 'L1GraphTokenLockTransferToolBadMock' }) + ).contract as L1GraphTokenLockTransferToolBadMock + + await helpers.setBalances([ + { address: l1GraphTokenLockTransferTool.address, balance: parseEther('1') }, + { address: l1GraphTokenLockTransferToolBad.address, balance: parseEther('1') }, + ]) + + await staking + .connect(governor) + .setL1GraphTokenLockTransferTool(l1GraphTokenLockTransferTool.address) + + // Give some funds to the indexer and approve staking contract to use funds on indexer behalf + await grt.connect(governor).mint(indexer.address, indexerTokens) + await grt.connect(indexer).approve(staking.address, indexerTokens) + + await grt.connect(governor).mint(delegator.address, delegatorTokens) + await grt.connect(delegator).approve(staking.address, delegatorTokens) + + await staking.connect(governor).setMinimumIndexerStake(minimumIndexerStake) + await staking.connect(governor).setDelegationTaxPercentage(delegationTaxPPM) // 1% + }) + + beforeEach(async function () { + await fixture.setUp() + }) + + afterEach(async function () { + await fixture.tearDown() + }) + + context('> when not staked', function () { + describe('transferStakeToL2', function () { + it('should not allow transferring for someone who has not staked', async function () { + const tx = staking + .connect(indexer) + .transferStakeToL2( + l2Indexer.address, + tokensToStake, + maxGas, + gasPriceBid, + maxSubmissionCost, + { + value: maxSubmissionCost.add(gasPriceBid.mul(maxGas)), + }, + ) + await expect(tx).revertedWith('tokensStaked == 0') + }) + }) + }) + + context('> when staked', function () { + const shouldTransferIndexerStake = async ( + amountToSend: BigNumber, + options: { + expectedSeqNum?: number + l2Beneficiary?: string + } = {}, + ) => { + const l2Beneficiary = options.l2Beneficiary ?? l2Indexer.address + const expectedSeqNum = options.expectedSeqNum ?? 1 + const tx = staking + .connect(indexer) + .transferStakeToL2(l2Beneficiary, amountToSend, maxGas, gasPriceBid, maxSubmissionCost, { + value: maxSubmissionCost.add(gasPriceBid.mul(maxGas)), + }) + const expectedFunctionData = defaultAbiCoder.encode(['tuple(address)'], [[l2Indexer.address]]) + + const expectedCallhookData = defaultAbiCoder.encode( + ['uint8', 'bytes'], + [toBN(0), expectedFunctionData], // code = 1 means RECEIVE_INDEXER_CODE + ) + const expectedL2Data = await l1GraphTokenGateway.getOutboundCalldata( + grt.address, + staking.address, + l2StakingMock.address, + amountToSend, + expectedCallhookData, + ) + + await expect(tx) + .emit(l1GraphTokenGateway, 'TxToL2') + .withArgs(staking.address, l2GRTGatewayMock.address, toBN(expectedSeqNum), expectedL2Data) + } + + beforeEach(async function () { + await staking.connect(indexer).stake(tokensToStake) + }) + + describe('receive()', function () { + it('should not allow receiving funds from a random address', async function () { + const tx = indexer.sendTransaction({ + to: staking.address, + value: parseEther('1'), + }) + await expect(tx).revertedWith('Only transfer tool can send ETH') + }) + it('should allow receiving funds from the transfer tool', async function () { + const impersonatedTransferTool = await helpers.impersonateAccount( + l1GraphTokenLockTransferTool.address, + ) + + const tx = impersonatedTransferTool.sendTransaction({ + to: staking.address, + value: parseEther('1'), + }) + await expect(tx).to.not.be.reverted + }) + }) + describe('transferStakeToL2', function () { + it('should not allow transferring if the protocol is partially paused', async function () { + await controller.connect(governor).setPartialPaused(true) + + const tx = staking + .connect(indexer) + .transferStakeToL2( + l2Indexer.address, + tokensToStake.sub(minimumIndexerStake), + maxGas, + gasPriceBid, + maxSubmissionCost, + { + value: maxSubmissionCost.add(gasPriceBid.mul(maxGas)), + }, + ) + await expect(tx).revertedWith('Partial-paused') + }) + it('should not allow transferring but leaving less than the minimum indexer stake', async function () { + const tx = staking + .connect(indexer) + .transferStakeToL2( + l2Indexer.address, + tokensToStake.sub(minimumIndexerStake).add(1), + maxGas, + gasPriceBid, + maxSubmissionCost, + { + value: maxSubmissionCost.add(gasPriceBid.mul(maxGas)), + }, + ) + await expect(tx).revertedWith('!minimumIndexerStake remaining') + }) + it('should not allow transferring less than the minimum indexer stake the first time', async function () { + const tx = staking + .connect(indexer) + .transferStakeToL2( + l2Indexer.address, + minimumIndexerStake.sub(1), + maxGas, + gasPriceBid, + maxSubmissionCost, + { + value: maxSubmissionCost.add(gasPriceBid.mul(maxGas)), + }, + ) + await expect(tx).revertedWith('!minimumIndexerStake sent') + }) + it('should not allow transferring if there are tokens locked for withdrawal', async function () { + await staking.connect(indexer).unstake(tokensToStake) + const tx = staking + .connect(indexer) + .transferStakeToL2( + l2Indexer.address, + tokensToStake, + maxGas, + gasPriceBid, + maxSubmissionCost, + { + value: maxSubmissionCost.add(gasPriceBid.mul(maxGas)), + }, + ) + await expect(tx).revertedWith('tokensLocked != 0') + }) + it('should not allow transferring to a beneficiary that is address zero', async function () { + const tx = staking + .connect(indexer) + .transferStakeToL2(AddressZero, tokensToStake, maxGas, gasPriceBid, maxSubmissionCost, { + value: maxSubmissionCost.add(gasPriceBid.mul(maxGas)), + }) + await expect(tx).revertedWith('l2Beneficiary == 0') + }) + it('should not allow transferring the whole stake if there are open allocations', async function () { + await allocate(toGRT('10')) + const tx = staking + .connect(indexer) + .transferStakeToL2( + l2Indexer.address, + tokensToStake, + maxGas, + gasPriceBid, + maxSubmissionCost, + { + value: maxSubmissionCost.add(gasPriceBid.mul(maxGas)), + }, + ) + await expect(tx).revertedWith('allocated') + }) + it('should not allow transferring partial stake if the remaining indexer capacity is insufficient for open allocations', async function () { + // We set delegation ratio == 1 so an indexer can only use as much delegation as their own stake + await staking.connect(governor).setDelegationRatio(1) + const tokensToDelegate = toGRT('202100') + await staking.connect(delegator).delegate(indexer.address, tokensToDelegate) + + // Now the indexer has 200k tokens staked and 200k tokens delegated + await allocate(toGRT('400000')) + + // But if we try to transfer even 100k, we will not have enough indexer capacity to cover the open allocation + const tx = staking + .connect(indexer) + .transferStakeToL2( + l2Indexer.address, + toGRT('100000'), + maxGas, + gasPriceBid, + maxSubmissionCost, + { + value: maxSubmissionCost.add(gasPriceBid.mul(maxGas)), + }, + ) + await expect(tx).revertedWith('! allocation capacity') + }) + it('should not allow transferring if the ETH sent is more than required', async function () { + const tx = staking + .connect(indexer) + .transferStakeToL2( + indexer.address, + tokensToStake, + maxGas, + gasPriceBid, + maxSubmissionCost, + { + value: maxSubmissionCost.add(gasPriceBid.mul(maxGas)).add(1), + }, + ) + await expect(tx).revertedWith('INVALID_ETH_AMOUNT') + }) + it('sends the tokens and a message through the L1GraphTokenGateway', async function () { + const amountToSend = minimumIndexerStake + await shouldTransferIndexerStake(amountToSend) + // Check that the indexer stake was reduced by the sent amount + expect((await staking.stakes(indexer.address)).tokensStaked).to.equal( + tokensToStake.sub(amountToSend), + ) + }) + it('should allow transferring the whole stake if there are no open allocations', async function () { + await shouldTransferIndexerStake(tokensToStake) + // Check that the indexer stake was reduced by the sent amount + expect((await staking.stakes(indexer.address)).tokensStaked).to.equal(0) + }) + it('should allow transferring partial stake if the remaining capacity can cover the allocations', async function () { + // We set delegation ratio == 1 so an indexer can only use as much delegation as their own stake + await staking.connect(governor).setDelegationRatio(1) + const tokensToDelegate = toGRT('200000') + await staking.connect(delegator).delegate(indexer.address, tokensToDelegate) + + // Now the indexer has 200k tokens staked and 200k tokens delegated, + // but they allocate 200k + await allocate(toGRT('200000')) + + // If we transfer 100k, we will still have enough indexer capacity to cover the open allocation + const amountToSend = toGRT('100000') + await shouldTransferIndexerStake(amountToSend) + // Check that the indexer stake was reduced by the sent amount + expect((await staking.stakes(indexer.address)).tokensStaked).to.equal( + tokensToStake.sub(amountToSend), + ) + }) + it('allows transferring several times to the same beneficiary', async function () { + // Stake a bit more so we're still over the minimum stake after transferring twice + await staking.connect(indexer).stake(tokensToStake) + await shouldTransferIndexerStake(minimumIndexerStake) + await shouldTransferIndexerStake(toGRT('1000'), { expectedSeqNum: 2 }) + expect((await staking.stakes(indexer.address)).tokensStaked).to.equal( + tokensToStake.mul(2).sub(minimumIndexerStake).sub(toGRT('1000')), + ) + }) + it('should not allow transferring to a different beneficiary the second time', async function () { + await shouldTransferIndexerStake(minimumIndexerStake) + const tx = staking.connect(indexer).transferStakeToL2( + indexer.address, // Note this is different from l2Indexer used before + minimumIndexerStake, + maxGas, + gasPriceBid, + maxSubmissionCost, + { + value: maxSubmissionCost.add(gasPriceBid.mul(maxGas)), + }, + ) + await expect(tx).revertedWith('l2Beneficiary != previous') + }) + }) + + describe('transferLockedStakeToL2', function () { + it('should not allow transferring if the protocol is partially paused', async function () { + await controller.connect(governor).setPartialPaused(true) + + const tx = staking + .connect(indexer) + .transferLockedStakeToL2(minimumIndexerStake, maxGas, gasPriceBid, maxSubmissionCost) + await expect(tx).revertedWith('Partial-paused') + }) + it('sends a message through L1GraphTokenGateway like transferStakeToL2, but gets the beneficiary and ETH from a transfer tool contract', async function () { + const amountToSend = minimumIndexerStake + + await l1GraphTokenLockTransferTool.setL2WalletAddress(indexer.address, l2Indexer.address) + const oldTransferToolEthBalance = await graph.provider.getBalance( + l1GraphTokenLockTransferTool.address, + ) + const tx = staking + .connect(indexer) + .transferLockedStakeToL2(minimumIndexerStake, maxGas, gasPriceBid, maxSubmissionCost) + const expectedFunctionData = defaultAbiCoder.encode( + ['tuple(address)'], + [[l2Indexer.address]], + ) + + const expectedCallhookData = defaultAbiCoder.encode( + ['uint8', 'bytes'], + [toBN(0), expectedFunctionData], // code = 0 means RECEIVE_INDEXER_CODE + ) + const expectedL2Data = await l1GraphTokenGateway.getOutboundCalldata( + grt.address, + staking.address, + l2StakingMock.address, + amountToSend, + expectedCallhookData, + ) + + await expect(tx) + .emit(l1GraphTokenGateway, 'TxToL2') + .withArgs(staking.address, l2GRTGatewayMock.address, toBN(1), expectedL2Data) + expect(await graph.provider.getBalance(l1GraphTokenLockTransferTool.address)).to.equal( + oldTransferToolEthBalance.sub(maxSubmissionCost).sub(gasPriceBid.mul(maxGas)), + ) + }) + it('should not allow transferring if the transfer tool contract returns a zero address beneficiary', async function () { + const tx = staking + .connect(indexer) + .transferLockedStakeToL2(minimumIndexerStake, maxGas, gasPriceBid, maxSubmissionCost) + await expect(tx).revertedWith('LOCK NOT TRANSFERRED') + }) + it('should not allow transferring if the transfer tool contract does not provide enough ETH', async function () { + await staking + .connect(governor) + .setL1GraphTokenLockTransferTool(l1GraphTokenLockTransferToolBad.address) + await l1GraphTokenLockTransferToolBad.setL2WalletAddress(indexer.address, l2Indexer.address) + const tx = staking + .connect(indexer) + .transferLockedStakeToL2(minimumIndexerStake, maxGas, gasPriceBid, maxSubmissionCost) + await expect(tx).revertedWith('ETH TRANSFER FAILED') + }) + }) + describe('unlockDelegationToTransferredIndexer', function () { + beforeEach(async function () { + await staking.connect(governor).setDelegationUnbondingPeriod(28) // epochs + }) + it('allows a delegator to a transferred indexer to withdraw locked delegation before the unbonding period', async function () { + const tokensToDelegate = toGRT('10000') + await staking.connect(delegator).delegate(indexer.address, tokensToDelegate) + const actualDelegation = tokensToDelegate.sub( + tokensToDelegate.mul(delegationTaxPPM).div(1000000), + ) + await staking + .connect(indexer) + .transferStakeToL2( + l2Indexer.address, + tokensToStake, + maxGas, + gasPriceBid, + maxSubmissionCost, + { + value: maxSubmissionCost.add(gasPriceBid.mul(maxGas)), + }, + ) + await staking.connect(delegator).undelegate(indexer.address, actualDelegation) + const tx = await staking + .connect(delegator) + .unlockDelegationToTransferredIndexer(indexer.address) + await expect(tx) + .emit(staking, 'StakeDelegatedUnlockedDueToL2Transfer') + .withArgs(indexer.address, delegator.address) + const tx2 = await staking.connect(delegator).withdrawDelegated(indexer.address, AddressZero) + await expect(tx2) + .emit(staking, 'StakeDelegatedWithdrawn') + .withArgs(indexer.address, delegator.address, actualDelegation) + }) + it('rejects calls if the protocol is partially paused', async function () { + await controller.connect(governor).setPartialPaused(true) + + const tx = staking.connect(delegator).unlockDelegationToTransferredIndexer(indexer.address) + await expect(tx).revertedWith('Partial-paused') + }) + it('rejects calls if the indexer has not transferred their stake to L2', async function () { + const tokensToDelegate = toGRT('10000') + await staking.connect(delegator).delegate(indexer.address, tokensToDelegate) + const tx = staking.connect(delegator).unlockDelegationToTransferredIndexer(indexer.address) + await expect(tx).revertedWith('indexer not transferred') + }) + it('rejects calls if the indexer has only transferred part of their stake but not all', async function () { + const tokensToDelegate = toGRT('10000') + await staking.connect(delegator).delegate(indexer.address, tokensToDelegate) + await staking + .connect(indexer) + .transferStakeToL2( + l2Indexer.address, + minimumIndexerStake, + maxGas, + gasPriceBid, + maxSubmissionCost, + { + value: maxSubmissionCost.add(gasPriceBid.mul(maxGas)), + }, + ) + const tx = staking.connect(delegator).unlockDelegationToTransferredIndexer(indexer.address) + await expect(tx).revertedWith('indexer not transferred') + }) + it('rejects calls if the delegator has not undelegated first', async function () { + const tokensToDelegate = toGRT('10000') + await staking.connect(delegator).delegate(indexer.address, tokensToDelegate) + await staking + .connect(indexer) + .transferStakeToL2( + l2Indexer.address, + tokensToStake, + maxGas, + gasPriceBid, + maxSubmissionCost, + { + value: maxSubmissionCost.add(gasPriceBid.mul(maxGas)), + }, + ) + const tx = staking.connect(delegator).unlockDelegationToTransferredIndexer(indexer.address) + await expect(tx).revertedWith('! locked') + }) + it('rejects calls if the caller is not a delegator', async function () { + await staking + .connect(indexer) + .transferStakeToL2( + l2Indexer.address, + tokensToStake, + maxGas, + gasPriceBid, + maxSubmissionCost, + { + value: maxSubmissionCost.add(gasPriceBid.mul(maxGas)), + }, + ) + const tx = staking.connect(delegator).unlockDelegationToTransferredIndexer(indexer.address) + // The function checks for tokensLockedUntil so this is the error we should get: + await expect(tx).revertedWith('! locked') + }) + }) + describe('transferDelegationToL2', function () { + it('rejects calls if the protocol is partially paused', async function () { + await controller.connect(governor).setPartialPaused(true) + + const tx = staking + .connect(delegator) + .transferDelegationToL2( + indexer.address, + l2Delegator.address, + maxGas, + gasPriceBid, + maxSubmissionCost, + { + value: maxSubmissionCost.add(gasPriceBid.mul(maxGas)), + }, + ) + await expect(tx).revertedWith('Partial-paused') + }) + it('rejects calls if the delegated indexer has not transferred stake to L2', async function () { + const tokensToDelegate = toGRT('10000') + await staking.connect(delegator).delegate(indexer.address, tokensToDelegate) + + const tx = staking + .connect(delegator) + .transferDelegationToL2( + indexer.address, + l2Delegator.address, + maxGas, + gasPriceBid, + maxSubmissionCost, + { + value: maxSubmissionCost.add(gasPriceBid.mul(maxGas)), + }, + ) + await expect(tx).revertedWith('indexer not transferred') + }) + it('rejects calls if the beneficiary is zero', async function () { + const tokensToDelegate = toGRT('10000') + await staking.connect(delegator).delegate(indexer.address, tokensToDelegate) + await staking + .connect(indexer) + .transferStakeToL2( + l2Indexer.address, + minimumIndexerStake, + maxGas, + gasPriceBid, + maxSubmissionCost, + { + value: maxSubmissionCost.add(gasPriceBid.mul(maxGas)), + }, + ) + + const tx = staking + .connect(delegator) + .transferDelegationToL2( + indexer.address, + AddressZero, + maxGas, + gasPriceBid, + maxSubmissionCost, + { + value: maxSubmissionCost.add(gasPriceBid.mul(maxGas)), + }, + ) + await expect(tx).revertedWith('l2Beneficiary == 0') + }) + it('rejects calls if the delegator has tokens locked for undelegation', async function () { + const tokensToDelegate = toGRT('10000') + await staking.connect(delegator).delegate(indexer.address, tokensToDelegate) + await staking + .connect(indexer) + .transferStakeToL2( + l2Indexer.address, + minimumIndexerStake, + maxGas, + gasPriceBid, + maxSubmissionCost, + { + value: maxSubmissionCost.add(gasPriceBid.mul(maxGas)), + }, + ) + await staking.connect(delegator).undelegate(indexer.address, toGRT('1')) + + const tx = staking + .connect(delegator) + .transferDelegationToL2( + indexer.address, + l2Delegator.address, + maxGas, + gasPriceBid, + maxSubmissionCost, + { + value: maxSubmissionCost.add(gasPriceBid.mul(maxGas)), + }, + ) + await expect(tx).revertedWith('tokensLocked != 0') + }) + it('rejects calls if the delegator has no tokens delegated to the indexer', async function () { + await staking + .connect(indexer) + .transferStakeToL2( + l2Indexer.address, + minimumIndexerStake, + maxGas, + gasPriceBid, + maxSubmissionCost, + { + value: maxSubmissionCost.add(gasPriceBid.mul(maxGas)), + }, + ) + + const tx = staking + .connect(delegator) + .transferDelegationToL2( + indexer.address, + l2Delegator.address, + maxGas, + gasPriceBid, + maxSubmissionCost, + { + value: maxSubmissionCost.add(gasPriceBid.mul(maxGas)), + }, + ) + await expect(tx).revertedWith('delegation == 0') + }) + it('sends all the tokens delegated to the indexer to the beneficiary on L2, using the gateway', async function () { + const tokensToDelegate = toGRT('10000') + await staking.connect(delegator).delegate(indexer.address, tokensToDelegate) + const actualDelegation = tokensToDelegate.sub( + tokensToDelegate.mul(delegationTaxPPM).div(1000000), + ) + await staking + .connect(indexer) + .transferStakeToL2( + l2Indexer.address, + minimumIndexerStake, + maxGas, + gasPriceBid, + maxSubmissionCost, + { + value: maxSubmissionCost.add(gasPriceBid.mul(maxGas)), + }, + ) + + const expectedFunctionData = defaultAbiCoder.encode( + ['tuple(address,address)'], + [[l2Indexer.address, l2Delegator.address]], + ) + + const expectedCallhookData = defaultAbiCoder.encode( + ['uint8', 'bytes'], + [toBN(1), expectedFunctionData], // code = 1 means RECEIVE_DELEGATION_CODE + ) + const expectedL2Data = await l1GraphTokenGateway.getOutboundCalldata( + grt.address, + staking.address, + l2StakingMock.address, + actualDelegation, + expectedCallhookData, + ) + + const tx = staking + .connect(delegator) + .transferDelegationToL2( + indexer.address, + l2Delegator.address, + maxGas, + gasPriceBid, + maxSubmissionCost, + { + value: maxSubmissionCost.add(gasPriceBid.mul(maxGas)), + }, + ) + // seqNum is 2 because the first bridge call was in transferStakeToL2 + await expect(tx) + .emit(l1GraphTokenGateway, 'TxToL2') + .withArgs(staking.address, l2GRTGatewayMock.address, toBN(2), expectedL2Data) + await expect(tx) + .emit(staking, 'DelegationTransferredToL2') + .withArgs( + delegator.address, + l2Delegator.address, + indexer.address, + l2Indexer.address, + actualDelegation, + ) + }) + it('sets the delegation shares to zero so cannot be called twice', async function () { + const tokensToDelegate = toGRT('10000') + await staking.connect(delegator).delegate(indexer.address, tokensToDelegate) + await staking + .connect(indexer) + .transferStakeToL2( + l2Indexer.address, + minimumIndexerStake, + maxGas, + gasPriceBid, + maxSubmissionCost, + { + value: maxSubmissionCost.add(gasPriceBid.mul(maxGas)), + }, + ) + + await staking + .connect(delegator) + .transferDelegationToL2( + indexer.address, + l2Delegator.address, + maxGas, + gasPriceBid, + maxSubmissionCost, + { + value: maxSubmissionCost.add(gasPriceBid.mul(maxGas)), + }, + ) + + const tx = staking + .connect(delegator) + .transferDelegationToL2( + indexer.address, + l2Delegator.address, + maxGas, + gasPriceBid, + maxSubmissionCost, + { + value: maxSubmissionCost.add(gasPriceBid.mul(maxGas)), + }, + ) + await expect(tx).revertedWith('delegation == 0') + }) + it('can be called again if the delegator added more delegation (edge case)', async function () { + const tokensToDelegate = toGRT('10000') + await staking.connect(delegator).delegate(indexer.address, tokensToDelegate) + const actualDelegation = tokensToDelegate.sub( + tokensToDelegate.mul(delegationTaxPPM).div(1000000), + ) + await staking + .connect(indexer) + .transferStakeToL2( + l2Indexer.address, + minimumIndexerStake, + maxGas, + gasPriceBid, + maxSubmissionCost, + { + value: maxSubmissionCost.add(gasPriceBid.mul(maxGas)), + }, + ) + + await staking + .connect(delegator) + .transferDelegationToL2( + indexer.address, + l2Delegator.address, + maxGas, + gasPriceBid, + maxSubmissionCost, + { + value: maxSubmissionCost.add(gasPriceBid.mul(maxGas)), + }, + ) + + await staking.connect(delegator).delegate(indexer.address, tokensToDelegate) + + const tx = staking + .connect(delegator) + .transferDelegationToL2( + indexer.address, + l2Delegator.address, + maxGas, + gasPriceBid, + maxSubmissionCost, + { + value: maxSubmissionCost.add(gasPriceBid.mul(maxGas)), + }, + ) + await expect(tx) + .emit(staking, 'DelegationTransferredToL2') + .withArgs( + delegator.address, + l2Delegator.address, + indexer.address, + l2Indexer.address, + actualDelegation, + ) + }) + it('rejects calls if the ETH value is larger than expected', async function () { + const tokensToDelegate = toGRT('10000') + await staking.connect(delegator).delegate(indexer.address, tokensToDelegate) + await staking + .connect(indexer) + .transferStakeToL2( + l2Indexer.address, + minimumIndexerStake, + maxGas, + gasPriceBid, + maxSubmissionCost, + { + value: maxSubmissionCost.add(gasPriceBid.mul(maxGas)), + }, + ) + + const tx = staking + .connect(delegator) + .transferDelegationToL2( + indexer.address, + l2Delegator.address, + maxGas, + gasPriceBid, + maxSubmissionCost, + { + value: maxSubmissionCost.add(gasPriceBid.mul(maxGas)).add(1), + }, + ) + await expect(tx).revertedWith('INVALID_ETH_AMOUNT') + }) + }) + describe('transferLockedDelegationToL2', function () { + it('rejects calls if the protocol is partially paused', async function () { + await controller.connect(governor).setPartialPaused(true) + + const tx = staking + .connect(delegator) + .transferLockedDelegationToL2(indexer.address, maxGas, gasPriceBid, maxSubmissionCost) + await expect(tx).revertedWith('Partial-paused') + }) + it('sends delegated tokens to L2 like transferDelegationToL2, but gets the beneficiary and ETH from the L1GraphTokenLockTransferTool', async function () { + const tokensToDelegate = toGRT('10000') + await staking.connect(delegator).delegate(indexer.address, tokensToDelegate) + const actualDelegation = tokensToDelegate.sub( + tokensToDelegate.mul(delegationTaxPPM).div(1000000), + ) + + await staking + .connect(indexer) + .transferStakeToL2( + l2Indexer.address, + minimumIndexerStake, + maxGas, + gasPriceBid, + maxSubmissionCost, + { + value: maxSubmissionCost.add(gasPriceBid.mul(maxGas)), + }, + ) + + const expectedFunctionData = defaultAbiCoder.encode( + ['tuple(address,address)'], + [[l2Indexer.address, l2Delegator.address]], + ) + + const expectedCallhookData = defaultAbiCoder.encode( + ['uint8', 'bytes'], + [toBN(1), expectedFunctionData], // code = 1 means RECEIVE_DELEGATION_CODE + ) + const expectedL2Data = await l1GraphTokenGateway.getOutboundCalldata( + grt.address, + staking.address, + l2StakingMock.address, + actualDelegation, + expectedCallhookData, + ) + + await l1GraphTokenLockTransferTool.setL2WalletAddress( + delegator.address, + l2Delegator.address, + ) + + const oldTransferToolEthBalance = await graph.provider.getBalance( + l1GraphTokenLockTransferTool.address, + ) + const tx = staking + .connect(delegator) + .transferLockedDelegationToL2(indexer.address, maxGas, gasPriceBid, maxSubmissionCost) + // seqNum is 2 because the first bridge call was in transferStakeToL2 + await expect(tx) + .emit(l1GraphTokenGateway, 'TxToL2') + .withArgs(staking.address, l2GRTGatewayMock.address, toBN(2), expectedL2Data) + await expect(tx) + .emit(staking, 'DelegationTransferredToL2') + .withArgs( + delegator.address, + l2Delegator.address, + indexer.address, + l2Indexer.address, + actualDelegation, + ) + expect(await graph.provider.getBalance(l1GraphTokenLockTransferTool.address)).to.equal( + oldTransferToolEthBalance.sub(maxSubmissionCost).sub(gasPriceBid.mul(maxGas)), + ) + }) + it('rejects calls if the transfer tool contract returns a zero address beneficiary', async function () { + const tokensToDelegate = toGRT('10000') + await staking.connect(delegator).delegate(indexer.address, tokensToDelegate) + + await staking + .connect(indexer) + .transferStakeToL2( + l2Indexer.address, + minimumIndexerStake, + maxGas, + gasPriceBid, + maxSubmissionCost, + { + value: maxSubmissionCost.add(gasPriceBid.mul(maxGas)), + }, + ) + + const tx = staking + .connect(delegator) + .transferLockedDelegationToL2(indexer.address, maxGas, gasPriceBid, maxSubmissionCost) + await expect(tx).revertedWith('LOCK NOT TRANSFERRED') + }) + it('rejects calls if the transfer tool contract does not provide enough ETH', async function () { + const tokensToDelegate = toGRT('10000') + await staking.connect(delegator).delegate(indexer.address, tokensToDelegate) + + await staking + .connect(indexer) + .transferStakeToL2( + l2Indexer.address, + minimumIndexerStake, + maxGas, + gasPriceBid, + maxSubmissionCost, + { + value: maxSubmissionCost.add(gasPriceBid.mul(maxGas)), + }, + ) + await staking + .connect(governor) + .setL1GraphTokenLockTransferTool(l1GraphTokenLockTransferToolBad.address) + + await l1GraphTokenLockTransferToolBad.setL2WalletAddress( + delegator.address, + l2Delegator.address, + ) + const tx = staking + .connect(delegator) + .transferLockedDelegationToL2(indexer.address, maxGas, gasPriceBid, maxSubmissionCost) + await expect(tx).revertedWith('ETH TRANSFER FAILED') + }) + }) + }) +}) diff --git a/packages/contracts/test/unit/staking/rebate.test.ts b/packages/contracts/test/unit/staking/rebate.test.ts new file mode 100644 index 000000000..7eb989fdc --- /dev/null +++ b/packages/contracts/test/unit/staking/rebate.test.ts @@ -0,0 +1,239 @@ +import hre from 'hardhat' +import { expect } from 'chai' +import { BigNumber, Contract } from 'ethers' + +import { LibExponential } from '../../../build/types/LibExponential' + +import { formatGRT, isGraphL1ChainId, toGRT } from '@graphprotocol/sdk' +import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers' +import { NetworkFixture } from '../lib/fixtures' + +const toFloat = (n: BigNumber) => parseFloat(formatGRT(n)) +const toFixed = (n: number | BigNumber, precision = 12) => { + if (typeof n === 'number') { + return n.toFixed(precision) + } + return toFloat(n).toFixed(precision) +} + +const ABI_LIB_EXPONENTIAL = [ + { + inputs: [ + { + internalType: 'uint256', + name: 'fees', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'stake', + type: 'uint256', + }, + { + internalType: 'uint32', + name: 'alphaNumerator', + type: 'uint32', + }, + { + internalType: 'uint32', + name: 'alphaDenominator', + type: 'uint32', + }, + { + internalType: 'uint32', + name: 'lambdaNumerator', + type: 'uint32', + }, + { + internalType: 'uint32', + name: 'lambdaDenominator', + type: 'uint32', + }, + ], + name: 'exponentialRebates', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'pure', + type: 'function', + }, +] + +type RebateParameters = number[] + +interface RebateTestCase { + totalRewards: number + fees: number + totalFees: number + stake: number + totalStake: number +} + +// This function calculates the exponential rebates formula in Typescript so we can compare against +// the Solidity implementation +export function exponentialRebates( + fees: number, + stake: number, + alphaNumerator: number, + alphaDenominator: number, + lambdaNumerator: number, + lambdaDenominator: number, +): number { + const alpha = alphaNumerator / alphaDenominator + if (alpha === 0) { + return fees + } + + const lambda = lambdaNumerator / lambdaDenominator + if (fees === 0) { + return 0 + } + + const exponent = (lambda * stake) / fees + // eslint-disable-next-line no-secrets/no-secrets + // LibExponential.MAX_EXPONENT = 15 + if (exponent > 15) { + return fees + } + + return fees * (1 - alpha * Math.exp(-exponent)) +} + +describe('Staking:rebates', () => { + const graph = hre.graph({ addressBook: 'addresses-local.json' }) + + let libExponential: LibExponential + let fixture: NetworkFixture + + let governor: SignerWithAddress + + const testCases: RebateTestCase[] = [ + { totalRewards: 1400, fees: 100, totalFees: 1400, stake: 5000, totalStake: 7300 }, + { totalRewards: 1400, fees: 300, totalFees: 1400, stake: 600, totalStake: 7300 }, + { totalRewards: 1400, fees: 1000, totalFees: 1400, stake: 500, totalStake: 7300 }, + { totalRewards: 1400, fees: 0, totalFees: 1400, stake: 1200, totalStake: 7300 }, + ] + + // Edge case #1 - No closed allocations any query fees + const edgeCases1: RebateTestCase[] = [ + { totalRewards: 0, fees: 0, totalFees: 0, stake: 5000, totalStake: 7300 }, + { totalRewards: 0, fees: 0, totalFees: 0, stake: 600, totalStake: 7300 }, + { totalRewards: 0, fees: 0, totalFees: 0, stake: 500, totalStake: 7300 }, + { totalRewards: 0, fees: 0, totalFees: 0, stake: 1200, totalStake: 7300 }, + ] + + // Edge case #2 - Closed allocations with queries but no stake + const edgeCases2: RebateTestCase[] = [ + { totalRewards: 1300, fees: 100, totalFees: 1300, stake: 0, totalStake: 0 }, + { totalRewards: 1300, fees: 0, totalFees: 1300, stake: 0, totalStake: 0 }, + { totalRewards: 1300, fees: 200, totalFees: 1300, stake: 0, totalStake: 0 }, + { totalRewards: 1300, fees: 1000, totalFees: 1300, stake: 0, totalStake: 0 }, + ] + + // Test if the Solidity implementation of the rebate formula match the local implementation + async function shouldMatchFormulas(testCases: RebateTestCase[], rebateParams: RebateParameters) { + const [alphaNumerator, alphaDenominator, lambdaNumerator, lambdaDenominator] = rebateParams + + for (const testCase of testCases) { + // Test Typescript exponential rebates formula implementation + const r1 = exponentialRebates( + testCase.fees, + testCase.stake, + alphaNumerator, + alphaDenominator, + lambdaNumerator, + lambdaDenominator, + ) + + // Convert non-alpha values to wei before sending for precision + const r2 = await libExponential.exponentialRebates( + toGRT(testCase.fees), + toGRT(testCase.stake), + alphaNumerator, + alphaDenominator, + lambdaNumerator, + lambdaDenominator, + ) + + // Must match : contracts to local implementation + expect(toFixed(r1)).eq(toFixed(r2)) + } + } + + function testRebateParameters(fn, testCases) { + // *** Exponential rebates *** + // Typical alpha and lambda + it('alpha 1 - lambda 0.6', async function () { + const params: RebateParameters = [10, 10, 6, 10] + await fn(testCases, params) + }) + + // Typical alpha and lambda + it('alpha 0.25 - lambda 0.1', async function () { + const params: RebateParameters = [1, 4, 1, 10] + await fn(testCases, params) + }) + + // Periodic alpha and lambda + it('alpha ~0.33 - lambda ~0.66', async function () { + const params: RebateParameters = [1, 3, 2, 3] + await fn(testCases, params) + }) + + // Small alpha typical lambda + it('alpha 0.005 - lambda 0.6', async function () { + const params: RebateParameters = [1, 200, 6, 10] + await fn(testCases, params) + }) + + // Typical alpha small lambda + it('alpha 1 - lambda 0.6', async function () { + const params: RebateParameters = [1, 1, 1, 200] + await fn(testCases, params) + }) + + // Edge alpha - typical lambda + it('alpha 0 - lambda 0.6', async function () { + const params: RebateParameters = [0, 1, 6, 10] + await fn(testCases, params) + }) + + // Typical alpha - edge lambda + it('alpha 1 - lambda 0', async function () { + const params: RebateParameters = [1, 1, 0, 10] + await fn(testCases, params) + }) + } + + before(async function () { + ({ governor } = await graph.getNamedAccounts()) + fixture = new NetworkFixture(graph.provider) + await fixture.load(governor) + + const stakingName = isGraphL1ChainId(graph.chainId) ? 'L1Staking' : 'L2Staking' + const entry = graph.addressBook.getEntry(stakingName) + libExponential = new Contract( + entry.implementation.libraries.LibExponential, + ABI_LIB_EXPONENTIAL, + graph.provider, + ) as LibExponential + }) + + describe('should match rebates Solidity implementation', function () { + describe('normal test case', function () { + testRebateParameters(shouldMatchFormulas, testCases) + }) + + describe('edge #1 test case', function () { + testRebateParameters(shouldMatchFormulas, edgeCases1) + }) + + describe('edge #2 test case', function () { + testRebateParameters(shouldMatchFormulas, edgeCases2) + }) + }) +}) diff --git a/packages/contracts/test/unit/staking/staking.test.ts b/packages/contracts/test/unit/staking/staking.test.ts new file mode 100644 index 000000000..6fe5fdcb0 --- /dev/null +++ b/packages/contracts/test/unit/staking/staking.test.ts @@ -0,0 +1,542 @@ +import hre from 'hardhat' +import { expect } from 'chai' +import { BigNumber, constants, Event } from 'ethers' + +import { GraphToken } from '../../../build/types/GraphToken' +import { IStaking } from '../../../build/types/IStaking' + +import { NetworkFixture } from '../lib/fixtures' + +import { + deriveChannelKey, + GraphNetworkContracts, + helpers, + randomHexBytes, + toBN, + toGRT, +} from '@graphprotocol/sdk' +import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers' + +const { AddressZero, MaxUint256 } = constants + +function weightedAverage( + valueA: BigNumber, + valueB: BigNumber, + periodA: BigNumber, + periodB: BigNumber, +) { + return periodA.mul(valueA).add(periodB.mul(valueB)).div(valueA.add(valueB)) +} + +describe('Staking:Stakes', () => { + const graph = hre.graph() + let me: SignerWithAddress + let governor: SignerWithAddress + let indexer: SignerWithAddress + let slasher: SignerWithAddress + let fisherman: SignerWithAddress + + let fixture: NetworkFixture + + let contracts: GraphNetworkContracts + let grt: GraphToken + let staking: IStaking + + // Test values + const indexerTokens = toGRT('1000') + const tokensToStake = toGRT('100') + const subgraphDeploymentID = randomHexBytes() + const channelKey = deriveChannelKey() + const allocationID = channelKey.address + const metadata = randomHexBytes(32) + + // Allocate with test values + const allocate = async (tokens: BigNumber) => { + return staking + .connect(indexer) + .allocateFrom( + indexer.address, + subgraphDeploymentID, + tokens, + allocationID, + metadata, + await channelKey.generateProof(indexer.address), + ) + } + + // Stake and verify state change + const shouldStake = async function (tokensToStake: BigNumber) { + // Before state + const beforeIndexerStake = await staking.getIndexerStakedTokens(indexer.address) + const beforeStakingBalance = await grt.balanceOf(staking.address) + + // Stake + const tx = staking.connect(indexer).stake(tokensToStake) + await expect(tx).emit(staking, 'StakeDeposited').withArgs(indexer.address, tokensToStake) + + // After state + const afterIndexerStake = await staking.getIndexerStakedTokens(indexer.address) + const afterStakingBalance = await grt.balanceOf(staking.address) + + // State updated + expect(afterIndexerStake).eq(beforeIndexerStake.add(tokensToStake)) + expect(afterStakingBalance).eq(beforeStakingBalance.add(tokensToStake)) + } + + before(async function () { + [me, indexer, slasher, fisherman] = await graph.getTestAccounts() + ;({ governor } = await graph.getNamedAccounts()) + fixture = new NetworkFixture(graph.provider) + contracts = await fixture.load(governor) + grt = contracts.GraphToken as GraphToken + staking = contracts.Staking as IStaking + + // Give some funds to the indexer and approve staking contract to use funds on indexer behalf + await grt.connect(governor).mint(indexer.address, indexerTokens) + await grt.connect(indexer).approve(staking.address, indexerTokens) + + await staking.connect(governor).setSlasher(slasher.address, true) + }) + + beforeEach(async function () { + await fixture.setUp() + }) + + afterEach(async function () { + await fixture.tearDown() + }) + + context('> when not staked', function () { + describe('hasStake', function () { + it('should not have stakes', async function () { + expect(await staking.hasStake(indexer.address)).eq(false) + }) + }) + + describe('stake', function () { + it('reject stake zero tokens', async function () { + const tx = staking.connect(indexer).stake(toGRT('0')) + await expect(tx).revertedWith('!tokens') + }) + + it('reject stake less than minimum indexer stake', async function () { + const amount = (await staking.minimumIndexerStake()).sub(toGRT('1')) + const tx = staking.connect(indexer).stake(amount) + await expect(tx).revertedWith('!minimumIndexerStake') + }) + + it('should stake tokens', async function () { + await shouldStake(tokensToStake) + }) + + it('should stake tokens = minimumIndexerStake', async function () { + await shouldStake(await staking.minimumIndexerStake()) + }) + }) + + describe('unstake', function () { + it('reject unstake tokens', async function () { + const tokensToUnstake = toGRT('2') + const tx = staking.connect(indexer).unstake(tokensToUnstake) + await expect(tx).revertedWith('!stake') + }) + }) + + describe('slash', function () { + it('reject slash indexer', async function () { + const tokensToSlash = toGRT('10') + const tokensToReward = toGRT('10') + const tx = staking + .connect(slasher) + .slash(indexer.address, tokensToSlash, tokensToReward, fisherman.address) + await expect(tx).revertedWith('!stake') + }) + }) + }) + + context('> when staked', function () { + beforeEach(async function () { + await staking.connect(indexer).stake(tokensToStake) + }) + + describe('hasStake', function () { + it('should have stakes', async function () { + expect(await staking.hasStake(indexer.address)).eq(true) + }) + }) + + describe('stake', function () { + it('should allow re-staking', async function () { + await shouldStake(tokensToStake) + }) + + it('reject to stake under the minimum indexer stake after unstake + slash', async function () { + // Unstake (we get right on the minimum stake) + const minimumIndexerStake = await staking.minimumIndexerStake() + const tokensStaked = (await staking.stakes(indexer.address)).tokensStaked + const tokensToGetOnMinimumStake = tokensStaked.sub(minimumIndexerStake) + await staking.connect(indexer).unstake(tokensToGetOnMinimumStake) + + // Slash some indexer tokens to get under the water of the minimum indexer stake + await staking + .connect(slasher) + .slash(indexer.address, toGRT('10'), toGRT(0), fisherman.address) + + // Stake should require to go over the minimum stake + const tx = staking.connect(indexer).stake(toGRT('1')) + await expect(tx).revertedWith('!minimumIndexerStake') + }) + }) + + describe('unstake', function () { + it('should unstake and lock tokens for thawing period', async function () { + const tokensToUnstake = toGRT('2') + const thawingPeriod = toBN(await staking.thawingPeriod()) + const currentBlock = await helpers.latestBlock() + const until = currentBlock + thawingPeriod.add(toBN('1')).toNumber() + + // Unstake + const tx = staking.connect(indexer).unstake(tokensToUnstake) + await expect(tx) + .emit(staking, 'StakeLocked') + .withArgs(indexer.address, tokensToUnstake, until) + }) + + it('should unstake and lock tokens for (weighted avg) thawing period if repeated', async function () { + const tokensToUnstake = toGRT('10') + const thawingPeriod = toBN(await staking.thawingPeriod()) + + // Unstake (1) + const tx1 = await staking.connect(indexer).unstake(tokensToUnstake) + const receipt1 = await tx1.wait() + const event1: Event = receipt1.events.pop() + const tokensLockedUntil1 = event1.args['until'] + + // Move forward before the tokens are unlocked for withdrawal + await helpers.mineUpTo(tokensLockedUntil1.sub(5)) + + // Calculate locking time for tokens taking into account the previous unstake request + const currentBlock = await helpers.latestBlock() + const lockingPeriod = weightedAverage( + tokensToUnstake, + tokensToUnstake, + tokensLockedUntil1.sub(currentBlock), + thawingPeriod, + ) + const expectedLockedUntil = currentBlock + lockingPeriod.add(toBN('1')).toNumber() + + // Unstake (2) + const tx2 = await staking.connect(indexer).unstake(tokensToUnstake) + const receipt2 = await tx2.wait() + + // Verify events + const event2: Event = receipt2.events.pop() + expect(event2.args['until']).eq(expectedLockedUntil) + + // Verify state + const afterIndexerStake = await staking.stakes(indexer.address) + expect(afterIndexerStake.tokensLocked).eq(tokensToUnstake.mul(2)) // we unstaked two times + expect(afterIndexerStake.tokensLockedUntil).eq(expectedLockedUntil) + }) + + it('should always increase the thawing period on subsequent unstakes', async function () { + const tokensToUnstake = toGRT('10') + const tokensToUnstakeSecondTime = toGRT('0.000001') + + // Unstake (1) + const tx1 = await staking.connect(indexer).unstake(tokensToUnstake) + const receipt1 = await tx1.wait() + const event1: Event = receipt1.events.pop() + const tokensLockedUntil1 = event1.args['until'] + + // Move forward before the tokens are unlocked for withdrawal + await helpers.mineUpTo(tokensLockedUntil1.sub(5)) + + // Ensure at least 1 block is added (i.e. the weighted average rounds up) + const expectedLockedUntil = tokensLockedUntil1.add(1) + + // Unstake (2) + const tx2 = await staking.connect(indexer).unstake(tokensToUnstakeSecondTime) + const receipt2 = await tx2.wait() + + // Verify events + const event2: Event = receipt2.events.pop() + expect(event2.args['until']).eq(expectedLockedUntil) + + // Verify state + const afterIndexerStake = await staking.stakes(indexer.address) + expect(afterIndexerStake.tokensLocked).eq(tokensToUnstake.add(tokensToUnstakeSecondTime)) // we unstaked two times + expect(afterIndexerStake.tokensLockedUntil).eq(expectedLockedUntil) + }) + + it('should unstake and withdraw if some tokens are unthawed', async function () { + const tokensToUnstake = toGRT('10') + const thawingPeriod = toBN(await staking.thawingPeriod()) + + const beforeIndexerBalance = await grt.balanceOf(indexer.address) + + // Unstake (1) + const tx1 = await staking.connect(indexer).unstake(tokensToUnstake) + const receipt1 = await tx1.wait() + const event1: Event = receipt1.events.pop() + const tokensLockedUntil1 = event1.args['until'] + + // Move forward after the tokens are unlocked for withdrawal + await helpers.mineUpTo(tokensLockedUntil1) + + // Calculate locking time for tokens taking into account some tokens are withdraweable + const currentBlock = await helpers.latestBlock() + const expectedLockedUntil = currentBlock + thawingPeriod.add(toBN('1')).toNumber() + + // Unstake (2) + const tx2 = await staking.connect(indexer).unstake(tokensToUnstake) + const receipt2 = await tx2.wait() + + // Verify events + const unstakeEvent: Event = receipt2.events.pop() + const withdrawEvent: Event = receipt2.events.pop() + expect(unstakeEvent.args['until']).eq(expectedLockedUntil) + expect(withdrawEvent.args['tokens']).eq(tokensToUnstake) + + // Verify state + const afterIndexerStake = await staking.stakes(indexer.address) + const afterIndexerBalance = await grt.balanceOf(indexer.address) + expect(afterIndexerStake.tokensLocked).eq(tokensToUnstake) + expect(afterIndexerStake.tokensLockedUntil).eq(expectedLockedUntil) + expect(afterIndexerBalance).eq(beforeIndexerBalance.add(tokensToUnstake)) + }) + + it('should unstake available tokens even if passed a higher amount', async function () { + // Try to unstake a bit more than currently staked + const tokensOverCapacity = tokensToStake.add(toGRT('1')) + await staking.connect(indexer).unstake(tokensOverCapacity) + + // Check state + const tokensLocked = (await staking.stakes(indexer.address)).tokensLocked + expect(tokensLocked).eq(tokensToStake) + }) + + it('reject unstake zero tokens', async function () { + const tx = staking.connect(indexer).unstake(toGRT('0')) + await expect(tx).revertedWith('!stake-avail') + }) + + it('reject unstake under the minimum indexer stake', async function () { + const minimumIndexerStake = await staking.minimumIndexerStake() + const tokensStaked = (await staking.stakes(indexer.address)).tokensStaked + const tokensToGetUnderMinimumStake = tokensStaked.sub(minimumIndexerStake).add(1) + const tx = staking.connect(indexer).unstake(tokensToGetUnderMinimumStake) + await expect(tx).revertedWith('!minimumIndexerStake') + }) + + it('reject unstake under the minimum indexer stake w/multiple unstake', async function () { + const minimumIndexerStake = await staking.minimumIndexerStake() + const tokensStaked = (await staking.stakes(indexer.address)).tokensStaked + + // First unstake (we get right on the minimum stake) + const tokensToGetOnMinimumStake = tokensStaked.sub(minimumIndexerStake) + await staking.connect(indexer).unstake(tokensToGetOnMinimumStake) + + // Second unstake, taking just one token out will make us under the minimum stake + const tx = staking.connect(indexer).unstake(toGRT('1')) + await expect(tx).revertedWith('!minimumIndexerStake') + }) + + it('should allow unstake of full amount', async function () { + await staking.connect(indexer).unstake(tokensToStake) + expect(await staking.getIndexerCapacity(indexer.address)).eq(0) + }) + + it('should allow unstake of full amount with no upper limits', async function () { + // Use manual mining + await helpers.setAutoMine(false) + + // Setup + const newTokens = toGRT('2') + const stakedTokens = await staking.getIndexerStakedTokens(indexer.address) + const tokensToUnstake = stakedTokens.add(newTokens) + + // StakeTo & Unstake + await staking.connect(indexer).stakeTo(indexer.address, newTokens) + await staking.connect(indexer).unstake(MaxUint256) + await helpers.mine() + + // Check state + const tokensLocked = (await staking.stakes(indexer.address)).tokensLocked + expect(tokensLocked).eq(tokensToUnstake) + + // Restore automine + await helpers.setAutoMine(true) + }) + }) + + describe('withdraw', function () { + it('reject withdraw if no tokens available', async function () { + const tx = staking.connect(indexer).withdraw() + await expect(tx).revertedWith('!tokens') + }) + + it('should withdraw if tokens available', async function () { + // Unstake + const tokensToUnstake = toGRT('10') + const tx1 = await staking.connect(indexer).unstake(tokensToUnstake) + const receipt1 = await tx1.wait() + const event1: Event = receipt1.events.pop() + const tokensLockedUntil = event1.args['until'] + + // Withdraw on locking period (should fail) + const tx2 = staking.connect(indexer).withdraw() + await expect(tx2).revertedWith('!tokens') + + // Move forward + await helpers.mineUpTo(tokensLockedUntil) + + // Withdraw after locking period (all good) + const beforeBalance = await grt.balanceOf(indexer.address) + const tx3 = staking.connect(indexer).withdraw() + await expect(tx3).emit(staking, 'StakeWithdrawn').withArgs(indexer.address, tokensToUnstake) + const afterBalance = await grt.balanceOf(indexer.address) + expect(afterBalance).eq(beforeBalance.add(tokensToUnstake)) + }) + }) + + describe('slash', function () { + // This function tests slashing behaviour under different conditions + const shouldSlash = async function ( + indexer: SignerWithAddress, + tokensToSlash: BigNumber, + tokensToReward: BigNumber, + fisherman: SignerWithAddress, + ) { + // Before + const beforeTotalSupply = await grt.totalSupply() + const beforeFishermanTokens = await grt.balanceOf(fisherman.address) + const beforeIndexerStake = await staking.getIndexerStakedTokens(indexer.address) + + // Slash indexer + const tokensToBurn = tokensToSlash.sub(tokensToReward) + const tx = staking + .connect(slasher) + .slash(indexer.address, tokensToSlash, tokensToReward, fisherman.address) + await expect(tx) + .emit(staking, 'StakeSlashed') + .withArgs(indexer.address, tokensToSlash, tokensToReward, fisherman.address) + + // After + const afterTotalSupply = await grt.totalSupply() + const afterFishermanTokens = await grt.balanceOf(fisherman.address) + const afterIndexerStake = await staking.getIndexerStakedTokens(indexer.address) + + // Check slashed tokens has been burned + expect(afterTotalSupply).eq(beforeTotalSupply.sub(tokensToBurn)) + // Check reward was given to the fisherman + expect(afterFishermanTokens).eq(beforeFishermanTokens.add(tokensToReward)) + // Check indexer stake was updated + expect(afterIndexerStake).eq(beforeIndexerStake.sub(tokensToSlash)) + } + + it('should slash indexer and give reward to beneficiary slash>reward', async function () { + // Slash indexer + const tokensToSlash = toGRT('100') + const tokensToReward = toGRT('10') + await shouldSlash(indexer, tokensToSlash, tokensToReward, fisherman) + }) + + it('should slash indexer and give reward to beneficiary slash=reward', async function () { + // Slash indexer + const tokensToSlash = toGRT('10') + const tokensToReward = toGRT('10') + await shouldSlash(indexer, tokensToSlash, tokensToReward, fisherman) + }) + + it('should slash indexer even when overallocated', async function () { + // Initial stake + const beforeTokensStaked = await staking.getIndexerStakedTokens(indexer.address) + + // Unstake partially, these tokens will be locked + const tokensToUnstake = toGRT('10') + await staking.connect(indexer).unstake(tokensToUnstake) + + // Allocate indexer stake + const tokensToAllocate = toGRT('70') + await allocate(tokensToAllocate) + + // State pre-slashing + // helpers.logStake(await staking.stakes(indexer)) + // > Current state: + // = Staked: 100 + // = Locked: 10 + // = Allocated: 70 + // = Available: 20 (staked - allocated - locked) + + // Even if all stake is allocated it should slash the indexer + const tokensToSlash = toGRT('80') + const tokensToReward = toGRT('0') + await shouldSlash(indexer, tokensToSlash, tokensToReward, fisherman) + + // State post-slashing + // helpers.logStake(await staking.stakes(indexer)) + // > Current state: + // = Staked: 20 + // = Locked: 0 + // = Allocated: 70 + // = Available: -50 (staked - allocated - locked) => when tokens available becomes negative + // we are overallocated, the staking contract will prevent unstaking or allocating until + // the balance is restored by staking or unallocating + + const stakes = await staking.stakes(indexer.address) + // Stake should be reduced by the amount slashed + expect(stakes.tokensStaked).eq(beforeTokensStaked.sub(tokensToSlash)) + // All allocated tokens should be untouched + expect(stakes.tokensAllocated).eq(tokensToAllocate) + // All locked tokens need to be consumed from the stake + expect(stakes.tokensLocked).eq(toBN('0')) + expect(stakes.tokensLockedUntil).eq(toBN('0')) + // Tokens available when negative means over allocation + const tokensAvailable = stakes.tokensStaked + .sub(stakes.tokensAllocated) + .sub(stakes.tokensLocked) + expect(tokensAvailable).eq(toGRT('-50')) + + const tx = staking.connect(indexer).unstake(tokensToUnstake) + await expect(tx).revertedWith('!stake-avail') + }) + + it('reject to slash zero tokens', async function () { + const tokensToSlash = toGRT('0') + const tokensToReward = toGRT('0') + const tx = staking + .connect(slasher) + .slash(indexer.address, tokensToSlash, tokensToReward, me.address) + await expect(tx).revertedWith('!tokens') + }) + + it('reject to slash indexer if caller is not slasher', async function () { + const tokensToSlash = toGRT('100') + const tokensToReward = toGRT('10') + const tx = staking + .connect(me) + .slash(indexer.address, tokensToSlash, tokensToReward, me.address) + await expect(tx).revertedWith('!slasher') + }) + + it('reject to slash indexer if beneficiary is zero address', async function () { + const tokensToSlash = toGRT('100') + const tokensToReward = toGRT('10') + const tx = staking + .connect(slasher) + .slash(indexer.address, tokensToSlash, tokensToReward, AddressZero) + await expect(tx).revertedWith('!beneficiary') + }) + + it('reject to slash indexer if reward is greater than slash amount', async function () { + const tokensToSlash = toGRT('100') + const tokensToReward = toGRT('200') + const tx = staking + .connect(slasher) + .slash(indexer.address, tokensToSlash, tokensToReward, fisherman.address) + await expect(tx).revertedWith('rewards>slash') + }) + }) + }) +}) diff --git a/packages/contracts/test/unit/upgrade/admin.test.ts b/packages/contracts/test/unit/upgrade/admin.test.ts new file mode 100644 index 000000000..1cd9720ba --- /dev/null +++ b/packages/contracts/test/unit/upgrade/admin.test.ts @@ -0,0 +1,210 @@ +import { expect } from 'chai' +import hre from 'hardhat' +import '@nomiclabs/hardhat-ethers' + +import { GraphProxy } from '../../../build/types/GraphProxy' +import { Curation } from '../../../build/types/Curation' +import { GraphProxyAdmin } from '../../../build/types/GraphProxyAdmin' +import { IStaking } from '../../../build/types/IStaking' + +import { NetworkFixture } from '../lib/fixtures' + +import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers' +import { deploy, DeployType, GraphNetworkContracts, loadContractAt } from '@graphprotocol/sdk' + +const { ethers } = hre +const { AddressZero } = ethers.constants + +describe('Upgrades', () => { + const graph = hre.graph() + let me: SignerWithAddress + let governor: SignerWithAddress + + let fixture: NetworkFixture + + let contracts: GraphNetworkContracts + let proxyAdmin: GraphProxyAdmin + let curation: Curation + let staking: IStaking + let stakingProxy: GraphProxy + + before(async function () { + [me, governor] = await graph.getTestAccounts() + + fixture = new NetworkFixture(graph.provider) + contracts = await fixture.load(governor) + staking = contracts.Staking as IStaking + proxyAdmin = contracts.GraphProxyAdmin as GraphProxyAdmin + curation = contracts.Curation as Curation + stakingProxy = loadContractAt('GraphProxy', staking.address, undefined, governor) as GraphProxy + + // Give some funds to the indexer and approve staking contract to use funds on indexer behalf + }) + + beforeEach(async function () { + await fixture.setUp() + }) + + afterEach(async function () { + await fixture.tearDown() + }) + + describe('GraphProxyAdmin & GraphProxy', function () { + describe('getters', function () { + describe('admin()', function () { + it('should get the proxy admin of a proxy contract', async function () { + const proxyAdminAddress = await proxyAdmin.getProxyAdmin(staking.address) + expect(proxyAdmin.address).eq(proxyAdminAddress) + }) + + it('reject get admin from other than the ProxyAdmin', async function () { + await expect(stakingProxy.connect(governor).admin()).revertedWith( + 'function selector was not recognized and there\'s no fallback function', + ) + }) + }) + + describe('implementation()', function () { + it('should get implementation only from ProxyAdmin', async function () { + const implementationAddress = await proxyAdmin.getProxyImplementation(staking.address) + expect(implementationAddress).not.eq(AddressZero) + }) + + it('reject get implementation from other than the ProxyAdmin', async function () { + await expect(stakingProxy.implementation()).revertedWith( + 'function selector was not recognized and there\'s no fallback function', + ) + }) + }) + + describe('pendingImplementation()', function () { + it('should get pending implementation only from ProxyAdmin', async function () { + const pendingImplementationAddress = await proxyAdmin.getProxyPendingImplementation( + staking.address, + ) + expect(pendingImplementationAddress).eq(AddressZero) + }) + + it('reject get pending implementation from other than the ProxyAdmin', async function () { + await expect(stakingProxy.connect(governor).pendingImplementation()).revertedWith( + 'function selector was not recognized and there\'s no fallback function', + ) + }) + }) + }) + + describe('upgrade', function () { + it('should be able to upgrade contract', async function () { + // Get some other implementation to use just for the purpose of the test + const oldImplementationAddress = await proxyAdmin.getProxyImplementation(staking.address) + const newImplementationAddress = await proxyAdmin.getProxyImplementation(curation.address) + + const stakingProxy = loadContractAt('GraphProxy', staking.address, undefined, governor) + + // Upgrade the Staking:Proxy to a new implementation + const tx1 = proxyAdmin.connect(governor).upgrade(staking.address, newImplementationAddress) + await expect(tx1) + .emit(stakingProxy, 'PendingImplementationUpdated') + .withArgs(AddressZero, newImplementationAddress) + + const tx2 = proxyAdmin + .connect(governor) + .acceptProxy(newImplementationAddress, staking.address) + await expect(tx2) + .emit(stakingProxy, 'ImplementationUpdated') + .withArgs(oldImplementationAddress, newImplementationAddress) + + // Implementation should be the new one + expect(await proxyAdmin.getProxyImplementation(curation.address)).eq( + newImplementationAddress, + ) + }) + + it('reject upgrade if not the governor of the ProxyAdmin', async function () { + const newImplementationAddress = await proxyAdmin.getProxyImplementation(curation.address) + + // Upgrade the Staking:Proxy to a new implementation + const tx = proxyAdmin.connect(me).upgrade(staking.address, newImplementationAddress) + await expect(tx).revertedWith('Only Governor can call') + }) + + it('reject upgrade if not using the ProxyAdmin', async function () { + const newImplementationAddress = await proxyAdmin.getProxyImplementation(curation.address) + + // Due to the transparent proxy we should not be able to upgrade from other than the proxy admin + const tx = stakingProxy.connect(governor).upgradeTo(newImplementationAddress) + await expect(tx).revertedWith( + 'function selector was not recognized and there\'s no fallback function', + ) + }) + }) + + describe('acceptUpgrade', function () { + it('reject accept upgrade if not using the ProxyAdmin', async function () { + // Due to the transparent proxy we should not be able to accept upgrades from other than the proxy admin + const tx = stakingProxy.connect(governor).acceptUpgrade() + await expect(tx).revertedWith( + 'function selector was not recognized and there\'s no fallback function', + ) + }) + }) + + describe('acceptProxy', function () { + it('reject accept proxy if not using the ProxyAdmin', async function () { + const newImplementationAddress = await proxyAdmin.getProxyImplementation(curation.address) + const implementation = loadContractAt( + 'Curation', + newImplementationAddress, + undefined, + governor, + ) + + // Start an upgrade to a new implementation + await proxyAdmin.connect(governor).upgrade(staking.address, newImplementationAddress) + + // Try to accept the proxy directly from the implementation, this should not work, only from the ProxyAdmin + const tx = implementation.connect(governor).acceptProxy(staking.address) + await expect(tx).revertedWith('Caller must be the proxy admin') + }) + }) + + describe('changeProxyAdmin', function () { + it('should set the proxy admin of a proxy', async function () { + const { contract: otherProxyAdmin } = await deploy(DeployType.Deploy, governor, { + name: 'GraphProxyAdmin', + }) + + await proxyAdmin + .connect(governor) + .changeProxyAdmin(staking.address, otherProxyAdmin.address) + expect(await otherProxyAdmin.getProxyAdmin(staking.address)).eq(otherProxyAdmin.address) + + // Should not find the change admin function in the proxy due to transparent proxy + // as this ProxyAdmin is not longer the owner + const tx = proxyAdmin + .connect(governor) + .changeProxyAdmin(staking.address, otherProxyAdmin.address) + await expect(tx).revertedWith( + 'function selector was not recognized and there\'s no fallback function', + ) + }) + + it('reject change admin if not the governor of the ProxyAdmin', async function () { + const { contract: otherProxyAdmin } = await deploy(DeployType.Deploy, governor, { + name: 'GraphProxyAdmin', + }) + + const tx = proxyAdmin.connect(me).changeProxyAdmin(staking.address, otherProxyAdmin.address) + await expect(tx).revertedWith('Only Governor can call') + }) + + it('reject change admin if not using the ProxyAdmin', async function () { + // Due to the transparent proxy we should not be able to set admin from other than the proxy admin + const tx = stakingProxy.connect(governor).setAdmin(me.address) + await expect(tx).revertedWith( + 'function selector was not recognized and there\'s no fallback function', + ) + }) + }) + }) +}) diff --git a/truffle.js b/packages/contracts/truffle.js similarity index 100% rename from truffle.js rename to packages/contracts/truffle.js diff --git a/packages/contracts/tsconfig.json b/packages/contracts/tsconfig.json new file mode 100644 index 000000000..a876614c5 --- /dev/null +++ b/packages/contracts/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "lib": ["ES2020", "dom"], + "module": "Node16", + "moduleResolution": "node16", + "target": "ES2020", + "outDir": "dist", + "resolveJsonModule": true, + "esModuleInterop": true + }, + "include": [ + ".solcover.js", + "truffle.js", + "eslint.config.js", + "prettier.config.js", + "solhint.config.js", + "hardhat.config.ts", + "index.d.ts", + "scripts/**/*.ts", + "test/**/*.ts", + "tasks/**/*.ts" + ] +} diff --git a/packages/data-edge/.env.sample b/packages/data-edge/.env.sample new file mode 100644 index 000000000..3409066ad --- /dev/null +++ b/packages/data-edge/.env.sample @@ -0,0 +1,4 @@ +MNEMONIC= +INFURA_KEY= +ETHERSCAN_API_KEY= +ARBISCAN_API_KEY= diff --git a/packages/data-edge/.prettierignore b/packages/data-edge/.prettierignore new file mode 100644 index 000000000..e69de29bb diff --git a/packages/data-edge/.solcover.js b/packages/data-edge/.solcover.js new file mode 100644 index 000000000..bef64bdf9 --- /dev/null +++ b/packages/data-edge/.solcover.js @@ -0,0 +1,10 @@ +const skipFiles = [''] + +module.exports = { + providerOptions: { + mnemonic: 'myth like bonus scare over problem client lizard pioneer submit female collect', + network_id: 1337, + }, + skipFiles, + istanbulFolder: './reports/coverage', +} diff --git a/packages/data-edge/LICENSE b/packages/data-edge/LICENSE new file mode 100644 index 000000000..947d07ab5 --- /dev/null +++ b/packages/data-edge/LICENSE @@ -0,0 +1,342 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + +Copyright (C) 1989, 1991 Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. + + Preamble + +The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + +When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + +To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + +For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + +We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + +Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + +Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + +The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + +0. This License applies to any program or other work which contains + a notice placed by the copyright holder saying it may be distributed + under the terms of this General Public License. The "Program", below, + refers to any such program or work, and a "work based on the Program" + means either the Program or any derivative work under copyright law: + that is to say, a work containing the Program or a portion of it, + either verbatim or with modifications and/or translated into another + language. (Hereinafter, translation is included without limitation in + the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + +1. You may copy and distribute verbatim copies of the Program's + source code as you receive it, in any medium, provided that you + conspicuously and appropriately publish on each copy an appropriate + copyright notice and disclaimer of warranty; keep intact all the + notices that refer to this License and to the absence of any warranty; + and give any other recipients of the Program a copy of this License + along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + +2. You may modify your copy or copies of the Program or any portion + of it, thus forming a work based on the Program, and copy and + distribute such modifications or work under the terms of Section 1 + above, provided that you also meet all of these conditions: + + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + +3. You may copy and distribute the Program (or a work based on it, + under Section 2) in object code or executable form under the terms of + Sections 1 and 2 above provided that you also do one of the following: + + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + +4. You may not copy, modify, sublicense, or distribute the Program + except as expressly provided under this License. Any attempt + otherwise to copy, modify, sublicense or distribute the Program is + void, and will automatically terminate your rights under this License. + However, parties who have received copies, or rights, from you under + this License will not have their licenses terminated so long as such + parties remain in full compliance. + +5. You are not required to accept this License, since you have not + signed it. However, nothing else grants you permission to modify or + distribute the Program or its derivative works. These actions are + prohibited by law if you do not accept this License. Therefore, by + modifying or distributing the Program (or any work based on the + Program), you indicate your acceptance of this License to do so, and + all its terms and conditions for copying, distributing or modifying + the Program or works based on it. + +6. Each time you redistribute the Program (or any work based on the + Program), the recipient automatically receives a license from the + original licensor to copy, distribute or modify the Program subject to + these terms and conditions. You may not impose any further + restrictions on the recipients' exercise of the rights granted herein. + You are not responsible for enforcing compliance by third parties to + this License. + +7. If, as a consequence of a court judgment or allegation of patent + infringement or for any other reason (not limited to patent issues), + conditions are imposed on you (whether by court order, agreement or + otherwise) that contradict the conditions of this License, they do not + excuse you from the conditions of this License. If you cannot + distribute so as to satisfy simultaneously your obligations under this + License and any other pertinent obligations, then as a consequence you + may not distribute the Program at all. For example, if a patent + license would not permit royalty-free redistribution of the Program by + all those who receive copies directly or indirectly through you, then + the only way you could satisfy both it and this License would be to + refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + +8. If the distribution and/or use of the Program is restricted in + certain countries either by patents or by copyrighted interfaces, the + original copyright holder who places the Program under this License + may add an explicit geographical distribution limitation excluding + those countries, so that distribution is permitted only in or among + countries not thus excluded. In such case, this License incorporates + the limitation as if written in the body of this License. + +9. The Free Software Foundation may publish revised and/or new versions + of the General Public License from time to time. Such new versions will + be similar in spirit to the present version, but may differ in detail to + address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + +10. If you wish to incorporate parts of the Program into other free + programs whose distribution conditions are different, write to the author + to ask for permission. For software which is copyrighted by the Free + Software Foundation, write to the Free Software Foundation; we sometimes + make exceptions for this. Our decision will be guided by the two goals + of preserving the free status of all derivatives of our free software and + of promoting the sharing and reuse of software generally. + + NO WARRANTY + +11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY + FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN + OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES + PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED + OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS + TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE + PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, + REPAIR OR CORRECTION. + +12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING + WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR + REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, + INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING + OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED + TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY + YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER + PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE + POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + +To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + +Yoyodyne, Inc., hereby disclaims all copyright interest in the program +`Gnomovision' (which makes passes at compilers) written by James Hacker. + +, 1 April 1989 +Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/packages/data-edge/README.md b/packages/data-edge/README.md new file mode 100644 index 000000000..3f344dba3 --- /dev/null +++ b/packages/data-edge/README.md @@ -0,0 +1,20 @@ +# Data Edge + +A DataEdge contract is used to store arbitrary data on-chain on any EVM compatible blockchain. A subgraph can then read all the calldata sent to a particular contract, decode it and update the subgraph state accordingly. + +The DataEdge accepts any function call by using a fallback function that will not revert. It is up to the implementor to define the calldata format as well as how to decode it. + +### Additional Considerations + +- Fallback is not payable to avoid anyone sending ETH by mistake as the main purpose is to store calldata. + +# Deploying + +Setup a `.env` file with the keys you want to use for deployments. You can use `.env.sample` as a guide. +Deploy a `DataEdge` contract by running `pnpm deploy -- --network ` + +# Copyright + +Copyright © 2022 The Graph Foundation + +Licensed under [GPL license](LICENSE). diff --git a/packages/data-edge/addresses.json b/packages/data-edge/addresses.json new file mode 100644 index 000000000..73842c025 --- /dev/null +++ b/packages/data-edge/addresses.json @@ -0,0 +1,16 @@ +{ + "1": { + "EBODataEdge": "0xADE906194C923b28F03F48BC5D9D987AAE21fFab" + }, + "42161": { + "EBOEventfulDataEdge": "0x633bb9790d7c4c59991cebd377c0ed6501a35ebe", + "SAOEventfulDataEdge": "0xeD16cEbd4fa74a0016E1149cc03563Db4B223aec" + }, + "421614": { + "EBOEventfulDataEdge": "0x9b9402939133F27c6eba81a321dfBFa1feE6714E", + "SAOEventfulDataEdge": "0xB61AF143c79Cbdd68f179B657AaC86665CC2B469" + }, + "11155111": { + "EBOEventfulDataEdge": "0xEFC8D47673777b899f2FB597C6FC0E87ecce98Cb" + } +} \ No newline at end of file diff --git a/packages/data-edge/contracts/DataEdge.sol b/packages/data-edge/contracts/DataEdge.sol new file mode 100644 index 000000000..fc39b7386 --- /dev/null +++ b/packages/data-edge/contracts/DataEdge.sol @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.8.12; + +/// @title Data Edge contract is only used to store on-chain data, it does not +/// perform execution. On-chain client services can read the data +/// and decode the payload for different purposes. +contract DataEdge { + /// @dev Fallback function, accepts any payload + fallback() external payable { + // no-op + } +} diff --git a/packages/data-edge/contracts/EventfulDataEdge.sol b/packages/data-edge/contracts/EventfulDataEdge.sol new file mode 100644 index 000000000..d995be665 --- /dev/null +++ b/packages/data-edge/contracts/EventfulDataEdge.sol @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.8.12; + +/// @title Data Edge contract is only used to store on-chain data, it does not +/// perform execution. On-chain client services can read the data +/// and decode the payload for different purposes. +/// NOTE: This version emits an event with the calldata. +contract EventfulDataEdge { + event Log(bytes data); + + /// @dev Fallback function, accepts any payload + fallback() external payable { + emit Log(msg.data); + } +} diff --git a/packages/data-edge/eslint.config.js b/packages/data-edge/eslint.config.js new file mode 100644 index 000000000..c7c0ba1b2 --- /dev/null +++ b/packages/data-edge/eslint.config.js @@ -0,0 +1,17 @@ +const config = require('eslint-graph-config') + +module.exports = [ + ...config.default, + { + rules: { + '@typescript-eslint/no-unsafe-assignment': 'off', + '@typescript-eslint/no-var-requires': 'off', + '@typescript-eslint/no-unsafe-call': 'off', + '@typescript-eslint/no-unsafe-member-access': 'off', + '@typescript-eslint/no-unsafe-argument': 'off', + }, + }, + { + ignores: ['**/reports/*'], + }, +] diff --git a/packages/data-edge/hardhat.config.ts b/packages/data-edge/hardhat.config.ts new file mode 100644 index 000000000..8cd85bf0e --- /dev/null +++ b/packages/data-edge/hardhat.config.ts @@ -0,0 +1,191 @@ +import * as dotenv from 'dotenv' +dotenv.config() + +import { HardhatUserConfig } from 'hardhat/types' +import { task } from 'hardhat/config' + +// Plugins + +import '@nomiclabs/hardhat-ethers' +import '@nomiclabs/hardhat-etherscan' +import '@nomiclabs/hardhat-waffle' +import 'hardhat-abi-exporter' +import 'hardhat-gas-reporter' +import 'hardhat-contract-sizer' +import '@openzeppelin/hardhat-upgrades' +import '@typechain/hardhat' + +import "@tenderly/hardhat-tenderly"; + + +// Tasks + +import './tasks/craft-calldata' +import './tasks/post-calldata' +import './tasks/deploy' + +// Networks + +interface NetworkConfig { + network: string + chainId: number + gas?: number | 'auto' + gasPrice?: number | 'auto' + url?: string +} + +const networkConfigs: NetworkConfig[] = [ + { network: 'mainnet', chainId: 1 }, + { network: 'ropsten', chainId: 3 }, + { network: 'rinkeby', chainId: 4 }, + { network: 'kovan', chainId: 42 }, + { network: 'sepolia', chainId: 11155111 }, + { + network: 'arbitrum-one', + chainId: 42161, + url: 'https://arb1.arbitrum.io/rpc', + }, + { + network: 'arbitrum-goerli', + chainId: 421613, + url: 'https://goerli-rollup.arbitrum.io/rpc', + }, + { + network: 'arbitrum-sepolia', + chainId: 421614, + url: 'https://sepolia-rollup.arbitrum.io/rpcblock', + }, +] + +function getAccountMnemonic() { + return process.env.MNEMONIC || '' +} + +function getAccountIndex() { + return process.env.ACCOUNT_INDEX ? parseInt(process.env.ACCOUNT_INDEX) : 0 +} + +function getDefaultProviderURL(network: string) { + return `https://${network}.infura.io/v3/${process.env.INFURA_KEY}` +} + +function setupDefaultNetworkProviders(buidlerConfig) { + for (const netConfig of networkConfigs) { + buidlerConfig.networks[netConfig.network] = { + chainId: netConfig.chainId, + url: netConfig.url ? netConfig.url : getDefaultProviderURL(netConfig.network), + gas: netConfig.gasPrice || 'auto', + gasPrice: netConfig.gasPrice || 'auto', + accounts: { + mnemonic: getAccountMnemonic(), + path: "m/44'/60'/0'/0", + initialIndex: getAccountIndex(), + }, + } + } +} + +// Tasks + +task('accounts', 'Prints the list of accounts', async (_, bre) => { + const accounts = await bre.ethers.getSigners() + for (const account of accounts) { + console.log(await account.getAddress()) + } +}) + +// Config +const config: HardhatUserConfig = { + paths: { + sources: './contracts', + tests: './test', + artifacts: './build/contracts', + }, + solidity: { + compilers: [ + { + version: '0.8.12', + settings: { + optimizer: { + enabled: true, + runs: 200, + }, + outputSelection: { + '*': { + '*': ['storageLayout'], + }, + }, + }, + }, + ], + }, + defaultNetwork: 'hardhat', + networks: { + hardhat: { + chainId: 1337, + loggingEnabled: false, + gas: 1200000, + gasPrice: 'auto', + blockGasLimit: 12000000, + accounts: { + mnemonic: 'myth like bonus scare over problem client lizard pioneer submit female collect', + }, + mining: { + auto: true, + interval: 0, + }, + }, + ganache: { + chainId: 1337, + url: 'http://localhost:8545', + }, + }, + etherscan: { + apiKey: { + mainnet: process.env.ETHERSCAN_API_KEY, + goerli: process.env.ETHERSCAN_API_KEY, + sepolia: process.env.ETHERSCAN_API_KEY, + arbitrumOne: process.env.ARBISCAN_API_KEY, + arbitrumGoerli: process.env.ARBISCAN_API_KEY, + arbitrumSepolia: process.env.ARBISCAN_API_KEY, + }, + customChains: [ + { + network: 'arbitrumSepolia', + chainId: 421614, + urls: { + apiURL: 'https://api-sepolia.arbiscan.io/api', + browserURL: 'https://sepolia.arbiscan.io', + }, + }, + ], + }, + gasReporter: { + enabled: process.env.REPORT_GAS ? true : false, + showTimeSpent: true, + currency: 'USD', + outputFile: 'reports/gas-report.log', + }, + typechain: { + outDir: 'build/types', + target: 'ethers-v5', + }, + abiExporter: { + path: './build/abis', + clear: false, + flat: true, + }, + tenderly: { + project: process.env.TENDERLY_PROJECT, + username: process.env.TENDERLY_USERNAME, + }, + contractSizer: { + alphaSort: true, + runOnCompile: false, + disambiguatePaths: true, + }, +} + +setupDefaultNetworkProviders(config) + +export default config diff --git a/packages/data-edge/package.json b/packages/data-edge/package.json new file mode 100644 index 000000000..03095477b --- /dev/null +++ b/packages/data-edge/package.json @@ -0,0 +1,81 @@ +{ + "name": "@graphprotocol/data-edge", + "private": true, + "version": "0.2.0", + "description": "The Graph Data Edge", + "main": "index.js", + "scripts": { + "prepare": "cd ../.. && husky install packages/contracts/.husky", + "prepublishOnly": "scripts/prepublish", + "build": "scripts/build", + "clean": "rm -rf build/ cache/ dist/", + "compile": "hardhat compile", + "test": "scripts/test", + "test:gas": "RUN_EVM=true REPORT_GAS=true scripts/test", + "test:coverage": "scripts/coverage", + "lint": "pnpm lint:ts && pnpm lint:sol", + "lint:ts": "eslint '**/*.{js,ts}' --fix", + "lint:sol": "prettier --write 'contracts/**/*.sol' && solhint --fix --noPrompt contracts/**/*.sol --config node_modules/solhint-graph-config/index.js", + "prettier": "pnpm prettier:ts && pnpm prettier:sol", + "prettier:ts": "prettier --write 'test/**/*.ts'", + "prettier:sol": "prettier --write 'contracts/**/*.sol'", + "security": "scripts/security", + "flatten": "scripts/flatten", + "typechain": "hardhat typechain", + "verify": "hardhat verify", + "size": "hardhat size-contracts", + "deploy": "hardhat run scripts/deploy.ts" + }, + "files": [ + "dist/**/*", + "README.md", + "LICENSE" + ], + "lint-staged": { + "contracts/*.sol": [ + "prettier --write" + ], + "test/**/*.ts": [ + "prettier --write" + ] + }, + "author": "The Graph Team", + "license": "GPL-2.0-or-later", + "devDependencies": { + "@commitlint/cli": "^16.2.1", + "@commitlint/config-conventional": "^16.2.1", + "@nomiclabs/hardhat-ethers": "^2.0.2", + "@nomiclabs/hardhat-etherscan": "^3.1.2", + "@nomiclabs/hardhat-waffle": "^2.0.1", + "@openzeppelin/contracts": "^4.5.0", + "@openzeppelin/hardhat-upgrades": "^1.8.2", + "@tenderly/api-client": "^1.0.13", + "@tenderly/hardhat-tenderly": "^1.0.13", + "@typechain/ethers-v5": "^9.0.0", + "@typechain/hardhat": "^4.0.0", + "@types/mocha": "^9.0.0", + "@types/node": "^17.0.0", + "chai": "^4.2.0", + "dotenv": "^16.0.0", + "eslint": "^8.57.0", + "eslint-graph-config": "workspace:^0.0.1", + "ethereum-waffle": "^3.0.2", + "ethers": "^5.1.3", + "ethlint": "^1.2.5", + "hardhat": "~2.14.0", + "hardhat-abi-exporter": "^2.2.0", + "hardhat-contract-sizer": "^2.0.3", + "hardhat-gas-reporter": "^1.0.4", + "husky": "^7.0.4", + "lint-staged": "^12.3.5", + "prettier": "^2.1.1", + "prettier-plugin-solidity": "^1.0.0-alpha.56", + "solhint": "^4.5.2", + "solhint-graph-config": "workspace:^0.0.1", + "solidity-coverage": "^0.7.10", + "truffle-flattener": "^1.4.4", + "ts-node": "^10.5.0", + "typechain": "^7.0.0", + "typescript": "^4.0.2" + } +} diff --git a/packages/data-edge/scripts/build b/packages/data-edge/scripts/build new file mode 100755 index 000000000..0cbb3b5a0 --- /dev/null +++ b/packages/data-edge/scripts/build @@ -0,0 +1,6 @@ +#!/bin/bash + +set -eo pipefail + +# Build +pnpm compile \ No newline at end of file diff --git a/packages/data-edge/scripts/coverage b/packages/data-edge/scripts/coverage new file mode 100755 index 000000000..d067ae3a4 --- /dev/null +++ b/packages/data-edge/scripts/coverage @@ -0,0 +1,6 @@ +#!/bin/bash + +set -eo pipefail + +pnpm compile +npx hardhat coverage $@ \ No newline at end of file diff --git a/packages/data-edge/scripts/flatten b/packages/data-edge/scripts/flatten new file mode 100755 index 000000000..15c3830f5 --- /dev/null +++ b/packages/data-edge/scripts/flatten @@ -0,0 +1,21 @@ +#!/bin/bash + +OUT_DIR="build/flatten" + +mkdir -p ${OUT_DIR} + +echo "Flattening contracts..." + +FILES=( + "contracts/Counter.sol" +) + +for path in ${FILES[@]}; do + IFS='/' + parts=( $path ) + name=${parts[${#parts[@]}-1]} + echo "Flatten > ${name}" + hardhat flatten "${path}" > "${OUT_DIR}/${name}" +done + +echo "Done!" diff --git a/packages/data-edge/scripts/prepublish b/packages/data-edge/scripts/prepublish new file mode 100755 index 000000000..f82a85729 --- /dev/null +++ b/packages/data-edge/scripts/prepublish @@ -0,0 +1,23 @@ +#!/bin/bash + +TYPECHAIN_DIR=dist/types + +set -eo pipefail + +# Build contracts +pnpm clean +pnpm build + +# Refresh distribution folder +rm -rf dist && mkdir -p dist/types/_src +cp -R build/contracts/contracts/ dist/abis +cp -R build/types/ dist/types/_src + +### Build Typechain bindings + +# Build and create TS declarations +tsc -d ${TYPECHAIN_DIR}/_src/*.ts --outdir ${TYPECHAIN_DIR} +# Copy back sources +cp ${TYPECHAIN_DIR}/_src/*.ts ${TYPECHAIN_DIR} +# Delete temporary src dir +rm -rf ${TYPECHAIN_DIR}/_src \ No newline at end of file diff --git a/packages/data-edge/scripts/security b/packages/data-edge/scripts/security new file mode 100755 index 000000000..b647eca1e --- /dev/null +++ b/packages/data-edge/scripts/security @@ -0,0 +1,17 @@ +#!/bin/bash + +## Before running: +# This tool requires to have solc installed. +# Ensure that you have the binaries installed by pip3 in your path. +# Install: https://github.com/crytic/slither#how-to-install +# Usage: https://github.com/crytic/slither/wiki/Usage + +mkdir -p reports + +pip3 install --user slither-analyzer && \ +pnpm build && \ + +echo "Analyzing contracts..." +slither . &> reports/analyzer-report.log && \ + +echo "Done!" diff --git a/packages/data-edge/scripts/test b/packages/data-edge/scripts/test new file mode 100755 index 000000000..45ccd4b41 --- /dev/null +++ b/packages/data-edge/scripts/test @@ -0,0 +1,56 @@ +#!/bin/bash + +set -eo pipefail + +MNEMONIC="myth like bonus scare over problem client lizard pioneer submit female collect" +TESTRPC_PORT=8545 + +### Functions + +evm_running() { + nc -z localhost "$TESTRPC_PORT" +} + +evm_start() { + echo "Starting our own evm instance at port $TESTRPC_PORT" + npx hardhat node --port "$TESTRPC_PORT" > /dev/null & +} + +evm_kill() { + if evm_running; then + echo "Killing evm instance at port $TESTRPC_PORT" + kill -9 $(lsof -i:$TESTRPC_PORT -t) + fi +} + +### Setup EVM + +# Ensure we compiled sources + +pnpm build + +# Gas reporter needs to run in its own evm instance +if [ "$RUN_EVM" = true ]; then + evm_kill + evm_start + sleep 5 +fi + +### Main + +mkdir -p reports + +# Run using the standalone evm instance +npx hardhat test --network hardhat + +### Cleanup + +# Exit error mode so the evm instance always gets killed +set +e +result=0 + +if [ "$RUN_EVM" = true ]; then + evm_kill +fi + +exit $result diff --git a/packages/data-edge/tasks/craft-calldata.ts b/packages/data-edge/tasks/craft-calldata.ts new file mode 100644 index 000000000..f8c596c72 --- /dev/null +++ b/packages/data-edge/tasks/craft-calldata.ts @@ -0,0 +1,48 @@ +import '@nomiclabs/hardhat-ethers' +import { Contract } from 'ethers' +import { task } from 'hardhat/config' + +const baseABI = [ + { + inputs: [ + { + internalType: 'bytes', + name: '_payload', + type: 'bytes', + }, + ], + name: '', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, +] + +const getContract = (contractAddress: string, abi, provider) => { + return new Contract(contractAddress, abi, provider) +} + +const getAbiForSelector = (selector: string) => { + return baseABI.map((item) => { + item.name = selector + return item + }) +} + +task('data:craft', 'Build calldata') + .addParam('edge', 'Address of the data edge contract') + .addParam('selector', 'Selector name') + .addParam('data', 'Call data to post') + .setAction(async (taskArgs, hre) => { + // parse input + const edgeAddress = taskArgs.edge + const calldata = taskArgs.data + const selector = taskArgs.selector + + // build data + const abi = getAbiForSelector(selector) + const contract = getContract(edgeAddress, abi, hre.ethers.provider) + const tx = await contract.populateTransaction[selector](calldata) + const txData = tx.data + console.log(txData) + }) diff --git a/packages/data-edge/tasks/deploy.ts b/packages/data-edge/tasks/deploy.ts new file mode 100644 index 000000000..028d6fa66 --- /dev/null +++ b/packages/data-edge/tasks/deploy.ts @@ -0,0 +1,53 @@ +import '@nomiclabs/hardhat-ethers' +import { task } from 'hardhat/config' + +import addresses from '../addresses.json' + +import { promises as fs } from 'fs' + +enum Contract { + DataEdge, + EventfulDataEdge +} + +enum DeployName { + EBODataEdge = 'EBO', + SAODataEdge = 'SAO', +} + +task('data-edge:deploy', 'Deploy a DataEdge contract') + .addParam('contract', 'Chose DataEdge or EventfulDataEdge') + .addParam('deployName', 'Chose EBO or SAO') + .setAction(async (taskArgs, hre) => { + if (!Object.values(Contract).includes(taskArgs.contract)) { + throw new Error(`Contract ${taskArgs.contract} not supported`) + } + + if (!Object.values(DeployName).includes(taskArgs.deployName)) { + throw new Error(`Deploy name ${taskArgs.deployName} not supported`) + } + + const factory = await hre.ethers.getContractFactory(taskArgs.contract) + + console.log(`Deploying contract...`) + const contract = await factory.deploy() + const tx = contract.deployTransaction + + // The address the Contract WILL have once mined + console.log(`> deployer: ${await contract.signer.getAddress()}`) + console.log(`> contract: ${contract.address}`) + console.log(`> tx: ${tx.hash} nonce:${tx.nonce} limit: ${tx.gasLimit.toString()} gas: ${tx.gasPrice.toNumber() / 1e9} (gwei)`) + + // The contract is NOT deployed yet; we must wait until it is mined + await contract.deployed() + console.log(`Done!`) + + // Update addresses.json + const chainId = (hre.network.config.chainId).toString() + if (!addresses[chainId]) { + addresses[chainId] = {} + } + let deployName = `${taskArgs.deployName}${taskArgs.contract}` + addresses[chainId][deployName] = contract.address + return fs.writeFile('addresses.json', JSON.stringify(addresses, null, 2)) + }) diff --git a/packages/data-edge/tasks/post-calldata.ts b/packages/data-edge/tasks/post-calldata.ts new file mode 100644 index 000000000..ee96351de --- /dev/null +++ b/packages/data-edge/tasks/post-calldata.ts @@ -0,0 +1,27 @@ +import '@nomiclabs/hardhat-ethers' +import { task } from 'hardhat/config' + +task('data:post', 'Post calldata') + .addParam('edge', 'Address of the data edge contract') + .addParam('data', 'Call data to post') + .setAction(async (taskArgs, hre) => { + // prepare data + const edgeAddress = taskArgs.edge + const txData = taskArgs.data + const contract = await hre.ethers.getContractAt('DataEdge', edgeAddress) + const txRequest = { + data: txData, + to: contract.address, + } + + // send transaction + console.log(`Sending data...`) + console.log(`> edge: ${contract.address}`) + console.log(`> sender: ${await contract.signer.getAddress()}`) + console.log(`> payload: ${txData}`) + const tx = await contract.signer.sendTransaction(txRequest) + console.log(`> tx: ${tx.hash} nonce:${tx.nonce} limit: ${tx.gasLimit.toString()} gas: ${tx.gasPrice.toNumber() / 1e9} (gwei)`) + const rx = await tx.wait() + console.log('> rx: ', rx.status == 1 ? 'success' : 'failed') + console.log(`Done!`) + }) diff --git a/packages/data-edge/test/dataedge.test.ts b/packages/data-edge/test/dataedge.test.ts new file mode 100644 index 000000000..345e3b4d8 --- /dev/null +++ b/packages/data-edge/test/dataedge.test.ts @@ -0,0 +1,59 @@ +import "@nomiclabs/hardhat-ethers"; +import { ethers } from "hardhat"; +import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; + +import { DataEdge, DataEdge__factory } from "../build/types"; +import { expect } from "chai"; + +const { getContractFactory, getSigners } = ethers; +const { id, hexConcat, randomBytes, hexlify, defaultAbiCoder } = ethers.utils; + +describe("DataEdge", () => { + let edge: DataEdge; + let me: SignerWithAddress; + + beforeEach(async () => { + [me] = await getSigners(); // eslint-disable-line @typescript-eslint/no-extra-semi + + const factory = (await getContractFactory( + "DataEdge", + me + )) as DataEdge__factory; + edge = await factory.deploy(); + await edge.deployed(); + }); + + describe("submit data", () => { + it("post any arbitrary data as selector", async () => { + // virtual function call + const txRequest = { + data: "0x123123", + to: edge.address, + }; + // send transaction + const tx = await me.sendTransaction(txRequest); + const rx = await tx.wait(); + // transaction must work - it just stores data + expect(rx.status).eq(1); + }); + + it("post long calldata", async () => { + // virtual function call + const selector = id("setEpochBlocksPayload(bytes)").slice(0, 10); + // calldata payload + const messageBlocks = hexlify(randomBytes(1000)); + const txCalldata = defaultAbiCoder.encode(["bytes"], [messageBlocks]); // we abi encode to allow the subgraph to decode it properly + const txData = hexConcat([selector, txCalldata]); + // craft full transaction + const txRequest = { + data: txData, + to: edge.address, + }; + // send transaction + const tx = await me.sendTransaction(txRequest); + const rx = await tx.wait(); + // transaction must work - it just stores data + expect(rx.status).eq(1); + }); + }); +}); diff --git a/packages/data-edge/test/eventful-dataedge.test.ts b/packages/data-edge/test/eventful-dataedge.test.ts new file mode 100644 index 000000000..d2a861aa5 --- /dev/null +++ b/packages/data-edge/test/eventful-dataedge.test.ts @@ -0,0 +1,65 @@ +import "@nomiclabs/hardhat-ethers"; +import { ethers } from "hardhat"; +import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; + +import { EventfulDataEdge, EventfulDataEdge__factory } from "../build/types"; +import { expect } from "chai"; + +const { getContractFactory, getSigners } = ethers; +const { id, hexConcat, randomBytes, hexlify, defaultAbiCoder } = ethers.utils; + +describe("EventfulDataEdge", () => { + let edge: EventfulDataEdge; + let me: SignerWithAddress; + + beforeEach(async () => { + [me] = await getSigners(); // eslint-disable-line @typescript-eslint/no-extra-semi + + const factory = (await getContractFactory( + "EventfulDataEdge", + me + )) as EventfulDataEdge__factory; + edge = await factory.deploy(); + await edge.deployed(); + }); + + describe("submit data", () => { + it("post any arbitrary data as selector", async () => { + // virtual function call + const txRequest = { + data: "0x123123", + to: edge.address, + }; + // send transaction + const tx = await me.sendTransaction(txRequest); + const rx = await tx.wait(); + // transaction must work - it just stores data + expect(rx.status).eq(1); + // emit log event + const event = edge.interface.parseLog(rx.logs[0]).args; + expect(event.data).eq(txRequest.data); + }); + + it("post long calldata", async () => { + // virtual function call + const selector = id("setEpochBlocksPayload(bytes)").slice(0, 10); + // calldata payload + const messageBlocks = hexlify(randomBytes(1000)); + const txCalldata = defaultAbiCoder.encode(["bytes"], [messageBlocks]); // we abi encode to allow the subgraph to decode it properly + const txData = hexConcat([selector, txCalldata]); + // craft full transaction + const txRequest = { + data: txData, + to: edge.address, + }; + // send transaction + const tx = await me.sendTransaction(txRequest); + const rx = await tx.wait(); + // transaction must work - it just stores data + expect(rx.status).eq(1); + // emit log event + const event = edge.interface.parseLog(rx.logs[0]).args; + expect(event.data).eq(txRequest.data); + }); + }); +}); diff --git a/packages/data-edge/tsconfig.json b/packages/data-edge/tsconfig.json new file mode 100644 index 000000000..10ade59cd --- /dev/null +++ b/packages/data-edge/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "lib": ["ES2020", "dom"], + "module": "commonjs", + "moduleResolution": "node", + "target": "ES2020", + "outDir": "dist", + "resolveJsonModule": true, + "esModuleInterop": true + }, + "exclude": ["dist", "node_modules"], + "include": [ + "./hardhat.config.ts", + "./scripts/**/*.ts", + "./test/**/*.ts", + "node_modules/@nomiclabs/hardhat-ethers/internal/type-extensions.d.ts", + "node_modules/@nomiclabs/hardhat-etherscan/dist/src/type-extensions.d.ts", + "node_modules/@nomiclabs/hardhat-waffle/dist/src/type-extensions.d.ts", + "node_modules/@typechain/hardhat/dist/type-extensions.d.ts", + "./index.d.ts", + "eslint.config.js", + ".solcover.js" + ] +} diff --git a/packages/eslint-graph-config/.gitignore b/packages/eslint-graph-config/.gitignore new file mode 100644 index 000000000..945ce43a9 --- /dev/null +++ b/packages/eslint-graph-config/.gitignore @@ -0,0 +1 @@ +index.js \ No newline at end of file diff --git a/packages/eslint-graph-config/README.md b/packages/eslint-graph-config/README.md new file mode 100644 index 000000000..61b3f2b73 --- /dev/null +++ b/packages/eslint-graph-config/README.md @@ -0,0 +1,76 @@ +# eslint-graph-config + +This repository contains shared linting and formatting rules for TypeScript projects. + +## Installation + +```bash +pnpm add --dev eslint@^8.56.0 eslint-graph-config +``` + +For projects on this monorepo, you can use the following command to install the package: + +```bash +pnpm add --dev eslint@^8.56.0 eslint-graph-config@workspace:^x.y.z +``` + +To enable the rules, you need to create an `eslint.config.js` file in the root of your project with the following content: + +```javascript +const config = require('eslint-graph-config') +module.exports = config.default + ``` + +**Recommended config for existing projects** +The default configuration is quite strict specially with the usage of `any` and it's derivatives. For existing projects with a codebase that was developed with more lenient guidelines migrating to this configuration can be a bit overwhelming. + +You can customize your `eslint.config.js` file to disable some rules and make the transition easier. For example, you can create a `eslint.config.js` file with the following content: + +```javascript +const config = require('eslint-graph-config') + +module.exports = [ + ...config.default, + { + rules: { + '@typescript-eslint/no-unsafe-assignment': 'off', + '@typescript-eslint/no-var-requires': 'off', + '@typescript-eslint/no-unsafe-call': 'off', + '@typescript-eslint/no-unsafe-member-access': 'off', + '@typescript-eslint/no-unsafe-argument': 'off', + }, + }, + { + ignores: [ + 'library/*', // ignore its contents + '!node_modules/mylibrary/' // unignore `node_modules/mylibrary` directory + ] + } +] +``` + +## Tooling + +This package uses the following tools: +- [ESLint](https://eslint.org/) as the base linting tool +- [typescript-eslint](https://typescript-eslint.io/) for TypeScript support +- [ESLint Stylistic](https://eslint.style/) as the formatting tool + +**Why no prettier?** +Instead of prettier we use ESLint Stylistic which is a set of ESLint rules focused on formatting and styling code. As opposed to prettier, ESLint Stylistic runs entirely within ESLint and does not require a separate tool to be run (e.g. `prettier`, `eslint-plugin-prettier` and `eslint-config-prettier`). Additionally it's supposed to be [more efficient](https://eslint.style/guide/why#linters-vs-formatters) and [less opinionated](https://antfu.me/posts/why-not-prettier). + +## VSCode support + +If you are using VSCode you can install the [ESLint extension](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) to get real-time linting and formatting support. + +The following settings should be added to your `settings.json` file: +```json +{ + "editor.defaultFormatter": "dbaeumer.vscode-eslint", + "eslint.format.enable": true, + "eslint.experimental.useFlatConfig": true, + "eslint.workingDirectories": [{ "pattern": "./packages/*/" }] +} +``` + +Additionally you can configure the `Format document` keyboard shortcut to run `eslint --fix` on demand. \ No newline at end of file diff --git a/packages/eslint-graph-config/eslint.config.js b/packages/eslint-graph-config/eslint.config.js new file mode 100644 index 000000000..b4d8d3631 --- /dev/null +++ b/packages/eslint-graph-config/eslint.config.js @@ -0,0 +1,12 @@ +// This file only exists to enable linting on index.js +const config = require('./index') + +module.exports = [ + ...config.default, + { + rules: { + '@typescript-eslint/no-unsafe-assignment': 'off', + '@typescript-eslint/no-var-requires': 'off', + }, + }, +] diff --git a/packages/eslint-graph-config/index.ts b/packages/eslint-graph-config/index.ts new file mode 100644 index 000000000..9c814527b --- /dev/null +++ b/packages/eslint-graph-config/index.ts @@ -0,0 +1,65 @@ +import eslint from '@eslint/js' +import globals from 'globals' +import noOnlyTests from 'eslint-plugin-no-only-tests' +import noSecrets from 'eslint-plugin-no-secrets' +import stylistic from '@stylistic/eslint-plugin' +import tseslint from 'typescript-eslint' + +export default [ + // Base eslint configuration + eslint.configs.recommended, + + // Enable linting with type information + // https://typescript-eslint.io/getting-started/typed-linting + ...tseslint.configs.recommendedTypeChecked, + + // Formatting and stylistic rules + stylistic.configs['recommended-flat'], + + // Custom config + { + languageOptions: { + parserOptions: { + project: ['../*/tsconfig.json', 'tsconfig.json'], + tsconfigRootDir: __dirname, + }, + globals: { + ...globals.node, + }, + }, + plugins: { + 'no-only-tests': noOnlyTests, + 'no-secrets': noSecrets, + }, + rules: { + 'prefer-const': 'warn', + '@typescript-eslint/no-redundant-type-constituents': 'warn', + '@typescript-eslint/no-inferrable-types': 'warn', + '@typescript-eslint/no-empty-function': 'warn', + 'no-only-tests/no-only-tests': 'error', + 'no-secrets/no-secrets': ['error', { tolerance: 5.1 }], + 'sort-imports': [ + 'warn', { + memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'], + ignoreCase: true, + allowSeparatedGroups: true, + }], + '@stylistic/brace-style': ['error', '1tbs'], + '@typescript-eslint/no-unused-vars': [ + 'error', + { + args: 'all', + argsIgnorePattern: '^_', + caughtErrors: 'all', + caughtErrorsIgnorePattern: '^_', + destructuredArrayIgnorePattern: '^_', + varsIgnorePattern: '^_', + ignoreRestSiblings: true, + }, + ], + }, + }, + { + ignores: ['**/dist/*', '**/node_modules/*', '**/build/*', '**/cache/*', '**/.graphclient/*'], + }, +] diff --git a/packages/eslint-graph-config/package.json b/packages/eslint-graph-config/package.json new file mode 100644 index 000000000..0cf1cd2f9 --- /dev/null +++ b/packages/eslint-graph-config/package.json @@ -0,0 +1,29 @@ +{ + "name": "eslint-graph-config", + "version": "0.0.1", + "description": "Linting and formatting rules for The Graph's TypeScript projects", + "main": "index.js", + "author": "The Graph Team", + "license": "GPL-2.0-or-later", + "scripts": { + "clean": "rm -rf index.js", + "lint": "eslint '**/*.{js,ts}' --ignore-pattern index.js --fix", + "build": "pnpm clean && tsc" + }, + "dependencies": { + "@stylistic/eslint-plugin": "^1.6.2", + "eslint": "^8.56.0", + "eslint-plugin-no-only-tests": "^3.1.0", + "eslint-plugin-no-secrets": "^0.8.9", + "typescript-eslint": "^7.0.2" + }, + "devDependencies": { + "@types/eslint__js": "^8.42.3", + "@types/node": "^20.11.19", + "globals": "^16.0.0", + "typescript": "^5.3.3" + }, + "peerDependencies": { + "eslint": "^8.56.0" + } +} diff --git a/packages/eslint-graph-config/tsconfig.json b/packages/eslint-graph-config/tsconfig.json new file mode 100644 index 000000000..015450292 --- /dev/null +++ b/packages/eslint-graph-config/tsconfig.json @@ -0,0 +1,12 @@ +{ + "compilerOptions": { + "target": "es2020", + "module": "commonjs", + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "strict": true, + "skipLibCheck": true, + "resolveJsonModule": true + }, + "include": ["index.ts", "typings/**/*.d.ts", "eslint.config.js"] +} diff --git a/packages/eslint-graph-config/typings/eslint-plugin-no-only-tests.d.ts b/packages/eslint-graph-config/typings/eslint-plugin-no-only-tests.d.ts new file mode 100644 index 000000000..1b3dbf7bd --- /dev/null +++ b/packages/eslint-graph-config/typings/eslint-plugin-no-only-tests.d.ts @@ -0,0 +1,5 @@ +declare module 'eslint-plugin-no-only-tests' { + import { FlatConfig } from 'typescript-eslint' + const plugin: FlatConfig.Plugin + export default plugin +} diff --git a/packages/eslint-graph-config/typings/eslint-plugin-no-secrets.d.ts b/packages/eslint-graph-config/typings/eslint-plugin-no-secrets.d.ts new file mode 100644 index 000000000..cde4120c2 --- /dev/null +++ b/packages/eslint-graph-config/typings/eslint-plugin-no-secrets.d.ts @@ -0,0 +1,5 @@ +declare module 'eslint-plugin-no-secrets' { + import { FlatConfig } from 'typescript-eslint' + const plugin: FlatConfig.Plugin + export default plugin +} diff --git a/packages/hardhat-graph-protocol/.mocharc.json b/packages/hardhat-graph-protocol/.mocharc.json new file mode 100644 index 000000000..de4e97026 --- /dev/null +++ b/packages/hardhat-graph-protocol/.mocharc.json @@ -0,0 +1,5 @@ +{ + "require": "ts-node/register/files", + "ignore": ["test/fixtures/**/*"], + "timeout": 6000 +} diff --git a/packages/hardhat-graph-protocol/CHANGELOG.md b/packages/hardhat-graph-protocol/CHANGELOG.md new file mode 100644 index 000000000..129f9383a --- /dev/null +++ b/packages/hardhat-graph-protocol/CHANGELOG.md @@ -0,0 +1,157 @@ +# hardhat-graph-protocol + +## 0.1.21 + +### Patch Changes + +- Updated dependencies + - @graphprotocol/toolshed@0.5.4 + +## 0.1.20 + +### Patch Changes + +- Updated dependencies + - @graphprotocol/toolshed@0.5.3 + +## 0.1.19 + +### Patch Changes + +- Updated dependencies + - @graphprotocol/toolshed@0.5.1 + +## 0.1.18 + +### Patch Changes + +- Fix target undefined bug + +## 0.1.17 + +### Patch Changes + +- Fix auto balance function + +## 0.1.16 + +### Patch Changes + +- Updated dependencies + - @graphprotocol/toolshed@0.5.0 + +## 0.1.15 + +### Patch Changes + +- Updated dependencies + - @graphprotocol/toolshed@0.4.2 + +## 0.1.14 + +### Patch Changes + +- Updated dependencies + - @graphprotocol/toolshed@0.4.1 + +## 0.1.13 + +### Patch Changes + +- Updated dependencies + - @graphprotocol/toolshed@0.4.0 + +## 0.1.12 + +### Patch Changes + +- Fix package exports +- Updated dependencies + - @graphprotocol/toolshed@0.3.2 + +## 0.1.11 + +### Patch Changes + +- chore: fix package visibility +- Updated dependencies + - @graphprotocol/toolshed@0.3.1 + +## 0.1.10 + +### Patch Changes + +- Updated dependencies + - @graphprotocol/toolshed@0.3.0 + +## 0.1.9 + +### Patch Changes + +- @graphprotocol/toolshed@0.2.6 + +## 0.1.8 + +### Patch Changes + +- Updated dependencies + - @graphprotocol/toolshed@0.2.5 + +## 0.1.7 + +### Patch Changes + +- @graphprotocol/toolshed@0.2.4 + +## 0.1.6 + +### Patch Changes + +- Updated dependencies + - @graphprotocol/toolshed@0.2.3 + +## 0.1.5 + +### Patch Changes + +- @graphprotocol/toolshed@0.2.2 + +## 0.1.4 + +### Patch Changes + +- Pin ethers version +- Updated dependencies + - @graphprotocol/toolshed@0.2.1 + +## 0.1.3 + +### Patch Changes + +- Updated dependencies + - @graphprotocol/toolshed@0.2.0 + +## 0.1.2 + +### Patch Changes + +- Updated dependencies [585cf27] + - @graphprotocol/toolshed@0.1.2 + +## 0.1.1 + +### Patch Changes + +- Updated dependencies + - @graphprotocol/toolshed@0.1.1 + +## 0.1.0 + +### Minor Changes + +- Publish initial dev versions + +### Patch Changes + +- Updated dependencies + - @graphprotocol/toolshed@0.1.0 diff --git a/packages/hardhat-graph-protocol/README.md b/packages/hardhat-graph-protocol/README.md new file mode 100644 index 000000000..3d210098b --- /dev/null +++ b/packages/hardhat-graph-protocol/README.md @@ -0,0 +1,231 @@ +# hardhat-graph-protocol + +A Hardhat plugin for integrating with The Graph Protocol, providing easy access to deployment addresses and configuration for Graph Protocol contracts. + +### Features + +- **Protocol deployments** - Provides a simple interface to interact with protocol contracts without having to configure contract addresses or ABIs. +- **Transaction logging** - Transactions made via the plugin are automatically awaited and logged. +- **Accounts** - Provides account management methods for convenience, following protocol conventions for account derivation +- **Secure accounts** - Integrates seamlessly with [hardhat-secure-accounts](https://www.npmjs.com/package/hardhat-secure-accounts) + +## Installation + +```bash +# Install as a dev dependency +pnpm add --dev hardhat-graph-protocol +``` + +## Configuration + +Add the plugin to your `hardhat.config.ts`: + +```ts +import "hardhat-graph-protocol"; +``` + +### Using @graphprotocol/toolshed +To use the plugin you'll need to configure the target networks. We recommend using our base hardhat configuration which can be imported from `@graphprotocol/toolshed`: + +```ts +import { hardhatBaseConfig, networksUserConfig } from '@graphprotocol/toolshed/hardhat' +import "hardhat-graph-protocol"; + +const config: HardhatUserConfig = { + ...networksUserConfig, + // rest of config +} + +export default config // or just "export default hardhatBaseConfig" +``` + +### Manual configuration +To manually configure target networks: + +**Hardhat: Network config** +```ts + networks: { + arbitrumOne: { + chainId: 42161, + url: `https://arbitrum-one.infura.io/v3/123456` + deployments: { + horizon: '/path/to/horizon/addresses.json, + subgraphService: 'path/to/subgraph-service/addresses.json' + } + }, + } +``` +**Hardhat: Graph config** + +Additionally, the plugin adds a new config field to hardhat's config file: `graph`. This can be used used to define defaults for all networks: + +```ts + ... + networks: { + ... + }, + graph: { + deployments: { + horizon: '/path/to/horizon/addresses.json, + subgraphService: 'path/to/subgraph-service/addresses.json' + }, + }, + ... +``` + +## Usage + +This plugin exposes functionality via a simple API: + +```ts +const graph = hre.graph() +``` + +The interface for the graph object can be found [here](src/types.ts), it's expanded version lookg like this: + +```ts +export type GraphRuntimeEnvironment = { + [deploymentName]: { + contracts: DeploymentContractsType, + addressBook: DeploymentAddressBookType, + actions: DeplyomentActionsType + }, + provider: HardhatEthersProvider + chainId: number + accounts: { + getAccounts: () => Promise + getDeployer: (accountIndex?: number) => Promise + getGovernor: (accountIndex?: number) => Promise + getArbitrator: (accountIndex?: number) => Promise + getPauseGuardian: (accountIndex?: number) => Promise + getSubgraphAvailabilityOracle: (accountIndex?: number) => Promise + getGateway: (accountIndex?: number) => Promise + getTestAccounts: () => Promise + } +} +``` + +### Deployments + +The plugin provides one object for each configured deployment, this object allows easily interacting with the associated deployment with a few additional features. The current deployments that are supported: `horizon` and `subgraphService`. + +Each deployment will be of the form: +```ts + [deploymentName]: { + contracts: DeploymentContractsType, + addressBook: DeploymentAddressBookType, + actions: DeplyomentActionsType + }, +``` +Where: +- `contracts`: an object with all the contracts available in the deployment, already instanced, fully typed and ready to go. +- `addressBook`: an object allowing read and write access to the deployment's address book. +- `actions`: (optional) an object with helper functions to perform common actions in the associated deployment. + +**Transaction logging** + +Any transactions made using the `contracts` object will be automatically logged both to the console and to a file: +- `file`, in the project's root directory: `tx-YYYY-MM-DD.log` +- `console`, not shown by default. Run with `DEBUG=toolshed:tx` to enable them. + +Note that this does not apply to getter functions (`view` or `pure`) as those are not state modifying calls. +An example log output: +``` +[2025-04-10T20:32:37.182Z] > Sending transaction: HorizonStaking.addToProvision +[2025-04-10T20:32:37.182Z] = Sender: 0xACa94ef8bD5ffEE41947b4585a84BdA5a3d3DA6E +[2025-04-10T20:32:37.182Z] = Contract: 0x865365C425f3A593Ffe698D9c4E6707D14d51e08 +[2025-04-10T20:32:37.182Z] = Params: [ 0xACa94ef8bD5ffEE41947b4585a84BdA5a3d3DA6E, 0x1afb3ce06A1b3Cfb065DA4821c6Fa33b8CfC3485, 100000000000000000000 ] +[2025-04-10T20:32:37.182Z] = TxHash: 0x0e76c384a80f9f0402eb74de40c0456ef808d7afb4de68d451f5ed95b4be5c8a +[2025-04-10T20:32:37.183Z] ✔ Transaction succeeded! +[2025-04-10T20:32:40.936Z] > Sending transaction: HorizonStaking.thaw +[2025-04-10T20:32:40.936Z] = Sender: 0xACa94ef8bD5ffEE41947b4585a84BdA5a3d3DA6E +[2025-04-10T20:32:40.936Z] = Contract: 0x865365C425f3A593Ffe698D9c4E6707D14d51e08 +[2025-04-10T20:32:40.936Z] = Params: [ 0xACa94ef8bD5ffEE41947b4585a84BdA5a3d3DA6E, 0x1afb3ce06A1b3Cfb065DA4821c6Fa33b8CfC3485, 100000000000000000000 ] +[2025-04-10T20:32:40.936Z] = TxHash: 0x5422a1e975688952e13a455498c4f652a090d619bec414662775fc9d8cbd0af6 +[2025-04-10T20:32:40.946Z] ✔ Transaction succeeded! +``` + +__Note__ Transaction logging requires using js Proxy which strips down some type definitions from contract methods. This means that when transaction logging is enabled `contract.functionName.estimateGas` for example will not be available. + +**Transaction auto-awaiting** + +Any transactions made using the `contracts` object will be automatically awaited: + +```ts +const graph = hre.graph() + +// The transaction is automatically awaited, no need to await tx.wait() it +const tx = await graph.horizon.contracts.GraphToken.approve('0xDEADBEEF', 100) + +// But you can still do it if you need more confirmations for example +await tx.wait(10) +``` + +**Examples** +```js +const graph = hre.graph() +const { GraphPayments, HorizonStaking, GraphToken } = graph.horizon.contracts +const { provision } = graph.horizon.actions + +// Print GraphPayment's protocol cut +await GraphPayments.PROTOCOL_PAYMENT_CUT() +10000n + +// Provision some GRT to a data service +await GraphToken.connect(signer).approve(HorizonStaking.target, 100_000_000) +await HorizonStaking.connect(signer).stake(100_000_000) +await HorizonStaking.connect(signer).provision(signer.address, dataService.address, 100_000_000, 10_000, 42_690) + +// Do the same but using actions - in this case the `provision` helper also approves and stakes +await provision(signer, [signer.address, dataService.address, 100_000_000, 10_000, 42_690]) + +// Read the address book +const entry = graph.horizon.addressBook.getEntry('HorizonStaking') +console.log(entry.address) // HorizonStaking proxy address +console.log(entry.implementation) // HorizonStaking implementation address +``` + +### Accounts + +The plugin provides helper functions to derive signers from the configured accounts in hardhat config: +```ts + hardhat: { + chainId: 31337, + accounts: { + mnemonic: 'myth like bonus scare over problem client lizard pioneer submit female collect', + }, + ... + }, +``` + +| Function | Description | Default account derivation index | +|----------|-------------|-------------| +| `getAccounts()` | Returns all the accounts listed below | - | +| `getDeployer()` | Returns the deployer signer | 0 | +| `getGovernor()` | Returns the governor signer | 1 | +| `getArbitrator()` | Returns the arbitrator signer | 2 | +| `getPauseGuardian()` | Returns the pause guardian signer | 3 | +| `getSubgraphAvailabilityOracle()` | Returns a service provider signer | 4 | +| `getGateway()` | Returns the gateway signer | 5 | +| `getTestAccounts()` | Returns the test signers | 6-20 | + +Note that these are just helper functions to enforce a convention on which index to use for each account. These might not match what is configured in the target protocol deployment. + +For any of the accounts listed above these are equivalents: + +```ts +const graph = hre.graph() + +// These two should match +const governor = await graph.accounts.getGovernor() // By default governor uses derivation index 1 +const governorFromEthers = (await hre.ethers.getSigners())[1] +``` + +## Development: TypeScript support + +When using the plugin from within this monorepo, TypeScript may fail to properly apply the type extension typings. To work around this issue: + +1. Create a file at `types/hardhat-graph-protocol.d.ts` +2. Copy the contents from the `type-extensions.ts` file in this repository into the new file + +This will ensure proper TypeScript type support for the plugin. diff --git a/packages/hardhat-graph-protocol/eslint.config.js b/packages/hardhat-graph-protocol/eslint.config.js new file mode 100644 index 000000000..ed2d51271 --- /dev/null +++ b/packages/hardhat-graph-protocol/eslint.config.js @@ -0,0 +1,14 @@ +const config = require('eslint-graph-config') + +module.exports = [ + ...config.default, + { + rules: { + '@typescript-eslint/no-unsafe-assignment': 'off', + '@typescript-eslint/no-var-requires': 'off', + '@typescript-eslint/no-unsafe-call': 'off', + '@typescript-eslint/no-unsafe-member-access': 'off', + '@typescript-eslint/no-unsafe-argument': 'off', + }, + }, +] diff --git a/packages/hardhat-graph-protocol/package.json b/packages/hardhat-graph-protocol/package.json new file mode 100644 index 000000000..dbc7f2870 --- /dev/null +++ b/packages/hardhat-graph-protocol/package.json @@ -0,0 +1,65 @@ +{ + "name": "hardhat-graph-protocol", + "version": "0.1.21", + "publishConfig": { + "access": "public" + }, + "description": "A hardhat plugin that extends the runtime environment to inject additional functionality related to the usage of the Graph Protocol.", + "keywords": [ + "ethereum", + "smart-contracts", + "hardhat", + "hardhat-plugin", + "graph", + "graph-protocol", + "horizon" + ], + "author": "Tomás Migone ", + "license": "MIT", + "main": "./dist/src/index.js", + "types": "./dist/src/index.d.ts", + "exports": { + ".": { + "types": "./src/types.ts", + "default": "./dist/src/index.js" + } + }, + "scripts": { + "build": "tsc", + "clean": "rm -rf dist", + "lint": "eslint '**/*.{js,ts}' --fix", + "test": "mocha --exit --recursive 'test/**/*.test.ts'", + "prepublishOnly": "npm run build" + }, + "files": [ + "dist/", + "src/", + "LICENSE", + "README.md" + ], + "dependencies": { + "@graphprotocol/toolshed": "workspace:^", + "@nomicfoundation/hardhat-ethers": "3.0.8", + "debug": "^4.3.7", + "json5": "^2.2.3" + }, + "devDependencies": { + "@nomicfoundation/hardhat-verify": "^2.0.12", + "@types/chai": "^4.0.0", + "@types/debug": "^4.1.12", + "@types/mocha": "^10.0.9", + "chai": "^4.0.0", + "eslint": "^8.56.0", + "eslint-graph-config": "workspace:^0.0.1", + "ethers": "6.13.7", + "hardhat": "^2.22.16", + "hardhat-secure-accounts": "^1.0.4", + "mocha": "^10.8.2", + "ts-node": "^8.0.0", + "typescript": "^5.6.3" + }, + "peerDependencies": { + "ethers": "6.13.7", + "hardhat": "^2.22.16" + } +} \ No newline at end of file diff --git a/packages/hardhat-graph-protocol/src/accounts.ts b/packages/hardhat-graph-protocol/src/accounts.ts new file mode 100644 index 000000000..079a69645 --- /dev/null +++ b/packages/hardhat-graph-protocol/src/accounts.ts @@ -0,0 +1,84 @@ +import { + getAccounts as getAccountsToolshed, + getArbitrator, + getDeployer, + getGateway, getGovernor, getPauseGuardian, getSubgraphAvailabilityOracle, getTestAccounts, + TEN_MILLION, +} from '@graphprotocol/toolshed' +import { setGRTBalance } from '@graphprotocol/toolshed/hardhat' + +import type { Addressable } from 'ethers' +import type { HardhatEthersProvider } from '@nomicfoundation/hardhat-ethers/internal/hardhat-ethers-provider' +import type { HardhatEthersSigner } from '@nomicfoundation/hardhat-ethers/signers' + +type Accounts = { + getAccounts: () => ReturnType + getDeployer: (accountIndex?: number) => ReturnType + getGovernor: (accountIndex?: number) => ReturnType + getArbitrator: (accountIndex?: number) => ReturnType + getPauseGuardian: (accountIndex?: number) => ReturnType + getSubgraphAvailabilityOracle: (accountIndex?: number) => ReturnType + getGateway: (accountIndex?: number) => ReturnType + getTestAccounts: () => ReturnType +} + +export function getAccounts(provider: HardhatEthersProvider, chainId: number, grtTokenAddress: string | Addressable | undefined): Accounts { + return { + getAccounts: async () => { + const accounts = await getAccountsToolshed(provider) + for (const account of Object.values(accounts)) { + if (typeof account === 'object' && 'address' in account) { + await setBalanceIfLocal(provider, chainId, grtTokenAddress, account) + } else if (Array.isArray(account)) { + for (const testAccount of account) { + await setBalanceIfLocal(provider, chainId, grtTokenAddress, testAccount) + } + } + } + return accounts + }, + getDeployer: async (accountIndex?: number) => { + const account = await getDeployer(provider, accountIndex) + await setBalanceIfLocal(provider, chainId, grtTokenAddress, account) + return account + }, + getGovernor: async (accountIndex?: number) => { + const account = await getGovernor(provider, accountIndex) + await setBalanceIfLocal(provider, chainId, grtTokenAddress, account) + return account + }, + getArbitrator: async (accountIndex?: number) => { + const account = await getArbitrator(provider, accountIndex) + await setBalanceIfLocal(provider, chainId, grtTokenAddress, account) + return account + }, + getPauseGuardian: async (accountIndex?: number) => { + const account = await getPauseGuardian(provider, accountIndex) + await setBalanceIfLocal(provider, chainId, grtTokenAddress, account) + return account + }, + getSubgraphAvailabilityOracle: async (accountIndex?: number) => { + const account = await getSubgraphAvailabilityOracle(provider, accountIndex) + await setBalanceIfLocal(provider, chainId, grtTokenAddress, account) + return account + }, + getGateway: async (accountIndex?: number) => { + const account = await getGateway(provider, accountIndex) + await setBalanceIfLocal(provider, chainId, grtTokenAddress, account) + return account + }, + getTestAccounts: async () => { + const accounts = await getTestAccounts(provider) + for (const account of accounts) { + await setBalanceIfLocal(provider, chainId, grtTokenAddress, account) + } + return accounts + }, + } +} + +async function setBalanceIfLocal(provider: HardhatEthersProvider, chainId: number, grtTokenAddress: string | Addressable | undefined, account: HardhatEthersSigner) { + if (grtTokenAddress && [1337, 31337].includes(chainId)) { + await setGRTBalance(provider, grtTokenAddress, account.address, TEN_MILLION) + } +} diff --git a/packages/hardhat-graph-protocol/src/config.ts b/packages/hardhat-graph-protocol/src/config.ts new file mode 100644 index 000000000..f8d72183d --- /dev/null +++ b/packages/hardhat-graph-protocol/src/config.ts @@ -0,0 +1,58 @@ +import fs from 'fs' +import path from 'path' + +import { logDebug, logError } from './logger' +import { GraphPluginError } from './error' + +import type { GraphDeploymentName } from '@graphprotocol/toolshed/deployments' +import type { GraphRuntimeEnvironmentOptions } from './types' +import type { HardhatRuntimeEnvironment } from 'hardhat/types' + +export function getAddressBookPath( + deployment: GraphDeploymentName, + hre: HardhatRuntimeEnvironment, + opts: GraphRuntimeEnvironmentOptions, +): string | undefined { + const optsPath = getPath(opts.deployments?.[deployment]) + const networkPath = getPath(hre.network.config.deployments?.[deployment]) + const globalPath = getPath(hre.config.graph?.deployments?.[deployment]) + + logDebug(`Getting address book path...`) + logDebug(`Graph base dir: ${hre.config.paths.graph}`) + logDebug(`1) opts: ${optsPath}`) + logDebug(`2) network: ${networkPath}`) + logDebug(`3) global: ${globalPath}`) + + const addressBookPath = optsPath ?? networkPath ?? globalPath + if (addressBookPath === undefined) { + throw new GraphPluginError('Must set a an addressBook path!') + } + + const normalizedAddressBookPath = normalizePath(addressBookPath, hre.config.paths.graph) + logDebug(`Address book path: ${normalizedAddressBookPath}`) + + if (!fs.existsSync(normalizedAddressBookPath)) { + logError(`Address book path does not exist: ${normalizedAddressBookPath}`) + return undefined + } + + return normalizedAddressBookPath +} + +function normalizePath(_path: string, graphPath?: string): string { + if (!path.isAbsolute(_path) && graphPath !== undefined) { + _path = path.join(graphPath, _path) + } + return _path +} + +function getPath(value: string | { + addressBook: string +} | undefined): string | undefined { + if (typeof value === 'string') { + return value + } else if (value && typeof value == 'object') { + return value.addressBook + } + return +} diff --git a/packages/hardhat-graph-protocol/src/error.ts b/packages/hardhat-graph-protocol/src/error.ts new file mode 100644 index 000000000..1979c0ab2 --- /dev/null +++ b/packages/hardhat-graph-protocol/src/error.ts @@ -0,0 +1,9 @@ +import { HardhatPluginError } from 'hardhat/plugins' +import { logError } from './logger' + +export class GraphPluginError extends HardhatPluginError { + constructor(message: string) { + super('GraphRuntimeEnvironment', message) + logError(message) + } +} diff --git a/packages/hardhat-graph-protocol/src/gre.ts b/packages/hardhat-graph-protocol/src/gre.ts new file mode 100644 index 000000000..71ebebc1f --- /dev/null +++ b/packages/hardhat-graph-protocol/src/gre.ts @@ -0,0 +1,97 @@ +/* eslint-disable no-case-declarations */ +import path from 'path' + +import { loadGraphHorizon, loadSubgraphService } from '@graphprotocol/toolshed/deployments' +import { logDebug, logError } from './logger' +import { getAccounts } from './accounts' +import { getAddressBookPath } from './config' +import { GraphPluginError } from './error' +import { HardhatEthersProvider } from '@nomicfoundation/hardhat-ethers/internal/hardhat-ethers-provider' +import { isGraphDeployment } from './types' +import { lazyFunction } from 'hardhat/plugins' + +import type { HardhatConfig, HardhatRuntimeEnvironment, HardhatUserConfig } from 'hardhat/types' +import type { GraphDeployments } from '@graphprotocol/toolshed/deployments' +import type { GraphRuntimeEnvironmentOptions } from './types' + +export const greExtendConfig = (config: HardhatConfig, userConfig: Readonly) => { + const userPath = userConfig.paths?.graph + + let newPath: string + if (userPath === undefined) { + newPath = config.paths.root + } else { + if (path.isAbsolute(userPath)) { + newPath = userPath + } else { + newPath = path.normalize(path.join(config.paths.root, userPath)) + } + } + + config.paths.graph = newPath +} + +export const greExtendEnvironment = (hre: HardhatRuntimeEnvironment) => { + hre.graph = lazyFunction(() => (opts: GraphRuntimeEnvironmentOptions = { deployments: {} }) => { + logDebug('*** Initializing Graph Runtime Environment (GRE) ***') + logDebug(`Main network: ${hre.network.name}`) + const chainId = hre.network.config.chainId + if (chainId === undefined) { + throw new GraphPluginError('Please define chainId in your Hardhat network configuration') + } + logDebug(`Chain Id: ${chainId}`) + + const deployments = [...new Set([ + ...Object.keys(opts.deployments ?? {}), + ...Object.keys(hre.network.config.deployments ?? {}), + ...Object.keys(hre.config.graph?.deployments ?? {}), + ].filter(v => isGraphDeployment(v)))] + logDebug(`Detected deployments: ${deployments.join(', ')}`) + + // Build the Graph Runtime Environment (GRE) for each deployment + const provider = new HardhatEthersProvider(hre.network.provider, hre.network.name) + const greDeployments = {} as GraphDeployments + + for (const deployment of deployments) { + logDebug(`== Initializing deployment: ${deployment} ==`) + + const addressBookPath = getAddressBookPath(deployment, hre, opts) + if (addressBookPath === undefined) { + logError(`Skipping deployment ${deployment} - Reason: address book path does not exist`) + continue + } + + try { + switch (deployment) { + case 'horizon': + greDeployments.horizon = loadGraphHorizon(addressBookPath, chainId, provider) + break + case 'subgraphService': + greDeployments.subgraphService = loadSubgraphService(addressBookPath, chainId, provider) + break + default: + // eslint-disable-next-line @typescript-eslint/restrict-template-expressions + logError(`Skipping deployment ${deployment} - Reason: unknown deployment`) + break + } + } catch (error) { + logError(`Skipping deployment ${deployment} - Reason: runtime error`) + logError(error) + continue + } + } + + // Accounts + // We use ? here because we've previously asserted that the deployment exists which might not be true + const accounts = getAccounts(provider, chainId, greDeployments.horizon?.contracts?.GraphToken?.target) + + logDebug('GRE initialized successfully!') + + return { + ...greDeployments, + provider, + chainId, + accounts, + } + }) +} diff --git a/packages/hardhat-graph-protocol/src/index.ts b/packages/hardhat-graph-protocol/src/index.ts new file mode 100644 index 000000000..f4284811c --- /dev/null +++ b/packages/hardhat-graph-protocol/src/index.ts @@ -0,0 +1,10 @@ +import { extendConfig, extendEnvironment } from 'hardhat/config' +import { greExtendConfig, greExtendEnvironment } from './gre' + +// This import is needed to let the TypeScript compiler know that it should include your type +// extensions in your npm package's types file. +import './type-extensions' + +// ** Graph Runtime Environment (GRE) extensions for the HRE ** +extendConfig(greExtendConfig) +extendEnvironment(greExtendEnvironment) diff --git a/packages/hardhat-graph-protocol/src/logger.ts b/packages/hardhat-graph-protocol/src/logger.ts new file mode 100644 index 000000000..3529373f6 --- /dev/null +++ b/packages/hardhat-graph-protocol/src/logger.ts @@ -0,0 +1,7 @@ +import debug from 'debug' + +const LOG_BASE = 'hardhat:graph' + +export const logDebug = debug(`${LOG_BASE}:debug`) +export const logWarn = debug(`${LOG_BASE}:warn`) +export const logError = debug(`${LOG_BASE}:error`) diff --git a/packages/hardhat-graph-protocol/src/type-extensions.ts b/packages/hardhat-graph-protocol/src/type-extensions.ts new file mode 100644 index 000000000..ef11ad994 --- /dev/null +++ b/packages/hardhat-graph-protocol/src/type-extensions.ts @@ -0,0 +1,45 @@ +// To extend one of Hardhat's types, you need to import the module where it has been defined, and redeclare it. +import 'hardhat/types/config' +import 'hardhat/types/runtime' + +import type { GraphDeploymentOptions, GraphRuntimeEnvironment, GraphRuntimeEnvironmentOptions } from './types' + +declare module 'hardhat/types/runtime' { + interface HardhatRuntimeEnvironment { + graph: (opts?: GraphRuntimeEnvironmentOptions) => GraphRuntimeEnvironment + } +} + +declare module 'hardhat/types/config' { + interface HardhatConfig { + graph: GraphRuntimeEnvironmentOptions + } + + interface HardhatUserConfig { + graph: GraphRuntimeEnvironmentOptions + } + + interface HardhatNetworkConfig { + deployments?: GraphDeploymentOptions + } + + interface HardhatNetworkUserConfig { + deployments?: GraphDeploymentOptions + } + + interface HttpNetworkConfig { + deployments?: GraphDeploymentOptions + } + + interface HttpNetworkUserConfig { + deployments?: GraphDeploymentOptions + } + + interface ProjectPathsConfig { + graph?: string + } + + interface ProjectPathsUserConfig { + graph?: string + } +} diff --git a/packages/hardhat-graph-protocol/src/types.ts b/packages/hardhat-graph-protocol/src/types.ts new file mode 100644 index 000000000..d37e4f465 --- /dev/null +++ b/packages/hardhat-graph-protocol/src/types.ts @@ -0,0 +1,32 @@ +import { GraphDeploymentsList } from '@graphprotocol/toolshed/deployments' + +import type { GraphDeploymentName, GraphDeployments } from '@graphprotocol/toolshed/deployments' +import type { GraphAccounts } from '@graphprotocol/toolshed' +import type { HardhatEthersProvider } from '@nomicfoundation/hardhat-ethers/internal/hardhat-ethers-provider' +import type { HardhatEthersSigner } from '@nomicfoundation/hardhat-ethers/signers' +export type GraphDeploymentOptions = { + [deployment in GraphDeploymentName]?: string +} + +export type GraphRuntimeEnvironmentOptions = { + deployments?: GraphDeploymentOptions +} + +export type GraphRuntimeEnvironment = GraphDeployments & { + provider: HardhatEthersProvider + chainId: number + accounts: { + getAccounts: () => Promise + getDeployer: (accountIndex?: number) => Promise + getGovernor: (accountIndex?: number) => Promise + getArbitrator: (accountIndex?: number) => Promise + getPauseGuardian: (accountIndex?: number) => Promise + getSubgraphAvailabilityOracle: (accountIndex?: number) => Promise + getGateway: (accountIndex?: number) => Promise + getTestAccounts: () => Promise + } +} + +export function isGraphDeployment(deployment: unknown): deployment is GraphDeploymentName { + return typeof deployment === 'string' && GraphDeploymentsList.includes(deployment as GraphDeploymentName) +} diff --git a/packages/hardhat-graph-protocol/test/config.test.ts b/packages/hardhat-graph-protocol/test/config.test.ts new file mode 100644 index 000000000..55121be14 --- /dev/null +++ b/packages/hardhat-graph-protocol/test/config.test.ts @@ -0,0 +1,73 @@ +import path from 'path' + +import { expect } from 'chai' +import { getAddressBookPath } from '../src/config' +import { loadHardhatContext } from './helpers' + +describe('GRE init functions', function () { + // No address book - should throw + describe('getAddressBookPath', function () { + it('should throw if no address book is specified', function () { + this.hre = loadHardhatContext('default-config', 'mainnet') + expect(() => getAddressBookPath('horizon', this.hre, {})).to.throw('Must set a an addressBook path!') + }) + + it('should throw if address book doesn\'t exist', function () { + this.hre = loadHardhatContext('invalid-address-book', 'mainnet') + expect(() => getAddressBookPath('horizon', this.hre, {})).to.throw(/Address book not found: /) + }) + + // Address book via opts should be used + it('should use opts parameter if available', function () { + this.hre = loadHardhatContext('network-address-book', 'mainnet') + const addressBook = getAddressBookPath('horizon', this.hre, { + deployments: { + horizon: 'addresses-opt.json', + }, + }) + expect(path.basename(addressBook!)).to.equal('addresses-opt.json') + }) + + it('should use opts parameter if available - shortcut syntax', function () { + this.hre = loadHardhatContext('network-address-book', 'mainnet') + const addressBook = getAddressBookPath('horizon', this.hre, { + deployments: { + horizon: 'addresses-opt.json', + }, + }) + expect(path.basename(addressBook!)).to.equal('addresses-opt.json') + }) + + // Address book via network config should be used + it('should use HH network config', function () { + this.hre = loadHardhatContext('network-address-book', 'mainnet') + const addressBook = getAddressBookPath('horizon', this.hre, {}) + expect(path.basename(addressBook!)).to.equal('addresses-network.json') + }) + + it('should use HH network config - shortcut syntax', function () { + this.hre = loadHardhatContext('network-address-book', 'mainnet') + if (this.hre.network.config.deployments) { + this.hre.network.config.deployments.horizon = 'addresses-network-short.json' + } + const addressBook = getAddressBookPath('horizon', this.hre, {}) + expect(path.basename(addressBook!)).to.equal('addresses-network-short.json') + }) + + // Address book via global config should be used + it('should use HH global config', function () { + this.hre = loadHardhatContext('global-address-book', 'mainnet') + const addressBook = getAddressBookPath('horizon', this.hre, {}) + expect(path.basename(addressBook!)).to.equal('addresses-global.json') + }) + + it('should use HH global config - shortcut syntax', function () { + this.hre = loadHardhatContext('global-address-book', 'mainnet') + if (this.hre.config.graph.deployments) { + this.hre.config.graph.deployments.horizon = 'addresses-global-short.json' + } + const addressBook = getAddressBookPath('horizon', this.hre, {}) + expect(path.basename(addressBook!)).to.equal('addresses-global-short.json') + }) + }) +}) diff --git a/packages/hardhat-graph-protocol/test/fixtures/default-config/hardhat.config.ts b/packages/hardhat-graph-protocol/test/fixtures/default-config/hardhat.config.ts new file mode 100644 index 000000000..17de4a585 --- /dev/null +++ b/packages/hardhat-graph-protocol/test/fixtures/default-config/hardhat.config.ts @@ -0,0 +1,8 @@ +module.exports = { + networks: { + mainnet: { + chainId: 1, + url: `https://mainnet.infura.io/v3/123456`, + }, + }, +} diff --git a/packages/hardhat-graph-protocol/test/fixtures/files/addresses-arbsep.json b/packages/hardhat-graph-protocol/test/fixtures/files/addresses-arbsep.json new file mode 100644 index 000000000..15dc74b27 --- /dev/null +++ b/packages/hardhat-graph-protocol/test/fixtures/files/addresses-arbsep.json @@ -0,0 +1,226 @@ +{ + "421614": { + "HorizonStaking": { + "address": "0xFf2Ee30de92F276018642A59Fb7Be95b3F9088Af" + }, + "GraphPayments": { + "address": "0xf5B3661BbB8CD48571C7f41ba2D896a3589C9753" + }, + "PaymentsEscrow": { + "address": "0x09B985a2042848A08bA59060EaF0f07c6F5D4d54" + }, + "GraphTallyCollector": { + "address": "0xacC71844EF6beEF70106ABe6E51013189A1f3738" + }, + "GraphProxyAdmin": { + "address": "0x7474a6cc5fAeDEc620Db0fa8E4da6eD58477042C", + "creationCodeHash": "0x68b304ac6bce7380d5e0f6b14a122f628bffebcc75f8205cb60f0baf578b79c3", + "runtimeCodeHash": "0x8d9ba87a745cf82ab407ebabe6c1490197084d320efb6c246d94bcc80e804417", + "txHash": "0x71b6defab0d3d7b711b7f6769f20a8c85bc9686eb5939b2a86dfaf587fceab17" + }, + "Controller": { + "address": "0x9DB3ee191681f092607035d9BDA6e59FbEaCa695", + "creationCodeHash": "0x5bde9a87bc4e8dd24d41900f0a19321c1dc6d3373d51bba093b130bb5b80a677", + "runtimeCodeHash": "0x7f0479db1d60ecf6295d92ea2359ebdd223640795613558b0594680f5d4922c9", + "txHash": "0xf7b4faa14f9d29bb62dec73fd163d1253184233012bcadf7ae78af7995017f29" + }, + "EpochManager": { + "address": "0x88b3C7f37253bAA1A9b95feAd69bD5320585826D", + "initArgs": ["0x9DB3ee191681f092607035d9BDA6e59FbEaCa695", "554"], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0x587ea6f421a08ab3a390103f63daba0529901f2e662ca7f6fe575674a439fa79", + "proxy": true, + "implementation": { + "address": "0x646627fa39ec6f6E757Cb4189bC54c92FFBb71da", + "creationCodeHash": "0x9947bd0a1f46027123b8fb4aec8b11af540aea587eb79642475d57b4e347078f", + "runtimeCodeHash": "0xe45a27197726de0e3149014823794708edd432ee56ec8358554c0d2365674ca0", + "txHash": "0x82653a0bd83e0541379b920415af94e4be1d732dfab720e5dead839062781c07" + } + }, + "L2GraphToken": { + "address": "0xf8c05dCF59E8B28BFD5eed176C562bEbcfc7Ac04", + "initArgs": ["0xadE6B8EB69a49B56929C1d4F4b428d791861dB6f"], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0xbb27939a4e4b5d92da8a10add4b7d0126e907da30b07b5f3d439f1c32a6c8e2c", + "proxy": true, + "implementation": { + "address": "0x4cf968bA38b43dd10be114daa7959C1b369479e5", + "creationCodeHash": "0x6c4146427aafa7375a569154be95c8c931bf83aab0315706dd78bdf79c889e4c", + "runtimeCodeHash": "0x004371d1d80011906953dcba17c648503fc94b94e1e0365c8d8c706ff91f93e9", + "txHash": "0x3fab5697addf0c0e16b8e2249f2b833c6f256e699b293d184089c96de8deaa44" + } + }, + "GraphCurationToken": { + "address": "0x00FBd5D46FFAc54862c1Dd27BE08924BB17f5CDa", + "creationCodeHash": "0x1ee42ee271cefe20c33c0de904501e618ac4b56debca67c634d0564cecea9ff2", + "runtimeCodeHash": "0x340e8f378c0117b300f3ec255bc5c3a273f9ab5bd2940fa8eb3b5065b21f86dc", + "txHash": "0x045d64dc3ebb7ae6c4976854ce0a797a04524d22a6ef5f526bfc27f744bc68e5" + }, + "ServiceRegistry": { + "address": "0x888541878CbDDEd880Cd58c728f1Af5C47343F86", + "initArgs": ["0x9DB3ee191681f092607035d9BDA6e59FbEaCa695"], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0xdaa1228e8cd8569c1e5562b63d2fd89caf897ab67da05922636d3309b838e289", + "proxy": true, + "implementation": { + "address": "0x05E732280bf9F37054346Cb83f5Fd58C5B44F6A8", + "creationCodeHash": "0xec9cb879003a06609541ad87efd4bc5dfc8ea60e4e77cfa5ae2cb5208742e7bc", + "runtimeCodeHash": "0x5161b534164413a88d851832f9c9d1dd1bca32fe2bbb62bb35d112c1dc8b69ab", + "txHash": "0xe1fce867f5dd708e60518b7f257fdbcb28f460d1e3b82045b82d03e64345b210" + } + }, + "L2Curation": { + "address": "0xDe761f075200E75485F4358978FB4d1dC8644FD5", + "initArgs": [ + "0x9DB3ee191681f092607035d9BDA6e59FbEaCa695", + "0x00FBd5D46FFAc54862c1Dd27BE08924BB17f5CDa", + "10000", + "1" + ], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0xe9298239bcb3c386cf66e6dd493cf6e7cdd9771c65fa2225e0b34d17550d6805", + "proxy": true, + "implementation": { + "address": "0xd90022aB67920212D0F902F5c427DE82732DE136", + "creationCodeHash": "0x2287d9023bf7d91e688e1eb029eff7657ef3b87e37b5222b01fd50985d0928f9", + "runtimeCodeHash": "0xd799b2b74e9634d6b6ef15b5710409264bed04a60f9519b9d8f05ac183199d16", + "txHash": "0x436bcf91fed712dc8d54f449726b2078fb63cd770f90b492a9622efac5817762" + } + }, + "SubgraphNFTDescriptor": { + "address": "0x4032F7B6b27FfC9862106f826379DaB1716C71d7", + "creationCodeHash": "0xf16e8ff11d852eea165195ac9e0dfa00f98e48f6ce3c77c469c7df9bf195b651", + "runtimeCodeHash": "0x39583196f2bcb85789b6e64692d8c0aa56f001c46f0ca3d371abbba2c695860f", + "txHash": "0xb7e7aeeecc693f34f491b01c56950533119810a4e3e2642081efc127f11cb782" + }, + "SubgraphNFT": { + "address": "0xF21Df5BbA7EB9b54D8F60C560aFb9bA63e6aED1A", + "constructorArgs": ["0xadE6B8EB69a49B56929C1d4F4b428d791861dB6f"], + "creationCodeHash": "0xc1e58864302084de282dffe54c160e20dd96c6cfff45e00e6ebfc15e04136982", + "runtimeCodeHash": "0x7216e736a8a8754e88688fbf5c0c7e9caf35c55ecc3a0c5a597b951c56cf7458", + "txHash": "0x1309c1caea76f4014ba612de092cc746816119b1440d635d11b6bc7e361a32b0" + }, + "L2GNS": { + "address": "0x3133948342F35b8699d8F94aeE064AbB76eDe965", + "initArgs": [ + "0x9DB3ee191681f092607035d9BDA6e59FbEaCa695", + "0xF21Df5BbA7EB9b54D8F60C560aFb9bA63e6aED1A" + ], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0x137140783a99a3e9a60048d607124626ca87e2b972e8cc05efb41ac87c3cbcc4", + "proxy": true, + "implementation": { + "address": "0x00CBF5024d454255577Bf2b0fB6A43328a6828c9", + "creationCodeHash": "0xd71f45e6c194920a26f90fcec96d8c3375f02c5aef8ad90c1be24e906ffe8342", + "runtimeCodeHash": "0x68ec24512fedb866d7ba7ba6c02160317d0ca34eaacd23bddcc62d2cbcd9869c", + "txHash": "0x54619944731edec530b7b0cd587f9c2faae332aa1671fe5e8d7e7e5c7e291a77" + } + }, + "StakingExtension": { + "address": "0x05709dd705A5674346B7206a2bC657C8bAb3301B", + "creationCodeHash": "0x7ae74140871330ecabb7040182dc8288c2c84693393a519230036f39c2281138", + "runtimeCodeHash": "0x4994aa74e9e29c36a8158af690a245ccd1cf4d955223e5fcb1ca62810b37ed57", + "txHash": "0xbe1ff9cb949a53209b778708265740dfa2a08a93cfce4c897a53989a5d93f8c1" + }, + "L2Staking": { + "address": "0x865365C425f3A593Ffe698D9c4E6707D14d51e08", + "initArgs": [ + "0x9DB3ee191681f092607035d9BDA6e59FbEaCa695", + "100000000000000000000000", + "6646", + "10000", + "100000", + "8", + "12", + "16", + "100,100,60,100", + "0x876fB4B13D7Ed146757D3664B7E962b36936001C" + ], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0x326cf1f2849da4bb4d7e39f2783779e3c99fa48e4ee8ef004cfdd50c62e775df", + "proxy": true, + "implementation": { + "address": "0xD07dFD514dc1b57020e6C1F49e05c48d0658C99f", + "creationCodeHash": "0x6a763345e5f166ea4e73ce9a116a49c9fc0833d9ea235a86fa5a997e91cf09e5", + "runtimeCodeHash": "0xb4c31859ac132241f04c802d4add70a94c7f2c6eb9dfd4bf224048d249dbc7bc", + "txHash": "0x68b34eda64287b84582c8f005c4e96162252d36c9c5c9b84332336a7c2e3d6d3", + "libraries": { + "LibExponential": "0xd844116f6d79a280b117Bb6d9EBf4121D4e8B44b" + } + } + }, + "RewardsManager": { + "address": "0x1F49caE7669086c8ba53CC35d1E9f80176d67E79", + "initArgs": ["0x9DB3ee191681f092607035d9BDA6e59FbEaCa695"], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0xd8765fb87e11e8d41951f9071188b888829022a889cf66fdc2357f1f9f15c8e2", + "proxy": true, + "implementation": { + "address": "0x714B54e5249C90414fecA240e2F5B618C243F0aE", + "creationCodeHash": "0x59c1680da2d19124daaf95fd66acc5eae68e6f46dfe2ff0b3ccb777daf9949b2", + "runtimeCodeHash": "0xe33080183ec49ab1ec8d78b80b90158f0f3ac6f2deedf6115a32a9d11d3e4d9b", + "txHash": "0x8192f6c0e63a9beede3b025878af6a49367564c8bc32cb11a64f5f1e8351c7cd" + } + }, + "DisputeManager": { + "address": "0x7C9B82717f9433932507dF6EdA93A9678b258698", + "initArgs": [ + "0x9DB3ee191681f092607035d9BDA6e59FbEaCa695", + "0xF89688d5d44d73cc4dE880857A3940487076e5A4", + "10000000000000000000000", + "500000", + "25000", + "25000" + ], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0xb3764f4b576b46ee8dc6cbf680cad650b3ba80aa93dc6cf099862cfe8efc8a68", + "proxy": true, + "implementation": { + "address": "0x887aC2f58D62Ac86d4E9aEc07c953991e3ca1bA3", + "creationCodeHash": "0xce4c47d94a33d69e03d607dd13a9ad1ed7fa730ef4a2308eb56ddd646ebaa0aa", + "runtimeCodeHash": "0x18d4a1659ccecede3d4d305ef1db4653d8f3dcbd4012f4e52200ae9f0c6c322c", + "txHash": "0x59d99afb9cefbb5c2275d9ac2d7230ac7f4a4cfb2440636408988a66075c032a" + } + }, + "AllocationExchange": { + "address": "0x9BD4FBDa981D628AbA16F261f810dD59E5bAf9eA", + "constructorArgs": [ + "0xf8c05dCF59E8B28BFD5eed176C562bEbcfc7Ac04", + "0x865365C425f3A593Ffe698D9c4E6707D14d51e08", + "0x72ee30d43Fb5A90B3FE983156C5d2fBE6F6d07B3", + "0x49D4CFC037430cA9355B422bAeA7E9391e1d3215" + ], + "creationCodeHash": "0x2963baeedb2d0f5a95fa41f6c89e48e5bf177ca439379fc6becd54870d330ab0", + "runtimeCodeHash": "0xd8b53b3f65b49198d35392e0fd11da229a40d15a96151bca2976cbbe36b909d5", + "txHash": "0xa1a9410662d43463c39802e887f33a1401ed0fc35bf22c5be275e62141eae442" + }, + "L2GraphTokenGateway": { + "address": "0xB24Ce0f8c18c4DdDa584A7EeC132F49C966813bb", + "initArgs": ["0x9DB3ee191681f092607035d9BDA6e59FbEaCa695"], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0x90949db305a73b85e7208aa6b8d03c5181945eedc3df38e90f215a0dec8b02ae", + "proxy": true, + "implementation": { + "address": "0x3C2eB5E561f70c0573E5f6c92358e988E32cb5eC", + "creationCodeHash": "0x90253be19d23d542b29e95e6faf52304fcff91b21edfdb5f79e165051740d1ab", + "runtimeCodeHash": "0x3a7fab6792b4dad58c7b59da19c5b65b3985d1be77024a9f86cb135965e9b462", + "txHash": "0x78ff2e39d5c33ddfb89b1dbee89bdbc24452843a051f860c94e4e9dd75ded9c3" + } + }, + "EthereumDIDRegistry": { + "address": "0xF5f4cA61481558709AFa94AdEDa7B5F180f4AD59", + "creationCodeHash": "0x20cd202f7991716a84c097da5fbd365fd27f7f35f241f82c529ad7aba18b814b", + "runtimeCodeHash": "0x5f396ffd54b6cd6b3faded0f366c5d7e148cc54743926061be2dfd12a75391de", + "txHash": "0x2cefbc169b8ae51c263d0298956d86a397b05f11f076b71c918551f63fe33784" + } + } +} diff --git a/packages/hardhat-graph-protocol/test/fixtures/files/addresses-global-short.json b/packages/hardhat-graph-protocol/test/fixtures/files/addresses-global-short.json new file mode 100644 index 000000000..e69de29bb diff --git a/packages/hardhat-graph-protocol/test/fixtures/files/addresses-global.json b/packages/hardhat-graph-protocol/test/fixtures/files/addresses-global.json new file mode 100644 index 000000000..e69de29bb diff --git a/packages/hardhat-graph-protocol/test/fixtures/files/addresses-hre.json b/packages/hardhat-graph-protocol/test/fixtures/files/addresses-hre.json new file mode 100644 index 000000000..e69de29bb diff --git a/packages/hardhat-graph-protocol/test/fixtures/files/addresses-network-short.json b/packages/hardhat-graph-protocol/test/fixtures/files/addresses-network-short.json new file mode 100644 index 000000000..e69de29bb diff --git a/packages/hardhat-graph-protocol/test/fixtures/files/addresses-network.json b/packages/hardhat-graph-protocol/test/fixtures/files/addresses-network.json new file mode 100644 index 000000000..e69de29bb diff --git a/packages/hardhat-graph-protocol/test/fixtures/files/addresses-opt.json b/packages/hardhat-graph-protocol/test/fixtures/files/addresses-opt.json new file mode 100644 index 000000000..e69de29bb diff --git a/packages/hardhat-graph-protocol/test/fixtures/global-address-book/hardhat.config.ts b/packages/hardhat-graph-protocol/test/fixtures/global-address-book/hardhat.config.ts new file mode 100644 index 000000000..7008f9b7e --- /dev/null +++ b/packages/hardhat-graph-protocol/test/fixtures/global-address-book/hardhat.config.ts @@ -0,0 +1,50 @@ +import '../../../src/index' + +import type { HardhatUserConfig } from 'hardhat/config' + +const config: HardhatUserConfig = { + paths: { + graph: '../files', + }, + solidity: '0.8.9', + defaultNetwork: 'hardhat', + networks: { + 'hardhat': { + chainId: 1337, + accounts: { + mnemonic: 'pumpkin orient can short never warm truth legend cereal tourist craft skin', + }, + }, + 'mainnet': { + chainId: 1, + url: `https://mainnet.infura.io/v3/123456`, + }, + 'arbitrum-one': { + chainId: 42161, + url: 'https://arb1.arbitrum.io/rpc', + }, + 'goerli': { + chainId: 5, + url: `https://goerli.infura.io/v3/123456`, + }, + 'arbitrum-goerli': { + chainId: 421613, + url: 'https://goerli-rollup.arbitrum.io/rpc', + }, + 'localhost': { + chainId: 1337, + url: 'http://127.0.0.1:8545', + }, + 'arbitrum-rinkeby': { + chainId: 421611, + url: 'http://127.0.0.1:8545', + }, + }, + graph: { + deployments: { + horizon: 'addresses-global.json', + }, + }, +} + +export default config diff --git a/packages/hardhat-graph-protocol/test/fixtures/invalid-address-book/hardhat.config.ts b/packages/hardhat-graph-protocol/test/fixtures/invalid-address-book/hardhat.config.ts new file mode 100644 index 000000000..684594076 --- /dev/null +++ b/packages/hardhat-graph-protocol/test/fixtures/invalid-address-book/hardhat.config.ts @@ -0,0 +1,50 @@ +import '../../../src/index' + +import type { HardhatUserConfig } from 'hardhat/config' + +const config: HardhatUserConfig = { + paths: { + graph: '../files', + }, + solidity: '0.8.9', + defaultNetwork: 'hardhat', + networks: { + 'hardhat': { + chainId: 1337, + accounts: { + mnemonic: 'pumpkin orient can short never warm truth legend cereal tourist craft skin', + }, + }, + 'mainnet': { + chainId: 1, + url: `https://mainnet.infura.io/v3/123456`, + }, + 'arbitrum-one': { + chainId: 42161, + url: 'https://arb1.arbitrum.io/rpc', + }, + 'goerli': { + chainId: 5, + url: `https://goerli.infura.io/v3/123456`, + }, + 'arbitrum-goerli': { + chainId: 421613, + url: 'https://goerli-rollup.arbitrum.io/rpc', + }, + 'localhost': { + chainId: 1337, + url: 'http://127.0.0.1:8545', + }, + 'arbitrum-rinkeby': { + chainId: 421611, + url: 'http://127.0.0.1:8545', + }, + }, + graph: { + deployments: { + horizon: 'addresses-invalid.json', + }, + }, +} + +export default config diff --git a/packages/hardhat-graph-protocol/test/fixtures/network-address-book/hardhat.config.ts b/packages/hardhat-graph-protocol/test/fixtures/network-address-book/hardhat.config.ts new file mode 100644 index 000000000..b85036e2b --- /dev/null +++ b/packages/hardhat-graph-protocol/test/fixtures/network-address-book/hardhat.config.ts @@ -0,0 +1,53 @@ +import '../../../src/index' + +import type { HardhatUserConfig } from 'hardhat/config' + +const config: HardhatUserConfig = { + paths: { + graph: '../files', + }, + solidity: '0.8.9', + defaultNetwork: 'hardhat', + networks: { + 'hardhat': { + chainId: 1337, + accounts: { + mnemonic: 'pumpkin orient can short never warm truth legend cereal tourist craft skin', + }, + }, + 'mainnet': { + chainId: 1, + url: `https://mainnet.infura.io/v3/123456`, + deployments: { + horizon: 'addresses-network.json', + }, + }, + 'arbitrum-one': { + chainId: 42161, + url: 'https://arb1.arbitrum.io/rpc', + }, + 'goerli': { + chainId: 5, + url: `https://goerli.infura.io/v3/123456`, + }, + 'arbitrum-goerli': { + chainId: 421613, + url: 'https://goerli-rollup.arbitrum.io/rpc', + }, + 'localhost': { + chainId: 1337, + url: 'http://127.0.0.1:8545', + }, + 'arbitrum-rinkeby': { + chainId: 421611, + url: 'http://127.0.0.1:8545', + }, + }, + graph: { + deployments: { + horizon: 'addresses-global.json', + }, + }, +} + +export default config diff --git a/packages/hardhat-graph-protocol/test/fixtures/no-path-config/addresses.json b/packages/hardhat-graph-protocol/test/fixtures/no-path-config/addresses.json new file mode 100644 index 000000000..e69de29bb diff --git a/packages/hardhat-graph-protocol/test/fixtures/no-path-config/hardhat.config.ts b/packages/hardhat-graph-protocol/test/fixtures/no-path-config/hardhat.config.ts new file mode 100644 index 000000000..00595ec1b --- /dev/null +++ b/packages/hardhat-graph-protocol/test/fixtures/no-path-config/hardhat.config.ts @@ -0,0 +1,47 @@ +import '../../../src/index' + +import type { HardhatUserConfig } from 'hardhat/config' + +const config: HardhatUserConfig = { + solidity: '0.8.9', + defaultNetwork: 'hardhat', + networks: { + 'hardhat': { + chainId: 1337, + accounts: { + mnemonic: 'pumpkin orient can short never warm truth legend cereal tourist craft skin', + }, + }, + 'mainnet': { + chainId: 1, + url: `https://mainnet.infura.io/v3/123456`, + }, + 'arbitrum-one': { + chainId: 42161, + url: 'https://arb1.arbitrum.io/rpc', + }, + 'goerli': { + chainId: 5, + url: `https://goerli.infura.io/v3/123456`, + }, + 'arbitrum-goerli': { + chainId: 421613, + url: 'https://goerli-rollup.arbitrum.io/rpc', + }, + 'localhost': { + chainId: 1337, + url: 'http://127.0.0.1:8545', + }, + 'arbitrum-rinkeby': { + chainId: 421611, + url: 'http://127.0.0.1:8545', + }, + }, + graph: { + deployments: { + horizon: 'addresses-hre.json', + }, + }, +} + +export default config diff --git a/packages/hardhat-graph-protocol/test/fixtures/path-config/hardhat.config.ts b/packages/hardhat-graph-protocol/test/fixtures/path-config/hardhat.config.ts new file mode 100644 index 000000000..d7b36bb2f --- /dev/null +++ b/packages/hardhat-graph-protocol/test/fixtures/path-config/hardhat.config.ts @@ -0,0 +1,57 @@ +import '../../../src/index' + +import type { HardhatUserConfig } from 'hardhat/config' + +const config: HardhatUserConfig = { + paths: { + graph: '../files', + }, + solidity: '0.8.9', + defaultNetwork: 'hardhat', + networks: { + 'hardhat': { + chainId: 1337, + accounts: { + mnemonic: 'pumpkin orient can short never warm truth legend cereal tourist craft skin', + }, + }, + 'mainnet': { + chainId: 1, + url: `https://mainnet.infura.io/v3/123456`, + }, + 'arbitrum-one': { + chainId: 42161, + url: 'https://arb1.arbitrum.io/rpc', + }, + 'goerli': { + chainId: 5, + url: `https://goerli.infura.io/v3/123456`, + }, + 'arbitrum-goerli': { + chainId: 421613, + url: 'https://goerli-rollup.arbitrum.io/rpc', + }, + 'arbitrumSepolia': { + chainId: 421614, + url: 'https://goerli-rollup.arbitrum.io/rpc', + deployments: { + horizon: 'addresses-arbsep.json', + }, + }, + 'localhost': { + chainId: 1337, + url: 'http://127.0.0.1:8545', + }, + 'arbitrum-rinkeby': { + chainId: 421611, + url: 'http://127.0.0.1:8545', + }, + }, + graph: { + deployments: { + horizon: 'addresses-hre.json', + }, + }, +} + +export default config diff --git a/packages/hardhat-graph-protocol/test/gre.test.ts b/packages/hardhat-graph-protocol/test/gre.test.ts new file mode 100644 index 000000000..d70868ae7 --- /dev/null +++ b/packages/hardhat-graph-protocol/test/gre.test.ts @@ -0,0 +1,53 @@ +import path from 'path' + +import { assert, expect } from 'chai' +import { loadHardhatContext, useHardhatProject } from './helpers' +import { GraphHorizonAddressBook } from '@graphprotocol/toolshed/deployments' + +describe('GRE usage', function () { + describe('Project not using GRE', function () { + useHardhatProject('default-config', 'mainnet') + + it('should throw when accessing hre.graph()', function () { + expect(() => this.hre.graph()).to.throw() + }) + }) + + describe(`Project using GRE - graph path`, function () { + it('should add the graph path to the config', function () { + this.hre = loadHardhatContext('no-path-config', 'mainnet') + assert.equal( + this.hre.config.paths.graph, + path.join(__dirname, 'fixtures/no-path-config'), + ) + }) + + it('should add the graph path to the config from custom path', function () { + this.hre = loadHardhatContext('path-config', 'mainnet') + assert.equal( + this.hre.config.paths.graph, + path.join(__dirname, 'fixtures/files'), + ) + }) + }) + + describe(`Project using GRE - deployments`, function () { + useHardhatProject('path-config', 'arbitrumSepolia') + + it('should load Horizon deployment', function () { + const graph = this.hre.graph() + assert.isDefined(graph.horizon) + assert.isObject(graph.horizon) + + assert.isDefined(graph.horizon.contracts) + assert.isObject(graph.horizon.contracts) + + assert.isDefined(graph.horizon.addressBook) + assert.isObject(graph.horizon.addressBook) + assert.instanceOf( + graph.horizon.addressBook, + GraphHorizonAddressBook, + ) + }) + }) +}) diff --git a/packages/hardhat-graph-protocol/test/helpers.ts b/packages/hardhat-graph-protocol/test/helpers.ts new file mode 100644 index 000000000..1c7050e05 --- /dev/null +++ b/packages/hardhat-graph-protocol/test/helpers.ts @@ -0,0 +1,38 @@ +import path from 'path' + +import { resetHardhatContext as _resetHardhatContext } from 'hardhat/plugins-testing' +import type { HardhatRuntimeEnvironment } from 'hardhat/types' + +declare module 'mocha' { + interface Context { + hre: HardhatRuntimeEnvironment + } +} + +export function useHardhatProject(fixtureProjectName: string, network?: string): void { + beforeEach('Loading hardhat environment', function () { + this.hre = loadHardhatContext(fixtureProjectName, network) + }) + + afterEach('Resetting hardhat', function () { + resetHardhatContext() + }) +} + +export function loadHardhatContext(fixtureProjectName: string, network?: string): HardhatRuntimeEnvironment { + resetHardhatContext() + delete process.env.HARDHAT_NETWORK + + process.chdir(path.join(__dirname, 'fixtures', fixtureProjectName)) + + if (network !== undefined) { + process.env.HARDHAT_NETWORK = network + } + // eslint-disable-next-line @typescript-eslint/no-unsafe-return + return require('hardhat') +} + +export function resetHardhatContext(): void { + _resetHardhatContext() + delete process.env.HARDHAT_NETWORK +} diff --git a/packages/hardhat-graph-protocol/tsconfig.json b/packages/hardhat-graph-protocol/tsconfig.json new file mode 100644 index 000000000..e5a013f47 --- /dev/null +++ b/packages/hardhat-graph-protocol/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "target": "es2020", + "module": "node16", + "declaration": true, + "declarationMap": true, + "sourceMap": true, + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "strict": true, + "skipLibCheck": true, + "resolveJsonModule": true, + "outDir": "dist", + }, + "include": ["eslint.config.js", "src/**/*.ts", "test/**/*.ts"], +} diff --git a/packages/horizon/.solhintignore b/packages/horizon/.solhintignore new file mode 100644 index 000000000..a0367e1af --- /dev/null +++ b/packages/horizon/.solhintignore @@ -0,0 +1 @@ +contracts/mocks/* \ No newline at end of file diff --git a/packages/horizon/CHANGELOG.md b/packages/horizon/CHANGELOG.md new file mode 100644 index 000000000..9a9dd0db8 --- /dev/null +++ b/packages/horizon/CHANGELOG.md @@ -0,0 +1,49 @@ +# @graphprotocol/horizon + +## 0.3.3 + +### Patch Changes + +- Add GNS to deployments + +## 0.3.2 + +### Patch Changes + +- chore: fix package visibility + +## 0.3.1 + +### Patch Changes + +- Use proper types for Curation contract, add epochLength to EpochManager import in Horizon. + +## 0.3.0 + +### Minor Changes + +- Publish types for contracts packages + +## 0.2.1 + +### Patch Changes + +- Pin ethers version + +## 0.2.0 + +### Minor Changes + +- Publish scratch testnet 2 address book + +## 0.1.1 + +### Patch Changes + +- Publish fork 1 deployment + +## 0.1.0 + +### Minor Changes + +- Publish initial dev versions diff --git a/packages/horizon/README.md b/packages/horizon/README.md new file mode 100644 index 000000000..7ec0a8536 --- /dev/null +++ b/packages/horizon/README.md @@ -0,0 +1,70 @@ +# 🌅 Graph Horizon 🌅 + +Graph Horizon is the next evolution of the Graph Protocol. + +## Configuration + +The following environment variables might be required: + +| Variable | Description | +|----------|-------------| +| `ARBISCAN_API_KEY` | Arbiscan API key - for contract verification| +| `ARBITRUM_ONE_RPC` | Arbitrum One RPC URL - defaults to `https://arb1.arbitrum.io/rpc` | +| `ARBITRUM_SEPOLIA_RPC` | Arbitrum Sepolia RPC URL - defaults to `https://sepolia-rollup.arbitrum.io/rpc` | +| `LOCALHOST_RPC` | Localhost RPC URL - defaults to `http://localhost:8545` | + +You can set them using Hardhat: + +```bash +npx hardhat vars set +``` + +## Build + +```bash +pnpm install +pnpm build +``` + +## Deployment + +Note that this instructions will help you deploy Graph Horizon contracts, but no data service will be deployed. If you want to deploy the Subgraph Service please refer to the [Subgraph Service README](../subgraph-service/README.md) for deploy instructions. + +### New deployment +To deploy Graph Horizon from scratch run the following command: + +```bash +npx hardhat deploy:protocol --network hardhat +``` + +### Upgrade deployment +Usually you would run this against a network (or a fork) where the original Graph Protocol was previously deployed. To upgrade an existing deployment of the original Graph Protocol to Graph Horizon, run the following commands. Note that some steps might need to be run by different accounts (deployer vs governor): + +```bash +npx hardhat deploy:migrate --network hardhat --step 1 +npx hardhat deploy:migrate --network hardhat --step 2 # Run with governor. Optionally add --patch-config +npx hardhat deploy:migrate --network hardhat --step 3 # Optionally add --patch-config +npx hardhat deploy:migrate --network hardhat --step 4 # Run with governor. Optionally add --patch-config +``` + +Steps 2, 3 and 4 require patching the configuration file with addresses from previous steps. The files are located in the `ignition/configs` directory and need to be manually edited. You can also pass `--patch-config` flag to the deploy command to automatically patch the configuration reading values from the address book. Note that this will NOT update the configuration file. + +## Testing +- **unit**: Unit tests can be run with `pnpm test` +- **integration**: Integration tests can be run with `pnpm test:integration` + - Need to set `BLOCKCHAIN_RPC` for a chain where The Graph is already deployed + - If no `BLOCKCHAIN_RPC` is detected it will try using `ARBITRUM_SEPOLIA_RPC` +- **deployment**: Deployment tests can be run with `pnpm test:deployment --network `, the following environment variables allow customizing the test suite for different scenarios: + - `TEST_DEPLOYMENT_STEP` (default: 1) - Specify the latest deployment step that has been executed. Tests for later steps will be skipped. + - `TEST_DEPLOYMENT_TYPE` (default: migrate) - The deployment type `protocol/migrate` that is being tested. Test suite has been developed for `migrate` use case but can be run against a `protocol` deployment, likely with some failed tests. + - `TEST_DEPLOYMENT_CONFIG` (default: `hre.network.name`) - The Ignition config file name to use for the test suite. + +## Verification + +To verify contracts on a network, run the following commands: + +```bash +./scripts/pre-verify +npx hardhat ignition verify --network --include-unrelated-contracts +./scripts/post-verify +``` \ No newline at end of file diff --git a/packages/horizon/addresses-integration-tests.json b/packages/horizon/addresses-integration-tests.json new file mode 100644 index 000000000..b8229613d --- /dev/null +++ b/packages/horizon/addresses-integration-tests.json @@ -0,0 +1,40 @@ +{ + "421614": { + "Controller": { + "address": "0x9DB3ee191681f092607035d9BDA6e59FbEaCa695" + }, + "EpochManager": { + "address": "0x88b3C7f37253bAA1A9b95feAd69bD5320585826D", + "proxy": "graph", + "implementation": "0x646627fa39ec6f6E757Cb4189bC54c92FFBb71da" + }, + "L2Curation": { + "address": "0xDe761f075200E75485F4358978FB4d1dC8644FD5", + "proxy": "graph", + "implementation": "0xdf27da4db64bf29a8f2a710a0b448474151ff925" + }, + "RewardsManager": { + "address": "0x1F49caE7669086c8ba53CC35d1E9f80176d67E79", + "proxy": "graph", + "implementation": "0x714B54e5249C90414fecA240e2F5B618C243F0aE" + }, + "L2GraphTokenGateway": { + "address": "0xB24Ce0f8c18c4DdDa584A7EeC132F49C966813bb", + "proxy": "graph", + "implementation": "0x3C2eB5E561f70c0573E5f6c92358e988E32cb5eC" + }, + "L2GraphToken": { + "address": "0xf8c05dCF59E8B28BFD5eed176C562bEbcfc7Ac04", + "proxy": "graph", + "implementation": "0x4cf968bA38b43dd10be114daa7959C1b369479e5" + }, + "GraphProxyAdmin": { + "address": "0x7474a6cc5fAeDEc620Db0fa8E4da6eD58477042C" + }, + "HorizonStaking": { + "address": "0x865365C425f3A593Ffe698D9c4E6707D14d51e08", + "proxy": "graph", + "implementation": "0x64Ed77b164d3B22339DA4DB6d56a1C1d8A051c0A" + } + } +} \ No newline at end of file diff --git a/packages/horizon/addresses.json b/packages/horizon/addresses.json new file mode 100644 index 000000000..48d1cbd29 --- /dev/null +++ b/packages/horizon/addresses.json @@ -0,0 +1,55 @@ +{ + "421614": { + "Controller": { + "address": "0x0750EdA3185C758247E97819074bCD217a815FaE" + }, + "EpochManager": { + "address": "0xAA1DeBfb7A7c0Ba85cef858B6E70cFad943Fd4A2", + "proxy": "graph", + "implementation": "0x450906A976dc21450A7CcD1989D26E137E605B91" + }, + "L2Curation": { + "address": "0xe135BFD9E51BbAfCeBb0141af85F0bc6DA1b3BA4", + "proxy": "graph", + "implementation": "0x9CCD9B656f8A558879974ef2505496eEd7Ef7210" + }, + "RewardsManager": { + "address": "0x1AB05a65fa6D5F6a90A23693D5d40A4D927a815f", + "proxy": "graph", + "implementation": "0x05Ca4d407ec53Ac17ce6Bb414f42663f415Dc5C3" + }, + "L2GraphTokenGateway": { + "address": "0x7284213d1cDa80C892a4388f38dA431F06343144", + "proxy": "graph", + "implementation": "0x4dEA2d1Be05909B71F539FD32601F7bd736c28D4" + }, + "L2GraphToken": { + "address": "0xBBcb9a575176039C06F94d4d8337818318A26828", + "proxy": "graph", + "implementation": "0x71927f8Ff0ce294882e2A161A54F62f3b0f3c726" + }, + "GraphProxyAdmin": { + "address": "0x1CEBe1C314Cc454baf4bd553409d957C833623c0" + }, + "HorizonStaking": { + "address": "0xF5D432192dAF7e8B045349693577ccF0B5165A12", + "proxy": "graph", + "implementation": "0xa9B5CD0E94eBDf5A6dBB16A01635D432AB707244" + }, + "GraphPayments": { + "proxy": "transparent", + "proxyAdmin": "0xAcA3dd622e863E425Cdb15E8734a5CB318448db7", + "address": "0xAFd60629034fBdC3ef58518B817bBDB4EC861c93", + "implementation": "0x4756cdF556A78BD28399E833Bc5bBFc7a5bca866" + }, + "PaymentsEscrow": { + "proxy": "transparent", + "proxyAdmin": "0xbB643167f03EfF532c537e3d72E56b9992CaD985", + "address": "0x70d5AFAAaEF8f2F095E83D6E6151146c18A5Bb85", + "implementation": "0xeED33B904efF05BbdcC9008F5174088DF77dD183" + }, + "GraphTallyCollector": { + "address": "0xB63bC33D13F73eFD14d32D2b9FC0B6116B6611CE" + } + } +} \ No newline at end of file diff --git a/packages/horizon/audits/2024-06-OZ-horizon.pdf b/packages/horizon/audits/2024-06-OZ-horizon.pdf new file mode 100644 index 000000000..5f1084413 Binary files /dev/null and b/packages/horizon/audits/2024-06-OZ-horizon.pdf differ diff --git a/packages/horizon/audits/2024-11-Trust-horizon.pdf b/packages/horizon/audits/2024-11-Trust-horizon.pdf new file mode 100644 index 000000000..79533a431 Binary files /dev/null and b/packages/horizon/audits/2024-11-Trust-horizon.pdf differ diff --git a/packages/horizon/audits/2025-03-OZ-pre audit assessment.pdf b/packages/horizon/audits/2025-03-OZ-pre audit assessment.pdf new file mode 100644 index 000000000..b394d92bd Binary files /dev/null and b/packages/horizon/audits/2025-03-OZ-pre audit assessment.pdf differ diff --git a/packages/horizon/audits/2025-05-OZ-The Graph Horizon Audit.pdf b/packages/horizon/audits/2025-05-OZ-The Graph Horizon Audit.pdf new file mode 100644 index 000000000..8104f746d Binary files /dev/null and b/packages/horizon/audits/2025-05-OZ-The Graph Horizon Audit.pdf differ diff --git a/packages/horizon/contracts/data-service/DataService.sol b/packages/horizon/contracts/data-service/DataService.sol new file mode 100644 index 000000000..fc72e54ab --- /dev/null +++ b/packages/horizon/contracts/data-service/DataService.sol @@ -0,0 +1,72 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +pragma solidity 0.8.27; + +import { IDataService } from "./interfaces/IDataService.sol"; + +import { DataServiceV1Storage } from "./DataServiceStorage.sol"; +import { GraphDirectory } from "../utilities/GraphDirectory.sol"; +import { ProvisionManager } from "./utilities/ProvisionManager.sol"; + +/** + * @title DataService contract + * @dev Implementation of the {IDataService} interface. + * @notice This implementation provides base functionality for a data service: + * - GraphDirectory, allows the data service to interact with Graph Horizon contracts + * - ProvisionManager, provides functionality to manage provisions + * + * The derived contract MUST implement all the interfaces described in {IDataService} and in + * accordance with the Data Service framework. + * @dev A note on upgradeability: this base contract can be inherited by upgradeable or non upgradeable + * contracts. + * - If the data service implementation is upgradeable, it must initialize the contract via an external + * initializer function with the `initializer` modifier that calls {__DataService_init} or + * {__DataService_init_unchained}. It's recommended the implementation constructor to also call + * {_disableInitializers} to prevent the implementation from being initialized. + * - If the data service implementation is NOT upgradeable, it must initialize the contract by calling + * {__DataService_init} or {__DataService_init_unchained} in the constructor. Note that the `initializer` + * will be required in the constructor. + * - Note that in both cases if using {__DataService_init_unchained} variant the corresponding parent + * initializers must be called in the implementation. + * @custom:security-contact Please email security+contracts@thegraph.com if you find any + * bugs. We may have an active bug bounty program. + */ +abstract contract DataService is GraphDirectory, ProvisionManager, DataServiceV1Storage, IDataService { + /** + * @dev Addresses in GraphDirectory are immutables, they can only be set in this constructor. + * @param controller The address of the Graph Horizon controller contract. + */ + constructor(address controller) GraphDirectory(controller) {} + + /// @inheritdoc IDataService + function getThawingPeriodRange() external view returns (uint64, uint64) { + return _getThawingPeriodRange(); + } + + /// @inheritdoc IDataService + function getVerifierCutRange() external view returns (uint32, uint32) { + return _getVerifierCutRange(); + } + + /// @inheritdoc IDataService + function getProvisionTokensRange() external view returns (uint256, uint256) { + return _getProvisionTokensRange(); + } + + /// @inheritdoc IDataService + function getDelegationRatio() external view returns (uint32) { + return _getDelegationRatio(); + } + + /** + * @notice Initializes the contract and any parent contracts. + */ + function __DataService_init() internal onlyInitializing { + __ProvisionManager_init_unchained(); + __DataService_init_unchained(); + } + + /** + * @notice Initializes the contract. + */ + function __DataService_init_unchained() internal onlyInitializing {} +} diff --git a/packages/horizon/contracts/data-service/DataServiceStorage.sol b/packages/horizon/contracts/data-service/DataServiceStorage.sol new file mode 100644 index 000000000..df759b892 --- /dev/null +++ b/packages/horizon/contracts/data-service/DataServiceStorage.sol @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +pragma solidity 0.8.27; + +/** + * @title DataServiceStorage + * @dev This contract holds the storage variables for the DataService contract. + * @custom:security-contact Please email security+contracts@thegraph.com if you find any + * bugs. We may have an active bug bounty program. + */ +abstract contract DataServiceV1Storage { + /// @dev Gap to allow adding variables in future upgrades + /// Note that this contract is not upgradeable but might be inherited by an upgradeable contract + uint256[50] private __gap; +} diff --git a/packages/horizon/contracts/data-service/extensions/DataServiceFees.sol b/packages/horizon/contracts/data-service/extensions/DataServiceFees.sol new file mode 100644 index 000000000..a1c38a99a --- /dev/null +++ b/packages/horizon/contracts/data-service/extensions/DataServiceFees.sol @@ -0,0 +1,153 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +pragma solidity 0.8.27; + +import { IDataServiceFees } from "../interfaces/IDataServiceFees.sol"; + +import { ProvisionTracker } from "../libraries/ProvisionTracker.sol"; +import { LinkedList } from "../../libraries/LinkedList.sol"; + +import { DataService } from "../DataService.sol"; +import { DataServiceFeesV1Storage } from "./DataServiceFeesStorage.sol"; + +/** + * @title DataServiceFees contract + * @dev Implementation of the {IDataServiceFees} interface. + * @notice Extension for the {IDataService} contract to handle payment collateralization + * using a Horizon provision. See {IDataServiceFees} for more details. + * @dev This contract inherits from {DataService} which needs to be initialized, please see + * {DataService} for detailed instructions. + * @custom:security-contact Please email security+contracts@thegraph.com if you find any + * bugs. We may have an active bug bounty program. + */ +abstract contract DataServiceFees is DataService, DataServiceFeesV1Storage, IDataServiceFees { + using ProvisionTracker for mapping(address => uint256); + using LinkedList for LinkedList.List; + + /// @inheritdoc IDataServiceFees + function releaseStake(uint256 numClaimsToRelease) external virtual override { + _releaseStake(msg.sender, numClaimsToRelease); + } + + /** + * @notice Locks stake for a service provider to back a payment. + * Creates a stake claim, which is stored in a linked list by service provider. + * @dev Requirements: + * - The associated provision must have enough available tokens to lock the stake. + * + * Emits a {StakeClaimLocked} event. + * + * @param _serviceProvider The address of the service provider + * @param _tokens The amount of tokens to lock in the claim + * @param _unlockTimestamp The timestamp when the tokens can be released + */ + function _lockStake(address _serviceProvider, uint256 _tokens, uint256 _unlockTimestamp) internal { + require(_tokens != 0, DataServiceFeesZeroTokens()); + feesProvisionTracker.lock(_graphStaking(), _serviceProvider, _tokens, _delegationRatio); + + LinkedList.List storage claimsList = claimsLists[_serviceProvider]; + + // Save item and add to list + bytes32 claimId = _buildStakeClaimId(_serviceProvider, claimsList.nonce); + claims[claimId] = StakeClaim({ + tokens: _tokens, + createdAt: block.timestamp, + releasableAt: _unlockTimestamp, + nextClaim: bytes32(0) + }); + if (claimsList.count != 0) claims[claimsList.tail].nextClaim = claimId; + claimsList.addTail(claimId); + + emit StakeClaimLocked(_serviceProvider, claimId, _tokens, _unlockTimestamp); + } + + /** + * @notice Releases expired stake claims for a service provider. + * @dev This function can be overriden and/or disabled. + * @dev Note that the list is traversed by creation date not by releasableAt date. Traversing will stop + * when the first stake claim that is not yet expired is found even if later stake claims have expired. This + * could happen if stake claims are genereted with different unlock periods. + * @dev Emits a {StakeClaimsReleased} event, and a {StakeClaimReleased} event for each claim released. + * @param _serviceProvider The address of the service provider + * @param _numClaimsToRelease Amount of stake claims to process. If 0, all stake claims are processed. + */ + function _releaseStake(address _serviceProvider, uint256 _numClaimsToRelease) internal { + LinkedList.List storage claimsList = claimsLists[_serviceProvider]; + (uint256 claimsReleased, bytes memory data) = claimsList.traverse( + _getNextStakeClaim, + _processStakeClaim, + _deleteStakeClaim, + abi.encode(0, _serviceProvider), + _numClaimsToRelease + ); + + emit StakeClaimsReleased(_serviceProvider, claimsReleased, abi.decode(data, (uint256))); + } + + /** + * @notice Processes a stake claim, releasing the tokens if the claim has expired. + * @dev This function is used as a callback in the stake claims linked list traversal. + * @param _claimId The id of the stake claim + * @param _acc The accumulator for the stake claims being processed + * @return Whether the stake claim is still locked, indicating that the traversal should continue or stop. + * @return The updated accumulator data + */ + function _processStakeClaim(bytes32 _claimId, bytes memory _acc) private returns (bool, bytes memory) { + StakeClaim memory claim = _getStakeClaim(_claimId); + + // early exit + if (claim.releasableAt > block.timestamp) { + return (true, LinkedList.NULL_BYTES); + } + + // decode + (uint256 tokensClaimed, address serviceProvider) = abi.decode(_acc, (uint256, address)); + + // process + feesProvisionTracker.release(serviceProvider, claim.tokens); + emit StakeClaimReleased(serviceProvider, _claimId, claim.tokens, claim.releasableAt); + + // encode + _acc = abi.encode(tokensClaimed + claim.tokens, serviceProvider); + return (false, _acc); + } + + /** + * @notice Deletes a stake claim. + * @dev This function is used as a callback in the stake claims linked list traversal. + * @param _claimId The ID of the stake claim to delete + */ + function _deleteStakeClaim(bytes32 _claimId) private { + delete claims[_claimId]; + } + + /** + * @notice Gets the details of a stake claim + * @param _claimId The ID of the stake claim + * @return The stake claim details + */ + function _getStakeClaim(bytes32 _claimId) private view returns (StakeClaim memory) { + StakeClaim memory claim = claims[_claimId]; + require(claim.createdAt != 0, DataServiceFeesClaimNotFound(_claimId)); + return claim; + } + + /** + * @notice Gets the next stake claim in the linked list + * @dev This function is used as a callback in the stake claims linked list traversal. + * @param _claimId The ID of the stake claim + * @return The next stake claim ID + */ + function _getNextStakeClaim(bytes32 _claimId) private view returns (bytes32) { + return claims[_claimId].nextClaim; + } + + /** + * @notice Builds a stake claim ID + * @param _serviceProvider The address of the service provider + * @param _nonce A nonce of the stake claim + * @return The stake claim ID + */ + function _buildStakeClaimId(address _serviceProvider, uint256 _nonce) private view returns (bytes32) { + return keccak256(abi.encodePacked(address(this), _serviceProvider, _nonce)); + } +} diff --git a/packages/horizon/contracts/data-service/extensions/DataServiceFeesStorage.sol b/packages/horizon/contracts/data-service/extensions/DataServiceFeesStorage.sol new file mode 100644 index 000000000..30d1aa4ee --- /dev/null +++ b/packages/horizon/contracts/data-service/extensions/DataServiceFeesStorage.sol @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +pragma solidity 0.8.27; + +import { IDataServiceFees } from "../interfaces/IDataServiceFees.sol"; + +import { LinkedList } from "../../libraries/LinkedList.sol"; + +/** + * @title Storage layout for the {DataServiceFees} extension contract. + * @custom:security-contact Please email security+contracts@thegraph.com if you find any + * bugs. We may have an active bug bounty program. + */ +abstract contract DataServiceFeesV1Storage { + /// @notice The amount of tokens locked in stake claims for each service provider + mapping(address serviceProvider => uint256 tokens) public feesProvisionTracker; + + /// @notice List of all locked stake claims to be released to service providers + mapping(bytes32 claimId => IDataServiceFees.StakeClaim claim) public claims; + + /// @notice Service providers registered in the data service + mapping(address serviceProvider => LinkedList.List list) public claimsLists; + + /// @dev Gap to allow adding variables in future upgrades + /// Note that this contract is not upgradeable but might be inherited by an upgradeable contract + uint256[50] private __gap; +} diff --git a/packages/horizon/contracts/data-service/extensions/DataServicePausable.sol b/packages/horizon/contracts/data-service/extensions/DataServicePausable.sol new file mode 100644 index 000000000..16cd26885 --- /dev/null +++ b/packages/horizon/contracts/data-service/extensions/DataServicePausable.sol @@ -0,0 +1,58 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +pragma solidity 0.8.27; + +import { IDataServicePausable } from "../interfaces/IDataServicePausable.sol"; + +import { Pausable } from "@openzeppelin/contracts/utils/Pausable.sol"; +import { DataService } from "../DataService.sol"; + +/** + * @title DataServicePausable contract + * @dev Implementation of the {IDataServicePausable} interface. + * @notice Extension for the {IDataService} contract, adds pausing functionality + * to the data service. Pausing is controlled by privileged accounts called + * pause guardians. + * @dev Note that this extension does not provide an external function to set pause + * guardians. This should be implemented in the derived contract. + * @dev This contract inherits from {DataService} which needs to be initialized, please see + * {DataService} for detailed instructions. + * @custom:security-contact Please email security+contracts@thegraph.com if you find any + * bugs. We may have an active bug bounty program. + */ +abstract contract DataServicePausable is Pausable, DataService, IDataServicePausable { + /// @notice List of pause guardians and their allowed status + mapping(address pauseGuardian => bool allowed) public pauseGuardians; + + /** + * @notice Checks if the caller is a pause guardian. + */ + modifier onlyPauseGuardian() { + require(pauseGuardians[msg.sender], DataServicePausableNotPauseGuardian(msg.sender)); + _; + } + + /// @inheritdoc IDataServicePausable + function pause() external override onlyPauseGuardian { + _pause(); + } + + /// @inheritdoc IDataServicePausable + function unpause() external override onlyPauseGuardian { + _unpause(); + } + + /** + * @notice Sets a pause guardian. + * @dev Internal function to be used by the derived contract to set pause guardians. + * @param _pauseGuardian The address of the pause guardian + * @param _allowed The allowed status of the pause guardian + */ + function _setPauseGuardian(address _pauseGuardian, bool _allowed) internal { + require( + pauseGuardians[_pauseGuardian] == !_allowed, + DataServicePausablePauseGuardianNoChange(_pauseGuardian, _allowed) + ); + pauseGuardians[_pauseGuardian] = _allowed; + emit PauseGuardianSet(_pauseGuardian, _allowed); + } +} diff --git a/packages/horizon/contracts/data-service/extensions/DataServicePausableUpgradeable.sol b/packages/horizon/contracts/data-service/extensions/DataServicePausableUpgradeable.sol new file mode 100644 index 000000000..da4d8fd77 --- /dev/null +++ b/packages/horizon/contracts/data-service/extensions/DataServicePausableUpgradeable.sol @@ -0,0 +1,73 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +pragma solidity 0.8.27; + +import { IDataServicePausable } from "../interfaces/IDataServicePausable.sol"; + +import { PausableUpgradeable } from "@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol"; +import { DataService } from "../DataService.sol"; + +/** + * @title DataServicePausableUpgradeable contract + * @dev Implementation of the {IDataServicePausable} interface. + * @dev Upgradeable version of the {DataServicePausable} contract. + * @dev This contract inherits from {DataService} which needs to be initialized, please see + * {DataService} for detailed instructions. + * @custom:security-contact Please email security+contracts@thegraph.com if you find any + * bugs. We may have an active bug bounty program. + */ +abstract contract DataServicePausableUpgradeable is PausableUpgradeable, DataService, IDataServicePausable { + /// @notice List of pause guardians and their allowed status + mapping(address pauseGuardian => bool allowed) public pauseGuardians; + + /// @dev Gap to allow adding variables in future upgrades + uint256[50] private __gap; + + /** + * @notice Checks if the caller is a pause guardian. + */ + modifier onlyPauseGuardian() { + require(pauseGuardians[msg.sender], DataServicePausableNotPauseGuardian(msg.sender)); + _; + } + + /// @inheritdoc IDataServicePausable + function pause() external override onlyPauseGuardian { + _pause(); + } + + /// @inheritdoc IDataServicePausable + function unpause() external override onlyPauseGuardian { + _unpause(); + } + + /** + * @notice Initializes the contract and parent contracts + */ + function __DataServicePausable_init() internal onlyInitializing { + __Pausable_init_unchained(); + __DataServicePausable_init_unchained(); + } + + /** + * @notice Initializes the contract + */ + function __DataServicePausable_init_unchained() internal onlyInitializing {} + + /** + * @notice Sets a pause guardian. + * @dev Internal function to be used by the derived contract to set pause guardians. + * + * Emits a {PauseGuardianSet} event. + * + * @param _pauseGuardian The address of the pause guardian + * @param _allowed The allowed status of the pause guardian + */ + function _setPauseGuardian(address _pauseGuardian, bool _allowed) internal { + require( + pauseGuardians[_pauseGuardian] == !_allowed, + DataServicePausablePauseGuardianNoChange(_pauseGuardian, _allowed) + ); + pauseGuardians[_pauseGuardian] = _allowed; + emit PauseGuardianSet(_pauseGuardian, _allowed); + } +} diff --git a/packages/horizon/contracts/data-service/extensions/DataServiceRescuable.sol b/packages/horizon/contracts/data-service/extensions/DataServiceRescuable.sol new file mode 100644 index 000000000..13ef7d4df --- /dev/null +++ b/packages/horizon/contracts/data-service/extensions/DataServiceRescuable.sol @@ -0,0 +1,79 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +pragma solidity 0.8.27; + +import { Address } from "@openzeppelin/contracts/utils/Address.sol"; +import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; +import { IDataServiceRescuable } from "../interfaces/IDataServiceRescuable.sol"; + +import { DataService } from "../DataService.sol"; + +import { Denominations } from "../../libraries/Denominations.sol"; +import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; + +/** + * @title Rescuable contract + * @dev Allows a contract to have a function to rescue tokens sent by mistake. + * The contract must implement the external rescueTokens function or similar, + * that calls this contract's _rescueTokens. + * @dev Note that this extension does not provide an external function to set + * rescuers. This should be implemented in the derived contract. + * @dev This contract inherits from {DataService} which needs to be initialized, please see + * {DataService} for detailed instructions. + * @custom:security-contact Please email security+contracts@thegraph.com if you find any + * bugs. We may have an active bug bounty program. + */ +abstract contract DataServiceRescuable is DataService, IDataServiceRescuable { + /// @notice List of rescuers and their allowed status + mapping(address rescuer => bool allowed) public rescuers; + + /// @dev Gap to allow adding variables in future upgrades + /// Note that this contract is not upgradeable but might be inherited by an upgradeable contract + uint256[50] private __gap; + + /** + * @notice Checks if the caller is a rescuer. + */ + modifier onlyRescuer() { + require(rescuers[msg.sender], DataServiceRescuableNotRescuer(msg.sender)); + _; + } + + /// @inheritdoc IDataServiceRescuable + function rescueGRT(address to, uint256 tokens) external virtual onlyRescuer { + _rescueTokens(to, address(_graphToken()), tokens); + } + + /// @inheritdoc IDataServiceRescuable + function rescueETH(address payable to, uint256 tokens) external virtual onlyRescuer { + _rescueTokens(to, Denominations.NATIVE_TOKEN, tokens); + } + + /** + * @notice Sets a rescuer. + * @dev Internal function to be used by the derived contract to set rescuers. + * + * Emits a {RescuerSet} event. + * + * @param _rescuer Address of the rescuer + * @param _allowed Allowed status of the rescuer + */ + function _setRescuer(address _rescuer, bool _allowed) internal { + rescuers[_rescuer] = _allowed; + emit RescuerSet(_rescuer, _allowed); + } + + /** + * @dev Allows rescuing tokens sent to this contract + * @param _to Destination address to send the tokens + * @param _token Address of the token being rescued + * @param _tokens Amount of tokens to pull + */ + function _rescueTokens(address _to, address _token, uint256 _tokens) internal { + require(_tokens != 0, DataServiceRescuableCannotRescueZero()); + + if (Denominations.isNativeToken(_token)) Address.sendValue(payable(_to), _tokens); + else SafeERC20.safeTransfer(IERC20(_token), _to, _tokens); + + emit TokensRescued(msg.sender, _to, _token, _tokens); + } +} diff --git a/packages/horizon/contracts/data-service/interfaces/IDataService.sol b/packages/horizon/contracts/data-service/interfaces/IDataService.sol new file mode 100644 index 000000000..017d90b80 --- /dev/null +++ b/packages/horizon/contracts/data-service/interfaces/IDataService.sol @@ -0,0 +1,170 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +pragma solidity 0.8.27; + +import { IGraphPayments } from "../../interfaces/IGraphPayments.sol"; + +/** + * @title Interface of the base {DataService} contract as defined by the Graph Horizon specification. + * @notice This interface provides a guardrail for contracts that use the Data Service framework + * to implement a data service on Graph Horizon. Much of the specification is intentionally loose + * to allow for greater flexibility when designing a data service. It's not possible to guarantee that + * an implementation will honor the Data Service framework guidelines so it's advised to always review + * the implementation code and the documentation. + * @dev This interface is expected to be inherited and extended by a data service interface. It can be + * used to interact with it however it's advised to use the more specific parent interface. + * @custom:security-contact Please email security+contracts@thegraph.com if you find any + * bugs. We may have an active bug bounty program. + */ +interface IDataService { + /** + * @notice Emitted when a service provider is registered with the data service. + * @param serviceProvider The address of the service provider. + * @param data Custom data, usage defined by the data service. + */ + event ServiceProviderRegistered(address indexed serviceProvider, bytes data); + + /** + * @notice Emitted when a service provider accepts a provision in {Graph Horizon staking contract}. + * @param serviceProvider The address of the service provider. + */ + event ProvisionPendingParametersAccepted(address indexed serviceProvider); + + /** + * @notice Emitted when a service provider starts providing the service. + * @param serviceProvider The address of the service provider. + * @param data Custom data, usage defined by the data service. + */ + event ServiceStarted(address indexed serviceProvider, bytes data); + + /** + * @notice Emitted when a service provider stops providing the service. + * @param serviceProvider The address of the service provider. + * @param data Custom data, usage defined by the data service. + */ + event ServiceStopped(address indexed serviceProvider, bytes data); + + /** + * @notice Emitted when a service provider collects payment. + * @param serviceProvider The address of the service provider. + * @param feeType The type of fee to collect as defined in {GraphPayments}. + * @param tokens The amount of tokens collected. + */ + event ServicePaymentCollected( + address indexed serviceProvider, + IGraphPayments.PaymentTypes indexed feeType, + uint256 tokens + ); + + /** + * @notice Emitted when a service provider is slashed. + * @param serviceProvider The address of the service provider. + * @param tokens The amount of tokens slashed. + */ + event ServiceProviderSlashed(address indexed serviceProvider, uint256 tokens); + + /** + * @notice Registers a service provider with the data service. The service provider can now + * start providing the service. + * @dev Before registering, the service provider must have created a provision in the + * Graph Horizon staking contract with parameters that are compatible with the data service. + * + * Verifies provision parameters and rejects registration in the event they are not valid. + * + * Emits a {ServiceProviderRegistered} event. + * + * NOTE: Failing to accept the provision will result in the service provider operating + * on an unverified provision. Depending on of the data service this can be a security + * risk as the protocol won't be able to guarantee economic security for the consumer. + * @param serviceProvider The address of the service provider. + * @param data Custom data, usage defined by the data service. + */ + function register(address serviceProvider, bytes calldata data) external; + + /** + * @notice Accepts pending parameters in the provision of a service provider in the {Graph Horizon staking + * contract}. + * @dev Provides a way for the data service to validate and accept provision parameter changes. Call {_acceptProvision}. + * + * Emits a {ProvisionPendingParametersAccepted} event. + * + * @param serviceProvider The address of the service provider. + * @param data Custom data, usage defined by the data service. + */ + function acceptProvisionPendingParameters(address serviceProvider, bytes calldata data) external; + + /** + * @notice Service provider starts providing the service. + * @dev Emits a {ServiceStarted} event. + * @param serviceProvider The address of the service provider. + * @param data Custom data, usage defined by the data service. + */ + function startService(address serviceProvider, bytes calldata data) external; + + /** + * @notice Service provider stops providing the service. + * @dev Emits a {ServiceStopped} event. + * @param serviceProvider The address of the service provider. + * @param data Custom data, usage defined by the data service. + */ + function stopService(address serviceProvider, bytes calldata data) external; + + /** + * @notice Collects payment earnt by the service provider. + * @dev The implementation of this function is expected to interact with {GraphPayments} + * to collect payment from the service payer, which is done via {IGraphPayments-collect}. + * + * Emits a {ServicePaymentCollected} event. + * + * NOTE: Data services that are vetted by the Graph Council might qualify for a portion of + * protocol issuance to cover for these payments. In this case, the funds are taken by + * interacting with the rewards manager contract instead of the {GraphPayments} contract. + * @param serviceProvider The address of the service provider. + * @param feeType The type of fee to collect as defined in {GraphPayments}. + * @param data Custom data, usage defined by the data service. + * @return The amount of tokens collected. + */ + function collect( + address serviceProvider, + IGraphPayments.PaymentTypes feeType, + bytes calldata data + ) external returns (uint256); + + /** + * @notice Slash a service provider for misbehaviour. + * @dev To slash the service provider's provision the function should call + * {Staking-slash}. + * + * Emits a {ServiceProviderSlashed} event. + * + * @param serviceProvider The address of the service provider. + * @param data Custom data, usage defined by the data service. + */ + function slash(address serviceProvider, bytes calldata data) external; + + /** + * @notice External getter for the thawing period range + * @return Minimum thawing period allowed + * @return Maximum thawing period allowed + */ + function getThawingPeriodRange() external view returns (uint64, uint64); + + /** + * @notice External getter for the verifier cut range + * @return Minimum verifier cut allowed + * @return Maximum verifier cut allowed + */ + function getVerifierCutRange() external view returns (uint32, uint32); + + /** + * @notice External getter for the provision tokens range + * @return Minimum provision tokens allowed + * @return Maximum provision tokens allowed + */ + function getProvisionTokensRange() external view returns (uint256, uint256); + + /** + * @notice External getter for the delegation ratio + * @return The delegation ratio + */ + function getDelegationRatio() external view returns (uint32); +} diff --git a/packages/horizon/contracts/data-service/interfaces/IDataServiceFees.sol b/packages/horizon/contracts/data-service/interfaces/IDataServiceFees.sol new file mode 100644 index 000000000..9d235f4f7 --- /dev/null +++ b/packages/horizon/contracts/data-service/interfaces/IDataServiceFees.sol @@ -0,0 +1,98 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +pragma solidity 0.8.27; + +import { IDataService } from "./IDataService.sol"; + +/** + * @title Interface for the {DataServiceFees} contract. + * @notice Extension for the {IDataService} contract to handle payment collateralization + * using a Horizon provision. + * + * It's designed to be used with the Data Service framework: + * - When a service provider collects payment with {IDataService.collect} the data service should lock + * stake to back the payment using {_lockStake}. + * - Every time there is a payment collection with {IDataService.collect}, the data service should + * attempt to release any expired stake claims by calling {_releaseStake}. + * - Stake claims can also be manually released by calling {releaseStake} directly. + * + * @dev Note that this implementation uses the entire provisioned stake as collateral for the payment. + * It can be used to provide economic security for the payments collected as long as the provisioned + * stake is not being used for other purposes. + * @custom:security-contact Please email security+contracts@thegraph.com if you find any + * bugs. We may have an active bug bounty program. + */ +interface IDataServiceFees is IDataService { + /** + * @notice A stake claim, representing provisioned stake that gets locked + * to be released to a service provider. + * @dev StakeClaims are stored in linked lists by service provider, ordered by + * creation timestamp. + * @param tokens The amount of tokens to be locked in the claim + * @param createdAt The timestamp when the claim was created + * @param releasableAt The timestamp when the tokens can be released + * @param nextClaim The next claim in the linked list + */ + struct StakeClaim { + uint256 tokens; + uint256 createdAt; + uint256 releasableAt; + bytes32 nextClaim; + } + + /** + * @notice Emitted when a stake claim is created and stake is locked. + * @param serviceProvider The address of the service provider + * @param claimId The id of the stake claim + * @param tokens The amount of tokens to lock in the claim + * @param unlockTimestamp The timestamp when the tokens can be released + */ + event StakeClaimLocked( + address indexed serviceProvider, + bytes32 indexed claimId, + uint256 tokens, + uint256 unlockTimestamp + ); + + /** + * @notice Emitted when a stake claim is released and stake is unlocked. + * @param serviceProvider The address of the service provider + * @param claimId The id of the stake claim + * @param tokens The amount of tokens released + * @param releasableAt The timestamp when the tokens were released + */ + event StakeClaimReleased( + address indexed serviceProvider, + bytes32 indexed claimId, + uint256 tokens, + uint256 releasableAt + ); + + /** + * @notice Emitted when a series of stake claims are released. + * @param serviceProvider The address of the service provider + * @param claimsCount The number of stake claims being released + * @param tokensReleased The total amount of tokens being released + */ + event StakeClaimsReleased(address indexed serviceProvider, uint256 claimsCount, uint256 tokensReleased); + + /** + * @notice Thrown when attempting to get a stake claim that does not exist. + * @param claimId The id of the stake claim + */ + error DataServiceFeesClaimNotFound(bytes32 claimId); + + /** + * @notice Emitted when trying to lock zero tokens in a stake claim + */ + error DataServiceFeesZeroTokens(); + + /** + * @notice Releases expired stake claims for the caller. + * @dev This function is only meant to be called if the service provider has enough + * stake claims that releasing them all at once would exceed the block gas limit. + * @dev This function can be overriden and/or disabled. + * @dev Emits a {StakeClaimsReleased} event, and a {StakeClaimReleased} event for each claim released. + * @param numClaimsToRelease Amount of stake claims to process. If 0, all stake claims are processed. + */ + function releaseStake(uint256 numClaimsToRelease) external; +} diff --git a/packages/horizon/contracts/data-service/interfaces/IDataServicePausable.sol b/packages/horizon/contracts/data-service/interfaces/IDataServicePausable.sol new file mode 100644 index 000000000..906e864a8 --- /dev/null +++ b/packages/horizon/contracts/data-service/interfaces/IDataServicePausable.sol @@ -0,0 +1,54 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +pragma solidity 0.8.27; + +import { IDataService } from "./IDataService.sol"; + +/** + * @title Interface for the {DataServicePausable} contract. + * @notice Extension for the {IDataService} contract, adds pausing functionality + * to the data service. Pausing is controlled by privileged accounts called + * pause guardians. + * @custom:security-contact Please email security+contracts@thegraph.com if you find any + * bugs. We may have an active bug bounty program. + */ +interface IDataServicePausable is IDataService { + /** + * @notice Emitted when a pause guardian is set. + * @param account The address of the pause guardian + * @param allowed The allowed status of the pause guardian + */ + event PauseGuardianSet(address indexed account, bool allowed); + + /** + * @notice Emitted when a the caller is not a pause guardian + * @param account The address of the pause guardian + */ + error DataServicePausableNotPauseGuardian(address account); + + /** + * @notice Emitted when a pause guardian is set to the same allowed status + * @param account The address of the pause guardian + * @param allowed The allowed status of the pause guardian + */ + error DataServicePausablePauseGuardianNoChange(address account, bool allowed); + + /** + * @notice Pauses the data service. + * @dev Note that only functions using the modifiers `whenNotPaused` + * and `whenPaused` will be affected by the pause. + * + * Requirements: + * - The contract must not be already paused + */ + function pause() external; + + /** + * @notice Unpauses the data service. + * @dev Note that only functions using the modifiers `whenNotPaused` + * and `whenPaused` will be affected by the pause. + * + * Requirements: + * - The contract must be paused + */ + function unpause() external; +} diff --git a/packages/horizon/contracts/data-service/interfaces/IDataServiceRescuable.sol b/packages/horizon/contracts/data-service/interfaces/IDataServiceRescuable.sol new file mode 100644 index 000000000..f2cd7b06e --- /dev/null +++ b/packages/horizon/contracts/data-service/interfaces/IDataServiceRescuable.sol @@ -0,0 +1,68 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +pragma solidity 0.8.27; + +import { IDataService } from "./IDataService.sol"; + +/** + * @title Interface for the {IDataServicePausable} contract. + * @notice Extension for the {IDataService} contract, adds the ability to rescue + * any ERC20 token or ETH from the contract, controlled by a rescuer privileged role. + * @custom:security-contact Please email security+contracts@thegraph.com if you find any + * bugs. We may have an active bug bounty program. + */ +interface IDataServiceRescuable is IDataService { + /** + * @notice Emitted when tokens are rescued from the contract. + * @param from The address initiating the rescue + * @param to The address receiving the rescued tokens + * @param token The address of the token being rescued + * @param tokens The amount of tokens rescued + */ + event TokensRescued(address indexed from, address indexed to, address indexed token, uint256 tokens); + + /** + * @notice Emitted when a rescuer is set. + * @param account The address of the rescuer + * @param allowed Whether the rescuer is allowed to rescue tokens + */ + event RescuerSet(address indexed account, bool allowed); + + /** + * @notice Thrown when trying to rescue zero tokens. + */ + error DataServiceRescuableCannotRescueZero(); + + /** + * @notice Thrown when the caller is not a rescuer. + * @param account The address of the account that attempted the rescue + */ + error DataServiceRescuableNotRescuer(address account); + + /** + * @notice Rescues GRT tokens from the contract. + * @dev Declared as virtual to allow disabling the function via override. + * + * Requirements: + * - Cannot rescue zero tokens. + * + * Emits a {TokensRescued} event. + * + * @param to Address of the tokens recipient. + * @param tokens Amount of tokens to rescue. + */ + function rescueGRT(address to, uint256 tokens) external; + + /** + * @notice Rescues ether from the contract. + * @dev Declared as virtual to allow disabling the function via override. + * + * Requirements: + * - Cannot rescue zeroether. + * + * Emits a {TokensRescued} event. + * + * @param to Address of the tokens recipient. + * @param tokens Amount of tokens to rescue. + */ + function rescueETH(address payable to, uint256 tokens) external; +} diff --git a/packages/horizon/contracts/data-service/libraries/ProvisionTracker.sol b/packages/horizon/contracts/data-service/libraries/ProvisionTracker.sol new file mode 100644 index 000000000..2fe271833 --- /dev/null +++ b/packages/horizon/contracts/data-service/libraries/ProvisionTracker.sol @@ -0,0 +1,80 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +pragma solidity 0.8.27; + +import { IHorizonStaking } from "../../interfaces/IHorizonStaking.sol"; + +/** + * @title ProvisionTracker library + * @notice A library to facilitate tracking of "used tokens" on Graph Horizon provisions. This can be used to + * ensure data services have enough economic security (provisioned stake) to back the payments they collect for + * their services. + * The library provides two primitives, lock and release to signal token usage and free up tokens respectively. It + * does not make any assumptions about the conditions under which tokens are locked or released. + * @custom:security-contact Please email security+contracts@thegraph.com if you find any + * bugs. We may have an active bug bounty program. + */ +library ProvisionTracker { + /** + * @notice Thrown when trying to lock more tokens than available + * @param tokensAvailable The amount of tokens available + * @param tokensRequired The amount of tokens required + */ + error ProvisionTrackerInsufficientTokens(uint256 tokensAvailable, uint256 tokensRequired); + + /** + * @notice Locks tokens for a service provider + * @dev Requirements: + * - `tokens` must be less than or equal to the amount of tokens available, as reported by the HorizonStaking contract + * @param self The provision tracker mapping + * @param graphStaking The HorizonStaking contract + * @param serviceProvider The service provider address + * @param tokens The amount of tokens to lock + * @param delegationRatio A delegation ratio to limit the amount of delegation that's usable + */ + function lock( + mapping(address => uint256) storage self, + IHorizonStaking graphStaking, + address serviceProvider, + uint256 tokens, + uint32 delegationRatio + ) internal { + if (tokens == 0) return; + + uint256 tokensRequired = self[serviceProvider] + tokens; + uint256 tokensAvailable = graphStaking.getTokensAvailable(serviceProvider, address(this), delegationRatio); + require(tokensRequired <= tokensAvailable, ProvisionTrackerInsufficientTokens(tokensAvailable, tokensRequired)); + self[serviceProvider] += tokens; + } + + /** + * @notice Releases tokens for a service provider + * @dev Requirements: + * - `tokens` must be less than or equal to the amount of tokens locked for the service provider + * @param self The provision tracker mapping + * @param serviceProvider The service provider address + * @param tokens The amount of tokens to release + */ + function release(mapping(address => uint256) storage self, address serviceProvider, uint256 tokens) internal { + if (tokens == 0) return; + require(self[serviceProvider] >= tokens, ProvisionTrackerInsufficientTokens(self[serviceProvider], tokens)); + self[serviceProvider] -= tokens; + } + + /** + * @notice Checks if a service provider has enough tokens available to lock + * @param self The provision tracker mapping + * @param graphStaking The HorizonStaking contract + * @param serviceProvider The service provider address + * @param delegationRatio A delegation ratio to limit the amount of delegation that's usable + * @return true if the service provider has enough tokens available to lock, false otherwise + */ + function check( + mapping(address => uint256) storage self, + IHorizonStaking graphStaking, + address serviceProvider, + uint32 delegationRatio + ) internal view returns (bool) { + uint256 tokensAvailable = graphStaking.getTokensAvailable(serviceProvider, address(this), delegationRatio); + return self[serviceProvider] <= tokensAvailable; + } +} diff --git a/packages/horizon/contracts/data-service/utilities/ProvisionManager.sol b/packages/horizon/contracts/data-service/utilities/ProvisionManager.sol new file mode 100644 index 000000000..699394c8d --- /dev/null +++ b/packages/horizon/contracts/data-service/utilities/ProvisionManager.sol @@ -0,0 +1,323 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +pragma solidity 0.8.27; + +import { IHorizonStaking } from "../../interfaces/IHorizonStaking.sol"; + +import { UintRange } from "../../libraries/UintRange.sol"; +import { PPMMath } from "../../libraries/PPMMath.sol"; + +import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; +import { GraphDirectory } from "../../utilities/GraphDirectory.sol"; +import { ProvisionManagerV1Storage } from "./ProvisionManagerStorage.sol"; + +/** + * @title ProvisionManager contract + * @notice A helper contract that implements several provision management functions. + * @dev Provides utilities to verify provision parameters are within an acceptable range. Each + * parameter has an overridable setter and getter for the validity range, and a checker that reverts + * if the parameter is out of range. + * The parameters are: + * - Provision parameters (thawing period and verifier cut) + * - Provision tokens + * + * Note that default values for all provision parameters provide the most permissive configuration, it's + * highly recommended to override them at the data service level. + * + * @custom:security-contact Please email security+contracts@thegraph.com if you find any + * bugs. We may have an active bug bounty program. + */ +abstract contract ProvisionManager is Initializable, GraphDirectory, ProvisionManagerV1Storage { + using UintRange for uint256; + + /// @notice The default minimum verifier cut. + uint32 internal constant DEFAULT_MIN_VERIFIER_CUT = type(uint32).min; + + /// @notice The default maximum verifier cut. + uint32 internal constant DEFAULT_MAX_VERIFIER_CUT = uint32(PPMMath.MAX_PPM); + + /// @notice The default minimum thawing period. + uint64 internal constant DEFAULT_MIN_THAWING_PERIOD = type(uint64).min; + + /// @notice The default maximum thawing period. + uint64 internal constant DEFAULT_MAX_THAWING_PERIOD = type(uint64).max; + + /// @notice The default minimum provision tokens. + uint256 internal constant DEFAULT_MIN_PROVISION_TOKENS = type(uint256).min; + + /// @notice The default maximum provision tokens. + uint256 internal constant DEFAULT_MAX_PROVISION_TOKENS = type(uint256).max; + + /// @notice The default delegation ratio. + uint32 internal constant DEFAULT_DELEGATION_RATIO = type(uint32).max; + + /** + * @notice Emitted when the provision tokens range is set. + * @param min The minimum allowed value for the provision tokens. + * @param max The maximum allowed value for the provision tokens. + */ + event ProvisionTokensRangeSet(uint256 min, uint256 max); + + /** + * @notice Emitted when the delegation ratio is set. + * @param ratio The delegation ratio + */ + event DelegationRatioSet(uint32 ratio); + + /** + * @notice Emitted when the verifier cut range is set. + * @param min The minimum allowed value for the max verifier cut. + * @param max The maximum allowed value for the max verifier cut. + */ + event VerifierCutRangeSet(uint32 min, uint32 max); + + /** + * @notice Emitted when the thawing period range is set. + * @param min The minimum allowed value for the thawing period. + * @param max The maximum allowed value for the thawing period. + */ + event ThawingPeriodRangeSet(uint64 min, uint64 max); + + /** + * @notice Thrown when a provision parameter is out of range. + * @param message The error message. + * @param value The value that is out of range. + * @param min The minimum allowed value. + * @param max The maximum allowed value. + */ + error ProvisionManagerInvalidValue(bytes message, uint256 value, uint256 min, uint256 max); + + /** + * @notice Thrown when attempting to set a range where min is greater than max. + * @param min The minimum value. + * @param max The maximum value. + */ + error ProvisionManagerInvalidRange(uint256 min, uint256 max); + + /** + * @notice Thrown when the caller is not authorized to manage the provision of a service provider. + * @param serviceProvider The address of the serviceProvider. + * @param caller The address of the caller. + */ + error ProvisionManagerNotAuthorized(address serviceProvider, address caller); + + /** + * @notice Thrown when a provision is not found. + * @param serviceProvider The address of the service provider. + */ + error ProvisionManagerProvisionNotFound(address serviceProvider); + + /** + * @notice Checks if the caller is authorized to manage the provision of a service provider. + * @param serviceProvider The address of the service provider. + */ + modifier onlyAuthorizedForProvision(address serviceProvider) { + require( + _graphStaking().isAuthorized(serviceProvider, address(this), msg.sender), + ProvisionManagerNotAuthorized(serviceProvider, msg.sender) + ); + _; + } + + /** + * @notice Checks if a provision of a service provider is valid according + * to the parameter ranges established. + * @param serviceProvider The address of the service provider. + */ + modifier onlyValidProvision(address serviceProvider) virtual { + IHorizonStaking.Provision memory provision = _getProvision(serviceProvider); + _checkProvisionTokens(provision); + _checkProvisionParameters(provision, false); + _; + } + + /** + * @notice Initializes the contract and any parent contracts. + */ + function __ProvisionManager_init() internal onlyInitializing { + __ProvisionManager_init_unchained(); + } + + /** + * @notice Initializes the contract. + * @dev All parameters set to their entire range as valid. + */ + function __ProvisionManager_init_unchained() internal onlyInitializing { + _setProvisionTokensRange(DEFAULT_MIN_PROVISION_TOKENS, DEFAULT_MAX_PROVISION_TOKENS); + _setVerifierCutRange(DEFAULT_MIN_VERIFIER_CUT, DEFAULT_MAX_VERIFIER_CUT); + _setThawingPeriodRange(DEFAULT_MIN_THAWING_PERIOD, DEFAULT_MAX_THAWING_PERIOD); + _setDelegationRatio(DEFAULT_DELEGATION_RATIO); + } + + /** + * @notice Verifies and accepts the provision parameters of a service provider in + * the {HorizonStaking} contract. + * @dev Checks the pending provision parameters, not the current ones. + * + * @param _serviceProvider The address of the service provider. + */ + function _acceptProvisionParameters(address _serviceProvider) internal { + _checkProvisionParameters(_serviceProvider, true); + _graphStaking().acceptProvisionParameters(_serviceProvider); + } + + // -- setters -- + /** + * @notice Sets the delegation ratio. + * @param _ratio The delegation ratio to be set + */ + function _setDelegationRatio(uint32 _ratio) internal { + _delegationRatio = _ratio; + emit DelegationRatioSet(_ratio); + } + + /** + * @notice Sets the range for the provision tokens. + * @param _min The minimum allowed value for the provision tokens. + * @param _max The maximum allowed value for the provision tokens. + */ + function _setProvisionTokensRange(uint256 _min, uint256 _max) internal { + require(_min <= _max, ProvisionManagerInvalidRange(_min, _max)); + _minimumProvisionTokens = _min; + _maximumProvisionTokens = _max; + emit ProvisionTokensRangeSet(_min, _max); + } + + /** + * @notice Sets the range for the verifier cut. + * @param _min The minimum allowed value for the max verifier cut. + * @param _max The maximum allowed value for the max verifier cut. + */ + function _setVerifierCutRange(uint32 _min, uint32 _max) internal { + require(_min <= _max, ProvisionManagerInvalidRange(_min, _max)); + require(PPMMath.isValidPPM(_max), ProvisionManagerInvalidRange(_min, _max)); + _minimumVerifierCut = _min; + _maximumVerifierCut = _max; + emit VerifierCutRangeSet(_min, _max); + } + + /** + * @notice Sets the range for the thawing period. + * @param _min The minimum allowed value for the thawing period. + * @param _max The maximum allowed value for the thawing period. + */ + function _setThawingPeriodRange(uint64 _min, uint64 _max) internal { + require(_min <= _max, ProvisionManagerInvalidRange(_min, _max)); + _minimumThawingPeriod = _min; + _maximumThawingPeriod = _max; + emit ThawingPeriodRangeSet(_min, _max); + } + + // -- checks -- + + /** + * @notice Checks if the provision tokens of a service provider are within the valid range. + * @param _serviceProvider The address of the service provider. + */ + function _checkProvisionTokens(address _serviceProvider) internal view virtual { + IHorizonStaking.Provision memory provision = _getProvision(_serviceProvider); + _checkProvisionTokens(provision); + } + + /** + * @notice Checks if the provision tokens of a service provider are within the valid range. + * Note that thawing tokens are not considered in this check. + * @param _provision The provision to check. + */ + function _checkProvisionTokens(IHorizonStaking.Provision memory _provision) internal view virtual { + _checkValueInRange( + _provision.tokens - _provision.tokensThawing, + _minimumProvisionTokens, + _maximumProvisionTokens, + "tokens" + ); + } + + /** + * @notice Checks if the provision parameters of a service provider are within the valid range. + * @param _serviceProvider The address of the service provider. + * @param _checkPending If true, checks the pending provision parameters. + */ + function _checkProvisionParameters(address _serviceProvider, bool _checkPending) internal view virtual { + IHorizonStaking.Provision memory provision = _getProvision(_serviceProvider); + _checkProvisionParameters(provision, _checkPending); + } + + /** + * @notice Checks if the provision parameters of a service provider are within the valid range. + * @param _provision The provision to check. + * @param _checkPending If true, checks the pending provision parameters instead of the current ones. + */ + function _checkProvisionParameters( + IHorizonStaking.Provision memory _provision, + bool _checkPending + ) internal view virtual { + (uint64 thawingPeriodMin, uint64 thawingPeriodMax) = _getThawingPeriodRange(); + uint64 thawingPeriodToCheck = _checkPending ? _provision.thawingPeriodPending : _provision.thawingPeriod; + _checkValueInRange(thawingPeriodToCheck, thawingPeriodMin, thawingPeriodMax, "thawingPeriod"); + + (uint32 verifierCutMin, uint32 verifierCutMax) = _getVerifierCutRange(); + uint32 maxVerifierCutToCheck = _checkPending ? _provision.maxVerifierCutPending : _provision.maxVerifierCut; + _checkValueInRange(maxVerifierCutToCheck, verifierCutMin, verifierCutMax, "maxVerifierCut"); + } + + // -- getters -- + + /** + * @notice Gets the delegation ratio. + * @return The delegation ratio + */ + function _getDelegationRatio() internal view returns (uint32) { + return _delegationRatio; + } + + /** + * @notice Gets the range for the provision tokens. + * @return The minimum allowed value for the provision tokens. + * @return The maximum allowed value for the provision tokens. + */ + function _getProvisionTokensRange() internal view virtual returns (uint256, uint256) { + return (_minimumProvisionTokens, _maximumProvisionTokens); + } + + /** + * @notice Gets the range for the thawing period. + * @return The minimum allowed value for the thawing period. + * @return The maximum allowed value for the thawing period. + */ + function _getThawingPeriodRange() internal view virtual returns (uint64, uint64) { + return (_minimumThawingPeriod, _maximumThawingPeriod); + } + + /** + * @notice Gets the range for the verifier cut. + * @return The minimum allowed value for the max verifier cut. + * @return The maximum allowed value for the max verifier cut. + */ + function _getVerifierCutRange() internal view virtual returns (uint32, uint32) { + return (_minimumVerifierCut, _maximumVerifierCut); + } + + /** + * @notice Gets a provision from the {HorizonStaking} contract. + * @dev Requirements: + * - The provision must exist. + * @param _serviceProvider The address of the service provider. + * @return The provision. + */ + function _getProvision(address _serviceProvider) internal view returns (IHorizonStaking.Provision memory) { + IHorizonStaking.Provision memory provision = _graphStaking().getProvision(_serviceProvider, address(this)); + require(provision.createdAt != 0, ProvisionManagerProvisionNotFound(_serviceProvider)); + return provision; + } + + /** + * @notice Checks if a value is within a valid range. + * @param _value The value to check. + * @param _min The minimum allowed value. + * @param _max The maximum allowed value. + * @param _revertMessage The revert message to display if the value is out of range. + */ + function _checkValueInRange(uint256 _value, uint256 _min, uint256 _max, bytes memory _revertMessage) private pure { + require(_value.isInRange(_min, _max), ProvisionManagerInvalidValue(_revertMessage, _value, _min, _max)); + } +} diff --git a/packages/horizon/contracts/data-service/utilities/ProvisionManagerStorage.sol b/packages/horizon/contracts/data-service/utilities/ProvisionManagerStorage.sol new file mode 100644 index 000000000..5931c66e5 --- /dev/null +++ b/packages/horizon/contracts/data-service/utilities/ProvisionManagerStorage.sol @@ -0,0 +1,35 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +pragma solidity 0.8.27; + +/** + * @title Storage layout for the {ProvisionManager} helper contract. + * @custom:security-contact Please email security+contracts@thegraph.com if you find any + * bugs. We may have an active bug bounty program. + */ +abstract contract ProvisionManagerV1Storage { + /// @notice The minimum amount of tokens required to register a provision in the data service + uint256 internal _minimumProvisionTokens; + + /// @notice The maximum amount of tokens allowed to register a provision in the data service + uint256 internal _maximumProvisionTokens; + + /// @notice The minimum thawing period required to register a provision in the data service + uint64 internal _minimumThawingPeriod; + + /// @notice The maximum thawing period allowed to register a provision in the data service + uint64 internal _maximumThawingPeriod; + + /// @notice The minimum verifier cut required to register a provision in the data service (in PPM) + uint32 internal _minimumVerifierCut; + + /// @notice The maximum verifier cut allowed to register a provision in the data service (in PPM) + uint32 internal _maximumVerifierCut; + + /// @notice How much delegation the service provider can effectively use + /// @dev Max calculated as service provider's stake * delegationRatio + uint32 internal _delegationRatio; + + /// @dev Gap to allow adding variables in future upgrades + /// Note that this contract is not upgradeable but might be inherited by an upgradeable contract + uint256[50] private __gap; +} diff --git a/packages/horizon/contracts/interfaces/IAuthorizable.sol b/packages/horizon/contracts/interfaces/IAuthorizable.sol new file mode 100644 index 000000000..cd6553fa7 --- /dev/null +++ b/packages/horizon/contracts/interfaces/IAuthorizable.sol @@ -0,0 +1,158 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +pragma solidity 0.8.27; + +/** + * @title Interface for the {Authorizable} contract + * @notice Implements an authorization scheme that allows authorizers to + * authorize signers to sign on their behalf. + * @custom:security-contact Please email security+contracts@thegraph.com if you find any + * bugs. We may have an active bug bounty program. + */ +interface IAuthorizable { + /** + * @notice Details for an authorizer-signer pair + * @dev Authorizations can be removed only after a thawing period + * @param authorizer The address of the authorizer - resource owner + * @param thawEndTimestamp The timestamp at which the thawing period ends (zero if not thawing) + * @param revoked Whether the signer authorization was revoked + */ + struct Authorization { + address authorizer; + uint256 thawEndTimestamp; + bool revoked; + } + + /** + * @notice Emitted when a signer is authorized to sign for a authorizer + * @param authorizer The address of the authorizer + * @param signer The address of the signer + */ + event SignerAuthorized(address indexed authorizer, address indexed signer); + + /** + * @notice Emitted when a signer is thawed to be de-authorized + * @param authorizer The address of the authorizer thawing the signer + * @param signer The address of the signer to thaw + * @param thawEndTimestamp The timestamp at which the thawing period ends + */ + event SignerThawing(address indexed authorizer, address indexed signer, uint256 thawEndTimestamp); + + /** + * @notice Emitted when the thawing of a signer is cancelled + * @param authorizer The address of the authorizer cancelling the thawing + * @param signer The address of the signer + * @param thawEndTimestamp The timestamp at which the thawing period was scheduled to end + */ + event SignerThawCanceled(address indexed authorizer, address indexed signer, uint256 thawEndTimestamp); + + /** + * @notice Emitted when a signer has been revoked after thawing + * @param authorizer The address of the authorizer revoking the signer + * @param signer The address of the signer + */ + event SignerRevoked(address indexed authorizer, address indexed signer); + + /** + * @notice Thrown when attempting to authorize a signer that is already authorized + * @param authorizer The address of the authorizer + * @param signer The address of the signer + * @param revoked The revoked status of the authorization + */ + error AuthorizableSignerAlreadyAuthorized(address authorizer, address signer, bool revoked); + + /** + * @notice Thrown when the signer proof deadline is invalid + * @param proofDeadline The deadline for the proof provided + * @param currentTimestamp The current timestamp + */ + error AuthorizableInvalidSignerProofDeadline(uint256 proofDeadline, uint256 currentTimestamp); + + /** + * @notice Thrown when the signer proof is invalid + */ + error AuthorizableInvalidSignerProof(); + + /** + * @notice Thrown when the signer is not authorized by the authorizer + * @param authorizer The address of the authorizer + * @param signer The address of the signer + */ + error AuthorizableSignerNotAuthorized(address authorizer, address signer); + + /** + * @notice Thrown when the signer is not thawing + * @param signer The address of the signer + */ + error AuthorizableSignerNotThawing(address signer); + + /** + * @notice Thrown when the signer is still thawing + * @param currentTimestamp The current timestamp + * @param thawEndTimestamp The timestamp at which the thawing period ends + */ + error AuthorizableSignerStillThawing(uint256 currentTimestamp, uint256 thawEndTimestamp); + + /** + * @notice Authorize a signer to sign on behalf of the authorizer + * @dev Requirements: + * - `signer` must not be already authorized + * - `proofDeadline` must be greater than the current timestamp + * - `proof` must be a valid signature from the signer being authorized + * + * Emits a {SignerAuthorized} event + * @param signer The address of the signer + * @param proofDeadline The deadline for the proof provided by the signer + * @param proof The proof provided by the signer to be authorized by the authorizer + * consists of (chain id, verifying contract address, domain, proof deadline, authorizer address) + */ + function authorizeSigner(address signer, uint256 proofDeadline, bytes calldata proof) external; + + /** + * @notice Starts thawing a signer to be de-authorized + * @dev Thawing a signer signals that signatures from that signer will soon be deemed invalid. + * Once a signer is thawed, they should be viewed as revoked regardless of their revocation status. + * If a signer is already thawing and this function is called, the thawing period is reset. + * Requirements: + * - `signer` must be authorized by the authorizer calling this function + * + * Emits a {SignerThawing} event + * @param signer The address of the signer to thaw + */ + function thawSigner(address signer) external; + + /** + * @notice Stops thawing a signer. + * @dev Requirements: + * - `signer` must be thawing and authorized by the function caller + * + * Emits a {SignerThawCanceled} event + * @param signer The address of the signer to cancel thawing + */ + function cancelThawSigner(address signer) external; + + /** + * @notice Revokes a signer if thawed. + * @dev Requirements: + * - `signer` must be thawed and authorized by the function caller + * + * Emits a {SignerRevoked} event + * @param signer The address of the signer + */ + function revokeAuthorizedSigner(address signer) external; + + /** + * @notice Returns the timestamp at which the thawing period ends for a signer. + * Returns 0 if the signer is not thawing. + * @param signer The address of the signer + * @return The timestamp at which the thawing period ends + */ + function getThawEnd(address signer) external view returns (uint256); + + /** + * @notice Returns true if the signer is authorized by the authorizer + * @param authorizer The address of the authorizer + * @param signer The address of the signer + * @return true if the signer is authorized by the authorizer, false otherwise + */ + function isAuthorized(address authorizer, address signer) external view returns (bool); +} diff --git a/packages/horizon/contracts/interfaces/IGraphPayments.sol b/packages/horizon/contracts/interfaces/IGraphPayments.sol new file mode 100644 index 000000000..2fe37d86e --- /dev/null +++ b/packages/horizon/contracts/interfaces/IGraphPayments.sol @@ -0,0 +1,89 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +pragma solidity 0.8.27; + +/** + * @title Interface for the {GraphPayments} contract + * @notice This contract is part of the Graph Horizon payments protocol. It's designed + * to pull funds (GRT) from the {PaymentsEscrow} and distribute them according to a + * set of pre established rules. + * @custom:security-contact Please email security+contracts@thegraph.com if you find any + * bugs. We may have an active bug bounty program. + */ +interface IGraphPayments { + /** + * @notice Types of payments that are supported by the payments protocol + * @dev + */ + enum PaymentTypes { + QueryFee, + IndexingFee, + IndexingRewards + } + + /** + * @notice Emitted when a payment is collected + * @param paymentType The type of payment as defined in {IGraphPayments} + * @param payer The address of the payer + * @param receiver The address of the receiver + * @param dataService The address of the data service + * @param tokens The total amount of tokens being collected + * @param tokensProtocol Amount of tokens charged as protocol tax + * @param tokensDataService Amount of tokens for the data service + * @param tokensDelegationPool Amount of tokens for delegators + * @param tokensReceiver Amount of tokens for the receiver + * @param receiverDestination The address where the receiver's payment cut is sent. + */ + event GraphPaymentCollected( + PaymentTypes indexed paymentType, + address indexed payer, + address receiver, + address indexed dataService, + uint256 tokens, + uint256 tokensProtocol, + uint256 tokensDataService, + uint256 tokensDelegationPool, + uint256 tokensReceiver, + address receiverDestination + ); + + /** + * @notice Thrown when the protocol payment cut is invalid + * @param protocolPaymentCut The protocol payment cut + */ + error GraphPaymentsInvalidProtocolPaymentCut(uint256 protocolPaymentCut); + + /** + * @notice Thrown when trying to use a cut that is not expressed in PPM + * @param cut The cut + */ + error GraphPaymentsInvalidCut(uint256 cut); + + /** + * @notice Initialize the contract + */ + function initialize() external; + + /** + * @notice Collects funds from a payer. + * It will pay cuts to all relevant parties and forward the rest to the receiver destination address. If the + * destination address is zero the funds are automatically staked to the receiver. Note that the receiver + * destination address can be set to the receiver address to collect funds on the receiver without re-staking. + * + * Note that the collected amount can be zero. + * + * @param paymentType The type of payment as defined in {IGraphPayments} + * @param receiver The address of the receiver + * @param tokens The amount of tokens being collected. + * @param dataService The address of the data service + * @param dataServiceCut The data service cut in PPM + * @param receiverDestination The address where the receiver's payment cut is sent. + */ + function collect( + PaymentTypes paymentType, + address receiver, + uint256 tokens, + address dataService, + uint256 dataServiceCut, + address receiverDestination + ) external; +} diff --git a/packages/horizon/contracts/interfaces/IGraphProxyAdmin.sol b/packages/horizon/contracts/interfaces/IGraphProxyAdmin.sol new file mode 100644 index 000000000..7ffe0487f --- /dev/null +++ b/packages/horizon/contracts/interfaces/IGraphProxyAdmin.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity 0.8.27; + +/** + * @title IGraphProxyAdmin + * @dev Empty interface to allow the GraphProxyAdmin contract to be used + * in the GraphDirectory contract. + * @custom:security-contact Please email security+contracts@thegraph.com if you find any + * bugs. We may have an active bug bounty program. + */ +interface IGraphProxyAdmin {} diff --git a/packages/horizon/contracts/interfaces/IGraphTallyCollector.sol b/packages/horizon/contracts/interfaces/IGraphTallyCollector.sol new file mode 100644 index 000000000..cb665bda5 --- /dev/null +++ b/packages/horizon/contracts/interfaces/IGraphTallyCollector.sol @@ -0,0 +1,136 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +pragma solidity 0.8.27; + +import { IPaymentsCollector } from "./IPaymentsCollector.sol"; +import { IGraphPayments } from "./IGraphPayments.sol"; + +/** + * @title Interface for the {GraphTallyCollector} contract + * @dev Implements the {IPaymentCollector} interface as defined by the Graph + * Horizon payments protocol. + * @notice Implements a payments collector contract that can be used to collect + * payments using a GraphTally RAV (Receipt Aggregate Voucher). + * @custom:security-contact Please email security+contracts@thegraph.com if you find any + * bugs. We may have an active bug bounty program. + */ +interface IGraphTallyCollector is IPaymentsCollector { + /** + * @notice The Receipt Aggregate Voucher (RAV) struct + * @param collectionId The ID of the collection "bucket" the RAV belongs to. Note that multiple RAVs can be collected for the same collection id. + * @param payer The address of the payer the RAV was issued by + * @param serviceProvider The address of the service provider the RAV was issued to + * @param dataService The address of the data service the RAV was issued to + * @param timestampNs The RAV timestamp, indicating the latest GraphTally Receipt in the RAV + * @param valueAggregate The total amount owed to the service provider since the beginning of the payer-service provider relationship, including all debt that is already paid for. + * @param metadata Arbitrary metadata to extend functionality if a data service requires it + */ + struct ReceiptAggregateVoucher { + bytes32 collectionId; + address payer; + address serviceProvider; + address dataService; + uint64 timestampNs; + uint128 valueAggregate; + bytes metadata; + } + + /** + * @notice A struct representing a signed RAV + * @param rav The RAV + * @param signature The signature of the RAV - 65 bytes: r (32 Bytes) || s (32 Bytes) || v (1 Byte) + */ + struct SignedRAV { + ReceiptAggregateVoucher rav; + bytes signature; + } + + /** + * @notice Emitted when a RAV is collected + * @param collectionId The ID of the collection "bucket" the RAV belongs to. + * @param payer The address of the payer + * @param dataService The address of the data service + * @param serviceProvider The address of the service provider + * @param timestampNs The timestamp of the RAV + * @param valueAggregate The total amount owed to the service provider + * @param metadata Arbitrary metadata + * @param signature The signature of the RAV + */ + event RAVCollected( + bytes32 indexed collectionId, + address indexed payer, + address serviceProvider, + address indexed dataService, + uint64 timestampNs, + uint128 valueAggregate, + bytes metadata, + bytes signature + ); + + /** + * @notice Thrown when the RAV signer is invalid + */ + error GraphTallyCollectorInvalidRAVSigner(); + + /** + * @notice Thrown when the RAV is for a data service the service provider has no provision for + * @param dataService The address of the data service + */ + error GraphTallyCollectorUnauthorizedDataService(address dataService); + + /** + * @notice Thrown when the caller is not the data service the RAV was issued to + * @param caller The address of the caller + * @param dataService The address of the data service + */ + error GraphTallyCollectorCallerNotDataService(address caller, address dataService); + + /** + * @notice Thrown when the tokens collected are inconsistent with the collection history + * Each RAV should have a value greater than the previous one + * @param tokens The amount of tokens in the RAV + * @param tokensCollected The amount of tokens already collected + */ + error GraphTallyCollectorInconsistentRAVTokens(uint256 tokens, uint256 tokensCollected); + + /** + * @notice Thrown when the attempting to collect more tokens than what it's owed + * @param tokensToCollect The amount of tokens to collect + * @param maxTokensToCollect The maximum amount of tokens to collect + */ + error GraphTallyCollectorInvalidTokensToCollectAmount(uint256 tokensToCollect, uint256 maxTokensToCollect); + + /** + * @notice See {IPaymentsCollector.collect} + * This variant adds the ability to partially collect a RAV by specifying the amount of tokens to collect. + * + * Requirements: + * - The amount of tokens to collect must be less than or equal to the total amount of tokens in the RAV minus + * the tokens already collected. + * @param paymentType The payment type to collect + * @param data Additional data required for the payment collection. Encoded as follows: + * - SignedRAV `signedRAV`: The signed RAV + * - uint256 `dataServiceCut`: The data service cut in PPM + * - address `receiverDestination`: The address where the receiver's payment should be sent. + * @param tokensToCollect The amount of tokens to collect + * @return The amount of tokens collected + */ + function collect( + IGraphPayments.PaymentTypes paymentType, + bytes calldata data, + uint256 tokensToCollect + ) external returns (uint256); + + /** + * @dev Recovers the signer address of a signed ReceiptAggregateVoucher (RAV). + * @param signedRAV The SignedRAV containing the RAV and its signature. + * @return The address of the signer. + */ + function recoverRAVSigner(SignedRAV calldata signedRAV) external view returns (address); + + /** + * @dev Computes the hash of a ReceiptAggregateVoucher (RAV). + * @param rav The RAV for which to compute the hash. + * @return The hash of the RAV. + */ + function encodeRAV(ReceiptAggregateVoucher calldata rav) external view returns (bytes32); +} diff --git a/packages/horizon/contracts/interfaces/IHorizonStaking.sol b/packages/horizon/contracts/interfaces/IHorizonStaking.sol new file mode 100644 index 000000000..0ba4e26b3 --- /dev/null +++ b/packages/horizon/contracts/interfaces/IHorizonStaking.sol @@ -0,0 +1,18 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity 0.8.27; + +import { IHorizonStakingTypes } from "./internal/IHorizonStakingTypes.sol"; +import { IHorizonStakingMain } from "./internal/IHorizonStakingMain.sol"; +import { IHorizonStakingBase } from "./internal/IHorizonStakingBase.sol"; +import { IHorizonStakingExtension } from "./internal/IHorizonStakingExtension.sol"; + +/** + * @title Complete interface for the Horizon Staking contract + * @notice This interface exposes all functions implemented by the {HorizonStaking} contract and its extension + * {HorizonStakingExtension} as well as the custom data types used by the contract. + * @dev Use this interface to interact with the Horizon Staking contract. + * @custom:security-contact Please email security+contracts@thegraph.com if you find any + * bugs. We may have an active bug bounty program. + */ +interface IHorizonStaking is IHorizonStakingTypes, IHorizonStakingBase, IHorizonStakingMain, IHorizonStakingExtension {} diff --git a/packages/horizon/contracts/interfaces/IPaymentsCollector.sol b/packages/horizon/contracts/interfaces/IPaymentsCollector.sol new file mode 100644 index 000000000..d37688462 --- /dev/null +++ b/packages/horizon/contracts/interfaces/IPaymentsCollector.sol @@ -0,0 +1,50 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity 0.8.27; + +import { IGraphPayments } from "./IGraphPayments.sol"; + +/** + * @title Interface for a payments collector contract as defined by Graph Horizon payments protocol + * @notice Contracts implementing this interface can be used with the payments protocol. First, a payer must + * approve the collector to collect payments on their behalf. Only then can payment collection be initiated + * using the collector contract. + * + * @dev It's important to note that it's the collector contract's responsibility to validate the payment + * request is legitimate. + * @custom:security-contact Please email security+contracts@thegraph.com if you find any + * bugs. We may have an active bug bounty program. + */ +interface IPaymentsCollector { + /** + * @notice Emitted when a payment is collected + * @param paymentType The payment type collected as defined by {IGraphPayments} + * @param collectionId The id for the collection. Can be used at the discretion of the collector to group multiple payments. + * @param payer The address of the payer + * @param receiver The address of the receiver + * @param dataService The address of the data service + * @param tokens The amount of tokens being collected + */ + event PaymentCollected( + IGraphPayments.PaymentTypes paymentType, + bytes32 indexed collectionId, + address indexed payer, + address receiver, + address indexed dataService, + uint256 tokens + ); + + /** + * @notice Initiate a payment collection through the payments protocol + * @dev This function should require the caller to present some form of evidence of the payer's debt to + * the receiver. The collector should validate this evidence and, if valid, collect the payment. + * + * Emits a {PaymentCollected} event + * + * @param paymentType The payment type to collect, as defined by {IGraphPayments} + * @param data Additional data required for the payment collection. Will vary depending on the collector + * implementation. + * @return The amount of tokens collected + */ + function collect(IGraphPayments.PaymentTypes paymentType, bytes memory data) external returns (uint256); +} diff --git a/packages/horizon/contracts/interfaces/IPaymentsEscrow.sol b/packages/horizon/contracts/interfaces/IPaymentsEscrow.sol new file mode 100644 index 000000000..eb3b262e8 --- /dev/null +++ b/packages/horizon/contracts/interfaces/IPaymentsEscrow.sol @@ -0,0 +1,247 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +pragma solidity 0.8.27; + +import { IGraphPayments } from "./IGraphPayments.sol"; + +/** + * @title Interface for the {PaymentsEscrow} contract + * @notice This contract is part of the Graph Horizon payments protocol. It holds the funds (GRT) + * for payments made through the payments protocol for services provided + * via a Graph Horizon data service. + * + * Payers deposit funds on the escrow, signalling their ability to pay for a service, and only + * being able to retrieve them after a thawing period. Receivers collect funds from the escrow, + * provided the payer has authorized them. The payer authorization is delegated to a payment + * collector contract which implements the {IPaymentsCollector} interface. + * @custom:security-contact Please email security+contracts@thegraph.com if you find any + * bugs. We may have an active bug bounty program. + */ +interface IPaymentsEscrow { + /** + * @notice Escrow account for a payer-collector-receiver tuple + * @param balance The total token balance for the payer-collector-receiver tuple + * @param tokensThawing The amount of tokens currently being thawed + * @param thawEndTimestamp The timestamp at which thawing period ends (zero if not thawing) + */ + struct EscrowAccount { + uint256 balance; + uint256 tokensThawing; + uint256 thawEndTimestamp; + } + + /** + * @notice Emitted when a payer deposits funds into the escrow for a payer-collector-receiver tuple + * @param payer The address of the payer + * @param collector The address of the collector + * @param receiver The address of the receiver + * @param tokens The amount of tokens deposited + */ + event Deposit(address indexed payer, address indexed collector, address indexed receiver, uint256 tokens); + + /** + * @notice Emitted when a payer cancels an escrow thawing + * @param payer The address of the payer + * @param collector The address of the collector + * @param receiver The address of the receiver + * @param tokensThawing The amount of tokens that were being thawed + * @param thawEndTimestamp The timestamp at which the thawing period was ending + */ + event CancelThaw( + address indexed payer, + address indexed collector, + address indexed receiver, + uint256 tokensThawing, + uint256 thawEndTimestamp + ); + + /** + * @notice Emitted when a payer thaws funds from the escrow for a payer-collector-receiver tuple + * @param payer The address of the payer + * @param collector The address of the collector + * @param receiver The address of the receiver + * @param tokens The amount of tokens being thawed + * @param thawEndTimestamp The timestamp at which the thawing period ends + */ + event Thaw( + address indexed payer, + address indexed collector, + address indexed receiver, + uint256 tokens, + uint256 thawEndTimestamp + ); + + /** + * @notice Emitted when a payer withdraws funds from the escrow for a payer-collector-receiver tuple + * @param payer The address of the payer + * @param collector The address of the collector + * @param receiver The address of the receiver + * @param tokens The amount of tokens withdrawn + */ + event Withdraw(address indexed payer, address indexed collector, address indexed receiver, uint256 tokens); + + /** + * @notice Emitted when a collector collects funds from the escrow for a payer-collector-receiver tuple + * @param paymentType The type of payment being collected as defined in the {IGraphPayments} interface + * @param payer The address of the payer + * @param collector The address of the collector + * @param receiver The address of the receiver + * @param tokens The amount of tokens collected + * @param receiverDestination The address where the receiver's payment should be sent. + */ + event EscrowCollected( + IGraphPayments.PaymentTypes indexed paymentType, + address indexed payer, + address indexed collector, + address receiver, + uint256 tokens, + address receiverDestination + ); + + // -- Errors -- + + /** + * @notice Thrown when a protected function is called and the contract is paused. + */ + error PaymentsEscrowIsPaused(); + + /** + * @notice Thrown when the available balance is insufficient to perform an operation + * @param balance The current balance + * @param minBalance The minimum required balance + */ + error PaymentsEscrowInsufficientBalance(uint256 balance, uint256 minBalance); + + /** + * @notice Thrown when a thawing is expected to be in progress but it is not + */ + error PaymentsEscrowNotThawing(); + + /** + * @notice Thrown when a thawing is still in progress + * @param currentTimestamp The current timestamp + * @param thawEndTimestamp The timestamp at which the thawing period ends + */ + error PaymentsEscrowStillThawing(uint256 currentTimestamp, uint256 thawEndTimestamp); + + /** + * @notice Thrown when setting the thawing period to a value greater than the maximum + * @param thawingPeriod The thawing period + * @param maxWaitPeriod The maximum wait period + */ + error PaymentsEscrowThawingPeriodTooLong(uint256 thawingPeriod, uint256 maxWaitPeriod); + + /** + * @notice Thrown when the contract balance is not consistent with the collection amount + * @param balanceBefore The balance before the collection + * @param balanceAfter The balance after the collection + * @param tokens The amount of tokens collected + */ + error PaymentsEscrowInconsistentCollection(uint256 balanceBefore, uint256 balanceAfter, uint256 tokens); + + /** + * @notice Thrown when operating a zero token amount is not allowed. + */ + error PaymentsEscrowInvalidZeroTokens(); + + /** + * @notice Initialize the contract + */ + function initialize() external; + + /** + * @notice Deposits funds into the escrow for a payer-collector-receiver tuple, where + * the payer is the transaction caller. + * @dev Emits a {Deposit} event + * @param collector The address of the collector + * @param receiver The address of the receiver + * @param tokens The amount of tokens to deposit + */ + function deposit(address collector, address receiver, uint256 tokens) external; + + /** + * @notice Deposits funds into the escrow for a payer-collector-receiver tuple, where + * the payer can be specified. + * @dev Emits a {Deposit} event + * @param payer The address of the payer + * @param collector The address of the collector + * @param receiver The address of the receiver + * @param tokens The amount of tokens to deposit + */ + function depositTo(address payer, address collector, address receiver, uint256 tokens) external; + + /** + * @notice Thaw a specific amount of escrow from a payer-collector-receiver's escrow account. + * The payer is the transaction caller. + * Note that repeated calls to this function will overwrite the previous thawing amount + * and reset the thawing period. + * @dev Requirements: + * - `tokens` must be less than or equal to the available balance + * + * Emits a {Thaw} event. + * + * @param collector The address of the collector + * @param receiver The address of the receiver + * @param tokens The amount of tokens to thaw + */ + function thaw(address collector, address receiver, uint256 tokens) external; + + /** + * @notice Cancels the thawing of escrow from a payer-collector-receiver's escrow account. + * @param collector The address of the collector + * @param receiver The address of the receiver + * @dev Requirements: + * - The payer must be thawing funds + * Emits a {CancelThaw} event. + */ + function cancelThaw(address collector, address receiver) external; + + /** + * @notice Withdraws all thawed escrow from a payer-collector-receiver's escrow account. + * The payer is the transaction caller. + * Note that the withdrawn funds might be less than the thawed amount if there were + * payment collections in the meantime. + * @dev Requirements: + * - Funds must be thawed + * + * Emits a {Withdraw} event + * + * @param collector The address of the collector + * @param receiver The address of the receiver + */ + function withdraw(address collector, address receiver) external; + + /** + * @notice Collects funds from the payer-collector-receiver's escrow and sends them to {GraphPayments} for + * distribution using the Graph Horizon Payments protocol. + * The function will revert if there are not enough funds in the escrow. + * + * Emits an {EscrowCollected} event + * + * @param paymentType The type of payment being collected as defined in the {IGraphPayments} interface + * @param payer The address of the payer + * @param receiver The address of the receiver + * @param tokens The amount of tokens to collect + * @param dataService The address of the data service + * @param dataServiceCut The data service cut in PPM that {GraphPayments} should send + * @param receiverDestination The address where the receiver's payment should be sent. + */ + function collect( + IGraphPayments.PaymentTypes paymentType, + address payer, + address receiver, + uint256 tokens, + address dataService, + uint256 dataServiceCut, + address receiverDestination + ) external; + + /** + * @notice Get the balance of a payer-collector-receiver tuple + * This function will return 0 if the current balance is less than the amount of funds being thawed. + * @param payer The address of the payer + * @param collector The address of the collector + * @param receiver The address of the receiver + * @return The balance of the payer-collector-receiver tuple + */ + function getBalance(address payer, address collector, address receiver) external view returns (uint256); +} diff --git a/packages/horizon/contracts/interfaces/internal/IHorizonStakingBase.sol b/packages/horizon/contracts/interfaces/internal/IHorizonStakingBase.sol new file mode 100644 index 000000000..fb642fe84 --- /dev/null +++ b/packages/horizon/contracts/interfaces/internal/IHorizonStakingBase.sol @@ -0,0 +1,208 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity 0.8.27; + +import { IHorizonStakingTypes } from "./IHorizonStakingTypes.sol"; +import { IGraphPayments } from "../IGraphPayments.sol"; + +import { LinkedList } from "../../libraries/LinkedList.sol"; + +/** + * @title Interface for the {HorizonStakingBase} contract. + * @notice Provides getters for {HorizonStaking} and {HorizonStakingExtension} storage variables. + * @dev Most functions operate over {HorizonStaking} provisions. To uniquely identify a provision + * functions take `serviceProvider` and `verifier` addresses. + * @custom:security-contact Please email security+contracts@thegraph.com if you find any + * bugs. We may have an active bug bounty program. + */ +interface IHorizonStakingBase { + /** + * @notice Emitted when a service provider stakes tokens. + * @dev TRANSITION PERIOD: After transition period move to IHorizonStakingMain. Temporarily it + * needs to be here since it's emitted by {_stake} which is used by both {HorizonStaking} + * and {HorizonStakingExtension}. + * @param serviceProvider The address of the service provider. + * @param tokens The amount of tokens staked. + */ + event HorizonStakeDeposited(address indexed serviceProvider, uint256 tokens); + + /** + * @notice Thrown when using an invalid thaw request type. + */ + error HorizonStakingInvalidThawRequestType(); + + /** + * @notice Gets the details of a service provider. + * @param serviceProvider The address of the service provider. + * @return The service provider details. + */ + function getServiceProvider( + address serviceProvider + ) external view returns (IHorizonStakingTypes.ServiceProvider memory); + + /** + * @notice Gets the stake of a service provider. + * @param serviceProvider The address of the service provider. + * @return The amount of tokens staked. + */ + function getStake(address serviceProvider) external view returns (uint256); + + /** + * @notice Gets the service provider's idle stake which is the stake that is not being + * used for any provision. Note that this only includes service provider's self stake. + * @param serviceProvider The address of the service provider. + * @return The amount of tokens that are idle. + */ + function getIdleStake(address serviceProvider) external view returns (uint256); + + /** + * @notice Gets the details of delegation pool. + * @param serviceProvider The address of the service provider. + * @param verifier The address of the verifier. + * @return The delegation pool details. + */ + function getDelegationPool( + address serviceProvider, + address verifier + ) external view returns (IHorizonStakingTypes.DelegationPool memory); + + /** + * @notice Gets the details of a delegation. + * @param serviceProvider The address of the service provider. + * @param verifier The address of the verifier. + * @param delegator The address of the delegator. + * @return The delegation details. + */ + function getDelegation( + address serviceProvider, + address verifier, + address delegator + ) external view returns (IHorizonStakingTypes.Delegation memory); + + /** + * @notice Gets the delegation fee cut for a payment type. + * @param serviceProvider The address of the service provider. + * @param verifier The address of the verifier. + * @param paymentType The payment type as defined by {IGraphPayments.PaymentTypes}. + * @return The delegation fee cut in PPM. + */ + function getDelegationFeeCut( + address serviceProvider, + address verifier, + IGraphPayments.PaymentTypes paymentType + ) external view returns (uint256); + + /** + * @notice Gets the details of a provision. + * @param serviceProvider The address of the service provider. + * @param verifier The address of the verifier. + * @return The provision details. + */ + function getProvision( + address serviceProvider, + address verifier + ) external view returns (IHorizonStakingTypes.Provision memory); + + /** + * @notice Gets the tokens available in a provision. + * Tokens available are the tokens in a provision that are not thawing. Includes service + * provider's and delegator's stake. + * + * Allows specifying a `delegationRatio` which caps the amount of delegated tokens that are + * considered available. + * + * @param serviceProvider The address of the service provider. + * @param verifier The address of the verifier. + * @param delegationRatio The delegation ratio. + * @return The amount of tokens available. + */ + function getTokensAvailable( + address serviceProvider, + address verifier, + uint32 delegationRatio + ) external view returns (uint256); + + /** + * @notice Gets the service provider's tokens available in a provision. + * @dev Calculated as the tokens available minus the tokens thawing. + * @param serviceProvider The address of the service provider. + * @param verifier The address of the verifier. + * @return The amount of tokens available. + */ + function getProviderTokensAvailable(address serviceProvider, address verifier) external view returns (uint256); + + /** + * @notice Gets the delegator's tokens available in a provision. + * @dev Calculated as the tokens available minus the tokens thawing. + * @param serviceProvider The address of the service provider. + * @param verifier The address of the verifier. + * @return The amount of tokens available. + */ + function getDelegatedTokensAvailable(address serviceProvider, address verifier) external view returns (uint256); + + /** + * @notice Gets a thaw request. + * @param thawRequestType The type of thaw request. + * @param thawRequestId The id of the thaw request. + * @return The thaw request details. + */ + function getThawRequest( + IHorizonStakingTypes.ThawRequestType thawRequestType, + bytes32 thawRequestId + ) external view returns (IHorizonStakingTypes.ThawRequest memory); + + /** + * @notice Gets the metadata of a thaw request list. + * Service provider and delegators each have their own thaw request list per provision. + * Metadata includes the head and tail of the list, plus the total number of thaw requests. + * @param thawRequestType The type of thaw request. + * @param serviceProvider The address of the service provider. + * @param verifier The address of the verifier. + * @param owner The owner of the thaw requests. Use either the service provider or delegator address. + * @return The thaw requests list metadata. + */ + function getThawRequestList( + IHorizonStakingTypes.ThawRequestType thawRequestType, + address serviceProvider, + address verifier, + address owner + ) external view returns (LinkedList.List memory); + + /** + * @notice Gets the amount of thawed tokens that can be releasedfor a given provision. + * @dev Note that the value returned by this function does not return the total amount of thawed tokens + * but only those that can be released. If thaw requests are created with different thawing periods it's + * possible that an unexpired thaw request temporarily blocks the release of other ones that have already + * expired. This function will stop counting when it encounters the first thaw request that is not yet expired. + * @param thawRequestType The type of thaw request. + * @param serviceProvider The address of the service provider. + * @param verifier The address of the verifier. + * @param owner The owner of the thaw requests. Use either the service provider or delegator address. + * @return The amount of thawed tokens. + */ + function getThawedTokens( + IHorizonStakingTypes.ThawRequestType thawRequestType, + address serviceProvider, + address verifier, + address owner + ) external view returns (uint256); + + /** + * @notice Gets the maximum allowed thawing period for a provision. + * @return The maximum allowed thawing period in seconds. + */ + function getMaxThawingPeriod() external view returns (uint64); + + /** + * @notice Return true if the verifier is an allowed locked verifier. + * @param verifier Address of the verifier + * @return True if verifier is allowed locked verifier, false otherwise + */ + function isAllowedLockedVerifier(address verifier) external view returns (bool); + + /** + * @notice Return true if delegation slashing is enabled, false otherwise. + * @return True if delegation slashing is enabled, false otherwise + */ + function isDelegationSlashingEnabled() external view returns (bool); +} diff --git a/packages/horizon/contracts/interfaces/internal/IHorizonStakingExtension.sol b/packages/horizon/contracts/interfaces/internal/IHorizonStakingExtension.sol new file mode 100644 index 000000000..de39ab52c --- /dev/null +++ b/packages/horizon/contracts/interfaces/internal/IHorizonStakingExtension.sol @@ -0,0 +1,211 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity 0.8.27; + +import { IRewardsIssuer } from "@graphprotocol/contracts/contracts/rewards/IRewardsIssuer.sol"; + +/** + * @title Interface for {HorizonStakingExtension} contract. + * @notice Provides functions for managing legacy allocations. + * @custom:security-contact Please email security+contracts@thegraph.com if you find any + * bugs. We may have an active bug bounty program. + */ +interface IHorizonStakingExtension is IRewardsIssuer { + /** + * @dev Allocate GRT tokens for the purpose of serving queries of a subgraph deployment + * An allocation is created in the allocate() function and closed in closeAllocation() + * @param indexer The indexer address + * @param subgraphDeploymentID The subgraph deployment ID + * @param tokens The amount of tokens allocated to the subgraph deployment + * @param createdAtEpoch The epoch when the allocation was created + * @param closedAtEpoch The epoch when the allocation was closed + * @param collectedFees The amount of collected fees for the allocation + * @param __DEPRECATED_effectiveAllocation Deprecated field. + * @param accRewardsPerAllocatedToken Snapshot used for reward calculation + * @param distributedRebates The amount of collected rebates that have been rebated + */ + struct Allocation { + address indexer; + bytes32 subgraphDeploymentID; + uint256 tokens; + uint256 createdAtEpoch; + uint256 closedAtEpoch; + uint256 collectedFees; + uint256 __DEPRECATED_effectiveAllocation; + uint256 accRewardsPerAllocatedToken; + uint256 distributedRebates; + } + + /** + * @dev Possible states an allocation can be. + * States: + * - Null = indexer == address(0) + * - Active = not Null && tokens > 0 + * - Closed = Active && closedAtEpoch != 0 + */ + enum AllocationState { + Null, + Active, + Closed + } + + /** + * @dev Emitted when `indexer` close an allocation in `epoch` for `allocationID`. + * An amount of `tokens` get unallocated from `subgraphDeploymentID`. + * This event also emits the POI (proof of indexing) submitted by the indexer. + * `isPublic` is true if the sender was someone other than the indexer. + * @param indexer The indexer address + * @param subgraphDeploymentID The subgraph deployment ID + * @param epoch The protocol epoch the allocation was closed on + * @param tokens The amount of tokens unallocated from the allocation + * @param allocationID The allocation identifier + * @param sender The address closing the allocation + * @param poi The proof of indexing submitted by the sender + * @param isPublic True if the allocation was force closed by someone other than the indexer/operator + */ + event AllocationClosed( + address indexed indexer, + bytes32 indexed subgraphDeploymentID, + uint256 epoch, + uint256 tokens, + address indexed allocationID, + address sender, + bytes32 poi, + bool isPublic + ); + + /** + * @dev Emitted when `indexer` collects a rebate on `subgraphDeploymentID` for `allocationID`. + * `epoch` is the protocol epoch the rebate was collected on + * The rebate is for `tokens` amount which are being provided by `assetHolder`; `queryFees` + * is the amount up for rebate after `curationFees` are distributed and `protocolTax` is burnt. + * `queryRebates` is the amount distributed to the `indexer` with `delegationFees` collected + * and sent to the delegation pool. + * @param assetHolder The address of the asset holder, the entity paying the query fees + * @param indexer The indexer address + * @param subgraphDeploymentID The subgraph deployment ID + * @param allocationID The allocation identifier + * @param epoch The protocol epoch the rebate was collected on + * @param tokens The amount of tokens collected + * @param protocolTax The amount of tokens burnt as protocol tax + * @param curationFees The amount of tokens distributed to the curation pool + * @param queryFees The amount of tokens collected as query fees + * @param queryRebates The amount of tokens distributed to the indexer + * @param delegationRewards The amount of tokens collected from the delegation pool + */ + event RebateCollected( + address assetHolder, + address indexed indexer, + bytes32 indexed subgraphDeploymentID, + address indexed allocationID, + uint256 epoch, + uint256 tokens, + uint256 protocolTax, + uint256 curationFees, + uint256 queryFees, + uint256 queryRebates, + uint256 delegationRewards + ); + + /** + * @dev Emitted when `indexer` was slashed for a total of `tokens` amount. + * Tracks `reward` amount of tokens given to `beneficiary`. + * @param indexer The indexer address + * @param tokens The amount of tokens slashed + * @param reward The amount of reward tokens to send to a beneficiary + * @param beneficiary The address of a beneficiary to receive a reward for the slashing + */ + event StakeSlashed(address indexed indexer, uint256 tokens, uint256 reward, address beneficiary); + + /** + * @notice Close an allocation and free the staked tokens. + * To be eligible for rewards a proof of indexing must be presented. + * Presenting a bad proof is subject to slashable condition. + * To opt out of rewards set _poi to 0x0 + * @param allocationID The allocation identifier + * @param poi Proof of indexing submitted for the allocated period + */ + function closeAllocation(address allocationID, bytes32 poi) external; + + /** + * @dev Collect and rebate query fees to the indexer + * This function will accept calls with zero tokens. + * We use an exponential rebate formula to calculate the amount of tokens to rebate to the indexer. + * This implementation allows collecting multiple times on the same allocation, keeping track of the + * total amount rebated, the total amount collected and compensating the indexer for the difference. + * @param tokens Amount of tokens to collect + * @param allocationID Allocation where the tokens will be assigned + */ + function collect(uint256 tokens, address allocationID) external; + + /** + * @notice Slash the indexer stake. Delegated tokens are not subject to slashing. + * Note that depending on the state of the indexer's stake, the slashed amount might be smaller than the + * requested slash amount. This can happen if the indexer has moved a significant part of their stake to + * a provision. Any outstanding slashing amount should be settled using Horizon's slash function + * {IHorizonStaking.slash}. + * @dev Can only be called by the slasher role. + * @param indexer Address of indexer to slash + * @param tokens Amount of tokens to slash from the indexer stake + * @param reward Amount of reward tokens to send to a beneficiary + * @param beneficiary Address of a beneficiary to receive a reward for the slashing + */ + function legacySlash(address indexer, uint256 tokens, uint256 reward, address beneficiary) external; + + /** + * @notice (Legacy) Return true if operator is allowed for the service provider on the subgraph data service. + * @param operator Address of the operator + * @param indexer Address of the service provider + * @return True if operator is allowed for indexer, false otherwise + */ + function isOperator(address operator, address indexer) external view returns (bool); + + /** + * @notice Getter that returns if an indexer has any stake. + * @param indexer Address of the indexer + * @return True if indexer has staked tokens + */ + function hasStake(address indexer) external view returns (bool); + + /** + * @notice Get the total amount of tokens staked by the indexer. + * @param indexer Address of the indexer + * @return Amount of tokens staked by the indexer + */ + function getIndexerStakedTokens(address indexer) external view returns (uint256); + + /** + * @notice Return the allocation by ID. + * @param allocationID Address used as allocation identifier + * @return Allocation data + */ + function getAllocation(address allocationID) external view returns (Allocation memory); + + /** + * @notice Return the current state of an allocation + * @param allocationID Allocation identifier + * @return AllocationState enum with the state of the allocation + */ + function getAllocationState(address allocationID) external view returns (AllocationState); + + /** + * @notice Return if allocationID is used. + * @param allocationID Address used as signer by the indexer for an allocation + * @return True if allocationID already used + */ + function isAllocation(address allocationID) external view returns (bool); + + /** + * @notice Return the time in blocks to unstake + * Deprecated, now enforced by each data service (verifier) + * @return Thawing period in blocks + */ + function __DEPRECATED_getThawingPeriod() external view returns (uint64); + + /** + * @notice Return the address of the subgraph data service. + * @dev TRANSITION PERIOD: After transition period move to main HorizonStaking contract + * @return Address of the subgraph data service + */ + function getSubgraphService() external view returns (address); +} diff --git a/packages/horizon/contracts/interfaces/internal/IHorizonStakingMain.sol b/packages/horizon/contracts/interfaces/internal/IHorizonStakingMain.sol new file mode 100644 index 000000000..71cf7b3b4 --- /dev/null +++ b/packages/horizon/contracts/interfaces/internal/IHorizonStakingMain.sol @@ -0,0 +1,1007 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity 0.8.27; + +import { IGraphPayments } from "../../interfaces/IGraphPayments.sol"; +import { IHorizonStakingTypes } from "./IHorizonStakingTypes.sol"; + +/** + * @title Inferface for the {HorizonStaking} contract. + * @notice Provides functions for managing stake, provisions, delegations, and slashing. + * @dev Note that this interface only includes the functions implemented by {HorizonStaking} contract, + * and not those implemented by {HorizonStakingExtension}. + * Do not use this interface to interface with the {HorizonStaking} contract, use {IHorizonStaking} for + * the complete interface. + * @dev Most functions operate over {HorizonStaking} provisions. To uniquely identify a provision + * functions take `serviceProvider` and `verifier` addresses. + * @dev TRANSITION PERIOD: After transition period rename to IHorizonStaking. + * @custom:security-contact Please email security+contracts@thegraph.com if you find any + * bugs. We may have an active bug bounty program. + */ +interface IHorizonStakingMain { + // -- Events: stake -- + + /** + * @notice Emitted when a service provider unstakes tokens during the transition period. + * @param serviceProvider The address of the service provider + * @param tokens The amount of tokens now locked (including previously locked tokens) + * @param until The block number until the stake is locked + */ + event HorizonStakeLocked(address indexed serviceProvider, uint256 tokens, uint256 until); + + /** + * @notice Emitted when a service provider withdraws tokens during the transition period. + * @param serviceProvider The address of the service provider + * @param tokens The amount of tokens withdrawn + */ + event HorizonStakeWithdrawn(address indexed serviceProvider, uint256 tokens); + + // -- Events: provision -- + + /** + * @notice Emitted when a service provider provisions staked tokens to a verifier. + * @param serviceProvider The address of the service provider + * @param verifier The address of the verifier + * @param tokens The amount of tokens provisioned + * @param maxVerifierCut The maximum cut, expressed in PPM of the slashed amount, that a verifier can take for themselves when slashing + * @param thawingPeriod The period in seconds that the tokens will be thawing before they can be removed from the provision + */ + event ProvisionCreated( + address indexed serviceProvider, + address indexed verifier, + uint256 tokens, + uint32 maxVerifierCut, + uint64 thawingPeriod + ); + + /** + * @notice Emitted whenever staked tokens are added to an existing provision + * @param serviceProvider The address of the service provider + * @param verifier The address of the verifier + * @param tokens The amount of tokens added to the provision + */ + event ProvisionIncreased(address indexed serviceProvider, address indexed verifier, uint256 tokens); + + /** + * @notice Emitted when a service provider thaws tokens from a provision. + * @param serviceProvider The address of the service provider + * @param verifier The address of the verifier + * @param tokens The amount of tokens thawed + */ + event ProvisionThawed(address indexed serviceProvider, address indexed verifier, uint256 tokens); + + /** + * @notice Emitted when a service provider removes tokens from a provision. + * @param serviceProvider The address of the service provider + * @param verifier The address of the verifier + * @param tokens The amount of tokens removed + */ + event TokensDeprovisioned(address indexed serviceProvider, address indexed verifier, uint256 tokens); + + /** + * @notice Emitted when a service provider stages a provision parameter update. + * @param serviceProvider The address of the service provider + * @param verifier The address of the verifier + * @param maxVerifierCut The proposed maximum cut, expressed in PPM of the slashed amount, that a verifier can take for + * themselves when slashing + * @param thawingPeriod The proposed period in seconds that the tokens will be thawing before they can be removed from + * the provision + */ + event ProvisionParametersStaged( + address indexed serviceProvider, + address indexed verifier, + uint32 maxVerifierCut, + uint64 thawingPeriod + ); + + /** + * @notice Emitted when a service provider accepts a staged provision parameter update. + * @param serviceProvider The address of the service provider + * @param verifier The address of the verifier + * @param maxVerifierCut The new maximum cut, expressed in PPM of the slashed amount, that a verifier can take for themselves + * when slashing + * @param thawingPeriod The new period in seconds that the tokens will be thawing before they can be removed from the provision + */ + event ProvisionParametersSet( + address indexed serviceProvider, + address indexed verifier, + uint32 maxVerifierCut, + uint64 thawingPeriod + ); + + /** + * @dev Emitted when an operator is allowed or denied by a service provider for a particular verifier + * @param serviceProvider The address of the service provider + * @param verifier The address of the verifier + * @param operator The address of the operator + * @param allowed Whether the operator is allowed or denied + */ + event OperatorSet( + address indexed serviceProvider, + address indexed verifier, + address indexed operator, + bool allowed + ); + + // -- Events: slashing -- + + /** + * @notice Emitted when a provision is slashed by a verifier. + * @param serviceProvider The address of the service provider + * @param verifier The address of the verifier + * @param tokens The amount of tokens slashed (note this only represents service provider's slashed stake) + */ + event ProvisionSlashed(address indexed serviceProvider, address indexed verifier, uint256 tokens); + + /** + * @notice Emitted when a delegation pool is slashed by a verifier. + * @param serviceProvider The address of the service provider + * @param verifier The address of the verifier + * @param tokens The amount of tokens slashed (note this only represents delegation pool's slashed stake) + */ + event DelegationSlashed(address indexed serviceProvider, address indexed verifier, uint256 tokens); + + /** + * @notice Emitted when a delegation pool would have been slashed by a verifier, but the slashing was skipped + * because delegation slashing global parameter is not enabled. + * @param serviceProvider The address of the service provider + * @param verifier The address of the verifier + * @param tokens The amount of tokens that would have been slashed (note this only represents delegation pool's slashed stake) + */ + event DelegationSlashingSkipped(address indexed serviceProvider, address indexed verifier, uint256 tokens); + + /** + * @notice Emitted when the verifier cut is sent to the verifier after slashing a provision. + * @param serviceProvider The address of the service provider + * @param verifier The address of the verifier + * @param destination The address where the verifier cut is sent + * @param tokens The amount of tokens sent to the verifier + */ + event VerifierTokensSent( + address indexed serviceProvider, + address indexed verifier, + address indexed destination, + uint256 tokens + ); + + // -- Events: delegation -- + + /** + * @notice Emitted when tokens are delegated to a provision. + * @param serviceProvider The address of the service provider + * @param verifier The address of the verifier + * @param delegator The address of the delegator + * @param tokens The amount of tokens delegated + * @param shares The amount of shares delegated + */ + event TokensDelegated( + address indexed serviceProvider, + address indexed verifier, + address indexed delegator, + uint256 tokens, + uint256 shares + ); + + /** + * @notice Emitted when a delegator undelegates tokens from a provision and starts + * thawing them. + * @param serviceProvider The address of the service provider + * @param verifier The address of the verifier + * @param delegator The address of the delegator + * @param tokens The amount of tokens undelegated + * @param shares The amount of shares undelegated + */ + event TokensUndelegated( + address indexed serviceProvider, + address indexed verifier, + address indexed delegator, + uint256 tokens, + uint256 shares + ); + + /** + * @notice Emitted when a delegator withdraws tokens from a provision after thawing. + * @param serviceProvider The address of the service provider + * @param verifier The address of the verifier + * @param delegator The address of the delegator + * @param tokens The amount of tokens withdrawn + */ + event DelegatedTokensWithdrawn( + address indexed serviceProvider, + address indexed verifier, + address indexed delegator, + uint256 tokens + ); + + /** + * @notice Emitted when `delegator` withdrew delegated `tokens` from `indexer` using `withdrawDelegated`. + * @dev This event is for the legacy `withdrawDelegated` function. + * @param indexer The address of the indexer + * @param delegator The address of the delegator + * @param tokens The amount of tokens withdrawn + */ + event StakeDelegatedWithdrawn(address indexed indexer, address indexed delegator, uint256 tokens); + + /** + * @notice Emitted when tokens are added to a delegation pool's reserve. + * @param serviceProvider The address of the service provider + * @param verifier The address of the verifier + * @param tokens The amount of tokens withdrawn + */ + event TokensToDelegationPoolAdded(address indexed serviceProvider, address indexed verifier, uint256 tokens); + + /** + * @notice Emitted when a service provider sets delegation fee cuts for a verifier. + * @param serviceProvider The address of the service provider + * @param verifier The address of the verifier + * @param paymentType The payment type for which the fee cut is set, as defined in {IGraphPayments} + * @param feeCut The fee cut set, in PPM + */ + event DelegationFeeCutSet( + address indexed serviceProvider, + address indexed verifier, + IGraphPayments.PaymentTypes indexed paymentType, + uint256 feeCut + ); + + // -- Events: thawing -- + + /** + * @notice Emitted when a thaw request is created. + * @dev Can be emitted by the service provider when thawing stake or by the delegator when undelegating. + * @param requestType The type of thaw request + * @param serviceProvider The address of the service provider + * @param verifier The address of the verifier + * @param owner The address of the owner of the thaw request. + * @param shares The amount of shares being thawed + * @param thawingUntil The timestamp until the stake is thawed + * @param thawRequestId The ID of the thaw request + * @param nonce The nonce of the thaw request + */ + event ThawRequestCreated( + IHorizonStakingTypes.ThawRequestType indexed requestType, + address indexed serviceProvider, + address indexed verifier, + address owner, + uint256 shares, + uint64 thawingUntil, + bytes32 thawRequestId, + uint256 nonce + ); + + /** + * @notice Emitted when a thaw request is fulfilled, meaning the stake is released. + * @param requestType The type of thaw request + * @param thawRequestId The ID of the thaw request + * @param tokens The amount of tokens being released + * @param shares The amount of shares being released + * @param thawingUntil The timestamp until the stake has thawed + * @param valid Whether the thaw request was valid at the time of fulfillment + */ + event ThawRequestFulfilled( + IHorizonStakingTypes.ThawRequestType indexed requestType, + bytes32 indexed thawRequestId, + uint256 tokens, + uint256 shares, + uint64 thawingUntil, + bool valid + ); + + /** + * @notice Emitted when a series of thaw requests are fulfilled. + * @param serviceProvider The address of the service provider + * @param verifier The address of the verifier + * @param owner The address of the owner of the thaw requests + * @param thawRequestsFulfilled The number of thaw requests fulfilled + * @param tokens The total amount of tokens being released + * @param requestType The type of thaw request + */ + event ThawRequestsFulfilled( + IHorizonStakingTypes.ThawRequestType indexed requestType, + address indexed serviceProvider, + address indexed verifier, + address owner, + uint256 thawRequestsFulfilled, + uint256 tokens + ); + + // -- Events: governance -- + + /** + * @notice Emitted when the global maximum thawing period allowed for provisions is set. + * @param maxThawingPeriod The new maximum thawing period + */ + event MaxThawingPeriodSet(uint64 maxThawingPeriod); + + /** + * @notice Emitted when a verifier is allowed or disallowed to be used for locked provisions. + * @param verifier The address of the verifier + * @param allowed Whether the verifier is allowed or disallowed + */ + event AllowedLockedVerifierSet(address indexed verifier, bool allowed); + + /** + * @notice Emitted when the legacy global thawing period is set to zero. + * @dev This marks the end of the transition period. + */ + event ThawingPeriodCleared(); + + /** + * @notice Emitted when the delegation slashing global flag is set. + */ + event DelegationSlashingEnabled(); + + // -- Errors: tokens + + /** + * @notice Thrown when operating a zero token amount is not allowed. + */ + error HorizonStakingInvalidZeroTokens(); + + /** + * @notice Thrown when a minimum token amount is required to operate but it's not met. + * @param tokens The actual token amount + * @param minRequired The minimum required token amount + */ + error HorizonStakingInsufficientTokens(uint256 tokens, uint256 minRequired); + + /** + * @notice Thrown when the amount of tokens exceeds the maximum allowed to operate. + * @param tokens The actual token amount + * @param maxTokens The maximum allowed token amount + */ + error HorizonStakingTooManyTokens(uint256 tokens, uint256 maxTokens); + + // -- Errors: provision -- + + /** + * @notice Thrown when attempting to operate with a provision that does not exist. + * @param serviceProvider The service provider address + * @param verifier The verifier address + */ + error HorizonStakingInvalidProvision(address serviceProvider, address verifier); + + /** + * @notice Thrown when the caller is not authorized to operate on a provision. + * @param caller The caller address + * @param serviceProvider The service provider address + * @param verifier The verifier address + */ + error HorizonStakingNotAuthorized(address serviceProvider, address verifier, address caller); + + /** + * @notice Thrown when attempting to create a provision with a verifier other than the + * subgraph data service. This restriction only applies during the transition period. + * @param verifier The verifier address + */ + error HorizonStakingInvalidVerifier(address verifier); + + /** + * @notice Thrown when attempting to create a provision with an invalid maximum verifier cut. + * @param maxVerifierCut The maximum verifier cut + */ + error HorizonStakingInvalidMaxVerifierCut(uint32 maxVerifierCut); + + /** + * @notice Thrown when attempting to create a provision with an invalid thawing period. + * @param thawingPeriod The thawing period + * @param maxThawingPeriod The maximum `thawingPeriod` allowed + */ + error HorizonStakingInvalidThawingPeriod(uint64 thawingPeriod, uint64 maxThawingPeriod); + + /** + * @notice Thrown when attempting to create a provision for a data service that already has a provision. + */ + error HorizonStakingProvisionAlreadyExists(); + + // -- Errors: stake -- + + /** + * @notice Thrown when the service provider has insufficient idle stake to operate. + * @param tokens The actual token amount + * @param minTokens The minimum required token amount + */ + error HorizonStakingInsufficientIdleStake(uint256 tokens, uint256 minTokens); + + /** + * @notice Thrown during the transition period when the service provider has insufficient stake to + * cover their existing legacy allocations. + * @param tokens The actual token amount + * @param minTokens The minimum required token amount + */ + error HorizonStakingInsufficientStakeForLegacyAllocations(uint256 tokens, uint256 minTokens); + + // -- Errors: delegation -- + + /** + * @notice Thrown when delegation shares obtained are below the expected amount. + * @param shares The actual share amount + * @param minShares The minimum required share amount + */ + error HorizonStakingSlippageProtection(uint256 shares, uint256 minShares); + + /** + * @notice Thrown when operating a zero share amount is not allowed. + */ + error HorizonStakingInvalidZeroShares(); + + /** + * @notice Thrown when a minimum share amount is required to operate but it's not met. + * @param shares The actual share amount + * @param minShares The minimum required share amount + */ + error HorizonStakingInsufficientShares(uint256 shares, uint256 minShares); + + /** + * @notice Thrown when as a result of slashing delegation pool has no tokens but has shares. + * @param serviceProvider The service provider address + * @param verifier The verifier address + */ + error HorizonStakingInvalidDelegationPoolState(address serviceProvider, address verifier); + + /** + * @notice Thrown when attempting to operate with a delegation pool that does not exist. + * @param serviceProvider The service provider address + * @param verifier The verifier address + */ + error HorizonStakingInvalidDelegationPool(address serviceProvider, address verifier); + + /** + * @notice Thrown when the minimum token amount required for delegation is not met. + * @param tokens The actual token amount + * @param minTokens The minimum required token amount + */ + error HorizonStakingInsufficientDelegationTokens(uint256 tokens, uint256 minTokens); + + /** + * @notice Thrown when attempting to redelegate with a serivce provider that is the zero address. + */ + error HorizonStakingInvalidServiceProviderZeroAddress(); + + /** + * @notice Thrown when attempting to redelegate with a verifier that is the zero address. + */ + error HorizonStakingInvalidVerifierZeroAddress(); + + // -- Errors: thaw requests -- + + /** + * @notice Thrown when attempting to fulfill a thaw request but there is nothing thawing. + */ + error HorizonStakingNothingThawing(); + + /** + * @notice Thrown when a service provider has too many thaw requests. + */ + error HorizonStakingTooManyThawRequests(); + + /** + * @notice Thrown when attempting to withdraw tokens that have not thawed (legacy undelegate). + */ + error HorizonStakingNothingToWithdraw(); + + // -- Errors: misc -- + /** + * @notice Thrown during the transition period when attempting to withdraw tokens that are still thawing. + * @dev Note this thawing refers to the global thawing period applied to legacy allocated tokens, + * it does not refer to thaw requests. + * @param until The block number until the stake is locked + */ + error HorizonStakingStillThawing(uint256 until); + + /** + * @notice Thrown when a service provider attempts to operate on verifiers that are not allowed. + * @dev Only applies to stake from locked wallets. + * @param verifier The verifier address + */ + error HorizonStakingVerifierNotAllowed(address verifier); + + /** + * @notice Thrown when a service provider attempts to change their own operator access. + */ + error HorizonStakingCallerIsServiceProvider(); + + /** + * @notice Thrown when trying to set a delegation fee cut that is not valid. + * @param feeCut The fee cut + */ + error HorizonStakingInvalidDelegationFeeCut(uint256 feeCut); + + /** + * @notice Thrown when a legacy slash fails. + */ + error HorizonStakingLegacySlashFailed(); + + /** + * @notice Thrown when there attempting to slash a provision with no tokens to slash. + */ + error HorizonStakingNoTokensToSlash(); + + // -- Functions -- + + /** + * @notice Deposit tokens on the staking contract. + * @dev Pulls tokens from the caller. + * + * Requirements: + * - `_tokens` cannot be zero. + * - Caller must have previously approved this contract to pull tokens from their balance. + * + * Emits a {HorizonStakeDeposited} event. + * + * @param tokens Amount of tokens to stake + */ + function stake(uint256 tokens) external; + + /** + * @notice Deposit tokens on the service provider stake, on behalf of the service provider. + * @dev Pulls tokens from the caller. + * + * Requirements: + * - `_tokens` cannot be zero. + * - Caller must have previously approved this contract to pull tokens from their balance. + * + * Emits a {HorizonStakeDeposited} event. + * + * @param serviceProvider Address of the service provider + * @param tokens Amount of tokens to stake + */ + function stakeTo(address serviceProvider, uint256 tokens) external; + + /** + * @notice Deposit tokens on the service provider stake, on behalf of the service provider, + * provisioned to a specific verifier. + * @dev This function can be called by the service provider, by an authorized operator or by the verifier itself. + * @dev Requirements: + * - The `serviceProvider` must have previously provisioned stake to `verifier`. + * - `_tokens` cannot be zero. + * - Caller must have previously approved this contract to pull tokens from their balance. + * + * Emits {HorizonStakeDeposited} and {ProvisionIncreased} events. + * + * @param serviceProvider Address of the service provider + * @param verifier Address of the verifier + * @param tokens Amount of tokens to stake + */ + function stakeToProvision(address serviceProvider, address verifier, uint256 tokens) external; + + /** + * @notice Move idle stake back to the owner's account. + * Stake is removed from the protocol: + * - During the transition period it's locked for a period of time before it can be withdrawn + * by calling {withdraw}. + * - After the transition period it's immediately withdrawn. + * Note that after the transition period if there are tokens still locked they will have to be + * withdrawn by calling {withdraw}. + * @dev Requirements: + * - `_tokens` cannot be zero. + * - `_serviceProvider` must have enough idle stake to cover the staking amount and any + * legacy allocation. + * + * Emits a {HorizonStakeLocked} event during the transition period. + * Emits a {HorizonStakeWithdrawn} event after the transition period. + * + * @param tokens Amount of tokens to unstake + */ + function unstake(uint256 tokens) external; + + /** + * @notice Withdraw service provider tokens once the thawing period (initiated by {unstake}) has passed. + * All thawed tokens are withdrawn. + * @dev This is only needed during the transition period while we still have + * a global lock. After that, unstake() will automatically withdraw. + */ + function withdraw() external; + + /** + * @notice Provision stake to a verifier. The tokens will be locked with a thawing period + * and will be slashable by the verifier. This is the main mechanism to provision stake to a data + * service, where the data service is the verifier. + * This function can be called by the service provider or by an operator authorized by the provider + * for this specific verifier. + * @dev During the transition period, only the subgraph data service can be used as a verifier. This + * prevents an escape hatch for legacy allocation stake. + * @dev Requirements: + * - `tokens` cannot be zero. + * - The `serviceProvider` must have enough idle stake to cover the tokens to provision. + * - `maxVerifierCut` must be a valid PPM. + * - `thawingPeriod` must be less than or equal to `_maxThawingPeriod`. + * + * Emits a {ProvisionCreated} event. + * + * @param serviceProvider The service provider address + * @param verifier The verifier address for which the tokens are provisioned (who will be able to slash the tokens) + * @param tokens The amount of tokens that will be locked and slashable + * @param maxVerifierCut The maximum cut, expressed in PPM, that a verifier can transfer instead of burning when slashing + * @param thawingPeriod The period in seconds that the tokens will be thawing before they can be removed from the provision + */ + function provision( + address serviceProvider, + address verifier, + uint256 tokens, + uint32 maxVerifierCut, + uint64 thawingPeriod + ) external; + + /** + * @notice Adds tokens from the service provider's idle stake to a provision + * @dev + * + * Requirements: + * - The `serviceProvider` must have previously provisioned stake to `verifier`. + * - `tokens` cannot be zero. + * - The `serviceProvider` must have enough idle stake to cover the tokens to add. + * + * Emits a {ProvisionIncreased} event. + * + * @param serviceProvider The service provider address + * @param verifier The verifier address + * @param tokens The amount of tokens to add to the provision + */ + function addToProvision(address serviceProvider, address verifier, uint256 tokens) external; + + /** + * @notice Start thawing tokens to remove them from a provision. + * This function can be called by the service provider or by an operator authorized by the provider + * for this specific verifier. + * + * Note that removing tokens from a provision is a two step process: + * - First the tokens are thawed using this function. + * - Then after the thawing period, the tokens are removed from the provision using {deprovision} + * or {reprovision}. + * + * @dev Requirements: + * - The provision must have enough tokens available to thaw. + * - `tokens` cannot be zero. + * + * Emits {ProvisionThawed} and {ThawRequestCreated} events. + * + * @param serviceProvider The service provider address + * @param verifier The verifier address for which the tokens are provisioned + * @param tokens The amount of tokens to thaw + * @return The ID of the thaw request + */ + function thaw(address serviceProvider, address verifier, uint256 tokens) external returns (bytes32); + + /** + * @notice Remove tokens from a provision and move them back to the service provider's idle stake. + * @dev The parameter `nThawRequests` can be set to a non zero value to fulfill a specific number of thaw + * requests in the event that fulfilling all of them results in a gas limit error. Otherwise, the function + * will attempt to fulfill all thaw requests until the first one that is not yet expired is found. + * + * Requirements: + * - Must have previously initiated a thaw request using {thaw}. + * + * Emits {ThawRequestFulfilled}, {ThawRequestsFulfilled} and {TokensDeprovisioned} events. + * + * @param serviceProvider The service provider address + * @param verifier The verifier address + * @param nThawRequests The number of thaw requests to fulfill. Set to 0 to fulfill all thaw requests. + */ + function deprovision(address serviceProvider, address verifier, uint256 nThawRequests) external; + + /** + * @notice Move already thawed stake from one provision into another provision + * This function can be called by the service provider or by an operator authorized by the provider + * for the two corresponding verifiers. + * @dev Requirements: + * - Must have previously initiated a thaw request using {thaw}. + * - `tokens` cannot be zero. + * - The `serviceProvider` must have previously provisioned stake to `newVerifier`. + * - The `serviceProvider` must have enough idle stake to cover the tokens to add. + * + * Emits {ThawRequestFulfilled}, {ThawRequestsFulfilled}, {TokensDeprovisioned} and {ProvisionIncreased} + * events. + * + * @param serviceProvider The service provider address + * @param oldVerifier The verifier address for which the tokens are currently provisioned + * @param newVerifier The verifier address for which the tokens will be provisioned + * @param nThawRequests The number of thaw requests to fulfill. Set to 0 to fulfill all thaw requests. + */ + function reprovision( + address serviceProvider, + address oldVerifier, + address newVerifier, + uint256 nThawRequests + ) external; + + /** + * @notice Stages a provision parameter update. Note that the change is not effective until the verifier calls + * {acceptProvisionParameters}. Calling this function is a no-op if the new parameters are the same as the current + * ones. + * @dev This two step update process prevents the service provider from changing the parameters + * without the verifier's consent. + * + * Requirements: + * - `thawingPeriod` must be less than or equal to `_maxThawingPeriod`. Note that if `_maxThawingPeriod` changes the + * function will not revert if called with the same thawing period as the current one. + * + * Emits a {ProvisionParametersStaged} event if at least one of the parameters changed. + * + * @param serviceProvider The service provider address + * @param verifier The verifier address + * @param maxVerifierCut The proposed maximum cut, expressed in PPM of the slashed amount, that a verifier can take for + * themselves when slashing + * @param thawingPeriod The proposed period in seconds that the tokens will be thawing before they can be removed from + * the provision + */ + function setProvisionParameters( + address serviceProvider, + address verifier, + uint32 maxVerifierCut, + uint64 thawingPeriod + ) external; + + /** + * @notice Accepts a staged provision parameter update. + * @dev Only the provision's verifier can call this function. + * + * Emits a {ProvisionParametersSet} event. + * + * @param serviceProvider The service provider address + */ + function acceptProvisionParameters(address serviceProvider) external; + + /** + * @notice Delegate tokens to a provision. + * @dev Requirements: + * - `tokens` cannot be zero. + * - Caller must have previously approved this contract to pull tokens from their balance. + * - The provision must exist. + * + * Emits a {TokensDelegated} event. + * + * @param serviceProvider The service provider address + * @param verifier The verifier address + * @param tokens The amount of tokens to delegate + * @param minSharesOut The minimum amount of shares to accept, slippage protection. + */ + function delegate(address serviceProvider, address verifier, uint256 tokens, uint256 minSharesOut) external; + + /** + * @notice Add tokens to a delegation pool without issuing shares. + * Used by data services to pay delegation fees/rewards. + * Delegators SHOULD NOT call this function. + * + * @dev Requirements: + * - `tokens` cannot be zero. + * - Caller must have previously approved this contract to pull tokens from their balance. + * + * Emits a {TokensToDelegationPoolAdded} event. + * + * @param serviceProvider The service provider address + * @param verifier The verifier address for which the tokens are provisioned + * @param tokens The amount of tokens to add to the delegation pool + */ + function addToDelegationPool(address serviceProvider, address verifier, uint256 tokens) external; + + /** + * @notice Undelegate tokens from a provision and start thawing them. + * Note that undelegating tokens from a provision is a two step process: + * - First the tokens are thawed using this function. + * - Then after the thawing period, the tokens are removed from the provision using {withdrawDelegated}. + * + * Requirements: + * - `shares` cannot be zero. + * + * Emits a {TokensUndelegated} and {ThawRequestCreated} event. + * + * @param serviceProvider The service provider address + * @param verifier The verifier address + * @param shares The amount of shares to undelegate + * @return The ID of the thaw request + */ + function undelegate(address serviceProvider, address verifier, uint256 shares) external returns (bytes32); + + /** + * @notice Withdraw undelegated tokens from a provision after thawing. + * @dev The parameter `nThawRequests` can be set to a non zero value to fulfill a specific number of thaw + * requests in the event that fulfilling all of them results in a gas limit error. Otherwise, the function + * will attempt to fulfill all thaw requests until the first one that is not yet expired is found. + * @dev If the delegation pool was completely slashed before withdrawing, calling this function will fulfill + * the thaw requests with an amount equal to zero. + * + * Requirements: + * - Must have previously initiated a thaw request using {undelegate}. + * + * Emits {ThawRequestFulfilled}, {ThawRequestsFulfilled} and {DelegatedTokensWithdrawn} events. + * + * @param serviceProvider The service provider address + * @param verifier The verifier address + * @param nThawRequests The number of thaw requests to fulfill. Set to 0 to fulfill all thaw requests. + */ + function withdrawDelegated(address serviceProvider, address verifier, uint256 nThawRequests) external; + + /** + * @notice Re-delegate undelegated tokens from a provision after thawing to a `newServiceProvider` and `newVerifier`. + * @dev The parameter `nThawRequests` can be set to a non zero value to fulfill a specific number of thaw + * requests in the event that fulfilling all of them results in a gas limit error. + * + * Requirements: + * - Must have previously initiated a thaw request using {undelegate}. + * - `newServiceProvider` and `newVerifier` must not be the zero address. + * - `newServiceProvider` must have previously provisioned stake to `newVerifier`. + * + * Emits {ThawRequestFulfilled}, {ThawRequestsFulfilled} and {DelegatedTokensWithdrawn} events. + * + * @param oldServiceProvider The old service provider address + * @param oldVerifier The old verifier address + * @param newServiceProvider The address of a new service provider + * @param newVerifier The address of a new verifier + * @param minSharesForNewProvider The minimum amount of shares to accept for the new service provider + * @param nThawRequests The number of thaw requests to fulfill. Set to 0 to fulfill all thaw requests. + */ + function redelegate( + address oldServiceProvider, + address oldVerifier, + address newServiceProvider, + address newVerifier, + uint256 minSharesForNewProvider, + uint256 nThawRequests + ) external; + + /** + * @notice Set the fee cut for a verifier on a specific payment type. + * @dev Emits a {DelegationFeeCutSet} event. + * @param serviceProvider The service provider address + * @param verifier The verifier address + * @param paymentType The payment type for which the fee cut is set, as defined in {IGraphPayments} + * @param feeCut The fee cut to set, in PPM + */ + function setDelegationFeeCut( + address serviceProvider, + address verifier, + IGraphPayments.PaymentTypes paymentType, + uint256 feeCut + ) external; + + /** + * @notice Delegate tokens to the subgraph data service provision. + * This function is for backwards compatibility with the legacy staking contract. + * It only allows delegating to the subgraph data service and DOES NOT have slippage protection. + * @dev See {delegate}. + * @param serviceProvider The service provider address + * @param tokens The amount of tokens to delegate + */ + function delegate(address serviceProvider, uint256 tokens) external; + + /** + * @notice Undelegate tokens from the subgraph data service provision and start thawing them. + * This function is for backwards compatibility with the legacy staking contract. + * It only allows undelegating from the subgraph data service. + * @dev See {undelegate}. + * @param serviceProvider The service provider address + * @param shares The amount of shares to undelegate + */ + function undelegate(address serviceProvider, uint256 shares) external; + + /** + * @notice Withdraw undelegated tokens from the subgraph data service provision after thawing. + * This function is for backwards compatibility with the legacy staking contract. + * It only allows withdrawing tokens undelegated before horizon upgrade. + * @dev See {delegate}. + * @param serviceProvider The service provider address + * @param deprecated Deprecated parameter kept for backwards compatibility + * @return The amount of tokens withdrawn + */ + function withdrawDelegated( + address serviceProvider, + address deprecated // kept for backwards compatibility + ) external returns (uint256); + + /** + * @notice Slash a service provider. This can only be called by a verifier to which + * the provider has provisioned stake, and up to the amount of tokens they have provisioned. + * If the service provider's stake is not enough, the associated delegation pool might be slashed + * depending on the value of the global delegation slashing flag. + * + * Part of the slashed tokens are sent to the `verifierDestination` as a reward. + * + * @dev Requirements: + * - `tokens` must be less than or equal to the amount of tokens provisioned by the service provider. + * - `tokensVerifier` must be less than the provision's tokens times the provision's maximum verifier cut. + * + * Emits a {ProvisionSlashed} and {VerifierTokensSent} events. + * Emits a {DelegationSlashed} or {DelegationSlashingSkipped} event depending on the global delegation slashing + * flag. + * + * @param serviceProvider The service provider to slash + * @param tokens The amount of tokens to slash + * @param tokensVerifier The amount of tokens to transfer instead of burning + * @param verifierDestination The address to transfer the verifier cut to + */ + function slash( + address serviceProvider, + uint256 tokens, + uint256 tokensVerifier, + address verifierDestination + ) external; + + /** + * @notice Provision stake to a verifier using locked tokens (i.e. from GraphTokenLockWallets). + * @dev See {provision}. + * + * Additional requirements: + * - The `verifier` must be allowed to be used for locked provisions. + * + * @param serviceProvider The service provider address + * @param verifier The verifier address for which the tokens are provisioned (who will be able to slash the tokens) + * @param tokens The amount of tokens that will be locked and slashable + * @param maxVerifierCut The maximum cut, expressed in PPM, that a verifier can transfer instead of burning when slashing + * @param thawingPeriod The period in seconds that the tokens will be thawing before they can be removed from the provision + */ + function provisionLocked( + address serviceProvider, + address verifier, + uint256 tokens, + uint32 maxVerifierCut, + uint64 thawingPeriod + ) external; + + /** + * @notice Authorize or unauthorize an address to be an operator for the caller on a verifier. + * + * @dev See {setOperator}. + * Additional requirements: + * - The `verifier` must be allowed to be used for locked provisions. + * + * @param verifier The verifier / data service on which they'll be allowed to operate + * @param operator Address to authorize or unauthorize + * @param allowed Whether the operator is authorized or not + */ + function setOperatorLocked(address verifier, address operator, bool allowed) external; + + /** + * @notice Sets a verifier as a globally allowed verifier for locked provisions. + * @dev This function can only be called by the contract governor, it's used to maintain + * a whitelist of verifiers that do not allow the stake from a locked wallet to escape the lock. + * @dev Emits a {AllowedLockedVerifierSet} event. + * @param verifier The verifier address + * @param allowed Whether the verifier is allowed or not + */ + function setAllowedLockedVerifier(address verifier, bool allowed) external; + + /** + * @notice Set the global delegation slashing flag to true. + * @dev This function can only be called by the contract governor. + */ + function setDelegationSlashingEnabled() external; + + /** + * @notice Clear the legacy global thawing period. + * This signifies the end of the transition period, after which no legacy allocations should be left. + * @dev This function can only be called by the contract governor. + * @dev Emits a {ThawingPeriodCleared} event. + */ + function clearThawingPeriod() external; + + /** + * @notice Sets the global maximum thawing period allowed for provisions. + * @param maxThawingPeriod The new maximum thawing period, in seconds + */ + function setMaxThawingPeriod(uint64 maxThawingPeriod) external; + + /** + * @notice Authorize or unauthorize an address to be an operator for the caller on a data service. + * @dev Emits a {OperatorSet} event. + * @param verifier The verifier / data service on which they'll be allowed to operate + * @param operator Address to authorize or unauthorize + * @param allowed Whether the operator is authorized or not + */ + function setOperator(address verifier, address operator, bool allowed) external; + + /** + * @notice Check if an operator is authorized for the caller on a specific verifier / data service. + * @param serviceProvider The service provider on behalf of whom they're claiming to act + * @param verifier The verifier / data service on which they're claiming to act + * @param operator The address to check for auth + * @return Whether the operator is authorized or not + */ + function isAuthorized(address serviceProvider, address verifier, address operator) external view returns (bool); + + /** + * @notice Get the address of the staking extension. + * @return The address of the staking extension + */ + function getStakingExtension() external view returns (address); +} diff --git a/packages/horizon/contracts/interfaces/internal/IHorizonStakingTypes.sol b/packages/horizon/contracts/interfaces/internal/IHorizonStakingTypes.sol new file mode 100644 index 000000000..0ab84fc1b --- /dev/null +++ b/packages/horizon/contracts/interfaces/internal/IHorizonStakingTypes.sol @@ -0,0 +1,201 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity 0.8.27; + +/** + * @title Defines the data types used in the Horizon staking contract + * @dev In order to preserve storage compatibility some data structures keep deprecated fields. + * These structures have then two representations, an internal one used by the contract storage and a public one. + * Getter functions should retrieve internal representations, remove deprecated fields and return the public representation. + * @custom:security-contact Please email security+contracts@thegraph.com if you find any + * bugs. We may have an active bug bounty program. + */ +interface IHorizonStakingTypes { + /** + * @notice Represents stake assigned to a specific verifier/data service. + * Provisioned stake is locked and can be used as economic security by a data service. + * @param tokens Service provider tokens in the provision (does not include delegated tokens) + * @param tokensThawing Service provider tokens that are being thawed (and will stop being slashable soon) + * @param sharesThawing Shares representing the thawing tokens + * @param maxVerifierCut Max amount that can be taken by the verifier when slashing, expressed in parts-per-million of the amount slashed + * @param thawingPeriod Time, in seconds, tokens must thaw before being withdrawn + * @param createdAt Timestamp when the provision was created + * @param maxVerifierCutPending Pending value for `maxVerifierCut`. Verifier needs to accept it before it becomes active. + * @param thawingPeriodPending Pending value for `thawingPeriod`. Verifier needs to accept it before it becomes active. + * @param lastParametersStagedAt Timestamp when the provision parameters were last staged. Can be used by data service implementation to + * implement arbitrary parameter update logic. + * @param thawingNonce Value of the current thawing nonce. Thaw requests with older nonces are invalid. + */ + struct Provision { + uint256 tokens; + uint256 tokensThawing; + uint256 sharesThawing; + uint32 maxVerifierCut; + uint64 thawingPeriod; + uint64 createdAt; + uint32 maxVerifierCutPending; + uint64 thawingPeriodPending; + uint256 lastParametersStagedAt; + uint256 thawingNonce; + } + + /** + * @notice Public representation of a service provider. + * @dev See {ServiceProviderInternal} for the actual storage representation + * @param tokensStaked Total amount of tokens on the provider stake (only staked by the provider, includes all provisions) + * @param tokensProvisioned Total amount of tokens locked in provisions (only staked by the provider) + */ + struct ServiceProvider { + uint256 tokensStaked; + uint256 tokensProvisioned; + } + + /** + * @notice Internal representation of a service provider. + * @dev It contains deprecated fields from the `Indexer` struct to maintain storage compatibility. + * @param tokensStaked Total amount of tokens on the provider stake (only staked by the provider, includes all provisions) + * @param __DEPRECATED_tokensAllocated (Deprecated) Tokens used in allocations + * @param __DEPRECATED_tokensLocked (Deprecated) Tokens locked for withdrawal subject to thawing period + * @param __DEPRECATED_tokensLockedUntil (Deprecated) Block when locked tokens can be withdrawn + * @param tokensProvisioned Total amount of tokens locked in provisions (only staked by the provider) + */ + struct ServiceProviderInternal { + uint256 tokensStaked; + uint256 __DEPRECATED_tokensAllocated; + uint256 __DEPRECATED_tokensLocked; + uint256 __DEPRECATED_tokensLockedUntil; + uint256 tokensProvisioned; + } + + /** + * @notice Public representation of a delegation pool. + * @dev See {DelegationPoolInternal} for the actual storage representation + * @param tokens Total tokens as pool reserves + * @param shares Total shares minted in the pool + * @param tokensThawing Tokens thawing in the pool + * @param sharesThawing Shares representing the thawing tokens + * @param thawingNonce Value of the current thawing nonce. Thaw requests with older nonces are invalid. + */ + struct DelegationPool { + uint256 tokens; + uint256 shares; + uint256 tokensThawing; + uint256 sharesThawing; + uint256 thawingNonce; + } + + /** + * @notice Internal representation of a delegation pool. + * @dev It contains deprecated fields from the previous version of the `DelegationPool` struct + * to maintain storage compatibility. + * @param __DEPRECATED_cooldownBlocks (Deprecated) Time, in blocks, an indexer must wait before updating delegation parameters + * @param __DEPRECATED_indexingRewardCut (Deprecated) Percentage of indexing rewards for the service provider, in PPM + * @param __DEPRECATED_queryFeeCut (Deprecated) Percentage of query fees for the service provider, in PPM + * @param __DEPRECATED_updatedAtBlock (Deprecated) Block when the delegation parameters were last updated + * @param tokens Total tokens as pool reserves + * @param shares Total shares minted in the pool + * @param delegators Delegation details by delegator + * @param tokensThawing Tokens thawing in the pool + * @param sharesThawing Shares representing the thawing tokens + * @param thawingNonce Value of the current thawing nonce. Thaw requests with older nonces are invalid. + */ + struct DelegationPoolInternal { + uint32 __DEPRECATED_cooldownBlocks; + uint32 __DEPRECATED_indexingRewardCut; + uint32 __DEPRECATED_queryFeeCut; + uint256 __DEPRECATED_updatedAtBlock; + uint256 tokens; + uint256 shares; + mapping(address delegator => DelegationInternal delegation) delegators; + uint256 tokensThawing; + uint256 sharesThawing; + uint256 thawingNonce; + } + + /** + * @notice Public representation of delegation details. + * @dev See {DelegationInternal} for the actual storage representation + * @param shares Shares owned by a delegator in the pool + */ + struct Delegation { + uint256 shares; + } + + /** + * @notice Internal representation of delegation details. + * @dev It contains deprecated fields from the previous version of the `Delegation` struct + * to maintain storage compatibility. + * @param shares Shares owned by the delegator in the pool + * @param __DEPRECATED_tokensLocked Tokens locked for undelegation + * @param __DEPRECATED_tokensLockedUntil Epoch when locked tokens can be withdrawn + */ + struct DelegationInternal { + uint256 shares; + uint256 __DEPRECATED_tokensLocked; + uint256 __DEPRECATED_tokensLockedUntil; + } + + /** + * @dev Enum to specify the type of thaw request. + * @param Provision Represents a thaw request for a provision. + * @param Delegation Represents a thaw request for a delegation. + */ + enum ThawRequestType { + Provision, + Delegation + } + + /** + * @notice Details of a stake thawing operation. + * @dev ThawRequests are stored in linked lists by service provider/delegator, + * ordered by creation timestamp. + * @param shares Shares that represent the tokens being thawed + * @param thawingUntil The timestamp when the thawed funds can be removed from the provision + * @param nextRequest Id of the next thaw request in the linked list + * @param thawingNonce Used to invalidate unfulfilled thaw requests + */ + struct ThawRequest { + uint256 shares; + uint64 thawingUntil; + bytes32 nextRequest; + uint256 thawingNonce; + } + + /** + * @notice Parameters to fulfill thaw requests. + * @dev This struct is used to avoid stack too deep error in the `fulfillThawRequests` function. + * @param requestType The type of thaw request (Provision or Delegation) + * @param serviceProvider The address of the service provider + * @param verifier The address of the verifier + * @param owner The address of the owner of the thaw request + * @param tokensThawing The current amount of tokens already thawing + * @param sharesThawing The current amount of shares already thawing + * @param nThawRequests The number of thaw requests to fulfill. If set to 0, all thaw requests are fulfilled. + * @param thawingNonce The current valid thawing nonce. Any thaw request with a different nonce is invalid and should be ignored. + */ + struct FulfillThawRequestsParams { + ThawRequestType requestType; + address serviceProvider; + address verifier; + address owner; + uint256 tokensThawing; + uint256 sharesThawing; + uint256 nThawRequests; + uint256 thawingNonce; + } + + /** + * @notice Results of the traversal of thaw requests. + * @dev This struct is used to avoid stack too deep error in the `fulfillThawRequests` function. + * @param requestsFulfilled The number of thaw requests fulfilled + * @param tokensThawed The total amount of tokens thawed + * @param tokensThawing The total amount of tokens thawing + * @param sharesThawing The total amount of shares thawing + */ + struct TraverseThawRequestsResults { + uint256 requestsFulfilled; + uint256 tokensThawed; + uint256 tokensThawing; + uint256 sharesThawing; + } +} diff --git a/packages/horizon/contracts/libraries/Denominations.sol b/packages/horizon/contracts/libraries/Denominations.sol new file mode 100644 index 000000000..46cff3516 --- /dev/null +++ b/packages/horizon/contracts/libraries/Denominations.sol @@ -0,0 +1,24 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +pragma solidity 0.8.27; + +/** + * @title Denominations library + * @dev Provides a list of ground denominations for those tokens that cannot be represented by an ERC20. + * For now, the only needed is the native token that could be ETH, MATIC, or other depending on the layer being operated. + * @custom:security-contact Please email security+contracts@thegraph.com if you find any + * bugs. We may have an active bug bounty program. + */ +library Denominations { + /// @notice The address of the native token, i.e ETH + /// @dev This convention is taken from https://eips.ethereum.org/EIPS/eip-7528 + address internal constant NATIVE_TOKEN = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; + + /** + * @notice Checks if a token is the native token + * @param token The token address to check + * @return True if the token is the native token, false otherwise + */ + function isNativeToken(address token) internal pure returns (bool) { + return token == NATIVE_TOKEN; + } +} diff --git a/packages/horizon/contracts/libraries/LibFixedMath.sol b/packages/horizon/contracts/libraries/LibFixedMath.sol new file mode 100644 index 000000000..704617b40 --- /dev/null +++ b/packages/horizon/contracts/libraries/LibFixedMath.sol @@ -0,0 +1,243 @@ +/* + + Copyright 2017 Bprotocol Foundation, 2019 ZeroEx Intl. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +*/ + +// SPDX-License-Identifier: Apache-2.0 + +pragma solidity 0.8.27; + +/** + * @title LibFixedMath + * @notice This library provides fixed-point arithmetic operations. + * @custom:security-contact Please email security+contracts@thegraph.com if you find any + * bugs. We may have an active bug bounty program. + */ +library LibFixedMath { + // 1 + int256 private constant FIXED_1 = int256(0x0000000000000000000000000000000080000000000000000000000000000000); + // 2**255 + int256 private constant MIN_FIXED_VAL = type(int256).min; + // 0 + int256 private constant EXP_MAX_VAL = 0; + // -63.875 + int256 private constant EXP_MIN_VAL = -int256(0x0000000000000000000000000000001ff0000000000000000000000000000000); + + /// @dev Get one as a fixed-point number. + function one() internal pure returns (int256 f) { + f = FIXED_1; + } + + /// @dev Returns the addition of two fixed point numbers, reverting on overflow. + function sub(int256 a, int256 b) internal pure returns (int256 c) { + if (b == MIN_FIXED_VAL) { + revert("out-of-bounds"); + } + c = _add(a, -b); + } + + /// @dev Returns the multiplication of two fixed point numbers, reverting on overflow. + function mul(int256 a, int256 b) internal pure returns (int256 c) { + c = _mul(a, b) / FIXED_1; + } + + /// @dev Performs (a * n) / d, without scaling for precision. + function mulDiv(int256 a, int256 n, int256 d) internal pure returns (int256 c) { + c = _div(_mul(a, n), d); + } + + /// @dev Returns the unsigned integer result of multiplying a fixed-point + /// number with an integer, reverting if the multiplication overflows. + /// Negative results are clamped to zero. + function uintMul(int256 f, uint256 u) internal pure returns (uint256) { + if (int256(u) < int256(0)) { + revert("out-of-bounds"); + } + int256 c = _mul(f, int256(u)); + if (c <= 0) { + return 0; + } + return uint256(uint256(c) >> 127); + } + + /// @dev Convert signed `n` / `d` to a fixed-point number. + function toFixed(int256 n, int256 d) internal pure returns (int256 f) { + f = _div(_mul(n, FIXED_1), d); + } + + /// @dev Convert a fixed-point number to an integer. + function toInteger(int256 f) internal pure returns (int256 n) { + return f / FIXED_1; + } + + /// @dev Compute the natural exponent for a fixed-point number EXP_MIN_VAL <= `x` <= 1 + function exp(int256 x) internal pure returns (int256 r) { + if (x < EXP_MIN_VAL) { + // Saturate to zero below EXP_MIN_VAL. + return 0; + } + if (x == 0) { + return FIXED_1; + } + if (x > EXP_MAX_VAL) { + revert("out-of-bounds"); + } + + // Rewrite the input as a product of natural exponents and a + // single residual q, where q is a number of small magnitude. + // For example: e^-34.419 = e^(-32 - 2 - 0.25 - 0.125 - 0.044) + // = e^-32 * e^-2 * e^-0.25 * e^-0.125 * e^-0.044 + // -> q = -0.044 + + // Multiply with the taylor series for e^q + int256 y; + int256 z; + // q = x % 0.125 (the residual) + z = y = x % 0x0000000000000000000000000000000010000000000000000000000000000000; + z = (z * y) / FIXED_1; + r += z * 0x10e1b3be415a0000; // add y^02 * (20! / 02!) + z = (z * y) / FIXED_1; + r += z * 0x05a0913f6b1e0000; // add y^03 * (20! / 03!) + z = (z * y) / FIXED_1; + r += z * 0x0168244fdac78000; // add y^04 * (20! / 04!) + z = (z * y) / FIXED_1; + r += z * 0x004807432bc18000; // add y^05 * (20! / 05!) + z = (z * y) / FIXED_1; + r += z * 0x000c0135dca04000; // add y^06 * (20! / 06!) + z = (z * y) / FIXED_1; + r += z * 0x0001b707b1cdc000; // add y^07 * (20! / 07!) + z = (z * y) / FIXED_1; + r += z * 0x000036e0f639b800; // add y^08 * (20! / 08!) + z = (z * y) / FIXED_1; + r += z * 0x00000618fee9f800; // add y^09 * (20! / 09!) + z = (z * y) / FIXED_1; + r += z * 0x0000009c197dcc00; // add y^10 * (20! / 10!) + z = (z * y) / FIXED_1; + r += z * 0x0000000e30dce400; // add y^11 * (20! / 11!) + z = (z * y) / FIXED_1; + r += z * 0x000000012ebd1300; // add y^12 * (20! / 12!) + z = (z * y) / FIXED_1; + r += z * 0x0000000017499f00; // add y^13 * (20! / 13!) + z = (z * y) / FIXED_1; + r += z * 0x0000000001a9d480; // add y^14 * (20! / 14!) + z = (z * y) / FIXED_1; + r += z * 0x00000000001c6380; // add y^15 * (20! / 15!) + z = (z * y) / FIXED_1; + r += z * 0x000000000001c638; // add y^16 * (20! / 16!) + z = (z * y) / FIXED_1; + r += z * 0x0000000000001ab8; // add y^17 * (20! / 17!) + z = (z * y) / FIXED_1; + r += z * 0x000000000000017c; // add y^18 * (20! / 18!) + z = (z * y) / FIXED_1; + r += z * 0x0000000000000014; // add y^19 * (20! / 19!) + z = (z * y) / FIXED_1; + r += z * 0x0000000000000001; // add y^20 * (20! / 20!) + r = r / 0x21c3677c82b40000 + y + FIXED_1; // divide by 20! and then add y^1 / 1! + y^0 / 0! + + // Multiply with the non-residual terms. + x = -x; + // e ^ -32 + if ((x & int256(0x0000000000000000000000000000001000000000000000000000000000000000)) != 0) { + r = + (r * int256(0x00000000000000000000000000000000000000f1aaddd7742e56d32fb9f99744)) / + int256(0x0000000000000000000000000043cbaf42a000812488fc5c220ad7b97bf6e99e); // * e ^ -32 + } + // e ^ -16 + if ((x & int256(0x0000000000000000000000000000000800000000000000000000000000000000)) != 0) { + r = + (r * int256(0x00000000000000000000000000000000000afe10820813d65dfe6a33c07f738f)) / + int256(0x000000000000000000000000000005d27a9f51c31b7c2f8038212a0574779991); // * e ^ -16 + } + // e ^ -8 + if ((x & int256(0x0000000000000000000000000000000400000000000000000000000000000000)) != 0) { + r = + (r * int256(0x0000000000000000000000000000000002582ab704279e8efd15e0265855c47a)) / + int256(0x0000000000000000000000000000001b4c902e273a58678d6d3bfdb93db96d02); // * e ^ -8 + } + // e ^ -4 + if ((x & int256(0x0000000000000000000000000000000200000000000000000000000000000000)) != 0) { + r = + (r * int256(0x000000000000000000000000000000001152aaa3bf81cb9fdb76eae12d029571)) / + int256(0x00000000000000000000000000000003b1cc971a9bb5b9867477440d6d157750); // * e ^ -4 + } + // e ^ -2 + if ((x & int256(0x0000000000000000000000000000000100000000000000000000000000000000)) != 0) { + r = + (r * int256(0x000000000000000000000000000000002f16ac6c59de6f8d5d6f63c1482a7c86)) / + int256(0x000000000000000000000000000000015bf0a8b1457695355fb8ac404e7a79e3); // * e ^ -2 + } + // e ^ -1 + if ((x & int256(0x0000000000000000000000000000000080000000000000000000000000000000)) != 0) { + r = + (r * int256(0x000000000000000000000000000000004da2cbf1be5827f9eb3ad1aa9866ebb3)) / + int256(0x00000000000000000000000000000000d3094c70f034de4b96ff7d5b6f99fcd8); // * e ^ -1 + } + // e ^ -0.5 + if ((x & int256(0x0000000000000000000000000000000040000000000000000000000000000000)) != 0) { + r = + (r * int256(0x0000000000000000000000000000000063afbe7ab2082ba1a0ae5e4eb1b479dc)) / + int256(0x00000000000000000000000000000000a45af1e1f40c333b3de1db4dd55f29a7); // * e ^ -0.5 + } + // e ^ -0.25 + if ((x & int256(0x0000000000000000000000000000000020000000000000000000000000000000)) != 0) { + r = + (r * int256(0x0000000000000000000000000000000070f5a893b608861e1f58934f97aea57d)) / + int256(0x00000000000000000000000000000000910b022db7ae67ce76b441c27035c6a1); // * e ^ -0.25 + } + // e ^ -0.125 + if ((x & int256(0x0000000000000000000000000000000010000000000000000000000000000000)) != 0) { + r = + (r * int256(0x00000000000000000000000000000000783eafef1c0a8f3978c7f81824d62ebf)) / + int256(0x0000000000000000000000000000000088415abbe9a76bead8d00cf112e4d4a8); // * e ^ -0.125 + } + } + + /// @dev Returns the multiplication two numbers, reverting on overflow. + function _mul(int256 a, int256 b) private pure returns (int256 c) { + if (a == 0 || b == 0) { + return 0; + } + unchecked { + c = a * b; + if (c / a != b || c / b != a) { + revert("overflow"); + } + } + } + + /// @dev Returns the division of two numbers, reverting on division by zero. + function _div(int256 a, int256 b) private pure returns (int256 c) { + if (b == 0) { + revert("overflow"); + } + if (a == MIN_FIXED_VAL && b == -1) { + revert("overflow"); + } + unchecked { + c = a / b; + } + } + + /// @dev Adds two numbers, reverting on overflow. + function _add(int256 a, int256 b) private pure returns (int256 c) { + unchecked { + c = a + b; + if ((a < 0 && b < 0 && c > a) || (a > 0 && b > 0 && c < a)) { + revert("overflow"); + } + } + } +} diff --git a/packages/horizon/contracts/libraries/LinkedList.sol b/packages/horizon/contracts/libraries/LinkedList.sol new file mode 100644 index 000000000..af0f1dad9 --- /dev/null +++ b/packages/horizon/contracts/libraries/LinkedList.sol @@ -0,0 +1,155 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity 0.8.27; + +/** + * @title LinkedList library + * @notice A library to manage singly linked lists. + * + * The library makes no assumptions about the contents of the items, the only + * requirements on the items are: + * - they must be represented by a unique bytes32 id + * - the id of the item must not be bytes32(0) + * - each item must have a reference to the next item in the list + * - the list cannot have more than `MAX_ITEMS` items + * + * A contract using this library must store: + * - a LinkedList.List to keep track of the list metadata + * - a mapping from bytes32 to the item data + * @custom:security-contact Please email security+contracts@thegraph.com if you find any + * bugs. We may have an active bug bounty program. + */ +library LinkedList { + using LinkedList for List; + + /** + * @notice Represents a linked list + * @param head The head of the list + * @param tail The tail of the list + * @param nonce A nonce, which can optionally be used to generate unique ids + * @param count The number of items in the list + */ + struct List { + bytes32 head; + bytes32 tail; + uint256 nonce; + uint256 count; + } + + /// @notice Empty bytes constant + bytes internal constant NULL_BYTES = bytes(""); + + /// @notice Maximum amount of items allowed in the list + uint256 internal constant MAX_ITEMS = 10_000; + + /** + * @notice Thrown when trying to remove an item from an empty list + */ + error LinkedListEmptyList(); + + /** + * @notice Thrown when trying to add an item to a list that has reached the maximum number of elements + */ + error LinkedListMaxElementsExceeded(); + + /** + * @notice Thrown when trying to traverse a list with more iterations than elements + */ + error LinkedListInvalidIterations(); + + /** + * @notice Thrown when trying to add an item with id equal to bytes32(0) + */ + error LinkedListInvalidZeroId(); + + /** + * @notice Adds an item to the list. + * The item is added to the end of the list. + * @dev Note that this function will not take care of linking the + * old tail to the new item. The caller should take care of this. + * It will also not ensure id uniqueness. + * @dev There is a maximum number of elements that can be added to the list. + * @param self The list metadata + * @param id The id of the item to add + */ + function addTail(List storage self, bytes32 id) internal { + require(self.count < MAX_ITEMS, LinkedListMaxElementsExceeded()); + require(id != bytes32(0), LinkedListInvalidZeroId()); + self.tail = id; + self.nonce += 1; + if (self.count == 0) self.head = id; + self.count += 1; + } + + /** + * @notice Removes an item from the list. + * The item is removed from the beginning of the list. + * @param self The list metadata + * @param getNextItem A function to get the next item in the list. It should take + * the id of the current item and return the id of the next item. + * @param deleteItem A function to delete an item. This should delete the item from + * the contract storage. It takes the id of the item to delete. + * @return The id of the head of the list. + */ + function removeHead( + List storage self, + function(bytes32) view returns (bytes32) getNextItem, + function(bytes32) deleteItem + ) internal returns (bytes32) { + require(self.count > 0, LinkedListEmptyList()); + bytes32 nextItem = getNextItem(self.head); + deleteItem(self.head); + self.count -= 1; + self.head = nextItem; + if (self.count == 0) self.tail = bytes32(0); + return self.head; + } + + /** + * @notice Traverses the list and processes each item. + * It deletes the processed items from both the list and the storage mapping. + * @param self The list metadata + * @param getNextItem A function to get the next item in the list. It should take + * the id of the current item and return the id of the next item. + * @param processItem A function to process an item. The function should take the id of the item + * and an accumulator, and return: + * - a boolean indicating whether the traversal should stop + * - an accumulator to pass data between iterations + * @param deleteItem A function to delete an item. This should delete the item from + * the contract storage. It takes the id of the item to delete. + * @param processInitAcc The initial accumulator data + * @param iterations The maximum number of iterations to perform. If 0, the traversal will continue + * until the end of the list. + * @return The number of items processed + * @return The final accumulator data. + */ + function traverse( + List storage self, + function(bytes32) view returns (bytes32) getNextItem, + function(bytes32, bytes memory) returns (bool, bytes memory) processItem, + function(bytes32) deleteItem, + bytes memory processInitAcc, + uint256 iterations + ) internal returns (uint256, bytes memory) { + require(iterations <= self.count, LinkedListInvalidIterations()); + + uint256 itemCount = 0; + iterations = (iterations == 0) ? self.count : iterations; + + bytes32 cursor = self.head; + + while (cursor != bytes32(0) && iterations > 0) { + (bool shouldBreak, bytes memory acc_) = processItem(cursor, processInitAcc); + + if (shouldBreak) break; + + processInitAcc = acc_; + cursor = self.removeHead(getNextItem, deleteItem); + + iterations--; + itemCount++; + } + + return (itemCount, processInitAcc); + } +} diff --git a/packages/horizon/contracts/libraries/MathUtils.sol b/packages/horizon/contracts/libraries/MathUtils.sol new file mode 100644 index 000000000..fc81e9608 --- /dev/null +++ b/packages/horizon/contracts/libraries/MathUtils.sol @@ -0,0 +1,50 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity 0.8.27; + +/** + * @title MathUtils Library + * @notice A collection of functions to perform math operations + * @custom:security-contact Please email security+contracts@thegraph.com if you find any + * bugs. We may have an active bug bounty program. + */ +library MathUtils { + /** + * @dev Calculates the weighted average of two values pondering each of these + * values based on configured weights. The contribution of each value N is + * weightN/(weightA + weightB). The calculation rounds up to ensure the result + * is always equal or greater than the smallest of the two values. + * @param valueA The amount for value A + * @param weightA The weight to use for value A + * @param valueB The amount for value B + * @param weightB The weight to use for value B + */ + function weightedAverageRoundingUp( + uint256 valueA, + uint256 weightA, + uint256 valueB, + uint256 weightB + ) internal pure returns (uint256) { + return ((valueA * weightA) + (valueB * weightB) + (weightA + weightB - 1)) / (weightA + weightB); + } + + /** + * @dev Returns the minimum of two numbers. + * @param x The first number + * @param y The second number + * @return The minimum of the two numbers + */ + function min(uint256 x, uint256 y) internal pure returns (uint256) { + return x <= y ? x : y; + } + + /** + * @dev Returns the difference between two numbers or zero if negative. + * @param x The first number + * @param y The second number + * @return The difference between the two numbers or zero if negative + */ + function diffOrZero(uint256 x, uint256 y) internal pure returns (uint256) { + return (x > y) ? x - y : 0; + } +} diff --git a/packages/horizon/contracts/libraries/PPMMath.sol b/packages/horizon/contracts/libraries/PPMMath.sol new file mode 100644 index 000000000..a7966c91d --- /dev/null +++ b/packages/horizon/contracts/libraries/PPMMath.sol @@ -0,0 +1,60 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +pragma solidity 0.8.27; + +/** + * @title PPMMath library + * @notice A library for handling calculations with parts per million (PPM) amounts. + * @custom:security-contact Please email security+contracts@thegraph.com if you find any + * bugs. We may have an active bug bounty program. + */ +library PPMMath { + /// @notice Maximum value (100%) in parts per million (PPM). + uint256 internal constant MAX_PPM = 1_000_000; + + /** + * @notice Thrown when a value is expected to be in PPM but is not. + * @param value The value that is not in PPM. + */ + error PPMMathInvalidPPM(uint256 value); + + /** + * @notice Thrown when no value in a multiplication is in PPM. + * @param a The first value in the multiplication. + * @param b The second value in the multiplication. + */ + error PPMMathInvalidMulPPM(uint256 a, uint256 b); + + /** + * @notice Multiplies two values, one of which must be in PPM. + * @param a The first value. + * @param b The second value. + * @return The result of the multiplication. + */ + function mulPPM(uint256 a, uint256 b) internal pure returns (uint256) { + require(isValidPPM(a) || isValidPPM(b), PPMMathInvalidMulPPM(a, b)); + return (a * b) / MAX_PPM; + } + + /** + * @notice Multiplies two values, the second one must be in PPM, and rounds up the result. + * @dev requirements: + * - The second value must be in PPM. + * @param a The first value. + * @param b The second value. + * @return The result of the multiplication. + */ + function mulPPMRoundUp(uint256 a, uint256 b) internal pure returns (uint256) { + require(isValidPPM(b), PPMMathInvalidPPM(b)); + return a - mulPPM(a, MAX_PPM - b); + } + + /** + * @notice Checks if a value is in PPM. + * @dev A valid PPM value is between 0 and MAX_PPM. + * @param value The value to check. + * @return true if the value is in PPM, false otherwise. + */ + function isValidPPM(uint256 value) internal pure returns (bool) { + return value <= MAX_PPM; + } +} diff --git a/packages/horizon/contracts/libraries/UintRange.sol b/packages/horizon/contracts/libraries/UintRange.sol new file mode 100644 index 000000000..69d3f5d8a --- /dev/null +++ b/packages/horizon/contracts/libraries/UintRange.sol @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +pragma solidity 0.8.27; + +/** + * @title UintRange library + * @notice A library for handling range checks on uint256 values. + * @custom:security-contact Please email security+contracts@thegraph.com if you find any + * bugs. We may have an active bug bounty program. + */ +library UintRange { + /** + * @notice Checks if a value is in the range [`min`, `max`]. + * @param value The value to check. + * @param min The minimum value of the range. + * @param max The maximum value of the range. + * @return true if the value is in the range, false otherwise. + */ + function isInRange(uint256 value, uint256 min, uint256 max) internal pure returns (bool) { + return value >= min && value <= max; + } +} diff --git a/packages/horizon/contracts/mocks/ControllerMock.sol b/packages/horizon/contracts/mocks/ControllerMock.sol new file mode 100644 index 000000000..54c3ec8db --- /dev/null +++ b/packages/horizon/contracts/mocks/ControllerMock.sol @@ -0,0 +1,125 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity 0.8.27; + +import { IController } from "@graphprotocol/contracts/contracts/governance/IController.sol"; +import { IManaged } from "@graphprotocol/contracts/contracts/governance/IManaged.sol"; + +/** + * @title Graph Controller contract (mock) + * @dev Controller is a registry of contracts for convenience. Inspired by Livepeer: + * https://github.com/livepeer/protocol/blob/streamflow/contracts/Controller.sol + */ +contract ControllerMock is IController { + /// @dev Track contract ids to contract proxy address + mapping(bytes32 contractName => address contractAddress) private _registry; + address public governor; + bool internal _paused; + bool internal _partialPaused; + address internal _pauseGuardian; + + /// Emitted when the proxy address for a protocol contract has been set + event SetContractProxy(bytes32 indexed id, address contractAddress); + + /** + * Constructor for the Controller mock + * @param governor_ Address of the governor + */ + constructor(address governor_) { + governor = governor_; + } + + // -- Registry -- + + /** + * @notice Register contract id and mapped address + * @param id Contract id (keccak256 hash of contract name) + * @param contractAddress Contract address + */ + function setContractProxy(bytes32 id, address contractAddress) external override { + require(contractAddress != address(0), "Contract address must be set"); + _registry[id] = contractAddress; + emit SetContractProxy(id, contractAddress); + } + + /** + * @notice Unregister a contract address + * @param id Contract id (keccak256 hash of contract name) + */ + function unsetContractProxy(bytes32 id) external override { + _registry[id] = address(0); + emit SetContractProxy(id, address(0)); + } + + /** + * @notice Update a contract's controller + * @param id Contract id (keccak256 hash of contract name) + * @param controller New Controller address + */ + function updateController(bytes32 id, address controller) external override { + require(controller != address(0), "Controller must be set"); + return IManaged(_registry[id]).setController(controller); + } + + // -- Pausing -- + + /** + * @notice Change the partial paused state of the contract + * Partial pause is intended as a partial pause of the protocol + * @param toPause True if the contracts should be (partially) paused, false otherwise + */ + function setPartialPaused(bool toPause) external override { + _partialPaused = toPause; + } + + /** + * @notice Change the paused state of the contract + * Full pause most of protocol functions + * @param toPause True if the contracts should be paused, false otherwise + */ + function setPaused(bool toPause) external override { + _paused = toPause; + } + + /** + * @notice Change the Pause Guardian + * @param newPauseGuardian The address of the new Pause Guardian + */ + function setPauseGuardian(address newPauseGuardian) external override { + require(newPauseGuardian != address(0), "PauseGuardian must be set"); + _pauseGuardian = newPauseGuardian; + } + + /** + * @notice Getter to access governor + * @return Address of the governor + */ + function getGovernor() external view override returns (address) { + return governor; + } + + /** + * @notice Get contract proxy address by its id + * @param id Contract id (keccak256 hash of contract name) + * @return Address of the proxy contract for the provided id + */ + function getContractProxy(bytes32 id) external view virtual override returns (address) { + return _registry[id]; + } + + /** + * @notice Getter to access paused + * @return True if the contracts are paused, false otherwise + */ + function paused() external view override returns (bool) { + return _paused; + } + + /** + * @notice Getter to access partial pause status + * @return True if the contracts are partially paused, false otherwise + */ + function partialPaused() external view override returns (bool) { + return _partialPaused; + } +} diff --git a/packages/horizon/contracts/mocks/CurationMock.sol b/packages/horizon/contracts/mocks/CurationMock.sol new file mode 100644 index 000000000..996f971b1 --- /dev/null +++ b/packages/horizon/contracts/mocks/CurationMock.sol @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity 0.8.27; + +import { MockGRTToken } from "./MockGRTToken.sol"; + +contract CurationMock { + mapping(bytes32 => uint256) public curation; + + function signal(bytes32 _subgraphDeploymentID, uint256 _tokens) public { + curation[_subgraphDeploymentID] += _tokens; + } + + function isCurated(bytes32 _subgraphDeploymentID) public view returns (bool) { + return curation[_subgraphDeploymentID] != 0; + } + + function collect(bytes32 _subgraphDeploymentID, uint256 _tokens) external { + curation[_subgraphDeploymentID] += _tokens; + } +} diff --git a/packages/horizon/contracts/mocks/Dummy.sol b/packages/horizon/contracts/mocks/Dummy.sol new file mode 100644 index 000000000..e6a575d0f --- /dev/null +++ b/packages/horizon/contracts/mocks/Dummy.sol @@ -0,0 +1,5 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity 0.8.27; + +contract Dummy {} diff --git a/packages/horizon/contracts/mocks/EpochManagerMock.sol b/packages/horizon/contracts/mocks/EpochManagerMock.sol new file mode 100644 index 000000000..12f694a5e --- /dev/null +++ b/packages/horizon/contracts/mocks/EpochManagerMock.sol @@ -0,0 +1,63 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity 0.8.27; + +import { IEpochManager } from "@graphprotocol/contracts/contracts/epochs/IEpochManager.sol"; + +contract EpochManagerMock is IEpochManager { + // -- Variables -- + + uint256 public epochLength; + uint256 public lastRunEpoch; + uint256 public lastLengthUpdateEpoch; + uint256 public lastLengthUpdateBlock; + + // -- Configuration -- + + function setEpochLength(uint256 _epochLength) public { + lastLengthUpdateEpoch = 1; + lastLengthUpdateBlock = blockNum(); + epochLength = _epochLength; + } + + // -- Epochs + + function runEpoch() public { + lastRunEpoch = currentEpoch(); + } + + // -- Getters -- + + function isCurrentEpochRun() public view returns (bool) { + return lastRunEpoch == currentEpoch(); + } + + function blockNum() public view returns (uint256) { + return block.number; + } + + function blockHash(uint256 _block) public view returns (bytes32) { + return blockhash(_block); + } + + function currentEpoch() public view returns (uint256) { + return lastLengthUpdateEpoch + epochsSinceUpdate(); + } + + function currentEpochBlock() public view returns (uint256) { + return lastLengthUpdateBlock + (epochsSinceUpdate() * epochLength); + } + + function currentEpochBlockSinceStart() public view returns (uint256) { + return blockNum() - currentEpochBlock(); + } + + function epochsSince(uint256 _epoch) public view returns (uint256) { + uint256 epoch = currentEpoch(); + return _epoch < epoch ? (epoch - _epoch) : 0; + } + + function epochsSinceUpdate() public view returns (uint256) { + return (blockNum() - lastLengthUpdateBlock) / epochLength; + } +} diff --git a/packages/horizon/contracts/mocks/MockGRTToken.sol b/packages/horizon/contracts/mocks/MockGRTToken.sol new file mode 100644 index 000000000..235999ae5 --- /dev/null +++ b/packages/horizon/contracts/mocks/MockGRTToken.sol @@ -0,0 +1,49 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; +import { IGraphToken } from "@graphprotocol/contracts/contracts/token/IGraphToken.sol"; + +contract MockGRTToken is ERC20, IGraphToken { + constructor() ERC20("Graph Token", "GRT") {} + + function burn(uint256 tokens) external { + _burn(msg.sender, tokens); + } + + function burnFrom(address from, uint256 tokens) external { + _burn(from, tokens); + } + + // -- Mint Admin -- + + function addMinter(address account) external {} + + function removeMinter(address account) external {} + + function renounceMinter() external {} + + // -- Permit -- + + function permit( + address owner, + address spender, + uint256 value, + uint256 deadline, + uint8 v, + bytes32 r, + bytes32 s + ) external {} + + // -- Allowance -- + + function increaseAllowance(address spender, uint256 addedValue) external returns (bool) {} + + function decreaseAllowance(address spender, uint256 subtractedValue) external returns (bool) {} + + function isMinter(address account) external view returns (bool) {} + + function mint(address to, uint256 tokens) public { + _mint(to, tokens); + } +} diff --git a/packages/horizon/contracts/mocks/RewardsManagerMock.sol b/packages/horizon/contracts/mocks/RewardsManagerMock.sol new file mode 100644 index 000000000..272584ca4 --- /dev/null +++ b/packages/horizon/contracts/mocks/RewardsManagerMock.sol @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity 0.8.27; + +import { MockGRTToken } from "./MockGRTToken.sol"; + +contract RewardsManagerMock { + // -- Variables -- + MockGRTToken public token; + uint256 private rewards; + + // -- Constructor -- + + constructor(MockGRTToken _token, uint256 _rewards) { + token = _token; + rewards = _rewards; + } + + function takeRewards(address) external returns (uint256) { + token.mint(msg.sender, rewards); + return rewards; + } + + function onSubgraphAllocationUpdate(bytes32) public returns (uint256) {} + function onSubgraphSignalUpdate(bytes32 _subgraphDeploymentID) external returns (uint256) {} +} diff --git a/packages/horizon/contracts/mocks/imports.sol b/packages/horizon/contracts/mocks/imports.sol new file mode 100644 index 000000000..f70a28ab9 --- /dev/null +++ b/packages/horizon/contracts/mocks/imports.sol @@ -0,0 +1,36 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity ^0.7.6 || 0.8.27; + +// We import these here to force Hardhat to compile them. +// This ensures that their artifacts are available for Hardhat Ignition to use. +import "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; +import "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol"; + +// These are needed to get artifacts for toolshed +import "@graphprotocol/contracts/contracts/governance/Controller.sol"; +import "@graphprotocol/contracts/contracts/upgrades/GraphProxyAdmin.sol"; +import "@graphprotocol/contracts/contracts/staking/IStaking.sol"; +import "@graphprotocol/contracts/contracts/discovery/ISubgraphNFT.sol"; + +// Also for toolshed, solidity version in @graphprotocol/contracts does not support overriding public getters +// in interface file, so we need to amend them here. +import { IRewardsManager } from "@graphprotocol/contracts/contracts/rewards/IRewardsManager.sol"; +import { IL2Curation } from "@graphprotocol/contracts/contracts/l2/curation/IL2Curation.sol"; +import { IEpochManager } from "@graphprotocol/contracts/contracts/epochs/IEpochManager.sol"; +import { IGNS } from "@graphprotocol/contracts/contracts/discovery/IGNS.sol"; + +interface IRewardsManagerToolshed is IRewardsManager { + function subgraphService() external view returns (address); +} + +interface IL2CurationToolshed is IL2Curation { + function subgraphService() external view returns (address); +} + +interface IEpochManagerToolshed is IEpochManager { + function epochLength() external view returns (uint256); +} + +interface IGNSToolshed is IGNS { + function subgraphNFT() external view returns (address); +} diff --git a/packages/horizon/contracts/payments/GraphPayments.sol b/packages/horizon/contracts/payments/GraphPayments.sol new file mode 100644 index 000000000..e74e351cf --- /dev/null +++ b/packages/horizon/contracts/payments/GraphPayments.sol @@ -0,0 +1,114 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +pragma solidity 0.8.27; + +import { IGraphToken } from "@graphprotocol/contracts/contracts/token/IGraphToken.sol"; +import { IGraphPayments } from "../interfaces/IGraphPayments.sol"; +import { IHorizonStakingTypes } from "../interfaces/internal/IHorizonStakingTypes.sol"; + +import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; +import { MulticallUpgradeable } from "@openzeppelin/contracts-upgradeable/utils/MulticallUpgradeable.sol"; +import { TokenUtils } from "@graphprotocol/contracts/contracts/utils/TokenUtils.sol"; +import { PPMMath } from "../libraries/PPMMath.sol"; + +import { GraphDirectory } from "../utilities/GraphDirectory.sol"; + +/** + * @title GraphPayments contract + * @notice This contract is part of the Graph Horizon payments protocol. It's designed + * to pull funds (GRT) from the {PaymentsEscrow} and distribute them according to a + * set of pre established rules. + * @custom:security-contact Please email security+contracts@thegraph.com if you find any + * bugs. We may have an active bug bounty program. + */ +contract GraphPayments is Initializable, MulticallUpgradeable, GraphDirectory, IGraphPayments { + using TokenUtils for IGraphToken; + using PPMMath for uint256; + + /// @notice Protocol payment cut in PPM + uint256 public immutable PROTOCOL_PAYMENT_CUT; + + /** + * @notice Constructor for the {GraphPayments} contract + * @dev This contract is upgradeable however we still use the constructor to set + * a few immutable variables. + * @param controller The address of the Graph controller + * @param protocolPaymentCut The protocol tax in PPM + */ + constructor(address controller, uint256 protocolPaymentCut) GraphDirectory(controller) { + require(PPMMath.isValidPPM(protocolPaymentCut), GraphPaymentsInvalidCut(protocolPaymentCut)); + PROTOCOL_PAYMENT_CUT = protocolPaymentCut; + _disableInitializers(); + } + + /// @inheritdoc IGraphPayments + function initialize() external initializer { + __Multicall_init(); + } + + /// @inheritdoc IGraphPayments + function collect( + IGraphPayments.PaymentTypes paymentType, + address receiver, + uint256 tokens, + address dataService, + uint256 dataServiceCut, + address receiverDestination + ) external { + require(PPMMath.isValidPPM(dataServiceCut), GraphPaymentsInvalidCut(dataServiceCut)); + + // Pull tokens from the sender + _graphToken().pullTokens(msg.sender, tokens); + + // Calculate token amounts for each party + // Order matters: protocol -> data service -> delegators -> receiver + // Note the substractions should not underflow as we are only deducting a percentage of the remainder + uint256 tokensRemaining = tokens; + + uint256 tokensProtocol = tokensRemaining.mulPPMRoundUp(PROTOCOL_PAYMENT_CUT); + tokensRemaining = tokensRemaining - tokensProtocol; + + uint256 tokensDataService = tokensRemaining.mulPPMRoundUp(dataServiceCut); + tokensRemaining = tokensRemaining - tokensDataService; + + uint256 tokensDelegationPool = 0; + IHorizonStakingTypes.DelegationPool memory pool = _graphStaking().getDelegationPool(receiver, dataService); + if (pool.shares > 0) { + tokensDelegationPool = tokensRemaining.mulPPMRoundUp( + _graphStaking().getDelegationFeeCut(receiver, dataService, paymentType) + ); + tokensRemaining = tokensRemaining - tokensDelegationPool; + } + + // Pay all parties + _graphToken().burnTokens(tokensProtocol); + + _graphToken().pushTokens(dataService, tokensDataService); + + if (tokensDelegationPool > 0) { + _graphToken().approve(address(_graphStaking()), tokensDelegationPool); + _graphStaking().addToDelegationPool(receiver, dataService, tokensDelegationPool); + } + + if (tokensRemaining > 0) { + if (receiverDestination == address(0)) { + _graphToken().approve(address(_graphStaking()), tokensRemaining); + _graphStaking().stakeTo(receiver, tokensRemaining); + } else { + _graphToken().pushTokens(receiverDestination, tokensRemaining); + } + } + + emit GraphPaymentCollected( + paymentType, + msg.sender, + receiver, + dataService, + tokens, + tokensProtocol, + tokensDataService, + tokensDelegationPool, + tokensRemaining, + receiverDestination + ); + } +} diff --git a/packages/horizon/contracts/payments/PaymentsEscrow.sol b/packages/horizon/contracts/payments/PaymentsEscrow.sol new file mode 100644 index 000000000..d947921cd --- /dev/null +++ b/packages/horizon/contracts/payments/PaymentsEscrow.sol @@ -0,0 +1,172 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +pragma solidity 0.8.27; + +import { IGraphToken } from "@graphprotocol/contracts/contracts/token/IGraphToken.sol"; +import { IGraphPayments } from "../interfaces/IGraphPayments.sol"; +import { IPaymentsEscrow } from "../interfaces/IPaymentsEscrow.sol"; + +import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; +import { MulticallUpgradeable } from "@openzeppelin/contracts-upgradeable/utils/MulticallUpgradeable.sol"; +import { TokenUtils } from "@graphprotocol/contracts/contracts/utils/TokenUtils.sol"; + +import { GraphDirectory } from "../utilities/GraphDirectory.sol"; + +/** + * @title PaymentsEscrow contract + * @dev Implements the {IPaymentsEscrow} interface + * @notice This contract is part of the Graph Horizon payments protocol. It holds the funds (GRT) + * for payments made through the payments protocol for services provided + * via a Graph Horizon data service. + * @custom:security-contact Please email security+contracts@thegraph.com if you find any + * bugs. We may have an active bug bounty program. + */ +contract PaymentsEscrow is Initializable, MulticallUpgradeable, GraphDirectory, IPaymentsEscrow { + using TokenUtils for IGraphToken; + + /// @notice The maximum thawing period (in seconds) for both escrow withdrawal and collector revocation + /// @dev This is a precautionary measure to avoid inadvertedly locking funds for too long + uint256 public constant MAX_WAIT_PERIOD = 90 days; + + /// @notice Thawing period in seconds for escrow funds withdrawal + uint256 public immutable WITHDRAW_ESCROW_THAWING_PERIOD; + + /// @notice Escrow account details for payer-collector-receiver tuples + mapping(address payer => mapping(address collector => mapping(address receiver => IPaymentsEscrow.EscrowAccount escrowAccount))) + public escrowAccounts; + + /** + * @notice Modifier to prevent function execution when contract is paused + * @dev Reverts if the controller indicates the contract is paused + */ + modifier notPaused() { + require(!_graphController().paused(), PaymentsEscrowIsPaused()); + _; + } + + /** + * @notice Construct the PaymentsEscrow contract + * @param controller The address of the controller + * @param withdrawEscrowThawingPeriod Thawing period in seconds for escrow funds withdrawal + */ + constructor(address controller, uint256 withdrawEscrowThawingPeriod) GraphDirectory(controller) { + require( + withdrawEscrowThawingPeriod <= MAX_WAIT_PERIOD, + PaymentsEscrowThawingPeriodTooLong(withdrawEscrowThawingPeriod, MAX_WAIT_PERIOD) + ); + + WITHDRAW_ESCROW_THAWING_PERIOD = withdrawEscrowThawingPeriod; + _disableInitializers(); + } + + /// @inheritdoc IPaymentsEscrow + function initialize() external initializer { + __Multicall_init(); + } + + /// @inheritdoc IPaymentsEscrow + function deposit(address collector, address receiver, uint256 tokens) external override notPaused { + _deposit(msg.sender, collector, receiver, tokens); + } + + /// @inheritdoc IPaymentsEscrow + function depositTo(address payer, address collector, address receiver, uint256 tokens) external override notPaused { + _deposit(payer, collector, receiver, tokens); + } + + /// @inheritdoc IPaymentsEscrow + function thaw(address collector, address receiver, uint256 tokens) external override notPaused { + require(tokens > 0, PaymentsEscrowInvalidZeroTokens()); + + EscrowAccount storage account = escrowAccounts[msg.sender][collector][receiver]; + require(account.balance >= tokens, PaymentsEscrowInsufficientBalance(account.balance, tokens)); + + account.tokensThawing = tokens; + account.thawEndTimestamp = block.timestamp + WITHDRAW_ESCROW_THAWING_PERIOD; + + emit Thaw(msg.sender, collector, receiver, tokens, account.thawEndTimestamp); + } + + /// @inheritdoc IPaymentsEscrow + function cancelThaw(address collector, address receiver) external override notPaused { + EscrowAccount storage account = escrowAccounts[msg.sender][collector][receiver]; + require(account.tokensThawing != 0, PaymentsEscrowNotThawing()); + + uint256 tokensThawing = account.tokensThawing; + uint256 thawEndTimestamp = account.thawEndTimestamp; + account.tokensThawing = 0; + account.thawEndTimestamp = 0; + + emit CancelThaw(msg.sender, collector, receiver, tokensThawing, thawEndTimestamp); + } + + /// @inheritdoc IPaymentsEscrow + function withdraw(address collector, address receiver) external override notPaused { + EscrowAccount storage account = escrowAccounts[msg.sender][collector][receiver]; + require(account.thawEndTimestamp != 0, PaymentsEscrowNotThawing()); + require( + account.thawEndTimestamp < block.timestamp, + PaymentsEscrowStillThawing(block.timestamp, account.thawEndTimestamp) + ); + + // Amount is the minimum between the amount being thawed and the actual balance + uint256 tokens = account.tokensThawing > account.balance ? account.balance : account.tokensThawing; + + account.balance -= tokens; + account.tokensThawing = 0; + account.thawEndTimestamp = 0; + _graphToken().pushTokens(msg.sender, tokens); + emit Withdraw(msg.sender, collector, receiver, tokens); + } + + /// @inheritdoc IPaymentsEscrow + function collect( + IGraphPayments.PaymentTypes paymentType, + address payer, + address receiver, + uint256 tokens, + address dataService, + uint256 dataServiceCut, + address receiverDestination + ) external override notPaused { + // Check if there are enough funds in the escrow account + EscrowAccount storage account = escrowAccounts[payer][msg.sender][receiver]; + require(account.balance >= tokens, PaymentsEscrowInsufficientBalance(account.balance, tokens)); + + // Reduce amount from account balance + account.balance -= tokens; + + uint256 escrowBalanceBefore = _graphToken().balanceOf(address(this)); + + _graphToken().approve(address(_graphPayments()), tokens); + _graphPayments().collect(paymentType, receiver, tokens, dataService, dataServiceCut, receiverDestination); + + // Verify that the escrow balance is consistent with the collected tokens + uint256 escrowBalanceAfter = _graphToken().balanceOf(address(this)); + require( + escrowBalanceBefore == tokens + escrowBalanceAfter, + PaymentsEscrowInconsistentCollection(escrowBalanceBefore, escrowBalanceAfter, tokens) + ); + + emit EscrowCollected(paymentType, payer, msg.sender, receiver, tokens, receiverDestination); + } + + /// @inheritdoc IPaymentsEscrow + function getBalance(address payer, address collector, address receiver) external view override returns (uint256) { + EscrowAccount storage account = escrowAccounts[payer][collector][receiver]; + return account.balance > account.tokensThawing ? account.balance - account.tokensThawing : 0; + } + + /** + * @notice Deposits funds into the escrow for a payer-collector-receiver tuple, where + * the payer is the transaction caller. + * @param _payer The address of the payer + * @param _collector The address of the collector + * @param _receiver The address of the receiver + * @param _tokens The amount of tokens to deposit + */ + function _deposit(address _payer, address _collector, address _receiver, uint256 _tokens) private { + escrowAccounts[_payer][_collector][_receiver].balance += _tokens; + _graphToken().pullTokens(msg.sender, _tokens); + emit Deposit(_payer, _collector, _receiver, _tokens); + } +} diff --git a/packages/horizon/contracts/payments/collectors/GraphTallyCollector.sol b/packages/horizon/contracts/payments/collectors/GraphTallyCollector.sol new file mode 100644 index 000000000..671826169 --- /dev/null +++ b/packages/horizon/contracts/payments/collectors/GraphTallyCollector.sol @@ -0,0 +1,219 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +pragma solidity 0.8.27; + +import { IGraphPayments } from "../../interfaces/IGraphPayments.sol"; +import { IGraphTallyCollector } from "../../interfaces/IGraphTallyCollector.sol"; +import { IPaymentsCollector } from "../../interfaces/IPaymentsCollector.sol"; + +import { Authorizable } from "../../utilities/Authorizable.sol"; +import { EIP712 } from "@openzeppelin/contracts/utils/cryptography/EIP712.sol"; +import { PPMMath } from "../../libraries/PPMMath.sol"; + +import { GraphDirectory } from "../../utilities/GraphDirectory.sol"; +import { ECDSA } from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; + +/** + * @title GraphTallyCollector contract + * @dev Implements the {IGraphTallyCollector}, {IPaymentCollector} and {IAuthorizable} interfaces. + * @notice A payments collector contract that can be used to collect payments using a GraphTally RAV (Receipt Aggregate Voucher). + * @dev Note that the contract expects the RAV aggregate value to be monotonically increasing, each successive RAV for the same + * (data service-payer-receiver) tuple should have a value greater than the previous one. The contract will keep track of the tokens + * already collected and calculate the difference to collect. + * @custom:security-contact Please email security+contracts@thegraph.com if you find any + * bugs. We may have an active bug bounty program. + */ +contract GraphTallyCollector is EIP712, GraphDirectory, Authorizable, IGraphTallyCollector { + using PPMMath for uint256; + + /// @notice The EIP712 typehash for the ReceiptAggregateVoucher struct + bytes32 private constant EIP712_RAV_TYPEHASH = + keccak256( + "ReceiptAggregateVoucher(bytes32 collectionId,address payer,address serviceProvider,address dataService,uint64 timestampNs,uint128 valueAggregate,bytes metadata)" + ); + + /// @notice Tracks the amount of tokens already collected by a data service from a payer to a receiver. + /// @dev The collectionId provides a secondary key for grouping payment tracking if needed. Data services that do not require + /// grouping can use the same collectionId for all payments (0x00 or some other default value). + mapping(address dataService => mapping(bytes32 collectionId => mapping(address receiver => mapping(address payer => uint256 tokens)))) + public tokensCollected; + + /** + * @notice Constructs a new instance of the GraphTallyCollector contract. + * @param eip712Name The name of the EIP712 domain. + * @param eip712Version The version of the EIP712 domain. + * @param controller The address of the Graph controller. + * @param revokeSignerThawingPeriod The duration (in seconds) in which a signer is thawing before they can be revoked. + */ + constructor( + string memory eip712Name, + string memory eip712Version, + address controller, + uint256 revokeSignerThawingPeriod + ) EIP712(eip712Name, eip712Version) GraphDirectory(controller) Authorizable(revokeSignerThawingPeriod) {} + + /** + * @notice See {IGraphPayments.collect}. + * @dev Requirements: + * - Caller must be the data service the RAV was issued to. + * - Signer of the RAV must be authorized to sign for the payer. + * - Service provider must have an active provision with the data service to collect payments. + * @notice REVERT: This function may revert if ECDSA.recover fails, check ECDSA library for details. + * @param paymentType The payment type to collect + * @param data Additional data required for the payment collection. Encoded as follows: + * - SignedRAV `signedRAV`: The signed RAV + * - uint256 `dataServiceCut`: The data service cut in PPM + * - address `receiverDestination`: The address where the receiver's payment should be sent. + * @return The amount of tokens collected + */ + /// @inheritdoc IPaymentsCollector + function collect(IGraphPayments.PaymentTypes paymentType, bytes calldata data) external override returns (uint256) { + return _collect(paymentType, data, 0); + } + + /// @inheritdoc IGraphTallyCollector + function collect( + IGraphPayments.PaymentTypes paymentType, + bytes calldata data, + uint256 tokensToCollect + ) external override returns (uint256) { + return _collect(paymentType, data, tokensToCollect); + } + + /// @inheritdoc IGraphTallyCollector + function recoverRAVSigner(SignedRAV calldata signedRAV) external view override returns (address) { + return _recoverRAVSigner(signedRAV); + } + + /// @inheritdoc IGraphTallyCollector + function encodeRAV(ReceiptAggregateVoucher calldata rav) external view returns (bytes32) { + return _encodeRAV(rav); + } + + /** + * @notice See {IPaymentsCollector.collect} + * This variant adds the ability to partially collect a RAV by specifying the amount of tokens to collect. + * @param _paymentType The payment type to collect + * @param _data Additional data required for the payment collection + * @param _tokensToCollect The amount of tokens to collect. If 0, all tokens from the RAV will be collected. + * @return The amount of tokens collected + */ + function _collect( + IGraphPayments.PaymentTypes _paymentType, + bytes calldata _data, + uint256 _tokensToCollect + ) private returns (uint256) { + (SignedRAV memory signedRAV, uint256 dataServiceCut, address receiverDestination) = abi.decode(_data, (SignedRAV, uint256, address)); + + // Ensure caller is the RAV data service + require( + signedRAV.rav.dataService == msg.sender, + GraphTallyCollectorCallerNotDataService(msg.sender, signedRAV.rav.dataService) + ); + + // Ensure RAV signer is authorized for the payer + _requireAuthorizedSigner(signedRAV); + + bytes32 collectionId = signedRAV.rav.collectionId; + address dataService = signedRAV.rav.dataService; + address receiver = signedRAV.rav.serviceProvider; + + // Check the service provider has an active provision with the data service + // This prevents an attack where the payer can deny the service provider from collecting payments + // by using a signer as data service to syphon off the tokens in the escrow to an account they control + { + uint256 tokensAvailable = _graphStaking().getProviderTokensAvailable( + signedRAV.rav.serviceProvider, + signedRAV.rav.dataService + ); + require(tokensAvailable > 0, GraphTallyCollectorUnauthorizedDataService(signedRAV.rav.dataService)); + } + + uint256 tokensToCollect = 0; + { + uint256 tokensRAV = signedRAV.rav.valueAggregate; + uint256 tokensAlreadyCollected = tokensCollected[dataService][collectionId][receiver][signedRAV.rav.payer]; + require( + tokensRAV > tokensAlreadyCollected, + GraphTallyCollectorInconsistentRAVTokens(tokensRAV, tokensAlreadyCollected) + ); + + if (_tokensToCollect == 0) { + tokensToCollect = tokensRAV - tokensAlreadyCollected; + } else { + require( + _tokensToCollect <= tokensRAV - tokensAlreadyCollected, + GraphTallyCollectorInvalidTokensToCollectAmount( + _tokensToCollect, + tokensRAV - tokensAlreadyCollected + ) + ); + tokensToCollect = _tokensToCollect; + } + } + + if (tokensToCollect > 0) { + tokensCollected[dataService][collectionId][receiver][signedRAV.rav.payer] += tokensToCollect; + _graphPaymentsEscrow().collect(_paymentType, signedRAV.rav.payer, receiver, tokensToCollect, dataService, dataServiceCut, receiverDestination); + } + + emit PaymentCollected(_paymentType, collectionId, signedRAV.rav.payer, receiver, dataService, tokensToCollect); + + // This event is emitted to allow reconstructing RAV history with onchain data. + emit RAVCollected( + collectionId, + signedRAV.rav.payer, + receiver, + dataService, + signedRAV.rav.timestampNs, + signedRAV.rav.valueAggregate, + signedRAV.rav.metadata, + signedRAV.signature + ); + + return tokensToCollect; + } + + /** + * @dev Recovers the signer address of a signed ReceiptAggregateVoucher (RAV). + * @param _signedRAV The SignedRAV containing the RAV and its signature. + * @return The address of the signer. + */ + function _recoverRAVSigner(SignedRAV memory _signedRAV) private view returns (address) { + bytes32 messageHash = _encodeRAV(_signedRAV.rav); + return ECDSA.recover(messageHash, _signedRAV.signature); + } + + /** + * @dev Computes the hash of a ReceiptAggregateVoucher (RAV). + * @param _rav The RAV for which to compute the hash. + * @return The hash of the RAV. + */ + function _encodeRAV(ReceiptAggregateVoucher memory _rav) private view returns (bytes32) { + return + _hashTypedDataV4( + keccak256( + abi.encode( + EIP712_RAV_TYPEHASH, + _rav.collectionId, + _rav.payer, + _rav.serviceProvider, + _rav.dataService, + _rav.timestampNs, + _rav.valueAggregate, + keccak256(_rav.metadata) + ) + ) + ); + } + + /** + * @notice Reverts if the RAV signer is not authorized by the payer + * @param _signedRAV The signed RAV + */ + function _requireAuthorizedSigner(SignedRAV memory _signedRAV) private view { + require( + _isAuthorized(_signedRAV.rav.payer, _recoverRAVSigner(_signedRAV)), + GraphTallyCollectorInvalidRAVSigner() + ); + } +} diff --git a/packages/horizon/contracts/staking/HorizonStaking.sol b/packages/horizon/contracts/staking/HorizonStaking.sol new file mode 100644 index 000000000..49d753ffb --- /dev/null +++ b/packages/horizon/contracts/staking/HorizonStaking.sol @@ -0,0 +1,1262 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity 0.8.27; + +import { IGraphToken } from "@graphprotocol/contracts/contracts/token/IGraphToken.sol"; +import { IHorizonStakingMain } from "../interfaces/internal/IHorizonStakingMain.sol"; +import { IHorizonStakingExtension } from "../interfaces/internal/IHorizonStakingExtension.sol"; +import { IGraphPayments } from "../interfaces/IGraphPayments.sol"; + +import { TokenUtils } from "@graphprotocol/contracts/contracts/utils/TokenUtils.sol"; +import { MathUtils } from "../libraries/MathUtils.sol"; +import { PPMMath } from "../libraries/PPMMath.sol"; +import { LinkedList } from "../libraries/LinkedList.sol"; + +import { HorizonStakingBase } from "./HorizonStakingBase.sol"; + +/** + * @title HorizonStaking contract + * @notice The {HorizonStaking} contract allows service providers to stake and provision tokens to verifiers to be used + * as economic security for a service. It also allows delegators to delegate towards a service provider provision. + * @dev Implements the {IHorizonStakingMain} interface. + * @dev This is the main Staking contract in The Graph protocol after the Horizon upgrade. + * It is designed to be deployed as an upgrade to the L2Staking contract from the legacy contracts package. + * @dev It uses a {HorizonStakingExtension} contract to implement the full {IHorizonStaking} interface through delegatecalls. + * This is due to the contract size limit on Arbitrum (24kB). The extension contract implements functionality to support + * the legacy staking functions. It can be eventually removed without affecting the main staking contract. + * @custom:security-contact Please email security+contracts@thegraph.com if you find any + * bugs. We may have an active bug bounty program. + */ +contract HorizonStaking is HorizonStakingBase, IHorizonStakingMain { + using TokenUtils for IGraphToken; + using PPMMath for uint256; + using LinkedList for LinkedList.List; + + /// @dev Maximum number of simultaneous stake thaw requests (per provision) or undelegations (per delegation) + uint256 private constant MAX_THAW_REQUESTS = 1_000; + + /// @dev Address of the staking extension contract + address private immutable STAKING_EXTENSION_ADDRESS; + + /// @dev Minimum amount of delegation. + uint256 private constant MIN_DELEGATION = 1e18; + + /** + * @notice Checks that the caller is authorized to operate over a provision. + * @param serviceProvider The address of the service provider. + * @param verifier The address of the verifier. + */ + modifier onlyAuthorized(address serviceProvider, address verifier) { + require( + _isAuthorized(serviceProvider, verifier, msg.sender), + HorizonStakingNotAuthorized(serviceProvider, verifier, msg.sender) + ); + _; + } + + /** + * @notice Checks that the caller is authorized to operate over a provision or it is the verifier. + * @param serviceProvider The address of the service provider. + * @param verifier The address of the verifier. + */ + modifier onlyAuthorizedOrVerifier(address serviceProvider, address verifier) { + require( + _isAuthorized(serviceProvider, verifier, msg.sender) || msg.sender == verifier, + HorizonStakingNotAuthorized(serviceProvider, verifier, msg.sender) + ); + _; + } + + /** + * @dev The staking contract is upgradeable however we still use the constructor to set + * a few immutable variables. + * @param controller The address of the Graph controller contract. + * @param stakingExtensionAddress The address of the staking extension contract. + * @param subgraphDataServiceAddress The address of the subgraph data service. + */ + constructor( + address controller, + address stakingExtensionAddress, + address subgraphDataServiceAddress + ) HorizonStakingBase(controller, subgraphDataServiceAddress) { + STAKING_EXTENSION_ADDRESS = stakingExtensionAddress; + } + + /** + * @notice Delegates the current call to the StakingExtension implementation. + * @dev This function does not return to its internal call site, it will return directly to the + * external caller. + */ + // solhint-disable-next-line payable-fallback, no-complex-fallback + fallback() external { + address extensionImpl = STAKING_EXTENSION_ADDRESS; + // solhint-disable-next-line no-inline-assembly + assembly { + // (a) get free memory pointer + let ptr := mload(0x40) + + // (1) copy incoming call data + calldatacopy(ptr, 0, calldatasize()) + + // (2) forward call to logic contract + let result := delegatecall(gas(), extensionImpl, ptr, calldatasize(), 0, 0) + let size := returndatasize() + + // (3) retrieve return data + returndatacopy(ptr, 0, size) + + // (4) forward return data back to caller + switch result + case 0 { + revert(ptr, size) + } + default { + return(ptr, size) + } + } + } + + /* + * STAKING + */ + + /// @inheritdoc IHorizonStakingMain + function stake(uint256 tokens) external override notPaused { + _stakeTo(msg.sender, tokens); + } + + /// @inheritdoc IHorizonStakingMain + function stakeTo(address serviceProvider, uint256 tokens) external override notPaused { + _stakeTo(serviceProvider, tokens); + } + + /// @inheritdoc IHorizonStakingMain + function stakeToProvision( + address serviceProvider, + address verifier, + uint256 tokens + ) external override notPaused onlyAuthorizedOrVerifier(serviceProvider, verifier) { + _stakeTo(serviceProvider, tokens); + _addToProvision(serviceProvider, verifier, tokens); + } + + /// @inheritdoc IHorizonStakingMain + function unstake(uint256 tokens) external override notPaused { + _unstake(tokens); + } + + /// @inheritdoc IHorizonStakingMain + function withdraw() external override notPaused { + _withdraw(msg.sender); + } + + /* + * PROVISIONS + */ + + /// @inheritdoc IHorizonStakingMain + function provision( + address serviceProvider, + address verifier, + uint256 tokens, + uint32 maxVerifierCut, + uint64 thawingPeriod + ) external override notPaused onlyAuthorized(serviceProvider, verifier) { + _createProvision(serviceProvider, tokens, verifier, maxVerifierCut, thawingPeriod); + } + + /// @inheritdoc IHorizonStakingMain + function addToProvision( + address serviceProvider, + address verifier, + uint256 tokens + ) external override notPaused onlyAuthorized(serviceProvider, verifier) { + _addToProvision(serviceProvider, verifier, tokens); + } + + /// @inheritdoc IHorizonStakingMain + function thaw( + address serviceProvider, + address verifier, + uint256 tokens + ) external override notPaused onlyAuthorized(serviceProvider, verifier) returns (bytes32) { + return _thaw(serviceProvider, verifier, tokens); + } + + /// @inheritdoc IHorizonStakingMain + function deprovision( + address serviceProvider, + address verifier, + uint256 nThawRequests + ) external override onlyAuthorized(serviceProvider, verifier) notPaused { + _deprovision(serviceProvider, verifier, nThawRequests); + } + + /// @inheritdoc IHorizonStakingMain + function reprovision( + address serviceProvider, + address oldVerifier, + address newVerifier, + uint256 nThawRequests + ) + external + override + notPaused + onlyAuthorized(serviceProvider, oldVerifier) + onlyAuthorized(serviceProvider, newVerifier) + { + uint256 tokensThawed = _deprovision(serviceProvider, oldVerifier, nThawRequests); + _addToProvision(serviceProvider, newVerifier, tokensThawed); + } + + /// @inheritdoc IHorizonStakingMain + function setProvisionParameters( + address serviceProvider, + address verifier, + uint32 newMaxVerifierCut, + uint64 newThawingPeriod + ) external override notPaused onlyAuthorized(serviceProvider, verifier) { + // Provision must exist + Provision storage prov = _provisions[serviceProvider][verifier]; + require(prov.createdAt != 0, HorizonStakingInvalidProvision(serviceProvider, verifier)); + + bool verifierCutChanged = prov.maxVerifierCutPending != newMaxVerifierCut; + bool thawingPeriodChanged = prov.thawingPeriodPending != newThawingPeriod; + + if (verifierCutChanged || thawingPeriodChanged) { + if (verifierCutChanged) { + require(PPMMath.isValidPPM(newMaxVerifierCut), HorizonStakingInvalidMaxVerifierCut(newMaxVerifierCut)); + prov.maxVerifierCutPending = newMaxVerifierCut; + } + if (thawingPeriodChanged) { + require( + newThawingPeriod <= _maxThawingPeriod, + HorizonStakingInvalidThawingPeriod(newThawingPeriod, _maxThawingPeriod) + ); + prov.thawingPeriodPending = newThawingPeriod; + } + + prov.lastParametersStagedAt = block.timestamp; + emit ProvisionParametersStaged(serviceProvider, verifier, newMaxVerifierCut, newThawingPeriod); + } + } + + /// @inheritdoc IHorizonStakingMain + function acceptProvisionParameters(address serviceProvider) external override notPaused { + address verifier = msg.sender; + + // Provision must exist + Provision storage prov = _provisions[serviceProvider][verifier]; + require(prov.createdAt != 0, HorizonStakingInvalidProvision(serviceProvider, verifier)); + + if ((prov.maxVerifierCutPending != prov.maxVerifierCut) || (prov.thawingPeriodPending != prov.thawingPeriod)) { + prov.maxVerifierCut = prov.maxVerifierCutPending; + prov.thawingPeriod = prov.thawingPeriodPending; + emit ProvisionParametersSet(serviceProvider, verifier, prov.maxVerifierCut, prov.thawingPeriod); + } + } + + /* + * DELEGATION + */ + + /// @inheritdoc IHorizonStakingMain + function delegate( + address serviceProvider, + address verifier, + uint256 tokens, + uint256 minSharesOut + ) external override notPaused { + require(tokens != 0, HorizonStakingInvalidZeroTokens()); + _graphToken().pullTokens(msg.sender, tokens); + _delegate(serviceProvider, verifier, tokens, minSharesOut); + } + + /// @inheritdoc IHorizonStakingMain + function addToDelegationPool( + address serviceProvider, + address verifier, + uint256 tokens + ) external override notPaused { + require(tokens != 0, HorizonStakingInvalidZeroTokens()); + + // Provision must exist before adding to delegation pool + Provision memory prov = _provisions[serviceProvider][verifier]; + require(prov.createdAt != 0, HorizonStakingInvalidProvision(serviceProvider, verifier)); + + // Delegation pool must exist before adding tokens + DelegationPoolInternal storage pool = _getDelegationPool(serviceProvider, verifier); + require(pool.shares > 0, HorizonStakingInvalidDelegationPool(serviceProvider, verifier)); + + pool.tokens = pool.tokens + tokens; + _graphToken().pullTokens(msg.sender, tokens); + emit TokensToDelegationPoolAdded(serviceProvider, verifier, tokens); + } + + /// @inheritdoc IHorizonStakingMain + function undelegate( + address serviceProvider, + address verifier, + uint256 shares + ) external override notPaused returns (bytes32) { + return _undelegate(serviceProvider, verifier, shares); + } + + /// @inheritdoc IHorizonStakingMain + function withdrawDelegated( + address serviceProvider, + address verifier, + uint256 nThawRequests + ) external override notPaused { + _withdrawDelegated(serviceProvider, verifier, address(0), address(0), 0, nThawRequests); + } + + /// @inheritdoc IHorizonStakingMain + function redelegate( + address oldServiceProvider, + address oldVerifier, + address newServiceProvider, + address newVerifier, + uint256 minSharesForNewProvider, + uint256 nThawRequests + ) external override notPaused { + require(newServiceProvider != address(0), HorizonStakingInvalidServiceProviderZeroAddress()); + require(newVerifier != address(0), HorizonStakingInvalidVerifierZeroAddress()); + _withdrawDelegated( + oldServiceProvider, + oldVerifier, + newServiceProvider, + newVerifier, + minSharesForNewProvider, + nThawRequests + ); + } + + /// @inheritdoc IHorizonStakingMain + function setDelegationFeeCut( + address serviceProvider, + address verifier, + IGraphPayments.PaymentTypes paymentType, + uint256 feeCut + ) external override notPaused onlyAuthorized(serviceProvider, verifier) { + require(PPMMath.isValidPPM(feeCut), HorizonStakingInvalidDelegationFeeCut(feeCut)); + _delegationFeeCut[serviceProvider][verifier][paymentType] = feeCut; + emit DelegationFeeCutSet(serviceProvider, verifier, paymentType, feeCut); + } + + /// @inheritdoc IHorizonStakingMain + function delegate(address serviceProvider, uint256 tokens) external override notPaused { + require(tokens != 0, HorizonStakingInvalidZeroTokens()); + _graphToken().pullTokens(msg.sender, tokens); + _delegate(serviceProvider, SUBGRAPH_DATA_SERVICE_ADDRESS, tokens, 0); + } + + /// @inheritdoc IHorizonStakingMain + function undelegate(address serviceProvider, uint256 shares) external override notPaused { + _undelegate(serviceProvider, SUBGRAPH_DATA_SERVICE_ADDRESS, shares); + } + + /// @inheritdoc IHorizonStakingMain + function withdrawDelegated( + address serviceProvider, + address // deprecated - kept for backwards compatibility + ) external override notPaused returns (uint256) { + // Get the delegation pool of the indexer + address delegator = msg.sender; + DelegationPoolInternal storage pool = _legacyDelegationPools[serviceProvider]; + DelegationInternal storage delegation = pool.delegators[delegator]; + + // Validation + uint256 tokensToWithdraw = 0; + uint256 currentEpoch = _graphEpochManager().currentEpoch(); + if ( + delegation.__DEPRECATED_tokensLockedUntil > 0 && currentEpoch >= delegation.__DEPRECATED_tokensLockedUntil + ) { + tokensToWithdraw = delegation.__DEPRECATED_tokensLocked; + } + require(tokensToWithdraw > 0, HorizonStakingNothingToWithdraw()); + + // Reset lock + delegation.__DEPRECATED_tokensLocked = 0; + delegation.__DEPRECATED_tokensLockedUntil = 0; + + emit StakeDelegatedWithdrawn(serviceProvider, delegator, tokensToWithdraw); + + // -- Interactions -- + + // Return tokens to the delegator + _graphToken().pushTokens(delegator, tokensToWithdraw); + + return tokensToWithdraw; + } + + /* + * SLASHING + */ + + /// @inheritdoc IHorizonStakingMain + function slash( + address serviceProvider, + uint256 tokens, + uint256 tokensVerifier, + address verifierDestination + ) external override notPaused { + // TRANSITION PERIOD: remove after the transition period + // Check if sender is authorized to slash on the deprecated list + if (__DEPRECATED_slashers[msg.sender]) { + // Forward call to staking extension + // solhint-disable-next-line avoid-low-level-calls + (bool success, ) = STAKING_EXTENSION_ADDRESS.delegatecall( + abi.encodeCall( + IHorizonStakingExtension.legacySlash, + (serviceProvider, tokens, tokensVerifier, verifierDestination) + ) + ); + require(success, HorizonStakingLegacySlashFailed()); + return; + } + + address verifier = msg.sender; + Provision storage prov = _provisions[serviceProvider][verifier]; + DelegationPoolInternal storage pool = _getDelegationPool(serviceProvider, verifier); + uint256 tokensProvisionTotal = prov.tokens + pool.tokens; + require(tokensProvisionTotal != 0, HorizonStakingNoTokensToSlash()); + + uint256 tokensToSlash = MathUtils.min(tokens, tokensProvisionTotal); + + // Slash service provider first + // - A portion goes to verifier as reward + // - A portion gets burned + uint256 providerTokensSlashed = MathUtils.min(prov.tokens, tokensToSlash); + if (providerTokensSlashed > 0) { + // Pay verifier reward - must be within the maxVerifierCut percentage + uint256 maxVerifierTokens = providerTokensSlashed.mulPPM(prov.maxVerifierCut); + require( + maxVerifierTokens >= tokensVerifier, + HorizonStakingTooManyTokens(tokensVerifier, maxVerifierTokens) + ); + if (tokensVerifier > 0) { + _graphToken().pushTokens(verifierDestination, tokensVerifier); + emit VerifierTokensSent(serviceProvider, verifier, verifierDestination, tokensVerifier); + } + + // Burn remainder + _graphToken().burnTokens(providerTokensSlashed - tokensVerifier); + + // Provision accounting - round down, 1 wei max precision loss + prov.tokensThawing = (prov.tokensThawing * (prov.tokens - providerTokensSlashed)) / prov.tokens; + prov.tokens = prov.tokens - providerTokensSlashed; + + // If the slashing leaves the thawing shares with no thawing tokens, cancel pending thawings by: + // - deleting all thawing shares + // - incrementing the nonce to invalidate pending thaw requests + if (prov.sharesThawing != 0 && prov.tokensThawing == 0) { + prov.sharesThawing = 0; + prov.thawingNonce++; + } + + // Service provider accounting + _serviceProviders[serviceProvider].tokensProvisioned = + _serviceProviders[serviceProvider].tokensProvisioned - + providerTokensSlashed; + _serviceProviders[serviceProvider].tokensStaked = + _serviceProviders[serviceProvider].tokensStaked - + providerTokensSlashed; + + emit ProvisionSlashed(serviceProvider, verifier, providerTokensSlashed); + } + + // Slash delegators if needed + // - Slashed delegation is entirely burned + // Since tokensToSlash is already limited above, this subtraction will remain within pool.tokens. + tokensToSlash = tokensToSlash - providerTokensSlashed; + if (tokensToSlash > 0) { + if (_delegationSlashingEnabled) { + // Burn tokens + _graphToken().burnTokens(tokensToSlash); + + // Delegation pool accounting - round down, 1 wei max precision loss + pool.tokensThawing = (pool.tokensThawing * (pool.tokens - tokensToSlash)) / pool.tokens; + pool.tokens = pool.tokens - tokensToSlash; + + // If the slashing leaves the thawing shares with no thawing tokens, cancel pending thawings by: + // - deleting all thawing shares + // - incrementing the nonce to invalidate pending thaw requests + // Note that thawing shares are completely lost, delegators won't get back the corresponding + // delegation pool shares. + if (pool.sharesThawing != 0 && pool.tokensThawing == 0) { + pool.sharesThawing = 0; + pool.thawingNonce++; + } + + emit DelegationSlashed(serviceProvider, verifier, tokensToSlash); + } else { + emit DelegationSlashingSkipped(serviceProvider, verifier, tokensToSlash); + } + } + } + + /* + * LOCKED VERIFIERS + */ + + /// @inheritdoc IHorizonStakingMain + function provisionLocked( + address serviceProvider, + address verifier, + uint256 tokens, + uint32 maxVerifierCut, + uint64 thawingPeriod + ) external override notPaused onlyAuthorized(serviceProvider, verifier) { + require(_allowedLockedVerifiers[verifier], HorizonStakingVerifierNotAllowed(verifier)); + _createProvision(serviceProvider, tokens, verifier, maxVerifierCut, thawingPeriod); + } + + /// @inheritdoc IHorizonStakingMain + function setOperatorLocked(address verifier, address operator, bool allowed) external override notPaused { + require(_allowedLockedVerifiers[verifier], HorizonStakingVerifierNotAllowed(verifier)); + _setOperator(verifier, operator, allowed); + } + + /* + * GOVERNANCE + */ + + /// @inheritdoc IHorizonStakingMain + function setAllowedLockedVerifier(address verifier, bool allowed) external override onlyGovernor { + _allowedLockedVerifiers[verifier] = allowed; + emit AllowedLockedVerifierSet(verifier, allowed); + } + + /// @inheritdoc IHorizonStakingMain + function setDelegationSlashingEnabled() external override onlyGovernor { + _delegationSlashingEnabled = true; + emit DelegationSlashingEnabled(); + } + + /// @inheritdoc IHorizonStakingMain + function clearThawingPeriod() external override onlyGovernor { + __DEPRECATED_thawingPeriod = 0; + emit ThawingPeriodCleared(); + } + + /// @inheritdoc IHorizonStakingMain + function setMaxThawingPeriod(uint64 maxThawingPeriod) external override onlyGovernor { + _maxThawingPeriod = maxThawingPeriod; + emit MaxThawingPeriodSet(_maxThawingPeriod); + } + + /* + * OPERATOR + */ + + /// @inheritdoc IHorizonStakingMain + function setOperator(address verifier, address operator, bool allowed) external override notPaused { + _setOperator(verifier, operator, allowed); + } + + /// @inheritdoc IHorizonStakingMain + function isAuthorized( + address serviceProvider, + address verifier, + address operator + ) external view override returns (bool) { + return _isAuthorized(serviceProvider, verifier, operator); + } + + /* + * GETTERS + */ + + /// @inheritdoc IHorizonStakingMain + function getStakingExtension() external view override returns (address) { + return STAKING_EXTENSION_ADDRESS; + } + + /* + * PRIVATE FUNCTIONS + */ + + /** + * @notice Deposit tokens on the service provider stake, on behalf of the service provider. + * @dev Pulls tokens from the caller. + * @param _serviceProvider Address of the service provider + * @param _tokens Amount of tokens to stake + */ + function _stakeTo(address _serviceProvider, uint256 _tokens) private { + require(_tokens != 0, HorizonStakingInvalidZeroTokens()); + + // Transfer tokens to stake from caller to this contract + _graphToken().pullTokens(msg.sender, _tokens); + + // Stake the transferred tokens + _stake(_serviceProvider, _tokens); + } + + /** + * @notice Move idle stake back to the owner's account. + * Stake is removed from the protocol: + * - During the transition period it's locked for a period of time before it can be withdrawn + * by calling {withdraw}. + * - After the transition period it's immediately withdrawn. + * Note that after the transition period if there are tokens still locked they will have to be + * withdrawn by calling {withdraw}. + * @param _tokens Amount of tokens to unstake + */ + function _unstake(uint256 _tokens) private { + address serviceProvider = msg.sender; + require(_tokens != 0, HorizonStakingInvalidZeroTokens()); + uint256 tokensIdle = _getIdleStake(serviceProvider); + require(_tokens <= tokensIdle, HorizonStakingInsufficientIdleStake(_tokens, tokensIdle)); + + ServiceProviderInternal storage sp = _serviceProviders[serviceProvider]; + uint256 stakedTokens = sp.tokensStaked; + + // This is also only during the transition period: we need + // to ensure tokens stay locked after closing legacy allocations. + // After sufficient time (56 days?) we should remove the closeAllocation function + // and set the thawing period to 0. + uint256 lockingPeriod = __DEPRECATED_thawingPeriod; + if (lockingPeriod == 0) { + sp.tokensStaked = stakedTokens - _tokens; + _graphToken().pushTokens(serviceProvider, _tokens); + emit HorizonStakeWithdrawn(serviceProvider, _tokens); + } else { + // Before locking more tokens, withdraw any unlocked ones if possible + if (sp.__DEPRECATED_tokensLocked != 0 && block.number >= sp.__DEPRECATED_tokensLockedUntil) { + _withdraw(serviceProvider); + } + // TRANSITION PERIOD: remove after the transition period + // Take into account period averaging for multiple unstake requests + if (sp.__DEPRECATED_tokensLocked > 0) { + lockingPeriod = MathUtils.weightedAverageRoundingUp( + MathUtils.diffOrZero(sp.__DEPRECATED_tokensLockedUntil, block.number), // Remaining thawing period + sp.__DEPRECATED_tokensLocked, // Weighted by remaining unstaked tokens + lockingPeriod, // Thawing period + _tokens // Weighted by new tokens to unstake + ); + } + + // Update balances + sp.__DEPRECATED_tokensLocked = sp.__DEPRECATED_tokensLocked + _tokens; + sp.__DEPRECATED_tokensLockedUntil = block.number + lockingPeriod; + emit HorizonStakeLocked(serviceProvider, sp.__DEPRECATED_tokensLocked, sp.__DEPRECATED_tokensLockedUntil); + } + } + + /** + * @notice Withdraw service provider tokens once the thawing period (initiated by {unstake}) has passed. + * All thawed tokens are withdrawn. + * @dev TRANSITION PERIOD: This is only needed during the transition period while we still have + * a global lock. After that, unstake() will automatically withdraw. + * @param _serviceProvider Address of service provider to withdraw funds from + */ + function _withdraw(address _serviceProvider) private { + // Get tokens available for withdraw and update balance + ServiceProviderInternal storage sp = _serviceProviders[_serviceProvider]; + uint256 tokensToWithdraw = sp.__DEPRECATED_tokensLocked; + require(tokensToWithdraw != 0, HorizonStakingInvalidZeroTokens()); + require( + block.number >= sp.__DEPRECATED_tokensLockedUntil, + HorizonStakingStillThawing(sp.__DEPRECATED_tokensLockedUntil) + ); + + // Reset locked tokens + sp.__DEPRECATED_tokensLocked = 0; + sp.__DEPRECATED_tokensLockedUntil = 0; + + sp.tokensStaked = sp.tokensStaked - tokensToWithdraw; + + // Return tokens to the service provider + _graphToken().pushTokens(_serviceProvider, tokensToWithdraw); + + emit HorizonStakeWithdrawn(_serviceProvider, tokensToWithdraw); + } + + /** + * @notice Provision stake to a verifier. The tokens will be locked with a thawing period + * and will be slashable by the verifier. This is the main mechanism to provision stake to a data + * service, where the data service is the verifier. + * This function can be called by the service provider or by an operator authorized by the provider + * for this specific verifier. + * @dev TRANSITION PERIOD: During the transition period, only the subgraph data service can be used as a verifier. This + * prevents an escape hatch for legacy allocation stake. + * @param _serviceProvider The service provider address + * @param _verifier The verifier address for which the tokens are provisioned (who will be able to slash the tokens) + * @param _tokens The amount of tokens that will be locked and slashable + * @param _maxVerifierCut The maximum cut, expressed in PPM, that a verifier can transfer instead of burning when slashing + * @param _thawingPeriod The period in seconds that the tokens will be thawing before they can be removed from the provision + */ + function _createProvision( + address _serviceProvider, + uint256 _tokens, + address _verifier, + uint32 _maxVerifierCut, + uint64 _thawingPeriod + ) private { + require(_tokens > 0, HorizonStakingInvalidZeroTokens()); + // TRANSITION PERIOD: Remove this after the transition period - it prevents an early escape hatch for legacy allocations + require( + _verifier == SUBGRAPH_DATA_SERVICE_ADDRESS || __DEPRECATED_thawingPeriod == 0, + HorizonStakingInvalidVerifier(_verifier) + ); + require(PPMMath.isValidPPM(_maxVerifierCut), HorizonStakingInvalidMaxVerifierCut(_maxVerifierCut)); + require( + _thawingPeriod <= _maxThawingPeriod, + HorizonStakingInvalidThawingPeriod(_thawingPeriod, _maxThawingPeriod) + ); + require(_provisions[_serviceProvider][_verifier].createdAt == 0, HorizonStakingProvisionAlreadyExists()); + uint256 tokensIdle = _getIdleStake(_serviceProvider); + require(_tokens <= tokensIdle, HorizonStakingInsufficientIdleStake(_tokens, tokensIdle)); + + _provisions[_serviceProvider][_verifier] = Provision({ + tokens: _tokens, + tokensThawing: 0, + sharesThawing: 0, + maxVerifierCut: _maxVerifierCut, + thawingPeriod: _thawingPeriod, + createdAt: uint64(block.timestamp), + maxVerifierCutPending: _maxVerifierCut, + thawingPeriodPending: _thawingPeriod, + lastParametersStagedAt: 0, + thawingNonce: 0 + }); + + ServiceProviderInternal storage sp = _serviceProviders[_serviceProvider]; + sp.tokensProvisioned = sp.tokensProvisioned + _tokens; + + emit ProvisionCreated(_serviceProvider, _verifier, _tokens, _maxVerifierCut, _thawingPeriod); + } + + /** + * @notice Adds tokens from the service provider's idle stake to a provision + * @param _serviceProvider The service provider address + * @param _verifier The verifier address + * @param _tokens The amount of tokens to add to the provision + */ + function _addToProvision(address _serviceProvider, address _verifier, uint256 _tokens) private { + require(_tokens != 0, HorizonStakingInvalidZeroTokens()); + + Provision storage prov = _provisions[_serviceProvider][_verifier]; + require(prov.createdAt != 0, HorizonStakingInvalidProvision(_serviceProvider, _verifier)); + uint256 tokensIdle = _getIdleStake(_serviceProvider); + require(_tokens <= tokensIdle, HorizonStakingInsufficientIdleStake(_tokens, tokensIdle)); + + prov.tokens = prov.tokens + _tokens; + _serviceProviders[_serviceProvider].tokensProvisioned = + _serviceProviders[_serviceProvider].tokensProvisioned + + _tokens; + emit ProvisionIncreased(_serviceProvider, _verifier, _tokens); + } + + /** + * @notice Start thawing tokens to remove them from a provision. + * This function can be called by the service provider or by an operator authorized by the provider + * for this specific verifier. + * + * Note that removing tokens from a provision is a two step process: + * - First the tokens are thawed using this function. + * - Then after the thawing period, the tokens are removed from the provision using {deprovision} + * or {reprovision}. + * + * @dev We use a thawing pool to keep track of tokens thawing for multiple thaw requests. + * If due to slashing the thawing pool loses all of its tokens, the pool is reset and all pending thaw + * requests are invalidated. + * + * @param _serviceProvider The service provider address + * @param _verifier The verifier address for which the tokens are provisioned + * @param _tokens The amount of tokens to thaw + * @return The ID of the thaw request + */ + function _thaw(address _serviceProvider, address _verifier, uint256 _tokens) private returns (bytes32) { + require(_tokens != 0, HorizonStakingInvalidZeroTokens()); + uint256 tokensAvailable = _getProviderTokensAvailable(_serviceProvider, _verifier); + require(tokensAvailable >= _tokens, HorizonStakingInsufficientTokens(tokensAvailable, _tokens)); + + Provision storage prov = _provisions[_serviceProvider][_verifier]; + + // Calculate shares to issue + // Thawing pool is reset/initialized when the pool is empty: prov.tokensThawing == 0 + // Round thawing shares up to ensure fairness and avoid undervaluing the shares due to rounding down. + uint256 thawingShares = prov.tokensThawing == 0 + ? _tokens + : ((prov.sharesThawing * _tokens + prov.tokensThawing - 1) / prov.tokensThawing); + uint64 thawingUntil = uint64(block.timestamp + uint256(prov.thawingPeriod)); + + prov.sharesThawing = prov.sharesThawing + thawingShares; + prov.tokensThawing = prov.tokensThawing + _tokens; + + bytes32 thawRequestId = _createThawRequest( + ThawRequestType.Provision, + _serviceProvider, + _verifier, + _serviceProvider, + thawingShares, + thawingUntil, + prov.thawingNonce + ); + emit ProvisionThawed(_serviceProvider, _verifier, _tokens); + return thawRequestId; + } + + /** + * @notice Remove tokens from a provision and move them back to the service provider's idle stake. + * @dev The parameter `nThawRequests` can be set to a non zero value to fulfill a specific number of thaw + * requests in the event that fulfilling all of them results in a gas limit error. Otherwise, the function + * will attempt to fulfill all thaw requests until the first one that is not yet expired is found. + * @param _serviceProvider The service provider address + * @param _verifier The verifier address + * @param _nThawRequests The number of thaw requests to fulfill. Set to 0 to fulfill all thaw requests. + * @return The amount of tokens that were removed from the provision + */ + function _deprovision( + address _serviceProvider, + address _verifier, + uint256 _nThawRequests + ) private returns (uint256) { + Provision storage prov = _provisions[_serviceProvider][_verifier]; + + uint256 tokensThawed_ = 0; + uint256 sharesThawing = prov.sharesThawing; + uint256 tokensThawing = prov.tokensThawing; + + FulfillThawRequestsParams memory params = FulfillThawRequestsParams({ + requestType: ThawRequestType.Provision, + serviceProvider: _serviceProvider, + verifier: _verifier, + owner: _serviceProvider, + tokensThawing: tokensThawing, + sharesThawing: sharesThawing, + nThawRequests: _nThawRequests, + thawingNonce: prov.thawingNonce + }); + (tokensThawed_, tokensThawing, sharesThawing) = _fulfillThawRequests(params); + + prov.tokens = prov.tokens - tokensThawed_; + prov.sharesThawing = sharesThawing; + prov.tokensThawing = tokensThawing; + _serviceProviders[_serviceProvider].tokensProvisioned -= tokensThawed_; + + emit TokensDeprovisioned(_serviceProvider, _verifier, tokensThawed_); + return tokensThawed_; + } + + /** + * @notice Delegate tokens to a provision. + * @dev Note that this function does not pull the delegated tokens from the caller. It expects that to + * have been done before calling this function. + * @param _serviceProvider The service provider address + * @param _verifier The verifier address + * @param _tokens The amount of tokens to delegate + * @param _minSharesOut The minimum amount of shares to accept, slippage protection. + */ + function _delegate(address _serviceProvider, address _verifier, uint256 _tokens, uint256 _minSharesOut) private { + // Enforces a minimum delegation amount to prevent share manipulation attacks. + // This stops attackers from inflating share value and blocking other delegators. + require(_tokens >= MIN_DELEGATION, HorizonStakingInsufficientDelegationTokens(_tokens, MIN_DELEGATION)); + require( + _provisions[_serviceProvider][_verifier].createdAt != 0, + HorizonStakingInvalidProvision(_serviceProvider, _verifier) + ); + + DelegationPoolInternal storage pool = _getDelegationPool(_serviceProvider, _verifier); + DelegationInternal storage delegation = pool.delegators[msg.sender]; + + // An invalid delegation pool has shares but no tokens + require( + pool.tokens != 0 || pool.shares == 0, + HorizonStakingInvalidDelegationPoolState(_serviceProvider, _verifier) + ); + + // Calculate shares to issue + // Delegation pool is reset/initialized in any of the following cases: + // - pool.tokens == 0 and pool.shares == 0, pool is completely empty. Note that we don't test shares == 0 because + // the invalid delegation pool check already ensures shares are 0 if tokens are 0 + // - pool.tokens == pool.tokensThawing, the entire pool is thawing + bool initializePool = pool.tokens == 0 || pool.tokens == pool.tokensThawing; + uint256 shares = initializePool ? _tokens : ((_tokens * pool.shares) / (pool.tokens - pool.tokensThawing)); + require(shares != 0 && shares >= _minSharesOut, HorizonStakingSlippageProtection(shares, _minSharesOut)); + + pool.tokens = pool.tokens + _tokens; + pool.shares = pool.shares + shares; + + delegation.shares = delegation.shares + shares; + + emit TokensDelegated(_serviceProvider, _verifier, msg.sender, _tokens, shares); + } + + /** + * @notice Undelegate tokens from a provision and start thawing them. + * Note that undelegating tokens from a provision is a two step process: + * - First the tokens are thawed using this function. + * - Then after the thawing period, the tokens are removed from the provision using {withdrawDelegated}. + * @dev To allow delegation to be slashable even while thawing without breaking accounting + * the delegation pool shares are burned and replaced with thawing pool shares. + * @dev Note that due to slashing the delegation pool can enter an invalid state if all it's tokens are slashed. + * An invalid pool can only be recovered by adding back tokens into the pool with {IHorizonStakingMain-addToDelegationPool}. + * Any time the delegation pool is invalidated, the thawing pool is also reset and any pending undelegate requests get + * invalidated. + * @dev Note that delegation that is caught thawing when the pool is invalidated will be completely lost! However delegation shares + * that were not thawing will be preserved. + * @param _serviceProvider The service provider address + * @param _verifier The verifier address + * @param _shares The amount of shares to undelegate + * @return The ID of the thaw request + */ + function _undelegate(address _serviceProvider, address _verifier, uint256 _shares) private returns (bytes32) { + require(_shares > 0, HorizonStakingInvalidZeroShares()); + DelegationPoolInternal storage pool = _getDelegationPool(_serviceProvider, _verifier); + DelegationInternal storage delegation = pool.delegators[msg.sender]; + require(delegation.shares >= _shares, HorizonStakingInsufficientShares(delegation.shares, _shares)); + + // An invalid delegation pool has shares but no tokens (previous require check ensures shares > 0) + require(pool.tokens != 0, HorizonStakingInvalidDelegationPoolState(_serviceProvider, _verifier)); + + // Calculate thawing shares to issue - convert delegation pool shares to thawing pool shares + // delegation pool shares -> delegation pool tokens -> thawing pool shares + // Thawing pool is reset/initialized when the pool is empty: prov.tokensThawing == 0 + uint256 tokens = (_shares * (pool.tokens - pool.tokensThawing)) / pool.shares; + + // Thawing shares are rounded down to protect the pool and avoid taking extra tokens from other participants. + uint256 thawingShares = pool.tokensThawing == 0 ? tokens : ((tokens * pool.sharesThawing) / pool.tokensThawing); + uint64 thawingUntil = uint64(block.timestamp + uint256(_provisions[_serviceProvider][_verifier].thawingPeriod)); + + pool.tokensThawing = pool.tokensThawing + tokens; + pool.sharesThawing = pool.sharesThawing + thawingShares; + + pool.shares = pool.shares - _shares; + delegation.shares = delegation.shares - _shares; + if (delegation.shares != 0) { + uint256 remainingTokens = (delegation.shares * (pool.tokens - pool.tokensThawing)) / pool.shares; + require( + remainingTokens >= MIN_DELEGATION, + HorizonStakingInsufficientTokens(remainingTokens, MIN_DELEGATION) + ); + } + + bytes32 thawRequestId = _createThawRequest( + ThawRequestType.Delegation, + _serviceProvider, + _verifier, + msg.sender, + thawingShares, + thawingUntil, + pool.thawingNonce + ); + + emit TokensUndelegated(_serviceProvider, _verifier, msg.sender, tokens, _shares); + return thawRequestId; + } + + /** + * @notice Withdraw undelegated tokens from a provision after thawing. + * @dev The parameter `nThawRequests` can be set to a non zero value to fulfill a specific number of thaw + * requests in the event that fulfilling all of them results in a gas limit error. Otherwise, the function + * will attempt to fulfill all thaw requests until the first one that is not yet expired is found. + * @dev If the delegation pool was completely slashed before withdrawing, calling this function will fulfill + * the thaw requests with an amount equal to zero. + * @param _serviceProvider The service provider address + * @param _verifier The verifier address + * @param _newServiceProvider The new service provider address + * @param _newVerifier The new verifier address + * @param _minSharesForNewProvider The minimum number of shares for the new service provider + * @param _nThawRequests The number of thaw requests to fulfill. Set to 0 to fulfill all thaw requests. + */ + function _withdrawDelegated( + address _serviceProvider, + address _verifier, + address _newServiceProvider, + address _newVerifier, + uint256 _minSharesForNewProvider, + uint256 _nThawRequests + ) private { + DelegationPoolInternal storage pool = _getDelegationPool(_serviceProvider, _verifier); + + // An invalid delegation pool has shares but no tokens + require( + pool.tokens != 0 || pool.shares == 0, + HorizonStakingInvalidDelegationPoolState(_serviceProvider, _verifier) + ); + + uint256 tokensThawed = 0; + uint256 sharesThawing = pool.sharesThawing; + uint256 tokensThawing = pool.tokensThawing; + + FulfillThawRequestsParams memory params = FulfillThawRequestsParams({ + requestType: ThawRequestType.Delegation, + serviceProvider: _serviceProvider, + verifier: _verifier, + owner: msg.sender, + tokensThawing: tokensThawing, + sharesThawing: sharesThawing, + nThawRequests: _nThawRequests, + thawingNonce: pool.thawingNonce + }); + (tokensThawed, tokensThawing, sharesThawing) = _fulfillThawRequests(params); + + // The next subtraction should never revert becase: pool.tokens >= pool.tokensThawing and pool.tokensThawing >= tokensThawed + // In the event the pool gets completely slashed tokensThawed will fulfil to 0. + pool.tokens = pool.tokens - tokensThawed; + pool.sharesThawing = sharesThawing; + pool.tokensThawing = tokensThawing; + + if (tokensThawed != 0) { + if (_newServiceProvider != address(0) && _newVerifier != address(0)) { + _delegate(_newServiceProvider, _newVerifier, tokensThawed, _minSharesForNewProvider); + } else { + _graphToken().pushTokens(msg.sender, tokensThawed); + emit DelegatedTokensWithdrawn(_serviceProvider, _verifier, msg.sender, tokensThawed); + } + } + } + + /** + * @notice Creates a thaw request. + * Allows creating thaw requests up to a maximum of `MAX_THAW_REQUESTS` per owner. + * Thaw requests are stored in a linked list per owner (and service provider, verifier) to allow for efficient + * processing. + * @param _requestType The type of thaw request. + * @param _serviceProvider The address of the service provider + * @param _verifier The address of the verifier + * @param _owner The address of the owner of the thaw request + * @param _shares The number of shares to thaw + * @param _thawingUntil The timestamp until which the shares are thawing + * @param _thawingNonce Owner's validity nonce for the thaw request + * @return The ID of the thaw request + */ + function _createThawRequest( + ThawRequestType _requestType, + address _serviceProvider, + address _verifier, + address _owner, + uint256 _shares, + uint64 _thawingUntil, + uint256 _thawingNonce + ) private returns (bytes32) { + require(_shares != 0, HorizonStakingInvalidZeroShares()); + LinkedList.List storage thawRequestList = _getThawRequestList( + _requestType, + _serviceProvider, + _verifier, + _owner + ); + require(thawRequestList.count < MAX_THAW_REQUESTS, HorizonStakingTooManyThawRequests()); + + bytes32 thawRequestId = keccak256(abi.encodePacked(_serviceProvider, _verifier, _owner, thawRequestList.nonce)); + ThawRequest storage thawRequest = _getThawRequest(_requestType, thawRequestId); + thawRequest.shares = _shares; + thawRequest.thawingUntil = _thawingUntil; + thawRequest.nextRequest = bytes32(0); + thawRequest.thawingNonce = _thawingNonce; + + if (thawRequestList.count != 0) _getThawRequest(_requestType, thawRequestList.tail).nextRequest = thawRequestId; + thawRequestList.addTail(thawRequestId); + + emit ThawRequestCreated( + _requestType, + _serviceProvider, + _verifier, + _owner, + _shares, + _thawingUntil, + thawRequestId, + _thawingNonce + ); + return thawRequestId; + } + + /** + * @notice Traverses a thaw request list and fulfills expired thaw requests. + * @dev Note that the list is traversed by creation date not by thawing until date. Traversing will stop + * when the first thaw request that is not yet expired is found even if later thaw requests have expired. This + * could happen for example when the thawing period is shortened. + * @param _params The parameters for fulfilling thaw requests + * @return The amount of thawed tokens + * @return The amount of tokens still thawing + * @return The amount of shares still thawing + */ + function _fulfillThawRequests( + FulfillThawRequestsParams memory _params + ) private returns (uint256, uint256, uint256) { + LinkedList.List storage thawRequestList = _getThawRequestList( + _params.requestType, + _params.serviceProvider, + _params.verifier, + _params.owner + ); + require(thawRequestList.count > 0, HorizonStakingNothingThawing()); + + TraverseThawRequestsResults memory results = _traverseThawRequests(_params, thawRequestList); + + emit ThawRequestsFulfilled( + _params.requestType, + _params.serviceProvider, + _params.verifier, + _params.owner, + results.requestsFulfilled, + results.tokensThawed + ); + + return (results.tokensThawed, results.tokensThawing, results.sharesThawing); + } + + /** + * @notice Traverses a thaw request list and fulfills expired thaw requests. + * @param _params The parameters for fulfilling thaw requests + * @param _thawRequestList The list of thaw requests to traverse + * @return The results of the traversal + */ + function _traverseThawRequests( + FulfillThawRequestsParams memory _params, + LinkedList.List storage _thawRequestList + ) private returns (TraverseThawRequestsResults memory) { + function(bytes32) view returns (bytes32) getNextItem = _getNextThawRequest(_params.requestType); + function(bytes32) deleteItem = _getDeleteThawRequest(_params.requestType); + + bytes memory acc = abi.encode( + _params.requestType, + uint256(0), + _params.tokensThawing, + _params.sharesThawing, + _params.thawingNonce + ); + (uint256 thawRequestsFulfilled, bytes memory data) = _thawRequestList.traverse( + getNextItem, + _fulfillThawRequest, + deleteItem, + acc, + _params.nThawRequests + ); + + (, uint256 tokensThawed, uint256 tokensThawing, uint256 sharesThawing) = abi.decode( + data, + (ThawRequestType, uint256, uint256, uint256) + ); + + return + TraverseThawRequestsResults({ + requestsFulfilled: thawRequestsFulfilled, + tokensThawed: tokensThawed, + tokensThawing: tokensThawing, + sharesThawing: sharesThawing + }); + } + + /** + * @notice Fulfills a thaw request. + * @dev This function is used as a callback in the thaw requests linked list traversal. + * @param _thawRequestId The ID of the current thaw request + * @param _acc The accumulator data for the thaw requests being fulfilled + * @return Whether the thaw request is still thawing, indicating that the traversal should continue or stop. + * @return The updated accumulator data + */ + function _fulfillThawRequest(bytes32 _thawRequestId, bytes memory _acc) private returns (bool, bytes memory) { + // decode + ( + ThawRequestType requestType, + uint256 tokensThawed, + uint256 tokensThawing, + uint256 sharesThawing, + uint256 thawingNonce + ) = abi.decode(_acc, (ThawRequestType, uint256, uint256, uint256, uint256)); + + ThawRequest storage thawRequest = _getThawRequest(requestType, _thawRequestId); + + // early exit + if (thawRequest.thawingUntil > block.timestamp) { + return (true, LinkedList.NULL_BYTES); + } + + // process - only fulfill thaw requests for the current valid nonce + uint256 tokens = 0; + bool validThawRequest = thawRequest.thawingNonce == thawingNonce; + if (validThawRequest) { + // sharesThawing cannot be zero if there is a valid thaw request so the next division is safe + tokens = (thawRequest.shares * tokensThawing) / sharesThawing; + tokensThawing = tokensThawing - tokens; + sharesThawing = sharesThawing - thawRequest.shares; + tokensThawed = tokensThawed + tokens; + } + emit ThawRequestFulfilled( + requestType, + _thawRequestId, + tokens, + thawRequest.shares, + thawRequest.thawingUntil, + validThawRequest + ); + + // encode + _acc = abi.encode(requestType, tokensThawed, tokensThawing, sharesThawing, thawingNonce); + return (false, _acc); + } + + /** + * @notice Deletes a thaw request for a provision. + * @param _thawRequestId The ID of the thaw request to delete. + */ + function _deleteProvisionThawRequest(bytes32 _thawRequestId) private { + delete _thawRequests[ThawRequestType.Provision][_thawRequestId]; + } + + /** + * @notice Deletes a thaw request for a delegation. + * @param _thawRequestId The ID of the thaw request to delete. + */ + function _deleteDelegationThawRequest(bytes32 _thawRequestId) private { + delete _thawRequests[ThawRequestType.Delegation][_thawRequestId]; + } + + /** + * @notice Authorize or unauthorize an address to be an operator for the caller on a data service. + * @dev Note that this function handles the special case where the verifier is the subgraph data service, + * where the operator settings are stored in the legacy mapping. + * @param _verifier The verifier / data service on which they'll be allowed to operate + * @param _operator Address to authorize or unauthorize + * @param _allowed Whether the operator is authorized or not + */ + function _setOperator(address _verifier, address _operator, bool _allowed) private { + require(_operator != msg.sender, HorizonStakingCallerIsServiceProvider()); + if (_verifier == SUBGRAPH_DATA_SERVICE_ADDRESS) { + _legacyOperatorAuth[msg.sender][_operator] = _allowed; + } else { + _operatorAuth[msg.sender][_verifier][_operator] = _allowed; + } + emit OperatorSet(msg.sender, _verifier, _operator, _allowed); + } + + /** + * @notice Check if an operator is authorized for the caller on a specific verifier / data service. + * @dev Note that this function handles the special case where the verifier is the subgraph data service, + * where the operator settings are stored in the legacy mapping. + * @param _serviceProvider The service provider on behalf of whom they're claiming to act + * @param _verifier The verifier / data service on which they're claiming to act + * @param _operator The address to check for auth + * @return Whether the operator is authorized or not + */ + function _isAuthorized(address _serviceProvider, address _verifier, address _operator) private view returns (bool) { + if (_operator == _serviceProvider) { + return true; + } + if (_verifier == SUBGRAPH_DATA_SERVICE_ADDRESS) { + return _legacyOperatorAuth[_serviceProvider][_operator]; + } else { + return _operatorAuth[_serviceProvider][_verifier][_operator]; + } + } + + /** + * @notice Determines the correct callback function for `deleteItem` based on the request type. + * @param _requestType The type of thaw request (Provision or Delegation). + * @return A function pointer to the appropriate `deleteItem` callback. + */ + function _getDeleteThawRequest(ThawRequestType _requestType) private pure returns (function(bytes32)) { + if (_requestType == ThawRequestType.Provision) { + return _deleteProvisionThawRequest; + } else if (_requestType == ThawRequestType.Delegation) { + return _deleteDelegationThawRequest; + } else { + revert HorizonStakingInvalidThawRequestType(); + } + } +} diff --git a/packages/horizon/contracts/staking/HorizonStakingBase.sol b/packages/horizon/contracts/staking/HorizonStakingBase.sol new file mode 100644 index 000000000..3b0f29065 --- /dev/null +++ b/packages/horizon/contracts/staking/HorizonStakingBase.sol @@ -0,0 +1,356 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity 0.8.27; + +import { IHorizonStakingTypes } from "../interfaces/internal/IHorizonStakingTypes.sol"; +import { IHorizonStakingBase } from "../interfaces/internal/IHorizonStakingBase.sol"; +import { IGraphPayments } from "../interfaces/IGraphPayments.sol"; + +import { MathUtils } from "../libraries/MathUtils.sol"; +import { LinkedList } from "../libraries/LinkedList.sol"; + +import { Multicall } from "@openzeppelin/contracts/utils/Multicall.sol"; +import { GraphUpgradeable } from "@graphprotocol/contracts/contracts/upgrades/GraphUpgradeable.sol"; +import { Managed } from "./utilities/Managed.sol"; +import { HorizonStakingV1Storage } from "./HorizonStakingStorage.sol"; + +/** + * @title HorizonStakingBase contract + * @notice This contract is the base staking contract implementing storage getters for both internal + * and external use. + * @dev Implementation of the {IHorizonStakingBase} interface. + * @dev It's meant to be inherited by the {HorizonStaking} and {HorizonStakingExtension} + * contracts so some internal functions are also included here. + * @custom:security-contact Please email security+contracts@thegraph.com if you find any + * bugs. We may have an active bug bounty program. + */ +abstract contract HorizonStakingBase is + Multicall, + Managed, + HorizonStakingV1Storage, + GraphUpgradeable, + IHorizonStakingTypes, + IHorizonStakingBase +{ + using LinkedList for LinkedList.List; + + /** + * @notice The address of the subgraph data service. + * @dev Require to handle the special case when the verifier is the subgraph data service. + */ + address internal immutable SUBGRAPH_DATA_SERVICE_ADDRESS; + + /** + * @dev The staking contract is upgradeable however we still use the constructor to set + * a few immutable variables. + * @param controller The address of the Graph controller contract. + * @param subgraphDataServiceAddress The address of the subgraph data service. + */ + constructor(address controller, address subgraphDataServiceAddress) Managed(controller) { + SUBGRAPH_DATA_SERVICE_ADDRESS = subgraphDataServiceAddress; + } + + /// @inheritdoc IHorizonStakingBase + /// @dev Removes deprecated fields from the return value. + function getServiceProvider(address serviceProvider) external view override returns (ServiceProvider memory) { + ServiceProvider memory sp; + ServiceProviderInternal storage spInternal = _serviceProviders[serviceProvider]; + sp.tokensStaked = spInternal.tokensStaked; + sp.tokensProvisioned = spInternal.tokensProvisioned; + return sp; + } + + /// @inheritdoc IHorizonStakingBase + function getStake(address serviceProvider) external view override returns (uint256) { + return _serviceProviders[serviceProvider].tokensStaked; + } + + /// @inheritdoc IHorizonStakingBase + function getIdleStake(address serviceProvider) external view override returns (uint256) { + return _getIdleStake(serviceProvider); + } + + /// @inheritdoc IHorizonStakingBase + /// @dev Removes deprecated fields from the return value. + function getDelegationPool( + address serviceProvider, + address verifier + ) external view override returns (DelegationPool memory) { + DelegationPool memory pool; + DelegationPoolInternal storage poolInternal = _getDelegationPool(serviceProvider, verifier); + pool.tokens = poolInternal.tokens; + pool.shares = poolInternal.shares; + pool.tokensThawing = poolInternal.tokensThawing; + pool.sharesThawing = poolInternal.sharesThawing; + pool.thawingNonce = poolInternal.thawingNonce; + return pool; + } + + /// @inheritdoc IHorizonStakingBase + /// @dev Removes deprecated fields from the return value. + function getDelegation( + address serviceProvider, + address verifier, + address delegator + ) external view override returns (Delegation memory) { + Delegation memory delegation; + DelegationPoolInternal storage poolInternal = _getDelegationPool(serviceProvider, verifier); + delegation.shares = poolInternal.delegators[delegator].shares; + return delegation; + } + + /// @inheritdoc IHorizonStakingBase + function getDelegationFeeCut( + address serviceProvider, + address verifier, + IGraphPayments.PaymentTypes paymentType + ) external view override returns (uint256) { + return _delegationFeeCut[serviceProvider][verifier][paymentType]; + } + + /// @inheritdoc IHorizonStakingBase + function getProvision(address serviceProvider, address verifier) external view override returns (Provision memory) { + return _provisions[serviceProvider][verifier]; + } + + /// @inheritdoc IHorizonStakingBase + function getTokensAvailable( + address serviceProvider, + address verifier, + uint32 delegationRatio + ) external view override returns (uint256) { + uint256 tokensAvailableProvider = _getProviderTokensAvailable(serviceProvider, verifier); + uint256 tokensAvailableDelegated = _getDelegatedTokensAvailable(serviceProvider, verifier); + + uint256 tokensDelegatedMax = tokensAvailableProvider * (uint256(delegationRatio)); + uint256 tokensDelegatedCapacity = MathUtils.min(tokensAvailableDelegated, tokensDelegatedMax); + + return tokensAvailableProvider + tokensDelegatedCapacity; + } + + /// @inheritdoc IHorizonStakingBase + function getProviderTokensAvailable( + address serviceProvider, + address verifier + ) external view override returns (uint256) { + return _getProviderTokensAvailable(serviceProvider, verifier); + } + + /// @inheritdoc IHorizonStakingBase + function getDelegatedTokensAvailable( + address serviceProvider, + address verifier + ) external view override returns (uint256) { + return _getDelegatedTokensAvailable(serviceProvider, verifier); + } + + /// @inheritdoc IHorizonStakingBase + function getThawRequest( + ThawRequestType requestType, + bytes32 thawRequestId + ) external view override returns (ThawRequest memory) { + return _getThawRequest(requestType, thawRequestId); + } + + /// @inheritdoc IHorizonStakingBase + function getThawRequestList( + ThawRequestType requestType, + address serviceProvider, + address verifier, + address owner + ) external view override returns (LinkedList.List memory) { + return _getThawRequestList(requestType, serviceProvider, verifier, owner); + } + + /// @inheritdoc IHorizonStakingBase + function getThawedTokens( + ThawRequestType requestType, + address serviceProvider, + address verifier, + address owner + ) external view override returns (uint256) { + LinkedList.List storage thawRequestList = _getThawRequestList(requestType, serviceProvider, verifier, owner); + if (thawRequestList.count == 0) { + return 0; + } + + uint256 thawedTokens = 0; + Provision storage prov = _provisions[serviceProvider][verifier]; + uint256 tokensThawing = prov.tokensThawing; + uint256 sharesThawing = prov.sharesThawing; + + bytes32 thawRequestId = thawRequestList.head; + while (thawRequestId != bytes32(0)) { + ThawRequest storage thawRequest = _getThawRequest(requestType, thawRequestId); + if (thawRequest.thawingNonce == prov.thawingNonce) { + if (thawRequest.thawingUntil <= block.timestamp) { + // sharesThawing cannot be zero if there is a valid thaw request so the next division is safe + uint256 tokens = (thawRequest.shares * tokensThawing) / sharesThawing; + tokensThawing = tokensThawing - tokens; + sharesThawing = sharesThawing - thawRequest.shares; + thawedTokens = thawedTokens + tokens; + } else { + break; + } + } + + thawRequestId = thawRequest.nextRequest; + } + return thawedTokens; + } + + /// @inheritdoc IHorizonStakingBase + function getMaxThawingPeriod() external view override returns (uint64) { + return _maxThawingPeriod; + } + + /// @inheritdoc IHorizonStakingBase + function isAllowedLockedVerifier(address verifier) external view returns (bool) { + return _allowedLockedVerifiers[verifier]; + } + + /// @inheritdoc IHorizonStakingBase + function isDelegationSlashingEnabled() external view returns (bool) { + return _delegationSlashingEnabled; + } + + /** + * @notice Deposit tokens into the service provider stake. + * @dev TRANSITION PERIOD: After transition period move to IHorizonStakingMain. Temporarily it + * needs to be here since it's used by both {HorizonStaking} and {HorizonStakingExtension}. + * + * Emits a {HorizonStakeDeposited} event. + * @param _serviceProvider The address of the service provider. + * @param _tokens The amount of tokens to deposit. + */ + function _stake(address _serviceProvider, uint256 _tokens) internal { + _serviceProviders[_serviceProvider].tokensStaked = _serviceProviders[_serviceProvider].tokensStaked + _tokens; + emit HorizonStakeDeposited(_serviceProvider, _tokens); + } + + /** + * @notice Gets the service provider's idle stake which is the stake that is not being + * used for any provision. Note that this only includes service provider's self stake. + * @dev Note that the calculation considers tokens that were locked in the legacy staking contract. + * @dev TRANSITION PERIOD: update the calculation after the transition period. + * @param _serviceProvider The address of the service provider. + * @return The amount of tokens that are idle. + */ + function _getIdleStake(address _serviceProvider) internal view returns (uint256) { + uint256 tokensUsed = _serviceProviders[_serviceProvider].tokensProvisioned + + _serviceProviders[_serviceProvider].__DEPRECATED_tokensAllocated + + _serviceProviders[_serviceProvider].__DEPRECATED_tokensLocked; + uint256 tokensStaked = _serviceProviders[_serviceProvider].tokensStaked; + return tokensStaked > tokensUsed ? tokensStaked - tokensUsed : 0; + } + + /** + * @notice Gets the details of delegation pool. + * @dev Note that this function handles the special case where the verifier is the subgraph data service, + * where the pools are stored in the legacy mapping. + * @param _serviceProvider The address of the service provider. + * @param _verifier The address of the verifier. + * @return The delegation pool details. + */ + function _getDelegationPool( + address _serviceProvider, + address _verifier + ) internal view returns (DelegationPoolInternal storage) { + if (_verifier == SUBGRAPH_DATA_SERVICE_ADDRESS) { + return _legacyDelegationPools[_serviceProvider]; + } else { + return _delegationPools[_serviceProvider][_verifier]; + } + } + + /** + * @notice Gets the service provider's tokens available in a provision. + * @dev Calculated as the tokens available minus the tokens thawing. + * @param _serviceProvider The address of the service provider. + * @param _verifier The address of the verifier. + * @return The amount of tokens available. + */ + function _getProviderTokensAvailable(address _serviceProvider, address _verifier) internal view returns (uint256) { + return _provisions[_serviceProvider][_verifier].tokens - _provisions[_serviceProvider][_verifier].tokensThawing; + } + + /** + * @notice Retrieves the next thaw request for a provision. + * @param _thawRequestId The ID of the current thaw request. + * @return The ID of the next thaw request in the list. + */ + function _getNextProvisionThawRequest(bytes32 _thawRequestId) internal view returns (bytes32) { + return _thawRequests[ThawRequestType.Provision][_thawRequestId].nextRequest; + } + + /** + * @notice Retrieves the next thaw request for a delegation. + * @param _thawRequestId The ID of the current thaw request. + * @return The ID of the next thaw request in the list. + */ + function _getNextDelegationThawRequest(bytes32 _thawRequestId) internal view returns (bytes32) { + return _thawRequests[ThawRequestType.Delegation][_thawRequestId].nextRequest; + } + + /** + * @notice Retrieves the thaw request list for the given request type. + * @dev Uses the `ThawRequestType` to determine which mapping to access. + * Reverts if the request type is unknown. + * @param _requestType The type of thaw request (Provision or Delegation). + * @param _serviceProvider The address of the service provider. + * @param _verifier The address of the verifier. + * @param _owner The address of the owner of the thaw request. + * @return The linked list of thaw requests for the specified request type. + */ + function _getThawRequestList( + ThawRequestType _requestType, + address _serviceProvider, + address _verifier, + address _owner + ) internal view returns (LinkedList.List storage) { + return _thawRequestLists[_requestType][_serviceProvider][_verifier][_owner]; + } + + /** + * @notice Retrieves a specific thaw request for the given request type. + * @dev Uses the `ThawRequestType` to determine which mapping to access. + * @param _requestType The type of thaw request (Provision or Delegation). + * @param _thawRequestId The unique ID of the thaw request. + * @return The thaw request data for the specified request type and ID. + */ + function _getThawRequest( + ThawRequestType _requestType, + bytes32 _thawRequestId + ) internal view returns (IHorizonStakingTypes.ThawRequest storage) { + return _thawRequests[_requestType][_thawRequestId]; + } + + /** + * @notice Determines the correct callback function for `getNextItem` based on the request type. + * @param _requestType The type of thaw request (Provision or Delegation). + * @return A function pointer to the appropriate `getNextItem` callback. + */ + function _getNextThawRequest( + ThawRequestType _requestType + ) internal pure returns (function(bytes32) view returns (bytes32)) { + if (_requestType == ThawRequestType.Provision) { + return _getNextProvisionThawRequest; + } else if (_requestType == ThawRequestType.Delegation) { + return _getNextDelegationThawRequest; + } else { + revert HorizonStakingInvalidThawRequestType(); + } + } + + /** + * @notice Gets the delegator's tokens available in a provision. + * @dev Calculated as the tokens available minus the tokens thawing. + * @param _serviceProvider The address of the service provider. + * @param _verifier The address of the verifier. + * @return The amount of tokens available. + */ + function _getDelegatedTokensAvailable(address _serviceProvider, address _verifier) private view returns (uint256) { + DelegationPoolInternal storage poolInternal = _getDelegationPool(_serviceProvider, _verifier); + return poolInternal.tokens - poolInternal.tokensThawing; + } +} diff --git a/packages/horizon/contracts/staking/HorizonStakingExtension.sol b/packages/horizon/contracts/staking/HorizonStakingExtension.sol new file mode 100644 index 000000000..17787c4d3 --- /dev/null +++ b/packages/horizon/contracts/staking/HorizonStakingExtension.sol @@ -0,0 +1,483 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity 0.8.27; + +import { ICuration } from "@graphprotocol/contracts/contracts/curation/ICuration.sol"; +import { IGraphToken } from "@graphprotocol/contracts/contracts/token/IGraphToken.sol"; +import { IHorizonStakingExtension } from "../interfaces/internal/IHorizonStakingExtension.sol"; +import { IRewardsIssuer } from "@graphprotocol/contracts/contracts/rewards/IRewardsIssuer.sol"; + +import { TokenUtils } from "@graphprotocol/contracts/contracts/utils/TokenUtils.sol"; +import { MathUtils } from "../libraries/MathUtils.sol"; +import { ExponentialRebates } from "./libraries/ExponentialRebates.sol"; +import { PPMMath } from "../libraries/PPMMath.sol"; + +import { HorizonStakingBase } from "./HorizonStakingBase.sol"; + +/** + * @title Horizon Staking extension contract + * @notice The {HorizonStakingExtension} contract implements the legacy functionality required to support the transition + * to the Horizon Staking contract. It allows indexers to close allocations and collect pending query fees, but it + * does not allow for the creation of new allocations. This should allow indexers to migrate to a subgraph data service + * without losing rewards or having service interruptions. + * @dev TRANSITION PERIOD: Once the transition period passes this contract can be removed (note that an upgrade to the + * RewardsManager will also be required). It's expected the transition period to last for at least a full allocation cycle + * (28 epochs). + * @custom:security-contact Please email security+contracts@thegraph.com if you find any + * bugs. We may have an active bug bounty program. + */ +contract HorizonStakingExtension is HorizonStakingBase, IHorizonStakingExtension { + using TokenUtils for IGraphToken; + using PPMMath for uint256; + + /** + * @dev Check if the caller is the slasher. + */ + modifier onlySlasher() { + require(__DEPRECATED_slashers[msg.sender], "!slasher"); + _; + } + + /** + * @dev The staking contract is upgradeable however we still use the constructor to set + * a few immutable variables. + * @param controller The address of the Graph controller contract. + * @param subgraphDataServiceAddress The address of the subgraph data service. + */ + constructor( + address controller, + address subgraphDataServiceAddress + ) HorizonStakingBase(controller, subgraphDataServiceAddress) {} + + /// @inheritdoc IHorizonStakingExtension + function closeAllocation(address allocationID, bytes32 poi) external override notPaused { + _closeAllocation(allocationID, poi); + } + + /// @inheritdoc IHorizonStakingExtension + function collect(uint256 tokens, address allocationID) external override notPaused { + // Allocation identifier validation + require(allocationID != address(0), "!alloc"); + + // Allocation must exist + AllocationState allocState = _getAllocationState(allocationID); + require(allocState != AllocationState.Null, "!collect"); + + // If the query fees are zero, we don't want to revert + // but we also don't need to do anything, so just return + if (tokens == 0) { + return; + } + + Allocation storage alloc = __DEPRECATED_allocations[allocationID]; + bytes32 subgraphDeploymentID = alloc.subgraphDeploymentID; + + uint256 queryFees = tokens; // Tokens collected from the channel + uint256 protocolTax = 0; // Tokens burnt as protocol tax + uint256 curationFees = 0; // Tokens distributed to curators as curation fees + uint256 queryRebates = 0; // Tokens to distribute to indexer + uint256 delegationRewards = 0; // Tokens to distribute to delegators + + { + // -- Pull tokens from the sender -- + _graphToken().pullTokens(msg.sender, queryFees); + + // -- Collect protocol tax -- + protocolTax = _collectTax(queryFees, __DEPRECATED_protocolPercentage); + queryFees = queryFees - protocolTax; + + // -- Collect curation fees -- + // Only if the subgraph deployment is curated + curationFees = _collectCurationFees(subgraphDeploymentID, queryFees, __DEPRECATED_curationPercentage); + queryFees = queryFees - curationFees; + + // -- Process rebate reward -- + // Using accumulated fees and subtracting previously distributed rebates + // allows for multiple vouchers to be collected while following the rebate formula + alloc.collectedFees = alloc.collectedFees + queryFees; + + // No rebates if indexer has no stake or if lambda is zero + uint256 newRebates = (alloc.tokens == 0 || __DEPRECATED_lambdaNumerator == 0) + ? 0 + : ExponentialRebates.exponentialRebates( + alloc.collectedFees, + alloc.tokens, + __DEPRECATED_alphaNumerator, + __DEPRECATED_alphaDenominator, + __DEPRECATED_lambdaNumerator, + __DEPRECATED_lambdaDenominator + ); + + // -- Ensure rebates to distribute are within bounds -- + // Indexers can become under or over rebated if rebate parameters (alpha, lambda) + // change between successive collect calls for the same allocation + + // Ensure rebates to distribute are not negative (indexer is over-rebated) + queryRebates = MathUtils.diffOrZero(newRebates, alloc.distributedRebates); + + // Ensure rebates to distribute are not greater than available (indexer is under-rebated) + queryRebates = MathUtils.min(queryRebates, queryFees); + + // -- Burn rebates remanent -- + _graphToken().burnTokens(queryFees - queryRebates); + + // -- Distribute rebates -- + if (queryRebates > 0) { + alloc.distributedRebates = alloc.distributedRebates + queryRebates; + + // -- Collect delegation rewards into the delegation pool -- + delegationRewards = _collectDelegationQueryRewards(alloc.indexer, queryRebates); + queryRebates = queryRebates - delegationRewards; + + // -- Transfer or restake rebates -- + _sendRewards(queryRebates, alloc.indexer, __DEPRECATED_rewardsDestination[alloc.indexer] == address(0)); + } + } + + emit RebateCollected( + msg.sender, + alloc.indexer, + subgraphDeploymentID, + allocationID, + _graphEpochManager().currentEpoch(), + tokens, + protocolTax, + curationFees, + queryFees, + queryRebates, + delegationRewards + ); + } + + /// @inheritdoc IHorizonStakingExtension + function legacySlash( + address indexer, + uint256 tokens, + uint256 reward, + address beneficiary + ) external override onlySlasher notPaused { + ServiceProviderInternal storage indexerStake = _serviceProviders[indexer]; + + // Only able to slash a non-zero number of tokens + require(tokens > 0, "!tokens"); + + // Rewards comes from tokens slashed balance + require(tokens >= reward, "rewards>slash"); + + // Cannot slash stake of an indexer without any or enough stake + require(indexerStake.tokensStaked > 0, "!stake"); + require(tokens <= indexerStake.tokensStaked, "slash>stake"); + + // Validate beneficiary of slashed tokens + require(beneficiary != address(0), "!beneficiary"); + + // Slashing tokens that are already provisioned would break provision accounting, we need to limit + // the slash amount. This can be compensated for, by slashing with the main slash function if needed. + uint256 slashableStake = indexerStake.tokensStaked - indexerStake.tokensProvisioned; + if (slashableStake == 0) { + emit StakeSlashed(indexer, 0, 0, beneficiary); + return; + } + if (tokens > slashableStake) { + reward = (reward * slashableStake) / tokens; + tokens = slashableStake; + } + + // Slashing more tokens than freely available (over allocation condition) + // Unlock locked tokens to avoid the indexer to withdraw them + uint256 tokensUsed = indexerStake.__DEPRECATED_tokensAllocated + indexerStake.__DEPRECATED_tokensLocked; + uint256 tokensAvailable = tokensUsed > indexerStake.tokensStaked ? 0 : indexerStake.tokensStaked - tokensUsed; + if (tokens > tokensAvailable && indexerStake.__DEPRECATED_tokensLocked > 0) { + uint256 tokensOverAllocated = tokens - tokensAvailable; + uint256 tokensToUnlock = MathUtils.min(tokensOverAllocated, indexerStake.__DEPRECATED_tokensLocked); + indexerStake.__DEPRECATED_tokensLocked = indexerStake.__DEPRECATED_tokensLocked - tokensToUnlock; + if (indexerStake.__DEPRECATED_tokensLocked == 0) { + indexerStake.__DEPRECATED_tokensLockedUntil = 0; + } + } + + // Remove tokens to slash from the stake + indexerStake.tokensStaked = indexerStake.tokensStaked - tokens; + + // -- Interactions -- + + // Set apart the reward for the beneficiary and burn remaining slashed stake + _graphToken().burnTokens(tokens - reward); + + // Give the beneficiary a reward for slashing + _graphToken().pushTokens(beneficiary, reward); + + emit StakeSlashed(indexer, tokens, reward, beneficiary); + } + + /// @inheritdoc IHorizonStakingExtension + function isAllocation(address allocationID) external view override returns (bool) { + return _getAllocationState(allocationID) != AllocationState.Null; + } + + /// @inheritdoc IHorizonStakingExtension + function getAllocation(address allocationID) external view override returns (Allocation memory) { + return __DEPRECATED_allocations[allocationID]; + } + + /// @inheritdoc IRewardsIssuer + function getAllocationData( + address allocationID + ) external view override returns (bool, address, bytes32, uint256, uint256, uint256) { + Allocation memory allo = __DEPRECATED_allocations[allocationID]; + bool isActive = _getAllocationState(allocationID) == AllocationState.Active; + return (isActive, allo.indexer, allo.subgraphDeploymentID, allo.tokens, allo.accRewardsPerAllocatedToken, 0); + } + + /// @inheritdoc IHorizonStakingExtension + function getAllocationState(address allocationID) external view override returns (AllocationState) { + return _getAllocationState(allocationID); + } + + /// @inheritdoc IRewardsIssuer + function getSubgraphAllocatedTokens(bytes32 subgraphDeploymentID) external view override returns (uint256) { + return __DEPRECATED_subgraphAllocations[subgraphDeploymentID]; + } + + /// @inheritdoc IHorizonStakingExtension + function getIndexerStakedTokens(address indexer) external view override returns (uint256) { + return _serviceProviders[indexer].tokensStaked; + } + + /// @inheritdoc IHorizonStakingExtension + function getSubgraphService() external view override returns (address) { + return SUBGRAPH_DATA_SERVICE_ADDRESS; + } + + /// @inheritdoc IHorizonStakingExtension + function hasStake(address indexer) external view override returns (bool) { + return _serviceProviders[indexer].tokensStaked > 0; + } + + /// @inheritdoc IHorizonStakingExtension + function __DEPRECATED_getThawingPeriod() external view returns (uint64) { + return __DEPRECATED_thawingPeriod; + } + + /// @inheritdoc IHorizonStakingExtension + function isOperator(address operator, address serviceProvider) public view override returns (bool) { + return _legacyOperatorAuth[serviceProvider][operator]; + } + + /** + * @dev Collect tax to burn for an amount of tokens. + * @param _tokens Total tokens received used to calculate the amount of tax to collect + * @param _percentage Percentage of tokens to burn as tax + * @return Amount of tax charged + */ + function _collectTax(uint256 _tokens, uint256 _percentage) private returns (uint256) { + uint256 tax = _tokens.mulPPMRoundUp(_percentage); + _graphToken().burnTokens(tax); // Burn tax if any + return tax; + } + + /** + * @dev Triggers an update of rewards due to a change in allocations. + * @param _subgraphDeploymentID Subgraph deployment updated + */ + function _updateRewards(bytes32 _subgraphDeploymentID) private { + _graphRewardsManager().onSubgraphAllocationUpdate(_subgraphDeploymentID); + } + + /** + * @dev Assign rewards for the closed allocation to indexer and delegators. + * @param _allocationID Allocation + * @param _indexer Address of the indexer that did the allocation + */ + function _distributeRewards(address _allocationID, address _indexer) private { + // Automatically triggers update of rewards snapshot as allocation will change + // after this call. Take rewards mint tokens for the Staking contract to distribute + // between indexer and delegators + uint256 totalRewards = _graphRewardsManager().takeRewards(_allocationID); + if (totalRewards == 0) { + return; + } + + // Calculate delegation rewards and add them to the delegation pool + uint256 delegationRewards = _collectDelegationIndexingRewards(_indexer, totalRewards); + uint256 indexerRewards = totalRewards - delegationRewards; + + // Send the indexer rewards + _sendRewards(indexerRewards, _indexer, __DEPRECATED_rewardsDestination[_indexer] == address(0)); + } + + /** + * @dev Send rewards to the appropriate destination. + * @param _tokens Number of rewards tokens + * @param _beneficiary Address of the beneficiary of rewards + * @param _restake Whether to restake or not + */ + function _sendRewards(uint256 _tokens, address _beneficiary, bool _restake) private { + if (_tokens == 0) return; + + if (_restake) { + // Restake to place fees into the indexer stake + _stake(_beneficiary, _tokens); + } else { + // Transfer funds to the beneficiary's designated rewards destination if set + address destination = __DEPRECATED_rewardsDestination[_beneficiary]; + _graphToken().pushTokens(destination == address(0) ? _beneficiary : destination, _tokens); + } + } + + /** + * @dev Close an allocation and free the staked tokens. + * @param _allocationID The allocation identifier + * @param _poi Proof of indexing submitted for the allocated period + */ + function _closeAllocation(address _allocationID, bytes32 _poi) private { + // Allocation must exist and be active + AllocationState allocState = _getAllocationState(_allocationID); + require(allocState == AllocationState.Active, "!active"); + + // Get allocation + Allocation memory alloc = __DEPRECATED_allocations[_allocationID]; + + // Validate that an allocation cannot be closed before one epoch + alloc.closedAtEpoch = _graphEpochManager().currentEpoch(); + uint256 epochs = MathUtils.diffOrZero(alloc.closedAtEpoch, alloc.createdAtEpoch); + + // Indexer or operator can close an allocation + // Anyone is allowed to close ONLY under two concurrent conditions + // - After maxAllocationEpochs passed + // - When the allocation is for non-zero amount of tokens + bool isIndexerOrOperator = msg.sender == alloc.indexer || isOperator(msg.sender, alloc.indexer); + if (epochs <= __DEPRECATED_maxAllocationEpochs || alloc.tokens == 0) { + require(isIndexerOrOperator, "!auth"); + } + + // -- Rewards Distribution -- + + // Process non-zero-allocation rewards tracking + if (alloc.tokens > 0) { + // Distribute rewards if proof of indexing was presented by the indexer or operator + if (isIndexerOrOperator && _poi != 0) { + _distributeRewards(_allocationID, alloc.indexer); + } else { + _updateRewards(alloc.subgraphDeploymentID); + } + + // Free allocated tokens from use + _serviceProviders[alloc.indexer].__DEPRECATED_tokensAllocated = + _serviceProviders[alloc.indexer].__DEPRECATED_tokensAllocated - + alloc.tokens; + + // Track total allocations per subgraph + // Used for rewards calculations + __DEPRECATED_subgraphAllocations[alloc.subgraphDeploymentID] = + __DEPRECATED_subgraphAllocations[alloc.subgraphDeploymentID] - + alloc.tokens; + } + + // Close the allocation + // Note that this breaks CEI pattern. We update after the rewards distribution logic as it expects the allocation + // to still be active. There shouldn't be reentrancy risk here as all internal calls are to trusted contracts. + __DEPRECATED_allocations[_allocationID].closedAtEpoch = alloc.closedAtEpoch; + + emit AllocationClosed( + alloc.indexer, + alloc.subgraphDeploymentID, + alloc.closedAtEpoch, + alloc.tokens, + _allocationID, + msg.sender, + _poi, + !isIndexerOrOperator + ); + } + + /** + * @dev Collect the delegation rewards for query fees. + * This function will assign the collected fees to the delegation pool. + * @param _indexer Indexer to which the tokens to distribute are related + * @param _tokens Total tokens received used to calculate the amount of fees to collect + * @return Amount of delegation rewards + */ + function _collectDelegationQueryRewards(address _indexer, uint256 _tokens) private returns (uint256) { + uint256 delegationRewards = 0; + DelegationPoolInternal storage pool = _legacyDelegationPools[_indexer]; + if (pool.tokens > 0 && uint256(pool.__DEPRECATED_queryFeeCut).isValidPPM()) { + uint256 indexerCut = uint256(pool.__DEPRECATED_queryFeeCut).mulPPM(_tokens); + delegationRewards = _tokens - indexerCut; + pool.tokens = pool.tokens + delegationRewards; + } + return delegationRewards; + } + + /** + * @dev Collect the delegation rewards for indexing. + * This function will assign the collected fees to the delegation pool. + * @param _indexer Indexer to which the tokens to distribute are related + * @param _tokens Total tokens received used to calculate the amount of fees to collect + * @return Amount of delegation rewards + */ + function _collectDelegationIndexingRewards(address _indexer, uint256 _tokens) private returns (uint256) { + uint256 delegationRewards = 0; + DelegationPoolInternal storage pool = _legacyDelegationPools[_indexer]; + if (pool.tokens > 0 && uint256(pool.__DEPRECATED_indexingRewardCut).isValidPPM()) { + uint256 indexerCut = uint256(pool.__DEPRECATED_indexingRewardCut).mulPPM(_tokens); + delegationRewards = _tokens - indexerCut; + pool.tokens = pool.tokens + delegationRewards; + } + return delegationRewards; + } + + /** + * @dev Collect the curation fees for a subgraph deployment from an amount of tokens. + * This function transfer curation fees to the Curation contract by calling Curation.collect + * @param _subgraphDeploymentID Subgraph deployment to which the curation fees are related + * @param _tokens Total tokens received used to calculate the amount of fees to collect + * @param _curationCut Percentage of tokens to collect as fees + * @return Amount of curation fees + */ + function _collectCurationFees( + bytes32 _subgraphDeploymentID, + uint256 _tokens, + uint256 _curationCut + ) private returns (uint256) { + if (_tokens == 0) { + return 0; + } + + ICuration curation = _graphCuration(); + bool isCurationEnabled = _curationCut > 0 && address(curation) != address(0); + + if (isCurationEnabled && curation.isCurated(_subgraphDeploymentID)) { + uint256 curationFees = _tokens.mulPPMRoundUp(_curationCut); + if (curationFees > 0) { + // Transfer and call collect() + // This function transfer tokens to a trusted protocol contracts + // Then we call collect() to do the transfer Bookkeeping + _graphRewardsManager().onSubgraphSignalUpdate(_subgraphDeploymentID); + _graphToken().pushTokens(address(curation), curationFees); + curation.collect(_subgraphDeploymentID, curationFees); + } + return curationFees; + } + return 0; + } + + /** + * @dev Return the current state of an allocation + * @param _allocationID Allocation identifier + * @return AllocationState enum with the state of the allocation + */ + function _getAllocationState(address _allocationID) private view returns (AllocationState) { + Allocation storage alloc = __DEPRECATED_allocations[_allocationID]; + + if (alloc.indexer == address(0)) { + return AllocationState.Null; + } + + if (alloc.createdAtEpoch != 0 && alloc.closedAtEpoch == 0) { + return AllocationState.Active; + } + + return AllocationState.Closed; + } +} diff --git a/packages/horizon/contracts/staking/HorizonStakingStorage.sol b/packages/horizon/contracts/staking/HorizonStakingStorage.sol new file mode 100644 index 000000000..f06ff5cb6 --- /dev/null +++ b/packages/horizon/contracts/staking/HorizonStakingStorage.sol @@ -0,0 +1,183 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity 0.8.27; + +import { IHorizonStakingExtension } from "../interfaces/internal/IHorizonStakingExtension.sol"; +import { IHorizonStakingTypes } from "../interfaces/internal/IHorizonStakingTypes.sol"; +import { IGraphPayments } from "../interfaces/IGraphPayments.sol"; + +import { LinkedList } from "../libraries/LinkedList.sol"; + +/* solhint-disable max-states-count */ + +/** + * @title HorizonStakingV1Storage + * @notice This contract holds all the storage variables for the Staking contract. + * @dev Deprecated variables are kept to support the transition to Horizon Staking. + * They can eventually be collapsed into a single storage slot. + * @custom:security-contact Please email security+contracts@thegraph.com if you find any + * bugs. We may have an active bug bounty program. + */ +abstract contract HorizonStakingV1Storage { + // -- Staking -- + + /// @dev Minimum amount of tokens an indexer needs to stake. + /// Deprecated, now enforced by each data service (verifier) + uint256 internal __DEPRECATED_minimumIndexerStake; + + /// @dev Time in blocks to unstake + /// Deprecated, now enforced by each data service (verifier) + uint32 internal __DEPRECATED_thawingPeriod; // in blocks + + /// @dev Percentage of fees going to curators + /// Parts per million. (Allows for 4 decimal points, 999,999 = 99.9999%) + /// Deprecated, now enforced by each data service (verifier) + uint32 internal __DEPRECATED_curationPercentage; + + /// @dev Percentage of fees burned as protocol fee + /// Parts per million. (Allows for 4 decimal points, 999,999 = 99.9999%) + /// Deprecated, now enforced by each data service (verifier) + uint32 internal __DEPRECATED_protocolPercentage; + + /// @dev Period for allocation to be finalized + /// Deprecated with exponential rebates. + uint32 private __DEPRECATED_channelDisputeEpochs; + + /// @dev Maximum allocation time. + /// Deprecated, allocations now live on the subgraph service contract. + uint32 internal __DEPRECATED_maxAllocationEpochs; + + /// @dev Rebate alpha numerator + /// Originally used for Cobb-Douglas rebates, now used for exponential rebates + /// Deprecated, any rebate mechanism is now applied on the subgraph data service. + uint32 internal __DEPRECATED_alphaNumerator; + + /// @dev Rebate alpha denominator + /// Originally used for Cobb-Douglas rebates, now used for exponential rebates + /// Deprecated, any rebate mechanism is now applied on the subgraph data service. + uint32 internal __DEPRECATED_alphaDenominator; + + /// @dev Service providers details, tracks stake utilization. + mapping(address serviceProvider => IHorizonStakingTypes.ServiceProviderInternal details) internal _serviceProviders; + + /// @dev Allocation details. + /// Deprecated, now applied on the subgraph data service + mapping(address allocationId => IHorizonStakingExtension.Allocation allocation) internal __DEPRECATED_allocations; + + /// @dev Subgraph allocations, tracks the tokens allocated to a subgraph deployment + /// Deprecated, now applied on the SubgraphService + mapping(bytes32 subgraphDeploymentId => uint256 tokens) internal __DEPRECATED_subgraphAllocations; + + /// @dev Rebate pool details per epoch + /// Deprecated with exponential rebates. + mapping(uint256 epoch => uint256 rebates) private __DEPRECATED_rebates; + + // -- Slashing -- + + /// @dev List of addresses allowed to slash stakes + /// Deprecated, now each verifier can slash the corresponding provision. + mapping(address slasher => bool allowed) internal __DEPRECATED_slashers; + + // -- Delegation -- + + /// @dev Delegation capacity multiplier defined by the delegation ratio + /// Deprecated, enforced by each data service as needed. + uint32 internal __DEPRECATED_delegationRatio; + + /// @dev Time in blocks an indexer needs to wait to change delegation parameters + /// Deprecated, enforced by each data service as needed. + uint32 internal __DEPRECATED_delegationParametersCooldown; + + /// @dev Time in epochs a delegator needs to wait to withdraw delegated stake + /// Deprecated, now only enforced during a transition period + uint32 internal __DEPRECATED_delegationUnbondingPeriod; + + /// @dev Percentage of tokens to tax a delegation deposit + /// Parts per million. (Allows for 4 decimal points, 999,999 = 99.9999%) + /// Deprecated, no tax is applied now. + uint32 internal __DEPRECATED_delegationTaxPercentage; + + /// @dev Delegation pools (legacy). + /// Only used when the verifier is the subgraph data service. + mapping(address serviceProvider => IHorizonStakingTypes.DelegationPoolInternal delegationPool) + internal _legacyDelegationPools; + + // -- Operators -- + + /// @dev Operator allow list (legacy) + /// Only used when the verifier is the subgraph data service. + mapping(address serviceProvider => mapping(address legacyOperator => bool authorized)) internal _legacyOperatorAuth; + + // -- Asset Holders -- + + /// @dev Asset holder allow list + /// Deprecated with permissionless payers + mapping(address assetHolder => bool allowed) private __DEPRECATED_assetHolders; + + /// @dev Destination of accrued indexing rewards + /// Deprecated, defined by each data service as needed + mapping(address serviceProvider => address rewardsDestination) internal __DEPRECATED_rewardsDestination; + + /// @dev Address of the counterpart Staking contract on L1/L2 + /// Deprecated, transfer tools no longer enabled. + address internal __DEPRECATED_counterpartStakingAddress; + + /// @dev Address of the StakingExtension implementation + /// This is now an immutable variable to save some gas. + address internal __DEPRECATED_extensionImpl; + + /// @dev Rebate lambda numerator for exponential rebates + /// Deprecated, any rebate mechanism is now applied on the subgraph data service. + uint32 internal __DEPRECATED_lambdaNumerator; + + /// @dev Rebate lambda denominator for exponential rebates + /// Deprecated, any rebate mechanism is now applied on the subgraph data service. + uint32 internal __DEPRECATED_lambdaDenominator; + + // -- Horizon Staking -- + + /// @dev Maximum thawing period, in seconds, for a provision + /// Note that to protect delegation from being unfairly locked this should be set to a sufficiently low value + /// Additionally note that setting this to a high enough value could lead to overflow when calculating thawing until + /// dates. For practical purposes this should not be an issue but we recommend using a value like 1e18 to represent + /// "infinite thawing" if that is the intent. + uint64 internal _maxThawingPeriod; + + /// @dev Provisions from each service provider for each data service + mapping(address serviceProvider => mapping(address verifier => IHorizonStakingTypes.Provision provision)) + internal _provisions; + + /// @dev Delegation fee cuts for each service provider on each provision, by fee type: + /// This is the effective delegator fee cuts for each (data-service-defined) fee type (e.g. indexing fees, query fees). + /// This is in PPM and is the cut taken by the service provider from the fees that correspond to delegators. + /// (based on stake vs delegated stake proportion). + /// The cuts are applied in GraphPayments so apply to all data services that use it. + mapping(address serviceProvider => mapping(address verifier => mapping(IGraphPayments.PaymentTypes paymentType => uint256 feeCut))) + internal _delegationFeeCut; + + /// @dev Thaw requests + /// Details for each thawing operation in the staking contract (for both service providers and delegators). + mapping(IHorizonStakingTypes.ThawRequestType thawRequestType => mapping(bytes32 thawRequestId => IHorizonStakingTypes.ThawRequest thawRequest)) + internal _thawRequests; + + /// @dev Thaw request lists + /// Metadata defining linked lists of thaw requests for each service provider or delegator (owner) + mapping(IHorizonStakingTypes.ThawRequestType thawRequestType => mapping(address serviceProvider => mapping(address verifier => mapping(address owner => LinkedList.List list)))) + internal _thawRequestLists; + + /// @dev Operator allow list + /// Used for all verifiers except the subgraph data service. + mapping(address serviceProvider => mapping(address verifier => mapping(address operator => bool authorized))) + internal _operatorAuth; + + /// @dev Flag to enable or disable delegation slashing + bool internal _delegationSlashingEnabled; + + /// @dev Delegation pools for each service provider and verifier + mapping(address serviceProvider => mapping(address verifier => IHorizonStakingTypes.DelegationPoolInternal delegationPool)) + internal _delegationPools; + + /// @dev Allowed verifiers for locked provisions (i.e. from GraphTokenLockWallets) + // Verifiers are whitelisted to ensure locked tokens cannot escape using an arbitrary verifier. + mapping(address verifier => bool allowed) internal _allowedLockedVerifiers; +} diff --git a/packages/horizon/contracts/staking/libraries/ExponentialRebates.sol b/packages/horizon/contracts/staking/libraries/ExponentialRebates.sol new file mode 100644 index 000000000..b137079b3 --- /dev/null +++ b/packages/horizon/contracts/staking/libraries/ExponentialRebates.sol @@ -0,0 +1,66 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity 0.8.27; + +import { LibFixedMath } from "../../libraries/LibFixedMath.sol"; + +/** + * @title ExponentialRebates library + * @notice A library to compute query fee rebates using an exponential formula + * @dev This is only used for backwards compatibility in HorizonStaking, and should + * be removed after the transition period. + * @custom:security-contact Please email security+contracts@thegraph.com if you find any + * bugs. We may have an active bug bounty program. + */ +library ExponentialRebates { + /// @dev Maximum value of the exponent for which to compute the exponential before clamping to zero. + uint32 private constant MAX_EXPONENT = 15; + + /// @dev The exponential formula used to compute fee-based rewards for + /// staking pools in a given epoch. This function does not perform + /// bounds checking on the inputs, but the following conditions + /// need to be true: + /// 0 <= alphaNumerator / alphaDenominator <= 1 + /// 0 < lambdaNumerator / lambdaDenominator + /// The exponential rebates function has the form: + /// `(1 - alpha * exp ^ (-lambda * stake / fees)) * fees` + /// @param fees Fees generated by indexer in the staking pool. + /// @param stake Stake attributed to the indexer in the staking pool. + /// @param alphaNumerator Numerator of `alpha` in the rebates function. + /// @param alphaDenominator Denominator of `alpha` in the rebates function. + /// @param lambdaNumerator Numerator of `lambda` in the rebates function. + /// @param lambdaDenominator Denominator of `lambda` in the rebates function. + /// @return rewards Rewards owed to the staking pool. + function exponentialRebates( + uint256 fees, + uint256 stake, + uint32 alphaNumerator, + uint32 alphaDenominator, + uint32 lambdaNumerator, + uint32 lambdaDenominator + ) external pure returns (uint256) { + // If alpha is zero indexer gets 100% fees rebate + int256 alpha = LibFixedMath.toFixed(int32(alphaNumerator), int32(alphaDenominator)); + if (alpha == 0) { + return fees; + } + + // No rebates if no fees... + if (fees == 0) { + return 0; + } + + // Award all fees as rebate if the exponent is too large + int256 lambda = LibFixedMath.toFixed(int32(lambdaNumerator), int32(lambdaDenominator)); + int256 exponent = LibFixedMath.mulDiv(lambda, int256(stake), int256(fees)); + if (LibFixedMath.toInteger(exponent) > int256(uint256(MAX_EXPONENT))) { + return fees; + } + + // Compute `1 - alpha * exp ^(-exponent)` + int256 factor = LibFixedMath.sub(LibFixedMath.one(), LibFixedMath.mul(alpha, LibFixedMath.exp(-exponent))); + + // Weight the fees by the factor + return LibFixedMath.uintMul(factor, fees); + } +} diff --git a/packages/horizon/contracts/staking/utilities/Managed.sol b/packages/horizon/contracts/staking/utilities/Managed.sol new file mode 100644 index 000000000..b2e36056f --- /dev/null +++ b/packages/horizon/contracts/staking/utilities/Managed.sol @@ -0,0 +1,66 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity 0.8.27; + +import { GraphDirectory } from "../../utilities/GraphDirectory.sol"; + +/* solhint-disable var-name-mixedcase */ + +/** + * @title Graph Managed contract + * @dev The Managed contract provides an interface to interact with the Controller. + * For Graph Horizon this contract is mostly a shell that uses {GraphDirectory}, however since the {HorizonStaking} + * contract uses it we need to preserve the storage layout. + * Inspired by Livepeer: https://github.com/livepeer/protocol/blob/streamflow/contracts/Controller.sol + * @custom:security-contact Please email security+contracts@thegraph.com if you find any + * bugs. We may have an active bug bounty program. + */ +abstract contract Managed is GraphDirectory { + // -- State -- + + /// @notice Controller that manages this contract + address private __DEPRECATED_controller; + + /// @dev Cache for the addresses of the contracts retrieved from the controller + mapping(bytes32 contractName => address contractAddress) private __DEPRECATED_addressCache; + + /// @dev Gap for future storage variables + uint256[10] private __gap; + + /** + * @notice Thrown when a protected function is called and the contract is paused. + */ + error ManagedIsPaused(); + + /** + * @notice Thrown when a the caller is not the expected controller address. + */ + error ManagedOnlyController(); + + /** + * @notice Thrown when a the caller is not the governor. + */ + error ManagedOnlyGovernor(); + + /** + * @dev Revert if the controller is paused + */ + modifier notPaused() { + require(!_graphController().paused(), ManagedIsPaused()); + _; + } + + /** + * @dev Revert if the caller is not the governor + */ + modifier onlyGovernor() { + require(msg.sender == _graphController().getGovernor(), ManagedOnlyGovernor()); + _; + } + + /** + * @dev Initialize the contract + * @param controller_ The address of the Graph controller contract. + */ + constructor(address controller_) GraphDirectory(controller_) {} +} diff --git a/packages/horizon/contracts/utilities/Authorizable.sol b/packages/horizon/contracts/utilities/Authorizable.sol new file mode 100644 index 000000000..5d164c2c3 --- /dev/null +++ b/packages/horizon/contracts/utilities/Authorizable.sol @@ -0,0 +1,135 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +pragma solidity 0.8.27; + +import { IAuthorizable } from "../interfaces/IAuthorizable.sol"; + +import { ECDSA } from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; +import { MessageHashUtils } from "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol"; + +/** + * @title Authorizable contract + * @dev Implements the {IAuthorizable} interface. + * @notice A mechanism to authorize signers to sign messages on behalf of an authorizer. + * Signers cannot be reused for different authorizers. + * @dev Contract uses "authorizeSignerProof" as the domain for signer proofs. + * @custom:security-contact Please email security+contracts@thegraph.com if you find any + * bugs. We may have an active bug bounty program. + */ +abstract contract Authorizable is IAuthorizable { + /// @notice The duration (in seconds) for which an authorization is thawing before it can be revoked + uint256 public immutable REVOKE_AUTHORIZATION_THAWING_PERIOD; + + /// @notice Authorization details for authorizer-signer pairs + mapping(address signer => Authorization authorization) public authorizations; + + /** + * @dev Revert if the caller has not authorized the signer + * @param signer The address of the signer + */ + modifier onlyAuthorized(address signer) { + _requireAuthorized(msg.sender, signer); + _; + } + + /** + * @notice Constructs a new instance of the Authorizable contract. + * @param revokeAuthorizationThawingPeriod The duration (in seconds) for which an authorization is thawing before it can be revoked. + */ + constructor(uint256 revokeAuthorizationThawingPeriod) { + REVOKE_AUTHORIZATION_THAWING_PERIOD = revokeAuthorizationThawingPeriod; + } + + /// @inheritdoc IAuthorizable + function authorizeSigner(address signer, uint256 proofDeadline, bytes calldata proof) external { + require( + authorizations[signer].authorizer == address(0), + AuthorizableSignerAlreadyAuthorized( + authorizations[signer].authorizer, + signer, + authorizations[signer].revoked + ) + ); + _verifyAuthorizationProof(proof, proofDeadline, signer); + authorizations[signer].authorizer = msg.sender; + emit SignerAuthorized(msg.sender, signer); + } + + /// @inheritdoc IAuthorizable + function thawSigner(address signer) external onlyAuthorized(signer) { + authorizations[signer].thawEndTimestamp = block.timestamp + REVOKE_AUTHORIZATION_THAWING_PERIOD; + emit SignerThawing(msg.sender, signer, authorizations[signer].thawEndTimestamp); + } + + /// @inheritdoc IAuthorizable + function cancelThawSigner(address signer) external onlyAuthorized(signer) { + require(authorizations[signer].thawEndTimestamp > 0, AuthorizableSignerNotThawing(signer)); + uint256 thawEnd = authorizations[signer].thawEndTimestamp; + authorizations[signer].thawEndTimestamp = 0; + emit SignerThawCanceled(msg.sender, signer, thawEnd); + } + + /// @inheritdoc IAuthorizable + function revokeAuthorizedSigner(address signer) external onlyAuthorized(signer) { + uint256 thawEndTimestamp = authorizations[signer].thawEndTimestamp; + require(thawEndTimestamp > 0, AuthorizableSignerNotThawing(signer)); + require(thawEndTimestamp <= block.timestamp, AuthorizableSignerStillThawing(block.timestamp, thawEndTimestamp)); + authorizations[signer].revoked = true; + emit SignerRevoked(msg.sender, signer); + } + + /// @inheritdoc IAuthorizable + function getThawEnd(address signer) external view returns (uint256) { + return authorizations[signer].thawEndTimestamp; + } + + /// @inheritdoc IAuthorizable + function isAuthorized(address authorizer, address signer) external view returns (bool) { + return _isAuthorized(authorizer, signer); + } + + /** + * @notice Returns true if the signer is authorized by the authorizer + * @param _authorizer The address of the authorizer + * @param _signer The address of the signer + * @return true if the signer is authorized by the authorizer, false otherwise + */ + function _isAuthorized(address _authorizer, address _signer) internal view returns (bool) { + return (_authorizer != address(0) && + authorizations[_signer].authorizer == _authorizer && + !authorizations[_signer].revoked); + } + + /** + * @notice Reverts if the authorizer has not authorized the signer + * @param _authorizer The address of the authorizer + * @param _signer The address of the signer + */ + function _requireAuthorized(address _authorizer, address _signer) internal view { + require(_isAuthorized(_authorizer, _signer), AuthorizableSignerNotAuthorized(_authorizer, _signer)); + } + + /** + * @notice Verify the authorization proof provided by the authorizer + * @param _proof The proof provided by the authorizer + * @param _proofDeadline The deadline by which the proof must be verified + * @param _signer The authorization recipient + */ + function _verifyAuthorizationProof(bytes calldata _proof, uint256 _proofDeadline, address _signer) private view { + // Check that the proofDeadline has not passed + require( + _proofDeadline > block.timestamp, + AuthorizableInvalidSignerProofDeadline(_proofDeadline, block.timestamp) + ); + + // Generate the message hash + bytes32 messageHash = keccak256( + abi.encodePacked(block.chainid, address(this), "authorizeSignerProof", _proofDeadline, msg.sender) + ); + + // Generate the allegedly signed digest + bytes32 digest = MessageHashUtils.toEthSignedMessageHash(messageHash); + + // Verify that the recovered signer matches the to be authorized signer + require(ECDSA.recover(digest, _proof) == _signer, AuthorizableInvalidSignerProof()); + } +} diff --git a/packages/horizon/contracts/utilities/GraphDirectory.sol b/packages/horizon/contracts/utilities/GraphDirectory.sol new file mode 100644 index 000000000..418b58619 --- /dev/null +++ b/packages/horizon/contracts/utilities/GraphDirectory.sol @@ -0,0 +1,226 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity 0.8.27; + +import { IGraphToken } from "@graphprotocol/contracts/contracts/token/IGraphToken.sol"; +import { IHorizonStaking } from "../interfaces/IHorizonStaking.sol"; +import { IGraphPayments } from "../interfaces/IGraphPayments.sol"; +import { IPaymentsEscrow } from "../interfaces/IPaymentsEscrow.sol"; + +import { IController } from "@graphprotocol/contracts/contracts/governance/IController.sol"; +import { IEpochManager } from "@graphprotocol/contracts/contracts/epochs/IEpochManager.sol"; +import { IRewardsManager } from "@graphprotocol/contracts/contracts/rewards/IRewardsManager.sol"; +import { ITokenGateway } from "@graphprotocol/contracts/contracts/arbitrum/ITokenGateway.sol"; +import { IGraphProxyAdmin } from "../interfaces/IGraphProxyAdmin.sol"; + +import { ICuration } from "@graphprotocol/contracts/contracts/curation/ICuration.sol"; + +/** + * @title GraphDirectory contract + * @notice This contract is meant to be inherited by other contracts that + * need to keep track of the addresses in Graph Horizon contracts. + * It fetches the addresses from the Controller supplied during construction, + * and uses immutable variables to minimize gas costs. + */ +abstract contract GraphDirectory { + // -- Graph Horizon contracts -- + + /// @notice The Graph Token contract address + IGraphToken private immutable GRAPH_TOKEN; + + /// @notice The Horizon Staking contract address + IHorizonStaking private immutable GRAPH_STAKING; + + /// @notice The Graph Payments contract address + IGraphPayments private immutable GRAPH_PAYMENTS; + + /// @notice The Payments Escrow contract address + IPaymentsEscrow private immutable GRAPH_PAYMENTS_ESCROW; + + // -- Graph periphery contracts -- + + /// @notice The Graph Controller contract address + IController private immutable GRAPH_CONTROLLER; + + /// @notice The Epoch Manager contract address + IEpochManager private immutable GRAPH_EPOCH_MANAGER; + + /// @notice The Rewards Manager contract address + IRewardsManager private immutable GRAPH_REWARDS_MANAGER; + + /// @notice The Token Gateway contract address + ITokenGateway private immutable GRAPH_TOKEN_GATEWAY; + + /// @notice The Graph Proxy Admin contract address + IGraphProxyAdmin private immutable GRAPH_PROXY_ADMIN; + + // -- Legacy Graph contracts -- + // These are required for backwards compatibility on HorizonStakingExtension + // TRANSITION PERIOD: remove these once HorizonStakingExtension is removed + + /// @notice The Curation contract address + ICuration private immutable GRAPH_CURATION; + + /** + * @notice Emitted when the GraphDirectory is initialized + * @param graphToken The Graph Token contract address + * @param graphStaking The Horizon Staking contract address + * @param graphPayments The Graph Payments contract address + * @param graphEscrow The Payments Escrow contract address + * @param graphController The Graph Controller contract address + * @param graphEpochManager The Epoch Manager contract address + * @param graphRewardsManager The Rewards Manager contract address + * @param graphTokenGateway The Token Gateway contract address + * @param graphProxyAdmin The Graph Proxy Admin contract address + * @param graphCuration The Curation contract address + */ + event GraphDirectoryInitialized( + address indexed graphToken, + address indexed graphStaking, + address graphPayments, + address graphEscrow, + address indexed graphController, + address graphEpochManager, + address graphRewardsManager, + address graphTokenGateway, + address graphProxyAdmin, + address graphCuration + ); + + /** + * @notice Thrown when either the controller is the zero address or a contract address is not found + * on the controller + * @param contractName The name of the contract that was not found, or the controller + */ + error GraphDirectoryInvalidZeroAddress(bytes contractName); + + /** + * @notice Constructor for the GraphDirectory contract + * @dev Requirements: + * - `controller` cannot be zero address + * + * Emits a {GraphDirectoryInitialized} event + * + * @param controller The address of the Graph Controller contract. + */ + constructor(address controller) { + require(controller != address(0), GraphDirectoryInvalidZeroAddress("Controller")); + + GRAPH_CONTROLLER = IController(controller); + GRAPH_TOKEN = IGraphToken(_getContractFromController("GraphToken")); + GRAPH_STAKING = IHorizonStaking(_getContractFromController("Staking")); + GRAPH_PAYMENTS = IGraphPayments(_getContractFromController("GraphPayments")); + GRAPH_PAYMENTS_ESCROW = IPaymentsEscrow(_getContractFromController("PaymentsEscrow")); + GRAPH_EPOCH_MANAGER = IEpochManager(_getContractFromController("EpochManager")); + GRAPH_REWARDS_MANAGER = IRewardsManager(_getContractFromController("RewardsManager")); + GRAPH_TOKEN_GATEWAY = ITokenGateway(_getContractFromController("GraphTokenGateway")); + GRAPH_PROXY_ADMIN = IGraphProxyAdmin(_getContractFromController("GraphProxyAdmin")); + GRAPH_CURATION = ICuration(_getContractFromController("Curation")); + + emit GraphDirectoryInitialized( + address(GRAPH_TOKEN), + address(GRAPH_STAKING), + address(GRAPH_PAYMENTS), + address(GRAPH_PAYMENTS_ESCROW), + address(GRAPH_CONTROLLER), + address(GRAPH_EPOCH_MANAGER), + address(GRAPH_REWARDS_MANAGER), + address(GRAPH_TOKEN_GATEWAY), + address(GRAPH_PROXY_ADMIN), + address(GRAPH_CURATION) + ); + } + + /** + * @notice Get the Graph Token contract + * @return The Graph Token contract + */ + function _graphToken() internal view returns (IGraphToken) { + return GRAPH_TOKEN; + } + + /** + * @notice Get the Horizon Staking contract + * @return The Horizon Staking contract + */ + function _graphStaking() internal view returns (IHorizonStaking) { + return GRAPH_STAKING; + } + + /** + * @notice Get the Graph Payments contract + * @return The Graph Payments contract + */ + function _graphPayments() internal view returns (IGraphPayments) { + return GRAPH_PAYMENTS; + } + + /** + * @notice Get the Payments Escrow contract + * @return The Payments Escrow contract + */ + function _graphPaymentsEscrow() internal view returns (IPaymentsEscrow) { + return GRAPH_PAYMENTS_ESCROW; + } + + /** + * @notice Get the Graph Controller contract + * @return The Graph Controller contract + */ + function _graphController() internal view returns (IController) { + return GRAPH_CONTROLLER; + } + + /** + * @notice Get the Epoch Manager contract + * @return The Epoch Manager contract + */ + function _graphEpochManager() internal view returns (IEpochManager) { + return GRAPH_EPOCH_MANAGER; + } + + /** + * @notice Get the Rewards Manager contract + * @return The Rewards Manager contract address + */ + function _graphRewardsManager() internal view returns (IRewardsManager) { + return GRAPH_REWARDS_MANAGER; + } + + /** + * @notice Get the Graph Token Gateway contract + * @return The Graph Token Gateway contract + */ + function _graphTokenGateway() internal view returns (ITokenGateway) { + return GRAPH_TOKEN_GATEWAY; + } + + /** + * @notice Get the Graph Proxy Admin contract + * @return The Graph Proxy Admin contract + */ + function _graphProxyAdmin() internal view returns (IGraphProxyAdmin) { + return GRAPH_PROXY_ADMIN; + } + + /** + * @notice Get the Curation contract + * @return The Curation contract + */ + function _graphCuration() internal view returns (ICuration) { + return GRAPH_CURATION; + } + + /** + * @notice Get a contract address from the controller + * @dev Requirements: + * - The `_contractName` must be registered in the controller + * @param _contractName The name of the contract to fetch from the controller + * @return The address of the contract + */ + function _getContractFromController(bytes memory _contractName) private view returns (address) { + address contractAddress = GRAPH_CONTROLLER.getContractProxy(keccak256(_contractName)); + require(contractAddress != address(0), GraphDirectoryInvalidZeroAddress(_contractName)); + return contractAddress; + } +} diff --git a/packages/horizon/eslint.config.js b/packages/horizon/eslint.config.js new file mode 100644 index 000000000..c9e06b116 --- /dev/null +++ b/packages/horizon/eslint.config.js @@ -0,0 +1,21 @@ +// @ts-check +/* eslint-disable no-undef */ +/* eslint-disable @typescript-eslint/no-var-requires */ +/* eslint-disable @typescript-eslint/no-unsafe-assignment */ + +const eslintGraphConfig = require('eslint-graph-config') +module.exports = [ + ...eslintGraphConfig.default, + { + rules: { + '@typescript-eslint/no-unsafe-assignment': 'off', + '@typescript-eslint/no-var-requires': 'off', + '@typescript-eslint/no-unsafe-call': 'off', + '@typescript-eslint/no-unsafe-member-access': 'off', + '@typescript-eslint/no-unsafe-argument': 'off', + }, + }, + { + ignores: ['typechain-types/*', 'lib/*'], + }, +] diff --git a/packages/horizon/foundry.toml b/packages/horizon/foundry.toml new file mode 100644 index 000000000..552938288 --- /dev/null +++ b/packages/horizon/foundry.toml @@ -0,0 +1,9 @@ +[profile.default] +src = 'contracts' +out = 'build' +libs = ['node_modules', 'lib'] +test = 'test' +cache_path = 'cache_forge' +fs_permissions = [{ access = "read", path = "./"}] +optimizer = true +optimizer_runs = 100 \ No newline at end of file diff --git a/packages/horizon/hardhat.config.ts b/packages/horizon/hardhat.config.ts new file mode 100644 index 000000000..6032c48c4 --- /dev/null +++ b/packages/horizon/hardhat.config.ts @@ -0,0 +1,43 @@ +import { hardhatBaseConfig, isProjectBuilt, loadTasks } from '@graphprotocol/toolshed/hardhat' +import type { HardhatUserConfig } from 'hardhat/types' + +// Hardhat plugins +import '@nomicfoundation/hardhat-foundry' +import '@nomicfoundation/hardhat-toolbox' +import '@nomicfoundation/hardhat-ignition-ethers' +import 'hardhat-contract-sizer' +import 'hardhat-secure-accounts' + +// Skip importing hardhat-graph-protocol when building the project, it has circular dependency +if (isProjectBuilt(__dirname)) { + require('hardhat-graph-protocol') + loadTasks(__dirname) +} + +const config: HardhatUserConfig = { + ...hardhatBaseConfig, + solidity: { + version: '0.8.27', + settings: { + optimizer: { + enabled: true, + runs: 20, + }, + }, + }, + etherscan: { + ...hardhatBaseConfig.etherscan, + customChains: [ + { + network: 'arbitrumSepolia', + chainId: 421614, + urls: { + apiURL: 'https://api-sepolia.arbiscan.io/api', + browserURL: 'https://sepolia.arbiscan.io/', + }, + }, + ], + }, +} + +export default config diff --git a/packages/horizon/ignition/configs/migrate.default.json5 b/packages/horizon/ignition/configs/migrate.default.json5 new file mode 100644 index 000000000..546b4287f --- /dev/null +++ b/packages/horizon/ignition/configs/migrate.default.json5 @@ -0,0 +1,45 @@ +{ + "$global": { + // Accounts already configured in the original Graph Protocol - Arbitrum Sepolia values + "governor": "0x72ee30d43Fb5A90B3FE983156C5d2fBE6F6d07B3", + + // Addresses for contracts deployed in the original Graph Protocol - Arbitrum Sepolia values + "graphProxyAdminAddress": "0x7474a6cc5fAeDEc620Db0fa8E4da6eD58477042C", + "controllerAddress": "0x9DB3ee191681f092607035d9BDA6e59FbEaCa695", + "horizonStakingAddress": "0x865365C425f3A593Ffe698D9c4E6707D14d51e08", + "epochManagerAddress": "0x88b3C7f37253bAA1A9b95feAd69bD5320585826D", + "graphTokenAddress": "0xf8c05dCF59E8B28BFD5eed176C562bEbcfc7Ac04", + "graphTokenGatewayAddress": "0xB24Ce0f8c18c4DdDa584A7EeC132F49C966813bb", + "rewardsManagerAddress": "0x1F49caE7669086c8ba53CC35d1E9f80176d67E79", + "curationAddress": "0xDe761f075200E75485F4358978FB4d1dC8644FD5", + "gnsAddress": "0x3133948342F35b8699d8F94aeE064AbB76eDe965", + "gnsImplementationAddress": "0x00CBF5024d454255577Bf2b0fB6A43328a6828c9", + "subgraphNFTAddress": "0xF21Df5BbA7EB9b54D8F60C560aFb9bA63e6aED1A", + + // Must be set for step 2 of the migration + "graphPaymentsAddress": "", + "paymentsEscrowAddress": "", + + // Must be set for step 3 and 4 of the migration + "subgraphServiceAddress": "", + + // Must be set for step 4 of the migration + "horizonStakingImplementationAddress": "", + "curationImplementationAddress": "", + "rewardsManagerImplementationAddress": "", + + // Global parameters + "maxThawingPeriod": 2419200 + }, + "GraphPayments": { + "protocolPaymentCut": 10000 + }, + "PaymentsEscrow": { + "withdrawEscrowThawingPeriod": 10000 + }, + "GraphTallyCollector": { + "eip712Name": "GraphTallyCollector", + "eip712Version": "1", + "revokeSignerThawingPeriod": 10000 + } +} diff --git a/packages/horizon/ignition/configs/migrate.fork1.json5 b/packages/horizon/ignition/configs/migrate.fork1.json5 new file mode 100644 index 000000000..543cc3443 --- /dev/null +++ b/packages/horizon/ignition/configs/migrate.fork1.json5 @@ -0,0 +1,45 @@ +{ + "$global": { + // Accounts already configured in the original Graph Protocol - Arbitrum Sepolia values + "governor": "0x72ee30d43Fb5A90B3FE983156C5d2fBE6F6d07B3", + + // Addresses for contracts deployed in the original Graph Protocol - Arbitrum Sepolia values + "graphProxyAdminAddress": "0x7474a6cc5fAeDEc620Db0fa8E4da6eD58477042C", + "controllerAddress": "0x9DB3ee191681f092607035d9BDA6e59FbEaCa695", + "horizonStakingAddress": "0x865365C425f3A593Ffe698D9c4E6707D14d51e08", + "epochManagerAddress": "0x88b3C7f37253bAA1A9b95feAd69bD5320585826D", + "graphTokenAddress": "0xf8c05dCF59E8B28BFD5eed176C562bEbcfc7Ac04", + "graphTokenGatewayAddress": "0xB24Ce0f8c18c4DdDa584A7EeC132F49C966813bb", + "rewardsManagerAddress": "0x1F49caE7669086c8ba53CC35d1E9f80176d67E79", + "curationAddress": "0xDe761f075200E75485F4358978FB4d1dC8644FD5", + "gnsAddress": "0x3133948342F35b8699d8F94aeE064AbB76eDe965", + "gnsImplementationAddress": "0x00CBF5024d454255577Bf2b0fB6A43328a6828c9", + "subgraphNFTAddress": "0xF21Df5BbA7EB9b54D8F60C560aFb9bA63e6aED1A", + + // Must be set for step 2 of the migration + "graphPaymentsAddress": "0x1A7Fb71014d4395903eC56662f32dD02344D361C", + "paymentsEscrowAddress": "0x00fe8F95407AB61863d27c07F584A0930ee5F3b0", + + // Must be set for step 3 and 4 of the migration + "subgraphServiceAddress": "0x8A44C49eD477e7130249d4B8d5248d08B469Bf0d", + + // Must be set for step 4 of the migration + "horizonStakingImplementationAddress": "0xf1b9D089f5f6dEd46EC88830051db0e68c58e032", + "curationImplementationAddress": "0x9CCD9B656f8A558879974ef2505496eEd7Ef7210", + "rewardsManagerImplementationAddress": "0x4dEA2d1Be05909B71F539FD32601F7bd736c28D4", + + // Global parameters + "maxThawingPeriod": 2419200 + }, + "GraphPayments": { + "protocolPaymentCut": 10000 + }, + "PaymentsEscrow": { + "withdrawEscrowThawingPeriod": 10000 + }, + "GraphTallyCollector": { + "eip712Name": "GraphTallyCollector", + "eip712Version": "1", + "revokeSignerThawingPeriod": 10000 + } +} diff --git a/packages/horizon/ignition/configs/migrate.integration.json5 b/packages/horizon/ignition/configs/migrate.integration.json5 new file mode 100644 index 000000000..35b3e4547 --- /dev/null +++ b/packages/horizon/ignition/configs/migrate.integration.json5 @@ -0,0 +1,45 @@ +{ + "$global": { + // Accounts + "governor": "0xFFcf8FDEE72ac11b5c542428B35EEF5769C409f0", + + // Addresses for contracts deployed in the original Graph Protocol + "graphProxyAdminAddress": "0x7474a6cc5fAeDEc620Db0fa8E4da6eD58477042C", + "controllerAddress": "0x9DB3ee191681f092607035d9BDA6e59FbEaCa695", + "horizonStakingAddress": "0x865365C425f3A593Ffe698D9c4E6707D14d51e08", + "epochManagerAddress": "0x88b3C7f37253bAA1A9b95feAd69bD5320585826D", + "graphTokenAddress": "0xf8c05dCF59E8B28BFD5eed176C562bEbcfc7Ac04", + "graphTokenGatewayAddress": "0xB24Ce0f8c18c4DdDa584A7EeC132F49C966813bb", + "rewardsManagerAddress": "0x1F49caE7669086c8ba53CC35d1E9f80176d67E79", + "curationAddress": "0xDe761f075200E75485F4358978FB4d1dC8644FD5", + "gnsAddress": "0x3133948342F35b8699d8F94aeE064AbB76eDe965", + "gnsImplementationAddress": "0x00CBF5024d454255577Bf2b0fB6A43328a6828c9", + "subgraphNFTAddress": "0xF21Df5BbA7EB9b54D8F60C560aFb9bA63e6aED1A", + + // Must be set for step 2 of the migration + "graphPaymentsAddress": "", + "paymentsEscrowAddress": "", + + // Must be set for step 3 and 4 of the migration + "subgraphServiceAddress": "", + + // Must be set for step 4 of the migration + "horizonStakingImplementationAddress": "", + "curationImplementationAddress": "", + "rewardsManagerImplementationAddress": "", + + // Global parameters + "maxThawingPeriod": 2419200 + }, + "GraphPayments": { + "protocolPaymentCut": 10000 + }, + "PaymentsEscrow": { + "withdrawEscrowThawingPeriod": 10000 + }, + "GraphTallyCollector": { + "eip712Name": "GraphTallyCollector", + "eip712Version": "1", + "revokeSignerThawingPeriod": 10000 + } +} diff --git a/packages/horizon/ignition/configs/protocol.default.json5 b/packages/horizon/ignition/configs/protocol.default.json5 new file mode 100644 index 000000000..538561aa1 --- /dev/null +++ b/packages/horizon/ignition/configs/protocol.default.json5 @@ -0,0 +1,39 @@ +{ + "$global": { + // Accounts for new deployment - derived from hardhat default mnemonic + "pauseGuardian": "0xE11BA2b4D45Eaed5996Cd0823791E0C93114882d", // index 3 + "subgraphAvailabilityOracle": "0xd03ea8624C8C5987235048901fB614fDcA89b117", // index 4 + + // Placeholder address for a standalone Horizon deployment, see README.md for more details + "subgraphServiceAddress": "0x0000000000000000000000000000000000000000", + + // Global parameters + "maxThawingPeriod": 2419200 + }, + "GraphPayments": { + "protocolPaymentCut": 10000 + }, + "PaymentsEscrow": { + "withdrawEscrowThawingPeriod": 10000 + }, + "GraphTallyCollector": { + "eip712Name": "GraphTallyCollector", + "eip712Version": "1", + "revokeSignerThawingPeriod": 10000 + }, + "RewardsManager": { + "issuancePerBlock": "114155251141552511415n" + }, + "EpochManager": { + "epochLength": 60 + }, + "L2Curation": { + "curationTaxPercentage": 10000, + "minimumCurationDeposit": 1 + }, + "L2GraphToken": { + "initialSupply": "10000000000000000000000000000n" + }, + + +} diff --git a/packages/horizon/ignition/configs/protocol.localNetwork.json5 b/packages/horizon/ignition/configs/protocol.localNetwork.json5 new file mode 100644 index 000000000..cea86ca46 --- /dev/null +++ b/packages/horizon/ignition/configs/protocol.localNetwork.json5 @@ -0,0 +1,39 @@ +{ + "$global": { + // Accounts for new deployment - derived from hardhat default mnemonic + "pauseGuardian": "0xE11BA2b4D45Eaed5996Cd0823791E0C93114882d", // index 3 + "subgraphAvailabilityOracle": "0xd03ea8624C8C5987235048901fB614fDcA89b117", // index 4 + + // Placeholder address for a standalone Horizon deployment, see README.md for more details + "subgraphServiceAddress": "0x0000000000000000000000000000000000000000", + + // Global parameters + "maxThawingPeriod": 2419200 + }, + "GraphPayments": { + "protocolPaymentCut": 10000 + }, + "PaymentsEscrow": { + "withdrawEscrowThawingPeriod": 10000 + }, + "GraphTallyCollector": { + "eip712Name": "GraphTallyCollector", + "eip712Version": "1", + "revokeSignerThawingPeriod": 10000 + }, + "RewardsManager": { + "issuancePerBlock": "114155251141552511415n" + }, + "EpochManager": { + "epochLength": 60, // Note that localNetwork does not auto-mine blocks, so this could be any amount of time in seconds + }, + "L2Curation": { + "curationTaxPercentage": 10000, + "minimumCurationDeposit": 1 + }, + "L2GraphToken": { + "initialSupply": "10000000000000000000000000000n" + }, + + +} diff --git a/packages/horizon/ignition/modules/core/GraphPayments.ts b/packages/horizon/ignition/modules/core/GraphPayments.ts new file mode 100644 index 000000000..56aa73f60 --- /dev/null +++ b/packages/horizon/ignition/modules/core/GraphPayments.ts @@ -0,0 +1,70 @@ +import { buildModule } from '@nomicfoundation/hardhat-ignition/modules' +import { deployImplementation } from '../proxy/implementation' +import { upgradeTransparentUpgradeableProxy } from '../proxy/TransparentUpgradeableProxy' + +import GraphPeripheryModule, { MigratePeripheryModule } from '../periphery/periphery' +import HorizonProxiesModule, { MigrateHorizonProxiesDeployerModule } from './HorizonProxies' + +import GraphPaymentsArtifact from '../../../build/contracts/contracts/payments/GraphPayments.sol/GraphPayments.json' + +export default buildModule('GraphPayments', (m) => { + const { Controller } = m.useModule(GraphPeripheryModule) + const { GraphPaymentsProxyAdmin, GraphPaymentsProxy } = m.useModule(HorizonProxiesModule) + + const governor = m.getAccount(1) + const protocolPaymentCut = m.getParameter('protocolPaymentCut') + + // Deploy GraphPayments implementation - requires periphery and proxies to be registered in the controller + const GraphPaymentsImplementation = deployImplementation(m, { + name: 'GraphPayments', + artifact: GraphPaymentsArtifact, + constructorArgs: [Controller, protocolPaymentCut], + }, { after: [GraphPeripheryModule, HorizonProxiesModule] }) + + // Upgrade proxy to implementation contract + const GraphPayments = upgradeTransparentUpgradeableProxy(m, + GraphPaymentsProxyAdmin, + GraphPaymentsProxy, + GraphPaymentsImplementation, { + name: 'GraphPayments', + artifact: GraphPaymentsArtifact, + initArgs: [], + }) + + m.call(GraphPaymentsProxyAdmin, 'transferOwnership', [governor], { after: [GraphPayments] }) + + return { GraphPayments, GraphPaymentsProxyAdmin, GraphPaymentsImplementation } +}) + +// Note that this module requires MigrateHorizonProxiesGovernorModule to be executed first +// The dependency is not made explicit to support the production workflow where the governor is a +// multisig owned by the Graph Council. +// For testnet, the dependency can be made explicit by having a parent module establish it. +export const MigrateGraphPaymentsModule = buildModule('GraphPayments', (m) => { + const { GraphPaymentsProxyAdmin, GraphPaymentsProxy } = m.useModule(MigrateHorizonProxiesDeployerModule) + const { Controller } = m.useModule(MigratePeripheryModule) + + const governor = m.getParameter('governor') + const protocolPaymentCut = m.getParameter('protocolPaymentCut') + + // Deploy GraphPayments implementation + const GraphPaymentsImplementation = deployImplementation(m, { + name: 'GraphPayments', + artifact: GraphPaymentsArtifact, + constructorArgs: [Controller, protocolPaymentCut], + }) + + // Upgrade proxy to implementation contract + const GraphPayments = upgradeTransparentUpgradeableProxy(m, + GraphPaymentsProxyAdmin, + GraphPaymentsProxy, + GraphPaymentsImplementation, { + name: 'GraphPayments', + artifact: GraphPaymentsArtifact, + initArgs: [], + }) + + m.call(GraphPaymentsProxyAdmin, 'transferOwnership', [governor], { after: [GraphPayments] }) + + return { GraphPayments, GraphPaymentsProxyAdmin, GraphPaymentsImplementation } +}) diff --git a/packages/horizon/ignition/modules/core/GraphTallyCollector.ts b/packages/horizon/ignition/modules/core/GraphTallyCollector.ts new file mode 100644 index 000000000..1f1a7f767 --- /dev/null +++ b/packages/horizon/ignition/modules/core/GraphTallyCollector.ts @@ -0,0 +1,43 @@ +import { buildModule } from '@nomicfoundation/hardhat-ignition/modules' + +import GraphPeripheryModule, { MigratePeripheryModule } from '../periphery/periphery' +import HorizonProxiesModule from './HorizonProxies' + +import GraphTallyCollectorArtifact from '../../../build/contracts/contracts/payments/collectors/GraphTallyCollector.sol/GraphTallyCollector.json' + +export default buildModule('GraphTallyCollector', (m) => { + const { Controller } = m.useModule(GraphPeripheryModule) + + const name = m.getParameter('eip712Name') + const version = m.getParameter('eip712Version') + const revokeSignerThawingPeriod = m.getParameter('revokeSignerThawingPeriod') + + const GraphTallyCollector = m.contract( + 'GraphTallyCollector', + GraphTallyCollectorArtifact, + [name, version, Controller, revokeSignerThawingPeriod], + { after: [GraphPeripheryModule, HorizonProxiesModule] }, + ) + + return { GraphTallyCollector } +}) + +// Note that this module requires MigrateHorizonProxiesGovernorModule to be executed first +// The dependency is not made explicit to support the production workflow where the governor is a +// multisig owned by the Graph Council. +// For testnet, the dependency can be made explicit by having a parent module establish it. +export const MigrateGraphTallyCollectorModule = buildModule('GraphTallyCollector', (m) => { + const { Controller } = m.useModule(MigratePeripheryModule) + + const name = m.getParameter('eip712Name') + const version = m.getParameter('eip712Version') + const revokeSignerThawingPeriod = m.getParameter('revokeSignerThawingPeriod') + + const GraphTallyCollector = m.contract( + 'GraphTallyCollector', + GraphTallyCollectorArtifact, + [name, version, Controller, revokeSignerThawingPeriod], + ) + + return { GraphTallyCollector } +}) diff --git a/packages/horizon/ignition/modules/core/HorizonProxies.ts b/packages/horizon/ignition/modules/core/HorizonProxies.ts new file mode 100644 index 000000000..9345beeae --- /dev/null +++ b/packages/horizon/ignition/modules/core/HorizonProxies.ts @@ -0,0 +1,81 @@ +import { buildModule } from '@nomicfoundation/hardhat-ignition/modules' +import { deployGraphProxy } from '../proxy/GraphProxy' +import { deployTransparentUpgradeableProxy } from '../proxy/TransparentUpgradeableProxy' +import { ethers } from 'ethers' + +import GraphPeripheryModule from '../periphery/periphery' +import { MigrateControllerGovernorModule } from '../periphery/Controller' + +import GraphPaymentsArtifact from '../../../build/contracts/contracts/payments/GraphPayments.sol/GraphPayments.json' +import PaymentsEscrowArtifact from '../../../build/contracts/contracts/payments/PaymentsEscrow.sol/PaymentsEscrow.json' + +// HorizonStaking, GraphPayments and PaymentsEscrow use GraphDirectory but they are also in the directory. +// So we need to deploy their proxies, register them in the controller before being able to deploy the implementations +export default buildModule('HorizonProxies', (m) => { + const { Controller, GraphProxyAdmin } = m.useModule(GraphPeripheryModule) + + // Deploy HorizonStaking proxy with no implementation + const HorizonStakingProxy = deployGraphProxy(m, GraphProxyAdmin) + m.call(Controller, 'setContractProxy', + [ethers.keccak256(ethers.toUtf8Bytes('Staking')), HorizonStakingProxy], + { id: 'setContractProxy_HorizonStaking' }, + ) + + // Deploy and register GraphPayments proxy + const { Proxy: GraphPaymentsProxy, ProxyAdmin: GraphPaymentsProxyAdmin } = deployTransparentUpgradeableProxy(m, { + name: 'GraphPayments', + artifact: GraphPaymentsArtifact, + }) + m.call(Controller, 'setContractProxy', + [ethers.keccak256(ethers.toUtf8Bytes('GraphPayments')), GraphPaymentsProxy], + { id: 'setContractProxy_GraphPayments' }, + ) + + // Deploy and register PaymentsEscrow proxy + const { Proxy: PaymentsEscrowProxy, ProxyAdmin: PaymentsEscrowProxyAdmin } = deployTransparentUpgradeableProxy(m, { + name: 'PaymentsEscrow', + artifact: PaymentsEscrowArtifact, + }) + m.call(Controller, 'setContractProxy', + [ethers.keccak256(ethers.toUtf8Bytes('PaymentsEscrow')), PaymentsEscrowProxy], + { id: 'setContractProxy_PaymentsEscrow' }, + ) + + return { HorizonStakingProxy, GraphPaymentsProxy, PaymentsEscrowProxy, GraphPaymentsProxyAdmin, PaymentsEscrowProxyAdmin } +}) + +export const MigrateHorizonProxiesDeployerModule = buildModule('HorizonProxiesDeployer', (m) => { + // Deploy GraphPayments proxy + const { Proxy: GraphPaymentsProxy, ProxyAdmin: GraphPaymentsProxyAdmin } = deployTransparentUpgradeableProxy(m, { + name: 'GraphPayments', + artifact: GraphPaymentsArtifact, + }) + + // Deploy PaymentsEscrow proxy + const { Proxy: PaymentsEscrowProxy, ProxyAdmin: PaymentsEscrowProxyAdmin } = deployTransparentUpgradeableProxy(m, { + name: 'PaymentsEscrow', + artifact: PaymentsEscrowArtifact, + }) + + return { GraphPaymentsProxy, PaymentsEscrowProxy, GraphPaymentsProxyAdmin, PaymentsEscrowProxyAdmin } +}) + +export const MigrateHorizonProxiesGovernorModule = buildModule('HorizonProxiesGovernor', (m) => { + const { Controller } = m.useModule(MigrateControllerGovernorModule) + + const graphPaymentsAddress = m.getParameter('graphPaymentsAddress') + const paymentsEscrowAddress = m.getParameter('paymentsEscrowAddress') + + // Register proxies in controller + m.call(Controller, 'setContractProxy', + [ethers.keccak256(ethers.toUtf8Bytes('GraphPayments')), graphPaymentsAddress], + { id: 'setContractProxy_GraphPayments' }, + ) + + m.call(Controller, 'setContractProxy', + [ethers.keccak256(ethers.toUtf8Bytes('PaymentsEscrow')), paymentsEscrowAddress], + { id: 'setContractProxy_PaymentsEscrow' }, + ) + + return { } +}) diff --git a/packages/horizon/ignition/modules/core/HorizonStaking.ts b/packages/horizon/ignition/modules/core/HorizonStaking.ts new file mode 100644 index 000000000..c87208be2 --- /dev/null +++ b/packages/horizon/ignition/modules/core/HorizonStaking.ts @@ -0,0 +1,99 @@ +import { buildModule } from '@nomicfoundation/hardhat-ignition/modules' +import { deployImplementation } from '../proxy/implementation' +import { upgradeGraphProxy } from '../proxy/GraphProxy' + +import GraphPeripheryModule, { MigratePeripheryModule } from '../periphery/periphery' +import HorizonProxiesModule from './HorizonProxies' + +import ExponentialRebatesArtifact from '../../../build/contracts/contracts/staking/libraries/ExponentialRebates.sol/ExponentialRebates.json' +import GraphProxyAdminArtifact from '@graphprotocol/contracts/build/contracts/contracts/upgrades/GraphProxyAdmin.sol/GraphProxyAdmin.json' +import GraphProxyArtifact from '@graphprotocol/contracts/build/contracts/contracts/upgrades/GraphProxy.sol/GraphProxy.json' +import HorizonStakingArtifact from '../../../build/contracts/contracts/staking/HorizonStaking.sol/HorizonStaking.json' +import HorizonStakingExtensionArtifact from '../../../build/contracts/contracts/staking/HorizonStakingExtension.sol/HorizonStakingExtension.json' + +export default buildModule('HorizonStaking', (m) => { + const { Controller, GraphProxyAdmin } = m.useModule(GraphPeripheryModule) + const { HorizonStakingProxy } = m.useModule(HorizonProxiesModule) + + const subgraphServiceAddress = m.getParameter('subgraphServiceAddress') + const maxThawingPeriod = m.getParameter('maxThawingPeriod') + + // Deploy HorizonStakingExtension - requires periphery and proxies to be registered in the controller + const ExponentialRebates = m.library('ExponentialRebates', ExponentialRebatesArtifact) + const HorizonStakingExtension = m.contract('HorizonStakingExtension', + HorizonStakingExtensionArtifact, + [Controller, subgraphServiceAddress], { + libraries: { + ExponentialRebates: ExponentialRebates, + }, + after: [GraphPeripheryModule, HorizonProxiesModule], + }) + + // Deploy HorizonStaking implementation + const HorizonStakingImplementation = deployImplementation(m, { + name: 'HorizonStaking', + artifact: HorizonStakingArtifact, + constructorArgs: [Controller, HorizonStakingExtension, subgraphServiceAddress], + }) + + // Upgrade proxy to implementation contract + const HorizonStaking = upgradeGraphProxy(m, GraphProxyAdmin, HorizonStakingProxy, HorizonStakingImplementation, { + name: 'HorizonStaking', + artifact: HorizonStakingArtifact, + }) + m.call(HorizonStaking, 'setMaxThawingPeriod', [maxThawingPeriod]) + + return { HorizonStaking, HorizonStakingImplementation } +}) + +// Note that this module requires MigrateHorizonProxiesGovernorModule to be executed first +// The dependency is not made explicit to support the production workflow where the governor is a +// multisig owned by the Graph Council. +// For testnet, the dependency can be made explicit by having a parent module establish it. +export const MigrateHorizonStakingDeployerModule = buildModule('HorizonStakingDeployer', (m) => { + const { Controller } = m.useModule(MigratePeripheryModule) + + const subgraphServiceAddress = m.getParameter('subgraphServiceAddress') + const horizonStakingAddress = m.getParameter('horizonStakingAddress') + + const HorizonStakingProxy = m.contractAt('HorizonStakingProxy', GraphProxyArtifact, horizonStakingAddress) + + // Deploy HorizonStakingExtension - requires periphery and proxies to be registered in the controller + const ExponentialRebates = m.library('ExponentialRebates', ExponentialRebatesArtifact) + const HorizonStakingExtension = m.contract('HorizonStakingExtension', + HorizonStakingExtensionArtifact, + [Controller, subgraphServiceAddress], { + libraries: { + ExponentialRebates: ExponentialRebates, + }, + }) + + // Deploy HorizonStaking implementation + const HorizonStakingImplementation = deployImplementation(m, { + name: 'HorizonStaking', + artifact: HorizonStakingArtifact, + constructorArgs: [Controller, HorizonStakingExtension, subgraphServiceAddress], + }) + + return { HorizonStakingProxy, HorizonStakingImplementation } +}) + +export const MigrateHorizonStakingGovernorModule = buildModule('HorizonStakingGovernor', (m) => { + const maxThawingPeriod = m.getParameter('maxThawingPeriod') + const graphProxyAdminAddress = m.getParameter('graphProxyAdminAddress') + const horizonStakingAddress = m.getParameter('horizonStakingAddress') + const horizonStakingImplementationAddress = m.getParameter('horizonStakingImplementationAddress') + + const HorizonStakingImplementation = m.contractAt('HorizonStakingImplementation', HorizonStakingArtifact, horizonStakingImplementationAddress) + const HorizonStakingProxy = m.contractAt('HorizonStakingProxy', GraphProxyArtifact, horizonStakingAddress) + const GraphProxyAdmin = m.contractAt('GraphProxyAdmin', GraphProxyAdminArtifact, graphProxyAdminAddress) + + // Upgrade proxy to implementation contract + const HorizonStaking = upgradeGraphProxy(m, GraphProxyAdmin, HorizonStakingProxy, HorizonStakingImplementation, { + name: 'HorizonStaking', + artifact: HorizonStakingArtifact, + }) + m.call(HorizonStaking, 'setMaxThawingPeriod', [maxThawingPeriod]) + + return { HorizonStaking, HorizonStakingImplementation } +}) diff --git a/packages/horizon/ignition/modules/core/PaymentsEscrow.ts b/packages/horizon/ignition/modules/core/PaymentsEscrow.ts new file mode 100644 index 000000000..139d06b06 --- /dev/null +++ b/packages/horizon/ignition/modules/core/PaymentsEscrow.ts @@ -0,0 +1,70 @@ +import { buildModule } from '@nomicfoundation/hardhat-ignition/modules' +import { deployImplementation } from '../proxy/implementation' +import { upgradeTransparentUpgradeableProxy } from '../proxy/TransparentUpgradeableProxy' + +import GraphPeripheryModule, { MigratePeripheryModule } from '../periphery/periphery' +import HorizonProxiesModule, { MigrateHorizonProxiesDeployerModule } from './HorizonProxies' + +import PaymentsEscrowArtifact from '../../../build/contracts/contracts/payments/PaymentsEscrow.sol/PaymentsEscrow.json' + +export default buildModule('PaymentsEscrow', (m) => { + const { Controller } = m.useModule(GraphPeripheryModule) + const { PaymentsEscrowProxyAdmin, PaymentsEscrowProxy } = m.useModule(HorizonProxiesModule) + + const governor = m.getAccount(1) + const withdrawEscrowThawingPeriod = m.getParameter('withdrawEscrowThawingPeriod') + + // Deploy PaymentsEscrow implementation - requires periphery and proxies to be registered in the controller + const PaymentsEscrowImplementation = deployImplementation(m, { + name: 'PaymentsEscrow', + artifact: PaymentsEscrowArtifact, + constructorArgs: [Controller, withdrawEscrowThawingPeriod], + }, { after: [GraphPeripheryModule, HorizonProxiesModule] }) + + // Upgrade proxy to implementation contract + const PaymentsEscrow = upgradeTransparentUpgradeableProxy(m, + PaymentsEscrowProxyAdmin, + PaymentsEscrowProxy, + PaymentsEscrowImplementation, { + name: 'PaymentsEscrow', + artifact: PaymentsEscrowArtifact, + initArgs: [], + }) + + m.call(PaymentsEscrowProxyAdmin, 'transferOwnership', [governor], { after: [PaymentsEscrow] }) + + return { PaymentsEscrow, PaymentsEscrowProxyAdmin, PaymentsEscrowImplementation } +}) + +// Note that this module requires MigrateHorizonProxiesGovernorModule to be executed first +// The dependency is not made explicit to support the production workflow where the governor is a +// multisig owned by the Graph Council. +// For testnet, the dependency can be made explicit by having a parent module establish it. +export const MigratePaymentsEscrowModule = buildModule('PaymentsEscrow', (m) => { + const { PaymentsEscrowProxyAdmin, PaymentsEscrowProxy } = m.useModule(MigrateHorizonProxiesDeployerModule) + const { Controller } = m.useModule(MigratePeripheryModule) + + const governor = m.getParameter('governor') + const withdrawEscrowThawingPeriod = m.getParameter('withdrawEscrowThawingPeriod') + + // Deploy PaymentsEscrow implementation + const PaymentsEscrowImplementation = deployImplementation(m, { + name: 'PaymentsEscrow', + artifact: PaymentsEscrowArtifact, + constructorArgs: [Controller, withdrawEscrowThawingPeriod], + }) + + // Upgrade proxy to implementation contract + const PaymentsEscrow = upgradeTransparentUpgradeableProxy(m, + PaymentsEscrowProxyAdmin, + PaymentsEscrowProxy, + PaymentsEscrowImplementation, { + name: 'PaymentsEscrow', + artifact: PaymentsEscrowArtifact, + initArgs: [], + }) + + m.call(PaymentsEscrowProxyAdmin, 'transferOwnership', [governor], { after: [PaymentsEscrow] }) + + return { PaymentsEscrow, PaymentsEscrowProxyAdmin, PaymentsEscrowImplementation } +}) diff --git a/packages/horizon/ignition/modules/core/core.ts b/packages/horizon/ignition/modules/core/core.ts new file mode 100644 index 000000000..9d10c8619 --- /dev/null +++ b/packages/horizon/ignition/modules/core/core.ts @@ -0,0 +1,42 @@ +import { buildModule } from '@nomicfoundation/hardhat-ignition/modules' + +import GraphPaymentsModule, { MigrateGraphPaymentsModule } from './GraphPayments' +import GraphTallyCollectorModule, { MigrateGraphTallyCollectorModule } from './GraphTallyCollector' +import HorizonStakingModule, { MigrateHorizonStakingDeployerModule } from './HorizonStaking' +import PaymentsEscrowModule, { MigratePaymentsEscrowModule } from './PaymentsEscrow' + +export default buildModule('GraphHorizon_Core', (m) => { + const { HorizonStaking, HorizonStakingImplementation } = m.useModule(HorizonStakingModule) + const { GraphPaymentsProxyAdmin, GraphPayments, GraphPaymentsImplementation } = m.useModule(GraphPaymentsModule) + const { PaymentsEscrowProxyAdmin, PaymentsEscrow, PaymentsEscrowImplementation } = m.useModule(PaymentsEscrowModule) + const { GraphTallyCollector } = m.useModule(GraphTallyCollectorModule) + + return { + HorizonStaking, + HorizonStakingImplementation, + GraphPaymentsProxyAdmin, + GraphPayments, + GraphPaymentsImplementation, + PaymentsEscrowProxyAdmin, + PaymentsEscrow, + PaymentsEscrowImplementation, + GraphTallyCollector, + } +}) + +export const MigrateHorizonCoreModule = buildModule('GraphHorizon_Core', (m) => { + const { HorizonStakingProxy: HorizonStaking, HorizonStakingImplementation } = m.useModule(MigrateHorizonStakingDeployerModule) + const { GraphPayments, GraphPaymentsImplementation } = m.useModule(MigrateGraphPaymentsModule) + const { PaymentsEscrow, PaymentsEscrowImplementation } = m.useModule(MigratePaymentsEscrowModule) + const { GraphTallyCollector } = m.useModule(MigrateGraphTallyCollectorModule) + + return { + HorizonStaking, + HorizonStakingImplementation, + GraphPayments, + GraphPaymentsImplementation, + PaymentsEscrow, + PaymentsEscrowImplementation, + GraphTallyCollector, + } +}) diff --git a/packages/horizon/ignition/modules/deploy.ts b/packages/horizon/ignition/modules/deploy.ts new file mode 100644 index 000000000..1968f3878 --- /dev/null +++ b/packages/horizon/ignition/modules/deploy.ts @@ -0,0 +1,72 @@ +import { buildModule } from '@nomicfoundation/hardhat-ignition/modules' + +import GraphHorizonCoreModule from './core/core' +import GraphPeripheryModule from './periphery/periphery' + +export default buildModule('GraphHorizon_Deploy', (m) => { + const { + Controller, + EpochManager, + EpochManagerImplementation, + GraphProxyAdmin, + L2GraphTokenGateway, + L2GraphTokenGatewayImplementation, + L2GraphToken, + L2GraphTokenImplementation, + RewardsManager, + RewardsManagerImplementation, + L2Curation, + L2CurationImplementation, + L2GNS, + L2GNSImplementation, + SubgraphNFT, + } = m.useModule(GraphPeripheryModule) + const { + HorizonStaking, + HorizonStakingImplementation, + GraphPaymentsProxyAdmin, + GraphPayments, + GraphPaymentsImplementation, + PaymentsEscrowProxyAdmin, + PaymentsEscrow, + PaymentsEscrowImplementation, + GraphTallyCollector, + } = m.useModule(GraphHorizonCoreModule) + + const governor = m.getAccount(1) + + // BUG?: acceptOwnership should be called after everything in GraphHorizonCoreModule and GraphPeripheryModule is resolved + // but it seems that it's not waiting for interal calls. Waiting on HorizonStaking seems to fix the issue for some reason + // Removing HorizonStaking from the after list will trigger the bug + + // Accept ownership of Graph Governed based contracts + m.call(Controller, 'acceptOwnership', [], { from: governor, after: [GraphPeripheryModule, GraphHorizonCoreModule, HorizonStaking] }) + m.call(GraphProxyAdmin, 'acceptOwnership', [], { from: governor, after: [GraphPeripheryModule, GraphHorizonCoreModule, HorizonStaking] }) + + return { + Controller, + Graph_Proxy_EpochManager: EpochManager, + Implementation_EpochManager: EpochManagerImplementation, + Graph_Proxy_L2Curation: L2Curation, + Implementation_L2Curation: L2CurationImplementation, + Graph_Proxy_L2GNS: L2GNS, + Implementation_L2GNS: L2GNSImplementation, + SubgraphNFT, + Graph_Proxy_RewardsManager: RewardsManager, + Implementation_RewardsManager: RewardsManagerImplementation, + Graph_Proxy_L2GraphTokenGateway: L2GraphTokenGateway, + Implementation_L2GraphTokenGateway: L2GraphTokenGatewayImplementation, + Graph_Proxy_L2GraphToken: L2GraphToken, + Implementation_L2GraphToken: L2GraphTokenImplementation, + GraphProxyAdmin, + Graph_Proxy_HorizonStaking: HorizonStaking, + Implementation_HorizonStaking: HorizonStakingImplementation, + Transparent_ProxyAdmin_GraphPayments: GraphPaymentsProxyAdmin, + Transparent_Proxy_GraphPayments: GraphPayments, + Implementation_GraphPayments: GraphPaymentsImplementation, + Transparent_ProxyAdmin_PaymentsEscrow: PaymentsEscrowProxyAdmin, + Transparent_Proxy_PaymentsEscrow: PaymentsEscrow, + Implementation_PaymentsEscrow: PaymentsEscrowImplementation, + GraphTallyCollector, + } +}) diff --git a/packages/horizon/ignition/modules/migrate/migrate-1.ts b/packages/horizon/ignition/modules/migrate/migrate-1.ts new file mode 100644 index 000000000..9b7cab512 --- /dev/null +++ b/packages/horizon/ignition/modules/migrate/migrate-1.ts @@ -0,0 +1,19 @@ +import { buildModule } from '@nomicfoundation/hardhat-ignition/modules' + +import { MigrateHorizonProxiesDeployerModule } from '../core/HorizonProxies' + +export default buildModule('GraphHorizon_Migrate_1', (m) => { + const { + GraphPaymentsProxy, + PaymentsEscrowProxy, + GraphPaymentsProxyAdmin, + PaymentsEscrowProxyAdmin, + } = m.useModule(MigrateHorizonProxiesDeployerModule) + + return { + Transparent_Proxy_GraphPayments: GraphPaymentsProxy, + Transparent_Proxy_PaymentsEscrow: PaymentsEscrowProxy, + Transparent_ProxyAdmin_GraphPayments: GraphPaymentsProxyAdmin, + Transparent_ProxyAdmin_PaymentsEscrow: PaymentsEscrowProxyAdmin, + } +}) diff --git a/packages/horizon/ignition/modules/migrate/migrate-2.ts b/packages/horizon/ignition/modules/migrate/migrate-2.ts new file mode 100644 index 000000000..7b59217e4 --- /dev/null +++ b/packages/horizon/ignition/modules/migrate/migrate-2.ts @@ -0,0 +1,9 @@ +import { buildModule } from '@nomicfoundation/hardhat-ignition/modules' + +import { MigrateHorizonProxiesGovernorModule } from '../core/HorizonProxies' + +export default buildModule('GraphHorizon_Migrate_2', (m) => { + m.useModule(MigrateHorizonProxiesGovernorModule) + + return {} +}) diff --git a/packages/horizon/ignition/modules/migrate/migrate-3.ts b/packages/horizon/ignition/modules/migrate/migrate-3.ts new file mode 100644 index 000000000..94e1ac5b0 --- /dev/null +++ b/packages/horizon/ignition/modules/migrate/migrate-3.ts @@ -0,0 +1,53 @@ +import { buildModule } from '@nomicfoundation/hardhat-ignition/modules' + +import { MigrateHorizonCoreModule } from '../core/core' +import { MigratePeripheryModule } from '../periphery/periphery' + +export default buildModule('GraphHorizon_Migrate_3', (m) => { + const { + L2Curation, + L2CurationImplementation, + RewardsManager, + RewardsManagerImplementation, + Controller, + GraphProxyAdmin, + EpochManager, + L2GraphToken, + L2GraphTokenGateway, + L2GNS, + L2GNSImplementation, + SubgraphNFT, + } = m.useModule(MigratePeripheryModule) + + const { + HorizonStaking, + HorizonStakingImplementation, + GraphPayments, + GraphPaymentsImplementation, + PaymentsEscrow, + PaymentsEscrowImplementation, + GraphTallyCollector, + } = m.useModule(MigrateHorizonCoreModule) + + return { + Graph_Proxy_L2Curation: L2Curation, + Implementation_L2Curation: L2CurationImplementation, + Graph_Proxy_L2GNS: L2GNS, + Implementation_L2GNS: L2GNSImplementation, + SubgraphNFT, + Graph_Proxy_RewardsManager: RewardsManager, + Implementation_RewardsManager: RewardsManagerImplementation, + Graph_Proxy_HorizonStaking: HorizonStaking, + Implementation_HorizonStaking: HorizonStakingImplementation, + Transparent_Proxy_GraphPayments: GraphPayments, + Implementation_GraphPayments: GraphPaymentsImplementation, + Transparent_Proxy_PaymentsEscrow: PaymentsEscrow, + Implementation_PaymentsEscrow: PaymentsEscrowImplementation, + GraphTallyCollector, + Controller: Controller, + GraphProxyAdmin, + Graph_Proxy_EpochManager: EpochManager, + Graph_Proxy_L2GraphToken: L2GraphToken, + Graph_Proxy_L2GraphTokenGateway: L2GraphTokenGateway, + } +}) diff --git a/packages/horizon/ignition/modules/migrate/migrate-4.ts b/packages/horizon/ignition/modules/migrate/migrate-4.ts new file mode 100644 index 000000000..9290cc753 --- /dev/null +++ b/packages/horizon/ignition/modules/migrate/migrate-4.ts @@ -0,0 +1,31 @@ +import { buildModule } from '@nomicfoundation/hardhat-ignition/modules' + +import { MigrateCurationGovernorModule } from '../periphery/Curation' +import { MigrateHorizonStakingGovernorModule } from '../core/HorizonStaking' +import { MigrateRewardsManagerGovernorModule } from '../periphery/RewardsManager' + +export default buildModule('GraphHorizon_Migrate_4', (m) => { + const { + L2Curation, + L2CurationImplementation, + } = m.useModule(MigrateCurationGovernorModule) + + const { + RewardsManager, + RewardsManagerImplementation, + } = m.useModule(MigrateRewardsManagerGovernorModule) + + const { + HorizonStaking, + HorizonStakingImplementation, + } = m.useModule(MigrateHorizonStakingGovernorModule) + + return { + Graph_Proxy_L2Curation: L2Curation, + Implementation_L2Curation: L2CurationImplementation, + Graph_Proxy_RewardsManager: RewardsManager, + Implementation_RewardsManager: RewardsManagerImplementation, + Graph_Proxy_HorizonStaking: HorizonStaking, + Implementation_HorizonStaking: HorizonStakingImplementation, + } +}) diff --git a/packages/horizon/ignition/modules/periphery/Controller.ts b/packages/horizon/ignition/modules/periphery/Controller.ts new file mode 100644 index 000000000..8e8e130d7 --- /dev/null +++ b/packages/horizon/ignition/modules/periphery/Controller.ts @@ -0,0 +1,39 @@ +/* eslint-disable no-secrets/no-secrets */ +import { buildModule } from '@nomicfoundation/hardhat-ignition/modules' +import { ethers } from 'ethers' + +import ControllerArtifact from '@graphprotocol/contracts/build/contracts/contracts/governance/Controller.sol/Controller.json' + +export default buildModule('Controller', (m) => { + const governor = m.getAccount(1) + const pauseGuardian = m.getParameter('pauseGuardian') + + const Controller = m.contract('Controller', ControllerArtifact) + m.call(Controller, 'setPauseGuardian', [pauseGuardian]) + m.call(Controller, 'setPaused', [false]) + m.call(Controller, 'transferOwnership', [governor]) + + return { Controller } +}) + +export const MigrateControllerDeployerModule = buildModule('ControllerDeployer', (m) => { + const controllerAddress = m.getParameter('controllerAddress') + + const Controller = m.contractAt('Controller', ControllerArtifact, controllerAddress) + + return { Controller } +}) + +export const MigrateControllerGovernorModule = buildModule('ControllerGovernor', (m) => { + const { Controller } = m.useModule(MigrateControllerDeployerModule) + + const graphProxyAdminAddress = m.getParameter('graphProxyAdminAddress') + + // GraphProxyAdmin was not registered in the controller in the original protocol + m.call(Controller, 'setContractProxy', + [ethers.keccak256(ethers.toUtf8Bytes('GraphProxyAdmin')), graphProxyAdminAddress], + { id: 'setContractProxy_GraphProxyAdmin' }, + ) + + return { Controller } +}) diff --git a/packages/horizon/ignition/modules/periphery/Curation.ts b/packages/horizon/ignition/modules/periphery/Curation.ts new file mode 100644 index 000000000..1625dc2f1 --- /dev/null +++ b/packages/horizon/ignition/modules/periphery/Curation.ts @@ -0,0 +1,69 @@ +import { buildModule, IgnitionModuleBuilder } from '@nomicfoundation/ignition-core' +import { deployWithGraphProxy, upgradeGraphProxy } from '../proxy/GraphProxy' +import { deployImplementation } from '../proxy/implementation' + +import ControllerModule from './Controller' +import GraphProxyAdminModule from './GraphProxyAdmin' + +import CurationArtifact from '@graphprotocol/contracts/build/contracts/contracts/l2/curation/L2Curation.sol/L2Curation.json' +import GraphCurationTokenArtifact from '@graphprotocol/contracts/build/contracts/contracts/curation/GraphCurationToken.sol/GraphCurationToken.json' +import GraphProxyAdminArtifact from '@graphprotocol/contracts/build/contracts/contracts/upgrades/GraphProxyAdmin.sol/GraphProxyAdmin.json' +import GraphProxyArtifact from '@graphprotocol/contracts/build/contracts/contracts/upgrades/GraphProxy.sol/GraphProxy.json' + +// Curation deployment should be managed by ignition scripts in subgraph-service package however +// due to tight coupling with Controller it's easier to do it on the horizon package. + +export default buildModule('L2Curation', (m) => { + const { Controller } = m.useModule(ControllerModule) + const { GraphProxyAdmin } = m.useModule(GraphProxyAdminModule) + + const curationTaxPercentage = m.getParameter('curationTaxPercentage') + const minimumCurationDeposit = m.getParameter('minimumCurationDeposit') + const subgraphServiceAddress = m.getParameter('subgraphServiceAddress') + + const GraphCurationToken = m.contract('GraphCurationToken', GraphCurationTokenArtifact, []) + + const { proxy: L2Curation, implementation: L2CurationImplementation } = deployWithGraphProxy(m, GraphProxyAdmin, { + name: 'L2Curation', + artifact: CurationArtifact, + initArgs: [Controller, GraphCurationToken, curationTaxPercentage, minimumCurationDeposit], + }) + m.call(L2Curation, 'setSubgraphService', [subgraphServiceAddress]) + + return { L2Curation, L2CurationImplementation } +}) + +export const MigrateCurationDeployerModule = buildModule('L2CurationDeployer', (m: IgnitionModuleBuilder) => { + const curationAddress = m.getParameter('curationAddress') + + const L2CurationProxy = m.contractAt('L2CurationProxy', GraphProxyArtifact, curationAddress) + + const implementationMetadata = { + name: 'L2Curation', + artifact: CurationArtifact, + } + const L2CurationImplementation = deployImplementation(m, implementationMetadata) + + return { L2CurationProxy, L2CurationImplementation } +}) + +export const MigrateCurationGovernorModule = buildModule('L2CurationGovernor', (m: IgnitionModuleBuilder) => { + const curationAddress = m.getParameter('curationAddress') + const curationImplementationAddress = m.getParameter('curationImplementationAddress') + const subgraphServiceAddress = m.getParameter('subgraphServiceAddress') + const graphProxyAdminAddress = m.getParameter('graphProxyAdminAddress') + + const GraphProxyAdmin = m.contractAt('GraphProxyAdmin', GraphProxyAdminArtifact, graphProxyAdminAddress) + const L2CurationProxy = m.contractAt('L2CurationProxy', GraphProxyArtifact, curationAddress) + const L2CurationImplementation = m.contractAt('L2CurationImplementation', CurationArtifact, curationImplementationAddress) + + const implementationMetadata = { + name: 'L2Curation', + artifact: CurationArtifact, + } + + const L2Curation = upgradeGraphProxy(m, GraphProxyAdmin, L2CurationProxy, L2CurationImplementation, implementationMetadata) + m.call(L2Curation, 'setSubgraphService', [subgraphServiceAddress]) + + return { L2Curation, L2CurationImplementation } +}) diff --git a/packages/horizon/ignition/modules/periphery/EpochManager.ts b/packages/horizon/ignition/modules/periphery/EpochManager.ts new file mode 100644 index 000000000..a7e08bf22 --- /dev/null +++ b/packages/horizon/ignition/modules/periphery/EpochManager.ts @@ -0,0 +1,30 @@ +import { buildModule } from '@nomicfoundation/hardhat-ignition/modules' +import { deployWithGraphProxy } from '../proxy/GraphProxy' + +import ControllerModule from './Controller' +import GraphProxyAdminModule from './GraphProxyAdmin' + +import EpochManagerArtifact from '@graphprotocol/contracts/build/contracts/contracts/epochs/EpochManager.sol/EpochManager.json' + +export default buildModule('EpochManager', (m) => { + const { Controller } = m.useModule(ControllerModule) + const { GraphProxyAdmin } = m.useModule(GraphProxyAdminModule) + + const epochLength = m.getParameter('epochLength') + + const { proxy: EpochManager, implementation: EpochManagerImplementation } = deployWithGraphProxy(m, GraphProxyAdmin, { + name: 'EpochManager', + artifact: EpochManagerArtifact, + initArgs: [Controller, epochLength], + }) + + return { EpochManager, EpochManagerImplementation } +}) + +export const MigrateEpochManagerModule = buildModule('EpochManager', (m) => { + const epochManagerAddress = m.getParameter('epochManagerAddress') + + const EpochManager = m.contractAt('EpochManager', EpochManagerArtifact, epochManagerAddress) + + return { EpochManager } +}) diff --git a/packages/horizon/ignition/modules/periphery/GNS.ts b/packages/horizon/ignition/modules/periphery/GNS.ts new file mode 100644 index 000000000..acc2cf59e --- /dev/null +++ b/packages/horizon/ignition/modules/periphery/GNS.ts @@ -0,0 +1,55 @@ +import { buildModule } from '@nomicfoundation/hardhat-ignition/modules' +import { deployWithGraphProxy } from '../proxy/GraphProxy' + +import ControllerModule from './Controller' +import CurationModule from './Curation' +import GraphProxyAdminModule from './GraphProxyAdmin' +import GraphTokenModule from './GraphToken' + +import L2GNSArtifact from '@graphprotocol/contracts/build/contracts/contracts/l2/discovery/L2GNS.sol/L2GNS.json' +import SubgraphNFTArtifact from '@graphprotocol/contracts/build/contracts/contracts/discovery/SubgraphNFT.sol/SubgraphNFT.json' +import SubgraphNFTDescriptorArtifact from '@graphprotocol/contracts/build/contracts/contracts/discovery/SubgraphNFTDescriptor.sol/SubgraphNFTDescriptor.json' + +// GNS deployment should be managed by ignition scripts in subgraph-service package however +// due to tight coupling with Controller it's easier to do it on the horizon package. + +export default buildModule('L2GNS', (m) => { + const { Controller } = m.useModule(ControllerModule) + const { GraphProxyAdmin } = m.useModule(GraphProxyAdminModule) + const { L2GraphToken } = m.useModule(GraphTokenModule) + const { L2Curation } = m.useModule(CurationModule) + + const deployer = m.getAccount(0) + const governor = m.getAccount(1) + + const SubgraphNFTDescriptor = m.contract('SubgraphNFTDescriptor', SubgraphNFTDescriptorArtifact) + const SubgraphNFT = m.contract('SubgraphNFT', SubgraphNFTArtifact, [deployer]) + + m.call(SubgraphNFT, 'setTokenDescriptor', [SubgraphNFTDescriptor]) + + const { proxy: L2GNS, implementation: L2GNSImplementation } = deployWithGraphProxy(m, GraphProxyAdmin, { + name: 'L2GNS', + artifact: L2GNSArtifact, + initArgs: [Controller, SubgraphNFT], + }) + m.call(L2GNS, 'approveAll', [], { after: [L2GraphToken, L2Curation] }) + + const setMinterCall = m.call(SubgraphNFT, 'setMinter', [L2GNS]) + m.call(SubgraphNFT, 'transferOwnership', [governor], { after: [setMinterCall] }) + + return { L2GNS, L2GNSImplementation, SubgraphNFT } +}) + +// L2GNS and SubgraphNFT are already deployed and are not being upgraded +// This is a no-op to get the addresses into the address book +export const MigrateL2GNSModule = buildModule('L2GNS', (m) => { + const gnsProxyAddress = m.getParameter('gnsAddress') + const gnsImplementationAddress = m.getParameter('gnsImplementationAddress') + const subgraphNFTAddress = m.getParameter('subgraphNFTAddress') + + const SubgraphNFT = m.contractAt('SubgraphNFT', SubgraphNFTArtifact, subgraphNFTAddress) + const L2GNS = m.contractAt('L2GNS', L2GNSArtifact, gnsProxyAddress) + const L2GNSImplementation = m.contractAt('L2GNSAddressBook', L2GNSArtifact, gnsImplementationAddress) + + return { L2GNS, L2GNSImplementation, SubgraphNFT } +}) diff --git a/packages/horizon/ignition/modules/periphery/GraphProxyAdmin.ts b/packages/horizon/ignition/modules/periphery/GraphProxyAdmin.ts new file mode 100644 index 000000000..c727620c2 --- /dev/null +++ b/packages/horizon/ignition/modules/periphery/GraphProxyAdmin.ts @@ -0,0 +1,20 @@ +import { buildModule } from '@nomicfoundation/hardhat-ignition/modules' + +import GraphProxyAdminArtifact from '@graphprotocol/contracts/build/contracts/contracts/upgrades/GraphProxyAdmin.sol/GraphProxyAdmin.json' + +export default buildModule('GraphProxyAdmin', (m) => { + const governor = m.getAccount(1) + + const GraphProxyAdmin = m.contract('GraphProxyAdmin', GraphProxyAdminArtifact) + m.call(GraphProxyAdmin, 'transferOwnership', [governor]) + + return { GraphProxyAdmin } +}) + +export const MigrateGraphProxyAdminModule = buildModule('GraphProxyAdmin', (m) => { + const graphProxyAdminAddress = m.getParameter('graphProxyAdminAddress') + + const GraphProxyAdmin = m.contractAt('GraphProxyAdmin', GraphProxyAdminArtifact, graphProxyAdminAddress) + + return { GraphProxyAdmin } +}) diff --git a/packages/horizon/ignition/modules/periphery/GraphToken.ts b/packages/horizon/ignition/modules/periphery/GraphToken.ts new file mode 100644 index 000000000..dd8c1a129 --- /dev/null +++ b/packages/horizon/ignition/modules/periphery/GraphToken.ts @@ -0,0 +1,43 @@ +import { buildModule } from '@nomicfoundation/hardhat-ignition/modules' +import { deployWithGraphProxy } from '../proxy/GraphProxy' + +import GraphProxyAdminModule from '../periphery/GraphProxyAdmin' +import GraphTokenGatewayModule from '../periphery/GraphTokenGateway' +import RewardsManagerModule from '../periphery/RewardsManager' + +import GraphTokenArtifact from '@graphprotocol/contracts/build/contracts/contracts/l2/token/L2GraphToken.sol/L2GraphToken.json' + +export default buildModule('L2GraphToken', (m) => { + const { GraphProxyAdmin } = m.useModule(GraphProxyAdminModule) + const { RewardsManager } = m.useModule(RewardsManagerModule) + const { L2GraphTokenGateway } = m.useModule(GraphTokenGatewayModule) + + const deployer = m.getAccount(0) + const governor = m.getAccount(1) + const initialSupply = m.getParameter('initialSupply') + + const { proxy: L2GraphToken, implementation: L2GraphTokenImplementation } = deployWithGraphProxy(m, GraphProxyAdmin, { + name: 'L2GraphToken', + artifact: GraphTokenArtifact, + initArgs: [deployer], + }) + + const mintCall = m.call(L2GraphToken, 'mint', [deployer, initialSupply]) + const renounceMinterCall = m.call(L2GraphToken, 'renounceMinter', []) + const addMinterRewardsManagerCall = m.call(L2GraphToken, 'addMinter', [RewardsManager], { id: 'addMinterRewardsManager' }) + const addMinterGatewayCall = m.call(L2GraphToken, 'addMinter', [L2GraphTokenGateway], { id: 'addMinterGateway' }) + + // No further calls are needed so we can transfer ownership now + const transferOwnershipCall = m.call(L2GraphToken, 'transferOwnership', [governor], { after: [mintCall, renounceMinterCall, addMinterRewardsManagerCall, addMinterGatewayCall] }) + m.call(L2GraphToken, 'acceptOwnership', [], { from: governor, after: [transferOwnershipCall] }) + + return { L2GraphToken, L2GraphTokenImplementation } +}) + +export const MigrateGraphTokenModule = buildModule('L2GraphToken', (m) => { + const graphTokenAddress = m.getParameter('graphTokenAddress') + + const L2GraphToken = m.contractAt('L2GraphToken', GraphTokenArtifact, graphTokenAddress) + + return { L2GraphToken } +}) diff --git a/packages/horizon/ignition/modules/periphery/GraphTokenGateway.ts b/packages/horizon/ignition/modules/periphery/GraphTokenGateway.ts new file mode 100644 index 000000000..fc679e8ad --- /dev/null +++ b/packages/horizon/ignition/modules/periphery/GraphTokenGateway.ts @@ -0,0 +1,32 @@ +import { buildModule } from '@nomicfoundation/ignition-core' + +import { deployWithGraphProxy } from '../proxy/GraphProxy' + +import ControllerModule from '../periphery/Controller' +import GraphProxyAdminModule from '../periphery/GraphProxyAdmin' + +import GraphTokenGatewayArtifact from '@graphprotocol/contracts/build/contracts/contracts/l2/gateway/L2GraphTokenGateway.sol/L2GraphTokenGateway.json' + +export default buildModule('L2GraphTokenGateway', (m) => { + const { Controller } = m.useModule(ControllerModule) + const { GraphProxyAdmin } = m.useModule(GraphProxyAdminModule) + + const pauseGuardian = m.getParameter('pauseGuardian') + + const { proxy: L2GraphTokenGateway, implementation: L2GraphTokenGatewayImplementation } = deployWithGraphProxy(m, GraphProxyAdmin, { + name: 'L2GraphTokenGateway', + artifact: GraphTokenGatewayArtifact, + initArgs: [Controller], + }) + m.call(L2GraphTokenGateway, 'setPauseGuardian', [pauseGuardian]) + + return { L2GraphTokenGateway, L2GraphTokenGatewayImplementation } +}) + +export const MigrateGraphTokenGatewayModule = buildModule('L2GraphTokenGateway', (m) => { + const graphTokenGatewayAddress = m.getParameter('graphTokenGatewayAddress') + + const L2GraphTokenGateway = m.contractAt('L2GraphTokenGateway', GraphTokenGatewayArtifact, graphTokenGatewayAddress) + + return { L2GraphTokenGateway } +}) diff --git a/packages/horizon/ignition/modules/periphery/RewardsManager.ts b/packages/horizon/ignition/modules/periphery/RewardsManager.ts new file mode 100644 index 000000000..c1dc8e285 --- /dev/null +++ b/packages/horizon/ignition/modules/periphery/RewardsManager.ts @@ -0,0 +1,66 @@ +import { buildModule, IgnitionModuleBuilder } from '@nomicfoundation/ignition-core' +import { deployWithGraphProxy, upgradeGraphProxy } from '../proxy/GraphProxy' +import { deployImplementation } from '../proxy/implementation' + +import ControllerModule from './Controller' +import GraphProxyAdminModule from './GraphProxyAdmin' + +import GraphProxyAdminArtifact from '@graphprotocol/contracts/build/contracts/contracts/upgrades/GraphProxyAdmin.sol/GraphProxyAdmin.json' +import GraphProxyArtifact from '@graphprotocol/contracts/build/contracts/contracts/upgrades/GraphProxy.sol/GraphProxy.json' +import RewardsManagerArtifact from '@graphprotocol/contracts/build/contracts/contracts/rewards/RewardsManager.sol/RewardsManager.json' + +export default buildModule('RewardsManager', (m) => { + const { Controller } = m.useModule(ControllerModule) + const { GraphProxyAdmin } = m.useModule(GraphProxyAdminModule) + + const issuancePerBlock = m.getParameter('issuancePerBlock') + const subgraphAvailabilityOracle = m.getParameter('subgraphAvailabilityOracle') + const subgraphServiceAddress = m.getParameter('subgraphServiceAddress') + + const { proxy: RewardsManager, implementation: RewardsManagerImplementation } = deployWithGraphProxy(m, GraphProxyAdmin, { + name: 'RewardsManager', + artifact: RewardsManagerArtifact, + initArgs: [Controller], + }) + m.call(RewardsManager, 'setSubgraphAvailabilityOracle', [subgraphAvailabilityOracle]) + m.call(RewardsManager, 'setIssuancePerBlock', [issuancePerBlock]) + m.call(RewardsManager, 'setSubgraphService', [subgraphServiceAddress]) + + return { RewardsManager, RewardsManagerImplementation } +}) + +export const MigrateRewardsManagerDeployerModule = buildModule('RewardsManagerDeployer', (m: IgnitionModuleBuilder) => { + const rewardsManagerAddress = m.getParameter('rewardsManagerAddress') + + const RewardsManagerProxy = m.contractAt('RewardsManagerProxy', GraphProxyArtifact, rewardsManagerAddress) + + const implementationMetadata = { + name: 'RewardsManager', + artifact: RewardsManagerArtifact, + } + const RewardsManagerImplementation = deployImplementation(m, implementationMetadata) + + return { RewardsManagerProxy, RewardsManagerImplementation } +}) + +export const MigrateRewardsManagerGovernorModule = buildModule('RewardsManagerGovernor', (m: IgnitionModuleBuilder) => { + const rewardsManagerAddress = m.getParameter('rewardsManagerAddress') + const rewardsManagerImplementationAddress = m.getParameter('rewardsManagerImplementationAddress') + const graphProxyAdminAddress = m.getParameter('graphProxyAdminAddress') + + const GraphProxyAdmin = m.contractAt('GraphProxyAdmin', GraphProxyAdminArtifact, graphProxyAdminAddress) + const RewardsManagerProxy = m.contractAt('RewardsManagerProxy', GraphProxyArtifact, rewardsManagerAddress) + const RewardsManagerImplementation = m.contractAt('RewardsManagerImplementation', RewardsManagerArtifact, rewardsManagerImplementationAddress) + + const subgraphServiceAddress = m.getParameter('subgraphServiceAddress') + + const implementationMetadata = { + name: 'RewardsManager', + artifact: RewardsManagerArtifact, + } + + const RewardsManager = upgradeGraphProxy(m, GraphProxyAdmin, RewardsManagerProxy, RewardsManagerImplementation, implementationMetadata) + m.call(RewardsManager, 'setSubgraphService', [subgraphServiceAddress]) + + return { RewardsManager, RewardsManagerImplementation } +}) diff --git a/packages/horizon/ignition/modules/periphery/periphery.ts b/packages/horizon/ignition/modules/periphery/periphery.ts new file mode 100644 index 000000000..e6c7daa89 --- /dev/null +++ b/packages/horizon/ignition/modules/periphery/periphery.ts @@ -0,0 +1,77 @@ +/* eslint-disable no-secrets/no-secrets */ +import { buildModule } from '@nomicfoundation/hardhat-ignition/modules' +import { ethers } from 'ethers' + +import ControllerModule, { MigrateControllerDeployerModule } from './Controller' +import CurationModule, { MigrateCurationDeployerModule } from './Curation' +import EpochManagerModule, { MigrateEpochManagerModule } from './EpochManager' +import GNSModule, { MigrateL2GNSModule } from './GNS' +import GraphProxyAdminModule, { MigrateGraphProxyAdminModule } from './GraphProxyAdmin' +import GraphTokenGatewayModule, { MigrateGraphTokenGatewayModule } from './GraphTokenGateway' +import GraphTokenModule, { MigrateGraphTokenModule } from './GraphToken' +import RewardsManagerModule, { MigrateRewardsManagerDeployerModule } from './RewardsManager' + +export default buildModule('GraphHorizon_Periphery', (m) => { + const { Controller } = m.useModule(ControllerModule) + const { GraphProxyAdmin } = m.useModule(GraphProxyAdminModule) + + const { EpochManager, EpochManagerImplementation } = m.useModule(EpochManagerModule) + const { L2Curation, L2CurationImplementation } = m.useModule(CurationModule) + const { L2GNS, L2GNSImplementation, SubgraphNFT } = m.useModule(GNSModule) + const { RewardsManager, RewardsManagerImplementation } = m.useModule(RewardsManagerModule) + const { L2GraphTokenGateway, L2GraphTokenGatewayImplementation } = m.useModule(GraphTokenGatewayModule) + const { L2GraphToken, L2GraphTokenImplementation } = m.useModule(GraphTokenModule) + + m.call(Controller, 'setContractProxy', [ethers.keccak256(ethers.toUtf8Bytes('EpochManager')), EpochManager], { id: 'setContractProxy_EpochManager' }) + m.call(Controller, 'setContractProxy', [ethers.keccak256(ethers.toUtf8Bytes('RewardsManager')), RewardsManager], { id: 'setContractProxy_RewardsManager' }) + m.call(Controller, 'setContractProxy', [ethers.keccak256(ethers.toUtf8Bytes('GraphToken')), L2GraphToken], { id: 'setContractProxy_GraphToken' }) + m.call(Controller, 'setContractProxy', [ethers.keccak256(ethers.toUtf8Bytes('GraphTokenGateway')), L2GraphTokenGateway], { id: 'setContractProxy_GraphTokenGateway' }) + m.call(Controller, 'setContractProxy', [ethers.keccak256(ethers.toUtf8Bytes('GraphProxyAdmin')), GraphProxyAdmin], { id: 'setContractProxy_GraphProxyAdmin' }) + m.call(Controller, 'setContractProxy', [ethers.keccak256(ethers.toUtf8Bytes('Curation')), L2Curation], { id: 'setContractProxy_L2Curation' }) + m.call(Controller, 'setContractProxy', [ethers.keccak256(ethers.toUtf8Bytes('GNS')), L2GNS], { id: 'setContractProxy_L2GNS' }) + + return { + Controller, + EpochManager, + EpochManagerImplementation, + L2Curation, + L2CurationImplementation, + L2GNS, + L2GNSImplementation, + SubgraphNFT, + GraphProxyAdmin, + L2GraphToken, + L2GraphTokenImplementation, + L2GraphTokenGateway, + L2GraphTokenGatewayImplementation, + RewardsManager, + RewardsManagerImplementation, + } +}) + +export const MigratePeripheryModule = buildModule('GraphHorizon_Periphery', (m) => { + const { L2CurationProxy: L2Curation, L2CurationImplementation } = m.useModule(MigrateCurationDeployerModule) + const { L2GNS, L2GNSImplementation, SubgraphNFT } = m.useModule(MigrateL2GNSModule) + const { RewardsManagerProxy: RewardsManager, RewardsManagerImplementation } = m.useModule(MigrateRewardsManagerDeployerModule) + const { Controller } = m.useModule(MigrateControllerDeployerModule) + const { GraphProxyAdmin } = m.useModule(MigrateGraphProxyAdminModule) + const { EpochManager } = m.useModule(MigrateEpochManagerModule) + const { L2GraphToken } = m.useModule(MigrateGraphTokenModule) + const { L2GraphTokenGateway } = m.useModule(MigrateGraphTokenGatewayModule) + + // Load these contracts so they are available in the address book + return { + Controller, + EpochManager, + L2Curation, + L2CurationImplementation, + L2GNS, + L2GNSImplementation, + SubgraphNFT, + GraphProxyAdmin, + L2GraphToken, + L2GraphTokenGateway, + RewardsManager, + RewardsManagerImplementation, + } +}) diff --git a/packages/horizon/ignition/modules/proxy/GraphProxy.ts b/packages/horizon/ignition/modules/proxy/GraphProxy.ts new file mode 100644 index 000000000..efc6fe4ef --- /dev/null +++ b/packages/horizon/ignition/modules/proxy/GraphProxy.ts @@ -0,0 +1,77 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ +import { + CallableContractFuture, + ContractFuture, + ContractOptions, + IgnitionModuleBuilder, +} from '@nomicfoundation/ignition-core' + +import { deployImplementation, type ImplementationMetadata } from './implementation' +import { loadProxyWithABI } from './utils' + +import GraphProxyArtifact from '@graphprotocol/contracts/build/contracts/contracts/upgrades/GraphProxy.sol/GraphProxy.json' + +export function deployGraphProxy( + m: IgnitionModuleBuilder, + proxyAdmin: ContractFuture, + implementation?: ContractFuture, + metadata?: ImplementationMetadata, + options?: ContractOptions, +) { + if (implementation === undefined || metadata === undefined) { + const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000' + return m.contract('GraphProxy', GraphProxyArtifact, [ZERO_ADDRESS, proxyAdmin], options) + } else { + const GraphProxy = m.contract('GraphProxy', GraphProxyArtifact, [implementation, proxyAdmin], options) + return loadProxyWithABI(m, GraphProxy, metadata, options) + } +} + +export function upgradeGraphProxy( + m: IgnitionModuleBuilder, + proxyAdmin: CallableContractFuture, + proxy: CallableContractFuture, + implementation: ContractFuture, + metadata: ImplementationMetadata, + options?: ContractOptions, +) { + const upgradeCall = m.call(proxyAdmin, 'upgrade', [proxy, implementation], options) + const acceptCall = m.call(proxyAdmin, 'acceptProxy', [implementation, proxy], { ...options, after: [upgradeCall] }) + + return loadProxyWithABI(m, proxy, metadata, { ...options, after: [acceptCall] }) +} + +export function acceptUpgradeGraphProxy( + m: IgnitionModuleBuilder, + proxyAdmin: CallableContractFuture, + proxy: CallableContractFuture, + implementation: ContractFuture, + metadata: ImplementationMetadata, + options?: ContractOptions, +) { + const acceptCall = m.call(proxyAdmin, 'acceptProxy', [implementation, proxy], { ...options }) + + return loadProxyWithABI(m, proxy, metadata, { ...options, after: [acceptCall] }) +} + +export function deployWithGraphProxy( + m: IgnitionModuleBuilder, + proxyAdmin: CallableContractFuture, + metadata: ImplementationMetadata, + options?: ContractOptions, +) { + options = options || {} + + // Deploy implementation + const implementation = deployImplementation(m, metadata, options) + + // Deploy proxy and initialize + const proxy = deployGraphProxy(m, proxyAdmin, implementation, metadata, options) + if (metadata.initArgs === undefined) { + m.call(proxyAdmin, 'acceptProxy', [implementation, proxy], options) + } else { + m.call(proxyAdmin, 'acceptProxyAndCall', [implementation, proxy, m.encodeFunctionCall(implementation, 'initialize', metadata.initArgs)], options) + } + + return { proxy, implementation } +} diff --git a/packages/horizon/ignition/modules/proxy/TransparentUpgradeableProxy.ts b/packages/horizon/ignition/modules/proxy/TransparentUpgradeableProxy.ts new file mode 100644 index 000000000..371b06eb5 --- /dev/null +++ b/packages/horizon/ignition/modules/proxy/TransparentUpgradeableProxy.ts @@ -0,0 +1,61 @@ +import { CallableContractFuture, ContractFuture, ContractOptions, IgnitionModuleBuilder } from '@nomicfoundation/ignition-core' +import { ImplementationMetadata } from './implementation' +import { loadProxyWithABI } from './utils' + +// Importing artifacts from build directory so we have all build artifacts for contract verification +import DummyArtifact from '../../../build/contracts/contracts/mocks/Dummy.sol/Dummy.json' +import ProxyAdminArtifact from '../../../build/contracts/@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol/ProxyAdmin.json' +import TransparentUpgradeableProxyArtifact from '../../../build/contracts/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/TransparentUpgradeableProxy.json' + +// Deploy a TransparentUpgradeableProxy +// The TransparentUpgradeableProxy contract creates the ProxyAdmin within its constructor. +export function deployTransparentUpgradeableProxy( + m: IgnitionModuleBuilder, + metadata: ImplementationMetadata, + implementation?: ContractFuture, + options?: ContractOptions, +) { + const deployer = m.getAccount(0) + + // The proxy requires a valid contract as initial implementation so we use a dummy + if (implementation === undefined) { + implementation = m.contract('Dummy', DummyArtifact, [], { ...options, id: `OZProxyDummy_${metadata.name}` }) + } + + const Proxy = m.contract('TransparentUpgradeableProxy', TransparentUpgradeableProxyArtifact, [ + implementation, + deployer, + '0x', + ], + { ...options, id: `TransparentUpgradeableProxy_${metadata.name}` }) + + const proxyAdminAddress = m.readEventArgument( + Proxy, + 'AdminChanged', + 'newAdmin', + { ...options, id: `TransparentUpgradeableProxy_${metadata.name}_AdminChanged` }, + ) + + const ProxyAdmin = m.contractAt('ProxyAdmin', ProxyAdminArtifact, proxyAdminAddress, { ...options, id: `ProxyAdmin_${metadata.name}` }) + + if (implementation !== undefined) { + return { ProxyAdmin, Proxy: loadProxyWithABI(m, Proxy, metadata, options) } + } else { + return { ProxyAdmin, Proxy } + } +} + +export function upgradeTransparentUpgradeableProxy( + m: IgnitionModuleBuilder, + proxyAdmin: CallableContractFuture, + proxy: CallableContractFuture, + implementation: CallableContractFuture, + metadata: ImplementationMetadata, + options?: ContractOptions, +) { + const upgradeCall = m.call(proxyAdmin, 'upgradeAndCall', + [proxy, implementation, m.encodeFunctionCall(implementation, 'initialize', metadata.initArgs)], + options, + ) + return loadProxyWithABI(m, proxy, metadata, { ...options, after: [upgradeCall] }) +} diff --git a/packages/horizon/ignition/modules/proxy/implementation.ts b/packages/horizon/ignition/modules/proxy/implementation.ts new file mode 100644 index 000000000..a1cd30c4c --- /dev/null +++ b/packages/horizon/ignition/modules/proxy/implementation.ts @@ -0,0 +1,22 @@ +import { ArgumentType, Artifact, ContractOptions, IgnitionModuleBuilder } from '@nomicfoundation/ignition-core' + +export type ImplementationMetadata = { + name: string + artifact?: Artifact + constructorArgs?: ArgumentType[] + initArgs?: ArgumentType[] +} + +export function deployImplementation( + m: IgnitionModuleBuilder, + contract: ImplementationMetadata, + options?: ContractOptions, +) { + let implementation + if (contract.artifact === undefined) { + implementation = m.contract(contract.name, contract.constructorArgs, options) + } else { + implementation = m.contract(contract.name, contract.artifact, contract.constructorArgs, options) + } + return implementation +} diff --git a/packages/horizon/ignition/modules/proxy/utils.ts b/packages/horizon/ignition/modules/proxy/utils.ts new file mode 100644 index 000000000..c6b7f4c2a --- /dev/null +++ b/packages/horizon/ignition/modules/proxy/utils.ts @@ -0,0 +1,23 @@ +import { + ContractAtFuture, + ContractFuture, + ContractOptions, + IgnitionModuleBuilder, +} from '@nomicfoundation/ignition-core' + +import type { ImplementationMetadata } from './implementation' + +export function loadProxyWithABI( + m: IgnitionModuleBuilder, + proxy: ContractFuture | ContractAtFuture, + contract: ImplementationMetadata, + options?: ContractOptions, +) { + let proxyWithABI + if (contract.artifact === undefined) { + proxyWithABI = m.contractAt(contract.name, proxy, options) + } else { + proxyWithABI = m.contractAt(`${contract.name}_ProxyWithABI`, contract.artifact, proxy, options) + } + return proxyWithABI +} diff --git a/packages/horizon/lib/forge-std b/packages/horizon/lib/forge-std new file mode 160000 index 000000000..e4aef94c1 --- /dev/null +++ b/packages/horizon/lib/forge-std @@ -0,0 +1 @@ +Subproject commit e4aef94c1768803a16fe19f7ce8b65defd027cfd diff --git a/packages/horizon/lib/openzeppelin-foundry-upgrades b/packages/horizon/lib/openzeppelin-foundry-upgrades new file mode 160000 index 000000000..4cd15fc50 --- /dev/null +++ b/packages/horizon/lib/openzeppelin-foundry-upgrades @@ -0,0 +1 @@ +Subproject commit 4cd15fc50b141c77d8cc9ff8efb44d00e841a299 diff --git a/packages/horizon/natspec-smells.config.js b/packages/horizon/natspec-smells.config.js new file mode 100644 index 000000000..d6b05e812 --- /dev/null +++ b/packages/horizon/natspec-smells.config.js @@ -0,0 +1,10 @@ +/** + * List of supported options: https://github.com/defi-wonderland/natspec-smells?tab=readme-ov-file#options + */ + +/** @type {import('@defi-wonderland/natspec-smells').Config} */ +module.exports = { + include: 'contracts/**/*.sol', + exclude: ['test/**/*.sol', 'contracts/mocks/**/*.sol', 'contracts/**/LibFixedMath.sol'], + constructorNatspec: true, +} diff --git a/packages/horizon/package.json b/packages/horizon/package.json new file mode 100644 index 000000000..ff9ea6c82 --- /dev/null +++ b/packages/horizon/package.json @@ -0,0 +1,85 @@ +{ + "name": "@graphprotocol/horizon", + "version": "0.3.3", + "publishConfig": { + "access": "public" + }, + "description": "", + "author": "The Graph core devs", + "license": "GPL-2.0-or-later", + "types": "typechain-types/index.ts", + "files": [ + "build/contracts/**/*", + "typechain-types/**/*", + "README.md", + "addresses.json" + ], + "scripts": { + "lint": "pnpm lint:ts && pnpm lint:sol", + "lint:ts": "eslint '**/*.{js,ts}' --fix --no-warn-ignored", + "lint:sol": "pnpm lint:sol:prettier && pnpm lint:sol:solhint", + "lint:sol:prettier": "prettier --write contracts/**/*.sol test/**/*.sol", + "lint:sol:solhint": "solhint --noPrompt --fix contracts/**/*.sol --config node_modules/solhint-graph-config/index.js", + "lint:sol:natspec": "natspec-smells --config natspec-smells.config.js", + "clean": "rm -rf build dist cache cache_forge typechain-types", + "build": "hardhat compile", + "test": "forge test", + "test:deployment": "SECURE_ACCOUNTS_DISABLE_PROVIDER=true hardhat test test/deployment/*.ts", + "test:integration": "./scripts/integration" + }, + "devDependencies": { + "@defi-wonderland/natspec-smells": "^1.1.6", + "@graphprotocol/contracts": "workspace:^7.1.2", + "@graphprotocol/toolshed": "workspace:^", + "@nomicfoundation/hardhat-chai-matchers": "^2.0.0", + "@nomicfoundation/hardhat-ethers": "3.0.8", + "@nomicfoundation/hardhat-foundry": "^1.1.1", + "@nomicfoundation/hardhat-ignition": "^0.15.9", + "@nomicfoundation/hardhat-ignition-ethers": "^0.15.9", + "@nomicfoundation/hardhat-network-helpers": "^1.0.0", + "@nomicfoundation/hardhat-toolbox": "^4.0.0", + "@nomicfoundation/hardhat-verify": "^2.0.10", + "@nomicfoundation/ignition-core": "^0.15.9", + "@openzeppelin/contracts": "^5.0.2", + "@openzeppelin/contracts-upgradeable": "^5.0.2", + "@typechain/ethers-v6": "^0.5.0", + "@typechain/hardhat": "^9.0.0", + "@types/chai": "^4.2.0", + "@types/mocha": ">=9.1.0", + "@types/node": ">=16.0.0", + "chai": "^4.2.0", + "eslint": "^8.56.0", + "eslint-graph-config": "workspace:^0.0.1", + "ethers": "6.13.7", + "glob": "^11.0.1", + "hardhat": "^2.22.18", + "hardhat-contract-sizer": "^2.10.0", + "hardhat-gas-reporter": "^1.0.8", + "hardhat-graph-protocol": "workspace:^0.1.21", + "hardhat-secure-accounts": "^1.0.5", + "lint-staged": "^15.2.2", + "prettier": "^3.2.5", + "prettier-plugin-solidity": "^1.3.1", + "solhint": "^4.5.2", + "solhint-graph-config": "workspace:^0.0.1", + "solhint-plugin-graph": "workspace:^0.0.1", + "solidity-coverage": "^0.8.0", + "ts-node": ">=8.0.0", + "typechain": "^8.3.0", + "typescript": "^5.6.3" + }, + "lint-staged": { + "contracts/**/*.sol": [ + "pnpm lint:sol" + ], + "**/*.ts": [ + "pnpm lint:ts" + ], + "**/*.js": [ + "pnpm lint:ts" + ], + "**/*.json": [ + "pnpm lint:ts" + ] + } +} diff --git a/packages/horizon/prettier.config.js b/packages/horizon/prettier.config.js new file mode 100644 index 000000000..5b8e866f2 --- /dev/null +++ b/packages/horizon/prettier.config.js @@ -0,0 +1,2 @@ +const prettierGraphConfig = require('solhint-graph-config/prettier') +module.exports = prettierGraphConfig diff --git a/packages/horizon/remappings.txt b/packages/horizon/remappings.txt new file mode 100644 index 000000000..d27549557 --- /dev/null +++ b/packages/horizon/remappings.txt @@ -0,0 +1,8 @@ +@graphprotocol/contracts/=node_modules/@graphprotocol/contracts/ +forge-std/=lib/forge-std/src/ +ds-test/=lib/forge-std/lib/ds-test/src/ +eth-gas-reporter/=node_modules/eth-gas-reporter/ +hardhat/=node_modules/hardhat/ +@openzeppelin/contracts/=node_modules/@openzeppelin/contracts/ +@openzeppelin/contracts-upgradeable/=node_modules/@openzeppelin/contracts-upgradeable/ +openzeppelin-foundry-upgrades/=lib/openzeppelin-foundry-upgrades/src \ No newline at end of file diff --git a/packages/horizon/scripts/integration b/packages/horizon/scripts/integration new file mode 100755 index 000000000..baf48cf5e --- /dev/null +++ b/packages/horizon/scripts/integration @@ -0,0 +1,120 @@ +#!/bin/bash + +set -eo pipefail + +NON_INTERACTIVE=${NON_INTERACTIVE:-false} + +# Set environment variables for this script +export SECURE_ACCOUNTS_DISABLE_PROVIDER=true +export FORK_FROM_CHAIN_ID=${FORK_FROM_CHAIN_ID:-421614} + +# Function to cleanup resources +cleanup() { + # Kill hardhat node only if we started it + if [ ! -z "$NODE_PID" ] && [ "$STARTED_NODE" = true ]; then + echo "Cleaning up Hardhat node (PID: $NODE_PID)..." + kill -TERM -- -$NODE_PID 2>/dev/null || true + fi +} + +# Set trap to call cleanup function on script exit (normal or error) +trap cleanup EXIT + +# Check if ignition deployment folder exists and prompt before proceeding +if [ -d "ignition/deployments/horizon-localhost" ]; then + if [ "$NON_INTERACTIVE" = true ]; then + confirm=y + else + read -p "Ignition deployment files already exist. These must be removed for the tests to work properly. Remove them? (y/n) [y]: " confirm + confirm=${confirm:-y} + fi + if [[ $confirm == [yY] || $confirm == [yY][eE][sS] ]]; then + echo "Removing existing ignition deployment files..." + rm -rf ignition/deployments/horizon-localhost + else + echo "Operation cancelled. Exiting..." + exit 1 + fi +fi + +if [ -f "addresses-localhost.json" ]; then + if [ "$NON_INTERACTIVE" = true ]; then + confirm=y + else + read -p "Address book for horizon will be deleted. Continue? (y/n) [y]: " confirm + confirm=${confirm:-y} + fi + if [[ $confirm == [yY] || $confirm == [yY][eE][sS] ]]; then + echo "Deleting addresses-localhost.json..." + rm -f addresses-localhost.json + else + echo "Operation cancelled. Exiting..." + exit 1 + fi +fi + +# Check required env variables +BLOCKCHAIN_RPC=${BLOCKCHAIN_RPC:-$(npx hardhat vars get ARBITRUM_SEPOLIA_RPC)} +if [ -z "$BLOCKCHAIN_RPC" ]; then + echo "BLOCKCHAIN_RPC environment variable is required" + exit 1 +fi + +echo "Starting integration tests..." + +# Check if hardhat node is already running on port 8545 +STARTED_NODE=false +if lsof -i:8545 > /dev/null 2>&1; then + echo "Hardhat node already running on port 8545, using existing node" + # Get the PID of the process using port 8545 + NODE_PID=$(lsof -t -i:8545) +else + # Start local hardhat node forked from Arbitrum Sepolia + echo "Starting local hardhat node..." + npx hardhat node --fork $BLOCKCHAIN_RPC > node.log 2>&1 & + NODE_PID=$! + STARTED_NODE=true + + # Wait for node to start + sleep 10 +fi + +# Setup horizon address book +jq '{"31337": ."'"$FORK_FROM_CHAIN_ID"'"}' addresses-integration-tests.json > addresses-localhost.json + +# Setup pre horizon migration state needed for the integration tests +npx hardhat test:seed --network localhost + +# Transfer ownership of protocol to hardhat signer 1 +npx hardhat test:transfer-ownership --network localhost + +# Step 1 - Deployer +npx hardhat deploy:migrate --network localhost --horizon-config integration --step 1 + +# Step 2 - Governor +npx hardhat deploy:migrate --network localhost --horizon-config integration --step 2 --patch-config --account-index 1 --hide-banner --standalone + +# Step 3 - Deployer +npx hardhat deploy:migrate --network localhost --horizon-config integration --step 3 --patch-config --hide-banner --standalone + +# Step 4 - Governor +npx hardhat deploy:migrate --network localhost --horizon-config integration --step 4 --patch-config --account-index 1 --hide-banner --standalone + +# Run integration tests - During transition period +npx hardhat test:integration --phase during-transition-period --network localhost + +# Clear thawing period +npx hardhat transition:clear-thawing --network localhost + +# Run integration tests - After transition period +npx hardhat test:integration --phase after-transition-period --network localhost + +# Enable delegation slashing +npx hardhat transition:enable-delegation-slashing --network localhost + +# Run integration tests - After delegation slashing enabled +npx hardhat test:integration --phase after-delegation-slashing-enabled --network localhost + +echo "" +echo "🎉 ✨ 🚀 ✅ Integration tests completed successfully! 🎉 ✨ 🚀 ✅" +echo "" \ No newline at end of file diff --git a/packages/horizon/scripts/post-verify b/packages/horizon/scripts/post-verify new file mode 100644 index 000000000..dfcae3bcc --- /dev/null +++ b/packages/horizon/scripts/post-verify @@ -0,0 +1,3 @@ +#!/bin/bash + +git ls-files --others --exclude-standard ignition/deployments | xargs rm -f \ No newline at end of file diff --git a/packages/horizon/scripts/pre-verify b/packages/horizon/scripts/pre-verify new file mode 100755 index 000000000..679f51560 --- /dev/null +++ b/packages/horizon/scripts/pre-verify @@ -0,0 +1,60 @@ +#!/bin/bash + +# Move external artifacts +cp -r ../contracts/build/contracts/contracts/* build/contracts/contracts +cp -r ../contracts/build/contracts/build-info/* build/contracts/build-info +cp -r build/contracts/@openzeppelin/contracts/proxy/transparent/* build/contracts/contracts + +# HardHat Ignition deployment ID +DEPLOYMENT_ID="${1:-chain-421614}" + +# .dbg.json files +DBG_DIR_SRC="./build/contracts/contracts" +DBG_DIR_DEST="./ignition/deployments/${DEPLOYMENT_ID}/artifacts" + +# build-info files +BUILD_INFO_DIR_SRC="./build/contracts/build-info" +BUILD_INFO_DIR_DEST="./ignition/deployments/${DEPLOYMENT_ID}/build-info" + +# Ensure the destination directories exist +mkdir -p "$DBG_DIR_DEST" +mkdir -p "$BUILD_INFO_DIR_DEST" + +# Copy .dbg.json files +echo "Searching for .dbg.json files in $DBG_DIR_SRC and copying them to $DBG_DIR_DEST..." +find "$DBG_DIR_SRC" -type f -name "*.dbg.json" | while read -r file; do + base_name=$(basename "$file" .dbg.json) + new_name="${base_name}#${base_name}.dbg.json" + + if [ ! -f "$DBG_DIR_DEST/$new_name" ]; then + cp "$file" "$DBG_DIR_DEST/$new_name" + fi + + jq '.buildInfo |= sub("../../../../"; "../") | .buildInfo |= sub("../../../"; "../") | .buildInfo |= sub("../../"; "../")' "$DBG_DIR_DEST/$new_name" > "${DBG_DIR_DEST}/${new_name}.tmp" && mv "${DBG_DIR_DEST}/${new_name}.tmp" "$DBG_DIR_DEST/$new_name" +done + +# Copy build-info files +echo "Searching for build-info files in $BUILD_INFO_DIR_SRC and copying them to $BUILD_INFO_DIR_DEST..." +find "$BUILD_INFO_DIR_SRC" -type f -name "*.json" | while read -r file; do + base_name=$(basename "$file" .json) + if [ ! -f "$BUILD_INFO_DIR_DEST/$base_name.json" ]; then + cp "$file" "$BUILD_INFO_DIR_DEST/$base_name.json" + fi +done + +echo "All files have been processed." + +# Patch proxy artifacts +cp "$DBG_DIR_DEST/GraphProxy#GraphProxy.dbg.json" "$DBG_DIR_DEST/HorizonProxies#GraphProxy_HorizonStaking.dbg.json" +cp "$DBG_DIR_DEST/GraphProxy#GraphProxy.dbg.json" "$DBG_DIR_DEST/L2Curation#GraphProxy.dbg.json" +cp "$DBG_DIR_DEST/GraphProxy#GraphProxy.dbg.json" "$DBG_DIR_DEST/L2GraphToken#GraphProxy.dbg.json" +cp "$DBG_DIR_DEST/GraphProxy#GraphProxy.dbg.json" "$DBG_DIR_DEST/L2GraphTokenGateway#GraphProxy.dbg.json" +cp "$DBG_DIR_DEST/GraphProxy#GraphProxy.dbg.json" "$DBG_DIR_DEST/RewardsManager#GraphProxy.dbg.json" +cp "$DBG_DIR_DEST/GraphProxy#GraphProxy.dbg.json" "$DBG_DIR_DEST/BridgeEscrow#GraphProxy.dbg.json" +cp "$DBG_DIR_DEST/GraphProxy#GraphProxy.dbg.json" "$DBG_DIR_DEST/EpochManager#GraphProxy.dbg.json" +cp "$DBG_DIR_DEST/GraphProxy#GraphProxy.dbg.json" "$DBG_DIR_DEST/L2GNS#GraphProxy.dbg.json" + +cp "$DBG_DIR_DEST/TransparentUpgradeableProxy#TransparentUpgradeableProxy.dbg.json" "$DBG_DIR_DEST/HorizonProxiesDeployer#TransparentUpgradeableProxy_GraphPayments.dbg.json" +cp "$DBG_DIR_DEST/TransparentUpgradeableProxy#TransparentUpgradeableProxy.dbg.json" "$DBG_DIR_DEST/HorizonProxies#TransparentUpgradeableProxy_GraphPayments.dbg.json" +cp "$DBG_DIR_DEST/TransparentUpgradeableProxy#TransparentUpgradeableProxy.dbg.json" "$DBG_DIR_DEST/HorizonProxiesDeployer#TransparentUpgradeableProxy_PaymentsEscrow.dbg.json" +cp "$DBG_DIR_DEST/TransparentUpgradeableProxy#TransparentUpgradeableProxy.dbg.json" "$DBG_DIR_DEST/HorizonProxies#TransparentUpgradeableProxy_PaymentsEscrow.dbg.json" diff --git a/packages/horizon/tasks/deploy.ts b/packages/horizon/tasks/deploy.ts new file mode 100644 index 000000000..6f7d006bd --- /dev/null +++ b/packages/horizon/tasks/deploy.ts @@ -0,0 +1,186 @@ +/* eslint-disable no-case-declarations */ +import { loadConfig, patchConfig, saveToAddressBook } from '@graphprotocol/toolshed/hardhat' +import { task, types } from 'hardhat/config' +import { ZERO_ADDRESS } from '@graphprotocol/toolshed' + +import type { AddressBook } from '@graphprotocol/toolshed/deployments' +import type { HardhatRuntimeEnvironment } from 'hardhat/types' + +import DeployModule from '../ignition/modules/deploy' +import { printHorizonBanner } from '@graphprotocol/toolshed/utils' + +task('deploy:protocol', 'Deploy a new version of the Graph Protocol Horizon contracts - no data services deployed') + .addOptionalParam('horizonConfig', 'Name of the Horizon configuration file to use. Format is "protocol..json5", file must be in the "ignition/configs/" directory. Defaults to network name.', undefined, types.string) + .addOptionalParam('accountIndex', 'Derivation path index for the account to use', 0, types.int) + .setAction(async (args, hre: HardhatRuntimeEnvironment) => { + const graph = hre.graph() + + // Load configuration for the deployment + console.log('\n========== ⚙️ Deployment configuration ==========') + const { config: HorizonConfig, file } = loadConfig('./ignition/configs/', 'protocol', args.horizonConfig ?? hre.network.name) + console.log(`Loaded migration configuration from ${file}`) + + // Display the deployer -- this also triggers the secure accounts prompt if being used + console.log('\n========== 🔑 Deployer account ==========') + const deployer = await graph.accounts.getDeployer(args.accountIndex) + console.log('Using deployer account:', deployer.address) + const balance = await hre.ethers.provider.getBalance(deployer.address) + console.log('Deployer balance:', hre.ethers.formatEther(balance), 'ETH') + if (balance === 0n) { + console.error('Error: Deployer account has no ETH balance') + process.exit(1) + } + + // Deploy the contracts + console.log(`\n========== 🚧 Deploy protocol ==========`) + const deployment = await hre.ignition.deploy(DeployModule, { + displayUi: true, + parameters: HorizonConfig, + defaultSender: deployer.address, + }) + + // Save the addresses to the address book + console.log('\n========== 📖 Updating address book ==========') + // @ts-expect-error - @graphprotocol/toolshed/hardhat exports ts files so types mismatch here + saveToAddressBook(deployment, graph.horizon.addressBook) + console.log(`Address book at ${graph.horizon.addressBook.file} updated!`) + + console.log('\n\n🎉 ✨ 🚀 ✅ Deployment complete! 🎉 ✨ 🚀 ✅') + }) + +task('deploy:migrate', 'Upgrade an existing version of the Graph Protocol v1 to Horizon - no data services deployed') + .addOptionalParam('horizonConfig', 'Name of the Horizon configuration file to use. Format is "migrate..json5", file must be in the "ignition/configs/" directory. Defaults to network name.', undefined, types.string) + .addOptionalParam('step', 'Migration step to run (1, 2, 3 or 4)', undefined, types.int) + .addOptionalParam('accountIndex', 'Derivation path index for the account to use', 0, types.int) + .addFlag('patchConfig', 'Patch configuration file using address book values - does not save changes') + .addFlag('standalone', 'Deploy horizon contracts in standalone mode - subgraph service hardcoded as zero address') + .addFlag('hideBanner', 'Hide the banner display') + .setAction(async (args, hre: HardhatRuntimeEnvironment) => { + // Task parameters + const step: number = args.step ?? 0 + const patchConfig: boolean = args.patchConfig ?? false + + const graph = hre.graph() + if (!args.hideBanner) { + printHorizonBanner() + } + + // Migration step to run + console.log('\n========== 🏗️ Migration steps ==========') + const validSteps = [1, 2, 3, 4] + if (!validSteps.includes(step)) { + console.error(`Error: Invalid migration step provided: ${step}`) + console.error(`Valid steps are: ${validSteps.join(', ')}`) + process.exit(1) + } + console.log(`Running migration step: ${step}`) + + // Load configuration for the migration + console.log('\n========== ⚙️ Deployment configuration ==========') + const { config: HorizonMigrateConfig, file } = loadConfig('./ignition/configs/', 'migrate', args.horizonConfig ?? hre.network.name) + console.log(`Loaded migration configuration from ${file}`) + + // Display the deployer -- this also triggers the secure accounts prompt if being used + console.log('\n========== 🔑 Deployer account ==========') + const deployer = await graph.accounts.getDeployer(args.accountIndex) + console.log('Using deployer account:', deployer.address) + const balance = await hre.ethers.provider.getBalance(deployer.address) + console.log('Deployer balance:', hre.ethers.formatEther(balance), 'ETH') + if (balance === 0n) { + console.error('Error: Deployer account has no ETH balance') + process.exit(1) + } + + // Run migration step + console.log(`\n========== 🚧 Running migration: step ${step} ==========`) + const MigrationModule = require(`../ignition/modules/migrate/migrate-${step}`).default + const deployment = await hre.ignition.deploy( + MigrationModule, + { + displayUi: true, + parameters: patchConfig + ? _patchStepConfig( + step, + HorizonMigrateConfig, + graph.horizon.addressBook, + graph.subgraphService?.addressBook, + args.standalone, + ) + : HorizonMigrateConfig, + deploymentId: `horizon-${hre.network.name}`, + defaultSender: deployer.address, + }, + ) + + // Update address book + console.log('\n========== 📖 Updating address book ==========') + // @ts-expect-error - @graphprotocol/toolshed/hardhat exports ts files so types mismatch here + saveToAddressBook(deployment, graph.horizon.addressBook) + console.log(`Address book at ${graph.horizon.addressBook.file} updated!`) + + console.log(`\n\n🎉 ✨ 🚀 ✅ Migration step ${step} complete! 🎉 ✨ 🚀 ✅\n`) + }) + +// This function patches the Ignition configuration object using an address book to fill in the gaps +// The resulting configuration is not saved back to the configuration file +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function _patchStepConfig( + step: number, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + config: any, + horizonAddressBook: AddressBook, + subgraphServiceAddressBook: AddressBook | undefined, + standalone: boolean, + // eslint-disable-next-line @typescript-eslint/no-explicit-any +): any { + let patchedConfig = config + + // Get the subgraph service address + // Subgraph service address book might exist if we are running horizon + subgraph service + // or it might not exist if we are running horizon standalone + function getSubgraphServiceAddress() { + if ( + subgraphServiceAddressBook === undefined + || !subgraphServiceAddressBook.entryExists('SubgraphService') + || standalone + ) { + return ZERO_ADDRESS + } + return subgraphServiceAddressBook.getEntry('SubgraphService').address + } + + switch (step) { + case 2: + const GraphPayments = horizonAddressBook.getEntry('GraphPayments') + const PaymentsEscrow = horizonAddressBook.getEntry('PaymentsEscrow') + patchedConfig = patchConfig(config, { + $global: { + graphPaymentsAddress: GraphPayments.address, + paymentsEscrowAddress: PaymentsEscrow.address, + }, + }) + break + case 3: + patchedConfig = patchConfig(patchedConfig, { + $global: { + subgraphServiceAddress: getSubgraphServiceAddress(), + }, + }) + break + case 4: + const HorizonStaking = horizonAddressBook.getEntry('HorizonStaking') + const L2Curation = horizonAddressBook.getEntry('L2Curation') + const RewardsManager = horizonAddressBook.getEntry('RewardsManager') + patchedConfig = patchConfig(patchedConfig, { + $global: { + subgraphServiceAddress: getSubgraphServiceAddress(), + horizonStakingImplementationAddress: HorizonStaking.implementation ?? ZERO_ADDRESS, + curationImplementationAddress: L2Curation.implementation ?? ZERO_ADDRESS, + rewardsManagerImplementationAddress: RewardsManager.implementation ?? ZERO_ADDRESS, + }, + }) + break + } + + return patchedConfig +} diff --git a/packages/horizon/tasks/test/fixtures/delegators.ts b/packages/horizon/tasks/test/fixtures/delegators.ts new file mode 100644 index 000000000..274a040dd --- /dev/null +++ b/packages/horizon/tasks/test/fixtures/delegators.ts @@ -0,0 +1,58 @@ +import { indexers } from './indexers' +import { parseEther } from 'ethers' + +export interface Delegator { + address: string + delegations: { + indexerAddress: string + tokens: bigint + }[] + undelegate: boolean // Whether this delegator should undelegate at the end +} + +export const delegators: Delegator[] = [ + { + address: '0x610Bb1573d1046FCb8A70Bbbd395754cD57C2b60', // Hardhat account #10 + delegations: [ + { + indexerAddress: indexers[0].address, + tokens: parseEther('50000'), + }, + { + indexerAddress: indexers[1].address, + tokens: parseEther('25000'), + }, + ], + undelegate: false, + }, + { + address: '0x855FA758c77D68a04990E992aA4dcdeF899F654A', // Hardhat account #11 + delegations: [ + { + indexerAddress: indexers[1].address, + tokens: parseEther('75000'), + }, + ], + undelegate: false, + }, + { + address: '0xfA2435Eacf10Ca62ae6787ba2fB044f8733Ee843', // Hardhat account #12 + delegations: [ + { + indexerAddress: indexers[0].address, + tokens: parseEther('100000'), + }, + ], + undelegate: true, // This delegator will undelegate + }, + { + address: '0x64E078A8Aa15A41B85890265648e965De686bAE6', // Hardhat account #13 + delegations: [], + undelegate: false, + }, + { + address: '0x2F560290FEF1B3Ada194b6aA9c40aa71f8e95598', // Hardhat account #14 + delegations: [], + undelegate: false, + }, +] diff --git a/packages/horizon/tasks/test/fixtures/indexers.ts b/packages/horizon/tasks/test/fixtures/indexers.ts new file mode 100644 index 000000000..d92559ac0 --- /dev/null +++ b/packages/horizon/tasks/test/fixtures/indexers.ts @@ -0,0 +1,105 @@ +import { parseEther } from 'ethers' + +// Indexer interface +export interface Indexer { + address: string + stake: bigint + tokensToUnstake?: bigint + indexingRewardCut: number + queryFeeCut: number + rewardsDestination?: string + allocations: Allocation[] +} + +// Allocation interface +export interface Allocation { + allocationID: string + allocationPrivateKey: string + subgraphDeploymentID: string + tokens: bigint +} + +// Indexer one data +const INDEXER_ONE_ADDRESS = '0x95cED938F7991cd0dFcb48F0a06a40FA1aF46EBC' // Hardhat account #5 +const INDEXER_ONE_FIRST_ALLOCATION_ID = '0x70043e424171076D74a1f6a6a56087Bb4c7A61AA' +const INDEXER_ONE_FIRST_ALLOCATION_PRIVATE_KEY = '0x9c41bca4eb319bdf4cac23ae3366eed5f9fa12eb05c0ef29319afcfaa3fc2d79' +const INDEXER_ONE_SECOND_ALLOCATION_ID = '0xd67CE7F6A2eCa6fD78A7E2A5C5e56Fb821BEdE0c' +const INDEXER_ONE_SECOND_ALLOCATION_PRIVATE_KEY = '0x827a0b66fbeb3fefb4a99b6ba0b4bea3b8dd590b97fa7a1bbe74e5b33c935f16' +const INDEXER_ONE_THIRD_ALLOCATION_ID = '0x212e51125e4Ed4C2041614b139eC6cb8FA6d561C' +const INDEXER_ONE_THIRD_ALLOCATION_PRIVATE_KEY = '0x434f1d4435e978299ec64841153c25af2f611a145da3e8539c65b9bd5d9c08b5' + +// Indexer two data +const INDEXER_TWO_ADDRESS = '0x3E5e9111Ae8eB78Fe1CC3bb8915d5D461F3Ef9A9' // Hardhat account #6 +const INDEXER_TWO_REWARDS_DESTINATION = '0x227A35f9912693240E842FaAB6cf5e4E6371ff63' +const INDEXER_TWO_FIRST_ALLOCATION_ID = '0xD0EAc83b0bf328bbf68F4f1a1480e17A38BFb192' +const INDEXER_TWO_FIRST_ALLOCATION_PRIVATE_KEY = '0x80ff89a67cf4b41ea3ece2574b7212b5fee43c0fa370bf3e188a645b561ac810' +const INDEXER_TWO_SECOND_ALLOCATION_ID = '0x63280ec9EA63859b7e2041f07a549F311C86B3bd' +const INDEXER_TWO_SECOND_ALLOCATION_PRIVATE_KEY = '0xab6cb9dbb3646a856e6cac2c0e2a59615634e93cde11385eb6c6ba58e2873a46' + +// Indexer three data +const INDEXER_THREE_ADDRESS = '0x28a8746e75304c0780E011BEd21C72cD78cd535E' // Hardhat account #6 +const INDEXER_THREE_REWARDS_DESTINATION = '0xA3D22DDf431A8745888804F520D4eA51Cb43A458' +// Subgraph deployment IDs +const SUBGRAPH_DEPLOYMENT_ID_ONE = '0x02cd85012c1f075fd58fad178fd23ab841d3b5ddcf5cd3377c30118da97cb2a4' +const SUBGRAPH_DEPLOYMENT_ID_TWO = '0x03ca89485a59894f1acfa34660c69024b6b90ce45171dece7662b0886bc375c7' +const SUBGRAPH_DEPLOYMENT_ID_THREE = '0x0472e8c46f728adb65a22187c6740532f82c2ebadaeabbbe59a2bb4a1bdde197' + +export const indexers: Indexer[] = [ + { + address: INDEXER_ONE_ADDRESS, + stake: parseEther('1100000'), + tokensToUnstake: parseEther('10000'), + indexingRewardCut: 900000, // 90% + queryFeeCut: 900000, // 90% + allocations: [ + { + allocationID: INDEXER_ONE_FIRST_ALLOCATION_ID, + allocationPrivateKey: INDEXER_ONE_FIRST_ALLOCATION_PRIVATE_KEY, + subgraphDeploymentID: SUBGRAPH_DEPLOYMENT_ID_ONE, + tokens: parseEther('400000'), + }, + { + allocationID: INDEXER_ONE_SECOND_ALLOCATION_ID, + allocationPrivateKey: INDEXER_ONE_SECOND_ALLOCATION_PRIVATE_KEY, + subgraphDeploymentID: SUBGRAPH_DEPLOYMENT_ID_TWO, + tokens: parseEther('300000'), + }, + { + allocationID: INDEXER_ONE_THIRD_ALLOCATION_ID, + allocationPrivateKey: INDEXER_ONE_THIRD_ALLOCATION_PRIVATE_KEY, + subgraphDeploymentID: SUBGRAPH_DEPLOYMENT_ID_THREE, + tokens: parseEther('250000'), + }, + ], + }, + { + address: INDEXER_TWO_ADDRESS, + stake: parseEther('1100000'), + tokensToUnstake: parseEther('1000000'), + indexingRewardCut: 850000, // 85% + queryFeeCut: 850000, // 85% + rewardsDestination: INDEXER_TWO_REWARDS_DESTINATION, + allocations: [ + { + allocationID: INDEXER_TWO_FIRST_ALLOCATION_ID, + allocationPrivateKey: INDEXER_TWO_FIRST_ALLOCATION_PRIVATE_KEY, + subgraphDeploymentID: SUBGRAPH_DEPLOYMENT_ID_ONE, + tokens: parseEther('400000'), + }, + { + allocationID: INDEXER_TWO_SECOND_ALLOCATION_ID, + allocationPrivateKey: INDEXER_TWO_SECOND_ALLOCATION_PRIVATE_KEY, + subgraphDeploymentID: SUBGRAPH_DEPLOYMENT_ID_TWO, + tokens: parseEther('200000'), + }, + ], + }, + { + address: INDEXER_THREE_ADDRESS, + stake: parseEther('1100000'), + indexingRewardCut: 800000, // 80% + queryFeeCut: 800000, // 80% + rewardsDestination: INDEXER_THREE_REWARDS_DESTINATION, + allocations: [], + }, +] diff --git a/packages/horizon/tasks/test/integration.ts b/packages/horizon/tasks/test/integration.ts new file mode 100644 index 000000000..f25d0855b --- /dev/null +++ b/packages/horizon/tasks/test/integration.ts @@ -0,0 +1,36 @@ +import { glob } from 'glob' +import { task } from 'hardhat/config' +import { TASK_TEST } from 'hardhat/builtin-tasks/task-names' + +import { printBanner } from '@graphprotocol/toolshed/utils' + +task('test:integration', 'Runs all integration tests') + .addParam( + 'phase', + 'Test phase to run: "during-transition-period", "after-transition-period", "after-delegation-slashing-enabled"', + ) + .setAction(async (taskArgs, hre) => { + // Get test files for each phase + const duringTransitionPeriodFiles = await glob('test/integration/during-transition-period/**/*.{js,ts}') + const afterTransitionPeriodFiles = await glob('test/integration/after-transition-period/**/*.{js,ts}') + const afterDelegationSlashingEnabledFiles = await glob('test/integration/after-delegation-slashing-enabled/**/*.{js,ts}') + + // Display banner for the current test phase + printBanner(taskArgs.phase, 'INTEGRATION TESTS: ') + + switch (taskArgs.phase) { + case 'during-transition-period': + await hre.run(TASK_TEST, { testFiles: duringTransitionPeriodFiles }) + break + case 'after-transition-period': + await hre.run(TASK_TEST, { testFiles: afterTransitionPeriodFiles }) + break + case 'after-delegation-slashing-enabled': + await hre.run(TASK_TEST, { testFiles: afterDelegationSlashingEnabledFiles }) + break + default: + throw new Error( + 'Invalid phase. Must be "during-transition-period", "after-transition-period", "after-delegation-slashing-enabled", or "all"', + ) + } + }) diff --git a/packages/horizon/tasks/test/ownership.ts b/packages/horizon/tasks/test/ownership.ts new file mode 100644 index 000000000..af0d29b57 --- /dev/null +++ b/packages/horizon/tasks/test/ownership.ts @@ -0,0 +1,78 @@ +import { task, types } from 'hardhat/config' +import { printBanner } from '@graphprotocol/toolshed/utils' +import { requireLocalNetwork } from '@graphprotocol/toolshed/hardhat' + +// This is required because we cannot impersonate Ignition accounts +// so we impersonate current governor and transfer ownership to accounts that Ignition can control +task('test:transfer-ownership', 'Transfer ownership of protocol contracts to a new governor') + .addOptionalParam('governorIndex', 'Derivation path index for the new governor account', 1, types.int) + .addOptionalParam('slasherIndex', 'Derivation path index for the new slasher account', 2, types.int) + .addOptionalParam('pauseGuardianIndex', 'Derivation path index for the new pause guardian account', 3, types.int) + .setAction(async (taskArgs, hre) => { + printBanner('TRANSFER OWNERSHIP') + + const graph = hre.graph() + + // this task uses impersonation so we NEED a local network + requireLocalNetwork(hre) + + console.log('\n--- STEP 0: Setup ---') + + // Get signers + const newGovernor = await graph.accounts.getGovernor(taskArgs.governorIndex) + const newSlasher = await graph.accounts.getArbitrator(taskArgs.slasherIndex) + const newPauseGuardian = await graph.accounts.getPauseGuardian(taskArgs.pauseGuardianIndex) + console.log(`New governor will be: ${newGovernor.address}`) + + // Get contracts + const staking = graph.horizon.contracts.LegacyStaking + const controller = graph.horizon.contracts.Controller + const graphProxyAdmin = graph.horizon.contracts.GraphProxyAdmin + + // Get current owners + const controllerGovernor = await controller.governor() + const proxyAdminGovernor = await graphProxyAdmin.governor() + + console.log(`Current Controller governor: ${controllerGovernor}`) + console.log(`Current GraphProxyAdmin governor: ${proxyAdminGovernor}`) + + // Get impersonated signers + const controllerSigner = await hre.ethers.getImpersonatedSigner(controllerGovernor) + const proxyAdminSigner = await hre.ethers.getImpersonatedSigner(proxyAdminGovernor) + + console.log('\n--- STEP 1: Transfer ownership of Controller ---') + + // Transfer Controller ownership + console.log('Transferring Controller ownership...') + await controller.connect(controllerSigner).transferOwnership(newGovernor.address) + console.log('Accepting Controller ownership...') + + // Accept ownership of Controller + await controller.connect(newGovernor).acceptOwnership() + console.log(`New Controller governor: ${await controller.governor()}`) + + console.log('\n--- STEP 2: Transfer ownership of GraphProxyAdmin ---') + + // Transfer GraphProxyAdmin ownership + console.log('Transferring GraphProxyAdmin ownership...') + await graphProxyAdmin.connect(proxyAdminSigner).transferOwnership(newGovernor.address) + console.log('Accepting GraphProxyAdmin ownership...') + + // Accept ownership of GraphProxyAdmin + await graphProxyAdmin.connect(newGovernor).acceptOwnership() + console.log(`New GraphProxyAdmin governor: ${await graphProxyAdmin.governor()}`) + + console.log('\n--- STEP 3: Assign new slasher ---') + + // Assign new slasher + console.log('Assigning new slasher...') + await staking.connect(newGovernor).setSlasher(newSlasher.address, true) + console.log(`New slasher: ${newSlasher.address}, allowed: ${await staking.slashers(newSlasher.address)}`) + + // Assign new pause guardian + console.log('Assigning new pause guardian...') + await controller.connect(newGovernor).setPauseGuardian(newPauseGuardian.address) + console.log(`New pause guardian: ${newPauseGuardian.address}`) + + console.log('\n\n🎉 ✨ 🚀 ✅ Transfer ownership complete! 🎉 ✨ 🚀 ✅\n') + }) diff --git a/packages/horizon/tasks/test/seed.ts b/packages/horizon/tasks/test/seed.ts new file mode 100644 index 000000000..c172c0d6e --- /dev/null +++ b/packages/horizon/tasks/test/seed.ts @@ -0,0 +1,118 @@ +import { generateLegacyAllocationProof, randomAllocationMetadata } from '@graphprotocol/toolshed' +import { requireLocalNetwork, setGRTBalance } from '@graphprotocol/toolshed/hardhat' +import { delegators } from './fixtures/delegators' +import { indexers } from './fixtures/indexers' +import { printBanner } from '@graphprotocol/toolshed/utils' +import { task } from 'hardhat/config' + +task('test:seed', 'Sets up some protocol state for testing') + .setAction(async (_, hre) => { + printBanner('PROTOCOL STATE SETUP') + + console.log('\n--- STEP 0: Setup ---') + + // this task uses impersonation so we NEED a local network + requireLocalNetwork(hre) + + // Get contracts + const graph = hre.graph() + const GraphToken = graph.horizon.contracts.L2GraphToken + const Staking = graph.horizon.contracts.LegacyStaking + + // STEP 1: stake for indexers + console.log('\n--- STEP 1: Indexers Setup ---') + for (const indexer of indexers) { + await setGRTBalance(graph.provider, GraphToken.target, indexer.address, indexer.stake) + + // Impersonate the indexer + const indexerSigner = await hre.ethers.getImpersonatedSigner(indexer.address) + + // Approve and stake + console.log(`Staking ${indexer.stake} tokens for indexer ${indexer.address}...`) + await GraphToken.connect(indexerSigner).approve(Staking.target, indexer.stake) + await Staking.connect(indexerSigner).stake(indexer.stake) + + // Set delegation parameters + console.log(`Setting delegation parameters for indexer ${indexer.address}...`) + await Staking.connect(indexerSigner).setDelegationParameters(indexer.indexingRewardCut, indexer.queryFeeCut, 0) + + // Set rewards destination if it exists + if (indexer.rewardsDestination) { + console.log(`Setting rewards destination for indexer ${indexer.address} to ${indexer.rewardsDestination}...`) + await Staking.connect(indexerSigner).setRewardsDestination(indexer.rewardsDestination) + } + } + + // STEP 2: Fund and delegate for delegators + console.log('\n--- STEP 2: Delegators Delegating ---') + for (const delegator of delegators) { + await setGRTBalance(graph.provider, GraphToken.target, delegator.address, delegator.delegations.reduce((acc, d) => acc + d.tokens, BigInt(0))) + + // Impersonate the delegator + const delegatorSigner = await hre.ethers.getImpersonatedSigner(delegator.address) + + // Delegate to each indexer + for (const delegation of delegator.delegations) { + console.log(`Delegating ${delegation.tokens} tokens from ${delegator.address} to indexer ${delegation.indexerAddress}...`) + await GraphToken.connect(delegatorSigner).approve(Staking.target, delegation.tokens) + await Staking.connect(delegatorSigner).delegate(delegation.indexerAddress, delegation.tokens) + } + } + + // STEP 3: Create allocations + console.log('\n--- STEP 3: Creating Allocations ---') + for (const indexer of indexers) { + // Impersonate the indexer + const indexerSigner = await hre.ethers.getImpersonatedSigner(indexer.address) + + for (const allocation of indexer.allocations) { + console.log(`Creating allocation of ${allocation.tokens} tokens from indexer ${indexer.address} on subgraph ${allocation.subgraphDeploymentID}...`) + + await Staking.connect(indexerSigner).allocate( + allocation.subgraphDeploymentID, + allocation.tokens, + allocation.allocationID, + randomAllocationMetadata(), + await generateLegacyAllocationProof(indexer.address, allocation.allocationPrivateKey), + ) + } + } + + // STEP 4: Indexer unstakes + console.log('\n--- STEP 4: Indexer unstakes ---') + for (const indexer of indexers) { + if (indexer.tokensToUnstake) { + console.log(`Indexer ${indexer.address} is unstaking...`) + + // Impersonate the indexer + const indexerSigner = await hre.ethers.getImpersonatedSigner(indexer.address) + + // Unstake + await Staking.connect(indexerSigner).unstake(indexer.tokensToUnstake) + } + } + + // STEP 5: Undelegate + console.log('\n--- STEP 5: Undelegating ---') + for (const delegator of delegators) { + if (delegator.undelegate) { + console.log(`Delegator ${delegator.address} is undelegating...`) + + // Impersonate the delegator + const delegatorSigner = await hre.ethers.getImpersonatedSigner(delegator.address) + + for (const delegation of delegator.delegations) { + // Get the delegation information + const delegationInfo = await Staking.getDelegation(delegation.indexerAddress, delegator.address) + const shares = BigInt(delegationInfo.shares.toString()) + + console.log(`Undelegating ${shares} shares from indexer ${delegation.indexerAddress}...`) + + // Undelegate the shares + await Staking.connect(delegatorSigner).undelegate(delegation.indexerAddress, shares) + } + } + } + + console.log('\n\n🎉 ✨ 🚀 ✅ Pre-upgrade state setup complete! 🎉 ✨ 🚀 ✅\n') + }) diff --git a/packages/horizon/tasks/transitions/delegation-slashing.ts b/packages/horizon/tasks/transitions/delegation-slashing.ts new file mode 100644 index 000000000..a983686ce --- /dev/null +++ b/packages/horizon/tasks/transitions/delegation-slashing.ts @@ -0,0 +1,25 @@ +import { task, types } from 'hardhat/config' +import { printBanner } from '@graphprotocol/toolshed/utils' +import { requireLocalNetwork } from '@graphprotocol/toolshed/hardhat' + +task('transition:enable-delegation-slashing', 'Enables delegation slashing in HorizonStaking') + .addOptionalParam('governorIndex', 'Derivation path index for the governor account', 1, types.int) + .addFlag('skipNetworkCheck', 'Skip the network check (use with caution)') + .setAction(async (taskArgs, hre) => { + printBanner('ENABLING DELEGATION SLASHING') + + if (!taskArgs.skipNetworkCheck) { + requireLocalNetwork(hre) + } + + const graph = hre.graph() + const governor = await graph.accounts.getGovernor(taskArgs.governorIndex) + const horizonStaking = graph.horizon.contracts.HorizonStaking + + console.log('Enabling delegation slashing...') + await horizonStaking.connect(governor).setDelegationSlashingEnabled() + + // Log if the delegation slashing is enabled + const delegationSlashingEnabled = await horizonStaking.isDelegationSlashingEnabled() + console.log('Delegation slashing enabled:', delegationSlashingEnabled) + }) diff --git a/packages/horizon/tasks/transitions/thawing-period.ts b/packages/horizon/tasks/transitions/thawing-period.ts new file mode 100644 index 000000000..f0957184c --- /dev/null +++ b/packages/horizon/tasks/transitions/thawing-period.ts @@ -0,0 +1,22 @@ +import { task, types } from 'hardhat/config' +import { printBanner } from '@graphprotocol/toolshed/utils' +import { requireLocalNetwork } from '@graphprotocol/toolshed/hardhat' + +task('transition:clear-thawing', 'Clears the thawing period in HorizonStaking') + .addOptionalParam('governorIndex', 'Derivation path index for the governor account', 1, types.int) + .addFlag('skipNetworkCheck', 'Skip the network check (use with caution)') + .setAction(async (taskArgs, hre) => { + printBanner('CLEARING THAWING PERIOD') + + if (!taskArgs.skipNetworkCheck) { + requireLocalNetwork(hre) + } + + const graph = hre.graph() + const governor = await graph.accounts.getGovernor(taskArgs.governorIndex) + const horizonStaking = graph.horizon.contracts.HorizonStaking + + console.log('Clearing thawing period...') + await horizonStaking.connect(governor).clearThawingPeriod() + console.log('Thawing period cleared') + }) diff --git a/packages/horizon/test/deployment/Controller.test.ts b/packages/horizon/test/deployment/Controller.test.ts new file mode 100644 index 000000000..777d755b1 --- /dev/null +++ b/packages/horizon/test/deployment/Controller.test.ts @@ -0,0 +1,56 @@ +import hre from 'hardhat' + +import { expect } from 'chai' +import { testIf } from './lib/testIf' +import { toUtf8Bytes } from 'ethers' + +const graph = hre.graph() +const addressBook = graph.horizon.addressBook +const Controller = graph.horizon.contracts.Controller + +describe('Controller', function () { + it('should have GraphToken registered', async function () { + const graphToken = await Controller.getContractProxy(hre.ethers.keccak256(toUtf8Bytes('GraphToken'))) + expect(graphToken).to.equal(addressBook.getEntry('L2GraphToken').address) + }) + + it('should have HorizonStaking registered', async function () { + const horizonStaking = await Controller.getContractProxy(hre.ethers.keccak256(toUtf8Bytes('Staking'))) + expect(horizonStaking).to.equal(addressBook.getEntry('HorizonStaking').address) + }) + + testIf(2)('should have GraphPayments registered', async function () { + const graphPayments = await Controller.getContractProxy(hre.ethers.keccak256(toUtf8Bytes('GraphPayments'))) + expect(graphPayments).to.equal(addressBook.getEntry('GraphPayments').address) + }) + + testIf(2)('should have PaymentsEscrow registered', async function () { + const paymentsEscrow = await Controller.getContractProxy(hre.ethers.keccak256(toUtf8Bytes('PaymentsEscrow'))) + expect(paymentsEscrow).to.equal(addressBook.getEntry('PaymentsEscrow').address) + }) + + it('should have EpochManager registered', async function () { + const epochManager = await Controller.getContractProxy(hre.ethers.keccak256(toUtf8Bytes('EpochManager'))) + expect(epochManager).to.equal(addressBook.getEntry('EpochManager').address) + }) + + it('should have RewardsManager registered', async function () { + const rewardsManager = await Controller.getContractProxy(hre.ethers.keccak256(toUtf8Bytes('RewardsManager'))) + expect(rewardsManager).to.equal(addressBook.getEntry('RewardsManager').address) + }) + + it('should have GraphTokenGateway registered', async function () { + const graphTokenGateway = await Controller.getContractProxy(hre.ethers.keccak256(toUtf8Bytes('GraphTokenGateway'))) + expect(graphTokenGateway).to.equal(addressBook.getEntry('L2GraphTokenGateway').address) + }) + + testIf(2)('should have GraphProxyAdmin registered', async function () { + const graphProxyAdmin = await Controller.getContractProxy(hre.ethers.keccak256(toUtf8Bytes('GraphProxyAdmin'))) + expect(graphProxyAdmin).to.equal(addressBook.getEntry('GraphProxyAdmin').address) + }) + + it('should have Curation registered', async function () { + const curation = await Controller.getContractProxy(hre.ethers.keccak256(toUtf8Bytes('Curation'))) + expect(curation).to.equal(addressBook.getEntry('L2Curation').address) + }) +}) diff --git a/packages/horizon/test/deployment/Curation.test.ts b/packages/horizon/test/deployment/Curation.test.ts new file mode 100644 index 000000000..c7dbc2b5b --- /dev/null +++ b/packages/horizon/test/deployment/Curation.test.ts @@ -0,0 +1,26 @@ +import hre from 'hardhat' + +import { expect } from 'chai' +import { graphProxyTests } from './lib/GraphProxy.test' +import { loadConfig } from '@graphprotocol/toolshed/hardhat' +import { testIf } from './lib/testIf' + +const config = loadConfig( + './ignition/configs/', + 'migrate', + String(process.env.TEST_DEPLOYMENT_CONFIG ?? hre.network.name), +).config +const graph = hre.graph() + +const graphProxyAdminAddressBookEntry = graph.horizon.addressBook.getEntry('GraphProxyAdmin') +const curationAddressBookEntry = graph.horizon.addressBook.getEntry('L2Curation') +const Curation = graph.horizon.contracts.L2Curation + +describe('Curation', function () { + testIf(4)('should set the right subgraph service', async function () { + const subgraphService = await Curation.subgraphService() + expect(subgraphService).to.equal(config.$global.subgraphServiceAddress) + }) +}) + +graphProxyTests('Curation', curationAddressBookEntry, graphProxyAdminAddressBookEntry.address) diff --git a/packages/horizon/test/deployment/GNS.test.ts b/packages/horizon/test/deployment/GNS.test.ts new file mode 100644 index 000000000..ee3b85f96 --- /dev/null +++ b/packages/horizon/test/deployment/GNS.test.ts @@ -0,0 +1,20 @@ +import hre from 'hardhat' + +import { expect } from 'chai' +import { graphProxyTests } from './lib/GraphProxy.test' + +const graph = hre.graph() + +const graphProxyAdminAddressBookEntry = graph.horizon.addressBook.getEntry('GraphProxyAdmin') +const gnsAddressBookEntry = graph.horizon.addressBook.getEntry('L2GNS') +const GNS = graph.horizon.contracts.L2GNS +const SubgraphNFT = graph.horizon.contracts.SubgraphNFT + +describe('GNS', function () { + it('should set the right subgraphNFT address', async function () { + const subgraphNFT = await GNS.subgraphNFT() + expect(subgraphNFT).to.equal(SubgraphNFT) + }) +}) + +graphProxyTests('GNS', gnsAddressBookEntry, graphProxyAdminAddressBookEntry.address) diff --git a/packages/horizon/test/deployment/GraphPayments.test.ts b/packages/horizon/test/deployment/GraphPayments.test.ts new file mode 100644 index 000000000..7014ce09f --- /dev/null +++ b/packages/horizon/test/deployment/GraphPayments.test.ts @@ -0,0 +1,30 @@ +import hre from 'hardhat' + +import { expect } from 'chai' +import { loadConfig } from '@graphprotocol/toolshed/hardhat' +import { testIf } from './lib/testIf' +import { transparentUpgradeableProxyTests } from './lib/TransparentUpgradeableProxy.tests' + +const config = loadConfig( + './ignition/configs/', + 'migrate', + String(process.env.TEST_DEPLOYMENT_CONFIG ?? hre.network.name), +).config +const graph = hre.graph() + +const addressBookEntry = graph.horizon.addressBook.getEntry('GraphPayments') +const GraphPayments = graph.horizon.contracts.GraphPayments + +describe('GraphPayments', function () { + testIf(3)('should set the right protocolPaymentCut', async function () { + const protocolPaymentCut = await GraphPayments.PROTOCOL_PAYMENT_CUT() + expect(protocolPaymentCut).to.equal(config.GraphPayments.protocolPaymentCut) + }) +}) + +transparentUpgradeableProxyTests( + 'GraphPayments', + addressBookEntry, + config.$global.governor as string, + Number(process.env.TEST_DEPLOYMENT_STEP ?? 1) >= 3, +) diff --git a/packages/horizon/test/deployment/GraphTallyCollector.test.ts b/packages/horizon/test/deployment/GraphTallyCollector.test.ts new file mode 100644 index 000000000..289f052c0 --- /dev/null +++ b/packages/horizon/test/deployment/GraphTallyCollector.test.ts @@ -0,0 +1,21 @@ +import hre from 'hardhat' + +import { expect } from 'chai' +import { loadConfig } from '@graphprotocol/toolshed/hardhat' +import { testIf } from './lib/testIf' + +const config = loadConfig( + './ignition/configs/', + 'migrate', + String(process.env.TEST_DEPLOYMENT_CONFIG ?? hre.network.name), +).config +const graph = hre.graph() + +const GraphTallyCollector = graph.horizon.contracts.GraphTallyCollector + +describe('GraphTallyCollector', function () { + testIf(3)('should set the right revokeSignerThawingPeriod', async function () { + const revokeSignerThawingPeriod = await GraphTallyCollector.REVOKE_AUTHORIZATION_THAWING_PERIOD() + expect(revokeSignerThawingPeriod).to.equal(config.GraphTallyCollector.revokeSignerThawingPeriod) + }) +}) diff --git a/packages/horizon/test/deployment/HorizonStaking.test.ts b/packages/horizon/test/deployment/HorizonStaking.test.ts new file mode 100644 index 000000000..4d80ec057 --- /dev/null +++ b/packages/horizon/test/deployment/HorizonStaking.test.ts @@ -0,0 +1,48 @@ +import hre from 'hardhat' + +import { assert, expect } from 'chai' +import { graphProxyTests } from './lib/GraphProxy.test' +import { loadConfig } from '@graphprotocol/toolshed/hardhat' +import { testIf } from './lib/testIf' + +const config = loadConfig( + './ignition/configs/', + 'migrate', + String(process.env.TEST_DEPLOYMENT_CONFIG ?? hre.network.name), +).config +const graph = hre.graph() + +const horizonStakingAddressBookEntry = graph.horizon.addressBook.getEntry('HorizonStaking') +const HorizonStaking = graph.horizon.contracts.HorizonStaking +const graphProxyAdminAddressBookEntry = graph.horizon.addressBook.getEntry('GraphProxyAdmin') + +describe('HorizonStaking', function () { + testIf(4)('should set the right maxThawingPeriod', async function () { + const maxThawingPeriod = await HorizonStaking.getMaxThawingPeriod() + expect(maxThawingPeriod).to.equal(config.$global.maxThawingPeriod) + }) + + testIf(4)('should set delegationSlashingEnabled to false', async function () { + const delegationSlashingEnabled = await HorizonStaking.isDelegationSlashingEnabled() + expect(delegationSlashingEnabled).to.equal(false) + }) + + testIf(4)('should set a non zero thawing period', async function () { + if (process.env.IGNITION_DEPLOYMENT_TYPE === 'protocol') { + assert.fail('Deployment type "protocol": no historical state available') + } + const thawingPeriod = await HorizonStaking.__DEPRECATED_getThawingPeriod() + expect(thawingPeriod).to.not.equal(0) + }) + + it.skip('should set the right staking extension address') + + testIf(4)('should set the right subgraph data service address', async function () { + const subgraphDataServiceAddress = await HorizonStaking.getSubgraphService() + expect(subgraphDataServiceAddress).to.equal(config.$global.subgraphServiceAddress) + }) + + it.skip('should set the right allowed lock verifiers') +}) + +graphProxyTests('HorizonStaking', horizonStakingAddressBookEntry, graphProxyAdminAddressBookEntry.address) diff --git a/packages/horizon/test/deployment/PaymentsEscrow.test.ts b/packages/horizon/test/deployment/PaymentsEscrow.test.ts new file mode 100644 index 000000000..b930f4dc5 --- /dev/null +++ b/packages/horizon/test/deployment/PaymentsEscrow.test.ts @@ -0,0 +1,30 @@ +import hre from 'hardhat' + +import { expect } from 'chai' +import { loadConfig } from '@graphprotocol/toolshed/hardhat' +import { testIf } from './lib/testIf' +import { transparentUpgradeableProxyTests } from './lib/TransparentUpgradeableProxy.tests' + +const config = loadConfig( + './ignition/configs/', + 'migrate', + String(process.env.TEST_DEPLOYMENT_CONFIG ?? hre.network.name), +).config +const graph = hre.graph() + +const addressBookEntry = graph.horizon.addressBook.getEntry('PaymentsEscrow') +const PaymentsEscrow = graph.horizon.contracts.PaymentsEscrow + +describe('PaymentsEscrow', function () { + testIf(3)('should set the right withdrawEscrowThawingPeriod', async function () { + const withdrawEscrowThawingPeriod = await PaymentsEscrow.WITHDRAW_ESCROW_THAWING_PERIOD() + expect(withdrawEscrowThawingPeriod).to.equal(config.PaymentsEscrow.withdrawEscrowThawingPeriod) + }) +}) + +transparentUpgradeableProxyTests( + 'PaymentsEscrow', + addressBookEntry, + config.$global.governor as string, + Number(process.env.TEST_DEPLOYMENT_STEP ?? 1) >= 3, +) diff --git a/packages/horizon/test/deployment/RewardsManager.test.ts b/packages/horizon/test/deployment/RewardsManager.test.ts new file mode 100644 index 000000000..72b202be6 --- /dev/null +++ b/packages/horizon/test/deployment/RewardsManager.test.ts @@ -0,0 +1,25 @@ +import hre from 'hardhat' + +import { expect } from 'chai' +import { graphProxyTests } from './lib/GraphProxy.test' +import { loadConfig } from '@graphprotocol/toolshed/hardhat' +import { testIf } from './lib/testIf' +const config = loadConfig( + './ignition/configs/', + 'migrate', + String(process.env.TEST_DEPLOYMENT_CONFIG ?? hre.network.name), +).config +const graph = hre.graph() + +const graphProxyAdminAddressBookEntry = graph.horizon.addressBook.getEntry('GraphProxyAdmin') +const rewardsManagerAddressBookEntry = graph.horizon.addressBook.getEntry('RewardsManager') +const RewardsManager = graph.horizon.contracts.RewardsManager + +describe('RewardsManager', function () { + testIf(4)('should set the right subgraph service', async function () { + const subgraphService = await RewardsManager.subgraphService() + expect(subgraphService).to.equal(config.$global.subgraphServiceAddress) + }) +}) + +graphProxyTests('RewardsManager', rewardsManagerAddressBookEntry, graphProxyAdminAddressBookEntry.address) diff --git a/packages/horizon/test/deployment/lib/GraphProxy.test.ts b/packages/horizon/test/deployment/lib/GraphProxy.test.ts new file mode 100644 index 000000000..efd26cdd0 --- /dev/null +++ b/packages/horizon/test/deployment/lib/GraphProxy.test.ts @@ -0,0 +1,22 @@ +import hre from 'hardhat' + +import { assert, expect } from 'chai' +import { AddressBookEntry } from '@graphprotocol/toolshed/deployments' +import { zeroPadValue } from 'ethers' + +export function graphProxyTests(contractName: string, addressBookEntry: AddressBookEntry, proxyAdmin: string): void { + describe(`${contractName}: GraphProxy`, function () { + it('should target the correct implementation', async function () { + const implementation = await hre.ethers.provider.getStorage(addressBookEntry.address, '0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc') + if (!addressBookEntry.implementation) { + assert.fail('Implementation address is not set') + } + expect(implementation).to.equal(zeroPadValue(addressBookEntry.implementation, 32)) + }) + + it('should be owned by the proxy admin', async function () { + const admin = await hre.ethers.provider.getStorage(addressBookEntry.address, '0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103') + expect(admin).to.equal(zeroPadValue(proxyAdmin, 32)) + }) + }) +} diff --git a/packages/horizon/test/deployment/lib/TransparentUpgradeableProxy.tests.ts b/packages/horizon/test/deployment/lib/TransparentUpgradeableProxy.tests.ts new file mode 100644 index 000000000..49bd6b1e0 --- /dev/null +++ b/packages/horizon/test/deployment/lib/TransparentUpgradeableProxy.tests.ts @@ -0,0 +1,58 @@ +import hre from 'hardhat' + +import { assert, expect } from 'chai' +import { AddressBookEntry } from '@graphprotocol/toolshed/deployments' +import { zeroPadValue } from 'ethers' + +export function transparentUpgradeableProxyTests(contractName: string, addressBookEntry: AddressBookEntry, owner: string, upgraded: boolean): void { + const testIf = () => (upgraded ? it : it.skip) + + describe(`${contractName}: implementation`, function () { + testIf()('should be locked for initialization', async function () { + if (!addressBookEntry.implementation) { + assert.fail('Implementation address is not set') + } + const initialized = await hre.ethers.provider.getStorage(addressBookEntry.implementation, '0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00') + expect(initialized).to.equal(zeroPadValue('0xffffffffffffffff', 32)) + }) + }) + + describe(`${contractName}: TransparentUpgradeableProxy`, function () { + testIf()('should be initialized', async function () { + // https://github.com/OpenZeppelin/openzeppelin-contracts/blob/dbb6104ce834628e473d2173bbc9d47f81a9eec3/contracts/proxy/utils/Initializable.sol#L77 + const initialized = await hre.ethers.provider.getStorage(addressBookEntry.address, '0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00') + expect(initialized).to.equal(zeroPadValue('0x01', 32)) + }) + + testIf()('should target the correct implementation', async function () { + // https:// github.com/OpenZeppelin/openzeppelin-contracts/blob/dbb6104ce834628e473d2173bbc9d47f81a9eec3/contracts/proxy/ERC1967/ERC1967Utils.sol#L37C53-L37C119 + const implementation = await hre.ethers.provider.getStorage(addressBookEntry.address, '0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc') + if (!addressBookEntry.implementation) { + assert.fail('Implementation address is not set') + } + expect(implementation).to.equal(zeroPadValue(addressBookEntry.implementation, 32)) + }) + + it('should be owned by the proxy admin', async function () { + // https://github.com/OpenZeppelin/openzeppelin-contracts/blob/dbb6104ce834628e473d2173bbc9d47f81a9eec3/contracts/proxy/ERC1967/ERC1967Utils.sol#L99 + const admin = await hre.ethers.provider.getStorage(addressBookEntry.address, '0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103') + if (!addressBookEntry.proxyAdmin) { + assert.fail('Proxy admin address is not set') + } + expect(admin).to.equal(zeroPadValue(addressBookEntry.proxyAdmin, 32)) + }) + }) + + describe(`${contractName}: ProxyAdmin`, function () { + testIf()('should be owned by the governor', async function () { + if (process.env.IGNITION_DEPLOYMENT_TYPE === 'protocol') { + assert.fail('Deployment type "protocol": unknown governor address') + } + if (!addressBookEntry.proxyAdmin) { + assert.fail('Proxy admin address is not set') + } + const ownerStorage = await hre.ethers.provider.getStorage(addressBookEntry.proxyAdmin, 0) + expect(ownerStorage).to.equal(zeroPadValue(owner, 32)) + }) + }) +} diff --git a/packages/horizon/test/deployment/lib/testIf.ts b/packages/horizon/test/deployment/lib/testIf.ts new file mode 100644 index 000000000..a3863326c --- /dev/null +++ b/packages/horizon/test/deployment/lib/testIf.ts @@ -0,0 +1,4 @@ +const currentStep = Number(process.env.TEST_DEPLOYMENT_STEP ?? 1) +const testIf = (stepRequired: number) => (stepRequired <= currentStep ? it : it.skip) + +export { testIf } diff --git a/packages/horizon/test/integration/after-delegation-slashing-enabled/add-to-delegation-pool.test.ts b/packages/horizon/test/integration/after-delegation-slashing-enabled/add-to-delegation-pool.test.ts new file mode 100644 index 000000000..4a1ee683a --- /dev/null +++ b/packages/horizon/test/integration/after-delegation-slashing-enabled/add-to-delegation-pool.test.ts @@ -0,0 +1,97 @@ +import hre from 'hardhat' + +import { ethers } from 'hardhat' +import { expect } from 'chai' +import { ONE_MILLION } from '@graphprotocol/toolshed' +import { setGRTBalance } from '@graphprotocol/toolshed/hardhat' + +import type { HardhatEthersSigner } from '@nomicfoundation/hardhat-ethers/signers' + +describe('Add to delegation pool', () => { + let serviceProvider: HardhatEthersSigner + let delegator: HardhatEthersSigner + let signer: HardhatEthersSigner + let verifier: HardhatEthersSigner + let newVerifier: HardhatEthersSigner + let snapshotId: string + + const maxVerifierCut = 1000000n + const thawingPeriod = 2419200n // 28 days + const tokens = ethers.parseEther('100000') + const delegationTokens = ethers.parseEther('1000') + + const graph = hre.graph() + const { stake, delegate, addToDelegationPool } = graph.horizon.actions + const horizonStaking = graph.horizon.contracts.HorizonStaking + const graphToken = graph.horizon.contracts.L2GraphToken + + before(async () => { + [serviceProvider, delegator, verifier, newVerifier, signer] = await graph.accounts.getTestAccounts() + + await setGRTBalance(graph.provider, graphToken.target, serviceProvider.address, ONE_MILLION) + await setGRTBalance(graph.provider, graphToken.target, delegator.address, ONE_MILLION) + await setGRTBalance(graph.provider, graphToken.target, signer.address, ONE_MILLION) + }) + + beforeEach(async () => { + // Take a snapshot before each test + snapshotId = await ethers.provider.send('evm_snapshot', []) + + // Service provider stake + await stake(serviceProvider, [tokens]) + + // Create provision + const provisionTokens = ethers.parseEther('1000') + await horizonStaking.connect(serviceProvider).provision(serviceProvider.address, verifier.address, provisionTokens, maxVerifierCut, thawingPeriod) + + // Initialize delegation pool + await delegate(delegator, [serviceProvider.address, verifier.address, delegationTokens, 0n]) + }) + + afterEach(async () => { + // Revert to the snapshot after each test + await ethers.provider.send('evm_revert', [snapshotId]) + }) + + it('should recover delegation pool from invalid state by adding tokens', async () => { + // Send eth to new verifier to cover gas fees + await serviceProvider.sendTransaction({ + to: newVerifier.address, + value: ethers.parseEther('0.1'), + }) + + // Create a provision for the new verifier + const newVerifierProvisionTokens = ethers.parseEther('1000') + await horizonStaking.connect(serviceProvider).provision(serviceProvider.address, newVerifier.address, newVerifierProvisionTokens, maxVerifierCut, thawingPeriod) + + // Initialize delegation pool + const initialDelegation = ethers.parseEther('1000') + await delegate(delegator, [serviceProvider.address, newVerifier.address, initialDelegation, 0n]) + + const poolBefore = await horizonStaking.getDelegationPool(serviceProvider.address, newVerifier.address) + + // Slash entire provision (service provider tokens + delegation pool tokens) + const slashTokens = newVerifierProvisionTokens + initialDelegation + const tokensVerifier = newVerifierProvisionTokens / 2n + await horizonStaking.connect(newVerifier).slash(serviceProvider.address, slashTokens, tokensVerifier, newVerifier.address) + + // Delegating should revert since pool.tokens == 0 and pool.shares != 0 + const delegateTokens = ethers.parseEther('500') + await graphToken.connect(delegator).approve(horizonStaking.target, delegateTokens) + await expect( + horizonStaking.connect(delegator)['delegate(address,address,uint256,uint256)'](serviceProvider.address, newVerifier.address, delegateTokens, 0n), + ).to.be.revertedWithCustomError(horizonStaking, 'HorizonStakingInvalidDelegationPoolState') + + // Add tokens to the delegation pool to recover the pool + const recoverPoolTokens = ethers.parseEther('500') + await addToDelegationPool(signer, [serviceProvider.address, newVerifier.address, recoverPoolTokens]) + + // Verify delegation pool is recovered + const poolAfter = await horizonStaking.getDelegationPool(serviceProvider.address, newVerifier.address) + expect(poolAfter.tokens).to.equal(recoverPoolTokens, 'Pool tokens should be recovered') + expect(poolAfter.shares).to.equal(poolBefore.shares, 'Pool shares should remain the same') + + // Delegation should now succeed + await delegate(delegator, [serviceProvider.address, newVerifier.address, delegateTokens, 0n]) + }) +}) diff --git a/packages/horizon/test/integration/after-delegation-slashing-enabled/slasher.test.ts b/packages/horizon/test/integration/after-delegation-slashing-enabled/slasher.test.ts new file mode 100644 index 000000000..34bece2dd --- /dev/null +++ b/packages/horizon/test/integration/after-delegation-slashing-enabled/slasher.test.ts @@ -0,0 +1,108 @@ +import hre from 'hardhat' + +import { ethers } from 'hardhat' +import { expect } from 'chai' +import { ONE_MILLION } from '@graphprotocol/toolshed' +import { setGRTBalance } from '@graphprotocol/toolshed/hardhat' + +import type { HardhatEthersSigner } from '@nomicfoundation/hardhat-ethers/signers' + +describe('Slasher', () => { + let snapshotId: string + let serviceProvider: HardhatEthersSigner + let delegator: HardhatEthersSigner + let verifier: HardhatEthersSigner + let verifierDestination: string + + const maxVerifierCut = 1000000n // 100% + const thawingPeriod = 2419200n // 28 days + const provisionTokens = ethers.parseEther('10000') + const delegationTokens = ethers.parseEther('1000') + + const graph = hre.graph() + const { provision, delegate } = graph.horizon.actions + const horizonStaking = graph.horizon.contracts.HorizonStaking + const graphToken = graph.horizon.contracts.L2GraphToken + + before(async () => { + [serviceProvider, delegator, verifier] = await graph.accounts.getTestAccounts() + verifierDestination = ethers.Wallet.createRandom().address + await setGRTBalance(graph.provider, graphToken.target, serviceProvider.address, ONE_MILLION) + await setGRTBalance(graph.provider, graphToken.target, delegator.address, ONE_MILLION) + }) + + beforeEach(async () => { + // Take a snapshot before each test + snapshotId = await ethers.provider.send('evm_snapshot', []) + // Check that delegation slashing is enabled + const delegationSlashingEnabled = await horizonStaking.isDelegationSlashingEnabled() + expect(delegationSlashingEnabled).to.be.equal(true, 'Delegation slashing should be enabled') + + // Send funds to delegator + await graphToken.connect(serviceProvider).transfer(delegator.address, delegationTokens * 3n) + // Create provision + await provision(serviceProvider, [serviceProvider.address, verifier.address, provisionTokens, maxVerifierCut, thawingPeriod]) + + // Initialize delegation pool if it does not exist + await delegate(delegator, [serviceProvider.address, verifier.address, delegationTokens, 0n]) + + // Send eth to verifier to cover gas fees + await serviceProvider.sendTransaction({ + to: verifier.address, + value: ethers.parseEther('0.1'), + }) + }) + + afterEach(async () => { + // Revert to the snapshot after each test + await ethers.provider.send('evm_revert', [snapshotId]) + }) + + it('should slash service provider and delegation pool tokens', async () => { + const provisionBefore = await horizonStaking.getProvision(serviceProvider.address, verifier.address) + const poolBefore = await horizonStaking.getDelegationPool(serviceProvider.address, verifier.address) + const slashTokens = provisionBefore.tokens + poolBefore.tokens / 2n + const tokensVerifier = slashTokens / 2n + + // Slash the provision for all service provider and half of the delegation pool tokens + await horizonStaking.connect(verifier).slash(serviceProvider.address, slashTokens, tokensVerifier, verifierDestination) + + // Verify provision tokens should be slashed completely + const provisionAfter = await horizonStaking.getProvision(serviceProvider.address, verifier.address) + expect(provisionAfter.tokens).to.be.equal(0, 'Provision tokens should be slashed completely') + + // Verify the remaining half of the delegation pool tokens are not slashed + const poolAfter = await horizonStaking.getDelegationPool(serviceProvider.address, verifier.address) + expect(poolAfter.tokens).to.be.equal(poolBefore.tokens / 2n, 'Delegation pool tokens should be slashed') + expect(poolAfter.shares).to.equal(poolBefore.shares, 'Delegation pool shares should remain the same') + }) + + it('should handle delegation operations after complete provision is completely slashed', async () => { + const provisionBefore = await horizonStaking.getProvision(serviceProvider.address, verifier.address) + const poolBefore = await horizonStaking.getDelegationPool(serviceProvider.address, verifier.address) + const slashTokens = provisionBefore.tokens + poolBefore.tokens + const tokensVerifier = slashTokens / 2n + + // Slash the provision for all service provider and delegation pool tokens + await horizonStaking.connect(verifier).slash(serviceProvider.address, slashTokens, tokensVerifier, verifierDestination) + + const delegateAmount = ethers.parseEther('100') + const undelegateShares = ethers.parseEther('50') + + // Try to delegate to slashed pool + await graphToken.connect(delegator).approve(horizonStaking.target, delegateAmount) + await expect( + horizonStaking.connect(delegator)['delegate(address,address,uint256,uint256)'](serviceProvider.address, verifier.address, delegateAmount, 0n), + ).to.be.revertedWithCustomError(horizonStaking, 'HorizonStakingInvalidDelegationPoolState') + + // Try to undelegate from slashed pool + await expect( + horizonStaking.connect(delegator)['undelegate(address,address,uint256)'](serviceProvider.address, verifier.address, undelegateShares), + ).to.be.revertedWithCustomError(horizonStaking, 'HorizonStakingInvalidDelegationPoolState') + + // Try to withdraw from slashed pool + await expect( + horizonStaking.connect(delegator)['withdrawDelegated(address,address,uint256)'](serviceProvider.address, verifier.address, 1n), + ).to.be.revertedWithCustomError(horizonStaking, 'HorizonStakingInvalidDelegationPoolState') + }) +}) diff --git a/packages/horizon/test/integration/after-transition-period/add-to-delegation-pool.test.ts b/packages/horizon/test/integration/after-transition-period/add-to-delegation-pool.test.ts new file mode 100644 index 000000000..a56cb2cc8 --- /dev/null +++ b/packages/horizon/test/integration/after-transition-period/add-to-delegation-pool.test.ts @@ -0,0 +1,82 @@ +import hre from 'hardhat' + +import { ethers } from 'hardhat' +import { expect } from 'chai' +import { ONE_MILLION } from '@graphprotocol/toolshed' +import { setGRTBalance } from '@graphprotocol/toolshed/hardhat' + +import type { HardhatEthersSigner } from '@nomicfoundation/hardhat-ethers/signers' + +describe('Add to delegation pool', () => { + let serviceProvider: HardhatEthersSigner + let delegator: HardhatEthersSigner + let signer: HardhatEthersSigner + let verifier: string + + const maxVerifierCut = 1000000n + const thawingPeriod = 2419200n // 28 days + const tokens = ethers.parseEther('100000') + const delegationTokens = ethers.parseEther('1000') + + const graph = hre.graph() + const { stake, delegate, addToDelegationPool, provision } = graph.horizon.actions + const horizonStaking = graph.horizon.contracts.HorizonStaking + const graphToken = graph.horizon.contracts.L2GraphToken + + before(async () => { + [serviceProvider, delegator, signer] = await graph.accounts.getTestAccounts() + await setGRTBalance(graph.provider, graphToken.target, serviceProvider.address, ONE_MILLION) + await setGRTBalance(graph.provider, graphToken.target, delegator.address, ONE_MILLION) + verifier = ethers.Wallet.createRandom().address + + // Service provider stake + await stake(serviceProvider, [tokens]) + + // Create provision + const provisionTokens = ethers.parseEther('1000') + await horizonStaking.connect(serviceProvider).provision(serviceProvider.address, verifier, provisionTokens, maxVerifierCut, thawingPeriod) + + // Send funds to delegator and signer + await graphToken.connect(serviceProvider).transfer(delegator.address, tokens) + await graphToken.connect(serviceProvider).transfer(signer.address, tokens) + + // Initialize delegation pool + await delegate(delegator, [serviceProvider.address, verifier, delegationTokens, 0n]) + }) + + it('should add tokens to an existing delegation pool', async () => { + const poolBefore = await horizonStaking.getDelegationPool(serviceProvider.address, verifier) + const addTokens = ethers.parseEther('500') + + // Add tokens to the delegation pool + await addToDelegationPool(signer, [serviceProvider.address, verifier, addTokens]) + + // Verify tokens were added to the pool + const poolAfter = await horizonStaking.getDelegationPool(serviceProvider.address, verifier) + expect(poolAfter.tokens).to.equal(poolBefore.tokens + addTokens, 'Pool tokens should increase') + expect(poolAfter.shares).to.equal(poolBefore.shares, 'Pool shares should remain the same') + }) + + it('should revert when adding tokens to a non-existent provision', async () => { + const invalidVerifier = await ethers.Wallet.createRandom().getAddress() + const addTokens = ethers.parseEther('500') + + // Attempt to add tokens to a non-existent provision + await expect( + horizonStaking.connect(signer).addToDelegationPool(serviceProvider.address, invalidVerifier, addTokens), + ).to.be.revertedWithCustomError(horizonStaking, 'HorizonStakingInvalidProvision') + }) + + it('should revert when adding tokens to a provision with zero shares in delegation pool', async () => { + // Create new provision without any delegations + const newVerifier = await ethers.Wallet.createRandom().getAddress() + const newVerifierProvisionTokens = ethers.parseEther('1000') + await provision(serviceProvider, [serviceProvider.address, newVerifier, newVerifierProvisionTokens, maxVerifierCut, thawingPeriod]) + + // Attempt to add tokens to the new provision + const addTokens = ethers.parseEther('500') + await expect( + horizonStaking.connect(signer).addToDelegationPool(serviceProvider.address, newVerifier, addTokens), + ).to.be.revertedWithCustomError(horizonStaking, 'HorizonStakingInvalidDelegationPool') + }) +}) diff --git a/packages/horizon/test/integration/after-transition-period/delegator.test.ts b/packages/horizon/test/integration/after-transition-period/delegator.test.ts new file mode 100644 index 000000000..3e2ca3ccb --- /dev/null +++ b/packages/horizon/test/integration/after-transition-period/delegator.test.ts @@ -0,0 +1,363 @@ +import hre from 'hardhat' + +import { ONE_MILLION, ZERO_ADDRESS } from '@graphprotocol/toolshed' +import { delegators } from '../../../tasks/test/fixtures/delegators' +import { ethers } from 'hardhat' +import { expect } from 'chai' +import { setGRTBalance } from '@graphprotocol/toolshed/hardhat' + +import type { HardhatEthersSigner } from '@nomicfoundation/hardhat-ethers/signers' + +describe('Delegator', () => { + let delegator: HardhatEthersSigner + let serviceProvider: HardhatEthersSigner + let newServiceProvider: HardhatEthersSigner + let verifier: string + let newVerifier: string + let snapshotId: string + const maxVerifierCut = 1000000n + const thawingPeriod = 2419200n // 28 days + const tokens = ethers.parseEther('100000') + + // Subgraph service address is not set for integration tests + const subgraphServiceAddress = '0x0000000000000000000000000000000000000000' + const graph = hre.graph() + const { provision, delegate } = graph.horizon.actions + const horizonStaking = graph.horizon.contracts.HorizonStaking + const graphToken = graph.horizon.contracts.L2GraphToken + + before(async () => { + [serviceProvider, delegator, newServiceProvider] = await graph.accounts.getTestAccounts() + verifier = ethers.Wallet.createRandom().address + newVerifier = ethers.Wallet.createRandom().address + await setGRTBalance(graph.provider, graphToken.target, delegator.address, ONE_MILLION) + await setGRTBalance(graph.provider, graphToken.target, newServiceProvider.address, ONE_MILLION) + }) + + beforeEach(async () => { + // Take a snapshot before each test + snapshotId = await ethers.provider.send('evm_snapshot', []) + + // Create provision + await provision(serviceProvider, [serviceProvider.address, verifier, tokens, maxVerifierCut, thawingPeriod]) + + // Send GRT to delegator and new service provider to use for delegation and staking + await graphToken.connect(serviceProvider).transfer(delegator.address, tokens) + await graphToken.connect(serviceProvider).transfer(newServiceProvider.address, tokens) + }) + + afterEach(async () => { + // Revert to the snapshot after each test + await ethers.provider.send('evm_revert', [snapshotId]) + }) + + describe('New Protocol Users', () => { + it('should allow delegator to delegate to a service provider and verifier, undelegate and withdraw tokens', async () => { + const delegatorBalanceBefore = await graphToken.balanceOf(delegator.address) + const delegationTokens = ethers.parseEther('1000') + + // Delegate tokens to the service provider and verifier + await delegate(delegator, [serviceProvider.address, verifier, delegationTokens, 0n]) + + // Verify delegation tokens were added to the delegation pool + const delegationPool = await horizonStaking.getDelegationPool( + serviceProvider.address, + verifier, + ) + expect(delegationPool.tokens).to.equal(delegationTokens, 'Delegation tokens were not added to the delegation pool') + + // Verify delegation shares were minted, since it's the first delegation + // shares should be equal to tokens + const delegation = await horizonStaking.getDelegation( + serviceProvider.address, + verifier, + delegator.address, + ) + expect(delegation.shares).to.equal(delegationTokens, 'Delegation shares were not minted correctly') + + // Undelegate tokens + await horizonStaking.connect(delegator)['undelegate(address,address,uint256)'](serviceProvider.address, verifier, delegationTokens) + + // Wait for thawing period + await ethers.provider.send('evm_increaseTime', [Number(thawingPeriod)]) + await ethers.provider.send('evm_mine', []) + + // Withdraw tokens + await horizonStaking.connect(delegator)['withdrawDelegated(address,address,uint256)'](serviceProvider.address, verifier, 1n) + + // Delegator should have received their tokens back + expect(await graphToken.balanceOf(delegator.address)).to.equal(delegatorBalanceBefore, 'Delegator balance should be the same as before delegation') + }) + + it('should revert when delegating to an invalid provision', async () => { + const delegateTokens = ethers.parseEther('1000') + const invalidVerifier = await ethers.Wallet.createRandom().getAddress() + + await graphToken.connect(delegator).approve(horizonStaking.target, delegateTokens) + await expect( + horizonStaking.connect(delegator)['delegate(address,address,uint256,uint256)'](serviceProvider.address, invalidVerifier, delegateTokens, 0n), + ).to.be.revertedWithCustomError(horizonStaking, 'HorizonStakingInvalidProvision') + }) + + it('should revert when delegating less than minimum delegation', async () => { + const minDelegation = ethers.parseEther('1') + + await graphToken.connect(delegator).approve(horizonStaking.target, minDelegation - 1n) + await expect( + horizonStaking.connect(delegator)['delegate(address,address,uint256,uint256)'](serviceProvider.address, verifier, minDelegation - 1n, 0n), + ).to.be.revertedWithCustomError(horizonStaking, 'HorizonStakingInsufficientDelegationTokens') + }) + + describe('Delegation pool already exists', () => { + const newProvisionTokens = ethers.parseEther('10000') + const delegationPoolTokens = ethers.parseEther('1000') + + beforeEach(async () => { + // Delegate tokens to initialize the delegation pool + await delegate(delegator, [serviceProvider.address, verifier, delegationPoolTokens, 0n]) + + // Create new provision for a new service provider and verifier combo + await provision(newServiceProvider, [newServiceProvider.address, newVerifier, newProvisionTokens, maxVerifierCut, thawingPeriod]) + }) + + it('should allow delegator to undelegate and redelegate to new provider and verifier', async () => { + // Undelegate 20% of delegator's shares + const delegation = await horizonStaking.getDelegation( + serviceProvider.address, + verifier, + delegator.address, + ) + const undelegateShares = delegation.shares / 5n + + await horizonStaking.connect(delegator)['undelegate(address,address,uint256)'](serviceProvider.address, verifier, undelegateShares) + + // Wait for thawing period + await ethers.provider.send('evm_increaseTime', [Number(thawingPeriod)]) + await ethers.provider.send('evm_mine', []) + + await delegate(delegator, [newServiceProvider.address, newVerifier, undelegateShares, 0n]) + + // Verify delegation shares were transferred to the new service provider + const delegationPool = await horizonStaking.getDelegationPool( + newServiceProvider.address, + newVerifier, + ) + expect(delegationPool.tokens).to.equal(undelegateShares, 'Delegation tokens were not transferred to the new service provider') + + const newDelegation = await horizonStaking.getDelegation( + newServiceProvider.address, + newVerifier, + delegator.address, + ) + expect(newDelegation.shares).to.equal(undelegateShares, 'Delegation shares were not transferred to the new service provider') + }) + + it('should handle multiple undelegations with nThawRequests = 0', async () => { + const delegatorBalanceBefore = await graphToken.balanceOf(delegator.address) + const delegationPool = await horizonStaking.getDelegationPool( + serviceProvider.address, + verifier, + ) + + const delegation = await horizonStaking.getDelegation( + serviceProvider.address, + verifier, + delegator.address, + ) + const undelegateShares = delegation.shares / 10n + + let totalExpectedTokens = 0n + let remainingShares = delegation.shares + let remainingPoolTokens = delegationPool.tokens + + // Undelegate shares in 3 different transactions + for (let i = 0; i < 3; i++) { + const tokensOut = (undelegateShares * remainingPoolTokens) / remainingShares + totalExpectedTokens += tokensOut + + await horizonStaking.connect(delegator)['undelegate(address,address,uint256)'](serviceProvider.address, verifier, undelegateShares) + + remainingShares -= undelegateShares + remainingPoolTokens -= tokensOut + } + + // Wait for thawing period + await ethers.provider.send('evm_increaseTime', [Number(thawingPeriod)]) + await ethers.provider.send('evm_mine', []) + + // Withdraw all thaw requests + await horizonStaking.connect(delegator)['withdrawDelegated(address,address,uint256)'](serviceProvider.address, verifier, 0n) + + // Verify tokens were transferred to delegator + expect(await graphToken.balanceOf(delegator.address)) + .to.equal(delegatorBalanceBefore + totalExpectedTokens, 'Delegator balance should be the same as before delegation') + }) + + it('should handle multiple undelegations with nThawRequests = 1', async () => { + const delegatorBalanceBefore = await graphToken.balanceOf(delegator.address) + const delegationPool = await horizonStaking.getDelegationPool( + serviceProvider.address, + verifier, + ) + + const delegation = await horizonStaking.getDelegation( + serviceProvider.address, + verifier, + delegator.address, + ) + const undelegateShares = delegation.shares / 10n + + let totalExpectedTokens = 0n + let remainingShares = delegation.shares + let remainingPoolTokens = delegationPool.tokens + + // Undelegate shares in 3 different transactions + for (let i = 0; i < 3; i++) { + const tokensOut = (undelegateShares * remainingPoolTokens) / remainingShares + totalExpectedTokens += tokensOut + + await horizonStaking.connect(delegator)['undelegate(address,address,uint256)'](serviceProvider.address, verifier, undelegateShares) + + remainingShares -= undelegateShares + remainingPoolTokens -= tokensOut + } + + // Wait for thawing period + await ethers.provider.send('evm_increaseTime', [Number(thawingPeriod)]) + await ethers.provider.send('evm_mine', []) + + // Withdraw each thaw request individually + for (let i = 0; i < 3; i++) { + await horizonStaking.connect(delegator)['withdrawDelegated(address,address,uint256)'](serviceProvider.address, verifier, 1n) + } + + // Verify tokens were transferred to delegator + expect(await graphToken.balanceOf(delegator.address)) + .to.equal(delegatorBalanceBefore + totalExpectedTokens, 'Delegator balance should be the same as before delegation') + }) + + it('should not revert when withdrawing before thawing period', async () => { + const delegatorBalanceBefore = await graphToken.balanceOf(delegator.address) + const delegation = await horizonStaking.getDelegation( + serviceProvider.address, + verifier, + delegator.address, + ) + const undelegateShares = delegation.shares / 10n + + await horizonStaking.connect(delegator)['undelegate(address,address,uint256)'](serviceProvider.address, verifier, undelegateShares) + + await expect( + horizonStaking.connect(delegator)['withdrawDelegated(address,address,uint256)'](serviceProvider.address, verifier, 1n), + ).to.not.be.reverted + + // Verify tokens were not transferred to delegator + expect(await graphToken.balanceOf(delegator.address)) + .to.equal(delegatorBalanceBefore, 'Delegator balance should be the same as before delegation') + }) + }) + }) + + describe('Existing Protocol Users', () => { + let indexer: HardhatEthersSigner + let existingDelegator: HardhatEthersSigner + let delegatedTokens: bigint + + let snapshotId: string + + before(async () => { + // Get indexer + indexer = await ethers.getSigner(delegators[0].delegations[0].indexerAddress) + + // Get delegator + existingDelegator = await ethers.getSigner(delegators[0].address) + + await setGRTBalance(graph.provider, graphToken.target, indexer.address, ONE_MILLION) + await setGRTBalance(graph.provider, graphToken.target, existingDelegator.address, ONE_MILLION) + + // Get delegated tokens + delegatedTokens = delegators[0].delegations[0].tokens + }) + + beforeEach(async () => { + // Take a snapshot before each test + snapshotId = await ethers.provider.send('evm_snapshot', []) + }) + + afterEach(async () => { + // Revert to the snapshot after each test + await ethers.provider.send('evm_revert', [snapshotId]) + }) + + it('should be able to undelegate and withdraw tokens after the transition period', async () => { + // Get delegator's delegation + const delegation = await horizonStaking.getDelegation( + indexer.address, + subgraphServiceAddress, + existingDelegator.address, + ) + + // Undelegate tokens + await horizonStaking.connect(existingDelegator)['undelegate(address,address,uint256)'](indexer.address, subgraphServiceAddress, delegation.shares) + + // Wait for thawing period + await ethers.provider.send('evm_increaseTime', [Number(thawingPeriod) + 1]) + await ethers.provider.send('evm_mine', []) + + // Get delegator balance before withdrawing + const balanceBefore = await graphToken.balanceOf(existingDelegator.address) + + // Withdraw tokens + await horizonStaking.connect(existingDelegator)['withdrawDelegated(address,address,uint256)'](indexer.address, subgraphServiceAddress, 1n) + + // Get delegator balance after withdrawing + const balanceAfter = await graphToken.balanceOf(existingDelegator.address) + + // Expected balance after is the balance before plus the tokens minus the 0.5% delegation tax + // because the delegation was before the horizon upgrade, after the upgrade there is no tax + const expectedBalanceAfter = balanceBefore + delegatedTokens - (delegatedTokens * 5000n / 1000000n) + + // Verify tokens were transferred to delegator + expect(balanceAfter).to.equal(expectedBalanceAfter, 'Tokens were not transferred to delegator') + }) + + describe('Undelegated before horizon upgrade', () => { + before(async () => { + const delegatorFixture = delegators[2] + const delegationFixture = delegatorFixture.delegations[0] + + // Get signers + indexer = await ethers.getSigner(delegationFixture.indexerAddress) + existingDelegator = await ethers.getSigner(delegatorFixture.address) + await setGRTBalance(graph.provider, graphToken.target, indexer.address, ONE_MILLION) + + // Verify delegator is undelegated + expect(delegatorFixture.undelegate).to.be.true + }) + + it('should allow delegator to withdraw tokens undelegated before horizon upgrade', async () => { + // Mine remaining blocks to complete thawing period + const oldThawingPeriod = 6646 + for (let i = 0; i < oldThawingPeriod + 1; i++) { + await ethers.provider.send('evm_mine', []) + } + + // Get delegator balance before withdrawing + const balanceBefore = await graphToken.balanceOf(existingDelegator.address) + + // Withdraw tokens + await horizonStaking.connect(existingDelegator)['withdrawDelegated(address,address)'](indexer.address, ZERO_ADDRESS) + + // Get delegator balance after withdrawing + const balanceAfter = await graphToken.balanceOf(existingDelegator.address) + + // Expected balance after is the balance before plus the tokens minus the 0.5% delegation tax + // because the delegation was before the horizon upgrade, after the upgrade there is no tax + const expectedBalanceAfter = balanceBefore + tokens - (tokens * 5000n / 1000000n) + + // Verify tokens were transferred to delegator + expect(balanceAfter).to.equal(expectedBalanceAfter, 'Tokens were not transferred to delegator') + }) + }) + }) +}) diff --git a/packages/horizon/test/integration/after-transition-period/multicall.test.ts b/packages/horizon/test/integration/after-transition-period/multicall.test.ts new file mode 100644 index 000000000..93b561285 --- /dev/null +++ b/packages/horizon/test/integration/after-transition-period/multicall.test.ts @@ -0,0 +1,103 @@ +import hre from 'hardhat' + +import { ethers } from 'hardhat' +import { expect } from 'chai' +import { ONE_MILLION } from '@graphprotocol/toolshed' +import { setGRTBalance } from '@graphprotocol/toolshed/hardhat' + +import type { HardhatEthersSigner } from '@nomicfoundation/hardhat-ethers/signers' + +describe('Service Provider', () => { + let snapshotId: string + + const maxVerifierCut = 50_000n + const thawingPeriod = 2419200n + + const graph = hre.graph() + const { provision } = graph.horizon.actions + const horizonStaking = graph.horizon.contracts.HorizonStaking + const graphToken = graph.horizon.contracts.L2GraphToken + + const subgraphServiceAddress = '0x0000000000000000000000000000000000000000' + beforeEach(async () => { + // Take a snapshot before each test + snapshotId = await ethers.provider.send('evm_snapshot', []) + }) + + afterEach(async () => { + // Revert to the snapshot after each test + await ethers.provider.send('evm_revert', [snapshotId]) + }) + + describe(('New Protocol Users'), () => { + let serviceProvider: HardhatEthersSigner + + before(async () => { + [,,serviceProvider] = await graph.accounts.getTestAccounts() + await setGRTBalance(graph.provider, graphToken.target, serviceProvider.address, ONE_MILLION) + }) + + it('should allow multicalling stake+provision calls', async () => { + const tokensToStake = ethers.parseEther('1000') + const tokensToProvision = ethers.parseEther('100') + + // check state before + const beforeProvision = await horizonStaking.getProvision(serviceProvider.address, subgraphServiceAddress) + expect(beforeProvision.tokens).to.equal(0) + expect(beforeProvision.maxVerifierCut).to.equal(0) + expect(beforeProvision.thawingPeriod).to.equal(0) + expect(beforeProvision.createdAt).to.equal(0) + + // multicall + await graphToken.connect(serviceProvider).approve(horizonStaking.target, tokensToStake) + const stakeCalldata = horizonStaking.interface.encodeFunctionData('stake', [tokensToStake]) + const provisionCalldata = horizonStaking.interface.encodeFunctionData('provision', [ + serviceProvider.address, + subgraphServiceAddress, + tokensToProvision, + maxVerifierCut, + thawingPeriod, + ]) + await horizonStaking.connect(serviceProvider).multicall([stakeCalldata, provisionCalldata]) + + // check state after + const block = await graph.provider.getBlock('latest') + const afterProvision = await horizonStaking.getProvision(serviceProvider.address, subgraphServiceAddress) + expect(afterProvision.tokens).to.equal(tokensToProvision) + expect(afterProvision.maxVerifierCut).to.equal(maxVerifierCut) + expect(afterProvision.thawingPeriod).to.equal(thawingPeriod) + expect(afterProvision.createdAt).to.equal(block?.timestamp) + }) + + it('should allow multicalling deprovision+unstake calls', async () => { + const tokens = ethers.parseEther('100') + + // setup state + await provision(serviceProvider, [serviceProvider.address, subgraphServiceAddress, tokens, maxVerifierCut, thawingPeriod]) + await horizonStaking.connect(serviceProvider).thaw(serviceProvider.address, subgraphServiceAddress, tokens) + await ethers.provider.send('evm_increaseTime', [Number(thawingPeriod)]) + await ethers.provider.send('evm_mine', []) + + // check state before + const beforeServiceProviderBalance = await graphToken.balanceOf(serviceProvider.address) + + // multicall + const deprovisionCalldata = horizonStaking.interface.encodeFunctionData('deprovision', [ + serviceProvider.address, + subgraphServiceAddress, + 0n, + ]) + const unstakeCalldata = horizonStaking.interface.encodeFunctionData('unstake', [tokens]) + await horizonStaking.connect(serviceProvider).multicall([deprovisionCalldata, unstakeCalldata]) + + // check state after + const afterProvision = await horizonStaking.getProvision(serviceProvider.address, subgraphServiceAddress) + const afterServiceProviderBalance = await graphToken.balanceOf(serviceProvider.address) + + expect(afterProvision.tokens).to.equal(0) + expect(afterProvision.maxVerifierCut).to.equal(maxVerifierCut) + expect(afterProvision.thawingPeriod).to.equal(thawingPeriod) + expect(afterServiceProviderBalance).to.equal(beforeServiceProviderBalance + tokens) + }) + }) +}) diff --git a/packages/horizon/test/integration/after-transition-period/operator.test.ts b/packages/horizon/test/integration/after-transition-period/operator.test.ts new file mode 100644 index 000000000..ed801362f --- /dev/null +++ b/packages/horizon/test/integration/after-transition-period/operator.test.ts @@ -0,0 +1,155 @@ +import hre from 'hardhat' + +import { ONE_MILLION, PaymentTypes } from '@graphprotocol/toolshed' +import { ethers } from 'hardhat' +import { expect } from 'chai' +import { setGRTBalance } from '@graphprotocol/toolshed/hardhat' + +import type { HardhatEthersSigner } from '@nomicfoundation/hardhat-ethers/signers' + +describe('Operator', () => { + let serviceProvider: HardhatEthersSigner + let verifier: string + let operator: HardhatEthersSigner + + const tokens = ethers.parseEther('100000') + const maxVerifierCut = 1000000n // 100% + const thawingPeriod = 2419200n + + const graph = hre.graph() + const { stakeTo } = graph.horizon.actions + const horizonStaking = graph.horizon.contracts.HorizonStaking + const graphToken = graph.horizon.contracts.L2GraphToken + + before(async () => { + // Get signers + [serviceProvider, operator] = await graph.accounts.getTestAccounts() + verifier = await ethers.Wallet.createRandom().getAddress() + await setGRTBalance(graph.provider, graphToken.target, operator.address, ONE_MILLION) + + // Authorize operator for verifier + await horizonStaking.connect(serviceProvider).setOperator(verifier, operator.address, true) + + // Fund operator with tokens + await graphToken.connect(serviceProvider).transfer(operator.address, tokens) + }) + + it('operator stakes using stakeTo and service provider unstakes', async () => { + const stakeTokens = ethers.parseEther('100') + const operatorBalanceBefore = await graphToken.balanceOf(operator.address) + const serviceProviderBalanceBefore = await graphToken.balanceOf(serviceProvider.address) + + // Operator stakes on behalf of service provider + await stakeTo(operator, [serviceProvider.address, stakeTokens]) + + // Service provider unstakes + await horizonStaking.connect(serviceProvider).unstake(stakeTokens) + + // Verify tokens were removed from operator's address + const operatorBalanceAfter = await graphToken.balanceOf(operator.address) + expect(operatorBalanceAfter).to.be.equal(operatorBalanceBefore - stakeTokens) + + // Verify tokens were added to service provider's address + const serviceProviderBalanceAfter = await graphToken.balanceOf(serviceProvider.address) + expect(serviceProviderBalanceAfter).to.be.equal(serviceProviderBalanceBefore + stakeTokens) + }) + + it('operator sets delegation fee cut', async () => { + const feeCut = 100000 // 10% + const paymentType = PaymentTypes.QueryFee + + // Operator sets delegation fee cut + await horizonStaking.connect(operator).setDelegationFeeCut( + serviceProvider.address, + verifier, + paymentType, + feeCut, + ) + + // Verify fee cut + const delegationFeeCut = await horizonStaking.getDelegationFeeCut( + serviceProvider.address, + verifier, + paymentType, + ) + expect(delegationFeeCut).to.equal(feeCut) + }) + + describe('Provision', () => { + before(async () => { + const provisionTokens = ethers.parseEther('10000') + // Operator stakes tokens to service provider + await stakeTo(operator, [serviceProvider.address, provisionTokens]) + + // Operator creates provision + await horizonStaking.connect(serviceProvider).provision(serviceProvider.address, verifier, provisionTokens, maxVerifierCut, thawingPeriod) + + // Verify provision + const provision = await horizonStaking.getProvision(serviceProvider.address, verifier) + expect(provision.tokens).to.equal(provisionTokens) + }) + + it('operator thaws and deprovisions', async () => { + const thawTokens = ethers.parseEther('100') + const idleStakeBefore = await horizonStaking.getIdleStake(serviceProvider.address) + const provisionTokensBefore = (await horizonStaking.getProvision(serviceProvider.address, verifier)).tokens + + // Operator thaws tokens + await horizonStaking.connect(serviceProvider).thaw(serviceProvider.address, verifier, thawTokens) + + // Increase time + await ethers.provider.send('evm_increaseTime', [Number(thawingPeriod)]) + await ethers.provider.send('evm_mine', []) + + // Operator deprovisions + await horizonStaking.connect(serviceProvider).deprovision(serviceProvider.address, verifier, 1n) + + // Verify idle stake increased by thawed tokens + const idleStakeAfter = await horizonStaking.getIdleStake(serviceProvider.address) + expect(idleStakeAfter).to.equal(idleStakeBefore + thawTokens) + + // Verify provision tokens decreased by thawed tokens + const provision = await horizonStaking.getProvision(serviceProvider.address, verifier) + expect(provision.tokens).to.equal(provisionTokensBefore - thawTokens) + }) + + it('operator thaws and reprovisions', async () => { + const thawTokens = ethers.parseEther('100') + + // Operator thaws tokens + await horizonStaking.connect(serviceProvider).thaw(serviceProvider.address, verifier, thawTokens) + + // Increase time + await ethers.provider.send('evm_increaseTime', [Number(thawingPeriod)]) + await ethers.provider.send('evm_mine', []) + + // Create new verifier and authorize operator + const newVerifier = await ethers.Wallet.createRandom().getAddress() + await horizonStaking.connect(serviceProvider).setOperator(newVerifier, operator.address, true) + + // Operator creates a provision for the new verifier + await horizonStaking.connect(serviceProvider).provision(serviceProvider.address, newVerifier, thawTokens, maxVerifierCut, thawingPeriod) + + // Operator reprovisions + await horizonStaking.connect(serviceProvider).reprovision(serviceProvider.address, verifier, newVerifier, 1n) + }) + + it('operator sets provision parameters', async () => { + const newMaxVerifierCut = 500000 // 50% + const newThawingPeriod = 7200 // 2 hours + + // Operator sets new parameters + await horizonStaking.connect(operator).setProvisionParameters( + serviceProvider.address, + verifier, + newMaxVerifierCut, + newThawingPeriod, + ) + + // Verify new parameters + const provision = await horizonStaking.getProvision(serviceProvider.address, verifier) + expect(provision.maxVerifierCutPending).to.equal(newMaxVerifierCut) + expect(provision.thawingPeriodPending).to.equal(newThawingPeriod) + }) + }) +}) diff --git a/packages/horizon/test/integration/after-transition-period/pause.test.ts b/packages/horizon/test/integration/after-transition-period/pause.test.ts new file mode 100644 index 000000000..1857be606 --- /dev/null +++ b/packages/horizon/test/integration/after-transition-period/pause.test.ts @@ -0,0 +1,44 @@ +import hre from 'hardhat' + +import { ethers } from 'hardhat' +import { expect } from 'chai' + +import type { HardhatEthersSigner } from '@nomicfoundation/hardhat-ethers/signers' + +describe('Pausing', () => { + let snapshotId: string + + // Test addresses + let pauseGuardian: HardhatEthersSigner + let governor: HardhatEthersSigner + + const graph = hre.graph() + const controller = graph.horizon.contracts.Controller + + before(async () => { + pauseGuardian = await graph.accounts.getPauseGuardian() + governor = await graph.accounts.getGovernor() + }) + + beforeEach(async () => { + // Take a snapshot before each test + snapshotId = await ethers.provider.send('evm_snapshot', []) + }) + + afterEach(async () => { + // Revert to the snapshot after each test + await ethers.provider.send('evm_revert', [snapshotId]) + }) + + describe('HorizonStaking', () => { + it('should be pauseable by pause guardian', async () => { + await controller.connect(pauseGuardian).setPaused(true) + expect(await controller.paused()).to.equal(true) + }) + + it('should be pauseable by governor', async () => { + await controller.connect(governor).setPaused(true) + expect(await controller.paused()).to.equal(true) + }) + }) +}) diff --git a/packages/horizon/test/integration/after-transition-period/service-provider.test.ts b/packages/horizon/test/integration/after-transition-period/service-provider.test.ts new file mode 100644 index 000000000..2a4de7261 --- /dev/null +++ b/packages/horizon/test/integration/after-transition-period/service-provider.test.ts @@ -0,0 +1,325 @@ +import hre from 'hardhat' + +import { ONE_MILLION, PaymentTypes } from '@graphprotocol/toolshed' +import { ethers } from 'hardhat' +import { expect } from 'chai' +import { indexers } from '../../../tasks/test/fixtures/indexers' +import { setGRTBalance } from '@graphprotocol/toolshed/hardhat' + +import type { HardhatEthersSigner } from '@nomicfoundation/hardhat-ethers/signers' + +describe('Service provider', () => { + let verifier: string + const thawingPeriod = 2419200n + + const graph = hre.graph() + const { stake, stakeToProvision, addToProvision } = graph.horizon.actions + const horizonStaking = graph.horizon.contracts.HorizonStaking + const graphToken = graph.horizon.contracts.L2GraphToken + + before(async () => { + verifier = await ethers.Wallet.createRandom().getAddress() + }) + + describe('New Protocol Users', () => { + let serviceProvider: HardhatEthersSigner + const stakeAmount = ethers.parseEther('1000') + + before(async () => { + [serviceProvider] = await graph.accounts.getTestAccounts() + await setGRTBalance(graph.provider, graphToken.target, serviceProvider.address, ONE_MILLION) + }) + + it('should allow staking tokens and unstake right after', async () => { + const serviceProviderBalanceBefore = await graphToken.balanceOf(serviceProvider.address) + await stake(serviceProvider, [stakeAmount]) + await horizonStaking.connect(serviceProvider).unstake(stakeAmount) + const serviceProviderBalanceAfter = await graphToken.balanceOf(serviceProvider.address) + expect(serviceProviderBalanceAfter).to.equal(serviceProviderBalanceBefore, 'Service provider balance should not change') + }) + + it('should revert if unstaking more than the idle stake', async () => { + const idleStake = await horizonStaking.getIdleStake(serviceProvider.address) + await expect(horizonStaking.connect(serviceProvider).unstake(idleStake + 1n)) + .to.be.revertedWithCustomError(horizonStaking, 'HorizonStakingInsufficientIdleStake') + .withArgs(idleStake + 1n, idleStake) + }) + + it('should be able to set delegation fee cut for payment type', async () => { + const delegationFeeCut = 10_000 // 10% + const paymentType = PaymentTypes.QueryFee + + await horizonStaking.connect(serviceProvider).setDelegationFeeCut( + serviceProvider.address, + verifier, + paymentType, + delegationFeeCut, + ) + + // Verify delegation fee cut was set + const delegationFeeCutAfterSet = await horizonStaking.getDelegationFeeCut( + serviceProvider.address, + verifier, + paymentType, + ) + expect(delegationFeeCutAfterSet).to.equal(delegationFeeCut, 'Delegation fee cut was not set') + }) + + it('should be able to set an operator for a verifier', async () => { + const operator = await ethers.Wallet.createRandom().getAddress() + await horizonStaking.connect(serviceProvider).setOperator( + verifier, + operator, + true, + ) + + // Verify operator was set + const isAuthorized = await horizonStaking.isAuthorized( + serviceProvider.address, + verifier, + operator, + ) + expect(isAuthorized).to.be.true + }) + + describe('Provision', () => { + let maxVerifierCut: bigint + + before(async () => { + const tokensToStake = ethers.parseEther('100000') + maxVerifierCut = 50_000n // 50% + const createProvisionTokens = ethers.parseEther('10000') + + // Add idle stake + await stake(serviceProvider, [tokensToStake]) + await horizonStaking.connect(serviceProvider).provision(serviceProvider.address, verifier, createProvisionTokens, maxVerifierCut, thawingPeriod) + }) + + it('should be able to stake to provision directly', async () => { + let provision = await horizonStaking.getProvision(serviceProvider.address, verifier) + const provisionTokensBefore = provision.tokens + + // Add stake and provision on the same transaction + const stakeToProvisionTokens = ethers.parseEther('100') + await stakeToProvision(serviceProvider, [serviceProvider.address, verifier, stakeToProvisionTokens]) + + // Verify provision tokens were updated + provision = await horizonStaking.getProvision(serviceProvider.address, verifier) + expect(provision.tokens).to.equal(provisionTokensBefore + stakeToProvisionTokens, 'Provision tokens were not updated') + }) + + it('should be able to add idle stake to provision', async () => { + let provision = await horizonStaking.getProvision(serviceProvider.address, verifier) + const provisionTokensBefore = provision.tokens + + // Add to provision using idle stake + const addToProvisionTokens = ethers.parseEther('100') + await addToProvision(serviceProvider, [serviceProvider.address, verifier, addToProvisionTokens]) + + // Verify provision tokens were updated + provision = await horizonStaking.getProvision(serviceProvider.address, verifier) + expect(provision.tokens).to.equal(provisionTokensBefore + addToProvisionTokens, 'Provision tokens were not updated') + }) + + it('should revert if creating a provision with tokens greater than the idle stake', async () => { + const newVerifier = await ethers.Wallet.createRandom().getAddress() + const idleStake = await horizonStaking.getIdleStake(serviceProvider.address) + await expect(horizonStaking.connect(serviceProvider).provision( + serviceProvider.address, newVerifier, idleStake + 1n, maxVerifierCut, thawingPeriod)) + .to.be.revertedWithCustomError(horizonStaking, 'HorizonStakingInsufficientIdleStake') + .withArgs(idleStake + 1n, idleStake) + }) + + it('should revert if adding to provision with tokens greater than the idle stake', async () => { + const idleStake = await horizonStaking.getIdleStake(serviceProvider.address) + await expect(horizonStaking.connect(serviceProvider).addToProvision( + serviceProvider.address, verifier, idleStake + 1n)) + .to.be.revertedWithCustomError(horizonStaking, 'HorizonStakingInsufficientIdleStake') + .withArgs(idleStake + 1n, idleStake) + }) + + describe('Thawing', () => { + describe('Deprovisioning', () => { + it('should be able to thaw tokens, wait for thawing period, deprovision and unstake', async () => { + const serviceProviderBalanceBefore = await graphToken.balanceOf(serviceProvider.address) + const tokensToThaw = ethers.parseEther('100') + await horizonStaking.connect(serviceProvider).thaw(serviceProvider.address, verifier, tokensToThaw) + + // Wait for thawing period + await ethers.provider.send('evm_increaseTime', [Number(thawingPeriod)]) + await ethers.provider.send('evm_mine', []) + + // Deprovision the single thaw request + await horizonStaking.connect(serviceProvider).deprovision(serviceProvider.address, verifier, 1n) + + // Unstake + await horizonStaking.connect(serviceProvider).unstake(tokensToThaw) + + // Verify service provider balance increased by the unstake tokens + const serviceProviderBalanceAfter = await graphToken.balanceOf(serviceProvider.address) + expect(serviceProviderBalanceAfter).to.equal(serviceProviderBalanceBefore + tokensToThaw, 'Service provider balance should increase by the thawed tokens') + }) + + it('should be able to create multiple thaw requests and deprovision all at once', async () => { + const serviceProviderIdleStakeBefore = await horizonStaking.getIdleStake(serviceProvider.address) + const tokensToThaw = ethers.parseEther('100') + // Create 10 thaw requests for 100 GRT each + for (let i = 0; i < 10; i++) { + await horizonStaking.connect(serviceProvider).thaw(serviceProvider.address, verifier, tokensToThaw) + } + + // Wait for thawing period + await ethers.provider.send('evm_increaseTime', [Number(thawingPeriod)]) + await ethers.provider.send('evm_mine', []) + + // Deprovision all thaw requests + await horizonStaking.connect(serviceProvider).deprovision(serviceProvider.address, verifier, 10n) + + // Verify service provider idle stake increased by the deprovisioned tokens + const serviceProviderIdleStakeAfter = await horizonStaking.getIdleStake(serviceProvider.address) + expect(serviceProviderIdleStakeAfter).to.equal(serviceProviderIdleStakeBefore + tokensToThaw * 10n, 'Service provider idle stake should increase by the deprovisioned tokens') + }) + + it('should be able to create multiple thaw requests and deprovision one by one', async () => { + const serviceProviderIdleStakeBefore = await horizonStaking.getIdleStake(serviceProvider.address) + const tokensToThaw = ethers.parseEther('100') + // Create 3 thaw requests for 100 GRT each + for (let i = 0; i < 3; i++) { + await horizonStaking.connect(serviceProvider).thaw(serviceProvider.address, verifier, tokensToThaw) + } + + // Wait for thawing period + await ethers.provider.send('evm_increaseTime', [Number(thawingPeriod)]) + await ethers.provider.send('evm_mine', []) + + // Deprovision one by one + for (let i = 0; i < 3; i++) { + await horizonStaking.connect(serviceProvider).deprovision(serviceProvider.address, verifier, 1n) + } + + // Verify service provider idle stake increased by the deprovisioned tokens + const serviceProviderIdleStakeAfter = await horizonStaking.getIdleStake(serviceProvider.address) + expect(serviceProviderIdleStakeAfter).to.equal(serviceProviderIdleStakeBefore + tokensToThaw * 3n, 'Service provider idle stake should increase by the deprovisioned tokens') + }) + }) + + describe('Reprovisioning', () => { + let newVerifier: string + + before(async () => { + newVerifier = await ethers.Wallet.createRandom().getAddress() + await horizonStaking.connect(serviceProvider).provision(serviceProvider.address, newVerifier, ethers.parseEther('100'), maxVerifierCut, thawingPeriod) + }) + + it('should be able to thaw tokens, wait for thawing period and reprovision', async () => { + const serviceProviderNewProvisionSizeBefore = (await horizonStaking.getProvision(serviceProvider.address, newVerifier)).tokens + const serviceProviderOldProvisionSizeBefore = (await horizonStaking.getProvision(serviceProvider.address, verifier)).tokens + const tokensToThaw = ethers.parseEther('100') + + // Thaw tokens + await horizonStaking.connect(serviceProvider).thaw(serviceProvider.address, verifier, tokensToThaw) + + // Wait for thawing period + await ethers.provider.send('evm_increaseTime', [Number(thawingPeriod)]) + await ethers.provider.send('evm_mine', []) + + // Reprovision + await horizonStaking.connect(serviceProvider).reprovision(serviceProvider.address, verifier, newVerifier, 1n) + + // Verify new provision size increased by the reprovisioned tokens + const serviceProviderNewProvisionSizeAfter = (await horizonStaking.getProvision(serviceProvider.address, newVerifier)).tokens + expect(serviceProviderNewProvisionSizeAfter).to.equal(serviceProviderNewProvisionSizeBefore + tokensToThaw, 'New provision size should increase by the reprovisioned tokens') + + // Verify old provision size decreased by the reprovisioned tokens + const serviceProviderOldProvisionSizeAfter = (await horizonStaking.getProvision(serviceProvider.address, verifier)).tokens + expect(serviceProviderOldProvisionSizeAfter).to.equal(serviceProviderOldProvisionSizeBefore - tokensToThaw, 'Old provision size should decrease by the reprovisioned tokens') + }) + + it('should revert if thawing period is not over', async () => { + const tokensToThaw = ethers.parseEther('100') + await horizonStaking.connect(serviceProvider).thaw(serviceProvider.address, verifier, tokensToThaw) + + await expect(horizonStaking.connect(serviceProvider).reprovision(serviceProvider.address, verifier, newVerifier, 1n)) + .to.be.revertedWithCustomError(horizonStaking, 'HorizonStakingInvalidZeroTokens') + }) + }) + }) + + describe('Set parameters', () => { + it('should be able to set provision parameters', async () => { + const newMaxVerifierCut = 20_000 // 20% + const newThawingPeriod = 1000 + + // Set parameters + await horizonStaking.connect(serviceProvider).setProvisionParameters( + serviceProvider.address, + verifier, + newMaxVerifierCut, + newThawingPeriod, + ) + + // Verify parameters were set as pending + const provision = await horizonStaking.getProvision(serviceProvider.address, verifier) + expect(provision.maxVerifierCutPending).to.equal(newMaxVerifierCut, 'Max verifier cut should be set') + expect(provision.thawingPeriodPending).to.equal(newThawingPeriod, 'Thawing period should be set') + }) + }) + }) + }) + + describe('Existing Protocol Users', () => { + let indexer: HardhatEthersSigner + let tokensToUnstake: bigint + let snapshotId: string + + before(async () => { + // Get indexer + const indexerFixture = indexers[0] + indexer = await ethers.getSigner(indexerFixture.address) + await setGRTBalance(graph.provider, graphToken.target, indexer.address, ONE_MILLION) + // Set tokens + tokensToUnstake = ethers.parseEther('10000') + }) + + beforeEach(async () => { + // Take a snapshot before each test + snapshotId = await ethers.provider.send('evm_snapshot', []) + }) + + afterEach(async () => { + // Revert to the snapshot after each test + await ethers.provider.send('evm_revert', [snapshotId]) + }) + + it('should be able to unstake tokens without thawing', async () => { + // Get balance before unstaking + const balanceBefore = await graphToken.balanceOf(indexer.address) + + // Unstake tokens + await horizonStaking.connect(indexer).unstake(tokensToUnstake) + + // Verify tokens are transferred back to service provider + const balanceAfter = await graphToken.balanceOf(indexer.address) + expect(balanceAfter).to.equal(balanceBefore + tokensToUnstake, 'Tokens were not transferred back to service provider') + }) + + it('should be able to withdraw locked tokens after thawing period', async () => { + const oldThawingPeriod = 6646 + + // Mine blocks to complete thawing period + for (let i = 0; i < oldThawingPeriod + 1; i++) { + await ethers.provider.send('evm_mine', []) + } + + // Get balance before withdrawing + const balanceBefore = await graphToken.balanceOf(indexer.address) + + // Withdraw tokens + await horizonStaking.connect(indexer).withdraw() + + // Get balance after withdrawing + const balanceAfter = await graphToken.balanceOf(indexer.address) + expect(balanceAfter).to.equal(balanceBefore + tokensToUnstake, 'Tokens were not transferred back to service provider') + }) + }) +}) diff --git a/packages/horizon/test/integration/after-transition-period/slasher.test.ts b/packages/horizon/test/integration/after-transition-period/slasher.test.ts new file mode 100644 index 000000000..93db7b6dc --- /dev/null +++ b/packages/horizon/test/integration/after-transition-period/slasher.test.ts @@ -0,0 +1,131 @@ +import hre from 'hardhat' + +import { ethers } from 'hardhat' +import { expect } from 'chai' +import { ONE_MILLION } from '@graphprotocol/toolshed' +import { setGRTBalance } from '@graphprotocol/toolshed/hardhat' + +import type { HardhatEthersSigner } from '@nomicfoundation/hardhat-ethers/signers' + +describe('Slasher', () => { + let snapshotId: string + let serviceProvider: HardhatEthersSigner + let delegator: HardhatEthersSigner + let verifier: HardhatEthersSigner + let slashingVerifier: HardhatEthersSigner + let verifierDestination: string + + const maxVerifierCut = 1000000n // 100% + const thawingPeriod = 2419200n // 28 days + const provisionTokens = ethers.parseEther('10000') + const delegationTokens = ethers.parseEther('1000') + + const graph = hre.graph() + const { provision, delegate } = graph.horizon.actions + const horizonStaking = graph.horizon.contracts.HorizonStaking + const graphToken = graph.horizon.contracts.L2GraphToken + + before(async () => { + [serviceProvider, delegator, verifier, slashingVerifier] = await graph.accounts.getTestAccounts() + verifierDestination = ethers.Wallet.createRandom().address + await setGRTBalance(graph.provider, graphToken.target, serviceProvider.address, ONE_MILLION) + await setGRTBalance(graph.provider, graphToken.target, delegator.address, ONE_MILLION) + }) + + beforeEach(async () => { + // Take a snapshot before each test + snapshotId = await ethers.provider.send('evm_snapshot', []) + + // Create provision + await provision(serviceProvider, [serviceProvider.address, verifier.address, provisionTokens, maxVerifierCut, thawingPeriod]) + + // Send funds to delegator + await graphToken.connect(serviceProvider).transfer(delegator.address, delegationTokens * 3n) + + // Initialize delegation pool if it does not exist + await delegate(delegator, [serviceProvider.address, verifier.address, delegationTokens, 0n]) + + // Send eth to verifier to cover gas fees + await serviceProvider.sendTransaction({ + to: verifier, + value: ethers.parseEther('0.1'), + }) + }) + + afterEach(async () => { + // Revert to the snapshot after each test + await ethers.provider.send('evm_revert', [snapshotId]) + }) + + it('should slash service provider tokens', async () => { + const slashTokens = ethers.parseEther('1000') + const tokensVerifier = slashTokens / 2n + const provisionBefore = await horizonStaking.getProvision(serviceProvider.address, verifier) + const verifierDestinationBalanceBefore = await graphToken.balanceOf(verifierDestination) + + // Slash provision + await horizonStaking.connect(verifier).slash(serviceProvider.address, slashTokens, tokensVerifier, verifierDestination) + + // Verify provision tokens are reduced + const provisionAfter = await horizonStaking.getProvision(serviceProvider.address, verifier) + expect(provisionAfter.tokens).to.equal(provisionBefore.tokens - slashTokens, 'Provision tokens should be reduced') + + // Verify verifier destination received the tokens + const verifierDestinationBalanceAfter = await graphToken.balanceOf(verifierDestination) + expect(verifierDestinationBalanceAfter).to.equal(verifierDestinationBalanceBefore + tokensVerifier, 'Verifier destination should receive the tokens') + }) + + it('should slash service provider tokens when tokens are thawing', async () => { + // Start thawing + const thawTokens = ethers.parseEther('1000') + await horizonStaking.connect(serviceProvider).thaw(serviceProvider.address, verifier.address, thawTokens) + + const slashTokens = ethers.parseEther('500') + const tokensVerifier = slashTokens / 2n + const provisionBefore = await horizonStaking.getProvision(serviceProvider.address, verifier) + const verifierDestinationBalanceBefore = await graphToken.balanceOf(verifierDestination) + + // Slash provision + await horizonStaking.connect(verifier).slash(serviceProvider.address, slashTokens, tokensVerifier, verifierDestination) + + // Verify provision tokens are reduced + const provisionAfter = await horizonStaking.getProvision(serviceProvider.address, verifier) + expect(provisionAfter.tokens).to.equal(provisionBefore.tokens - slashTokens, 'Provision tokens should be reduced') + + // Verify verifier destination received the tokens + const verifierDestinationBalanceAfter = await graphToken.balanceOf(verifierDestination) + expect(verifierDestinationBalanceAfter).to.equal(verifierDestinationBalanceBefore + tokensVerifier, 'Verifier destination should receive the tokens') + }) + + it('should only slash service provider when delegation slashing is disabled', async () => { + const slashTokens = provisionTokens + delegationTokens + const tokensVerifier = slashTokens / 2n + + // Send eth to slashing verifier to cover gas fees + await serviceProvider.sendTransaction({ + to: slashingVerifier.address, + value: ethers.parseEther('0.5'), + }) + + // Create provision for slashing verifier + await provision(serviceProvider, [serviceProvider.address, slashingVerifier.address, provisionTokens, maxVerifierCut, thawingPeriod]) + + // Initialize delegation pool for slashing verifier + await delegate(serviceProvider, [serviceProvider.address, slashingVerifier.address, delegationTokens, 0n]) + + // Get delegation pool state before slashing + const poolBefore = await horizonStaking.getDelegationPool(serviceProvider.address, slashingVerifier.address) + + // Slash the provision for all service provider and delegation pool tokens + await horizonStaking.connect(slashingVerifier).slash(serviceProvider.address, slashTokens, tokensVerifier, verifierDestination) + + // Verify provision tokens were completely slashed + const provisionAfter = await horizonStaking.getProvision(serviceProvider.address, slashingVerifier.address) + expect(provisionAfter.tokens).to.be.equal(0, 'Provision tokens should be slashed completely') + + // Verify delegation pool tokens are not reduced + const poolAfter = await horizonStaking.getDelegationPool(serviceProvider.address, slashingVerifier.address) + expect(poolAfter.tokens).to.equal(poolBefore.tokens, 'Delegation pool tokens should not be reduced') + expect(poolAfter.shares).to.equal(poolBefore.shares, 'Delegation pool shares should remain the same') + }) +}) diff --git a/packages/horizon/test/integration/after-transition-period/upgrade.test.ts b/packages/horizon/test/integration/after-transition-period/upgrade.test.ts new file mode 100644 index 000000000..f46252b71 --- /dev/null +++ b/packages/horizon/test/integration/after-transition-period/upgrade.test.ts @@ -0,0 +1,83 @@ +import hre from 'hardhat' + +import { ethers } from 'hardhat' +import { expect } from 'chai' + +import type { HardhatEthersSigner } from '@nomicfoundation/hardhat-ethers/signers' +import { zeroPadValue } from 'ethers' + +const abi = [{ + inputs: [ + { + internalType: 'contract ITransparentUpgradeableProxy', + name: 'proxy', + type: 'address', + }, + { + internalType: 'address', + name: 'implementation', + type: 'address', + }, + { + internalType: 'bytes', + name: 'data', + type: 'bytes', + }, + ], + name: 'upgradeAndCall', + outputs: [], + stateMutability: 'payable', + type: 'function', +}] + +describe('Upgrading contracts', () => { + let snapshotId: string + + // Test addresses + let governor: HardhatEthersSigner + const graph = hre.graph() + + before(async () => { + governor = await graph.accounts.getGovernor() + }) + + beforeEach(async () => { + // Take a snapshot before each test + snapshotId = await ethers.provider.send('evm_snapshot', []) + }) + + afterEach(async () => { + // Revert to the snapshot after each test + await ethers.provider.send('evm_revert', [snapshotId]) + }) + + it('GraphPayments should be upgradeable by the governor', async () => { + const entry = graph.horizon.addressBook.getEntry('GraphPayments') + const proxyAdmin = entry.proxyAdmin! + const proxy = entry.address + + // Upgrade the contract to a different implementation + // the implementation we use is the GraphTallyCollector, this is obviously absurd but we just need an address with code on it + const ProxyAdmin = new ethers.Contract(proxyAdmin, abi, governor) + await ProxyAdmin.upgradeAndCall(proxy, graph.horizon.contracts.GraphTallyCollector.target, '0x') + + // https:// github.com/OpenZeppelin/openzeppelin-contracts/blob/dbb6104ce834628e473d2173bbc9d47f81a9eec3/contracts/proxy/ERC1967/ERC1967Utils.sol#L37C53-L37C119 + const implementation = await hre.ethers.provider.getStorage(proxy, '0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc') + expect(zeroPadValue(implementation, 32)).to.equal(zeroPadValue(graph.horizon.contracts.GraphTallyCollector.target as string, 32)) + }) + + it('PaymentsEscrow should be upgradeable by the governor', async () => { + const entry = graph.horizon.addressBook.getEntry('PaymentsEscrow') + const proxyAdmin = entry.proxyAdmin! + const proxy = entry.address + + // Upgrade the contract to a different implementation + // the implementation we use is the GraphTallyCollector, this is obviously absurd but we just need an address with code on it + const ProxyAdmin = new ethers.Contract(proxyAdmin, abi, governor) + await ProxyAdmin.upgradeAndCall(proxy, graph.horizon.contracts.GraphTallyCollector.target, '0x') + + // https:// github.com/OpenZeppelin/openzeppelin-contracts/blob/dbb6104ce834628e473d2173bbc9d47f81a9eec3/contracts/proxy/ERC1967/ERC1967Utils.sol#L37C53-L37C119 + const implementation = await hre.ethers.provider.getStorage(proxy, '0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc') + expect(zeroPadValue(implementation, 32)).to.equal(zeroPadValue(graph.horizon.contracts.GraphTallyCollector.target as string, 32)) + }) +}) diff --git a/packages/horizon/test/integration/during-transition-period/delegator.test.ts b/packages/horizon/test/integration/during-transition-period/delegator.test.ts new file mode 100644 index 000000000..d267af6b2 --- /dev/null +++ b/packages/horizon/test/integration/during-transition-period/delegator.test.ts @@ -0,0 +1,141 @@ +import hre from 'hardhat' + +import { delegators } from '../../../tasks/test/fixtures/delegators' +import { ethers } from 'hardhat' +import { expect } from 'chai' +import { ZERO_ADDRESS } from '@graphprotocol/toolshed' + +import type { HardhatEthersSigner } from '@nomicfoundation/hardhat-ethers/signers' + +describe('Delegator', () => { + let snapshotId: string + + const thawingPeriod = 2419200n // 28 days + + // Subgraph service address is not set for integration tests + const subgraphServiceAddress = '0x0000000000000000000000000000000000000000' + + const graph = hre.graph() + const horizonStaking = graph.horizon.contracts.HorizonStaking + const graphToken = graph.horizon.contracts.L2GraphToken + + beforeEach(async () => { + // Take a snapshot before each test + snapshotId = await ethers.provider.send('evm_snapshot', []) + }) + + afterEach(async () => { + // Revert to the snapshot after each test + await ethers.provider.send('evm_revert', [snapshotId]) + }) + + describe('Existing Protocol Users', () => { + describe('User undelegated before horizon was deployed', () => { + let indexer: HardhatEthersSigner + let delegator: HardhatEthersSigner + let tokens: bigint + + before(async () => { + const delegatorFixture = delegators[2] + const delegationFixture = delegatorFixture.delegations[0] + + // Verify delegator is undelegated + expect(delegatorFixture.undelegate).to.be.true + + // Get signers + indexer = await ethers.getSigner(delegationFixture.indexerAddress) + delegator = await ethers.getSigner(delegatorFixture.address) + + // Get tokens + tokens = delegationFixture.tokens + }) + + it('should be able to withdraw their tokens after the thawing period', async () => { + // Get the thawing period + const thawingPeriod = await horizonStaking.__DEPRECATED_getThawingPeriod() + + // Mine remaining blocks to complete thawing period + for (let i = 0; i < Number(thawingPeriod) + 1; i++) { + await ethers.provider.send('evm_mine', []) + } + + // Get delegator balance before withdrawing + const balanceBefore = await graphToken.balanceOf(delegator.address) + + // Withdraw tokens + await horizonStaking.connect(delegator)['withdrawDelegated(address,address)'](indexer.address, ZERO_ADDRESS) + + // Get delegator balance after withdrawing + const balanceAfter = await graphToken.balanceOf(delegator.address) + + // Expected balance after is the balance before plus the tokens minus the 0.5% delegation tax + const expectedBalanceAfter = balanceBefore + tokens - (tokens * 5000n / 1000000n) + + // Verify tokens are withdrawn + expect(balanceAfter).to.equal(expectedBalanceAfter) + }) + + it('should revert if the thawing period has not passed', async () => { + // Withdraw tokens + await expect( + horizonStaking.connect(delegator)['withdrawDelegated(address,address)'](indexer.address, ZERO_ADDRESS), + ).to.be.revertedWithCustomError(horizonStaking, 'HorizonStakingNothingToWithdraw') + }) + }) + + describe('Transition period is over', () => { + let governor: HardhatEthersSigner + let indexer: HardhatEthersSigner + let delegator: HardhatEthersSigner + let tokens: bigint + + before(async () => { + const delegatorFixture = delegators[0] + const delegationFixture = delegatorFixture.delegations[0] + + // Get signers + governor = await graph.accounts.getGovernor() + indexer = await ethers.getSigner(delegationFixture.indexerAddress) + delegator = await ethers.getSigner(delegatorFixture.address) + + // Get tokens + tokens = delegationFixture.tokens + }) + + it('should be able to undelegate during transition period and withdraw after transition period', async () => { + // Get delegator's delegation + const delegation = await horizonStaking.getDelegation( + indexer.address, + subgraphServiceAddress, + delegator.address, + ) + + // Undelegate tokens + await horizonStaking.connect(delegator)['undelegate(address,address,uint256)'](indexer.address, subgraphServiceAddress, delegation.shares) + + // Wait for thawing period + await ethers.provider.send('evm_increaseTime', [Number(thawingPeriod) + 1]) + await ethers.provider.send('evm_mine', []) + + // Clear thawing period + await horizonStaking.connect(governor).clearThawingPeriod() + + // Get delegator balance before withdrawing + const balanceBefore = await graphToken.balanceOf(delegator.address) + + // Withdraw tokens + await horizonStaking.connect(delegator)['withdrawDelegated(address,address,uint256)'](indexer.address, ZERO_ADDRESS, BigInt(1)) + + // Get delegator balance after withdrawing + const balanceAfter = await graphToken.balanceOf(delegator.address) + + // Expected balance after is the balance before plus the tokens minus the 0.5% delegation tax + // because the delegation was before the horizon upgrade, after the upgrade there is no tax + const expectedBalanceAfter = balanceBefore + tokens - (tokens * 5000n / 1000000n) + + // Verify tokens are withdrawn + expect(balanceAfter).to.equal(expectedBalanceAfter) + }) + }) + }) +}) diff --git a/packages/horizon/test/integration/during-transition-period/multicall.test.ts b/packages/horizon/test/integration/during-transition-period/multicall.test.ts new file mode 100644 index 000000000..116888275 --- /dev/null +++ b/packages/horizon/test/integration/during-transition-period/multicall.test.ts @@ -0,0 +1,100 @@ +import hre from 'hardhat' + +import { ONE_MILLION, PaymentTypes } from '@graphprotocol/toolshed' +import { ethers } from 'hardhat' +import { expect } from 'chai' +import { setGRTBalance } from '@graphprotocol/toolshed/hardhat' + +import type { HardhatEthersSigner } from '@nomicfoundation/hardhat-ethers/signers' + +describe('Service Provider', () => { + let snapshotId: string + + const maxVerifierCut = 50_000n + const thawingPeriod = 2419200n + + const graph = hre.graph() + const horizonStaking = graph.horizon.contracts.HorizonStaking + const graphToken = graph.horizon.contracts.L2GraphToken + + const subgraphServiceAddress = '0x0000000000000000000000000000000000000000' + beforeEach(async () => { + // Take a snapshot before each test + snapshotId = await ethers.provider.send('evm_snapshot', []) + }) + + afterEach(async () => { + // Revert to the snapshot after each test + await ethers.provider.send('evm_revert', [snapshotId]) + }) + + describe(('New Protocol Users'), () => { + let serviceProvider: HardhatEthersSigner + + before(async () => { + [,,serviceProvider] = await graph.accounts.getTestAccounts() + await setGRTBalance(graph.provider, graphToken.target, serviceProvider.address, ONE_MILLION) + }) + + it('should allow multicalling stake+provision calls', async () => { + const tokensToStake = ethers.parseEther('1000') + const tokensToProvision = ethers.parseEther('100') + + // check state before + const beforeProvision = await horizonStaking.getProvision(serviceProvider.address, subgraphServiceAddress) + expect(beforeProvision.tokens).to.equal(0) + expect(beforeProvision.maxVerifierCut).to.equal(0) + expect(beforeProvision.thawingPeriod).to.equal(0) + expect(beforeProvision.createdAt).to.equal(0) + + // multicall + await graphToken.connect(serviceProvider).approve(horizonStaking.target, tokensToStake) + const stakeCalldata = horizonStaking.interface.encodeFunctionData('stake', [tokensToStake]) + const provisionCalldata = horizonStaking.interface.encodeFunctionData('provision', [ + serviceProvider.address, + subgraphServiceAddress, + tokensToProvision, + maxVerifierCut, + thawingPeriod, + ]) + await horizonStaking.connect(serviceProvider).multicall([stakeCalldata, provisionCalldata]) + + // check state after + const block = await graph.provider.getBlock('latest') + const afterProvision = await horizonStaking.getProvision(serviceProvider.address, subgraphServiceAddress) + expect(afterProvision.tokens).to.equal(tokensToProvision) + expect(afterProvision.maxVerifierCut).to.equal(maxVerifierCut) + expect(afterProvision.thawingPeriod).to.equal(thawingPeriod) + expect(afterProvision.createdAt).to.equal(block?.timestamp) + }) + + it('should allow multicalling delegation parameter set calls', async () => { + // check state before + const beforeIndexingRewards = await horizonStaking.getDelegationFeeCut(serviceProvider.address, subgraphServiceAddress, PaymentTypes.IndexingRewards) + const beforeQueryFee = await horizonStaking.getDelegationFeeCut(serviceProvider.address, subgraphServiceAddress, PaymentTypes.QueryFee) + expect(beforeIndexingRewards).to.equal(0) + expect(beforeQueryFee).to.equal(0) + + // multicall + const indexingRewardsCalldata = horizonStaking.interface.encodeFunctionData('setDelegationFeeCut', [ + serviceProvider.address, + subgraphServiceAddress, + PaymentTypes.IndexingRewards, + 10_000n, + ]) + const queryFeeCalldata = horizonStaking.interface.encodeFunctionData('setDelegationFeeCut', [ + serviceProvider.address, + subgraphServiceAddress, + PaymentTypes.QueryFee, + 12_345n, + ]) + await horizonStaking.connect(serviceProvider).multicall([indexingRewardsCalldata, queryFeeCalldata]) + + // check state after + const afterIndexingRewards = await horizonStaking.getDelegationFeeCut(serviceProvider.address, subgraphServiceAddress, PaymentTypes.IndexingRewards) + const afterQueryFee = await horizonStaking.getDelegationFeeCut(serviceProvider.address, subgraphServiceAddress, PaymentTypes.QueryFee) + expect(afterIndexingRewards).to.equal(10_000n) + expect(afterQueryFee).to.equal(12_345n) + }) + }) +}) diff --git a/packages/horizon/test/integration/during-transition-period/operator.test.ts b/packages/horizon/test/integration/during-transition-period/operator.test.ts new file mode 100644 index 000000000..858d9ce72 --- /dev/null +++ b/packages/horizon/test/integration/during-transition-period/operator.test.ts @@ -0,0 +1,93 @@ +import hre from 'hardhat' + +import { ethers } from 'hardhat' +import { expect } from 'chai' +import { generatePOI } from '@graphprotocol/toolshed' +import { getEventData } from '@graphprotocol/toolshed/hardhat' +import { indexers } from '../../../tasks/test/fixtures/indexers' + +import type { HardhatEthersSigner } from '@nomicfoundation/hardhat-ethers/signers' +import type { HorizonStakingExtension } from '@graphprotocol/toolshed/deployments' + +describe('Operator', () => { + let snapshotId: string + + // Subgraph service address is not set for integration tests + const subgraphServiceAddress = '0x0000000000000000000000000000000000000000' + + const graph = hre.graph() + const horizonStaking = graph.horizon.contracts.HorizonStaking + + beforeEach(async () => { + // Take a snapshot before each test + snapshotId = await ethers.provider.send('evm_snapshot', []) + }) + + afterEach(async () => { + // Revert to the snapshot after each test + await ethers.provider.send('evm_revert', [snapshotId]) + }) + + describe('Existing Protocol Users', () => { + let indexer: HardhatEthersSigner + let operator: HardhatEthersSigner + let allocationID: string + let allocationTokens: bigint + let delegationIndexingCut: number + + before(async () => { + const indexerFixture = indexers[0] + const allocationFixture = indexerFixture.allocations[0] + + // Get signers + indexer = await ethers.getSigner(indexerFixture.address) + ;[operator] = await graph.accounts.getTestAccounts() + + // Get allocation details + allocationID = allocationFixture.allocationID + allocationTokens = allocationFixture.tokens + delegationIndexingCut = indexerFixture.indexingRewardCut + + // Set the operator + await horizonStaking.connect(indexer).setOperator(subgraphServiceAddress, operator.address, true) + }) + + it('should allow the operator to close an open legacy allocation and collect rewards', async () => { + // Use a non-zero POI + const poi = generatePOI('poi') + const thawingPeriod = await horizonStaking.__DEPRECATED_getThawingPeriod() + + // Get delegation pool before closing allocation + const delegationPoolBefore = await horizonStaking.getDelegationPool(indexer.address, subgraphServiceAddress) + const delegationPoolTokensBefore = delegationPoolBefore.tokens + + // Mine blocks to simulate time passing + const halfThawingPeriod = Number(thawingPeriod) / 2 + for (let i = 0; i < halfThawingPeriod; i++) { + await ethers.provider.send('evm_mine', []) + } + + // Get idle stake before closing allocation + const idleStakeBefore = await horizonStaking.getIdleStake(indexer.address) + + // Close allocation + const tx = await (horizonStaking as HorizonStakingExtension).connect(operator).closeAllocation(allocationID, poi) + const eventData = await getEventData(tx, 'event HorizonRewardsAssigned(address indexed indexer, address indexed allocationID, uint256 amount)') + const rewards = eventData[2] + + // Verify rewards are not zero + expect(rewards).to.not.equal(0, 'Rewards were not transferred to service provider') + + // Verify rewards minus delegation cut are restaked + const idleStakeAfter = await horizonStaking.getIdleStake(indexer.address) + const idleStakeRewardsTokens = rewards * BigInt(delegationIndexingCut) / 1000000n + expect(idleStakeAfter).to.equal(idleStakeBefore + allocationTokens + idleStakeRewardsTokens, 'Rewards were not restaked') + + // Verify delegators cut is added to delegation pool + const delegationPool = await horizonStaking.getDelegationPool(indexer.address, subgraphServiceAddress) + const delegationPoolTokensAfter = delegationPool.tokens + const delegationRewardsTokens = rewards - idleStakeRewardsTokens + expect(delegationPoolTokensAfter).to.equal(delegationPoolTokensBefore + delegationRewardsTokens, 'Delegators cut was not added to delegation pool') + }) + }) +}) diff --git a/packages/horizon/test/integration/during-transition-period/permissionless.test.ts b/packages/horizon/test/integration/during-transition-period/permissionless.test.ts new file mode 100644 index 000000000..85da398e5 --- /dev/null +++ b/packages/horizon/test/integration/during-transition-period/permissionless.test.ts @@ -0,0 +1,69 @@ +import hre from 'hardhat' + +import { ethers } from 'hardhat' +import { expect } from 'chai' +import { generatePOI } from '@graphprotocol/toolshed' +import { indexers } from '../../../tasks/test/fixtures/indexers' + +import type { HardhatEthersSigner } from '@nomicfoundation/hardhat-ethers/signers' +import type { HorizonStakingExtension } from '@graphprotocol/toolshed/deployments' + +describe('Permissionless', () => { + let snapshotId: string + + const graph = hre.graph() + const horizonStaking = graph.horizon.contracts.HorizonStaking + const epochManager = graph.horizon.contracts.EpochManager + const subgraphServiceAddress = '0x0000000000000000000000000000000000000000' + + beforeEach(async () => { + // Take a snapshot before each test + snapshotId = await ethers.provider.send('evm_snapshot', []) + }) + + afterEach(async () => { + // Revert to the snapshot after each test + await ethers.provider.send('evm_revert', [snapshotId]) + }) + + describe('After max allocation epochs', () => { + let indexer: HardhatEthersSigner + let anySigner: HardhatEthersSigner + let allocationID: string + let allocationTokens: bigint + + before(async () => { + // Get signers + indexer = await ethers.getSigner(indexers[0].address) + ;[anySigner] = await graph.accounts.getTestAccounts() + + // ensure anySigner is not operator for the indexer + await horizonStaking.connect(indexer).setOperator(subgraphServiceAddress, anySigner.address, false) + + // Get allocation details + allocationID = indexers[0].allocations[0].allocationID + allocationTokens = indexers[0].allocations[0].tokens + }) + + it('should allow any user to close an allocation after 28 epochs', async () => { + // Get indexer's idle stake before closing allocation + const idleStakeBefore = await horizonStaking.getIdleStake(indexer.address) + + // Mine blocks to simulate 28 epochs passing + const startingEpoch = await epochManager.currentEpoch() + while (await epochManager.currentEpoch() - startingEpoch < 28) { + await ethers.provider.send('evm_mine', []) + } + + // Close allocation + const poi = generatePOI('poi') + await (horizonStaking as HorizonStakingExtension).connect(anySigner).closeAllocation(allocationID, poi) + + // Get indexer's idle stake after closing allocation + const idleStakeAfter = await horizonStaking.getIdleStake(indexer.address) + + // Verify allocation tokens were added to indexer's idle stake but no rewards were collected + expect(idleStakeAfter).to.be.equal(idleStakeBefore + allocationTokens) + }) + }) +}) diff --git a/packages/horizon/test/integration/during-transition-period/service-provider.test.ts b/packages/horizon/test/integration/during-transition-period/service-provider.test.ts new file mode 100644 index 000000000..23c0f0f30 --- /dev/null +++ b/packages/horizon/test/integration/during-transition-period/service-provider.test.ts @@ -0,0 +1,476 @@ +import hre from 'hardhat' + +import { generatePOI, ONE_MILLION } from '@graphprotocol/toolshed' +import { getEventData, setGRTBalance } from '@graphprotocol/toolshed/hardhat' +import { ethers } from 'hardhat' +import { expect } from 'chai' +import { indexers } from '../../../tasks/test/fixtures/indexers' + +import type { HardhatEthersSigner } from '@nomicfoundation/hardhat-ethers/signers' +import type { HorizonStakingExtension } from '@graphprotocol/toolshed/deployments' + +describe('Service Provider', () => { + let snapshotId: string + + const graph = hre.graph() + const { stake, collect } = graph.horizon.actions + const horizonStaking = graph.horizon.contracts.HorizonStaking + const horizonStakingExtension = horizonStaking as HorizonStakingExtension + const graphToken = graph.horizon.contracts.L2GraphToken + + // Subgraph service address is not set for integration tests + const subgraphServiceAddress = '0x0000000000000000000000000000000000000000' + + beforeEach(async () => { + // Take a snapshot before each test + snapshotId = await ethers.provider.send('evm_snapshot', []) + }) + + afterEach(async () => { + // Revert to the snapshot after each test + await ethers.provider.send('evm_revert', [snapshotId]) + }) + + describe(('New Protocol Users'), () => { + let serviceProvider: HardhatEthersSigner + let tokensToStake = ethers.parseEther('1000') + + before(async () => { + [,,serviceProvider] = await graph.accounts.getTestAccounts() + await setGRTBalance(graph.provider, graphToken.target, serviceProvider.address, ONE_MILLION) + + // Stake tokens to service provider + await stake(serviceProvider, [tokensToStake]) + }) + + it('should allow service provider to unstake and withdraw after thawing period', async () => { + const tokensToUnstake = ethers.parseEther('100') + const balanceBefore = await graphToken.balanceOf(serviceProvider.address) + + // First unstake request + await horizonStaking.connect(serviceProvider).unstake(tokensToUnstake) + + // During transition period, tokens are locked by thawing period + const thawingPeriod = await horizonStaking.__DEPRECATED_getThawingPeriod() + + // Mine remaining blocks to complete thawing period + for (let i = 0; i < Number(thawingPeriod) + 1; i++) { + await ethers.provider.send('evm_mine', []) + } + + // Now we can withdraw + await horizonStaking.connect(serviceProvider).withdraw() + const balanceAfter = await graphToken.balanceOf(serviceProvider.address) + + expect(balanceAfter).to.equal(balanceBefore + tokensToUnstake, 'Tokens were not transferred back to service provider') + }) + + it('should handle multiple unstake requests correctly', async () => { + // Make multiple unstake requests + const request1 = ethers.parseEther('50') + const request2 = ethers.parseEther('75') + + const thawingPeriod = await horizonStaking.__DEPRECATED_getThawingPeriod() + + // First unstake request + await horizonStaking.connect(serviceProvider).unstake(request1) + + // Mine half of thawing period blocks + const halfThawingPeriod = Number(thawingPeriod) / 2 + for (let i = 0; i < halfThawingPeriod; i++) { + await ethers.provider.send('evm_mine', []) + } + + // Second unstake request + await horizonStaking.connect(serviceProvider).unstake(request2) + + // Mine remaining blocks to complete first unstake thawing period + for (let i = 0; i < halfThawingPeriod; i++) { + await ethers.provider.send('evm_mine', []) + } + + // Check that withdraw reverts since thawing period is not complete + await expect( + horizonStaking.connect(serviceProvider).withdraw(), + ).to.be.revertedWithCustomError(horizonStaking, 'HorizonStakingStillThawing') + + // Mine remaining blocks to complete thawing period + for (let i = 0; i < halfThawingPeriod + 1; i++) { + await ethers.provider.send('evm_mine', []) + } + + // Get balance before withdrawing + const balanceBefore = await graphToken.balanceOf(serviceProvider.address) + + // Withdraw all thawed tokens + await horizonStaking.connect(serviceProvider).withdraw() + + // Verify all tokens are withdrawn and transferred back to service provider + const balanceAfter = await graphToken.balanceOf(serviceProvider.address) + expect(balanceAfter).to.equal(balanceBefore + request1 + request2, 'Tokens were not transferred back to service provider') + }) + + describe('Transition period is over', () => { + let governor: HardhatEthersSigner + let tokensToUnstake: bigint + + before(async () => { + // Get governor + governor = await graph.accounts.getGovernor() + + // Set tokens + tokensToStake = ethers.parseEther('100000') + tokensToUnstake = ethers.parseEther('10000') + }) + + it('should be able to withdraw tokens that were unstaked during transition period', async () => { + // Stake tokens + await stake(serviceProvider, [tokensToStake]) + + // Unstake tokens + await horizonStaking.connect(serviceProvider).unstake(tokensToUnstake) + + // Get balance before withdrawing + const balanceBefore = await graphToken.balanceOf(serviceProvider.address) + + // Get thawing period + const thawingPeriod = await horizonStaking.__DEPRECATED_getThawingPeriod() + + // Clear thawing period + await horizonStaking.connect(governor).clearThawingPeriod() + + // Mine blocks to complete thawing period + for (let i = 0; i < Number(thawingPeriod) + 1; i++) { + await ethers.provider.send('evm_mine', []) + } + + // Withdraw tokens + await horizonStaking.connect(serviceProvider).withdraw() + + // Get balance after withdrawing + const balanceAfter = await graphToken.balanceOf(serviceProvider.address) + expect(balanceAfter).to.equal(balanceBefore + tokensToUnstake, 'Tokens were not transferred back to service provider') + }) + + it('should be able to unstake tokens without a thawing period', async () => { + // Stake tokens + await stake(serviceProvider, [tokensToStake]) + + // Clear thawing period + await horizonStaking.connect(governor).clearThawingPeriod() + + // Get balance before withdrawing + const balanceBefore = await graphToken.balanceOf(serviceProvider.address) + + // Unstake tokens + await horizonStaking.connect(serviceProvider).unstake(tokensToUnstake) + + // Get balance after withdrawing + const balanceAfter = await graphToken.balanceOf(serviceProvider.address) + expect(balanceAfter).to.equal(balanceBefore + tokensToUnstake, 'Tokens were not transferred back to service provider') + }) + }) + }) + + describe('Existing Protocol Users', () => { + let indexer: HardhatEthersSigner + let tokensUnstaked: bigint + + before(async () => { + const indexerFixture = indexers[0] + indexer = await ethers.getSigner(indexerFixture.address) + tokensUnstaked = indexerFixture.tokensToUnstake || 0n + + await setGRTBalance(graph.provider, graphToken.target, indexer.address, ONE_MILLION) + }) + + it('should allow service provider to withdraw their locked tokens after thawing period passes', async () => { + // Get balance before withdrawing + const balanceBefore = await graphToken.balanceOf(indexer.address) + + // Get thawing period + const thawingPeriod = await horizonStaking.__DEPRECATED_getThawingPeriod() + + // Mine blocks to complete thawing period + for (let i = 0; i < Number(thawingPeriod) + 1; i++) { + await ethers.provider.send('evm_mine', []) + } + + // Withdraw tokens + await horizonStaking.connect(indexer).withdraw() + + // Verify tokens are transferred back to service provider + const balanceAfter = await graphToken.balanceOf(indexer.address) + expect(balanceAfter).to.equal(balanceBefore + tokensUnstaked, 'Tokens were not transferred back to service provider') + }) + + describe('Legacy allocations', () => { + describe('Restaking', () => { + let delegationIndexingCut: number + let delegationQueryFeeCut: number + let allocationID: string + let allocationTokens: bigint + let gateway: HardhatEthersSigner + + beforeEach(async () => { + const indexerFixture = indexers[0] + indexer = await ethers.getSigner(indexerFixture.address) + delegationIndexingCut = indexerFixture.indexingRewardCut + delegationQueryFeeCut = indexerFixture.queryFeeCut + allocationID = indexerFixture.allocations[0].allocationID + allocationTokens = indexerFixture.allocations[0].tokens + gateway = await graph.accounts.getGateway() + await setGRTBalance(graph.provider, graphToken.target, gateway.address, ONE_MILLION) + }) + + it('should be able to close an open legacy allocation and collect rewards', async () => { + // Use a non-zero POI + const poi = generatePOI('poi') + const thawingPeriod = await horizonStaking.__DEPRECATED_getThawingPeriod() + + // Get delegation pool before closing allocation + const delegationPoolBefore = await horizonStaking.getDelegationPool(indexer.address, subgraphServiceAddress) + const delegationPoolTokensBefore = delegationPoolBefore.tokens + + // Mine blocks to simulate time passing + const halfThawingPeriod = Number(thawingPeriod) / 2 + for (let i = 0; i < halfThawingPeriod; i++) { + await ethers.provider.send('evm_mine', []) + } + + // Get idle stake before closing allocation + const idleStakeBefore = await horizonStaking.getIdleStake(indexer.address) + + // Close allocation + const tx = await horizonStakingExtension.connect(indexer).closeAllocation(allocationID, poi) + const eventData = await getEventData(tx, 'event HorizonRewardsAssigned(address indexed indexer, address indexed allocationID, uint256 amount)') + const rewards = eventData[2] + + // Verify rewards are not zero + expect(rewards).to.not.equal(0, 'Rewards were not transferred to service provider') + + // Verify rewards minus delegation cut are restaked + const idleStakeAfter = await horizonStaking.getIdleStake(indexer.address) + const idleStakeRewardsTokens = rewards * BigInt(delegationIndexingCut) / 1000000n + expect(idleStakeAfter).to.equal(idleStakeBefore + allocationTokens + idleStakeRewardsTokens, 'Rewards were not restaked') + + // Verify delegators cut is added to delegation pool + const delegationPool = await horizonStaking.getDelegationPool(indexer.address, subgraphServiceAddress) + const delegationPoolTokensAfter = delegationPool.tokens + const delegationRewardsTokens = rewards - idleStakeRewardsTokens + expect(delegationPoolTokensAfter).to.equal(delegationPoolTokensBefore + delegationRewardsTokens, 'Delegators cut was not added to delegation pool') + }) + + it('should be able to collect query fees', async () => { + const tokensToCollect = ethers.parseEther('1000') + + // Get idle stake before collecting + const idleStakeBefore = await horizonStaking.getIdleStake(indexer.address) + + // Get delegation pool before collecting + const delegationPoolBefore = await horizonStaking.getDelegationPool(indexer.address, subgraphServiceAddress) + const delegationPoolTokensBefore = delegationPoolBefore.tokens + + // Collect query fees + await collect(gateway, [tokensToCollect, allocationID]) + + // Get idle stake after collecting + const idleStakeAfter = await horizonStaking.getIdleStake(indexer.address) + + // Subtract protocol tax (1%) and curation fees (10% after the protocol tax deduction) + const protocolTax = tokensToCollect * 1n / 100n + const curationFees = tokensToCollect * 99n / 1000n + const remainingTokens = tokensToCollect - protocolTax - curationFees + + // Verify tokens minus delegators cut are restaked + const indexerCutTokens = remainingTokens * BigInt(delegationQueryFeeCut) / 1000000n + expect(idleStakeAfter).to.equal(idleStakeBefore + indexerCutTokens, 'Indexer cut was not restaked') + + // Verify delegators cut is added to delegation pool + const delegationPool = await horizonStaking.getDelegationPool(indexer.address, subgraphServiceAddress) + const delegationPoolTokensAfter = delegationPool.tokens + const delegationCutTokens = remainingTokens - indexerCutTokens + expect(delegationPoolTokensAfter).to.equal(delegationPoolTokensBefore + delegationCutTokens, 'Delegators cut was not added to delegation pool') + }) + + it('should be able to close an allocation and collect query fees for the closed allocation', async () => { + // Use a non-zero POI + const poi = generatePOI('poi') + const thawingPeriod = await horizonStaking.__DEPRECATED_getThawingPeriod() + + // Mine blocks to simulate time passing + const halfThawingPeriod = Number(thawingPeriod) / 2 + for (let i = 0; i < halfThawingPeriod; i++) { + await ethers.provider.send('evm_mine', []) + } + + // Close allocation + await horizonStakingExtension.connect(indexer).closeAllocation(allocationID, poi) + + // Tokens to collect + const tokensToCollect = ethers.parseEther('1000') + + // Get idle stake before collecting + const idleStakeBefore = await horizonStaking.getIdleStake(indexer.address) + + // Get delegation pool before collecting + const delegationPoolBefore = await horizonStaking.getDelegationPool(indexer.address, subgraphServiceAddress) + const delegationPoolTokensBefore = delegationPoolBefore.tokens + + // Collect query fees + await collect(gateway, [tokensToCollect, allocationID]) + + // Get idle stake after collecting + const idleStakeAfter = await horizonStaking.getIdleStake(indexer.address) + + // Subtract protocol tax (1%) and curation fees (10% after the protocol tax deduction) + const protocolTax = tokensToCollect * 1n / 100n + const curationFees = tokensToCollect * 99n / 1000n + const remainingTokens = tokensToCollect - protocolTax - curationFees + + // Verify tokens minus delegators cut are restaked + const indexerCutTokens = remainingTokens * BigInt(delegationQueryFeeCut) / 1000000n + expect(idleStakeAfter).to.equal(idleStakeBefore + indexerCutTokens, 'Indexer cut was not restaked') + + // Verify delegators cut is added to delegation pool + const delegationPool = await horizonStaking.getDelegationPool(indexer.address, subgraphServiceAddress) + const delegationPoolTokensAfter = delegationPool.tokens + const delegationCutTokens = remainingTokens - indexerCutTokens + expect(delegationPoolTokensAfter).to.equal(delegationPoolTokensBefore + delegationCutTokens, 'Delegators cut was not added to delegation pool') + }) + }) + + describe('With rewardsDestination set', () => { + let delegationIndexingCut: number + let delegationQueryFeeCut: number + let rewardsDestination: string + let allocationID: string + let gateway: HardhatEthersSigner + + beforeEach(async () => { + const indexerFixture = indexers[1] + indexer = await ethers.getSigner(indexerFixture.address) + delegationIndexingCut = indexerFixture.indexingRewardCut + delegationQueryFeeCut = indexerFixture.queryFeeCut + rewardsDestination = indexerFixture.rewardsDestination! + allocationID = indexerFixture.allocations[0].allocationID + gateway = await graph.accounts.getGateway() + await setGRTBalance(graph.provider, graphToken.target, gateway.address, ONE_MILLION) + }) + + it('should be able to close an open allocation and collect rewards', async () => { + // Use a non-zero POI + const poi = generatePOI('poi') + const thawingPeriod = await horizonStaking.__DEPRECATED_getThawingPeriod() + + // Get delegation tokens before + const delegationPoolBefore = await horizonStaking.getDelegationPool(indexer.address, subgraphServiceAddress) + const delegationPoolTokensBefore = delegationPoolBefore.tokens + + // Mine blocks to simulate time passing + const halfThawingPeriod = Number(thawingPeriod) / 2 + for (let i = 0; i < halfThawingPeriod; i++) { + await ethers.provider.send('evm_mine', []) + } + + // Get rewards destination balance before closing allocation + const balanceBefore = await graphToken.balanceOf(rewardsDestination) + + // Close allocation + const tx = await horizonStakingExtension.connect(indexer).closeAllocation(allocationID, poi) + const eventData = await getEventData(tx, 'event HorizonRewardsAssigned(address indexed indexer, address indexed allocationID, uint256 amount)') + const rewards = eventData[2] + + // Verify rewards are not zero + expect(rewards).to.not.equal(0, 'Rewards were not transferred to rewards destination') + + // Verify indexer rewards cut is transferred to rewards destination + const balanceAfter = await graphToken.balanceOf(rewardsDestination) + const indexerCutTokens = rewards * BigInt(delegationIndexingCut) / 1000000n + expect(balanceAfter).to.equal(balanceBefore + indexerCutTokens, 'Indexer cut was not transferred to rewards destination') + + // Verify delegators cut is added to delegation pool + const delegationPoolAfter = await horizonStaking.getDelegationPool(indexer.address, subgraphServiceAddress) + const delegationPoolTokensAfter = delegationPoolAfter.tokens + const delegationCutTokens = rewards - indexerCutTokens + expect(delegationPoolTokensAfter).to.equal(delegationPoolTokensBefore + delegationCutTokens, 'Delegators cut was not added to delegation pool') + }) + + it('should be able to collect query fees', async () => { + const tokensToCollect = ethers.parseEther('1000') + + // Get rewards destination balance before collecting + const balanceBefore = await graphToken.balanceOf(rewardsDestination) + + // Get delegation tokens before + const delegationPoolBefore = await horizonStaking.getDelegationPool(indexer.address, subgraphServiceAddress) + const delegationPoolTokensBefore = delegationPoolBefore.tokens + + // Collect query fees + await collect(gateway, [tokensToCollect, allocationID]) + + // Get rewards destination balance after collecting + const balanceAfter = await graphToken.balanceOf(rewardsDestination) + + // Subtract protocol tax (1%) and curation fees (10% after the protocol tax deduction) + const protocolTax = tokensToCollect * 1n / 100n + const curationFees = tokensToCollect * 99n / 1000n + const remainingTokens = tokensToCollect - protocolTax - curationFees + + // Verify indexer cut is transferred to rewards destination + const indexerCutTokens = remainingTokens * BigInt(delegationQueryFeeCut) / 1000000n + expect(balanceAfter).to.equal(balanceBefore + indexerCutTokens, 'Indexer cut was not transferred to rewards destination') + + // Verify delegators cut is added to delegation pool + const delegationPoolAfter = await horizonStaking.getDelegationPool(indexer.address, subgraphServiceAddress) + const delegationPoolTokensAfter = delegationPoolAfter.tokens + const delegationCutTokens = remainingTokens - indexerCutTokens + expect(delegationPoolTokensAfter).to.equal(delegationPoolTokensBefore + delegationCutTokens, 'Delegators cut was not added to delegation pool') + }) + }) + }) + + describe('Transition period is over', () => { + let governor: HardhatEthersSigner + let tokensToUnstake: bigint + + before(async () => { + // Get governor + governor = await graph.accounts.getGovernor() + + // Get indexer + const indexerFixture = indexers[2] + indexer = await ethers.getSigner(indexerFixture.address) + + // Set tokens + tokensToUnstake = ethers.parseEther('10000') + }) + + it('should be able to withdraw tokens that were unstaked during transition period', async () => { + // Unstake tokens during transition period + await horizonStaking.connect(indexer).unstake(tokensToUnstake) + + // Get thawing period + const thawingPeriod = await horizonStaking.__DEPRECATED_getThawingPeriod() + + // Clear thawing period + await horizonStaking.connect(governor).clearThawingPeriod() + + // Mine blocks to complete thawing period + for (let i = 0; i < Number(thawingPeriod) + 1; i++) { + await ethers.provider.send('evm_mine', []) + } + + // Get balance before withdrawing + const balanceBefore = await graphToken.balanceOf(indexer.address) + + // Withdraw tokens + await horizonStaking.connect(indexer).withdraw() + + // Get balance after withdrawing + const balanceAfter = await graphToken.balanceOf(indexer.address) + expect(balanceAfter).to.equal(balanceBefore + tokensToUnstake, 'Tokens were not transferred back to service provider') + }) + }) + }) +}) diff --git a/packages/horizon/test/integration/during-transition-period/slasher.test.ts b/packages/horizon/test/integration/during-transition-period/slasher.test.ts new file mode 100644 index 000000000..50fb80e69 --- /dev/null +++ b/packages/horizon/test/integration/during-transition-period/slasher.test.ts @@ -0,0 +1,85 @@ +import hre from 'hardhat' + +import { ethers } from 'hardhat' +import { expect } from 'chai' + +import { indexers } from '../../../tasks/test/fixtures/indexers' + +import type { HardhatEthersSigner } from '@nomicfoundation/hardhat-ethers/signers' + +describe('Slasher', () => { + let snapshotId: string + + let indexer: string + let slasher: HardhatEthersSigner + let tokensToSlash: bigint + + const graph = hre.graph() + const horizonStaking = graph.horizon.contracts.HorizonStaking + const graphToken = graph.horizon.contracts.L2GraphToken + + before(async () => { + slasher = await graph.accounts.getArbitrator() + }) + + beforeEach(async () => { + // Take a snapshot before each test + snapshotId = await ethers.provider.send('evm_snapshot', []) + }) + + afterEach(async () => { + // Revert to the snapshot after each test + await ethers.provider.send('evm_revert', [snapshotId]) + }) + + describe('Available tokens', () => { + before(() => { + const indexerFixture = indexers[0] + indexer = indexerFixture.address + tokensToSlash = ethers.parseEther('10000') + }) + + it('should be able to slash indexer stake', async () => { + // Before slash state + const idleStakeBeforeSlash = await horizonStaking.getIdleStake(indexer) + const tokensVerifier = tokensToSlash / 2n + const slasherBeforeBalance = await graphToken.balanceOf(slasher.address) + + // Slash tokens + await horizonStaking.connect(slasher).slash(indexer, tokensToSlash, tokensVerifier, slasher.address) + + // Indexer's stake should have decreased + const idleStakeAfterSlash = await horizonStaking.getIdleStake(indexer) + expect(idleStakeAfterSlash).to.equal(idleStakeBeforeSlash - tokensToSlash, 'Indexer stake should have decreased') + + // Slasher should have received the tokens + const slasherAfterBalance = await graphToken.balanceOf(slasher.address) + expect(slasherAfterBalance).to.equal(slasherBeforeBalance + tokensVerifier, 'Slasher should have received the tokens') + }) + }) + + describe('Locked tokens', () => { + before(() => { + const indexerFixture = indexers[1] + indexer = indexerFixture.address + tokensToSlash = indexerFixture.stake + }) + + it('should be able to slash locked tokens', async () => { + // Before slash state + const tokensVerifier = tokensToSlash / 2n + const slasherBeforeBalance = await graphToken.balanceOf(slasher.address) + + // Slash tokens + await horizonStaking.connect(slasher).slash(indexer, tokensToSlash, tokensVerifier, slasher.address) + + // Indexer's entire stake should have been slashed + const indexerStakeAfterSlash = await horizonStaking.getServiceProvider(indexer) + expect(indexerStakeAfterSlash.tokensStaked).to.equal(0n, 'Indexer stake should have been slashed') + + // Slasher should have received the tokens + const slasherAfterBalance = await graphToken.balanceOf(slasher.address) + expect(slasherAfterBalance).to.equal(slasherBeforeBalance + tokensVerifier, 'Slasher should have received the tokens') + }) + }) +}) diff --git a/packages/horizon/test/unit/GraphBase.t.sol b/packages/horizon/test/unit/GraphBase.t.sol new file mode 100644 index 000000000..0a72c8c0e --- /dev/null +++ b/packages/horizon/test/unit/GraphBase.t.sol @@ -0,0 +1,265 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { Create2 } from "@openzeppelin/contracts/utils/Create2.sol"; +import { GraphProxyAdmin } from "@graphprotocol/contracts/contracts/upgrades/GraphProxyAdmin.sol"; +import { GraphProxy } from "@graphprotocol/contracts/contracts/upgrades/GraphProxy.sol"; +import { Controller } from "@graphprotocol/contracts/contracts/governance/Controller.sol"; +import { TransparentUpgradeableProxy } from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; + +import { PaymentsEscrow } from "contracts/payments/PaymentsEscrow.sol"; +import { GraphPayments } from "contracts/payments/GraphPayments.sol"; +import { GraphTallyCollector } from "contracts/payments/collectors/GraphTallyCollector.sol"; +import { IHorizonStaking } from "contracts/interfaces/IHorizonStaking.sol"; +import { HorizonStaking } from "contracts/staking/HorizonStaking.sol"; +import { HorizonStakingExtension } from "contracts/staking/HorizonStakingExtension.sol"; +import { IHorizonStakingTypes } from "contracts/interfaces/internal/IHorizonStakingTypes.sol"; +import { MockGRTToken } from "../../contracts/mocks/MockGRTToken.sol"; +import { EpochManagerMock } from "contracts/mocks/EpochManagerMock.sol"; +import { RewardsManagerMock } from "contracts/mocks/RewardsManagerMock.sol"; +import { CurationMock } from "contracts/mocks/CurationMock.sol"; +import { Constants } from "./utils/Constants.sol"; +import { Users } from "./utils/Users.sol"; +import { Utils } from "./utils/Utils.sol"; + +abstract contract GraphBaseTest is IHorizonStakingTypes, Utils, Constants { + /* + * VARIABLES + */ + + /* Contracts */ + + GraphProxyAdmin public proxyAdmin; + Controller public controller; + MockGRTToken public token; + GraphPayments public payments; + PaymentsEscrow public escrow; + IHorizonStaking public staking; + EpochManagerMock public epochManager; + RewardsManagerMock public rewardsManager; + CurationMock public curation; + GraphTallyCollector graphTallyCollector; + + HorizonStaking private stakingBase; + HorizonStakingExtension private stakingExtension; + + address subgraphDataServiceLegacyAddress = makeAddr("subgraphDataServiceLegacyAddress"); + address subgraphDataServiceAddress = makeAddr("subgraphDataServiceAddress"); + + address graphTokenGatewayAddress = makeAddr("GraphTokenGateway"); + + /* Users */ + + Users internal users; + + /* + * SET UP + */ + + function setUp() public virtual { + // Deploy ERC20 token + vm.prank(users.deployer); + token = new MockGRTToken(); + + // Setup Users + users = Users({ + governor: createUser("governor"), + deployer: createUser("deployer"), + indexer: createUser("indexer"), + operator: createUser("operator"), + gateway: createUser("gateway"), + verifier: createUser("verifier"), + delegator: createUser("delegator"), + legacySlasher: createUser("legacySlasher") + }); + + // Deploy protocol contracts + deployProtocolContracts(); + setupProtocol(); + unpauseProtocol(); + + // Label contracts + vm.label({ account: address(controller), newLabel: "Controller" }); + vm.label({ account: address(token), newLabel: "GraphToken" }); + vm.label({ account: address(payments), newLabel: "GraphPayments" }); + vm.label({ account: address(escrow), newLabel: "PaymentsEscrow" }); + vm.label({ account: address(staking), newLabel: "HorizonStaking" }); + vm.label({ account: address(stakingExtension), newLabel: "HorizonStakingExtension" }); + vm.label({ account: address(graphTallyCollector), newLabel: "GraphTallyCollector" }); + + // Ensure caller is back to the original msg.sender + vm.stopPrank(); + } + + function deployProtocolContracts() private { + vm.startPrank(users.governor); + proxyAdmin = new GraphProxyAdmin(); + controller = new Controller(); + + // Staking Proxy + resetPrank(users.deployer); + GraphProxy stakingProxy = new GraphProxy(address(0), address(proxyAdmin)); + + // GraphPayments predict address + bytes memory paymentsImplementationParameters = abi.encode(address(controller), protocolPaymentCut); + bytes memory paymentsImplementationBytecode = abi.encodePacked( + type(GraphPayments).creationCode, + paymentsImplementationParameters + ); + address predictedPaymentsImplementationAddress = _computeAddress( + "GraphPayments", + paymentsImplementationBytecode, + users.deployer + ); + + bytes memory paymentsProxyParameters = abi.encode( + predictedPaymentsImplementationAddress, + users.governor, + abi.encodeCall(GraphPayments.initialize, ()) + ); + bytes memory paymentsProxyBytecode = abi.encodePacked( + type(TransparentUpgradeableProxy).creationCode, + paymentsProxyParameters + ); + address predictedPaymentsProxyAddress = _computeAddress( + "TransparentUpgradeableProxy", + paymentsProxyBytecode, + users.deployer + ); + + // PaymentsEscrow + bytes memory escrowImplementationParameters = abi.encode(address(controller), withdrawEscrowThawingPeriod); + bytes memory escrowImplementationBytecode = abi.encodePacked( + type(PaymentsEscrow).creationCode, + escrowImplementationParameters + ); + address predictedEscrowImplementationAddress = _computeAddress( + "PaymentsEscrow", + escrowImplementationBytecode, + users.deployer + ); + + bytes memory escrowProxyParameters = abi.encode( + predictedEscrowImplementationAddress, + users.governor, + abi.encodeCall(PaymentsEscrow.initialize, ()) + ); + bytes memory escrowProxyBytecode = abi.encodePacked( + type(TransparentUpgradeableProxy).creationCode, + escrowProxyParameters + ); + address predictedEscrowProxyAddress = _computeAddress( + "TransparentUpgradeableProxy", + escrowProxyBytecode, + users.deployer + ); + + // Epoch Manager + epochManager = new EpochManagerMock(); + + // Rewards Manager + rewardsManager = new RewardsManagerMock(token, ALLOCATIONS_REWARD_CUT); + + // Curation + curation = new CurationMock(); + + // Setup controller + resetPrank(users.governor); + controller.setContractProxy(keccak256("GraphToken"), address(token)); + controller.setContractProxy(keccak256("PaymentsEscrow"), predictedEscrowProxyAddress); + controller.setContractProxy(keccak256("GraphPayments"), predictedPaymentsProxyAddress); + controller.setContractProxy(keccak256("Staking"), address(stakingProxy)); + controller.setContractProxy(keccak256("EpochManager"), address(epochManager)); + controller.setContractProxy(keccak256("RewardsManager"), address(rewardsManager)); + controller.setContractProxy(keccak256("Curation"), address(curation)); + controller.setContractProxy(keccak256("GraphTokenGateway"), graphTokenGatewayAddress); + controller.setContractProxy(keccak256("GraphProxyAdmin"), address(proxyAdmin)); + + resetPrank(users.deployer); + { + address paymentsImplementationAddress = _deployContract("GraphPayments", paymentsImplementationBytecode); + address paymentsProxyAddress = _deployContract("TransparentUpgradeableProxy", paymentsProxyBytecode); + assertEq(paymentsImplementationAddress, predictedPaymentsImplementationAddress); + assertEq(paymentsProxyAddress, predictedPaymentsProxyAddress); + payments = GraphPayments(paymentsProxyAddress); + } + + { + address escrowImplementationAddress = _deployContract("PaymentsEscrow", escrowImplementationBytecode); + address escrowProxyAddress = _deployContract("TransparentUpgradeableProxy", escrowProxyBytecode); + assertEq(escrowImplementationAddress, predictedEscrowImplementationAddress); + assertEq(escrowProxyAddress, predictedEscrowProxyAddress); + escrow = PaymentsEscrow(escrowProxyAddress); + } + + stakingExtension = new HorizonStakingExtension(address(controller), subgraphDataServiceLegacyAddress); + stakingBase = new HorizonStaking( + address(controller), + address(stakingExtension), + subgraphDataServiceLegacyAddress + ); + + graphTallyCollector = new GraphTallyCollector( + "GraphTallyCollector", + "1", + address(controller), + revokeSignerThawingPeriod + ); + + resetPrank(users.governor); + proxyAdmin.upgrade(stakingProxy, address(stakingBase)); + proxyAdmin.acceptProxy(stakingBase, stakingProxy); + staking = IHorizonStaking(address(stakingProxy)); + } + + function setupProtocol() private { + resetPrank(users.governor); + staking.setMaxThawingPeriod(MAX_THAWING_PERIOD); + epochManager.setEpochLength(EPOCH_LENGTH); + } + + function unpauseProtocol() private { + resetPrank(users.governor); + controller.setPaused(false); + } + + function createUser(string memory name) internal returns (address) { + address user = makeAddr(name); + vm.deal({ account: user, newBalance: 100 ether }); + deal({ token: address(token), to: user, give: type(uint256).max }); + vm.label({ account: user, newLabel: name }); + return user; + } + + /* + * TOKEN HELPERS + */ + + function mint(address _address, uint256 amount) internal { + deal({ token: address(token), to: _address, give: amount }); + } + + function approve(address spender, uint256 amount) internal { + token.approve(spender, amount); + } + + /* + * PRIVATE + */ + + function _computeAddress( + string memory contractName, + bytes memory bytecode, + address deployer + ) private pure returns (address) { + bytes32 salt = keccak256(abi.encodePacked(contractName, "Salt")); + return Create2.computeAddress(salt, keccak256(bytecode), deployer); + } + + function _deployContract(string memory contractName, bytes memory bytecode) private returns (address) { + bytes32 salt = keccak256(abi.encodePacked(contractName, "Salt")); + return Create2.deploy(0, salt, bytecode); + } +} diff --git a/packages/horizon/test/unit/data-service/DataService.t.sol b/packages/horizon/test/unit/data-service/DataService.t.sol new file mode 100644 index 000000000..85c576308 --- /dev/null +++ b/packages/horizon/test/unit/data-service/DataService.t.sol @@ -0,0 +1,419 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity 0.8.27; + +import { IHorizonStakingMain } from "../../../contracts/interfaces/internal/IHorizonStakingMain.sol"; +import { HorizonStakingSharedTest } from "../shared/horizon-staking/HorizonStakingShared.t.sol"; +import { DataServiceBase } from "./implementations/DataServiceBase.sol"; +import { DataServiceOverride } from "./implementations/DataServiceOverride.sol"; +import { ProvisionManager } from "./../../../contracts/data-service/utilities/ProvisionManager.sol"; +import { PPMMath } from "./../../../contracts/libraries/PPMMath.sol"; + +contract DataServiceTest is HorizonStakingSharedTest { + DataServiceBase dataService; + DataServiceOverride dataServiceOverride; + + function setUp() public override { + super.setUp(); + + dataService = new DataServiceBase(address(controller)); + dataServiceOverride = new DataServiceOverride(address(controller)); + } + + function test_Constructor_WhenTheContractIsDeployedWithAValidController() external view { + _assert_delegationRatio(type(uint32).max); + _assert_provisionTokens_range(type(uint256).min, type(uint256).max); + _assert_verifierCut_range(type(uint32).min, uint32(PPMMath.MAX_PPM)); + _assert_thawingPeriod_range(type(uint64).min, type(uint64).max); + } + + // -- Delegation ratio -- + + function test_DelegationRatio_WhenSettingTheDelegationRatio(uint32 delegationRatio) external { + _assert_set_delegationRatio(delegationRatio); + } + + function test_DelegationRatio_WhenGettingTheDelegationRatio(uint32 ratio) external { + dataService.setDelegationRatio(ratio); + _assert_delegationRatio(ratio); + } + + // -- Provision tokens -- + + function test_ProvisionTokens_WhenSettingAValidRange(uint256 min, uint256 max) external { + vm.assume(min <= max); + _assert_set_provisionTokens_range(min, max); + } + + function test_ProvisionTokens_RevertWhen_SettingAnInvalidRange(uint256 min, uint256 max) external { + vm.assume(min > max); + + vm.expectRevert(abi.encodeWithSelector(ProvisionManager.ProvisionManagerInvalidRange.selector, min, max)); + dataService.setProvisionTokensRange(min, max); + } + + function test_ProvisionTokens_WhenGettingTheRange() external { + dataService.setProvisionTokensRange(dataService.PROVISION_TOKENS_MIN(), dataService.PROVISION_TOKENS_MAX()); + _assert_provisionTokens_range(dataService.PROVISION_TOKENS_MIN(), dataService.PROVISION_TOKENS_MAX()); + } + + function test_ProvisionTokens_WhenGettingTheRangeWithAnOverridenGetter() external { + // Overriden getter returns the const values regardless of the set range + dataServiceOverride.setProvisionTokensRange(0, 1); + (uint256 min, uint256 max) = dataServiceOverride.getProvisionTokensRange(); + + assertEq(min, dataServiceOverride.PROVISION_TOKENS_MIN()); + assertEq(max, dataServiceOverride.PROVISION_TOKENS_MAX()); + } + + function test_ProvisionTokens_WhenCheckingAValidProvision_WithThawing( + uint256 tokens, + uint256 tokensThaw + ) external useIndexer { + dataService.setProvisionTokensRange(dataService.PROVISION_TOKENS_MIN(), dataService.PROVISION_TOKENS_MAX()); + tokens = bound(tokens, dataService.PROVISION_TOKENS_MIN(), dataService.PROVISION_TOKENS_MAX()); + tokensThaw = bound(tokensThaw, tokens - dataService.PROVISION_TOKENS_MIN() + 1, tokens); + + _createProvision(users.indexer, address(dataService), tokens, 0, 0); + staking.thaw(users.indexer, address(dataService), tokensThaw); + vm.expectRevert( + abi.encodeWithSelector( + ProvisionManager.ProvisionManagerInvalidValue.selector, + "tokens", + tokens - tokensThaw, + dataService.PROVISION_TOKENS_MIN(), + dataService.PROVISION_TOKENS_MAX() + ) + ); + dataService.checkProvisionTokens(users.indexer); + } + + function test_ProvisionTokens_WhenCheckingAValidProvision(uint256 tokens) external useIndexer { + dataService.setProvisionTokensRange(dataService.PROVISION_TOKENS_MIN(), dataService.PROVISION_TOKENS_MAX()); + tokens = bound(tokens, dataService.PROVISION_TOKENS_MIN(), dataService.PROVISION_TOKENS_MAX()); + + _createProvision(users.indexer, address(dataService), tokens, 0, 0); + dataService.checkProvisionTokens(users.indexer); + } + + function test_ProvisionTokens_WhenCheckingWithAnOverridenChecker(uint256 tokens) external useIndexer { + vm.assume(tokens != 0); + dataServiceOverride.setProvisionTokensRange( + dataService.PROVISION_TOKENS_MIN(), + dataService.PROVISION_TOKENS_MAX() + ); + + // this checker accepts provisions with any amount of tokens + _createProvision(users.indexer, address(dataServiceOverride), tokens, 0, 0); + dataServiceOverride.checkProvisionTokens(users.indexer); + } + + function test_ProvisionTokens_RevertWhen_CheckingAnInvalidProvision(uint256 tokens) external useIndexer { + dataService.setProvisionTokensRange(dataService.PROVISION_TOKENS_MIN(), dataService.PROVISION_TOKENS_MAX()); + tokens = bound(tokens, 1, dataService.PROVISION_TOKENS_MIN() - 1); + + _createProvision(users.indexer, address(dataService), tokens, 0, 0); + vm.expectRevert( + abi.encodeWithSelector( + ProvisionManager.ProvisionManagerInvalidValue.selector, + "tokens", + tokens, + dataService.PROVISION_TOKENS_MIN(), + dataService.PROVISION_TOKENS_MAX() + ) + ); + dataService.checkProvisionTokens(users.indexer); + } + + // -- Verifier cut -- + + function test_VerifierCut_WhenSettingAValidRange(uint32 min, uint32 max) external { + vm.assume(min <= max); + vm.assume(max <= uint32(PPMMath.MAX_PPM)); + _assert_set_verifierCut_range(min, max); + } + + function test_VerifierCut_RevertWhen_SettingAnInvalidRange(uint32 min, uint32 max) external { + vm.assume(min > max); + + vm.expectRevert(abi.encodeWithSelector(ProvisionManager.ProvisionManagerInvalidRange.selector, min, max)); + dataService.setVerifierCutRange(min, max); + } + + function test_VerifierCut_RevertWhen_SettingAnInvalidMax(uint32 min, uint32 max) external { + vm.assume(max > uint32(PPMMath.MAX_PPM)); + vm.assume(min <= max); + + vm.expectRevert(abi.encodeWithSelector(ProvisionManager.ProvisionManagerInvalidRange.selector, min, max)); + dataService.setVerifierCutRange(min, max); + } + + function test_VerifierCut_WhenGettingTheRange() external { + dataService.setVerifierCutRange(dataService.VERIFIER_CUT_MIN(), dataService.VERIFIER_CUT_MAX()); + _assert_verifierCut_range(dataService.VERIFIER_CUT_MIN(), dataService.VERIFIER_CUT_MAX()); + } + + function test_VerifierCut_WhenGettingTheRangeWithAnOverridenGetter() external { + // Overriden getter returns the const values regardless of the set range + dataServiceOverride.setVerifierCutRange(0, 1); + (uint32 min, uint32 max) = dataServiceOverride.getVerifierCutRange(); + assertEq(min, dataServiceOverride.VERIFIER_CUT_MIN()); + assertEq(max, dataServiceOverride.VERIFIER_CUT_MAX()); + } + + function test_VerifierCut_WhenCheckingAValidProvision(uint32 verifierCut) external useIndexer { + dataService.setVerifierCutRange(dataService.VERIFIER_CUT_MIN(), dataService.VERIFIER_CUT_MAX()); + verifierCut = uint32(bound(verifierCut, dataService.VERIFIER_CUT_MIN(), dataService.VERIFIER_CUT_MAX())); + + _createProvision(users.indexer, address(dataService), dataService.PROVISION_TOKENS_MIN(), verifierCut, 0); + dataService.checkProvisionParameters(users.indexer, false); + } + + function test_VerifierCut_WhenCheckingWithAnOverridenChecker(uint32 verifierCut) external useIndexer { + verifierCut = uint32(bound(verifierCut, 0, uint32(PPMMath.MAX_PPM))); + dataServiceOverride.setVerifierCutRange(dataService.VERIFIER_CUT_MIN(), dataService.VERIFIER_CUT_MAX()); + + // this checker accepts provisions with any verifier cut range + _createProvision(users.indexer, address(dataService), dataService.PROVISION_TOKENS_MIN(), verifierCut, 0); + dataServiceOverride.checkProvisionParameters(users.indexer, false); + } + + function test_VerifierCut_RevertWhen_CheckingAnInvalidProvision(uint32 verifierCut) external useIndexer { + dataService.setVerifierCutRange(dataService.VERIFIER_CUT_MIN(), dataService.VERIFIER_CUT_MAX()); + verifierCut = uint32(bound(verifierCut, 0, dataService.VERIFIER_CUT_MIN() - 1)); + + _createProvision(users.indexer, address(dataService), dataService.PROVISION_TOKENS_MIN(), verifierCut, 0); + vm.expectRevert( + abi.encodeWithSelector( + ProvisionManager.ProvisionManagerInvalidValue.selector, + "maxVerifierCut", + verifierCut, + dataService.VERIFIER_CUT_MIN(), + dataService.VERIFIER_CUT_MAX() + ) + ); + dataService.checkProvisionParameters(users.indexer, false); + } + + // -- Thawing period -- + + function test_ThawingPeriod_WhenSettingAValidRange(uint64 min, uint64 max) external { + vm.assume(min <= max); + _assert_set_thawingPeriod_range(min, max); + } + + function test_ThawingPeriod_RevertWhen_SettingAnInvalidRange(uint64 min, uint64 max) external { + vm.assume(min > max); + + vm.expectRevert(abi.encodeWithSelector(ProvisionManager.ProvisionManagerInvalidRange.selector, min, max)); + dataService.setThawingPeriodRange(min, max); + } + + function test_ThawingPeriod_WhenGettingTheRange() external { + dataService.setThawingPeriodRange(dataService.THAWING_PERIOD_MIN(), dataService.THAWING_PERIOD_MAX()); + _assert_thawingPeriod_range(dataService.THAWING_PERIOD_MIN(), dataService.THAWING_PERIOD_MAX()); + } + + function test_ThawingPeriod_WhenGettingTheRangeWithAnOverridenGetter() external { + // Overriden getter returns the const values regardless of the set range + dataServiceOverride.setThawingPeriodRange(0, 1); + (uint64 min, uint64 max) = dataServiceOverride.getThawingPeriodRange(); + assertEq(min, dataServiceOverride.THAWING_PERIOD_MIN()); + assertEq(max, dataServiceOverride.THAWING_PERIOD_MAX()); + } + + function test_ThawingPeriod_WhenCheckingAValidProvision(uint64 thawingPeriod) external useIndexer { + dataService.setThawingPeriodRange(dataService.THAWING_PERIOD_MIN(), dataService.THAWING_PERIOD_MAX()); + thawingPeriod = uint32( + bound(thawingPeriod, dataService.THAWING_PERIOD_MIN(), dataService.THAWING_PERIOD_MAX()) + ); + + _createProvision(users.indexer, address(dataService), dataService.PROVISION_TOKENS_MIN(), 0, thawingPeriod); + dataService.checkProvisionParameters(users.indexer, false); + } + + function test_ThawingPeriod_WhenCheckingWithAnOverridenChecker(uint64 thawingPeriod) external useIndexer { + thawingPeriod = uint32(bound(thawingPeriod, 0, staking.getMaxThawingPeriod())); + dataServiceOverride.setThawingPeriodRange(dataService.THAWING_PERIOD_MIN(), dataService.THAWING_PERIOD_MAX()); + + // this checker accepts provisions with any verifier cut range + _createProvision(users.indexer, address(dataService), dataService.PROVISION_TOKENS_MIN(), 0, thawingPeriod); + dataServiceOverride.checkProvisionParameters(users.indexer, false); + } + + function test_ThawingPeriod_RevertWhen_CheckingAnInvalidProvision(uint64 thawingPeriod) external useIndexer { + dataService.setThawingPeriodRange(dataService.THAWING_PERIOD_MIN(), dataService.THAWING_PERIOD_MAX()); + thawingPeriod = uint32(bound(thawingPeriod, 0, dataService.THAWING_PERIOD_MIN() - 1)); + + _createProvision(users.indexer, address(dataService), dataService.PROVISION_TOKENS_MIN(), 0, thawingPeriod); + vm.expectRevert( + abi.encodeWithSelector( + ProvisionManager.ProvisionManagerInvalidValue.selector, + "thawingPeriod", + thawingPeriod, + dataService.THAWING_PERIOD_MIN(), + dataService.THAWING_PERIOD_MAX() + ) + ); + dataService.checkProvisionParameters(users.indexer, false); + } + + modifier givenProvisionParametersChanged() { + _; + } + + function test_ProvisionParameters_WhenTheNewParametersAreValid( + uint32 maxVerifierCut, + uint64 thawingPeriod + ) external givenProvisionParametersChanged useIndexer { + // bound to valid values + maxVerifierCut = uint32(bound(maxVerifierCut, dataService.VERIFIER_CUT_MIN(), dataService.VERIFIER_CUT_MAX())); + thawingPeriod = uint64( + bound(thawingPeriod, dataService.THAWING_PERIOD_MIN(), dataService.THAWING_PERIOD_MAX()) + ); + + // set provision parameter ranges + dataService.setVerifierCutRange(dataService.VERIFIER_CUT_MIN(), dataService.VERIFIER_CUT_MAX()); + dataService.setThawingPeriodRange(dataService.THAWING_PERIOD_MIN(), dataService.THAWING_PERIOD_MAX()); + + // stage provision parameter changes + _createProvision( + users.indexer, + address(dataService), + dataService.PROVISION_TOKENS_MIN(), + dataService.VERIFIER_CUT_MIN(), + dataService.THAWING_PERIOD_MIN() + ); + _setProvisionParameters(users.indexer, address(dataService), maxVerifierCut, thawingPeriod); + + // accept provision parameters + if (maxVerifierCut != dataService.VERIFIER_CUT_MIN() || thawingPeriod != dataService.THAWING_PERIOD_MIN()) { + vm.expectEmit(); + emit IHorizonStakingMain.ProvisionParametersSet( + users.indexer, + address(dataService), + maxVerifierCut, + thawingPeriod + ); + } + dataService.acceptProvisionParameters(users.indexer); + } + + function test_ProvisionParameters_RevertWhen_TheNewThawingPeriodIsInvalid( + uint64 thawingPeriod + ) external givenProvisionParametersChanged useIndexer { + // bound to invalid values + thawingPeriod = uint64(bound(thawingPeriod, 0, dataService.THAWING_PERIOD_MIN() - 1)); + + // set provision parameter ranges + dataService.setVerifierCutRange(dataService.VERIFIER_CUT_MIN(), dataService.VERIFIER_CUT_MAX()); + dataService.setThawingPeriodRange(dataService.THAWING_PERIOD_MIN(), dataService.THAWING_PERIOD_MAX()); + + // stage provision parameter changes + _createProvision( + users.indexer, + address(dataService), + dataService.PROVISION_TOKENS_MIN(), + dataService.VERIFIER_CUT_MIN(), + dataService.THAWING_PERIOD_MIN() + ); + _setProvisionParameters(users.indexer, address(dataService), dataService.VERIFIER_CUT_MIN(), thawingPeriod); + + // accept provision parameters + vm.expectRevert( + abi.encodeWithSelector( + ProvisionManager.ProvisionManagerInvalidValue.selector, + "thawingPeriod", + thawingPeriod, + dataService.THAWING_PERIOD_MIN(), + dataService.THAWING_PERIOD_MAX() + ) + ); + dataService.acceptProvisionParameters(users.indexer); + } + + function test_ProvisionParameters_RevertWhen_TheNewVerifierCutIsInvalid( + uint32 maxVerifierCut + ) external givenProvisionParametersChanged useIndexer { + // bound to valid values + maxVerifierCut = uint32(bound(maxVerifierCut, dataService.VERIFIER_CUT_MIN(), dataService.VERIFIER_CUT_MAX())); + + // set provision parameter ranges + dataService.setVerifierCutRange(dataService.VERIFIER_CUT_MIN(), dataService.VERIFIER_CUT_MAX()); + dataService.setThawingPeriodRange(dataService.THAWING_PERIOD_MIN(), dataService.THAWING_PERIOD_MAX()); + + // stage provision parameter changes + _createProvision( + users.indexer, + address(dataService), + dataService.PROVISION_TOKENS_MIN(), + dataService.VERIFIER_CUT_MIN(), + dataService.THAWING_PERIOD_MIN() + ); + _setProvisionParameters(users.indexer, address(dataService), maxVerifierCut, dataService.THAWING_PERIOD_MIN()); + + // accept provision parameters + if (maxVerifierCut != dataService.VERIFIER_CUT_MIN()) { + vm.expectEmit(); + emit IHorizonStakingMain.ProvisionParametersSet( + users.indexer, + address(dataService), + maxVerifierCut, + dataService.THAWING_PERIOD_MIN() + ); + } + dataService.acceptProvisionParameters(users.indexer); + } + + // -- Assert functions -- + + function _assert_set_delegationRatio(uint32 ratio) internal { + vm.expectEmit(); + emit ProvisionManager.DelegationRatioSet(ratio); + dataService.setDelegationRatio(ratio); + _assert_delegationRatio(ratio); + } + + function _assert_delegationRatio(uint32 ratio) internal view { + uint32 _delegationRatio = dataService.getDelegationRatio(); + assertEq(_delegationRatio, ratio); + } + + function _assert_set_provisionTokens_range(uint256 min, uint256 max) internal { + vm.expectEmit(); + emit ProvisionManager.ProvisionTokensRangeSet(min, max); + dataService.setProvisionTokensRange(min, max); + _assert_provisionTokens_range(min, max); + } + + function _assert_provisionTokens_range(uint256 min, uint256 max) internal view { + (uint256 _min, uint256 _max) = dataService.getProvisionTokensRange(); + assertEq(_min, min); + assertEq(_max, max); + } + + function _assert_set_verifierCut_range(uint32 min, uint32 max) internal { + vm.expectEmit(); + emit ProvisionManager.VerifierCutRangeSet(min, max); + dataService.setVerifierCutRange(min, max); + _assert_verifierCut_range(min, max); + } + + function _assert_verifierCut_range(uint32 min, uint32 max) internal view { + (uint32 _min, uint32 _max) = dataService.getVerifierCutRange(); + assertEq(_min, min); + assertEq(_max, max); + } + + function _assert_set_thawingPeriod_range(uint64 min, uint64 max) internal { + vm.expectEmit(); + emit ProvisionManager.ThawingPeriodRangeSet(min, max); + dataService.setThawingPeriodRange(min, max); + _assert_thawingPeriod_range(min, max); + } + + function _assert_thawingPeriod_range(uint64 min, uint64 max) internal view { + (uint64 _min, uint64 _max) = dataService.getThawingPeriodRange(); + assertEq(_min, min); + assertEq(_max, max); + } +} diff --git a/packages/horizon/test/unit/data-service/DataServiceUpgradeable.t.sol b/packages/horizon/test/unit/data-service/DataServiceUpgradeable.t.sol new file mode 100644 index 000000000..265cb8071 --- /dev/null +++ b/packages/horizon/test/unit/data-service/DataServiceUpgradeable.t.sol @@ -0,0 +1,50 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity 0.8.27; + +import { GraphBaseTest } from "../GraphBase.t.sol"; +import { DataServiceBaseUpgradeable } from "./implementations/DataServiceBaseUpgradeable.sol"; +import { UnsafeUpgrades } from "openzeppelin-foundry-upgrades/Upgrades.sol"; + +import { PPMMath } from "./../../../contracts/libraries/PPMMath.sol"; + +contract DataServiceUpgradeableTest is GraphBaseTest { + function test_WhenTheContractIsDeployed() external { + (DataServiceBaseUpgradeable dataService, DataServiceBaseUpgradeable implementation) = _deployDataService(); + + // via proxy - ensure that the proxy was initialized correctly + // these calls validate proxy storage was correctly initialized + uint32 delegationRatio = dataService.getDelegationRatio(); + assertEq(delegationRatio, type(uint32).max); + + (uint256 minTokens, uint256 maxTokens) = dataService.getProvisionTokensRange(); + assertEq(minTokens, type(uint256).min); + assertEq(maxTokens, type(uint256).max); + + (uint32 minVerifierCut, uint32 maxVerifierCut) = dataService.getVerifierCutRange(); + assertEq(minVerifierCut, type(uint32).min); + assertEq(maxVerifierCut, uint32(PPMMath.MAX_PPM)); + + (uint64 minThawingPeriod, uint64 maxThawingPeriod) = dataService.getThawingPeriodRange(); + assertEq(minThawingPeriod, type(uint64).min); + assertEq(maxThawingPeriod, type(uint64).max); + + // this ensures that implementation immutables were correctly initialized + // and they can be read via the proxy + assertEq(implementation.controller(), address(controller)); + assertEq(dataService.controller(), address(controller)); + } + + function _deployDataService() internal returns (DataServiceBaseUpgradeable, DataServiceBaseUpgradeable) { + // Deploy implementation + address implementation = address(new DataServiceBaseUpgradeable(address(controller))); + + // Deploy proxy + address proxy = UnsafeUpgrades.deployTransparentProxy( + implementation, + users.governor, + abi.encodeCall(DataServiceBaseUpgradeable.initialize, ()) + ); + + return (DataServiceBaseUpgradeable(proxy), DataServiceBaseUpgradeable(implementation)); + } +} diff --git a/packages/horizon/test/unit/data-service/extensions/DataServiceFees.t.sol b/packages/horizon/test/unit/data-service/extensions/DataServiceFees.t.sol new file mode 100644 index 000000000..cd6e7bf46 --- /dev/null +++ b/packages/horizon/test/unit/data-service/extensions/DataServiceFees.t.sol @@ -0,0 +1,241 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity 0.8.27; + +import { HorizonStakingSharedTest } from "../../shared/horizon-staking/HorizonStakingShared.t.sol"; +import { DataServiceImpFees } from "../implementations/DataServiceImpFees.sol"; +import { IDataServiceFees } from "../../../../contracts/data-service/interfaces/IDataServiceFees.sol"; +import { ProvisionTracker } from "../../../../contracts/data-service/libraries/ProvisionTracker.sol"; +import { LinkedList } from "../../../../contracts/libraries/LinkedList.sol"; + +contract DataServiceFeesTest is HorizonStakingSharedTest { + function test_Lock_RevertWhen_ZeroTokensAreLocked() + external + useIndexer + useProvisionDataService(address(dataService), PROVISION_TOKENS, 0, 0) + { + vm.expectRevert(abi.encodeWithSignature("DataServiceFeesZeroTokens()")); + dataService.lockStake(users.indexer, 0); + } + + uint256 public constant PROVISION_TOKENS = 10_000_000 ether; + DataServiceImpFees dataService; + + function setUp() public override { + super.setUp(); + + dataService = new DataServiceImpFees(address(controller)); + } + + function test_Lock_WhenTheProvisionHasEnoughTokens( + uint256 tokens + ) external useIndexer useProvisionDataService(address(dataService), PROVISION_TOKENS, 0, 0) { + tokens = bound(tokens, 1, PROVISION_TOKENS / dataService.STAKE_TO_FEES_RATIO()); + + _assert_lockStake(users.indexer, tokens); + } + + function test_Lock_WhenTheProvisionHasJustEnoughTokens( + uint256 tokens, + uint256 steps + ) external useIndexer useProvisionDataService(address(dataService), PROVISION_TOKENS, 0, 0) { + // lock all provisioned stake in steps + // limit tokens to at least 1 per step + tokens = bound(tokens, 50, PROVISION_TOKENS / dataService.STAKE_TO_FEES_RATIO()); + steps = bound(steps, 1, 50); + uint256 stepAmount = tokens / steps; + + for (uint256 i = 0; i < steps; i++) { + _assert_lockStake(users.indexer, stepAmount); + } + + uint256 lockedStake = dataService.feesProvisionTracker(users.indexer); + uint256 delta = (tokens % steps); + assertEq(lockedStake, stepAmount * dataService.STAKE_TO_FEES_RATIO() * steps); + assertEq(tokens * dataService.STAKE_TO_FEES_RATIO() - lockedStake, delta * dataService.STAKE_TO_FEES_RATIO()); + } + + function test_Lock_RevertWhen_TheProvisionHasNotEnoughTokens( + uint256 tokens + ) external useIndexer useProvisionDataService(address(dataService), PROVISION_TOKENS, 0, 0) { + tokens = bound(tokens, 1, PROVISION_TOKENS / dataService.STAKE_TO_FEES_RATIO()); + + // lock everything + _assert_lockStake(users.indexer, PROVISION_TOKENS / dataService.STAKE_TO_FEES_RATIO()); + + // tryna lock some more + uint256 additionalTokens = 10000; + uint256 tokensRequired = dataService.feesProvisionTracker(users.indexer) + + additionalTokens * + dataService.STAKE_TO_FEES_RATIO(); + uint256 tokensAvailable = staking.getTokensAvailable(users.indexer, address(dataService), 0); + vm.expectRevert( + abi.encodeWithSelector( + ProvisionTracker.ProvisionTrackerInsufficientTokens.selector, + tokensAvailable, + tokensRequired + ) + ); + dataService.lockStake(users.indexer, additionalTokens); + } + + function test_Release_WhenNIsValid( + uint256 tokens, + uint256 steps, + uint256 numClaimsToRelease + ) external useIndexer useProvisionDataService(address(dataService), PROVISION_TOKENS, 0, 0) { + // lock all provisioned stake in steps + // limit tokens to at least 1 per step + // limit steps to at least 15 so we stagger locks every 5 seconds to have some expired + tokens = bound(tokens, 50, PROVISION_TOKENS / dataService.STAKE_TO_FEES_RATIO()); + steps = bound(steps, 15, 50); + numClaimsToRelease = bound(numClaimsToRelease, 0, steps); + + uint256 stepAmount = tokens / steps; + + // lock tokens staggering the release + for (uint256 i = 0; i < steps; i++) { + _assert_lockStake(users.indexer, stepAmount); + vm.warp(block.timestamp + 5 seconds); + } + + // it should release all expired claims + _assert_releaseStake(users.indexer, numClaimsToRelease); + } + + function test_Release_WhenNIsNotValid( + uint256 tokens, + uint256 steps + ) external useIndexer useProvisionDataService(address(dataService), PROVISION_TOKENS, 0, 0) { + // lock all provisioned stake in steps + // limit tokens to at least 1 per step + // limit steps to at least 15 so we stagger locks every 5 seconds to have some expired + tokens = bound(tokens, 50, PROVISION_TOKENS / dataService.STAKE_TO_FEES_RATIO()); + steps = bound(steps, 15, 50); + + uint256 stepAmount = tokens / steps; + + // lock tokens staggering the release + for (uint256 i = 0; i < steps; i++) { + _assert_lockStake(users.indexer, stepAmount); + vm.warp(block.timestamp + 5 seconds); + } + + // it should revert + vm.expectRevert(abi.encodeWithSelector(LinkedList.LinkedListInvalidIterations.selector)); + dataService.releaseStake(steps + 1); + } + + // -- Assertion functions -- + // use struct to avoid 'stack too deep' error + struct CalcValues_LockStake { + uint256 unlockTimestamp; + uint256 stakeToLock; + bytes32 predictedClaimId; + } + function _assert_lockStake(address serviceProvider, uint256 tokens) private { + // before state + (bytes32 beforeHead, , uint256 beforeNonce, uint256 beforeCount) = dataService.claimsLists(serviceProvider); + uint256 beforeLockedStake = dataService.feesProvisionTracker(serviceProvider); + + // calc + CalcValues_LockStake memory calcValues = CalcValues_LockStake({ + unlockTimestamp: block.timestamp + dataService.LOCK_DURATION(), + stakeToLock: tokens * dataService.STAKE_TO_FEES_RATIO(), + predictedClaimId: keccak256(abi.encodePacked(address(dataService), serviceProvider, beforeNonce)) + }); + + // it should emit a an event + vm.expectEmit(); + emit IDataServiceFees.StakeClaimLocked( + serviceProvider, + calcValues.predictedClaimId, + calcValues.stakeToLock, + calcValues.unlockTimestamp + ); + dataService.lockStake(serviceProvider, tokens); + + // after state + uint256 afterLockedStake = dataService.feesProvisionTracker(serviceProvider); + (bytes32 afterHead, bytes32 afterTail, uint256 afterNonce, uint256 afterCount) = dataService.claimsLists( + serviceProvider + ); + + // it should lock the tokens + assertEq(beforeLockedStake + calcValues.stakeToLock, afterLockedStake); + + // it should create a stake claim + (uint256 claimTokens, uint256 createdAt, uint256 releasableAt, bytes32 nextClaim) = dataService.claims( + calcValues.predictedClaimId + ); + assertEq(claimTokens, calcValues.stakeToLock); + assertEq(createdAt, block.timestamp); + assertEq(releasableAt, calcValues.unlockTimestamp); + assertEq(nextClaim, bytes32(0)); + + // it should update the list + assertEq(afterCount, beforeCount + 1); + assertEq(afterNonce, beforeNonce + 1); + assertEq(afterHead, beforeCount == 0 ? calcValues.predictedClaimId : beforeHead); + assertEq(afterTail, calcValues.predictedClaimId); + } + + // use struct to avoid 'stack too deep' error + struct CalcValues_ReleaseStake { + uint256 claimsCount; + uint256 tokensReleased; + bytes32 head; + } + function _assert_releaseStake(address serviceProvider, uint256 numClaimsToRelease) private { + // before state + (bytes32 beforeHead, bytes32 beforeTail, uint256 beforeNonce, uint256 beforeCount) = dataService.claimsLists( + serviceProvider + ); + uint256 beforeLockedStake = dataService.feesProvisionTracker(serviceProvider); + + // calc and set events + vm.expectEmit(); + + CalcValues_ReleaseStake memory calcValues = CalcValues_ReleaseStake({ + claimsCount: 0, + tokensReleased: 0, + head: beforeHead + }); + while ( + calcValues.head != bytes32(0) && (calcValues.claimsCount < numClaimsToRelease || numClaimsToRelease == 0) + ) { + (uint256 claimTokens, , uint256 releasableAt, bytes32 nextClaim) = dataService.claims(calcValues.head); + if (releasableAt > block.timestamp) { + break; + } + + emit IDataServiceFees.StakeClaimReleased(serviceProvider, calcValues.head, claimTokens, releasableAt); + calcValues.head = nextClaim; + calcValues.tokensReleased += claimTokens; + calcValues.claimsCount++; + } + + // it should emit a an event + emit IDataServiceFees.StakeClaimsReleased(serviceProvider, calcValues.claimsCount, calcValues.tokensReleased); + dataService.releaseStake(numClaimsToRelease); + + // after state + (bytes32 afterHead, bytes32 afterTail, uint256 afterNonce, uint256 afterCount) = dataService.claimsLists( + serviceProvider + ); + uint256 afterLockedStake = dataService.feesProvisionTracker(serviceProvider); + + // it should release the tokens + assertEq(beforeLockedStake - calcValues.tokensReleased, afterLockedStake); + + // it should remove the processed claims from the list + assertEq(afterCount, beforeCount - calcValues.claimsCount); + assertEq(afterNonce, beforeNonce); + if (calcValues.claimsCount != 0) { + assertNotEq(afterHead, beforeHead); + } else { + assertEq(afterHead, beforeHead); + } + assertEq(afterHead, calcValues.head); + assertEq(afterTail, calcValues.claimsCount == beforeCount ? bytes32(0) : beforeTail); + } +} diff --git a/packages/horizon/test/unit/data-service/extensions/DataServicePausable.t.sol b/packages/horizon/test/unit/data-service/extensions/DataServicePausable.t.sol new file mode 100644 index 000000000..f43191a94 --- /dev/null +++ b/packages/horizon/test/unit/data-service/extensions/DataServicePausable.t.sol @@ -0,0 +1,138 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity 0.8.27; + +import { HorizonStakingSharedTest } from "../../shared/horizon-staking/HorizonStakingShared.t.sol"; +import { DataServiceImpPausable } from "../implementations/DataServiceImpPausable.sol"; +import { IDataServicePausable } from "./../../../../contracts/data-service/interfaces/IDataServicePausable.sol"; + +contract DataServicePausableTest is HorizonStakingSharedTest { + DataServiceImpPausable dataService; + + event Paused(address pauser); + event Unpaused(address unpauser); + + function setUp() public override { + super.setUp(); + + dataService = new DataServiceImpPausable(address(controller)); + } + + modifier whenTheCallerIsAPauseGuardian() { + _assert_setPauseGuardian(address(this), true); + _; + } + + function test_Pause_WhenTheProtocolIsNotPaused() external whenTheCallerIsAPauseGuardian { + _assert_pause(); + } + + function test_Pause_RevertWhen_TheProtocolIsPaused() external whenTheCallerIsAPauseGuardian { + _assert_pause(); + + vm.expectRevert(abi.encodeWithSignature("EnforcedPause()")); + dataService.pause(); + assertEq(dataService.paused(), true); + } + + function test_Pause_RevertWhen_TheCallerIsNotAPauseGuardian() external { + vm.expectRevert(abi.encodeWithSignature("DataServicePausableNotPauseGuardian(address)", address(this))); + dataService.pause(); + assertEq(dataService.paused(), false); + } + + function test_Unpause_WhenTheProtocolIsPaused() external whenTheCallerIsAPauseGuardian { + _assert_pause(); + _assert_unpause(); + } + + function test_Unpause_RevertWhen_TheProtocolIsNotPaused() external whenTheCallerIsAPauseGuardian { + vm.expectRevert(abi.encodeWithSignature("ExpectedPause()")); + dataService.unpause(); + assertEq(dataService.paused(), false); + } + + function test_Unpause_RevertWhen_TheCallerIsNotAPauseGuardian() external { + _assert_setPauseGuardian(address(this), true); + _assert_pause(); + _assert_setPauseGuardian(address(this), false); + + vm.expectRevert(abi.encodeWithSignature("DataServicePausableNotPauseGuardian(address)", address(this))); + dataService.unpause(); + assertEq(dataService.paused(), true); + } + + function test_SetPauseGuardian_WhenSettingAPauseGuardian() external { + _assert_setPauseGuardian(address(this), true); + } + + function test_SetPauseGuardian_WhenRemovingAPauseGuardian() external { + _assert_setPauseGuardian(address(this), true); + _assert_setPauseGuardian(address(this), false); + } + + function test_SetPauseGuardian_RevertWhen_AlreadyPauseGuardian() external { + _assert_setPauseGuardian(address(this), true); + vm.expectRevert( + abi.encodeWithSignature("DataServicePausablePauseGuardianNoChange(address,bool)", address(this), true) + ); + dataService.setPauseGuardian(address(this), true); + } + + function test_SetPauseGuardian_RevertWhen_AlreadyNotPauseGuardian() external { + _assert_setPauseGuardian(address(this), true); + _assert_setPauseGuardian(address(this), false); + vm.expectRevert( + abi.encodeWithSignature("DataServicePausablePauseGuardianNoChange(address,bool)", address(this), false) + ); + dataService.setPauseGuardian(address(this), false); + } + + function test_PausedProtectedFn_RevertWhen_TheProtocolIsPaused() external { + _assert_setPauseGuardian(address(this), true); + _assert_pause(); + + vm.expectRevert(abi.encodeWithSignature("EnforcedPause()")); + dataService.pausedProtectedFn(); + } + + function test_PausedProtectedFn_WhenTheProtocolIsNotPaused() external { + vm.expectEmit(); + emit DataServiceImpPausable.PausedProtectedFn(); + dataService.pausedProtectedFn(); + } + + function test_UnpausedProtectedFn_WhenTheProtocolIsPaused() external { + _assert_setPauseGuardian(address(this), true); + _assert_pause(); + + vm.expectEmit(); + emit DataServiceImpPausable.UnpausedProtectedFn(); + dataService.unpausedProtectedFn(); + } + + function test_UnpausedProtectedFn_RevertWhen_TheProtocolIsNotPaused() external { + vm.expectRevert(abi.encodeWithSignature("ExpectedPause()")); + dataService.unpausedProtectedFn(); + } + + function _assert_pause() private { + vm.expectEmit(); + emit Paused(address(this)); + dataService.pause(); + assertEq(dataService.paused(), true); + } + + function _assert_unpause() private { + vm.expectEmit(); + emit Unpaused(address(this)); + dataService.unpause(); + assertEq(dataService.paused(), false); + } + + function _assert_setPauseGuardian(address pauseGuardian, bool allowed) private { + vm.expectEmit(); + emit IDataServicePausable.PauseGuardianSet(pauseGuardian, allowed); + dataService.setPauseGuardian(pauseGuardian, allowed); + assertEq(dataService.pauseGuardians(pauseGuardian), allowed); + } +} diff --git a/packages/horizon/test/unit/data-service/extensions/DataServicePausableUpgradeable.t.sol b/packages/horizon/test/unit/data-service/extensions/DataServicePausableUpgradeable.t.sol new file mode 100644 index 000000000..1e47f7a34 --- /dev/null +++ b/packages/horizon/test/unit/data-service/extensions/DataServicePausableUpgradeable.t.sol @@ -0,0 +1,56 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity 0.8.27; + +import { GraphBaseTest } from "../../GraphBase.t.sol"; +import { DataServiceImpPausableUpgradeable } from "../implementations/DataServiceImpPausableUpgradeable.sol"; +import { UnsafeUpgrades } from "openzeppelin-foundry-upgrades/Upgrades.sol"; + +import { PPMMath } from "./../../../../contracts/libraries/PPMMath.sol"; + +contract DataServicePausableUpgradeableTest is GraphBaseTest { + function test_WhenTheContractIsDeployed() external { + ( + DataServiceImpPausableUpgradeable dataService, + DataServiceImpPausableUpgradeable implementation + ) = _deployDataService(); + + // via proxy - ensure that the proxy was initialized correctly + // these calls validate proxy storage was correctly initialized + uint32 delegationRatio = dataService.getDelegationRatio(); + assertEq(delegationRatio, type(uint32).max); + + (uint256 minTokens, uint256 maxTokens) = dataService.getProvisionTokensRange(); + assertEq(minTokens, type(uint256).min); + assertEq(maxTokens, type(uint256).max); + + (uint32 minVerifierCut, uint32 maxVerifierCut) = dataService.getVerifierCutRange(); + assertEq(minVerifierCut, type(uint32).min); + assertEq(maxVerifierCut, uint32(PPMMath.MAX_PPM)); + + (uint64 minThawingPeriod, uint64 maxThawingPeriod) = dataService.getThawingPeriodRange(); + assertEq(minThawingPeriod, type(uint64).min); + assertEq(maxThawingPeriod, type(uint64).max); + + // this ensures that implementation immutables were correctly initialized + // and they can be read via the proxy + assertEq(implementation.controller(), address(controller)); + assertEq(dataService.controller(), address(controller)); + } + + function _deployDataService() + internal + returns (DataServiceImpPausableUpgradeable, DataServiceImpPausableUpgradeable) + { + // Deploy implementation + address implementation = address(new DataServiceImpPausableUpgradeable(address(controller))); + + // Deploy proxy + address proxy = UnsafeUpgrades.deployTransparentProxy( + implementation, + users.governor, + abi.encodeCall(DataServiceImpPausableUpgradeable.initialize, ()) + ); + + return (DataServiceImpPausableUpgradeable(proxy), DataServiceImpPausableUpgradeable(implementation)); + } +} diff --git a/packages/horizon/test/unit/data-service/implementations/DataServiceBase.sol b/packages/horizon/test/unit/data-service/implementations/DataServiceBase.sol new file mode 100644 index 000000000..30a40b4db --- /dev/null +++ b/packages/horizon/test/unit/data-service/implementations/DataServiceBase.sol @@ -0,0 +1,63 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +pragma solidity 0.8.27; + +import { DataService } from "../../../../contracts/data-service/DataService.sol"; +import { IGraphPayments } from "./../../../../contracts/interfaces/IGraphPayments.sol"; + +contract DataServiceBase is DataService { + uint32 public constant DELEGATION_RATIO = 100; + uint256 public constant PROVISION_TOKENS_MIN = 50; + uint256 public constant PROVISION_TOKENS_MAX = 5000; + uint32 public constant VERIFIER_CUT_MIN = 5; + uint32 public constant VERIFIER_CUT_MAX = 100000; + uint64 public constant THAWING_PERIOD_MIN = 15; + uint64 public constant THAWING_PERIOD_MAX = 76; + + constructor(address controller) DataService(controller) initializer { + __DataService_init(); + } + + function register(address serviceProvider, bytes calldata data) external {} + + function acceptProvisionPendingParameters(address serviceProvider, bytes calldata data) external {} + + function startService(address serviceProvider, bytes calldata data) external {} + + function stopService(address serviceProvider, bytes calldata data) external {} + + function collect( + address serviceProvider, + IGraphPayments.PaymentTypes feeType, + bytes calldata data + ) external returns (uint256) {} + + function slash(address serviceProvider, bytes calldata data) external {} + + function setDelegationRatio(uint32 ratio) external { + _setDelegationRatio(ratio); + } + + function setProvisionTokensRange(uint256 min, uint256 max) external { + _setProvisionTokensRange(min, max); + } + + function setVerifierCutRange(uint32 min, uint32 max) external { + _setVerifierCutRange(min, max); + } + + function setThawingPeriodRange(uint64 min, uint64 max) external { + _setThawingPeriodRange(min, max); + } + + function checkProvisionTokens(address serviceProvider) external view { + _checkProvisionTokens(serviceProvider); + } + + function checkProvisionParameters(address serviceProvider, bool pending) external view { + _checkProvisionParameters(serviceProvider, pending); + } + + function acceptProvisionParameters(address serviceProvider) external { + _acceptProvisionParameters(serviceProvider); + } +} diff --git a/packages/horizon/test/unit/data-service/implementations/DataServiceBaseUpgradeable.sol b/packages/horizon/test/unit/data-service/implementations/DataServiceBaseUpgradeable.sol new file mode 100644 index 000000000..d24e831af --- /dev/null +++ b/packages/horizon/test/unit/data-service/implementations/DataServiceBaseUpgradeable.sol @@ -0,0 +1,35 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +pragma solidity 0.8.27; + +import { DataService } from "../../../../contracts/data-service/DataService.sol"; +import { IGraphPayments } from "./../../../../contracts/interfaces/IGraphPayments.sol"; + +contract DataServiceBaseUpgradeable is DataService { + constructor(address controller_) DataService(controller_) { + _disableInitializers(); + } + + function initialize() external initializer { + __DataService_init(); + } + + function register(address serviceProvider, bytes calldata data) external {} + + function acceptProvisionPendingParameters(address serviceProvider, bytes calldata data) external {} + + function startService(address serviceProvider, bytes calldata data) external {} + + function stopService(address serviceProvider, bytes calldata data) external {} + + function collect( + address serviceProvider, + IGraphPayments.PaymentTypes feeType, + bytes calldata data + ) external returns (uint256) {} + + function slash(address serviceProvider, bytes calldata data) external {} + + function controller() external view returns (address) { + return address(_graphController()); + } +} diff --git a/packages/horizon/test/unit/data-service/implementations/DataServiceImpFees.sol b/packages/horizon/test/unit/data-service/implementations/DataServiceImpFees.sol new file mode 100644 index 000000000..04d0ca336 --- /dev/null +++ b/packages/horizon/test/unit/data-service/implementations/DataServiceImpFees.sol @@ -0,0 +1,40 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +pragma solidity 0.8.27; + +import { DataService } from "../../../../contracts/data-service/DataService.sol"; +import { DataServiceFees } from "../../../../contracts/data-service/extensions/DataServiceFees.sol"; +import { IGraphPayments } from "./../../../../contracts/interfaces/IGraphPayments.sol"; + +contract DataServiceImpFees is DataServiceFees { + uint256 public constant STAKE_TO_FEES_RATIO = 1000; + uint256 public constant LOCK_DURATION = 1 minutes; + + constructor(address controller) DataService(controller) initializer { + __DataService_init(); + } + + function register(address serviceProvider, bytes calldata data) external {} + + function acceptProvisionPendingParameters(address serviceProvider, bytes calldata data) external {} + + function startService(address serviceProvider, bytes calldata data) external {} + + function stopService(address serviceProvider, bytes calldata data) external {} + + function collect( + address serviceProvider, + IGraphPayments.PaymentTypes, + bytes calldata data + ) external returns (uint256) { + uint256 amount = abi.decode(data, (uint256)); + _releaseStake(serviceProvider, 0); + _lockStake(serviceProvider, amount * STAKE_TO_FEES_RATIO, block.timestamp + LOCK_DURATION); + return amount; + } + + function lockStake(address serviceProvider, uint256 amount) external { + _lockStake(serviceProvider, amount * STAKE_TO_FEES_RATIO, block.timestamp + LOCK_DURATION); + } + + function slash(address serviceProvider, bytes calldata data) external {} +} diff --git a/packages/horizon/test/unit/data-service/implementations/DataServiceImpPausable.sol b/packages/horizon/test/unit/data-service/implementations/DataServiceImpPausable.sol new file mode 100644 index 000000000..00e9c94a9 --- /dev/null +++ b/packages/horizon/test/unit/data-service/implementations/DataServiceImpPausable.sol @@ -0,0 +1,51 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +pragma solidity 0.8.27; + +import { DataService } from "../../../../contracts/data-service/DataService.sol"; +import { DataServicePausable } from "../../../../contracts/data-service/extensions/DataServicePausable.sol"; +import { IGraphPayments } from "./../../../../contracts/interfaces/IGraphPayments.sol"; + +contract DataServiceImpPausable is DataServicePausable { + uint32 public constant DELEGATION_RATIO = 100; + uint256 public constant PROVISION_TOKENS_MIN = 50; + uint256 public constant PROVISION_TOKENS_MAX = 5000; + uint32 public constant VERIFIER_CUT_MIN = 5; + uint32 public constant VERIFIER_CUT_MAX = 100000; + uint64 public constant THAWING_PERIOD_MIN = 15; + uint64 public constant THAWING_PERIOD_MAX = 76; + + event PausedProtectedFn(); + event UnpausedProtectedFn(); + + constructor(address controller) DataService(controller) initializer { + __DataService_init(); + } + + function register(address serviceProvider, bytes calldata data) external {} + + function acceptProvisionPendingParameters(address serviceProvider, bytes calldata data) external {} + + function startService(address serviceProvider, bytes calldata data) external {} + + function stopService(address serviceProvider, bytes calldata data) external {} + + function collect( + address serviceProvider, + IGraphPayments.PaymentTypes feeType, + bytes calldata data + ) external returns (uint256) {} + + function slash(address serviceProvider, bytes calldata data) external {} + + function setPauseGuardian(address pauseGuardian, bool allowed) external { + _setPauseGuardian(pauseGuardian, allowed); + } + + function pausedProtectedFn() external whenNotPaused { + emit PausedProtectedFn(); + } + + function unpausedProtectedFn() external whenPaused { + emit UnpausedProtectedFn(); + } +} diff --git a/packages/horizon/test/unit/data-service/implementations/DataServiceImpPausableUpgradeable.sol b/packages/horizon/test/unit/data-service/implementations/DataServiceImpPausableUpgradeable.sol new file mode 100644 index 000000000..e50864ace --- /dev/null +++ b/packages/horizon/test/unit/data-service/implementations/DataServiceImpPausableUpgradeable.sol @@ -0,0 +1,37 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +pragma solidity 0.8.27; + +import { DataService } from "../../../../contracts/data-service/DataService.sol"; +import { DataServicePausableUpgradeable } from "../../../../contracts/data-service/extensions/DataServicePausableUpgradeable.sol"; +import { IGraphPayments } from "./../../../../contracts/interfaces/IGraphPayments.sol"; + +contract DataServiceImpPausableUpgradeable is DataServicePausableUpgradeable { + constructor(address controller_) DataService(controller_) { + _disableInitializers(); + } + + function initialize() external initializer { + __DataService_init(); + __DataServicePausable_init(); + } + + function register(address serviceProvider, bytes calldata data) external {} + + function acceptProvisionPendingParameters(address serviceProvider, bytes calldata data) external {} + + function startService(address serviceProvider, bytes calldata data) external {} + + function stopService(address serviceProvider, bytes calldata data) external {} + + function collect( + address serviceProvider, + IGraphPayments.PaymentTypes feeType, + bytes calldata data + ) external returns (uint256) {} + + function slash(address serviceProvider, bytes calldata data) external {} + + function controller() external view returns (address) { + return address(_graphController()); + } +} diff --git a/packages/horizon/test/unit/data-service/implementations/DataServiceOverride.sol b/packages/horizon/test/unit/data-service/implementations/DataServiceOverride.sol new file mode 100644 index 000000000..c5d50ca74 --- /dev/null +++ b/packages/horizon/test/unit/data-service/implementations/DataServiceOverride.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +pragma solidity 0.8.27; + +import { DataServiceBase } from "./DataServiceBase.sol"; + +contract DataServiceOverride is DataServiceBase { + constructor(address controller) DataServiceBase(controller) initializer { + __DataService_init(); + } + + function _getProvisionTokensRange() internal pure override returns (uint256, uint256) { + return (PROVISION_TOKENS_MIN, PROVISION_TOKENS_MAX); + } + + function _getVerifierCutRange() internal pure override returns (uint32, uint32) { + return (VERIFIER_CUT_MIN, VERIFIER_CUT_MAX); + } + + function _getThawingPeriodRange() internal pure override returns (uint64, uint64) { + return (THAWING_PERIOD_MIN, THAWING_PERIOD_MAX); + } + + function _checkProvisionTokens(address _serviceProvider) internal pure override {} + function _checkProvisionParameters(address _serviceProvider, bool pending) internal pure override {} +} diff --git a/packages/horizon/test/unit/data-service/libraries/ProvisionTracker.t.sol b/packages/horizon/test/unit/data-service/libraries/ProvisionTracker.t.sol new file mode 100644 index 000000000..ab6a6f584 --- /dev/null +++ b/packages/horizon/test/unit/data-service/libraries/ProvisionTracker.t.sol @@ -0,0 +1,105 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity 0.8.27; + +import { HorizonStakingSharedTest } from "../../shared/horizon-staking/HorizonStakingShared.t.sol"; +import { ProvisionTrackerImplementation } from "./ProvisionTrackerImplementation.sol"; +import { ProvisionTracker } from "../../../../contracts/data-service/libraries/ProvisionTracker.sol"; +import { IHorizonStaking } from "./../../../../contracts/interfaces/IHorizonStaking.sol"; + +// Wrapper required because when using vm.expectRevert, the error is expected in the next immediate call +// Which in the case of this library is an internal call to the staking contract +// See: https://github.com/foundry-rs/foundry/issues/5454 +library ProvisionTrackerWrapper { + function lock( + mapping(address => uint256) storage self, + IHorizonStaking graphStaking, + address serviceProvider, + uint256 tokens, + uint32 delegationRatio + ) external { + ProvisionTracker.lock(self, graphStaking, serviceProvider, tokens, delegationRatio); + } + + function release(mapping(address => uint256) storage self, address serviceProvider, uint256 tokens) external { + ProvisionTracker.release(self, serviceProvider, tokens); + } +} + +contract ProvisionTrackerTest is HorizonStakingSharedTest, ProvisionTrackerImplementation { + using ProvisionTrackerWrapper for mapping(address => uint256); + + function test_Lock_GivenTheProvisionHasSufficientAvailableTokens( + uint256 tokens, + uint256 steps + ) external useIndexer useProvisionDataService(address(this), tokens, 0, 0) { + vm.assume(tokens > 0); + vm.assume(steps > 0); + vm.assume(steps < 100); + uint256 stepAmount = tokens / steps; + + for (uint256 i = 0; i < steps; i++) { + uint256 beforeLockedAmount = provisionTracker[users.indexer]; + provisionTracker.lock(staking, users.indexer, stepAmount, uint32(0)); + uint256 afterLockedAmount = provisionTracker[users.indexer]; + assertEq(afterLockedAmount, beforeLockedAmount + stepAmount); + } + + assertEq(provisionTracker[users.indexer], stepAmount * steps); + uint256 delta = (tokens % steps); + uint256 tokensAvailable = staking.getTokensAvailable(users.indexer, address(this), 0); + assertEq(tokensAvailable - provisionTracker[users.indexer], delta); + } + + function test_Lock_RevertGiven_TheProvisionHasInsufficientAvailableTokens( + uint256 tokens + ) external useIndexer useProvisionDataService(address(this), tokens, 0, 0) { + uint256 tokensToLock = tokens + 1; + vm.expectRevert( + abi.encodeWithSelector(ProvisionTracker.ProvisionTrackerInsufficientTokens.selector, tokens, tokensToLock) + ); + provisionTracker.lock(staking, users.indexer, tokensToLock, uint32(0)); + } + + function test_Release_GivenTheProvisionHasSufficientLockedTokens( + uint256 tokens, + uint256 steps + ) external useIndexer useProvisionDataService(address(this), tokens, 0, 0) { + vm.assume(tokens > 0); + vm.assume(steps > 0); + vm.assume(steps < 100); + + // setup + provisionTracker.lock(staking, users.indexer, tokens, uint32(0)); + + // lock entire provision, then unlock in steps + uint256 stepAmount = tokens / steps; + + for (uint256 i = 0; i < steps; i++) { + uint256 beforeLockedAmount = provisionTracker[users.indexer]; + provisionTracker.release(users.indexer, stepAmount); + uint256 afterLockedAmount = provisionTracker[users.indexer]; + assertEq(afterLockedAmount, beforeLockedAmount - stepAmount); + } + + assertEq(provisionTracker[users.indexer], tokens - stepAmount * steps); + uint256 delta = (tokens % steps); + assertEq(provisionTracker[users.indexer], delta); + } + + function test_Release_RevertGiven_TheProvisionHasInsufficientLockedTokens( + uint256 tokens + ) external useIndexer useProvisionDataService(address(this), tokens, 0, 0) { + // setup + provisionTracker.lock(staking, users.indexer, tokens, uint32(0)); + + uint256 tokensToRelease = tokens + 1; + vm.expectRevert( + abi.encodeWithSelector( + ProvisionTracker.ProvisionTrackerInsufficientTokens.selector, + tokens, + tokensToRelease + ) + ); + provisionTracker.release(users.indexer, tokensToRelease); + } +} diff --git a/packages/horizon/test/unit/data-service/libraries/ProvisionTrackerImplementation.sol b/packages/horizon/test/unit/data-service/libraries/ProvisionTrackerImplementation.sol new file mode 100644 index 000000000..1f897fd02 --- /dev/null +++ b/packages/horizon/test/unit/data-service/libraries/ProvisionTrackerImplementation.sol @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity 0.8.27; + +import { ProvisionTracker } from "../../../../contracts/data-service/libraries/ProvisionTracker.sol"; + +contract ProvisionTrackerImplementation { + mapping(address => uint256) public provisionTracker; +} diff --git a/packages/horizon/test/unit/escrow/GraphEscrow.t.sol b/packages/horizon/test/unit/escrow/GraphEscrow.t.sol new file mode 100644 index 000000000..5ce7dcf37 --- /dev/null +++ b/packages/horizon/test/unit/escrow/GraphEscrow.t.sol @@ -0,0 +1,220 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; +import { IPaymentsEscrow } from "../../../contracts/interfaces/IPaymentsEscrow.sol"; +import { IGraphPayments } from "../../../contracts/interfaces/IGraphPayments.sol"; +import { IHorizonStakingTypes } from "../../../contracts/interfaces/internal/IHorizonStakingTypes.sol"; + +import { HorizonStakingSharedTest } from "../shared/horizon-staking/HorizonStakingShared.t.sol"; +import { PaymentsEscrowSharedTest } from "../shared/payments-escrow/PaymentsEscrowShared.t.sol"; +import { PPMMath } from "../../../contracts/libraries/PPMMath.sol"; + +contract GraphEscrowTest is HorizonStakingSharedTest, PaymentsEscrowSharedTest { + using PPMMath for uint256; + + /* + * MODIFIERS + */ + + modifier approveEscrow(uint256 tokens) { + _approveEscrow(tokens); + _; + } + + modifier useDeposit(uint256 tokens) { + vm.assume(tokens > 0); + vm.assume(tokens <= MAX_STAKING_TOKENS); + _depositTokens(users.verifier, users.indexer, tokens); + _; + } + + modifier depositAndThawTokens(uint256 amount, uint256 thawAmount) { + vm.assume(amount > 0); + vm.assume(thawAmount > 0); + vm.assume(amount <= MAX_STAKING_TOKENS); + vm.assume(amount > thawAmount); + _depositTokens(users.verifier, users.indexer, amount); + escrow.thaw(users.verifier, users.indexer, thawAmount); + _; + } + + /* + * HELPERS + */ + + function _approveEscrow(uint256 tokens) internal { + token.approve(address(escrow), tokens); + } + + function _thawEscrow(address collector, address receiver, uint256 amount) internal { + (, address msgSender, ) = vm.readCallers(); + uint256 expectedThawEndTimestamp = block.timestamp + withdrawEscrowThawingPeriod; + vm.expectEmit(address(escrow)); + emit IPaymentsEscrow.Thaw(msgSender, collector, receiver, amount, expectedThawEndTimestamp); + escrow.thaw(collector, receiver, amount); + + (, uint256 amountThawing, uint256 thawEndTimestamp) = escrow.escrowAccounts(msgSender, collector, receiver); + assertEq(amountThawing, amount); + assertEq(thawEndTimestamp, expectedThawEndTimestamp); + } + + function _cancelThawEscrow(address collector, address receiver) internal { + (, address msgSender, ) = vm.readCallers(); + (, uint256 amountThawingBefore, uint256 thawEndTimestampBefore) = escrow.escrowAccounts( + msgSender, + collector, + receiver + ); + + vm.expectEmit(address(escrow)); + emit IPaymentsEscrow.CancelThaw(msgSender, collector, receiver, amountThawingBefore, thawEndTimestampBefore); + escrow.cancelThaw(collector, receiver); + + (, uint256 amountThawing, uint256 thawEndTimestamp) = escrow.escrowAccounts(msgSender, collector, receiver); + assertEq(amountThawing, 0); + assertEq(thawEndTimestamp, 0); + } + + function _withdrawEscrow(address collector, address receiver) internal { + (, address msgSender, ) = vm.readCallers(); + + (uint256 balanceBefore, uint256 amountThawingBefore, ) = escrow.escrowAccounts(msgSender, collector, receiver); + uint256 tokenBalanceBeforeSender = token.balanceOf(msgSender); + uint256 tokenBalanceBeforeEscrow = token.balanceOf(address(escrow)); + + uint256 amountToWithdraw = amountThawingBefore > balanceBefore ? balanceBefore : amountThawingBefore; + vm.expectEmit(address(escrow)); + emit IPaymentsEscrow.Withdraw(msgSender, collector, receiver, amountToWithdraw); + escrow.withdraw(collector, receiver); + + (uint256 balanceAfter, uint256 tokensThawingAfter, uint256 thawEndTimestampAfter) = escrow.escrowAccounts( + msgSender, + collector, + receiver + ); + uint256 tokenBalanceAfterSender = token.balanceOf(msgSender); + uint256 tokenBalanceAfterEscrow = token.balanceOf(address(escrow)); + + assertEq(balanceAfter, balanceBefore - amountToWithdraw); + assertEq(tokensThawingAfter, 0); + assertEq(thawEndTimestampAfter, 0); + + assertEq(tokenBalanceAfterSender, tokenBalanceBeforeSender + amountToWithdraw); + assertEq(tokenBalanceAfterEscrow, tokenBalanceBeforeEscrow - amountToWithdraw); + } + + struct CollectPaymentData { + uint256 escrowBalance; + uint256 paymentsBalance; + uint256 receiverBalance; + uint256 delegationPoolBalance; + uint256 dataServiceBalance; + uint256 payerEscrowBalance; + } + + struct CollectTokensData { + uint256 tokensProtocol; + uint256 tokensDataService; + uint256 tokensDelegation; + uint256 receiverExpectedPayment; + } + + function _collectEscrow( + IGraphPayments.PaymentTypes _paymentType, + address _payer, + address _receiver, + uint256 _tokens, + address _dataService, + uint256 _dataServiceCut, + address _paymentsDestination + ) internal { + (, address _collector, ) = vm.readCallers(); + + // Previous balances + CollectPaymentData memory previousBalances = CollectPaymentData({ + escrowBalance: token.balanceOf(address(escrow)), + paymentsBalance: token.balanceOf(address(payments)), + receiverBalance: token.balanceOf(_receiver), + delegationPoolBalance: staking.getDelegatedTokensAvailable(_receiver, _dataService), + dataServiceBalance: token.balanceOf(_dataService), + payerEscrowBalance: 0 + }); + CollectTokensData memory collectTokensData = CollectTokensData({ + tokensProtocol: 0, + tokensDataService: 0, + tokensDelegation: 0, + receiverExpectedPayment: 0 + }); + + { + (uint256 payerEscrowBalance, , ) = escrow.escrowAccounts(_payer, _collector, _receiver); + previousBalances.payerEscrowBalance = payerEscrowBalance; + } + + vm.expectEmit(address(escrow)); + emit IPaymentsEscrow.EscrowCollected( + _paymentType, + _payer, + _collector, + _receiver, + _tokens, + _paymentsDestination + ); + escrow.collect(_paymentType, _payer, _receiver, _tokens, _dataService, _dataServiceCut, _paymentsDestination); + + // Calculate cuts + // this is nasty but stack is indeed too deep + collectTokensData.tokensProtocol = _tokens.mulPPMRoundUp(payments.PROTOCOL_PAYMENT_CUT()); + collectTokensData.tokensDataService = (_tokens - collectTokensData.tokensProtocol).mulPPMRoundUp( + _dataServiceCut + ); + + IHorizonStakingTypes.DelegationPool memory pool = staking.getDelegationPool(_receiver, _dataService); + if (pool.shares > 0) { + collectTokensData.tokensDelegation = (_tokens - + collectTokensData.tokensProtocol - + collectTokensData.tokensDataService).mulPPMRoundUp( + staking.getDelegationFeeCut(_receiver, _dataService, _paymentType) + ); + } + collectTokensData.receiverExpectedPayment = + _tokens - + collectTokensData.tokensProtocol - + collectTokensData.tokensDataService - + collectTokensData.tokensDelegation; + + // After balances + CollectPaymentData memory afterBalances = CollectPaymentData({ + escrowBalance: token.balanceOf(address(escrow)), + paymentsBalance: token.balanceOf(address(payments)), + receiverBalance: token.balanceOf(_receiver), + delegationPoolBalance: staking.getDelegatedTokensAvailable(_receiver, _dataService), + dataServiceBalance: token.balanceOf(_dataService), + payerEscrowBalance: 0 + }); + { + (uint256 afterPayerEscrowBalance, , ) = escrow.escrowAccounts(_payer, _collector, _receiver); + afterBalances.payerEscrowBalance = afterPayerEscrowBalance; + } + + // Check receiver balance after payment + assertEq(afterBalances.receiverBalance - previousBalances.receiverBalance, collectTokensData.receiverExpectedPayment); + assertEq(token.balanceOf(address(payments)), 0); + + // Check delegation pool balance after payment + assertEq(afterBalances.delegationPoolBalance - previousBalances.delegationPoolBalance, collectTokensData.tokensDelegation); + + // Check that the escrow account has been updated + assertEq(previousBalances.escrowBalance, afterBalances.escrowBalance + _tokens); + + // Check that payments balance didn't change + assertEq(previousBalances.paymentsBalance, afterBalances.paymentsBalance); + + // Check data service balance after payment + assertEq(afterBalances.dataServiceBalance - previousBalances.dataServiceBalance, collectTokensData.tokensDataService); + + // Check payers escrow balance after payment + assertEq(previousBalances.payerEscrowBalance - _tokens, afterBalances.payerEscrowBalance); + } +} diff --git a/packages/horizon/test/unit/escrow/collect.t.sol b/packages/horizon/test/unit/escrow/collect.t.sol new file mode 100644 index 000000000..c0a3c8145 --- /dev/null +++ b/packages/horizon/test/unit/escrow/collect.t.sol @@ -0,0 +1,136 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { IHorizonStakingMain } from "../../../contracts/interfaces/internal/IHorizonStakingMain.sol"; +import { IGraphPayments } from "../../../contracts/interfaces/IGraphPayments.sol"; + +import { GraphEscrowTest } from "./GraphEscrow.t.sol"; + +contract GraphEscrowCollectTest is GraphEscrowTest { + /* + * TESTS + */ + + // use users.verifier as collector + function testCollect_Tokens( + uint256 tokens, + uint256 tokensToCollect, + uint256 delegationTokens, + uint256 dataServiceCut + ) + public + useIndexer + useProvision(tokens, 0, 0) + useDelegationFeeCut(IGraphPayments.PaymentTypes.QueryFee, delegationFeeCut) + { + dataServiceCut = bound(dataServiceCut, 0, MAX_PPM); + delegationTokens = bound(delegationTokens, MIN_DELEGATION, MAX_STAKING_TOKENS); + tokensToCollect = bound(tokensToCollect, 1, MAX_STAKING_TOKENS); + + resetPrank(users.delegator); + _delegate(users.indexer, subgraphDataServiceAddress, delegationTokens, 0); + + resetPrank(users.gateway); + _depositTokens(users.verifier, users.indexer, tokensToCollect); + + // burn some tokens to prevent overflow + resetPrank(users.indexer); + token.burn(MAX_STAKING_TOKENS); + + resetPrank(users.verifier); + _collectEscrow( + IGraphPayments.PaymentTypes.QueryFee, + users.gateway, + users.indexer, + tokensToCollect, + subgraphDataServiceAddress, + dataServiceCut, + users.indexer + ); + } + + function testCollect_Tokens_NoProvision( + uint256 tokens, + uint256 dataServiceCut + ) public useIndexer useDelegationFeeCut(IGraphPayments.PaymentTypes.QueryFee, delegationFeeCut) { + dataServiceCut = bound(dataServiceCut, 0, MAX_PPM); + tokens = bound(tokens, 1, MAX_STAKING_TOKENS); + + resetPrank(users.gateway); + _depositTokens(users.verifier, users.indexer, tokens); + + // burn some tokens to prevent overflow + resetPrank(users.indexer); + token.burn(MAX_STAKING_TOKENS); + + resetPrank(users.verifier); + _collectEscrow( + IGraphPayments.PaymentTypes.QueryFee, + users.gateway, + users.indexer, + tokens, + subgraphDataServiceAddress, + dataServiceCut, + users.indexer + ); + } + + function testCollect_RevertWhen_SenderHasInsufficientAmountInEscrow( + uint256 amount, + uint256 insufficientAmount + ) public useGateway useDeposit(insufficientAmount) { + vm.assume(amount > 0); + vm.assume(insufficientAmount < amount); + + vm.startPrank(users.verifier); + bytes memory expectedError = abi.encodeWithSignature( + "PaymentsEscrowInsufficientBalance(uint256,uint256)", + insufficientAmount, + amount + ); + vm.expectRevert(expectedError); + escrow.collect( + IGraphPayments.PaymentTypes.QueryFee, + users.gateway, + users.indexer, + amount, + subgraphDataServiceAddress, + 0, + users.indexer + ); + vm.stopPrank(); + } + + function testCollect_MultipleCollections( + uint256 depositAmount, + uint256 firstCollect, + uint256 secondCollect + ) public useIndexer { + // Tests multiple collect operations from the same escrow account + vm.assume(firstCollect < MAX_STAKING_TOKENS); + vm.assume(secondCollect < MAX_STAKING_TOKENS); + vm.assume(depositAmount > 0); + vm.assume(firstCollect > 0 && firstCollect < depositAmount); + vm.assume(secondCollect > 0 && secondCollect <= depositAmount - firstCollect); + + resetPrank(users.gateway); + _depositTokens(users.verifier, users.indexer, depositAmount); + + // burn some tokens to prevent overflow + resetPrank(users.indexer); + token.burn(MAX_STAKING_TOKENS); + + resetPrank(users.verifier); + _collectEscrow( + IGraphPayments.PaymentTypes.QueryFee, + users.gateway, + users.indexer, + firstCollect, + subgraphDataServiceAddress, + 0, + users.indexer + ); + } +} diff --git a/packages/horizon/test/unit/escrow/deposit.t.sol b/packages/horizon/test/unit/escrow/deposit.t.sol new file mode 100644 index 000000000..bab8d0e5f --- /dev/null +++ b/packages/horizon/test/unit/escrow/deposit.t.sol @@ -0,0 +1,37 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { GraphEscrowTest } from "./GraphEscrow.t.sol"; + +contract GraphEscrowDepositTest is GraphEscrowTest { + /* + * TESTS + */ + + function testDeposit_Tokens(uint256 amount) public useGateway useDeposit(amount) { + (uint256 indexerEscrowBalance, , ) = escrow.escrowAccounts(users.gateway, users.verifier, users.indexer); + assertEq(indexerEscrowBalance, amount); + } + + function testDepositTo_Tokens(uint256 amount) public { + resetPrank(users.delegator); + token.approve(address(escrow), amount); + _depositToTokens(users.gateway, users.verifier, users.indexer, amount); + } + + // Tests multiple deposits accumulate correctly in the escrow account + function testDeposit_MultipleDeposits(uint256 amount1, uint256 amount2) public useGateway { + vm.assume(amount1 > 0); + vm.assume(amount2 > 0); + vm.assume(amount1 <= MAX_STAKING_TOKENS); + vm.assume(amount2 <= MAX_STAKING_TOKENS); + + _depositTokens(users.verifier, users.indexer, amount1); + _depositTokens(users.verifier, users.indexer, amount2); + + (uint256 balance, , ) = escrow.escrowAccounts(users.gateway, users.verifier, users.indexer); + assertEq(balance, amount1 + amount2); + } +} diff --git a/packages/horizon/test/unit/escrow/getters.t.sol b/packages/horizon/test/unit/escrow/getters.t.sol new file mode 100644 index 000000000..e0279ee49 --- /dev/null +++ b/packages/horizon/test/unit/escrow/getters.t.sol @@ -0,0 +1,68 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; +import { IGraphPayments } from "../../../contracts/interfaces/IGraphPayments.sol"; + +import { GraphEscrowTest } from "./GraphEscrow.t.sol"; + +contract GraphEscrowGettersTest is GraphEscrowTest { + /* + * TESTS + */ + + function testGetBalance(uint256 amount) public useGateway useDeposit(amount) { + uint256 balance = escrow.getBalance(users.gateway, users.verifier, users.indexer); + assertEq(balance, amount); + } + + function testGetBalance_WhenThawing( + uint256 amountDeposit, + uint256 amountThawing + ) public useGateway useDeposit(amountDeposit) { + vm.assume(amountThawing > 0); + vm.assume(amountDeposit >= amountThawing); + + // thaw some funds + _thawEscrow(users.verifier, users.indexer, amountThawing); + + uint256 balance = escrow.getBalance(users.gateway, users.verifier, users.indexer); + assertEq(balance, amountDeposit - amountThawing); + } + + function testGetBalance_WhenCollectedOverThawing( + uint256 amountDeposit, + uint256 amountThawing, + uint256 amountCollected + ) public useGateway useDeposit(amountDeposit) { + vm.assume(amountThawing > 0); + vm.assume(amountDeposit > 0); + vm.assume(amountDeposit >= amountThawing); + vm.assume(amountDeposit >= amountCollected); + vm.assume(amountDeposit - amountCollected < amountThawing); + + // thaw some funds + _thawEscrow(users.verifier, users.indexer, amountThawing); + + // users start with max uint256 balance so we burn to avoid overflow + // TODO: we should modify all tests to consider users have a max balance thats less than max uint256 + resetPrank(users.indexer); + token.burn(amountCollected); + + // collect some funds to get the balance of the account below the amount thawing + resetPrank(users.verifier); + _collectEscrow( + IGraphPayments.PaymentTypes.QueryFee, + users.gateway, + users.indexer, + amountCollected, + subgraphDataServiceAddress, + 0, + users.indexer + ); + + // balance should always be 0 since thawing funds > available funds + uint256 balance = escrow.getBalance(users.gateway, users.verifier, users.indexer); + assertEq(balance, 0); + } +} diff --git a/packages/horizon/test/unit/escrow/paused.t.sol b/packages/horizon/test/unit/escrow/paused.t.sol new file mode 100644 index 000000000..60fe38f25 --- /dev/null +++ b/packages/horizon/test/unit/escrow/paused.t.sol @@ -0,0 +1,73 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { IGraphPayments } from "../../../contracts/interfaces/IGraphPayments.sol"; +import { IPaymentsEscrow } from "../../../contracts/interfaces/IPaymentsEscrow.sol"; + +import { GraphEscrowTest } from "./GraphEscrow.t.sol"; + +contract GraphEscrowPausedTest is GraphEscrowTest { + /* + * MODIFIERS + */ + + modifier usePaused(bool paused) { + address msgSender; + (, msgSender, ) = vm.readCallers(); + resetPrank(users.governor); + controller.setPaused(paused); + resetPrank(msgSender); + _; + } + + /* + * TESTS + */ + + // Escrow + + function testPaused_RevertWhen_Deposit(uint256 tokens) public useGateway usePaused(true) { + vm.expectRevert(abi.encodeWithSelector(IPaymentsEscrow.PaymentsEscrowIsPaused.selector)); + escrow.deposit(users.verifier, users.indexer, tokens); + } + + function testPaused_RevertWhen_DepositTo(uint256 tokens) public usePaused(true) { + resetPrank(users.operator); + vm.expectRevert(abi.encodeWithSelector(IPaymentsEscrow.PaymentsEscrowIsPaused.selector)); + escrow.depositTo(users.gateway, users.verifier, users.indexer, tokens); + } + + function testPaused_RevertWhen_ThawTokens(uint256 tokens) public useGateway useDeposit(tokens) usePaused(true) { + vm.expectRevert(abi.encodeWithSelector(IPaymentsEscrow.PaymentsEscrowIsPaused.selector)); + escrow.thaw(users.verifier, users.indexer, tokens); + } + + function testPaused_RevertWhen_WithdrawTokens( + uint256 tokens, + uint256 thawAmount + ) public useGateway depositAndThawTokens(tokens, thawAmount) usePaused(true) { + // advance time + skip(withdrawEscrowThawingPeriod + 1); + + vm.expectRevert(abi.encodeWithSelector(IPaymentsEscrow.PaymentsEscrowIsPaused.selector)); + escrow.withdraw(users.verifier, users.indexer); + } + + // Collect + + function testPaused_RevertWhen_CollectTokens(uint256 tokens, uint256 tokensDataService) public usePaused(true) { + resetPrank(users.verifier); + vm.expectRevert(abi.encodeWithSelector(IPaymentsEscrow.PaymentsEscrowIsPaused.selector)); + escrow.collect( + IGraphPayments.PaymentTypes.QueryFee, + users.gateway, + users.indexer, + tokens, + subgraphDataServiceAddress, + tokensDataService, + users.indexer + ); + } +} diff --git a/packages/horizon/test/unit/escrow/thaw.t.sol b/packages/horizon/test/unit/escrow/thaw.t.sol new file mode 100644 index 000000000..f7c23371b --- /dev/null +++ b/packages/horizon/test/unit/escrow/thaw.t.sol @@ -0,0 +1,79 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { GraphEscrowTest } from "./GraphEscrow.t.sol"; + +contract GraphEscrowThawTest is GraphEscrowTest { + /* + * TESTS + */ + + function testThaw_PartialBalanceThaw( + uint256 amountDeposited, + uint256 amountThawed + ) public useGateway useDeposit(amountDeposited) { + vm.assume(amountThawed > 0); + vm.assume(amountThawed <= amountDeposited); + _thawEscrow(users.verifier, users.indexer, amountThawed); + } + + function testThaw_FullBalanceThaw(uint256 amount) public useGateway useDeposit(amount) { + vm.assume(amount > 0); + _thawEscrow(users.verifier, users.indexer, amount); + + uint256 availableBalance = escrow.getBalance(users.gateway, users.verifier, users.indexer); + assertEq(availableBalance, 0); + } + + function testThaw_Tokens_SuccesiveCalls(uint256 amount) public useGateway { + amount = bound(amount, 2, type(uint256).max - 10); + _depositTokens(users.verifier, users.indexer, amount); + + uint256 firstAmountToThaw = (amount + 2 - 1) / 2; + uint256 secondAmountToThaw = (amount + 10 - 1) / 10; + _thawEscrow(users.verifier, users.indexer, firstAmountToThaw); + _thawEscrow(users.verifier, users.indexer, secondAmountToThaw); + + (, address msgSender, ) = vm.readCallers(); + (, uint256 amountThawing, uint256 thawEndTimestamp) = escrow.escrowAccounts( + msgSender, + users.verifier, + users.indexer + ); + assertEq(amountThawing, secondAmountToThaw); + assertEq(thawEndTimestamp, block.timestamp + withdrawEscrowThawingPeriod); + } + + function testThaw_Tokens_RevertWhen_AmountIsZero() public useGateway { + bytes memory expectedError = abi.encodeWithSignature("PaymentsEscrowInvalidZeroTokens()"); + vm.expectRevert(expectedError); + escrow.thaw(users.verifier, users.indexer, 0); + } + + function testThaw_RevertWhen_InsufficientAmount( + uint256 amount, + uint256 overAmount + ) public useGateway useDeposit(amount) { + overAmount = bound(overAmount, amount + 1, type(uint256).max); + bytes memory expectedError = abi.encodeWithSignature( + "PaymentsEscrowInsufficientBalance(uint256,uint256)", + amount, + overAmount + ); + vm.expectRevert(expectedError); + escrow.thaw(users.verifier, users.indexer, overAmount); + } + + function testThaw_CancelRequest(uint256 amount) public useGateway useDeposit(amount) { + _thawEscrow(users.verifier, users.indexer, amount); + _cancelThawEscrow(users.verifier, users.indexer); + } + + function testThaw_CancelRequest_RevertWhen_NoThawing(uint256 amount) public useGateway useDeposit(amount) { + bytes memory expectedError = abi.encodeWithSignature("PaymentsEscrowNotThawing()"); + vm.expectRevert(expectedError); + escrow.cancelThaw(users.verifier, users.indexer); + } +} diff --git a/packages/horizon/test/unit/escrow/withdraw.t.sol b/packages/horizon/test/unit/escrow/withdraw.t.sol new file mode 100644 index 000000000..1b60118bf --- /dev/null +++ b/packages/horizon/test/unit/escrow/withdraw.t.sol @@ -0,0 +1,75 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { IGraphPayments } from "../../../contracts/interfaces/IGraphPayments.sol"; +import { GraphEscrowTest } from "./GraphEscrow.t.sol"; + +contract GraphEscrowWithdrawTest is GraphEscrowTest { + /* + * TESTS + */ + + function testWithdraw_Tokens( + uint256 amount, + uint256 thawAmount + ) public useGateway depositAndThawTokens(amount, thawAmount) { + // advance time + skip(withdrawEscrowThawingPeriod + 1); + + _withdrawEscrow(users.verifier, users.indexer); + vm.stopPrank(); + } + + function testWithdraw_RevertWhen_NotThawing(uint256 amount) public useGateway useDeposit(amount) { + bytes memory expectedError = abi.encodeWithSignature("PaymentsEscrowNotThawing()"); + vm.expectRevert(expectedError); + escrow.withdraw(users.verifier, users.indexer); + } + + function testWithdraw_RevertWhen_StillThawing( + uint256 amount, + uint256 thawAmount + ) public useGateway depositAndThawTokens(amount, thawAmount) { + bytes memory expectedError = abi.encodeWithSignature( + "PaymentsEscrowStillThawing(uint256,uint256)", + block.timestamp, + block.timestamp + withdrawEscrowThawingPeriod + ); + vm.expectRevert(expectedError); + escrow.withdraw(users.verifier, users.indexer); + } + + function testWithdraw_BalanceAfterCollect( + uint256 amountDeposited, + uint256 amountThawed, + uint256 amountCollected + ) public useGateway depositAndThawTokens(amountDeposited, amountThawed) { + vm.assume(amountCollected > 0); + vm.assume(amountCollected <= amountDeposited); + + // burn some tokens to prevent overflow + resetPrank(users.indexer); + token.burn(MAX_STAKING_TOKENS); + + // collect + resetPrank(users.verifier); + _collectEscrow( + IGraphPayments.PaymentTypes.QueryFee, + users.gateway, + users.indexer, + amountCollected, + subgraphDataServiceAddress, + 0, + users.indexer + ); + + // Advance time to simulate the thawing period + skip(withdrawEscrowThawingPeriod + 1); + + // withdraw the remaining thawed balance + resetPrank(users.gateway); + _withdrawEscrow(users.verifier, users.indexer); + } +} diff --git a/packages/horizon/test/unit/libraries/LinkedList.t.sol b/packages/horizon/test/unit/libraries/LinkedList.t.sol new file mode 100644 index 000000000..13f31b8ad --- /dev/null +++ b/packages/horizon/test/unit/libraries/LinkedList.t.sol @@ -0,0 +1,194 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity 0.8.27; + +import "forge-std/console.sol"; +import { Test } from "forge-std/Test.sol"; +import { LinkedList } from "../../../contracts/libraries/LinkedList.sol"; + +import { ListImplementation } from "./ListImplementation.sol"; + +contract LinkedListTest is Test, ListImplementation { + using LinkedList for LinkedList.List; + + function setUp() internal { + list = LinkedList.List({ head: bytes32(0), tail: bytes32(0), nonce: 0, count: 0 }); + } + + /// forge-config: default.allow_internal_expect_revert = true + function test_Add_RevertGiven_TheItemIdIsZero() external { + vm.expectRevert(LinkedList.LinkedListInvalidZeroId.selector); + list.addTail(bytes32(0)); + } + + function test_Add_GivenTheListIsEmpty() external { + _assert_addItem(_buildItemId(list.nonce), 0); + } + + function test_Add_GivenTheListIsNotEmpty() external { + // init list + _assert_addItem(_buildItemId(list.nonce), 0); + + // add to a non empty list + _assert_addItem(_buildItemId(list.nonce), 1); + } + + /// forge-config: default.allow_internal_expect_revert = true + function test_Add_RevertGiven_TheListIsAtMaxSize() external { + for (uint256 i = 0; i < LinkedList.MAX_ITEMS; i++) { + bytes32 id = _buildItemId(list.nonce); + _addItemToList(list, id, i); + } + + vm.expectRevert(LinkedList.LinkedListMaxElementsExceeded.selector); + list.addTail(_buildItemId(list.nonce)); + } + + /// forge-config: default.allow_internal_expect_revert = true + function test_Remove_RevertGiven_TheListIsEmpty() external { + vm.expectRevert(LinkedList.LinkedListEmptyList.selector); + list.removeHead(_getNextItem, _deleteItem); + } + + function test_Remove_GivenTheListIsNotEmpty() external { + _assert_addItem(_buildItemId(list.nonce), 0); + _assert_removeItem(); + } + + function test_TraverseGivenTheListIsEmpty() external { + _assert_traverseList(_processItemAddition, abi.encode(0), 0, abi.encode(0)); + } + + modifier givenTheListIsNotEmpty() { + for (uint256 i = 0; i < LIST_LENGTH; i++) { + bytes32 id = _buildItemId(list.nonce); + _assert_addItem(id, i); + } + _; + } + + function test_TraverseWhenIterationsAreNotSpecified() external givenTheListIsNotEmpty { + // calculate sum of all item idexes - it's what _processItemAddition does + uint256 sum = 0; + for (uint256 i = 0; i < list.count; i++) { + sum += i; + } + _assert_traverseList(_processItemAddition, abi.encode(0), 0, abi.encode(sum)); + } + + function test_TraverseWhenIterationsAreSpecified(uint256 n) external givenTheListIsNotEmpty { + vm.assume(n > 0); + vm.assume(n < LIST_LENGTH); + uint256 sum = 0; + for (uint256 i = 0; i < n; i++) { + sum += i; + } + _assert_traverseList(_processItemAddition, abi.encode(0), n, abi.encode(sum)); + } + + /// forge-config: default.allow_internal_expect_revert = true + function test_TraverseWhenIterationsAreInvalid() external givenTheListIsNotEmpty { + uint256 n = LIST_LENGTH + 1; + uint256 sum = 0; + for (uint256 i = 0; i < n; i++) { + sum += i; + } + vm.expectRevert(LinkedList.LinkedListInvalidIterations.selector); + _assert_traverseList(_processItemAddition, abi.encode(0), n, abi.encode(sum)); + } + + // -- Assertions -- + function _assert_addItem(bytes32 id, uint256 idIndex) internal { + uint256 beforeNonce = list.nonce; + uint256 beforeCount = list.count; + bytes32 beforeHead = list.head; + + ids[idIndex] = _addItemToList(list, id, idIndex); + + uint256 afterNonce = list.nonce; + uint256 afterCount = list.count; + bytes32 afterTail = list.tail; + bytes32 afterHead = list.head; + + assertEq(afterNonce, beforeNonce + 1); + assertEq(afterCount, beforeCount + 1); + + if (beforeCount == 0) { + assertEq(afterHead, id); + } else { + assertEq(afterHead, beforeHead); + } + assertEq(afterTail, id); + } + + function _assert_removeItem() internal { + uint256 beforeNonce = list.nonce; + uint256 beforeCount = list.count; + bytes32 beforeTail = list.tail; + bytes32 beforeHead = list.head; + + Item memory beforeHeadItem = items[beforeHead]; + + list.removeHead(_getNextItem, _deleteItem); + + uint256 afterNonce = list.nonce; + uint256 afterCount = list.count; + bytes32 afterTail = list.tail; + bytes32 afterHead = list.head; + + assertEq(afterNonce, beforeNonce); + assertEq(afterCount, beforeCount - 1); + + if (afterCount == 0) { + assertEq(afterTail, bytes32(0)); + } else { + assertEq(afterTail, beforeTail); + } + assertEq(afterHead, beforeHeadItem.next); + } + + function _assert_traverseList( + function(bytes32, bytes memory) internal returns (bool, bytes memory) _processItem, + bytes memory _initAcc, + uint256 _n, + bytes memory _expectedAcc + ) internal { + uint256 beforeNonce = list.nonce; + uint256 beforeCount = list.count; + bytes32 beforeTail = list.tail; + bytes32 beforeHead = list.head; + + // calculate after head item + bytes32 calcAfterHead = beforeHead; + if (_n != 0) { + for (uint256 i = 0; i < _n; i++) { + calcAfterHead = _getNextItem(calcAfterHead); + } + } + + (uint256 processedCount, bytes memory acc) = list.traverse( + _getNextItem, + _processItem, + _deleteItem, + _initAcc, + _n + ); + uint256 afterNonce = list.nonce; + uint256 afterCount = list.count; + bytes32 afterTail = list.tail; + bytes32 afterHead = list.head; + + assertEq(processedCount, _n == 0 ? beforeCount : _n); + assertEq(acc, _expectedAcc); + + assertEq(afterNonce, beforeNonce); + assertEq(afterCount, _n == 0 ? 0 : beforeCount - _n); + + if (_n == 0) { + assertEq(afterTail, bytes32(0)); + assertEq(afterHead, bytes32(0)); + } else { + assertEq(afterTail, beforeTail); + assertEq(afterHead, calcAfterHead); + } + } +} diff --git a/packages/horizon/test/unit/libraries/ListImplementation.sol b/packages/horizon/test/unit/libraries/ListImplementation.sol new file mode 100644 index 000000000..5f1c6ce3b --- /dev/null +++ b/packages/horizon/test/unit/libraries/ListImplementation.sol @@ -0,0 +1,48 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity 0.8.27; + +import { LinkedList } from "../../../contracts/libraries/LinkedList.sol"; + +contract ListImplementation { + using LinkedList for LinkedList.List; + + uint256 constant LIST_LENGTH = 100; + + struct Item { + uint256 data; + bytes32 next; + } + + LinkedList.List public list; + mapping(bytes32 id => Item data) public items; + bytes32[LIST_LENGTH] public ids; + + function _addItemToList(LinkedList.List storage _list, bytes32 _id, uint256 _data) internal returns (bytes32) { + items[_id] = Item({ data: _data, next: bytes32(0) }); + if (_list.count != 0) { + items[_list.tail].next = _id; + } + _list.addTail(_id); + return _id; + } + + function _deleteItem(bytes32 _id) internal { + delete items[_id]; + } + + function _getNextItem(bytes32 _id) internal view returns (bytes32) { + return items[_id].next; + } + + function _processItemAddition(bytes32 _id, bytes memory _acc) internal view returns (bool, bytes memory) { + uint256 sum = abi.decode(_acc, (uint256)); + sum += items[_id].data; + return (false, abi.encode(sum)); // dont break, do delete + } + + function _buildItemId(uint256 nonce) internal view returns (bytes32) { + // use block.number to salt the id generation to avoid + // accidentally using dirty state on repeat tests + return bytes32(keccak256(abi.encode(nonce, block.number))); + } +} diff --git a/packages/horizon/test/unit/libraries/PPMMath.t.sol b/packages/horizon/test/unit/libraries/PPMMath.t.sol new file mode 100644 index 000000000..a2d011aeb --- /dev/null +++ b/packages/horizon/test/unit/libraries/PPMMath.t.sol @@ -0,0 +1,48 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity 0.8.27; + +import "forge-std/console.sol"; +import { Test } from "forge-std/Test.sol"; +import { PPMMath } from "../../../contracts/libraries/PPMMath.sol"; + +contract PPMMathTest is Test { + uint32 private constant MAX_PPM = 1000000; + + function test_mulPPM(uint256 a, uint256 b) public pure { + a = bound(a, 0, MAX_PPM); + b = bound(b, 0, type(uint256).max / MAX_PPM); + + uint256 result = PPMMath.mulPPM(a, b); + assertEq(result, (a * b) / MAX_PPM); + } + + function test_mulPPMRoundUp(uint256 a, uint256 b) public pure { + a = bound(a, 0, type(uint256).max / MAX_PPM); + b = bound(b, 0, MAX_PPM); + + uint256 result = PPMMath.mulPPMRoundUp(a, b); + assertEq(result, a - PPMMath.mulPPM(a, MAX_PPM - b)); + } + + function test_isValidPPM(uint256 value) public pure { + bool result = PPMMath.isValidPPM(value); + assert(result == (value <= MAX_PPM)); + } + + /// forge-config: default.allow_internal_expect_revert = true + function test_mullPPM_RevertWhen_InvalidPPM(uint256 a, uint256 b) public { + a = bound(a, MAX_PPM + 1, type(uint256).max); + b = bound(b, MAX_PPM + 1, type(uint256).max); + bytes memory expectedError = abi.encodeWithSelector(PPMMath.PPMMathInvalidMulPPM.selector, a, b); + vm.expectRevert(expectedError); + PPMMath.mulPPM(a, b); + } + + /// forge-config: default.allow_internal_expect_revert = true + function test_mullPPMRoundUp_RevertWhen_InvalidPPM(uint256 a, uint256 b) public { + b = bound(b, MAX_PPM + 1, type(uint256).max); + bytes memory expectedError = abi.encodeWithSelector(PPMMath.PPMMathInvalidPPM.selector, b); + vm.expectRevert(expectedError); + PPMMath.mulPPMRoundUp(a, b); + } +} diff --git a/packages/horizon/test/unit/payments/GraphPayments.t.sol b/packages/horizon/test/unit/payments/GraphPayments.t.sol new file mode 100644 index 000000000..564bf3a1f --- /dev/null +++ b/packages/horizon/test/unit/payments/GraphPayments.t.sol @@ -0,0 +1,472 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { IHorizonStakingMain } from "../../../contracts/interfaces/internal/IHorizonStakingMain.sol"; +import { IHorizonStakingTypes } from "../../../contracts/interfaces/internal/IHorizonStakingTypes.sol"; +import { IGraphPayments } from "../../../contracts/interfaces/IGraphPayments.sol"; +import { GraphPayments } from "../../../contracts/payments/GraphPayments.sol"; + +import { HorizonStakingSharedTest } from "../shared/horizon-staking/HorizonStakingShared.t.sol"; +import { PPMMath } from "../../../contracts/libraries/PPMMath.sol"; +import { IERC20Errors } from "@openzeppelin/contracts/interfaces/draft-IERC6093.sol"; + +contract GraphPaymentsExtended is GraphPayments { + constructor(address controller, uint256 protocolPaymentCut) GraphPayments(controller, protocolPaymentCut) {} + + function readController() external view returns (address) { + return address(_graphController()); + } +} + +contract GraphPaymentsTest is HorizonStakingSharedTest { + using PPMMath for uint256; + + struct CollectPaymentData { + uint256 escrowBalance; + uint256 paymentsBalance; + uint256 receiverBalance; + uint256 receiverDestinationBalance; + uint256 delegationPoolBalance; + uint256 dataServiceBalance; + uint256 receiverStake; + } + + struct CollectTokensData { + uint256 tokensProtocol; + uint256 tokensDataService; + uint256 tokensDelegation; + uint256 receiverExpectedPayment; + } + + function _collect( + IGraphPayments.PaymentTypes _paymentType, + address _receiver, + uint256 _tokens, + address _dataService, + uint256 _dataServiceCut, + address _paymentsDestination + ) private { + // Previous balances + CollectPaymentData memory previousBalances = CollectPaymentData({ + escrowBalance: token.balanceOf(address(escrow)), + paymentsBalance: token.balanceOf(address(payments)), + receiverBalance: token.balanceOf(_receiver), + receiverDestinationBalance: token.balanceOf(_paymentsDestination), + delegationPoolBalance: staking.getDelegatedTokensAvailable(_receiver, _dataService), + dataServiceBalance: token.balanceOf(_dataService), + receiverStake: staking.getStake(_receiver) + }); + + // Calculate cuts + CollectTokensData memory collectTokensData = CollectTokensData({ + tokensProtocol: 0, + tokensDataService: 0, + tokensDelegation: 0, + receiverExpectedPayment: 0 + }); + collectTokensData.tokensProtocol = _tokens.mulPPMRoundUp(payments.PROTOCOL_PAYMENT_CUT()); + collectTokensData.tokensDataService = (_tokens - collectTokensData.tokensProtocol).mulPPMRoundUp( + _dataServiceCut + ); + + { + IHorizonStakingTypes.DelegationPool memory pool = staking.getDelegationPool(_receiver, _dataService); + if (pool.shares > 0) { + collectTokensData.tokensDelegation = (_tokens - + collectTokensData.tokensProtocol - + collectTokensData.tokensDataService).mulPPMRoundUp( + staking.getDelegationFeeCut(_receiver, _dataService, _paymentType) + ); + } + } + + collectTokensData.receiverExpectedPayment = + _tokens - + collectTokensData.tokensProtocol - + collectTokensData.tokensDataService - + collectTokensData.tokensDelegation; + + (, address msgSender, ) = vm.readCallers(); + vm.expectEmit(address(payments)); + emit IGraphPayments.GraphPaymentCollected( + _paymentType, + msgSender, + _receiver, + _dataService, + _tokens, + collectTokensData.tokensProtocol, + collectTokensData.tokensDataService, + collectTokensData.tokensDelegation, + collectTokensData.receiverExpectedPayment, + _paymentsDestination + ); + payments.collect(_paymentType, _receiver, _tokens, _dataService, _dataServiceCut, _paymentsDestination); + + // After balances + CollectPaymentData memory afterBalances = CollectPaymentData({ + escrowBalance: token.balanceOf(address(escrow)), + paymentsBalance: token.balanceOf(address(payments)), + receiverBalance: token.balanceOf(_receiver), + receiverDestinationBalance: token.balanceOf(_paymentsDestination), + delegationPoolBalance: staking.getDelegatedTokensAvailable(_receiver, _dataService), + dataServiceBalance: token.balanceOf(_dataService), + receiverStake: staking.getStake(_receiver) + }); + + // Check receiver balance after payment + assertEq( + afterBalances.receiverBalance - previousBalances.receiverBalance, + _paymentsDestination == _receiver ? collectTokensData.receiverExpectedPayment : 0 + ); + assertEq(token.balanceOf(address(payments)), 0); + + // Check receiver destination balance after payment + assertEq( + afterBalances.receiverDestinationBalance - previousBalances.receiverDestinationBalance, + _paymentsDestination == address(0) ? 0 : collectTokensData.receiverExpectedPayment + ); + + // Check receiver stake after payment + assertEq( + afterBalances.receiverStake - previousBalances.receiverStake, + _paymentsDestination == address(0) ? collectTokensData.receiverExpectedPayment : 0 + ); + + // Check delegation pool balance after payment + assertEq( + afterBalances.delegationPoolBalance - previousBalances.delegationPoolBalance, + collectTokensData.tokensDelegation + ); + + // Check that the escrow account has been updated + assertEq(previousBalances.escrowBalance, afterBalances.escrowBalance + _tokens); + + // Check that payments balance didn't change + assertEq(previousBalances.paymentsBalance, afterBalances.paymentsBalance); + + // Check data service balance after payment + assertEq( + afterBalances.dataServiceBalance - previousBalances.dataServiceBalance, + collectTokensData.tokensDataService + ); + } + + /* + * TESTS + */ + + function testConstructor() public { + uint256 protocolCut = 100_000; + GraphPaymentsExtended newPayments = new GraphPaymentsExtended(address(controller), protocolCut); + assertEq(address(newPayments.readController()), address(controller)); + assertEq(newPayments.PROTOCOL_PAYMENT_CUT(), protocolCut); + } + + function testConstructor_RevertIf_InvalidProtocolPaymentCut(uint256 protocolPaymentCut) public { + protocolPaymentCut = bound(protocolPaymentCut, MAX_PPM + 1, type(uint256).max); + + resetPrank(users.deployer); + bytes memory expectedError = abi.encodeWithSelector( + IGraphPayments.GraphPaymentsInvalidCut.selector, + protocolPaymentCut + ); + vm.expectRevert(expectedError); + new GraphPayments(address(controller), protocolPaymentCut); + } + + function testInitialize() public { + // Deploy new instance to test initialization + GraphPayments newPayments = new GraphPayments(address(controller), 100_000); + + // Should revert if not called by onlyInitializer + vm.expectRevert(); + newPayments.initialize(); + } + + function testCollect( + uint256 amount, + uint256 amountToCollect, + uint256 dataServiceCut, + uint256 tokensDelegate, + uint256 delegationFeeCut + ) public useIndexer useProvision(amount, 0, 0) { + amountToCollect = bound(amountToCollect, 1, MAX_STAKING_TOKENS); + dataServiceCut = bound(dataServiceCut, 0, MAX_PPM); + tokensDelegate = bound(tokensDelegate, 1, MAX_STAKING_TOKENS); + delegationFeeCut = bound(delegationFeeCut, 0, MAX_PPM); // Covers zero, max, and everything in between + + // Set delegation fee cut + _setDelegationFeeCut( + users.indexer, + subgraphDataServiceAddress, + IGraphPayments.PaymentTypes.QueryFee, + delegationFeeCut + ); + + // Delegate tokens + tokensDelegate = bound(tokensDelegate, MIN_DELEGATION, MAX_STAKING_TOKENS); + vm.startPrank(users.delegator); + _delegate(users.indexer, subgraphDataServiceAddress, tokensDelegate, 0); + + // Add tokens in escrow + address escrowAddress = address(escrow); + mint(escrowAddress, amount); + vm.startPrank(escrowAddress); + approve(address(payments), amount); + + // Collect payments through GraphPayments + _collect( + IGraphPayments.PaymentTypes.QueryFee, + users.indexer, + amount, + subgraphDataServiceAddress, + dataServiceCut, + users.indexer + ); + vm.stopPrank(); + } + + function testCollect_WithRestaking( + uint256 amount, + uint256 amountToCollect, + uint256 dataServiceCut, + uint256 tokensDelegate, + uint256 delegationFeeCut + ) public useIndexer useProvision(amount, 0, 0) { + amountToCollect = bound(amountToCollect, 1, MAX_STAKING_TOKENS); + dataServiceCut = bound(dataServiceCut, 0, MAX_PPM); + tokensDelegate = bound(tokensDelegate, 1, MAX_STAKING_TOKENS); + delegationFeeCut = bound(delegationFeeCut, 0, MAX_PPM); // Covers zero, max, and everything in between + + // Set delegation fee cut + _setDelegationFeeCut( + users.indexer, + subgraphDataServiceAddress, + IGraphPayments.PaymentTypes.QueryFee, + delegationFeeCut + ); + + // Delegate tokens + tokensDelegate = bound(tokensDelegate, MIN_DELEGATION, MAX_STAKING_TOKENS); + vm.startPrank(users.delegator); + _delegate(users.indexer, subgraphDataServiceAddress, tokensDelegate, 0); + + // Add tokens in escrow + address escrowAddress = address(escrow); + mint(escrowAddress, amount); + vm.startPrank(escrowAddress); + approve(address(payments), amount); + + // Collect payments through GraphPayments + _collect( + IGraphPayments.PaymentTypes.QueryFee, + users.indexer, + amount, + subgraphDataServiceAddress, + dataServiceCut, + address(0) + ); + vm.stopPrank(); + } + + function testCollect_WithBeneficiary( + uint256 amount, + uint256 amountToCollect, + uint256 dataServiceCut, + uint256 tokensDelegate, + uint256 delegationFeeCut + ) public useIndexer useProvision(amount, 0, 0) { + amountToCollect = bound(amountToCollect, 1, MAX_STAKING_TOKENS); + dataServiceCut = bound(dataServiceCut, 0, MAX_PPM); + tokensDelegate = bound(tokensDelegate, 1, MAX_STAKING_TOKENS); + delegationFeeCut = bound(delegationFeeCut, 0, MAX_PPM); // Covers zero, max, and everything in between + + // Set delegation fee cut + _setDelegationFeeCut( + users.indexer, + subgraphDataServiceAddress, + IGraphPayments.PaymentTypes.QueryFee, + delegationFeeCut + ); + + // Delegate tokens + tokensDelegate = bound(tokensDelegate, MIN_DELEGATION, MAX_STAKING_TOKENS); + vm.startPrank(users.delegator); + _delegate(users.indexer, subgraphDataServiceAddress, tokensDelegate, 0); + + // Add tokens in escrow + address escrowAddress = address(escrow); + mint(escrowAddress, amount); + vm.startPrank(escrowAddress); + approve(address(payments), amount); + + // Collect payments through GraphPayments + _collect( + IGraphPayments.PaymentTypes.QueryFee, + users.indexer, + amount, + subgraphDataServiceAddress, + dataServiceCut, + vm.addr(1) // use some random address as beneficiary + ); + vm.stopPrank(); + } + + function testCollect_NoProvision( + uint256 amount, + uint256 dataServiceCut, + uint256 delegationFeeCut + ) public useIndexer { + amount = bound(amount, 1, MAX_STAKING_TOKENS); + dataServiceCut = bound(dataServiceCut, 0, MAX_PPM); + delegationFeeCut = bound(delegationFeeCut, 0, MAX_PPM); // Covers zero, max, and everything in between + + // Set delegation fee cut + _setDelegationFeeCut( + users.indexer, + subgraphDataServiceAddress, + IGraphPayments.PaymentTypes.QueryFee, + delegationFeeCut + ); + + // Add tokens in escrow + address escrowAddress = address(escrow); + mint(escrowAddress, amount); + vm.startPrank(escrowAddress); + approve(address(payments), amount); + + // burn some tokens to prevent overflow + resetPrank(users.indexer); + token.burn(MAX_STAKING_TOKENS); + + // Collect payments through GraphPayments + vm.startPrank(escrowAddress); + _collect( + IGraphPayments.PaymentTypes.QueryFee, + users.indexer, + amount, + subgraphDataServiceAddress, + dataServiceCut, + users.indexer + ); + vm.stopPrank(); + } + + function testCollect_RevertWhen_InvalidDataServiceCut( + uint256 amount, + uint256 dataServiceCut + ) + public + useIndexer + useProvision(amount, 0, 0) + useDelegationFeeCut(IGraphPayments.PaymentTypes.QueryFee, delegationFeeCut) + { + dataServiceCut = bound(dataServiceCut, MAX_PPM + 1, type(uint256).max); + + resetPrank(users.deployer); + bytes memory expectedError = abi.encodeWithSelector( + IGraphPayments.GraphPaymentsInvalidCut.selector, + dataServiceCut + ); + vm.expectRevert(expectedError); + payments.collect( + IGraphPayments.PaymentTypes.QueryFee, + users.indexer, + amount, + subgraphDataServiceAddress, + dataServiceCut, + users.indexer + ); + } + + function testCollect_WithZeroAmount(uint256 amount) public useIndexer useProvision(amount, 0, 0) { + _collect(IGraphPayments.PaymentTypes.QueryFee, users.indexer, 0, subgraphDataServiceAddress, 0, users.indexer); + } + + function testCollect_RevertWhen_UnauthorizedCaller(uint256 amount) public useIndexer useProvision(amount, 0, 0) { + vm.assume(amount > 0 && amount <= MAX_STAKING_TOKENS); + + // Try to collect without being the escrow + resetPrank(users.indexer); + + vm.expectRevert( + abi.encodeWithSelector(IERC20Errors.ERC20InsufficientAllowance.selector, address(payments), 0, amount) + ); + + payments.collect( + IGraphPayments.PaymentTypes.QueryFee, + users.indexer, + amount, + subgraphDataServiceAddress, + 0, + users.indexer + ); + } + + function testCollect_WithNoDelegation( + uint256 amount, + uint256 dataServiceCut, + uint256 delegationFeeCut + ) public useIndexer useProvision(amount, 0, 0) { + dataServiceCut = bound(dataServiceCut, 0, MAX_PPM); + delegationFeeCut = bound(delegationFeeCut, 0, MAX_PPM); + + // Set delegation fee cut + _setDelegationFeeCut( + users.indexer, + subgraphDataServiceAddress, + IGraphPayments.PaymentTypes.QueryFee, + delegationFeeCut + ); + + // Add tokens in escrow + address escrowAddress = address(escrow); + mint(escrowAddress, amount); + vm.startPrank(escrowAddress); + approve(address(payments), amount); + + // Collect payments through GraphPayments + _collect( + IGraphPayments.PaymentTypes.QueryFee, + users.indexer, + amount, + subgraphDataServiceAddress, + dataServiceCut, + users.indexer + ); + vm.stopPrank(); + } + + function testCollect_ViaMulticall(uint256 amount) public useIndexer { + amount = bound(amount, 1, MAX_STAKING_TOKENS / 2); // Divide by 2 as we'll make two calls + + address escrowAddress = address(escrow); + mint(escrowAddress, amount * 2); + vm.startPrank(escrowAddress); + approve(address(payments), amount * 2); + + bytes[] memory data = new bytes[](2); + data[0] = abi.encodeWithSelector( + payments.collect.selector, + IGraphPayments.PaymentTypes.QueryFee, + users.indexer, + amount, + subgraphDataServiceAddress, + 100_000, // 10% + users.indexer + ); + data[1] = abi.encodeWithSelector( + payments.collect.selector, + IGraphPayments.PaymentTypes.IndexingFee, + users.indexer, + amount, + subgraphDataServiceAddress, + 200_000, // 20% + users.indexer + ); + + payments.multicall(data); + } +} diff --git a/packages/horizon/test/unit/payments/graph-tally-collector/GraphTallyCollector.t.sol b/packages/horizon/test/unit/payments/graph-tally-collector/GraphTallyCollector.t.sol new file mode 100644 index 000000000..ca9ff235d --- /dev/null +++ b/packages/horizon/test/unit/payments/graph-tally-collector/GraphTallyCollector.t.sol @@ -0,0 +1,183 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { ECDSA } from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; +import { MessageHashUtils } from "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol"; +import { IHorizonStakingMain } from "../../../../contracts/interfaces/internal/IHorizonStakingMain.sol"; +import { IGraphTallyCollector } from "../../../../contracts/interfaces/IGraphTallyCollector.sol"; +import { IPaymentsCollector } from "../../../../contracts/interfaces/IPaymentsCollector.sol"; +import { IGraphPayments } from "../../../../contracts/interfaces/IGraphPayments.sol"; +import { IAuthorizable } from "../../../../contracts/interfaces/IAuthorizable.sol"; +import { GraphTallyCollector } from "../../../../contracts/payments/collectors/GraphTallyCollector.sol"; +import { PPMMath } from "../../../../contracts/libraries/PPMMath.sol"; + +import { HorizonStakingSharedTest } from "../../shared/horizon-staking/HorizonStakingShared.t.sol"; +import { PaymentsEscrowSharedTest } from "../../shared/payments-escrow/PaymentsEscrowShared.t.sol"; + +contract GraphTallyTest is HorizonStakingSharedTest, PaymentsEscrowSharedTest { + using PPMMath for uint256; + + address signer; + uint256 signerPrivateKey; + + /* + * MODIFIERS + */ + + modifier useSigner() { + uint256 proofDeadline = block.timestamp + 1; + bytes memory signerProof = _getSignerProof(proofDeadline, signerPrivateKey); + _authorizeSigner(signer, proofDeadline, signerProof); + _; + } + + /* + * SET UP + */ + + function setUp() public virtual override { + super.setUp(); + (signer, signerPrivateKey) = makeAddrAndKey("signer"); + vm.label({ account: signer, newLabel: "signer" }); + } + + /* + * HELPERS + */ + + function _getSignerProof(uint256 _proofDeadline, uint256 _signer) internal returns (bytes memory) { + (, address msgSender, ) = vm.readCallers(); + bytes32 messageHash = keccak256( + abi.encodePacked( + block.chainid, + address(graphTallyCollector), + "authorizeSignerProof", + _proofDeadline, + msgSender + ) + ); + bytes32 proofToDigest = MessageHashUtils.toEthSignedMessageHash(messageHash); + (uint8 v, bytes32 r, bytes32 s) = vm.sign(_signer, proofToDigest); + return abi.encodePacked(r, s, v); + } + + /* + * ACTIONS + */ + + function _authorizeSigner(address _signer, uint256 _proofDeadline, bytes memory _proof) internal { + (, address msgSender, ) = vm.readCallers(); + + vm.expectEmit(address(graphTallyCollector)); + emit IAuthorizable.SignerAuthorized(msgSender, _signer); + + graphTallyCollector.authorizeSigner(_signer, _proofDeadline, _proof); + assertTrue(graphTallyCollector.isAuthorized(msgSender, _signer)); + assertEq(graphTallyCollector.getThawEnd(_signer), 0); + } + + function _thawSigner(address _signer) internal { + (, address msgSender, ) = vm.readCallers(); + uint256 expectedThawEndTimestamp = block.timestamp + revokeSignerThawingPeriod; + + vm.expectEmit(address(graphTallyCollector)); + emit IAuthorizable.SignerThawing(msgSender, _signer, expectedThawEndTimestamp); + + graphTallyCollector.thawSigner(_signer); + + assertTrue(graphTallyCollector.isAuthorized(msgSender, _signer)); + assertEq(graphTallyCollector.getThawEnd(_signer), expectedThawEndTimestamp); + } + + function _cancelThawSigner(address _signer) internal { + (, address msgSender, ) = vm.readCallers(); + + vm.expectEmit(address(graphTallyCollector)); + emit IAuthorizable.SignerThawCanceled(msgSender, _signer, graphTallyCollector.getThawEnd(_signer)); + + graphTallyCollector.cancelThawSigner(_signer); + + assertTrue(graphTallyCollector.isAuthorized(msgSender, _signer)); + assertEq(graphTallyCollector.getThawEnd(_signer), 0); + } + + function _revokeAuthorizedSigner(address _signer) internal { + (, address msgSender, ) = vm.readCallers(); + + assertTrue(graphTallyCollector.isAuthorized(msgSender, _signer)); + assertLt(graphTallyCollector.getThawEnd(_signer), block.timestamp); + + vm.expectEmit(address(graphTallyCollector)); + emit IAuthorizable.SignerRevoked(msgSender, _signer); + + graphTallyCollector.revokeAuthorizedSigner(_signer); + + assertFalse(graphTallyCollector.isAuthorized(msgSender, _signer)); + } + + function _collect(IGraphPayments.PaymentTypes _paymentType, bytes memory _data) internal { + __collect(_paymentType, _data, 0); + } + + function _collect(IGraphPayments.PaymentTypes _paymentType, bytes memory _data, uint256 _tokensToCollect) internal { + __collect(_paymentType, _data, _tokensToCollect); + } + + function __collect( + IGraphPayments.PaymentTypes _paymentType, + bytes memory _data, + uint256 _tokensToCollect + ) internal { + (IGraphTallyCollector.SignedRAV memory signedRAV, ) = abi.decode( + _data, + (IGraphTallyCollector.SignedRAV, uint256) + ); + uint256 tokensAlreadyCollected = graphTallyCollector.tokensCollected( + signedRAV.rav.dataService, + signedRAV.rav.collectionId, + signedRAV.rav.serviceProvider, + signedRAV.rav.payer + ); + uint256 tokensToCollect = _tokensToCollect == 0 + ? signedRAV.rav.valueAggregate - tokensAlreadyCollected + : _tokensToCollect; + + vm.expectEmit(address(graphTallyCollector)); + emit IPaymentsCollector.PaymentCollected( + _paymentType, + signedRAV.rav.collectionId, + signedRAV.rav.payer, + signedRAV.rav.serviceProvider, + signedRAV.rav.dataService, + tokensToCollect + ); + vm.expectEmit(address(graphTallyCollector)); + emit IGraphTallyCollector.RAVCollected( + signedRAV.rav.collectionId, + signedRAV.rav.payer, + signedRAV.rav.serviceProvider, + signedRAV.rav.dataService, + signedRAV.rav.timestampNs, + signedRAV.rav.valueAggregate, + signedRAV.rav.metadata, + signedRAV.signature + ); + uint256 tokensCollected = _tokensToCollect == 0 + ? graphTallyCollector.collect(_paymentType, _data) + : graphTallyCollector.collect(_paymentType, _data, _tokensToCollect); + + uint256 tokensCollectedAfter = graphTallyCollector.tokensCollected( + signedRAV.rav.dataService, + signedRAV.rav.collectionId, + signedRAV.rav.serviceProvider, + signedRAV.rav.payer + ); + assertEq(tokensCollected, tokensToCollect); + assertEq( + tokensCollectedAfter, + _tokensToCollect == 0 ? signedRAV.rav.valueAggregate : tokensAlreadyCollected + _tokensToCollect + ); + } +} diff --git a/packages/horizon/test/unit/payments/graph-tally-collector/collect/collect.t.sol b/packages/horizon/test/unit/payments/graph-tally-collector/collect/collect.t.sol new file mode 100644 index 000000000..c0c30fb78 --- /dev/null +++ b/packages/horizon/test/unit/payments/graph-tally-collector/collect/collect.t.sol @@ -0,0 +1,486 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { IGraphTallyCollector } from "../../../../../contracts/interfaces/IGraphTallyCollector.sol"; +import { IGraphPayments } from "../../../../../contracts/interfaces/IGraphPayments.sol"; + +import { GraphTallyTest } from "../GraphTallyCollector.t.sol"; + +contract GraphTallyCollectTest is GraphTallyTest { + /* + * HELPERS + */ + + struct CollectTestParams { + uint256 tokens; + address allocationId; + address payer; + address indexer; + address collector; + } + + function _getQueryFeeEncodedData( + uint256 _signerPrivateKey, + CollectTestParams memory params + ) private view returns (bytes memory) { + IGraphTallyCollector.ReceiptAggregateVoucher memory rav = _getRAV( + params.allocationId, + params.payer, + params.indexer, + params.collector, + uint128(params.tokens) + ); + bytes32 messageHash = graphTallyCollector.encodeRAV(rav); + (uint8 v, bytes32 r, bytes32 s) = vm.sign(_signerPrivateKey, messageHash); + bytes memory signature = abi.encodePacked(r, s, v); + IGraphTallyCollector.SignedRAV memory signedRAV = IGraphTallyCollector.SignedRAV(rav, signature); + return abi.encode(signedRAV); + } + + function _getRAV( + address _allocationId, + address _payer, + address _indexer, + address _dataService, + uint128 _tokens + ) private pure returns (IGraphTallyCollector.ReceiptAggregateVoucher memory rav) { + return + IGraphTallyCollector.ReceiptAggregateVoucher({ + collectionId: bytes32(uint256(uint160(_allocationId))), + payer: _payer, + dataService: _dataService, + serviceProvider: _indexer, + timestampNs: 0, + valueAggregate: _tokens, + metadata: abi.encode("") + }); + } + + /* + * TESTS + */ + + function testGraphTally_Collect( + uint256 tokens + ) public useIndexer useProvisionDataService(users.verifier, 100, 0, 0) useGateway useSigner { + tokens = bound(tokens, 1, type(uint128).max); + + _depositTokens(address(graphTallyCollector), users.indexer, tokens); + + CollectTestParams memory params = CollectTestParams({ + tokens: tokens, + allocationId: _allocationId, + payer: users.gateway, + indexer: users.indexer, + collector: users.verifier + }); + + bytes memory data = _getQueryFeeEncodedData(signerPrivateKey, params); + + resetPrank(users.verifier); + _collect(IGraphPayments.PaymentTypes.QueryFee, data); + } + + function testGraphTally_Collect_Multiple( + uint256 tokens, + uint8 steps + ) public useIndexer useProvisionDataService(users.verifier, 100, 0, 0) useGateway useSigner { + steps = uint8(bound(steps, 1, 100)); + tokens = bound(tokens, steps, type(uint128).max); + + _depositTokens(address(graphTallyCollector), users.indexer, tokens); + + resetPrank(users.verifier); + uint256 payed = 0; + uint256 tokensPerStep = tokens / steps; + for (uint256 i = 0; i < steps; i++) { + CollectTestParams memory params = CollectTestParams({ + tokens: payed + tokensPerStep, + allocationId: _allocationId, + payer: users.gateway, + indexer: users.indexer, + collector: users.verifier + }); + bytes memory data = _getQueryFeeEncodedData(signerPrivateKey, params); + _collect(IGraphPayments.PaymentTypes.QueryFee, data); + payed += tokensPerStep; + } + } + + function testGraphTally_Collect_RevertWhen_NoProvision(uint256 tokens) public useGateway useSigner { + tokens = bound(tokens, 1, type(uint128).max); + + _depositTokens(address(graphTallyCollector), users.indexer, tokens); + + CollectTestParams memory params = CollectTestParams({ + tokens: tokens, + allocationId: _allocationId, + payer: users.gateway, + indexer: users.indexer, + collector: users.verifier + }); + bytes memory data = _getQueryFeeEncodedData(signerPrivateKey, params); + + resetPrank(users.verifier); + bytes memory expectedError = abi.encodeWithSelector( + IGraphTallyCollector.GraphTallyCollectorUnauthorizedDataService.selector, + users.verifier + ); + vm.expectRevert(expectedError); + graphTallyCollector.collect(IGraphPayments.PaymentTypes.QueryFee, data); + } + + function testGraphTally_Collect_RevertWhen_ProvisionEmpty( + uint256 tokens + ) public useIndexer useProvisionDataService(users.verifier, 100, 0, 0) useGateway useSigner { + // thaw tokens from the provision + resetPrank(users.indexer); + staking.thaw(users.indexer, users.verifier, 100); + + tokens = bound(tokens, 1, type(uint128).max); + + resetPrank(users.gateway); + _depositTokens(address(graphTallyCollector), users.indexer, tokens); + + CollectTestParams memory params = CollectTestParams({ + tokens: tokens, + allocationId: _allocationId, + payer: users.gateway, + indexer: users.indexer, + collector: users.verifier + }); + bytes memory data = _getQueryFeeEncodedData(signerPrivateKey, params); + + resetPrank(users.verifier); + bytes memory expectedError = abi.encodeWithSelector( + IGraphTallyCollector.GraphTallyCollectorUnauthorizedDataService.selector, + users.verifier + ); + vm.expectRevert(expectedError); + graphTallyCollector.collect(IGraphPayments.PaymentTypes.QueryFee, data); + } + + function testGraphTally_Collect_PreventSignerAttack( + uint256 tokens + ) public useIndexer useProvisionDataService(users.verifier, 100, 0, 0) useGateway useSigner { + tokens = bound(tokens, 1, type(uint128).max); + + resetPrank(users.gateway); + _depositTokens(address(graphTallyCollector), users.indexer, tokens); + + // The sender authorizes another signer + (address anotherSigner, uint256 anotherSignerPrivateKey) = makeAddrAndKey("anotherSigner"); + { + uint256 proofDeadline = block.timestamp + 1; + bytes memory anotherSignerProof = _getSignerProof(proofDeadline, anotherSignerPrivateKey); + _authorizeSigner(anotherSigner, proofDeadline, anotherSignerProof); + } + + // And crafts a RAV using the new signer as the data service + CollectTestParams memory params = CollectTestParams({ + tokens: tokens, + allocationId: _allocationId, + payer: users.gateway, + indexer: users.indexer, + collector: anotherSigner + }); + bytes memory data = _getQueryFeeEncodedData(anotherSignerPrivateKey, params); + + // the call should revert because the service provider has no provision with the "data service" + resetPrank(anotherSigner); + bytes memory expectedError = abi.encodeWithSelector( + IGraphTallyCollector.GraphTallyCollectorUnauthorizedDataService.selector, + anotherSigner + ); + vm.expectRevert(expectedError); + graphTallyCollector.collect(IGraphPayments.PaymentTypes.QueryFee, data); + } + + function testGraphTally_Collect_RevertWhen_CallerNotDataService(uint256 tokens) public useGateway useSigner { + tokens = bound(tokens, 1, type(uint128).max); + + resetPrank(users.gateway); + _depositTokens(address(graphTallyCollector), users.indexer, tokens); + + CollectTestParams memory params = CollectTestParams({ + tokens: tokens, + allocationId: _allocationId, + payer: users.gateway, + indexer: users.indexer, + collector: users.verifier + }); + bytes memory data = _getQueryFeeEncodedData(signerPrivateKey, params); + + resetPrank(users.indexer); + bytes memory expectedError = abi.encodeWithSelector( + IGraphTallyCollector.GraphTallyCollectorCallerNotDataService.selector, + users.indexer, + users.verifier + ); + vm.expectRevert(expectedError); + graphTallyCollector.collect(IGraphPayments.PaymentTypes.QueryFee, data); + } + + function testGraphTally_Collect_RevertWhen_PayerMismatch( + uint256 tokens + ) public useIndexer useProvisionDataService(users.verifier, 100, 0, 0) useGateway useSigner { + tokens = bound(tokens, 1, type(uint128).max); + + resetPrank(users.gateway); + _depositTokens(address(graphTallyCollector), users.indexer, tokens); + + (address anotherPayer, ) = makeAddrAndKey("anotherPayer"); + CollectTestParams memory params = CollectTestParams({ + tokens: tokens, + allocationId: _allocationId, + payer: anotherPayer, + indexer: users.indexer, + collector: users.verifier + }); + bytes memory data = _getQueryFeeEncodedData(signerPrivateKey, params); + + resetPrank(users.verifier); + vm.expectRevert(IGraphTallyCollector.GraphTallyCollectorInvalidRAVSigner.selector); + graphTallyCollector.collect(IGraphPayments.PaymentTypes.QueryFee, data); + } + + function testGraphTally_Collect_RevertWhen_InconsistentRAVTokens( + uint256 tokens + ) public useIndexer useProvisionDataService(users.verifier, 100, 0, 0) useGateway useSigner { + tokens = bound(tokens, 1, type(uint128).max); + + _depositTokens(address(graphTallyCollector), users.indexer, tokens); + CollectTestParams memory params = CollectTestParams({ + tokens: tokens, + allocationId: _allocationId, + payer: users.gateway, + indexer: users.indexer, + collector: users.verifier + }); + bytes memory data = _getQueryFeeEncodedData(signerPrivateKey, params); + + resetPrank(users.verifier); + _collect(IGraphPayments.PaymentTypes.QueryFee, data); + + // Attempt to collect again + vm.expectRevert( + abi.encodeWithSelector( + IGraphTallyCollector.GraphTallyCollectorInconsistentRAVTokens.selector, + tokens, + tokens + ) + ); + graphTallyCollector.collect(IGraphPayments.PaymentTypes.QueryFee, data); + } + + function testGraphTally_Collect_RevertWhen_SignerNotAuthorized(uint256 tokens) public useGateway { + tokens = bound(tokens, 1, type(uint128).max); + + _depositTokens(address(graphTallyCollector), users.indexer, tokens); + + CollectTestParams memory params = CollectTestParams({ + tokens: tokens, + allocationId: _allocationId, + payer: users.gateway, + indexer: users.indexer, + collector: users.verifier + }); + bytes memory data = _getQueryFeeEncodedData(signerPrivateKey, params); + + resetPrank(users.verifier); + vm.expectRevert(abi.encodeWithSelector(IGraphTallyCollector.GraphTallyCollectorInvalidRAVSigner.selector)); + graphTallyCollector.collect(IGraphPayments.PaymentTypes.QueryFee, data); + } + + function testGraphTally_Collect_ThawingSigner( + uint256 tokens + ) public useIndexer useProvisionDataService(users.verifier, 100, 0, 0) useGateway useSigner { + tokens = bound(tokens, 1, type(uint128).max); + + _depositTokens(address(graphTallyCollector), users.indexer, tokens); + + // Start thawing signer + _thawSigner(signer); + skip(revokeSignerThawingPeriod + 1); + + CollectTestParams memory params = CollectTestParams({ + tokens: tokens, + allocationId: _allocationId, + payer: users.gateway, + indexer: users.indexer, + collector: users.verifier + }); + bytes memory data = _getQueryFeeEncodedData(signerPrivateKey, params); + + resetPrank(users.verifier); + _collect(IGraphPayments.PaymentTypes.QueryFee, data); + } + + function testGraphTally_Collect_RevertIf_SignerWasRevoked(uint256 tokens) public useGateway useSigner { + tokens = bound(tokens, 1, type(uint128).max); + + _depositTokens(address(graphTallyCollector), users.indexer, tokens); + + // Start thawing signer + _thawSigner(signer); + skip(revokeSignerThawingPeriod + 1); + _revokeAuthorizedSigner(signer); + + CollectTestParams memory params = CollectTestParams({ + tokens: tokens, + allocationId: _allocationId, + payer: users.gateway, + indexer: users.indexer, + collector: users.verifier + }); + bytes memory data = _getQueryFeeEncodedData(signerPrivateKey, params); + + resetPrank(users.verifier); + vm.expectRevert(abi.encodeWithSelector(IGraphTallyCollector.GraphTallyCollectorInvalidRAVSigner.selector)); + graphTallyCollector.collect(IGraphPayments.PaymentTypes.QueryFee, data); + } + + function testGraphTally_Collect_ThawingSignerCanceled( + uint256 tokens + ) public useIndexer useProvisionDataService(users.verifier, 100, 0, 0) useGateway useSigner { + tokens = bound(tokens, 1, type(uint128).max); + + _depositTokens(address(graphTallyCollector), users.indexer, tokens); + + // Start thawing signer + _thawSigner(signer); + skip(revokeSignerThawingPeriod + 1); + _cancelThawSigner(signer); + + CollectTestParams memory params = CollectTestParams({ + tokens: tokens, + allocationId: _allocationId, + payer: users.gateway, + indexer: users.indexer, + collector: users.verifier + }); + bytes memory data = _getQueryFeeEncodedData(signerPrivateKey, params); + + resetPrank(users.verifier); + _collect(IGraphPayments.PaymentTypes.QueryFee, data); + } + + function testGraphTally_CollectPartial( + uint256 tokens, + uint256 tokensToCollect + ) public useIndexer useProvisionDataService(users.verifier, 100, 0, 0) useGateway useSigner { + tokens = bound(tokens, 1, type(uint128).max); + tokensToCollect = bound(tokensToCollect, 1, tokens); + + _depositTokens(address(graphTallyCollector), users.indexer, tokens); + + CollectTestParams memory params = CollectTestParams({ + tokens: tokens, + allocationId: _allocationId, + payer: users.gateway, + indexer: users.indexer, + collector: users.verifier + }); + bytes memory data = _getQueryFeeEncodedData(signerPrivateKey, params); + + resetPrank(users.verifier); + _collect(IGraphPayments.PaymentTypes.QueryFee, data, tokensToCollect); + } + + function testGraphTally_CollectPartial_RevertWhen_AmountTooHigh( + uint256 tokens, + uint256 tokensToCollect + ) public useIndexer useProvisionDataService(users.verifier, 100, 0, 0) useGateway useSigner { + tokens = bound(tokens, 1, type(uint128).max - 1); + + _depositTokens(address(graphTallyCollector), users.indexer, tokens); + + CollectTestParams memory params = CollectTestParams({ + tokens: tokens, + allocationId: _allocationId, + payer: users.gateway, + indexer: users.indexer, + collector: users.verifier + }); + bytes memory data = _getQueryFeeEncodedData(signerPrivateKey, params); + + resetPrank(users.verifier); + uint256 tokensAlreadyCollected = graphTallyCollector.tokensCollected( + users.verifier, + bytes32(uint256(uint160(_allocationId))), + users.indexer, + users.gateway + ); + tokensToCollect = bound(tokensToCollect, tokens - tokensAlreadyCollected + 1, type(uint128).max); + + vm.expectRevert( + abi.encodeWithSelector( + IGraphTallyCollector.GraphTallyCollectorInvalidTokensToCollectAmount.selector, + tokensToCollect, + tokens - tokensAlreadyCollected + ) + ); + graphTallyCollector.collect(IGraphPayments.PaymentTypes.QueryFee, data, tokensToCollect); + } + + function testGraphTally_Collect_SeparateAllocationTracking( + uint256 tokens + ) public useIndexer useProvisionDataService(users.verifier, 100, 0, 0) useGateway useSigner { + tokens = bound(tokens, 1, type(uint64).max); + uint8 numAllocations = 10; + + _depositTokens(address(graphTallyCollector), users.indexer, tokens * numAllocations); + // Array with collectTestParams for each allocation + CollectTestParams[] memory collectTestParams = new CollectTestParams[](numAllocations); + + // Collect tokens for each allocation + resetPrank(users.verifier); + for (uint256 i = 0; i < numAllocations; i++) { + address allocationId = makeAddr(string.concat("allocation", vm.toString(i))); + collectTestParams[i] = CollectTestParams({ + tokens: tokens, + allocationId: allocationId, + payer: users.gateway, + indexer: users.indexer, + collector: users.verifier + }); + bytes memory data = _getQueryFeeEncodedData(signerPrivateKey, collectTestParams[i]); + _collect(IGraphPayments.PaymentTypes.QueryFee, data); + } + + for (uint256 i = 0; i < numAllocations; i++) { + assertEq( + graphTallyCollector.tokensCollected( + collectTestParams[i].collector, + bytes32(uint256(uint160(collectTestParams[i].allocationId))), + collectTestParams[i].indexer, + collectTestParams[i].payer + ), + collectTestParams[i].tokens, + "Incorrect tokens collected for allocation" + ); + + // Try to collect again with the same allocation - should revert + bytes memory data = _getQueryFeeEncodedData(signerPrivateKey, collectTestParams[i]); + vm.expectRevert( + abi.encodeWithSelector( + IGraphTallyCollector.GraphTallyCollectorInconsistentRAVTokens.selector, + tokens, + tokens + ) + ); + graphTallyCollector.collect(IGraphPayments.PaymentTypes.QueryFee, data); + } + + // Increase tokens for allocation 0 by 1000 ether and collect again + resetPrank(users.gateway); + _depositTokens(address(graphTallyCollector), users.indexer, 1000 ether); + + resetPrank(users.verifier); + collectTestParams[0].tokens = tokens + 1000 ether; + bytes memory allocation0Data = _getQueryFeeEncodedData(signerPrivateKey, collectTestParams[0]); + _collect(IGraphPayments.PaymentTypes.QueryFee, allocation0Data); + } +} diff --git a/packages/horizon/test/unit/payments/graph-tally-collector/signer/authorizeSigner.t.sol b/packages/horizon/test/unit/payments/graph-tally-collector/signer/authorizeSigner.t.sol new file mode 100644 index 000000000..3eb65e094 --- /dev/null +++ b/packages/horizon/test/unit/payments/graph-tally-collector/signer/authorizeSigner.t.sol @@ -0,0 +1,86 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { IAuthorizable } from "../../../../../contracts/interfaces/IAuthorizable.sol"; + +import { GraphTallyTest } from "../GraphTallyCollector.t.sol"; + +contract GraphTallyAuthorizeSignerTest is GraphTallyTest { + uint256 constant SECP256K1_CURVE_ORDER = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141; + + /* + * TESTS + */ + + function testGraphTally_AuthorizeSigner(uint256 signerKey) public useGateway { + signerKey = bound(signerKey, 1, SECP256K1_CURVE_ORDER - 1); + uint256 proofDeadline = block.timestamp + 1; + bytes memory signerProof = _getSignerProof(proofDeadline, signerKey); + _authorizeSigner(vm.addr(signerKey), proofDeadline, signerProof); + } + + function testGraphTally_AuthorizeSigner_RevertWhen_Invalid() public useGateway { + // Sign proof with payer + uint256 proofDeadline = block.timestamp + 1; + bytes memory signerProof = _getSignerProof(proofDeadline, signerPrivateKey); + + // Attempt to authorize delegator with payer's proof + vm.expectRevert(IAuthorizable.AuthorizableInvalidSignerProof.selector); + graphTallyCollector.authorizeSigner(users.delegator, proofDeadline, signerProof); + } + + function testGraphTally_AuthorizeSigner_RevertWhen_AlreadyAuthroized() public useGateway { + // Authorize signer + uint256 proofDeadline = block.timestamp + 1; + bytes memory signerProof = _getSignerProof(proofDeadline, signerPrivateKey); + _authorizeSigner(signer, proofDeadline, signerProof); + + // Attempt to authorize signer again + bytes memory expectedError = abi.encodeWithSelector( + IAuthorizable.AuthorizableSignerAlreadyAuthorized.selector, + users.gateway, + signer, + false + ); + vm.expectRevert(expectedError); + graphTallyCollector.authorizeSigner(signer, proofDeadline, signerProof); + } + + function testGraphTally_AuthorizeSigner_RevertWhen_AlreadyAuthroizedAfterRevoking() public useGateway { + // Authorize signer + uint256 proofDeadline = block.timestamp + 1; + bytes memory signerProof = _getSignerProof(proofDeadline, signerPrivateKey); + _authorizeSigner(signer, proofDeadline, signerProof); + // Revoke signer + _thawSigner(signer); + skip(revokeSignerThawingPeriod + 1); + _revokeAuthorizedSigner(signer); + + // Attempt to authorize signer again + bytes memory expectedError = abi.encodeWithSelector( + IAuthorizable.AuthorizableSignerAlreadyAuthorized.selector, + users.gateway, + signer, + true + ); + vm.expectRevert(expectedError); + graphTallyCollector.authorizeSigner(signer, proofDeadline, signerProof); + } + + function testGraphTally_AuthorizeSigner_RevertWhen_ProofExpired() public useGateway { + // Sign proof with payer + uint256 proofDeadline = block.timestamp - 1; + bytes memory signerProof = _getSignerProof(proofDeadline, signerPrivateKey); + + // Attempt to authorize delegator with expired proof + bytes memory expectedError = abi.encodeWithSelector( + IAuthorizable.AuthorizableInvalidSignerProofDeadline.selector, + proofDeadline, + block.timestamp + ); + vm.expectRevert(expectedError); + graphTallyCollector.authorizeSigner(users.delegator, proofDeadline, signerProof); + } +} diff --git a/packages/horizon/test/unit/payments/graph-tally-collector/signer/cancelThawSigner.t.sol b/packages/horizon/test/unit/payments/graph-tally-collector/signer/cancelThawSigner.t.sol new file mode 100644 index 000000000..c70379e94 --- /dev/null +++ b/packages/horizon/test/unit/payments/graph-tally-collector/signer/cancelThawSigner.t.sol @@ -0,0 +1,38 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { IAuthorizable } from "../../../../../contracts/interfaces/IAuthorizable.sol"; + +import { GraphTallyTest } from "../GraphTallyCollector.t.sol"; + +contract GraphTallyCancelThawSignerTest is GraphTallyTest { + /* + * TESTS + */ + + function testGraphTally_CancelThawSigner() public useGateway useSigner { + _thawSigner(signer); + _cancelThawSigner(signer); + } + + function testGraphTally_CancelThawSigner_RevertWhen_NotAuthorized() public useGateway { + bytes memory expectedError = abi.encodeWithSelector( + IAuthorizable.AuthorizableSignerNotAuthorized.selector, + users.gateway, + signer + ); + vm.expectRevert(expectedError); + graphTallyCollector.thawSigner(signer); + } + + function testGraphTally_CancelThawSigner_RevertWhen_NotThawing() public useGateway useSigner { + bytes memory expectedError = abi.encodeWithSelector( + IAuthorizable.AuthorizableSignerNotThawing.selector, + signer + ); + vm.expectRevert(expectedError); + graphTallyCollector.cancelThawSigner(signer); + } +} diff --git a/packages/horizon/test/unit/payments/graph-tally-collector/signer/revokeSigner.t.sol b/packages/horizon/test/unit/payments/graph-tally-collector/signer/revokeSigner.t.sol new file mode 100644 index 000000000..cdc4f5d36 --- /dev/null +++ b/packages/horizon/test/unit/payments/graph-tally-collector/signer/revokeSigner.t.sol @@ -0,0 +1,53 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { IAuthorizable } from "../../../../../contracts/interfaces/IAuthorizable.sol"; + +import { GraphTallyTest } from "../GraphTallyCollector.t.sol"; + +contract GraphTallyRevokeAuthorizedSignerTest is GraphTallyTest { + /* + * TESTS + */ + + function testGraphTally_RevokeAuthorizedSigner() public useGateway useSigner { + _thawSigner(signer); + + // Advance time to thaw signer + skip(revokeSignerThawingPeriod + 1); + + _revokeAuthorizedSigner(signer); + } + + function testGraphTally_RevokeAuthorizedSigner_RevertWhen_NotAuthorized() public useGateway { + bytes memory expectedError = abi.encodeWithSelector( + IAuthorizable.AuthorizableSignerNotAuthorized.selector, + users.gateway, + signer + ); + vm.expectRevert(expectedError); + graphTallyCollector.revokeAuthorizedSigner(signer); + } + + function testGraphTally_RevokeAuthorizedSigner_RevertWhen_NotThawing() public useGateway useSigner { + bytes memory expectedError = abi.encodeWithSelector( + IAuthorizable.AuthorizableSignerNotThawing.selector, + signer + ); + vm.expectRevert(expectedError); + graphTallyCollector.revokeAuthorizedSigner(signer); + } + + function testGraphTally_RevokeAuthorizedSigner_RevertWhen_StillThawing() public useGateway useSigner { + _thawSigner(signer); + bytes memory expectedError = abi.encodeWithSelector( + IAuthorizable.AuthorizableSignerStillThawing.selector, + block.timestamp, + block.timestamp + revokeSignerThawingPeriod + ); + vm.expectRevert(expectedError); + graphTallyCollector.revokeAuthorizedSigner(signer); + } +} diff --git a/packages/horizon/test/unit/payments/graph-tally-collector/signer/thawSigner.t.sol b/packages/horizon/test/unit/payments/graph-tally-collector/signer/thawSigner.t.sol new file mode 100644 index 000000000..3e62dd6ff --- /dev/null +++ b/packages/horizon/test/unit/payments/graph-tally-collector/signer/thawSigner.t.sol @@ -0,0 +1,53 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { IAuthorizable } from "../../../../../contracts/interfaces/IAuthorizable.sol"; + +import { GraphTallyTest } from "../GraphTallyCollector.t.sol"; + +contract GraphTallyThawSignerTest is GraphTallyTest { + /* + * TESTS + */ + + function testGraphTally_ThawSigner() public useGateway useSigner { + _thawSigner(signer); + } + + function testGraphTally_ThawSigner_RevertWhen_NotAuthorized() public useGateway { + bytes memory expectedError = abi.encodeWithSelector( + IAuthorizable.AuthorizableSignerNotAuthorized.selector, + users.gateway, + signer + ); + vm.expectRevert(expectedError); + graphTallyCollector.thawSigner(signer); + } + + function testGraphTally_ThawSigner_RevertWhen_AlreadyRevoked() public useGateway useSigner { + _thawSigner(signer); + skip(revokeSignerThawingPeriod + 1); + _revokeAuthorizedSigner(signer); + + bytes memory expectedError = abi.encodeWithSelector( + IAuthorizable.AuthorizableSignerNotAuthorized.selector, + users.gateway, + signer + ); + vm.expectRevert(expectedError); + graphTallyCollector.thawSigner(signer); + } + + function testGraphTally_ThawSigner_AlreadyThawing() public useGateway useSigner { + _thawSigner(signer); + uint256 originalThawEnd = graphTallyCollector.getThawEnd(signer); + skip(1); + + graphTallyCollector.thawSigner(signer); + uint256 currentThawEnd = graphTallyCollector.getThawEnd(signer); + vm.assertEq(originalThawEnd, block.timestamp + revokeSignerThawingPeriod - 1); + vm.assertEq(currentThawEnd, block.timestamp + revokeSignerThawingPeriod); + } +} diff --git a/packages/horizon/test/unit/shared/horizon-staking/HorizonStakingShared.t.sol b/packages/horizon/test/unit/shared/horizon-staking/HorizonStakingShared.t.sol new file mode 100644 index 000000000..62b531ffb --- /dev/null +++ b/packages/horizon/test/unit/shared/horizon-staking/HorizonStakingShared.t.sol @@ -0,0 +1,2497 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { GraphBaseTest } from "../../GraphBase.t.sol"; +import { IGraphPayments } from "../../../../contracts/interfaces/IGraphPayments.sol"; +import { IHorizonStakingBase } from "../../../../contracts/interfaces/internal/IHorizonStakingBase.sol"; +import { IHorizonStakingMain } from "../../../../contracts/interfaces/internal/IHorizonStakingMain.sol"; +import { IHorizonStakingExtension } from "../../../../contracts/interfaces/internal/IHorizonStakingExtension.sol"; +import { IHorizonStakingTypes } from "../../../../contracts/interfaces/internal/IHorizonStakingTypes.sol"; + +import { LinkedList } from "../../../../contracts/libraries/LinkedList.sol"; +import { MathUtils } from "../../../../contracts/libraries/MathUtils.sol"; +import { PPMMath } from "../../../../contracts/libraries/PPMMath.sol"; +import { ExponentialRebates } from "../../../../contracts/staking/libraries/ExponentialRebates.sol"; + +abstract contract HorizonStakingSharedTest is GraphBaseTest { + using LinkedList for LinkedList.List; + using PPMMath for uint256; + + event Transfer(address indexed from, address indexed to, uint tokens); + + address internal _allocationId = makeAddr("allocationId"); + bytes32 internal constant _subgraphDeploymentID = keccak256("subgraphDeploymentID"); + uint256 internal constant MAX_ALLOCATION_EPOCHS = 28; + + uint32 internal alphaNumerator = 100; + uint32 internal alphaDenominator = 100; + uint32 internal lambdaNumerator = 60; + uint32 internal lambdaDenominator = 100; + + /* + * MODIFIERS + */ + + modifier useIndexer() { + vm.startPrank(users.indexer); + _; + vm.stopPrank(); + } + + modifier useOperator() { + vm.startPrank(users.indexer); + _setOperator(subgraphDataServiceAddress, users.operator, true); + vm.startPrank(users.operator); + _; + vm.stopPrank(); + } + + modifier useStake(uint256 amount) { + vm.assume(amount > 0); + _stake(amount); + _; + } + + modifier useProvision( + uint256 tokens, + uint32 maxVerifierCut, + uint64 thawingPeriod + ) virtual { + _useProvision(subgraphDataServiceAddress, tokens, maxVerifierCut, thawingPeriod); + _; + } + + modifier useProvisionDataService( + address dataService, + uint256 tokens, + uint32 maxVerifierCut, + uint64 thawingPeriod + ) { + _useProvision(dataService, tokens, maxVerifierCut, thawingPeriod); + _; + } + + modifier useDelegationFeeCut(IGraphPayments.PaymentTypes paymentType, uint256 cut) { + _setDelegationFeeCut(users.indexer, subgraphDataServiceAddress, paymentType, cut); + _; + } + + function _useProvision(address dataService, uint256 tokens, uint32 maxVerifierCut, uint64 thawingPeriod) internal { + // use assume instead of bound to avoid the bounding falling out of scope + vm.assume(tokens > 0); + vm.assume(tokens <= MAX_STAKING_TOKENS); + vm.assume(maxVerifierCut <= MAX_PPM); + vm.assume(thawingPeriod <= MAX_THAWING_PERIOD); + + _createProvision(users.indexer, dataService, tokens, maxVerifierCut, thawingPeriod); + } + + modifier useAllocation(uint256 tokens) { + vm.assume(tokens <= MAX_STAKING_TOKENS); + _createAllocation(users.indexer, _allocationId, _subgraphDeploymentID, tokens); + _; + } + + modifier useRebateParameters() { + _setStorage_RebateParameters(alphaNumerator, alphaDenominator, lambdaNumerator, lambdaDenominator); + _; + } + + /* + * HELPERS: these are shortcuts to perform common actions that often involve multiple contract calls + */ + function _createProvision( + address serviceProvider, + address verifier, + uint256 tokens, + uint32 maxVerifierCut, + uint64 thawingPeriod + ) internal { + _stakeTo(serviceProvider, tokens); + _provision(serviceProvider, verifier, tokens, maxVerifierCut, thawingPeriod); + } + + // This allows setting up contract state with legacy allocations + function _createAllocation( + address serviceProvider, + address allocationId, + bytes32 subgraphDeploymentID, + uint256 tokens + ) internal { + _setStorage_MaxAllocationEpochs(MAX_ALLOCATION_EPOCHS); + + IHorizonStakingExtension.Allocation memory _allocation = IHorizonStakingExtension.Allocation({ + indexer: serviceProvider, + subgraphDeploymentID: subgraphDeploymentID, + tokens: tokens, + createdAtEpoch: block.timestamp, + closedAtEpoch: 0, + collectedFees: 0, + __DEPRECATED_effectiveAllocation: 0, + accRewardsPerAllocatedToken: 0, + distributedRebates: 0 + }); + _setStorage_allocation(_allocation, allocationId, tokens); + + // delegation pool initialized + _setStorage_DelegationPool(serviceProvider, 0, uint32(PPMMath.MAX_PPM), uint32(PPMMath.MAX_PPM)); + + token.transfer(address(staking), tokens); + } + + /* + * ACTIONS: these are individual contract calls wrapped in assertion blocks to ensure they work as expected + */ + function _stake(uint256 tokens) internal { + (, address msgSender, ) = vm.readCallers(); + _stakeTo(msgSender, tokens); + } + + function _stakeTo(address serviceProvider, uint256 tokens) internal { + (, address msgSender, ) = vm.readCallers(); + + // before + uint256 beforeStakingBalance = token.balanceOf(address(staking)); + uint256 beforeSenderBalance = token.balanceOf(msgSender); + ServiceProviderInternal memory beforeServiceProvider = _getStorage_ServiceProviderInternal(serviceProvider); + + // stakeTo + token.approve(address(staking), tokens); + vm.expectEmit(); + emit IHorizonStakingBase.HorizonStakeDeposited(serviceProvider, tokens); + staking.stakeTo(serviceProvider, tokens); + + // after + uint256 afterStakingBalance = token.balanceOf(address(staking)); + uint256 afterSenderBalance = token.balanceOf(msgSender); + ServiceProviderInternal memory afterServiceProvider = _getStorage_ServiceProviderInternal(serviceProvider); + + // assert + assertEq(afterStakingBalance, beforeStakingBalance + tokens); + assertEq(afterSenderBalance, beforeSenderBalance - tokens); + assertEq(afterServiceProvider.tokensStaked, beforeServiceProvider.tokensStaked + tokens); + assertEq(afterServiceProvider.tokensProvisioned, beforeServiceProvider.tokensProvisioned); + assertEq(afterServiceProvider.__DEPRECATED_tokensAllocated, beforeServiceProvider.__DEPRECATED_tokensAllocated); + assertEq(afterServiceProvider.__DEPRECATED_tokensLocked, beforeServiceProvider.__DEPRECATED_tokensLocked); + assertEq( + afterServiceProvider.__DEPRECATED_tokensLockedUntil, + beforeServiceProvider.__DEPRECATED_tokensLockedUntil + ); + } + + function _stakeToProvision(address serviceProvider, address verifier, uint256 tokens) internal { + (, address msgSender, ) = vm.readCallers(); + + // before + uint256 beforeStakingBalance = token.balanceOf(address(staking)); + uint256 beforeSenderBalance = token.balanceOf(msgSender); + ServiceProviderInternal memory beforeServiceProvider = _getStorage_ServiceProviderInternal(serviceProvider); + Provision memory beforeProvision = staking.getProvision(serviceProvider, verifier); + + // stakeTo + token.approve(address(staking), tokens); + vm.expectEmit(); + emit IHorizonStakingBase.HorizonStakeDeposited(serviceProvider, tokens); + vm.expectEmit(); + emit IHorizonStakingMain.ProvisionIncreased(serviceProvider, verifier, tokens); + staking.stakeToProvision(serviceProvider, verifier, tokens); + + // after + uint256 afterStakingBalance = token.balanceOf(address(staking)); + uint256 afterSenderBalance = token.balanceOf(msgSender); + ServiceProviderInternal memory afterServiceProvider = _getStorage_ServiceProviderInternal(serviceProvider); + Provision memory afterProvision = staking.getProvision(serviceProvider, verifier); + + // assert - stakeTo + assertEq(afterStakingBalance, beforeStakingBalance + tokens); + assertEq(afterSenderBalance, beforeSenderBalance - tokens); + assertEq(afterServiceProvider.tokensStaked, beforeServiceProvider.tokensStaked + tokens); + assertEq(afterServiceProvider.tokensProvisioned, beforeServiceProvider.tokensProvisioned + tokens); + assertEq(afterServiceProvider.__DEPRECATED_tokensAllocated, beforeServiceProvider.__DEPRECATED_tokensAllocated); + assertEq(afterServiceProvider.__DEPRECATED_tokensLocked, beforeServiceProvider.__DEPRECATED_tokensLocked); + assertEq( + afterServiceProvider.__DEPRECATED_tokensLockedUntil, + beforeServiceProvider.__DEPRECATED_tokensLockedUntil + ); + + // assert - addToProvision + assertEq(afterProvision.tokens, beforeProvision.tokens + tokens); + assertEq(afterProvision.tokensThawing, beforeProvision.tokensThawing); + assertEq(afterProvision.sharesThawing, beforeProvision.sharesThawing); + assertEq(afterProvision.maxVerifierCut, beforeProvision.maxVerifierCut); + assertEq(afterProvision.thawingPeriod, beforeProvision.thawingPeriod); + assertEq(afterProvision.createdAt, beforeProvision.createdAt); + assertEq(afterProvision.lastParametersStagedAt, beforeProvision.lastParametersStagedAt); + assertEq(afterProvision.maxVerifierCutPending, beforeProvision.maxVerifierCutPending); + assertEq(afterProvision.thawingPeriodPending, beforeProvision.thawingPeriodPending); + assertEq(afterProvision.thawingNonce, beforeProvision.thawingNonce); + assertEq(afterServiceProvider.tokensStaked, beforeServiceProvider.tokensStaked + tokens); + assertEq(afterServiceProvider.tokensProvisioned, beforeServiceProvider.tokensProvisioned + tokens); + assertEq(afterServiceProvider.__DEPRECATED_tokensAllocated, beforeServiceProvider.__DEPRECATED_tokensAllocated); + assertEq(afterServiceProvider.__DEPRECATED_tokensLocked, beforeServiceProvider.__DEPRECATED_tokensLocked); + assertEq( + afterServiceProvider.__DEPRECATED_tokensLockedUntil, + beforeServiceProvider.__DEPRECATED_tokensLockedUntil + ); + } + + function _unstake(uint256 _tokens) internal { + (, address msgSender, ) = vm.readCallers(); + + uint256 deprecatedThawingPeriod = staking.__DEPRECATED_getThawingPeriod(); + + // before + uint256 beforeSenderBalance = token.balanceOf(msgSender); + uint256 beforeStakingBalance = token.balanceOf(address(staking)); + ServiceProviderInternal memory beforeServiceProvider = _getStorage_ServiceProviderInternal(msgSender); + + bool withdrawCalled = beforeServiceProvider.__DEPRECATED_tokensLocked != 0 && + block.number >= beforeServiceProvider.__DEPRECATED_tokensLockedUntil; + + if (deprecatedThawingPeriod != 0 && beforeServiceProvider.__DEPRECATED_tokensLocked > 0) { + deprecatedThawingPeriod = MathUtils.weightedAverageRoundingUp( + MathUtils.diffOrZero( + withdrawCalled ? 0 : beforeServiceProvider.__DEPRECATED_tokensLockedUntil, + block.number + ), + withdrawCalled ? 0 : beforeServiceProvider.__DEPRECATED_tokensLocked, + deprecatedThawingPeriod, + _tokens + ); + } + + // unstake + if (deprecatedThawingPeriod == 0) { + vm.expectEmit(address(staking)); + emit IHorizonStakingMain.HorizonStakeWithdrawn(msgSender, _tokens); + } else { + if (withdrawCalled) { + vm.expectEmit(address(staking)); + emit IHorizonStakingMain.HorizonStakeWithdrawn( + msgSender, + beforeServiceProvider.__DEPRECATED_tokensLocked + ); + } + + vm.expectEmit(address(staking)); + emit IHorizonStakingMain.HorizonStakeLocked( + msgSender, + withdrawCalled ? _tokens : beforeServiceProvider.__DEPRECATED_tokensLocked + _tokens, + block.number + deprecatedThawingPeriod + ); + } + staking.unstake(_tokens); + + // after + uint256 afterSenderBalance = token.balanceOf(msgSender); + uint256 afterStakingBalance = token.balanceOf(address(staking)); + ServiceProviderInternal memory afterServiceProvider = _getStorage_ServiceProviderInternal(msgSender); + + // assert + if (deprecatedThawingPeriod == 0) { + assertEq(afterSenderBalance, _tokens + beforeSenderBalance); + assertEq(afterStakingBalance, beforeStakingBalance - _tokens); + assertEq(afterServiceProvider.tokensStaked, beforeServiceProvider.tokensStaked - _tokens); + assertEq(afterServiceProvider.tokensProvisioned, beforeServiceProvider.tokensProvisioned); + assertEq( + afterServiceProvider.__DEPRECATED_tokensAllocated, + beforeServiceProvider.__DEPRECATED_tokensAllocated + ); + assertEq(afterServiceProvider.__DEPRECATED_tokensLocked, beforeServiceProvider.__DEPRECATED_tokensLocked); + assertEq( + afterServiceProvider.__DEPRECATED_tokensLockedUntil, + beforeServiceProvider.__DEPRECATED_tokensLockedUntil + ); + } else { + assertEq( + afterServiceProvider.tokensStaked, + withdrawCalled + ? beforeServiceProvider.tokensStaked - beforeServiceProvider.__DEPRECATED_tokensLocked + : beforeServiceProvider.tokensStaked + ); + assertEq( + afterServiceProvider.__DEPRECATED_tokensLocked, + _tokens + (withdrawCalled ? 0 : beforeServiceProvider.__DEPRECATED_tokensLocked) + ); + assertEq(afterServiceProvider.__DEPRECATED_tokensLockedUntil, block.number + deprecatedThawingPeriod); + assertEq(afterServiceProvider.tokensProvisioned, beforeServiceProvider.tokensProvisioned); + assertEq( + afterServiceProvider.__DEPRECATED_tokensAllocated, + beforeServiceProvider.__DEPRECATED_tokensAllocated + ); + uint256 tokensTransferred = (withdrawCalled ? beforeServiceProvider.__DEPRECATED_tokensLocked : 0); + assertEq(afterSenderBalance, beforeSenderBalance + tokensTransferred); + assertEq(afterStakingBalance, beforeStakingBalance - tokensTransferred); + } + } + + function _withdraw() internal { + (, address msgSender, ) = vm.readCallers(); + + // before + ServiceProviderInternal memory beforeServiceProvider = _getStorage_ServiceProviderInternal(msgSender); + uint256 beforeSenderBalance = token.balanceOf(msgSender); + uint256 beforeStakingBalance = token.balanceOf(address(staking)); + + // withdraw + vm.expectEmit(address(staking)); + emit IHorizonStakingMain.HorizonStakeWithdrawn(msgSender, beforeServiceProvider.__DEPRECATED_tokensLocked); + staking.withdraw(); + + // after + ServiceProviderInternal memory afterServiceProvider = _getStorage_ServiceProviderInternal(msgSender); + uint256 afterSenderBalance = token.balanceOf(msgSender); + uint256 afterStakingBalance = token.balanceOf(address(staking)); + + // assert + assertEq(afterSenderBalance - beforeSenderBalance, beforeServiceProvider.__DEPRECATED_tokensLocked); + assertEq(beforeStakingBalance - afterStakingBalance, beforeServiceProvider.__DEPRECATED_tokensLocked); + assertEq( + afterServiceProvider.tokensStaked, + beforeServiceProvider.tokensStaked - beforeServiceProvider.__DEPRECATED_tokensLocked + ); + assertEq(afterServiceProvider.tokensProvisioned, beforeServiceProvider.tokensProvisioned); + assertEq(afterServiceProvider.__DEPRECATED_tokensAllocated, beforeServiceProvider.__DEPRECATED_tokensAllocated); + assertEq(afterServiceProvider.__DEPRECATED_tokensLocked, 0); + assertEq(afterServiceProvider.__DEPRECATED_tokensLockedUntil, 0); + } + + function _provision( + address serviceProvider, + address verifier, + uint256 tokens, + uint32 maxVerifierCut, + uint64 thawingPeriod + ) internal { + __provision(serviceProvider, verifier, tokens, maxVerifierCut, thawingPeriod, false); + } + + function _provisionLocked( + address serviceProvider, + address verifier, + uint256 tokens, + uint32 maxVerifierCut, + uint64 thawingPeriod + ) internal { + __provision(serviceProvider, verifier, tokens, maxVerifierCut, thawingPeriod, true); + } + + function __provision( + address serviceProvider, + address verifier, + uint256 tokens, + uint32 maxVerifierCut, + uint64 thawingPeriod, + bool locked + ) private { + // before + ServiceProviderInternal memory beforeServiceProvider = _getStorage_ServiceProviderInternal(serviceProvider); + + // provision + vm.expectEmit(); + emit IHorizonStakingMain.ProvisionCreated(serviceProvider, verifier, tokens, maxVerifierCut, thawingPeriod); + if (locked) { + staking.provisionLocked(serviceProvider, verifier, tokens, maxVerifierCut, thawingPeriod); + } else { + staking.provision(serviceProvider, verifier, tokens, maxVerifierCut, thawingPeriod); + } + + // after + Provision memory afterProvision = staking.getProvision(serviceProvider, verifier); + ServiceProviderInternal memory afterServiceProvider = _getStorage_ServiceProviderInternal(serviceProvider); + + // assert + assertEq(afterProvision.tokens, tokens); + assertEq(afterProvision.tokensThawing, 0); + assertEq(afterProvision.sharesThawing, 0); + assertEq(afterProvision.maxVerifierCut, maxVerifierCut); + assertEq(afterProvision.thawingPeriod, thawingPeriod); + assertEq(afterProvision.createdAt, uint64(block.timestamp)); + assertEq(afterProvision.maxVerifierCutPending, maxVerifierCut); + assertEq(afterProvision.thawingPeriodPending, thawingPeriod); + assertEq(afterProvision.lastParametersStagedAt, 0); + assertEq(afterProvision.thawingNonce, 0); + assertEq(afterServiceProvider.tokensStaked, beforeServiceProvider.tokensStaked); + assertEq(afterServiceProvider.tokensProvisioned, tokens + beforeServiceProvider.tokensProvisioned); + assertEq(afterServiceProvider.__DEPRECATED_tokensAllocated, beforeServiceProvider.__DEPRECATED_tokensAllocated); + assertEq(afterServiceProvider.__DEPRECATED_tokensLocked, beforeServiceProvider.__DEPRECATED_tokensLocked); + assertEq( + afterServiceProvider.__DEPRECATED_tokensLockedUntil, + beforeServiceProvider.__DEPRECATED_tokensLockedUntil + ); + } + + function _addToProvision(address serviceProvider, address verifier, uint256 tokens) internal { + // before + Provision memory beforeProvision = staking.getProvision(serviceProvider, verifier); + ServiceProviderInternal memory beforeServiceProvider = _getStorage_ServiceProviderInternal(serviceProvider); + + // addToProvision + vm.expectEmit(); + emit IHorizonStakingMain.ProvisionIncreased(serviceProvider, verifier, tokens); + staking.addToProvision(serviceProvider, verifier, tokens); + + // after + Provision memory afterProvision = staking.getProvision(serviceProvider, verifier); + ServiceProviderInternal memory afterServiceProvider = _getStorage_ServiceProviderInternal(serviceProvider); + + // assert + assertEq(afterProvision.tokens, beforeProvision.tokens + tokens); + assertEq(afterProvision.tokensThawing, beforeProvision.tokensThawing); + assertEq(afterProvision.sharesThawing, beforeProvision.sharesThawing); + assertEq(afterProvision.maxVerifierCut, beforeProvision.maxVerifierCut); + assertEq(afterProvision.thawingPeriod, beforeProvision.thawingPeriod); + assertEq(afterProvision.createdAt, beforeProvision.createdAt); + assertEq(afterProvision.lastParametersStagedAt, beforeProvision.lastParametersStagedAt); + assertEq(afterProvision.maxVerifierCutPending, beforeProvision.maxVerifierCutPending); + assertEq(afterProvision.thawingPeriodPending, beforeProvision.thawingPeriodPending); + assertEq(afterProvision.thawingNonce, beforeProvision.thawingNonce); + assertEq(afterServiceProvider.tokensStaked, beforeServiceProvider.tokensStaked); + assertEq(afterServiceProvider.tokensProvisioned, beforeServiceProvider.tokensProvisioned + tokens); + assertEq(afterServiceProvider.__DEPRECATED_tokensAllocated, beforeServiceProvider.__DEPRECATED_tokensAllocated); + assertEq(afterServiceProvider.__DEPRECATED_tokensLocked, beforeServiceProvider.__DEPRECATED_tokensLocked); + assertEq( + afterServiceProvider.__DEPRECATED_tokensLockedUntil, + beforeServiceProvider.__DEPRECATED_tokensLockedUntil + ); + } + + function _thaw(address serviceProvider, address verifier, uint256 tokens) internal returns (bytes32) { + // before + Provision memory beforeProvision = staking.getProvision(serviceProvider, verifier); + LinkedList.List memory beforeThawRequestList = staking.getThawRequestList( + IHorizonStakingTypes.ThawRequestType.Provision, + serviceProvider, + verifier, + serviceProvider + ); + + bytes32 expectedThawRequestId = keccak256( + abi.encodePacked(users.indexer, verifier, users.indexer, beforeThawRequestList.nonce) + ); + uint256 thawingShares = beforeProvision.tokensThawing == 0 + ? tokens + : (beforeProvision.sharesThawing * tokens) / beforeProvision.tokensThawing; + + // thaw + vm.expectEmit(address(staking)); + emit IHorizonStakingMain.ThawRequestCreated( + IHorizonStakingTypes.ThawRequestType.Provision, + serviceProvider, + verifier, + serviceProvider, + thawingShares, + uint64(block.timestamp + beforeProvision.thawingPeriod), + expectedThawRequestId, + beforeProvision.thawingNonce + ); + vm.expectEmit(address(staking)); + emit IHorizonStakingMain.ProvisionThawed(serviceProvider, verifier, tokens); + bytes32 thawRequestId = staking.thaw(serviceProvider, verifier, tokens); + + // after + Provision memory afterProvision = staking.getProvision(serviceProvider, verifier); + ThawRequest memory afterThawRequest = staking.getThawRequest( + IHorizonStakingTypes.ThawRequestType.Provision, + thawRequestId + ); + LinkedList.List memory afterThawRequestList = _getThawRequestList( + IHorizonStakingTypes.ThawRequestType.Provision, + serviceProvider, + verifier, + serviceProvider + ); + ThawRequest memory afterPreviousTailThawRequest = staking.getThawRequest( + IHorizonStakingTypes.ThawRequestType.Provision, + beforeThawRequestList.tail + ); + + // assert + assertEq(afterProvision.tokens, beforeProvision.tokens); + assertEq(afterProvision.tokensThawing, beforeProvision.tokensThawing + tokens); + assertEq( + afterProvision.sharesThawing, + beforeProvision.tokensThawing == 0 ? thawingShares : beforeProvision.sharesThawing + thawingShares + ); + assertEq(afterProvision.maxVerifierCut, beforeProvision.maxVerifierCut); + assertEq(afterProvision.thawingPeriod, beforeProvision.thawingPeriod); + assertEq(afterProvision.createdAt, beforeProvision.createdAt); + assertEq(afterProvision.maxVerifierCutPending, beforeProvision.maxVerifierCutPending); + assertEq(afterProvision.thawingPeriodPending, beforeProvision.thawingPeriodPending); + assertEq(afterProvision.lastParametersStagedAt, beforeProvision.lastParametersStagedAt); + assertEq(afterProvision.thawingNonce, beforeProvision.thawingNonce); + assertEq(thawRequestId, expectedThawRequestId); + assertEq(afterThawRequest.shares, thawingShares); + assertEq(afterThawRequest.thawingUntil, block.timestamp + beforeProvision.thawingPeriod); + assertEq(afterThawRequest.nextRequest, bytes32(0)); + assertEq( + afterThawRequestList.head, + beforeThawRequestList.count == 0 ? thawRequestId : beforeThawRequestList.head + ); + assertEq(afterThawRequestList.tail, thawRequestId); + assertEq(afterThawRequestList.count, beforeThawRequestList.count + 1); + assertEq(afterThawRequestList.nonce, beforeThawRequestList.nonce + 1); + if (beforeThawRequestList.count != 0) { + assertEq(afterPreviousTailThawRequest.nextRequest, thawRequestId); + } + + return thawRequestId; + } + + function _deprovision(address serviceProvider, address verifier, uint256 nThawRequests) internal { + // before + Provision memory beforeProvision = staking.getProvision(serviceProvider, verifier); + ServiceProviderInternal memory beforeServiceProvider = _getStorage_ServiceProviderInternal(serviceProvider); + LinkedList.List memory beforeThawRequestList = staking.getThawRequestList( + IHorizonStakingTypes.ThawRequestType.Provision, + serviceProvider, + verifier, + serviceProvider + ); + + Params_CalcThawRequestData memory params = Params_CalcThawRequestData({ + thawRequestType: IHorizonStakingTypes.ThawRequestType.Provision, + serviceProvider: serviceProvider, + verifier: verifier, + owner: serviceProvider, + iterations: nThawRequests, + delegation: false + }); + CalcValues_ThawRequestData memory calcValues = calcThawRequestData(params); + + // deprovision + for (uint i = 0; i < calcValues.thawRequestsFulfilledList.length; i++) { + ThawRequest memory thawRequest = calcValues.thawRequestsFulfilledList[i]; + vm.expectEmit(address(staking)); + emit IHorizonStakingMain.ThawRequestFulfilled( + params.thawRequestType, + calcValues.thawRequestsFulfilledListIds[i], + calcValues.thawRequestsFulfilledListTokens[i], + thawRequest.shares, + thawRequest.thawingUntil, + beforeProvision.thawingNonce == thawRequest.thawingNonce + ); + } + vm.expectEmit(address(staking)); + emit IHorizonStakingMain.ThawRequestsFulfilled( + IHorizonStakingTypes.ThawRequestType.Provision, + serviceProvider, + verifier, + serviceProvider, + calcValues.thawRequestsFulfilledList.length, + calcValues.tokensThawed + ); + vm.expectEmit(address(staking)); + emit IHorizonStakingMain.TokensDeprovisioned(serviceProvider, verifier, calcValues.tokensThawed); + staking.deprovision(serviceProvider, verifier, nThawRequests); + + // after + Provision memory afterProvision = staking.getProvision(serviceProvider, verifier); + ServiceProviderInternal memory afterServiceProvider = _getStorage_ServiceProviderInternal(serviceProvider); + LinkedList.List memory afterThawRequestList = staking.getThawRequestList( + IHorizonStakingTypes.ThawRequestType.Provision, + serviceProvider, + verifier, + serviceProvider + ); + + // assert + assertEq(afterProvision.tokens, beforeProvision.tokens - calcValues.tokensThawed); + assertEq(afterProvision.tokensThawing, calcValues.tokensThawing); + assertEq(afterProvision.sharesThawing, calcValues.sharesThawing); + assertEq(afterProvision.maxVerifierCut, beforeProvision.maxVerifierCut); + assertEq(afterProvision.thawingPeriod, beforeProvision.thawingPeriod); + assertEq(afterProvision.createdAt, beforeProvision.createdAt); + assertEq(afterProvision.maxVerifierCutPending, beforeProvision.maxVerifierCutPending); + assertEq(afterProvision.thawingPeriodPending, beforeProvision.thawingPeriodPending); + assertEq(afterProvision.lastParametersStagedAt, beforeProvision.lastParametersStagedAt); + assertEq(afterProvision.thawingNonce, beforeProvision.thawingNonce); + assertEq(afterServiceProvider.tokensStaked, beforeServiceProvider.tokensStaked); + assertEq( + afterServiceProvider.tokensProvisioned, + beforeServiceProvider.tokensProvisioned - calcValues.tokensThawed + ); + assertEq(afterServiceProvider.__DEPRECATED_tokensAllocated, beforeServiceProvider.__DEPRECATED_tokensAllocated); + assertEq(afterServiceProvider.__DEPRECATED_tokensLocked, beforeServiceProvider.__DEPRECATED_tokensLocked); + assertEq( + afterServiceProvider.__DEPRECATED_tokensLockedUntil, + beforeServiceProvider.__DEPRECATED_tokensLockedUntil + ); + for (uint i = 0; i < calcValues.thawRequestsFulfilledListIds.length; i++) { + ThawRequest memory thawRequest = staking.getThawRequest( + IHorizonStakingTypes.ThawRequestType.Provision, + calcValues.thawRequestsFulfilledListIds[i] + ); + assertEq(thawRequest.shares, 0); + assertEq(thawRequest.thawingUntil, 0); + assertEq(thawRequest.nextRequest, bytes32(0)); + } + if (calcValues.thawRequestsFulfilledList.length == 0) { + assertEq(afterThawRequestList.head, beforeThawRequestList.head); + } else { + assertEq( + afterThawRequestList.head, + calcValues.thawRequestsFulfilledList.length == beforeThawRequestList.count + ? bytes32(0) + : calcValues.thawRequestsFulfilledList[calcValues.thawRequestsFulfilledList.length - 1].nextRequest + ); + } + assertEq( + afterThawRequestList.tail, + calcValues.thawRequestsFulfilledList.length == beforeThawRequestList.count + ? bytes32(0) + : beforeThawRequestList.tail + ); + assertEq(afterThawRequestList.count, beforeThawRequestList.count - calcValues.thawRequestsFulfilledList.length); + assertEq(afterThawRequestList.nonce, beforeThawRequestList.nonce); + } + + struct BeforeValues_Reprovision { + Provision provision; + Provision provisionNewVerifier; + ServiceProviderInternal serviceProvider; + LinkedList.List thawRequestList; + } + + function _reprovision( + address serviceProvider, + address verifier, + address newVerifier, + uint256 nThawRequests + ) internal { + // before + BeforeValues_Reprovision memory beforeValues = BeforeValues_Reprovision({ + provision: staking.getProvision(serviceProvider, verifier), + provisionNewVerifier: staking.getProvision(serviceProvider, newVerifier), + serviceProvider: _getStorage_ServiceProviderInternal(serviceProvider), + thawRequestList: staking.getThawRequestList( + IHorizonStakingTypes.ThawRequestType.Provision, + serviceProvider, + verifier, + serviceProvider + ) + }); + + // calc + Params_CalcThawRequestData memory params = Params_CalcThawRequestData({ + thawRequestType: IHorizonStakingTypes.ThawRequestType.Provision, + serviceProvider: serviceProvider, + verifier: verifier, + owner: serviceProvider, + iterations: nThawRequests, + delegation: false + }); + CalcValues_ThawRequestData memory calcValues = calcThawRequestData(params); + + // reprovision + for (uint i = 0; i < calcValues.thawRequestsFulfilledList.length; i++) { + ThawRequest memory thawRequest = calcValues.thawRequestsFulfilledList[i]; + vm.expectEmit(address(staking)); + emit IHorizonStakingMain.ThawRequestFulfilled( + params.thawRequestType, + calcValues.thawRequestsFulfilledListIds[i], + calcValues.thawRequestsFulfilledListTokens[i], + thawRequest.shares, + thawRequest.thawingUntil, + beforeValues.provision.thawingNonce == thawRequest.thawingNonce + ); + } + vm.expectEmit(address(staking)); + emit IHorizonStakingMain.ThawRequestsFulfilled( + IHorizonStakingTypes.ThawRequestType.Provision, + serviceProvider, + verifier, + serviceProvider, + calcValues.thawRequestsFulfilledList.length, + calcValues.tokensThawed + ); + vm.expectEmit(address(staking)); + emit IHorizonStakingMain.TokensDeprovisioned(serviceProvider, verifier, calcValues.tokensThawed); + vm.expectEmit(); + emit IHorizonStakingMain.ProvisionIncreased(serviceProvider, newVerifier, calcValues.tokensThawed); + staking.reprovision(serviceProvider, verifier, newVerifier, nThawRequests); + + // after + Provision memory afterProvision = staking.getProvision(serviceProvider, verifier); + Provision memory afterProvisionNewVerifier = staking.getProvision(serviceProvider, newVerifier); + ServiceProviderInternal memory afterServiceProvider = _getStorage_ServiceProviderInternal(serviceProvider); + LinkedList.List memory afterThawRequestList = staking.getThawRequestList( + IHorizonStakingTypes.ThawRequestType.Provision, + serviceProvider, + verifier, + serviceProvider + ); + + // assert: provision old verifier + assertEq(afterProvision.tokens, beforeValues.provision.tokens - calcValues.tokensThawed); + assertEq(afterProvision.tokensThawing, calcValues.tokensThawing); + assertEq(afterProvision.sharesThawing, calcValues.sharesThawing); + assertEq(afterProvision.maxVerifierCut, beforeValues.provision.maxVerifierCut); + assertEq(afterProvision.thawingPeriod, beforeValues.provision.thawingPeriod); + assertEq(afterProvision.createdAt, beforeValues.provision.createdAt); + assertEq(afterProvision.maxVerifierCutPending, beforeValues.provision.maxVerifierCutPending); + assertEq(afterProvision.thawingPeriodPending, beforeValues.provision.thawingPeriodPending); + assertEq(afterProvision.lastParametersStagedAt, beforeValues.provision.lastParametersStagedAt); + assertEq(afterProvision.thawingNonce, beforeValues.provision.thawingNonce); + + // assert: provision new verifier + assertEq(afterProvisionNewVerifier.tokens, beforeValues.provisionNewVerifier.tokens + calcValues.tokensThawed); + assertEq(afterProvisionNewVerifier.tokensThawing, beforeValues.provisionNewVerifier.tokensThawing); + assertEq(afterProvisionNewVerifier.sharesThawing, beforeValues.provisionNewVerifier.sharesThawing); + assertEq(afterProvisionNewVerifier.maxVerifierCut, beforeValues.provisionNewVerifier.maxVerifierCut); + assertEq(afterProvisionNewVerifier.thawingPeriod, beforeValues.provisionNewVerifier.thawingPeriod); + assertEq(afterProvisionNewVerifier.createdAt, beforeValues.provisionNewVerifier.createdAt); + assertEq( + afterProvisionNewVerifier.maxVerifierCutPending, + beforeValues.provisionNewVerifier.maxVerifierCutPending + ); + assertEq( + afterProvisionNewVerifier.thawingPeriodPending, + beforeValues.provisionNewVerifier.thawingPeriodPending + ); + assertEq(afterProvisionNewVerifier.thawingNonce, beforeValues.provisionNewVerifier.thawingNonce); + + // assert: service provider + assertEq(afterServiceProvider.tokensStaked, beforeValues.serviceProvider.tokensStaked); + assertEq( + afterServiceProvider.tokensProvisioned, + beforeValues.serviceProvider.tokensProvisioned + calcValues.tokensThawed - calcValues.tokensThawed + ); + assertEq( + afterServiceProvider.__DEPRECATED_tokensAllocated, + beforeValues.serviceProvider.__DEPRECATED_tokensAllocated + ); + assertEq( + afterServiceProvider.__DEPRECATED_tokensLocked, + beforeValues.serviceProvider.__DEPRECATED_tokensLocked + ); + assertEq( + afterServiceProvider.__DEPRECATED_tokensLockedUntil, + beforeValues.serviceProvider.__DEPRECATED_tokensLockedUntil + ); + + // assert: thaw request list old verifier + for (uint i = 0; i < calcValues.thawRequestsFulfilledListIds.length; i++) { + ThawRequest memory thawRequest = staking.getThawRequest( + IHorizonStakingTypes.ThawRequestType.Provision, + calcValues.thawRequestsFulfilledListIds[i] + ); + assertEq(thawRequest.shares, 0); + assertEq(thawRequest.thawingUntil, 0); + assertEq(thawRequest.nextRequest, bytes32(0)); + } + if (calcValues.thawRequestsFulfilledList.length == 0) { + assertEq(afterThawRequestList.head, beforeValues.thawRequestList.head); + } else { + assertEq( + afterThawRequestList.head, + calcValues.thawRequestsFulfilledList.length == beforeValues.thawRequestList.count + ? bytes32(0) + : calcValues.thawRequestsFulfilledList[calcValues.thawRequestsFulfilledList.length - 1].nextRequest + ); + } + assertEq( + afterThawRequestList.tail, + calcValues.thawRequestsFulfilledList.length == beforeValues.thawRequestList.count + ? bytes32(0) + : beforeValues.thawRequestList.tail + ); + assertEq( + afterThawRequestList.count, + beforeValues.thawRequestList.count - calcValues.thawRequestsFulfilledList.length + ); + assertEq(afterThawRequestList.nonce, beforeValues.thawRequestList.nonce); + } + + function _setProvisionParameters( + address serviceProvider, + address verifier, + uint32 maxVerifierCut, + uint64 thawingPeriod + ) internal { + // before + Provision memory beforeProvision = staking.getProvision(serviceProvider, verifier); + + // setProvisionParameters + bool paramsChanged = beforeProvision.maxVerifierCut != maxVerifierCut || + beforeProvision.thawingPeriod != thawingPeriod; + if (paramsChanged) { + vm.expectEmit(); + emit IHorizonStakingMain.ProvisionParametersStaged( + serviceProvider, + verifier, + maxVerifierCut, + thawingPeriod + ); + } + staking.setProvisionParameters(serviceProvider, verifier, maxVerifierCut, thawingPeriod); + + // after + Provision memory afterProvision = staking.getProvision(serviceProvider, verifier); + + // assert + assertEq(afterProvision.tokens, beforeProvision.tokens); + assertEq(afterProvision.tokensThawing, beforeProvision.tokensThawing); + assertEq(afterProvision.sharesThawing, beforeProvision.sharesThawing); + assertEq(afterProvision.maxVerifierCut, beforeProvision.maxVerifierCut); + assertEq(afterProvision.thawingPeriod, beforeProvision.thawingPeriod); + assertEq(afterProvision.createdAt, beforeProvision.createdAt); + assertEq(afterProvision.maxVerifierCutPending, maxVerifierCut); + assertEq(afterProvision.thawingPeriodPending, thawingPeriod); + assertEq( + afterProvision.lastParametersStagedAt, + paramsChanged ? block.timestamp : beforeProvision.lastParametersStagedAt + ); + assertEq(afterProvision.thawingNonce, beforeProvision.thawingNonce); + } + + function _acceptProvisionParameters(address serviceProvider) internal { + (, address msgSender, ) = vm.readCallers(); + + // before + Provision memory beforeProvision = staking.getProvision(serviceProvider, msgSender); + + // acceptProvisionParameters + if ( + beforeProvision.maxVerifierCutPending != beforeProvision.maxVerifierCut || + beforeProvision.thawingPeriodPending != beforeProvision.thawingPeriod + ) { + vm.expectEmit(); + emit IHorizonStakingMain.ProvisionParametersSet( + serviceProvider, + msgSender, + beforeProvision.maxVerifierCutPending, + beforeProvision.thawingPeriodPending + ); + } + staking.acceptProvisionParameters(serviceProvider); + + // after + Provision memory afterProvision = staking.getProvision(serviceProvider, msgSender); + + // assert + assertEq(afterProvision.tokens, beforeProvision.tokens); + assertEq(afterProvision.tokensThawing, beforeProvision.tokensThawing); + assertEq(afterProvision.sharesThawing, beforeProvision.sharesThawing); + assertEq(afterProvision.maxVerifierCut, beforeProvision.maxVerifierCutPending); + assertEq(afterProvision.maxVerifierCut, afterProvision.maxVerifierCutPending); + assertEq(afterProvision.thawingPeriod, beforeProvision.thawingPeriodPending); + assertEq(afterProvision.thawingPeriod, afterProvision.thawingPeriodPending); + assertEq(afterProvision.createdAt, beforeProvision.createdAt); + assertEq(afterProvision.lastParametersStagedAt, beforeProvision.lastParametersStagedAt); + assertEq(afterProvision.thawingNonce, beforeProvision.thawingNonce); + } + + function _setOperator(address verifier, address operator, bool allow) internal { + __setOperator(verifier, operator, allow, false); + } + + function _setOperatorLocked(address verifier, address operator, bool allow) internal { + __setOperator(verifier, operator, allow, true); + } + + function __setOperator(address verifier, address operator, bool allow, bool locked) private { + (, address msgSender, ) = vm.readCallers(); + + // staking contract knows the address of the legacy subgraph service + // but we cannot read it as it's an immutable, we have to use the global var :/ + bool legacy = verifier == subgraphDataServiceLegacyAddress; + + // before + bool beforeOperatorAllowed = _getStorage_OperatorAuth(msgSender, verifier, operator, legacy); + bool beforeOperatorAllowedGetter = staking.isAuthorized(msgSender, verifier, operator); + assertEq(beforeOperatorAllowed, beforeOperatorAllowedGetter); + + // setOperator + vm.expectEmit(address(staking)); + emit IHorizonStakingMain.OperatorSet(msgSender, verifier, operator, allow); + if (locked) { + staking.setOperatorLocked(verifier, operator, allow); + } else { + staking.setOperator(verifier, operator, allow); + } + + // after + bool afterOperatorAllowed = _getStorage_OperatorAuth(msgSender, verifier, operator, legacy); + bool afterOperatorAllowedGetter = staking.isAuthorized(msgSender, verifier, operator); + assertEq(afterOperatorAllowed, afterOperatorAllowedGetter, "afterOperatorAllowedGetter FAIL"); + + // assert + assertEq(afterOperatorAllowed, allow); + } + + function _delegate(address serviceProvider, address verifier, uint256 tokens, uint256 minSharesOut) internal { + __delegate(serviceProvider, verifier, tokens, minSharesOut, false); + } + + function _delegate(address serviceProvider, uint256 tokens) internal { + __delegate(serviceProvider, subgraphDataServiceLegacyAddress, tokens, 0, true); + } + + function __delegate( + address serviceProvider, + address verifier, + uint256 tokens, + uint256 minSharesOut, + bool legacy + ) private { + (, address delegator, ) = vm.readCallers(); + + // before + DelegationPoolInternalTest memory beforePool = _getStorage_DelegationPoolInternal( + serviceProvider, + verifier, + legacy + ); + DelegationInternal memory beforeDelegation = _getStorage_Delegation( + serviceProvider, + verifier, + delegator, + legacy + ); + uint256 beforeDelegatorBalance = token.balanceOf(delegator); + uint256 beforeStakingBalance = token.balanceOf(address(staking)); + + uint256 calcShares = (beforePool.tokens == 0 || beforePool.tokens == beforePool.tokensThawing) + ? tokens + : ((tokens * beforePool.shares) / (beforePool.tokens - beforePool.tokensThawing)); + + // delegate + token.approve(address(staking), tokens); + vm.expectEmit(); + emit IHorizonStakingMain.TokensDelegated(serviceProvider, verifier, delegator, tokens, calcShares); + if (legacy) { + staking.delegate(serviceProvider, tokens); + } else { + staking.delegate(serviceProvider, verifier, tokens, minSharesOut); + } + + // after + DelegationPoolInternalTest memory afterPool = _getStorage_DelegationPoolInternal( + serviceProvider, + verifier, + legacy + ); + DelegationInternal memory afterDelegation = _getStorage_Delegation( + serviceProvider, + verifier, + delegator, + legacy + ); + uint256 afterDelegatorBalance = token.balanceOf(delegator); + uint256 afterStakingBalance = token.balanceOf(address(staking)); + + uint256 deltaShares = afterDelegation.shares - beforeDelegation.shares; + + // assertions + assertEq(beforePool.tokens + tokens, afterPool.tokens, "afterPool.tokens FAIL"); + assertEq(beforePool.shares + calcShares, afterPool.shares, "afterPool.shares FAIL"); + assertEq(beforePool.tokensThawing, afterPool.tokensThawing); + assertEq(beforePool.sharesThawing, afterPool.sharesThawing); + assertEq(beforePool.thawingNonce, afterPool.thawingNonce); + assertEq(beforeDelegation.shares + calcShares, afterDelegation.shares); + assertEq(beforeDelegation.__DEPRECATED_tokensLocked, afterDelegation.__DEPRECATED_tokensLocked); + assertEq(beforeDelegation.__DEPRECATED_tokensLockedUntil, afterDelegation.__DEPRECATED_tokensLockedUntil); + assertGe(deltaShares, minSharesOut); + assertEq(calcShares, deltaShares); + assertEq(beforeDelegatorBalance - tokens, afterDelegatorBalance); + assertEq(beforeStakingBalance + tokens, afterStakingBalance); + } + + function _undelegate(address serviceProvider, address verifier, uint256 shares) internal { + (, address caller, ) = vm.readCallers(); + __undelegate(IHorizonStakingTypes.ThawRequestType.Delegation, serviceProvider, verifier, shares, false, caller); + } + + function _undelegate(address serviceProvider, uint256 shares) internal { + (, address caller, ) = vm.readCallers(); + __undelegate( + IHorizonStakingTypes.ThawRequestType.Delegation, + serviceProvider, + subgraphDataServiceLegacyAddress, + shares, + true, + caller + ); + } + + struct BeforeValues_Undelegate { + DelegationPoolInternalTest pool; + DelegationInternal delegation; + LinkedList.List thawRequestList; + uint256 delegatedTokens; + } + struct CalcValues_Undelegate { + uint256 tokens; + uint256 thawingShares; + uint64 thawingUntil; + bytes32 thawRequestId; + } + + function __undelegate( + IHorizonStakingTypes.ThawRequestType thawRequestType, + address serviceProvider, + address verifier, + uint256 shares, + bool legacy, + address beneficiary + ) private { + (, address delegator, ) = vm.readCallers(); + + // before + BeforeValues_Undelegate memory beforeValues; + beforeValues.pool = _getStorage_DelegationPoolInternal(serviceProvider, verifier, legacy); + beforeValues.delegation = _getStorage_Delegation(serviceProvider, verifier, delegator, legacy); + beforeValues.thawRequestList = staking.getThawRequestList( + thawRequestType, + serviceProvider, + verifier, + delegator + ); + beforeValues.delegatedTokens = staking.getDelegatedTokensAvailable(serviceProvider, verifier); + + // calc + CalcValues_Undelegate memory calcValues; + calcValues.tokens = + ((beforeValues.pool.tokens - beforeValues.pool.tokensThawing) * shares) / + beforeValues.pool.shares; + calcValues.thawingShares = beforeValues.pool.tokensThawing == 0 + ? calcValues.tokens + : (beforeValues.pool.sharesThawing * calcValues.tokens) / beforeValues.pool.tokensThawing; + calcValues.thawingUntil = + staking.getProvision(serviceProvider, verifier).thawingPeriod + + uint64(block.timestamp); + calcValues.thawRequestId = keccak256( + abi.encodePacked(serviceProvider, verifier, beneficiary, beforeValues.thawRequestList.nonce) + ); + + // undelegate + vm.expectEmit(); + emit IHorizonStakingMain.ThawRequestCreated( + thawRequestType, + serviceProvider, + verifier, + beneficiary, + calcValues.thawingShares, + calcValues.thawingUntil, + calcValues.thawRequestId, + beforeValues.pool.thawingNonce + ); + vm.expectEmit(); + emit IHorizonStakingMain.TokensUndelegated(serviceProvider, verifier, delegator, calcValues.tokens, shares); + if (legacy) { + staking.undelegate(serviceProvider, shares); + } else if (thawRequestType == IHorizonStakingTypes.ThawRequestType.Delegation) { + staking.undelegate(serviceProvider, verifier, shares); + } else { + revert("Invalid thaw request type"); + } + + // after + DelegationPoolInternalTest memory afterPool = _getStorage_DelegationPoolInternal( + users.indexer, + verifier, + legacy + ); + DelegationInternal memory afterDelegation = _getStorage_Delegation( + serviceProvider, + verifier, + beneficiary, + legacy + ); + LinkedList.List memory afterThawRequestList = staking.getThawRequestList( + thawRequestType, + serviceProvider, + verifier, + beneficiary + ); + ThawRequest memory afterThawRequest = staking.getThawRequest(thawRequestType, calcValues.thawRequestId); + uint256 afterDelegatedTokens = staking.getDelegatedTokensAvailable(serviceProvider, verifier); + + // assertions + assertEq(beforeValues.pool.shares, afterPool.shares + shares); + assertEq(beforeValues.pool.tokens, afterPool.tokens); + assertEq(beforeValues.pool.tokensThawing + calcValues.tokens, afterPool.tokensThawing); + assertEq( + beforeValues.pool.tokensThawing == 0 + ? calcValues.thawingShares + : beforeValues.pool.sharesThawing + calcValues.thawingShares, + afterPool.sharesThawing + ); + assertEq(beforeValues.pool.thawingNonce, afterPool.thawingNonce); + assertEq(beforeValues.delegation.shares - shares, afterDelegation.shares); + assertEq(afterThawRequest.shares, calcValues.thawingShares); + assertEq(afterThawRequest.thawingUntil, calcValues.thawingUntil); + assertEq(afterThawRequest.nextRequest, bytes32(0)); + assertEq(calcValues.thawRequestId, afterThawRequestList.tail); + assertEq(beforeValues.thawRequestList.nonce + 1, afterThawRequestList.nonce); + assertEq(beforeValues.thawRequestList.count + 1, afterThawRequestList.count); + assertEq(afterDelegatedTokens + calcValues.tokens, beforeValues.delegatedTokens); + } + + function _withdrawDelegated(address serviceProvider, address verifier, uint256 nThawRequests) internal { + Params_WithdrawDelegated memory params = Params_WithdrawDelegated({ + thawRequestType: IHorizonStakingTypes.ThawRequestType.Delegation, + serviceProvider: serviceProvider, + verifier: verifier, + newServiceProvider: address(0), + newVerifier: address(0), + minSharesForNewProvider: 0, + nThawRequests: nThawRequests, + legacy: verifier == subgraphDataServiceLegacyAddress + }); + __withdrawDelegated(params); + } + + function _redelegate( + address serviceProvider, + address verifier, + address newServiceProvider, + address newVerifier, + uint256 minSharesForNewProvider, + uint256 nThawRequests + ) internal { + Params_WithdrawDelegated memory params = Params_WithdrawDelegated({ + thawRequestType: IHorizonStakingTypes.ThawRequestType.Delegation, + serviceProvider: serviceProvider, + verifier: verifier, + newServiceProvider: newServiceProvider, + newVerifier: newVerifier, + minSharesForNewProvider: minSharesForNewProvider, + nThawRequests: nThawRequests, + legacy: false + }); + __withdrawDelegated(params); + } + + struct BeforeValues_WithdrawDelegated { + DelegationPoolInternalTest pool; + DelegationPoolInternalTest newPool; + DelegationInternal newDelegation; + LinkedList.List thawRequestList; + uint256 senderBalance; + uint256 stakingBalance; + } + struct AfterValues_WithdrawDelegated { + DelegationPoolInternalTest pool; + DelegationPoolInternalTest newPool; + DelegationInternal newDelegation; + LinkedList.List thawRequestList; + uint256 senderBalance; + uint256 stakingBalance; + } + + struct Params_WithdrawDelegated { + IHorizonStakingTypes.ThawRequestType thawRequestType; + address serviceProvider; + address verifier; + address newServiceProvider; + address newVerifier; + uint256 minSharesForNewProvider; + uint256 nThawRequests; + bool legacy; + } + + function __withdrawDelegated(Params_WithdrawDelegated memory params) private { + (, address msgSender, ) = vm.readCallers(); + + bool reDelegate = params.newServiceProvider != address(0) && params.newVerifier != address(0); + + // before + BeforeValues_WithdrawDelegated memory beforeValues; + beforeValues.pool = _getStorage_DelegationPoolInternal(params.serviceProvider, params.verifier, params.legacy); + beforeValues.newPool = _getStorage_DelegationPoolInternal( + params.newServiceProvider, + params.newVerifier, + params.legacy + ); + beforeValues.newDelegation = _getStorage_Delegation( + params.newServiceProvider, + params.newVerifier, + msgSender, + params.legacy + ); + beforeValues.thawRequestList = staking.getThawRequestList( + params.thawRequestType, + params.serviceProvider, + params.verifier, + msgSender + ); + beforeValues.senderBalance = token.balanceOf(msgSender); + beforeValues.stakingBalance = token.balanceOf(address(staking)); + + Params_CalcThawRequestData memory paramsCalc = Params_CalcThawRequestData({ + thawRequestType: params.thawRequestType, + serviceProvider: params.serviceProvider, + verifier: params.verifier, + owner: msgSender, + iterations: params.nThawRequests, + delegation: true + }); + CalcValues_ThawRequestData memory calcValues = calcThawRequestData(paramsCalc); + + // withdrawDelegated + for (uint i = 0; i < calcValues.thawRequestsFulfilledList.length; i++) { + ThawRequest memory thawRequest = calcValues.thawRequestsFulfilledList[i]; + vm.expectEmit(address(staking)); + emit IHorizonStakingMain.ThawRequestFulfilled( + params.thawRequestType, + calcValues.thawRequestsFulfilledListIds[i], + calcValues.thawRequestsFulfilledListTokens[i], + thawRequest.shares, + thawRequest.thawingUntil, + beforeValues.pool.thawingNonce == thawRequest.thawingNonce + ); + } + vm.expectEmit(address(staking)); + emit IHorizonStakingMain.ThawRequestsFulfilled( + params.thawRequestType, + params.serviceProvider, + params.verifier, + msgSender, + calcValues.thawRequestsFulfilledList.length, + calcValues.tokensThawed + ); + if (calcValues.tokensThawed != 0) { + vm.expectEmit(); + if (reDelegate) { + emit IHorizonStakingMain.TokensDelegated( + params.newServiceProvider, + params.newVerifier, + msgSender, + calcValues.tokensThawed, + calcValues.sharesThawed + ); + } else { + emit Transfer(address(staking), msgSender, calcValues.tokensThawed); + + vm.expectEmit(); + emit IHorizonStakingMain.DelegatedTokensWithdrawn( + params.serviceProvider, + params.verifier, + msgSender, + calcValues.tokensThawed + ); + } + } + + if (reDelegate) { + staking.redelegate( + params.serviceProvider, + params.verifier, + params.newServiceProvider, + params.newVerifier, + params.minSharesForNewProvider, + params.nThawRequests + ); + } else if (params.thawRequestType == IHorizonStakingTypes.ThawRequestType.Delegation) { + staking.withdrawDelegated(params.serviceProvider, params.verifier, params.nThawRequests); + } else { + revert("Invalid thaw request type"); + } + + // after + AfterValues_WithdrawDelegated memory afterValues; + afterValues.pool = _getStorage_DelegationPoolInternal(params.serviceProvider, params.verifier, params.legacy); + afterValues.newPool = _getStorage_DelegationPoolInternal( + params.newServiceProvider, + params.newVerifier, + params.legacy + ); + afterValues.newDelegation = _getStorage_Delegation( + params.newServiceProvider, + params.newVerifier, + msgSender, + params.legacy + ); + afterValues.thawRequestList = staking.getThawRequestList( + params.thawRequestType, + params.serviceProvider, + params.verifier, + msgSender + ); + afterValues.senderBalance = token.balanceOf(msgSender); + afterValues.stakingBalance = token.balanceOf(address(staking)); + + // assert + assertEq(afterValues.pool.tokens, beforeValues.pool.tokens - calcValues.tokensThawed); + assertEq(afterValues.pool.shares, beforeValues.pool.shares); + assertEq(afterValues.pool.tokensThawing, calcValues.tokensThawing); + assertEq(afterValues.pool.sharesThawing, calcValues.sharesThawing); + assertEq(afterValues.pool.thawingNonce, beforeValues.pool.thawingNonce); + + for (uint i = 0; i < calcValues.thawRequestsFulfilledListIds.length; i++) { + ThawRequest memory thawRequest = staking.getThawRequest( + params.thawRequestType, + calcValues.thawRequestsFulfilledListIds[i] + ); + assertEq(thawRequest.shares, 0); + assertEq(thawRequest.thawingUntil, 0); + assertEq(thawRequest.nextRequest, bytes32(0)); + } + if (calcValues.thawRequestsFulfilledList.length == 0) { + assertEq(afterValues.thawRequestList.head, beforeValues.thawRequestList.head); + } else { + assertEq( + afterValues.thawRequestList.head, + calcValues.thawRequestsFulfilledList.length == beforeValues.thawRequestList.count + ? bytes32(0) + : calcValues.thawRequestsFulfilledList[calcValues.thawRequestsFulfilledList.length - 1].nextRequest + ); + } + assertEq( + afterValues.thawRequestList.tail, + calcValues.thawRequestsFulfilledList.length == beforeValues.thawRequestList.count + ? bytes32(0) + : beforeValues.thawRequestList.tail + ); + assertEq( + afterValues.thawRequestList.count, + beforeValues.thawRequestList.count - calcValues.thawRequestsFulfilledList.length + ); + assertEq(afterValues.thawRequestList.nonce, beforeValues.thawRequestList.nonce); + + if (reDelegate) { + uint256 calcShares = (afterValues.newPool.tokens == 0 || + afterValues.newPool.tokens == afterValues.newPool.tokensThawing) + ? calcValues.tokensThawed + : ((calcValues.tokensThawed * afterValues.newPool.shares) / + (afterValues.newPool.tokens - afterValues.newPool.tokensThawing)); + uint256 deltaShares = afterValues.newDelegation.shares - beforeValues.newDelegation.shares; + + assertEq(afterValues.newPool.tokens, beforeValues.newPool.tokens + calcValues.tokensThawed); + assertEq(afterValues.newPool.shares, beforeValues.newPool.shares + calcShares); + assertEq(afterValues.newPool.tokensThawing, beforeValues.newPool.tokensThawing); + assertEq(afterValues.newPool.sharesThawing, beforeValues.newPool.sharesThawing); + assertEq(afterValues.newDelegation.shares, beforeValues.newDelegation.shares + calcShares); + assertEq( + afterValues.newDelegation.__DEPRECATED_tokensLocked, + beforeValues.newDelegation.__DEPRECATED_tokensLocked + ); + assertEq( + afterValues.newDelegation.__DEPRECATED_tokensLockedUntil, + beforeValues.newDelegation.__DEPRECATED_tokensLockedUntil + ); + assertGe(deltaShares, params.minSharesForNewProvider); + assertEq(calcShares, deltaShares); + assertEq(afterValues.senderBalance - beforeValues.senderBalance, 0); + assertEq(beforeValues.stakingBalance - afterValues.stakingBalance, 0); + } else { + assertEq(beforeValues.stakingBalance - afterValues.stakingBalance, calcValues.tokensThawed); + assertEq(afterValues.senderBalance - beforeValues.senderBalance, calcValues.tokensThawed); + } + } + + function _addToDelegationPool(address serviceProvider, address verifier, uint256 tokens) internal { + (, address msgSender, ) = vm.readCallers(); + + // staking contract knows the address of the legacy subgraph service + // but we cannot read it as it's an immutable, we have to use the global var :/ + bool legacy = verifier == subgraphDataServiceLegacyAddress; + + // before + DelegationPoolInternalTest memory beforePool = _getStorage_DelegationPoolInternal( + serviceProvider, + verifier, + legacy + ); + uint256 beforeSenderBalance = token.balanceOf(msgSender); + uint256 beforeStakingBalance = token.balanceOf(address(staking)); + + // addToDelegationPool + vm.expectEmit(); + emit Transfer(msgSender, address(staking), tokens); + vm.expectEmit(address(staking)); + emit IHorizonStakingMain.TokensToDelegationPoolAdded(serviceProvider, verifier, tokens); + staking.addToDelegationPool(serviceProvider, verifier, tokens); + + // after + DelegationPoolInternalTest memory afterPool = _getStorage_DelegationPoolInternal( + serviceProvider, + verifier, + legacy + ); + uint256 afterSenderBalance = token.balanceOf(msgSender); + uint256 afterStakingBalance = token.balanceOf(address(staking)); + + // assert + assertEq(beforeSenderBalance - tokens, afterSenderBalance); + assertEq(beforeStakingBalance + tokens, afterStakingBalance); + assertEq(beforePool.tokens + tokens, afterPool.tokens); + assertEq(beforePool.shares, afterPool.shares); + assertEq(beforePool.tokensThawing, afterPool.tokensThawing); + assertEq(beforePool.sharesThawing, afterPool.sharesThawing); + assertEq(beforePool.thawingNonce, afterPool.thawingNonce); + } + + function _setDelegationFeeCut( + address serviceProvider, + address verifier, + IGraphPayments.PaymentTypes paymentType, + uint256 feeCut + ) internal { + // setDelegationFeeCut + vm.expectEmit(); + emit IHorizonStakingMain.DelegationFeeCutSet(serviceProvider, verifier, paymentType, feeCut); + staking.setDelegationFeeCut(serviceProvider, verifier, paymentType, feeCut); + + // after + uint256 afterDelegationFeeCut = staking.getDelegationFeeCut(serviceProvider, verifier, paymentType); + + // assert + assertEq(afterDelegationFeeCut, feeCut); + } + + function _setAllowedLockedVerifier(address verifier, bool allowed) internal { + // setAllowedLockedVerifier + vm.expectEmit(); + emit IHorizonStakingMain.AllowedLockedVerifierSet(verifier, allowed); + staking.setAllowedLockedVerifier(verifier, allowed); + + // after + bool afterAllowed = staking.isAllowedLockedVerifier(verifier); + + // assert + assertEq(afterAllowed, allowed); + } + + function _setDelegationSlashingEnabled() internal { + // setDelegationSlashingEnabled + vm.expectEmit(); + emit IHorizonStakingMain.DelegationSlashingEnabled(); + staking.setDelegationSlashingEnabled(); + + // after + bool afterEnabled = staking.isDelegationSlashingEnabled(); + + // assert + assertEq(afterEnabled, true); + } + + function _clearThawingPeriod() internal { + // clearThawingPeriod + vm.expectEmit(address(staking)); + emit IHorizonStakingMain.ThawingPeriodCleared(); + staking.clearThawingPeriod(); + + // after + uint64 afterThawingPeriod = staking.__DEPRECATED_getThawingPeriod(); + + // assert + assertEq(afterThawingPeriod, 0); + } + + function _setMaxThawingPeriod(uint64 maxThawingPeriod) internal { + // setMaxThawingPeriod + vm.expectEmit(address(staking)); + emit IHorizonStakingMain.MaxThawingPeriodSet(maxThawingPeriod); + staking.setMaxThawingPeriod(maxThawingPeriod); + + // after + uint64 afterMaxThawingPeriod = staking.getMaxThawingPeriod(); + + // assert + assertEq(afterMaxThawingPeriod, maxThawingPeriod); + } + + struct BeforeValues_Slash { + Provision provision; + DelegationPoolInternalTest pool; + ServiceProviderInternal serviceProvider; + uint256 stakingBalance; + uint256 verifierBalance; + } + struct CalcValues_Slash { + uint256 tokensToSlash; + uint256 providerTokensSlashed; + uint256 delegationTokensSlashed; + } + + function _slash(address serviceProvider, address verifier, uint256 tokens, uint256 verifierCutAmount) internal { + bool isDelegationSlashingEnabled = staking.isDelegationSlashingEnabled(); + + // staking contract knows the address of the legacy subgraph service + // but we cannot read it as it's an immutable, we have to use the global var :/ + bool legacy = verifier == subgraphDataServiceLegacyAddress; + + // before + BeforeValues_Slash memory before; + before.provision = staking.getProvision(serviceProvider, verifier); + before.pool = _getStorage_DelegationPoolInternal(serviceProvider, verifier, legacy); + before.serviceProvider = _getStorage_ServiceProviderInternal(serviceProvider); + before.stakingBalance = token.balanceOf(address(staking)); + before.verifierBalance = token.balanceOf(verifier); + + // Calculate expected tokens after slashing + CalcValues_Slash memory calcValues; + calcValues.tokensToSlash = MathUtils.min(tokens, before.provision.tokens + before.pool.tokens); + calcValues.providerTokensSlashed = MathUtils.min(before.provision.tokens, calcValues.tokensToSlash); + calcValues.delegationTokensSlashed = calcValues.tokensToSlash - calcValues.providerTokensSlashed; + + if (calcValues.tokensToSlash > 0) { + if (verifierCutAmount > 0) { + vm.expectEmit(address(token)); + emit Transfer(address(staking), verifier, verifierCutAmount); + vm.expectEmit(address(staking)); + emit IHorizonStakingMain.VerifierTokensSent(serviceProvider, verifier, verifier, verifierCutAmount); + } + if (calcValues.providerTokensSlashed - verifierCutAmount > 0) { + vm.expectEmit(address(token)); + emit Transfer(address(staking), address(0), calcValues.providerTokensSlashed - verifierCutAmount); + } + vm.expectEmit(address(staking)); + emit IHorizonStakingMain.ProvisionSlashed(serviceProvider, verifier, calcValues.providerTokensSlashed); + } + + if (calcValues.delegationTokensSlashed > 0) { + if (isDelegationSlashingEnabled) { + vm.expectEmit(address(token)); + emit Transfer(address(staking), address(0), calcValues.delegationTokensSlashed); + vm.expectEmit(address(staking)); + emit IHorizonStakingMain.DelegationSlashed( + serviceProvider, + verifier, + calcValues.delegationTokensSlashed + ); + } else { + vm.expectEmit(address(staking)); + emit IHorizonStakingMain.DelegationSlashingSkipped( + serviceProvider, + verifier, + calcValues.delegationTokensSlashed + ); + } + } + staking.slash(serviceProvider, tokens, verifierCutAmount, verifier); + + // after + Provision memory afterProvision = staking.getProvision(serviceProvider, verifier); + DelegationPoolInternalTest memory afterPool = _getStorage_DelegationPoolInternal( + serviceProvider, + verifier, + legacy + ); + ServiceProviderInternal memory afterServiceProvider = _getStorage_ServiceProviderInternal(serviceProvider); + uint256 afterStakingBalance = token.balanceOf(address(staking)); + uint256 afterVerifierBalance = token.balanceOf(verifier); + + { + uint256 tokensSlashed = calcValues.providerTokensSlashed + + (isDelegationSlashingEnabled ? calcValues.delegationTokensSlashed : 0); + uint256 provisionThawingTokens = (before.provision.tokensThawing * + (before.provision.tokens - calcValues.providerTokensSlashed)) / before.provision.tokens; + + // assert + assertEq(afterProvision.tokens + calcValues.providerTokensSlashed, before.provision.tokens); + assertEq(afterProvision.tokensThawing, provisionThawingTokens); + assertEq( + afterProvision.sharesThawing, + afterProvision.tokensThawing == 0 ? 0 : before.provision.sharesThawing + ); + assertEq(afterProvision.maxVerifierCut, before.provision.maxVerifierCut); + assertEq(afterProvision.maxVerifierCutPending, before.provision.maxVerifierCutPending); + assertEq(afterProvision.thawingPeriod, before.provision.thawingPeriod); + assertEq(afterProvision.thawingPeriodPending, before.provision.thawingPeriodPending); + assertEq( + afterProvision.thawingNonce, + (before.provision.sharesThawing != 0 && afterProvision.sharesThawing == 0) + ? before.provision.thawingNonce + 1 + : before.provision.thawingNonce + ); + if (isDelegationSlashingEnabled) { + uint256 poolThawingTokens = (before.pool.tokensThawing * + (before.pool.tokens - calcValues.delegationTokensSlashed)) / before.pool.tokens; + assertEq(afterPool.tokens + calcValues.delegationTokensSlashed, before.pool.tokens); + assertEq(afterPool.shares, before.pool.shares); + assertEq(afterPool.tokensThawing, poolThawingTokens); + assertEq(afterPool.sharesThawing, afterPool.tokensThawing == 0 ? 0 : before.pool.sharesThawing); + assertEq( + afterPool.thawingNonce, + (before.pool.sharesThawing != 0 && afterPool.sharesThawing == 0) + ? before.pool.thawingNonce + 1 + : before.pool.thawingNonce + ); + } + + assertEq(before.stakingBalance - tokensSlashed, afterStakingBalance); + assertEq(before.verifierBalance + verifierCutAmount, afterVerifierBalance); + + assertEq( + afterServiceProvider.tokensStaked + calcValues.providerTokensSlashed, + before.serviceProvider.tokensStaked + ); + assertEq( + afterServiceProvider.tokensProvisioned + calcValues.providerTokensSlashed, + before.serviceProvider.tokensProvisioned + ); + } + } + + // use struct to avoid 'stack too deep' error + struct CalcValues_CloseAllocation { + uint256 rewards; + uint256 delegatorRewards; + uint256 indexerRewards; + } + struct BeforeValues_CloseAllocation { + IHorizonStakingExtension.Allocation allocation; + DelegationPoolInternalTest pool; + ServiceProviderInternal serviceProvider; + uint256 subgraphAllocations; + uint256 stakingBalance; + uint256 indexerBalance; + uint256 beneficiaryBalance; + } + + // Current rewards manager is mocked and assumed to mint fixed rewards + function _closeAllocation(address allocationId, bytes32 poi) internal { + (, address msgSender, ) = vm.readCallers(); + + // before + BeforeValues_CloseAllocation memory beforeValues; + beforeValues.allocation = staking.getAllocation(allocationId); + beforeValues.pool = _getStorage_DelegationPoolInternal( + beforeValues.allocation.indexer, + subgraphDataServiceLegacyAddress, + true + ); + beforeValues.serviceProvider = _getStorage_ServiceProviderInternal(beforeValues.allocation.indexer); + beforeValues.subgraphAllocations = _getStorage_SubgraphAllocations( + beforeValues.allocation.subgraphDeploymentID + ); + beforeValues.stakingBalance = token.balanceOf(address(staking)); + beforeValues.indexerBalance = token.balanceOf(beforeValues.allocation.indexer); + beforeValues.beneficiaryBalance = token.balanceOf( + _getStorage_RewardsDestination(beforeValues.allocation.indexer) + ); + + bool isAuth = staking.isAuthorized( + beforeValues.allocation.indexer, + subgraphDataServiceLegacyAddress, + msgSender + ); + address rewardsDestination = _getStorage_RewardsDestination(beforeValues.allocation.indexer); + + CalcValues_CloseAllocation memory calcValues = CalcValues_CloseAllocation({ + rewards: ALLOCATIONS_REWARD_CUT, + delegatorRewards: ALLOCATIONS_REWARD_CUT - + uint256(beforeValues.pool.__DEPRECATED_indexingRewardCut).mulPPM(ALLOCATIONS_REWARD_CUT), + indexerRewards: 0 + }); + calcValues.indexerRewards = + ALLOCATIONS_REWARD_CUT - + (beforeValues.pool.tokens > 0 ? calcValues.delegatorRewards : 0); + + // closeAllocation + vm.expectEmit(address(staking)); + emit IHorizonStakingExtension.AllocationClosed( + beforeValues.allocation.indexer, + beforeValues.allocation.subgraphDeploymentID, + epochManager.currentEpoch(), + beforeValues.allocation.tokens, + allocationId, + msgSender, + poi, + !isAuth + ); + staking.closeAllocation(allocationId, poi); + + // after + IHorizonStakingExtension.Allocation memory afterAllocation = staking.getAllocation(allocationId); + DelegationPoolInternalTest memory afterPool = _getStorage_DelegationPoolInternal( + beforeValues.allocation.indexer, + subgraphDataServiceLegacyAddress, + true + ); + ServiceProviderInternal memory afterServiceProvider = _getStorage_ServiceProviderInternal( + beforeValues.allocation.indexer + ); + uint256 afterSubgraphAllocations = _getStorage_SubgraphAllocations( + beforeValues.allocation.subgraphDeploymentID + ); + uint256 afterStakingBalance = token.balanceOf(address(staking)); + uint256 afterIndexerBalance = token.balanceOf(beforeValues.allocation.indexer); + uint256 afterBeneficiaryBalance = token.balanceOf(rewardsDestination); + + if (beforeValues.allocation.tokens > 0) { + if (isAuth && poi != 0) { + if (rewardsDestination != address(0)) { + assertEq( + beforeValues.stakingBalance + calcValues.rewards - calcValues.indexerRewards, + afterStakingBalance + ); + assertEq(beforeValues.indexerBalance, afterIndexerBalance); + assertEq(beforeValues.beneficiaryBalance + calcValues.indexerRewards, afterBeneficiaryBalance); + } else { + assertEq(beforeValues.stakingBalance + calcValues.rewards, afterStakingBalance); + assertEq(beforeValues.indexerBalance, afterIndexerBalance); + assertEq(beforeValues.beneficiaryBalance, afterBeneficiaryBalance); + } + } else { + assertEq(beforeValues.stakingBalance, afterStakingBalance); + assertEq(beforeValues.indexerBalance, afterIndexerBalance); + assertEq(beforeValues.beneficiaryBalance, afterBeneficiaryBalance); + } + } else { + assertEq(beforeValues.stakingBalance, afterStakingBalance); + assertEq(beforeValues.indexerBalance, afterIndexerBalance); + assertEq(beforeValues.beneficiaryBalance, afterBeneficiaryBalance); + } + + assertEq(afterAllocation.indexer, beforeValues.allocation.indexer); + assertEq(afterAllocation.subgraphDeploymentID, beforeValues.allocation.subgraphDeploymentID); + assertEq(afterAllocation.tokens, beforeValues.allocation.tokens); + assertEq(afterAllocation.createdAtEpoch, beforeValues.allocation.createdAtEpoch); + assertEq(afterAllocation.closedAtEpoch, epochManager.currentEpoch()); + assertEq(afterAllocation.collectedFees, beforeValues.allocation.collectedFees); + assertEq( + afterAllocation.__DEPRECATED_effectiveAllocation, + beforeValues.allocation.__DEPRECATED_effectiveAllocation + ); + assertEq(afterAllocation.accRewardsPerAllocatedToken, beforeValues.allocation.accRewardsPerAllocatedToken); + assertEq(afterAllocation.distributedRebates, beforeValues.allocation.distributedRebates); + + if (beforeValues.allocation.tokens > 0 && isAuth && poi != 0 && rewardsDestination == address(0)) { + assertEq( + afterServiceProvider.tokensStaked, + beforeValues.serviceProvider.tokensStaked + calcValues.indexerRewards + ); + } else { + assertEq(afterServiceProvider.tokensStaked, beforeValues.serviceProvider.tokensStaked); + } + assertEq(afterServiceProvider.tokensProvisioned, beforeValues.serviceProvider.tokensProvisioned); + assertEq( + afterServiceProvider.__DEPRECATED_tokensAllocated + beforeValues.allocation.tokens, + beforeValues.serviceProvider.__DEPRECATED_tokensAllocated + ); + assertEq( + afterServiceProvider.__DEPRECATED_tokensLocked, + beforeValues.serviceProvider.__DEPRECATED_tokensLocked + ); + assertEq( + afterServiceProvider.__DEPRECATED_tokensLockedUntil, + beforeValues.serviceProvider.__DEPRECATED_tokensLockedUntil + ); + + assertEq(afterSubgraphAllocations + beforeValues.allocation.tokens, beforeValues.subgraphAllocations); + + if (beforeValues.allocation.tokens > 0 && isAuth && poi != 0 && beforeValues.pool.tokens > 0) { + assertEq(afterPool.tokens, beforeValues.pool.tokens + calcValues.delegatorRewards); + } else { + assertEq(afterPool.tokens, beforeValues.pool.tokens); + } + } + + // use struct to avoid 'stack too deep' error + struct BeforeValues_Collect { + IHorizonStakingExtension.Allocation allocation; + DelegationPoolInternalTest pool; + ServiceProviderInternal serviceProvider; + uint256 stakingBalance; + uint256 senderBalance; + uint256 curationBalance; + uint256 beneficiaryBalance; + } + struct CalcValues_Collect { + uint256 protocolTaxTokens; + uint256 queryFees; + uint256 curationCutTokens; + uint256 newRebates; + uint256 payment; + uint256 delegationFeeCut; + } + struct AfterValues_Collect { + IHorizonStakingExtension.Allocation allocation; + DelegationPoolInternalTest pool; + ServiceProviderInternal serviceProvider; + uint256 stakingBalance; + uint256 senderBalance; + uint256 curationBalance; + uint256 beneficiaryBalance; + } + + function _collect(uint256 tokens, address allocationId) internal { + (, address msgSender, ) = vm.readCallers(); + + // before + BeforeValues_Collect memory beforeValues; + beforeValues.allocation = staking.getAllocation(allocationId); + beforeValues.pool = _getStorage_DelegationPoolInternal( + beforeValues.allocation.indexer, + subgraphDataServiceLegacyAddress, + true + ); + beforeValues.serviceProvider = _getStorage_ServiceProviderInternal(beforeValues.allocation.indexer); + + (uint32 curationPercentage, uint32 protocolPercentage) = _getStorage_ProtocolTaxAndCuration(); + address rewardsDestination = _getStorage_RewardsDestination(beforeValues.allocation.indexer); + + beforeValues.stakingBalance = token.balanceOf(address(staking)); + beforeValues.senderBalance = token.balanceOf(msgSender); + beforeValues.curationBalance = token.balanceOf(address(curation)); + beforeValues.beneficiaryBalance = token.balanceOf(rewardsDestination); + + // calc some stuff + CalcValues_Collect memory calcValues; + calcValues.protocolTaxTokens = tokens.mulPPMRoundUp(protocolPercentage); + calcValues.queryFees = tokens - calcValues.protocolTaxTokens; + calcValues.curationCutTokens = 0; + if (curation.isCurated(beforeValues.allocation.subgraphDeploymentID)) { + calcValues.curationCutTokens = calcValues.queryFees.mulPPMRoundUp(curationPercentage); + calcValues.queryFees -= calcValues.curationCutTokens; + } + calcValues.newRebates = ExponentialRebates.exponentialRebates( + calcValues.queryFees + beforeValues.allocation.collectedFees, + beforeValues.allocation.tokens, + alphaNumerator, + alphaDenominator, + lambdaNumerator, + lambdaDenominator + ); + calcValues.payment = calcValues.newRebates > calcValues.queryFees + ? calcValues.queryFees + : calcValues.newRebates; + calcValues.delegationFeeCut = 0; + if (beforeValues.pool.tokens > 0) { + calcValues.delegationFeeCut = + calcValues.payment - + calcValues.payment.mulPPM(beforeValues.pool.__DEPRECATED_queryFeeCut); + calcValues.payment -= calcValues.delegationFeeCut; + } + + // staking.collect() + if (tokens > 0) { + vm.expectEmit(address(staking)); + emit IHorizonStakingExtension.RebateCollected( + msgSender, + beforeValues.allocation.indexer, + beforeValues.allocation.subgraphDeploymentID, + allocationId, + epochManager.currentEpoch(), + tokens, + calcValues.protocolTaxTokens, + calcValues.curationCutTokens, + calcValues.queryFees, + calcValues.payment, + calcValues.delegationFeeCut + ); + } + staking.collect(tokens, allocationId); + + // after + AfterValues_Collect memory afterValues; + afterValues.allocation = staking.getAllocation(allocationId); + afterValues.pool = _getStorage_DelegationPoolInternal( + beforeValues.allocation.indexer, + subgraphDataServiceLegacyAddress, + true + ); + afterValues.serviceProvider = _getStorage_ServiceProviderInternal(beforeValues.allocation.indexer); + afterValues.stakingBalance = token.balanceOf(address(staking)); + afterValues.senderBalance = token.balanceOf(msgSender); + afterValues.curationBalance = token.balanceOf(address(curation)); + afterValues.beneficiaryBalance = token.balanceOf(rewardsDestination); + + // assert + assertEq(afterValues.senderBalance + tokens, beforeValues.senderBalance); + assertEq(afterValues.curationBalance, beforeValues.curationBalance + calcValues.curationCutTokens); + if (rewardsDestination != address(0)) { + assertEq(afterValues.beneficiaryBalance, beforeValues.beneficiaryBalance + calcValues.payment); + assertEq(afterValues.stakingBalance, beforeValues.stakingBalance + calcValues.delegationFeeCut); + } else { + assertEq(afterValues.beneficiaryBalance, beforeValues.beneficiaryBalance); + assertEq( + afterValues.stakingBalance, + beforeValues.stakingBalance + calcValues.delegationFeeCut + calcValues.payment + ); + } + + assertEq( + afterValues.allocation.collectedFees, + beforeValues.allocation.collectedFees + tokens - calcValues.protocolTaxTokens - calcValues.curationCutTokens + ); + assertEq(afterValues.allocation.indexer, beforeValues.allocation.indexer); + assertEq(afterValues.allocation.subgraphDeploymentID, beforeValues.allocation.subgraphDeploymentID); + assertEq(afterValues.allocation.tokens, beforeValues.allocation.tokens); + assertEq(afterValues.allocation.createdAtEpoch, beforeValues.allocation.createdAtEpoch); + assertEq(afterValues.allocation.closedAtEpoch, beforeValues.allocation.closedAtEpoch); + assertEq( + afterValues.allocation.accRewardsPerAllocatedToken, + beforeValues.allocation.accRewardsPerAllocatedToken + ); + assertEq( + afterValues.allocation.distributedRebates, + beforeValues.allocation.distributedRebates + calcValues.newRebates + ); + + assertEq(afterValues.pool.tokens, beforeValues.pool.tokens + calcValues.delegationFeeCut); + assertEq(afterValues.pool.shares, beforeValues.pool.shares); + assertEq(afterValues.pool.tokensThawing, beforeValues.pool.tokensThawing); + assertEq(afterValues.pool.sharesThawing, beforeValues.pool.sharesThawing); + assertEq(afterValues.pool.thawingNonce, beforeValues.pool.thawingNonce); + + assertEq(afterValues.serviceProvider.tokensProvisioned, beforeValues.serviceProvider.tokensProvisioned); + if (rewardsDestination != address(0)) { + assertEq(afterValues.serviceProvider.tokensStaked, beforeValues.serviceProvider.tokensStaked); + } else { + assertEq( + afterValues.serviceProvider.tokensStaked, + beforeValues.serviceProvider.tokensStaked + calcValues.payment + ); + } + } + + /* + * STORAGE HELPERS + */ + function _getStorage_ServiceProviderInternal( + address serviceProvider + ) internal view returns (ServiceProviderInternal memory) { + uint256 slotNumber = 14; + uint256 baseSlotUint = uint256(keccak256(abi.encode(serviceProvider, slotNumber))); + + ServiceProviderInternal memory serviceProviderInternal = ServiceProviderInternal({ + tokensStaked: uint256(vm.load(address(staking), bytes32(baseSlotUint))), + __DEPRECATED_tokensAllocated: uint256(vm.load(address(staking), bytes32(baseSlotUint + 1))), + __DEPRECATED_tokensLocked: uint256(vm.load(address(staking), bytes32(baseSlotUint + 2))), + __DEPRECATED_tokensLockedUntil: uint256(vm.load(address(staking), bytes32(baseSlotUint + 3))), + tokensProvisioned: uint256(vm.load(address(staking), bytes32(baseSlotUint + 4))) + }); + + return serviceProviderInternal; + } + + function _getStorage_OperatorAuth( + address serviceProvider, + address verifier, + address operator, + bool legacy + ) internal view returns (bool) { + uint256 slotNumber = legacy ? 21 : 31; + uint256 slot; + + if (legacy) { + slot = uint256(keccak256(abi.encode(operator, keccak256(abi.encode(serviceProvider, slotNumber))))); + } else { + slot = uint256( + keccak256( + abi.encode( + operator, + keccak256(abi.encode(verifier, keccak256(abi.encode(serviceProvider, slotNumber)))) + ) + ) + ); + } + return vm.load(address(staking), bytes32(slot)) == bytes32(uint256(1)); + } + + function _setStorage_DeprecatedThawingPeriod(uint32 _thawingPeriod) internal { + uint256 slot = 13; + + // Read the current value of the slot + uint256 currentSlotValue = uint256(vm.load(address(staking), bytes32(slot))); + + // Create a mask to clear the bits for __DEPRECATED_thawingPeriod (bits 0-31) + uint256 mask = ~(uint256(0xFFFFFFFF)); // Mask to clear the first 32 bits + + // Clear the bits for __DEPRECATED_thawingPeriod and set the new value + uint256 newSlotValue = (currentSlotValue & mask) | uint256(_thawingPeriod); + + // Store the updated value back into the slot + vm.store(address(staking), bytes32(slot), bytes32(newSlotValue)); + } + + function _setStorage_ServiceProvider( + address _indexer, + uint256 _tokensStaked, + uint256 _tokensAllocated, + uint256 _tokensLocked, + uint256 _tokensLockedUntil, + uint256 _tokensProvisioned + ) internal { + uint256 serviceProviderSlot = 14; + bytes32 serviceProviderBaseSlot = keccak256(abi.encode(_indexer, serviceProviderSlot)); + vm.store(address(staking), bytes32(uint256(serviceProviderBaseSlot)), bytes32(_tokensStaked)); + vm.store(address(staking), bytes32(uint256(serviceProviderBaseSlot) + 1), bytes32(_tokensAllocated)); + vm.store(address(staking), bytes32(uint256(serviceProviderBaseSlot) + 2), bytes32(_tokensLocked)); + vm.store(address(staking), bytes32(uint256(serviceProviderBaseSlot) + 3), bytes32(_tokensLockedUntil)); + vm.store(address(staking), bytes32(uint256(serviceProviderBaseSlot) + 4), bytes32(_tokensProvisioned)); + } + + // DelegationPoolInternal contains a mapping, solidity doesn't allow constructing structs with + // nested mappings on memory: "Struct containing a (nested) mapping cannot be constructed" + // So we use a custom struct here and remove the nested mapping which we don't need anyways + struct DelegationPoolInternalTest { + // (Deprecated) Time, in blocks, an indexer must wait before updating delegation parameters + uint32 __DEPRECATED_cooldownBlocks; + // (Deprecated) Percentage of indexing rewards for the service provider, in PPM + uint32 __DEPRECATED_indexingRewardCut; + // (Deprecated) Percentage of query fees for the service provider, in PPM + uint32 __DEPRECATED_queryFeeCut; + // (Deprecated) Block when the delegation parameters were last updated + uint256 __DEPRECATED_updatedAtBlock; + // Total tokens as pool reserves + uint256 tokens; + // Total shares minted in the pool + uint256 shares; + // Delegation details by delegator + uint256 _gap_delegators_mapping; + // Tokens thawing in the pool + uint256 tokensThawing; + // Shares representing the thawing tokens + uint256 sharesThawing; + // Thawing nonce + uint256 thawingNonce; + } + + function _getStorage_DelegationPoolInternal( + address serviceProvider, + address verifier, + bool legacy + ) internal view returns (DelegationPoolInternalTest memory) { + uint256 slotNumber = legacy ? 20 : 33; + uint256 baseSlot; + if (legacy) { + baseSlot = uint256(keccak256(abi.encode(serviceProvider, slotNumber))); + } else { + baseSlot = uint256(keccak256(abi.encode(verifier, keccak256(abi.encode(serviceProvider, slotNumber))))); + } + + uint256 packedData = uint256(vm.load(address(staking), bytes32(baseSlot))); + + DelegationPoolInternalTest memory delegationPoolInternal = DelegationPoolInternalTest({ + __DEPRECATED_cooldownBlocks: uint32(packedData & 0xFFFFFFFF), + __DEPRECATED_indexingRewardCut: uint32((packedData >> 32) & 0xFFFFFFFF), + __DEPRECATED_queryFeeCut: uint32((packedData >> 64) & 0xFFFFFFFF), + __DEPRECATED_updatedAtBlock: uint256(vm.load(address(staking), bytes32(baseSlot + 1))), + tokens: uint256(vm.load(address(staking), bytes32(baseSlot + 2))), + shares: uint256(vm.load(address(staking), bytes32(baseSlot + 3))), + _gap_delegators_mapping: uint256(vm.load(address(staking), bytes32(baseSlot + 4))), + tokensThawing: uint256(vm.load(address(staking), bytes32(baseSlot + 5))), + sharesThawing: uint256(vm.load(address(staking), bytes32(baseSlot + 6))), + thawingNonce: uint256(vm.load(address(staking), bytes32(baseSlot + 7))) + }); + + return delegationPoolInternal; + } + + function _getStorage_Delegation( + address serviceProvider, + address verifier, + address delegator, + bool legacy + ) internal view returns (DelegationInternal memory) { + uint256 slotNumber = legacy ? 20 : 33; + uint256 baseSlot; + + // DelegationPool + if (legacy) { + baseSlot = uint256(keccak256(abi.encode(serviceProvider, slotNumber))); + } else { + baseSlot = uint256(keccak256(abi.encode(verifier, keccak256(abi.encode(serviceProvider, slotNumber))))); + } + + // delegators slot in DelegationPool + baseSlot += 4; + + // Delegation + baseSlot = uint256(keccak256(abi.encode(delegator, baseSlot))); + + DelegationInternal memory delegation = DelegationInternal({ + shares: uint256(vm.load(address(staking), bytes32(baseSlot))), + __DEPRECATED_tokensLocked: uint256(vm.load(address(staking), bytes32(baseSlot + 1))), + __DEPRECATED_tokensLockedUntil: uint256(vm.load(address(staking), bytes32(baseSlot + 2))) + }); + + return delegation; + } + + function _setStorage_allocation( + IHorizonStakingExtension.Allocation memory allocation, + address allocationId, + uint256 tokens + ) internal { + // __DEPRECATED_allocations + uint256 allocationsSlot = 15; + bytes32 allocationBaseSlot = keccak256(abi.encode(allocationId, allocationsSlot)); + vm.store(address(staking), allocationBaseSlot, bytes32(uint256(uint160(allocation.indexer)))); + vm.store(address(staking), bytes32(uint256(allocationBaseSlot) + 1), allocation.subgraphDeploymentID); + vm.store(address(staking), bytes32(uint256(allocationBaseSlot) + 2), bytes32(tokens)); + vm.store(address(staking), bytes32(uint256(allocationBaseSlot) + 3), bytes32(allocation.createdAtEpoch)); + vm.store(address(staking), bytes32(uint256(allocationBaseSlot) + 4), bytes32(allocation.closedAtEpoch)); + vm.store(address(staking), bytes32(uint256(allocationBaseSlot) + 5), bytes32(allocation.collectedFees)); + vm.store( + address(staking), + bytes32(uint256(allocationBaseSlot) + 6), + bytes32(allocation.__DEPRECATED_effectiveAllocation) + ); + vm.store( + address(staking), + bytes32(uint256(allocationBaseSlot) + 7), + bytes32(allocation.accRewardsPerAllocatedToken) + ); + vm.store(address(staking), bytes32(uint256(allocationBaseSlot) + 8), bytes32(allocation.distributedRebates)); + + // _serviceProviders + uint256 serviceProviderSlot = 14; + bytes32 serviceProviderBaseSlot = keccak256(abi.encode(allocation.indexer, serviceProviderSlot)); + uint256 currentTokensStaked = uint256(vm.load(address(staking), serviceProviderBaseSlot)); + uint256 currentTokensProvisioned = uint256( + vm.load(address(staking), bytes32(uint256(serviceProviderBaseSlot) + 1)) + ); + vm.store( + address(staking), + bytes32(uint256(serviceProviderBaseSlot) + 0), + bytes32(currentTokensStaked + tokens) + ); + vm.store( + address(staking), + bytes32(uint256(serviceProviderBaseSlot) + 1), + bytes32(currentTokensProvisioned + tokens) + ); + + // __DEPRECATED_subgraphAllocations + uint256 subgraphsAllocationsSlot = 16; + bytes32 subgraphAllocationsBaseSlot = keccak256( + abi.encode(allocation.subgraphDeploymentID, subgraphsAllocationsSlot) + ); + uint256 currentAllocatedTokens = uint256(vm.load(address(staking), subgraphAllocationsBaseSlot)); + vm.store(address(staking), subgraphAllocationsBaseSlot, bytes32(currentAllocatedTokens + tokens)); + } + + function _getStorage_SubgraphAllocations(bytes32 subgraphDeploymentID) internal view returns (uint256) { + uint256 subgraphsAllocationsSlot = 16; + bytes32 subgraphAllocationsBaseSlot = keccak256(abi.encode(subgraphDeploymentID, subgraphsAllocationsSlot)); + return uint256(vm.load(address(staking), subgraphAllocationsBaseSlot)); + } + + function _setStorage_RewardsDestination(address serviceProvider, address destination) internal { + uint256 rewardsDestinationSlot = 23; + bytes32 rewardsDestinationSlotBaseSlot = keccak256(abi.encode(serviceProvider, rewardsDestinationSlot)); + vm.store(address(staking), rewardsDestinationSlotBaseSlot, bytes32(uint256(uint160(destination)))); + } + + function _getStorage_RewardsDestination(address serviceProvider) internal view returns (address) { + uint256 rewardsDestinationSlot = 23; + bytes32 rewardsDestinationSlotBaseSlot = keccak256(abi.encode(serviceProvider, rewardsDestinationSlot)); + return address(uint160(uint256(vm.load(address(staking), rewardsDestinationSlotBaseSlot)))); + } + + function _setStorage_MaxAllocationEpochs(uint256 maxAllocationEpochs) internal { + uint256 slot = 13; + + // Read the current value of the storage slot + uint256 currentSlotValue = uint256(vm.load(address(staking), bytes32(slot))); + + // Mask to clear the specific bits for __DEPRECATED_maxAllocationEpochs (bits 128-159) + uint256 mask = ~(uint256(0xFFFFFFFF) << 128); + + // Clear the bits and set the new maxAllocationEpochs value + uint256 newSlotValue = (currentSlotValue & mask) | (uint256(maxAllocationEpochs) << 128); + + // Store the updated value back into the slot + vm.store(address(staking), bytes32(slot), bytes32(newSlotValue)); + + uint256 readMaxAllocationEpochs = _getStorage_MaxAllocationEpochs(); + assertEq(readMaxAllocationEpochs, maxAllocationEpochs); + } + + function _getStorage_MaxAllocationEpochs() internal view returns (uint256) { + uint256 slot = 13; + + // Read the current value of the storage slot + uint256 currentSlotValue = uint256(vm.load(address(staking), bytes32(slot))); + + // Mask to isolate bits 128-159 + uint256 mask = uint256(0xFFFFFFFF) << 128; + + // Extract the maxAllocationEpochs by masking and shifting + uint256 maxAllocationEpochs = (currentSlotValue & mask) >> 128; + + return maxAllocationEpochs; + } + + function _setStorage_DelegationPool( + address serviceProvider, + uint256 tokens, + uint32 indexingRewardCut, + uint32 queryFeeCut + ) internal { + bytes32 baseSlot = keccak256(abi.encode(serviceProvider, uint256(20))); + bytes32 feeCutValues = bytes32( + (uint256(indexingRewardCut) << uint256(32)) | (uint256(queryFeeCut) << uint256(64)) + ); + bytes32 tokensSlot = bytes32(uint256(baseSlot) + 2); + vm.store(address(staking), baseSlot, feeCutValues); + vm.store(address(staking), tokensSlot, bytes32(tokens)); + } + + function _setStorage_RebateParameters( + uint32 alphaNumerator_, + uint32 alphaDenominator_, + uint32 lambdaNumerator_, + uint32 lambdaDenominator_ + ) internal { + // Store alpha numerator and denominator in slot 13 + uint256 alphaSlot = 13; + + uint256 newAlphaSlotValue; + { + uint256 alphaNumeratorOffset = 160; // Offset for __DEPRECATED_alphaNumerator (20th byte) + uint256 alphaDenominatorOffset = 192; // Offset for __DEPRECATED_alphaDenominator (24th byte) + + // Read current value of the slot + uint256 currentAlphaSlotValue = uint256(vm.load(address(staking), bytes32(alphaSlot))); + + // Create a mask to clear the bits for alphaNumerator and alphaDenominator + uint256 alphaMask = ~(uint256(0xFFFFFFFF) << alphaNumeratorOffset) & + ~(uint256(0xFFFFFFFF) << alphaDenominatorOffset); + + // Clear and set new values + newAlphaSlotValue = + (currentAlphaSlotValue & alphaMask) | + (uint256(alphaNumerator_) << alphaNumeratorOffset) | + (uint256(alphaDenominator_) << alphaDenominatorOffset); + } + + // Store the updated value back into the slot + vm.store(address(staking), bytes32(alphaSlot), bytes32(newAlphaSlotValue)); + + // Store lambda numerator and denominator in slot 25 + uint256 lambdaSlot = 25; + + uint256 newLambdaSlotValue; + { + uint256 lambdaNumeratorOffset = 160; // Offset for lambdaNumerator (20th byte) + uint256 lambdaDenominatorOffset = 192; // Offset for lambdaDenominator (24th byte) + + // Read current value of the slot + uint256 currentLambdaSlotValue = uint256(vm.load(address(staking), bytes32(lambdaSlot))); + + // Create a mask to clear the bits for lambdaNumerator and lambdaDenominator + uint256 lambdaMask = ~(uint256(0xFFFFFFFF) << lambdaNumeratorOffset) & + ~(uint256(0xFFFFFFFF) << lambdaDenominatorOffset); + + // Clear and set new values + newLambdaSlotValue = + (currentLambdaSlotValue & lambdaMask) | + (uint256(lambdaNumerator_) << lambdaNumeratorOffset) | + (uint256(lambdaDenominator_) << lambdaDenominatorOffset); + } + + // Store the updated value back into the slot + vm.store(address(staking), bytes32(lambdaSlot), bytes32(newLambdaSlotValue)); + + // Verify the storage + ( + uint32 readAlphaNumerator, + uint32 readAlphaDenominator, + uint32 readLambdaNumerator, + uint32 readLambdaDenominator + ) = _getStorage_RebateParameters(); + assertEq(readAlphaNumerator, alphaNumerator_); + assertEq(readAlphaDenominator, alphaDenominator_); + assertEq(readLambdaNumerator, lambdaNumerator_); + assertEq(readLambdaDenominator, lambdaDenominator_); + } + + function _getStorage_RebateParameters() internal view returns (uint32, uint32, uint32, uint32) { + // Read alpha numerator and denominator + uint256 alphaSlot = 13; + uint256 alphaValues = uint256(vm.load(address(staking), bytes32(alphaSlot))); + uint32 alphaNumerator_ = uint32(alphaValues >> 160); + uint32 alphaDenominator_ = uint32(alphaValues >> 192); + + // Read lambda numerator and denominator + uint256 lambdaSlot = 25; + uint256 lambdaValues = uint256(vm.load(address(staking), bytes32(lambdaSlot))); + uint32 lambdaNumerator_ = uint32(lambdaValues >> 160); + uint32 lambdaDenominator_ = uint32(lambdaValues >> 192); + + return (alphaNumerator_, alphaDenominator_, lambdaNumerator_, lambdaDenominator_); + } + + // function _setStorage_ProtocolTaxAndCuration(uint32 curationPercentage, uint32 taxPercentage) private { + // bytes32 slot = bytes32(uint256(13)); + // uint256 curationOffset = 4; + // uint256 protocolTaxOffset = 8; + // bytes32 originalValue = vm.load(address(staking), slot); + + // bytes32 newProtocolTaxValue = bytes32( + // ((uint256(originalValue) & + // ~((0xFFFFFFFF << (8 * curationOffset)) | (0xFFFFFFFF << (8 * protocolTaxOffset)))) | + // (uint256(curationPercentage) << (8 * curationOffset))) | + // (uint256(taxPercentage) << (8 * protocolTaxOffset)) + // ); + // vm.store(address(staking), slot, newProtocolTaxValue); + + // (uint32 readCurationPercentage, uint32 readTaxPercentage) = _getStorage_ProtocolTaxAndCuration(); + // assertEq(readCurationPercentage, curationPercentage); + // } + + function _setStorage_ProtocolTaxAndCuration(uint32 curationPercentage, uint32 taxPercentage) internal { + bytes32 slot = bytes32(uint256(13)); + + // Offsets for the percentages + uint256 curationOffset = 32; // __DEPRECATED_curationPercentage (2nd uint32, bits 32-63) + uint256 protocolTaxOffset = 64; // __DEPRECATED_protocolPercentage (3rd uint32, bits 64-95) + + // Read the current slot value + uint256 originalValue = uint256(vm.load(address(staking), slot)); + + // Create masks to clear the specific bits for the two percentages + uint256 mask = ~(uint256(0xFFFFFFFF) << curationOffset) & ~(uint256(0xFFFFFFFF) << protocolTaxOffset); // Mask for curationPercentage // Mask for protocolTax + + // Clear the existing bits and set the new values + uint256 newSlotValue = (originalValue & mask) | + (uint256(curationPercentage) << curationOffset) | + (uint256(taxPercentage) << protocolTaxOffset); + + // Store the updated slot value + vm.store(address(staking), slot, bytes32(newSlotValue)); + + // Verify the values were set correctly + (uint32 readCurationPercentage, uint32 readTaxPercentage) = _getStorage_ProtocolTaxAndCuration(); + assertEq(readCurationPercentage, curationPercentage); + assertEq(readTaxPercentage, taxPercentage); + } + + function _getStorage_ProtocolTaxAndCuration() internal view returns (uint32, uint32) { + bytes32 slot = bytes32(uint256(13)); + bytes32 value = vm.load(address(staking), slot); + uint32 curationPercentage = uint32(uint256(value) >> 32); + uint32 taxPercentage = uint32(uint256(value) >> 64); + return (curationPercentage, taxPercentage); + } + + /* + * MISC: private functions to help with testing + */ + // use struct to avoid 'stack too deep' error + struct CalcValues_ThawRequestData { + uint256 tokensThawed; + uint256 tokensThawing; + uint256 sharesThawed; + uint256 sharesThawing; + ThawRequest[] thawRequestsFulfilledList; + bytes32[] thawRequestsFulfilledListIds; + uint256[] thawRequestsFulfilledListTokens; + } + + struct ThawingData { + uint256 tokensThawed; + uint256 tokensThawing; + uint256 sharesThawing; + uint256 thawRequestsFulfilled; + } + + struct Params_CalcThawRequestData { + IHorizonStakingTypes.ThawRequestType thawRequestType; + address serviceProvider; + address verifier; + address owner; + uint256 iterations; + bool delegation; + } + + function calcThawRequestData( + Params_CalcThawRequestData memory params + ) private view returns (CalcValues_ThawRequestData memory) { + LinkedList.List memory thawRequestList = _getThawRequestList( + params.thawRequestType, + params.serviceProvider, + params.verifier, + params.owner + ); + if (thawRequestList.count == 0) { + return CalcValues_ThawRequestData(0, 0, 0, 0, new ThawRequest[](0), new bytes32[](0), new uint256[](0)); + } + + Provision memory prov = staking.getProvision(params.serviceProvider, params.verifier); + DelegationPool memory pool = staking.getDelegationPool(params.serviceProvider, params.verifier); + + uint256 tokensThawed = 0; + uint256 sharesThawed = 0; + uint256 tokensThawing = params.delegation ? pool.tokensThawing : prov.tokensThawing; + uint256 sharesThawing = params.delegation ? pool.sharesThawing : prov.sharesThawing; + uint256 thawRequestsFulfilled = 0; + + bytes32 thawRequestId = thawRequestList.head; + while (thawRequestId != bytes32(0) && (params.iterations == 0 || thawRequestsFulfilled < params.iterations)) { + ThawRequest memory thawRequest = _getThawRequest(params.thawRequestType, thawRequestId); + bool isThawRequestValid = thawRequest.thawingNonce == + (params.delegation ? pool.thawingNonce : prov.thawingNonce); + if (thawRequest.thawingUntil <= block.timestamp) { + thawRequestsFulfilled++; + if (isThawRequestValid) { + uint256 tokens = params.delegation + ? (thawRequest.shares * pool.tokensThawing) / pool.sharesThawing + : (thawRequest.shares * prov.tokensThawing) / prov.sharesThawing; + tokensThawed += tokens; + tokensThawing -= tokens; + sharesThawed += thawRequest.shares; + sharesThawing -= thawRequest.shares; + } + } else { + break; + } + thawRequestId = thawRequest.nextRequest; + } + + // we need to do a second pass because solidity doesnt allow dynamic arrays on memory + CalcValues_ThawRequestData memory thawRequestData; + thawRequestData.tokensThawed = tokensThawed; + thawRequestData.tokensThawing = tokensThawing; + thawRequestData.sharesThawed = sharesThawed; + thawRequestData.sharesThawing = sharesThawing; + thawRequestData.thawRequestsFulfilledList = new ThawRequest[](thawRequestsFulfilled); + thawRequestData.thawRequestsFulfilledListIds = new bytes32[](thawRequestsFulfilled); + thawRequestData.thawRequestsFulfilledListTokens = new uint256[](thawRequestsFulfilled); + uint256 i = 0; + thawRequestId = thawRequestList.head; + while (thawRequestId != bytes32(0) && (params.iterations == 0 || i < params.iterations)) { + ThawRequest memory thawRequest = _getThawRequest(params.thawRequestType, thawRequestId); + bool isThawRequestValid = thawRequest.thawingNonce == + (params.delegation ? pool.thawingNonce : prov.thawingNonce); + + if (thawRequest.thawingUntil <= block.timestamp) { + if (isThawRequestValid) { + thawRequestData.thawRequestsFulfilledListTokens[i] = params.delegation + ? (thawRequest.shares * pool.tokensThawing) / pool.sharesThawing + : (thawRequest.shares * prov.tokensThawing) / prov.sharesThawing; + } + thawRequestData.thawRequestsFulfilledListIds[i] = thawRequestId; + thawRequestData.thawRequestsFulfilledList[i] = _getThawRequest(params.thawRequestType, thawRequestId); + thawRequestId = thawRequestData.thawRequestsFulfilledList[i].nextRequest; + i++; + } else { + break; + } + thawRequestId = thawRequest.nextRequest; + } + + assertEq(thawRequestsFulfilled, thawRequestData.thawRequestsFulfilledList.length); + assertEq(thawRequestsFulfilled, thawRequestData.thawRequestsFulfilledListIds.length); + assertEq(thawRequestsFulfilled, thawRequestData.thawRequestsFulfilledListTokens.length); + + return thawRequestData; + } + + function _getThawRequestList( + IHorizonStakingTypes.ThawRequestType thawRequestType, + address serviceProvider, + address verifier, + address owner + ) private view returns (LinkedList.List memory) { + return staking.getThawRequestList(thawRequestType, serviceProvider, verifier, owner); + } + + function _getThawRequest( + IHorizonStakingTypes.ThawRequestType thawRequestType, + bytes32 thawRequestId + ) private view returns (ThawRequest memory) { + return staking.getThawRequest(thawRequestType, thawRequestId); + } +} diff --git a/packages/horizon/test/unit/shared/payments-escrow/PaymentsEscrowShared.t.sol b/packages/horizon/test/unit/shared/payments-escrow/PaymentsEscrowShared.t.sol new file mode 100644 index 000000000..0e6c91b81 --- /dev/null +++ b/packages/horizon/test/unit/shared/payments-escrow/PaymentsEscrowShared.t.sol @@ -0,0 +1,48 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { IPaymentsEscrow } from "../../../../contracts/interfaces/IPaymentsEscrow.sol"; +import { GraphBaseTest } from "../../GraphBase.t.sol"; + +abstract contract PaymentsEscrowSharedTest is GraphBaseTest { + /* + * MODIFIERS + */ + + modifier useGateway() { + vm.startPrank(users.gateway); + _; + vm.stopPrank(); + } + + /* + * HELPERS + */ + + function _depositTokens(address _collector, address _receiver, uint256 _tokens) internal { + (, address msgSender, ) = vm.readCallers(); + (uint256 escrowBalanceBefore, , ) = escrow.escrowAccounts(msgSender, _collector, _receiver); + token.approve(address(escrow), _tokens); + + vm.expectEmit(address(escrow)); + emit IPaymentsEscrow.Deposit(msgSender, _collector, _receiver, _tokens); + escrow.deposit(_collector, _receiver, _tokens); + + (uint256 escrowBalanceAfter, , ) = escrow.escrowAccounts(msgSender, _collector, _receiver); + assertEq(escrowBalanceAfter - _tokens, escrowBalanceBefore); + } + + function _depositToTokens(address _payer, address _collector, address _receiver, uint256 _tokens) internal { + (uint256 escrowBalanceBefore, , ) = escrow.escrowAccounts(_payer, _collector, _receiver); + token.approve(address(escrow), _tokens); + + vm.expectEmit(address(escrow)); + emit IPaymentsEscrow.Deposit(_payer, _collector, _receiver, _tokens); + escrow.depositTo(_payer, _collector, _receiver, _tokens); + + (uint256 escrowBalanceAfter, , ) = escrow.escrowAccounts(_payer, _collector, _receiver); + assertEq(escrowBalanceAfter - _tokens, escrowBalanceBefore); + } +} diff --git a/packages/horizon/test/unit/staking/HorizonStaking.t.sol b/packages/horizon/test/unit/staking/HorizonStaking.t.sol new file mode 100644 index 000000000..5dd4d6153 --- /dev/null +++ b/packages/horizon/test/unit/staking/HorizonStaking.t.sol @@ -0,0 +1,85 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; +import { stdStorage, StdStorage } from "forge-std/Test.sol"; + +import { HorizonStakingSharedTest } from "../shared/horizon-staking/HorizonStakingShared.t.sol"; + +contract HorizonStakingTest is HorizonStakingSharedTest { + using stdStorage for StdStorage; + + /* + * MODIFIERS + */ + + modifier usePausedStaking() { + vm.startPrank(users.governor); + controller.setPaused(true); + vm.stopPrank(); + _; + } + + modifier useThawAndDeprovision(uint256 amount, uint64 thawingPeriod) { + vm.assume(amount > 0); + _thaw(users.indexer, subgraphDataServiceAddress, amount); + skip(thawingPeriod + 1); + _deprovision(users.indexer, subgraphDataServiceAddress, 0); + _; + } + + modifier useDelegation(uint256 delegationAmount) { + address msgSender; + (, msgSender, ) = vm.readCallers(); + vm.assume(delegationAmount >= MIN_DELEGATION); + vm.assume(delegationAmount <= MAX_STAKING_TOKENS); + vm.startPrank(users.delegator); + _delegate(users.indexer, subgraphDataServiceAddress, delegationAmount, 0); + vm.startPrank(msgSender); + _; + } + + modifier useLockedVerifier(address verifier) { + address msgSender; + (, msgSender, ) = vm.readCallers(); + resetPrank(users.governor); + _setAllowedLockedVerifier(verifier, true); + resetPrank(msgSender); + _; + } + + modifier useDelegationSlashing() { + address msgSender; + (, msgSender, ) = vm.readCallers(); + resetPrank(users.governor); + staking.setDelegationSlashingEnabled(); + resetPrank(msgSender); + _; + } + + modifier useUndelegate(uint256 shares) { + resetPrank(users.delegator); + + DelegationPoolInternalTest memory pool = _getStorage_DelegationPoolInternal( + users.indexer, + subgraphDataServiceAddress, + false + ); + DelegationInternal memory delegation = _getStorage_Delegation( + users.indexer, + subgraphDataServiceAddress, + users.delegator, + false + ); + + shares = bound(shares, 1, delegation.shares); + uint256 tokens = (shares * (pool.tokens - pool.tokensThawing)) / pool.shares; + if (shares < delegation.shares) { + uint256 remainingTokens = (shares * (pool.tokens - pool.tokensThawing - tokens)) / pool.shares; + vm.assume(remainingTokens >= MIN_DELEGATION); + } + + _undelegate(users.indexer, subgraphDataServiceAddress, shares); + _; + } +} diff --git a/packages/horizon/test/unit/staking/allocation/allocation.t.sol b/packages/horizon/test/unit/staking/allocation/allocation.t.sol new file mode 100644 index 000000000..64b830be0 --- /dev/null +++ b/packages/horizon/test/unit/staking/allocation/allocation.t.sol @@ -0,0 +1,33 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { HorizonStakingTest } from "../HorizonStaking.t.sol"; +import { IHorizonStakingExtension } from "../../../../contracts/interfaces/internal/IHorizonStakingExtension.sol"; + +contract HorizonStakingAllocationTest is HorizonStakingTest { + /* + * TESTS + */ + + function testAllocation_GetAllocationState_Active(uint256 tokens) public useIndexer useAllocation(tokens) { + IHorizonStakingExtension.AllocationState state = staking.getAllocationState(_allocationId); + assertEq(uint16(state), uint16(IHorizonStakingExtension.AllocationState.Active)); + } + + function testAllocation_GetAllocationState_Null() public view { + IHorizonStakingExtension.AllocationState state = staking.getAllocationState(_allocationId); + assertEq(uint16(state), uint16(IHorizonStakingExtension.AllocationState.Null)); + } + + function testAllocation_IsAllocation(uint256 tokens) public useIndexer useAllocation(tokens) { + bool isAllocation = staking.isAllocation(_allocationId); + assertTrue(isAllocation); + } + + function testAllocation_IsNotAllocation() public view { + bool isAllocation = staking.isAllocation(_allocationId); + assertFalse(isAllocation); + } +} diff --git a/packages/horizon/test/unit/staking/allocation/close.t.sol b/packages/horizon/test/unit/staking/allocation/close.t.sol new file mode 100644 index 000000000..5bb3bc979 --- /dev/null +++ b/packages/horizon/test/unit/staking/allocation/close.t.sol @@ -0,0 +1,116 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { HorizonStakingTest } from "../HorizonStaking.t.sol"; +import { IHorizonStakingExtension } from "../../../../contracts/interfaces/internal/IHorizonStakingExtension.sol"; +import { PPMMath } from "../../../../contracts/libraries/PPMMath.sol"; + +contract HorizonStakingCloseAllocationTest is HorizonStakingTest { + using PPMMath for uint256; + + bytes32 internal constant _poi = keccak256("poi"); + + /* + * MODIFIERS + */ + + modifier useLegacyOperator() { + resetPrank(users.indexer); + _setOperator(subgraphDataServiceLegacyAddress, users.operator, true); + vm.startPrank(users.operator); + _; + vm.stopPrank(); + } + + /* + * TESTS + */ + + function testCloseAllocation(uint256 tokens) public useIndexer useAllocation(1 ether) { + tokens = bound(tokens, 1, MAX_STAKING_TOKENS); + _createProvision(users.indexer, subgraphDataServiceLegacyAddress, tokens, 0, 0); + + // Skip 15 epochs + vm.roll(15); + + _closeAllocation(_allocationId, _poi); + } + + function testCloseAllocation_Operator(uint256 tokens) public useLegacyOperator useAllocation(1 ether) { + tokens = bound(tokens, 1, MAX_STAKING_TOKENS); + _createProvision(users.indexer, subgraphDataServiceLegacyAddress, tokens, 0, 0); + + // Skip 15 epochs + vm.roll(15); + + _closeAllocation(_allocationId, _poi); + } + + function testCloseAllocation_WithBeneficiaryAddress(uint256 tokens) public useIndexer useAllocation(1 ether) { + tokens = bound(tokens, 1, MAX_STAKING_TOKENS); + _createProvision(users.indexer, subgraphDataServiceLegacyAddress, tokens, 0, 0); + + address beneficiary = makeAddr("beneficiary"); + _setStorage_RewardsDestination(users.indexer, beneficiary); + + // Skip 15 epochs + vm.roll(15); + + _closeAllocation(_allocationId, _poi); + } + + function testCloseAllocation_RevertWhen_NotActive() public { + vm.expectRevert("!active"); + staking.closeAllocation(_allocationId, _poi); + } + + function testCloseAllocation_RevertWhen_NotIndexer() public useIndexer useAllocation(1 ether) { + resetPrank(users.delegator); + vm.expectRevert("!auth"); + staking.closeAllocation(_allocationId, _poi); + } + + function testCloseAllocation_AfterMaxEpochs_AnyoneCanClose( + uint256 tokens + ) public useIndexer useAllocation(1 ether) { + tokens = bound(tokens, 1, MAX_STAKING_TOKENS); + _createProvision(users.indexer, subgraphDataServiceLegacyAddress, tokens, 0, 0); + + // Skip to over the max allocation epochs + vm.roll((MAX_ALLOCATION_EPOCHS + 1) * EPOCH_LENGTH + 1); + + resetPrank(users.delegator); + _closeAllocation(_allocationId, 0x0); + } + + function testCloseAllocation_RevertWhen_ZeroTokensNotAuthorized() public useIndexer useAllocation(1 ether) { + _createProvision(users.indexer, subgraphDataServiceLegacyAddress, 100 ether, 0, 0); + + resetPrank(users.delegator); + vm.expectRevert("!auth"); + staking.closeAllocation(_allocationId, 0x0); + } + + function testCloseAllocation_WithDelegation( + uint256 tokens, + uint256 delegationTokens, + uint32 indexingRewardCut + ) public useIndexer useAllocation(1 ether) { + tokens = bound(tokens, 2, MAX_STAKING_TOKENS); + delegationTokens = bound(delegationTokens, 0, MAX_STAKING_TOKENS); + vm.assume(indexingRewardCut <= MAX_PPM); + + uint256 legacyAllocationTokens = tokens / 2; + uint256 provisionTokens = tokens - legacyAllocationTokens; + + _createProvision(users.indexer, subgraphDataServiceLegacyAddress, provisionTokens, 0, 0); + _setStorage_DelegationPool(users.indexer, delegationTokens, indexingRewardCut, 0); + + // Skip 15 epochs + vm.roll(15); + + _closeAllocation(_allocationId, _poi); + } +} diff --git a/packages/horizon/test/unit/staking/allocation/collect.t.sol b/packages/horizon/test/unit/staking/allocation/collect.t.sol new file mode 100644 index 000000000..31a5138b2 --- /dev/null +++ b/packages/horizon/test/unit/staking/allocation/collect.t.sol @@ -0,0 +1,81 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { HorizonStakingTest } from "../HorizonStaking.t.sol"; +import { ExponentialRebates } from "../../../../contracts/staking/libraries/ExponentialRebates.sol"; +import { PPMMath } from "../../../../contracts/libraries/PPMMath.sol"; + +contract HorizonStakingCollectAllocationTest is HorizonStakingTest { + using PPMMath for uint256; + + /* + * TESTS + */ + + function testCollectAllocation_RevertWhen_InvalidAllocationId( + uint256 tokens + ) public useIndexer useAllocation(1 ether) { + vm.expectRevert("!alloc"); + staking.collect(tokens, address(0)); + } + + function testCollectAllocation_RevertWhen_Null(uint256 tokens) public { + vm.expectRevert("!collect"); + staking.collect(tokens, _allocationId); + } + + function testCollect_Tokens( + uint256 allocationTokens, + uint256 collectTokens, + uint256 curationTokens, + uint32 curationPercentage, + uint32 protocolTaxPercentage, + uint256 delegationTokens, + uint32 queryFeeCut + ) public useIndexer useRebateParameters useAllocation(allocationTokens) { + collectTokens = bound(collectTokens, 0, MAX_STAKING_TOKENS); + curationTokens = bound(curationTokens, 0, MAX_STAKING_TOKENS); + delegationTokens = bound(delegationTokens, 0, MAX_STAKING_TOKENS); + vm.assume(curationPercentage <= MAX_PPM); + vm.assume(protocolTaxPercentage <= MAX_PPM); + vm.assume(queryFeeCut <= MAX_PPM); + + resetPrank(users.indexer); + _setStorage_ProtocolTaxAndCuration(curationPercentage, protocolTaxPercentage); + console.log("queryFeeCut", queryFeeCut); + _setStorage_DelegationPool(users.indexer, delegationTokens, 0, queryFeeCut); + curation.signal(_subgraphDeploymentID, curationTokens); + + resetPrank(users.gateway); + approve(address(staking), collectTokens); + _collect(collectTokens, _allocationId); + } + + function testCollect_WithBeneficiaryAddress( + uint256 allocationTokens, + uint256 collectTokens + ) public useIndexer useRebateParameters useAllocation(allocationTokens) { + collectTokens = bound(collectTokens, 0, MAX_STAKING_TOKENS); + + address beneficiary = makeAddr("beneficiary"); + _setStorage_RewardsDestination(users.indexer, beneficiary); + + resetPrank(users.gateway); + approve(address(staking), collectTokens); + _collect(collectTokens, _allocationId); + + uint256 newRebates = ExponentialRebates.exponentialRebates( + collectTokens, + allocationTokens, + alphaNumerator, + alphaDenominator, + lambdaNumerator, + lambdaDenominator + ); + uint256 payment = newRebates > collectTokens ? collectTokens : newRebates; + + assertEq(token.balanceOf(beneficiary), payment); + } +} diff --git a/packages/horizon/test/unit/staking/delegation/addToPool.t.sol b/packages/horizon/test/unit/staking/delegation/addToPool.t.sol new file mode 100644 index 000000000..d07fbc713 --- /dev/null +++ b/packages/horizon/test/unit/staking/delegation/addToPool.t.sol @@ -0,0 +1,161 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { IHorizonStakingMain } from "../../../../contracts/interfaces/internal/IHorizonStakingMain.sol"; +import { HorizonStakingTest } from "../HorizonStaking.t.sol"; + +contract HorizonStakingDelegationAddToPoolTest is HorizonStakingTest { + modifier useValidDelegationAmount(uint256 tokens) { + vm.assume(tokens <= MAX_STAKING_TOKENS); + vm.assume(tokens >= MIN_DELEGATION); + _; + } + + modifier useValidAddToPoolAmount(uint256 tokens) { + vm.assume(tokens > 0); + vm.assume(tokens <= MAX_STAKING_TOKENS); + _; + } + + /* + * TESTS + */ + + function test_Delegation_AddToPool_Verifier( + uint256 amount, + uint256 delegationAmount, + uint256 addToPoolAmount + ) + public + useIndexer + useProvision(amount, 0, 0) + useValidDelegationAmount(delegationAmount) + useValidAddToPoolAmount(addToPoolAmount) + { + delegationAmount = bound(delegationAmount, 1, MAX_STAKING_TOKENS); + + // Initialize delegation pool + resetPrank(users.delegator); + _delegate(users.indexer, subgraphDataServiceAddress, delegationAmount, 0); + + resetPrank(subgraphDataServiceAddress); + mint(subgraphDataServiceAddress, addToPoolAmount); + token.approve(address(staking), addToPoolAmount); + _addToDelegationPool(users.indexer, subgraphDataServiceAddress, addToPoolAmount); + } + + function test_Delegation_AddToPool_Payments( + uint256 amount, + uint256 delegationAmount + ) + public + useIndexer + useProvision(amount, 0, 0) + useValidDelegationAmount(delegationAmount) + useValidAddToPoolAmount(delegationAmount) + { + // Initialize delegation pool + resetPrank(users.delegator); + _delegate(users.indexer, subgraphDataServiceAddress, delegationAmount, 0); + + resetPrank(address(payments)); + mint(address(payments), delegationAmount); + token.approve(address(staking), delegationAmount); + _addToDelegationPool(users.indexer, subgraphDataServiceAddress, delegationAmount); + } + + function test_Delegation_AddToPool_RevertWhen_ZeroTokens( + uint256 amount + ) public useIndexer useProvision(amount, 0, 0) { + vm.startPrank(subgraphDataServiceAddress); + bytes memory expectedError = abi.encodeWithSelector( + IHorizonStakingMain.HorizonStakingInvalidZeroTokens.selector + ); + vm.expectRevert(expectedError); + staking.addToDelegationPool(users.indexer, subgraphDataServiceAddress, 0); + } + + function test_Delegation_AddToPool_RevertWhen_PoolHasNoShares( + uint256 amount + ) public useIndexer useProvision(amount, 0, 0) { + vm.startPrank(subgraphDataServiceAddress); + bytes memory expectedError = abi.encodeWithSelector( + IHorizonStakingMain.HorizonStakingInvalidDelegationPool.selector, + users.indexer, + subgraphDataServiceAddress + ); + vm.expectRevert(expectedError); + staking.addToDelegationPool(users.indexer, subgraphDataServiceAddress, 1); + } + + function test_Delegation_AddToPool_RevertWhen_NoProvision() public { + vm.startPrank(subgraphDataServiceAddress); + bytes memory expectedError = abi.encodeWithSelector( + IHorizonStakingMain.HorizonStakingInvalidProvision.selector, + users.indexer, + subgraphDataServiceAddress + ); + vm.expectRevert(expectedError); + staking.addToDelegationPool(users.indexer, subgraphDataServiceAddress, 1); + } + + function test_Delegation_AddToPool_WhenInvalidPool( + uint256 tokens, + uint256 delegationTokens, + uint256 recoverAmount + ) public useIndexer useProvision(tokens, 0, 0) useDelegationSlashing { + recoverAmount = bound(recoverAmount, 1, MAX_STAKING_TOKENS); + delegationTokens = bound(delegationTokens, MIN_DELEGATION, MAX_STAKING_TOKENS); + + // create delegation pool + resetPrank(users.delegator); + _delegate(users.indexer, subgraphDataServiceAddress, delegationTokens, 0); + + // slash entire provision + pool + resetPrank(subgraphDataServiceAddress); + _slash(users.indexer, subgraphDataServiceAddress, tokens + delegationTokens, 0); + + // recover pool by adding tokens + resetPrank(users.indexer); + token.approve(address(staking), recoverAmount); + _addToDelegationPool(users.indexer, subgraphDataServiceAddress, recoverAmount); + } + + function test_Delegation_AddToPool_WhenInvalidPool_RevertWhen_PoolHasNoShares( + uint256 tokens, + uint256 delegationTokens, + uint256 recoverAmount + ) public useIndexer useProvision(tokens, 0, 0) useDelegationSlashing { + recoverAmount = bound(recoverAmount, 1, MAX_STAKING_TOKENS); + delegationTokens = bound(delegationTokens, MIN_DELEGATION, MAX_STAKING_TOKENS); + + // create delegation pool + resetPrank(users.delegator); + _delegate(users.indexer, subgraphDataServiceAddress, delegationTokens, 0); + + // undelegate shares so we have thawing shares/tokens + DelegationInternal memory delegation = _getStorage_Delegation( + users.indexer, + subgraphDataServiceAddress, + users.delegator, + false + ); + resetPrank(users.delegator); + _undelegate(users.indexer, subgraphDataServiceAddress, delegation.shares); + + // slash entire provision + pool + resetPrank(subgraphDataServiceAddress); + _slash(users.indexer, subgraphDataServiceAddress, tokens + delegationTokens, 0); + + // addTokens + bytes memory expectedError = abi.encodeWithSelector( + IHorizonStakingMain.HorizonStakingInvalidDelegationPool.selector, + users.indexer, + subgraphDataServiceAddress + ); + vm.expectRevert(expectedError); + staking.addToDelegationPool(users.indexer, subgraphDataServiceAddress, 1); + } +} diff --git a/packages/horizon/test/unit/staking/delegation/delegate.t.sol b/packages/horizon/test/unit/staking/delegation/delegate.t.sol new file mode 100644 index 000000000..48ff6abd7 --- /dev/null +++ b/packages/horizon/test/unit/staking/delegation/delegate.t.sol @@ -0,0 +1,197 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { IHorizonStakingMain } from "../../../../contracts/interfaces/internal/IHorizonStakingMain.sol"; + +import { HorizonStakingTest } from "../HorizonStaking.t.sol"; + +contract HorizonStakingDelegateTest is HorizonStakingTest { + /* + * TESTS + */ + + function testDelegate_Tokens( + uint256 amount, + uint256 delegationAmount + ) public useIndexer useProvision(amount, 0, 0) useDelegation(delegationAmount) {} + + function testDelegate_Tokens_WhenThawing( + uint256 amount, + uint256 delegationAmount, + uint256 undelegateAmount + ) public useIndexer useProvision(amount, 0, 1 days) { + amount = bound(amount, 1 ether, MAX_STAKING_TOKENS); + // there is a min delegation amount of 1 ether after undelegating so we start with 1 ether + 1 wei + delegationAmount = bound(delegationAmount, 1 ether + 1 wei, MAX_STAKING_TOKENS); + + vm.startPrank(users.delegator); + _delegate(users.indexer, subgraphDataServiceAddress, delegationAmount, 0); + + DelegationInternal memory delegation = _getStorage_Delegation( + users.indexer, + subgraphDataServiceAddress, + users.delegator, + false + ); + undelegateAmount = bound(undelegateAmount, 1 wei, delegation.shares - 1 ether); + _undelegate(users.indexer, subgraphDataServiceAddress, undelegateAmount); + + _delegate(users.indexer, subgraphDataServiceAddress, delegationAmount, 0); + } + + function testDelegate_Tokens_WhenAllThawing( + uint256 amount, + uint256 delegationAmount + ) public useIndexer useProvision(amount, 0, 1 days) { + delegationAmount = bound(delegationAmount, 1 ether, MAX_STAKING_TOKENS); + + vm.startPrank(users.delegator); + _delegate(users.indexer, subgraphDataServiceAddress, delegationAmount, 0); + + DelegationInternal memory delegation = _getStorage_Delegation( + users.indexer, + subgraphDataServiceAddress, + users.delegator, + false + ); + _undelegate(users.indexer, subgraphDataServiceAddress, delegation.shares); + + _delegate(users.indexer, subgraphDataServiceAddress, delegationAmount, 0); + } + + function testDelegate_RevertWhen_ZeroTokens(uint256 amount) public useIndexer useProvision(amount, 0, 0) { + vm.startPrank(users.delegator); + bytes memory expectedError = abi.encodeWithSignature("HorizonStakingInvalidZeroTokens()"); + vm.expectRevert(expectedError); + staking.delegate(users.indexer, subgraphDataServiceAddress, 0, 0); + } + + function testDelegate_RevertWhen_UnderMinDelegation( + uint256 amount, + uint256 delegationAmount + ) public useIndexer useProvision(amount, 0, 0) { + delegationAmount = bound(delegationAmount, 1, MIN_DELEGATION - 1); + vm.startPrank(users.delegator); + token.approve(address(staking), delegationAmount); + bytes memory expectedError = abi.encodeWithSelector( + IHorizonStakingMain.HorizonStakingInsufficientDelegationTokens.selector, + delegationAmount, + MIN_DELEGATION + ); + vm.expectRevert(expectedError); + staking.delegate(users.indexer, subgraphDataServiceAddress, delegationAmount, 0); + } + + function testDelegate_LegacySubgraphService(uint256 amount, uint256 delegationAmount) public useIndexer { + amount = bound(amount, 1 ether, MAX_STAKING_TOKENS); + delegationAmount = bound(delegationAmount, MIN_DELEGATION, MAX_STAKING_TOKENS); + _createProvision(users.indexer, subgraphDataServiceLegacyAddress, amount, 0, 0); + + resetPrank(users.delegator); + _delegate(users.indexer, delegationAmount); + } + + function testDelegate_RevertWhen_InvalidPool( + uint256 tokens, + uint256 delegationTokens + ) public useIndexer useProvision(tokens, 0, 0) useDelegationSlashing { + delegationTokens = bound(delegationTokens, MIN_DELEGATION, MAX_STAKING_TOKENS); + + resetPrank(users.delegator); + _delegate(users.indexer, subgraphDataServiceAddress, delegationTokens, 0); + + // slash entire provision + pool + resetPrank(subgraphDataServiceAddress); + _slash(users.indexer, subgraphDataServiceAddress, tokens + delegationTokens, 0); + + // attempt to delegate to a pool on invalid state, should revert + resetPrank(users.delegator); + token.approve(address(staking), delegationTokens); + vm.expectRevert( + abi.encodeWithSelector( + IHorizonStakingMain.HorizonStakingInvalidDelegationPoolState.selector, + users.indexer, + subgraphDataServiceAddress + ) + ); + staking.delegate(users.indexer, subgraphDataServiceAddress, delegationTokens, 0); + } + + function testDelegate_RevertWhen_ThawingShares_InvalidPool( + uint256 tokens, + uint256 delegationTokens + ) public useIndexer useProvision(tokens, 0, 0) useDelegationSlashing { + delegationTokens = bound(delegationTokens, MIN_DELEGATION * 2, MAX_STAKING_TOKENS); + + resetPrank(users.delegator); + _delegate(users.indexer, subgraphDataServiceAddress, delegationTokens, 0); + + // undelegate some shares but not all + DelegationInternal memory delegation = _getStorage_Delegation( + users.indexer, + subgraphDataServiceAddress, + users.delegator, + false + ); + _undelegate(users.indexer, subgraphDataServiceAddress, delegation.shares / 2); + + // slash entire provision + pool + resetPrank(subgraphDataServiceAddress); + _slash(users.indexer, subgraphDataServiceAddress, tokens + delegationTokens, 0); + + // attempt to delegate to a pool on invalid state, should revert + resetPrank(users.delegator); + token.approve(address(staking), delegationTokens); + vm.expectRevert( + abi.encodeWithSelector( + IHorizonStakingMain.HorizonStakingInvalidDelegationPoolState.selector, + users.indexer, + subgraphDataServiceAddress + ) + ); + staking.delegate(users.indexer, subgraphDataServiceAddress, delegationTokens, 0); + } + + function testDelegate_AfterRecoveringPool( + uint256 tokens, + uint256 delegationTokens, + uint256 recoverAmount + ) public useIndexer useProvision(tokens, 0, 0) useDelegationSlashing { + recoverAmount = bound(recoverAmount, 1, MAX_STAKING_TOKENS); + delegationTokens = bound(delegationTokens, MIN_DELEGATION, MAX_STAKING_TOKENS); + + // create delegation pool + resetPrank(users.delegator); + _delegate(users.indexer, subgraphDataServiceAddress, delegationTokens, 0); + + // slash entire provision + pool + resetPrank(subgraphDataServiceAddress); + _slash(users.indexer, subgraphDataServiceAddress, tokens + delegationTokens, 0); + + // recover pool by adding tokens + resetPrank(users.indexer); + token.approve(address(staking), recoverAmount); + _addToDelegationPool(users.indexer, subgraphDataServiceAddress, recoverAmount); + + // delegate to pool - should be allowed now + vm.assume(delegationTokens >= recoverAmount); // to avoid getting issued 0 shares + resetPrank(users.delegator); + _delegate(users.indexer, subgraphDataServiceAddress, delegationTokens, 0); + } + + function testDelegate_RevertWhen_ProvisionNotCreated(uint256 delegationAmount) public { + delegationAmount = bound(delegationAmount, MIN_DELEGATION, MAX_STAKING_TOKENS); + + vm.startPrank(users.delegator); + token.approve(address(staking), delegationAmount); + bytes memory expectedError = abi.encodeWithSelector( + IHorizonStakingMain.HorizonStakingInvalidProvision.selector, + users.indexer, + subgraphDataServiceAddress + ); + vm.expectRevert(expectedError); + staking.delegate(users.indexer, subgraphDataServiceAddress, delegationAmount, 0); + } +} diff --git a/packages/horizon/test/unit/staking/delegation/legacyWithdraw.t.sol b/packages/horizon/test/unit/staking/delegation/legacyWithdraw.t.sol new file mode 100644 index 000000000..f18485fd5 --- /dev/null +++ b/packages/horizon/test/unit/staking/delegation/legacyWithdraw.t.sol @@ -0,0 +1,102 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { IHorizonStakingMain } from "../../../../contracts/interfaces/internal/IHorizonStakingMain.sol"; +import { IHorizonStakingTypes } from "../../../../contracts/interfaces/internal/IHorizonStakingTypes.sol"; +import { IHorizonStakingExtension } from "../../../../contracts/interfaces/internal/IHorizonStakingExtension.sol"; +import { LinkedList } from "../../../../contracts/libraries/LinkedList.sol"; + +import { HorizonStakingTest } from "../HorizonStaking.t.sol"; + +contract HorizonStakingLegacyWithdrawDelegationTest is HorizonStakingTest { + /* + * MODIFIERS + */ + + modifier useDelegator() { + resetPrank(users.delegator); + _; + } + + /* + * HELPERS + */ + + function _setLegacyDelegation( + address _indexer, + address _delegator, + uint256 _shares, + uint256 __DEPRECATED_tokensLocked, + uint256 __DEPRECATED_tokensLockedUntil + ) public { + // Calculate the base storage slot for the serviceProvider in the mapping + bytes32 baseSlot = keccak256(abi.encode(_indexer, uint256(20))); + + // Calculate the slot for the delegator's DelegationInternal struct + bytes32 delegatorSlot = keccak256(abi.encode(_delegator, bytes32(uint256(baseSlot) + 4))); + + // Use vm.store to set each field of the struct + vm.store(address(staking), bytes32(uint256(delegatorSlot)), bytes32(_shares)); + vm.store(address(staking), bytes32(uint256(delegatorSlot) + 1), bytes32(__DEPRECATED_tokensLocked)); + vm.store(address(staking), bytes32(uint256(delegatorSlot) + 2), bytes32(__DEPRECATED_tokensLockedUntil)); + } + + /* + * ACTIONS + */ + + function _legacyWithdrawDelegated(address _indexer) internal { + (, address delegator, ) = vm.readCallers(); + IHorizonStakingTypes.DelegationPool memory pool = staking.getDelegationPool( + _indexer, + subgraphDataServiceLegacyAddress + ); + uint256 beforeStakingBalance = token.balanceOf(address(staking)); + uint256 beforeDelegatorBalance = token.balanceOf(users.delegator); + + vm.expectEmit(address(staking)); + emit IHorizonStakingMain.StakeDelegatedWithdrawn(_indexer, delegator, pool.tokens); + staking.withdrawDelegated(users.indexer, address(0)); + + uint256 afterStakingBalance = token.balanceOf(address(staking)); + uint256 afterDelegatorBalance = token.balanceOf(users.delegator); + + assertEq(afterStakingBalance, beforeStakingBalance - pool.tokens); + assertEq(afterDelegatorBalance - pool.tokens, beforeDelegatorBalance); + + DelegationInternal memory delegation = _getStorage_Delegation( + _indexer, + subgraphDataServiceLegacyAddress, + delegator, + true + ); + assertEq(delegation.shares, 0); + assertEq(delegation.__DEPRECATED_tokensLocked, 0); + assertEq(delegation.__DEPRECATED_tokensLockedUntil, 0); + } + + /* + * TESTS + */ + + function testWithdraw_Legacy(uint256 tokensLocked) public useDelegator { + vm.assume(tokensLocked > 0); + + _setStorage_DelegationPool(users.indexer, tokensLocked, 0, 0); + _setLegacyDelegation(users.indexer, users.delegator, 0, tokensLocked, 1); + token.transfer(address(staking), tokensLocked); + + _legacyWithdrawDelegated(users.indexer); + } + + function testWithdraw_Legacy_RevertWhen_NoTokens() public useDelegator { + _setStorage_DelegationPool(users.indexer, 0, 0, 0); + _setLegacyDelegation(users.indexer, users.delegator, 0, 0, 0); + + bytes memory expectedError = abi.encodeWithSignature("HorizonStakingNothingToWithdraw()"); + vm.expectRevert(expectedError); + staking.withdrawDelegated(users.indexer, address(0)); + } +} diff --git a/packages/horizon/test/unit/staking/delegation/redelegate.t.sol b/packages/horizon/test/unit/staking/delegation/redelegate.t.sol new file mode 100644 index 000000000..27399328d --- /dev/null +++ b/packages/horizon/test/unit/staking/delegation/redelegate.t.sol @@ -0,0 +1,134 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { IHorizonStakingMain } from "../../../../contracts/interfaces/internal/IHorizonStakingMain.sol"; + +import { HorizonStakingTest } from "../HorizonStaking.t.sol"; + +contract HorizonStakingWithdrawDelegationTest is HorizonStakingTest { + /* + * HELPERS + */ + + function _setupNewIndexer(uint256 tokens) private returns (address) { + (, address msgSender, ) = vm.readCallers(); + + address newIndexer = createUser("newIndexer"); + vm.startPrank(newIndexer); + _createProvision(newIndexer, subgraphDataServiceAddress, tokens, 0, MAX_THAWING_PERIOD); + + vm.startPrank(msgSender); + return newIndexer; + } + + function _setupNewIndexerAndVerifier(uint256 tokens) private returns (address, address) { + (, address msgSender, ) = vm.readCallers(); + + address newIndexer = createUser("newIndexer"); + address newVerifier = makeAddr("newVerifier"); + vm.startPrank(newIndexer); + _createProvision(newIndexer, newVerifier, tokens, 0, MAX_THAWING_PERIOD); + + vm.startPrank(msgSender); + return (newIndexer, newVerifier); + } + + /* + * TESTS + */ + + function testRedelegate_MoveToNewServiceProvider( + uint256 delegationAmount, + uint256 withdrawShares + ) + public + useIndexer + useProvision(10_000_000 ether, 0, MAX_THAWING_PERIOD) + useDelegation(delegationAmount) + useUndelegate(withdrawShares) + { + skip(MAX_THAWING_PERIOD + 1); + + // Setup new service provider + address newIndexer = _setupNewIndexer(10_000_000 ether); + _redelegate(users.indexer, subgraphDataServiceAddress, newIndexer, subgraphDataServiceAddress, 0, 0); + } + + function testRedelegate_MoveToNewServiceProviderAndNewVerifier( + uint256 delegationAmount, + uint256 withdrawShares + ) + public + useIndexer + useProvision(10_000_000 ether, 0, MAX_THAWING_PERIOD) + useDelegation(delegationAmount) + useUndelegate(withdrawShares) + { + skip(MAX_THAWING_PERIOD + 1); + + // Setup new service provider + (address newIndexer, address newVerifier) = _setupNewIndexerAndVerifier(10_000_000 ether); + _redelegate(users.indexer, subgraphDataServiceAddress, newIndexer, newVerifier, 0, 0); + } + + function testRedelegate_RevertWhen_VerifierZeroAddress( + uint256 delegationAmount + ) + public + useIndexer + useProvision(10_000_000 ether, 0, MAX_THAWING_PERIOD) + useDelegation(delegationAmount) + useUndelegate(delegationAmount) + { + skip(MAX_THAWING_PERIOD + 1); + + // Setup new service provider + address newIndexer = _setupNewIndexer(10_000_000 ether); + vm.expectRevert(abi.encodeWithSelector(IHorizonStakingMain.HorizonStakingInvalidVerifierZeroAddress.selector)); + staking.redelegate(users.indexer, subgraphDataServiceAddress, newIndexer, address(0), 0, 0); + } + + function testRedelegate_RevertWhen_ServiceProviderZeroAddress( + uint256 delegationAmount + ) + public + useIndexer + useProvision(10_000_000 ether, 0, MAX_THAWING_PERIOD) + useDelegation(delegationAmount) + useUndelegate(delegationAmount) + { + skip(MAX_THAWING_PERIOD + 1); + + // Setup new verifier + address newVerifier = makeAddr("newVerifier"); + vm.expectRevert( + abi.encodeWithSelector(IHorizonStakingMain.HorizonStakingInvalidServiceProviderZeroAddress.selector) + ); + staking.redelegate(users.indexer, subgraphDataServiceAddress, address(0), newVerifier, 0, 0); + } + + function testRedelegate_MoveZeroTokensToNewServiceProviderAndVerifier( + uint256 delegationAmount, + uint256 withdrawShares + ) + public + useIndexer + useProvision(10_000_000 ether, 0, MAX_THAWING_PERIOD) + useDelegation(delegationAmount) + useUndelegate(withdrawShares) + { + // Setup new service provider + (address newIndexer, address newVerifier) = _setupNewIndexerAndVerifier(10_000_000 ether); + + uint256 previousBalance = token.balanceOf(users.delegator); + _redelegate(users.indexer, subgraphDataServiceAddress, newIndexer, newVerifier, 0, 0); + + uint256 newBalance = token.balanceOf(users.delegator); + assertEq(newBalance, previousBalance); + + uint256 delegatedTokens = staking.getDelegatedTokensAvailable(newIndexer, newVerifier); + assertEq(delegatedTokens, 0); + } +} diff --git a/packages/horizon/test/unit/staking/delegation/undelegate.t.sol b/packages/horizon/test/unit/staking/delegation/undelegate.t.sol new file mode 100644 index 000000000..fcdca8107 --- /dev/null +++ b/packages/horizon/test/unit/staking/delegation/undelegate.t.sol @@ -0,0 +1,241 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { IHorizonStakingMain } from "../../../../contracts/interfaces/internal/IHorizonStakingMain.sol"; + +import { HorizonStakingTest } from "../HorizonStaking.t.sol"; + +contract HorizonStakingUndelegateTest is HorizonStakingTest { + /* + * TESTS + */ + + function testUndelegate_Tokens( + uint256 amount, + uint256 delegationAmount + ) public useIndexer useProvision(amount, 0, 0) useDelegation(delegationAmount) { + resetPrank(users.delegator); + DelegationInternal memory delegation = _getStorage_Delegation( + users.indexer, + subgraphDataServiceAddress, + users.delegator, + false + ); + _undelegate(users.indexer, subgraphDataServiceAddress, delegation.shares); + } + + function testMultipleUndelegate_Tokens( + uint256 amount, + uint256 delegationAmount, + uint256 undelegateSteps + ) public useIndexer useProvision(amount, 0, 0) { + undelegateSteps = bound(undelegateSteps, 1, 10); + delegationAmount = bound(delegationAmount, MIN_DELEGATION * undelegateSteps, MAX_STAKING_TOKENS); + + resetPrank(users.delegator); + _delegate(users.indexer, subgraphDataServiceAddress, delegationAmount, 0); + DelegationInternal memory delegation = _getStorage_Delegation( + users.indexer, + subgraphDataServiceAddress, + users.delegator, + false + ); + + uint256 undelegateAmount = delegation.shares / undelegateSteps; + for (uint i = 0; i < undelegateSteps - 1; i++) { + _undelegate(users.indexer, subgraphDataServiceAddress, undelegateAmount); + } + + delegation = _getStorage_Delegation(users.indexer, subgraphDataServiceAddress, users.delegator, false); + _undelegate(users.indexer, subgraphDataServiceAddress, delegation.shares); + } + + function testUndelegate_RevertWhen_InsuficientTokens( + uint256 amount, + uint256 delegationAmount, + uint256 undelegateAmount + ) public useIndexer useProvision(amount, 0, 0) useDelegation(delegationAmount) { + undelegateAmount = bound(undelegateAmount, 1, delegationAmount); + resetPrank(users.delegator); + DelegationInternal memory delegation = _getStorage_Delegation( + users.indexer, + subgraphDataServiceAddress, + users.delegator, + false + ); + undelegateAmount = bound(undelegateAmount, delegation.shares - MIN_DELEGATION + 1, delegation.shares - 1); + bytes memory expectedError = abi.encodeWithSelector( + IHorizonStakingMain.HorizonStakingInsufficientTokens.selector, + delegation.shares - undelegateAmount, + MIN_DELEGATION + ); + vm.expectRevert(expectedError); + staking.undelegate(users.indexer, subgraphDataServiceAddress, undelegateAmount); + } + + function testUndelegate_RevertWhen_TooManyUndelegations() + public + useIndexer + useProvision(1000 ether, 0, 0) + useDelegation(10000 ether) + { + resetPrank(users.delegator); + + for (uint i = 0; i < MAX_THAW_REQUESTS; i++) { + _undelegate(users.indexer, subgraphDataServiceAddress, 1 ether); + } + + bytes memory expectedError = abi.encodeWithSignature("HorizonStakingTooManyThawRequests()"); + vm.expectRevert(expectedError); + staking.undelegate(users.indexer, subgraphDataServiceAddress, 1 ether); + } + + function testUndelegate_RevertWhen_ZeroShares( + uint256 amount, + uint256 delegationAmount + ) public useIndexer useProvision(amount, 0, 0) useDelegation(delegationAmount) { + resetPrank(users.delegator); + bytes memory expectedError = abi.encodeWithSignature("HorizonStakingInvalidZeroShares()"); + vm.expectRevert(expectedError); + staking.undelegate(users.indexer, subgraphDataServiceAddress, 0); + } + + function testUndelegate_RevertWhen_OverShares( + uint256 amount, + uint256 delegationAmount, + uint256 overDelegationShares + ) public useIndexer useProvision(amount, 0, 0) useDelegation(delegationAmount) { + resetPrank(users.delegator); + DelegationInternal memory delegation = _getStorage_Delegation( + users.indexer, + subgraphDataServiceAddress, + users.delegator, + false + ); + overDelegationShares = bound(overDelegationShares, delegation.shares + 1, MAX_STAKING_TOKENS + 1); + + bytes memory expectedError = abi.encodeWithSignature( + "HorizonStakingInsufficientShares(uint256,uint256)", + delegation.shares, + overDelegationShares + ); + vm.expectRevert(expectedError); + staking.undelegate(users.indexer, subgraphDataServiceAddress, overDelegationShares); + } + + function testUndelegate_LegacySubgraphService(uint256 amount, uint256 delegationAmount) public useIndexer { + amount = bound(amount, 1, MAX_STAKING_TOKENS); + delegationAmount = bound(delegationAmount, MIN_DELEGATION, MAX_STAKING_TOKENS); + _createProvision(users.indexer, subgraphDataServiceLegacyAddress, amount, 0, 0); + + resetPrank(users.delegator); + _delegate(users.indexer, delegationAmount); + + DelegationInternal memory delegation = _getStorage_Delegation( + users.indexer, + subgraphDataServiceAddress, + users.delegator, + true + ); + _undelegate(users.indexer, delegation.shares); + } + + function testUndelegate_RevertWhen_InvalidPool( + uint256 tokens, + uint256 delegationTokens + ) public useIndexer useProvision(tokens, 0, 0) useDelegationSlashing { + delegationTokens = bound(delegationTokens, MIN_DELEGATION, MAX_STAKING_TOKENS); + + resetPrank(users.delegator); + _delegate(users.indexer, subgraphDataServiceAddress, delegationTokens, 0); + + // slash all of the provision + delegation + resetPrank(subgraphDataServiceAddress); + _slash(users.indexer, subgraphDataServiceAddress, tokens + delegationTokens, 0); + + // attempt to undelegate - should revert + resetPrank(users.delegator); + DelegationInternal memory delegation = _getStorage_Delegation( + users.indexer, + subgraphDataServiceAddress, + users.delegator, + false + ); + vm.expectRevert( + abi.encodeWithSelector( + IHorizonStakingMain.HorizonStakingInvalidDelegationPoolState.selector, + users.indexer, + subgraphDataServiceAddress + ) + ); + staking.undelegate(users.indexer, subgraphDataServiceAddress, delegation.shares); + } + + function testUndelegate_AfterRecoveringPool( + uint256 tokens, + uint256 delegationTokens + ) public useIndexer useProvision(tokens, 0, 0) useDelegationSlashing { + delegationTokens = bound(delegationTokens, MIN_DELEGATION, MAX_STAKING_TOKENS); + + // delegate + resetPrank(users.delegator); + _delegate(users.indexer, subgraphDataServiceAddress, delegationTokens, 0); + + // slash all of the provision + delegation + resetPrank(subgraphDataServiceAddress); + _slash(users.indexer, subgraphDataServiceAddress, tokens + delegationTokens, 0); + + // recover the delegation pool + resetPrank(users.indexer); + token.approve(address(staking), delegationTokens); + _addToDelegationPool(users.indexer, subgraphDataServiceAddress, delegationTokens); + + // undelegate -- should now work + DelegationInternal memory delegation = _getStorage_Delegation( + users.indexer, + subgraphDataServiceAddress, + users.delegator, + false + ); + resetPrank(users.delegator); + _undelegate(users.indexer, subgraphDataServiceAddress, delegation.shares); + } + + function testUndelegate_ThawingShares_AfterRecoveringPool() + public + useIndexer + useProvision(MAX_STAKING_TOKENS, 0, 0) + useDelegationSlashing + { + uint256 delegationTokens = MAX_STAKING_TOKENS / 10; + + // delegate + resetPrank(users.delegator); + _delegate(users.indexer, subgraphDataServiceAddress, delegationTokens, 0); + + // undelegate half shares so we have some thawing shares/tokens + DelegationInternal memory delegation = _getStorage_Delegation( + users.indexer, + subgraphDataServiceAddress, + users.delegator, + false + ); + resetPrank(users.delegator); + _undelegate(users.indexer, subgraphDataServiceAddress, delegation.shares / 2); + + // slash all of the provision + delegation + resetPrank(subgraphDataServiceAddress); + _slash(users.indexer, subgraphDataServiceAddress, MAX_STAKING_TOKENS + delegationTokens, 0); + + // recover the delegation pool + resetPrank(users.indexer); + token.approve(address(staking), delegationTokens); + _addToDelegationPool(users.indexer, subgraphDataServiceAddress, delegationTokens); + + // undelegate the rest + resetPrank(users.delegator); + _undelegate(users.indexer, subgraphDataServiceAddress, delegation.shares - delegation.shares / 2); + } +} diff --git a/packages/horizon/test/unit/staking/delegation/withdraw.t.sol b/packages/horizon/test/unit/staking/delegation/withdraw.t.sol new file mode 100644 index 000000000..7c2c1ec53 --- /dev/null +++ b/packages/horizon/test/unit/staking/delegation/withdraw.t.sol @@ -0,0 +1,165 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { IHorizonStakingMain } from "../../../../contracts/interfaces/internal/IHorizonStakingMain.sol"; +import { IHorizonStakingTypes } from "../../../../contracts/interfaces/internal/IHorizonStakingTypes.sol"; +import { LinkedList } from "../../../../contracts/libraries/LinkedList.sol"; + +import { HorizonStakingTest } from "../HorizonStaking.t.sol"; + +contract HorizonStakingWithdrawDelegationTest is HorizonStakingTest { + /* + * TESTS + */ + + function testWithdrawDelegation_Tokens( + uint256 delegationAmount, + uint256 withdrawShares + ) + public + useIndexer + useProvision(10_000_000 ether, 0, MAX_THAWING_PERIOD) + useDelegation(delegationAmount) + useUndelegate(withdrawShares) + { + LinkedList.List memory thawingRequests = staking.getThawRequestList( + IHorizonStakingTypes.ThawRequestType.Delegation, + users.indexer, + subgraphDataServiceAddress, + users.delegator + ); + ThawRequest memory thawRequest = staking.getThawRequest( + IHorizonStakingTypes.ThawRequestType.Delegation, + thawingRequests.tail + ); + + skip(thawRequest.thawingUntil + 1); + + _withdrawDelegated(users.indexer, subgraphDataServiceAddress, 0); + } + + function testWithdrawDelegation_RevertWhen_NotThawing( + uint256 delegationAmount + ) public useIndexer useProvision(10_000_000 ether, 0, MAX_THAWING_PERIOD) useDelegation(delegationAmount) { + bytes memory expectedError = abi.encodeWithSignature("HorizonStakingNothingThawing()"); + vm.expectRevert(expectedError); + staking.withdrawDelegated(users.indexer, subgraphDataServiceAddress, 0); + } + + function testWithdrawDelegation_ZeroTokens( + uint256 delegationAmount + ) + public + useIndexer + useProvision(10_000_000 ether, 0, MAX_THAWING_PERIOD) + useDelegation(delegationAmount) + useUndelegate(delegationAmount) + { + uint256 previousBalance = token.balanceOf(users.delegator); + _withdrawDelegated(users.indexer, subgraphDataServiceAddress, 0); + + // Nothing changed since thawing period hasn't finished + uint256 newBalance = token.balanceOf(users.delegator); + assertEq(newBalance, previousBalance); + } + + function testWithdrawDelegation_LegacySubgraphService(uint256 delegationAmount) public useIndexer { + delegationAmount = bound(delegationAmount, MIN_DELEGATION, MAX_STAKING_TOKENS); + _createProvision(users.indexer, subgraphDataServiceLegacyAddress, 10_000_000 ether, 0, MAX_THAWING_PERIOD); + + resetPrank(users.delegator); + _delegate(users.indexer, delegationAmount); + DelegationInternal memory delegation = _getStorage_Delegation( + users.indexer, + subgraphDataServiceAddress, + users.delegator, + true + ); + _undelegate(users.indexer, delegation.shares); + + LinkedList.List memory thawingRequests = staking.getThawRequestList( + IHorizonStakingTypes.ThawRequestType.Delegation, + users.indexer, + subgraphDataServiceLegacyAddress, + users.delegator + ); + ThawRequest memory thawRequest = staking.getThawRequest( + IHorizonStakingTypes.ThawRequestType.Delegation, + thawingRequests.tail + ); + + skip(thawRequest.thawingUntil + 1); + + _withdrawDelegated(users.indexer, subgraphDataServiceLegacyAddress, 0); + } + + function testWithdrawDelegation_RevertWhen_InvalidPool( + uint256 tokens, + uint256 delegationTokens + ) public useIndexer useProvision(tokens, 0, MAX_THAWING_PERIOD) useDelegationSlashing { + delegationTokens = bound(delegationTokens, MIN_DELEGATION * 2, MAX_STAKING_TOKENS); + + resetPrank(users.delegator); + _delegate(users.indexer, subgraphDataServiceAddress, delegationTokens, 0); + + // undelegate some shares + DelegationInternal memory delegation = _getStorage_Delegation( + users.indexer, + subgraphDataServiceAddress, + users.delegator, + false + ); + _undelegate(users.indexer, subgraphDataServiceAddress, delegation.shares / 2); + + // slash all of the provision + delegation + resetPrank(subgraphDataServiceAddress); + _slash(users.indexer, subgraphDataServiceAddress, tokens + delegationTokens, 0); + + // fast forward in time and attempt to withdraw + skip(MAX_THAWING_PERIOD + 1); + resetPrank(users.delegator); + vm.expectRevert( + abi.encodeWithSelector( + IHorizonStakingMain.HorizonStakingInvalidDelegationPoolState.selector, + users.indexer, + subgraphDataServiceAddress + ) + ); + staking.withdrawDelegated(users.indexer, subgraphDataServiceAddress, 0); + } + + function testWithdrawDelegation_AfterRecoveringPool( + uint256 tokens + ) public useIndexer useProvision(tokens, 0, MAX_THAWING_PERIOD) useDelegationSlashing { + uint256 delegationTokens = MAX_STAKING_TOKENS / 10; + + // delegate + resetPrank(users.delegator); + _delegate(users.indexer, subgraphDataServiceAddress, delegationTokens, 0); + + // undelegate some shares + DelegationInternal memory delegation = _getStorage_Delegation( + users.indexer, + subgraphDataServiceAddress, + users.delegator, + false + ); + _undelegate(users.indexer, subgraphDataServiceAddress, delegation.shares / 2); + + // slash all of the provision + delegation + resetPrank(subgraphDataServiceAddress); + _slash(users.indexer, subgraphDataServiceAddress, tokens + delegationTokens, 0); + + // recover the delegation pool + resetPrank(users.indexer); + token.approve(address(staking), delegationTokens); + _addToDelegationPool(users.indexer, subgraphDataServiceAddress, delegationTokens); + + // fast forward in time and withdraw - this withdraw will net 0 tokens + skip(MAX_THAWING_PERIOD + 1); + resetPrank(users.delegator); + _withdrawDelegated(users.indexer, subgraphDataServiceAddress, 0); + } +} diff --git a/packages/horizon/test/unit/staking/governance/governance.t.sol b/packages/horizon/test/unit/staking/governance/governance.t.sol new file mode 100644 index 000000000..2fe4a46da --- /dev/null +++ b/packages/horizon/test/unit/staking/governance/governance.t.sol @@ -0,0 +1,64 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { HorizonStakingTest } from "../HorizonStaking.t.sol"; + +contract HorizonStakingGovernanceTest is HorizonStakingTest { + /* + * MODIFIERS + */ + + modifier useGovernor() { + vm.startPrank(users.governor); + _; + } + + /* + * TESTS + */ + + function testGovernance_SetAllowedLockedVerifier() public useGovernor { + _setAllowedLockedVerifier(subgraphDataServiceAddress, true); + } + + function testGovernance_RevertWhen_SetAllowedLockedVerifier_NotGovernor() public useIndexer { + bytes memory expectedError = abi.encodeWithSignature("ManagedOnlyGovernor()"); + vm.expectRevert(expectedError); + staking.setAllowedLockedVerifier(subgraphDataServiceAddress, true); + } + + function testGovernance_SetDelgationSlashingEnabled() public useGovernor { + _setDelegationSlashingEnabled(); + } + + function testGovernance_SetDelgationSlashing_NotGovernor() public useIndexer { + bytes memory expectedError = abi.encodeWithSignature("ManagedOnlyGovernor()"); + vm.expectRevert(expectedError); + staking.setDelegationSlashingEnabled(); + } + + function testGovernance_ClearThawingPeriod(uint32 thawingPeriod) public useGovernor { + // simulate previous thawing period + _setStorage_DeprecatedThawingPeriod(thawingPeriod); + + _clearThawingPeriod(); + } + + function testGovernance_ClearThawingPeriod_NotGovernor() public useIndexer { + bytes memory expectedError = abi.encodeWithSignature("ManagedOnlyGovernor()"); + vm.expectRevert(expectedError); + staking.clearThawingPeriod(); + } + + function testGovernance__SetMaxThawingPeriod(uint64 maxThawingPeriod) public useGovernor { + _setMaxThawingPeriod(maxThawingPeriod); + } + + function testGovernance__SetMaxThawingPeriod_NotGovernor() public useIndexer { + bytes memory expectedError = abi.encodeWithSignature("ManagedOnlyGovernor()"); + vm.expectRevert(expectedError); + staking.setMaxThawingPeriod(MAX_THAWING_PERIOD); + } +} diff --git a/packages/horizon/test/unit/staking/operator/locked.t.sol b/packages/horizon/test/unit/staking/operator/locked.t.sol new file mode 100644 index 000000000..0568e8cb3 --- /dev/null +++ b/packages/horizon/test/unit/staking/operator/locked.t.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { HorizonStakingTest } from "../HorizonStaking.t.sol"; + +contract HorizonStakingOperatorLockedTest is HorizonStakingTest { + /* + * TESTS + */ + + function testOperatorLocked_Set() public useIndexer useLockedVerifier(subgraphDataServiceAddress) { + _setOperatorLocked(subgraphDataServiceAddress, users.operator, true); + } + + function testOperatorLocked_RevertWhen_VerifierNotAllowed() public useIndexer { + bytes memory expectedError = abi.encodeWithSignature( + "HorizonStakingVerifierNotAllowed(address)", + subgraphDataServiceAddress + ); + vm.expectRevert(expectedError); + staking.setOperatorLocked(subgraphDataServiceAddress, users.operator, true); + } + + function testOperatorLocked_RevertWhen_CallerIsServiceProvider() + public + useIndexer + useLockedVerifier(subgraphDataServiceAddress) + { + bytes memory expectedError = abi.encodeWithSignature("HorizonStakingCallerIsServiceProvider()"); + vm.expectRevert(expectedError); + staking.setOperatorLocked(subgraphDataServiceAddress, users.indexer, true); + } + + function testOperatorLocked_SetLegacySubgraphService() + public + useIndexer + useLockedVerifier(subgraphDataServiceLegacyAddress) + { + _setOperatorLocked(subgraphDataServiceLegacyAddress, users.operator, true); + } +} diff --git a/packages/horizon/test/unit/staking/operator/operator.t.sol b/packages/horizon/test/unit/staking/operator/operator.t.sol new file mode 100644 index 000000000..664414047 --- /dev/null +++ b/packages/horizon/test/unit/staking/operator/operator.t.sol @@ -0,0 +1,27 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { HorizonStakingTest } from "../HorizonStaking.t.sol"; + +contract HorizonStakingOperatorTest is HorizonStakingTest { + /* + * TESTS + */ + + function testOperator_SetOperator() public useIndexer { + _setOperator(subgraphDataServiceAddress, users.operator, true); + } + + function testOperator_RevertWhen_CallerIsServiceProvider() public useIndexer { + bytes memory expectedError = abi.encodeWithSignature("HorizonStakingCallerIsServiceProvider()"); + vm.expectRevert(expectedError); + staking.setOperator(subgraphDataServiceAddress, users.indexer, true); + } + + function testOperator_RemoveOperator() public useIndexer { + _setOperator(subgraphDataServiceAddress, users.operator, true); + _setOperator(subgraphDataServiceAddress, users.operator, false); + } +} diff --git a/packages/horizon/test/unit/staking/provision/deprovision.t.sol b/packages/horizon/test/unit/staking/provision/deprovision.t.sol new file mode 100644 index 000000000..4fa97da6c --- /dev/null +++ b/packages/horizon/test/unit/staking/provision/deprovision.t.sol @@ -0,0 +1,152 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { HorizonStakingTest } from "../HorizonStaking.t.sol"; + +contract HorizonStakingDeprovisionTest is HorizonStakingTest { + /* + * TESTS + */ + + function testDeprovision_AllRequests( + uint256 amount, + uint32 maxVerifierCut, + uint64 thawingPeriod, + uint256 thawCount, + uint256 deprovisionCount + ) public useIndexer useProvision(amount, maxVerifierCut, thawingPeriod) { + thawCount = bound(thawCount, 1, 100); + deprovisionCount = bound(deprovisionCount, 0, thawCount); + vm.assume(amount >= thawCount); // ensure the provision has at least 1 token for each thaw step + uint256 individualThawAmount = amount / thawCount; + + for (uint i = 0; i < thawCount; i++) { + _thaw(users.indexer, subgraphDataServiceAddress, individualThawAmount); + } + + skip(thawingPeriod + 1); + + _deprovision(users.indexer, subgraphDataServiceAddress, deprovisionCount); + } + + function testDeprovision_ThawedRequests( + uint256 amount, + uint32 maxVerifierCut, + uint64 thawingPeriod, + uint256 thawCount + ) public useIndexer useProvision(amount, maxVerifierCut, thawingPeriod) { + thawCount = bound(thawCount, 2, 100); + vm.assume(amount >= thawCount); // ensure the provision has at least 1 token for each thaw step + uint256 individualThawAmount = amount / thawCount; + + for (uint i = 0; i < thawCount / 2; i++) { + _thaw(users.indexer, subgraphDataServiceAddress, individualThawAmount); + } + + skip(thawingPeriod + 1); + + for (uint i = 0; i < thawCount / 2; i++) { + _thaw(users.indexer, subgraphDataServiceAddress, individualThawAmount); + } + + _deprovision(users.indexer, subgraphDataServiceAddress, 0); + } + + function testDeprovision_OperatorMovingTokens( + uint256 amount, + uint32 maxVerifierCut, + uint64 thawingPeriod + ) public useIndexer useProvision(amount, maxVerifierCut, thawingPeriod) useOperator { + _thaw(users.indexer, subgraphDataServiceAddress, amount); + skip(thawingPeriod + 1); + + _deprovision(users.indexer, subgraphDataServiceAddress, 0); + } + + function testDeprovision_RevertWhen_OperatorNotAuthorized( + uint256 amount, + uint32 maxVerifierCut, + uint64 thawingPeriod + ) public useIndexer useProvision(amount, maxVerifierCut, thawingPeriod) { + _thaw(users.indexer, subgraphDataServiceAddress, amount); + + vm.startPrank(users.operator); + bytes memory expectedError = abi.encodeWithSignature( + "HorizonStakingNotAuthorized(address,address,address)", + users.indexer, + subgraphDataServiceAddress, + users.operator + ); + vm.expectRevert(expectedError); + staking.deprovision(users.indexer, subgraphDataServiceAddress, 0); + } + + function testDeprovision_RevertWhen_NoThawingTokens( + uint256 amount, + uint32 maxVerifierCut, + uint64 thawingPeriod + ) public useIndexer useProvision(amount, maxVerifierCut, thawingPeriod) { + bytes memory expectedError = abi.encodeWithSignature("HorizonStakingNothingThawing()"); + vm.expectRevert(expectedError); + staking.deprovision(users.indexer, subgraphDataServiceAddress, 0); + } + + function testDeprovision_StillThawing( + uint256 amount, + uint32 maxVerifierCut, + uint64 thawingPeriod + ) public useIndexer useProvision(amount, maxVerifierCut, thawingPeriod) { + vm.assume(thawingPeriod > 0); + + _thaw(users.indexer, subgraphDataServiceAddress, amount); + + _deprovision(users.indexer, subgraphDataServiceAddress, 0); + } + + function testDeprovision_AfterProvisionFullySlashed( + uint256 amount, + uint64 thawingPeriod, + uint256 thawAmount + ) public useIndexer useProvision(amount, 0, thawingPeriod) { + // thaw some funds so there are some shares and tokens thawing + thawAmount = bound(thawAmount, 1, amount); + _thaw(users.indexer, subgraphDataServiceAddress, thawAmount); + + // slash all of it + resetPrank(subgraphDataServiceAddress); + _slash(users.indexer, subgraphDataServiceAddress, amount, 0); + + // now deprovision + resetPrank(users.indexer); + _deprovision(users.indexer, subgraphDataServiceAddress, 0); + } + + function testDeprovision_AfterResetingThawingPool( + uint256 amount, + uint64 thawingPeriod, + uint256 thawAmount + ) public useIndexer useProvision(amount, 0, thawingPeriod) { + // thaw some funds so there are some shares and tokens thawing + thawAmount = bound(thawAmount, 1, amount); + _thaw(users.indexer, subgraphDataServiceAddress, thawAmount); + + // slash all of it + resetPrank(subgraphDataServiceAddress); + _slash(users.indexer, subgraphDataServiceAddress, amount, 0); + + // put some funds back in + resetPrank(users.indexer); + _stake(amount); + _addToProvision(users.indexer, subgraphDataServiceAddress, amount); + + // thaw some funds again + resetPrank(users.indexer); + _thaw(users.indexer, subgraphDataServiceAddress, thawAmount); + + // now deprovision + resetPrank(users.indexer); + _deprovision(users.indexer, subgraphDataServiceAddress, 0); + } +} diff --git a/packages/horizon/test/unit/staking/provision/locked.t.sol b/packages/horizon/test/unit/staking/provision/locked.t.sol new file mode 100644 index 000000000..bc44a32f1 --- /dev/null +++ b/packages/horizon/test/unit/staking/provision/locked.t.sol @@ -0,0 +1,66 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { HorizonStakingTest } from "../HorizonStaking.t.sol"; + +contract HorizonStakingProvisionLockedTest is HorizonStakingTest { + /* + * TESTS + */ + + function testProvisionLocked_Create( + uint256 amount + ) public useIndexer useStake(amount) useLockedVerifier(subgraphDataServiceAddress) { + uint256 provisionTokens = staking.getProviderTokensAvailable(users.indexer, subgraphDataServiceAddress); + assertEq(provisionTokens, 0); + + _setOperatorLocked(subgraphDataServiceAddress, users.operator, true); + + vm.startPrank(users.operator); + _provisionLocked(users.indexer, subgraphDataServiceAddress, amount, MAX_PPM, MAX_THAWING_PERIOD); + + provisionTokens = staking.getProviderTokensAvailable(users.indexer, subgraphDataServiceAddress); + assertEq(provisionTokens, amount); + } + + function testProvisionLocked_RevertWhen_VerifierNotAllowed( + uint256 amount + ) public useIndexer useStake(amount) useLockedVerifier(subgraphDataServiceAddress) { + uint256 provisionTokens = staking.getProviderTokensAvailable(users.indexer, subgraphDataServiceAddress); + assertEq(provisionTokens, 0); + + // Set operator + _setOperatorLocked(subgraphDataServiceAddress, users.operator, true); + + // Disable locked verifier + vm.startPrank(users.governor); + _setAllowedLockedVerifier(subgraphDataServiceAddress, false); + + vm.startPrank(users.operator); + bytes memory expectedError = abi.encodeWithSignature( + "HorizonStakingVerifierNotAllowed(address)", + subgraphDataServiceAddress + ); + vm.expectRevert(expectedError); + staking.provisionLocked(users.indexer, subgraphDataServiceAddress, amount, MAX_PPM, MAX_THAWING_PERIOD); + } + + function testProvisionLocked_RevertWhen_OperatorNotAllowed( + uint256 amount + ) public useIndexer useStake(amount) useLockedVerifier(subgraphDataServiceAddress) { + uint256 provisionTokens = staking.getProviderTokensAvailable(users.indexer, subgraphDataServiceAddress); + assertEq(provisionTokens, 0); + + vm.startPrank(users.operator); + bytes memory expectedError = abi.encodeWithSignature( + "HorizonStakingNotAuthorized(address,address,address)", + users.indexer, + subgraphDataServiceAddress, + users.operator + ); + vm.expectRevert(expectedError); + staking.provisionLocked(users.indexer, subgraphDataServiceAddress, amount, MAX_PPM, MAX_THAWING_PERIOD); + } +} diff --git a/packages/horizon/test/unit/staking/provision/parameters.t.sol b/packages/horizon/test/unit/staking/provision/parameters.t.sol new file mode 100644 index 000000000..bc44876e5 --- /dev/null +++ b/packages/horizon/test/unit/staking/provision/parameters.t.sol @@ -0,0 +1,180 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { HorizonStakingTest } from "../HorizonStaking.t.sol"; +import { IHorizonStakingMain } from "../../../../contracts/interfaces/internal/IHorizonStakingMain.sol"; + +contract HorizonStakingProvisionParametersTest is HorizonStakingTest { + /* + * MODIFIERS + */ + + modifier useValidParameters(uint32 maxVerifierCut, uint64 thawingPeriod) { + vm.assume(maxVerifierCut <= MAX_PPM); + vm.assume(thawingPeriod <= MAX_THAWING_PERIOD); + _; + } + + /* + * TESTS + */ + + function test_ProvisionParametersSet( + uint256 amount, + uint32 maxVerifierCut, + uint64 thawingPeriod + ) public useIndexer useProvision(amount, 0, 0) useValidParameters(maxVerifierCut, thawingPeriod) { + _setProvisionParameters(users.indexer, subgraphDataServiceAddress, maxVerifierCut, thawingPeriod); + } + + function test_ProvisionParametersSet_RevertWhen_ProvisionNotExists( + uint32 maxVerifierCut, + uint64 thawingPeriod + ) public useIndexer useValidParameters(maxVerifierCut, thawingPeriod) { + vm.expectRevert( + abi.encodeWithSignature( + "HorizonStakingInvalidProvision(address,address)", + users.indexer, + subgraphDataServiceAddress + ) + ); + staking.setProvisionParameters(users.indexer, subgraphDataServiceAddress, maxVerifierCut, thawingPeriod); + } + + function test_ProvisionParametersSet_RevertWhen_CallerNotAuthorized( + uint256 amount, + uint32 maxVerifierCut, + uint64 thawingPeriod + ) public useIndexer useProvision(amount, maxVerifierCut, thawingPeriod) { + vm.startPrank(msg.sender); // stop impersonating the indexer + vm.expectRevert( + abi.encodeWithSignature( + "HorizonStakingNotAuthorized(address,address,address)", + users.indexer, + subgraphDataServiceAddress, + msg.sender + ) + ); + staking.setProvisionParameters(users.indexer, subgraphDataServiceAddress, maxVerifierCut, thawingPeriod); + vm.stopPrank(); + } + + function test_ProvisionParametersSet_RevertWhen_ProtocolPaused( + uint256 amount, + uint32 maxVerifierCut, + uint64 thawingPeriod + ) public useIndexer useProvision(amount, maxVerifierCut, thawingPeriod) usePausedStaking { + vm.expectRevert(abi.encodeWithSignature("ManagedIsPaused()")); + staking.setProvisionParameters(users.indexer, subgraphDataServiceAddress, maxVerifierCut, thawingPeriod); + } + + function test_ProvisionParametersSet_MaxMaxThawingPeriodChanged( + uint256 amount, + uint32 maxVerifierCut, + uint64 thawingPeriod + ) public useIndexer { + vm.assume(amount > 0); + vm.assume(amount <= MAX_STAKING_TOKENS); + vm.assume(maxVerifierCut <= MAX_PPM); + + // create provision with initial parameters + uint32 initialMaxVerifierCut = 1000; + uint64 initialThawingPeriod = 14 days; // Max thawing period is 28 days + _createProvision( + users.indexer, + subgraphDataServiceAddress, + amount, + initialMaxVerifierCut, + initialThawingPeriod + ); + + // change the max thawing period allowed so that the initial thawing period is not valid anymore + uint64 newMaxThawingPeriod = 7 days; + resetPrank(users.governor); + _setMaxThawingPeriod(newMaxThawingPeriod); + + // set the verifier cut to a new value - keep the thawing period the same, it should be allowed + resetPrank(users.indexer); + _setProvisionParameters(users.indexer, subgraphDataServiceAddress, maxVerifierCut, initialThawingPeriod); + + // now try to change the thawing period to a new value that is invalid + vm.assume(thawingPeriod > initialThawingPeriod); + vm.expectRevert( + abi.encodeWithSelector( + IHorizonStakingMain.HorizonStakingInvalidThawingPeriod.selector, + thawingPeriod, + newMaxThawingPeriod + ) + ); + staking.setProvisionParameters(users.indexer, subgraphDataServiceAddress, maxVerifierCut, thawingPeriod); + } + + function test_ProvisionParametersAccept( + uint256 amount, + uint32 maxVerifierCut, + uint64 thawingPeriod + ) public useIndexer useProvision(amount, maxVerifierCut, thawingPeriod) { + _setProvisionParameters(users.indexer, subgraphDataServiceAddress, maxVerifierCut, thawingPeriod); + + vm.startPrank(subgraphDataServiceAddress); + _acceptProvisionParameters(users.indexer); + vm.stopPrank(); + } + + function test_ProvisionParametersAccept_SameParameters( + uint256 amount, + uint32 maxVerifierCut, + uint64 thawingPeriod + ) public useIndexer useProvision(amount, maxVerifierCut, thawingPeriod) { + _setProvisionParameters(users.indexer, subgraphDataServiceAddress, maxVerifierCut, thawingPeriod); + + vm.startPrank(subgraphDataServiceAddress); + _acceptProvisionParameters(users.indexer); + _acceptProvisionParameters(users.indexer); + vm.stopPrank(); + } + + function test_ProvisionParameters_RevertIf_InvalidMaxVerifierCut( + uint256 amount, + uint32 maxVerifierCut, + uint64 thawingPeriod + ) public useIndexer useProvision(amount, maxVerifierCut, thawingPeriod) { + maxVerifierCut = uint32(bound(maxVerifierCut, MAX_PPM + 1, type(uint32).max)); + vm.assume(thawingPeriod <= MAX_THAWING_PERIOD); + vm.expectRevert( + abi.encodeWithSelector(IHorizonStakingMain.HorizonStakingInvalidMaxVerifierCut.selector, maxVerifierCut) + ); + staking.setProvisionParameters(users.indexer, subgraphDataServiceAddress, maxVerifierCut, thawingPeriod); + } + + function test_ProvisionParameters_RevertIf_InvalidThawingPeriod( + uint256 amount, + uint32 maxVerifierCut, + uint64 thawingPeriod + ) public useIndexer useProvision(amount, maxVerifierCut, thawingPeriod) { + vm.assume(maxVerifierCut <= MAX_PPM); + thawingPeriod = uint64(bound(thawingPeriod, MAX_THAWING_PERIOD + 1, type(uint64).max)); + vm.expectRevert( + abi.encodeWithSelector( + IHorizonStakingMain.HorizonStakingInvalidThawingPeriod.selector, + thawingPeriod, + MAX_THAWING_PERIOD + ) + ); + staking.setProvisionParameters(users.indexer, subgraphDataServiceAddress, maxVerifierCut, thawingPeriod); + } + + function test_ProvisionParametersAccept_RevertWhen_ProvisionNotExists() public useIndexer { + resetPrank(subgraphDataServiceAddress); + vm.expectRevert( + abi.encodeWithSignature( + "HorizonStakingInvalidProvision(address,address)", + users.indexer, + subgraphDataServiceAddress + ) + ); + staking.acceptProvisionParameters(users.indexer); + } +} diff --git a/packages/horizon/test/unit/staking/provision/provision.t.sol b/packages/horizon/test/unit/staking/provision/provision.t.sol new file mode 100644 index 000000000..c87e13a45 --- /dev/null +++ b/packages/horizon/test/unit/staking/provision/provision.t.sol @@ -0,0 +1,223 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { HorizonStakingTest } from "../HorizonStaking.t.sol"; + +contract HorizonStakingProvisionTest is HorizonStakingTest { + /* + * TESTS + */ + + function testProvision_Create(uint256 tokens, uint32 maxVerifierCut, uint64 thawingPeriod) public useIndexer { + tokens = bound(tokens, 1, MAX_STAKING_TOKENS); + maxVerifierCut = uint32(bound(maxVerifierCut, 0, MAX_PPM)); + thawingPeriod = uint32(bound(thawingPeriod, 0, MAX_THAWING_PERIOD)); + + _createProvision(users.indexer, subgraphDataServiceAddress, tokens, maxVerifierCut, thawingPeriod); + } + + function testProvision_RevertWhen_ZeroTokens() public useIndexer useStake(1000 ether) { + bytes memory expectedError = abi.encodeWithSignature("HorizonStakingInvalidZeroTokens()"); + vm.expectRevert(expectedError); + staking.provision(users.indexer, subgraphDataServiceAddress, 0, 0, 0); + } + + function testProvision_RevertWhen_MaxVerifierCutTooHigh( + uint256 amount, + uint32 maxVerifierCut + ) public useIndexer useStake(amount) { + vm.assume(maxVerifierCut > MAX_PPM); + bytes memory expectedError = abi.encodeWithSignature( + "HorizonStakingInvalidMaxVerifierCut(uint32)", + maxVerifierCut + ); + vm.expectRevert(expectedError); + staking.provision(users.indexer, subgraphDataServiceAddress, amount, maxVerifierCut, 0); + } + + function testProvision_RevertWhen_ThawingPeriodTooHigh( + uint256 amount, + uint64 thawingPeriod + ) public useIndexer useStake(amount) { + vm.assume(thawingPeriod > MAX_THAWING_PERIOD); + bytes memory expectedError = abi.encodeWithSignature( + "HorizonStakingInvalidThawingPeriod(uint64,uint64)", + thawingPeriod, + MAX_THAWING_PERIOD + ); + vm.expectRevert(expectedError); + staking.provision(users.indexer, subgraphDataServiceAddress, amount, 0, thawingPeriod); + } + + function testProvision_RevertWhen_ThereIsNoIdleStake( + uint256 amount, + uint256 provisionTokens + ) public useIndexer useStake(amount) { + vm.assume(provisionTokens > amount); + bytes memory expectedError = abi.encodeWithSignature( + "HorizonStakingInsufficientIdleStake(uint256,uint256)", + provisionTokens, + amount + ); + vm.expectRevert(expectedError); + staking.provision(users.indexer, subgraphDataServiceAddress, provisionTokens, 0, 0); + } + + function testProvision_RevertWhen_AlreadyExists( + uint256 amount, + uint32 maxVerifierCut, + uint64 thawingPeriod + ) public useIndexer useProvision(amount / 2, maxVerifierCut, thawingPeriod) { + resetPrank(users.indexer); + + token.approve(address(staking), amount / 2); + _stake(amount / 2); + + bytes memory expectedError = abi.encodeWithSignature("HorizonStakingProvisionAlreadyExists()"); + vm.expectRevert(expectedError); + staking.provision(users.indexer, subgraphDataServiceAddress, amount / 2, maxVerifierCut, thawingPeriod); + } + + function testProvision_RevertWhen_OperatorNotAuthorized( + uint256 amount, + uint32 maxVerifierCut, + uint64 thawingPeriod + ) public useIndexer useProvision(amount, maxVerifierCut, thawingPeriod) { + vm.startPrank(users.operator); + bytes memory expectedError = abi.encodeWithSignature( + "HorizonStakingNotAuthorized(address,address,address)", + users.indexer, + subgraphDataServiceAddress, + users.operator + ); + vm.expectRevert(expectedError); + staking.provision(users.indexer, subgraphDataServiceAddress, amount, maxVerifierCut, thawingPeriod); + } + + function testProvision_RevertWhen_VerifierIsNotSubgraphDataServiceDuringTransitionPeriod( + uint256 amount + ) public useIndexer useStake(amount) { + // simulate the transition period + _setStorage_DeprecatedThawingPeriod(THAWING_PERIOD_IN_BLOCKS); + + // oddly we use subgraphDataServiceLegacyAddress as the subgraph service address + // so subgraphDataServiceAddress is not the subgraph service ¯\_(ツ)_/¯ + bytes memory expectedError = abi.encodeWithSignature( + "HorizonStakingInvalidVerifier(address)", + subgraphDataServiceAddress + ); + vm.expectRevert(expectedError); + staking.provision(users.indexer, subgraphDataServiceAddress, amount, 0, 0); + } + + function testProvision_AddTokensToProvision( + uint256 amount, + uint32 maxVerifierCut, + uint64 thawingPeriod, + uint256 tokensToAdd + ) public useIndexer useProvision(amount, maxVerifierCut, thawingPeriod) { + tokensToAdd = bound(tokensToAdd, 1, MAX_STAKING_TOKENS); + + // Add more tokens to the provision + _stakeTo(users.indexer, tokensToAdd); + _addToProvision(users.indexer, subgraphDataServiceAddress, tokensToAdd); + } + + function testProvision_OperatorAddTokensToProvision( + uint256 amount, + uint32 maxVerifierCut, + uint64 thawingPeriod, + uint256 tokensToAdd + ) public useIndexer useProvision(amount, maxVerifierCut, thawingPeriod) useOperator { + tokensToAdd = bound(tokensToAdd, 1, MAX_STAKING_TOKENS); + + // Add more tokens to the provision + _stakeTo(users.indexer, tokensToAdd); + _addToProvision(users.indexer, subgraphDataServiceAddress, tokensToAdd); + } + + function testProvision_AddTokensToProvision_RevertWhen_NotAuthorized( + uint256 amount, + uint32 maxVerifierCut, + uint64 thawingPeriod, + uint256 tokensToAdd + ) public useIndexer useProvision(amount, maxVerifierCut, thawingPeriod) { + tokensToAdd = bound(tokensToAdd, 1, MAX_STAKING_TOKENS); + + // Add more tokens to the provision + _stakeTo(users.indexer, tokensToAdd); + + // use delegator as a non authorized operator + vm.startPrank(users.delegator); + bytes memory expectedError = abi.encodeWithSignature( + "HorizonStakingNotAuthorized(address,address,address)", + users.indexer, + subgraphDataServiceAddress, + users.delegator + ); + vm.expectRevert(expectedError); + staking.addToProvision(users.indexer, subgraphDataServiceAddress, amount); + } + + function testProvision_StakeToProvision( + uint256 amount, + uint32 maxVerifierCut, + uint64 thawingPeriod, + uint256 tokensToAdd + ) public useIndexer useProvision(amount, maxVerifierCut, thawingPeriod) { + tokensToAdd = bound(tokensToAdd, 1, MAX_STAKING_TOKENS); + + // Add more tokens to the provision + _stakeToProvision(users.indexer, subgraphDataServiceAddress, tokensToAdd); + } + + function testProvision_Operator_StakeToProvision( + uint256 amount, + uint32 maxVerifierCut, + uint64 thawingPeriod, + uint256 tokensToAdd + ) public useIndexer useProvision(amount, maxVerifierCut, thawingPeriod) useOperator { + tokensToAdd = bound(tokensToAdd, 1, MAX_STAKING_TOKENS); + + // Add more tokens to the provision + _stakeToProvision(users.indexer, subgraphDataServiceAddress, tokensToAdd); + } + + function testProvision_Verifier_StakeToProvision( + uint256 amount, + uint32 maxVerifierCut, + uint64 thawingPeriod, + uint256 tokensToAdd + ) public useIndexer useProvision(amount, maxVerifierCut, thawingPeriod) { + tokensToAdd = bound(tokensToAdd, 1, MAX_STAKING_TOKENS); + + // Ensure the verifier has enough tokens to then stake to the provision + token.transfer(subgraphDataServiceAddress, tokensToAdd); + + // Add more tokens to the provision + resetPrank(subgraphDataServiceAddress); + _stakeToProvision(users.indexer, subgraphDataServiceAddress, tokensToAdd); + } + + function testProvision_StakeToProvision_RevertWhen_NotAuthorized( + uint256 amount, + uint32 maxVerifierCut, + uint64 thawingPeriod, + uint256 tokensToAdd + ) public useIndexer useProvision(amount, maxVerifierCut, thawingPeriod) { + tokensToAdd = bound(tokensToAdd, 1, MAX_STAKING_TOKENS); + + // Add more tokens to the provision + vm.startPrank(users.delegator); + bytes memory expectedError = abi.encodeWithSignature( + "HorizonStakingNotAuthorized(address,address,address)", + users.indexer, + subgraphDataServiceAddress, + users.delegator + ); + vm.expectRevert(expectedError); + staking.stakeToProvision(users.indexer, subgraphDataServiceAddress, tokensToAdd); + } +} diff --git a/packages/horizon/test/unit/staking/provision/reprovision.t.sol b/packages/horizon/test/unit/staking/provision/reprovision.t.sol new file mode 100644 index 000000000..be650019f --- /dev/null +++ b/packages/horizon/test/unit/staking/provision/reprovision.t.sol @@ -0,0 +1,74 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { HorizonStakingTest } from "../HorizonStaking.t.sol"; + +contract HorizonStakingReprovisionTest is HorizonStakingTest { + /* + * VARIABLES + */ + + address private newDataService = makeAddr("newDataService"); + + /* + * TESTS + */ + + function testReprovision_MovingTokens( + uint64 thawingPeriod, + uint256 provisionAmount + ) public useIndexer useProvision(provisionAmount, 0, thawingPeriod) { + _thaw(users.indexer, subgraphDataServiceAddress, provisionAmount); + skip(thawingPeriod + 1); + + _createProvision(users.indexer, newDataService, 1 ether, 0, thawingPeriod); + + _reprovision(users.indexer, subgraphDataServiceAddress, newDataService, 0); + } + + function testReprovision_OperatorMovingTokens( + uint64 thawingPeriod, + uint256 provisionAmount + ) public useOperator useProvision(provisionAmount, 0, thawingPeriod) { + _thaw(users.indexer, subgraphDataServiceAddress, provisionAmount); + skip(thawingPeriod + 1); + + // Switch to indexer to set operator for new data service + vm.startPrank(users.indexer); + _setOperator(newDataService, users.operator, true); + + // Switch back to operator + vm.startPrank(users.operator); + _createProvision(users.indexer, newDataService, 1 ether, 0, thawingPeriod); + _reprovision(users.indexer, subgraphDataServiceAddress, newDataService, 0); + } + + function testReprovision_RevertWhen_OperatorNotAuthorizedForNewDataService( + uint256 provisionAmount + ) public useOperator useProvision(provisionAmount, 0, 0) { + _thaw(users.indexer, subgraphDataServiceAddress, provisionAmount); + + // Switch to indexer to create new provision + vm.startPrank(users.indexer); + _createProvision(users.indexer, newDataService, 1 ether, 0, 0); + + // Switch back to operator + vm.startPrank(users.operator); + bytes memory expectedError = abi.encodeWithSignature( + "HorizonStakingNotAuthorized(address,address,address)", + users.indexer, + newDataService, + users.operator + ); + vm.expectRevert(expectedError); + staking.reprovision(users.indexer, subgraphDataServiceAddress, newDataService, 0); + } + + function testReprovision_RevertWhen_NoThawingTokens(uint256 amount) public useIndexer useProvision(amount, 0, 0) { + bytes memory expectedError = abi.encodeWithSignature("HorizonStakingNothingThawing()"); + vm.expectRevert(expectedError); + staking.reprovision(users.indexer, subgraphDataServiceAddress, newDataService, 0); + } +} diff --git a/packages/horizon/test/unit/staking/provision/thaw.t.sol b/packages/horizon/test/unit/staking/provision/thaw.t.sol new file mode 100644 index 000000000..6b57a7b70 --- /dev/null +++ b/packages/horizon/test/unit/staking/provision/thaw.t.sol @@ -0,0 +1,237 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { IHorizonStakingTypes } from "../../../../contracts/interfaces/internal/IHorizonStakingTypes.sol"; +import { HorizonStakingTest } from "../HorizonStaking.t.sol"; + +contract HorizonStakingThawTest is HorizonStakingTest { + /* + * TESTS + */ + + function testThaw_Tokens( + uint256 amount, + uint64 thawingPeriod, + uint256 thawAmount + ) public useIndexer useProvision(amount, 0, thawingPeriod) { + thawAmount = bound(thawAmount, 1, amount); + + _thaw(users.indexer, subgraphDataServiceAddress, thawAmount); + } + + function testThaw_MultipleRequests( + uint256 amount, + uint64 thawingPeriod, + uint256 thawCount + ) public useIndexer useProvision(amount, 0, thawingPeriod) { + thawCount = bound(thawCount, 1, 100); + vm.assume(amount >= thawCount); // ensure the provision has at least 1 token for each thaw step + uint256 individualThawAmount = amount / thawCount; + + for (uint i = 0; i < thawCount; i++) { + _thaw(users.indexer, subgraphDataServiceAddress, individualThawAmount); + } + } + + function testThaw_OperatorCanStartThawing( + uint256 amount, + uint64 thawingPeriod + ) public useIndexer useProvision(amount, 0, thawingPeriod) useOperator { + _thaw(users.indexer, subgraphDataServiceAddress, amount); + } + + function testThaw_RevertWhen_OperatorNotAuthorized( + uint256 amount, + uint64 thawingPeriod + ) public useIndexer useProvision(amount, 0, thawingPeriod) { + vm.startPrank(users.operator); + bytes memory expectedError = abi.encodeWithSignature( + "HorizonStakingNotAuthorized(address,address,address)", + users.indexer, + subgraphDataServiceAddress, + users.operator + ); + vm.expectRevert(expectedError); + staking.thaw(users.indexer, subgraphDataServiceAddress, amount); + } + + function testThaw_RevertWhen_InsufficientTokensAvailable( + uint256 amount, + uint64 thawingPeriod, + uint256 thawAmount + ) public useIndexer useProvision(amount, 0, thawingPeriod) { + vm.assume(thawAmount > amount); + bytes memory expectedError = abi.encodeWithSignature( + "HorizonStakingInsufficientTokens(uint256,uint256)", + amount, + thawAmount + ); + vm.expectRevert(expectedError); + staking.thaw(users.indexer, subgraphDataServiceAddress, thawAmount); + } + + function testThaw_RevertWhen_OverMaxThawRequests() public useIndexer useProvision(10000 ether, 0, 0) { + uint256 thawAmount = 1 ether; + + for (uint256 i = 0; i < MAX_THAW_REQUESTS; i++) { + _thaw(users.indexer, subgraphDataServiceAddress, thawAmount); + } + + bytes memory expectedError = abi.encodeWithSignature("HorizonStakingTooManyThawRequests()"); + vm.expectRevert(expectedError); + staking.thaw(users.indexer, subgraphDataServiceAddress, thawAmount); + } + + function testThaw_RevertWhen_ThawingZeroTokens( + uint256 amount, + uint64 thawingPeriod + ) public useIndexer useProvision(amount, 0, thawingPeriod) { + uint256 thawAmount = 0 ether; + bytes memory expectedError = abi.encodeWithSignature("HorizonStakingInvalidZeroTokens()"); + vm.expectRevert(expectedError); + staking.thaw(users.indexer, subgraphDataServiceAddress, thawAmount); + } + + function testThaw_RevertWhen_ProvisionFullySlashed( + uint256 amount, + uint64 thawingPeriod, + uint256 thawAmount + ) public useIndexer useProvision(amount, 0, thawingPeriod) { + thawAmount = bound(thawAmount, 1, amount); + + // slash all of it + resetPrank(subgraphDataServiceAddress); + _slash(users.indexer, subgraphDataServiceAddress, amount, 0); + + // Attempt to thaw on a provision that has been fully slashed + resetPrank(users.indexer); + bytes memory expectedError = abi.encodeWithSignature( + "HorizonStakingInsufficientTokens(uint256,uint256)", + 0, + thawAmount + ); + vm.expectRevert(expectedError); + staking.thaw(users.indexer, subgraphDataServiceAddress, thawAmount); + } + + function testThaw_AfterResetingThawingPool( + uint256 amount, + uint64 thawingPeriod, + uint256 thawAmount + ) public useIndexer useProvision(amount, 0, thawingPeriod) { + // thaw some funds so there are some shares thawing and tokens thawing + thawAmount = bound(thawAmount, 1, amount); + _thaw(users.indexer, subgraphDataServiceAddress, thawAmount); + + // slash all of it + resetPrank(subgraphDataServiceAddress); + _slash(users.indexer, subgraphDataServiceAddress, amount, 0); + + // put some funds back in + resetPrank(users.indexer); + _stake(amount); + _addToProvision(users.indexer, subgraphDataServiceAddress, amount); + + // we should be able to thaw again + resetPrank(users.indexer); + _thaw(users.indexer, subgraphDataServiceAddress, thawAmount); + } + + function testThaw_GetThawedTokens( + uint256 amount, + uint64 thawingPeriod, + uint256 thawSteps + ) public useIndexer useProvision(amount, 0, thawingPeriod) { + thawSteps = bound(thawSteps, 1, 10); + + uint256 thawAmount = amount / thawSteps; + vm.assume(thawAmount > 0); + for (uint256 i = 0; i < thawSteps; i++) { + _thaw(users.indexer, subgraphDataServiceAddress, thawAmount); + } + + skip(thawingPeriod + 1); + + uint256 thawedTokens = staking.getThawedTokens( + ThawRequestType.Provision, + users.indexer, + subgraphDataServiceAddress, + users.indexer + ); + vm.assertEq(thawedTokens, thawAmount * thawSteps); + } + + function testThaw_GetThawedTokens_AfterProvisionFullySlashed( + uint256 amount, + uint64 thawingPeriod, + uint256 thawAmount + ) public useIndexer useProvision(amount, 0, thawingPeriod) { + // thaw some funds so there are some shares thawing and tokens thawing + thawAmount = bound(thawAmount, 1, amount); + _thaw(users.indexer, subgraphDataServiceAddress, thawAmount); + + // skip to after the thawing period has passed + skip(thawingPeriod + 1); + + // slash all of it + resetPrank(subgraphDataServiceAddress); + _slash(users.indexer, subgraphDataServiceAddress, amount, 0); + + // get the thawed tokens - should be zero now as the pool was reset + uint256 thawedTokens = staking.getThawedTokens( + ThawRequestType.Provision, + users.indexer, + subgraphDataServiceAddress, + users.indexer + ); + vm.assertEq(thawedTokens, 0); + } + + function testThaw_GetThawedTokens_AfterRecoveringProvision( + uint256 amount, + uint64 thawingPeriod, + uint256 thawAmount + ) public useIndexer useProvision(amount, 0, thawingPeriod) { + // thaw some funds so there are some shares thawing and tokens thawing + thawAmount = bound(thawAmount, 1, amount); + _thaw(users.indexer, subgraphDataServiceAddress, thawAmount); + + // skip to after the thawing period has passed + skip(thawingPeriod + 1); + + // slash all of it + resetPrank(subgraphDataServiceAddress); + _slash(users.indexer, subgraphDataServiceAddress, amount, 0); + + // get the thawed tokens - should be zero now as the pool was reset + uint256 thawedTokens = staking.getThawedTokens( + ThawRequestType.Provision, + users.indexer, + subgraphDataServiceAddress, + users.indexer + ); + vm.assertEq(thawedTokens, 0); + + // put some funds back in + resetPrank(users.indexer); + _stake(amount); + _addToProvision(users.indexer, subgraphDataServiceAddress, amount); + + // thaw some more funds + _thaw(users.indexer, subgraphDataServiceAddress, thawAmount); + + // skip to after the thawing period has passed + skip(block.timestamp + thawingPeriod + 1); + + // get the thawed tokens - should be the amount we thawed + thawedTokens = staking.getThawedTokens( + ThawRequestType.Provision, + users.indexer, + subgraphDataServiceAddress, + users.indexer + ); + vm.assertEq(thawedTokens, thawAmount); + } +} diff --git a/packages/horizon/test/unit/staking/serviceProvider/serviceProvider.t.sol b/packages/horizon/test/unit/staking/serviceProvider/serviceProvider.t.sol new file mode 100644 index 000000000..053130db1 --- /dev/null +++ b/packages/horizon/test/unit/staking/serviceProvider/serviceProvider.t.sol @@ -0,0 +1,147 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { IHorizonStakingMain } from "../../../../contracts/interfaces/internal/IHorizonStakingMain.sol"; +import { IGraphPayments } from "../../../../contracts/interfaces/IGraphPayments.sol"; + +import { HorizonStakingTest } from "../HorizonStaking.t.sol"; + +contract HorizonStakingServiceProviderTest is HorizonStakingTest { + /* + * TESTS + */ + + function testServiceProvider_GetProvider( + uint256 amount, + uint256 operatorAmount, + uint32 maxVerifierCut, + uint64 thawingPeriod + ) public useIndexer useProvision(amount, maxVerifierCut, thawingPeriod) { + operatorAmount = bound(operatorAmount, 1, MAX_STAKING_TOKENS); + ServiceProvider memory sp = staking.getServiceProvider(users.indexer); + assertEq(sp.tokensStaked, amount); + assertEq(sp.tokensProvisioned, amount); + + _setOperator(subgraphDataServiceAddress, users.operator, true); + resetPrank(users.operator); + _stakeTo(users.indexer, operatorAmount); + sp = staking.getServiceProvider(users.indexer); + assertEq(sp.tokensStaked, amount + operatorAmount); + assertEq(sp.tokensProvisioned, amount); + } + + function testServiceProvider_SetDelegationFeeCut(uint256 feeCut, uint8 paymentTypeInput) public useIndexer { + vm.assume(paymentTypeInput < 3); + IGraphPayments.PaymentTypes paymentType = IGraphPayments.PaymentTypes(paymentTypeInput); + feeCut = bound(feeCut, 0, MAX_PPM); + _setDelegationFeeCut(users.indexer, subgraphDataServiceAddress, paymentType, feeCut); + } + + function testServiceProvider_GetProvision( + uint256 amount, + uint256 thawAmount, + uint32 maxVerifierCut, + uint64 thawingPeriod + ) public useIndexer useProvision(amount, maxVerifierCut, thawingPeriod) { + thawAmount = bound(thawAmount, 1, amount); + Provision memory p = staking.getProvision(users.indexer, subgraphDataServiceAddress); + assertEq(p.tokens, amount); + assertEq(p.tokensThawing, 0); + assertEq(p.sharesThawing, 0); + assertEq(p.maxVerifierCut, maxVerifierCut); + assertEq(p.thawingPeriod, thawingPeriod); + assertEq(p.createdAt, block.timestamp); + assertEq(p.maxVerifierCutPending, maxVerifierCut); + assertEq(p.thawingPeriodPending, thawingPeriod); + + _thaw(users.indexer, subgraphDataServiceAddress, thawAmount); + p = staking.getProvision(users.indexer, subgraphDataServiceAddress); + assertEq(p.tokensThawing, thawAmount); + } + + function testServiceProvider_GetTokensAvailable( + uint256 amount, + uint256 thawAmount, + uint32 maxVerifierCut, + uint64 thawingPeriod + ) public useIndexer useProvision(amount, maxVerifierCut, thawingPeriod) { + thawAmount = bound(thawAmount, 1, amount); + uint256 tokensAvailable = staking.getTokensAvailable(users.indexer, subgraphDataServiceAddress, 0); + assertEq(tokensAvailable, amount); + + _thaw(users.indexer, subgraphDataServiceAddress, thawAmount); + tokensAvailable = staking.getTokensAvailable(users.indexer, subgraphDataServiceAddress, 0); + assertEq(tokensAvailable, amount - thawAmount); + } + + function testServiceProvider_GetTokensAvailable_WithDelegation( + uint256 amount, + uint256 delegationAmount, + uint32 delegationRatio + ) public useIndexer useProvision(amount, MAX_PPM, MAX_THAWING_PERIOD) useDelegation(delegationAmount) { + uint256 tokensAvailable = staking.getTokensAvailable( + users.indexer, + subgraphDataServiceAddress, + delegationRatio + ); + + uint256 tokensDelegatedMax = amount * (uint256(delegationRatio)); + uint256 tokensDelegatedCapacity = delegationAmount > tokensDelegatedMax ? tokensDelegatedMax : delegationAmount; + assertEq(tokensAvailable, amount + tokensDelegatedCapacity); + } + + function testServiceProvider_GetProviderTokensAvailable( + uint256 amount, + uint256 delegationAmount + ) public useIndexer useProvision(amount, MAX_PPM, MAX_THAWING_PERIOD) useDelegation(delegationAmount) { + uint256 providerTokensAvailable = staking.getProviderTokensAvailable(users.indexer, subgraphDataServiceAddress); + // Should not include delegated tokens + assertEq(providerTokensAvailable, amount); + } + + function testServiceProvider_HasStake( + uint256 amount + ) public useIndexer useProvision(amount, MAX_PPM, MAX_THAWING_PERIOD) { + assertTrue(staking.hasStake(users.indexer)); + + _thaw(users.indexer, subgraphDataServiceAddress, amount); + skip(MAX_THAWING_PERIOD + 1); + _deprovision(users.indexer, subgraphDataServiceAddress, 0); + staking.unstake(amount); + + assertFalse(staking.hasStake(users.indexer)); + } + + function testServiceProvider_GetIndexerStakedTokens( + uint256 amount + ) public useIndexer useProvision(amount, MAX_PPM, MAX_THAWING_PERIOD) { + assertEq(staking.getIndexerStakedTokens(users.indexer), amount); + + _thaw(users.indexer, subgraphDataServiceAddress, amount); + // Does not discount thawing tokens + assertEq(staking.getIndexerStakedTokens(users.indexer), amount); + + skip(MAX_THAWING_PERIOD + 1); + _deprovision(users.indexer, subgraphDataServiceAddress, 0); + // Does not discount thawing tokens + assertEq(staking.getIndexerStakedTokens(users.indexer), amount); + + staking.unstake(amount); + assertEq(staking.getIndexerStakedTokens(users.indexer), 0); + } + + function testServiceProvider_RevertIf_InvalidDelegationFeeCut( + uint256 cut, + uint8 paymentTypeInput + ) public useIndexer { + vm.assume(paymentTypeInput < 3); + IGraphPayments.PaymentTypes paymentType = IGraphPayments.PaymentTypes(paymentTypeInput); + cut = bound(cut, MAX_PPM + 1, MAX_PPM + 100); + vm.expectRevert( + abi.encodeWithSelector(IHorizonStakingMain.HorizonStakingInvalidDelegationFeeCut.selector, cut) + ); + staking.setDelegationFeeCut(users.indexer, subgraphDataServiceAddress, paymentType, cut); + } +} diff --git a/packages/horizon/test/unit/staking/slash/legacySlash.t.sol b/packages/horizon/test/unit/staking/slash/legacySlash.t.sol new file mode 100644 index 000000000..d4dda3f2f --- /dev/null +++ b/packages/horizon/test/unit/staking/slash/legacySlash.t.sol @@ -0,0 +1,253 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { IHorizonStakingExtension } from "../../../../contracts/interfaces/internal/IHorizonStakingExtension.sol"; + +import { HorizonStakingTest } from "../HorizonStaking.t.sol"; + +contract HorizonStakingLegacySlashTest is HorizonStakingTest { + /* + * MODIFIERS + */ + + modifier useLegacySlasher(address slasher) { + bytes32 storageKey = keccak256(abi.encode(slasher, 18)); + vm.store(address(staking), storageKey, bytes32(uint256(1))); + _; + } + + /* + * HELPERS + */ + + function _setIndexer( + address _indexer, + uint256 _tokensStaked, + uint256 _tokensAllocated, + uint256 _tokensLocked, + uint256 _tokensLockedUntil + ) public { + bytes32 baseSlot = keccak256(abi.encode(_indexer, 14)); + + vm.store(address(staking), bytes32(uint256(baseSlot)), bytes32(_tokensStaked)); + vm.store(address(staking), bytes32(uint256(baseSlot) + 1), bytes32(_tokensAllocated)); + vm.store(address(staking), bytes32(uint256(baseSlot) + 2), bytes32(_tokensLocked)); + vm.store(address(staking), bytes32(uint256(baseSlot) + 3), bytes32(_tokensLockedUntil)); + } + + /* + * ACTIONS + */ + + function _legacySlash(address _indexer, uint256 _tokens, uint256 _rewards, address _beneficiary) internal { + // before + uint256 beforeStakingBalance = token.balanceOf(address(staking)); + uint256 beforeRewardsDestinationBalance = token.balanceOf(_beneficiary); + ServiceProviderInternal memory beforeIndexer = _getStorage_ServiceProviderInternal(_indexer); + + // calculate slashable stake + uint256 slashableStake = beforeIndexer.tokensStaked - beforeIndexer.tokensProvisioned; + uint256 actualTokens = _tokens; + uint256 actualRewards = _rewards; + if (slashableStake == 0) { + actualTokens = 0; + actualRewards = 0; + } else if (_tokens > slashableStake) { + actualRewards = (_rewards * slashableStake) / _tokens; + actualTokens = slashableStake; + } + + // slash + vm.expectEmit(address(staking)); + emit IHorizonStakingExtension.StakeSlashed(_indexer, actualTokens, actualRewards, _beneficiary); + staking.slash(_indexer, _tokens, _rewards, _beneficiary); + + // after + uint256 afterStakingBalance = token.balanceOf(address(staking)); + uint256 afterRewardsDestinationBalance = token.balanceOf(_beneficiary); + ServiceProviderInternal memory afterIndexer = _getStorage_ServiceProviderInternal(_indexer); + + assertEq(beforeStakingBalance - actualTokens, afterStakingBalance); + assertEq(beforeRewardsDestinationBalance, afterRewardsDestinationBalance - actualRewards); + assertEq(afterIndexer.tokensStaked, beforeIndexer.tokensStaked - actualTokens); + } + + /* + * TESTS + */ + function testSlash_Legacy( + uint256 tokensStaked, + uint256 tokensProvisioned, + uint256 slashTokens, + uint256 reward + ) public useIndexer useLegacySlasher(users.legacySlasher) { + vm.assume(tokensStaked > 0); + vm.assume(tokensStaked <= MAX_STAKING_TOKENS); + vm.assume(tokensProvisioned > 0); + vm.assume(tokensProvisioned <= tokensStaked); + slashTokens = bound(slashTokens, 1, tokensStaked); + reward = bound(reward, 0, slashTokens); + + _stake(tokensStaked); + _provision(users.indexer, subgraphDataServiceLegacyAddress, tokensProvisioned, 0, 0); + + resetPrank(users.legacySlasher); + _legacySlash(users.indexer, slashTokens, reward, makeAddr("fisherman")); + } + + function testSlash_Legacy_UsingLockedTokens( + uint256 tokens, + uint256 slashTokens, + uint256 reward + ) public useIndexer useLegacySlasher(users.legacySlasher) { + vm.assume(tokens > 1); + slashTokens = bound(slashTokens, 1, tokens); + reward = bound(reward, 0, slashTokens); + + _setIndexer(users.indexer, tokens, 0, tokens, block.timestamp + 1); + // Send tokens manually to staking + token.transfer(address(staking), tokens); + + resetPrank(users.legacySlasher); + _legacySlash(users.indexer, slashTokens, reward, makeAddr("fisherman")); + } + + function testSlash_Legacy_UsingAllocatedTokens( + uint256 tokens, + uint256 slashTokens, + uint256 reward + ) public useIndexer useLegacySlasher(users.legacySlasher) { + vm.assume(tokens > 1); + slashTokens = bound(slashTokens, 1, tokens); + reward = bound(reward, 0, slashTokens); + + _setIndexer(users.indexer, tokens, 0, tokens, 0); + // Send tokens manually to staking + token.transfer(address(staking), tokens); + + resetPrank(users.legacySlasher); + staking.legacySlash(users.indexer, slashTokens, reward, makeAddr("fisherman")); + } + + function testSlash_Legacy_RevertWhen_CallerNotSlasher( + uint256 tokens, + uint256 slashTokens, + uint256 reward + ) public useIndexer { + vm.assume(tokens > 0); + _createProvision(users.indexer, subgraphDataServiceLegacyAddress, tokens, 0, 0); + + vm.expectRevert("!slasher"); + staking.legacySlash(users.indexer, slashTokens, reward, makeAddr("fisherman")); + } + + function testSlash_Legacy_RevertWhen_RewardsOverSlashTokens( + uint256 tokens, + uint256 slashTokens, + uint256 reward + ) public useIndexer useLegacySlasher(users.legacySlasher) { + vm.assume(tokens > 0); + vm.assume(slashTokens > 0); + vm.assume(reward > slashTokens); + + _createProvision(users.indexer, subgraphDataServiceLegacyAddress, tokens, 0, 0); + + resetPrank(users.legacySlasher); + vm.expectRevert("rewards>slash"); + staking.legacySlash(users.indexer, slashTokens, reward, makeAddr("fisherman")); + } + + function testSlash_Legacy_RevertWhen_NoStake( + uint256 slashTokens, + uint256 reward + ) public useLegacySlasher(users.legacySlasher) { + vm.assume(slashTokens > 0); + reward = bound(reward, 0, slashTokens); + + resetPrank(users.legacySlasher); + vm.expectRevert("!stake"); + staking.legacySlash(users.indexer, slashTokens, reward, makeAddr("fisherman")); + } + + function testSlash_Legacy_RevertWhen_ZeroTokens( + uint256 tokens + ) public useIndexer useLegacySlasher(users.legacySlasher) { + vm.assume(tokens > 0); + + _createProvision(users.indexer, subgraphDataServiceLegacyAddress, tokens, 0, 0); + + resetPrank(users.legacySlasher); + vm.expectRevert("!tokens"); + staking.legacySlash(users.indexer, 0, 0, makeAddr("fisherman")); + } + + function testSlash_Legacy_RevertWhen_NoBeneficiary( + uint256 tokens, + uint256 slashTokens, + uint256 reward + ) public useIndexer useLegacySlasher(users.legacySlasher) { + vm.assume(tokens > 0); + slashTokens = bound(slashTokens, 1, tokens); + reward = bound(reward, 0, slashTokens); + + _createProvision(users.indexer, subgraphDataServiceLegacyAddress, tokens, 0, 0); + + resetPrank(users.legacySlasher); + vm.expectRevert("!beneficiary"); + staking.legacySlash(users.indexer, slashTokens, reward, address(0)); + } + + function test_LegacySlash_WhenTokensAllocatedGreaterThanStake() + public + useIndexer + useLegacySlasher(users.legacySlasher) + { + // Setup indexer with: + // - tokensStaked = 1000 GRT + // - tokensAllocated = 800 GRT + // - tokensLocked = 300 GRT + // This means tokensUsed (1100 GRT) > tokensStaked (1000 GRT) + _setIndexer( + users.indexer, + 1000 ether, // tokensStaked + 800 ether, // tokensAllocated + 300 ether, // tokensLocked + 0 // tokensLockedUntil + ); + + // Send tokens manually to staking + token.transfer(address(staking), 1100 ether); + + resetPrank(users.legacySlasher); + _legacySlash(users.indexer, 1000 ether, 500 ether, makeAddr("fisherman")); + } + + function test_LegacySlash_WhenDelegateCallFails() public useIndexer useLegacySlasher(users.legacySlasher) { + // Setup indexer with: + // - tokensStaked = 1000 GRT + // - tokensAllocated = 800 GRT + // - tokensLocked = 300 GRT + + _setIndexer( + users.indexer, + 1000 ether, // tokensStaked + 800 ether, // tokensAllocated + 300 ether, // tokensLocked + 0 // tokensLockedUntil + ); + + // Send tokens manually to staking + token.transfer(address(staking), 1100 ether); + + // Change staking extension code to an invalid opcode so the delegatecall reverts + address stakingExtension = staking.getStakingExtension(); + vm.etch(stakingExtension, hex"fe"); + + resetPrank(users.legacySlasher); + bytes memory expectedError = abi.encodeWithSignature("HorizonStakingLegacySlashFailed()"); + vm.expectRevert(expectedError); + staking.slash(users.indexer, 1000 ether, 500 ether, makeAddr("fisherman")); + } +} diff --git a/packages/horizon/test/unit/staking/slash/slash.t.sol b/packages/horizon/test/unit/staking/slash/slash.t.sol new file mode 100644 index 000000000..ffe76c5a8 --- /dev/null +++ b/packages/horizon/test/unit/staking/slash/slash.t.sol @@ -0,0 +1,193 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { IHorizonStakingMain } from "../../../../contracts/interfaces/internal/IHorizonStakingMain.sol"; + +import { HorizonStakingTest } from "../HorizonStaking.t.sol"; + +contract HorizonStakingSlashTest is HorizonStakingTest { + /* + * TESTS + */ + + function testSlash_Tokens( + uint256 tokens, + uint32 maxVerifierCut, + uint256 slashTokens, + uint256 verifierCutAmount + ) public useIndexer useProvision(tokens, maxVerifierCut, 0) { + slashTokens = bound(slashTokens, 1, tokens); + uint256 maxVerifierTokens = (slashTokens * maxVerifierCut) / MAX_PPM; + vm.assume(verifierCutAmount <= maxVerifierTokens); + + vm.startPrank(subgraphDataServiceAddress); + _slash(users.indexer, subgraphDataServiceAddress, slashTokens, verifierCutAmount); + } + + function testSlash_Tokens_RevertWhen_TooManyVerifierTokens( + uint256 tokens, + uint32 maxVerifierCut, + uint256 slashTokens, + uint256 verifierCutAmount + ) public useIndexer useProvision(tokens, maxVerifierCut, 0) { + slashTokens = bound(slashTokens, 1, tokens); + uint256 maxVerifierTokens = (slashTokens * maxVerifierCut) / MAX_PPM; + vm.assume(verifierCutAmount > maxVerifierTokens); + + vm.startPrank(subgraphDataServiceAddress); + vm.assume(slashTokens > 0); + bytes memory expectedError = abi.encodeWithSelector( + IHorizonStakingMain.HorizonStakingTooManyTokens.selector, + verifierCutAmount, + maxVerifierTokens + ); + vm.expectRevert(expectedError); + staking.slash(users.indexer, slashTokens, verifierCutAmount, subgraphDataServiceAddress); + } + + function testSlash_DelegationDisabled_SlashingOverProviderTokens( + uint256 tokens, + uint256 slashTokens, + uint256 verifierCutAmount, + uint256 delegationTokens + ) public useIndexer useProvision(tokens, MAX_PPM, 0) { + vm.assume(slashTokens > tokens); + delegationTokens = bound(delegationTokens, MIN_DELEGATION, MAX_STAKING_TOKENS); + verifierCutAmount = bound(verifierCutAmount, 0, MAX_PPM); + vm.assume(verifierCutAmount <= tokens); + + resetPrank(users.delegator); + _delegate(users.indexer, subgraphDataServiceAddress, delegationTokens, 0); + + vm.startPrank(subgraphDataServiceAddress); + _slash(users.indexer, subgraphDataServiceAddress, slashTokens, verifierCutAmount); + } + + function testSlash_DelegationEnabled_SlashingOverProviderTokens( + uint256 tokens, + uint256 slashTokens, + uint256 verifierCutAmount, + uint256 delegationTokens + ) public useIndexer useProvision(tokens, MAX_PPM, 0) useDelegationSlashing { + delegationTokens = bound(delegationTokens, MIN_DELEGATION, MAX_STAKING_TOKENS); + slashTokens = bound(slashTokens, tokens + 1, tokens + 1 + delegationTokens); + verifierCutAmount = bound(verifierCutAmount, 0, tokens); + + resetPrank(users.delegator); + _delegate(users.indexer, subgraphDataServiceAddress, delegationTokens, 0); + + vm.startPrank(subgraphDataServiceAddress); + _slash(users.indexer, subgraphDataServiceAddress, slashTokens, verifierCutAmount); + } + + function testSlash_OverProvisionSize( + uint256 tokens, + uint256 slashTokens, + uint256 delegationTokens + ) public useIndexer useProvision(tokens, MAX_PPM, 0) { + delegationTokens = bound(delegationTokens, 0, MAX_STAKING_TOKENS); + vm.assume(slashTokens > tokens + delegationTokens); + + vm.startPrank(subgraphDataServiceAddress); + _slash(users.indexer, subgraphDataServiceAddress, slashTokens, 0); + } + + function testSlash_RevertWhen_NoProvision(uint256 tokens, uint256 slashTokens) public useIndexer useStake(tokens) { + vm.assume(slashTokens > 0); + bytes memory expectedError = abi.encodeWithSelector(IHorizonStakingMain.HorizonStakingNoTokensToSlash.selector); + vm.expectRevert(expectedError); + vm.startPrank(subgraphDataServiceAddress); + staking.slash(users.indexer, slashTokens, 0, subgraphDataServiceAddress); + } + + function testSlash_Everything( + uint256 tokens, + uint256 delegationTokens + ) public useIndexer useProvision(tokens, MAX_PPM, 0) useDelegationSlashing { + delegationTokens = bound(delegationTokens, MIN_DELEGATION, MAX_STAKING_TOKENS); + + resetPrank(users.delegator); + _delegate(users.indexer, subgraphDataServiceAddress, delegationTokens, 0); + + vm.startPrank(subgraphDataServiceAddress); + _slash(users.indexer, subgraphDataServiceAddress, tokens + delegationTokens, 0); + } + + function testSlash_Everything_WithUndelegation( + uint256 tokens + ) public useIndexer useProvision(tokens, MAX_PPM, 0) useDelegationSlashing { + uint256 delegationTokens = MAX_STAKING_TOKENS / 10; + + resetPrank(users.delegator); + _delegate(users.indexer, subgraphDataServiceAddress, delegationTokens, 0); + + // undelegate half shares so we have some thawing shares/tokens + DelegationInternal memory delegation = _getStorage_Delegation( + users.indexer, + subgraphDataServiceAddress, + users.delegator, + false + ); + resetPrank(users.delegator); + _undelegate(users.indexer, subgraphDataServiceAddress, delegation.shares / 2); + + vm.startPrank(subgraphDataServiceAddress); + _slash(users.indexer, subgraphDataServiceAddress, tokens + delegationTokens, 0); + } + + function testSlash_RoundDown_TokensThawing_Provision( + uint256 tokens, + uint256 slashTokens, + uint256 tokensToThaw + ) public useIndexer { + vm.assume(slashTokens <= tokens); + vm.assume(tokensToThaw <= tokens); + vm.assume(tokensToThaw > 0); + + _useProvision(subgraphDataServiceAddress, tokens, MAX_PPM, MAX_THAWING_PERIOD); + _thaw(users.indexer, subgraphDataServiceAddress, tokensToThaw); + + Provision memory beforeProvision = staking.getProvision(users.indexer, subgraphDataServiceAddress); + + resetPrank(subgraphDataServiceAddress); + _slash(users.indexer, subgraphDataServiceAddress, slashTokens, 0); + + Provision memory afterProvision = staking.getProvision(users.indexer, subgraphDataServiceAddress); + assertEq(afterProvision.tokens, beforeProvision.tokens - slashTokens); + assertEq( + afterProvision.tokensThawing, + (beforeProvision.tokensThawing * (beforeProvision.tokens - slashTokens)) / beforeProvision.tokens + ); + } + + function testSlash_RoundDown_TokensThawing_Delegation( + uint256 tokens, + uint256 delegationTokensToSlash, + uint256 delegationTokensToUndelegate + ) public useIndexer useProvision(tokens, MAX_PPM, 0) useDelegationSlashing { + uint256 delegationTokens = 10 ether; + + vm.assume(delegationTokensToSlash <= delegationTokens); + vm.assume(delegationTokensToUndelegate <= delegationTokens); + vm.assume(delegationTokensToUndelegate > 0); + + resetPrank(users.delegator); + _delegate(users.indexer, subgraphDataServiceAddress, delegationTokens, 0); + _undelegate(users.indexer, subgraphDataServiceAddress, delegationTokensToUndelegate); + + DelegationPool memory beforePool = staking.getDelegationPool(users.indexer, subgraphDataServiceAddress); + + // Slash + resetPrank(subgraphDataServiceAddress); + _slash(users.indexer, subgraphDataServiceAddress, tokens + delegationTokensToSlash, 0); + + DelegationPool memory afterPool = staking.getDelegationPool(users.indexer, subgraphDataServiceAddress); + assertEq(afterPool.tokens, beforePool.tokens - delegationTokensToSlash); + assertEq( + afterPool.tokensThawing, + (beforePool.tokensThawing * (beforePool.tokens - delegationTokensToSlash)) / beforePool.tokens + ); + } +} diff --git a/packages/horizon/test/unit/staking/stake/stake.t.sol b/packages/horizon/test/unit/staking/stake/stake.t.sol new file mode 100644 index 000000000..bf62de8b7 --- /dev/null +++ b/packages/horizon/test/unit/staking/stake/stake.t.sol @@ -0,0 +1,34 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { HorizonStakingTest } from "../HorizonStaking.t.sol"; + +contract HorizonStakingStakeTest is HorizonStakingTest { + /* + * TESTS + */ + + function testStake_Tokens(uint256 amount) public useIndexer { + amount = bound(amount, 1, MAX_STAKING_TOKENS); + _stake(amount); + } + + function testStake_RevertWhen_ZeroTokens() public useIndexer { + bytes memory expectedError = abi.encodeWithSignature("HorizonStakingInvalidZeroTokens()"); + vm.expectRevert(expectedError); + staking.stake(0); + } + + function testStakeTo_Tokens(uint256 amount) public useOperator { + amount = bound(amount, 1, MAX_STAKING_TOKENS); + _stakeTo(users.indexer, amount); + } + + function testStakeTo_RevertWhen_ZeroTokens() public useOperator { + bytes memory expectedError = abi.encodeWithSignature("HorizonStakingInvalidZeroTokens()"); + vm.expectRevert(expectedError); + staking.stakeTo(users.indexer, 0); + } +} diff --git a/packages/horizon/test/unit/staking/stake/unstake.t.sol b/packages/horizon/test/unit/staking/stake/unstake.t.sol new file mode 100644 index 000000000..83c6a0a81 --- /dev/null +++ b/packages/horizon/test/unit/staking/stake/unstake.t.sol @@ -0,0 +1,147 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { HorizonStakingTest } from "../HorizonStaking.t.sol"; + +contract HorizonStakingUnstakeTest is HorizonStakingTest { + /* + * TESTS + */ + + function testUnstake_Tokens( + uint256 tokens, + uint256 tokensToUnstake, + uint32 maxVerifierCut, + uint64 thawingPeriod + ) public useIndexer useProvision(tokens, maxVerifierCut, thawingPeriod) { + tokensToUnstake = bound(tokensToUnstake, 1, tokens); + + // thaw, wait and deprovision + _thaw(users.indexer, subgraphDataServiceAddress, tokens); + skip(thawingPeriod + 1); + _deprovision(users.indexer, subgraphDataServiceAddress, 0); + + _unstake(tokensToUnstake); + } + + function testUnstake_LockingPeriodGreaterThanZero_NoThawing( + uint256 tokens, + uint256 tokensToUnstake, + uint32 maxVerifierCut, + uint64 thawingPeriod + ) public useIndexer useProvision(tokens, maxVerifierCut, thawingPeriod) { + tokensToUnstake = bound(tokensToUnstake, 1, tokens); + + // simulate transition period + _setStorage_DeprecatedThawingPeriod(THAWING_PERIOD_IN_BLOCKS); + + // thaw, wait and deprovision + _thaw(users.indexer, subgraphDataServiceAddress, tokens); + skip(thawingPeriod + 1); + _deprovision(users.indexer, subgraphDataServiceAddress, 0); + + // unstake + _unstake(tokensToUnstake); + } + + function testUnstake_LockingPeriodGreaterThanZero_TokensDoneThawing( + uint256 tokens, + uint256 tokensToUnstake, + uint256 tokensLocked + ) public useIndexer { + // bounds + tokens = bound(tokens, 1, MAX_STAKING_TOKENS); + tokensToUnstake = bound(tokensToUnstake, 1, tokens); + tokensLocked = bound(tokensLocked, 1, MAX_STAKING_TOKENS); + + // simulate locked tokens with past locking period + _setStorage_DeprecatedThawingPeriod(THAWING_PERIOD_IN_BLOCKS); + token.transfer(address(staking), tokensLocked); + _setStorage_ServiceProvider(users.indexer, tokensLocked, 0, tokensLocked, block.number, 0); + + // create provision, thaw and deprovision + _createProvision(users.indexer, subgraphDataServiceLegacyAddress, tokens, 0, MAX_THAWING_PERIOD); + _thaw(users.indexer, subgraphDataServiceLegacyAddress, tokens); + skip(MAX_THAWING_PERIOD + 1); + _deprovision(users.indexer, subgraphDataServiceLegacyAddress, 0); + + // unstake + _unstake(tokensToUnstake); + } + + function testUnstake_LockingPeriodGreaterThanZero_TokensStillThawing( + uint256 tokens, + uint256 tokensToUnstake, + uint256 tokensThawing, + uint32 tokensThawingUntilBlock + ) public useIndexer { + // bounds + tokens = bound(tokens, 1, MAX_STAKING_TOKENS); + tokensToUnstake = bound(tokensToUnstake, 1, tokens); + tokensThawing = bound(tokensThawing, 1, MAX_STAKING_TOKENS); + vm.assume(tokensThawingUntilBlock > block.number); + vm.assume(tokensThawingUntilBlock < block.number + THAWING_PERIOD_IN_BLOCKS); + + // simulate locked tokens still thawing + _setStorage_DeprecatedThawingPeriod(THAWING_PERIOD_IN_BLOCKS); + token.transfer(address(staking), tokensThawing); + _setStorage_ServiceProvider(users.indexer, tokensThawing, 0, tokensThawing, tokensThawingUntilBlock, 0); + + // create provision, thaw and deprovision + _createProvision(users.indexer, subgraphDataServiceLegacyAddress, tokens, 0, MAX_THAWING_PERIOD); + _thaw(users.indexer, subgraphDataServiceLegacyAddress, tokens); + skip(MAX_THAWING_PERIOD + 1); + _deprovision(users.indexer, subgraphDataServiceLegacyAddress, 0); + + // unstake + _unstake(tokensToUnstake); + } + + function testUnstake_RevertWhen_ZeroTokens( + uint256 amount, + uint32 maxVerifierCut, + uint64 thawingPeriod + ) + public + useIndexer + useProvision(amount, maxVerifierCut, thawingPeriod) + useThawAndDeprovision(amount, thawingPeriod) + { + bytes memory expectedError = abi.encodeWithSignature("HorizonStakingInvalidZeroTokens()"); + vm.expectRevert(expectedError); + staking.unstake(0); + } + + function testUnstake_RevertWhen_NoIdleStake( + uint256 amount, + uint32 maxVerifierCut, + uint64 thawingPeriod + ) public useIndexer useProvision(amount, maxVerifierCut, thawingPeriod) { + bytes memory expectedError = abi.encodeWithSignature( + "HorizonStakingInsufficientIdleStake(uint256,uint256)", + amount, + 0 + ); + vm.expectRevert(expectedError); + staking.unstake(amount); + } + + function testUnstake_RevertWhen_NotDeprovision( + uint256 amount, + uint32 maxVerifierCut, + uint64 thawingPeriod + ) public useIndexer useProvision(amount, maxVerifierCut, thawingPeriod) { + _thaw(users.indexer, subgraphDataServiceAddress, amount); + skip(thawingPeriod + 1); + + bytes memory expectedError = abi.encodeWithSignature( + "HorizonStakingInsufficientIdleStake(uint256,uint256)", + amount, + 0 + ); + vm.expectRevert(expectedError); + staking.unstake(amount); + } +} diff --git a/packages/horizon/test/unit/staking/stake/withdraw.t.sol b/packages/horizon/test/unit/staking/stake/withdraw.t.sol new file mode 100644 index 000000000..5968838b4 --- /dev/null +++ b/packages/horizon/test/unit/staking/stake/withdraw.t.sol @@ -0,0 +1,55 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { IHorizonStakingMain } from "../../../../contracts/interfaces/internal/IHorizonStakingMain.sol"; + +import { HorizonStakingTest } from "../HorizonStaking.t.sol"; + +contract HorizonStakingWithdrawTest is HorizonStakingTest { + /* + * TESTS + */ + + function testWithdraw_Tokens(uint256 tokens, uint256 tokensLocked) public useIndexer { + tokens = bound(tokens, 1, MAX_STAKING_TOKENS); + tokensLocked = bound(tokensLocked, 1, tokens); + + // simulate locked tokens ready to withdraw + token.transfer(address(staking), tokens); + _setStorage_ServiceProvider(users.indexer, tokens, 0, tokensLocked, block.number, 0); + + _createProvision(users.indexer, subgraphDataServiceAddress, tokens, 0, MAX_THAWING_PERIOD); + + _withdraw(); + } + + function testWithdraw_RevertWhen_ZeroTokens(uint256 tokens) public useIndexer { + tokens = bound(tokens, 1, MAX_STAKING_TOKENS); + + // simulate zero locked tokens + token.transfer(address(staking), tokens); + _setStorage_ServiceProvider(users.indexer, tokens, 0, 0, 0, 0); + + _createProvision(users.indexer, subgraphDataServiceLegacyAddress, tokens, 0, MAX_THAWING_PERIOD); + + vm.expectRevert(abi.encodeWithSelector(IHorizonStakingMain.HorizonStakingInvalidZeroTokens.selector)); + staking.withdraw(); + } + + function testWithdraw_RevertWhen_StillThawing(uint256 tokens, uint256 tokensLocked) public useIndexer { + tokens = bound(tokens, 1, MAX_STAKING_TOKENS); + tokensLocked = bound(tokensLocked, 1, tokens); + + // simulate locked tokens still thawing + uint256 thawUntil = block.timestamp + 1; + token.transfer(address(staking), tokens); + _setStorage_ServiceProvider(users.indexer, tokens, 0, tokensLocked, thawUntil, 0); + + _createProvision(users.indexer, subgraphDataServiceLegacyAddress, tokens, 0, MAX_THAWING_PERIOD); + + vm.expectRevert(abi.encodeWithSelector(IHorizonStakingMain.HorizonStakingStillThawing.selector, thawUntil)); + staking.withdraw(); + } +} diff --git a/packages/horizon/test/unit/utilities/Authorizable.t.sol b/packages/horizon/test/unit/utilities/Authorizable.t.sol new file mode 100644 index 000000000..4528b339d --- /dev/null +++ b/packages/horizon/test/unit/utilities/Authorizable.t.sol @@ -0,0 +1,404 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity 0.8.27; + +import { Test } from "forge-std/Test.sol"; + +import { Authorizable } from "../../../contracts/utilities/Authorizable.sol"; +import { IAuthorizable } from "../../../contracts/interfaces/IAuthorizable.sol"; +import { Bounder } from "../utils/Bounder.t.sol"; + +import { MessageHashUtils } from "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol"; + +contract AuthorizableImp is Authorizable { + constructor(uint256 _revokeAuthorizationThawingPeriod) Authorizable(_revokeAuthorizationThawingPeriod) {} +} + +contract AuthorizableTest is Test, Bounder { + AuthorizableImp public authorizable; + AuthorizableHelper authHelper; + + modifier withFuzzyThaw(uint256 _thawPeriod) { + // Max thaw period is 1 year to allow for thawing tests + _thawPeriod = bound(_thawPeriod, 1, 60 * 60 * 24 * 365); + setupAuthorizable(new AuthorizableImp(_thawPeriod)); + _; + } + + function setUp() public virtual { + setupAuthorizable(new AuthorizableImp(0)); + } + + function setupAuthorizable(AuthorizableImp _authorizable) internal { + authorizable = _authorizable; + authHelper = new AuthorizableHelper(authorizable); + } + + function test_AuthorizeSigner(uint256 _unboundedKey, address _authorizer) public { + vm.assume(_authorizer != address(0)); + uint256 signerKey = boundKey(_unboundedKey); + + authHelper.authorizeSignerWithChecks(_authorizer, signerKey); + } + + function test_AuthorizeSigner_Revert_WhenAlreadyAuthorized( + uint256[] memory _unboundedAuthorizers, + uint256 _unboundedKey + ) public { + vm.assume(_unboundedAuthorizers.length > 1); + address[] memory authorizers = new address[](_unboundedAuthorizers.length); + for (uint256 i = 0; i < authorizers.length; i++) { + authorizers[i] = boundAddr(_unboundedAuthorizers[i]); + } + (uint256 signerKey, address signer) = boundAddrAndKey(_unboundedKey); + + address validAuthorizer = authorizers[0]; + authHelper.authorizeSignerWithChecks(validAuthorizer, signerKey); + + bytes memory expectedErr = abi.encodeWithSelector( + IAuthorizable.AuthorizableSignerAlreadyAuthorized.selector, + validAuthorizer, + signer, + false + ); + + for (uint256 i = 0; i < authorizers.length; i++) { + vm.expectRevert(expectedErr); + vm.prank(authorizers[i]); + authorizable.authorizeSigner(signer, 0, ""); + } + } + + function test_AuthorizeSigner_Revert_WhenInvalidProofDeadline(uint256 _proofDeadline, uint256 _now) public { + _proofDeadline = bound(_proofDeadline, 0, _now); + vm.warp(_now); + + bytes memory expectedErr = abi.encodeWithSelector( + IAuthorizable.AuthorizableInvalidSignerProofDeadline.selector, + _proofDeadline, + _now + ); + vm.expectRevert(expectedErr); + authorizable.authorizeSigner(address(0), _proofDeadline, ""); + } + + function test_AuthorizeSigner_Revert_WhenAuthorizableInvalidSignerProof( + uint256 _now, + uint256 _unboundedAuthorizer, + uint256 _unboundedKey, + uint256 _proofDeadline, + uint256 _chainid, + uint256 _wrong + ) public { + _now = bound(_now, 0, type(uint256).max - 1); + address authorizer = boundAddr(_unboundedAuthorizer); + (uint256 signerKey, address signer) = boundAddrAndKey(_unboundedKey); + _proofDeadline = boundTimestampMin(_proofDeadline, _now + 1); + vm.assume(_wrong != _proofDeadline); + _chainid = boundChainId(_chainid); + vm.assume(_wrong != _chainid); + (uint256 wrongKey, address wrongAddress) = boundAddrAndKey(_wrong); + vm.assume(wrongKey != signerKey); + vm.assume(wrongAddress != authorizer); + + vm.chainId(_chainid); + vm.warp(_now); + + bytes memory validProof = authHelper.generateAuthorizationProof( + _chainid, + address(authorizable), + _proofDeadline, + authorizer, + signerKey + ); + bytes[5] memory proofs = [ + authHelper.generateAuthorizationProof(_wrong, address(authorizable), _proofDeadline, authorizer, signerKey), + authHelper.generateAuthorizationProof(_chainid, wrongAddress, _proofDeadline, authorizer, signerKey), + authHelper.generateAuthorizationProof(_chainid, address(authorizable), _wrong, authorizer, signerKey), + authHelper.generateAuthorizationProof( + _chainid, + address(authorizable), + _proofDeadline, + wrongAddress, + signerKey + ), + authHelper.generateAuthorizationProof(_chainid, address(authorizable), _proofDeadline, authorizer, wrongKey) + ]; + + for (uint256 i = 0; i < proofs.length; i++) { + vm.expectRevert(IAuthorizable.AuthorizableInvalidSignerProof.selector); + vm.prank(authorizer); + authorizable.authorizeSigner(signer, _proofDeadline, proofs[i]); + } + + vm.prank(authorizer); + authorizable.authorizeSigner(signer, _proofDeadline, validProof); + authHelper.assertAuthorized(authorizer, signer); + } + + function test_ThawSigner(address _authorizer, uint256 _unboundedKey, uint256 _thaw) public withFuzzyThaw(_thaw) { + vm.assume(_authorizer != address(0)); + uint256 signerKey = boundKey(_unboundedKey); + + authHelper.authorizeAndThawSignerWithChecks(_authorizer, signerKey); + } + + function test_ThawSigner_Revert_WhenNotAuthorized(address _authorizer, address _signer) public { + vm.assume(_authorizer != address(0)); + vm.assume(_signer != address(0)); + + bytes memory expectedErr = abi.encodeWithSelector( + IAuthorizable.AuthorizableSignerNotAuthorized.selector, + _authorizer, + _signer + ); + vm.expectRevert(expectedErr); + vm.prank(_authorizer); + authorizable.thawSigner(_signer); + } + + function test_ThawSigner_Revert_WhenAuthorizationRevoked( + address _authorizer, + uint256 _unboundedKey, + uint256 _thaw + ) public withFuzzyThaw(_thaw) { + vm.assume(_authorizer != address(0)); + (uint256 signerKey, address signer) = boundAddrAndKey(_unboundedKey); + authHelper.authorizeAndRevokeSignerWithChecks(_authorizer, signerKey); + + bytes memory expectedErr = abi.encodeWithSelector( + IAuthorizable.AuthorizableSignerNotAuthorized.selector, + _authorizer, + signer + ); + vm.expectRevert(expectedErr); + vm.prank(_authorizer); + authorizable.thawSigner(signer); + } + + function test_CancelThawSigner( + address _authorizer, + uint256 _unboundedKey, + uint256 _thaw + ) public withFuzzyThaw(_thaw) { + vm.assume(_authorizer != address(0)); + (uint256 signerKey, address signer) = boundAddrAndKey(_unboundedKey); + + authHelper.authorizeAndThawSignerWithChecks(_authorizer, signerKey); + vm.expectEmit(address(authorizable)); + emit IAuthorizable.SignerThawCanceled(_authorizer, signer, authorizable.getThawEnd(signer)); + vm.prank(_authorizer); + authorizable.cancelThawSigner(signer); + + authHelper.assertAuthorized(_authorizer, signer); + } + + function test_CancelThawSigner_Revert_When_NotAuthorized(address _authorizer, address _signer) public { + vm.assume(_authorizer != address(0)); + vm.assume(_signer != address(0)); + + bytes memory expectedErr = abi.encodeWithSelector( + IAuthorizable.AuthorizableSignerNotAuthorized.selector, + _authorizer, + _signer + ); + vm.expectRevert(expectedErr); + vm.prank(_authorizer); + authorizable.cancelThawSigner(_signer); + } + + function test_CancelThawSigner_Revert_WhenAuthorizationRevoked( + address _authorizer, + uint256 _unboundedKey, + uint256 _thaw + ) public withFuzzyThaw(_thaw) { + vm.assume(_authorizer != address(0)); + (uint256 signerKey, address signer) = boundAddrAndKey(_unboundedKey); + authHelper.authorizeAndRevokeSignerWithChecks(_authorizer, signerKey); + + bytes memory expectedErr = abi.encodeWithSelector( + IAuthorizable.AuthorizableSignerNotAuthorized.selector, + _authorizer, + signer + ); + vm.expectRevert(expectedErr); + vm.prank(_authorizer); + authorizable.cancelThawSigner(signer); + } + + function test_CancelThawSigner_Revert_When_NotThawing(address _authorizer, uint256 _unboundedKey) public { + vm.assume(_authorizer != address(0)); + (uint256 signerKey, address signer) = boundAddrAndKey(_unboundedKey); + + authHelper.authorizeSignerWithChecks(_authorizer, signerKey); + + bytes memory expectedErr = abi.encodeWithSelector(IAuthorizable.AuthorizableSignerNotThawing.selector, signer); + vm.expectRevert(expectedErr); + vm.prank(_authorizer); + authorizable.cancelThawSigner(signer); + } + + function test_RevokeAuthorizedSigner( + address _authorizer, + uint256 _unboundedKey, + uint256 _thaw + ) public withFuzzyThaw(_thaw) { + vm.assume(_authorizer != address(0)); + uint256 signerKey = boundKey(_unboundedKey); + + authHelper.authorizeAndRevokeSignerWithChecks(_authorizer, signerKey); + } + + function test_RevokeAuthorizedSigner_Revert_WhenNotAuthorized(address _authorizer, address _signer) public { + vm.assume(_authorizer != address(0)); + vm.assume(_signer != address(0)); + + bytes memory expectedErr = abi.encodeWithSelector( + IAuthorizable.AuthorizableSignerNotAuthorized.selector, + _authorizer, + _signer + ); + vm.expectRevert(expectedErr); + vm.prank(_authorizer); + authorizable.revokeAuthorizedSigner(_signer); + } + + function test_RevokeAuthorizedSigner_Revert_WhenAuthorizationRevoked( + address _authorizer, + uint256 _unboundedKey, + uint256 _thaw + ) public withFuzzyThaw(_thaw) { + vm.assume(_authorizer != address(0)); + (uint256 signerKey, address signer) = boundAddrAndKey(_unboundedKey); + authHelper.authorizeAndRevokeSignerWithChecks(_authorizer, signerKey); + + bytes memory expectedErr = abi.encodeWithSelector( + IAuthorizable.AuthorizableSignerNotAuthorized.selector, + _authorizer, + signer + ); + vm.expectRevert(expectedErr); + vm.prank(_authorizer); + authorizable.revokeAuthorizedSigner(signer); + } + + function test_RevokeAuthorizedSigner_Revert_WhenNotThawing(address _authorizer, uint256 _unboundedKey) public { + vm.assume(_authorizer != address(0)); + (uint256 signerKey, address signer) = boundAddrAndKey(_unboundedKey); + + authHelper.authorizeSignerWithChecks(_authorizer, signerKey); + bytes memory expectedErr = abi.encodeWithSelector(IAuthorizable.AuthorizableSignerNotThawing.selector, signer); + vm.expectRevert(expectedErr); + vm.prank(_authorizer); + authorizable.revokeAuthorizedSigner(signer); + } + + function test_RevokeAuthorizedSigner_Revert_WhenStillThawing( + address _authorizer, + uint256 _unboundedKey, + uint256 _thaw, + uint256 _skip + ) public withFuzzyThaw(_thaw) { + vm.assume(_authorizer != address(0)); + (uint256 signerKey, address signer) = boundAddrAndKey(_unboundedKey); + + authHelper.authorizeAndThawSignerWithChecks(_authorizer, signerKey); + + _skip = bound(_skip, 0, authorizable.REVOKE_AUTHORIZATION_THAWING_PERIOD() - 1); + skip(_skip); + bytes memory expectedErr = abi.encodeWithSelector( + IAuthorizable.AuthorizableSignerStillThawing.selector, + block.timestamp, + block.timestamp - _skip + authorizable.REVOKE_AUTHORIZATION_THAWING_PERIOD() + ); + vm.expectRevert(expectedErr); + vm.prank(_authorizer); + authorizable.revokeAuthorizedSigner(signer); + } + + function test_IsAuthorized_Revert_WhenZero(address signer) public view { + authHelper.assertNotAuthorized(address(0), signer); + } +} + +contract AuthorizableHelper is Test { + AuthorizableImp internal authorizable; + + constructor(AuthorizableImp _authorizable) { + authorizable = _authorizable; + } + + function authorizeAndThawSignerWithChecks(address _authorizer, uint256 _signerKey) public { + address signer = vm.addr(_signerKey); + authorizeSignerWithChecks(_authorizer, _signerKey); + + uint256 thawEndTimestamp = block.timestamp + authorizable.REVOKE_AUTHORIZATION_THAWING_PERIOD(); + vm.expectEmit(address(authorizable)); + emit IAuthorizable.SignerThawing(_authorizer, signer, thawEndTimestamp); + vm.prank(_authorizer); + authorizable.thawSigner(signer); + + assertAuthorized(_authorizer, signer); + } + + function authorizeAndRevokeSignerWithChecks(address _authorizer, uint256 _signerKey) public { + address signer = vm.addr(_signerKey); + authorizeAndThawSignerWithChecks(_authorizer, _signerKey); + skip(authorizable.REVOKE_AUTHORIZATION_THAWING_PERIOD() + 1); + vm.expectEmit(address(authorizable)); + emit IAuthorizable.SignerRevoked(_authorizer, signer); + vm.prank(_authorizer); + authorizable.revokeAuthorizedSigner(signer); + + assertNotAuthorized(_authorizer, signer); + } + + function authorizeSignerWithChecks(address _authorizer, uint256 _signerKey) public { + address signer = vm.addr(_signerKey); + assertNotAuthorized(_authorizer, signer); + + uint256 proofDeadline = block.timestamp + 1; + bytes memory proof = generateAuthorizationProof( + block.chainid, + address(authorizable), + proofDeadline, + _authorizer, + _signerKey + ); + vm.expectEmit(address(authorizable)); + emit IAuthorizable.SignerAuthorized(_authorizer, signer); + vm.prank(_authorizer); + authorizable.authorizeSigner(signer, proofDeadline, proof); + + assertAuthorized(_authorizer, signer); + } + + function assertNotAuthorized(address _authorizer, address _signer) public view { + assertFalse(authorizable.isAuthorized(_authorizer, _signer), "Should not be authorized"); + } + + function assertAuthorized(address _authorizer, address _signer) public view { + assertTrue(authorizable.isAuthorized(_authorizer, _signer), "Should be authorized"); + } + + function generateAuthorizationProof( + uint256 _chainId, + address _verifyingContract, + uint256 _proofDeadline, + address _authorizer, + uint256 _signerPrivateKey + ) public pure returns (bytes memory) { + // Generate the message hash + bytes32 messageHash = keccak256( + abi.encodePacked(_chainId, _verifyingContract, "authorizeSignerProof", _proofDeadline, _authorizer) + ); + + // Generate the digest to sign + bytes32 digest = MessageHashUtils.toEthSignedMessageHash(messageHash); + + // Sign the digest + (uint8 v, bytes32 r, bytes32 s) = vm.sign(_signerPrivateKey, digest); + + // Encode the signature + return abi.encodePacked(r, s, v); + } +} diff --git a/packages/horizon/test/unit/utilities/GraphDirectory.t.sol b/packages/horizon/test/unit/utilities/GraphDirectory.t.sol new file mode 100644 index 000000000..180590a1e --- /dev/null +++ b/packages/horizon/test/unit/utilities/GraphDirectory.t.sol @@ -0,0 +1,71 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; +import { stdStorage, StdStorage } from "forge-std/Test.sol"; +import { GraphBaseTest } from "../GraphBase.t.sol"; +import { GraphDirectory } from "./../../../contracts/utilities/GraphDirectory.sol"; +import { GraphDirectoryImplementation } from "./GraphDirectoryImplementation.sol"; + +contract GraphDirectoryTest is GraphBaseTest { + function test_WhenTheContractIsDeployedWithAValidController() external { + vm.expectEmit(); + emit GraphDirectory.GraphDirectoryInitialized( + _getContractFromController("GraphToken"), + _getContractFromController("Staking"), + _getContractFromController("GraphPayments"), + _getContractFromController("PaymentsEscrow"), + address(controller), + _getContractFromController("EpochManager"), + _getContractFromController("RewardsManager"), + _getContractFromController("GraphTokenGateway"), + _getContractFromController("GraphProxyAdmin"), + _getContractFromController("Curation") + ); + _deployImplementation(address(controller)); + } + + function test_RevertWhen_TheContractIsDeployedWithAnInvalidController(address controller_) external { + vm.assume(controller_ != address(controller)); + vm.assume(uint160(controller_) > 9); // Skip precompiled contracts + + vm.expectRevert(); // call to getContractProxy on a random address reverts + _deployImplementation(controller_); + } + + function test_RevertWhen_TheContractIsDeployedWithTheZeroAddressAsTheInvalidController() external { + vm.expectRevert(abi.encodeWithSelector(GraphDirectory.GraphDirectoryInvalidZeroAddress.selector, "Controller")); // call to getContractProxy on a random address reverts + _deployImplementation(address(0)); + } + + function test_WhenTheContractGettersAreCalled() external { + GraphDirectoryImplementation directory = _deployImplementation(address(controller)); + + assertEq(_getContractFromController("GraphToken"), address(directory.graphToken())); + assertEq(_getContractFromController("Staking"), address(directory.graphStaking())); + assertEq(_getContractFromController("GraphPayments"), address(directory.graphPayments())); + assertEq(_getContractFromController("PaymentsEscrow"), address(directory.graphPaymentsEscrow())); + assertEq(_getContractFromController("EpochManager"), address(directory.graphEpochManager())); + assertEq(_getContractFromController("RewardsManager"), address(directory.graphRewardsManager())); + assertEq(_getContractFromController("GraphTokenGateway"), address(directory.graphTokenGateway())); + assertEq(_getContractFromController("GraphProxyAdmin"), address(directory.graphProxyAdmin())); + assertEq(_getContractFromController("Curation"), address(directory.graphCuration())); + } + + function test_RevertWhen_AnInvalidContractGetterIsCalled() external { + // Zero out the Staking contract address to simulate a non registered contract + bytes32 storageSlot = keccak256(abi.encode(keccak256("Staking"), 5)); + vm.store(address(controller), storageSlot, bytes32(0)); + + vm.expectRevert(abi.encodeWithSelector(GraphDirectory.GraphDirectoryInvalidZeroAddress.selector, "Staking")); + _deployImplementation(address(controller)); + } + + function _deployImplementation(address _controller) private returns (GraphDirectoryImplementation) { + return new GraphDirectoryImplementation(_controller); + } + + function _getContractFromController(bytes memory _contractName) private view returns (address) { + return controller.getContractProxy(keccak256(_contractName)); + } +} diff --git a/packages/horizon/test/unit/utilities/GraphDirectoryImplementation.sol b/packages/horizon/test/unit/utilities/GraphDirectoryImplementation.sol new file mode 100644 index 000000000..bf40a35b8 --- /dev/null +++ b/packages/horizon/test/unit/utilities/GraphDirectoryImplementation.sol @@ -0,0 +1,64 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity 0.8.27; + +import { IGraphToken } from "@graphprotocol/contracts/contracts/token/IGraphToken.sol"; +import { IHorizonStaking } from "../../../contracts/interfaces/IHorizonStaking.sol"; +import { IGraphPayments } from "../../../contracts/interfaces/IGraphPayments.sol"; +import { IPaymentsEscrow } from "../../../contracts/interfaces/IPaymentsEscrow.sol"; + +import { IController } from "@graphprotocol/contracts/contracts/governance/IController.sol"; +import { IEpochManager } from "@graphprotocol/contracts/contracts/epochs/IEpochManager.sol"; +import { IRewardsManager } from "@graphprotocol/contracts/contracts/rewards/IRewardsManager.sol"; +import { ITokenGateway } from "@graphprotocol/contracts/contracts/arbitrum/ITokenGateway.sol"; +import { IGraphProxyAdmin } from "../../../contracts/interfaces/IGraphProxyAdmin.sol"; +import { ICuration } from "@graphprotocol/contracts/contracts/curation/ICuration.sol"; + +import { GraphDirectory } from "./../../../contracts/utilities/GraphDirectory.sol"; + +contract GraphDirectoryImplementation is GraphDirectory { + constructor(address controller) GraphDirectory(controller) {} + + function getContractFromController(bytes memory contractName) external view returns (address) { + return _graphController().getContractProxy(keccak256(contractName)); + } + function graphToken() external view returns (IGraphToken) { + return _graphToken(); + } + + function graphStaking() external view returns (IHorizonStaking) { + return _graphStaking(); + } + + function graphPayments() external view returns (IGraphPayments) { + return _graphPayments(); + } + + function graphPaymentsEscrow() external view returns (IPaymentsEscrow) { + return _graphPaymentsEscrow(); + } + + function graphController() external view returns (IController) { + return _graphController(); + } + + function graphEpochManager() external view returns (IEpochManager) { + return _graphEpochManager(); + } + + function graphRewardsManager() external view returns (IRewardsManager) { + return _graphRewardsManager(); + } + + function graphTokenGateway() external view returns (ITokenGateway) { + return _graphTokenGateway(); + } + + function graphProxyAdmin() external view returns (IGraphProxyAdmin) { + return _graphProxyAdmin(); + } + + function graphCuration() external view returns (ICuration) { + return _graphCuration(); + } +} diff --git a/packages/horizon/test/unit/utils/Bounder.t.sol b/packages/horizon/test/unit/utils/Bounder.t.sol new file mode 100644 index 000000000..44e977f57 --- /dev/null +++ b/packages/horizon/test/unit/utils/Bounder.t.sol @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity 0.8.27; + +import { Test } from "forge-std/Test.sol"; + +contract Bounder is Test { + uint256 constant SECP256K1_CURVE_ORDER = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141; + + function boundAddrAndKey(uint256 _value) internal pure returns (uint256, address) { + uint256 signerKey = bound(_value, 1, SECP256K1_CURVE_ORDER - 1); + return (signerKey, vm.addr(signerKey)); + } + + function boundAddr(uint256 _value) internal pure returns (address) { + (, address addr) = boundAddrAndKey(_value); + return addr; + } + + function boundKey(uint256 _value) internal pure returns (uint256) { + (uint256 key, ) = boundAddrAndKey(_value); + return key; + } + + function boundChainId(uint256 _value) internal pure returns (uint256) { + return bound(_value, 1, (2 ^ 64) - 1); + } + + function boundTimestampMin(uint256 _value, uint256 _min) internal pure returns (uint256) { + return bound(_value, _min, type(uint256).max); + } +} diff --git a/packages/horizon/test/unit/utils/Constants.sol b/packages/horizon/test/unit/utils/Constants.sol new file mode 100644 index 000000000..0aa53700d --- /dev/null +++ b/packages/horizon/test/unit/utils/Constants.sol @@ -0,0 +1,23 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +abstract contract Constants { + uint32 internal constant MAX_PPM = 1000000; // 100% in parts per million + uint256 internal constant delegationFeeCut = 100000; // 10% in parts per million + uint256 internal constant MAX_STAKING_TOKENS = 10_000_000_000 ether; + // GraphEscrow parameters + uint256 internal constant withdrawEscrowThawingPeriod = 60; + // GraphPayments parameters + uint256 internal constant protocolPaymentCut = 10000; + // Staking constants + uint256 internal constant MAX_THAW_REQUESTS = 1_000; + uint64 internal constant MAX_THAWING_PERIOD = 28 days; + uint32 internal constant THAWING_PERIOD_IN_BLOCKS = 300; + uint256 internal constant MIN_DELEGATION = 1e18; + // Epoch manager + uint256 internal constant EPOCH_LENGTH = 1; + // Rewards manager + uint256 internal constant ALLOCATIONS_REWARD_CUT = 100 ether; + // GraphTallyCollector + uint256 internal constant revokeSignerThawingPeriod = 7 days; +} diff --git a/packages/horizon/test/unit/utils/Users.sol b/packages/horizon/test/unit/utils/Users.sol new file mode 100644 index 000000000..6213e4e82 --- /dev/null +++ b/packages/horizon/test/unit/utils/Users.sol @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +struct Users { + address governor; + address deployer; + address indexer; + address operator; + address gateway; + address verifier; + address delegator; + address legacySlasher; +} diff --git a/packages/horizon/test/unit/utils/Utils.sol b/packages/horizon/test/unit/utils/Utils.sol new file mode 100644 index 000000000..be42f269f --- /dev/null +++ b/packages/horizon/test/unit/utils/Utils.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +abstract contract Utils is Test { + /// @dev Stops the active prank and sets a new one. + function resetPrank(address msgSender) internal { + vm.stopPrank(); + vm.startPrank(msgSender); + } +} diff --git a/packages/horizon/tsconfig.json b/packages/horizon/tsconfig.json new file mode 100644 index 000000000..5f32ebc8c --- /dev/null +++ b/packages/horizon/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "target": "es2020", + "module": "node16", + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "strict": true, + "skipLibCheck": true, + "resolveJsonModule": true, + "outDir": "dist", + "moduleResolution": "node16" + }, + "include": [ + "hardhat.config.ts", + "types/**/*.ts", + "scripts/**/*.ts", + "tasks/**/*.ts", + "test/**/*.ts", + "ignition/**/*.ts", + "eslint.config.js", + "prettier.config.js", + "natspec-smells.config.js" + ] +} diff --git a/packages/horizon/types/hardhat-graph-protocol.d.ts b/packages/horizon/types/hardhat-graph-protocol.d.ts new file mode 100644 index 000000000..8b5985269 --- /dev/null +++ b/packages/horizon/types/hardhat-graph-protocol.d.ts @@ -0,0 +1,45 @@ +// TypeScript does not resolve correctly the type extensions when they are symlinked from the same monorepo. +// So we need to re-type it... this file should be a copy of hardhat-graph-protocol/src/type-extensions.ts +import 'hardhat/types/config' +import 'hardhat/types/runtime' +import type { GraphDeployments, GraphRuntimeEnvironment, GraphRuntimeEnvironmentOptions } from 'hardhat-graph-protocol' + +declare module 'hardhat/types/runtime' { + interface HardhatRuntimeEnvironment { + graph: (opts?: GraphRuntimeEnvironmentOptions) => GraphRuntimeEnvironment + } +} + +declare module 'hardhat/types/config' { + interface HardhatConfig { + graph: GraphRuntimeEnvironmentOptions + } + + interface HardhatUserConfig { + graph: GraphRuntimeEnvironmentOptions + } + + interface HardhatNetworkConfig { + deployments?: GraphDeployments + } + + interface HardhatNetworkUserConfig { + deployments?: GraphDeployments + } + + interface HttpNetworkConfig { + deployments?: GraphDeployments + } + + interface HttpNetworkUserConfig { + deployments?: GraphDeployments + } + + interface ProjectPathsConfig { + graph?: string + } + + interface ProjectPathsUserConfig { + graph?: string + } +} diff --git a/packages/solhint-graph-config/README.md b/packages/solhint-graph-config/README.md new file mode 100644 index 000000000..6257d8f2b --- /dev/null +++ b/packages/solhint-graph-config/README.md @@ -0,0 +1,89 @@ +# solhint-graph-config + +This repository contains shared linting and formatting rules for Solidity projects. + +## Code linting + +### Installation + +```bash +# Install with peer packages +pnpm add --dev solhint solhint-graph-config + +# For projects on this monorepo +pnpm add --dev solhint solhint-graph-config@workspace:^x.y.z +``` + +To use graph plugin you'll also need to manually add the plugin to your `package.json`: +```json + "devDependencies": { + "solhint-plugin-graph": "file:node_modules/solhint-graph-config/plugin" + } +``` + +### Configuration + +Run `solhint` with `node_modules/solhint-graph-config/index.js` as the configuration file. We suggest creating an npm script to make it easier to run: + +```json + +{ + "scripts": { + "lint": "solhint --fix --noPrompt contracts/**/*.sol --config node_modules/solhint-graph-config/index.js" + } +} + +``` + +## Code formatting + +### Installation + +```bash +# Install with peer packages +pnpm add --dev solhint-graph-config prettier prettier-plugin-solidity + +# For projects on this monorepo +pnpm add --dev solhint-graph-config@workspace:^x.y.z prettier prettier-plugin-solidity +``` + + +### Configuration: formatting + +Create a configuration file for prettier at `prettier.config.js`: + +```javascript +const prettierGraphConfig = require('solhint-graph-config/prettier') +module.exports = prettierGraphConfig +``` + +Running `prettier` will automatically pick up the configuration file. We suggest creating an npm script to make it easier to run: + +```json +{ + "scripts": { + "format": "prettier --write 'contracts/**/*.sol'" + } +} +``` + +## Tooling + +This package uses the following tools: +- [solhint](https://protofire.github.io/solhint/) as the base linting tool +- [prettier](https://prettier.io/) as the base formatting tool +- [prettier-plugin-solidity](https://github.com/prettier-solidity/prettier-plugin-solidity) to format Solidity code + + +## VSCode support + +If you are using VSCode you can install the [Solidity extension by Nomic Foundation](https://marketplace.visualstudio.com/items?itemName=NomicFoundation.hardhat-solidity). Unfortunately there is currently no way of getting real-time linting output from solhint, but this extension will provide formatting support using our prettier config and will also provide inline code validation using solc compiler output. + +For formatting, the following settings should be added to your `settings.json` file: +```json + "[solidity]": { + "editor.defaultFormatter": "NomicFoundation.hardhat-solidity" + }, +``` + +Additionally you can configure the `Format document` keyboard shortcut to run `prettier --write` on demand. \ No newline at end of file diff --git a/packages/solhint-graph-config/index.js b/packages/solhint-graph-config/index.js new file mode 100644 index 000000000..770350520 --- /dev/null +++ b/packages/solhint-graph-config/index.js @@ -0,0 +1,33 @@ +module.exports = { + plugins: [ 'graph' ], + extends: 'solhint:recommended', + rules: { + // best practices + 'no-empty-blocks': 'off', + 'constructor-syntax': 'warn', + + // style rules + 'private-vars-leading-underscore': 'off', // see graph/leading-underscore + 'const-name-snakecase': 'warn', + 'named-parameters-mapping': 'warn', + 'imports-on-top': 'warn', + 'ordering': 'warn', + 'visibility-modifier-order': 'warn', + 'func-name-mixedcase': 'off', // see graph/func-name-mixedcase + 'var-name-mixedcase': 'off', // see graph/var-name-mixedcase + + // miscellaneous + 'quotes': ['error', 'double'], + + // security + 'compiler-version': ['off'], + 'func-visibility': ['warn', { ignoreConstructors: true }], + 'not-rely-on-time': 'off', + + // graph + 'graph/leading-underscore': 'warn', + 'graph/func-name-mixedcase': 'warn', + 'graph/var-name-mixedcase': 'warn', + 'gas-custom-errors': 'off' + }, +} diff --git a/packages/solhint-graph-config/package.json b/packages/solhint-graph-config/package.json new file mode 100644 index 000000000..5b516ed58 --- /dev/null +++ b/packages/solhint-graph-config/package.json @@ -0,0 +1,17 @@ +{ + "name": "solhint-graph-config", + "private": true, + "version": "0.0.1", + "description": "Linting and formatting rules for The Graph's Solidity projects", + "main": "index.js", + "author": "The Graph Team", + "license": "GPL-2.0-or-later", + "dependencies": { + "solhint-plugin-graph": "workspace:*" + }, + "peerDependencies": { + "prettier": "^3.2.5", + "prettier-plugin-solidity": "^1.3.1", + "solhint": "^4.5.4" + } +} diff --git a/packages/solhint-graph-config/prettier.js b/packages/solhint-graph-config/prettier.js new file mode 100644 index 000000000..b7539ce04 --- /dev/null +++ b/packages/solhint-graph-config/prettier.js @@ -0,0 +1,15 @@ +module.exports = { + "printWidth": 120, + "useTabs": false, + "bracketSpacing": true, + "plugins": ["prettier-plugin-solidity"], + "overrides": [ + { + "files": "*.sol", + "options": { + "tabWidth": 4, + "singleQuote": false, + } + } + ] +} \ No newline at end of file diff --git a/packages/solhint-plugin-graph/index.js b/packages/solhint-plugin-graph/index.js new file mode 100644 index 000000000..7e134089f --- /dev/null +++ b/packages/solhint-plugin-graph/index.js @@ -0,0 +1,172 @@ +function hasLeadingUnderscore(text) { + return text && text[0] === '_' +} + +function match(text, regex) { + return text.replace(regex, '').length === 0 +} + +function isMixedCase(text) { + return match(text, /[_]*[a-z$]+[a-zA-Z0-9$]*[_]?/) +} + +function isUpperSnakeCase(text) { + return match(text, /_{0,2}[A-Z0-9$]+[_A-Z0-9$]*/) +} + +class Base { + constructor(reporter, config, source, fileName) { + this.ignoreDeprecated = true; + this.deprecatedPrefix = '__DEPRECATED_'; + this.underscorePrefix = '__'; + this.reporter = reporter; + this.ignored = this.constructor.global; + this.ruleId = this.constructor.ruleId; + if (this.ruleId === undefined) { + throw Error('missing ruleId static property'); + } + } + + error(node, message, fix) { + if (!this.ignored) { + this.reporter.error(node, this.ruleId, message, fix); + } + } +} + +module.exports = [ + class extends Base { + static ruleId = 'leading-underscore'; + + ContractDefinition(node) { + if (node.kind === 'library') { + this.inLibrary = true + } + } + + 'ContractDefinition:exit'() { + this.inLibrary = false + } + + StateVariableDeclaration() { + this.inStateVariableDeclaration = true + } + + 'StateVariableDeclaration:exit'() { + this.inStateVariableDeclaration = false + } + + VariableDeclaration(node) { + if (!this.inLibrary) { + if (!this.inStateVariableDeclaration) { + this.validateName(node, false, 'variable') + return + } + + this.validateName(node, 'variable') + } + + } + + FunctionDefinition(node) { + if (!this.inLibrary) { + if (!node.name) { + return + } + for (const parameter of node.parameters) { + parameter.visibility = node.visibility + } + + this.validateName(node, 'function') + + } + } + + validateName(node, type) { + if (this.ignoreDeprecated && node.name.startsWith(this.deprecatedPrefix)) { + return + } + + const isPrivate = node.visibility === 'private' + const isInternal = node.visibility === 'internal' || node.visibility === 'default' + const isConstant = node.isDeclaredConst + const isImmutable = node.isImmutable + const shouldHaveLeadingUnderscore = (isPrivate || isInternal) && !(isConstant || isImmutable) + + if (node.name === null) { + return + } + + if (hasLeadingUnderscore(node.name) !== shouldHaveLeadingUnderscore) { + this._error(node, node.name, shouldHaveLeadingUnderscore, type) + } + } + + fixStatement(node, shouldHaveLeadingUnderscore, type) { + let range + + if (type === 'function') { + range = node.range + range[0] += 8 + } else if (type === 'parameter') { + range = node.identifier.range + } else { + range = node.identifier.range + range[0] -= 1 + } + + return (fixer) => + shouldHaveLeadingUnderscore + ? fixer.insertTextBeforeRange(range, ' _') + : fixer.removeRange([range[0] + 1, range[0] + 1]) + } + + _error(node, name, shouldHaveLeadingUnderscore, type) { + this.error( + node, + `'${name}' ${shouldHaveLeadingUnderscore ? 'should' : 'should not'} start with _`, + // this.fixStatement(node, shouldHaveLeadingUnderscore, type) + ) + } + }, + class extends Base { + static ruleId = 'func-name-mixedcase'; + + FunctionDefinition(node) { + // Allow __DEPRECATED_ prefixed functions and __ prefixed functions + if (node.name.startsWith(this.deprecatedPrefix) || node.name.startsWith(this.underscorePrefix)) { + return + } + + if (!isMixedCase(node.name) && !node.isConstructor) { + // Allow external functions to be in UPPER_SNAKE_CASE - for immutable state getters + if (node.visibility === 'external' && isUpperSnakeCase(node.name)) { + return + } + this.error(node, 'Function name must be in mixedCase',) + } + } + }, + class extends Base { + static ruleId = 'var-name-mixedcase'; + + VariableDeclaration(node) { + if (node.name.startsWith(this.deprecatedPrefix)) { + return + } + if (!node.isDeclaredConst && !node.isImmutable) { + this.validateVariablesName(node) + } + } + + validateVariablesName(node) { + if (node.name.startsWith(this.deprecatedPrefix)) { + return + } + if (!isMixedCase(node.name)) { + this.error(node, 'Variable name must be in mixedCase') + } + } + } + +]; \ No newline at end of file diff --git a/packages/solhint-plugin-graph/package.json b/packages/solhint-plugin-graph/package.json new file mode 100644 index 000000000..1b1c0f568 --- /dev/null +++ b/packages/solhint-plugin-graph/package.json @@ -0,0 +1,5 @@ +{ + "name": "solhint-plugin-graph", + "version": "0.0.1", + "private": true +} diff --git a/packages/subgraph-service/.solhintignore b/packages/subgraph-service/.solhintignore new file mode 100644 index 000000000..a0367e1af --- /dev/null +++ b/packages/subgraph-service/.solhintignore @@ -0,0 +1 @@ +contracts/mocks/* \ No newline at end of file diff --git a/packages/subgraph-service/CHANGELOG.md b/packages/subgraph-service/CHANGELOG.md new file mode 100644 index 000000000..07ec8f18e --- /dev/null +++ b/packages/subgraph-service/CHANGELOG.md @@ -0,0 +1,61 @@ +# @graphprotocol/subgraph-service + +## 0.3.5 + +### Patch Changes + +- Add GNS to deployments + +## 0.3.4 + +### Patch Changes + +- chore: fix package visibility + +## 0.3.3 + +### Patch Changes + +- Fix missing public getter from toolshed interface + +## 0.3.2 + +### Patch Changes + +- Fix IServiceRegistry import in subgraph service toolshed deployment + +## 0.3.1 + +### Patch Changes + +- Use proper types for Curation contract, add epochLength to EpochManager import in Horizon. + +## 0.3.0 + +### Minor Changes + +- Publish types for contracts packages + +## 0.2.1 + +### Patch Changes + +- Pin ethers version + +## 0.2.0 + +### Minor Changes + +- Publish scratch testnet 2 address book + +## 0.1.1 + +### Patch Changes + +- Publish fork 1 deployment + +## 0.1.0 + +### Minor Changes + +- Publish initial dev versions diff --git a/packages/subgraph-service/README.md b/packages/subgraph-service/README.md new file mode 100644 index 000000000..430ebd7aa --- /dev/null +++ b/packages/subgraph-service/README.md @@ -0,0 +1,73 @@ +# 🌅 Subgraph Service 🌅 + +The Subgraph Service is a data service designed to work with Graph Horizon that supports indexing subgraphs and serving queries to consumers. + +## Configuration + +The following environment variables might be required: + +| Variable | Description | +|----------|-------------| +| `ARBISCAN_API_KEY` | Arbiscan API key - for contract verification| +| `ARBITRUM_ONE_RPC` | Arbitrum One RPC URL - defaults to `https://arb1.arbitrum.io/rpc` | +| `ARBITRUM_SEPOLIA_RPC` | Arbitrum Sepolia RPC URL - defaults to `https://sepolia-rollup.arbitrum.io/rpc` | +| `LOCALHOST_RPC` | Localhost RPC URL - defaults to `http://localhost:8545` | + +You can set them using Hardhat: + +```bash +npx hardhat vars set +``` + +## Build + +```bash +pnpm install +pnpm build +``` + +## Deployment + +Note that this instructions will help you deploy Graph Horizon contracts alongside the Subgraph Service. If you want to deploy just the core Horizon contracts please refer to the [Horizon README](../horizon/README.md) for deploy instructions. + +### New deployment +To deploy Graph Horizon from scratch including the Subgraph Service run the following command: + +```bash +npx hardhat deploy:protocol --network hardhat +``` + +### Upgrade deployment +Usually you would run this against a network (or a fork) where the original Graph Protocol was previously deployed. To upgrade an existing deployment of the original Graph Protocol to Graph Horizon including the Subgraph Service, run the following commands. Note that some steps might need to be run by different accounts (deployer vs governor): + +```bash +cd ../ +cd horizon && npx hardhat deploy:migrate --network hardhat --step 1 && cd .. +cd subgraph-service && npx hardhat deploy:migrate --network hardhat --step 1 && cd .. +cd horizon && npx hardhat deploy:migrate --network hardhat --step 2 && cd .. # Run with governor. Optionally add --patch-config +cd horizon && npx hardhat deploy:migrate --network hardhat --step 3 && cd .. # Optionally add --patch-config +cd subgraph-service && npx hardhat deploy:migrate --network hardhat --step 2 && cd .. # Optionally add --patch-config +cd horizon && npx hardhat deploy:migrate --network hardhat --step 4 && cd .. # Run with governor. Optionally add --patch-config +``` + +Horizon Steps 2, 3 and 4, and Subgraph Service Step 2 require patching the configuration file with addresses from previous steps. The files are located in the `ignition/configs` directory and need to be manually edited. You can also pass `--patch-config` flag to the deploy command to automatically patch the configuration reading values from the address book. Note that this will NOT update the configuration file. + +## Testing +- **unit**: Unit tests can be run with `pnpm test` +- **integration**: Integration tests can be run with `pnpm test:integration` + - Need to set `BLOCKCHAIN_RPC` for a chain where The Graph is already deployed + - If no `BLOCKCHAIN_RPC` is detected it will try using `ARBITRUM_SEPOLIA_RPC` +- **deployment**: Deployment tests can be run with `pnpm test:deployment --network `, the following environment variables allow customizing the test suite for different scenarios: + - `TEST_DEPLOYMENT_STEP` (default: 1) - Specify the latest deployment step that has been executed. Tests for later steps will be skipped. + - `TEST_DEPLOYMENT_TYPE` (default: migrate) - The deployment type `protocol/migrate` that is being tested. Test suite has been developed for `migrate` use case but can be run against a `protocol` deployment, likely with some failed tests. + - `TEST_DEPLOYMENT_CONFIG` (default: `hre.network.name`) - The Ignition config file name to use for the test suite. + +## Verification + +To verify contracts on a network, run the following commands: + +```bash +./scripts/pre-verify +npx hardhat ignition verify --network --include-unrelated-contracts +./scripts/post-verify +``` \ No newline at end of file diff --git a/packages/subgraph-service/addresses-integration-tests.json b/packages/subgraph-service/addresses-integration-tests.json new file mode 100644 index 000000000..7f60fa388 --- /dev/null +++ b/packages/subgraph-service/addresses-integration-tests.json @@ -0,0 +1,35 @@ +{ + "421614": { + "L2Curation": { + "address": "0xe135BFD9E51BbAfCeBb0141af85F0bc6DA1b3BA4", + "proxy": "graph", + "implementation": "0x9CCD9B656f8A558879974ef2505496eEd7Ef7210" + }, + "L2GNS": { + "address": "0x3133948342F35b8699d8F94aeE064AbB76eDe965", + "proxy": "graph", + "implementation": "0x00CBF5024d454255577Bf2b0fB6A43328a6828c9" + }, + "SubgraphNFT": { + "address": "0xF21Df5BbA7EB9b54D8F60C560aFb9bA63e6aED1A" + }, + "LegacyDisputeManager": { + "address": "0x7C9B82717f9433932507dF6EdA93A9678b258698" + }, + "LegacyServiceRegistry": { + "address": "0x888541878CbDDEd880Cd58c728f1Af5C47343F86" + }, + "SubgraphService": { + "address": "0x00fe8F95407AB61863d27c07F584A0930ee5F3b0", + "proxy": "transparent", + "proxyAdmin": "0xD23a972f47B7D45E729AB9B8399D628c87b6C0d6", + "implementation": "0x30b34eAaF354cAdd64836Bc0846F4414254271ea" + }, + "DisputeManager": { + "address": "0x1A7Fb71014d4395903eC56662f32dD02344D361C", + "proxy": "transparent", + "proxyAdmin": "0x9a8C3B6D649108bd11670de0B9b981ae3C167707", + "implementation": "0x75f7Bd9D2F0bca7bA7189BB582f5eb95afa051e8" + } + } +} \ No newline at end of file diff --git a/packages/subgraph-service/addresses.json b/packages/subgraph-service/addresses.json new file mode 100644 index 000000000..7f60fa388 --- /dev/null +++ b/packages/subgraph-service/addresses.json @@ -0,0 +1,35 @@ +{ + "421614": { + "L2Curation": { + "address": "0xe135BFD9E51BbAfCeBb0141af85F0bc6DA1b3BA4", + "proxy": "graph", + "implementation": "0x9CCD9B656f8A558879974ef2505496eEd7Ef7210" + }, + "L2GNS": { + "address": "0x3133948342F35b8699d8F94aeE064AbB76eDe965", + "proxy": "graph", + "implementation": "0x00CBF5024d454255577Bf2b0fB6A43328a6828c9" + }, + "SubgraphNFT": { + "address": "0xF21Df5BbA7EB9b54D8F60C560aFb9bA63e6aED1A" + }, + "LegacyDisputeManager": { + "address": "0x7C9B82717f9433932507dF6EdA93A9678b258698" + }, + "LegacyServiceRegistry": { + "address": "0x888541878CbDDEd880Cd58c728f1Af5C47343F86" + }, + "SubgraphService": { + "address": "0x00fe8F95407AB61863d27c07F584A0930ee5F3b0", + "proxy": "transparent", + "proxyAdmin": "0xD23a972f47B7D45E729AB9B8399D628c87b6C0d6", + "implementation": "0x30b34eAaF354cAdd64836Bc0846F4414254271ea" + }, + "DisputeManager": { + "address": "0x1A7Fb71014d4395903eC56662f32dD02344D361C", + "proxy": "transparent", + "proxyAdmin": "0x9a8C3B6D649108bd11670de0B9b981ae3C167707", + "implementation": "0x75f7Bd9D2F0bca7bA7189BB582f5eb95afa051e8" + } + } +} \ No newline at end of file diff --git a/packages/subgraph-service/contracts/DisputeManager.sol b/packages/subgraph-service/contracts/DisputeManager.sol new file mode 100644 index 000000000..ec6634034 --- /dev/null +++ b/packages/subgraph-service/contracts/DisputeManager.sol @@ -0,0 +1,701 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity 0.8.27; + +import { IGraphToken } from "@graphprotocol/contracts/contracts/token/IGraphToken.sol"; +import { IHorizonStaking } from "@graphprotocol/horizon/contracts/interfaces/IHorizonStaking.sol"; +import { IDisputeManager } from "./interfaces/IDisputeManager.sol"; +import { ISubgraphService } from "./interfaces/ISubgraphService.sol"; + +import { TokenUtils } from "@graphprotocol/contracts/contracts/utils/TokenUtils.sol"; +import { PPMMath } from "@graphprotocol/horizon/contracts/libraries/PPMMath.sol"; +import { MathUtils } from "@graphprotocol/horizon/contracts/libraries/MathUtils.sol"; +import { Allocation } from "./libraries/Allocation.sol"; +import { Attestation } from "./libraries/Attestation.sol"; + +import { OwnableUpgradeable } from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; +import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; +import { GraphDirectory } from "@graphprotocol/horizon/contracts/utilities/GraphDirectory.sol"; +import { DisputeManagerV1Storage } from "./DisputeManagerStorage.sol"; +import { AttestationManager } from "./utilities/AttestationManager.sol"; + +/** + * @title DisputeManager + * @notice Provides a way to permissionlessly create disputes for incorrect behavior in the Subgraph Service. + * + * There are two types of disputes that can be created: Query disputes and Indexing disputes. + * + * Query Disputes: + * Graph nodes receive queries and return responses with signed receipts called attestations. + * An attestation can be disputed if the consumer thinks the query response was invalid. + * Indexers use the derived private key for an allocation to sign attestations. + * + * Indexing Disputes: + * Indexers periodically present a Proof of Indexing (POI) to prove they are indexing a subgraph. + * The Subgraph Service contract emits that proof which includes the POI. Any fisherman can dispute the + * validity of a POI by submitting a dispute to this contract along with a deposit. + * + * Arbitration: + * Disputes can only be accepted, rejected or drawn by the arbitrator role that can be delegated + * to a EOA or DAO. + * @custom:security-contact Please email security+contracts@thegraph.com if you find any + * bugs. We may have an active bug bounty program. + */ +contract DisputeManager is + Initializable, + OwnableUpgradeable, + GraphDirectory, + AttestationManager, + DisputeManagerV1Storage, + IDisputeManager +{ + using TokenUtils for IGraphToken; + using PPMMath for uint256; + + // -- Constants -- + + /// @notice Maximum value for fisherman reward cut in PPM + uint32 public constant MAX_FISHERMAN_REWARD_CUT = 500000; // 50% + + /// @notice Minimum value for dispute deposit + uint256 public constant MIN_DISPUTE_DEPOSIT = 1e18; // 1 GRT + + // -- Modifiers -- + + /** + * @notice Check if the caller is the arbitrator. + */ + modifier onlyArbitrator() { + require(msg.sender == arbitrator, DisputeManagerNotArbitrator()); + _; + } + + /** + * @notice Check if the dispute exists and is pending. + * @param disputeId The dispute Id + */ + modifier onlyPendingDispute(bytes32 disputeId) { + require(isDisputeCreated(disputeId), DisputeManagerInvalidDispute(disputeId)); + require( + disputes[disputeId].status == IDisputeManager.DisputeStatus.Pending, + DisputeManagerDisputeNotPending(disputes[disputeId].status) + ); + _; + } + + /** + * @notice Check if the caller is the fisherman of the dispute. + * @param disputeId The dispute Id + */ + modifier onlyFisherman(bytes32 disputeId) { + require(isDisputeCreated(disputeId), DisputeManagerInvalidDispute(disputeId)); + require(msg.sender == disputes[disputeId].fisherman, DisputeManagerNotFisherman()); + _; + } + + /** + * @notice Contract constructor + * @param controller Address of the controller + */ + constructor(address controller) GraphDirectory(controller) { + _disableInitializers(); + } + + /// @inheritdoc IDisputeManager + function initialize( + address owner, + address arbitrator_, + uint64 disputePeriod_, + uint256 disputeDeposit_, + uint32 fishermanRewardCut_, + uint32 maxSlashingCut_ + ) external override initializer { + __Ownable_init(owner); + __AttestationManager_init(); + + _setArbitrator(arbitrator_); + _setDisputePeriod(disputePeriod_); + _setDisputeDeposit(disputeDeposit_); + _setFishermanRewardCut(fishermanRewardCut_); + _setMaxSlashingCut(maxSlashingCut_); + } + + /// @inheritdoc IDisputeManager + function createIndexingDispute(address allocationId, bytes32 poi) external override returns (bytes32) { + // Get funds from fisherman + _graphToken().pullTokens(msg.sender, disputeDeposit); + + // Create a dispute + return _createIndexingDisputeWithAllocation(msg.sender, disputeDeposit, allocationId, poi); + } + + /// @inheritdoc IDisputeManager + function createQueryDispute(bytes calldata attestationData) external override returns (bytes32) { + // Get funds from fisherman + _graphToken().pullTokens(msg.sender, disputeDeposit); + + // Create a dispute + return + _createQueryDisputeWithAttestation( + msg.sender, + disputeDeposit, + Attestation.parse(attestationData), + attestationData + ); + } + + /// @inheritdoc IDisputeManager + function createQueryDisputeConflict( + bytes calldata attestationData1, + bytes calldata attestationData2 + ) external override returns (bytes32, bytes32) { + address fisherman = msg.sender; + + // Parse each attestation + Attestation.State memory attestation1 = Attestation.parse(attestationData1); + Attestation.State memory attestation2 = Attestation.parse(attestationData2); + + // Test that attestations are conflicting + require( + Attestation.areConflicting(attestation1, attestation2), + DisputeManagerNonConflictingAttestations( + attestation1.requestCID, + attestation1.responseCID, + attestation1.subgraphDeploymentId, + attestation2.requestCID, + attestation2.responseCID, + attestation2.subgraphDeploymentId + ) + ); + + // Get funds from fisherman + _graphToken().pullTokens(msg.sender, disputeDeposit); + + // Create the disputes + // The deposit is zero for conflicting attestations + bytes32 dId1 = _createQueryDisputeWithAttestation( + fisherman, + disputeDeposit / 2, + attestation1, + attestationData1 + ); + bytes32 dId2 = _createQueryDisputeWithAttestation( + fisherman, + disputeDeposit / 2, + attestation2, + attestationData2 + ); + + // Store the linked disputes to be resolved + disputes[dId1].relatedDisputeId = dId2; + disputes[dId2].relatedDisputeId = dId1; + + // Emit event that links the two created disputes + emit DisputeLinked(dId1, dId2); + + return (dId1, dId2); + } + + /// @inheritdoc IDisputeManager + function createAndAcceptLegacyDispute( + address allocationId, + address fisherman, + uint256 tokensSlash, + uint256 tokensRewards + ) external override onlyArbitrator returns (bytes32) { + // Create a disputeId + bytes32 disputeId = keccak256(abi.encodePacked(allocationId, "legacy")); + + // Get the indexer for the legacy allocation + address indexer = _graphStaking().getAllocation(allocationId).indexer; + require(indexer != address(0), DisputeManagerIndexerNotFound(allocationId)); + + // Store dispute + disputes[disputeId] = Dispute( + indexer, + fisherman, + 0, + 0, + DisputeType.LegacyDispute, + IDisputeManager.DisputeStatus.Accepted, + block.timestamp, + block.timestamp + disputePeriod, + 0 + ); + + // Slash the indexer + ISubgraphService subgraphService_ = _getSubgraphService(); + subgraphService_.slash(indexer, abi.encode(tokensSlash, tokensRewards)); + + // Reward the fisherman + _graphToken().pushTokens(fisherman, tokensRewards); + + emit LegacyDisputeCreated(disputeId, indexer, fisherman, allocationId, tokensSlash, tokensRewards); + emit DisputeAccepted(disputeId, indexer, fisherman, tokensRewards); + + return disputeId; + } + + /// @inheritdoc IDisputeManager + function acceptDispute( + bytes32 disputeId, + uint256 tokensSlash + ) external override onlyArbitrator onlyPendingDispute(disputeId) { + require(!_isDisputeInConflict(disputes[disputeId]), DisputeManagerDisputeInConflict(disputeId)); + Dispute storage dispute = disputes[disputeId]; + _acceptDispute(disputeId, dispute, tokensSlash); + } + + /// @inheritdoc IDisputeManager + function acceptDisputeConflict( + bytes32 disputeId, + uint256 tokensSlash, + bool acceptDisputeInConflict, + uint256 tokensSlashRelated + ) external override onlyArbitrator onlyPendingDispute(disputeId) { + require(_isDisputeInConflict(disputes[disputeId]), DisputeManagerDisputeNotInConflict(disputeId)); + Dispute storage dispute = disputes[disputeId]; + _acceptDispute(disputeId, dispute, tokensSlash); + + if (acceptDisputeInConflict) { + _acceptDispute(dispute.relatedDisputeId, disputes[dispute.relatedDisputeId], tokensSlashRelated); + } else { + _drawDispute(dispute.relatedDisputeId, disputes[dispute.relatedDisputeId]); + } + } + + /// @inheritdoc IDisputeManager + function rejectDispute(bytes32 disputeId) external override onlyArbitrator onlyPendingDispute(disputeId) { + Dispute storage dispute = disputes[disputeId]; + require(!_isDisputeInConflict(dispute), DisputeManagerDisputeInConflict(disputeId)); + _rejectDispute(disputeId, dispute); + } + + /// @inheritdoc IDisputeManager + function drawDispute(bytes32 disputeId) external override onlyArbitrator onlyPendingDispute(disputeId) { + Dispute storage dispute = disputes[disputeId]; + _drawDispute(disputeId, dispute); + + if (_isDisputeInConflict(dispute)) { + _drawDispute(dispute.relatedDisputeId, disputes[dispute.relatedDisputeId]); + } + } + + /// @inheritdoc IDisputeManager + function cancelDispute(bytes32 disputeId) external override onlyFisherman(disputeId) onlyPendingDispute(disputeId) { + Dispute storage dispute = disputes[disputeId]; + + // Check if dispute period has finished + require(dispute.cancellableAt <= block.timestamp, DisputeManagerDisputePeriodNotFinished()); + _cancelDispute(disputeId, dispute); + + if (_isDisputeInConflict(dispute)) { + _cancelDispute(dispute.relatedDisputeId, disputes[dispute.relatedDisputeId]); + } + } + + /// @inheritdoc IDisputeManager + function setArbitrator(address arbitrator) external override onlyOwner { + _setArbitrator(arbitrator); + } + + /// @inheritdoc IDisputeManager + function setDisputePeriod(uint64 disputePeriod) external override onlyOwner { + _setDisputePeriod(disputePeriod); + } + + /// @inheritdoc IDisputeManager + function setDisputeDeposit(uint256 disputeDeposit) external override onlyOwner { + _setDisputeDeposit(disputeDeposit); + } + + /// @inheritdoc IDisputeManager + function setFishermanRewardCut(uint32 fishermanRewardCut_) external override onlyOwner { + _setFishermanRewardCut(fishermanRewardCut_); + } + + /// @inheritdoc IDisputeManager + function setMaxSlashingCut(uint32 maxSlashingCut_) external override onlyOwner { + _setMaxSlashingCut(maxSlashingCut_); + } + + /// @inheritdoc IDisputeManager + function setSubgraphService(address subgraphService_) external override onlyOwner { + _setSubgraphService(subgraphService_); + } + + /// @inheritdoc IDisputeManager + function encodeReceipt(Attestation.Receipt calldata receipt) external view override returns (bytes32) { + return _encodeReceipt(receipt); + } + + /// @inheritdoc IDisputeManager + function getFishermanRewardCut() external view override returns (uint32) { + return fishermanRewardCut; + } + + /// @inheritdoc IDisputeManager + function getDisputePeriod() external view override returns (uint64) { + return disputePeriod; + } + + /// @inheritdoc IDisputeManager + function getStakeSnapshot(address indexer) external view override returns (uint256) { + IHorizonStaking.Provision memory provision = _graphStaking().getProvision( + indexer, + address(_getSubgraphService()) + ); + return _getStakeSnapshot(indexer, provision.tokens); + } + + /// @inheritdoc IDisputeManager + function areConflictingAttestations( + Attestation.State calldata attestation1, + Attestation.State calldata attestation2 + ) external pure override returns (bool) { + return Attestation.areConflicting(attestation1, attestation2); + } + + /// @inheritdoc IDisputeManager + function getAttestationIndexer(Attestation.State memory attestation) public view returns (address) { + // Get attestation signer. Indexers signs with the allocationId + address allocationId = _recoverSigner(attestation); + + Allocation.State memory alloc = _getSubgraphService().getAllocation(allocationId); + require(alloc.indexer != address(0), DisputeManagerIndexerNotFound(allocationId)); + require( + alloc.subgraphDeploymentId == attestation.subgraphDeploymentId, + DisputeManagerNonMatchingSubgraphDeployment(alloc.subgraphDeploymentId, attestation.subgraphDeploymentId) + ); + return alloc.indexer; + } + + /// @inheritdoc IDisputeManager + function isDisputeCreated(bytes32 disputeId) public view override returns (bool) { + return disputes[disputeId].status != DisputeStatus.Null; + } + + /** + * @notice Create a query dispute passing the parsed attestation. + * To be used in createQueryDispute() and createQueryDisputeConflict() + * to avoid calling parseAttestation() multiple times + * `attestationData` is only passed to be emitted + * @param _fisherman Creator of dispute + * @param _deposit Amount of tokens staked as deposit + * @param _attestation Attestation struct parsed from bytes + * @param _attestationData Attestation bytes submitted by the fisherman + * @return DisputeId + */ + function _createQueryDisputeWithAttestation( + address _fisherman, + uint256 _deposit, + Attestation.State memory _attestation, + bytes memory _attestationData + ) private returns (bytes32) { + // Get the indexer that signed the attestation + address indexer = getAttestationIndexer(_attestation); + + // The indexer is disputable + IHorizonStaking.Provision memory provision = _graphStaking().getProvision( + indexer, + address(_getSubgraphService()) + ); + require(provision.tokens != 0, DisputeManagerZeroTokens()); + + // Create a disputeId + bytes32 disputeId = keccak256( + abi.encodePacked( + _attestation.requestCID, + _attestation.responseCID, + _attestation.subgraphDeploymentId, + indexer, + _fisherman + ) + ); + + // Only one dispute at a time + require(!isDisputeCreated(disputeId), DisputeManagerDisputeAlreadyCreated(disputeId)); + + // Store dispute + uint256 stakeSnapshot = _getStakeSnapshot(indexer, provision.tokens); + uint256 cancellableAt = block.timestamp + disputePeriod; + disputes[disputeId] = Dispute( + indexer, + _fisherman, + _deposit, + 0, // no related dispute, + DisputeType.QueryDispute, + IDisputeManager.DisputeStatus.Pending, + block.timestamp, + cancellableAt, + stakeSnapshot + ); + + emit QueryDisputeCreated( + disputeId, + indexer, + _fisherman, + _deposit, + _attestation.subgraphDeploymentId, + _attestationData, + cancellableAt, + stakeSnapshot + ); + + return disputeId; + } + + /** + * @notice Create indexing dispute internal function. + * @param _fisherman The fisherman creating the dispute + * @param _deposit Amount of tokens staked as deposit + * @param _allocationId Allocation disputed + * @param _poi The POI being disputed + * @return The dispute id + */ + function _createIndexingDisputeWithAllocation( + address _fisherman, + uint256 _deposit, + address _allocationId, + bytes32 _poi + ) private returns (bytes32) { + // Create a disputeId + bytes32 disputeId = keccak256(abi.encodePacked(_allocationId, _poi)); + + // Only one dispute for an allocationId at a time + require(!isDisputeCreated(disputeId), DisputeManagerDisputeAlreadyCreated(disputeId)); + + // Allocation must exist + ISubgraphService subgraphService_ = _getSubgraphService(); + Allocation.State memory alloc = subgraphService_.getAllocation(_allocationId); + address indexer = alloc.indexer; + require(indexer != address(0), DisputeManagerIndexerNotFound(_allocationId)); + + // The indexer must be disputable + IHorizonStaking.Provision memory provision = _graphStaking().getProvision(indexer, address(subgraphService_)); + require(provision.tokens != 0, DisputeManagerZeroTokens()); + + // Store dispute + uint256 stakeSnapshot = _getStakeSnapshot(indexer, provision.tokens); + uint256 cancellableAt = block.timestamp + disputePeriod; + disputes[disputeId] = Dispute( + alloc.indexer, + _fisherman, + _deposit, + 0, + DisputeType.IndexingDispute, + IDisputeManager.DisputeStatus.Pending, + block.timestamp, + cancellableAt, + stakeSnapshot + ); + + emit IndexingDisputeCreated( + disputeId, + alloc.indexer, + _fisherman, + _deposit, + _allocationId, + _poi, + stakeSnapshot, + cancellableAt + ); + + return disputeId; + } + + /** + * @notice Accept a dispute + * @param _disputeId The id of the dispute + * @param _dispute The dispute + * @param _tokensSlashed The amount of tokens to slash + */ + function _acceptDispute(bytes32 _disputeId, Dispute storage _dispute, uint256 _tokensSlashed) private { + uint256 tokensToReward = _slashIndexer(_dispute.indexer, _tokensSlashed, _dispute.stakeSnapshot); + _dispute.status = IDisputeManager.DisputeStatus.Accepted; + _graphToken().pushTokens(_dispute.fisherman, tokensToReward + _dispute.deposit); + + emit DisputeAccepted(_disputeId, _dispute.indexer, _dispute.fisherman, _dispute.deposit + tokensToReward); + } + + /** + * @notice Reject a dispute + * @param _disputeId The id of the dispute + * @param _dispute The dispute + */ + function _rejectDispute(bytes32 _disputeId, Dispute storage _dispute) private { + _dispute.status = IDisputeManager.DisputeStatus.Rejected; + _graphToken().burnTokens(_dispute.deposit); + + emit DisputeRejected(_disputeId, _dispute.indexer, _dispute.fisherman, _dispute.deposit); + } + + /** + * @notice Draw a dispute + * @param _disputeId The id of the dispute + * @param _dispute The dispute + */ + function _drawDispute(bytes32 _disputeId, Dispute storage _dispute) private { + _dispute.status = IDisputeManager.DisputeStatus.Drawn; + _graphToken().pushTokens(_dispute.fisherman, _dispute.deposit); + + emit DisputeDrawn(_disputeId, _dispute.indexer, _dispute.fisherman, _dispute.deposit); + } + + /** + * @notice Cancel a dispute + * @param _disputeId The id of the dispute + * @param _dispute The dispute + */ + function _cancelDispute(bytes32 _disputeId, Dispute storage _dispute) private { + _dispute.status = IDisputeManager.DisputeStatus.Cancelled; + _graphToken().pushTokens(_dispute.fisherman, _dispute.deposit); + + emit DisputeCancelled(_disputeId, _dispute.indexer, _dispute.fisherman, _dispute.deposit); + } + + /** + * @notice Make the subgraph service contract slash the indexer and reward the fisherman. + * Give the fisherman a reward equal to the fishermanRewardCut of slashed amount + * @param _indexer Address of the indexer + * @param _tokensSlash Amount of tokens to slash from the indexer + * @param _tokensStakeSnapshot Snapshot of the indexer's stake at the time of the dispute creation + * @return The amount of tokens rewarded to the fisherman + */ + function _slashIndexer( + address _indexer, + uint256 _tokensSlash, + uint256 _tokensStakeSnapshot + ) private returns (uint256) { + ISubgraphService subgraphService_ = _getSubgraphService(); + + // Get slashable amount for indexer + IHorizonStaking.Provision memory provision = _graphStaking().getProvision(_indexer, address(subgraphService_)); + + // Ensure slash amount is within the cap + uint256 maxTokensSlash = _tokensStakeSnapshot.mulPPM(maxSlashingCut); + require( + _tokensSlash != 0 && _tokensSlash <= maxTokensSlash, + DisputeManagerInvalidTokensSlash(_tokensSlash, maxTokensSlash) + ); + + // Rewards calculation: + // - Rewards can only be extracted from service provider tokens so we grab the minimum between the slash + // amount and indexer's tokens + // - The applied cut is the minimum between the provision's maxVerifierCut and the current fishermanRewardCut. This + // protects the indexer from sudden changes to the fishermanRewardCut while ensuring the slashing does not revert due + // to excessive rewards being requested. + uint256 maxRewardableTokens = MathUtils.min(_tokensSlash, provision.tokens); + uint256 effectiveCut = MathUtils.min(provision.maxVerifierCut, fishermanRewardCut); + uint256 tokensRewards = effectiveCut.mulPPM(maxRewardableTokens); + + subgraphService_.slash(_indexer, abi.encode(_tokensSlash, tokensRewards)); + return tokensRewards; + } + + /** + * @notice Set the arbitrator address. + * @dev Update the arbitrator to `_arbitrator` + * @param _arbitrator The address of the arbitration contract or party + */ + function _setArbitrator(address _arbitrator) private { + require(_arbitrator != address(0), DisputeManagerInvalidZeroAddress()); + arbitrator = _arbitrator; + emit ArbitratorSet(_arbitrator); + } + + /** + * @notice Set the dispute period. + * @dev Update the dispute period to `_disputePeriod` in seconds + * @param _disputePeriod Dispute period in seconds + */ + function _setDisputePeriod(uint64 _disputePeriod) private { + require(_disputePeriod != 0, DisputeManagerDisputePeriodZero()); + disputePeriod = _disputePeriod; + emit DisputePeriodSet(_disputePeriod); + } + + /** + * @notice Set the dispute deposit required to create a dispute. + * @dev Update the dispute deposit to `_disputeDeposit` Graph Tokens + * @param _disputeDeposit The dispute deposit in Graph Tokens + */ + function _setDisputeDeposit(uint256 _disputeDeposit) private { + require(_disputeDeposit >= MIN_DISPUTE_DEPOSIT, DisputeManagerInvalidDisputeDeposit(_disputeDeposit)); + disputeDeposit = _disputeDeposit; + emit DisputeDepositSet(_disputeDeposit); + } + + /** + * @notice Set the reward cut that the fisherman gets when slashing occurs. + * @dev Update the reward cut to `_fishermanRewardCut` + * @param _fishermanRewardCut The fisherman reward cut, in PPM + */ + function _setFishermanRewardCut(uint32 _fishermanRewardCut) private { + require( + _fishermanRewardCut <= MAX_FISHERMAN_REWARD_CUT, + DisputeManagerInvalidFishermanReward(_fishermanRewardCut) + ); + fishermanRewardCut = _fishermanRewardCut; + emit FishermanRewardCutSet(_fishermanRewardCut); + } + + /** + * @notice Set the maximum cut that can be used for slashing indexers. + * @param _maxSlashingCut Max slashing cut, in PPM + */ + function _setMaxSlashingCut(uint32 _maxSlashingCut) private { + require(PPMMath.isValidPPM(_maxSlashingCut), DisputeManagerInvalidMaxSlashingCut(_maxSlashingCut)); + maxSlashingCut = _maxSlashingCut; + emit MaxSlashingCutSet(maxSlashingCut); + } + + /** + * @notice Set the subgraph service address. + * @dev Update the subgraph service to `_subgraphService` + * @param _subgraphService The address of the subgraph service contract + */ + function _setSubgraphService(address _subgraphService) private { + require(_subgraphService != address(0), DisputeManagerInvalidZeroAddress()); + subgraphService = ISubgraphService(_subgraphService); + emit SubgraphServiceSet(_subgraphService); + } + + /** + * @notice Get the address of the subgraph service + * @dev Will revert if the subgraph service is not set + * @return The subgraph service address + */ + function _getSubgraphService() private view returns (ISubgraphService) { + require(address(subgraphService) != address(0), DisputeManagerSubgraphServiceNotSet()); + return subgraphService; + } + + /** + * @notice Returns whether the dispute is for a conflicting attestation or not. + * @param _dispute Dispute + * @return True conflicting attestation dispute + */ + function _isDisputeInConflict(Dispute storage _dispute) private view returns (bool) { + return _dispute.relatedDisputeId != bytes32(0); + } + + /** + * @notice Get the total stake snapshot for and indexer. + * @dev A few considerations: + * - We include both indexer and delegators stake. + * - Thawing stake is not excluded from the snapshot. + * - Delegators stake is capped at the delegation ratio to prevent delegators from inflating the snapshot + * to increase the indexer slash amount. + * + * Note that the snapshot can be inflated by delegators front-running the dispute creation with a delegation + * to the indexer. Given the snapshot is a cap, the dispute outcome is uncertain and considering the cost of capital + * and slashing risk, this is not a concern. + * @param _indexer Indexer address + * @param _indexerStake Indexer's stake + * @return Total stake snapshot + */ + function _getStakeSnapshot(address _indexer, uint256 _indexerStake) private view returns (uint256) { + uint256 delegatorsStake = _graphStaking().getDelegationPool(_indexer, address(_getSubgraphService())).tokens; + return _indexerStake + delegatorsStake; + } +} diff --git a/packages/subgraph-service/contracts/DisputeManagerStorage.sol b/packages/subgraph-service/contracts/DisputeManagerStorage.sol new file mode 100644 index 000000000..0f56b4cbe --- /dev/null +++ b/packages/subgraph-service/contracts/DisputeManagerStorage.sol @@ -0,0 +1,35 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity 0.8.27; + +import { IDisputeManager } from "./interfaces/IDisputeManager.sol"; +import { ISubgraphService } from "./interfaces/ISubgraphService.sol"; + +/** + * @title DisputeManagerStorage + * @notice This contract holds all the storage variables for the Dispute Manager contract. + * @custom:security-contact Please email security+contracts@thegraph.com if you find any + * bugs. We may have an active bug bounty program. + */ +abstract contract DisputeManagerV1Storage { + /// @notice The Subgraph Service contract address + ISubgraphService public subgraphService; + + /// @notice The arbitrator is solely in control of arbitrating disputes + address public arbitrator; + + /// @notice dispute period in seconds + uint64 public disputePeriod; + + /// @notice Deposit required to create a Dispute + uint256 public disputeDeposit; + + /// @notice Percentage of indexer slashed funds to assign as a reward to fisherman in successful dispute. In PPM. + uint32 public fishermanRewardCut; + + /// @notice Maximum percentage of indexer stake that can be slashed on a dispute. In PPM. + uint32 public maxSlashingCut; + + /// @notice List of disputes created + mapping(bytes32 disputeId => IDisputeManager.Dispute dispute) public disputes; +} diff --git a/packages/subgraph-service/contracts/SubgraphService.sol b/packages/subgraph-service/contracts/SubgraphService.sol new file mode 100644 index 000000000..4179cf786 --- /dev/null +++ b/packages/subgraph-service/contracts/SubgraphService.sol @@ -0,0 +1,604 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +pragma solidity 0.8.27; + +import { IGraphPayments } from "@graphprotocol/horizon/contracts/interfaces/IGraphPayments.sol"; +import { IGraphToken } from "@graphprotocol/contracts/contracts/token/IGraphToken.sol"; +import { IGraphTallyCollector } from "@graphprotocol/horizon/contracts/interfaces/IGraphTallyCollector.sol"; +import { IRewardsIssuer } from "@graphprotocol/contracts/contracts/rewards/IRewardsIssuer.sol"; +import { IDataService } from "@graphprotocol/horizon/contracts/data-service/interfaces/IDataService.sol"; +import { ISubgraphService } from "./interfaces/ISubgraphService.sol"; + +import { OwnableUpgradeable } from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; +import { MulticallUpgradeable } from "@openzeppelin/contracts-upgradeable/utils/MulticallUpgradeable.sol"; +import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; +import { DataServicePausableUpgradeable } from "@graphprotocol/horizon/contracts/data-service/extensions/DataServicePausableUpgradeable.sol"; +import { DataService } from "@graphprotocol/horizon/contracts/data-service/DataService.sol"; +import { DataServiceFees } from "@graphprotocol/horizon/contracts/data-service/extensions/DataServiceFees.sol"; +import { Directory } from "./utilities/Directory.sol"; +import { AllocationManager } from "./utilities/AllocationManager.sol"; +import { SubgraphServiceV1Storage } from "./SubgraphServiceStorage.sol"; + +import { TokenUtils } from "@graphprotocol/contracts/contracts/utils/TokenUtils.sol"; +import { PPMMath } from "@graphprotocol/horizon/contracts/libraries/PPMMath.sol"; +import { Allocation } from "./libraries/Allocation.sol"; +import { LegacyAllocation } from "./libraries/LegacyAllocation.sol"; + +/** + * @title SubgraphService contract + * @custom:security-contact Please email security+contracts@thegraph.com if you find any + * bugs. We may have an active bug bounty program. + */ +contract SubgraphService is + Initializable, + OwnableUpgradeable, + MulticallUpgradeable, + DataService, + DataServicePausableUpgradeable, + DataServiceFees, + Directory, + AllocationManager, + SubgraphServiceV1Storage, + IRewardsIssuer, + ISubgraphService +{ + using PPMMath for uint256; + using Allocation for mapping(address => Allocation.State); + using Allocation for Allocation.State; + using TokenUtils for IGraphToken; + + /** + * @notice Checks that an indexer is registered + * @param indexer The address of the indexer + */ + modifier onlyRegisteredIndexer(address indexer) { + require(indexers[indexer].registeredAt != 0, SubgraphServiceIndexerNotRegistered(indexer)); + _; + } + + /** + * @notice Constructor for the SubgraphService contract + * @dev DataService and Directory constructors set a bunch of immutable variables + * @param graphController The address of the Graph Controller contract + * @param disputeManager The address of the DisputeManager contract + * @param graphTallyCollector The address of the GraphTallyCollector contract + * @param curation The address of the Curation contract + */ + constructor( + address graphController, + address disputeManager, + address graphTallyCollector, + address curation + ) DataService(graphController) Directory(address(this), disputeManager, graphTallyCollector, curation) { + _disableInitializers(); + } + + /// @inheritdoc ISubgraphService + function initialize( + address owner, + uint256 minimumProvisionTokens, + uint32 maximumDelegationRatio, + uint256 stakeToFeesRatio_ + ) external initializer { + __Ownable_init(owner); + __Multicall_init(); + __DataService_init(); + __DataServicePausable_init(); + __AllocationManager_init("SubgraphService", "1.0"); + + _setProvisionTokensRange(minimumProvisionTokens, type(uint256).max); + _setDelegationRatio(maximumDelegationRatio); + _setStakeToFeesRatio(stakeToFeesRatio_); + } + + /** + * @notice + * @dev Implements {IDataService.register} + * + * Requirements: + * - The indexer must not be already registered + * - The URL must not be empty + * - The provision must be valid according to the subgraph service rules + * + * Emits a {ServiceProviderRegistered} event + * + * @param indexer The address of the indexer to register + * @param data Encoded registration data: + * - string `url`: The URL of the indexer + * - string `geohash`: The geohash of the indexer + * - address `paymentsDestination`: The address where the indexer wants to receive payments. + * Use zero address for automatically restaking payments. + */ + /// @inheritdoc IDataService + function register( + address indexer, + bytes calldata data + ) external override onlyAuthorizedForProvision(indexer) onlyValidProvision(indexer) whenNotPaused { + (string memory url, string memory geohash, address paymentsDestination_) = abi.decode( + data, + (string, string, address) + ); + + require(bytes(url).length > 0, SubgraphServiceEmptyUrl()); + require(bytes(geohash).length > 0, SubgraphServiceEmptyGeohash()); + require(indexers[indexer].registeredAt == 0, SubgraphServiceIndexerAlreadyRegistered()); + + // Register the indexer + indexers[indexer] = Indexer({ registeredAt: block.timestamp, url: url, geoHash: geohash }); + if (paymentsDestination_ != address(0)) { + _setPaymentsDestination(indexer, paymentsDestination_); + } + + emit ServiceProviderRegistered(indexer, data); + } + + /** + * @notice Accept staged parameters in the provision of a service provider + * @dev Implements {IDataService-acceptProvisionPendingParameters} + * + * Requirements: + * - The indexer must be registered + * - Must have previously staged provision parameters, using {IHorizonStaking-setProvisionParameters} + * - The new provision parameters must be valid according to the subgraph service rules + * + * Emits a {ProvisionPendingParametersAccepted} event + * + * @param indexer The address of the indexer to accept the provision for + */ + /// @inheritdoc IDataService + function acceptProvisionPendingParameters( + address indexer, + bytes calldata + ) external override onlyAuthorizedForProvision(indexer) whenNotPaused { + _acceptProvisionParameters(indexer); + emit ProvisionPendingParametersAccepted(indexer); + } + + /** + * @notice Allocates tokens to subgraph deployment, manifesting the indexer's commitment to index it + * @dev This is the equivalent of the `allocate` function in the legacy Staking contract. + * + * Requirements: + * - The indexer must be registered + * - The provision must be valid according to the subgraph service rules + * - Allocation id cannot be zero + * - Allocation id cannot be reused from the legacy staking contract + * - The indexer must have enough available tokens to allocate + * + * The `allocationProof` is a 65-bytes Ethereum signed message of `keccak256(indexerAddress,allocationId)`. + * + * See {AllocationManager-allocate} for more details. + * + * Emits {ServiceStarted} and {AllocationCreated} events + * + * @param indexer The address of the indexer + * @param data Encoded data: + * - bytes32 `subgraphDeploymentId`: The id of the subgraph deployment + * - uint256 `tokens`: The amount of tokens to allocate + * - address `allocationId`: The id of the allocation + * - bytes `allocationProof`: Signed proof of the allocation id address ownership + */ + /// @inheritdoc IDataService + function startService( + address indexer, + bytes calldata data + ) + external + override + onlyAuthorizedForProvision(indexer) + onlyValidProvision(indexer) + onlyRegisteredIndexer(indexer) + whenNotPaused + { + (bytes32 subgraphDeploymentId, uint256 tokens, address allocationId, bytes memory allocationProof) = abi.decode( + data, + (bytes32, uint256, address, bytes) + ); + _allocate(indexer, allocationId, subgraphDeploymentId, tokens, allocationProof, _delegationRatio); + emit ServiceStarted(indexer, data); + } + + /** + * @notice Close an allocation, indicating that the indexer has stopped indexing the subgraph deployment + * @dev This is the equivalent of the `closeAllocation` function in the legacy Staking contract. + * There are a few notable differences with the legacy function: + * - allocations are nowlong lived. All service payments, including indexing rewards, should be collected periodically + * without the need of closing the allocation. Allocations should only be closed when indexers want to reclaim the allocated + * tokens for other purposes. + * - No POI is required to close an allocation. Indexers should present POIs to collect indexing rewards using {collect}. + * + * Requirements: + * - The indexer must be registered + * - Allocation must exist and be open + * + * Emits {ServiceStopped} and {AllocationClosed} events + * + * @param indexer The address of the indexer + * @param data Encoded data: + * - address `allocationId`: The id of the allocation + */ + /// @inheritdoc IDataService + function stopService( + address indexer, + bytes calldata data + ) external override onlyAuthorizedForProvision(indexer) onlyRegisteredIndexer(indexer) whenNotPaused { + address allocationId = abi.decode(data, (address)); + require( + _allocations.get(allocationId).indexer == indexer, + SubgraphServiceAllocationNotAuthorized(indexer, allocationId) + ); + _closeAllocation(allocationId, false); + emit ServiceStopped(indexer, data); + } + + /** + * @notice Collects payment for the service provided by the indexer + * Allows collecting different types of payments such as query fees and indexing rewards. + * It uses Graph Horizon payments protocol to process payments. + * Reverts if the payment type is not supported. + * @dev This function is the equivalent of the `collect` function for query fees and the `closeAllocation` function + * for indexing rewards in the legacy Staking contract. + * + * Requirements: + * - The indexer must be registered + * - The provision must be valid according to the subgraph service rules + * + * Emits a {ServicePaymentCollected} event. Emits payment type specific events. + * + * For query fees, see {SubgraphService-_collectQueryFees} for more details. + * For indexing rewards, see {AllocationManager-_collectIndexingRewards} for more details. + * + * @param indexer The address of the indexer + * @param paymentType The type of payment to collect as defined in {IGraphPayments} + * @param data Encoded data: + * - For query fees: + * - IGraphTallyCollector.SignedRAV `signedRav`: The signed RAV + * - For indexing rewards: + * - address `allocationId`: The id of the allocation + * - bytes32 `poi`: The POI being presented + * - bytes `poiMetadata`: The metadata associated with the POI. See {AllocationManager-_collectIndexingRewards} for more details. + */ + /// @inheritdoc IDataService + function collect( + address indexer, + IGraphPayments.PaymentTypes paymentType, + bytes calldata data + ) + external + override + onlyAuthorizedForProvision(indexer) + onlyValidProvision(indexer) + onlyRegisteredIndexer(indexer) + whenNotPaused + returns (uint256) + { + uint256 paymentCollected = 0; + + if (paymentType == IGraphPayments.PaymentTypes.QueryFee) { + paymentCollected = _collectQueryFees(indexer, data); + } else if (paymentType == IGraphPayments.PaymentTypes.IndexingRewards) { + paymentCollected = _collectIndexingRewards(indexer, data); + } else { + revert SubgraphServiceInvalidPaymentType(paymentType); + } + + emit ServicePaymentCollected(indexer, paymentType, paymentCollected); + return paymentCollected; + } + + /** + * @notice See {IHorizonStaking-slash} for more details. + * @dev Slashing is delegated to the {DisputeManager} contract which is the only one that can call this + * function. + */ + /// @inheritdoc IDataService + function slash(address indexer, bytes calldata data) external override onlyDisputeManager { + (uint256 tokens, uint256 reward) = abi.decode(data, (uint256, uint256)); + _graphStaking().slash(indexer, tokens, reward, address(_disputeManager())); + emit ServiceProviderSlashed(indexer, tokens); + } + + /// @inheritdoc ISubgraphService + function closeStaleAllocation(address allocationId) external override whenNotPaused { + Allocation.State memory allocation = _allocations.get(allocationId); + require(allocation.isStale(maxPOIStaleness), SubgraphServiceCannotForceCloseAllocation(allocationId)); + require(!allocation.isAltruistic(), SubgraphServiceAllocationIsAltruistic(allocationId)); + _closeAllocation(allocationId, true); + } + + /// @inheritdoc ISubgraphService + function resizeAllocation( + address indexer, + address allocationId, + uint256 tokens + ) + external + onlyAuthorizedForProvision(indexer) + onlyValidProvision(indexer) + onlyRegisteredIndexer(indexer) + whenNotPaused + { + require( + _allocations.get(allocationId).indexer == indexer, + SubgraphServiceAllocationNotAuthorized(indexer, allocationId) + ); + _resizeAllocation(allocationId, tokens, _delegationRatio); + } + + /// @inheritdoc ISubgraphService + function migrateLegacyAllocation( + address indexer, + address allocationId, + bytes32 subgraphDeploymentID + ) external override onlyOwner { + _migrateLegacyAllocation(indexer, allocationId, subgraphDeploymentID); + } + + /// @inheritdoc ISubgraphService + function setPauseGuardian(address pauseGuardian, bool allowed) external override onlyOwner { + _setPauseGuardian(pauseGuardian, allowed); + } + + /// @inheritdoc ISubgraphService + function setPaymentsDestination(address paymentsDestination_) external override { + _setPaymentsDestination(msg.sender, paymentsDestination_); + } + + /// @inheritdoc ISubgraphService + function setMinimumProvisionTokens(uint256 minimumProvisionTokens) external override onlyOwner { + _setProvisionTokensRange(minimumProvisionTokens, DEFAULT_MAX_PROVISION_TOKENS); + } + + /// @inheritdoc ISubgraphService + function setDelegationRatio(uint32 delegationRatio) external override onlyOwner { + _setDelegationRatio(delegationRatio); + } + + /// @inheritdoc ISubgraphService + function setStakeToFeesRatio(uint256 stakeToFeesRatio_) external override onlyOwner { + _setStakeToFeesRatio(stakeToFeesRatio_); + } + + /// @inheritdoc ISubgraphService + function setMaxPOIStaleness(uint256 maxPOIStaleness_) external override onlyOwner { + _setMaxPOIStaleness(maxPOIStaleness_); + } + + /// @inheritdoc ISubgraphService + function setCurationCut(uint256 curationCut) external override onlyOwner { + require(PPMMath.isValidPPM(curationCut), SubgraphServiceInvalidCurationCut(curationCut)); + curationFeesCut = curationCut; + emit CurationCutSet(curationCut); + } + + /// @inheritdoc ISubgraphService + function getAllocation(address allocationId) external view override returns (Allocation.State memory) { + return _allocations[allocationId]; + } + + /// @inheritdoc IRewardsIssuer + function getAllocationData( + address allocationId + ) external view override returns (bool, address, bytes32, uint256, uint256, uint256) { + Allocation.State memory allo = _allocations[allocationId]; + return ( + allo.isOpen(), + allo.indexer, + allo.subgraphDeploymentId, + allo.tokens, + allo.accRewardsPerAllocatedToken, + allo.accRewardsPending + ); + } + + /// @inheritdoc IRewardsIssuer + function getSubgraphAllocatedTokens(bytes32 subgraphDeploymentId) external view override returns (uint256) { + return _subgraphAllocatedTokens[subgraphDeploymentId]; + } + + /// @inheritdoc ISubgraphService + function getLegacyAllocation(address allocationId) external view override returns (LegacyAllocation.State memory) { + return _legacyAllocations[allocationId]; + } + + /// @inheritdoc ISubgraphService + function getDisputeManager() external view override returns (address) { + return address(_disputeManager()); + } + + /// @inheritdoc ISubgraphService + function getGraphTallyCollector() external view override returns (address) { + return address(_graphTallyCollector()); + } + + /// @inheritdoc ISubgraphService + function getCuration() external view override returns (address) { + return address(_curation()); + } + + /// @inheritdoc ISubgraphService + function encodeAllocationProof(address indexer, address allocationId) external view override returns (bytes32) { + return _encodeAllocationProof(indexer, allocationId); + } + + /// @inheritdoc ISubgraphService + function isOverAllocated(address indexer) external view override returns (bool) { + return _isOverAllocated(indexer, _delegationRatio); + } + + // -- Data service parameter getters -- + /** + * @notice Getter for the accepted thawing period range for provisions + * The accepted range is just the dispute period defined by {DisputeManager-getDisputePeriod} + * @dev This override ensures {ProvisionManager} uses the thawing period from the {DisputeManager} + * @return The minimum thawing period - the dispute period + * @return The maximum thawing period - the dispute period + */ + function _getThawingPeriodRange() internal view override returns (uint64, uint64) { + uint64 disputePeriod = _disputeManager().getDisputePeriod(); + return (disputePeriod, disputePeriod); + } + + /** + * @notice Getter for the accepted verifier cut range for provisions + * @return The minimum verifier cut which is defined by the fisherman reward cut {DisputeManager-getFishermanRewardCut} + * @return The maximum is 100% in PPM + */ + function _getVerifierCutRange() internal view override returns (uint32, uint32) { + return (_disputeManager().getFishermanRewardCut(), DEFAULT_MAX_VERIFIER_CUT); + } + + /** + * @notice Collect query fees + * Stake equal to the amount being collected times the `stakeToFeesRatio` is locked into a stake claim. + * This claim can be released at a later stage once expired. + * + * It's important to note that before collecting this function will attempt to release any expired stake claims. + * This could lead to an out of gas error if there are too many expired claims. In that case, the indexer will need to + * manually release the claims, see {IDataServiceFees-releaseStake}, before attempting to collect again. + * + * @dev This function is the equivalent of the legacy `collect` function for query fees. + * @dev Uses the {GraphTallyCollector} to collect payment from Graph Horizon payments protocol. + * Fees are distributed to service provider and delegators by {GraphPayments}, though curators + * share is distributed by this function. + * + * Query fees can be collected on closed allocations. + * + * Requirements: + * - Indexer must have enough available tokens to lock as economic security for fees + * + * Emits a {StakeClaimsReleased} event, and a {StakeClaimReleased} event for each claim released. + * Emits a {StakeClaimLocked} event. + * Emits a {QueryFeesCollected} event. + * + * @param indexer The address of the indexer + * @param data Encoded data: + * - IGraphTallyCollector.SignedRAV `signedRav`: The signed RAV + * - uint256 `tokensToCollect`: The amount of tokens to collect. Allows partially collecting a RAV. If 0, the entire RAV will + * be collected. + * @return The amount of fees collected + */ + function _collectQueryFees(address indexer, bytes calldata data) private returns (uint256) { + (IGraphTallyCollector.SignedRAV memory signedRav, uint256 tokensToCollect) = abi.decode( + data, + (IGraphTallyCollector.SignedRAV, uint256) + ); + require( + signedRav.rav.serviceProvider == indexer, + SubgraphServiceIndexerMismatch(signedRav.rav.serviceProvider, indexer) + ); + + // Check that collectionId (256 bits) is a valid address (160 bits) + // collectionId is expected to be a zero padded address so it's safe to cast to uint160 + require( + uint256(signedRav.rav.collectionId) <= type(uint160).max, + SubgraphServiceInvalidCollectionId(signedRav.rav.collectionId) + ); + address allocationId = address(uint160(uint256(signedRav.rav.collectionId))); + Allocation.State memory allocation = _allocations.get(allocationId); + + // Check RAV is consistent - RAV indexer must match the allocation's indexer + require(allocation.indexer == indexer, SubgraphServiceInvalidRAV(indexer, allocation.indexer)); + bytes32 subgraphDeploymentId = allocation.subgraphDeploymentId; + + // release expired stake claims + _releaseStake(indexer, 0); + + // Collect from GraphPayments - only curators cut is sent back to the subgraph service + uint256 tokensCollected; + uint256 tokensCurators; + { + uint256 balanceBefore = _graphToken().balanceOf(address(this)); + + tokensCollected = _graphTallyCollector().collect( + IGraphPayments.PaymentTypes.QueryFee, + _encodeGraphTallyData(signedRav, _curation().isCurated(subgraphDeploymentId) ? curationFeesCut : 0), + tokensToCollect + ); + + uint256 balanceAfter = _graphToken().balanceOf(address(this)); + require(balanceAfter >= balanceBefore, SubgraphServiceInconsistentCollection(balanceBefore, balanceAfter)); + tokensCurators = balanceAfter - balanceBefore; + } + + if (tokensCollected > 0) { + // lock stake as economic security for fees + _lockStake( + indexer, + tokensCollected * stakeToFeesRatio, + block.timestamp + _disputeManager().getDisputePeriod() + ); + + if (tokensCurators > 0) { + // curation collection changes subgraph signal so we take rewards snapshot + _graphRewardsManager().onSubgraphSignalUpdate(subgraphDeploymentId); + + // Send GRT and bookkeep by calling collect() + _graphToken().pushTokens(address(_curation()), tokensCurators); + _curation().collect(subgraphDeploymentId, tokensCurators); + } + } + + emit QueryFeesCollected( + indexer, + signedRav.rav.payer, + allocationId, + subgraphDeploymentId, + tokensCollected, + tokensCurators + ); + return tokensCollected; + } + + /** + * @notice Collect indexing rewards + * @param indexer The address of the indexer + * @param data Encoded data: + * - address `allocationId`: The id of the allocation + * - bytes32 `poi`: The POI being presented + * - bytes `poiMetadata`: The metadata associated with the POI. See {AllocationManager-_presentPOI} for more details. + * @return The amount of indexing rewards collected + */ + function _collectIndexingRewards(address indexer, bytes calldata data) private returns (uint256) { + (address allocationId, bytes32 poi_, bytes memory poiMetadata_) = abi.decode(data, (address, bytes32, bytes)); + require( + _allocations.get(allocationId).indexer == indexer, + SubgraphServiceAllocationNotAuthorized(indexer, allocationId) + ); + return _presentPOI(allocationId, poi_, poiMetadata_, _delegationRatio, paymentsDestination[indexer]); + } + + /** + * @notice Sets the payments destination for an indexer to receive payments + * @dev Emits a {PaymentsDestinationSet} event + * @param _indexer The address of the indexer + * @param _paymentsDestination The address where payments should be sent + */ + function _setPaymentsDestination(address _indexer, address _paymentsDestination) internal { + paymentsDestination[_indexer] = _paymentsDestination; + emit PaymentsDestinationSet(_indexer, _paymentsDestination); + } + + /** + * @notice Set the stake to fees ratio. + * @param _stakeToFeesRatio The stake to fees ratio + */ + function _setStakeToFeesRatio(uint256 _stakeToFeesRatio) private { + require(_stakeToFeesRatio != 0, SubgraphServiceInvalidZeroStakeToFeesRatio()); + stakeToFeesRatio = _stakeToFeesRatio; + emit StakeToFeesRatioSet(_stakeToFeesRatio); + } + + /** + * @notice Encodes the data for the GraphTallyCollector + * @dev The purpose of this function is just to avoid stack too deep errors + * @param signedRav The signed RAV + * @param curationCut The curation cut + * @return The encoded data + */ + function _encodeGraphTallyData( + IGraphTallyCollector.SignedRAV memory signedRav, + uint256 curationCut + ) private view returns (bytes memory) { + return abi.encode(signedRav, curationCut, paymentsDestination[signedRav.rav.serviceProvider]); + } +} diff --git a/packages/subgraph-service/contracts/SubgraphServiceStorage.sol b/packages/subgraph-service/contracts/SubgraphServiceStorage.sol new file mode 100644 index 000000000..06ada3a59 --- /dev/null +++ b/packages/subgraph-service/contracts/SubgraphServiceStorage.sol @@ -0,0 +1,24 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +pragma solidity 0.8.27; + +import { ISubgraphService } from "./interfaces/ISubgraphService.sol"; + +/** + * @title SubgraphServiceStorage + * @notice This contract holds all the storage variables for the Subgraph Service contract. + * @custom:security-contact Please email security+contracts@thegraph.com if you find any + * bugs. We may have an active bug bounty program. + */ +abstract contract SubgraphServiceV1Storage { + /// @notice Service providers registered in the data service + mapping(address indexer => ISubgraphService.Indexer details) public indexers; + + ///@notice Multiplier for how many tokens back collected query fees + uint256 public stakeToFeesRatio; + + /// @notice The cut curators take from query fee payments. In PPM. + uint256 public curationFeesCut; + + /// @notice Destination of indexer payments + mapping(address indexer => address destination) public paymentsDestination; +} diff --git a/packages/subgraph-service/contracts/interfaces/IDisputeManager.sol b/packages/subgraph-service/contracts/interfaces/IDisputeManager.sol new file mode 100644 index 000000000..611009bef --- /dev/null +++ b/packages/subgraph-service/contracts/interfaces/IDisputeManager.sol @@ -0,0 +1,613 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity 0.8.27; + +import { Attestation } from "../libraries/Attestation.sol"; + +/** + * @title IDisputeManager + * @notice Interface for the {Dispute Manager} contract. + * @custom:security-contact Please email security+contracts@thegraph.com if you find any + * bugs. We may have an active bug bounty program. + */ +interface IDisputeManager { + /// @notice Types of disputes that can be created + enum DisputeType { + Null, + IndexingDispute, + QueryDispute, + LegacyDispute + } + + /// @notice Status of a dispute + enum DisputeStatus { + Null, + Accepted, + Rejected, + Drawn, + Pending, + Cancelled + } + + /** + * @notice Dispute details + * @param indexer The indexer that is being disputed + * @param fisherman The fisherman that created the dispute + * @param deposit The amount of tokens deposited by the fisherman + * @param relatedDisputeId The link to a related dispute, used when creating dispute via conflicting attestations + * @param disputeType The type of dispute + * @param status The status of the dispute + * @param createdAt The timestamp when the dispute was created + * @param cancellableAt The timestamp when the dispute can be cancelled + * @param stakeSnapshot The stake snapshot of the indexer at the time of the dispute (includes delegation up to the delegation ratio) + */ + struct Dispute { + address indexer; + address fisherman; + uint256 deposit; + bytes32 relatedDisputeId; + DisputeType disputeType; + DisputeStatus status; + uint256 createdAt; + uint256 cancellableAt; + uint256 stakeSnapshot; + } + + /** + * @notice Emitted when arbitrator is set. + * @param arbitrator The address of the arbitrator. + */ + event ArbitratorSet(address indexed arbitrator); + + /** + * @notice Emitted when dispute period is set. + * @param disputePeriod The dispute period in seconds. + */ + event DisputePeriodSet(uint64 disputePeriod); + + /** + * @notice Emitted when dispute deposit is set. + * @param disputeDeposit The dispute deposit required to create a dispute. + */ + event DisputeDepositSet(uint256 disputeDeposit); + + /** + * @notice Emitted when max slashing cut is set. + * @param maxSlashingCut The maximum slashing cut that can be set. + */ + event MaxSlashingCutSet(uint32 maxSlashingCut); + + /** + * @notice Emitted when fisherman reward cut is set. + * @param fishermanRewardCut The fisherman reward cut. + */ + event FishermanRewardCutSet(uint32 fishermanRewardCut); + + /** + * @notice Emitted when subgraph service is set. + * @param subgraphService The address of the subgraph service. + */ + event SubgraphServiceSet(address indexed subgraphService); + + /** + * @dev Emitted when a query dispute is created for `subgraphDeploymentId` and `indexer` + * by `fisherman`. + * The event emits the amount of `tokens` deposited by the fisherman and `attestation` submitted. + * @param disputeId The dispute id + * @param indexer The indexer address + * @param fisherman The fisherman address + * @param tokens The amount of tokens deposited by the fisherman + * @param subgraphDeploymentId The subgraph deployment id + * @param attestation The attestation + * @param cancellableAt The timestamp when the dispute can be cancelled + * @param stakeSnapshot The stake snapshot of the indexer at the time of the dispute + */ + event QueryDisputeCreated( + bytes32 indexed disputeId, + address indexed indexer, + address indexed fisherman, + uint256 tokens, + bytes32 subgraphDeploymentId, + bytes attestation, + uint256 stakeSnapshot, + uint256 cancellableAt + ); + + /** + * @dev Emitted when an indexing dispute is created for `allocationId` and `indexer` + * by `fisherman`. + * The event emits the amount of `tokens` deposited by the fisherman. + * @param disputeId The dispute id + * @param indexer The indexer address + * @param fisherman The fisherman address + * @param tokens The amount of tokens deposited by the fisherman + * @param allocationId The allocation id + * @param poi The POI + * @param stakeSnapshot The stake snapshot of the indexer at the time of the dispute + * @param cancellableAt The timestamp when the dispute can be cancelled + */ + event IndexingDisputeCreated( + bytes32 indexed disputeId, + address indexed indexer, + address indexed fisherman, + uint256 tokens, + address allocationId, + bytes32 poi, + uint256 stakeSnapshot, + uint256 cancellableAt + ); + + /** + * @dev Emitted when a legacy dispute is created for `allocationId` and `fisherman`. + * The event emits the amount of `tokensSlash` to slash and `tokensRewards` to reward the fisherman. + * @param disputeId The dispute id + * @param indexer The indexer address + * @param fisherman The fisherman address to be credited with the rewards + * @param allocationId The allocation id + * @param tokensSlash The amount of tokens to slash + * @param tokensRewards The amount of tokens to reward the fisherman + */ + event LegacyDisputeCreated( + bytes32 indexed disputeId, + address indexed indexer, + address indexed fisherman, + address allocationId, + uint256 tokensSlash, + uint256 tokensRewards + ); + + /** + * @dev Emitted when arbitrator accepts a `disputeId` to `indexer` created by `fisherman`. + * The event emits the amount `tokens` transferred to the fisherman, the deposit plus reward. + * @param disputeId The dispute id + * @param indexer The indexer address + * @param fisherman The fisherman address + * @param tokens The amount of tokens transferred to the fisherman, the deposit plus reward + */ + event DisputeAccepted( + bytes32 indexed disputeId, + address indexed indexer, + address indexed fisherman, + uint256 tokens + ); + + /** + * @dev Emitted when arbitrator rejects a `disputeId` for `indexer` created by `fisherman`. + * The event emits the amount `tokens` burned from the fisherman deposit. + * @param disputeId The dispute id + * @param indexer The indexer address + * @param fisherman The fisherman address + * @param tokens The amount of tokens burned from the fisherman deposit + */ + event DisputeRejected( + bytes32 indexed disputeId, + address indexed indexer, + address indexed fisherman, + uint256 tokens + ); + + /** + * @dev Emitted when arbitrator draw a `disputeId` for `indexer` created by `fisherman`. + * The event emits the amount `tokens` used as deposit and returned to the fisherman. + * @param disputeId The dispute id + * @param indexer The indexer address + * @param fisherman The fisherman address + * @param tokens The amount of tokens returned to the fisherman - the deposit + */ + event DisputeDrawn(bytes32 indexed disputeId, address indexed indexer, address indexed fisherman, uint256 tokens); + + /** + * @dev Emitted when two disputes are in conflict to link them. + * This event will be emitted after each DisputeCreated event is emitted + * for each of the individual disputes. + * @param disputeId1 The first dispute id + * @param disputeId2 The second dispute id + */ + event DisputeLinked(bytes32 indexed disputeId1, bytes32 indexed disputeId2); + + /** + * @dev Emitted when a dispute is cancelled by the fisherman. + * The event emits the amount `tokens` returned to the fisherman. + * @param disputeId The dispute id + * @param indexer The indexer address + * @param fisherman The fisherman address + * @param tokens The amount of tokens returned to the fisherman - the deposit + */ + event DisputeCancelled( + bytes32 indexed disputeId, + address indexed indexer, + address indexed fisherman, + uint256 tokens + ); + + // -- Errors -- + + /** + * @notice Thrown when the caller is not the arbitrator + */ + error DisputeManagerNotArbitrator(); + + /** + * @notice Thrown when the caller is not the fisherman + */ + error DisputeManagerNotFisherman(); + + /** + * @notice Thrown when the address is the zero address + */ + error DisputeManagerInvalidZeroAddress(); + + /** + * @notice Thrown when the dispute period is zero + */ + error DisputeManagerDisputePeriodZero(); + + /** + * @notice Thrown when the indexer being disputed has no provisioned tokens + */ + error DisputeManagerZeroTokens(); + + /** + * @notice Thrown when the dispute id is invalid + * @param disputeId The dispute id + */ + error DisputeManagerInvalidDispute(bytes32 disputeId); + + /** + * @notice Thrown when the dispute deposit is invalid - less than the minimum dispute deposit + * @param disputeDeposit The dispute deposit + */ + error DisputeManagerInvalidDisputeDeposit(uint256 disputeDeposit); + + /** + * @notice Thrown when the fisherman reward cut is invalid + * @param cut The fisherman reward cut + */ + error DisputeManagerInvalidFishermanReward(uint32 cut); + + /** + * @notice Thrown when the max slashing cut is invalid + * @param maxSlashingCut The max slashing cut + */ + error DisputeManagerInvalidMaxSlashingCut(uint32 maxSlashingCut); + + /** + * @notice Thrown when the tokens slash is invalid + * @param tokensSlash The tokens slash + * @param maxTokensSlash The max tokens slash + */ + error DisputeManagerInvalidTokensSlash(uint256 tokensSlash, uint256 maxTokensSlash); + + /** + * @notice Thrown when the dispute is not pending + * @param status The status of the dispute + */ + error DisputeManagerDisputeNotPending(IDisputeManager.DisputeStatus status); + + /** + * @notice Thrown when the dispute is already created + * @param disputeId The dispute id + */ + error DisputeManagerDisputeAlreadyCreated(bytes32 disputeId); + + /** + * @notice Thrown when the dispute period is not finished + */ + error DisputeManagerDisputePeriodNotFinished(); + + /** + * @notice Thrown when the dispute is in conflict + * @param disputeId The dispute id + */ + error DisputeManagerDisputeInConflict(bytes32 disputeId); + + /** + * @notice Thrown when the dispute is not in conflict + * @param disputeId The dispute id + */ + error DisputeManagerDisputeNotInConflict(bytes32 disputeId); + + /** + * @notice Thrown when the dispute must be accepted + * @param disputeId The dispute id + * @param relatedDisputeId The related dispute id + */ + error DisputeManagerMustAcceptRelatedDispute(bytes32 disputeId, bytes32 relatedDisputeId); + + /** + * @notice Thrown when the indexer is not found + * @param allocationId The allocation id + */ + error DisputeManagerIndexerNotFound(address allocationId); + + /** + * @notice Thrown when the subgraph deployment is not matching + * @param subgraphDeploymentId1 The subgraph deployment id of the first attestation + * @param subgraphDeploymentId2 The subgraph deployment id of the second attestation + */ + error DisputeManagerNonMatchingSubgraphDeployment(bytes32 subgraphDeploymentId1, bytes32 subgraphDeploymentId2); + + /** + * @notice Thrown when the attestations are not conflicting + * @param requestCID1 The request CID of the first attestation + * @param responseCID1 The response CID of the first attestation + * @param subgraphDeploymentId1 The subgraph deployment id of the first attestation + * @param requestCID2 The request CID of the second attestation + * @param responseCID2 The response CID of the second attestation + * @param subgraphDeploymentId2 The subgraph deployment id of the second attestation + */ + error DisputeManagerNonConflictingAttestations( + bytes32 requestCID1, + bytes32 responseCID1, + bytes32 subgraphDeploymentId1, + bytes32 requestCID2, + bytes32 responseCID2, + bytes32 subgraphDeploymentId2 + ); + + /** + * @notice Thrown when attempting to get the subgraph service before it is set + */ + error DisputeManagerSubgraphServiceNotSet(); + + /** + * @notice Initialize this contract. + * @param owner The owner of the contract + * @param arbitrator Arbitrator role + * @param disputePeriod Dispute period in seconds + * @param disputeDeposit Deposit required to create a Dispute + * @param fishermanRewardCut_ Percent of slashed funds for fisherman (ppm) + * @param maxSlashingCut_ Maximum percentage of indexer stake that can be slashed (ppm) + */ + function initialize( + address owner, + address arbitrator, + uint64 disputePeriod, + uint256 disputeDeposit, + uint32 fishermanRewardCut_, + uint32 maxSlashingCut_ + ) external; + + /** + * @notice Set the dispute period. + * @dev Update the dispute period to `_disputePeriod` in seconds + * @param disputePeriod Dispute period in seconds + */ + function setDisputePeriod(uint64 disputePeriod) external; + + /** + * @notice Set the arbitrator address. + * @dev Update the arbitrator to `_arbitrator` + * @param arbitrator The address of the arbitration contract or party + */ + function setArbitrator(address arbitrator) external; + + /** + * @notice Set the dispute deposit required to create a dispute. + * @dev Update the dispute deposit to `_disputeDeposit` Graph Tokens + * @param disputeDeposit The dispute deposit in Graph Tokens + */ + function setDisputeDeposit(uint256 disputeDeposit) external; + + /** + * @notice Set the percent reward that the fisherman gets when slashing occurs. + * @dev Update the reward percentage to `_percentage` + * @param fishermanRewardCut_ Reward as a percentage of indexer stake + */ + function setFishermanRewardCut(uint32 fishermanRewardCut_) external; + + /** + * @notice Set the maximum percentage that can be used for slashing indexers. + * @param maxSlashingCut_ Max percentage slashing for disputes + */ + function setMaxSlashingCut(uint32 maxSlashingCut_) external; + + /** + * @notice Set the subgraph service address. + * @dev Update the subgraph service to `_subgraphService` + * @param subgraphService The address of the subgraph service contract + */ + function setSubgraphService(address subgraphService) external; + + // -- Dispute -- + + /** + * @notice Create a query dispute for the arbitrator to resolve. + * This function is called by a fisherman and it will pull `disputeDeposit` GRT tokens. + * + * * Requirements: + * - fisherman must have previously approved this contract to pull `disputeDeposit` amount + * of tokens from their balance. + * + * @param attestationData Attestation bytes submitted by the fisherman + * @return The dispute id + */ + function createQueryDispute(bytes calldata attestationData) external returns (bytes32); + + /** + * @notice Create query disputes for two conflicting attestations. + * A conflicting attestation is a proof presented by two different indexers + * where for the same request on a subgraph the response is different. + * Two linked disputes will be created and if the arbitrator resolve one, the other + * one will be automatically resolved. Note that: + * - it's not possible to reject a conflicting query dispute as by definition at least one + * of the attestations is incorrect. + * - if both attestations are proven to be incorrect, the arbitrator can slash the indexer twice. + * Requirements: + * - fisherman must have previously approved this contract to pull `disputeDeposit` amount + * of tokens from their balance. + * @param attestationData1 First attestation data submitted + * @param attestationData2 Second attestation data submitted + * @return The first dispute id + * @return The second dispute id + */ + function createQueryDisputeConflict( + bytes calldata attestationData1, + bytes calldata attestationData2 + ) external returns (bytes32, bytes32); + + /** + * @notice Create an indexing dispute for the arbitrator to resolve. + * The disputes are created in reference to an allocationId and specifically + * a POI for that allocation. + * This function is called by a fisherman and it will pull `disputeDeposit` GRT tokens. + * + * Requirements: + * - fisherman must have previously approved this contract to pull `disputeDeposit` amount + * of tokens from their balance. + * + * @param allocationId The allocation to dispute + * @param poi The Proof of Indexing (POI) being disputed + * @return The dispute id + */ + function createIndexingDispute(address allocationId, bytes32 poi) external returns (bytes32); + + /** + * @notice Creates and auto-accepts a legacy dispute. + * This disputes can be created to settle outstanding slashing amounts with an indexer that has been + * "legacy slashed" during or shortly after the transition period. See {HorizonStakingExtension.legacySlash} + * for more details. + * + * Note that this type of dispute: + * - can only be created by the arbitrator + * - does not require a bond + * - is automatically accepted when created + * + * Additionally, note that this type of disputes allow the arbitrator to directly set the slash and rewards + * amounts, bypassing the usual mechanisms that impose restrictions on those. This is done to give arbitrators + * maximum flexibility to ensure outstanding slashing amounts are settled fairly. This function needs to be removed + * after the transition period. + * + * Requirements: + * - Indexer must have been legacy slashed during or shortly after the transition period + * - Indexer must have provisioned funds to the Subgraph Service + * + * @param allocationId The allocation to dispute + * @param fisherman The fisherman address to be credited with the rewards + * @param tokensSlash The amount of tokens to slash + * @param tokensRewards The amount of tokens to reward the fisherman + * @return The dispute id + */ + function createAndAcceptLegacyDispute( + address allocationId, + address fisherman, + uint256 tokensSlash, + uint256 tokensRewards + ) external returns (bytes32); + + // -- Arbitrator -- + + /** + * @notice The arbitrator accepts a dispute as being valid. + * This function will revert if the indexer is not slashable, whether because it does not have + * any stake available or the slashing percentage is configured to be zero. In those cases + * a dispute must be resolved using drawDispute or rejectDispute. + * This function will also revert if the dispute is in conflict, to accept a conflicting dispute + * use acceptDisputeConflict. + * @dev Accept a dispute with Id `disputeId` + * @param disputeId Id of the dispute to be accepted + * @param tokensSlash Amount of tokens to slash from the indexer + */ + function acceptDispute(bytes32 disputeId, uint256 tokensSlash) external; + + /** + * @notice The arbitrator accepts a conflicting dispute as being valid. + * This function will revert if the indexer is not slashable, whether because it does not have + * any stake available or the slashing percentage is configured to be zero. In those cases + * a dispute must be resolved using drawDispute. + * @param disputeId Id of the dispute to be accepted + * @param tokensSlash Amount of tokens to slash from the indexer for the first dispute + * @param acceptDisputeInConflict Accept the conflicting dispute. Otherwise it will be drawn automatically + * @param tokensSlashRelated Amount of tokens to slash from the indexer for the related dispute in case + * acceptDisputeInConflict is true, otherwise it will be ignored + */ + function acceptDisputeConflict( + bytes32 disputeId, + uint256 tokensSlash, + bool acceptDisputeInConflict, + uint256 tokensSlashRelated + ) external; + + /** + * @notice The arbitrator rejects a dispute as being invalid. + * Note that conflicting query disputes cannot be rejected. + * @dev Reject a dispute with Id `disputeId` + * @param disputeId Id of the dispute to be rejected + */ + function rejectDispute(bytes32 disputeId) external; + + /** + * @notice The arbitrator draws dispute. + * Note that drawing a conflicting query dispute should not be possible however it is allowed + * to give arbitrators greater flexibility when resolving disputes. + * @dev Ignore a dispute with Id `disputeId` + * @param disputeId Id of the dispute to be disregarded + */ + function drawDispute(bytes32 disputeId) external; + + /** + * @notice Once the dispute period ends, if the dispute status remains Pending, + * the fisherman can cancel the dispute and get back their initial deposit. + * Note that cancelling a conflicting query dispute will also cancel the related dispute. + * @dev Cancel a dispute with Id `disputeId` + * @param disputeId Id of the dispute to be cancelled + */ + function cancelDispute(bytes32 disputeId) external; + + // -- Getters -- + + /** + * @notice Get the fisherman reward cut. + * @return Fisherman reward cut in percentage (ppm) + */ + function getFishermanRewardCut() external view returns (uint32); + + /** + * @notice Get the dispute period. + * @return Dispute period in seconds + */ + function getDisputePeriod() external view returns (uint64); + + /** + * @notice Return whether a dispute exists or not. + * @dev Return if dispute with Id `disputeId` exists + * @param disputeId True if dispute already exists + * @return True if dispute already exists + */ + function isDisputeCreated(bytes32 disputeId) external view returns (bool); + + /** + * @notice Get the message hash that a indexer used to sign the receipt. + * Encodes a receipt using a domain separator, as described on + * https://github.com/ethereum/EIPs/blob/master/EIPS/eip-712.md#specification. + * @dev Return the message hash used to sign the receipt + * @param receipt Receipt returned by indexer and submitted by fisherman + * @return Message hash used to sign the receipt + */ + function encodeReceipt(Attestation.Receipt memory receipt) external view returns (bytes32); + + /** + * @notice Returns the indexer that signed an attestation. + * @param attestation Attestation + * @return indexer address + */ + function getAttestationIndexer(Attestation.State memory attestation) external view returns (address); + + /** + * @notice Get the stake snapshot for an indexer. + * @param indexer The indexer address + * @return The stake snapshot + */ + function getStakeSnapshot(address indexer) external view returns (uint256); + + /** + * @notice Checks if two attestations are conflicting + * @param attestation1 The first attestation + * @param attestation2 The second attestation + * @return Whether the attestations are conflicting + */ + function areConflictingAttestations( + Attestation.State memory attestation1, + Attestation.State memory attestation2 + ) external pure returns (bool); +} diff --git a/packages/subgraph-service/contracts/interfaces/ISubgraphService.sol b/packages/subgraph-service/contracts/interfaces/ISubgraphService.sol new file mode 100644 index 000000000..5c35296f2 --- /dev/null +++ b/packages/subgraph-service/contracts/interfaces/ISubgraphService.sol @@ -0,0 +1,308 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +pragma solidity 0.8.27; + +import { IDataServiceFees } from "@graphprotocol/horizon/contracts/data-service/interfaces/IDataServiceFees.sol"; +import { IGraphPayments } from "@graphprotocol/horizon/contracts/interfaces/IGraphPayments.sol"; + +import { Allocation } from "../libraries/Allocation.sol"; +import { LegacyAllocation } from "../libraries/LegacyAllocation.sol"; + +/** + * @title Interface for the {SubgraphService} contract + * @dev This interface extends {IDataServiceFees} and {IDataService}. + * @notice The Subgraph Service is a data service built on top of Graph Horizon that supports the use case of + * subgraph indexing and querying. The {SubgraphService} contract implements the flows described in the Data + * Service framework to allow indexers to register as subgraph service providers, create allocations to signal + * their commitment to index a subgraph, and collect fees for indexing and querying services. + * @custom:security-contact Please email security+contracts@thegraph.com if you find any + * bugs. We may have an active bug bounty program. + */ +interface ISubgraphService is IDataServiceFees { + /** + * @notice Indexer details + * @param registeredAt The timestamp when the indexer registered + * @param url The URL where the indexer can be reached at for queries + * @param geoHash The indexer's geo location, expressed as a geo hash + */ + struct Indexer { + uint256 registeredAt; + string url; + string geoHash; + } + + /** + * @notice Emitted when a subgraph service collects query fees from Graph Payments + * @param serviceProvider The address of the service provider + * @param payer The address paying for the query fees + * @param allocationId The id of the allocation + * @param subgraphDeploymentId The id of the subgraph deployment + * @param tokensCollected The amount of tokens collected + * @param tokensCurators The amount of tokens curators receive + */ + event QueryFeesCollected( + address indexed serviceProvider, + address indexed payer, + address indexed allocationId, + bytes32 subgraphDeploymentId, + uint256 tokensCollected, + uint256 tokensCurators + ); + + /** + * @notice Emitted when an indexer sets a new payments destination + * @param indexer The address of the indexer + * @param paymentsDestination The address where payments should be sent + */ + event PaymentsDestinationSet(address indexed indexer, address indexed paymentsDestination); + + /** + * @notice Emitted when the stake to fees ratio is set. + * @param ratio The stake to fees ratio + */ + event StakeToFeesRatioSet(uint256 ratio); + + /** + * @notice Emitted when curator cuts are set + * @param curationCut The curation cut + */ + event CurationCutSet(uint256 curationCut); + + /** + * @notice Thrown when trying to set a curation cut that is not a valid PPM value + * @param curationCut The curation cut value + */ + error SubgraphServiceInvalidCurationCut(uint256 curationCut); + + /** + * @notice Thrown when an indexer tries to register with an empty URL + */ + error SubgraphServiceEmptyUrl(); + + /** + * @notice Thrown when an indexer tries to register with an empty geohash + */ + error SubgraphServiceEmptyGeohash(); + + /** + * @notice Thrown when an indexer tries to register but they are already registered + */ + error SubgraphServiceIndexerAlreadyRegistered(); + + /** + * @notice Thrown when an indexer tries to perform an operation but they are not registered + * @param indexer The address of the indexer that is not registered + */ + error SubgraphServiceIndexerNotRegistered(address indexer); + + /** + * @notice Thrown when an indexer tries to collect fees for an unsupported payment type + * @param paymentType The payment type that is not supported + */ + error SubgraphServiceInvalidPaymentType(IGraphPayments.PaymentTypes paymentType); + + /** + * @notice Thrown when the contract GRT balance is inconsistent after collecting from Graph Payments + * @param balanceBefore The contract GRT balance before the collection + * @param balanceAfter The contract GRT balance after the collection + */ + error SubgraphServiceInconsistentCollection(uint256 balanceBefore, uint256 balanceAfter); + + /** + * @notice @notice Thrown when the service provider in the RAV does not match the expected indexer. + * @param providedIndexer The address of the provided indexer. + * @param expectedIndexer The address of the expected indexer. + */ + error SubgraphServiceIndexerMismatch(address providedIndexer, address expectedIndexer); + + /** + * @notice Thrown when the indexer in the allocation state does not match the expected indexer. + * @param indexer The address of the expected indexer. + * @param allocationId The id of the allocation. + */ + error SubgraphServiceAllocationNotAuthorized(address indexer, address allocationId); + + /** + * @notice Thrown when collecting a RAV where the RAV indexer is not the same as the allocation indexer + * @param ravIndexer The address of the RAV indexer + * @param allocationIndexer The address of the allocation indexer + */ + error SubgraphServiceInvalidRAV(address ravIndexer, address allocationIndexer); + + /** + * @notice Thrown when trying to force close an allocation that is not stale and the indexer is not over-allocated + * @param allocationId The id of the allocation + */ + error SubgraphServiceCannotForceCloseAllocation(address allocationId); + + /** + * @notice Thrown when trying to force close an altruistic allocation + * @param allocationId The id of the allocation + */ + error SubgraphServiceAllocationIsAltruistic(address allocationId); + + /** + * @notice Thrown when trying to set stake to fees ratio to zero + */ + error SubgraphServiceInvalidZeroStakeToFeesRatio(); + + /** + * @notice Thrown when collectionId is not a valid address + * @param collectionId The collectionId + */ + error SubgraphServiceInvalidCollectionId(bytes32 collectionId); + + /** + * @notice Initialize the contract + * @dev The thawingPeriod and verifierCut ranges are not set here because they are variables + * on the DisputeManager. We use the {ProvisionManager} overrideable getters to get the ranges. + * @param owner The owner of the contract + * @param minimumProvisionTokens The minimum amount of provisioned tokens required to create an allocation + * @param maximumDelegationRatio The maximum delegation ratio allowed for an allocation + * @param stakeToFeesRatio The ratio of stake to fees to lock when collecting query fees + */ + function initialize( + address owner, + uint256 minimumProvisionTokens, + uint32 maximumDelegationRatio, + uint256 stakeToFeesRatio + ) external; + + /** + * @notice Force close a stale allocation + * @dev This function can be permissionlessly called when the allocation is stale. This + * ensures that rewards for other allocations are not diluted by an inactive allocation. + * + * Requirements: + * - Allocation must exist and be open + * - Allocation must be stale + * - Allocation cannot be altruistic + * + * Emits a {AllocationClosed} event. + * + * @param allocationId The id of the allocation + */ + function closeStaleAllocation(address allocationId) external; + + /** + * @notice Change the amount of tokens in an allocation + * @dev Requirements: + * - The indexer must be registered + * - The provision must be valid according to the subgraph service rules + * - `tokens` must be different from the current allocation size + * - The indexer must have enough available tokens to allocate if they are upsizing the allocation + * + * Emits a {AllocationResized} event. + * + * See {AllocationManager-_resizeAllocation} for more details. + * + * @param indexer The address of the indexer + * @param allocationId The id of the allocation + * @param tokens The new amount of tokens in the allocation + */ + function resizeAllocation(address indexer, address allocationId, uint256 tokens) external; + + /** + * @notice Imports a legacy allocation id into the subgraph service + * This is a governor only action that is required to prevent indexers from re-using allocation ids from the + * legacy staking contract. + * @param indexer The address of the indexer + * @param allocationId The id of the allocation + * @param subgraphDeploymentId The id of the subgraph deployment + */ + function migrateLegacyAllocation(address indexer, address allocationId, bytes32 subgraphDeploymentId) external; + + /** + * @notice Sets a pause guardian + * @param pauseGuardian The address of the pause guardian + * @param allowed True if the pause guardian is allowed to pause the contract, false otherwise + */ + function setPauseGuardian(address pauseGuardian, bool allowed) external; + + /** + * @notice Sets the minimum amount of provisioned tokens required to create an allocation + * @param minimumProvisionTokens The minimum amount of provisioned tokens required to create an allocation + */ + function setMinimumProvisionTokens(uint256 minimumProvisionTokens) external; + + /** + * @notice Sets the delegation ratio + * @param delegationRatio The delegation ratio + */ + function setDelegationRatio(uint32 delegationRatio) external; + + /** + * @notice Sets the stake to fees ratio + * @param stakeToFeesRatio The stake to fees ratio + */ + function setStakeToFeesRatio(uint256 stakeToFeesRatio) external; + + /** + * @notice Sets the max POI staleness + * See {AllocationManagerV1Storage-maxPOIStaleness} for more details. + * @param maxPOIStaleness The max POI staleness in seconds + */ + function setMaxPOIStaleness(uint256 maxPOIStaleness) external; + + /** + * @notice Sets the curators payment cut for query fees + * @dev Emits a {CuratorCutSet} event + * @param curationCut The curation cut for the payment type + */ + function setCurationCut(uint256 curationCut) external; + + /** + * @notice Sets the payments destination for an indexer to receive payments + * @dev Emits a {PaymentsDestinationSet} event + * @param paymentsDestination The address where payments should be sent + */ + function setPaymentsDestination(address paymentsDestination) external; + + /** + * @notice Gets the details of an allocation + * For legacy allocations use {getLegacyAllocation} + * @param allocationId The id of the allocation + * @return The allocation details + */ + function getAllocation(address allocationId) external view returns (Allocation.State memory); + + /** + * @notice Gets the details of a legacy allocation + * For non-legacy allocations use {getAllocation} + * @param allocationId The id of the allocation + * @return The legacy allocation details + */ + function getLegacyAllocation(address allocationId) external view returns (LegacyAllocation.State memory); + + /** + * @notice Encodes the allocation proof for EIP712 signing + * @param indexer The address of the indexer + * @param allocationId The id of the allocation + * @return The encoded allocation proof + */ + function encodeAllocationProof(address indexer, address allocationId) external view returns (bytes32); + + /** + * @notice Checks if an indexer is over-allocated + * @param allocationId The id of the allocation + * @return True if the indexer is over-allocated, false otherwise + */ + function isOverAllocated(address allocationId) external view returns (bool); + + /** + * @notice Gets the address of the dispute manager + * @return The address of the dispute manager + */ + function getDisputeManager() external view returns (address); + + /** + * @notice Gets the address of the graph tally collector + * @return The address of the graph tally collector + */ + function getGraphTallyCollector() external view returns (address); + + /** + * @notice Gets the address of the curation contract + * @return The address of the curation contract + */ + function getCuration() external view returns (address); +} diff --git a/packages/subgraph-service/contracts/libraries/Allocation.sol b/packages/subgraph-service/contracts/libraries/Allocation.sol new file mode 100644 index 000000000..6f6563068 --- /dev/null +++ b/packages/subgraph-service/contracts/libraries/Allocation.sol @@ -0,0 +1,217 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +pragma solidity 0.8.27; + +import { Math } from "@openzeppelin/contracts/utils/math/Math.sol"; + +/** + * @title Allocation library + * @notice A library to handle Allocations. + * @custom:security-contact Please email security+contracts@thegraph.com if you find any + * bugs. We may have an active bug bounty program. + */ +library Allocation { + using Allocation for State; + + /** + * @notice Allocation details + * @param indexer The indexer that owns the allocation + * @param subgraphDeploymentId The subgraph deployment id the allocation is for + * @param tokens The number of tokens allocated + * @param createdAt The timestamp when the allocation was created + * @param closedAt The timestamp when the allocation was closed + * @param lastPOIPresentedAt The timestamp when the last POI was presented + * @param accRewardsPerAllocatedToken The accumulated rewards per allocated token + * @param accRewardsPending The accumulated rewards that are pending to be claimed due allocation resize + * @param createdAtEpoch The epoch when the allocation was created + */ + struct State { + address indexer; + bytes32 subgraphDeploymentId; + uint256 tokens; + uint256 createdAt; + uint256 closedAt; + uint256 lastPOIPresentedAt; + uint256 accRewardsPerAllocatedToken; + uint256 accRewardsPending; + uint256 createdAtEpoch; + } + + /** + * @notice Thrown when attempting to create an allocation with an existing id + * @param allocationId The allocation id + */ + error AllocationAlreadyExists(address allocationId); + + /** + * @notice Thrown when trying to perform an operation on a non-existent allocation + * @param allocationId The allocation id + */ + error AllocationDoesNotExist(address allocationId); + + /** + * @notice Thrown when trying to perform an operation on a closed allocation + * @param allocationId The allocation id + * @param closedAt The timestamp when the allocation was closed + */ + error AllocationClosed(address allocationId, uint256 closedAt); + + /** + * @notice Create a new allocation + * @dev Requirements: + * - The allocation must not exist + * @param self The allocation list mapping + * @param indexer The indexer that owns the allocation + * @param allocationId The allocation id + * @param subgraphDeploymentId The subgraph deployment id the allocation is for + * @param tokens The number of tokens allocated + * @param accRewardsPerAllocatedToken The initial accumulated rewards per allocated token + * @param createdAtEpoch The epoch when the allocation was created + * @return The allocation + */ + function create( + mapping(address => State) storage self, + address indexer, + address allocationId, + bytes32 subgraphDeploymentId, + uint256 tokens, + uint256 accRewardsPerAllocatedToken, + uint256 createdAtEpoch + ) internal returns (State memory) { + require(!self[allocationId].exists(), AllocationAlreadyExists(allocationId)); + + State memory allocation = State({ + indexer: indexer, + subgraphDeploymentId: subgraphDeploymentId, + tokens: tokens, + createdAt: block.timestamp, + closedAt: 0, + lastPOIPresentedAt: 0, + accRewardsPerAllocatedToken: accRewardsPerAllocatedToken, + accRewardsPending: 0, + createdAtEpoch: createdAtEpoch + }); + + self[allocationId] = allocation; + + return allocation; + } + + /** + * @notice Present a POI for an allocation + * @dev It only updates the last POI presented timestamp. + * Requirements: + * - The allocation must be open + * @param self The allocation list mapping + * @param allocationId The allocation id + */ + function presentPOI(mapping(address => State) storage self, address allocationId) internal { + State storage allocation = _get(self, allocationId); + require(allocation.isOpen(), AllocationClosed(allocationId, allocation.closedAt)); + allocation.lastPOIPresentedAt = block.timestamp; + } + + /** + * @notice Update the accumulated rewards per allocated token for an allocation + * @dev Requirements: + * - The allocation must be open + * @param self The allocation list mapping + * @param allocationId The allocation id + * @param accRewardsPerAllocatedToken The new accumulated rewards per allocated token + */ + function snapshotRewards( + mapping(address => State) storage self, + address allocationId, + uint256 accRewardsPerAllocatedToken + ) internal { + State storage allocation = _get(self, allocationId); + require(allocation.isOpen(), AllocationClosed(allocationId, allocation.closedAt)); + allocation.accRewardsPerAllocatedToken = accRewardsPerAllocatedToken; + } + + /** + * @notice Update the accumulated rewards pending to be claimed for an allocation + * @dev Requirements: + * - The allocation must be open + * @param self The allocation list mapping + * @param allocationId The allocation id + */ + function clearPendingRewards(mapping(address => State) storage self, address allocationId) internal { + State storage allocation = _get(self, allocationId); + require(allocation.isOpen(), AllocationClosed(allocationId, allocation.closedAt)); + allocation.accRewardsPending = 0; + } + + /** + * @notice Close an allocation + * @dev Requirements: + * - The allocation must be open + * @param self The allocation list mapping + * @param allocationId The allocation id + */ + function close(mapping(address => State) storage self, address allocationId) internal { + State storage allocation = _get(self, allocationId); + require(allocation.isOpen(), AllocationClosed(allocationId, allocation.closedAt)); + allocation.closedAt = block.timestamp; + } + + /** + * @notice Get an allocation + * @param self The allocation list mapping + * @param allocationId The allocation id + * @return The allocation + */ + function get(mapping(address => State) storage self, address allocationId) internal view returns (State memory) { + return _get(self, allocationId); + } + + /** + * @notice Checks if an allocation is stale + * @param self The allocation + * @param staleThreshold The time in blocks to consider an allocation stale + * @return True if the allocation is stale + */ + function isStale(State memory self, uint256 staleThreshold) internal view returns (bool) { + uint256 timeSinceLastPOI = block.timestamp - Math.max(self.createdAt, self.lastPOIPresentedAt); + return self.isOpen() && timeSinceLastPOI > staleThreshold; + } + + /** + * @notice Checks if an allocation exists + * @param self The allocation + * @return True if the allocation exists + */ + function exists(State memory self) internal pure returns (bool) { + return self.createdAt != 0; + } + + /** + * @notice Checks if an allocation is open + * @param self The allocation + * @return True if the allocation is open + */ + function isOpen(State memory self) internal pure returns (bool) { + return self.exists() && self.closedAt == 0; + } + + /** + * @notice Checks if an allocation is alturistic + * @param self The allocation + * @return True if the allocation is alturistic + */ + function isAltruistic(State memory self) internal pure returns (bool) { + return self.exists() && self.tokens == 0; + } + + /** + * @notice Get the allocation for an allocation id + * @dev Reverts if the allocation does not exist + * @param self The allocation list mapping + * @param allocationId The allocation id + * @return The allocation + */ + function _get(mapping(address => State) storage self, address allocationId) private view returns (State storage) { + State storage allocation = self[allocationId]; + require(allocation.exists(), AllocationDoesNotExist(allocationId)); + return allocation; + } +} diff --git a/packages/subgraph-service/contracts/libraries/Attestation.sol b/packages/subgraph-service/contracts/libraries/Attestation.sol new file mode 100644 index 000000000..b7acd0a10 --- /dev/null +++ b/packages/subgraph-service/contracts/libraries/Attestation.sol @@ -0,0 +1,168 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +pragma solidity 0.8.27; + +/** + * @title Attestation library + * @notice A library to handle Attestation. + * @custom:security-contact Please email security+contracts@thegraph.com if you find any + * bugs. We may have an active bug bounty program. + */ +library Attestation { + /** + * @notice Receipt content sent from the service provider in response to request + * @param requestCID The request CID + * @param responseCID The response CID + * @param subgraphDeploymentId The subgraph deployment id + */ + struct Receipt { + bytes32 requestCID; + bytes32 responseCID; + bytes32 subgraphDeploymentId; + } + + /** + * @notice Attestation sent from the service provider in response to a request + * @param requestCID The request CID + * @param responseCID The response CID + * @param subgraphDeploymentId The subgraph deployment id + * @param r The r value of the signature + * @param s The s value of the signature + * @param v The v value of the signature + */ + struct State { + bytes32 requestCID; + bytes32 responseCID; + bytes32 subgraphDeploymentId; + bytes32 r; + bytes32 s; + uint8 v; + } + + /// @notice Attestation size is the sum of the receipt (96) + signature (65) + uint256 private constant RECEIPT_SIZE_BYTES = 96; + + /// @notice The length of the r value of the signature + uint256 private constant SIG_R_LENGTH = 32; + + /// @notice The length of the s value of the signature + uint256 private constant SIG_S_LENGTH = 32; + + /// @notice The length of the v value of the signature + uint256 private constant SIG_V_LENGTH = 1; + + /// @notice The offset of the r value of the signature + uint256 private constant SIG_R_OFFSET = RECEIPT_SIZE_BYTES; + + /// @notice The offset of the s value of the signature + uint256 private constant SIG_S_OFFSET = RECEIPT_SIZE_BYTES + SIG_R_LENGTH; + + /// @notice The offset of the v value of the signature + uint256 private constant SIG_V_OFFSET = RECEIPT_SIZE_BYTES + SIG_R_LENGTH + SIG_S_LENGTH; + + /// @notice The size of the signature + uint256 private constant SIG_SIZE_BYTES = SIG_R_LENGTH + SIG_S_LENGTH + SIG_V_LENGTH; + + /// @notice The size of the attestation + uint256 private constant ATTESTATION_SIZE_BYTES = RECEIPT_SIZE_BYTES + SIG_SIZE_BYTES; + + /// @notice The length of the uint8 value + uint256 private constant UINT8_BYTE_LENGTH = 1; + + /// @notice The length of the bytes32 value + uint256 private constant BYTES32_BYTE_LENGTH = 32; + + /** + * @notice The error thrown when the attestation data length is invalid + * @param length The length of the attestation data + * @param expectedLength The expected length of the attestation data + */ + error AttestationInvalidBytesLength(uint256 length, uint256 expectedLength); + + /** + * @dev Returns if two attestations are conflicting. + * Everything must match except for the responseId. + * @param _attestation1 Attestation + * @param _attestation2 Attestation + * @return True if the two attestations are conflicting + */ + function areConflicting( + Attestation.State memory _attestation1, + Attestation.State memory _attestation2 + ) internal pure returns (bool) { + return (_attestation1.requestCID == _attestation2.requestCID && + _attestation1.subgraphDeploymentId == _attestation2.subgraphDeploymentId && + _attestation1.responseCID != _attestation2.responseCID); + } + + /** + * @dev Parse the bytes attestation into a struct from `_data`. + * @param _data The bytes to parse + * @return Attestation struct + */ + function parse(bytes memory _data) internal pure returns (State memory) { + // Check attestation data length + require( + _data.length == ATTESTATION_SIZE_BYTES, + AttestationInvalidBytesLength(_data.length, ATTESTATION_SIZE_BYTES) + ); + + // Decode receipt + (bytes32 requestCID, bytes32 responseCID, bytes32 subgraphDeploymentId) = abi.decode( + _data, + (bytes32, bytes32, bytes32) + ); + + // Decode signature + // Signature is expected to be in the order defined in the Attestation struct + bytes32 r = _toBytes32(_data, SIG_R_OFFSET); + bytes32 s = _toBytes32(_data, SIG_S_OFFSET); + uint8 v = _toUint8(_data, SIG_V_OFFSET); + + return State(requestCID, responseCID, subgraphDeploymentId, r, s, v); + } + + /** + * @dev Parse a uint8 from `_bytes` starting at offset `_start`. + * @param _bytes The bytes to parse + * @param _start The start offset + * @return uint8 value + */ + function _toUint8(bytes memory _bytes, uint256 _start) private pure returns (uint8) { + require( + _bytes.length >= _start + UINT8_BYTE_LENGTH, + AttestationInvalidBytesLength(_bytes.length, _start + UINT8_BYTE_LENGTH) + ); + uint8 tempUint; + + // solhint-disable-next-line no-inline-assembly + assembly { + // Load the 32-byte word from memory starting at `_bytes + _start + 1` + // The `0x1` accounts for the fact that we want only the first byte (uint8) + // of the loaded 32 bytes. + tempUint := mload(add(add(_bytes, 0x1), _start)) + } + + return tempUint; + } + + /** + * @dev Parse a bytes32 from `_bytes` starting at offset `_start`. + * @param _bytes The bytes to parse + * @param _start The start offset + * @return bytes32 value + */ + function _toBytes32(bytes memory _bytes, uint256 _start) private pure returns (bytes32) { + require( + _bytes.length >= _start + BYTES32_BYTE_LENGTH, + AttestationInvalidBytesLength(_bytes.length, _start + BYTES32_BYTE_LENGTH) + ); + bytes32 tempBytes32; + + // solhint-disable-next-line no-inline-assembly + assembly { + tempBytes32 := mload(add(add(_bytes, 0x20), _start)) + } + + return tempBytes32; + } +} diff --git a/packages/subgraph-service/contracts/libraries/LegacyAllocation.sol b/packages/subgraph-service/contracts/libraries/LegacyAllocation.sol new file mode 100644 index 000000000..3d7f96213 --- /dev/null +++ b/packages/subgraph-service/contracts/libraries/LegacyAllocation.sol @@ -0,0 +1,108 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +pragma solidity 0.8.27; + +import { IHorizonStaking } from "@graphprotocol/horizon/contracts/interfaces/IHorizonStaking.sol"; + +/** + * @title LegacyAllocation library + * @notice A library to handle legacy Allocations. + * @custom:security-contact Please email security+contracts@thegraph.com if you find any + * bugs. We may have an active bug bounty program. + */ +library LegacyAllocation { + using LegacyAllocation for State; + + /** + * @notice Legacy allocation details + * @dev Note that we are only storing the indexer and subgraphDeploymentId. The main point of tracking legacy allocations + * is to prevent them from being re used on the Subgraph Service. We don't need to store the rest of the allocation details. + * @param indexer The indexer that owns the allocation + * @param subgraphDeploymentId The subgraph deployment id the allocation is for + */ + struct State { + address indexer; + bytes32 subgraphDeploymentId; + } + + /** + * @notice Thrown when attempting to migrate an allocation with an existing id + * @param allocationId The allocation id + */ + error LegacyAllocationAlreadyExists(address allocationId); + + /** + * @notice Thrown when trying to get a non-existent allocation + * @param allocationId The allocation id + */ + error LegacyAllocationDoesNotExist(address allocationId); + + /** + * @notice Migrate a legacy allocation + * @dev Requirements: + * - The allocation must not have been previously migrated + * @param self The legacy allocation list mapping + * @param indexer The indexer that owns the allocation + * @param allocationId The allocation id + * @param subgraphDeploymentId The subgraph deployment id the allocation is for + * @custom:error LegacyAllocationAlreadyMigrated if the allocation has already been migrated + */ + function migrate( + mapping(address => State) storage self, + address indexer, + address allocationId, + bytes32 subgraphDeploymentId + ) internal { + require(!self[allocationId].exists(), LegacyAllocationAlreadyExists(allocationId)); + + self[allocationId] = State({ indexer: indexer, subgraphDeploymentId: subgraphDeploymentId }); + } + + /** + * @notice Get a legacy allocation + * @param self The legacy allocation list mapping + * @param allocationId The allocation id + * @return The legacy allocation details + */ + function get(mapping(address => State) storage self, address allocationId) internal view returns (State memory) { + return _get(self, allocationId); + } + + /** + * @notice Revert if a legacy allocation exists + * @dev We first check the migrated mapping then the old staking contract. + * @dev TRANSITION PERIOD: after the transition period when all the allocations are migrated we can + * remove the call to the staking contract. + * @param self The legacy allocation list mapping + * @param graphStaking The Horizon Staking contract + * @param allocationId The allocation id + */ + function revertIfExists( + mapping(address => State) storage self, + IHorizonStaking graphStaking, + address allocationId + ) internal view { + require(!self[allocationId].exists(), LegacyAllocationAlreadyExists(allocationId)); + require(!graphStaking.isAllocation(allocationId), LegacyAllocationAlreadyExists(allocationId)); + } + + /** + * @notice Check if a legacy allocation exists + * @param self The legacy allocation + * @return True if the allocation exists + */ + function exists(State memory self) internal pure returns (bool) { + return self.indexer != address(0); + } + + /** + * @notice Get a legacy allocation + * @param self The legacy allocation list mapping + * @param allocationId The allocation id + * @return The legacy allocation details + */ + function _get(mapping(address => State) storage self, address allocationId) private view returns (State storage) { + State storage allocation = self[allocationId]; + require(allocation.exists(), LegacyAllocationDoesNotExist(allocationId)); + return allocation; + } +} diff --git a/packages/subgraph-service/contracts/mocks/imports.sol b/packages/subgraph-service/contracts/mocks/imports.sol new file mode 100644 index 000000000..5ce86bc61 --- /dev/null +++ b/packages/subgraph-service/contracts/mocks/imports.sol @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity ^0.7.6 || 0.8.27; + +// These are needed to get artifacts for toolshed +import "@graphprotocol/contracts/contracts/l2/discovery/IL2GNS.sol"; +import "@graphprotocol/contracts/contracts/disputes/IDisputeManager.sol"; + +// Also for toolshed, solidity version in @graphprotocol/contracts does not support overriding public getters +// in interface file, so we need to amend them here. +import { IServiceRegistry } from "@graphprotocol/contracts/contracts/discovery/IServiceRegistry.sol"; +import { IL2Curation } from "@graphprotocol/contracts/contracts/l2/curation/IL2Curation.sol"; + +interface IL2CurationToolshed is IL2Curation { + function subgraphService() external view returns (address); +} + +interface IServiceRegistryToolshed is IServiceRegistry { + function services(address indexer) external view returns (IServiceRegistry.IndexerService memory); +} diff --git a/packages/subgraph-service/contracts/utilities/AllocationManager.sol b/packages/subgraph-service/contracts/utilities/AllocationManager.sol new file mode 100644 index 000000000..78e5fa190 --- /dev/null +++ b/packages/subgraph-service/contracts/utilities/AllocationManager.sol @@ -0,0 +1,479 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +pragma solidity 0.8.27; + +import { IGraphPayments } from "@graphprotocol/horizon/contracts/interfaces/IGraphPayments.sol"; +import { IGraphToken } from "@graphprotocol/contracts/contracts/token/IGraphToken.sol"; +import { IHorizonStakingTypes } from "@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingTypes.sol"; + +import { GraphDirectory } from "@graphprotocol/horizon/contracts/utilities/GraphDirectory.sol"; +import { AllocationManagerV1Storage } from "./AllocationManagerStorage.sol"; + +import { TokenUtils } from "@graphprotocol/contracts/contracts/utils/TokenUtils.sol"; +import { ECDSA } from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; +import { EIP712Upgradeable } from "@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol"; +import { Allocation } from "../libraries/Allocation.sol"; +import { LegacyAllocation } from "../libraries/LegacyAllocation.sol"; +import { PPMMath } from "@graphprotocol/horizon/contracts/libraries/PPMMath.sol"; +import { ProvisionTracker } from "@graphprotocol/horizon/contracts/data-service/libraries/ProvisionTracker.sol"; + +/** + * @title AllocationManager contract + * @notice A helper contract implementing allocation lifecycle management. + * Allows opening, resizing, and closing allocations, as well as collecting indexing rewards by presenting a Proof + * of Indexing (POI). + * @custom:security-contact Please email security+contracts@thegraph.com if you find any + * bugs. We may have an active bug bounty program. + */ +abstract contract AllocationManager is EIP712Upgradeable, GraphDirectory, AllocationManagerV1Storage { + using ProvisionTracker for mapping(address => uint256); + using Allocation for mapping(address => Allocation.State); + using Allocation for Allocation.State; + using LegacyAllocation for mapping(address => LegacyAllocation.State); + using PPMMath for uint256; + using TokenUtils for IGraphToken; + + ///@dev EIP712 typehash for allocation id proof + bytes32 private constant EIP712_ALLOCATION_ID_PROOF_TYPEHASH = + keccak256("AllocationIdProof(address indexer,address allocationId)"); + + /** + * @notice Emitted when an indexer creates an allocation + * @param indexer The address of the indexer + * @param allocationId The id of the allocation + * @param subgraphDeploymentId The id of the subgraph deployment + * @param tokens The amount of tokens allocated + * @param currentEpoch The current epoch + */ + event AllocationCreated( + address indexed indexer, + address indexed allocationId, + bytes32 indexed subgraphDeploymentId, + uint256 tokens, + uint256 currentEpoch + ); + + /** + * @notice Emitted when an indexer collects indexing rewards for an allocation + * @param indexer The address of the indexer + * @param allocationId The id of the allocation + * @param subgraphDeploymentId The id of the subgraph deployment + * @param tokensRewards The amount of tokens collected + * @param tokensIndexerRewards The amount of tokens collected for the indexer + * @param tokensDelegationRewards The amount of tokens collected for delegators + * @param poi The POI presented + * @param currentEpoch The current epoch + * @param poiMetadata The metadata associated with the POI + */ + event IndexingRewardsCollected( + address indexed indexer, + address indexed allocationId, + bytes32 indexed subgraphDeploymentId, + uint256 tokensRewards, + uint256 tokensIndexerRewards, + uint256 tokensDelegationRewards, + bytes32 poi, + bytes poiMetadata, + uint256 currentEpoch + ); + + /** + * @notice Emitted when an indexer resizes an allocation + * @param indexer The address of the indexer + * @param allocationId The id of the allocation + * @param subgraphDeploymentId The id of the subgraph deployment + * @param newTokens The new amount of tokens allocated + * @param oldTokens The old amount of tokens allocated + */ + event AllocationResized( + address indexed indexer, + address indexed allocationId, + bytes32 indexed subgraphDeploymentId, + uint256 newTokens, + uint256 oldTokens + ); + + /** + * @dev Emitted when an indexer closes an allocation + * @param indexer The address of the indexer + * @param allocationId The id of the allocation + * @param subgraphDeploymentId The id of the subgraph deployment + * @param tokens The amount of tokens allocated + * @param forceClosed Whether the allocation was force closed + */ + event AllocationClosed( + address indexed indexer, + address indexed allocationId, + bytes32 indexed subgraphDeploymentId, + uint256 tokens, + bool forceClosed + ); + + /** + * @notice Emitted when a legacy allocation is migrated into the subgraph service + * @param indexer The address of the indexer + * @param allocationId The id of the allocation + * @param subgraphDeploymentId The id of the subgraph deployment + */ + event LegacyAllocationMigrated( + address indexed indexer, + address indexed allocationId, + bytes32 indexed subgraphDeploymentId + ); + + /** + * @notice Emitted when the maximum POI staleness is updated + * @param maxPOIStaleness The max POI staleness in seconds + */ + event MaxPOIStalenessSet(uint256 maxPOIStaleness); + + /** + * @notice Thrown when an allocation proof is invalid + * Both `signer` and `allocationId` should match for a valid proof. + * @param signer The address that signed the proof + * @param allocationId The id of the allocation + */ + error AllocationManagerInvalidAllocationProof(address signer, address allocationId); + + /** + * @notice Thrown when attempting to create an allocation with a zero allocation id + */ + error AllocationManagerInvalidZeroAllocationId(); + + /** + * @notice Thrown when attempting to collect indexing rewards on a closed allocationl + * @param allocationId The id of the allocation + */ + error AllocationManagerAllocationClosed(address allocationId); + + /** + * @notice Thrown when attempting to resize an allocation with the same size + * @param allocationId The id of the allocation + * @param tokens The amount of tokens + */ + error AllocationManagerAllocationSameSize(address allocationId, uint256 tokens); + + /** + * @notice Initializes the contract and parent contracts + * @param _name The name to use for EIP712 domain separation + * @param _version The version to use for EIP712 domain separation + */ + function __AllocationManager_init(string memory _name, string memory _version) internal onlyInitializing { + __EIP712_init(_name, _version); + __AllocationManager_init_unchained(); + } + + /** + * @notice Initializes the contract + */ + function __AllocationManager_init_unchained() internal onlyInitializing {} + + /** + * @notice Imports a legacy allocation id into the subgraph service + * This is a governor only action that is required to prevent indexers from re-using allocation ids from the + * legacy staking contract. It will revert with LegacyAllocationAlreadyMigrated if the allocation has already been migrated. + * @param _indexer The address of the indexer + * @param _allocationId The id of the allocation + * @param _subgraphDeploymentId The id of the subgraph deployment + */ + function _migrateLegacyAllocation(address _indexer, address _allocationId, bytes32 _subgraphDeploymentId) internal { + _legacyAllocations.migrate(_indexer, _allocationId, _subgraphDeploymentId); + emit LegacyAllocationMigrated(_indexer, _allocationId, _subgraphDeploymentId); + } + + /** + * @notice Create an allocation + * @dev The `_allocationProof` is a 65-bytes Ethereum signed message of `keccak256(indexerAddress,allocationId)` + * + * Requirements: + * - `_allocationId` must not be the zero address + * + * Emits a {AllocationCreated} event + * + * @param _indexer The address of the indexer + * @param _allocationId The id of the allocation to be created + * @param _subgraphDeploymentId The subgraph deployment Id + * @param _tokens The amount of tokens to allocate + * @param _allocationProof Signed proof of allocation id address ownership + * @param _delegationRatio The delegation ratio to consider when locking tokens + */ + function _allocate( + address _indexer, + address _allocationId, + bytes32 _subgraphDeploymentId, + uint256 _tokens, + bytes memory _allocationProof, + uint32 _delegationRatio + ) internal { + require(_allocationId != address(0), AllocationManagerInvalidZeroAllocationId()); + + _verifyAllocationProof(_indexer, _allocationId, _allocationProof); + + // Ensure allocation id is not reused + // need to check both subgraph service (on allocations.create()) and legacy allocations + _legacyAllocations.revertIfExists(_graphStaking(), _allocationId); + + uint256 currentEpoch = _graphEpochManager().currentEpoch(); + Allocation.State memory allocation = _allocations.create( + _indexer, + _allocationId, + _subgraphDeploymentId, + _tokens, + _graphRewardsManager().onSubgraphAllocationUpdate(_subgraphDeploymentId), + currentEpoch + ); + + // Check that the indexer has enough tokens available + // Note that the delegation ratio ensures overdelegation cannot be used + allocationProvisionTracker.lock(_graphStaking(), _indexer, _tokens, _delegationRatio); + + // Update total allocated tokens for the subgraph deployment + _subgraphAllocatedTokens[allocation.subgraphDeploymentId] = + _subgraphAllocatedTokens[allocation.subgraphDeploymentId] + + allocation.tokens; + + emit AllocationCreated(_indexer, _allocationId, _subgraphDeploymentId, allocation.tokens, currentEpoch); + } + + /** + * @notice Present a POI to collect indexing rewards for an allocation + * This function will mint indexing rewards using the {RewardsManager} and distribute them to the indexer and delegators. + * + * Conditions to qualify for indexing rewards: + * - POI must be non-zero + * - POI must not be stale, i.e: older than `maxPOIStaleness` + * - allocation must not be altruistic (allocated tokens = 0) + * - allocation must be open for at least one epoch + * + * Note that indexers are required to periodically (at most every `maxPOIStaleness`) present POIs to collect rewards. + * Rewards will not be issued to stale POIs, which means that indexers are advised to present a zero POI if they are + * unable to present a valid one to prevent being locked out of future rewards. + * + * Note on allocation duration restriction: this is required to ensure that non protocol chains have a valid block number for + * which to calculate POIs. EBO posts once per epoch typically at each epoch change, so we restrict rewards to allocations + * that have gone through at least one epoch change. + * + * Emits a {IndexingRewardsCollected} event. + * + * @param _allocationId The id of the allocation to collect rewards for + * @param _poi The POI being presented + * @param _poiMetadata The metadata associated with the POI. The data and encoding format is for off-chain components to define, this function will only emit the value in an event as-is. + * @param _delegationRatio The delegation ratio to consider when locking tokens + * @param _paymentsDestination The address where indexing rewards should be sent + * @return The amount of tokens collected + */ + function _presentPOI( + address _allocationId, + bytes32 _poi, + bytes memory _poiMetadata, + uint32 _delegationRatio, + address _paymentsDestination + ) internal returns (uint256) { + Allocation.State memory allocation = _allocations.get(_allocationId); + require(allocation.isOpen(), AllocationManagerAllocationClosed(_allocationId)); + + // Mint indexing rewards if all conditions are met + uint256 tokensRewards = (!allocation.isStale(maxPOIStaleness) && + !allocation.isAltruistic() && + _poi != bytes32(0)) && _graphEpochManager().currentEpoch() > allocation.createdAtEpoch + ? _graphRewardsManager().takeRewards(_allocationId) + : 0; + + // ... but we still take a snapshot to ensure the rewards are not accumulated for the next valid POI + _allocations.snapshotRewards( + _allocationId, + _graphRewardsManager().onSubgraphAllocationUpdate(allocation.subgraphDeploymentId) + ); + _allocations.presentPOI(_allocationId); + + // Any pending rewards should have been collected now + _allocations.clearPendingRewards(_allocationId); + + uint256 tokensIndexerRewards = 0; + uint256 tokensDelegationRewards = 0; + if (tokensRewards != 0) { + // Distribute rewards to delegators + uint256 delegatorCut = _graphStaking().getDelegationFeeCut( + allocation.indexer, + address(this), + IGraphPayments.PaymentTypes.IndexingRewards + ); + IHorizonStakingTypes.DelegationPool memory delegationPool = _graphStaking().getDelegationPool( + allocation.indexer, + address(this) + ); + // If delegation pool has no shares then we don't need to distribute rewards to delegators + tokensDelegationRewards = delegationPool.shares > 0 ? tokensRewards.mulPPM(delegatorCut) : 0; + if (tokensDelegationRewards > 0) { + _graphToken().approve(address(_graphStaking()), tokensDelegationRewards); + _graphStaking().addToDelegationPool(allocation.indexer, address(this), tokensDelegationRewards); + } + + // Distribute rewards to indexer + tokensIndexerRewards = tokensRewards - tokensDelegationRewards; + if (tokensIndexerRewards > 0) { + if (_paymentsDestination == address(0)) { + _graphToken().approve(address(_graphStaking()), tokensIndexerRewards); + _graphStaking().stakeToProvision(allocation.indexer, address(this), tokensIndexerRewards); + } else { + _graphToken().pushTokens(_paymentsDestination, tokensIndexerRewards); + } + } + } + + emit IndexingRewardsCollected( + allocation.indexer, + _allocationId, + allocation.subgraphDeploymentId, + tokensRewards, + tokensIndexerRewards, + tokensDelegationRewards, + _poi, + _poiMetadata, + _graphEpochManager().currentEpoch() + ); + + // Check if the indexer is over-allocated and force close the allocation if necessary + if (_isOverAllocated(allocation.indexer, _delegationRatio)) { + _closeAllocation(_allocationId, true); + } + + return tokensRewards; + } + + /** + * @notice Resize an allocation + * @dev Will lock or release tokens in the provision tracker depending on the new allocation size. + * Rewards accrued but not issued before the resize will be accounted for as pending rewards. + * These will be paid out when the indexer presents a POI. + * + * Requirements: + * - `_indexer` must be the owner of the allocation + * - Allocation must be open + * - `_tokens` must be different from the current allocation size + * + * Emits a {AllocationResized} event. + * + * @param _allocationId The id of the allocation to be resized + * @param _tokens The new amount of tokens to allocate + * @param _delegationRatio The delegation ratio to consider when locking tokens + */ + function _resizeAllocation(address _allocationId, uint256 _tokens, uint32 _delegationRatio) internal { + Allocation.State memory allocation = _allocations.get(_allocationId); + require(allocation.isOpen(), AllocationManagerAllocationClosed(_allocationId)); + require(_tokens != allocation.tokens, AllocationManagerAllocationSameSize(_allocationId, _tokens)); + + // Update provision tracker + uint256 oldTokens = allocation.tokens; + if (_tokens > oldTokens) { + allocationProvisionTracker.lock(_graphStaking(), allocation.indexer, _tokens - oldTokens, _delegationRatio); + } else { + allocationProvisionTracker.release(allocation.indexer, oldTokens - _tokens); + } + + // Calculate rewards that have been accrued since the last snapshot but not yet issued + uint256 accRewardsPerAllocatedToken = _graphRewardsManager().onSubgraphAllocationUpdate( + allocation.subgraphDeploymentId + ); + uint256 accRewardsPerAllocatedTokenPending = !allocation.isAltruistic() + ? accRewardsPerAllocatedToken - allocation.accRewardsPerAllocatedToken + : 0; + + // Update the allocation + _allocations[_allocationId].tokens = _tokens; + _allocations[_allocationId].accRewardsPerAllocatedToken = accRewardsPerAllocatedToken; + _allocations[_allocationId].accRewardsPending += _graphRewardsManager().calcRewards( + oldTokens, + accRewardsPerAllocatedTokenPending + ); + + // Update total allocated tokens for the subgraph deployment + if (_tokens > oldTokens) { + _subgraphAllocatedTokens[allocation.subgraphDeploymentId] += (_tokens - oldTokens); + } else { + _subgraphAllocatedTokens[allocation.subgraphDeploymentId] -= (oldTokens - _tokens); + } + + emit AllocationResized(allocation.indexer, _allocationId, allocation.subgraphDeploymentId, _tokens, oldTokens); + } + + /** + * @notice Close an allocation + * Does not require presenting a POI, use {_collectIndexingRewards} to present a POI and collect rewards + * @dev Note that allocations are nowlong lived. All service payments, including indexing rewards, should be collected periodically + * without the need of closing the allocation. Allocations should only be closed when indexers want to reclaim the allocated + * tokens for other purposes. + * + * Emits a {AllocationClosed} event + * + * @param _allocationId The id of the allocation to be closed + * @param _forceClosed Whether the allocation was force closed + */ + function _closeAllocation(address _allocationId, bool _forceClosed) internal { + Allocation.State memory allocation = _allocations.get(_allocationId); + + // Take rewards snapshot to prevent other allos from counting tokens from this allo + _allocations.snapshotRewards( + _allocationId, + _graphRewardsManager().onSubgraphAllocationUpdate(allocation.subgraphDeploymentId) + ); + + _allocations.close(_allocationId); + allocationProvisionTracker.release(allocation.indexer, allocation.tokens); + + // Update total allocated tokens for the subgraph deployment + _subgraphAllocatedTokens[allocation.subgraphDeploymentId] = + _subgraphAllocatedTokens[allocation.subgraphDeploymentId] - + allocation.tokens; + + emit AllocationClosed( + allocation.indexer, + _allocationId, + allocation.subgraphDeploymentId, + allocation.tokens, + _forceClosed + ); + } + + /** + * @notice Sets the maximum amount of time, in seconds, allowed between presenting POIs to qualify for indexing rewards + * @dev Emits a {MaxPOIStalenessSet} event + * @param _maxPOIStaleness The max POI staleness in seconds + */ + function _setMaxPOIStaleness(uint256 _maxPOIStaleness) internal { + maxPOIStaleness = _maxPOIStaleness; + emit MaxPOIStalenessSet(_maxPOIStaleness); + } + + /** + * @notice Encodes the allocation proof for EIP712 signing + * @param _indexer The address of the indexer + * @param _allocationId The id of the allocation + * @return The encoded allocation proof + */ + function _encodeAllocationProof(address _indexer, address _allocationId) internal view returns (bytes32) { + return _hashTypedDataV4(keccak256(abi.encode(EIP712_ALLOCATION_ID_PROOF_TYPEHASH, _indexer, _allocationId))); + } + + /** + * @notice Checks if an allocation is over-allocated + * @param _indexer The address of the indexer + * @param _delegationRatio The delegation ratio to consider when locking tokens + * @return True if the allocation is over-allocated, false otherwise + */ + function _isOverAllocated(address _indexer, uint32 _delegationRatio) internal view returns (bool) { + return !allocationProvisionTracker.check(_graphStaking(), _indexer, _delegationRatio); + } + + /** + * @notice Verifies ownership of an allocation id by verifying an EIP712 allocation proof + * @dev Requirements: + * - Signer must be the allocation id address + * @param _indexer The address of the indexer + * @param _allocationId The id of the allocation + * @param _proof The EIP712 proof, an EIP712 signed message of (indexer,allocationId) + */ + function _verifyAllocationProof(address _indexer, address _allocationId, bytes memory _proof) private view { + address signer = ECDSA.recover(_encodeAllocationProof(_indexer, _allocationId), _proof); + require(signer == _allocationId, AllocationManagerInvalidAllocationProof(signer, _allocationId)); + } +} diff --git a/packages/subgraph-service/contracts/utilities/AllocationManagerStorage.sol b/packages/subgraph-service/contracts/utilities/AllocationManagerStorage.sol new file mode 100644 index 000000000..1c4f555d8 --- /dev/null +++ b/packages/subgraph-service/contracts/utilities/AllocationManagerStorage.sol @@ -0,0 +1,32 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +pragma solidity 0.8.27; + +import { Allocation } from "../libraries/Allocation.sol"; +import { LegacyAllocation } from "../libraries/LegacyAllocation.sol"; + +/** + * @title AllocationManagerStorage + * @notice This contract holds all the storage variables for the Allocation Manager contract. + * @custom:security-contact Please email security+contracts@thegraph.com if you find any + * bugs. We may have an active bug bounty program. + */ +abstract contract AllocationManagerV1Storage { + /// @notice Allocation details + mapping(address allocationId => Allocation.State allocation) internal _allocations; + + /// @notice Legacy allocation details + mapping(address allocationId => LegacyAllocation.State allocation) internal _legacyAllocations; + + /// @notice Tracks allocated tokens per indexer + mapping(address indexer => uint256 tokens) public allocationProvisionTracker; + + /// @notice Maximum amount of time, in seconds, allowed between presenting POIs to qualify for indexing rewards + uint256 public maxPOIStaleness; + + /// @notice Track total tokens allocated per subgraph deployment + /// @dev Used to calculate indexing rewards + mapping(bytes32 subgraphDeploymentId => uint256 tokens) internal _subgraphAllocatedTokens; + + /// @dev Gap to allow adding variables in future upgrades + uint256[50] private __gap; +} diff --git a/packages/subgraph-service/contracts/utilities/AttestationManager.sol b/packages/subgraph-service/contracts/utilities/AttestationManager.sol new file mode 100644 index 000000000..a0771a841 --- /dev/null +++ b/packages/subgraph-service/contracts/utilities/AttestationManager.sol @@ -0,0 +1,104 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +pragma solidity 0.8.27; + +import { AttestationManagerV1Storage } from "./AttestationManagerStorage.sol"; + +import { ECDSA } from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; +import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; +import { Attestation } from "../libraries/Attestation.sol"; + +/** + * @title AttestationManager contract + * @notice A helper contract implementing attestation verification. + * Uses a custom implementation of EIP712 for backwards compatibility with attestations. + * @custom:security-contact Please email security+contracts@thegraph.com if you find any + * bugs. We may have an active bug bounty program. + */ +abstract contract AttestationManager is Initializable, AttestationManagerV1Storage { + /// @notice EIP712 type hash for Receipt struct + bytes32 private constant RECEIPT_TYPE_HASH = + keccak256("Receipt(bytes32 requestCID,bytes32 responseCID,bytes32 subgraphDeploymentID)"); + + /// @notice EIP712 domain type hash + bytes32 private constant DOMAIN_TYPE_HASH = + keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract,bytes32 salt)"); + + /// @notice EIP712 domain name + bytes32 private constant DOMAIN_NAME_HASH = keccak256("Graph Protocol"); + + /// @notice EIP712 domain version + bytes32 private constant DOMAIN_VERSION_HASH = keccak256("0"); + + /// @notice EIP712 domain salt + bytes32 private constant DOMAIN_SALT = 0xa070ffb1cd7409649bf77822cce74495468e06dbfaef09556838bf188679b9c2; + + /** + * @dev Initialize the AttestationManager contract and parent contracts + */ + // solhint-disable-next-line func-name-mixedcase + function __AttestationManager_init() internal onlyInitializing { + __AttestationManager_init_unchained(); + } + + /** + * @dev Initialize the AttestationManager contract + */ + // solhint-disable-next-line func-name-mixedcase + function __AttestationManager_init_unchained() internal onlyInitializing { + _domainSeparator = keccak256( + abi.encode( + DOMAIN_TYPE_HASH, + DOMAIN_NAME_HASH, + DOMAIN_VERSION_HASH, + block.chainid, + address(this), + DOMAIN_SALT + ) + ); + } + + /** + * @dev Recover the signer address of the `_attestation`. + * @param _attestation The attestation struct + * @return Signer address + */ + function _recoverSigner(Attestation.State memory _attestation) internal view returns (address) { + // Obtain the hash of the fully-encoded message, per EIP-712 encoding + Attestation.Receipt memory receipt = Attestation.Receipt( + _attestation.requestCID, + _attestation.responseCID, + _attestation.subgraphDeploymentId + ); + bytes32 messageHash = _encodeReceipt(receipt); + + // Obtain the signer of the fully-encoded EIP-712 message hash + // NOTE: The signer of the attestation is the indexer that served the request + return ECDSA.recover(messageHash, abi.encodePacked(_attestation.r, _attestation.s, _attestation.v)); + } + + /** + * @dev Get the message hash that a indexer used to sign the receipt. + * Encodes a receipt using a domain separator, as described on + * https://github.com/ethereum/EIPs/blob/master/EIPS/eip-712.md#specification. + * @notice Return the message hash used to sign the receipt + * @param _receipt Receipt returned by indexer and submitted by fisherman + * @return Message hash used to sign the receipt + */ + function _encodeReceipt(Attestation.Receipt memory _receipt) internal view returns (bytes32) { + return + keccak256( + abi.encodePacked( + "\x19\x01", // EIP-191 encoding pad, EIP-712 version 1 + _domainSeparator, + keccak256( + abi.encode( + RECEIPT_TYPE_HASH, + _receipt.requestCID, + _receipt.responseCID, + _receipt.subgraphDeploymentId + ) // EIP 712-encoded message hash + ) + ) + ); + } +} diff --git a/packages/subgraph-service/contracts/utilities/AttestationManagerStorage.sol b/packages/subgraph-service/contracts/utilities/AttestationManagerStorage.sol new file mode 100644 index 000000000..1c720ec8c --- /dev/null +++ b/packages/subgraph-service/contracts/utilities/AttestationManagerStorage.sol @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +pragma solidity 0.8.27; + +/** + * @title AttestationManagerStorage + * @notice This contract holds all the storage variables for the Attestation Manager contract. + * @custom:security-contact Please email security+contracts@thegraph.com if you find any + * bugs. We may have an active bug bounty program. + */ +abstract contract AttestationManagerV1Storage { + /// @dev EIP712 domain separator + bytes32 internal _domainSeparator; + + /// @dev Gap to allow adding variables in future upgrades + uint256[50] private __gap; +} diff --git a/packages/subgraph-service/contracts/utilities/Directory.sol b/packages/subgraph-service/contracts/utilities/Directory.sol new file mode 100644 index 000000000..d068c74b3 --- /dev/null +++ b/packages/subgraph-service/contracts/utilities/Directory.sol @@ -0,0 +1,111 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +pragma solidity 0.8.27; + +import { IDisputeManager } from "../interfaces/IDisputeManager.sol"; +import { ISubgraphService } from "../interfaces/ISubgraphService.sol"; +import { IGraphTallyCollector } from "@graphprotocol/horizon/contracts/interfaces/IGraphTallyCollector.sol"; +import { ICuration } from "@graphprotocol/contracts/contracts/curation/ICuration.sol"; + +/** + * @title Directory contract + * @notice This contract is meant to be inherited by {SubgraphService} contract. + * It contains the addresses of the contracts that the contract interacts with. + * Uses immutable variables to minimize gas costs. + * @custom:security-contact Please email security+contracts@thegraph.com if you find any + * bugs. We may have an active bug bounty program. + */ +abstract contract Directory { + /// @notice The Subgraph Service contract address + ISubgraphService private immutable SUBGRAPH_SERVICE; + + /// @notice The Dispute Manager contract address + IDisputeManager private immutable DISPUTE_MANAGER; + + /// @notice The Graph Tally Collector contract address + /// @dev Required to collect payments via Graph Horizon payments protocol + IGraphTallyCollector private immutable GRAPH_TALLY_COLLECTOR; + + /// @notice The Curation contract address + /// @dev Required for curation fees distribution + ICuration private immutable CURATION; + + /** + * @notice Emitted when the Directory is initialized + * @param subgraphService The Subgraph Service contract address + * @param disputeManager The Dispute Manager contract address + * @param graphTallyCollector The Graph Tally Collector contract address + * @param curation The Curation contract address + */ + event SubgraphServiceDirectoryInitialized( + address subgraphService, + address disputeManager, + address graphTallyCollector, + address curation + ); + + /** + * @notice Thrown when the caller is not the Dispute Manager + * @param caller The caller address + * @param disputeManager The Dispute Manager address + */ + error DirectoryNotDisputeManager(address caller, address disputeManager); + + /** + * @notice Checks that the caller is the Dispute Manager + */ + modifier onlyDisputeManager() { + require( + msg.sender == address(DISPUTE_MANAGER), + DirectoryNotDisputeManager(msg.sender, address(DISPUTE_MANAGER)) + ); + _; + } + + /** + * @notice Constructor for the Directory contract + * @param subgraphService The Subgraph Service contract address + * @param disputeManager The Dispute Manager contract address + * @param graphTallyCollector The Graph Tally Collector contract address + * @param curation The Curation contract address + */ + constructor(address subgraphService, address disputeManager, address graphTallyCollector, address curation) { + SUBGRAPH_SERVICE = ISubgraphService(subgraphService); + DISPUTE_MANAGER = IDisputeManager(disputeManager); + GRAPH_TALLY_COLLECTOR = IGraphTallyCollector(graphTallyCollector); + CURATION = ICuration(curation); + + emit SubgraphServiceDirectoryInitialized(subgraphService, disputeManager, graphTallyCollector, curation); + } + + /** + * @notice Returns the Subgraph Service contract address + * @return The Subgraph Service contract + */ + function _subgraphService() internal view returns (ISubgraphService) { + return SUBGRAPH_SERVICE; + } + + /** + * @notice Returns the Dispute Manager contract address + * @return The Dispute Manager contract + */ + function _disputeManager() internal view returns (IDisputeManager) { + return DISPUTE_MANAGER; + } + + /** + * @notice Returns the Graph Tally Collector contract address + * @return The Graph Tally Collector contract + */ + function _graphTallyCollector() internal view returns (IGraphTallyCollector) { + return GRAPH_TALLY_COLLECTOR; + } + + /** + * @notice Returns the Curation contract address + * @return The Curation contract + */ + function _curation() internal view returns (ICuration) { + return CURATION; + } +} diff --git a/packages/subgraph-service/eslint.config.js b/packages/subgraph-service/eslint.config.js new file mode 100644 index 000000000..c9e06b116 --- /dev/null +++ b/packages/subgraph-service/eslint.config.js @@ -0,0 +1,21 @@ +// @ts-check +/* eslint-disable no-undef */ +/* eslint-disable @typescript-eslint/no-var-requires */ +/* eslint-disable @typescript-eslint/no-unsafe-assignment */ + +const eslintGraphConfig = require('eslint-graph-config') +module.exports = [ + ...eslintGraphConfig.default, + { + rules: { + '@typescript-eslint/no-unsafe-assignment': 'off', + '@typescript-eslint/no-var-requires': 'off', + '@typescript-eslint/no-unsafe-call': 'off', + '@typescript-eslint/no-unsafe-member-access': 'off', + '@typescript-eslint/no-unsafe-argument': 'off', + }, + }, + { + ignores: ['typechain-types/*', 'lib/*'], + }, +] diff --git a/packages/subgraph-service/foundry.toml b/packages/subgraph-service/foundry.toml new file mode 100644 index 000000000..5aff4f8b1 --- /dev/null +++ b/packages/subgraph-service/foundry.toml @@ -0,0 +1,9 @@ +[profile.default] +src = 'contracts' +out = 'build' +libs = ['node_modules', 'lib'] +test = 'test' +cache_path = 'cache_forge' +fs_permissions = [{ access = "read", path = "./"}] +optimizer = true +optimizer_runs = 100 diff --git a/packages/subgraph-service/hardhat.config.ts b/packages/subgraph-service/hardhat.config.ts new file mode 100644 index 000000000..d07ec83a4 --- /dev/null +++ b/packages/subgraph-service/hardhat.config.ts @@ -0,0 +1,31 @@ +import { hardhatBaseConfig, isProjectBuilt, loadTasks } from '@graphprotocol/toolshed/hardhat' +import { HardhatUserConfig } from 'hardhat/config' + +// Hardhat plugins +import '@nomicfoundation/hardhat-foundry' +import '@nomicfoundation/hardhat-toolbox' +import '@nomicfoundation/hardhat-ignition-ethers' +import 'hardhat-contract-sizer' +import 'hardhat-secure-accounts' +import 'solidity-docgen' + +// Skip importing hardhat-graph-protocol when building the project, it has circular dependency +if (isProjectBuilt(__dirname)) { + require('hardhat-graph-protocol') + loadTasks(__dirname) +} + +const config: HardhatUserConfig = { + ...hardhatBaseConfig, + solidity: { + version: '0.8.27', + settings: { + optimizer: { + enabled: true, + runs: 10, + }, + }, + }, +} + +export default config diff --git a/packages/subgraph-service/ignition/configs/migrate.default.json5 b/packages/subgraph-service/ignition/configs/migrate.default.json5 new file mode 100644 index 000000000..c81352a2d --- /dev/null +++ b/packages/subgraph-service/ignition/configs/migrate.default.json5 @@ -0,0 +1,36 @@ +{ + "$global": { + // Accounts already configured in the original Graph Protocol - Arbitrum Sepolia values + "governor": "0x72ee30d43Fb5A90B3FE983156C5d2fBE6F6d07B3", + "arbitrator": "0x1726A5d52e279d02ff4732eCeB2D67BFE5Add328", + "pauseGuardian": "0xa0444508232dA3FA6C2f96a5f105f3f0cc0d20D7", + + // Addresses for contracts deployed in the original Graph Protocol - Arbitrum Sepolia values + "controllerAddress": "0x9DB3ee191681f092607035d9BDA6e59FbEaCa695", + "curationProxyAddress": "0xDe761f075200E75485F4358978FB4d1dC8644FD5", + "curationImplementationAddress": "0xd90022aB67920212D0F902F5c427DE82732DE136", + "gnsProxyAddress": "0x3133948342F35b8699d8F94aeE064AbB76eDe965", + "gnsImplementationAddress": "0x00CBF5024d454255577Bf2b0fB6A43328a6828c9", + "subgraphNFTAddress": "0xF21Df5BbA7EB9b54D8F60C560aFb9bA63e6aED1A", + + // Must be set for step 2 of the deployment + "disputeManagerProxyAddress": "", + "disputeManagerProxyAdminAddress": "", + "subgraphServiceProxyAddress": "", + "subgraphServiceProxyAdminAddress": "", + "graphTallyCollectorAddress": "" + }, + "DisputeManager": { + "disputePeriod": 2419200, + "disputeDeposit": "10000000000000000000000n", + "fishermanRewardCut": 500000, + "maxSlashingCut": 1000000, + }, + "SubgraphService": { + "minimumProvisionTokens": "100000000000000000000000n", + "maximumDelegationRatio": 16, + "stakeToFeesRatio": 2, + "maxPOIStaleness": 2419200, // 28 days = 2419200 seconds + "curationCut": 100000, + } +} diff --git a/packages/subgraph-service/ignition/configs/migrate.fork1.json5 b/packages/subgraph-service/ignition/configs/migrate.fork1.json5 new file mode 100644 index 000000000..2fef9940a --- /dev/null +++ b/packages/subgraph-service/ignition/configs/migrate.fork1.json5 @@ -0,0 +1,36 @@ +{ + "$global": { + // Accounts already configured in the original Graph Protocol - Arbitrum Sepolia values + "governor": "0x72ee30d43Fb5A90B3FE983156C5d2fBE6F6d07B3", + "arbitrator": "0x1726A5d52e279d02ff4732eCeB2D67BFE5Add328", + "pauseGuardian": "0xa0444508232dA3FA6C2f96a5f105f3f0cc0d20D7", + + // Addresses for contracts deployed in the original Graph Protocol - Arbitrum Sepolia values + "controllerAddress": "0x9DB3ee191681f092607035d9BDA6e59FbEaCa695", + "curationProxyAddress": "0xDe761f075200E75485F4358978FB4d1dC8644FD5", + "curationImplementationAddress": "0xd90022aB67920212D0F902F5c427DE82732DE136", + "gnsProxyAddress": "0x3133948342F35b8699d8F94aeE064AbB76eDe965", + "gnsImplementationAddress": "0x00CBF5024d454255577Bf2b0fB6A43328a6828c9", + "subgraphNFTAddress": "0xF21Df5BbA7EB9b54D8F60C560aFb9bA63e6aED1A", + + // Must be set for step 2 of the deployment + "disputeManagerProxyAddress": "0x1CEBe1C314Cc454baf4bd553409d957C833623c0", + "disputeManagerProxyAdminAddress": "0x1a14fF838e7e06FdabFb20c2553b4ad613aD832b", + "subgraphServiceProxyAddress": "0x8A44C49eD477e7130249d4B8d5248d08B469Bf0d", + "subgraphServiceProxyAdminAddress": "0x7CB6291437029a4cFd28b3455c9e2242767010F3", + "graphTallyCollectorAddress": "0xF2DB533658a1728f3ce04A49Df4b545f4A53b620" + }, + "DisputeManager": { + "disputePeriod": 2419200, + "disputeDeposit": "10000000000000000000000n", + "fishermanRewardCut": 500000, + "maxSlashingCut": 1000000, + }, + "SubgraphService": { + "minimumProvisionTokens": "100000000000000000000000n", + "maximumDelegationRatio": 16, + "stakeToFeesRatio": 2, + "maxPOIStaleness": 2419200, // 28 days = 2419200 seconds + "curationCut": 100000, + } +} diff --git a/packages/subgraph-service/ignition/configs/migrate.integration.json5 b/packages/subgraph-service/ignition/configs/migrate.integration.json5 new file mode 100644 index 000000000..7af88d6eb --- /dev/null +++ b/packages/subgraph-service/ignition/configs/migrate.integration.json5 @@ -0,0 +1,37 @@ +{ + "$global": { + // Accounts for new deployment - derived from local network mnemonic + "governor": "0xFFcf8FDEE72ac11b5c542428B35EEF5769C409f0", + "arbitrator": "0x22d491Bde2303f2f43325b2108D26f1eAbA1e32b", + "pauseGuardian": "0xE11BA2b4D45Eaed5996Cd0823791E0C93114882d", + + // Addresses for contracts deployed in the original Graph Protocol - Arbitrum Sepolia values + "controllerAddress": "0x9DB3ee191681f092607035d9BDA6e59FbEaCa695", + "curationProxyAddress": "0xDe761f075200E75485F4358978FB4d1dC8644FD5", + "curationImplementationAddress": "0xd90022aB67920212D0F902F5c427DE82732DE136", + "gnsProxyAddress": "0x3133948342F35b8699d8F94aeE064AbB76eDe965", + "gnsImplementationAddress": "0x00CBF5024d454255577Bf2b0fB6A43328a6828c9", + "subgraphNFTAddress": "0xF21Df5BbA7EB9b54D8F60C560aFb9bA63e6aED1A", + + + // Must be set for step 2 of the deployment + "disputeManagerProxyAddress": "", + "disputeManagerProxyAdminAddress": "", + "subgraphServiceProxyAddress": "", + "subgraphServiceProxyAdminAddress": "", + "graphTallyCollectorAddress": "" + }, + "DisputeManager": { + "disputePeriod": 2419200, + "disputeDeposit": "10000000000000000000000n", + "fishermanRewardCut": 500000, + "maxSlashingCut": 1000000, + }, + "SubgraphService": { + "minimumProvisionTokens": "100000000000000000000000n", + "maximumDelegationRatio": 16, + "stakeToFeesRatio": 2, + "maxPOIStaleness": 2419200, // 28 days = 2419200 seconds + "curationCut": 100000, + } +} diff --git a/packages/subgraph-service/ignition/configs/protocol.default.json5 b/packages/subgraph-service/ignition/configs/protocol.default.json5 new file mode 100644 index 000000000..77b2ac66e --- /dev/null +++ b/packages/subgraph-service/ignition/configs/protocol.default.json5 @@ -0,0 +1,36 @@ +{ + "$global": { + // Accounts for new deployment - derived from hardhat default mnemonic + "governor": "0xFFcf8FDEE72ac11b5c542428B35EEF5769C409f0", // index 1 + "arbitrator": "0x22d491Bde2303f2f43325b2108D26f1eAbA1e32b", // index 2 + "pauseGuardian": "0xE11BA2b4D45Eaed5996Cd0823791E0C93114882d", // index 3 + + // Address of the new controller contract - must be set for step 2 of the deployment + "controllerAddress": "", + "curationProxyAddress": "", + "curationImplementationAddress": "", + "gnsProxyAddress": "", + "gnsImplementationAddress": "", + "subgraphNFTAddress": "", + + // Must be set for step 2 of the deployment + "disputeManagerProxyAddress": "", + "disputeManagerProxyAdminAddress": "", + "subgraphServiceProxyAddress": "", + "subgraphServiceProxyAdminAddress": "", + "graphTallyCollectorAddress": "" + }, + "DisputeManager": { + "disputePeriod": 2419200, + "disputeDeposit": "10000000000000000000000n", + "fishermanRewardCut": 500000, + "maxSlashingCut": 1000000, + }, + "SubgraphService": { + "minimumProvisionTokens": "100000000000000000000000n", + "maximumDelegationRatio": 16, + "stakeToFeesRatio": 2, + "maxPOIStaleness": 2419200, // 28 days = 2419200 seconds + "curationCut": 100000, + } +} diff --git a/packages/subgraph-service/ignition/configs/protocol.localNetwork.json5 b/packages/subgraph-service/ignition/configs/protocol.localNetwork.json5 new file mode 100644 index 000000000..bafa504cc --- /dev/null +++ b/packages/subgraph-service/ignition/configs/protocol.localNetwork.json5 @@ -0,0 +1,36 @@ +{ + "$global": { + // Accounts for new deployment - derived from local network mnemonic + "governor": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", // index 0 + "arbitrator": "0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC", // index 2 + "pauseGuardian": "0x90F79bf6EB2c4f870365E785982E1f101E93b906", // index 3 + + // Address of the new controller contract - must be set for step 2 of the deployment + "controllerAddress": "", + "curationProxyAddress": "", + "curationImplementationAddress": "", + "gnsProxyAddress": "", + "gnsImplementationAddress": "", + "subgraphNFTAddress": "", + + // Must be set for step 2 of the deployment + "disputeManagerProxyAddress": "", + "disputeManagerProxyAdminAddress": "", + "subgraphServiceProxyAddress": "", + "subgraphServiceProxyAdminAddress": "", + "graphTallyCollectorAddress": "" + }, + "DisputeManager": { + "disputePeriod": 7200, // 2 hours = 7200 seconds + "disputeDeposit": "10000000000000000000000n", + "fishermanRewardCut": 500000, + "maxSlashingCut": 1000000, + }, + "SubgraphService": { + "minimumProvisionTokens": "100000000000000000000000n", + "maximumDelegationRatio": 16, + "stakeToFeesRatio": 2, + "maxPOIStaleness": 7200, // 2 hours = 7200 seconds + "curationCut": 100000, + } +} diff --git a/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/Controller#Controller.json b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/Controller#Controller.json new file mode 100644 index 000000000..6979339d2 --- /dev/null +++ b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/Controller#Controller.json @@ -0,0 +1,349 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "Controller", + "sourceName": "contracts/governance/Controller.sol", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "NewOwnership", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldPauseGuardian", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "pauseGuardian", + "type": "address" + } + ], + "name": "NewPauseGuardian", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "NewPendingOwnership", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "isPaused", + "type": "bool" + } + ], + "name": "PartialPauseChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "isPaused", + "type": "bool" + } + ], + "name": "PauseChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "contractAddress", + "type": "address" + } + ], + "name": "SetContractProxy", + "type": "event" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_id", + "type": "bytes32" + } + ], + "name": "getContractProxy", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getGovernor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "lastPartialPauseTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "lastPauseTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "partialPaused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pauseGuardian", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "paused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingGovernor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_id", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "_contractAddress", + "type": "address" + } + ], + "name": "setContractProxy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "_toPartialPause", + "type": "bool" + } + ], + "name": "setPartialPaused", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newPauseGuardian", + "type": "address" + } + ], + "name": "setPauseGuardian", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "_toPause", + "type": "bool" + } + ], + "name": "setPaused", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newGovernor", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_id", + "type": "bytes32" + } + ], + "name": "unsetContractProxy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_id", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "_controller", + "type": "address" + } + ], + "name": "updateController", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "bytecode": "0x608060405234801561001057600080fd5b506100243361003360201b6109b21760201c565b61002e6001610055565b6100e7565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b600160159054906101000a900460ff1615158115151415610075576100e4565b6001805460ff60a81b1916600160a81b8315158102919091179182905560ff910416156100a157426003555b60015460408051600160a81b90920460ff1615158252517f8fb6c181ee25a520cf3dd6565006ef91229fcfe5a989566c2a3b8c115570cec5916020908290030190a15b50565b610ba0806100f66000396000f3fe608060405234801561001057600080fd5b506004361061010b5760003560e01c80635c975abb116100a2578063e0e9929211610071578063e0e9929214610215578063e3056a3414610241578063eb5dd94f14610249578063f2fde38b14610275578063f7641a5e1461029b5761010b565b80635c975abb146101e057806379ba5097146101e85780639181df9c146101f057806391b4ded91461020d5761010b565b80632e292fc7116100de5780632e292fc71461017757806348bde20c146101935780634fc07d75146101b957806356371bd8146101c15761010b565b80630c340a2414610110578063147ddef51461013457806316c38b3c1461014e57806324a3d6221461016f575b600080fd5b6101186102b8565b604080516001600160a01b039092168252519081900360200190f35b61013c6102c7565b60408051918252519081900360200190f35b61016d6004803603602081101561016457600080fd5b503515156102cd565b005b610118610337565b61017f610346565b604080519115158252519081900360200190f35b61016d600480360360208110156101a957600080fd5b50356001600160a01b0316610356565b610118610412565b61016d600480360360208110156101d757600080fd5b50351515610421565b61017f610488565b61016d610498565b61016d6004803603602081101561020657600080fd5b50356105a6565b61013c610651565b61016d6004803603604081101561022b57600080fd5b50803590602001356001600160a01b0316610657565b61011861076e565b61016d6004803603604081101561025f57600080fd5b50803590602001356001600160a01b031661077d565b61016d6004803603602081101561028b57600080fd5b50356001600160a01b0316610899565b610118600480360360208110156102b157600080fd5b5035610997565b6000546001600160a01b031681565b60025481565b6000546001600160a01b03163314806102f057506004546001600160a01b031633145b61032b5760405162461bcd60e51b8152600401808060200182810382526022815260200180610b496022913960400191505060405180910390fd5b610334816109d4565b50565b6004546001600160a01b031681565b600154600160a01b900460ff1690565b6000546001600160a01b031633146103ae576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b6001600160a01b038116610409576040805162461bcd60e51b815260206004820152601960248201527f5061757365477561726469616e206d7573742062652073657400000000000000604482015290519081900360640190fd5b61033481610a65565b6000546001600160a01b031690565b6000546001600160a01b031633148061044457506004546001600160a01b031633145b61047f5760405162461bcd60e51b8152600401808060200182810382526022815260200180610b496022913960400191505060405180910390fd5b61033481610ab7565b600154600160a81b900460ff1690565b6001546001600160a01b031680158015906104bb5750336001600160a01b038216145b61050c576040805162461bcd60e51b815260206004820152601f60248201527f43616c6c6572206d7573742062652070656e64696e6720676f7665726e6f7200604482015290519081900360640190fd5b600080546001600160a01b038381166001600160a01b031980841691909117808555600180549092169091556040519282169391169183917f0ac6deed30eef60090c749850e10f2fa469e3e25fec1d1bef2853003f6e6f18f91a36001546040516001600160a01b03918216918416907f76563ad561b7036ae716b9b25cb521b21463240f104c97e12f25877f2235f33d90600090a35050565b6000546001600160a01b031633146105fe576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b600081815260056020908152604080832080546001600160a01b031916905580519283525183927f937cf566d78d4769ff0211a7d87a6bea51e1fc026fd4d3d8cd589f0e99b983bd92908290030190a250565b60035481565b6000546001600160a01b031633146106af576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b6001600160a01b03811661070a576040805162461bcd60e51b815260206004820152601c60248201527f436f6e74726163742061646472657373206d7573742062652073657400000000604482015290519081900360640190fd5b60008281526005602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251908152915184927f937cf566d78d4769ff0211a7d87a6bea51e1fc026fd4d3d8cd589f0e99b983bd92908290030190a25050565b6001546001600160a01b031681565b6000546001600160a01b031633146107d5576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b6001600160a01b038116610829576040805162461bcd60e51b815260206004820152601660248201527510dbdb9d1c9bdb1b195c881b5d5cdd081899481cd95d60521b604482015290519081900360640190fd5b6000828152600560205260408082205481516392eefe9b60e01b81526001600160a01b038581166004830152925192909116926392eefe9b9260248084019382900301818387803b15801561087d57600080fd5b505af1158015610891573d6000803e3d6000fd5b505050505050565b6000546001600160a01b031633146108f1576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b6001600160a01b038116610943576040805162461bcd60e51b815260206004820152601460248201527311dbdd995c9b9bdc881b5d5cdd081899481cd95d60621b604482015290519081900360640190fd5b600180546001600160a01b038381166001600160a01b03198316179283905560405191811692169082907f76563ad561b7036ae716b9b25cb521b21463240f104c97e12f25877f2235f33d90600090a35050565b6000908152600560205260409020546001600160a01b031690565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b600160159054906101000a900460ff16151581151514156109f457610334565b6001805460ff60a81b1916600160a81b8315158102919091179182905560ff91041615610a2057426003555b60015460408051600160a81b90920460ff1615158252517f8fb6c181ee25a520cf3dd6565006ef91229fcfe5a989566c2a3b8c115570cec5916020908290030190a150565b600480546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f0613b6ee6a04f0d09f390e4d9318894b9f6ac7fd83897cd8d18896ba579c401e90600090a35050565b600160149054906101000a900460ff1615158115151415610ad757610334565b6001805460ff60a01b1916600160a01b8315158102919091179182905560ff91041615610b0357426002555b60015460408051600160a01b90920460ff1615158252517f511b770d1b1dc5cbd412a5017f55cbb2295b826385e5f46c1de2b6ebeb44ae02916020908290030190a15056fe4f6e6c7920476f7665726e6f72206f7220477561726469616e2063616e2063616c6ca26469706673582212207cecec10a8617577e80b5c52f6cd82da5e5974468c039848ed5e90b25c8267c764736f6c63430007060033", + "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061010b5760003560e01c80635c975abb116100a2578063e0e9929211610071578063e0e9929214610215578063e3056a3414610241578063eb5dd94f14610249578063f2fde38b14610275578063f7641a5e1461029b5761010b565b80635c975abb146101e057806379ba5097146101e85780639181df9c146101f057806391b4ded91461020d5761010b565b80632e292fc7116100de5780632e292fc71461017757806348bde20c146101935780634fc07d75146101b957806356371bd8146101c15761010b565b80630c340a2414610110578063147ddef51461013457806316c38b3c1461014e57806324a3d6221461016f575b600080fd5b6101186102b8565b604080516001600160a01b039092168252519081900360200190f35b61013c6102c7565b60408051918252519081900360200190f35b61016d6004803603602081101561016457600080fd5b503515156102cd565b005b610118610337565b61017f610346565b604080519115158252519081900360200190f35b61016d600480360360208110156101a957600080fd5b50356001600160a01b0316610356565b610118610412565b61016d600480360360208110156101d757600080fd5b50351515610421565b61017f610488565b61016d610498565b61016d6004803603602081101561020657600080fd5b50356105a6565b61013c610651565b61016d6004803603604081101561022b57600080fd5b50803590602001356001600160a01b0316610657565b61011861076e565b61016d6004803603604081101561025f57600080fd5b50803590602001356001600160a01b031661077d565b61016d6004803603602081101561028b57600080fd5b50356001600160a01b0316610899565b610118600480360360208110156102b157600080fd5b5035610997565b6000546001600160a01b031681565b60025481565b6000546001600160a01b03163314806102f057506004546001600160a01b031633145b61032b5760405162461bcd60e51b8152600401808060200182810382526022815260200180610b496022913960400191505060405180910390fd5b610334816109d4565b50565b6004546001600160a01b031681565b600154600160a01b900460ff1690565b6000546001600160a01b031633146103ae576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b6001600160a01b038116610409576040805162461bcd60e51b815260206004820152601960248201527f5061757365477561726469616e206d7573742062652073657400000000000000604482015290519081900360640190fd5b61033481610a65565b6000546001600160a01b031690565b6000546001600160a01b031633148061044457506004546001600160a01b031633145b61047f5760405162461bcd60e51b8152600401808060200182810382526022815260200180610b496022913960400191505060405180910390fd5b61033481610ab7565b600154600160a81b900460ff1690565b6001546001600160a01b031680158015906104bb5750336001600160a01b038216145b61050c576040805162461bcd60e51b815260206004820152601f60248201527f43616c6c6572206d7573742062652070656e64696e6720676f7665726e6f7200604482015290519081900360640190fd5b600080546001600160a01b038381166001600160a01b031980841691909117808555600180549092169091556040519282169391169183917f0ac6deed30eef60090c749850e10f2fa469e3e25fec1d1bef2853003f6e6f18f91a36001546040516001600160a01b03918216918416907f76563ad561b7036ae716b9b25cb521b21463240f104c97e12f25877f2235f33d90600090a35050565b6000546001600160a01b031633146105fe576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b600081815260056020908152604080832080546001600160a01b031916905580519283525183927f937cf566d78d4769ff0211a7d87a6bea51e1fc026fd4d3d8cd589f0e99b983bd92908290030190a250565b60035481565b6000546001600160a01b031633146106af576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b6001600160a01b03811661070a576040805162461bcd60e51b815260206004820152601c60248201527f436f6e74726163742061646472657373206d7573742062652073657400000000604482015290519081900360640190fd5b60008281526005602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251908152915184927f937cf566d78d4769ff0211a7d87a6bea51e1fc026fd4d3d8cd589f0e99b983bd92908290030190a25050565b6001546001600160a01b031681565b6000546001600160a01b031633146107d5576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b6001600160a01b038116610829576040805162461bcd60e51b815260206004820152601660248201527510dbdb9d1c9bdb1b195c881b5d5cdd081899481cd95d60521b604482015290519081900360640190fd5b6000828152600560205260408082205481516392eefe9b60e01b81526001600160a01b038581166004830152925192909116926392eefe9b9260248084019382900301818387803b15801561087d57600080fd5b505af1158015610891573d6000803e3d6000fd5b505050505050565b6000546001600160a01b031633146108f1576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b6001600160a01b038116610943576040805162461bcd60e51b815260206004820152601460248201527311dbdd995c9b9bdc881b5d5cdd081899481cd95d60621b604482015290519081900360640190fd5b600180546001600160a01b038381166001600160a01b03198316179283905560405191811692169082907f76563ad561b7036ae716b9b25cb521b21463240f104c97e12f25877f2235f33d90600090a35050565b6000908152600560205260409020546001600160a01b031690565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b600160159054906101000a900460ff16151581151514156109f457610334565b6001805460ff60a81b1916600160a81b8315158102919091179182905560ff91041615610a2057426003555b60015460408051600160a81b90920460ff1615158252517f8fb6c181ee25a520cf3dd6565006ef91229fcfe5a989566c2a3b8c115570cec5916020908290030190a150565b600480546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f0613b6ee6a04f0d09f390e4d9318894b9f6ac7fd83897cd8d18896ba579c401e90600090a35050565b600160149054906101000a900460ff1615158115151415610ad757610334565b6001805460ff60a01b1916600160a01b8315158102919091179182905560ff91041615610b0357426002555b60015460408051600160a01b90920460ff1615158252517f511b770d1b1dc5cbd412a5017f55cbb2295b826385e5f46c1de2b6ebeb44ae02916020908290030190a15056fe4f6e6c7920476f7665726e6f72206f7220477561726469616e2063616e2063616c6ca26469706673582212207cecec10a8617577e80b5c52f6cd82da5e5974468c039848ed5e90b25c8267c764736f6c63430007060033", + "linkReferences": {}, + "deployedLinkReferences": {} +} \ No newline at end of file diff --git a/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/DisputeManager#DisputeManager.dbg.json b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/DisputeManager#DisputeManager.dbg.json new file mode 100644 index 000000000..767ad87b5 --- /dev/null +++ b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/DisputeManager#DisputeManager.dbg.json @@ -0,0 +1,4 @@ +{ + "_format": "hh-sol-dbg-1", + "buildInfo": "../build-info/81754efc7e2eec76b7d493cc60c0f970.json" +} \ No newline at end of file diff --git a/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/DisputeManager#DisputeManager.json b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/DisputeManager#DisputeManager.json new file mode 100644 index 000000000..e01123577 --- /dev/null +++ b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/DisputeManager#DisputeManager.json @@ -0,0 +1,1557 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "DisputeManager", + "sourceName": "contracts/DisputeManager.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "controller", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "length", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "expectedLength", + "type": "uint256" + } + ], + "name": "AttestationInvalidBytesLength", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + } + ], + "name": "DisputeManagerDisputeAlreadyCreated", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + } + ], + "name": "DisputeManagerDisputeInConflict", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + } + ], + "name": "DisputeManagerDisputeNotInConflict", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "enum IDisputeManager.DisputeStatus", + "name": "status", + "type": "uint8" + } + ], + "name": "DisputeManagerDisputeNotPending", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeManagerDisputePeriodNotFinished", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeManagerDisputePeriodZero", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "DisputeManagerIndexerNotFound", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + } + ], + "name": "DisputeManagerInvalidDispute", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "disputeDeposit", + "type": "uint256" + } + ], + "name": "DisputeManagerInvalidDisputeDeposit", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "cut", + "type": "uint32" + } + ], + "name": "DisputeManagerInvalidFishermanReward", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "maxSlashingCut", + "type": "uint32" + } + ], + "name": "DisputeManagerInvalidMaxSlashingCut", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokensSlash", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxTokensSlash", + "type": "uint256" + } + ], + "name": "DisputeManagerInvalidTokensSlash", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeManagerInvalidZeroAddress", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "relatedDisputeId", + "type": "bytes32" + } + ], + "name": "DisputeManagerMustAcceptRelatedDispute", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "requestCID1", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "responseCID1", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "subgraphDeploymentId1", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "requestCID2", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "responseCID2", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "subgraphDeploymentId2", + "type": "bytes32" + } + ], + "name": "DisputeManagerNonConflictingAttestations", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "subgraphDeploymentId1", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "subgraphDeploymentId2", + "type": "bytes32" + } + ], + "name": "DisputeManagerNonMatchingSubgraphDeployment", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeManagerNotArbitrator", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeManagerNotFisherman", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeManagerSubgraphServiceNotSet", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeManagerZeroTokens", + "type": "error" + }, + { + "inputs": [], + "name": "ECDSAInvalidSignature", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "length", + "type": "uint256" + } + ], + "name": "ECDSAInvalidSignatureLength", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "ECDSAInvalidSignatureS", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "contractName", + "type": "bytes" + } + ], + "name": "GraphDirectoryInvalidZeroAddress", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidInitialization", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "OwnableInvalidOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "OwnableUnauthorizedAccount", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "a", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "b", + "type": "uint256" + } + ], + "name": "PPMMathInvalidMulPPM", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "arbitrator", + "type": "address" + } + ], + "name": "ArbitratorSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "fisherman", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "DisputeAccepted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "fisherman", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "DisputeCancelled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "disputeDeposit", + "type": "uint256" + } + ], + "name": "DisputeDepositSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "fisherman", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "DisputeDrawn", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "disputeId1", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "disputeId2", + "type": "bytes32" + } + ], + "name": "DisputeLinked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "disputePeriod", + "type": "uint64" + } + ], + "name": "DisputePeriodSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "fisherman", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "DisputeRejected", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "fishermanRewardCut", + "type": "uint32" + } + ], + "name": "FishermanRewardCutSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "graphToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "graphStaking", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphPayments", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphEscrow", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "graphController", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphEpochManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphRewardsManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphTokenGateway", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphProxyAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphCuration", + "type": "address" + } + ], + "name": "GraphDirectoryInitialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "fisherman", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "poi", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "stakeSnapshot", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "cancellableAt", + "type": "uint256" + } + ], + "name": "IndexingDisputeCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "fisherman", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensSlash", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensRewards", + "type": "uint256" + } + ], + "name": "LegacyDisputeCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "maxSlashingCut", + "type": "uint32" + } + ], + "name": "MaxSlashingCutSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "fisherman", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "attestation", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "stakeSnapshot", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "cancellableAt", + "type": "uint256" + } + ], + "name": "QueryDisputeCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "subgraphService", + "type": "address" + } + ], + "name": "SubgraphServiceSet", + "type": "event" + }, + { + "inputs": [], + "name": "MAX_FISHERMAN_REWARD_CUT", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MIN_DISPUTE_DEPOSIT", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "tokensSlash", + "type": "uint256" + } + ], + "name": "acceptDispute", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "tokensSlash", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "acceptDisputeInConflict", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "tokensSlashRelated", + "type": "uint256" + } + ], + "name": "acceptDisputeConflict", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "arbitrator", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "requestCID", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "responseCID", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + } + ], + "internalType": "struct Attestation.State", + "name": "attestation1", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "bytes32", + "name": "requestCID", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "responseCID", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + } + ], + "internalType": "struct Attestation.State", + "name": "attestation2", + "type": "tuple" + } + ], + "name": "areConflictingAttestations", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + } + ], + "name": "cancelDispute", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "internalType": "address", + "name": "fisherman", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokensSlash", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokensRewards", + "type": "uint256" + } + ], + "name": "createAndAcceptLegacyDispute", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "poi", + "type": "bytes32" + } + ], + "name": "createIndexingDispute", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "attestationData", + "type": "bytes" + } + ], + "name": "createQueryDispute", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "attestationData1", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "attestationData2", + "type": "bytes" + } + ], + "name": "createQueryDisputeConflict", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "disputeDeposit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "disputePeriod", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + } + ], + "name": "disputes", + "outputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "address", + "name": "fisherman", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deposit", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "relatedDisputeId", + "type": "bytes32" + }, + { + "internalType": "enum IDisputeManager.DisputeType", + "name": "disputeType", + "type": "uint8" + }, + { + "internalType": "enum IDisputeManager.DisputeStatus", + "name": "status", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "createdAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "cancellableAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "stakeSnapshot", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + } + ], + "name": "drawDispute", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "requestCID", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "responseCID", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + } + ], + "internalType": "struct Attestation.Receipt", + "name": "receipt", + "type": "tuple" + } + ], + "name": "encodeReceipt", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "fishermanRewardCut", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "requestCID", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "responseCID", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + } + ], + "internalType": "struct Attestation.State", + "name": "attestation", + "type": "tuple" + } + ], + "name": "getAttestationIndexer", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getDisputePeriod", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getFishermanRewardCut", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + } + ], + "name": "getStakeSnapshot", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "arbitrator_", + "type": "address" + }, + { + "internalType": "uint64", + "name": "disputePeriod_", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "disputeDeposit_", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "fishermanRewardCut_", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "maxSlashingCut_", + "type": "uint32" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + } + ], + "name": "isDisputeCreated", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maxSlashingCut", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + } + ], + "name": "rejectDispute", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "arbitrator", + "type": "address" + } + ], + "name": "setArbitrator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "disputeDeposit", + "type": "uint256" + } + ], + "name": "setDisputeDeposit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "disputePeriod", + "type": "uint64" + } + ], + "name": "setDisputePeriod", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "fishermanRewardCut_", + "type": "uint32" + } + ], + "name": "setFishermanRewardCut", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "maxSlashingCut_", + "type": "uint32" + } + ], + "name": "setMaxSlashingCut", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "subgraphService_", + "type": "address" + } + ], + "name": "setSubgraphService", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "subgraphService", + "outputs": [ + { + "internalType": "contract ISubgraphService", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "bytecode": "0x6101c060405234801561001157600080fd5b50604051613b6e380380613b6e8339810160408190526100309161049b565b806001600160a01b03811661007a5760405163218f5add60e11b815260206004820152600a60248201526921b7b73a3937b63632b960b11b60448201526064015b60405180910390fd5b6001600160a01b0381166101005260408051808201909152600a81526923b930b8342a37b5b2b760b11b60208201526100b29061033b565b6001600160a01b03166080526040805180820190915260078152665374616b696e6760c81b60208201526100e59061033b565b6001600160a01b031660a05260408051808201909152600d81526c47726170685061796d656e747360981b602082015261011e9061033b565b6001600160a01b031660c05260408051808201909152600e81526d5061796d656e7473457363726f7760901b60208201526101589061033b565b6001600160a01b031660e05260408051808201909152600c81526b22b837b1b426b0b730b3b2b960a11b60208201526101909061033b565b6001600160a01b03166101205260408051808201909152600e81526d2932bbb0b93239a6b0b730b3b2b960911b60208201526101cb9061033b565b6001600160a01b0316610140526040805180820190915260118152704772617068546f6b656e4761746577617960781b60208201526102099061033b565b6001600160a01b03166101605260408051808201909152600f81526e23b930b834283937bc3ca0b236b4b760891b60208201526102459061033b565b6001600160a01b03166101805260408051808201909152600881526721bab930ba34b7b760c11b602082015261027a9061033b565b6001600160a01b039081166101a08190526101005160a05160805160c05160e05161012051610140516101605161018051604051988b169a9788169996909716977fef5021414834d86e36470f5c1cecf6544fb2bb723f2ca51a4c86fcd8c5919a43976103249790916001600160a01b03978816815295871660208701529386166040860152918516606085015284166080840152831660a083015290911660c082015260e00190565b60405180910390a4506103356103e9565b50610519565b600080610100516001600160a01b031663f7641a5e84805190602001206040518263ffffffff1660e01b815260040161037691815260200190565b602060405180830381865afa158015610393573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103b7919061049b565b9050826001600160a01b0382166103e25760405163218f5add60e11b815260040161007191906104cb565b5092915050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff16156104395760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b03908116146104985780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b6000602082840312156104ad57600080fd5b81516001600160a01b03811681146104c457600080fd5b9392505050565b602081526000825180602084015260005b818110156104f957602081860181015160408684010152016104dc565b506000604082850101526040601f19601f83011684010191505092915050565b60805160a05160c05160e05161010051610120516101405161016051610180516101a0516135f261057c60003960005050600050506000505060005050600050506000505060005050600050506000611f23015260006119cc01526135f26000f3fe608060405234801561001057600080fd5b50600436106101a15760003560e01c8063050b17ad146101a65780630533e1ba146101bb5780630bc7344b146101e857806311be1997146101fb578063169729781461027857806317337b461461028b5780631792f1941461029557806326058249146102a857806329e03ff1146102c857806336167e03146102df5780634bc5839a146102f25780635aea0ec4146103055780635bf31d4d146103265780636369df6b146103405780636cc6cde114610353578063715018a61461036657806376c993ae1461036e5780638d4e9008146103815780638da5cb5b14610394578063902a49381461039c5780639334ea52146103ac57806393a90a1e146103bf5780639f81a7cf146103d2578063b0e2f7e9146103e5578063b0eefabe146103f8578063bb2a2b471461040b578063be41f38414610419578063c133b4291461043c578063c50a77b11461044f578063c894222e14610462578063c9747f5114610483578063cc2d55cd14610496578063d36fc9d4146104a5578063d76f62d1146104b8578063f2fde38b146104cb575b600080fd5b6101b96101b4366004612c8a565b6104de565b005b6036546101d290600160201b900463ffffffff1681565b6040516101df9190612cac565b60405180910390f35b6101b96101f6366004612cf9565b6105fc565b610263610209366004612d72565b603760205260009081526040902080546001820154600283015460038401546004850154600586015460068701546007909701546001600160a01b039687169796909516959394929360ff80841694610100909404169289565b6040516101df99989796959493929190612db5565b6101b9610286366004612d72565b610734565b6101d26207a12081565b6101b96102a3366004612d72565b610748565b6033546102bb906001600160a01b031681565b6040516101df9190612e20565b6102d160355481565b6040519081526020016101df565b6101b96102ed366004612d72565b6108a8565b6102d1610300366004612e34565b6109ae565b603454600160a01b90046001600160401b03165b6040516101df9190612e60565b60345461031990600160a01b90046001600160401b031681565b6102d161034e366004612e74565b6109e6565b6034546102bb906001600160a01b031681565b6101b96109ff565b6101b961037c366004612e8f565b610a13565b6102d161038f366004612eac565b610a24565b6102bb610dc5565b6036546101d29063ffffffff1681565b6101b96103ba366004612d72565b610de0565b6101b96103cd366004612ef2565b610edf565b6101b96103e0366004612e8f565b610ef0565b6101b96103f3366004612f1d565b610f01565b6101b9610406366004612ef2565b611062565b60365463ffffffff166101d2565b61042c610427366004612d72565b611073565b60405190151581526020016101df565b6102d161044a366004612ef2565b6110a9565b6102d161045d366004612fa4565b611141565b610475610470366004612fe5565b6111d4565b6040516101df929190613054565b6102bb6104913660046130fa565b6113e2565b6102d1670de0b6b3a764000081565b61042c6104b336600461317c565b6114cd565b6101b96104c63660046131b2565b6114f5565b6101b96104d9366004612ef2565b611506565b6034546001600160a01b031633146105095760405163a8baf3bb60e01b815260040160405180910390fd5b8161051381611073565b819061053e576040516314a03bbd60e21b815260040161053591815260200190565b60405180910390fd5b506004600082815260376020526040902060040154610100900460ff16600581111561056c5761056c612d8b565b600083815260376020526040902060040154610100900460ff1691146105a65760405163146e540f60e21b815260040161053591906131cf565b506000838152603760205260409020600301548390156105dc576040516364d0c32b60e01b815260040161053591815260200190565b5060008381526037602052604090206105f6848285611541565b50505050565b60006106066115f2565b805490915060ff600160401b82041615906001600160401b031660008115801561062d5750825b90506000826001600160401b031660011480156106495750303b155b905081158015610657575080155b156106755760405163f92ee8a960e01b815260040160405180910390fd5b84546001600160401b0319166001178555831561069e57845460ff60401b1916600160401b1785555b6106a78b61161b565b6106af61162c565b6106b88a61163c565b6106c1896116ad565b6106ca88611736565b6106d387611799565b6106dc8661180b565b831561072757845460ff60401b191685556040517fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29061071e90600190612e60565b60405180910390a15b5050505050505050505050565b61073c611892565b61074581611736565b50565b8061075281611073565b8190610774576040516314a03bbd60e21b815260040161053591815260200190565b506000818152603760205260409020600101546001600160a01b031633146107af5760405163082c005560e41b815260040160405180910390fd5b816107b981611073565b81906107db576040516314a03bbd60e21b815260040161053591815260200190565b506004600082815260376020526040902060040154610100900460ff16600581111561080957610809612d8b565b600083815260376020526040902060040154610100900460ff1691146108435760405163146e540f60e21b815260040161053591906131cf565b506000838152603760205260409020600681015442101561087757604051631d7753d560e11b815260040160405180910390fd5b61088184826118c4565b6003810154156105f657600381015460008181526037602052604090206105f691906118c4565b6034546001600160a01b031633146108d35760405163a8baf3bb60e01b815260040160405180910390fd5b806108dd81611073565b81906108ff576040516314a03bbd60e21b815260040161053591815260200190565b506004600082815260376020526040902060040154610100900460ff16600581111561092d5761092d612d8b565b600083815260376020526040902060040154610100900460ff1691146109675760405163146e540f60e21b815260040161053591906131cf565b506000828152603760205260409020600381015483901561099e576040516364d0c32b60e01b815260040161053591815260200190565b506109a9838261194b565b505050565b60006109cf336035546109bf6119ca565b6001600160a01b031691906119ee565b6109dd336035548585611aa6565b90505b92915050565b60006109e06109fa368490038401846131dd565b611e28565b610a07611892565b610a116000611ec5565b565b610a1b611892565b61074581611799565b6034546000906001600160a01b03163314610a525760405163a8baf3bb60e01b815260040160405180910390fd5b6040516001600160601b0319606087901b166020820152656c656761637960d01b6034820152600090603a016040516020818303038152906040528051906020012090506000610aa0611f21565b6001600160a01b0316630e022923886040518263ffffffff1660e01b8152600401610acb9190612e20565b61012060405180830381865afa158015610ae9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b0d91906132d9565b519050866001600160a01b038216610b39576040516334789d8b60e21b81526004016105359190612e20565b5060408051610120810182526001600160a01b038381168252881660208201526000918101829052606081019190915260036080820152600160a08201524260c0820181905260345460e0830191610ba191600160a01b90046001600160401b03169061330c565b81526000602091820181905284815260378252604090819020835181546001600160a01b039182166001600160a01b0319918216178355938501516001808401805492909316919095161790559083015160028201556060830151600380830191909155608084015160048301805493949193909260ff1990911691908490811115610c2f57610c2f612d8b565b021790555060a082015160048201805461ff001916610100836005811115610c5957610c59612d8b565b021790555060c0820151600582015560e08201516006820155610100909101516007909101556000610c89611f45565b9050806001600160a01b031663cb8347fe838888604051602001610cae929190613054565b6040516020818303038152906040526040518363ffffffff1660e01b8152600401610cda929190613365565b600060405180830381600087803b158015610cf457600080fd5b505af1158015610d08573d6000803e3d6000fd5b50505050610d298786610d196119ca565b6001600160a01b03169190611f81565b604080516001600160a01b038a81168252602082018990529181018790528189169184169085907f587a1fc7e80e653a2ab7f63f98c080f5818b8cedcfd1374590c8c786290ed0319060600160405180910390a4866001600160a01b0316826001600160a01b03168460008051602061359d83398151915288604051610db191815260200190565b60405180910390a450909695505050505050565b600080610dd0611fbc565b546001600160a01b031692915050565b6034546001600160a01b03163314610e0b5760405163a8baf3bb60e01b815260040160405180910390fd5b80610e1581611073565b8190610e37576040516314a03bbd60e21b815260040161053591815260200190565b506004600082815260376020526040902060040154610100900460ff166005811115610e6557610e65612d8b565b600083815260376020526040902060040154610100900460ff169114610e9f5760405163146e540f60e21b815260040161053591906131cf565b506000828152603760205260409020610eb88382611fe0565b6003810154156109a957600381015460008181526037602052604090206109a99190611fe0565b610ee7611892565b6107458161205f565b610ef8611892565b6107458161180b565b6034546001600160a01b03163314610f2c5760405163a8baf3bb60e01b815260040160405180910390fd5b83610f3681611073565b8190610f58576040516314a03bbd60e21b815260040161053591815260200190565b506004600082815260376020526040902060040154610100900460ff166005811115610f8657610f86612d8b565b600083815260376020526040902060040154610100900460ff169114610fc05760405163146e540f60e21b815260040161053591906131cf565b5060008581526037602052604090206003015415158590610ffa57604051600162d62c0760e01b0319815260040161053591815260200190565b506000858152603760205260409020611014868287611541565b831561103d5760038101546000818152603760205260409020611038919085611541565b61105a565b6003810154600081815260376020526040902061105a9190611fe0565b505050505050565b61106a611892565b6107458161163c565b600080600083815260376020526040902060040154610100900460ff1660058111156110a1576110a1612d8b565b141592915050565b6000806110b4611f21565b6001600160a01b03166325d9897e846110cb611f45565b6040518363ffffffff1660e01b81526004016110e8929190613389565b61014060405180830381865afa158015611106573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061112a91906133b9565b905061113a8382600001516120d0565b9392505050565b6000611152336035546109bf6119ca565b6109dd3360355461119886868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061216592505050565b86868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506122a592505050565b6000806000339050600061121d88888080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061216592505050565b9050600061126087878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061216592505050565b905061126c82826125a4565b825160208085015160408087015186519387015191870151949592949093926112cb57604051636aba529760e11b81526004810196909652602486019490945260448501929092526064840152608483015260a482015260c401610535565b5050505050506112e0336035546109bf6119ca565b60006113328460026035546112f59190613466565b858d8d8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506122a592505050565b905060006113868560026035546113499190613466565b858c8c8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506122a592505050565b60008381526037602052604080822060039081018490558383528183200185905551919250829184917ffec135a4cf8e5c6e13dea23be058bf03a8bf8f1f6fb0a021b0a5aeddfba8140791a3909a909950975050505050505050565b6000806113ee836125d5565b905060006113fa611f45565b6001600160a01b0316630e022923836040518263ffffffff1660e01b81526004016114259190612e20565b61012060405180830381865afa158015611443573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061146791906132d9565b805190915082906001600160a01b0316611495576040516334789d8b60e21b81526004016105359190612e20565b5060408401516020820151908181146114c357604051630a24cfe560e21b8152600401610535929190613054565b5050519392505050565b60006109dd6114e1368590038501856130fa565b6114f0368590038501856130fa565b6125a4565b6114fd611892565b610745816116ad565b61150e611892565b6001600160a01b038116611538576000604051631e4fbdf760e01b81526004016105359190612e20565b61074581611ec5565b81546007830154600091611562916001600160a01b0390911690849061265e565b60048401805461ff001916610100179055600184015460028501549192506115a2916001600160a01b039091169061159a908461330c565b610d196119ca565b6001830154835460028501546001600160a01b039283169290911690869060008051602061359d833981519152906115db90869061330c565b60405190815260200160405180910390a450505050565b6000807ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a006109e0565b61162361280f565b61074581612834565b61163461280f565b610a1161283c565b6001600160a01b0381166116635760405163616bc44160e11b815260040160405180910390fd5b603480546001600160a01b0319166001600160a01b0383169081179091556040517f51744122301b50e919f4e3d22adf8c53abc92195b8c667eda98c6ef20375672e90600090a250565b806001600160401b03166000036116d75760405163c4411f1160e01b815260040160405180910390fd5b60348054600160a01b600160e01b031916600160a01b6001600160401b038416021790556040517f310462a9bf49fff4a57910ec647c77cbf8aaf2f13394554ac6cdf14fc68db7e69061172b908390612e60565b60405180910390a150565b80670de0b6b3a76400008110156117635760405163033f4e0560e01b815260040161053591815260200190565b5060358190556040518181527f97896b9da0f97f36bf3011570bcff930069299de4b1e89c9cb44909841cac2f89060200161172b565b806207a12063ffffffff821611156117c55760405163432e664360e11b81526004016105359190612cac565b506036805463ffffffff191663ffffffff83161790556040517fc573dc0f869f6a1d0a74fc7712a63baabcb5567131d2d98005e163924eddcbab9061172b908390612cac565b8063ffffffff8116620f4240101561183757604051634e9374fb60e11b81526004016105359190612cac565b506036805463ffffffff60201b1916600160201b63ffffffff848116820292909217928390556040517f7efaf01bec3cda8d104163bb466d01d7e16f68848301c7eb0749cfa59d6805029361172b9392900490911690612cac565b3361189b610dc5565b6001600160a01b031614610a11573360405163118cdaa760e01b81526004016105359190612e20565b60048101805461ff001916610500179055600181015460028201546118f5916001600160a01b031690610d196119ca565b6001810154815460028301546040519081526001600160a01b03928316929091169084907f223103f8eb52e5f43a75655152acd882a605d70df57a5c0fefd30f516b1756d2906020015b60405180910390a45050565b60048101805461ff001916610200179055600281015461197c9061196d6119ca565b6001600160a01b03169061290e565b6001810154815460028301546040519081526001600160a01b03928316929091169084907f2226ebd23625a7938fb786df2248bd171d2e6ad70cb2b654ea1be830ca17224d9060200161193f565b7f000000000000000000000000000000000000000000000000000000000000000090565b80156109a9576040516323b872dd60e01b81526001600160a01b038381166004830152306024830152604482018390528416906323b872dd906064015b6020604051808303816000875af1158015611a4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a6e9190613488565b6109a95760405162461bcd60e51b815260206004820152600960248201526810ba3930b739b332b960b91b6044820152606401610535565b6040516001600160601b0319606084901b166020820152603481018290526000908190605401604051602081830303815290604052805190602001209050611aed81611073565b158190611b105760405163124a23f160e11b815260040161053591815260200190565b506000611b1b611f45565b90506000816001600160a01b0316630e022923876040518263ffffffff1660e01b8152600401611b4b9190612e20565b61012060405180830381865afa158015611b69573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b8d91906132d9565b8051909150866001600160a01b038216611bbb576040516334789d8b60e21b81526004016105359190612e20565b506000611bc6611f21565b6001600160a01b03166325d9897e83866040518363ffffffff1660e01b8152600401611bf3929190613389565b61014060405180830381865afa158015611c11573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c3591906133b9565b8051909150600003611c5a5760405163307efdb760e11b815260040160405180910390fd5b6000611c6a8383600001516120d0565b603454909150600090611c8d90600160a01b90046001600160401b03164261330c565b604080516101208101825287516001600160a01b0390811682528f1660208201529081018d905260006060820152909150608081016001815260200160048152426020808301919091526040808301859052606092830186905260008b815260378352819020845181546001600160a01b039182166001600160a01b0319918216178355938601516001808401805492909316919095161790559084015160028201559183015160038084019190915560808401516004840180549193909260ff19909216918490811115611d6457611d64612d8b565b021790555060a082015160048201805461ff001916610100836005811115611d8e57611d8e612d8b565b021790555060c0820151600582015560e08201516006820155610100909101516007909101558451604080518d81526001600160a01b038d811660208301529181018c90526060810185905260808101849052818f16929091169089907f8a1eccecce948a912e2e195de5960359755aeac90ad88a3fde55a77e1a73796b9060a00160405180910390a450949a9950505050505050505050565b600054815160208084015160409485015185517f32dd026408194a0d7e54cc66a2ab6c856efc55cfcd4dd258fde5b1a55222baa6818501528087019490945260608401919091526080808401919091528451808403909101815260a08301855280519082012061190160f01b60c084015260c283019390935260e28083019390935283518083039093018352610102909101909252805191012090565b6000611ecf611fbc565b80546001600160a01b038481166001600160a01b031983168117845560405193945091169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b6033546000906001600160a01b0316611f715760405163bd088b4f60e01b815260040160405180910390fd5b506033546001600160a01b031690565b80156109a95760405163a9059cbb60e01b81526001600160a01b0383811660048301526024820183905284169063a9059cbb90604401611a2b565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930090565b60048101805461ff00191661030017905560018101546002820154612011916001600160a01b031690610d196119ca565b6001810154815460028301546040519081526001600160a01b03928316929091169084907ff0912efb86ea1d65a17d64d48393cdb1ca0ea5220dd2bbe438621199d30955b79060200161193f565b6001600160a01b0381166120865760405163616bc44160e11b815260040160405180910390fd5b603380546001600160a01b0319166001600160a01b0383169081179091556040517f81dcb738da3dabd5bb2adbc7dd107fbbfca936e9c8aecab25f5b17a710a784c790600090a250565b6000806120db611f21565b6001600160a01b031663561285e4856120f2611f45565b6040518363ffffffff1660e01b815260040161210f929190613389565b60a060405180830381865afa15801561212c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061215091906134a5565b51905061215d818461330c565b949350505050565b6040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a081019190915260016121a460208061330c565b6121ae919061330c565b6121b990606061330c565b82519081149060016121cc60208061330c565b6121d6919061330c565b6121e190606061330c565b909161220257604051633fdf342360e01b8152600401610535929190613054565b505060008060008480602001905181019061221d9190613524565b925092509250600061223086606061296e565b90506000612249876122446020606061330c565b61296e565b9050600061226d88602061225e81606061330c565b612268919061330c565b6129b9565b6040805160c081018252978852602088019690965294860193909352606085019190915260808401525060ff1660a082015292915050565b6000806122b1846113e2565b905060006122bd611f21565b6001600160a01b03166325d9897e836122d4611f45565b6040518363ffffffff1660e01b81526004016122f1929190613389565b61014060405180830381865afa15801561230f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061233391906133b9565b80519091506000036123585760405163307efdb760e11b815260040160405180910390fd5b84516020808701516040808901518151938401949094528201526060808201929092526001600160601b031984831b811660808301529189901b909116609482015260009060a8016040516020818303038152906040528051906020012090506123c181611073565b1581906123e45760405163124a23f160e11b815260040161053591815260200190565b5060006123f58484600001516120d0565b60345490915060009061241890600160a01b90046001600160401b03164261330c565b60408051610120810182526001600160a01b0380891682528d1660208201529081018b9052600060608201529091506080810160028152602001600481524260208083019190915260408083018590526060928301869052600087815260378352819020845181546001600160a01b039182166001600160a01b0319918216178355938601516001808401805492909316919095161790559084015160028201559183015160038084019190915560808401516004840180549193909260ff199092169184908111156124ed576124ed612d8b565b021790555060a082015160048201805461ff00191661010083600581111561251757612517612d8b565b021790555060c0820151816005015560e082015181600601556101008201518160070155905050896001600160a01b0316856001600160a01b0316847ffb70faf7306b83c2cec6d8c1627baad892cb79968a02cc0353174499ecfd8b358c8c604001518c878960405161258e959493929190613552565b60405180910390a4509098975050505050505050565b805182516000911480156125bf575081604001518360400151145b80156109dd575050602090810151910151141590565b60408051606081018252825181526020808401519082015282820151918101919091526000908161260582611e28565b905061215d81856060015186608001518760a0015160405160200161264a93929190928352602083019190915260f81b6001600160f81b031916604082015260410190565b604051602081830303815290604052612a04565b600080612669611f45565b90506000612675611f21565b6001600160a01b03166325d9897e87846040518363ffffffff1660e01b81526004016126a2929190613389565b61014060405180830381865afa1580156126c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126e491906133b9565b60365490915060009061270990869063ffffffff600160201b909104811690612a2e16565b9050851580159061271a5750808611155b8682909161273d5760405163cc6b7c4160e01b8152600401610535929190613054565b5050600061274f878460000151612a8e565b60608401516036549192506000916127709163ffffffff9081169116612a8e565b9050600061277e8284612a2e565b9050856001600160a01b031663cb8347fe8b8b846040516020016127a3929190613054565b6040516020818303038152906040526040518363ffffffff1660e01b81526004016127cf929190613365565b600060405180830381600087803b1580156127e957600080fd5b505af11580156127fd573d6000803e3d6000fd5b50929c9b505050505050505050505050565b612817612aa5565b610a1157604051631afcd79f60e31b815260040160405180910390fd5b61150e61280f565b61284461280f565b604080517fd87cd6ef79d4e2b95e15ce8abf732db51ec771f1ca2edccf22a46c729ac5647260208201527f171a7fa058648750a8c5aae430f30db8d0100efc3a5e1b2e8054b1c1ce28b6b4918101919091527f044852b2a670ade5407e78fb2863c51de9fcb96542a07186fe3aeda6bb8a116d60608201524660808201523060a08201527fa070ffb1cd7409649bf77822cce74495468e06dbfaef09556838bf188679b9c260c082015260e00160408051601f198184030181529190528051602090910120600055565b801561296a57604051630852cd8d60e31b8152600481018290526001600160a01b038316906342966c6890602401600060405180830381600087803b15801561295657600080fd5b505af115801561105a573d6000803e3d6000fd5b5050565b600061297b60208361330c565b8351908110159061298d60208561330c565b90916129ae57604051633fdf342360e01b8152600401610535929190613054565b505050016020015190565b60006129c660018361330c565b835190811015906129d860018561330c565b90916129f957604051633fdf342360e01b8152600401610535929190613054565b505050016001015190565b600080600080612a148686612abf565b925092509250612a248282612b0c565b5090949350505050565b6000612a3d83620f4240101590565b80612a505750612a5082620f4240101590565b83839091612a735760405163768bf0eb60e11b8152600401610535929190613054565b50620f42409050612a848385613585565b6109dd9190613466565b600081831115612a9e57816109dd565b5090919050565b6000612aaf6115f2565b54600160401b900460ff16919050565b60008060008351604103612af95760208401516040850151606086015160001a612aeb88828585612bc5565b955095509550505050612b05565b50508151600091506002905b9250925092565b6000826003811115612b2057612b20612d8b565b03612b29575050565b6001826003811115612b3d57612b3d612d8b565b03612b5b5760405163f645eedf60e01b815260040160405180910390fd5b6002826003811115612b6f57612b6f612d8b565b03612b905760405163fce698f760e01b815260048101829052602401610535565b6003826003811115612ba457612ba4612d8b565b0361296a576040516335e2f38360e21b815260048101829052602401610535565b600080806fa2a8918ca85bafe22016d0b997e4df60600160ff1b03841115612bf65750600091506003905082612c80565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa158015612c4a573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116612c7657506000925060019150829050612c80565b9250600091508190505b9450945094915050565b60008060408385031215612c9d57600080fd5b50508035926020909101359150565b63ffffffff91909116815260200190565b6001600160a01b038116811461074557600080fd5b6001600160401b038116811461074557600080fd5b63ffffffff8116811461074557600080fd5b60008060008060008060c08789031215612d1257600080fd5b8635612d1d81612cbd565b95506020870135612d2d81612cbd565b94506040870135612d3d81612cd2565b9350606087013592506080870135612d5481612ce7565b915060a0870135612d6481612ce7565b809150509295509295509295565b600060208284031215612d8457600080fd5b5035919050565b634e487b7160e01b600052602160045260246000fd5b60068110612db157612db1612d8b565b9052565b6001600160a01b038a81168252891660208201526040810188905260608101879052610120810160048710612dec57612dec612d8b565b866080830152612dff60a0830187612da1565b8460c08301528360e0830152826101008301529a9950505050505050505050565b6001600160a01b0391909116815260200190565b60008060408385031215612e4757600080fd5b8235612e5281612cbd565b946020939093013593505050565b6001600160401b0391909116815260200190565b60006060828403128015612e8757600080fd5b509092915050565b600060208284031215612ea157600080fd5b813561113a81612ce7565b60008060008060808587031215612ec257600080fd5b8435612ecd81612cbd565b93506020850135612edd81612cbd565b93969395505050506040820135916060013590565b600060208284031215612f0457600080fd5b813561113a81612cbd565b801515811461074557600080fd5b60008060008060808587031215612f3357600080fd5b84359350602085013592506040850135612f4c81612f0f565b9396929550929360600135925050565b60008083601f840112612f6e57600080fd5b5081356001600160401b03811115612f8557600080fd5b602083019150836020828501011115612f9d57600080fd5b9250929050565b60008060208385031215612fb757600080fd5b82356001600160401b03811115612fcd57600080fd5b612fd985828601612f5c565b90969095509350505050565b60008060008060408587031215612ffb57600080fd5b84356001600160401b0381111561301157600080fd5b61301d87828801612f5c565b90955093505060208501356001600160401b0381111561303c57600080fd5b61304887828801612f5c565b95989497509550505050565b918252602082015260400190565b60405160c081016001600160401b038111828210171561309257634e487b7160e01b600052604160045260246000fd5b60405290565b60405161012081016001600160401b038111828210171561309257634e487b7160e01b600052604160045260246000fd5b60405161014081016001600160401b038111828210171561309257634e487b7160e01b600052604160045260246000fd5b600060c082840312801561310d57600080fd5b506000613118613062565b833581526020808501359082015260408085013590820152606080850135908201526080808501359082015260a084013560ff81168114613157578283fd5b60a0820152949350505050565b600060c0828403121561317657600080fd5b50919050565b600080610180838503121561319057600080fd5b61319a8484613164565b91506131a98460c08501613164565b90509250929050565b6000602082840312156131c457600080fd5b813561113a81612cd2565b602081016109e08284612da1565b600060608284031280156131f057600080fd5b50604051600090606081016001600160401b038111828210171561322257634e487b7160e01b83526041600452602483fd5b604090815284358252602080860135908301529384013593810193909352509092915050565b805161325381612cbd565b919050565b6000610120828403121561326b57600080fd5b613273613098565b905061327e82613248565b81526020828101519082015260408083015190820152606080830151908201526080808301519082015260a0808301519082015260c0808301519082015260e080830151908201526101009182015191810191909152919050565b600061012082840312156132ec57600080fd5b6109dd8383613258565b634e487b7160e01b600052601160045260246000fd5b808201808211156109e0576109e06132f6565b6000815180845260005b8181101561334557602081850181015186830182015201613329565b506000602082860101526020601f19601f83011685010191505092915050565b6001600160a01b038316815260406020820181905260009061215d9083018461331f565b6001600160a01b0392831681529116602082015260400190565b805161325381612ce7565b805161325381612cd2565b60006101408284031280156133cd57600080fd5b5060006133d86130c9565b8351815260208085015190820152604080850151908201526133fc606085016133a3565b606082015261340d608085016133ae565b608082015261341e60a085016133ae565b60a082015261342f60c085016133a3565b60c082015261344060e085016133ae565b60e082015261010084810151908201526101209384015193810193909352509092915050565b60008261348357634e487b7160e01b600052601260045260246000fd5b500490565b60006020828403121561349a57600080fd5b815161113a81612f0f565b600060a08284031280156134b857600080fd5b5060405160009060a081016001600160401b03811182821017156134ea57634e487b7160e01b83526041600452602483fd5b6040908152845182526020808601519083015284810151908201526060808501519082015260809384015193810193909352509092915050565b60008060006060848603121561353957600080fd5b5050815160208301516040909301519094929350919050565b85815284602082015260a06040820152600061357160a083018661331f565b606083019490945250608001529392505050565b80820281158282048414176109e0576109e06132f656fe6d800aaaf64b9a1f321dcd63da04369d33d8a0d49ad0fbba085aab4a98bf31c4a2646970667358221220d50b3dec1e5d2d1d140733dca7d5163900c1fc882947b3208864910c6f452d0e64736f6c634300081b0033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101a15760003560e01c8063050b17ad146101a65780630533e1ba146101bb5780630bc7344b146101e857806311be1997146101fb578063169729781461027857806317337b461461028b5780631792f1941461029557806326058249146102a857806329e03ff1146102c857806336167e03146102df5780634bc5839a146102f25780635aea0ec4146103055780635bf31d4d146103265780636369df6b146103405780636cc6cde114610353578063715018a61461036657806376c993ae1461036e5780638d4e9008146103815780638da5cb5b14610394578063902a49381461039c5780639334ea52146103ac57806393a90a1e146103bf5780639f81a7cf146103d2578063b0e2f7e9146103e5578063b0eefabe146103f8578063bb2a2b471461040b578063be41f38414610419578063c133b4291461043c578063c50a77b11461044f578063c894222e14610462578063c9747f5114610483578063cc2d55cd14610496578063d36fc9d4146104a5578063d76f62d1146104b8578063f2fde38b146104cb575b600080fd5b6101b96101b4366004612c8a565b6104de565b005b6036546101d290600160201b900463ffffffff1681565b6040516101df9190612cac565b60405180910390f35b6101b96101f6366004612cf9565b6105fc565b610263610209366004612d72565b603760205260009081526040902080546001820154600283015460038401546004850154600586015460068701546007909701546001600160a01b039687169796909516959394929360ff80841694610100909404169289565b6040516101df99989796959493929190612db5565b6101b9610286366004612d72565b610734565b6101d26207a12081565b6101b96102a3366004612d72565b610748565b6033546102bb906001600160a01b031681565b6040516101df9190612e20565b6102d160355481565b6040519081526020016101df565b6101b96102ed366004612d72565b6108a8565b6102d1610300366004612e34565b6109ae565b603454600160a01b90046001600160401b03165b6040516101df9190612e60565b60345461031990600160a01b90046001600160401b031681565b6102d161034e366004612e74565b6109e6565b6034546102bb906001600160a01b031681565b6101b96109ff565b6101b961037c366004612e8f565b610a13565b6102d161038f366004612eac565b610a24565b6102bb610dc5565b6036546101d29063ffffffff1681565b6101b96103ba366004612d72565b610de0565b6101b96103cd366004612ef2565b610edf565b6101b96103e0366004612e8f565b610ef0565b6101b96103f3366004612f1d565b610f01565b6101b9610406366004612ef2565b611062565b60365463ffffffff166101d2565b61042c610427366004612d72565b611073565b60405190151581526020016101df565b6102d161044a366004612ef2565b6110a9565b6102d161045d366004612fa4565b611141565b610475610470366004612fe5565b6111d4565b6040516101df929190613054565b6102bb6104913660046130fa565b6113e2565b6102d1670de0b6b3a764000081565b61042c6104b336600461317c565b6114cd565b6101b96104c63660046131b2565b6114f5565b6101b96104d9366004612ef2565b611506565b6034546001600160a01b031633146105095760405163a8baf3bb60e01b815260040160405180910390fd5b8161051381611073565b819061053e576040516314a03bbd60e21b815260040161053591815260200190565b60405180910390fd5b506004600082815260376020526040902060040154610100900460ff16600581111561056c5761056c612d8b565b600083815260376020526040902060040154610100900460ff1691146105a65760405163146e540f60e21b815260040161053591906131cf565b506000838152603760205260409020600301548390156105dc576040516364d0c32b60e01b815260040161053591815260200190565b5060008381526037602052604090206105f6848285611541565b50505050565b60006106066115f2565b805490915060ff600160401b82041615906001600160401b031660008115801561062d5750825b90506000826001600160401b031660011480156106495750303b155b905081158015610657575080155b156106755760405163f92ee8a960e01b815260040160405180910390fd5b84546001600160401b0319166001178555831561069e57845460ff60401b1916600160401b1785555b6106a78b61161b565b6106af61162c565b6106b88a61163c565b6106c1896116ad565b6106ca88611736565b6106d387611799565b6106dc8661180b565b831561072757845460ff60401b191685556040517fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29061071e90600190612e60565b60405180910390a15b5050505050505050505050565b61073c611892565b61074581611736565b50565b8061075281611073565b8190610774576040516314a03bbd60e21b815260040161053591815260200190565b506000818152603760205260409020600101546001600160a01b031633146107af5760405163082c005560e41b815260040160405180910390fd5b816107b981611073565b81906107db576040516314a03bbd60e21b815260040161053591815260200190565b506004600082815260376020526040902060040154610100900460ff16600581111561080957610809612d8b565b600083815260376020526040902060040154610100900460ff1691146108435760405163146e540f60e21b815260040161053591906131cf565b506000838152603760205260409020600681015442101561087757604051631d7753d560e11b815260040160405180910390fd5b61088184826118c4565b6003810154156105f657600381015460008181526037602052604090206105f691906118c4565b6034546001600160a01b031633146108d35760405163a8baf3bb60e01b815260040160405180910390fd5b806108dd81611073565b81906108ff576040516314a03bbd60e21b815260040161053591815260200190565b506004600082815260376020526040902060040154610100900460ff16600581111561092d5761092d612d8b565b600083815260376020526040902060040154610100900460ff1691146109675760405163146e540f60e21b815260040161053591906131cf565b506000828152603760205260409020600381015483901561099e576040516364d0c32b60e01b815260040161053591815260200190565b506109a9838261194b565b505050565b60006109cf336035546109bf6119ca565b6001600160a01b031691906119ee565b6109dd336035548585611aa6565b90505b92915050565b60006109e06109fa368490038401846131dd565b611e28565b610a07611892565b610a116000611ec5565b565b610a1b611892565b61074581611799565b6034546000906001600160a01b03163314610a525760405163a8baf3bb60e01b815260040160405180910390fd5b6040516001600160601b0319606087901b166020820152656c656761637960d01b6034820152600090603a016040516020818303038152906040528051906020012090506000610aa0611f21565b6001600160a01b0316630e022923886040518263ffffffff1660e01b8152600401610acb9190612e20565b61012060405180830381865afa158015610ae9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b0d91906132d9565b519050866001600160a01b038216610b39576040516334789d8b60e21b81526004016105359190612e20565b5060408051610120810182526001600160a01b038381168252881660208201526000918101829052606081019190915260036080820152600160a08201524260c0820181905260345460e0830191610ba191600160a01b90046001600160401b03169061330c565b81526000602091820181905284815260378252604090819020835181546001600160a01b039182166001600160a01b0319918216178355938501516001808401805492909316919095161790559083015160028201556060830151600380830191909155608084015160048301805493949193909260ff1990911691908490811115610c2f57610c2f612d8b565b021790555060a082015160048201805461ff001916610100836005811115610c5957610c59612d8b565b021790555060c0820151600582015560e08201516006820155610100909101516007909101556000610c89611f45565b9050806001600160a01b031663cb8347fe838888604051602001610cae929190613054565b6040516020818303038152906040526040518363ffffffff1660e01b8152600401610cda929190613365565b600060405180830381600087803b158015610cf457600080fd5b505af1158015610d08573d6000803e3d6000fd5b50505050610d298786610d196119ca565b6001600160a01b03169190611f81565b604080516001600160a01b038a81168252602082018990529181018790528189169184169085907f587a1fc7e80e653a2ab7f63f98c080f5818b8cedcfd1374590c8c786290ed0319060600160405180910390a4866001600160a01b0316826001600160a01b03168460008051602061359d83398151915288604051610db191815260200190565b60405180910390a450909695505050505050565b600080610dd0611fbc565b546001600160a01b031692915050565b6034546001600160a01b03163314610e0b5760405163a8baf3bb60e01b815260040160405180910390fd5b80610e1581611073565b8190610e37576040516314a03bbd60e21b815260040161053591815260200190565b506004600082815260376020526040902060040154610100900460ff166005811115610e6557610e65612d8b565b600083815260376020526040902060040154610100900460ff169114610e9f5760405163146e540f60e21b815260040161053591906131cf565b506000828152603760205260409020610eb88382611fe0565b6003810154156109a957600381015460008181526037602052604090206109a99190611fe0565b610ee7611892565b6107458161205f565b610ef8611892565b6107458161180b565b6034546001600160a01b03163314610f2c5760405163a8baf3bb60e01b815260040160405180910390fd5b83610f3681611073565b8190610f58576040516314a03bbd60e21b815260040161053591815260200190565b506004600082815260376020526040902060040154610100900460ff166005811115610f8657610f86612d8b565b600083815260376020526040902060040154610100900460ff169114610fc05760405163146e540f60e21b815260040161053591906131cf565b5060008581526037602052604090206003015415158590610ffa57604051600162d62c0760e01b0319815260040161053591815260200190565b506000858152603760205260409020611014868287611541565b831561103d5760038101546000818152603760205260409020611038919085611541565b61105a565b6003810154600081815260376020526040902061105a9190611fe0565b505050505050565b61106a611892565b6107458161163c565b600080600083815260376020526040902060040154610100900460ff1660058111156110a1576110a1612d8b565b141592915050565b6000806110b4611f21565b6001600160a01b03166325d9897e846110cb611f45565b6040518363ffffffff1660e01b81526004016110e8929190613389565b61014060405180830381865afa158015611106573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061112a91906133b9565b905061113a8382600001516120d0565b9392505050565b6000611152336035546109bf6119ca565b6109dd3360355461119886868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061216592505050565b86868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506122a592505050565b6000806000339050600061121d88888080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061216592505050565b9050600061126087878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061216592505050565b905061126c82826125a4565b825160208085015160408087015186519387015191870151949592949093926112cb57604051636aba529760e11b81526004810196909652602486019490945260448501929092526064840152608483015260a482015260c401610535565b5050505050506112e0336035546109bf6119ca565b60006113328460026035546112f59190613466565b858d8d8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506122a592505050565b905060006113868560026035546113499190613466565b858c8c8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506122a592505050565b60008381526037602052604080822060039081018490558383528183200185905551919250829184917ffec135a4cf8e5c6e13dea23be058bf03a8bf8f1f6fb0a021b0a5aeddfba8140791a3909a909950975050505050505050565b6000806113ee836125d5565b905060006113fa611f45565b6001600160a01b0316630e022923836040518263ffffffff1660e01b81526004016114259190612e20565b61012060405180830381865afa158015611443573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061146791906132d9565b805190915082906001600160a01b0316611495576040516334789d8b60e21b81526004016105359190612e20565b5060408401516020820151908181146114c357604051630a24cfe560e21b8152600401610535929190613054565b5050519392505050565b60006109dd6114e1368590038501856130fa565b6114f0368590038501856130fa565b6125a4565b6114fd611892565b610745816116ad565b61150e611892565b6001600160a01b038116611538576000604051631e4fbdf760e01b81526004016105359190612e20565b61074581611ec5565b81546007830154600091611562916001600160a01b0390911690849061265e565b60048401805461ff001916610100179055600184015460028501549192506115a2916001600160a01b039091169061159a908461330c565b610d196119ca565b6001830154835460028501546001600160a01b039283169290911690869060008051602061359d833981519152906115db90869061330c565b60405190815260200160405180910390a450505050565b6000807ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a006109e0565b61162361280f565b61074581612834565b61163461280f565b610a1161283c565b6001600160a01b0381166116635760405163616bc44160e11b815260040160405180910390fd5b603480546001600160a01b0319166001600160a01b0383169081179091556040517f51744122301b50e919f4e3d22adf8c53abc92195b8c667eda98c6ef20375672e90600090a250565b806001600160401b03166000036116d75760405163c4411f1160e01b815260040160405180910390fd5b60348054600160a01b600160e01b031916600160a01b6001600160401b038416021790556040517f310462a9bf49fff4a57910ec647c77cbf8aaf2f13394554ac6cdf14fc68db7e69061172b908390612e60565b60405180910390a150565b80670de0b6b3a76400008110156117635760405163033f4e0560e01b815260040161053591815260200190565b5060358190556040518181527f97896b9da0f97f36bf3011570bcff930069299de4b1e89c9cb44909841cac2f89060200161172b565b806207a12063ffffffff821611156117c55760405163432e664360e11b81526004016105359190612cac565b506036805463ffffffff191663ffffffff83161790556040517fc573dc0f869f6a1d0a74fc7712a63baabcb5567131d2d98005e163924eddcbab9061172b908390612cac565b8063ffffffff8116620f4240101561183757604051634e9374fb60e11b81526004016105359190612cac565b506036805463ffffffff60201b1916600160201b63ffffffff848116820292909217928390556040517f7efaf01bec3cda8d104163bb466d01d7e16f68848301c7eb0749cfa59d6805029361172b9392900490911690612cac565b3361189b610dc5565b6001600160a01b031614610a11573360405163118cdaa760e01b81526004016105359190612e20565b60048101805461ff001916610500179055600181015460028201546118f5916001600160a01b031690610d196119ca565b6001810154815460028301546040519081526001600160a01b03928316929091169084907f223103f8eb52e5f43a75655152acd882a605d70df57a5c0fefd30f516b1756d2906020015b60405180910390a45050565b60048101805461ff001916610200179055600281015461197c9061196d6119ca565b6001600160a01b03169061290e565b6001810154815460028301546040519081526001600160a01b03928316929091169084907f2226ebd23625a7938fb786df2248bd171d2e6ad70cb2b654ea1be830ca17224d9060200161193f565b7f000000000000000000000000000000000000000000000000000000000000000090565b80156109a9576040516323b872dd60e01b81526001600160a01b038381166004830152306024830152604482018390528416906323b872dd906064015b6020604051808303816000875af1158015611a4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a6e9190613488565b6109a95760405162461bcd60e51b815260206004820152600960248201526810ba3930b739b332b960b91b6044820152606401610535565b6040516001600160601b0319606084901b166020820152603481018290526000908190605401604051602081830303815290604052805190602001209050611aed81611073565b158190611b105760405163124a23f160e11b815260040161053591815260200190565b506000611b1b611f45565b90506000816001600160a01b0316630e022923876040518263ffffffff1660e01b8152600401611b4b9190612e20565b61012060405180830381865afa158015611b69573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b8d91906132d9565b8051909150866001600160a01b038216611bbb576040516334789d8b60e21b81526004016105359190612e20565b506000611bc6611f21565b6001600160a01b03166325d9897e83866040518363ffffffff1660e01b8152600401611bf3929190613389565b61014060405180830381865afa158015611c11573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c3591906133b9565b8051909150600003611c5a5760405163307efdb760e11b815260040160405180910390fd5b6000611c6a8383600001516120d0565b603454909150600090611c8d90600160a01b90046001600160401b03164261330c565b604080516101208101825287516001600160a01b0390811682528f1660208201529081018d905260006060820152909150608081016001815260200160048152426020808301919091526040808301859052606092830186905260008b815260378352819020845181546001600160a01b039182166001600160a01b0319918216178355938601516001808401805492909316919095161790559084015160028201559183015160038084019190915560808401516004840180549193909260ff19909216918490811115611d6457611d64612d8b565b021790555060a082015160048201805461ff001916610100836005811115611d8e57611d8e612d8b565b021790555060c0820151600582015560e08201516006820155610100909101516007909101558451604080518d81526001600160a01b038d811660208301529181018c90526060810185905260808101849052818f16929091169089907f8a1eccecce948a912e2e195de5960359755aeac90ad88a3fde55a77e1a73796b9060a00160405180910390a450949a9950505050505050505050565b600054815160208084015160409485015185517f32dd026408194a0d7e54cc66a2ab6c856efc55cfcd4dd258fde5b1a55222baa6818501528087019490945260608401919091526080808401919091528451808403909101815260a08301855280519082012061190160f01b60c084015260c283019390935260e28083019390935283518083039093018352610102909101909252805191012090565b6000611ecf611fbc565b80546001600160a01b038481166001600160a01b031983168117845560405193945091169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b6033546000906001600160a01b0316611f715760405163bd088b4f60e01b815260040160405180910390fd5b506033546001600160a01b031690565b80156109a95760405163a9059cbb60e01b81526001600160a01b0383811660048301526024820183905284169063a9059cbb90604401611a2b565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930090565b60048101805461ff00191661030017905560018101546002820154612011916001600160a01b031690610d196119ca565b6001810154815460028301546040519081526001600160a01b03928316929091169084907ff0912efb86ea1d65a17d64d48393cdb1ca0ea5220dd2bbe438621199d30955b79060200161193f565b6001600160a01b0381166120865760405163616bc44160e11b815260040160405180910390fd5b603380546001600160a01b0319166001600160a01b0383169081179091556040517f81dcb738da3dabd5bb2adbc7dd107fbbfca936e9c8aecab25f5b17a710a784c790600090a250565b6000806120db611f21565b6001600160a01b031663561285e4856120f2611f45565b6040518363ffffffff1660e01b815260040161210f929190613389565b60a060405180830381865afa15801561212c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061215091906134a5565b51905061215d818461330c565b949350505050565b6040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a081019190915260016121a460208061330c565b6121ae919061330c565b6121b990606061330c565b82519081149060016121cc60208061330c565b6121d6919061330c565b6121e190606061330c565b909161220257604051633fdf342360e01b8152600401610535929190613054565b505060008060008480602001905181019061221d9190613524565b925092509250600061223086606061296e565b90506000612249876122446020606061330c565b61296e565b9050600061226d88602061225e81606061330c565b612268919061330c565b6129b9565b6040805160c081018252978852602088019690965294860193909352606085019190915260808401525060ff1660a082015292915050565b6000806122b1846113e2565b905060006122bd611f21565b6001600160a01b03166325d9897e836122d4611f45565b6040518363ffffffff1660e01b81526004016122f1929190613389565b61014060405180830381865afa15801561230f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061233391906133b9565b80519091506000036123585760405163307efdb760e11b815260040160405180910390fd5b84516020808701516040808901518151938401949094528201526060808201929092526001600160601b031984831b811660808301529189901b909116609482015260009060a8016040516020818303038152906040528051906020012090506123c181611073565b1581906123e45760405163124a23f160e11b815260040161053591815260200190565b5060006123f58484600001516120d0565b60345490915060009061241890600160a01b90046001600160401b03164261330c565b60408051610120810182526001600160a01b0380891682528d1660208201529081018b9052600060608201529091506080810160028152602001600481524260208083019190915260408083018590526060928301869052600087815260378352819020845181546001600160a01b039182166001600160a01b0319918216178355938601516001808401805492909316919095161790559084015160028201559183015160038084019190915560808401516004840180549193909260ff199092169184908111156124ed576124ed612d8b565b021790555060a082015160048201805461ff00191661010083600581111561251757612517612d8b565b021790555060c0820151816005015560e082015181600601556101008201518160070155905050896001600160a01b0316856001600160a01b0316847ffb70faf7306b83c2cec6d8c1627baad892cb79968a02cc0353174499ecfd8b358c8c604001518c878960405161258e959493929190613552565b60405180910390a4509098975050505050505050565b805182516000911480156125bf575081604001518360400151145b80156109dd575050602090810151910151141590565b60408051606081018252825181526020808401519082015282820151918101919091526000908161260582611e28565b905061215d81856060015186608001518760a0015160405160200161264a93929190928352602083019190915260f81b6001600160f81b031916604082015260410190565b604051602081830303815290604052612a04565b600080612669611f45565b90506000612675611f21565b6001600160a01b03166325d9897e87846040518363ffffffff1660e01b81526004016126a2929190613389565b61014060405180830381865afa1580156126c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126e491906133b9565b60365490915060009061270990869063ffffffff600160201b909104811690612a2e16565b9050851580159061271a5750808611155b8682909161273d5760405163cc6b7c4160e01b8152600401610535929190613054565b5050600061274f878460000151612a8e565b60608401516036549192506000916127709163ffffffff9081169116612a8e565b9050600061277e8284612a2e565b9050856001600160a01b031663cb8347fe8b8b846040516020016127a3929190613054565b6040516020818303038152906040526040518363ffffffff1660e01b81526004016127cf929190613365565b600060405180830381600087803b1580156127e957600080fd5b505af11580156127fd573d6000803e3d6000fd5b50929c9b505050505050505050505050565b612817612aa5565b610a1157604051631afcd79f60e31b815260040160405180910390fd5b61150e61280f565b61284461280f565b604080517fd87cd6ef79d4e2b95e15ce8abf732db51ec771f1ca2edccf22a46c729ac5647260208201527f171a7fa058648750a8c5aae430f30db8d0100efc3a5e1b2e8054b1c1ce28b6b4918101919091527f044852b2a670ade5407e78fb2863c51de9fcb96542a07186fe3aeda6bb8a116d60608201524660808201523060a08201527fa070ffb1cd7409649bf77822cce74495468e06dbfaef09556838bf188679b9c260c082015260e00160408051601f198184030181529190528051602090910120600055565b801561296a57604051630852cd8d60e31b8152600481018290526001600160a01b038316906342966c6890602401600060405180830381600087803b15801561295657600080fd5b505af115801561105a573d6000803e3d6000fd5b5050565b600061297b60208361330c565b8351908110159061298d60208561330c565b90916129ae57604051633fdf342360e01b8152600401610535929190613054565b505050016020015190565b60006129c660018361330c565b835190811015906129d860018561330c565b90916129f957604051633fdf342360e01b8152600401610535929190613054565b505050016001015190565b600080600080612a148686612abf565b925092509250612a248282612b0c565b5090949350505050565b6000612a3d83620f4240101590565b80612a505750612a5082620f4240101590565b83839091612a735760405163768bf0eb60e11b8152600401610535929190613054565b50620f42409050612a848385613585565b6109dd9190613466565b600081831115612a9e57816109dd565b5090919050565b6000612aaf6115f2565b54600160401b900460ff16919050565b60008060008351604103612af95760208401516040850151606086015160001a612aeb88828585612bc5565b955095509550505050612b05565b50508151600091506002905b9250925092565b6000826003811115612b2057612b20612d8b565b03612b29575050565b6001826003811115612b3d57612b3d612d8b565b03612b5b5760405163f645eedf60e01b815260040160405180910390fd5b6002826003811115612b6f57612b6f612d8b565b03612b905760405163fce698f760e01b815260048101829052602401610535565b6003826003811115612ba457612ba4612d8b565b0361296a576040516335e2f38360e21b815260048101829052602401610535565b600080806fa2a8918ca85bafe22016d0b997e4df60600160ff1b03841115612bf65750600091506003905082612c80565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa158015612c4a573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116612c7657506000925060019150829050612c80565b9250600091508190505b9450945094915050565b60008060408385031215612c9d57600080fd5b50508035926020909101359150565b63ffffffff91909116815260200190565b6001600160a01b038116811461074557600080fd5b6001600160401b038116811461074557600080fd5b63ffffffff8116811461074557600080fd5b60008060008060008060c08789031215612d1257600080fd5b8635612d1d81612cbd565b95506020870135612d2d81612cbd565b94506040870135612d3d81612cd2565b9350606087013592506080870135612d5481612ce7565b915060a0870135612d6481612ce7565b809150509295509295509295565b600060208284031215612d8457600080fd5b5035919050565b634e487b7160e01b600052602160045260246000fd5b60068110612db157612db1612d8b565b9052565b6001600160a01b038a81168252891660208201526040810188905260608101879052610120810160048710612dec57612dec612d8b565b866080830152612dff60a0830187612da1565b8460c08301528360e0830152826101008301529a9950505050505050505050565b6001600160a01b0391909116815260200190565b60008060408385031215612e4757600080fd5b8235612e5281612cbd565b946020939093013593505050565b6001600160401b0391909116815260200190565b60006060828403128015612e8757600080fd5b509092915050565b600060208284031215612ea157600080fd5b813561113a81612ce7565b60008060008060808587031215612ec257600080fd5b8435612ecd81612cbd565b93506020850135612edd81612cbd565b93969395505050506040820135916060013590565b600060208284031215612f0457600080fd5b813561113a81612cbd565b801515811461074557600080fd5b60008060008060808587031215612f3357600080fd5b84359350602085013592506040850135612f4c81612f0f565b9396929550929360600135925050565b60008083601f840112612f6e57600080fd5b5081356001600160401b03811115612f8557600080fd5b602083019150836020828501011115612f9d57600080fd5b9250929050565b60008060208385031215612fb757600080fd5b82356001600160401b03811115612fcd57600080fd5b612fd985828601612f5c565b90969095509350505050565b60008060008060408587031215612ffb57600080fd5b84356001600160401b0381111561301157600080fd5b61301d87828801612f5c565b90955093505060208501356001600160401b0381111561303c57600080fd5b61304887828801612f5c565b95989497509550505050565b918252602082015260400190565b60405160c081016001600160401b038111828210171561309257634e487b7160e01b600052604160045260246000fd5b60405290565b60405161012081016001600160401b038111828210171561309257634e487b7160e01b600052604160045260246000fd5b60405161014081016001600160401b038111828210171561309257634e487b7160e01b600052604160045260246000fd5b600060c082840312801561310d57600080fd5b506000613118613062565b833581526020808501359082015260408085013590820152606080850135908201526080808501359082015260a084013560ff81168114613157578283fd5b60a0820152949350505050565b600060c0828403121561317657600080fd5b50919050565b600080610180838503121561319057600080fd5b61319a8484613164565b91506131a98460c08501613164565b90509250929050565b6000602082840312156131c457600080fd5b813561113a81612cd2565b602081016109e08284612da1565b600060608284031280156131f057600080fd5b50604051600090606081016001600160401b038111828210171561322257634e487b7160e01b83526041600452602483fd5b604090815284358252602080860135908301529384013593810193909352509092915050565b805161325381612cbd565b919050565b6000610120828403121561326b57600080fd5b613273613098565b905061327e82613248565b81526020828101519082015260408083015190820152606080830151908201526080808301519082015260a0808301519082015260c0808301519082015260e080830151908201526101009182015191810191909152919050565b600061012082840312156132ec57600080fd5b6109dd8383613258565b634e487b7160e01b600052601160045260246000fd5b808201808211156109e0576109e06132f6565b6000815180845260005b8181101561334557602081850181015186830182015201613329565b506000602082860101526020601f19601f83011685010191505092915050565b6001600160a01b038316815260406020820181905260009061215d9083018461331f565b6001600160a01b0392831681529116602082015260400190565b805161325381612ce7565b805161325381612cd2565b60006101408284031280156133cd57600080fd5b5060006133d86130c9565b8351815260208085015190820152604080850151908201526133fc606085016133a3565b606082015261340d608085016133ae565b608082015261341e60a085016133ae565b60a082015261342f60c085016133a3565b60c082015261344060e085016133ae565b60e082015261010084810151908201526101209384015193810193909352509092915050565b60008261348357634e487b7160e01b600052601260045260246000fd5b500490565b60006020828403121561349a57600080fd5b815161113a81612f0f565b600060a08284031280156134b857600080fd5b5060405160009060a081016001600160401b03811182821017156134ea57634e487b7160e01b83526041600452602483fd5b6040908152845182526020808601519083015284810151908201526060808501519082015260809384015193810193909352509092915050565b60008060006060848603121561353957600080fd5b5050815160208301516040909301519094929350919050565b85815284602082015260a06040820152600061357160a083018661331f565b606083019490945250608001529392505050565b80820281158282048414176109e0576109e06132f656fe6d800aaaf64b9a1f321dcd63da04369d33d8a0d49ad0fbba085aab4a98bf31c4a2646970667358221220d50b3dec1e5d2d1d140733dca7d5163900c1fc882947b3208864910c6f452d0e64736f6c634300081b0033", + "linkReferences": {}, + "deployedLinkReferences": {} +} \ No newline at end of file diff --git a/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/DisputeManager#DisputeManagerProxy.json b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/DisputeManager#DisputeManagerProxy.json new file mode 100644 index 000000000..5f5b5ea19 --- /dev/null +++ b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/DisputeManager#DisputeManagerProxy.json @@ -0,0 +1,116 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "TransparentUpgradeableProxy", + "sourceName": "contracts/proxy/transparent/TransparentUpgradeableProxy.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "initialOwner", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + } + ], + "name": "AddressEmptyCode", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "admin", + "type": "address" + } + ], + "name": "ERC1967InvalidAdmin", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "ERC1967InvalidImplementation", + "type": "error" + }, + { + "inputs": [], + "name": "ERC1967NonPayable", + "type": "error" + }, + { + "inputs": [], + "name": "FailedCall", + "type": "error" + }, + { + "inputs": [], + "name": "ProxyDeniedAdminAccess", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + } + ], + "bytecode": "0x60a060405260405162000e5038038062000e508339810160408190526200002691620003bc565b828162000034828262000099565b50508160405162000045906200035a565b6001600160a01b039091168152602001604051809103905ff0801580156200006f573d5f803e3d5ffd5b506001600160a01b0316608052620000906200008a60805190565b620000fe565b505050620004b3565b620000a4826200016f565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b905f90a2805115620000f057620000eb8282620001ee565b505050565b620000fa62000267565b5050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6200013f5f8051602062000e30833981519152546001600160a01b031690565b604080516001600160a01b03928316815291841660208301520160405180910390a16200016c8162000289565b50565b806001600160a01b03163b5f03620001aa57604051634c9c8ce360e01b81526001600160a01b03821660048201526024015b60405180910390fd5b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5b80546001600160a01b0319166001600160a01b039290921691909117905550565b60605f80846001600160a01b0316846040516200020c919062000496565b5f60405180830381855af49150503d805f811462000246576040519150601f19603f3d011682016040523d82523d5f602084013e6200024b565b606091505b5090925090506200025e858383620002ca565b95945050505050565b3415620002875760405163b398979f60e01b815260040160405180910390fd5b565b6001600160a01b038116620002b457604051633173bdd160e11b81525f6004820152602401620001a1565b805f8051602062000e30833981519152620001cd565b606082620002e357620002dd8262000330565b62000329565b8151158015620002fb57506001600160a01b0384163b155b156200032657604051639996b31560e01b81526001600160a01b0385166004820152602401620001a1565b50805b9392505050565b805115620003415780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b6104fc806200093483390190565b80516001600160a01b03811681146200037f575f80fd5b919050565b634e487b7160e01b5f52604160045260245ffd5b5f5b83811015620003b45781810151838201526020016200039a565b50505f910152565b5f805f60608486031215620003cf575f80fd5b620003da8462000368565b9250620003ea6020850162000368565b60408501519092506001600160401b038082111562000407575f80fd5b818601915086601f8301126200041b575f80fd5b81518181111562000430576200043062000384565b604051601f8201601f19908116603f011681019083821181831017156200045b576200045b62000384565b8160405282815289602084870101111562000474575f80fd5b6200048783602083016020880162000398565b80955050505050509250925092565b5f8251620004a981846020870162000398565b9190910192915050565b608051610469620004cb5f395f601001526104695ff3fe608060405261000c61000e565b005b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316330361007a575f356001600160e01b03191663278f794360e11b14610070576040516334ad5dbb60e21b815260040160405180910390fd5b610078610082565b565b6100786100b0565b5f806100913660048184610303565b81019061009e919061033e565b915091506100ac82826100c0565b5050565b6100786100bb61011a565b610151565b6100c98261016f565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b905f90a28051156101125761010d82826101ea565b505050565b6100ac61025c565b5f61014c7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b365f80375f80365f845af43d5f803e80801561016b573d5ff35b3d5ffd5b806001600160a01b03163b5f036101a957604051634c9c8ce360e01b81526001600160a01b03821660048201526024015b60405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b60605f80846001600160a01b0316846040516102069190610407565b5f60405180830381855af49150503d805f811461023e576040519150601f19603f3d011682016040523d82523d5f602084013e610243565b606091505b509150915061025385838361027b565b95945050505050565b34156100785760405163b398979f60e01b815260040160405180910390fd5b6060826102905761028b826102da565b6102d3565b81511580156102a757506001600160a01b0384163b155b156102d057604051639996b31560e01b81526001600160a01b03851660048201526024016101a0565b50805b9392505050565b8051156102ea5780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b5f8085851115610311575f80fd5b8386111561031d575f80fd5b5050820193919092039150565b634e487b7160e01b5f52604160045260245ffd5b5f806040838503121561034f575f80fd5b82356001600160a01b0381168114610365575f80fd5b9150602083013567ffffffffffffffff80821115610381575f80fd5b818501915085601f830112610394575f80fd5b8135818111156103a6576103a661032a565b604051601f8201601f19908116603f011681019083821181831017156103ce576103ce61032a565b816040528281528860208487010111156103e6575f80fd5b826020860160208301375f6020848301015280955050505050509250929050565b5f82515f5b81811015610426576020818601810151858301520161040c565b505f92019182525091905056fea26469706673582212201a31c3db442064e980907a5ca999ca52c132d057688e882222814e029a3aad9064736f6c63430008180033608060405234801561000f575f80fd5b506040516104fc3803806104fc83398101604081905261002e916100bb565b806001600160a01b03811661005c57604051631e4fbdf760e01b81525f600482015260240160405180910390fd5b6100658161006c565b50506100e8565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b5f602082840312156100cb575f80fd5b81516001600160a01b03811681146100e1575f80fd5b9392505050565b610407806100f55f395ff3fe608060405260043610610049575f3560e01c8063715018a61461004d5780638da5cb5b146100635780639623609d1461008e578063ad3cb1cc146100a1578063f2fde38b146100de575b5f80fd5b348015610058575f80fd5b506100616100fd565b005b34801561006e575f80fd5b505f546040516001600160a01b0390911681526020015b60405180910390f35b61006161009c366004610260565b610110565b3480156100ac575f80fd5b506100d1604051806040016040528060058152602001640352e302e360dc1b81525081565b6040516100859190610372565b3480156100e9575f80fd5b506100616100f836600461038b565b61017b565b6101056101bd565b61010e5f6101e9565b565b6101186101bd565b60405163278f794360e11b81526001600160a01b03841690634f1ef28690349061014890869086906004016103a6565b5f604051808303818588803b15801561015f575f80fd5b505af1158015610171573d5f803e3d5ffd5b5050505050505050565b6101836101bd565b6001600160a01b0381166101b157604051631e4fbdf760e01b81525f60048201526024015b60405180910390fd5b6101ba816101e9565b50565b5f546001600160a01b0316331461010e5760405163118cdaa760e01b81523360048201526024016101a8565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b03811681146101ba575f80fd5b634e487b7160e01b5f52604160045260245ffd5b5f805f60608486031215610272575f80fd5b833561027d81610238565b9250602084013561028d81610238565b9150604084013567ffffffffffffffff808211156102a9575f80fd5b818601915086601f8301126102bc575f80fd5b8135818111156102ce576102ce61024c565b604051601f8201601f19908116603f011681019083821181831017156102f6576102f661024c565b8160405282815289602084870101111561030e575f80fd5b826020860160208301375f6020848301015280955050505050509250925092565b5f81518084525f5b8181101561035357602081850181015186830182015201610337565b505f602082860101526020601f19601f83011685010191505092915050565b602081525f610384602083018461032f565b9392505050565b5f6020828403121561039b575f80fd5b813561038481610238565b6001600160a01b03831681526040602082018190525f906103c99083018461032f565b94935050505056fea2646970667358221220098134bf3dcb274377e55b14b69b89c7eefde1171c4c5b1eb6233b5158fa785b64736f6c63430008180033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103", + "deployedBytecode": "0x608060405261000c61000e565b005b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316330361007a575f356001600160e01b03191663278f794360e11b14610070576040516334ad5dbb60e21b815260040160405180910390fd5b610078610082565b565b6100786100b0565b5f806100913660048184610303565b81019061009e919061033e565b915091506100ac82826100c0565b5050565b6100786100bb61011a565b610151565b6100c98261016f565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b905f90a28051156101125761010d82826101ea565b505050565b6100ac61025c565b5f61014c7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b365f80375f80365f845af43d5f803e80801561016b573d5ff35b3d5ffd5b806001600160a01b03163b5f036101a957604051634c9c8ce360e01b81526001600160a01b03821660048201526024015b60405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b60605f80846001600160a01b0316846040516102069190610407565b5f60405180830381855af49150503d805f811461023e576040519150601f19603f3d011682016040523d82523d5f602084013e610243565b606091505b509150915061025385838361027b565b95945050505050565b34156100785760405163b398979f60e01b815260040160405180910390fd5b6060826102905761028b826102da565b6102d3565b81511580156102a757506001600160a01b0384163b155b156102d057604051639996b31560e01b81526001600160a01b03851660048201526024016101a0565b50805b9392505050565b8051156102ea5780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b5f8085851115610311575f80fd5b8386111561031d575f80fd5b5050820193919092039150565b634e487b7160e01b5f52604160045260245ffd5b5f806040838503121561034f575f80fd5b82356001600160a01b0381168114610365575f80fd5b9150602083013567ffffffffffffffff80821115610381575f80fd5b818501915085601f830112610394575f80fd5b8135818111156103a6576103a661032a565b604051601f8201601f19908116603f011681019083821181831017156103ce576103ce61032a565b816040528281528860208487010111156103e6575f80fd5b826020860160208301375f6020848301015280955050505050509250929050565b5f82515f5b81811015610426576020818601810151858301520161040c565b505f92019182525091905056fea26469706673582212201a31c3db442064e980907a5ca999ca52c132d057688e882222814e029a3aad9064736f6c63430008180033", + "linkReferences": {}, + "deployedLinkReferences": {} +} \ No newline at end of file diff --git a/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/DisputeManager#DisputeManager_ProxyWithABI.json b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/DisputeManager#DisputeManager_ProxyWithABI.json new file mode 100644 index 000000000..e01123577 --- /dev/null +++ b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/DisputeManager#DisputeManager_ProxyWithABI.json @@ -0,0 +1,1557 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "DisputeManager", + "sourceName": "contracts/DisputeManager.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "controller", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "length", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "expectedLength", + "type": "uint256" + } + ], + "name": "AttestationInvalidBytesLength", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + } + ], + "name": "DisputeManagerDisputeAlreadyCreated", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + } + ], + "name": "DisputeManagerDisputeInConflict", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + } + ], + "name": "DisputeManagerDisputeNotInConflict", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "enum IDisputeManager.DisputeStatus", + "name": "status", + "type": "uint8" + } + ], + "name": "DisputeManagerDisputeNotPending", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeManagerDisputePeriodNotFinished", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeManagerDisputePeriodZero", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "DisputeManagerIndexerNotFound", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + } + ], + "name": "DisputeManagerInvalidDispute", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "disputeDeposit", + "type": "uint256" + } + ], + "name": "DisputeManagerInvalidDisputeDeposit", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "cut", + "type": "uint32" + } + ], + "name": "DisputeManagerInvalidFishermanReward", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "maxSlashingCut", + "type": "uint32" + } + ], + "name": "DisputeManagerInvalidMaxSlashingCut", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokensSlash", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxTokensSlash", + "type": "uint256" + } + ], + "name": "DisputeManagerInvalidTokensSlash", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeManagerInvalidZeroAddress", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "relatedDisputeId", + "type": "bytes32" + } + ], + "name": "DisputeManagerMustAcceptRelatedDispute", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "requestCID1", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "responseCID1", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "subgraphDeploymentId1", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "requestCID2", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "responseCID2", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "subgraphDeploymentId2", + "type": "bytes32" + } + ], + "name": "DisputeManagerNonConflictingAttestations", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "subgraphDeploymentId1", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "subgraphDeploymentId2", + "type": "bytes32" + } + ], + "name": "DisputeManagerNonMatchingSubgraphDeployment", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeManagerNotArbitrator", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeManagerNotFisherman", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeManagerSubgraphServiceNotSet", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeManagerZeroTokens", + "type": "error" + }, + { + "inputs": [], + "name": "ECDSAInvalidSignature", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "length", + "type": "uint256" + } + ], + "name": "ECDSAInvalidSignatureLength", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "ECDSAInvalidSignatureS", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "contractName", + "type": "bytes" + } + ], + "name": "GraphDirectoryInvalidZeroAddress", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidInitialization", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "OwnableInvalidOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "OwnableUnauthorizedAccount", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "a", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "b", + "type": "uint256" + } + ], + "name": "PPMMathInvalidMulPPM", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "arbitrator", + "type": "address" + } + ], + "name": "ArbitratorSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "fisherman", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "DisputeAccepted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "fisherman", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "DisputeCancelled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "disputeDeposit", + "type": "uint256" + } + ], + "name": "DisputeDepositSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "fisherman", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "DisputeDrawn", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "disputeId1", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "disputeId2", + "type": "bytes32" + } + ], + "name": "DisputeLinked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "disputePeriod", + "type": "uint64" + } + ], + "name": "DisputePeriodSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "fisherman", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "DisputeRejected", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "fishermanRewardCut", + "type": "uint32" + } + ], + "name": "FishermanRewardCutSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "graphToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "graphStaking", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphPayments", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphEscrow", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "graphController", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphEpochManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphRewardsManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphTokenGateway", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphProxyAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphCuration", + "type": "address" + } + ], + "name": "GraphDirectoryInitialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "fisherman", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "poi", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "stakeSnapshot", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "cancellableAt", + "type": "uint256" + } + ], + "name": "IndexingDisputeCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "fisherman", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensSlash", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensRewards", + "type": "uint256" + } + ], + "name": "LegacyDisputeCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "maxSlashingCut", + "type": "uint32" + } + ], + "name": "MaxSlashingCutSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "fisherman", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "attestation", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "stakeSnapshot", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "cancellableAt", + "type": "uint256" + } + ], + "name": "QueryDisputeCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "subgraphService", + "type": "address" + } + ], + "name": "SubgraphServiceSet", + "type": "event" + }, + { + "inputs": [], + "name": "MAX_FISHERMAN_REWARD_CUT", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MIN_DISPUTE_DEPOSIT", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "tokensSlash", + "type": "uint256" + } + ], + "name": "acceptDispute", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "tokensSlash", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "acceptDisputeInConflict", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "tokensSlashRelated", + "type": "uint256" + } + ], + "name": "acceptDisputeConflict", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "arbitrator", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "requestCID", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "responseCID", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + } + ], + "internalType": "struct Attestation.State", + "name": "attestation1", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "bytes32", + "name": "requestCID", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "responseCID", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + } + ], + "internalType": "struct Attestation.State", + "name": "attestation2", + "type": "tuple" + } + ], + "name": "areConflictingAttestations", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + } + ], + "name": "cancelDispute", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "internalType": "address", + "name": "fisherman", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokensSlash", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokensRewards", + "type": "uint256" + } + ], + "name": "createAndAcceptLegacyDispute", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "poi", + "type": "bytes32" + } + ], + "name": "createIndexingDispute", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "attestationData", + "type": "bytes" + } + ], + "name": "createQueryDispute", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "attestationData1", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "attestationData2", + "type": "bytes" + } + ], + "name": "createQueryDisputeConflict", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "disputeDeposit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "disputePeriod", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + } + ], + "name": "disputes", + "outputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "address", + "name": "fisherman", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deposit", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "relatedDisputeId", + "type": "bytes32" + }, + { + "internalType": "enum IDisputeManager.DisputeType", + "name": "disputeType", + "type": "uint8" + }, + { + "internalType": "enum IDisputeManager.DisputeStatus", + "name": "status", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "createdAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "cancellableAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "stakeSnapshot", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + } + ], + "name": "drawDispute", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "requestCID", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "responseCID", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + } + ], + "internalType": "struct Attestation.Receipt", + "name": "receipt", + "type": "tuple" + } + ], + "name": "encodeReceipt", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "fishermanRewardCut", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "requestCID", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "responseCID", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + } + ], + "internalType": "struct Attestation.State", + "name": "attestation", + "type": "tuple" + } + ], + "name": "getAttestationIndexer", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getDisputePeriod", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getFishermanRewardCut", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + } + ], + "name": "getStakeSnapshot", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "arbitrator_", + "type": "address" + }, + { + "internalType": "uint64", + "name": "disputePeriod_", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "disputeDeposit_", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "fishermanRewardCut_", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "maxSlashingCut_", + "type": "uint32" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + } + ], + "name": "isDisputeCreated", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maxSlashingCut", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + } + ], + "name": "rejectDispute", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "arbitrator", + "type": "address" + } + ], + "name": "setArbitrator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "disputeDeposit", + "type": "uint256" + } + ], + "name": "setDisputeDeposit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "disputePeriod", + "type": "uint64" + } + ], + "name": "setDisputePeriod", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "fishermanRewardCut_", + "type": "uint32" + } + ], + "name": "setFishermanRewardCut", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "maxSlashingCut_", + "type": "uint32" + } + ], + "name": "setMaxSlashingCut", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "subgraphService_", + "type": "address" + } + ], + "name": "setSubgraphService", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "subgraphService", + "outputs": [ + { + "internalType": "contract ISubgraphService", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "bytecode": "0x6101c060405234801561001157600080fd5b50604051613b6e380380613b6e8339810160408190526100309161049b565b806001600160a01b03811661007a5760405163218f5add60e11b815260206004820152600a60248201526921b7b73a3937b63632b960b11b60448201526064015b60405180910390fd5b6001600160a01b0381166101005260408051808201909152600a81526923b930b8342a37b5b2b760b11b60208201526100b29061033b565b6001600160a01b03166080526040805180820190915260078152665374616b696e6760c81b60208201526100e59061033b565b6001600160a01b031660a05260408051808201909152600d81526c47726170685061796d656e747360981b602082015261011e9061033b565b6001600160a01b031660c05260408051808201909152600e81526d5061796d656e7473457363726f7760901b60208201526101589061033b565b6001600160a01b031660e05260408051808201909152600c81526b22b837b1b426b0b730b3b2b960a11b60208201526101909061033b565b6001600160a01b03166101205260408051808201909152600e81526d2932bbb0b93239a6b0b730b3b2b960911b60208201526101cb9061033b565b6001600160a01b0316610140526040805180820190915260118152704772617068546f6b656e4761746577617960781b60208201526102099061033b565b6001600160a01b03166101605260408051808201909152600f81526e23b930b834283937bc3ca0b236b4b760891b60208201526102459061033b565b6001600160a01b03166101805260408051808201909152600881526721bab930ba34b7b760c11b602082015261027a9061033b565b6001600160a01b039081166101a08190526101005160a05160805160c05160e05161012051610140516101605161018051604051988b169a9788169996909716977fef5021414834d86e36470f5c1cecf6544fb2bb723f2ca51a4c86fcd8c5919a43976103249790916001600160a01b03978816815295871660208701529386166040860152918516606085015284166080840152831660a083015290911660c082015260e00190565b60405180910390a4506103356103e9565b50610519565b600080610100516001600160a01b031663f7641a5e84805190602001206040518263ffffffff1660e01b815260040161037691815260200190565b602060405180830381865afa158015610393573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103b7919061049b565b9050826001600160a01b0382166103e25760405163218f5add60e11b815260040161007191906104cb565b5092915050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff16156104395760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b03908116146104985780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b6000602082840312156104ad57600080fd5b81516001600160a01b03811681146104c457600080fd5b9392505050565b602081526000825180602084015260005b818110156104f957602081860181015160408684010152016104dc565b506000604082850101526040601f19601f83011684010191505092915050565b60805160a05160c05160e05161010051610120516101405161016051610180516101a0516135f261057c60003960005050600050506000505060005050600050506000505060005050600050506000611f23015260006119cc01526135f26000f3fe608060405234801561001057600080fd5b50600436106101a15760003560e01c8063050b17ad146101a65780630533e1ba146101bb5780630bc7344b146101e857806311be1997146101fb578063169729781461027857806317337b461461028b5780631792f1941461029557806326058249146102a857806329e03ff1146102c857806336167e03146102df5780634bc5839a146102f25780635aea0ec4146103055780635bf31d4d146103265780636369df6b146103405780636cc6cde114610353578063715018a61461036657806376c993ae1461036e5780638d4e9008146103815780638da5cb5b14610394578063902a49381461039c5780639334ea52146103ac57806393a90a1e146103bf5780639f81a7cf146103d2578063b0e2f7e9146103e5578063b0eefabe146103f8578063bb2a2b471461040b578063be41f38414610419578063c133b4291461043c578063c50a77b11461044f578063c894222e14610462578063c9747f5114610483578063cc2d55cd14610496578063d36fc9d4146104a5578063d76f62d1146104b8578063f2fde38b146104cb575b600080fd5b6101b96101b4366004612c8a565b6104de565b005b6036546101d290600160201b900463ffffffff1681565b6040516101df9190612cac565b60405180910390f35b6101b96101f6366004612cf9565b6105fc565b610263610209366004612d72565b603760205260009081526040902080546001820154600283015460038401546004850154600586015460068701546007909701546001600160a01b039687169796909516959394929360ff80841694610100909404169289565b6040516101df99989796959493929190612db5565b6101b9610286366004612d72565b610734565b6101d26207a12081565b6101b96102a3366004612d72565b610748565b6033546102bb906001600160a01b031681565b6040516101df9190612e20565b6102d160355481565b6040519081526020016101df565b6101b96102ed366004612d72565b6108a8565b6102d1610300366004612e34565b6109ae565b603454600160a01b90046001600160401b03165b6040516101df9190612e60565b60345461031990600160a01b90046001600160401b031681565b6102d161034e366004612e74565b6109e6565b6034546102bb906001600160a01b031681565b6101b96109ff565b6101b961037c366004612e8f565b610a13565b6102d161038f366004612eac565b610a24565b6102bb610dc5565b6036546101d29063ffffffff1681565b6101b96103ba366004612d72565b610de0565b6101b96103cd366004612ef2565b610edf565b6101b96103e0366004612e8f565b610ef0565b6101b96103f3366004612f1d565b610f01565b6101b9610406366004612ef2565b611062565b60365463ffffffff166101d2565b61042c610427366004612d72565b611073565b60405190151581526020016101df565b6102d161044a366004612ef2565b6110a9565b6102d161045d366004612fa4565b611141565b610475610470366004612fe5565b6111d4565b6040516101df929190613054565b6102bb6104913660046130fa565b6113e2565b6102d1670de0b6b3a764000081565b61042c6104b336600461317c565b6114cd565b6101b96104c63660046131b2565b6114f5565b6101b96104d9366004612ef2565b611506565b6034546001600160a01b031633146105095760405163a8baf3bb60e01b815260040160405180910390fd5b8161051381611073565b819061053e576040516314a03bbd60e21b815260040161053591815260200190565b60405180910390fd5b506004600082815260376020526040902060040154610100900460ff16600581111561056c5761056c612d8b565b600083815260376020526040902060040154610100900460ff1691146105a65760405163146e540f60e21b815260040161053591906131cf565b506000838152603760205260409020600301548390156105dc576040516364d0c32b60e01b815260040161053591815260200190565b5060008381526037602052604090206105f6848285611541565b50505050565b60006106066115f2565b805490915060ff600160401b82041615906001600160401b031660008115801561062d5750825b90506000826001600160401b031660011480156106495750303b155b905081158015610657575080155b156106755760405163f92ee8a960e01b815260040160405180910390fd5b84546001600160401b0319166001178555831561069e57845460ff60401b1916600160401b1785555b6106a78b61161b565b6106af61162c565b6106b88a61163c565b6106c1896116ad565b6106ca88611736565b6106d387611799565b6106dc8661180b565b831561072757845460ff60401b191685556040517fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29061071e90600190612e60565b60405180910390a15b5050505050505050505050565b61073c611892565b61074581611736565b50565b8061075281611073565b8190610774576040516314a03bbd60e21b815260040161053591815260200190565b506000818152603760205260409020600101546001600160a01b031633146107af5760405163082c005560e41b815260040160405180910390fd5b816107b981611073565b81906107db576040516314a03bbd60e21b815260040161053591815260200190565b506004600082815260376020526040902060040154610100900460ff16600581111561080957610809612d8b565b600083815260376020526040902060040154610100900460ff1691146108435760405163146e540f60e21b815260040161053591906131cf565b506000838152603760205260409020600681015442101561087757604051631d7753d560e11b815260040160405180910390fd5b61088184826118c4565b6003810154156105f657600381015460008181526037602052604090206105f691906118c4565b6034546001600160a01b031633146108d35760405163a8baf3bb60e01b815260040160405180910390fd5b806108dd81611073565b81906108ff576040516314a03bbd60e21b815260040161053591815260200190565b506004600082815260376020526040902060040154610100900460ff16600581111561092d5761092d612d8b565b600083815260376020526040902060040154610100900460ff1691146109675760405163146e540f60e21b815260040161053591906131cf565b506000828152603760205260409020600381015483901561099e576040516364d0c32b60e01b815260040161053591815260200190565b506109a9838261194b565b505050565b60006109cf336035546109bf6119ca565b6001600160a01b031691906119ee565b6109dd336035548585611aa6565b90505b92915050565b60006109e06109fa368490038401846131dd565b611e28565b610a07611892565b610a116000611ec5565b565b610a1b611892565b61074581611799565b6034546000906001600160a01b03163314610a525760405163a8baf3bb60e01b815260040160405180910390fd5b6040516001600160601b0319606087901b166020820152656c656761637960d01b6034820152600090603a016040516020818303038152906040528051906020012090506000610aa0611f21565b6001600160a01b0316630e022923886040518263ffffffff1660e01b8152600401610acb9190612e20565b61012060405180830381865afa158015610ae9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b0d91906132d9565b519050866001600160a01b038216610b39576040516334789d8b60e21b81526004016105359190612e20565b5060408051610120810182526001600160a01b038381168252881660208201526000918101829052606081019190915260036080820152600160a08201524260c0820181905260345460e0830191610ba191600160a01b90046001600160401b03169061330c565b81526000602091820181905284815260378252604090819020835181546001600160a01b039182166001600160a01b0319918216178355938501516001808401805492909316919095161790559083015160028201556060830151600380830191909155608084015160048301805493949193909260ff1990911691908490811115610c2f57610c2f612d8b565b021790555060a082015160048201805461ff001916610100836005811115610c5957610c59612d8b565b021790555060c0820151600582015560e08201516006820155610100909101516007909101556000610c89611f45565b9050806001600160a01b031663cb8347fe838888604051602001610cae929190613054565b6040516020818303038152906040526040518363ffffffff1660e01b8152600401610cda929190613365565b600060405180830381600087803b158015610cf457600080fd5b505af1158015610d08573d6000803e3d6000fd5b50505050610d298786610d196119ca565b6001600160a01b03169190611f81565b604080516001600160a01b038a81168252602082018990529181018790528189169184169085907f587a1fc7e80e653a2ab7f63f98c080f5818b8cedcfd1374590c8c786290ed0319060600160405180910390a4866001600160a01b0316826001600160a01b03168460008051602061359d83398151915288604051610db191815260200190565b60405180910390a450909695505050505050565b600080610dd0611fbc565b546001600160a01b031692915050565b6034546001600160a01b03163314610e0b5760405163a8baf3bb60e01b815260040160405180910390fd5b80610e1581611073565b8190610e37576040516314a03bbd60e21b815260040161053591815260200190565b506004600082815260376020526040902060040154610100900460ff166005811115610e6557610e65612d8b565b600083815260376020526040902060040154610100900460ff169114610e9f5760405163146e540f60e21b815260040161053591906131cf565b506000828152603760205260409020610eb88382611fe0565b6003810154156109a957600381015460008181526037602052604090206109a99190611fe0565b610ee7611892565b6107458161205f565b610ef8611892565b6107458161180b565b6034546001600160a01b03163314610f2c5760405163a8baf3bb60e01b815260040160405180910390fd5b83610f3681611073565b8190610f58576040516314a03bbd60e21b815260040161053591815260200190565b506004600082815260376020526040902060040154610100900460ff166005811115610f8657610f86612d8b565b600083815260376020526040902060040154610100900460ff169114610fc05760405163146e540f60e21b815260040161053591906131cf565b5060008581526037602052604090206003015415158590610ffa57604051600162d62c0760e01b0319815260040161053591815260200190565b506000858152603760205260409020611014868287611541565b831561103d5760038101546000818152603760205260409020611038919085611541565b61105a565b6003810154600081815260376020526040902061105a9190611fe0565b505050505050565b61106a611892565b6107458161163c565b600080600083815260376020526040902060040154610100900460ff1660058111156110a1576110a1612d8b565b141592915050565b6000806110b4611f21565b6001600160a01b03166325d9897e846110cb611f45565b6040518363ffffffff1660e01b81526004016110e8929190613389565b61014060405180830381865afa158015611106573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061112a91906133b9565b905061113a8382600001516120d0565b9392505050565b6000611152336035546109bf6119ca565b6109dd3360355461119886868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061216592505050565b86868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506122a592505050565b6000806000339050600061121d88888080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061216592505050565b9050600061126087878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061216592505050565b905061126c82826125a4565b825160208085015160408087015186519387015191870151949592949093926112cb57604051636aba529760e11b81526004810196909652602486019490945260448501929092526064840152608483015260a482015260c401610535565b5050505050506112e0336035546109bf6119ca565b60006113328460026035546112f59190613466565b858d8d8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506122a592505050565b905060006113868560026035546113499190613466565b858c8c8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506122a592505050565b60008381526037602052604080822060039081018490558383528183200185905551919250829184917ffec135a4cf8e5c6e13dea23be058bf03a8bf8f1f6fb0a021b0a5aeddfba8140791a3909a909950975050505050505050565b6000806113ee836125d5565b905060006113fa611f45565b6001600160a01b0316630e022923836040518263ffffffff1660e01b81526004016114259190612e20565b61012060405180830381865afa158015611443573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061146791906132d9565b805190915082906001600160a01b0316611495576040516334789d8b60e21b81526004016105359190612e20565b5060408401516020820151908181146114c357604051630a24cfe560e21b8152600401610535929190613054565b5050519392505050565b60006109dd6114e1368590038501856130fa565b6114f0368590038501856130fa565b6125a4565b6114fd611892565b610745816116ad565b61150e611892565b6001600160a01b038116611538576000604051631e4fbdf760e01b81526004016105359190612e20565b61074581611ec5565b81546007830154600091611562916001600160a01b0390911690849061265e565b60048401805461ff001916610100179055600184015460028501549192506115a2916001600160a01b039091169061159a908461330c565b610d196119ca565b6001830154835460028501546001600160a01b039283169290911690869060008051602061359d833981519152906115db90869061330c565b60405190815260200160405180910390a450505050565b6000807ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a006109e0565b61162361280f565b61074581612834565b61163461280f565b610a1161283c565b6001600160a01b0381166116635760405163616bc44160e11b815260040160405180910390fd5b603480546001600160a01b0319166001600160a01b0383169081179091556040517f51744122301b50e919f4e3d22adf8c53abc92195b8c667eda98c6ef20375672e90600090a250565b806001600160401b03166000036116d75760405163c4411f1160e01b815260040160405180910390fd5b60348054600160a01b600160e01b031916600160a01b6001600160401b038416021790556040517f310462a9bf49fff4a57910ec647c77cbf8aaf2f13394554ac6cdf14fc68db7e69061172b908390612e60565b60405180910390a150565b80670de0b6b3a76400008110156117635760405163033f4e0560e01b815260040161053591815260200190565b5060358190556040518181527f97896b9da0f97f36bf3011570bcff930069299de4b1e89c9cb44909841cac2f89060200161172b565b806207a12063ffffffff821611156117c55760405163432e664360e11b81526004016105359190612cac565b506036805463ffffffff191663ffffffff83161790556040517fc573dc0f869f6a1d0a74fc7712a63baabcb5567131d2d98005e163924eddcbab9061172b908390612cac565b8063ffffffff8116620f4240101561183757604051634e9374fb60e11b81526004016105359190612cac565b506036805463ffffffff60201b1916600160201b63ffffffff848116820292909217928390556040517f7efaf01bec3cda8d104163bb466d01d7e16f68848301c7eb0749cfa59d6805029361172b9392900490911690612cac565b3361189b610dc5565b6001600160a01b031614610a11573360405163118cdaa760e01b81526004016105359190612e20565b60048101805461ff001916610500179055600181015460028201546118f5916001600160a01b031690610d196119ca565b6001810154815460028301546040519081526001600160a01b03928316929091169084907f223103f8eb52e5f43a75655152acd882a605d70df57a5c0fefd30f516b1756d2906020015b60405180910390a45050565b60048101805461ff001916610200179055600281015461197c9061196d6119ca565b6001600160a01b03169061290e565b6001810154815460028301546040519081526001600160a01b03928316929091169084907f2226ebd23625a7938fb786df2248bd171d2e6ad70cb2b654ea1be830ca17224d9060200161193f565b7f000000000000000000000000000000000000000000000000000000000000000090565b80156109a9576040516323b872dd60e01b81526001600160a01b038381166004830152306024830152604482018390528416906323b872dd906064015b6020604051808303816000875af1158015611a4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a6e9190613488565b6109a95760405162461bcd60e51b815260206004820152600960248201526810ba3930b739b332b960b91b6044820152606401610535565b6040516001600160601b0319606084901b166020820152603481018290526000908190605401604051602081830303815290604052805190602001209050611aed81611073565b158190611b105760405163124a23f160e11b815260040161053591815260200190565b506000611b1b611f45565b90506000816001600160a01b0316630e022923876040518263ffffffff1660e01b8152600401611b4b9190612e20565b61012060405180830381865afa158015611b69573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b8d91906132d9565b8051909150866001600160a01b038216611bbb576040516334789d8b60e21b81526004016105359190612e20565b506000611bc6611f21565b6001600160a01b03166325d9897e83866040518363ffffffff1660e01b8152600401611bf3929190613389565b61014060405180830381865afa158015611c11573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c3591906133b9565b8051909150600003611c5a5760405163307efdb760e11b815260040160405180910390fd5b6000611c6a8383600001516120d0565b603454909150600090611c8d90600160a01b90046001600160401b03164261330c565b604080516101208101825287516001600160a01b0390811682528f1660208201529081018d905260006060820152909150608081016001815260200160048152426020808301919091526040808301859052606092830186905260008b815260378352819020845181546001600160a01b039182166001600160a01b0319918216178355938601516001808401805492909316919095161790559084015160028201559183015160038084019190915560808401516004840180549193909260ff19909216918490811115611d6457611d64612d8b565b021790555060a082015160048201805461ff001916610100836005811115611d8e57611d8e612d8b565b021790555060c0820151600582015560e08201516006820155610100909101516007909101558451604080518d81526001600160a01b038d811660208301529181018c90526060810185905260808101849052818f16929091169089907f8a1eccecce948a912e2e195de5960359755aeac90ad88a3fde55a77e1a73796b9060a00160405180910390a450949a9950505050505050505050565b600054815160208084015160409485015185517f32dd026408194a0d7e54cc66a2ab6c856efc55cfcd4dd258fde5b1a55222baa6818501528087019490945260608401919091526080808401919091528451808403909101815260a08301855280519082012061190160f01b60c084015260c283019390935260e28083019390935283518083039093018352610102909101909252805191012090565b6000611ecf611fbc565b80546001600160a01b038481166001600160a01b031983168117845560405193945091169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b6033546000906001600160a01b0316611f715760405163bd088b4f60e01b815260040160405180910390fd5b506033546001600160a01b031690565b80156109a95760405163a9059cbb60e01b81526001600160a01b0383811660048301526024820183905284169063a9059cbb90604401611a2b565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930090565b60048101805461ff00191661030017905560018101546002820154612011916001600160a01b031690610d196119ca565b6001810154815460028301546040519081526001600160a01b03928316929091169084907ff0912efb86ea1d65a17d64d48393cdb1ca0ea5220dd2bbe438621199d30955b79060200161193f565b6001600160a01b0381166120865760405163616bc44160e11b815260040160405180910390fd5b603380546001600160a01b0319166001600160a01b0383169081179091556040517f81dcb738da3dabd5bb2adbc7dd107fbbfca936e9c8aecab25f5b17a710a784c790600090a250565b6000806120db611f21565b6001600160a01b031663561285e4856120f2611f45565b6040518363ffffffff1660e01b815260040161210f929190613389565b60a060405180830381865afa15801561212c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061215091906134a5565b51905061215d818461330c565b949350505050565b6040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a081019190915260016121a460208061330c565b6121ae919061330c565b6121b990606061330c565b82519081149060016121cc60208061330c565b6121d6919061330c565b6121e190606061330c565b909161220257604051633fdf342360e01b8152600401610535929190613054565b505060008060008480602001905181019061221d9190613524565b925092509250600061223086606061296e565b90506000612249876122446020606061330c565b61296e565b9050600061226d88602061225e81606061330c565b612268919061330c565b6129b9565b6040805160c081018252978852602088019690965294860193909352606085019190915260808401525060ff1660a082015292915050565b6000806122b1846113e2565b905060006122bd611f21565b6001600160a01b03166325d9897e836122d4611f45565b6040518363ffffffff1660e01b81526004016122f1929190613389565b61014060405180830381865afa15801561230f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061233391906133b9565b80519091506000036123585760405163307efdb760e11b815260040160405180910390fd5b84516020808701516040808901518151938401949094528201526060808201929092526001600160601b031984831b811660808301529189901b909116609482015260009060a8016040516020818303038152906040528051906020012090506123c181611073565b1581906123e45760405163124a23f160e11b815260040161053591815260200190565b5060006123f58484600001516120d0565b60345490915060009061241890600160a01b90046001600160401b03164261330c565b60408051610120810182526001600160a01b0380891682528d1660208201529081018b9052600060608201529091506080810160028152602001600481524260208083019190915260408083018590526060928301869052600087815260378352819020845181546001600160a01b039182166001600160a01b0319918216178355938601516001808401805492909316919095161790559084015160028201559183015160038084019190915560808401516004840180549193909260ff199092169184908111156124ed576124ed612d8b565b021790555060a082015160048201805461ff00191661010083600581111561251757612517612d8b565b021790555060c0820151816005015560e082015181600601556101008201518160070155905050896001600160a01b0316856001600160a01b0316847ffb70faf7306b83c2cec6d8c1627baad892cb79968a02cc0353174499ecfd8b358c8c604001518c878960405161258e959493929190613552565b60405180910390a4509098975050505050505050565b805182516000911480156125bf575081604001518360400151145b80156109dd575050602090810151910151141590565b60408051606081018252825181526020808401519082015282820151918101919091526000908161260582611e28565b905061215d81856060015186608001518760a0015160405160200161264a93929190928352602083019190915260f81b6001600160f81b031916604082015260410190565b604051602081830303815290604052612a04565b600080612669611f45565b90506000612675611f21565b6001600160a01b03166325d9897e87846040518363ffffffff1660e01b81526004016126a2929190613389565b61014060405180830381865afa1580156126c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126e491906133b9565b60365490915060009061270990869063ffffffff600160201b909104811690612a2e16565b9050851580159061271a5750808611155b8682909161273d5760405163cc6b7c4160e01b8152600401610535929190613054565b5050600061274f878460000151612a8e565b60608401516036549192506000916127709163ffffffff9081169116612a8e565b9050600061277e8284612a2e565b9050856001600160a01b031663cb8347fe8b8b846040516020016127a3929190613054565b6040516020818303038152906040526040518363ffffffff1660e01b81526004016127cf929190613365565b600060405180830381600087803b1580156127e957600080fd5b505af11580156127fd573d6000803e3d6000fd5b50929c9b505050505050505050505050565b612817612aa5565b610a1157604051631afcd79f60e31b815260040160405180910390fd5b61150e61280f565b61284461280f565b604080517fd87cd6ef79d4e2b95e15ce8abf732db51ec771f1ca2edccf22a46c729ac5647260208201527f171a7fa058648750a8c5aae430f30db8d0100efc3a5e1b2e8054b1c1ce28b6b4918101919091527f044852b2a670ade5407e78fb2863c51de9fcb96542a07186fe3aeda6bb8a116d60608201524660808201523060a08201527fa070ffb1cd7409649bf77822cce74495468e06dbfaef09556838bf188679b9c260c082015260e00160408051601f198184030181529190528051602090910120600055565b801561296a57604051630852cd8d60e31b8152600481018290526001600160a01b038316906342966c6890602401600060405180830381600087803b15801561295657600080fd5b505af115801561105a573d6000803e3d6000fd5b5050565b600061297b60208361330c565b8351908110159061298d60208561330c565b90916129ae57604051633fdf342360e01b8152600401610535929190613054565b505050016020015190565b60006129c660018361330c565b835190811015906129d860018561330c565b90916129f957604051633fdf342360e01b8152600401610535929190613054565b505050016001015190565b600080600080612a148686612abf565b925092509250612a248282612b0c565b5090949350505050565b6000612a3d83620f4240101590565b80612a505750612a5082620f4240101590565b83839091612a735760405163768bf0eb60e11b8152600401610535929190613054565b50620f42409050612a848385613585565b6109dd9190613466565b600081831115612a9e57816109dd565b5090919050565b6000612aaf6115f2565b54600160401b900460ff16919050565b60008060008351604103612af95760208401516040850151606086015160001a612aeb88828585612bc5565b955095509550505050612b05565b50508151600091506002905b9250925092565b6000826003811115612b2057612b20612d8b565b03612b29575050565b6001826003811115612b3d57612b3d612d8b565b03612b5b5760405163f645eedf60e01b815260040160405180910390fd5b6002826003811115612b6f57612b6f612d8b565b03612b905760405163fce698f760e01b815260048101829052602401610535565b6003826003811115612ba457612ba4612d8b565b0361296a576040516335e2f38360e21b815260048101829052602401610535565b600080806fa2a8918ca85bafe22016d0b997e4df60600160ff1b03841115612bf65750600091506003905082612c80565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa158015612c4a573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116612c7657506000925060019150829050612c80565b9250600091508190505b9450945094915050565b60008060408385031215612c9d57600080fd5b50508035926020909101359150565b63ffffffff91909116815260200190565b6001600160a01b038116811461074557600080fd5b6001600160401b038116811461074557600080fd5b63ffffffff8116811461074557600080fd5b60008060008060008060c08789031215612d1257600080fd5b8635612d1d81612cbd565b95506020870135612d2d81612cbd565b94506040870135612d3d81612cd2565b9350606087013592506080870135612d5481612ce7565b915060a0870135612d6481612ce7565b809150509295509295509295565b600060208284031215612d8457600080fd5b5035919050565b634e487b7160e01b600052602160045260246000fd5b60068110612db157612db1612d8b565b9052565b6001600160a01b038a81168252891660208201526040810188905260608101879052610120810160048710612dec57612dec612d8b565b866080830152612dff60a0830187612da1565b8460c08301528360e0830152826101008301529a9950505050505050505050565b6001600160a01b0391909116815260200190565b60008060408385031215612e4757600080fd5b8235612e5281612cbd565b946020939093013593505050565b6001600160401b0391909116815260200190565b60006060828403128015612e8757600080fd5b509092915050565b600060208284031215612ea157600080fd5b813561113a81612ce7565b60008060008060808587031215612ec257600080fd5b8435612ecd81612cbd565b93506020850135612edd81612cbd565b93969395505050506040820135916060013590565b600060208284031215612f0457600080fd5b813561113a81612cbd565b801515811461074557600080fd5b60008060008060808587031215612f3357600080fd5b84359350602085013592506040850135612f4c81612f0f565b9396929550929360600135925050565b60008083601f840112612f6e57600080fd5b5081356001600160401b03811115612f8557600080fd5b602083019150836020828501011115612f9d57600080fd5b9250929050565b60008060208385031215612fb757600080fd5b82356001600160401b03811115612fcd57600080fd5b612fd985828601612f5c565b90969095509350505050565b60008060008060408587031215612ffb57600080fd5b84356001600160401b0381111561301157600080fd5b61301d87828801612f5c565b90955093505060208501356001600160401b0381111561303c57600080fd5b61304887828801612f5c565b95989497509550505050565b918252602082015260400190565b60405160c081016001600160401b038111828210171561309257634e487b7160e01b600052604160045260246000fd5b60405290565b60405161012081016001600160401b038111828210171561309257634e487b7160e01b600052604160045260246000fd5b60405161014081016001600160401b038111828210171561309257634e487b7160e01b600052604160045260246000fd5b600060c082840312801561310d57600080fd5b506000613118613062565b833581526020808501359082015260408085013590820152606080850135908201526080808501359082015260a084013560ff81168114613157578283fd5b60a0820152949350505050565b600060c0828403121561317657600080fd5b50919050565b600080610180838503121561319057600080fd5b61319a8484613164565b91506131a98460c08501613164565b90509250929050565b6000602082840312156131c457600080fd5b813561113a81612cd2565b602081016109e08284612da1565b600060608284031280156131f057600080fd5b50604051600090606081016001600160401b038111828210171561322257634e487b7160e01b83526041600452602483fd5b604090815284358252602080860135908301529384013593810193909352509092915050565b805161325381612cbd565b919050565b6000610120828403121561326b57600080fd5b613273613098565b905061327e82613248565b81526020828101519082015260408083015190820152606080830151908201526080808301519082015260a0808301519082015260c0808301519082015260e080830151908201526101009182015191810191909152919050565b600061012082840312156132ec57600080fd5b6109dd8383613258565b634e487b7160e01b600052601160045260246000fd5b808201808211156109e0576109e06132f6565b6000815180845260005b8181101561334557602081850181015186830182015201613329565b506000602082860101526020601f19601f83011685010191505092915050565b6001600160a01b038316815260406020820181905260009061215d9083018461331f565b6001600160a01b0392831681529116602082015260400190565b805161325381612ce7565b805161325381612cd2565b60006101408284031280156133cd57600080fd5b5060006133d86130c9565b8351815260208085015190820152604080850151908201526133fc606085016133a3565b606082015261340d608085016133ae565b608082015261341e60a085016133ae565b60a082015261342f60c085016133a3565b60c082015261344060e085016133ae565b60e082015261010084810151908201526101209384015193810193909352509092915050565b60008261348357634e487b7160e01b600052601260045260246000fd5b500490565b60006020828403121561349a57600080fd5b815161113a81612f0f565b600060a08284031280156134b857600080fd5b5060405160009060a081016001600160401b03811182821017156134ea57634e487b7160e01b83526041600452602483fd5b6040908152845182526020808601519083015284810151908201526060808501519082015260809384015193810193909352509092915050565b60008060006060848603121561353957600080fd5b5050815160208301516040909301519094929350919050565b85815284602082015260a06040820152600061357160a083018661331f565b606083019490945250608001529392505050565b80820281158282048414176109e0576109e06132f656fe6d800aaaf64b9a1f321dcd63da04369d33d8a0d49ad0fbba085aab4a98bf31c4a2646970667358221220d50b3dec1e5d2d1d140733dca7d5163900c1fc882947b3208864910c6f452d0e64736f6c634300081b0033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101a15760003560e01c8063050b17ad146101a65780630533e1ba146101bb5780630bc7344b146101e857806311be1997146101fb578063169729781461027857806317337b461461028b5780631792f1941461029557806326058249146102a857806329e03ff1146102c857806336167e03146102df5780634bc5839a146102f25780635aea0ec4146103055780635bf31d4d146103265780636369df6b146103405780636cc6cde114610353578063715018a61461036657806376c993ae1461036e5780638d4e9008146103815780638da5cb5b14610394578063902a49381461039c5780639334ea52146103ac57806393a90a1e146103bf5780639f81a7cf146103d2578063b0e2f7e9146103e5578063b0eefabe146103f8578063bb2a2b471461040b578063be41f38414610419578063c133b4291461043c578063c50a77b11461044f578063c894222e14610462578063c9747f5114610483578063cc2d55cd14610496578063d36fc9d4146104a5578063d76f62d1146104b8578063f2fde38b146104cb575b600080fd5b6101b96101b4366004612c8a565b6104de565b005b6036546101d290600160201b900463ffffffff1681565b6040516101df9190612cac565b60405180910390f35b6101b96101f6366004612cf9565b6105fc565b610263610209366004612d72565b603760205260009081526040902080546001820154600283015460038401546004850154600586015460068701546007909701546001600160a01b039687169796909516959394929360ff80841694610100909404169289565b6040516101df99989796959493929190612db5565b6101b9610286366004612d72565b610734565b6101d26207a12081565b6101b96102a3366004612d72565b610748565b6033546102bb906001600160a01b031681565b6040516101df9190612e20565b6102d160355481565b6040519081526020016101df565b6101b96102ed366004612d72565b6108a8565b6102d1610300366004612e34565b6109ae565b603454600160a01b90046001600160401b03165b6040516101df9190612e60565b60345461031990600160a01b90046001600160401b031681565b6102d161034e366004612e74565b6109e6565b6034546102bb906001600160a01b031681565b6101b96109ff565b6101b961037c366004612e8f565b610a13565b6102d161038f366004612eac565b610a24565b6102bb610dc5565b6036546101d29063ffffffff1681565b6101b96103ba366004612d72565b610de0565b6101b96103cd366004612ef2565b610edf565b6101b96103e0366004612e8f565b610ef0565b6101b96103f3366004612f1d565b610f01565b6101b9610406366004612ef2565b611062565b60365463ffffffff166101d2565b61042c610427366004612d72565b611073565b60405190151581526020016101df565b6102d161044a366004612ef2565b6110a9565b6102d161045d366004612fa4565b611141565b610475610470366004612fe5565b6111d4565b6040516101df929190613054565b6102bb6104913660046130fa565b6113e2565b6102d1670de0b6b3a764000081565b61042c6104b336600461317c565b6114cd565b6101b96104c63660046131b2565b6114f5565b6101b96104d9366004612ef2565b611506565b6034546001600160a01b031633146105095760405163a8baf3bb60e01b815260040160405180910390fd5b8161051381611073565b819061053e576040516314a03bbd60e21b815260040161053591815260200190565b60405180910390fd5b506004600082815260376020526040902060040154610100900460ff16600581111561056c5761056c612d8b565b600083815260376020526040902060040154610100900460ff1691146105a65760405163146e540f60e21b815260040161053591906131cf565b506000838152603760205260409020600301548390156105dc576040516364d0c32b60e01b815260040161053591815260200190565b5060008381526037602052604090206105f6848285611541565b50505050565b60006106066115f2565b805490915060ff600160401b82041615906001600160401b031660008115801561062d5750825b90506000826001600160401b031660011480156106495750303b155b905081158015610657575080155b156106755760405163f92ee8a960e01b815260040160405180910390fd5b84546001600160401b0319166001178555831561069e57845460ff60401b1916600160401b1785555b6106a78b61161b565b6106af61162c565b6106b88a61163c565b6106c1896116ad565b6106ca88611736565b6106d387611799565b6106dc8661180b565b831561072757845460ff60401b191685556040517fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29061071e90600190612e60565b60405180910390a15b5050505050505050505050565b61073c611892565b61074581611736565b50565b8061075281611073565b8190610774576040516314a03bbd60e21b815260040161053591815260200190565b506000818152603760205260409020600101546001600160a01b031633146107af5760405163082c005560e41b815260040160405180910390fd5b816107b981611073565b81906107db576040516314a03bbd60e21b815260040161053591815260200190565b506004600082815260376020526040902060040154610100900460ff16600581111561080957610809612d8b565b600083815260376020526040902060040154610100900460ff1691146108435760405163146e540f60e21b815260040161053591906131cf565b506000838152603760205260409020600681015442101561087757604051631d7753d560e11b815260040160405180910390fd5b61088184826118c4565b6003810154156105f657600381015460008181526037602052604090206105f691906118c4565b6034546001600160a01b031633146108d35760405163a8baf3bb60e01b815260040160405180910390fd5b806108dd81611073565b81906108ff576040516314a03bbd60e21b815260040161053591815260200190565b506004600082815260376020526040902060040154610100900460ff16600581111561092d5761092d612d8b565b600083815260376020526040902060040154610100900460ff1691146109675760405163146e540f60e21b815260040161053591906131cf565b506000828152603760205260409020600381015483901561099e576040516364d0c32b60e01b815260040161053591815260200190565b506109a9838261194b565b505050565b60006109cf336035546109bf6119ca565b6001600160a01b031691906119ee565b6109dd336035548585611aa6565b90505b92915050565b60006109e06109fa368490038401846131dd565b611e28565b610a07611892565b610a116000611ec5565b565b610a1b611892565b61074581611799565b6034546000906001600160a01b03163314610a525760405163a8baf3bb60e01b815260040160405180910390fd5b6040516001600160601b0319606087901b166020820152656c656761637960d01b6034820152600090603a016040516020818303038152906040528051906020012090506000610aa0611f21565b6001600160a01b0316630e022923886040518263ffffffff1660e01b8152600401610acb9190612e20565b61012060405180830381865afa158015610ae9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b0d91906132d9565b519050866001600160a01b038216610b39576040516334789d8b60e21b81526004016105359190612e20565b5060408051610120810182526001600160a01b038381168252881660208201526000918101829052606081019190915260036080820152600160a08201524260c0820181905260345460e0830191610ba191600160a01b90046001600160401b03169061330c565b81526000602091820181905284815260378252604090819020835181546001600160a01b039182166001600160a01b0319918216178355938501516001808401805492909316919095161790559083015160028201556060830151600380830191909155608084015160048301805493949193909260ff1990911691908490811115610c2f57610c2f612d8b565b021790555060a082015160048201805461ff001916610100836005811115610c5957610c59612d8b565b021790555060c0820151600582015560e08201516006820155610100909101516007909101556000610c89611f45565b9050806001600160a01b031663cb8347fe838888604051602001610cae929190613054565b6040516020818303038152906040526040518363ffffffff1660e01b8152600401610cda929190613365565b600060405180830381600087803b158015610cf457600080fd5b505af1158015610d08573d6000803e3d6000fd5b50505050610d298786610d196119ca565b6001600160a01b03169190611f81565b604080516001600160a01b038a81168252602082018990529181018790528189169184169085907f587a1fc7e80e653a2ab7f63f98c080f5818b8cedcfd1374590c8c786290ed0319060600160405180910390a4866001600160a01b0316826001600160a01b03168460008051602061359d83398151915288604051610db191815260200190565b60405180910390a450909695505050505050565b600080610dd0611fbc565b546001600160a01b031692915050565b6034546001600160a01b03163314610e0b5760405163a8baf3bb60e01b815260040160405180910390fd5b80610e1581611073565b8190610e37576040516314a03bbd60e21b815260040161053591815260200190565b506004600082815260376020526040902060040154610100900460ff166005811115610e6557610e65612d8b565b600083815260376020526040902060040154610100900460ff169114610e9f5760405163146e540f60e21b815260040161053591906131cf565b506000828152603760205260409020610eb88382611fe0565b6003810154156109a957600381015460008181526037602052604090206109a99190611fe0565b610ee7611892565b6107458161205f565b610ef8611892565b6107458161180b565b6034546001600160a01b03163314610f2c5760405163a8baf3bb60e01b815260040160405180910390fd5b83610f3681611073565b8190610f58576040516314a03bbd60e21b815260040161053591815260200190565b506004600082815260376020526040902060040154610100900460ff166005811115610f8657610f86612d8b565b600083815260376020526040902060040154610100900460ff169114610fc05760405163146e540f60e21b815260040161053591906131cf565b5060008581526037602052604090206003015415158590610ffa57604051600162d62c0760e01b0319815260040161053591815260200190565b506000858152603760205260409020611014868287611541565b831561103d5760038101546000818152603760205260409020611038919085611541565b61105a565b6003810154600081815260376020526040902061105a9190611fe0565b505050505050565b61106a611892565b6107458161163c565b600080600083815260376020526040902060040154610100900460ff1660058111156110a1576110a1612d8b565b141592915050565b6000806110b4611f21565b6001600160a01b03166325d9897e846110cb611f45565b6040518363ffffffff1660e01b81526004016110e8929190613389565b61014060405180830381865afa158015611106573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061112a91906133b9565b905061113a8382600001516120d0565b9392505050565b6000611152336035546109bf6119ca565b6109dd3360355461119886868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061216592505050565b86868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506122a592505050565b6000806000339050600061121d88888080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061216592505050565b9050600061126087878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061216592505050565b905061126c82826125a4565b825160208085015160408087015186519387015191870151949592949093926112cb57604051636aba529760e11b81526004810196909652602486019490945260448501929092526064840152608483015260a482015260c401610535565b5050505050506112e0336035546109bf6119ca565b60006113328460026035546112f59190613466565b858d8d8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506122a592505050565b905060006113868560026035546113499190613466565b858c8c8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506122a592505050565b60008381526037602052604080822060039081018490558383528183200185905551919250829184917ffec135a4cf8e5c6e13dea23be058bf03a8bf8f1f6fb0a021b0a5aeddfba8140791a3909a909950975050505050505050565b6000806113ee836125d5565b905060006113fa611f45565b6001600160a01b0316630e022923836040518263ffffffff1660e01b81526004016114259190612e20565b61012060405180830381865afa158015611443573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061146791906132d9565b805190915082906001600160a01b0316611495576040516334789d8b60e21b81526004016105359190612e20565b5060408401516020820151908181146114c357604051630a24cfe560e21b8152600401610535929190613054565b5050519392505050565b60006109dd6114e1368590038501856130fa565b6114f0368590038501856130fa565b6125a4565b6114fd611892565b610745816116ad565b61150e611892565b6001600160a01b038116611538576000604051631e4fbdf760e01b81526004016105359190612e20565b61074581611ec5565b81546007830154600091611562916001600160a01b0390911690849061265e565b60048401805461ff001916610100179055600184015460028501549192506115a2916001600160a01b039091169061159a908461330c565b610d196119ca565b6001830154835460028501546001600160a01b039283169290911690869060008051602061359d833981519152906115db90869061330c565b60405190815260200160405180910390a450505050565b6000807ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a006109e0565b61162361280f565b61074581612834565b61163461280f565b610a1161283c565b6001600160a01b0381166116635760405163616bc44160e11b815260040160405180910390fd5b603480546001600160a01b0319166001600160a01b0383169081179091556040517f51744122301b50e919f4e3d22adf8c53abc92195b8c667eda98c6ef20375672e90600090a250565b806001600160401b03166000036116d75760405163c4411f1160e01b815260040160405180910390fd5b60348054600160a01b600160e01b031916600160a01b6001600160401b038416021790556040517f310462a9bf49fff4a57910ec647c77cbf8aaf2f13394554ac6cdf14fc68db7e69061172b908390612e60565b60405180910390a150565b80670de0b6b3a76400008110156117635760405163033f4e0560e01b815260040161053591815260200190565b5060358190556040518181527f97896b9da0f97f36bf3011570bcff930069299de4b1e89c9cb44909841cac2f89060200161172b565b806207a12063ffffffff821611156117c55760405163432e664360e11b81526004016105359190612cac565b506036805463ffffffff191663ffffffff83161790556040517fc573dc0f869f6a1d0a74fc7712a63baabcb5567131d2d98005e163924eddcbab9061172b908390612cac565b8063ffffffff8116620f4240101561183757604051634e9374fb60e11b81526004016105359190612cac565b506036805463ffffffff60201b1916600160201b63ffffffff848116820292909217928390556040517f7efaf01bec3cda8d104163bb466d01d7e16f68848301c7eb0749cfa59d6805029361172b9392900490911690612cac565b3361189b610dc5565b6001600160a01b031614610a11573360405163118cdaa760e01b81526004016105359190612e20565b60048101805461ff001916610500179055600181015460028201546118f5916001600160a01b031690610d196119ca565b6001810154815460028301546040519081526001600160a01b03928316929091169084907f223103f8eb52e5f43a75655152acd882a605d70df57a5c0fefd30f516b1756d2906020015b60405180910390a45050565b60048101805461ff001916610200179055600281015461197c9061196d6119ca565b6001600160a01b03169061290e565b6001810154815460028301546040519081526001600160a01b03928316929091169084907f2226ebd23625a7938fb786df2248bd171d2e6ad70cb2b654ea1be830ca17224d9060200161193f565b7f000000000000000000000000000000000000000000000000000000000000000090565b80156109a9576040516323b872dd60e01b81526001600160a01b038381166004830152306024830152604482018390528416906323b872dd906064015b6020604051808303816000875af1158015611a4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a6e9190613488565b6109a95760405162461bcd60e51b815260206004820152600960248201526810ba3930b739b332b960b91b6044820152606401610535565b6040516001600160601b0319606084901b166020820152603481018290526000908190605401604051602081830303815290604052805190602001209050611aed81611073565b158190611b105760405163124a23f160e11b815260040161053591815260200190565b506000611b1b611f45565b90506000816001600160a01b0316630e022923876040518263ffffffff1660e01b8152600401611b4b9190612e20565b61012060405180830381865afa158015611b69573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b8d91906132d9565b8051909150866001600160a01b038216611bbb576040516334789d8b60e21b81526004016105359190612e20565b506000611bc6611f21565b6001600160a01b03166325d9897e83866040518363ffffffff1660e01b8152600401611bf3929190613389565b61014060405180830381865afa158015611c11573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c3591906133b9565b8051909150600003611c5a5760405163307efdb760e11b815260040160405180910390fd5b6000611c6a8383600001516120d0565b603454909150600090611c8d90600160a01b90046001600160401b03164261330c565b604080516101208101825287516001600160a01b0390811682528f1660208201529081018d905260006060820152909150608081016001815260200160048152426020808301919091526040808301859052606092830186905260008b815260378352819020845181546001600160a01b039182166001600160a01b0319918216178355938601516001808401805492909316919095161790559084015160028201559183015160038084019190915560808401516004840180549193909260ff19909216918490811115611d6457611d64612d8b565b021790555060a082015160048201805461ff001916610100836005811115611d8e57611d8e612d8b565b021790555060c0820151600582015560e08201516006820155610100909101516007909101558451604080518d81526001600160a01b038d811660208301529181018c90526060810185905260808101849052818f16929091169089907f8a1eccecce948a912e2e195de5960359755aeac90ad88a3fde55a77e1a73796b9060a00160405180910390a450949a9950505050505050505050565b600054815160208084015160409485015185517f32dd026408194a0d7e54cc66a2ab6c856efc55cfcd4dd258fde5b1a55222baa6818501528087019490945260608401919091526080808401919091528451808403909101815260a08301855280519082012061190160f01b60c084015260c283019390935260e28083019390935283518083039093018352610102909101909252805191012090565b6000611ecf611fbc565b80546001600160a01b038481166001600160a01b031983168117845560405193945091169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b6033546000906001600160a01b0316611f715760405163bd088b4f60e01b815260040160405180910390fd5b506033546001600160a01b031690565b80156109a95760405163a9059cbb60e01b81526001600160a01b0383811660048301526024820183905284169063a9059cbb90604401611a2b565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930090565b60048101805461ff00191661030017905560018101546002820154612011916001600160a01b031690610d196119ca565b6001810154815460028301546040519081526001600160a01b03928316929091169084907ff0912efb86ea1d65a17d64d48393cdb1ca0ea5220dd2bbe438621199d30955b79060200161193f565b6001600160a01b0381166120865760405163616bc44160e11b815260040160405180910390fd5b603380546001600160a01b0319166001600160a01b0383169081179091556040517f81dcb738da3dabd5bb2adbc7dd107fbbfca936e9c8aecab25f5b17a710a784c790600090a250565b6000806120db611f21565b6001600160a01b031663561285e4856120f2611f45565b6040518363ffffffff1660e01b815260040161210f929190613389565b60a060405180830381865afa15801561212c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061215091906134a5565b51905061215d818461330c565b949350505050565b6040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a081019190915260016121a460208061330c565b6121ae919061330c565b6121b990606061330c565b82519081149060016121cc60208061330c565b6121d6919061330c565b6121e190606061330c565b909161220257604051633fdf342360e01b8152600401610535929190613054565b505060008060008480602001905181019061221d9190613524565b925092509250600061223086606061296e565b90506000612249876122446020606061330c565b61296e565b9050600061226d88602061225e81606061330c565b612268919061330c565b6129b9565b6040805160c081018252978852602088019690965294860193909352606085019190915260808401525060ff1660a082015292915050565b6000806122b1846113e2565b905060006122bd611f21565b6001600160a01b03166325d9897e836122d4611f45565b6040518363ffffffff1660e01b81526004016122f1929190613389565b61014060405180830381865afa15801561230f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061233391906133b9565b80519091506000036123585760405163307efdb760e11b815260040160405180910390fd5b84516020808701516040808901518151938401949094528201526060808201929092526001600160601b031984831b811660808301529189901b909116609482015260009060a8016040516020818303038152906040528051906020012090506123c181611073565b1581906123e45760405163124a23f160e11b815260040161053591815260200190565b5060006123f58484600001516120d0565b60345490915060009061241890600160a01b90046001600160401b03164261330c565b60408051610120810182526001600160a01b0380891682528d1660208201529081018b9052600060608201529091506080810160028152602001600481524260208083019190915260408083018590526060928301869052600087815260378352819020845181546001600160a01b039182166001600160a01b0319918216178355938601516001808401805492909316919095161790559084015160028201559183015160038084019190915560808401516004840180549193909260ff199092169184908111156124ed576124ed612d8b565b021790555060a082015160048201805461ff00191661010083600581111561251757612517612d8b565b021790555060c0820151816005015560e082015181600601556101008201518160070155905050896001600160a01b0316856001600160a01b0316847ffb70faf7306b83c2cec6d8c1627baad892cb79968a02cc0353174499ecfd8b358c8c604001518c878960405161258e959493929190613552565b60405180910390a4509098975050505050505050565b805182516000911480156125bf575081604001518360400151145b80156109dd575050602090810151910151141590565b60408051606081018252825181526020808401519082015282820151918101919091526000908161260582611e28565b905061215d81856060015186608001518760a0015160405160200161264a93929190928352602083019190915260f81b6001600160f81b031916604082015260410190565b604051602081830303815290604052612a04565b600080612669611f45565b90506000612675611f21565b6001600160a01b03166325d9897e87846040518363ffffffff1660e01b81526004016126a2929190613389565b61014060405180830381865afa1580156126c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126e491906133b9565b60365490915060009061270990869063ffffffff600160201b909104811690612a2e16565b9050851580159061271a5750808611155b8682909161273d5760405163cc6b7c4160e01b8152600401610535929190613054565b5050600061274f878460000151612a8e565b60608401516036549192506000916127709163ffffffff9081169116612a8e565b9050600061277e8284612a2e565b9050856001600160a01b031663cb8347fe8b8b846040516020016127a3929190613054565b6040516020818303038152906040526040518363ffffffff1660e01b81526004016127cf929190613365565b600060405180830381600087803b1580156127e957600080fd5b505af11580156127fd573d6000803e3d6000fd5b50929c9b505050505050505050505050565b612817612aa5565b610a1157604051631afcd79f60e31b815260040160405180910390fd5b61150e61280f565b61284461280f565b604080517fd87cd6ef79d4e2b95e15ce8abf732db51ec771f1ca2edccf22a46c729ac5647260208201527f171a7fa058648750a8c5aae430f30db8d0100efc3a5e1b2e8054b1c1ce28b6b4918101919091527f044852b2a670ade5407e78fb2863c51de9fcb96542a07186fe3aeda6bb8a116d60608201524660808201523060a08201527fa070ffb1cd7409649bf77822cce74495468e06dbfaef09556838bf188679b9c260c082015260e00160408051601f198184030181529190528051602090910120600055565b801561296a57604051630852cd8d60e31b8152600481018290526001600160a01b038316906342966c6890602401600060405180830381600087803b15801561295657600080fd5b505af115801561105a573d6000803e3d6000fd5b5050565b600061297b60208361330c565b8351908110159061298d60208561330c565b90916129ae57604051633fdf342360e01b8152600401610535929190613054565b505050016020015190565b60006129c660018361330c565b835190811015906129d860018561330c565b90916129f957604051633fdf342360e01b8152600401610535929190613054565b505050016001015190565b600080600080612a148686612abf565b925092509250612a248282612b0c565b5090949350505050565b6000612a3d83620f4240101590565b80612a505750612a5082620f4240101590565b83839091612a735760405163768bf0eb60e11b8152600401610535929190613054565b50620f42409050612a848385613585565b6109dd9190613466565b600081831115612a9e57816109dd565b5090919050565b6000612aaf6115f2565b54600160401b900460ff16919050565b60008060008351604103612af95760208401516040850151606086015160001a612aeb88828585612bc5565b955095509550505050612b05565b50508151600091506002905b9250925092565b6000826003811115612b2057612b20612d8b565b03612b29575050565b6001826003811115612b3d57612b3d612d8b565b03612b5b5760405163f645eedf60e01b815260040160405180910390fd5b6002826003811115612b6f57612b6f612d8b565b03612b905760405163fce698f760e01b815260048101829052602401610535565b6003826003811115612ba457612ba4612d8b565b0361296a576040516335e2f38360e21b815260048101829052602401610535565b600080806fa2a8918ca85bafe22016d0b997e4df60600160ff1b03841115612bf65750600091506003905082612c80565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa158015612c4a573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116612c7657506000925060019150829050612c80565b9250600091508190505b9450945094915050565b60008060408385031215612c9d57600080fd5b50508035926020909101359150565b63ffffffff91909116815260200190565b6001600160a01b038116811461074557600080fd5b6001600160401b038116811461074557600080fd5b63ffffffff8116811461074557600080fd5b60008060008060008060c08789031215612d1257600080fd5b8635612d1d81612cbd565b95506020870135612d2d81612cbd565b94506040870135612d3d81612cd2565b9350606087013592506080870135612d5481612ce7565b915060a0870135612d6481612ce7565b809150509295509295509295565b600060208284031215612d8457600080fd5b5035919050565b634e487b7160e01b600052602160045260246000fd5b60068110612db157612db1612d8b565b9052565b6001600160a01b038a81168252891660208201526040810188905260608101879052610120810160048710612dec57612dec612d8b565b866080830152612dff60a0830187612da1565b8460c08301528360e0830152826101008301529a9950505050505050505050565b6001600160a01b0391909116815260200190565b60008060408385031215612e4757600080fd5b8235612e5281612cbd565b946020939093013593505050565b6001600160401b0391909116815260200190565b60006060828403128015612e8757600080fd5b509092915050565b600060208284031215612ea157600080fd5b813561113a81612ce7565b60008060008060808587031215612ec257600080fd5b8435612ecd81612cbd565b93506020850135612edd81612cbd565b93969395505050506040820135916060013590565b600060208284031215612f0457600080fd5b813561113a81612cbd565b801515811461074557600080fd5b60008060008060808587031215612f3357600080fd5b84359350602085013592506040850135612f4c81612f0f565b9396929550929360600135925050565b60008083601f840112612f6e57600080fd5b5081356001600160401b03811115612f8557600080fd5b602083019150836020828501011115612f9d57600080fd5b9250929050565b60008060208385031215612fb757600080fd5b82356001600160401b03811115612fcd57600080fd5b612fd985828601612f5c565b90969095509350505050565b60008060008060408587031215612ffb57600080fd5b84356001600160401b0381111561301157600080fd5b61301d87828801612f5c565b90955093505060208501356001600160401b0381111561303c57600080fd5b61304887828801612f5c565b95989497509550505050565b918252602082015260400190565b60405160c081016001600160401b038111828210171561309257634e487b7160e01b600052604160045260246000fd5b60405290565b60405161012081016001600160401b038111828210171561309257634e487b7160e01b600052604160045260246000fd5b60405161014081016001600160401b038111828210171561309257634e487b7160e01b600052604160045260246000fd5b600060c082840312801561310d57600080fd5b506000613118613062565b833581526020808501359082015260408085013590820152606080850135908201526080808501359082015260a084013560ff81168114613157578283fd5b60a0820152949350505050565b600060c0828403121561317657600080fd5b50919050565b600080610180838503121561319057600080fd5b61319a8484613164565b91506131a98460c08501613164565b90509250929050565b6000602082840312156131c457600080fd5b813561113a81612cd2565b602081016109e08284612da1565b600060608284031280156131f057600080fd5b50604051600090606081016001600160401b038111828210171561322257634e487b7160e01b83526041600452602483fd5b604090815284358252602080860135908301529384013593810193909352509092915050565b805161325381612cbd565b919050565b6000610120828403121561326b57600080fd5b613273613098565b905061327e82613248565b81526020828101519082015260408083015190820152606080830151908201526080808301519082015260a0808301519082015260c0808301519082015260e080830151908201526101009182015191810191909152919050565b600061012082840312156132ec57600080fd5b6109dd8383613258565b634e487b7160e01b600052601160045260246000fd5b808201808211156109e0576109e06132f6565b6000815180845260005b8181101561334557602081850181015186830182015201613329565b506000602082860101526020601f19601f83011685010191505092915050565b6001600160a01b038316815260406020820181905260009061215d9083018461331f565b6001600160a01b0392831681529116602082015260400190565b805161325381612ce7565b805161325381612cd2565b60006101408284031280156133cd57600080fd5b5060006133d86130c9565b8351815260208085015190820152604080850151908201526133fc606085016133a3565b606082015261340d608085016133ae565b608082015261341e60a085016133ae565b60a082015261342f60c085016133a3565b60c082015261344060e085016133ae565b60e082015261010084810151908201526101209384015193810193909352509092915050565b60008261348357634e487b7160e01b600052601260045260246000fd5b500490565b60006020828403121561349a57600080fd5b815161113a81612f0f565b600060a08284031280156134b857600080fd5b5060405160009060a081016001600160401b03811182821017156134ea57634e487b7160e01b83526041600452602483fd5b6040908152845182526020808601519083015284810151908201526060808501519082015260809384015193810193909352509092915050565b60008060006060848603121561353957600080fd5b5050815160208301516040909301519094929350919050565b85815284602082015260a06040820152600061357160a083018661331f565b606083019490945250608001529392505050565b80820281158282048414176109e0576109e06132f656fe6d800aaaf64b9a1f321dcd63da04369d33d8a0d49ad0fbba085aab4a98bf31c4a2646970667358221220d50b3dec1e5d2d1d140733dca7d5163900c1fc882947b3208864910c6f452d0e64736f6c634300081b0033", + "linkReferences": {}, + "deployedLinkReferences": {} +} \ No newline at end of file diff --git a/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/DisputeManager#ProxyAdmin.json b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/DisputeManager#ProxyAdmin.json new file mode 100644 index 000000000..8db6171f9 --- /dev/null +++ b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/DisputeManager#ProxyAdmin.json @@ -0,0 +1,132 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "ProxyAdmin", + "sourceName": "contracts/proxy/transparent/ProxyAdmin.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "initialOwner", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "OwnableInvalidOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "OwnableUnauthorizedAccount", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "inputs": [], + "name": "UPGRADE_INTERFACE_VERSION", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ITransparentUpgradeableProxy", + "name": "proxy", + "type": "address" + }, + { + "internalType": "address", + "name": "implementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ], + "bytecode": "0x608060405234801561000f575f80fd5b506040516104fc3803806104fc83398101604081905261002e916100bb565b806001600160a01b03811661005c57604051631e4fbdf760e01b81525f600482015260240160405180910390fd5b6100658161006c565b50506100e8565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b5f602082840312156100cb575f80fd5b81516001600160a01b03811681146100e1575f80fd5b9392505050565b610407806100f55f395ff3fe608060405260043610610049575f3560e01c8063715018a61461004d5780638da5cb5b146100635780639623609d1461008e578063ad3cb1cc146100a1578063f2fde38b146100de575b5f80fd5b348015610058575f80fd5b506100616100fd565b005b34801561006e575f80fd5b505f546040516001600160a01b0390911681526020015b60405180910390f35b61006161009c366004610260565b610110565b3480156100ac575f80fd5b506100d1604051806040016040528060058152602001640352e302e360dc1b81525081565b6040516100859190610372565b3480156100e9575f80fd5b506100616100f836600461038b565b61017b565b6101056101bd565b61010e5f6101e9565b565b6101186101bd565b60405163278f794360e11b81526001600160a01b03841690634f1ef28690349061014890869086906004016103a6565b5f604051808303818588803b15801561015f575f80fd5b505af1158015610171573d5f803e3d5ffd5b5050505050505050565b6101836101bd565b6001600160a01b0381166101b157604051631e4fbdf760e01b81525f60048201526024015b60405180910390fd5b6101ba816101e9565b50565b5f546001600160a01b0316331461010e5760405163118cdaa760e01b81523360048201526024016101a8565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b03811681146101ba575f80fd5b634e487b7160e01b5f52604160045260245ffd5b5f805f60608486031215610272575f80fd5b833561027d81610238565b9250602084013561028d81610238565b9150604084013567ffffffffffffffff808211156102a9575f80fd5b818601915086601f8301126102bc575f80fd5b8135818111156102ce576102ce61024c565b604051601f8201601f19908116603f011681019083821181831017156102f6576102f661024c565b8160405282815289602084870101111561030e575f80fd5b826020860160208301375f6020848301015280955050505050509250925092565b5f81518084525f5b8181101561035357602081850181015186830182015201610337565b505f602082860101526020601f19601f83011685010191505092915050565b602081525f610384602083018461032f565b9392505050565b5f6020828403121561039b575f80fd5b813561038481610238565b6001600160a01b03831681526040602082018190525f906103c99083018461032f565b94935050505056fea2646970667358221220098134bf3dcb274377e55b14b69b89c7eefde1171c4c5b1eb6233b5158fa785b64736f6c63430008180033", + "deployedBytecode": "0x608060405260043610610049575f3560e01c8063715018a61461004d5780638da5cb5b146100635780639623609d1461008e578063ad3cb1cc146100a1578063f2fde38b146100de575b5f80fd5b348015610058575f80fd5b506100616100fd565b005b34801561006e575f80fd5b505f546040516001600160a01b0390911681526020015b60405180910390f35b61006161009c366004610260565b610110565b3480156100ac575f80fd5b506100d1604051806040016040528060058152602001640352e302e360dc1b81525081565b6040516100859190610372565b3480156100e9575f80fd5b506100616100f836600461038b565b61017b565b6101056101bd565b61010e5f6101e9565b565b6101186101bd565b60405163278f794360e11b81526001600160a01b03841690634f1ef28690349061014890869086906004016103a6565b5f604051808303818588803b15801561015f575f80fd5b505af1158015610171573d5f803e3d5ffd5b5050505050505050565b6101836101bd565b6001600160a01b0381166101b157604051631e4fbdf760e01b81525f60048201526024015b60405180910390fd5b6101ba816101e9565b50565b5f546001600160a01b0316331461010e5760405163118cdaa760e01b81523360048201526024016101a8565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b03811681146101ba575f80fd5b634e487b7160e01b5f52604160045260245ffd5b5f805f60608486031215610272575f80fd5b833561027d81610238565b9250602084013561028d81610238565b9150604084013567ffffffffffffffff808211156102a9575f80fd5b818601915086601f8301126102bc575f80fd5b8135818111156102ce576102ce61024c565b604051601f8201601f19908116603f011681019083821181831017156102f6576102f661024c565b8160405282815289602084870101111561030e575f80fd5b826020860160208301375f6020848301015280955050505050509250925092565b5f81518084525f5b8181101561035357602081850181015186830182015201610337565b505f602082860101526020601f19601f83011685010191505092915050565b602081525f610384602083018461032f565b9392505050565b5f6020828403121561039b575f80fd5b813561038481610238565b6001600160a01b03831681526040602082018190525f906103c99083018461032f565b94935050505056fea2646970667358221220098134bf3dcb274377e55b14b69b89c7eefde1171c4c5b1eb6233b5158fa785b64736f6c63430008180033", + "linkReferences": {}, + "deployedLinkReferences": {} +} \ No newline at end of file diff --git a/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/EpochManager#EpochManager.json b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/EpochManager#EpochManager.json new file mode 100644 index 000000000..b14ccddd8 --- /dev/null +++ b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/EpochManager#EpochManager.json @@ -0,0 +1,364 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "EpochManager", + "sourceName": "contracts/epochs/EpochManager.sol", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "nameHash", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "contractAddress", + "type": "address" + } + ], + "name": "ContractSynced", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "epoch", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "epochLength", + "type": "uint256" + } + ], + "name": "EpochLengthUpdate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "epoch", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "EpochRun", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "param", + "type": "string" + } + ], + "name": "ParameterUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "controller", + "type": "address" + } + ], + "name": "SetController", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "contract IGraphProxy", + "name": "_proxy", + "type": "address" + } + ], + "name": "acceptProxy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IGraphProxy", + "name": "_proxy", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "acceptProxyAndCall", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_block", + "type": "uint256" + } + ], + "name": "blockHash", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "blockNum", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "controller", + "outputs": [ + { + "internalType": "contract IController", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "currentEpoch", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "currentEpochBlock", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "currentEpochBlockSinceStart", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "epochLength", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_epoch", + "type": "uint256" + } + ], + "name": "epochsSince", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "epochsSinceUpdate", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_controller", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_epochLength", + "type": "uint256" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "isCurrentEpochRun", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "lastLengthUpdateBlock", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "lastLengthUpdateEpoch", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "lastRunEpoch", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "runEpoch", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_controller", + "type": "address" + } + ], + "name": "setController", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_epochLength", + "type": "uint256" + } + ], + "name": "setEpochLength", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "syncAllContracts", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "bytecode": "0x6101606040527fe6876326c1291dfcbbd3864a6816d698cd591defc7aa2153d7f9c4c04016c89f6080527fc713c3df6d14cdf946460395d09af88993ee2b948b1a808161494e32c5f6706360a0527f966f1e8d8d8014e05f6ec4a57138da9be1f7c5a7f802928a18072f7c5318076160c0527f1df41cd916959d1163dc8f0671a666ea8a3e434c13e40faef527133b5d16703460e0527f45fc200c7e4544e457d3c5709bfe0d520442c30bbcbdaede89e8d4a4bbc19247610100527fd362cac9cb75c10d67bcc0b7eeb0b1ef48bb5420b556c092d4fd7f758816fcf0610120527f39605a6c26a173774ca666c67ef70cf491880e5d3d6d0ca66ec0a31034f15ea36101405234801561011057600080fd5b5060805160a05160c05160e05161010051610120516101405161103461016460003980610aac525080610a83525080610a5a525080610a31525080610a085250806109df5250806109b652506110346000f3fe608060405234801561001057600080fd5b506004361061012c5760003560e01c8063a2594d82116100ad578063cd6dc68711610071578063cd6dc687146102c4578063d0cfa46e146102f0578063d6866ea5146102f8578063f77c479114610300578063faa1a23c146103245761012c565b8063a2594d821461027e578063ab93122c146102a4578063b4146a0b146102ac578063c46e58eb146102b4578063cc65149b146102bc5761012c565b806376671808116100f457806376671808146101ab57806385df51fd146101b35780638ae63d6d146101d057806392eefe9b146101d85780639ce7abe5146101fe5761012c565b806319c3b82d146101315780631b28126d1461014b5780631ce05d381461016857806354eea7961461018457806357d775f8146101a3575b600080fd5b61013961032c565b60408051918252519081900360200190f35b6101396004803603602081101561016157600080fd5b5035610353565b61017061037f565b604080519115158252519081900360200190f35b6101a16004803603602081101561019a57600080fd5b5035610392565b005b61013961047f565b610139610485565b610139600480360360208110156101c957600080fd5b503561049b565b61013961053b565b6101a1600480360360208110156101ee57600080fd5b50356001600160a01b031661053f565b6101a16004803603604081101561021457600080fd5b6001600160a01b03823516919081019060408101602082013564010000000081111561023f57600080fd5b82018360208201111561025157600080fd5b8035906020019184600183028401116401000000008311171561027357600080fd5b509092509050610553565b6101a16004803603602081101561029457600080fd5b50356001600160a01b03166106a9565b6101396107c4565b6101396107e6565b6101a16107ec565b610139610888565b6101a1600480360360408110156102da57600080fd5b506001600160a01b03813516906020013561088e565b610139610999565b6101a16109b1565b610308610ad2565b604080516001600160a01b039092168252519081900360200190f35b610139610ae1565b600061034e600c54610348600f5461034261053b565b90610ae7565b90610b49565b905090565b60008061035e610485565b905080831061036e576000610378565b6103788184610ae7565b9392505050565b6000610389610485565b600d5414905090565b61039a610bb0565b600081116103ea576040805162461bcd60e51b8152602060048201526018602482015277045706f6368206c656e6774682063616e6e6f7420626520360441b604482015290519081900360640190fd5b600c5481141561042b5760405162461bcd60e51b8152600401808060200182810382526029815260200180610f666029913960400191505060405180910390fd5b610433610485565b600e5561043e6107c4565b600f55600c819055600e546040805183815290517f25ddd6f00038d5eac0051df83c6084f140a01586f092e2728d1ed781c9ce24419181900360200190a250565b600c5481565b600061034e61049261032c565b600e5490610c84565b6000806104a661053b565b90508083106104e65760405162461bcd60e51b8152600401808060200182810382526023815260200180610fdc6023913960400191505060405180910390fd5b6101008110806104fa575061010081038310155b6105355760405162461bcd60e51b815260040180806020018281038252602c815260200180610fb0602c913960400191505060405180910390fd5b50504090565b4390565b610547610cde565b61055081610d3d565b50565b82806001600160a01b031663f851a4406040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561058f57600080fd5b505af11580156105a3573d6000803e3d6000fd5b505050506040513d60208110156105b957600080fd5b50516001600160a01b03163314610617576040805162461bcd60e51b815260206004820152601e60248201527f43616c6c6572206d757374206265207468652070726f78792061646d696e0000604482015290519081900360640190fd5b60405163623faf6160e01b8152602060048201908152602482018490526001600160a01b0386169163623faf619186918691908190604401848480828437600081840152601f19601f8201169050808301925050509350505050600060405180830381600087803b15801561068b57600080fd5b505af115801561069f573d6000803e3d6000fd5b5050505050505050565b80806001600160a01b031663f851a4406040518163ffffffff1660e01b8152600401602060405180830381600087803b1580156106e557600080fd5b505af11580156106f9573d6000803e3d6000fd5b505050506040513d602081101561070f57600080fd5b50516001600160a01b0316331461076d576040805162461bcd60e51b815260206004820152601e60248201527f43616c6c6572206d757374206265207468652070726f78792061646d696e0000604482015290519081900360640190fd5b816001600160a01b03166359fc20bb6040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156107a857600080fd5b505af11580156107bc573d6000803e3d6000fd5b505050505050565b600061034e6107dd600c546107d761032c565b90610de5565b600f5490610c84565b600e5481565b6107f461037f565b15610846576040805162461bcd60e51b815260206004820152601960248201527f43757272656e742065706f636820616c72656164792072756e00000000000000604482015290519081900360640190fd5b61084e610485565b600d8190556040805133815290517f666a37ccc682d20f8c51c5f6fd835cbadbcaaf09921e076282446e42d7264e3e9181900360200190a2565b600f5481565b610896610e3e565b6001600160a01b0316336001600160a01b0316146108f1576040805162461bcd60e51b815260206004820152601360248201527227b7363c9034b6b83632b6b2b73a30ba34b7b760691b604482015290519081900360640190fd5b60008111610941576040805162461bcd60e51b8152602060048201526018602482015277045706f6368206c656e6774682063616e6e6f7420626520360441b604482015290519081900360640190fd5b61094a82610547565b6001600e5561095761053b565b600f55600c819055600e546040805183815290517f25ddd6f00038d5eac0051df83c6084f140a01586f092e2728d1ed781c9ce24419181900360200190a25050565b60006109a36107c4565b6109ab61053b565b03905090565b6109da7f0000000000000000000000000000000000000000000000000000000000000000610e63565b610a037f0000000000000000000000000000000000000000000000000000000000000000610e63565b610a2c7f0000000000000000000000000000000000000000000000000000000000000000610e63565b610a557f0000000000000000000000000000000000000000000000000000000000000000610e63565b610a7e7f0000000000000000000000000000000000000000000000000000000000000000610e63565b610aa77f0000000000000000000000000000000000000000000000000000000000000000610e63565b610ad07f0000000000000000000000000000000000000000000000000000000000000000610e63565b565b6000546001600160a01b031681565b600d5481565b600082821115610b3e576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b508082035b92915050565b6000808211610b9f576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b818381610ba857fe5b049392505050565b60008054906101000a90046001600160a01b03166001600160a01b0316634fc07d756040518163ffffffff1660e01b815260040160206040518083038186803b158015610bfc57600080fd5b505afa158015610c10573d6000803e3d6000fd5b505050506040513d6020811015610c2657600080fd5b50516001600160a01b03163314610ad0576040805162461bcd60e51b815260206004820152601860248201527f4f6e6c7920436f6e74726f6c6c657220676f7665726e6f720000000000000000604482015290519081900360640190fd5b600082820183811015610378576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000546001600160a01b03163314610ad0576040805162461bcd60e51b815260206004820152601960248201527f43616c6c6572206d75737420626520436f6e74726f6c6c657200000000000000604482015290519081900360640190fd5b6001600160a01b038116610d91576040805162461bcd60e51b815260206004820152601660248201527510dbdb9d1c9bdb1b195c881b5d5cdd081899481cd95d60521b604482015290519081900360640190fd5b600080546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f4ff638452bbf33c012645d18ae6f05515ff5f2d1dfb0cece8cbf018c60903f709181900360200190a150565b600082610df457506000610b43565b82820282848281610e0157fe5b04146103785760405162461bcd60e51b8152600401808060200182810382526021815260200180610f8f6021913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6000805460408051637bb20d2f60e11b81526004810185905290516001600160a01b039092169163f7641a5e91602480820192602092909190829003018186803b158015610eb057600080fd5b505afa158015610ec4573d6000803e3d6000fd5b505050506040513d6020811015610eda57600080fd5b50516000838152600160205260409020549091506001600160a01b03808316911614610f615760008281526001602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251908152915184927fd0e7a942b1fc38c411c4f53d153ba14fd24542a6a35ebacd9b6afca1a154e20692908290030190a25b505056fe45706f6368206c656e677468206d75737420626520646966666572656e7420746f2063757272656e74536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7743616e206f6e6c792072657472696576652068617368657320666f72206c6173742032353620626c6f636b7343616e206f6e6c79207265747269657665207061737420626c6f636b20686173686573a264697066735822122045232c339fada874ae01964572e7664b10cfd18abe5a79dda984153cc999839564736f6c63430007060033", + "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061012c5760003560e01c8063a2594d82116100ad578063cd6dc68711610071578063cd6dc687146102c4578063d0cfa46e146102f0578063d6866ea5146102f8578063f77c479114610300578063faa1a23c146103245761012c565b8063a2594d821461027e578063ab93122c146102a4578063b4146a0b146102ac578063c46e58eb146102b4578063cc65149b146102bc5761012c565b806376671808116100f457806376671808146101ab57806385df51fd146101b35780638ae63d6d146101d057806392eefe9b146101d85780639ce7abe5146101fe5761012c565b806319c3b82d146101315780631b28126d1461014b5780631ce05d381461016857806354eea7961461018457806357d775f8146101a3575b600080fd5b61013961032c565b60408051918252519081900360200190f35b6101396004803603602081101561016157600080fd5b5035610353565b61017061037f565b604080519115158252519081900360200190f35b6101a16004803603602081101561019a57600080fd5b5035610392565b005b61013961047f565b610139610485565b610139600480360360208110156101c957600080fd5b503561049b565b61013961053b565b6101a1600480360360208110156101ee57600080fd5b50356001600160a01b031661053f565b6101a16004803603604081101561021457600080fd5b6001600160a01b03823516919081019060408101602082013564010000000081111561023f57600080fd5b82018360208201111561025157600080fd5b8035906020019184600183028401116401000000008311171561027357600080fd5b509092509050610553565b6101a16004803603602081101561029457600080fd5b50356001600160a01b03166106a9565b6101396107c4565b6101396107e6565b6101a16107ec565b610139610888565b6101a1600480360360408110156102da57600080fd5b506001600160a01b03813516906020013561088e565b610139610999565b6101a16109b1565b610308610ad2565b604080516001600160a01b039092168252519081900360200190f35b610139610ae1565b600061034e600c54610348600f5461034261053b565b90610ae7565b90610b49565b905090565b60008061035e610485565b905080831061036e576000610378565b6103788184610ae7565b9392505050565b6000610389610485565b600d5414905090565b61039a610bb0565b600081116103ea576040805162461bcd60e51b8152602060048201526018602482015277045706f6368206c656e6774682063616e6e6f7420626520360441b604482015290519081900360640190fd5b600c5481141561042b5760405162461bcd60e51b8152600401808060200182810382526029815260200180610f666029913960400191505060405180910390fd5b610433610485565b600e5561043e6107c4565b600f55600c819055600e546040805183815290517f25ddd6f00038d5eac0051df83c6084f140a01586f092e2728d1ed781c9ce24419181900360200190a250565b600c5481565b600061034e61049261032c565b600e5490610c84565b6000806104a661053b565b90508083106104e65760405162461bcd60e51b8152600401808060200182810382526023815260200180610fdc6023913960400191505060405180910390fd5b6101008110806104fa575061010081038310155b6105355760405162461bcd60e51b815260040180806020018281038252602c815260200180610fb0602c913960400191505060405180910390fd5b50504090565b4390565b610547610cde565b61055081610d3d565b50565b82806001600160a01b031663f851a4406040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561058f57600080fd5b505af11580156105a3573d6000803e3d6000fd5b505050506040513d60208110156105b957600080fd5b50516001600160a01b03163314610617576040805162461bcd60e51b815260206004820152601e60248201527f43616c6c6572206d757374206265207468652070726f78792061646d696e0000604482015290519081900360640190fd5b60405163623faf6160e01b8152602060048201908152602482018490526001600160a01b0386169163623faf619186918691908190604401848480828437600081840152601f19601f8201169050808301925050509350505050600060405180830381600087803b15801561068b57600080fd5b505af115801561069f573d6000803e3d6000fd5b5050505050505050565b80806001600160a01b031663f851a4406040518163ffffffff1660e01b8152600401602060405180830381600087803b1580156106e557600080fd5b505af11580156106f9573d6000803e3d6000fd5b505050506040513d602081101561070f57600080fd5b50516001600160a01b0316331461076d576040805162461bcd60e51b815260206004820152601e60248201527f43616c6c6572206d757374206265207468652070726f78792061646d696e0000604482015290519081900360640190fd5b816001600160a01b03166359fc20bb6040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156107a857600080fd5b505af11580156107bc573d6000803e3d6000fd5b505050505050565b600061034e6107dd600c546107d761032c565b90610de5565b600f5490610c84565b600e5481565b6107f461037f565b15610846576040805162461bcd60e51b815260206004820152601960248201527f43757272656e742065706f636820616c72656164792072756e00000000000000604482015290519081900360640190fd5b61084e610485565b600d8190556040805133815290517f666a37ccc682d20f8c51c5f6fd835cbadbcaaf09921e076282446e42d7264e3e9181900360200190a2565b600f5481565b610896610e3e565b6001600160a01b0316336001600160a01b0316146108f1576040805162461bcd60e51b815260206004820152601360248201527227b7363c9034b6b83632b6b2b73a30ba34b7b760691b604482015290519081900360640190fd5b60008111610941576040805162461bcd60e51b8152602060048201526018602482015277045706f6368206c656e6774682063616e6e6f7420626520360441b604482015290519081900360640190fd5b61094a82610547565b6001600e5561095761053b565b600f55600c819055600e546040805183815290517f25ddd6f00038d5eac0051df83c6084f140a01586f092e2728d1ed781c9ce24419181900360200190a25050565b60006109a36107c4565b6109ab61053b565b03905090565b6109da7f0000000000000000000000000000000000000000000000000000000000000000610e63565b610a037f0000000000000000000000000000000000000000000000000000000000000000610e63565b610a2c7f0000000000000000000000000000000000000000000000000000000000000000610e63565b610a557f0000000000000000000000000000000000000000000000000000000000000000610e63565b610a7e7f0000000000000000000000000000000000000000000000000000000000000000610e63565b610aa77f0000000000000000000000000000000000000000000000000000000000000000610e63565b610ad07f0000000000000000000000000000000000000000000000000000000000000000610e63565b565b6000546001600160a01b031681565b600d5481565b600082821115610b3e576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b508082035b92915050565b6000808211610b9f576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b818381610ba857fe5b049392505050565b60008054906101000a90046001600160a01b03166001600160a01b0316634fc07d756040518163ffffffff1660e01b815260040160206040518083038186803b158015610bfc57600080fd5b505afa158015610c10573d6000803e3d6000fd5b505050506040513d6020811015610c2657600080fd5b50516001600160a01b03163314610ad0576040805162461bcd60e51b815260206004820152601860248201527f4f6e6c7920436f6e74726f6c6c657220676f7665726e6f720000000000000000604482015290519081900360640190fd5b600082820183811015610378576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000546001600160a01b03163314610ad0576040805162461bcd60e51b815260206004820152601960248201527f43616c6c6572206d75737420626520436f6e74726f6c6c657200000000000000604482015290519081900360640190fd5b6001600160a01b038116610d91576040805162461bcd60e51b815260206004820152601660248201527510dbdb9d1c9bdb1b195c881b5d5cdd081899481cd95d60521b604482015290519081900360640190fd5b600080546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f4ff638452bbf33c012645d18ae6f05515ff5f2d1dfb0cece8cbf018c60903f709181900360200190a150565b600082610df457506000610b43565b82820282848281610e0157fe5b04146103785760405162461bcd60e51b8152600401808060200182810382526021815260200180610f8f6021913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6000805460408051637bb20d2f60e11b81526004810185905290516001600160a01b039092169163f7641a5e91602480820192602092909190829003018186803b158015610eb057600080fd5b505afa158015610ec4573d6000803e3d6000fd5b505050506040513d6020811015610eda57600080fd5b50516000838152600160205260409020549091506001600160a01b03808316911614610f615760008281526001602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251908152915184927fd0e7a942b1fc38c411c4f53d153ba14fd24542a6a35ebacd9b6afca1a154e20692908290030190a25b505056fe45706f6368206c656e677468206d75737420626520646966666572656e7420746f2063757272656e74536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7743616e206f6e6c792072657472696576652068617368657320666f72206c6173742032353620626c6f636b7343616e206f6e6c79207265747269657665207061737420626c6f636b20686173686573a264697066735822122045232c339fada874ae01964572e7664b10cfd18abe5a79dda984153cc999839564736f6c63430007060033", + "linkReferences": {}, + "deployedLinkReferences": {} +} \ No newline at end of file diff --git a/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/EpochManager#EpochManager_ProxyWithABI.json b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/EpochManager#EpochManager_ProxyWithABI.json new file mode 100644 index 000000000..b14ccddd8 --- /dev/null +++ b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/EpochManager#EpochManager_ProxyWithABI.json @@ -0,0 +1,364 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "EpochManager", + "sourceName": "contracts/epochs/EpochManager.sol", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "nameHash", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "contractAddress", + "type": "address" + } + ], + "name": "ContractSynced", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "epoch", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "epochLength", + "type": "uint256" + } + ], + "name": "EpochLengthUpdate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "epoch", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "EpochRun", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "param", + "type": "string" + } + ], + "name": "ParameterUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "controller", + "type": "address" + } + ], + "name": "SetController", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "contract IGraphProxy", + "name": "_proxy", + "type": "address" + } + ], + "name": "acceptProxy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IGraphProxy", + "name": "_proxy", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "acceptProxyAndCall", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_block", + "type": "uint256" + } + ], + "name": "blockHash", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "blockNum", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "controller", + "outputs": [ + { + "internalType": "contract IController", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "currentEpoch", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "currentEpochBlock", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "currentEpochBlockSinceStart", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "epochLength", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_epoch", + "type": "uint256" + } + ], + "name": "epochsSince", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "epochsSinceUpdate", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_controller", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_epochLength", + "type": "uint256" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "isCurrentEpochRun", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "lastLengthUpdateBlock", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "lastLengthUpdateEpoch", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "lastRunEpoch", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "runEpoch", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_controller", + "type": "address" + } + ], + "name": "setController", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_epochLength", + "type": "uint256" + } + ], + "name": "setEpochLength", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "syncAllContracts", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "bytecode": "0x6101606040527fe6876326c1291dfcbbd3864a6816d698cd591defc7aa2153d7f9c4c04016c89f6080527fc713c3df6d14cdf946460395d09af88993ee2b948b1a808161494e32c5f6706360a0527f966f1e8d8d8014e05f6ec4a57138da9be1f7c5a7f802928a18072f7c5318076160c0527f1df41cd916959d1163dc8f0671a666ea8a3e434c13e40faef527133b5d16703460e0527f45fc200c7e4544e457d3c5709bfe0d520442c30bbcbdaede89e8d4a4bbc19247610100527fd362cac9cb75c10d67bcc0b7eeb0b1ef48bb5420b556c092d4fd7f758816fcf0610120527f39605a6c26a173774ca666c67ef70cf491880e5d3d6d0ca66ec0a31034f15ea36101405234801561011057600080fd5b5060805160a05160c05160e05161010051610120516101405161103461016460003980610aac525080610a83525080610a5a525080610a31525080610a085250806109df5250806109b652506110346000f3fe608060405234801561001057600080fd5b506004361061012c5760003560e01c8063a2594d82116100ad578063cd6dc68711610071578063cd6dc687146102c4578063d0cfa46e146102f0578063d6866ea5146102f8578063f77c479114610300578063faa1a23c146103245761012c565b8063a2594d821461027e578063ab93122c146102a4578063b4146a0b146102ac578063c46e58eb146102b4578063cc65149b146102bc5761012c565b806376671808116100f457806376671808146101ab57806385df51fd146101b35780638ae63d6d146101d057806392eefe9b146101d85780639ce7abe5146101fe5761012c565b806319c3b82d146101315780631b28126d1461014b5780631ce05d381461016857806354eea7961461018457806357d775f8146101a3575b600080fd5b61013961032c565b60408051918252519081900360200190f35b6101396004803603602081101561016157600080fd5b5035610353565b61017061037f565b604080519115158252519081900360200190f35b6101a16004803603602081101561019a57600080fd5b5035610392565b005b61013961047f565b610139610485565b610139600480360360208110156101c957600080fd5b503561049b565b61013961053b565b6101a1600480360360208110156101ee57600080fd5b50356001600160a01b031661053f565b6101a16004803603604081101561021457600080fd5b6001600160a01b03823516919081019060408101602082013564010000000081111561023f57600080fd5b82018360208201111561025157600080fd5b8035906020019184600183028401116401000000008311171561027357600080fd5b509092509050610553565b6101a16004803603602081101561029457600080fd5b50356001600160a01b03166106a9565b6101396107c4565b6101396107e6565b6101a16107ec565b610139610888565b6101a1600480360360408110156102da57600080fd5b506001600160a01b03813516906020013561088e565b610139610999565b6101a16109b1565b610308610ad2565b604080516001600160a01b039092168252519081900360200190f35b610139610ae1565b600061034e600c54610348600f5461034261053b565b90610ae7565b90610b49565b905090565b60008061035e610485565b905080831061036e576000610378565b6103788184610ae7565b9392505050565b6000610389610485565b600d5414905090565b61039a610bb0565b600081116103ea576040805162461bcd60e51b8152602060048201526018602482015277045706f6368206c656e6774682063616e6e6f7420626520360441b604482015290519081900360640190fd5b600c5481141561042b5760405162461bcd60e51b8152600401808060200182810382526029815260200180610f666029913960400191505060405180910390fd5b610433610485565b600e5561043e6107c4565b600f55600c819055600e546040805183815290517f25ddd6f00038d5eac0051df83c6084f140a01586f092e2728d1ed781c9ce24419181900360200190a250565b600c5481565b600061034e61049261032c565b600e5490610c84565b6000806104a661053b565b90508083106104e65760405162461bcd60e51b8152600401808060200182810382526023815260200180610fdc6023913960400191505060405180910390fd5b6101008110806104fa575061010081038310155b6105355760405162461bcd60e51b815260040180806020018281038252602c815260200180610fb0602c913960400191505060405180910390fd5b50504090565b4390565b610547610cde565b61055081610d3d565b50565b82806001600160a01b031663f851a4406040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561058f57600080fd5b505af11580156105a3573d6000803e3d6000fd5b505050506040513d60208110156105b957600080fd5b50516001600160a01b03163314610617576040805162461bcd60e51b815260206004820152601e60248201527f43616c6c6572206d757374206265207468652070726f78792061646d696e0000604482015290519081900360640190fd5b60405163623faf6160e01b8152602060048201908152602482018490526001600160a01b0386169163623faf619186918691908190604401848480828437600081840152601f19601f8201169050808301925050509350505050600060405180830381600087803b15801561068b57600080fd5b505af115801561069f573d6000803e3d6000fd5b5050505050505050565b80806001600160a01b031663f851a4406040518163ffffffff1660e01b8152600401602060405180830381600087803b1580156106e557600080fd5b505af11580156106f9573d6000803e3d6000fd5b505050506040513d602081101561070f57600080fd5b50516001600160a01b0316331461076d576040805162461bcd60e51b815260206004820152601e60248201527f43616c6c6572206d757374206265207468652070726f78792061646d696e0000604482015290519081900360640190fd5b816001600160a01b03166359fc20bb6040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156107a857600080fd5b505af11580156107bc573d6000803e3d6000fd5b505050505050565b600061034e6107dd600c546107d761032c565b90610de5565b600f5490610c84565b600e5481565b6107f461037f565b15610846576040805162461bcd60e51b815260206004820152601960248201527f43757272656e742065706f636820616c72656164792072756e00000000000000604482015290519081900360640190fd5b61084e610485565b600d8190556040805133815290517f666a37ccc682d20f8c51c5f6fd835cbadbcaaf09921e076282446e42d7264e3e9181900360200190a2565b600f5481565b610896610e3e565b6001600160a01b0316336001600160a01b0316146108f1576040805162461bcd60e51b815260206004820152601360248201527227b7363c9034b6b83632b6b2b73a30ba34b7b760691b604482015290519081900360640190fd5b60008111610941576040805162461bcd60e51b8152602060048201526018602482015277045706f6368206c656e6774682063616e6e6f7420626520360441b604482015290519081900360640190fd5b61094a82610547565b6001600e5561095761053b565b600f55600c819055600e546040805183815290517f25ddd6f00038d5eac0051df83c6084f140a01586f092e2728d1ed781c9ce24419181900360200190a25050565b60006109a36107c4565b6109ab61053b565b03905090565b6109da7f0000000000000000000000000000000000000000000000000000000000000000610e63565b610a037f0000000000000000000000000000000000000000000000000000000000000000610e63565b610a2c7f0000000000000000000000000000000000000000000000000000000000000000610e63565b610a557f0000000000000000000000000000000000000000000000000000000000000000610e63565b610a7e7f0000000000000000000000000000000000000000000000000000000000000000610e63565b610aa77f0000000000000000000000000000000000000000000000000000000000000000610e63565b610ad07f0000000000000000000000000000000000000000000000000000000000000000610e63565b565b6000546001600160a01b031681565b600d5481565b600082821115610b3e576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b508082035b92915050565b6000808211610b9f576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b818381610ba857fe5b049392505050565b60008054906101000a90046001600160a01b03166001600160a01b0316634fc07d756040518163ffffffff1660e01b815260040160206040518083038186803b158015610bfc57600080fd5b505afa158015610c10573d6000803e3d6000fd5b505050506040513d6020811015610c2657600080fd5b50516001600160a01b03163314610ad0576040805162461bcd60e51b815260206004820152601860248201527f4f6e6c7920436f6e74726f6c6c657220676f7665726e6f720000000000000000604482015290519081900360640190fd5b600082820183811015610378576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000546001600160a01b03163314610ad0576040805162461bcd60e51b815260206004820152601960248201527f43616c6c6572206d75737420626520436f6e74726f6c6c657200000000000000604482015290519081900360640190fd5b6001600160a01b038116610d91576040805162461bcd60e51b815260206004820152601660248201527510dbdb9d1c9bdb1b195c881b5d5cdd081899481cd95d60521b604482015290519081900360640190fd5b600080546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f4ff638452bbf33c012645d18ae6f05515ff5f2d1dfb0cece8cbf018c60903f709181900360200190a150565b600082610df457506000610b43565b82820282848281610e0157fe5b04146103785760405162461bcd60e51b8152600401808060200182810382526021815260200180610f8f6021913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6000805460408051637bb20d2f60e11b81526004810185905290516001600160a01b039092169163f7641a5e91602480820192602092909190829003018186803b158015610eb057600080fd5b505afa158015610ec4573d6000803e3d6000fd5b505050506040513d6020811015610eda57600080fd5b50516000838152600160205260409020549091506001600160a01b03808316911614610f615760008281526001602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251908152915184927fd0e7a942b1fc38c411c4f53d153ba14fd24542a6a35ebacd9b6afca1a154e20692908290030190a25b505056fe45706f6368206c656e677468206d75737420626520646966666572656e7420746f2063757272656e74536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7743616e206f6e6c792072657472696576652068617368657320666f72206c6173742032353620626c6f636b7343616e206f6e6c79207265747269657665207061737420626c6f636b20686173686573a264697066735822122045232c339fada874ae01964572e7664b10cfd18abe5a79dda984153cc999839564736f6c63430007060033", + "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061012c5760003560e01c8063a2594d82116100ad578063cd6dc68711610071578063cd6dc687146102c4578063d0cfa46e146102f0578063d6866ea5146102f8578063f77c479114610300578063faa1a23c146103245761012c565b8063a2594d821461027e578063ab93122c146102a4578063b4146a0b146102ac578063c46e58eb146102b4578063cc65149b146102bc5761012c565b806376671808116100f457806376671808146101ab57806385df51fd146101b35780638ae63d6d146101d057806392eefe9b146101d85780639ce7abe5146101fe5761012c565b806319c3b82d146101315780631b28126d1461014b5780631ce05d381461016857806354eea7961461018457806357d775f8146101a3575b600080fd5b61013961032c565b60408051918252519081900360200190f35b6101396004803603602081101561016157600080fd5b5035610353565b61017061037f565b604080519115158252519081900360200190f35b6101a16004803603602081101561019a57600080fd5b5035610392565b005b61013961047f565b610139610485565b610139600480360360208110156101c957600080fd5b503561049b565b61013961053b565b6101a1600480360360208110156101ee57600080fd5b50356001600160a01b031661053f565b6101a16004803603604081101561021457600080fd5b6001600160a01b03823516919081019060408101602082013564010000000081111561023f57600080fd5b82018360208201111561025157600080fd5b8035906020019184600183028401116401000000008311171561027357600080fd5b509092509050610553565b6101a16004803603602081101561029457600080fd5b50356001600160a01b03166106a9565b6101396107c4565b6101396107e6565b6101a16107ec565b610139610888565b6101a1600480360360408110156102da57600080fd5b506001600160a01b03813516906020013561088e565b610139610999565b6101a16109b1565b610308610ad2565b604080516001600160a01b039092168252519081900360200190f35b610139610ae1565b600061034e600c54610348600f5461034261053b565b90610ae7565b90610b49565b905090565b60008061035e610485565b905080831061036e576000610378565b6103788184610ae7565b9392505050565b6000610389610485565b600d5414905090565b61039a610bb0565b600081116103ea576040805162461bcd60e51b8152602060048201526018602482015277045706f6368206c656e6774682063616e6e6f7420626520360441b604482015290519081900360640190fd5b600c5481141561042b5760405162461bcd60e51b8152600401808060200182810382526029815260200180610f666029913960400191505060405180910390fd5b610433610485565b600e5561043e6107c4565b600f55600c819055600e546040805183815290517f25ddd6f00038d5eac0051df83c6084f140a01586f092e2728d1ed781c9ce24419181900360200190a250565b600c5481565b600061034e61049261032c565b600e5490610c84565b6000806104a661053b565b90508083106104e65760405162461bcd60e51b8152600401808060200182810382526023815260200180610fdc6023913960400191505060405180910390fd5b6101008110806104fa575061010081038310155b6105355760405162461bcd60e51b815260040180806020018281038252602c815260200180610fb0602c913960400191505060405180910390fd5b50504090565b4390565b610547610cde565b61055081610d3d565b50565b82806001600160a01b031663f851a4406040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561058f57600080fd5b505af11580156105a3573d6000803e3d6000fd5b505050506040513d60208110156105b957600080fd5b50516001600160a01b03163314610617576040805162461bcd60e51b815260206004820152601e60248201527f43616c6c6572206d757374206265207468652070726f78792061646d696e0000604482015290519081900360640190fd5b60405163623faf6160e01b8152602060048201908152602482018490526001600160a01b0386169163623faf619186918691908190604401848480828437600081840152601f19601f8201169050808301925050509350505050600060405180830381600087803b15801561068b57600080fd5b505af115801561069f573d6000803e3d6000fd5b5050505050505050565b80806001600160a01b031663f851a4406040518163ffffffff1660e01b8152600401602060405180830381600087803b1580156106e557600080fd5b505af11580156106f9573d6000803e3d6000fd5b505050506040513d602081101561070f57600080fd5b50516001600160a01b0316331461076d576040805162461bcd60e51b815260206004820152601e60248201527f43616c6c6572206d757374206265207468652070726f78792061646d696e0000604482015290519081900360640190fd5b816001600160a01b03166359fc20bb6040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156107a857600080fd5b505af11580156107bc573d6000803e3d6000fd5b505050505050565b600061034e6107dd600c546107d761032c565b90610de5565b600f5490610c84565b600e5481565b6107f461037f565b15610846576040805162461bcd60e51b815260206004820152601960248201527f43757272656e742065706f636820616c72656164792072756e00000000000000604482015290519081900360640190fd5b61084e610485565b600d8190556040805133815290517f666a37ccc682d20f8c51c5f6fd835cbadbcaaf09921e076282446e42d7264e3e9181900360200190a2565b600f5481565b610896610e3e565b6001600160a01b0316336001600160a01b0316146108f1576040805162461bcd60e51b815260206004820152601360248201527227b7363c9034b6b83632b6b2b73a30ba34b7b760691b604482015290519081900360640190fd5b60008111610941576040805162461bcd60e51b8152602060048201526018602482015277045706f6368206c656e6774682063616e6e6f7420626520360441b604482015290519081900360640190fd5b61094a82610547565b6001600e5561095761053b565b600f55600c819055600e546040805183815290517f25ddd6f00038d5eac0051df83c6084f140a01586f092e2728d1ed781c9ce24419181900360200190a25050565b60006109a36107c4565b6109ab61053b565b03905090565b6109da7f0000000000000000000000000000000000000000000000000000000000000000610e63565b610a037f0000000000000000000000000000000000000000000000000000000000000000610e63565b610a2c7f0000000000000000000000000000000000000000000000000000000000000000610e63565b610a557f0000000000000000000000000000000000000000000000000000000000000000610e63565b610a7e7f0000000000000000000000000000000000000000000000000000000000000000610e63565b610aa77f0000000000000000000000000000000000000000000000000000000000000000610e63565b610ad07f0000000000000000000000000000000000000000000000000000000000000000610e63565b565b6000546001600160a01b031681565b600d5481565b600082821115610b3e576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b508082035b92915050565b6000808211610b9f576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b818381610ba857fe5b049392505050565b60008054906101000a90046001600160a01b03166001600160a01b0316634fc07d756040518163ffffffff1660e01b815260040160206040518083038186803b158015610bfc57600080fd5b505afa158015610c10573d6000803e3d6000fd5b505050506040513d6020811015610c2657600080fd5b50516001600160a01b03163314610ad0576040805162461bcd60e51b815260206004820152601860248201527f4f6e6c7920436f6e74726f6c6c657220676f7665726e6f720000000000000000604482015290519081900360640190fd5b600082820183811015610378576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000546001600160a01b03163314610ad0576040805162461bcd60e51b815260206004820152601960248201527f43616c6c6572206d75737420626520436f6e74726f6c6c657200000000000000604482015290519081900360640190fd5b6001600160a01b038116610d91576040805162461bcd60e51b815260206004820152601660248201527510dbdb9d1c9bdb1b195c881b5d5cdd081899481cd95d60521b604482015290519081900360640190fd5b600080546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f4ff638452bbf33c012645d18ae6f05515ff5f2d1dfb0cece8cbf018c60903f709181900360200190a150565b600082610df457506000610b43565b82820282848281610e0157fe5b04146103785760405162461bcd60e51b8152600401808060200182810382526021815260200180610f8f6021913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6000805460408051637bb20d2f60e11b81526004810185905290516001600160a01b039092169163f7641a5e91602480820192602092909190829003018186803b158015610eb057600080fd5b505afa158015610ec4573d6000803e3d6000fd5b505050506040513d6020811015610eda57600080fd5b50516000838152600160205260409020549091506001600160a01b03808316911614610f615760008281526001602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251908152915184927fd0e7a942b1fc38c411c4f53d153ba14fd24542a6a35ebacd9b6afca1a154e20692908290030190a25b505056fe45706f6368206c656e677468206d75737420626520646966666572656e7420746f2063757272656e74536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7743616e206f6e6c792072657472696576652068617368657320666f72206c6173742032353620626c6f636b7343616e206f6e6c79207265747269657665207061737420626c6f636b20686173686573a264697066735822122045232c339fada874ae01964572e7664b10cfd18abe5a79dda984153cc999839564736f6c63430007060033", + "linkReferences": {}, + "deployedLinkReferences": {} +} \ No newline at end of file diff --git a/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/EpochManager#GraphProxy.json b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/EpochManager#GraphProxy.json new file mode 100644 index 000000000..2cfb21e41 --- /dev/null +++ b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/EpochManager#GraphProxy.json @@ -0,0 +1,177 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "GraphProxy", + "sourceName": "contracts/upgrades/GraphProxy.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_impl", + "type": "address" + }, + { + "internalType": "address", + "name": "_admin", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldAdmin", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldImplementation", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "ImplementationUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldPendingImplementation", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newPendingImplementation", + "type": "address" + } + ], + "name": "PendingImplementationUpdated", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "acceptUpgrade", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "acceptUpgradeAndCall", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "pendingImplementation", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newAdmin", + "type": "address" + } + ], + "name": "setAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "bytecode": "0x608060405234801561001057600080fd5b50604051610a12380380610a128339818101604052604081101561003357600080fd5b50805160209091015161004581610055565b61004e826100b3565b5050610137565b600061005f610111565b6000805160206109d2833981519152838155604051919250906001600160a01b0380851691908416907f101b8081ff3b56bbf45deb824d86a3b0fd38b7e3dd42421105cf8abe9106db0b90600090a3505050565b60006100bd610124565b6000805160206109f2833981519152838155604051919250906001600160a01b0380851691908416907f980c0d30fe97457c47903527d88b7009a1643be6de24d2af664214919f0540a190600090a3505050565b6000805160206109d28339815191525490565b6000805160206109f28339815191525490565b61088c806101466000396000f3fe6080604052600436106100745760003560e01c80635c60da1b1161004e5780635c60da1b14610104578063623faf6114610119578063704b6c0214610196578063f851a440146101c957610083565b80633659cfe61461008b578063396f7b23146100be57806359fc20bb146100ef57610083565b36610083576100816101de565b005b6100816101de565b34801561009757600080fd5b50610081600480360360208110156100ae57600080fd5b50356001600160a01b031661029e565b3480156100ca57600080fd5b506100d36102d8565b604080516001600160a01b039092168252519081900360200190f35b3480156100fb57600080fd5b50610081610338565b34801561011057600080fd5b506100d3610393565b34801561012557600080fd5b506100816004803603602081101561013c57600080fd5b81019060208101813564010000000081111561015757600080fd5b82018360208201111561016957600080fd5b8035906020019184600183028401116401000000008311171561018b57600080fd5b5090925090506103e1565b3480156101a257600080fd5b50610081600480360360208110156101b957600080fd5b50356001600160a01b03166104f1565b3480156101d557600080fd5b506100d3610576565b6101e66105c0565b6001600160a01b0316336001600160a01b0316141561024c576040805162461bcd60e51b815260206004820152601f60248201527f43616e6e6f742066616c6c6261636b20746f2070726f78792074617267657400604482015290519081900360640190fd5b6040516001600160a01b037f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc541636600083376000803684845af490503d806000843e81801561029a578184f35b8184fd5b6102a66105c0565b6001600160a01b0316336001600160a01b031614156102cd576102c8816105e5565b6102d5565b6102d56101de565b50565b60006102e26105c0565b6001600160a01b0316336001600160a01b031614806103195750610304610655565b6001600160a01b0316336001600160a01b0316145b1561032d57610326610655565b9050610335565b6103356101de565b90565b6103406105c0565b6001600160a01b0316336001600160a01b031614806103775750610362610655565b6001600160a01b0316336001600160a01b0316145b156103895761038461067a565b610391565b6103916101de565b565b600061039d6105c0565b6001600160a01b0316336001600160a01b031614806103d457506103bf610655565b6001600160a01b0316336001600160a01b0316145b1561032d57610326610751565b6103e96105c0565b6001600160a01b0316336001600160a01b03161480610420575061040b610655565b6001600160a01b0316336001600160a01b0316145b156104e55761042d61067a565b6000610437610751565b6001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d8060008114610491576040519150601f19603f3d011682016040523d82523d6000602084013e610496565b606091505b50509050806104df576040805162461bcd60e51b815260206004820152601060248201526f125b5c1b0818d85b1b0819985a5b195960821b604482015290519081900360640190fd5b506104ed565b6104ed6101de565b5050565b6104f96105c0565b6001600160a01b0316336001600160a01b031614156102cd576001600160a01b03811661056d576040805162461bcd60e51b815260206004820152601e60248201527f41646d696e2063616e7420626520746865207a65726f20616464726573730000604482015290519081900360640190fd5b6102c881610776565b60006105806105c0565b6001600160a01b0316336001600160a01b031614806105b757506105a2610655565b6001600160a01b0316336001600160a01b0316145b1561032d576103265b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b60006105ef610655565b7f9e5eddc59e0b171f57125ab86bee043d9128098c3a6b9adb4f2e86333c2f6f8c838155604051919250906001600160a01b0380851691908416907f980c0d30fe97457c47903527d88b7009a1643be6de24d2af664214919f0540a190600090a3505050565b7f9e5eddc59e0b171f57125ab86bee043d9128098c3a6b9adb4f2e86333c2f6f8c5490565b6000610684610655565b90506001600160a01b0381166106e1576040805162461bcd60e51b815260206004820152601b60248201527f496d706c2063616e6e6f74206265207a65726f20616464726573730000000000604482015290519081900360640190fd5b336001600160a01b0382161461073e576040805162461bcd60e51b815260206004820152601b60248201527f4f6e6c792070656e64696e6720696d706c656d656e746174696f6e0000000000604482015290519081900360640190fd5b610747816107e6565b6102d560006105e5565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b60006107806105c0565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103838155604051919250906001600160a01b0380851691908416907f101b8081ff3b56bbf45deb824d86a3b0fd38b7e3dd42421105cf8abe9106db0b90600090a3505050565b60006107f0610751565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc838155604051919250906001600160a01b0380851691908416907faa3f731066a578e5f39b4215468d826cdd15373cbc0dfc9cb9bdc649718ef7da90600090a350505056fea264697066735822122041ce882775d17ef838c17f08249aa48a5f3ea1c65b581e69896452640b274de264736f6c63430007060033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61039e5eddc59e0b171f57125ab86bee043d9128098c3a6b9adb4f2e86333c2f6f8c", + "deployedBytecode": "0x6080604052600436106100745760003560e01c80635c60da1b1161004e5780635c60da1b14610104578063623faf6114610119578063704b6c0214610196578063f851a440146101c957610083565b80633659cfe61461008b578063396f7b23146100be57806359fc20bb146100ef57610083565b36610083576100816101de565b005b6100816101de565b34801561009757600080fd5b50610081600480360360208110156100ae57600080fd5b50356001600160a01b031661029e565b3480156100ca57600080fd5b506100d36102d8565b604080516001600160a01b039092168252519081900360200190f35b3480156100fb57600080fd5b50610081610338565b34801561011057600080fd5b506100d3610393565b34801561012557600080fd5b506100816004803603602081101561013c57600080fd5b81019060208101813564010000000081111561015757600080fd5b82018360208201111561016957600080fd5b8035906020019184600183028401116401000000008311171561018b57600080fd5b5090925090506103e1565b3480156101a257600080fd5b50610081600480360360208110156101b957600080fd5b50356001600160a01b03166104f1565b3480156101d557600080fd5b506100d3610576565b6101e66105c0565b6001600160a01b0316336001600160a01b0316141561024c576040805162461bcd60e51b815260206004820152601f60248201527f43616e6e6f742066616c6c6261636b20746f2070726f78792074617267657400604482015290519081900360640190fd5b6040516001600160a01b037f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc541636600083376000803684845af490503d806000843e81801561029a578184f35b8184fd5b6102a66105c0565b6001600160a01b0316336001600160a01b031614156102cd576102c8816105e5565b6102d5565b6102d56101de565b50565b60006102e26105c0565b6001600160a01b0316336001600160a01b031614806103195750610304610655565b6001600160a01b0316336001600160a01b0316145b1561032d57610326610655565b9050610335565b6103356101de565b90565b6103406105c0565b6001600160a01b0316336001600160a01b031614806103775750610362610655565b6001600160a01b0316336001600160a01b0316145b156103895761038461067a565b610391565b6103916101de565b565b600061039d6105c0565b6001600160a01b0316336001600160a01b031614806103d457506103bf610655565b6001600160a01b0316336001600160a01b0316145b1561032d57610326610751565b6103e96105c0565b6001600160a01b0316336001600160a01b03161480610420575061040b610655565b6001600160a01b0316336001600160a01b0316145b156104e55761042d61067a565b6000610437610751565b6001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d8060008114610491576040519150601f19603f3d011682016040523d82523d6000602084013e610496565b606091505b50509050806104df576040805162461bcd60e51b815260206004820152601060248201526f125b5c1b0818d85b1b0819985a5b195960821b604482015290519081900360640190fd5b506104ed565b6104ed6101de565b5050565b6104f96105c0565b6001600160a01b0316336001600160a01b031614156102cd576001600160a01b03811661056d576040805162461bcd60e51b815260206004820152601e60248201527f41646d696e2063616e7420626520746865207a65726f20616464726573730000604482015290519081900360640190fd5b6102c881610776565b60006105806105c0565b6001600160a01b0316336001600160a01b031614806105b757506105a2610655565b6001600160a01b0316336001600160a01b0316145b1561032d576103265b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b60006105ef610655565b7f9e5eddc59e0b171f57125ab86bee043d9128098c3a6b9adb4f2e86333c2f6f8c838155604051919250906001600160a01b0380851691908416907f980c0d30fe97457c47903527d88b7009a1643be6de24d2af664214919f0540a190600090a3505050565b7f9e5eddc59e0b171f57125ab86bee043d9128098c3a6b9adb4f2e86333c2f6f8c5490565b6000610684610655565b90506001600160a01b0381166106e1576040805162461bcd60e51b815260206004820152601b60248201527f496d706c2063616e6e6f74206265207a65726f20616464726573730000000000604482015290519081900360640190fd5b336001600160a01b0382161461073e576040805162461bcd60e51b815260206004820152601b60248201527f4f6e6c792070656e64696e6720696d706c656d656e746174696f6e0000000000604482015290519081900360640190fd5b610747816107e6565b6102d560006105e5565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b60006107806105c0565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103838155604051919250906001600160a01b0380851691908416907f101b8081ff3b56bbf45deb824d86a3b0fd38b7e3dd42421105cf8abe9106db0b90600090a3505050565b60006107f0610751565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc838155604051919250906001600160a01b0380851691908416907faa3f731066a578e5f39b4215468d826cdd15373cbc0dfc9cb9bdc649718ef7da90600090a350505056fea264697066735822122041ce882775d17ef838c17f08249aa48a5f3ea1c65b581e69896452640b274de264736f6c63430007060033", + "linkReferences": {}, + "deployedLinkReferences": {} +} \ No newline at end of file diff --git a/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/GraphPayments#GraphPayments.json b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/GraphPayments#GraphPayments.json new file mode 100644 index 000000000..45cfb0f51 --- /dev/null +++ b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/GraphPayments#GraphPayments.json @@ -0,0 +1,337 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "GraphPayments", + "sourceName": "contracts/payments/GraphPayments.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "controller", + "type": "address" + }, + { + "internalType": "uint256", + "name": "protocolPaymentCut", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + } + ], + "name": "AddressEmptyCode", + "type": "error" + }, + { + "inputs": [], + "name": "FailedCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "contractName", + "type": "bytes" + } + ], + "name": "GraphDirectoryInvalidZeroAddress", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "cut", + "type": "uint256" + } + ], + "name": "GraphPaymentsInvalidCut", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "protocolPaymentCut", + "type": "uint256" + } + ], + "name": "GraphPaymentsInvalidProtocolPaymentCut", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidInitialization", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "a", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "b", + "type": "uint256" + } + ], + "name": "PPMMathInvalidMulPPM", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "PPMMathInvalidPPM", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "graphToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "graphStaking", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphPayments", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphEscrow", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "graphController", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphEpochManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphRewardsManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphTokenGateway", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphProxyAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphCuration", + "type": "address" + } + ], + "name": "GraphDirectoryInitialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "paymentType", + "type": "uint8" + }, + { + "indexed": true, + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "dataService", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensProtocol", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensDataService", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensDelegationPool", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensReceiver", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "receiverDestination", + "type": "address" + } + ], + "name": "GraphPaymentCollected", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "inputs": [], + "name": "PROTOCOL_PAYMENT_CUT", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "paymentType", + "type": "uint8" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "address", + "name": "dataService", + "type": "address" + }, + { + "internalType": "uint256", + "name": "dataServiceCut", + "type": "uint256" + }, + { + "internalType": "address", + "name": "receiverDestination", + "type": "address" + } + ], + "name": "collect", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "name": "multicall", + "outputs": [ + { + "internalType": "bytes[]", + "name": "results", + "type": "bytes[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "bytecode": "0x6101e060405234801561001157600080fd5b50604051611552380380611552833981016040819052610030916104ee565b816001600160a01b03811661007a5760405163218f5add60e11b815260206004820152600a60248201526921b7b73a3937b63632b960b11b60448201526064015b60405180910390fd5b6001600160a01b0381166101005260408051808201909152600a81526923b930b8342a37b5b2b760b11b60208201526100b290610372565b6001600160a01b03166080526040805180820190915260078152665374616b696e6760c81b60208201526100e590610372565b6001600160a01b031660a05260408051808201909152600d81526c47726170685061796d656e747360981b602082015261011e90610372565b6001600160a01b031660c05260408051808201909152600e81526d5061796d656e7473457363726f7760901b602082015261015890610372565b6001600160a01b031660e05260408051808201909152600c81526b22b837b1b426b0b730b3b2b960a11b602082015261019090610372565b6001600160a01b03166101205260408051808201909152600e81526d2932bbb0b93239a6b0b730b3b2b960911b60208201526101cb90610372565b6001600160a01b0316610140526040805180820190915260118152704772617068546f6b656e4761746577617960781b602082015261020990610372565b6001600160a01b03166101605260408051808201909152600f81526e23b930b834283937bc3ca0b236b4b760891b602082015261024590610372565b6001600160a01b03166101805260408051808201909152600881526721bab930ba34b7b760c11b602082015261027a90610372565b6001600160a01b039081166101a08190526101005160a05160805160c05160e05161012051610140516101605161018051604051988b169a9788169996909716977fef5021414834d86e36470f5c1cecf6544fb2bb723f2ca51a4c86fcd8c5919a43976103249790916001600160a01b03978816815295871660208701529386166040860152918516606085015284166080840152831660a083015290911660c082015260e00190565b60405180910390a45061033a81620f4240101590565b819061035c576040516339b762e560e21b815260040161007191815260200190565b506101c081905261036b610420565b505061058a565b600080610100516001600160a01b031663f7641a5e84805190602001206040518263ffffffff1660e01b81526004016103ad91815260200190565b602060405180830381865afa1580156103ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103ee919061051a565b9050826001600160a01b0382166104195760405163218f5add60e11b8152600401610071919061053c565b5092915050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff16156104705760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b03908116146104cf5780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b80516001600160a01b03811681146104e957600080fd5b919050565b6000806040838503121561050157600080fd5b61050a836104d2565b9150602083015190509250929050565b60006020828403121561052c57600080fd5b610535826104d2565b9392505050565b602081526000825180602084015260005b8181101561056a576020818601810151604086840101520161054d565b506000604082850101526040601f19601f83011684010191505092915050565b60805160a05160c05160e05161010051610120516101405161016051610180516101a0516101c051610f546105fe600039600081816056015261021f0152600050506000505060005050600050506000505060005050600050506000505060006108b20152600061077f0152610f546000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c80631d526e50146100515780638129fc1c1461008b57806381cd11a014610095578063ac9650d8146100a8575b600080fd5b6100787f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b6100936100c8565b005b6100936100a3366004610b2a565b6101c0565b6100bb6100b6366004610b96565b610662565b6040516100829190610c2f565b60006100d261074a565b805490915060ff600160401b82041615906001600160401b03166000811580156100f95750825b90506000826001600160401b031660011480156101155750303b155b905081158015610123575080155b156101415760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff19166001178555831561016b57845460ff60401b1916600160401b1785555b610173610773565b83156101b957845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b5050505050565b6101cd82620f4240101590565b82906101f8576040516339b762e560e21b81526004016101ef91815260200190565b60405180910390fd5b50610216338561020661077d565b6001600160a01b031691906107a1565b836000610243827f0000000000000000000000000000000000000000000000000000000000000000610857565b905061024f8183610cc5565b9150600061025d8386610857565b90506102698184610cc5565b92506000806102766108b0565b604051631584a17960e21b81526001600160a01b038c811660048301528a81166024830152919091169063561285e49060440160a060405180830381865afa1580156102c6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102ea9190610cee565b602081015190915015610388576103796103026108b0565b6001600160a01b0316637573ef4f8c8b8f6040518463ffffffff1660e01b815260040161033193929190610d83565b602060405180830381865afa15801561034e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103729190610dc7565b8690610857565b91506103858286610cc5565b94505b6103a38461039461077d565b6001600160a01b0316906108d4565b6103c088846103b061077d565b6001600160a01b03169190610939565b81156104b0576103ce61077d565b6001600160a01b031663095ea7b36103e46108b0565b846040518363ffffffff1660e01b8152600401610402929190610de0565b6020604051808303816000875af1158015610421573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104459190610df9565b5061044e6108b0565b6001600160a01b031663ca94b0e98b8a856040518463ffffffff1660e01b815260040161047d93929190610e1b565b600060405180830381600087803b15801561049757600080fd5b505af11580156104ab573d6000803e3d6000fd5b505050505b84156105bd576001600160a01b0386166105b0576104cc61077d565b6001600160a01b031663095ea7b36104e26108b0565b876040518363ffffffff1660e01b8152600401610500929190610de0565b6020604051808303816000875af115801561051f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105439190610df9565b5061054c6108b0565b6001600160a01b031663a2a317228b876040518363ffffffff1660e01b8152600401610579929190610de0565b600060405180830381600087803b15801561059357600080fd5b505af11580156105a7573d6000803e3d6000fd5b505050506105bd565b6105bd86866103b061077d565b6001600160a01b038816338c60028111156105da576105da610d6d565b7fb1ac8b16683562f4b1b5ecbe3321151b400058de5cdd25ac44d5bfacb106765f8d8d8989898d8f60405161064d97969594939291906001600160a01b039788168152602081019690965260408601949094526060850192909252608084015260a083015290911660c082015260e00190565b60405180910390a45050505050505050505050565b604080516000815260208101909152606090826001600160401b0381111561068c5761068c610cd8565b6040519080825280602002602001820160405280156106bf57816020015b60608152602001906001900390816106aa5790505b50915060005b838110156107415761071c308686848181106106e3576106e3610e3f565b90506020028101906106f59190610e55565b8560405160200161070893929190610ea2565b60405160208183030381529060405261096d565b83828151811061072e5761072e610e3f565b60209081029190910101526001016106c5565b50505b92915050565b6000807ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00610744565b61077b6109e3565b565b7f000000000000000000000000000000000000000000000000000000000000000090565b8015610852576040516323b872dd60e01b81526001600160a01b038416906323b872dd906107d790859030908690600401610e1b565b6020604051808303816000875af11580156107f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061081a9190610df9565b6108525760405162461bcd60e51b815260206004820152600960248201526810ba3930b739b332b960b91b60448201526064016101ef565b505050565b600061086682620f4240101590565b829061088857604051633dc311df60e01b81526004016101ef91815260200190565b5061089f8361089a84620f4240610cc5565b610a08565b6108a99084610cc5565b9392505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b801561093557604051630852cd8d60e31b8152600481018290526001600160a01b038316906342966c6890602401600060405180830381600087803b15801561091c57600080fd5b505af1158015610930573d6000803e3d6000fd5b505050505b5050565b80156108525760405163a9059cbb60e01b81526001600160a01b0384169063a9059cbb906107d79085908590600401610de0565b6060600080846001600160a01b03168460405161098a9190610ec9565b600060405180830381855af49150503d80600081146109c5576040519150601f19603f3d011682016040523d82523d6000602084013e6109ca565b606091505b50915091506109da858383610a6f565b95945050505050565b6109eb610acb565b61077b57604051631afcd79f60e31b815260040160405180910390fd5b6000610a1783620f4240101590565b80610a2a5750610a2a82620f4240101590565b83839091610a545760405163768bf0eb60e11b8152600481019290925260248201526044016101ef565b50620f42409050610a658385610ee5565b6108a99190610efc565b606082610a8457610a7f82610ae5565b6108a9565b8151158015610a9b57506001600160a01b0384163b155b15610ac457604051639996b31560e01b81526001600160a01b03851660048201526024016101ef565b5092915050565b6000610ad561074a565b54600160401b900460ff16919050565b805115610af55780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b80356001600160a01b0381168114610b2557600080fd5b919050565b60008060008060008060c08789031215610b4357600080fd5b863560038110610b5257600080fd5b9550610b6060208801610b0e565b945060408701359350610b7560608801610b0e565b925060808701359150610b8a60a08801610b0e565b90509295509295509295565b60008060208385031215610ba957600080fd5b82356001600160401b03811115610bbf57600080fd5b8301601f81018513610bd057600080fd5b80356001600160401b03811115610be657600080fd5b8560208260051b8401011115610bfb57600080fd5b6020919091019590945092505050565b60005b83811015610c26578181015183820152602001610c0e565b50506000910152565b6000602082016020835280845180835260408501915060408160051b86010192506020860160005b82811015610ca357603f1987860301845281518051808752610c80816020890160208501610c0b565b601f01601f19169590950160209081019550938401939190910190600101610c57565b50929695505050505050565b634e487b7160e01b600052601160045260246000fd5b8181038181111561074457610744610caf565b634e487b7160e01b600052604160045260246000fd5b600060a0828403128015610d0157600080fd5b6000905060405160a081018181106001600160401b0382111715610d3357634e487b7160e01b83526041600452602483fd5b6040908152845182526020808601519083015284810151908201526060808501519082015260809384015193810193909352509092915050565b634e487b7160e01b600052602160045260246000fd5b6001600160a01b038481168252831660208201526060810160038310610db957634e487b7160e01b600052602160045260246000fd5b826040830152949350505050565b600060208284031215610dd957600080fd5b5051919050565b6001600160a01b03929092168252602082015260400190565b600060208284031215610e0b57600080fd5b815180151581146108a957600080fd5b6001600160a01b039384168152919092166020820152604081019190915260600190565b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112610e6c57600080fd5b8301803591506001600160401b03821115610e8657600080fd5b602001915036819003821315610e9b57600080fd5b9250929050565b828482376000838201600081528351610ebf818360208801610c0b565b0195945050505050565b60008251610edb818460208701610c0b565b9190910192915050565b808202811582820484141761074457610744610caf565b600082610f1957634e487b7160e01b600052601260045260246000fd5b50049056fea2646970667358221220c7f05052208f6f4047e1223bab7d7f3c4001cbe9b001fbbc3b1069b01cc7eced64736f6c634300081b0033", + "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061004c5760003560e01c80631d526e50146100515780638129fc1c1461008b57806381cd11a014610095578063ac9650d8146100a8575b600080fd5b6100787f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b6100936100c8565b005b6100936100a3366004610b2a565b6101c0565b6100bb6100b6366004610b96565b610662565b6040516100829190610c2f565b60006100d261074a565b805490915060ff600160401b82041615906001600160401b03166000811580156100f95750825b90506000826001600160401b031660011480156101155750303b155b905081158015610123575080155b156101415760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff19166001178555831561016b57845460ff60401b1916600160401b1785555b610173610773565b83156101b957845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b5050505050565b6101cd82620f4240101590565b82906101f8576040516339b762e560e21b81526004016101ef91815260200190565b60405180910390fd5b50610216338561020661077d565b6001600160a01b031691906107a1565b836000610243827f0000000000000000000000000000000000000000000000000000000000000000610857565b905061024f8183610cc5565b9150600061025d8386610857565b90506102698184610cc5565b92506000806102766108b0565b604051631584a17960e21b81526001600160a01b038c811660048301528a81166024830152919091169063561285e49060440160a060405180830381865afa1580156102c6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102ea9190610cee565b602081015190915015610388576103796103026108b0565b6001600160a01b0316637573ef4f8c8b8f6040518463ffffffff1660e01b815260040161033193929190610d83565b602060405180830381865afa15801561034e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103729190610dc7565b8690610857565b91506103858286610cc5565b94505b6103a38461039461077d565b6001600160a01b0316906108d4565b6103c088846103b061077d565b6001600160a01b03169190610939565b81156104b0576103ce61077d565b6001600160a01b031663095ea7b36103e46108b0565b846040518363ffffffff1660e01b8152600401610402929190610de0565b6020604051808303816000875af1158015610421573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104459190610df9565b5061044e6108b0565b6001600160a01b031663ca94b0e98b8a856040518463ffffffff1660e01b815260040161047d93929190610e1b565b600060405180830381600087803b15801561049757600080fd5b505af11580156104ab573d6000803e3d6000fd5b505050505b84156105bd576001600160a01b0386166105b0576104cc61077d565b6001600160a01b031663095ea7b36104e26108b0565b876040518363ffffffff1660e01b8152600401610500929190610de0565b6020604051808303816000875af115801561051f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105439190610df9565b5061054c6108b0565b6001600160a01b031663a2a317228b876040518363ffffffff1660e01b8152600401610579929190610de0565b600060405180830381600087803b15801561059357600080fd5b505af11580156105a7573d6000803e3d6000fd5b505050506105bd565b6105bd86866103b061077d565b6001600160a01b038816338c60028111156105da576105da610d6d565b7fb1ac8b16683562f4b1b5ecbe3321151b400058de5cdd25ac44d5bfacb106765f8d8d8989898d8f60405161064d97969594939291906001600160a01b039788168152602081019690965260408601949094526060850192909252608084015260a083015290911660c082015260e00190565b60405180910390a45050505050505050505050565b604080516000815260208101909152606090826001600160401b0381111561068c5761068c610cd8565b6040519080825280602002602001820160405280156106bf57816020015b60608152602001906001900390816106aa5790505b50915060005b838110156107415761071c308686848181106106e3576106e3610e3f565b90506020028101906106f59190610e55565b8560405160200161070893929190610ea2565b60405160208183030381529060405261096d565b83828151811061072e5761072e610e3f565b60209081029190910101526001016106c5565b50505b92915050565b6000807ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00610744565b61077b6109e3565b565b7f000000000000000000000000000000000000000000000000000000000000000090565b8015610852576040516323b872dd60e01b81526001600160a01b038416906323b872dd906107d790859030908690600401610e1b565b6020604051808303816000875af11580156107f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061081a9190610df9565b6108525760405162461bcd60e51b815260206004820152600960248201526810ba3930b739b332b960b91b60448201526064016101ef565b505050565b600061086682620f4240101590565b829061088857604051633dc311df60e01b81526004016101ef91815260200190565b5061089f8361089a84620f4240610cc5565b610a08565b6108a99084610cc5565b9392505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b801561093557604051630852cd8d60e31b8152600481018290526001600160a01b038316906342966c6890602401600060405180830381600087803b15801561091c57600080fd5b505af1158015610930573d6000803e3d6000fd5b505050505b5050565b80156108525760405163a9059cbb60e01b81526001600160a01b0384169063a9059cbb906107d79085908590600401610de0565b6060600080846001600160a01b03168460405161098a9190610ec9565b600060405180830381855af49150503d80600081146109c5576040519150601f19603f3d011682016040523d82523d6000602084013e6109ca565b606091505b50915091506109da858383610a6f565b95945050505050565b6109eb610acb565b61077b57604051631afcd79f60e31b815260040160405180910390fd5b6000610a1783620f4240101590565b80610a2a5750610a2a82620f4240101590565b83839091610a545760405163768bf0eb60e11b8152600481019290925260248201526044016101ef565b50620f42409050610a658385610ee5565b6108a99190610efc565b606082610a8457610a7f82610ae5565b6108a9565b8151158015610a9b57506001600160a01b0384163b155b15610ac457604051639996b31560e01b81526001600160a01b03851660048201526024016101ef565b5092915050565b6000610ad561074a565b54600160401b900460ff16919050565b805115610af55780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b80356001600160a01b0381168114610b2557600080fd5b919050565b60008060008060008060c08789031215610b4357600080fd5b863560038110610b5257600080fd5b9550610b6060208801610b0e565b945060408701359350610b7560608801610b0e565b925060808701359150610b8a60a08801610b0e565b90509295509295509295565b60008060208385031215610ba957600080fd5b82356001600160401b03811115610bbf57600080fd5b8301601f81018513610bd057600080fd5b80356001600160401b03811115610be657600080fd5b8560208260051b8401011115610bfb57600080fd5b6020919091019590945092505050565b60005b83811015610c26578181015183820152602001610c0e565b50506000910152565b6000602082016020835280845180835260408501915060408160051b86010192506020860160005b82811015610ca357603f1987860301845281518051808752610c80816020890160208501610c0b565b601f01601f19169590950160209081019550938401939190910190600101610c57565b50929695505050505050565b634e487b7160e01b600052601160045260246000fd5b8181038181111561074457610744610caf565b634e487b7160e01b600052604160045260246000fd5b600060a0828403128015610d0157600080fd5b6000905060405160a081018181106001600160401b0382111715610d3357634e487b7160e01b83526041600452602483fd5b6040908152845182526020808601519083015284810151908201526060808501519082015260809384015193810193909352509092915050565b634e487b7160e01b600052602160045260246000fd5b6001600160a01b038481168252831660208201526060810160038310610db957634e487b7160e01b600052602160045260246000fd5b826040830152949350505050565b600060208284031215610dd957600080fd5b5051919050565b6001600160a01b03929092168252602082015260400190565b600060208284031215610e0b57600080fd5b815180151581146108a957600080fd5b6001600160a01b039384168152919092166020820152604081019190915260600190565b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112610e6c57600080fd5b8301803591506001600160401b03821115610e8657600080fd5b602001915036819003821315610e9b57600080fd5b9250929050565b828482376000838201600081528351610ebf818360208801610c0b565b0195945050505050565b60008251610edb818460208701610c0b565b9190910192915050565b808202811582820484141761074457610744610caf565b600082610f1957634e487b7160e01b600052601260045260246000fd5b50049056fea2646970667358221220c7f05052208f6f4047e1223bab7d7f3c4001cbe9b001fbbc3b1069b01cc7eced64736f6c634300081b0033", + "linkReferences": {}, + "deployedLinkReferences": {} +} \ No newline at end of file diff --git a/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/GraphPayments#GraphPayments_ProxyWithABI.json b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/GraphPayments#GraphPayments_ProxyWithABI.json new file mode 100644 index 000000000..45cfb0f51 --- /dev/null +++ b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/GraphPayments#GraphPayments_ProxyWithABI.json @@ -0,0 +1,337 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "GraphPayments", + "sourceName": "contracts/payments/GraphPayments.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "controller", + "type": "address" + }, + { + "internalType": "uint256", + "name": "protocolPaymentCut", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + } + ], + "name": "AddressEmptyCode", + "type": "error" + }, + { + "inputs": [], + "name": "FailedCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "contractName", + "type": "bytes" + } + ], + "name": "GraphDirectoryInvalidZeroAddress", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "cut", + "type": "uint256" + } + ], + "name": "GraphPaymentsInvalidCut", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "protocolPaymentCut", + "type": "uint256" + } + ], + "name": "GraphPaymentsInvalidProtocolPaymentCut", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidInitialization", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "a", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "b", + "type": "uint256" + } + ], + "name": "PPMMathInvalidMulPPM", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "PPMMathInvalidPPM", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "graphToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "graphStaking", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphPayments", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphEscrow", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "graphController", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphEpochManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphRewardsManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphTokenGateway", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphProxyAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphCuration", + "type": "address" + } + ], + "name": "GraphDirectoryInitialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "paymentType", + "type": "uint8" + }, + { + "indexed": true, + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "dataService", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensProtocol", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensDataService", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensDelegationPool", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensReceiver", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "receiverDestination", + "type": "address" + } + ], + "name": "GraphPaymentCollected", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "inputs": [], + "name": "PROTOCOL_PAYMENT_CUT", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "paymentType", + "type": "uint8" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "address", + "name": "dataService", + "type": "address" + }, + { + "internalType": "uint256", + "name": "dataServiceCut", + "type": "uint256" + }, + { + "internalType": "address", + "name": "receiverDestination", + "type": "address" + } + ], + "name": "collect", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "name": "multicall", + "outputs": [ + { + "internalType": "bytes[]", + "name": "results", + "type": "bytes[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "bytecode": "0x6101e060405234801561001157600080fd5b50604051611552380380611552833981016040819052610030916104ee565b816001600160a01b03811661007a5760405163218f5add60e11b815260206004820152600a60248201526921b7b73a3937b63632b960b11b60448201526064015b60405180910390fd5b6001600160a01b0381166101005260408051808201909152600a81526923b930b8342a37b5b2b760b11b60208201526100b290610372565b6001600160a01b03166080526040805180820190915260078152665374616b696e6760c81b60208201526100e590610372565b6001600160a01b031660a05260408051808201909152600d81526c47726170685061796d656e747360981b602082015261011e90610372565b6001600160a01b031660c05260408051808201909152600e81526d5061796d656e7473457363726f7760901b602082015261015890610372565b6001600160a01b031660e05260408051808201909152600c81526b22b837b1b426b0b730b3b2b960a11b602082015261019090610372565b6001600160a01b03166101205260408051808201909152600e81526d2932bbb0b93239a6b0b730b3b2b960911b60208201526101cb90610372565b6001600160a01b0316610140526040805180820190915260118152704772617068546f6b656e4761746577617960781b602082015261020990610372565b6001600160a01b03166101605260408051808201909152600f81526e23b930b834283937bc3ca0b236b4b760891b602082015261024590610372565b6001600160a01b03166101805260408051808201909152600881526721bab930ba34b7b760c11b602082015261027a90610372565b6001600160a01b039081166101a08190526101005160a05160805160c05160e05161012051610140516101605161018051604051988b169a9788169996909716977fef5021414834d86e36470f5c1cecf6544fb2bb723f2ca51a4c86fcd8c5919a43976103249790916001600160a01b03978816815295871660208701529386166040860152918516606085015284166080840152831660a083015290911660c082015260e00190565b60405180910390a45061033a81620f4240101590565b819061035c576040516339b762e560e21b815260040161007191815260200190565b506101c081905261036b610420565b505061058a565b600080610100516001600160a01b031663f7641a5e84805190602001206040518263ffffffff1660e01b81526004016103ad91815260200190565b602060405180830381865afa1580156103ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103ee919061051a565b9050826001600160a01b0382166104195760405163218f5add60e11b8152600401610071919061053c565b5092915050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff16156104705760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b03908116146104cf5780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b80516001600160a01b03811681146104e957600080fd5b919050565b6000806040838503121561050157600080fd5b61050a836104d2565b9150602083015190509250929050565b60006020828403121561052c57600080fd5b610535826104d2565b9392505050565b602081526000825180602084015260005b8181101561056a576020818601810151604086840101520161054d565b506000604082850101526040601f19601f83011684010191505092915050565b60805160a05160c05160e05161010051610120516101405161016051610180516101a0516101c051610f546105fe600039600081816056015261021f0152600050506000505060005050600050506000505060005050600050506000505060006108b20152600061077f0152610f546000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c80631d526e50146100515780638129fc1c1461008b57806381cd11a014610095578063ac9650d8146100a8575b600080fd5b6100787f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b6100936100c8565b005b6100936100a3366004610b2a565b6101c0565b6100bb6100b6366004610b96565b610662565b6040516100829190610c2f565b60006100d261074a565b805490915060ff600160401b82041615906001600160401b03166000811580156100f95750825b90506000826001600160401b031660011480156101155750303b155b905081158015610123575080155b156101415760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff19166001178555831561016b57845460ff60401b1916600160401b1785555b610173610773565b83156101b957845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b5050505050565b6101cd82620f4240101590565b82906101f8576040516339b762e560e21b81526004016101ef91815260200190565b60405180910390fd5b50610216338561020661077d565b6001600160a01b031691906107a1565b836000610243827f0000000000000000000000000000000000000000000000000000000000000000610857565b905061024f8183610cc5565b9150600061025d8386610857565b90506102698184610cc5565b92506000806102766108b0565b604051631584a17960e21b81526001600160a01b038c811660048301528a81166024830152919091169063561285e49060440160a060405180830381865afa1580156102c6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102ea9190610cee565b602081015190915015610388576103796103026108b0565b6001600160a01b0316637573ef4f8c8b8f6040518463ffffffff1660e01b815260040161033193929190610d83565b602060405180830381865afa15801561034e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103729190610dc7565b8690610857565b91506103858286610cc5565b94505b6103a38461039461077d565b6001600160a01b0316906108d4565b6103c088846103b061077d565b6001600160a01b03169190610939565b81156104b0576103ce61077d565b6001600160a01b031663095ea7b36103e46108b0565b846040518363ffffffff1660e01b8152600401610402929190610de0565b6020604051808303816000875af1158015610421573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104459190610df9565b5061044e6108b0565b6001600160a01b031663ca94b0e98b8a856040518463ffffffff1660e01b815260040161047d93929190610e1b565b600060405180830381600087803b15801561049757600080fd5b505af11580156104ab573d6000803e3d6000fd5b505050505b84156105bd576001600160a01b0386166105b0576104cc61077d565b6001600160a01b031663095ea7b36104e26108b0565b876040518363ffffffff1660e01b8152600401610500929190610de0565b6020604051808303816000875af115801561051f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105439190610df9565b5061054c6108b0565b6001600160a01b031663a2a317228b876040518363ffffffff1660e01b8152600401610579929190610de0565b600060405180830381600087803b15801561059357600080fd5b505af11580156105a7573d6000803e3d6000fd5b505050506105bd565b6105bd86866103b061077d565b6001600160a01b038816338c60028111156105da576105da610d6d565b7fb1ac8b16683562f4b1b5ecbe3321151b400058de5cdd25ac44d5bfacb106765f8d8d8989898d8f60405161064d97969594939291906001600160a01b039788168152602081019690965260408601949094526060850192909252608084015260a083015290911660c082015260e00190565b60405180910390a45050505050505050505050565b604080516000815260208101909152606090826001600160401b0381111561068c5761068c610cd8565b6040519080825280602002602001820160405280156106bf57816020015b60608152602001906001900390816106aa5790505b50915060005b838110156107415761071c308686848181106106e3576106e3610e3f565b90506020028101906106f59190610e55565b8560405160200161070893929190610ea2565b60405160208183030381529060405261096d565b83828151811061072e5761072e610e3f565b60209081029190910101526001016106c5565b50505b92915050565b6000807ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00610744565b61077b6109e3565b565b7f000000000000000000000000000000000000000000000000000000000000000090565b8015610852576040516323b872dd60e01b81526001600160a01b038416906323b872dd906107d790859030908690600401610e1b565b6020604051808303816000875af11580156107f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061081a9190610df9565b6108525760405162461bcd60e51b815260206004820152600960248201526810ba3930b739b332b960b91b60448201526064016101ef565b505050565b600061086682620f4240101590565b829061088857604051633dc311df60e01b81526004016101ef91815260200190565b5061089f8361089a84620f4240610cc5565b610a08565b6108a99084610cc5565b9392505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b801561093557604051630852cd8d60e31b8152600481018290526001600160a01b038316906342966c6890602401600060405180830381600087803b15801561091c57600080fd5b505af1158015610930573d6000803e3d6000fd5b505050505b5050565b80156108525760405163a9059cbb60e01b81526001600160a01b0384169063a9059cbb906107d79085908590600401610de0565b6060600080846001600160a01b03168460405161098a9190610ec9565b600060405180830381855af49150503d80600081146109c5576040519150601f19603f3d011682016040523d82523d6000602084013e6109ca565b606091505b50915091506109da858383610a6f565b95945050505050565b6109eb610acb565b61077b57604051631afcd79f60e31b815260040160405180910390fd5b6000610a1783620f4240101590565b80610a2a5750610a2a82620f4240101590565b83839091610a545760405163768bf0eb60e11b8152600481019290925260248201526044016101ef565b50620f42409050610a658385610ee5565b6108a99190610efc565b606082610a8457610a7f82610ae5565b6108a9565b8151158015610a9b57506001600160a01b0384163b155b15610ac457604051639996b31560e01b81526001600160a01b03851660048201526024016101ef565b5092915050565b6000610ad561074a565b54600160401b900460ff16919050565b805115610af55780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b80356001600160a01b0381168114610b2557600080fd5b919050565b60008060008060008060c08789031215610b4357600080fd5b863560038110610b5257600080fd5b9550610b6060208801610b0e565b945060408701359350610b7560608801610b0e565b925060808701359150610b8a60a08801610b0e565b90509295509295509295565b60008060208385031215610ba957600080fd5b82356001600160401b03811115610bbf57600080fd5b8301601f81018513610bd057600080fd5b80356001600160401b03811115610be657600080fd5b8560208260051b8401011115610bfb57600080fd5b6020919091019590945092505050565b60005b83811015610c26578181015183820152602001610c0e565b50506000910152565b6000602082016020835280845180835260408501915060408160051b86010192506020860160005b82811015610ca357603f1987860301845281518051808752610c80816020890160208501610c0b565b601f01601f19169590950160209081019550938401939190910190600101610c57565b50929695505050505050565b634e487b7160e01b600052601160045260246000fd5b8181038181111561074457610744610caf565b634e487b7160e01b600052604160045260246000fd5b600060a0828403128015610d0157600080fd5b6000905060405160a081018181106001600160401b0382111715610d3357634e487b7160e01b83526041600452602483fd5b6040908152845182526020808601519083015284810151908201526060808501519082015260809384015193810193909352509092915050565b634e487b7160e01b600052602160045260246000fd5b6001600160a01b038481168252831660208201526060810160038310610db957634e487b7160e01b600052602160045260246000fd5b826040830152949350505050565b600060208284031215610dd957600080fd5b5051919050565b6001600160a01b03929092168252602082015260400190565b600060208284031215610e0b57600080fd5b815180151581146108a957600080fd5b6001600160a01b039384168152919092166020820152604081019190915260600190565b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112610e6c57600080fd5b8301803591506001600160401b03821115610e8657600080fd5b602001915036819003821315610e9b57600080fd5b9250929050565b828482376000838201600081528351610ebf818360208801610c0b565b0195945050505050565b60008251610edb818460208701610c0b565b9190910192915050565b808202811582820484141761074457610744610caf565b600082610f1957634e487b7160e01b600052601260045260246000fd5b50049056fea2646970667358221220c7f05052208f6f4047e1223bab7d7f3c4001cbe9b001fbbc3b1069b01cc7eced64736f6c634300081b0033", + "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061004c5760003560e01c80631d526e50146100515780638129fc1c1461008b57806381cd11a014610095578063ac9650d8146100a8575b600080fd5b6100787f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b6100936100c8565b005b6100936100a3366004610b2a565b6101c0565b6100bb6100b6366004610b96565b610662565b6040516100829190610c2f565b60006100d261074a565b805490915060ff600160401b82041615906001600160401b03166000811580156100f95750825b90506000826001600160401b031660011480156101155750303b155b905081158015610123575080155b156101415760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff19166001178555831561016b57845460ff60401b1916600160401b1785555b610173610773565b83156101b957845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b5050505050565b6101cd82620f4240101590565b82906101f8576040516339b762e560e21b81526004016101ef91815260200190565b60405180910390fd5b50610216338561020661077d565b6001600160a01b031691906107a1565b836000610243827f0000000000000000000000000000000000000000000000000000000000000000610857565b905061024f8183610cc5565b9150600061025d8386610857565b90506102698184610cc5565b92506000806102766108b0565b604051631584a17960e21b81526001600160a01b038c811660048301528a81166024830152919091169063561285e49060440160a060405180830381865afa1580156102c6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102ea9190610cee565b602081015190915015610388576103796103026108b0565b6001600160a01b0316637573ef4f8c8b8f6040518463ffffffff1660e01b815260040161033193929190610d83565b602060405180830381865afa15801561034e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103729190610dc7565b8690610857565b91506103858286610cc5565b94505b6103a38461039461077d565b6001600160a01b0316906108d4565b6103c088846103b061077d565b6001600160a01b03169190610939565b81156104b0576103ce61077d565b6001600160a01b031663095ea7b36103e46108b0565b846040518363ffffffff1660e01b8152600401610402929190610de0565b6020604051808303816000875af1158015610421573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104459190610df9565b5061044e6108b0565b6001600160a01b031663ca94b0e98b8a856040518463ffffffff1660e01b815260040161047d93929190610e1b565b600060405180830381600087803b15801561049757600080fd5b505af11580156104ab573d6000803e3d6000fd5b505050505b84156105bd576001600160a01b0386166105b0576104cc61077d565b6001600160a01b031663095ea7b36104e26108b0565b876040518363ffffffff1660e01b8152600401610500929190610de0565b6020604051808303816000875af115801561051f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105439190610df9565b5061054c6108b0565b6001600160a01b031663a2a317228b876040518363ffffffff1660e01b8152600401610579929190610de0565b600060405180830381600087803b15801561059357600080fd5b505af11580156105a7573d6000803e3d6000fd5b505050506105bd565b6105bd86866103b061077d565b6001600160a01b038816338c60028111156105da576105da610d6d565b7fb1ac8b16683562f4b1b5ecbe3321151b400058de5cdd25ac44d5bfacb106765f8d8d8989898d8f60405161064d97969594939291906001600160a01b039788168152602081019690965260408601949094526060850192909252608084015260a083015290911660c082015260e00190565b60405180910390a45050505050505050505050565b604080516000815260208101909152606090826001600160401b0381111561068c5761068c610cd8565b6040519080825280602002602001820160405280156106bf57816020015b60608152602001906001900390816106aa5790505b50915060005b838110156107415761071c308686848181106106e3576106e3610e3f565b90506020028101906106f59190610e55565b8560405160200161070893929190610ea2565b60405160208183030381529060405261096d565b83828151811061072e5761072e610e3f565b60209081029190910101526001016106c5565b50505b92915050565b6000807ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00610744565b61077b6109e3565b565b7f000000000000000000000000000000000000000000000000000000000000000090565b8015610852576040516323b872dd60e01b81526001600160a01b038416906323b872dd906107d790859030908690600401610e1b565b6020604051808303816000875af11580156107f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061081a9190610df9565b6108525760405162461bcd60e51b815260206004820152600960248201526810ba3930b739b332b960b91b60448201526064016101ef565b505050565b600061086682620f4240101590565b829061088857604051633dc311df60e01b81526004016101ef91815260200190565b5061089f8361089a84620f4240610cc5565b610a08565b6108a99084610cc5565b9392505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b801561093557604051630852cd8d60e31b8152600481018290526001600160a01b038316906342966c6890602401600060405180830381600087803b15801561091c57600080fd5b505af1158015610930573d6000803e3d6000fd5b505050505b5050565b80156108525760405163a9059cbb60e01b81526001600160a01b0384169063a9059cbb906107d79085908590600401610de0565b6060600080846001600160a01b03168460405161098a9190610ec9565b600060405180830381855af49150503d80600081146109c5576040519150601f19603f3d011682016040523d82523d6000602084013e6109ca565b606091505b50915091506109da858383610a6f565b95945050505050565b6109eb610acb565b61077b57604051631afcd79f60e31b815260040160405180910390fd5b6000610a1783620f4240101590565b80610a2a5750610a2a82620f4240101590565b83839091610a545760405163768bf0eb60e11b8152600481019290925260248201526044016101ef565b50620f42409050610a658385610ee5565b6108a99190610efc565b606082610a8457610a7f82610ae5565b6108a9565b8151158015610a9b57506001600160a01b0384163b155b15610ac457604051639996b31560e01b81526001600160a01b03851660048201526024016101ef565b5092915050565b6000610ad561074a565b54600160401b900460ff16919050565b805115610af55780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b80356001600160a01b0381168114610b2557600080fd5b919050565b60008060008060008060c08789031215610b4357600080fd5b863560038110610b5257600080fd5b9550610b6060208801610b0e565b945060408701359350610b7560608801610b0e565b925060808701359150610b8a60a08801610b0e565b90509295509295509295565b60008060208385031215610ba957600080fd5b82356001600160401b03811115610bbf57600080fd5b8301601f81018513610bd057600080fd5b80356001600160401b03811115610be657600080fd5b8560208260051b8401011115610bfb57600080fd5b6020919091019590945092505050565b60005b83811015610c26578181015183820152602001610c0e565b50506000910152565b6000602082016020835280845180835260408501915060408160051b86010192506020860160005b82811015610ca357603f1987860301845281518051808752610c80816020890160208501610c0b565b601f01601f19169590950160209081019550938401939190910190600101610c57565b50929695505050505050565b634e487b7160e01b600052601160045260246000fd5b8181038181111561074457610744610caf565b634e487b7160e01b600052604160045260246000fd5b600060a0828403128015610d0157600080fd5b6000905060405160a081018181106001600160401b0382111715610d3357634e487b7160e01b83526041600452602483fd5b6040908152845182526020808601519083015284810151908201526060808501519082015260809384015193810193909352509092915050565b634e487b7160e01b600052602160045260246000fd5b6001600160a01b038481168252831660208201526060810160038310610db957634e487b7160e01b600052602160045260246000fd5b826040830152949350505050565b600060208284031215610dd957600080fd5b5051919050565b6001600160a01b03929092168252602082015260400190565b600060208284031215610e0b57600080fd5b815180151581146108a957600080fd5b6001600160a01b039384168152919092166020820152604081019190915260600190565b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112610e6c57600080fd5b8301803591506001600160401b03821115610e8657600080fd5b602001915036819003821315610e9b57600080fd5b9250929050565b828482376000838201600081528351610ebf818360208801610c0b565b0195945050505050565b60008251610edb818460208701610c0b565b9190910192915050565b808202811582820484141761074457610744610caf565b600082610f1957634e487b7160e01b600052601260045260246000fd5b50049056fea2646970667358221220c7f05052208f6f4047e1223bab7d7f3c4001cbe9b001fbbc3b1069b01cc7eced64736f6c634300081b0033", + "linkReferences": {}, + "deployedLinkReferences": {} +} \ No newline at end of file diff --git a/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/GraphProxyAdmin#GraphProxyAdmin.json b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/GraphProxyAdmin#GraphProxyAdmin.json new file mode 100644 index 000000000..07f0623c5 --- /dev/null +++ b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/GraphProxyAdmin#GraphProxyAdmin.json @@ -0,0 +1,234 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "GraphProxyAdmin", + "sourceName": "contracts/upgrades/GraphProxyAdmin.sol", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "NewOwnership", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "NewPendingOwnership", + "type": "event" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract GraphUpgradeable", + "name": "_implementation", + "type": "address" + }, + { + "internalType": "contract IGraphProxy", + "name": "_proxy", + "type": "address" + } + ], + "name": "acceptProxy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract GraphUpgradeable", + "name": "_implementation", + "type": "address" + }, + { + "internalType": "contract IGraphProxy", + "name": "_proxy", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "acceptProxyAndCall", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IGraphProxy", + "name": "_proxy", + "type": "address" + }, + { + "internalType": "address", + "name": "_newAdmin", + "type": "address" + } + ], + "name": "changeProxyAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IGraphProxy", + "name": "_proxy", + "type": "address" + } + ], + "name": "getProxyAdmin", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IGraphProxy", + "name": "_proxy", + "type": "address" + } + ], + "name": "getProxyImplementation", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IGraphProxy", + "name": "_proxy", + "type": "address" + } + ], + "name": "getProxyPendingImplementation", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingGovernor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newGovernor", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IGraphProxy", + "name": "_proxy", + "type": "address" + }, + { + "internalType": "address", + "name": "_implementation", + "type": "address" + } + ], + "name": "upgrade", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "bytecode": "0x608060405234801561001057600080fd5b506100243361002960201b610a0c1760201c565b61004b565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b610a648061005a6000396000f3fe608060405234801561001057600080fd5b50600436106100a95760003560e01c80637eff275e116100715780637eff275e146101b157806399a88ec4146101df578063e3056a341461020d578063eb451a0214610215578063f2fde38b14610243578063f3b7dead14610269576100a9565b806307ebde0e146100ae5780630c340a2414610139578063204e1c7a1461015d5780635bf410eb1461018357806379ba5097146101a9575b600080fd5b610137600480360360608110156100c457600080fd5b6001600160a01b0382358116926020810135909116918101906060810160408201356401000000008111156100f857600080fd5b82018360208201111561010a57600080fd5b8035906020019184600183028401116401000000008311171561012c57600080fd5b50909250905061028f565b005b610141610388565b604080516001600160a01b039092168252519081900360200190f35b6101416004803603602081101561017357600080fd5b50356001600160a01b0316610397565b6101416004803603602081101561019957600080fd5b50356001600160a01b031661046a565b610137610525565b610137600480360360408110156101c757600080fd5b506001600160a01b0381358116916020013516610633565b610137600480360360408110156101f557600080fd5b506001600160a01b03813581169160200135166106f6565b61014161079d565b6101376004803603604081101561022b57600080fd5b506001600160a01b03813581169160200135166107ac565b6101376004803603602081101561025957600080fd5b50356001600160a01b0316610853565b6101416004803603602081101561027f57600080fd5b50356001600160a01b0316610951565b6000546001600160a01b031633146102e7576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b836001600160a01b0316639ce7abe58484846040518463ffffffff1660e01b815260040180846001600160a01b03168152602001806020018281038252848482818152602001925080828437600081840152601f19601f820116905080830192505050945050505050600060405180830381600087803b15801561036a57600080fd5b505af115801561037e573d6000803e3d6000fd5b5050505050505050565b6000546001600160a01b031681565b6000806000836001600160a01b03166040518080635c60da1b60e01b8152506004019050600060405180830381855afa9150503d80600081146103f6576040519150601f19603f3d011682016040523d82523d6000602084013e6103fb565b606091505b50915091508161044b576040805162461bcd60e51b8152602060048201526016602482015275141c9bde1e481a5b5c1b0818d85b1b0819985a5b195960521b604482015290519081900360640190fd5b80806020019051602081101561046057600080fd5b5051949350505050565b6000806000836001600160a01b0316604051808063396f7b2360e01b8152506004019050600060405180830381855afa9150503d80600081146104c9576040519150601f19603f3d011682016040523d82523d6000602084013e6104ce565b606091505b50915091508161044b576040805162461bcd60e51b815260206004820152601d60248201527f50726f78792070656e64696e67496d706c2063616c6c206661696c6564000000604482015290519081900360640190fd5b6001546001600160a01b031680158015906105485750336001600160a01b038216145b610599576040805162461bcd60e51b815260206004820152601f60248201527f43616c6c6572206d7573742062652070656e64696e6720676f7665726e6f7200604482015290519081900360640190fd5b600080546001600160a01b038381166001600160a01b031980841691909117808555600180549092169091556040519282169391169183917f0ac6deed30eef60090c749850e10f2fa469e3e25fec1d1bef2853003f6e6f18f91a36001546040516001600160a01b03918216918416907f76563ad561b7036ae716b9b25cb521b21463240f104c97e12f25877f2235f33d90600090a35050565b6000546001600160a01b0316331461068b576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b816001600160a01b031663704b6c02826040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050600060405180830381600087803b1580156106da57600080fd5b505af11580156106ee573d6000803e3d6000fd5b505050505050565b6000546001600160a01b0316331461074e576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b816001600160a01b0316633659cfe6826040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050600060405180830381600087803b1580156106da57600080fd5b6001546001600160a01b031681565b6000546001600160a01b03163314610804576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b816001600160a01b031663a2594d82826040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050600060405180830381600087803b1580156106da57600080fd5b6000546001600160a01b031633146108ab576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b6001600160a01b0381166108fd576040805162461bcd60e51b815260206004820152601460248201527311dbdd995c9b9bdc881b5d5cdd081899481cd95d60621b604482015290519081900360640190fd5b600180546001600160a01b038381166001600160a01b03198316179283905560405191811692169082907f76563ad561b7036ae716b9b25cb521b21463240f104c97e12f25877f2235f33d90600090a35050565b6000806000836001600160a01b031660405180806303e1469160e61b8152506004019050600060405180830381855afa9150503d80600081146109b0576040519150601f19603f3d011682016040523d82523d6000602084013e6109b5565b606091505b50915091508161044b576040805162461bcd60e51b815260206004820152601760248201527f50726f78792061646d696e2063616c6c206661696c6564000000000000000000604482015290519081900360640190fd5b600080546001600160a01b0319166001600160a01b039290921691909117905556fea26469706673582212208b271ee4c7625d89f662c15e90f70e142245bf56f0595043fe9af742b09d958c64736f6c63430007060033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100a95760003560e01c80637eff275e116100715780637eff275e146101b157806399a88ec4146101df578063e3056a341461020d578063eb451a0214610215578063f2fde38b14610243578063f3b7dead14610269576100a9565b806307ebde0e146100ae5780630c340a2414610139578063204e1c7a1461015d5780635bf410eb1461018357806379ba5097146101a9575b600080fd5b610137600480360360608110156100c457600080fd5b6001600160a01b0382358116926020810135909116918101906060810160408201356401000000008111156100f857600080fd5b82018360208201111561010a57600080fd5b8035906020019184600183028401116401000000008311171561012c57600080fd5b50909250905061028f565b005b610141610388565b604080516001600160a01b039092168252519081900360200190f35b6101416004803603602081101561017357600080fd5b50356001600160a01b0316610397565b6101416004803603602081101561019957600080fd5b50356001600160a01b031661046a565b610137610525565b610137600480360360408110156101c757600080fd5b506001600160a01b0381358116916020013516610633565b610137600480360360408110156101f557600080fd5b506001600160a01b03813581169160200135166106f6565b61014161079d565b6101376004803603604081101561022b57600080fd5b506001600160a01b03813581169160200135166107ac565b6101376004803603602081101561025957600080fd5b50356001600160a01b0316610853565b6101416004803603602081101561027f57600080fd5b50356001600160a01b0316610951565b6000546001600160a01b031633146102e7576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b836001600160a01b0316639ce7abe58484846040518463ffffffff1660e01b815260040180846001600160a01b03168152602001806020018281038252848482818152602001925080828437600081840152601f19601f820116905080830192505050945050505050600060405180830381600087803b15801561036a57600080fd5b505af115801561037e573d6000803e3d6000fd5b5050505050505050565b6000546001600160a01b031681565b6000806000836001600160a01b03166040518080635c60da1b60e01b8152506004019050600060405180830381855afa9150503d80600081146103f6576040519150601f19603f3d011682016040523d82523d6000602084013e6103fb565b606091505b50915091508161044b576040805162461bcd60e51b8152602060048201526016602482015275141c9bde1e481a5b5c1b0818d85b1b0819985a5b195960521b604482015290519081900360640190fd5b80806020019051602081101561046057600080fd5b5051949350505050565b6000806000836001600160a01b0316604051808063396f7b2360e01b8152506004019050600060405180830381855afa9150503d80600081146104c9576040519150601f19603f3d011682016040523d82523d6000602084013e6104ce565b606091505b50915091508161044b576040805162461bcd60e51b815260206004820152601d60248201527f50726f78792070656e64696e67496d706c2063616c6c206661696c6564000000604482015290519081900360640190fd5b6001546001600160a01b031680158015906105485750336001600160a01b038216145b610599576040805162461bcd60e51b815260206004820152601f60248201527f43616c6c6572206d7573742062652070656e64696e6720676f7665726e6f7200604482015290519081900360640190fd5b600080546001600160a01b038381166001600160a01b031980841691909117808555600180549092169091556040519282169391169183917f0ac6deed30eef60090c749850e10f2fa469e3e25fec1d1bef2853003f6e6f18f91a36001546040516001600160a01b03918216918416907f76563ad561b7036ae716b9b25cb521b21463240f104c97e12f25877f2235f33d90600090a35050565b6000546001600160a01b0316331461068b576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b816001600160a01b031663704b6c02826040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050600060405180830381600087803b1580156106da57600080fd5b505af11580156106ee573d6000803e3d6000fd5b505050505050565b6000546001600160a01b0316331461074e576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b816001600160a01b0316633659cfe6826040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050600060405180830381600087803b1580156106da57600080fd5b6001546001600160a01b031681565b6000546001600160a01b03163314610804576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b816001600160a01b031663a2594d82826040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050600060405180830381600087803b1580156106da57600080fd5b6000546001600160a01b031633146108ab576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b6001600160a01b0381166108fd576040805162461bcd60e51b815260206004820152601460248201527311dbdd995c9b9bdc881b5d5cdd081899481cd95d60621b604482015290519081900360640190fd5b600180546001600160a01b038381166001600160a01b03198316179283905560405191811692169082907f76563ad561b7036ae716b9b25cb521b21463240f104c97e12f25877f2235f33d90600090a35050565b6000806000836001600160a01b031660405180806303e1469160e61b8152506004019050600060405180830381855afa9150503d80600081146109b0576040519150601f19603f3d011682016040523d82523d6000602084013e6109b5565b606091505b50915091508161044b576040805162461bcd60e51b815260206004820152601760248201527f50726f78792061646d696e2063616c6c206661696c6564000000000000000000604482015290519081900360640190fd5b600080546001600160a01b0319166001600160a01b039290921691909117905556fea26469706673582212208b271ee4c7625d89f662c15e90f70e142245bf56f0595043fe9af742b09d958c64736f6c63430007060033", + "linkReferences": {}, + "deployedLinkReferences": {} +} \ No newline at end of file diff --git a/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/GraphTallyCollector#GraphTallyCollector.json b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/GraphTallyCollector#GraphTallyCollector.json new file mode 100644 index 000000000..f430c0ad9 --- /dev/null +++ b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/GraphTallyCollector#GraphTallyCollector.json @@ -0,0 +1,900 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "GraphTallyCollector", + "sourceName": "contracts/payments/collectors/GraphTallyCollector.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "string", + "name": "eip712Name", + "type": "string" + }, + { + "internalType": "string", + "name": "eip712Version", + "type": "string" + }, + { + "internalType": "address", + "name": "controller", + "type": "address" + }, + { + "internalType": "uint256", + "name": "revokeSignerThawingPeriod", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "AuthorizableInvalidSignerProof", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "proofDeadline", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "currentTimestamp", + "type": "uint256" + } + ], + "name": "AuthorizableInvalidSignerProofDeadline", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "authorizer", + "type": "address" + }, + { + "internalType": "address", + "name": "signer", + "type": "address" + }, + { + "internalType": "bool", + "name": "revoked", + "type": "bool" + } + ], + "name": "AuthorizableSignerAlreadyAuthorized", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "authorizer", + "type": "address" + }, + { + "internalType": "address", + "name": "signer", + "type": "address" + } + ], + "name": "AuthorizableSignerNotAuthorized", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "signer", + "type": "address" + } + ], + "name": "AuthorizableSignerNotThawing", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "currentTimestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "thawEndTimestamp", + "type": "uint256" + } + ], + "name": "AuthorizableSignerStillThawing", + "type": "error" + }, + { + "inputs": [], + "name": "ECDSAInvalidSignature", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "length", + "type": "uint256" + } + ], + "name": "ECDSAInvalidSignatureLength", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "ECDSAInvalidSignatureS", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "contractName", + "type": "bytes" + } + ], + "name": "GraphDirectoryInvalidZeroAddress", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "internalType": "address", + "name": "dataService", + "type": "address" + } + ], + "name": "GraphTallyCollectorCallerNotDataService", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokensCollected", + "type": "uint256" + } + ], + "name": "GraphTallyCollectorInconsistentRAVTokens", + "type": "error" + }, + { + "inputs": [], + "name": "GraphTallyCollectorInvalidRAVSigner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokensToCollect", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxTokensToCollect", + "type": "uint256" + } + ], + "name": "GraphTallyCollectorInvalidTokensToCollectAmount", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "dataService", + "type": "address" + } + ], + "name": "GraphTallyCollectorUnauthorizedDataService", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidShortString", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "str", + "type": "string" + } + ], + "name": "StringTooLong", + "type": "error" + }, + { + "anonymous": false, + "inputs": [], + "name": "EIP712DomainChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "graphToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "graphStaking", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphPayments", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphEscrow", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "graphController", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphEpochManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphRewardsManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphTokenGateway", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphProxyAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphCuration", + "type": "address" + } + ], + "name": "GraphDirectoryInitialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "paymentType", + "type": "uint8" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "collectionId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "dataService", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "PaymentCollected", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "collectionId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "dataService", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "timestampNs", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "uint128", + "name": "valueAggregate", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "metadata", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "signature", + "type": "bytes" + } + ], + "name": "RAVCollected", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "authorizer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "signer", + "type": "address" + } + ], + "name": "SignerAuthorized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "authorizer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "signer", + "type": "address" + } + ], + "name": "SignerRevoked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "authorizer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "signer", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "thawEndTimestamp", + "type": "uint256" + } + ], + "name": "SignerThawCanceled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "authorizer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "signer", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "thawEndTimestamp", + "type": "uint256" + } + ], + "name": "SignerThawing", + "type": "event" + }, + { + "inputs": [], + "name": "REVOKE_AUTHORIZATION_THAWING_PERIOD", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "signer", + "type": "address" + } + ], + "name": "authorizations", + "outputs": [ + { + "internalType": "address", + "name": "authorizer", + "type": "address" + }, + { + "internalType": "uint256", + "name": "thawEndTimestamp", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "revoked", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "signer", + "type": "address" + }, + { + "internalType": "uint256", + "name": "proofDeadline", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "proof", + "type": "bytes" + } + ], + "name": "authorizeSigner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "signer", + "type": "address" + } + ], + "name": "cancelThawSigner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "paymentType", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "tokensToCollect", + "type": "uint256" + } + ], + "name": "collect", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "paymentType", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "collect", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "eip712Domain", + "outputs": [ + { + "internalType": "bytes1", + "name": "fields", + "type": "bytes1" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "version", + "type": "string" + }, + { + "internalType": "uint256", + "name": "chainId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "verifyingContract", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "salt", + "type": "bytes32" + }, + { + "internalType": "uint256[]", + "name": "extensions", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "collectionId", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "dataService", + "type": "address" + }, + { + "internalType": "uint64", + "name": "timestampNs", + "type": "uint64" + }, + { + "internalType": "uint128", + "name": "valueAggregate", + "type": "uint128" + }, + { + "internalType": "bytes", + "name": "metadata", + "type": "bytes" + } + ], + "internalType": "struct IGraphTallyCollector.ReceiptAggregateVoucher", + "name": "rav", + "type": "tuple" + } + ], + "name": "encodeRAV", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "signer", + "type": "address" + } + ], + "name": "getThawEnd", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "authorizer", + "type": "address" + }, + { + "internalType": "address", + "name": "signer", + "type": "address" + } + ], + "name": "isAuthorized", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "collectionId", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "dataService", + "type": "address" + }, + { + "internalType": "uint64", + "name": "timestampNs", + "type": "uint64" + }, + { + "internalType": "uint128", + "name": "valueAggregate", + "type": "uint128" + }, + { + "internalType": "bytes", + "name": "metadata", + "type": "bytes" + } + ], + "internalType": "struct IGraphTallyCollector.ReceiptAggregateVoucher", + "name": "rav", + "type": "tuple" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + } + ], + "internalType": "struct IGraphTallyCollector.SignedRAV", + "name": "signedRAV", + "type": "tuple" + } + ], + "name": "recoverRAVSigner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "signer", + "type": "address" + } + ], + "name": "revokeAuthorizedSigner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "signer", + "type": "address" + } + ], + "name": "thawSigner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "dataService", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "collectionId", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "payer", + "type": "address" + } + ], + "name": "tokensCollected", + "outputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "bytecode": "0x6102c060405234801561001157600080fd5b506040516122bf3803806122bf833981016040819052610030916105e0565b8082858561003f8260006103e2565b6101205261004e8160016103e2565b61014052815160208084019190912060e052815190820120610100524660a0526100db60e05161010051604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201529081019290925260608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b60805250503060c0526001600160a01b03811661012d5760405163218f5add60e11b815260206004820152600a60248201526921b7b73a3937b63632b960b11b60448201526064015b60405180910390fd5b6001600160a01b0381166101e05260408051808201909152600a81526923b930b8342a37b5b2b760b11b602082015261016590610415565b6001600160a01b0316610160526040805180820190915260078152665374616b696e6760c81b602082015261019990610415565b6001600160a01b03166101805260408051808201909152600d81526c47726170685061796d656e747360981b60208201526101d390610415565b6001600160a01b03166101a05260408051808201909152600e81526d5061796d656e7473457363726f7760901b602082015261020e90610415565b6001600160a01b03166101c05260408051808201909152600c81526b22b837b1b426b0b730b3b2b960a11b602082015261024790610415565b6001600160a01b03166102005260408051808201909152600e81526d2932bbb0b93239a6b0b730b3b2b960911b602082015261028290610415565b6001600160a01b0316610220526040805180820190915260118152704772617068546f6b656e4761746577617960781b60208201526102c090610415565b6001600160a01b03166102405260408051808201909152600f81526e23b930b834283937bc3ca0b236b4b760891b60208201526102fc90610415565b6001600160a01b03166102605260408051808201909152600881526721bab930ba34b7b760c11b602082015261033190610415565b6001600160a01b039081166102808190526101e05161018051610160516101a0516101c0516102005161022051610240516102605160408051968c168752948b166020870152928a1685850152908916606085015288166080840152871660a083015260c0820195909552935192851694918216939116917fef5021414834d86e36470f5c1cecf6544fb2bb723f2ca51a4c86fcd8c5919a439181900360e00190a4506102a0525061082d92505050565b60006020835110156103fe576103f7836104c3565b905061040f565b8161040984826106ea565b5060ff90505b92915050565b6000806101e0516001600160a01b031663f7641a5e84805190602001206040518263ffffffff1660e01b815260040161045091815260200190565b602060405180830381865afa15801561046d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061049191906107a8565b9050826001600160a01b0382166104bc5760405163218f5add60e11b815260040161012491906107f6565b5092915050565b600080829050601f815111156104ee578260405163305a27a960e01b815260040161012491906107f6565b80516104f982610809565b179392505050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561053257818101518382015260200161051a565b50506000910152565b600082601f83011261054c57600080fd5b81516001600160401b0381111561056557610565610501565b604051601f8201601f19908116603f011681016001600160401b038111828210171561059357610593610501565b6040528181528382016020018510156105ab57600080fd5b6105bc826020830160208701610517565b949350505050565b80516001600160a01b03811681146105db57600080fd5b919050565b600080600080608085870312156105f657600080fd5b84516001600160401b0381111561060c57600080fd5b6106188782880161053b565b602087015190955090506001600160401b0381111561063657600080fd5b6106428782880161053b565b935050610651604086016105c4565b6060959095015193969295505050565b600181811c9082168061067557607f821691505b60208210810361069557634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156106e557806000526020600020601f840160051c810160208510156106c25750805b601f840160051c820191505b818110156106e257600081556001016106ce565b50505b505050565b81516001600160401b0381111561070357610703610501565b610717816107118454610661565b8461069b565b6020601f82116001811461074b57600083156107335750848201515b600019600385901b1c1916600184901b1784556106e2565b600084815260208120601f198516915b8281101561077b578785015182556020948501946001909201910161075b565b50848210156107995786840151600019600387901b60f8161c191681555b50505050600190811b01905550565b6000602082840312156107ba57600080fd5b6107c3826105c4565b9392505050565b600081518084526107e2816020860160208601610517565b601f01601f19169290920160200192915050565b6020815260006107c360208301846107ca565b805160208083015191908110156106955760001960209190910360031b1b16919050565b60805160a05160c05160e05161010051610120516101405161016051610180516101a0516101c0516101e05161020051610220516102405161026051610280516102a0516119d06108ef60003960008181610247015261036501526000505060005050600050506000505060005050600050506000610a19015260005050600061083e0152600050506000610bb401526000610b8201526000610f2b01526000610f0301526000610e5e01526000610e8801526000610eb201526119d06000f3fe608060405234801561001057600080fd5b50600436106100ba5760003560e01c8063015cdd80146100bf5780631354f019146100d4578063181250ff146100e757806326969c4c1461013457806339aa7416146101475780633a13e1af1461015a57806363648817146101be57806365e4ad9e146101de578063692209ce146102015780637f07d2831461021457806384b0196e146102275780639b95288114610242578063bea5d2ab14610269578063fee9f01f14610295575b600080fd5b6100d26100cd3660046111d7565b6102a8565b005b6100d26100e23660046111d7565b610355565b6101216100f53660046111f4565b600360209081526000948552604080862082529385528385208152918452828420909152825290205481565b6040519081526020015b60405180910390f35b610121610142366004611247565b6103ea565b6100d26101553660046111d7565b610403565b6101976101683660046111d7565b60026020819052600091825260409091208054600182015491909201546001600160a01b039092169160ff1683565b604080516001600160a01b039094168452602084019290925215159082015260600161012b565b6101d16101cc366004611281565b6104cd565b60405161012b91906112bb565b6101f16101ec3660046112cf565b6104e0565b604051901515815260200161012b565b61012161020f36600461135f565b6104f3565b6101216102223660046113b8565b61050a565b61022f610521565b60405161012b9796959493929190611450565b6101217f000000000000000000000000000000000000000000000000000000000000000081565b6101216102773660046111d7565b6001600160a01b031660009081526002602052604090206001015490565b6100d26102a33660046114e8565b610567565b806102b33382610633565b6001600160a01b03821660009081526002602052604090206001015482906102f85760405163cd3cd55d60e01b81526004016102ef91906112bb565b60405180910390fd5b506001600160a01b038216600081815260026020908152604080832060010180549390555182815291929133917f3b4432b11b66b46d9a7b190aa989c0ae85a5395b543540220596dd94dd405ceb910160405180910390a3505050565b806103603382610633565b61038a7f000000000000000000000000000000000000000000000000000000000000000042611559565b6001600160a01b0383166000818152600260205260409081902060010183905551909133917fd939049941f6a15381248e4ac0010f15efdf0f3221923711244c200b5ff2cddf916103de9190815260200190565b60405180910390a35050565b60006103fd6103f88361170b565b610666565b92915050565b8061040e3382610633565b6001600160a01b038216600090815260026020526040902060010154828161044a5760405163cd3cd55d60e01b81526004016102ef91906112bb565b504281818111156104775760405163bd76307f60e01b8152600481019290925260248201526044016102ef565b50506001600160a01b0383166000818152600260208190526040808320909101805460ff191660011790555133917f2fc91dbd92d741cae16e0315578d7f6cf77043b771692c4bd993658ecfe8942291a3505050565b60006103fd6104db836117a8565b610738565b60006104ec8383610758565b9392505050565b6000610501858585856107bb565b95945050505050565b600061051984848460006107bb565b949350505050565b600060608060008060006060610535610b7b565b61053d610bad565b60408051600080825260208201909252600f60f81b9b939a50919850469750309650945092509050565b6001600160a01b0384811660009081526002602081905260409091208054910154911690859060ff1682156105cb57604051630c83a00f60e01b81526001600160a01b039384166004820152929091166024830152151560448201526064016102ef565b5050506105da82828587610bda565b6001600160a01b03841660008181526002602052604080822080546001600160a01b03191633908117909155905190917f6edcdd4150e63c6c36d965976c1c37375609c8b040c50d39e7156437b80e282891a350505050565b61063d8282610758565b8282909161066057604051631e58ab1f60e01b81526004016102ef9291906117b4565b50505050565b60006103fd7f2f8962be843489018f0fe44aa06adfead655e3c10d7347a020040f9524f392d3836000015184602001518560400151866060015187608001518860a001518960c001518051906020012060405160200161071d98979695949392919097885260208801969096526001600160a01b0394851660408801529284166060870152921660808501526001600160401b039190911660a08401526001600160801b031660c083015260e08201526101000190565b60405160208183030381529060405280519060200120610d17565b6000806107488360000151610666565b90506104ec818460200151610d44565b60006001600160a01b0383161580159061078e57506001600160a01b038281166000908152600260205260409020548116908416145b80156104ec5750506001600160a01b03166000908152600260208190526040909120015460ff1615919050565b60008080806107cc868801886117ce565b825160600151929550909350915033906001600160a01b038116821461080757604051632b65e49760e11b81526004016102ef9291906117b4565b505061081283610d6e565b8251805160608201516040928301519251630119cbed60e31b8152919290916000906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906308ce5f689061087590859087906004016117b4565b602060405180830381865afa158015610892573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108b69190611828565b875160600151909150816108de5760405163037a2d1f60e61b81526004016102ef91906112bb565b5050855160a001516001600160a01b0380841660009081526003602090815260408083208884528252808320868516845282528083208b5183015190941683529290529081205490916001600160801b031690818180821161095c57604051637007d4a160e01b8152600481019290925260248201526044016102ef565b50508a600003610977576109708183611841565b92506109bd565b6109818183611841565b8b11158b61098f8385611841565b90916109b75760405163c5602bb160e01b8152600481019290925260248201526044016102ef565b50508a92505b50508015610aac576001600160a01b0380841660009081526003602090815260408083208884528252808320868516845282528083208b5183015190941683529290529081208054839290610a13908490611559565b909155507f000000000000000000000000000000000000000000000000000000000000000090506001600160a01b0316631230fa3e8d8960000151602001518585888c8c6040518863ffffffff1660e01b8152600401610a79979695949392919061188c565b600060405180830381600087803b158015610a9357600080fd5b505af1158015610aa7573d6000803e3d6000fd5b505050505b826001600160a01b03168760000151602001516001600160a01b0316857f481a17595c709e8f745444fb9ffc8f0b5e98458de94463971947f548e12bbdb48f8686604051610afc939291906118d8565b60405180910390a48651602080820151608083015160a084015160c090940151928b01516040516001600160a01b03808a16969416948a947f3943fc3b19ec289c87b57de7a8bf1448d81ced03d1806144ecaca4ba9e97605694610b64948b94919391611900565b60405180910390a49b9a5050505050505050505050565b6060610ba87f00000000000000000000000000000000000000000000000000000000000000006000610da6565b905090565b6060610ba87f00000000000000000000000000000000000000000000000000000000000000006001610da6565b8142808211610c055760405163d7705a0160e01b8152600481019290925260248201526044016102ef565b505060408051466020808301919091526001600160601b031930606090811b8216848601527330baba3437b934bd32a9b4b3b732b9283937b7b360611b60548501526068840187905233901b1660888301528251808303607c018152609c90920190925280519101207b0ca2ba3432b932bab69029b4b3b732b21026b2b9b9b0b3b29d05199960211b6000908152601c829052603c81209050826001600160a01b0316610ce88288888080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610d4492505050565b6001600160a01b031614610d0f57604051631c07ed3360e31b815260040160405180910390fd5b505050505050565b60006103fd610d24610e51565b8360405161190160f01b8152600281019290925260228201526042902090565b600080600080610d548686610f7c565b925092509250610d648282610fc9565b5090949350505050565b805160200151610d8690610d8183610738565b610758565b610da35760405163aa415c3360e01b815260040160405180910390fd5b50565b606060ff8314610dc057610db983611086565b90506103fd565b818054610dcc90611960565b80601f0160208091040260200160405190810160405280929190818152602001828054610df890611960565b8015610e455780601f10610e1a57610100808354040283529160200191610e45565b820191906000526020600020905b815481529060010190602001808311610e2857829003601f168201915b505050505090506103fd565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148015610eaa57507f000000000000000000000000000000000000000000000000000000000000000046145b15610ed457507f000000000000000000000000000000000000000000000000000000000000000090565b610ba8604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f0000000000000000000000000000000000000000000000000000000000000000918101919091527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b60008060008351604103610fb65760208401516040850151606086015160001a610fa8888285856110c5565b955095509550505050610fc2565b50508151600091506002905b9250925092565b6000826003811115610fdd57610fdd611854565b03610fe6575050565b6001826003811115610ffa57610ffa611854565b036110185760405163f645eedf60e01b815260040160405180910390fd5b600282600381111561102c5761102c611854565b0361104d5760405163fce698f760e01b8152600481018290526024016102ef565b600382600381111561106157611061611854565b03611082576040516335e2f38360e21b8152600481018290526024016102ef565b5050565b606060006110938361118a565b604080516020808252818301909252919250600091906020820181803683375050509182525060208101929092525090565b600080806fa2a8918ca85bafe22016d0b997e4df60600160ff1b038411156110f65750600091506003905082611180565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa15801561114a573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661117657506000925060019150829050611180565b9250600091508190505b9450945094915050565b600060ff8216601f8111156103fd57604051632cd44ac360e21b815260040160405180910390fd5b6001600160a01b0381168114610da357600080fd5b80356111d2816111b2565b919050565b6000602082840312156111e957600080fd5b81356104ec816111b2565b6000806000806080858703121561120a57600080fd5b8435611215816111b2565b935060208501359250604085013561122c816111b2565b9150606085013561123c816111b2565b939692955090935050565b60006020828403121561125957600080fd5b81356001600160401b0381111561126f57600080fd5b820160e081850312156104ec57600080fd5b60006020828403121561129357600080fd5b81356001600160401b038111156112a957600080fd5b8201604081850312156104ec57600080fd5b6001600160a01b0391909116815260200190565b600080604083850312156112e257600080fd5b82356112ed816111b2565b915060208301356112fd816111b2565b809150509250929050565b8035600381106111d257600080fd5b60008083601f84011261132957600080fd5b5081356001600160401b0381111561134057600080fd5b60208301915083602082850101111561135857600080fd5b9250929050565b6000806000806060858703121561137557600080fd5b61137e85611308565b935060208501356001600160401b0381111561139957600080fd5b6113a587828801611317565b9598909750949560400135949350505050565b6000806000604084860312156113cd57600080fd5b6113d684611308565b925060208401356001600160401b038111156113f157600080fd5b6113fd86828701611317565b9497909650939450505050565b6000815180845260005b8181101561143057602081850181015186830182015201611414565b506000602082860101526020601f19601f83011685010191505092915050565b60ff60f81b8816815260e06020820152600061146f60e083018961140a565b8281036040840152611481818961140a565b606084018890526001600160a01b038716608085015260a0840186905283810360c08501528451808252602080870193509091019060005b818110156114d75783518352602093840193909201916001016114b9565b50909b9a5050505050505050505050565b600080600080606085870312156114fe57600080fd5b8435611509816111b2565b93506020850135925060408501356001600160401b0381111561152b57600080fd5b61153787828801611317565b95989497509550505050565b634e487b7160e01b600052601160045260246000fd5b808201808211156103fd576103fd611543565b634e487b7160e01b600052604160045260246000fd5b60405160e081016001600160401b03811182821017156115a4576115a461156c565b60405290565b80356001600160401b03811681146111d257600080fd5b80356001600160801b03811681146111d257600080fd5b600082601f8301126115e957600080fd5b81356001600160401b038111156116025761160261156c565b604051601f8201601f19908116603f011681016001600160401b03811182821017156116305761163061156c565b60405281815283820160200185101561164857600080fd5b816020850160208301376000918101602001919091529392505050565b600060e0828403121561167757600080fd5b61167f611582565b823581529050611691602083016111c7565b60208201526116a2604083016111c7565b60408201526116b3606083016111c7565b60608201526116c4608083016115aa565b60808201526116d560a083016115c1565b60a082015260c08201356001600160401b038111156116f357600080fd5b6116ff848285016115d8565b60c08301525092915050565b60006103fd3683611665565b60006040828403121561172957600080fd5b604080519081016001600160401b038111828210171561174b5761174b61156c565b60405290508082356001600160401b0381111561176757600080fd5b61177385828601611665565b82525060208301356001600160401b0381111561178f57600080fd5b61179b858286016115d8565b6020830152505092915050565b60006103fd3683611717565b6001600160a01b0392831681529116602082015260400190565b6000806000606084860312156117e357600080fd5b83356001600160401b038111156117f957600080fd5b61180586828701611717565b93505060208401359150604084013561181d816111b2565b809150509250925092565b60006020828403121561183a57600080fd5b5051919050565b818103818111156103fd576103fd611543565b634e487b7160e01b600052602160045260246000fd5b6003811061188857634e487b7160e01b600052602160045260246000fd5b9052565b60e0810161189a828a61186a565b6001600160a01b03978816602083015295871660408201526060810194909452918516608084015260a083015290921660c090920191909152919050565b606081016118e6828661186a565b6001600160a01b0393909316602082015260400152919050565b6001600160a01b03861681526001600160401b03851660208201526001600160801b038416604082015260a0606082018190526000906119429083018561140a565b8281036080840152611954818561140a565b98975050505050505050565b600181811c9082168061197457607f821691505b60208210810361199457634e487b7160e01b600052602260045260246000fd5b5091905056fea26469706673582212202168ccf8bac6984eef611a01a2e1c7b84ddb64fd4b819201ae6206ab6038e15764736f6c634300081b0033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100ba5760003560e01c8063015cdd80146100bf5780631354f019146100d4578063181250ff146100e757806326969c4c1461013457806339aa7416146101475780633a13e1af1461015a57806363648817146101be57806365e4ad9e146101de578063692209ce146102015780637f07d2831461021457806384b0196e146102275780639b95288114610242578063bea5d2ab14610269578063fee9f01f14610295575b600080fd5b6100d26100cd3660046111d7565b6102a8565b005b6100d26100e23660046111d7565b610355565b6101216100f53660046111f4565b600360209081526000948552604080862082529385528385208152918452828420909152825290205481565b6040519081526020015b60405180910390f35b610121610142366004611247565b6103ea565b6100d26101553660046111d7565b610403565b6101976101683660046111d7565b60026020819052600091825260409091208054600182015491909201546001600160a01b039092169160ff1683565b604080516001600160a01b039094168452602084019290925215159082015260600161012b565b6101d16101cc366004611281565b6104cd565b60405161012b91906112bb565b6101f16101ec3660046112cf565b6104e0565b604051901515815260200161012b565b61012161020f36600461135f565b6104f3565b6101216102223660046113b8565b61050a565b61022f610521565b60405161012b9796959493929190611450565b6101217f000000000000000000000000000000000000000000000000000000000000000081565b6101216102773660046111d7565b6001600160a01b031660009081526002602052604090206001015490565b6100d26102a33660046114e8565b610567565b806102b33382610633565b6001600160a01b03821660009081526002602052604090206001015482906102f85760405163cd3cd55d60e01b81526004016102ef91906112bb565b60405180910390fd5b506001600160a01b038216600081815260026020908152604080832060010180549390555182815291929133917f3b4432b11b66b46d9a7b190aa989c0ae85a5395b543540220596dd94dd405ceb910160405180910390a3505050565b806103603382610633565b61038a7f000000000000000000000000000000000000000000000000000000000000000042611559565b6001600160a01b0383166000818152600260205260409081902060010183905551909133917fd939049941f6a15381248e4ac0010f15efdf0f3221923711244c200b5ff2cddf916103de9190815260200190565b60405180910390a35050565b60006103fd6103f88361170b565b610666565b92915050565b8061040e3382610633565b6001600160a01b038216600090815260026020526040902060010154828161044a5760405163cd3cd55d60e01b81526004016102ef91906112bb565b504281818111156104775760405163bd76307f60e01b8152600481019290925260248201526044016102ef565b50506001600160a01b0383166000818152600260208190526040808320909101805460ff191660011790555133917f2fc91dbd92d741cae16e0315578d7f6cf77043b771692c4bd993658ecfe8942291a3505050565b60006103fd6104db836117a8565b610738565b60006104ec8383610758565b9392505050565b6000610501858585856107bb565b95945050505050565b600061051984848460006107bb565b949350505050565b600060608060008060006060610535610b7b565b61053d610bad565b60408051600080825260208201909252600f60f81b9b939a50919850469750309650945092509050565b6001600160a01b0384811660009081526002602081905260409091208054910154911690859060ff1682156105cb57604051630c83a00f60e01b81526001600160a01b039384166004820152929091166024830152151560448201526064016102ef565b5050506105da82828587610bda565b6001600160a01b03841660008181526002602052604080822080546001600160a01b03191633908117909155905190917f6edcdd4150e63c6c36d965976c1c37375609c8b040c50d39e7156437b80e282891a350505050565b61063d8282610758565b8282909161066057604051631e58ab1f60e01b81526004016102ef9291906117b4565b50505050565b60006103fd7f2f8962be843489018f0fe44aa06adfead655e3c10d7347a020040f9524f392d3836000015184602001518560400151866060015187608001518860a001518960c001518051906020012060405160200161071d98979695949392919097885260208801969096526001600160a01b0394851660408801529284166060870152921660808501526001600160401b039190911660a08401526001600160801b031660c083015260e08201526101000190565b60405160208183030381529060405280519060200120610d17565b6000806107488360000151610666565b90506104ec818460200151610d44565b60006001600160a01b0383161580159061078e57506001600160a01b038281166000908152600260205260409020548116908416145b80156104ec5750506001600160a01b03166000908152600260208190526040909120015460ff1615919050565b60008080806107cc868801886117ce565b825160600151929550909350915033906001600160a01b038116821461080757604051632b65e49760e11b81526004016102ef9291906117b4565b505061081283610d6e565b8251805160608201516040928301519251630119cbed60e31b8152919290916000906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906308ce5f689061087590859087906004016117b4565b602060405180830381865afa158015610892573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108b69190611828565b875160600151909150816108de5760405163037a2d1f60e61b81526004016102ef91906112bb565b5050855160a001516001600160a01b0380841660009081526003602090815260408083208884528252808320868516845282528083208b5183015190941683529290529081205490916001600160801b031690818180821161095c57604051637007d4a160e01b8152600481019290925260248201526044016102ef565b50508a600003610977576109708183611841565b92506109bd565b6109818183611841565b8b11158b61098f8385611841565b90916109b75760405163c5602bb160e01b8152600481019290925260248201526044016102ef565b50508a92505b50508015610aac576001600160a01b0380841660009081526003602090815260408083208884528252808320868516845282528083208b5183015190941683529290529081208054839290610a13908490611559565b909155507f000000000000000000000000000000000000000000000000000000000000000090506001600160a01b0316631230fa3e8d8960000151602001518585888c8c6040518863ffffffff1660e01b8152600401610a79979695949392919061188c565b600060405180830381600087803b158015610a9357600080fd5b505af1158015610aa7573d6000803e3d6000fd5b505050505b826001600160a01b03168760000151602001516001600160a01b0316857f481a17595c709e8f745444fb9ffc8f0b5e98458de94463971947f548e12bbdb48f8686604051610afc939291906118d8565b60405180910390a48651602080820151608083015160a084015160c090940151928b01516040516001600160a01b03808a16969416948a947f3943fc3b19ec289c87b57de7a8bf1448d81ced03d1806144ecaca4ba9e97605694610b64948b94919391611900565b60405180910390a49b9a5050505050505050505050565b6060610ba87f00000000000000000000000000000000000000000000000000000000000000006000610da6565b905090565b6060610ba87f00000000000000000000000000000000000000000000000000000000000000006001610da6565b8142808211610c055760405163d7705a0160e01b8152600481019290925260248201526044016102ef565b505060408051466020808301919091526001600160601b031930606090811b8216848601527330baba3437b934bd32a9b4b3b732b9283937b7b360611b60548501526068840187905233901b1660888301528251808303607c018152609c90920190925280519101207b0ca2ba3432b932bab69029b4b3b732b21026b2b9b9b0b3b29d05199960211b6000908152601c829052603c81209050826001600160a01b0316610ce88288888080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610d4492505050565b6001600160a01b031614610d0f57604051631c07ed3360e31b815260040160405180910390fd5b505050505050565b60006103fd610d24610e51565b8360405161190160f01b8152600281019290925260228201526042902090565b600080600080610d548686610f7c565b925092509250610d648282610fc9565b5090949350505050565b805160200151610d8690610d8183610738565b610758565b610da35760405163aa415c3360e01b815260040160405180910390fd5b50565b606060ff8314610dc057610db983611086565b90506103fd565b818054610dcc90611960565b80601f0160208091040260200160405190810160405280929190818152602001828054610df890611960565b8015610e455780601f10610e1a57610100808354040283529160200191610e45565b820191906000526020600020905b815481529060010190602001808311610e2857829003601f168201915b505050505090506103fd565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148015610eaa57507f000000000000000000000000000000000000000000000000000000000000000046145b15610ed457507f000000000000000000000000000000000000000000000000000000000000000090565b610ba8604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f0000000000000000000000000000000000000000000000000000000000000000918101919091527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b60008060008351604103610fb65760208401516040850151606086015160001a610fa8888285856110c5565b955095509550505050610fc2565b50508151600091506002905b9250925092565b6000826003811115610fdd57610fdd611854565b03610fe6575050565b6001826003811115610ffa57610ffa611854565b036110185760405163f645eedf60e01b815260040160405180910390fd5b600282600381111561102c5761102c611854565b0361104d5760405163fce698f760e01b8152600481018290526024016102ef565b600382600381111561106157611061611854565b03611082576040516335e2f38360e21b8152600481018290526024016102ef565b5050565b606060006110938361118a565b604080516020808252818301909252919250600091906020820181803683375050509182525060208101929092525090565b600080806fa2a8918ca85bafe22016d0b997e4df60600160ff1b038411156110f65750600091506003905082611180565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa15801561114a573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661117657506000925060019150829050611180565b9250600091508190505b9450945094915050565b600060ff8216601f8111156103fd57604051632cd44ac360e21b815260040160405180910390fd5b6001600160a01b0381168114610da357600080fd5b80356111d2816111b2565b919050565b6000602082840312156111e957600080fd5b81356104ec816111b2565b6000806000806080858703121561120a57600080fd5b8435611215816111b2565b935060208501359250604085013561122c816111b2565b9150606085013561123c816111b2565b939692955090935050565b60006020828403121561125957600080fd5b81356001600160401b0381111561126f57600080fd5b820160e081850312156104ec57600080fd5b60006020828403121561129357600080fd5b81356001600160401b038111156112a957600080fd5b8201604081850312156104ec57600080fd5b6001600160a01b0391909116815260200190565b600080604083850312156112e257600080fd5b82356112ed816111b2565b915060208301356112fd816111b2565b809150509250929050565b8035600381106111d257600080fd5b60008083601f84011261132957600080fd5b5081356001600160401b0381111561134057600080fd5b60208301915083602082850101111561135857600080fd5b9250929050565b6000806000806060858703121561137557600080fd5b61137e85611308565b935060208501356001600160401b0381111561139957600080fd5b6113a587828801611317565b9598909750949560400135949350505050565b6000806000604084860312156113cd57600080fd5b6113d684611308565b925060208401356001600160401b038111156113f157600080fd5b6113fd86828701611317565b9497909650939450505050565b6000815180845260005b8181101561143057602081850181015186830182015201611414565b506000602082860101526020601f19601f83011685010191505092915050565b60ff60f81b8816815260e06020820152600061146f60e083018961140a565b8281036040840152611481818961140a565b606084018890526001600160a01b038716608085015260a0840186905283810360c08501528451808252602080870193509091019060005b818110156114d75783518352602093840193909201916001016114b9565b50909b9a5050505050505050505050565b600080600080606085870312156114fe57600080fd5b8435611509816111b2565b93506020850135925060408501356001600160401b0381111561152b57600080fd5b61153787828801611317565b95989497509550505050565b634e487b7160e01b600052601160045260246000fd5b808201808211156103fd576103fd611543565b634e487b7160e01b600052604160045260246000fd5b60405160e081016001600160401b03811182821017156115a4576115a461156c565b60405290565b80356001600160401b03811681146111d257600080fd5b80356001600160801b03811681146111d257600080fd5b600082601f8301126115e957600080fd5b81356001600160401b038111156116025761160261156c565b604051601f8201601f19908116603f011681016001600160401b03811182821017156116305761163061156c565b60405281815283820160200185101561164857600080fd5b816020850160208301376000918101602001919091529392505050565b600060e0828403121561167757600080fd5b61167f611582565b823581529050611691602083016111c7565b60208201526116a2604083016111c7565b60408201526116b3606083016111c7565b60608201526116c4608083016115aa565b60808201526116d560a083016115c1565b60a082015260c08201356001600160401b038111156116f357600080fd5b6116ff848285016115d8565b60c08301525092915050565b60006103fd3683611665565b60006040828403121561172957600080fd5b604080519081016001600160401b038111828210171561174b5761174b61156c565b60405290508082356001600160401b0381111561176757600080fd5b61177385828601611665565b82525060208301356001600160401b0381111561178f57600080fd5b61179b858286016115d8565b6020830152505092915050565b60006103fd3683611717565b6001600160a01b0392831681529116602082015260400190565b6000806000606084860312156117e357600080fd5b83356001600160401b038111156117f957600080fd5b61180586828701611717565b93505060208401359150604084013561181d816111b2565b809150509250925092565b60006020828403121561183a57600080fd5b5051919050565b818103818111156103fd576103fd611543565b634e487b7160e01b600052602160045260246000fd5b6003811061188857634e487b7160e01b600052602160045260246000fd5b9052565b60e0810161189a828a61186a565b6001600160a01b03978816602083015295871660408201526060810194909452918516608084015260a083015290921660c090920191909152919050565b606081016118e6828661186a565b6001600160a01b0393909316602082015260400152919050565b6001600160a01b03861681526001600160401b03851660208201526001600160801b038416604082015260a0606082018190526000906119429083018561140a565b8281036080840152611954818561140a565b98975050505050505050565b600181811c9082168061197457607f821691505b60208210810361199457634e487b7160e01b600052602260045260246000fd5b5091905056fea26469706673582212202168ccf8bac6984eef611a01a2e1c7b84ddb64fd4b819201ae6206ab6038e15764736f6c634300081b0033", + "linkReferences": {}, + "deployedLinkReferences": {} +} \ No newline at end of file diff --git a/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/HorizonProxies#GraphPayments_ProxyWithABI.json b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/HorizonProxies#GraphPayments_ProxyWithABI.json new file mode 100644 index 000000000..45cfb0f51 --- /dev/null +++ b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/HorizonProxies#GraphPayments_ProxyWithABI.json @@ -0,0 +1,337 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "GraphPayments", + "sourceName": "contracts/payments/GraphPayments.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "controller", + "type": "address" + }, + { + "internalType": "uint256", + "name": "protocolPaymentCut", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + } + ], + "name": "AddressEmptyCode", + "type": "error" + }, + { + "inputs": [], + "name": "FailedCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "contractName", + "type": "bytes" + } + ], + "name": "GraphDirectoryInvalidZeroAddress", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "cut", + "type": "uint256" + } + ], + "name": "GraphPaymentsInvalidCut", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "protocolPaymentCut", + "type": "uint256" + } + ], + "name": "GraphPaymentsInvalidProtocolPaymentCut", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidInitialization", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "a", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "b", + "type": "uint256" + } + ], + "name": "PPMMathInvalidMulPPM", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "PPMMathInvalidPPM", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "graphToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "graphStaking", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphPayments", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphEscrow", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "graphController", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphEpochManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphRewardsManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphTokenGateway", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphProxyAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphCuration", + "type": "address" + } + ], + "name": "GraphDirectoryInitialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "paymentType", + "type": "uint8" + }, + { + "indexed": true, + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "dataService", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensProtocol", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensDataService", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensDelegationPool", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensReceiver", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "receiverDestination", + "type": "address" + } + ], + "name": "GraphPaymentCollected", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "inputs": [], + "name": "PROTOCOL_PAYMENT_CUT", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "paymentType", + "type": "uint8" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "address", + "name": "dataService", + "type": "address" + }, + { + "internalType": "uint256", + "name": "dataServiceCut", + "type": "uint256" + }, + { + "internalType": "address", + "name": "receiverDestination", + "type": "address" + } + ], + "name": "collect", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "name": "multicall", + "outputs": [ + { + "internalType": "bytes[]", + "name": "results", + "type": "bytes[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "bytecode": "0x6101e060405234801561001157600080fd5b50604051611552380380611552833981016040819052610030916104ee565b816001600160a01b03811661007a5760405163218f5add60e11b815260206004820152600a60248201526921b7b73a3937b63632b960b11b60448201526064015b60405180910390fd5b6001600160a01b0381166101005260408051808201909152600a81526923b930b8342a37b5b2b760b11b60208201526100b290610372565b6001600160a01b03166080526040805180820190915260078152665374616b696e6760c81b60208201526100e590610372565b6001600160a01b031660a05260408051808201909152600d81526c47726170685061796d656e747360981b602082015261011e90610372565b6001600160a01b031660c05260408051808201909152600e81526d5061796d656e7473457363726f7760901b602082015261015890610372565b6001600160a01b031660e05260408051808201909152600c81526b22b837b1b426b0b730b3b2b960a11b602082015261019090610372565b6001600160a01b03166101205260408051808201909152600e81526d2932bbb0b93239a6b0b730b3b2b960911b60208201526101cb90610372565b6001600160a01b0316610140526040805180820190915260118152704772617068546f6b656e4761746577617960781b602082015261020990610372565b6001600160a01b03166101605260408051808201909152600f81526e23b930b834283937bc3ca0b236b4b760891b602082015261024590610372565b6001600160a01b03166101805260408051808201909152600881526721bab930ba34b7b760c11b602082015261027a90610372565b6001600160a01b039081166101a08190526101005160a05160805160c05160e05161012051610140516101605161018051604051988b169a9788169996909716977fef5021414834d86e36470f5c1cecf6544fb2bb723f2ca51a4c86fcd8c5919a43976103249790916001600160a01b03978816815295871660208701529386166040860152918516606085015284166080840152831660a083015290911660c082015260e00190565b60405180910390a45061033a81620f4240101590565b819061035c576040516339b762e560e21b815260040161007191815260200190565b506101c081905261036b610420565b505061058a565b600080610100516001600160a01b031663f7641a5e84805190602001206040518263ffffffff1660e01b81526004016103ad91815260200190565b602060405180830381865afa1580156103ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103ee919061051a565b9050826001600160a01b0382166104195760405163218f5add60e11b8152600401610071919061053c565b5092915050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff16156104705760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b03908116146104cf5780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b80516001600160a01b03811681146104e957600080fd5b919050565b6000806040838503121561050157600080fd5b61050a836104d2565b9150602083015190509250929050565b60006020828403121561052c57600080fd5b610535826104d2565b9392505050565b602081526000825180602084015260005b8181101561056a576020818601810151604086840101520161054d565b506000604082850101526040601f19601f83011684010191505092915050565b60805160a05160c05160e05161010051610120516101405161016051610180516101a0516101c051610f546105fe600039600081816056015261021f0152600050506000505060005050600050506000505060005050600050506000505060006108b20152600061077f0152610f546000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c80631d526e50146100515780638129fc1c1461008b57806381cd11a014610095578063ac9650d8146100a8575b600080fd5b6100787f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b6100936100c8565b005b6100936100a3366004610b2a565b6101c0565b6100bb6100b6366004610b96565b610662565b6040516100829190610c2f565b60006100d261074a565b805490915060ff600160401b82041615906001600160401b03166000811580156100f95750825b90506000826001600160401b031660011480156101155750303b155b905081158015610123575080155b156101415760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff19166001178555831561016b57845460ff60401b1916600160401b1785555b610173610773565b83156101b957845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b5050505050565b6101cd82620f4240101590565b82906101f8576040516339b762e560e21b81526004016101ef91815260200190565b60405180910390fd5b50610216338561020661077d565b6001600160a01b031691906107a1565b836000610243827f0000000000000000000000000000000000000000000000000000000000000000610857565b905061024f8183610cc5565b9150600061025d8386610857565b90506102698184610cc5565b92506000806102766108b0565b604051631584a17960e21b81526001600160a01b038c811660048301528a81166024830152919091169063561285e49060440160a060405180830381865afa1580156102c6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102ea9190610cee565b602081015190915015610388576103796103026108b0565b6001600160a01b0316637573ef4f8c8b8f6040518463ffffffff1660e01b815260040161033193929190610d83565b602060405180830381865afa15801561034e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103729190610dc7565b8690610857565b91506103858286610cc5565b94505b6103a38461039461077d565b6001600160a01b0316906108d4565b6103c088846103b061077d565b6001600160a01b03169190610939565b81156104b0576103ce61077d565b6001600160a01b031663095ea7b36103e46108b0565b846040518363ffffffff1660e01b8152600401610402929190610de0565b6020604051808303816000875af1158015610421573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104459190610df9565b5061044e6108b0565b6001600160a01b031663ca94b0e98b8a856040518463ffffffff1660e01b815260040161047d93929190610e1b565b600060405180830381600087803b15801561049757600080fd5b505af11580156104ab573d6000803e3d6000fd5b505050505b84156105bd576001600160a01b0386166105b0576104cc61077d565b6001600160a01b031663095ea7b36104e26108b0565b876040518363ffffffff1660e01b8152600401610500929190610de0565b6020604051808303816000875af115801561051f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105439190610df9565b5061054c6108b0565b6001600160a01b031663a2a317228b876040518363ffffffff1660e01b8152600401610579929190610de0565b600060405180830381600087803b15801561059357600080fd5b505af11580156105a7573d6000803e3d6000fd5b505050506105bd565b6105bd86866103b061077d565b6001600160a01b038816338c60028111156105da576105da610d6d565b7fb1ac8b16683562f4b1b5ecbe3321151b400058de5cdd25ac44d5bfacb106765f8d8d8989898d8f60405161064d97969594939291906001600160a01b039788168152602081019690965260408601949094526060850192909252608084015260a083015290911660c082015260e00190565b60405180910390a45050505050505050505050565b604080516000815260208101909152606090826001600160401b0381111561068c5761068c610cd8565b6040519080825280602002602001820160405280156106bf57816020015b60608152602001906001900390816106aa5790505b50915060005b838110156107415761071c308686848181106106e3576106e3610e3f565b90506020028101906106f59190610e55565b8560405160200161070893929190610ea2565b60405160208183030381529060405261096d565b83828151811061072e5761072e610e3f565b60209081029190910101526001016106c5565b50505b92915050565b6000807ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00610744565b61077b6109e3565b565b7f000000000000000000000000000000000000000000000000000000000000000090565b8015610852576040516323b872dd60e01b81526001600160a01b038416906323b872dd906107d790859030908690600401610e1b565b6020604051808303816000875af11580156107f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061081a9190610df9565b6108525760405162461bcd60e51b815260206004820152600960248201526810ba3930b739b332b960b91b60448201526064016101ef565b505050565b600061086682620f4240101590565b829061088857604051633dc311df60e01b81526004016101ef91815260200190565b5061089f8361089a84620f4240610cc5565b610a08565b6108a99084610cc5565b9392505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b801561093557604051630852cd8d60e31b8152600481018290526001600160a01b038316906342966c6890602401600060405180830381600087803b15801561091c57600080fd5b505af1158015610930573d6000803e3d6000fd5b505050505b5050565b80156108525760405163a9059cbb60e01b81526001600160a01b0384169063a9059cbb906107d79085908590600401610de0565b6060600080846001600160a01b03168460405161098a9190610ec9565b600060405180830381855af49150503d80600081146109c5576040519150601f19603f3d011682016040523d82523d6000602084013e6109ca565b606091505b50915091506109da858383610a6f565b95945050505050565b6109eb610acb565b61077b57604051631afcd79f60e31b815260040160405180910390fd5b6000610a1783620f4240101590565b80610a2a5750610a2a82620f4240101590565b83839091610a545760405163768bf0eb60e11b8152600481019290925260248201526044016101ef565b50620f42409050610a658385610ee5565b6108a99190610efc565b606082610a8457610a7f82610ae5565b6108a9565b8151158015610a9b57506001600160a01b0384163b155b15610ac457604051639996b31560e01b81526001600160a01b03851660048201526024016101ef565b5092915050565b6000610ad561074a565b54600160401b900460ff16919050565b805115610af55780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b80356001600160a01b0381168114610b2557600080fd5b919050565b60008060008060008060c08789031215610b4357600080fd5b863560038110610b5257600080fd5b9550610b6060208801610b0e565b945060408701359350610b7560608801610b0e565b925060808701359150610b8a60a08801610b0e565b90509295509295509295565b60008060208385031215610ba957600080fd5b82356001600160401b03811115610bbf57600080fd5b8301601f81018513610bd057600080fd5b80356001600160401b03811115610be657600080fd5b8560208260051b8401011115610bfb57600080fd5b6020919091019590945092505050565b60005b83811015610c26578181015183820152602001610c0e565b50506000910152565b6000602082016020835280845180835260408501915060408160051b86010192506020860160005b82811015610ca357603f1987860301845281518051808752610c80816020890160208501610c0b565b601f01601f19169590950160209081019550938401939190910190600101610c57565b50929695505050505050565b634e487b7160e01b600052601160045260246000fd5b8181038181111561074457610744610caf565b634e487b7160e01b600052604160045260246000fd5b600060a0828403128015610d0157600080fd5b6000905060405160a081018181106001600160401b0382111715610d3357634e487b7160e01b83526041600452602483fd5b6040908152845182526020808601519083015284810151908201526060808501519082015260809384015193810193909352509092915050565b634e487b7160e01b600052602160045260246000fd5b6001600160a01b038481168252831660208201526060810160038310610db957634e487b7160e01b600052602160045260246000fd5b826040830152949350505050565b600060208284031215610dd957600080fd5b5051919050565b6001600160a01b03929092168252602082015260400190565b600060208284031215610e0b57600080fd5b815180151581146108a957600080fd5b6001600160a01b039384168152919092166020820152604081019190915260600190565b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112610e6c57600080fd5b8301803591506001600160401b03821115610e8657600080fd5b602001915036819003821315610e9b57600080fd5b9250929050565b828482376000838201600081528351610ebf818360208801610c0b565b0195945050505050565b60008251610edb818460208701610c0b565b9190910192915050565b808202811582820484141761074457610744610caf565b600082610f1957634e487b7160e01b600052601260045260246000fd5b50049056fea2646970667358221220c7f05052208f6f4047e1223bab7d7f3c4001cbe9b001fbbc3b1069b01cc7eced64736f6c634300081b0033", + "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061004c5760003560e01c80631d526e50146100515780638129fc1c1461008b57806381cd11a014610095578063ac9650d8146100a8575b600080fd5b6100787f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b6100936100c8565b005b6100936100a3366004610b2a565b6101c0565b6100bb6100b6366004610b96565b610662565b6040516100829190610c2f565b60006100d261074a565b805490915060ff600160401b82041615906001600160401b03166000811580156100f95750825b90506000826001600160401b031660011480156101155750303b155b905081158015610123575080155b156101415760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff19166001178555831561016b57845460ff60401b1916600160401b1785555b610173610773565b83156101b957845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b5050505050565b6101cd82620f4240101590565b82906101f8576040516339b762e560e21b81526004016101ef91815260200190565b60405180910390fd5b50610216338561020661077d565b6001600160a01b031691906107a1565b836000610243827f0000000000000000000000000000000000000000000000000000000000000000610857565b905061024f8183610cc5565b9150600061025d8386610857565b90506102698184610cc5565b92506000806102766108b0565b604051631584a17960e21b81526001600160a01b038c811660048301528a81166024830152919091169063561285e49060440160a060405180830381865afa1580156102c6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102ea9190610cee565b602081015190915015610388576103796103026108b0565b6001600160a01b0316637573ef4f8c8b8f6040518463ffffffff1660e01b815260040161033193929190610d83565b602060405180830381865afa15801561034e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103729190610dc7565b8690610857565b91506103858286610cc5565b94505b6103a38461039461077d565b6001600160a01b0316906108d4565b6103c088846103b061077d565b6001600160a01b03169190610939565b81156104b0576103ce61077d565b6001600160a01b031663095ea7b36103e46108b0565b846040518363ffffffff1660e01b8152600401610402929190610de0565b6020604051808303816000875af1158015610421573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104459190610df9565b5061044e6108b0565b6001600160a01b031663ca94b0e98b8a856040518463ffffffff1660e01b815260040161047d93929190610e1b565b600060405180830381600087803b15801561049757600080fd5b505af11580156104ab573d6000803e3d6000fd5b505050505b84156105bd576001600160a01b0386166105b0576104cc61077d565b6001600160a01b031663095ea7b36104e26108b0565b876040518363ffffffff1660e01b8152600401610500929190610de0565b6020604051808303816000875af115801561051f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105439190610df9565b5061054c6108b0565b6001600160a01b031663a2a317228b876040518363ffffffff1660e01b8152600401610579929190610de0565b600060405180830381600087803b15801561059357600080fd5b505af11580156105a7573d6000803e3d6000fd5b505050506105bd565b6105bd86866103b061077d565b6001600160a01b038816338c60028111156105da576105da610d6d565b7fb1ac8b16683562f4b1b5ecbe3321151b400058de5cdd25ac44d5bfacb106765f8d8d8989898d8f60405161064d97969594939291906001600160a01b039788168152602081019690965260408601949094526060850192909252608084015260a083015290911660c082015260e00190565b60405180910390a45050505050505050505050565b604080516000815260208101909152606090826001600160401b0381111561068c5761068c610cd8565b6040519080825280602002602001820160405280156106bf57816020015b60608152602001906001900390816106aa5790505b50915060005b838110156107415761071c308686848181106106e3576106e3610e3f565b90506020028101906106f59190610e55565b8560405160200161070893929190610ea2565b60405160208183030381529060405261096d565b83828151811061072e5761072e610e3f565b60209081029190910101526001016106c5565b50505b92915050565b6000807ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00610744565b61077b6109e3565b565b7f000000000000000000000000000000000000000000000000000000000000000090565b8015610852576040516323b872dd60e01b81526001600160a01b038416906323b872dd906107d790859030908690600401610e1b565b6020604051808303816000875af11580156107f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061081a9190610df9565b6108525760405162461bcd60e51b815260206004820152600960248201526810ba3930b739b332b960b91b60448201526064016101ef565b505050565b600061086682620f4240101590565b829061088857604051633dc311df60e01b81526004016101ef91815260200190565b5061089f8361089a84620f4240610cc5565b610a08565b6108a99084610cc5565b9392505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b801561093557604051630852cd8d60e31b8152600481018290526001600160a01b038316906342966c6890602401600060405180830381600087803b15801561091c57600080fd5b505af1158015610930573d6000803e3d6000fd5b505050505b5050565b80156108525760405163a9059cbb60e01b81526001600160a01b0384169063a9059cbb906107d79085908590600401610de0565b6060600080846001600160a01b03168460405161098a9190610ec9565b600060405180830381855af49150503d80600081146109c5576040519150601f19603f3d011682016040523d82523d6000602084013e6109ca565b606091505b50915091506109da858383610a6f565b95945050505050565b6109eb610acb565b61077b57604051631afcd79f60e31b815260040160405180910390fd5b6000610a1783620f4240101590565b80610a2a5750610a2a82620f4240101590565b83839091610a545760405163768bf0eb60e11b8152600481019290925260248201526044016101ef565b50620f42409050610a658385610ee5565b6108a99190610efc565b606082610a8457610a7f82610ae5565b6108a9565b8151158015610a9b57506001600160a01b0384163b155b15610ac457604051639996b31560e01b81526001600160a01b03851660048201526024016101ef565b5092915050565b6000610ad561074a565b54600160401b900460ff16919050565b805115610af55780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b80356001600160a01b0381168114610b2557600080fd5b919050565b60008060008060008060c08789031215610b4357600080fd5b863560038110610b5257600080fd5b9550610b6060208801610b0e565b945060408701359350610b7560608801610b0e565b925060808701359150610b8a60a08801610b0e565b90509295509295509295565b60008060208385031215610ba957600080fd5b82356001600160401b03811115610bbf57600080fd5b8301601f81018513610bd057600080fd5b80356001600160401b03811115610be657600080fd5b8560208260051b8401011115610bfb57600080fd5b6020919091019590945092505050565b60005b83811015610c26578181015183820152602001610c0e565b50506000910152565b6000602082016020835280845180835260408501915060408160051b86010192506020860160005b82811015610ca357603f1987860301845281518051808752610c80816020890160208501610c0b565b601f01601f19169590950160209081019550938401939190910190600101610c57565b50929695505050505050565b634e487b7160e01b600052601160045260246000fd5b8181038181111561074457610744610caf565b634e487b7160e01b600052604160045260246000fd5b600060a0828403128015610d0157600080fd5b6000905060405160a081018181106001600160401b0382111715610d3357634e487b7160e01b83526041600452602483fd5b6040908152845182526020808601519083015284810151908201526060808501519082015260809384015193810193909352509092915050565b634e487b7160e01b600052602160045260246000fd5b6001600160a01b038481168252831660208201526060810160038310610db957634e487b7160e01b600052602160045260246000fd5b826040830152949350505050565b600060208284031215610dd957600080fd5b5051919050565b6001600160a01b03929092168252602082015260400190565b600060208284031215610e0b57600080fd5b815180151581146108a957600080fd5b6001600160a01b039384168152919092166020820152604081019190915260600190565b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112610e6c57600080fd5b8301803591506001600160401b03821115610e8657600080fd5b602001915036819003821315610e9b57600080fd5b9250929050565b828482376000838201600081528351610ebf818360208801610c0b565b0195945050505050565b60008251610edb818460208701610c0b565b9190910192915050565b808202811582820484141761074457610744610caf565b600082610f1957634e487b7160e01b600052601260045260246000fd5b50049056fea2646970667358221220c7f05052208f6f4047e1223bab7d7f3c4001cbe9b001fbbc3b1069b01cc7eced64736f6c634300081b0033", + "linkReferences": {}, + "deployedLinkReferences": {} +} \ No newline at end of file diff --git a/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/HorizonProxies#GraphProxy.json b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/HorizonProxies#GraphProxy.json new file mode 100644 index 000000000..2cfb21e41 --- /dev/null +++ b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/HorizonProxies#GraphProxy.json @@ -0,0 +1,177 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "GraphProxy", + "sourceName": "contracts/upgrades/GraphProxy.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_impl", + "type": "address" + }, + { + "internalType": "address", + "name": "_admin", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldAdmin", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldImplementation", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "ImplementationUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldPendingImplementation", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newPendingImplementation", + "type": "address" + } + ], + "name": "PendingImplementationUpdated", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "acceptUpgrade", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "acceptUpgradeAndCall", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "pendingImplementation", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newAdmin", + "type": "address" + } + ], + "name": "setAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "bytecode": "0x608060405234801561001057600080fd5b50604051610a12380380610a128339818101604052604081101561003357600080fd5b50805160209091015161004581610055565b61004e826100b3565b5050610137565b600061005f610111565b6000805160206109d2833981519152838155604051919250906001600160a01b0380851691908416907f101b8081ff3b56bbf45deb824d86a3b0fd38b7e3dd42421105cf8abe9106db0b90600090a3505050565b60006100bd610124565b6000805160206109f2833981519152838155604051919250906001600160a01b0380851691908416907f980c0d30fe97457c47903527d88b7009a1643be6de24d2af664214919f0540a190600090a3505050565b6000805160206109d28339815191525490565b6000805160206109f28339815191525490565b61088c806101466000396000f3fe6080604052600436106100745760003560e01c80635c60da1b1161004e5780635c60da1b14610104578063623faf6114610119578063704b6c0214610196578063f851a440146101c957610083565b80633659cfe61461008b578063396f7b23146100be57806359fc20bb146100ef57610083565b36610083576100816101de565b005b6100816101de565b34801561009757600080fd5b50610081600480360360208110156100ae57600080fd5b50356001600160a01b031661029e565b3480156100ca57600080fd5b506100d36102d8565b604080516001600160a01b039092168252519081900360200190f35b3480156100fb57600080fd5b50610081610338565b34801561011057600080fd5b506100d3610393565b34801561012557600080fd5b506100816004803603602081101561013c57600080fd5b81019060208101813564010000000081111561015757600080fd5b82018360208201111561016957600080fd5b8035906020019184600183028401116401000000008311171561018b57600080fd5b5090925090506103e1565b3480156101a257600080fd5b50610081600480360360208110156101b957600080fd5b50356001600160a01b03166104f1565b3480156101d557600080fd5b506100d3610576565b6101e66105c0565b6001600160a01b0316336001600160a01b0316141561024c576040805162461bcd60e51b815260206004820152601f60248201527f43616e6e6f742066616c6c6261636b20746f2070726f78792074617267657400604482015290519081900360640190fd5b6040516001600160a01b037f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc541636600083376000803684845af490503d806000843e81801561029a578184f35b8184fd5b6102a66105c0565b6001600160a01b0316336001600160a01b031614156102cd576102c8816105e5565b6102d5565b6102d56101de565b50565b60006102e26105c0565b6001600160a01b0316336001600160a01b031614806103195750610304610655565b6001600160a01b0316336001600160a01b0316145b1561032d57610326610655565b9050610335565b6103356101de565b90565b6103406105c0565b6001600160a01b0316336001600160a01b031614806103775750610362610655565b6001600160a01b0316336001600160a01b0316145b156103895761038461067a565b610391565b6103916101de565b565b600061039d6105c0565b6001600160a01b0316336001600160a01b031614806103d457506103bf610655565b6001600160a01b0316336001600160a01b0316145b1561032d57610326610751565b6103e96105c0565b6001600160a01b0316336001600160a01b03161480610420575061040b610655565b6001600160a01b0316336001600160a01b0316145b156104e55761042d61067a565b6000610437610751565b6001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d8060008114610491576040519150601f19603f3d011682016040523d82523d6000602084013e610496565b606091505b50509050806104df576040805162461bcd60e51b815260206004820152601060248201526f125b5c1b0818d85b1b0819985a5b195960821b604482015290519081900360640190fd5b506104ed565b6104ed6101de565b5050565b6104f96105c0565b6001600160a01b0316336001600160a01b031614156102cd576001600160a01b03811661056d576040805162461bcd60e51b815260206004820152601e60248201527f41646d696e2063616e7420626520746865207a65726f20616464726573730000604482015290519081900360640190fd5b6102c881610776565b60006105806105c0565b6001600160a01b0316336001600160a01b031614806105b757506105a2610655565b6001600160a01b0316336001600160a01b0316145b1561032d576103265b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b60006105ef610655565b7f9e5eddc59e0b171f57125ab86bee043d9128098c3a6b9adb4f2e86333c2f6f8c838155604051919250906001600160a01b0380851691908416907f980c0d30fe97457c47903527d88b7009a1643be6de24d2af664214919f0540a190600090a3505050565b7f9e5eddc59e0b171f57125ab86bee043d9128098c3a6b9adb4f2e86333c2f6f8c5490565b6000610684610655565b90506001600160a01b0381166106e1576040805162461bcd60e51b815260206004820152601b60248201527f496d706c2063616e6e6f74206265207a65726f20616464726573730000000000604482015290519081900360640190fd5b336001600160a01b0382161461073e576040805162461bcd60e51b815260206004820152601b60248201527f4f6e6c792070656e64696e6720696d706c656d656e746174696f6e0000000000604482015290519081900360640190fd5b610747816107e6565b6102d560006105e5565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b60006107806105c0565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103838155604051919250906001600160a01b0380851691908416907f101b8081ff3b56bbf45deb824d86a3b0fd38b7e3dd42421105cf8abe9106db0b90600090a3505050565b60006107f0610751565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc838155604051919250906001600160a01b0380851691908416907faa3f731066a578e5f39b4215468d826cdd15373cbc0dfc9cb9bdc649718ef7da90600090a350505056fea264697066735822122041ce882775d17ef838c17f08249aa48a5f3ea1c65b581e69896452640b274de264736f6c63430007060033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61039e5eddc59e0b171f57125ab86bee043d9128098c3a6b9adb4f2e86333c2f6f8c", + "deployedBytecode": "0x6080604052600436106100745760003560e01c80635c60da1b1161004e5780635c60da1b14610104578063623faf6114610119578063704b6c0214610196578063f851a440146101c957610083565b80633659cfe61461008b578063396f7b23146100be57806359fc20bb146100ef57610083565b36610083576100816101de565b005b6100816101de565b34801561009757600080fd5b50610081600480360360208110156100ae57600080fd5b50356001600160a01b031661029e565b3480156100ca57600080fd5b506100d36102d8565b604080516001600160a01b039092168252519081900360200190f35b3480156100fb57600080fd5b50610081610338565b34801561011057600080fd5b506100d3610393565b34801561012557600080fd5b506100816004803603602081101561013c57600080fd5b81019060208101813564010000000081111561015757600080fd5b82018360208201111561016957600080fd5b8035906020019184600183028401116401000000008311171561018b57600080fd5b5090925090506103e1565b3480156101a257600080fd5b50610081600480360360208110156101b957600080fd5b50356001600160a01b03166104f1565b3480156101d557600080fd5b506100d3610576565b6101e66105c0565b6001600160a01b0316336001600160a01b0316141561024c576040805162461bcd60e51b815260206004820152601f60248201527f43616e6e6f742066616c6c6261636b20746f2070726f78792074617267657400604482015290519081900360640190fd5b6040516001600160a01b037f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc541636600083376000803684845af490503d806000843e81801561029a578184f35b8184fd5b6102a66105c0565b6001600160a01b0316336001600160a01b031614156102cd576102c8816105e5565b6102d5565b6102d56101de565b50565b60006102e26105c0565b6001600160a01b0316336001600160a01b031614806103195750610304610655565b6001600160a01b0316336001600160a01b0316145b1561032d57610326610655565b9050610335565b6103356101de565b90565b6103406105c0565b6001600160a01b0316336001600160a01b031614806103775750610362610655565b6001600160a01b0316336001600160a01b0316145b156103895761038461067a565b610391565b6103916101de565b565b600061039d6105c0565b6001600160a01b0316336001600160a01b031614806103d457506103bf610655565b6001600160a01b0316336001600160a01b0316145b1561032d57610326610751565b6103e96105c0565b6001600160a01b0316336001600160a01b03161480610420575061040b610655565b6001600160a01b0316336001600160a01b0316145b156104e55761042d61067a565b6000610437610751565b6001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d8060008114610491576040519150601f19603f3d011682016040523d82523d6000602084013e610496565b606091505b50509050806104df576040805162461bcd60e51b815260206004820152601060248201526f125b5c1b0818d85b1b0819985a5b195960821b604482015290519081900360640190fd5b506104ed565b6104ed6101de565b5050565b6104f96105c0565b6001600160a01b0316336001600160a01b031614156102cd576001600160a01b03811661056d576040805162461bcd60e51b815260206004820152601e60248201527f41646d696e2063616e7420626520746865207a65726f20616464726573730000604482015290519081900360640190fd5b6102c881610776565b60006105806105c0565b6001600160a01b0316336001600160a01b031614806105b757506105a2610655565b6001600160a01b0316336001600160a01b0316145b1561032d576103265b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b60006105ef610655565b7f9e5eddc59e0b171f57125ab86bee043d9128098c3a6b9adb4f2e86333c2f6f8c838155604051919250906001600160a01b0380851691908416907f980c0d30fe97457c47903527d88b7009a1643be6de24d2af664214919f0540a190600090a3505050565b7f9e5eddc59e0b171f57125ab86bee043d9128098c3a6b9adb4f2e86333c2f6f8c5490565b6000610684610655565b90506001600160a01b0381166106e1576040805162461bcd60e51b815260206004820152601b60248201527f496d706c2063616e6e6f74206265207a65726f20616464726573730000000000604482015290519081900360640190fd5b336001600160a01b0382161461073e576040805162461bcd60e51b815260206004820152601b60248201527f4f6e6c792070656e64696e6720696d706c656d656e746174696f6e0000000000604482015290519081900360640190fd5b610747816107e6565b6102d560006105e5565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b60006107806105c0565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103838155604051919250906001600160a01b0380851691908416907f101b8081ff3b56bbf45deb824d86a3b0fd38b7e3dd42421105cf8abe9106db0b90600090a3505050565b60006107f0610751565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc838155604051919250906001600160a01b0380851691908416907faa3f731066a578e5f39b4215468d826cdd15373cbc0dfc9cb9bdc649718ef7da90600090a350505056fea264697066735822122041ce882775d17ef838c17f08249aa48a5f3ea1c65b581e69896452640b274de264736f6c63430007060033", + "linkReferences": {}, + "deployedLinkReferences": {} +} \ No newline at end of file diff --git a/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/HorizonProxies#OZProxyDummy_GraphPayments.json b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/HorizonProxies#OZProxyDummy_GraphPayments.json new file mode 100644 index 000000000..8fbd24cbb --- /dev/null +++ b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/HorizonProxies#OZProxyDummy_GraphPayments.json @@ -0,0 +1,10 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "Dummy", + "sourceName": "contracts/mocks/Dummy.sol", + "abi": [], + "bytecode": "0x6080604052348015600f57600080fd5b50603f80601d6000396000f3fe6080604052600080fdfea264697066735822122081eeeeb2e55704976a5bd19451809712b1b76b2d5b7a994dc02b32128a829da764736f6c634300081b0033", + "deployedBytecode": "0x6080604052600080fdfea264697066735822122081eeeeb2e55704976a5bd19451809712b1b76b2d5b7a994dc02b32128a829da764736f6c634300081b0033", + "linkReferences": {}, + "deployedLinkReferences": {} +} \ No newline at end of file diff --git a/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/HorizonProxies#OZProxyDummy_PaymentsEscrow.json b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/HorizonProxies#OZProxyDummy_PaymentsEscrow.json new file mode 100644 index 000000000..8fbd24cbb --- /dev/null +++ b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/HorizonProxies#OZProxyDummy_PaymentsEscrow.json @@ -0,0 +1,10 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "Dummy", + "sourceName": "contracts/mocks/Dummy.sol", + "abi": [], + "bytecode": "0x6080604052348015600f57600080fd5b50603f80601d6000396000f3fe6080604052600080fdfea264697066735822122081eeeeb2e55704976a5bd19451809712b1b76b2d5b7a994dc02b32128a829da764736f6c634300081b0033", + "deployedBytecode": "0x6080604052600080fdfea264697066735822122081eeeeb2e55704976a5bd19451809712b1b76b2d5b7a994dc02b32128a829da764736f6c634300081b0033", + "linkReferences": {}, + "deployedLinkReferences": {} +} \ No newline at end of file diff --git a/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/HorizonProxies#PaymentsEscrow_ProxyWithABI.json b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/HorizonProxies#PaymentsEscrow_ProxyWithABI.json new file mode 100644 index 000000000..c543471bf --- /dev/null +++ b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/HorizonProxies#PaymentsEscrow_ProxyWithABI.json @@ -0,0 +1,680 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "PaymentsEscrow", + "sourceName": "contracts/payments/PaymentsEscrow.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "controller", + "type": "address" + }, + { + "internalType": "uint256", + "name": "withdrawEscrowThawingPeriod", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + } + ], + "name": "AddressEmptyCode", + "type": "error" + }, + { + "inputs": [], + "name": "FailedCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "contractName", + "type": "bytes" + } + ], + "name": "GraphDirectoryInvalidZeroAddress", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidInitialization", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "balanceBefore", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "balanceAfter", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "PaymentsEscrowInconsistentCollection", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minBalance", + "type": "uint256" + } + ], + "name": "PaymentsEscrowInsufficientBalance", + "type": "error" + }, + { + "inputs": [], + "name": "PaymentsEscrowInvalidZeroTokens", + "type": "error" + }, + { + "inputs": [], + "name": "PaymentsEscrowIsPaused", + "type": "error" + }, + { + "inputs": [], + "name": "PaymentsEscrowNotThawing", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "currentTimestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "thawEndTimestamp", + "type": "uint256" + } + ], + "name": "PaymentsEscrowStillThawing", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "thawingPeriod", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxWaitPeriod", + "type": "uint256" + } + ], + "name": "PaymentsEscrowThawingPeriodTooLong", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "collector", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensThawing", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "thawEndTimestamp", + "type": "uint256" + } + ], + "name": "CancelThaw", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "collector", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "Deposit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "paymentType", + "type": "uint8" + }, + { + "indexed": true, + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "collector", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "receiverDestination", + "type": "address" + } + ], + "name": "EscrowCollected", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "graphToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "graphStaking", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphPayments", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphEscrow", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "graphController", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphEpochManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphRewardsManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphTokenGateway", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphProxyAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphCuration", + "type": "address" + } + ], + "name": "GraphDirectoryInitialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "collector", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "thawEndTimestamp", + "type": "uint256" + } + ], + "name": "Thaw", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "collector", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "Withdraw", + "type": "event" + }, + { + "inputs": [], + "name": "MAX_WAIT_PERIOD", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "WITHDRAW_ESCROW_THAWING_PERIOD", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "collector", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + } + ], + "name": "cancelThaw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "paymentType", + "type": "uint8" + }, + { + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "address", + "name": "dataService", + "type": "address" + }, + { + "internalType": "uint256", + "name": "dataServiceCut", + "type": "uint256" + }, + { + "internalType": "address", + "name": "receiverDestination", + "type": "address" + } + ], + "name": "collect", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "collector", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "deposit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "internalType": "address", + "name": "collector", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "depositTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "internalType": "address", + "name": "collector", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + } + ], + "name": "escrowAccounts", + "outputs": [ + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokensThawing", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "thawEndTimestamp", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "internalType": "address", + "name": "collector", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + } + ], + "name": "getBalance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "name": "multicall", + "outputs": [ + { + "internalType": "bytes[]", + "name": "results", + "type": "bytes[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "collector", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "thaw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "collector", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + } + ], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "bytecode": "0x6101e060405234801561001157600080fd5b50604051611bb6380380611bb6833981016040819052610030916104ef565b816001600160a01b03811661007a5760405163218f5add60e11b815260206004820152600a60248201526921b7b73a3937b63632b960b11b60448201526064015b60405180910390fd5b6001600160a01b0381166101005260408051808201909152600a81526923b930b8342a37b5b2b760b11b60208201526100b290610373565b6001600160a01b03166080526040805180820190915260078152665374616b696e6760c81b60208201526100e590610373565b6001600160a01b031660a05260408051808201909152600d81526c47726170685061796d656e747360981b602082015261011e90610373565b6001600160a01b031660c05260408051808201909152600e81526d5061796d656e7473457363726f7760901b602082015261015890610373565b6001600160a01b031660e05260408051808201909152600c81526b22b837b1b426b0b730b3b2b960a11b602082015261019090610373565b6001600160a01b03166101205260408051808201909152600e81526d2932bbb0b93239a6b0b730b3b2b960911b60208201526101cb90610373565b6001600160a01b0316610140526040805180820190915260118152704772617068546f6b656e4761746577617960781b602082015261020990610373565b6001600160a01b03166101605260408051808201909152600f81526e23b930b834283937bc3ca0b236b4b760891b602082015261024590610373565b6001600160a01b03166101805260408051808201909152600881526721bab930ba34b7b760c11b602082015261027a90610373565b6001600160a01b039081166101a08190526101005160a05160805160c05160e05161012051610140516101605161018051604051988b169a9788169996909716977fef5021414834d86e36470f5c1cecf6544fb2bb723f2ca51a4c86fcd8c5919a43976103249790916001600160a01b03978816815295871660208701529386166040860152918516606085015284166080840152831660a083015290911660c082015260e00190565b60405180910390a450806276a7008082111561035c57604051635c0f65a160e01b815260048101929092526024820152604401610071565b50506101c081905261036c610421565b505061058b565b600080610100516001600160a01b031663f7641a5e84805190602001206040518263ffffffff1660e01b81526004016103ae91815260200190565b602060405180830381865afa1580156103cb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103ef919061051b565b9050826001600160a01b03821661041a5760405163218f5add60e11b8152600401610071919061053d565b5092915050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff16156104715760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b03908116146104d05780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b80516001600160a01b03811681146104ea57600080fd5b919050565b6000806040838503121561050257600080fd5b61050b836104d3565b9150602083015190509250929050565b60006020828403121561052d57600080fd5b610536826104d3565b9392505050565b602081526000825180602084015260005b8181101561056b576020818601810151604086840101520161054e565b506000604082850101526040601f19601f83011684010191505092915050565b60805160a05160c05160e05161010051610120516101405161016051610180516101a0516101c0516115b3610603600039600081816101350152610b4e015260005050600050506000505060005050600050506000610d910152600050506000610dd90152600050506000610db501526115b36000f3fe608060405234801561001057600080fd5b50600436106100a45760003560e01c80631230fa3e146100a957806372eb521e146100be5780637a8df28b146100d15780637b8ae6cf146101305780638129fc1c146101655780638340f5491461016d578063ac9650d814610180578063b1d07de4146101a0578063b2168b6b146101b3578063d6bd603c146101bd578063f93f1cd0146101d0578063f940e385146101e3575b600080fd5b6100bc6100b736600461111c565b6101f6565b005b6100bc6100cc36600461119a565b61058c565b6101106100df3660046111e5565b6000602081815293815260408082208552928152828120909352825290208054600182015460029092015490919083565b604080519384526020840192909252908201526060015b60405180910390f35b6101577f000000000000000000000000000000000000000000000000000000000000000081565b604051908152602001610127565b6100bc610625565b6100bc61017b366004611228565b61071d565b61019361018e366004611265565b6107b5565b60405161012791906112fe565b6100bc6101ae36600461137e565b61089d565b6101576276a70081565b6101576101cb3660046111e5565b6109e0565b6100bc6101de366004611228565b610a3e565b6100bc6101f136600461137e565b610bd1565b6101fe610d8f565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561023b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061025f91906113b1565b1561027d57604051639e68cf0b60e01b815260040160405180910390fd5b6001600160a01b038087166000908152602081815260408083203384528252808320938916835292905220805485808210156102da57604051633db4e69160e01b8152600481019290925260248201526044015b60405180910390fd5b5050848160000160008282546102f091906113e9565b9091555060009050610300610db3565b6001600160a01b03166370a08231306040518263ffffffff1660e01b815260040161032b91906113fc565b602060405180830381865afa158015610348573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061036c9190611410565b9050610376610db3565b6001600160a01b031663095ea7b361038c610dd7565b886040518363ffffffff1660e01b81526004016103aa929190611429565b6020604051808303816000875af11580156103c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103ed91906113b1565b506103f6610dd7565b6001600160a01b03166381cd11a08a89898989896040518763ffffffff1660e01b815260040161042b96959493929190611458565b600060405180830381600087803b15801561044557600080fd5b505af1158015610459573d6000803e3d6000fd5b505050506000610467610db3565b6001600160a01b03166370a08231306040518263ffffffff1660e01b815260040161049291906113fc565b602060405180830381865afa1580156104af573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104d39190611410565b90506104df81886114ae565b821482828990919261051557604051631f82726b60e21b81526004810193909352602483019190915260448201526064016102d1565b50339150506001600160a01b038a168b600281111561053657610536611442565b604080516001600160a01b038d81168252602082018d905289168183015290517f399b99b484be516eace7ececa486139581a25b0d2d12dac8bfa0948d07a8c9139181900360600190a450505050505050505050565b610594610d8f565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156105d1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105f591906113b1565b1561061357604051639e68cf0b60e01b815260040160405180910390fd5b61061f84848484610dfb565b50505050565b600061062f610eac565b805490915060ff600160401b82041615906001600160401b03166000811580156106565750825b90506000826001600160401b031660011480156106725750303b155b905081158015610680575080155b1561069e5760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff1916600117855583156106c857845460ff60401b1916600160401b1785555b6106d0610ed5565b831561071657845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b5050505050565b610725610d8f565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610762573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061078691906113b1565b156107a457604051639e68cf0b60e01b815260040160405180910390fd5b6107b033848484610dfb565b505050565b604080516000815260208101909152606090826001600160401b038111156107df576107df6114c1565b60405190808252806020026020018201604052801561081257816020015b60608152602001906001900390816107fd5790505b50915060005b838110156108945761086f30868684818110610836576108366114d7565b905060200281019061084891906114ed565b8560405160200161085b9392919061153a565b604051602081830303815290604052610edf565b838281518110610881576108816114d7565b6020908102919091010152600101610818565b50505b92915050565b6108a5610d8f565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108e2573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061090691906113b1565b1561092457604051639e68cf0b60e01b815260040160405180910390fd5b336000908152602081815260408083206001600160a01b03868116855290835281842090851684529091528120600181015490910361097657604051638cbd172f60e01b815260040160405180910390fd5b60018101805460028301805460009384905592905560408051828152602081018490529192916001600160a01b03868116929088169133917f6c4ed34e7347a8682024ee40d393e45f4075c46c593aaaed3cc3e49dd6933535910160405180910390a45050505050565b6001600160a01b038084166000908152602081815260408083208685168452825280832093851683529290529081206001810154815411610a22576000610a33565b60018101548154610a3391906113e9565b9150505b9392505050565b610a46610d8f565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a83573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aa791906113b1565b15610ac557604051639e68cf0b60e01b815260040160405180910390fd5b60008111610ae657604051633aff1f3760e21b815260040160405180910390fd5b336000908152602081815260408083206001600160a01b0387811685529083528184209086168452909152902080548280821015610b4057604051633db4e69160e01b8152600481019290925260248201526044016102d1565b505060018101829055610b737f0000000000000000000000000000000000000000000000000000000000000000426114ae565b600282018190556040516001600160a01b03808616929087169133917fba109e8a47e57c895aa1802554cd51025499c2b07c3c9b467c70413a4434ffbc91610bc391888252602082015260400190565b60405180910390a450505050565b610bd9610d8f565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c3a91906113b1565b15610c5857604051639e68cf0b60e01b815260040160405180910390fd5b336000908152602081815260408083206001600160a01b038681168552908352818420908516845290915281206002810154909103610caa57604051638cbd172f60e01b815260040160405180910390fd5b60028101544290818110610cda57604051633c50db7960e11b8152600481019290925260248201526044016102d1565b505060008160000154826001015411610cf7578160010154610cfa565b81545b905080826000016000828254610d1091906113e9565b90915550506000600183018190556002830155610d403382610d30610db3565b6001600160a01b03169190610f55565b826001600160a01b0316846001600160a01b0316336001600160a01b03167f3115d1449a7b732c986cba18244e897a450f61e1bb8d589cd2e69e6c8924f9f784604051610bc391815260200190565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b6001600160a01b038085166000908152602081815260408083208785168452825280832093861683529290529081208054839290610e3a9084906114ae565b90915550610e5d90503382610e4d610db3565b6001600160a01b03169190611004565b816001600160a01b0316836001600160a01b0316856001600160a01b03167f7cfff908a4b583f36430b25d75964c458d8ede8a99bd61be750e97ee1b2f3a9684604051610bc391815260200190565b6000807ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00610897565b610edd611045565b565b6060600080846001600160a01b031684604051610efc9190611561565b600060405180830381855af49150503d8060008114610f37576040519150601f19603f3d011682016040523d82523d6000602084013e610f3c565b606091505b5091509150610f4c85838361106a565b95945050505050565b80156107b05760405163a9059cbb60e01b81526001600160a01b0384169063a9059cbb90610f899085908590600401611429565b6020604051808303816000875af1158015610fa8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fcc91906113b1565b6107b05760405162461bcd60e51b815260206004820152600960248201526810ba3930b739b332b960b91b60448201526064016102d1565b80156107b0576040516323b872dd60e01b81526001600160a01b038381166004830152306024830152604482018390528416906323b872dd90606401610f89565b61104d6110bd565b610edd57604051631afcd79f60e31b815260040160405180910390fd5b60608261107f5761107a826110d7565b610a37565b815115801561109657506001600160a01b0384163b155b156110b65783604051639996b31560e01b81526004016102d191906113fc565b5080610a37565b60006110c7610eac565b54600160401b900460ff16919050565b8051156110e75780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b80356001600160a01b038116811461111757600080fd5b919050565b600080600080600080600060e0888a03121561113757600080fd5b87356003811061114657600080fd5b965061115460208901611100565b955061116260408901611100565b94506060880135935061117760808901611100565b925060a0880135915061118c60c08901611100565b905092959891949750929550565b600080600080608085870312156111b057600080fd5b6111b985611100565b93506111c760208601611100565b92506111d560408601611100565b9396929550929360600135925050565b6000806000606084860312156111fa57600080fd5b61120384611100565b925061121160208501611100565b915061121f60408501611100565b90509250925092565b60008060006060848603121561123d57600080fd5b61124684611100565b925061125460208501611100565b929592945050506040919091013590565b6000806020838503121561127857600080fd5b82356001600160401b0381111561128e57600080fd5b8301601f8101851361129f57600080fd5b80356001600160401b038111156112b557600080fd5b8560208260051b84010111156112ca57600080fd5b6020919091019590945092505050565b60005b838110156112f55781810151838201526020016112dd565b50506000910152565b6000602082016020835280845180835260408501915060408160051b86010192506020860160005b8281101561137257603f198786030184528151805180875261134f8160208901602085016112da565b601f01601f19169590950160209081019550938401939190910190600101611326565b50929695505050505050565b6000806040838503121561139157600080fd5b61139a83611100565b91506113a860208401611100565b90509250929050565b6000602082840312156113c357600080fd5b81518015158114610a3757600080fd5b634e487b7160e01b600052601160045260246000fd5b81810381811115610897576108976113d3565b6001600160a01b0391909116815260200190565b60006020828403121561142257600080fd5b5051919050565b6001600160a01b03929092168252602082015260400190565b634e487b7160e01b600052602160045260246000fd5b60c081016003881061147a57634e487b7160e01b600052602160045260246000fd5b9681526001600160a01b03958616602082015260408101949094529184166060840152608083015290911660a09091015290565b80820180821115610897576108976113d3565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261150457600080fd5b8301803591506001600160401b0382111561151e57600080fd5b60200191503681900382131561153357600080fd5b9250929050565b8284823760008382016000815283516115578183602088016112da565b0195945050505050565b600082516115738184602087016112da565b919091019291505056fea26469706673582212208ab10e801fa2cc0d10964181f12d884e2488e415d888ab908ab3d257d0bef82f64736f6c634300081b0033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100a45760003560e01c80631230fa3e146100a957806372eb521e146100be5780637a8df28b146100d15780637b8ae6cf146101305780638129fc1c146101655780638340f5491461016d578063ac9650d814610180578063b1d07de4146101a0578063b2168b6b146101b3578063d6bd603c146101bd578063f93f1cd0146101d0578063f940e385146101e3575b600080fd5b6100bc6100b736600461111c565b6101f6565b005b6100bc6100cc36600461119a565b61058c565b6101106100df3660046111e5565b6000602081815293815260408082208552928152828120909352825290208054600182015460029092015490919083565b604080519384526020840192909252908201526060015b60405180910390f35b6101577f000000000000000000000000000000000000000000000000000000000000000081565b604051908152602001610127565b6100bc610625565b6100bc61017b366004611228565b61071d565b61019361018e366004611265565b6107b5565b60405161012791906112fe565b6100bc6101ae36600461137e565b61089d565b6101576276a70081565b6101576101cb3660046111e5565b6109e0565b6100bc6101de366004611228565b610a3e565b6100bc6101f136600461137e565b610bd1565b6101fe610d8f565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561023b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061025f91906113b1565b1561027d57604051639e68cf0b60e01b815260040160405180910390fd5b6001600160a01b038087166000908152602081815260408083203384528252808320938916835292905220805485808210156102da57604051633db4e69160e01b8152600481019290925260248201526044015b60405180910390fd5b5050848160000160008282546102f091906113e9565b9091555060009050610300610db3565b6001600160a01b03166370a08231306040518263ffffffff1660e01b815260040161032b91906113fc565b602060405180830381865afa158015610348573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061036c9190611410565b9050610376610db3565b6001600160a01b031663095ea7b361038c610dd7565b886040518363ffffffff1660e01b81526004016103aa929190611429565b6020604051808303816000875af11580156103c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103ed91906113b1565b506103f6610dd7565b6001600160a01b03166381cd11a08a89898989896040518763ffffffff1660e01b815260040161042b96959493929190611458565b600060405180830381600087803b15801561044557600080fd5b505af1158015610459573d6000803e3d6000fd5b505050506000610467610db3565b6001600160a01b03166370a08231306040518263ffffffff1660e01b815260040161049291906113fc565b602060405180830381865afa1580156104af573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104d39190611410565b90506104df81886114ae565b821482828990919261051557604051631f82726b60e21b81526004810193909352602483019190915260448201526064016102d1565b50339150506001600160a01b038a168b600281111561053657610536611442565b604080516001600160a01b038d81168252602082018d905289168183015290517f399b99b484be516eace7ececa486139581a25b0d2d12dac8bfa0948d07a8c9139181900360600190a450505050505050505050565b610594610d8f565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156105d1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105f591906113b1565b1561061357604051639e68cf0b60e01b815260040160405180910390fd5b61061f84848484610dfb565b50505050565b600061062f610eac565b805490915060ff600160401b82041615906001600160401b03166000811580156106565750825b90506000826001600160401b031660011480156106725750303b155b905081158015610680575080155b1561069e5760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff1916600117855583156106c857845460ff60401b1916600160401b1785555b6106d0610ed5565b831561071657845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b5050505050565b610725610d8f565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610762573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061078691906113b1565b156107a457604051639e68cf0b60e01b815260040160405180910390fd5b6107b033848484610dfb565b505050565b604080516000815260208101909152606090826001600160401b038111156107df576107df6114c1565b60405190808252806020026020018201604052801561081257816020015b60608152602001906001900390816107fd5790505b50915060005b838110156108945761086f30868684818110610836576108366114d7565b905060200281019061084891906114ed565b8560405160200161085b9392919061153a565b604051602081830303815290604052610edf565b838281518110610881576108816114d7565b6020908102919091010152600101610818565b50505b92915050565b6108a5610d8f565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108e2573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061090691906113b1565b1561092457604051639e68cf0b60e01b815260040160405180910390fd5b336000908152602081815260408083206001600160a01b03868116855290835281842090851684529091528120600181015490910361097657604051638cbd172f60e01b815260040160405180910390fd5b60018101805460028301805460009384905592905560408051828152602081018490529192916001600160a01b03868116929088169133917f6c4ed34e7347a8682024ee40d393e45f4075c46c593aaaed3cc3e49dd6933535910160405180910390a45050505050565b6001600160a01b038084166000908152602081815260408083208685168452825280832093851683529290529081206001810154815411610a22576000610a33565b60018101548154610a3391906113e9565b9150505b9392505050565b610a46610d8f565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a83573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aa791906113b1565b15610ac557604051639e68cf0b60e01b815260040160405180910390fd5b60008111610ae657604051633aff1f3760e21b815260040160405180910390fd5b336000908152602081815260408083206001600160a01b0387811685529083528184209086168452909152902080548280821015610b4057604051633db4e69160e01b8152600481019290925260248201526044016102d1565b505060018101829055610b737f0000000000000000000000000000000000000000000000000000000000000000426114ae565b600282018190556040516001600160a01b03808616929087169133917fba109e8a47e57c895aa1802554cd51025499c2b07c3c9b467c70413a4434ffbc91610bc391888252602082015260400190565b60405180910390a450505050565b610bd9610d8f565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c3a91906113b1565b15610c5857604051639e68cf0b60e01b815260040160405180910390fd5b336000908152602081815260408083206001600160a01b038681168552908352818420908516845290915281206002810154909103610caa57604051638cbd172f60e01b815260040160405180910390fd5b60028101544290818110610cda57604051633c50db7960e11b8152600481019290925260248201526044016102d1565b505060008160000154826001015411610cf7578160010154610cfa565b81545b905080826000016000828254610d1091906113e9565b90915550506000600183018190556002830155610d403382610d30610db3565b6001600160a01b03169190610f55565b826001600160a01b0316846001600160a01b0316336001600160a01b03167f3115d1449a7b732c986cba18244e897a450f61e1bb8d589cd2e69e6c8924f9f784604051610bc391815260200190565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b6001600160a01b038085166000908152602081815260408083208785168452825280832093861683529290529081208054839290610e3a9084906114ae565b90915550610e5d90503382610e4d610db3565b6001600160a01b03169190611004565b816001600160a01b0316836001600160a01b0316856001600160a01b03167f7cfff908a4b583f36430b25d75964c458d8ede8a99bd61be750e97ee1b2f3a9684604051610bc391815260200190565b6000807ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00610897565b610edd611045565b565b6060600080846001600160a01b031684604051610efc9190611561565b600060405180830381855af49150503d8060008114610f37576040519150601f19603f3d011682016040523d82523d6000602084013e610f3c565b606091505b5091509150610f4c85838361106a565b95945050505050565b80156107b05760405163a9059cbb60e01b81526001600160a01b0384169063a9059cbb90610f899085908590600401611429565b6020604051808303816000875af1158015610fa8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fcc91906113b1565b6107b05760405162461bcd60e51b815260206004820152600960248201526810ba3930b739b332b960b91b60448201526064016102d1565b80156107b0576040516323b872dd60e01b81526001600160a01b038381166004830152306024830152604482018390528416906323b872dd90606401610f89565b61104d6110bd565b610edd57604051631afcd79f60e31b815260040160405180910390fd5b60608261107f5761107a826110d7565b610a37565b815115801561109657506001600160a01b0384163b155b156110b65783604051639996b31560e01b81526004016102d191906113fc565b5080610a37565b60006110c7610eac565b54600160401b900460ff16919050565b8051156110e75780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b80356001600160a01b038116811461111757600080fd5b919050565b600080600080600080600060e0888a03121561113757600080fd5b87356003811061114657600080fd5b965061115460208901611100565b955061116260408901611100565b94506060880135935061117760808901611100565b925060a0880135915061118c60c08901611100565b905092959891949750929550565b600080600080608085870312156111b057600080fd5b6111b985611100565b93506111c760208601611100565b92506111d560408601611100565b9396929550929360600135925050565b6000806000606084860312156111fa57600080fd5b61120384611100565b925061121160208501611100565b915061121f60408501611100565b90509250925092565b60008060006060848603121561123d57600080fd5b61124684611100565b925061125460208501611100565b929592945050506040919091013590565b6000806020838503121561127857600080fd5b82356001600160401b0381111561128e57600080fd5b8301601f8101851361129f57600080fd5b80356001600160401b038111156112b557600080fd5b8560208260051b84010111156112ca57600080fd5b6020919091019590945092505050565b60005b838110156112f55781810151838201526020016112dd565b50506000910152565b6000602082016020835280845180835260408501915060408160051b86010192506020860160005b8281101561137257603f198786030184528151805180875261134f8160208901602085016112da565b601f01601f19169590950160209081019550938401939190910190600101611326565b50929695505050505050565b6000806040838503121561139157600080fd5b61139a83611100565b91506113a860208401611100565b90509250929050565b6000602082840312156113c357600080fd5b81518015158114610a3757600080fd5b634e487b7160e01b600052601160045260246000fd5b81810381811115610897576108976113d3565b6001600160a01b0391909116815260200190565b60006020828403121561142257600080fd5b5051919050565b6001600160a01b03929092168252602082015260400190565b634e487b7160e01b600052602160045260246000fd5b60c081016003881061147a57634e487b7160e01b600052602160045260246000fd5b9681526001600160a01b03958616602082015260408101949094529184166060840152608083015290911660a09091015290565b80820180821115610897576108976113d3565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261150457600080fd5b8301803591506001600160401b0382111561151e57600080fd5b60200191503681900382131561153357600080fd5b9250929050565b8284823760008382016000815283516115578183602088016112da565b0195945050505050565b600082516115738184602087016112da565b919091019291505056fea26469706673582212208ab10e801fa2cc0d10964181f12d884e2488e415d888ab908ab3d257d0bef82f64736f6c634300081b0033", + "linkReferences": {}, + "deployedLinkReferences": {} +} \ No newline at end of file diff --git a/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/HorizonProxies#ProxyAdmin_GraphPayments.json b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/HorizonProxies#ProxyAdmin_GraphPayments.json new file mode 100644 index 000000000..2e9762744 --- /dev/null +++ b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/HorizonProxies#ProxyAdmin_GraphPayments.json @@ -0,0 +1,132 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "ProxyAdmin", + "sourceName": "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "initialOwner", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "OwnableInvalidOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "OwnableUnauthorizedAccount", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "inputs": [], + "name": "UPGRADE_INTERFACE_VERSION", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ITransparentUpgradeableProxy", + "name": "proxy", + "type": "address" + }, + { + "internalType": "address", + "name": "implementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ], + "bytecode": "0x608060405234801561001057600080fd5b5060405161055338038061055383398101604081905261002f916100be565b806001600160a01b03811661005e57604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b6100678161006e565b50506100ee565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000602082840312156100d057600080fd5b81516001600160a01b03811681146100e757600080fd5b9392505050565b610456806100fd6000396000f3fe60806040526004361061004a5760003560e01c8063715018a61461004f5780638da5cb5b146100665780639623609d14610091578063ad3cb1cc146100a4578063f2fde38b146100e2575b600080fd5b34801561005b57600080fd5b50610064610102565b005b34801561007257600080fd5b5061007b610116565b604051610088919061025d565b60405180910390f35b61006461009f36600461029c565b610125565b3480156100b057600080fd5b506100d5604051806040016040528060058152602001640352e302e360dc1b81525081565b60405161008891906103bd565b3480156100ee57600080fd5b506100646100fd3660046103d7565b610194565b61010a6101db565b610114600061020d565b565b6000546001600160a01b031690565b61012d6101db565b60405163278f794360e11b81526001600160a01b03841690634f1ef28690349061015d90869086906004016103f4565b6000604051808303818588803b15801561017657600080fd5b505af115801561018a573d6000803e3d6000fd5b5050505050505050565b61019c6101db565b6001600160a01b0381166101cf576000604051631e4fbdf760e01b81526004016101c6919061025d565b60405180910390fd5b6101d88161020d565b50565b336101e4610116565b6001600160a01b031614610114573360405163118cdaa760e01b81526004016101c6919061025d565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b0391909116815260200190565b6001600160a01b03811681146101d857600080fd5b634e487b7160e01b600052604160045260246000fd5b6000806000606084860312156102b157600080fd5b83356102bc81610271565b925060208401356102cc81610271565b915060408401356001600160401b038111156102e757600080fd5b8401601f810186136102f857600080fd5b80356001600160401b0381111561031157610311610286565b604051601f8201601f19908116603f011681016001600160401b038111828210171561033f5761033f610286565b60405281815282820160200188101561035757600080fd5b816020840160208301376000602083830101528093505050509250925092565b6000815180845260005b8181101561039d57602081850181015186830182015201610381565b506000602082860101526020601f19601f83011685010191505092915050565b6020815260006103d06020830184610377565b9392505050565b6000602082840312156103e957600080fd5b81356103d081610271565b6001600160a01b038316815260406020820181905260009061041890830184610377565b94935050505056fea2646970667358221220e77af71a19651e50da550702ce9a5b1b89dda100ca5f41a9c778b943df55af8064736f6c634300081b0033", + "deployedBytecode": "0x60806040526004361061004a5760003560e01c8063715018a61461004f5780638da5cb5b146100665780639623609d14610091578063ad3cb1cc146100a4578063f2fde38b146100e2575b600080fd5b34801561005b57600080fd5b50610064610102565b005b34801561007257600080fd5b5061007b610116565b604051610088919061025d565b60405180910390f35b61006461009f36600461029c565b610125565b3480156100b057600080fd5b506100d5604051806040016040528060058152602001640352e302e360dc1b81525081565b60405161008891906103bd565b3480156100ee57600080fd5b506100646100fd3660046103d7565b610194565b61010a6101db565b610114600061020d565b565b6000546001600160a01b031690565b61012d6101db565b60405163278f794360e11b81526001600160a01b03841690634f1ef28690349061015d90869086906004016103f4565b6000604051808303818588803b15801561017657600080fd5b505af115801561018a573d6000803e3d6000fd5b5050505050505050565b61019c6101db565b6001600160a01b0381166101cf576000604051631e4fbdf760e01b81526004016101c6919061025d565b60405180910390fd5b6101d88161020d565b50565b336101e4610116565b6001600160a01b031614610114573360405163118cdaa760e01b81526004016101c6919061025d565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b0391909116815260200190565b6001600160a01b03811681146101d857600080fd5b634e487b7160e01b600052604160045260246000fd5b6000806000606084860312156102b157600080fd5b83356102bc81610271565b925060208401356102cc81610271565b915060408401356001600160401b038111156102e757600080fd5b8401601f810186136102f857600080fd5b80356001600160401b0381111561031157610311610286565b604051601f8201601f19908116603f011681016001600160401b038111828210171561033f5761033f610286565b60405281815282820160200188101561035757600080fd5b816020840160208301376000602083830101528093505050509250925092565b6000815180845260005b8181101561039d57602081850181015186830182015201610381565b506000602082860101526020601f19601f83011685010191505092915050565b6020815260006103d06020830184610377565b9392505050565b6000602082840312156103e957600080fd5b81356103d081610271565b6001600160a01b038316815260406020820181905260009061041890830184610377565b94935050505056fea2646970667358221220e77af71a19651e50da550702ce9a5b1b89dda100ca5f41a9c778b943df55af8064736f6c634300081b0033", + "linkReferences": {}, + "deployedLinkReferences": {} +} \ No newline at end of file diff --git a/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/HorizonProxies#ProxyAdmin_PaymentsEscrow.json b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/HorizonProxies#ProxyAdmin_PaymentsEscrow.json new file mode 100644 index 000000000..2e9762744 --- /dev/null +++ b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/HorizonProxies#ProxyAdmin_PaymentsEscrow.json @@ -0,0 +1,132 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "ProxyAdmin", + "sourceName": "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "initialOwner", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "OwnableInvalidOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "OwnableUnauthorizedAccount", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "inputs": [], + "name": "UPGRADE_INTERFACE_VERSION", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ITransparentUpgradeableProxy", + "name": "proxy", + "type": "address" + }, + { + "internalType": "address", + "name": "implementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ], + "bytecode": "0x608060405234801561001057600080fd5b5060405161055338038061055383398101604081905261002f916100be565b806001600160a01b03811661005e57604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b6100678161006e565b50506100ee565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000602082840312156100d057600080fd5b81516001600160a01b03811681146100e757600080fd5b9392505050565b610456806100fd6000396000f3fe60806040526004361061004a5760003560e01c8063715018a61461004f5780638da5cb5b146100665780639623609d14610091578063ad3cb1cc146100a4578063f2fde38b146100e2575b600080fd5b34801561005b57600080fd5b50610064610102565b005b34801561007257600080fd5b5061007b610116565b604051610088919061025d565b60405180910390f35b61006461009f36600461029c565b610125565b3480156100b057600080fd5b506100d5604051806040016040528060058152602001640352e302e360dc1b81525081565b60405161008891906103bd565b3480156100ee57600080fd5b506100646100fd3660046103d7565b610194565b61010a6101db565b610114600061020d565b565b6000546001600160a01b031690565b61012d6101db565b60405163278f794360e11b81526001600160a01b03841690634f1ef28690349061015d90869086906004016103f4565b6000604051808303818588803b15801561017657600080fd5b505af115801561018a573d6000803e3d6000fd5b5050505050505050565b61019c6101db565b6001600160a01b0381166101cf576000604051631e4fbdf760e01b81526004016101c6919061025d565b60405180910390fd5b6101d88161020d565b50565b336101e4610116565b6001600160a01b031614610114573360405163118cdaa760e01b81526004016101c6919061025d565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b0391909116815260200190565b6001600160a01b03811681146101d857600080fd5b634e487b7160e01b600052604160045260246000fd5b6000806000606084860312156102b157600080fd5b83356102bc81610271565b925060208401356102cc81610271565b915060408401356001600160401b038111156102e757600080fd5b8401601f810186136102f857600080fd5b80356001600160401b0381111561031157610311610286565b604051601f8201601f19908116603f011681016001600160401b038111828210171561033f5761033f610286565b60405281815282820160200188101561035757600080fd5b816020840160208301376000602083830101528093505050509250925092565b6000815180845260005b8181101561039d57602081850181015186830182015201610381565b506000602082860101526020601f19601f83011685010191505092915050565b6020815260006103d06020830184610377565b9392505050565b6000602082840312156103e957600080fd5b81356103d081610271565b6001600160a01b038316815260406020820181905260009061041890830184610377565b94935050505056fea2646970667358221220e77af71a19651e50da550702ce9a5b1b89dda100ca5f41a9c778b943df55af8064736f6c634300081b0033", + "deployedBytecode": "0x60806040526004361061004a5760003560e01c8063715018a61461004f5780638da5cb5b146100665780639623609d14610091578063ad3cb1cc146100a4578063f2fde38b146100e2575b600080fd5b34801561005b57600080fd5b50610064610102565b005b34801561007257600080fd5b5061007b610116565b604051610088919061025d565b60405180910390f35b61006461009f36600461029c565b610125565b3480156100b057600080fd5b506100d5604051806040016040528060058152602001640352e302e360dc1b81525081565b60405161008891906103bd565b3480156100ee57600080fd5b506100646100fd3660046103d7565b610194565b61010a6101db565b610114600061020d565b565b6000546001600160a01b031690565b61012d6101db565b60405163278f794360e11b81526001600160a01b03841690634f1ef28690349061015d90869086906004016103f4565b6000604051808303818588803b15801561017657600080fd5b505af115801561018a573d6000803e3d6000fd5b5050505050505050565b61019c6101db565b6001600160a01b0381166101cf576000604051631e4fbdf760e01b81526004016101c6919061025d565b60405180910390fd5b6101d88161020d565b50565b336101e4610116565b6001600160a01b031614610114573360405163118cdaa760e01b81526004016101c6919061025d565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b0391909116815260200190565b6001600160a01b03811681146101d857600080fd5b634e487b7160e01b600052604160045260246000fd5b6000806000606084860312156102b157600080fd5b83356102bc81610271565b925060208401356102cc81610271565b915060408401356001600160401b038111156102e757600080fd5b8401601f810186136102f857600080fd5b80356001600160401b0381111561031157610311610286565b604051601f8201601f19908116603f011681016001600160401b038111828210171561033f5761033f610286565b60405281815282820160200188101561035757600080fd5b816020840160208301376000602083830101528093505050509250925092565b6000815180845260005b8181101561039d57602081850181015186830182015201610381565b506000602082860101526020601f19601f83011685010191505092915050565b6020815260006103d06020830184610377565b9392505050565b6000602082840312156103e957600080fd5b81356103d081610271565b6001600160a01b038316815260406020820181905260009061041890830184610377565b94935050505056fea2646970667358221220e77af71a19651e50da550702ce9a5b1b89dda100ca5f41a9c778b943df55af8064736f6c634300081b0033", + "linkReferences": {}, + "deployedLinkReferences": {} +} \ No newline at end of file diff --git a/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/HorizonProxies#TransparentUpgradeableProxy_GraphPayments.json b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/HorizonProxies#TransparentUpgradeableProxy_GraphPayments.json new file mode 100644 index 000000000..700f93578 --- /dev/null +++ b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/HorizonProxies#TransparentUpgradeableProxy_GraphPayments.json @@ -0,0 +1,116 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "TransparentUpgradeableProxy", + "sourceName": "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "initialOwner", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + } + ], + "name": "AddressEmptyCode", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "admin", + "type": "address" + } + ], + "name": "ERC1967InvalidAdmin", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "ERC1967InvalidImplementation", + "type": "error" + }, + { + "inputs": [], + "name": "ERC1967NonPayable", + "type": "error" + }, + { + "inputs": [], + "name": "FailedCall", + "type": "error" + }, + { + "inputs": [], + "name": "ProxyDeniedAdminAccess", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + } + ], + "bytecode": "0x60a0604052604051610eae380380610eae8339810160408190526100229161039d565b828161002e828261008f565b50508160405161003d9061033a565b6001600160a01b039091168152602001604051809103906000f080158015610069573d6000803e3d6000fd5b506001600160a01b031660805261008761008260805190565b6100ee565b50505061048f565b6100988261015c565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a28051156100e2576100dd82826101db565b505050565b6100ea610252565b5050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61012e600080516020610e8e833981519152546001600160a01b031690565b604080516001600160a01b03928316815291841660208301520160405180910390a161015981610273565b50565b806001600160a01b03163b60000361019757604051634c9c8ce360e01b81526001600160a01b03821660048201526024015b60405180910390fd5b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5b80546001600160a01b0319166001600160a01b039290921691909117905550565b6060600080846001600160a01b0316846040516101f89190610473565b600060405180830381855af49150503d8060008114610233576040519150601f19603f3d011682016040523d82523d6000602084013e610238565b606091505b5090925090506102498583836102b2565b95945050505050565b34156102715760405163b398979f60e01b815260040160405180910390fd5b565b6001600160a01b03811661029d57604051633173bdd160e11b81526000600482015260240161018e565b80600080516020610e8e8339815191526101ba565b6060826102c7576102c282610311565b61030a565b81511580156102de57506001600160a01b0384163b155b1561030757604051639996b31560e01b81526001600160a01b038516600482015260240161018e565b50805b9392505050565b8051156103215780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b6105538061093b83390190565b80516001600160a01b038116811461035e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561039457818101518382015260200161037c565b50506000910152565b6000806000606084860312156103b257600080fd5b6103bb84610347565b92506103c960208501610347565b60408501519092506001600160401b038111156103e557600080fd5b8401601f810186136103f657600080fd5b80516001600160401b0381111561040f5761040f610363565b604051601f8201601f19908116603f011681016001600160401b038111828210171561043d5761043d610363565b60405281815282820160200188101561045557600080fd5b610466826020830160208601610379565b8093505050509250925092565b60008251610485818460208701610379565b9190910192915050565b6080516104926104a96000396000601001526104926000f3fe608060405261000c61000e565b005b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316330361007b576000356001600160e01b03191663278f794360e11b14610071576040516334ad5dbb60e21b815260040160405180910390fd5b610079610083565b565b6100796100b2565b6000806100933660048184610304565b8101906100a09190610344565b915091506100ae82826100c2565b5050565b6100796100bd61011d565b610155565b6100cb82610179565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a28051156101155761011082826101f0565b505050565b6100ae610266565b60006101507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b3660008037600080366000845af43d6000803e808015610174573d6000f35b3d6000fd5b806001600160a01b03163b6000036101af5780604051634c9c8ce360e01b81526004016101a69190610419565b60405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080846001600160a01b03168460405161020d919061042d565b600060405180830381855af49150503d8060008114610248576040519150601f19603f3d011682016040523d82523d6000602084013e61024d565b606091505b509150915061025d858383610285565b95945050505050565b34156100795760405163b398979f60e01b815260040160405180910390fd5b60608261029a57610295826102db565b6102d4565b81511580156102b157506001600160a01b0384163b155b156102d15783604051639996b31560e01b81526004016101a69190610419565b50805b9392505050565b8051156102eb5780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b6000808585111561031457600080fd5b8386111561032157600080fd5b5050820193919092039150565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561035757600080fd5b82356001600160a01b038116811461036e57600080fd5b915060208301356001600160401b0381111561038957600080fd5b8301601f8101851361039a57600080fd5b80356001600160401b038111156103b3576103b361032e565b604051601f8201601f19908116603f011681016001600160401b03811182821017156103e1576103e161032e565b6040528181528282016020018710156103f957600080fd5b816020840160208301376000602083830101528093505050509250929050565b6001600160a01b0391909116815260200190565b6000825160005b8181101561044e5760208186018101518583015201610434565b50600092019182525091905056fea2646970667358221220079092acd5c0b5783781c6719b8677b2804315edab5ec07af0a0f7a7a9b7803c64736f6c634300081b0033608060405234801561001057600080fd5b5060405161055338038061055383398101604081905261002f916100be565b806001600160a01b03811661005e57604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b6100678161006e565b50506100ee565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000602082840312156100d057600080fd5b81516001600160a01b03811681146100e757600080fd5b9392505050565b610456806100fd6000396000f3fe60806040526004361061004a5760003560e01c8063715018a61461004f5780638da5cb5b146100665780639623609d14610091578063ad3cb1cc146100a4578063f2fde38b146100e2575b600080fd5b34801561005b57600080fd5b50610064610102565b005b34801561007257600080fd5b5061007b610116565b604051610088919061025d565b60405180910390f35b61006461009f36600461029c565b610125565b3480156100b057600080fd5b506100d5604051806040016040528060058152602001640352e302e360dc1b81525081565b60405161008891906103bd565b3480156100ee57600080fd5b506100646100fd3660046103d7565b610194565b61010a6101db565b610114600061020d565b565b6000546001600160a01b031690565b61012d6101db565b60405163278f794360e11b81526001600160a01b03841690634f1ef28690349061015d90869086906004016103f4565b6000604051808303818588803b15801561017657600080fd5b505af115801561018a573d6000803e3d6000fd5b5050505050505050565b61019c6101db565b6001600160a01b0381166101cf576000604051631e4fbdf760e01b81526004016101c6919061025d565b60405180910390fd5b6101d88161020d565b50565b336101e4610116565b6001600160a01b031614610114573360405163118cdaa760e01b81526004016101c6919061025d565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b0391909116815260200190565b6001600160a01b03811681146101d857600080fd5b634e487b7160e01b600052604160045260246000fd5b6000806000606084860312156102b157600080fd5b83356102bc81610271565b925060208401356102cc81610271565b915060408401356001600160401b038111156102e757600080fd5b8401601f810186136102f857600080fd5b80356001600160401b0381111561031157610311610286565b604051601f8201601f19908116603f011681016001600160401b038111828210171561033f5761033f610286565b60405281815282820160200188101561035757600080fd5b816020840160208301376000602083830101528093505050509250925092565b6000815180845260005b8181101561039d57602081850181015186830182015201610381565b506000602082860101526020601f19601f83011685010191505092915050565b6020815260006103d06020830184610377565b9392505050565b6000602082840312156103e957600080fd5b81356103d081610271565b6001600160a01b038316815260406020820181905260009061041890830184610377565b94935050505056fea2646970667358221220e77af71a19651e50da550702ce9a5b1b89dda100ca5f41a9c778b943df55af8064736f6c634300081b0033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103", + "deployedBytecode": "0x608060405261000c61000e565b005b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316330361007b576000356001600160e01b03191663278f794360e11b14610071576040516334ad5dbb60e21b815260040160405180910390fd5b610079610083565b565b6100796100b2565b6000806100933660048184610304565b8101906100a09190610344565b915091506100ae82826100c2565b5050565b6100796100bd61011d565b610155565b6100cb82610179565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a28051156101155761011082826101f0565b505050565b6100ae610266565b60006101507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b3660008037600080366000845af43d6000803e808015610174573d6000f35b3d6000fd5b806001600160a01b03163b6000036101af5780604051634c9c8ce360e01b81526004016101a69190610419565b60405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080846001600160a01b03168460405161020d919061042d565b600060405180830381855af49150503d8060008114610248576040519150601f19603f3d011682016040523d82523d6000602084013e61024d565b606091505b509150915061025d858383610285565b95945050505050565b34156100795760405163b398979f60e01b815260040160405180910390fd5b60608261029a57610295826102db565b6102d4565b81511580156102b157506001600160a01b0384163b155b156102d15783604051639996b31560e01b81526004016101a69190610419565b50805b9392505050565b8051156102eb5780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b6000808585111561031457600080fd5b8386111561032157600080fd5b5050820193919092039150565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561035757600080fd5b82356001600160a01b038116811461036e57600080fd5b915060208301356001600160401b0381111561038957600080fd5b8301601f8101851361039a57600080fd5b80356001600160401b038111156103b3576103b361032e565b604051601f8201601f19908116603f011681016001600160401b03811182821017156103e1576103e161032e565b6040528181528282016020018710156103f957600080fd5b816020840160208301376000602083830101528093505050509250929050565b6001600160a01b0391909116815260200190565b6000825160005b8181101561044e5760208186018101518583015201610434565b50600092019182525091905056fea2646970667358221220079092acd5c0b5783781c6719b8677b2804315edab5ec07af0a0f7a7a9b7803c64736f6c634300081b0033", + "linkReferences": {}, + "deployedLinkReferences": {} +} \ No newline at end of file diff --git a/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/HorizonProxies#TransparentUpgradeableProxy_PaymentsEscrow.json b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/HorizonProxies#TransparentUpgradeableProxy_PaymentsEscrow.json new file mode 100644 index 000000000..700f93578 --- /dev/null +++ b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/HorizonProxies#TransparentUpgradeableProxy_PaymentsEscrow.json @@ -0,0 +1,116 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "TransparentUpgradeableProxy", + "sourceName": "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "initialOwner", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + } + ], + "name": "AddressEmptyCode", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "admin", + "type": "address" + } + ], + "name": "ERC1967InvalidAdmin", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "ERC1967InvalidImplementation", + "type": "error" + }, + { + "inputs": [], + "name": "ERC1967NonPayable", + "type": "error" + }, + { + "inputs": [], + "name": "FailedCall", + "type": "error" + }, + { + "inputs": [], + "name": "ProxyDeniedAdminAccess", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + } + ], + "bytecode": "0x60a0604052604051610eae380380610eae8339810160408190526100229161039d565b828161002e828261008f565b50508160405161003d9061033a565b6001600160a01b039091168152602001604051809103906000f080158015610069573d6000803e3d6000fd5b506001600160a01b031660805261008761008260805190565b6100ee565b50505061048f565b6100988261015c565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a28051156100e2576100dd82826101db565b505050565b6100ea610252565b5050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61012e600080516020610e8e833981519152546001600160a01b031690565b604080516001600160a01b03928316815291841660208301520160405180910390a161015981610273565b50565b806001600160a01b03163b60000361019757604051634c9c8ce360e01b81526001600160a01b03821660048201526024015b60405180910390fd5b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5b80546001600160a01b0319166001600160a01b039290921691909117905550565b6060600080846001600160a01b0316846040516101f89190610473565b600060405180830381855af49150503d8060008114610233576040519150601f19603f3d011682016040523d82523d6000602084013e610238565b606091505b5090925090506102498583836102b2565b95945050505050565b34156102715760405163b398979f60e01b815260040160405180910390fd5b565b6001600160a01b03811661029d57604051633173bdd160e11b81526000600482015260240161018e565b80600080516020610e8e8339815191526101ba565b6060826102c7576102c282610311565b61030a565b81511580156102de57506001600160a01b0384163b155b1561030757604051639996b31560e01b81526001600160a01b038516600482015260240161018e565b50805b9392505050565b8051156103215780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b6105538061093b83390190565b80516001600160a01b038116811461035e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561039457818101518382015260200161037c565b50506000910152565b6000806000606084860312156103b257600080fd5b6103bb84610347565b92506103c960208501610347565b60408501519092506001600160401b038111156103e557600080fd5b8401601f810186136103f657600080fd5b80516001600160401b0381111561040f5761040f610363565b604051601f8201601f19908116603f011681016001600160401b038111828210171561043d5761043d610363565b60405281815282820160200188101561045557600080fd5b610466826020830160208601610379565b8093505050509250925092565b60008251610485818460208701610379565b9190910192915050565b6080516104926104a96000396000601001526104926000f3fe608060405261000c61000e565b005b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316330361007b576000356001600160e01b03191663278f794360e11b14610071576040516334ad5dbb60e21b815260040160405180910390fd5b610079610083565b565b6100796100b2565b6000806100933660048184610304565b8101906100a09190610344565b915091506100ae82826100c2565b5050565b6100796100bd61011d565b610155565b6100cb82610179565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a28051156101155761011082826101f0565b505050565b6100ae610266565b60006101507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b3660008037600080366000845af43d6000803e808015610174573d6000f35b3d6000fd5b806001600160a01b03163b6000036101af5780604051634c9c8ce360e01b81526004016101a69190610419565b60405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080846001600160a01b03168460405161020d919061042d565b600060405180830381855af49150503d8060008114610248576040519150601f19603f3d011682016040523d82523d6000602084013e61024d565b606091505b509150915061025d858383610285565b95945050505050565b34156100795760405163b398979f60e01b815260040160405180910390fd5b60608261029a57610295826102db565b6102d4565b81511580156102b157506001600160a01b0384163b155b156102d15783604051639996b31560e01b81526004016101a69190610419565b50805b9392505050565b8051156102eb5780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b6000808585111561031457600080fd5b8386111561032157600080fd5b5050820193919092039150565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561035757600080fd5b82356001600160a01b038116811461036e57600080fd5b915060208301356001600160401b0381111561038957600080fd5b8301601f8101851361039a57600080fd5b80356001600160401b038111156103b3576103b361032e565b604051601f8201601f19908116603f011681016001600160401b03811182821017156103e1576103e161032e565b6040528181528282016020018710156103f957600080fd5b816020840160208301376000602083830101528093505050509250929050565b6001600160a01b0391909116815260200190565b6000825160005b8181101561044e5760208186018101518583015201610434565b50600092019182525091905056fea2646970667358221220079092acd5c0b5783781c6719b8677b2804315edab5ec07af0a0f7a7a9b7803c64736f6c634300081b0033608060405234801561001057600080fd5b5060405161055338038061055383398101604081905261002f916100be565b806001600160a01b03811661005e57604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b6100678161006e565b50506100ee565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000602082840312156100d057600080fd5b81516001600160a01b03811681146100e757600080fd5b9392505050565b610456806100fd6000396000f3fe60806040526004361061004a5760003560e01c8063715018a61461004f5780638da5cb5b146100665780639623609d14610091578063ad3cb1cc146100a4578063f2fde38b146100e2575b600080fd5b34801561005b57600080fd5b50610064610102565b005b34801561007257600080fd5b5061007b610116565b604051610088919061025d565b60405180910390f35b61006461009f36600461029c565b610125565b3480156100b057600080fd5b506100d5604051806040016040528060058152602001640352e302e360dc1b81525081565b60405161008891906103bd565b3480156100ee57600080fd5b506100646100fd3660046103d7565b610194565b61010a6101db565b610114600061020d565b565b6000546001600160a01b031690565b61012d6101db565b60405163278f794360e11b81526001600160a01b03841690634f1ef28690349061015d90869086906004016103f4565b6000604051808303818588803b15801561017657600080fd5b505af115801561018a573d6000803e3d6000fd5b5050505050505050565b61019c6101db565b6001600160a01b0381166101cf576000604051631e4fbdf760e01b81526004016101c6919061025d565b60405180910390fd5b6101d88161020d565b50565b336101e4610116565b6001600160a01b031614610114573360405163118cdaa760e01b81526004016101c6919061025d565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b0391909116815260200190565b6001600160a01b03811681146101d857600080fd5b634e487b7160e01b600052604160045260246000fd5b6000806000606084860312156102b157600080fd5b83356102bc81610271565b925060208401356102cc81610271565b915060408401356001600160401b038111156102e757600080fd5b8401601f810186136102f857600080fd5b80356001600160401b0381111561031157610311610286565b604051601f8201601f19908116603f011681016001600160401b038111828210171561033f5761033f610286565b60405281815282820160200188101561035757600080fd5b816020840160208301376000602083830101528093505050509250925092565b6000815180845260005b8181101561039d57602081850181015186830182015201610381565b506000602082860101526020601f19601f83011685010191505092915050565b6020815260006103d06020830184610377565b9392505050565b6000602082840312156103e957600080fd5b81356103d081610271565b6001600160a01b038316815260406020820181905260009061041890830184610377565b94935050505056fea2646970667358221220e77af71a19651e50da550702ce9a5b1b89dda100ca5f41a9c778b943df55af8064736f6c634300081b0033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103", + "deployedBytecode": "0x608060405261000c61000e565b005b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316330361007b576000356001600160e01b03191663278f794360e11b14610071576040516334ad5dbb60e21b815260040160405180910390fd5b610079610083565b565b6100796100b2565b6000806100933660048184610304565b8101906100a09190610344565b915091506100ae82826100c2565b5050565b6100796100bd61011d565b610155565b6100cb82610179565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a28051156101155761011082826101f0565b505050565b6100ae610266565b60006101507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b3660008037600080366000845af43d6000803e808015610174573d6000f35b3d6000fd5b806001600160a01b03163b6000036101af5780604051634c9c8ce360e01b81526004016101a69190610419565b60405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080846001600160a01b03168460405161020d919061042d565b600060405180830381855af49150503d8060008114610248576040519150601f19603f3d011682016040523d82523d6000602084013e61024d565b606091505b509150915061025d858383610285565b95945050505050565b34156100795760405163b398979f60e01b815260040160405180910390fd5b60608261029a57610295826102db565b6102d4565b81511580156102b157506001600160a01b0384163b155b156102d15783604051639996b31560e01b81526004016101a69190610419565b50805b9392505050565b8051156102eb5780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b6000808585111561031457600080fd5b8386111561032157600080fd5b5050820193919092039150565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561035757600080fd5b82356001600160a01b038116811461036e57600080fd5b915060208301356001600160401b0381111561038957600080fd5b8301601f8101851361039a57600080fd5b80356001600160401b038111156103b3576103b361032e565b604051601f8201601f19908116603f011681016001600160401b03811182821017156103e1576103e161032e565b6040528181528282016020018710156103f957600080fd5b816020840160208301376000602083830101528093505050509250929050565b6001600160a01b0391909116815260200190565b6000825160005b8181101561044e5760208186018101518583015201610434565b50600092019182525091905056fea2646970667358221220079092acd5c0b5783781c6719b8677b2804315edab5ec07af0a0f7a7a9b7803c64736f6c634300081b0033", + "linkReferences": {}, + "deployedLinkReferences": {} +} \ No newline at end of file diff --git a/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/HorizonStaking#ExponentialRebates.json b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/HorizonStaking#ExponentialRebates.json new file mode 100644 index 000000000..56c4ece9f --- /dev/null +++ b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/HorizonStaking#ExponentialRebates.json @@ -0,0 +1,55 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "ExponentialRebates", + "sourceName": "contracts/staking/libraries/ExponentialRebates.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "uint256", + "name": "fees", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "stake", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "alphaNumerator", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "alphaDenominator", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "lambdaNumerator", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "lambdaDenominator", + "type": "uint32" + } + ], + "name": "exponentialRebates", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + } + ], + "bytecode": "0x610c2d610039600b82828239805160001a607314602c57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600436106100355760003560e01c806349484d811461003a575b600080fd5b61004d610048366004610a66565b61005f565b60405190815260200160405180910390f35b6000806100728660030b8660030b61011c565b9050806000036100855787915050610112565b87600003610097576000915050610112565b60006100a98560030b8560030b61011c565b905060006100b8828a8c61013c565b9050600f6100c582610153565b13156100d657899350505050610112565b60006100ff6001607f1b6100fa866100f56100f087610ae2565b610169565b610882565b61089d565b905061010b818c6108d4565b9450505050505b9695505050505050565b600061013561012f846001607f1b610920565b83610988565b9392505050565b600061014b61012f8585610920565b949350505050565b60006101636001607f1b83610b14565b92915050565b60006101796101ff607c1b610ae2565b82121561018857506000919050565b8160000361019b57506001607f1b919050565b60008213156101c55760405162461bcd60e51b81526004016101bc90610b42565b60405180910390fd5b6000806101d66001607c1b85610b69565b91508190506001607f1b6101ea8280610b7d565b6101f49190610b14565b9050610208816710e1b3be415a0000610b7d565b6102129084610bad565b92506001607f1b6102238383610b7d565b61022d9190610b14565b9050610241816705a0913f6b1e0000610b7d565b61024b9084610bad565b92506001607f1b61025c8383610b7d565b6102669190610b14565b905061027a81670168244fdac78000610b7d565b6102849084610bad565b92506001607f1b6102958383610b7d565b61029f9190610b14565b90506102b281664807432bc18000610b7d565b6102bc9084610bad565b92506001607f1b6102cd8383610b7d565b6102d79190610b14565b90506102ea81660c0135dca04000610b7d565b6102f49084610bad565b92506001607f1b6103058383610b7d565b61030f9190610b14565b9050610322816601b707b1cdc000610b7d565b61032c9084610bad565b92506001607f1b61033d8383610b7d565b6103479190610b14565b9050610359816536e0f639b800610b7d565b6103639084610bad565b92506001607f1b6103748383610b7d565b61037e9190610b14565b905061039081650618fee9f800610b7d565b61039a9084610bad565b92506001607f1b6103ab8383610b7d565b6103b59190610b14565b90506103c681649c197dcc00610b7d565b6103d09084610bad565b92506001607f1b6103e18383610b7d565b6103eb9190610b14565b90506103fc81640e30dce400610b7d565b6104069084610bad565b92506001607f1b6104178383610b7d565b6104219190610b14565b90506104328164012ebd1300610b7d565b61043c9084610bad565b92506001607f1b61044d8383610b7d565b6104579190610b14565b9050610467816317499f00610b7d565b6104719084610bad565b92506001607f1b6104828383610b7d565b61048c9190610b14565b905061049c816301a9d480610b7d565b6104a69084610bad565b92506001607f1b6104b78383610b7d565b6104c19190610b14565b90506104d081621c6380610b7d565b6104da9084610bad565b92506001607f1b6104eb8383610b7d565b6104f59190610b14565b9050610504816201c638610b7d565b61050e9084610bad565b92506001607f1b61051f8383610b7d565b6105299190610b14565b905061053781611ab8610b7d565b6105419084610bad565b92506001607f1b6105528383610b7d565b61055c9190610b14565b905061056a8161017c610b7d565b6105749084610bad565b92506001607f1b6105858383610b7d565b61058f9190610b14565b905061059c816014610b7d565b6105a69084610bad565b92506001607f1b6105b78383610b7d565b6105c19190610b14565b90506105ce816001610b7d565b6105d89084610bad565b92506001607f1b826105f26721c3677c82b4000086610b14565b6105fc9190610bad565b6106069190610bad565b925061061184610ae2565b9350600160841b841615610657577243cbaf42a000812488fc5c220ad7b97bf6e99e61064a6cf1aaddd7742e56d32fb9f9974485610b7d565b6106549190610b14565b92505b600160831b84161561069c577105d27a9f51c31b7c2f8038212a057477999161068f6e0afe10820813d65dfe6a33c07f738f85610b7d565b6106999190610b14565b92505b600160821b8416156106e157701b4c902e273a58678d6d3bfdb93db96d026106d46f02582ab704279e8efd15e0265855c47a85610b7d565b6106de9190610b14565b92505b600160811b841615610726577003b1cc971a9bb5b9867477440d6d1577506107196f1152aaa3bf81cb9fdb76eae12d02957185610b7d565b6107239190610b14565b92505b600160801b84161561076b5770015bf0a8b1457695355fb8ac404e7a79e361075e6f2f16ac6c59de6f8d5d6f63c1482a7c8685610b7d565b6107689190610b14565b92505b6001607f1b8416156107af576fd3094c70f034de4b96ff7d5b6f99fcd86107a26f4da2cbf1be5827f9eb3ad1aa9866ebb385610b7d565b6107ac9190610b14565b92505b6001607e1b8416156107f3576fa45af1e1f40c333b3de1db4dd55f29a76107e66f63afbe7ab2082ba1a0ae5e4eb1b479dc85610b7d565b6107f09190610b14565b92505b6001607d1b841615610837576f910b022db7ae67ce76b441c27035c6a161082a6f70f5a893b608861e1f58934f97aea57d85610b7d565b6108349190610b14565b92505b6001607c1b84161561087b576f88415abbe9a76bead8d00cf112e4d4a861086e6f783eafef1c0a8f3978c7f81824d62ebf85610b7d565b6108789190610b14565b92505b5050919050565b60006001607f1b6108938484610920565b6101359190610b14565b6000600160ff1b82036108c25760405162461bcd60e51b81526004016101bc90610b42565b610135836108cf84610ae2565b6109f2565b6000808212156108f65760405162461bcd60e51b81526004016101bc90610b42565b60006109028484610920565b905060008113610916576000915050610163565b607f1c9392505050565b600082158061092d575081155b1561093a57506000610163565b508181028183828161094e5761094e610afe565b0514158061096b57508282828161096757610967610afe565b0514155b156101635760405162461bcd60e51b81526004016101bc90610bd5565b6000816000036109aa5760405162461bcd60e51b81526004016101bc90610bd5565b600160ff1b831480156109be575081600019145b156109db5760405162461bcd60e51b81526004016101bc90610bd5565b8183816109ea576109ea610afe565b059392505050565b818101600083128015610a055750600082125b8015610a1057508281135b8061096b5750600083138015610a265750600082135b801561096b5750828112156101635760405162461bcd60e51b81526004016101bc90610bd5565b803563ffffffff81168114610a6157600080fd5b919050565b60008060008060008060c08789031215610a7f57600080fd5b8635955060208701359450610a9660408801610a4d565b9350610aa460608801610a4d565b9250610ab260808801610a4d565b9150610ac060a08801610a4d565b90509295509295509295565b634e487b7160e01b600052601160045260246000fd5b6000600160ff1b8201610af757610af7610acc565b5060000390565b634e487b7160e01b600052601260045260246000fd5b600082610b2357610b23610afe565b600160ff1b821460001984141615610b3d57610b3d610acc565b500590565b6020808252600d908201526c6f75742d6f662d626f756e647360981b604082015260600190565b600082610b7857610b78610afe565b500790565b80820260008212600160ff1b84141615610b9957610b99610acc565b818105831482151761016357610163610acc565b8082018281126000831280158216821582161715610bcd57610bcd610acc565b505092915050565b6020808252600890820152676f766572666c6f7760c01b60408201526060019056fea26469706673582212201ef3beb7da88d73c1ec2e008b9308e699e4621df52e1b4b35ff71522e3621d6464736f6c634300081b0033", + "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600436106100355760003560e01c806349484d811461003a575b600080fd5b61004d610048366004610a66565b61005f565b60405190815260200160405180910390f35b6000806100728660030b8660030b61011c565b9050806000036100855787915050610112565b87600003610097576000915050610112565b60006100a98560030b8560030b61011c565b905060006100b8828a8c61013c565b9050600f6100c582610153565b13156100d657899350505050610112565b60006100ff6001607f1b6100fa866100f56100f087610ae2565b610169565b610882565b61089d565b905061010b818c6108d4565b9450505050505b9695505050505050565b600061013561012f846001607f1b610920565b83610988565b9392505050565b600061014b61012f8585610920565b949350505050565b60006101636001607f1b83610b14565b92915050565b60006101796101ff607c1b610ae2565b82121561018857506000919050565b8160000361019b57506001607f1b919050565b60008213156101c55760405162461bcd60e51b81526004016101bc90610b42565b60405180910390fd5b6000806101d66001607c1b85610b69565b91508190506001607f1b6101ea8280610b7d565b6101f49190610b14565b9050610208816710e1b3be415a0000610b7d565b6102129084610bad565b92506001607f1b6102238383610b7d565b61022d9190610b14565b9050610241816705a0913f6b1e0000610b7d565b61024b9084610bad565b92506001607f1b61025c8383610b7d565b6102669190610b14565b905061027a81670168244fdac78000610b7d565b6102849084610bad565b92506001607f1b6102958383610b7d565b61029f9190610b14565b90506102b281664807432bc18000610b7d565b6102bc9084610bad565b92506001607f1b6102cd8383610b7d565b6102d79190610b14565b90506102ea81660c0135dca04000610b7d565b6102f49084610bad565b92506001607f1b6103058383610b7d565b61030f9190610b14565b9050610322816601b707b1cdc000610b7d565b61032c9084610bad565b92506001607f1b61033d8383610b7d565b6103479190610b14565b9050610359816536e0f639b800610b7d565b6103639084610bad565b92506001607f1b6103748383610b7d565b61037e9190610b14565b905061039081650618fee9f800610b7d565b61039a9084610bad565b92506001607f1b6103ab8383610b7d565b6103b59190610b14565b90506103c681649c197dcc00610b7d565b6103d09084610bad565b92506001607f1b6103e18383610b7d565b6103eb9190610b14565b90506103fc81640e30dce400610b7d565b6104069084610bad565b92506001607f1b6104178383610b7d565b6104219190610b14565b90506104328164012ebd1300610b7d565b61043c9084610bad565b92506001607f1b61044d8383610b7d565b6104579190610b14565b9050610467816317499f00610b7d565b6104719084610bad565b92506001607f1b6104828383610b7d565b61048c9190610b14565b905061049c816301a9d480610b7d565b6104a69084610bad565b92506001607f1b6104b78383610b7d565b6104c19190610b14565b90506104d081621c6380610b7d565b6104da9084610bad565b92506001607f1b6104eb8383610b7d565b6104f59190610b14565b9050610504816201c638610b7d565b61050e9084610bad565b92506001607f1b61051f8383610b7d565b6105299190610b14565b905061053781611ab8610b7d565b6105419084610bad565b92506001607f1b6105528383610b7d565b61055c9190610b14565b905061056a8161017c610b7d565b6105749084610bad565b92506001607f1b6105858383610b7d565b61058f9190610b14565b905061059c816014610b7d565b6105a69084610bad565b92506001607f1b6105b78383610b7d565b6105c19190610b14565b90506105ce816001610b7d565b6105d89084610bad565b92506001607f1b826105f26721c3677c82b4000086610b14565b6105fc9190610bad565b6106069190610bad565b925061061184610ae2565b9350600160841b841615610657577243cbaf42a000812488fc5c220ad7b97bf6e99e61064a6cf1aaddd7742e56d32fb9f9974485610b7d565b6106549190610b14565b92505b600160831b84161561069c577105d27a9f51c31b7c2f8038212a057477999161068f6e0afe10820813d65dfe6a33c07f738f85610b7d565b6106999190610b14565b92505b600160821b8416156106e157701b4c902e273a58678d6d3bfdb93db96d026106d46f02582ab704279e8efd15e0265855c47a85610b7d565b6106de9190610b14565b92505b600160811b841615610726577003b1cc971a9bb5b9867477440d6d1577506107196f1152aaa3bf81cb9fdb76eae12d02957185610b7d565b6107239190610b14565b92505b600160801b84161561076b5770015bf0a8b1457695355fb8ac404e7a79e361075e6f2f16ac6c59de6f8d5d6f63c1482a7c8685610b7d565b6107689190610b14565b92505b6001607f1b8416156107af576fd3094c70f034de4b96ff7d5b6f99fcd86107a26f4da2cbf1be5827f9eb3ad1aa9866ebb385610b7d565b6107ac9190610b14565b92505b6001607e1b8416156107f3576fa45af1e1f40c333b3de1db4dd55f29a76107e66f63afbe7ab2082ba1a0ae5e4eb1b479dc85610b7d565b6107f09190610b14565b92505b6001607d1b841615610837576f910b022db7ae67ce76b441c27035c6a161082a6f70f5a893b608861e1f58934f97aea57d85610b7d565b6108349190610b14565b92505b6001607c1b84161561087b576f88415abbe9a76bead8d00cf112e4d4a861086e6f783eafef1c0a8f3978c7f81824d62ebf85610b7d565b6108789190610b14565b92505b5050919050565b60006001607f1b6108938484610920565b6101359190610b14565b6000600160ff1b82036108c25760405162461bcd60e51b81526004016101bc90610b42565b610135836108cf84610ae2565b6109f2565b6000808212156108f65760405162461bcd60e51b81526004016101bc90610b42565b60006109028484610920565b905060008113610916576000915050610163565b607f1c9392505050565b600082158061092d575081155b1561093a57506000610163565b508181028183828161094e5761094e610afe565b0514158061096b57508282828161096757610967610afe565b0514155b156101635760405162461bcd60e51b81526004016101bc90610bd5565b6000816000036109aa5760405162461bcd60e51b81526004016101bc90610bd5565b600160ff1b831480156109be575081600019145b156109db5760405162461bcd60e51b81526004016101bc90610bd5565b8183816109ea576109ea610afe565b059392505050565b818101600083128015610a055750600082125b8015610a1057508281135b8061096b5750600083138015610a265750600082135b801561096b5750828112156101635760405162461bcd60e51b81526004016101bc90610bd5565b803563ffffffff81168114610a6157600080fd5b919050565b60008060008060008060c08789031215610a7f57600080fd5b8635955060208701359450610a9660408801610a4d565b9350610aa460608801610a4d565b9250610ab260808801610a4d565b9150610ac060a08801610a4d565b90509295509295509295565b634e487b7160e01b600052601160045260246000fd5b6000600160ff1b8201610af757610af7610acc565b5060000390565b634e487b7160e01b600052601260045260246000fd5b600082610b2357610b23610afe565b600160ff1b821460001984141615610b3d57610b3d610acc565b500590565b6020808252600d908201526c6f75742d6f662d626f756e647360981b604082015260600190565b600082610b7857610b78610afe565b500790565b80820260008212600160ff1b84141615610b9957610b99610acc565b818105831482151761016357610163610acc565b8082018281126000831280158216821582161715610bcd57610bcd610acc565b505092915050565b6020808252600890820152676f766572666c6f7760c01b60408201526060019056fea26469706673582212201ef3beb7da88d73c1ec2e008b9308e699e4621df52e1b4b35ff71522e3621d6464736f6c634300081b0033", + "linkReferences": {}, + "deployedLinkReferences": {} +} \ No newline at end of file diff --git a/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/HorizonStaking#HorizonStaking.json b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/HorizonStaking#HorizonStaking.json new file mode 100644 index 000000000..094f54411 --- /dev/null +++ b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/HorizonStaking#HorizonStaking.json @@ -0,0 +1,2481 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "HorizonStaking", + "sourceName": "contracts/staking/HorizonStaking.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "controller", + "type": "address" + }, + { + "internalType": "address", + "name": "stakingExtensionAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "subgraphDataServiceAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + } + ], + "name": "AddressEmptyCode", + "type": "error" + }, + { + "inputs": [], + "name": "FailedCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "contractName", + "type": "bytes" + } + ], + "name": "GraphDirectoryInvalidZeroAddress", + "type": "error" + }, + { + "inputs": [], + "name": "HorizonStakingCallerIsServiceProvider", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minTokens", + "type": "uint256" + } + ], + "name": "HorizonStakingInsufficientDelegationTokens", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minTokens", + "type": "uint256" + } + ], + "name": "HorizonStakingInsufficientIdleStake", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minShares", + "type": "uint256" + } + ], + "name": "HorizonStakingInsufficientShares", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minTokens", + "type": "uint256" + } + ], + "name": "HorizonStakingInsufficientStakeForLegacyAllocations", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minRequired", + "type": "uint256" + } + ], + "name": "HorizonStakingInsufficientTokens", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "feeCut", + "type": "uint256" + } + ], + "name": "HorizonStakingInvalidDelegationFeeCut", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + } + ], + "name": "HorizonStakingInvalidDelegationPool", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + } + ], + "name": "HorizonStakingInvalidDelegationPoolState", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "maxVerifierCut", + "type": "uint32" + } + ], + "name": "HorizonStakingInvalidMaxVerifierCut", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + } + ], + "name": "HorizonStakingInvalidProvision", + "type": "error" + }, + { + "inputs": [], + "name": "HorizonStakingInvalidServiceProviderZeroAddress", + "type": "error" + }, + { + "inputs": [], + "name": "HorizonStakingInvalidThawRequestType", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "thawingPeriod", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "maxThawingPeriod", + "type": "uint64" + } + ], + "name": "HorizonStakingInvalidThawingPeriod", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "verifier", + "type": "address" + } + ], + "name": "HorizonStakingInvalidVerifier", + "type": "error" + }, + { + "inputs": [], + "name": "HorizonStakingInvalidVerifierZeroAddress", + "type": "error" + }, + { + "inputs": [], + "name": "HorizonStakingInvalidZeroShares", + "type": "error" + }, + { + "inputs": [], + "name": "HorizonStakingInvalidZeroTokens", + "type": "error" + }, + { + "inputs": [], + "name": "HorizonStakingLegacySlashFailed", + "type": "error" + }, + { + "inputs": [], + "name": "HorizonStakingNoTokensToSlash", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "HorizonStakingNotAuthorized", + "type": "error" + }, + { + "inputs": [], + "name": "HorizonStakingNothingThawing", + "type": "error" + }, + { + "inputs": [], + "name": "HorizonStakingNothingToWithdraw", + "type": "error" + }, + { + "inputs": [], + "name": "HorizonStakingProvisionAlreadyExists", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minShares", + "type": "uint256" + } + ], + "name": "HorizonStakingSlippageProtection", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "until", + "type": "uint256" + } + ], + "name": "HorizonStakingStillThawing", + "type": "error" + }, + { + "inputs": [], + "name": "HorizonStakingTooManyThawRequests", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxTokens", + "type": "uint256" + } + ], + "name": "HorizonStakingTooManyTokens", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "verifier", + "type": "address" + } + ], + "name": "HorizonStakingVerifierNotAllowed", + "type": "error" + }, + { + "inputs": [], + "name": "LinkedListEmptyList", + "type": "error" + }, + { + "inputs": [], + "name": "LinkedListInvalidIterations", + "type": "error" + }, + { + "inputs": [], + "name": "LinkedListInvalidZeroId", + "type": "error" + }, + { + "inputs": [], + "name": "LinkedListMaxElementsExceeded", + "type": "error" + }, + { + "inputs": [], + "name": "ManagedIsPaused", + "type": "error" + }, + { + "inputs": [], + "name": "ManagedOnlyController", + "type": "error" + }, + { + "inputs": [], + "name": "ManagedOnlyGovernor", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "a", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "b", + "type": "uint256" + } + ], + "name": "PPMMathInvalidMulPPM", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "AllowedLockedVerifierSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "delegator", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "DelegatedTokensWithdrawn", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": true, + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "paymentType", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "feeCut", + "type": "uint256" + } + ], + "name": "DelegationFeeCutSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "DelegationSlashed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "DelegationSlashingEnabled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "DelegationSlashingSkipped", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "graphToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "graphStaking", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphPayments", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphEscrow", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "graphController", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphEpochManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphRewardsManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphTokenGateway", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphProxyAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphCuration", + "type": "address" + } + ], + "name": "GraphDirectoryInitialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "HorizonStakeDeposited", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "until", + "type": "uint256" + } + ], + "name": "HorizonStakeLocked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "HorizonStakeWithdrawn", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "maxThawingPeriod", + "type": "uint64" + } + ], + "name": "MaxThawingPeriodSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "OperatorSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "maxVerifierCut", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "thawingPeriod", + "type": "uint64" + } + ], + "name": "ProvisionCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "ProvisionIncreased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "maxVerifierCut", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "thawingPeriod", + "type": "uint64" + } + ], + "name": "ProvisionParametersSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "maxVerifierCut", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "thawingPeriod", + "type": "uint64" + } + ], + "name": "ProvisionParametersStaged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "ProvisionSlashed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "ProvisionThawed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "delegator", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "StakeDelegatedWithdrawn", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "enum IHorizonStakingTypes.ThawRequestType", + "name": "requestType", + "type": "uint8" + }, + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "shares", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "thawingUntil", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "thawRequestId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + } + ], + "name": "ThawRequestCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "enum IHorizonStakingTypes.ThawRequestType", + "name": "requestType", + "type": "uint8" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "thawRequestId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "shares", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "thawingUntil", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "bool", + "name": "valid", + "type": "bool" + } + ], + "name": "ThawRequestFulfilled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "enum IHorizonStakingTypes.ThawRequestType", + "name": "requestType", + "type": "uint8" + }, + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "thawRequestsFulfilled", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "ThawRequestsFulfilled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "ThawingPeriodCleared", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "delegator", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "shares", + "type": "uint256" + } + ], + "name": "TokensDelegated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "TokensDeprovisioned", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "TokensToDelegationPoolAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "delegator", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "shares", + "type": "uint256" + } + ], + "name": "TokensUndelegated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "VerifierTokensSent", + "type": "event" + }, + { + "stateMutability": "nonpayable", + "type": "fallback" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + } + ], + "name": "acceptProvisionParameters", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IGraphProxy", + "name": "_proxy", + "type": "address" + } + ], + "name": "acceptProxy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IGraphProxy", + "name": "_proxy", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "acceptProxyAndCall", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "addToDelegationPool", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "addToProvision", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "clearThawingPeriod", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "delegate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minSharesOut", + "type": "uint256" + } + ], + "name": "delegate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "uint256", + "name": "nThawRequests", + "type": "uint256" + } + ], + "name": "deprovision", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + } + ], + "name": "getDelegatedTokensAvailable", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "address", + "name": "delegator", + "type": "address" + } + ], + "name": "getDelegation", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + } + ], + "internalType": "struct IHorizonStakingTypes.Delegation", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "paymentType", + "type": "uint8" + } + ], + "name": "getDelegationFeeCut", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + } + ], + "name": "getDelegationPool", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokensThawing", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sharesThawing", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "thawingNonce", + "type": "uint256" + } + ], + "internalType": "struct IHorizonStakingTypes.DelegationPool", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + } + ], + "name": "getIdleStake", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getMaxThawingPeriod", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + } + ], + "name": "getProviderTokensAvailable", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + } + ], + "name": "getProvision", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokensThawing", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sharesThawing", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "maxVerifierCut", + "type": "uint32" + }, + { + "internalType": "uint64", + "name": "thawingPeriod", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "createdAt", + "type": "uint64" + }, + { + "internalType": "uint32", + "name": "maxVerifierCutPending", + "type": "uint32" + }, + { + "internalType": "uint64", + "name": "thawingPeriodPending", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "lastParametersStagedAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "thawingNonce", + "type": "uint256" + } + ], + "internalType": "struct IHorizonStakingTypes.Provision", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + } + ], + "name": "getServiceProvider", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "tokensStaked", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokensProvisioned", + "type": "uint256" + } + ], + "internalType": "struct IHorizonStakingTypes.ServiceProvider", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + } + ], + "name": "getStake", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getStakingExtension", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "enum IHorizonStakingTypes.ThawRequestType", + "name": "requestType", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "thawRequestId", + "type": "bytes32" + } + ], + "name": "getThawRequest", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + }, + { + "internalType": "uint64", + "name": "thawingUntil", + "type": "uint64" + }, + { + "internalType": "bytes32", + "name": "nextRequest", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "thawingNonce", + "type": "uint256" + } + ], + "internalType": "struct IHorizonStakingTypes.ThawRequest", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "enum IHorizonStakingTypes.ThawRequestType", + "name": "requestType", + "type": "uint8" + }, + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "getThawRequestList", + "outputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "head", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "tail", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "count", + "type": "uint256" + } + ], + "internalType": "struct LinkedList.List", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "enum IHorizonStakingTypes.ThawRequestType", + "name": "requestType", + "type": "uint8" + }, + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "getThawedTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "uint32", + "name": "delegationRatio", + "type": "uint32" + } + ], + "name": "getTokensAvailable", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "verifier", + "type": "address" + } + ], + "name": "isAllowedLockedVerifier", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "address", + "name": "operator", + "type": "address" + } + ], + "name": "isAuthorized", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isDelegationSlashingEnabled", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "name": "multicall", + "outputs": [ + { + "internalType": "bytes[]", + "name": "results", + "type": "bytes[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "maxVerifierCut", + "type": "uint32" + }, + { + "internalType": "uint64", + "name": "thawingPeriod", + "type": "uint64" + } + ], + "name": "provision", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "maxVerifierCut", + "type": "uint32" + }, + { + "internalType": "uint64", + "name": "thawingPeriod", + "type": "uint64" + } + ], + "name": "provisionLocked", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "oldServiceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "oldVerifier", + "type": "address" + }, + { + "internalType": "address", + "name": "newServiceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "newVerifier", + "type": "address" + }, + { + "internalType": "uint256", + "name": "minSharesForNewProvider", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nThawRequests", + "type": "uint256" + } + ], + "name": "redelegate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "oldVerifier", + "type": "address" + }, + { + "internalType": "address", + "name": "newVerifier", + "type": "address" + }, + { + "internalType": "uint256", + "name": "nThawRequests", + "type": "uint256" + } + ], + "name": "reprovision", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "setAllowedLockedVerifier", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "paymentType", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "feeCut", + "type": "uint256" + } + ], + "name": "setDelegationFeeCut", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "setDelegationSlashingEnabled", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "maxThawingPeriod", + "type": "uint64" + } + ], + "name": "setMaxThawingPeriod", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "setOperator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "setOperatorLocked", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "uint32", + "name": "newMaxVerifierCut", + "type": "uint32" + }, + { + "internalType": "uint64", + "name": "newThawingPeriod", + "type": "uint64" + } + ], + "name": "setProvisionParameters", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokensVerifier", + "type": "uint256" + }, + { + "internalType": "address", + "name": "verifierDestination", + "type": "address" + } + ], + "name": "slash", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "stake", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "stakeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "stakeToProvision", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "thaw", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + } + ], + "name": "undelegate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + } + ], + "name": "undelegate", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "unstake", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "uint256", + "name": "nThawRequests", + "type": "uint256" + } + ], + "name": "withdrawDelegated", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "withdrawDelegated", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "bytecode": "0x61020060405234801561001157600080fd5b506040516162a33803806162a38339810160408190526100309161041b565b828181806001600160a01b03811661007d5760405163218f5add60e11b815260206004820152600a60248201526921b7b73a3937b63632b960b11b60448201526064015b60405180910390fd5b6001600160a01b0381166101005260408051808201909152600a81526923b930b8342a37b5b2b760b11b60208201526100b590610351565b6001600160a01b03166080526040805180820190915260078152665374616b696e6760c81b60208201526100e890610351565b6001600160a01b031660a05260408051808201909152600d81526c47726170685061796d656e747360981b602082015261012190610351565b6001600160a01b031660c05260408051808201909152600e81526d5061796d656e7473457363726f7760901b602082015261015b90610351565b6001600160a01b031660e05260408051808201909152600c81526b22b837b1b426b0b730b3b2b960a11b602082015261019390610351565b6001600160a01b03166101205260408051808201909152600e81526d2932bbb0b93239a6b0b730b3b2b960911b60208201526101ce90610351565b6001600160a01b0316610140526040805180820190915260118152704772617068546f6b656e4761746577617960781b602082015261020c90610351565b6001600160a01b03166101605260408051808201909152600f81526e23b930b834283937bc3ca0b236b4b760891b602082015261024890610351565b6001600160a01b03166101805260408051808201909152600881526721bab930ba34b7b760c11b602082015261027d90610351565b6001600160a01b039081166101a08190526101005160a05160805160c05160e05161012051610140516101605161018051604051988b169a9788169996909716977fef5021414834d86e36470f5c1cecf6544fb2bb723f2ca51a4c86fcd8c5919a43976103279790916001600160a01b03978816815295871660208701529386166040860152918516606085015284166080840152831660a083015290911660c082015260e00190565b60405180910390a450506001600160a01b039081166101c052929092166101e052506104ce915050565b600080610100516001600160a01b031663f7641a5e84805190602001206040518263ffffffff1660e01b815260040161038c91815260200190565b602060405180830381865afa1580156103a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103cd919061045e565b9050826001600160a01b0382166103f85760405163218f5add60e11b81526004016100749190610480565b5092915050565b80516001600160a01b038116811461041657600080fd5b919050565b60008060006060848603121561043057600080fd5b610439846103ff565b9250610447602085016103ff565b9150610455604085016103ff565b90509250925092565b60006020828403121561047057600080fd5b610479826103ff565b9392505050565b602081526000825180602084015260005b818110156104ae5760208186018101516040868401015201610491565b506000604082850101526040601f19601f83011684010191505092915050565b60805160a05160c05160e05161010051610120516101405161016051610180516101a0516101c0516101e051615d2861057b6000396000818161025b0152818161055e01526128a3015260008181610a450152818161140a015281816130de015281816131a001528181614130015261447401526000505060005050600050506000505060006114e901526000613097015260005050600050506000505060006135670152615d286000f3fe608060405234801561001057600080fd5b50600436106102565760003560e01c8063872d048911610142578063872d0489146106225780638cc01c86146106355780639ce7abe514610663578063a02b942614610676578063a2594d8214610689578063a2a317221461069c578063a694fc3a146106af578063a784d498146106c2578063ac9650d8146106d5578063ad4d35b5146106f5578063ae4fe67a14610708578063ba7fb0b414610734578063bc735d9014610747578063ca94b0e91461075a578063ccebcabb1461076d578063d48de8451461078f578063e473522a146107de578063e56f8a1d146107e6578063e76fede61461082c578063ef58bd671461083f578063f64b359814610847578063f93f1cd01461085a578063fb744cc01461086d578063fc54fb2714610880578063fecc9cc11461088b57610256565b8063010167e51461029f578063026e402b146102b257806308ce5f68146102c557806321195373146102eb578063259bc435146102fe57806325d9897e146103115780632e17de78146104395780632f7cc5011461044c57806339514ad21461045f5780633993d8491461047a5780633a78b7321461048d5780633ccfd60b146104a057806342c51693146104a85780634ca7ac22146104bb5780634d99dd16146104ce57806351a60b02146104e1578063561285e4146104f45780636230001a1461054957806366ee1b281461055c578063746120921461058a5780637573ef4f1461059d5780637a766460146105b05780637c145cc7146105d957806381e21b56146105fc57806382d66cb81461060f575b6040517f00000000000000000000000000000000000000000000000000000000000000009036600082376000803683855af43d806000843e818015610299578184f35b8184fd5b005b61029d6102ad3660046151dc565b61089e565b61029d6102c036600461523e565b61097a565b6102d86102d336600461526a565b610a70565b6040519081526020015b60405180910390f35b61029d6102f93660046152a3565b610a85565b61029d61030c3660046152e4565b610b55565b61042c61031f36600461526a565b6040805161014081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101829052610120810191909152506001600160a01b039182166000908152601b6020908152604080832093909416825291825282902082516101408101845281548152600182015492810192909252600281015492820192909252600382015463ffffffff8082166060840152600160201b82046001600160401b039081166080850152600160601b8304811660a0850152600160a01b830490911660c0840152600160c01b9091041660e0820152600482015461010082015260059091015461012082015290565b6040516102e291906152ff565b61029d6104473660046153bf565b610c43565b6102d861045a3660046153e5565b610cd6565b601a546040516001600160401b0390911681526020016102e2565b61029d6104883660046152a3565b610dd8565b61029d61049b366004615441565b610e74565b61029d611040565b61029d6104b636600461546d565b6110d2565b61029d6104c93660046154ca565b611283565b61029d6104dc36600461523e565b61137d565b6102d86104ef36600461526a565b61142f565b61050761050236600461526a565b611629565b6040516102e29190600060a082019050825182526020830151602083015260408301516040830152606083015160608301526080830151608083015292915050565b61029d6105573660046154f8565b61167b565b7f00000000000000000000000000000000000000000000000000000000000000006040516102e2919061553e565b61029d6105983660046152a3565b611742565b6102d86105ab366004615552565b61182e565b6102d86105be366004615441565b6001600160a01b03166000908152600e602052604090205490565b6105ec6105e7366004615599565b611892565b60405190151581526020016102e2565b61029d61060a3660046155e4565b61189f565b61029d61061d3660046151dc565b611b18565b6102d861063036600461563c565b611c1e565b610648610643366004615441565b611c73565b604080518251815260209283015192810192909252016102e2565b61029d61067136600461567a565b611caf565b6102d86106843660046152a3565b611daa565b61029d610697366004615441565b611e3e565b61029d6106aa36600461523e565b611f22565b61029d6106bd3660046153bf565b611fb3565b6102d86106d0366004615441565b612044565b6106e86106e33660046156ff565b61204f565b6040516102e29190615798565b61029d610703366004615818565b612136565b6105ec610716366004615441565b6001600160a01b031660009081526022602052604090205460ff1690565b61029d610742366004615858565b612204565b61029d610755366004615818565b612311565b61029d6107683660046152a3565b6123a3565b61078061077b366004615599565b6125dd565b604051905181526020016102e2565b6107a261079d366004615899565b61262f565b6040516102e29190815181526020808301516001600160401b031690820152604080830151908201526060918201519181019190915260800190565b61029d61269c565b6107f96107f43660046153e5565b61276e565b6040516102e291908151815260208083015190820152604080830151908201526060918201519181019190915260800190565b61029d61083a3660046158b7565b6127d6565b61029d612d38565b61029d6108553660046158f6565b612e0a565b6102d86108683660046152a3565b612eed565b6102d861087b36600461526a565b612fc1565b60205460ff166105ec565b61029d6108993660046152a3565b612fcd565b6108a6613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108e3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109079190615964565b1561092557604051632b37d9d160e21b815260040160405180910390fd5b84846109328282336130b9565b82823390919261096157604051630c76b97b60e41b815260040161095893929190615981565b60405180910390fd5b505050610971878688878761317d565b50505050505050565b610982613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156109bf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109e39190615964565b15610a0157604051632b37d9d160e21b815260040160405180910390fd5b80600003610a2257604051630a2a4e5b60e11b815260040160405180910390fd5b610a3f3382610a2f613565565b6001600160a01b03169190613589565b610a6c827f0000000000000000000000000000000000000000000000000000000000000000836000613641565b5050565b6000610a7c8383613846565b90505b92915050565b8282610a928282336130b9565b828233909192610ab857604051630c76b97b60e41b815260040161095893929190615981565b505050610ac3613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b00573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b249190615964565b15610b4257604051632b37d9d160e21b815260040160405180910390fd5b610b4d85858561387e565b505050505050565b610b5d613095565b6001600160a01b0316634fc07d756040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b9a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bbe91906159a4565b6001600160a01b0316336001600160a01b031614610bef57604051635d9044cd60e01b815260040160405180910390fd5b601a80546001600160401b0319166001600160401b0383169081179091556040519081527fe8526be46fa99b6313d439293c9be3491ffb067741bc8fce9d30c270cbb8459f9060200160405180910390a150565b610c4b613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c88573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cac9190615964565b15610cca57604051632b37d9d160e21b815260040160405180910390fd5b610cd3816139af565b50565b600080610ce586868686613b5c565b90508060030154600003610cfd576000915050610dd0565b6001600160a01b038086166000908152601b6020908152604080832093881683529290529081206001810154600282015484545b8015610dc7576000610d438c83613bc8565b90508460050154816003015403610dbc576001810154426001600160401b0390911611610db657600083858360000154610d7d91906159d7565b610d8791906159ee565b9050610d938186615a10565b8254909550610da29085615a10565b9350610dae8188615a23565b965050610dbc565b50610dc7565b600201549050610d31565b50929450505050505b949350505050565b610de0613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e1d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e419190615964565b15610e5f57604051632b37d9d160e21b815260040160405180910390fd5b610e6f8383600080600086613c18565b505050565b610e7c613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610eb9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610edd9190615964565b15610efb57604051632b37d9d160e21b815260040160405180910390fd5b6001600160a01b0381166000908152601b60209081526040808320338085529252909120600381015483908390600160601b90046001600160401b0316610f57576040516330acea0d60e11b8152600401610958929190615a36565b50506003810154600160a01b810463ffffffff9081169116141580610f9a57506003810154600160c01b81046001600160401b03908116600160201b9092041614155b15610e6f57600381018054600160201b6001600160401b03600160c01b63ffffffff19841663ffffffff600160a01b8604811691821792909204831684026001600160601b03199095161793909317938490556040516001600160a01b0380881695908916947fa4c005afae9298a5ca51e7710c334ac406fb3d914588ade970850f917cedb1c694611033949183169392041690615a50565b60405180910390a3505050565b611048613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611085573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110a99190615964565b156110c757604051632b37d9d160e21b815260040160405180910390fd5b6110d033613d9e565b565b6110da613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611117573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061113b9190615964565b1561115957604051632b37d9d160e21b815260040160405180910390fd5b83836111668282336130b9565b82823390919261118c57604051630c76b97b60e41b815260040161095893929190615981565b50505061119c83620f4240101590565b83906111be57604051631504950160e21b815260040161095891815260200190565b506001600160a01b038087166000908152601c60209081526040808320938916835292905290812084918660028111156111fa576111fa615a6f565b600281111561120b5761120b615a6f565b815260208101919091526040016000205583600281111561122e5761122e615a6f565b856001600160a01b0316876001600160a01b03167f3474eba30406cacbfbc5a596a7e471662bbcccf206f8d244dbb6f4cc578c52208660405161127391815260200190565b60405180910390a4505050505050565b61128b613095565b6001600160a01b0316634fc07d756040518163ffffffff1660e01b8152600401602060405180830381865afa1580156112c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112ec91906159a4565b6001600160a01b0316336001600160a01b03161461131d57604051635d9044cd60e01b815260040160405180910390fd5b6001600160a01b038216600081815260226020908152604091829020805460ff191685151590811790915591519182527f4542960abc7f2d26dab244fc440acf511e3dd0f5cefad571ca802283b4751bbb91015b60405180910390a25050565b611385613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156113c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113e69190615964565b1561140457604051632b37d9d160e21b815260040160405180910390fd5b610e6f827f000000000000000000000000000000000000000000000000000000000000000083613e79565b6000611439613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611476573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061149a9190615964565b156114b857604051632b37d9d160e21b815260040160405180910390fd5b6001600160a01b038316600090815260146020908152604080832033808552600482019093529083209192909190807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663766718086040518163ffffffff1660e01b8152600401602060405180830381865afa158015611545573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115699190615a85565b905060008360020154118015611583575082600201548110155b1561159057826001015491505b600082116115b05760405162cf4d4760e51b815260040160405180910390fd5b60006001840181905560028401556040518281526001600160a01b0386811691908a16907f1b2e7737e043c5cf1b587ceb4daeb7ae00148b9bda8f79f1093eead08f1419529060200160405180910390a361161e858361160e613565565b6001600160a01b031691906140f1565b509695505050505050565b61163161514b565b61163961514b565b6000611645858561412c565b60028101548352600381015460208401526005810154604084015260068101546060840152600701546080830152509392505050565b611683613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156116c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116e49190615964565b1561170257604051632b37d9d160e21b815260040160405180910390fd5b8160000361172357604051630a2a4e5b60e11b815260040160405180910390fd5b6117303383610a2f613565565b61173c84848484613641565b50505050565b61174a613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611787573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117ab9190615964565b156117c957604051632b37d9d160e21b815260040160405180910390fd5b82826117d68282336130b9565b806117e95750336001600160a01b038216145b82823390919261180f57604051630c76b97b60e41b815260040161095893929190615981565b50505061181c85846141b0565b6118278585856141e8565b5050505050565b6001600160a01b038084166000908152601c6020908152604080832093861683529290529081208183600281111561186857611868615a6f565b600281111561187957611879615a6f565b81526020019081526020016000205490505b9392505050565b6000610dd08484846130b9565b6118a7613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156118e4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119089190615964565b1561192657604051632b37d9d160e21b815260040160405180910390fd5b83836119338282336130b9565b82823390919261195957604051630c76b97b60e41b815260040161095893929190615981565b5050506001600160a01b038681166000908152601b60209081526040808320938916835292905220600381015487908790600160601b90046001600160401b03166119b9576040516330acea0d60e11b8152600401610958929190615a36565b50506003810154600160a01b810463ffffffff908116908716141590600160c01b90046001600160401b03908116908616141581806119f55750805b15611b0d578115611a56578663ffffffff8116620f42401015611a34576040516329bff5f560e01b815263ffffffff9091166004820152602401610958565b5060038301805463ffffffff60a01b1916600160a01b63ffffffff8a16021790555b8015611ab657601a5486906001600160401b03908116908216811015611a915760405163ee5602e160e01b8152600401610958929190615a9e565b50506003830180546001600160c01b0316600160c01b6001600160401b038916021790555b428360040181905550876001600160a01b0316896001600160a01b03167fe89cbb9d63ba60af555547b12dde6817283e88cbdd45feb2059f2ba71ea346ba8989604051611b04929190615a50565b60405180910390a35b505050505050505050565b611b20613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611b5d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b819190615964565b15611b9f57604051632b37d9d160e21b815260040160405180910390fd5b8484611bac8282336130b9565b828233909192611bd257604051630c76b97b60e41b815260040161095893929190615981565b5050506001600160a01b038616600090815260226020526040902054869060ff16611c1057604051622920f760e21b8152600401610958919061553e565b50610971878688878761317d565b600080611c2b8585613846565b90506000611c398686614328565b90506000611c4d63ffffffff8616846159d7565b90506000611c5b838361434b565b9050611c678185615a23565b98975050505050505050565b611c7b61517a565b611c8361517a565b6001600160a01b039092166000908152600e602090815260409091208054845260040154908301525090565b82806001600160a01b031663f851a4406040518163ffffffff1660e01b81526004016020604051808303816000875af1158015611cf0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d1491906159a4565b6001600160a01b0316336001600160a01b031614611d445760405162461bcd60e51b815260040161095890615ab8565b60405163623faf6160e01b81526001600160a01b0385169063623faf6190611d729086908690600401615aef565b600060405180830381600087803b158015611d8c57600080fd5b505af1158015611da0573d6000803e3d6000fd5b5050505050505050565b6000611db4613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611df1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e159190615964565b15611e3357604051632b37d9d160e21b815260040160405180910390fd5b610dd0848484613e79565b80806001600160a01b031663f851a4406040518163ffffffff1660e01b81526004016020604051808303816000875af1158015611e7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ea391906159a4565b6001600160a01b0316336001600160a01b031614611ed35760405162461bcd60e51b815260040161095890615ab8565b816001600160a01b03166359fc20bb6040518163ffffffff1660e01b8152600401600060405180830381600087803b158015611f0e57600080fd5b505af1158015610b4d573d6000803e3d6000fd5b611f2a613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611f67573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f8b9190615964565b15611fa957604051632b37d9d160e21b815260040160405180910390fd5b610a6c82826141b0565b611fbb613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611ff8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061201c9190615964565b1561203a57604051632b37d9d160e21b815260040160405180910390fd5b610cd333826141b0565b6000610a7f82614362565b604080516000815260208101909152606090826001600160401b0381111561207957612079615b1e565b6040519080825280602002602001820160405280156120ac57816020015b60608152602001906001900390816120975790505b50915060005b8381101561212e57612109308686848181106120d0576120d0615b34565b90506020028101906120e29190615b4a565b856040516020016120f593929190615b90565b6040516020818303038152906040526143d3565b83828151811061211b5761211b615b34565b60209081029190910101526001016120b2565b505092915050565b61213e613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561217b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061219f9190615964565b156121bd57604051632b37d9d160e21b815260040160405180910390fd5b6001600160a01b038316600090815260226020526040902054839060ff166121f857604051622920f760e21b8152600401610958919061553e565b50610e6f838383614449565b61220c613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612249573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061226d9190615964565b1561228b57604051632b37d9d160e21b815260040160405180910390fd5b83836122988282336130b9565b8282339091926122be57604051630c76b97b60e41b815260040161095893929190615981565b50505085846122ce8282336130b9565b8282339091926122f457604051630c76b97b60e41b815260040161095893929190615981565b505050600061230489898861387e565b9050611b0d8988836141e8565b612319613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612356573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061237a9190615964565b1561239857604051632b37d9d160e21b815260040160405180910390fd5b610e6f838383614449565b6123ab613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156123e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061240c9190615964565b1561242a57604051632b37d9d160e21b815260040160405180910390fd5b8060000361244b57604051630a2a4e5b60e11b815260040160405180910390fd5b6001600160a01b038084166000908152601b6020908152604080832093861683529281529082902082516101408101845281548152600182015492810192909252600281015492820192909252600382015463ffffffff80821660608401526001600160401b03600160201b830481166080850152600160601b8304811660a08501819052600160a01b840490921660c0850152600160c01b90920490911660e08301526004830154610100830152600590920154610120820152908490849061252a576040516330acea0d60e11b8152600401610958929190615a36565b50506000612538858561412c565b90506000816003015411858590916125655760405163b6a70b3b60e01b8152600401610958929190615a36565b50508281600201546125779190615a23565b60028201556125893384610a2f613565565b836001600160a01b0316856001600160a01b03167f673007a04e501145e79f59aea5e0413b6e88344fdaf10326254530d6a1511530856040516125ce91815260200190565b60405180910390a35050505050565b6040805160208101909152600081526040805160208101909152600081526000612607868661412c565b6001600160a01b03851660009081526004909101602052604090205482525090509392505050565b60408051608081018252600080825260208201819052918101829052606081019190915261265d8383613bc8565b604080516080810182528254815260018301546001600160401b0316602082015260028301549181019190915260039091015460608201529392505050565b6126a4613095565b6001600160a01b0316634fc07d756040518163ffffffff1660e01b8152600401602060405180830381865afa1580156126e1573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061270591906159a4565b6001600160a01b0316336001600160a01b03161461273657604051635d9044cd60e01b815260040160405180910390fd5b600d805463ffffffff191690556040517f93be484d290d119d9cf99cce69d173c732f9403333ad84f69c807b590203d10990600090a1565b60408051608081018252600080825260208201819052918101829052606081019190915261279e85858585613b5c565b604080516080810182528254815260018301546020820152600283015491810191909152600390910154606082015295945050505050565b6127de613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561281b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061283f9190615964565b1561285d57604051632b37d9d160e21b815260040160405180910390fd5b3360009081526012602052604090205460ff1615612966576040516001600160a01b038581166024830152604482018590526064820184905282811660848301526000917f00000000000000000000000000000000000000000000000000000000000000009091169060a40160408051601f198184030181529181526020820180516001600160e01b031663224451c160e11b179052516128fe9190615bb7565b600060405180830381855af49150503d8060008114612939576040519150601f19603f3d011682016040523d82523d6000602084013e61293e565b606091505b50509050806129605760405163ef370f5160e01b815260040160405180910390fd5b5061173c565b6001600160a01b0384166000908152601b6020908152604080832033808552925282209091612995878461412c565b90506000816002015483600001546129ad9190615a23565b9050806000036129d057604051630a8a55c960e31b815260040160405180910390fd5b60006129dc888361434b565b905060006129ee85600001548361434b565b90508015612be8576003850154600090612a1390839063ffffffff9081169061457916565b9050888181811015612a3a57604051632f514d5760e21b8152600401610958929190615bd3565b50508815612aa757612a4f888a61160e613565565b876001600160a01b0316876001600160a01b03168c6001600160a01b03167f95ff4196cd75fa49180ba673948ea43935f59e7c4ba101fa09b9fe0ec266d5828c604051612a9e91815260200190565b60405180910390a45b612acb612ab48a84615a10565b612abc613565565b6001600160a01b0316906145d9565b8554612ad78382615a10565b8760010154612ae691906159d7565b612af091906159ee565b60018701558554612b02908390615a10565b8655600286015415801590612b1957506001860154155b15612b3d5760006002870181905560058701805491612b3783615be1565b91905055505b6001600160a01b038b166000908152600e6020526040902060040154612b64908390615a10565b6001600160a01b038c166000908152600e60205260409020600481019190915554612b90908390615a10565b6001600160a01b038c81166000818152600e60209081526040918290209490945551858152918a169290917fe7b110f13cde981d5079ab7faa4249c5f331f5c292dbc6031969d2ce694188a3910160405180910390a3505b612bf28183615a10565b91508115612d2c5760205460ff1615612cde57612c1182612abc613565565b6002840154612c208382615a10565b8560050154612c2f91906159d7565b612c3991906159ee565b60058501556002840154612c4e908390615a10565b6002850155600684015415801590612c6857506005840154155b15612c8c5760006006850181905560078501805491612c8683615be1565b91905055505b856001600160a01b03168a6001600160a01b03167fc5d16dbb577cf07678b577232717c9a606197a014f61847e623d47fc6bf6b77184604051612cd191815260200190565b60405180910390a3612d2c565b856001600160a01b03168a6001600160a01b03167fdce44f0aeed2089c75db59f5a517b9a19a734bf0213412fa129f0d0434126b2484604051612d2391815260200190565b60405180910390a35b50505050505050505050565b612d40613095565b6001600160a01b0316634fc07d756040518163ffffffff1660e01b8152600401602060405180830381865afa158015612d7d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612da191906159a4565b6001600160a01b0316336001600160a01b031614612dd257604051635d9044cd60e01b815260040160405180910390fd5b6020805460ff191660011790556040517f2192802a8934dbf383338406b279ec7f3eccee31e58d6c0444d6dd6bfff24b3590600090a1565b612e12613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612e4f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e739190615964565b15612e9157604051632b37d9d160e21b815260040160405180910390fd5b6001600160a01b038416612eb8576040516322347d6760e21b815260040160405180910390fd5b6001600160a01b038316612edf5760405163a962605960e01b815260040160405180910390fd5b610b4d868686868686613c18565b6000612ef7613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612f34573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f589190615964565b15612f7657604051632b37d9d160e21b815260040160405180910390fd5b8383612f838282336130b9565b828233909192612fa957604051630c76b97b60e41b815260040161095893929190615981565b505050612fb7868686614621565b9695505050505050565b6000610a7c8383614328565b612fd5613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015613012573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130369190615964565b1561305457604051632b37d9d160e21b815260040160405180910390fd5b82826130618282336130b9565b82823390919261308757604051630c76b97b60e41b815260040161095893929190615981565b5050506118278585856141e8565b7f000000000000000000000000000000000000000000000000000000000000000090565b6000836001600160a01b0316826001600160a01b0316036130dc5750600161188b565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b03160361314457506001600160a01b0380841660009081526015602090815260408083209385168352929052205460ff1661188b565b506001600160a01b038084166000908152601f60209081526040808320868516845282528083209385168352929052205460ff1661188b565b6000841161319e57604051630a2a4e5b60e11b815260040160405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b031614806131e45750600d5463ffffffff16155b83906132045760405163353666ff60e01b8152600401610958919061553e565b508163ffffffff8116620f42401015613239576040516329bff5f560e01b815263ffffffff9091166004820152602401610958565b50601a5481906001600160401b0390811690821681101561326f5760405163ee5602e160e01b8152600401610958929190615a9e565b50506001600160a01b038581166000908152601b6020908152604080832093871683529290522060030154600160601b90046001600160401b0316156132c857604051632b542c0d60e11b815260040160405180910390fd5b60006132d386614362565b90508481808211156132fa5760405163ccaf28a960e01b8152600401610958929190615bd3565b505060405180610140016040528086815260200160008152602001600081526020018463ffffffff168152602001836001600160401b03168152602001426001600160401b031681526020018463ffffffff168152602001836001600160401b03168152602001600081526020016000815250601b6000886001600160a01b03166001600160a01b031681526020019081526020016000206000866001600160a01b03166001600160a01b0316815260200190815260200160002060008201518160000155602082015181600101556040820151816002015560608201518160030160006101000a81548163ffffffff021916908363ffffffff16021790555060808201518160030160046101000a8154816001600160401b0302191690836001600160401b0316021790555060a082015181600301600c6101000a8154816001600160401b0302191690836001600160401b0316021790555060c08201518160030160146101000a81548163ffffffff021916908363ffffffff16021790555060e08201518160030160186101000a8154816001600160401b0302191690836001600160401b03160217905550610100820151816004015561012082015181600501559050506000600e6000886001600160a01b03166001600160a01b0316815260200190815260200160002090508581600401546134fa9190615a23565b60048201556040805187815263ffffffff861660208201526001600160401b0385168183015290516001600160a01b0387811692908a16917f88b4c2d08cea0f01a24841ff5d14814ddb5b14ac44b05e0835fcc0dcd8c7bc259181900360600190a350505050505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b8015610e6f576040516323b872dd60e01b81526001600160a01b038381166004830152306024830152604482018390528416906323b872dd906064015b6020604051808303816000875af11580156135e5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906136099190615964565b610e6f5760405162461bcd60e51b815260206004820152600960248201526810ba3930b739b332b960b91b6044820152606401610958565b81670de0b6b3a76400008082101561366e5760405163b86d885760e01b8152600401610958929190615bd3565b50506001600160a01b038481166000908152601b602090815260408083209387168352929052206003015484908490600160601b90046001600160401b03166136cc576040516330acea0d60e11b8152600401610958929190615a36565b505060006136da858561412c565b336000908152600482016020526040902060028201549192509015158061370357506003820154155b8686909161372657604051631984edef60e31b8152600401610958929190615a36565b50506000826002015460001480613744575082600501548360020154145b905060008161377f57836005015484600201546137619190615a10565b600385015461377090886159d7565b61377a91906159ee565b613781565b855b905080158015906137925750848110155b818690916137b557604051635d88e8d160e01b8152600401610958929190615bd3565b50508584600201546137c79190615a23565b600285015560038401546137dc908290615a23565b600385015582546137ee908290615a23565b835560405133906001600160a01b0389811691908b16907f237818af8bb47710142edd8fc301fbc507064fb357cf122fb161ca447e3cb13e90613834908b908790615bd3565b60405180910390a45050505050505050565b6001600160a01b038281166000908152601b60209081526040808320938516835292905290812060018101549054610a7c9190615a10565b6001600160a01b038381166000818152601b60209081526040808320948716808452948252808320600281015460018201548351610100810185528681529485018790529284019690965260608301949094526080820181905260a0820185905260c08201869052600584015460e08301529193849290916138ff816147b3565b875492965094509250613913908590615a10565b855560028501839055600185018290556001600160a01b0389166000908152600e60205260408120600401805486929061394e908490615a10565b92505081905550876001600160a01b0316896001600160a01b03167f9008d731ddfbec70bc364780efd63057c6877bee8027c4708a104b365395885d8660405161399a91815260200190565b60405180910390a35091979650505050505050565b3360008290036139d257604051630a2a4e5b60e11b815260040160405180910390fd5b60006139dd82614362565b9050828180821115613a045760405163ccaf28a960e01b8152600401610958929190615bd3565b50506001600160a01b0382166000908152600e602052604081208054600d549192909163ffffffff1690819003613a9657613a3f8683615a10565b8355613a4e858761160e613565565b846001600160a01b03167f32eed9ebc5696170068a371fdbea4c076da1bc21b305e78ca0a5e65ee913be8387604051613a8991815260200190565b60405180910390a2610b4d565b600283015415801590613aad575082600301544310155b15613abb57613abb85613d9e565b600283015415613ae557613ae2613ad68460030154436148ad565b846002015483896148c7565b90505b858360020154613af59190615a23565b6002840155613b048143615a23565b6003840181905560028401546040516001600160a01b038816927f91642f23a1196e1424949fafa2a428c3b5d1f699763942ff08a6fbe9d4d7e98092613b4c92909190615bd3565b60405180910390a2505050505050565b6000601e6000866001811115613b7457613b74615a6f565b6001811115613b8557613b85615a6f565b8152602080820192909252604090810160009081206001600160a01b03978816825283528181209587168152948252808520939095168452919091525020919050565b6000601d6000846001811115613be057613be0615a6f565b6001811115613bf157613bf1615a6f565b81526020019081526020016000206000838152602001908152602001600020905092915050565b6000613c24878761412c565b905080600201546000141580613c3c57506003810154155b87879091613c5f57604051631984edef60e31b8152600401610958929190615a36565b5050600681015460058201546040805161010081018252600181526001600160a01b03808c1660208301528a16918101919091523360608201526080810182905260a0810183905260c08101859052600784015460e08201526000929190613cc6816147b3565b600288015492965094509250613cdd908590615a10565b600286015560068501839055600585018290558315613d91576001600160a01b03891615801590613d1657506001600160a01b03881615155b15613d2c57613d278989868a613641565b613d91565b613d39338561160e613565565b336001600160a01b03168a6001600160a01b03168c6001600160a01b03167f305f519d8909c676ffd870495d4563032eb0b506891a6dd9827490256cc9914e87604051613d8891815260200190565b60405180910390a45b5050505050505050505050565b6001600160a01b0381166000908152600e6020526040812060028101549091819003613ddd57604051630a2a4e5b60e11b815260040160405180910390fd5b600382015443811115613e0657604051631d222f1b60e31b815260040161095891815260200190565b5060006002830181905560038301558154613e22908290615a10565b8255613e31838261160e613565565b826001600160a01b03167f32eed9ebc5696170068a371fdbea4c076da1bc21b305e78ca0a5e65ee913be8382604051613e6c91815260200190565b60405180910390a2505050565b6000808211613e9b57604051637318ad9960e01b815260040160405180910390fd5b6000613ea7858561412c565b33600090815260048201602052604090208054919250908480821015613ee25760405163ab99793560e01b8152600401610958929190615bd3565b5050600282015486908690613f0c57604051631984edef60e31b8152600401610958929190615a36565b50506000826003015483600501548460020154613f299190615a10565b613f3390876159d7565b613f3d91906159ee565b905060008360050154600014613f705760058401546006850154613f6190846159d7565b613f6b91906159ee565b613f72565b815b6001600160a01b038981166000908152601b60209081526040808320938c1683529290529081206003015491925090613fbb90600160201b90046001600160401b031642615a23565b9050828560050154613fcd9190615a23565b60058601556006850154613fe2908390615a23565b60068601556003850154613ff7908890615a10565b60038601558354614009908890615a10565b8085551561407557600085600301548660050154876002015461402c9190615a10565b865461403891906159d7565b61404291906159ee565b905080670de0b6b3a7640000808210156140715760405163587ab9ab60e11b8152600401610958929190615bd3565b5050505b600061408b60018b8b3387878c6007015461491b565b9050336001600160a01b0316896001600160a01b03168b6001600160a01b03167f0525d6ad1aa78abc571b5c1984b5e1ea4f1412368c1cc348ca408dbb1085c9a1878c6040516140dc929190615bd3565b60405180910390a49998505050505050505050565b8015610e6f5760405163a9059cbb60e01b81526001600160a01b0383811660048301526024820183905284169063a9059cbb906044016135c6565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b03160361418557506001600160a01b0382166000908152601460205260409020610a7f565b506001600160a01b038083166000908152602160209081526040808320938516835292905220610a7f565b806000036141d157604051630a2a4e5b60e11b815260040160405180910390fd5b6141de3382610a2f613565565b610a6c8282614ac1565b8060000361420957604051630a2a4e5b60e11b815260040160405180910390fd5b6001600160a01b038381166000908152601b60209081526040808320938616835292905220600381015484908490600160601b90046001600160401b0316614266576040516330acea0d60e11b8152600401610958929190615a36565b5050600061427385614362565b905082818082111561429a5760405163ccaf28a960e01b8152600401610958929190615bd3565b505081546142a9908490615a23565b82556001600160a01b0385166000908152600e60205260409020600401546142d2908490615a23565b6001600160a01b038681166000818152600e602090815260409182902060040194909455518681529187169290917feaf6ea3a42ed2fd1b6d575f818cbda593af9524aa94bd30e65302ac4dc23474591016125ce565b600080614335848461412c565b905080600501548160020154610dd09190615a10565b60008183111561435b5781610a7c565b5090919050565b6001600160a01b0381166000908152600e6020526040812060028101546001820154600490920154839261439591615a23565b61439f9190615a23565b6001600160a01b0384166000908152600e60205260409020549091508181116143c9576000610dd0565b610dd08282615a10565b6060600080846001600160a01b0316846040516143f09190615bb7565b600060405180830381855af49150503d806000811461442b576040519150601f19603f3d011682016040523d82523d6000602084013e614430565b606091505b5091509150614440858383614b34565b95945050505050565b336001600160a01b0383160361447257604051630123065360e01b815260040160405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b0316036144df573360009081526015602090815260408083206001600160a01b03861684529091529020805460ff191682151517905561451b565b336000908152601f602090815260408083206001600160a01b03878116855290835281842090861684529091529020805460ff19168215151790555b816001600160a01b0316836001600160a01b0316336001600160a01b03167faa5a59b38e8f68292982382bf635c2f263ca37137bbc52956acd808fd7bf976f8460405161456c911515815260200190565b60405180910390a4505050565b600061458883620f4240101590565b8061459b575061459b82620f4240101590565b838390916145be5760405163768bf0eb60e11b8152600401610958929190615bd3565b50620f424090506145cf83856159d7565b610a7c91906159ee565b8015610a6c57604051630852cd8d60e31b8152600481018290526001600160a01b038316906342966c6890602401600060405180830381600087803b158015611f0e57600080fd5b60008160000361464457604051630a2a4e5b60e11b815260040160405180910390fd5b60006146508585613846565b90508083808210156146775760405163587ab9ab60e11b8152600401610958929190615bd3565b50506001600160a01b038086166000908152601b6020908152604080832093881683529290529081206001810154909190156146ec578160010154600183600101548785600201546146c991906159d7565b6146d39190615a23565b6146dd9190615a10565b6146e791906159ee565b6146ee565b845b600383015490915060009061471390600160201b90046001600160401b031642615a23565b90508183600201546147259190615a23565b6002840155600183015461473a908790615a23565b8360010181905550600061475860008a8a8c87878a6005015461491b565b9050876001600160a01b0316896001600160a01b03167f3b81913739097ced1e7fa748c6058d34e2c00b961fb501094543b397b198fdaa8960405161479f91815260200190565b60405180910390a398975050505050505050565b6000806000806147d58560000151866020015187604001518860600151613b5c565b905060008160030154116147fc576040516307e332c560e31b815260040160405180910390fd5b60006148088683614b87565b905085604001516001600160a01b031686602001516001600160a01b03168760000151600181111561483c5761483c615a6f565b6060808a01518551602080880151604080516001600160a01b039095168552918401929092528201527f86c2f162872d7c46d7ee0caad366da6dc430889b9d8f27e4bed3785548f9954b910160405180910390a4602081015160408201516060909201519097919650945092505050565b60008183116148bd576000610a7c565b610a7c8284615a10565b60006148d38285615a23565b60016148df8487615a23565b6148e99190615a10565b6148f384866159d7565b6148fd87896159d7565b6149079190615a23565b6149119190615a23565b61444091906159ee565b60008360000361493e57604051637318ad9960e01b815260040160405180910390fd5b600061494c89898989613b5c565b90506103e88160030154106149745760405163332b852b60e11b815260040160405180910390fd5b60028101546040516001600160601b031960608b811b821660208401528a811b8216603484015289901b166048820152605c810191909152600090607c0160405160208183030381529060405280519060200120905060006149d68b83613bc8565b8781556001810180546001600160401b0319166001600160401b03891617905560006002820155600380820187905584015490915015614a245781614a1f8c8560010154613bc8565b600201555b614a2e8383614c82565b886001600160a01b03168a6001600160a01b03168c6001811115614a5457614a54615a6f565b604080516001600160a01b038d168152602081018c90526001600160401b038b168183015260608101879052608081018a905290517f036538df4a591a5cc74b68cfc7f8c61e8173dbc81627e1d62600b61e820461789181900360a00190a4509998505050505050505050565b6001600160a01b0382166000908152600e6020526040902054614ae5908290615a23565b6001600160a01b0383166000818152600e6020526040908190209290925590517f48c384dd8bdf1e06d8afecd810c4acfc3d553ac5d879dec5a69875dbbd90e14b906113719084815260200190565b606082614b4957614b4482614d15565b61188b565b8151158015614b6057506001600160a01b0384163b155b15614b805783604051639996b31560e01b8152600401610958919061553e565b508061188b565b614bb26040518060800160405280600081526020016000815260200160008152602001600081525090565b615194614bc28460000151614d3e565b9050615194614bd48560000151614da3565b905060008560000151600087608001518860a001518960e00151604051602001614c02959493929190615bfa565b6040516020818303038152906040529050600080614c3785614dea86868c60c001518c614f5a9095949392919063ffffffff16565b91509150600080600083806020019051810190614c549190615c3d565b60408051608081018252998a5260208a019390935291880152606087015250939a9950505050505050505050565b612710826003015410614ca8576040516303a8c56b60e61b815260040160405180910390fd5b80614cc657604051638f4a893d60e01b815260040160405180910390fd5b6001808301829055600283018054600090614ce2908490615a23565b90915550506003820154600003614cf7578082555b6001826003016000828254614d0c9190615a23565b90915550505050565b805115614d255780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b6151946000826001811115614d5557614d55615a6f565b03614d635750615014919050565b6001826001811115614d7757614d77615a6f565b03614d855750615056919050565b604051636bd1fba760e11b815260040160405180910390fd5b919050565b6151946000826001811115614dba57614dba615a6f565b03614dc85750615062919050565b6001826001811115614ddc57614ddc615a6f565b03614d8557506150b9919050565b60006060600080600080600087806020019051810190614e0a9190615c7c565b945094509450945094506000614e20868b613bc8565b6001810154909150426001600160401b039091161115614e5b5760016040518060200160405280600081525097509750505050505050614f53565b600381015460009083148015614eae5782548590614e7a9088906159d7565b614e8491906159ee565b9150614e908287615a10565b8354909650614e9f9086615a10565b9450614eab8288615a23565b96505b8b886001811115614ec157614ec1615a6f565b845460018601546040805187815260208101939093526001600160401b03909116828201528415156060830152517f469e89d0a4e0e5deb2eb1ade5b3fa67fdfbeb4787c3a7c1e8e89aaf28562cab29181900360800190a38787878787604051602001614f32959493929190615bfa565b6040516020818303038152906040529a5060008b9950995050505050505050505b9250929050565b600060608760030154831115614f8357604051634a411b9d60e11b815260040160405180910390fd5b60008315614f915783614f97565b88600301545b89549094505b8015801590614fac5750600085115b1561500557600080614fc283898c63ffffffff16565b915091508115614fd3575050615005565b965086614fe18c8c8b6150c4565b925086614fed81615cc5565b9750508380614ffb90615be1565b9450505050614f9d565b50989397509295505050505050565b6000601d81805b600181111561502c5761502c615a6f565b81526020019081526020016000206000838152602001908152602001600020600201549050919050565b6000601d81600161501b565b601d6000805b600181111561507957615079615a6f565b8152602080820192909252604090810160009081209381529290915281208181556001810180546001600160401b03191690556002810182905560030155565b601d60006001615068565b6000808460030154116150ea5760405163ddaf8f2160e01b815260040160405180910390fd5b60006150fd85600001548563ffffffff16565b905061511085600001548463ffffffff16565b60018560030160008282546151259190615a10565b9091555050808555600385015460000361514157600060018601555b5050915492915050565b6040518060a0016040528060008152602001600081526020016000815260200160008152602001600081525090565b604051806040016040528060008152602001600081525090565b6110d0615cdc565b6001600160a01b0381168114610cd357600080fd5b803563ffffffff81168114614d9e57600080fd5b80356001600160401b0381168114614d9e57600080fd5b600080600080600060a086880312156151f457600080fd5b85356151ff8161519c565b9450602086013561520f8161519c565b935060408601359250615224606087016151b1565b9150615232608087016151c5565b90509295509295909350565b6000806040838503121561525157600080fd5b823561525c8161519c565b946020939093013593505050565b6000806040838503121561527d57600080fd5b82356152888161519c565b915060208301356152988161519c565b809150509250929050565b6000806000606084860312156152b857600080fd5b83356152c38161519c565b925060208401356152d38161519c565b929592945050506040919091013590565b6000602082840312156152f657600080fd5b610a7c826151c5565b6000610140820190508251825260208301516020830152604083015160408301526060830151615337606084018263ffffffff169052565b50608083015161535260808401826001600160401b03169052565b5060a083015161536d60a08401826001600160401b03169052565b5060c083015161538560c084018263ffffffff169052565b5060e08301516153a060e08401826001600160401b03169052565b5061010083015161010083015261012083015161012083015292915050565b6000602082840312156153d157600080fd5b5035919050565b60028110610cd357600080fd5b600080600080608085870312156153fb57600080fd5b8435615406816153d8565b935060208501356154168161519c565b925060408501356154268161519c565b915060608501356154368161519c565b939692955090935050565b60006020828403121561545357600080fd5b813561188b8161519c565b803560038110614d9e57600080fd5b6000806000806080858703121561548357600080fd5b843561548e8161519c565b9350602085013561549e8161519c565b92506154ac6040860161545e565b9396929550929360600135925050565b8015158114610cd357600080fd5b600080604083850312156154dd57600080fd5b82356154e88161519c565b91506020830135615298816154bc565b6000806000806080858703121561550e57600080fd5b84356155198161519c565b935060208501356155298161519c565b93969395505050506040820135916060013590565b6001600160a01b0391909116815260200190565b60008060006060848603121561556757600080fd5b83356155728161519c565b925060208401356155828161519c565b91506155906040850161545e565b90509250925092565b6000806000606084860312156155ae57600080fd5b83356155b98161519c565b925060208401356155c98161519c565b915060408401356155d98161519c565b809150509250925092565b600080600080608085870312156155fa57600080fd5b84356156058161519c565b935060208501356156158161519c565b9250615623604086016151b1565b9150615631606086016151c5565b905092959194509250565b60008060006060848603121561565157600080fd5b833561565c8161519c565b9250602084013561566c8161519c565b9150615590604085016151b1565b60008060006040848603121561568f57600080fd5b833561569a8161519c565b925060208401356001600160401b038111156156b557600080fd5b8401601f810186136156c657600080fd5b80356001600160401b038111156156dc57600080fd5b8660208284010111156156ee57600080fd5b939660209190910195509293505050565b6000806020838503121561571257600080fd5b82356001600160401b0381111561572857600080fd5b8301601f8101851361573957600080fd5b80356001600160401b0381111561574f57600080fd5b8560208260051b840101111561576457600080fd5b6020919091019590945092505050565b60005b8381101561578f578181015183820152602001615777565b50506000910152565b6000602082016020835280845180835260408501915060408160051b86010192506020860160005b8281101561580c57603f19878603018452815180518087526157e9816020890160208501615774565b601f01601f191695909501602090810195509384019391909101906001016157c0565b50929695505050505050565b60008060006060848603121561582d57600080fd5b83356158388161519c565b925060208401356158488161519c565b915060408401356155d9816154bc565b6000806000806080858703121561586e57600080fd5b84356158798161519c565b935060208501356158898161519c565b925060408501356154ac8161519c565b600080604083850312156158ac57600080fd5b823561525c816153d8565b600080600080608085870312156158cd57600080fd5b84356158d88161519c565b9350602085013592506040850135915060608501356154368161519c565b60008060008060008060c0878903121561590f57600080fd5b863561591a8161519c565b9550602087013561592a8161519c565b9450604087013561593a8161519c565b9350606087013561594a8161519c565b9598949750929560808101359460a0909101359350915050565b60006020828403121561597657600080fd5b815161188b816154bc565b6001600160a01b0393841681529183166020830152909116604082015260600190565b6000602082840312156159b657600080fd5b815161188b8161519c565b634e487b7160e01b600052601160045260246000fd5b8082028115828204841417610a7f57610a7f6159c1565b600082615a0b57634e487b7160e01b600052601260045260246000fd5b500490565b81810381811115610a7f57610a7f6159c1565b80820180821115610a7f57610a7f6159c1565b6001600160a01b0392831681529116602082015260400190565b63ffffffff9290921682526001600160401b0316602082015260400190565b634e487b7160e01b600052602160045260246000fd5b600060208284031215615a9757600080fd5b5051919050565b6001600160401b0392831681529116602082015260400190565b6020808252601e908201527f43616c6c6572206d757374206265207468652070726f78792061646d696e0000604082015260600190565b60208152816020820152818360408301376000818301604090810191909152601f909201601f19160101919050565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112615b6157600080fd5b8301803591506001600160401b03821115615b7b57600080fd5b602001915036819003821315614f5357600080fd5b828482376000838201600081528351615bad818360208801615774565b0195945050505050565b60008251615bc9818460208701615774565b9190910192915050565b918252602082015260400190565b600060018201615bf357615bf36159c1565b5060010190565b60a0810160028710615c1c57634e487b7160e01b600052602160045260246000fd5b95815260208101949094526040840192909252606083015260809091015290565b60008060008060808587031215615c5357600080fd5b8451615c5e816153d8565b60208601516040870151606090970151919890975090945092505050565b600080600080600060a08688031215615c9457600080fd5b8551615c9f816153d8565b602087015160408801516060890151608090990151929a91995097965090945092505050565b600081615cd457615cd46159c1565b506000190190565b634e487b7160e01b600052605160045260246000fdfea2646970667358221220f5046670ab269f9c179f41df4a02cd9c6b2ca3d5d507e2b9fcf15f800f351d8b64736f6c634300081b0033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106102565760003560e01c8063872d048911610142578063872d0489146106225780638cc01c86146106355780639ce7abe514610663578063a02b942614610676578063a2594d8214610689578063a2a317221461069c578063a694fc3a146106af578063a784d498146106c2578063ac9650d8146106d5578063ad4d35b5146106f5578063ae4fe67a14610708578063ba7fb0b414610734578063bc735d9014610747578063ca94b0e91461075a578063ccebcabb1461076d578063d48de8451461078f578063e473522a146107de578063e56f8a1d146107e6578063e76fede61461082c578063ef58bd671461083f578063f64b359814610847578063f93f1cd01461085a578063fb744cc01461086d578063fc54fb2714610880578063fecc9cc11461088b57610256565b8063010167e51461029f578063026e402b146102b257806308ce5f68146102c557806321195373146102eb578063259bc435146102fe57806325d9897e146103115780632e17de78146104395780632f7cc5011461044c57806339514ad21461045f5780633993d8491461047a5780633a78b7321461048d5780633ccfd60b146104a057806342c51693146104a85780634ca7ac22146104bb5780634d99dd16146104ce57806351a60b02146104e1578063561285e4146104f45780636230001a1461054957806366ee1b281461055c578063746120921461058a5780637573ef4f1461059d5780637a766460146105b05780637c145cc7146105d957806381e21b56146105fc57806382d66cb81461060f575b6040517f00000000000000000000000000000000000000000000000000000000000000009036600082376000803683855af43d806000843e818015610299578184f35b8184fd5b005b61029d6102ad3660046151dc565b61089e565b61029d6102c036600461523e565b61097a565b6102d86102d336600461526a565b610a70565b6040519081526020015b60405180910390f35b61029d6102f93660046152a3565b610a85565b61029d61030c3660046152e4565b610b55565b61042c61031f36600461526a565b6040805161014081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101829052610120810191909152506001600160a01b039182166000908152601b6020908152604080832093909416825291825282902082516101408101845281548152600182015492810192909252600281015492820192909252600382015463ffffffff8082166060840152600160201b82046001600160401b039081166080850152600160601b8304811660a0850152600160a01b830490911660c0840152600160c01b9091041660e0820152600482015461010082015260059091015461012082015290565b6040516102e291906152ff565b61029d6104473660046153bf565b610c43565b6102d861045a3660046153e5565b610cd6565b601a546040516001600160401b0390911681526020016102e2565b61029d6104883660046152a3565b610dd8565b61029d61049b366004615441565b610e74565b61029d611040565b61029d6104b636600461546d565b6110d2565b61029d6104c93660046154ca565b611283565b61029d6104dc36600461523e565b61137d565b6102d86104ef36600461526a565b61142f565b61050761050236600461526a565b611629565b6040516102e29190600060a082019050825182526020830151602083015260408301516040830152606083015160608301526080830151608083015292915050565b61029d6105573660046154f8565b61167b565b7f00000000000000000000000000000000000000000000000000000000000000006040516102e2919061553e565b61029d6105983660046152a3565b611742565b6102d86105ab366004615552565b61182e565b6102d86105be366004615441565b6001600160a01b03166000908152600e602052604090205490565b6105ec6105e7366004615599565b611892565b60405190151581526020016102e2565b61029d61060a3660046155e4565b61189f565b61029d61061d3660046151dc565b611b18565b6102d861063036600461563c565b611c1e565b610648610643366004615441565b611c73565b604080518251815260209283015192810192909252016102e2565b61029d61067136600461567a565b611caf565b6102d86106843660046152a3565b611daa565b61029d610697366004615441565b611e3e565b61029d6106aa36600461523e565b611f22565b61029d6106bd3660046153bf565b611fb3565b6102d86106d0366004615441565b612044565b6106e86106e33660046156ff565b61204f565b6040516102e29190615798565b61029d610703366004615818565b612136565b6105ec610716366004615441565b6001600160a01b031660009081526022602052604090205460ff1690565b61029d610742366004615858565b612204565b61029d610755366004615818565b612311565b61029d6107683660046152a3565b6123a3565b61078061077b366004615599565b6125dd565b604051905181526020016102e2565b6107a261079d366004615899565b61262f565b6040516102e29190815181526020808301516001600160401b031690820152604080830151908201526060918201519181019190915260800190565b61029d61269c565b6107f96107f43660046153e5565b61276e565b6040516102e291908151815260208083015190820152604080830151908201526060918201519181019190915260800190565b61029d61083a3660046158b7565b6127d6565b61029d612d38565b61029d6108553660046158f6565b612e0a565b6102d86108683660046152a3565b612eed565b6102d861087b36600461526a565b612fc1565b60205460ff166105ec565b61029d6108993660046152a3565b612fcd565b6108a6613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108e3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109079190615964565b1561092557604051632b37d9d160e21b815260040160405180910390fd5b84846109328282336130b9565b82823390919261096157604051630c76b97b60e41b815260040161095893929190615981565b60405180910390fd5b505050610971878688878761317d565b50505050505050565b610982613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156109bf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109e39190615964565b15610a0157604051632b37d9d160e21b815260040160405180910390fd5b80600003610a2257604051630a2a4e5b60e11b815260040160405180910390fd5b610a3f3382610a2f613565565b6001600160a01b03169190613589565b610a6c827f0000000000000000000000000000000000000000000000000000000000000000836000613641565b5050565b6000610a7c8383613846565b90505b92915050565b8282610a928282336130b9565b828233909192610ab857604051630c76b97b60e41b815260040161095893929190615981565b505050610ac3613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b00573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b249190615964565b15610b4257604051632b37d9d160e21b815260040160405180910390fd5b610b4d85858561387e565b505050505050565b610b5d613095565b6001600160a01b0316634fc07d756040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b9a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bbe91906159a4565b6001600160a01b0316336001600160a01b031614610bef57604051635d9044cd60e01b815260040160405180910390fd5b601a80546001600160401b0319166001600160401b0383169081179091556040519081527fe8526be46fa99b6313d439293c9be3491ffb067741bc8fce9d30c270cbb8459f9060200160405180910390a150565b610c4b613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c88573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cac9190615964565b15610cca57604051632b37d9d160e21b815260040160405180910390fd5b610cd3816139af565b50565b600080610ce586868686613b5c565b90508060030154600003610cfd576000915050610dd0565b6001600160a01b038086166000908152601b6020908152604080832093881683529290529081206001810154600282015484545b8015610dc7576000610d438c83613bc8565b90508460050154816003015403610dbc576001810154426001600160401b0390911611610db657600083858360000154610d7d91906159d7565b610d8791906159ee565b9050610d938186615a10565b8254909550610da29085615a10565b9350610dae8188615a23565b965050610dbc565b50610dc7565b600201549050610d31565b50929450505050505b949350505050565b610de0613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e1d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e419190615964565b15610e5f57604051632b37d9d160e21b815260040160405180910390fd5b610e6f8383600080600086613c18565b505050565b610e7c613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610eb9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610edd9190615964565b15610efb57604051632b37d9d160e21b815260040160405180910390fd5b6001600160a01b0381166000908152601b60209081526040808320338085529252909120600381015483908390600160601b90046001600160401b0316610f57576040516330acea0d60e11b8152600401610958929190615a36565b50506003810154600160a01b810463ffffffff9081169116141580610f9a57506003810154600160c01b81046001600160401b03908116600160201b9092041614155b15610e6f57600381018054600160201b6001600160401b03600160c01b63ffffffff19841663ffffffff600160a01b8604811691821792909204831684026001600160601b03199095161793909317938490556040516001600160a01b0380881695908916947fa4c005afae9298a5ca51e7710c334ac406fb3d914588ade970850f917cedb1c694611033949183169392041690615a50565b60405180910390a3505050565b611048613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611085573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110a99190615964565b156110c757604051632b37d9d160e21b815260040160405180910390fd5b6110d033613d9e565b565b6110da613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611117573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061113b9190615964565b1561115957604051632b37d9d160e21b815260040160405180910390fd5b83836111668282336130b9565b82823390919261118c57604051630c76b97b60e41b815260040161095893929190615981565b50505061119c83620f4240101590565b83906111be57604051631504950160e21b815260040161095891815260200190565b506001600160a01b038087166000908152601c60209081526040808320938916835292905290812084918660028111156111fa576111fa615a6f565b600281111561120b5761120b615a6f565b815260208101919091526040016000205583600281111561122e5761122e615a6f565b856001600160a01b0316876001600160a01b03167f3474eba30406cacbfbc5a596a7e471662bbcccf206f8d244dbb6f4cc578c52208660405161127391815260200190565b60405180910390a4505050505050565b61128b613095565b6001600160a01b0316634fc07d756040518163ffffffff1660e01b8152600401602060405180830381865afa1580156112c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112ec91906159a4565b6001600160a01b0316336001600160a01b03161461131d57604051635d9044cd60e01b815260040160405180910390fd5b6001600160a01b038216600081815260226020908152604091829020805460ff191685151590811790915591519182527f4542960abc7f2d26dab244fc440acf511e3dd0f5cefad571ca802283b4751bbb91015b60405180910390a25050565b611385613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156113c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113e69190615964565b1561140457604051632b37d9d160e21b815260040160405180910390fd5b610e6f827f000000000000000000000000000000000000000000000000000000000000000083613e79565b6000611439613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611476573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061149a9190615964565b156114b857604051632b37d9d160e21b815260040160405180910390fd5b6001600160a01b038316600090815260146020908152604080832033808552600482019093529083209192909190807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663766718086040518163ffffffff1660e01b8152600401602060405180830381865afa158015611545573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115699190615a85565b905060008360020154118015611583575082600201548110155b1561159057826001015491505b600082116115b05760405162cf4d4760e51b815260040160405180910390fd5b60006001840181905560028401556040518281526001600160a01b0386811691908a16907f1b2e7737e043c5cf1b587ceb4daeb7ae00148b9bda8f79f1093eead08f1419529060200160405180910390a361161e858361160e613565565b6001600160a01b031691906140f1565b509695505050505050565b61163161514b565b61163961514b565b6000611645858561412c565b60028101548352600381015460208401526005810154604084015260068101546060840152600701546080830152509392505050565b611683613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156116c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116e49190615964565b1561170257604051632b37d9d160e21b815260040160405180910390fd5b8160000361172357604051630a2a4e5b60e11b815260040160405180910390fd5b6117303383610a2f613565565b61173c84848484613641565b50505050565b61174a613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611787573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117ab9190615964565b156117c957604051632b37d9d160e21b815260040160405180910390fd5b82826117d68282336130b9565b806117e95750336001600160a01b038216145b82823390919261180f57604051630c76b97b60e41b815260040161095893929190615981565b50505061181c85846141b0565b6118278585856141e8565b5050505050565b6001600160a01b038084166000908152601c6020908152604080832093861683529290529081208183600281111561186857611868615a6f565b600281111561187957611879615a6f565b81526020019081526020016000205490505b9392505050565b6000610dd08484846130b9565b6118a7613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156118e4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119089190615964565b1561192657604051632b37d9d160e21b815260040160405180910390fd5b83836119338282336130b9565b82823390919261195957604051630c76b97b60e41b815260040161095893929190615981565b5050506001600160a01b038681166000908152601b60209081526040808320938916835292905220600381015487908790600160601b90046001600160401b03166119b9576040516330acea0d60e11b8152600401610958929190615a36565b50506003810154600160a01b810463ffffffff908116908716141590600160c01b90046001600160401b03908116908616141581806119f55750805b15611b0d578115611a56578663ffffffff8116620f42401015611a34576040516329bff5f560e01b815263ffffffff9091166004820152602401610958565b5060038301805463ffffffff60a01b1916600160a01b63ffffffff8a16021790555b8015611ab657601a5486906001600160401b03908116908216811015611a915760405163ee5602e160e01b8152600401610958929190615a9e565b50506003830180546001600160c01b0316600160c01b6001600160401b038916021790555b428360040181905550876001600160a01b0316896001600160a01b03167fe89cbb9d63ba60af555547b12dde6817283e88cbdd45feb2059f2ba71ea346ba8989604051611b04929190615a50565b60405180910390a35b505050505050505050565b611b20613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611b5d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b819190615964565b15611b9f57604051632b37d9d160e21b815260040160405180910390fd5b8484611bac8282336130b9565b828233909192611bd257604051630c76b97b60e41b815260040161095893929190615981565b5050506001600160a01b038616600090815260226020526040902054869060ff16611c1057604051622920f760e21b8152600401610958919061553e565b50610971878688878761317d565b600080611c2b8585613846565b90506000611c398686614328565b90506000611c4d63ffffffff8616846159d7565b90506000611c5b838361434b565b9050611c678185615a23565b98975050505050505050565b611c7b61517a565b611c8361517a565b6001600160a01b039092166000908152600e602090815260409091208054845260040154908301525090565b82806001600160a01b031663f851a4406040518163ffffffff1660e01b81526004016020604051808303816000875af1158015611cf0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d1491906159a4565b6001600160a01b0316336001600160a01b031614611d445760405162461bcd60e51b815260040161095890615ab8565b60405163623faf6160e01b81526001600160a01b0385169063623faf6190611d729086908690600401615aef565b600060405180830381600087803b158015611d8c57600080fd5b505af1158015611da0573d6000803e3d6000fd5b5050505050505050565b6000611db4613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611df1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e159190615964565b15611e3357604051632b37d9d160e21b815260040160405180910390fd5b610dd0848484613e79565b80806001600160a01b031663f851a4406040518163ffffffff1660e01b81526004016020604051808303816000875af1158015611e7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ea391906159a4565b6001600160a01b0316336001600160a01b031614611ed35760405162461bcd60e51b815260040161095890615ab8565b816001600160a01b03166359fc20bb6040518163ffffffff1660e01b8152600401600060405180830381600087803b158015611f0e57600080fd5b505af1158015610b4d573d6000803e3d6000fd5b611f2a613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611f67573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f8b9190615964565b15611fa957604051632b37d9d160e21b815260040160405180910390fd5b610a6c82826141b0565b611fbb613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611ff8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061201c9190615964565b1561203a57604051632b37d9d160e21b815260040160405180910390fd5b610cd333826141b0565b6000610a7f82614362565b604080516000815260208101909152606090826001600160401b0381111561207957612079615b1e565b6040519080825280602002602001820160405280156120ac57816020015b60608152602001906001900390816120975790505b50915060005b8381101561212e57612109308686848181106120d0576120d0615b34565b90506020028101906120e29190615b4a565b856040516020016120f593929190615b90565b6040516020818303038152906040526143d3565b83828151811061211b5761211b615b34565b60209081029190910101526001016120b2565b505092915050565b61213e613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561217b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061219f9190615964565b156121bd57604051632b37d9d160e21b815260040160405180910390fd5b6001600160a01b038316600090815260226020526040902054839060ff166121f857604051622920f760e21b8152600401610958919061553e565b50610e6f838383614449565b61220c613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612249573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061226d9190615964565b1561228b57604051632b37d9d160e21b815260040160405180910390fd5b83836122988282336130b9565b8282339091926122be57604051630c76b97b60e41b815260040161095893929190615981565b50505085846122ce8282336130b9565b8282339091926122f457604051630c76b97b60e41b815260040161095893929190615981565b505050600061230489898861387e565b9050611b0d8988836141e8565b612319613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612356573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061237a9190615964565b1561239857604051632b37d9d160e21b815260040160405180910390fd5b610e6f838383614449565b6123ab613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156123e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061240c9190615964565b1561242a57604051632b37d9d160e21b815260040160405180910390fd5b8060000361244b57604051630a2a4e5b60e11b815260040160405180910390fd5b6001600160a01b038084166000908152601b6020908152604080832093861683529281529082902082516101408101845281548152600182015492810192909252600281015492820192909252600382015463ffffffff80821660608401526001600160401b03600160201b830481166080850152600160601b8304811660a08501819052600160a01b840490921660c0850152600160c01b90920490911660e08301526004830154610100830152600590920154610120820152908490849061252a576040516330acea0d60e11b8152600401610958929190615a36565b50506000612538858561412c565b90506000816003015411858590916125655760405163b6a70b3b60e01b8152600401610958929190615a36565b50508281600201546125779190615a23565b60028201556125893384610a2f613565565b836001600160a01b0316856001600160a01b03167f673007a04e501145e79f59aea5e0413b6e88344fdaf10326254530d6a1511530856040516125ce91815260200190565b60405180910390a35050505050565b6040805160208101909152600081526040805160208101909152600081526000612607868661412c565b6001600160a01b03851660009081526004909101602052604090205482525090509392505050565b60408051608081018252600080825260208201819052918101829052606081019190915261265d8383613bc8565b604080516080810182528254815260018301546001600160401b0316602082015260028301549181019190915260039091015460608201529392505050565b6126a4613095565b6001600160a01b0316634fc07d756040518163ffffffff1660e01b8152600401602060405180830381865afa1580156126e1573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061270591906159a4565b6001600160a01b0316336001600160a01b03161461273657604051635d9044cd60e01b815260040160405180910390fd5b600d805463ffffffff191690556040517f93be484d290d119d9cf99cce69d173c732f9403333ad84f69c807b590203d10990600090a1565b60408051608081018252600080825260208201819052918101829052606081019190915261279e85858585613b5c565b604080516080810182528254815260018301546020820152600283015491810191909152600390910154606082015295945050505050565b6127de613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561281b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061283f9190615964565b1561285d57604051632b37d9d160e21b815260040160405180910390fd5b3360009081526012602052604090205460ff1615612966576040516001600160a01b038581166024830152604482018590526064820184905282811660848301526000917f00000000000000000000000000000000000000000000000000000000000000009091169060a40160408051601f198184030181529181526020820180516001600160e01b031663224451c160e11b179052516128fe9190615bb7565b600060405180830381855af49150503d8060008114612939576040519150601f19603f3d011682016040523d82523d6000602084013e61293e565b606091505b50509050806129605760405163ef370f5160e01b815260040160405180910390fd5b5061173c565b6001600160a01b0384166000908152601b6020908152604080832033808552925282209091612995878461412c565b90506000816002015483600001546129ad9190615a23565b9050806000036129d057604051630a8a55c960e31b815260040160405180910390fd5b60006129dc888361434b565b905060006129ee85600001548361434b565b90508015612be8576003850154600090612a1390839063ffffffff9081169061457916565b9050888181811015612a3a57604051632f514d5760e21b8152600401610958929190615bd3565b50508815612aa757612a4f888a61160e613565565b876001600160a01b0316876001600160a01b03168c6001600160a01b03167f95ff4196cd75fa49180ba673948ea43935f59e7c4ba101fa09b9fe0ec266d5828c604051612a9e91815260200190565b60405180910390a45b612acb612ab48a84615a10565b612abc613565565b6001600160a01b0316906145d9565b8554612ad78382615a10565b8760010154612ae691906159d7565b612af091906159ee565b60018701558554612b02908390615a10565b8655600286015415801590612b1957506001860154155b15612b3d5760006002870181905560058701805491612b3783615be1565b91905055505b6001600160a01b038b166000908152600e6020526040902060040154612b64908390615a10565b6001600160a01b038c166000908152600e60205260409020600481019190915554612b90908390615a10565b6001600160a01b038c81166000818152600e60209081526040918290209490945551858152918a169290917fe7b110f13cde981d5079ab7faa4249c5f331f5c292dbc6031969d2ce694188a3910160405180910390a3505b612bf28183615a10565b91508115612d2c5760205460ff1615612cde57612c1182612abc613565565b6002840154612c208382615a10565b8560050154612c2f91906159d7565b612c3991906159ee565b60058501556002840154612c4e908390615a10565b6002850155600684015415801590612c6857506005840154155b15612c8c5760006006850181905560078501805491612c8683615be1565b91905055505b856001600160a01b03168a6001600160a01b03167fc5d16dbb577cf07678b577232717c9a606197a014f61847e623d47fc6bf6b77184604051612cd191815260200190565b60405180910390a3612d2c565b856001600160a01b03168a6001600160a01b03167fdce44f0aeed2089c75db59f5a517b9a19a734bf0213412fa129f0d0434126b2484604051612d2391815260200190565b60405180910390a35b50505050505050505050565b612d40613095565b6001600160a01b0316634fc07d756040518163ffffffff1660e01b8152600401602060405180830381865afa158015612d7d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612da191906159a4565b6001600160a01b0316336001600160a01b031614612dd257604051635d9044cd60e01b815260040160405180910390fd5b6020805460ff191660011790556040517f2192802a8934dbf383338406b279ec7f3eccee31e58d6c0444d6dd6bfff24b3590600090a1565b612e12613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612e4f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e739190615964565b15612e9157604051632b37d9d160e21b815260040160405180910390fd5b6001600160a01b038416612eb8576040516322347d6760e21b815260040160405180910390fd5b6001600160a01b038316612edf5760405163a962605960e01b815260040160405180910390fd5b610b4d868686868686613c18565b6000612ef7613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612f34573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f589190615964565b15612f7657604051632b37d9d160e21b815260040160405180910390fd5b8383612f838282336130b9565b828233909192612fa957604051630c76b97b60e41b815260040161095893929190615981565b505050612fb7868686614621565b9695505050505050565b6000610a7c8383614328565b612fd5613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015613012573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130369190615964565b1561305457604051632b37d9d160e21b815260040160405180910390fd5b82826130618282336130b9565b82823390919261308757604051630c76b97b60e41b815260040161095893929190615981565b5050506118278585856141e8565b7f000000000000000000000000000000000000000000000000000000000000000090565b6000836001600160a01b0316826001600160a01b0316036130dc5750600161188b565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b03160361314457506001600160a01b0380841660009081526015602090815260408083209385168352929052205460ff1661188b565b506001600160a01b038084166000908152601f60209081526040808320868516845282528083209385168352929052205460ff1661188b565b6000841161319e57604051630a2a4e5b60e11b815260040160405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b031614806131e45750600d5463ffffffff16155b83906132045760405163353666ff60e01b8152600401610958919061553e565b508163ffffffff8116620f42401015613239576040516329bff5f560e01b815263ffffffff9091166004820152602401610958565b50601a5481906001600160401b0390811690821681101561326f5760405163ee5602e160e01b8152600401610958929190615a9e565b50506001600160a01b038581166000908152601b6020908152604080832093871683529290522060030154600160601b90046001600160401b0316156132c857604051632b542c0d60e11b815260040160405180910390fd5b60006132d386614362565b90508481808211156132fa5760405163ccaf28a960e01b8152600401610958929190615bd3565b505060405180610140016040528086815260200160008152602001600081526020018463ffffffff168152602001836001600160401b03168152602001426001600160401b031681526020018463ffffffff168152602001836001600160401b03168152602001600081526020016000815250601b6000886001600160a01b03166001600160a01b031681526020019081526020016000206000866001600160a01b03166001600160a01b0316815260200190815260200160002060008201518160000155602082015181600101556040820151816002015560608201518160030160006101000a81548163ffffffff021916908363ffffffff16021790555060808201518160030160046101000a8154816001600160401b0302191690836001600160401b0316021790555060a082015181600301600c6101000a8154816001600160401b0302191690836001600160401b0316021790555060c08201518160030160146101000a81548163ffffffff021916908363ffffffff16021790555060e08201518160030160186101000a8154816001600160401b0302191690836001600160401b03160217905550610100820151816004015561012082015181600501559050506000600e6000886001600160a01b03166001600160a01b0316815260200190815260200160002090508581600401546134fa9190615a23565b60048201556040805187815263ffffffff861660208201526001600160401b0385168183015290516001600160a01b0387811692908a16917f88b4c2d08cea0f01a24841ff5d14814ddb5b14ac44b05e0835fcc0dcd8c7bc259181900360600190a350505050505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b8015610e6f576040516323b872dd60e01b81526001600160a01b038381166004830152306024830152604482018390528416906323b872dd906064015b6020604051808303816000875af11580156135e5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906136099190615964565b610e6f5760405162461bcd60e51b815260206004820152600960248201526810ba3930b739b332b960b91b6044820152606401610958565b81670de0b6b3a76400008082101561366e5760405163b86d885760e01b8152600401610958929190615bd3565b50506001600160a01b038481166000908152601b602090815260408083209387168352929052206003015484908490600160601b90046001600160401b03166136cc576040516330acea0d60e11b8152600401610958929190615a36565b505060006136da858561412c565b336000908152600482016020526040902060028201549192509015158061370357506003820154155b8686909161372657604051631984edef60e31b8152600401610958929190615a36565b50506000826002015460001480613744575082600501548360020154145b905060008161377f57836005015484600201546137619190615a10565b600385015461377090886159d7565b61377a91906159ee565b613781565b855b905080158015906137925750848110155b818690916137b557604051635d88e8d160e01b8152600401610958929190615bd3565b50508584600201546137c79190615a23565b600285015560038401546137dc908290615a23565b600385015582546137ee908290615a23565b835560405133906001600160a01b0389811691908b16907f237818af8bb47710142edd8fc301fbc507064fb357cf122fb161ca447e3cb13e90613834908b908790615bd3565b60405180910390a45050505050505050565b6001600160a01b038281166000908152601b60209081526040808320938516835292905290812060018101549054610a7c9190615a10565b6001600160a01b038381166000818152601b60209081526040808320948716808452948252808320600281015460018201548351610100810185528681529485018790529284019690965260608301949094526080820181905260a0820185905260c08201869052600584015460e08301529193849290916138ff816147b3565b875492965094509250613913908590615a10565b855560028501839055600185018290556001600160a01b0389166000908152600e60205260408120600401805486929061394e908490615a10565b92505081905550876001600160a01b0316896001600160a01b03167f9008d731ddfbec70bc364780efd63057c6877bee8027c4708a104b365395885d8660405161399a91815260200190565b60405180910390a35091979650505050505050565b3360008290036139d257604051630a2a4e5b60e11b815260040160405180910390fd5b60006139dd82614362565b9050828180821115613a045760405163ccaf28a960e01b8152600401610958929190615bd3565b50506001600160a01b0382166000908152600e602052604081208054600d549192909163ffffffff1690819003613a9657613a3f8683615a10565b8355613a4e858761160e613565565b846001600160a01b03167f32eed9ebc5696170068a371fdbea4c076da1bc21b305e78ca0a5e65ee913be8387604051613a8991815260200190565b60405180910390a2610b4d565b600283015415801590613aad575082600301544310155b15613abb57613abb85613d9e565b600283015415613ae557613ae2613ad68460030154436148ad565b846002015483896148c7565b90505b858360020154613af59190615a23565b6002840155613b048143615a23565b6003840181905560028401546040516001600160a01b038816927f91642f23a1196e1424949fafa2a428c3b5d1f699763942ff08a6fbe9d4d7e98092613b4c92909190615bd3565b60405180910390a2505050505050565b6000601e6000866001811115613b7457613b74615a6f565b6001811115613b8557613b85615a6f565b8152602080820192909252604090810160009081206001600160a01b03978816825283528181209587168152948252808520939095168452919091525020919050565b6000601d6000846001811115613be057613be0615a6f565b6001811115613bf157613bf1615a6f565b81526020019081526020016000206000838152602001908152602001600020905092915050565b6000613c24878761412c565b905080600201546000141580613c3c57506003810154155b87879091613c5f57604051631984edef60e31b8152600401610958929190615a36565b5050600681015460058201546040805161010081018252600181526001600160a01b03808c1660208301528a16918101919091523360608201526080810182905260a0810183905260c08101859052600784015460e08201526000929190613cc6816147b3565b600288015492965094509250613cdd908590615a10565b600286015560068501839055600585018290558315613d91576001600160a01b03891615801590613d1657506001600160a01b03881615155b15613d2c57613d278989868a613641565b613d91565b613d39338561160e613565565b336001600160a01b03168a6001600160a01b03168c6001600160a01b03167f305f519d8909c676ffd870495d4563032eb0b506891a6dd9827490256cc9914e87604051613d8891815260200190565b60405180910390a45b5050505050505050505050565b6001600160a01b0381166000908152600e6020526040812060028101549091819003613ddd57604051630a2a4e5b60e11b815260040160405180910390fd5b600382015443811115613e0657604051631d222f1b60e31b815260040161095891815260200190565b5060006002830181905560038301558154613e22908290615a10565b8255613e31838261160e613565565b826001600160a01b03167f32eed9ebc5696170068a371fdbea4c076da1bc21b305e78ca0a5e65ee913be8382604051613e6c91815260200190565b60405180910390a2505050565b6000808211613e9b57604051637318ad9960e01b815260040160405180910390fd5b6000613ea7858561412c565b33600090815260048201602052604090208054919250908480821015613ee25760405163ab99793560e01b8152600401610958929190615bd3565b5050600282015486908690613f0c57604051631984edef60e31b8152600401610958929190615a36565b50506000826003015483600501548460020154613f299190615a10565b613f3390876159d7565b613f3d91906159ee565b905060008360050154600014613f705760058401546006850154613f6190846159d7565b613f6b91906159ee565b613f72565b815b6001600160a01b038981166000908152601b60209081526040808320938c1683529290529081206003015491925090613fbb90600160201b90046001600160401b031642615a23565b9050828560050154613fcd9190615a23565b60058601556006850154613fe2908390615a23565b60068601556003850154613ff7908890615a10565b60038601558354614009908890615a10565b8085551561407557600085600301548660050154876002015461402c9190615a10565b865461403891906159d7565b61404291906159ee565b905080670de0b6b3a7640000808210156140715760405163587ab9ab60e11b8152600401610958929190615bd3565b5050505b600061408b60018b8b3387878c6007015461491b565b9050336001600160a01b0316896001600160a01b03168b6001600160a01b03167f0525d6ad1aa78abc571b5c1984b5e1ea4f1412368c1cc348ca408dbb1085c9a1878c6040516140dc929190615bd3565b60405180910390a49998505050505050505050565b8015610e6f5760405163a9059cbb60e01b81526001600160a01b0383811660048301526024820183905284169063a9059cbb906044016135c6565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b03160361418557506001600160a01b0382166000908152601460205260409020610a7f565b506001600160a01b038083166000908152602160209081526040808320938516835292905220610a7f565b806000036141d157604051630a2a4e5b60e11b815260040160405180910390fd5b6141de3382610a2f613565565b610a6c8282614ac1565b8060000361420957604051630a2a4e5b60e11b815260040160405180910390fd5b6001600160a01b038381166000908152601b60209081526040808320938616835292905220600381015484908490600160601b90046001600160401b0316614266576040516330acea0d60e11b8152600401610958929190615a36565b5050600061427385614362565b905082818082111561429a5760405163ccaf28a960e01b8152600401610958929190615bd3565b505081546142a9908490615a23565b82556001600160a01b0385166000908152600e60205260409020600401546142d2908490615a23565b6001600160a01b038681166000818152600e602090815260409182902060040194909455518681529187169290917feaf6ea3a42ed2fd1b6d575f818cbda593af9524aa94bd30e65302ac4dc23474591016125ce565b600080614335848461412c565b905080600501548160020154610dd09190615a10565b60008183111561435b5781610a7c565b5090919050565b6001600160a01b0381166000908152600e6020526040812060028101546001820154600490920154839261439591615a23565b61439f9190615a23565b6001600160a01b0384166000908152600e60205260409020549091508181116143c9576000610dd0565b610dd08282615a10565b6060600080846001600160a01b0316846040516143f09190615bb7565b600060405180830381855af49150503d806000811461442b576040519150601f19603f3d011682016040523d82523d6000602084013e614430565b606091505b5091509150614440858383614b34565b95945050505050565b336001600160a01b0383160361447257604051630123065360e01b815260040160405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b0316036144df573360009081526015602090815260408083206001600160a01b03861684529091529020805460ff191682151517905561451b565b336000908152601f602090815260408083206001600160a01b03878116855290835281842090861684529091529020805460ff19168215151790555b816001600160a01b0316836001600160a01b0316336001600160a01b03167faa5a59b38e8f68292982382bf635c2f263ca37137bbc52956acd808fd7bf976f8460405161456c911515815260200190565b60405180910390a4505050565b600061458883620f4240101590565b8061459b575061459b82620f4240101590565b838390916145be5760405163768bf0eb60e11b8152600401610958929190615bd3565b50620f424090506145cf83856159d7565b610a7c91906159ee565b8015610a6c57604051630852cd8d60e31b8152600481018290526001600160a01b038316906342966c6890602401600060405180830381600087803b158015611f0e57600080fd5b60008160000361464457604051630a2a4e5b60e11b815260040160405180910390fd5b60006146508585613846565b90508083808210156146775760405163587ab9ab60e11b8152600401610958929190615bd3565b50506001600160a01b038086166000908152601b6020908152604080832093881683529290529081206001810154909190156146ec578160010154600183600101548785600201546146c991906159d7565b6146d39190615a23565b6146dd9190615a10565b6146e791906159ee565b6146ee565b845b600383015490915060009061471390600160201b90046001600160401b031642615a23565b90508183600201546147259190615a23565b6002840155600183015461473a908790615a23565b8360010181905550600061475860008a8a8c87878a6005015461491b565b9050876001600160a01b0316896001600160a01b03167f3b81913739097ced1e7fa748c6058d34e2c00b961fb501094543b397b198fdaa8960405161479f91815260200190565b60405180910390a398975050505050505050565b6000806000806147d58560000151866020015187604001518860600151613b5c565b905060008160030154116147fc576040516307e332c560e31b815260040160405180910390fd5b60006148088683614b87565b905085604001516001600160a01b031686602001516001600160a01b03168760000151600181111561483c5761483c615a6f565b6060808a01518551602080880151604080516001600160a01b039095168552918401929092528201527f86c2f162872d7c46d7ee0caad366da6dc430889b9d8f27e4bed3785548f9954b910160405180910390a4602081015160408201516060909201519097919650945092505050565b60008183116148bd576000610a7c565b610a7c8284615a10565b60006148d38285615a23565b60016148df8487615a23565b6148e99190615a10565b6148f384866159d7565b6148fd87896159d7565b6149079190615a23565b6149119190615a23565b61444091906159ee565b60008360000361493e57604051637318ad9960e01b815260040160405180910390fd5b600061494c89898989613b5c565b90506103e88160030154106149745760405163332b852b60e11b815260040160405180910390fd5b60028101546040516001600160601b031960608b811b821660208401528a811b8216603484015289901b166048820152605c810191909152600090607c0160405160208183030381529060405280519060200120905060006149d68b83613bc8565b8781556001810180546001600160401b0319166001600160401b03891617905560006002820155600380820187905584015490915015614a245781614a1f8c8560010154613bc8565b600201555b614a2e8383614c82565b886001600160a01b03168a6001600160a01b03168c6001811115614a5457614a54615a6f565b604080516001600160a01b038d168152602081018c90526001600160401b038b168183015260608101879052608081018a905290517f036538df4a591a5cc74b68cfc7f8c61e8173dbc81627e1d62600b61e820461789181900360a00190a4509998505050505050505050565b6001600160a01b0382166000908152600e6020526040902054614ae5908290615a23565b6001600160a01b0383166000818152600e6020526040908190209290925590517f48c384dd8bdf1e06d8afecd810c4acfc3d553ac5d879dec5a69875dbbd90e14b906113719084815260200190565b606082614b4957614b4482614d15565b61188b565b8151158015614b6057506001600160a01b0384163b155b15614b805783604051639996b31560e01b8152600401610958919061553e565b508061188b565b614bb26040518060800160405280600081526020016000815260200160008152602001600081525090565b615194614bc28460000151614d3e565b9050615194614bd48560000151614da3565b905060008560000151600087608001518860a001518960e00151604051602001614c02959493929190615bfa565b6040516020818303038152906040529050600080614c3785614dea86868c60c001518c614f5a9095949392919063ffffffff16565b91509150600080600083806020019051810190614c549190615c3d565b60408051608081018252998a5260208a019390935291880152606087015250939a9950505050505050505050565b612710826003015410614ca8576040516303a8c56b60e61b815260040160405180910390fd5b80614cc657604051638f4a893d60e01b815260040160405180910390fd5b6001808301829055600283018054600090614ce2908490615a23565b90915550506003820154600003614cf7578082555b6001826003016000828254614d0c9190615a23565b90915550505050565b805115614d255780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b6151946000826001811115614d5557614d55615a6f565b03614d635750615014919050565b6001826001811115614d7757614d77615a6f565b03614d855750615056919050565b604051636bd1fba760e11b815260040160405180910390fd5b919050565b6151946000826001811115614dba57614dba615a6f565b03614dc85750615062919050565b6001826001811115614ddc57614ddc615a6f565b03614d8557506150b9919050565b60006060600080600080600087806020019051810190614e0a9190615c7c565b945094509450945094506000614e20868b613bc8565b6001810154909150426001600160401b039091161115614e5b5760016040518060200160405280600081525097509750505050505050614f53565b600381015460009083148015614eae5782548590614e7a9088906159d7565b614e8491906159ee565b9150614e908287615a10565b8354909650614e9f9086615a10565b9450614eab8288615a23565b96505b8b886001811115614ec157614ec1615a6f565b845460018601546040805187815260208101939093526001600160401b03909116828201528415156060830152517f469e89d0a4e0e5deb2eb1ade5b3fa67fdfbeb4787c3a7c1e8e89aaf28562cab29181900360800190a38787878787604051602001614f32959493929190615bfa565b6040516020818303038152906040529a5060008b9950995050505050505050505b9250929050565b600060608760030154831115614f8357604051634a411b9d60e11b815260040160405180910390fd5b60008315614f915783614f97565b88600301545b89549094505b8015801590614fac5750600085115b1561500557600080614fc283898c63ffffffff16565b915091508115614fd3575050615005565b965086614fe18c8c8b6150c4565b925086614fed81615cc5565b9750508380614ffb90615be1565b9450505050614f9d565b50989397509295505050505050565b6000601d81805b600181111561502c5761502c615a6f565b81526020019081526020016000206000838152602001908152602001600020600201549050919050565b6000601d81600161501b565b601d6000805b600181111561507957615079615a6f565b8152602080820192909252604090810160009081209381529290915281208181556001810180546001600160401b03191690556002810182905560030155565b601d60006001615068565b6000808460030154116150ea5760405163ddaf8f2160e01b815260040160405180910390fd5b60006150fd85600001548563ffffffff16565b905061511085600001548463ffffffff16565b60018560030160008282546151259190615a10565b9091555050808555600385015460000361514157600060018601555b5050915492915050565b6040518060a0016040528060008152602001600081526020016000815260200160008152602001600081525090565b604051806040016040528060008152602001600081525090565b6110d0615cdc565b6001600160a01b0381168114610cd357600080fd5b803563ffffffff81168114614d9e57600080fd5b80356001600160401b0381168114614d9e57600080fd5b600080600080600060a086880312156151f457600080fd5b85356151ff8161519c565b9450602086013561520f8161519c565b935060408601359250615224606087016151b1565b9150615232608087016151c5565b90509295509295909350565b6000806040838503121561525157600080fd5b823561525c8161519c565b946020939093013593505050565b6000806040838503121561527d57600080fd5b82356152888161519c565b915060208301356152988161519c565b809150509250929050565b6000806000606084860312156152b857600080fd5b83356152c38161519c565b925060208401356152d38161519c565b929592945050506040919091013590565b6000602082840312156152f657600080fd5b610a7c826151c5565b6000610140820190508251825260208301516020830152604083015160408301526060830151615337606084018263ffffffff169052565b50608083015161535260808401826001600160401b03169052565b5060a083015161536d60a08401826001600160401b03169052565b5060c083015161538560c084018263ffffffff169052565b5060e08301516153a060e08401826001600160401b03169052565b5061010083015161010083015261012083015161012083015292915050565b6000602082840312156153d157600080fd5b5035919050565b60028110610cd357600080fd5b600080600080608085870312156153fb57600080fd5b8435615406816153d8565b935060208501356154168161519c565b925060408501356154268161519c565b915060608501356154368161519c565b939692955090935050565b60006020828403121561545357600080fd5b813561188b8161519c565b803560038110614d9e57600080fd5b6000806000806080858703121561548357600080fd5b843561548e8161519c565b9350602085013561549e8161519c565b92506154ac6040860161545e565b9396929550929360600135925050565b8015158114610cd357600080fd5b600080604083850312156154dd57600080fd5b82356154e88161519c565b91506020830135615298816154bc565b6000806000806080858703121561550e57600080fd5b84356155198161519c565b935060208501356155298161519c565b93969395505050506040820135916060013590565b6001600160a01b0391909116815260200190565b60008060006060848603121561556757600080fd5b83356155728161519c565b925060208401356155828161519c565b91506155906040850161545e565b90509250925092565b6000806000606084860312156155ae57600080fd5b83356155b98161519c565b925060208401356155c98161519c565b915060408401356155d98161519c565b809150509250925092565b600080600080608085870312156155fa57600080fd5b84356156058161519c565b935060208501356156158161519c565b9250615623604086016151b1565b9150615631606086016151c5565b905092959194509250565b60008060006060848603121561565157600080fd5b833561565c8161519c565b9250602084013561566c8161519c565b9150615590604085016151b1565b60008060006040848603121561568f57600080fd5b833561569a8161519c565b925060208401356001600160401b038111156156b557600080fd5b8401601f810186136156c657600080fd5b80356001600160401b038111156156dc57600080fd5b8660208284010111156156ee57600080fd5b939660209190910195509293505050565b6000806020838503121561571257600080fd5b82356001600160401b0381111561572857600080fd5b8301601f8101851361573957600080fd5b80356001600160401b0381111561574f57600080fd5b8560208260051b840101111561576457600080fd5b6020919091019590945092505050565b60005b8381101561578f578181015183820152602001615777565b50506000910152565b6000602082016020835280845180835260408501915060408160051b86010192506020860160005b8281101561580c57603f19878603018452815180518087526157e9816020890160208501615774565b601f01601f191695909501602090810195509384019391909101906001016157c0565b50929695505050505050565b60008060006060848603121561582d57600080fd5b83356158388161519c565b925060208401356158488161519c565b915060408401356155d9816154bc565b6000806000806080858703121561586e57600080fd5b84356158798161519c565b935060208501356158898161519c565b925060408501356154ac8161519c565b600080604083850312156158ac57600080fd5b823561525c816153d8565b600080600080608085870312156158cd57600080fd5b84356158d88161519c565b9350602085013592506040850135915060608501356154368161519c565b60008060008060008060c0878903121561590f57600080fd5b863561591a8161519c565b9550602087013561592a8161519c565b9450604087013561593a8161519c565b9350606087013561594a8161519c565b9598949750929560808101359460a0909101359350915050565b60006020828403121561597657600080fd5b815161188b816154bc565b6001600160a01b0393841681529183166020830152909116604082015260600190565b6000602082840312156159b657600080fd5b815161188b8161519c565b634e487b7160e01b600052601160045260246000fd5b8082028115828204841417610a7f57610a7f6159c1565b600082615a0b57634e487b7160e01b600052601260045260246000fd5b500490565b81810381811115610a7f57610a7f6159c1565b80820180821115610a7f57610a7f6159c1565b6001600160a01b0392831681529116602082015260400190565b63ffffffff9290921682526001600160401b0316602082015260400190565b634e487b7160e01b600052602160045260246000fd5b600060208284031215615a9757600080fd5b5051919050565b6001600160401b0392831681529116602082015260400190565b6020808252601e908201527f43616c6c6572206d757374206265207468652070726f78792061646d696e0000604082015260600190565b60208152816020820152818360408301376000818301604090810191909152601f909201601f19160101919050565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112615b6157600080fd5b8301803591506001600160401b03821115615b7b57600080fd5b602001915036819003821315614f5357600080fd5b828482376000838201600081528351615bad818360208801615774565b0195945050505050565b60008251615bc9818460208701615774565b9190910192915050565b918252602082015260400190565b600060018201615bf357615bf36159c1565b5060010190565b60a0810160028710615c1c57634e487b7160e01b600052602160045260246000fd5b95815260208101949094526040840192909252606083015260809091015290565b60008060008060808587031215615c5357600080fd5b8451615c5e816153d8565b60208601516040870151606090970151919890975090945092505050565b600080600080600060a08688031215615c9457600080fd5b8551615c9f816153d8565b602087015160408801516060890151608090990151929a91995097965090945092505050565b600081615cd457615cd46159c1565b506000190190565b634e487b7160e01b600052605160045260246000fdfea2646970667358221220f5046670ab269f9c179f41df4a02cd9c6b2ca3d5d507e2b9fcf15f800f351d8b64736f6c634300081b0033", + "linkReferences": {}, + "deployedLinkReferences": {} +} \ No newline at end of file diff --git a/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/HorizonStaking#HorizonStakingExtension.json b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/HorizonStaking#HorizonStakingExtension.json new file mode 100644 index 000000000..5dee92f1e --- /dev/null +++ b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/HorizonStaking#HorizonStakingExtension.json @@ -0,0 +1,1252 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "HorizonStakingExtension", + "sourceName": "contracts/staking/HorizonStakingExtension.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "controller", + "type": "address" + }, + { + "internalType": "address", + "name": "subgraphDataServiceAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + } + ], + "name": "AddressEmptyCode", + "type": "error" + }, + { + "inputs": [], + "name": "FailedCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "contractName", + "type": "bytes" + } + ], + "name": "GraphDirectoryInvalidZeroAddress", + "type": "error" + }, + { + "inputs": [], + "name": "HorizonStakingInvalidThawRequestType", + "type": "error" + }, + { + "inputs": [], + "name": "ManagedIsPaused", + "type": "error" + }, + { + "inputs": [], + "name": "ManagedOnlyController", + "type": "error" + }, + { + "inputs": [], + "name": "ManagedOnlyGovernor", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "a", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "b", + "type": "uint256" + } + ], + "name": "PPMMathInvalidMulPPM", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "PPMMathInvalidPPM", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "subgraphDeploymentID", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "epoch", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "allocationID", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "poi", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bool", + "name": "isPublic", + "type": "bool" + } + ], + "name": "AllocationClosed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "graphToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "graphStaking", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphPayments", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphEscrow", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "graphController", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphEpochManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphRewardsManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphTokenGateway", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphProxyAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphCuration", + "type": "address" + } + ], + "name": "GraphDirectoryInitialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "HorizonStakeDeposited", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "assetHolder", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "subgraphDeploymentID", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "allocationID", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "epoch", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "protocolTax", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "curationFees", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "queryFees", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "queryRebates", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "delegationRewards", + "type": "uint256" + } + ], + "name": "RebateCollected", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "reward", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "beneficiary", + "type": "address" + } + ], + "name": "StakeSlashed", + "type": "event" + }, + { + "inputs": [], + "name": "__DEPRECATED_getThawingPeriod", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IGraphProxy", + "name": "_proxy", + "type": "address" + } + ], + "name": "acceptProxy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IGraphProxy", + "name": "_proxy", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "acceptProxyAndCall", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationID", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "poi", + "type": "bytes32" + } + ], + "name": "closeAllocation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "address", + "name": "allocationID", + "type": "address" + } + ], + "name": "collect", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationID", + "type": "address" + } + ], + "name": "getAllocation", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "subgraphDeploymentID", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "createdAtEpoch", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "closedAtEpoch", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "collectedFees", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "__DEPRECATED_effectiveAllocation", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "accRewardsPerAllocatedToken", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "distributedRebates", + "type": "uint256" + } + ], + "internalType": "struct IHorizonStakingExtension.Allocation", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationID", + "type": "address" + } + ], + "name": "getAllocationData", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationID", + "type": "address" + } + ], + "name": "getAllocationState", + "outputs": [ + { + "internalType": "enum IHorizonStakingExtension.AllocationState", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + } + ], + "name": "getDelegatedTokensAvailable", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "address", + "name": "delegator", + "type": "address" + } + ], + "name": "getDelegation", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + } + ], + "internalType": "struct IHorizonStakingTypes.Delegation", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "paymentType", + "type": "uint8" + } + ], + "name": "getDelegationFeeCut", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + } + ], + "name": "getDelegationPool", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokensThawing", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sharesThawing", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "thawingNonce", + "type": "uint256" + } + ], + "internalType": "struct IHorizonStakingTypes.DelegationPool", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + } + ], + "name": "getIdleStake", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + } + ], + "name": "getIndexerStakedTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getMaxThawingPeriod", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + } + ], + "name": "getProviderTokensAvailable", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + } + ], + "name": "getProvision", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokensThawing", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sharesThawing", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "maxVerifierCut", + "type": "uint32" + }, + { + "internalType": "uint64", + "name": "thawingPeriod", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "createdAt", + "type": "uint64" + }, + { + "internalType": "uint32", + "name": "maxVerifierCutPending", + "type": "uint32" + }, + { + "internalType": "uint64", + "name": "thawingPeriodPending", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "lastParametersStagedAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "thawingNonce", + "type": "uint256" + } + ], + "internalType": "struct IHorizonStakingTypes.Provision", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + } + ], + "name": "getServiceProvider", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "tokensStaked", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokensProvisioned", + "type": "uint256" + } + ], + "internalType": "struct IHorizonStakingTypes.ServiceProvider", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + } + ], + "name": "getStake", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "subgraphDeploymentID", + "type": "bytes32" + } + ], + "name": "getSubgraphAllocatedTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getSubgraphService", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "enum IHorizonStakingTypes.ThawRequestType", + "name": "requestType", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "thawRequestId", + "type": "bytes32" + } + ], + "name": "getThawRequest", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + }, + { + "internalType": "uint64", + "name": "thawingUntil", + "type": "uint64" + }, + { + "internalType": "bytes32", + "name": "nextRequest", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "thawingNonce", + "type": "uint256" + } + ], + "internalType": "struct IHorizonStakingTypes.ThawRequest", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "enum IHorizonStakingTypes.ThawRequestType", + "name": "requestType", + "type": "uint8" + }, + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "getThawRequestList", + "outputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "head", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "tail", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "count", + "type": "uint256" + } + ], + "internalType": "struct LinkedList.List", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "enum IHorizonStakingTypes.ThawRequestType", + "name": "requestType", + "type": "uint8" + }, + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "getThawedTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "uint32", + "name": "delegationRatio", + "type": "uint32" + } + ], + "name": "getTokensAvailable", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + } + ], + "name": "hasStake", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationID", + "type": "address" + } + ], + "name": "isAllocation", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "verifier", + "type": "address" + } + ], + "name": "isAllowedLockedVerifier", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isDelegationSlashingEnabled", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + } + ], + "name": "isOperator", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "reward", + "type": "uint256" + }, + { + "internalType": "address", + "name": "beneficiary", + "type": "address" + } + ], + "name": "legacySlash", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "name": "multicall", + "outputs": [ + { + "internalType": "bytes[]", + "name": "results", + "type": "bytes[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "bytecode": "0x6101e060405234801561001157600080fd5b506040516133a83803806133a883398101604081905261003091610411565b818181806001600160a01b03811661007d5760405163218f5add60e11b815260206004820152600a60248201526921b7b73a3937b63632b960b11b60448201526064015b60405180910390fd5b6001600160a01b0381166101005260408051808201909152600a81526923b930b8342a37b5b2b760b11b60208201526100b590610347565b6001600160a01b03166080526040805180820190915260078152665374616b696e6760c81b60208201526100e890610347565b6001600160a01b031660a05260408051808201909152600d81526c47726170685061796d656e747360981b602082015261012190610347565b6001600160a01b031660c05260408051808201909152600e81526d5061796d656e7473457363726f7760901b602082015261015b90610347565b6001600160a01b031660e05260408051808201909152600c81526b22b837b1b426b0b730b3b2b960a11b602082015261019390610347565b6001600160a01b03166101205260408051808201909152600e81526d2932bbb0b93239a6b0b730b3b2b960911b60208201526101ce90610347565b6001600160a01b0316610140526040805180820190915260118152704772617068546f6b656e4761746577617960781b602082015261020c90610347565b6001600160a01b03166101605260408051808201909152600f81526e23b930b834283937bc3ca0b236b4b760891b602082015261024890610347565b6001600160a01b03166101805260408051808201909152600881526721bab930ba34b7b760c11b602082015261027d90610347565b6001600160a01b039081166101a08190526101005160a05160805160c05160e05161012051610140516101605161018051604051988b169a9788169996909716977fef5021414834d86e36470f5c1cecf6544fb2bb723f2ca51a4c86fcd8c5919a43976103279790916001600160a01b03978816815295871660208701529386166040860152918516606085015284166080840152831660a083015290911660c082015260e00190565b60405180910390a450506001600160a01b03166101c052506104b4915050565b600080610100516001600160a01b031663f7641a5e84805190602001206040518263ffffffff1660e01b815260040161038291815260200190565b602060405180830381865afa15801561039f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103c39190610444565b9050826001600160a01b0382166103ee5760405163218f5add60e11b81526004016100749190610466565b5092915050565b80516001600160a01b038116811461040c57600080fd5b919050565b6000806040838503121561042457600080fd5b61042d836103f5565b915061043b602084016103f5565b90509250929050565b60006020828403121561045657600080fd5b61045f826103f5565b9392505050565b602081526000825180602084015260005b818110156104945760208186018101516040868401015201610477565b506000604082850101526040601f19601f83011684010191505092915050565b60805160a05160c05160e05161010051610120516101405161016051610180516101a0516101c051612e76610532600039600081816104ec0152611e5901526000611f6c0152600050506000505060006124d70152600061222e01526000611966015260005050600050506000505060006119a10152612e766000f3fe608060405234801561001057600080fd5b50600436106101805760003560e01c806308ce5f68146101855780630e022923146101ab5780631787e69f1461023357806325d9897e1461025c5780632f7cc5011461038457806339514ad2146103975780634488a382146103bc57806344c32a61146103d157806355c85269146103e4578063561285e41461042e5780637573ef4f146104835780637a76646014610233578063872d0489146104965780638cc01c86146104a95780638d3c100a146104d75780639363c522146104ea57806398c657dc146105185780639ce7abe514610538578063a2594d821461054b578063a784d4981461055e578063ac9650d814610571578063ae4fe67a14610591578063b6363cf2146105cd578063c0641994146105e0578063ccebcabb146105ee578063d48de84514610610578063e2e1e8e91461065f578063e56f8a1d1461067f578063e73e14bf146106c5578063f1d60d66146106f0578063fb744cc014610703578063fc54fb2714610716575b600080fd5b610198610193366004612721565b610721565b6040519081526020015b60405180910390f35b6101be6101b936600461275a565b610736565b6040516101a2919060006101208201905060018060a01b0383511682526020830151602083015260408301516040830152606083015160608301526080830151608083015260a083015160a083015260c083015160c083015260e083015160e083015261010083015161010083015292915050565b61019861024136600461275a565b6001600160a01b03166000908152600e602052604090205490565b61037761026a366004612721565b6040805161014081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101829052610120810191909152506001600160a01b039182166000908152601b6020908152604080832093909416825291825282902082516101408101845281548152600182015492810192909252600281015492820192909252600382015463ffffffff8082166060840152600160201b82046001600160401b039081166080850152600160601b8304811660a0850152600160a01b830490911660c0840152600160c01b9091041660e0820152600482015461010082015260059091015461012082015290565b6040516101a29190612777565b61019861039236600461284b565b610816565b601a546001600160401b03165b6040516001600160401b0390911681526020016101a2565b6103cf6103ca3660046128a5565b610918565b005b6103cf6103df3660046128e4565b610d04565b6103f76103f236600461275a565b610d99565b6040805196151587526001600160a01b039095166020870152938501929092526060840152608083015260a082015260c0016101a2565b61044161043c366004612721565b610e6f565b6040516101a29190600060a082019050825182526020830151602083015260408301516040830152606083015160608301526080830151608083015292915050565b610198610491366004612910565b610ec1565b6101986104a436600461295f565b610f25565b6104bc6104b736600461275a565b610f7a565b604080518251815260209283015192810192909252016101a2565b6103cf6104e53660046129a8565b610fb6565b7f00000000000000000000000000000000000000000000000000000000000000006040516101a291906129cd565b61052b61052636600461275a565b611405565b6040516101a291906129f7565b6103cf610546366004612a1f565b611410565b6103cf61055936600461275a565b61150b565b61019861056c36600461275a565b6115f7565b61058461057f366004612aa4565b611602565b6040516101a29190612b3d565b6105bd61059f36600461275a565b6001600160a01b031660009081526022602052604090205460ff1690565b60405190151581526020016101a2565b6105bd6105db366004612721565b6116e9565b600d5463ffffffff166103a4565b6106016105fc366004612bbd565b611718565b604051905181526020016101a2565b61062361061e366004612bfd565b61176a565b6040516101a29190815181526020808301516001600160401b031690820152604080830151908201526060918201519181019190915260800190565b61019861066d366004612c19565b60009081526010602052604090205490565b61069261068d36600461284b565b6117d7565b6040516101a291908151815260208083015190820152604080830151908201526060918201519181019190915260800190565b6105bd6106d336600461275a565b6001600160a01b03166000908152600e6020526040902054151590565b6105bd6106fe36600461275a565b61183f565b610198610711366004612721565b611864565b60205460ff166105bd565b600061072d8383611870565b90505b92915050565b61079160405180610120016040528060006001600160a01b0316815260200160008019168152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b506001600160a01b039081166000908152600f6020908152604091829020825161012081018452815490941684526001810154918401919091526002810154918301919091526003810154606083015260048101546080830152600581015460a0830152600681015460c0830152600781015460e08301526008015461010082015290565b600080610825868686866118a8565b9050806003015460000361083d576000915050610910565b6001600160a01b038086166000908152601b6020908152604080832093881683529290529081206001810154600282015484545b80156109075760006108838c83611914565b905084600501548160030154036108fc576001810154426001600160401b03909116116108f6576000838583600001546108bd9190612c48565b6108c79190612c5f565b90506108d38186612c81565b82549095506108e29085612c81565b93506108ee8188612c94565b9650506108fc565b50610907565b600201549050610871565b50929450505050505b949350505050565b3360009081526012602052604090205460ff166109675760405162461bcd60e51b815260206004820152600860248201526710b9b630b9b432b960c11b60448201526064015b60405180910390fd5b61096f611964565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156109ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109d09190612ca7565b156109ee57604051632b37d9d160e21b815260040160405180910390fd5b6001600160a01b0384166000908152600e6020526040902083610a3d5760405162461bcd60e51b815260206004820152600760248201526621746f6b656e7360c81b604482015260640161095e565b82841015610a7d5760405162461bcd60e51b815260206004820152600d60248201526c0e4caeec2e4c8e67ce6d8c2e6d609b1b604482015260640161095e565b8054610ab45760405162461bcd60e51b8152602060048201526006602482015265217374616b6560d01b604482015260640161095e565b8054841115610af35760405162461bcd60e51b815260206004820152600b60248201526a736c6173683e7374616b6560a81b604482015260640161095e565b6001600160a01b038216610b385760405162461bcd60e51b815260206004820152600c60248201526b2162656e656669636961727960a01b604482015260640161095e565b600081600201548260010154610b4e9190612c94565b9050600082600001548211610b6f578254610b6a908390612c81565b610b72565b60005b90508086118015610b87575060008360020154115b15610bd5576000610b988288612c81565b90506000610baa828660020154611988565b9050808560020154610bbc9190612c81565b60028601819055600003610bd257600060038601555b50505b60048301548354600091610be891612c81565b905080600003610c4157876001600160a01b03167ff2717be2f27d9d2d7d265e42dc556e40d2d9aeaba02f49c5286030f30c0571f360008088604051610c3093929190612cc9565b60405180910390a250505050610cfe565b80871115610c645786610c548288612c48565b610c5e9190612c5f565b95508096505b8354610c71908890612c81565b8455610c97610c808789612c81565b610c8861199f565b6001600160a01b0316906119c3565b610cb48587610ca461199f565b6001600160a01b03169190611a0b565b876001600160a01b03167ff2717be2f27d9d2d7d265e42dc556e40d2d9aeaba02f49c5286030f30c0571f3888888604051610cf193929190612cc9565b60405180910390a2505050505b50505050565b610d0c611964565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610d49573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6d9190612ca7565b15610d8b57604051632b37d9d160e21b815260040160405180910390fd5b610d958282611ac2565b5050565b6001600160a01b038082166000908152600f6020908152604080832081516101208101835281549095168552600180820154938601939093526002810154918501919091526003810154606085015260048101546080850152600581015460a0850152600681015460c0850152600781015460e0850152600801546101008401529091829182918291829182918290610e318a611dfc565b6002811115610e4257610e426129e1565b83516020850151604086015160e090960151939092149c909b509099509297509550600094509092505050565b610e776126c3565b610e7f6126c3565b6000610e8b8585611e55565b60028101548352600381015460208401526005810154604084015260068101546060840152600701546080830152509392505050565b6001600160a01b038084166000908152601c60209081526040808320938616835292905290812081836002811115610efb57610efb6129e1565b6002811115610f0c57610f0c6129e1565b81526020019081526020016000205490505b9392505050565b600080610f328585611870565b90506000610f408686611ed9565b90506000610f5463ffffffff861684612c48565b90506000610f628383611988565b9050610f6e8185612c94565b98975050505050505050565b610f826126f2565b610f8a6126f2565b6001600160a01b039092166000908152600e602090815260409091208054845260040154908301525090565b610fbe611964565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ffb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061101f9190612ca7565b1561103d57604051632b37d9d160e21b815260040160405180910390fd5b6001600160a01b03811661107c5760405162461bcd60e51b815260206004820152600660248201526521616c6c6f6360d01b604482015260640161095e565b600061108782611dfc565b9050600081600281111561109d5761109d6129e1565b036110d55760405162461bcd60e51b81526020600482015260086024820152670858dbdb1b1958dd60c21b604482015260640161095e565b826000036110e257505050565b6001600160a01b0382166000908152600f60205260408120600181015490918590808080611123338661111361199f565b6001600160a01b03169190611efc565b600d5461113e908690600160401b900463ffffffff16611f3d565b935061114a8486612c81565b600d5490955061116a9087908790600160201b900463ffffffff16611f58565b92506111768386612c81565b94508487600501546111889190612c94565b6005880155600287015460009015806111ae5750601954600160a01b900463ffffffff16155b6112795760058801546002890154600d546019546040516349484d8160e01b81526004810194909452602484019290925263ffffffff600160a01b80830482166044860152600160c01b928390048216606486015283048116608485015291041660a482015273__$8eb3cac1482a31d7a7f2cbe7dc8bdcd821$__906349484d819060c401602060405180830381865af4158015611250573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112749190612ce8565b61127c565b60005b905061128c81896008015461212e565b92506112988387611988565b92506112a7610c808488612c81565b821561130f578288600801546112bd9190612c94565b600889015587546112d7906001600160a01b031684612148565b91506112e38284612c81565b88546001600160a01b0390811660008181526017602052604090205492955061130f92869216156121da565b5086546001600160a01b03808b16918891167ff5ded07502b6feba4c13b19a0c6646efd4b4119f439bcbd49076e4f0ed1eec4b3361134b61222c565b6001600160a01b031663766718086040518163ffffffff1660e01b8152600401602060405180830381865afa158015611388573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113ac9190612ce8565b604080516001600160a01b039093168352602083019190915281018f9052606081018990526080810188905260a081018a905260c0810187905260e081018690526101000160405180910390a450505050505050505050565b600061073082611dfc565b82806001600160a01b031663f851a4406040518163ffffffff1660e01b81526004016020604051808303816000875af1158015611451573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114759190612d01565b6001600160a01b0316336001600160a01b0316146114a55760405162461bcd60e51b815260040161095e90612d1e565b60405163623faf6160e01b81526001600160a01b0385169063623faf61906114d39086908690600401612d55565b600060405180830381600087803b1580156114ed57600080fd5b505af1158015611501573d6000803e3d6000fd5b5050505050505050565b80806001600160a01b031663f851a4406040518163ffffffff1660e01b81526004016020604051808303816000875af115801561154c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115709190612d01565b6001600160a01b0316336001600160a01b0316146115a05760405162461bcd60e51b815260040161095e90612d1e565b816001600160a01b03166359fc20bb6040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156115db57600080fd5b505af11580156115ef573d6000803e3d6000fd5b505050505050565b600061073082612250565b604080516000815260208101909152606090826001600160401b0381111561162c5761162c612d84565b60405190808252806020026020018201604052801561165f57816020015b606081526020019060019003908161164a5790505b50915060005b838110156116e1576116bc3086868481811061168357611683612d9a565b90506020028101906116959190612db0565b856040516020016116a893929190612dfd565b6040516020818303038152906040526122c1565b8382815181106116ce576116ce612d9a565b6020908102919091010152600101611665565b505092915050565b6001600160a01b0380821660009081526015602090815260408083209386168352929052205460ff1692915050565b60408051602081019091526000815260408051602081019091526000815260006117428686611e55565b6001600160a01b03851660009081526004909101602052604090205482525090509392505050565b6040805160808101825260008082526020820181905291810182905260608101919091526117988383611914565b604080516080810182528254815260018301546001600160401b0316602082015260028301549181019190915260039091015460608201529392505050565b604080516080810182526000808252602082018190529181018290526060810191909152611807858585856118a8565b604080516080810182528254815260018301546020820152600283015491810191909152600390910154606082015295945050505050565b60008061184b83611dfc565b600281111561185c5761185c6129e1565b141592915050565b600061072d8383611ed9565b6001600160a01b038281166000908152601b6020908152604080832093851683529290529081206001810154905461072d9190612c81565b6000601e60008660018111156118c0576118c06129e1565b60018111156118d1576118d16129e1565b8152602080820192909252604090810160009081206001600160a01b03978816825283528181209587168152948252808520939095168452919091525020919050565b6000601d600084600181111561192c5761192c6129e1565b600181111561193d5761193d6129e1565b81526020019081526020016000206000838152602001908152602001600020905092915050565b7f000000000000000000000000000000000000000000000000000000000000000090565b600081831115611998578161072d565b5090919050565b7f000000000000000000000000000000000000000000000000000000000000000090565b8015610d9557604051630852cd8d60e31b8152600481018290526001600160a01b038316906342966c6890602401600060405180830381600087803b1580156115db57600080fd5b8015611abd5760405163a9059cbb60e01b81526001600160a01b0383811660048301526024820183905284169063a9059cbb906044015b6020604051808303816000875af1158015611a61573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a859190612ca7565b611abd5760405162461bcd60e51b815260206004820152600960248201526810ba3930b739b332b960b91b604482015260640161095e565b505050565b6000611acd83611dfc565b90506001816002811115611ae357611ae36129e1565b14611b1a5760405162461bcd60e51b81526020600482015260076024820152662161637469766560c81b604482015260640161095e565b6001600160a01b038084166000908152600f6020908152604091829020825161012081018452815490941684526001810154918401919091526002810154918301919091526003810154606083015260048101546080830152600581015460a0830152600681015460c0830152600781015460e083015260080154610100820152611ba361222c565b6001600160a01b031663766718086040518163ffffffff1660e01b8152600401602060405180830381865afa158015611be0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c049190612ce8565b608082018190526060820151600091611c1c9161212e565b9050600082600001516001600160a01b0316336001600160a01b03161480611c4d5750611c4d3384600001516116e9565b600d54909150600160801b900463ffffffff1682111580611c7057506040830151155b15611caa5780611caa5760405162461bcd60e51b8152602060048201526005602482015264042c2eae8d60db1b604482015260640161095e565b604083015115611d6857808015611cc057508415155b15611cd857611cd3868460000151612337565b611ce5565b611ce5836020015161240b565b60408084015184516001600160a01b03166000908152600e6020529190912060010154611d129190612c81565b83516001600160a01b03166000908152600e602090815260408083206001019390935582860151818701518352601090915291902054611d529190612c81565b6020808501516000908152601090915260409020555b608080840180516001600160a01b03808a166000818152600f6020908152604091829020600401949094558389015189519551828b01518351918252958101959095523391850191909152606084018b9052861595840195909552939216907ff6725dd105a6fc88bb79a6e4627f128577186c567a17c94818d201c2a4ce14039060a00160405180910390a4505050505050565b6001600160a01b038082166000908152600f6020526040812080549192909116611e295750600092915050565b600381015415801590611e3e57506004810154155b15611e4c5750600192915050565b50600292915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031603611eae57506001600160a01b0382166000908152601460205260409020610730565b506001600160a01b038083166000908152602160209081526040808320938516835292905220610730565b600080611ee68484611e55565b9050806005015481600201546109109190612c81565b8015611abd576040516323b872dd60e01b81526001600160a01b038381166004830152306024830152604482018390528416906323b872dd90606401611a42565b600080611f4a8484612483565b905061072d81610c8861199f565b600082600003611f6a57506000610f1e565b7f000000000000000000000000000000000000000000000000000000000000000060008315801590611fa457506001600160a01b03821615155b90508080156120175750604051634c4ea0ed60e01b8152600481018790526001600160a01b03831690634c4ea0ed90602401602060405180830381865afa158015611ff3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120179190612ca7565b156121225760006120288686612483565b90508015612118576120386124d5565b6001600160a01b0316631d1c2fec886040518263ffffffff1660e01b815260040161206591815260200190565b6020604051808303816000875af1158015612084573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120a89190612ce8565b506120b68382610ca461199f565b60405163102ae65160e31b815260048101889052602481018290526001600160a01b03841690638157328890604401600060405180830381600087803b1580156120ff57600080fd5b505af1158015612113573d6000803e3d6000fd5b505050505b9250610f1e915050565b50600095945050505050565b600081831161213e57600061072d565b61072d8284612c81565b6001600160a01b038216600090815260146020526040812060028101548291901580159061218757508054600160401b900463ffffffff16620f424010155b156121d25780546000906121ad9063ffffffff600160401b90910481169087906124f916565b90506121b98186612c81565b92508282600201546121cb9190612c94565b6002830155505b509392505050565b826000036121e757505050565b80156121f757611abd8284612560565b6001600160a01b0380831660009081526017602052604090205416610cfe81156122215781612223565b835b85610ca461199f565b7f000000000000000000000000000000000000000000000000000000000000000090565b6001600160a01b0381166000908152600e6020526040812060028101546001820154600490920154839261228391612c94565b61228d9190612c94565b6001600160a01b0384166000908152600e60205260409020549091508181116122b7576000610910565b6109108282612c81565b6060600080846001600160a01b0316846040516122de9190612e24565b600060405180830381855af49150503d8060008114612319576040519150601f19603f3d011682016040523d82523d6000602084013e61231e565b606091505b509150915061232e8583836125df565b95945050505050565b60006123416124d5565b6001600160a01b031663db750926846040518263ffffffff1660e01b815260040161236c91906129cd565b6020604051808303816000875af115801561238b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123af9190612ce8565b9050806000036123be57505050565b60006123ca8383612632565b905060006123d88284612c81565b6001600160a01b03808616600090815260176020526040902054919250612404918391879116156121da565b5050505050565b6124136124d5565b6001600160a01b031663eeac3e0e826040518263ffffffff1660e01b815260040161244091815260200190565b6020604051808303816000875af115801561245f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d959190612ce8565b600061249282620f4240101590565b82906124b457604051633dc311df60e01b815260040161095e91815260200190565b506124cb836124c684620f4240612c81565b6124f9565b61072d9084612c81565b7f000000000000000000000000000000000000000000000000000000000000000090565b600061250883620f4240101590565b8061251b575061251b82620f4240101590565b838390916125455760405163768bf0eb60e11b81526004810192909252602482015260440161095e565b50620f424090506125568385612c48565b61072d9190612c5f565b6001600160a01b0382166000908152600e6020526040902054612584908290612c94565b6001600160a01b0383166000818152600e6020526040908190209290925590517f48c384dd8bdf1e06d8afecd810c4acfc3d553ac5d879dec5a69875dbbd90e14b906125d39084815260200190565b60405180910390a25050565b6060826125f4576125ef82612697565b610f1e565b815115801561260b57506001600160a01b0384163b155b1561262b5783604051639996b31560e01b815260040161095e91906129cd565b5080610f1e565b6001600160a01b038216600090815260146020526040812060028101548291901580159061267157508054600160201b900463ffffffff16620f424010155b156121d25780546000906121ad9063ffffffff600160201b90910481169087906124f916565b8051156126a75780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b50565b6040518060a0016040528060008152602001600081526020016000815260200160008152602001600081525090565b604051806040016040528060008152602001600081525090565b6001600160a01b03811681146126c057600080fd5b6000806040838503121561273457600080fd5b823561273f8161270c565b9150602083013561274f8161270c565b809150509250929050565b60006020828403121561276c57600080fd5b813561072d8161270c565b60006101408201905082518252602083015160208301526040830151604083015260608301516127af606084018263ffffffff169052565b5060808301516127ca60808401826001600160401b03169052565b5060a08301516127e560a08401826001600160401b03169052565b5060c08301516127fd60c084018263ffffffff169052565b5060e083015161281860e08401826001600160401b03169052565b5061010083015161010083015261012083015161012083015292915050565b80356002811061284657600080fd5b919050565b6000806000806080858703121561286157600080fd5b61286a85612837565b9350602085013561287a8161270c565b9250604085013561288a8161270c565b9150606085013561289a8161270c565b939692955090935050565b600080600080608085870312156128bb57600080fd5b84356128c68161270c565b93506020850135925060408501359150606085013561289a8161270c565b600080604083850312156128f757600080fd5b82356129028161270c565b946020939093013593505050565b60008060006060848603121561292557600080fd5b83356129308161270c565b925060208401356129408161270c565b915060408401356003811061295457600080fd5b809150509250925092565b60008060006060848603121561297457600080fd5b833561297f8161270c565b9250602084013561298f8161270c565b9150604084013563ffffffff8116811461295457600080fd5b600080604083850312156129bb57600080fd5b82359150602083013561274f8161270c565b6001600160a01b0391909116815260200190565b634e487b7160e01b600052602160045260246000fd5b6020810160038310612a1957634e487b7160e01b600052602160045260246000fd5b91905290565b600080600060408486031215612a3457600080fd5b8335612a3f8161270c565b925060208401356001600160401b03811115612a5a57600080fd5b8401601f81018613612a6b57600080fd5b80356001600160401b03811115612a8157600080fd5b866020828401011115612a9357600080fd5b939660209190910195509293505050565b60008060208385031215612ab757600080fd5b82356001600160401b03811115612acd57600080fd5b8301601f81018513612ade57600080fd5b80356001600160401b03811115612af457600080fd5b8560208260051b8401011115612b0957600080fd5b6020919091019590945092505050565b60005b83811015612b34578181015183820152602001612b1c565b50506000910152565b6000602082016020835280845180835260408501915060408160051b86010192506020860160005b82811015612bb157603f1987860301845281518051808752612b8e816020890160208501612b19565b601f01601f19169590950160209081019550938401939190910190600101612b65565b50929695505050505050565b600080600060608486031215612bd257600080fd5b8335612bdd8161270c565b92506020840135612bed8161270c565b915060408401356129548161270c565b60008060408385031215612c1057600080fd5b61290283612837565b600060208284031215612c2b57600080fd5b5035919050565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761073057610730612c32565b600082612c7c57634e487b7160e01b600052601260045260246000fd5b500490565b8181038181111561073057610730612c32565b8082018082111561073057610730612c32565b600060208284031215612cb957600080fd5b8151801515811461072d57600080fd5b92835260208301919091526001600160a01b0316604082015260600190565b600060208284031215612cfa57600080fd5b5051919050565b600060208284031215612d1357600080fd5b815161072d8161270c565b6020808252601e908201527f43616c6c6572206d757374206265207468652070726f78792061646d696e0000604082015260600190565b60208152816020820152818360408301376000818301604090810191909152601f909201601f19160101919050565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112612dc757600080fd5b8301803591506001600160401b03821115612de157600080fd5b602001915036819003821315612df657600080fd5b9250929050565b828482376000838201600081528351612e1a818360208801612b19565b0195945050505050565b60008251612e36818460208701612b19565b919091019291505056fea2646970667358221220eee2ca3f28b971ad70ed8bb53d0d0f8eb32b9f33a12776bc83fb4b7d1b75ddfd64736f6c634300081b0033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101805760003560e01c806308ce5f68146101855780630e022923146101ab5780631787e69f1461023357806325d9897e1461025c5780632f7cc5011461038457806339514ad2146103975780634488a382146103bc57806344c32a61146103d157806355c85269146103e4578063561285e41461042e5780637573ef4f146104835780637a76646014610233578063872d0489146104965780638cc01c86146104a95780638d3c100a146104d75780639363c522146104ea57806398c657dc146105185780639ce7abe514610538578063a2594d821461054b578063a784d4981461055e578063ac9650d814610571578063ae4fe67a14610591578063b6363cf2146105cd578063c0641994146105e0578063ccebcabb146105ee578063d48de84514610610578063e2e1e8e91461065f578063e56f8a1d1461067f578063e73e14bf146106c5578063f1d60d66146106f0578063fb744cc014610703578063fc54fb2714610716575b600080fd5b610198610193366004612721565b610721565b6040519081526020015b60405180910390f35b6101be6101b936600461275a565b610736565b6040516101a2919060006101208201905060018060a01b0383511682526020830151602083015260408301516040830152606083015160608301526080830151608083015260a083015160a083015260c083015160c083015260e083015160e083015261010083015161010083015292915050565b61019861024136600461275a565b6001600160a01b03166000908152600e602052604090205490565b61037761026a366004612721565b6040805161014081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101829052610120810191909152506001600160a01b039182166000908152601b6020908152604080832093909416825291825282902082516101408101845281548152600182015492810192909252600281015492820192909252600382015463ffffffff8082166060840152600160201b82046001600160401b039081166080850152600160601b8304811660a0850152600160a01b830490911660c0840152600160c01b9091041660e0820152600482015461010082015260059091015461012082015290565b6040516101a29190612777565b61019861039236600461284b565b610816565b601a546001600160401b03165b6040516001600160401b0390911681526020016101a2565b6103cf6103ca3660046128a5565b610918565b005b6103cf6103df3660046128e4565b610d04565b6103f76103f236600461275a565b610d99565b6040805196151587526001600160a01b039095166020870152938501929092526060840152608083015260a082015260c0016101a2565b61044161043c366004612721565b610e6f565b6040516101a29190600060a082019050825182526020830151602083015260408301516040830152606083015160608301526080830151608083015292915050565b610198610491366004612910565b610ec1565b6101986104a436600461295f565b610f25565b6104bc6104b736600461275a565b610f7a565b604080518251815260209283015192810192909252016101a2565b6103cf6104e53660046129a8565b610fb6565b7f00000000000000000000000000000000000000000000000000000000000000006040516101a291906129cd565b61052b61052636600461275a565b611405565b6040516101a291906129f7565b6103cf610546366004612a1f565b611410565b6103cf61055936600461275a565b61150b565b61019861056c36600461275a565b6115f7565b61058461057f366004612aa4565b611602565b6040516101a29190612b3d565b6105bd61059f36600461275a565b6001600160a01b031660009081526022602052604090205460ff1690565b60405190151581526020016101a2565b6105bd6105db366004612721565b6116e9565b600d5463ffffffff166103a4565b6106016105fc366004612bbd565b611718565b604051905181526020016101a2565b61062361061e366004612bfd565b61176a565b6040516101a29190815181526020808301516001600160401b031690820152604080830151908201526060918201519181019190915260800190565b61019861066d366004612c19565b60009081526010602052604090205490565b61069261068d36600461284b565b6117d7565b6040516101a291908151815260208083015190820152604080830151908201526060918201519181019190915260800190565b6105bd6106d336600461275a565b6001600160a01b03166000908152600e6020526040902054151590565b6105bd6106fe36600461275a565b61183f565b610198610711366004612721565b611864565b60205460ff166105bd565b600061072d8383611870565b90505b92915050565b61079160405180610120016040528060006001600160a01b0316815260200160008019168152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b506001600160a01b039081166000908152600f6020908152604091829020825161012081018452815490941684526001810154918401919091526002810154918301919091526003810154606083015260048101546080830152600581015460a0830152600681015460c0830152600781015460e08301526008015461010082015290565b600080610825868686866118a8565b9050806003015460000361083d576000915050610910565b6001600160a01b038086166000908152601b6020908152604080832093881683529290529081206001810154600282015484545b80156109075760006108838c83611914565b905084600501548160030154036108fc576001810154426001600160401b03909116116108f6576000838583600001546108bd9190612c48565b6108c79190612c5f565b90506108d38186612c81565b82549095506108e29085612c81565b93506108ee8188612c94565b9650506108fc565b50610907565b600201549050610871565b50929450505050505b949350505050565b3360009081526012602052604090205460ff166109675760405162461bcd60e51b815260206004820152600860248201526710b9b630b9b432b960c11b60448201526064015b60405180910390fd5b61096f611964565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156109ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109d09190612ca7565b156109ee57604051632b37d9d160e21b815260040160405180910390fd5b6001600160a01b0384166000908152600e6020526040902083610a3d5760405162461bcd60e51b815260206004820152600760248201526621746f6b656e7360c81b604482015260640161095e565b82841015610a7d5760405162461bcd60e51b815260206004820152600d60248201526c0e4caeec2e4c8e67ce6d8c2e6d609b1b604482015260640161095e565b8054610ab45760405162461bcd60e51b8152602060048201526006602482015265217374616b6560d01b604482015260640161095e565b8054841115610af35760405162461bcd60e51b815260206004820152600b60248201526a736c6173683e7374616b6560a81b604482015260640161095e565b6001600160a01b038216610b385760405162461bcd60e51b815260206004820152600c60248201526b2162656e656669636961727960a01b604482015260640161095e565b600081600201548260010154610b4e9190612c94565b9050600082600001548211610b6f578254610b6a908390612c81565b610b72565b60005b90508086118015610b87575060008360020154115b15610bd5576000610b988288612c81565b90506000610baa828660020154611988565b9050808560020154610bbc9190612c81565b60028601819055600003610bd257600060038601555b50505b60048301548354600091610be891612c81565b905080600003610c4157876001600160a01b03167ff2717be2f27d9d2d7d265e42dc556e40d2d9aeaba02f49c5286030f30c0571f360008088604051610c3093929190612cc9565b60405180910390a250505050610cfe565b80871115610c645786610c548288612c48565b610c5e9190612c5f565b95508096505b8354610c71908890612c81565b8455610c97610c808789612c81565b610c8861199f565b6001600160a01b0316906119c3565b610cb48587610ca461199f565b6001600160a01b03169190611a0b565b876001600160a01b03167ff2717be2f27d9d2d7d265e42dc556e40d2d9aeaba02f49c5286030f30c0571f3888888604051610cf193929190612cc9565b60405180910390a2505050505b50505050565b610d0c611964565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610d49573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6d9190612ca7565b15610d8b57604051632b37d9d160e21b815260040160405180910390fd5b610d958282611ac2565b5050565b6001600160a01b038082166000908152600f6020908152604080832081516101208101835281549095168552600180820154938601939093526002810154918501919091526003810154606085015260048101546080850152600581015460a0850152600681015460c0850152600781015460e0850152600801546101008401529091829182918291829182918290610e318a611dfc565b6002811115610e4257610e426129e1565b83516020850151604086015160e090960151939092149c909b509099509297509550600094509092505050565b610e776126c3565b610e7f6126c3565b6000610e8b8585611e55565b60028101548352600381015460208401526005810154604084015260068101546060840152600701546080830152509392505050565b6001600160a01b038084166000908152601c60209081526040808320938616835292905290812081836002811115610efb57610efb6129e1565b6002811115610f0c57610f0c6129e1565b81526020019081526020016000205490505b9392505050565b600080610f328585611870565b90506000610f408686611ed9565b90506000610f5463ffffffff861684612c48565b90506000610f628383611988565b9050610f6e8185612c94565b98975050505050505050565b610f826126f2565b610f8a6126f2565b6001600160a01b039092166000908152600e602090815260409091208054845260040154908301525090565b610fbe611964565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ffb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061101f9190612ca7565b1561103d57604051632b37d9d160e21b815260040160405180910390fd5b6001600160a01b03811661107c5760405162461bcd60e51b815260206004820152600660248201526521616c6c6f6360d01b604482015260640161095e565b600061108782611dfc565b9050600081600281111561109d5761109d6129e1565b036110d55760405162461bcd60e51b81526020600482015260086024820152670858dbdb1b1958dd60c21b604482015260640161095e565b826000036110e257505050565b6001600160a01b0382166000908152600f60205260408120600181015490918590808080611123338661111361199f565b6001600160a01b03169190611efc565b600d5461113e908690600160401b900463ffffffff16611f3d565b935061114a8486612c81565b600d5490955061116a9087908790600160201b900463ffffffff16611f58565b92506111768386612c81565b94508487600501546111889190612c94565b6005880155600287015460009015806111ae5750601954600160a01b900463ffffffff16155b6112795760058801546002890154600d546019546040516349484d8160e01b81526004810194909452602484019290925263ffffffff600160a01b80830482166044860152600160c01b928390048216606486015283048116608485015291041660a482015273__$8eb3cac1482a31d7a7f2cbe7dc8bdcd821$__906349484d819060c401602060405180830381865af4158015611250573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112749190612ce8565b61127c565b60005b905061128c81896008015461212e565b92506112988387611988565b92506112a7610c808488612c81565b821561130f578288600801546112bd9190612c94565b600889015587546112d7906001600160a01b031684612148565b91506112e38284612c81565b88546001600160a01b0390811660008181526017602052604090205492955061130f92869216156121da565b5086546001600160a01b03808b16918891167ff5ded07502b6feba4c13b19a0c6646efd4b4119f439bcbd49076e4f0ed1eec4b3361134b61222c565b6001600160a01b031663766718086040518163ffffffff1660e01b8152600401602060405180830381865afa158015611388573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113ac9190612ce8565b604080516001600160a01b039093168352602083019190915281018f9052606081018990526080810188905260a081018a905260c0810187905260e081018690526101000160405180910390a450505050505050505050565b600061073082611dfc565b82806001600160a01b031663f851a4406040518163ffffffff1660e01b81526004016020604051808303816000875af1158015611451573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114759190612d01565b6001600160a01b0316336001600160a01b0316146114a55760405162461bcd60e51b815260040161095e90612d1e565b60405163623faf6160e01b81526001600160a01b0385169063623faf61906114d39086908690600401612d55565b600060405180830381600087803b1580156114ed57600080fd5b505af1158015611501573d6000803e3d6000fd5b5050505050505050565b80806001600160a01b031663f851a4406040518163ffffffff1660e01b81526004016020604051808303816000875af115801561154c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115709190612d01565b6001600160a01b0316336001600160a01b0316146115a05760405162461bcd60e51b815260040161095e90612d1e565b816001600160a01b03166359fc20bb6040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156115db57600080fd5b505af11580156115ef573d6000803e3d6000fd5b505050505050565b600061073082612250565b604080516000815260208101909152606090826001600160401b0381111561162c5761162c612d84565b60405190808252806020026020018201604052801561165f57816020015b606081526020019060019003908161164a5790505b50915060005b838110156116e1576116bc3086868481811061168357611683612d9a565b90506020028101906116959190612db0565b856040516020016116a893929190612dfd565b6040516020818303038152906040526122c1565b8382815181106116ce576116ce612d9a565b6020908102919091010152600101611665565b505092915050565b6001600160a01b0380821660009081526015602090815260408083209386168352929052205460ff1692915050565b60408051602081019091526000815260408051602081019091526000815260006117428686611e55565b6001600160a01b03851660009081526004909101602052604090205482525090509392505050565b6040805160808101825260008082526020820181905291810182905260608101919091526117988383611914565b604080516080810182528254815260018301546001600160401b0316602082015260028301549181019190915260039091015460608201529392505050565b604080516080810182526000808252602082018190529181018290526060810191909152611807858585856118a8565b604080516080810182528254815260018301546020820152600283015491810191909152600390910154606082015295945050505050565b60008061184b83611dfc565b600281111561185c5761185c6129e1565b141592915050565b600061072d8383611ed9565b6001600160a01b038281166000908152601b6020908152604080832093851683529290529081206001810154905461072d9190612c81565b6000601e60008660018111156118c0576118c06129e1565b60018111156118d1576118d16129e1565b8152602080820192909252604090810160009081206001600160a01b03978816825283528181209587168152948252808520939095168452919091525020919050565b6000601d600084600181111561192c5761192c6129e1565b600181111561193d5761193d6129e1565b81526020019081526020016000206000838152602001908152602001600020905092915050565b7f000000000000000000000000000000000000000000000000000000000000000090565b600081831115611998578161072d565b5090919050565b7f000000000000000000000000000000000000000000000000000000000000000090565b8015610d9557604051630852cd8d60e31b8152600481018290526001600160a01b038316906342966c6890602401600060405180830381600087803b1580156115db57600080fd5b8015611abd5760405163a9059cbb60e01b81526001600160a01b0383811660048301526024820183905284169063a9059cbb906044015b6020604051808303816000875af1158015611a61573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a859190612ca7565b611abd5760405162461bcd60e51b815260206004820152600960248201526810ba3930b739b332b960b91b604482015260640161095e565b505050565b6000611acd83611dfc565b90506001816002811115611ae357611ae36129e1565b14611b1a5760405162461bcd60e51b81526020600482015260076024820152662161637469766560c81b604482015260640161095e565b6001600160a01b038084166000908152600f6020908152604091829020825161012081018452815490941684526001810154918401919091526002810154918301919091526003810154606083015260048101546080830152600581015460a0830152600681015460c0830152600781015460e083015260080154610100820152611ba361222c565b6001600160a01b031663766718086040518163ffffffff1660e01b8152600401602060405180830381865afa158015611be0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c049190612ce8565b608082018190526060820151600091611c1c9161212e565b9050600082600001516001600160a01b0316336001600160a01b03161480611c4d5750611c4d3384600001516116e9565b600d54909150600160801b900463ffffffff1682111580611c7057506040830151155b15611caa5780611caa5760405162461bcd60e51b8152602060048201526005602482015264042c2eae8d60db1b604482015260640161095e565b604083015115611d6857808015611cc057508415155b15611cd857611cd3868460000151612337565b611ce5565b611ce5836020015161240b565b60408084015184516001600160a01b03166000908152600e6020529190912060010154611d129190612c81565b83516001600160a01b03166000908152600e602090815260408083206001019390935582860151818701518352601090915291902054611d529190612c81565b6020808501516000908152601090915260409020555b608080840180516001600160a01b03808a166000818152600f6020908152604091829020600401949094558389015189519551828b01518351918252958101959095523391850191909152606084018b9052861595840195909552939216907ff6725dd105a6fc88bb79a6e4627f128577186c567a17c94818d201c2a4ce14039060a00160405180910390a4505050505050565b6001600160a01b038082166000908152600f6020526040812080549192909116611e295750600092915050565b600381015415801590611e3e57506004810154155b15611e4c5750600192915050565b50600292915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031603611eae57506001600160a01b0382166000908152601460205260409020610730565b506001600160a01b038083166000908152602160209081526040808320938516835292905220610730565b600080611ee68484611e55565b9050806005015481600201546109109190612c81565b8015611abd576040516323b872dd60e01b81526001600160a01b038381166004830152306024830152604482018390528416906323b872dd90606401611a42565b600080611f4a8484612483565b905061072d81610c8861199f565b600082600003611f6a57506000610f1e565b7f000000000000000000000000000000000000000000000000000000000000000060008315801590611fa457506001600160a01b03821615155b90508080156120175750604051634c4ea0ed60e01b8152600481018790526001600160a01b03831690634c4ea0ed90602401602060405180830381865afa158015611ff3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120179190612ca7565b156121225760006120288686612483565b90508015612118576120386124d5565b6001600160a01b0316631d1c2fec886040518263ffffffff1660e01b815260040161206591815260200190565b6020604051808303816000875af1158015612084573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120a89190612ce8565b506120b68382610ca461199f565b60405163102ae65160e31b815260048101889052602481018290526001600160a01b03841690638157328890604401600060405180830381600087803b1580156120ff57600080fd5b505af1158015612113573d6000803e3d6000fd5b505050505b9250610f1e915050565b50600095945050505050565b600081831161213e57600061072d565b61072d8284612c81565b6001600160a01b038216600090815260146020526040812060028101548291901580159061218757508054600160401b900463ffffffff16620f424010155b156121d25780546000906121ad9063ffffffff600160401b90910481169087906124f916565b90506121b98186612c81565b92508282600201546121cb9190612c94565b6002830155505b509392505050565b826000036121e757505050565b80156121f757611abd8284612560565b6001600160a01b0380831660009081526017602052604090205416610cfe81156122215781612223565b835b85610ca461199f565b7f000000000000000000000000000000000000000000000000000000000000000090565b6001600160a01b0381166000908152600e6020526040812060028101546001820154600490920154839261228391612c94565b61228d9190612c94565b6001600160a01b0384166000908152600e60205260409020549091508181116122b7576000610910565b6109108282612c81565b6060600080846001600160a01b0316846040516122de9190612e24565b600060405180830381855af49150503d8060008114612319576040519150601f19603f3d011682016040523d82523d6000602084013e61231e565b606091505b509150915061232e8583836125df565b95945050505050565b60006123416124d5565b6001600160a01b031663db750926846040518263ffffffff1660e01b815260040161236c91906129cd565b6020604051808303816000875af115801561238b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123af9190612ce8565b9050806000036123be57505050565b60006123ca8383612632565b905060006123d88284612c81565b6001600160a01b03808616600090815260176020526040902054919250612404918391879116156121da565b5050505050565b6124136124d5565b6001600160a01b031663eeac3e0e826040518263ffffffff1660e01b815260040161244091815260200190565b6020604051808303816000875af115801561245f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d959190612ce8565b600061249282620f4240101590565b82906124b457604051633dc311df60e01b815260040161095e91815260200190565b506124cb836124c684620f4240612c81565b6124f9565b61072d9084612c81565b7f000000000000000000000000000000000000000000000000000000000000000090565b600061250883620f4240101590565b8061251b575061251b82620f4240101590565b838390916125455760405163768bf0eb60e11b81526004810192909252602482015260440161095e565b50620f424090506125568385612c48565b61072d9190612c5f565b6001600160a01b0382166000908152600e6020526040902054612584908290612c94565b6001600160a01b0383166000818152600e6020526040908190209290925590517f48c384dd8bdf1e06d8afecd810c4acfc3d553ac5d879dec5a69875dbbd90e14b906125d39084815260200190565b60405180910390a25050565b6060826125f4576125ef82612697565b610f1e565b815115801561260b57506001600160a01b0384163b155b1561262b5783604051639996b31560e01b815260040161095e91906129cd565b5080610f1e565b6001600160a01b038216600090815260146020526040812060028101548291901580159061267157508054600160201b900463ffffffff16620f424010155b156121d25780546000906121ad9063ffffffff600160201b90910481169087906124f916565b8051156126a75780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b50565b6040518060a0016040528060008152602001600081526020016000815260200160008152602001600081525090565b604051806040016040528060008152602001600081525090565b6001600160a01b03811681146126c057600080fd5b6000806040838503121561273457600080fd5b823561273f8161270c565b9150602083013561274f8161270c565b809150509250929050565b60006020828403121561276c57600080fd5b813561072d8161270c565b60006101408201905082518252602083015160208301526040830151604083015260608301516127af606084018263ffffffff169052565b5060808301516127ca60808401826001600160401b03169052565b5060a08301516127e560a08401826001600160401b03169052565b5060c08301516127fd60c084018263ffffffff169052565b5060e083015161281860e08401826001600160401b03169052565b5061010083015161010083015261012083015161012083015292915050565b80356002811061284657600080fd5b919050565b6000806000806080858703121561286157600080fd5b61286a85612837565b9350602085013561287a8161270c565b9250604085013561288a8161270c565b9150606085013561289a8161270c565b939692955090935050565b600080600080608085870312156128bb57600080fd5b84356128c68161270c565b93506020850135925060408501359150606085013561289a8161270c565b600080604083850312156128f757600080fd5b82356129028161270c565b946020939093013593505050565b60008060006060848603121561292557600080fd5b83356129308161270c565b925060208401356129408161270c565b915060408401356003811061295457600080fd5b809150509250925092565b60008060006060848603121561297457600080fd5b833561297f8161270c565b9250602084013561298f8161270c565b9150604084013563ffffffff8116811461295457600080fd5b600080604083850312156129bb57600080fd5b82359150602083013561274f8161270c565b6001600160a01b0391909116815260200190565b634e487b7160e01b600052602160045260246000fd5b6020810160038310612a1957634e487b7160e01b600052602160045260246000fd5b91905290565b600080600060408486031215612a3457600080fd5b8335612a3f8161270c565b925060208401356001600160401b03811115612a5a57600080fd5b8401601f81018613612a6b57600080fd5b80356001600160401b03811115612a8157600080fd5b866020828401011115612a9357600080fd5b939660209190910195509293505050565b60008060208385031215612ab757600080fd5b82356001600160401b03811115612acd57600080fd5b8301601f81018513612ade57600080fd5b80356001600160401b03811115612af457600080fd5b8560208260051b8401011115612b0957600080fd5b6020919091019590945092505050565b60005b83811015612b34578181015183820152602001612b1c565b50506000910152565b6000602082016020835280845180835260408501915060408160051b86010192506020860160005b82811015612bb157603f1987860301845281518051808752612b8e816020890160208501612b19565b601f01601f19169590950160209081019550938401939190910190600101612b65565b50929695505050505050565b600080600060608486031215612bd257600080fd5b8335612bdd8161270c565b92506020840135612bed8161270c565b915060408401356129548161270c565b60008060408385031215612c1057600080fd5b61290283612837565b600060208284031215612c2b57600080fd5b5035919050565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761073057610730612c32565b600082612c7c57634e487b7160e01b600052601260045260246000fd5b500490565b8181038181111561073057610730612c32565b8082018082111561073057610730612c32565b600060208284031215612cb957600080fd5b8151801515811461072d57600080fd5b92835260208301919091526001600160a01b0316604082015260600190565b600060208284031215612cfa57600080fd5b5051919050565b600060208284031215612d1357600080fd5b815161072d8161270c565b6020808252601e908201527f43616c6c6572206d757374206265207468652070726f78792061646d696e0000604082015260600190565b60208152816020820152818360408301376000818301604090810191909152601f909201601f19160101919050565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112612dc757600080fd5b8301803591506001600160401b03821115612de157600080fd5b602001915036819003821315612df657600080fd5b9250929050565b828482376000838201600081528351612e1a818360208801612b19565b0195945050505050565b60008251612e36818460208701612b19565b919091019291505056fea2646970667358221220eee2ca3f28b971ad70ed8bb53d0d0f8eb32b9f33a12776bc83fb4b7d1b75ddfd64736f6c634300081b0033", + "linkReferences": { + "contracts/staking/libraries/ExponentialRebates.sol": { + "ExponentialRebates": [ + { + "length": 20, + "start": 5960 + } + ] + } + }, + "deployedLinkReferences": { + "contracts/staking/libraries/ExponentialRebates.sol": { + "ExponentialRebates": [ + { + "length": 20, + "start": 4630 + } + ] + } + } +} \ No newline at end of file diff --git a/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/HorizonStaking#HorizonStaking_ProxyWithABI.json b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/HorizonStaking#HorizonStaking_ProxyWithABI.json new file mode 100644 index 000000000..094f54411 --- /dev/null +++ b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/HorizonStaking#HorizonStaking_ProxyWithABI.json @@ -0,0 +1,2481 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "HorizonStaking", + "sourceName": "contracts/staking/HorizonStaking.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "controller", + "type": "address" + }, + { + "internalType": "address", + "name": "stakingExtensionAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "subgraphDataServiceAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + } + ], + "name": "AddressEmptyCode", + "type": "error" + }, + { + "inputs": [], + "name": "FailedCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "contractName", + "type": "bytes" + } + ], + "name": "GraphDirectoryInvalidZeroAddress", + "type": "error" + }, + { + "inputs": [], + "name": "HorizonStakingCallerIsServiceProvider", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minTokens", + "type": "uint256" + } + ], + "name": "HorizonStakingInsufficientDelegationTokens", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minTokens", + "type": "uint256" + } + ], + "name": "HorizonStakingInsufficientIdleStake", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minShares", + "type": "uint256" + } + ], + "name": "HorizonStakingInsufficientShares", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minTokens", + "type": "uint256" + } + ], + "name": "HorizonStakingInsufficientStakeForLegacyAllocations", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minRequired", + "type": "uint256" + } + ], + "name": "HorizonStakingInsufficientTokens", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "feeCut", + "type": "uint256" + } + ], + "name": "HorizonStakingInvalidDelegationFeeCut", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + } + ], + "name": "HorizonStakingInvalidDelegationPool", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + } + ], + "name": "HorizonStakingInvalidDelegationPoolState", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "maxVerifierCut", + "type": "uint32" + } + ], + "name": "HorizonStakingInvalidMaxVerifierCut", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + } + ], + "name": "HorizonStakingInvalidProvision", + "type": "error" + }, + { + "inputs": [], + "name": "HorizonStakingInvalidServiceProviderZeroAddress", + "type": "error" + }, + { + "inputs": [], + "name": "HorizonStakingInvalidThawRequestType", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "thawingPeriod", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "maxThawingPeriod", + "type": "uint64" + } + ], + "name": "HorizonStakingInvalidThawingPeriod", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "verifier", + "type": "address" + } + ], + "name": "HorizonStakingInvalidVerifier", + "type": "error" + }, + { + "inputs": [], + "name": "HorizonStakingInvalidVerifierZeroAddress", + "type": "error" + }, + { + "inputs": [], + "name": "HorizonStakingInvalidZeroShares", + "type": "error" + }, + { + "inputs": [], + "name": "HorizonStakingInvalidZeroTokens", + "type": "error" + }, + { + "inputs": [], + "name": "HorizonStakingLegacySlashFailed", + "type": "error" + }, + { + "inputs": [], + "name": "HorizonStakingNoTokensToSlash", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "HorizonStakingNotAuthorized", + "type": "error" + }, + { + "inputs": [], + "name": "HorizonStakingNothingThawing", + "type": "error" + }, + { + "inputs": [], + "name": "HorizonStakingNothingToWithdraw", + "type": "error" + }, + { + "inputs": [], + "name": "HorizonStakingProvisionAlreadyExists", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minShares", + "type": "uint256" + } + ], + "name": "HorizonStakingSlippageProtection", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "until", + "type": "uint256" + } + ], + "name": "HorizonStakingStillThawing", + "type": "error" + }, + { + "inputs": [], + "name": "HorizonStakingTooManyThawRequests", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxTokens", + "type": "uint256" + } + ], + "name": "HorizonStakingTooManyTokens", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "verifier", + "type": "address" + } + ], + "name": "HorizonStakingVerifierNotAllowed", + "type": "error" + }, + { + "inputs": [], + "name": "LinkedListEmptyList", + "type": "error" + }, + { + "inputs": [], + "name": "LinkedListInvalidIterations", + "type": "error" + }, + { + "inputs": [], + "name": "LinkedListInvalidZeroId", + "type": "error" + }, + { + "inputs": [], + "name": "LinkedListMaxElementsExceeded", + "type": "error" + }, + { + "inputs": [], + "name": "ManagedIsPaused", + "type": "error" + }, + { + "inputs": [], + "name": "ManagedOnlyController", + "type": "error" + }, + { + "inputs": [], + "name": "ManagedOnlyGovernor", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "a", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "b", + "type": "uint256" + } + ], + "name": "PPMMathInvalidMulPPM", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "AllowedLockedVerifierSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "delegator", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "DelegatedTokensWithdrawn", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": true, + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "paymentType", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "feeCut", + "type": "uint256" + } + ], + "name": "DelegationFeeCutSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "DelegationSlashed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "DelegationSlashingEnabled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "DelegationSlashingSkipped", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "graphToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "graphStaking", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphPayments", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphEscrow", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "graphController", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphEpochManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphRewardsManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphTokenGateway", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphProxyAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphCuration", + "type": "address" + } + ], + "name": "GraphDirectoryInitialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "HorizonStakeDeposited", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "until", + "type": "uint256" + } + ], + "name": "HorizonStakeLocked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "HorizonStakeWithdrawn", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "maxThawingPeriod", + "type": "uint64" + } + ], + "name": "MaxThawingPeriodSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "OperatorSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "maxVerifierCut", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "thawingPeriod", + "type": "uint64" + } + ], + "name": "ProvisionCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "ProvisionIncreased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "maxVerifierCut", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "thawingPeriod", + "type": "uint64" + } + ], + "name": "ProvisionParametersSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "maxVerifierCut", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "thawingPeriod", + "type": "uint64" + } + ], + "name": "ProvisionParametersStaged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "ProvisionSlashed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "ProvisionThawed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "delegator", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "StakeDelegatedWithdrawn", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "enum IHorizonStakingTypes.ThawRequestType", + "name": "requestType", + "type": "uint8" + }, + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "shares", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "thawingUntil", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "thawRequestId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + } + ], + "name": "ThawRequestCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "enum IHorizonStakingTypes.ThawRequestType", + "name": "requestType", + "type": "uint8" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "thawRequestId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "shares", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "thawingUntil", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "bool", + "name": "valid", + "type": "bool" + } + ], + "name": "ThawRequestFulfilled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "enum IHorizonStakingTypes.ThawRequestType", + "name": "requestType", + "type": "uint8" + }, + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "thawRequestsFulfilled", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "ThawRequestsFulfilled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "ThawingPeriodCleared", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "delegator", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "shares", + "type": "uint256" + } + ], + "name": "TokensDelegated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "TokensDeprovisioned", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "TokensToDelegationPoolAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "delegator", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "shares", + "type": "uint256" + } + ], + "name": "TokensUndelegated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "VerifierTokensSent", + "type": "event" + }, + { + "stateMutability": "nonpayable", + "type": "fallback" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + } + ], + "name": "acceptProvisionParameters", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IGraphProxy", + "name": "_proxy", + "type": "address" + } + ], + "name": "acceptProxy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IGraphProxy", + "name": "_proxy", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "acceptProxyAndCall", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "addToDelegationPool", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "addToProvision", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "clearThawingPeriod", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "delegate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minSharesOut", + "type": "uint256" + } + ], + "name": "delegate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "uint256", + "name": "nThawRequests", + "type": "uint256" + } + ], + "name": "deprovision", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + } + ], + "name": "getDelegatedTokensAvailable", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "address", + "name": "delegator", + "type": "address" + } + ], + "name": "getDelegation", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + } + ], + "internalType": "struct IHorizonStakingTypes.Delegation", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "paymentType", + "type": "uint8" + } + ], + "name": "getDelegationFeeCut", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + } + ], + "name": "getDelegationPool", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokensThawing", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sharesThawing", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "thawingNonce", + "type": "uint256" + } + ], + "internalType": "struct IHorizonStakingTypes.DelegationPool", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + } + ], + "name": "getIdleStake", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getMaxThawingPeriod", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + } + ], + "name": "getProviderTokensAvailable", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + } + ], + "name": "getProvision", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokensThawing", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sharesThawing", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "maxVerifierCut", + "type": "uint32" + }, + { + "internalType": "uint64", + "name": "thawingPeriod", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "createdAt", + "type": "uint64" + }, + { + "internalType": "uint32", + "name": "maxVerifierCutPending", + "type": "uint32" + }, + { + "internalType": "uint64", + "name": "thawingPeriodPending", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "lastParametersStagedAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "thawingNonce", + "type": "uint256" + } + ], + "internalType": "struct IHorizonStakingTypes.Provision", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + } + ], + "name": "getServiceProvider", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "tokensStaked", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokensProvisioned", + "type": "uint256" + } + ], + "internalType": "struct IHorizonStakingTypes.ServiceProvider", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + } + ], + "name": "getStake", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getStakingExtension", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "enum IHorizonStakingTypes.ThawRequestType", + "name": "requestType", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "thawRequestId", + "type": "bytes32" + } + ], + "name": "getThawRequest", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + }, + { + "internalType": "uint64", + "name": "thawingUntil", + "type": "uint64" + }, + { + "internalType": "bytes32", + "name": "nextRequest", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "thawingNonce", + "type": "uint256" + } + ], + "internalType": "struct IHorizonStakingTypes.ThawRequest", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "enum IHorizonStakingTypes.ThawRequestType", + "name": "requestType", + "type": "uint8" + }, + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "getThawRequestList", + "outputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "head", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "tail", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "count", + "type": "uint256" + } + ], + "internalType": "struct LinkedList.List", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "enum IHorizonStakingTypes.ThawRequestType", + "name": "requestType", + "type": "uint8" + }, + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "getThawedTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "uint32", + "name": "delegationRatio", + "type": "uint32" + } + ], + "name": "getTokensAvailable", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "verifier", + "type": "address" + } + ], + "name": "isAllowedLockedVerifier", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "address", + "name": "operator", + "type": "address" + } + ], + "name": "isAuthorized", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isDelegationSlashingEnabled", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "name": "multicall", + "outputs": [ + { + "internalType": "bytes[]", + "name": "results", + "type": "bytes[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "maxVerifierCut", + "type": "uint32" + }, + { + "internalType": "uint64", + "name": "thawingPeriod", + "type": "uint64" + } + ], + "name": "provision", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "maxVerifierCut", + "type": "uint32" + }, + { + "internalType": "uint64", + "name": "thawingPeriod", + "type": "uint64" + } + ], + "name": "provisionLocked", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "oldServiceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "oldVerifier", + "type": "address" + }, + { + "internalType": "address", + "name": "newServiceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "newVerifier", + "type": "address" + }, + { + "internalType": "uint256", + "name": "minSharesForNewProvider", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nThawRequests", + "type": "uint256" + } + ], + "name": "redelegate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "oldVerifier", + "type": "address" + }, + { + "internalType": "address", + "name": "newVerifier", + "type": "address" + }, + { + "internalType": "uint256", + "name": "nThawRequests", + "type": "uint256" + } + ], + "name": "reprovision", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "setAllowedLockedVerifier", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "paymentType", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "feeCut", + "type": "uint256" + } + ], + "name": "setDelegationFeeCut", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "setDelegationSlashingEnabled", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "maxThawingPeriod", + "type": "uint64" + } + ], + "name": "setMaxThawingPeriod", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "setOperator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "setOperatorLocked", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "uint32", + "name": "newMaxVerifierCut", + "type": "uint32" + }, + { + "internalType": "uint64", + "name": "newThawingPeriod", + "type": "uint64" + } + ], + "name": "setProvisionParameters", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokensVerifier", + "type": "uint256" + }, + { + "internalType": "address", + "name": "verifierDestination", + "type": "address" + } + ], + "name": "slash", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "stake", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "stakeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "stakeToProvision", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "thaw", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + } + ], + "name": "undelegate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + } + ], + "name": "undelegate", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "unstake", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "uint256", + "name": "nThawRequests", + "type": "uint256" + } + ], + "name": "withdrawDelegated", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "withdrawDelegated", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "bytecode": "0x61020060405234801561001157600080fd5b506040516162a33803806162a38339810160408190526100309161041b565b828181806001600160a01b03811661007d5760405163218f5add60e11b815260206004820152600a60248201526921b7b73a3937b63632b960b11b60448201526064015b60405180910390fd5b6001600160a01b0381166101005260408051808201909152600a81526923b930b8342a37b5b2b760b11b60208201526100b590610351565b6001600160a01b03166080526040805180820190915260078152665374616b696e6760c81b60208201526100e890610351565b6001600160a01b031660a05260408051808201909152600d81526c47726170685061796d656e747360981b602082015261012190610351565b6001600160a01b031660c05260408051808201909152600e81526d5061796d656e7473457363726f7760901b602082015261015b90610351565b6001600160a01b031660e05260408051808201909152600c81526b22b837b1b426b0b730b3b2b960a11b602082015261019390610351565b6001600160a01b03166101205260408051808201909152600e81526d2932bbb0b93239a6b0b730b3b2b960911b60208201526101ce90610351565b6001600160a01b0316610140526040805180820190915260118152704772617068546f6b656e4761746577617960781b602082015261020c90610351565b6001600160a01b03166101605260408051808201909152600f81526e23b930b834283937bc3ca0b236b4b760891b602082015261024890610351565b6001600160a01b03166101805260408051808201909152600881526721bab930ba34b7b760c11b602082015261027d90610351565b6001600160a01b039081166101a08190526101005160a05160805160c05160e05161012051610140516101605161018051604051988b169a9788169996909716977fef5021414834d86e36470f5c1cecf6544fb2bb723f2ca51a4c86fcd8c5919a43976103279790916001600160a01b03978816815295871660208701529386166040860152918516606085015284166080840152831660a083015290911660c082015260e00190565b60405180910390a450506001600160a01b039081166101c052929092166101e052506104ce915050565b600080610100516001600160a01b031663f7641a5e84805190602001206040518263ffffffff1660e01b815260040161038c91815260200190565b602060405180830381865afa1580156103a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103cd919061045e565b9050826001600160a01b0382166103f85760405163218f5add60e11b81526004016100749190610480565b5092915050565b80516001600160a01b038116811461041657600080fd5b919050565b60008060006060848603121561043057600080fd5b610439846103ff565b9250610447602085016103ff565b9150610455604085016103ff565b90509250925092565b60006020828403121561047057600080fd5b610479826103ff565b9392505050565b602081526000825180602084015260005b818110156104ae5760208186018101516040868401015201610491565b506000604082850101526040601f19601f83011684010191505092915050565b60805160a05160c05160e05161010051610120516101405161016051610180516101a0516101c0516101e051615d2861057b6000396000818161025b0152818161055e01526128a3015260008181610a450152818161140a015281816130de015281816131a001528181614130015261447401526000505060005050600050506000505060006114e901526000613097015260005050600050506000505060006135670152615d286000f3fe608060405234801561001057600080fd5b50600436106102565760003560e01c8063872d048911610142578063872d0489146106225780638cc01c86146106355780639ce7abe514610663578063a02b942614610676578063a2594d8214610689578063a2a317221461069c578063a694fc3a146106af578063a784d498146106c2578063ac9650d8146106d5578063ad4d35b5146106f5578063ae4fe67a14610708578063ba7fb0b414610734578063bc735d9014610747578063ca94b0e91461075a578063ccebcabb1461076d578063d48de8451461078f578063e473522a146107de578063e56f8a1d146107e6578063e76fede61461082c578063ef58bd671461083f578063f64b359814610847578063f93f1cd01461085a578063fb744cc01461086d578063fc54fb2714610880578063fecc9cc11461088b57610256565b8063010167e51461029f578063026e402b146102b257806308ce5f68146102c557806321195373146102eb578063259bc435146102fe57806325d9897e146103115780632e17de78146104395780632f7cc5011461044c57806339514ad21461045f5780633993d8491461047a5780633a78b7321461048d5780633ccfd60b146104a057806342c51693146104a85780634ca7ac22146104bb5780634d99dd16146104ce57806351a60b02146104e1578063561285e4146104f45780636230001a1461054957806366ee1b281461055c578063746120921461058a5780637573ef4f1461059d5780637a766460146105b05780637c145cc7146105d957806381e21b56146105fc57806382d66cb81461060f575b6040517f00000000000000000000000000000000000000000000000000000000000000009036600082376000803683855af43d806000843e818015610299578184f35b8184fd5b005b61029d6102ad3660046151dc565b61089e565b61029d6102c036600461523e565b61097a565b6102d86102d336600461526a565b610a70565b6040519081526020015b60405180910390f35b61029d6102f93660046152a3565b610a85565b61029d61030c3660046152e4565b610b55565b61042c61031f36600461526a565b6040805161014081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101829052610120810191909152506001600160a01b039182166000908152601b6020908152604080832093909416825291825282902082516101408101845281548152600182015492810192909252600281015492820192909252600382015463ffffffff8082166060840152600160201b82046001600160401b039081166080850152600160601b8304811660a0850152600160a01b830490911660c0840152600160c01b9091041660e0820152600482015461010082015260059091015461012082015290565b6040516102e291906152ff565b61029d6104473660046153bf565b610c43565b6102d861045a3660046153e5565b610cd6565b601a546040516001600160401b0390911681526020016102e2565b61029d6104883660046152a3565b610dd8565b61029d61049b366004615441565b610e74565b61029d611040565b61029d6104b636600461546d565b6110d2565b61029d6104c93660046154ca565b611283565b61029d6104dc36600461523e565b61137d565b6102d86104ef36600461526a565b61142f565b61050761050236600461526a565b611629565b6040516102e29190600060a082019050825182526020830151602083015260408301516040830152606083015160608301526080830151608083015292915050565b61029d6105573660046154f8565b61167b565b7f00000000000000000000000000000000000000000000000000000000000000006040516102e2919061553e565b61029d6105983660046152a3565b611742565b6102d86105ab366004615552565b61182e565b6102d86105be366004615441565b6001600160a01b03166000908152600e602052604090205490565b6105ec6105e7366004615599565b611892565b60405190151581526020016102e2565b61029d61060a3660046155e4565b61189f565b61029d61061d3660046151dc565b611b18565b6102d861063036600461563c565b611c1e565b610648610643366004615441565b611c73565b604080518251815260209283015192810192909252016102e2565b61029d61067136600461567a565b611caf565b6102d86106843660046152a3565b611daa565b61029d610697366004615441565b611e3e565b61029d6106aa36600461523e565b611f22565b61029d6106bd3660046153bf565b611fb3565b6102d86106d0366004615441565b612044565b6106e86106e33660046156ff565b61204f565b6040516102e29190615798565b61029d610703366004615818565b612136565b6105ec610716366004615441565b6001600160a01b031660009081526022602052604090205460ff1690565b61029d610742366004615858565b612204565b61029d610755366004615818565b612311565b61029d6107683660046152a3565b6123a3565b61078061077b366004615599565b6125dd565b604051905181526020016102e2565b6107a261079d366004615899565b61262f565b6040516102e29190815181526020808301516001600160401b031690820152604080830151908201526060918201519181019190915260800190565b61029d61269c565b6107f96107f43660046153e5565b61276e565b6040516102e291908151815260208083015190820152604080830151908201526060918201519181019190915260800190565b61029d61083a3660046158b7565b6127d6565b61029d612d38565b61029d6108553660046158f6565b612e0a565b6102d86108683660046152a3565b612eed565b6102d861087b36600461526a565b612fc1565b60205460ff166105ec565b61029d6108993660046152a3565b612fcd565b6108a6613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108e3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109079190615964565b1561092557604051632b37d9d160e21b815260040160405180910390fd5b84846109328282336130b9565b82823390919261096157604051630c76b97b60e41b815260040161095893929190615981565b60405180910390fd5b505050610971878688878761317d565b50505050505050565b610982613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156109bf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109e39190615964565b15610a0157604051632b37d9d160e21b815260040160405180910390fd5b80600003610a2257604051630a2a4e5b60e11b815260040160405180910390fd5b610a3f3382610a2f613565565b6001600160a01b03169190613589565b610a6c827f0000000000000000000000000000000000000000000000000000000000000000836000613641565b5050565b6000610a7c8383613846565b90505b92915050565b8282610a928282336130b9565b828233909192610ab857604051630c76b97b60e41b815260040161095893929190615981565b505050610ac3613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b00573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b249190615964565b15610b4257604051632b37d9d160e21b815260040160405180910390fd5b610b4d85858561387e565b505050505050565b610b5d613095565b6001600160a01b0316634fc07d756040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b9a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bbe91906159a4565b6001600160a01b0316336001600160a01b031614610bef57604051635d9044cd60e01b815260040160405180910390fd5b601a80546001600160401b0319166001600160401b0383169081179091556040519081527fe8526be46fa99b6313d439293c9be3491ffb067741bc8fce9d30c270cbb8459f9060200160405180910390a150565b610c4b613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c88573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cac9190615964565b15610cca57604051632b37d9d160e21b815260040160405180910390fd5b610cd3816139af565b50565b600080610ce586868686613b5c565b90508060030154600003610cfd576000915050610dd0565b6001600160a01b038086166000908152601b6020908152604080832093881683529290529081206001810154600282015484545b8015610dc7576000610d438c83613bc8565b90508460050154816003015403610dbc576001810154426001600160401b0390911611610db657600083858360000154610d7d91906159d7565b610d8791906159ee565b9050610d938186615a10565b8254909550610da29085615a10565b9350610dae8188615a23565b965050610dbc565b50610dc7565b600201549050610d31565b50929450505050505b949350505050565b610de0613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e1d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e419190615964565b15610e5f57604051632b37d9d160e21b815260040160405180910390fd5b610e6f8383600080600086613c18565b505050565b610e7c613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610eb9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610edd9190615964565b15610efb57604051632b37d9d160e21b815260040160405180910390fd5b6001600160a01b0381166000908152601b60209081526040808320338085529252909120600381015483908390600160601b90046001600160401b0316610f57576040516330acea0d60e11b8152600401610958929190615a36565b50506003810154600160a01b810463ffffffff9081169116141580610f9a57506003810154600160c01b81046001600160401b03908116600160201b9092041614155b15610e6f57600381018054600160201b6001600160401b03600160c01b63ffffffff19841663ffffffff600160a01b8604811691821792909204831684026001600160601b03199095161793909317938490556040516001600160a01b0380881695908916947fa4c005afae9298a5ca51e7710c334ac406fb3d914588ade970850f917cedb1c694611033949183169392041690615a50565b60405180910390a3505050565b611048613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611085573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110a99190615964565b156110c757604051632b37d9d160e21b815260040160405180910390fd5b6110d033613d9e565b565b6110da613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611117573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061113b9190615964565b1561115957604051632b37d9d160e21b815260040160405180910390fd5b83836111668282336130b9565b82823390919261118c57604051630c76b97b60e41b815260040161095893929190615981565b50505061119c83620f4240101590565b83906111be57604051631504950160e21b815260040161095891815260200190565b506001600160a01b038087166000908152601c60209081526040808320938916835292905290812084918660028111156111fa576111fa615a6f565b600281111561120b5761120b615a6f565b815260208101919091526040016000205583600281111561122e5761122e615a6f565b856001600160a01b0316876001600160a01b03167f3474eba30406cacbfbc5a596a7e471662bbcccf206f8d244dbb6f4cc578c52208660405161127391815260200190565b60405180910390a4505050505050565b61128b613095565b6001600160a01b0316634fc07d756040518163ffffffff1660e01b8152600401602060405180830381865afa1580156112c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112ec91906159a4565b6001600160a01b0316336001600160a01b03161461131d57604051635d9044cd60e01b815260040160405180910390fd5b6001600160a01b038216600081815260226020908152604091829020805460ff191685151590811790915591519182527f4542960abc7f2d26dab244fc440acf511e3dd0f5cefad571ca802283b4751bbb91015b60405180910390a25050565b611385613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156113c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113e69190615964565b1561140457604051632b37d9d160e21b815260040160405180910390fd5b610e6f827f000000000000000000000000000000000000000000000000000000000000000083613e79565b6000611439613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611476573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061149a9190615964565b156114b857604051632b37d9d160e21b815260040160405180910390fd5b6001600160a01b038316600090815260146020908152604080832033808552600482019093529083209192909190807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663766718086040518163ffffffff1660e01b8152600401602060405180830381865afa158015611545573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115699190615a85565b905060008360020154118015611583575082600201548110155b1561159057826001015491505b600082116115b05760405162cf4d4760e51b815260040160405180910390fd5b60006001840181905560028401556040518281526001600160a01b0386811691908a16907f1b2e7737e043c5cf1b587ceb4daeb7ae00148b9bda8f79f1093eead08f1419529060200160405180910390a361161e858361160e613565565b6001600160a01b031691906140f1565b509695505050505050565b61163161514b565b61163961514b565b6000611645858561412c565b60028101548352600381015460208401526005810154604084015260068101546060840152600701546080830152509392505050565b611683613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156116c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116e49190615964565b1561170257604051632b37d9d160e21b815260040160405180910390fd5b8160000361172357604051630a2a4e5b60e11b815260040160405180910390fd5b6117303383610a2f613565565b61173c84848484613641565b50505050565b61174a613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611787573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117ab9190615964565b156117c957604051632b37d9d160e21b815260040160405180910390fd5b82826117d68282336130b9565b806117e95750336001600160a01b038216145b82823390919261180f57604051630c76b97b60e41b815260040161095893929190615981565b50505061181c85846141b0565b6118278585856141e8565b5050505050565b6001600160a01b038084166000908152601c6020908152604080832093861683529290529081208183600281111561186857611868615a6f565b600281111561187957611879615a6f565b81526020019081526020016000205490505b9392505050565b6000610dd08484846130b9565b6118a7613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156118e4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119089190615964565b1561192657604051632b37d9d160e21b815260040160405180910390fd5b83836119338282336130b9565b82823390919261195957604051630c76b97b60e41b815260040161095893929190615981565b5050506001600160a01b038681166000908152601b60209081526040808320938916835292905220600381015487908790600160601b90046001600160401b03166119b9576040516330acea0d60e11b8152600401610958929190615a36565b50506003810154600160a01b810463ffffffff908116908716141590600160c01b90046001600160401b03908116908616141581806119f55750805b15611b0d578115611a56578663ffffffff8116620f42401015611a34576040516329bff5f560e01b815263ffffffff9091166004820152602401610958565b5060038301805463ffffffff60a01b1916600160a01b63ffffffff8a16021790555b8015611ab657601a5486906001600160401b03908116908216811015611a915760405163ee5602e160e01b8152600401610958929190615a9e565b50506003830180546001600160c01b0316600160c01b6001600160401b038916021790555b428360040181905550876001600160a01b0316896001600160a01b03167fe89cbb9d63ba60af555547b12dde6817283e88cbdd45feb2059f2ba71ea346ba8989604051611b04929190615a50565b60405180910390a35b505050505050505050565b611b20613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611b5d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b819190615964565b15611b9f57604051632b37d9d160e21b815260040160405180910390fd5b8484611bac8282336130b9565b828233909192611bd257604051630c76b97b60e41b815260040161095893929190615981565b5050506001600160a01b038616600090815260226020526040902054869060ff16611c1057604051622920f760e21b8152600401610958919061553e565b50610971878688878761317d565b600080611c2b8585613846565b90506000611c398686614328565b90506000611c4d63ffffffff8616846159d7565b90506000611c5b838361434b565b9050611c678185615a23565b98975050505050505050565b611c7b61517a565b611c8361517a565b6001600160a01b039092166000908152600e602090815260409091208054845260040154908301525090565b82806001600160a01b031663f851a4406040518163ffffffff1660e01b81526004016020604051808303816000875af1158015611cf0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d1491906159a4565b6001600160a01b0316336001600160a01b031614611d445760405162461bcd60e51b815260040161095890615ab8565b60405163623faf6160e01b81526001600160a01b0385169063623faf6190611d729086908690600401615aef565b600060405180830381600087803b158015611d8c57600080fd5b505af1158015611da0573d6000803e3d6000fd5b5050505050505050565b6000611db4613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611df1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e159190615964565b15611e3357604051632b37d9d160e21b815260040160405180910390fd5b610dd0848484613e79565b80806001600160a01b031663f851a4406040518163ffffffff1660e01b81526004016020604051808303816000875af1158015611e7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ea391906159a4565b6001600160a01b0316336001600160a01b031614611ed35760405162461bcd60e51b815260040161095890615ab8565b816001600160a01b03166359fc20bb6040518163ffffffff1660e01b8152600401600060405180830381600087803b158015611f0e57600080fd5b505af1158015610b4d573d6000803e3d6000fd5b611f2a613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611f67573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f8b9190615964565b15611fa957604051632b37d9d160e21b815260040160405180910390fd5b610a6c82826141b0565b611fbb613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611ff8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061201c9190615964565b1561203a57604051632b37d9d160e21b815260040160405180910390fd5b610cd333826141b0565b6000610a7f82614362565b604080516000815260208101909152606090826001600160401b0381111561207957612079615b1e565b6040519080825280602002602001820160405280156120ac57816020015b60608152602001906001900390816120975790505b50915060005b8381101561212e57612109308686848181106120d0576120d0615b34565b90506020028101906120e29190615b4a565b856040516020016120f593929190615b90565b6040516020818303038152906040526143d3565b83828151811061211b5761211b615b34565b60209081029190910101526001016120b2565b505092915050565b61213e613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561217b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061219f9190615964565b156121bd57604051632b37d9d160e21b815260040160405180910390fd5b6001600160a01b038316600090815260226020526040902054839060ff166121f857604051622920f760e21b8152600401610958919061553e565b50610e6f838383614449565b61220c613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612249573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061226d9190615964565b1561228b57604051632b37d9d160e21b815260040160405180910390fd5b83836122988282336130b9565b8282339091926122be57604051630c76b97b60e41b815260040161095893929190615981565b50505085846122ce8282336130b9565b8282339091926122f457604051630c76b97b60e41b815260040161095893929190615981565b505050600061230489898861387e565b9050611b0d8988836141e8565b612319613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612356573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061237a9190615964565b1561239857604051632b37d9d160e21b815260040160405180910390fd5b610e6f838383614449565b6123ab613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156123e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061240c9190615964565b1561242a57604051632b37d9d160e21b815260040160405180910390fd5b8060000361244b57604051630a2a4e5b60e11b815260040160405180910390fd5b6001600160a01b038084166000908152601b6020908152604080832093861683529281529082902082516101408101845281548152600182015492810192909252600281015492820192909252600382015463ffffffff80821660608401526001600160401b03600160201b830481166080850152600160601b8304811660a08501819052600160a01b840490921660c0850152600160c01b90920490911660e08301526004830154610100830152600590920154610120820152908490849061252a576040516330acea0d60e11b8152600401610958929190615a36565b50506000612538858561412c565b90506000816003015411858590916125655760405163b6a70b3b60e01b8152600401610958929190615a36565b50508281600201546125779190615a23565b60028201556125893384610a2f613565565b836001600160a01b0316856001600160a01b03167f673007a04e501145e79f59aea5e0413b6e88344fdaf10326254530d6a1511530856040516125ce91815260200190565b60405180910390a35050505050565b6040805160208101909152600081526040805160208101909152600081526000612607868661412c565b6001600160a01b03851660009081526004909101602052604090205482525090509392505050565b60408051608081018252600080825260208201819052918101829052606081019190915261265d8383613bc8565b604080516080810182528254815260018301546001600160401b0316602082015260028301549181019190915260039091015460608201529392505050565b6126a4613095565b6001600160a01b0316634fc07d756040518163ffffffff1660e01b8152600401602060405180830381865afa1580156126e1573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061270591906159a4565b6001600160a01b0316336001600160a01b03161461273657604051635d9044cd60e01b815260040160405180910390fd5b600d805463ffffffff191690556040517f93be484d290d119d9cf99cce69d173c732f9403333ad84f69c807b590203d10990600090a1565b60408051608081018252600080825260208201819052918101829052606081019190915261279e85858585613b5c565b604080516080810182528254815260018301546020820152600283015491810191909152600390910154606082015295945050505050565b6127de613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561281b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061283f9190615964565b1561285d57604051632b37d9d160e21b815260040160405180910390fd5b3360009081526012602052604090205460ff1615612966576040516001600160a01b038581166024830152604482018590526064820184905282811660848301526000917f00000000000000000000000000000000000000000000000000000000000000009091169060a40160408051601f198184030181529181526020820180516001600160e01b031663224451c160e11b179052516128fe9190615bb7565b600060405180830381855af49150503d8060008114612939576040519150601f19603f3d011682016040523d82523d6000602084013e61293e565b606091505b50509050806129605760405163ef370f5160e01b815260040160405180910390fd5b5061173c565b6001600160a01b0384166000908152601b6020908152604080832033808552925282209091612995878461412c565b90506000816002015483600001546129ad9190615a23565b9050806000036129d057604051630a8a55c960e31b815260040160405180910390fd5b60006129dc888361434b565b905060006129ee85600001548361434b565b90508015612be8576003850154600090612a1390839063ffffffff9081169061457916565b9050888181811015612a3a57604051632f514d5760e21b8152600401610958929190615bd3565b50508815612aa757612a4f888a61160e613565565b876001600160a01b0316876001600160a01b03168c6001600160a01b03167f95ff4196cd75fa49180ba673948ea43935f59e7c4ba101fa09b9fe0ec266d5828c604051612a9e91815260200190565b60405180910390a45b612acb612ab48a84615a10565b612abc613565565b6001600160a01b0316906145d9565b8554612ad78382615a10565b8760010154612ae691906159d7565b612af091906159ee565b60018701558554612b02908390615a10565b8655600286015415801590612b1957506001860154155b15612b3d5760006002870181905560058701805491612b3783615be1565b91905055505b6001600160a01b038b166000908152600e6020526040902060040154612b64908390615a10565b6001600160a01b038c166000908152600e60205260409020600481019190915554612b90908390615a10565b6001600160a01b038c81166000818152600e60209081526040918290209490945551858152918a169290917fe7b110f13cde981d5079ab7faa4249c5f331f5c292dbc6031969d2ce694188a3910160405180910390a3505b612bf28183615a10565b91508115612d2c5760205460ff1615612cde57612c1182612abc613565565b6002840154612c208382615a10565b8560050154612c2f91906159d7565b612c3991906159ee565b60058501556002840154612c4e908390615a10565b6002850155600684015415801590612c6857506005840154155b15612c8c5760006006850181905560078501805491612c8683615be1565b91905055505b856001600160a01b03168a6001600160a01b03167fc5d16dbb577cf07678b577232717c9a606197a014f61847e623d47fc6bf6b77184604051612cd191815260200190565b60405180910390a3612d2c565b856001600160a01b03168a6001600160a01b03167fdce44f0aeed2089c75db59f5a517b9a19a734bf0213412fa129f0d0434126b2484604051612d2391815260200190565b60405180910390a35b50505050505050505050565b612d40613095565b6001600160a01b0316634fc07d756040518163ffffffff1660e01b8152600401602060405180830381865afa158015612d7d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612da191906159a4565b6001600160a01b0316336001600160a01b031614612dd257604051635d9044cd60e01b815260040160405180910390fd5b6020805460ff191660011790556040517f2192802a8934dbf383338406b279ec7f3eccee31e58d6c0444d6dd6bfff24b3590600090a1565b612e12613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612e4f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e739190615964565b15612e9157604051632b37d9d160e21b815260040160405180910390fd5b6001600160a01b038416612eb8576040516322347d6760e21b815260040160405180910390fd5b6001600160a01b038316612edf5760405163a962605960e01b815260040160405180910390fd5b610b4d868686868686613c18565b6000612ef7613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612f34573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f589190615964565b15612f7657604051632b37d9d160e21b815260040160405180910390fd5b8383612f838282336130b9565b828233909192612fa957604051630c76b97b60e41b815260040161095893929190615981565b505050612fb7868686614621565b9695505050505050565b6000610a7c8383614328565b612fd5613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015613012573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130369190615964565b1561305457604051632b37d9d160e21b815260040160405180910390fd5b82826130618282336130b9565b82823390919261308757604051630c76b97b60e41b815260040161095893929190615981565b5050506118278585856141e8565b7f000000000000000000000000000000000000000000000000000000000000000090565b6000836001600160a01b0316826001600160a01b0316036130dc5750600161188b565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b03160361314457506001600160a01b0380841660009081526015602090815260408083209385168352929052205460ff1661188b565b506001600160a01b038084166000908152601f60209081526040808320868516845282528083209385168352929052205460ff1661188b565b6000841161319e57604051630a2a4e5b60e11b815260040160405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b031614806131e45750600d5463ffffffff16155b83906132045760405163353666ff60e01b8152600401610958919061553e565b508163ffffffff8116620f42401015613239576040516329bff5f560e01b815263ffffffff9091166004820152602401610958565b50601a5481906001600160401b0390811690821681101561326f5760405163ee5602e160e01b8152600401610958929190615a9e565b50506001600160a01b038581166000908152601b6020908152604080832093871683529290522060030154600160601b90046001600160401b0316156132c857604051632b542c0d60e11b815260040160405180910390fd5b60006132d386614362565b90508481808211156132fa5760405163ccaf28a960e01b8152600401610958929190615bd3565b505060405180610140016040528086815260200160008152602001600081526020018463ffffffff168152602001836001600160401b03168152602001426001600160401b031681526020018463ffffffff168152602001836001600160401b03168152602001600081526020016000815250601b6000886001600160a01b03166001600160a01b031681526020019081526020016000206000866001600160a01b03166001600160a01b0316815260200190815260200160002060008201518160000155602082015181600101556040820151816002015560608201518160030160006101000a81548163ffffffff021916908363ffffffff16021790555060808201518160030160046101000a8154816001600160401b0302191690836001600160401b0316021790555060a082015181600301600c6101000a8154816001600160401b0302191690836001600160401b0316021790555060c08201518160030160146101000a81548163ffffffff021916908363ffffffff16021790555060e08201518160030160186101000a8154816001600160401b0302191690836001600160401b03160217905550610100820151816004015561012082015181600501559050506000600e6000886001600160a01b03166001600160a01b0316815260200190815260200160002090508581600401546134fa9190615a23565b60048201556040805187815263ffffffff861660208201526001600160401b0385168183015290516001600160a01b0387811692908a16917f88b4c2d08cea0f01a24841ff5d14814ddb5b14ac44b05e0835fcc0dcd8c7bc259181900360600190a350505050505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b8015610e6f576040516323b872dd60e01b81526001600160a01b038381166004830152306024830152604482018390528416906323b872dd906064015b6020604051808303816000875af11580156135e5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906136099190615964565b610e6f5760405162461bcd60e51b815260206004820152600960248201526810ba3930b739b332b960b91b6044820152606401610958565b81670de0b6b3a76400008082101561366e5760405163b86d885760e01b8152600401610958929190615bd3565b50506001600160a01b038481166000908152601b602090815260408083209387168352929052206003015484908490600160601b90046001600160401b03166136cc576040516330acea0d60e11b8152600401610958929190615a36565b505060006136da858561412c565b336000908152600482016020526040902060028201549192509015158061370357506003820154155b8686909161372657604051631984edef60e31b8152600401610958929190615a36565b50506000826002015460001480613744575082600501548360020154145b905060008161377f57836005015484600201546137619190615a10565b600385015461377090886159d7565b61377a91906159ee565b613781565b855b905080158015906137925750848110155b818690916137b557604051635d88e8d160e01b8152600401610958929190615bd3565b50508584600201546137c79190615a23565b600285015560038401546137dc908290615a23565b600385015582546137ee908290615a23565b835560405133906001600160a01b0389811691908b16907f237818af8bb47710142edd8fc301fbc507064fb357cf122fb161ca447e3cb13e90613834908b908790615bd3565b60405180910390a45050505050505050565b6001600160a01b038281166000908152601b60209081526040808320938516835292905290812060018101549054610a7c9190615a10565b6001600160a01b038381166000818152601b60209081526040808320948716808452948252808320600281015460018201548351610100810185528681529485018790529284019690965260608301949094526080820181905260a0820185905260c08201869052600584015460e08301529193849290916138ff816147b3565b875492965094509250613913908590615a10565b855560028501839055600185018290556001600160a01b0389166000908152600e60205260408120600401805486929061394e908490615a10565b92505081905550876001600160a01b0316896001600160a01b03167f9008d731ddfbec70bc364780efd63057c6877bee8027c4708a104b365395885d8660405161399a91815260200190565b60405180910390a35091979650505050505050565b3360008290036139d257604051630a2a4e5b60e11b815260040160405180910390fd5b60006139dd82614362565b9050828180821115613a045760405163ccaf28a960e01b8152600401610958929190615bd3565b50506001600160a01b0382166000908152600e602052604081208054600d549192909163ffffffff1690819003613a9657613a3f8683615a10565b8355613a4e858761160e613565565b846001600160a01b03167f32eed9ebc5696170068a371fdbea4c076da1bc21b305e78ca0a5e65ee913be8387604051613a8991815260200190565b60405180910390a2610b4d565b600283015415801590613aad575082600301544310155b15613abb57613abb85613d9e565b600283015415613ae557613ae2613ad68460030154436148ad565b846002015483896148c7565b90505b858360020154613af59190615a23565b6002840155613b048143615a23565b6003840181905560028401546040516001600160a01b038816927f91642f23a1196e1424949fafa2a428c3b5d1f699763942ff08a6fbe9d4d7e98092613b4c92909190615bd3565b60405180910390a2505050505050565b6000601e6000866001811115613b7457613b74615a6f565b6001811115613b8557613b85615a6f565b8152602080820192909252604090810160009081206001600160a01b03978816825283528181209587168152948252808520939095168452919091525020919050565b6000601d6000846001811115613be057613be0615a6f565b6001811115613bf157613bf1615a6f565b81526020019081526020016000206000838152602001908152602001600020905092915050565b6000613c24878761412c565b905080600201546000141580613c3c57506003810154155b87879091613c5f57604051631984edef60e31b8152600401610958929190615a36565b5050600681015460058201546040805161010081018252600181526001600160a01b03808c1660208301528a16918101919091523360608201526080810182905260a0810183905260c08101859052600784015460e08201526000929190613cc6816147b3565b600288015492965094509250613cdd908590615a10565b600286015560068501839055600585018290558315613d91576001600160a01b03891615801590613d1657506001600160a01b03881615155b15613d2c57613d278989868a613641565b613d91565b613d39338561160e613565565b336001600160a01b03168a6001600160a01b03168c6001600160a01b03167f305f519d8909c676ffd870495d4563032eb0b506891a6dd9827490256cc9914e87604051613d8891815260200190565b60405180910390a45b5050505050505050505050565b6001600160a01b0381166000908152600e6020526040812060028101549091819003613ddd57604051630a2a4e5b60e11b815260040160405180910390fd5b600382015443811115613e0657604051631d222f1b60e31b815260040161095891815260200190565b5060006002830181905560038301558154613e22908290615a10565b8255613e31838261160e613565565b826001600160a01b03167f32eed9ebc5696170068a371fdbea4c076da1bc21b305e78ca0a5e65ee913be8382604051613e6c91815260200190565b60405180910390a2505050565b6000808211613e9b57604051637318ad9960e01b815260040160405180910390fd5b6000613ea7858561412c565b33600090815260048201602052604090208054919250908480821015613ee25760405163ab99793560e01b8152600401610958929190615bd3565b5050600282015486908690613f0c57604051631984edef60e31b8152600401610958929190615a36565b50506000826003015483600501548460020154613f299190615a10565b613f3390876159d7565b613f3d91906159ee565b905060008360050154600014613f705760058401546006850154613f6190846159d7565b613f6b91906159ee565b613f72565b815b6001600160a01b038981166000908152601b60209081526040808320938c1683529290529081206003015491925090613fbb90600160201b90046001600160401b031642615a23565b9050828560050154613fcd9190615a23565b60058601556006850154613fe2908390615a23565b60068601556003850154613ff7908890615a10565b60038601558354614009908890615a10565b8085551561407557600085600301548660050154876002015461402c9190615a10565b865461403891906159d7565b61404291906159ee565b905080670de0b6b3a7640000808210156140715760405163587ab9ab60e11b8152600401610958929190615bd3565b5050505b600061408b60018b8b3387878c6007015461491b565b9050336001600160a01b0316896001600160a01b03168b6001600160a01b03167f0525d6ad1aa78abc571b5c1984b5e1ea4f1412368c1cc348ca408dbb1085c9a1878c6040516140dc929190615bd3565b60405180910390a49998505050505050505050565b8015610e6f5760405163a9059cbb60e01b81526001600160a01b0383811660048301526024820183905284169063a9059cbb906044016135c6565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b03160361418557506001600160a01b0382166000908152601460205260409020610a7f565b506001600160a01b038083166000908152602160209081526040808320938516835292905220610a7f565b806000036141d157604051630a2a4e5b60e11b815260040160405180910390fd5b6141de3382610a2f613565565b610a6c8282614ac1565b8060000361420957604051630a2a4e5b60e11b815260040160405180910390fd5b6001600160a01b038381166000908152601b60209081526040808320938616835292905220600381015484908490600160601b90046001600160401b0316614266576040516330acea0d60e11b8152600401610958929190615a36565b5050600061427385614362565b905082818082111561429a5760405163ccaf28a960e01b8152600401610958929190615bd3565b505081546142a9908490615a23565b82556001600160a01b0385166000908152600e60205260409020600401546142d2908490615a23565b6001600160a01b038681166000818152600e602090815260409182902060040194909455518681529187169290917feaf6ea3a42ed2fd1b6d575f818cbda593af9524aa94bd30e65302ac4dc23474591016125ce565b600080614335848461412c565b905080600501548160020154610dd09190615a10565b60008183111561435b5781610a7c565b5090919050565b6001600160a01b0381166000908152600e6020526040812060028101546001820154600490920154839261439591615a23565b61439f9190615a23565b6001600160a01b0384166000908152600e60205260409020549091508181116143c9576000610dd0565b610dd08282615a10565b6060600080846001600160a01b0316846040516143f09190615bb7565b600060405180830381855af49150503d806000811461442b576040519150601f19603f3d011682016040523d82523d6000602084013e614430565b606091505b5091509150614440858383614b34565b95945050505050565b336001600160a01b0383160361447257604051630123065360e01b815260040160405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b0316036144df573360009081526015602090815260408083206001600160a01b03861684529091529020805460ff191682151517905561451b565b336000908152601f602090815260408083206001600160a01b03878116855290835281842090861684529091529020805460ff19168215151790555b816001600160a01b0316836001600160a01b0316336001600160a01b03167faa5a59b38e8f68292982382bf635c2f263ca37137bbc52956acd808fd7bf976f8460405161456c911515815260200190565b60405180910390a4505050565b600061458883620f4240101590565b8061459b575061459b82620f4240101590565b838390916145be5760405163768bf0eb60e11b8152600401610958929190615bd3565b50620f424090506145cf83856159d7565b610a7c91906159ee565b8015610a6c57604051630852cd8d60e31b8152600481018290526001600160a01b038316906342966c6890602401600060405180830381600087803b158015611f0e57600080fd5b60008160000361464457604051630a2a4e5b60e11b815260040160405180910390fd5b60006146508585613846565b90508083808210156146775760405163587ab9ab60e11b8152600401610958929190615bd3565b50506001600160a01b038086166000908152601b6020908152604080832093881683529290529081206001810154909190156146ec578160010154600183600101548785600201546146c991906159d7565b6146d39190615a23565b6146dd9190615a10565b6146e791906159ee565b6146ee565b845b600383015490915060009061471390600160201b90046001600160401b031642615a23565b90508183600201546147259190615a23565b6002840155600183015461473a908790615a23565b8360010181905550600061475860008a8a8c87878a6005015461491b565b9050876001600160a01b0316896001600160a01b03167f3b81913739097ced1e7fa748c6058d34e2c00b961fb501094543b397b198fdaa8960405161479f91815260200190565b60405180910390a398975050505050505050565b6000806000806147d58560000151866020015187604001518860600151613b5c565b905060008160030154116147fc576040516307e332c560e31b815260040160405180910390fd5b60006148088683614b87565b905085604001516001600160a01b031686602001516001600160a01b03168760000151600181111561483c5761483c615a6f565b6060808a01518551602080880151604080516001600160a01b039095168552918401929092528201527f86c2f162872d7c46d7ee0caad366da6dc430889b9d8f27e4bed3785548f9954b910160405180910390a4602081015160408201516060909201519097919650945092505050565b60008183116148bd576000610a7c565b610a7c8284615a10565b60006148d38285615a23565b60016148df8487615a23565b6148e99190615a10565b6148f384866159d7565b6148fd87896159d7565b6149079190615a23565b6149119190615a23565b61444091906159ee565b60008360000361493e57604051637318ad9960e01b815260040160405180910390fd5b600061494c89898989613b5c565b90506103e88160030154106149745760405163332b852b60e11b815260040160405180910390fd5b60028101546040516001600160601b031960608b811b821660208401528a811b8216603484015289901b166048820152605c810191909152600090607c0160405160208183030381529060405280519060200120905060006149d68b83613bc8565b8781556001810180546001600160401b0319166001600160401b03891617905560006002820155600380820187905584015490915015614a245781614a1f8c8560010154613bc8565b600201555b614a2e8383614c82565b886001600160a01b03168a6001600160a01b03168c6001811115614a5457614a54615a6f565b604080516001600160a01b038d168152602081018c90526001600160401b038b168183015260608101879052608081018a905290517f036538df4a591a5cc74b68cfc7f8c61e8173dbc81627e1d62600b61e820461789181900360a00190a4509998505050505050505050565b6001600160a01b0382166000908152600e6020526040902054614ae5908290615a23565b6001600160a01b0383166000818152600e6020526040908190209290925590517f48c384dd8bdf1e06d8afecd810c4acfc3d553ac5d879dec5a69875dbbd90e14b906113719084815260200190565b606082614b4957614b4482614d15565b61188b565b8151158015614b6057506001600160a01b0384163b155b15614b805783604051639996b31560e01b8152600401610958919061553e565b508061188b565b614bb26040518060800160405280600081526020016000815260200160008152602001600081525090565b615194614bc28460000151614d3e565b9050615194614bd48560000151614da3565b905060008560000151600087608001518860a001518960e00151604051602001614c02959493929190615bfa565b6040516020818303038152906040529050600080614c3785614dea86868c60c001518c614f5a9095949392919063ffffffff16565b91509150600080600083806020019051810190614c549190615c3d565b60408051608081018252998a5260208a019390935291880152606087015250939a9950505050505050505050565b612710826003015410614ca8576040516303a8c56b60e61b815260040160405180910390fd5b80614cc657604051638f4a893d60e01b815260040160405180910390fd5b6001808301829055600283018054600090614ce2908490615a23565b90915550506003820154600003614cf7578082555b6001826003016000828254614d0c9190615a23565b90915550505050565b805115614d255780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b6151946000826001811115614d5557614d55615a6f565b03614d635750615014919050565b6001826001811115614d7757614d77615a6f565b03614d855750615056919050565b604051636bd1fba760e11b815260040160405180910390fd5b919050565b6151946000826001811115614dba57614dba615a6f565b03614dc85750615062919050565b6001826001811115614ddc57614ddc615a6f565b03614d8557506150b9919050565b60006060600080600080600087806020019051810190614e0a9190615c7c565b945094509450945094506000614e20868b613bc8565b6001810154909150426001600160401b039091161115614e5b5760016040518060200160405280600081525097509750505050505050614f53565b600381015460009083148015614eae5782548590614e7a9088906159d7565b614e8491906159ee565b9150614e908287615a10565b8354909650614e9f9086615a10565b9450614eab8288615a23565b96505b8b886001811115614ec157614ec1615a6f565b845460018601546040805187815260208101939093526001600160401b03909116828201528415156060830152517f469e89d0a4e0e5deb2eb1ade5b3fa67fdfbeb4787c3a7c1e8e89aaf28562cab29181900360800190a38787878787604051602001614f32959493929190615bfa565b6040516020818303038152906040529a5060008b9950995050505050505050505b9250929050565b600060608760030154831115614f8357604051634a411b9d60e11b815260040160405180910390fd5b60008315614f915783614f97565b88600301545b89549094505b8015801590614fac5750600085115b1561500557600080614fc283898c63ffffffff16565b915091508115614fd3575050615005565b965086614fe18c8c8b6150c4565b925086614fed81615cc5565b9750508380614ffb90615be1565b9450505050614f9d565b50989397509295505050505050565b6000601d81805b600181111561502c5761502c615a6f565b81526020019081526020016000206000838152602001908152602001600020600201549050919050565b6000601d81600161501b565b601d6000805b600181111561507957615079615a6f565b8152602080820192909252604090810160009081209381529290915281208181556001810180546001600160401b03191690556002810182905560030155565b601d60006001615068565b6000808460030154116150ea5760405163ddaf8f2160e01b815260040160405180910390fd5b60006150fd85600001548563ffffffff16565b905061511085600001548463ffffffff16565b60018560030160008282546151259190615a10565b9091555050808555600385015460000361514157600060018601555b5050915492915050565b6040518060a0016040528060008152602001600081526020016000815260200160008152602001600081525090565b604051806040016040528060008152602001600081525090565b6110d0615cdc565b6001600160a01b0381168114610cd357600080fd5b803563ffffffff81168114614d9e57600080fd5b80356001600160401b0381168114614d9e57600080fd5b600080600080600060a086880312156151f457600080fd5b85356151ff8161519c565b9450602086013561520f8161519c565b935060408601359250615224606087016151b1565b9150615232608087016151c5565b90509295509295909350565b6000806040838503121561525157600080fd5b823561525c8161519c565b946020939093013593505050565b6000806040838503121561527d57600080fd5b82356152888161519c565b915060208301356152988161519c565b809150509250929050565b6000806000606084860312156152b857600080fd5b83356152c38161519c565b925060208401356152d38161519c565b929592945050506040919091013590565b6000602082840312156152f657600080fd5b610a7c826151c5565b6000610140820190508251825260208301516020830152604083015160408301526060830151615337606084018263ffffffff169052565b50608083015161535260808401826001600160401b03169052565b5060a083015161536d60a08401826001600160401b03169052565b5060c083015161538560c084018263ffffffff169052565b5060e08301516153a060e08401826001600160401b03169052565b5061010083015161010083015261012083015161012083015292915050565b6000602082840312156153d157600080fd5b5035919050565b60028110610cd357600080fd5b600080600080608085870312156153fb57600080fd5b8435615406816153d8565b935060208501356154168161519c565b925060408501356154268161519c565b915060608501356154368161519c565b939692955090935050565b60006020828403121561545357600080fd5b813561188b8161519c565b803560038110614d9e57600080fd5b6000806000806080858703121561548357600080fd5b843561548e8161519c565b9350602085013561549e8161519c565b92506154ac6040860161545e565b9396929550929360600135925050565b8015158114610cd357600080fd5b600080604083850312156154dd57600080fd5b82356154e88161519c565b91506020830135615298816154bc565b6000806000806080858703121561550e57600080fd5b84356155198161519c565b935060208501356155298161519c565b93969395505050506040820135916060013590565b6001600160a01b0391909116815260200190565b60008060006060848603121561556757600080fd5b83356155728161519c565b925060208401356155828161519c565b91506155906040850161545e565b90509250925092565b6000806000606084860312156155ae57600080fd5b83356155b98161519c565b925060208401356155c98161519c565b915060408401356155d98161519c565b809150509250925092565b600080600080608085870312156155fa57600080fd5b84356156058161519c565b935060208501356156158161519c565b9250615623604086016151b1565b9150615631606086016151c5565b905092959194509250565b60008060006060848603121561565157600080fd5b833561565c8161519c565b9250602084013561566c8161519c565b9150615590604085016151b1565b60008060006040848603121561568f57600080fd5b833561569a8161519c565b925060208401356001600160401b038111156156b557600080fd5b8401601f810186136156c657600080fd5b80356001600160401b038111156156dc57600080fd5b8660208284010111156156ee57600080fd5b939660209190910195509293505050565b6000806020838503121561571257600080fd5b82356001600160401b0381111561572857600080fd5b8301601f8101851361573957600080fd5b80356001600160401b0381111561574f57600080fd5b8560208260051b840101111561576457600080fd5b6020919091019590945092505050565b60005b8381101561578f578181015183820152602001615777565b50506000910152565b6000602082016020835280845180835260408501915060408160051b86010192506020860160005b8281101561580c57603f19878603018452815180518087526157e9816020890160208501615774565b601f01601f191695909501602090810195509384019391909101906001016157c0565b50929695505050505050565b60008060006060848603121561582d57600080fd5b83356158388161519c565b925060208401356158488161519c565b915060408401356155d9816154bc565b6000806000806080858703121561586e57600080fd5b84356158798161519c565b935060208501356158898161519c565b925060408501356154ac8161519c565b600080604083850312156158ac57600080fd5b823561525c816153d8565b600080600080608085870312156158cd57600080fd5b84356158d88161519c565b9350602085013592506040850135915060608501356154368161519c565b60008060008060008060c0878903121561590f57600080fd5b863561591a8161519c565b9550602087013561592a8161519c565b9450604087013561593a8161519c565b9350606087013561594a8161519c565b9598949750929560808101359460a0909101359350915050565b60006020828403121561597657600080fd5b815161188b816154bc565b6001600160a01b0393841681529183166020830152909116604082015260600190565b6000602082840312156159b657600080fd5b815161188b8161519c565b634e487b7160e01b600052601160045260246000fd5b8082028115828204841417610a7f57610a7f6159c1565b600082615a0b57634e487b7160e01b600052601260045260246000fd5b500490565b81810381811115610a7f57610a7f6159c1565b80820180821115610a7f57610a7f6159c1565b6001600160a01b0392831681529116602082015260400190565b63ffffffff9290921682526001600160401b0316602082015260400190565b634e487b7160e01b600052602160045260246000fd5b600060208284031215615a9757600080fd5b5051919050565b6001600160401b0392831681529116602082015260400190565b6020808252601e908201527f43616c6c6572206d757374206265207468652070726f78792061646d696e0000604082015260600190565b60208152816020820152818360408301376000818301604090810191909152601f909201601f19160101919050565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112615b6157600080fd5b8301803591506001600160401b03821115615b7b57600080fd5b602001915036819003821315614f5357600080fd5b828482376000838201600081528351615bad818360208801615774565b0195945050505050565b60008251615bc9818460208701615774565b9190910192915050565b918252602082015260400190565b600060018201615bf357615bf36159c1565b5060010190565b60a0810160028710615c1c57634e487b7160e01b600052602160045260246000fd5b95815260208101949094526040840192909252606083015260809091015290565b60008060008060808587031215615c5357600080fd5b8451615c5e816153d8565b60208601516040870151606090970151919890975090945092505050565b600080600080600060a08688031215615c9457600080fd5b8551615c9f816153d8565b602087015160408801516060890151608090990151929a91995097965090945092505050565b600081615cd457615cd46159c1565b506000190190565b634e487b7160e01b600052605160045260246000fdfea2646970667358221220f5046670ab269f9c179f41df4a02cd9c6b2ca3d5d507e2b9fcf15f800f351d8b64736f6c634300081b0033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106102565760003560e01c8063872d048911610142578063872d0489146106225780638cc01c86146106355780639ce7abe514610663578063a02b942614610676578063a2594d8214610689578063a2a317221461069c578063a694fc3a146106af578063a784d498146106c2578063ac9650d8146106d5578063ad4d35b5146106f5578063ae4fe67a14610708578063ba7fb0b414610734578063bc735d9014610747578063ca94b0e91461075a578063ccebcabb1461076d578063d48de8451461078f578063e473522a146107de578063e56f8a1d146107e6578063e76fede61461082c578063ef58bd671461083f578063f64b359814610847578063f93f1cd01461085a578063fb744cc01461086d578063fc54fb2714610880578063fecc9cc11461088b57610256565b8063010167e51461029f578063026e402b146102b257806308ce5f68146102c557806321195373146102eb578063259bc435146102fe57806325d9897e146103115780632e17de78146104395780632f7cc5011461044c57806339514ad21461045f5780633993d8491461047a5780633a78b7321461048d5780633ccfd60b146104a057806342c51693146104a85780634ca7ac22146104bb5780634d99dd16146104ce57806351a60b02146104e1578063561285e4146104f45780636230001a1461054957806366ee1b281461055c578063746120921461058a5780637573ef4f1461059d5780637a766460146105b05780637c145cc7146105d957806381e21b56146105fc57806382d66cb81461060f575b6040517f00000000000000000000000000000000000000000000000000000000000000009036600082376000803683855af43d806000843e818015610299578184f35b8184fd5b005b61029d6102ad3660046151dc565b61089e565b61029d6102c036600461523e565b61097a565b6102d86102d336600461526a565b610a70565b6040519081526020015b60405180910390f35b61029d6102f93660046152a3565b610a85565b61029d61030c3660046152e4565b610b55565b61042c61031f36600461526a565b6040805161014081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101829052610120810191909152506001600160a01b039182166000908152601b6020908152604080832093909416825291825282902082516101408101845281548152600182015492810192909252600281015492820192909252600382015463ffffffff8082166060840152600160201b82046001600160401b039081166080850152600160601b8304811660a0850152600160a01b830490911660c0840152600160c01b9091041660e0820152600482015461010082015260059091015461012082015290565b6040516102e291906152ff565b61029d6104473660046153bf565b610c43565b6102d861045a3660046153e5565b610cd6565b601a546040516001600160401b0390911681526020016102e2565b61029d6104883660046152a3565b610dd8565b61029d61049b366004615441565b610e74565b61029d611040565b61029d6104b636600461546d565b6110d2565b61029d6104c93660046154ca565b611283565b61029d6104dc36600461523e565b61137d565b6102d86104ef36600461526a565b61142f565b61050761050236600461526a565b611629565b6040516102e29190600060a082019050825182526020830151602083015260408301516040830152606083015160608301526080830151608083015292915050565b61029d6105573660046154f8565b61167b565b7f00000000000000000000000000000000000000000000000000000000000000006040516102e2919061553e565b61029d6105983660046152a3565b611742565b6102d86105ab366004615552565b61182e565b6102d86105be366004615441565b6001600160a01b03166000908152600e602052604090205490565b6105ec6105e7366004615599565b611892565b60405190151581526020016102e2565b61029d61060a3660046155e4565b61189f565b61029d61061d3660046151dc565b611b18565b6102d861063036600461563c565b611c1e565b610648610643366004615441565b611c73565b604080518251815260209283015192810192909252016102e2565b61029d61067136600461567a565b611caf565b6102d86106843660046152a3565b611daa565b61029d610697366004615441565b611e3e565b61029d6106aa36600461523e565b611f22565b61029d6106bd3660046153bf565b611fb3565b6102d86106d0366004615441565b612044565b6106e86106e33660046156ff565b61204f565b6040516102e29190615798565b61029d610703366004615818565b612136565b6105ec610716366004615441565b6001600160a01b031660009081526022602052604090205460ff1690565b61029d610742366004615858565b612204565b61029d610755366004615818565b612311565b61029d6107683660046152a3565b6123a3565b61078061077b366004615599565b6125dd565b604051905181526020016102e2565b6107a261079d366004615899565b61262f565b6040516102e29190815181526020808301516001600160401b031690820152604080830151908201526060918201519181019190915260800190565b61029d61269c565b6107f96107f43660046153e5565b61276e565b6040516102e291908151815260208083015190820152604080830151908201526060918201519181019190915260800190565b61029d61083a3660046158b7565b6127d6565b61029d612d38565b61029d6108553660046158f6565b612e0a565b6102d86108683660046152a3565b612eed565b6102d861087b36600461526a565b612fc1565b60205460ff166105ec565b61029d6108993660046152a3565b612fcd565b6108a6613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108e3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109079190615964565b1561092557604051632b37d9d160e21b815260040160405180910390fd5b84846109328282336130b9565b82823390919261096157604051630c76b97b60e41b815260040161095893929190615981565b60405180910390fd5b505050610971878688878761317d565b50505050505050565b610982613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156109bf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109e39190615964565b15610a0157604051632b37d9d160e21b815260040160405180910390fd5b80600003610a2257604051630a2a4e5b60e11b815260040160405180910390fd5b610a3f3382610a2f613565565b6001600160a01b03169190613589565b610a6c827f0000000000000000000000000000000000000000000000000000000000000000836000613641565b5050565b6000610a7c8383613846565b90505b92915050565b8282610a928282336130b9565b828233909192610ab857604051630c76b97b60e41b815260040161095893929190615981565b505050610ac3613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b00573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b249190615964565b15610b4257604051632b37d9d160e21b815260040160405180910390fd5b610b4d85858561387e565b505050505050565b610b5d613095565b6001600160a01b0316634fc07d756040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b9a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bbe91906159a4565b6001600160a01b0316336001600160a01b031614610bef57604051635d9044cd60e01b815260040160405180910390fd5b601a80546001600160401b0319166001600160401b0383169081179091556040519081527fe8526be46fa99b6313d439293c9be3491ffb067741bc8fce9d30c270cbb8459f9060200160405180910390a150565b610c4b613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c88573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cac9190615964565b15610cca57604051632b37d9d160e21b815260040160405180910390fd5b610cd3816139af565b50565b600080610ce586868686613b5c565b90508060030154600003610cfd576000915050610dd0565b6001600160a01b038086166000908152601b6020908152604080832093881683529290529081206001810154600282015484545b8015610dc7576000610d438c83613bc8565b90508460050154816003015403610dbc576001810154426001600160401b0390911611610db657600083858360000154610d7d91906159d7565b610d8791906159ee565b9050610d938186615a10565b8254909550610da29085615a10565b9350610dae8188615a23565b965050610dbc565b50610dc7565b600201549050610d31565b50929450505050505b949350505050565b610de0613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e1d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e419190615964565b15610e5f57604051632b37d9d160e21b815260040160405180910390fd5b610e6f8383600080600086613c18565b505050565b610e7c613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610eb9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610edd9190615964565b15610efb57604051632b37d9d160e21b815260040160405180910390fd5b6001600160a01b0381166000908152601b60209081526040808320338085529252909120600381015483908390600160601b90046001600160401b0316610f57576040516330acea0d60e11b8152600401610958929190615a36565b50506003810154600160a01b810463ffffffff9081169116141580610f9a57506003810154600160c01b81046001600160401b03908116600160201b9092041614155b15610e6f57600381018054600160201b6001600160401b03600160c01b63ffffffff19841663ffffffff600160a01b8604811691821792909204831684026001600160601b03199095161793909317938490556040516001600160a01b0380881695908916947fa4c005afae9298a5ca51e7710c334ac406fb3d914588ade970850f917cedb1c694611033949183169392041690615a50565b60405180910390a3505050565b611048613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611085573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110a99190615964565b156110c757604051632b37d9d160e21b815260040160405180910390fd5b6110d033613d9e565b565b6110da613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611117573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061113b9190615964565b1561115957604051632b37d9d160e21b815260040160405180910390fd5b83836111668282336130b9565b82823390919261118c57604051630c76b97b60e41b815260040161095893929190615981565b50505061119c83620f4240101590565b83906111be57604051631504950160e21b815260040161095891815260200190565b506001600160a01b038087166000908152601c60209081526040808320938916835292905290812084918660028111156111fa576111fa615a6f565b600281111561120b5761120b615a6f565b815260208101919091526040016000205583600281111561122e5761122e615a6f565b856001600160a01b0316876001600160a01b03167f3474eba30406cacbfbc5a596a7e471662bbcccf206f8d244dbb6f4cc578c52208660405161127391815260200190565b60405180910390a4505050505050565b61128b613095565b6001600160a01b0316634fc07d756040518163ffffffff1660e01b8152600401602060405180830381865afa1580156112c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112ec91906159a4565b6001600160a01b0316336001600160a01b03161461131d57604051635d9044cd60e01b815260040160405180910390fd5b6001600160a01b038216600081815260226020908152604091829020805460ff191685151590811790915591519182527f4542960abc7f2d26dab244fc440acf511e3dd0f5cefad571ca802283b4751bbb91015b60405180910390a25050565b611385613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156113c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113e69190615964565b1561140457604051632b37d9d160e21b815260040160405180910390fd5b610e6f827f000000000000000000000000000000000000000000000000000000000000000083613e79565b6000611439613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611476573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061149a9190615964565b156114b857604051632b37d9d160e21b815260040160405180910390fd5b6001600160a01b038316600090815260146020908152604080832033808552600482019093529083209192909190807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663766718086040518163ffffffff1660e01b8152600401602060405180830381865afa158015611545573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115699190615a85565b905060008360020154118015611583575082600201548110155b1561159057826001015491505b600082116115b05760405162cf4d4760e51b815260040160405180910390fd5b60006001840181905560028401556040518281526001600160a01b0386811691908a16907f1b2e7737e043c5cf1b587ceb4daeb7ae00148b9bda8f79f1093eead08f1419529060200160405180910390a361161e858361160e613565565b6001600160a01b031691906140f1565b509695505050505050565b61163161514b565b61163961514b565b6000611645858561412c565b60028101548352600381015460208401526005810154604084015260068101546060840152600701546080830152509392505050565b611683613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156116c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116e49190615964565b1561170257604051632b37d9d160e21b815260040160405180910390fd5b8160000361172357604051630a2a4e5b60e11b815260040160405180910390fd5b6117303383610a2f613565565b61173c84848484613641565b50505050565b61174a613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611787573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117ab9190615964565b156117c957604051632b37d9d160e21b815260040160405180910390fd5b82826117d68282336130b9565b806117e95750336001600160a01b038216145b82823390919261180f57604051630c76b97b60e41b815260040161095893929190615981565b50505061181c85846141b0565b6118278585856141e8565b5050505050565b6001600160a01b038084166000908152601c6020908152604080832093861683529290529081208183600281111561186857611868615a6f565b600281111561187957611879615a6f565b81526020019081526020016000205490505b9392505050565b6000610dd08484846130b9565b6118a7613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156118e4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119089190615964565b1561192657604051632b37d9d160e21b815260040160405180910390fd5b83836119338282336130b9565b82823390919261195957604051630c76b97b60e41b815260040161095893929190615981565b5050506001600160a01b038681166000908152601b60209081526040808320938916835292905220600381015487908790600160601b90046001600160401b03166119b9576040516330acea0d60e11b8152600401610958929190615a36565b50506003810154600160a01b810463ffffffff908116908716141590600160c01b90046001600160401b03908116908616141581806119f55750805b15611b0d578115611a56578663ffffffff8116620f42401015611a34576040516329bff5f560e01b815263ffffffff9091166004820152602401610958565b5060038301805463ffffffff60a01b1916600160a01b63ffffffff8a16021790555b8015611ab657601a5486906001600160401b03908116908216811015611a915760405163ee5602e160e01b8152600401610958929190615a9e565b50506003830180546001600160c01b0316600160c01b6001600160401b038916021790555b428360040181905550876001600160a01b0316896001600160a01b03167fe89cbb9d63ba60af555547b12dde6817283e88cbdd45feb2059f2ba71ea346ba8989604051611b04929190615a50565b60405180910390a35b505050505050505050565b611b20613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611b5d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b819190615964565b15611b9f57604051632b37d9d160e21b815260040160405180910390fd5b8484611bac8282336130b9565b828233909192611bd257604051630c76b97b60e41b815260040161095893929190615981565b5050506001600160a01b038616600090815260226020526040902054869060ff16611c1057604051622920f760e21b8152600401610958919061553e565b50610971878688878761317d565b600080611c2b8585613846565b90506000611c398686614328565b90506000611c4d63ffffffff8616846159d7565b90506000611c5b838361434b565b9050611c678185615a23565b98975050505050505050565b611c7b61517a565b611c8361517a565b6001600160a01b039092166000908152600e602090815260409091208054845260040154908301525090565b82806001600160a01b031663f851a4406040518163ffffffff1660e01b81526004016020604051808303816000875af1158015611cf0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d1491906159a4565b6001600160a01b0316336001600160a01b031614611d445760405162461bcd60e51b815260040161095890615ab8565b60405163623faf6160e01b81526001600160a01b0385169063623faf6190611d729086908690600401615aef565b600060405180830381600087803b158015611d8c57600080fd5b505af1158015611da0573d6000803e3d6000fd5b5050505050505050565b6000611db4613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611df1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e159190615964565b15611e3357604051632b37d9d160e21b815260040160405180910390fd5b610dd0848484613e79565b80806001600160a01b031663f851a4406040518163ffffffff1660e01b81526004016020604051808303816000875af1158015611e7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ea391906159a4565b6001600160a01b0316336001600160a01b031614611ed35760405162461bcd60e51b815260040161095890615ab8565b816001600160a01b03166359fc20bb6040518163ffffffff1660e01b8152600401600060405180830381600087803b158015611f0e57600080fd5b505af1158015610b4d573d6000803e3d6000fd5b611f2a613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611f67573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f8b9190615964565b15611fa957604051632b37d9d160e21b815260040160405180910390fd5b610a6c82826141b0565b611fbb613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611ff8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061201c9190615964565b1561203a57604051632b37d9d160e21b815260040160405180910390fd5b610cd333826141b0565b6000610a7f82614362565b604080516000815260208101909152606090826001600160401b0381111561207957612079615b1e565b6040519080825280602002602001820160405280156120ac57816020015b60608152602001906001900390816120975790505b50915060005b8381101561212e57612109308686848181106120d0576120d0615b34565b90506020028101906120e29190615b4a565b856040516020016120f593929190615b90565b6040516020818303038152906040526143d3565b83828151811061211b5761211b615b34565b60209081029190910101526001016120b2565b505092915050565b61213e613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561217b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061219f9190615964565b156121bd57604051632b37d9d160e21b815260040160405180910390fd5b6001600160a01b038316600090815260226020526040902054839060ff166121f857604051622920f760e21b8152600401610958919061553e565b50610e6f838383614449565b61220c613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612249573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061226d9190615964565b1561228b57604051632b37d9d160e21b815260040160405180910390fd5b83836122988282336130b9565b8282339091926122be57604051630c76b97b60e41b815260040161095893929190615981565b50505085846122ce8282336130b9565b8282339091926122f457604051630c76b97b60e41b815260040161095893929190615981565b505050600061230489898861387e565b9050611b0d8988836141e8565b612319613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612356573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061237a9190615964565b1561239857604051632b37d9d160e21b815260040160405180910390fd5b610e6f838383614449565b6123ab613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156123e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061240c9190615964565b1561242a57604051632b37d9d160e21b815260040160405180910390fd5b8060000361244b57604051630a2a4e5b60e11b815260040160405180910390fd5b6001600160a01b038084166000908152601b6020908152604080832093861683529281529082902082516101408101845281548152600182015492810192909252600281015492820192909252600382015463ffffffff80821660608401526001600160401b03600160201b830481166080850152600160601b8304811660a08501819052600160a01b840490921660c0850152600160c01b90920490911660e08301526004830154610100830152600590920154610120820152908490849061252a576040516330acea0d60e11b8152600401610958929190615a36565b50506000612538858561412c565b90506000816003015411858590916125655760405163b6a70b3b60e01b8152600401610958929190615a36565b50508281600201546125779190615a23565b60028201556125893384610a2f613565565b836001600160a01b0316856001600160a01b03167f673007a04e501145e79f59aea5e0413b6e88344fdaf10326254530d6a1511530856040516125ce91815260200190565b60405180910390a35050505050565b6040805160208101909152600081526040805160208101909152600081526000612607868661412c565b6001600160a01b03851660009081526004909101602052604090205482525090509392505050565b60408051608081018252600080825260208201819052918101829052606081019190915261265d8383613bc8565b604080516080810182528254815260018301546001600160401b0316602082015260028301549181019190915260039091015460608201529392505050565b6126a4613095565b6001600160a01b0316634fc07d756040518163ffffffff1660e01b8152600401602060405180830381865afa1580156126e1573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061270591906159a4565b6001600160a01b0316336001600160a01b03161461273657604051635d9044cd60e01b815260040160405180910390fd5b600d805463ffffffff191690556040517f93be484d290d119d9cf99cce69d173c732f9403333ad84f69c807b590203d10990600090a1565b60408051608081018252600080825260208201819052918101829052606081019190915261279e85858585613b5c565b604080516080810182528254815260018301546020820152600283015491810191909152600390910154606082015295945050505050565b6127de613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561281b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061283f9190615964565b1561285d57604051632b37d9d160e21b815260040160405180910390fd5b3360009081526012602052604090205460ff1615612966576040516001600160a01b038581166024830152604482018590526064820184905282811660848301526000917f00000000000000000000000000000000000000000000000000000000000000009091169060a40160408051601f198184030181529181526020820180516001600160e01b031663224451c160e11b179052516128fe9190615bb7565b600060405180830381855af49150503d8060008114612939576040519150601f19603f3d011682016040523d82523d6000602084013e61293e565b606091505b50509050806129605760405163ef370f5160e01b815260040160405180910390fd5b5061173c565b6001600160a01b0384166000908152601b6020908152604080832033808552925282209091612995878461412c565b90506000816002015483600001546129ad9190615a23565b9050806000036129d057604051630a8a55c960e31b815260040160405180910390fd5b60006129dc888361434b565b905060006129ee85600001548361434b565b90508015612be8576003850154600090612a1390839063ffffffff9081169061457916565b9050888181811015612a3a57604051632f514d5760e21b8152600401610958929190615bd3565b50508815612aa757612a4f888a61160e613565565b876001600160a01b0316876001600160a01b03168c6001600160a01b03167f95ff4196cd75fa49180ba673948ea43935f59e7c4ba101fa09b9fe0ec266d5828c604051612a9e91815260200190565b60405180910390a45b612acb612ab48a84615a10565b612abc613565565b6001600160a01b0316906145d9565b8554612ad78382615a10565b8760010154612ae691906159d7565b612af091906159ee565b60018701558554612b02908390615a10565b8655600286015415801590612b1957506001860154155b15612b3d5760006002870181905560058701805491612b3783615be1565b91905055505b6001600160a01b038b166000908152600e6020526040902060040154612b64908390615a10565b6001600160a01b038c166000908152600e60205260409020600481019190915554612b90908390615a10565b6001600160a01b038c81166000818152600e60209081526040918290209490945551858152918a169290917fe7b110f13cde981d5079ab7faa4249c5f331f5c292dbc6031969d2ce694188a3910160405180910390a3505b612bf28183615a10565b91508115612d2c5760205460ff1615612cde57612c1182612abc613565565b6002840154612c208382615a10565b8560050154612c2f91906159d7565b612c3991906159ee565b60058501556002840154612c4e908390615a10565b6002850155600684015415801590612c6857506005840154155b15612c8c5760006006850181905560078501805491612c8683615be1565b91905055505b856001600160a01b03168a6001600160a01b03167fc5d16dbb577cf07678b577232717c9a606197a014f61847e623d47fc6bf6b77184604051612cd191815260200190565b60405180910390a3612d2c565b856001600160a01b03168a6001600160a01b03167fdce44f0aeed2089c75db59f5a517b9a19a734bf0213412fa129f0d0434126b2484604051612d2391815260200190565b60405180910390a35b50505050505050505050565b612d40613095565b6001600160a01b0316634fc07d756040518163ffffffff1660e01b8152600401602060405180830381865afa158015612d7d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612da191906159a4565b6001600160a01b0316336001600160a01b031614612dd257604051635d9044cd60e01b815260040160405180910390fd5b6020805460ff191660011790556040517f2192802a8934dbf383338406b279ec7f3eccee31e58d6c0444d6dd6bfff24b3590600090a1565b612e12613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612e4f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e739190615964565b15612e9157604051632b37d9d160e21b815260040160405180910390fd5b6001600160a01b038416612eb8576040516322347d6760e21b815260040160405180910390fd5b6001600160a01b038316612edf5760405163a962605960e01b815260040160405180910390fd5b610b4d868686868686613c18565b6000612ef7613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612f34573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f589190615964565b15612f7657604051632b37d9d160e21b815260040160405180910390fd5b8383612f838282336130b9565b828233909192612fa957604051630c76b97b60e41b815260040161095893929190615981565b505050612fb7868686614621565b9695505050505050565b6000610a7c8383614328565b612fd5613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015613012573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130369190615964565b1561305457604051632b37d9d160e21b815260040160405180910390fd5b82826130618282336130b9565b82823390919261308757604051630c76b97b60e41b815260040161095893929190615981565b5050506118278585856141e8565b7f000000000000000000000000000000000000000000000000000000000000000090565b6000836001600160a01b0316826001600160a01b0316036130dc5750600161188b565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b03160361314457506001600160a01b0380841660009081526015602090815260408083209385168352929052205460ff1661188b565b506001600160a01b038084166000908152601f60209081526040808320868516845282528083209385168352929052205460ff1661188b565b6000841161319e57604051630a2a4e5b60e11b815260040160405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b031614806131e45750600d5463ffffffff16155b83906132045760405163353666ff60e01b8152600401610958919061553e565b508163ffffffff8116620f42401015613239576040516329bff5f560e01b815263ffffffff9091166004820152602401610958565b50601a5481906001600160401b0390811690821681101561326f5760405163ee5602e160e01b8152600401610958929190615a9e565b50506001600160a01b038581166000908152601b6020908152604080832093871683529290522060030154600160601b90046001600160401b0316156132c857604051632b542c0d60e11b815260040160405180910390fd5b60006132d386614362565b90508481808211156132fa5760405163ccaf28a960e01b8152600401610958929190615bd3565b505060405180610140016040528086815260200160008152602001600081526020018463ffffffff168152602001836001600160401b03168152602001426001600160401b031681526020018463ffffffff168152602001836001600160401b03168152602001600081526020016000815250601b6000886001600160a01b03166001600160a01b031681526020019081526020016000206000866001600160a01b03166001600160a01b0316815260200190815260200160002060008201518160000155602082015181600101556040820151816002015560608201518160030160006101000a81548163ffffffff021916908363ffffffff16021790555060808201518160030160046101000a8154816001600160401b0302191690836001600160401b0316021790555060a082015181600301600c6101000a8154816001600160401b0302191690836001600160401b0316021790555060c08201518160030160146101000a81548163ffffffff021916908363ffffffff16021790555060e08201518160030160186101000a8154816001600160401b0302191690836001600160401b03160217905550610100820151816004015561012082015181600501559050506000600e6000886001600160a01b03166001600160a01b0316815260200190815260200160002090508581600401546134fa9190615a23565b60048201556040805187815263ffffffff861660208201526001600160401b0385168183015290516001600160a01b0387811692908a16917f88b4c2d08cea0f01a24841ff5d14814ddb5b14ac44b05e0835fcc0dcd8c7bc259181900360600190a350505050505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b8015610e6f576040516323b872dd60e01b81526001600160a01b038381166004830152306024830152604482018390528416906323b872dd906064015b6020604051808303816000875af11580156135e5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906136099190615964565b610e6f5760405162461bcd60e51b815260206004820152600960248201526810ba3930b739b332b960b91b6044820152606401610958565b81670de0b6b3a76400008082101561366e5760405163b86d885760e01b8152600401610958929190615bd3565b50506001600160a01b038481166000908152601b602090815260408083209387168352929052206003015484908490600160601b90046001600160401b03166136cc576040516330acea0d60e11b8152600401610958929190615a36565b505060006136da858561412c565b336000908152600482016020526040902060028201549192509015158061370357506003820154155b8686909161372657604051631984edef60e31b8152600401610958929190615a36565b50506000826002015460001480613744575082600501548360020154145b905060008161377f57836005015484600201546137619190615a10565b600385015461377090886159d7565b61377a91906159ee565b613781565b855b905080158015906137925750848110155b818690916137b557604051635d88e8d160e01b8152600401610958929190615bd3565b50508584600201546137c79190615a23565b600285015560038401546137dc908290615a23565b600385015582546137ee908290615a23565b835560405133906001600160a01b0389811691908b16907f237818af8bb47710142edd8fc301fbc507064fb357cf122fb161ca447e3cb13e90613834908b908790615bd3565b60405180910390a45050505050505050565b6001600160a01b038281166000908152601b60209081526040808320938516835292905290812060018101549054610a7c9190615a10565b6001600160a01b038381166000818152601b60209081526040808320948716808452948252808320600281015460018201548351610100810185528681529485018790529284019690965260608301949094526080820181905260a0820185905260c08201869052600584015460e08301529193849290916138ff816147b3565b875492965094509250613913908590615a10565b855560028501839055600185018290556001600160a01b0389166000908152600e60205260408120600401805486929061394e908490615a10565b92505081905550876001600160a01b0316896001600160a01b03167f9008d731ddfbec70bc364780efd63057c6877bee8027c4708a104b365395885d8660405161399a91815260200190565b60405180910390a35091979650505050505050565b3360008290036139d257604051630a2a4e5b60e11b815260040160405180910390fd5b60006139dd82614362565b9050828180821115613a045760405163ccaf28a960e01b8152600401610958929190615bd3565b50506001600160a01b0382166000908152600e602052604081208054600d549192909163ffffffff1690819003613a9657613a3f8683615a10565b8355613a4e858761160e613565565b846001600160a01b03167f32eed9ebc5696170068a371fdbea4c076da1bc21b305e78ca0a5e65ee913be8387604051613a8991815260200190565b60405180910390a2610b4d565b600283015415801590613aad575082600301544310155b15613abb57613abb85613d9e565b600283015415613ae557613ae2613ad68460030154436148ad565b846002015483896148c7565b90505b858360020154613af59190615a23565b6002840155613b048143615a23565b6003840181905560028401546040516001600160a01b038816927f91642f23a1196e1424949fafa2a428c3b5d1f699763942ff08a6fbe9d4d7e98092613b4c92909190615bd3565b60405180910390a2505050505050565b6000601e6000866001811115613b7457613b74615a6f565b6001811115613b8557613b85615a6f565b8152602080820192909252604090810160009081206001600160a01b03978816825283528181209587168152948252808520939095168452919091525020919050565b6000601d6000846001811115613be057613be0615a6f565b6001811115613bf157613bf1615a6f565b81526020019081526020016000206000838152602001908152602001600020905092915050565b6000613c24878761412c565b905080600201546000141580613c3c57506003810154155b87879091613c5f57604051631984edef60e31b8152600401610958929190615a36565b5050600681015460058201546040805161010081018252600181526001600160a01b03808c1660208301528a16918101919091523360608201526080810182905260a0810183905260c08101859052600784015460e08201526000929190613cc6816147b3565b600288015492965094509250613cdd908590615a10565b600286015560068501839055600585018290558315613d91576001600160a01b03891615801590613d1657506001600160a01b03881615155b15613d2c57613d278989868a613641565b613d91565b613d39338561160e613565565b336001600160a01b03168a6001600160a01b03168c6001600160a01b03167f305f519d8909c676ffd870495d4563032eb0b506891a6dd9827490256cc9914e87604051613d8891815260200190565b60405180910390a45b5050505050505050505050565b6001600160a01b0381166000908152600e6020526040812060028101549091819003613ddd57604051630a2a4e5b60e11b815260040160405180910390fd5b600382015443811115613e0657604051631d222f1b60e31b815260040161095891815260200190565b5060006002830181905560038301558154613e22908290615a10565b8255613e31838261160e613565565b826001600160a01b03167f32eed9ebc5696170068a371fdbea4c076da1bc21b305e78ca0a5e65ee913be8382604051613e6c91815260200190565b60405180910390a2505050565b6000808211613e9b57604051637318ad9960e01b815260040160405180910390fd5b6000613ea7858561412c565b33600090815260048201602052604090208054919250908480821015613ee25760405163ab99793560e01b8152600401610958929190615bd3565b5050600282015486908690613f0c57604051631984edef60e31b8152600401610958929190615a36565b50506000826003015483600501548460020154613f299190615a10565b613f3390876159d7565b613f3d91906159ee565b905060008360050154600014613f705760058401546006850154613f6190846159d7565b613f6b91906159ee565b613f72565b815b6001600160a01b038981166000908152601b60209081526040808320938c1683529290529081206003015491925090613fbb90600160201b90046001600160401b031642615a23565b9050828560050154613fcd9190615a23565b60058601556006850154613fe2908390615a23565b60068601556003850154613ff7908890615a10565b60038601558354614009908890615a10565b8085551561407557600085600301548660050154876002015461402c9190615a10565b865461403891906159d7565b61404291906159ee565b905080670de0b6b3a7640000808210156140715760405163587ab9ab60e11b8152600401610958929190615bd3565b5050505b600061408b60018b8b3387878c6007015461491b565b9050336001600160a01b0316896001600160a01b03168b6001600160a01b03167f0525d6ad1aa78abc571b5c1984b5e1ea4f1412368c1cc348ca408dbb1085c9a1878c6040516140dc929190615bd3565b60405180910390a49998505050505050505050565b8015610e6f5760405163a9059cbb60e01b81526001600160a01b0383811660048301526024820183905284169063a9059cbb906044016135c6565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b03160361418557506001600160a01b0382166000908152601460205260409020610a7f565b506001600160a01b038083166000908152602160209081526040808320938516835292905220610a7f565b806000036141d157604051630a2a4e5b60e11b815260040160405180910390fd5b6141de3382610a2f613565565b610a6c8282614ac1565b8060000361420957604051630a2a4e5b60e11b815260040160405180910390fd5b6001600160a01b038381166000908152601b60209081526040808320938616835292905220600381015484908490600160601b90046001600160401b0316614266576040516330acea0d60e11b8152600401610958929190615a36565b5050600061427385614362565b905082818082111561429a5760405163ccaf28a960e01b8152600401610958929190615bd3565b505081546142a9908490615a23565b82556001600160a01b0385166000908152600e60205260409020600401546142d2908490615a23565b6001600160a01b038681166000818152600e602090815260409182902060040194909455518681529187169290917feaf6ea3a42ed2fd1b6d575f818cbda593af9524aa94bd30e65302ac4dc23474591016125ce565b600080614335848461412c565b905080600501548160020154610dd09190615a10565b60008183111561435b5781610a7c565b5090919050565b6001600160a01b0381166000908152600e6020526040812060028101546001820154600490920154839261439591615a23565b61439f9190615a23565b6001600160a01b0384166000908152600e60205260409020549091508181116143c9576000610dd0565b610dd08282615a10565b6060600080846001600160a01b0316846040516143f09190615bb7565b600060405180830381855af49150503d806000811461442b576040519150601f19603f3d011682016040523d82523d6000602084013e614430565b606091505b5091509150614440858383614b34565b95945050505050565b336001600160a01b0383160361447257604051630123065360e01b815260040160405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b0316036144df573360009081526015602090815260408083206001600160a01b03861684529091529020805460ff191682151517905561451b565b336000908152601f602090815260408083206001600160a01b03878116855290835281842090861684529091529020805460ff19168215151790555b816001600160a01b0316836001600160a01b0316336001600160a01b03167faa5a59b38e8f68292982382bf635c2f263ca37137bbc52956acd808fd7bf976f8460405161456c911515815260200190565b60405180910390a4505050565b600061458883620f4240101590565b8061459b575061459b82620f4240101590565b838390916145be5760405163768bf0eb60e11b8152600401610958929190615bd3565b50620f424090506145cf83856159d7565b610a7c91906159ee565b8015610a6c57604051630852cd8d60e31b8152600481018290526001600160a01b038316906342966c6890602401600060405180830381600087803b158015611f0e57600080fd5b60008160000361464457604051630a2a4e5b60e11b815260040160405180910390fd5b60006146508585613846565b90508083808210156146775760405163587ab9ab60e11b8152600401610958929190615bd3565b50506001600160a01b038086166000908152601b6020908152604080832093881683529290529081206001810154909190156146ec578160010154600183600101548785600201546146c991906159d7565b6146d39190615a23565b6146dd9190615a10565b6146e791906159ee565b6146ee565b845b600383015490915060009061471390600160201b90046001600160401b031642615a23565b90508183600201546147259190615a23565b6002840155600183015461473a908790615a23565b8360010181905550600061475860008a8a8c87878a6005015461491b565b9050876001600160a01b0316896001600160a01b03167f3b81913739097ced1e7fa748c6058d34e2c00b961fb501094543b397b198fdaa8960405161479f91815260200190565b60405180910390a398975050505050505050565b6000806000806147d58560000151866020015187604001518860600151613b5c565b905060008160030154116147fc576040516307e332c560e31b815260040160405180910390fd5b60006148088683614b87565b905085604001516001600160a01b031686602001516001600160a01b03168760000151600181111561483c5761483c615a6f565b6060808a01518551602080880151604080516001600160a01b039095168552918401929092528201527f86c2f162872d7c46d7ee0caad366da6dc430889b9d8f27e4bed3785548f9954b910160405180910390a4602081015160408201516060909201519097919650945092505050565b60008183116148bd576000610a7c565b610a7c8284615a10565b60006148d38285615a23565b60016148df8487615a23565b6148e99190615a10565b6148f384866159d7565b6148fd87896159d7565b6149079190615a23565b6149119190615a23565b61444091906159ee565b60008360000361493e57604051637318ad9960e01b815260040160405180910390fd5b600061494c89898989613b5c565b90506103e88160030154106149745760405163332b852b60e11b815260040160405180910390fd5b60028101546040516001600160601b031960608b811b821660208401528a811b8216603484015289901b166048820152605c810191909152600090607c0160405160208183030381529060405280519060200120905060006149d68b83613bc8565b8781556001810180546001600160401b0319166001600160401b03891617905560006002820155600380820187905584015490915015614a245781614a1f8c8560010154613bc8565b600201555b614a2e8383614c82565b886001600160a01b03168a6001600160a01b03168c6001811115614a5457614a54615a6f565b604080516001600160a01b038d168152602081018c90526001600160401b038b168183015260608101879052608081018a905290517f036538df4a591a5cc74b68cfc7f8c61e8173dbc81627e1d62600b61e820461789181900360a00190a4509998505050505050505050565b6001600160a01b0382166000908152600e6020526040902054614ae5908290615a23565b6001600160a01b0383166000818152600e6020526040908190209290925590517f48c384dd8bdf1e06d8afecd810c4acfc3d553ac5d879dec5a69875dbbd90e14b906113719084815260200190565b606082614b4957614b4482614d15565b61188b565b8151158015614b6057506001600160a01b0384163b155b15614b805783604051639996b31560e01b8152600401610958919061553e565b508061188b565b614bb26040518060800160405280600081526020016000815260200160008152602001600081525090565b615194614bc28460000151614d3e565b9050615194614bd48560000151614da3565b905060008560000151600087608001518860a001518960e00151604051602001614c02959493929190615bfa565b6040516020818303038152906040529050600080614c3785614dea86868c60c001518c614f5a9095949392919063ffffffff16565b91509150600080600083806020019051810190614c549190615c3d565b60408051608081018252998a5260208a019390935291880152606087015250939a9950505050505050505050565b612710826003015410614ca8576040516303a8c56b60e61b815260040160405180910390fd5b80614cc657604051638f4a893d60e01b815260040160405180910390fd5b6001808301829055600283018054600090614ce2908490615a23565b90915550506003820154600003614cf7578082555b6001826003016000828254614d0c9190615a23565b90915550505050565b805115614d255780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b6151946000826001811115614d5557614d55615a6f565b03614d635750615014919050565b6001826001811115614d7757614d77615a6f565b03614d855750615056919050565b604051636bd1fba760e11b815260040160405180910390fd5b919050565b6151946000826001811115614dba57614dba615a6f565b03614dc85750615062919050565b6001826001811115614ddc57614ddc615a6f565b03614d8557506150b9919050565b60006060600080600080600087806020019051810190614e0a9190615c7c565b945094509450945094506000614e20868b613bc8565b6001810154909150426001600160401b039091161115614e5b5760016040518060200160405280600081525097509750505050505050614f53565b600381015460009083148015614eae5782548590614e7a9088906159d7565b614e8491906159ee565b9150614e908287615a10565b8354909650614e9f9086615a10565b9450614eab8288615a23565b96505b8b886001811115614ec157614ec1615a6f565b845460018601546040805187815260208101939093526001600160401b03909116828201528415156060830152517f469e89d0a4e0e5deb2eb1ade5b3fa67fdfbeb4787c3a7c1e8e89aaf28562cab29181900360800190a38787878787604051602001614f32959493929190615bfa565b6040516020818303038152906040529a5060008b9950995050505050505050505b9250929050565b600060608760030154831115614f8357604051634a411b9d60e11b815260040160405180910390fd5b60008315614f915783614f97565b88600301545b89549094505b8015801590614fac5750600085115b1561500557600080614fc283898c63ffffffff16565b915091508115614fd3575050615005565b965086614fe18c8c8b6150c4565b925086614fed81615cc5565b9750508380614ffb90615be1565b9450505050614f9d565b50989397509295505050505050565b6000601d81805b600181111561502c5761502c615a6f565b81526020019081526020016000206000838152602001908152602001600020600201549050919050565b6000601d81600161501b565b601d6000805b600181111561507957615079615a6f565b8152602080820192909252604090810160009081209381529290915281208181556001810180546001600160401b03191690556002810182905560030155565b601d60006001615068565b6000808460030154116150ea5760405163ddaf8f2160e01b815260040160405180910390fd5b60006150fd85600001548563ffffffff16565b905061511085600001548463ffffffff16565b60018560030160008282546151259190615a10565b9091555050808555600385015460000361514157600060018601555b5050915492915050565b6040518060a0016040528060008152602001600081526020016000815260200160008152602001600081525090565b604051806040016040528060008152602001600081525090565b6110d0615cdc565b6001600160a01b0381168114610cd357600080fd5b803563ffffffff81168114614d9e57600080fd5b80356001600160401b0381168114614d9e57600080fd5b600080600080600060a086880312156151f457600080fd5b85356151ff8161519c565b9450602086013561520f8161519c565b935060408601359250615224606087016151b1565b9150615232608087016151c5565b90509295509295909350565b6000806040838503121561525157600080fd5b823561525c8161519c565b946020939093013593505050565b6000806040838503121561527d57600080fd5b82356152888161519c565b915060208301356152988161519c565b809150509250929050565b6000806000606084860312156152b857600080fd5b83356152c38161519c565b925060208401356152d38161519c565b929592945050506040919091013590565b6000602082840312156152f657600080fd5b610a7c826151c5565b6000610140820190508251825260208301516020830152604083015160408301526060830151615337606084018263ffffffff169052565b50608083015161535260808401826001600160401b03169052565b5060a083015161536d60a08401826001600160401b03169052565b5060c083015161538560c084018263ffffffff169052565b5060e08301516153a060e08401826001600160401b03169052565b5061010083015161010083015261012083015161012083015292915050565b6000602082840312156153d157600080fd5b5035919050565b60028110610cd357600080fd5b600080600080608085870312156153fb57600080fd5b8435615406816153d8565b935060208501356154168161519c565b925060408501356154268161519c565b915060608501356154368161519c565b939692955090935050565b60006020828403121561545357600080fd5b813561188b8161519c565b803560038110614d9e57600080fd5b6000806000806080858703121561548357600080fd5b843561548e8161519c565b9350602085013561549e8161519c565b92506154ac6040860161545e565b9396929550929360600135925050565b8015158114610cd357600080fd5b600080604083850312156154dd57600080fd5b82356154e88161519c565b91506020830135615298816154bc565b6000806000806080858703121561550e57600080fd5b84356155198161519c565b935060208501356155298161519c565b93969395505050506040820135916060013590565b6001600160a01b0391909116815260200190565b60008060006060848603121561556757600080fd5b83356155728161519c565b925060208401356155828161519c565b91506155906040850161545e565b90509250925092565b6000806000606084860312156155ae57600080fd5b83356155b98161519c565b925060208401356155c98161519c565b915060408401356155d98161519c565b809150509250925092565b600080600080608085870312156155fa57600080fd5b84356156058161519c565b935060208501356156158161519c565b9250615623604086016151b1565b9150615631606086016151c5565b905092959194509250565b60008060006060848603121561565157600080fd5b833561565c8161519c565b9250602084013561566c8161519c565b9150615590604085016151b1565b60008060006040848603121561568f57600080fd5b833561569a8161519c565b925060208401356001600160401b038111156156b557600080fd5b8401601f810186136156c657600080fd5b80356001600160401b038111156156dc57600080fd5b8660208284010111156156ee57600080fd5b939660209190910195509293505050565b6000806020838503121561571257600080fd5b82356001600160401b0381111561572857600080fd5b8301601f8101851361573957600080fd5b80356001600160401b0381111561574f57600080fd5b8560208260051b840101111561576457600080fd5b6020919091019590945092505050565b60005b8381101561578f578181015183820152602001615777565b50506000910152565b6000602082016020835280845180835260408501915060408160051b86010192506020860160005b8281101561580c57603f19878603018452815180518087526157e9816020890160208501615774565b601f01601f191695909501602090810195509384019391909101906001016157c0565b50929695505050505050565b60008060006060848603121561582d57600080fd5b83356158388161519c565b925060208401356158488161519c565b915060408401356155d9816154bc565b6000806000806080858703121561586e57600080fd5b84356158798161519c565b935060208501356158898161519c565b925060408501356154ac8161519c565b600080604083850312156158ac57600080fd5b823561525c816153d8565b600080600080608085870312156158cd57600080fd5b84356158d88161519c565b9350602085013592506040850135915060608501356154368161519c565b60008060008060008060c0878903121561590f57600080fd5b863561591a8161519c565b9550602087013561592a8161519c565b9450604087013561593a8161519c565b9350606087013561594a8161519c565b9598949750929560808101359460a0909101359350915050565b60006020828403121561597657600080fd5b815161188b816154bc565b6001600160a01b0393841681529183166020830152909116604082015260600190565b6000602082840312156159b657600080fd5b815161188b8161519c565b634e487b7160e01b600052601160045260246000fd5b8082028115828204841417610a7f57610a7f6159c1565b600082615a0b57634e487b7160e01b600052601260045260246000fd5b500490565b81810381811115610a7f57610a7f6159c1565b80820180821115610a7f57610a7f6159c1565b6001600160a01b0392831681529116602082015260400190565b63ffffffff9290921682526001600160401b0316602082015260400190565b634e487b7160e01b600052602160045260246000fd5b600060208284031215615a9757600080fd5b5051919050565b6001600160401b0392831681529116602082015260400190565b6020808252601e908201527f43616c6c6572206d757374206265207468652070726f78792061646d696e0000604082015260600190565b60208152816020820152818360408301376000818301604090810191909152601f909201601f19160101919050565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112615b6157600080fd5b8301803591506001600160401b03821115615b7b57600080fd5b602001915036819003821315614f5357600080fd5b828482376000838201600081528351615bad818360208801615774565b0195945050505050565b60008251615bc9818460208701615774565b9190910192915050565b918252602082015260400190565b600060018201615bf357615bf36159c1565b5060010190565b60a0810160028710615c1c57634e487b7160e01b600052602160045260246000fd5b95815260208101949094526040840192909252606083015260809091015290565b60008060008060808587031215615c5357600080fd5b8451615c5e816153d8565b60208601516040870151606090970151919890975090945092505050565b600080600080600060a08688031215615c9457600080fd5b8551615c9f816153d8565b602087015160408801516060890151608090990151929a91995097965090945092505050565b600081615cd457615cd46159c1565b506000190190565b634e487b7160e01b600052605160045260246000fdfea2646970667358221220f5046670ab269f9c179f41df4a02cd9c6b2ca3d5d507e2b9fcf15f800f351d8b64736f6c634300081b0033", + "linkReferences": {}, + "deployedLinkReferences": {} +} \ No newline at end of file diff --git a/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/L2Curation#GraphCurationToken.json b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/L2Curation#GraphCurationToken.json new file mode 100644 index 000000000..b7220dcc7 --- /dev/null +++ b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/L2Curation#GraphCurationToken.json @@ -0,0 +1,414 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "GraphCurationToken", + "sourceName": "contracts/curation/GraphCurationToken.sol", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "NewOwnership", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "NewPendingOwnership", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "burnFrom", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_owner", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingGovernor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newGovernor", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "bytecode": "0x608060405234801561001057600080fd5b506114ec806100206000396000f3fe608060405234801561001057600080fd5b50600436106101165760003560e01c806379ba5097116100a2578063a9059cbb11610071578063a9059cbb14610352578063c4d66de81461037e578063dd62ed3e146103a4578063e3056a34146103d2578063f2fde38b146103da57610116565b806379ba5097146102ea57806379cc6790146102f257806395d89b411461031e578063a457c2d71461032657610116565b806323b872dd116100e957806323b872dd14610216578063313ce5671461024c578063395093511461026a57806340c10f191461029657806370a08231146102c457610116565b806306fdde031461011b578063095ea7b3146101985780630c340a24146101d857806318160ddd146101fc575b600080fd5b610123610400565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561015d578181015183820152602001610145565b50505050905090810190601f16801561018a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c4600480360360408110156101ae57600080fd5b506001600160a01b038135169060200135610496565b604080519115158252519081900360200190f35b6101e06104b3565b604080516001600160a01b039092168252519081900360200190f35b6102046104c2565b60408051918252519081900360200190f35b6101c46004803603606081101561022c57600080fd5b506001600160a01b038135811691602081013590911690604001356104c8565b61025461054f565b6040805160ff9092168252519081900360200190f35b6101c46004803603604081101561028057600080fd5b506001600160a01b038135169060200135610558565b6102c2600480360360408110156102ac57600080fd5b506001600160a01b0381351690602001356105a6565b005b610204600480360360208110156102da57600080fd5b50356001600160a01b031661060c565b6102c2610627565b6102c26004803603604081101561030857600080fd5b506001600160a01b038135169060200135610737565b610123610799565b6101c46004803603604081101561033c57600080fd5b506001600160a01b0381351690602001356107fa565b6101c46004803603604081101561036857600080fd5b506001600160a01b038135169060200135610862565b6102c26004803603602081101561039457600080fd5b50356001600160a01b0316610876565b610204600480360360408110156103ba57600080fd5b506001600160a01b0381358116916020013516610972565b6101e061099d565b6102c2600480360360208110156103f057600080fd5b50356001600160a01b03166109ac565b60368054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561048c5780601f106104615761010080835404028352916020019161048c565b820191906000526020600020905b81548152906001019060200180831161046f57829003601f168201915b5050505050905090565b60006104aa6104a3610aaa565b8484610aae565b50600192915050565b6065546001600160a01b031681565b60355490565b60006104d5848484610b9a565b610545846104e1610aaa565b61054085604051806060016040528060288152602001611400602891396001600160a01b038a1660009081526034602052604081209061051f610aaa565b6001600160a01b031681526020810191909152604001600020549190610cf7565b610aae565b5060019392505050565b60385460ff1690565b60006104aa610565610aaa565b846105408560346000610576610aaa565b6001600160a01b03908116825260208083019390935260409182016000908120918c168152925290205490610d8e565b6065546001600160a01b031633146105fe576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b6106088282610def565b5050565b6001600160a01b031660009081526033602052604090205490565b6066546001600160a01b0316801580159061064a5750336001600160a01b038216145b61069b576040805162461bcd60e51b815260206004820152601f60248201527f43616c6c6572206d7573742062652070656e64696e6720676f7665726e6f7200604482015290519081900360640190fd5b606580546001600160a01b038381166001600160a01b0319808416919091179384905560668054909116905560405191811692169082907f0ac6deed30eef60090c749850e10f2fa469e3e25fec1d1bef2853003f6e6f18f90600090a36066546040516001600160a01b03918216918416907f76563ad561b7036ae716b9b25cb521b21463240f104c97e12f25877f2235f33d90600090a35050565b6065546001600160a01b0316331461078f576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b6106088282610ee1565b60378054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561048c5780601f106104615761010080835404028352916020019161048c565b60006104aa610807610aaa565b84610540856040518060600160405280602581526020016114926025913960346000610831610aaa565b6001600160a01b03908116825260208083019390935260409182016000908120918d16815292529020549190610cf7565b60006104aa61086f610aaa565b8484610b9a565b600054610100900460ff168061088f575061088f610fdd565b8061089d575060005460ff16155b6108d85760405162461bcd60e51b815260040180806020018281038252602e8152602001806113d2602e913960400191505060405180910390fd5b600054610100900460ff16158015610903576000805460ff1961ff0019909116610100171660011790555b61090c82610fee565b61095d604051806040016040528060148152602001734772617068204375726174696f6e20536861726560601b8152506040518060400160405280600381526020016247435360e81b815250611010565b8015610608576000805461ff00191690555050565b6001600160a01b03918216600090815260346020908152604080832093909416825291909152205490565b6066546001600160a01b031681565b6065546001600160a01b03163314610a04576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b6001600160a01b038116610a56576040805162461bcd60e51b815260206004820152601460248201527311dbdd995c9b9bdc881b5d5cdd081899481cd95d60621b604482015290519081900360640190fd5b606680546001600160a01b038381166001600160a01b03198316179283905560405191811692169082907f76563ad561b7036ae716b9b25cb521b21463240f104c97e12f25877f2235f33d90600090a35050565b3390565b6001600160a01b038316610af35760405162461bcd60e51b815260040180806020018281038252602481526020018061146e6024913960400191505060405180910390fd5b6001600160a01b038216610b385760405162461bcd60e51b815260040180806020018281038252602281526020018061138a6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260346020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b038316610bdf5760405162461bcd60e51b81526004018080602001828103825260258152602001806114496025913960400191505060405180910390fd5b6001600160a01b038216610c245760405162461bcd60e51b81526004018080602001828103825260238152602001806113456023913960400191505060405180910390fd5b610c2f8383836110c1565b610c6c816040518060600160405280602681526020016113ac602691396001600160a01b0386166000908152603360205260409020549190610cf7565b6001600160a01b038085166000908152603360205260408082209390935590841681522054610c9b9082610d8e565b6001600160a01b0380841660008181526033602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b60008184841115610d865760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610d4b578181015183820152602001610d33565b50505050905090810190601f168015610d785780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600082820183811015610de8576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b6001600160a01b038216610e4a576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b610e56600083836110c1565b603554610e639082610d8e565b6035556001600160a01b038216600090815260336020526040902054610e899082610d8e565b6001600160a01b03831660008181526033602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6001600160a01b038216610f265760405162461bcd60e51b81526004018080602001828103825260218152602001806114286021913960400191505060405180910390fd5b610f32826000836110c1565b610f6f81604051806060016040528060228152602001611368602291396001600160a01b0385166000908152603360205260409020549190610cf7565b6001600160a01b038316600090815260336020526040902055603554610f9590826110c6565b6035556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b6000610fe830611123565b15905090565b606580546001600160a01b0319166001600160a01b0392909216919091179055565b600054610100900460ff16806110295750611029610fdd565b80611037575060005460ff16155b6110725760405162461bcd60e51b815260040180806020018281038252602e8152602001806113d2602e913960400191505060405180910390fd5b600054610100900460ff1615801561109d576000805460ff1961ff0019909116610100171660011790555b6110a5611129565b6110af83836111cb565b80156110c1576000805461ff00191690555b505050565b60008282111561111d576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b3b151590565b600054610100900460ff16806111425750611142610fdd565b80611150575060005460ff16155b61118b5760405162461bcd60e51b815260040180806020018281038252602e8152602001806113d2602e913960400191505060405180910390fd5b600054610100900460ff161580156111b6576000805460ff1961ff0019909116610100171660011790555b80156111c8576000805461ff00191690555b50565b600054610100900460ff16806111e457506111e4610fdd565b806111f2575060005460ff16155b61122d5760405162461bcd60e51b815260040180806020018281038252602e8152602001806113d2602e913960400191505060405180910390fd5b600054610100900460ff16158015611258576000805460ff1961ff0019909116610100171660011790555b825161126b9060369060208601906112a3565b50815161127f9060379060208501906112a3565b506038805460ff1916601217905580156110c1576000805461ff0019169055505050565b828054600181600116156101000203166002900490600052602060002090601f0160209004810192826112d9576000855561131f565b82601f106112f257805160ff191683800117855561131f565b8280016001018555821561131f579182015b8281111561131f578251825591602001919060010190611304565b5061132b92915061132f565b5090565b5b8082111561132b576000815560010161133056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e6365496e697469616c697a61626c653a20636f6e747261637420697320616c726561647920696e697469616c697a656445524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa26469706673582212200b687fddcd01dbad6e1d5fbd49cb041f69ed61684a12a4c26c6e37e0f5ad7c2a64736f6c63430007060033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101165760003560e01c806379ba5097116100a2578063a9059cbb11610071578063a9059cbb14610352578063c4d66de81461037e578063dd62ed3e146103a4578063e3056a34146103d2578063f2fde38b146103da57610116565b806379ba5097146102ea57806379cc6790146102f257806395d89b411461031e578063a457c2d71461032657610116565b806323b872dd116100e957806323b872dd14610216578063313ce5671461024c578063395093511461026a57806340c10f191461029657806370a08231146102c457610116565b806306fdde031461011b578063095ea7b3146101985780630c340a24146101d857806318160ddd146101fc575b600080fd5b610123610400565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561015d578181015183820152602001610145565b50505050905090810190601f16801561018a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c4600480360360408110156101ae57600080fd5b506001600160a01b038135169060200135610496565b604080519115158252519081900360200190f35b6101e06104b3565b604080516001600160a01b039092168252519081900360200190f35b6102046104c2565b60408051918252519081900360200190f35b6101c46004803603606081101561022c57600080fd5b506001600160a01b038135811691602081013590911690604001356104c8565b61025461054f565b6040805160ff9092168252519081900360200190f35b6101c46004803603604081101561028057600080fd5b506001600160a01b038135169060200135610558565b6102c2600480360360408110156102ac57600080fd5b506001600160a01b0381351690602001356105a6565b005b610204600480360360208110156102da57600080fd5b50356001600160a01b031661060c565b6102c2610627565b6102c26004803603604081101561030857600080fd5b506001600160a01b038135169060200135610737565b610123610799565b6101c46004803603604081101561033c57600080fd5b506001600160a01b0381351690602001356107fa565b6101c46004803603604081101561036857600080fd5b506001600160a01b038135169060200135610862565b6102c26004803603602081101561039457600080fd5b50356001600160a01b0316610876565b610204600480360360408110156103ba57600080fd5b506001600160a01b0381358116916020013516610972565b6101e061099d565b6102c2600480360360208110156103f057600080fd5b50356001600160a01b03166109ac565b60368054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561048c5780601f106104615761010080835404028352916020019161048c565b820191906000526020600020905b81548152906001019060200180831161046f57829003601f168201915b5050505050905090565b60006104aa6104a3610aaa565b8484610aae565b50600192915050565b6065546001600160a01b031681565b60355490565b60006104d5848484610b9a565b610545846104e1610aaa565b61054085604051806060016040528060288152602001611400602891396001600160a01b038a1660009081526034602052604081209061051f610aaa565b6001600160a01b031681526020810191909152604001600020549190610cf7565b610aae565b5060019392505050565b60385460ff1690565b60006104aa610565610aaa565b846105408560346000610576610aaa565b6001600160a01b03908116825260208083019390935260409182016000908120918c168152925290205490610d8e565b6065546001600160a01b031633146105fe576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b6106088282610def565b5050565b6001600160a01b031660009081526033602052604090205490565b6066546001600160a01b0316801580159061064a5750336001600160a01b038216145b61069b576040805162461bcd60e51b815260206004820152601f60248201527f43616c6c6572206d7573742062652070656e64696e6720676f7665726e6f7200604482015290519081900360640190fd5b606580546001600160a01b038381166001600160a01b0319808416919091179384905560668054909116905560405191811692169082907f0ac6deed30eef60090c749850e10f2fa469e3e25fec1d1bef2853003f6e6f18f90600090a36066546040516001600160a01b03918216918416907f76563ad561b7036ae716b9b25cb521b21463240f104c97e12f25877f2235f33d90600090a35050565b6065546001600160a01b0316331461078f576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b6106088282610ee1565b60378054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561048c5780601f106104615761010080835404028352916020019161048c565b60006104aa610807610aaa565b84610540856040518060600160405280602581526020016114926025913960346000610831610aaa565b6001600160a01b03908116825260208083019390935260409182016000908120918d16815292529020549190610cf7565b60006104aa61086f610aaa565b8484610b9a565b600054610100900460ff168061088f575061088f610fdd565b8061089d575060005460ff16155b6108d85760405162461bcd60e51b815260040180806020018281038252602e8152602001806113d2602e913960400191505060405180910390fd5b600054610100900460ff16158015610903576000805460ff1961ff0019909116610100171660011790555b61090c82610fee565b61095d604051806040016040528060148152602001734772617068204375726174696f6e20536861726560601b8152506040518060400160405280600381526020016247435360e81b815250611010565b8015610608576000805461ff00191690555050565b6001600160a01b03918216600090815260346020908152604080832093909416825291909152205490565b6066546001600160a01b031681565b6065546001600160a01b03163314610a04576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b6001600160a01b038116610a56576040805162461bcd60e51b815260206004820152601460248201527311dbdd995c9b9bdc881b5d5cdd081899481cd95d60621b604482015290519081900360640190fd5b606680546001600160a01b038381166001600160a01b03198316179283905560405191811692169082907f76563ad561b7036ae716b9b25cb521b21463240f104c97e12f25877f2235f33d90600090a35050565b3390565b6001600160a01b038316610af35760405162461bcd60e51b815260040180806020018281038252602481526020018061146e6024913960400191505060405180910390fd5b6001600160a01b038216610b385760405162461bcd60e51b815260040180806020018281038252602281526020018061138a6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260346020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b038316610bdf5760405162461bcd60e51b81526004018080602001828103825260258152602001806114496025913960400191505060405180910390fd5b6001600160a01b038216610c245760405162461bcd60e51b81526004018080602001828103825260238152602001806113456023913960400191505060405180910390fd5b610c2f8383836110c1565b610c6c816040518060600160405280602681526020016113ac602691396001600160a01b0386166000908152603360205260409020549190610cf7565b6001600160a01b038085166000908152603360205260408082209390935590841681522054610c9b9082610d8e565b6001600160a01b0380841660008181526033602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b60008184841115610d865760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610d4b578181015183820152602001610d33565b50505050905090810190601f168015610d785780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600082820183811015610de8576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b6001600160a01b038216610e4a576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b610e56600083836110c1565b603554610e639082610d8e565b6035556001600160a01b038216600090815260336020526040902054610e899082610d8e565b6001600160a01b03831660008181526033602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6001600160a01b038216610f265760405162461bcd60e51b81526004018080602001828103825260218152602001806114286021913960400191505060405180910390fd5b610f32826000836110c1565b610f6f81604051806060016040528060228152602001611368602291396001600160a01b0385166000908152603360205260409020549190610cf7565b6001600160a01b038316600090815260336020526040902055603554610f9590826110c6565b6035556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b6000610fe830611123565b15905090565b606580546001600160a01b0319166001600160a01b0392909216919091179055565b600054610100900460ff16806110295750611029610fdd565b80611037575060005460ff16155b6110725760405162461bcd60e51b815260040180806020018281038252602e8152602001806113d2602e913960400191505060405180910390fd5b600054610100900460ff1615801561109d576000805460ff1961ff0019909116610100171660011790555b6110a5611129565b6110af83836111cb565b80156110c1576000805461ff00191690555b505050565b60008282111561111d576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b3b151590565b600054610100900460ff16806111425750611142610fdd565b80611150575060005460ff16155b61118b5760405162461bcd60e51b815260040180806020018281038252602e8152602001806113d2602e913960400191505060405180910390fd5b600054610100900460ff161580156111b6576000805460ff1961ff0019909116610100171660011790555b80156111c8576000805461ff00191690555b50565b600054610100900460ff16806111e457506111e4610fdd565b806111f2575060005460ff16155b61122d5760405162461bcd60e51b815260040180806020018281038252602e8152602001806113d2602e913960400191505060405180910390fd5b600054610100900460ff16158015611258576000805460ff1961ff0019909116610100171660011790555b825161126b9060369060208601906112a3565b50815161127f9060379060208501906112a3565b506038805460ff1916601217905580156110c1576000805461ff0019169055505050565b828054600181600116156101000203166002900490600052602060002090601f0160209004810192826112d9576000855561131f565b82601f106112f257805160ff191683800117855561131f565b8280016001018555821561131f579182015b8281111561131f578251825591602001919060010190611304565b5061132b92915061132f565b5090565b5b8082111561132b576000815560010161133056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e6365496e697469616c697a61626c653a20636f6e747261637420697320616c726561647920696e697469616c697a656445524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa26469706673582212200b687fddcd01dbad6e1d5fbd49cb041f69ed61684a12a4c26c6e37e0f5ad7c2a64736f6c63430007060033", + "linkReferences": {}, + "deployedLinkReferences": {} +} \ No newline at end of file diff --git a/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/L2Curation#GraphProxy.json b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/L2Curation#GraphProxy.json new file mode 100644 index 000000000..2cfb21e41 --- /dev/null +++ b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/L2Curation#GraphProxy.json @@ -0,0 +1,177 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "GraphProxy", + "sourceName": "contracts/upgrades/GraphProxy.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_impl", + "type": "address" + }, + { + "internalType": "address", + "name": "_admin", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldAdmin", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldImplementation", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "ImplementationUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldPendingImplementation", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newPendingImplementation", + "type": "address" + } + ], + "name": "PendingImplementationUpdated", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "acceptUpgrade", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "acceptUpgradeAndCall", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "pendingImplementation", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newAdmin", + "type": "address" + } + ], + "name": "setAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "bytecode": "0x608060405234801561001057600080fd5b50604051610a12380380610a128339818101604052604081101561003357600080fd5b50805160209091015161004581610055565b61004e826100b3565b5050610137565b600061005f610111565b6000805160206109d2833981519152838155604051919250906001600160a01b0380851691908416907f101b8081ff3b56bbf45deb824d86a3b0fd38b7e3dd42421105cf8abe9106db0b90600090a3505050565b60006100bd610124565b6000805160206109f2833981519152838155604051919250906001600160a01b0380851691908416907f980c0d30fe97457c47903527d88b7009a1643be6de24d2af664214919f0540a190600090a3505050565b6000805160206109d28339815191525490565b6000805160206109f28339815191525490565b61088c806101466000396000f3fe6080604052600436106100745760003560e01c80635c60da1b1161004e5780635c60da1b14610104578063623faf6114610119578063704b6c0214610196578063f851a440146101c957610083565b80633659cfe61461008b578063396f7b23146100be57806359fc20bb146100ef57610083565b36610083576100816101de565b005b6100816101de565b34801561009757600080fd5b50610081600480360360208110156100ae57600080fd5b50356001600160a01b031661029e565b3480156100ca57600080fd5b506100d36102d8565b604080516001600160a01b039092168252519081900360200190f35b3480156100fb57600080fd5b50610081610338565b34801561011057600080fd5b506100d3610393565b34801561012557600080fd5b506100816004803603602081101561013c57600080fd5b81019060208101813564010000000081111561015757600080fd5b82018360208201111561016957600080fd5b8035906020019184600183028401116401000000008311171561018b57600080fd5b5090925090506103e1565b3480156101a257600080fd5b50610081600480360360208110156101b957600080fd5b50356001600160a01b03166104f1565b3480156101d557600080fd5b506100d3610576565b6101e66105c0565b6001600160a01b0316336001600160a01b0316141561024c576040805162461bcd60e51b815260206004820152601f60248201527f43616e6e6f742066616c6c6261636b20746f2070726f78792074617267657400604482015290519081900360640190fd5b6040516001600160a01b037f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc541636600083376000803684845af490503d806000843e81801561029a578184f35b8184fd5b6102a66105c0565b6001600160a01b0316336001600160a01b031614156102cd576102c8816105e5565b6102d5565b6102d56101de565b50565b60006102e26105c0565b6001600160a01b0316336001600160a01b031614806103195750610304610655565b6001600160a01b0316336001600160a01b0316145b1561032d57610326610655565b9050610335565b6103356101de565b90565b6103406105c0565b6001600160a01b0316336001600160a01b031614806103775750610362610655565b6001600160a01b0316336001600160a01b0316145b156103895761038461067a565b610391565b6103916101de565b565b600061039d6105c0565b6001600160a01b0316336001600160a01b031614806103d457506103bf610655565b6001600160a01b0316336001600160a01b0316145b1561032d57610326610751565b6103e96105c0565b6001600160a01b0316336001600160a01b03161480610420575061040b610655565b6001600160a01b0316336001600160a01b0316145b156104e55761042d61067a565b6000610437610751565b6001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d8060008114610491576040519150601f19603f3d011682016040523d82523d6000602084013e610496565b606091505b50509050806104df576040805162461bcd60e51b815260206004820152601060248201526f125b5c1b0818d85b1b0819985a5b195960821b604482015290519081900360640190fd5b506104ed565b6104ed6101de565b5050565b6104f96105c0565b6001600160a01b0316336001600160a01b031614156102cd576001600160a01b03811661056d576040805162461bcd60e51b815260206004820152601e60248201527f41646d696e2063616e7420626520746865207a65726f20616464726573730000604482015290519081900360640190fd5b6102c881610776565b60006105806105c0565b6001600160a01b0316336001600160a01b031614806105b757506105a2610655565b6001600160a01b0316336001600160a01b0316145b1561032d576103265b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b60006105ef610655565b7f9e5eddc59e0b171f57125ab86bee043d9128098c3a6b9adb4f2e86333c2f6f8c838155604051919250906001600160a01b0380851691908416907f980c0d30fe97457c47903527d88b7009a1643be6de24d2af664214919f0540a190600090a3505050565b7f9e5eddc59e0b171f57125ab86bee043d9128098c3a6b9adb4f2e86333c2f6f8c5490565b6000610684610655565b90506001600160a01b0381166106e1576040805162461bcd60e51b815260206004820152601b60248201527f496d706c2063616e6e6f74206265207a65726f20616464726573730000000000604482015290519081900360640190fd5b336001600160a01b0382161461073e576040805162461bcd60e51b815260206004820152601b60248201527f4f6e6c792070656e64696e6720696d706c656d656e746174696f6e0000000000604482015290519081900360640190fd5b610747816107e6565b6102d560006105e5565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b60006107806105c0565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103838155604051919250906001600160a01b0380851691908416907f101b8081ff3b56bbf45deb824d86a3b0fd38b7e3dd42421105cf8abe9106db0b90600090a3505050565b60006107f0610751565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc838155604051919250906001600160a01b0380851691908416907faa3f731066a578e5f39b4215468d826cdd15373cbc0dfc9cb9bdc649718ef7da90600090a350505056fea264697066735822122041ce882775d17ef838c17f08249aa48a5f3ea1c65b581e69896452640b274de264736f6c63430007060033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61039e5eddc59e0b171f57125ab86bee043d9128098c3a6b9adb4f2e86333c2f6f8c", + "deployedBytecode": "0x6080604052600436106100745760003560e01c80635c60da1b1161004e5780635c60da1b14610104578063623faf6114610119578063704b6c0214610196578063f851a440146101c957610083565b80633659cfe61461008b578063396f7b23146100be57806359fc20bb146100ef57610083565b36610083576100816101de565b005b6100816101de565b34801561009757600080fd5b50610081600480360360208110156100ae57600080fd5b50356001600160a01b031661029e565b3480156100ca57600080fd5b506100d36102d8565b604080516001600160a01b039092168252519081900360200190f35b3480156100fb57600080fd5b50610081610338565b34801561011057600080fd5b506100d3610393565b34801561012557600080fd5b506100816004803603602081101561013c57600080fd5b81019060208101813564010000000081111561015757600080fd5b82018360208201111561016957600080fd5b8035906020019184600183028401116401000000008311171561018b57600080fd5b5090925090506103e1565b3480156101a257600080fd5b50610081600480360360208110156101b957600080fd5b50356001600160a01b03166104f1565b3480156101d557600080fd5b506100d3610576565b6101e66105c0565b6001600160a01b0316336001600160a01b0316141561024c576040805162461bcd60e51b815260206004820152601f60248201527f43616e6e6f742066616c6c6261636b20746f2070726f78792074617267657400604482015290519081900360640190fd5b6040516001600160a01b037f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc541636600083376000803684845af490503d806000843e81801561029a578184f35b8184fd5b6102a66105c0565b6001600160a01b0316336001600160a01b031614156102cd576102c8816105e5565b6102d5565b6102d56101de565b50565b60006102e26105c0565b6001600160a01b0316336001600160a01b031614806103195750610304610655565b6001600160a01b0316336001600160a01b0316145b1561032d57610326610655565b9050610335565b6103356101de565b90565b6103406105c0565b6001600160a01b0316336001600160a01b031614806103775750610362610655565b6001600160a01b0316336001600160a01b0316145b156103895761038461067a565b610391565b6103916101de565b565b600061039d6105c0565b6001600160a01b0316336001600160a01b031614806103d457506103bf610655565b6001600160a01b0316336001600160a01b0316145b1561032d57610326610751565b6103e96105c0565b6001600160a01b0316336001600160a01b03161480610420575061040b610655565b6001600160a01b0316336001600160a01b0316145b156104e55761042d61067a565b6000610437610751565b6001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d8060008114610491576040519150601f19603f3d011682016040523d82523d6000602084013e610496565b606091505b50509050806104df576040805162461bcd60e51b815260206004820152601060248201526f125b5c1b0818d85b1b0819985a5b195960821b604482015290519081900360640190fd5b506104ed565b6104ed6101de565b5050565b6104f96105c0565b6001600160a01b0316336001600160a01b031614156102cd576001600160a01b03811661056d576040805162461bcd60e51b815260206004820152601e60248201527f41646d696e2063616e7420626520746865207a65726f20616464726573730000604482015290519081900360640190fd5b6102c881610776565b60006105806105c0565b6001600160a01b0316336001600160a01b031614806105b757506105a2610655565b6001600160a01b0316336001600160a01b0316145b1561032d576103265b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b60006105ef610655565b7f9e5eddc59e0b171f57125ab86bee043d9128098c3a6b9adb4f2e86333c2f6f8c838155604051919250906001600160a01b0380851691908416907f980c0d30fe97457c47903527d88b7009a1643be6de24d2af664214919f0540a190600090a3505050565b7f9e5eddc59e0b171f57125ab86bee043d9128098c3a6b9adb4f2e86333c2f6f8c5490565b6000610684610655565b90506001600160a01b0381166106e1576040805162461bcd60e51b815260206004820152601b60248201527f496d706c2063616e6e6f74206265207a65726f20616464726573730000000000604482015290519081900360640190fd5b336001600160a01b0382161461073e576040805162461bcd60e51b815260206004820152601b60248201527f4f6e6c792070656e64696e6720696d706c656d656e746174696f6e0000000000604482015290519081900360640190fd5b610747816107e6565b6102d560006105e5565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b60006107806105c0565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103838155604051919250906001600160a01b0380851691908416907f101b8081ff3b56bbf45deb824d86a3b0fd38b7e3dd42421105cf8abe9106db0b90600090a3505050565b60006107f0610751565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc838155604051919250906001600160a01b0380851691908416907faa3f731066a578e5f39b4215468d826cdd15373cbc0dfc9cb9bdc649718ef7da90600090a350505056fea264697066735822122041ce882775d17ef838c17f08249aa48a5f3ea1c65b581e69896452640b274de264736f6c63430007060033", + "linkReferences": {}, + "deployedLinkReferences": {} +} \ No newline at end of file diff --git a/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/L2Curation#L2Curation.json b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/L2Curation#L2Curation.json new file mode 100644 index 000000000..0d8c75203 --- /dev/null +++ b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/L2Curation#L2Curation.json @@ -0,0 +1,707 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "L2Curation", + "sourceName": "contracts/l2/curation/L2Curation.sol", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "curator", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "subgraphDeploymentID", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "signal", + "type": "uint256" + } + ], + "name": "Burned", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "subgraphDeploymentID", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "Collected", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "nameHash", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "contractAddress", + "type": "address" + } + ], + "name": "ContractSynced", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "param", + "type": "string" + } + ], + "name": "ParameterUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "controller", + "type": "address" + } + ], + "name": "SetController", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "curator", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "subgraphDeploymentID", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "signal", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "curationTax", + "type": "uint256" + } + ], + "name": "Signalled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newSubgraphService", + "type": "address" + } + ], + "name": "SubgraphServiceSet", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "contract IGraphProxy", + "name": "_proxy", + "type": "address" + } + ], + "name": "acceptProxy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IGraphProxy", + "name": "_proxy", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "acceptProxyAndCall", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "bondingCurve", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_signalIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_tokensOutMin", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_tokens", + "type": "uint256" + } + ], + "name": "collect", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "controller", + "outputs": [ + { + "internalType": "contract IController", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "curationTaxPercentage", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "curationTokenMaster", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "defaultReserveRatio", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + } + ], + "name": "getCurationPoolSignal", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + } + ], + "name": "getCurationPoolTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_curator", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + } + ], + "name": "getCuratorSignal", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_controller", + "type": "address" + }, + { + "internalType": "address", + "name": "_curationTokenMaster", + "type": "address" + }, + { + "internalType": "uint32", + "name": "_curationTaxPercentage", + "type": "uint32" + }, + { + "internalType": "uint256", + "name": "_minimumCurationDeposit", + "type": "uint256" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + } + ], + "name": "isCurated", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "minimumCurationDeposit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_tokensIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_signalOutMin", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_tokensIn", + "type": "uint256" + } + ], + "name": "mintTaxFree", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "pools", + "outputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "reserveRatio", + "type": "uint32" + }, + { + "internalType": "contract IGraphCurationToken", + "name": "gcs", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_controller", + "type": "address" + } + ], + "name": "setController", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "_percentage", + "type": "uint32" + } + ], + "name": "setCurationTaxPercentage", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_curationTokenMaster", + "type": "address" + } + ], + "name": "setCurationTokenMaster", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "name": "setDefaultReserveRatio", + "outputs": [], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_minimumCurationDeposit", + "type": "uint256" + } + ], + "name": "setMinimumCurationDeposit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_subgraphService", + "type": "address" + } + ], + "name": "setSubgraphService", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_signalIn", + "type": "uint256" + } + ], + "name": "signalToTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "subgraphService", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "syncAllContracts", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_tokensIn", + "type": "uint256" + } + ], + "name": "tokensToSignal", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_tokensIn", + "type": "uint256" + } + ], + "name": "tokensToSignalNoTax", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_tokensIn", + "type": "uint256" + } + ], + "name": "tokensToSignalToTokensNoTax", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "bytecode": "0x6101806040527fe6876326c1291dfcbbd3864a6816d698cd591defc7aa2153d7f9c4c04016c89f6080527fc713c3df6d14cdf946460395d09af88993ee2b948b1a808161494e32c5f6706360a0527f966f1e8d8d8014e05f6ec4a57138da9be1f7c5a7f802928a18072f7c5318076160c0527f1df41cd916959d1163dc8f0671a666ea8a3e434c13e40faef527133b5d16703460e0527f45fc200c7e4544e457d3c5709bfe0d520442c30bbcbdaede89e8d4a4bbc19247610100527fd362cac9cb75c10d67bcc0b7eeb0b1ef48bb5420b556c092d4fd7f758816fcf0610120527f39605a6c26a173774ca666c67ef70cf491880e5d3d6d0ca66ec0a31034f15ea361014052613d0960e61b6101605234801561011a57600080fd5b5060805160a05160c05160e0516101005161012051610140516101605160e01c6128cc61018f60003980610c2f52508061141b52806119025250806113f25250806113c9528061180c5250806113a05280611dbf5250806113775280611ff252508061134e52508061132552506128cc6000f3fe608060405234801561001057600080fd5b50600436106101da5760003560e01c806399439fee11610104578063cd0ad4a2116100a2578063eff1d50e11610071578063eff1d50e146103f2578063f049b900146103fa578063f115c4271461040d578063f77c479114610415576101da565b8063cd0ad4a2146103af578063cd18119e146103c2578063d6866ea5146103d5578063eba0c8a1146103dd576101da565b80639f94c667116100de5780639f94c6671461035f578063a2594d8214610372578063a25e62c714610385578063b5217bb41461038d576101da565b806399439fee146103265780639b4d9f33146103395780639ce7abe51461034c576101da565b80634c4ea0ed1161017c5780637a2a45b81161014b5780637a2a45b8146102da57806381573288146102ed57806392eefe9b1461030057806393a90a1e14610313576101da565b80634c4ea0ed1461027f5780634c8c7a441461029f5780636536fe32146102b457806369db11a1146102c7576101da565b806326058249116101b857806326058249146102235780633718896d14610238578063375a54ab1461024b57806346e855da1461026c576101da565b80630faaf87f146101df578063185360f91461020857806324bdeec714610210575b600080fd5b6101f26101ed366004612175565b61041d565b6040516101ff91906122ab565b60405180910390f35b6101f26104da565b6101f261021e366004612196565b6104e0565b61022b610662565b6040516101ff9190612273565b6101f2610246366004612175565b610677565b61025e610259366004612196565b6108b6565b6040516101ff9291906127b8565b6101f261027a36600461215d565b610af7565b61029261028d36600461215d565b610b0c565b6040516101ff91906122a0565b6102b26102ad3660046120e4565b610b20565b005b6102b26102c236600461215d565b610cb0565b6101f26102d5366004612175565b610cc4565b6101f26102e8366004612175565b610d78565b6102b26102fb366004612175565b610d8b565b6102b261030e3660046120c8565b610e5e565b6102b26103213660046120c8565b610e6f565b6101f261033436600461215d565b610ecb565b6102b26103473660046120c8565b610f72565b6102b261035a3660046121c1565b610f83565b6101f261036d366004612132565b6110d9565b6102b26103803660046120c8565b61118d565b61022b6112a8565b6103a061039b36600461215d565b6112be565b6040516101ff939291906127dc565b6102b26103bd366004612259565b6112ef565b6102b26103d0366004612259565b61130f565b6102b2611320565b6103e5611441565b6040516101ff9190612801565b61022b611454565b61025e610408366004612175565b611463565b6103e56114c0565b61022b6114cc565b6000828152600f6020908152604080832081516060810183528154815260019091015463ffffffff811693820193909352600160201b9092046001600160a01b0316908201528161046d85610ecb565b82519091506104975760405162461bcd60e51b815260040161048e906125e8565b60405180910390fd5b838110156104b75760405162461bcd60e51b815260040161048e906124f3565b81516104cf9082906104c990876114db565b90611534565b925050505b92915050565b600d5481565b60006104ea61159b565b33836105085760405162461bcd60e51b815260040161048e906122b4565b8361051382876110d9565b10156105315760405162461bcd60e51b815260040161048e906124af565b600061053d868661041d565b90508381101561055f5760405162461bcd60e51b815260040161048e906123ff565b61056886611709565b6000868152600f60205260409020805461058290836117a8565b8155600181015460405163079cc67960e41b8152600160201b9091046001600160a01b0316906379cc6790906105be9086908a90600401612287565b600060405180830381600087803b1580156105d857600080fd5b505af11580156105ec573d6000803e3d6000fd5b505050506105f987610ecb565b61060257600081555b61061461060d611805565b8484611835565b86836001600160a01b03167fe14cd5e80f6821ded0538e85a537487acf10bb5e97a12176df56a099e90bfb3484896040516106509291906127b8565b60405180910390a35095945050505050565b6010546201000090046001600160a01b031681565b600061068161159b565b6106896118fb565b6001600160a01b0316336001600160a01b0316146106b95760405162461bcd60e51b815260040161048e90612781565b816106d65760405162461bcd60e51b815260040161048e906126c0565b60006106e28484611926565b6000858152600f6020526040902090915033906106fe86610b0c565b6107ca576001810154600160201b90046001600160a01b03166107ca57600c5460009061073a90600160401b90046001600160a01b03166119d9565b60405163189acdbd60e31b81529091506001600160a01b0382169063c4d66de890610769903090600401612273565b600060405180830381600087803b15801561078357600080fd5b505af1158015610797573d6000803e3d6000fd5b5050506001830180546001600160a01b03909316600160201b02640100000000600160c01b031990931692909217909155505b6107d386611709565b60006107dd611805565b90506107ea818488611a76565b81546107f69087611ad5565b825560018201546040516340c10f1960e01b8152600160201b9091046001600160a01b0316906340c10f19906108329086908890600401612287565b600060405180830381600087803b15801561084c57600080fd5b505af1158015610860573d6000803e3d6000fd5b5050505086836001600160a01b03167fb7bf5f4e5b23ef992df9875ecea572620d18dab0c1a5486a9b695d20d9ec50cf888760006040516108a3939291906127c6565b60405180910390a3509195945050505050565b6000806108c161159b565b836108de5760405162461bcd60e51b815260040161048e906126c0565b6000806108eb8787611463565b915091508482101561090f5760405162461bcd60e51b815260040161048e906123ff565b6000878152600f60205260409020339061092889610b0c565b6109f4576001810154600160201b90046001600160a01b03166109f457600c5460009061096490600160401b90046001600160a01b03166119d9565b60405163189acdbd60e31b81529091506001600160a01b0382169063c4d66de890610993903090600401612273565b600060405180830381600087803b1580156109ad57600080fd5b505af11580156109c1573d6000803e3d6000fd5b5050506001830180546001600160a01b03909316600160201b02640100000000600160c01b031990931692909217909155505b6109fd89611709565b6000610a07611805565b9050610a1481848b611a76565b610a1e8185611b2f565b610a33610a2b8a866117a8565b835490611ad5565b825560018201546040516340c10f1960e01b8152600160201b9091046001600160a01b0316906340c10f1990610a6f9086908990600401612287565b600060405180830381600087803b158015610a8957600080fd5b505af1158015610a9d573d6000803e3d6000fd5b5050505089836001600160a01b03167fb7bf5f4e5b23ef992df9875ecea572620d18dab0c1a5486a9b695d20d9ec50cf8b8888604051610adf939291906127c6565b60405180910390a35092989197509095505050505050565b6000818152600f60205260409020545b919050565b6000908152600f6020526040902054151590565b610b28611b7b565b6001600160a01b0316336001600160a01b031614610b83576040805162461bcd60e51b815260206004820152601360248201527227b7363c9034b6b83632b6b2b73a30ba34b7b760691b604482015290519081900360640190fd5b601054610100900460ff1680610b9c5750610b9c611ba0565b80610baa575060105460ff16155b610be55760405162461bcd60e51b815260040180806020018281038252602e815260200180612848602e913960400191505060405180910390fd5b601054610100900460ff16158015610c10576010805460ff1961ff0019909116610100171660011790555b610c1985610e66565b600c805467ffffffff000000001916600160201b7f000000000000000000000000000000000000000000000000000000000000000063ffffffff160217905560405160008051602061282883398151915290610c74906123d2565b60405180910390a1610c8583611bb1565b610c8e82611c16565b610c9784611c54565b8015610ca9576010805461ff00191690555b5050505050565b610cb8611ce4565b610cc181611c16565b50565b600081610ce35760405162461bcd60e51b815260040161048e90612322565b6000610cef8484611926565b6000858152600f6020908152604080832081516060810183528154815260019091015463ffffffff811693820193909352600160201b9092046001600160a01b031690820152919250610d4b83610d4588610ecb565b90611ad5565b8251909150600090610d5d9087611ad5565b9050610d6d826104c983876114db565b979650505050505050565b6000610d848383611926565b9392505050565b6010546201000090046001600160a01b0316331480610dc25750610dad611db8565b6001600160a01b0316336001600160a01b0316145b610dde5760405162461bcd60e51b815260040161048e9061255c565b610de782610b0c565b610e035760405162461bcd60e51b815260040161048e9061245c565b6000828152600f602052604090208054610e1d9083611ad5565b815560405183907ff17fdee613a92b35db6b7598eb43750b24d4072eb304e6eca80121e40402e34b90610e519085906122ab565b60405180910390a2505050565b610e66611de3565b610cc181611e42565b610e77611ce4565b6010805462010000600160b01b031916620100006001600160a01b038416908102919091179091556040517f81dcb738da3dabd5bb2adbc7dd107fbbfca936e9c8aecab25f5b17a710a784c790600090a250565b6000818152600f6020526040812060010154600160201b90046001600160a01b03168015610f6957806001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015610f2c57600080fd5b505afa158015610f40573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f649190612241565b610d84565b60009392505050565b610f7a611ce4565b610cc181611c54565b82806001600160a01b031663f851a4406040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610fbf57600080fd5b505af1158015610fd3573d6000803e3d6000fd5b505050506040513d6020811015610fe957600080fd5b50516001600160a01b03163314611047576040805162461bcd60e51b815260206004820152601e60248201527f43616c6c6572206d757374206265207468652070726f78792061646d696e0000604482015290519081900360640190fd5b60405163623faf6160e01b8152602060048201908152602482018490526001600160a01b0386169163623faf619186918691908190604401848480828437600081840152601f19601f8201169050808301925050509350505050600060405180830381600087803b1580156110bb57600080fd5b505af11580156110cf573d6000803e3d6000fd5b5050505050505050565b6000818152600f6020526040812060010154600160201b90046001600160a01b03168015611182576040516370a0823160e01b81526001600160a01b038216906370a082319061112d908790600401612273565b60206040518083038186803b15801561114557600080fd5b505afa158015611159573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061117d9190612241565b611185565b60005b949350505050565b80806001600160a01b031663f851a4406040518163ffffffff1660e01b8152600401602060405180830381600087803b1580156111c957600080fd5b505af11580156111dd573d6000803e3d6000fd5b505050506040513d60208110156111f357600080fd5b50516001600160a01b03163314611251576040805162461bcd60e51b815260206004820152601e60248201527f43616c6c6572206d757374206265207468652070726f78792061646d696e0000604482015290519081900360640190fd5b816001600160a01b03166359fc20bb6040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561128c57600080fd5b505af11580156112a0573d6000803e3d6000fd5b505050505050565b600c54600160401b90046001600160a01b031681565b600f602052600090815260409020805460019091015463ffffffff811690600160201b90046001600160a01b031683565b6112f7611ce4565b60405162461bcd60e51b815260040161048e906123a3565b611317611ce4565b610cc181611bb1565b6113497f0000000000000000000000000000000000000000000000000000000000000000611eea565b6113727f0000000000000000000000000000000000000000000000000000000000000000611eea565b61139b7f0000000000000000000000000000000000000000000000000000000000000000611eea565b6113c47f0000000000000000000000000000000000000000000000000000000000000000611eea565b6113ed7f0000000000000000000000000000000000000000000000000000000000000000611eea565b6114167f0000000000000000000000000000000000000000000000000000000000000000611eea565b61143f7f0000000000000000000000000000000000000000000000000000000000000000611eea565b565b600c54600160201b900463ffffffff1681565b600e546001600160a01b031681565b600c546000908190819061149790620f4240906104c990879061149190849063ffffffff908116906117a816565b906114db565b905060006114a585836117a8565b905060006114b38784611926565b9791965090945050505050565b600c5463ffffffff1681565b6000546001600160a01b031681565b6000826114ea575060006104d4565b828202828482816114f757fe5b0414610d845760405162461bcd60e51b81526004018080602001828103825260218152602001806128766021913960400191505060405180910390fd5b600080821161158a576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b81838161159357fe5b049392505050565b60008054906101000a90046001600160a01b03166001600160a01b0316635c975abb6040518163ffffffff1660e01b815260040160206040518083038186803b1580156115e757600080fd5b505afa1580156115fb573d6000803e3d6000fd5b505050506040513d602081101561161157600080fd5b50511561164e576040805162461bcd60e51b815260206004820152600660248201526514185d5cd95960d21b604482015290519081900360640190fd5b60008054906101000a90046001600160a01b03166001600160a01b0316632e292fc76040518163ffffffff1660e01b815260040160206040518083038186803b15801561169a57600080fd5b505afa1580156116ae573d6000803e3d6000fd5b505050506040513d60208110156116c457600080fd5b50511561143f576040805162461bcd60e51b815260206004820152600e60248201526d14185c9d1a585b0b5c185d5cd95960921b604482015290519081900360640190fd5b6000611713611feb565b90506001600160a01b038116156117a4576040516307470bfb60e21b81526001600160a01b03821690631d1c2fec906117509085906004016122ab565b602060405180830381600087803b15801561176a57600080fd5b505af115801561177e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117a29190612241565b505b5050565b6000828211156117ff576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b60006118307f0000000000000000000000000000000000000000000000000000000000000000612012565b905090565b80156117a257826001600160a01b031663a9059cbb83836040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561189257600080fd5b505af11580156118a6573d6000803e3d6000fd5b505050506040513d60208110156118bc57600080fd5b50516117a2576040805162461bcd60e51b815260206004820152600960248201526810ba3930b739b332b960b91b604482015290519081900360640190fd5b60006118307f0000000000000000000000000000000000000000000000000000000000000000612012565b6000828152600f602090815260408083208151606081018352815480825260019092015463ffffffff811694820194909452600160201b9093046001600160a01b0316918301919091526119c657600d548310156119965760405162461bcd60e51b815260040161048e90612359565b600d546119be906119b6906104c96119ae87836117a8565b6001906114db565b600190611ad5565b9150506104d4565b8051611185906104c98561149188610ecb565b6000604051733d602d80600a3d3981f3363d3d373d3d3d363d7360601b81528260601b60148201526e5af43d82803e903d91602b57fd5bf360881b60288201526037816000f09150506001600160a01b038116610b07576040805162461bcd60e51b8152602060048201526016602482015275115490cc4c4d8dce8818dc99585d194819985a5b195960521b604482015290519081900360640190fd5b80156117a257604080516323b872dd60e01b81526001600160a01b038481166004830152306024830152604482018490529151918516916323b872dd916064808201926020929091908290030181600087803b15801561189257600080fd5b600082820183811015610d84576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b80156117a457816001600160a01b03166342966c68826040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561128c57600080fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6000611bab306120ae565b15905090565b620f424063ffffffff82161115611bda5760405162461bcd60e51b815260040161048e906126f7565b600c805463ffffffff191663ffffffff831617905560405160008051602061282883398151915290611c0b906125b9565b60405180910390a150565b80611c335760405162461bcd60e51b815260040161048e90612645565b600d81905560405160008051602061282883398151915290611c0b9061242c565b6001600160a01b038116611c7a5760405162461bcd60e51b815260040161048e906122eb565b611c83816120ae565b611c9f5760405162461bcd60e51b815260040161048e90612689565b600c805468010000000000000000600160e01b031916600160401b6001600160a01b0384160217905560405160008051602061282883398151915290611c0b90612754565b60008054906101000a90046001600160a01b03166001600160a01b0316634fc07d756040518163ffffffff1660e01b815260040160206040518083038186803b158015611d3057600080fd5b505afa158015611d44573d6000803e3d6000fd5b505050506040513d6020811015611d5a57600080fd5b50516001600160a01b0316331461143f576040805162461bcd60e51b815260206004820152601860248201527f4f6e6c7920436f6e74726f6c6c657220676f7665726e6f720000000000000000604482015290519081900360640190fd5b60006118307f0000000000000000000000000000000000000000000000000000000000000000612012565b6000546001600160a01b0316331461143f576040805162461bcd60e51b815260206004820152601960248201527f43616c6c6572206d75737420626520436f6e74726f6c6c657200000000000000604482015290519081900360640190fd5b6001600160a01b038116611e96576040805162461bcd60e51b815260206004820152601660248201527510dbdb9d1c9bdb1b195c881b5d5cdd081899481cd95d60521b604482015290519081900360640190fd5b600080546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f4ff638452bbf33c012645d18ae6f05515ff5f2d1dfb0cece8cbf018c60903f709181900360200190a150565b6000805460408051637bb20d2f60e11b81526004810185905290516001600160a01b039092169163f7641a5e91602480820192602092909190829003018186803b158015611f3757600080fd5b505afa158015611f4b573d6000803e3d6000fd5b505050506040513d6020811015611f6157600080fd5b50516000838152600160205260409020549091506001600160a01b038083169116146117a45760008281526001602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251908152915184927fd0e7a942b1fc38c411c4f53d153ba14fd24542a6a35ebacd9b6afca1a154e20692908290030190a25050565b60006118307f00000000000000000000000000000000000000000000000000000000000000005b6000818152600160205260408120546001600160a01b0316806104d45760005460408051637bb20d2f60e11b81526004810186905290516001600160a01b039092169163f7641a5e91602480820192602092909190829003018186803b15801561207b57600080fd5b505afa15801561208f573d6000803e3d6000fd5b505050506040513d60208110156120a557600080fd5b50519392505050565b3b151590565b803563ffffffff81168114610b0757600080fd5b6000602082840312156120d9578081fd5b8135610d8481612812565b600080600080608085870312156120f9578283fd5b843561210481612812565b9350602085013561211481612812565b9250612122604086016120b4565b9396929550929360600135925050565b60008060408385031215612144578182fd5b823561214f81612812565b946020939093013593505050565b60006020828403121561216e578081fd5b5035919050565b60008060408385031215612187578182fd5b50508035926020909101359150565b6000806000606084860312156121aa578283fd5b505081359360208301359350604090920135919050565b6000806000604084860312156121d5578283fd5b83356121e081612812565b9250602084013567ffffffffffffffff808211156121fc578384fd5b818601915086601f83011261220f578384fd5b81358181111561221d578485fd5b87602082850101111561222e578485fd5b6020830194508093505050509250925092565b600060208284031215612252578081fd5b5051919050565b60006020828403121561226a578081fd5b610d84826120b4565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b901515815260200190565b90815260200190565b60208082526017908201527f43616e6e6f74206275726e207a65726f207369676e616c000000000000000000604082015260600190565b6020808252601e908201527f546f6b656e206d6173746572206d757374206265206e6f6e2d656d7074790000604082015260600190565b6020808252601d908201527f43616e27742063616c63756c6174652077697468203020746f6b656e73000000604082015260600190565b6020808252602a908201527f4375726174696f6e206465706f7369742069732062656c6f77206d696e696d756040820152691b481c995c5d5a5c995960b21b606082015260800190565b6020808252601590820152742737ba1034b6b83632b6b2b73a32b21034b710261960591b604082015260600190565b60208082526013908201527264656661756c7452657365727665526174696f60681b604082015260600190565b60208082526013908201527229b634b83830b3b290383937ba32b1ba34b7b760691b604082015260600190565b6020808252601690820152751b5a5b9a5b5d5b50dd5c985d1a5bdb91195c1bdcda5d60521b604082015260600190565b60208082526033908201527f5375626772617068206465706c6f796d656e74206d757374206265206375726160408201527274656420746f20636f6c6c656374206665657360681b606082015260800190565b60208082526024908201527f43616e6e6f74206275726e206d6f7265207369676e616c207468616e20796f756040820152631037bbb760e11b606082015260800190565b60208082526043908201527f5369676e616c206d7573742062652061626f7665206f7220657175616c20746f60408201527f207369676e616c2069737375656420696e20746865206375726174696f6e20706060820152621bdbdb60ea1b608082015260a00190565b60208082526037908201527f43616c6c6572206d75737420626520746865207375626772617068207365727660408201527f696365206f72207374616b696e6720636f6e7472616374000000000000000000606082015260800190565b6020808252601590820152746375726174696f6e54617850657263656e7461676560581b604082015260600190565b6020808252603b908201527f5375626772617068206465706c6f796d656e74206d757374206265206375726160408201527f74656420746f20706572666f726d2063616c63756c6174696f6e730000000000606082015260800190565b60208082526024908201527f4d696e696d756d206375726174696f6e206465706f7369742063616e6e6f74206040820152630626520360e41b606082015260800190565b6020808252601f908201527f546f6b656e206d6173746572206d757374206265206120636f6e747261637400604082015260600190565b6020808252601a908201527f43616e6e6f74206465706f736974207a65726f20746f6b656e73000000000000604082015260600190565b60208082526039908201527f4375726174696f6e207461782070657263656e74616765206d7573742062652060408201527f62656c6f77206f7220657175616c20746f204d41585f50504d00000000000000606082015260800190565b60208082526013908201527231bab930ba34b7b72a37b5b2b726b0b9ba32b960691b604082015260600190565b6020808252601a908201527f4f6e6c792074686520474e532063616e2063616c6c2074686973000000000000604082015260600190565b918252602082015260400190565b9283526020830191909152604082015260600190565b92835263ffffffff9190911660208301526001600160a01b0316604082015260600190565b63ffffffff91909116815260200190565b6001600160a01b0381168114610cc157600080fdfe96d5a4b4edf1cefd0900c166d64447f8da1d01d1861a6a60894b5b82a2c15c3c496e697469616c697a61626c653a20636f6e747261637420697320616c726561647920696e697469616c697a6564536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a2646970667358221220182d4780700d3d385918c6f4a2bbe50d522f035098d04683e959156c3033203064736f6c63430007060033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101da5760003560e01c806399439fee11610104578063cd0ad4a2116100a2578063eff1d50e11610071578063eff1d50e146103f2578063f049b900146103fa578063f115c4271461040d578063f77c479114610415576101da565b8063cd0ad4a2146103af578063cd18119e146103c2578063d6866ea5146103d5578063eba0c8a1146103dd576101da565b80639f94c667116100de5780639f94c6671461035f578063a2594d8214610372578063a25e62c714610385578063b5217bb41461038d576101da565b806399439fee146103265780639b4d9f33146103395780639ce7abe51461034c576101da565b80634c4ea0ed1161017c5780637a2a45b81161014b5780637a2a45b8146102da57806381573288146102ed57806392eefe9b1461030057806393a90a1e14610313576101da565b80634c4ea0ed1461027f5780634c8c7a441461029f5780636536fe32146102b457806369db11a1146102c7576101da565b806326058249116101b857806326058249146102235780633718896d14610238578063375a54ab1461024b57806346e855da1461026c576101da565b80630faaf87f146101df578063185360f91461020857806324bdeec714610210575b600080fd5b6101f26101ed366004612175565b61041d565b6040516101ff91906122ab565b60405180910390f35b6101f26104da565b6101f261021e366004612196565b6104e0565b61022b610662565b6040516101ff9190612273565b6101f2610246366004612175565b610677565b61025e610259366004612196565b6108b6565b6040516101ff9291906127b8565b6101f261027a36600461215d565b610af7565b61029261028d36600461215d565b610b0c565b6040516101ff91906122a0565b6102b26102ad3660046120e4565b610b20565b005b6102b26102c236600461215d565b610cb0565b6101f26102d5366004612175565b610cc4565b6101f26102e8366004612175565b610d78565b6102b26102fb366004612175565b610d8b565b6102b261030e3660046120c8565b610e5e565b6102b26103213660046120c8565b610e6f565b6101f261033436600461215d565b610ecb565b6102b26103473660046120c8565b610f72565b6102b261035a3660046121c1565b610f83565b6101f261036d366004612132565b6110d9565b6102b26103803660046120c8565b61118d565b61022b6112a8565b6103a061039b36600461215d565b6112be565b6040516101ff939291906127dc565b6102b26103bd366004612259565b6112ef565b6102b26103d0366004612259565b61130f565b6102b2611320565b6103e5611441565b6040516101ff9190612801565b61022b611454565b61025e610408366004612175565b611463565b6103e56114c0565b61022b6114cc565b6000828152600f6020908152604080832081516060810183528154815260019091015463ffffffff811693820193909352600160201b9092046001600160a01b0316908201528161046d85610ecb565b82519091506104975760405162461bcd60e51b815260040161048e906125e8565b60405180910390fd5b838110156104b75760405162461bcd60e51b815260040161048e906124f3565b81516104cf9082906104c990876114db565b90611534565b925050505b92915050565b600d5481565b60006104ea61159b565b33836105085760405162461bcd60e51b815260040161048e906122b4565b8361051382876110d9565b10156105315760405162461bcd60e51b815260040161048e906124af565b600061053d868661041d565b90508381101561055f5760405162461bcd60e51b815260040161048e906123ff565b61056886611709565b6000868152600f60205260409020805461058290836117a8565b8155600181015460405163079cc67960e41b8152600160201b9091046001600160a01b0316906379cc6790906105be9086908a90600401612287565b600060405180830381600087803b1580156105d857600080fd5b505af11580156105ec573d6000803e3d6000fd5b505050506105f987610ecb565b61060257600081555b61061461060d611805565b8484611835565b86836001600160a01b03167fe14cd5e80f6821ded0538e85a537487acf10bb5e97a12176df56a099e90bfb3484896040516106509291906127b8565b60405180910390a35095945050505050565b6010546201000090046001600160a01b031681565b600061068161159b565b6106896118fb565b6001600160a01b0316336001600160a01b0316146106b95760405162461bcd60e51b815260040161048e90612781565b816106d65760405162461bcd60e51b815260040161048e906126c0565b60006106e28484611926565b6000858152600f6020526040902090915033906106fe86610b0c565b6107ca576001810154600160201b90046001600160a01b03166107ca57600c5460009061073a90600160401b90046001600160a01b03166119d9565b60405163189acdbd60e31b81529091506001600160a01b0382169063c4d66de890610769903090600401612273565b600060405180830381600087803b15801561078357600080fd5b505af1158015610797573d6000803e3d6000fd5b5050506001830180546001600160a01b03909316600160201b02640100000000600160c01b031990931692909217909155505b6107d386611709565b60006107dd611805565b90506107ea818488611a76565b81546107f69087611ad5565b825560018201546040516340c10f1960e01b8152600160201b9091046001600160a01b0316906340c10f19906108329086908890600401612287565b600060405180830381600087803b15801561084c57600080fd5b505af1158015610860573d6000803e3d6000fd5b5050505086836001600160a01b03167fb7bf5f4e5b23ef992df9875ecea572620d18dab0c1a5486a9b695d20d9ec50cf888760006040516108a3939291906127c6565b60405180910390a3509195945050505050565b6000806108c161159b565b836108de5760405162461bcd60e51b815260040161048e906126c0565b6000806108eb8787611463565b915091508482101561090f5760405162461bcd60e51b815260040161048e906123ff565b6000878152600f60205260409020339061092889610b0c565b6109f4576001810154600160201b90046001600160a01b03166109f457600c5460009061096490600160401b90046001600160a01b03166119d9565b60405163189acdbd60e31b81529091506001600160a01b0382169063c4d66de890610993903090600401612273565b600060405180830381600087803b1580156109ad57600080fd5b505af11580156109c1573d6000803e3d6000fd5b5050506001830180546001600160a01b03909316600160201b02640100000000600160c01b031990931692909217909155505b6109fd89611709565b6000610a07611805565b9050610a1481848b611a76565b610a1e8185611b2f565b610a33610a2b8a866117a8565b835490611ad5565b825560018201546040516340c10f1960e01b8152600160201b9091046001600160a01b0316906340c10f1990610a6f9086908990600401612287565b600060405180830381600087803b158015610a8957600080fd5b505af1158015610a9d573d6000803e3d6000fd5b5050505089836001600160a01b03167fb7bf5f4e5b23ef992df9875ecea572620d18dab0c1a5486a9b695d20d9ec50cf8b8888604051610adf939291906127c6565b60405180910390a35092989197509095505050505050565b6000818152600f60205260409020545b919050565b6000908152600f6020526040902054151590565b610b28611b7b565b6001600160a01b0316336001600160a01b031614610b83576040805162461bcd60e51b815260206004820152601360248201527227b7363c9034b6b83632b6b2b73a30ba34b7b760691b604482015290519081900360640190fd5b601054610100900460ff1680610b9c5750610b9c611ba0565b80610baa575060105460ff16155b610be55760405162461bcd60e51b815260040180806020018281038252602e815260200180612848602e913960400191505060405180910390fd5b601054610100900460ff16158015610c10576010805460ff1961ff0019909116610100171660011790555b610c1985610e66565b600c805467ffffffff000000001916600160201b7f000000000000000000000000000000000000000000000000000000000000000063ffffffff160217905560405160008051602061282883398151915290610c74906123d2565b60405180910390a1610c8583611bb1565b610c8e82611c16565b610c9784611c54565b8015610ca9576010805461ff00191690555b5050505050565b610cb8611ce4565b610cc181611c16565b50565b600081610ce35760405162461bcd60e51b815260040161048e90612322565b6000610cef8484611926565b6000858152600f6020908152604080832081516060810183528154815260019091015463ffffffff811693820193909352600160201b9092046001600160a01b031690820152919250610d4b83610d4588610ecb565b90611ad5565b8251909150600090610d5d9087611ad5565b9050610d6d826104c983876114db565b979650505050505050565b6000610d848383611926565b9392505050565b6010546201000090046001600160a01b0316331480610dc25750610dad611db8565b6001600160a01b0316336001600160a01b0316145b610dde5760405162461bcd60e51b815260040161048e9061255c565b610de782610b0c565b610e035760405162461bcd60e51b815260040161048e9061245c565b6000828152600f602052604090208054610e1d9083611ad5565b815560405183907ff17fdee613a92b35db6b7598eb43750b24d4072eb304e6eca80121e40402e34b90610e519085906122ab565b60405180910390a2505050565b610e66611de3565b610cc181611e42565b610e77611ce4565b6010805462010000600160b01b031916620100006001600160a01b038416908102919091179091556040517f81dcb738da3dabd5bb2adbc7dd107fbbfca936e9c8aecab25f5b17a710a784c790600090a250565b6000818152600f6020526040812060010154600160201b90046001600160a01b03168015610f6957806001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015610f2c57600080fd5b505afa158015610f40573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f649190612241565b610d84565b60009392505050565b610f7a611ce4565b610cc181611c54565b82806001600160a01b031663f851a4406040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610fbf57600080fd5b505af1158015610fd3573d6000803e3d6000fd5b505050506040513d6020811015610fe957600080fd5b50516001600160a01b03163314611047576040805162461bcd60e51b815260206004820152601e60248201527f43616c6c6572206d757374206265207468652070726f78792061646d696e0000604482015290519081900360640190fd5b60405163623faf6160e01b8152602060048201908152602482018490526001600160a01b0386169163623faf619186918691908190604401848480828437600081840152601f19601f8201169050808301925050509350505050600060405180830381600087803b1580156110bb57600080fd5b505af11580156110cf573d6000803e3d6000fd5b5050505050505050565b6000818152600f6020526040812060010154600160201b90046001600160a01b03168015611182576040516370a0823160e01b81526001600160a01b038216906370a082319061112d908790600401612273565b60206040518083038186803b15801561114557600080fd5b505afa158015611159573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061117d9190612241565b611185565b60005b949350505050565b80806001600160a01b031663f851a4406040518163ffffffff1660e01b8152600401602060405180830381600087803b1580156111c957600080fd5b505af11580156111dd573d6000803e3d6000fd5b505050506040513d60208110156111f357600080fd5b50516001600160a01b03163314611251576040805162461bcd60e51b815260206004820152601e60248201527f43616c6c6572206d757374206265207468652070726f78792061646d696e0000604482015290519081900360640190fd5b816001600160a01b03166359fc20bb6040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561128c57600080fd5b505af11580156112a0573d6000803e3d6000fd5b505050505050565b600c54600160401b90046001600160a01b031681565b600f602052600090815260409020805460019091015463ffffffff811690600160201b90046001600160a01b031683565b6112f7611ce4565b60405162461bcd60e51b815260040161048e906123a3565b611317611ce4565b610cc181611bb1565b6113497f0000000000000000000000000000000000000000000000000000000000000000611eea565b6113727f0000000000000000000000000000000000000000000000000000000000000000611eea565b61139b7f0000000000000000000000000000000000000000000000000000000000000000611eea565b6113c47f0000000000000000000000000000000000000000000000000000000000000000611eea565b6113ed7f0000000000000000000000000000000000000000000000000000000000000000611eea565b6114167f0000000000000000000000000000000000000000000000000000000000000000611eea565b61143f7f0000000000000000000000000000000000000000000000000000000000000000611eea565b565b600c54600160201b900463ffffffff1681565b600e546001600160a01b031681565b600c546000908190819061149790620f4240906104c990879061149190849063ffffffff908116906117a816565b906114db565b905060006114a585836117a8565b905060006114b38784611926565b9791965090945050505050565b600c5463ffffffff1681565b6000546001600160a01b031681565b6000826114ea575060006104d4565b828202828482816114f757fe5b0414610d845760405162461bcd60e51b81526004018080602001828103825260218152602001806128766021913960400191505060405180910390fd5b600080821161158a576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b81838161159357fe5b049392505050565b60008054906101000a90046001600160a01b03166001600160a01b0316635c975abb6040518163ffffffff1660e01b815260040160206040518083038186803b1580156115e757600080fd5b505afa1580156115fb573d6000803e3d6000fd5b505050506040513d602081101561161157600080fd5b50511561164e576040805162461bcd60e51b815260206004820152600660248201526514185d5cd95960d21b604482015290519081900360640190fd5b60008054906101000a90046001600160a01b03166001600160a01b0316632e292fc76040518163ffffffff1660e01b815260040160206040518083038186803b15801561169a57600080fd5b505afa1580156116ae573d6000803e3d6000fd5b505050506040513d60208110156116c457600080fd5b50511561143f576040805162461bcd60e51b815260206004820152600e60248201526d14185c9d1a585b0b5c185d5cd95960921b604482015290519081900360640190fd5b6000611713611feb565b90506001600160a01b038116156117a4576040516307470bfb60e21b81526001600160a01b03821690631d1c2fec906117509085906004016122ab565b602060405180830381600087803b15801561176a57600080fd5b505af115801561177e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117a29190612241565b505b5050565b6000828211156117ff576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b60006118307f0000000000000000000000000000000000000000000000000000000000000000612012565b905090565b80156117a257826001600160a01b031663a9059cbb83836040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561189257600080fd5b505af11580156118a6573d6000803e3d6000fd5b505050506040513d60208110156118bc57600080fd5b50516117a2576040805162461bcd60e51b815260206004820152600960248201526810ba3930b739b332b960b91b604482015290519081900360640190fd5b60006118307f0000000000000000000000000000000000000000000000000000000000000000612012565b6000828152600f602090815260408083208151606081018352815480825260019092015463ffffffff811694820194909452600160201b9093046001600160a01b0316918301919091526119c657600d548310156119965760405162461bcd60e51b815260040161048e90612359565b600d546119be906119b6906104c96119ae87836117a8565b6001906114db565b600190611ad5565b9150506104d4565b8051611185906104c98561149188610ecb565b6000604051733d602d80600a3d3981f3363d3d373d3d3d363d7360601b81528260601b60148201526e5af43d82803e903d91602b57fd5bf360881b60288201526037816000f09150506001600160a01b038116610b07576040805162461bcd60e51b8152602060048201526016602482015275115490cc4c4d8dce8818dc99585d194819985a5b195960521b604482015290519081900360640190fd5b80156117a257604080516323b872dd60e01b81526001600160a01b038481166004830152306024830152604482018490529151918516916323b872dd916064808201926020929091908290030181600087803b15801561189257600080fd5b600082820183811015610d84576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b80156117a457816001600160a01b03166342966c68826040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561128c57600080fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6000611bab306120ae565b15905090565b620f424063ffffffff82161115611bda5760405162461bcd60e51b815260040161048e906126f7565b600c805463ffffffff191663ffffffff831617905560405160008051602061282883398151915290611c0b906125b9565b60405180910390a150565b80611c335760405162461bcd60e51b815260040161048e90612645565b600d81905560405160008051602061282883398151915290611c0b9061242c565b6001600160a01b038116611c7a5760405162461bcd60e51b815260040161048e906122eb565b611c83816120ae565b611c9f5760405162461bcd60e51b815260040161048e90612689565b600c805468010000000000000000600160e01b031916600160401b6001600160a01b0384160217905560405160008051602061282883398151915290611c0b90612754565b60008054906101000a90046001600160a01b03166001600160a01b0316634fc07d756040518163ffffffff1660e01b815260040160206040518083038186803b158015611d3057600080fd5b505afa158015611d44573d6000803e3d6000fd5b505050506040513d6020811015611d5a57600080fd5b50516001600160a01b0316331461143f576040805162461bcd60e51b815260206004820152601860248201527f4f6e6c7920436f6e74726f6c6c657220676f7665726e6f720000000000000000604482015290519081900360640190fd5b60006118307f0000000000000000000000000000000000000000000000000000000000000000612012565b6000546001600160a01b0316331461143f576040805162461bcd60e51b815260206004820152601960248201527f43616c6c6572206d75737420626520436f6e74726f6c6c657200000000000000604482015290519081900360640190fd5b6001600160a01b038116611e96576040805162461bcd60e51b815260206004820152601660248201527510dbdb9d1c9bdb1b195c881b5d5cdd081899481cd95d60521b604482015290519081900360640190fd5b600080546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f4ff638452bbf33c012645d18ae6f05515ff5f2d1dfb0cece8cbf018c60903f709181900360200190a150565b6000805460408051637bb20d2f60e11b81526004810185905290516001600160a01b039092169163f7641a5e91602480820192602092909190829003018186803b158015611f3757600080fd5b505afa158015611f4b573d6000803e3d6000fd5b505050506040513d6020811015611f6157600080fd5b50516000838152600160205260409020549091506001600160a01b038083169116146117a45760008281526001602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251908152915184927fd0e7a942b1fc38c411c4f53d153ba14fd24542a6a35ebacd9b6afca1a154e20692908290030190a25050565b60006118307f00000000000000000000000000000000000000000000000000000000000000005b6000818152600160205260408120546001600160a01b0316806104d45760005460408051637bb20d2f60e11b81526004810186905290516001600160a01b039092169163f7641a5e91602480820192602092909190829003018186803b15801561207b57600080fd5b505afa15801561208f573d6000803e3d6000fd5b505050506040513d60208110156120a557600080fd5b50519392505050565b3b151590565b803563ffffffff81168114610b0757600080fd5b6000602082840312156120d9578081fd5b8135610d8481612812565b600080600080608085870312156120f9578283fd5b843561210481612812565b9350602085013561211481612812565b9250612122604086016120b4565b9396929550929360600135925050565b60008060408385031215612144578182fd5b823561214f81612812565b946020939093013593505050565b60006020828403121561216e578081fd5b5035919050565b60008060408385031215612187578182fd5b50508035926020909101359150565b6000806000606084860312156121aa578283fd5b505081359360208301359350604090920135919050565b6000806000604084860312156121d5578283fd5b83356121e081612812565b9250602084013567ffffffffffffffff808211156121fc578384fd5b818601915086601f83011261220f578384fd5b81358181111561221d578485fd5b87602082850101111561222e578485fd5b6020830194508093505050509250925092565b600060208284031215612252578081fd5b5051919050565b60006020828403121561226a578081fd5b610d84826120b4565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b901515815260200190565b90815260200190565b60208082526017908201527f43616e6e6f74206275726e207a65726f207369676e616c000000000000000000604082015260600190565b6020808252601e908201527f546f6b656e206d6173746572206d757374206265206e6f6e2d656d7074790000604082015260600190565b6020808252601d908201527f43616e27742063616c63756c6174652077697468203020746f6b656e73000000604082015260600190565b6020808252602a908201527f4375726174696f6e206465706f7369742069732062656c6f77206d696e696d756040820152691b481c995c5d5a5c995960b21b606082015260800190565b6020808252601590820152742737ba1034b6b83632b6b2b73a32b21034b710261960591b604082015260600190565b60208082526013908201527264656661756c7452657365727665526174696f60681b604082015260600190565b60208082526013908201527229b634b83830b3b290383937ba32b1ba34b7b760691b604082015260600190565b6020808252601690820152751b5a5b9a5b5d5b50dd5c985d1a5bdb91195c1bdcda5d60521b604082015260600190565b60208082526033908201527f5375626772617068206465706c6f796d656e74206d757374206265206375726160408201527274656420746f20636f6c6c656374206665657360681b606082015260800190565b60208082526024908201527f43616e6e6f74206275726e206d6f7265207369676e616c207468616e20796f756040820152631037bbb760e11b606082015260800190565b60208082526043908201527f5369676e616c206d7573742062652061626f7665206f7220657175616c20746f60408201527f207369676e616c2069737375656420696e20746865206375726174696f6e20706060820152621bdbdb60ea1b608082015260a00190565b60208082526037908201527f43616c6c6572206d75737420626520746865207375626772617068207365727660408201527f696365206f72207374616b696e6720636f6e7472616374000000000000000000606082015260800190565b6020808252601590820152746375726174696f6e54617850657263656e7461676560581b604082015260600190565b6020808252603b908201527f5375626772617068206465706c6f796d656e74206d757374206265206375726160408201527f74656420746f20706572666f726d2063616c63756c6174696f6e730000000000606082015260800190565b60208082526024908201527f4d696e696d756d206375726174696f6e206465706f7369742063616e6e6f74206040820152630626520360e41b606082015260800190565b6020808252601f908201527f546f6b656e206d6173746572206d757374206265206120636f6e747261637400604082015260600190565b6020808252601a908201527f43616e6e6f74206465706f736974207a65726f20746f6b656e73000000000000604082015260600190565b60208082526039908201527f4375726174696f6e207461782070657263656e74616765206d7573742062652060408201527f62656c6f77206f7220657175616c20746f204d41585f50504d00000000000000606082015260800190565b60208082526013908201527231bab930ba34b7b72a37b5b2b726b0b9ba32b960691b604082015260600190565b6020808252601a908201527f4f6e6c792074686520474e532063616e2063616c6c2074686973000000000000604082015260600190565b918252602082015260400190565b9283526020830191909152604082015260600190565b92835263ffffffff9190911660208301526001600160a01b0316604082015260600190565b63ffffffff91909116815260200190565b6001600160a01b0381168114610cc157600080fdfe96d5a4b4edf1cefd0900c166d64447f8da1d01d1861a6a60894b5b82a2c15c3c496e697469616c697a61626c653a20636f6e747261637420697320616c726561647920696e697469616c697a6564536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a2646970667358221220182d4780700d3d385918c6f4a2bbe50d522f035098d04683e959156c3033203064736f6c63430007060033", + "linkReferences": {}, + "deployedLinkReferences": {} +} \ No newline at end of file diff --git a/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/L2Curation#L2CurationAddressBook.json b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/L2Curation#L2CurationAddressBook.json new file mode 100644 index 000000000..0d8c75203 --- /dev/null +++ b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/L2Curation#L2CurationAddressBook.json @@ -0,0 +1,707 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "L2Curation", + "sourceName": "contracts/l2/curation/L2Curation.sol", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "curator", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "subgraphDeploymentID", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "signal", + "type": "uint256" + } + ], + "name": "Burned", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "subgraphDeploymentID", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "Collected", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "nameHash", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "contractAddress", + "type": "address" + } + ], + "name": "ContractSynced", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "param", + "type": "string" + } + ], + "name": "ParameterUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "controller", + "type": "address" + } + ], + "name": "SetController", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "curator", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "subgraphDeploymentID", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "signal", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "curationTax", + "type": "uint256" + } + ], + "name": "Signalled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newSubgraphService", + "type": "address" + } + ], + "name": "SubgraphServiceSet", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "contract IGraphProxy", + "name": "_proxy", + "type": "address" + } + ], + "name": "acceptProxy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IGraphProxy", + "name": "_proxy", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "acceptProxyAndCall", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "bondingCurve", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_signalIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_tokensOutMin", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_tokens", + "type": "uint256" + } + ], + "name": "collect", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "controller", + "outputs": [ + { + "internalType": "contract IController", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "curationTaxPercentage", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "curationTokenMaster", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "defaultReserveRatio", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + } + ], + "name": "getCurationPoolSignal", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + } + ], + "name": "getCurationPoolTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_curator", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + } + ], + "name": "getCuratorSignal", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_controller", + "type": "address" + }, + { + "internalType": "address", + "name": "_curationTokenMaster", + "type": "address" + }, + { + "internalType": "uint32", + "name": "_curationTaxPercentage", + "type": "uint32" + }, + { + "internalType": "uint256", + "name": "_minimumCurationDeposit", + "type": "uint256" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + } + ], + "name": "isCurated", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "minimumCurationDeposit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_tokensIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_signalOutMin", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_tokensIn", + "type": "uint256" + } + ], + "name": "mintTaxFree", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "pools", + "outputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "reserveRatio", + "type": "uint32" + }, + { + "internalType": "contract IGraphCurationToken", + "name": "gcs", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_controller", + "type": "address" + } + ], + "name": "setController", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "_percentage", + "type": "uint32" + } + ], + "name": "setCurationTaxPercentage", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_curationTokenMaster", + "type": "address" + } + ], + "name": "setCurationTokenMaster", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "name": "setDefaultReserveRatio", + "outputs": [], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_minimumCurationDeposit", + "type": "uint256" + } + ], + "name": "setMinimumCurationDeposit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_subgraphService", + "type": "address" + } + ], + "name": "setSubgraphService", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_signalIn", + "type": "uint256" + } + ], + "name": "signalToTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "subgraphService", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "syncAllContracts", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_tokensIn", + "type": "uint256" + } + ], + "name": "tokensToSignal", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_tokensIn", + "type": "uint256" + } + ], + "name": "tokensToSignalNoTax", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_tokensIn", + "type": "uint256" + } + ], + "name": "tokensToSignalToTokensNoTax", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "bytecode": "0x6101806040527fe6876326c1291dfcbbd3864a6816d698cd591defc7aa2153d7f9c4c04016c89f6080527fc713c3df6d14cdf946460395d09af88993ee2b948b1a808161494e32c5f6706360a0527f966f1e8d8d8014e05f6ec4a57138da9be1f7c5a7f802928a18072f7c5318076160c0527f1df41cd916959d1163dc8f0671a666ea8a3e434c13e40faef527133b5d16703460e0527f45fc200c7e4544e457d3c5709bfe0d520442c30bbcbdaede89e8d4a4bbc19247610100527fd362cac9cb75c10d67bcc0b7eeb0b1ef48bb5420b556c092d4fd7f758816fcf0610120527f39605a6c26a173774ca666c67ef70cf491880e5d3d6d0ca66ec0a31034f15ea361014052613d0960e61b6101605234801561011a57600080fd5b5060805160a05160c05160e0516101005161012051610140516101605160e01c6128cc61018f60003980610c2f52508061141b52806119025250806113f25250806113c9528061180c5250806113a05280611dbf5250806113775280611ff252508061134e52508061132552506128cc6000f3fe608060405234801561001057600080fd5b50600436106101da5760003560e01c806399439fee11610104578063cd0ad4a2116100a2578063eff1d50e11610071578063eff1d50e146103f2578063f049b900146103fa578063f115c4271461040d578063f77c479114610415576101da565b8063cd0ad4a2146103af578063cd18119e146103c2578063d6866ea5146103d5578063eba0c8a1146103dd576101da565b80639f94c667116100de5780639f94c6671461035f578063a2594d8214610372578063a25e62c714610385578063b5217bb41461038d576101da565b806399439fee146103265780639b4d9f33146103395780639ce7abe51461034c576101da565b80634c4ea0ed1161017c5780637a2a45b81161014b5780637a2a45b8146102da57806381573288146102ed57806392eefe9b1461030057806393a90a1e14610313576101da565b80634c4ea0ed1461027f5780634c8c7a441461029f5780636536fe32146102b457806369db11a1146102c7576101da565b806326058249116101b857806326058249146102235780633718896d14610238578063375a54ab1461024b57806346e855da1461026c576101da565b80630faaf87f146101df578063185360f91461020857806324bdeec714610210575b600080fd5b6101f26101ed366004612175565b61041d565b6040516101ff91906122ab565b60405180910390f35b6101f26104da565b6101f261021e366004612196565b6104e0565b61022b610662565b6040516101ff9190612273565b6101f2610246366004612175565b610677565b61025e610259366004612196565b6108b6565b6040516101ff9291906127b8565b6101f261027a36600461215d565b610af7565b61029261028d36600461215d565b610b0c565b6040516101ff91906122a0565b6102b26102ad3660046120e4565b610b20565b005b6102b26102c236600461215d565b610cb0565b6101f26102d5366004612175565b610cc4565b6101f26102e8366004612175565b610d78565b6102b26102fb366004612175565b610d8b565b6102b261030e3660046120c8565b610e5e565b6102b26103213660046120c8565b610e6f565b6101f261033436600461215d565b610ecb565b6102b26103473660046120c8565b610f72565b6102b261035a3660046121c1565b610f83565b6101f261036d366004612132565b6110d9565b6102b26103803660046120c8565b61118d565b61022b6112a8565b6103a061039b36600461215d565b6112be565b6040516101ff939291906127dc565b6102b26103bd366004612259565b6112ef565b6102b26103d0366004612259565b61130f565b6102b2611320565b6103e5611441565b6040516101ff9190612801565b61022b611454565b61025e610408366004612175565b611463565b6103e56114c0565b61022b6114cc565b6000828152600f6020908152604080832081516060810183528154815260019091015463ffffffff811693820193909352600160201b9092046001600160a01b0316908201528161046d85610ecb565b82519091506104975760405162461bcd60e51b815260040161048e906125e8565b60405180910390fd5b838110156104b75760405162461bcd60e51b815260040161048e906124f3565b81516104cf9082906104c990876114db565b90611534565b925050505b92915050565b600d5481565b60006104ea61159b565b33836105085760405162461bcd60e51b815260040161048e906122b4565b8361051382876110d9565b10156105315760405162461bcd60e51b815260040161048e906124af565b600061053d868661041d565b90508381101561055f5760405162461bcd60e51b815260040161048e906123ff565b61056886611709565b6000868152600f60205260409020805461058290836117a8565b8155600181015460405163079cc67960e41b8152600160201b9091046001600160a01b0316906379cc6790906105be9086908a90600401612287565b600060405180830381600087803b1580156105d857600080fd5b505af11580156105ec573d6000803e3d6000fd5b505050506105f987610ecb565b61060257600081555b61061461060d611805565b8484611835565b86836001600160a01b03167fe14cd5e80f6821ded0538e85a537487acf10bb5e97a12176df56a099e90bfb3484896040516106509291906127b8565b60405180910390a35095945050505050565b6010546201000090046001600160a01b031681565b600061068161159b565b6106896118fb565b6001600160a01b0316336001600160a01b0316146106b95760405162461bcd60e51b815260040161048e90612781565b816106d65760405162461bcd60e51b815260040161048e906126c0565b60006106e28484611926565b6000858152600f6020526040902090915033906106fe86610b0c565b6107ca576001810154600160201b90046001600160a01b03166107ca57600c5460009061073a90600160401b90046001600160a01b03166119d9565b60405163189acdbd60e31b81529091506001600160a01b0382169063c4d66de890610769903090600401612273565b600060405180830381600087803b15801561078357600080fd5b505af1158015610797573d6000803e3d6000fd5b5050506001830180546001600160a01b03909316600160201b02640100000000600160c01b031990931692909217909155505b6107d386611709565b60006107dd611805565b90506107ea818488611a76565b81546107f69087611ad5565b825560018201546040516340c10f1960e01b8152600160201b9091046001600160a01b0316906340c10f19906108329086908890600401612287565b600060405180830381600087803b15801561084c57600080fd5b505af1158015610860573d6000803e3d6000fd5b5050505086836001600160a01b03167fb7bf5f4e5b23ef992df9875ecea572620d18dab0c1a5486a9b695d20d9ec50cf888760006040516108a3939291906127c6565b60405180910390a3509195945050505050565b6000806108c161159b565b836108de5760405162461bcd60e51b815260040161048e906126c0565b6000806108eb8787611463565b915091508482101561090f5760405162461bcd60e51b815260040161048e906123ff565b6000878152600f60205260409020339061092889610b0c565b6109f4576001810154600160201b90046001600160a01b03166109f457600c5460009061096490600160401b90046001600160a01b03166119d9565b60405163189acdbd60e31b81529091506001600160a01b0382169063c4d66de890610993903090600401612273565b600060405180830381600087803b1580156109ad57600080fd5b505af11580156109c1573d6000803e3d6000fd5b5050506001830180546001600160a01b03909316600160201b02640100000000600160c01b031990931692909217909155505b6109fd89611709565b6000610a07611805565b9050610a1481848b611a76565b610a1e8185611b2f565b610a33610a2b8a866117a8565b835490611ad5565b825560018201546040516340c10f1960e01b8152600160201b9091046001600160a01b0316906340c10f1990610a6f9086908990600401612287565b600060405180830381600087803b158015610a8957600080fd5b505af1158015610a9d573d6000803e3d6000fd5b5050505089836001600160a01b03167fb7bf5f4e5b23ef992df9875ecea572620d18dab0c1a5486a9b695d20d9ec50cf8b8888604051610adf939291906127c6565b60405180910390a35092989197509095505050505050565b6000818152600f60205260409020545b919050565b6000908152600f6020526040902054151590565b610b28611b7b565b6001600160a01b0316336001600160a01b031614610b83576040805162461bcd60e51b815260206004820152601360248201527227b7363c9034b6b83632b6b2b73a30ba34b7b760691b604482015290519081900360640190fd5b601054610100900460ff1680610b9c5750610b9c611ba0565b80610baa575060105460ff16155b610be55760405162461bcd60e51b815260040180806020018281038252602e815260200180612848602e913960400191505060405180910390fd5b601054610100900460ff16158015610c10576010805460ff1961ff0019909116610100171660011790555b610c1985610e66565b600c805467ffffffff000000001916600160201b7f000000000000000000000000000000000000000000000000000000000000000063ffffffff160217905560405160008051602061282883398151915290610c74906123d2565b60405180910390a1610c8583611bb1565b610c8e82611c16565b610c9784611c54565b8015610ca9576010805461ff00191690555b5050505050565b610cb8611ce4565b610cc181611c16565b50565b600081610ce35760405162461bcd60e51b815260040161048e90612322565b6000610cef8484611926565b6000858152600f6020908152604080832081516060810183528154815260019091015463ffffffff811693820193909352600160201b9092046001600160a01b031690820152919250610d4b83610d4588610ecb565b90611ad5565b8251909150600090610d5d9087611ad5565b9050610d6d826104c983876114db565b979650505050505050565b6000610d848383611926565b9392505050565b6010546201000090046001600160a01b0316331480610dc25750610dad611db8565b6001600160a01b0316336001600160a01b0316145b610dde5760405162461bcd60e51b815260040161048e9061255c565b610de782610b0c565b610e035760405162461bcd60e51b815260040161048e9061245c565b6000828152600f602052604090208054610e1d9083611ad5565b815560405183907ff17fdee613a92b35db6b7598eb43750b24d4072eb304e6eca80121e40402e34b90610e519085906122ab565b60405180910390a2505050565b610e66611de3565b610cc181611e42565b610e77611ce4565b6010805462010000600160b01b031916620100006001600160a01b038416908102919091179091556040517f81dcb738da3dabd5bb2adbc7dd107fbbfca936e9c8aecab25f5b17a710a784c790600090a250565b6000818152600f6020526040812060010154600160201b90046001600160a01b03168015610f6957806001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015610f2c57600080fd5b505afa158015610f40573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f649190612241565b610d84565b60009392505050565b610f7a611ce4565b610cc181611c54565b82806001600160a01b031663f851a4406040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610fbf57600080fd5b505af1158015610fd3573d6000803e3d6000fd5b505050506040513d6020811015610fe957600080fd5b50516001600160a01b03163314611047576040805162461bcd60e51b815260206004820152601e60248201527f43616c6c6572206d757374206265207468652070726f78792061646d696e0000604482015290519081900360640190fd5b60405163623faf6160e01b8152602060048201908152602482018490526001600160a01b0386169163623faf619186918691908190604401848480828437600081840152601f19601f8201169050808301925050509350505050600060405180830381600087803b1580156110bb57600080fd5b505af11580156110cf573d6000803e3d6000fd5b5050505050505050565b6000818152600f6020526040812060010154600160201b90046001600160a01b03168015611182576040516370a0823160e01b81526001600160a01b038216906370a082319061112d908790600401612273565b60206040518083038186803b15801561114557600080fd5b505afa158015611159573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061117d9190612241565b611185565b60005b949350505050565b80806001600160a01b031663f851a4406040518163ffffffff1660e01b8152600401602060405180830381600087803b1580156111c957600080fd5b505af11580156111dd573d6000803e3d6000fd5b505050506040513d60208110156111f357600080fd5b50516001600160a01b03163314611251576040805162461bcd60e51b815260206004820152601e60248201527f43616c6c6572206d757374206265207468652070726f78792061646d696e0000604482015290519081900360640190fd5b816001600160a01b03166359fc20bb6040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561128c57600080fd5b505af11580156112a0573d6000803e3d6000fd5b505050505050565b600c54600160401b90046001600160a01b031681565b600f602052600090815260409020805460019091015463ffffffff811690600160201b90046001600160a01b031683565b6112f7611ce4565b60405162461bcd60e51b815260040161048e906123a3565b611317611ce4565b610cc181611bb1565b6113497f0000000000000000000000000000000000000000000000000000000000000000611eea565b6113727f0000000000000000000000000000000000000000000000000000000000000000611eea565b61139b7f0000000000000000000000000000000000000000000000000000000000000000611eea565b6113c47f0000000000000000000000000000000000000000000000000000000000000000611eea565b6113ed7f0000000000000000000000000000000000000000000000000000000000000000611eea565b6114167f0000000000000000000000000000000000000000000000000000000000000000611eea565b61143f7f0000000000000000000000000000000000000000000000000000000000000000611eea565b565b600c54600160201b900463ffffffff1681565b600e546001600160a01b031681565b600c546000908190819061149790620f4240906104c990879061149190849063ffffffff908116906117a816565b906114db565b905060006114a585836117a8565b905060006114b38784611926565b9791965090945050505050565b600c5463ffffffff1681565b6000546001600160a01b031681565b6000826114ea575060006104d4565b828202828482816114f757fe5b0414610d845760405162461bcd60e51b81526004018080602001828103825260218152602001806128766021913960400191505060405180910390fd5b600080821161158a576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b81838161159357fe5b049392505050565b60008054906101000a90046001600160a01b03166001600160a01b0316635c975abb6040518163ffffffff1660e01b815260040160206040518083038186803b1580156115e757600080fd5b505afa1580156115fb573d6000803e3d6000fd5b505050506040513d602081101561161157600080fd5b50511561164e576040805162461bcd60e51b815260206004820152600660248201526514185d5cd95960d21b604482015290519081900360640190fd5b60008054906101000a90046001600160a01b03166001600160a01b0316632e292fc76040518163ffffffff1660e01b815260040160206040518083038186803b15801561169a57600080fd5b505afa1580156116ae573d6000803e3d6000fd5b505050506040513d60208110156116c457600080fd5b50511561143f576040805162461bcd60e51b815260206004820152600e60248201526d14185c9d1a585b0b5c185d5cd95960921b604482015290519081900360640190fd5b6000611713611feb565b90506001600160a01b038116156117a4576040516307470bfb60e21b81526001600160a01b03821690631d1c2fec906117509085906004016122ab565b602060405180830381600087803b15801561176a57600080fd5b505af115801561177e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117a29190612241565b505b5050565b6000828211156117ff576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b60006118307f0000000000000000000000000000000000000000000000000000000000000000612012565b905090565b80156117a257826001600160a01b031663a9059cbb83836040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561189257600080fd5b505af11580156118a6573d6000803e3d6000fd5b505050506040513d60208110156118bc57600080fd5b50516117a2576040805162461bcd60e51b815260206004820152600960248201526810ba3930b739b332b960b91b604482015290519081900360640190fd5b60006118307f0000000000000000000000000000000000000000000000000000000000000000612012565b6000828152600f602090815260408083208151606081018352815480825260019092015463ffffffff811694820194909452600160201b9093046001600160a01b0316918301919091526119c657600d548310156119965760405162461bcd60e51b815260040161048e90612359565b600d546119be906119b6906104c96119ae87836117a8565b6001906114db565b600190611ad5565b9150506104d4565b8051611185906104c98561149188610ecb565b6000604051733d602d80600a3d3981f3363d3d373d3d3d363d7360601b81528260601b60148201526e5af43d82803e903d91602b57fd5bf360881b60288201526037816000f09150506001600160a01b038116610b07576040805162461bcd60e51b8152602060048201526016602482015275115490cc4c4d8dce8818dc99585d194819985a5b195960521b604482015290519081900360640190fd5b80156117a257604080516323b872dd60e01b81526001600160a01b038481166004830152306024830152604482018490529151918516916323b872dd916064808201926020929091908290030181600087803b15801561189257600080fd5b600082820183811015610d84576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b80156117a457816001600160a01b03166342966c68826040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561128c57600080fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6000611bab306120ae565b15905090565b620f424063ffffffff82161115611bda5760405162461bcd60e51b815260040161048e906126f7565b600c805463ffffffff191663ffffffff831617905560405160008051602061282883398151915290611c0b906125b9565b60405180910390a150565b80611c335760405162461bcd60e51b815260040161048e90612645565b600d81905560405160008051602061282883398151915290611c0b9061242c565b6001600160a01b038116611c7a5760405162461bcd60e51b815260040161048e906122eb565b611c83816120ae565b611c9f5760405162461bcd60e51b815260040161048e90612689565b600c805468010000000000000000600160e01b031916600160401b6001600160a01b0384160217905560405160008051602061282883398151915290611c0b90612754565b60008054906101000a90046001600160a01b03166001600160a01b0316634fc07d756040518163ffffffff1660e01b815260040160206040518083038186803b158015611d3057600080fd5b505afa158015611d44573d6000803e3d6000fd5b505050506040513d6020811015611d5a57600080fd5b50516001600160a01b0316331461143f576040805162461bcd60e51b815260206004820152601860248201527f4f6e6c7920436f6e74726f6c6c657220676f7665726e6f720000000000000000604482015290519081900360640190fd5b60006118307f0000000000000000000000000000000000000000000000000000000000000000612012565b6000546001600160a01b0316331461143f576040805162461bcd60e51b815260206004820152601960248201527f43616c6c6572206d75737420626520436f6e74726f6c6c657200000000000000604482015290519081900360640190fd5b6001600160a01b038116611e96576040805162461bcd60e51b815260206004820152601660248201527510dbdb9d1c9bdb1b195c881b5d5cdd081899481cd95d60521b604482015290519081900360640190fd5b600080546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f4ff638452bbf33c012645d18ae6f05515ff5f2d1dfb0cece8cbf018c60903f709181900360200190a150565b6000805460408051637bb20d2f60e11b81526004810185905290516001600160a01b039092169163f7641a5e91602480820192602092909190829003018186803b158015611f3757600080fd5b505afa158015611f4b573d6000803e3d6000fd5b505050506040513d6020811015611f6157600080fd5b50516000838152600160205260409020549091506001600160a01b038083169116146117a45760008281526001602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251908152915184927fd0e7a942b1fc38c411c4f53d153ba14fd24542a6a35ebacd9b6afca1a154e20692908290030190a25050565b60006118307f00000000000000000000000000000000000000000000000000000000000000005b6000818152600160205260408120546001600160a01b0316806104d45760005460408051637bb20d2f60e11b81526004810186905290516001600160a01b039092169163f7641a5e91602480820192602092909190829003018186803b15801561207b57600080fd5b505afa15801561208f573d6000803e3d6000fd5b505050506040513d60208110156120a557600080fd5b50519392505050565b3b151590565b803563ffffffff81168114610b0757600080fd5b6000602082840312156120d9578081fd5b8135610d8481612812565b600080600080608085870312156120f9578283fd5b843561210481612812565b9350602085013561211481612812565b9250612122604086016120b4565b9396929550929360600135925050565b60008060408385031215612144578182fd5b823561214f81612812565b946020939093013593505050565b60006020828403121561216e578081fd5b5035919050565b60008060408385031215612187578182fd5b50508035926020909101359150565b6000806000606084860312156121aa578283fd5b505081359360208301359350604090920135919050565b6000806000604084860312156121d5578283fd5b83356121e081612812565b9250602084013567ffffffffffffffff808211156121fc578384fd5b818601915086601f83011261220f578384fd5b81358181111561221d578485fd5b87602082850101111561222e578485fd5b6020830194508093505050509250925092565b600060208284031215612252578081fd5b5051919050565b60006020828403121561226a578081fd5b610d84826120b4565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b901515815260200190565b90815260200190565b60208082526017908201527f43616e6e6f74206275726e207a65726f207369676e616c000000000000000000604082015260600190565b6020808252601e908201527f546f6b656e206d6173746572206d757374206265206e6f6e2d656d7074790000604082015260600190565b6020808252601d908201527f43616e27742063616c63756c6174652077697468203020746f6b656e73000000604082015260600190565b6020808252602a908201527f4375726174696f6e206465706f7369742069732062656c6f77206d696e696d756040820152691b481c995c5d5a5c995960b21b606082015260800190565b6020808252601590820152742737ba1034b6b83632b6b2b73a32b21034b710261960591b604082015260600190565b60208082526013908201527264656661756c7452657365727665526174696f60681b604082015260600190565b60208082526013908201527229b634b83830b3b290383937ba32b1ba34b7b760691b604082015260600190565b6020808252601690820152751b5a5b9a5b5d5b50dd5c985d1a5bdb91195c1bdcda5d60521b604082015260600190565b60208082526033908201527f5375626772617068206465706c6f796d656e74206d757374206265206375726160408201527274656420746f20636f6c6c656374206665657360681b606082015260800190565b60208082526024908201527f43616e6e6f74206275726e206d6f7265207369676e616c207468616e20796f756040820152631037bbb760e11b606082015260800190565b60208082526043908201527f5369676e616c206d7573742062652061626f7665206f7220657175616c20746f60408201527f207369676e616c2069737375656420696e20746865206375726174696f6e20706060820152621bdbdb60ea1b608082015260a00190565b60208082526037908201527f43616c6c6572206d75737420626520746865207375626772617068207365727660408201527f696365206f72207374616b696e6720636f6e7472616374000000000000000000606082015260800190565b6020808252601590820152746375726174696f6e54617850657263656e7461676560581b604082015260600190565b6020808252603b908201527f5375626772617068206465706c6f796d656e74206d757374206265206375726160408201527f74656420746f20706572666f726d2063616c63756c6174696f6e730000000000606082015260800190565b60208082526024908201527f4d696e696d756d206375726174696f6e206465706f7369742063616e6e6f74206040820152630626520360e41b606082015260800190565b6020808252601f908201527f546f6b656e206d6173746572206d757374206265206120636f6e747261637400604082015260600190565b6020808252601a908201527f43616e6e6f74206465706f736974207a65726f20746f6b656e73000000000000604082015260600190565b60208082526039908201527f4375726174696f6e207461782070657263656e74616765206d7573742062652060408201527f62656c6f77206f7220657175616c20746f204d41585f50504d00000000000000606082015260800190565b60208082526013908201527231bab930ba34b7b72a37b5b2b726b0b9ba32b960691b604082015260600190565b6020808252601a908201527f4f6e6c792074686520474e532063616e2063616c6c2074686973000000000000604082015260600190565b918252602082015260400190565b9283526020830191909152604082015260600190565b92835263ffffffff9190911660208301526001600160a01b0316604082015260600190565b63ffffffff91909116815260200190565b6001600160a01b0381168114610cc157600080fdfe96d5a4b4edf1cefd0900c166d64447f8da1d01d1861a6a60894b5b82a2c15c3c496e697469616c697a61626c653a20636f6e747261637420697320616c726561647920696e697469616c697a6564536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a2646970667358221220182d4780700d3d385918c6f4a2bbe50d522f035098d04683e959156c3033203064736f6c63430007060033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101da5760003560e01c806399439fee11610104578063cd0ad4a2116100a2578063eff1d50e11610071578063eff1d50e146103f2578063f049b900146103fa578063f115c4271461040d578063f77c479114610415576101da565b8063cd0ad4a2146103af578063cd18119e146103c2578063d6866ea5146103d5578063eba0c8a1146103dd576101da565b80639f94c667116100de5780639f94c6671461035f578063a2594d8214610372578063a25e62c714610385578063b5217bb41461038d576101da565b806399439fee146103265780639b4d9f33146103395780639ce7abe51461034c576101da565b80634c4ea0ed1161017c5780637a2a45b81161014b5780637a2a45b8146102da57806381573288146102ed57806392eefe9b1461030057806393a90a1e14610313576101da565b80634c4ea0ed1461027f5780634c8c7a441461029f5780636536fe32146102b457806369db11a1146102c7576101da565b806326058249116101b857806326058249146102235780633718896d14610238578063375a54ab1461024b57806346e855da1461026c576101da565b80630faaf87f146101df578063185360f91461020857806324bdeec714610210575b600080fd5b6101f26101ed366004612175565b61041d565b6040516101ff91906122ab565b60405180910390f35b6101f26104da565b6101f261021e366004612196565b6104e0565b61022b610662565b6040516101ff9190612273565b6101f2610246366004612175565b610677565b61025e610259366004612196565b6108b6565b6040516101ff9291906127b8565b6101f261027a36600461215d565b610af7565b61029261028d36600461215d565b610b0c565b6040516101ff91906122a0565b6102b26102ad3660046120e4565b610b20565b005b6102b26102c236600461215d565b610cb0565b6101f26102d5366004612175565b610cc4565b6101f26102e8366004612175565b610d78565b6102b26102fb366004612175565b610d8b565b6102b261030e3660046120c8565b610e5e565b6102b26103213660046120c8565b610e6f565b6101f261033436600461215d565b610ecb565b6102b26103473660046120c8565b610f72565b6102b261035a3660046121c1565b610f83565b6101f261036d366004612132565b6110d9565b6102b26103803660046120c8565b61118d565b61022b6112a8565b6103a061039b36600461215d565b6112be565b6040516101ff939291906127dc565b6102b26103bd366004612259565b6112ef565b6102b26103d0366004612259565b61130f565b6102b2611320565b6103e5611441565b6040516101ff9190612801565b61022b611454565b61025e610408366004612175565b611463565b6103e56114c0565b61022b6114cc565b6000828152600f6020908152604080832081516060810183528154815260019091015463ffffffff811693820193909352600160201b9092046001600160a01b0316908201528161046d85610ecb565b82519091506104975760405162461bcd60e51b815260040161048e906125e8565b60405180910390fd5b838110156104b75760405162461bcd60e51b815260040161048e906124f3565b81516104cf9082906104c990876114db565b90611534565b925050505b92915050565b600d5481565b60006104ea61159b565b33836105085760405162461bcd60e51b815260040161048e906122b4565b8361051382876110d9565b10156105315760405162461bcd60e51b815260040161048e906124af565b600061053d868661041d565b90508381101561055f5760405162461bcd60e51b815260040161048e906123ff565b61056886611709565b6000868152600f60205260409020805461058290836117a8565b8155600181015460405163079cc67960e41b8152600160201b9091046001600160a01b0316906379cc6790906105be9086908a90600401612287565b600060405180830381600087803b1580156105d857600080fd5b505af11580156105ec573d6000803e3d6000fd5b505050506105f987610ecb565b61060257600081555b61061461060d611805565b8484611835565b86836001600160a01b03167fe14cd5e80f6821ded0538e85a537487acf10bb5e97a12176df56a099e90bfb3484896040516106509291906127b8565b60405180910390a35095945050505050565b6010546201000090046001600160a01b031681565b600061068161159b565b6106896118fb565b6001600160a01b0316336001600160a01b0316146106b95760405162461bcd60e51b815260040161048e90612781565b816106d65760405162461bcd60e51b815260040161048e906126c0565b60006106e28484611926565b6000858152600f6020526040902090915033906106fe86610b0c565b6107ca576001810154600160201b90046001600160a01b03166107ca57600c5460009061073a90600160401b90046001600160a01b03166119d9565b60405163189acdbd60e31b81529091506001600160a01b0382169063c4d66de890610769903090600401612273565b600060405180830381600087803b15801561078357600080fd5b505af1158015610797573d6000803e3d6000fd5b5050506001830180546001600160a01b03909316600160201b02640100000000600160c01b031990931692909217909155505b6107d386611709565b60006107dd611805565b90506107ea818488611a76565b81546107f69087611ad5565b825560018201546040516340c10f1960e01b8152600160201b9091046001600160a01b0316906340c10f19906108329086908890600401612287565b600060405180830381600087803b15801561084c57600080fd5b505af1158015610860573d6000803e3d6000fd5b5050505086836001600160a01b03167fb7bf5f4e5b23ef992df9875ecea572620d18dab0c1a5486a9b695d20d9ec50cf888760006040516108a3939291906127c6565b60405180910390a3509195945050505050565b6000806108c161159b565b836108de5760405162461bcd60e51b815260040161048e906126c0565b6000806108eb8787611463565b915091508482101561090f5760405162461bcd60e51b815260040161048e906123ff565b6000878152600f60205260409020339061092889610b0c565b6109f4576001810154600160201b90046001600160a01b03166109f457600c5460009061096490600160401b90046001600160a01b03166119d9565b60405163189acdbd60e31b81529091506001600160a01b0382169063c4d66de890610993903090600401612273565b600060405180830381600087803b1580156109ad57600080fd5b505af11580156109c1573d6000803e3d6000fd5b5050506001830180546001600160a01b03909316600160201b02640100000000600160c01b031990931692909217909155505b6109fd89611709565b6000610a07611805565b9050610a1481848b611a76565b610a1e8185611b2f565b610a33610a2b8a866117a8565b835490611ad5565b825560018201546040516340c10f1960e01b8152600160201b9091046001600160a01b0316906340c10f1990610a6f9086908990600401612287565b600060405180830381600087803b158015610a8957600080fd5b505af1158015610a9d573d6000803e3d6000fd5b5050505089836001600160a01b03167fb7bf5f4e5b23ef992df9875ecea572620d18dab0c1a5486a9b695d20d9ec50cf8b8888604051610adf939291906127c6565b60405180910390a35092989197509095505050505050565b6000818152600f60205260409020545b919050565b6000908152600f6020526040902054151590565b610b28611b7b565b6001600160a01b0316336001600160a01b031614610b83576040805162461bcd60e51b815260206004820152601360248201527227b7363c9034b6b83632b6b2b73a30ba34b7b760691b604482015290519081900360640190fd5b601054610100900460ff1680610b9c5750610b9c611ba0565b80610baa575060105460ff16155b610be55760405162461bcd60e51b815260040180806020018281038252602e815260200180612848602e913960400191505060405180910390fd5b601054610100900460ff16158015610c10576010805460ff1961ff0019909116610100171660011790555b610c1985610e66565b600c805467ffffffff000000001916600160201b7f000000000000000000000000000000000000000000000000000000000000000063ffffffff160217905560405160008051602061282883398151915290610c74906123d2565b60405180910390a1610c8583611bb1565b610c8e82611c16565b610c9784611c54565b8015610ca9576010805461ff00191690555b5050505050565b610cb8611ce4565b610cc181611c16565b50565b600081610ce35760405162461bcd60e51b815260040161048e90612322565b6000610cef8484611926565b6000858152600f6020908152604080832081516060810183528154815260019091015463ffffffff811693820193909352600160201b9092046001600160a01b031690820152919250610d4b83610d4588610ecb565b90611ad5565b8251909150600090610d5d9087611ad5565b9050610d6d826104c983876114db565b979650505050505050565b6000610d848383611926565b9392505050565b6010546201000090046001600160a01b0316331480610dc25750610dad611db8565b6001600160a01b0316336001600160a01b0316145b610dde5760405162461bcd60e51b815260040161048e9061255c565b610de782610b0c565b610e035760405162461bcd60e51b815260040161048e9061245c565b6000828152600f602052604090208054610e1d9083611ad5565b815560405183907ff17fdee613a92b35db6b7598eb43750b24d4072eb304e6eca80121e40402e34b90610e519085906122ab565b60405180910390a2505050565b610e66611de3565b610cc181611e42565b610e77611ce4565b6010805462010000600160b01b031916620100006001600160a01b038416908102919091179091556040517f81dcb738da3dabd5bb2adbc7dd107fbbfca936e9c8aecab25f5b17a710a784c790600090a250565b6000818152600f6020526040812060010154600160201b90046001600160a01b03168015610f6957806001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015610f2c57600080fd5b505afa158015610f40573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f649190612241565b610d84565b60009392505050565b610f7a611ce4565b610cc181611c54565b82806001600160a01b031663f851a4406040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610fbf57600080fd5b505af1158015610fd3573d6000803e3d6000fd5b505050506040513d6020811015610fe957600080fd5b50516001600160a01b03163314611047576040805162461bcd60e51b815260206004820152601e60248201527f43616c6c6572206d757374206265207468652070726f78792061646d696e0000604482015290519081900360640190fd5b60405163623faf6160e01b8152602060048201908152602482018490526001600160a01b0386169163623faf619186918691908190604401848480828437600081840152601f19601f8201169050808301925050509350505050600060405180830381600087803b1580156110bb57600080fd5b505af11580156110cf573d6000803e3d6000fd5b5050505050505050565b6000818152600f6020526040812060010154600160201b90046001600160a01b03168015611182576040516370a0823160e01b81526001600160a01b038216906370a082319061112d908790600401612273565b60206040518083038186803b15801561114557600080fd5b505afa158015611159573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061117d9190612241565b611185565b60005b949350505050565b80806001600160a01b031663f851a4406040518163ffffffff1660e01b8152600401602060405180830381600087803b1580156111c957600080fd5b505af11580156111dd573d6000803e3d6000fd5b505050506040513d60208110156111f357600080fd5b50516001600160a01b03163314611251576040805162461bcd60e51b815260206004820152601e60248201527f43616c6c6572206d757374206265207468652070726f78792061646d696e0000604482015290519081900360640190fd5b816001600160a01b03166359fc20bb6040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561128c57600080fd5b505af11580156112a0573d6000803e3d6000fd5b505050505050565b600c54600160401b90046001600160a01b031681565b600f602052600090815260409020805460019091015463ffffffff811690600160201b90046001600160a01b031683565b6112f7611ce4565b60405162461bcd60e51b815260040161048e906123a3565b611317611ce4565b610cc181611bb1565b6113497f0000000000000000000000000000000000000000000000000000000000000000611eea565b6113727f0000000000000000000000000000000000000000000000000000000000000000611eea565b61139b7f0000000000000000000000000000000000000000000000000000000000000000611eea565b6113c47f0000000000000000000000000000000000000000000000000000000000000000611eea565b6113ed7f0000000000000000000000000000000000000000000000000000000000000000611eea565b6114167f0000000000000000000000000000000000000000000000000000000000000000611eea565b61143f7f0000000000000000000000000000000000000000000000000000000000000000611eea565b565b600c54600160201b900463ffffffff1681565b600e546001600160a01b031681565b600c546000908190819061149790620f4240906104c990879061149190849063ffffffff908116906117a816565b906114db565b905060006114a585836117a8565b905060006114b38784611926565b9791965090945050505050565b600c5463ffffffff1681565b6000546001600160a01b031681565b6000826114ea575060006104d4565b828202828482816114f757fe5b0414610d845760405162461bcd60e51b81526004018080602001828103825260218152602001806128766021913960400191505060405180910390fd5b600080821161158a576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b81838161159357fe5b049392505050565b60008054906101000a90046001600160a01b03166001600160a01b0316635c975abb6040518163ffffffff1660e01b815260040160206040518083038186803b1580156115e757600080fd5b505afa1580156115fb573d6000803e3d6000fd5b505050506040513d602081101561161157600080fd5b50511561164e576040805162461bcd60e51b815260206004820152600660248201526514185d5cd95960d21b604482015290519081900360640190fd5b60008054906101000a90046001600160a01b03166001600160a01b0316632e292fc76040518163ffffffff1660e01b815260040160206040518083038186803b15801561169a57600080fd5b505afa1580156116ae573d6000803e3d6000fd5b505050506040513d60208110156116c457600080fd5b50511561143f576040805162461bcd60e51b815260206004820152600e60248201526d14185c9d1a585b0b5c185d5cd95960921b604482015290519081900360640190fd5b6000611713611feb565b90506001600160a01b038116156117a4576040516307470bfb60e21b81526001600160a01b03821690631d1c2fec906117509085906004016122ab565b602060405180830381600087803b15801561176a57600080fd5b505af115801561177e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117a29190612241565b505b5050565b6000828211156117ff576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b60006118307f0000000000000000000000000000000000000000000000000000000000000000612012565b905090565b80156117a257826001600160a01b031663a9059cbb83836040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561189257600080fd5b505af11580156118a6573d6000803e3d6000fd5b505050506040513d60208110156118bc57600080fd5b50516117a2576040805162461bcd60e51b815260206004820152600960248201526810ba3930b739b332b960b91b604482015290519081900360640190fd5b60006118307f0000000000000000000000000000000000000000000000000000000000000000612012565b6000828152600f602090815260408083208151606081018352815480825260019092015463ffffffff811694820194909452600160201b9093046001600160a01b0316918301919091526119c657600d548310156119965760405162461bcd60e51b815260040161048e90612359565b600d546119be906119b6906104c96119ae87836117a8565b6001906114db565b600190611ad5565b9150506104d4565b8051611185906104c98561149188610ecb565b6000604051733d602d80600a3d3981f3363d3d373d3d3d363d7360601b81528260601b60148201526e5af43d82803e903d91602b57fd5bf360881b60288201526037816000f09150506001600160a01b038116610b07576040805162461bcd60e51b8152602060048201526016602482015275115490cc4c4d8dce8818dc99585d194819985a5b195960521b604482015290519081900360640190fd5b80156117a257604080516323b872dd60e01b81526001600160a01b038481166004830152306024830152604482018490529151918516916323b872dd916064808201926020929091908290030181600087803b15801561189257600080fd5b600082820183811015610d84576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b80156117a457816001600160a01b03166342966c68826040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561128c57600080fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6000611bab306120ae565b15905090565b620f424063ffffffff82161115611bda5760405162461bcd60e51b815260040161048e906126f7565b600c805463ffffffff191663ffffffff831617905560405160008051602061282883398151915290611c0b906125b9565b60405180910390a150565b80611c335760405162461bcd60e51b815260040161048e90612645565b600d81905560405160008051602061282883398151915290611c0b9061242c565b6001600160a01b038116611c7a5760405162461bcd60e51b815260040161048e906122eb565b611c83816120ae565b611c9f5760405162461bcd60e51b815260040161048e90612689565b600c805468010000000000000000600160e01b031916600160401b6001600160a01b0384160217905560405160008051602061282883398151915290611c0b90612754565b60008054906101000a90046001600160a01b03166001600160a01b0316634fc07d756040518163ffffffff1660e01b815260040160206040518083038186803b158015611d3057600080fd5b505afa158015611d44573d6000803e3d6000fd5b505050506040513d6020811015611d5a57600080fd5b50516001600160a01b0316331461143f576040805162461bcd60e51b815260206004820152601860248201527f4f6e6c7920436f6e74726f6c6c657220676f7665726e6f720000000000000000604482015290519081900360640190fd5b60006118307f0000000000000000000000000000000000000000000000000000000000000000612012565b6000546001600160a01b0316331461143f576040805162461bcd60e51b815260206004820152601960248201527f43616c6c6572206d75737420626520436f6e74726f6c6c657200000000000000604482015290519081900360640190fd5b6001600160a01b038116611e96576040805162461bcd60e51b815260206004820152601660248201527510dbdb9d1c9bdb1b195c881b5d5cdd081899481cd95d60521b604482015290519081900360640190fd5b600080546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f4ff638452bbf33c012645d18ae6f05515ff5f2d1dfb0cece8cbf018c60903f709181900360200190a150565b6000805460408051637bb20d2f60e11b81526004810185905290516001600160a01b039092169163f7641a5e91602480820192602092909190829003018186803b158015611f3757600080fd5b505afa158015611f4b573d6000803e3d6000fd5b505050506040513d6020811015611f6157600080fd5b50516000838152600160205260409020549091506001600160a01b038083169116146117a45760008281526001602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251908152915184927fd0e7a942b1fc38c411c4f53d153ba14fd24542a6a35ebacd9b6afca1a154e20692908290030190a25050565b60006118307f00000000000000000000000000000000000000000000000000000000000000005b6000818152600160205260408120546001600160a01b0316806104d45760005460408051637bb20d2f60e11b81526004810186905290516001600160a01b039092169163f7641a5e91602480820192602092909190829003018186803b15801561207b57600080fd5b505afa15801561208f573d6000803e3d6000fd5b505050506040513d60208110156120a557600080fd5b50519392505050565b3b151590565b803563ffffffff81168114610b0757600080fd5b6000602082840312156120d9578081fd5b8135610d8481612812565b600080600080608085870312156120f9578283fd5b843561210481612812565b9350602085013561211481612812565b9250612122604086016120b4565b9396929550929360600135925050565b60008060408385031215612144578182fd5b823561214f81612812565b946020939093013593505050565b60006020828403121561216e578081fd5b5035919050565b60008060408385031215612187578182fd5b50508035926020909101359150565b6000806000606084860312156121aa578283fd5b505081359360208301359350604090920135919050565b6000806000604084860312156121d5578283fd5b83356121e081612812565b9250602084013567ffffffffffffffff808211156121fc578384fd5b818601915086601f83011261220f578384fd5b81358181111561221d578485fd5b87602082850101111561222e578485fd5b6020830194508093505050509250925092565b600060208284031215612252578081fd5b5051919050565b60006020828403121561226a578081fd5b610d84826120b4565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b901515815260200190565b90815260200190565b60208082526017908201527f43616e6e6f74206275726e207a65726f207369676e616c000000000000000000604082015260600190565b6020808252601e908201527f546f6b656e206d6173746572206d757374206265206e6f6e2d656d7074790000604082015260600190565b6020808252601d908201527f43616e27742063616c63756c6174652077697468203020746f6b656e73000000604082015260600190565b6020808252602a908201527f4375726174696f6e206465706f7369742069732062656c6f77206d696e696d756040820152691b481c995c5d5a5c995960b21b606082015260800190565b6020808252601590820152742737ba1034b6b83632b6b2b73a32b21034b710261960591b604082015260600190565b60208082526013908201527264656661756c7452657365727665526174696f60681b604082015260600190565b60208082526013908201527229b634b83830b3b290383937ba32b1ba34b7b760691b604082015260600190565b6020808252601690820152751b5a5b9a5b5d5b50dd5c985d1a5bdb91195c1bdcda5d60521b604082015260600190565b60208082526033908201527f5375626772617068206465706c6f796d656e74206d757374206265206375726160408201527274656420746f20636f6c6c656374206665657360681b606082015260800190565b60208082526024908201527f43616e6e6f74206275726e206d6f7265207369676e616c207468616e20796f756040820152631037bbb760e11b606082015260800190565b60208082526043908201527f5369676e616c206d7573742062652061626f7665206f7220657175616c20746f60408201527f207369676e616c2069737375656420696e20746865206375726174696f6e20706060820152621bdbdb60ea1b608082015260a00190565b60208082526037908201527f43616c6c6572206d75737420626520746865207375626772617068207365727660408201527f696365206f72207374616b696e6720636f6e7472616374000000000000000000606082015260800190565b6020808252601590820152746375726174696f6e54617850657263656e7461676560581b604082015260600190565b6020808252603b908201527f5375626772617068206465706c6f796d656e74206d757374206265206375726160408201527f74656420746f20706572666f726d2063616c63756c6174696f6e730000000000606082015260800190565b60208082526024908201527f4d696e696d756d206375726174696f6e206465706f7369742063616e6e6f74206040820152630626520360e41b606082015260800190565b6020808252601f908201527f546f6b656e206d6173746572206d757374206265206120636f6e747261637400604082015260600190565b6020808252601a908201527f43616e6e6f74206465706f736974207a65726f20746f6b656e73000000000000604082015260600190565b60208082526039908201527f4375726174696f6e207461782070657263656e74616765206d7573742062652060408201527f62656c6f77206f7220657175616c20746f204d41585f50504d00000000000000606082015260800190565b60208082526013908201527231bab930ba34b7b72a37b5b2b726b0b9ba32b960691b604082015260600190565b6020808252601a908201527f4f6e6c792074686520474e532063616e2063616c6c2074686973000000000000604082015260600190565b918252602082015260400190565b9283526020830191909152604082015260600190565b92835263ffffffff9190911660208301526001600160a01b0316604082015260600190565b63ffffffff91909116815260200190565b6001600160a01b0381168114610cc157600080fdfe96d5a4b4edf1cefd0900c166d64447f8da1d01d1861a6a60894b5b82a2c15c3c496e697469616c697a61626c653a20636f6e747261637420697320616c726561647920696e697469616c697a6564536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a2646970667358221220182d4780700d3d385918c6f4a2bbe50d522f035098d04683e959156c3033203064736f6c63430007060033", + "linkReferences": {}, + "deployedLinkReferences": {} +} \ No newline at end of file diff --git a/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/L2Curation#L2CurationImplementationAddressBook.json b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/L2Curation#L2CurationImplementationAddressBook.json new file mode 100644 index 000000000..0d8c75203 --- /dev/null +++ b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/L2Curation#L2CurationImplementationAddressBook.json @@ -0,0 +1,707 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "L2Curation", + "sourceName": "contracts/l2/curation/L2Curation.sol", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "curator", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "subgraphDeploymentID", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "signal", + "type": "uint256" + } + ], + "name": "Burned", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "subgraphDeploymentID", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "Collected", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "nameHash", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "contractAddress", + "type": "address" + } + ], + "name": "ContractSynced", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "param", + "type": "string" + } + ], + "name": "ParameterUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "controller", + "type": "address" + } + ], + "name": "SetController", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "curator", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "subgraphDeploymentID", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "signal", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "curationTax", + "type": "uint256" + } + ], + "name": "Signalled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newSubgraphService", + "type": "address" + } + ], + "name": "SubgraphServiceSet", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "contract IGraphProxy", + "name": "_proxy", + "type": "address" + } + ], + "name": "acceptProxy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IGraphProxy", + "name": "_proxy", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "acceptProxyAndCall", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "bondingCurve", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_signalIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_tokensOutMin", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_tokens", + "type": "uint256" + } + ], + "name": "collect", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "controller", + "outputs": [ + { + "internalType": "contract IController", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "curationTaxPercentage", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "curationTokenMaster", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "defaultReserveRatio", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + } + ], + "name": "getCurationPoolSignal", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + } + ], + "name": "getCurationPoolTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_curator", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + } + ], + "name": "getCuratorSignal", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_controller", + "type": "address" + }, + { + "internalType": "address", + "name": "_curationTokenMaster", + "type": "address" + }, + { + "internalType": "uint32", + "name": "_curationTaxPercentage", + "type": "uint32" + }, + { + "internalType": "uint256", + "name": "_minimumCurationDeposit", + "type": "uint256" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + } + ], + "name": "isCurated", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "minimumCurationDeposit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_tokensIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_signalOutMin", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_tokensIn", + "type": "uint256" + } + ], + "name": "mintTaxFree", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "pools", + "outputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "reserveRatio", + "type": "uint32" + }, + { + "internalType": "contract IGraphCurationToken", + "name": "gcs", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_controller", + "type": "address" + } + ], + "name": "setController", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "_percentage", + "type": "uint32" + } + ], + "name": "setCurationTaxPercentage", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_curationTokenMaster", + "type": "address" + } + ], + "name": "setCurationTokenMaster", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "name": "setDefaultReserveRatio", + "outputs": [], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_minimumCurationDeposit", + "type": "uint256" + } + ], + "name": "setMinimumCurationDeposit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_subgraphService", + "type": "address" + } + ], + "name": "setSubgraphService", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_signalIn", + "type": "uint256" + } + ], + "name": "signalToTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "subgraphService", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "syncAllContracts", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_tokensIn", + "type": "uint256" + } + ], + "name": "tokensToSignal", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_tokensIn", + "type": "uint256" + } + ], + "name": "tokensToSignalNoTax", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_tokensIn", + "type": "uint256" + } + ], + "name": "tokensToSignalToTokensNoTax", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "bytecode": "0x6101806040527fe6876326c1291dfcbbd3864a6816d698cd591defc7aa2153d7f9c4c04016c89f6080527fc713c3df6d14cdf946460395d09af88993ee2b948b1a808161494e32c5f6706360a0527f966f1e8d8d8014e05f6ec4a57138da9be1f7c5a7f802928a18072f7c5318076160c0527f1df41cd916959d1163dc8f0671a666ea8a3e434c13e40faef527133b5d16703460e0527f45fc200c7e4544e457d3c5709bfe0d520442c30bbcbdaede89e8d4a4bbc19247610100527fd362cac9cb75c10d67bcc0b7eeb0b1ef48bb5420b556c092d4fd7f758816fcf0610120527f39605a6c26a173774ca666c67ef70cf491880e5d3d6d0ca66ec0a31034f15ea361014052613d0960e61b6101605234801561011a57600080fd5b5060805160a05160c05160e0516101005161012051610140516101605160e01c6128cc61018f60003980610c2f52508061141b52806119025250806113f25250806113c9528061180c5250806113a05280611dbf5250806113775280611ff252508061134e52508061132552506128cc6000f3fe608060405234801561001057600080fd5b50600436106101da5760003560e01c806399439fee11610104578063cd0ad4a2116100a2578063eff1d50e11610071578063eff1d50e146103f2578063f049b900146103fa578063f115c4271461040d578063f77c479114610415576101da565b8063cd0ad4a2146103af578063cd18119e146103c2578063d6866ea5146103d5578063eba0c8a1146103dd576101da565b80639f94c667116100de5780639f94c6671461035f578063a2594d8214610372578063a25e62c714610385578063b5217bb41461038d576101da565b806399439fee146103265780639b4d9f33146103395780639ce7abe51461034c576101da565b80634c4ea0ed1161017c5780637a2a45b81161014b5780637a2a45b8146102da57806381573288146102ed57806392eefe9b1461030057806393a90a1e14610313576101da565b80634c4ea0ed1461027f5780634c8c7a441461029f5780636536fe32146102b457806369db11a1146102c7576101da565b806326058249116101b857806326058249146102235780633718896d14610238578063375a54ab1461024b57806346e855da1461026c576101da565b80630faaf87f146101df578063185360f91461020857806324bdeec714610210575b600080fd5b6101f26101ed366004612175565b61041d565b6040516101ff91906122ab565b60405180910390f35b6101f26104da565b6101f261021e366004612196565b6104e0565b61022b610662565b6040516101ff9190612273565b6101f2610246366004612175565b610677565b61025e610259366004612196565b6108b6565b6040516101ff9291906127b8565b6101f261027a36600461215d565b610af7565b61029261028d36600461215d565b610b0c565b6040516101ff91906122a0565b6102b26102ad3660046120e4565b610b20565b005b6102b26102c236600461215d565b610cb0565b6101f26102d5366004612175565b610cc4565b6101f26102e8366004612175565b610d78565b6102b26102fb366004612175565b610d8b565b6102b261030e3660046120c8565b610e5e565b6102b26103213660046120c8565b610e6f565b6101f261033436600461215d565b610ecb565b6102b26103473660046120c8565b610f72565b6102b261035a3660046121c1565b610f83565b6101f261036d366004612132565b6110d9565b6102b26103803660046120c8565b61118d565b61022b6112a8565b6103a061039b36600461215d565b6112be565b6040516101ff939291906127dc565b6102b26103bd366004612259565b6112ef565b6102b26103d0366004612259565b61130f565b6102b2611320565b6103e5611441565b6040516101ff9190612801565b61022b611454565b61025e610408366004612175565b611463565b6103e56114c0565b61022b6114cc565b6000828152600f6020908152604080832081516060810183528154815260019091015463ffffffff811693820193909352600160201b9092046001600160a01b0316908201528161046d85610ecb565b82519091506104975760405162461bcd60e51b815260040161048e906125e8565b60405180910390fd5b838110156104b75760405162461bcd60e51b815260040161048e906124f3565b81516104cf9082906104c990876114db565b90611534565b925050505b92915050565b600d5481565b60006104ea61159b565b33836105085760405162461bcd60e51b815260040161048e906122b4565b8361051382876110d9565b10156105315760405162461bcd60e51b815260040161048e906124af565b600061053d868661041d565b90508381101561055f5760405162461bcd60e51b815260040161048e906123ff565b61056886611709565b6000868152600f60205260409020805461058290836117a8565b8155600181015460405163079cc67960e41b8152600160201b9091046001600160a01b0316906379cc6790906105be9086908a90600401612287565b600060405180830381600087803b1580156105d857600080fd5b505af11580156105ec573d6000803e3d6000fd5b505050506105f987610ecb565b61060257600081555b61061461060d611805565b8484611835565b86836001600160a01b03167fe14cd5e80f6821ded0538e85a537487acf10bb5e97a12176df56a099e90bfb3484896040516106509291906127b8565b60405180910390a35095945050505050565b6010546201000090046001600160a01b031681565b600061068161159b565b6106896118fb565b6001600160a01b0316336001600160a01b0316146106b95760405162461bcd60e51b815260040161048e90612781565b816106d65760405162461bcd60e51b815260040161048e906126c0565b60006106e28484611926565b6000858152600f6020526040902090915033906106fe86610b0c565b6107ca576001810154600160201b90046001600160a01b03166107ca57600c5460009061073a90600160401b90046001600160a01b03166119d9565b60405163189acdbd60e31b81529091506001600160a01b0382169063c4d66de890610769903090600401612273565b600060405180830381600087803b15801561078357600080fd5b505af1158015610797573d6000803e3d6000fd5b5050506001830180546001600160a01b03909316600160201b02640100000000600160c01b031990931692909217909155505b6107d386611709565b60006107dd611805565b90506107ea818488611a76565b81546107f69087611ad5565b825560018201546040516340c10f1960e01b8152600160201b9091046001600160a01b0316906340c10f19906108329086908890600401612287565b600060405180830381600087803b15801561084c57600080fd5b505af1158015610860573d6000803e3d6000fd5b5050505086836001600160a01b03167fb7bf5f4e5b23ef992df9875ecea572620d18dab0c1a5486a9b695d20d9ec50cf888760006040516108a3939291906127c6565b60405180910390a3509195945050505050565b6000806108c161159b565b836108de5760405162461bcd60e51b815260040161048e906126c0565b6000806108eb8787611463565b915091508482101561090f5760405162461bcd60e51b815260040161048e906123ff565b6000878152600f60205260409020339061092889610b0c565b6109f4576001810154600160201b90046001600160a01b03166109f457600c5460009061096490600160401b90046001600160a01b03166119d9565b60405163189acdbd60e31b81529091506001600160a01b0382169063c4d66de890610993903090600401612273565b600060405180830381600087803b1580156109ad57600080fd5b505af11580156109c1573d6000803e3d6000fd5b5050506001830180546001600160a01b03909316600160201b02640100000000600160c01b031990931692909217909155505b6109fd89611709565b6000610a07611805565b9050610a1481848b611a76565b610a1e8185611b2f565b610a33610a2b8a866117a8565b835490611ad5565b825560018201546040516340c10f1960e01b8152600160201b9091046001600160a01b0316906340c10f1990610a6f9086908990600401612287565b600060405180830381600087803b158015610a8957600080fd5b505af1158015610a9d573d6000803e3d6000fd5b5050505089836001600160a01b03167fb7bf5f4e5b23ef992df9875ecea572620d18dab0c1a5486a9b695d20d9ec50cf8b8888604051610adf939291906127c6565b60405180910390a35092989197509095505050505050565b6000818152600f60205260409020545b919050565b6000908152600f6020526040902054151590565b610b28611b7b565b6001600160a01b0316336001600160a01b031614610b83576040805162461bcd60e51b815260206004820152601360248201527227b7363c9034b6b83632b6b2b73a30ba34b7b760691b604482015290519081900360640190fd5b601054610100900460ff1680610b9c5750610b9c611ba0565b80610baa575060105460ff16155b610be55760405162461bcd60e51b815260040180806020018281038252602e815260200180612848602e913960400191505060405180910390fd5b601054610100900460ff16158015610c10576010805460ff1961ff0019909116610100171660011790555b610c1985610e66565b600c805467ffffffff000000001916600160201b7f000000000000000000000000000000000000000000000000000000000000000063ffffffff160217905560405160008051602061282883398151915290610c74906123d2565b60405180910390a1610c8583611bb1565b610c8e82611c16565b610c9784611c54565b8015610ca9576010805461ff00191690555b5050505050565b610cb8611ce4565b610cc181611c16565b50565b600081610ce35760405162461bcd60e51b815260040161048e90612322565b6000610cef8484611926565b6000858152600f6020908152604080832081516060810183528154815260019091015463ffffffff811693820193909352600160201b9092046001600160a01b031690820152919250610d4b83610d4588610ecb565b90611ad5565b8251909150600090610d5d9087611ad5565b9050610d6d826104c983876114db565b979650505050505050565b6000610d848383611926565b9392505050565b6010546201000090046001600160a01b0316331480610dc25750610dad611db8565b6001600160a01b0316336001600160a01b0316145b610dde5760405162461bcd60e51b815260040161048e9061255c565b610de782610b0c565b610e035760405162461bcd60e51b815260040161048e9061245c565b6000828152600f602052604090208054610e1d9083611ad5565b815560405183907ff17fdee613a92b35db6b7598eb43750b24d4072eb304e6eca80121e40402e34b90610e519085906122ab565b60405180910390a2505050565b610e66611de3565b610cc181611e42565b610e77611ce4565b6010805462010000600160b01b031916620100006001600160a01b038416908102919091179091556040517f81dcb738da3dabd5bb2adbc7dd107fbbfca936e9c8aecab25f5b17a710a784c790600090a250565b6000818152600f6020526040812060010154600160201b90046001600160a01b03168015610f6957806001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015610f2c57600080fd5b505afa158015610f40573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f649190612241565b610d84565b60009392505050565b610f7a611ce4565b610cc181611c54565b82806001600160a01b031663f851a4406040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610fbf57600080fd5b505af1158015610fd3573d6000803e3d6000fd5b505050506040513d6020811015610fe957600080fd5b50516001600160a01b03163314611047576040805162461bcd60e51b815260206004820152601e60248201527f43616c6c6572206d757374206265207468652070726f78792061646d696e0000604482015290519081900360640190fd5b60405163623faf6160e01b8152602060048201908152602482018490526001600160a01b0386169163623faf619186918691908190604401848480828437600081840152601f19601f8201169050808301925050509350505050600060405180830381600087803b1580156110bb57600080fd5b505af11580156110cf573d6000803e3d6000fd5b5050505050505050565b6000818152600f6020526040812060010154600160201b90046001600160a01b03168015611182576040516370a0823160e01b81526001600160a01b038216906370a082319061112d908790600401612273565b60206040518083038186803b15801561114557600080fd5b505afa158015611159573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061117d9190612241565b611185565b60005b949350505050565b80806001600160a01b031663f851a4406040518163ffffffff1660e01b8152600401602060405180830381600087803b1580156111c957600080fd5b505af11580156111dd573d6000803e3d6000fd5b505050506040513d60208110156111f357600080fd5b50516001600160a01b03163314611251576040805162461bcd60e51b815260206004820152601e60248201527f43616c6c6572206d757374206265207468652070726f78792061646d696e0000604482015290519081900360640190fd5b816001600160a01b03166359fc20bb6040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561128c57600080fd5b505af11580156112a0573d6000803e3d6000fd5b505050505050565b600c54600160401b90046001600160a01b031681565b600f602052600090815260409020805460019091015463ffffffff811690600160201b90046001600160a01b031683565b6112f7611ce4565b60405162461bcd60e51b815260040161048e906123a3565b611317611ce4565b610cc181611bb1565b6113497f0000000000000000000000000000000000000000000000000000000000000000611eea565b6113727f0000000000000000000000000000000000000000000000000000000000000000611eea565b61139b7f0000000000000000000000000000000000000000000000000000000000000000611eea565b6113c47f0000000000000000000000000000000000000000000000000000000000000000611eea565b6113ed7f0000000000000000000000000000000000000000000000000000000000000000611eea565b6114167f0000000000000000000000000000000000000000000000000000000000000000611eea565b61143f7f0000000000000000000000000000000000000000000000000000000000000000611eea565b565b600c54600160201b900463ffffffff1681565b600e546001600160a01b031681565b600c546000908190819061149790620f4240906104c990879061149190849063ffffffff908116906117a816565b906114db565b905060006114a585836117a8565b905060006114b38784611926565b9791965090945050505050565b600c5463ffffffff1681565b6000546001600160a01b031681565b6000826114ea575060006104d4565b828202828482816114f757fe5b0414610d845760405162461bcd60e51b81526004018080602001828103825260218152602001806128766021913960400191505060405180910390fd5b600080821161158a576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b81838161159357fe5b049392505050565b60008054906101000a90046001600160a01b03166001600160a01b0316635c975abb6040518163ffffffff1660e01b815260040160206040518083038186803b1580156115e757600080fd5b505afa1580156115fb573d6000803e3d6000fd5b505050506040513d602081101561161157600080fd5b50511561164e576040805162461bcd60e51b815260206004820152600660248201526514185d5cd95960d21b604482015290519081900360640190fd5b60008054906101000a90046001600160a01b03166001600160a01b0316632e292fc76040518163ffffffff1660e01b815260040160206040518083038186803b15801561169a57600080fd5b505afa1580156116ae573d6000803e3d6000fd5b505050506040513d60208110156116c457600080fd5b50511561143f576040805162461bcd60e51b815260206004820152600e60248201526d14185c9d1a585b0b5c185d5cd95960921b604482015290519081900360640190fd5b6000611713611feb565b90506001600160a01b038116156117a4576040516307470bfb60e21b81526001600160a01b03821690631d1c2fec906117509085906004016122ab565b602060405180830381600087803b15801561176a57600080fd5b505af115801561177e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117a29190612241565b505b5050565b6000828211156117ff576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b60006118307f0000000000000000000000000000000000000000000000000000000000000000612012565b905090565b80156117a257826001600160a01b031663a9059cbb83836040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561189257600080fd5b505af11580156118a6573d6000803e3d6000fd5b505050506040513d60208110156118bc57600080fd5b50516117a2576040805162461bcd60e51b815260206004820152600960248201526810ba3930b739b332b960b91b604482015290519081900360640190fd5b60006118307f0000000000000000000000000000000000000000000000000000000000000000612012565b6000828152600f602090815260408083208151606081018352815480825260019092015463ffffffff811694820194909452600160201b9093046001600160a01b0316918301919091526119c657600d548310156119965760405162461bcd60e51b815260040161048e90612359565b600d546119be906119b6906104c96119ae87836117a8565b6001906114db565b600190611ad5565b9150506104d4565b8051611185906104c98561149188610ecb565b6000604051733d602d80600a3d3981f3363d3d373d3d3d363d7360601b81528260601b60148201526e5af43d82803e903d91602b57fd5bf360881b60288201526037816000f09150506001600160a01b038116610b07576040805162461bcd60e51b8152602060048201526016602482015275115490cc4c4d8dce8818dc99585d194819985a5b195960521b604482015290519081900360640190fd5b80156117a257604080516323b872dd60e01b81526001600160a01b038481166004830152306024830152604482018490529151918516916323b872dd916064808201926020929091908290030181600087803b15801561189257600080fd5b600082820183811015610d84576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b80156117a457816001600160a01b03166342966c68826040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561128c57600080fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6000611bab306120ae565b15905090565b620f424063ffffffff82161115611bda5760405162461bcd60e51b815260040161048e906126f7565b600c805463ffffffff191663ffffffff831617905560405160008051602061282883398151915290611c0b906125b9565b60405180910390a150565b80611c335760405162461bcd60e51b815260040161048e90612645565b600d81905560405160008051602061282883398151915290611c0b9061242c565b6001600160a01b038116611c7a5760405162461bcd60e51b815260040161048e906122eb565b611c83816120ae565b611c9f5760405162461bcd60e51b815260040161048e90612689565b600c805468010000000000000000600160e01b031916600160401b6001600160a01b0384160217905560405160008051602061282883398151915290611c0b90612754565b60008054906101000a90046001600160a01b03166001600160a01b0316634fc07d756040518163ffffffff1660e01b815260040160206040518083038186803b158015611d3057600080fd5b505afa158015611d44573d6000803e3d6000fd5b505050506040513d6020811015611d5a57600080fd5b50516001600160a01b0316331461143f576040805162461bcd60e51b815260206004820152601860248201527f4f6e6c7920436f6e74726f6c6c657220676f7665726e6f720000000000000000604482015290519081900360640190fd5b60006118307f0000000000000000000000000000000000000000000000000000000000000000612012565b6000546001600160a01b0316331461143f576040805162461bcd60e51b815260206004820152601960248201527f43616c6c6572206d75737420626520436f6e74726f6c6c657200000000000000604482015290519081900360640190fd5b6001600160a01b038116611e96576040805162461bcd60e51b815260206004820152601660248201527510dbdb9d1c9bdb1b195c881b5d5cdd081899481cd95d60521b604482015290519081900360640190fd5b600080546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f4ff638452bbf33c012645d18ae6f05515ff5f2d1dfb0cece8cbf018c60903f709181900360200190a150565b6000805460408051637bb20d2f60e11b81526004810185905290516001600160a01b039092169163f7641a5e91602480820192602092909190829003018186803b158015611f3757600080fd5b505afa158015611f4b573d6000803e3d6000fd5b505050506040513d6020811015611f6157600080fd5b50516000838152600160205260409020549091506001600160a01b038083169116146117a45760008281526001602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251908152915184927fd0e7a942b1fc38c411c4f53d153ba14fd24542a6a35ebacd9b6afca1a154e20692908290030190a25050565b60006118307f00000000000000000000000000000000000000000000000000000000000000005b6000818152600160205260408120546001600160a01b0316806104d45760005460408051637bb20d2f60e11b81526004810186905290516001600160a01b039092169163f7641a5e91602480820192602092909190829003018186803b15801561207b57600080fd5b505afa15801561208f573d6000803e3d6000fd5b505050506040513d60208110156120a557600080fd5b50519392505050565b3b151590565b803563ffffffff81168114610b0757600080fd5b6000602082840312156120d9578081fd5b8135610d8481612812565b600080600080608085870312156120f9578283fd5b843561210481612812565b9350602085013561211481612812565b9250612122604086016120b4565b9396929550929360600135925050565b60008060408385031215612144578182fd5b823561214f81612812565b946020939093013593505050565b60006020828403121561216e578081fd5b5035919050565b60008060408385031215612187578182fd5b50508035926020909101359150565b6000806000606084860312156121aa578283fd5b505081359360208301359350604090920135919050565b6000806000604084860312156121d5578283fd5b83356121e081612812565b9250602084013567ffffffffffffffff808211156121fc578384fd5b818601915086601f83011261220f578384fd5b81358181111561221d578485fd5b87602082850101111561222e578485fd5b6020830194508093505050509250925092565b600060208284031215612252578081fd5b5051919050565b60006020828403121561226a578081fd5b610d84826120b4565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b901515815260200190565b90815260200190565b60208082526017908201527f43616e6e6f74206275726e207a65726f207369676e616c000000000000000000604082015260600190565b6020808252601e908201527f546f6b656e206d6173746572206d757374206265206e6f6e2d656d7074790000604082015260600190565b6020808252601d908201527f43616e27742063616c63756c6174652077697468203020746f6b656e73000000604082015260600190565b6020808252602a908201527f4375726174696f6e206465706f7369742069732062656c6f77206d696e696d756040820152691b481c995c5d5a5c995960b21b606082015260800190565b6020808252601590820152742737ba1034b6b83632b6b2b73a32b21034b710261960591b604082015260600190565b60208082526013908201527264656661756c7452657365727665526174696f60681b604082015260600190565b60208082526013908201527229b634b83830b3b290383937ba32b1ba34b7b760691b604082015260600190565b6020808252601690820152751b5a5b9a5b5d5b50dd5c985d1a5bdb91195c1bdcda5d60521b604082015260600190565b60208082526033908201527f5375626772617068206465706c6f796d656e74206d757374206265206375726160408201527274656420746f20636f6c6c656374206665657360681b606082015260800190565b60208082526024908201527f43616e6e6f74206275726e206d6f7265207369676e616c207468616e20796f756040820152631037bbb760e11b606082015260800190565b60208082526043908201527f5369676e616c206d7573742062652061626f7665206f7220657175616c20746f60408201527f207369676e616c2069737375656420696e20746865206375726174696f6e20706060820152621bdbdb60ea1b608082015260a00190565b60208082526037908201527f43616c6c6572206d75737420626520746865207375626772617068207365727660408201527f696365206f72207374616b696e6720636f6e7472616374000000000000000000606082015260800190565b6020808252601590820152746375726174696f6e54617850657263656e7461676560581b604082015260600190565b6020808252603b908201527f5375626772617068206465706c6f796d656e74206d757374206265206375726160408201527f74656420746f20706572666f726d2063616c63756c6174696f6e730000000000606082015260800190565b60208082526024908201527f4d696e696d756d206375726174696f6e206465706f7369742063616e6e6f74206040820152630626520360e41b606082015260800190565b6020808252601f908201527f546f6b656e206d6173746572206d757374206265206120636f6e747261637400604082015260600190565b6020808252601a908201527f43616e6e6f74206465706f736974207a65726f20746f6b656e73000000000000604082015260600190565b60208082526039908201527f4375726174696f6e207461782070657263656e74616765206d7573742062652060408201527f62656c6f77206f7220657175616c20746f204d41585f50504d00000000000000606082015260800190565b60208082526013908201527231bab930ba34b7b72a37b5b2b726b0b9ba32b960691b604082015260600190565b6020808252601a908201527f4f6e6c792074686520474e532063616e2063616c6c2074686973000000000000604082015260600190565b918252602082015260400190565b9283526020830191909152604082015260600190565b92835263ffffffff9190911660208301526001600160a01b0316604082015260600190565b63ffffffff91909116815260200190565b6001600160a01b0381168114610cc157600080fdfe96d5a4b4edf1cefd0900c166d64447f8da1d01d1861a6a60894b5b82a2c15c3c496e697469616c697a61626c653a20636f6e747261637420697320616c726561647920696e697469616c697a6564536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a2646970667358221220182d4780700d3d385918c6f4a2bbe50d522f035098d04683e959156c3033203064736f6c63430007060033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101da5760003560e01c806399439fee11610104578063cd0ad4a2116100a2578063eff1d50e11610071578063eff1d50e146103f2578063f049b900146103fa578063f115c4271461040d578063f77c479114610415576101da565b8063cd0ad4a2146103af578063cd18119e146103c2578063d6866ea5146103d5578063eba0c8a1146103dd576101da565b80639f94c667116100de5780639f94c6671461035f578063a2594d8214610372578063a25e62c714610385578063b5217bb41461038d576101da565b806399439fee146103265780639b4d9f33146103395780639ce7abe51461034c576101da565b80634c4ea0ed1161017c5780637a2a45b81161014b5780637a2a45b8146102da57806381573288146102ed57806392eefe9b1461030057806393a90a1e14610313576101da565b80634c4ea0ed1461027f5780634c8c7a441461029f5780636536fe32146102b457806369db11a1146102c7576101da565b806326058249116101b857806326058249146102235780633718896d14610238578063375a54ab1461024b57806346e855da1461026c576101da565b80630faaf87f146101df578063185360f91461020857806324bdeec714610210575b600080fd5b6101f26101ed366004612175565b61041d565b6040516101ff91906122ab565b60405180910390f35b6101f26104da565b6101f261021e366004612196565b6104e0565b61022b610662565b6040516101ff9190612273565b6101f2610246366004612175565b610677565b61025e610259366004612196565b6108b6565b6040516101ff9291906127b8565b6101f261027a36600461215d565b610af7565b61029261028d36600461215d565b610b0c565b6040516101ff91906122a0565b6102b26102ad3660046120e4565b610b20565b005b6102b26102c236600461215d565b610cb0565b6101f26102d5366004612175565b610cc4565b6101f26102e8366004612175565b610d78565b6102b26102fb366004612175565b610d8b565b6102b261030e3660046120c8565b610e5e565b6102b26103213660046120c8565b610e6f565b6101f261033436600461215d565b610ecb565b6102b26103473660046120c8565b610f72565b6102b261035a3660046121c1565b610f83565b6101f261036d366004612132565b6110d9565b6102b26103803660046120c8565b61118d565b61022b6112a8565b6103a061039b36600461215d565b6112be565b6040516101ff939291906127dc565b6102b26103bd366004612259565b6112ef565b6102b26103d0366004612259565b61130f565b6102b2611320565b6103e5611441565b6040516101ff9190612801565b61022b611454565b61025e610408366004612175565b611463565b6103e56114c0565b61022b6114cc565b6000828152600f6020908152604080832081516060810183528154815260019091015463ffffffff811693820193909352600160201b9092046001600160a01b0316908201528161046d85610ecb565b82519091506104975760405162461bcd60e51b815260040161048e906125e8565b60405180910390fd5b838110156104b75760405162461bcd60e51b815260040161048e906124f3565b81516104cf9082906104c990876114db565b90611534565b925050505b92915050565b600d5481565b60006104ea61159b565b33836105085760405162461bcd60e51b815260040161048e906122b4565b8361051382876110d9565b10156105315760405162461bcd60e51b815260040161048e906124af565b600061053d868661041d565b90508381101561055f5760405162461bcd60e51b815260040161048e906123ff565b61056886611709565b6000868152600f60205260409020805461058290836117a8565b8155600181015460405163079cc67960e41b8152600160201b9091046001600160a01b0316906379cc6790906105be9086908a90600401612287565b600060405180830381600087803b1580156105d857600080fd5b505af11580156105ec573d6000803e3d6000fd5b505050506105f987610ecb565b61060257600081555b61061461060d611805565b8484611835565b86836001600160a01b03167fe14cd5e80f6821ded0538e85a537487acf10bb5e97a12176df56a099e90bfb3484896040516106509291906127b8565b60405180910390a35095945050505050565b6010546201000090046001600160a01b031681565b600061068161159b565b6106896118fb565b6001600160a01b0316336001600160a01b0316146106b95760405162461bcd60e51b815260040161048e90612781565b816106d65760405162461bcd60e51b815260040161048e906126c0565b60006106e28484611926565b6000858152600f6020526040902090915033906106fe86610b0c565b6107ca576001810154600160201b90046001600160a01b03166107ca57600c5460009061073a90600160401b90046001600160a01b03166119d9565b60405163189acdbd60e31b81529091506001600160a01b0382169063c4d66de890610769903090600401612273565b600060405180830381600087803b15801561078357600080fd5b505af1158015610797573d6000803e3d6000fd5b5050506001830180546001600160a01b03909316600160201b02640100000000600160c01b031990931692909217909155505b6107d386611709565b60006107dd611805565b90506107ea818488611a76565b81546107f69087611ad5565b825560018201546040516340c10f1960e01b8152600160201b9091046001600160a01b0316906340c10f19906108329086908890600401612287565b600060405180830381600087803b15801561084c57600080fd5b505af1158015610860573d6000803e3d6000fd5b5050505086836001600160a01b03167fb7bf5f4e5b23ef992df9875ecea572620d18dab0c1a5486a9b695d20d9ec50cf888760006040516108a3939291906127c6565b60405180910390a3509195945050505050565b6000806108c161159b565b836108de5760405162461bcd60e51b815260040161048e906126c0565b6000806108eb8787611463565b915091508482101561090f5760405162461bcd60e51b815260040161048e906123ff565b6000878152600f60205260409020339061092889610b0c565b6109f4576001810154600160201b90046001600160a01b03166109f457600c5460009061096490600160401b90046001600160a01b03166119d9565b60405163189acdbd60e31b81529091506001600160a01b0382169063c4d66de890610993903090600401612273565b600060405180830381600087803b1580156109ad57600080fd5b505af11580156109c1573d6000803e3d6000fd5b5050506001830180546001600160a01b03909316600160201b02640100000000600160c01b031990931692909217909155505b6109fd89611709565b6000610a07611805565b9050610a1481848b611a76565b610a1e8185611b2f565b610a33610a2b8a866117a8565b835490611ad5565b825560018201546040516340c10f1960e01b8152600160201b9091046001600160a01b0316906340c10f1990610a6f9086908990600401612287565b600060405180830381600087803b158015610a8957600080fd5b505af1158015610a9d573d6000803e3d6000fd5b5050505089836001600160a01b03167fb7bf5f4e5b23ef992df9875ecea572620d18dab0c1a5486a9b695d20d9ec50cf8b8888604051610adf939291906127c6565b60405180910390a35092989197509095505050505050565b6000818152600f60205260409020545b919050565b6000908152600f6020526040902054151590565b610b28611b7b565b6001600160a01b0316336001600160a01b031614610b83576040805162461bcd60e51b815260206004820152601360248201527227b7363c9034b6b83632b6b2b73a30ba34b7b760691b604482015290519081900360640190fd5b601054610100900460ff1680610b9c5750610b9c611ba0565b80610baa575060105460ff16155b610be55760405162461bcd60e51b815260040180806020018281038252602e815260200180612848602e913960400191505060405180910390fd5b601054610100900460ff16158015610c10576010805460ff1961ff0019909116610100171660011790555b610c1985610e66565b600c805467ffffffff000000001916600160201b7f000000000000000000000000000000000000000000000000000000000000000063ffffffff160217905560405160008051602061282883398151915290610c74906123d2565b60405180910390a1610c8583611bb1565b610c8e82611c16565b610c9784611c54565b8015610ca9576010805461ff00191690555b5050505050565b610cb8611ce4565b610cc181611c16565b50565b600081610ce35760405162461bcd60e51b815260040161048e90612322565b6000610cef8484611926565b6000858152600f6020908152604080832081516060810183528154815260019091015463ffffffff811693820193909352600160201b9092046001600160a01b031690820152919250610d4b83610d4588610ecb565b90611ad5565b8251909150600090610d5d9087611ad5565b9050610d6d826104c983876114db565b979650505050505050565b6000610d848383611926565b9392505050565b6010546201000090046001600160a01b0316331480610dc25750610dad611db8565b6001600160a01b0316336001600160a01b0316145b610dde5760405162461bcd60e51b815260040161048e9061255c565b610de782610b0c565b610e035760405162461bcd60e51b815260040161048e9061245c565b6000828152600f602052604090208054610e1d9083611ad5565b815560405183907ff17fdee613a92b35db6b7598eb43750b24d4072eb304e6eca80121e40402e34b90610e519085906122ab565b60405180910390a2505050565b610e66611de3565b610cc181611e42565b610e77611ce4565b6010805462010000600160b01b031916620100006001600160a01b038416908102919091179091556040517f81dcb738da3dabd5bb2adbc7dd107fbbfca936e9c8aecab25f5b17a710a784c790600090a250565b6000818152600f6020526040812060010154600160201b90046001600160a01b03168015610f6957806001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015610f2c57600080fd5b505afa158015610f40573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f649190612241565b610d84565b60009392505050565b610f7a611ce4565b610cc181611c54565b82806001600160a01b031663f851a4406040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610fbf57600080fd5b505af1158015610fd3573d6000803e3d6000fd5b505050506040513d6020811015610fe957600080fd5b50516001600160a01b03163314611047576040805162461bcd60e51b815260206004820152601e60248201527f43616c6c6572206d757374206265207468652070726f78792061646d696e0000604482015290519081900360640190fd5b60405163623faf6160e01b8152602060048201908152602482018490526001600160a01b0386169163623faf619186918691908190604401848480828437600081840152601f19601f8201169050808301925050509350505050600060405180830381600087803b1580156110bb57600080fd5b505af11580156110cf573d6000803e3d6000fd5b5050505050505050565b6000818152600f6020526040812060010154600160201b90046001600160a01b03168015611182576040516370a0823160e01b81526001600160a01b038216906370a082319061112d908790600401612273565b60206040518083038186803b15801561114557600080fd5b505afa158015611159573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061117d9190612241565b611185565b60005b949350505050565b80806001600160a01b031663f851a4406040518163ffffffff1660e01b8152600401602060405180830381600087803b1580156111c957600080fd5b505af11580156111dd573d6000803e3d6000fd5b505050506040513d60208110156111f357600080fd5b50516001600160a01b03163314611251576040805162461bcd60e51b815260206004820152601e60248201527f43616c6c6572206d757374206265207468652070726f78792061646d696e0000604482015290519081900360640190fd5b816001600160a01b03166359fc20bb6040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561128c57600080fd5b505af11580156112a0573d6000803e3d6000fd5b505050505050565b600c54600160401b90046001600160a01b031681565b600f602052600090815260409020805460019091015463ffffffff811690600160201b90046001600160a01b031683565b6112f7611ce4565b60405162461bcd60e51b815260040161048e906123a3565b611317611ce4565b610cc181611bb1565b6113497f0000000000000000000000000000000000000000000000000000000000000000611eea565b6113727f0000000000000000000000000000000000000000000000000000000000000000611eea565b61139b7f0000000000000000000000000000000000000000000000000000000000000000611eea565b6113c47f0000000000000000000000000000000000000000000000000000000000000000611eea565b6113ed7f0000000000000000000000000000000000000000000000000000000000000000611eea565b6114167f0000000000000000000000000000000000000000000000000000000000000000611eea565b61143f7f0000000000000000000000000000000000000000000000000000000000000000611eea565b565b600c54600160201b900463ffffffff1681565b600e546001600160a01b031681565b600c546000908190819061149790620f4240906104c990879061149190849063ffffffff908116906117a816565b906114db565b905060006114a585836117a8565b905060006114b38784611926565b9791965090945050505050565b600c5463ffffffff1681565b6000546001600160a01b031681565b6000826114ea575060006104d4565b828202828482816114f757fe5b0414610d845760405162461bcd60e51b81526004018080602001828103825260218152602001806128766021913960400191505060405180910390fd5b600080821161158a576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b81838161159357fe5b049392505050565b60008054906101000a90046001600160a01b03166001600160a01b0316635c975abb6040518163ffffffff1660e01b815260040160206040518083038186803b1580156115e757600080fd5b505afa1580156115fb573d6000803e3d6000fd5b505050506040513d602081101561161157600080fd5b50511561164e576040805162461bcd60e51b815260206004820152600660248201526514185d5cd95960d21b604482015290519081900360640190fd5b60008054906101000a90046001600160a01b03166001600160a01b0316632e292fc76040518163ffffffff1660e01b815260040160206040518083038186803b15801561169a57600080fd5b505afa1580156116ae573d6000803e3d6000fd5b505050506040513d60208110156116c457600080fd5b50511561143f576040805162461bcd60e51b815260206004820152600e60248201526d14185c9d1a585b0b5c185d5cd95960921b604482015290519081900360640190fd5b6000611713611feb565b90506001600160a01b038116156117a4576040516307470bfb60e21b81526001600160a01b03821690631d1c2fec906117509085906004016122ab565b602060405180830381600087803b15801561176a57600080fd5b505af115801561177e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117a29190612241565b505b5050565b6000828211156117ff576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b60006118307f0000000000000000000000000000000000000000000000000000000000000000612012565b905090565b80156117a257826001600160a01b031663a9059cbb83836040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561189257600080fd5b505af11580156118a6573d6000803e3d6000fd5b505050506040513d60208110156118bc57600080fd5b50516117a2576040805162461bcd60e51b815260206004820152600960248201526810ba3930b739b332b960b91b604482015290519081900360640190fd5b60006118307f0000000000000000000000000000000000000000000000000000000000000000612012565b6000828152600f602090815260408083208151606081018352815480825260019092015463ffffffff811694820194909452600160201b9093046001600160a01b0316918301919091526119c657600d548310156119965760405162461bcd60e51b815260040161048e90612359565b600d546119be906119b6906104c96119ae87836117a8565b6001906114db565b600190611ad5565b9150506104d4565b8051611185906104c98561149188610ecb565b6000604051733d602d80600a3d3981f3363d3d373d3d3d363d7360601b81528260601b60148201526e5af43d82803e903d91602b57fd5bf360881b60288201526037816000f09150506001600160a01b038116610b07576040805162461bcd60e51b8152602060048201526016602482015275115490cc4c4d8dce8818dc99585d194819985a5b195960521b604482015290519081900360640190fd5b80156117a257604080516323b872dd60e01b81526001600160a01b038481166004830152306024830152604482018490529151918516916323b872dd916064808201926020929091908290030181600087803b15801561189257600080fd5b600082820183811015610d84576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b80156117a457816001600160a01b03166342966c68826040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561128c57600080fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6000611bab306120ae565b15905090565b620f424063ffffffff82161115611bda5760405162461bcd60e51b815260040161048e906126f7565b600c805463ffffffff191663ffffffff831617905560405160008051602061282883398151915290611c0b906125b9565b60405180910390a150565b80611c335760405162461bcd60e51b815260040161048e90612645565b600d81905560405160008051602061282883398151915290611c0b9061242c565b6001600160a01b038116611c7a5760405162461bcd60e51b815260040161048e906122eb565b611c83816120ae565b611c9f5760405162461bcd60e51b815260040161048e90612689565b600c805468010000000000000000600160e01b031916600160401b6001600160a01b0384160217905560405160008051602061282883398151915290611c0b90612754565b60008054906101000a90046001600160a01b03166001600160a01b0316634fc07d756040518163ffffffff1660e01b815260040160206040518083038186803b158015611d3057600080fd5b505afa158015611d44573d6000803e3d6000fd5b505050506040513d6020811015611d5a57600080fd5b50516001600160a01b0316331461143f576040805162461bcd60e51b815260206004820152601860248201527f4f6e6c7920436f6e74726f6c6c657220676f7665726e6f720000000000000000604482015290519081900360640190fd5b60006118307f0000000000000000000000000000000000000000000000000000000000000000612012565b6000546001600160a01b0316331461143f576040805162461bcd60e51b815260206004820152601960248201527f43616c6c6572206d75737420626520436f6e74726f6c6c657200000000000000604482015290519081900360640190fd5b6001600160a01b038116611e96576040805162461bcd60e51b815260206004820152601660248201527510dbdb9d1c9bdb1b195c881b5d5cdd081899481cd95d60521b604482015290519081900360640190fd5b600080546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f4ff638452bbf33c012645d18ae6f05515ff5f2d1dfb0cece8cbf018c60903f709181900360200190a150565b6000805460408051637bb20d2f60e11b81526004810185905290516001600160a01b039092169163f7641a5e91602480820192602092909190829003018186803b158015611f3757600080fd5b505afa158015611f4b573d6000803e3d6000fd5b505050506040513d6020811015611f6157600080fd5b50516000838152600160205260409020549091506001600160a01b038083169116146117a45760008281526001602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251908152915184927fd0e7a942b1fc38c411c4f53d153ba14fd24542a6a35ebacd9b6afca1a154e20692908290030190a25050565b60006118307f00000000000000000000000000000000000000000000000000000000000000005b6000818152600160205260408120546001600160a01b0316806104d45760005460408051637bb20d2f60e11b81526004810186905290516001600160a01b039092169163f7641a5e91602480820192602092909190829003018186803b15801561207b57600080fd5b505afa15801561208f573d6000803e3d6000fd5b505050506040513d60208110156120a557600080fd5b50519392505050565b3b151590565b803563ffffffff81168114610b0757600080fd5b6000602082840312156120d9578081fd5b8135610d8481612812565b600080600080608085870312156120f9578283fd5b843561210481612812565b9350602085013561211481612812565b9250612122604086016120b4565b9396929550929360600135925050565b60008060408385031215612144578182fd5b823561214f81612812565b946020939093013593505050565b60006020828403121561216e578081fd5b5035919050565b60008060408385031215612187578182fd5b50508035926020909101359150565b6000806000606084860312156121aa578283fd5b505081359360208301359350604090920135919050565b6000806000604084860312156121d5578283fd5b83356121e081612812565b9250602084013567ffffffffffffffff808211156121fc578384fd5b818601915086601f83011261220f578384fd5b81358181111561221d578485fd5b87602082850101111561222e578485fd5b6020830194508093505050509250925092565b600060208284031215612252578081fd5b5051919050565b60006020828403121561226a578081fd5b610d84826120b4565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b901515815260200190565b90815260200190565b60208082526017908201527f43616e6e6f74206275726e207a65726f207369676e616c000000000000000000604082015260600190565b6020808252601e908201527f546f6b656e206d6173746572206d757374206265206e6f6e2d656d7074790000604082015260600190565b6020808252601d908201527f43616e27742063616c63756c6174652077697468203020746f6b656e73000000604082015260600190565b6020808252602a908201527f4375726174696f6e206465706f7369742069732062656c6f77206d696e696d756040820152691b481c995c5d5a5c995960b21b606082015260800190565b6020808252601590820152742737ba1034b6b83632b6b2b73a32b21034b710261960591b604082015260600190565b60208082526013908201527264656661756c7452657365727665526174696f60681b604082015260600190565b60208082526013908201527229b634b83830b3b290383937ba32b1ba34b7b760691b604082015260600190565b6020808252601690820152751b5a5b9a5b5d5b50dd5c985d1a5bdb91195c1bdcda5d60521b604082015260600190565b60208082526033908201527f5375626772617068206465706c6f796d656e74206d757374206265206375726160408201527274656420746f20636f6c6c656374206665657360681b606082015260800190565b60208082526024908201527f43616e6e6f74206275726e206d6f7265207369676e616c207468616e20796f756040820152631037bbb760e11b606082015260800190565b60208082526043908201527f5369676e616c206d7573742062652061626f7665206f7220657175616c20746f60408201527f207369676e616c2069737375656420696e20746865206375726174696f6e20706060820152621bdbdb60ea1b608082015260a00190565b60208082526037908201527f43616c6c6572206d75737420626520746865207375626772617068207365727660408201527f696365206f72207374616b696e6720636f6e7472616374000000000000000000606082015260800190565b6020808252601590820152746375726174696f6e54617850657263656e7461676560581b604082015260600190565b6020808252603b908201527f5375626772617068206465706c6f796d656e74206d757374206265206375726160408201527f74656420746f20706572666f726d2063616c63756c6174696f6e730000000000606082015260800190565b60208082526024908201527f4d696e696d756d206375726174696f6e206465706f7369742063616e6e6f74206040820152630626520360e41b606082015260800190565b6020808252601f908201527f546f6b656e206d6173746572206d757374206265206120636f6e747261637400604082015260600190565b6020808252601a908201527f43616e6e6f74206465706f736974207a65726f20746f6b656e73000000000000604082015260600190565b60208082526039908201527f4375726174696f6e207461782070657263656e74616765206d7573742062652060408201527f62656c6f77206f7220657175616c20746f204d41585f50504d00000000000000606082015260800190565b60208082526013908201527231bab930ba34b7b72a37b5b2b726b0b9ba32b960691b604082015260600190565b6020808252601a908201527f4f6e6c792074686520474e532063616e2063616c6c2074686973000000000000604082015260600190565b918252602082015260400190565b9283526020830191909152604082015260600190565b92835263ffffffff9190911660208301526001600160a01b0316604082015260600190565b63ffffffff91909116815260200190565b6001600160a01b0381168114610cc157600080fdfe96d5a4b4edf1cefd0900c166d64447f8da1d01d1861a6a60894b5b82a2c15c3c496e697469616c697a61626c653a20636f6e747261637420697320616c726561647920696e697469616c697a6564536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a2646970667358221220182d4780700d3d385918c6f4a2bbe50d522f035098d04683e959156c3033203064736f6c63430007060033", + "linkReferences": {}, + "deployedLinkReferences": {} +} \ No newline at end of file diff --git a/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/L2Curation#L2Curation_ProxyWithABI.json b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/L2Curation#L2Curation_ProxyWithABI.json new file mode 100644 index 000000000..0d8c75203 --- /dev/null +++ b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/L2Curation#L2Curation_ProxyWithABI.json @@ -0,0 +1,707 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "L2Curation", + "sourceName": "contracts/l2/curation/L2Curation.sol", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "curator", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "subgraphDeploymentID", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "signal", + "type": "uint256" + } + ], + "name": "Burned", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "subgraphDeploymentID", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "Collected", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "nameHash", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "contractAddress", + "type": "address" + } + ], + "name": "ContractSynced", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "param", + "type": "string" + } + ], + "name": "ParameterUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "controller", + "type": "address" + } + ], + "name": "SetController", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "curator", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "subgraphDeploymentID", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "signal", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "curationTax", + "type": "uint256" + } + ], + "name": "Signalled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newSubgraphService", + "type": "address" + } + ], + "name": "SubgraphServiceSet", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "contract IGraphProxy", + "name": "_proxy", + "type": "address" + } + ], + "name": "acceptProxy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IGraphProxy", + "name": "_proxy", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "acceptProxyAndCall", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "bondingCurve", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_signalIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_tokensOutMin", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_tokens", + "type": "uint256" + } + ], + "name": "collect", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "controller", + "outputs": [ + { + "internalType": "contract IController", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "curationTaxPercentage", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "curationTokenMaster", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "defaultReserveRatio", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + } + ], + "name": "getCurationPoolSignal", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + } + ], + "name": "getCurationPoolTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_curator", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + } + ], + "name": "getCuratorSignal", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_controller", + "type": "address" + }, + { + "internalType": "address", + "name": "_curationTokenMaster", + "type": "address" + }, + { + "internalType": "uint32", + "name": "_curationTaxPercentage", + "type": "uint32" + }, + { + "internalType": "uint256", + "name": "_minimumCurationDeposit", + "type": "uint256" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + } + ], + "name": "isCurated", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "minimumCurationDeposit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_tokensIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_signalOutMin", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_tokensIn", + "type": "uint256" + } + ], + "name": "mintTaxFree", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "pools", + "outputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "reserveRatio", + "type": "uint32" + }, + { + "internalType": "contract IGraphCurationToken", + "name": "gcs", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_controller", + "type": "address" + } + ], + "name": "setController", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "_percentage", + "type": "uint32" + } + ], + "name": "setCurationTaxPercentage", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_curationTokenMaster", + "type": "address" + } + ], + "name": "setCurationTokenMaster", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "name": "setDefaultReserveRatio", + "outputs": [], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_minimumCurationDeposit", + "type": "uint256" + } + ], + "name": "setMinimumCurationDeposit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_subgraphService", + "type": "address" + } + ], + "name": "setSubgraphService", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_signalIn", + "type": "uint256" + } + ], + "name": "signalToTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "subgraphService", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "syncAllContracts", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_tokensIn", + "type": "uint256" + } + ], + "name": "tokensToSignal", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_tokensIn", + "type": "uint256" + } + ], + "name": "tokensToSignalNoTax", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_tokensIn", + "type": "uint256" + } + ], + "name": "tokensToSignalToTokensNoTax", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "bytecode": "0x6101806040527fe6876326c1291dfcbbd3864a6816d698cd591defc7aa2153d7f9c4c04016c89f6080527fc713c3df6d14cdf946460395d09af88993ee2b948b1a808161494e32c5f6706360a0527f966f1e8d8d8014e05f6ec4a57138da9be1f7c5a7f802928a18072f7c5318076160c0527f1df41cd916959d1163dc8f0671a666ea8a3e434c13e40faef527133b5d16703460e0527f45fc200c7e4544e457d3c5709bfe0d520442c30bbcbdaede89e8d4a4bbc19247610100527fd362cac9cb75c10d67bcc0b7eeb0b1ef48bb5420b556c092d4fd7f758816fcf0610120527f39605a6c26a173774ca666c67ef70cf491880e5d3d6d0ca66ec0a31034f15ea361014052613d0960e61b6101605234801561011a57600080fd5b5060805160a05160c05160e0516101005161012051610140516101605160e01c6128cc61018f60003980610c2f52508061141b52806119025250806113f25250806113c9528061180c5250806113a05280611dbf5250806113775280611ff252508061134e52508061132552506128cc6000f3fe608060405234801561001057600080fd5b50600436106101da5760003560e01c806399439fee11610104578063cd0ad4a2116100a2578063eff1d50e11610071578063eff1d50e146103f2578063f049b900146103fa578063f115c4271461040d578063f77c479114610415576101da565b8063cd0ad4a2146103af578063cd18119e146103c2578063d6866ea5146103d5578063eba0c8a1146103dd576101da565b80639f94c667116100de5780639f94c6671461035f578063a2594d8214610372578063a25e62c714610385578063b5217bb41461038d576101da565b806399439fee146103265780639b4d9f33146103395780639ce7abe51461034c576101da565b80634c4ea0ed1161017c5780637a2a45b81161014b5780637a2a45b8146102da57806381573288146102ed57806392eefe9b1461030057806393a90a1e14610313576101da565b80634c4ea0ed1461027f5780634c8c7a441461029f5780636536fe32146102b457806369db11a1146102c7576101da565b806326058249116101b857806326058249146102235780633718896d14610238578063375a54ab1461024b57806346e855da1461026c576101da565b80630faaf87f146101df578063185360f91461020857806324bdeec714610210575b600080fd5b6101f26101ed366004612175565b61041d565b6040516101ff91906122ab565b60405180910390f35b6101f26104da565b6101f261021e366004612196565b6104e0565b61022b610662565b6040516101ff9190612273565b6101f2610246366004612175565b610677565b61025e610259366004612196565b6108b6565b6040516101ff9291906127b8565b6101f261027a36600461215d565b610af7565b61029261028d36600461215d565b610b0c565b6040516101ff91906122a0565b6102b26102ad3660046120e4565b610b20565b005b6102b26102c236600461215d565b610cb0565b6101f26102d5366004612175565b610cc4565b6101f26102e8366004612175565b610d78565b6102b26102fb366004612175565b610d8b565b6102b261030e3660046120c8565b610e5e565b6102b26103213660046120c8565b610e6f565b6101f261033436600461215d565b610ecb565b6102b26103473660046120c8565b610f72565b6102b261035a3660046121c1565b610f83565b6101f261036d366004612132565b6110d9565b6102b26103803660046120c8565b61118d565b61022b6112a8565b6103a061039b36600461215d565b6112be565b6040516101ff939291906127dc565b6102b26103bd366004612259565b6112ef565b6102b26103d0366004612259565b61130f565b6102b2611320565b6103e5611441565b6040516101ff9190612801565b61022b611454565b61025e610408366004612175565b611463565b6103e56114c0565b61022b6114cc565b6000828152600f6020908152604080832081516060810183528154815260019091015463ffffffff811693820193909352600160201b9092046001600160a01b0316908201528161046d85610ecb565b82519091506104975760405162461bcd60e51b815260040161048e906125e8565b60405180910390fd5b838110156104b75760405162461bcd60e51b815260040161048e906124f3565b81516104cf9082906104c990876114db565b90611534565b925050505b92915050565b600d5481565b60006104ea61159b565b33836105085760405162461bcd60e51b815260040161048e906122b4565b8361051382876110d9565b10156105315760405162461bcd60e51b815260040161048e906124af565b600061053d868661041d565b90508381101561055f5760405162461bcd60e51b815260040161048e906123ff565b61056886611709565b6000868152600f60205260409020805461058290836117a8565b8155600181015460405163079cc67960e41b8152600160201b9091046001600160a01b0316906379cc6790906105be9086908a90600401612287565b600060405180830381600087803b1580156105d857600080fd5b505af11580156105ec573d6000803e3d6000fd5b505050506105f987610ecb565b61060257600081555b61061461060d611805565b8484611835565b86836001600160a01b03167fe14cd5e80f6821ded0538e85a537487acf10bb5e97a12176df56a099e90bfb3484896040516106509291906127b8565b60405180910390a35095945050505050565b6010546201000090046001600160a01b031681565b600061068161159b565b6106896118fb565b6001600160a01b0316336001600160a01b0316146106b95760405162461bcd60e51b815260040161048e90612781565b816106d65760405162461bcd60e51b815260040161048e906126c0565b60006106e28484611926565b6000858152600f6020526040902090915033906106fe86610b0c565b6107ca576001810154600160201b90046001600160a01b03166107ca57600c5460009061073a90600160401b90046001600160a01b03166119d9565b60405163189acdbd60e31b81529091506001600160a01b0382169063c4d66de890610769903090600401612273565b600060405180830381600087803b15801561078357600080fd5b505af1158015610797573d6000803e3d6000fd5b5050506001830180546001600160a01b03909316600160201b02640100000000600160c01b031990931692909217909155505b6107d386611709565b60006107dd611805565b90506107ea818488611a76565b81546107f69087611ad5565b825560018201546040516340c10f1960e01b8152600160201b9091046001600160a01b0316906340c10f19906108329086908890600401612287565b600060405180830381600087803b15801561084c57600080fd5b505af1158015610860573d6000803e3d6000fd5b5050505086836001600160a01b03167fb7bf5f4e5b23ef992df9875ecea572620d18dab0c1a5486a9b695d20d9ec50cf888760006040516108a3939291906127c6565b60405180910390a3509195945050505050565b6000806108c161159b565b836108de5760405162461bcd60e51b815260040161048e906126c0565b6000806108eb8787611463565b915091508482101561090f5760405162461bcd60e51b815260040161048e906123ff565b6000878152600f60205260409020339061092889610b0c565b6109f4576001810154600160201b90046001600160a01b03166109f457600c5460009061096490600160401b90046001600160a01b03166119d9565b60405163189acdbd60e31b81529091506001600160a01b0382169063c4d66de890610993903090600401612273565b600060405180830381600087803b1580156109ad57600080fd5b505af11580156109c1573d6000803e3d6000fd5b5050506001830180546001600160a01b03909316600160201b02640100000000600160c01b031990931692909217909155505b6109fd89611709565b6000610a07611805565b9050610a1481848b611a76565b610a1e8185611b2f565b610a33610a2b8a866117a8565b835490611ad5565b825560018201546040516340c10f1960e01b8152600160201b9091046001600160a01b0316906340c10f1990610a6f9086908990600401612287565b600060405180830381600087803b158015610a8957600080fd5b505af1158015610a9d573d6000803e3d6000fd5b5050505089836001600160a01b03167fb7bf5f4e5b23ef992df9875ecea572620d18dab0c1a5486a9b695d20d9ec50cf8b8888604051610adf939291906127c6565b60405180910390a35092989197509095505050505050565b6000818152600f60205260409020545b919050565b6000908152600f6020526040902054151590565b610b28611b7b565b6001600160a01b0316336001600160a01b031614610b83576040805162461bcd60e51b815260206004820152601360248201527227b7363c9034b6b83632b6b2b73a30ba34b7b760691b604482015290519081900360640190fd5b601054610100900460ff1680610b9c5750610b9c611ba0565b80610baa575060105460ff16155b610be55760405162461bcd60e51b815260040180806020018281038252602e815260200180612848602e913960400191505060405180910390fd5b601054610100900460ff16158015610c10576010805460ff1961ff0019909116610100171660011790555b610c1985610e66565b600c805467ffffffff000000001916600160201b7f000000000000000000000000000000000000000000000000000000000000000063ffffffff160217905560405160008051602061282883398151915290610c74906123d2565b60405180910390a1610c8583611bb1565b610c8e82611c16565b610c9784611c54565b8015610ca9576010805461ff00191690555b5050505050565b610cb8611ce4565b610cc181611c16565b50565b600081610ce35760405162461bcd60e51b815260040161048e90612322565b6000610cef8484611926565b6000858152600f6020908152604080832081516060810183528154815260019091015463ffffffff811693820193909352600160201b9092046001600160a01b031690820152919250610d4b83610d4588610ecb565b90611ad5565b8251909150600090610d5d9087611ad5565b9050610d6d826104c983876114db565b979650505050505050565b6000610d848383611926565b9392505050565b6010546201000090046001600160a01b0316331480610dc25750610dad611db8565b6001600160a01b0316336001600160a01b0316145b610dde5760405162461bcd60e51b815260040161048e9061255c565b610de782610b0c565b610e035760405162461bcd60e51b815260040161048e9061245c565b6000828152600f602052604090208054610e1d9083611ad5565b815560405183907ff17fdee613a92b35db6b7598eb43750b24d4072eb304e6eca80121e40402e34b90610e519085906122ab565b60405180910390a2505050565b610e66611de3565b610cc181611e42565b610e77611ce4565b6010805462010000600160b01b031916620100006001600160a01b038416908102919091179091556040517f81dcb738da3dabd5bb2adbc7dd107fbbfca936e9c8aecab25f5b17a710a784c790600090a250565b6000818152600f6020526040812060010154600160201b90046001600160a01b03168015610f6957806001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015610f2c57600080fd5b505afa158015610f40573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f649190612241565b610d84565b60009392505050565b610f7a611ce4565b610cc181611c54565b82806001600160a01b031663f851a4406040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610fbf57600080fd5b505af1158015610fd3573d6000803e3d6000fd5b505050506040513d6020811015610fe957600080fd5b50516001600160a01b03163314611047576040805162461bcd60e51b815260206004820152601e60248201527f43616c6c6572206d757374206265207468652070726f78792061646d696e0000604482015290519081900360640190fd5b60405163623faf6160e01b8152602060048201908152602482018490526001600160a01b0386169163623faf619186918691908190604401848480828437600081840152601f19601f8201169050808301925050509350505050600060405180830381600087803b1580156110bb57600080fd5b505af11580156110cf573d6000803e3d6000fd5b5050505050505050565b6000818152600f6020526040812060010154600160201b90046001600160a01b03168015611182576040516370a0823160e01b81526001600160a01b038216906370a082319061112d908790600401612273565b60206040518083038186803b15801561114557600080fd5b505afa158015611159573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061117d9190612241565b611185565b60005b949350505050565b80806001600160a01b031663f851a4406040518163ffffffff1660e01b8152600401602060405180830381600087803b1580156111c957600080fd5b505af11580156111dd573d6000803e3d6000fd5b505050506040513d60208110156111f357600080fd5b50516001600160a01b03163314611251576040805162461bcd60e51b815260206004820152601e60248201527f43616c6c6572206d757374206265207468652070726f78792061646d696e0000604482015290519081900360640190fd5b816001600160a01b03166359fc20bb6040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561128c57600080fd5b505af11580156112a0573d6000803e3d6000fd5b505050505050565b600c54600160401b90046001600160a01b031681565b600f602052600090815260409020805460019091015463ffffffff811690600160201b90046001600160a01b031683565b6112f7611ce4565b60405162461bcd60e51b815260040161048e906123a3565b611317611ce4565b610cc181611bb1565b6113497f0000000000000000000000000000000000000000000000000000000000000000611eea565b6113727f0000000000000000000000000000000000000000000000000000000000000000611eea565b61139b7f0000000000000000000000000000000000000000000000000000000000000000611eea565b6113c47f0000000000000000000000000000000000000000000000000000000000000000611eea565b6113ed7f0000000000000000000000000000000000000000000000000000000000000000611eea565b6114167f0000000000000000000000000000000000000000000000000000000000000000611eea565b61143f7f0000000000000000000000000000000000000000000000000000000000000000611eea565b565b600c54600160201b900463ffffffff1681565b600e546001600160a01b031681565b600c546000908190819061149790620f4240906104c990879061149190849063ffffffff908116906117a816565b906114db565b905060006114a585836117a8565b905060006114b38784611926565b9791965090945050505050565b600c5463ffffffff1681565b6000546001600160a01b031681565b6000826114ea575060006104d4565b828202828482816114f757fe5b0414610d845760405162461bcd60e51b81526004018080602001828103825260218152602001806128766021913960400191505060405180910390fd5b600080821161158a576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b81838161159357fe5b049392505050565b60008054906101000a90046001600160a01b03166001600160a01b0316635c975abb6040518163ffffffff1660e01b815260040160206040518083038186803b1580156115e757600080fd5b505afa1580156115fb573d6000803e3d6000fd5b505050506040513d602081101561161157600080fd5b50511561164e576040805162461bcd60e51b815260206004820152600660248201526514185d5cd95960d21b604482015290519081900360640190fd5b60008054906101000a90046001600160a01b03166001600160a01b0316632e292fc76040518163ffffffff1660e01b815260040160206040518083038186803b15801561169a57600080fd5b505afa1580156116ae573d6000803e3d6000fd5b505050506040513d60208110156116c457600080fd5b50511561143f576040805162461bcd60e51b815260206004820152600e60248201526d14185c9d1a585b0b5c185d5cd95960921b604482015290519081900360640190fd5b6000611713611feb565b90506001600160a01b038116156117a4576040516307470bfb60e21b81526001600160a01b03821690631d1c2fec906117509085906004016122ab565b602060405180830381600087803b15801561176a57600080fd5b505af115801561177e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117a29190612241565b505b5050565b6000828211156117ff576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b60006118307f0000000000000000000000000000000000000000000000000000000000000000612012565b905090565b80156117a257826001600160a01b031663a9059cbb83836040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561189257600080fd5b505af11580156118a6573d6000803e3d6000fd5b505050506040513d60208110156118bc57600080fd5b50516117a2576040805162461bcd60e51b815260206004820152600960248201526810ba3930b739b332b960b91b604482015290519081900360640190fd5b60006118307f0000000000000000000000000000000000000000000000000000000000000000612012565b6000828152600f602090815260408083208151606081018352815480825260019092015463ffffffff811694820194909452600160201b9093046001600160a01b0316918301919091526119c657600d548310156119965760405162461bcd60e51b815260040161048e90612359565b600d546119be906119b6906104c96119ae87836117a8565b6001906114db565b600190611ad5565b9150506104d4565b8051611185906104c98561149188610ecb565b6000604051733d602d80600a3d3981f3363d3d373d3d3d363d7360601b81528260601b60148201526e5af43d82803e903d91602b57fd5bf360881b60288201526037816000f09150506001600160a01b038116610b07576040805162461bcd60e51b8152602060048201526016602482015275115490cc4c4d8dce8818dc99585d194819985a5b195960521b604482015290519081900360640190fd5b80156117a257604080516323b872dd60e01b81526001600160a01b038481166004830152306024830152604482018490529151918516916323b872dd916064808201926020929091908290030181600087803b15801561189257600080fd5b600082820183811015610d84576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b80156117a457816001600160a01b03166342966c68826040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561128c57600080fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6000611bab306120ae565b15905090565b620f424063ffffffff82161115611bda5760405162461bcd60e51b815260040161048e906126f7565b600c805463ffffffff191663ffffffff831617905560405160008051602061282883398151915290611c0b906125b9565b60405180910390a150565b80611c335760405162461bcd60e51b815260040161048e90612645565b600d81905560405160008051602061282883398151915290611c0b9061242c565b6001600160a01b038116611c7a5760405162461bcd60e51b815260040161048e906122eb565b611c83816120ae565b611c9f5760405162461bcd60e51b815260040161048e90612689565b600c805468010000000000000000600160e01b031916600160401b6001600160a01b0384160217905560405160008051602061282883398151915290611c0b90612754565b60008054906101000a90046001600160a01b03166001600160a01b0316634fc07d756040518163ffffffff1660e01b815260040160206040518083038186803b158015611d3057600080fd5b505afa158015611d44573d6000803e3d6000fd5b505050506040513d6020811015611d5a57600080fd5b50516001600160a01b0316331461143f576040805162461bcd60e51b815260206004820152601860248201527f4f6e6c7920436f6e74726f6c6c657220676f7665726e6f720000000000000000604482015290519081900360640190fd5b60006118307f0000000000000000000000000000000000000000000000000000000000000000612012565b6000546001600160a01b0316331461143f576040805162461bcd60e51b815260206004820152601960248201527f43616c6c6572206d75737420626520436f6e74726f6c6c657200000000000000604482015290519081900360640190fd5b6001600160a01b038116611e96576040805162461bcd60e51b815260206004820152601660248201527510dbdb9d1c9bdb1b195c881b5d5cdd081899481cd95d60521b604482015290519081900360640190fd5b600080546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f4ff638452bbf33c012645d18ae6f05515ff5f2d1dfb0cece8cbf018c60903f709181900360200190a150565b6000805460408051637bb20d2f60e11b81526004810185905290516001600160a01b039092169163f7641a5e91602480820192602092909190829003018186803b158015611f3757600080fd5b505afa158015611f4b573d6000803e3d6000fd5b505050506040513d6020811015611f6157600080fd5b50516000838152600160205260409020549091506001600160a01b038083169116146117a45760008281526001602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251908152915184927fd0e7a942b1fc38c411c4f53d153ba14fd24542a6a35ebacd9b6afca1a154e20692908290030190a25050565b60006118307f00000000000000000000000000000000000000000000000000000000000000005b6000818152600160205260408120546001600160a01b0316806104d45760005460408051637bb20d2f60e11b81526004810186905290516001600160a01b039092169163f7641a5e91602480820192602092909190829003018186803b15801561207b57600080fd5b505afa15801561208f573d6000803e3d6000fd5b505050506040513d60208110156120a557600080fd5b50519392505050565b3b151590565b803563ffffffff81168114610b0757600080fd5b6000602082840312156120d9578081fd5b8135610d8481612812565b600080600080608085870312156120f9578283fd5b843561210481612812565b9350602085013561211481612812565b9250612122604086016120b4565b9396929550929360600135925050565b60008060408385031215612144578182fd5b823561214f81612812565b946020939093013593505050565b60006020828403121561216e578081fd5b5035919050565b60008060408385031215612187578182fd5b50508035926020909101359150565b6000806000606084860312156121aa578283fd5b505081359360208301359350604090920135919050565b6000806000604084860312156121d5578283fd5b83356121e081612812565b9250602084013567ffffffffffffffff808211156121fc578384fd5b818601915086601f83011261220f578384fd5b81358181111561221d578485fd5b87602082850101111561222e578485fd5b6020830194508093505050509250925092565b600060208284031215612252578081fd5b5051919050565b60006020828403121561226a578081fd5b610d84826120b4565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b901515815260200190565b90815260200190565b60208082526017908201527f43616e6e6f74206275726e207a65726f207369676e616c000000000000000000604082015260600190565b6020808252601e908201527f546f6b656e206d6173746572206d757374206265206e6f6e2d656d7074790000604082015260600190565b6020808252601d908201527f43616e27742063616c63756c6174652077697468203020746f6b656e73000000604082015260600190565b6020808252602a908201527f4375726174696f6e206465706f7369742069732062656c6f77206d696e696d756040820152691b481c995c5d5a5c995960b21b606082015260800190565b6020808252601590820152742737ba1034b6b83632b6b2b73a32b21034b710261960591b604082015260600190565b60208082526013908201527264656661756c7452657365727665526174696f60681b604082015260600190565b60208082526013908201527229b634b83830b3b290383937ba32b1ba34b7b760691b604082015260600190565b6020808252601690820152751b5a5b9a5b5d5b50dd5c985d1a5bdb91195c1bdcda5d60521b604082015260600190565b60208082526033908201527f5375626772617068206465706c6f796d656e74206d757374206265206375726160408201527274656420746f20636f6c6c656374206665657360681b606082015260800190565b60208082526024908201527f43616e6e6f74206275726e206d6f7265207369676e616c207468616e20796f756040820152631037bbb760e11b606082015260800190565b60208082526043908201527f5369676e616c206d7573742062652061626f7665206f7220657175616c20746f60408201527f207369676e616c2069737375656420696e20746865206375726174696f6e20706060820152621bdbdb60ea1b608082015260a00190565b60208082526037908201527f43616c6c6572206d75737420626520746865207375626772617068207365727660408201527f696365206f72207374616b696e6720636f6e7472616374000000000000000000606082015260800190565b6020808252601590820152746375726174696f6e54617850657263656e7461676560581b604082015260600190565b6020808252603b908201527f5375626772617068206465706c6f796d656e74206d757374206265206375726160408201527f74656420746f20706572666f726d2063616c63756c6174696f6e730000000000606082015260800190565b60208082526024908201527f4d696e696d756d206375726174696f6e206465706f7369742063616e6e6f74206040820152630626520360e41b606082015260800190565b6020808252601f908201527f546f6b656e206d6173746572206d757374206265206120636f6e747261637400604082015260600190565b6020808252601a908201527f43616e6e6f74206465706f736974207a65726f20746f6b656e73000000000000604082015260600190565b60208082526039908201527f4375726174696f6e207461782070657263656e74616765206d7573742062652060408201527f62656c6f77206f7220657175616c20746f204d41585f50504d00000000000000606082015260800190565b60208082526013908201527231bab930ba34b7b72a37b5b2b726b0b9ba32b960691b604082015260600190565b6020808252601a908201527f4f6e6c792074686520474e532063616e2063616c6c2074686973000000000000604082015260600190565b918252602082015260400190565b9283526020830191909152604082015260600190565b92835263ffffffff9190911660208301526001600160a01b0316604082015260600190565b63ffffffff91909116815260200190565b6001600160a01b0381168114610cc157600080fdfe96d5a4b4edf1cefd0900c166d64447f8da1d01d1861a6a60894b5b82a2c15c3c496e697469616c697a61626c653a20636f6e747261637420697320616c726561647920696e697469616c697a6564536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a2646970667358221220182d4780700d3d385918c6f4a2bbe50d522f035098d04683e959156c3033203064736f6c63430007060033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101da5760003560e01c806399439fee11610104578063cd0ad4a2116100a2578063eff1d50e11610071578063eff1d50e146103f2578063f049b900146103fa578063f115c4271461040d578063f77c479114610415576101da565b8063cd0ad4a2146103af578063cd18119e146103c2578063d6866ea5146103d5578063eba0c8a1146103dd576101da565b80639f94c667116100de5780639f94c6671461035f578063a2594d8214610372578063a25e62c714610385578063b5217bb41461038d576101da565b806399439fee146103265780639b4d9f33146103395780639ce7abe51461034c576101da565b80634c4ea0ed1161017c5780637a2a45b81161014b5780637a2a45b8146102da57806381573288146102ed57806392eefe9b1461030057806393a90a1e14610313576101da565b80634c4ea0ed1461027f5780634c8c7a441461029f5780636536fe32146102b457806369db11a1146102c7576101da565b806326058249116101b857806326058249146102235780633718896d14610238578063375a54ab1461024b57806346e855da1461026c576101da565b80630faaf87f146101df578063185360f91461020857806324bdeec714610210575b600080fd5b6101f26101ed366004612175565b61041d565b6040516101ff91906122ab565b60405180910390f35b6101f26104da565b6101f261021e366004612196565b6104e0565b61022b610662565b6040516101ff9190612273565b6101f2610246366004612175565b610677565b61025e610259366004612196565b6108b6565b6040516101ff9291906127b8565b6101f261027a36600461215d565b610af7565b61029261028d36600461215d565b610b0c565b6040516101ff91906122a0565b6102b26102ad3660046120e4565b610b20565b005b6102b26102c236600461215d565b610cb0565b6101f26102d5366004612175565b610cc4565b6101f26102e8366004612175565b610d78565b6102b26102fb366004612175565b610d8b565b6102b261030e3660046120c8565b610e5e565b6102b26103213660046120c8565b610e6f565b6101f261033436600461215d565b610ecb565b6102b26103473660046120c8565b610f72565b6102b261035a3660046121c1565b610f83565b6101f261036d366004612132565b6110d9565b6102b26103803660046120c8565b61118d565b61022b6112a8565b6103a061039b36600461215d565b6112be565b6040516101ff939291906127dc565b6102b26103bd366004612259565b6112ef565b6102b26103d0366004612259565b61130f565b6102b2611320565b6103e5611441565b6040516101ff9190612801565b61022b611454565b61025e610408366004612175565b611463565b6103e56114c0565b61022b6114cc565b6000828152600f6020908152604080832081516060810183528154815260019091015463ffffffff811693820193909352600160201b9092046001600160a01b0316908201528161046d85610ecb565b82519091506104975760405162461bcd60e51b815260040161048e906125e8565b60405180910390fd5b838110156104b75760405162461bcd60e51b815260040161048e906124f3565b81516104cf9082906104c990876114db565b90611534565b925050505b92915050565b600d5481565b60006104ea61159b565b33836105085760405162461bcd60e51b815260040161048e906122b4565b8361051382876110d9565b10156105315760405162461bcd60e51b815260040161048e906124af565b600061053d868661041d565b90508381101561055f5760405162461bcd60e51b815260040161048e906123ff565b61056886611709565b6000868152600f60205260409020805461058290836117a8565b8155600181015460405163079cc67960e41b8152600160201b9091046001600160a01b0316906379cc6790906105be9086908a90600401612287565b600060405180830381600087803b1580156105d857600080fd5b505af11580156105ec573d6000803e3d6000fd5b505050506105f987610ecb565b61060257600081555b61061461060d611805565b8484611835565b86836001600160a01b03167fe14cd5e80f6821ded0538e85a537487acf10bb5e97a12176df56a099e90bfb3484896040516106509291906127b8565b60405180910390a35095945050505050565b6010546201000090046001600160a01b031681565b600061068161159b565b6106896118fb565b6001600160a01b0316336001600160a01b0316146106b95760405162461bcd60e51b815260040161048e90612781565b816106d65760405162461bcd60e51b815260040161048e906126c0565b60006106e28484611926565b6000858152600f6020526040902090915033906106fe86610b0c565b6107ca576001810154600160201b90046001600160a01b03166107ca57600c5460009061073a90600160401b90046001600160a01b03166119d9565b60405163189acdbd60e31b81529091506001600160a01b0382169063c4d66de890610769903090600401612273565b600060405180830381600087803b15801561078357600080fd5b505af1158015610797573d6000803e3d6000fd5b5050506001830180546001600160a01b03909316600160201b02640100000000600160c01b031990931692909217909155505b6107d386611709565b60006107dd611805565b90506107ea818488611a76565b81546107f69087611ad5565b825560018201546040516340c10f1960e01b8152600160201b9091046001600160a01b0316906340c10f19906108329086908890600401612287565b600060405180830381600087803b15801561084c57600080fd5b505af1158015610860573d6000803e3d6000fd5b5050505086836001600160a01b03167fb7bf5f4e5b23ef992df9875ecea572620d18dab0c1a5486a9b695d20d9ec50cf888760006040516108a3939291906127c6565b60405180910390a3509195945050505050565b6000806108c161159b565b836108de5760405162461bcd60e51b815260040161048e906126c0565b6000806108eb8787611463565b915091508482101561090f5760405162461bcd60e51b815260040161048e906123ff565b6000878152600f60205260409020339061092889610b0c565b6109f4576001810154600160201b90046001600160a01b03166109f457600c5460009061096490600160401b90046001600160a01b03166119d9565b60405163189acdbd60e31b81529091506001600160a01b0382169063c4d66de890610993903090600401612273565b600060405180830381600087803b1580156109ad57600080fd5b505af11580156109c1573d6000803e3d6000fd5b5050506001830180546001600160a01b03909316600160201b02640100000000600160c01b031990931692909217909155505b6109fd89611709565b6000610a07611805565b9050610a1481848b611a76565b610a1e8185611b2f565b610a33610a2b8a866117a8565b835490611ad5565b825560018201546040516340c10f1960e01b8152600160201b9091046001600160a01b0316906340c10f1990610a6f9086908990600401612287565b600060405180830381600087803b158015610a8957600080fd5b505af1158015610a9d573d6000803e3d6000fd5b5050505089836001600160a01b03167fb7bf5f4e5b23ef992df9875ecea572620d18dab0c1a5486a9b695d20d9ec50cf8b8888604051610adf939291906127c6565b60405180910390a35092989197509095505050505050565b6000818152600f60205260409020545b919050565b6000908152600f6020526040902054151590565b610b28611b7b565b6001600160a01b0316336001600160a01b031614610b83576040805162461bcd60e51b815260206004820152601360248201527227b7363c9034b6b83632b6b2b73a30ba34b7b760691b604482015290519081900360640190fd5b601054610100900460ff1680610b9c5750610b9c611ba0565b80610baa575060105460ff16155b610be55760405162461bcd60e51b815260040180806020018281038252602e815260200180612848602e913960400191505060405180910390fd5b601054610100900460ff16158015610c10576010805460ff1961ff0019909116610100171660011790555b610c1985610e66565b600c805467ffffffff000000001916600160201b7f000000000000000000000000000000000000000000000000000000000000000063ffffffff160217905560405160008051602061282883398151915290610c74906123d2565b60405180910390a1610c8583611bb1565b610c8e82611c16565b610c9784611c54565b8015610ca9576010805461ff00191690555b5050505050565b610cb8611ce4565b610cc181611c16565b50565b600081610ce35760405162461bcd60e51b815260040161048e90612322565b6000610cef8484611926565b6000858152600f6020908152604080832081516060810183528154815260019091015463ffffffff811693820193909352600160201b9092046001600160a01b031690820152919250610d4b83610d4588610ecb565b90611ad5565b8251909150600090610d5d9087611ad5565b9050610d6d826104c983876114db565b979650505050505050565b6000610d848383611926565b9392505050565b6010546201000090046001600160a01b0316331480610dc25750610dad611db8565b6001600160a01b0316336001600160a01b0316145b610dde5760405162461bcd60e51b815260040161048e9061255c565b610de782610b0c565b610e035760405162461bcd60e51b815260040161048e9061245c565b6000828152600f602052604090208054610e1d9083611ad5565b815560405183907ff17fdee613a92b35db6b7598eb43750b24d4072eb304e6eca80121e40402e34b90610e519085906122ab565b60405180910390a2505050565b610e66611de3565b610cc181611e42565b610e77611ce4565b6010805462010000600160b01b031916620100006001600160a01b038416908102919091179091556040517f81dcb738da3dabd5bb2adbc7dd107fbbfca936e9c8aecab25f5b17a710a784c790600090a250565b6000818152600f6020526040812060010154600160201b90046001600160a01b03168015610f6957806001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015610f2c57600080fd5b505afa158015610f40573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f649190612241565b610d84565b60009392505050565b610f7a611ce4565b610cc181611c54565b82806001600160a01b031663f851a4406040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610fbf57600080fd5b505af1158015610fd3573d6000803e3d6000fd5b505050506040513d6020811015610fe957600080fd5b50516001600160a01b03163314611047576040805162461bcd60e51b815260206004820152601e60248201527f43616c6c6572206d757374206265207468652070726f78792061646d696e0000604482015290519081900360640190fd5b60405163623faf6160e01b8152602060048201908152602482018490526001600160a01b0386169163623faf619186918691908190604401848480828437600081840152601f19601f8201169050808301925050509350505050600060405180830381600087803b1580156110bb57600080fd5b505af11580156110cf573d6000803e3d6000fd5b5050505050505050565b6000818152600f6020526040812060010154600160201b90046001600160a01b03168015611182576040516370a0823160e01b81526001600160a01b038216906370a082319061112d908790600401612273565b60206040518083038186803b15801561114557600080fd5b505afa158015611159573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061117d9190612241565b611185565b60005b949350505050565b80806001600160a01b031663f851a4406040518163ffffffff1660e01b8152600401602060405180830381600087803b1580156111c957600080fd5b505af11580156111dd573d6000803e3d6000fd5b505050506040513d60208110156111f357600080fd5b50516001600160a01b03163314611251576040805162461bcd60e51b815260206004820152601e60248201527f43616c6c6572206d757374206265207468652070726f78792061646d696e0000604482015290519081900360640190fd5b816001600160a01b03166359fc20bb6040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561128c57600080fd5b505af11580156112a0573d6000803e3d6000fd5b505050505050565b600c54600160401b90046001600160a01b031681565b600f602052600090815260409020805460019091015463ffffffff811690600160201b90046001600160a01b031683565b6112f7611ce4565b60405162461bcd60e51b815260040161048e906123a3565b611317611ce4565b610cc181611bb1565b6113497f0000000000000000000000000000000000000000000000000000000000000000611eea565b6113727f0000000000000000000000000000000000000000000000000000000000000000611eea565b61139b7f0000000000000000000000000000000000000000000000000000000000000000611eea565b6113c47f0000000000000000000000000000000000000000000000000000000000000000611eea565b6113ed7f0000000000000000000000000000000000000000000000000000000000000000611eea565b6114167f0000000000000000000000000000000000000000000000000000000000000000611eea565b61143f7f0000000000000000000000000000000000000000000000000000000000000000611eea565b565b600c54600160201b900463ffffffff1681565b600e546001600160a01b031681565b600c546000908190819061149790620f4240906104c990879061149190849063ffffffff908116906117a816565b906114db565b905060006114a585836117a8565b905060006114b38784611926565b9791965090945050505050565b600c5463ffffffff1681565b6000546001600160a01b031681565b6000826114ea575060006104d4565b828202828482816114f757fe5b0414610d845760405162461bcd60e51b81526004018080602001828103825260218152602001806128766021913960400191505060405180910390fd5b600080821161158a576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b81838161159357fe5b049392505050565b60008054906101000a90046001600160a01b03166001600160a01b0316635c975abb6040518163ffffffff1660e01b815260040160206040518083038186803b1580156115e757600080fd5b505afa1580156115fb573d6000803e3d6000fd5b505050506040513d602081101561161157600080fd5b50511561164e576040805162461bcd60e51b815260206004820152600660248201526514185d5cd95960d21b604482015290519081900360640190fd5b60008054906101000a90046001600160a01b03166001600160a01b0316632e292fc76040518163ffffffff1660e01b815260040160206040518083038186803b15801561169a57600080fd5b505afa1580156116ae573d6000803e3d6000fd5b505050506040513d60208110156116c457600080fd5b50511561143f576040805162461bcd60e51b815260206004820152600e60248201526d14185c9d1a585b0b5c185d5cd95960921b604482015290519081900360640190fd5b6000611713611feb565b90506001600160a01b038116156117a4576040516307470bfb60e21b81526001600160a01b03821690631d1c2fec906117509085906004016122ab565b602060405180830381600087803b15801561176a57600080fd5b505af115801561177e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117a29190612241565b505b5050565b6000828211156117ff576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b60006118307f0000000000000000000000000000000000000000000000000000000000000000612012565b905090565b80156117a257826001600160a01b031663a9059cbb83836040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561189257600080fd5b505af11580156118a6573d6000803e3d6000fd5b505050506040513d60208110156118bc57600080fd5b50516117a2576040805162461bcd60e51b815260206004820152600960248201526810ba3930b739b332b960b91b604482015290519081900360640190fd5b60006118307f0000000000000000000000000000000000000000000000000000000000000000612012565b6000828152600f602090815260408083208151606081018352815480825260019092015463ffffffff811694820194909452600160201b9093046001600160a01b0316918301919091526119c657600d548310156119965760405162461bcd60e51b815260040161048e90612359565b600d546119be906119b6906104c96119ae87836117a8565b6001906114db565b600190611ad5565b9150506104d4565b8051611185906104c98561149188610ecb565b6000604051733d602d80600a3d3981f3363d3d373d3d3d363d7360601b81528260601b60148201526e5af43d82803e903d91602b57fd5bf360881b60288201526037816000f09150506001600160a01b038116610b07576040805162461bcd60e51b8152602060048201526016602482015275115490cc4c4d8dce8818dc99585d194819985a5b195960521b604482015290519081900360640190fd5b80156117a257604080516323b872dd60e01b81526001600160a01b038481166004830152306024830152604482018490529151918516916323b872dd916064808201926020929091908290030181600087803b15801561189257600080fd5b600082820183811015610d84576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b80156117a457816001600160a01b03166342966c68826040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561128c57600080fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6000611bab306120ae565b15905090565b620f424063ffffffff82161115611bda5760405162461bcd60e51b815260040161048e906126f7565b600c805463ffffffff191663ffffffff831617905560405160008051602061282883398151915290611c0b906125b9565b60405180910390a150565b80611c335760405162461bcd60e51b815260040161048e90612645565b600d81905560405160008051602061282883398151915290611c0b9061242c565b6001600160a01b038116611c7a5760405162461bcd60e51b815260040161048e906122eb565b611c83816120ae565b611c9f5760405162461bcd60e51b815260040161048e90612689565b600c805468010000000000000000600160e01b031916600160401b6001600160a01b0384160217905560405160008051602061282883398151915290611c0b90612754565b60008054906101000a90046001600160a01b03166001600160a01b0316634fc07d756040518163ffffffff1660e01b815260040160206040518083038186803b158015611d3057600080fd5b505afa158015611d44573d6000803e3d6000fd5b505050506040513d6020811015611d5a57600080fd5b50516001600160a01b0316331461143f576040805162461bcd60e51b815260206004820152601860248201527f4f6e6c7920436f6e74726f6c6c657220676f7665726e6f720000000000000000604482015290519081900360640190fd5b60006118307f0000000000000000000000000000000000000000000000000000000000000000612012565b6000546001600160a01b0316331461143f576040805162461bcd60e51b815260206004820152601960248201527f43616c6c6572206d75737420626520436f6e74726f6c6c657200000000000000604482015290519081900360640190fd5b6001600160a01b038116611e96576040805162461bcd60e51b815260206004820152601660248201527510dbdb9d1c9bdb1b195c881b5d5cdd081899481cd95d60521b604482015290519081900360640190fd5b600080546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f4ff638452bbf33c012645d18ae6f05515ff5f2d1dfb0cece8cbf018c60903f709181900360200190a150565b6000805460408051637bb20d2f60e11b81526004810185905290516001600160a01b039092169163f7641a5e91602480820192602092909190829003018186803b158015611f3757600080fd5b505afa158015611f4b573d6000803e3d6000fd5b505050506040513d6020811015611f6157600080fd5b50516000838152600160205260409020549091506001600160a01b038083169116146117a45760008281526001602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251908152915184927fd0e7a942b1fc38c411c4f53d153ba14fd24542a6a35ebacd9b6afca1a154e20692908290030190a25050565b60006118307f00000000000000000000000000000000000000000000000000000000000000005b6000818152600160205260408120546001600160a01b0316806104d45760005460408051637bb20d2f60e11b81526004810186905290516001600160a01b039092169163f7641a5e91602480820192602092909190829003018186803b15801561207b57600080fd5b505afa15801561208f573d6000803e3d6000fd5b505050506040513d60208110156120a557600080fd5b50519392505050565b3b151590565b803563ffffffff81168114610b0757600080fd5b6000602082840312156120d9578081fd5b8135610d8481612812565b600080600080608085870312156120f9578283fd5b843561210481612812565b9350602085013561211481612812565b9250612122604086016120b4565b9396929550929360600135925050565b60008060408385031215612144578182fd5b823561214f81612812565b946020939093013593505050565b60006020828403121561216e578081fd5b5035919050565b60008060408385031215612187578182fd5b50508035926020909101359150565b6000806000606084860312156121aa578283fd5b505081359360208301359350604090920135919050565b6000806000604084860312156121d5578283fd5b83356121e081612812565b9250602084013567ffffffffffffffff808211156121fc578384fd5b818601915086601f83011261220f578384fd5b81358181111561221d578485fd5b87602082850101111561222e578485fd5b6020830194508093505050509250925092565b600060208284031215612252578081fd5b5051919050565b60006020828403121561226a578081fd5b610d84826120b4565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b901515815260200190565b90815260200190565b60208082526017908201527f43616e6e6f74206275726e207a65726f207369676e616c000000000000000000604082015260600190565b6020808252601e908201527f546f6b656e206d6173746572206d757374206265206e6f6e2d656d7074790000604082015260600190565b6020808252601d908201527f43616e27742063616c63756c6174652077697468203020746f6b656e73000000604082015260600190565b6020808252602a908201527f4375726174696f6e206465706f7369742069732062656c6f77206d696e696d756040820152691b481c995c5d5a5c995960b21b606082015260800190565b6020808252601590820152742737ba1034b6b83632b6b2b73a32b21034b710261960591b604082015260600190565b60208082526013908201527264656661756c7452657365727665526174696f60681b604082015260600190565b60208082526013908201527229b634b83830b3b290383937ba32b1ba34b7b760691b604082015260600190565b6020808252601690820152751b5a5b9a5b5d5b50dd5c985d1a5bdb91195c1bdcda5d60521b604082015260600190565b60208082526033908201527f5375626772617068206465706c6f796d656e74206d757374206265206375726160408201527274656420746f20636f6c6c656374206665657360681b606082015260800190565b60208082526024908201527f43616e6e6f74206275726e206d6f7265207369676e616c207468616e20796f756040820152631037bbb760e11b606082015260800190565b60208082526043908201527f5369676e616c206d7573742062652061626f7665206f7220657175616c20746f60408201527f207369676e616c2069737375656420696e20746865206375726174696f6e20706060820152621bdbdb60ea1b608082015260a00190565b60208082526037908201527f43616c6c6572206d75737420626520746865207375626772617068207365727660408201527f696365206f72207374616b696e6720636f6e7472616374000000000000000000606082015260800190565b6020808252601590820152746375726174696f6e54617850657263656e7461676560581b604082015260600190565b6020808252603b908201527f5375626772617068206465706c6f796d656e74206d757374206265206375726160408201527f74656420746f20706572666f726d2063616c63756c6174696f6e730000000000606082015260800190565b60208082526024908201527f4d696e696d756d206375726174696f6e206465706f7369742063616e6e6f74206040820152630626520360e41b606082015260800190565b6020808252601f908201527f546f6b656e206d6173746572206d757374206265206120636f6e747261637400604082015260600190565b6020808252601a908201527f43616e6e6f74206465706f736974207a65726f20746f6b656e73000000000000604082015260600190565b60208082526039908201527f4375726174696f6e207461782070657263656e74616765206d7573742062652060408201527f62656c6f77206f7220657175616c20746f204d41585f50504d00000000000000606082015260800190565b60208082526013908201527231bab930ba34b7b72a37b5b2b726b0b9ba32b960691b604082015260600190565b6020808252601a908201527f4f6e6c792074686520474e532063616e2063616c6c2074686973000000000000604082015260600190565b918252602082015260400190565b9283526020830191909152604082015260600190565b92835263ffffffff9190911660208301526001600160a01b0316604082015260600190565b63ffffffff91909116815260200190565b6001600160a01b0381168114610cc157600080fdfe96d5a4b4edf1cefd0900c166d64447f8da1d01d1861a6a60894b5b82a2c15c3c496e697469616c697a61626c653a20636f6e747261637420697320616c726561647920696e697469616c697a6564536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a2646970667358221220182d4780700d3d385918c6f4a2bbe50d522f035098d04683e959156c3033203064736f6c63430007060033", + "linkReferences": {}, + "deployedLinkReferences": {} +} \ No newline at end of file diff --git a/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/L2GraphToken#GraphProxy.json b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/L2GraphToken#GraphProxy.json new file mode 100644 index 000000000..2cfb21e41 --- /dev/null +++ b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/L2GraphToken#GraphProxy.json @@ -0,0 +1,177 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "GraphProxy", + "sourceName": "contracts/upgrades/GraphProxy.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_impl", + "type": "address" + }, + { + "internalType": "address", + "name": "_admin", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldAdmin", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldImplementation", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "ImplementationUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldPendingImplementation", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newPendingImplementation", + "type": "address" + } + ], + "name": "PendingImplementationUpdated", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "acceptUpgrade", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "acceptUpgradeAndCall", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "pendingImplementation", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newAdmin", + "type": "address" + } + ], + "name": "setAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "bytecode": "0x608060405234801561001057600080fd5b50604051610a12380380610a128339818101604052604081101561003357600080fd5b50805160209091015161004581610055565b61004e826100b3565b5050610137565b600061005f610111565b6000805160206109d2833981519152838155604051919250906001600160a01b0380851691908416907f101b8081ff3b56bbf45deb824d86a3b0fd38b7e3dd42421105cf8abe9106db0b90600090a3505050565b60006100bd610124565b6000805160206109f2833981519152838155604051919250906001600160a01b0380851691908416907f980c0d30fe97457c47903527d88b7009a1643be6de24d2af664214919f0540a190600090a3505050565b6000805160206109d28339815191525490565b6000805160206109f28339815191525490565b61088c806101466000396000f3fe6080604052600436106100745760003560e01c80635c60da1b1161004e5780635c60da1b14610104578063623faf6114610119578063704b6c0214610196578063f851a440146101c957610083565b80633659cfe61461008b578063396f7b23146100be57806359fc20bb146100ef57610083565b36610083576100816101de565b005b6100816101de565b34801561009757600080fd5b50610081600480360360208110156100ae57600080fd5b50356001600160a01b031661029e565b3480156100ca57600080fd5b506100d36102d8565b604080516001600160a01b039092168252519081900360200190f35b3480156100fb57600080fd5b50610081610338565b34801561011057600080fd5b506100d3610393565b34801561012557600080fd5b506100816004803603602081101561013c57600080fd5b81019060208101813564010000000081111561015757600080fd5b82018360208201111561016957600080fd5b8035906020019184600183028401116401000000008311171561018b57600080fd5b5090925090506103e1565b3480156101a257600080fd5b50610081600480360360208110156101b957600080fd5b50356001600160a01b03166104f1565b3480156101d557600080fd5b506100d3610576565b6101e66105c0565b6001600160a01b0316336001600160a01b0316141561024c576040805162461bcd60e51b815260206004820152601f60248201527f43616e6e6f742066616c6c6261636b20746f2070726f78792074617267657400604482015290519081900360640190fd5b6040516001600160a01b037f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc541636600083376000803684845af490503d806000843e81801561029a578184f35b8184fd5b6102a66105c0565b6001600160a01b0316336001600160a01b031614156102cd576102c8816105e5565b6102d5565b6102d56101de565b50565b60006102e26105c0565b6001600160a01b0316336001600160a01b031614806103195750610304610655565b6001600160a01b0316336001600160a01b0316145b1561032d57610326610655565b9050610335565b6103356101de565b90565b6103406105c0565b6001600160a01b0316336001600160a01b031614806103775750610362610655565b6001600160a01b0316336001600160a01b0316145b156103895761038461067a565b610391565b6103916101de565b565b600061039d6105c0565b6001600160a01b0316336001600160a01b031614806103d457506103bf610655565b6001600160a01b0316336001600160a01b0316145b1561032d57610326610751565b6103e96105c0565b6001600160a01b0316336001600160a01b03161480610420575061040b610655565b6001600160a01b0316336001600160a01b0316145b156104e55761042d61067a565b6000610437610751565b6001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d8060008114610491576040519150601f19603f3d011682016040523d82523d6000602084013e610496565b606091505b50509050806104df576040805162461bcd60e51b815260206004820152601060248201526f125b5c1b0818d85b1b0819985a5b195960821b604482015290519081900360640190fd5b506104ed565b6104ed6101de565b5050565b6104f96105c0565b6001600160a01b0316336001600160a01b031614156102cd576001600160a01b03811661056d576040805162461bcd60e51b815260206004820152601e60248201527f41646d696e2063616e7420626520746865207a65726f20616464726573730000604482015290519081900360640190fd5b6102c881610776565b60006105806105c0565b6001600160a01b0316336001600160a01b031614806105b757506105a2610655565b6001600160a01b0316336001600160a01b0316145b1561032d576103265b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b60006105ef610655565b7f9e5eddc59e0b171f57125ab86bee043d9128098c3a6b9adb4f2e86333c2f6f8c838155604051919250906001600160a01b0380851691908416907f980c0d30fe97457c47903527d88b7009a1643be6de24d2af664214919f0540a190600090a3505050565b7f9e5eddc59e0b171f57125ab86bee043d9128098c3a6b9adb4f2e86333c2f6f8c5490565b6000610684610655565b90506001600160a01b0381166106e1576040805162461bcd60e51b815260206004820152601b60248201527f496d706c2063616e6e6f74206265207a65726f20616464726573730000000000604482015290519081900360640190fd5b336001600160a01b0382161461073e576040805162461bcd60e51b815260206004820152601b60248201527f4f6e6c792070656e64696e6720696d706c656d656e746174696f6e0000000000604482015290519081900360640190fd5b610747816107e6565b6102d560006105e5565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b60006107806105c0565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103838155604051919250906001600160a01b0380851691908416907f101b8081ff3b56bbf45deb824d86a3b0fd38b7e3dd42421105cf8abe9106db0b90600090a3505050565b60006107f0610751565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc838155604051919250906001600160a01b0380851691908416907faa3f731066a578e5f39b4215468d826cdd15373cbc0dfc9cb9bdc649718ef7da90600090a350505056fea264697066735822122041ce882775d17ef838c17f08249aa48a5f3ea1c65b581e69896452640b274de264736f6c63430007060033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61039e5eddc59e0b171f57125ab86bee043d9128098c3a6b9adb4f2e86333c2f6f8c", + "deployedBytecode": "0x6080604052600436106100745760003560e01c80635c60da1b1161004e5780635c60da1b14610104578063623faf6114610119578063704b6c0214610196578063f851a440146101c957610083565b80633659cfe61461008b578063396f7b23146100be57806359fc20bb146100ef57610083565b36610083576100816101de565b005b6100816101de565b34801561009757600080fd5b50610081600480360360208110156100ae57600080fd5b50356001600160a01b031661029e565b3480156100ca57600080fd5b506100d36102d8565b604080516001600160a01b039092168252519081900360200190f35b3480156100fb57600080fd5b50610081610338565b34801561011057600080fd5b506100d3610393565b34801561012557600080fd5b506100816004803603602081101561013c57600080fd5b81019060208101813564010000000081111561015757600080fd5b82018360208201111561016957600080fd5b8035906020019184600183028401116401000000008311171561018b57600080fd5b5090925090506103e1565b3480156101a257600080fd5b50610081600480360360208110156101b957600080fd5b50356001600160a01b03166104f1565b3480156101d557600080fd5b506100d3610576565b6101e66105c0565b6001600160a01b0316336001600160a01b0316141561024c576040805162461bcd60e51b815260206004820152601f60248201527f43616e6e6f742066616c6c6261636b20746f2070726f78792074617267657400604482015290519081900360640190fd5b6040516001600160a01b037f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc541636600083376000803684845af490503d806000843e81801561029a578184f35b8184fd5b6102a66105c0565b6001600160a01b0316336001600160a01b031614156102cd576102c8816105e5565b6102d5565b6102d56101de565b50565b60006102e26105c0565b6001600160a01b0316336001600160a01b031614806103195750610304610655565b6001600160a01b0316336001600160a01b0316145b1561032d57610326610655565b9050610335565b6103356101de565b90565b6103406105c0565b6001600160a01b0316336001600160a01b031614806103775750610362610655565b6001600160a01b0316336001600160a01b0316145b156103895761038461067a565b610391565b6103916101de565b565b600061039d6105c0565b6001600160a01b0316336001600160a01b031614806103d457506103bf610655565b6001600160a01b0316336001600160a01b0316145b1561032d57610326610751565b6103e96105c0565b6001600160a01b0316336001600160a01b03161480610420575061040b610655565b6001600160a01b0316336001600160a01b0316145b156104e55761042d61067a565b6000610437610751565b6001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d8060008114610491576040519150601f19603f3d011682016040523d82523d6000602084013e610496565b606091505b50509050806104df576040805162461bcd60e51b815260206004820152601060248201526f125b5c1b0818d85b1b0819985a5b195960821b604482015290519081900360640190fd5b506104ed565b6104ed6101de565b5050565b6104f96105c0565b6001600160a01b0316336001600160a01b031614156102cd576001600160a01b03811661056d576040805162461bcd60e51b815260206004820152601e60248201527f41646d696e2063616e7420626520746865207a65726f20616464726573730000604482015290519081900360640190fd5b6102c881610776565b60006105806105c0565b6001600160a01b0316336001600160a01b031614806105b757506105a2610655565b6001600160a01b0316336001600160a01b0316145b1561032d576103265b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b60006105ef610655565b7f9e5eddc59e0b171f57125ab86bee043d9128098c3a6b9adb4f2e86333c2f6f8c838155604051919250906001600160a01b0380851691908416907f980c0d30fe97457c47903527d88b7009a1643be6de24d2af664214919f0540a190600090a3505050565b7f9e5eddc59e0b171f57125ab86bee043d9128098c3a6b9adb4f2e86333c2f6f8c5490565b6000610684610655565b90506001600160a01b0381166106e1576040805162461bcd60e51b815260206004820152601b60248201527f496d706c2063616e6e6f74206265207a65726f20616464726573730000000000604482015290519081900360640190fd5b336001600160a01b0382161461073e576040805162461bcd60e51b815260206004820152601b60248201527f4f6e6c792070656e64696e6720696d706c656d656e746174696f6e0000000000604482015290519081900360640190fd5b610747816107e6565b6102d560006105e5565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b60006107806105c0565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103838155604051919250906001600160a01b0380851691908416907f101b8081ff3b56bbf45deb824d86a3b0fd38b7e3dd42421105cf8abe9106db0b90600090a3505050565b60006107f0610751565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc838155604051919250906001600160a01b0380851691908416907faa3f731066a578e5f39b4215468d826cdd15373cbc0dfc9cb9bdc649718ef7da90600090a350505056fea264697066735822122041ce882775d17ef838c17f08249aa48a5f3ea1c65b581e69896452640b274de264736f6c63430007060033", + "linkReferences": {}, + "deployedLinkReferences": {} +} \ No newline at end of file diff --git a/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/L2GraphToken#L2GraphToken.json b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/L2GraphToken#L2GraphToken.json new file mode 100644 index 000000000..5889eeaf0 --- /dev/null +++ b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/L2GraphToken#L2GraphToken.json @@ -0,0 +1,750 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "L2GraphToken", + "sourceName": "contracts/l2/token/L2GraphToken.sol", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "BridgeBurned", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "BridgeMinted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "gateway", + "type": "address" + } + ], + "name": "GatewaySet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "l1Address", + "type": "address" + } + ], + "name": "L1AddressSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "MinterAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "MinterRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "NewOwnership", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "NewPendingOwnership", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IGraphProxy", + "name": "_proxy", + "type": "address" + } + ], + "name": "acceptProxy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IGraphProxy", + "name": "_proxy", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "acceptProxyAndCall", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + } + ], + "name": "addMinter", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "bridgeBurn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "bridgeMint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "burnFrom", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "gateway", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_owner", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + } + ], + "name": "isMinter", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "l1Address", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "nonces", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingGovernor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_owner", + "type": "address" + }, + { + "internalType": "address", + "name": "_spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "_v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "_r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "_s", + "type": "bytes32" + } + ], + "name": "permit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + } + ], + "name": "removeMinter", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceMinter", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_gw", + "type": "address" + } + ], + "name": "setGateway", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_addr", + "type": "address" + } + ], + "name": "setL1Address", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newGovernor", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "bytecode": "0x6101206040527fd87cd6ef79d4e2b95e15ce8abf732db51ec771f1ca2edccf22a46c729ac564726080527fefcec85968da792893fa503eb21730083fc6c50ed5461e56163b28335b2a5f9660a0527f044852b2a670ade5407e78fb2863c51de9fcb96542a07186fe3aeda6bb8a116d60c0527fe33842a7acd1d5a1d28f25a931703e5605152dc48d64dc4716efdae1f565959160e0527f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9610100523480156100c657600080fd5b5060805160a05160c05160e0516101005161261e61010660003980611547525080611eae525080611e5e525080611e3d525080611e1c525061261e6000f3fe608060405234801561001057600080fd5b50600436106101fb5760003560e01c80638c2a993e1161011a578063a9059cbb116100ad578063ca52d7d71161007c578063ca52d7d71461067a578063d505accf146106a0578063dd62ed3e146106f1578063e3056a341461071f578063f2fde38b14610727576101fb565b8063a9059cbb146105fa578063aa271e1a14610626578063c2eeeebd1461064c578063c4d66de814610654576101fb565b806398650275116100e957806398650275146105205780639ce7abe514610528578063a2594d82146105a8578063a457c2d7146105ce576101fb565b80638c2a993e146104a057806390646b4a146104cc57806395d89b41146104f2578063983b2d56146104fa576101fb565b8063395093511161019257806374f4f5471161016157806374f4f5471461041a57806379ba50971461044657806379cc67901461044e5780637ecebe001461047a576101fb565b8063395093511461037f57806340c10f19146103ab57806342966c68146103d757806370a08231146103f4576101fb565b806318160ddd116101ce57806318160ddd146102e957806323b872dd146103035780633092afd514610339578063313ce56714610361576101fb565b806306fdde0314610200578063095ea7b31461027d5780630c340a24146102bd578063116191b6146102e1575b600080fd5b61020861074d565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561024257818101518382015260200161022a565b50505050905090810190601f16801561026f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102a96004803603604081101561029357600080fd5b506001600160a01b0381351690602001356107e3565b604080519115158252519081900360200190f35b6102c5610800565b604080516001600160a01b039092168252519081900360200190f35b6102c561080f565b6102f161081e565b60408051918252519081900360200190f35b6102a96004803603606081101561031957600080fd5b506001600160a01b03813581169160208101359091169060400135610824565b61035f6004803603602081101561034f57600080fd5b50356001600160a01b03166108ab565b005b610369610958565b6040805160ff9092168252519081900360200190f35b6102a96004803603604081101561039557600080fd5b506001600160a01b038135169060200135610961565b61035f600480360360408110156103c157600080fd5b506001600160a01b0381351690602001356109af565b61035f600480360360208110156103ed57600080fd5b5035610a0e565b6102f16004803603602081101561040a57600080fd5b50356001600160a01b0316610a1f565b61035f6004803603604081101561043057600080fd5b506001600160a01b038135169060200135610a3a565b61035f610ad4565b61035f6004803603604081101561046457600080fd5b506001600160a01b038135169060200135610be2565b6102f16004803603602081101561049057600080fd5b50356001600160a01b0316610c3c565b61035f600480360360408110156104b657600080fd5b506001600160a01b038135169060200135610c4e565b61035f600480360360208110156104e257600080fd5b50356001600160a01b0316610ce8565b610208610de1565b61035f6004803603602081101561051057600080fd5b50356001600160a01b0316610e42565b61035f610eef565b61035f6004803603604081101561053e57600080fd5b6001600160a01b03823516919081019060408101602082013564010000000081111561056957600080fd5b82018360208201111561057b57600080fd5b8035906020019184600183028401116401000000008311171561059d57600080fd5b509092509050610f43565b61035f600480360360208110156105be57600080fd5b50356001600160a01b0316611099565b6102a9600480360360408110156105e457600080fd5b506001600160a01b0381351690602001356111b4565b6102a96004803603604081101561061057600080fd5b506001600160a01b03813516906020013561121c565b6102a96004803603602081101561063c57600080fd5b50356001600160a01b0316611230565b6102c561124e565b61035f6004803603602081101561066a57600080fd5b50356001600160a01b031661125d565b61035f6004803603602081101561069057600080fd5b50356001600160a01b03166113d3565b61035f600480360360e08110156106b657600080fd5b506001600160a01b03813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c001356114cf565b6102f16004803603604081101561070757600080fd5b506001600160a01b0381358116916020013516611680565b6102c56116ab565b61035f6004803603602081101561073d57600080fd5b50356001600160a01b03166116ba565b60378054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156107d95780601f106107ae576101008083540402835291602001916107d9565b820191906000526020600020905b8154815290600101906020018083116107bc57829003601f168201915b5050505050905090565b60006107f76107f06117b8565b84846117bc565b50600192915050565b6000546001600160a01b031681565b60ca546001600160a01b031681565b60365490565b60006108318484846118a8565b6108a18461083d6117b8565b61089c8560405180606001604052806028815260200161250e602891396001600160a01b038a1660009081526035602052604081209061087b6117b8565b6001600160a01b031681526020810191909152604001600020549190611a05565b6117bc565b5060019392505050565b6000546001600160a01b03163314610903576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b61090c81611230565b61094c576040805162461bcd60e51b815260206004820152600c60248201526b2727aa2fa0afa6a4a72a22a960a11b604482015290519081900360640190fd5b61095581611a9c565b50565b60395460ff1690565b60006107f761096e6117b8565b8461089c856035600061097f6117b8565b6001600160a01b03908116825260208083019390935260409182016000908120918c168152925290205490611ae5565b6109b833611230565b610a00576040805162461bcd60e51b815260206004820152601460248201527313db9b1e481b5a5b9d195c8818d85b8818d85b1b60621b604482015290519081900360640190fd5b610a0a8282611b46565b5050565b610955610a196117b8565b82611c38565b6001600160a01b031660009081526034602052604090205490565b60ca546001600160a01b03163314610a87576040805162461bcd60e51b815260206004820152600b60248201526a4e4f545f4741544557415960a81b604482015290519081900360640190fd5b610a918282610be2565b6040805182815290516001600160a01b038416917fe87aeeb22c5753db7f543198a4c3089d2233040ea9d1cab0eaa3b96d94d4fc6e919081900360200190a25050565b6001546001600160a01b03168015801590610af75750336001600160a01b038216145b610b48576040805162461bcd60e51b815260206004820152601f60248201527f43616c6c6572206d7573742062652070656e64696e6720676f7665726e6f7200604482015290519081900360640190fd5b600080546001600160a01b038381166001600160a01b031980841691909117808555600180549092169091556040519282169391169183917f0ac6deed30eef60090c749850e10f2fa469e3e25fec1d1bef2853003f6e6f18f91a36001546040516001600160a01b03918216918416907f76563ad561b7036ae716b9b25cb521b21463240f104c97e12f25877f2235f33d90600090a35050565b6000610c198260405180606001604052806024815260200161253660249139610c1286610c0d6117b8565b611680565b9190611a05565b9050610c2d83610c276117b8565b836117bc565b610c378383611c38565b505050565b609a6020526000908152604090205481565b60ca546001600160a01b03163314610c9b576040805162461bcd60e51b815260206004820152600b60248201526a4e4f545f4741544557415960a81b604482015290519081900360640190fd5b610ca58282611b46565b6040805182815290516001600160a01b038416917fae4b6e741e38054ad6705655cc56c91c184f6768f76b41e10803e2766d89e19f919081900360200190a25050565b6000546001600160a01b03163314610d40576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b6001600160a01b038116610d8d576040805162461bcd60e51b815260206004820152600f60248201526e494e56414c49445f4741544557415960881b604482015290519081900360640190fd5b60ca80546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f5317fa585931182194fed99f2ea5f2efd38af9cff9724273704c8501c521e34b9181900360200190a150565b60388054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156107d95780601f106107ae576101008083540402835291602001916107d9565b6000546001600160a01b03163314610e9a576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b6001600160a01b038116610ee6576040805162461bcd60e51b815260206004820152600e60248201526d24a72b20a624a22fa6a4a72a22a960911b604482015290519081900360640190fd5b61095581611d34565b610ef833611230565b610f38576040805162461bcd60e51b815260206004820152600c60248201526b2727aa2fa0afa6a4a72a22a960a11b604482015290519081900360640190fd5b610f4133611a9c565b565b82806001600160a01b031663f851a4406040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610f7f57600080fd5b505af1158015610f93573d6000803e3d6000fd5b505050506040513d6020811015610fa957600080fd5b50516001600160a01b03163314611007576040805162461bcd60e51b815260206004820152601e60248201527f43616c6c6572206d757374206265207468652070726f78792061646d696e0000604482015290519081900360640190fd5b60405163623faf6160e01b8152602060048201908152602482018490526001600160a01b0386169163623faf619186918691908190604401848480828437600081840152601f19601f8201169050808301925050509350505050600060405180830381600087803b15801561107b57600080fd5b505af115801561108f573d6000803e3d6000fd5b5050505050505050565b80806001600160a01b031663f851a4406040518163ffffffff1660e01b8152600401602060405180830381600087803b1580156110d557600080fd5b505af11580156110e9573d6000803e3d6000fd5b505050506040513d60208110156110ff57600080fd5b50516001600160a01b0316331461115d576040805162461bcd60e51b815260206004820152601e60248201527f43616c6c6572206d757374206265207468652070726f78792061646d696e0000604482015290519081900360640190fd5b816001600160a01b03166359fc20bb6040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561119857600080fd5b505af11580156111ac573d6000803e3d6000fd5b505050505050565b60006107f76111c16117b8565b8461089c856040518060600160405280602581526020016125c460259139603560006111eb6117b8565b6001600160a01b03908116825260208083019390935260409182016000908120918d16815292529020549190611a05565b60006107f76112296117b8565b84846118a8565b6001600160a01b031660009081526099602052604090205460ff1690565b60cb546001600160a01b031681565b611265611d80565b6001600160a01b0316336001600160a01b0316146112c0576040805162461bcd60e51b815260206004820152601360248201527227b7363c9034b6b83632b6b2b73a30ba34b7b760691b604482015290519081900360640190fd5b600154600160a81b900460ff16806112db57506112db611da5565b806112f05750600154600160a01b900460ff16155b61132b5760405162461bcd60e51b815260040180806020018281038252602e8152602001806124be602e913960400191505060405180910390fd5b600154600160a81b900460ff16158015611362576001805460ff60a01b1960ff60a81b19909116600160a81b1716600160a01b1790555b6001600160a01b0382166113b1576040805162461bcd60e51b815260206004820152601160248201527013dddb995c881b5d5cdd081899481cd95d607a1b604482015290519081900360640190fd5b6113bc826000611db6565b8015610a0a576001805460ff60a81b191690555050565b6000546001600160a01b0316331461142b576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b6001600160a01b03811661147b576040805162461bcd60e51b8152602060048201526012602482015271494e56414c49445f4c315f4144445245535360701b604482015290519081900360640190fd5b60cb80546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f603c0b2e4494ac82839a70be8b6c660d7d042ccfe71c3ce0e5157f59090e74459181900360200190a150565b8315806114dc5750834211155b611523576040805162461bcd60e51b815260206004820152601360248201527211d4950e88195e1c1a5c9959081c195c9b5a5d606a1b604482015290519081900360640190fd5b6098546001600160a01b038089166000818152609a602090815260408083205481517f00000000000000000000000000000000000000000000000000000000000000008185015280830195909552948c166060850152608084018b905260a084019490945260c08084018a90528451808503909101815260e08401855280519082012061190160f01b61010085015261010284019590955261012280840195909552835180840390950185526101429092019092528251920191909120906115ed82868686611ef3565b9050806001600160a01b0316896001600160a01b03161461164b576040805162461bcd60e51b815260206004820152601360248201527211d4950e881a5b9d985b1a59081c195c9b5a5d606a1b604482015290519081900360640190fd5b6001600160a01b0389166000908152609a60205260409020805460010190556116758989896117bc565b505050505050505050565b6001600160a01b03918216600090815260356020908152604080832093909416825291909152205490565b6001546001600160a01b031681565b6000546001600160a01b03163314611712576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b6001600160a01b038116611764576040805162461bcd60e51b815260206004820152601460248201527311dbdd995c9b9bdc881b5d5cdd081899481cd95d60621b604482015290519081900360640190fd5b600180546001600160a01b038381166001600160a01b03198316179283905560405191811692169082907f76563ad561b7036ae716b9b25cb521b21463240f104c97e12f25877f2235f33d90600090a35050565b3390565b6001600160a01b0383166118015760405162461bcd60e51b81526004018080602001828103825260248152602001806125a06024913960400191505060405180910390fd5b6001600160a01b0382166118465760405162461bcd60e51b81526004018080602001828103825260228152602001806124546022913960400191505060405180910390fd5b6001600160a01b03808416600081815260356020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b0383166118ed5760405162461bcd60e51b815260040180806020018281038252602581526020018061257b6025913960400191505060405180910390fd5b6001600160a01b0382166119325760405162461bcd60e51b815260040180806020018281038252602381526020018061240f6023913960400191505060405180910390fd5b61193d838383610c37565b61197a81604051806060016040528060268152602001612476602691396001600160a01b0386166000908152603460205260409020549190611a05565b6001600160a01b0380851660009081526034602052604080822093909355908416815220546119a99082611ae5565b6001600160a01b0380841660008181526034602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b60008184841115611a945760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611a59578181015183820152602001611a41565b50505050905090810190601f168015611a865780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6001600160a01b038116600081815260996020526040808220805460ff19169055517fe94479a9f7e1952cc78f2d6baab678adc1b772d936c6583def489e524cb666929190a250565b600082820183811015611b3f576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b6001600160a01b038216611ba1576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b611bad60008383610c37565b603654611bba9082611ae5565b6036556001600160a01b038216600090815260346020526040902054611be09082611ae5565b6001600160a01b03831660008181526034602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6001600160a01b038216611c7d5760405162461bcd60e51b815260040180806020018281038252602181526020018061255a6021913960400191505060405180910390fd5b611c8982600083610c37565b611cc681604051806060016040528060228152602001612432602291396001600160a01b0385166000908152603460205260409020549190611a05565b6001600160a01b038316600090815260346020526040902055603654611cec9082612071565b6036556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b6001600160a01b038116600081815260996020526040808220805460ff19166001179055517f6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f69190a250565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6000611db0306120ce565b15905090565b611dfe6040518060400160405280600b81526020016a23b930b834102a37b5b2b760a91b8152506040518060400160405280600381526020016211d49560ea1b8152506120d4565b611e07826121a0565b611e118282611b46565b611e1a82611d34565b7f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000611e856121c2565b6040805160208082019690965280820194909452606084019290925260808301523060a08301527f000000000000000000000000000000000000000000000000000000000000000060c0808401919091528151808403909101815260e0909201905280519101206098555050565b60007f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0821115611f545760405162461bcd60e51b815260040180806020018281038252602281526020018061249c6022913960400191505060405180910390fd5b8360ff16601b1480611f6957508360ff16601c145b611fa45760405162461bcd60e51b81526004018080602001828103825260228152602001806124ec6022913960400191505060405180910390fd5b600060018686868660405160008152602001604052604051808581526020018460ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa158015612000573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116612068576040805162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015290519081900360640190fd5b95945050505050565b6000828211156120c8576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b3b151590565b600154600160a81b900460ff16806120ef57506120ef611da5565b806121045750600154600160a01b900460ff16155b61213f5760405162461bcd60e51b815260040180806020018281038252602e8152602001806124be602e913960400191505060405180910390fd5b600154600160a81b900460ff16158015612176576001805460ff60a01b1960ff60a81b19909116600160a81b1716600160a01b1790555b61217e6121c6565b612188838361227e565b8015610c37576001805460ff60a81b19169055505050565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b4690565b600154600160a81b900460ff16806121e157506121e1611da5565b806121f65750600154600160a01b900460ff16155b6122315760405162461bcd60e51b815260040180806020018281038252602e8152602001806124be602e913960400191505060405180910390fd5b600154600160a81b900460ff16158015612268576001805460ff60a01b1960ff60a81b19909116600160a81b1716600160a01b1790555b8015610955576001805460ff60a81b1916905550565b600154600160a81b900460ff16806122995750612299611da5565b806122ae5750600154600160a01b900460ff16155b6122e95760405162461bcd60e51b815260040180806020018281038252602e8152602001806124be602e913960400191505060405180910390fd5b600154600160a81b900460ff16158015612320576001805460ff60a01b1960ff60a81b19909116600160a81b1716600160a01b1790555b825161233390603790602086019061236d565b50815161234790603890602085019061236d565b506039805460ff191660121790558015610c37576001805460ff60a81b19169055505050565b828054600181600116156101000203166002900490600052602060002090601f0160209004810192826123a357600085556123e9565b82601f106123bc57805160ff19168380011785556123e9565b828001600101855582156123e9579182015b828111156123e95782518255916020019190600101906123ce565b506123f59291506123f9565b5090565b5b808211156123f557600081556001016123fa56fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545434453413a20696e76616c6964207369676e6174757265202773272076616c7565496e697469616c697a61626c653a20636f6e747261637420697320616c726561647920696e697469616c697a656445434453413a20696e76616c6964207369676e6174757265202776272076616c756545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e20616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220ff9ed43c1b257716d58111b6358b62039b7d7359bc9f0f142332535a4370cafe64736f6c63430007060033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101fb5760003560e01c80638c2a993e1161011a578063a9059cbb116100ad578063ca52d7d71161007c578063ca52d7d71461067a578063d505accf146106a0578063dd62ed3e146106f1578063e3056a341461071f578063f2fde38b14610727576101fb565b8063a9059cbb146105fa578063aa271e1a14610626578063c2eeeebd1461064c578063c4d66de814610654576101fb565b806398650275116100e957806398650275146105205780639ce7abe514610528578063a2594d82146105a8578063a457c2d7146105ce576101fb565b80638c2a993e146104a057806390646b4a146104cc57806395d89b41146104f2578063983b2d56146104fa576101fb565b8063395093511161019257806374f4f5471161016157806374f4f5471461041a57806379ba50971461044657806379cc67901461044e5780637ecebe001461047a576101fb565b8063395093511461037f57806340c10f19146103ab57806342966c68146103d757806370a08231146103f4576101fb565b806318160ddd116101ce57806318160ddd146102e957806323b872dd146103035780633092afd514610339578063313ce56714610361576101fb565b806306fdde0314610200578063095ea7b31461027d5780630c340a24146102bd578063116191b6146102e1575b600080fd5b61020861074d565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561024257818101518382015260200161022a565b50505050905090810190601f16801561026f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102a96004803603604081101561029357600080fd5b506001600160a01b0381351690602001356107e3565b604080519115158252519081900360200190f35b6102c5610800565b604080516001600160a01b039092168252519081900360200190f35b6102c561080f565b6102f161081e565b60408051918252519081900360200190f35b6102a96004803603606081101561031957600080fd5b506001600160a01b03813581169160208101359091169060400135610824565b61035f6004803603602081101561034f57600080fd5b50356001600160a01b03166108ab565b005b610369610958565b6040805160ff9092168252519081900360200190f35b6102a96004803603604081101561039557600080fd5b506001600160a01b038135169060200135610961565b61035f600480360360408110156103c157600080fd5b506001600160a01b0381351690602001356109af565b61035f600480360360208110156103ed57600080fd5b5035610a0e565b6102f16004803603602081101561040a57600080fd5b50356001600160a01b0316610a1f565b61035f6004803603604081101561043057600080fd5b506001600160a01b038135169060200135610a3a565b61035f610ad4565b61035f6004803603604081101561046457600080fd5b506001600160a01b038135169060200135610be2565b6102f16004803603602081101561049057600080fd5b50356001600160a01b0316610c3c565b61035f600480360360408110156104b657600080fd5b506001600160a01b038135169060200135610c4e565b61035f600480360360208110156104e257600080fd5b50356001600160a01b0316610ce8565b610208610de1565b61035f6004803603602081101561051057600080fd5b50356001600160a01b0316610e42565b61035f610eef565b61035f6004803603604081101561053e57600080fd5b6001600160a01b03823516919081019060408101602082013564010000000081111561056957600080fd5b82018360208201111561057b57600080fd5b8035906020019184600183028401116401000000008311171561059d57600080fd5b509092509050610f43565b61035f600480360360208110156105be57600080fd5b50356001600160a01b0316611099565b6102a9600480360360408110156105e457600080fd5b506001600160a01b0381351690602001356111b4565b6102a96004803603604081101561061057600080fd5b506001600160a01b03813516906020013561121c565b6102a96004803603602081101561063c57600080fd5b50356001600160a01b0316611230565b6102c561124e565b61035f6004803603602081101561066a57600080fd5b50356001600160a01b031661125d565b61035f6004803603602081101561069057600080fd5b50356001600160a01b03166113d3565b61035f600480360360e08110156106b657600080fd5b506001600160a01b03813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c001356114cf565b6102f16004803603604081101561070757600080fd5b506001600160a01b0381358116916020013516611680565b6102c56116ab565b61035f6004803603602081101561073d57600080fd5b50356001600160a01b03166116ba565b60378054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156107d95780601f106107ae576101008083540402835291602001916107d9565b820191906000526020600020905b8154815290600101906020018083116107bc57829003601f168201915b5050505050905090565b60006107f76107f06117b8565b84846117bc565b50600192915050565b6000546001600160a01b031681565b60ca546001600160a01b031681565b60365490565b60006108318484846118a8565b6108a18461083d6117b8565b61089c8560405180606001604052806028815260200161250e602891396001600160a01b038a1660009081526035602052604081209061087b6117b8565b6001600160a01b031681526020810191909152604001600020549190611a05565b6117bc565b5060019392505050565b6000546001600160a01b03163314610903576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b61090c81611230565b61094c576040805162461bcd60e51b815260206004820152600c60248201526b2727aa2fa0afa6a4a72a22a960a11b604482015290519081900360640190fd5b61095581611a9c565b50565b60395460ff1690565b60006107f761096e6117b8565b8461089c856035600061097f6117b8565b6001600160a01b03908116825260208083019390935260409182016000908120918c168152925290205490611ae5565b6109b833611230565b610a00576040805162461bcd60e51b815260206004820152601460248201527313db9b1e481b5a5b9d195c8818d85b8818d85b1b60621b604482015290519081900360640190fd5b610a0a8282611b46565b5050565b610955610a196117b8565b82611c38565b6001600160a01b031660009081526034602052604090205490565b60ca546001600160a01b03163314610a87576040805162461bcd60e51b815260206004820152600b60248201526a4e4f545f4741544557415960a81b604482015290519081900360640190fd5b610a918282610be2565b6040805182815290516001600160a01b038416917fe87aeeb22c5753db7f543198a4c3089d2233040ea9d1cab0eaa3b96d94d4fc6e919081900360200190a25050565b6001546001600160a01b03168015801590610af75750336001600160a01b038216145b610b48576040805162461bcd60e51b815260206004820152601f60248201527f43616c6c6572206d7573742062652070656e64696e6720676f7665726e6f7200604482015290519081900360640190fd5b600080546001600160a01b038381166001600160a01b031980841691909117808555600180549092169091556040519282169391169183917f0ac6deed30eef60090c749850e10f2fa469e3e25fec1d1bef2853003f6e6f18f91a36001546040516001600160a01b03918216918416907f76563ad561b7036ae716b9b25cb521b21463240f104c97e12f25877f2235f33d90600090a35050565b6000610c198260405180606001604052806024815260200161253660249139610c1286610c0d6117b8565b611680565b9190611a05565b9050610c2d83610c276117b8565b836117bc565b610c378383611c38565b505050565b609a6020526000908152604090205481565b60ca546001600160a01b03163314610c9b576040805162461bcd60e51b815260206004820152600b60248201526a4e4f545f4741544557415960a81b604482015290519081900360640190fd5b610ca58282611b46565b6040805182815290516001600160a01b038416917fae4b6e741e38054ad6705655cc56c91c184f6768f76b41e10803e2766d89e19f919081900360200190a25050565b6000546001600160a01b03163314610d40576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b6001600160a01b038116610d8d576040805162461bcd60e51b815260206004820152600f60248201526e494e56414c49445f4741544557415960881b604482015290519081900360640190fd5b60ca80546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f5317fa585931182194fed99f2ea5f2efd38af9cff9724273704c8501c521e34b9181900360200190a150565b60388054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156107d95780601f106107ae576101008083540402835291602001916107d9565b6000546001600160a01b03163314610e9a576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b6001600160a01b038116610ee6576040805162461bcd60e51b815260206004820152600e60248201526d24a72b20a624a22fa6a4a72a22a960911b604482015290519081900360640190fd5b61095581611d34565b610ef833611230565b610f38576040805162461bcd60e51b815260206004820152600c60248201526b2727aa2fa0afa6a4a72a22a960a11b604482015290519081900360640190fd5b610f4133611a9c565b565b82806001600160a01b031663f851a4406040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610f7f57600080fd5b505af1158015610f93573d6000803e3d6000fd5b505050506040513d6020811015610fa957600080fd5b50516001600160a01b03163314611007576040805162461bcd60e51b815260206004820152601e60248201527f43616c6c6572206d757374206265207468652070726f78792061646d696e0000604482015290519081900360640190fd5b60405163623faf6160e01b8152602060048201908152602482018490526001600160a01b0386169163623faf619186918691908190604401848480828437600081840152601f19601f8201169050808301925050509350505050600060405180830381600087803b15801561107b57600080fd5b505af115801561108f573d6000803e3d6000fd5b5050505050505050565b80806001600160a01b031663f851a4406040518163ffffffff1660e01b8152600401602060405180830381600087803b1580156110d557600080fd5b505af11580156110e9573d6000803e3d6000fd5b505050506040513d60208110156110ff57600080fd5b50516001600160a01b0316331461115d576040805162461bcd60e51b815260206004820152601e60248201527f43616c6c6572206d757374206265207468652070726f78792061646d696e0000604482015290519081900360640190fd5b816001600160a01b03166359fc20bb6040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561119857600080fd5b505af11580156111ac573d6000803e3d6000fd5b505050505050565b60006107f76111c16117b8565b8461089c856040518060600160405280602581526020016125c460259139603560006111eb6117b8565b6001600160a01b03908116825260208083019390935260409182016000908120918d16815292529020549190611a05565b60006107f76112296117b8565b84846118a8565b6001600160a01b031660009081526099602052604090205460ff1690565b60cb546001600160a01b031681565b611265611d80565b6001600160a01b0316336001600160a01b0316146112c0576040805162461bcd60e51b815260206004820152601360248201527227b7363c9034b6b83632b6b2b73a30ba34b7b760691b604482015290519081900360640190fd5b600154600160a81b900460ff16806112db57506112db611da5565b806112f05750600154600160a01b900460ff16155b61132b5760405162461bcd60e51b815260040180806020018281038252602e8152602001806124be602e913960400191505060405180910390fd5b600154600160a81b900460ff16158015611362576001805460ff60a01b1960ff60a81b19909116600160a81b1716600160a01b1790555b6001600160a01b0382166113b1576040805162461bcd60e51b815260206004820152601160248201527013dddb995c881b5d5cdd081899481cd95d607a1b604482015290519081900360640190fd5b6113bc826000611db6565b8015610a0a576001805460ff60a81b191690555050565b6000546001600160a01b0316331461142b576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b6001600160a01b03811661147b576040805162461bcd60e51b8152602060048201526012602482015271494e56414c49445f4c315f4144445245535360701b604482015290519081900360640190fd5b60cb80546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f603c0b2e4494ac82839a70be8b6c660d7d042ccfe71c3ce0e5157f59090e74459181900360200190a150565b8315806114dc5750834211155b611523576040805162461bcd60e51b815260206004820152601360248201527211d4950e88195e1c1a5c9959081c195c9b5a5d606a1b604482015290519081900360640190fd5b6098546001600160a01b038089166000818152609a602090815260408083205481517f00000000000000000000000000000000000000000000000000000000000000008185015280830195909552948c166060850152608084018b905260a084019490945260c08084018a90528451808503909101815260e08401855280519082012061190160f01b61010085015261010284019590955261012280840195909552835180840390950185526101429092019092528251920191909120906115ed82868686611ef3565b9050806001600160a01b0316896001600160a01b03161461164b576040805162461bcd60e51b815260206004820152601360248201527211d4950e881a5b9d985b1a59081c195c9b5a5d606a1b604482015290519081900360640190fd5b6001600160a01b0389166000908152609a60205260409020805460010190556116758989896117bc565b505050505050505050565b6001600160a01b03918216600090815260356020908152604080832093909416825291909152205490565b6001546001600160a01b031681565b6000546001600160a01b03163314611712576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b6001600160a01b038116611764576040805162461bcd60e51b815260206004820152601460248201527311dbdd995c9b9bdc881b5d5cdd081899481cd95d60621b604482015290519081900360640190fd5b600180546001600160a01b038381166001600160a01b03198316179283905560405191811692169082907f76563ad561b7036ae716b9b25cb521b21463240f104c97e12f25877f2235f33d90600090a35050565b3390565b6001600160a01b0383166118015760405162461bcd60e51b81526004018080602001828103825260248152602001806125a06024913960400191505060405180910390fd5b6001600160a01b0382166118465760405162461bcd60e51b81526004018080602001828103825260228152602001806124546022913960400191505060405180910390fd5b6001600160a01b03808416600081815260356020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b0383166118ed5760405162461bcd60e51b815260040180806020018281038252602581526020018061257b6025913960400191505060405180910390fd5b6001600160a01b0382166119325760405162461bcd60e51b815260040180806020018281038252602381526020018061240f6023913960400191505060405180910390fd5b61193d838383610c37565b61197a81604051806060016040528060268152602001612476602691396001600160a01b0386166000908152603460205260409020549190611a05565b6001600160a01b0380851660009081526034602052604080822093909355908416815220546119a99082611ae5565b6001600160a01b0380841660008181526034602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b60008184841115611a945760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611a59578181015183820152602001611a41565b50505050905090810190601f168015611a865780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6001600160a01b038116600081815260996020526040808220805460ff19169055517fe94479a9f7e1952cc78f2d6baab678adc1b772d936c6583def489e524cb666929190a250565b600082820183811015611b3f576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b6001600160a01b038216611ba1576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b611bad60008383610c37565b603654611bba9082611ae5565b6036556001600160a01b038216600090815260346020526040902054611be09082611ae5565b6001600160a01b03831660008181526034602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6001600160a01b038216611c7d5760405162461bcd60e51b815260040180806020018281038252602181526020018061255a6021913960400191505060405180910390fd5b611c8982600083610c37565b611cc681604051806060016040528060228152602001612432602291396001600160a01b0385166000908152603460205260409020549190611a05565b6001600160a01b038316600090815260346020526040902055603654611cec9082612071565b6036556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b6001600160a01b038116600081815260996020526040808220805460ff19166001179055517f6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f69190a250565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6000611db0306120ce565b15905090565b611dfe6040518060400160405280600b81526020016a23b930b834102a37b5b2b760a91b8152506040518060400160405280600381526020016211d49560ea1b8152506120d4565b611e07826121a0565b611e118282611b46565b611e1a82611d34565b7f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000611e856121c2565b6040805160208082019690965280820194909452606084019290925260808301523060a08301527f000000000000000000000000000000000000000000000000000000000000000060c0808401919091528151808403909101815260e0909201905280519101206098555050565b60007f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0821115611f545760405162461bcd60e51b815260040180806020018281038252602281526020018061249c6022913960400191505060405180910390fd5b8360ff16601b1480611f6957508360ff16601c145b611fa45760405162461bcd60e51b81526004018080602001828103825260228152602001806124ec6022913960400191505060405180910390fd5b600060018686868660405160008152602001604052604051808581526020018460ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa158015612000573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116612068576040805162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015290519081900360640190fd5b95945050505050565b6000828211156120c8576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b3b151590565b600154600160a81b900460ff16806120ef57506120ef611da5565b806121045750600154600160a01b900460ff16155b61213f5760405162461bcd60e51b815260040180806020018281038252602e8152602001806124be602e913960400191505060405180910390fd5b600154600160a81b900460ff16158015612176576001805460ff60a01b1960ff60a81b19909116600160a81b1716600160a01b1790555b61217e6121c6565b612188838361227e565b8015610c37576001805460ff60a81b19169055505050565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b4690565b600154600160a81b900460ff16806121e157506121e1611da5565b806121f65750600154600160a01b900460ff16155b6122315760405162461bcd60e51b815260040180806020018281038252602e8152602001806124be602e913960400191505060405180910390fd5b600154600160a81b900460ff16158015612268576001805460ff60a01b1960ff60a81b19909116600160a81b1716600160a01b1790555b8015610955576001805460ff60a81b1916905550565b600154600160a81b900460ff16806122995750612299611da5565b806122ae5750600154600160a01b900460ff16155b6122e95760405162461bcd60e51b815260040180806020018281038252602e8152602001806124be602e913960400191505060405180910390fd5b600154600160a81b900460ff16158015612320576001805460ff60a01b1960ff60a81b19909116600160a81b1716600160a01b1790555b825161233390603790602086019061236d565b50815161234790603890602085019061236d565b506039805460ff191660121790558015610c37576001805460ff60a81b19169055505050565b828054600181600116156101000203166002900490600052602060002090601f0160209004810192826123a357600085556123e9565b82601f106123bc57805160ff19168380011785556123e9565b828001600101855582156123e9579182015b828111156123e95782518255916020019190600101906123ce565b506123f59291506123f9565b5090565b5b808211156123f557600081556001016123fa56fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545434453413a20696e76616c6964207369676e6174757265202773272076616c7565496e697469616c697a61626c653a20636f6e747261637420697320616c726561647920696e697469616c697a656445434453413a20696e76616c6964207369676e6174757265202776272076616c756545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e20616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220ff9ed43c1b257716d58111b6358b62039b7d7359bc9f0f142332535a4370cafe64736f6c63430007060033", + "linkReferences": {}, + "deployedLinkReferences": {} +} \ No newline at end of file diff --git a/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/L2GraphToken#L2GraphToken_ProxyWithABI.json b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/L2GraphToken#L2GraphToken_ProxyWithABI.json new file mode 100644 index 000000000..5889eeaf0 --- /dev/null +++ b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/L2GraphToken#L2GraphToken_ProxyWithABI.json @@ -0,0 +1,750 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "L2GraphToken", + "sourceName": "contracts/l2/token/L2GraphToken.sol", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "BridgeBurned", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "BridgeMinted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "gateway", + "type": "address" + } + ], + "name": "GatewaySet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "l1Address", + "type": "address" + } + ], + "name": "L1AddressSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "MinterAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "MinterRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "NewOwnership", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "NewPendingOwnership", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IGraphProxy", + "name": "_proxy", + "type": "address" + } + ], + "name": "acceptProxy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IGraphProxy", + "name": "_proxy", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "acceptProxyAndCall", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + } + ], + "name": "addMinter", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "bridgeBurn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "bridgeMint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "burnFrom", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "gateway", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_owner", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + } + ], + "name": "isMinter", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "l1Address", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "nonces", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingGovernor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_owner", + "type": "address" + }, + { + "internalType": "address", + "name": "_spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "_v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "_r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "_s", + "type": "bytes32" + } + ], + "name": "permit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + } + ], + "name": "removeMinter", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceMinter", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_gw", + "type": "address" + } + ], + "name": "setGateway", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_addr", + "type": "address" + } + ], + "name": "setL1Address", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newGovernor", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "bytecode": "0x6101206040527fd87cd6ef79d4e2b95e15ce8abf732db51ec771f1ca2edccf22a46c729ac564726080527fefcec85968da792893fa503eb21730083fc6c50ed5461e56163b28335b2a5f9660a0527f044852b2a670ade5407e78fb2863c51de9fcb96542a07186fe3aeda6bb8a116d60c0527fe33842a7acd1d5a1d28f25a931703e5605152dc48d64dc4716efdae1f565959160e0527f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9610100523480156100c657600080fd5b5060805160a05160c05160e0516101005161261e61010660003980611547525080611eae525080611e5e525080611e3d525080611e1c525061261e6000f3fe608060405234801561001057600080fd5b50600436106101fb5760003560e01c80638c2a993e1161011a578063a9059cbb116100ad578063ca52d7d71161007c578063ca52d7d71461067a578063d505accf146106a0578063dd62ed3e146106f1578063e3056a341461071f578063f2fde38b14610727576101fb565b8063a9059cbb146105fa578063aa271e1a14610626578063c2eeeebd1461064c578063c4d66de814610654576101fb565b806398650275116100e957806398650275146105205780639ce7abe514610528578063a2594d82146105a8578063a457c2d7146105ce576101fb565b80638c2a993e146104a057806390646b4a146104cc57806395d89b41146104f2578063983b2d56146104fa576101fb565b8063395093511161019257806374f4f5471161016157806374f4f5471461041a57806379ba50971461044657806379cc67901461044e5780637ecebe001461047a576101fb565b8063395093511461037f57806340c10f19146103ab57806342966c68146103d757806370a08231146103f4576101fb565b806318160ddd116101ce57806318160ddd146102e957806323b872dd146103035780633092afd514610339578063313ce56714610361576101fb565b806306fdde0314610200578063095ea7b31461027d5780630c340a24146102bd578063116191b6146102e1575b600080fd5b61020861074d565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561024257818101518382015260200161022a565b50505050905090810190601f16801561026f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102a96004803603604081101561029357600080fd5b506001600160a01b0381351690602001356107e3565b604080519115158252519081900360200190f35b6102c5610800565b604080516001600160a01b039092168252519081900360200190f35b6102c561080f565b6102f161081e565b60408051918252519081900360200190f35b6102a96004803603606081101561031957600080fd5b506001600160a01b03813581169160208101359091169060400135610824565b61035f6004803603602081101561034f57600080fd5b50356001600160a01b03166108ab565b005b610369610958565b6040805160ff9092168252519081900360200190f35b6102a96004803603604081101561039557600080fd5b506001600160a01b038135169060200135610961565b61035f600480360360408110156103c157600080fd5b506001600160a01b0381351690602001356109af565b61035f600480360360208110156103ed57600080fd5b5035610a0e565b6102f16004803603602081101561040a57600080fd5b50356001600160a01b0316610a1f565b61035f6004803603604081101561043057600080fd5b506001600160a01b038135169060200135610a3a565b61035f610ad4565b61035f6004803603604081101561046457600080fd5b506001600160a01b038135169060200135610be2565b6102f16004803603602081101561049057600080fd5b50356001600160a01b0316610c3c565b61035f600480360360408110156104b657600080fd5b506001600160a01b038135169060200135610c4e565b61035f600480360360208110156104e257600080fd5b50356001600160a01b0316610ce8565b610208610de1565b61035f6004803603602081101561051057600080fd5b50356001600160a01b0316610e42565b61035f610eef565b61035f6004803603604081101561053e57600080fd5b6001600160a01b03823516919081019060408101602082013564010000000081111561056957600080fd5b82018360208201111561057b57600080fd5b8035906020019184600183028401116401000000008311171561059d57600080fd5b509092509050610f43565b61035f600480360360208110156105be57600080fd5b50356001600160a01b0316611099565b6102a9600480360360408110156105e457600080fd5b506001600160a01b0381351690602001356111b4565b6102a96004803603604081101561061057600080fd5b506001600160a01b03813516906020013561121c565b6102a96004803603602081101561063c57600080fd5b50356001600160a01b0316611230565b6102c561124e565b61035f6004803603602081101561066a57600080fd5b50356001600160a01b031661125d565b61035f6004803603602081101561069057600080fd5b50356001600160a01b03166113d3565b61035f600480360360e08110156106b657600080fd5b506001600160a01b03813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c001356114cf565b6102f16004803603604081101561070757600080fd5b506001600160a01b0381358116916020013516611680565b6102c56116ab565b61035f6004803603602081101561073d57600080fd5b50356001600160a01b03166116ba565b60378054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156107d95780601f106107ae576101008083540402835291602001916107d9565b820191906000526020600020905b8154815290600101906020018083116107bc57829003601f168201915b5050505050905090565b60006107f76107f06117b8565b84846117bc565b50600192915050565b6000546001600160a01b031681565b60ca546001600160a01b031681565b60365490565b60006108318484846118a8565b6108a18461083d6117b8565b61089c8560405180606001604052806028815260200161250e602891396001600160a01b038a1660009081526035602052604081209061087b6117b8565b6001600160a01b031681526020810191909152604001600020549190611a05565b6117bc565b5060019392505050565b6000546001600160a01b03163314610903576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b61090c81611230565b61094c576040805162461bcd60e51b815260206004820152600c60248201526b2727aa2fa0afa6a4a72a22a960a11b604482015290519081900360640190fd5b61095581611a9c565b50565b60395460ff1690565b60006107f761096e6117b8565b8461089c856035600061097f6117b8565b6001600160a01b03908116825260208083019390935260409182016000908120918c168152925290205490611ae5565b6109b833611230565b610a00576040805162461bcd60e51b815260206004820152601460248201527313db9b1e481b5a5b9d195c8818d85b8818d85b1b60621b604482015290519081900360640190fd5b610a0a8282611b46565b5050565b610955610a196117b8565b82611c38565b6001600160a01b031660009081526034602052604090205490565b60ca546001600160a01b03163314610a87576040805162461bcd60e51b815260206004820152600b60248201526a4e4f545f4741544557415960a81b604482015290519081900360640190fd5b610a918282610be2565b6040805182815290516001600160a01b038416917fe87aeeb22c5753db7f543198a4c3089d2233040ea9d1cab0eaa3b96d94d4fc6e919081900360200190a25050565b6001546001600160a01b03168015801590610af75750336001600160a01b038216145b610b48576040805162461bcd60e51b815260206004820152601f60248201527f43616c6c6572206d7573742062652070656e64696e6720676f7665726e6f7200604482015290519081900360640190fd5b600080546001600160a01b038381166001600160a01b031980841691909117808555600180549092169091556040519282169391169183917f0ac6deed30eef60090c749850e10f2fa469e3e25fec1d1bef2853003f6e6f18f91a36001546040516001600160a01b03918216918416907f76563ad561b7036ae716b9b25cb521b21463240f104c97e12f25877f2235f33d90600090a35050565b6000610c198260405180606001604052806024815260200161253660249139610c1286610c0d6117b8565b611680565b9190611a05565b9050610c2d83610c276117b8565b836117bc565b610c378383611c38565b505050565b609a6020526000908152604090205481565b60ca546001600160a01b03163314610c9b576040805162461bcd60e51b815260206004820152600b60248201526a4e4f545f4741544557415960a81b604482015290519081900360640190fd5b610ca58282611b46565b6040805182815290516001600160a01b038416917fae4b6e741e38054ad6705655cc56c91c184f6768f76b41e10803e2766d89e19f919081900360200190a25050565b6000546001600160a01b03163314610d40576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b6001600160a01b038116610d8d576040805162461bcd60e51b815260206004820152600f60248201526e494e56414c49445f4741544557415960881b604482015290519081900360640190fd5b60ca80546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f5317fa585931182194fed99f2ea5f2efd38af9cff9724273704c8501c521e34b9181900360200190a150565b60388054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156107d95780601f106107ae576101008083540402835291602001916107d9565b6000546001600160a01b03163314610e9a576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b6001600160a01b038116610ee6576040805162461bcd60e51b815260206004820152600e60248201526d24a72b20a624a22fa6a4a72a22a960911b604482015290519081900360640190fd5b61095581611d34565b610ef833611230565b610f38576040805162461bcd60e51b815260206004820152600c60248201526b2727aa2fa0afa6a4a72a22a960a11b604482015290519081900360640190fd5b610f4133611a9c565b565b82806001600160a01b031663f851a4406040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610f7f57600080fd5b505af1158015610f93573d6000803e3d6000fd5b505050506040513d6020811015610fa957600080fd5b50516001600160a01b03163314611007576040805162461bcd60e51b815260206004820152601e60248201527f43616c6c6572206d757374206265207468652070726f78792061646d696e0000604482015290519081900360640190fd5b60405163623faf6160e01b8152602060048201908152602482018490526001600160a01b0386169163623faf619186918691908190604401848480828437600081840152601f19601f8201169050808301925050509350505050600060405180830381600087803b15801561107b57600080fd5b505af115801561108f573d6000803e3d6000fd5b5050505050505050565b80806001600160a01b031663f851a4406040518163ffffffff1660e01b8152600401602060405180830381600087803b1580156110d557600080fd5b505af11580156110e9573d6000803e3d6000fd5b505050506040513d60208110156110ff57600080fd5b50516001600160a01b0316331461115d576040805162461bcd60e51b815260206004820152601e60248201527f43616c6c6572206d757374206265207468652070726f78792061646d696e0000604482015290519081900360640190fd5b816001600160a01b03166359fc20bb6040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561119857600080fd5b505af11580156111ac573d6000803e3d6000fd5b505050505050565b60006107f76111c16117b8565b8461089c856040518060600160405280602581526020016125c460259139603560006111eb6117b8565b6001600160a01b03908116825260208083019390935260409182016000908120918d16815292529020549190611a05565b60006107f76112296117b8565b84846118a8565b6001600160a01b031660009081526099602052604090205460ff1690565b60cb546001600160a01b031681565b611265611d80565b6001600160a01b0316336001600160a01b0316146112c0576040805162461bcd60e51b815260206004820152601360248201527227b7363c9034b6b83632b6b2b73a30ba34b7b760691b604482015290519081900360640190fd5b600154600160a81b900460ff16806112db57506112db611da5565b806112f05750600154600160a01b900460ff16155b61132b5760405162461bcd60e51b815260040180806020018281038252602e8152602001806124be602e913960400191505060405180910390fd5b600154600160a81b900460ff16158015611362576001805460ff60a01b1960ff60a81b19909116600160a81b1716600160a01b1790555b6001600160a01b0382166113b1576040805162461bcd60e51b815260206004820152601160248201527013dddb995c881b5d5cdd081899481cd95d607a1b604482015290519081900360640190fd5b6113bc826000611db6565b8015610a0a576001805460ff60a81b191690555050565b6000546001600160a01b0316331461142b576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b6001600160a01b03811661147b576040805162461bcd60e51b8152602060048201526012602482015271494e56414c49445f4c315f4144445245535360701b604482015290519081900360640190fd5b60cb80546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f603c0b2e4494ac82839a70be8b6c660d7d042ccfe71c3ce0e5157f59090e74459181900360200190a150565b8315806114dc5750834211155b611523576040805162461bcd60e51b815260206004820152601360248201527211d4950e88195e1c1a5c9959081c195c9b5a5d606a1b604482015290519081900360640190fd5b6098546001600160a01b038089166000818152609a602090815260408083205481517f00000000000000000000000000000000000000000000000000000000000000008185015280830195909552948c166060850152608084018b905260a084019490945260c08084018a90528451808503909101815260e08401855280519082012061190160f01b61010085015261010284019590955261012280840195909552835180840390950185526101429092019092528251920191909120906115ed82868686611ef3565b9050806001600160a01b0316896001600160a01b03161461164b576040805162461bcd60e51b815260206004820152601360248201527211d4950e881a5b9d985b1a59081c195c9b5a5d606a1b604482015290519081900360640190fd5b6001600160a01b0389166000908152609a60205260409020805460010190556116758989896117bc565b505050505050505050565b6001600160a01b03918216600090815260356020908152604080832093909416825291909152205490565b6001546001600160a01b031681565b6000546001600160a01b03163314611712576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b6001600160a01b038116611764576040805162461bcd60e51b815260206004820152601460248201527311dbdd995c9b9bdc881b5d5cdd081899481cd95d60621b604482015290519081900360640190fd5b600180546001600160a01b038381166001600160a01b03198316179283905560405191811692169082907f76563ad561b7036ae716b9b25cb521b21463240f104c97e12f25877f2235f33d90600090a35050565b3390565b6001600160a01b0383166118015760405162461bcd60e51b81526004018080602001828103825260248152602001806125a06024913960400191505060405180910390fd5b6001600160a01b0382166118465760405162461bcd60e51b81526004018080602001828103825260228152602001806124546022913960400191505060405180910390fd5b6001600160a01b03808416600081815260356020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b0383166118ed5760405162461bcd60e51b815260040180806020018281038252602581526020018061257b6025913960400191505060405180910390fd5b6001600160a01b0382166119325760405162461bcd60e51b815260040180806020018281038252602381526020018061240f6023913960400191505060405180910390fd5b61193d838383610c37565b61197a81604051806060016040528060268152602001612476602691396001600160a01b0386166000908152603460205260409020549190611a05565b6001600160a01b0380851660009081526034602052604080822093909355908416815220546119a99082611ae5565b6001600160a01b0380841660008181526034602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b60008184841115611a945760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611a59578181015183820152602001611a41565b50505050905090810190601f168015611a865780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6001600160a01b038116600081815260996020526040808220805460ff19169055517fe94479a9f7e1952cc78f2d6baab678adc1b772d936c6583def489e524cb666929190a250565b600082820183811015611b3f576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b6001600160a01b038216611ba1576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b611bad60008383610c37565b603654611bba9082611ae5565b6036556001600160a01b038216600090815260346020526040902054611be09082611ae5565b6001600160a01b03831660008181526034602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6001600160a01b038216611c7d5760405162461bcd60e51b815260040180806020018281038252602181526020018061255a6021913960400191505060405180910390fd5b611c8982600083610c37565b611cc681604051806060016040528060228152602001612432602291396001600160a01b0385166000908152603460205260409020549190611a05565b6001600160a01b038316600090815260346020526040902055603654611cec9082612071565b6036556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b6001600160a01b038116600081815260996020526040808220805460ff19166001179055517f6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f69190a250565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6000611db0306120ce565b15905090565b611dfe6040518060400160405280600b81526020016a23b930b834102a37b5b2b760a91b8152506040518060400160405280600381526020016211d49560ea1b8152506120d4565b611e07826121a0565b611e118282611b46565b611e1a82611d34565b7f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000611e856121c2565b6040805160208082019690965280820194909452606084019290925260808301523060a08301527f000000000000000000000000000000000000000000000000000000000000000060c0808401919091528151808403909101815260e0909201905280519101206098555050565b60007f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0821115611f545760405162461bcd60e51b815260040180806020018281038252602281526020018061249c6022913960400191505060405180910390fd5b8360ff16601b1480611f6957508360ff16601c145b611fa45760405162461bcd60e51b81526004018080602001828103825260228152602001806124ec6022913960400191505060405180910390fd5b600060018686868660405160008152602001604052604051808581526020018460ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa158015612000573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116612068576040805162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015290519081900360640190fd5b95945050505050565b6000828211156120c8576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b3b151590565b600154600160a81b900460ff16806120ef57506120ef611da5565b806121045750600154600160a01b900460ff16155b61213f5760405162461bcd60e51b815260040180806020018281038252602e8152602001806124be602e913960400191505060405180910390fd5b600154600160a81b900460ff16158015612176576001805460ff60a01b1960ff60a81b19909116600160a81b1716600160a01b1790555b61217e6121c6565b612188838361227e565b8015610c37576001805460ff60a81b19169055505050565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b4690565b600154600160a81b900460ff16806121e157506121e1611da5565b806121f65750600154600160a01b900460ff16155b6122315760405162461bcd60e51b815260040180806020018281038252602e8152602001806124be602e913960400191505060405180910390fd5b600154600160a81b900460ff16158015612268576001805460ff60a01b1960ff60a81b19909116600160a81b1716600160a01b1790555b8015610955576001805460ff60a81b1916905550565b600154600160a81b900460ff16806122995750612299611da5565b806122ae5750600154600160a01b900460ff16155b6122e95760405162461bcd60e51b815260040180806020018281038252602e8152602001806124be602e913960400191505060405180910390fd5b600154600160a81b900460ff16158015612320576001805460ff60a01b1960ff60a81b19909116600160a81b1716600160a01b1790555b825161233390603790602086019061236d565b50815161234790603890602085019061236d565b506039805460ff191660121790558015610c37576001805460ff60a81b19169055505050565b828054600181600116156101000203166002900490600052602060002090601f0160209004810192826123a357600085556123e9565b82601f106123bc57805160ff19168380011785556123e9565b828001600101855582156123e9579182015b828111156123e95782518255916020019190600101906123ce565b506123f59291506123f9565b5090565b5b808211156123f557600081556001016123fa56fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545434453413a20696e76616c6964207369676e6174757265202773272076616c7565496e697469616c697a61626c653a20636f6e747261637420697320616c726561647920696e697469616c697a656445434453413a20696e76616c6964207369676e6174757265202776272076616c756545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e20616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220ff9ed43c1b257716d58111b6358b62039b7d7359bc9f0f142332535a4370cafe64736f6c63430007060033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101fb5760003560e01c80638c2a993e1161011a578063a9059cbb116100ad578063ca52d7d71161007c578063ca52d7d71461067a578063d505accf146106a0578063dd62ed3e146106f1578063e3056a341461071f578063f2fde38b14610727576101fb565b8063a9059cbb146105fa578063aa271e1a14610626578063c2eeeebd1461064c578063c4d66de814610654576101fb565b806398650275116100e957806398650275146105205780639ce7abe514610528578063a2594d82146105a8578063a457c2d7146105ce576101fb565b80638c2a993e146104a057806390646b4a146104cc57806395d89b41146104f2578063983b2d56146104fa576101fb565b8063395093511161019257806374f4f5471161016157806374f4f5471461041a57806379ba50971461044657806379cc67901461044e5780637ecebe001461047a576101fb565b8063395093511461037f57806340c10f19146103ab57806342966c68146103d757806370a08231146103f4576101fb565b806318160ddd116101ce57806318160ddd146102e957806323b872dd146103035780633092afd514610339578063313ce56714610361576101fb565b806306fdde0314610200578063095ea7b31461027d5780630c340a24146102bd578063116191b6146102e1575b600080fd5b61020861074d565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561024257818101518382015260200161022a565b50505050905090810190601f16801561026f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102a96004803603604081101561029357600080fd5b506001600160a01b0381351690602001356107e3565b604080519115158252519081900360200190f35b6102c5610800565b604080516001600160a01b039092168252519081900360200190f35b6102c561080f565b6102f161081e565b60408051918252519081900360200190f35b6102a96004803603606081101561031957600080fd5b506001600160a01b03813581169160208101359091169060400135610824565b61035f6004803603602081101561034f57600080fd5b50356001600160a01b03166108ab565b005b610369610958565b6040805160ff9092168252519081900360200190f35b6102a96004803603604081101561039557600080fd5b506001600160a01b038135169060200135610961565b61035f600480360360408110156103c157600080fd5b506001600160a01b0381351690602001356109af565b61035f600480360360208110156103ed57600080fd5b5035610a0e565b6102f16004803603602081101561040a57600080fd5b50356001600160a01b0316610a1f565b61035f6004803603604081101561043057600080fd5b506001600160a01b038135169060200135610a3a565b61035f610ad4565b61035f6004803603604081101561046457600080fd5b506001600160a01b038135169060200135610be2565b6102f16004803603602081101561049057600080fd5b50356001600160a01b0316610c3c565b61035f600480360360408110156104b657600080fd5b506001600160a01b038135169060200135610c4e565b61035f600480360360208110156104e257600080fd5b50356001600160a01b0316610ce8565b610208610de1565b61035f6004803603602081101561051057600080fd5b50356001600160a01b0316610e42565b61035f610eef565b61035f6004803603604081101561053e57600080fd5b6001600160a01b03823516919081019060408101602082013564010000000081111561056957600080fd5b82018360208201111561057b57600080fd5b8035906020019184600183028401116401000000008311171561059d57600080fd5b509092509050610f43565b61035f600480360360208110156105be57600080fd5b50356001600160a01b0316611099565b6102a9600480360360408110156105e457600080fd5b506001600160a01b0381351690602001356111b4565b6102a96004803603604081101561061057600080fd5b506001600160a01b03813516906020013561121c565b6102a96004803603602081101561063c57600080fd5b50356001600160a01b0316611230565b6102c561124e565b61035f6004803603602081101561066a57600080fd5b50356001600160a01b031661125d565b61035f6004803603602081101561069057600080fd5b50356001600160a01b03166113d3565b61035f600480360360e08110156106b657600080fd5b506001600160a01b03813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c001356114cf565b6102f16004803603604081101561070757600080fd5b506001600160a01b0381358116916020013516611680565b6102c56116ab565b61035f6004803603602081101561073d57600080fd5b50356001600160a01b03166116ba565b60378054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156107d95780601f106107ae576101008083540402835291602001916107d9565b820191906000526020600020905b8154815290600101906020018083116107bc57829003601f168201915b5050505050905090565b60006107f76107f06117b8565b84846117bc565b50600192915050565b6000546001600160a01b031681565b60ca546001600160a01b031681565b60365490565b60006108318484846118a8565b6108a18461083d6117b8565b61089c8560405180606001604052806028815260200161250e602891396001600160a01b038a1660009081526035602052604081209061087b6117b8565b6001600160a01b031681526020810191909152604001600020549190611a05565b6117bc565b5060019392505050565b6000546001600160a01b03163314610903576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b61090c81611230565b61094c576040805162461bcd60e51b815260206004820152600c60248201526b2727aa2fa0afa6a4a72a22a960a11b604482015290519081900360640190fd5b61095581611a9c565b50565b60395460ff1690565b60006107f761096e6117b8565b8461089c856035600061097f6117b8565b6001600160a01b03908116825260208083019390935260409182016000908120918c168152925290205490611ae5565b6109b833611230565b610a00576040805162461bcd60e51b815260206004820152601460248201527313db9b1e481b5a5b9d195c8818d85b8818d85b1b60621b604482015290519081900360640190fd5b610a0a8282611b46565b5050565b610955610a196117b8565b82611c38565b6001600160a01b031660009081526034602052604090205490565b60ca546001600160a01b03163314610a87576040805162461bcd60e51b815260206004820152600b60248201526a4e4f545f4741544557415960a81b604482015290519081900360640190fd5b610a918282610be2565b6040805182815290516001600160a01b038416917fe87aeeb22c5753db7f543198a4c3089d2233040ea9d1cab0eaa3b96d94d4fc6e919081900360200190a25050565b6001546001600160a01b03168015801590610af75750336001600160a01b038216145b610b48576040805162461bcd60e51b815260206004820152601f60248201527f43616c6c6572206d7573742062652070656e64696e6720676f7665726e6f7200604482015290519081900360640190fd5b600080546001600160a01b038381166001600160a01b031980841691909117808555600180549092169091556040519282169391169183917f0ac6deed30eef60090c749850e10f2fa469e3e25fec1d1bef2853003f6e6f18f91a36001546040516001600160a01b03918216918416907f76563ad561b7036ae716b9b25cb521b21463240f104c97e12f25877f2235f33d90600090a35050565b6000610c198260405180606001604052806024815260200161253660249139610c1286610c0d6117b8565b611680565b9190611a05565b9050610c2d83610c276117b8565b836117bc565b610c378383611c38565b505050565b609a6020526000908152604090205481565b60ca546001600160a01b03163314610c9b576040805162461bcd60e51b815260206004820152600b60248201526a4e4f545f4741544557415960a81b604482015290519081900360640190fd5b610ca58282611b46565b6040805182815290516001600160a01b038416917fae4b6e741e38054ad6705655cc56c91c184f6768f76b41e10803e2766d89e19f919081900360200190a25050565b6000546001600160a01b03163314610d40576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b6001600160a01b038116610d8d576040805162461bcd60e51b815260206004820152600f60248201526e494e56414c49445f4741544557415960881b604482015290519081900360640190fd5b60ca80546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f5317fa585931182194fed99f2ea5f2efd38af9cff9724273704c8501c521e34b9181900360200190a150565b60388054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156107d95780601f106107ae576101008083540402835291602001916107d9565b6000546001600160a01b03163314610e9a576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b6001600160a01b038116610ee6576040805162461bcd60e51b815260206004820152600e60248201526d24a72b20a624a22fa6a4a72a22a960911b604482015290519081900360640190fd5b61095581611d34565b610ef833611230565b610f38576040805162461bcd60e51b815260206004820152600c60248201526b2727aa2fa0afa6a4a72a22a960a11b604482015290519081900360640190fd5b610f4133611a9c565b565b82806001600160a01b031663f851a4406040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610f7f57600080fd5b505af1158015610f93573d6000803e3d6000fd5b505050506040513d6020811015610fa957600080fd5b50516001600160a01b03163314611007576040805162461bcd60e51b815260206004820152601e60248201527f43616c6c6572206d757374206265207468652070726f78792061646d696e0000604482015290519081900360640190fd5b60405163623faf6160e01b8152602060048201908152602482018490526001600160a01b0386169163623faf619186918691908190604401848480828437600081840152601f19601f8201169050808301925050509350505050600060405180830381600087803b15801561107b57600080fd5b505af115801561108f573d6000803e3d6000fd5b5050505050505050565b80806001600160a01b031663f851a4406040518163ffffffff1660e01b8152600401602060405180830381600087803b1580156110d557600080fd5b505af11580156110e9573d6000803e3d6000fd5b505050506040513d60208110156110ff57600080fd5b50516001600160a01b0316331461115d576040805162461bcd60e51b815260206004820152601e60248201527f43616c6c6572206d757374206265207468652070726f78792061646d696e0000604482015290519081900360640190fd5b816001600160a01b03166359fc20bb6040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561119857600080fd5b505af11580156111ac573d6000803e3d6000fd5b505050505050565b60006107f76111c16117b8565b8461089c856040518060600160405280602581526020016125c460259139603560006111eb6117b8565b6001600160a01b03908116825260208083019390935260409182016000908120918d16815292529020549190611a05565b60006107f76112296117b8565b84846118a8565b6001600160a01b031660009081526099602052604090205460ff1690565b60cb546001600160a01b031681565b611265611d80565b6001600160a01b0316336001600160a01b0316146112c0576040805162461bcd60e51b815260206004820152601360248201527227b7363c9034b6b83632b6b2b73a30ba34b7b760691b604482015290519081900360640190fd5b600154600160a81b900460ff16806112db57506112db611da5565b806112f05750600154600160a01b900460ff16155b61132b5760405162461bcd60e51b815260040180806020018281038252602e8152602001806124be602e913960400191505060405180910390fd5b600154600160a81b900460ff16158015611362576001805460ff60a01b1960ff60a81b19909116600160a81b1716600160a01b1790555b6001600160a01b0382166113b1576040805162461bcd60e51b815260206004820152601160248201527013dddb995c881b5d5cdd081899481cd95d607a1b604482015290519081900360640190fd5b6113bc826000611db6565b8015610a0a576001805460ff60a81b191690555050565b6000546001600160a01b0316331461142b576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b6001600160a01b03811661147b576040805162461bcd60e51b8152602060048201526012602482015271494e56414c49445f4c315f4144445245535360701b604482015290519081900360640190fd5b60cb80546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f603c0b2e4494ac82839a70be8b6c660d7d042ccfe71c3ce0e5157f59090e74459181900360200190a150565b8315806114dc5750834211155b611523576040805162461bcd60e51b815260206004820152601360248201527211d4950e88195e1c1a5c9959081c195c9b5a5d606a1b604482015290519081900360640190fd5b6098546001600160a01b038089166000818152609a602090815260408083205481517f00000000000000000000000000000000000000000000000000000000000000008185015280830195909552948c166060850152608084018b905260a084019490945260c08084018a90528451808503909101815260e08401855280519082012061190160f01b61010085015261010284019590955261012280840195909552835180840390950185526101429092019092528251920191909120906115ed82868686611ef3565b9050806001600160a01b0316896001600160a01b03161461164b576040805162461bcd60e51b815260206004820152601360248201527211d4950e881a5b9d985b1a59081c195c9b5a5d606a1b604482015290519081900360640190fd5b6001600160a01b0389166000908152609a60205260409020805460010190556116758989896117bc565b505050505050505050565b6001600160a01b03918216600090815260356020908152604080832093909416825291909152205490565b6001546001600160a01b031681565b6000546001600160a01b03163314611712576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b6001600160a01b038116611764576040805162461bcd60e51b815260206004820152601460248201527311dbdd995c9b9bdc881b5d5cdd081899481cd95d60621b604482015290519081900360640190fd5b600180546001600160a01b038381166001600160a01b03198316179283905560405191811692169082907f76563ad561b7036ae716b9b25cb521b21463240f104c97e12f25877f2235f33d90600090a35050565b3390565b6001600160a01b0383166118015760405162461bcd60e51b81526004018080602001828103825260248152602001806125a06024913960400191505060405180910390fd5b6001600160a01b0382166118465760405162461bcd60e51b81526004018080602001828103825260228152602001806124546022913960400191505060405180910390fd5b6001600160a01b03808416600081815260356020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b0383166118ed5760405162461bcd60e51b815260040180806020018281038252602581526020018061257b6025913960400191505060405180910390fd5b6001600160a01b0382166119325760405162461bcd60e51b815260040180806020018281038252602381526020018061240f6023913960400191505060405180910390fd5b61193d838383610c37565b61197a81604051806060016040528060268152602001612476602691396001600160a01b0386166000908152603460205260409020549190611a05565b6001600160a01b0380851660009081526034602052604080822093909355908416815220546119a99082611ae5565b6001600160a01b0380841660008181526034602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b60008184841115611a945760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611a59578181015183820152602001611a41565b50505050905090810190601f168015611a865780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6001600160a01b038116600081815260996020526040808220805460ff19169055517fe94479a9f7e1952cc78f2d6baab678adc1b772d936c6583def489e524cb666929190a250565b600082820183811015611b3f576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b6001600160a01b038216611ba1576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b611bad60008383610c37565b603654611bba9082611ae5565b6036556001600160a01b038216600090815260346020526040902054611be09082611ae5565b6001600160a01b03831660008181526034602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6001600160a01b038216611c7d5760405162461bcd60e51b815260040180806020018281038252602181526020018061255a6021913960400191505060405180910390fd5b611c8982600083610c37565b611cc681604051806060016040528060228152602001612432602291396001600160a01b0385166000908152603460205260409020549190611a05565b6001600160a01b038316600090815260346020526040902055603654611cec9082612071565b6036556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b6001600160a01b038116600081815260996020526040808220805460ff19166001179055517f6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f69190a250565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6000611db0306120ce565b15905090565b611dfe6040518060400160405280600b81526020016a23b930b834102a37b5b2b760a91b8152506040518060400160405280600381526020016211d49560ea1b8152506120d4565b611e07826121a0565b611e118282611b46565b611e1a82611d34565b7f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000611e856121c2565b6040805160208082019690965280820194909452606084019290925260808301523060a08301527f000000000000000000000000000000000000000000000000000000000000000060c0808401919091528151808403909101815260e0909201905280519101206098555050565b60007f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0821115611f545760405162461bcd60e51b815260040180806020018281038252602281526020018061249c6022913960400191505060405180910390fd5b8360ff16601b1480611f6957508360ff16601c145b611fa45760405162461bcd60e51b81526004018080602001828103825260228152602001806124ec6022913960400191505060405180910390fd5b600060018686868660405160008152602001604052604051808581526020018460ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa158015612000573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116612068576040805162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015290519081900360640190fd5b95945050505050565b6000828211156120c8576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b3b151590565b600154600160a81b900460ff16806120ef57506120ef611da5565b806121045750600154600160a01b900460ff16155b61213f5760405162461bcd60e51b815260040180806020018281038252602e8152602001806124be602e913960400191505060405180910390fd5b600154600160a81b900460ff16158015612176576001805460ff60a01b1960ff60a81b19909116600160a81b1716600160a01b1790555b61217e6121c6565b612188838361227e565b8015610c37576001805460ff60a81b19169055505050565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b4690565b600154600160a81b900460ff16806121e157506121e1611da5565b806121f65750600154600160a01b900460ff16155b6122315760405162461bcd60e51b815260040180806020018281038252602e8152602001806124be602e913960400191505060405180910390fd5b600154600160a81b900460ff16158015612268576001805460ff60a01b1960ff60a81b19909116600160a81b1716600160a01b1790555b8015610955576001805460ff60a81b1916905550565b600154600160a81b900460ff16806122995750612299611da5565b806122ae5750600154600160a01b900460ff16155b6122e95760405162461bcd60e51b815260040180806020018281038252602e8152602001806124be602e913960400191505060405180910390fd5b600154600160a81b900460ff16158015612320576001805460ff60a01b1960ff60a81b19909116600160a81b1716600160a01b1790555b825161233390603790602086019061236d565b50815161234790603890602085019061236d565b506039805460ff191660121790558015610c37576001805460ff60a81b19169055505050565b828054600181600116156101000203166002900490600052602060002090601f0160209004810192826123a357600085556123e9565b82601f106123bc57805160ff19168380011785556123e9565b828001600101855582156123e9579182015b828111156123e95782518255916020019190600101906123ce565b506123f59291506123f9565b5090565b5b808211156123f557600081556001016123fa56fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545434453413a20696e76616c6964207369676e6174757265202773272076616c7565496e697469616c697a61626c653a20636f6e747261637420697320616c726561647920696e697469616c697a656445434453413a20696e76616c6964207369676e6174757265202776272076616c756545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e20616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220ff9ed43c1b257716d58111b6358b62039b7d7359bc9f0f142332535a4370cafe64736f6c63430007060033", + "linkReferences": {}, + "deployedLinkReferences": {} +} \ No newline at end of file diff --git a/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/L2GraphTokenGateway#GraphProxy.json b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/L2GraphTokenGateway#GraphProxy.json new file mode 100644 index 000000000..2cfb21e41 --- /dev/null +++ b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/L2GraphTokenGateway#GraphProxy.json @@ -0,0 +1,177 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "GraphProxy", + "sourceName": "contracts/upgrades/GraphProxy.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_impl", + "type": "address" + }, + { + "internalType": "address", + "name": "_admin", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldAdmin", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldImplementation", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "ImplementationUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldPendingImplementation", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newPendingImplementation", + "type": "address" + } + ], + "name": "PendingImplementationUpdated", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "acceptUpgrade", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "acceptUpgradeAndCall", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "pendingImplementation", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newAdmin", + "type": "address" + } + ], + "name": "setAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "bytecode": "0x608060405234801561001057600080fd5b50604051610a12380380610a128339818101604052604081101561003357600080fd5b50805160209091015161004581610055565b61004e826100b3565b5050610137565b600061005f610111565b6000805160206109d2833981519152838155604051919250906001600160a01b0380851691908416907f101b8081ff3b56bbf45deb824d86a3b0fd38b7e3dd42421105cf8abe9106db0b90600090a3505050565b60006100bd610124565b6000805160206109f2833981519152838155604051919250906001600160a01b0380851691908416907f980c0d30fe97457c47903527d88b7009a1643be6de24d2af664214919f0540a190600090a3505050565b6000805160206109d28339815191525490565b6000805160206109f28339815191525490565b61088c806101466000396000f3fe6080604052600436106100745760003560e01c80635c60da1b1161004e5780635c60da1b14610104578063623faf6114610119578063704b6c0214610196578063f851a440146101c957610083565b80633659cfe61461008b578063396f7b23146100be57806359fc20bb146100ef57610083565b36610083576100816101de565b005b6100816101de565b34801561009757600080fd5b50610081600480360360208110156100ae57600080fd5b50356001600160a01b031661029e565b3480156100ca57600080fd5b506100d36102d8565b604080516001600160a01b039092168252519081900360200190f35b3480156100fb57600080fd5b50610081610338565b34801561011057600080fd5b506100d3610393565b34801561012557600080fd5b506100816004803603602081101561013c57600080fd5b81019060208101813564010000000081111561015757600080fd5b82018360208201111561016957600080fd5b8035906020019184600183028401116401000000008311171561018b57600080fd5b5090925090506103e1565b3480156101a257600080fd5b50610081600480360360208110156101b957600080fd5b50356001600160a01b03166104f1565b3480156101d557600080fd5b506100d3610576565b6101e66105c0565b6001600160a01b0316336001600160a01b0316141561024c576040805162461bcd60e51b815260206004820152601f60248201527f43616e6e6f742066616c6c6261636b20746f2070726f78792074617267657400604482015290519081900360640190fd5b6040516001600160a01b037f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc541636600083376000803684845af490503d806000843e81801561029a578184f35b8184fd5b6102a66105c0565b6001600160a01b0316336001600160a01b031614156102cd576102c8816105e5565b6102d5565b6102d56101de565b50565b60006102e26105c0565b6001600160a01b0316336001600160a01b031614806103195750610304610655565b6001600160a01b0316336001600160a01b0316145b1561032d57610326610655565b9050610335565b6103356101de565b90565b6103406105c0565b6001600160a01b0316336001600160a01b031614806103775750610362610655565b6001600160a01b0316336001600160a01b0316145b156103895761038461067a565b610391565b6103916101de565b565b600061039d6105c0565b6001600160a01b0316336001600160a01b031614806103d457506103bf610655565b6001600160a01b0316336001600160a01b0316145b1561032d57610326610751565b6103e96105c0565b6001600160a01b0316336001600160a01b03161480610420575061040b610655565b6001600160a01b0316336001600160a01b0316145b156104e55761042d61067a565b6000610437610751565b6001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d8060008114610491576040519150601f19603f3d011682016040523d82523d6000602084013e610496565b606091505b50509050806104df576040805162461bcd60e51b815260206004820152601060248201526f125b5c1b0818d85b1b0819985a5b195960821b604482015290519081900360640190fd5b506104ed565b6104ed6101de565b5050565b6104f96105c0565b6001600160a01b0316336001600160a01b031614156102cd576001600160a01b03811661056d576040805162461bcd60e51b815260206004820152601e60248201527f41646d696e2063616e7420626520746865207a65726f20616464726573730000604482015290519081900360640190fd5b6102c881610776565b60006105806105c0565b6001600160a01b0316336001600160a01b031614806105b757506105a2610655565b6001600160a01b0316336001600160a01b0316145b1561032d576103265b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b60006105ef610655565b7f9e5eddc59e0b171f57125ab86bee043d9128098c3a6b9adb4f2e86333c2f6f8c838155604051919250906001600160a01b0380851691908416907f980c0d30fe97457c47903527d88b7009a1643be6de24d2af664214919f0540a190600090a3505050565b7f9e5eddc59e0b171f57125ab86bee043d9128098c3a6b9adb4f2e86333c2f6f8c5490565b6000610684610655565b90506001600160a01b0381166106e1576040805162461bcd60e51b815260206004820152601b60248201527f496d706c2063616e6e6f74206265207a65726f20616464726573730000000000604482015290519081900360640190fd5b336001600160a01b0382161461073e576040805162461bcd60e51b815260206004820152601b60248201527f4f6e6c792070656e64696e6720696d706c656d656e746174696f6e0000000000604482015290519081900360640190fd5b610747816107e6565b6102d560006105e5565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b60006107806105c0565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103838155604051919250906001600160a01b0380851691908416907f101b8081ff3b56bbf45deb824d86a3b0fd38b7e3dd42421105cf8abe9106db0b90600090a3505050565b60006107f0610751565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc838155604051919250906001600160a01b0380851691908416907faa3f731066a578e5f39b4215468d826cdd15373cbc0dfc9cb9bdc649718ef7da90600090a350505056fea264697066735822122041ce882775d17ef838c17f08249aa48a5f3ea1c65b581e69896452640b274de264736f6c63430007060033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61039e5eddc59e0b171f57125ab86bee043d9128098c3a6b9adb4f2e86333c2f6f8c", + "deployedBytecode": "0x6080604052600436106100745760003560e01c80635c60da1b1161004e5780635c60da1b14610104578063623faf6114610119578063704b6c0214610196578063f851a440146101c957610083565b80633659cfe61461008b578063396f7b23146100be57806359fc20bb146100ef57610083565b36610083576100816101de565b005b6100816101de565b34801561009757600080fd5b50610081600480360360208110156100ae57600080fd5b50356001600160a01b031661029e565b3480156100ca57600080fd5b506100d36102d8565b604080516001600160a01b039092168252519081900360200190f35b3480156100fb57600080fd5b50610081610338565b34801561011057600080fd5b506100d3610393565b34801561012557600080fd5b506100816004803603602081101561013c57600080fd5b81019060208101813564010000000081111561015757600080fd5b82018360208201111561016957600080fd5b8035906020019184600183028401116401000000008311171561018b57600080fd5b5090925090506103e1565b3480156101a257600080fd5b50610081600480360360208110156101b957600080fd5b50356001600160a01b03166104f1565b3480156101d557600080fd5b506100d3610576565b6101e66105c0565b6001600160a01b0316336001600160a01b0316141561024c576040805162461bcd60e51b815260206004820152601f60248201527f43616e6e6f742066616c6c6261636b20746f2070726f78792074617267657400604482015290519081900360640190fd5b6040516001600160a01b037f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc541636600083376000803684845af490503d806000843e81801561029a578184f35b8184fd5b6102a66105c0565b6001600160a01b0316336001600160a01b031614156102cd576102c8816105e5565b6102d5565b6102d56101de565b50565b60006102e26105c0565b6001600160a01b0316336001600160a01b031614806103195750610304610655565b6001600160a01b0316336001600160a01b0316145b1561032d57610326610655565b9050610335565b6103356101de565b90565b6103406105c0565b6001600160a01b0316336001600160a01b031614806103775750610362610655565b6001600160a01b0316336001600160a01b0316145b156103895761038461067a565b610391565b6103916101de565b565b600061039d6105c0565b6001600160a01b0316336001600160a01b031614806103d457506103bf610655565b6001600160a01b0316336001600160a01b0316145b1561032d57610326610751565b6103e96105c0565b6001600160a01b0316336001600160a01b03161480610420575061040b610655565b6001600160a01b0316336001600160a01b0316145b156104e55761042d61067a565b6000610437610751565b6001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d8060008114610491576040519150601f19603f3d011682016040523d82523d6000602084013e610496565b606091505b50509050806104df576040805162461bcd60e51b815260206004820152601060248201526f125b5c1b0818d85b1b0819985a5b195960821b604482015290519081900360640190fd5b506104ed565b6104ed6101de565b5050565b6104f96105c0565b6001600160a01b0316336001600160a01b031614156102cd576001600160a01b03811661056d576040805162461bcd60e51b815260206004820152601e60248201527f41646d696e2063616e7420626520746865207a65726f20616464726573730000604482015290519081900360640190fd5b6102c881610776565b60006105806105c0565b6001600160a01b0316336001600160a01b031614806105b757506105a2610655565b6001600160a01b0316336001600160a01b0316145b1561032d576103265b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b60006105ef610655565b7f9e5eddc59e0b171f57125ab86bee043d9128098c3a6b9adb4f2e86333c2f6f8c838155604051919250906001600160a01b0380851691908416907f980c0d30fe97457c47903527d88b7009a1643be6de24d2af664214919f0540a190600090a3505050565b7f9e5eddc59e0b171f57125ab86bee043d9128098c3a6b9adb4f2e86333c2f6f8c5490565b6000610684610655565b90506001600160a01b0381166106e1576040805162461bcd60e51b815260206004820152601b60248201527f496d706c2063616e6e6f74206265207a65726f20616464726573730000000000604482015290519081900360640190fd5b336001600160a01b0382161461073e576040805162461bcd60e51b815260206004820152601b60248201527f4f6e6c792070656e64696e6720696d706c656d656e746174696f6e0000000000604482015290519081900360640190fd5b610747816107e6565b6102d560006105e5565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b60006107806105c0565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103838155604051919250906001600160a01b0380851691908416907f101b8081ff3b56bbf45deb824d86a3b0fd38b7e3dd42421105cf8abe9106db0b90600090a3505050565b60006107f0610751565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc838155604051919250906001600160a01b0380851691908416907faa3f731066a578e5f39b4215468d826cdd15373cbc0dfc9cb9bdc649718ef7da90600090a350505056fea264697066735822122041ce882775d17ef838c17f08249aa48a5f3ea1c65b581e69896452640b274de264736f6c63430007060033", + "linkReferences": {}, + "deployedLinkReferences": {} +} \ No newline at end of file diff --git a/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/L2GraphTokenGateway#L2GraphTokenGateway.json b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/L2GraphTokenGateway#L2GraphTokenGateway.json new file mode 100644 index 000000000..0a9b3a140 --- /dev/null +++ b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/L2GraphTokenGateway#L2GraphTokenGateway.json @@ -0,0 +1,647 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "L2GraphTokenGateway", + "sourceName": "contracts/l2/gateway/L2GraphTokenGateway.sol", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "nameHash", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "contractAddress", + "type": "address" + } + ], + "name": "ContractSynced", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "l1Token", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "DepositFinalized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "l1Counterpart", + "type": "address" + } + ], + "name": "L1CounterpartAddressSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "l1GRT", + "type": "address" + } + ], + "name": "L1TokenAddressSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "l2Router", + "type": "address" + } + ], + "name": "L2RouterSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldPauseGuardian", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "pauseGuardian", + "type": "address" + } + ], + "name": "NewPauseGuardian", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "param", + "type": "string" + } + ], + "name": "ParameterUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "isPaused", + "type": "bool" + } + ], + "name": "PartialPauseChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "isPaused", + "type": "bool" + } + ], + "name": "PauseChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "controller", + "type": "address" + } + ], + "name": "SetController", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_id", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "TxToL1", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "l1Token", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "l2ToL1Id", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "exitNum", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "WithdrawalInitiated", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "contract IGraphProxy", + "name": "_proxy", + "type": "address" + } + ], + "name": "acceptProxy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IGraphProxy", + "name": "_proxy", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "acceptProxyAndCall", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "l1ERC20", + "type": "address" + } + ], + "name": "calculateL2TokenAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "controller", + "outputs": [ + { + "internalType": "contract IController", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_l1Token", + "type": "address" + }, + { + "internalType": "address", + "name": "_from", + "type": "address" + }, + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "finalizeInboundTransfer", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "address", + "name": "_from", + "type": "address" + }, + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "getOutboundCalldata", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_controller", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "l1Counterpart", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "l1GRT", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "l2Router", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "lastPartialPauseTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "lastPauseTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_l1Token", + "type": "address" + }, + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "outboundTransfer", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_l1Token", + "type": "address" + }, + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "outboundTransfer", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "pauseGuardian", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "paused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_controller", + "type": "address" + } + ], + "name": "setController", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_l1Counterpart", + "type": "address" + } + ], + "name": "setL1CounterpartAddress", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_l1GRT", + "type": "address" + } + ], + "name": "setL1TokenAddress", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_l2Router", + "type": "address" + } + ], + "name": "setL2Router", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newPauseGuardian", + "type": "address" + } + ], + "name": "setPauseGuardian", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "_newPaused", + "type": "bool" + } + ], + "name": "setPaused", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "syncAllContracts", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "bytecode": "0x6101606040527fe6876326c1291dfcbbd3864a6816d698cd591defc7aa2153d7f9c4c04016c89f6080527fc713c3df6d14cdf946460395d09af88993ee2b948b1a808161494e32c5f6706360a0527f966f1e8d8d8014e05f6ec4a57138da9be1f7c5a7f802928a18072f7c5318076160c0527f1df41cd916959d1163dc8f0671a666ea8a3e434c13e40faef527133b5d16703460e0527f45fc200c7e4544e457d3c5709bfe0d520442c30bbcbdaede89e8d4a4bbc19247610100527fd362cac9cb75c10d67bcc0b7eeb0b1ef48bb5420b556c092d4fd7f758816fcf0610120527f39605a6c26a173774ca666c67ef70cf491880e5d3d6d0ca66ec0a31034f15ea36101405234801561011057600080fd5b5060805160a05160c05160e05161010051610120516101405161222b6101696000398061112f5250806111065250806110dd528061150a5250806110b452508061108b525080611062525080611039525061222b6000f3fe6080604052600436106101405760003560e01c806392eefe9b116100b6578063c4d66de81161006f578063c4d66de814610355578063d2ce7d6514610375578063d685c0b214610388578063d6866ea5146103a8578063f14a4bd5146103bd578063f77c4791146103d257610140565b806392eefe9b146102a05780639ce7abe5146102c0578063a0c76a96146102e0578063a2594d8214610300578063a7e28d4814610320578063c4c0087c1461034057610140565b806348bde20c1161010857806348bde20c146101e75780634adc698a146102075780635c975abb1461021c57806369bc8cd41461023e5780637b3a3c8b1461025e57806391b4ded91461028b57610140565b80630252fec114610145578063147ddef51461016757806316c38b3c1461019257806324a3d622146101b25780632e567b36146101d4575b600080fd5b34801561015157600080fd5b50610165610160366004611b43565b6103e7565b005b34801561017357600080fd5b5061017c610474565b60405161018991906121a9565b60405180910390f35b34801561019e57600080fd5b506101656101ad366004611da9565b61047a565b3480156101be57600080fd5b506101c7610572565b6040516101899190611e67565b6101656101e2366004611bb4565b610581565b3480156101f357600080fd5b50610165610202366004611b43565b6107b9565b34801561021357600080fd5b506101c7610825565b34801561022857600080fd5b50610231610834565b6040516101899190611f43565b34801561024a57600080fd5b50610165610259366004611b43565b610842565b34801561026a57600080fd5b5061027e610279366004611cb4565b6108bb565b6040516101899190611f4e565b34801561029757600080fd5b5061017c6108d7565b3480156102ac57600080fd5b506101656102bb366004611b43565b6108dd565b3480156102cc57600080fd5b506101656102db366004611dc9565b6108ee565b3480156102ec57600080fd5b5061027e6102fb366004611c37565b610a44565b34801561030c57600080fd5b5061016561031b366004611b43565b610ac4565b34801561032c57600080fd5b506101c761033b366004611b43565b610bdf565b34801561034c57600080fd5b506101c7610c0f565b34801561036157600080fd5b50610165610370366004611b43565b610c1e565b61027e610383366004611d25565b610d44565b34801561039457600080fd5b506101656103a3366004611b43565b610fbb565b3480156103b457600080fd5b50610165611034565b3480156103c957600080fd5b506101c7611155565b3480156103de57600080fd5b506101c7611164565b6103ef611173565b6001600160a01b03811661041e5760405162461bcd60e51b815260040161041590612034565b60405180910390fd5b607780546001600160a01b0319166001600160a01b0383161790556040517f43a303848c82a28f94def3043839eaebd654c19fdada874a74fb94d8bf7d343890610469908390611e67565b60405180910390a150565b60015481565b6004805460408051634fc07d7560e01b815290516001600160a01b0390921692634fc07d75928282019260209290829003018186803b1580156104bc57600080fd5b505afa1580156104d0573d6000803e3d6000fd5b505050506040513d60208110156104e657600080fd5b50516001600160a01b031633148061050857506003546001600160a01b031633145b610559576040805162461bcd60e51b815260206004820152601960248201527f4f6e6c7920476f7665726e6f72206f7220477561726469616e00000000000000604482015290519081900360640190fd5b806105665761056661123d565b61056f816112b5565b50565b6003546001600160a01b031681565b600260435414156105d9576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b60026043556105e6611340565b6076546105fb906001600160a01b0316611391565b6001600160a01b0316336001600160a01b03161461062b5760405162461bcd60e51b815260040161041590612172565b6075546001600160a01b038781169116146106585760405162461bcd60e51b81526004016104159061214b565b34156106765760405162461bcd60e51b815260040161041590611fdd565b60755461068b906001600160a01b0316610bdf565b6001600160a01b0316638c2a993e85856040518363ffffffff1660e01b81526004016106b8929190611ee2565b600060405180830381600087803b1580156106d257600080fd5b505af11580156106e6573d6000803e3d6000fd5b505082159150610757905057604051635260769b60e11b81526001600160a01b0385169063a4c0ed3690610724908890879087908790600401611efb565b600060405180830381600087803b15801561073e57600080fd5b505af1158015610752573d6000803e3d6000fd5b505050505b836001600160a01b0316856001600160a01b0316876001600160a01b03167fc7f2e9c55c40a50fbc217dfc70cd39a222940dfa62145aa0ca49eb9535d4fcb2866040516107a491906121a9565b60405180910390a45050600160435550505050565b6107c1611173565b6001600160a01b03811661081c576040805162461bcd60e51b815260206004820152601960248201527f5061757365477561726469616e206d7573742062652073657400000000000000604482015290519081900360640190fd5b61056f816113aa565b6077546001600160a01b031681565b600054610100900460ff1690565b61084a611173565b6001600160a01b0381166108705760405162461bcd60e51b81526004016104159061200c565b607580546001600160a01b0319166001600160a01b0383161790556040517f0b7cf729ac6c387cab57a28d257c6ecac863c24b086353121057083c7bfc79f990610469908390611e67565b60606108cd8686866000808888610d44565b9695505050505050565b60025481565b6108e56113fc565b61056f8161145b565b82806001600160a01b031663f851a4406040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561092a57600080fd5b505af115801561093e573d6000803e3d6000fd5b505050506040513d602081101561095457600080fd5b50516001600160a01b031633146109b2576040805162461bcd60e51b815260206004820152601e60248201527f43616c6c6572206d757374206265207468652070726f78792061646d696e0000604482015290519081900360640190fd5b60405163623faf6160e01b8152602060048201908152602482018490526001600160a01b0386169163623faf619186918691908190604401848480828437600081840152601f19601f8201169050808301925050509350505050600060405180830381600087803b158015610a2657600080fd5b505af1158015610a3a573d6000803e3d6000fd5b5050505050505050565b6060632e567b3660e01b86868686600087604051602001610a66929190611f61565b60408051601f1981840301815290829052610a879594939291602401611e7b565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152905095945050505050565b80806001600160a01b031663f851a4406040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610b0057600080fd5b505af1158015610b14573d6000803e3d6000fd5b505050506040513d6020811015610b2a57600080fd5b50516001600160a01b03163314610b88576040805162461bcd60e51b815260206004820152601e60248201527f43616c6c6572206d757374206265207468652070726f78792061646d696e0000604482015290519081900360640190fd5b816001600160a01b03166359fc20bb6040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610bc357600080fd5b505af1158015610bd7573d6000803e3d6000fd5b505050505050565b6075546000906001600160a01b03838116911614610bff57506000610c0a565b610c07611503565b90505b919050565b6076546001600160a01b031681565b610c26611533565b6001600160a01b0316336001600160a01b031614610c81576040805162461bcd60e51b815260206004820152601360248201527227b7363c9034b6b83632b6b2b73a30ba34b7b760691b604482015290519081900360640190fd5b604254610100900460ff1680610c9a5750610c9a611558565b80610ca8575060425460ff16155b610ce35760405162461bcd60e51b815260040180806020018281038252602e8152602001806121c8602e913960400191505060405180910390fd5b604254610100900460ff16158015610d0e576042805460ff1961ff0019909116610100171660011790555b610d17826108e5565b6000805461ff001916610100179055610d2e611569565b8015610d40576042805461ff00191690555b5050565b606060026043541415610d9e576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b6002604355610dab611340565b6075546001600160a01b03898116911614610dd85760405162461bcd60e51b81526004016104159061214b565b85610df55760405162461bcd60e51b815260040161041590611fb0565b3415610e135760405162461bcd60e51b815260040161041590611fdd565b6001600160a01b038716610e395760405162461bcd60e51b81526004016104159061205f565b610e41611a76565b610e4b8484611612565b602083018190526001600160a01b0390911682525115610e7d5760405162461bcd60e51b8152600401610415906120bc565b607554610e92906001600160a01b0316610bdf565b81516040516374f4f54760e01b81526001600160a01b0392909216916374f4f54791610ec2918b90600401611ee2565b600060405180830381600087803b158015610edc57600080fd5b505af1158015610ef0573d6000803e3d6000fd5b505050506000610f3060008360000151607660009054906101000a90046001600160a01b0316610f2b8e87600001518f8f8a60200151610a44565b61168f565b905080896001600160a01b031683600001516001600160a01b03167f3073a74ecb728d10be779fe19a74a1428e20468f5b4d167bf9c73d9067847d738d60008d604051610f7f93929190611ec1565b60405180910390a480604051602001610f9891906121a9565b604051602081830303815290604052925050506001604355979650505050505050565b610fc3611173565b6001600160a01b038116610fe95760405162461bcd60e51b81526004016104159061208c565b607680546001600160a01b0319166001600160a01b0383161790556040517f60d5265d09ed32300af9a69188333d24b405b6f4196f623f3e2b78321181a61590610469908390611e67565b61105d7f000000000000000000000000000000000000000000000000000000000000000061182f565b6110867f000000000000000000000000000000000000000000000000000000000000000061182f565b6110af7f000000000000000000000000000000000000000000000000000000000000000061182f565b6110d87f000000000000000000000000000000000000000000000000000000000000000061182f565b6111017f000000000000000000000000000000000000000000000000000000000000000061182f565b61112a7f000000000000000000000000000000000000000000000000000000000000000061182f565b6111537f000000000000000000000000000000000000000000000000000000000000000061182f565b565b6075546001600160a01b031681565b6004546001600160a01b031681565b6004805460408051634fc07d7560e01b815290516001600160a01b0390921692634fc07d75928282019260209290829003018186803b1580156111b557600080fd5b505afa1580156111c9573d6000803e3d6000fd5b505050506040513d60208110156111df57600080fd5b50516001600160a01b03163314611153576040805162461bcd60e51b815260206004820152601860248201527f4f6e6c7920436f6e74726f6c6c657220676f7665726e6f720000000000000000604482015290519081900360640190fd5b6077546001600160a01b03166112655760405162461bcd60e51b815260040161041590611f85565b6076546001600160a01b031661128d5760405162461bcd60e51b8152600401610415906120f3565b6075546001600160a01b03166111535760405162461bcd60e51b815260040161041590612123565b600060019054906101000a900460ff16151581151514156112d55761056f565b6000805461ff0019166101008315158102919091179182905560ff910416156112fd57426002555b6000546040805161010090920460ff1615158252517f8fb6c181ee25a520cf3dd6565006ef91229fcfe5a989566c2a3b8c115570cec5916020908290030190a150565b600054610100900460ff1615611153576040805162461bcd60e51b81526020600482015260116024820152705061757365642028636f6e74726163742960781b604482015290519081900360640190fd5b7311110000000000000000000000000000000011110190565b600380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f0613b6ee6a04f0d09f390e4d9318894b9f6ac7fd83897cd8d18896ba579c401e90600090a35050565b6004546001600160a01b03163314611153576040805162461bcd60e51b815260206004820152601960248201527f43616c6c6572206d75737420626520436f6e74726f6c6c657200000000000000604482015290519081900360640190fd5b6001600160a01b0381166114af576040805162461bcd60e51b815260206004820152601660248201527510dbdb9d1c9bdb1b195c881b5d5cdd081899481cd95d60521b604482015290519081900360640190fd5b600480546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f4ff638452bbf33c012645d18ae6f05515ff5f2d1dfb0cece8cbf018c60903f709181900360200190a150565b600061152e7f0000000000000000000000000000000000000000000000000000000000000000611930565b905090565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6000611563306119ca565b15905090565b604254610100900460ff16806115825750611582611558565b80611590575060425460ff16155b6115cb5760405162461bcd60e51b815260040180806020018281038252602e8152602001806121c8602e913960400191505060405180910390fd5b604254610100900460ff161580156115f6576042805460ff1961ff0019909116610100171660011790555b6115fe6119d0565b801561056f576042805461ff001916905550565b607754600090606090829082906001600160a01b03163314156116455761163b85870187611b66565b9092509050611682565b33915085858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509293505050505b90925090505b9250929050565b60008060646001600160a01b031663928c169a8786866040518463ffffffff1660e01b815260040180836001600160a01b0316815260200180602001828103825283818151815260200191508051906020019080838360005b838110156117005781810151838201526020016116e8565b50505050905090810190601f16801561172d5780820380516001836020036101000a031916815260200191505b5093505050506020604051808303818588803b15801561174c57600080fd5b505af1158015611760573d6000803e3d6000fd5b50505050506040513d602081101561177757600080fd5b5051604080516020808252865182820152865193945084936001600160a01b03808a1694908b16937f2b986d32a0536b7e19baa48ab949fec7b903b7fad7730820b20632d100cc3a68938a93919283929083019185019080838360005b838110156117ec5781810151838201526020016117d4565b50505050905090810190601f1680156118195780820380516001836020036101000a031916815260200191505b509250505060405180910390a495945050505050565b6004805460408051637bb20d2f60e11b8152928301849052516000926001600160a01b039092169163f7641a5e916024808301926020929190829003018186803b15801561187c57600080fd5b505afa158015611890573d6000803e3d6000fd5b505050506040513d60208110156118a657600080fd5b50516000838152600560205260409020549091506001600160a01b03808316911614610d405760008281526005602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251908152915184927fd0e7a942b1fc38c411c4f53d153ba14fd24542a6a35ebacd9b6afca1a154e20692908290030190a25050565b6000818152600560205260408120546001600160a01b031680610c07576004805460408051637bb20d2f60e11b8152928301869052516001600160a01b039091169163f7641a5e916024808301926020929190829003018186803b15801561199757600080fd5b505afa1580156119ab573d6000803e3d6000fd5b505050506040513d60208110156119c157600080fd5b50519392505050565b3b151590565b604254610100900460ff16806119e957506119e9611558565b806119f7575060425460ff16155b611a325760405162461bcd60e51b815260040180806020018281038252602e8152602001806121c8602e913960400191505060405180910390fd5b604254610100900460ff16158015611a5d576042805460ff1961ff0019909116610100171660011790555b6001604355801561056f576042805461ff001916905550565b60408051808201909152600081526060602082015290565b60008083601f840112611a9f578182fd5b50813567ffffffffffffffff811115611ab6578182fd5b60208301915083602082850101111561168857600080fd5b600082601f830112611ade578081fd5b813567ffffffffffffffff80821115611af357fe5b604051601f8301601f191681016020018281118282101715611b1157fe5b604052828152848301602001861015611b28578384fd5b82602086016020830137918201602001929092529392505050565b600060208284031215611b54578081fd5b8135611b5f816121b2565b9392505050565b60008060408385031215611b78578081fd5b8235611b83816121b2565b9150602083013567ffffffffffffffff811115611b9e578182fd5b611baa85828601611ace565b9150509250929050565b60008060008060008060a08789031215611bcc578182fd5b8635611bd7816121b2565b95506020870135611be7816121b2565b94506040870135611bf7816121b2565b935060608701359250608087013567ffffffffffffffff811115611c19578283fd5b611c2589828a01611a8e565b979a9699509497509295939492505050565b600080600080600060a08688031215611c4e578081fd5b8535611c59816121b2565b94506020860135611c69816121b2565b93506040860135611c79816121b2565b925060608601359150608086013567ffffffffffffffff811115611c9b578182fd5b611ca788828901611ace565b9150509295509295909350565b600080600080600060808688031215611ccb578081fd5b8535611cd6816121b2565b94506020860135611ce6816121b2565b935060408601359250606086013567ffffffffffffffff811115611d08578182fd5b611d1488828901611a8e565b969995985093965092949392505050565b600080600080600080600060c0888a031215611d3f578081fd5b8735611d4a816121b2565b96506020880135611d5a816121b2565b955060408801359450606088013593506080880135925060a088013567ffffffffffffffff811115611d8a578182fd5b611d968a828b01611a8e565b989b979a50959850939692959293505050565b600060208284031215611dba578081fd5b81358015158114611b5f578182fd5b600080600060408486031215611ddd578283fd5b8335611de8816121b2565b9250602084013567ffffffffffffffff811115611e03578283fd5b611e0f86828701611a8e565b9497909650939450505050565b60008151808452815b81811015611e4157602081850181015186830182015201611e25565b81811115611e525782602083870101525b50601f01601f19169290920160200192915050565b6001600160a01b0391909116815260200190565b6001600160a01b0386811682528581166020830152841660408201526060810183905260a060808201819052600090611eb690830184611e1c565b979650505050505050565b6001600160a01b039390931683526020830191909152604082015260600190565b6001600160a01b03929092168252602082015260400190565b6001600160a01b0385168152602081018490526060604082018190528101829052600082846080840137818301608090810191909152601f909201601f191601019392505050565b901515815260200190565b600060208252611b5f6020830184611e1c565b600060ff8416825260406020830152611f7d6040830184611e1c565b949350505050565b602080825260119082015270130c97d493d555115497d393d517d4d155607a1b604082015260600190565b6020808252601390820152721253959053125117d6915493d7d05353d55395606a1b604082015260600190565b602080825260159082015274494e56414c49445f4e4f4e5a45524f5f56414c554560581b604082015260600190565b6020808252600e908201526d1253959053125117d30c57d1d49560921b604082015260600190565b60208082526011908201527024a72b20a624a22fa6192fa927aaaa22a960791b604082015260600190565b60208082526013908201527224a72b20a624a22fa222a9aa24a720aa24a7a760691b604082015260600190565b6020808252601690820152751253959053125117d30c57d0d3d5539511549410549560521b604082015260600190565b6020808252601a908201527f43414c4c5f484f4f4b5f444154415f4e4f545f414c4c4f574544000000000000604082015260600190565b602080825260169082015275130c57d0d3d5539511549410549517d393d517d4d15560521b604082015260600190565b6020808252600e908201526d130c57d1d49517d393d517d4d15560921b604082015260600190565b6020808252600d908201526c1513d2d15397d393d517d1d495609a1b604082015260600190565b60208082526018908201527f4f4e4c595f434f554e544552504152545f474154455741590000000000000000604082015260600190565b90815260200190565b6001600160a01b038116811461056f57600080fdfe496e697469616c697a61626c653a20636f6e747261637420697320616c726561647920696e697469616c697a6564a264697066735822122065fad7a9fc021b14dda68574a33568d80fcb7311e53fb115c48b61e211858c8364736f6c63430007060033", + "deployedBytecode": "0x6080604052600436106101405760003560e01c806392eefe9b116100b6578063c4d66de81161006f578063c4d66de814610355578063d2ce7d6514610375578063d685c0b214610388578063d6866ea5146103a8578063f14a4bd5146103bd578063f77c4791146103d257610140565b806392eefe9b146102a05780639ce7abe5146102c0578063a0c76a96146102e0578063a2594d8214610300578063a7e28d4814610320578063c4c0087c1461034057610140565b806348bde20c1161010857806348bde20c146101e75780634adc698a146102075780635c975abb1461021c57806369bc8cd41461023e5780637b3a3c8b1461025e57806391b4ded91461028b57610140565b80630252fec114610145578063147ddef51461016757806316c38b3c1461019257806324a3d622146101b25780632e567b36146101d4575b600080fd5b34801561015157600080fd5b50610165610160366004611b43565b6103e7565b005b34801561017357600080fd5b5061017c610474565b60405161018991906121a9565b60405180910390f35b34801561019e57600080fd5b506101656101ad366004611da9565b61047a565b3480156101be57600080fd5b506101c7610572565b6040516101899190611e67565b6101656101e2366004611bb4565b610581565b3480156101f357600080fd5b50610165610202366004611b43565b6107b9565b34801561021357600080fd5b506101c7610825565b34801561022857600080fd5b50610231610834565b6040516101899190611f43565b34801561024a57600080fd5b50610165610259366004611b43565b610842565b34801561026a57600080fd5b5061027e610279366004611cb4565b6108bb565b6040516101899190611f4e565b34801561029757600080fd5b5061017c6108d7565b3480156102ac57600080fd5b506101656102bb366004611b43565b6108dd565b3480156102cc57600080fd5b506101656102db366004611dc9565b6108ee565b3480156102ec57600080fd5b5061027e6102fb366004611c37565b610a44565b34801561030c57600080fd5b5061016561031b366004611b43565b610ac4565b34801561032c57600080fd5b506101c761033b366004611b43565b610bdf565b34801561034c57600080fd5b506101c7610c0f565b34801561036157600080fd5b50610165610370366004611b43565b610c1e565b61027e610383366004611d25565b610d44565b34801561039457600080fd5b506101656103a3366004611b43565b610fbb565b3480156103b457600080fd5b50610165611034565b3480156103c957600080fd5b506101c7611155565b3480156103de57600080fd5b506101c7611164565b6103ef611173565b6001600160a01b03811661041e5760405162461bcd60e51b815260040161041590612034565b60405180910390fd5b607780546001600160a01b0319166001600160a01b0383161790556040517f43a303848c82a28f94def3043839eaebd654c19fdada874a74fb94d8bf7d343890610469908390611e67565b60405180910390a150565b60015481565b6004805460408051634fc07d7560e01b815290516001600160a01b0390921692634fc07d75928282019260209290829003018186803b1580156104bc57600080fd5b505afa1580156104d0573d6000803e3d6000fd5b505050506040513d60208110156104e657600080fd5b50516001600160a01b031633148061050857506003546001600160a01b031633145b610559576040805162461bcd60e51b815260206004820152601960248201527f4f6e6c7920476f7665726e6f72206f7220477561726469616e00000000000000604482015290519081900360640190fd5b806105665761056661123d565b61056f816112b5565b50565b6003546001600160a01b031681565b600260435414156105d9576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b60026043556105e6611340565b6076546105fb906001600160a01b0316611391565b6001600160a01b0316336001600160a01b03161461062b5760405162461bcd60e51b815260040161041590612172565b6075546001600160a01b038781169116146106585760405162461bcd60e51b81526004016104159061214b565b34156106765760405162461bcd60e51b815260040161041590611fdd565b60755461068b906001600160a01b0316610bdf565b6001600160a01b0316638c2a993e85856040518363ffffffff1660e01b81526004016106b8929190611ee2565b600060405180830381600087803b1580156106d257600080fd5b505af11580156106e6573d6000803e3d6000fd5b505082159150610757905057604051635260769b60e11b81526001600160a01b0385169063a4c0ed3690610724908890879087908790600401611efb565b600060405180830381600087803b15801561073e57600080fd5b505af1158015610752573d6000803e3d6000fd5b505050505b836001600160a01b0316856001600160a01b0316876001600160a01b03167fc7f2e9c55c40a50fbc217dfc70cd39a222940dfa62145aa0ca49eb9535d4fcb2866040516107a491906121a9565b60405180910390a45050600160435550505050565b6107c1611173565b6001600160a01b03811661081c576040805162461bcd60e51b815260206004820152601960248201527f5061757365477561726469616e206d7573742062652073657400000000000000604482015290519081900360640190fd5b61056f816113aa565b6077546001600160a01b031681565b600054610100900460ff1690565b61084a611173565b6001600160a01b0381166108705760405162461bcd60e51b81526004016104159061200c565b607580546001600160a01b0319166001600160a01b0383161790556040517f0b7cf729ac6c387cab57a28d257c6ecac863c24b086353121057083c7bfc79f990610469908390611e67565b60606108cd8686866000808888610d44565b9695505050505050565b60025481565b6108e56113fc565b61056f8161145b565b82806001600160a01b031663f851a4406040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561092a57600080fd5b505af115801561093e573d6000803e3d6000fd5b505050506040513d602081101561095457600080fd5b50516001600160a01b031633146109b2576040805162461bcd60e51b815260206004820152601e60248201527f43616c6c6572206d757374206265207468652070726f78792061646d696e0000604482015290519081900360640190fd5b60405163623faf6160e01b8152602060048201908152602482018490526001600160a01b0386169163623faf619186918691908190604401848480828437600081840152601f19601f8201169050808301925050509350505050600060405180830381600087803b158015610a2657600080fd5b505af1158015610a3a573d6000803e3d6000fd5b5050505050505050565b6060632e567b3660e01b86868686600087604051602001610a66929190611f61565b60408051601f1981840301815290829052610a879594939291602401611e7b565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152905095945050505050565b80806001600160a01b031663f851a4406040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610b0057600080fd5b505af1158015610b14573d6000803e3d6000fd5b505050506040513d6020811015610b2a57600080fd5b50516001600160a01b03163314610b88576040805162461bcd60e51b815260206004820152601e60248201527f43616c6c6572206d757374206265207468652070726f78792061646d696e0000604482015290519081900360640190fd5b816001600160a01b03166359fc20bb6040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610bc357600080fd5b505af1158015610bd7573d6000803e3d6000fd5b505050505050565b6075546000906001600160a01b03838116911614610bff57506000610c0a565b610c07611503565b90505b919050565b6076546001600160a01b031681565b610c26611533565b6001600160a01b0316336001600160a01b031614610c81576040805162461bcd60e51b815260206004820152601360248201527227b7363c9034b6b83632b6b2b73a30ba34b7b760691b604482015290519081900360640190fd5b604254610100900460ff1680610c9a5750610c9a611558565b80610ca8575060425460ff16155b610ce35760405162461bcd60e51b815260040180806020018281038252602e8152602001806121c8602e913960400191505060405180910390fd5b604254610100900460ff16158015610d0e576042805460ff1961ff0019909116610100171660011790555b610d17826108e5565b6000805461ff001916610100179055610d2e611569565b8015610d40576042805461ff00191690555b5050565b606060026043541415610d9e576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b6002604355610dab611340565b6075546001600160a01b03898116911614610dd85760405162461bcd60e51b81526004016104159061214b565b85610df55760405162461bcd60e51b815260040161041590611fb0565b3415610e135760405162461bcd60e51b815260040161041590611fdd565b6001600160a01b038716610e395760405162461bcd60e51b81526004016104159061205f565b610e41611a76565b610e4b8484611612565b602083018190526001600160a01b0390911682525115610e7d5760405162461bcd60e51b8152600401610415906120bc565b607554610e92906001600160a01b0316610bdf565b81516040516374f4f54760e01b81526001600160a01b0392909216916374f4f54791610ec2918b90600401611ee2565b600060405180830381600087803b158015610edc57600080fd5b505af1158015610ef0573d6000803e3d6000fd5b505050506000610f3060008360000151607660009054906101000a90046001600160a01b0316610f2b8e87600001518f8f8a60200151610a44565b61168f565b905080896001600160a01b031683600001516001600160a01b03167f3073a74ecb728d10be779fe19a74a1428e20468f5b4d167bf9c73d9067847d738d60008d604051610f7f93929190611ec1565b60405180910390a480604051602001610f9891906121a9565b604051602081830303815290604052925050506001604355979650505050505050565b610fc3611173565b6001600160a01b038116610fe95760405162461bcd60e51b81526004016104159061208c565b607680546001600160a01b0319166001600160a01b0383161790556040517f60d5265d09ed32300af9a69188333d24b405b6f4196f623f3e2b78321181a61590610469908390611e67565b61105d7f000000000000000000000000000000000000000000000000000000000000000061182f565b6110867f000000000000000000000000000000000000000000000000000000000000000061182f565b6110af7f000000000000000000000000000000000000000000000000000000000000000061182f565b6110d87f000000000000000000000000000000000000000000000000000000000000000061182f565b6111017f000000000000000000000000000000000000000000000000000000000000000061182f565b61112a7f000000000000000000000000000000000000000000000000000000000000000061182f565b6111537f000000000000000000000000000000000000000000000000000000000000000061182f565b565b6075546001600160a01b031681565b6004546001600160a01b031681565b6004805460408051634fc07d7560e01b815290516001600160a01b0390921692634fc07d75928282019260209290829003018186803b1580156111b557600080fd5b505afa1580156111c9573d6000803e3d6000fd5b505050506040513d60208110156111df57600080fd5b50516001600160a01b03163314611153576040805162461bcd60e51b815260206004820152601860248201527f4f6e6c7920436f6e74726f6c6c657220676f7665726e6f720000000000000000604482015290519081900360640190fd5b6077546001600160a01b03166112655760405162461bcd60e51b815260040161041590611f85565b6076546001600160a01b031661128d5760405162461bcd60e51b8152600401610415906120f3565b6075546001600160a01b03166111535760405162461bcd60e51b815260040161041590612123565b600060019054906101000a900460ff16151581151514156112d55761056f565b6000805461ff0019166101008315158102919091179182905560ff910416156112fd57426002555b6000546040805161010090920460ff1615158252517f8fb6c181ee25a520cf3dd6565006ef91229fcfe5a989566c2a3b8c115570cec5916020908290030190a150565b600054610100900460ff1615611153576040805162461bcd60e51b81526020600482015260116024820152705061757365642028636f6e74726163742960781b604482015290519081900360640190fd5b7311110000000000000000000000000000000011110190565b600380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f0613b6ee6a04f0d09f390e4d9318894b9f6ac7fd83897cd8d18896ba579c401e90600090a35050565b6004546001600160a01b03163314611153576040805162461bcd60e51b815260206004820152601960248201527f43616c6c6572206d75737420626520436f6e74726f6c6c657200000000000000604482015290519081900360640190fd5b6001600160a01b0381166114af576040805162461bcd60e51b815260206004820152601660248201527510dbdb9d1c9bdb1b195c881b5d5cdd081899481cd95d60521b604482015290519081900360640190fd5b600480546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f4ff638452bbf33c012645d18ae6f05515ff5f2d1dfb0cece8cbf018c60903f709181900360200190a150565b600061152e7f0000000000000000000000000000000000000000000000000000000000000000611930565b905090565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6000611563306119ca565b15905090565b604254610100900460ff16806115825750611582611558565b80611590575060425460ff16155b6115cb5760405162461bcd60e51b815260040180806020018281038252602e8152602001806121c8602e913960400191505060405180910390fd5b604254610100900460ff161580156115f6576042805460ff1961ff0019909116610100171660011790555b6115fe6119d0565b801561056f576042805461ff001916905550565b607754600090606090829082906001600160a01b03163314156116455761163b85870187611b66565b9092509050611682565b33915085858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509293505050505b90925090505b9250929050565b60008060646001600160a01b031663928c169a8786866040518463ffffffff1660e01b815260040180836001600160a01b0316815260200180602001828103825283818151815260200191508051906020019080838360005b838110156117005781810151838201526020016116e8565b50505050905090810190601f16801561172d5780820380516001836020036101000a031916815260200191505b5093505050506020604051808303818588803b15801561174c57600080fd5b505af1158015611760573d6000803e3d6000fd5b50505050506040513d602081101561177757600080fd5b5051604080516020808252865182820152865193945084936001600160a01b03808a1694908b16937f2b986d32a0536b7e19baa48ab949fec7b903b7fad7730820b20632d100cc3a68938a93919283929083019185019080838360005b838110156117ec5781810151838201526020016117d4565b50505050905090810190601f1680156118195780820380516001836020036101000a031916815260200191505b509250505060405180910390a495945050505050565b6004805460408051637bb20d2f60e11b8152928301849052516000926001600160a01b039092169163f7641a5e916024808301926020929190829003018186803b15801561187c57600080fd5b505afa158015611890573d6000803e3d6000fd5b505050506040513d60208110156118a657600080fd5b50516000838152600560205260409020549091506001600160a01b03808316911614610d405760008281526005602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251908152915184927fd0e7a942b1fc38c411c4f53d153ba14fd24542a6a35ebacd9b6afca1a154e20692908290030190a25050565b6000818152600560205260408120546001600160a01b031680610c07576004805460408051637bb20d2f60e11b8152928301869052516001600160a01b039091169163f7641a5e916024808301926020929190829003018186803b15801561199757600080fd5b505afa1580156119ab573d6000803e3d6000fd5b505050506040513d60208110156119c157600080fd5b50519392505050565b3b151590565b604254610100900460ff16806119e957506119e9611558565b806119f7575060425460ff16155b611a325760405162461bcd60e51b815260040180806020018281038252602e8152602001806121c8602e913960400191505060405180910390fd5b604254610100900460ff16158015611a5d576042805460ff1961ff0019909116610100171660011790555b6001604355801561056f576042805461ff001916905550565b60408051808201909152600081526060602082015290565b60008083601f840112611a9f578182fd5b50813567ffffffffffffffff811115611ab6578182fd5b60208301915083602082850101111561168857600080fd5b600082601f830112611ade578081fd5b813567ffffffffffffffff80821115611af357fe5b604051601f8301601f191681016020018281118282101715611b1157fe5b604052828152848301602001861015611b28578384fd5b82602086016020830137918201602001929092529392505050565b600060208284031215611b54578081fd5b8135611b5f816121b2565b9392505050565b60008060408385031215611b78578081fd5b8235611b83816121b2565b9150602083013567ffffffffffffffff811115611b9e578182fd5b611baa85828601611ace565b9150509250929050565b60008060008060008060a08789031215611bcc578182fd5b8635611bd7816121b2565b95506020870135611be7816121b2565b94506040870135611bf7816121b2565b935060608701359250608087013567ffffffffffffffff811115611c19578283fd5b611c2589828a01611a8e565b979a9699509497509295939492505050565b600080600080600060a08688031215611c4e578081fd5b8535611c59816121b2565b94506020860135611c69816121b2565b93506040860135611c79816121b2565b925060608601359150608086013567ffffffffffffffff811115611c9b578182fd5b611ca788828901611ace565b9150509295509295909350565b600080600080600060808688031215611ccb578081fd5b8535611cd6816121b2565b94506020860135611ce6816121b2565b935060408601359250606086013567ffffffffffffffff811115611d08578182fd5b611d1488828901611a8e565b969995985093965092949392505050565b600080600080600080600060c0888a031215611d3f578081fd5b8735611d4a816121b2565b96506020880135611d5a816121b2565b955060408801359450606088013593506080880135925060a088013567ffffffffffffffff811115611d8a578182fd5b611d968a828b01611a8e565b989b979a50959850939692959293505050565b600060208284031215611dba578081fd5b81358015158114611b5f578182fd5b600080600060408486031215611ddd578283fd5b8335611de8816121b2565b9250602084013567ffffffffffffffff811115611e03578283fd5b611e0f86828701611a8e565b9497909650939450505050565b60008151808452815b81811015611e4157602081850181015186830182015201611e25565b81811115611e525782602083870101525b50601f01601f19169290920160200192915050565b6001600160a01b0391909116815260200190565b6001600160a01b0386811682528581166020830152841660408201526060810183905260a060808201819052600090611eb690830184611e1c565b979650505050505050565b6001600160a01b039390931683526020830191909152604082015260600190565b6001600160a01b03929092168252602082015260400190565b6001600160a01b0385168152602081018490526060604082018190528101829052600082846080840137818301608090810191909152601f909201601f191601019392505050565b901515815260200190565b600060208252611b5f6020830184611e1c565b600060ff8416825260406020830152611f7d6040830184611e1c565b949350505050565b602080825260119082015270130c97d493d555115497d393d517d4d155607a1b604082015260600190565b6020808252601390820152721253959053125117d6915493d7d05353d55395606a1b604082015260600190565b602080825260159082015274494e56414c49445f4e4f4e5a45524f5f56414c554560581b604082015260600190565b6020808252600e908201526d1253959053125117d30c57d1d49560921b604082015260600190565b60208082526011908201527024a72b20a624a22fa6192fa927aaaa22a960791b604082015260600190565b60208082526013908201527224a72b20a624a22fa222a9aa24a720aa24a7a760691b604082015260600190565b6020808252601690820152751253959053125117d30c57d0d3d5539511549410549560521b604082015260600190565b6020808252601a908201527f43414c4c5f484f4f4b5f444154415f4e4f545f414c4c4f574544000000000000604082015260600190565b602080825260169082015275130c57d0d3d5539511549410549517d393d517d4d15560521b604082015260600190565b6020808252600e908201526d130c57d1d49517d393d517d4d15560921b604082015260600190565b6020808252600d908201526c1513d2d15397d393d517d1d495609a1b604082015260600190565b60208082526018908201527f4f4e4c595f434f554e544552504152545f474154455741590000000000000000604082015260600190565b90815260200190565b6001600160a01b038116811461056f57600080fdfe496e697469616c697a61626c653a20636f6e747261637420697320616c726561647920696e697469616c697a6564a264697066735822122065fad7a9fc021b14dda68574a33568d80fcb7311e53fb115c48b61e211858c8364736f6c63430007060033", + "linkReferences": {}, + "deployedLinkReferences": {} +} \ No newline at end of file diff --git a/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/L2GraphTokenGateway#L2GraphTokenGateway_ProxyWithABI.json b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/L2GraphTokenGateway#L2GraphTokenGateway_ProxyWithABI.json new file mode 100644 index 000000000..0a9b3a140 --- /dev/null +++ b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/L2GraphTokenGateway#L2GraphTokenGateway_ProxyWithABI.json @@ -0,0 +1,647 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "L2GraphTokenGateway", + "sourceName": "contracts/l2/gateway/L2GraphTokenGateway.sol", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "nameHash", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "contractAddress", + "type": "address" + } + ], + "name": "ContractSynced", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "l1Token", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "DepositFinalized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "l1Counterpart", + "type": "address" + } + ], + "name": "L1CounterpartAddressSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "l1GRT", + "type": "address" + } + ], + "name": "L1TokenAddressSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "l2Router", + "type": "address" + } + ], + "name": "L2RouterSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldPauseGuardian", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "pauseGuardian", + "type": "address" + } + ], + "name": "NewPauseGuardian", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "param", + "type": "string" + } + ], + "name": "ParameterUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "isPaused", + "type": "bool" + } + ], + "name": "PartialPauseChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "isPaused", + "type": "bool" + } + ], + "name": "PauseChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "controller", + "type": "address" + } + ], + "name": "SetController", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_id", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "TxToL1", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "l1Token", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "l2ToL1Id", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "exitNum", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "WithdrawalInitiated", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "contract IGraphProxy", + "name": "_proxy", + "type": "address" + } + ], + "name": "acceptProxy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IGraphProxy", + "name": "_proxy", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "acceptProxyAndCall", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "l1ERC20", + "type": "address" + } + ], + "name": "calculateL2TokenAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "controller", + "outputs": [ + { + "internalType": "contract IController", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_l1Token", + "type": "address" + }, + { + "internalType": "address", + "name": "_from", + "type": "address" + }, + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "finalizeInboundTransfer", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "address", + "name": "_from", + "type": "address" + }, + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "getOutboundCalldata", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_controller", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "l1Counterpart", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "l1GRT", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "l2Router", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "lastPartialPauseTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "lastPauseTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_l1Token", + "type": "address" + }, + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "outboundTransfer", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_l1Token", + "type": "address" + }, + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "outboundTransfer", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "pauseGuardian", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "paused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_controller", + "type": "address" + } + ], + "name": "setController", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_l1Counterpart", + "type": "address" + } + ], + "name": "setL1CounterpartAddress", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_l1GRT", + "type": "address" + } + ], + "name": "setL1TokenAddress", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_l2Router", + "type": "address" + } + ], + "name": "setL2Router", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newPauseGuardian", + "type": "address" + } + ], + "name": "setPauseGuardian", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "_newPaused", + "type": "bool" + } + ], + "name": "setPaused", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "syncAllContracts", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "bytecode": "0x6101606040527fe6876326c1291dfcbbd3864a6816d698cd591defc7aa2153d7f9c4c04016c89f6080527fc713c3df6d14cdf946460395d09af88993ee2b948b1a808161494e32c5f6706360a0527f966f1e8d8d8014e05f6ec4a57138da9be1f7c5a7f802928a18072f7c5318076160c0527f1df41cd916959d1163dc8f0671a666ea8a3e434c13e40faef527133b5d16703460e0527f45fc200c7e4544e457d3c5709bfe0d520442c30bbcbdaede89e8d4a4bbc19247610100527fd362cac9cb75c10d67bcc0b7eeb0b1ef48bb5420b556c092d4fd7f758816fcf0610120527f39605a6c26a173774ca666c67ef70cf491880e5d3d6d0ca66ec0a31034f15ea36101405234801561011057600080fd5b5060805160a05160c05160e05161010051610120516101405161222b6101696000398061112f5250806111065250806110dd528061150a5250806110b452508061108b525080611062525080611039525061222b6000f3fe6080604052600436106101405760003560e01c806392eefe9b116100b6578063c4d66de81161006f578063c4d66de814610355578063d2ce7d6514610375578063d685c0b214610388578063d6866ea5146103a8578063f14a4bd5146103bd578063f77c4791146103d257610140565b806392eefe9b146102a05780639ce7abe5146102c0578063a0c76a96146102e0578063a2594d8214610300578063a7e28d4814610320578063c4c0087c1461034057610140565b806348bde20c1161010857806348bde20c146101e75780634adc698a146102075780635c975abb1461021c57806369bc8cd41461023e5780637b3a3c8b1461025e57806391b4ded91461028b57610140565b80630252fec114610145578063147ddef51461016757806316c38b3c1461019257806324a3d622146101b25780632e567b36146101d4575b600080fd5b34801561015157600080fd5b50610165610160366004611b43565b6103e7565b005b34801561017357600080fd5b5061017c610474565b60405161018991906121a9565b60405180910390f35b34801561019e57600080fd5b506101656101ad366004611da9565b61047a565b3480156101be57600080fd5b506101c7610572565b6040516101899190611e67565b6101656101e2366004611bb4565b610581565b3480156101f357600080fd5b50610165610202366004611b43565b6107b9565b34801561021357600080fd5b506101c7610825565b34801561022857600080fd5b50610231610834565b6040516101899190611f43565b34801561024a57600080fd5b50610165610259366004611b43565b610842565b34801561026a57600080fd5b5061027e610279366004611cb4565b6108bb565b6040516101899190611f4e565b34801561029757600080fd5b5061017c6108d7565b3480156102ac57600080fd5b506101656102bb366004611b43565b6108dd565b3480156102cc57600080fd5b506101656102db366004611dc9565b6108ee565b3480156102ec57600080fd5b5061027e6102fb366004611c37565b610a44565b34801561030c57600080fd5b5061016561031b366004611b43565b610ac4565b34801561032c57600080fd5b506101c761033b366004611b43565b610bdf565b34801561034c57600080fd5b506101c7610c0f565b34801561036157600080fd5b50610165610370366004611b43565b610c1e565b61027e610383366004611d25565b610d44565b34801561039457600080fd5b506101656103a3366004611b43565b610fbb565b3480156103b457600080fd5b50610165611034565b3480156103c957600080fd5b506101c7611155565b3480156103de57600080fd5b506101c7611164565b6103ef611173565b6001600160a01b03811661041e5760405162461bcd60e51b815260040161041590612034565b60405180910390fd5b607780546001600160a01b0319166001600160a01b0383161790556040517f43a303848c82a28f94def3043839eaebd654c19fdada874a74fb94d8bf7d343890610469908390611e67565b60405180910390a150565b60015481565b6004805460408051634fc07d7560e01b815290516001600160a01b0390921692634fc07d75928282019260209290829003018186803b1580156104bc57600080fd5b505afa1580156104d0573d6000803e3d6000fd5b505050506040513d60208110156104e657600080fd5b50516001600160a01b031633148061050857506003546001600160a01b031633145b610559576040805162461bcd60e51b815260206004820152601960248201527f4f6e6c7920476f7665726e6f72206f7220477561726469616e00000000000000604482015290519081900360640190fd5b806105665761056661123d565b61056f816112b5565b50565b6003546001600160a01b031681565b600260435414156105d9576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b60026043556105e6611340565b6076546105fb906001600160a01b0316611391565b6001600160a01b0316336001600160a01b03161461062b5760405162461bcd60e51b815260040161041590612172565b6075546001600160a01b038781169116146106585760405162461bcd60e51b81526004016104159061214b565b34156106765760405162461bcd60e51b815260040161041590611fdd565b60755461068b906001600160a01b0316610bdf565b6001600160a01b0316638c2a993e85856040518363ffffffff1660e01b81526004016106b8929190611ee2565b600060405180830381600087803b1580156106d257600080fd5b505af11580156106e6573d6000803e3d6000fd5b505082159150610757905057604051635260769b60e11b81526001600160a01b0385169063a4c0ed3690610724908890879087908790600401611efb565b600060405180830381600087803b15801561073e57600080fd5b505af1158015610752573d6000803e3d6000fd5b505050505b836001600160a01b0316856001600160a01b0316876001600160a01b03167fc7f2e9c55c40a50fbc217dfc70cd39a222940dfa62145aa0ca49eb9535d4fcb2866040516107a491906121a9565b60405180910390a45050600160435550505050565b6107c1611173565b6001600160a01b03811661081c576040805162461bcd60e51b815260206004820152601960248201527f5061757365477561726469616e206d7573742062652073657400000000000000604482015290519081900360640190fd5b61056f816113aa565b6077546001600160a01b031681565b600054610100900460ff1690565b61084a611173565b6001600160a01b0381166108705760405162461bcd60e51b81526004016104159061200c565b607580546001600160a01b0319166001600160a01b0383161790556040517f0b7cf729ac6c387cab57a28d257c6ecac863c24b086353121057083c7bfc79f990610469908390611e67565b60606108cd8686866000808888610d44565b9695505050505050565b60025481565b6108e56113fc565b61056f8161145b565b82806001600160a01b031663f851a4406040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561092a57600080fd5b505af115801561093e573d6000803e3d6000fd5b505050506040513d602081101561095457600080fd5b50516001600160a01b031633146109b2576040805162461bcd60e51b815260206004820152601e60248201527f43616c6c6572206d757374206265207468652070726f78792061646d696e0000604482015290519081900360640190fd5b60405163623faf6160e01b8152602060048201908152602482018490526001600160a01b0386169163623faf619186918691908190604401848480828437600081840152601f19601f8201169050808301925050509350505050600060405180830381600087803b158015610a2657600080fd5b505af1158015610a3a573d6000803e3d6000fd5b5050505050505050565b6060632e567b3660e01b86868686600087604051602001610a66929190611f61565b60408051601f1981840301815290829052610a879594939291602401611e7b565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152905095945050505050565b80806001600160a01b031663f851a4406040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610b0057600080fd5b505af1158015610b14573d6000803e3d6000fd5b505050506040513d6020811015610b2a57600080fd5b50516001600160a01b03163314610b88576040805162461bcd60e51b815260206004820152601e60248201527f43616c6c6572206d757374206265207468652070726f78792061646d696e0000604482015290519081900360640190fd5b816001600160a01b03166359fc20bb6040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610bc357600080fd5b505af1158015610bd7573d6000803e3d6000fd5b505050505050565b6075546000906001600160a01b03838116911614610bff57506000610c0a565b610c07611503565b90505b919050565b6076546001600160a01b031681565b610c26611533565b6001600160a01b0316336001600160a01b031614610c81576040805162461bcd60e51b815260206004820152601360248201527227b7363c9034b6b83632b6b2b73a30ba34b7b760691b604482015290519081900360640190fd5b604254610100900460ff1680610c9a5750610c9a611558565b80610ca8575060425460ff16155b610ce35760405162461bcd60e51b815260040180806020018281038252602e8152602001806121c8602e913960400191505060405180910390fd5b604254610100900460ff16158015610d0e576042805460ff1961ff0019909116610100171660011790555b610d17826108e5565b6000805461ff001916610100179055610d2e611569565b8015610d40576042805461ff00191690555b5050565b606060026043541415610d9e576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b6002604355610dab611340565b6075546001600160a01b03898116911614610dd85760405162461bcd60e51b81526004016104159061214b565b85610df55760405162461bcd60e51b815260040161041590611fb0565b3415610e135760405162461bcd60e51b815260040161041590611fdd565b6001600160a01b038716610e395760405162461bcd60e51b81526004016104159061205f565b610e41611a76565b610e4b8484611612565b602083018190526001600160a01b0390911682525115610e7d5760405162461bcd60e51b8152600401610415906120bc565b607554610e92906001600160a01b0316610bdf565b81516040516374f4f54760e01b81526001600160a01b0392909216916374f4f54791610ec2918b90600401611ee2565b600060405180830381600087803b158015610edc57600080fd5b505af1158015610ef0573d6000803e3d6000fd5b505050506000610f3060008360000151607660009054906101000a90046001600160a01b0316610f2b8e87600001518f8f8a60200151610a44565b61168f565b905080896001600160a01b031683600001516001600160a01b03167f3073a74ecb728d10be779fe19a74a1428e20468f5b4d167bf9c73d9067847d738d60008d604051610f7f93929190611ec1565b60405180910390a480604051602001610f9891906121a9565b604051602081830303815290604052925050506001604355979650505050505050565b610fc3611173565b6001600160a01b038116610fe95760405162461bcd60e51b81526004016104159061208c565b607680546001600160a01b0319166001600160a01b0383161790556040517f60d5265d09ed32300af9a69188333d24b405b6f4196f623f3e2b78321181a61590610469908390611e67565b61105d7f000000000000000000000000000000000000000000000000000000000000000061182f565b6110867f000000000000000000000000000000000000000000000000000000000000000061182f565b6110af7f000000000000000000000000000000000000000000000000000000000000000061182f565b6110d87f000000000000000000000000000000000000000000000000000000000000000061182f565b6111017f000000000000000000000000000000000000000000000000000000000000000061182f565b61112a7f000000000000000000000000000000000000000000000000000000000000000061182f565b6111537f000000000000000000000000000000000000000000000000000000000000000061182f565b565b6075546001600160a01b031681565b6004546001600160a01b031681565b6004805460408051634fc07d7560e01b815290516001600160a01b0390921692634fc07d75928282019260209290829003018186803b1580156111b557600080fd5b505afa1580156111c9573d6000803e3d6000fd5b505050506040513d60208110156111df57600080fd5b50516001600160a01b03163314611153576040805162461bcd60e51b815260206004820152601860248201527f4f6e6c7920436f6e74726f6c6c657220676f7665726e6f720000000000000000604482015290519081900360640190fd5b6077546001600160a01b03166112655760405162461bcd60e51b815260040161041590611f85565b6076546001600160a01b031661128d5760405162461bcd60e51b8152600401610415906120f3565b6075546001600160a01b03166111535760405162461bcd60e51b815260040161041590612123565b600060019054906101000a900460ff16151581151514156112d55761056f565b6000805461ff0019166101008315158102919091179182905560ff910416156112fd57426002555b6000546040805161010090920460ff1615158252517f8fb6c181ee25a520cf3dd6565006ef91229fcfe5a989566c2a3b8c115570cec5916020908290030190a150565b600054610100900460ff1615611153576040805162461bcd60e51b81526020600482015260116024820152705061757365642028636f6e74726163742960781b604482015290519081900360640190fd5b7311110000000000000000000000000000000011110190565b600380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f0613b6ee6a04f0d09f390e4d9318894b9f6ac7fd83897cd8d18896ba579c401e90600090a35050565b6004546001600160a01b03163314611153576040805162461bcd60e51b815260206004820152601960248201527f43616c6c6572206d75737420626520436f6e74726f6c6c657200000000000000604482015290519081900360640190fd5b6001600160a01b0381166114af576040805162461bcd60e51b815260206004820152601660248201527510dbdb9d1c9bdb1b195c881b5d5cdd081899481cd95d60521b604482015290519081900360640190fd5b600480546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f4ff638452bbf33c012645d18ae6f05515ff5f2d1dfb0cece8cbf018c60903f709181900360200190a150565b600061152e7f0000000000000000000000000000000000000000000000000000000000000000611930565b905090565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6000611563306119ca565b15905090565b604254610100900460ff16806115825750611582611558565b80611590575060425460ff16155b6115cb5760405162461bcd60e51b815260040180806020018281038252602e8152602001806121c8602e913960400191505060405180910390fd5b604254610100900460ff161580156115f6576042805460ff1961ff0019909116610100171660011790555b6115fe6119d0565b801561056f576042805461ff001916905550565b607754600090606090829082906001600160a01b03163314156116455761163b85870187611b66565b9092509050611682565b33915085858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509293505050505b90925090505b9250929050565b60008060646001600160a01b031663928c169a8786866040518463ffffffff1660e01b815260040180836001600160a01b0316815260200180602001828103825283818151815260200191508051906020019080838360005b838110156117005781810151838201526020016116e8565b50505050905090810190601f16801561172d5780820380516001836020036101000a031916815260200191505b5093505050506020604051808303818588803b15801561174c57600080fd5b505af1158015611760573d6000803e3d6000fd5b50505050506040513d602081101561177757600080fd5b5051604080516020808252865182820152865193945084936001600160a01b03808a1694908b16937f2b986d32a0536b7e19baa48ab949fec7b903b7fad7730820b20632d100cc3a68938a93919283929083019185019080838360005b838110156117ec5781810151838201526020016117d4565b50505050905090810190601f1680156118195780820380516001836020036101000a031916815260200191505b509250505060405180910390a495945050505050565b6004805460408051637bb20d2f60e11b8152928301849052516000926001600160a01b039092169163f7641a5e916024808301926020929190829003018186803b15801561187c57600080fd5b505afa158015611890573d6000803e3d6000fd5b505050506040513d60208110156118a657600080fd5b50516000838152600560205260409020549091506001600160a01b03808316911614610d405760008281526005602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251908152915184927fd0e7a942b1fc38c411c4f53d153ba14fd24542a6a35ebacd9b6afca1a154e20692908290030190a25050565b6000818152600560205260408120546001600160a01b031680610c07576004805460408051637bb20d2f60e11b8152928301869052516001600160a01b039091169163f7641a5e916024808301926020929190829003018186803b15801561199757600080fd5b505afa1580156119ab573d6000803e3d6000fd5b505050506040513d60208110156119c157600080fd5b50519392505050565b3b151590565b604254610100900460ff16806119e957506119e9611558565b806119f7575060425460ff16155b611a325760405162461bcd60e51b815260040180806020018281038252602e8152602001806121c8602e913960400191505060405180910390fd5b604254610100900460ff16158015611a5d576042805460ff1961ff0019909116610100171660011790555b6001604355801561056f576042805461ff001916905550565b60408051808201909152600081526060602082015290565b60008083601f840112611a9f578182fd5b50813567ffffffffffffffff811115611ab6578182fd5b60208301915083602082850101111561168857600080fd5b600082601f830112611ade578081fd5b813567ffffffffffffffff80821115611af357fe5b604051601f8301601f191681016020018281118282101715611b1157fe5b604052828152848301602001861015611b28578384fd5b82602086016020830137918201602001929092529392505050565b600060208284031215611b54578081fd5b8135611b5f816121b2565b9392505050565b60008060408385031215611b78578081fd5b8235611b83816121b2565b9150602083013567ffffffffffffffff811115611b9e578182fd5b611baa85828601611ace565b9150509250929050565b60008060008060008060a08789031215611bcc578182fd5b8635611bd7816121b2565b95506020870135611be7816121b2565b94506040870135611bf7816121b2565b935060608701359250608087013567ffffffffffffffff811115611c19578283fd5b611c2589828a01611a8e565b979a9699509497509295939492505050565b600080600080600060a08688031215611c4e578081fd5b8535611c59816121b2565b94506020860135611c69816121b2565b93506040860135611c79816121b2565b925060608601359150608086013567ffffffffffffffff811115611c9b578182fd5b611ca788828901611ace565b9150509295509295909350565b600080600080600060808688031215611ccb578081fd5b8535611cd6816121b2565b94506020860135611ce6816121b2565b935060408601359250606086013567ffffffffffffffff811115611d08578182fd5b611d1488828901611a8e565b969995985093965092949392505050565b600080600080600080600060c0888a031215611d3f578081fd5b8735611d4a816121b2565b96506020880135611d5a816121b2565b955060408801359450606088013593506080880135925060a088013567ffffffffffffffff811115611d8a578182fd5b611d968a828b01611a8e565b989b979a50959850939692959293505050565b600060208284031215611dba578081fd5b81358015158114611b5f578182fd5b600080600060408486031215611ddd578283fd5b8335611de8816121b2565b9250602084013567ffffffffffffffff811115611e03578283fd5b611e0f86828701611a8e565b9497909650939450505050565b60008151808452815b81811015611e4157602081850181015186830182015201611e25565b81811115611e525782602083870101525b50601f01601f19169290920160200192915050565b6001600160a01b0391909116815260200190565b6001600160a01b0386811682528581166020830152841660408201526060810183905260a060808201819052600090611eb690830184611e1c565b979650505050505050565b6001600160a01b039390931683526020830191909152604082015260600190565b6001600160a01b03929092168252602082015260400190565b6001600160a01b0385168152602081018490526060604082018190528101829052600082846080840137818301608090810191909152601f909201601f191601019392505050565b901515815260200190565b600060208252611b5f6020830184611e1c565b600060ff8416825260406020830152611f7d6040830184611e1c565b949350505050565b602080825260119082015270130c97d493d555115497d393d517d4d155607a1b604082015260600190565b6020808252601390820152721253959053125117d6915493d7d05353d55395606a1b604082015260600190565b602080825260159082015274494e56414c49445f4e4f4e5a45524f5f56414c554560581b604082015260600190565b6020808252600e908201526d1253959053125117d30c57d1d49560921b604082015260600190565b60208082526011908201527024a72b20a624a22fa6192fa927aaaa22a960791b604082015260600190565b60208082526013908201527224a72b20a624a22fa222a9aa24a720aa24a7a760691b604082015260600190565b6020808252601690820152751253959053125117d30c57d0d3d5539511549410549560521b604082015260600190565b6020808252601a908201527f43414c4c5f484f4f4b5f444154415f4e4f545f414c4c4f574544000000000000604082015260600190565b602080825260169082015275130c57d0d3d5539511549410549517d393d517d4d15560521b604082015260600190565b6020808252600e908201526d130c57d1d49517d393d517d4d15560921b604082015260600190565b6020808252600d908201526c1513d2d15397d393d517d1d495609a1b604082015260600190565b60208082526018908201527f4f4e4c595f434f554e544552504152545f474154455741590000000000000000604082015260600190565b90815260200190565b6001600160a01b038116811461056f57600080fdfe496e697469616c697a61626c653a20636f6e747261637420697320616c726561647920696e697469616c697a6564a264697066735822122065fad7a9fc021b14dda68574a33568d80fcb7311e53fb115c48b61e211858c8364736f6c63430007060033", + "deployedBytecode": "0x6080604052600436106101405760003560e01c806392eefe9b116100b6578063c4d66de81161006f578063c4d66de814610355578063d2ce7d6514610375578063d685c0b214610388578063d6866ea5146103a8578063f14a4bd5146103bd578063f77c4791146103d257610140565b806392eefe9b146102a05780639ce7abe5146102c0578063a0c76a96146102e0578063a2594d8214610300578063a7e28d4814610320578063c4c0087c1461034057610140565b806348bde20c1161010857806348bde20c146101e75780634adc698a146102075780635c975abb1461021c57806369bc8cd41461023e5780637b3a3c8b1461025e57806391b4ded91461028b57610140565b80630252fec114610145578063147ddef51461016757806316c38b3c1461019257806324a3d622146101b25780632e567b36146101d4575b600080fd5b34801561015157600080fd5b50610165610160366004611b43565b6103e7565b005b34801561017357600080fd5b5061017c610474565b60405161018991906121a9565b60405180910390f35b34801561019e57600080fd5b506101656101ad366004611da9565b61047a565b3480156101be57600080fd5b506101c7610572565b6040516101899190611e67565b6101656101e2366004611bb4565b610581565b3480156101f357600080fd5b50610165610202366004611b43565b6107b9565b34801561021357600080fd5b506101c7610825565b34801561022857600080fd5b50610231610834565b6040516101899190611f43565b34801561024a57600080fd5b50610165610259366004611b43565b610842565b34801561026a57600080fd5b5061027e610279366004611cb4565b6108bb565b6040516101899190611f4e565b34801561029757600080fd5b5061017c6108d7565b3480156102ac57600080fd5b506101656102bb366004611b43565b6108dd565b3480156102cc57600080fd5b506101656102db366004611dc9565b6108ee565b3480156102ec57600080fd5b5061027e6102fb366004611c37565b610a44565b34801561030c57600080fd5b5061016561031b366004611b43565b610ac4565b34801561032c57600080fd5b506101c761033b366004611b43565b610bdf565b34801561034c57600080fd5b506101c7610c0f565b34801561036157600080fd5b50610165610370366004611b43565b610c1e565b61027e610383366004611d25565b610d44565b34801561039457600080fd5b506101656103a3366004611b43565b610fbb565b3480156103b457600080fd5b50610165611034565b3480156103c957600080fd5b506101c7611155565b3480156103de57600080fd5b506101c7611164565b6103ef611173565b6001600160a01b03811661041e5760405162461bcd60e51b815260040161041590612034565b60405180910390fd5b607780546001600160a01b0319166001600160a01b0383161790556040517f43a303848c82a28f94def3043839eaebd654c19fdada874a74fb94d8bf7d343890610469908390611e67565b60405180910390a150565b60015481565b6004805460408051634fc07d7560e01b815290516001600160a01b0390921692634fc07d75928282019260209290829003018186803b1580156104bc57600080fd5b505afa1580156104d0573d6000803e3d6000fd5b505050506040513d60208110156104e657600080fd5b50516001600160a01b031633148061050857506003546001600160a01b031633145b610559576040805162461bcd60e51b815260206004820152601960248201527f4f6e6c7920476f7665726e6f72206f7220477561726469616e00000000000000604482015290519081900360640190fd5b806105665761056661123d565b61056f816112b5565b50565b6003546001600160a01b031681565b600260435414156105d9576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b60026043556105e6611340565b6076546105fb906001600160a01b0316611391565b6001600160a01b0316336001600160a01b03161461062b5760405162461bcd60e51b815260040161041590612172565b6075546001600160a01b038781169116146106585760405162461bcd60e51b81526004016104159061214b565b34156106765760405162461bcd60e51b815260040161041590611fdd565b60755461068b906001600160a01b0316610bdf565b6001600160a01b0316638c2a993e85856040518363ffffffff1660e01b81526004016106b8929190611ee2565b600060405180830381600087803b1580156106d257600080fd5b505af11580156106e6573d6000803e3d6000fd5b505082159150610757905057604051635260769b60e11b81526001600160a01b0385169063a4c0ed3690610724908890879087908790600401611efb565b600060405180830381600087803b15801561073e57600080fd5b505af1158015610752573d6000803e3d6000fd5b505050505b836001600160a01b0316856001600160a01b0316876001600160a01b03167fc7f2e9c55c40a50fbc217dfc70cd39a222940dfa62145aa0ca49eb9535d4fcb2866040516107a491906121a9565b60405180910390a45050600160435550505050565b6107c1611173565b6001600160a01b03811661081c576040805162461bcd60e51b815260206004820152601960248201527f5061757365477561726469616e206d7573742062652073657400000000000000604482015290519081900360640190fd5b61056f816113aa565b6077546001600160a01b031681565b600054610100900460ff1690565b61084a611173565b6001600160a01b0381166108705760405162461bcd60e51b81526004016104159061200c565b607580546001600160a01b0319166001600160a01b0383161790556040517f0b7cf729ac6c387cab57a28d257c6ecac863c24b086353121057083c7bfc79f990610469908390611e67565b60606108cd8686866000808888610d44565b9695505050505050565b60025481565b6108e56113fc565b61056f8161145b565b82806001600160a01b031663f851a4406040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561092a57600080fd5b505af115801561093e573d6000803e3d6000fd5b505050506040513d602081101561095457600080fd5b50516001600160a01b031633146109b2576040805162461bcd60e51b815260206004820152601e60248201527f43616c6c6572206d757374206265207468652070726f78792061646d696e0000604482015290519081900360640190fd5b60405163623faf6160e01b8152602060048201908152602482018490526001600160a01b0386169163623faf619186918691908190604401848480828437600081840152601f19601f8201169050808301925050509350505050600060405180830381600087803b158015610a2657600080fd5b505af1158015610a3a573d6000803e3d6000fd5b5050505050505050565b6060632e567b3660e01b86868686600087604051602001610a66929190611f61565b60408051601f1981840301815290829052610a879594939291602401611e7b565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152905095945050505050565b80806001600160a01b031663f851a4406040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610b0057600080fd5b505af1158015610b14573d6000803e3d6000fd5b505050506040513d6020811015610b2a57600080fd5b50516001600160a01b03163314610b88576040805162461bcd60e51b815260206004820152601e60248201527f43616c6c6572206d757374206265207468652070726f78792061646d696e0000604482015290519081900360640190fd5b816001600160a01b03166359fc20bb6040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610bc357600080fd5b505af1158015610bd7573d6000803e3d6000fd5b505050505050565b6075546000906001600160a01b03838116911614610bff57506000610c0a565b610c07611503565b90505b919050565b6076546001600160a01b031681565b610c26611533565b6001600160a01b0316336001600160a01b031614610c81576040805162461bcd60e51b815260206004820152601360248201527227b7363c9034b6b83632b6b2b73a30ba34b7b760691b604482015290519081900360640190fd5b604254610100900460ff1680610c9a5750610c9a611558565b80610ca8575060425460ff16155b610ce35760405162461bcd60e51b815260040180806020018281038252602e8152602001806121c8602e913960400191505060405180910390fd5b604254610100900460ff16158015610d0e576042805460ff1961ff0019909116610100171660011790555b610d17826108e5565b6000805461ff001916610100179055610d2e611569565b8015610d40576042805461ff00191690555b5050565b606060026043541415610d9e576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b6002604355610dab611340565b6075546001600160a01b03898116911614610dd85760405162461bcd60e51b81526004016104159061214b565b85610df55760405162461bcd60e51b815260040161041590611fb0565b3415610e135760405162461bcd60e51b815260040161041590611fdd565b6001600160a01b038716610e395760405162461bcd60e51b81526004016104159061205f565b610e41611a76565b610e4b8484611612565b602083018190526001600160a01b0390911682525115610e7d5760405162461bcd60e51b8152600401610415906120bc565b607554610e92906001600160a01b0316610bdf565b81516040516374f4f54760e01b81526001600160a01b0392909216916374f4f54791610ec2918b90600401611ee2565b600060405180830381600087803b158015610edc57600080fd5b505af1158015610ef0573d6000803e3d6000fd5b505050506000610f3060008360000151607660009054906101000a90046001600160a01b0316610f2b8e87600001518f8f8a60200151610a44565b61168f565b905080896001600160a01b031683600001516001600160a01b03167f3073a74ecb728d10be779fe19a74a1428e20468f5b4d167bf9c73d9067847d738d60008d604051610f7f93929190611ec1565b60405180910390a480604051602001610f9891906121a9565b604051602081830303815290604052925050506001604355979650505050505050565b610fc3611173565b6001600160a01b038116610fe95760405162461bcd60e51b81526004016104159061208c565b607680546001600160a01b0319166001600160a01b0383161790556040517f60d5265d09ed32300af9a69188333d24b405b6f4196f623f3e2b78321181a61590610469908390611e67565b61105d7f000000000000000000000000000000000000000000000000000000000000000061182f565b6110867f000000000000000000000000000000000000000000000000000000000000000061182f565b6110af7f000000000000000000000000000000000000000000000000000000000000000061182f565b6110d87f000000000000000000000000000000000000000000000000000000000000000061182f565b6111017f000000000000000000000000000000000000000000000000000000000000000061182f565b61112a7f000000000000000000000000000000000000000000000000000000000000000061182f565b6111537f000000000000000000000000000000000000000000000000000000000000000061182f565b565b6075546001600160a01b031681565b6004546001600160a01b031681565b6004805460408051634fc07d7560e01b815290516001600160a01b0390921692634fc07d75928282019260209290829003018186803b1580156111b557600080fd5b505afa1580156111c9573d6000803e3d6000fd5b505050506040513d60208110156111df57600080fd5b50516001600160a01b03163314611153576040805162461bcd60e51b815260206004820152601860248201527f4f6e6c7920436f6e74726f6c6c657220676f7665726e6f720000000000000000604482015290519081900360640190fd5b6077546001600160a01b03166112655760405162461bcd60e51b815260040161041590611f85565b6076546001600160a01b031661128d5760405162461bcd60e51b8152600401610415906120f3565b6075546001600160a01b03166111535760405162461bcd60e51b815260040161041590612123565b600060019054906101000a900460ff16151581151514156112d55761056f565b6000805461ff0019166101008315158102919091179182905560ff910416156112fd57426002555b6000546040805161010090920460ff1615158252517f8fb6c181ee25a520cf3dd6565006ef91229fcfe5a989566c2a3b8c115570cec5916020908290030190a150565b600054610100900460ff1615611153576040805162461bcd60e51b81526020600482015260116024820152705061757365642028636f6e74726163742960781b604482015290519081900360640190fd5b7311110000000000000000000000000000000011110190565b600380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f0613b6ee6a04f0d09f390e4d9318894b9f6ac7fd83897cd8d18896ba579c401e90600090a35050565b6004546001600160a01b03163314611153576040805162461bcd60e51b815260206004820152601960248201527f43616c6c6572206d75737420626520436f6e74726f6c6c657200000000000000604482015290519081900360640190fd5b6001600160a01b0381166114af576040805162461bcd60e51b815260206004820152601660248201527510dbdb9d1c9bdb1b195c881b5d5cdd081899481cd95d60521b604482015290519081900360640190fd5b600480546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f4ff638452bbf33c012645d18ae6f05515ff5f2d1dfb0cece8cbf018c60903f709181900360200190a150565b600061152e7f0000000000000000000000000000000000000000000000000000000000000000611930565b905090565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6000611563306119ca565b15905090565b604254610100900460ff16806115825750611582611558565b80611590575060425460ff16155b6115cb5760405162461bcd60e51b815260040180806020018281038252602e8152602001806121c8602e913960400191505060405180910390fd5b604254610100900460ff161580156115f6576042805460ff1961ff0019909116610100171660011790555b6115fe6119d0565b801561056f576042805461ff001916905550565b607754600090606090829082906001600160a01b03163314156116455761163b85870187611b66565b9092509050611682565b33915085858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509293505050505b90925090505b9250929050565b60008060646001600160a01b031663928c169a8786866040518463ffffffff1660e01b815260040180836001600160a01b0316815260200180602001828103825283818151815260200191508051906020019080838360005b838110156117005781810151838201526020016116e8565b50505050905090810190601f16801561172d5780820380516001836020036101000a031916815260200191505b5093505050506020604051808303818588803b15801561174c57600080fd5b505af1158015611760573d6000803e3d6000fd5b50505050506040513d602081101561177757600080fd5b5051604080516020808252865182820152865193945084936001600160a01b03808a1694908b16937f2b986d32a0536b7e19baa48ab949fec7b903b7fad7730820b20632d100cc3a68938a93919283929083019185019080838360005b838110156117ec5781810151838201526020016117d4565b50505050905090810190601f1680156118195780820380516001836020036101000a031916815260200191505b509250505060405180910390a495945050505050565b6004805460408051637bb20d2f60e11b8152928301849052516000926001600160a01b039092169163f7641a5e916024808301926020929190829003018186803b15801561187c57600080fd5b505afa158015611890573d6000803e3d6000fd5b505050506040513d60208110156118a657600080fd5b50516000838152600560205260409020549091506001600160a01b03808316911614610d405760008281526005602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251908152915184927fd0e7a942b1fc38c411c4f53d153ba14fd24542a6a35ebacd9b6afca1a154e20692908290030190a25050565b6000818152600560205260408120546001600160a01b031680610c07576004805460408051637bb20d2f60e11b8152928301869052516001600160a01b039091169163f7641a5e916024808301926020929190829003018186803b15801561199757600080fd5b505afa1580156119ab573d6000803e3d6000fd5b505050506040513d60208110156119c157600080fd5b50519392505050565b3b151590565b604254610100900460ff16806119e957506119e9611558565b806119f7575060425460ff16155b611a325760405162461bcd60e51b815260040180806020018281038252602e8152602001806121c8602e913960400191505060405180910390fd5b604254610100900460ff16158015611a5d576042805460ff1961ff0019909116610100171660011790555b6001604355801561056f576042805461ff001916905550565b60408051808201909152600081526060602082015290565b60008083601f840112611a9f578182fd5b50813567ffffffffffffffff811115611ab6578182fd5b60208301915083602082850101111561168857600080fd5b600082601f830112611ade578081fd5b813567ffffffffffffffff80821115611af357fe5b604051601f8301601f191681016020018281118282101715611b1157fe5b604052828152848301602001861015611b28578384fd5b82602086016020830137918201602001929092529392505050565b600060208284031215611b54578081fd5b8135611b5f816121b2565b9392505050565b60008060408385031215611b78578081fd5b8235611b83816121b2565b9150602083013567ffffffffffffffff811115611b9e578182fd5b611baa85828601611ace565b9150509250929050565b60008060008060008060a08789031215611bcc578182fd5b8635611bd7816121b2565b95506020870135611be7816121b2565b94506040870135611bf7816121b2565b935060608701359250608087013567ffffffffffffffff811115611c19578283fd5b611c2589828a01611a8e565b979a9699509497509295939492505050565b600080600080600060a08688031215611c4e578081fd5b8535611c59816121b2565b94506020860135611c69816121b2565b93506040860135611c79816121b2565b925060608601359150608086013567ffffffffffffffff811115611c9b578182fd5b611ca788828901611ace565b9150509295509295909350565b600080600080600060808688031215611ccb578081fd5b8535611cd6816121b2565b94506020860135611ce6816121b2565b935060408601359250606086013567ffffffffffffffff811115611d08578182fd5b611d1488828901611a8e565b969995985093965092949392505050565b600080600080600080600060c0888a031215611d3f578081fd5b8735611d4a816121b2565b96506020880135611d5a816121b2565b955060408801359450606088013593506080880135925060a088013567ffffffffffffffff811115611d8a578182fd5b611d968a828b01611a8e565b989b979a50959850939692959293505050565b600060208284031215611dba578081fd5b81358015158114611b5f578182fd5b600080600060408486031215611ddd578283fd5b8335611de8816121b2565b9250602084013567ffffffffffffffff811115611e03578283fd5b611e0f86828701611a8e565b9497909650939450505050565b60008151808452815b81811015611e4157602081850181015186830182015201611e25565b81811115611e525782602083870101525b50601f01601f19169290920160200192915050565b6001600160a01b0391909116815260200190565b6001600160a01b0386811682528581166020830152841660408201526060810183905260a060808201819052600090611eb690830184611e1c565b979650505050505050565b6001600160a01b039390931683526020830191909152604082015260600190565b6001600160a01b03929092168252602082015260400190565b6001600160a01b0385168152602081018490526060604082018190528101829052600082846080840137818301608090810191909152601f909201601f191601019392505050565b901515815260200190565b600060208252611b5f6020830184611e1c565b600060ff8416825260406020830152611f7d6040830184611e1c565b949350505050565b602080825260119082015270130c97d493d555115497d393d517d4d155607a1b604082015260600190565b6020808252601390820152721253959053125117d6915493d7d05353d55395606a1b604082015260600190565b602080825260159082015274494e56414c49445f4e4f4e5a45524f5f56414c554560581b604082015260600190565b6020808252600e908201526d1253959053125117d30c57d1d49560921b604082015260600190565b60208082526011908201527024a72b20a624a22fa6192fa927aaaa22a960791b604082015260600190565b60208082526013908201527224a72b20a624a22fa222a9aa24a720aa24a7a760691b604082015260600190565b6020808252601690820152751253959053125117d30c57d0d3d5539511549410549560521b604082015260600190565b6020808252601a908201527f43414c4c5f484f4f4b5f444154415f4e4f545f414c4c4f574544000000000000604082015260600190565b602080825260169082015275130c57d0d3d5539511549410549517d393d517d4d15560521b604082015260600190565b6020808252600e908201526d130c57d1d49517d393d517d4d15560921b604082015260600190565b6020808252600d908201526c1513d2d15397d393d517d1d495609a1b604082015260600190565b60208082526018908201527f4f4e4c595f434f554e544552504152545f474154455741590000000000000000604082015260600190565b90815260200190565b6001600160a01b038116811461056f57600080fdfe496e697469616c697a61626c653a20636f6e747261637420697320616c726561647920696e697469616c697a6564a264697066735822122065fad7a9fc021b14dda68574a33568d80fcb7311e53fb115c48b61e211858c8364736f6c63430007060033", + "linkReferences": {}, + "deployedLinkReferences": {} +} \ No newline at end of file diff --git a/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/PaymentsEscrow#PaymentsEscrow.json b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/PaymentsEscrow#PaymentsEscrow.json new file mode 100644 index 000000000..c543471bf --- /dev/null +++ b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/PaymentsEscrow#PaymentsEscrow.json @@ -0,0 +1,680 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "PaymentsEscrow", + "sourceName": "contracts/payments/PaymentsEscrow.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "controller", + "type": "address" + }, + { + "internalType": "uint256", + "name": "withdrawEscrowThawingPeriod", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + } + ], + "name": "AddressEmptyCode", + "type": "error" + }, + { + "inputs": [], + "name": "FailedCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "contractName", + "type": "bytes" + } + ], + "name": "GraphDirectoryInvalidZeroAddress", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidInitialization", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "balanceBefore", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "balanceAfter", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "PaymentsEscrowInconsistentCollection", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minBalance", + "type": "uint256" + } + ], + "name": "PaymentsEscrowInsufficientBalance", + "type": "error" + }, + { + "inputs": [], + "name": "PaymentsEscrowInvalidZeroTokens", + "type": "error" + }, + { + "inputs": [], + "name": "PaymentsEscrowIsPaused", + "type": "error" + }, + { + "inputs": [], + "name": "PaymentsEscrowNotThawing", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "currentTimestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "thawEndTimestamp", + "type": "uint256" + } + ], + "name": "PaymentsEscrowStillThawing", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "thawingPeriod", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxWaitPeriod", + "type": "uint256" + } + ], + "name": "PaymentsEscrowThawingPeriodTooLong", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "collector", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensThawing", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "thawEndTimestamp", + "type": "uint256" + } + ], + "name": "CancelThaw", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "collector", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "Deposit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "paymentType", + "type": "uint8" + }, + { + "indexed": true, + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "collector", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "receiverDestination", + "type": "address" + } + ], + "name": "EscrowCollected", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "graphToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "graphStaking", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphPayments", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphEscrow", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "graphController", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphEpochManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphRewardsManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphTokenGateway", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphProxyAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphCuration", + "type": "address" + } + ], + "name": "GraphDirectoryInitialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "collector", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "thawEndTimestamp", + "type": "uint256" + } + ], + "name": "Thaw", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "collector", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "Withdraw", + "type": "event" + }, + { + "inputs": [], + "name": "MAX_WAIT_PERIOD", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "WITHDRAW_ESCROW_THAWING_PERIOD", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "collector", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + } + ], + "name": "cancelThaw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "paymentType", + "type": "uint8" + }, + { + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "address", + "name": "dataService", + "type": "address" + }, + { + "internalType": "uint256", + "name": "dataServiceCut", + "type": "uint256" + }, + { + "internalType": "address", + "name": "receiverDestination", + "type": "address" + } + ], + "name": "collect", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "collector", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "deposit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "internalType": "address", + "name": "collector", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "depositTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "internalType": "address", + "name": "collector", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + } + ], + "name": "escrowAccounts", + "outputs": [ + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokensThawing", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "thawEndTimestamp", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "internalType": "address", + "name": "collector", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + } + ], + "name": "getBalance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "name": "multicall", + "outputs": [ + { + "internalType": "bytes[]", + "name": "results", + "type": "bytes[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "collector", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "thaw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "collector", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + } + ], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "bytecode": "0x6101e060405234801561001157600080fd5b50604051611bb6380380611bb6833981016040819052610030916104ef565b816001600160a01b03811661007a5760405163218f5add60e11b815260206004820152600a60248201526921b7b73a3937b63632b960b11b60448201526064015b60405180910390fd5b6001600160a01b0381166101005260408051808201909152600a81526923b930b8342a37b5b2b760b11b60208201526100b290610373565b6001600160a01b03166080526040805180820190915260078152665374616b696e6760c81b60208201526100e590610373565b6001600160a01b031660a05260408051808201909152600d81526c47726170685061796d656e747360981b602082015261011e90610373565b6001600160a01b031660c05260408051808201909152600e81526d5061796d656e7473457363726f7760901b602082015261015890610373565b6001600160a01b031660e05260408051808201909152600c81526b22b837b1b426b0b730b3b2b960a11b602082015261019090610373565b6001600160a01b03166101205260408051808201909152600e81526d2932bbb0b93239a6b0b730b3b2b960911b60208201526101cb90610373565b6001600160a01b0316610140526040805180820190915260118152704772617068546f6b656e4761746577617960781b602082015261020990610373565b6001600160a01b03166101605260408051808201909152600f81526e23b930b834283937bc3ca0b236b4b760891b602082015261024590610373565b6001600160a01b03166101805260408051808201909152600881526721bab930ba34b7b760c11b602082015261027a90610373565b6001600160a01b039081166101a08190526101005160a05160805160c05160e05161012051610140516101605161018051604051988b169a9788169996909716977fef5021414834d86e36470f5c1cecf6544fb2bb723f2ca51a4c86fcd8c5919a43976103249790916001600160a01b03978816815295871660208701529386166040860152918516606085015284166080840152831660a083015290911660c082015260e00190565b60405180910390a450806276a7008082111561035c57604051635c0f65a160e01b815260048101929092526024820152604401610071565b50506101c081905261036c610421565b505061058b565b600080610100516001600160a01b031663f7641a5e84805190602001206040518263ffffffff1660e01b81526004016103ae91815260200190565b602060405180830381865afa1580156103cb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103ef919061051b565b9050826001600160a01b03821661041a5760405163218f5add60e11b8152600401610071919061053d565b5092915050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff16156104715760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b03908116146104d05780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b80516001600160a01b03811681146104ea57600080fd5b919050565b6000806040838503121561050257600080fd5b61050b836104d3565b9150602083015190509250929050565b60006020828403121561052d57600080fd5b610536826104d3565b9392505050565b602081526000825180602084015260005b8181101561056b576020818601810151604086840101520161054e565b506000604082850101526040601f19601f83011684010191505092915050565b60805160a05160c05160e05161010051610120516101405161016051610180516101a0516101c0516115b3610603600039600081816101350152610b4e015260005050600050506000505060005050600050506000610d910152600050506000610dd90152600050506000610db501526115b36000f3fe608060405234801561001057600080fd5b50600436106100a45760003560e01c80631230fa3e146100a957806372eb521e146100be5780637a8df28b146100d15780637b8ae6cf146101305780638129fc1c146101655780638340f5491461016d578063ac9650d814610180578063b1d07de4146101a0578063b2168b6b146101b3578063d6bd603c146101bd578063f93f1cd0146101d0578063f940e385146101e3575b600080fd5b6100bc6100b736600461111c565b6101f6565b005b6100bc6100cc36600461119a565b61058c565b6101106100df3660046111e5565b6000602081815293815260408082208552928152828120909352825290208054600182015460029092015490919083565b604080519384526020840192909252908201526060015b60405180910390f35b6101577f000000000000000000000000000000000000000000000000000000000000000081565b604051908152602001610127565b6100bc610625565b6100bc61017b366004611228565b61071d565b61019361018e366004611265565b6107b5565b60405161012791906112fe565b6100bc6101ae36600461137e565b61089d565b6101576276a70081565b6101576101cb3660046111e5565b6109e0565b6100bc6101de366004611228565b610a3e565b6100bc6101f136600461137e565b610bd1565b6101fe610d8f565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561023b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061025f91906113b1565b1561027d57604051639e68cf0b60e01b815260040160405180910390fd5b6001600160a01b038087166000908152602081815260408083203384528252808320938916835292905220805485808210156102da57604051633db4e69160e01b8152600481019290925260248201526044015b60405180910390fd5b5050848160000160008282546102f091906113e9565b9091555060009050610300610db3565b6001600160a01b03166370a08231306040518263ffffffff1660e01b815260040161032b91906113fc565b602060405180830381865afa158015610348573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061036c9190611410565b9050610376610db3565b6001600160a01b031663095ea7b361038c610dd7565b886040518363ffffffff1660e01b81526004016103aa929190611429565b6020604051808303816000875af11580156103c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103ed91906113b1565b506103f6610dd7565b6001600160a01b03166381cd11a08a89898989896040518763ffffffff1660e01b815260040161042b96959493929190611458565b600060405180830381600087803b15801561044557600080fd5b505af1158015610459573d6000803e3d6000fd5b505050506000610467610db3565b6001600160a01b03166370a08231306040518263ffffffff1660e01b815260040161049291906113fc565b602060405180830381865afa1580156104af573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104d39190611410565b90506104df81886114ae565b821482828990919261051557604051631f82726b60e21b81526004810193909352602483019190915260448201526064016102d1565b50339150506001600160a01b038a168b600281111561053657610536611442565b604080516001600160a01b038d81168252602082018d905289168183015290517f399b99b484be516eace7ececa486139581a25b0d2d12dac8bfa0948d07a8c9139181900360600190a450505050505050505050565b610594610d8f565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156105d1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105f591906113b1565b1561061357604051639e68cf0b60e01b815260040160405180910390fd5b61061f84848484610dfb565b50505050565b600061062f610eac565b805490915060ff600160401b82041615906001600160401b03166000811580156106565750825b90506000826001600160401b031660011480156106725750303b155b905081158015610680575080155b1561069e5760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff1916600117855583156106c857845460ff60401b1916600160401b1785555b6106d0610ed5565b831561071657845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b5050505050565b610725610d8f565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610762573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061078691906113b1565b156107a457604051639e68cf0b60e01b815260040160405180910390fd5b6107b033848484610dfb565b505050565b604080516000815260208101909152606090826001600160401b038111156107df576107df6114c1565b60405190808252806020026020018201604052801561081257816020015b60608152602001906001900390816107fd5790505b50915060005b838110156108945761086f30868684818110610836576108366114d7565b905060200281019061084891906114ed565b8560405160200161085b9392919061153a565b604051602081830303815290604052610edf565b838281518110610881576108816114d7565b6020908102919091010152600101610818565b50505b92915050565b6108a5610d8f565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108e2573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061090691906113b1565b1561092457604051639e68cf0b60e01b815260040160405180910390fd5b336000908152602081815260408083206001600160a01b03868116855290835281842090851684529091528120600181015490910361097657604051638cbd172f60e01b815260040160405180910390fd5b60018101805460028301805460009384905592905560408051828152602081018490529192916001600160a01b03868116929088169133917f6c4ed34e7347a8682024ee40d393e45f4075c46c593aaaed3cc3e49dd6933535910160405180910390a45050505050565b6001600160a01b038084166000908152602081815260408083208685168452825280832093851683529290529081206001810154815411610a22576000610a33565b60018101548154610a3391906113e9565b9150505b9392505050565b610a46610d8f565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a83573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aa791906113b1565b15610ac557604051639e68cf0b60e01b815260040160405180910390fd5b60008111610ae657604051633aff1f3760e21b815260040160405180910390fd5b336000908152602081815260408083206001600160a01b0387811685529083528184209086168452909152902080548280821015610b4057604051633db4e69160e01b8152600481019290925260248201526044016102d1565b505060018101829055610b737f0000000000000000000000000000000000000000000000000000000000000000426114ae565b600282018190556040516001600160a01b03808616929087169133917fba109e8a47e57c895aa1802554cd51025499c2b07c3c9b467c70413a4434ffbc91610bc391888252602082015260400190565b60405180910390a450505050565b610bd9610d8f565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c3a91906113b1565b15610c5857604051639e68cf0b60e01b815260040160405180910390fd5b336000908152602081815260408083206001600160a01b038681168552908352818420908516845290915281206002810154909103610caa57604051638cbd172f60e01b815260040160405180910390fd5b60028101544290818110610cda57604051633c50db7960e11b8152600481019290925260248201526044016102d1565b505060008160000154826001015411610cf7578160010154610cfa565b81545b905080826000016000828254610d1091906113e9565b90915550506000600183018190556002830155610d403382610d30610db3565b6001600160a01b03169190610f55565b826001600160a01b0316846001600160a01b0316336001600160a01b03167f3115d1449a7b732c986cba18244e897a450f61e1bb8d589cd2e69e6c8924f9f784604051610bc391815260200190565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b6001600160a01b038085166000908152602081815260408083208785168452825280832093861683529290529081208054839290610e3a9084906114ae565b90915550610e5d90503382610e4d610db3565b6001600160a01b03169190611004565b816001600160a01b0316836001600160a01b0316856001600160a01b03167f7cfff908a4b583f36430b25d75964c458d8ede8a99bd61be750e97ee1b2f3a9684604051610bc391815260200190565b6000807ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00610897565b610edd611045565b565b6060600080846001600160a01b031684604051610efc9190611561565b600060405180830381855af49150503d8060008114610f37576040519150601f19603f3d011682016040523d82523d6000602084013e610f3c565b606091505b5091509150610f4c85838361106a565b95945050505050565b80156107b05760405163a9059cbb60e01b81526001600160a01b0384169063a9059cbb90610f899085908590600401611429565b6020604051808303816000875af1158015610fa8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fcc91906113b1565b6107b05760405162461bcd60e51b815260206004820152600960248201526810ba3930b739b332b960b91b60448201526064016102d1565b80156107b0576040516323b872dd60e01b81526001600160a01b038381166004830152306024830152604482018390528416906323b872dd90606401610f89565b61104d6110bd565b610edd57604051631afcd79f60e31b815260040160405180910390fd5b60608261107f5761107a826110d7565b610a37565b815115801561109657506001600160a01b0384163b155b156110b65783604051639996b31560e01b81526004016102d191906113fc565b5080610a37565b60006110c7610eac565b54600160401b900460ff16919050565b8051156110e75780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b80356001600160a01b038116811461111757600080fd5b919050565b600080600080600080600060e0888a03121561113757600080fd5b87356003811061114657600080fd5b965061115460208901611100565b955061116260408901611100565b94506060880135935061117760808901611100565b925060a0880135915061118c60c08901611100565b905092959891949750929550565b600080600080608085870312156111b057600080fd5b6111b985611100565b93506111c760208601611100565b92506111d560408601611100565b9396929550929360600135925050565b6000806000606084860312156111fa57600080fd5b61120384611100565b925061121160208501611100565b915061121f60408501611100565b90509250925092565b60008060006060848603121561123d57600080fd5b61124684611100565b925061125460208501611100565b929592945050506040919091013590565b6000806020838503121561127857600080fd5b82356001600160401b0381111561128e57600080fd5b8301601f8101851361129f57600080fd5b80356001600160401b038111156112b557600080fd5b8560208260051b84010111156112ca57600080fd5b6020919091019590945092505050565b60005b838110156112f55781810151838201526020016112dd565b50506000910152565b6000602082016020835280845180835260408501915060408160051b86010192506020860160005b8281101561137257603f198786030184528151805180875261134f8160208901602085016112da565b601f01601f19169590950160209081019550938401939190910190600101611326565b50929695505050505050565b6000806040838503121561139157600080fd5b61139a83611100565b91506113a860208401611100565b90509250929050565b6000602082840312156113c357600080fd5b81518015158114610a3757600080fd5b634e487b7160e01b600052601160045260246000fd5b81810381811115610897576108976113d3565b6001600160a01b0391909116815260200190565b60006020828403121561142257600080fd5b5051919050565b6001600160a01b03929092168252602082015260400190565b634e487b7160e01b600052602160045260246000fd5b60c081016003881061147a57634e487b7160e01b600052602160045260246000fd5b9681526001600160a01b03958616602082015260408101949094529184166060840152608083015290911660a09091015290565b80820180821115610897576108976113d3565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261150457600080fd5b8301803591506001600160401b0382111561151e57600080fd5b60200191503681900382131561153357600080fd5b9250929050565b8284823760008382016000815283516115578183602088016112da565b0195945050505050565b600082516115738184602087016112da565b919091019291505056fea26469706673582212208ab10e801fa2cc0d10964181f12d884e2488e415d888ab908ab3d257d0bef82f64736f6c634300081b0033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100a45760003560e01c80631230fa3e146100a957806372eb521e146100be5780637a8df28b146100d15780637b8ae6cf146101305780638129fc1c146101655780638340f5491461016d578063ac9650d814610180578063b1d07de4146101a0578063b2168b6b146101b3578063d6bd603c146101bd578063f93f1cd0146101d0578063f940e385146101e3575b600080fd5b6100bc6100b736600461111c565b6101f6565b005b6100bc6100cc36600461119a565b61058c565b6101106100df3660046111e5565b6000602081815293815260408082208552928152828120909352825290208054600182015460029092015490919083565b604080519384526020840192909252908201526060015b60405180910390f35b6101577f000000000000000000000000000000000000000000000000000000000000000081565b604051908152602001610127565b6100bc610625565b6100bc61017b366004611228565b61071d565b61019361018e366004611265565b6107b5565b60405161012791906112fe565b6100bc6101ae36600461137e565b61089d565b6101576276a70081565b6101576101cb3660046111e5565b6109e0565b6100bc6101de366004611228565b610a3e565b6100bc6101f136600461137e565b610bd1565b6101fe610d8f565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561023b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061025f91906113b1565b1561027d57604051639e68cf0b60e01b815260040160405180910390fd5b6001600160a01b038087166000908152602081815260408083203384528252808320938916835292905220805485808210156102da57604051633db4e69160e01b8152600481019290925260248201526044015b60405180910390fd5b5050848160000160008282546102f091906113e9565b9091555060009050610300610db3565b6001600160a01b03166370a08231306040518263ffffffff1660e01b815260040161032b91906113fc565b602060405180830381865afa158015610348573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061036c9190611410565b9050610376610db3565b6001600160a01b031663095ea7b361038c610dd7565b886040518363ffffffff1660e01b81526004016103aa929190611429565b6020604051808303816000875af11580156103c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103ed91906113b1565b506103f6610dd7565b6001600160a01b03166381cd11a08a89898989896040518763ffffffff1660e01b815260040161042b96959493929190611458565b600060405180830381600087803b15801561044557600080fd5b505af1158015610459573d6000803e3d6000fd5b505050506000610467610db3565b6001600160a01b03166370a08231306040518263ffffffff1660e01b815260040161049291906113fc565b602060405180830381865afa1580156104af573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104d39190611410565b90506104df81886114ae565b821482828990919261051557604051631f82726b60e21b81526004810193909352602483019190915260448201526064016102d1565b50339150506001600160a01b038a168b600281111561053657610536611442565b604080516001600160a01b038d81168252602082018d905289168183015290517f399b99b484be516eace7ececa486139581a25b0d2d12dac8bfa0948d07a8c9139181900360600190a450505050505050505050565b610594610d8f565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156105d1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105f591906113b1565b1561061357604051639e68cf0b60e01b815260040160405180910390fd5b61061f84848484610dfb565b50505050565b600061062f610eac565b805490915060ff600160401b82041615906001600160401b03166000811580156106565750825b90506000826001600160401b031660011480156106725750303b155b905081158015610680575080155b1561069e5760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff1916600117855583156106c857845460ff60401b1916600160401b1785555b6106d0610ed5565b831561071657845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b5050505050565b610725610d8f565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610762573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061078691906113b1565b156107a457604051639e68cf0b60e01b815260040160405180910390fd5b6107b033848484610dfb565b505050565b604080516000815260208101909152606090826001600160401b038111156107df576107df6114c1565b60405190808252806020026020018201604052801561081257816020015b60608152602001906001900390816107fd5790505b50915060005b838110156108945761086f30868684818110610836576108366114d7565b905060200281019061084891906114ed565b8560405160200161085b9392919061153a565b604051602081830303815290604052610edf565b838281518110610881576108816114d7565b6020908102919091010152600101610818565b50505b92915050565b6108a5610d8f565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108e2573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061090691906113b1565b1561092457604051639e68cf0b60e01b815260040160405180910390fd5b336000908152602081815260408083206001600160a01b03868116855290835281842090851684529091528120600181015490910361097657604051638cbd172f60e01b815260040160405180910390fd5b60018101805460028301805460009384905592905560408051828152602081018490529192916001600160a01b03868116929088169133917f6c4ed34e7347a8682024ee40d393e45f4075c46c593aaaed3cc3e49dd6933535910160405180910390a45050505050565b6001600160a01b038084166000908152602081815260408083208685168452825280832093851683529290529081206001810154815411610a22576000610a33565b60018101548154610a3391906113e9565b9150505b9392505050565b610a46610d8f565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a83573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aa791906113b1565b15610ac557604051639e68cf0b60e01b815260040160405180910390fd5b60008111610ae657604051633aff1f3760e21b815260040160405180910390fd5b336000908152602081815260408083206001600160a01b0387811685529083528184209086168452909152902080548280821015610b4057604051633db4e69160e01b8152600481019290925260248201526044016102d1565b505060018101829055610b737f0000000000000000000000000000000000000000000000000000000000000000426114ae565b600282018190556040516001600160a01b03808616929087169133917fba109e8a47e57c895aa1802554cd51025499c2b07c3c9b467c70413a4434ffbc91610bc391888252602082015260400190565b60405180910390a450505050565b610bd9610d8f565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c3a91906113b1565b15610c5857604051639e68cf0b60e01b815260040160405180910390fd5b336000908152602081815260408083206001600160a01b038681168552908352818420908516845290915281206002810154909103610caa57604051638cbd172f60e01b815260040160405180910390fd5b60028101544290818110610cda57604051633c50db7960e11b8152600481019290925260248201526044016102d1565b505060008160000154826001015411610cf7578160010154610cfa565b81545b905080826000016000828254610d1091906113e9565b90915550506000600183018190556002830155610d403382610d30610db3565b6001600160a01b03169190610f55565b826001600160a01b0316846001600160a01b0316336001600160a01b03167f3115d1449a7b732c986cba18244e897a450f61e1bb8d589cd2e69e6c8924f9f784604051610bc391815260200190565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b6001600160a01b038085166000908152602081815260408083208785168452825280832093861683529290529081208054839290610e3a9084906114ae565b90915550610e5d90503382610e4d610db3565b6001600160a01b03169190611004565b816001600160a01b0316836001600160a01b0316856001600160a01b03167f7cfff908a4b583f36430b25d75964c458d8ede8a99bd61be750e97ee1b2f3a9684604051610bc391815260200190565b6000807ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00610897565b610edd611045565b565b6060600080846001600160a01b031684604051610efc9190611561565b600060405180830381855af49150503d8060008114610f37576040519150601f19603f3d011682016040523d82523d6000602084013e610f3c565b606091505b5091509150610f4c85838361106a565b95945050505050565b80156107b05760405163a9059cbb60e01b81526001600160a01b0384169063a9059cbb90610f899085908590600401611429565b6020604051808303816000875af1158015610fa8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fcc91906113b1565b6107b05760405162461bcd60e51b815260206004820152600960248201526810ba3930b739b332b960b91b60448201526064016102d1565b80156107b0576040516323b872dd60e01b81526001600160a01b038381166004830152306024830152604482018390528416906323b872dd90606401610f89565b61104d6110bd565b610edd57604051631afcd79f60e31b815260040160405180910390fd5b60608261107f5761107a826110d7565b610a37565b815115801561109657506001600160a01b0384163b155b156110b65783604051639996b31560e01b81526004016102d191906113fc565b5080610a37565b60006110c7610eac565b54600160401b900460ff16919050565b8051156110e75780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b80356001600160a01b038116811461111757600080fd5b919050565b600080600080600080600060e0888a03121561113757600080fd5b87356003811061114657600080fd5b965061115460208901611100565b955061116260408901611100565b94506060880135935061117760808901611100565b925060a0880135915061118c60c08901611100565b905092959891949750929550565b600080600080608085870312156111b057600080fd5b6111b985611100565b93506111c760208601611100565b92506111d560408601611100565b9396929550929360600135925050565b6000806000606084860312156111fa57600080fd5b61120384611100565b925061121160208501611100565b915061121f60408501611100565b90509250925092565b60008060006060848603121561123d57600080fd5b61124684611100565b925061125460208501611100565b929592945050506040919091013590565b6000806020838503121561127857600080fd5b82356001600160401b0381111561128e57600080fd5b8301601f8101851361129f57600080fd5b80356001600160401b038111156112b557600080fd5b8560208260051b84010111156112ca57600080fd5b6020919091019590945092505050565b60005b838110156112f55781810151838201526020016112dd565b50506000910152565b6000602082016020835280845180835260408501915060408160051b86010192506020860160005b8281101561137257603f198786030184528151805180875261134f8160208901602085016112da565b601f01601f19169590950160209081019550938401939190910190600101611326565b50929695505050505050565b6000806040838503121561139157600080fd5b61139a83611100565b91506113a860208401611100565b90509250929050565b6000602082840312156113c357600080fd5b81518015158114610a3757600080fd5b634e487b7160e01b600052601160045260246000fd5b81810381811115610897576108976113d3565b6001600160a01b0391909116815260200190565b60006020828403121561142257600080fd5b5051919050565b6001600160a01b03929092168252602082015260400190565b634e487b7160e01b600052602160045260246000fd5b60c081016003881061147a57634e487b7160e01b600052602160045260246000fd5b9681526001600160a01b03958616602082015260408101949094529184166060840152608083015290911660a09091015290565b80820180821115610897576108976113d3565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261150457600080fd5b8301803591506001600160401b0382111561151e57600080fd5b60200191503681900382131561153357600080fd5b9250929050565b8284823760008382016000815283516115578183602088016112da565b0195945050505050565b600082516115738184602087016112da565b919091019291505056fea26469706673582212208ab10e801fa2cc0d10964181f12d884e2488e415d888ab908ab3d257d0bef82f64736f6c634300081b0033", + "linkReferences": {}, + "deployedLinkReferences": {} +} \ No newline at end of file diff --git a/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/PaymentsEscrow#PaymentsEscrow_ProxyWithABI.json b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/PaymentsEscrow#PaymentsEscrow_ProxyWithABI.json new file mode 100644 index 000000000..c543471bf --- /dev/null +++ b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/PaymentsEscrow#PaymentsEscrow_ProxyWithABI.json @@ -0,0 +1,680 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "PaymentsEscrow", + "sourceName": "contracts/payments/PaymentsEscrow.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "controller", + "type": "address" + }, + { + "internalType": "uint256", + "name": "withdrawEscrowThawingPeriod", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + } + ], + "name": "AddressEmptyCode", + "type": "error" + }, + { + "inputs": [], + "name": "FailedCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "contractName", + "type": "bytes" + } + ], + "name": "GraphDirectoryInvalidZeroAddress", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidInitialization", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "balanceBefore", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "balanceAfter", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "PaymentsEscrowInconsistentCollection", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minBalance", + "type": "uint256" + } + ], + "name": "PaymentsEscrowInsufficientBalance", + "type": "error" + }, + { + "inputs": [], + "name": "PaymentsEscrowInvalidZeroTokens", + "type": "error" + }, + { + "inputs": [], + "name": "PaymentsEscrowIsPaused", + "type": "error" + }, + { + "inputs": [], + "name": "PaymentsEscrowNotThawing", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "currentTimestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "thawEndTimestamp", + "type": "uint256" + } + ], + "name": "PaymentsEscrowStillThawing", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "thawingPeriod", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxWaitPeriod", + "type": "uint256" + } + ], + "name": "PaymentsEscrowThawingPeriodTooLong", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "collector", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensThawing", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "thawEndTimestamp", + "type": "uint256" + } + ], + "name": "CancelThaw", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "collector", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "Deposit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "paymentType", + "type": "uint8" + }, + { + "indexed": true, + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "collector", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "receiverDestination", + "type": "address" + } + ], + "name": "EscrowCollected", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "graphToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "graphStaking", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphPayments", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphEscrow", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "graphController", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphEpochManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphRewardsManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphTokenGateway", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphProxyAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphCuration", + "type": "address" + } + ], + "name": "GraphDirectoryInitialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "collector", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "thawEndTimestamp", + "type": "uint256" + } + ], + "name": "Thaw", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "collector", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "Withdraw", + "type": "event" + }, + { + "inputs": [], + "name": "MAX_WAIT_PERIOD", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "WITHDRAW_ESCROW_THAWING_PERIOD", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "collector", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + } + ], + "name": "cancelThaw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "paymentType", + "type": "uint8" + }, + { + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "address", + "name": "dataService", + "type": "address" + }, + { + "internalType": "uint256", + "name": "dataServiceCut", + "type": "uint256" + }, + { + "internalType": "address", + "name": "receiverDestination", + "type": "address" + } + ], + "name": "collect", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "collector", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "deposit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "internalType": "address", + "name": "collector", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "depositTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "internalType": "address", + "name": "collector", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + } + ], + "name": "escrowAccounts", + "outputs": [ + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokensThawing", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "thawEndTimestamp", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "internalType": "address", + "name": "collector", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + } + ], + "name": "getBalance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "name": "multicall", + "outputs": [ + { + "internalType": "bytes[]", + "name": "results", + "type": "bytes[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "collector", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "thaw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "collector", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + } + ], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "bytecode": "0x6101e060405234801561001157600080fd5b50604051611bb6380380611bb6833981016040819052610030916104ef565b816001600160a01b03811661007a5760405163218f5add60e11b815260206004820152600a60248201526921b7b73a3937b63632b960b11b60448201526064015b60405180910390fd5b6001600160a01b0381166101005260408051808201909152600a81526923b930b8342a37b5b2b760b11b60208201526100b290610373565b6001600160a01b03166080526040805180820190915260078152665374616b696e6760c81b60208201526100e590610373565b6001600160a01b031660a05260408051808201909152600d81526c47726170685061796d656e747360981b602082015261011e90610373565b6001600160a01b031660c05260408051808201909152600e81526d5061796d656e7473457363726f7760901b602082015261015890610373565b6001600160a01b031660e05260408051808201909152600c81526b22b837b1b426b0b730b3b2b960a11b602082015261019090610373565b6001600160a01b03166101205260408051808201909152600e81526d2932bbb0b93239a6b0b730b3b2b960911b60208201526101cb90610373565b6001600160a01b0316610140526040805180820190915260118152704772617068546f6b656e4761746577617960781b602082015261020990610373565b6001600160a01b03166101605260408051808201909152600f81526e23b930b834283937bc3ca0b236b4b760891b602082015261024590610373565b6001600160a01b03166101805260408051808201909152600881526721bab930ba34b7b760c11b602082015261027a90610373565b6001600160a01b039081166101a08190526101005160a05160805160c05160e05161012051610140516101605161018051604051988b169a9788169996909716977fef5021414834d86e36470f5c1cecf6544fb2bb723f2ca51a4c86fcd8c5919a43976103249790916001600160a01b03978816815295871660208701529386166040860152918516606085015284166080840152831660a083015290911660c082015260e00190565b60405180910390a450806276a7008082111561035c57604051635c0f65a160e01b815260048101929092526024820152604401610071565b50506101c081905261036c610421565b505061058b565b600080610100516001600160a01b031663f7641a5e84805190602001206040518263ffffffff1660e01b81526004016103ae91815260200190565b602060405180830381865afa1580156103cb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103ef919061051b565b9050826001600160a01b03821661041a5760405163218f5add60e11b8152600401610071919061053d565b5092915050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff16156104715760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b03908116146104d05780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b80516001600160a01b03811681146104ea57600080fd5b919050565b6000806040838503121561050257600080fd5b61050b836104d3565b9150602083015190509250929050565b60006020828403121561052d57600080fd5b610536826104d3565b9392505050565b602081526000825180602084015260005b8181101561056b576020818601810151604086840101520161054e565b506000604082850101526040601f19601f83011684010191505092915050565b60805160a05160c05160e05161010051610120516101405161016051610180516101a0516101c0516115b3610603600039600081816101350152610b4e015260005050600050506000505060005050600050506000610d910152600050506000610dd90152600050506000610db501526115b36000f3fe608060405234801561001057600080fd5b50600436106100a45760003560e01c80631230fa3e146100a957806372eb521e146100be5780637a8df28b146100d15780637b8ae6cf146101305780638129fc1c146101655780638340f5491461016d578063ac9650d814610180578063b1d07de4146101a0578063b2168b6b146101b3578063d6bd603c146101bd578063f93f1cd0146101d0578063f940e385146101e3575b600080fd5b6100bc6100b736600461111c565b6101f6565b005b6100bc6100cc36600461119a565b61058c565b6101106100df3660046111e5565b6000602081815293815260408082208552928152828120909352825290208054600182015460029092015490919083565b604080519384526020840192909252908201526060015b60405180910390f35b6101577f000000000000000000000000000000000000000000000000000000000000000081565b604051908152602001610127565b6100bc610625565b6100bc61017b366004611228565b61071d565b61019361018e366004611265565b6107b5565b60405161012791906112fe565b6100bc6101ae36600461137e565b61089d565b6101576276a70081565b6101576101cb3660046111e5565b6109e0565b6100bc6101de366004611228565b610a3e565b6100bc6101f136600461137e565b610bd1565b6101fe610d8f565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561023b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061025f91906113b1565b1561027d57604051639e68cf0b60e01b815260040160405180910390fd5b6001600160a01b038087166000908152602081815260408083203384528252808320938916835292905220805485808210156102da57604051633db4e69160e01b8152600481019290925260248201526044015b60405180910390fd5b5050848160000160008282546102f091906113e9565b9091555060009050610300610db3565b6001600160a01b03166370a08231306040518263ffffffff1660e01b815260040161032b91906113fc565b602060405180830381865afa158015610348573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061036c9190611410565b9050610376610db3565b6001600160a01b031663095ea7b361038c610dd7565b886040518363ffffffff1660e01b81526004016103aa929190611429565b6020604051808303816000875af11580156103c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103ed91906113b1565b506103f6610dd7565b6001600160a01b03166381cd11a08a89898989896040518763ffffffff1660e01b815260040161042b96959493929190611458565b600060405180830381600087803b15801561044557600080fd5b505af1158015610459573d6000803e3d6000fd5b505050506000610467610db3565b6001600160a01b03166370a08231306040518263ffffffff1660e01b815260040161049291906113fc565b602060405180830381865afa1580156104af573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104d39190611410565b90506104df81886114ae565b821482828990919261051557604051631f82726b60e21b81526004810193909352602483019190915260448201526064016102d1565b50339150506001600160a01b038a168b600281111561053657610536611442565b604080516001600160a01b038d81168252602082018d905289168183015290517f399b99b484be516eace7ececa486139581a25b0d2d12dac8bfa0948d07a8c9139181900360600190a450505050505050505050565b610594610d8f565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156105d1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105f591906113b1565b1561061357604051639e68cf0b60e01b815260040160405180910390fd5b61061f84848484610dfb565b50505050565b600061062f610eac565b805490915060ff600160401b82041615906001600160401b03166000811580156106565750825b90506000826001600160401b031660011480156106725750303b155b905081158015610680575080155b1561069e5760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff1916600117855583156106c857845460ff60401b1916600160401b1785555b6106d0610ed5565b831561071657845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b5050505050565b610725610d8f565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610762573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061078691906113b1565b156107a457604051639e68cf0b60e01b815260040160405180910390fd5b6107b033848484610dfb565b505050565b604080516000815260208101909152606090826001600160401b038111156107df576107df6114c1565b60405190808252806020026020018201604052801561081257816020015b60608152602001906001900390816107fd5790505b50915060005b838110156108945761086f30868684818110610836576108366114d7565b905060200281019061084891906114ed565b8560405160200161085b9392919061153a565b604051602081830303815290604052610edf565b838281518110610881576108816114d7565b6020908102919091010152600101610818565b50505b92915050565b6108a5610d8f565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108e2573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061090691906113b1565b1561092457604051639e68cf0b60e01b815260040160405180910390fd5b336000908152602081815260408083206001600160a01b03868116855290835281842090851684529091528120600181015490910361097657604051638cbd172f60e01b815260040160405180910390fd5b60018101805460028301805460009384905592905560408051828152602081018490529192916001600160a01b03868116929088169133917f6c4ed34e7347a8682024ee40d393e45f4075c46c593aaaed3cc3e49dd6933535910160405180910390a45050505050565b6001600160a01b038084166000908152602081815260408083208685168452825280832093851683529290529081206001810154815411610a22576000610a33565b60018101548154610a3391906113e9565b9150505b9392505050565b610a46610d8f565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a83573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aa791906113b1565b15610ac557604051639e68cf0b60e01b815260040160405180910390fd5b60008111610ae657604051633aff1f3760e21b815260040160405180910390fd5b336000908152602081815260408083206001600160a01b0387811685529083528184209086168452909152902080548280821015610b4057604051633db4e69160e01b8152600481019290925260248201526044016102d1565b505060018101829055610b737f0000000000000000000000000000000000000000000000000000000000000000426114ae565b600282018190556040516001600160a01b03808616929087169133917fba109e8a47e57c895aa1802554cd51025499c2b07c3c9b467c70413a4434ffbc91610bc391888252602082015260400190565b60405180910390a450505050565b610bd9610d8f565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c3a91906113b1565b15610c5857604051639e68cf0b60e01b815260040160405180910390fd5b336000908152602081815260408083206001600160a01b038681168552908352818420908516845290915281206002810154909103610caa57604051638cbd172f60e01b815260040160405180910390fd5b60028101544290818110610cda57604051633c50db7960e11b8152600481019290925260248201526044016102d1565b505060008160000154826001015411610cf7578160010154610cfa565b81545b905080826000016000828254610d1091906113e9565b90915550506000600183018190556002830155610d403382610d30610db3565b6001600160a01b03169190610f55565b826001600160a01b0316846001600160a01b0316336001600160a01b03167f3115d1449a7b732c986cba18244e897a450f61e1bb8d589cd2e69e6c8924f9f784604051610bc391815260200190565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b6001600160a01b038085166000908152602081815260408083208785168452825280832093861683529290529081208054839290610e3a9084906114ae565b90915550610e5d90503382610e4d610db3565b6001600160a01b03169190611004565b816001600160a01b0316836001600160a01b0316856001600160a01b03167f7cfff908a4b583f36430b25d75964c458d8ede8a99bd61be750e97ee1b2f3a9684604051610bc391815260200190565b6000807ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00610897565b610edd611045565b565b6060600080846001600160a01b031684604051610efc9190611561565b600060405180830381855af49150503d8060008114610f37576040519150601f19603f3d011682016040523d82523d6000602084013e610f3c565b606091505b5091509150610f4c85838361106a565b95945050505050565b80156107b05760405163a9059cbb60e01b81526001600160a01b0384169063a9059cbb90610f899085908590600401611429565b6020604051808303816000875af1158015610fa8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fcc91906113b1565b6107b05760405162461bcd60e51b815260206004820152600960248201526810ba3930b739b332b960b91b60448201526064016102d1565b80156107b0576040516323b872dd60e01b81526001600160a01b038381166004830152306024830152604482018390528416906323b872dd90606401610f89565b61104d6110bd565b610edd57604051631afcd79f60e31b815260040160405180910390fd5b60608261107f5761107a826110d7565b610a37565b815115801561109657506001600160a01b0384163b155b156110b65783604051639996b31560e01b81526004016102d191906113fc565b5080610a37565b60006110c7610eac565b54600160401b900460ff16919050565b8051156110e75780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b80356001600160a01b038116811461111757600080fd5b919050565b600080600080600080600060e0888a03121561113757600080fd5b87356003811061114657600080fd5b965061115460208901611100565b955061116260408901611100565b94506060880135935061117760808901611100565b925060a0880135915061118c60c08901611100565b905092959891949750929550565b600080600080608085870312156111b057600080fd5b6111b985611100565b93506111c760208601611100565b92506111d560408601611100565b9396929550929360600135925050565b6000806000606084860312156111fa57600080fd5b61120384611100565b925061121160208501611100565b915061121f60408501611100565b90509250925092565b60008060006060848603121561123d57600080fd5b61124684611100565b925061125460208501611100565b929592945050506040919091013590565b6000806020838503121561127857600080fd5b82356001600160401b0381111561128e57600080fd5b8301601f8101851361129f57600080fd5b80356001600160401b038111156112b557600080fd5b8560208260051b84010111156112ca57600080fd5b6020919091019590945092505050565b60005b838110156112f55781810151838201526020016112dd565b50506000910152565b6000602082016020835280845180835260408501915060408160051b86010192506020860160005b8281101561137257603f198786030184528151805180875261134f8160208901602085016112da565b601f01601f19169590950160209081019550938401939190910190600101611326565b50929695505050505050565b6000806040838503121561139157600080fd5b61139a83611100565b91506113a860208401611100565b90509250929050565b6000602082840312156113c357600080fd5b81518015158114610a3757600080fd5b634e487b7160e01b600052601160045260246000fd5b81810381811115610897576108976113d3565b6001600160a01b0391909116815260200190565b60006020828403121561142257600080fd5b5051919050565b6001600160a01b03929092168252602082015260400190565b634e487b7160e01b600052602160045260246000fd5b60c081016003881061147a57634e487b7160e01b600052602160045260246000fd5b9681526001600160a01b03958616602082015260408101949094529184166060840152608083015290911660a09091015290565b80820180821115610897576108976113d3565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261150457600080fd5b8301803591506001600160401b0382111561151e57600080fd5b60200191503681900382131561153357600080fd5b9250929050565b8284823760008382016000815283516115578183602088016112da565b0195945050505050565b600082516115738184602087016112da565b919091019291505056fea26469706673582212208ab10e801fa2cc0d10964181f12d884e2488e415d888ab908ab3d257d0bef82f64736f6c634300081b0033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100a45760003560e01c80631230fa3e146100a957806372eb521e146100be5780637a8df28b146100d15780637b8ae6cf146101305780638129fc1c146101655780638340f5491461016d578063ac9650d814610180578063b1d07de4146101a0578063b2168b6b146101b3578063d6bd603c146101bd578063f93f1cd0146101d0578063f940e385146101e3575b600080fd5b6100bc6100b736600461111c565b6101f6565b005b6100bc6100cc36600461119a565b61058c565b6101106100df3660046111e5565b6000602081815293815260408082208552928152828120909352825290208054600182015460029092015490919083565b604080519384526020840192909252908201526060015b60405180910390f35b6101577f000000000000000000000000000000000000000000000000000000000000000081565b604051908152602001610127565b6100bc610625565b6100bc61017b366004611228565b61071d565b61019361018e366004611265565b6107b5565b60405161012791906112fe565b6100bc6101ae36600461137e565b61089d565b6101576276a70081565b6101576101cb3660046111e5565b6109e0565b6100bc6101de366004611228565b610a3e565b6100bc6101f136600461137e565b610bd1565b6101fe610d8f565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561023b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061025f91906113b1565b1561027d57604051639e68cf0b60e01b815260040160405180910390fd5b6001600160a01b038087166000908152602081815260408083203384528252808320938916835292905220805485808210156102da57604051633db4e69160e01b8152600481019290925260248201526044015b60405180910390fd5b5050848160000160008282546102f091906113e9565b9091555060009050610300610db3565b6001600160a01b03166370a08231306040518263ffffffff1660e01b815260040161032b91906113fc565b602060405180830381865afa158015610348573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061036c9190611410565b9050610376610db3565b6001600160a01b031663095ea7b361038c610dd7565b886040518363ffffffff1660e01b81526004016103aa929190611429565b6020604051808303816000875af11580156103c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103ed91906113b1565b506103f6610dd7565b6001600160a01b03166381cd11a08a89898989896040518763ffffffff1660e01b815260040161042b96959493929190611458565b600060405180830381600087803b15801561044557600080fd5b505af1158015610459573d6000803e3d6000fd5b505050506000610467610db3565b6001600160a01b03166370a08231306040518263ffffffff1660e01b815260040161049291906113fc565b602060405180830381865afa1580156104af573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104d39190611410565b90506104df81886114ae565b821482828990919261051557604051631f82726b60e21b81526004810193909352602483019190915260448201526064016102d1565b50339150506001600160a01b038a168b600281111561053657610536611442565b604080516001600160a01b038d81168252602082018d905289168183015290517f399b99b484be516eace7ececa486139581a25b0d2d12dac8bfa0948d07a8c9139181900360600190a450505050505050505050565b610594610d8f565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156105d1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105f591906113b1565b1561061357604051639e68cf0b60e01b815260040160405180910390fd5b61061f84848484610dfb565b50505050565b600061062f610eac565b805490915060ff600160401b82041615906001600160401b03166000811580156106565750825b90506000826001600160401b031660011480156106725750303b155b905081158015610680575080155b1561069e5760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff1916600117855583156106c857845460ff60401b1916600160401b1785555b6106d0610ed5565b831561071657845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b5050505050565b610725610d8f565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610762573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061078691906113b1565b156107a457604051639e68cf0b60e01b815260040160405180910390fd5b6107b033848484610dfb565b505050565b604080516000815260208101909152606090826001600160401b038111156107df576107df6114c1565b60405190808252806020026020018201604052801561081257816020015b60608152602001906001900390816107fd5790505b50915060005b838110156108945761086f30868684818110610836576108366114d7565b905060200281019061084891906114ed565b8560405160200161085b9392919061153a565b604051602081830303815290604052610edf565b838281518110610881576108816114d7565b6020908102919091010152600101610818565b50505b92915050565b6108a5610d8f565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108e2573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061090691906113b1565b1561092457604051639e68cf0b60e01b815260040160405180910390fd5b336000908152602081815260408083206001600160a01b03868116855290835281842090851684529091528120600181015490910361097657604051638cbd172f60e01b815260040160405180910390fd5b60018101805460028301805460009384905592905560408051828152602081018490529192916001600160a01b03868116929088169133917f6c4ed34e7347a8682024ee40d393e45f4075c46c593aaaed3cc3e49dd6933535910160405180910390a45050505050565b6001600160a01b038084166000908152602081815260408083208685168452825280832093851683529290529081206001810154815411610a22576000610a33565b60018101548154610a3391906113e9565b9150505b9392505050565b610a46610d8f565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a83573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aa791906113b1565b15610ac557604051639e68cf0b60e01b815260040160405180910390fd5b60008111610ae657604051633aff1f3760e21b815260040160405180910390fd5b336000908152602081815260408083206001600160a01b0387811685529083528184209086168452909152902080548280821015610b4057604051633db4e69160e01b8152600481019290925260248201526044016102d1565b505060018101829055610b737f0000000000000000000000000000000000000000000000000000000000000000426114ae565b600282018190556040516001600160a01b03808616929087169133917fba109e8a47e57c895aa1802554cd51025499c2b07c3c9b467c70413a4434ffbc91610bc391888252602082015260400190565b60405180910390a450505050565b610bd9610d8f565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c3a91906113b1565b15610c5857604051639e68cf0b60e01b815260040160405180910390fd5b336000908152602081815260408083206001600160a01b038681168552908352818420908516845290915281206002810154909103610caa57604051638cbd172f60e01b815260040160405180910390fd5b60028101544290818110610cda57604051633c50db7960e11b8152600481019290925260248201526044016102d1565b505060008160000154826001015411610cf7578160010154610cfa565b81545b905080826000016000828254610d1091906113e9565b90915550506000600183018190556002830155610d403382610d30610db3565b6001600160a01b03169190610f55565b826001600160a01b0316846001600160a01b0316336001600160a01b03167f3115d1449a7b732c986cba18244e897a450f61e1bb8d589cd2e69e6c8924f9f784604051610bc391815260200190565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b6001600160a01b038085166000908152602081815260408083208785168452825280832093861683529290529081208054839290610e3a9084906114ae565b90915550610e5d90503382610e4d610db3565b6001600160a01b03169190611004565b816001600160a01b0316836001600160a01b0316856001600160a01b03167f7cfff908a4b583f36430b25d75964c458d8ede8a99bd61be750e97ee1b2f3a9684604051610bc391815260200190565b6000807ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00610897565b610edd611045565b565b6060600080846001600160a01b031684604051610efc9190611561565b600060405180830381855af49150503d8060008114610f37576040519150601f19603f3d011682016040523d82523d6000602084013e610f3c565b606091505b5091509150610f4c85838361106a565b95945050505050565b80156107b05760405163a9059cbb60e01b81526001600160a01b0384169063a9059cbb90610f899085908590600401611429565b6020604051808303816000875af1158015610fa8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fcc91906113b1565b6107b05760405162461bcd60e51b815260206004820152600960248201526810ba3930b739b332b960b91b60448201526064016102d1565b80156107b0576040516323b872dd60e01b81526001600160a01b038381166004830152306024830152604482018390528416906323b872dd90606401610f89565b61104d6110bd565b610edd57604051631afcd79f60e31b815260040160405180910390fd5b60608261107f5761107a826110d7565b610a37565b815115801561109657506001600160a01b0384163b155b156110b65783604051639996b31560e01b81526004016102d191906113fc565b5080610a37565b60006110c7610eac565b54600160401b900460ff16919050565b8051156110e75780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b80356001600160a01b038116811461111757600080fd5b919050565b600080600080600080600060e0888a03121561113757600080fd5b87356003811061114657600080fd5b965061115460208901611100565b955061116260408901611100565b94506060880135935061117760808901611100565b925060a0880135915061118c60c08901611100565b905092959891949750929550565b600080600080608085870312156111b057600080fd5b6111b985611100565b93506111c760208601611100565b92506111d560408601611100565b9396929550929360600135925050565b6000806000606084860312156111fa57600080fd5b61120384611100565b925061121160208501611100565b915061121f60408501611100565b90509250925092565b60008060006060848603121561123d57600080fd5b61124684611100565b925061125460208501611100565b929592945050506040919091013590565b6000806020838503121561127857600080fd5b82356001600160401b0381111561128e57600080fd5b8301601f8101851361129f57600080fd5b80356001600160401b038111156112b557600080fd5b8560208260051b84010111156112ca57600080fd5b6020919091019590945092505050565b60005b838110156112f55781810151838201526020016112dd565b50506000910152565b6000602082016020835280845180835260408501915060408160051b86010192506020860160005b8281101561137257603f198786030184528151805180875261134f8160208901602085016112da565b601f01601f19169590950160209081019550938401939190910190600101611326565b50929695505050505050565b6000806040838503121561139157600080fd5b61139a83611100565b91506113a860208401611100565b90509250929050565b6000602082840312156113c357600080fd5b81518015158114610a3757600080fd5b634e487b7160e01b600052601160045260246000fd5b81810381811115610897576108976113d3565b6001600160a01b0391909116815260200190565b60006020828403121561142257600080fd5b5051919050565b6001600160a01b03929092168252602082015260400190565b634e487b7160e01b600052602160045260246000fd5b60c081016003881061147a57634e487b7160e01b600052602160045260246000fd5b9681526001600160a01b03958616602082015260408101949094529184166060840152608083015290911660a09091015290565b80820180821115610897576108976113d3565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261150457600080fd5b8301803591506001600160401b0382111561151e57600080fd5b60200191503681900382131561153357600080fd5b9250929050565b8284823760008382016000815283516115578183602088016112da565b0195945050505050565b600082516115738184602087016112da565b919091019291505056fea26469706673582212208ab10e801fa2cc0d10964181f12d884e2488e415d888ab908ab3d257d0bef82f64736f6c634300081b0033", + "linkReferences": {}, + "deployedLinkReferences": {} +} \ No newline at end of file diff --git a/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/RewardsManager#GraphProxy.json b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/RewardsManager#GraphProxy.json new file mode 100644 index 000000000..2cfb21e41 --- /dev/null +++ b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/RewardsManager#GraphProxy.json @@ -0,0 +1,177 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "GraphProxy", + "sourceName": "contracts/upgrades/GraphProxy.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_impl", + "type": "address" + }, + { + "internalType": "address", + "name": "_admin", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldAdmin", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldImplementation", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "ImplementationUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldPendingImplementation", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newPendingImplementation", + "type": "address" + } + ], + "name": "PendingImplementationUpdated", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "acceptUpgrade", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "acceptUpgradeAndCall", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "pendingImplementation", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newAdmin", + "type": "address" + } + ], + "name": "setAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "bytecode": "0x608060405234801561001057600080fd5b50604051610a12380380610a128339818101604052604081101561003357600080fd5b50805160209091015161004581610055565b61004e826100b3565b5050610137565b600061005f610111565b6000805160206109d2833981519152838155604051919250906001600160a01b0380851691908416907f101b8081ff3b56bbf45deb824d86a3b0fd38b7e3dd42421105cf8abe9106db0b90600090a3505050565b60006100bd610124565b6000805160206109f2833981519152838155604051919250906001600160a01b0380851691908416907f980c0d30fe97457c47903527d88b7009a1643be6de24d2af664214919f0540a190600090a3505050565b6000805160206109d28339815191525490565b6000805160206109f28339815191525490565b61088c806101466000396000f3fe6080604052600436106100745760003560e01c80635c60da1b1161004e5780635c60da1b14610104578063623faf6114610119578063704b6c0214610196578063f851a440146101c957610083565b80633659cfe61461008b578063396f7b23146100be57806359fc20bb146100ef57610083565b36610083576100816101de565b005b6100816101de565b34801561009757600080fd5b50610081600480360360208110156100ae57600080fd5b50356001600160a01b031661029e565b3480156100ca57600080fd5b506100d36102d8565b604080516001600160a01b039092168252519081900360200190f35b3480156100fb57600080fd5b50610081610338565b34801561011057600080fd5b506100d3610393565b34801561012557600080fd5b506100816004803603602081101561013c57600080fd5b81019060208101813564010000000081111561015757600080fd5b82018360208201111561016957600080fd5b8035906020019184600183028401116401000000008311171561018b57600080fd5b5090925090506103e1565b3480156101a257600080fd5b50610081600480360360208110156101b957600080fd5b50356001600160a01b03166104f1565b3480156101d557600080fd5b506100d3610576565b6101e66105c0565b6001600160a01b0316336001600160a01b0316141561024c576040805162461bcd60e51b815260206004820152601f60248201527f43616e6e6f742066616c6c6261636b20746f2070726f78792074617267657400604482015290519081900360640190fd5b6040516001600160a01b037f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc541636600083376000803684845af490503d806000843e81801561029a578184f35b8184fd5b6102a66105c0565b6001600160a01b0316336001600160a01b031614156102cd576102c8816105e5565b6102d5565b6102d56101de565b50565b60006102e26105c0565b6001600160a01b0316336001600160a01b031614806103195750610304610655565b6001600160a01b0316336001600160a01b0316145b1561032d57610326610655565b9050610335565b6103356101de565b90565b6103406105c0565b6001600160a01b0316336001600160a01b031614806103775750610362610655565b6001600160a01b0316336001600160a01b0316145b156103895761038461067a565b610391565b6103916101de565b565b600061039d6105c0565b6001600160a01b0316336001600160a01b031614806103d457506103bf610655565b6001600160a01b0316336001600160a01b0316145b1561032d57610326610751565b6103e96105c0565b6001600160a01b0316336001600160a01b03161480610420575061040b610655565b6001600160a01b0316336001600160a01b0316145b156104e55761042d61067a565b6000610437610751565b6001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d8060008114610491576040519150601f19603f3d011682016040523d82523d6000602084013e610496565b606091505b50509050806104df576040805162461bcd60e51b815260206004820152601060248201526f125b5c1b0818d85b1b0819985a5b195960821b604482015290519081900360640190fd5b506104ed565b6104ed6101de565b5050565b6104f96105c0565b6001600160a01b0316336001600160a01b031614156102cd576001600160a01b03811661056d576040805162461bcd60e51b815260206004820152601e60248201527f41646d696e2063616e7420626520746865207a65726f20616464726573730000604482015290519081900360640190fd5b6102c881610776565b60006105806105c0565b6001600160a01b0316336001600160a01b031614806105b757506105a2610655565b6001600160a01b0316336001600160a01b0316145b1561032d576103265b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b60006105ef610655565b7f9e5eddc59e0b171f57125ab86bee043d9128098c3a6b9adb4f2e86333c2f6f8c838155604051919250906001600160a01b0380851691908416907f980c0d30fe97457c47903527d88b7009a1643be6de24d2af664214919f0540a190600090a3505050565b7f9e5eddc59e0b171f57125ab86bee043d9128098c3a6b9adb4f2e86333c2f6f8c5490565b6000610684610655565b90506001600160a01b0381166106e1576040805162461bcd60e51b815260206004820152601b60248201527f496d706c2063616e6e6f74206265207a65726f20616464726573730000000000604482015290519081900360640190fd5b336001600160a01b0382161461073e576040805162461bcd60e51b815260206004820152601b60248201527f4f6e6c792070656e64696e6720696d706c656d656e746174696f6e0000000000604482015290519081900360640190fd5b610747816107e6565b6102d560006105e5565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b60006107806105c0565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103838155604051919250906001600160a01b0380851691908416907f101b8081ff3b56bbf45deb824d86a3b0fd38b7e3dd42421105cf8abe9106db0b90600090a3505050565b60006107f0610751565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc838155604051919250906001600160a01b0380851691908416907faa3f731066a578e5f39b4215468d826cdd15373cbc0dfc9cb9bdc649718ef7da90600090a350505056fea264697066735822122041ce882775d17ef838c17f08249aa48a5f3ea1c65b581e69896452640b274de264736f6c63430007060033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61039e5eddc59e0b171f57125ab86bee043d9128098c3a6b9adb4f2e86333c2f6f8c", + "deployedBytecode": "0x6080604052600436106100745760003560e01c80635c60da1b1161004e5780635c60da1b14610104578063623faf6114610119578063704b6c0214610196578063f851a440146101c957610083565b80633659cfe61461008b578063396f7b23146100be57806359fc20bb146100ef57610083565b36610083576100816101de565b005b6100816101de565b34801561009757600080fd5b50610081600480360360208110156100ae57600080fd5b50356001600160a01b031661029e565b3480156100ca57600080fd5b506100d36102d8565b604080516001600160a01b039092168252519081900360200190f35b3480156100fb57600080fd5b50610081610338565b34801561011057600080fd5b506100d3610393565b34801561012557600080fd5b506100816004803603602081101561013c57600080fd5b81019060208101813564010000000081111561015757600080fd5b82018360208201111561016957600080fd5b8035906020019184600183028401116401000000008311171561018b57600080fd5b5090925090506103e1565b3480156101a257600080fd5b50610081600480360360208110156101b957600080fd5b50356001600160a01b03166104f1565b3480156101d557600080fd5b506100d3610576565b6101e66105c0565b6001600160a01b0316336001600160a01b0316141561024c576040805162461bcd60e51b815260206004820152601f60248201527f43616e6e6f742066616c6c6261636b20746f2070726f78792074617267657400604482015290519081900360640190fd5b6040516001600160a01b037f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc541636600083376000803684845af490503d806000843e81801561029a578184f35b8184fd5b6102a66105c0565b6001600160a01b0316336001600160a01b031614156102cd576102c8816105e5565b6102d5565b6102d56101de565b50565b60006102e26105c0565b6001600160a01b0316336001600160a01b031614806103195750610304610655565b6001600160a01b0316336001600160a01b0316145b1561032d57610326610655565b9050610335565b6103356101de565b90565b6103406105c0565b6001600160a01b0316336001600160a01b031614806103775750610362610655565b6001600160a01b0316336001600160a01b0316145b156103895761038461067a565b610391565b6103916101de565b565b600061039d6105c0565b6001600160a01b0316336001600160a01b031614806103d457506103bf610655565b6001600160a01b0316336001600160a01b0316145b1561032d57610326610751565b6103e96105c0565b6001600160a01b0316336001600160a01b03161480610420575061040b610655565b6001600160a01b0316336001600160a01b0316145b156104e55761042d61067a565b6000610437610751565b6001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d8060008114610491576040519150601f19603f3d011682016040523d82523d6000602084013e610496565b606091505b50509050806104df576040805162461bcd60e51b815260206004820152601060248201526f125b5c1b0818d85b1b0819985a5b195960821b604482015290519081900360640190fd5b506104ed565b6104ed6101de565b5050565b6104f96105c0565b6001600160a01b0316336001600160a01b031614156102cd576001600160a01b03811661056d576040805162461bcd60e51b815260206004820152601e60248201527f41646d696e2063616e7420626520746865207a65726f20616464726573730000604482015290519081900360640190fd5b6102c881610776565b60006105806105c0565b6001600160a01b0316336001600160a01b031614806105b757506105a2610655565b6001600160a01b0316336001600160a01b0316145b1561032d576103265b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b60006105ef610655565b7f9e5eddc59e0b171f57125ab86bee043d9128098c3a6b9adb4f2e86333c2f6f8c838155604051919250906001600160a01b0380851691908416907f980c0d30fe97457c47903527d88b7009a1643be6de24d2af664214919f0540a190600090a3505050565b7f9e5eddc59e0b171f57125ab86bee043d9128098c3a6b9adb4f2e86333c2f6f8c5490565b6000610684610655565b90506001600160a01b0381166106e1576040805162461bcd60e51b815260206004820152601b60248201527f496d706c2063616e6e6f74206265207a65726f20616464726573730000000000604482015290519081900360640190fd5b336001600160a01b0382161461073e576040805162461bcd60e51b815260206004820152601b60248201527f4f6e6c792070656e64696e6720696d706c656d656e746174696f6e0000000000604482015290519081900360640190fd5b610747816107e6565b6102d560006105e5565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b60006107806105c0565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103838155604051919250906001600160a01b0380851691908416907f101b8081ff3b56bbf45deb824d86a3b0fd38b7e3dd42421105cf8abe9106db0b90600090a3505050565b60006107f0610751565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc838155604051919250906001600160a01b0380851691908416907faa3f731066a578e5f39b4215468d826cdd15373cbc0dfc9cb9bdc649718ef7da90600090a350505056fea264697066735822122041ce882775d17ef838c17f08249aa48a5f3ea1c65b581e69896452640b274de264736f6c63430007060033", + "linkReferences": {}, + "deployedLinkReferences": {} +} \ No newline at end of file diff --git a/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/RewardsManager#RewardsManager.json b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/RewardsManager#RewardsManager.json new file mode 100644 index 000000000..fe6be7a77 --- /dev/null +++ b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/RewardsManager#RewardsManager.json @@ -0,0 +1,622 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "RewardsManager", + "sourceName": "contracts/rewards/RewardsManager.sol", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "nameHash", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "contractAddress", + "type": "address" + } + ], + "name": "ContractSynced", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "allocationID", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "HorizonRewardsAssigned", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "param", + "type": "string" + } + ], + "name": "ParameterUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "allocationID", + "type": "address" + } + ], + "name": "RewardsDenied", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "subgraphDeploymentID", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "sinceBlock", + "type": "uint256" + } + ], + "name": "RewardsDenylistUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "controller", + "type": "address" + } + ], + "name": "SetController", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldSubgraphService", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newSubgraphService", + "type": "address" + } + ], + "name": "SubgraphServiceSet", + "type": "event" + }, + { + "inputs": [], + "name": "accRewardsPerSignal", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "accRewardsPerSignalLastBlockUpdated", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IGraphProxy", + "name": "_proxy", + "type": "address" + } + ], + "name": "acceptProxy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IGraphProxy", + "name": "_proxy", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "acceptProxyAndCall", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_accRewardsPerAllocatedToken", + "type": "uint256" + } + ], + "name": "calcRewards", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "controller", + "outputs": [ + { + "internalType": "contract IController", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "denylist", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + } + ], + "name": "getAccRewardsForSubgraph", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + } + ], + "name": "getAccRewardsPerAllocatedToken", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getAccRewardsPerSignal", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getNewRewardsPerSignal", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_rewardsIssuer", + "type": "address" + }, + { + "internalType": "address", + "name": "_allocationID", + "type": "address" + } + ], + "name": "getRewards", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_controller", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + } + ], + "name": "isDenied", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "issuancePerBlock", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "minimumSubgraphSignal", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + } + ], + "name": "onSubgraphAllocationUpdate", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + } + ], + "name": "onSubgraphSignalUpdate", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_controller", + "type": "address" + } + ], + "name": "setController", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + }, + { + "internalType": "bool", + "name": "_deny", + "type": "bool" + } + ], + "name": "setDenied", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_issuancePerBlock", + "type": "uint256" + } + ], + "name": "setIssuancePerBlock", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_minimumSubgraphSignal", + "type": "uint256" + } + ], + "name": "setMinimumSubgraphSignal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_subgraphAvailabilityOracle", + "type": "address" + } + ], + "name": "setSubgraphAvailabilityOracle", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_subgraphService", + "type": "address" + } + ], + "name": "setSubgraphService", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "subgraphAvailabilityOracle", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "subgraphService", + "outputs": [ + { + "internalType": "contract IRewardsIssuer", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "subgraphs", + "outputs": [ + { + "internalType": "uint256", + "name": "accRewardsForSubgraph", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "accRewardsForSubgraphSnapshot", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "accRewardsPerSignalSnapshot", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "accRewardsPerAllocatedToken", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "syncAllContracts", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_allocationID", + "type": "address" + } + ], + "name": "takeRewards", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "updateAccRewardsPerSignal", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "bytecode": "0x6101606040527fe6876326c1291dfcbbd3864a6816d698cd591defc7aa2153d7f9c4c04016c89f6080527fc713c3df6d14cdf946460395d09af88993ee2b948b1a808161494e32c5f6706360a0527f966f1e8d8d8014e05f6ec4a57138da9be1f7c5a7f802928a18072f7c5318076160c0527f1df41cd916959d1163dc8f0671a666ea8a3e434c13e40faef527133b5d16703460e0527f45fc200c7e4544e457d3c5709bfe0d520442c30bbcbdaede89e8d4a4bbc19247610100527fd362cac9cb75c10d67bcc0b7eeb0b1ef48bb5420b556c092d4fd7f758816fcf0610120527f39605a6c26a173774ca666c67ef70cf491880e5d3d6d0ca66ec0a31034f15ea36101405234801561011057600080fd5b5060805160a05160c05160e051610100516101205161014051611ca761017360003980610e60525080610e37525080610e0e52806117d9525080610de5528061155c525080610dbc525080610d93525080610d6a52806113a05250611ca76000f3fe608060405234801561001057600080fd5b50600436106101da5760003560e01c806393a90a1e11610104578063c8a5f81e116100a2578063e284f84811610071578063e284f848146103ad578063e820e284146103b5578063eeac3e0e146103d5578063f77c4791146103e8576101da565b8063c8a5f81e14610377578063d6866ea51461038a578063db75092614610392578063e242cf1e146103a5576101da565b8063a8cc0ee2116100de578063a8cc0ee21461034c578063b951acd714610354578063c4d66de81461035c578063c7d1117d1461036f576101da565b806393a90a1e146103135780639ce7abe514610326578063a2594d8214610339576101da565b80634986594f1161017c578063702a280e1161014b578063702a280e146102c4578063779bcb9b146102e55780639006ce8b146102f857806392eefe9b14610300576101da565b80634986594f146102735780634bbfc1c5146102965780635c6cbd59146102a95780636c080f18146102bc576101da565b80631324a506116101b85780631324a5061461022557806316a84ab2146102385780631d1c2fec14610258578063260582491461026b576101da565b806305bb8c6b146101df5780630903c094146101fd5780631156bdc114610212575b600080fd5b6101e76103f0565b6040516101f49190611a57565b60405180910390f35b61021061020b366004611895565b6103ff565b005b610210610220366004611962565b61045b565b61021061023336600461197a565b61046f565b61024b610246366004611962565b6104b0565b6040516101f49190611a8f565b61024b610266366004611962565b6104c2565b6101e76104fb565b610286610281366004611962565b61050a565b6040516101f49493929190611c12565b6102106102a4366004611962565b610531565b61024b6102b7366004611962565b61062d565b61024b61071e565b6102d76102d2366004611962565b610724565b6040516101f4929190611c04565b61024b6102f33660046118cd565b610898565b61024b6109be565b61021061030e366004611895565b6109c4565b610210610321366004611895565b6109d5565b61021061033436600461199e565b610a2f565b610210610347366004611895565b610b85565b61024b610ca0565b61024b610cbc565b61021061036a366004611895565b610cc2565b61024b610d2e565b61024b610385366004611a36565b610d46565b610210610d65565b61024b6103a0366004611895565b610e86565b61024b6110bc565b61024b6110c2565b6103c86103c3366004611962565b6111d1565b6040516101f49190611a84565b61024b6103e3366004611962565b6111e5565b6101e7611217565b600f546001600160a01b031681565b610407611226565b600f80546001600160a01b0319166001600160a01b0383161790556040517f96d5a4b4edf1cefd0900c166d64447f8da1d01d1861a6a60894b5b82a2c15c3c9061045090611a98565b60405180910390a150565b610463611226565b61046c816112fa565b50565b600f546001600160a01b031633146104a25760405162461bcd60e51b815260040161049990611acf565b60405180910390fd5b6104ac8282611336565b5050565b60116020526000908152604090205481565b60006104cc610d2e565b5060008281526010602052604090206104e48361062d565b808255600d5460029092019190915590505b919050565b6015546001600160a01b031681565b60106020526000908152604090208054600182015460028301546003909301549192909184565b600f546001600160a01b03163314806105de575060008054906101000a90046001600160a01b03166001600160a01b0316634fc07d756040518163ffffffff1660e01b815260040160206040518083038186803b15801561059157600080fd5b505afa1580156105a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105c991906118b1565b6001600160a01b0316336001600160a01b0316145b6105fa5760405162461bcd60e51b815260040161049990611bdc565b60128190556040517f96d5a4b4edf1cefd0900c166d64447f8da1d01d1861a6a60894b5b82a2c15c3c9061045090611b1e565b600081815260106020526040812081610644611399565b6001600160a01b03166346e855da856040518263ffffffff1660e01b815260040161066f9190611a8f565b60206040518083038186803b15801561068757600080fd5b505afa15801561069b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106bf9190611a1e565b905060006012548210156106d4576000610706565b610706670de0b6b3a7640000610700846106fa87600201546106f4610ca0565b906113c4565b90611421565b9061147a565b835490915061071590826114e1565b95945050505050565b60145481565b600081815260106020526040812081908161073e8561062d565b9050600061075082846001015461153b565b90506000806040518060400160405280610768611555565b6001600160a01b03908116825260155416602090910152905060005b600281101561084757600082826002811061079b57fe5b60200201516001600160a01b03161461083f578181600281106107ba57fe5b60200201516001600160a01b031663e2e1e8e98a6040518263ffffffff1660e01b81526004016107ea9190611a8f565b60206040518083038186803b15801561080257600080fd5b505afa158015610816573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061083a9190611a1e565b830192505b600101610784565b508161085e57600084965096505050505050610893565b60006108768361070086670de0b6b3a7640000611421565b600387015490915061088890826114e1565b975093955050505050505b915091565b60006108a2611555565b6001600160a01b0316836001600160a01b031614806108ce57506015546001600160a01b038481169116145b6108ea5760405162461bcd60e51b815260040161049990611b77565b6000806000806000876001600160a01b03166355c85269886040518263ffffffff1660e01b815260040161091e9190611a57565b60c06040518083038186803b15801561093657600080fd5b505afa15801561094a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061096e9190611905565b95509550955095505094508461098c576000955050505050506109b8565b600061099785610724565b5090506109af6109a8858584611580565b83906114e1565b96505050505050505b92915050565b600e5481565b6109cc6115a5565b61046c81611604565b6109dd611226565b601580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f97befc0afcf2bace352f077aea9873c9552fc2e5ab26874f356006fdf9da4ede90600090a35050565b82806001600160a01b031663f851a4406040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610a6b57600080fd5b505af1158015610a7f573d6000803e3d6000fd5b505050506040513d6020811015610a9557600080fd5b50516001600160a01b03163314610af3576040805162461bcd60e51b815260206004820152601e60248201527f43616c6c6572206d757374206265207468652070726f78792061646d696e0000604482015290519081900360640190fd5b60405163623faf6160e01b8152602060048201908152602482018490526001600160a01b0386169163623faf619186918691908190604401848480828437600081840152601f19601f8201169050808301925050509350505050600060405180830381600087803b158015610b6757600080fd5b505af1158015610b7b573d6000803e3d6000fd5b5050505050505050565b80806001600160a01b031663f851a4406040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610bc157600080fd5b505af1158015610bd5573d6000803e3d6000fd5b505050506040513d6020811015610beb57600080fd5b50516001600160a01b03163314610c49576040805162461bcd60e51b815260206004820152601e60248201527f43616c6c6572206d757374206265207468652070726f78792061646d696e0000604482015290519081900360640190fd5b816001600160a01b03166359fc20bb6040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610c8457600080fd5b505af1158015610c98573d6000803e3d6000fd5b505050505050565b6000610cb6610cad6110c2565b600d54906114e1565b90505b90565b60125481565b610cca6116ac565b6001600160a01b0316336001600160a01b031614610d25576040805162461bcd60e51b815260206004820152601360248201527227b7363c9034b6b83632b6b2b73a30ba34b7b760691b604482015290519081900360640190fd5b61046c816109cc565b6000610d38610ca0565b600d81905543600e55905090565b6000610d5e670de0b6b3a76400006107008486611421565b9392505050565b610d8e7f00000000000000000000000000000000000000000000000000000000000000006116d1565b610db77f00000000000000000000000000000000000000000000000000000000000000006116d1565b610de07f00000000000000000000000000000000000000000000000000000000000000006116d1565b610e097f00000000000000000000000000000000000000000000000000000000000000006116d1565b610e327f00000000000000000000000000000000000000000000000000000000000000006116d1565b610e5b7f00000000000000000000000000000000000000000000000000000000000000006116d1565b610e847f00000000000000000000000000000000000000000000000000000000000000006116d1565b565b600033610e91611555565b6001600160a01b0316816001600160a01b03161480610ebd57506015546001600160a01b038281169116145b610ed95760405162461bcd60e51b815260040161049990611ba5565b600080600080600080866001600160a01b03166355c852698a6040518263ffffffff1660e01b8152600401610f0e9190611a57565b60c06040518083038186803b158015610f2657600080fd5b505afa158015610f3a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f5e9190611905565b9550955095509550955095506000610f75856111e5565b9050610f80856111d1565b15610fd657896001600160a01b0316866001600160a01b03167f9b1323a10f3955b1c9c054ffbda78edfdf49998aaf37f61d9f84776b59ac804360405160405180910390a36000985050505050505050506104f6565b6000871561106357610ff3610fec868685611580565b84906114e1565b90508015611063576110036117d2565b6001600160a01b03166340c10f198a836040518363ffffffff1660e01b8152600401611030929190611a6b565b600060405180830381600087803b15801561104a57600080fd5b505af115801561105e573d6000803e3d6000fd5b505050505b8a6001600160a01b0316876001600160a01b03167fa111914d7f2ea8beca61d12f1a1f38c5533de5f1823c3936422df4404ac2ec68836040516110a69190611a8f565b60405180910390a39a9950505050505050505050565b600d5481565b6000806110da600e54436113c490919063ffffffff16565b9050806110eb576000915050610cb9565b6014546110fc576000915050610cb9565b60006111066117d2565b90506000816001600160a01b03166370a08231611121611399565b6040518263ffffffff1660e01b815260040161113d9190611a57565b60206040518083038186803b15801561115557600080fd5b505afa158015611169573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061118d9190611a1e565b9050806111a05760009350505050610cb9565b6014546000906111b09085611421565b90506111c88261070083670de0b6b3a7640000611421565b94505050505090565b600090815260116020526040902054151590565b600081815260106020526040812081806111fe85610724565b6003850182905560019094019390935550909392505050565b6000546001600160a01b031681565b60008054906101000a90046001600160a01b03166001600160a01b0316634fc07d756040518163ffffffff1660e01b815260040160206040518083038186803b15801561127257600080fd5b505afa158015611286573d6000803e3d6000fd5b505050506040513d602081101561129c57600080fd5b50516001600160a01b03163314610e84576040805162461bcd60e51b815260206004820152601860248201527f4f6e6c7920436f6e74726f6c6c657220676f7665726e6f720000000000000000604482015290519081900360640190fd5b611302610d2e565b5060148190556040517f96d5a4b4edf1cefd0900c166d64447f8da1d01d1861a6a60894b5b82a2c15c3c9061045090611b4d565b600081611344576000611346565b435b600084815260116020526040908190208290555190915083907fe016102b339c3889f4967b491f3381f2c352c8fe3d4f880007807d45b124065a9061138c908490611a8f565b60405180910390a2505050565b6000610cb67f00000000000000000000000000000000000000000000000000000000000000006117f9565b60008282111561141b576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b600082611430575060006109b8565b8282028284828161143d57fe5b0414610d5e5760405162461bcd60e51b8152600401808060200182810382526021815260200180611c516021913960400191505060405180910390fd5b60008082116114d0576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b8183816114d957fe5b049392505050565b600082820183811015610d5e576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600081831161154b576000610d5e565b610d5e83836113c4565b6000610cb67f00000000000000000000000000000000000000000000000000000000000000006117f9565b60008061158d83856113c4565b9050610715670de0b6b3a76400006107008388611421565b6000546001600160a01b03163314610e84576040805162461bcd60e51b815260206004820152601960248201527f43616c6c6572206d75737420626520436f6e74726f6c6c657200000000000000604482015290519081900360640190fd5b6001600160a01b038116611658576040805162461bcd60e51b815260206004820152601660248201527510dbdb9d1c9bdb1b195c881b5d5cdd081899481cd95d60521b604482015290519081900360640190fd5b600080546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f4ff638452bbf33c012645d18ae6f05515ff5f2d1dfb0cece8cbf018c60903f709181900360200190a150565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6000805460408051637bb20d2f60e11b81526004810185905290516001600160a01b039092169163f7641a5e91602480820192602092909190829003018186803b15801561171e57600080fd5b505afa158015611732573d6000803e3d6000fd5b505050506040513d602081101561174857600080fd5b50516000838152600160205260409020549091506001600160a01b038083169116146104ac5760008281526001602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251908152915184927fd0e7a942b1fc38c411c4f53d153ba14fd24542a6a35ebacd9b6afca1a154e20692908290030190a25050565b6000610cb67f00000000000000000000000000000000000000000000000000000000000000005b6000818152600160205260408120546001600160a01b0316806109b85760005460408051637bb20d2f60e11b81526004810186905290516001600160a01b039092169163f7641a5e91602480820192602092909190829003018186803b15801561186257600080fd5b505afa158015611876573d6000803e3d6000fd5b505050506040513d602081101561188c57600080fd5b50519392505050565b6000602082840312156118a6578081fd5b8135610d5e81611c2d565b6000602082840312156118c2578081fd5b8151610d5e81611c2d565b600080604083850312156118df578081fd5b82356118ea81611c2d565b915060208301356118fa81611c2d565b809150509250929050565b60008060008060008060c0878903121561191d578182fd5b865161192881611c42565b602088015190965061193981611c2d565b6040880151606089015160808a015160a0909a0151989b929a5090989097909650945092505050565b600060208284031215611973578081fd5b5035919050565b6000806040838503121561198c578182fd5b8235915060208301356118fa81611c42565b6000806000604084860312156119b2578283fd5b83356119bd81611c2d565b9250602084013567ffffffffffffffff808211156119d9578384fd5b818601915086601f8301126119ec578384fd5b8135818111156119fa578485fd5b876020828501011115611a0b578485fd5b6020830194508093505050509250925092565b600060208284031215611a2f578081fd5b5051919050565b60008060408385031215611a48578182fd5b50508035926020909101359150565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b901515815260200190565b90815260200190565b6020808252601a908201527f7375626772617068417661696c6162696c6974794f7261636c65000000000000604082015260600190565b6020808252602f908201527f43616c6c6572206d75737420626520746865207375626772617068206176616960408201526e6c6162696c697479206f7261636c6560881b606082015260800190565b6020808252601590820152741b5a5b9a5b5d5b54dd5899dc985c1a14da59db985b605a1b604082015260600190565b60208082526010908201526f69737375616e6365506572426c6f636b60801b604082015260600190565b6020808252601490820152732737ba1030903932bbb0b932399034b9b9bab2b960611b604082015260600190565b6020808252601f908201527f43616c6c6572206d757374206265206120726577617264732069737375657200604082015260600190565b6020808252600e908201526d139bdd08185d5d1a1bdc9a5e995960921b604082015260600190565b918252602082015260400190565b93845260208401929092526040830152606082015260800190565b6001600160a01b038116811461046c57600080fd5b801515811461046c57600080fdfe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a2646970667358221220b536df78ac5675cc1b134b52c2a049a6938eb11d81ca397ce9b07214c71d8af264736f6c63430007060033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101da5760003560e01c806393a90a1e11610104578063c8a5f81e116100a2578063e284f84811610071578063e284f848146103ad578063e820e284146103b5578063eeac3e0e146103d5578063f77c4791146103e8576101da565b8063c8a5f81e14610377578063d6866ea51461038a578063db75092614610392578063e242cf1e146103a5576101da565b8063a8cc0ee2116100de578063a8cc0ee21461034c578063b951acd714610354578063c4d66de81461035c578063c7d1117d1461036f576101da565b806393a90a1e146103135780639ce7abe514610326578063a2594d8214610339576101da565b80634986594f1161017c578063702a280e1161014b578063702a280e146102c4578063779bcb9b146102e55780639006ce8b146102f857806392eefe9b14610300576101da565b80634986594f146102735780634bbfc1c5146102965780635c6cbd59146102a95780636c080f18146102bc576101da565b80631324a506116101b85780631324a5061461022557806316a84ab2146102385780631d1c2fec14610258578063260582491461026b576101da565b806305bb8c6b146101df5780630903c094146101fd5780631156bdc114610212575b600080fd5b6101e76103f0565b6040516101f49190611a57565b60405180910390f35b61021061020b366004611895565b6103ff565b005b610210610220366004611962565b61045b565b61021061023336600461197a565b61046f565b61024b610246366004611962565b6104b0565b6040516101f49190611a8f565b61024b610266366004611962565b6104c2565b6101e76104fb565b610286610281366004611962565b61050a565b6040516101f49493929190611c12565b6102106102a4366004611962565b610531565b61024b6102b7366004611962565b61062d565b61024b61071e565b6102d76102d2366004611962565b610724565b6040516101f4929190611c04565b61024b6102f33660046118cd565b610898565b61024b6109be565b61021061030e366004611895565b6109c4565b610210610321366004611895565b6109d5565b61021061033436600461199e565b610a2f565b610210610347366004611895565b610b85565b61024b610ca0565b61024b610cbc565b61021061036a366004611895565b610cc2565b61024b610d2e565b61024b610385366004611a36565b610d46565b610210610d65565b61024b6103a0366004611895565b610e86565b61024b6110bc565b61024b6110c2565b6103c86103c3366004611962565b6111d1565b6040516101f49190611a84565b61024b6103e3366004611962565b6111e5565b6101e7611217565b600f546001600160a01b031681565b610407611226565b600f80546001600160a01b0319166001600160a01b0383161790556040517f96d5a4b4edf1cefd0900c166d64447f8da1d01d1861a6a60894b5b82a2c15c3c9061045090611a98565b60405180910390a150565b610463611226565b61046c816112fa565b50565b600f546001600160a01b031633146104a25760405162461bcd60e51b815260040161049990611acf565b60405180910390fd5b6104ac8282611336565b5050565b60116020526000908152604090205481565b60006104cc610d2e565b5060008281526010602052604090206104e48361062d565b808255600d5460029092019190915590505b919050565b6015546001600160a01b031681565b60106020526000908152604090208054600182015460028301546003909301549192909184565b600f546001600160a01b03163314806105de575060008054906101000a90046001600160a01b03166001600160a01b0316634fc07d756040518163ffffffff1660e01b815260040160206040518083038186803b15801561059157600080fd5b505afa1580156105a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105c991906118b1565b6001600160a01b0316336001600160a01b0316145b6105fa5760405162461bcd60e51b815260040161049990611bdc565b60128190556040517f96d5a4b4edf1cefd0900c166d64447f8da1d01d1861a6a60894b5b82a2c15c3c9061045090611b1e565b600081815260106020526040812081610644611399565b6001600160a01b03166346e855da856040518263ffffffff1660e01b815260040161066f9190611a8f565b60206040518083038186803b15801561068757600080fd5b505afa15801561069b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106bf9190611a1e565b905060006012548210156106d4576000610706565b610706670de0b6b3a7640000610700846106fa87600201546106f4610ca0565b906113c4565b90611421565b9061147a565b835490915061071590826114e1565b95945050505050565b60145481565b600081815260106020526040812081908161073e8561062d565b9050600061075082846001015461153b565b90506000806040518060400160405280610768611555565b6001600160a01b03908116825260155416602090910152905060005b600281101561084757600082826002811061079b57fe5b60200201516001600160a01b03161461083f578181600281106107ba57fe5b60200201516001600160a01b031663e2e1e8e98a6040518263ffffffff1660e01b81526004016107ea9190611a8f565b60206040518083038186803b15801561080257600080fd5b505afa158015610816573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061083a9190611a1e565b830192505b600101610784565b508161085e57600084965096505050505050610893565b60006108768361070086670de0b6b3a7640000611421565b600387015490915061088890826114e1565b975093955050505050505b915091565b60006108a2611555565b6001600160a01b0316836001600160a01b031614806108ce57506015546001600160a01b038481169116145b6108ea5760405162461bcd60e51b815260040161049990611b77565b6000806000806000876001600160a01b03166355c85269886040518263ffffffff1660e01b815260040161091e9190611a57565b60c06040518083038186803b15801561093657600080fd5b505afa15801561094a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061096e9190611905565b95509550955095505094508461098c576000955050505050506109b8565b600061099785610724565b5090506109af6109a8858584611580565b83906114e1565b96505050505050505b92915050565b600e5481565b6109cc6115a5565b61046c81611604565b6109dd611226565b601580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f97befc0afcf2bace352f077aea9873c9552fc2e5ab26874f356006fdf9da4ede90600090a35050565b82806001600160a01b031663f851a4406040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610a6b57600080fd5b505af1158015610a7f573d6000803e3d6000fd5b505050506040513d6020811015610a9557600080fd5b50516001600160a01b03163314610af3576040805162461bcd60e51b815260206004820152601e60248201527f43616c6c6572206d757374206265207468652070726f78792061646d696e0000604482015290519081900360640190fd5b60405163623faf6160e01b8152602060048201908152602482018490526001600160a01b0386169163623faf619186918691908190604401848480828437600081840152601f19601f8201169050808301925050509350505050600060405180830381600087803b158015610b6757600080fd5b505af1158015610b7b573d6000803e3d6000fd5b5050505050505050565b80806001600160a01b031663f851a4406040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610bc157600080fd5b505af1158015610bd5573d6000803e3d6000fd5b505050506040513d6020811015610beb57600080fd5b50516001600160a01b03163314610c49576040805162461bcd60e51b815260206004820152601e60248201527f43616c6c6572206d757374206265207468652070726f78792061646d696e0000604482015290519081900360640190fd5b816001600160a01b03166359fc20bb6040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610c8457600080fd5b505af1158015610c98573d6000803e3d6000fd5b505050505050565b6000610cb6610cad6110c2565b600d54906114e1565b90505b90565b60125481565b610cca6116ac565b6001600160a01b0316336001600160a01b031614610d25576040805162461bcd60e51b815260206004820152601360248201527227b7363c9034b6b83632b6b2b73a30ba34b7b760691b604482015290519081900360640190fd5b61046c816109cc565b6000610d38610ca0565b600d81905543600e55905090565b6000610d5e670de0b6b3a76400006107008486611421565b9392505050565b610d8e7f00000000000000000000000000000000000000000000000000000000000000006116d1565b610db77f00000000000000000000000000000000000000000000000000000000000000006116d1565b610de07f00000000000000000000000000000000000000000000000000000000000000006116d1565b610e097f00000000000000000000000000000000000000000000000000000000000000006116d1565b610e327f00000000000000000000000000000000000000000000000000000000000000006116d1565b610e5b7f00000000000000000000000000000000000000000000000000000000000000006116d1565b610e847f00000000000000000000000000000000000000000000000000000000000000006116d1565b565b600033610e91611555565b6001600160a01b0316816001600160a01b03161480610ebd57506015546001600160a01b038281169116145b610ed95760405162461bcd60e51b815260040161049990611ba5565b600080600080600080866001600160a01b03166355c852698a6040518263ffffffff1660e01b8152600401610f0e9190611a57565b60c06040518083038186803b158015610f2657600080fd5b505afa158015610f3a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f5e9190611905565b9550955095509550955095506000610f75856111e5565b9050610f80856111d1565b15610fd657896001600160a01b0316866001600160a01b03167f9b1323a10f3955b1c9c054ffbda78edfdf49998aaf37f61d9f84776b59ac804360405160405180910390a36000985050505050505050506104f6565b6000871561106357610ff3610fec868685611580565b84906114e1565b90508015611063576110036117d2565b6001600160a01b03166340c10f198a836040518363ffffffff1660e01b8152600401611030929190611a6b565b600060405180830381600087803b15801561104a57600080fd5b505af115801561105e573d6000803e3d6000fd5b505050505b8a6001600160a01b0316876001600160a01b03167fa111914d7f2ea8beca61d12f1a1f38c5533de5f1823c3936422df4404ac2ec68836040516110a69190611a8f565b60405180910390a39a9950505050505050505050565b600d5481565b6000806110da600e54436113c490919063ffffffff16565b9050806110eb576000915050610cb9565b6014546110fc576000915050610cb9565b60006111066117d2565b90506000816001600160a01b03166370a08231611121611399565b6040518263ffffffff1660e01b815260040161113d9190611a57565b60206040518083038186803b15801561115557600080fd5b505afa158015611169573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061118d9190611a1e565b9050806111a05760009350505050610cb9565b6014546000906111b09085611421565b90506111c88261070083670de0b6b3a7640000611421565b94505050505090565b600090815260116020526040902054151590565b600081815260106020526040812081806111fe85610724565b6003850182905560019094019390935550909392505050565b6000546001600160a01b031681565b60008054906101000a90046001600160a01b03166001600160a01b0316634fc07d756040518163ffffffff1660e01b815260040160206040518083038186803b15801561127257600080fd5b505afa158015611286573d6000803e3d6000fd5b505050506040513d602081101561129c57600080fd5b50516001600160a01b03163314610e84576040805162461bcd60e51b815260206004820152601860248201527f4f6e6c7920436f6e74726f6c6c657220676f7665726e6f720000000000000000604482015290519081900360640190fd5b611302610d2e565b5060148190556040517f96d5a4b4edf1cefd0900c166d64447f8da1d01d1861a6a60894b5b82a2c15c3c9061045090611b4d565b600081611344576000611346565b435b600084815260116020526040908190208290555190915083907fe016102b339c3889f4967b491f3381f2c352c8fe3d4f880007807d45b124065a9061138c908490611a8f565b60405180910390a2505050565b6000610cb67f00000000000000000000000000000000000000000000000000000000000000006117f9565b60008282111561141b576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b600082611430575060006109b8565b8282028284828161143d57fe5b0414610d5e5760405162461bcd60e51b8152600401808060200182810382526021815260200180611c516021913960400191505060405180910390fd5b60008082116114d0576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b8183816114d957fe5b049392505050565b600082820183811015610d5e576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600081831161154b576000610d5e565b610d5e83836113c4565b6000610cb67f00000000000000000000000000000000000000000000000000000000000000006117f9565b60008061158d83856113c4565b9050610715670de0b6b3a76400006107008388611421565b6000546001600160a01b03163314610e84576040805162461bcd60e51b815260206004820152601960248201527f43616c6c6572206d75737420626520436f6e74726f6c6c657200000000000000604482015290519081900360640190fd5b6001600160a01b038116611658576040805162461bcd60e51b815260206004820152601660248201527510dbdb9d1c9bdb1b195c881b5d5cdd081899481cd95d60521b604482015290519081900360640190fd5b600080546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f4ff638452bbf33c012645d18ae6f05515ff5f2d1dfb0cece8cbf018c60903f709181900360200190a150565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6000805460408051637bb20d2f60e11b81526004810185905290516001600160a01b039092169163f7641a5e91602480820192602092909190829003018186803b15801561171e57600080fd5b505afa158015611732573d6000803e3d6000fd5b505050506040513d602081101561174857600080fd5b50516000838152600160205260409020549091506001600160a01b038083169116146104ac5760008281526001602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251908152915184927fd0e7a942b1fc38c411c4f53d153ba14fd24542a6a35ebacd9b6afca1a154e20692908290030190a25050565b6000610cb67f00000000000000000000000000000000000000000000000000000000000000005b6000818152600160205260408120546001600160a01b0316806109b85760005460408051637bb20d2f60e11b81526004810186905290516001600160a01b039092169163f7641a5e91602480820192602092909190829003018186803b15801561186257600080fd5b505afa158015611876573d6000803e3d6000fd5b505050506040513d602081101561188c57600080fd5b50519392505050565b6000602082840312156118a6578081fd5b8135610d5e81611c2d565b6000602082840312156118c2578081fd5b8151610d5e81611c2d565b600080604083850312156118df578081fd5b82356118ea81611c2d565b915060208301356118fa81611c2d565b809150509250929050565b60008060008060008060c0878903121561191d578182fd5b865161192881611c42565b602088015190965061193981611c2d565b6040880151606089015160808a015160a0909a0151989b929a5090989097909650945092505050565b600060208284031215611973578081fd5b5035919050565b6000806040838503121561198c578182fd5b8235915060208301356118fa81611c42565b6000806000604084860312156119b2578283fd5b83356119bd81611c2d565b9250602084013567ffffffffffffffff808211156119d9578384fd5b818601915086601f8301126119ec578384fd5b8135818111156119fa578485fd5b876020828501011115611a0b578485fd5b6020830194508093505050509250925092565b600060208284031215611a2f578081fd5b5051919050565b60008060408385031215611a48578182fd5b50508035926020909101359150565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b901515815260200190565b90815260200190565b6020808252601a908201527f7375626772617068417661696c6162696c6974794f7261636c65000000000000604082015260600190565b6020808252602f908201527f43616c6c6572206d75737420626520746865207375626772617068206176616960408201526e6c6162696c697479206f7261636c6560881b606082015260800190565b6020808252601590820152741b5a5b9a5b5d5b54dd5899dc985c1a14da59db985b605a1b604082015260600190565b60208082526010908201526f69737375616e6365506572426c6f636b60801b604082015260600190565b6020808252601490820152732737ba1030903932bbb0b932399034b9b9bab2b960611b604082015260600190565b6020808252601f908201527f43616c6c6572206d757374206265206120726577617264732069737375657200604082015260600190565b6020808252600e908201526d139bdd08185d5d1a1bdc9a5e995960921b604082015260600190565b918252602082015260400190565b93845260208401929092526040830152606082015260800190565b6001600160a01b038116811461046c57600080fd5b801515811461046c57600080fdfe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a2646970667358221220b536df78ac5675cc1b134b52c2a049a6938eb11d81ca397ce9b07214c71d8af264736f6c63430007060033", + "linkReferences": {}, + "deployedLinkReferences": {} +} \ No newline at end of file diff --git a/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/RewardsManager#RewardsManager_ProxyWithABI.json b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/RewardsManager#RewardsManager_ProxyWithABI.json new file mode 100644 index 000000000..fe6be7a77 --- /dev/null +++ b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/RewardsManager#RewardsManager_ProxyWithABI.json @@ -0,0 +1,622 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "RewardsManager", + "sourceName": "contracts/rewards/RewardsManager.sol", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "nameHash", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "contractAddress", + "type": "address" + } + ], + "name": "ContractSynced", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "allocationID", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "HorizonRewardsAssigned", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "param", + "type": "string" + } + ], + "name": "ParameterUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "allocationID", + "type": "address" + } + ], + "name": "RewardsDenied", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "subgraphDeploymentID", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "sinceBlock", + "type": "uint256" + } + ], + "name": "RewardsDenylistUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "controller", + "type": "address" + } + ], + "name": "SetController", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldSubgraphService", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newSubgraphService", + "type": "address" + } + ], + "name": "SubgraphServiceSet", + "type": "event" + }, + { + "inputs": [], + "name": "accRewardsPerSignal", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "accRewardsPerSignalLastBlockUpdated", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IGraphProxy", + "name": "_proxy", + "type": "address" + } + ], + "name": "acceptProxy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IGraphProxy", + "name": "_proxy", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "acceptProxyAndCall", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_accRewardsPerAllocatedToken", + "type": "uint256" + } + ], + "name": "calcRewards", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "controller", + "outputs": [ + { + "internalType": "contract IController", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "denylist", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + } + ], + "name": "getAccRewardsForSubgraph", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + } + ], + "name": "getAccRewardsPerAllocatedToken", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getAccRewardsPerSignal", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getNewRewardsPerSignal", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_rewardsIssuer", + "type": "address" + }, + { + "internalType": "address", + "name": "_allocationID", + "type": "address" + } + ], + "name": "getRewards", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_controller", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + } + ], + "name": "isDenied", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "issuancePerBlock", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "minimumSubgraphSignal", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + } + ], + "name": "onSubgraphAllocationUpdate", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + } + ], + "name": "onSubgraphSignalUpdate", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_controller", + "type": "address" + } + ], + "name": "setController", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + }, + { + "internalType": "bool", + "name": "_deny", + "type": "bool" + } + ], + "name": "setDenied", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_issuancePerBlock", + "type": "uint256" + } + ], + "name": "setIssuancePerBlock", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_minimumSubgraphSignal", + "type": "uint256" + } + ], + "name": "setMinimumSubgraphSignal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_subgraphAvailabilityOracle", + "type": "address" + } + ], + "name": "setSubgraphAvailabilityOracle", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_subgraphService", + "type": "address" + } + ], + "name": "setSubgraphService", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "subgraphAvailabilityOracle", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "subgraphService", + "outputs": [ + { + "internalType": "contract IRewardsIssuer", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "subgraphs", + "outputs": [ + { + "internalType": "uint256", + "name": "accRewardsForSubgraph", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "accRewardsForSubgraphSnapshot", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "accRewardsPerSignalSnapshot", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "accRewardsPerAllocatedToken", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "syncAllContracts", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_allocationID", + "type": "address" + } + ], + "name": "takeRewards", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "updateAccRewardsPerSignal", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "bytecode": "0x6101606040527fe6876326c1291dfcbbd3864a6816d698cd591defc7aa2153d7f9c4c04016c89f6080527fc713c3df6d14cdf946460395d09af88993ee2b948b1a808161494e32c5f6706360a0527f966f1e8d8d8014e05f6ec4a57138da9be1f7c5a7f802928a18072f7c5318076160c0527f1df41cd916959d1163dc8f0671a666ea8a3e434c13e40faef527133b5d16703460e0527f45fc200c7e4544e457d3c5709bfe0d520442c30bbcbdaede89e8d4a4bbc19247610100527fd362cac9cb75c10d67bcc0b7eeb0b1ef48bb5420b556c092d4fd7f758816fcf0610120527f39605a6c26a173774ca666c67ef70cf491880e5d3d6d0ca66ec0a31034f15ea36101405234801561011057600080fd5b5060805160a05160c05160e051610100516101205161014051611ca761017360003980610e60525080610e37525080610e0e52806117d9525080610de5528061155c525080610dbc525080610d93525080610d6a52806113a05250611ca76000f3fe608060405234801561001057600080fd5b50600436106101da5760003560e01c806393a90a1e11610104578063c8a5f81e116100a2578063e284f84811610071578063e284f848146103ad578063e820e284146103b5578063eeac3e0e146103d5578063f77c4791146103e8576101da565b8063c8a5f81e14610377578063d6866ea51461038a578063db75092614610392578063e242cf1e146103a5576101da565b8063a8cc0ee2116100de578063a8cc0ee21461034c578063b951acd714610354578063c4d66de81461035c578063c7d1117d1461036f576101da565b806393a90a1e146103135780639ce7abe514610326578063a2594d8214610339576101da565b80634986594f1161017c578063702a280e1161014b578063702a280e146102c4578063779bcb9b146102e55780639006ce8b146102f857806392eefe9b14610300576101da565b80634986594f146102735780634bbfc1c5146102965780635c6cbd59146102a95780636c080f18146102bc576101da565b80631324a506116101b85780631324a5061461022557806316a84ab2146102385780631d1c2fec14610258578063260582491461026b576101da565b806305bb8c6b146101df5780630903c094146101fd5780631156bdc114610212575b600080fd5b6101e76103f0565b6040516101f49190611a57565b60405180910390f35b61021061020b366004611895565b6103ff565b005b610210610220366004611962565b61045b565b61021061023336600461197a565b61046f565b61024b610246366004611962565b6104b0565b6040516101f49190611a8f565b61024b610266366004611962565b6104c2565b6101e76104fb565b610286610281366004611962565b61050a565b6040516101f49493929190611c12565b6102106102a4366004611962565b610531565b61024b6102b7366004611962565b61062d565b61024b61071e565b6102d76102d2366004611962565b610724565b6040516101f4929190611c04565b61024b6102f33660046118cd565b610898565b61024b6109be565b61021061030e366004611895565b6109c4565b610210610321366004611895565b6109d5565b61021061033436600461199e565b610a2f565b610210610347366004611895565b610b85565b61024b610ca0565b61024b610cbc565b61021061036a366004611895565b610cc2565b61024b610d2e565b61024b610385366004611a36565b610d46565b610210610d65565b61024b6103a0366004611895565b610e86565b61024b6110bc565b61024b6110c2565b6103c86103c3366004611962565b6111d1565b6040516101f49190611a84565b61024b6103e3366004611962565b6111e5565b6101e7611217565b600f546001600160a01b031681565b610407611226565b600f80546001600160a01b0319166001600160a01b0383161790556040517f96d5a4b4edf1cefd0900c166d64447f8da1d01d1861a6a60894b5b82a2c15c3c9061045090611a98565b60405180910390a150565b610463611226565b61046c816112fa565b50565b600f546001600160a01b031633146104a25760405162461bcd60e51b815260040161049990611acf565b60405180910390fd5b6104ac8282611336565b5050565b60116020526000908152604090205481565b60006104cc610d2e565b5060008281526010602052604090206104e48361062d565b808255600d5460029092019190915590505b919050565b6015546001600160a01b031681565b60106020526000908152604090208054600182015460028301546003909301549192909184565b600f546001600160a01b03163314806105de575060008054906101000a90046001600160a01b03166001600160a01b0316634fc07d756040518163ffffffff1660e01b815260040160206040518083038186803b15801561059157600080fd5b505afa1580156105a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105c991906118b1565b6001600160a01b0316336001600160a01b0316145b6105fa5760405162461bcd60e51b815260040161049990611bdc565b60128190556040517f96d5a4b4edf1cefd0900c166d64447f8da1d01d1861a6a60894b5b82a2c15c3c9061045090611b1e565b600081815260106020526040812081610644611399565b6001600160a01b03166346e855da856040518263ffffffff1660e01b815260040161066f9190611a8f565b60206040518083038186803b15801561068757600080fd5b505afa15801561069b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106bf9190611a1e565b905060006012548210156106d4576000610706565b610706670de0b6b3a7640000610700846106fa87600201546106f4610ca0565b906113c4565b90611421565b9061147a565b835490915061071590826114e1565b95945050505050565b60145481565b600081815260106020526040812081908161073e8561062d565b9050600061075082846001015461153b565b90506000806040518060400160405280610768611555565b6001600160a01b03908116825260155416602090910152905060005b600281101561084757600082826002811061079b57fe5b60200201516001600160a01b03161461083f578181600281106107ba57fe5b60200201516001600160a01b031663e2e1e8e98a6040518263ffffffff1660e01b81526004016107ea9190611a8f565b60206040518083038186803b15801561080257600080fd5b505afa158015610816573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061083a9190611a1e565b830192505b600101610784565b508161085e57600084965096505050505050610893565b60006108768361070086670de0b6b3a7640000611421565b600387015490915061088890826114e1565b975093955050505050505b915091565b60006108a2611555565b6001600160a01b0316836001600160a01b031614806108ce57506015546001600160a01b038481169116145b6108ea5760405162461bcd60e51b815260040161049990611b77565b6000806000806000876001600160a01b03166355c85269886040518263ffffffff1660e01b815260040161091e9190611a57565b60c06040518083038186803b15801561093657600080fd5b505afa15801561094a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061096e9190611905565b95509550955095505094508461098c576000955050505050506109b8565b600061099785610724565b5090506109af6109a8858584611580565b83906114e1565b96505050505050505b92915050565b600e5481565b6109cc6115a5565b61046c81611604565b6109dd611226565b601580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f97befc0afcf2bace352f077aea9873c9552fc2e5ab26874f356006fdf9da4ede90600090a35050565b82806001600160a01b031663f851a4406040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610a6b57600080fd5b505af1158015610a7f573d6000803e3d6000fd5b505050506040513d6020811015610a9557600080fd5b50516001600160a01b03163314610af3576040805162461bcd60e51b815260206004820152601e60248201527f43616c6c6572206d757374206265207468652070726f78792061646d696e0000604482015290519081900360640190fd5b60405163623faf6160e01b8152602060048201908152602482018490526001600160a01b0386169163623faf619186918691908190604401848480828437600081840152601f19601f8201169050808301925050509350505050600060405180830381600087803b158015610b6757600080fd5b505af1158015610b7b573d6000803e3d6000fd5b5050505050505050565b80806001600160a01b031663f851a4406040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610bc157600080fd5b505af1158015610bd5573d6000803e3d6000fd5b505050506040513d6020811015610beb57600080fd5b50516001600160a01b03163314610c49576040805162461bcd60e51b815260206004820152601e60248201527f43616c6c6572206d757374206265207468652070726f78792061646d696e0000604482015290519081900360640190fd5b816001600160a01b03166359fc20bb6040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610c8457600080fd5b505af1158015610c98573d6000803e3d6000fd5b505050505050565b6000610cb6610cad6110c2565b600d54906114e1565b90505b90565b60125481565b610cca6116ac565b6001600160a01b0316336001600160a01b031614610d25576040805162461bcd60e51b815260206004820152601360248201527227b7363c9034b6b83632b6b2b73a30ba34b7b760691b604482015290519081900360640190fd5b61046c816109cc565b6000610d38610ca0565b600d81905543600e55905090565b6000610d5e670de0b6b3a76400006107008486611421565b9392505050565b610d8e7f00000000000000000000000000000000000000000000000000000000000000006116d1565b610db77f00000000000000000000000000000000000000000000000000000000000000006116d1565b610de07f00000000000000000000000000000000000000000000000000000000000000006116d1565b610e097f00000000000000000000000000000000000000000000000000000000000000006116d1565b610e327f00000000000000000000000000000000000000000000000000000000000000006116d1565b610e5b7f00000000000000000000000000000000000000000000000000000000000000006116d1565b610e847f00000000000000000000000000000000000000000000000000000000000000006116d1565b565b600033610e91611555565b6001600160a01b0316816001600160a01b03161480610ebd57506015546001600160a01b038281169116145b610ed95760405162461bcd60e51b815260040161049990611ba5565b600080600080600080866001600160a01b03166355c852698a6040518263ffffffff1660e01b8152600401610f0e9190611a57565b60c06040518083038186803b158015610f2657600080fd5b505afa158015610f3a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f5e9190611905565b9550955095509550955095506000610f75856111e5565b9050610f80856111d1565b15610fd657896001600160a01b0316866001600160a01b03167f9b1323a10f3955b1c9c054ffbda78edfdf49998aaf37f61d9f84776b59ac804360405160405180910390a36000985050505050505050506104f6565b6000871561106357610ff3610fec868685611580565b84906114e1565b90508015611063576110036117d2565b6001600160a01b03166340c10f198a836040518363ffffffff1660e01b8152600401611030929190611a6b565b600060405180830381600087803b15801561104a57600080fd5b505af115801561105e573d6000803e3d6000fd5b505050505b8a6001600160a01b0316876001600160a01b03167fa111914d7f2ea8beca61d12f1a1f38c5533de5f1823c3936422df4404ac2ec68836040516110a69190611a8f565b60405180910390a39a9950505050505050505050565b600d5481565b6000806110da600e54436113c490919063ffffffff16565b9050806110eb576000915050610cb9565b6014546110fc576000915050610cb9565b60006111066117d2565b90506000816001600160a01b03166370a08231611121611399565b6040518263ffffffff1660e01b815260040161113d9190611a57565b60206040518083038186803b15801561115557600080fd5b505afa158015611169573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061118d9190611a1e565b9050806111a05760009350505050610cb9565b6014546000906111b09085611421565b90506111c88261070083670de0b6b3a7640000611421565b94505050505090565b600090815260116020526040902054151590565b600081815260106020526040812081806111fe85610724565b6003850182905560019094019390935550909392505050565b6000546001600160a01b031681565b60008054906101000a90046001600160a01b03166001600160a01b0316634fc07d756040518163ffffffff1660e01b815260040160206040518083038186803b15801561127257600080fd5b505afa158015611286573d6000803e3d6000fd5b505050506040513d602081101561129c57600080fd5b50516001600160a01b03163314610e84576040805162461bcd60e51b815260206004820152601860248201527f4f6e6c7920436f6e74726f6c6c657220676f7665726e6f720000000000000000604482015290519081900360640190fd5b611302610d2e565b5060148190556040517f96d5a4b4edf1cefd0900c166d64447f8da1d01d1861a6a60894b5b82a2c15c3c9061045090611b4d565b600081611344576000611346565b435b600084815260116020526040908190208290555190915083907fe016102b339c3889f4967b491f3381f2c352c8fe3d4f880007807d45b124065a9061138c908490611a8f565b60405180910390a2505050565b6000610cb67f00000000000000000000000000000000000000000000000000000000000000006117f9565b60008282111561141b576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b600082611430575060006109b8565b8282028284828161143d57fe5b0414610d5e5760405162461bcd60e51b8152600401808060200182810382526021815260200180611c516021913960400191505060405180910390fd5b60008082116114d0576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b8183816114d957fe5b049392505050565b600082820183811015610d5e576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600081831161154b576000610d5e565b610d5e83836113c4565b6000610cb67f00000000000000000000000000000000000000000000000000000000000000006117f9565b60008061158d83856113c4565b9050610715670de0b6b3a76400006107008388611421565b6000546001600160a01b03163314610e84576040805162461bcd60e51b815260206004820152601960248201527f43616c6c6572206d75737420626520436f6e74726f6c6c657200000000000000604482015290519081900360640190fd5b6001600160a01b038116611658576040805162461bcd60e51b815260206004820152601660248201527510dbdb9d1c9bdb1b195c881b5d5cdd081899481cd95d60521b604482015290519081900360640190fd5b600080546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f4ff638452bbf33c012645d18ae6f05515ff5f2d1dfb0cece8cbf018c60903f709181900360200190a150565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6000805460408051637bb20d2f60e11b81526004810185905290516001600160a01b039092169163f7641a5e91602480820192602092909190829003018186803b15801561171e57600080fd5b505afa158015611732573d6000803e3d6000fd5b505050506040513d602081101561174857600080fd5b50516000838152600160205260409020549091506001600160a01b038083169116146104ac5760008281526001602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251908152915184927fd0e7a942b1fc38c411c4f53d153ba14fd24542a6a35ebacd9b6afca1a154e20692908290030190a25050565b6000610cb67f00000000000000000000000000000000000000000000000000000000000000005b6000818152600160205260408120546001600160a01b0316806109b85760005460408051637bb20d2f60e11b81526004810186905290516001600160a01b039092169163f7641a5e91602480820192602092909190829003018186803b15801561186257600080fd5b505afa158015611876573d6000803e3d6000fd5b505050506040513d602081101561188c57600080fd5b50519392505050565b6000602082840312156118a6578081fd5b8135610d5e81611c2d565b6000602082840312156118c2578081fd5b8151610d5e81611c2d565b600080604083850312156118df578081fd5b82356118ea81611c2d565b915060208301356118fa81611c2d565b809150509250929050565b60008060008060008060c0878903121561191d578182fd5b865161192881611c42565b602088015190965061193981611c2d565b6040880151606089015160808a015160a0909a0151989b929a5090989097909650945092505050565b600060208284031215611973578081fd5b5035919050565b6000806040838503121561198c578182fd5b8235915060208301356118fa81611c42565b6000806000604084860312156119b2578283fd5b83356119bd81611c2d565b9250602084013567ffffffffffffffff808211156119d9578384fd5b818601915086601f8301126119ec578384fd5b8135818111156119fa578485fd5b876020828501011115611a0b578485fd5b6020830194508093505050509250925092565b600060208284031215611a2f578081fd5b5051919050565b60008060408385031215611a48578182fd5b50508035926020909101359150565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b901515815260200190565b90815260200190565b6020808252601a908201527f7375626772617068417661696c6162696c6974794f7261636c65000000000000604082015260600190565b6020808252602f908201527f43616c6c6572206d75737420626520746865207375626772617068206176616960408201526e6c6162696c697479206f7261636c6560881b606082015260800190565b6020808252601590820152741b5a5b9a5b5d5b54dd5899dc985c1a14da59db985b605a1b604082015260600190565b60208082526010908201526f69737375616e6365506572426c6f636b60801b604082015260600190565b6020808252601490820152732737ba1030903932bbb0b932399034b9b9bab2b960611b604082015260600190565b6020808252601f908201527f43616c6c6572206d757374206265206120726577617264732069737375657200604082015260600190565b6020808252600e908201526d139bdd08185d5d1a1bdc9a5e995960921b604082015260600190565b918252602082015260400190565b93845260208401929092526040830152606082015260800190565b6001600160a01b038116811461046c57600080fd5b801515811461046c57600080fdfe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a2646970667358221220b536df78ac5675cc1b134b52c2a049a6938eb11d81ca397ce9b07214c71d8af264736f6c63430007060033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101da5760003560e01c806393a90a1e11610104578063c8a5f81e116100a2578063e284f84811610071578063e284f848146103ad578063e820e284146103b5578063eeac3e0e146103d5578063f77c4791146103e8576101da565b8063c8a5f81e14610377578063d6866ea51461038a578063db75092614610392578063e242cf1e146103a5576101da565b8063a8cc0ee2116100de578063a8cc0ee21461034c578063b951acd714610354578063c4d66de81461035c578063c7d1117d1461036f576101da565b806393a90a1e146103135780639ce7abe514610326578063a2594d8214610339576101da565b80634986594f1161017c578063702a280e1161014b578063702a280e146102c4578063779bcb9b146102e55780639006ce8b146102f857806392eefe9b14610300576101da565b80634986594f146102735780634bbfc1c5146102965780635c6cbd59146102a95780636c080f18146102bc576101da565b80631324a506116101b85780631324a5061461022557806316a84ab2146102385780631d1c2fec14610258578063260582491461026b576101da565b806305bb8c6b146101df5780630903c094146101fd5780631156bdc114610212575b600080fd5b6101e76103f0565b6040516101f49190611a57565b60405180910390f35b61021061020b366004611895565b6103ff565b005b610210610220366004611962565b61045b565b61021061023336600461197a565b61046f565b61024b610246366004611962565b6104b0565b6040516101f49190611a8f565b61024b610266366004611962565b6104c2565b6101e76104fb565b610286610281366004611962565b61050a565b6040516101f49493929190611c12565b6102106102a4366004611962565b610531565b61024b6102b7366004611962565b61062d565b61024b61071e565b6102d76102d2366004611962565b610724565b6040516101f4929190611c04565b61024b6102f33660046118cd565b610898565b61024b6109be565b61021061030e366004611895565b6109c4565b610210610321366004611895565b6109d5565b61021061033436600461199e565b610a2f565b610210610347366004611895565b610b85565b61024b610ca0565b61024b610cbc565b61021061036a366004611895565b610cc2565b61024b610d2e565b61024b610385366004611a36565b610d46565b610210610d65565b61024b6103a0366004611895565b610e86565b61024b6110bc565b61024b6110c2565b6103c86103c3366004611962565b6111d1565b6040516101f49190611a84565b61024b6103e3366004611962565b6111e5565b6101e7611217565b600f546001600160a01b031681565b610407611226565b600f80546001600160a01b0319166001600160a01b0383161790556040517f96d5a4b4edf1cefd0900c166d64447f8da1d01d1861a6a60894b5b82a2c15c3c9061045090611a98565b60405180910390a150565b610463611226565b61046c816112fa565b50565b600f546001600160a01b031633146104a25760405162461bcd60e51b815260040161049990611acf565b60405180910390fd5b6104ac8282611336565b5050565b60116020526000908152604090205481565b60006104cc610d2e565b5060008281526010602052604090206104e48361062d565b808255600d5460029092019190915590505b919050565b6015546001600160a01b031681565b60106020526000908152604090208054600182015460028301546003909301549192909184565b600f546001600160a01b03163314806105de575060008054906101000a90046001600160a01b03166001600160a01b0316634fc07d756040518163ffffffff1660e01b815260040160206040518083038186803b15801561059157600080fd5b505afa1580156105a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105c991906118b1565b6001600160a01b0316336001600160a01b0316145b6105fa5760405162461bcd60e51b815260040161049990611bdc565b60128190556040517f96d5a4b4edf1cefd0900c166d64447f8da1d01d1861a6a60894b5b82a2c15c3c9061045090611b1e565b600081815260106020526040812081610644611399565b6001600160a01b03166346e855da856040518263ffffffff1660e01b815260040161066f9190611a8f565b60206040518083038186803b15801561068757600080fd5b505afa15801561069b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106bf9190611a1e565b905060006012548210156106d4576000610706565b610706670de0b6b3a7640000610700846106fa87600201546106f4610ca0565b906113c4565b90611421565b9061147a565b835490915061071590826114e1565b95945050505050565b60145481565b600081815260106020526040812081908161073e8561062d565b9050600061075082846001015461153b565b90506000806040518060400160405280610768611555565b6001600160a01b03908116825260155416602090910152905060005b600281101561084757600082826002811061079b57fe5b60200201516001600160a01b03161461083f578181600281106107ba57fe5b60200201516001600160a01b031663e2e1e8e98a6040518263ffffffff1660e01b81526004016107ea9190611a8f565b60206040518083038186803b15801561080257600080fd5b505afa158015610816573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061083a9190611a1e565b830192505b600101610784565b508161085e57600084965096505050505050610893565b60006108768361070086670de0b6b3a7640000611421565b600387015490915061088890826114e1565b975093955050505050505b915091565b60006108a2611555565b6001600160a01b0316836001600160a01b031614806108ce57506015546001600160a01b038481169116145b6108ea5760405162461bcd60e51b815260040161049990611b77565b6000806000806000876001600160a01b03166355c85269886040518263ffffffff1660e01b815260040161091e9190611a57565b60c06040518083038186803b15801561093657600080fd5b505afa15801561094a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061096e9190611905565b95509550955095505094508461098c576000955050505050506109b8565b600061099785610724565b5090506109af6109a8858584611580565b83906114e1565b96505050505050505b92915050565b600e5481565b6109cc6115a5565b61046c81611604565b6109dd611226565b601580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f97befc0afcf2bace352f077aea9873c9552fc2e5ab26874f356006fdf9da4ede90600090a35050565b82806001600160a01b031663f851a4406040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610a6b57600080fd5b505af1158015610a7f573d6000803e3d6000fd5b505050506040513d6020811015610a9557600080fd5b50516001600160a01b03163314610af3576040805162461bcd60e51b815260206004820152601e60248201527f43616c6c6572206d757374206265207468652070726f78792061646d696e0000604482015290519081900360640190fd5b60405163623faf6160e01b8152602060048201908152602482018490526001600160a01b0386169163623faf619186918691908190604401848480828437600081840152601f19601f8201169050808301925050509350505050600060405180830381600087803b158015610b6757600080fd5b505af1158015610b7b573d6000803e3d6000fd5b5050505050505050565b80806001600160a01b031663f851a4406040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610bc157600080fd5b505af1158015610bd5573d6000803e3d6000fd5b505050506040513d6020811015610beb57600080fd5b50516001600160a01b03163314610c49576040805162461bcd60e51b815260206004820152601e60248201527f43616c6c6572206d757374206265207468652070726f78792061646d696e0000604482015290519081900360640190fd5b816001600160a01b03166359fc20bb6040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610c8457600080fd5b505af1158015610c98573d6000803e3d6000fd5b505050505050565b6000610cb6610cad6110c2565b600d54906114e1565b90505b90565b60125481565b610cca6116ac565b6001600160a01b0316336001600160a01b031614610d25576040805162461bcd60e51b815260206004820152601360248201527227b7363c9034b6b83632b6b2b73a30ba34b7b760691b604482015290519081900360640190fd5b61046c816109cc565b6000610d38610ca0565b600d81905543600e55905090565b6000610d5e670de0b6b3a76400006107008486611421565b9392505050565b610d8e7f00000000000000000000000000000000000000000000000000000000000000006116d1565b610db77f00000000000000000000000000000000000000000000000000000000000000006116d1565b610de07f00000000000000000000000000000000000000000000000000000000000000006116d1565b610e097f00000000000000000000000000000000000000000000000000000000000000006116d1565b610e327f00000000000000000000000000000000000000000000000000000000000000006116d1565b610e5b7f00000000000000000000000000000000000000000000000000000000000000006116d1565b610e847f00000000000000000000000000000000000000000000000000000000000000006116d1565b565b600033610e91611555565b6001600160a01b0316816001600160a01b03161480610ebd57506015546001600160a01b038281169116145b610ed95760405162461bcd60e51b815260040161049990611ba5565b600080600080600080866001600160a01b03166355c852698a6040518263ffffffff1660e01b8152600401610f0e9190611a57565b60c06040518083038186803b158015610f2657600080fd5b505afa158015610f3a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f5e9190611905565b9550955095509550955095506000610f75856111e5565b9050610f80856111d1565b15610fd657896001600160a01b0316866001600160a01b03167f9b1323a10f3955b1c9c054ffbda78edfdf49998aaf37f61d9f84776b59ac804360405160405180910390a36000985050505050505050506104f6565b6000871561106357610ff3610fec868685611580565b84906114e1565b90508015611063576110036117d2565b6001600160a01b03166340c10f198a836040518363ffffffff1660e01b8152600401611030929190611a6b565b600060405180830381600087803b15801561104a57600080fd5b505af115801561105e573d6000803e3d6000fd5b505050505b8a6001600160a01b0316876001600160a01b03167fa111914d7f2ea8beca61d12f1a1f38c5533de5f1823c3936422df4404ac2ec68836040516110a69190611a8f565b60405180910390a39a9950505050505050505050565b600d5481565b6000806110da600e54436113c490919063ffffffff16565b9050806110eb576000915050610cb9565b6014546110fc576000915050610cb9565b60006111066117d2565b90506000816001600160a01b03166370a08231611121611399565b6040518263ffffffff1660e01b815260040161113d9190611a57565b60206040518083038186803b15801561115557600080fd5b505afa158015611169573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061118d9190611a1e565b9050806111a05760009350505050610cb9565b6014546000906111b09085611421565b90506111c88261070083670de0b6b3a7640000611421565b94505050505090565b600090815260116020526040902054151590565b600081815260106020526040812081806111fe85610724565b6003850182905560019094019390935550909392505050565b6000546001600160a01b031681565b60008054906101000a90046001600160a01b03166001600160a01b0316634fc07d756040518163ffffffff1660e01b815260040160206040518083038186803b15801561127257600080fd5b505afa158015611286573d6000803e3d6000fd5b505050506040513d602081101561129c57600080fd5b50516001600160a01b03163314610e84576040805162461bcd60e51b815260206004820152601860248201527f4f6e6c7920436f6e74726f6c6c657220676f7665726e6f720000000000000000604482015290519081900360640190fd5b611302610d2e565b5060148190556040517f96d5a4b4edf1cefd0900c166d64447f8da1d01d1861a6a60894b5b82a2c15c3c9061045090611b4d565b600081611344576000611346565b435b600084815260116020526040908190208290555190915083907fe016102b339c3889f4967b491f3381f2c352c8fe3d4f880007807d45b124065a9061138c908490611a8f565b60405180910390a2505050565b6000610cb67f00000000000000000000000000000000000000000000000000000000000000006117f9565b60008282111561141b576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b600082611430575060006109b8565b8282028284828161143d57fe5b0414610d5e5760405162461bcd60e51b8152600401808060200182810382526021815260200180611c516021913960400191505060405180910390fd5b60008082116114d0576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b8183816114d957fe5b049392505050565b600082820183811015610d5e576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600081831161154b576000610d5e565b610d5e83836113c4565b6000610cb67f00000000000000000000000000000000000000000000000000000000000000006117f9565b60008061158d83856113c4565b9050610715670de0b6b3a76400006107008388611421565b6000546001600160a01b03163314610e84576040805162461bcd60e51b815260206004820152601960248201527f43616c6c6572206d75737420626520436f6e74726f6c6c657200000000000000604482015290519081900360640190fd5b6001600160a01b038116611658576040805162461bcd60e51b815260206004820152601660248201527510dbdb9d1c9bdb1b195c881b5d5cdd081899481cd95d60521b604482015290519081900360640190fd5b600080546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f4ff638452bbf33c012645d18ae6f05515ff5f2d1dfb0cece8cbf018c60903f709181900360200190a150565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6000805460408051637bb20d2f60e11b81526004810185905290516001600160a01b039092169163f7641a5e91602480820192602092909190829003018186803b15801561171e57600080fd5b505afa158015611732573d6000803e3d6000fd5b505050506040513d602081101561174857600080fd5b50516000838152600160205260409020549091506001600160a01b038083169116146104ac5760008281526001602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251908152915184927fd0e7a942b1fc38c411c4f53d153ba14fd24542a6a35ebacd9b6afca1a154e20692908290030190a25050565b6000610cb67f00000000000000000000000000000000000000000000000000000000000000005b6000818152600160205260408120546001600160a01b0316806109b85760005460408051637bb20d2f60e11b81526004810186905290516001600160a01b039092169163f7641a5e91602480820192602092909190829003018186803b15801561186257600080fd5b505afa158015611876573d6000803e3d6000fd5b505050506040513d602081101561188c57600080fd5b50519392505050565b6000602082840312156118a6578081fd5b8135610d5e81611c2d565b6000602082840312156118c2578081fd5b8151610d5e81611c2d565b600080604083850312156118df578081fd5b82356118ea81611c2d565b915060208301356118fa81611c2d565b809150509250929050565b60008060008060008060c0878903121561191d578182fd5b865161192881611c42565b602088015190965061193981611c2d565b6040880151606089015160808a015160a0909a0151989b929a5090989097909650945092505050565b600060208284031215611973578081fd5b5035919050565b6000806040838503121561198c578182fd5b8235915060208301356118fa81611c42565b6000806000604084860312156119b2578283fd5b83356119bd81611c2d565b9250602084013567ffffffffffffffff808211156119d9578384fd5b818601915086601f8301126119ec578384fd5b8135818111156119fa578485fd5b876020828501011115611a0b578485fd5b6020830194508093505050509250925092565b600060208284031215611a2f578081fd5b5051919050565b60008060408385031215611a48578182fd5b50508035926020909101359150565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b901515815260200190565b90815260200190565b6020808252601a908201527f7375626772617068417661696c6162696c6974794f7261636c65000000000000604082015260600190565b6020808252602f908201527f43616c6c6572206d75737420626520746865207375626772617068206176616960408201526e6c6162696c697479206f7261636c6560881b606082015260800190565b6020808252601590820152741b5a5b9a5b5d5b54dd5899dc985c1a14da59db985b605a1b604082015260600190565b60208082526010908201526f69737375616e6365506572426c6f636b60801b604082015260600190565b6020808252601490820152732737ba1030903932bbb0b932399034b9b9bab2b960611b604082015260600190565b6020808252601f908201527f43616c6c6572206d757374206265206120726577617264732069737375657200604082015260600190565b6020808252600e908201526d139bdd08185d5d1a1bdc9a5e995960921b604082015260600190565b918252602082015260400190565b93845260208401929092526040830152606082015260800190565b6001600160a01b038116811461046c57600080fd5b801515811461046c57600080fdfe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a2646970667358221220b536df78ac5675cc1b134b52c2a049a6938eb11d81ca397ce9b07214c71d8af264736f6c63430007060033", + "linkReferences": {}, + "deployedLinkReferences": {} +} \ No newline at end of file diff --git a/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/SubgraphService#ProxyAdmin.json b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/SubgraphService#ProxyAdmin.json new file mode 100644 index 000000000..8db6171f9 --- /dev/null +++ b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/SubgraphService#ProxyAdmin.json @@ -0,0 +1,132 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "ProxyAdmin", + "sourceName": "contracts/proxy/transparent/ProxyAdmin.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "initialOwner", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "OwnableInvalidOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "OwnableUnauthorizedAccount", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "inputs": [], + "name": "UPGRADE_INTERFACE_VERSION", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ITransparentUpgradeableProxy", + "name": "proxy", + "type": "address" + }, + { + "internalType": "address", + "name": "implementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ], + "bytecode": "0x608060405234801561000f575f80fd5b506040516104fc3803806104fc83398101604081905261002e916100bb565b806001600160a01b03811661005c57604051631e4fbdf760e01b81525f600482015260240160405180910390fd5b6100658161006c565b50506100e8565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b5f602082840312156100cb575f80fd5b81516001600160a01b03811681146100e1575f80fd5b9392505050565b610407806100f55f395ff3fe608060405260043610610049575f3560e01c8063715018a61461004d5780638da5cb5b146100635780639623609d1461008e578063ad3cb1cc146100a1578063f2fde38b146100de575b5f80fd5b348015610058575f80fd5b506100616100fd565b005b34801561006e575f80fd5b505f546040516001600160a01b0390911681526020015b60405180910390f35b61006161009c366004610260565b610110565b3480156100ac575f80fd5b506100d1604051806040016040528060058152602001640352e302e360dc1b81525081565b6040516100859190610372565b3480156100e9575f80fd5b506100616100f836600461038b565b61017b565b6101056101bd565b61010e5f6101e9565b565b6101186101bd565b60405163278f794360e11b81526001600160a01b03841690634f1ef28690349061014890869086906004016103a6565b5f604051808303818588803b15801561015f575f80fd5b505af1158015610171573d5f803e3d5ffd5b5050505050505050565b6101836101bd565b6001600160a01b0381166101b157604051631e4fbdf760e01b81525f60048201526024015b60405180910390fd5b6101ba816101e9565b50565b5f546001600160a01b0316331461010e5760405163118cdaa760e01b81523360048201526024016101a8565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b03811681146101ba575f80fd5b634e487b7160e01b5f52604160045260245ffd5b5f805f60608486031215610272575f80fd5b833561027d81610238565b9250602084013561028d81610238565b9150604084013567ffffffffffffffff808211156102a9575f80fd5b818601915086601f8301126102bc575f80fd5b8135818111156102ce576102ce61024c565b604051601f8201601f19908116603f011681019083821181831017156102f6576102f661024c565b8160405282815289602084870101111561030e575f80fd5b826020860160208301375f6020848301015280955050505050509250925092565b5f81518084525f5b8181101561035357602081850181015186830182015201610337565b505f602082860101526020601f19601f83011685010191505092915050565b602081525f610384602083018461032f565b9392505050565b5f6020828403121561039b575f80fd5b813561038481610238565b6001600160a01b03831681526040602082018190525f906103c99083018461032f565b94935050505056fea2646970667358221220098134bf3dcb274377e55b14b69b89c7eefde1171c4c5b1eb6233b5158fa785b64736f6c63430008180033", + "deployedBytecode": "0x608060405260043610610049575f3560e01c8063715018a61461004d5780638da5cb5b146100635780639623609d1461008e578063ad3cb1cc146100a1578063f2fde38b146100de575b5f80fd5b348015610058575f80fd5b506100616100fd565b005b34801561006e575f80fd5b505f546040516001600160a01b0390911681526020015b60405180910390f35b61006161009c366004610260565b610110565b3480156100ac575f80fd5b506100d1604051806040016040528060058152602001640352e302e360dc1b81525081565b6040516100859190610372565b3480156100e9575f80fd5b506100616100f836600461038b565b61017b565b6101056101bd565b61010e5f6101e9565b565b6101186101bd565b60405163278f794360e11b81526001600160a01b03841690634f1ef28690349061014890869086906004016103a6565b5f604051808303818588803b15801561015f575f80fd5b505af1158015610171573d5f803e3d5ffd5b5050505050505050565b6101836101bd565b6001600160a01b0381166101b157604051631e4fbdf760e01b81525f60048201526024015b60405180910390fd5b6101ba816101e9565b50565b5f546001600160a01b0316331461010e5760405163118cdaa760e01b81523360048201526024016101a8565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b03811681146101ba575f80fd5b634e487b7160e01b5f52604160045260245ffd5b5f805f60608486031215610272575f80fd5b833561027d81610238565b9250602084013561028d81610238565b9150604084013567ffffffffffffffff808211156102a9575f80fd5b818601915086601f8301126102bc575f80fd5b8135818111156102ce576102ce61024c565b604051601f8201601f19908116603f011681019083821181831017156102f6576102f661024c565b8160405282815289602084870101111561030e575f80fd5b826020860160208301375f6020848301015280955050505050509250925092565b5f81518084525f5b8181101561035357602081850181015186830182015201610337565b505f602082860101526020601f19601f83011685010191505092915050565b602081525f610384602083018461032f565b9392505050565b5f6020828403121561039b575f80fd5b813561038481610238565b6001600160a01b03831681526040602082018190525f906103c99083018461032f565b94935050505056fea2646970667358221220098134bf3dcb274377e55b14b69b89c7eefde1171c4c5b1eb6233b5158fa785b64736f6c63430008180033", + "linkReferences": {}, + "deployedLinkReferences": {} +} \ No newline at end of file diff --git a/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/SubgraphService#SubgraphService.dbg.json b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/SubgraphService#SubgraphService.dbg.json new file mode 100644 index 000000000..767ad87b5 --- /dev/null +++ b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/SubgraphService#SubgraphService.dbg.json @@ -0,0 +1,4 @@ +{ + "_format": "hh-sol-dbg-1", + "buildInfo": "../build-info/81754efc7e2eec76b7d493cc60c0f970.json" +} \ No newline at end of file diff --git a/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/SubgraphService#SubgraphService.json b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/SubgraphService#SubgraphService.json new file mode 100644 index 000000000..d14c050d0 --- /dev/null +++ b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/SubgraphService#SubgraphService.json @@ -0,0 +1,2268 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "SubgraphService", + "sourceName": "contracts/SubgraphService.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "graphController", + "type": "address" + }, + { + "internalType": "address", + "name": "disputeManager", + "type": "address" + }, + { + "internalType": "address", + "name": "graphTallyCollector", + "type": "address" + }, + { + "internalType": "address", + "name": "curation", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + } + ], + "name": "AddressEmptyCode", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "AllocationAlreadyExists", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "internalType": "uint256", + "name": "closedAt", + "type": "uint256" + } + ], + "name": "AllocationClosed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "AllocationDoesNotExist", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "AllocationManagerAllocationClosed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "AllocationManagerAllocationSameSize", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "signer", + "type": "address" + }, + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "AllocationManagerInvalidAllocationProof", + "type": "error" + }, + { + "inputs": [], + "name": "AllocationManagerInvalidZeroAllocationId", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "claimId", + "type": "bytes32" + } + ], + "name": "DataServiceFeesClaimNotFound", + "type": "error" + }, + { + "inputs": [], + "name": "DataServiceFeesZeroTokens", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "DataServicePausableNotPauseGuardian", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "DataServicePausablePauseGuardianNoChange", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "internalType": "address", + "name": "disputeManager", + "type": "address" + } + ], + "name": "DirectoryNotDisputeManager", + "type": "error" + }, + { + "inputs": [], + "name": "ECDSAInvalidSignature", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "length", + "type": "uint256" + } + ], + "name": "ECDSAInvalidSignatureLength", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "ECDSAInvalidSignatureS", + "type": "error" + }, + { + "inputs": [], + "name": "EnforcedPause", + "type": "error" + }, + { + "inputs": [], + "name": "ExpectedPause", + "type": "error" + }, + { + "inputs": [], + "name": "FailedCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "contractName", + "type": "bytes" + } + ], + "name": "GraphDirectoryInvalidZeroAddress", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidInitialization", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "LegacyAllocationAlreadyExists", + "type": "error" + }, + { + "inputs": [], + "name": "LinkedListEmptyList", + "type": "error" + }, + { + "inputs": [], + "name": "LinkedListInvalidIterations", + "type": "error" + }, + { + "inputs": [], + "name": "LinkedListInvalidZeroId", + "type": "error" + }, + { + "inputs": [], + "name": "LinkedListMaxElementsExceeded", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "OwnableInvalidOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "OwnableUnauthorizedAccount", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "a", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "b", + "type": "uint256" + } + ], + "name": "PPMMathInvalidMulPPM", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "name": "ProvisionManagerInvalidRange", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "message", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "name": "ProvisionManagerInvalidValue", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "ProvisionManagerNotAuthorized", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + } + ], + "name": "ProvisionManagerProvisionNotFound", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokensAvailable", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokensRequired", + "type": "uint256" + } + ], + "name": "ProvisionTrackerInsufficientTokens", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "SubgraphServiceAllocationIsAltruistic", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "SubgraphServiceAllocationNotAuthorized", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "SubgraphServiceCannotForceCloseAllocation", + "type": "error" + }, + { + "inputs": [], + "name": "SubgraphServiceEmptyGeohash", + "type": "error" + }, + { + "inputs": [], + "name": "SubgraphServiceEmptyUrl", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "balanceBefore", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "balanceAfter", + "type": "uint256" + } + ], + "name": "SubgraphServiceInconsistentCollection", + "type": "error" + }, + { + "inputs": [], + "name": "SubgraphServiceIndexerAlreadyRegistered", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "providedIndexer", + "type": "address" + }, + { + "internalType": "address", + "name": "expectedIndexer", + "type": "address" + } + ], + "name": "SubgraphServiceIndexerMismatch", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + } + ], + "name": "SubgraphServiceIndexerNotRegistered", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "collectionId", + "type": "bytes32" + } + ], + "name": "SubgraphServiceInvalidCollectionId", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "curationCut", + "type": "uint256" + } + ], + "name": "SubgraphServiceInvalidCurationCut", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "paymentType", + "type": "uint8" + } + ], + "name": "SubgraphServiceInvalidPaymentType", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "ravIndexer", + "type": "address" + }, + { + "internalType": "address", + "name": "allocationIndexer", + "type": "address" + } + ], + "name": "SubgraphServiceInvalidRAV", + "type": "error" + }, + { + "inputs": [], + "name": "SubgraphServiceInvalidZeroStakeToFeesRatio", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "forceClosed", + "type": "bool" + } + ], + "name": "AllocationClosed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "currentEpoch", + "type": "uint256" + } + ], + "name": "AllocationCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newTokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldTokens", + "type": "uint256" + } + ], + "name": "AllocationResized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "curationCut", + "type": "uint256" + } + ], + "name": "CurationCutSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "ratio", + "type": "uint32" + } + ], + "name": "DelegationRatioSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "EIP712DomainChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "graphToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "graphStaking", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphPayments", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphEscrow", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "graphController", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphEpochManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphRewardsManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphTokenGateway", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphProxyAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphCuration", + "type": "address" + } + ], + "name": "GraphDirectoryInitialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensRewards", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensIndexerRewards", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensDelegationRewards", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "poi", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "poiMetadata", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "currentEpoch", + "type": "uint256" + } + ], + "name": "IndexingRewardsCollected", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + } + ], + "name": "LegacyAllocationMigrated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "maxPOIStaleness", + "type": "uint256" + } + ], + "name": "MaxPOIStalenessSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "PauseGuardianSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Paused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "paymentsDestination", + "type": "address" + } + ], + "name": "PaymentsDestinationSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + } + ], + "name": "ProvisionPendingParametersAccepted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "name": "ProvisionTokensRangeSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensCollected", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensCurators", + "type": "uint256" + } + ], + "name": "QueryFeesCollected", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "feeType", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "ServicePaymentCollected", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "ServiceProviderRegistered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "ServiceProviderSlashed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "ServiceStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "ServiceStopped", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "claimId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "unlockTimestamp", + "type": "uint256" + } + ], + "name": "StakeClaimLocked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "claimId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "releasableAt", + "type": "uint256" + } + ], + "name": "StakeClaimReleased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "claimsCount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensReleased", + "type": "uint256" + } + ], + "name": "StakeClaimsReleased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "ratio", + "type": "uint256" + } + ], + "name": "StakeToFeesRatioSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "subgraphService", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "disputeManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphTallyCollector", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "curation", + "type": "address" + } + ], + "name": "SubgraphServiceDirectoryInitialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "min", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "max", + "type": "uint64" + } + ], + "name": "ThawingPeriodRangeSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Unpaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "min", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "max", + "type": "uint32" + } + ], + "name": "VerifierCutRangeSet", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "name": "acceptProvisionPendingParameters", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + } + ], + "name": "allocationProvisionTracker", + "outputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "claimId", + "type": "bytes32" + } + ], + "name": "claims", + "outputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "createdAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "releasableAt", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "nextClaim", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + } + ], + "name": "claimsLists", + "outputs": [ + { + "internalType": "bytes32", + "name": "head", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "tail", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "count", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "closeStaleAllocation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "paymentType", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "collect", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "curationFeesCut", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "eip712Domain", + "outputs": [ + { + "internalType": "bytes1", + "name": "fields", + "type": "bytes1" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "version", + "type": "string" + }, + { + "internalType": "uint256", + "name": "chainId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "verifyingContract", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "salt", + "type": "bytes32" + }, + { + "internalType": "uint256[]", + "name": "extensions", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "encodeAllocationProof", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + } + ], + "name": "feesProvisionTracker", + "outputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "getAllocation", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "createdAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "closedAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lastPOIPresentedAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "accRewardsPerAllocatedToken", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "accRewardsPending", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "createdAtEpoch", + "type": "uint256" + } + ], + "internalType": "struct Allocation.State", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "getAllocationData", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getCuration", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getDelegationRatio", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getDisputeManager", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getGraphTallyCollector", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "getLegacyAllocation", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + } + ], + "internalType": "struct LegacyAllocation.State", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getProvisionTokensRange", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + } + ], + "name": "getSubgraphAllocatedTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getThawingPeriodRange", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getVerifierCutRange", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + } + ], + "name": "indexers", + "outputs": [ + { + "internalType": "uint256", + "name": "registeredAt", + "type": "uint256" + }, + { + "internalType": "string", + "name": "url", + "type": "string" + }, + { + "internalType": "string", + "name": "geoHash", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "uint256", + "name": "minimumProvisionTokens", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "maximumDelegationRatio", + "type": "uint32" + }, + { + "internalType": "uint256", + "name": "stakeToFeesRatio_", + "type": "uint256" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + } + ], + "name": "isOverAllocated", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maxPOIStaleness", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "subgraphDeploymentID", + "type": "bytes32" + } + ], + "name": "migrateLegacyAllocation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "name": "multicall", + "outputs": [ + { + "internalType": "bytes[]", + "name": "results", + "type": "bytes[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "pauseGuardian", + "type": "address" + } + ], + "name": "pauseGuardians", + "outputs": [ + { + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "paused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + } + ], + "name": "paymentsDestination", + "outputs": [ + { + "internalType": "address", + "name": "destination", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "register", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "numClaimsToRelease", + "type": "uint256" + } + ], + "name": "releaseStake", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "resizeAllocation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "curationCut", + "type": "uint256" + } + ], + "name": "setCurationCut", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "delegationRatio", + "type": "uint32" + } + ], + "name": "setDelegationRatio", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "maxPOIStaleness_", + "type": "uint256" + } + ], + "name": "setMaxPOIStaleness", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "minimumProvisionTokens", + "type": "uint256" + } + ], + "name": "setMinimumProvisionTokens", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "pauseGuardian", + "type": "address" + }, + { + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "setPauseGuardian", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "paymentsDestination_", + "type": "address" + } + ], + "name": "setPaymentsDestination", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "stakeToFeesRatio_", + "type": "uint256" + } + ], + "name": "setStakeToFeesRatio", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "slash", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "stakeToFeesRatio", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "startService", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "stopService", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "unpause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "bytecode": "0x61024060405234801561001157600080fd5b5060405161667738038061667783398101604081905261003091610541565b3083838387806001600160a01b03811661007f5760405163218f5add60e11b815260206004820152600a60248201526921b7b73a3937b63632b960b11b60448201526064015b60405180910390fd5b6001600160a01b0381166101005260408051808201909152600a81526923b930b8342a37b5b2b760b11b60208201526100b7906103c5565b6001600160a01b03166080526040805180820190915260078152665374616b696e6760c81b60208201526100ea906103c5565b6001600160a01b031660a05260408051808201909152600d81526c47726170685061796d656e747360981b6020820152610123906103c5565b6001600160a01b031660c05260408051808201909152600e81526d5061796d656e7473457363726f7760901b602082015261015d906103c5565b6001600160a01b031660e05260408051808201909152600c81526b22b837b1b426b0b730b3b2b960a11b6020820152610195906103c5565b6001600160a01b03166101205260408051808201909152600e81526d2932bbb0b93239a6b0b730b3b2b960911b60208201526101d0906103c5565b6001600160a01b0316610140526040805180820190915260118152704772617068546f6b656e4761746577617960781b602082015261020e906103c5565b6001600160a01b03166101605260408051808201909152600f81526e23b930b834283937bc3ca0b236b4b760891b602082015261024a906103c5565b6001600160a01b03166101805260408051808201909152600881526721bab930ba34b7b760c11b602082015261027f906103c5565b6001600160a01b039081166101a08190526101005160a05160805160c05160e05161012051610140516101605161018051604051988b169a9788169996909716977fef5021414834d86e36470f5c1cecf6544fb2bb723f2ca51a4c86fcd8c5919a43976103299790916001600160a01b03978816815295871660208701529386166040860152918516606085015284166080840152831660a083015290911660c082015260e00190565b60405180910390a450506001600160a01b038481166101c08190528482166101e08190528483166102008190529284166102208190526040805193845260208401929092529082019290925260608101919091527f4175b2c37456dbac494e08de8666d31bb8f3f2aee36ea5d9e06894ff3e4ddda79060800160405180910390a1505050506103bc61047360201b60201c565b50505050610605565b600080610100516001600160a01b031663f7641a5e84805190602001206040518263ffffffff1660e01b815260040161040091815260200190565b602060405180830381865afa15801561041d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104419190610595565b9050826001600160a01b03821661046c5760405163218f5add60e11b815260040161007691906105b7565b5092915050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff16156104c35760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b03908116146105225780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b80516001600160a01b038116811461053c57600080fd5b919050565b6000806000806080858703121561055757600080fd5b61056085610525565b935061056e60208601610525565b925061057c60408601610525565b915061058a60608601610525565b905092959194509250565b6000602082840312156105a757600080fd5b6105b082610525565b9392505050565b602081526000825180602084015260005b818110156105e557602081860181015160408684010152016105c8565b506000604082850101526040601f19601f83011684010191505092915050565b60805160a05160c05160e05161010051610120516101405161016051610180516101a0516101c0516101e0516102005161022051615fd961069e6000396000612ee2015260006132de01526000818161163b0152612fe101526000505060005050600050506000505060006137080152600061457c01526000505060005050600050506000611b6b01526000613a640152615fd96000f3fe608060405234801561001057600080fd5b506004361061023b5760003560e01c806307e736d8146102405780630e02292314610280578063138dea081461030857806313c474c9146103205780631dd42f60146103755780631ebb7c301461038a57806324b8fbf6146103af57806335577962146103c25780633f4ba83a146103d557806345f54485146103dd578063482468b7146103f05780634f793cdc1461040657806355c85269146104285780635c975abb146104725780636234e2161461048a5780636ccec5b8146104aa5780636d9a3951146104bd578063715018a61461053857806371ce020a146105405780637aa31bce146105565780637dfe6d28146105695780637e89bac31461057c5780638180083b1461058f578063819ba366146105a257806381e777a7146105b8578063832bc923146105cb5780638456cb59146105de57806384b0196e146105e657806385e82baf146106015780638da5cb5b1461060a5780639384e07814610612578063ac9650d814610635578063b15d2a2c14610655578063ba38f67d14610668578063c0f474971461067b578063c84a5ef314610683578063cb8347fe14610696578063cbe5f3f2146106a9578063ce0fc0cc146106c9578063ce56c98b146106dc578063d07a7a84146106ef578063db9bee46146106f9578063dedf672614610701578063e2e1e8e914610714578063e6f5005414610734578063ebf6ddaf14610747578063ec9c218d1461074f578063eff0f59214610762578063f2fde38b14610797575b600080fd5b61026a61024e36600461502b565b610109602052600090815260409020546001600160a01b031681565b6040516102779190615048565b60405180910390f35b61029361028e36600461502b565b6107aa565b604051610277919060006101208201905060018060a01b0383511682526020830151602083015260408301516040830152606083015160608301526080830151608083015260a083015160a083015260c083015160c083015260e083015160e083015261010083015161010083015292915050565b6103126101085481565b604051908152602001610277565b61035561032e36600461502b565b609c6020526000908152604090208054600182015460028301546003909301549192909184565b604080519485526020850193909352918301526060820152608001610277565b61038861038336600461506e565b610837565b005b600254600160c01b900463ffffffff1660405163ffffffff9091168152602001610277565b6103886103bd3660046150cc565b610850565b6103886103d036600461512e565b610a7d565b610388610a93565b6103886103eb366004615167565b610acf565b6103f8610ad9565b604051610277929190615180565b61041961041436600461502b565b610aec565b604051610277939291906151e7565b61043b61043636600461502b565b610c20565b6040805196151587526001600160a01b039095166020870152938501929092526060840152608083015260a082015260c001610277565b61047a610cdc565b6040519015158152602001610277565b61031261049836600461502b565b60d16020526000908152604090205481565b6103886104b836600461502b565b610cf1565b6105146104cb36600461502b565b604080518082018252600080825260209182018190526001600160a01b03938416815260d082528290208251808401909352805490931682526001909201549181019190915290565b6040805182516001600160a01b031681526020928301519281019290925201610277565b610388610cfb565b610548610d0d565b60405161027792919061521c565b610388610564366004615167565b610d18565b610388610577366004615236565b610d29565b61038861058a366004615167565b610d41565b61038861059d3660046150cc565b610db6565b6105aa610f44565b604051610277929190615277565b6103886105c6366004615236565b610f54565b6103886105d9366004615167565b6110c4565b6103886110d8565b6105ee611112565b6040516102779796959493929190615285565b61031260d25481565b61026a6111bb565b61047a61062036600461502b565b60676020526000908152604090205460ff1681565b61064861064336600461531d565b6111d6565b6040516102779190615392565b6103126106633660046153f7565b6112be565b61047a61067636600461502b565b611492565b61026a6114b0565b61038861069136600461545f565b6114ba565b6103886106a43660046150cc565b611638565b6103126106b736600461502b565b609a6020526000908152604090205481565b6103886106d73660046150cc565b611777565b6103126106ea3660046154a7565b611860565b6103126101075481565b61026a611873565b61038861070f3660046150cc565b61187d565b610312610722366004615167565b600090815260d3602052604090205490565b610388610742366004615167565b611a0b565b61026a611a1c565b61038861075d36600461502b565b611a26565b610355610770366004615167565b609b6020526000908152604090208054600182015460028301546003909301549192909184565b6103886107a536600461502b565b611aa8565b6107b2614fae565b506001600160a01b03908116600090815260cf6020908152604091829020825161012081018452815490941684526001810154918401919091526002810154918301919091526003810154606083015260048101546080830152600581015460a0830152600681015460c0830152600781015460e08301526008015461010082015290565b61083f611ae3565b61084881611b15565b50565b905090565b82610859611b69565b6001600160a01b0316637c145cc78230336040518463ffffffff1660e01b8152600401610888939291906154d5565b602060405180830381865afa1580156108a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108c991906154f8565b813390916108f55760405163cc5d3c8b60e01b81526004016108ec929190615515565b60405180910390fd5b505083600061090382611b8d565b905061090e81611c90565b610919816000611cce565b610921611db8565b6000808061093187890189615646565b925092509250600083511161095957604051630783843960e51b815260040160405180910390fd5b600082511161097b57604051631e63bd9560e21b815260040160405180910390fd5b6001600160a01b03891660009081526101066020526040902054156109b357604051630d06866d60e21b815260040160405180910390fd5b6040805160608101825242815260208082018681528284018690526001600160a01b038d16600090815261010690925292902081518155915190919060018201906109fe9082615742565b5060408201516002820190610a139082615742565b5050506001600160a01b03811615610a2f57610a2f8982611dde565b886001600160a01b03167f159567bea25499a91f60e1fbb349ff2a1f8c1b2883198f25c1e12c99eddb44fa8989604051610a6a929190615800565b60405180910390a2505050505050505050565b610a85611ae3565b610a8f8282611e35565b5050565b3360008181526067602052604090205460ff16610ac4576040516372e3ef9760e01b81526004016108ec9190615048565b50610acd611eeb565b565b6108483382611f37565b600080610ae4611fdd565b915091509091565b6101066020526000908152604090208054600182018054919291610b0f906156c1565b80601f0160208091040260200160405190810160405280929190818152602001828054610b3b906156c1565b8015610b885780601f10610b5d57610100808354040283529160200191610b88565b820191906000526020600020905b815481529060010190602001808311610b6b57829003601f168201915b505050505090806002018054610b9d906156c1565b80601f0160208091040260200160405190810160405280929190818152602001828054610bc9906156c1565b8015610c165780601f10610beb57610100808354040283529160200191610c16565b820191906000526020600020905b815481529060010190602001808311610bf957829003601f168201915b5050505050905083565b6001600160a01b03808216600090815260cf60209081526040808320815161012081018352815490951685526001810154928501929092526002820154908401526003810154606084015260048101546080840152600581015460a0840152600681015460c0840152600781015460e0840152600801546101008301529081908190819081908190610cb181612054565b81516020830151604084015160c085015160e090950151939c929b5090995097509195509350915050565b600080610ce7612073565b5460ff1692915050565b6108483382611dde565b610d03611ae3565b610acd6000612097565b600080610ae46120f3565b610d20611ae3565b6108488161216a565b610d31611ae3565b610d3c83838361219f565b505050565b610d49611ae3565b610d5681620f4240101590565b8190610d7857604051631c9c717b60e01b81526004016108ec91815260200190565b506101088190556040518181527f6deef78ffe3df79ae5cd8e40b842c36ac6077e13746b9b68a9f327537b01e4e9906020015b60405180910390a150565b82610dbf611b69565b6001600160a01b0316637c145cc78230336040518463ffffffff1660e01b8152600401610dee939291906154d5565b602060405180830381865afa158015610e0b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e2f91906154f8565b81339091610e525760405163cc5d3c8b60e01b81526004016108ec929190615515565b50506001600160a01b0384166000908152610106602052604090205484908190610e905760405163ee27189960e01b81526004016108ec9190615048565b50610e99611db8565b6000610ea78486018661502b565b90506001600160a01b038616610ebe60cf836121f2565b51879183916001600160a01b031614610eec5760405163c0bbff1360e01b81526004016108ec929190615515565b5050610ef9816000612277565b856001600160a01b03167f73330c218a680717e9eee625c262df66eddfdf99ecb388d25f6b32d66b9a318a8686604051610f34929190615800565b60405180910390a2505050505050565b600080610ae46000546001549091565b82610f5d611b69565b6001600160a01b0316637c145cc78230336040518463ffffffff1660e01b8152600401610f8c939291906154d5565b602060405180830381865afa158015610fa9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fcd91906154f8565b81339091610ff05760405163cc5d3c8b60e01b81526004016108ec929190615515565b5050836000610ffe82611b8d565b905061100981611c90565b611014816000611cce565b6001600160a01b03861660009081526101066020526040902054869081906110505760405163ee27189960e01b81526004016108ec9190615048565b50611059611db8565b6001600160a01b03871661106e60cf886121f2565b51889188916001600160a01b03161461109c5760405163c0bbff1360e01b81526004016108ec929190615515565b50506110bb8686600260189054906101000a900463ffffffff166123d9565b50505050505050565b6110cc611ae3565b610848816000196126d7565b3360008181526067602052604090205460ff16611109576040516372e3ef9760e01b81526004016108ec9190615048565b50610acd612746565b600060608060008060006060600061112861278d565b805490915015801561113c57506001810154155b6111805760405162461bcd60e51b81526020600482015260156024820152741152540dcc4c8e88155b9a5b9a5d1a585b1a5e9959605a1b60448201526064016108ec565b6111886127b1565b611190612852565b60408051600080825260208201909252600f60f81b9c939b5091995046985030975095509350915050565b6000806111c661286f565b546001600160a01b031692915050565b604080516000815260208101909152606090826001600160401b038111156112005761120061552f565b60405190808252806020026020018201604052801561123357816020015b606081526020019060019003908161121e5790505b50915060005b838110156112b5576112903086868481811061125757611257615858565b9050602002810190611269919061586e565b8560405160200161127c939291906158b4565b604051602081830303815290604052612893565b8382815181106112a2576112a2615858565b6020908102919091010152600101611239565b50505b92915050565b6000846112c9611b69565b6001600160a01b0316637c145cc78230336040518463ffffffff1660e01b81526004016112f8939291906154d5565b602060405180830381865afa158015611315573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061133991906154f8565b8133909161135c5760405163cc5d3c8b60e01b81526004016108ec929190615515565b505085600061136a82611b8d565b905061137581611c90565b611380816000611cce565b6001600160a01b03881660009081526101066020526040902054889081906113bc5760405163ee27189960e01b81526004016108ec9190615048565b506113c5611db8565b6000808960028111156113da576113da6158db565b036113f1576113ea8a8989612909565b9050611430565b6002896002811115611405576114056158db565b03611415576113ea8a8989612e1d565b8860405163047031cf60e41b81526004016108ec9190615913565b886002811115611442576114426158db565b8a6001600160a01b03167f54fe682bfb66381a9382e13e4b95a3dd4f960eafbae063fdea3539d144ff3ff58360405161147d91815260200190565b60405180910390a39998505050505050505050565b60006112b882600260189054906101000a900463ffffffff16612ec1565b600061084b612ee0565b60006114c4612f04565b805490915060ff600160401b82041615906001600160401b03166000811580156114eb5750825b90506000826001600160401b031660011480156115075750303b155b905081158015611515575080155b156115335760405163f92ee8a960e01b815260040160405180910390fd5b84546001600160401b0319166001178555831561155c57845460ff60401b1916600160401b1785555b61156589612f2d565b61156d612f3e565b611575612f46565b61157d612f5e565b6115c96040518060400160405280600f81526020016e53756267726170685365727669636560881b815250604051806040016040528060038152602001620312e360ec1b815250612f6e565b6115d5886000196126d7565b6115de87611b15565b6115e786612f88565b831561162d57845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b505050505050505050565b337f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03811682146116855760405163cdc0567f60e01b81526004016108ec929190615515565b50600090508061169783850185615921565b915091506116a3611b69565b6001600160a01b031663e76fede68684846116bc612fdf565b60405160e086901b6001600160e01b03191681526001600160a01b039485166004820152602481019390935260448301919091529091166064820152608401600060405180830381600087803b15801561171557600080fd5b505af1158015611729573d6000803e3d6000fd5b50505050846001600160a01b03167f02f2e74a11116e05b39159372cceb6739257b08d72f7171d208ff27bb6466c588360405161176891815260200190565b60405180910390a25050505050565b82611780611b69565b6001600160a01b0316637c145cc78230336040518463ffffffff1660e01b81526004016117af939291906154d5565b602060405180830381865afa1580156117cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117f091906154f8565b813390916118135760405163cc5d3c8b60e01b81526004016108ec929190615515565b505061181d611db8565b61182684613003565b6040516001600160a01b038516907ff53cf6521a1b5fc0c04bffa70374a4dc2e3474f2b2ac1643c3bcc54e2db4a93990600090a250505050565b600061186c8383613076565b9392505050565b600061084b612fdf565b82611886611b69565b6001600160a01b0316637c145cc78230336040518463ffffffff1660e01b81526004016118b5939291906154d5565b602060405180830381865afa1580156118d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118f691906154f8565b813390916119195760405163cc5d3c8b60e01b81526004016108ec929190615515565b505083600061192782611b8d565b905061193281611c90565b61193d816000611cce565b6001600160a01b03861660009081526101066020526040902054869081906119795760405163ee27189960e01b81526004016108ec9190615048565b50611982611db8565b6000808080611993898b018b615943565b93509350935093506119bb8b83868685600260189054906101000a900463ffffffff166130e5565b8a6001600160a01b03167fd3803eb82ef5b4cdff8646734ebbaf5b37441e96314b27ffd3d0940f12a038e78b8b6040516119f6929190615800565b60405180910390a25050505050505050505050565b611a13611ae3565b61084881612f88565b600061084b6132dc565b611a2e611db8565b6000611a3b60cf836121f2565b9050611a5260d2548261330090919063ffffffff16565b8290611a7157604051623477b560e51b81526004016108ec9190615048565b50611a7b8161333d565b158290611a9c576040516317c7b35d60e31b81526004016108ec9190615048565b50610a8f826001612277565b611ab0611ae3565b6001600160a01b038116611ada576000604051631e4fbdf760e01b81526004016108ec9190615048565b61084881612097565b33611aec6111bb565b6001600160a01b031614610acd573360405163118cdaa760e01b81526004016108ec9190615048565b6002805463ffffffff60c01b1916600160c01b63ffffffff8416908102919091179091556040519081527f472aba493f9fd1d136ec54986f619f3aa5caff964f0e731a9909fb9a1270211f90602001610dab565b7f000000000000000000000000000000000000000000000000000000000000000090565b6040805161014081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101829052610120810182905290611be6611b69565b6001600160a01b03166325d9897e84306040518363ffffffff1660e01b8152600401611c13929190615515565b61014060405180830381865afa158015611c31573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c5591906159d0565b90508060a001516001600160401b0316600014158390611c8957604051637b3c09bf60e01b81526004016108ec9190615048565b5092915050565b6020810151815161084891611ca491615845565b60005460015460405180604001604052806006815260200165746f6b656e7360d01b81525061335c565b600080611cd96120f3565b91509150600083611cee578460800151611cf4565b8460e001515b9050611d42816001600160401b0316846001600160401b0316846001600160401b03166040518060400160405280600d81526020016c1d1a185dda5b99d4195c9a5bd9609a1b81525061335c565b600080611d4d611fdd565b91509150600086611d62578760600151611d68565b8760c001515b9050611dae8163ffffffff168463ffffffff168463ffffffff166040518060400160405280600e81526020016d1b585e15995c9a599a595c90dd5d60921b81525061335c565b5050505050505050565b611dc0610cdc565b15610acd5760405163d93c066560e01b815260040160405180910390fd5b6001600160a01b038281166000818152610109602052604080822080546001600160a01b0319169486169485179055517e3215dc05a2fc4e6a1e2c2776311d207c730ee51085aae221acc5cbe6fb55c19190a35050565b6001600160a01b0382166000908152606760205260409020548290829060ff161515811514611e8a57604051635e67e54b60e01b81526001600160a01b039092166004830152151560248201526044016108ec565b50506001600160a01b038216600081815260676020908152604091829020805460ff191685151590811790915591519182527fa95bac2f3df0d40e8278281c1d39d53c60e4f2bf3550ca5665738d0916e89789910160405180910390a25050565b611ef3613390565b6000611efd612073565b805460ff1916815590507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b604051610dab9190615048565b6001600160a01b0382166000818152609c60209081526040808320815192830184905282820194909452805180830382018152606090920190528190611f8b9084906133b5906133ca906134c590896134ea565b91509150846001600160a01b03167f13f3fa9f0e54af1af76d8b5d11c3973d7c2aed6312b61efff2f7b49d73ad67eb8383806020019051810190611fcf9190615a7d565b604051611768929190615277565b600080611fe8612fdf565b6001600160a01b031663bb2a2b476040518163ffffffff1660e01b8152600401602060405180830381865afa158015612025573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120499190615a96565b92620f424092509050565b60006120638260600151151590565b80156112b8575050608001511590565b7fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f0330090565b60006120a161286f565b80546001600160a01b038481166001600160a01b031983168117845560405193945091169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b6000806000612100612fdf565b6001600160a01b0316635aea0ec46040518163ffffffff1660e01b8152600401602060405180830381865afa15801561213d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121619190615ab3565b93849350915050565b60d28190556040518181527f21774046e2611ddb52c8c46e1ad97524eeb2e3fda7dcd9428867868b4c4d06ba90602001610dab565b6121ac60d08484846135a4565b80826001600160a01b0316846001600160a01b03167fd54c7abc930f6d506da2d08aa7aead4f2443e1db6d5f560384a2f652ff893e1960405160405180910390a4505050565b6121fa614fae565b6122048383613653565b604080516101208101825282546001600160a01b03168152600183015460208201526002830154918101919091526003820154606082015260048201546080820152600582015460a0820152600682015460c0820152600782015460e08201526008909101546101008201529392505050565b600061228460cf846121f2565b905061230f83612292613706565b6001600160a01b031663eeac3e0e84602001516040518263ffffffff1660e01b81526004016122c391815260200190565b6020604051808303816000875af11580156122e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123069190615a7d565b60cf919061372a565b61231a60cf846137dd565b8051604082015161232d9160d191613893565b806040015160d3600083602001518152602001908152602001600020546123549190615845565b60d3600083602001518152602001908152602001600020819055508060200151836001600160a01b031682600001516001600160a01b03167f08f2f865e0fb62d722a51e4d9873199bf6bf52e7d8ee5a2ee2896c9ef719f5458460400151866040516123cc9291909182521515602082015260400190565b60405180910390a4505050565b60006123e660cf856121f2565b90506123f181612054565b849061241157604051631eb5ff9560e01b81526004016108ec9190615048565b5080604001518314158484909161243d5760405163f32518cd60e01b81526004016108ec929190615ad0565b50506040810151808411156124735761246e612457611b69565b83516124638488615845565b60d192919087613911565b61248c565b815161248c906124838684615845565b60d19190613893565b6000612496613706565b6001600160a01b031663eeac3e0e84602001516040518263ffffffff1660e01b81526004016124c791815260200190565b6020604051808303816000875af11580156124e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061250a9190615a7d565b905060006125178461333d565b15612523576000612532565b60c08401516125329083615845565b6001600160a01b038816600090815260cf60205260409020600281018890556006018390559050612561613706565b6001600160a01b031663c8a5f81e84836040518363ffffffff1660e01b815260040161258e929190615277565b602060405180830381865afa1580156125ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125cf9190615a7d565b6001600160a01b038816600090815260cf6020526040812060070180549091906125fa908490615ae9565b909155505082861115612642576126118387615845565b60d360008660200151815260200190815260200160002060008282546126379190615ae9565b909155506126789050565b61264c8684615845565b60d360008660200151815260200190815260200160002060008282546126729190615845565b90915550505b8360200151876001600160a01b031685600001516001600160a01b03167f6db4a6f9be2d5e72eb2a2af2374ac487971bf342a261ba0bc1cf471bf2a2c31f89876040516126c6929190615277565b60405180910390a450505050505050565b8181808211156126fc5760405163ccccdafb60e01b81526004016108ec929190615277565b5050600082905560018190556040517f90699b8b4bf48918fea1129c85f9bc7b51285df7ecc982910813c7805f5688499061273a9084908490615277565b60405180910390a15050565b61274e611db8565b6000612758612073565b805460ff1916600117815590507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611f2a3390565b7fa16a46d94261c7517cc8ff89f61c0ce93598e3c849801011dee649a6a557d10090565b606060006127bd61278d565b90508060020180546127ce906156c1565b80601f01602080910402602001604051908101604052809291908181526020018280546127fa906156c1565b80156128475780601f1061281c57610100808354040283529160200191612847565b820191906000526020600020905b81548152906001019060200180831161282a57829003601f168201915b505050505091505090565b6060600061285e61278d565b90508060030180546127ce906156c1565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930090565b6060600080846001600160a01b0316846040516128b09190615afc565b600060405180830381855af49150503d80600081146128eb576040519150601f19603f3d011682016040523d82523d6000602084013e6128f0565b606091505b5091509150612900858383613a0f565b95945050505050565b6000808061291984860186615b3a565b8151604001519193509150866001600160a01b038281169082161461295357604051631a071d0760e01b81526004016108ec929190615515565b50508151516001600160a01b038111156129835760405163fa4ac7a760e01b81526004016108ec91815260200190565b50815151600061299460cf836121f2565b805190915088906001600160a01b03818116908316146129c957604051634508fbf760e11b81526004016108ec929190615515565b505060208101516129db896000611f37565b60008060006129e8613a62565b6001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401612a139190615048565b602060405180830381865afa158015612a30573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a549190615a7d565b9050612a5e6132dc565b6001600160a01b031663692209ce6000612afc8b612a7a612ee0565b6001600160a01b0316634c4ea0ed8a6040518263ffffffff1660e01b8152600401612aa791815260200190565b602060405180830381865afa158015612ac4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ae891906154f8565b612af3576000613a86565b61010854613a86565b8a6040518463ffffffff1660e01b8152600401612b1b93929190615c71565b6020604051808303816000875af1158015612b3a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b5e9190615a7d565b92506000612b6a613a62565b6001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401612b959190615048565b602060405180830381865afa158015612bb2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bd69190615a7d565b9050818181811015612bfd57604051639db8bc9560e01b81526004016108ec929190615277565b50612c0a90508282615845565b92505082159050612db457612ca98b6101075484612c289190615ca1565b612c30612fdf565b6001600160a01b0316635aea0ec46040518163ffffffff1660e01b8152600401602060405180830381865afa158015612c6d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c919190615ab3565b612ca4906001600160401b031642615ae9565b613ada565b8015612db457612cb7613706565b6001600160a01b0316631d1c2fec846040518263ffffffff1660e01b8152600401612ce491815260200190565b6020604051808303816000875af1158015612d03573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d279190615a7d565b50612d4c612d33612ee0565b82612d3c613a62565b6001600160a01b03169190613c4a565b612d54612ee0565b6001600160a01b0316638157328884836040518363ffffffff1660e01b8152600401612d81929190615277565b600060405180830381600087803b158015612d9b57600080fd5b505af1158015612daf573d6000803e3d6000fd5b505050505b86516020908101516040805186815292830185905282018390526001600160a01b038088169291811691908e16907f184c452047299395d4f7f147eb8e823458a450798539be54aeed978f13d87ba29060600160405180910390a4509998505050505050505050565b6000808080612e2e85870187615cb8565b919450925090506001600160a01b038716612e4a60cf856121f2565b51889185916001600160a01b031614612e785760405163c0bbff1360e01b81526004016108ec929190615515565b50506002546001600160a01b0388811660009081526101096020526040902054612eb692869286928692600160c01b900463ffffffff169116613cf9565b979650505050505050565b6000612ed8612ece611b69565b60d19085856142d6565b159392505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b6000807ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a006112b8565b612f35614370565b61084881614395565b610acd614370565b612f4e614370565b612f5661439d565b610acd612f3e565b612f66614370565b612f56612f3e565b612f76614370565b612f8082826143df565b610a8f612f3e565b80600003612fa95760405163bc71a04360e01b815260040160405180910390fd5b6101078190556040518181527f2aaaf20b08565eebc0c962cd7c568e54c3c0c2b85a1f942b82cd1bd730fdcd2390602001610dab565b7f000000000000000000000000000000000000000000000000000000000000000090565b61300e8160016143f1565b613016611b69565b6001600160a01b0316633a78b732826040518263ffffffff1660e01b81526004016130419190615048565b600060405180830381600087803b15801561305b57600080fd5b505af115801561306f573d6000803e3d6000fd5b5050505050565b600061186c7f4bdee85c4b4a268f4895d1096d553c3e57bb2433c380e7b7ec8cb56cc4f7467384846040516020016130ca939291909283526001600160a01b03918216602084015216604082015260600190565b60405160208183030381529060405280519060200120614408565b6001600160a01b03851661310c57604051634ffdf5ef60e11b815260040160405180910390fd5b613117868684614435565b61312b613122611b69565b60d09087614484565b600061313561457a565b6001600160a01b031663766718086040518163ffffffff1660e01b8152600401602060405180830381865afa158015613172573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131969190615a7d565b90506000613226888888886131a9613706565b6001600160a01b031663eeac3e0e8c6040518263ffffffff1660e01b81526004016131d691815260200190565b6020604051808303816000875af11580156131f5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132199190615a7d565b60cf94939291908861459e565b905061323e613233611b69565b60d1908a8887613911565b806040015160d3600083602001518152602001908152602001600020546132659190615ae9565b60d36000836020015181526020019081526020016000208190555085876001600160a01b0316896001600160a01b03167fe5e185fab2b992c4727ff702a867d78b15fb176dbaa20c9c312a1c351d3f7f838460400151866040516132ca929190615277565b60405180910390a45050505050505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b60008061331584606001518560a00151614706565b61331f9042615845565b905061332a84612054565b801561333557508281115b949350505050565b600061334c8260600151151590565b80156112b8575050604001511590565b613367848484614716565b8185858590919293611dae57604051630871e13d60e01b81526004016108ec9493929190615d10565b613398610cdc565b610acd57604051638dfc202b60e01b815260040160405180910390fd5b6000908152609b602052604090206003015490565b6000606060006133d98561472d565b90504281604001511115613401575050604080516020810190915260008152600191506134be565b600080858060200190518101906134189190615d3f565b8451919350915061342d90609a908390613893565b86816001600160a01b03167f4c06b68820628a39c787d2db1faa0eeacd7b9474847b198b1e871fe6e5b93f4485600001518660400151604051613471929190615277565b60405180910390a382516134859083615ae9565b6040805160208101929092526001600160a01b038316908201526060016040516020818303038152906040529550600086945094505050505b9250929050565b6000908152609b60205260408120818155600181018290556002810182905560030155565b60006060876003015483111561351357604051634a411b9d60e11b815260040160405180910390fd5b600083156135215783613527565b88600301545b89549094505b801580159061353c5750600085115b156135955760008061355283898c63ffffffff16565b915091508115613563575050613595565b9650866135718c8c8b6147bb565b92508661357d81615d65565b975050838061358b90615d7c565b945050505061352d565b50989397509295505050505050565b6001600160a01b0380831660009081526020868152604091829020825180840190935280549093168252600190920154918101919091526135e490614842565b15829061360557604051632d7d25f160e21b81526004016108ec9190615048565b506040805180820182526001600160a01b0394851681526020808201938452938516600090815295909352909320905181546001600160a01b03191692169190911781559051600190910155565b6001600160a01b03808216600090815260208481526040808320815161012081018352815490951685526001810154928501929092526002820154908401526003810154606084015260048101546080840152600581015460a0840152600681015460c0840152600781015460e0840152600881015461010084015290916136de9060600151151590565b83906136fe576040516342daadaf60e01b81526004016108ec9190615048565b509392505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b60006137368484613653565b604080516101208101825282546001600160a01b03168152600183015460208201526002830154918101919091526003820154606082015260048201546080820152600582015460a0820152600682015460c0820152600782015460e082015260088201546101008201529091506137ad90612054565b600482015484916137d3576040516361b66e0d60e01b81526004016108ec929190615ad0565b5050600601555050565b60006137e98383613653565b604080516101208101825282546001600160a01b03168152600183015460208201526002830154918101919091526003820154606082015260048201546080820152600582015460a0820152600682015460c0820152600782015460e0820152600882015461010082015290915061386090612054565b60048201548391613886576040516361b66e0d60e01b81526004016108ec929190615ad0565b5050426004909101555050565b806000036138a057505050565b6001600160a01b03821660009081526020849052604090205481808210156138dd57604051635f8ec70960e01b81526004016108ec929190615277565b50506001600160a01b03821660009081526020849052604081208054839290613907908490615845565b9091555050505050565b811561306f576001600160a01b03831660009081526020869052604081205461393b908490615ae9565b90506000856001600160a01b031663872d04898630866040518463ffffffff1660e01b815260040161396f93929190615d95565b602060405180830381865afa15801561398c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906139b09190615a7d565b90508082818111156139d757604051635f8ec70960e01b81526004016108ec929190615277565b50506001600160a01b03851660009081526020889052604081208054869290613a01908490615ae9565b909155505050505050505050565b606082613a2457613a1f82614851565b61186c565b8151158015613a3b57506001600160a01b0384163b155b15613a5b5783604051639996b31560e01b81526004016108ec9190615048565b508061186c565b7f000000000000000000000000000000000000000000000000000000000000000090565b81516040908101516001600160a01b039081166000908152610109602090815290839020549251606093613ac39387938793929091169101615dbe565b604051602081830303815290604052905092915050565b81600003613afb57604051638f4c63d960e01b815260040160405180910390fd5b613b27613b06611b69565b600254609a91908690869063ffffffff600160c01b90910481169061391116565b6001600160a01b0383166000908152609c6020908152604080832060028082015483516001600160601b031930606090811b8216838901528b901b166034820152604880820192909252845180820390920182526068810180865282519287019290922060e882018652898352426088830190815260a883018a815260c8909301898152828a52609b909852959097209151825593516001820155925190830155915160039182015581015490919015613bf55760018201546000908152609b602052604090206003018190555b613bff828261487a565b80856001600160a01b03167f5d9e2c5278e41138269f5f980cfbea016d8c59816754502abc4d2f87aaea987f8686604051613c3b929190615277565b60405180910390a35050505050565b8015610d3c5760405163a9059cbb60e01b81526001600160a01b0384169063a9059cbb90613c7e9085908590600401615ad0565b6020604051808303816000875af1158015613c9d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613cc191906154f8565b610d3c5760405162461bcd60e51b815260206004820152600960248201526810ba3930b739b332b960b91b60448201526064016108ec565b600080613d0760cf886121f2565b9050613d1281612054565b8790613d3257604051631eb5ff9560e01b81526004016108ec9190615048565b506000613d4a60d2548361330090919063ffffffff16565b158015613d5d5750613d5b8261333d565b155b8015613d6857508615155b8015613de05750816101000151613d7d61457a565b6001600160a01b031663766718086040518163ffffffff1660e01b8152600401602060405180830381865afa158015613dba573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613dde9190615a7d565b115b613deb576000613e61565b613df3613706565b6001600160a01b031663db750926896040518263ffffffff1660e01b8152600401613e1e9190615048565b6020604051808303816000875af1158015613e3d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613e619190615a7d565b9050613ea088613e6f613706565b6001600160a01b031663eeac3e0e85602001516040518263ffffffff1660e01b81526004016122c391815260200190565b613eab60cf8961490d565b613eb660cf896149c3565b60008082156141ef576000613ec9611b69565b8551604051637573ef4f60e01b81526001600160a01b039290921691637573ef4f91613efc913090600290600401615e87565b602060405180830381865afa158015613f19573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613f3d9190615a7d565b90506000613f49611b69565b8651604051631584a17960e21b81526001600160a01b03929092169163561285e491613f79913090600401615515565b60a060405180830381865afa158015613f96573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613fba9190615eac565b90506000816020015111613fcf576000613fd9565b613fd98583614a7a565b925082156140ce57613fe9613a62565b6001600160a01b031663095ea7b3613fff611b69565b856040518363ffffffff1660e01b815260040161401d929190615ad0565b6020604051808303816000875af115801561403c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061406091906154f8565b50614069611b69565b865160405163ca94b0e960e01b81526001600160a01b03929092169163ca94b0e99161409b9130908890600401615f1f565b600060405180830381600087803b1580156140b557600080fd5b505af11580156140c9573d6000803e3d6000fd5b505050505b6140d88386615845565b935083156141ec576001600160a01b0388166141df576140f6613a62565b6001600160a01b031663095ea7b361410c611b69565b866040518363ffffffff1660e01b815260040161412a929190615ad0565b6020604051808303816000875af1158015614149573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061416d91906154f8565b50614176611b69565b8651604051633a30904960e11b81526001600160a01b0392909216916374612092916141a89130908990600401615f1f565b600060405180830381600087803b1580156141c257600080fd5b505af11580156141d6573d6000803e3d6000fd5b505050506141ec565b6141ec8885612d3c613a62565b50505b602084015184516001600160a01b03808d1691167f443f56bd2098d273b8c8120398789a41da5925db4ba2f656813fc5299ac57b1f8686868f8f61423161457a565b6001600160a01b031663766718086040518163ffffffff1660e01b8152600401602060405180830381865afa15801561426e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906142929190615a7d565b6040516142a496959493929190615f43565b60405180910390a483516142b89088612ec1565b156142c8576142c88a6001612277565b509098975050505050505050565b600080846001600160a01b031663872d04898530866040518463ffffffff1660e01b815260040161430993929190615d95565b602060405180830381865afa158015614326573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061434a9190615a7d565b6001600160a01b0385166000908152602088905260409020541115915050949350505050565b614378614ada565b610acd57604051631afcd79f60e31b815260040160405180910390fd5b611ab0614370565b6143a5614370565b6143b260006000196126d7565b6143c06000620f4240614af4565b6143d260006001600160401b03614bc5565b610acd63ffffffff611b15565b6143e7614370565b610a8f8282614c52565b60006143fc83611b8d565b9050610d3c8183611cce565b60006112b8614415614c93565b8360405161190160f01b8152600281019290925260228201526042902090565b600061444a6144448585613076565b83614c9d565b905080836001600160a01b038083169082161461447c57604051638c5b935d60e01b81526004016108ec929190615515565b505050505050565b6001600160a01b0380821660009081526020858152604091829020825180840190935280549093168252600190920154918101919091526144c490614842565b1581906144e557604051632d7d25f160e21b81526004016108ec9190615048565b506040516378eb06b360e11b81526001600160a01b0383169063f1d60d6690614512908490600401615048565b602060405180830381865afa15801561452f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061455391906154f8565b15819061457457604051632d7d25f160e21b81526004016108ec9190615048565b50505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b6145a6614fae565b6001600160a01b03808716600090815260208a8152604091829020825161012081018452815490941684526001810154918401919091526002810154918301919091526003810154606083015260048101546080830152600581015460a0830152600681015460c0830152600781015460e0830152600801546101008201526146329060600151151590565b15869061465357604051630bc4def560e01b81526004016108ec9190615048565b505060408051610120810182526001600160a01b0397881681526020808201968752818301958652426060830190815260006080840181815260a0850182815260c0860198895260e0860183815261010087019889529b8d1683529c90935293909320825181546001600160a01b0319169a169990991789559551600189015593516002880155516003870155925160048601559451600585015593516006840155905160078301555160089091015590565b600082821882841102821861186c565b600082841015801561333557505090911115919050565b61475b6040518060800160405280600081526020016000815260200160008152602001600080191681525090565b6000828152609b602090815260409182902082516080810184528154815260018201549281018390526002820154938101939093526003015460608301528390611c895760405163107349a960e21b81526004016108ec91815260200190565b6000808460030154116147e15760405163ddaf8f2160e01b815260040160405180910390fd5b60006147f485600001548563ffffffff16565b905061480785600001548463ffffffff16565b600185600301600082825461481c9190615845565b9091555050808555600385015460000361483857600060018601555b5050915492915050565b516001600160a01b0316151590565b8051156148615780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b6127108260030154106148a0576040516303a8c56b60e61b815260040160405180910390fd5b806148be57604051638f4a893d60e01b815260040160405180910390fd5b60018083018290556002830180546000906148da908490615ae9565b909155505060038201546000036148ef578082555b60018260030160008282546149049190615ae9565b90915550505050565b60006149198383613653565b604080516101208101825282546001600160a01b03168152600183015460208201526002830154918101919091526003820154606082015260048201546080820152600582015460a0820152600682015460c0820152600782015460e0820152600882015461010082015290915061499090612054565b600482015483916149b6576040516361b66e0d60e01b81526004016108ec929190615ad0565b5050426005909101555050565b60006149cf8383613653565b604080516101208101825282546001600160a01b03168152600183015460208201526002830154918101919091526003820154606082015260048201546080820152600582015460a0820152600682015460c0820152600782015460e08201526008820154610100820152909150614a4690612054565b60048201548391614a6c576040516361b66e0d60e01b81526004016108ec929190615ad0565b505060006007909101555050565b6000614a8983620f4240101590565b80614a9c5750614a9c82620f4240101590565b83839091614abf5760405163768bf0eb60e11b81526004016108ec929190615277565b50620f42409050614ad08385615ca1565b61186c9190615f81565b6000614ae4612f04565b54600160401b900460ff16919050565b818163ffffffff8082169083161115614b225760405163ccccdafb60e01b81526004016108ec929190615180565b508290508163ffffffff8116620f42401015614b535760405163ccccdafb60e01b81526004016108ec929190615180565b50506002805463ffffffff838116600160a01b0263ffffffff60a01b19918616600160801b0291909116600160801b600160c01b0319909216919091171790556040517f2fe5a7039987697813605cc0b9d6db7aab575408e3fc59e8a457bef8d7bc0a369061273a9084908490615180565b81816001600160401b038082169083161115614bf65760405163ccccdafb60e01b81526004016108ec92919061521c565b5050600280546001600160401b03838116600160401b026001600160801b0319909216908516171790556040517f2867e04c500e438761486b78021d4f9eb97c77ff45d10c1183f5583ba4cbf7d19061273a908490849061521c565b614c5a614370565b6000614c6461278d565b905060028101614c748482615742565b5060038101614c838382615742565b5060008082556001909101555050565b600061084b614cc7565b600080600080614cad8686614d3b565b925092509250614cbd8282614d88565b5090949350505050565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f614cf2614e41565b614cfa614ea8565b60408051602081019490945283019190915260608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b60008060008351604103614d755760208401516040850151606086015160001a614d6788828585614ee9565b955095509550505050614d81565b50508151600091506002905b9250925092565b6000826003811115614d9c57614d9c6158db565b03614da5575050565b6001826003811115614db957614db96158db565b03614dd75760405163f645eedf60e01b815260040160405180910390fd5b6002826003811115614deb57614deb6158db565b03614e0c5760405163fce698f760e01b8152600481018290526024016108ec565b6003826003811115614e2057614e206158db565b03610a8f576040516335e2f38360e21b8152600481018290526024016108ec565b600080614e4c61278d565b90506000614e586127b1565b805190915015614e7057805160209091012092915050565b81548015614e7f579392505050565b7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470935050505090565b600080614eb361278d565b90506000614ebf612852565b805190915015614ed757805160209091012092915050565b60018201548015614e7f579392505050565b600080806fa2a8918ca85bafe22016d0b997e4df60600160ff1b03841115614f1a5750600091506003905082614fa4565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa158015614f6e573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116614f9a57506000925060019150829050614fa4565b9250600091508190505b9450945094915050565b60405180610120016040528060006001600160a01b0316815260200160008019168152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b6001600160a01b038116811461084857600080fd5b803561502681615006565b919050565b60006020828403121561503d57600080fd5b813561186c81615006565b6001600160a01b0391909116815260200190565b63ffffffff8116811461084857600080fd5b60006020828403121561508057600080fd5b813561186c8161505c565b60008083601f84011261509d57600080fd5b5081356001600160401b038111156150b457600080fd5b6020830191508360208285010111156134be57600080fd5b6000806000604084860312156150e157600080fd5b83356150ec81615006565b925060208401356001600160401b0381111561510757600080fd5b6151138682870161508b565b9497909650939450505050565b801515811461084857600080fd5b6000806040838503121561514157600080fd5b823561514c81615006565b9150602083013561515c81615120565b809150509250929050565b60006020828403121561517957600080fd5b5035919050565b63ffffffff92831681529116602082015260400190565b60005b838110156151b257818101518382015260200161519a565b50506000910152565b600081518084526151d3816020860160208601615197565b601f01601f19169290920160200192915050565b83815260606020820152600061520060608301856151bb565b828103604084015261521281856151bb565b9695505050505050565b6001600160401b0392831681529116602082015260400190565b60008060006060848603121561524b57600080fd5b833561525681615006565b9250602084013561526681615006565b929592945050506040919091013590565b918252602082015260400190565b60ff60f81b8816815260e0602082015260006152a460e08301896151bb565b82810360408401526152b681896151bb565b606084018890526001600160a01b038716608085015260a0840186905283810360c08501528451808252602080870193509091019060005b8181101561530c5783518352602093840193909201916001016152ee565b50909b9a5050505050505050505050565b6000806020838503121561533057600080fd5b82356001600160401b0381111561534657600080fd5b8301601f8101851361535757600080fd5b80356001600160401b0381111561536d57600080fd5b8560208260051b840101111561538257600080fd5b6020919091019590945092505050565b6000602082016020835280845180835260408501915060408160051b86010192506020860160005b828110156153eb57603f198786030184526153d68583516151bb565b945060209384019391909101906001016153ba565b50929695505050505050565b6000806000806060858703121561540d57600080fd5b843561541881615006565b935060208501356003811061542c57600080fd5b925060408501356001600160401b0381111561544757600080fd5b6154538782880161508b565b95989497509550505050565b6000806000806080858703121561547557600080fd5b843561548081615006565b93506020850135925060408501356154978161505c565b9396929550929360600135925050565b600080604083850312156154ba57600080fd5b82356154c581615006565b9150602083013561515c81615006565b6001600160a01b0393841681529183166020830152909116604082015260600190565b60006020828403121561550a57600080fd5b815161186c81615120565b6001600160a01b0392831681529116602082015260400190565b634e487b7160e01b600052604160045260246000fd5b60405161014081016001600160401b03811182821017156155685761556861552f565b60405290565b604080519081016001600160401b03811182821017156155685761556861552f565b60405160e081016001600160401b03811182821017156155685761556861552f565b600082601f8301126155c357600080fd5b8135602083016000806001600160401b038411156155e3576155e361552f565b50604051601f19601f85018116603f011681018181106001600160401b03821117156156115761561161552f565b60405283815290508082840187101561562957600080fd5b838360208301376000602085830101528094505050505092915050565b60008060006060848603121561565b57600080fd5b83356001600160401b0381111561567157600080fd5b61567d868287016155b2565b93505060208401356001600160401b0381111561569957600080fd5b6156a5868287016155b2565b92505060408401356156b681615006565b809150509250925092565b600181811c908216806156d557607f821691505b6020821081036156f557634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115610d3c57806000526020600020601f840160051c810160208510156157225750805b601f840160051c820191505b8181101561306f576000815560010161572e565b81516001600160401b0381111561575b5761575b61552f565b61576f8161576984546156c1565b846156fb565b6020601f8211600181146157a3576000831561578b5750848201515b600019600385901b1c1916600184901b17845561306f565b600084815260208120601f198516915b828110156157d357878501518255602094850194600190920191016157b3565b50848210156157f15786840151600019600387901b60f8161c191681555b50505050600190811b01905550565b60208152816020820152818360408301376000818301604090810191909152601f909201601f19160101919050565b634e487b7160e01b600052601160045260246000fd5b818103818111156112b8576112b861582f565b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261588557600080fd5b8301803591506001600160401b0382111561589f57600080fd5b6020019150368190038213156134be57600080fd5b8284823760008382016000815283516158d1818360208801615197565b0195945050505050565b634e487b7160e01b600052602160045260246000fd5b6003811061590f57634e487b7160e01b600052602160045260246000fd5b9052565b602081016112b882846158f1565b6000806040838503121561593457600080fd5b50508035926020909101359150565b6000806000806080858703121561595957600080fd5b8435935060208501359250604085013561597281615006565b915060608501356001600160401b0381111561598d57600080fd5b615999878288016155b2565b91505092959194509250565b80516150268161505c565b6001600160401b038116811461084857600080fd5b8051615026816159b0565b60006101408284031280156159e457600080fd5b5060006159ef615545565b835181526020808501519082015260408085015190820152615a13606085016159a5565b6060820152615a24608085016159c5565b6080820152615a3560a085016159c5565b60a0820152615a4660c085016159a5565b60c0820152615a5760e085016159c5565b60e082015261010084810151908201526101209384015193810193909352509092915050565b600060208284031215615a8f57600080fd5b5051919050565b600060208284031215615aa857600080fd5b815161186c8161505c565b600060208284031215615ac557600080fd5b815161186c816159b0565b6001600160a01b03929092168252602082015260400190565b808201808211156112b8576112b861582f565b60008251615b0e818460208701615197565b9190910192915050565b8035615026816159b0565b80356001600160801b038116811461502657600080fd5b60008060408385031215615b4d57600080fd5b82356001600160401b03811115615b6357600080fd5b830160408186031215615b7557600080fd5b615b7d61556e565b81356001600160401b03811115615b9357600080fd5b820160e08188031215615ba557600080fd5b615bad615590565b81358152615bbd6020830161501b565b6020820152615bce6040830161501b565b6040820152615bdf6060830161501b565b6060820152615bf060808301615b18565b6080820152615c0160a08301615b23565b60a082015260c08201356001600160401b03811115615c1f57600080fd5b615c2b898285016155b2565b60c08301525082525060208201356001600160401b03811115615c4d57600080fd5b615c59878285016155b2565b60208381019190915291979590910135955050505050565b615c7b81856158f1565b606060208201526000615c9160608301856151bb565b9050826040830152949350505050565b80820281158282048414176112b8576112b861582f565b600080600060608486031215615ccd57600080fd5b8335615cd881615006565b92506020840135915060408401356001600160401b03811115615cfa57600080fd5b615d06868287016155b2565b9150509250925092565b608081526000615d2360808301876151bb565b6020830195909552506040810192909252606090910152919050565b60008060408385031215615d5257600080fd5b8251602084015190925061515c81615006565b600081615d7457615d7461582f565b506000190190565b600060018201615d8e57615d8e61582f565b5060010190565b6001600160a01b03938416815291909216602082015263ffffffff909116604082015260600190565b606080825284516040838301819052815160a085015260208201516001600160a01b0390811660c086015290820151811660e08501529181015190911661010083015260808101516001600160401b038116610120840152600091905060a08101516001600160801b0381166101408501525060c0015160e0610160840152615e4b6101808401826151bb565b90506020860151605f19848303016080850152615e6882826151bb565b9250505083602083015261333560408301846001600160a01b03169052565b6001600160a01b038481168252831660208201526060810161333560408301846158f1565b600060a0828403128015615ebf57600080fd5b5060405160009060a081016001600160401b0381118282101715615ee557615ee561552f565b6040908152845182526020808601519083015284810151908201526060808501519082015260809384015193810193909352509092915050565b6001600160a01b039384168152919092166020820152604081019190915260600190565b86815285602082015284604082015283606082015260c060808201526000615f6e60c08301856151bb565b90508260a0830152979650505050505050565b600082615f9e57634e487b7160e01b600052601260045260246000fd5b50049056fea2646970667358221220b85de947a2adf153b4d5d66360454c8d0624bca998d3fc8f12bd17e31d74127864736f6c634300081b0033", + "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061023b5760003560e01c806307e736d8146102405780630e02292314610280578063138dea081461030857806313c474c9146103205780631dd42f60146103755780631ebb7c301461038a57806324b8fbf6146103af57806335577962146103c25780633f4ba83a146103d557806345f54485146103dd578063482468b7146103f05780634f793cdc1461040657806355c85269146104285780635c975abb146104725780636234e2161461048a5780636ccec5b8146104aa5780636d9a3951146104bd578063715018a61461053857806371ce020a146105405780637aa31bce146105565780637dfe6d28146105695780637e89bac31461057c5780638180083b1461058f578063819ba366146105a257806381e777a7146105b8578063832bc923146105cb5780638456cb59146105de57806384b0196e146105e657806385e82baf146106015780638da5cb5b1461060a5780639384e07814610612578063ac9650d814610635578063b15d2a2c14610655578063ba38f67d14610668578063c0f474971461067b578063c84a5ef314610683578063cb8347fe14610696578063cbe5f3f2146106a9578063ce0fc0cc146106c9578063ce56c98b146106dc578063d07a7a84146106ef578063db9bee46146106f9578063dedf672614610701578063e2e1e8e914610714578063e6f5005414610734578063ebf6ddaf14610747578063ec9c218d1461074f578063eff0f59214610762578063f2fde38b14610797575b600080fd5b61026a61024e36600461502b565b610109602052600090815260409020546001600160a01b031681565b6040516102779190615048565b60405180910390f35b61029361028e36600461502b565b6107aa565b604051610277919060006101208201905060018060a01b0383511682526020830151602083015260408301516040830152606083015160608301526080830151608083015260a083015160a083015260c083015160c083015260e083015160e083015261010083015161010083015292915050565b6103126101085481565b604051908152602001610277565b61035561032e36600461502b565b609c6020526000908152604090208054600182015460028301546003909301549192909184565b604080519485526020850193909352918301526060820152608001610277565b61038861038336600461506e565b610837565b005b600254600160c01b900463ffffffff1660405163ffffffff9091168152602001610277565b6103886103bd3660046150cc565b610850565b6103886103d036600461512e565b610a7d565b610388610a93565b6103886103eb366004615167565b610acf565b6103f8610ad9565b604051610277929190615180565b61041961041436600461502b565b610aec565b604051610277939291906151e7565b61043b61043636600461502b565b610c20565b6040805196151587526001600160a01b039095166020870152938501929092526060840152608083015260a082015260c001610277565b61047a610cdc565b6040519015158152602001610277565b61031261049836600461502b565b60d16020526000908152604090205481565b6103886104b836600461502b565b610cf1565b6105146104cb36600461502b565b604080518082018252600080825260209182018190526001600160a01b03938416815260d082528290208251808401909352805490931682526001909201549181019190915290565b6040805182516001600160a01b031681526020928301519281019290925201610277565b610388610cfb565b610548610d0d565b60405161027792919061521c565b610388610564366004615167565b610d18565b610388610577366004615236565b610d29565b61038861058a366004615167565b610d41565b61038861059d3660046150cc565b610db6565b6105aa610f44565b604051610277929190615277565b6103886105c6366004615236565b610f54565b6103886105d9366004615167565b6110c4565b6103886110d8565b6105ee611112565b6040516102779796959493929190615285565b61031260d25481565b61026a6111bb565b61047a61062036600461502b565b60676020526000908152604090205460ff1681565b61064861064336600461531d565b6111d6565b6040516102779190615392565b6103126106633660046153f7565b6112be565b61047a61067636600461502b565b611492565b61026a6114b0565b61038861069136600461545f565b6114ba565b6103886106a43660046150cc565b611638565b6103126106b736600461502b565b609a6020526000908152604090205481565b6103886106d73660046150cc565b611777565b6103126106ea3660046154a7565b611860565b6103126101075481565b61026a611873565b61038861070f3660046150cc565b61187d565b610312610722366004615167565b600090815260d3602052604090205490565b610388610742366004615167565b611a0b565b61026a611a1c565b61038861075d36600461502b565b611a26565b610355610770366004615167565b609b6020526000908152604090208054600182015460028301546003909301549192909184565b6103886107a536600461502b565b611aa8565b6107b2614fae565b506001600160a01b03908116600090815260cf6020908152604091829020825161012081018452815490941684526001810154918401919091526002810154918301919091526003810154606083015260048101546080830152600581015460a0830152600681015460c0830152600781015460e08301526008015461010082015290565b61083f611ae3565b61084881611b15565b50565b905090565b82610859611b69565b6001600160a01b0316637c145cc78230336040518463ffffffff1660e01b8152600401610888939291906154d5565b602060405180830381865afa1580156108a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108c991906154f8565b813390916108f55760405163cc5d3c8b60e01b81526004016108ec929190615515565b60405180910390fd5b505083600061090382611b8d565b905061090e81611c90565b610919816000611cce565b610921611db8565b6000808061093187890189615646565b925092509250600083511161095957604051630783843960e51b815260040160405180910390fd5b600082511161097b57604051631e63bd9560e21b815260040160405180910390fd5b6001600160a01b03891660009081526101066020526040902054156109b357604051630d06866d60e21b815260040160405180910390fd5b6040805160608101825242815260208082018681528284018690526001600160a01b038d16600090815261010690925292902081518155915190919060018201906109fe9082615742565b5060408201516002820190610a139082615742565b5050506001600160a01b03811615610a2f57610a2f8982611dde565b886001600160a01b03167f159567bea25499a91f60e1fbb349ff2a1f8c1b2883198f25c1e12c99eddb44fa8989604051610a6a929190615800565b60405180910390a2505050505050505050565b610a85611ae3565b610a8f8282611e35565b5050565b3360008181526067602052604090205460ff16610ac4576040516372e3ef9760e01b81526004016108ec9190615048565b50610acd611eeb565b565b6108483382611f37565b600080610ae4611fdd565b915091509091565b6101066020526000908152604090208054600182018054919291610b0f906156c1565b80601f0160208091040260200160405190810160405280929190818152602001828054610b3b906156c1565b8015610b885780601f10610b5d57610100808354040283529160200191610b88565b820191906000526020600020905b815481529060010190602001808311610b6b57829003601f168201915b505050505090806002018054610b9d906156c1565b80601f0160208091040260200160405190810160405280929190818152602001828054610bc9906156c1565b8015610c165780601f10610beb57610100808354040283529160200191610c16565b820191906000526020600020905b815481529060010190602001808311610bf957829003601f168201915b5050505050905083565b6001600160a01b03808216600090815260cf60209081526040808320815161012081018352815490951685526001810154928501929092526002820154908401526003810154606084015260048101546080840152600581015460a0840152600681015460c0840152600781015460e0840152600801546101008301529081908190819081908190610cb181612054565b81516020830151604084015160c085015160e090950151939c929b5090995097509195509350915050565b600080610ce7612073565b5460ff1692915050565b6108483382611dde565b610d03611ae3565b610acd6000612097565b600080610ae46120f3565b610d20611ae3565b6108488161216a565b610d31611ae3565b610d3c83838361219f565b505050565b610d49611ae3565b610d5681620f4240101590565b8190610d7857604051631c9c717b60e01b81526004016108ec91815260200190565b506101088190556040518181527f6deef78ffe3df79ae5cd8e40b842c36ac6077e13746b9b68a9f327537b01e4e9906020015b60405180910390a150565b82610dbf611b69565b6001600160a01b0316637c145cc78230336040518463ffffffff1660e01b8152600401610dee939291906154d5565b602060405180830381865afa158015610e0b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e2f91906154f8565b81339091610e525760405163cc5d3c8b60e01b81526004016108ec929190615515565b50506001600160a01b0384166000908152610106602052604090205484908190610e905760405163ee27189960e01b81526004016108ec9190615048565b50610e99611db8565b6000610ea78486018661502b565b90506001600160a01b038616610ebe60cf836121f2565b51879183916001600160a01b031614610eec5760405163c0bbff1360e01b81526004016108ec929190615515565b5050610ef9816000612277565b856001600160a01b03167f73330c218a680717e9eee625c262df66eddfdf99ecb388d25f6b32d66b9a318a8686604051610f34929190615800565b60405180910390a2505050505050565b600080610ae46000546001549091565b82610f5d611b69565b6001600160a01b0316637c145cc78230336040518463ffffffff1660e01b8152600401610f8c939291906154d5565b602060405180830381865afa158015610fa9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fcd91906154f8565b81339091610ff05760405163cc5d3c8b60e01b81526004016108ec929190615515565b5050836000610ffe82611b8d565b905061100981611c90565b611014816000611cce565b6001600160a01b03861660009081526101066020526040902054869081906110505760405163ee27189960e01b81526004016108ec9190615048565b50611059611db8565b6001600160a01b03871661106e60cf886121f2565b51889188916001600160a01b03161461109c5760405163c0bbff1360e01b81526004016108ec929190615515565b50506110bb8686600260189054906101000a900463ffffffff166123d9565b50505050505050565b6110cc611ae3565b610848816000196126d7565b3360008181526067602052604090205460ff16611109576040516372e3ef9760e01b81526004016108ec9190615048565b50610acd612746565b600060608060008060006060600061112861278d565b805490915015801561113c57506001810154155b6111805760405162461bcd60e51b81526020600482015260156024820152741152540dcc4c8e88155b9a5b9a5d1a585b1a5e9959605a1b60448201526064016108ec565b6111886127b1565b611190612852565b60408051600080825260208201909252600f60f81b9c939b5091995046985030975095509350915050565b6000806111c661286f565b546001600160a01b031692915050565b604080516000815260208101909152606090826001600160401b038111156112005761120061552f565b60405190808252806020026020018201604052801561123357816020015b606081526020019060019003908161121e5790505b50915060005b838110156112b5576112903086868481811061125757611257615858565b9050602002810190611269919061586e565b8560405160200161127c939291906158b4565b604051602081830303815290604052612893565b8382815181106112a2576112a2615858565b6020908102919091010152600101611239565b50505b92915050565b6000846112c9611b69565b6001600160a01b0316637c145cc78230336040518463ffffffff1660e01b81526004016112f8939291906154d5565b602060405180830381865afa158015611315573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061133991906154f8565b8133909161135c5760405163cc5d3c8b60e01b81526004016108ec929190615515565b505085600061136a82611b8d565b905061137581611c90565b611380816000611cce565b6001600160a01b03881660009081526101066020526040902054889081906113bc5760405163ee27189960e01b81526004016108ec9190615048565b506113c5611db8565b6000808960028111156113da576113da6158db565b036113f1576113ea8a8989612909565b9050611430565b6002896002811115611405576114056158db565b03611415576113ea8a8989612e1d565b8860405163047031cf60e41b81526004016108ec9190615913565b886002811115611442576114426158db565b8a6001600160a01b03167f54fe682bfb66381a9382e13e4b95a3dd4f960eafbae063fdea3539d144ff3ff58360405161147d91815260200190565b60405180910390a39998505050505050505050565b60006112b882600260189054906101000a900463ffffffff16612ec1565b600061084b612ee0565b60006114c4612f04565b805490915060ff600160401b82041615906001600160401b03166000811580156114eb5750825b90506000826001600160401b031660011480156115075750303b155b905081158015611515575080155b156115335760405163f92ee8a960e01b815260040160405180910390fd5b84546001600160401b0319166001178555831561155c57845460ff60401b1916600160401b1785555b61156589612f2d565b61156d612f3e565b611575612f46565b61157d612f5e565b6115c96040518060400160405280600f81526020016e53756267726170685365727669636560881b815250604051806040016040528060038152602001620312e360ec1b815250612f6e565b6115d5886000196126d7565b6115de87611b15565b6115e786612f88565b831561162d57845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b505050505050505050565b337f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03811682146116855760405163cdc0567f60e01b81526004016108ec929190615515565b50600090508061169783850185615921565b915091506116a3611b69565b6001600160a01b031663e76fede68684846116bc612fdf565b60405160e086901b6001600160e01b03191681526001600160a01b039485166004820152602481019390935260448301919091529091166064820152608401600060405180830381600087803b15801561171557600080fd5b505af1158015611729573d6000803e3d6000fd5b50505050846001600160a01b03167f02f2e74a11116e05b39159372cceb6739257b08d72f7171d208ff27bb6466c588360405161176891815260200190565b60405180910390a25050505050565b82611780611b69565b6001600160a01b0316637c145cc78230336040518463ffffffff1660e01b81526004016117af939291906154d5565b602060405180830381865afa1580156117cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117f091906154f8565b813390916118135760405163cc5d3c8b60e01b81526004016108ec929190615515565b505061181d611db8565b61182684613003565b6040516001600160a01b038516907ff53cf6521a1b5fc0c04bffa70374a4dc2e3474f2b2ac1643c3bcc54e2db4a93990600090a250505050565b600061186c8383613076565b9392505050565b600061084b612fdf565b82611886611b69565b6001600160a01b0316637c145cc78230336040518463ffffffff1660e01b81526004016118b5939291906154d5565b602060405180830381865afa1580156118d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118f691906154f8565b813390916119195760405163cc5d3c8b60e01b81526004016108ec929190615515565b505083600061192782611b8d565b905061193281611c90565b61193d816000611cce565b6001600160a01b03861660009081526101066020526040902054869081906119795760405163ee27189960e01b81526004016108ec9190615048565b50611982611db8565b6000808080611993898b018b615943565b93509350935093506119bb8b83868685600260189054906101000a900463ffffffff166130e5565b8a6001600160a01b03167fd3803eb82ef5b4cdff8646734ebbaf5b37441e96314b27ffd3d0940f12a038e78b8b6040516119f6929190615800565b60405180910390a25050505050505050505050565b611a13611ae3565b61084881612f88565b600061084b6132dc565b611a2e611db8565b6000611a3b60cf836121f2565b9050611a5260d2548261330090919063ffffffff16565b8290611a7157604051623477b560e51b81526004016108ec9190615048565b50611a7b8161333d565b158290611a9c576040516317c7b35d60e31b81526004016108ec9190615048565b50610a8f826001612277565b611ab0611ae3565b6001600160a01b038116611ada576000604051631e4fbdf760e01b81526004016108ec9190615048565b61084881612097565b33611aec6111bb565b6001600160a01b031614610acd573360405163118cdaa760e01b81526004016108ec9190615048565b6002805463ffffffff60c01b1916600160c01b63ffffffff8416908102919091179091556040519081527f472aba493f9fd1d136ec54986f619f3aa5caff964f0e731a9909fb9a1270211f90602001610dab565b7f000000000000000000000000000000000000000000000000000000000000000090565b6040805161014081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101829052610120810182905290611be6611b69565b6001600160a01b03166325d9897e84306040518363ffffffff1660e01b8152600401611c13929190615515565b61014060405180830381865afa158015611c31573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c5591906159d0565b90508060a001516001600160401b0316600014158390611c8957604051637b3c09bf60e01b81526004016108ec9190615048565b5092915050565b6020810151815161084891611ca491615845565b60005460015460405180604001604052806006815260200165746f6b656e7360d01b81525061335c565b600080611cd96120f3565b91509150600083611cee578460800151611cf4565b8460e001515b9050611d42816001600160401b0316846001600160401b0316846001600160401b03166040518060400160405280600d81526020016c1d1a185dda5b99d4195c9a5bd9609a1b81525061335c565b600080611d4d611fdd565b91509150600086611d62578760600151611d68565b8760c001515b9050611dae8163ffffffff168463ffffffff168463ffffffff166040518060400160405280600e81526020016d1b585e15995c9a599a595c90dd5d60921b81525061335c565b5050505050505050565b611dc0610cdc565b15610acd5760405163d93c066560e01b815260040160405180910390fd5b6001600160a01b038281166000818152610109602052604080822080546001600160a01b0319169486169485179055517e3215dc05a2fc4e6a1e2c2776311d207c730ee51085aae221acc5cbe6fb55c19190a35050565b6001600160a01b0382166000908152606760205260409020548290829060ff161515811514611e8a57604051635e67e54b60e01b81526001600160a01b039092166004830152151560248201526044016108ec565b50506001600160a01b038216600081815260676020908152604091829020805460ff191685151590811790915591519182527fa95bac2f3df0d40e8278281c1d39d53c60e4f2bf3550ca5665738d0916e89789910160405180910390a25050565b611ef3613390565b6000611efd612073565b805460ff1916815590507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b604051610dab9190615048565b6001600160a01b0382166000818152609c60209081526040808320815192830184905282820194909452805180830382018152606090920190528190611f8b9084906133b5906133ca906134c590896134ea565b91509150846001600160a01b03167f13f3fa9f0e54af1af76d8b5d11c3973d7c2aed6312b61efff2f7b49d73ad67eb8383806020019051810190611fcf9190615a7d565b604051611768929190615277565b600080611fe8612fdf565b6001600160a01b031663bb2a2b476040518163ffffffff1660e01b8152600401602060405180830381865afa158015612025573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120499190615a96565b92620f424092509050565b60006120638260600151151590565b80156112b8575050608001511590565b7fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f0330090565b60006120a161286f565b80546001600160a01b038481166001600160a01b031983168117845560405193945091169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b6000806000612100612fdf565b6001600160a01b0316635aea0ec46040518163ffffffff1660e01b8152600401602060405180830381865afa15801561213d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121619190615ab3565b93849350915050565b60d28190556040518181527f21774046e2611ddb52c8c46e1ad97524eeb2e3fda7dcd9428867868b4c4d06ba90602001610dab565b6121ac60d08484846135a4565b80826001600160a01b0316846001600160a01b03167fd54c7abc930f6d506da2d08aa7aead4f2443e1db6d5f560384a2f652ff893e1960405160405180910390a4505050565b6121fa614fae565b6122048383613653565b604080516101208101825282546001600160a01b03168152600183015460208201526002830154918101919091526003820154606082015260048201546080820152600582015460a0820152600682015460c0820152600782015460e08201526008909101546101008201529392505050565b600061228460cf846121f2565b905061230f83612292613706565b6001600160a01b031663eeac3e0e84602001516040518263ffffffff1660e01b81526004016122c391815260200190565b6020604051808303816000875af11580156122e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123069190615a7d565b60cf919061372a565b61231a60cf846137dd565b8051604082015161232d9160d191613893565b806040015160d3600083602001518152602001908152602001600020546123549190615845565b60d3600083602001518152602001908152602001600020819055508060200151836001600160a01b031682600001516001600160a01b03167f08f2f865e0fb62d722a51e4d9873199bf6bf52e7d8ee5a2ee2896c9ef719f5458460400151866040516123cc9291909182521515602082015260400190565b60405180910390a4505050565b60006123e660cf856121f2565b90506123f181612054565b849061241157604051631eb5ff9560e01b81526004016108ec9190615048565b5080604001518314158484909161243d5760405163f32518cd60e01b81526004016108ec929190615ad0565b50506040810151808411156124735761246e612457611b69565b83516124638488615845565b60d192919087613911565b61248c565b815161248c906124838684615845565b60d19190613893565b6000612496613706565b6001600160a01b031663eeac3e0e84602001516040518263ffffffff1660e01b81526004016124c791815260200190565b6020604051808303816000875af11580156124e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061250a9190615a7d565b905060006125178461333d565b15612523576000612532565b60c08401516125329083615845565b6001600160a01b038816600090815260cf60205260409020600281018890556006018390559050612561613706565b6001600160a01b031663c8a5f81e84836040518363ffffffff1660e01b815260040161258e929190615277565b602060405180830381865afa1580156125ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125cf9190615a7d565b6001600160a01b038816600090815260cf6020526040812060070180549091906125fa908490615ae9565b909155505082861115612642576126118387615845565b60d360008660200151815260200190815260200160002060008282546126379190615ae9565b909155506126789050565b61264c8684615845565b60d360008660200151815260200190815260200160002060008282546126729190615845565b90915550505b8360200151876001600160a01b031685600001516001600160a01b03167f6db4a6f9be2d5e72eb2a2af2374ac487971bf342a261ba0bc1cf471bf2a2c31f89876040516126c6929190615277565b60405180910390a450505050505050565b8181808211156126fc5760405163ccccdafb60e01b81526004016108ec929190615277565b5050600082905560018190556040517f90699b8b4bf48918fea1129c85f9bc7b51285df7ecc982910813c7805f5688499061273a9084908490615277565b60405180910390a15050565b61274e611db8565b6000612758612073565b805460ff1916600117815590507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611f2a3390565b7fa16a46d94261c7517cc8ff89f61c0ce93598e3c849801011dee649a6a557d10090565b606060006127bd61278d565b90508060020180546127ce906156c1565b80601f01602080910402602001604051908101604052809291908181526020018280546127fa906156c1565b80156128475780601f1061281c57610100808354040283529160200191612847565b820191906000526020600020905b81548152906001019060200180831161282a57829003601f168201915b505050505091505090565b6060600061285e61278d565b90508060030180546127ce906156c1565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930090565b6060600080846001600160a01b0316846040516128b09190615afc565b600060405180830381855af49150503d80600081146128eb576040519150601f19603f3d011682016040523d82523d6000602084013e6128f0565b606091505b5091509150612900858383613a0f565b95945050505050565b6000808061291984860186615b3a565b8151604001519193509150866001600160a01b038281169082161461295357604051631a071d0760e01b81526004016108ec929190615515565b50508151516001600160a01b038111156129835760405163fa4ac7a760e01b81526004016108ec91815260200190565b50815151600061299460cf836121f2565b805190915088906001600160a01b03818116908316146129c957604051634508fbf760e11b81526004016108ec929190615515565b505060208101516129db896000611f37565b60008060006129e8613a62565b6001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401612a139190615048565b602060405180830381865afa158015612a30573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a549190615a7d565b9050612a5e6132dc565b6001600160a01b031663692209ce6000612afc8b612a7a612ee0565b6001600160a01b0316634c4ea0ed8a6040518263ffffffff1660e01b8152600401612aa791815260200190565b602060405180830381865afa158015612ac4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ae891906154f8565b612af3576000613a86565b61010854613a86565b8a6040518463ffffffff1660e01b8152600401612b1b93929190615c71565b6020604051808303816000875af1158015612b3a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b5e9190615a7d565b92506000612b6a613a62565b6001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401612b959190615048565b602060405180830381865afa158015612bb2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bd69190615a7d565b9050818181811015612bfd57604051639db8bc9560e01b81526004016108ec929190615277565b50612c0a90508282615845565b92505082159050612db457612ca98b6101075484612c289190615ca1565b612c30612fdf565b6001600160a01b0316635aea0ec46040518163ffffffff1660e01b8152600401602060405180830381865afa158015612c6d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c919190615ab3565b612ca4906001600160401b031642615ae9565b613ada565b8015612db457612cb7613706565b6001600160a01b0316631d1c2fec846040518263ffffffff1660e01b8152600401612ce491815260200190565b6020604051808303816000875af1158015612d03573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d279190615a7d565b50612d4c612d33612ee0565b82612d3c613a62565b6001600160a01b03169190613c4a565b612d54612ee0565b6001600160a01b0316638157328884836040518363ffffffff1660e01b8152600401612d81929190615277565b600060405180830381600087803b158015612d9b57600080fd5b505af1158015612daf573d6000803e3d6000fd5b505050505b86516020908101516040805186815292830185905282018390526001600160a01b038088169291811691908e16907f184c452047299395d4f7f147eb8e823458a450798539be54aeed978f13d87ba29060600160405180910390a4509998505050505050505050565b6000808080612e2e85870187615cb8565b919450925090506001600160a01b038716612e4a60cf856121f2565b51889185916001600160a01b031614612e785760405163c0bbff1360e01b81526004016108ec929190615515565b50506002546001600160a01b0388811660009081526101096020526040902054612eb692869286928692600160c01b900463ffffffff169116613cf9565b979650505050505050565b6000612ed8612ece611b69565b60d19085856142d6565b159392505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b6000807ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a006112b8565b612f35614370565b61084881614395565b610acd614370565b612f4e614370565b612f5661439d565b610acd612f3e565b612f66614370565b612f56612f3e565b612f76614370565b612f8082826143df565b610a8f612f3e565b80600003612fa95760405163bc71a04360e01b815260040160405180910390fd5b6101078190556040518181527f2aaaf20b08565eebc0c962cd7c568e54c3c0c2b85a1f942b82cd1bd730fdcd2390602001610dab565b7f000000000000000000000000000000000000000000000000000000000000000090565b61300e8160016143f1565b613016611b69565b6001600160a01b0316633a78b732826040518263ffffffff1660e01b81526004016130419190615048565b600060405180830381600087803b15801561305b57600080fd5b505af115801561306f573d6000803e3d6000fd5b5050505050565b600061186c7f4bdee85c4b4a268f4895d1096d553c3e57bb2433c380e7b7ec8cb56cc4f7467384846040516020016130ca939291909283526001600160a01b03918216602084015216604082015260600190565b60405160208183030381529060405280519060200120614408565b6001600160a01b03851661310c57604051634ffdf5ef60e11b815260040160405180910390fd5b613117868684614435565b61312b613122611b69565b60d09087614484565b600061313561457a565b6001600160a01b031663766718086040518163ffffffff1660e01b8152600401602060405180830381865afa158015613172573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131969190615a7d565b90506000613226888888886131a9613706565b6001600160a01b031663eeac3e0e8c6040518263ffffffff1660e01b81526004016131d691815260200190565b6020604051808303816000875af11580156131f5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132199190615a7d565b60cf94939291908861459e565b905061323e613233611b69565b60d1908a8887613911565b806040015160d3600083602001518152602001908152602001600020546132659190615ae9565b60d36000836020015181526020019081526020016000208190555085876001600160a01b0316896001600160a01b03167fe5e185fab2b992c4727ff702a867d78b15fb176dbaa20c9c312a1c351d3f7f838460400151866040516132ca929190615277565b60405180910390a45050505050505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b60008061331584606001518560a00151614706565b61331f9042615845565b905061332a84612054565b801561333557508281115b949350505050565b600061334c8260600151151590565b80156112b8575050604001511590565b613367848484614716565b8185858590919293611dae57604051630871e13d60e01b81526004016108ec9493929190615d10565b613398610cdc565b610acd57604051638dfc202b60e01b815260040160405180910390fd5b6000908152609b602052604090206003015490565b6000606060006133d98561472d565b90504281604001511115613401575050604080516020810190915260008152600191506134be565b600080858060200190518101906134189190615d3f565b8451919350915061342d90609a908390613893565b86816001600160a01b03167f4c06b68820628a39c787d2db1faa0eeacd7b9474847b198b1e871fe6e5b93f4485600001518660400151604051613471929190615277565b60405180910390a382516134859083615ae9565b6040805160208101929092526001600160a01b038316908201526060016040516020818303038152906040529550600086945094505050505b9250929050565b6000908152609b60205260408120818155600181018290556002810182905560030155565b60006060876003015483111561351357604051634a411b9d60e11b815260040160405180910390fd5b600083156135215783613527565b88600301545b89549094505b801580159061353c5750600085115b156135955760008061355283898c63ffffffff16565b915091508115613563575050613595565b9650866135718c8c8b6147bb565b92508661357d81615d65565b975050838061358b90615d7c565b945050505061352d565b50989397509295505050505050565b6001600160a01b0380831660009081526020868152604091829020825180840190935280549093168252600190920154918101919091526135e490614842565b15829061360557604051632d7d25f160e21b81526004016108ec9190615048565b506040805180820182526001600160a01b0394851681526020808201938452938516600090815295909352909320905181546001600160a01b03191692169190911781559051600190910155565b6001600160a01b03808216600090815260208481526040808320815161012081018352815490951685526001810154928501929092526002820154908401526003810154606084015260048101546080840152600581015460a0840152600681015460c0840152600781015460e0840152600881015461010084015290916136de9060600151151590565b83906136fe576040516342daadaf60e01b81526004016108ec9190615048565b509392505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b60006137368484613653565b604080516101208101825282546001600160a01b03168152600183015460208201526002830154918101919091526003820154606082015260048201546080820152600582015460a0820152600682015460c0820152600782015460e082015260088201546101008201529091506137ad90612054565b600482015484916137d3576040516361b66e0d60e01b81526004016108ec929190615ad0565b5050600601555050565b60006137e98383613653565b604080516101208101825282546001600160a01b03168152600183015460208201526002830154918101919091526003820154606082015260048201546080820152600582015460a0820152600682015460c0820152600782015460e0820152600882015461010082015290915061386090612054565b60048201548391613886576040516361b66e0d60e01b81526004016108ec929190615ad0565b5050426004909101555050565b806000036138a057505050565b6001600160a01b03821660009081526020849052604090205481808210156138dd57604051635f8ec70960e01b81526004016108ec929190615277565b50506001600160a01b03821660009081526020849052604081208054839290613907908490615845565b9091555050505050565b811561306f576001600160a01b03831660009081526020869052604081205461393b908490615ae9565b90506000856001600160a01b031663872d04898630866040518463ffffffff1660e01b815260040161396f93929190615d95565b602060405180830381865afa15801561398c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906139b09190615a7d565b90508082818111156139d757604051635f8ec70960e01b81526004016108ec929190615277565b50506001600160a01b03851660009081526020889052604081208054869290613a01908490615ae9565b909155505050505050505050565b606082613a2457613a1f82614851565b61186c565b8151158015613a3b57506001600160a01b0384163b155b15613a5b5783604051639996b31560e01b81526004016108ec9190615048565b508061186c565b7f000000000000000000000000000000000000000000000000000000000000000090565b81516040908101516001600160a01b039081166000908152610109602090815290839020549251606093613ac39387938793929091169101615dbe565b604051602081830303815290604052905092915050565b81600003613afb57604051638f4c63d960e01b815260040160405180910390fd5b613b27613b06611b69565b600254609a91908690869063ffffffff600160c01b90910481169061391116565b6001600160a01b0383166000908152609c6020908152604080832060028082015483516001600160601b031930606090811b8216838901528b901b166034820152604880820192909252845180820390920182526068810180865282519287019290922060e882018652898352426088830190815260a883018a815260c8909301898152828a52609b909852959097209151825593516001820155925190830155915160039182015581015490919015613bf55760018201546000908152609b602052604090206003018190555b613bff828261487a565b80856001600160a01b03167f5d9e2c5278e41138269f5f980cfbea016d8c59816754502abc4d2f87aaea987f8686604051613c3b929190615277565b60405180910390a35050505050565b8015610d3c5760405163a9059cbb60e01b81526001600160a01b0384169063a9059cbb90613c7e9085908590600401615ad0565b6020604051808303816000875af1158015613c9d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613cc191906154f8565b610d3c5760405162461bcd60e51b815260206004820152600960248201526810ba3930b739b332b960b91b60448201526064016108ec565b600080613d0760cf886121f2565b9050613d1281612054565b8790613d3257604051631eb5ff9560e01b81526004016108ec9190615048565b506000613d4a60d2548361330090919063ffffffff16565b158015613d5d5750613d5b8261333d565b155b8015613d6857508615155b8015613de05750816101000151613d7d61457a565b6001600160a01b031663766718086040518163ffffffff1660e01b8152600401602060405180830381865afa158015613dba573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613dde9190615a7d565b115b613deb576000613e61565b613df3613706565b6001600160a01b031663db750926896040518263ffffffff1660e01b8152600401613e1e9190615048565b6020604051808303816000875af1158015613e3d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613e619190615a7d565b9050613ea088613e6f613706565b6001600160a01b031663eeac3e0e85602001516040518263ffffffff1660e01b81526004016122c391815260200190565b613eab60cf8961490d565b613eb660cf896149c3565b60008082156141ef576000613ec9611b69565b8551604051637573ef4f60e01b81526001600160a01b039290921691637573ef4f91613efc913090600290600401615e87565b602060405180830381865afa158015613f19573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613f3d9190615a7d565b90506000613f49611b69565b8651604051631584a17960e21b81526001600160a01b03929092169163561285e491613f79913090600401615515565b60a060405180830381865afa158015613f96573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613fba9190615eac565b90506000816020015111613fcf576000613fd9565b613fd98583614a7a565b925082156140ce57613fe9613a62565b6001600160a01b031663095ea7b3613fff611b69565b856040518363ffffffff1660e01b815260040161401d929190615ad0565b6020604051808303816000875af115801561403c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061406091906154f8565b50614069611b69565b865160405163ca94b0e960e01b81526001600160a01b03929092169163ca94b0e99161409b9130908890600401615f1f565b600060405180830381600087803b1580156140b557600080fd5b505af11580156140c9573d6000803e3d6000fd5b505050505b6140d88386615845565b935083156141ec576001600160a01b0388166141df576140f6613a62565b6001600160a01b031663095ea7b361410c611b69565b866040518363ffffffff1660e01b815260040161412a929190615ad0565b6020604051808303816000875af1158015614149573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061416d91906154f8565b50614176611b69565b8651604051633a30904960e11b81526001600160a01b0392909216916374612092916141a89130908990600401615f1f565b600060405180830381600087803b1580156141c257600080fd5b505af11580156141d6573d6000803e3d6000fd5b505050506141ec565b6141ec8885612d3c613a62565b50505b602084015184516001600160a01b03808d1691167f443f56bd2098d273b8c8120398789a41da5925db4ba2f656813fc5299ac57b1f8686868f8f61423161457a565b6001600160a01b031663766718086040518163ffffffff1660e01b8152600401602060405180830381865afa15801561426e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906142929190615a7d565b6040516142a496959493929190615f43565b60405180910390a483516142b89088612ec1565b156142c8576142c88a6001612277565b509098975050505050505050565b600080846001600160a01b031663872d04898530866040518463ffffffff1660e01b815260040161430993929190615d95565b602060405180830381865afa158015614326573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061434a9190615a7d565b6001600160a01b0385166000908152602088905260409020541115915050949350505050565b614378614ada565b610acd57604051631afcd79f60e31b815260040160405180910390fd5b611ab0614370565b6143a5614370565b6143b260006000196126d7565b6143c06000620f4240614af4565b6143d260006001600160401b03614bc5565b610acd63ffffffff611b15565b6143e7614370565b610a8f8282614c52565b60006143fc83611b8d565b9050610d3c8183611cce565b60006112b8614415614c93565b8360405161190160f01b8152600281019290925260228201526042902090565b600061444a6144448585613076565b83614c9d565b905080836001600160a01b038083169082161461447c57604051638c5b935d60e01b81526004016108ec929190615515565b505050505050565b6001600160a01b0380821660009081526020858152604091829020825180840190935280549093168252600190920154918101919091526144c490614842565b1581906144e557604051632d7d25f160e21b81526004016108ec9190615048565b506040516378eb06b360e11b81526001600160a01b0383169063f1d60d6690614512908490600401615048565b602060405180830381865afa15801561452f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061455391906154f8565b15819061457457604051632d7d25f160e21b81526004016108ec9190615048565b50505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b6145a6614fae565b6001600160a01b03808716600090815260208a8152604091829020825161012081018452815490941684526001810154918401919091526002810154918301919091526003810154606083015260048101546080830152600581015460a0830152600681015460c0830152600781015460e0830152600801546101008201526146329060600151151590565b15869061465357604051630bc4def560e01b81526004016108ec9190615048565b505060408051610120810182526001600160a01b0397881681526020808201968752818301958652426060830190815260006080840181815260a0850182815260c0860198895260e0860183815261010087019889529b8d1683529c90935293909320825181546001600160a01b0319169a169990991789559551600189015593516002880155516003870155925160048601559451600585015593516006840155905160078301555160089091015590565b600082821882841102821861186c565b600082841015801561333557505090911115919050565b61475b6040518060800160405280600081526020016000815260200160008152602001600080191681525090565b6000828152609b602090815260409182902082516080810184528154815260018201549281018390526002820154938101939093526003015460608301528390611c895760405163107349a960e21b81526004016108ec91815260200190565b6000808460030154116147e15760405163ddaf8f2160e01b815260040160405180910390fd5b60006147f485600001548563ffffffff16565b905061480785600001548463ffffffff16565b600185600301600082825461481c9190615845565b9091555050808555600385015460000361483857600060018601555b5050915492915050565b516001600160a01b0316151590565b8051156148615780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b6127108260030154106148a0576040516303a8c56b60e61b815260040160405180910390fd5b806148be57604051638f4a893d60e01b815260040160405180910390fd5b60018083018290556002830180546000906148da908490615ae9565b909155505060038201546000036148ef578082555b60018260030160008282546149049190615ae9565b90915550505050565b60006149198383613653565b604080516101208101825282546001600160a01b03168152600183015460208201526002830154918101919091526003820154606082015260048201546080820152600582015460a0820152600682015460c0820152600782015460e0820152600882015461010082015290915061499090612054565b600482015483916149b6576040516361b66e0d60e01b81526004016108ec929190615ad0565b5050426005909101555050565b60006149cf8383613653565b604080516101208101825282546001600160a01b03168152600183015460208201526002830154918101919091526003820154606082015260048201546080820152600582015460a0820152600682015460c0820152600782015460e08201526008820154610100820152909150614a4690612054565b60048201548391614a6c576040516361b66e0d60e01b81526004016108ec929190615ad0565b505060006007909101555050565b6000614a8983620f4240101590565b80614a9c5750614a9c82620f4240101590565b83839091614abf5760405163768bf0eb60e11b81526004016108ec929190615277565b50620f42409050614ad08385615ca1565b61186c9190615f81565b6000614ae4612f04565b54600160401b900460ff16919050565b818163ffffffff8082169083161115614b225760405163ccccdafb60e01b81526004016108ec929190615180565b508290508163ffffffff8116620f42401015614b535760405163ccccdafb60e01b81526004016108ec929190615180565b50506002805463ffffffff838116600160a01b0263ffffffff60a01b19918616600160801b0291909116600160801b600160c01b0319909216919091171790556040517f2fe5a7039987697813605cc0b9d6db7aab575408e3fc59e8a457bef8d7bc0a369061273a9084908490615180565b81816001600160401b038082169083161115614bf65760405163ccccdafb60e01b81526004016108ec92919061521c565b5050600280546001600160401b03838116600160401b026001600160801b0319909216908516171790556040517f2867e04c500e438761486b78021d4f9eb97c77ff45d10c1183f5583ba4cbf7d19061273a908490849061521c565b614c5a614370565b6000614c6461278d565b905060028101614c748482615742565b5060038101614c838382615742565b5060008082556001909101555050565b600061084b614cc7565b600080600080614cad8686614d3b565b925092509250614cbd8282614d88565b5090949350505050565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f614cf2614e41565b614cfa614ea8565b60408051602081019490945283019190915260608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b60008060008351604103614d755760208401516040850151606086015160001a614d6788828585614ee9565b955095509550505050614d81565b50508151600091506002905b9250925092565b6000826003811115614d9c57614d9c6158db565b03614da5575050565b6001826003811115614db957614db96158db565b03614dd75760405163f645eedf60e01b815260040160405180910390fd5b6002826003811115614deb57614deb6158db565b03614e0c5760405163fce698f760e01b8152600481018290526024016108ec565b6003826003811115614e2057614e206158db565b03610a8f576040516335e2f38360e21b8152600481018290526024016108ec565b600080614e4c61278d565b90506000614e586127b1565b805190915015614e7057805160209091012092915050565b81548015614e7f579392505050565b7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470935050505090565b600080614eb361278d565b90506000614ebf612852565b805190915015614ed757805160209091012092915050565b60018201548015614e7f579392505050565b600080806fa2a8918ca85bafe22016d0b997e4df60600160ff1b03841115614f1a5750600091506003905082614fa4565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa158015614f6e573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116614f9a57506000925060019150829050614fa4565b9250600091508190505b9450945094915050565b60405180610120016040528060006001600160a01b0316815260200160008019168152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b6001600160a01b038116811461084857600080fd5b803561502681615006565b919050565b60006020828403121561503d57600080fd5b813561186c81615006565b6001600160a01b0391909116815260200190565b63ffffffff8116811461084857600080fd5b60006020828403121561508057600080fd5b813561186c8161505c565b60008083601f84011261509d57600080fd5b5081356001600160401b038111156150b457600080fd5b6020830191508360208285010111156134be57600080fd5b6000806000604084860312156150e157600080fd5b83356150ec81615006565b925060208401356001600160401b0381111561510757600080fd5b6151138682870161508b565b9497909650939450505050565b801515811461084857600080fd5b6000806040838503121561514157600080fd5b823561514c81615006565b9150602083013561515c81615120565b809150509250929050565b60006020828403121561517957600080fd5b5035919050565b63ffffffff92831681529116602082015260400190565b60005b838110156151b257818101518382015260200161519a565b50506000910152565b600081518084526151d3816020860160208601615197565b601f01601f19169290920160200192915050565b83815260606020820152600061520060608301856151bb565b828103604084015261521281856151bb565b9695505050505050565b6001600160401b0392831681529116602082015260400190565b60008060006060848603121561524b57600080fd5b833561525681615006565b9250602084013561526681615006565b929592945050506040919091013590565b918252602082015260400190565b60ff60f81b8816815260e0602082015260006152a460e08301896151bb565b82810360408401526152b681896151bb565b606084018890526001600160a01b038716608085015260a0840186905283810360c08501528451808252602080870193509091019060005b8181101561530c5783518352602093840193909201916001016152ee565b50909b9a5050505050505050505050565b6000806020838503121561533057600080fd5b82356001600160401b0381111561534657600080fd5b8301601f8101851361535757600080fd5b80356001600160401b0381111561536d57600080fd5b8560208260051b840101111561538257600080fd5b6020919091019590945092505050565b6000602082016020835280845180835260408501915060408160051b86010192506020860160005b828110156153eb57603f198786030184526153d68583516151bb565b945060209384019391909101906001016153ba565b50929695505050505050565b6000806000806060858703121561540d57600080fd5b843561541881615006565b935060208501356003811061542c57600080fd5b925060408501356001600160401b0381111561544757600080fd5b6154538782880161508b565b95989497509550505050565b6000806000806080858703121561547557600080fd5b843561548081615006565b93506020850135925060408501356154978161505c565b9396929550929360600135925050565b600080604083850312156154ba57600080fd5b82356154c581615006565b9150602083013561515c81615006565b6001600160a01b0393841681529183166020830152909116604082015260600190565b60006020828403121561550a57600080fd5b815161186c81615120565b6001600160a01b0392831681529116602082015260400190565b634e487b7160e01b600052604160045260246000fd5b60405161014081016001600160401b03811182821017156155685761556861552f565b60405290565b604080519081016001600160401b03811182821017156155685761556861552f565b60405160e081016001600160401b03811182821017156155685761556861552f565b600082601f8301126155c357600080fd5b8135602083016000806001600160401b038411156155e3576155e361552f565b50604051601f19601f85018116603f011681018181106001600160401b03821117156156115761561161552f565b60405283815290508082840187101561562957600080fd5b838360208301376000602085830101528094505050505092915050565b60008060006060848603121561565b57600080fd5b83356001600160401b0381111561567157600080fd5b61567d868287016155b2565b93505060208401356001600160401b0381111561569957600080fd5b6156a5868287016155b2565b92505060408401356156b681615006565b809150509250925092565b600181811c908216806156d557607f821691505b6020821081036156f557634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115610d3c57806000526020600020601f840160051c810160208510156157225750805b601f840160051c820191505b8181101561306f576000815560010161572e565b81516001600160401b0381111561575b5761575b61552f565b61576f8161576984546156c1565b846156fb565b6020601f8211600181146157a3576000831561578b5750848201515b600019600385901b1c1916600184901b17845561306f565b600084815260208120601f198516915b828110156157d357878501518255602094850194600190920191016157b3565b50848210156157f15786840151600019600387901b60f8161c191681555b50505050600190811b01905550565b60208152816020820152818360408301376000818301604090810191909152601f909201601f19160101919050565b634e487b7160e01b600052601160045260246000fd5b818103818111156112b8576112b861582f565b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261588557600080fd5b8301803591506001600160401b0382111561589f57600080fd5b6020019150368190038213156134be57600080fd5b8284823760008382016000815283516158d1818360208801615197565b0195945050505050565b634e487b7160e01b600052602160045260246000fd5b6003811061590f57634e487b7160e01b600052602160045260246000fd5b9052565b602081016112b882846158f1565b6000806040838503121561593457600080fd5b50508035926020909101359150565b6000806000806080858703121561595957600080fd5b8435935060208501359250604085013561597281615006565b915060608501356001600160401b0381111561598d57600080fd5b615999878288016155b2565b91505092959194509250565b80516150268161505c565b6001600160401b038116811461084857600080fd5b8051615026816159b0565b60006101408284031280156159e457600080fd5b5060006159ef615545565b835181526020808501519082015260408085015190820152615a13606085016159a5565b6060820152615a24608085016159c5565b6080820152615a3560a085016159c5565b60a0820152615a4660c085016159a5565b60c0820152615a5760e085016159c5565b60e082015261010084810151908201526101209384015193810193909352509092915050565b600060208284031215615a8f57600080fd5b5051919050565b600060208284031215615aa857600080fd5b815161186c8161505c565b600060208284031215615ac557600080fd5b815161186c816159b0565b6001600160a01b03929092168252602082015260400190565b808201808211156112b8576112b861582f565b60008251615b0e818460208701615197565b9190910192915050565b8035615026816159b0565b80356001600160801b038116811461502657600080fd5b60008060408385031215615b4d57600080fd5b82356001600160401b03811115615b6357600080fd5b830160408186031215615b7557600080fd5b615b7d61556e565b81356001600160401b03811115615b9357600080fd5b820160e08188031215615ba557600080fd5b615bad615590565b81358152615bbd6020830161501b565b6020820152615bce6040830161501b565b6040820152615bdf6060830161501b565b6060820152615bf060808301615b18565b6080820152615c0160a08301615b23565b60a082015260c08201356001600160401b03811115615c1f57600080fd5b615c2b898285016155b2565b60c08301525082525060208201356001600160401b03811115615c4d57600080fd5b615c59878285016155b2565b60208381019190915291979590910135955050505050565b615c7b81856158f1565b606060208201526000615c9160608301856151bb565b9050826040830152949350505050565b80820281158282048414176112b8576112b861582f565b600080600060608486031215615ccd57600080fd5b8335615cd881615006565b92506020840135915060408401356001600160401b03811115615cfa57600080fd5b615d06868287016155b2565b9150509250925092565b608081526000615d2360808301876151bb565b6020830195909552506040810192909252606090910152919050565b60008060408385031215615d5257600080fd5b8251602084015190925061515c81615006565b600081615d7457615d7461582f565b506000190190565b600060018201615d8e57615d8e61582f565b5060010190565b6001600160a01b03938416815291909216602082015263ffffffff909116604082015260600190565b606080825284516040838301819052815160a085015260208201516001600160a01b0390811660c086015290820151811660e08501529181015190911661010083015260808101516001600160401b038116610120840152600091905060a08101516001600160801b0381166101408501525060c0015160e0610160840152615e4b6101808401826151bb565b90506020860151605f19848303016080850152615e6882826151bb565b9250505083602083015261333560408301846001600160a01b03169052565b6001600160a01b038481168252831660208201526060810161333560408301846158f1565b600060a0828403128015615ebf57600080fd5b5060405160009060a081016001600160401b0381118282101715615ee557615ee561552f565b6040908152845182526020808601519083015284810151908201526060808501519082015260809384015193810193909352509092915050565b6001600160a01b039384168152919092166020820152604081019190915260600190565b86815285602082015284604082015283606082015260c060808201526000615f6e60c08301856151bb565b90508260a0830152979650505050505050565b600082615f9e57634e487b7160e01b600052601260045260246000fd5b50049056fea2646970667358221220b85de947a2adf153b4d5d66360454c8d0624bca998d3fc8f12bd17e31d74127864736f6c634300081b0033", + "linkReferences": {}, + "deployedLinkReferences": {} +} \ No newline at end of file diff --git a/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/SubgraphService#SubgraphServiceProxy.json b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/SubgraphService#SubgraphServiceProxy.json new file mode 100644 index 000000000..5f5b5ea19 --- /dev/null +++ b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/SubgraphService#SubgraphServiceProxy.json @@ -0,0 +1,116 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "TransparentUpgradeableProxy", + "sourceName": "contracts/proxy/transparent/TransparentUpgradeableProxy.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "initialOwner", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + } + ], + "name": "AddressEmptyCode", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "admin", + "type": "address" + } + ], + "name": "ERC1967InvalidAdmin", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "ERC1967InvalidImplementation", + "type": "error" + }, + { + "inputs": [], + "name": "ERC1967NonPayable", + "type": "error" + }, + { + "inputs": [], + "name": "FailedCall", + "type": "error" + }, + { + "inputs": [], + "name": "ProxyDeniedAdminAccess", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + } + ], + "bytecode": "0x60a060405260405162000e5038038062000e508339810160408190526200002691620003bc565b828162000034828262000099565b50508160405162000045906200035a565b6001600160a01b039091168152602001604051809103905ff0801580156200006f573d5f803e3d5ffd5b506001600160a01b0316608052620000906200008a60805190565b620000fe565b505050620004b3565b620000a4826200016f565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b905f90a2805115620000f057620000eb8282620001ee565b505050565b620000fa62000267565b5050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6200013f5f8051602062000e30833981519152546001600160a01b031690565b604080516001600160a01b03928316815291841660208301520160405180910390a16200016c8162000289565b50565b806001600160a01b03163b5f03620001aa57604051634c9c8ce360e01b81526001600160a01b03821660048201526024015b60405180910390fd5b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5b80546001600160a01b0319166001600160a01b039290921691909117905550565b60605f80846001600160a01b0316846040516200020c919062000496565b5f60405180830381855af49150503d805f811462000246576040519150601f19603f3d011682016040523d82523d5f602084013e6200024b565b606091505b5090925090506200025e858383620002ca565b95945050505050565b3415620002875760405163b398979f60e01b815260040160405180910390fd5b565b6001600160a01b038116620002b457604051633173bdd160e11b81525f6004820152602401620001a1565b805f8051602062000e30833981519152620001cd565b606082620002e357620002dd8262000330565b62000329565b8151158015620002fb57506001600160a01b0384163b155b156200032657604051639996b31560e01b81526001600160a01b0385166004820152602401620001a1565b50805b9392505050565b805115620003415780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b6104fc806200093483390190565b80516001600160a01b03811681146200037f575f80fd5b919050565b634e487b7160e01b5f52604160045260245ffd5b5f5b83811015620003b45781810151838201526020016200039a565b50505f910152565b5f805f60608486031215620003cf575f80fd5b620003da8462000368565b9250620003ea6020850162000368565b60408501519092506001600160401b038082111562000407575f80fd5b818601915086601f8301126200041b575f80fd5b81518181111562000430576200043062000384565b604051601f8201601f19908116603f011681019083821181831017156200045b576200045b62000384565b8160405282815289602084870101111562000474575f80fd5b6200048783602083016020880162000398565b80955050505050509250925092565b5f8251620004a981846020870162000398565b9190910192915050565b608051610469620004cb5f395f601001526104695ff3fe608060405261000c61000e565b005b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316330361007a575f356001600160e01b03191663278f794360e11b14610070576040516334ad5dbb60e21b815260040160405180910390fd5b610078610082565b565b6100786100b0565b5f806100913660048184610303565b81019061009e919061033e565b915091506100ac82826100c0565b5050565b6100786100bb61011a565b610151565b6100c98261016f565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b905f90a28051156101125761010d82826101ea565b505050565b6100ac61025c565b5f61014c7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b365f80375f80365f845af43d5f803e80801561016b573d5ff35b3d5ffd5b806001600160a01b03163b5f036101a957604051634c9c8ce360e01b81526001600160a01b03821660048201526024015b60405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b60605f80846001600160a01b0316846040516102069190610407565b5f60405180830381855af49150503d805f811461023e576040519150601f19603f3d011682016040523d82523d5f602084013e610243565b606091505b509150915061025385838361027b565b95945050505050565b34156100785760405163b398979f60e01b815260040160405180910390fd5b6060826102905761028b826102da565b6102d3565b81511580156102a757506001600160a01b0384163b155b156102d057604051639996b31560e01b81526001600160a01b03851660048201526024016101a0565b50805b9392505050565b8051156102ea5780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b5f8085851115610311575f80fd5b8386111561031d575f80fd5b5050820193919092039150565b634e487b7160e01b5f52604160045260245ffd5b5f806040838503121561034f575f80fd5b82356001600160a01b0381168114610365575f80fd5b9150602083013567ffffffffffffffff80821115610381575f80fd5b818501915085601f830112610394575f80fd5b8135818111156103a6576103a661032a565b604051601f8201601f19908116603f011681019083821181831017156103ce576103ce61032a565b816040528281528860208487010111156103e6575f80fd5b826020860160208301375f6020848301015280955050505050509250929050565b5f82515f5b81811015610426576020818601810151858301520161040c565b505f92019182525091905056fea26469706673582212201a31c3db442064e980907a5ca999ca52c132d057688e882222814e029a3aad9064736f6c63430008180033608060405234801561000f575f80fd5b506040516104fc3803806104fc83398101604081905261002e916100bb565b806001600160a01b03811661005c57604051631e4fbdf760e01b81525f600482015260240160405180910390fd5b6100658161006c565b50506100e8565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b5f602082840312156100cb575f80fd5b81516001600160a01b03811681146100e1575f80fd5b9392505050565b610407806100f55f395ff3fe608060405260043610610049575f3560e01c8063715018a61461004d5780638da5cb5b146100635780639623609d1461008e578063ad3cb1cc146100a1578063f2fde38b146100de575b5f80fd5b348015610058575f80fd5b506100616100fd565b005b34801561006e575f80fd5b505f546040516001600160a01b0390911681526020015b60405180910390f35b61006161009c366004610260565b610110565b3480156100ac575f80fd5b506100d1604051806040016040528060058152602001640352e302e360dc1b81525081565b6040516100859190610372565b3480156100e9575f80fd5b506100616100f836600461038b565b61017b565b6101056101bd565b61010e5f6101e9565b565b6101186101bd565b60405163278f794360e11b81526001600160a01b03841690634f1ef28690349061014890869086906004016103a6565b5f604051808303818588803b15801561015f575f80fd5b505af1158015610171573d5f803e3d5ffd5b5050505050505050565b6101836101bd565b6001600160a01b0381166101b157604051631e4fbdf760e01b81525f60048201526024015b60405180910390fd5b6101ba816101e9565b50565b5f546001600160a01b0316331461010e5760405163118cdaa760e01b81523360048201526024016101a8565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b03811681146101ba575f80fd5b634e487b7160e01b5f52604160045260245ffd5b5f805f60608486031215610272575f80fd5b833561027d81610238565b9250602084013561028d81610238565b9150604084013567ffffffffffffffff808211156102a9575f80fd5b818601915086601f8301126102bc575f80fd5b8135818111156102ce576102ce61024c565b604051601f8201601f19908116603f011681019083821181831017156102f6576102f661024c565b8160405282815289602084870101111561030e575f80fd5b826020860160208301375f6020848301015280955050505050509250925092565b5f81518084525f5b8181101561035357602081850181015186830182015201610337565b505f602082860101526020601f19601f83011685010191505092915050565b602081525f610384602083018461032f565b9392505050565b5f6020828403121561039b575f80fd5b813561038481610238565b6001600160a01b03831681526040602082018190525f906103c99083018461032f565b94935050505056fea2646970667358221220098134bf3dcb274377e55b14b69b89c7eefde1171c4c5b1eb6233b5158fa785b64736f6c63430008180033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103", + "deployedBytecode": "0x608060405261000c61000e565b005b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316330361007a575f356001600160e01b03191663278f794360e11b14610070576040516334ad5dbb60e21b815260040160405180910390fd5b610078610082565b565b6100786100b0565b5f806100913660048184610303565b81019061009e919061033e565b915091506100ac82826100c0565b5050565b6100786100bb61011a565b610151565b6100c98261016f565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b905f90a28051156101125761010d82826101ea565b505050565b6100ac61025c565b5f61014c7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b365f80375f80365f845af43d5f803e80801561016b573d5ff35b3d5ffd5b806001600160a01b03163b5f036101a957604051634c9c8ce360e01b81526001600160a01b03821660048201526024015b60405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b60605f80846001600160a01b0316846040516102069190610407565b5f60405180830381855af49150503d805f811461023e576040519150601f19603f3d011682016040523d82523d5f602084013e610243565b606091505b509150915061025385838361027b565b95945050505050565b34156100785760405163b398979f60e01b815260040160405180910390fd5b6060826102905761028b826102da565b6102d3565b81511580156102a757506001600160a01b0384163b155b156102d057604051639996b31560e01b81526001600160a01b03851660048201526024016101a0565b50805b9392505050565b8051156102ea5780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b5f8085851115610311575f80fd5b8386111561031d575f80fd5b5050820193919092039150565b634e487b7160e01b5f52604160045260245ffd5b5f806040838503121561034f575f80fd5b82356001600160a01b0381168114610365575f80fd5b9150602083013567ffffffffffffffff80821115610381575f80fd5b818501915085601f830112610394575f80fd5b8135818111156103a6576103a661032a565b604051601f8201601f19908116603f011681019083821181831017156103ce576103ce61032a565b816040528281528860208487010111156103e6575f80fd5b826020860160208301375f6020848301015280955050505050509250929050565b5f82515f5b81811015610426576020818601810151858301520161040c565b505f92019182525091905056fea26469706673582212201a31c3db442064e980907a5ca999ca52c132d057688e882222814e029a3aad9064736f6c63430008180033", + "linkReferences": {}, + "deployedLinkReferences": {} +} \ No newline at end of file diff --git a/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/SubgraphService#SubgraphService_ProxyWithABI.json b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/SubgraphService#SubgraphService_ProxyWithABI.json new file mode 100644 index 000000000..d14c050d0 --- /dev/null +++ b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/SubgraphService#SubgraphService_ProxyWithABI.json @@ -0,0 +1,2268 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "SubgraphService", + "sourceName": "contracts/SubgraphService.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "graphController", + "type": "address" + }, + { + "internalType": "address", + "name": "disputeManager", + "type": "address" + }, + { + "internalType": "address", + "name": "graphTallyCollector", + "type": "address" + }, + { + "internalType": "address", + "name": "curation", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + } + ], + "name": "AddressEmptyCode", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "AllocationAlreadyExists", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "internalType": "uint256", + "name": "closedAt", + "type": "uint256" + } + ], + "name": "AllocationClosed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "AllocationDoesNotExist", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "AllocationManagerAllocationClosed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "AllocationManagerAllocationSameSize", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "signer", + "type": "address" + }, + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "AllocationManagerInvalidAllocationProof", + "type": "error" + }, + { + "inputs": [], + "name": "AllocationManagerInvalidZeroAllocationId", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "claimId", + "type": "bytes32" + } + ], + "name": "DataServiceFeesClaimNotFound", + "type": "error" + }, + { + "inputs": [], + "name": "DataServiceFeesZeroTokens", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "DataServicePausableNotPauseGuardian", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "DataServicePausablePauseGuardianNoChange", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "internalType": "address", + "name": "disputeManager", + "type": "address" + } + ], + "name": "DirectoryNotDisputeManager", + "type": "error" + }, + { + "inputs": [], + "name": "ECDSAInvalidSignature", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "length", + "type": "uint256" + } + ], + "name": "ECDSAInvalidSignatureLength", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "ECDSAInvalidSignatureS", + "type": "error" + }, + { + "inputs": [], + "name": "EnforcedPause", + "type": "error" + }, + { + "inputs": [], + "name": "ExpectedPause", + "type": "error" + }, + { + "inputs": [], + "name": "FailedCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "contractName", + "type": "bytes" + } + ], + "name": "GraphDirectoryInvalidZeroAddress", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidInitialization", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "LegacyAllocationAlreadyExists", + "type": "error" + }, + { + "inputs": [], + "name": "LinkedListEmptyList", + "type": "error" + }, + { + "inputs": [], + "name": "LinkedListInvalidIterations", + "type": "error" + }, + { + "inputs": [], + "name": "LinkedListInvalidZeroId", + "type": "error" + }, + { + "inputs": [], + "name": "LinkedListMaxElementsExceeded", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "OwnableInvalidOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "OwnableUnauthorizedAccount", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "a", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "b", + "type": "uint256" + } + ], + "name": "PPMMathInvalidMulPPM", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "name": "ProvisionManagerInvalidRange", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "message", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "name": "ProvisionManagerInvalidValue", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "ProvisionManagerNotAuthorized", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + } + ], + "name": "ProvisionManagerProvisionNotFound", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokensAvailable", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokensRequired", + "type": "uint256" + } + ], + "name": "ProvisionTrackerInsufficientTokens", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "SubgraphServiceAllocationIsAltruistic", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "SubgraphServiceAllocationNotAuthorized", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "SubgraphServiceCannotForceCloseAllocation", + "type": "error" + }, + { + "inputs": [], + "name": "SubgraphServiceEmptyGeohash", + "type": "error" + }, + { + "inputs": [], + "name": "SubgraphServiceEmptyUrl", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "balanceBefore", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "balanceAfter", + "type": "uint256" + } + ], + "name": "SubgraphServiceInconsistentCollection", + "type": "error" + }, + { + "inputs": [], + "name": "SubgraphServiceIndexerAlreadyRegistered", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "providedIndexer", + "type": "address" + }, + { + "internalType": "address", + "name": "expectedIndexer", + "type": "address" + } + ], + "name": "SubgraphServiceIndexerMismatch", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + } + ], + "name": "SubgraphServiceIndexerNotRegistered", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "collectionId", + "type": "bytes32" + } + ], + "name": "SubgraphServiceInvalidCollectionId", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "curationCut", + "type": "uint256" + } + ], + "name": "SubgraphServiceInvalidCurationCut", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "paymentType", + "type": "uint8" + } + ], + "name": "SubgraphServiceInvalidPaymentType", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "ravIndexer", + "type": "address" + }, + { + "internalType": "address", + "name": "allocationIndexer", + "type": "address" + } + ], + "name": "SubgraphServiceInvalidRAV", + "type": "error" + }, + { + "inputs": [], + "name": "SubgraphServiceInvalidZeroStakeToFeesRatio", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "forceClosed", + "type": "bool" + } + ], + "name": "AllocationClosed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "currentEpoch", + "type": "uint256" + } + ], + "name": "AllocationCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newTokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldTokens", + "type": "uint256" + } + ], + "name": "AllocationResized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "curationCut", + "type": "uint256" + } + ], + "name": "CurationCutSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "ratio", + "type": "uint32" + } + ], + "name": "DelegationRatioSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "EIP712DomainChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "graphToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "graphStaking", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphPayments", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphEscrow", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "graphController", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphEpochManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphRewardsManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphTokenGateway", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphProxyAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphCuration", + "type": "address" + } + ], + "name": "GraphDirectoryInitialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensRewards", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensIndexerRewards", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensDelegationRewards", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "poi", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "poiMetadata", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "currentEpoch", + "type": "uint256" + } + ], + "name": "IndexingRewardsCollected", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + } + ], + "name": "LegacyAllocationMigrated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "maxPOIStaleness", + "type": "uint256" + } + ], + "name": "MaxPOIStalenessSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "PauseGuardianSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Paused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "paymentsDestination", + "type": "address" + } + ], + "name": "PaymentsDestinationSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + } + ], + "name": "ProvisionPendingParametersAccepted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "name": "ProvisionTokensRangeSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensCollected", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensCurators", + "type": "uint256" + } + ], + "name": "QueryFeesCollected", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "feeType", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "ServicePaymentCollected", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "ServiceProviderRegistered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "ServiceProviderSlashed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "ServiceStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "ServiceStopped", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "claimId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "unlockTimestamp", + "type": "uint256" + } + ], + "name": "StakeClaimLocked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "claimId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "releasableAt", + "type": "uint256" + } + ], + "name": "StakeClaimReleased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "claimsCount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensReleased", + "type": "uint256" + } + ], + "name": "StakeClaimsReleased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "ratio", + "type": "uint256" + } + ], + "name": "StakeToFeesRatioSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "subgraphService", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "disputeManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphTallyCollector", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "curation", + "type": "address" + } + ], + "name": "SubgraphServiceDirectoryInitialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "min", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "max", + "type": "uint64" + } + ], + "name": "ThawingPeriodRangeSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Unpaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "min", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "max", + "type": "uint32" + } + ], + "name": "VerifierCutRangeSet", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "name": "acceptProvisionPendingParameters", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + } + ], + "name": "allocationProvisionTracker", + "outputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "claimId", + "type": "bytes32" + } + ], + "name": "claims", + "outputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "createdAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "releasableAt", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "nextClaim", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + } + ], + "name": "claimsLists", + "outputs": [ + { + "internalType": "bytes32", + "name": "head", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "tail", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "count", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "closeStaleAllocation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "paymentType", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "collect", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "curationFeesCut", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "eip712Domain", + "outputs": [ + { + "internalType": "bytes1", + "name": "fields", + "type": "bytes1" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "version", + "type": "string" + }, + { + "internalType": "uint256", + "name": "chainId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "verifyingContract", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "salt", + "type": "bytes32" + }, + { + "internalType": "uint256[]", + "name": "extensions", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "encodeAllocationProof", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + } + ], + "name": "feesProvisionTracker", + "outputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "getAllocation", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "createdAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "closedAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lastPOIPresentedAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "accRewardsPerAllocatedToken", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "accRewardsPending", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "createdAtEpoch", + "type": "uint256" + } + ], + "internalType": "struct Allocation.State", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "getAllocationData", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getCuration", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getDelegationRatio", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getDisputeManager", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getGraphTallyCollector", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "getLegacyAllocation", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + } + ], + "internalType": "struct LegacyAllocation.State", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getProvisionTokensRange", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + } + ], + "name": "getSubgraphAllocatedTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getThawingPeriodRange", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getVerifierCutRange", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + } + ], + "name": "indexers", + "outputs": [ + { + "internalType": "uint256", + "name": "registeredAt", + "type": "uint256" + }, + { + "internalType": "string", + "name": "url", + "type": "string" + }, + { + "internalType": "string", + "name": "geoHash", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "uint256", + "name": "minimumProvisionTokens", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "maximumDelegationRatio", + "type": "uint32" + }, + { + "internalType": "uint256", + "name": "stakeToFeesRatio_", + "type": "uint256" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + } + ], + "name": "isOverAllocated", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maxPOIStaleness", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "subgraphDeploymentID", + "type": "bytes32" + } + ], + "name": "migrateLegacyAllocation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "name": "multicall", + "outputs": [ + { + "internalType": "bytes[]", + "name": "results", + "type": "bytes[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "pauseGuardian", + "type": "address" + } + ], + "name": "pauseGuardians", + "outputs": [ + { + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "paused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + } + ], + "name": "paymentsDestination", + "outputs": [ + { + "internalType": "address", + "name": "destination", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "register", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "numClaimsToRelease", + "type": "uint256" + } + ], + "name": "releaseStake", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "resizeAllocation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "curationCut", + "type": "uint256" + } + ], + "name": "setCurationCut", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "delegationRatio", + "type": "uint32" + } + ], + "name": "setDelegationRatio", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "maxPOIStaleness_", + "type": "uint256" + } + ], + "name": "setMaxPOIStaleness", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "minimumProvisionTokens", + "type": "uint256" + } + ], + "name": "setMinimumProvisionTokens", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "pauseGuardian", + "type": "address" + }, + { + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "setPauseGuardian", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "paymentsDestination_", + "type": "address" + } + ], + "name": "setPaymentsDestination", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "stakeToFeesRatio_", + "type": "uint256" + } + ], + "name": "setStakeToFeesRatio", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "slash", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "stakeToFeesRatio", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "startService", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "stopService", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "unpause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "bytecode": "0x61024060405234801561001157600080fd5b5060405161667738038061667783398101604081905261003091610541565b3083838387806001600160a01b03811661007f5760405163218f5add60e11b815260206004820152600a60248201526921b7b73a3937b63632b960b11b60448201526064015b60405180910390fd5b6001600160a01b0381166101005260408051808201909152600a81526923b930b8342a37b5b2b760b11b60208201526100b7906103c5565b6001600160a01b03166080526040805180820190915260078152665374616b696e6760c81b60208201526100ea906103c5565b6001600160a01b031660a05260408051808201909152600d81526c47726170685061796d656e747360981b6020820152610123906103c5565b6001600160a01b031660c05260408051808201909152600e81526d5061796d656e7473457363726f7760901b602082015261015d906103c5565b6001600160a01b031660e05260408051808201909152600c81526b22b837b1b426b0b730b3b2b960a11b6020820152610195906103c5565b6001600160a01b03166101205260408051808201909152600e81526d2932bbb0b93239a6b0b730b3b2b960911b60208201526101d0906103c5565b6001600160a01b0316610140526040805180820190915260118152704772617068546f6b656e4761746577617960781b602082015261020e906103c5565b6001600160a01b03166101605260408051808201909152600f81526e23b930b834283937bc3ca0b236b4b760891b602082015261024a906103c5565b6001600160a01b03166101805260408051808201909152600881526721bab930ba34b7b760c11b602082015261027f906103c5565b6001600160a01b039081166101a08190526101005160a05160805160c05160e05161012051610140516101605161018051604051988b169a9788169996909716977fef5021414834d86e36470f5c1cecf6544fb2bb723f2ca51a4c86fcd8c5919a43976103299790916001600160a01b03978816815295871660208701529386166040860152918516606085015284166080840152831660a083015290911660c082015260e00190565b60405180910390a450506001600160a01b038481166101c08190528482166101e08190528483166102008190529284166102208190526040805193845260208401929092529082019290925260608101919091527f4175b2c37456dbac494e08de8666d31bb8f3f2aee36ea5d9e06894ff3e4ddda79060800160405180910390a1505050506103bc61047360201b60201c565b50505050610605565b600080610100516001600160a01b031663f7641a5e84805190602001206040518263ffffffff1660e01b815260040161040091815260200190565b602060405180830381865afa15801561041d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104419190610595565b9050826001600160a01b03821661046c5760405163218f5add60e11b815260040161007691906105b7565b5092915050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff16156104c35760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b03908116146105225780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b80516001600160a01b038116811461053c57600080fd5b919050565b6000806000806080858703121561055757600080fd5b61056085610525565b935061056e60208601610525565b925061057c60408601610525565b915061058a60608601610525565b905092959194509250565b6000602082840312156105a757600080fd5b6105b082610525565b9392505050565b602081526000825180602084015260005b818110156105e557602081860181015160408684010152016105c8565b506000604082850101526040601f19601f83011684010191505092915050565b60805160a05160c05160e05161010051610120516101405161016051610180516101a0516101c0516101e0516102005161022051615fd961069e6000396000612ee2015260006132de01526000818161163b0152612fe101526000505060005050600050506000505060006137080152600061457c01526000505060005050600050506000611b6b01526000613a640152615fd96000f3fe608060405234801561001057600080fd5b506004361061023b5760003560e01c806307e736d8146102405780630e02292314610280578063138dea081461030857806313c474c9146103205780631dd42f60146103755780631ebb7c301461038a57806324b8fbf6146103af57806335577962146103c25780633f4ba83a146103d557806345f54485146103dd578063482468b7146103f05780634f793cdc1461040657806355c85269146104285780635c975abb146104725780636234e2161461048a5780636ccec5b8146104aa5780636d9a3951146104bd578063715018a61461053857806371ce020a146105405780637aa31bce146105565780637dfe6d28146105695780637e89bac31461057c5780638180083b1461058f578063819ba366146105a257806381e777a7146105b8578063832bc923146105cb5780638456cb59146105de57806384b0196e146105e657806385e82baf146106015780638da5cb5b1461060a5780639384e07814610612578063ac9650d814610635578063b15d2a2c14610655578063ba38f67d14610668578063c0f474971461067b578063c84a5ef314610683578063cb8347fe14610696578063cbe5f3f2146106a9578063ce0fc0cc146106c9578063ce56c98b146106dc578063d07a7a84146106ef578063db9bee46146106f9578063dedf672614610701578063e2e1e8e914610714578063e6f5005414610734578063ebf6ddaf14610747578063ec9c218d1461074f578063eff0f59214610762578063f2fde38b14610797575b600080fd5b61026a61024e36600461502b565b610109602052600090815260409020546001600160a01b031681565b6040516102779190615048565b60405180910390f35b61029361028e36600461502b565b6107aa565b604051610277919060006101208201905060018060a01b0383511682526020830151602083015260408301516040830152606083015160608301526080830151608083015260a083015160a083015260c083015160c083015260e083015160e083015261010083015161010083015292915050565b6103126101085481565b604051908152602001610277565b61035561032e36600461502b565b609c6020526000908152604090208054600182015460028301546003909301549192909184565b604080519485526020850193909352918301526060820152608001610277565b61038861038336600461506e565b610837565b005b600254600160c01b900463ffffffff1660405163ffffffff9091168152602001610277565b6103886103bd3660046150cc565b610850565b6103886103d036600461512e565b610a7d565b610388610a93565b6103886103eb366004615167565b610acf565b6103f8610ad9565b604051610277929190615180565b61041961041436600461502b565b610aec565b604051610277939291906151e7565b61043b61043636600461502b565b610c20565b6040805196151587526001600160a01b039095166020870152938501929092526060840152608083015260a082015260c001610277565b61047a610cdc565b6040519015158152602001610277565b61031261049836600461502b565b60d16020526000908152604090205481565b6103886104b836600461502b565b610cf1565b6105146104cb36600461502b565b604080518082018252600080825260209182018190526001600160a01b03938416815260d082528290208251808401909352805490931682526001909201549181019190915290565b6040805182516001600160a01b031681526020928301519281019290925201610277565b610388610cfb565b610548610d0d565b60405161027792919061521c565b610388610564366004615167565b610d18565b610388610577366004615236565b610d29565b61038861058a366004615167565b610d41565b61038861059d3660046150cc565b610db6565b6105aa610f44565b604051610277929190615277565b6103886105c6366004615236565b610f54565b6103886105d9366004615167565b6110c4565b6103886110d8565b6105ee611112565b6040516102779796959493929190615285565b61031260d25481565b61026a6111bb565b61047a61062036600461502b565b60676020526000908152604090205460ff1681565b61064861064336600461531d565b6111d6565b6040516102779190615392565b6103126106633660046153f7565b6112be565b61047a61067636600461502b565b611492565b61026a6114b0565b61038861069136600461545f565b6114ba565b6103886106a43660046150cc565b611638565b6103126106b736600461502b565b609a6020526000908152604090205481565b6103886106d73660046150cc565b611777565b6103126106ea3660046154a7565b611860565b6103126101075481565b61026a611873565b61038861070f3660046150cc565b61187d565b610312610722366004615167565b600090815260d3602052604090205490565b610388610742366004615167565b611a0b565b61026a611a1c565b61038861075d36600461502b565b611a26565b610355610770366004615167565b609b6020526000908152604090208054600182015460028301546003909301549192909184565b6103886107a536600461502b565b611aa8565b6107b2614fae565b506001600160a01b03908116600090815260cf6020908152604091829020825161012081018452815490941684526001810154918401919091526002810154918301919091526003810154606083015260048101546080830152600581015460a0830152600681015460c0830152600781015460e08301526008015461010082015290565b61083f611ae3565b61084881611b15565b50565b905090565b82610859611b69565b6001600160a01b0316637c145cc78230336040518463ffffffff1660e01b8152600401610888939291906154d5565b602060405180830381865afa1580156108a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108c991906154f8565b813390916108f55760405163cc5d3c8b60e01b81526004016108ec929190615515565b60405180910390fd5b505083600061090382611b8d565b905061090e81611c90565b610919816000611cce565b610921611db8565b6000808061093187890189615646565b925092509250600083511161095957604051630783843960e51b815260040160405180910390fd5b600082511161097b57604051631e63bd9560e21b815260040160405180910390fd5b6001600160a01b03891660009081526101066020526040902054156109b357604051630d06866d60e21b815260040160405180910390fd5b6040805160608101825242815260208082018681528284018690526001600160a01b038d16600090815261010690925292902081518155915190919060018201906109fe9082615742565b5060408201516002820190610a139082615742565b5050506001600160a01b03811615610a2f57610a2f8982611dde565b886001600160a01b03167f159567bea25499a91f60e1fbb349ff2a1f8c1b2883198f25c1e12c99eddb44fa8989604051610a6a929190615800565b60405180910390a2505050505050505050565b610a85611ae3565b610a8f8282611e35565b5050565b3360008181526067602052604090205460ff16610ac4576040516372e3ef9760e01b81526004016108ec9190615048565b50610acd611eeb565b565b6108483382611f37565b600080610ae4611fdd565b915091509091565b6101066020526000908152604090208054600182018054919291610b0f906156c1565b80601f0160208091040260200160405190810160405280929190818152602001828054610b3b906156c1565b8015610b885780601f10610b5d57610100808354040283529160200191610b88565b820191906000526020600020905b815481529060010190602001808311610b6b57829003601f168201915b505050505090806002018054610b9d906156c1565b80601f0160208091040260200160405190810160405280929190818152602001828054610bc9906156c1565b8015610c165780601f10610beb57610100808354040283529160200191610c16565b820191906000526020600020905b815481529060010190602001808311610bf957829003601f168201915b5050505050905083565b6001600160a01b03808216600090815260cf60209081526040808320815161012081018352815490951685526001810154928501929092526002820154908401526003810154606084015260048101546080840152600581015460a0840152600681015460c0840152600781015460e0840152600801546101008301529081908190819081908190610cb181612054565b81516020830151604084015160c085015160e090950151939c929b5090995097509195509350915050565b600080610ce7612073565b5460ff1692915050565b6108483382611dde565b610d03611ae3565b610acd6000612097565b600080610ae46120f3565b610d20611ae3565b6108488161216a565b610d31611ae3565b610d3c83838361219f565b505050565b610d49611ae3565b610d5681620f4240101590565b8190610d7857604051631c9c717b60e01b81526004016108ec91815260200190565b506101088190556040518181527f6deef78ffe3df79ae5cd8e40b842c36ac6077e13746b9b68a9f327537b01e4e9906020015b60405180910390a150565b82610dbf611b69565b6001600160a01b0316637c145cc78230336040518463ffffffff1660e01b8152600401610dee939291906154d5565b602060405180830381865afa158015610e0b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e2f91906154f8565b81339091610e525760405163cc5d3c8b60e01b81526004016108ec929190615515565b50506001600160a01b0384166000908152610106602052604090205484908190610e905760405163ee27189960e01b81526004016108ec9190615048565b50610e99611db8565b6000610ea78486018661502b565b90506001600160a01b038616610ebe60cf836121f2565b51879183916001600160a01b031614610eec5760405163c0bbff1360e01b81526004016108ec929190615515565b5050610ef9816000612277565b856001600160a01b03167f73330c218a680717e9eee625c262df66eddfdf99ecb388d25f6b32d66b9a318a8686604051610f34929190615800565b60405180910390a2505050505050565b600080610ae46000546001549091565b82610f5d611b69565b6001600160a01b0316637c145cc78230336040518463ffffffff1660e01b8152600401610f8c939291906154d5565b602060405180830381865afa158015610fa9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fcd91906154f8565b81339091610ff05760405163cc5d3c8b60e01b81526004016108ec929190615515565b5050836000610ffe82611b8d565b905061100981611c90565b611014816000611cce565b6001600160a01b03861660009081526101066020526040902054869081906110505760405163ee27189960e01b81526004016108ec9190615048565b50611059611db8565b6001600160a01b03871661106e60cf886121f2565b51889188916001600160a01b03161461109c5760405163c0bbff1360e01b81526004016108ec929190615515565b50506110bb8686600260189054906101000a900463ffffffff166123d9565b50505050505050565b6110cc611ae3565b610848816000196126d7565b3360008181526067602052604090205460ff16611109576040516372e3ef9760e01b81526004016108ec9190615048565b50610acd612746565b600060608060008060006060600061112861278d565b805490915015801561113c57506001810154155b6111805760405162461bcd60e51b81526020600482015260156024820152741152540dcc4c8e88155b9a5b9a5d1a585b1a5e9959605a1b60448201526064016108ec565b6111886127b1565b611190612852565b60408051600080825260208201909252600f60f81b9c939b5091995046985030975095509350915050565b6000806111c661286f565b546001600160a01b031692915050565b604080516000815260208101909152606090826001600160401b038111156112005761120061552f565b60405190808252806020026020018201604052801561123357816020015b606081526020019060019003908161121e5790505b50915060005b838110156112b5576112903086868481811061125757611257615858565b9050602002810190611269919061586e565b8560405160200161127c939291906158b4565b604051602081830303815290604052612893565b8382815181106112a2576112a2615858565b6020908102919091010152600101611239565b50505b92915050565b6000846112c9611b69565b6001600160a01b0316637c145cc78230336040518463ffffffff1660e01b81526004016112f8939291906154d5565b602060405180830381865afa158015611315573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061133991906154f8565b8133909161135c5760405163cc5d3c8b60e01b81526004016108ec929190615515565b505085600061136a82611b8d565b905061137581611c90565b611380816000611cce565b6001600160a01b03881660009081526101066020526040902054889081906113bc5760405163ee27189960e01b81526004016108ec9190615048565b506113c5611db8565b6000808960028111156113da576113da6158db565b036113f1576113ea8a8989612909565b9050611430565b6002896002811115611405576114056158db565b03611415576113ea8a8989612e1d565b8860405163047031cf60e41b81526004016108ec9190615913565b886002811115611442576114426158db565b8a6001600160a01b03167f54fe682bfb66381a9382e13e4b95a3dd4f960eafbae063fdea3539d144ff3ff58360405161147d91815260200190565b60405180910390a39998505050505050505050565b60006112b882600260189054906101000a900463ffffffff16612ec1565b600061084b612ee0565b60006114c4612f04565b805490915060ff600160401b82041615906001600160401b03166000811580156114eb5750825b90506000826001600160401b031660011480156115075750303b155b905081158015611515575080155b156115335760405163f92ee8a960e01b815260040160405180910390fd5b84546001600160401b0319166001178555831561155c57845460ff60401b1916600160401b1785555b61156589612f2d565b61156d612f3e565b611575612f46565b61157d612f5e565b6115c96040518060400160405280600f81526020016e53756267726170685365727669636560881b815250604051806040016040528060038152602001620312e360ec1b815250612f6e565b6115d5886000196126d7565b6115de87611b15565b6115e786612f88565b831561162d57845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b505050505050505050565b337f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03811682146116855760405163cdc0567f60e01b81526004016108ec929190615515565b50600090508061169783850185615921565b915091506116a3611b69565b6001600160a01b031663e76fede68684846116bc612fdf565b60405160e086901b6001600160e01b03191681526001600160a01b039485166004820152602481019390935260448301919091529091166064820152608401600060405180830381600087803b15801561171557600080fd5b505af1158015611729573d6000803e3d6000fd5b50505050846001600160a01b03167f02f2e74a11116e05b39159372cceb6739257b08d72f7171d208ff27bb6466c588360405161176891815260200190565b60405180910390a25050505050565b82611780611b69565b6001600160a01b0316637c145cc78230336040518463ffffffff1660e01b81526004016117af939291906154d5565b602060405180830381865afa1580156117cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117f091906154f8565b813390916118135760405163cc5d3c8b60e01b81526004016108ec929190615515565b505061181d611db8565b61182684613003565b6040516001600160a01b038516907ff53cf6521a1b5fc0c04bffa70374a4dc2e3474f2b2ac1643c3bcc54e2db4a93990600090a250505050565b600061186c8383613076565b9392505050565b600061084b612fdf565b82611886611b69565b6001600160a01b0316637c145cc78230336040518463ffffffff1660e01b81526004016118b5939291906154d5565b602060405180830381865afa1580156118d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118f691906154f8565b813390916119195760405163cc5d3c8b60e01b81526004016108ec929190615515565b505083600061192782611b8d565b905061193281611c90565b61193d816000611cce565b6001600160a01b03861660009081526101066020526040902054869081906119795760405163ee27189960e01b81526004016108ec9190615048565b50611982611db8565b6000808080611993898b018b615943565b93509350935093506119bb8b83868685600260189054906101000a900463ffffffff166130e5565b8a6001600160a01b03167fd3803eb82ef5b4cdff8646734ebbaf5b37441e96314b27ffd3d0940f12a038e78b8b6040516119f6929190615800565b60405180910390a25050505050505050505050565b611a13611ae3565b61084881612f88565b600061084b6132dc565b611a2e611db8565b6000611a3b60cf836121f2565b9050611a5260d2548261330090919063ffffffff16565b8290611a7157604051623477b560e51b81526004016108ec9190615048565b50611a7b8161333d565b158290611a9c576040516317c7b35d60e31b81526004016108ec9190615048565b50610a8f826001612277565b611ab0611ae3565b6001600160a01b038116611ada576000604051631e4fbdf760e01b81526004016108ec9190615048565b61084881612097565b33611aec6111bb565b6001600160a01b031614610acd573360405163118cdaa760e01b81526004016108ec9190615048565b6002805463ffffffff60c01b1916600160c01b63ffffffff8416908102919091179091556040519081527f472aba493f9fd1d136ec54986f619f3aa5caff964f0e731a9909fb9a1270211f90602001610dab565b7f000000000000000000000000000000000000000000000000000000000000000090565b6040805161014081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101829052610120810182905290611be6611b69565b6001600160a01b03166325d9897e84306040518363ffffffff1660e01b8152600401611c13929190615515565b61014060405180830381865afa158015611c31573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c5591906159d0565b90508060a001516001600160401b0316600014158390611c8957604051637b3c09bf60e01b81526004016108ec9190615048565b5092915050565b6020810151815161084891611ca491615845565b60005460015460405180604001604052806006815260200165746f6b656e7360d01b81525061335c565b600080611cd96120f3565b91509150600083611cee578460800151611cf4565b8460e001515b9050611d42816001600160401b0316846001600160401b0316846001600160401b03166040518060400160405280600d81526020016c1d1a185dda5b99d4195c9a5bd9609a1b81525061335c565b600080611d4d611fdd565b91509150600086611d62578760600151611d68565b8760c001515b9050611dae8163ffffffff168463ffffffff168463ffffffff166040518060400160405280600e81526020016d1b585e15995c9a599a595c90dd5d60921b81525061335c565b5050505050505050565b611dc0610cdc565b15610acd5760405163d93c066560e01b815260040160405180910390fd5b6001600160a01b038281166000818152610109602052604080822080546001600160a01b0319169486169485179055517e3215dc05a2fc4e6a1e2c2776311d207c730ee51085aae221acc5cbe6fb55c19190a35050565b6001600160a01b0382166000908152606760205260409020548290829060ff161515811514611e8a57604051635e67e54b60e01b81526001600160a01b039092166004830152151560248201526044016108ec565b50506001600160a01b038216600081815260676020908152604091829020805460ff191685151590811790915591519182527fa95bac2f3df0d40e8278281c1d39d53c60e4f2bf3550ca5665738d0916e89789910160405180910390a25050565b611ef3613390565b6000611efd612073565b805460ff1916815590507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b604051610dab9190615048565b6001600160a01b0382166000818152609c60209081526040808320815192830184905282820194909452805180830382018152606090920190528190611f8b9084906133b5906133ca906134c590896134ea565b91509150846001600160a01b03167f13f3fa9f0e54af1af76d8b5d11c3973d7c2aed6312b61efff2f7b49d73ad67eb8383806020019051810190611fcf9190615a7d565b604051611768929190615277565b600080611fe8612fdf565b6001600160a01b031663bb2a2b476040518163ffffffff1660e01b8152600401602060405180830381865afa158015612025573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120499190615a96565b92620f424092509050565b60006120638260600151151590565b80156112b8575050608001511590565b7fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f0330090565b60006120a161286f565b80546001600160a01b038481166001600160a01b031983168117845560405193945091169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b6000806000612100612fdf565b6001600160a01b0316635aea0ec46040518163ffffffff1660e01b8152600401602060405180830381865afa15801561213d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121619190615ab3565b93849350915050565b60d28190556040518181527f21774046e2611ddb52c8c46e1ad97524eeb2e3fda7dcd9428867868b4c4d06ba90602001610dab565b6121ac60d08484846135a4565b80826001600160a01b0316846001600160a01b03167fd54c7abc930f6d506da2d08aa7aead4f2443e1db6d5f560384a2f652ff893e1960405160405180910390a4505050565b6121fa614fae565b6122048383613653565b604080516101208101825282546001600160a01b03168152600183015460208201526002830154918101919091526003820154606082015260048201546080820152600582015460a0820152600682015460c0820152600782015460e08201526008909101546101008201529392505050565b600061228460cf846121f2565b905061230f83612292613706565b6001600160a01b031663eeac3e0e84602001516040518263ffffffff1660e01b81526004016122c391815260200190565b6020604051808303816000875af11580156122e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123069190615a7d565b60cf919061372a565b61231a60cf846137dd565b8051604082015161232d9160d191613893565b806040015160d3600083602001518152602001908152602001600020546123549190615845565b60d3600083602001518152602001908152602001600020819055508060200151836001600160a01b031682600001516001600160a01b03167f08f2f865e0fb62d722a51e4d9873199bf6bf52e7d8ee5a2ee2896c9ef719f5458460400151866040516123cc9291909182521515602082015260400190565b60405180910390a4505050565b60006123e660cf856121f2565b90506123f181612054565b849061241157604051631eb5ff9560e01b81526004016108ec9190615048565b5080604001518314158484909161243d5760405163f32518cd60e01b81526004016108ec929190615ad0565b50506040810151808411156124735761246e612457611b69565b83516124638488615845565b60d192919087613911565b61248c565b815161248c906124838684615845565b60d19190613893565b6000612496613706565b6001600160a01b031663eeac3e0e84602001516040518263ffffffff1660e01b81526004016124c791815260200190565b6020604051808303816000875af11580156124e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061250a9190615a7d565b905060006125178461333d565b15612523576000612532565b60c08401516125329083615845565b6001600160a01b038816600090815260cf60205260409020600281018890556006018390559050612561613706565b6001600160a01b031663c8a5f81e84836040518363ffffffff1660e01b815260040161258e929190615277565b602060405180830381865afa1580156125ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125cf9190615a7d565b6001600160a01b038816600090815260cf6020526040812060070180549091906125fa908490615ae9565b909155505082861115612642576126118387615845565b60d360008660200151815260200190815260200160002060008282546126379190615ae9565b909155506126789050565b61264c8684615845565b60d360008660200151815260200190815260200160002060008282546126729190615845565b90915550505b8360200151876001600160a01b031685600001516001600160a01b03167f6db4a6f9be2d5e72eb2a2af2374ac487971bf342a261ba0bc1cf471bf2a2c31f89876040516126c6929190615277565b60405180910390a450505050505050565b8181808211156126fc5760405163ccccdafb60e01b81526004016108ec929190615277565b5050600082905560018190556040517f90699b8b4bf48918fea1129c85f9bc7b51285df7ecc982910813c7805f5688499061273a9084908490615277565b60405180910390a15050565b61274e611db8565b6000612758612073565b805460ff1916600117815590507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611f2a3390565b7fa16a46d94261c7517cc8ff89f61c0ce93598e3c849801011dee649a6a557d10090565b606060006127bd61278d565b90508060020180546127ce906156c1565b80601f01602080910402602001604051908101604052809291908181526020018280546127fa906156c1565b80156128475780601f1061281c57610100808354040283529160200191612847565b820191906000526020600020905b81548152906001019060200180831161282a57829003601f168201915b505050505091505090565b6060600061285e61278d565b90508060030180546127ce906156c1565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930090565b6060600080846001600160a01b0316846040516128b09190615afc565b600060405180830381855af49150503d80600081146128eb576040519150601f19603f3d011682016040523d82523d6000602084013e6128f0565b606091505b5091509150612900858383613a0f565b95945050505050565b6000808061291984860186615b3a565b8151604001519193509150866001600160a01b038281169082161461295357604051631a071d0760e01b81526004016108ec929190615515565b50508151516001600160a01b038111156129835760405163fa4ac7a760e01b81526004016108ec91815260200190565b50815151600061299460cf836121f2565b805190915088906001600160a01b03818116908316146129c957604051634508fbf760e11b81526004016108ec929190615515565b505060208101516129db896000611f37565b60008060006129e8613a62565b6001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401612a139190615048565b602060405180830381865afa158015612a30573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a549190615a7d565b9050612a5e6132dc565b6001600160a01b031663692209ce6000612afc8b612a7a612ee0565b6001600160a01b0316634c4ea0ed8a6040518263ffffffff1660e01b8152600401612aa791815260200190565b602060405180830381865afa158015612ac4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ae891906154f8565b612af3576000613a86565b61010854613a86565b8a6040518463ffffffff1660e01b8152600401612b1b93929190615c71565b6020604051808303816000875af1158015612b3a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b5e9190615a7d565b92506000612b6a613a62565b6001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401612b959190615048565b602060405180830381865afa158015612bb2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bd69190615a7d565b9050818181811015612bfd57604051639db8bc9560e01b81526004016108ec929190615277565b50612c0a90508282615845565b92505082159050612db457612ca98b6101075484612c289190615ca1565b612c30612fdf565b6001600160a01b0316635aea0ec46040518163ffffffff1660e01b8152600401602060405180830381865afa158015612c6d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c919190615ab3565b612ca4906001600160401b031642615ae9565b613ada565b8015612db457612cb7613706565b6001600160a01b0316631d1c2fec846040518263ffffffff1660e01b8152600401612ce491815260200190565b6020604051808303816000875af1158015612d03573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d279190615a7d565b50612d4c612d33612ee0565b82612d3c613a62565b6001600160a01b03169190613c4a565b612d54612ee0565b6001600160a01b0316638157328884836040518363ffffffff1660e01b8152600401612d81929190615277565b600060405180830381600087803b158015612d9b57600080fd5b505af1158015612daf573d6000803e3d6000fd5b505050505b86516020908101516040805186815292830185905282018390526001600160a01b038088169291811691908e16907f184c452047299395d4f7f147eb8e823458a450798539be54aeed978f13d87ba29060600160405180910390a4509998505050505050505050565b6000808080612e2e85870187615cb8565b919450925090506001600160a01b038716612e4a60cf856121f2565b51889185916001600160a01b031614612e785760405163c0bbff1360e01b81526004016108ec929190615515565b50506002546001600160a01b0388811660009081526101096020526040902054612eb692869286928692600160c01b900463ffffffff169116613cf9565b979650505050505050565b6000612ed8612ece611b69565b60d19085856142d6565b159392505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b6000807ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a006112b8565b612f35614370565b61084881614395565b610acd614370565b612f4e614370565b612f5661439d565b610acd612f3e565b612f66614370565b612f56612f3e565b612f76614370565b612f8082826143df565b610a8f612f3e565b80600003612fa95760405163bc71a04360e01b815260040160405180910390fd5b6101078190556040518181527f2aaaf20b08565eebc0c962cd7c568e54c3c0c2b85a1f942b82cd1bd730fdcd2390602001610dab565b7f000000000000000000000000000000000000000000000000000000000000000090565b61300e8160016143f1565b613016611b69565b6001600160a01b0316633a78b732826040518263ffffffff1660e01b81526004016130419190615048565b600060405180830381600087803b15801561305b57600080fd5b505af115801561306f573d6000803e3d6000fd5b5050505050565b600061186c7f4bdee85c4b4a268f4895d1096d553c3e57bb2433c380e7b7ec8cb56cc4f7467384846040516020016130ca939291909283526001600160a01b03918216602084015216604082015260600190565b60405160208183030381529060405280519060200120614408565b6001600160a01b03851661310c57604051634ffdf5ef60e11b815260040160405180910390fd5b613117868684614435565b61312b613122611b69565b60d09087614484565b600061313561457a565b6001600160a01b031663766718086040518163ffffffff1660e01b8152600401602060405180830381865afa158015613172573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131969190615a7d565b90506000613226888888886131a9613706565b6001600160a01b031663eeac3e0e8c6040518263ffffffff1660e01b81526004016131d691815260200190565b6020604051808303816000875af11580156131f5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132199190615a7d565b60cf94939291908861459e565b905061323e613233611b69565b60d1908a8887613911565b806040015160d3600083602001518152602001908152602001600020546132659190615ae9565b60d36000836020015181526020019081526020016000208190555085876001600160a01b0316896001600160a01b03167fe5e185fab2b992c4727ff702a867d78b15fb176dbaa20c9c312a1c351d3f7f838460400151866040516132ca929190615277565b60405180910390a45050505050505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b60008061331584606001518560a00151614706565b61331f9042615845565b905061332a84612054565b801561333557508281115b949350505050565b600061334c8260600151151590565b80156112b8575050604001511590565b613367848484614716565b8185858590919293611dae57604051630871e13d60e01b81526004016108ec9493929190615d10565b613398610cdc565b610acd57604051638dfc202b60e01b815260040160405180910390fd5b6000908152609b602052604090206003015490565b6000606060006133d98561472d565b90504281604001511115613401575050604080516020810190915260008152600191506134be565b600080858060200190518101906134189190615d3f565b8451919350915061342d90609a908390613893565b86816001600160a01b03167f4c06b68820628a39c787d2db1faa0eeacd7b9474847b198b1e871fe6e5b93f4485600001518660400151604051613471929190615277565b60405180910390a382516134859083615ae9565b6040805160208101929092526001600160a01b038316908201526060016040516020818303038152906040529550600086945094505050505b9250929050565b6000908152609b60205260408120818155600181018290556002810182905560030155565b60006060876003015483111561351357604051634a411b9d60e11b815260040160405180910390fd5b600083156135215783613527565b88600301545b89549094505b801580159061353c5750600085115b156135955760008061355283898c63ffffffff16565b915091508115613563575050613595565b9650866135718c8c8b6147bb565b92508661357d81615d65565b975050838061358b90615d7c565b945050505061352d565b50989397509295505050505050565b6001600160a01b0380831660009081526020868152604091829020825180840190935280549093168252600190920154918101919091526135e490614842565b15829061360557604051632d7d25f160e21b81526004016108ec9190615048565b506040805180820182526001600160a01b0394851681526020808201938452938516600090815295909352909320905181546001600160a01b03191692169190911781559051600190910155565b6001600160a01b03808216600090815260208481526040808320815161012081018352815490951685526001810154928501929092526002820154908401526003810154606084015260048101546080840152600581015460a0840152600681015460c0840152600781015460e0840152600881015461010084015290916136de9060600151151590565b83906136fe576040516342daadaf60e01b81526004016108ec9190615048565b509392505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b60006137368484613653565b604080516101208101825282546001600160a01b03168152600183015460208201526002830154918101919091526003820154606082015260048201546080820152600582015460a0820152600682015460c0820152600782015460e082015260088201546101008201529091506137ad90612054565b600482015484916137d3576040516361b66e0d60e01b81526004016108ec929190615ad0565b5050600601555050565b60006137e98383613653565b604080516101208101825282546001600160a01b03168152600183015460208201526002830154918101919091526003820154606082015260048201546080820152600582015460a0820152600682015460c0820152600782015460e0820152600882015461010082015290915061386090612054565b60048201548391613886576040516361b66e0d60e01b81526004016108ec929190615ad0565b5050426004909101555050565b806000036138a057505050565b6001600160a01b03821660009081526020849052604090205481808210156138dd57604051635f8ec70960e01b81526004016108ec929190615277565b50506001600160a01b03821660009081526020849052604081208054839290613907908490615845565b9091555050505050565b811561306f576001600160a01b03831660009081526020869052604081205461393b908490615ae9565b90506000856001600160a01b031663872d04898630866040518463ffffffff1660e01b815260040161396f93929190615d95565b602060405180830381865afa15801561398c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906139b09190615a7d565b90508082818111156139d757604051635f8ec70960e01b81526004016108ec929190615277565b50506001600160a01b03851660009081526020889052604081208054869290613a01908490615ae9565b909155505050505050505050565b606082613a2457613a1f82614851565b61186c565b8151158015613a3b57506001600160a01b0384163b155b15613a5b5783604051639996b31560e01b81526004016108ec9190615048565b508061186c565b7f000000000000000000000000000000000000000000000000000000000000000090565b81516040908101516001600160a01b039081166000908152610109602090815290839020549251606093613ac39387938793929091169101615dbe565b604051602081830303815290604052905092915050565b81600003613afb57604051638f4c63d960e01b815260040160405180910390fd5b613b27613b06611b69565b600254609a91908690869063ffffffff600160c01b90910481169061391116565b6001600160a01b0383166000908152609c6020908152604080832060028082015483516001600160601b031930606090811b8216838901528b901b166034820152604880820192909252845180820390920182526068810180865282519287019290922060e882018652898352426088830190815260a883018a815260c8909301898152828a52609b909852959097209151825593516001820155925190830155915160039182015581015490919015613bf55760018201546000908152609b602052604090206003018190555b613bff828261487a565b80856001600160a01b03167f5d9e2c5278e41138269f5f980cfbea016d8c59816754502abc4d2f87aaea987f8686604051613c3b929190615277565b60405180910390a35050505050565b8015610d3c5760405163a9059cbb60e01b81526001600160a01b0384169063a9059cbb90613c7e9085908590600401615ad0565b6020604051808303816000875af1158015613c9d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613cc191906154f8565b610d3c5760405162461bcd60e51b815260206004820152600960248201526810ba3930b739b332b960b91b60448201526064016108ec565b600080613d0760cf886121f2565b9050613d1281612054565b8790613d3257604051631eb5ff9560e01b81526004016108ec9190615048565b506000613d4a60d2548361330090919063ffffffff16565b158015613d5d5750613d5b8261333d565b155b8015613d6857508615155b8015613de05750816101000151613d7d61457a565b6001600160a01b031663766718086040518163ffffffff1660e01b8152600401602060405180830381865afa158015613dba573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613dde9190615a7d565b115b613deb576000613e61565b613df3613706565b6001600160a01b031663db750926896040518263ffffffff1660e01b8152600401613e1e9190615048565b6020604051808303816000875af1158015613e3d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613e619190615a7d565b9050613ea088613e6f613706565b6001600160a01b031663eeac3e0e85602001516040518263ffffffff1660e01b81526004016122c391815260200190565b613eab60cf8961490d565b613eb660cf896149c3565b60008082156141ef576000613ec9611b69565b8551604051637573ef4f60e01b81526001600160a01b039290921691637573ef4f91613efc913090600290600401615e87565b602060405180830381865afa158015613f19573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613f3d9190615a7d565b90506000613f49611b69565b8651604051631584a17960e21b81526001600160a01b03929092169163561285e491613f79913090600401615515565b60a060405180830381865afa158015613f96573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613fba9190615eac565b90506000816020015111613fcf576000613fd9565b613fd98583614a7a565b925082156140ce57613fe9613a62565b6001600160a01b031663095ea7b3613fff611b69565b856040518363ffffffff1660e01b815260040161401d929190615ad0565b6020604051808303816000875af115801561403c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061406091906154f8565b50614069611b69565b865160405163ca94b0e960e01b81526001600160a01b03929092169163ca94b0e99161409b9130908890600401615f1f565b600060405180830381600087803b1580156140b557600080fd5b505af11580156140c9573d6000803e3d6000fd5b505050505b6140d88386615845565b935083156141ec576001600160a01b0388166141df576140f6613a62565b6001600160a01b031663095ea7b361410c611b69565b866040518363ffffffff1660e01b815260040161412a929190615ad0565b6020604051808303816000875af1158015614149573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061416d91906154f8565b50614176611b69565b8651604051633a30904960e11b81526001600160a01b0392909216916374612092916141a89130908990600401615f1f565b600060405180830381600087803b1580156141c257600080fd5b505af11580156141d6573d6000803e3d6000fd5b505050506141ec565b6141ec8885612d3c613a62565b50505b602084015184516001600160a01b03808d1691167f443f56bd2098d273b8c8120398789a41da5925db4ba2f656813fc5299ac57b1f8686868f8f61423161457a565b6001600160a01b031663766718086040518163ffffffff1660e01b8152600401602060405180830381865afa15801561426e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906142929190615a7d565b6040516142a496959493929190615f43565b60405180910390a483516142b89088612ec1565b156142c8576142c88a6001612277565b509098975050505050505050565b600080846001600160a01b031663872d04898530866040518463ffffffff1660e01b815260040161430993929190615d95565b602060405180830381865afa158015614326573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061434a9190615a7d565b6001600160a01b0385166000908152602088905260409020541115915050949350505050565b614378614ada565b610acd57604051631afcd79f60e31b815260040160405180910390fd5b611ab0614370565b6143a5614370565b6143b260006000196126d7565b6143c06000620f4240614af4565b6143d260006001600160401b03614bc5565b610acd63ffffffff611b15565b6143e7614370565b610a8f8282614c52565b60006143fc83611b8d565b9050610d3c8183611cce565b60006112b8614415614c93565b8360405161190160f01b8152600281019290925260228201526042902090565b600061444a6144448585613076565b83614c9d565b905080836001600160a01b038083169082161461447c57604051638c5b935d60e01b81526004016108ec929190615515565b505050505050565b6001600160a01b0380821660009081526020858152604091829020825180840190935280549093168252600190920154918101919091526144c490614842565b1581906144e557604051632d7d25f160e21b81526004016108ec9190615048565b506040516378eb06b360e11b81526001600160a01b0383169063f1d60d6690614512908490600401615048565b602060405180830381865afa15801561452f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061455391906154f8565b15819061457457604051632d7d25f160e21b81526004016108ec9190615048565b50505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b6145a6614fae565b6001600160a01b03808716600090815260208a8152604091829020825161012081018452815490941684526001810154918401919091526002810154918301919091526003810154606083015260048101546080830152600581015460a0830152600681015460c0830152600781015460e0830152600801546101008201526146329060600151151590565b15869061465357604051630bc4def560e01b81526004016108ec9190615048565b505060408051610120810182526001600160a01b0397881681526020808201968752818301958652426060830190815260006080840181815260a0850182815260c0860198895260e0860183815261010087019889529b8d1683529c90935293909320825181546001600160a01b0319169a169990991789559551600189015593516002880155516003870155925160048601559451600585015593516006840155905160078301555160089091015590565b600082821882841102821861186c565b600082841015801561333557505090911115919050565b61475b6040518060800160405280600081526020016000815260200160008152602001600080191681525090565b6000828152609b602090815260409182902082516080810184528154815260018201549281018390526002820154938101939093526003015460608301528390611c895760405163107349a960e21b81526004016108ec91815260200190565b6000808460030154116147e15760405163ddaf8f2160e01b815260040160405180910390fd5b60006147f485600001548563ffffffff16565b905061480785600001548463ffffffff16565b600185600301600082825461481c9190615845565b9091555050808555600385015460000361483857600060018601555b5050915492915050565b516001600160a01b0316151590565b8051156148615780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b6127108260030154106148a0576040516303a8c56b60e61b815260040160405180910390fd5b806148be57604051638f4a893d60e01b815260040160405180910390fd5b60018083018290556002830180546000906148da908490615ae9565b909155505060038201546000036148ef578082555b60018260030160008282546149049190615ae9565b90915550505050565b60006149198383613653565b604080516101208101825282546001600160a01b03168152600183015460208201526002830154918101919091526003820154606082015260048201546080820152600582015460a0820152600682015460c0820152600782015460e0820152600882015461010082015290915061499090612054565b600482015483916149b6576040516361b66e0d60e01b81526004016108ec929190615ad0565b5050426005909101555050565b60006149cf8383613653565b604080516101208101825282546001600160a01b03168152600183015460208201526002830154918101919091526003820154606082015260048201546080820152600582015460a0820152600682015460c0820152600782015460e08201526008820154610100820152909150614a4690612054565b60048201548391614a6c576040516361b66e0d60e01b81526004016108ec929190615ad0565b505060006007909101555050565b6000614a8983620f4240101590565b80614a9c5750614a9c82620f4240101590565b83839091614abf5760405163768bf0eb60e11b81526004016108ec929190615277565b50620f42409050614ad08385615ca1565b61186c9190615f81565b6000614ae4612f04565b54600160401b900460ff16919050565b818163ffffffff8082169083161115614b225760405163ccccdafb60e01b81526004016108ec929190615180565b508290508163ffffffff8116620f42401015614b535760405163ccccdafb60e01b81526004016108ec929190615180565b50506002805463ffffffff838116600160a01b0263ffffffff60a01b19918616600160801b0291909116600160801b600160c01b0319909216919091171790556040517f2fe5a7039987697813605cc0b9d6db7aab575408e3fc59e8a457bef8d7bc0a369061273a9084908490615180565b81816001600160401b038082169083161115614bf65760405163ccccdafb60e01b81526004016108ec92919061521c565b5050600280546001600160401b03838116600160401b026001600160801b0319909216908516171790556040517f2867e04c500e438761486b78021d4f9eb97c77ff45d10c1183f5583ba4cbf7d19061273a908490849061521c565b614c5a614370565b6000614c6461278d565b905060028101614c748482615742565b5060038101614c838382615742565b5060008082556001909101555050565b600061084b614cc7565b600080600080614cad8686614d3b565b925092509250614cbd8282614d88565b5090949350505050565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f614cf2614e41565b614cfa614ea8565b60408051602081019490945283019190915260608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b60008060008351604103614d755760208401516040850151606086015160001a614d6788828585614ee9565b955095509550505050614d81565b50508151600091506002905b9250925092565b6000826003811115614d9c57614d9c6158db565b03614da5575050565b6001826003811115614db957614db96158db565b03614dd75760405163f645eedf60e01b815260040160405180910390fd5b6002826003811115614deb57614deb6158db565b03614e0c5760405163fce698f760e01b8152600481018290526024016108ec565b6003826003811115614e2057614e206158db565b03610a8f576040516335e2f38360e21b8152600481018290526024016108ec565b600080614e4c61278d565b90506000614e586127b1565b805190915015614e7057805160209091012092915050565b81548015614e7f579392505050565b7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470935050505090565b600080614eb361278d565b90506000614ebf612852565b805190915015614ed757805160209091012092915050565b60018201548015614e7f579392505050565b600080806fa2a8918ca85bafe22016d0b997e4df60600160ff1b03841115614f1a5750600091506003905082614fa4565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa158015614f6e573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116614f9a57506000925060019150829050614fa4565b9250600091508190505b9450945094915050565b60405180610120016040528060006001600160a01b0316815260200160008019168152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b6001600160a01b038116811461084857600080fd5b803561502681615006565b919050565b60006020828403121561503d57600080fd5b813561186c81615006565b6001600160a01b0391909116815260200190565b63ffffffff8116811461084857600080fd5b60006020828403121561508057600080fd5b813561186c8161505c565b60008083601f84011261509d57600080fd5b5081356001600160401b038111156150b457600080fd5b6020830191508360208285010111156134be57600080fd5b6000806000604084860312156150e157600080fd5b83356150ec81615006565b925060208401356001600160401b0381111561510757600080fd5b6151138682870161508b565b9497909650939450505050565b801515811461084857600080fd5b6000806040838503121561514157600080fd5b823561514c81615006565b9150602083013561515c81615120565b809150509250929050565b60006020828403121561517957600080fd5b5035919050565b63ffffffff92831681529116602082015260400190565b60005b838110156151b257818101518382015260200161519a565b50506000910152565b600081518084526151d3816020860160208601615197565b601f01601f19169290920160200192915050565b83815260606020820152600061520060608301856151bb565b828103604084015261521281856151bb565b9695505050505050565b6001600160401b0392831681529116602082015260400190565b60008060006060848603121561524b57600080fd5b833561525681615006565b9250602084013561526681615006565b929592945050506040919091013590565b918252602082015260400190565b60ff60f81b8816815260e0602082015260006152a460e08301896151bb565b82810360408401526152b681896151bb565b606084018890526001600160a01b038716608085015260a0840186905283810360c08501528451808252602080870193509091019060005b8181101561530c5783518352602093840193909201916001016152ee565b50909b9a5050505050505050505050565b6000806020838503121561533057600080fd5b82356001600160401b0381111561534657600080fd5b8301601f8101851361535757600080fd5b80356001600160401b0381111561536d57600080fd5b8560208260051b840101111561538257600080fd5b6020919091019590945092505050565b6000602082016020835280845180835260408501915060408160051b86010192506020860160005b828110156153eb57603f198786030184526153d68583516151bb565b945060209384019391909101906001016153ba565b50929695505050505050565b6000806000806060858703121561540d57600080fd5b843561541881615006565b935060208501356003811061542c57600080fd5b925060408501356001600160401b0381111561544757600080fd5b6154538782880161508b565b95989497509550505050565b6000806000806080858703121561547557600080fd5b843561548081615006565b93506020850135925060408501356154978161505c565b9396929550929360600135925050565b600080604083850312156154ba57600080fd5b82356154c581615006565b9150602083013561515c81615006565b6001600160a01b0393841681529183166020830152909116604082015260600190565b60006020828403121561550a57600080fd5b815161186c81615120565b6001600160a01b0392831681529116602082015260400190565b634e487b7160e01b600052604160045260246000fd5b60405161014081016001600160401b03811182821017156155685761556861552f565b60405290565b604080519081016001600160401b03811182821017156155685761556861552f565b60405160e081016001600160401b03811182821017156155685761556861552f565b600082601f8301126155c357600080fd5b8135602083016000806001600160401b038411156155e3576155e361552f565b50604051601f19601f85018116603f011681018181106001600160401b03821117156156115761561161552f565b60405283815290508082840187101561562957600080fd5b838360208301376000602085830101528094505050505092915050565b60008060006060848603121561565b57600080fd5b83356001600160401b0381111561567157600080fd5b61567d868287016155b2565b93505060208401356001600160401b0381111561569957600080fd5b6156a5868287016155b2565b92505060408401356156b681615006565b809150509250925092565b600181811c908216806156d557607f821691505b6020821081036156f557634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115610d3c57806000526020600020601f840160051c810160208510156157225750805b601f840160051c820191505b8181101561306f576000815560010161572e565b81516001600160401b0381111561575b5761575b61552f565b61576f8161576984546156c1565b846156fb565b6020601f8211600181146157a3576000831561578b5750848201515b600019600385901b1c1916600184901b17845561306f565b600084815260208120601f198516915b828110156157d357878501518255602094850194600190920191016157b3565b50848210156157f15786840151600019600387901b60f8161c191681555b50505050600190811b01905550565b60208152816020820152818360408301376000818301604090810191909152601f909201601f19160101919050565b634e487b7160e01b600052601160045260246000fd5b818103818111156112b8576112b861582f565b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261588557600080fd5b8301803591506001600160401b0382111561589f57600080fd5b6020019150368190038213156134be57600080fd5b8284823760008382016000815283516158d1818360208801615197565b0195945050505050565b634e487b7160e01b600052602160045260246000fd5b6003811061590f57634e487b7160e01b600052602160045260246000fd5b9052565b602081016112b882846158f1565b6000806040838503121561593457600080fd5b50508035926020909101359150565b6000806000806080858703121561595957600080fd5b8435935060208501359250604085013561597281615006565b915060608501356001600160401b0381111561598d57600080fd5b615999878288016155b2565b91505092959194509250565b80516150268161505c565b6001600160401b038116811461084857600080fd5b8051615026816159b0565b60006101408284031280156159e457600080fd5b5060006159ef615545565b835181526020808501519082015260408085015190820152615a13606085016159a5565b6060820152615a24608085016159c5565b6080820152615a3560a085016159c5565b60a0820152615a4660c085016159a5565b60c0820152615a5760e085016159c5565b60e082015261010084810151908201526101209384015193810193909352509092915050565b600060208284031215615a8f57600080fd5b5051919050565b600060208284031215615aa857600080fd5b815161186c8161505c565b600060208284031215615ac557600080fd5b815161186c816159b0565b6001600160a01b03929092168252602082015260400190565b808201808211156112b8576112b861582f565b60008251615b0e818460208701615197565b9190910192915050565b8035615026816159b0565b80356001600160801b038116811461502657600080fd5b60008060408385031215615b4d57600080fd5b82356001600160401b03811115615b6357600080fd5b830160408186031215615b7557600080fd5b615b7d61556e565b81356001600160401b03811115615b9357600080fd5b820160e08188031215615ba557600080fd5b615bad615590565b81358152615bbd6020830161501b565b6020820152615bce6040830161501b565b6040820152615bdf6060830161501b565b6060820152615bf060808301615b18565b6080820152615c0160a08301615b23565b60a082015260c08201356001600160401b03811115615c1f57600080fd5b615c2b898285016155b2565b60c08301525082525060208201356001600160401b03811115615c4d57600080fd5b615c59878285016155b2565b60208381019190915291979590910135955050505050565b615c7b81856158f1565b606060208201526000615c9160608301856151bb565b9050826040830152949350505050565b80820281158282048414176112b8576112b861582f565b600080600060608486031215615ccd57600080fd5b8335615cd881615006565b92506020840135915060408401356001600160401b03811115615cfa57600080fd5b615d06868287016155b2565b9150509250925092565b608081526000615d2360808301876151bb565b6020830195909552506040810192909252606090910152919050565b60008060408385031215615d5257600080fd5b8251602084015190925061515c81615006565b600081615d7457615d7461582f565b506000190190565b600060018201615d8e57615d8e61582f565b5060010190565b6001600160a01b03938416815291909216602082015263ffffffff909116604082015260600190565b606080825284516040838301819052815160a085015260208201516001600160a01b0390811660c086015290820151811660e08501529181015190911661010083015260808101516001600160401b038116610120840152600091905060a08101516001600160801b0381166101408501525060c0015160e0610160840152615e4b6101808401826151bb565b90506020860151605f19848303016080850152615e6882826151bb565b9250505083602083015261333560408301846001600160a01b03169052565b6001600160a01b038481168252831660208201526060810161333560408301846158f1565b600060a0828403128015615ebf57600080fd5b5060405160009060a081016001600160401b0381118282101715615ee557615ee561552f565b6040908152845182526020808601519083015284810151908201526060808501519082015260809384015193810193909352509092915050565b6001600160a01b039384168152919092166020820152604081019190915260600190565b86815285602082015284604082015283606082015260c060808201526000615f6e60c08301856151bb565b90508260a0830152979650505050505050565b600082615f9e57634e487b7160e01b600052601260045260246000fd5b50049056fea2646970667358221220b85de947a2adf153b4d5d66360454c8d0624bca998d3fc8f12bd17e31d74127864736f6c634300081b0033", + "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061023b5760003560e01c806307e736d8146102405780630e02292314610280578063138dea081461030857806313c474c9146103205780631dd42f60146103755780631ebb7c301461038a57806324b8fbf6146103af57806335577962146103c25780633f4ba83a146103d557806345f54485146103dd578063482468b7146103f05780634f793cdc1461040657806355c85269146104285780635c975abb146104725780636234e2161461048a5780636ccec5b8146104aa5780636d9a3951146104bd578063715018a61461053857806371ce020a146105405780637aa31bce146105565780637dfe6d28146105695780637e89bac31461057c5780638180083b1461058f578063819ba366146105a257806381e777a7146105b8578063832bc923146105cb5780638456cb59146105de57806384b0196e146105e657806385e82baf146106015780638da5cb5b1461060a5780639384e07814610612578063ac9650d814610635578063b15d2a2c14610655578063ba38f67d14610668578063c0f474971461067b578063c84a5ef314610683578063cb8347fe14610696578063cbe5f3f2146106a9578063ce0fc0cc146106c9578063ce56c98b146106dc578063d07a7a84146106ef578063db9bee46146106f9578063dedf672614610701578063e2e1e8e914610714578063e6f5005414610734578063ebf6ddaf14610747578063ec9c218d1461074f578063eff0f59214610762578063f2fde38b14610797575b600080fd5b61026a61024e36600461502b565b610109602052600090815260409020546001600160a01b031681565b6040516102779190615048565b60405180910390f35b61029361028e36600461502b565b6107aa565b604051610277919060006101208201905060018060a01b0383511682526020830151602083015260408301516040830152606083015160608301526080830151608083015260a083015160a083015260c083015160c083015260e083015160e083015261010083015161010083015292915050565b6103126101085481565b604051908152602001610277565b61035561032e36600461502b565b609c6020526000908152604090208054600182015460028301546003909301549192909184565b604080519485526020850193909352918301526060820152608001610277565b61038861038336600461506e565b610837565b005b600254600160c01b900463ffffffff1660405163ffffffff9091168152602001610277565b6103886103bd3660046150cc565b610850565b6103886103d036600461512e565b610a7d565b610388610a93565b6103886103eb366004615167565b610acf565b6103f8610ad9565b604051610277929190615180565b61041961041436600461502b565b610aec565b604051610277939291906151e7565b61043b61043636600461502b565b610c20565b6040805196151587526001600160a01b039095166020870152938501929092526060840152608083015260a082015260c001610277565b61047a610cdc565b6040519015158152602001610277565b61031261049836600461502b565b60d16020526000908152604090205481565b6103886104b836600461502b565b610cf1565b6105146104cb36600461502b565b604080518082018252600080825260209182018190526001600160a01b03938416815260d082528290208251808401909352805490931682526001909201549181019190915290565b6040805182516001600160a01b031681526020928301519281019290925201610277565b610388610cfb565b610548610d0d565b60405161027792919061521c565b610388610564366004615167565b610d18565b610388610577366004615236565b610d29565b61038861058a366004615167565b610d41565b61038861059d3660046150cc565b610db6565b6105aa610f44565b604051610277929190615277565b6103886105c6366004615236565b610f54565b6103886105d9366004615167565b6110c4565b6103886110d8565b6105ee611112565b6040516102779796959493929190615285565b61031260d25481565b61026a6111bb565b61047a61062036600461502b565b60676020526000908152604090205460ff1681565b61064861064336600461531d565b6111d6565b6040516102779190615392565b6103126106633660046153f7565b6112be565b61047a61067636600461502b565b611492565b61026a6114b0565b61038861069136600461545f565b6114ba565b6103886106a43660046150cc565b611638565b6103126106b736600461502b565b609a6020526000908152604090205481565b6103886106d73660046150cc565b611777565b6103126106ea3660046154a7565b611860565b6103126101075481565b61026a611873565b61038861070f3660046150cc565b61187d565b610312610722366004615167565b600090815260d3602052604090205490565b610388610742366004615167565b611a0b565b61026a611a1c565b61038861075d36600461502b565b611a26565b610355610770366004615167565b609b6020526000908152604090208054600182015460028301546003909301549192909184565b6103886107a536600461502b565b611aa8565b6107b2614fae565b506001600160a01b03908116600090815260cf6020908152604091829020825161012081018452815490941684526001810154918401919091526002810154918301919091526003810154606083015260048101546080830152600581015460a0830152600681015460c0830152600781015460e08301526008015461010082015290565b61083f611ae3565b61084881611b15565b50565b905090565b82610859611b69565b6001600160a01b0316637c145cc78230336040518463ffffffff1660e01b8152600401610888939291906154d5565b602060405180830381865afa1580156108a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108c991906154f8565b813390916108f55760405163cc5d3c8b60e01b81526004016108ec929190615515565b60405180910390fd5b505083600061090382611b8d565b905061090e81611c90565b610919816000611cce565b610921611db8565b6000808061093187890189615646565b925092509250600083511161095957604051630783843960e51b815260040160405180910390fd5b600082511161097b57604051631e63bd9560e21b815260040160405180910390fd5b6001600160a01b03891660009081526101066020526040902054156109b357604051630d06866d60e21b815260040160405180910390fd5b6040805160608101825242815260208082018681528284018690526001600160a01b038d16600090815261010690925292902081518155915190919060018201906109fe9082615742565b5060408201516002820190610a139082615742565b5050506001600160a01b03811615610a2f57610a2f8982611dde565b886001600160a01b03167f159567bea25499a91f60e1fbb349ff2a1f8c1b2883198f25c1e12c99eddb44fa8989604051610a6a929190615800565b60405180910390a2505050505050505050565b610a85611ae3565b610a8f8282611e35565b5050565b3360008181526067602052604090205460ff16610ac4576040516372e3ef9760e01b81526004016108ec9190615048565b50610acd611eeb565b565b6108483382611f37565b600080610ae4611fdd565b915091509091565b6101066020526000908152604090208054600182018054919291610b0f906156c1565b80601f0160208091040260200160405190810160405280929190818152602001828054610b3b906156c1565b8015610b885780601f10610b5d57610100808354040283529160200191610b88565b820191906000526020600020905b815481529060010190602001808311610b6b57829003601f168201915b505050505090806002018054610b9d906156c1565b80601f0160208091040260200160405190810160405280929190818152602001828054610bc9906156c1565b8015610c165780601f10610beb57610100808354040283529160200191610c16565b820191906000526020600020905b815481529060010190602001808311610bf957829003601f168201915b5050505050905083565b6001600160a01b03808216600090815260cf60209081526040808320815161012081018352815490951685526001810154928501929092526002820154908401526003810154606084015260048101546080840152600581015460a0840152600681015460c0840152600781015460e0840152600801546101008301529081908190819081908190610cb181612054565b81516020830151604084015160c085015160e090950151939c929b5090995097509195509350915050565b600080610ce7612073565b5460ff1692915050565b6108483382611dde565b610d03611ae3565b610acd6000612097565b600080610ae46120f3565b610d20611ae3565b6108488161216a565b610d31611ae3565b610d3c83838361219f565b505050565b610d49611ae3565b610d5681620f4240101590565b8190610d7857604051631c9c717b60e01b81526004016108ec91815260200190565b506101088190556040518181527f6deef78ffe3df79ae5cd8e40b842c36ac6077e13746b9b68a9f327537b01e4e9906020015b60405180910390a150565b82610dbf611b69565b6001600160a01b0316637c145cc78230336040518463ffffffff1660e01b8152600401610dee939291906154d5565b602060405180830381865afa158015610e0b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e2f91906154f8565b81339091610e525760405163cc5d3c8b60e01b81526004016108ec929190615515565b50506001600160a01b0384166000908152610106602052604090205484908190610e905760405163ee27189960e01b81526004016108ec9190615048565b50610e99611db8565b6000610ea78486018661502b565b90506001600160a01b038616610ebe60cf836121f2565b51879183916001600160a01b031614610eec5760405163c0bbff1360e01b81526004016108ec929190615515565b5050610ef9816000612277565b856001600160a01b03167f73330c218a680717e9eee625c262df66eddfdf99ecb388d25f6b32d66b9a318a8686604051610f34929190615800565b60405180910390a2505050505050565b600080610ae46000546001549091565b82610f5d611b69565b6001600160a01b0316637c145cc78230336040518463ffffffff1660e01b8152600401610f8c939291906154d5565b602060405180830381865afa158015610fa9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fcd91906154f8565b81339091610ff05760405163cc5d3c8b60e01b81526004016108ec929190615515565b5050836000610ffe82611b8d565b905061100981611c90565b611014816000611cce565b6001600160a01b03861660009081526101066020526040902054869081906110505760405163ee27189960e01b81526004016108ec9190615048565b50611059611db8565b6001600160a01b03871661106e60cf886121f2565b51889188916001600160a01b03161461109c5760405163c0bbff1360e01b81526004016108ec929190615515565b50506110bb8686600260189054906101000a900463ffffffff166123d9565b50505050505050565b6110cc611ae3565b610848816000196126d7565b3360008181526067602052604090205460ff16611109576040516372e3ef9760e01b81526004016108ec9190615048565b50610acd612746565b600060608060008060006060600061112861278d565b805490915015801561113c57506001810154155b6111805760405162461bcd60e51b81526020600482015260156024820152741152540dcc4c8e88155b9a5b9a5d1a585b1a5e9959605a1b60448201526064016108ec565b6111886127b1565b611190612852565b60408051600080825260208201909252600f60f81b9c939b5091995046985030975095509350915050565b6000806111c661286f565b546001600160a01b031692915050565b604080516000815260208101909152606090826001600160401b038111156112005761120061552f565b60405190808252806020026020018201604052801561123357816020015b606081526020019060019003908161121e5790505b50915060005b838110156112b5576112903086868481811061125757611257615858565b9050602002810190611269919061586e565b8560405160200161127c939291906158b4565b604051602081830303815290604052612893565b8382815181106112a2576112a2615858565b6020908102919091010152600101611239565b50505b92915050565b6000846112c9611b69565b6001600160a01b0316637c145cc78230336040518463ffffffff1660e01b81526004016112f8939291906154d5565b602060405180830381865afa158015611315573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061133991906154f8565b8133909161135c5760405163cc5d3c8b60e01b81526004016108ec929190615515565b505085600061136a82611b8d565b905061137581611c90565b611380816000611cce565b6001600160a01b03881660009081526101066020526040902054889081906113bc5760405163ee27189960e01b81526004016108ec9190615048565b506113c5611db8565b6000808960028111156113da576113da6158db565b036113f1576113ea8a8989612909565b9050611430565b6002896002811115611405576114056158db565b03611415576113ea8a8989612e1d565b8860405163047031cf60e41b81526004016108ec9190615913565b886002811115611442576114426158db565b8a6001600160a01b03167f54fe682bfb66381a9382e13e4b95a3dd4f960eafbae063fdea3539d144ff3ff58360405161147d91815260200190565b60405180910390a39998505050505050505050565b60006112b882600260189054906101000a900463ffffffff16612ec1565b600061084b612ee0565b60006114c4612f04565b805490915060ff600160401b82041615906001600160401b03166000811580156114eb5750825b90506000826001600160401b031660011480156115075750303b155b905081158015611515575080155b156115335760405163f92ee8a960e01b815260040160405180910390fd5b84546001600160401b0319166001178555831561155c57845460ff60401b1916600160401b1785555b61156589612f2d565b61156d612f3e565b611575612f46565b61157d612f5e565b6115c96040518060400160405280600f81526020016e53756267726170685365727669636560881b815250604051806040016040528060038152602001620312e360ec1b815250612f6e565b6115d5886000196126d7565b6115de87611b15565b6115e786612f88565b831561162d57845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b505050505050505050565b337f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03811682146116855760405163cdc0567f60e01b81526004016108ec929190615515565b50600090508061169783850185615921565b915091506116a3611b69565b6001600160a01b031663e76fede68684846116bc612fdf565b60405160e086901b6001600160e01b03191681526001600160a01b039485166004820152602481019390935260448301919091529091166064820152608401600060405180830381600087803b15801561171557600080fd5b505af1158015611729573d6000803e3d6000fd5b50505050846001600160a01b03167f02f2e74a11116e05b39159372cceb6739257b08d72f7171d208ff27bb6466c588360405161176891815260200190565b60405180910390a25050505050565b82611780611b69565b6001600160a01b0316637c145cc78230336040518463ffffffff1660e01b81526004016117af939291906154d5565b602060405180830381865afa1580156117cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117f091906154f8565b813390916118135760405163cc5d3c8b60e01b81526004016108ec929190615515565b505061181d611db8565b61182684613003565b6040516001600160a01b038516907ff53cf6521a1b5fc0c04bffa70374a4dc2e3474f2b2ac1643c3bcc54e2db4a93990600090a250505050565b600061186c8383613076565b9392505050565b600061084b612fdf565b82611886611b69565b6001600160a01b0316637c145cc78230336040518463ffffffff1660e01b81526004016118b5939291906154d5565b602060405180830381865afa1580156118d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118f691906154f8565b813390916119195760405163cc5d3c8b60e01b81526004016108ec929190615515565b505083600061192782611b8d565b905061193281611c90565b61193d816000611cce565b6001600160a01b03861660009081526101066020526040902054869081906119795760405163ee27189960e01b81526004016108ec9190615048565b50611982611db8565b6000808080611993898b018b615943565b93509350935093506119bb8b83868685600260189054906101000a900463ffffffff166130e5565b8a6001600160a01b03167fd3803eb82ef5b4cdff8646734ebbaf5b37441e96314b27ffd3d0940f12a038e78b8b6040516119f6929190615800565b60405180910390a25050505050505050505050565b611a13611ae3565b61084881612f88565b600061084b6132dc565b611a2e611db8565b6000611a3b60cf836121f2565b9050611a5260d2548261330090919063ffffffff16565b8290611a7157604051623477b560e51b81526004016108ec9190615048565b50611a7b8161333d565b158290611a9c576040516317c7b35d60e31b81526004016108ec9190615048565b50610a8f826001612277565b611ab0611ae3565b6001600160a01b038116611ada576000604051631e4fbdf760e01b81526004016108ec9190615048565b61084881612097565b33611aec6111bb565b6001600160a01b031614610acd573360405163118cdaa760e01b81526004016108ec9190615048565b6002805463ffffffff60c01b1916600160c01b63ffffffff8416908102919091179091556040519081527f472aba493f9fd1d136ec54986f619f3aa5caff964f0e731a9909fb9a1270211f90602001610dab565b7f000000000000000000000000000000000000000000000000000000000000000090565b6040805161014081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101829052610120810182905290611be6611b69565b6001600160a01b03166325d9897e84306040518363ffffffff1660e01b8152600401611c13929190615515565b61014060405180830381865afa158015611c31573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c5591906159d0565b90508060a001516001600160401b0316600014158390611c8957604051637b3c09bf60e01b81526004016108ec9190615048565b5092915050565b6020810151815161084891611ca491615845565b60005460015460405180604001604052806006815260200165746f6b656e7360d01b81525061335c565b600080611cd96120f3565b91509150600083611cee578460800151611cf4565b8460e001515b9050611d42816001600160401b0316846001600160401b0316846001600160401b03166040518060400160405280600d81526020016c1d1a185dda5b99d4195c9a5bd9609a1b81525061335c565b600080611d4d611fdd565b91509150600086611d62578760600151611d68565b8760c001515b9050611dae8163ffffffff168463ffffffff168463ffffffff166040518060400160405280600e81526020016d1b585e15995c9a599a595c90dd5d60921b81525061335c565b5050505050505050565b611dc0610cdc565b15610acd5760405163d93c066560e01b815260040160405180910390fd5b6001600160a01b038281166000818152610109602052604080822080546001600160a01b0319169486169485179055517e3215dc05a2fc4e6a1e2c2776311d207c730ee51085aae221acc5cbe6fb55c19190a35050565b6001600160a01b0382166000908152606760205260409020548290829060ff161515811514611e8a57604051635e67e54b60e01b81526001600160a01b039092166004830152151560248201526044016108ec565b50506001600160a01b038216600081815260676020908152604091829020805460ff191685151590811790915591519182527fa95bac2f3df0d40e8278281c1d39d53c60e4f2bf3550ca5665738d0916e89789910160405180910390a25050565b611ef3613390565b6000611efd612073565b805460ff1916815590507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b604051610dab9190615048565b6001600160a01b0382166000818152609c60209081526040808320815192830184905282820194909452805180830382018152606090920190528190611f8b9084906133b5906133ca906134c590896134ea565b91509150846001600160a01b03167f13f3fa9f0e54af1af76d8b5d11c3973d7c2aed6312b61efff2f7b49d73ad67eb8383806020019051810190611fcf9190615a7d565b604051611768929190615277565b600080611fe8612fdf565b6001600160a01b031663bb2a2b476040518163ffffffff1660e01b8152600401602060405180830381865afa158015612025573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120499190615a96565b92620f424092509050565b60006120638260600151151590565b80156112b8575050608001511590565b7fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f0330090565b60006120a161286f565b80546001600160a01b038481166001600160a01b031983168117845560405193945091169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b6000806000612100612fdf565b6001600160a01b0316635aea0ec46040518163ffffffff1660e01b8152600401602060405180830381865afa15801561213d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121619190615ab3565b93849350915050565b60d28190556040518181527f21774046e2611ddb52c8c46e1ad97524eeb2e3fda7dcd9428867868b4c4d06ba90602001610dab565b6121ac60d08484846135a4565b80826001600160a01b0316846001600160a01b03167fd54c7abc930f6d506da2d08aa7aead4f2443e1db6d5f560384a2f652ff893e1960405160405180910390a4505050565b6121fa614fae565b6122048383613653565b604080516101208101825282546001600160a01b03168152600183015460208201526002830154918101919091526003820154606082015260048201546080820152600582015460a0820152600682015460c0820152600782015460e08201526008909101546101008201529392505050565b600061228460cf846121f2565b905061230f83612292613706565b6001600160a01b031663eeac3e0e84602001516040518263ffffffff1660e01b81526004016122c391815260200190565b6020604051808303816000875af11580156122e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123069190615a7d565b60cf919061372a565b61231a60cf846137dd565b8051604082015161232d9160d191613893565b806040015160d3600083602001518152602001908152602001600020546123549190615845565b60d3600083602001518152602001908152602001600020819055508060200151836001600160a01b031682600001516001600160a01b03167f08f2f865e0fb62d722a51e4d9873199bf6bf52e7d8ee5a2ee2896c9ef719f5458460400151866040516123cc9291909182521515602082015260400190565b60405180910390a4505050565b60006123e660cf856121f2565b90506123f181612054565b849061241157604051631eb5ff9560e01b81526004016108ec9190615048565b5080604001518314158484909161243d5760405163f32518cd60e01b81526004016108ec929190615ad0565b50506040810151808411156124735761246e612457611b69565b83516124638488615845565b60d192919087613911565b61248c565b815161248c906124838684615845565b60d19190613893565b6000612496613706565b6001600160a01b031663eeac3e0e84602001516040518263ffffffff1660e01b81526004016124c791815260200190565b6020604051808303816000875af11580156124e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061250a9190615a7d565b905060006125178461333d565b15612523576000612532565b60c08401516125329083615845565b6001600160a01b038816600090815260cf60205260409020600281018890556006018390559050612561613706565b6001600160a01b031663c8a5f81e84836040518363ffffffff1660e01b815260040161258e929190615277565b602060405180830381865afa1580156125ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125cf9190615a7d565b6001600160a01b038816600090815260cf6020526040812060070180549091906125fa908490615ae9565b909155505082861115612642576126118387615845565b60d360008660200151815260200190815260200160002060008282546126379190615ae9565b909155506126789050565b61264c8684615845565b60d360008660200151815260200190815260200160002060008282546126729190615845565b90915550505b8360200151876001600160a01b031685600001516001600160a01b03167f6db4a6f9be2d5e72eb2a2af2374ac487971bf342a261ba0bc1cf471bf2a2c31f89876040516126c6929190615277565b60405180910390a450505050505050565b8181808211156126fc5760405163ccccdafb60e01b81526004016108ec929190615277565b5050600082905560018190556040517f90699b8b4bf48918fea1129c85f9bc7b51285df7ecc982910813c7805f5688499061273a9084908490615277565b60405180910390a15050565b61274e611db8565b6000612758612073565b805460ff1916600117815590507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611f2a3390565b7fa16a46d94261c7517cc8ff89f61c0ce93598e3c849801011dee649a6a557d10090565b606060006127bd61278d565b90508060020180546127ce906156c1565b80601f01602080910402602001604051908101604052809291908181526020018280546127fa906156c1565b80156128475780601f1061281c57610100808354040283529160200191612847565b820191906000526020600020905b81548152906001019060200180831161282a57829003601f168201915b505050505091505090565b6060600061285e61278d565b90508060030180546127ce906156c1565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930090565b6060600080846001600160a01b0316846040516128b09190615afc565b600060405180830381855af49150503d80600081146128eb576040519150601f19603f3d011682016040523d82523d6000602084013e6128f0565b606091505b5091509150612900858383613a0f565b95945050505050565b6000808061291984860186615b3a565b8151604001519193509150866001600160a01b038281169082161461295357604051631a071d0760e01b81526004016108ec929190615515565b50508151516001600160a01b038111156129835760405163fa4ac7a760e01b81526004016108ec91815260200190565b50815151600061299460cf836121f2565b805190915088906001600160a01b03818116908316146129c957604051634508fbf760e11b81526004016108ec929190615515565b505060208101516129db896000611f37565b60008060006129e8613a62565b6001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401612a139190615048565b602060405180830381865afa158015612a30573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a549190615a7d565b9050612a5e6132dc565b6001600160a01b031663692209ce6000612afc8b612a7a612ee0565b6001600160a01b0316634c4ea0ed8a6040518263ffffffff1660e01b8152600401612aa791815260200190565b602060405180830381865afa158015612ac4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ae891906154f8565b612af3576000613a86565b61010854613a86565b8a6040518463ffffffff1660e01b8152600401612b1b93929190615c71565b6020604051808303816000875af1158015612b3a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b5e9190615a7d565b92506000612b6a613a62565b6001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401612b959190615048565b602060405180830381865afa158015612bb2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bd69190615a7d565b9050818181811015612bfd57604051639db8bc9560e01b81526004016108ec929190615277565b50612c0a90508282615845565b92505082159050612db457612ca98b6101075484612c289190615ca1565b612c30612fdf565b6001600160a01b0316635aea0ec46040518163ffffffff1660e01b8152600401602060405180830381865afa158015612c6d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c919190615ab3565b612ca4906001600160401b031642615ae9565b613ada565b8015612db457612cb7613706565b6001600160a01b0316631d1c2fec846040518263ffffffff1660e01b8152600401612ce491815260200190565b6020604051808303816000875af1158015612d03573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d279190615a7d565b50612d4c612d33612ee0565b82612d3c613a62565b6001600160a01b03169190613c4a565b612d54612ee0565b6001600160a01b0316638157328884836040518363ffffffff1660e01b8152600401612d81929190615277565b600060405180830381600087803b158015612d9b57600080fd5b505af1158015612daf573d6000803e3d6000fd5b505050505b86516020908101516040805186815292830185905282018390526001600160a01b038088169291811691908e16907f184c452047299395d4f7f147eb8e823458a450798539be54aeed978f13d87ba29060600160405180910390a4509998505050505050505050565b6000808080612e2e85870187615cb8565b919450925090506001600160a01b038716612e4a60cf856121f2565b51889185916001600160a01b031614612e785760405163c0bbff1360e01b81526004016108ec929190615515565b50506002546001600160a01b0388811660009081526101096020526040902054612eb692869286928692600160c01b900463ffffffff169116613cf9565b979650505050505050565b6000612ed8612ece611b69565b60d19085856142d6565b159392505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b6000807ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a006112b8565b612f35614370565b61084881614395565b610acd614370565b612f4e614370565b612f5661439d565b610acd612f3e565b612f66614370565b612f56612f3e565b612f76614370565b612f8082826143df565b610a8f612f3e565b80600003612fa95760405163bc71a04360e01b815260040160405180910390fd5b6101078190556040518181527f2aaaf20b08565eebc0c962cd7c568e54c3c0c2b85a1f942b82cd1bd730fdcd2390602001610dab565b7f000000000000000000000000000000000000000000000000000000000000000090565b61300e8160016143f1565b613016611b69565b6001600160a01b0316633a78b732826040518263ffffffff1660e01b81526004016130419190615048565b600060405180830381600087803b15801561305b57600080fd5b505af115801561306f573d6000803e3d6000fd5b5050505050565b600061186c7f4bdee85c4b4a268f4895d1096d553c3e57bb2433c380e7b7ec8cb56cc4f7467384846040516020016130ca939291909283526001600160a01b03918216602084015216604082015260600190565b60405160208183030381529060405280519060200120614408565b6001600160a01b03851661310c57604051634ffdf5ef60e11b815260040160405180910390fd5b613117868684614435565b61312b613122611b69565b60d09087614484565b600061313561457a565b6001600160a01b031663766718086040518163ffffffff1660e01b8152600401602060405180830381865afa158015613172573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131969190615a7d565b90506000613226888888886131a9613706565b6001600160a01b031663eeac3e0e8c6040518263ffffffff1660e01b81526004016131d691815260200190565b6020604051808303816000875af11580156131f5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132199190615a7d565b60cf94939291908861459e565b905061323e613233611b69565b60d1908a8887613911565b806040015160d3600083602001518152602001908152602001600020546132659190615ae9565b60d36000836020015181526020019081526020016000208190555085876001600160a01b0316896001600160a01b03167fe5e185fab2b992c4727ff702a867d78b15fb176dbaa20c9c312a1c351d3f7f838460400151866040516132ca929190615277565b60405180910390a45050505050505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b60008061331584606001518560a00151614706565b61331f9042615845565b905061332a84612054565b801561333557508281115b949350505050565b600061334c8260600151151590565b80156112b8575050604001511590565b613367848484614716565b8185858590919293611dae57604051630871e13d60e01b81526004016108ec9493929190615d10565b613398610cdc565b610acd57604051638dfc202b60e01b815260040160405180910390fd5b6000908152609b602052604090206003015490565b6000606060006133d98561472d565b90504281604001511115613401575050604080516020810190915260008152600191506134be565b600080858060200190518101906134189190615d3f565b8451919350915061342d90609a908390613893565b86816001600160a01b03167f4c06b68820628a39c787d2db1faa0eeacd7b9474847b198b1e871fe6e5b93f4485600001518660400151604051613471929190615277565b60405180910390a382516134859083615ae9565b6040805160208101929092526001600160a01b038316908201526060016040516020818303038152906040529550600086945094505050505b9250929050565b6000908152609b60205260408120818155600181018290556002810182905560030155565b60006060876003015483111561351357604051634a411b9d60e11b815260040160405180910390fd5b600083156135215783613527565b88600301545b89549094505b801580159061353c5750600085115b156135955760008061355283898c63ffffffff16565b915091508115613563575050613595565b9650866135718c8c8b6147bb565b92508661357d81615d65565b975050838061358b90615d7c565b945050505061352d565b50989397509295505050505050565b6001600160a01b0380831660009081526020868152604091829020825180840190935280549093168252600190920154918101919091526135e490614842565b15829061360557604051632d7d25f160e21b81526004016108ec9190615048565b506040805180820182526001600160a01b0394851681526020808201938452938516600090815295909352909320905181546001600160a01b03191692169190911781559051600190910155565b6001600160a01b03808216600090815260208481526040808320815161012081018352815490951685526001810154928501929092526002820154908401526003810154606084015260048101546080840152600581015460a0840152600681015460c0840152600781015460e0840152600881015461010084015290916136de9060600151151590565b83906136fe576040516342daadaf60e01b81526004016108ec9190615048565b509392505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b60006137368484613653565b604080516101208101825282546001600160a01b03168152600183015460208201526002830154918101919091526003820154606082015260048201546080820152600582015460a0820152600682015460c0820152600782015460e082015260088201546101008201529091506137ad90612054565b600482015484916137d3576040516361b66e0d60e01b81526004016108ec929190615ad0565b5050600601555050565b60006137e98383613653565b604080516101208101825282546001600160a01b03168152600183015460208201526002830154918101919091526003820154606082015260048201546080820152600582015460a0820152600682015460c0820152600782015460e0820152600882015461010082015290915061386090612054565b60048201548391613886576040516361b66e0d60e01b81526004016108ec929190615ad0565b5050426004909101555050565b806000036138a057505050565b6001600160a01b03821660009081526020849052604090205481808210156138dd57604051635f8ec70960e01b81526004016108ec929190615277565b50506001600160a01b03821660009081526020849052604081208054839290613907908490615845565b9091555050505050565b811561306f576001600160a01b03831660009081526020869052604081205461393b908490615ae9565b90506000856001600160a01b031663872d04898630866040518463ffffffff1660e01b815260040161396f93929190615d95565b602060405180830381865afa15801561398c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906139b09190615a7d565b90508082818111156139d757604051635f8ec70960e01b81526004016108ec929190615277565b50506001600160a01b03851660009081526020889052604081208054869290613a01908490615ae9565b909155505050505050505050565b606082613a2457613a1f82614851565b61186c565b8151158015613a3b57506001600160a01b0384163b155b15613a5b5783604051639996b31560e01b81526004016108ec9190615048565b508061186c565b7f000000000000000000000000000000000000000000000000000000000000000090565b81516040908101516001600160a01b039081166000908152610109602090815290839020549251606093613ac39387938793929091169101615dbe565b604051602081830303815290604052905092915050565b81600003613afb57604051638f4c63d960e01b815260040160405180910390fd5b613b27613b06611b69565b600254609a91908690869063ffffffff600160c01b90910481169061391116565b6001600160a01b0383166000908152609c6020908152604080832060028082015483516001600160601b031930606090811b8216838901528b901b166034820152604880820192909252845180820390920182526068810180865282519287019290922060e882018652898352426088830190815260a883018a815260c8909301898152828a52609b909852959097209151825593516001820155925190830155915160039182015581015490919015613bf55760018201546000908152609b602052604090206003018190555b613bff828261487a565b80856001600160a01b03167f5d9e2c5278e41138269f5f980cfbea016d8c59816754502abc4d2f87aaea987f8686604051613c3b929190615277565b60405180910390a35050505050565b8015610d3c5760405163a9059cbb60e01b81526001600160a01b0384169063a9059cbb90613c7e9085908590600401615ad0565b6020604051808303816000875af1158015613c9d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613cc191906154f8565b610d3c5760405162461bcd60e51b815260206004820152600960248201526810ba3930b739b332b960b91b60448201526064016108ec565b600080613d0760cf886121f2565b9050613d1281612054565b8790613d3257604051631eb5ff9560e01b81526004016108ec9190615048565b506000613d4a60d2548361330090919063ffffffff16565b158015613d5d5750613d5b8261333d565b155b8015613d6857508615155b8015613de05750816101000151613d7d61457a565b6001600160a01b031663766718086040518163ffffffff1660e01b8152600401602060405180830381865afa158015613dba573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613dde9190615a7d565b115b613deb576000613e61565b613df3613706565b6001600160a01b031663db750926896040518263ffffffff1660e01b8152600401613e1e9190615048565b6020604051808303816000875af1158015613e3d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613e619190615a7d565b9050613ea088613e6f613706565b6001600160a01b031663eeac3e0e85602001516040518263ffffffff1660e01b81526004016122c391815260200190565b613eab60cf8961490d565b613eb660cf896149c3565b60008082156141ef576000613ec9611b69565b8551604051637573ef4f60e01b81526001600160a01b039290921691637573ef4f91613efc913090600290600401615e87565b602060405180830381865afa158015613f19573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613f3d9190615a7d565b90506000613f49611b69565b8651604051631584a17960e21b81526001600160a01b03929092169163561285e491613f79913090600401615515565b60a060405180830381865afa158015613f96573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613fba9190615eac565b90506000816020015111613fcf576000613fd9565b613fd98583614a7a565b925082156140ce57613fe9613a62565b6001600160a01b031663095ea7b3613fff611b69565b856040518363ffffffff1660e01b815260040161401d929190615ad0565b6020604051808303816000875af115801561403c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061406091906154f8565b50614069611b69565b865160405163ca94b0e960e01b81526001600160a01b03929092169163ca94b0e99161409b9130908890600401615f1f565b600060405180830381600087803b1580156140b557600080fd5b505af11580156140c9573d6000803e3d6000fd5b505050505b6140d88386615845565b935083156141ec576001600160a01b0388166141df576140f6613a62565b6001600160a01b031663095ea7b361410c611b69565b866040518363ffffffff1660e01b815260040161412a929190615ad0565b6020604051808303816000875af1158015614149573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061416d91906154f8565b50614176611b69565b8651604051633a30904960e11b81526001600160a01b0392909216916374612092916141a89130908990600401615f1f565b600060405180830381600087803b1580156141c257600080fd5b505af11580156141d6573d6000803e3d6000fd5b505050506141ec565b6141ec8885612d3c613a62565b50505b602084015184516001600160a01b03808d1691167f443f56bd2098d273b8c8120398789a41da5925db4ba2f656813fc5299ac57b1f8686868f8f61423161457a565b6001600160a01b031663766718086040518163ffffffff1660e01b8152600401602060405180830381865afa15801561426e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906142929190615a7d565b6040516142a496959493929190615f43565b60405180910390a483516142b89088612ec1565b156142c8576142c88a6001612277565b509098975050505050505050565b600080846001600160a01b031663872d04898530866040518463ffffffff1660e01b815260040161430993929190615d95565b602060405180830381865afa158015614326573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061434a9190615a7d565b6001600160a01b0385166000908152602088905260409020541115915050949350505050565b614378614ada565b610acd57604051631afcd79f60e31b815260040160405180910390fd5b611ab0614370565b6143a5614370565b6143b260006000196126d7565b6143c06000620f4240614af4565b6143d260006001600160401b03614bc5565b610acd63ffffffff611b15565b6143e7614370565b610a8f8282614c52565b60006143fc83611b8d565b9050610d3c8183611cce565b60006112b8614415614c93565b8360405161190160f01b8152600281019290925260228201526042902090565b600061444a6144448585613076565b83614c9d565b905080836001600160a01b038083169082161461447c57604051638c5b935d60e01b81526004016108ec929190615515565b505050505050565b6001600160a01b0380821660009081526020858152604091829020825180840190935280549093168252600190920154918101919091526144c490614842565b1581906144e557604051632d7d25f160e21b81526004016108ec9190615048565b506040516378eb06b360e11b81526001600160a01b0383169063f1d60d6690614512908490600401615048565b602060405180830381865afa15801561452f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061455391906154f8565b15819061457457604051632d7d25f160e21b81526004016108ec9190615048565b50505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b6145a6614fae565b6001600160a01b03808716600090815260208a8152604091829020825161012081018452815490941684526001810154918401919091526002810154918301919091526003810154606083015260048101546080830152600581015460a0830152600681015460c0830152600781015460e0830152600801546101008201526146329060600151151590565b15869061465357604051630bc4def560e01b81526004016108ec9190615048565b505060408051610120810182526001600160a01b0397881681526020808201968752818301958652426060830190815260006080840181815260a0850182815260c0860198895260e0860183815261010087019889529b8d1683529c90935293909320825181546001600160a01b0319169a169990991789559551600189015593516002880155516003870155925160048601559451600585015593516006840155905160078301555160089091015590565b600082821882841102821861186c565b600082841015801561333557505090911115919050565b61475b6040518060800160405280600081526020016000815260200160008152602001600080191681525090565b6000828152609b602090815260409182902082516080810184528154815260018201549281018390526002820154938101939093526003015460608301528390611c895760405163107349a960e21b81526004016108ec91815260200190565b6000808460030154116147e15760405163ddaf8f2160e01b815260040160405180910390fd5b60006147f485600001548563ffffffff16565b905061480785600001548463ffffffff16565b600185600301600082825461481c9190615845565b9091555050808555600385015460000361483857600060018601555b5050915492915050565b516001600160a01b0316151590565b8051156148615780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b6127108260030154106148a0576040516303a8c56b60e61b815260040160405180910390fd5b806148be57604051638f4a893d60e01b815260040160405180910390fd5b60018083018290556002830180546000906148da908490615ae9565b909155505060038201546000036148ef578082555b60018260030160008282546149049190615ae9565b90915550505050565b60006149198383613653565b604080516101208101825282546001600160a01b03168152600183015460208201526002830154918101919091526003820154606082015260048201546080820152600582015460a0820152600682015460c0820152600782015460e0820152600882015461010082015290915061499090612054565b600482015483916149b6576040516361b66e0d60e01b81526004016108ec929190615ad0565b5050426005909101555050565b60006149cf8383613653565b604080516101208101825282546001600160a01b03168152600183015460208201526002830154918101919091526003820154606082015260048201546080820152600582015460a0820152600682015460c0820152600782015460e08201526008820154610100820152909150614a4690612054565b60048201548391614a6c576040516361b66e0d60e01b81526004016108ec929190615ad0565b505060006007909101555050565b6000614a8983620f4240101590565b80614a9c5750614a9c82620f4240101590565b83839091614abf5760405163768bf0eb60e11b81526004016108ec929190615277565b50620f42409050614ad08385615ca1565b61186c9190615f81565b6000614ae4612f04565b54600160401b900460ff16919050565b818163ffffffff8082169083161115614b225760405163ccccdafb60e01b81526004016108ec929190615180565b508290508163ffffffff8116620f42401015614b535760405163ccccdafb60e01b81526004016108ec929190615180565b50506002805463ffffffff838116600160a01b0263ffffffff60a01b19918616600160801b0291909116600160801b600160c01b0319909216919091171790556040517f2fe5a7039987697813605cc0b9d6db7aab575408e3fc59e8a457bef8d7bc0a369061273a9084908490615180565b81816001600160401b038082169083161115614bf65760405163ccccdafb60e01b81526004016108ec92919061521c565b5050600280546001600160401b03838116600160401b026001600160801b0319909216908516171790556040517f2867e04c500e438761486b78021d4f9eb97c77ff45d10c1183f5583ba4cbf7d19061273a908490849061521c565b614c5a614370565b6000614c6461278d565b905060028101614c748482615742565b5060038101614c838382615742565b5060008082556001909101555050565b600061084b614cc7565b600080600080614cad8686614d3b565b925092509250614cbd8282614d88565b5090949350505050565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f614cf2614e41565b614cfa614ea8565b60408051602081019490945283019190915260608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b60008060008351604103614d755760208401516040850151606086015160001a614d6788828585614ee9565b955095509550505050614d81565b50508151600091506002905b9250925092565b6000826003811115614d9c57614d9c6158db565b03614da5575050565b6001826003811115614db957614db96158db565b03614dd75760405163f645eedf60e01b815260040160405180910390fd5b6002826003811115614deb57614deb6158db565b03614e0c5760405163fce698f760e01b8152600481018290526024016108ec565b6003826003811115614e2057614e206158db565b03610a8f576040516335e2f38360e21b8152600481018290526024016108ec565b600080614e4c61278d565b90506000614e586127b1565b805190915015614e7057805160209091012092915050565b81548015614e7f579392505050565b7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470935050505090565b600080614eb361278d565b90506000614ebf612852565b805190915015614ed757805160209091012092915050565b60018201548015614e7f579392505050565b600080806fa2a8918ca85bafe22016d0b997e4df60600160ff1b03841115614f1a5750600091506003905082614fa4565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa158015614f6e573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116614f9a57506000925060019150829050614fa4565b9250600091508190505b9450945094915050565b60405180610120016040528060006001600160a01b0316815260200160008019168152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b6001600160a01b038116811461084857600080fd5b803561502681615006565b919050565b60006020828403121561503d57600080fd5b813561186c81615006565b6001600160a01b0391909116815260200190565b63ffffffff8116811461084857600080fd5b60006020828403121561508057600080fd5b813561186c8161505c565b60008083601f84011261509d57600080fd5b5081356001600160401b038111156150b457600080fd5b6020830191508360208285010111156134be57600080fd5b6000806000604084860312156150e157600080fd5b83356150ec81615006565b925060208401356001600160401b0381111561510757600080fd5b6151138682870161508b565b9497909650939450505050565b801515811461084857600080fd5b6000806040838503121561514157600080fd5b823561514c81615006565b9150602083013561515c81615120565b809150509250929050565b60006020828403121561517957600080fd5b5035919050565b63ffffffff92831681529116602082015260400190565b60005b838110156151b257818101518382015260200161519a565b50506000910152565b600081518084526151d3816020860160208601615197565b601f01601f19169290920160200192915050565b83815260606020820152600061520060608301856151bb565b828103604084015261521281856151bb565b9695505050505050565b6001600160401b0392831681529116602082015260400190565b60008060006060848603121561524b57600080fd5b833561525681615006565b9250602084013561526681615006565b929592945050506040919091013590565b918252602082015260400190565b60ff60f81b8816815260e0602082015260006152a460e08301896151bb565b82810360408401526152b681896151bb565b606084018890526001600160a01b038716608085015260a0840186905283810360c08501528451808252602080870193509091019060005b8181101561530c5783518352602093840193909201916001016152ee565b50909b9a5050505050505050505050565b6000806020838503121561533057600080fd5b82356001600160401b0381111561534657600080fd5b8301601f8101851361535757600080fd5b80356001600160401b0381111561536d57600080fd5b8560208260051b840101111561538257600080fd5b6020919091019590945092505050565b6000602082016020835280845180835260408501915060408160051b86010192506020860160005b828110156153eb57603f198786030184526153d68583516151bb565b945060209384019391909101906001016153ba565b50929695505050505050565b6000806000806060858703121561540d57600080fd5b843561541881615006565b935060208501356003811061542c57600080fd5b925060408501356001600160401b0381111561544757600080fd5b6154538782880161508b565b95989497509550505050565b6000806000806080858703121561547557600080fd5b843561548081615006565b93506020850135925060408501356154978161505c565b9396929550929360600135925050565b600080604083850312156154ba57600080fd5b82356154c581615006565b9150602083013561515c81615006565b6001600160a01b0393841681529183166020830152909116604082015260600190565b60006020828403121561550a57600080fd5b815161186c81615120565b6001600160a01b0392831681529116602082015260400190565b634e487b7160e01b600052604160045260246000fd5b60405161014081016001600160401b03811182821017156155685761556861552f565b60405290565b604080519081016001600160401b03811182821017156155685761556861552f565b60405160e081016001600160401b03811182821017156155685761556861552f565b600082601f8301126155c357600080fd5b8135602083016000806001600160401b038411156155e3576155e361552f565b50604051601f19601f85018116603f011681018181106001600160401b03821117156156115761561161552f565b60405283815290508082840187101561562957600080fd5b838360208301376000602085830101528094505050505092915050565b60008060006060848603121561565b57600080fd5b83356001600160401b0381111561567157600080fd5b61567d868287016155b2565b93505060208401356001600160401b0381111561569957600080fd5b6156a5868287016155b2565b92505060408401356156b681615006565b809150509250925092565b600181811c908216806156d557607f821691505b6020821081036156f557634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115610d3c57806000526020600020601f840160051c810160208510156157225750805b601f840160051c820191505b8181101561306f576000815560010161572e565b81516001600160401b0381111561575b5761575b61552f565b61576f8161576984546156c1565b846156fb565b6020601f8211600181146157a3576000831561578b5750848201515b600019600385901b1c1916600184901b17845561306f565b600084815260208120601f198516915b828110156157d357878501518255602094850194600190920191016157b3565b50848210156157f15786840151600019600387901b60f8161c191681555b50505050600190811b01905550565b60208152816020820152818360408301376000818301604090810191909152601f909201601f19160101919050565b634e487b7160e01b600052601160045260246000fd5b818103818111156112b8576112b861582f565b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261588557600080fd5b8301803591506001600160401b0382111561589f57600080fd5b6020019150368190038213156134be57600080fd5b8284823760008382016000815283516158d1818360208801615197565b0195945050505050565b634e487b7160e01b600052602160045260246000fd5b6003811061590f57634e487b7160e01b600052602160045260246000fd5b9052565b602081016112b882846158f1565b6000806040838503121561593457600080fd5b50508035926020909101359150565b6000806000806080858703121561595957600080fd5b8435935060208501359250604085013561597281615006565b915060608501356001600160401b0381111561598d57600080fd5b615999878288016155b2565b91505092959194509250565b80516150268161505c565b6001600160401b038116811461084857600080fd5b8051615026816159b0565b60006101408284031280156159e457600080fd5b5060006159ef615545565b835181526020808501519082015260408085015190820152615a13606085016159a5565b6060820152615a24608085016159c5565b6080820152615a3560a085016159c5565b60a0820152615a4660c085016159a5565b60c0820152615a5760e085016159c5565b60e082015261010084810151908201526101209384015193810193909352509092915050565b600060208284031215615a8f57600080fd5b5051919050565b600060208284031215615aa857600080fd5b815161186c8161505c565b600060208284031215615ac557600080fd5b815161186c816159b0565b6001600160a01b03929092168252602082015260400190565b808201808211156112b8576112b861582f565b60008251615b0e818460208701615197565b9190910192915050565b8035615026816159b0565b80356001600160801b038116811461502657600080fd5b60008060408385031215615b4d57600080fd5b82356001600160401b03811115615b6357600080fd5b830160408186031215615b7557600080fd5b615b7d61556e565b81356001600160401b03811115615b9357600080fd5b820160e08188031215615ba557600080fd5b615bad615590565b81358152615bbd6020830161501b565b6020820152615bce6040830161501b565b6040820152615bdf6060830161501b565b6060820152615bf060808301615b18565b6080820152615c0160a08301615b23565b60a082015260c08201356001600160401b03811115615c1f57600080fd5b615c2b898285016155b2565b60c08301525082525060208201356001600160401b03811115615c4d57600080fd5b615c59878285016155b2565b60208381019190915291979590910135955050505050565b615c7b81856158f1565b606060208201526000615c9160608301856151bb565b9050826040830152949350505050565b80820281158282048414176112b8576112b861582f565b600080600060608486031215615ccd57600080fd5b8335615cd881615006565b92506020840135915060408401356001600160401b03811115615cfa57600080fd5b615d06868287016155b2565b9150509250925092565b608081526000615d2360808301876151bb565b6020830195909552506040810192909252606090910152919050565b60008060408385031215615d5257600080fd5b8251602084015190925061515c81615006565b600081615d7457615d7461582f565b506000190190565b600060018201615d8e57615d8e61582f565b5060010190565b6001600160a01b03938416815291909216602082015263ffffffff909116604082015260600190565b606080825284516040838301819052815160a085015260208201516001600160a01b0390811660c086015290820151811660e08501529181015190911661010083015260808101516001600160401b038116610120840152600091905060a08101516001600160801b0381166101408501525060c0015160e0610160840152615e4b6101808401826151bb565b90506020860151605f19848303016080850152615e6882826151bb565b9250505083602083015261333560408301846001600160a01b03169052565b6001600160a01b038481168252831660208201526060810161333560408301846158f1565b600060a0828403128015615ebf57600080fd5b5060405160009060a081016001600160401b0381118282101715615ee557615ee561552f565b6040908152845182526020808601519083015284810151908201526060808501519082015260809384015193810193909352509092915050565b6001600160a01b039384168152919092166020820152604081019190915260600190565b86815285602082015284604082015283606082015260c060808201526000615f6e60c08301856151bb565b90508260a0830152979650505050505050565b600082615f9e57634e487b7160e01b600052601260045260246000fd5b50049056fea2646970667358221220b85de947a2adf153b4d5d66360454c8d0624bca998d3fc8f12bd17e31d74127864736f6c634300081b0033", + "linkReferences": {}, + "deployedLinkReferences": {} +} \ No newline at end of file diff --git a/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/SubgraphServiceProxies#DisputeManager_ProxyWithABI.json b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/SubgraphServiceProxies#DisputeManager_ProxyWithABI.json new file mode 100644 index 000000000..e01123577 --- /dev/null +++ b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/SubgraphServiceProxies#DisputeManager_ProxyWithABI.json @@ -0,0 +1,1557 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "DisputeManager", + "sourceName": "contracts/DisputeManager.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "controller", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "length", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "expectedLength", + "type": "uint256" + } + ], + "name": "AttestationInvalidBytesLength", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + } + ], + "name": "DisputeManagerDisputeAlreadyCreated", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + } + ], + "name": "DisputeManagerDisputeInConflict", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + } + ], + "name": "DisputeManagerDisputeNotInConflict", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "enum IDisputeManager.DisputeStatus", + "name": "status", + "type": "uint8" + } + ], + "name": "DisputeManagerDisputeNotPending", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeManagerDisputePeriodNotFinished", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeManagerDisputePeriodZero", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "DisputeManagerIndexerNotFound", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + } + ], + "name": "DisputeManagerInvalidDispute", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "disputeDeposit", + "type": "uint256" + } + ], + "name": "DisputeManagerInvalidDisputeDeposit", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "cut", + "type": "uint32" + } + ], + "name": "DisputeManagerInvalidFishermanReward", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "maxSlashingCut", + "type": "uint32" + } + ], + "name": "DisputeManagerInvalidMaxSlashingCut", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokensSlash", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxTokensSlash", + "type": "uint256" + } + ], + "name": "DisputeManagerInvalidTokensSlash", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeManagerInvalidZeroAddress", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "relatedDisputeId", + "type": "bytes32" + } + ], + "name": "DisputeManagerMustAcceptRelatedDispute", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "requestCID1", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "responseCID1", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "subgraphDeploymentId1", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "requestCID2", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "responseCID2", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "subgraphDeploymentId2", + "type": "bytes32" + } + ], + "name": "DisputeManagerNonConflictingAttestations", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "subgraphDeploymentId1", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "subgraphDeploymentId2", + "type": "bytes32" + } + ], + "name": "DisputeManagerNonMatchingSubgraphDeployment", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeManagerNotArbitrator", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeManagerNotFisherman", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeManagerSubgraphServiceNotSet", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeManagerZeroTokens", + "type": "error" + }, + { + "inputs": [], + "name": "ECDSAInvalidSignature", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "length", + "type": "uint256" + } + ], + "name": "ECDSAInvalidSignatureLength", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "ECDSAInvalidSignatureS", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "contractName", + "type": "bytes" + } + ], + "name": "GraphDirectoryInvalidZeroAddress", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidInitialization", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "OwnableInvalidOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "OwnableUnauthorizedAccount", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "a", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "b", + "type": "uint256" + } + ], + "name": "PPMMathInvalidMulPPM", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "arbitrator", + "type": "address" + } + ], + "name": "ArbitratorSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "fisherman", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "DisputeAccepted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "fisherman", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "DisputeCancelled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "disputeDeposit", + "type": "uint256" + } + ], + "name": "DisputeDepositSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "fisherman", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "DisputeDrawn", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "disputeId1", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "disputeId2", + "type": "bytes32" + } + ], + "name": "DisputeLinked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "disputePeriod", + "type": "uint64" + } + ], + "name": "DisputePeriodSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "fisherman", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "DisputeRejected", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "fishermanRewardCut", + "type": "uint32" + } + ], + "name": "FishermanRewardCutSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "graphToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "graphStaking", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphPayments", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphEscrow", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "graphController", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphEpochManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphRewardsManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphTokenGateway", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphProxyAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphCuration", + "type": "address" + } + ], + "name": "GraphDirectoryInitialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "fisherman", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "poi", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "stakeSnapshot", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "cancellableAt", + "type": "uint256" + } + ], + "name": "IndexingDisputeCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "fisherman", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensSlash", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensRewards", + "type": "uint256" + } + ], + "name": "LegacyDisputeCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "maxSlashingCut", + "type": "uint32" + } + ], + "name": "MaxSlashingCutSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "fisherman", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "attestation", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "stakeSnapshot", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "cancellableAt", + "type": "uint256" + } + ], + "name": "QueryDisputeCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "subgraphService", + "type": "address" + } + ], + "name": "SubgraphServiceSet", + "type": "event" + }, + { + "inputs": [], + "name": "MAX_FISHERMAN_REWARD_CUT", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MIN_DISPUTE_DEPOSIT", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "tokensSlash", + "type": "uint256" + } + ], + "name": "acceptDispute", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "tokensSlash", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "acceptDisputeInConflict", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "tokensSlashRelated", + "type": "uint256" + } + ], + "name": "acceptDisputeConflict", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "arbitrator", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "requestCID", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "responseCID", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + } + ], + "internalType": "struct Attestation.State", + "name": "attestation1", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "bytes32", + "name": "requestCID", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "responseCID", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + } + ], + "internalType": "struct Attestation.State", + "name": "attestation2", + "type": "tuple" + } + ], + "name": "areConflictingAttestations", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + } + ], + "name": "cancelDispute", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "internalType": "address", + "name": "fisherman", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokensSlash", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokensRewards", + "type": "uint256" + } + ], + "name": "createAndAcceptLegacyDispute", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "poi", + "type": "bytes32" + } + ], + "name": "createIndexingDispute", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "attestationData", + "type": "bytes" + } + ], + "name": "createQueryDispute", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "attestationData1", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "attestationData2", + "type": "bytes" + } + ], + "name": "createQueryDisputeConflict", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "disputeDeposit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "disputePeriod", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + } + ], + "name": "disputes", + "outputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "address", + "name": "fisherman", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deposit", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "relatedDisputeId", + "type": "bytes32" + }, + { + "internalType": "enum IDisputeManager.DisputeType", + "name": "disputeType", + "type": "uint8" + }, + { + "internalType": "enum IDisputeManager.DisputeStatus", + "name": "status", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "createdAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "cancellableAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "stakeSnapshot", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + } + ], + "name": "drawDispute", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "requestCID", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "responseCID", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + } + ], + "internalType": "struct Attestation.Receipt", + "name": "receipt", + "type": "tuple" + } + ], + "name": "encodeReceipt", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "fishermanRewardCut", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "requestCID", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "responseCID", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + } + ], + "internalType": "struct Attestation.State", + "name": "attestation", + "type": "tuple" + } + ], + "name": "getAttestationIndexer", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getDisputePeriod", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getFishermanRewardCut", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + } + ], + "name": "getStakeSnapshot", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "arbitrator_", + "type": "address" + }, + { + "internalType": "uint64", + "name": "disputePeriod_", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "disputeDeposit_", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "fishermanRewardCut_", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "maxSlashingCut_", + "type": "uint32" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + } + ], + "name": "isDisputeCreated", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maxSlashingCut", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + } + ], + "name": "rejectDispute", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "arbitrator", + "type": "address" + } + ], + "name": "setArbitrator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "disputeDeposit", + "type": "uint256" + } + ], + "name": "setDisputeDeposit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "disputePeriod", + "type": "uint64" + } + ], + "name": "setDisputePeriod", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "fishermanRewardCut_", + "type": "uint32" + } + ], + "name": "setFishermanRewardCut", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "maxSlashingCut_", + "type": "uint32" + } + ], + "name": "setMaxSlashingCut", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "subgraphService_", + "type": "address" + } + ], + "name": "setSubgraphService", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "subgraphService", + "outputs": [ + { + "internalType": "contract ISubgraphService", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "bytecode": "0x6101c060405234801561001157600080fd5b50604051613b6e380380613b6e8339810160408190526100309161049b565b806001600160a01b03811661007a5760405163218f5add60e11b815260206004820152600a60248201526921b7b73a3937b63632b960b11b60448201526064015b60405180910390fd5b6001600160a01b0381166101005260408051808201909152600a81526923b930b8342a37b5b2b760b11b60208201526100b29061033b565b6001600160a01b03166080526040805180820190915260078152665374616b696e6760c81b60208201526100e59061033b565b6001600160a01b031660a05260408051808201909152600d81526c47726170685061796d656e747360981b602082015261011e9061033b565b6001600160a01b031660c05260408051808201909152600e81526d5061796d656e7473457363726f7760901b60208201526101589061033b565b6001600160a01b031660e05260408051808201909152600c81526b22b837b1b426b0b730b3b2b960a11b60208201526101909061033b565b6001600160a01b03166101205260408051808201909152600e81526d2932bbb0b93239a6b0b730b3b2b960911b60208201526101cb9061033b565b6001600160a01b0316610140526040805180820190915260118152704772617068546f6b656e4761746577617960781b60208201526102099061033b565b6001600160a01b03166101605260408051808201909152600f81526e23b930b834283937bc3ca0b236b4b760891b60208201526102459061033b565b6001600160a01b03166101805260408051808201909152600881526721bab930ba34b7b760c11b602082015261027a9061033b565b6001600160a01b039081166101a08190526101005160a05160805160c05160e05161012051610140516101605161018051604051988b169a9788169996909716977fef5021414834d86e36470f5c1cecf6544fb2bb723f2ca51a4c86fcd8c5919a43976103249790916001600160a01b03978816815295871660208701529386166040860152918516606085015284166080840152831660a083015290911660c082015260e00190565b60405180910390a4506103356103e9565b50610519565b600080610100516001600160a01b031663f7641a5e84805190602001206040518263ffffffff1660e01b815260040161037691815260200190565b602060405180830381865afa158015610393573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103b7919061049b565b9050826001600160a01b0382166103e25760405163218f5add60e11b815260040161007191906104cb565b5092915050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff16156104395760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b03908116146104985780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b6000602082840312156104ad57600080fd5b81516001600160a01b03811681146104c457600080fd5b9392505050565b602081526000825180602084015260005b818110156104f957602081860181015160408684010152016104dc565b506000604082850101526040601f19601f83011684010191505092915050565b60805160a05160c05160e05161010051610120516101405161016051610180516101a0516135f261057c60003960005050600050506000505060005050600050506000505060005050600050506000611f23015260006119cc01526135f26000f3fe608060405234801561001057600080fd5b50600436106101a15760003560e01c8063050b17ad146101a65780630533e1ba146101bb5780630bc7344b146101e857806311be1997146101fb578063169729781461027857806317337b461461028b5780631792f1941461029557806326058249146102a857806329e03ff1146102c857806336167e03146102df5780634bc5839a146102f25780635aea0ec4146103055780635bf31d4d146103265780636369df6b146103405780636cc6cde114610353578063715018a61461036657806376c993ae1461036e5780638d4e9008146103815780638da5cb5b14610394578063902a49381461039c5780639334ea52146103ac57806393a90a1e146103bf5780639f81a7cf146103d2578063b0e2f7e9146103e5578063b0eefabe146103f8578063bb2a2b471461040b578063be41f38414610419578063c133b4291461043c578063c50a77b11461044f578063c894222e14610462578063c9747f5114610483578063cc2d55cd14610496578063d36fc9d4146104a5578063d76f62d1146104b8578063f2fde38b146104cb575b600080fd5b6101b96101b4366004612c8a565b6104de565b005b6036546101d290600160201b900463ffffffff1681565b6040516101df9190612cac565b60405180910390f35b6101b96101f6366004612cf9565b6105fc565b610263610209366004612d72565b603760205260009081526040902080546001820154600283015460038401546004850154600586015460068701546007909701546001600160a01b039687169796909516959394929360ff80841694610100909404169289565b6040516101df99989796959493929190612db5565b6101b9610286366004612d72565b610734565b6101d26207a12081565b6101b96102a3366004612d72565b610748565b6033546102bb906001600160a01b031681565b6040516101df9190612e20565b6102d160355481565b6040519081526020016101df565b6101b96102ed366004612d72565b6108a8565b6102d1610300366004612e34565b6109ae565b603454600160a01b90046001600160401b03165b6040516101df9190612e60565b60345461031990600160a01b90046001600160401b031681565b6102d161034e366004612e74565b6109e6565b6034546102bb906001600160a01b031681565b6101b96109ff565b6101b961037c366004612e8f565b610a13565b6102d161038f366004612eac565b610a24565b6102bb610dc5565b6036546101d29063ffffffff1681565b6101b96103ba366004612d72565b610de0565b6101b96103cd366004612ef2565b610edf565b6101b96103e0366004612e8f565b610ef0565b6101b96103f3366004612f1d565b610f01565b6101b9610406366004612ef2565b611062565b60365463ffffffff166101d2565b61042c610427366004612d72565b611073565b60405190151581526020016101df565b6102d161044a366004612ef2565b6110a9565b6102d161045d366004612fa4565b611141565b610475610470366004612fe5565b6111d4565b6040516101df929190613054565b6102bb6104913660046130fa565b6113e2565b6102d1670de0b6b3a764000081565b61042c6104b336600461317c565b6114cd565b6101b96104c63660046131b2565b6114f5565b6101b96104d9366004612ef2565b611506565b6034546001600160a01b031633146105095760405163a8baf3bb60e01b815260040160405180910390fd5b8161051381611073565b819061053e576040516314a03bbd60e21b815260040161053591815260200190565b60405180910390fd5b506004600082815260376020526040902060040154610100900460ff16600581111561056c5761056c612d8b565b600083815260376020526040902060040154610100900460ff1691146105a65760405163146e540f60e21b815260040161053591906131cf565b506000838152603760205260409020600301548390156105dc576040516364d0c32b60e01b815260040161053591815260200190565b5060008381526037602052604090206105f6848285611541565b50505050565b60006106066115f2565b805490915060ff600160401b82041615906001600160401b031660008115801561062d5750825b90506000826001600160401b031660011480156106495750303b155b905081158015610657575080155b156106755760405163f92ee8a960e01b815260040160405180910390fd5b84546001600160401b0319166001178555831561069e57845460ff60401b1916600160401b1785555b6106a78b61161b565b6106af61162c565b6106b88a61163c565b6106c1896116ad565b6106ca88611736565b6106d387611799565b6106dc8661180b565b831561072757845460ff60401b191685556040517fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29061071e90600190612e60565b60405180910390a15b5050505050505050505050565b61073c611892565b61074581611736565b50565b8061075281611073565b8190610774576040516314a03bbd60e21b815260040161053591815260200190565b506000818152603760205260409020600101546001600160a01b031633146107af5760405163082c005560e41b815260040160405180910390fd5b816107b981611073565b81906107db576040516314a03bbd60e21b815260040161053591815260200190565b506004600082815260376020526040902060040154610100900460ff16600581111561080957610809612d8b565b600083815260376020526040902060040154610100900460ff1691146108435760405163146e540f60e21b815260040161053591906131cf565b506000838152603760205260409020600681015442101561087757604051631d7753d560e11b815260040160405180910390fd5b61088184826118c4565b6003810154156105f657600381015460008181526037602052604090206105f691906118c4565b6034546001600160a01b031633146108d35760405163a8baf3bb60e01b815260040160405180910390fd5b806108dd81611073565b81906108ff576040516314a03bbd60e21b815260040161053591815260200190565b506004600082815260376020526040902060040154610100900460ff16600581111561092d5761092d612d8b565b600083815260376020526040902060040154610100900460ff1691146109675760405163146e540f60e21b815260040161053591906131cf565b506000828152603760205260409020600381015483901561099e576040516364d0c32b60e01b815260040161053591815260200190565b506109a9838261194b565b505050565b60006109cf336035546109bf6119ca565b6001600160a01b031691906119ee565b6109dd336035548585611aa6565b90505b92915050565b60006109e06109fa368490038401846131dd565b611e28565b610a07611892565b610a116000611ec5565b565b610a1b611892565b61074581611799565b6034546000906001600160a01b03163314610a525760405163a8baf3bb60e01b815260040160405180910390fd5b6040516001600160601b0319606087901b166020820152656c656761637960d01b6034820152600090603a016040516020818303038152906040528051906020012090506000610aa0611f21565b6001600160a01b0316630e022923886040518263ffffffff1660e01b8152600401610acb9190612e20565b61012060405180830381865afa158015610ae9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b0d91906132d9565b519050866001600160a01b038216610b39576040516334789d8b60e21b81526004016105359190612e20565b5060408051610120810182526001600160a01b038381168252881660208201526000918101829052606081019190915260036080820152600160a08201524260c0820181905260345460e0830191610ba191600160a01b90046001600160401b03169061330c565b81526000602091820181905284815260378252604090819020835181546001600160a01b039182166001600160a01b0319918216178355938501516001808401805492909316919095161790559083015160028201556060830151600380830191909155608084015160048301805493949193909260ff1990911691908490811115610c2f57610c2f612d8b565b021790555060a082015160048201805461ff001916610100836005811115610c5957610c59612d8b565b021790555060c0820151600582015560e08201516006820155610100909101516007909101556000610c89611f45565b9050806001600160a01b031663cb8347fe838888604051602001610cae929190613054565b6040516020818303038152906040526040518363ffffffff1660e01b8152600401610cda929190613365565b600060405180830381600087803b158015610cf457600080fd5b505af1158015610d08573d6000803e3d6000fd5b50505050610d298786610d196119ca565b6001600160a01b03169190611f81565b604080516001600160a01b038a81168252602082018990529181018790528189169184169085907f587a1fc7e80e653a2ab7f63f98c080f5818b8cedcfd1374590c8c786290ed0319060600160405180910390a4866001600160a01b0316826001600160a01b03168460008051602061359d83398151915288604051610db191815260200190565b60405180910390a450909695505050505050565b600080610dd0611fbc565b546001600160a01b031692915050565b6034546001600160a01b03163314610e0b5760405163a8baf3bb60e01b815260040160405180910390fd5b80610e1581611073565b8190610e37576040516314a03bbd60e21b815260040161053591815260200190565b506004600082815260376020526040902060040154610100900460ff166005811115610e6557610e65612d8b565b600083815260376020526040902060040154610100900460ff169114610e9f5760405163146e540f60e21b815260040161053591906131cf565b506000828152603760205260409020610eb88382611fe0565b6003810154156109a957600381015460008181526037602052604090206109a99190611fe0565b610ee7611892565b6107458161205f565b610ef8611892565b6107458161180b565b6034546001600160a01b03163314610f2c5760405163a8baf3bb60e01b815260040160405180910390fd5b83610f3681611073565b8190610f58576040516314a03bbd60e21b815260040161053591815260200190565b506004600082815260376020526040902060040154610100900460ff166005811115610f8657610f86612d8b565b600083815260376020526040902060040154610100900460ff169114610fc05760405163146e540f60e21b815260040161053591906131cf565b5060008581526037602052604090206003015415158590610ffa57604051600162d62c0760e01b0319815260040161053591815260200190565b506000858152603760205260409020611014868287611541565b831561103d5760038101546000818152603760205260409020611038919085611541565b61105a565b6003810154600081815260376020526040902061105a9190611fe0565b505050505050565b61106a611892565b6107458161163c565b600080600083815260376020526040902060040154610100900460ff1660058111156110a1576110a1612d8b565b141592915050565b6000806110b4611f21565b6001600160a01b03166325d9897e846110cb611f45565b6040518363ffffffff1660e01b81526004016110e8929190613389565b61014060405180830381865afa158015611106573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061112a91906133b9565b905061113a8382600001516120d0565b9392505050565b6000611152336035546109bf6119ca565b6109dd3360355461119886868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061216592505050565b86868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506122a592505050565b6000806000339050600061121d88888080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061216592505050565b9050600061126087878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061216592505050565b905061126c82826125a4565b825160208085015160408087015186519387015191870151949592949093926112cb57604051636aba529760e11b81526004810196909652602486019490945260448501929092526064840152608483015260a482015260c401610535565b5050505050506112e0336035546109bf6119ca565b60006113328460026035546112f59190613466565b858d8d8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506122a592505050565b905060006113868560026035546113499190613466565b858c8c8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506122a592505050565b60008381526037602052604080822060039081018490558383528183200185905551919250829184917ffec135a4cf8e5c6e13dea23be058bf03a8bf8f1f6fb0a021b0a5aeddfba8140791a3909a909950975050505050505050565b6000806113ee836125d5565b905060006113fa611f45565b6001600160a01b0316630e022923836040518263ffffffff1660e01b81526004016114259190612e20565b61012060405180830381865afa158015611443573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061146791906132d9565b805190915082906001600160a01b0316611495576040516334789d8b60e21b81526004016105359190612e20565b5060408401516020820151908181146114c357604051630a24cfe560e21b8152600401610535929190613054565b5050519392505050565b60006109dd6114e1368590038501856130fa565b6114f0368590038501856130fa565b6125a4565b6114fd611892565b610745816116ad565b61150e611892565b6001600160a01b038116611538576000604051631e4fbdf760e01b81526004016105359190612e20565b61074581611ec5565b81546007830154600091611562916001600160a01b0390911690849061265e565b60048401805461ff001916610100179055600184015460028501549192506115a2916001600160a01b039091169061159a908461330c565b610d196119ca565b6001830154835460028501546001600160a01b039283169290911690869060008051602061359d833981519152906115db90869061330c565b60405190815260200160405180910390a450505050565b6000807ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a006109e0565b61162361280f565b61074581612834565b61163461280f565b610a1161283c565b6001600160a01b0381166116635760405163616bc44160e11b815260040160405180910390fd5b603480546001600160a01b0319166001600160a01b0383169081179091556040517f51744122301b50e919f4e3d22adf8c53abc92195b8c667eda98c6ef20375672e90600090a250565b806001600160401b03166000036116d75760405163c4411f1160e01b815260040160405180910390fd5b60348054600160a01b600160e01b031916600160a01b6001600160401b038416021790556040517f310462a9bf49fff4a57910ec647c77cbf8aaf2f13394554ac6cdf14fc68db7e69061172b908390612e60565b60405180910390a150565b80670de0b6b3a76400008110156117635760405163033f4e0560e01b815260040161053591815260200190565b5060358190556040518181527f97896b9da0f97f36bf3011570bcff930069299de4b1e89c9cb44909841cac2f89060200161172b565b806207a12063ffffffff821611156117c55760405163432e664360e11b81526004016105359190612cac565b506036805463ffffffff191663ffffffff83161790556040517fc573dc0f869f6a1d0a74fc7712a63baabcb5567131d2d98005e163924eddcbab9061172b908390612cac565b8063ffffffff8116620f4240101561183757604051634e9374fb60e11b81526004016105359190612cac565b506036805463ffffffff60201b1916600160201b63ffffffff848116820292909217928390556040517f7efaf01bec3cda8d104163bb466d01d7e16f68848301c7eb0749cfa59d6805029361172b9392900490911690612cac565b3361189b610dc5565b6001600160a01b031614610a11573360405163118cdaa760e01b81526004016105359190612e20565b60048101805461ff001916610500179055600181015460028201546118f5916001600160a01b031690610d196119ca565b6001810154815460028301546040519081526001600160a01b03928316929091169084907f223103f8eb52e5f43a75655152acd882a605d70df57a5c0fefd30f516b1756d2906020015b60405180910390a45050565b60048101805461ff001916610200179055600281015461197c9061196d6119ca565b6001600160a01b03169061290e565b6001810154815460028301546040519081526001600160a01b03928316929091169084907f2226ebd23625a7938fb786df2248bd171d2e6ad70cb2b654ea1be830ca17224d9060200161193f565b7f000000000000000000000000000000000000000000000000000000000000000090565b80156109a9576040516323b872dd60e01b81526001600160a01b038381166004830152306024830152604482018390528416906323b872dd906064015b6020604051808303816000875af1158015611a4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a6e9190613488565b6109a95760405162461bcd60e51b815260206004820152600960248201526810ba3930b739b332b960b91b6044820152606401610535565b6040516001600160601b0319606084901b166020820152603481018290526000908190605401604051602081830303815290604052805190602001209050611aed81611073565b158190611b105760405163124a23f160e11b815260040161053591815260200190565b506000611b1b611f45565b90506000816001600160a01b0316630e022923876040518263ffffffff1660e01b8152600401611b4b9190612e20565b61012060405180830381865afa158015611b69573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b8d91906132d9565b8051909150866001600160a01b038216611bbb576040516334789d8b60e21b81526004016105359190612e20565b506000611bc6611f21565b6001600160a01b03166325d9897e83866040518363ffffffff1660e01b8152600401611bf3929190613389565b61014060405180830381865afa158015611c11573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c3591906133b9565b8051909150600003611c5a5760405163307efdb760e11b815260040160405180910390fd5b6000611c6a8383600001516120d0565b603454909150600090611c8d90600160a01b90046001600160401b03164261330c565b604080516101208101825287516001600160a01b0390811682528f1660208201529081018d905260006060820152909150608081016001815260200160048152426020808301919091526040808301859052606092830186905260008b815260378352819020845181546001600160a01b039182166001600160a01b0319918216178355938601516001808401805492909316919095161790559084015160028201559183015160038084019190915560808401516004840180549193909260ff19909216918490811115611d6457611d64612d8b565b021790555060a082015160048201805461ff001916610100836005811115611d8e57611d8e612d8b565b021790555060c0820151600582015560e08201516006820155610100909101516007909101558451604080518d81526001600160a01b038d811660208301529181018c90526060810185905260808101849052818f16929091169089907f8a1eccecce948a912e2e195de5960359755aeac90ad88a3fde55a77e1a73796b9060a00160405180910390a450949a9950505050505050505050565b600054815160208084015160409485015185517f32dd026408194a0d7e54cc66a2ab6c856efc55cfcd4dd258fde5b1a55222baa6818501528087019490945260608401919091526080808401919091528451808403909101815260a08301855280519082012061190160f01b60c084015260c283019390935260e28083019390935283518083039093018352610102909101909252805191012090565b6000611ecf611fbc565b80546001600160a01b038481166001600160a01b031983168117845560405193945091169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b6033546000906001600160a01b0316611f715760405163bd088b4f60e01b815260040160405180910390fd5b506033546001600160a01b031690565b80156109a95760405163a9059cbb60e01b81526001600160a01b0383811660048301526024820183905284169063a9059cbb90604401611a2b565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930090565b60048101805461ff00191661030017905560018101546002820154612011916001600160a01b031690610d196119ca565b6001810154815460028301546040519081526001600160a01b03928316929091169084907ff0912efb86ea1d65a17d64d48393cdb1ca0ea5220dd2bbe438621199d30955b79060200161193f565b6001600160a01b0381166120865760405163616bc44160e11b815260040160405180910390fd5b603380546001600160a01b0319166001600160a01b0383169081179091556040517f81dcb738da3dabd5bb2adbc7dd107fbbfca936e9c8aecab25f5b17a710a784c790600090a250565b6000806120db611f21565b6001600160a01b031663561285e4856120f2611f45565b6040518363ffffffff1660e01b815260040161210f929190613389565b60a060405180830381865afa15801561212c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061215091906134a5565b51905061215d818461330c565b949350505050565b6040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a081019190915260016121a460208061330c565b6121ae919061330c565b6121b990606061330c565b82519081149060016121cc60208061330c565b6121d6919061330c565b6121e190606061330c565b909161220257604051633fdf342360e01b8152600401610535929190613054565b505060008060008480602001905181019061221d9190613524565b925092509250600061223086606061296e565b90506000612249876122446020606061330c565b61296e565b9050600061226d88602061225e81606061330c565b612268919061330c565b6129b9565b6040805160c081018252978852602088019690965294860193909352606085019190915260808401525060ff1660a082015292915050565b6000806122b1846113e2565b905060006122bd611f21565b6001600160a01b03166325d9897e836122d4611f45565b6040518363ffffffff1660e01b81526004016122f1929190613389565b61014060405180830381865afa15801561230f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061233391906133b9565b80519091506000036123585760405163307efdb760e11b815260040160405180910390fd5b84516020808701516040808901518151938401949094528201526060808201929092526001600160601b031984831b811660808301529189901b909116609482015260009060a8016040516020818303038152906040528051906020012090506123c181611073565b1581906123e45760405163124a23f160e11b815260040161053591815260200190565b5060006123f58484600001516120d0565b60345490915060009061241890600160a01b90046001600160401b03164261330c565b60408051610120810182526001600160a01b0380891682528d1660208201529081018b9052600060608201529091506080810160028152602001600481524260208083019190915260408083018590526060928301869052600087815260378352819020845181546001600160a01b039182166001600160a01b0319918216178355938601516001808401805492909316919095161790559084015160028201559183015160038084019190915560808401516004840180549193909260ff199092169184908111156124ed576124ed612d8b565b021790555060a082015160048201805461ff00191661010083600581111561251757612517612d8b565b021790555060c0820151816005015560e082015181600601556101008201518160070155905050896001600160a01b0316856001600160a01b0316847ffb70faf7306b83c2cec6d8c1627baad892cb79968a02cc0353174499ecfd8b358c8c604001518c878960405161258e959493929190613552565b60405180910390a4509098975050505050505050565b805182516000911480156125bf575081604001518360400151145b80156109dd575050602090810151910151141590565b60408051606081018252825181526020808401519082015282820151918101919091526000908161260582611e28565b905061215d81856060015186608001518760a0015160405160200161264a93929190928352602083019190915260f81b6001600160f81b031916604082015260410190565b604051602081830303815290604052612a04565b600080612669611f45565b90506000612675611f21565b6001600160a01b03166325d9897e87846040518363ffffffff1660e01b81526004016126a2929190613389565b61014060405180830381865afa1580156126c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126e491906133b9565b60365490915060009061270990869063ffffffff600160201b909104811690612a2e16565b9050851580159061271a5750808611155b8682909161273d5760405163cc6b7c4160e01b8152600401610535929190613054565b5050600061274f878460000151612a8e565b60608401516036549192506000916127709163ffffffff9081169116612a8e565b9050600061277e8284612a2e565b9050856001600160a01b031663cb8347fe8b8b846040516020016127a3929190613054565b6040516020818303038152906040526040518363ffffffff1660e01b81526004016127cf929190613365565b600060405180830381600087803b1580156127e957600080fd5b505af11580156127fd573d6000803e3d6000fd5b50929c9b505050505050505050505050565b612817612aa5565b610a1157604051631afcd79f60e31b815260040160405180910390fd5b61150e61280f565b61284461280f565b604080517fd87cd6ef79d4e2b95e15ce8abf732db51ec771f1ca2edccf22a46c729ac5647260208201527f171a7fa058648750a8c5aae430f30db8d0100efc3a5e1b2e8054b1c1ce28b6b4918101919091527f044852b2a670ade5407e78fb2863c51de9fcb96542a07186fe3aeda6bb8a116d60608201524660808201523060a08201527fa070ffb1cd7409649bf77822cce74495468e06dbfaef09556838bf188679b9c260c082015260e00160408051601f198184030181529190528051602090910120600055565b801561296a57604051630852cd8d60e31b8152600481018290526001600160a01b038316906342966c6890602401600060405180830381600087803b15801561295657600080fd5b505af115801561105a573d6000803e3d6000fd5b5050565b600061297b60208361330c565b8351908110159061298d60208561330c565b90916129ae57604051633fdf342360e01b8152600401610535929190613054565b505050016020015190565b60006129c660018361330c565b835190811015906129d860018561330c565b90916129f957604051633fdf342360e01b8152600401610535929190613054565b505050016001015190565b600080600080612a148686612abf565b925092509250612a248282612b0c565b5090949350505050565b6000612a3d83620f4240101590565b80612a505750612a5082620f4240101590565b83839091612a735760405163768bf0eb60e11b8152600401610535929190613054565b50620f42409050612a848385613585565b6109dd9190613466565b600081831115612a9e57816109dd565b5090919050565b6000612aaf6115f2565b54600160401b900460ff16919050565b60008060008351604103612af95760208401516040850151606086015160001a612aeb88828585612bc5565b955095509550505050612b05565b50508151600091506002905b9250925092565b6000826003811115612b2057612b20612d8b565b03612b29575050565b6001826003811115612b3d57612b3d612d8b565b03612b5b5760405163f645eedf60e01b815260040160405180910390fd5b6002826003811115612b6f57612b6f612d8b565b03612b905760405163fce698f760e01b815260048101829052602401610535565b6003826003811115612ba457612ba4612d8b565b0361296a576040516335e2f38360e21b815260048101829052602401610535565b600080806fa2a8918ca85bafe22016d0b997e4df60600160ff1b03841115612bf65750600091506003905082612c80565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa158015612c4a573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116612c7657506000925060019150829050612c80565b9250600091508190505b9450945094915050565b60008060408385031215612c9d57600080fd5b50508035926020909101359150565b63ffffffff91909116815260200190565b6001600160a01b038116811461074557600080fd5b6001600160401b038116811461074557600080fd5b63ffffffff8116811461074557600080fd5b60008060008060008060c08789031215612d1257600080fd5b8635612d1d81612cbd565b95506020870135612d2d81612cbd565b94506040870135612d3d81612cd2565b9350606087013592506080870135612d5481612ce7565b915060a0870135612d6481612ce7565b809150509295509295509295565b600060208284031215612d8457600080fd5b5035919050565b634e487b7160e01b600052602160045260246000fd5b60068110612db157612db1612d8b565b9052565b6001600160a01b038a81168252891660208201526040810188905260608101879052610120810160048710612dec57612dec612d8b565b866080830152612dff60a0830187612da1565b8460c08301528360e0830152826101008301529a9950505050505050505050565b6001600160a01b0391909116815260200190565b60008060408385031215612e4757600080fd5b8235612e5281612cbd565b946020939093013593505050565b6001600160401b0391909116815260200190565b60006060828403128015612e8757600080fd5b509092915050565b600060208284031215612ea157600080fd5b813561113a81612ce7565b60008060008060808587031215612ec257600080fd5b8435612ecd81612cbd565b93506020850135612edd81612cbd565b93969395505050506040820135916060013590565b600060208284031215612f0457600080fd5b813561113a81612cbd565b801515811461074557600080fd5b60008060008060808587031215612f3357600080fd5b84359350602085013592506040850135612f4c81612f0f565b9396929550929360600135925050565b60008083601f840112612f6e57600080fd5b5081356001600160401b03811115612f8557600080fd5b602083019150836020828501011115612f9d57600080fd5b9250929050565b60008060208385031215612fb757600080fd5b82356001600160401b03811115612fcd57600080fd5b612fd985828601612f5c565b90969095509350505050565b60008060008060408587031215612ffb57600080fd5b84356001600160401b0381111561301157600080fd5b61301d87828801612f5c565b90955093505060208501356001600160401b0381111561303c57600080fd5b61304887828801612f5c565b95989497509550505050565b918252602082015260400190565b60405160c081016001600160401b038111828210171561309257634e487b7160e01b600052604160045260246000fd5b60405290565b60405161012081016001600160401b038111828210171561309257634e487b7160e01b600052604160045260246000fd5b60405161014081016001600160401b038111828210171561309257634e487b7160e01b600052604160045260246000fd5b600060c082840312801561310d57600080fd5b506000613118613062565b833581526020808501359082015260408085013590820152606080850135908201526080808501359082015260a084013560ff81168114613157578283fd5b60a0820152949350505050565b600060c0828403121561317657600080fd5b50919050565b600080610180838503121561319057600080fd5b61319a8484613164565b91506131a98460c08501613164565b90509250929050565b6000602082840312156131c457600080fd5b813561113a81612cd2565b602081016109e08284612da1565b600060608284031280156131f057600080fd5b50604051600090606081016001600160401b038111828210171561322257634e487b7160e01b83526041600452602483fd5b604090815284358252602080860135908301529384013593810193909352509092915050565b805161325381612cbd565b919050565b6000610120828403121561326b57600080fd5b613273613098565b905061327e82613248565b81526020828101519082015260408083015190820152606080830151908201526080808301519082015260a0808301519082015260c0808301519082015260e080830151908201526101009182015191810191909152919050565b600061012082840312156132ec57600080fd5b6109dd8383613258565b634e487b7160e01b600052601160045260246000fd5b808201808211156109e0576109e06132f6565b6000815180845260005b8181101561334557602081850181015186830182015201613329565b506000602082860101526020601f19601f83011685010191505092915050565b6001600160a01b038316815260406020820181905260009061215d9083018461331f565b6001600160a01b0392831681529116602082015260400190565b805161325381612ce7565b805161325381612cd2565b60006101408284031280156133cd57600080fd5b5060006133d86130c9565b8351815260208085015190820152604080850151908201526133fc606085016133a3565b606082015261340d608085016133ae565b608082015261341e60a085016133ae565b60a082015261342f60c085016133a3565b60c082015261344060e085016133ae565b60e082015261010084810151908201526101209384015193810193909352509092915050565b60008261348357634e487b7160e01b600052601260045260246000fd5b500490565b60006020828403121561349a57600080fd5b815161113a81612f0f565b600060a08284031280156134b857600080fd5b5060405160009060a081016001600160401b03811182821017156134ea57634e487b7160e01b83526041600452602483fd5b6040908152845182526020808601519083015284810151908201526060808501519082015260809384015193810193909352509092915050565b60008060006060848603121561353957600080fd5b5050815160208301516040909301519094929350919050565b85815284602082015260a06040820152600061357160a083018661331f565b606083019490945250608001529392505050565b80820281158282048414176109e0576109e06132f656fe6d800aaaf64b9a1f321dcd63da04369d33d8a0d49ad0fbba085aab4a98bf31c4a2646970667358221220d50b3dec1e5d2d1d140733dca7d5163900c1fc882947b3208864910c6f452d0e64736f6c634300081b0033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101a15760003560e01c8063050b17ad146101a65780630533e1ba146101bb5780630bc7344b146101e857806311be1997146101fb578063169729781461027857806317337b461461028b5780631792f1941461029557806326058249146102a857806329e03ff1146102c857806336167e03146102df5780634bc5839a146102f25780635aea0ec4146103055780635bf31d4d146103265780636369df6b146103405780636cc6cde114610353578063715018a61461036657806376c993ae1461036e5780638d4e9008146103815780638da5cb5b14610394578063902a49381461039c5780639334ea52146103ac57806393a90a1e146103bf5780639f81a7cf146103d2578063b0e2f7e9146103e5578063b0eefabe146103f8578063bb2a2b471461040b578063be41f38414610419578063c133b4291461043c578063c50a77b11461044f578063c894222e14610462578063c9747f5114610483578063cc2d55cd14610496578063d36fc9d4146104a5578063d76f62d1146104b8578063f2fde38b146104cb575b600080fd5b6101b96101b4366004612c8a565b6104de565b005b6036546101d290600160201b900463ffffffff1681565b6040516101df9190612cac565b60405180910390f35b6101b96101f6366004612cf9565b6105fc565b610263610209366004612d72565b603760205260009081526040902080546001820154600283015460038401546004850154600586015460068701546007909701546001600160a01b039687169796909516959394929360ff80841694610100909404169289565b6040516101df99989796959493929190612db5565b6101b9610286366004612d72565b610734565b6101d26207a12081565b6101b96102a3366004612d72565b610748565b6033546102bb906001600160a01b031681565b6040516101df9190612e20565b6102d160355481565b6040519081526020016101df565b6101b96102ed366004612d72565b6108a8565b6102d1610300366004612e34565b6109ae565b603454600160a01b90046001600160401b03165b6040516101df9190612e60565b60345461031990600160a01b90046001600160401b031681565b6102d161034e366004612e74565b6109e6565b6034546102bb906001600160a01b031681565b6101b96109ff565b6101b961037c366004612e8f565b610a13565b6102d161038f366004612eac565b610a24565b6102bb610dc5565b6036546101d29063ffffffff1681565b6101b96103ba366004612d72565b610de0565b6101b96103cd366004612ef2565b610edf565b6101b96103e0366004612e8f565b610ef0565b6101b96103f3366004612f1d565b610f01565b6101b9610406366004612ef2565b611062565b60365463ffffffff166101d2565b61042c610427366004612d72565b611073565b60405190151581526020016101df565b6102d161044a366004612ef2565b6110a9565b6102d161045d366004612fa4565b611141565b610475610470366004612fe5565b6111d4565b6040516101df929190613054565b6102bb6104913660046130fa565b6113e2565b6102d1670de0b6b3a764000081565b61042c6104b336600461317c565b6114cd565b6101b96104c63660046131b2565b6114f5565b6101b96104d9366004612ef2565b611506565b6034546001600160a01b031633146105095760405163a8baf3bb60e01b815260040160405180910390fd5b8161051381611073565b819061053e576040516314a03bbd60e21b815260040161053591815260200190565b60405180910390fd5b506004600082815260376020526040902060040154610100900460ff16600581111561056c5761056c612d8b565b600083815260376020526040902060040154610100900460ff1691146105a65760405163146e540f60e21b815260040161053591906131cf565b506000838152603760205260409020600301548390156105dc576040516364d0c32b60e01b815260040161053591815260200190565b5060008381526037602052604090206105f6848285611541565b50505050565b60006106066115f2565b805490915060ff600160401b82041615906001600160401b031660008115801561062d5750825b90506000826001600160401b031660011480156106495750303b155b905081158015610657575080155b156106755760405163f92ee8a960e01b815260040160405180910390fd5b84546001600160401b0319166001178555831561069e57845460ff60401b1916600160401b1785555b6106a78b61161b565b6106af61162c565b6106b88a61163c565b6106c1896116ad565b6106ca88611736565b6106d387611799565b6106dc8661180b565b831561072757845460ff60401b191685556040517fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29061071e90600190612e60565b60405180910390a15b5050505050505050505050565b61073c611892565b61074581611736565b50565b8061075281611073565b8190610774576040516314a03bbd60e21b815260040161053591815260200190565b506000818152603760205260409020600101546001600160a01b031633146107af5760405163082c005560e41b815260040160405180910390fd5b816107b981611073565b81906107db576040516314a03bbd60e21b815260040161053591815260200190565b506004600082815260376020526040902060040154610100900460ff16600581111561080957610809612d8b565b600083815260376020526040902060040154610100900460ff1691146108435760405163146e540f60e21b815260040161053591906131cf565b506000838152603760205260409020600681015442101561087757604051631d7753d560e11b815260040160405180910390fd5b61088184826118c4565b6003810154156105f657600381015460008181526037602052604090206105f691906118c4565b6034546001600160a01b031633146108d35760405163a8baf3bb60e01b815260040160405180910390fd5b806108dd81611073565b81906108ff576040516314a03bbd60e21b815260040161053591815260200190565b506004600082815260376020526040902060040154610100900460ff16600581111561092d5761092d612d8b565b600083815260376020526040902060040154610100900460ff1691146109675760405163146e540f60e21b815260040161053591906131cf565b506000828152603760205260409020600381015483901561099e576040516364d0c32b60e01b815260040161053591815260200190565b506109a9838261194b565b505050565b60006109cf336035546109bf6119ca565b6001600160a01b031691906119ee565b6109dd336035548585611aa6565b90505b92915050565b60006109e06109fa368490038401846131dd565b611e28565b610a07611892565b610a116000611ec5565b565b610a1b611892565b61074581611799565b6034546000906001600160a01b03163314610a525760405163a8baf3bb60e01b815260040160405180910390fd5b6040516001600160601b0319606087901b166020820152656c656761637960d01b6034820152600090603a016040516020818303038152906040528051906020012090506000610aa0611f21565b6001600160a01b0316630e022923886040518263ffffffff1660e01b8152600401610acb9190612e20565b61012060405180830381865afa158015610ae9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b0d91906132d9565b519050866001600160a01b038216610b39576040516334789d8b60e21b81526004016105359190612e20565b5060408051610120810182526001600160a01b038381168252881660208201526000918101829052606081019190915260036080820152600160a08201524260c0820181905260345460e0830191610ba191600160a01b90046001600160401b03169061330c565b81526000602091820181905284815260378252604090819020835181546001600160a01b039182166001600160a01b0319918216178355938501516001808401805492909316919095161790559083015160028201556060830151600380830191909155608084015160048301805493949193909260ff1990911691908490811115610c2f57610c2f612d8b565b021790555060a082015160048201805461ff001916610100836005811115610c5957610c59612d8b565b021790555060c0820151600582015560e08201516006820155610100909101516007909101556000610c89611f45565b9050806001600160a01b031663cb8347fe838888604051602001610cae929190613054565b6040516020818303038152906040526040518363ffffffff1660e01b8152600401610cda929190613365565b600060405180830381600087803b158015610cf457600080fd5b505af1158015610d08573d6000803e3d6000fd5b50505050610d298786610d196119ca565b6001600160a01b03169190611f81565b604080516001600160a01b038a81168252602082018990529181018790528189169184169085907f587a1fc7e80e653a2ab7f63f98c080f5818b8cedcfd1374590c8c786290ed0319060600160405180910390a4866001600160a01b0316826001600160a01b03168460008051602061359d83398151915288604051610db191815260200190565b60405180910390a450909695505050505050565b600080610dd0611fbc565b546001600160a01b031692915050565b6034546001600160a01b03163314610e0b5760405163a8baf3bb60e01b815260040160405180910390fd5b80610e1581611073565b8190610e37576040516314a03bbd60e21b815260040161053591815260200190565b506004600082815260376020526040902060040154610100900460ff166005811115610e6557610e65612d8b565b600083815260376020526040902060040154610100900460ff169114610e9f5760405163146e540f60e21b815260040161053591906131cf565b506000828152603760205260409020610eb88382611fe0565b6003810154156109a957600381015460008181526037602052604090206109a99190611fe0565b610ee7611892565b6107458161205f565b610ef8611892565b6107458161180b565b6034546001600160a01b03163314610f2c5760405163a8baf3bb60e01b815260040160405180910390fd5b83610f3681611073565b8190610f58576040516314a03bbd60e21b815260040161053591815260200190565b506004600082815260376020526040902060040154610100900460ff166005811115610f8657610f86612d8b565b600083815260376020526040902060040154610100900460ff169114610fc05760405163146e540f60e21b815260040161053591906131cf565b5060008581526037602052604090206003015415158590610ffa57604051600162d62c0760e01b0319815260040161053591815260200190565b506000858152603760205260409020611014868287611541565b831561103d5760038101546000818152603760205260409020611038919085611541565b61105a565b6003810154600081815260376020526040902061105a9190611fe0565b505050505050565b61106a611892565b6107458161163c565b600080600083815260376020526040902060040154610100900460ff1660058111156110a1576110a1612d8b565b141592915050565b6000806110b4611f21565b6001600160a01b03166325d9897e846110cb611f45565b6040518363ffffffff1660e01b81526004016110e8929190613389565b61014060405180830381865afa158015611106573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061112a91906133b9565b905061113a8382600001516120d0565b9392505050565b6000611152336035546109bf6119ca565b6109dd3360355461119886868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061216592505050565b86868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506122a592505050565b6000806000339050600061121d88888080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061216592505050565b9050600061126087878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061216592505050565b905061126c82826125a4565b825160208085015160408087015186519387015191870151949592949093926112cb57604051636aba529760e11b81526004810196909652602486019490945260448501929092526064840152608483015260a482015260c401610535565b5050505050506112e0336035546109bf6119ca565b60006113328460026035546112f59190613466565b858d8d8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506122a592505050565b905060006113868560026035546113499190613466565b858c8c8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506122a592505050565b60008381526037602052604080822060039081018490558383528183200185905551919250829184917ffec135a4cf8e5c6e13dea23be058bf03a8bf8f1f6fb0a021b0a5aeddfba8140791a3909a909950975050505050505050565b6000806113ee836125d5565b905060006113fa611f45565b6001600160a01b0316630e022923836040518263ffffffff1660e01b81526004016114259190612e20565b61012060405180830381865afa158015611443573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061146791906132d9565b805190915082906001600160a01b0316611495576040516334789d8b60e21b81526004016105359190612e20565b5060408401516020820151908181146114c357604051630a24cfe560e21b8152600401610535929190613054565b5050519392505050565b60006109dd6114e1368590038501856130fa565b6114f0368590038501856130fa565b6125a4565b6114fd611892565b610745816116ad565b61150e611892565b6001600160a01b038116611538576000604051631e4fbdf760e01b81526004016105359190612e20565b61074581611ec5565b81546007830154600091611562916001600160a01b0390911690849061265e565b60048401805461ff001916610100179055600184015460028501549192506115a2916001600160a01b039091169061159a908461330c565b610d196119ca565b6001830154835460028501546001600160a01b039283169290911690869060008051602061359d833981519152906115db90869061330c565b60405190815260200160405180910390a450505050565b6000807ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a006109e0565b61162361280f565b61074581612834565b61163461280f565b610a1161283c565b6001600160a01b0381166116635760405163616bc44160e11b815260040160405180910390fd5b603480546001600160a01b0319166001600160a01b0383169081179091556040517f51744122301b50e919f4e3d22adf8c53abc92195b8c667eda98c6ef20375672e90600090a250565b806001600160401b03166000036116d75760405163c4411f1160e01b815260040160405180910390fd5b60348054600160a01b600160e01b031916600160a01b6001600160401b038416021790556040517f310462a9bf49fff4a57910ec647c77cbf8aaf2f13394554ac6cdf14fc68db7e69061172b908390612e60565b60405180910390a150565b80670de0b6b3a76400008110156117635760405163033f4e0560e01b815260040161053591815260200190565b5060358190556040518181527f97896b9da0f97f36bf3011570bcff930069299de4b1e89c9cb44909841cac2f89060200161172b565b806207a12063ffffffff821611156117c55760405163432e664360e11b81526004016105359190612cac565b506036805463ffffffff191663ffffffff83161790556040517fc573dc0f869f6a1d0a74fc7712a63baabcb5567131d2d98005e163924eddcbab9061172b908390612cac565b8063ffffffff8116620f4240101561183757604051634e9374fb60e11b81526004016105359190612cac565b506036805463ffffffff60201b1916600160201b63ffffffff848116820292909217928390556040517f7efaf01bec3cda8d104163bb466d01d7e16f68848301c7eb0749cfa59d6805029361172b9392900490911690612cac565b3361189b610dc5565b6001600160a01b031614610a11573360405163118cdaa760e01b81526004016105359190612e20565b60048101805461ff001916610500179055600181015460028201546118f5916001600160a01b031690610d196119ca565b6001810154815460028301546040519081526001600160a01b03928316929091169084907f223103f8eb52e5f43a75655152acd882a605d70df57a5c0fefd30f516b1756d2906020015b60405180910390a45050565b60048101805461ff001916610200179055600281015461197c9061196d6119ca565b6001600160a01b03169061290e565b6001810154815460028301546040519081526001600160a01b03928316929091169084907f2226ebd23625a7938fb786df2248bd171d2e6ad70cb2b654ea1be830ca17224d9060200161193f565b7f000000000000000000000000000000000000000000000000000000000000000090565b80156109a9576040516323b872dd60e01b81526001600160a01b038381166004830152306024830152604482018390528416906323b872dd906064015b6020604051808303816000875af1158015611a4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a6e9190613488565b6109a95760405162461bcd60e51b815260206004820152600960248201526810ba3930b739b332b960b91b6044820152606401610535565b6040516001600160601b0319606084901b166020820152603481018290526000908190605401604051602081830303815290604052805190602001209050611aed81611073565b158190611b105760405163124a23f160e11b815260040161053591815260200190565b506000611b1b611f45565b90506000816001600160a01b0316630e022923876040518263ffffffff1660e01b8152600401611b4b9190612e20565b61012060405180830381865afa158015611b69573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b8d91906132d9565b8051909150866001600160a01b038216611bbb576040516334789d8b60e21b81526004016105359190612e20565b506000611bc6611f21565b6001600160a01b03166325d9897e83866040518363ffffffff1660e01b8152600401611bf3929190613389565b61014060405180830381865afa158015611c11573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c3591906133b9565b8051909150600003611c5a5760405163307efdb760e11b815260040160405180910390fd5b6000611c6a8383600001516120d0565b603454909150600090611c8d90600160a01b90046001600160401b03164261330c565b604080516101208101825287516001600160a01b0390811682528f1660208201529081018d905260006060820152909150608081016001815260200160048152426020808301919091526040808301859052606092830186905260008b815260378352819020845181546001600160a01b039182166001600160a01b0319918216178355938601516001808401805492909316919095161790559084015160028201559183015160038084019190915560808401516004840180549193909260ff19909216918490811115611d6457611d64612d8b565b021790555060a082015160048201805461ff001916610100836005811115611d8e57611d8e612d8b565b021790555060c0820151600582015560e08201516006820155610100909101516007909101558451604080518d81526001600160a01b038d811660208301529181018c90526060810185905260808101849052818f16929091169089907f8a1eccecce948a912e2e195de5960359755aeac90ad88a3fde55a77e1a73796b9060a00160405180910390a450949a9950505050505050505050565b600054815160208084015160409485015185517f32dd026408194a0d7e54cc66a2ab6c856efc55cfcd4dd258fde5b1a55222baa6818501528087019490945260608401919091526080808401919091528451808403909101815260a08301855280519082012061190160f01b60c084015260c283019390935260e28083019390935283518083039093018352610102909101909252805191012090565b6000611ecf611fbc565b80546001600160a01b038481166001600160a01b031983168117845560405193945091169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b6033546000906001600160a01b0316611f715760405163bd088b4f60e01b815260040160405180910390fd5b506033546001600160a01b031690565b80156109a95760405163a9059cbb60e01b81526001600160a01b0383811660048301526024820183905284169063a9059cbb90604401611a2b565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930090565b60048101805461ff00191661030017905560018101546002820154612011916001600160a01b031690610d196119ca565b6001810154815460028301546040519081526001600160a01b03928316929091169084907ff0912efb86ea1d65a17d64d48393cdb1ca0ea5220dd2bbe438621199d30955b79060200161193f565b6001600160a01b0381166120865760405163616bc44160e11b815260040160405180910390fd5b603380546001600160a01b0319166001600160a01b0383169081179091556040517f81dcb738da3dabd5bb2adbc7dd107fbbfca936e9c8aecab25f5b17a710a784c790600090a250565b6000806120db611f21565b6001600160a01b031663561285e4856120f2611f45565b6040518363ffffffff1660e01b815260040161210f929190613389565b60a060405180830381865afa15801561212c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061215091906134a5565b51905061215d818461330c565b949350505050565b6040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a081019190915260016121a460208061330c565b6121ae919061330c565b6121b990606061330c565b82519081149060016121cc60208061330c565b6121d6919061330c565b6121e190606061330c565b909161220257604051633fdf342360e01b8152600401610535929190613054565b505060008060008480602001905181019061221d9190613524565b925092509250600061223086606061296e565b90506000612249876122446020606061330c565b61296e565b9050600061226d88602061225e81606061330c565b612268919061330c565b6129b9565b6040805160c081018252978852602088019690965294860193909352606085019190915260808401525060ff1660a082015292915050565b6000806122b1846113e2565b905060006122bd611f21565b6001600160a01b03166325d9897e836122d4611f45565b6040518363ffffffff1660e01b81526004016122f1929190613389565b61014060405180830381865afa15801561230f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061233391906133b9565b80519091506000036123585760405163307efdb760e11b815260040160405180910390fd5b84516020808701516040808901518151938401949094528201526060808201929092526001600160601b031984831b811660808301529189901b909116609482015260009060a8016040516020818303038152906040528051906020012090506123c181611073565b1581906123e45760405163124a23f160e11b815260040161053591815260200190565b5060006123f58484600001516120d0565b60345490915060009061241890600160a01b90046001600160401b03164261330c565b60408051610120810182526001600160a01b0380891682528d1660208201529081018b9052600060608201529091506080810160028152602001600481524260208083019190915260408083018590526060928301869052600087815260378352819020845181546001600160a01b039182166001600160a01b0319918216178355938601516001808401805492909316919095161790559084015160028201559183015160038084019190915560808401516004840180549193909260ff199092169184908111156124ed576124ed612d8b565b021790555060a082015160048201805461ff00191661010083600581111561251757612517612d8b565b021790555060c0820151816005015560e082015181600601556101008201518160070155905050896001600160a01b0316856001600160a01b0316847ffb70faf7306b83c2cec6d8c1627baad892cb79968a02cc0353174499ecfd8b358c8c604001518c878960405161258e959493929190613552565b60405180910390a4509098975050505050505050565b805182516000911480156125bf575081604001518360400151145b80156109dd575050602090810151910151141590565b60408051606081018252825181526020808401519082015282820151918101919091526000908161260582611e28565b905061215d81856060015186608001518760a0015160405160200161264a93929190928352602083019190915260f81b6001600160f81b031916604082015260410190565b604051602081830303815290604052612a04565b600080612669611f45565b90506000612675611f21565b6001600160a01b03166325d9897e87846040518363ffffffff1660e01b81526004016126a2929190613389565b61014060405180830381865afa1580156126c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126e491906133b9565b60365490915060009061270990869063ffffffff600160201b909104811690612a2e16565b9050851580159061271a5750808611155b8682909161273d5760405163cc6b7c4160e01b8152600401610535929190613054565b5050600061274f878460000151612a8e565b60608401516036549192506000916127709163ffffffff9081169116612a8e565b9050600061277e8284612a2e565b9050856001600160a01b031663cb8347fe8b8b846040516020016127a3929190613054565b6040516020818303038152906040526040518363ffffffff1660e01b81526004016127cf929190613365565b600060405180830381600087803b1580156127e957600080fd5b505af11580156127fd573d6000803e3d6000fd5b50929c9b505050505050505050505050565b612817612aa5565b610a1157604051631afcd79f60e31b815260040160405180910390fd5b61150e61280f565b61284461280f565b604080517fd87cd6ef79d4e2b95e15ce8abf732db51ec771f1ca2edccf22a46c729ac5647260208201527f171a7fa058648750a8c5aae430f30db8d0100efc3a5e1b2e8054b1c1ce28b6b4918101919091527f044852b2a670ade5407e78fb2863c51de9fcb96542a07186fe3aeda6bb8a116d60608201524660808201523060a08201527fa070ffb1cd7409649bf77822cce74495468e06dbfaef09556838bf188679b9c260c082015260e00160408051601f198184030181529190528051602090910120600055565b801561296a57604051630852cd8d60e31b8152600481018290526001600160a01b038316906342966c6890602401600060405180830381600087803b15801561295657600080fd5b505af115801561105a573d6000803e3d6000fd5b5050565b600061297b60208361330c565b8351908110159061298d60208561330c565b90916129ae57604051633fdf342360e01b8152600401610535929190613054565b505050016020015190565b60006129c660018361330c565b835190811015906129d860018561330c565b90916129f957604051633fdf342360e01b8152600401610535929190613054565b505050016001015190565b600080600080612a148686612abf565b925092509250612a248282612b0c565b5090949350505050565b6000612a3d83620f4240101590565b80612a505750612a5082620f4240101590565b83839091612a735760405163768bf0eb60e11b8152600401610535929190613054565b50620f42409050612a848385613585565b6109dd9190613466565b600081831115612a9e57816109dd565b5090919050565b6000612aaf6115f2565b54600160401b900460ff16919050565b60008060008351604103612af95760208401516040850151606086015160001a612aeb88828585612bc5565b955095509550505050612b05565b50508151600091506002905b9250925092565b6000826003811115612b2057612b20612d8b565b03612b29575050565b6001826003811115612b3d57612b3d612d8b565b03612b5b5760405163f645eedf60e01b815260040160405180910390fd5b6002826003811115612b6f57612b6f612d8b565b03612b905760405163fce698f760e01b815260048101829052602401610535565b6003826003811115612ba457612ba4612d8b565b0361296a576040516335e2f38360e21b815260048101829052602401610535565b600080806fa2a8918ca85bafe22016d0b997e4df60600160ff1b03841115612bf65750600091506003905082612c80565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa158015612c4a573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116612c7657506000925060019150829050612c80565b9250600091508190505b9450945094915050565b60008060408385031215612c9d57600080fd5b50508035926020909101359150565b63ffffffff91909116815260200190565b6001600160a01b038116811461074557600080fd5b6001600160401b038116811461074557600080fd5b63ffffffff8116811461074557600080fd5b60008060008060008060c08789031215612d1257600080fd5b8635612d1d81612cbd565b95506020870135612d2d81612cbd565b94506040870135612d3d81612cd2565b9350606087013592506080870135612d5481612ce7565b915060a0870135612d6481612ce7565b809150509295509295509295565b600060208284031215612d8457600080fd5b5035919050565b634e487b7160e01b600052602160045260246000fd5b60068110612db157612db1612d8b565b9052565b6001600160a01b038a81168252891660208201526040810188905260608101879052610120810160048710612dec57612dec612d8b565b866080830152612dff60a0830187612da1565b8460c08301528360e0830152826101008301529a9950505050505050505050565b6001600160a01b0391909116815260200190565b60008060408385031215612e4757600080fd5b8235612e5281612cbd565b946020939093013593505050565b6001600160401b0391909116815260200190565b60006060828403128015612e8757600080fd5b509092915050565b600060208284031215612ea157600080fd5b813561113a81612ce7565b60008060008060808587031215612ec257600080fd5b8435612ecd81612cbd565b93506020850135612edd81612cbd565b93969395505050506040820135916060013590565b600060208284031215612f0457600080fd5b813561113a81612cbd565b801515811461074557600080fd5b60008060008060808587031215612f3357600080fd5b84359350602085013592506040850135612f4c81612f0f565b9396929550929360600135925050565b60008083601f840112612f6e57600080fd5b5081356001600160401b03811115612f8557600080fd5b602083019150836020828501011115612f9d57600080fd5b9250929050565b60008060208385031215612fb757600080fd5b82356001600160401b03811115612fcd57600080fd5b612fd985828601612f5c565b90969095509350505050565b60008060008060408587031215612ffb57600080fd5b84356001600160401b0381111561301157600080fd5b61301d87828801612f5c565b90955093505060208501356001600160401b0381111561303c57600080fd5b61304887828801612f5c565b95989497509550505050565b918252602082015260400190565b60405160c081016001600160401b038111828210171561309257634e487b7160e01b600052604160045260246000fd5b60405290565b60405161012081016001600160401b038111828210171561309257634e487b7160e01b600052604160045260246000fd5b60405161014081016001600160401b038111828210171561309257634e487b7160e01b600052604160045260246000fd5b600060c082840312801561310d57600080fd5b506000613118613062565b833581526020808501359082015260408085013590820152606080850135908201526080808501359082015260a084013560ff81168114613157578283fd5b60a0820152949350505050565b600060c0828403121561317657600080fd5b50919050565b600080610180838503121561319057600080fd5b61319a8484613164565b91506131a98460c08501613164565b90509250929050565b6000602082840312156131c457600080fd5b813561113a81612cd2565b602081016109e08284612da1565b600060608284031280156131f057600080fd5b50604051600090606081016001600160401b038111828210171561322257634e487b7160e01b83526041600452602483fd5b604090815284358252602080860135908301529384013593810193909352509092915050565b805161325381612cbd565b919050565b6000610120828403121561326b57600080fd5b613273613098565b905061327e82613248565b81526020828101519082015260408083015190820152606080830151908201526080808301519082015260a0808301519082015260c0808301519082015260e080830151908201526101009182015191810191909152919050565b600061012082840312156132ec57600080fd5b6109dd8383613258565b634e487b7160e01b600052601160045260246000fd5b808201808211156109e0576109e06132f6565b6000815180845260005b8181101561334557602081850181015186830182015201613329565b506000602082860101526020601f19601f83011685010191505092915050565b6001600160a01b038316815260406020820181905260009061215d9083018461331f565b6001600160a01b0392831681529116602082015260400190565b805161325381612ce7565b805161325381612cd2565b60006101408284031280156133cd57600080fd5b5060006133d86130c9565b8351815260208085015190820152604080850151908201526133fc606085016133a3565b606082015261340d608085016133ae565b608082015261341e60a085016133ae565b60a082015261342f60c085016133a3565b60c082015261344060e085016133ae565b60e082015261010084810151908201526101209384015193810193909352509092915050565b60008261348357634e487b7160e01b600052601260045260246000fd5b500490565b60006020828403121561349a57600080fd5b815161113a81612f0f565b600060a08284031280156134b857600080fd5b5060405160009060a081016001600160401b03811182821017156134ea57634e487b7160e01b83526041600452602483fd5b6040908152845182526020808601519083015284810151908201526060808501519082015260809384015193810193909352509092915050565b60008060006060848603121561353957600080fd5b5050815160208301516040909301519094929350919050565b85815284602082015260a06040820152600061357160a083018661331f565b606083019490945250608001529392505050565b80820281158282048414176109e0576109e06132f656fe6d800aaaf64b9a1f321dcd63da04369d33d8a0d49ad0fbba085aab4a98bf31c4a2646970667358221220d50b3dec1e5d2d1d140733dca7d5163900c1fc882947b3208864910c6f452d0e64736f6c634300081b0033", + "linkReferences": {}, + "deployedLinkReferences": {} +} \ No newline at end of file diff --git a/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/SubgraphServiceProxies#OZProxyDummy_DisputeManager.json b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/SubgraphServiceProxies#OZProxyDummy_DisputeManager.json new file mode 100644 index 000000000..8fbd24cbb --- /dev/null +++ b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/SubgraphServiceProxies#OZProxyDummy_DisputeManager.json @@ -0,0 +1,10 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "Dummy", + "sourceName": "contracts/mocks/Dummy.sol", + "abi": [], + "bytecode": "0x6080604052348015600f57600080fd5b50603f80601d6000396000f3fe6080604052600080fdfea264697066735822122081eeeeb2e55704976a5bd19451809712b1b76b2d5b7a994dc02b32128a829da764736f6c634300081b0033", + "deployedBytecode": "0x6080604052600080fdfea264697066735822122081eeeeb2e55704976a5bd19451809712b1b76b2d5b7a994dc02b32128a829da764736f6c634300081b0033", + "linkReferences": {}, + "deployedLinkReferences": {} +} \ No newline at end of file diff --git a/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/SubgraphServiceProxies#OZProxyDummy_SubgraphService.json b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/SubgraphServiceProxies#OZProxyDummy_SubgraphService.json new file mode 100644 index 000000000..8fbd24cbb --- /dev/null +++ b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/SubgraphServiceProxies#OZProxyDummy_SubgraphService.json @@ -0,0 +1,10 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "Dummy", + "sourceName": "contracts/mocks/Dummy.sol", + "abi": [], + "bytecode": "0x6080604052348015600f57600080fd5b50603f80601d6000396000f3fe6080604052600080fdfea264697066735822122081eeeeb2e55704976a5bd19451809712b1b76b2d5b7a994dc02b32128a829da764736f6c634300081b0033", + "deployedBytecode": "0x6080604052600080fdfea264697066735822122081eeeeb2e55704976a5bd19451809712b1b76b2d5b7a994dc02b32128a829da764736f6c634300081b0033", + "linkReferences": {}, + "deployedLinkReferences": {} +} \ No newline at end of file diff --git a/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/SubgraphServiceProxies#ProxyAdmin_DisputeManager.json b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/SubgraphServiceProxies#ProxyAdmin_DisputeManager.json new file mode 100644 index 000000000..2e9762744 --- /dev/null +++ b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/SubgraphServiceProxies#ProxyAdmin_DisputeManager.json @@ -0,0 +1,132 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "ProxyAdmin", + "sourceName": "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "initialOwner", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "OwnableInvalidOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "OwnableUnauthorizedAccount", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "inputs": [], + "name": "UPGRADE_INTERFACE_VERSION", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ITransparentUpgradeableProxy", + "name": "proxy", + "type": "address" + }, + { + "internalType": "address", + "name": "implementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ], + "bytecode": "0x608060405234801561001057600080fd5b5060405161055338038061055383398101604081905261002f916100be565b806001600160a01b03811661005e57604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b6100678161006e565b50506100ee565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000602082840312156100d057600080fd5b81516001600160a01b03811681146100e757600080fd5b9392505050565b610456806100fd6000396000f3fe60806040526004361061004a5760003560e01c8063715018a61461004f5780638da5cb5b146100665780639623609d14610091578063ad3cb1cc146100a4578063f2fde38b146100e2575b600080fd5b34801561005b57600080fd5b50610064610102565b005b34801561007257600080fd5b5061007b610116565b604051610088919061025d565b60405180910390f35b61006461009f36600461029c565b610125565b3480156100b057600080fd5b506100d5604051806040016040528060058152602001640352e302e360dc1b81525081565b60405161008891906103bd565b3480156100ee57600080fd5b506100646100fd3660046103d7565b610194565b61010a6101db565b610114600061020d565b565b6000546001600160a01b031690565b61012d6101db565b60405163278f794360e11b81526001600160a01b03841690634f1ef28690349061015d90869086906004016103f4565b6000604051808303818588803b15801561017657600080fd5b505af115801561018a573d6000803e3d6000fd5b5050505050505050565b61019c6101db565b6001600160a01b0381166101cf576000604051631e4fbdf760e01b81526004016101c6919061025d565b60405180910390fd5b6101d88161020d565b50565b336101e4610116565b6001600160a01b031614610114573360405163118cdaa760e01b81526004016101c6919061025d565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b0391909116815260200190565b6001600160a01b03811681146101d857600080fd5b634e487b7160e01b600052604160045260246000fd5b6000806000606084860312156102b157600080fd5b83356102bc81610271565b925060208401356102cc81610271565b915060408401356001600160401b038111156102e757600080fd5b8401601f810186136102f857600080fd5b80356001600160401b0381111561031157610311610286565b604051601f8201601f19908116603f011681016001600160401b038111828210171561033f5761033f610286565b60405281815282820160200188101561035757600080fd5b816020840160208301376000602083830101528093505050509250925092565b6000815180845260005b8181101561039d57602081850181015186830182015201610381565b506000602082860101526020601f19601f83011685010191505092915050565b6020815260006103d06020830184610377565b9392505050565b6000602082840312156103e957600080fd5b81356103d081610271565b6001600160a01b038316815260406020820181905260009061041890830184610377565b94935050505056fea2646970667358221220e77af71a19651e50da550702ce9a5b1b89dda100ca5f41a9c778b943df55af8064736f6c634300081b0033", + "deployedBytecode": "0x60806040526004361061004a5760003560e01c8063715018a61461004f5780638da5cb5b146100665780639623609d14610091578063ad3cb1cc146100a4578063f2fde38b146100e2575b600080fd5b34801561005b57600080fd5b50610064610102565b005b34801561007257600080fd5b5061007b610116565b604051610088919061025d565b60405180910390f35b61006461009f36600461029c565b610125565b3480156100b057600080fd5b506100d5604051806040016040528060058152602001640352e302e360dc1b81525081565b60405161008891906103bd565b3480156100ee57600080fd5b506100646100fd3660046103d7565b610194565b61010a6101db565b610114600061020d565b565b6000546001600160a01b031690565b61012d6101db565b60405163278f794360e11b81526001600160a01b03841690634f1ef28690349061015d90869086906004016103f4565b6000604051808303818588803b15801561017657600080fd5b505af115801561018a573d6000803e3d6000fd5b5050505050505050565b61019c6101db565b6001600160a01b0381166101cf576000604051631e4fbdf760e01b81526004016101c6919061025d565b60405180910390fd5b6101d88161020d565b50565b336101e4610116565b6001600160a01b031614610114573360405163118cdaa760e01b81526004016101c6919061025d565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b0391909116815260200190565b6001600160a01b03811681146101d857600080fd5b634e487b7160e01b600052604160045260246000fd5b6000806000606084860312156102b157600080fd5b83356102bc81610271565b925060208401356102cc81610271565b915060408401356001600160401b038111156102e757600080fd5b8401601f810186136102f857600080fd5b80356001600160401b0381111561031157610311610286565b604051601f8201601f19908116603f011681016001600160401b038111828210171561033f5761033f610286565b60405281815282820160200188101561035757600080fd5b816020840160208301376000602083830101528093505050509250925092565b6000815180845260005b8181101561039d57602081850181015186830182015201610381565b506000602082860101526020601f19601f83011685010191505092915050565b6020815260006103d06020830184610377565b9392505050565b6000602082840312156103e957600080fd5b81356103d081610271565b6001600160a01b038316815260406020820181905260009061041890830184610377565b94935050505056fea2646970667358221220e77af71a19651e50da550702ce9a5b1b89dda100ca5f41a9c778b943df55af8064736f6c634300081b0033", + "linkReferences": {}, + "deployedLinkReferences": {} +} \ No newline at end of file diff --git a/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/SubgraphServiceProxies#ProxyAdmin_SubgraphService.json b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/SubgraphServiceProxies#ProxyAdmin_SubgraphService.json new file mode 100644 index 000000000..2e9762744 --- /dev/null +++ b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/SubgraphServiceProxies#ProxyAdmin_SubgraphService.json @@ -0,0 +1,132 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "ProxyAdmin", + "sourceName": "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "initialOwner", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "OwnableInvalidOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "OwnableUnauthorizedAccount", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "inputs": [], + "name": "UPGRADE_INTERFACE_VERSION", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ITransparentUpgradeableProxy", + "name": "proxy", + "type": "address" + }, + { + "internalType": "address", + "name": "implementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ], + "bytecode": "0x608060405234801561001057600080fd5b5060405161055338038061055383398101604081905261002f916100be565b806001600160a01b03811661005e57604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b6100678161006e565b50506100ee565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000602082840312156100d057600080fd5b81516001600160a01b03811681146100e757600080fd5b9392505050565b610456806100fd6000396000f3fe60806040526004361061004a5760003560e01c8063715018a61461004f5780638da5cb5b146100665780639623609d14610091578063ad3cb1cc146100a4578063f2fde38b146100e2575b600080fd5b34801561005b57600080fd5b50610064610102565b005b34801561007257600080fd5b5061007b610116565b604051610088919061025d565b60405180910390f35b61006461009f36600461029c565b610125565b3480156100b057600080fd5b506100d5604051806040016040528060058152602001640352e302e360dc1b81525081565b60405161008891906103bd565b3480156100ee57600080fd5b506100646100fd3660046103d7565b610194565b61010a6101db565b610114600061020d565b565b6000546001600160a01b031690565b61012d6101db565b60405163278f794360e11b81526001600160a01b03841690634f1ef28690349061015d90869086906004016103f4565b6000604051808303818588803b15801561017657600080fd5b505af115801561018a573d6000803e3d6000fd5b5050505050505050565b61019c6101db565b6001600160a01b0381166101cf576000604051631e4fbdf760e01b81526004016101c6919061025d565b60405180910390fd5b6101d88161020d565b50565b336101e4610116565b6001600160a01b031614610114573360405163118cdaa760e01b81526004016101c6919061025d565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b0391909116815260200190565b6001600160a01b03811681146101d857600080fd5b634e487b7160e01b600052604160045260246000fd5b6000806000606084860312156102b157600080fd5b83356102bc81610271565b925060208401356102cc81610271565b915060408401356001600160401b038111156102e757600080fd5b8401601f810186136102f857600080fd5b80356001600160401b0381111561031157610311610286565b604051601f8201601f19908116603f011681016001600160401b038111828210171561033f5761033f610286565b60405281815282820160200188101561035757600080fd5b816020840160208301376000602083830101528093505050509250925092565b6000815180845260005b8181101561039d57602081850181015186830182015201610381565b506000602082860101526020601f19601f83011685010191505092915050565b6020815260006103d06020830184610377565b9392505050565b6000602082840312156103e957600080fd5b81356103d081610271565b6001600160a01b038316815260406020820181905260009061041890830184610377565b94935050505056fea2646970667358221220e77af71a19651e50da550702ce9a5b1b89dda100ca5f41a9c778b943df55af8064736f6c634300081b0033", + "deployedBytecode": "0x60806040526004361061004a5760003560e01c8063715018a61461004f5780638da5cb5b146100665780639623609d14610091578063ad3cb1cc146100a4578063f2fde38b146100e2575b600080fd5b34801561005b57600080fd5b50610064610102565b005b34801561007257600080fd5b5061007b610116565b604051610088919061025d565b60405180910390f35b61006461009f36600461029c565b610125565b3480156100b057600080fd5b506100d5604051806040016040528060058152602001640352e302e360dc1b81525081565b60405161008891906103bd565b3480156100ee57600080fd5b506100646100fd3660046103d7565b610194565b61010a6101db565b610114600061020d565b565b6000546001600160a01b031690565b61012d6101db565b60405163278f794360e11b81526001600160a01b03841690634f1ef28690349061015d90869086906004016103f4565b6000604051808303818588803b15801561017657600080fd5b505af115801561018a573d6000803e3d6000fd5b5050505050505050565b61019c6101db565b6001600160a01b0381166101cf576000604051631e4fbdf760e01b81526004016101c6919061025d565b60405180910390fd5b6101d88161020d565b50565b336101e4610116565b6001600160a01b031614610114573360405163118cdaa760e01b81526004016101c6919061025d565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b0391909116815260200190565b6001600160a01b03811681146101d857600080fd5b634e487b7160e01b600052604160045260246000fd5b6000806000606084860312156102b157600080fd5b83356102bc81610271565b925060208401356102cc81610271565b915060408401356001600160401b038111156102e757600080fd5b8401601f810186136102f857600080fd5b80356001600160401b0381111561031157610311610286565b604051601f8201601f19908116603f011681016001600160401b038111828210171561033f5761033f610286565b60405281815282820160200188101561035757600080fd5b816020840160208301376000602083830101528093505050509250925092565b6000815180845260005b8181101561039d57602081850181015186830182015201610381565b506000602082860101526020601f19601f83011685010191505092915050565b6020815260006103d06020830184610377565b9392505050565b6000602082840312156103e957600080fd5b81356103d081610271565b6001600160a01b038316815260406020820181905260009061041890830184610377565b94935050505056fea2646970667358221220e77af71a19651e50da550702ce9a5b1b89dda100ca5f41a9c778b943df55af8064736f6c634300081b0033", + "linkReferences": {}, + "deployedLinkReferences": {} +} \ No newline at end of file diff --git a/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/SubgraphServiceProxies#SubgraphService_ProxyWithABI.json b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/SubgraphServiceProxies#SubgraphService_ProxyWithABI.json new file mode 100644 index 000000000..d14c050d0 --- /dev/null +++ b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/SubgraphServiceProxies#SubgraphService_ProxyWithABI.json @@ -0,0 +1,2268 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "SubgraphService", + "sourceName": "contracts/SubgraphService.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "graphController", + "type": "address" + }, + { + "internalType": "address", + "name": "disputeManager", + "type": "address" + }, + { + "internalType": "address", + "name": "graphTallyCollector", + "type": "address" + }, + { + "internalType": "address", + "name": "curation", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + } + ], + "name": "AddressEmptyCode", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "AllocationAlreadyExists", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "internalType": "uint256", + "name": "closedAt", + "type": "uint256" + } + ], + "name": "AllocationClosed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "AllocationDoesNotExist", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "AllocationManagerAllocationClosed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "AllocationManagerAllocationSameSize", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "signer", + "type": "address" + }, + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "AllocationManagerInvalidAllocationProof", + "type": "error" + }, + { + "inputs": [], + "name": "AllocationManagerInvalidZeroAllocationId", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "claimId", + "type": "bytes32" + } + ], + "name": "DataServiceFeesClaimNotFound", + "type": "error" + }, + { + "inputs": [], + "name": "DataServiceFeesZeroTokens", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "DataServicePausableNotPauseGuardian", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "DataServicePausablePauseGuardianNoChange", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "internalType": "address", + "name": "disputeManager", + "type": "address" + } + ], + "name": "DirectoryNotDisputeManager", + "type": "error" + }, + { + "inputs": [], + "name": "ECDSAInvalidSignature", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "length", + "type": "uint256" + } + ], + "name": "ECDSAInvalidSignatureLength", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "ECDSAInvalidSignatureS", + "type": "error" + }, + { + "inputs": [], + "name": "EnforcedPause", + "type": "error" + }, + { + "inputs": [], + "name": "ExpectedPause", + "type": "error" + }, + { + "inputs": [], + "name": "FailedCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "contractName", + "type": "bytes" + } + ], + "name": "GraphDirectoryInvalidZeroAddress", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidInitialization", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "LegacyAllocationAlreadyExists", + "type": "error" + }, + { + "inputs": [], + "name": "LinkedListEmptyList", + "type": "error" + }, + { + "inputs": [], + "name": "LinkedListInvalidIterations", + "type": "error" + }, + { + "inputs": [], + "name": "LinkedListInvalidZeroId", + "type": "error" + }, + { + "inputs": [], + "name": "LinkedListMaxElementsExceeded", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "OwnableInvalidOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "OwnableUnauthorizedAccount", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "a", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "b", + "type": "uint256" + } + ], + "name": "PPMMathInvalidMulPPM", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "name": "ProvisionManagerInvalidRange", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "message", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "name": "ProvisionManagerInvalidValue", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "ProvisionManagerNotAuthorized", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + } + ], + "name": "ProvisionManagerProvisionNotFound", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokensAvailable", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokensRequired", + "type": "uint256" + } + ], + "name": "ProvisionTrackerInsufficientTokens", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "SubgraphServiceAllocationIsAltruistic", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "SubgraphServiceAllocationNotAuthorized", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "SubgraphServiceCannotForceCloseAllocation", + "type": "error" + }, + { + "inputs": [], + "name": "SubgraphServiceEmptyGeohash", + "type": "error" + }, + { + "inputs": [], + "name": "SubgraphServiceEmptyUrl", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "balanceBefore", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "balanceAfter", + "type": "uint256" + } + ], + "name": "SubgraphServiceInconsistentCollection", + "type": "error" + }, + { + "inputs": [], + "name": "SubgraphServiceIndexerAlreadyRegistered", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "providedIndexer", + "type": "address" + }, + { + "internalType": "address", + "name": "expectedIndexer", + "type": "address" + } + ], + "name": "SubgraphServiceIndexerMismatch", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + } + ], + "name": "SubgraphServiceIndexerNotRegistered", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "collectionId", + "type": "bytes32" + } + ], + "name": "SubgraphServiceInvalidCollectionId", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "curationCut", + "type": "uint256" + } + ], + "name": "SubgraphServiceInvalidCurationCut", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "paymentType", + "type": "uint8" + } + ], + "name": "SubgraphServiceInvalidPaymentType", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "ravIndexer", + "type": "address" + }, + { + "internalType": "address", + "name": "allocationIndexer", + "type": "address" + } + ], + "name": "SubgraphServiceInvalidRAV", + "type": "error" + }, + { + "inputs": [], + "name": "SubgraphServiceInvalidZeroStakeToFeesRatio", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "forceClosed", + "type": "bool" + } + ], + "name": "AllocationClosed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "currentEpoch", + "type": "uint256" + } + ], + "name": "AllocationCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newTokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldTokens", + "type": "uint256" + } + ], + "name": "AllocationResized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "curationCut", + "type": "uint256" + } + ], + "name": "CurationCutSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "ratio", + "type": "uint32" + } + ], + "name": "DelegationRatioSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "EIP712DomainChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "graphToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "graphStaking", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphPayments", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphEscrow", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "graphController", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphEpochManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphRewardsManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphTokenGateway", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphProxyAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphCuration", + "type": "address" + } + ], + "name": "GraphDirectoryInitialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensRewards", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensIndexerRewards", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensDelegationRewards", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "poi", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "poiMetadata", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "currentEpoch", + "type": "uint256" + } + ], + "name": "IndexingRewardsCollected", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + } + ], + "name": "LegacyAllocationMigrated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "maxPOIStaleness", + "type": "uint256" + } + ], + "name": "MaxPOIStalenessSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "PauseGuardianSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Paused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "paymentsDestination", + "type": "address" + } + ], + "name": "PaymentsDestinationSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + } + ], + "name": "ProvisionPendingParametersAccepted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "name": "ProvisionTokensRangeSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensCollected", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensCurators", + "type": "uint256" + } + ], + "name": "QueryFeesCollected", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "feeType", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "ServicePaymentCollected", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "ServiceProviderRegistered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "ServiceProviderSlashed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "ServiceStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "ServiceStopped", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "claimId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "unlockTimestamp", + "type": "uint256" + } + ], + "name": "StakeClaimLocked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "claimId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "releasableAt", + "type": "uint256" + } + ], + "name": "StakeClaimReleased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "claimsCount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensReleased", + "type": "uint256" + } + ], + "name": "StakeClaimsReleased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "ratio", + "type": "uint256" + } + ], + "name": "StakeToFeesRatioSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "subgraphService", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "disputeManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphTallyCollector", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "curation", + "type": "address" + } + ], + "name": "SubgraphServiceDirectoryInitialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "min", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "max", + "type": "uint64" + } + ], + "name": "ThawingPeriodRangeSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Unpaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "min", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "max", + "type": "uint32" + } + ], + "name": "VerifierCutRangeSet", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "name": "acceptProvisionPendingParameters", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + } + ], + "name": "allocationProvisionTracker", + "outputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "claimId", + "type": "bytes32" + } + ], + "name": "claims", + "outputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "createdAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "releasableAt", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "nextClaim", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + } + ], + "name": "claimsLists", + "outputs": [ + { + "internalType": "bytes32", + "name": "head", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "tail", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "count", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "closeStaleAllocation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "paymentType", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "collect", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "curationFeesCut", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "eip712Domain", + "outputs": [ + { + "internalType": "bytes1", + "name": "fields", + "type": "bytes1" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "version", + "type": "string" + }, + { + "internalType": "uint256", + "name": "chainId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "verifyingContract", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "salt", + "type": "bytes32" + }, + { + "internalType": "uint256[]", + "name": "extensions", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "encodeAllocationProof", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + } + ], + "name": "feesProvisionTracker", + "outputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "getAllocation", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "createdAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "closedAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lastPOIPresentedAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "accRewardsPerAllocatedToken", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "accRewardsPending", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "createdAtEpoch", + "type": "uint256" + } + ], + "internalType": "struct Allocation.State", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "getAllocationData", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getCuration", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getDelegationRatio", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getDisputeManager", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getGraphTallyCollector", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "getLegacyAllocation", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + } + ], + "internalType": "struct LegacyAllocation.State", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getProvisionTokensRange", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + } + ], + "name": "getSubgraphAllocatedTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getThawingPeriodRange", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getVerifierCutRange", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + } + ], + "name": "indexers", + "outputs": [ + { + "internalType": "uint256", + "name": "registeredAt", + "type": "uint256" + }, + { + "internalType": "string", + "name": "url", + "type": "string" + }, + { + "internalType": "string", + "name": "geoHash", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "uint256", + "name": "minimumProvisionTokens", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "maximumDelegationRatio", + "type": "uint32" + }, + { + "internalType": "uint256", + "name": "stakeToFeesRatio_", + "type": "uint256" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + } + ], + "name": "isOverAllocated", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maxPOIStaleness", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "subgraphDeploymentID", + "type": "bytes32" + } + ], + "name": "migrateLegacyAllocation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "name": "multicall", + "outputs": [ + { + "internalType": "bytes[]", + "name": "results", + "type": "bytes[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "pauseGuardian", + "type": "address" + } + ], + "name": "pauseGuardians", + "outputs": [ + { + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "paused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + } + ], + "name": "paymentsDestination", + "outputs": [ + { + "internalType": "address", + "name": "destination", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "register", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "numClaimsToRelease", + "type": "uint256" + } + ], + "name": "releaseStake", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "resizeAllocation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "curationCut", + "type": "uint256" + } + ], + "name": "setCurationCut", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "delegationRatio", + "type": "uint32" + } + ], + "name": "setDelegationRatio", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "maxPOIStaleness_", + "type": "uint256" + } + ], + "name": "setMaxPOIStaleness", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "minimumProvisionTokens", + "type": "uint256" + } + ], + "name": "setMinimumProvisionTokens", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "pauseGuardian", + "type": "address" + }, + { + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "setPauseGuardian", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "paymentsDestination_", + "type": "address" + } + ], + "name": "setPaymentsDestination", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "stakeToFeesRatio_", + "type": "uint256" + } + ], + "name": "setStakeToFeesRatio", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "slash", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "stakeToFeesRatio", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "startService", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "stopService", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "unpause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "bytecode": "0x61024060405234801561001157600080fd5b5060405161667738038061667783398101604081905261003091610541565b3083838387806001600160a01b03811661007f5760405163218f5add60e11b815260206004820152600a60248201526921b7b73a3937b63632b960b11b60448201526064015b60405180910390fd5b6001600160a01b0381166101005260408051808201909152600a81526923b930b8342a37b5b2b760b11b60208201526100b7906103c5565b6001600160a01b03166080526040805180820190915260078152665374616b696e6760c81b60208201526100ea906103c5565b6001600160a01b031660a05260408051808201909152600d81526c47726170685061796d656e747360981b6020820152610123906103c5565b6001600160a01b031660c05260408051808201909152600e81526d5061796d656e7473457363726f7760901b602082015261015d906103c5565b6001600160a01b031660e05260408051808201909152600c81526b22b837b1b426b0b730b3b2b960a11b6020820152610195906103c5565b6001600160a01b03166101205260408051808201909152600e81526d2932bbb0b93239a6b0b730b3b2b960911b60208201526101d0906103c5565b6001600160a01b0316610140526040805180820190915260118152704772617068546f6b656e4761746577617960781b602082015261020e906103c5565b6001600160a01b03166101605260408051808201909152600f81526e23b930b834283937bc3ca0b236b4b760891b602082015261024a906103c5565b6001600160a01b03166101805260408051808201909152600881526721bab930ba34b7b760c11b602082015261027f906103c5565b6001600160a01b039081166101a08190526101005160a05160805160c05160e05161012051610140516101605161018051604051988b169a9788169996909716977fef5021414834d86e36470f5c1cecf6544fb2bb723f2ca51a4c86fcd8c5919a43976103299790916001600160a01b03978816815295871660208701529386166040860152918516606085015284166080840152831660a083015290911660c082015260e00190565b60405180910390a450506001600160a01b038481166101c08190528482166101e08190528483166102008190529284166102208190526040805193845260208401929092529082019290925260608101919091527f4175b2c37456dbac494e08de8666d31bb8f3f2aee36ea5d9e06894ff3e4ddda79060800160405180910390a1505050506103bc61047360201b60201c565b50505050610605565b600080610100516001600160a01b031663f7641a5e84805190602001206040518263ffffffff1660e01b815260040161040091815260200190565b602060405180830381865afa15801561041d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104419190610595565b9050826001600160a01b03821661046c5760405163218f5add60e11b815260040161007691906105b7565b5092915050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff16156104c35760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b03908116146105225780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b80516001600160a01b038116811461053c57600080fd5b919050565b6000806000806080858703121561055757600080fd5b61056085610525565b935061056e60208601610525565b925061057c60408601610525565b915061058a60608601610525565b905092959194509250565b6000602082840312156105a757600080fd5b6105b082610525565b9392505050565b602081526000825180602084015260005b818110156105e557602081860181015160408684010152016105c8565b506000604082850101526040601f19601f83011684010191505092915050565b60805160a05160c05160e05161010051610120516101405161016051610180516101a0516101c0516101e0516102005161022051615fd961069e6000396000612ee2015260006132de01526000818161163b0152612fe101526000505060005050600050506000505060006137080152600061457c01526000505060005050600050506000611b6b01526000613a640152615fd96000f3fe608060405234801561001057600080fd5b506004361061023b5760003560e01c806307e736d8146102405780630e02292314610280578063138dea081461030857806313c474c9146103205780631dd42f60146103755780631ebb7c301461038a57806324b8fbf6146103af57806335577962146103c25780633f4ba83a146103d557806345f54485146103dd578063482468b7146103f05780634f793cdc1461040657806355c85269146104285780635c975abb146104725780636234e2161461048a5780636ccec5b8146104aa5780636d9a3951146104bd578063715018a61461053857806371ce020a146105405780637aa31bce146105565780637dfe6d28146105695780637e89bac31461057c5780638180083b1461058f578063819ba366146105a257806381e777a7146105b8578063832bc923146105cb5780638456cb59146105de57806384b0196e146105e657806385e82baf146106015780638da5cb5b1461060a5780639384e07814610612578063ac9650d814610635578063b15d2a2c14610655578063ba38f67d14610668578063c0f474971461067b578063c84a5ef314610683578063cb8347fe14610696578063cbe5f3f2146106a9578063ce0fc0cc146106c9578063ce56c98b146106dc578063d07a7a84146106ef578063db9bee46146106f9578063dedf672614610701578063e2e1e8e914610714578063e6f5005414610734578063ebf6ddaf14610747578063ec9c218d1461074f578063eff0f59214610762578063f2fde38b14610797575b600080fd5b61026a61024e36600461502b565b610109602052600090815260409020546001600160a01b031681565b6040516102779190615048565b60405180910390f35b61029361028e36600461502b565b6107aa565b604051610277919060006101208201905060018060a01b0383511682526020830151602083015260408301516040830152606083015160608301526080830151608083015260a083015160a083015260c083015160c083015260e083015160e083015261010083015161010083015292915050565b6103126101085481565b604051908152602001610277565b61035561032e36600461502b565b609c6020526000908152604090208054600182015460028301546003909301549192909184565b604080519485526020850193909352918301526060820152608001610277565b61038861038336600461506e565b610837565b005b600254600160c01b900463ffffffff1660405163ffffffff9091168152602001610277565b6103886103bd3660046150cc565b610850565b6103886103d036600461512e565b610a7d565b610388610a93565b6103886103eb366004615167565b610acf565b6103f8610ad9565b604051610277929190615180565b61041961041436600461502b565b610aec565b604051610277939291906151e7565b61043b61043636600461502b565b610c20565b6040805196151587526001600160a01b039095166020870152938501929092526060840152608083015260a082015260c001610277565b61047a610cdc565b6040519015158152602001610277565b61031261049836600461502b565b60d16020526000908152604090205481565b6103886104b836600461502b565b610cf1565b6105146104cb36600461502b565b604080518082018252600080825260209182018190526001600160a01b03938416815260d082528290208251808401909352805490931682526001909201549181019190915290565b6040805182516001600160a01b031681526020928301519281019290925201610277565b610388610cfb565b610548610d0d565b60405161027792919061521c565b610388610564366004615167565b610d18565b610388610577366004615236565b610d29565b61038861058a366004615167565b610d41565b61038861059d3660046150cc565b610db6565b6105aa610f44565b604051610277929190615277565b6103886105c6366004615236565b610f54565b6103886105d9366004615167565b6110c4565b6103886110d8565b6105ee611112565b6040516102779796959493929190615285565b61031260d25481565b61026a6111bb565b61047a61062036600461502b565b60676020526000908152604090205460ff1681565b61064861064336600461531d565b6111d6565b6040516102779190615392565b6103126106633660046153f7565b6112be565b61047a61067636600461502b565b611492565b61026a6114b0565b61038861069136600461545f565b6114ba565b6103886106a43660046150cc565b611638565b6103126106b736600461502b565b609a6020526000908152604090205481565b6103886106d73660046150cc565b611777565b6103126106ea3660046154a7565b611860565b6103126101075481565b61026a611873565b61038861070f3660046150cc565b61187d565b610312610722366004615167565b600090815260d3602052604090205490565b610388610742366004615167565b611a0b565b61026a611a1c565b61038861075d36600461502b565b611a26565b610355610770366004615167565b609b6020526000908152604090208054600182015460028301546003909301549192909184565b6103886107a536600461502b565b611aa8565b6107b2614fae565b506001600160a01b03908116600090815260cf6020908152604091829020825161012081018452815490941684526001810154918401919091526002810154918301919091526003810154606083015260048101546080830152600581015460a0830152600681015460c0830152600781015460e08301526008015461010082015290565b61083f611ae3565b61084881611b15565b50565b905090565b82610859611b69565b6001600160a01b0316637c145cc78230336040518463ffffffff1660e01b8152600401610888939291906154d5565b602060405180830381865afa1580156108a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108c991906154f8565b813390916108f55760405163cc5d3c8b60e01b81526004016108ec929190615515565b60405180910390fd5b505083600061090382611b8d565b905061090e81611c90565b610919816000611cce565b610921611db8565b6000808061093187890189615646565b925092509250600083511161095957604051630783843960e51b815260040160405180910390fd5b600082511161097b57604051631e63bd9560e21b815260040160405180910390fd5b6001600160a01b03891660009081526101066020526040902054156109b357604051630d06866d60e21b815260040160405180910390fd5b6040805160608101825242815260208082018681528284018690526001600160a01b038d16600090815261010690925292902081518155915190919060018201906109fe9082615742565b5060408201516002820190610a139082615742565b5050506001600160a01b03811615610a2f57610a2f8982611dde565b886001600160a01b03167f159567bea25499a91f60e1fbb349ff2a1f8c1b2883198f25c1e12c99eddb44fa8989604051610a6a929190615800565b60405180910390a2505050505050505050565b610a85611ae3565b610a8f8282611e35565b5050565b3360008181526067602052604090205460ff16610ac4576040516372e3ef9760e01b81526004016108ec9190615048565b50610acd611eeb565b565b6108483382611f37565b600080610ae4611fdd565b915091509091565b6101066020526000908152604090208054600182018054919291610b0f906156c1565b80601f0160208091040260200160405190810160405280929190818152602001828054610b3b906156c1565b8015610b885780601f10610b5d57610100808354040283529160200191610b88565b820191906000526020600020905b815481529060010190602001808311610b6b57829003601f168201915b505050505090806002018054610b9d906156c1565b80601f0160208091040260200160405190810160405280929190818152602001828054610bc9906156c1565b8015610c165780601f10610beb57610100808354040283529160200191610c16565b820191906000526020600020905b815481529060010190602001808311610bf957829003601f168201915b5050505050905083565b6001600160a01b03808216600090815260cf60209081526040808320815161012081018352815490951685526001810154928501929092526002820154908401526003810154606084015260048101546080840152600581015460a0840152600681015460c0840152600781015460e0840152600801546101008301529081908190819081908190610cb181612054565b81516020830151604084015160c085015160e090950151939c929b5090995097509195509350915050565b600080610ce7612073565b5460ff1692915050565b6108483382611dde565b610d03611ae3565b610acd6000612097565b600080610ae46120f3565b610d20611ae3565b6108488161216a565b610d31611ae3565b610d3c83838361219f565b505050565b610d49611ae3565b610d5681620f4240101590565b8190610d7857604051631c9c717b60e01b81526004016108ec91815260200190565b506101088190556040518181527f6deef78ffe3df79ae5cd8e40b842c36ac6077e13746b9b68a9f327537b01e4e9906020015b60405180910390a150565b82610dbf611b69565b6001600160a01b0316637c145cc78230336040518463ffffffff1660e01b8152600401610dee939291906154d5565b602060405180830381865afa158015610e0b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e2f91906154f8565b81339091610e525760405163cc5d3c8b60e01b81526004016108ec929190615515565b50506001600160a01b0384166000908152610106602052604090205484908190610e905760405163ee27189960e01b81526004016108ec9190615048565b50610e99611db8565b6000610ea78486018661502b565b90506001600160a01b038616610ebe60cf836121f2565b51879183916001600160a01b031614610eec5760405163c0bbff1360e01b81526004016108ec929190615515565b5050610ef9816000612277565b856001600160a01b03167f73330c218a680717e9eee625c262df66eddfdf99ecb388d25f6b32d66b9a318a8686604051610f34929190615800565b60405180910390a2505050505050565b600080610ae46000546001549091565b82610f5d611b69565b6001600160a01b0316637c145cc78230336040518463ffffffff1660e01b8152600401610f8c939291906154d5565b602060405180830381865afa158015610fa9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fcd91906154f8565b81339091610ff05760405163cc5d3c8b60e01b81526004016108ec929190615515565b5050836000610ffe82611b8d565b905061100981611c90565b611014816000611cce565b6001600160a01b03861660009081526101066020526040902054869081906110505760405163ee27189960e01b81526004016108ec9190615048565b50611059611db8565b6001600160a01b03871661106e60cf886121f2565b51889188916001600160a01b03161461109c5760405163c0bbff1360e01b81526004016108ec929190615515565b50506110bb8686600260189054906101000a900463ffffffff166123d9565b50505050505050565b6110cc611ae3565b610848816000196126d7565b3360008181526067602052604090205460ff16611109576040516372e3ef9760e01b81526004016108ec9190615048565b50610acd612746565b600060608060008060006060600061112861278d565b805490915015801561113c57506001810154155b6111805760405162461bcd60e51b81526020600482015260156024820152741152540dcc4c8e88155b9a5b9a5d1a585b1a5e9959605a1b60448201526064016108ec565b6111886127b1565b611190612852565b60408051600080825260208201909252600f60f81b9c939b5091995046985030975095509350915050565b6000806111c661286f565b546001600160a01b031692915050565b604080516000815260208101909152606090826001600160401b038111156112005761120061552f565b60405190808252806020026020018201604052801561123357816020015b606081526020019060019003908161121e5790505b50915060005b838110156112b5576112903086868481811061125757611257615858565b9050602002810190611269919061586e565b8560405160200161127c939291906158b4565b604051602081830303815290604052612893565b8382815181106112a2576112a2615858565b6020908102919091010152600101611239565b50505b92915050565b6000846112c9611b69565b6001600160a01b0316637c145cc78230336040518463ffffffff1660e01b81526004016112f8939291906154d5565b602060405180830381865afa158015611315573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061133991906154f8565b8133909161135c5760405163cc5d3c8b60e01b81526004016108ec929190615515565b505085600061136a82611b8d565b905061137581611c90565b611380816000611cce565b6001600160a01b03881660009081526101066020526040902054889081906113bc5760405163ee27189960e01b81526004016108ec9190615048565b506113c5611db8565b6000808960028111156113da576113da6158db565b036113f1576113ea8a8989612909565b9050611430565b6002896002811115611405576114056158db565b03611415576113ea8a8989612e1d565b8860405163047031cf60e41b81526004016108ec9190615913565b886002811115611442576114426158db565b8a6001600160a01b03167f54fe682bfb66381a9382e13e4b95a3dd4f960eafbae063fdea3539d144ff3ff58360405161147d91815260200190565b60405180910390a39998505050505050505050565b60006112b882600260189054906101000a900463ffffffff16612ec1565b600061084b612ee0565b60006114c4612f04565b805490915060ff600160401b82041615906001600160401b03166000811580156114eb5750825b90506000826001600160401b031660011480156115075750303b155b905081158015611515575080155b156115335760405163f92ee8a960e01b815260040160405180910390fd5b84546001600160401b0319166001178555831561155c57845460ff60401b1916600160401b1785555b61156589612f2d565b61156d612f3e565b611575612f46565b61157d612f5e565b6115c96040518060400160405280600f81526020016e53756267726170685365727669636560881b815250604051806040016040528060038152602001620312e360ec1b815250612f6e565b6115d5886000196126d7565b6115de87611b15565b6115e786612f88565b831561162d57845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b505050505050505050565b337f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03811682146116855760405163cdc0567f60e01b81526004016108ec929190615515565b50600090508061169783850185615921565b915091506116a3611b69565b6001600160a01b031663e76fede68684846116bc612fdf565b60405160e086901b6001600160e01b03191681526001600160a01b039485166004820152602481019390935260448301919091529091166064820152608401600060405180830381600087803b15801561171557600080fd5b505af1158015611729573d6000803e3d6000fd5b50505050846001600160a01b03167f02f2e74a11116e05b39159372cceb6739257b08d72f7171d208ff27bb6466c588360405161176891815260200190565b60405180910390a25050505050565b82611780611b69565b6001600160a01b0316637c145cc78230336040518463ffffffff1660e01b81526004016117af939291906154d5565b602060405180830381865afa1580156117cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117f091906154f8565b813390916118135760405163cc5d3c8b60e01b81526004016108ec929190615515565b505061181d611db8565b61182684613003565b6040516001600160a01b038516907ff53cf6521a1b5fc0c04bffa70374a4dc2e3474f2b2ac1643c3bcc54e2db4a93990600090a250505050565b600061186c8383613076565b9392505050565b600061084b612fdf565b82611886611b69565b6001600160a01b0316637c145cc78230336040518463ffffffff1660e01b81526004016118b5939291906154d5565b602060405180830381865afa1580156118d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118f691906154f8565b813390916119195760405163cc5d3c8b60e01b81526004016108ec929190615515565b505083600061192782611b8d565b905061193281611c90565b61193d816000611cce565b6001600160a01b03861660009081526101066020526040902054869081906119795760405163ee27189960e01b81526004016108ec9190615048565b50611982611db8565b6000808080611993898b018b615943565b93509350935093506119bb8b83868685600260189054906101000a900463ffffffff166130e5565b8a6001600160a01b03167fd3803eb82ef5b4cdff8646734ebbaf5b37441e96314b27ffd3d0940f12a038e78b8b6040516119f6929190615800565b60405180910390a25050505050505050505050565b611a13611ae3565b61084881612f88565b600061084b6132dc565b611a2e611db8565b6000611a3b60cf836121f2565b9050611a5260d2548261330090919063ffffffff16565b8290611a7157604051623477b560e51b81526004016108ec9190615048565b50611a7b8161333d565b158290611a9c576040516317c7b35d60e31b81526004016108ec9190615048565b50610a8f826001612277565b611ab0611ae3565b6001600160a01b038116611ada576000604051631e4fbdf760e01b81526004016108ec9190615048565b61084881612097565b33611aec6111bb565b6001600160a01b031614610acd573360405163118cdaa760e01b81526004016108ec9190615048565b6002805463ffffffff60c01b1916600160c01b63ffffffff8416908102919091179091556040519081527f472aba493f9fd1d136ec54986f619f3aa5caff964f0e731a9909fb9a1270211f90602001610dab565b7f000000000000000000000000000000000000000000000000000000000000000090565b6040805161014081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101829052610120810182905290611be6611b69565b6001600160a01b03166325d9897e84306040518363ffffffff1660e01b8152600401611c13929190615515565b61014060405180830381865afa158015611c31573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c5591906159d0565b90508060a001516001600160401b0316600014158390611c8957604051637b3c09bf60e01b81526004016108ec9190615048565b5092915050565b6020810151815161084891611ca491615845565b60005460015460405180604001604052806006815260200165746f6b656e7360d01b81525061335c565b600080611cd96120f3565b91509150600083611cee578460800151611cf4565b8460e001515b9050611d42816001600160401b0316846001600160401b0316846001600160401b03166040518060400160405280600d81526020016c1d1a185dda5b99d4195c9a5bd9609a1b81525061335c565b600080611d4d611fdd565b91509150600086611d62578760600151611d68565b8760c001515b9050611dae8163ffffffff168463ffffffff168463ffffffff166040518060400160405280600e81526020016d1b585e15995c9a599a595c90dd5d60921b81525061335c565b5050505050505050565b611dc0610cdc565b15610acd5760405163d93c066560e01b815260040160405180910390fd5b6001600160a01b038281166000818152610109602052604080822080546001600160a01b0319169486169485179055517e3215dc05a2fc4e6a1e2c2776311d207c730ee51085aae221acc5cbe6fb55c19190a35050565b6001600160a01b0382166000908152606760205260409020548290829060ff161515811514611e8a57604051635e67e54b60e01b81526001600160a01b039092166004830152151560248201526044016108ec565b50506001600160a01b038216600081815260676020908152604091829020805460ff191685151590811790915591519182527fa95bac2f3df0d40e8278281c1d39d53c60e4f2bf3550ca5665738d0916e89789910160405180910390a25050565b611ef3613390565b6000611efd612073565b805460ff1916815590507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b604051610dab9190615048565b6001600160a01b0382166000818152609c60209081526040808320815192830184905282820194909452805180830382018152606090920190528190611f8b9084906133b5906133ca906134c590896134ea565b91509150846001600160a01b03167f13f3fa9f0e54af1af76d8b5d11c3973d7c2aed6312b61efff2f7b49d73ad67eb8383806020019051810190611fcf9190615a7d565b604051611768929190615277565b600080611fe8612fdf565b6001600160a01b031663bb2a2b476040518163ffffffff1660e01b8152600401602060405180830381865afa158015612025573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120499190615a96565b92620f424092509050565b60006120638260600151151590565b80156112b8575050608001511590565b7fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f0330090565b60006120a161286f565b80546001600160a01b038481166001600160a01b031983168117845560405193945091169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b6000806000612100612fdf565b6001600160a01b0316635aea0ec46040518163ffffffff1660e01b8152600401602060405180830381865afa15801561213d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121619190615ab3565b93849350915050565b60d28190556040518181527f21774046e2611ddb52c8c46e1ad97524eeb2e3fda7dcd9428867868b4c4d06ba90602001610dab565b6121ac60d08484846135a4565b80826001600160a01b0316846001600160a01b03167fd54c7abc930f6d506da2d08aa7aead4f2443e1db6d5f560384a2f652ff893e1960405160405180910390a4505050565b6121fa614fae565b6122048383613653565b604080516101208101825282546001600160a01b03168152600183015460208201526002830154918101919091526003820154606082015260048201546080820152600582015460a0820152600682015460c0820152600782015460e08201526008909101546101008201529392505050565b600061228460cf846121f2565b905061230f83612292613706565b6001600160a01b031663eeac3e0e84602001516040518263ffffffff1660e01b81526004016122c391815260200190565b6020604051808303816000875af11580156122e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123069190615a7d565b60cf919061372a565b61231a60cf846137dd565b8051604082015161232d9160d191613893565b806040015160d3600083602001518152602001908152602001600020546123549190615845565b60d3600083602001518152602001908152602001600020819055508060200151836001600160a01b031682600001516001600160a01b03167f08f2f865e0fb62d722a51e4d9873199bf6bf52e7d8ee5a2ee2896c9ef719f5458460400151866040516123cc9291909182521515602082015260400190565b60405180910390a4505050565b60006123e660cf856121f2565b90506123f181612054565b849061241157604051631eb5ff9560e01b81526004016108ec9190615048565b5080604001518314158484909161243d5760405163f32518cd60e01b81526004016108ec929190615ad0565b50506040810151808411156124735761246e612457611b69565b83516124638488615845565b60d192919087613911565b61248c565b815161248c906124838684615845565b60d19190613893565b6000612496613706565b6001600160a01b031663eeac3e0e84602001516040518263ffffffff1660e01b81526004016124c791815260200190565b6020604051808303816000875af11580156124e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061250a9190615a7d565b905060006125178461333d565b15612523576000612532565b60c08401516125329083615845565b6001600160a01b038816600090815260cf60205260409020600281018890556006018390559050612561613706565b6001600160a01b031663c8a5f81e84836040518363ffffffff1660e01b815260040161258e929190615277565b602060405180830381865afa1580156125ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125cf9190615a7d565b6001600160a01b038816600090815260cf6020526040812060070180549091906125fa908490615ae9565b909155505082861115612642576126118387615845565b60d360008660200151815260200190815260200160002060008282546126379190615ae9565b909155506126789050565b61264c8684615845565b60d360008660200151815260200190815260200160002060008282546126729190615845565b90915550505b8360200151876001600160a01b031685600001516001600160a01b03167f6db4a6f9be2d5e72eb2a2af2374ac487971bf342a261ba0bc1cf471bf2a2c31f89876040516126c6929190615277565b60405180910390a450505050505050565b8181808211156126fc5760405163ccccdafb60e01b81526004016108ec929190615277565b5050600082905560018190556040517f90699b8b4bf48918fea1129c85f9bc7b51285df7ecc982910813c7805f5688499061273a9084908490615277565b60405180910390a15050565b61274e611db8565b6000612758612073565b805460ff1916600117815590507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611f2a3390565b7fa16a46d94261c7517cc8ff89f61c0ce93598e3c849801011dee649a6a557d10090565b606060006127bd61278d565b90508060020180546127ce906156c1565b80601f01602080910402602001604051908101604052809291908181526020018280546127fa906156c1565b80156128475780601f1061281c57610100808354040283529160200191612847565b820191906000526020600020905b81548152906001019060200180831161282a57829003601f168201915b505050505091505090565b6060600061285e61278d565b90508060030180546127ce906156c1565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930090565b6060600080846001600160a01b0316846040516128b09190615afc565b600060405180830381855af49150503d80600081146128eb576040519150601f19603f3d011682016040523d82523d6000602084013e6128f0565b606091505b5091509150612900858383613a0f565b95945050505050565b6000808061291984860186615b3a565b8151604001519193509150866001600160a01b038281169082161461295357604051631a071d0760e01b81526004016108ec929190615515565b50508151516001600160a01b038111156129835760405163fa4ac7a760e01b81526004016108ec91815260200190565b50815151600061299460cf836121f2565b805190915088906001600160a01b03818116908316146129c957604051634508fbf760e11b81526004016108ec929190615515565b505060208101516129db896000611f37565b60008060006129e8613a62565b6001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401612a139190615048565b602060405180830381865afa158015612a30573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a549190615a7d565b9050612a5e6132dc565b6001600160a01b031663692209ce6000612afc8b612a7a612ee0565b6001600160a01b0316634c4ea0ed8a6040518263ffffffff1660e01b8152600401612aa791815260200190565b602060405180830381865afa158015612ac4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ae891906154f8565b612af3576000613a86565b61010854613a86565b8a6040518463ffffffff1660e01b8152600401612b1b93929190615c71565b6020604051808303816000875af1158015612b3a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b5e9190615a7d565b92506000612b6a613a62565b6001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401612b959190615048565b602060405180830381865afa158015612bb2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bd69190615a7d565b9050818181811015612bfd57604051639db8bc9560e01b81526004016108ec929190615277565b50612c0a90508282615845565b92505082159050612db457612ca98b6101075484612c289190615ca1565b612c30612fdf565b6001600160a01b0316635aea0ec46040518163ffffffff1660e01b8152600401602060405180830381865afa158015612c6d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c919190615ab3565b612ca4906001600160401b031642615ae9565b613ada565b8015612db457612cb7613706565b6001600160a01b0316631d1c2fec846040518263ffffffff1660e01b8152600401612ce491815260200190565b6020604051808303816000875af1158015612d03573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d279190615a7d565b50612d4c612d33612ee0565b82612d3c613a62565b6001600160a01b03169190613c4a565b612d54612ee0565b6001600160a01b0316638157328884836040518363ffffffff1660e01b8152600401612d81929190615277565b600060405180830381600087803b158015612d9b57600080fd5b505af1158015612daf573d6000803e3d6000fd5b505050505b86516020908101516040805186815292830185905282018390526001600160a01b038088169291811691908e16907f184c452047299395d4f7f147eb8e823458a450798539be54aeed978f13d87ba29060600160405180910390a4509998505050505050505050565b6000808080612e2e85870187615cb8565b919450925090506001600160a01b038716612e4a60cf856121f2565b51889185916001600160a01b031614612e785760405163c0bbff1360e01b81526004016108ec929190615515565b50506002546001600160a01b0388811660009081526101096020526040902054612eb692869286928692600160c01b900463ffffffff169116613cf9565b979650505050505050565b6000612ed8612ece611b69565b60d19085856142d6565b159392505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b6000807ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a006112b8565b612f35614370565b61084881614395565b610acd614370565b612f4e614370565b612f5661439d565b610acd612f3e565b612f66614370565b612f56612f3e565b612f76614370565b612f8082826143df565b610a8f612f3e565b80600003612fa95760405163bc71a04360e01b815260040160405180910390fd5b6101078190556040518181527f2aaaf20b08565eebc0c962cd7c568e54c3c0c2b85a1f942b82cd1bd730fdcd2390602001610dab565b7f000000000000000000000000000000000000000000000000000000000000000090565b61300e8160016143f1565b613016611b69565b6001600160a01b0316633a78b732826040518263ffffffff1660e01b81526004016130419190615048565b600060405180830381600087803b15801561305b57600080fd5b505af115801561306f573d6000803e3d6000fd5b5050505050565b600061186c7f4bdee85c4b4a268f4895d1096d553c3e57bb2433c380e7b7ec8cb56cc4f7467384846040516020016130ca939291909283526001600160a01b03918216602084015216604082015260600190565b60405160208183030381529060405280519060200120614408565b6001600160a01b03851661310c57604051634ffdf5ef60e11b815260040160405180910390fd5b613117868684614435565b61312b613122611b69565b60d09087614484565b600061313561457a565b6001600160a01b031663766718086040518163ffffffff1660e01b8152600401602060405180830381865afa158015613172573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131969190615a7d565b90506000613226888888886131a9613706565b6001600160a01b031663eeac3e0e8c6040518263ffffffff1660e01b81526004016131d691815260200190565b6020604051808303816000875af11580156131f5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132199190615a7d565b60cf94939291908861459e565b905061323e613233611b69565b60d1908a8887613911565b806040015160d3600083602001518152602001908152602001600020546132659190615ae9565b60d36000836020015181526020019081526020016000208190555085876001600160a01b0316896001600160a01b03167fe5e185fab2b992c4727ff702a867d78b15fb176dbaa20c9c312a1c351d3f7f838460400151866040516132ca929190615277565b60405180910390a45050505050505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b60008061331584606001518560a00151614706565b61331f9042615845565b905061332a84612054565b801561333557508281115b949350505050565b600061334c8260600151151590565b80156112b8575050604001511590565b613367848484614716565b8185858590919293611dae57604051630871e13d60e01b81526004016108ec9493929190615d10565b613398610cdc565b610acd57604051638dfc202b60e01b815260040160405180910390fd5b6000908152609b602052604090206003015490565b6000606060006133d98561472d565b90504281604001511115613401575050604080516020810190915260008152600191506134be565b600080858060200190518101906134189190615d3f565b8451919350915061342d90609a908390613893565b86816001600160a01b03167f4c06b68820628a39c787d2db1faa0eeacd7b9474847b198b1e871fe6e5b93f4485600001518660400151604051613471929190615277565b60405180910390a382516134859083615ae9565b6040805160208101929092526001600160a01b038316908201526060016040516020818303038152906040529550600086945094505050505b9250929050565b6000908152609b60205260408120818155600181018290556002810182905560030155565b60006060876003015483111561351357604051634a411b9d60e11b815260040160405180910390fd5b600083156135215783613527565b88600301545b89549094505b801580159061353c5750600085115b156135955760008061355283898c63ffffffff16565b915091508115613563575050613595565b9650866135718c8c8b6147bb565b92508661357d81615d65565b975050838061358b90615d7c565b945050505061352d565b50989397509295505050505050565b6001600160a01b0380831660009081526020868152604091829020825180840190935280549093168252600190920154918101919091526135e490614842565b15829061360557604051632d7d25f160e21b81526004016108ec9190615048565b506040805180820182526001600160a01b0394851681526020808201938452938516600090815295909352909320905181546001600160a01b03191692169190911781559051600190910155565b6001600160a01b03808216600090815260208481526040808320815161012081018352815490951685526001810154928501929092526002820154908401526003810154606084015260048101546080840152600581015460a0840152600681015460c0840152600781015460e0840152600881015461010084015290916136de9060600151151590565b83906136fe576040516342daadaf60e01b81526004016108ec9190615048565b509392505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b60006137368484613653565b604080516101208101825282546001600160a01b03168152600183015460208201526002830154918101919091526003820154606082015260048201546080820152600582015460a0820152600682015460c0820152600782015460e082015260088201546101008201529091506137ad90612054565b600482015484916137d3576040516361b66e0d60e01b81526004016108ec929190615ad0565b5050600601555050565b60006137e98383613653565b604080516101208101825282546001600160a01b03168152600183015460208201526002830154918101919091526003820154606082015260048201546080820152600582015460a0820152600682015460c0820152600782015460e0820152600882015461010082015290915061386090612054565b60048201548391613886576040516361b66e0d60e01b81526004016108ec929190615ad0565b5050426004909101555050565b806000036138a057505050565b6001600160a01b03821660009081526020849052604090205481808210156138dd57604051635f8ec70960e01b81526004016108ec929190615277565b50506001600160a01b03821660009081526020849052604081208054839290613907908490615845565b9091555050505050565b811561306f576001600160a01b03831660009081526020869052604081205461393b908490615ae9565b90506000856001600160a01b031663872d04898630866040518463ffffffff1660e01b815260040161396f93929190615d95565b602060405180830381865afa15801561398c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906139b09190615a7d565b90508082818111156139d757604051635f8ec70960e01b81526004016108ec929190615277565b50506001600160a01b03851660009081526020889052604081208054869290613a01908490615ae9565b909155505050505050505050565b606082613a2457613a1f82614851565b61186c565b8151158015613a3b57506001600160a01b0384163b155b15613a5b5783604051639996b31560e01b81526004016108ec9190615048565b508061186c565b7f000000000000000000000000000000000000000000000000000000000000000090565b81516040908101516001600160a01b039081166000908152610109602090815290839020549251606093613ac39387938793929091169101615dbe565b604051602081830303815290604052905092915050565b81600003613afb57604051638f4c63d960e01b815260040160405180910390fd5b613b27613b06611b69565b600254609a91908690869063ffffffff600160c01b90910481169061391116565b6001600160a01b0383166000908152609c6020908152604080832060028082015483516001600160601b031930606090811b8216838901528b901b166034820152604880820192909252845180820390920182526068810180865282519287019290922060e882018652898352426088830190815260a883018a815260c8909301898152828a52609b909852959097209151825593516001820155925190830155915160039182015581015490919015613bf55760018201546000908152609b602052604090206003018190555b613bff828261487a565b80856001600160a01b03167f5d9e2c5278e41138269f5f980cfbea016d8c59816754502abc4d2f87aaea987f8686604051613c3b929190615277565b60405180910390a35050505050565b8015610d3c5760405163a9059cbb60e01b81526001600160a01b0384169063a9059cbb90613c7e9085908590600401615ad0565b6020604051808303816000875af1158015613c9d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613cc191906154f8565b610d3c5760405162461bcd60e51b815260206004820152600960248201526810ba3930b739b332b960b91b60448201526064016108ec565b600080613d0760cf886121f2565b9050613d1281612054565b8790613d3257604051631eb5ff9560e01b81526004016108ec9190615048565b506000613d4a60d2548361330090919063ffffffff16565b158015613d5d5750613d5b8261333d565b155b8015613d6857508615155b8015613de05750816101000151613d7d61457a565b6001600160a01b031663766718086040518163ffffffff1660e01b8152600401602060405180830381865afa158015613dba573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613dde9190615a7d565b115b613deb576000613e61565b613df3613706565b6001600160a01b031663db750926896040518263ffffffff1660e01b8152600401613e1e9190615048565b6020604051808303816000875af1158015613e3d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613e619190615a7d565b9050613ea088613e6f613706565b6001600160a01b031663eeac3e0e85602001516040518263ffffffff1660e01b81526004016122c391815260200190565b613eab60cf8961490d565b613eb660cf896149c3565b60008082156141ef576000613ec9611b69565b8551604051637573ef4f60e01b81526001600160a01b039290921691637573ef4f91613efc913090600290600401615e87565b602060405180830381865afa158015613f19573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613f3d9190615a7d565b90506000613f49611b69565b8651604051631584a17960e21b81526001600160a01b03929092169163561285e491613f79913090600401615515565b60a060405180830381865afa158015613f96573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613fba9190615eac565b90506000816020015111613fcf576000613fd9565b613fd98583614a7a565b925082156140ce57613fe9613a62565b6001600160a01b031663095ea7b3613fff611b69565b856040518363ffffffff1660e01b815260040161401d929190615ad0565b6020604051808303816000875af115801561403c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061406091906154f8565b50614069611b69565b865160405163ca94b0e960e01b81526001600160a01b03929092169163ca94b0e99161409b9130908890600401615f1f565b600060405180830381600087803b1580156140b557600080fd5b505af11580156140c9573d6000803e3d6000fd5b505050505b6140d88386615845565b935083156141ec576001600160a01b0388166141df576140f6613a62565b6001600160a01b031663095ea7b361410c611b69565b866040518363ffffffff1660e01b815260040161412a929190615ad0565b6020604051808303816000875af1158015614149573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061416d91906154f8565b50614176611b69565b8651604051633a30904960e11b81526001600160a01b0392909216916374612092916141a89130908990600401615f1f565b600060405180830381600087803b1580156141c257600080fd5b505af11580156141d6573d6000803e3d6000fd5b505050506141ec565b6141ec8885612d3c613a62565b50505b602084015184516001600160a01b03808d1691167f443f56bd2098d273b8c8120398789a41da5925db4ba2f656813fc5299ac57b1f8686868f8f61423161457a565b6001600160a01b031663766718086040518163ffffffff1660e01b8152600401602060405180830381865afa15801561426e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906142929190615a7d565b6040516142a496959493929190615f43565b60405180910390a483516142b89088612ec1565b156142c8576142c88a6001612277565b509098975050505050505050565b600080846001600160a01b031663872d04898530866040518463ffffffff1660e01b815260040161430993929190615d95565b602060405180830381865afa158015614326573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061434a9190615a7d565b6001600160a01b0385166000908152602088905260409020541115915050949350505050565b614378614ada565b610acd57604051631afcd79f60e31b815260040160405180910390fd5b611ab0614370565b6143a5614370565b6143b260006000196126d7565b6143c06000620f4240614af4565b6143d260006001600160401b03614bc5565b610acd63ffffffff611b15565b6143e7614370565b610a8f8282614c52565b60006143fc83611b8d565b9050610d3c8183611cce565b60006112b8614415614c93565b8360405161190160f01b8152600281019290925260228201526042902090565b600061444a6144448585613076565b83614c9d565b905080836001600160a01b038083169082161461447c57604051638c5b935d60e01b81526004016108ec929190615515565b505050505050565b6001600160a01b0380821660009081526020858152604091829020825180840190935280549093168252600190920154918101919091526144c490614842565b1581906144e557604051632d7d25f160e21b81526004016108ec9190615048565b506040516378eb06b360e11b81526001600160a01b0383169063f1d60d6690614512908490600401615048565b602060405180830381865afa15801561452f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061455391906154f8565b15819061457457604051632d7d25f160e21b81526004016108ec9190615048565b50505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b6145a6614fae565b6001600160a01b03808716600090815260208a8152604091829020825161012081018452815490941684526001810154918401919091526002810154918301919091526003810154606083015260048101546080830152600581015460a0830152600681015460c0830152600781015460e0830152600801546101008201526146329060600151151590565b15869061465357604051630bc4def560e01b81526004016108ec9190615048565b505060408051610120810182526001600160a01b0397881681526020808201968752818301958652426060830190815260006080840181815260a0850182815260c0860198895260e0860183815261010087019889529b8d1683529c90935293909320825181546001600160a01b0319169a169990991789559551600189015593516002880155516003870155925160048601559451600585015593516006840155905160078301555160089091015590565b600082821882841102821861186c565b600082841015801561333557505090911115919050565b61475b6040518060800160405280600081526020016000815260200160008152602001600080191681525090565b6000828152609b602090815260409182902082516080810184528154815260018201549281018390526002820154938101939093526003015460608301528390611c895760405163107349a960e21b81526004016108ec91815260200190565b6000808460030154116147e15760405163ddaf8f2160e01b815260040160405180910390fd5b60006147f485600001548563ffffffff16565b905061480785600001548463ffffffff16565b600185600301600082825461481c9190615845565b9091555050808555600385015460000361483857600060018601555b5050915492915050565b516001600160a01b0316151590565b8051156148615780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b6127108260030154106148a0576040516303a8c56b60e61b815260040160405180910390fd5b806148be57604051638f4a893d60e01b815260040160405180910390fd5b60018083018290556002830180546000906148da908490615ae9565b909155505060038201546000036148ef578082555b60018260030160008282546149049190615ae9565b90915550505050565b60006149198383613653565b604080516101208101825282546001600160a01b03168152600183015460208201526002830154918101919091526003820154606082015260048201546080820152600582015460a0820152600682015460c0820152600782015460e0820152600882015461010082015290915061499090612054565b600482015483916149b6576040516361b66e0d60e01b81526004016108ec929190615ad0565b5050426005909101555050565b60006149cf8383613653565b604080516101208101825282546001600160a01b03168152600183015460208201526002830154918101919091526003820154606082015260048201546080820152600582015460a0820152600682015460c0820152600782015460e08201526008820154610100820152909150614a4690612054565b60048201548391614a6c576040516361b66e0d60e01b81526004016108ec929190615ad0565b505060006007909101555050565b6000614a8983620f4240101590565b80614a9c5750614a9c82620f4240101590565b83839091614abf5760405163768bf0eb60e11b81526004016108ec929190615277565b50620f42409050614ad08385615ca1565b61186c9190615f81565b6000614ae4612f04565b54600160401b900460ff16919050565b818163ffffffff8082169083161115614b225760405163ccccdafb60e01b81526004016108ec929190615180565b508290508163ffffffff8116620f42401015614b535760405163ccccdafb60e01b81526004016108ec929190615180565b50506002805463ffffffff838116600160a01b0263ffffffff60a01b19918616600160801b0291909116600160801b600160c01b0319909216919091171790556040517f2fe5a7039987697813605cc0b9d6db7aab575408e3fc59e8a457bef8d7bc0a369061273a9084908490615180565b81816001600160401b038082169083161115614bf65760405163ccccdafb60e01b81526004016108ec92919061521c565b5050600280546001600160401b03838116600160401b026001600160801b0319909216908516171790556040517f2867e04c500e438761486b78021d4f9eb97c77ff45d10c1183f5583ba4cbf7d19061273a908490849061521c565b614c5a614370565b6000614c6461278d565b905060028101614c748482615742565b5060038101614c838382615742565b5060008082556001909101555050565b600061084b614cc7565b600080600080614cad8686614d3b565b925092509250614cbd8282614d88565b5090949350505050565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f614cf2614e41565b614cfa614ea8565b60408051602081019490945283019190915260608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b60008060008351604103614d755760208401516040850151606086015160001a614d6788828585614ee9565b955095509550505050614d81565b50508151600091506002905b9250925092565b6000826003811115614d9c57614d9c6158db565b03614da5575050565b6001826003811115614db957614db96158db565b03614dd75760405163f645eedf60e01b815260040160405180910390fd5b6002826003811115614deb57614deb6158db565b03614e0c5760405163fce698f760e01b8152600481018290526024016108ec565b6003826003811115614e2057614e206158db565b03610a8f576040516335e2f38360e21b8152600481018290526024016108ec565b600080614e4c61278d565b90506000614e586127b1565b805190915015614e7057805160209091012092915050565b81548015614e7f579392505050565b7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470935050505090565b600080614eb361278d565b90506000614ebf612852565b805190915015614ed757805160209091012092915050565b60018201548015614e7f579392505050565b600080806fa2a8918ca85bafe22016d0b997e4df60600160ff1b03841115614f1a5750600091506003905082614fa4565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa158015614f6e573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116614f9a57506000925060019150829050614fa4565b9250600091508190505b9450945094915050565b60405180610120016040528060006001600160a01b0316815260200160008019168152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b6001600160a01b038116811461084857600080fd5b803561502681615006565b919050565b60006020828403121561503d57600080fd5b813561186c81615006565b6001600160a01b0391909116815260200190565b63ffffffff8116811461084857600080fd5b60006020828403121561508057600080fd5b813561186c8161505c565b60008083601f84011261509d57600080fd5b5081356001600160401b038111156150b457600080fd5b6020830191508360208285010111156134be57600080fd5b6000806000604084860312156150e157600080fd5b83356150ec81615006565b925060208401356001600160401b0381111561510757600080fd5b6151138682870161508b565b9497909650939450505050565b801515811461084857600080fd5b6000806040838503121561514157600080fd5b823561514c81615006565b9150602083013561515c81615120565b809150509250929050565b60006020828403121561517957600080fd5b5035919050565b63ffffffff92831681529116602082015260400190565b60005b838110156151b257818101518382015260200161519a565b50506000910152565b600081518084526151d3816020860160208601615197565b601f01601f19169290920160200192915050565b83815260606020820152600061520060608301856151bb565b828103604084015261521281856151bb565b9695505050505050565b6001600160401b0392831681529116602082015260400190565b60008060006060848603121561524b57600080fd5b833561525681615006565b9250602084013561526681615006565b929592945050506040919091013590565b918252602082015260400190565b60ff60f81b8816815260e0602082015260006152a460e08301896151bb565b82810360408401526152b681896151bb565b606084018890526001600160a01b038716608085015260a0840186905283810360c08501528451808252602080870193509091019060005b8181101561530c5783518352602093840193909201916001016152ee565b50909b9a5050505050505050505050565b6000806020838503121561533057600080fd5b82356001600160401b0381111561534657600080fd5b8301601f8101851361535757600080fd5b80356001600160401b0381111561536d57600080fd5b8560208260051b840101111561538257600080fd5b6020919091019590945092505050565b6000602082016020835280845180835260408501915060408160051b86010192506020860160005b828110156153eb57603f198786030184526153d68583516151bb565b945060209384019391909101906001016153ba565b50929695505050505050565b6000806000806060858703121561540d57600080fd5b843561541881615006565b935060208501356003811061542c57600080fd5b925060408501356001600160401b0381111561544757600080fd5b6154538782880161508b565b95989497509550505050565b6000806000806080858703121561547557600080fd5b843561548081615006565b93506020850135925060408501356154978161505c565b9396929550929360600135925050565b600080604083850312156154ba57600080fd5b82356154c581615006565b9150602083013561515c81615006565b6001600160a01b0393841681529183166020830152909116604082015260600190565b60006020828403121561550a57600080fd5b815161186c81615120565b6001600160a01b0392831681529116602082015260400190565b634e487b7160e01b600052604160045260246000fd5b60405161014081016001600160401b03811182821017156155685761556861552f565b60405290565b604080519081016001600160401b03811182821017156155685761556861552f565b60405160e081016001600160401b03811182821017156155685761556861552f565b600082601f8301126155c357600080fd5b8135602083016000806001600160401b038411156155e3576155e361552f565b50604051601f19601f85018116603f011681018181106001600160401b03821117156156115761561161552f565b60405283815290508082840187101561562957600080fd5b838360208301376000602085830101528094505050505092915050565b60008060006060848603121561565b57600080fd5b83356001600160401b0381111561567157600080fd5b61567d868287016155b2565b93505060208401356001600160401b0381111561569957600080fd5b6156a5868287016155b2565b92505060408401356156b681615006565b809150509250925092565b600181811c908216806156d557607f821691505b6020821081036156f557634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115610d3c57806000526020600020601f840160051c810160208510156157225750805b601f840160051c820191505b8181101561306f576000815560010161572e565b81516001600160401b0381111561575b5761575b61552f565b61576f8161576984546156c1565b846156fb565b6020601f8211600181146157a3576000831561578b5750848201515b600019600385901b1c1916600184901b17845561306f565b600084815260208120601f198516915b828110156157d357878501518255602094850194600190920191016157b3565b50848210156157f15786840151600019600387901b60f8161c191681555b50505050600190811b01905550565b60208152816020820152818360408301376000818301604090810191909152601f909201601f19160101919050565b634e487b7160e01b600052601160045260246000fd5b818103818111156112b8576112b861582f565b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261588557600080fd5b8301803591506001600160401b0382111561589f57600080fd5b6020019150368190038213156134be57600080fd5b8284823760008382016000815283516158d1818360208801615197565b0195945050505050565b634e487b7160e01b600052602160045260246000fd5b6003811061590f57634e487b7160e01b600052602160045260246000fd5b9052565b602081016112b882846158f1565b6000806040838503121561593457600080fd5b50508035926020909101359150565b6000806000806080858703121561595957600080fd5b8435935060208501359250604085013561597281615006565b915060608501356001600160401b0381111561598d57600080fd5b615999878288016155b2565b91505092959194509250565b80516150268161505c565b6001600160401b038116811461084857600080fd5b8051615026816159b0565b60006101408284031280156159e457600080fd5b5060006159ef615545565b835181526020808501519082015260408085015190820152615a13606085016159a5565b6060820152615a24608085016159c5565b6080820152615a3560a085016159c5565b60a0820152615a4660c085016159a5565b60c0820152615a5760e085016159c5565b60e082015261010084810151908201526101209384015193810193909352509092915050565b600060208284031215615a8f57600080fd5b5051919050565b600060208284031215615aa857600080fd5b815161186c8161505c565b600060208284031215615ac557600080fd5b815161186c816159b0565b6001600160a01b03929092168252602082015260400190565b808201808211156112b8576112b861582f565b60008251615b0e818460208701615197565b9190910192915050565b8035615026816159b0565b80356001600160801b038116811461502657600080fd5b60008060408385031215615b4d57600080fd5b82356001600160401b03811115615b6357600080fd5b830160408186031215615b7557600080fd5b615b7d61556e565b81356001600160401b03811115615b9357600080fd5b820160e08188031215615ba557600080fd5b615bad615590565b81358152615bbd6020830161501b565b6020820152615bce6040830161501b565b6040820152615bdf6060830161501b565b6060820152615bf060808301615b18565b6080820152615c0160a08301615b23565b60a082015260c08201356001600160401b03811115615c1f57600080fd5b615c2b898285016155b2565b60c08301525082525060208201356001600160401b03811115615c4d57600080fd5b615c59878285016155b2565b60208381019190915291979590910135955050505050565b615c7b81856158f1565b606060208201526000615c9160608301856151bb565b9050826040830152949350505050565b80820281158282048414176112b8576112b861582f565b600080600060608486031215615ccd57600080fd5b8335615cd881615006565b92506020840135915060408401356001600160401b03811115615cfa57600080fd5b615d06868287016155b2565b9150509250925092565b608081526000615d2360808301876151bb565b6020830195909552506040810192909252606090910152919050565b60008060408385031215615d5257600080fd5b8251602084015190925061515c81615006565b600081615d7457615d7461582f565b506000190190565b600060018201615d8e57615d8e61582f565b5060010190565b6001600160a01b03938416815291909216602082015263ffffffff909116604082015260600190565b606080825284516040838301819052815160a085015260208201516001600160a01b0390811660c086015290820151811660e08501529181015190911661010083015260808101516001600160401b038116610120840152600091905060a08101516001600160801b0381166101408501525060c0015160e0610160840152615e4b6101808401826151bb565b90506020860151605f19848303016080850152615e6882826151bb565b9250505083602083015261333560408301846001600160a01b03169052565b6001600160a01b038481168252831660208201526060810161333560408301846158f1565b600060a0828403128015615ebf57600080fd5b5060405160009060a081016001600160401b0381118282101715615ee557615ee561552f565b6040908152845182526020808601519083015284810151908201526060808501519082015260809384015193810193909352509092915050565b6001600160a01b039384168152919092166020820152604081019190915260600190565b86815285602082015284604082015283606082015260c060808201526000615f6e60c08301856151bb565b90508260a0830152979650505050505050565b600082615f9e57634e487b7160e01b600052601260045260246000fd5b50049056fea2646970667358221220b85de947a2adf153b4d5d66360454c8d0624bca998d3fc8f12bd17e31d74127864736f6c634300081b0033", + "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061023b5760003560e01c806307e736d8146102405780630e02292314610280578063138dea081461030857806313c474c9146103205780631dd42f60146103755780631ebb7c301461038a57806324b8fbf6146103af57806335577962146103c25780633f4ba83a146103d557806345f54485146103dd578063482468b7146103f05780634f793cdc1461040657806355c85269146104285780635c975abb146104725780636234e2161461048a5780636ccec5b8146104aa5780636d9a3951146104bd578063715018a61461053857806371ce020a146105405780637aa31bce146105565780637dfe6d28146105695780637e89bac31461057c5780638180083b1461058f578063819ba366146105a257806381e777a7146105b8578063832bc923146105cb5780638456cb59146105de57806384b0196e146105e657806385e82baf146106015780638da5cb5b1461060a5780639384e07814610612578063ac9650d814610635578063b15d2a2c14610655578063ba38f67d14610668578063c0f474971461067b578063c84a5ef314610683578063cb8347fe14610696578063cbe5f3f2146106a9578063ce0fc0cc146106c9578063ce56c98b146106dc578063d07a7a84146106ef578063db9bee46146106f9578063dedf672614610701578063e2e1e8e914610714578063e6f5005414610734578063ebf6ddaf14610747578063ec9c218d1461074f578063eff0f59214610762578063f2fde38b14610797575b600080fd5b61026a61024e36600461502b565b610109602052600090815260409020546001600160a01b031681565b6040516102779190615048565b60405180910390f35b61029361028e36600461502b565b6107aa565b604051610277919060006101208201905060018060a01b0383511682526020830151602083015260408301516040830152606083015160608301526080830151608083015260a083015160a083015260c083015160c083015260e083015160e083015261010083015161010083015292915050565b6103126101085481565b604051908152602001610277565b61035561032e36600461502b565b609c6020526000908152604090208054600182015460028301546003909301549192909184565b604080519485526020850193909352918301526060820152608001610277565b61038861038336600461506e565b610837565b005b600254600160c01b900463ffffffff1660405163ffffffff9091168152602001610277565b6103886103bd3660046150cc565b610850565b6103886103d036600461512e565b610a7d565b610388610a93565b6103886103eb366004615167565b610acf565b6103f8610ad9565b604051610277929190615180565b61041961041436600461502b565b610aec565b604051610277939291906151e7565b61043b61043636600461502b565b610c20565b6040805196151587526001600160a01b039095166020870152938501929092526060840152608083015260a082015260c001610277565b61047a610cdc565b6040519015158152602001610277565b61031261049836600461502b565b60d16020526000908152604090205481565b6103886104b836600461502b565b610cf1565b6105146104cb36600461502b565b604080518082018252600080825260209182018190526001600160a01b03938416815260d082528290208251808401909352805490931682526001909201549181019190915290565b6040805182516001600160a01b031681526020928301519281019290925201610277565b610388610cfb565b610548610d0d565b60405161027792919061521c565b610388610564366004615167565b610d18565b610388610577366004615236565b610d29565b61038861058a366004615167565b610d41565b61038861059d3660046150cc565b610db6565b6105aa610f44565b604051610277929190615277565b6103886105c6366004615236565b610f54565b6103886105d9366004615167565b6110c4565b6103886110d8565b6105ee611112565b6040516102779796959493929190615285565b61031260d25481565b61026a6111bb565b61047a61062036600461502b565b60676020526000908152604090205460ff1681565b61064861064336600461531d565b6111d6565b6040516102779190615392565b6103126106633660046153f7565b6112be565b61047a61067636600461502b565b611492565b61026a6114b0565b61038861069136600461545f565b6114ba565b6103886106a43660046150cc565b611638565b6103126106b736600461502b565b609a6020526000908152604090205481565b6103886106d73660046150cc565b611777565b6103126106ea3660046154a7565b611860565b6103126101075481565b61026a611873565b61038861070f3660046150cc565b61187d565b610312610722366004615167565b600090815260d3602052604090205490565b610388610742366004615167565b611a0b565b61026a611a1c565b61038861075d36600461502b565b611a26565b610355610770366004615167565b609b6020526000908152604090208054600182015460028301546003909301549192909184565b6103886107a536600461502b565b611aa8565b6107b2614fae565b506001600160a01b03908116600090815260cf6020908152604091829020825161012081018452815490941684526001810154918401919091526002810154918301919091526003810154606083015260048101546080830152600581015460a0830152600681015460c0830152600781015460e08301526008015461010082015290565b61083f611ae3565b61084881611b15565b50565b905090565b82610859611b69565b6001600160a01b0316637c145cc78230336040518463ffffffff1660e01b8152600401610888939291906154d5565b602060405180830381865afa1580156108a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108c991906154f8565b813390916108f55760405163cc5d3c8b60e01b81526004016108ec929190615515565b60405180910390fd5b505083600061090382611b8d565b905061090e81611c90565b610919816000611cce565b610921611db8565b6000808061093187890189615646565b925092509250600083511161095957604051630783843960e51b815260040160405180910390fd5b600082511161097b57604051631e63bd9560e21b815260040160405180910390fd5b6001600160a01b03891660009081526101066020526040902054156109b357604051630d06866d60e21b815260040160405180910390fd5b6040805160608101825242815260208082018681528284018690526001600160a01b038d16600090815261010690925292902081518155915190919060018201906109fe9082615742565b5060408201516002820190610a139082615742565b5050506001600160a01b03811615610a2f57610a2f8982611dde565b886001600160a01b03167f159567bea25499a91f60e1fbb349ff2a1f8c1b2883198f25c1e12c99eddb44fa8989604051610a6a929190615800565b60405180910390a2505050505050505050565b610a85611ae3565b610a8f8282611e35565b5050565b3360008181526067602052604090205460ff16610ac4576040516372e3ef9760e01b81526004016108ec9190615048565b50610acd611eeb565b565b6108483382611f37565b600080610ae4611fdd565b915091509091565b6101066020526000908152604090208054600182018054919291610b0f906156c1565b80601f0160208091040260200160405190810160405280929190818152602001828054610b3b906156c1565b8015610b885780601f10610b5d57610100808354040283529160200191610b88565b820191906000526020600020905b815481529060010190602001808311610b6b57829003601f168201915b505050505090806002018054610b9d906156c1565b80601f0160208091040260200160405190810160405280929190818152602001828054610bc9906156c1565b8015610c165780601f10610beb57610100808354040283529160200191610c16565b820191906000526020600020905b815481529060010190602001808311610bf957829003601f168201915b5050505050905083565b6001600160a01b03808216600090815260cf60209081526040808320815161012081018352815490951685526001810154928501929092526002820154908401526003810154606084015260048101546080840152600581015460a0840152600681015460c0840152600781015460e0840152600801546101008301529081908190819081908190610cb181612054565b81516020830151604084015160c085015160e090950151939c929b5090995097509195509350915050565b600080610ce7612073565b5460ff1692915050565b6108483382611dde565b610d03611ae3565b610acd6000612097565b600080610ae46120f3565b610d20611ae3565b6108488161216a565b610d31611ae3565b610d3c83838361219f565b505050565b610d49611ae3565b610d5681620f4240101590565b8190610d7857604051631c9c717b60e01b81526004016108ec91815260200190565b506101088190556040518181527f6deef78ffe3df79ae5cd8e40b842c36ac6077e13746b9b68a9f327537b01e4e9906020015b60405180910390a150565b82610dbf611b69565b6001600160a01b0316637c145cc78230336040518463ffffffff1660e01b8152600401610dee939291906154d5565b602060405180830381865afa158015610e0b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e2f91906154f8565b81339091610e525760405163cc5d3c8b60e01b81526004016108ec929190615515565b50506001600160a01b0384166000908152610106602052604090205484908190610e905760405163ee27189960e01b81526004016108ec9190615048565b50610e99611db8565b6000610ea78486018661502b565b90506001600160a01b038616610ebe60cf836121f2565b51879183916001600160a01b031614610eec5760405163c0bbff1360e01b81526004016108ec929190615515565b5050610ef9816000612277565b856001600160a01b03167f73330c218a680717e9eee625c262df66eddfdf99ecb388d25f6b32d66b9a318a8686604051610f34929190615800565b60405180910390a2505050505050565b600080610ae46000546001549091565b82610f5d611b69565b6001600160a01b0316637c145cc78230336040518463ffffffff1660e01b8152600401610f8c939291906154d5565b602060405180830381865afa158015610fa9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fcd91906154f8565b81339091610ff05760405163cc5d3c8b60e01b81526004016108ec929190615515565b5050836000610ffe82611b8d565b905061100981611c90565b611014816000611cce565b6001600160a01b03861660009081526101066020526040902054869081906110505760405163ee27189960e01b81526004016108ec9190615048565b50611059611db8565b6001600160a01b03871661106e60cf886121f2565b51889188916001600160a01b03161461109c5760405163c0bbff1360e01b81526004016108ec929190615515565b50506110bb8686600260189054906101000a900463ffffffff166123d9565b50505050505050565b6110cc611ae3565b610848816000196126d7565b3360008181526067602052604090205460ff16611109576040516372e3ef9760e01b81526004016108ec9190615048565b50610acd612746565b600060608060008060006060600061112861278d565b805490915015801561113c57506001810154155b6111805760405162461bcd60e51b81526020600482015260156024820152741152540dcc4c8e88155b9a5b9a5d1a585b1a5e9959605a1b60448201526064016108ec565b6111886127b1565b611190612852565b60408051600080825260208201909252600f60f81b9c939b5091995046985030975095509350915050565b6000806111c661286f565b546001600160a01b031692915050565b604080516000815260208101909152606090826001600160401b038111156112005761120061552f565b60405190808252806020026020018201604052801561123357816020015b606081526020019060019003908161121e5790505b50915060005b838110156112b5576112903086868481811061125757611257615858565b9050602002810190611269919061586e565b8560405160200161127c939291906158b4565b604051602081830303815290604052612893565b8382815181106112a2576112a2615858565b6020908102919091010152600101611239565b50505b92915050565b6000846112c9611b69565b6001600160a01b0316637c145cc78230336040518463ffffffff1660e01b81526004016112f8939291906154d5565b602060405180830381865afa158015611315573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061133991906154f8565b8133909161135c5760405163cc5d3c8b60e01b81526004016108ec929190615515565b505085600061136a82611b8d565b905061137581611c90565b611380816000611cce565b6001600160a01b03881660009081526101066020526040902054889081906113bc5760405163ee27189960e01b81526004016108ec9190615048565b506113c5611db8565b6000808960028111156113da576113da6158db565b036113f1576113ea8a8989612909565b9050611430565b6002896002811115611405576114056158db565b03611415576113ea8a8989612e1d565b8860405163047031cf60e41b81526004016108ec9190615913565b886002811115611442576114426158db565b8a6001600160a01b03167f54fe682bfb66381a9382e13e4b95a3dd4f960eafbae063fdea3539d144ff3ff58360405161147d91815260200190565b60405180910390a39998505050505050505050565b60006112b882600260189054906101000a900463ffffffff16612ec1565b600061084b612ee0565b60006114c4612f04565b805490915060ff600160401b82041615906001600160401b03166000811580156114eb5750825b90506000826001600160401b031660011480156115075750303b155b905081158015611515575080155b156115335760405163f92ee8a960e01b815260040160405180910390fd5b84546001600160401b0319166001178555831561155c57845460ff60401b1916600160401b1785555b61156589612f2d565b61156d612f3e565b611575612f46565b61157d612f5e565b6115c96040518060400160405280600f81526020016e53756267726170685365727669636560881b815250604051806040016040528060038152602001620312e360ec1b815250612f6e565b6115d5886000196126d7565b6115de87611b15565b6115e786612f88565b831561162d57845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b505050505050505050565b337f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03811682146116855760405163cdc0567f60e01b81526004016108ec929190615515565b50600090508061169783850185615921565b915091506116a3611b69565b6001600160a01b031663e76fede68684846116bc612fdf565b60405160e086901b6001600160e01b03191681526001600160a01b039485166004820152602481019390935260448301919091529091166064820152608401600060405180830381600087803b15801561171557600080fd5b505af1158015611729573d6000803e3d6000fd5b50505050846001600160a01b03167f02f2e74a11116e05b39159372cceb6739257b08d72f7171d208ff27bb6466c588360405161176891815260200190565b60405180910390a25050505050565b82611780611b69565b6001600160a01b0316637c145cc78230336040518463ffffffff1660e01b81526004016117af939291906154d5565b602060405180830381865afa1580156117cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117f091906154f8565b813390916118135760405163cc5d3c8b60e01b81526004016108ec929190615515565b505061181d611db8565b61182684613003565b6040516001600160a01b038516907ff53cf6521a1b5fc0c04bffa70374a4dc2e3474f2b2ac1643c3bcc54e2db4a93990600090a250505050565b600061186c8383613076565b9392505050565b600061084b612fdf565b82611886611b69565b6001600160a01b0316637c145cc78230336040518463ffffffff1660e01b81526004016118b5939291906154d5565b602060405180830381865afa1580156118d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118f691906154f8565b813390916119195760405163cc5d3c8b60e01b81526004016108ec929190615515565b505083600061192782611b8d565b905061193281611c90565b61193d816000611cce565b6001600160a01b03861660009081526101066020526040902054869081906119795760405163ee27189960e01b81526004016108ec9190615048565b50611982611db8565b6000808080611993898b018b615943565b93509350935093506119bb8b83868685600260189054906101000a900463ffffffff166130e5565b8a6001600160a01b03167fd3803eb82ef5b4cdff8646734ebbaf5b37441e96314b27ffd3d0940f12a038e78b8b6040516119f6929190615800565b60405180910390a25050505050505050505050565b611a13611ae3565b61084881612f88565b600061084b6132dc565b611a2e611db8565b6000611a3b60cf836121f2565b9050611a5260d2548261330090919063ffffffff16565b8290611a7157604051623477b560e51b81526004016108ec9190615048565b50611a7b8161333d565b158290611a9c576040516317c7b35d60e31b81526004016108ec9190615048565b50610a8f826001612277565b611ab0611ae3565b6001600160a01b038116611ada576000604051631e4fbdf760e01b81526004016108ec9190615048565b61084881612097565b33611aec6111bb565b6001600160a01b031614610acd573360405163118cdaa760e01b81526004016108ec9190615048565b6002805463ffffffff60c01b1916600160c01b63ffffffff8416908102919091179091556040519081527f472aba493f9fd1d136ec54986f619f3aa5caff964f0e731a9909fb9a1270211f90602001610dab565b7f000000000000000000000000000000000000000000000000000000000000000090565b6040805161014081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101829052610120810182905290611be6611b69565b6001600160a01b03166325d9897e84306040518363ffffffff1660e01b8152600401611c13929190615515565b61014060405180830381865afa158015611c31573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c5591906159d0565b90508060a001516001600160401b0316600014158390611c8957604051637b3c09bf60e01b81526004016108ec9190615048565b5092915050565b6020810151815161084891611ca491615845565b60005460015460405180604001604052806006815260200165746f6b656e7360d01b81525061335c565b600080611cd96120f3565b91509150600083611cee578460800151611cf4565b8460e001515b9050611d42816001600160401b0316846001600160401b0316846001600160401b03166040518060400160405280600d81526020016c1d1a185dda5b99d4195c9a5bd9609a1b81525061335c565b600080611d4d611fdd565b91509150600086611d62578760600151611d68565b8760c001515b9050611dae8163ffffffff168463ffffffff168463ffffffff166040518060400160405280600e81526020016d1b585e15995c9a599a595c90dd5d60921b81525061335c565b5050505050505050565b611dc0610cdc565b15610acd5760405163d93c066560e01b815260040160405180910390fd5b6001600160a01b038281166000818152610109602052604080822080546001600160a01b0319169486169485179055517e3215dc05a2fc4e6a1e2c2776311d207c730ee51085aae221acc5cbe6fb55c19190a35050565b6001600160a01b0382166000908152606760205260409020548290829060ff161515811514611e8a57604051635e67e54b60e01b81526001600160a01b039092166004830152151560248201526044016108ec565b50506001600160a01b038216600081815260676020908152604091829020805460ff191685151590811790915591519182527fa95bac2f3df0d40e8278281c1d39d53c60e4f2bf3550ca5665738d0916e89789910160405180910390a25050565b611ef3613390565b6000611efd612073565b805460ff1916815590507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b604051610dab9190615048565b6001600160a01b0382166000818152609c60209081526040808320815192830184905282820194909452805180830382018152606090920190528190611f8b9084906133b5906133ca906134c590896134ea565b91509150846001600160a01b03167f13f3fa9f0e54af1af76d8b5d11c3973d7c2aed6312b61efff2f7b49d73ad67eb8383806020019051810190611fcf9190615a7d565b604051611768929190615277565b600080611fe8612fdf565b6001600160a01b031663bb2a2b476040518163ffffffff1660e01b8152600401602060405180830381865afa158015612025573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120499190615a96565b92620f424092509050565b60006120638260600151151590565b80156112b8575050608001511590565b7fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f0330090565b60006120a161286f565b80546001600160a01b038481166001600160a01b031983168117845560405193945091169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b6000806000612100612fdf565b6001600160a01b0316635aea0ec46040518163ffffffff1660e01b8152600401602060405180830381865afa15801561213d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121619190615ab3565b93849350915050565b60d28190556040518181527f21774046e2611ddb52c8c46e1ad97524eeb2e3fda7dcd9428867868b4c4d06ba90602001610dab565b6121ac60d08484846135a4565b80826001600160a01b0316846001600160a01b03167fd54c7abc930f6d506da2d08aa7aead4f2443e1db6d5f560384a2f652ff893e1960405160405180910390a4505050565b6121fa614fae565b6122048383613653565b604080516101208101825282546001600160a01b03168152600183015460208201526002830154918101919091526003820154606082015260048201546080820152600582015460a0820152600682015460c0820152600782015460e08201526008909101546101008201529392505050565b600061228460cf846121f2565b905061230f83612292613706565b6001600160a01b031663eeac3e0e84602001516040518263ffffffff1660e01b81526004016122c391815260200190565b6020604051808303816000875af11580156122e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123069190615a7d565b60cf919061372a565b61231a60cf846137dd565b8051604082015161232d9160d191613893565b806040015160d3600083602001518152602001908152602001600020546123549190615845565b60d3600083602001518152602001908152602001600020819055508060200151836001600160a01b031682600001516001600160a01b03167f08f2f865e0fb62d722a51e4d9873199bf6bf52e7d8ee5a2ee2896c9ef719f5458460400151866040516123cc9291909182521515602082015260400190565b60405180910390a4505050565b60006123e660cf856121f2565b90506123f181612054565b849061241157604051631eb5ff9560e01b81526004016108ec9190615048565b5080604001518314158484909161243d5760405163f32518cd60e01b81526004016108ec929190615ad0565b50506040810151808411156124735761246e612457611b69565b83516124638488615845565b60d192919087613911565b61248c565b815161248c906124838684615845565b60d19190613893565b6000612496613706565b6001600160a01b031663eeac3e0e84602001516040518263ffffffff1660e01b81526004016124c791815260200190565b6020604051808303816000875af11580156124e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061250a9190615a7d565b905060006125178461333d565b15612523576000612532565b60c08401516125329083615845565b6001600160a01b038816600090815260cf60205260409020600281018890556006018390559050612561613706565b6001600160a01b031663c8a5f81e84836040518363ffffffff1660e01b815260040161258e929190615277565b602060405180830381865afa1580156125ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125cf9190615a7d565b6001600160a01b038816600090815260cf6020526040812060070180549091906125fa908490615ae9565b909155505082861115612642576126118387615845565b60d360008660200151815260200190815260200160002060008282546126379190615ae9565b909155506126789050565b61264c8684615845565b60d360008660200151815260200190815260200160002060008282546126729190615845565b90915550505b8360200151876001600160a01b031685600001516001600160a01b03167f6db4a6f9be2d5e72eb2a2af2374ac487971bf342a261ba0bc1cf471bf2a2c31f89876040516126c6929190615277565b60405180910390a450505050505050565b8181808211156126fc5760405163ccccdafb60e01b81526004016108ec929190615277565b5050600082905560018190556040517f90699b8b4bf48918fea1129c85f9bc7b51285df7ecc982910813c7805f5688499061273a9084908490615277565b60405180910390a15050565b61274e611db8565b6000612758612073565b805460ff1916600117815590507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611f2a3390565b7fa16a46d94261c7517cc8ff89f61c0ce93598e3c849801011dee649a6a557d10090565b606060006127bd61278d565b90508060020180546127ce906156c1565b80601f01602080910402602001604051908101604052809291908181526020018280546127fa906156c1565b80156128475780601f1061281c57610100808354040283529160200191612847565b820191906000526020600020905b81548152906001019060200180831161282a57829003601f168201915b505050505091505090565b6060600061285e61278d565b90508060030180546127ce906156c1565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930090565b6060600080846001600160a01b0316846040516128b09190615afc565b600060405180830381855af49150503d80600081146128eb576040519150601f19603f3d011682016040523d82523d6000602084013e6128f0565b606091505b5091509150612900858383613a0f565b95945050505050565b6000808061291984860186615b3a565b8151604001519193509150866001600160a01b038281169082161461295357604051631a071d0760e01b81526004016108ec929190615515565b50508151516001600160a01b038111156129835760405163fa4ac7a760e01b81526004016108ec91815260200190565b50815151600061299460cf836121f2565b805190915088906001600160a01b03818116908316146129c957604051634508fbf760e11b81526004016108ec929190615515565b505060208101516129db896000611f37565b60008060006129e8613a62565b6001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401612a139190615048565b602060405180830381865afa158015612a30573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a549190615a7d565b9050612a5e6132dc565b6001600160a01b031663692209ce6000612afc8b612a7a612ee0565b6001600160a01b0316634c4ea0ed8a6040518263ffffffff1660e01b8152600401612aa791815260200190565b602060405180830381865afa158015612ac4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ae891906154f8565b612af3576000613a86565b61010854613a86565b8a6040518463ffffffff1660e01b8152600401612b1b93929190615c71565b6020604051808303816000875af1158015612b3a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b5e9190615a7d565b92506000612b6a613a62565b6001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401612b959190615048565b602060405180830381865afa158015612bb2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bd69190615a7d565b9050818181811015612bfd57604051639db8bc9560e01b81526004016108ec929190615277565b50612c0a90508282615845565b92505082159050612db457612ca98b6101075484612c289190615ca1565b612c30612fdf565b6001600160a01b0316635aea0ec46040518163ffffffff1660e01b8152600401602060405180830381865afa158015612c6d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c919190615ab3565b612ca4906001600160401b031642615ae9565b613ada565b8015612db457612cb7613706565b6001600160a01b0316631d1c2fec846040518263ffffffff1660e01b8152600401612ce491815260200190565b6020604051808303816000875af1158015612d03573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d279190615a7d565b50612d4c612d33612ee0565b82612d3c613a62565b6001600160a01b03169190613c4a565b612d54612ee0565b6001600160a01b0316638157328884836040518363ffffffff1660e01b8152600401612d81929190615277565b600060405180830381600087803b158015612d9b57600080fd5b505af1158015612daf573d6000803e3d6000fd5b505050505b86516020908101516040805186815292830185905282018390526001600160a01b038088169291811691908e16907f184c452047299395d4f7f147eb8e823458a450798539be54aeed978f13d87ba29060600160405180910390a4509998505050505050505050565b6000808080612e2e85870187615cb8565b919450925090506001600160a01b038716612e4a60cf856121f2565b51889185916001600160a01b031614612e785760405163c0bbff1360e01b81526004016108ec929190615515565b50506002546001600160a01b0388811660009081526101096020526040902054612eb692869286928692600160c01b900463ffffffff169116613cf9565b979650505050505050565b6000612ed8612ece611b69565b60d19085856142d6565b159392505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b6000807ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a006112b8565b612f35614370565b61084881614395565b610acd614370565b612f4e614370565b612f5661439d565b610acd612f3e565b612f66614370565b612f56612f3e565b612f76614370565b612f8082826143df565b610a8f612f3e565b80600003612fa95760405163bc71a04360e01b815260040160405180910390fd5b6101078190556040518181527f2aaaf20b08565eebc0c962cd7c568e54c3c0c2b85a1f942b82cd1bd730fdcd2390602001610dab565b7f000000000000000000000000000000000000000000000000000000000000000090565b61300e8160016143f1565b613016611b69565b6001600160a01b0316633a78b732826040518263ffffffff1660e01b81526004016130419190615048565b600060405180830381600087803b15801561305b57600080fd5b505af115801561306f573d6000803e3d6000fd5b5050505050565b600061186c7f4bdee85c4b4a268f4895d1096d553c3e57bb2433c380e7b7ec8cb56cc4f7467384846040516020016130ca939291909283526001600160a01b03918216602084015216604082015260600190565b60405160208183030381529060405280519060200120614408565b6001600160a01b03851661310c57604051634ffdf5ef60e11b815260040160405180910390fd5b613117868684614435565b61312b613122611b69565b60d09087614484565b600061313561457a565b6001600160a01b031663766718086040518163ffffffff1660e01b8152600401602060405180830381865afa158015613172573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131969190615a7d565b90506000613226888888886131a9613706565b6001600160a01b031663eeac3e0e8c6040518263ffffffff1660e01b81526004016131d691815260200190565b6020604051808303816000875af11580156131f5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132199190615a7d565b60cf94939291908861459e565b905061323e613233611b69565b60d1908a8887613911565b806040015160d3600083602001518152602001908152602001600020546132659190615ae9565b60d36000836020015181526020019081526020016000208190555085876001600160a01b0316896001600160a01b03167fe5e185fab2b992c4727ff702a867d78b15fb176dbaa20c9c312a1c351d3f7f838460400151866040516132ca929190615277565b60405180910390a45050505050505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b60008061331584606001518560a00151614706565b61331f9042615845565b905061332a84612054565b801561333557508281115b949350505050565b600061334c8260600151151590565b80156112b8575050604001511590565b613367848484614716565b8185858590919293611dae57604051630871e13d60e01b81526004016108ec9493929190615d10565b613398610cdc565b610acd57604051638dfc202b60e01b815260040160405180910390fd5b6000908152609b602052604090206003015490565b6000606060006133d98561472d565b90504281604001511115613401575050604080516020810190915260008152600191506134be565b600080858060200190518101906134189190615d3f565b8451919350915061342d90609a908390613893565b86816001600160a01b03167f4c06b68820628a39c787d2db1faa0eeacd7b9474847b198b1e871fe6e5b93f4485600001518660400151604051613471929190615277565b60405180910390a382516134859083615ae9565b6040805160208101929092526001600160a01b038316908201526060016040516020818303038152906040529550600086945094505050505b9250929050565b6000908152609b60205260408120818155600181018290556002810182905560030155565b60006060876003015483111561351357604051634a411b9d60e11b815260040160405180910390fd5b600083156135215783613527565b88600301545b89549094505b801580159061353c5750600085115b156135955760008061355283898c63ffffffff16565b915091508115613563575050613595565b9650866135718c8c8b6147bb565b92508661357d81615d65565b975050838061358b90615d7c565b945050505061352d565b50989397509295505050505050565b6001600160a01b0380831660009081526020868152604091829020825180840190935280549093168252600190920154918101919091526135e490614842565b15829061360557604051632d7d25f160e21b81526004016108ec9190615048565b506040805180820182526001600160a01b0394851681526020808201938452938516600090815295909352909320905181546001600160a01b03191692169190911781559051600190910155565b6001600160a01b03808216600090815260208481526040808320815161012081018352815490951685526001810154928501929092526002820154908401526003810154606084015260048101546080840152600581015460a0840152600681015460c0840152600781015460e0840152600881015461010084015290916136de9060600151151590565b83906136fe576040516342daadaf60e01b81526004016108ec9190615048565b509392505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b60006137368484613653565b604080516101208101825282546001600160a01b03168152600183015460208201526002830154918101919091526003820154606082015260048201546080820152600582015460a0820152600682015460c0820152600782015460e082015260088201546101008201529091506137ad90612054565b600482015484916137d3576040516361b66e0d60e01b81526004016108ec929190615ad0565b5050600601555050565b60006137e98383613653565b604080516101208101825282546001600160a01b03168152600183015460208201526002830154918101919091526003820154606082015260048201546080820152600582015460a0820152600682015460c0820152600782015460e0820152600882015461010082015290915061386090612054565b60048201548391613886576040516361b66e0d60e01b81526004016108ec929190615ad0565b5050426004909101555050565b806000036138a057505050565b6001600160a01b03821660009081526020849052604090205481808210156138dd57604051635f8ec70960e01b81526004016108ec929190615277565b50506001600160a01b03821660009081526020849052604081208054839290613907908490615845565b9091555050505050565b811561306f576001600160a01b03831660009081526020869052604081205461393b908490615ae9565b90506000856001600160a01b031663872d04898630866040518463ffffffff1660e01b815260040161396f93929190615d95565b602060405180830381865afa15801561398c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906139b09190615a7d565b90508082818111156139d757604051635f8ec70960e01b81526004016108ec929190615277565b50506001600160a01b03851660009081526020889052604081208054869290613a01908490615ae9565b909155505050505050505050565b606082613a2457613a1f82614851565b61186c565b8151158015613a3b57506001600160a01b0384163b155b15613a5b5783604051639996b31560e01b81526004016108ec9190615048565b508061186c565b7f000000000000000000000000000000000000000000000000000000000000000090565b81516040908101516001600160a01b039081166000908152610109602090815290839020549251606093613ac39387938793929091169101615dbe565b604051602081830303815290604052905092915050565b81600003613afb57604051638f4c63d960e01b815260040160405180910390fd5b613b27613b06611b69565b600254609a91908690869063ffffffff600160c01b90910481169061391116565b6001600160a01b0383166000908152609c6020908152604080832060028082015483516001600160601b031930606090811b8216838901528b901b166034820152604880820192909252845180820390920182526068810180865282519287019290922060e882018652898352426088830190815260a883018a815260c8909301898152828a52609b909852959097209151825593516001820155925190830155915160039182015581015490919015613bf55760018201546000908152609b602052604090206003018190555b613bff828261487a565b80856001600160a01b03167f5d9e2c5278e41138269f5f980cfbea016d8c59816754502abc4d2f87aaea987f8686604051613c3b929190615277565b60405180910390a35050505050565b8015610d3c5760405163a9059cbb60e01b81526001600160a01b0384169063a9059cbb90613c7e9085908590600401615ad0565b6020604051808303816000875af1158015613c9d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613cc191906154f8565b610d3c5760405162461bcd60e51b815260206004820152600960248201526810ba3930b739b332b960b91b60448201526064016108ec565b600080613d0760cf886121f2565b9050613d1281612054565b8790613d3257604051631eb5ff9560e01b81526004016108ec9190615048565b506000613d4a60d2548361330090919063ffffffff16565b158015613d5d5750613d5b8261333d565b155b8015613d6857508615155b8015613de05750816101000151613d7d61457a565b6001600160a01b031663766718086040518163ffffffff1660e01b8152600401602060405180830381865afa158015613dba573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613dde9190615a7d565b115b613deb576000613e61565b613df3613706565b6001600160a01b031663db750926896040518263ffffffff1660e01b8152600401613e1e9190615048565b6020604051808303816000875af1158015613e3d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613e619190615a7d565b9050613ea088613e6f613706565b6001600160a01b031663eeac3e0e85602001516040518263ffffffff1660e01b81526004016122c391815260200190565b613eab60cf8961490d565b613eb660cf896149c3565b60008082156141ef576000613ec9611b69565b8551604051637573ef4f60e01b81526001600160a01b039290921691637573ef4f91613efc913090600290600401615e87565b602060405180830381865afa158015613f19573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613f3d9190615a7d565b90506000613f49611b69565b8651604051631584a17960e21b81526001600160a01b03929092169163561285e491613f79913090600401615515565b60a060405180830381865afa158015613f96573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613fba9190615eac565b90506000816020015111613fcf576000613fd9565b613fd98583614a7a565b925082156140ce57613fe9613a62565b6001600160a01b031663095ea7b3613fff611b69565b856040518363ffffffff1660e01b815260040161401d929190615ad0565b6020604051808303816000875af115801561403c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061406091906154f8565b50614069611b69565b865160405163ca94b0e960e01b81526001600160a01b03929092169163ca94b0e99161409b9130908890600401615f1f565b600060405180830381600087803b1580156140b557600080fd5b505af11580156140c9573d6000803e3d6000fd5b505050505b6140d88386615845565b935083156141ec576001600160a01b0388166141df576140f6613a62565b6001600160a01b031663095ea7b361410c611b69565b866040518363ffffffff1660e01b815260040161412a929190615ad0565b6020604051808303816000875af1158015614149573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061416d91906154f8565b50614176611b69565b8651604051633a30904960e11b81526001600160a01b0392909216916374612092916141a89130908990600401615f1f565b600060405180830381600087803b1580156141c257600080fd5b505af11580156141d6573d6000803e3d6000fd5b505050506141ec565b6141ec8885612d3c613a62565b50505b602084015184516001600160a01b03808d1691167f443f56bd2098d273b8c8120398789a41da5925db4ba2f656813fc5299ac57b1f8686868f8f61423161457a565b6001600160a01b031663766718086040518163ffffffff1660e01b8152600401602060405180830381865afa15801561426e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906142929190615a7d565b6040516142a496959493929190615f43565b60405180910390a483516142b89088612ec1565b156142c8576142c88a6001612277565b509098975050505050505050565b600080846001600160a01b031663872d04898530866040518463ffffffff1660e01b815260040161430993929190615d95565b602060405180830381865afa158015614326573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061434a9190615a7d565b6001600160a01b0385166000908152602088905260409020541115915050949350505050565b614378614ada565b610acd57604051631afcd79f60e31b815260040160405180910390fd5b611ab0614370565b6143a5614370565b6143b260006000196126d7565b6143c06000620f4240614af4565b6143d260006001600160401b03614bc5565b610acd63ffffffff611b15565b6143e7614370565b610a8f8282614c52565b60006143fc83611b8d565b9050610d3c8183611cce565b60006112b8614415614c93565b8360405161190160f01b8152600281019290925260228201526042902090565b600061444a6144448585613076565b83614c9d565b905080836001600160a01b038083169082161461447c57604051638c5b935d60e01b81526004016108ec929190615515565b505050505050565b6001600160a01b0380821660009081526020858152604091829020825180840190935280549093168252600190920154918101919091526144c490614842565b1581906144e557604051632d7d25f160e21b81526004016108ec9190615048565b506040516378eb06b360e11b81526001600160a01b0383169063f1d60d6690614512908490600401615048565b602060405180830381865afa15801561452f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061455391906154f8565b15819061457457604051632d7d25f160e21b81526004016108ec9190615048565b50505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b6145a6614fae565b6001600160a01b03808716600090815260208a8152604091829020825161012081018452815490941684526001810154918401919091526002810154918301919091526003810154606083015260048101546080830152600581015460a0830152600681015460c0830152600781015460e0830152600801546101008201526146329060600151151590565b15869061465357604051630bc4def560e01b81526004016108ec9190615048565b505060408051610120810182526001600160a01b0397881681526020808201968752818301958652426060830190815260006080840181815260a0850182815260c0860198895260e0860183815261010087019889529b8d1683529c90935293909320825181546001600160a01b0319169a169990991789559551600189015593516002880155516003870155925160048601559451600585015593516006840155905160078301555160089091015590565b600082821882841102821861186c565b600082841015801561333557505090911115919050565b61475b6040518060800160405280600081526020016000815260200160008152602001600080191681525090565b6000828152609b602090815260409182902082516080810184528154815260018201549281018390526002820154938101939093526003015460608301528390611c895760405163107349a960e21b81526004016108ec91815260200190565b6000808460030154116147e15760405163ddaf8f2160e01b815260040160405180910390fd5b60006147f485600001548563ffffffff16565b905061480785600001548463ffffffff16565b600185600301600082825461481c9190615845565b9091555050808555600385015460000361483857600060018601555b5050915492915050565b516001600160a01b0316151590565b8051156148615780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b6127108260030154106148a0576040516303a8c56b60e61b815260040160405180910390fd5b806148be57604051638f4a893d60e01b815260040160405180910390fd5b60018083018290556002830180546000906148da908490615ae9565b909155505060038201546000036148ef578082555b60018260030160008282546149049190615ae9565b90915550505050565b60006149198383613653565b604080516101208101825282546001600160a01b03168152600183015460208201526002830154918101919091526003820154606082015260048201546080820152600582015460a0820152600682015460c0820152600782015460e0820152600882015461010082015290915061499090612054565b600482015483916149b6576040516361b66e0d60e01b81526004016108ec929190615ad0565b5050426005909101555050565b60006149cf8383613653565b604080516101208101825282546001600160a01b03168152600183015460208201526002830154918101919091526003820154606082015260048201546080820152600582015460a0820152600682015460c0820152600782015460e08201526008820154610100820152909150614a4690612054565b60048201548391614a6c576040516361b66e0d60e01b81526004016108ec929190615ad0565b505060006007909101555050565b6000614a8983620f4240101590565b80614a9c5750614a9c82620f4240101590565b83839091614abf5760405163768bf0eb60e11b81526004016108ec929190615277565b50620f42409050614ad08385615ca1565b61186c9190615f81565b6000614ae4612f04565b54600160401b900460ff16919050565b818163ffffffff8082169083161115614b225760405163ccccdafb60e01b81526004016108ec929190615180565b508290508163ffffffff8116620f42401015614b535760405163ccccdafb60e01b81526004016108ec929190615180565b50506002805463ffffffff838116600160a01b0263ffffffff60a01b19918616600160801b0291909116600160801b600160c01b0319909216919091171790556040517f2fe5a7039987697813605cc0b9d6db7aab575408e3fc59e8a457bef8d7bc0a369061273a9084908490615180565b81816001600160401b038082169083161115614bf65760405163ccccdafb60e01b81526004016108ec92919061521c565b5050600280546001600160401b03838116600160401b026001600160801b0319909216908516171790556040517f2867e04c500e438761486b78021d4f9eb97c77ff45d10c1183f5583ba4cbf7d19061273a908490849061521c565b614c5a614370565b6000614c6461278d565b905060028101614c748482615742565b5060038101614c838382615742565b5060008082556001909101555050565b600061084b614cc7565b600080600080614cad8686614d3b565b925092509250614cbd8282614d88565b5090949350505050565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f614cf2614e41565b614cfa614ea8565b60408051602081019490945283019190915260608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b60008060008351604103614d755760208401516040850151606086015160001a614d6788828585614ee9565b955095509550505050614d81565b50508151600091506002905b9250925092565b6000826003811115614d9c57614d9c6158db565b03614da5575050565b6001826003811115614db957614db96158db565b03614dd75760405163f645eedf60e01b815260040160405180910390fd5b6002826003811115614deb57614deb6158db565b03614e0c5760405163fce698f760e01b8152600481018290526024016108ec565b6003826003811115614e2057614e206158db565b03610a8f576040516335e2f38360e21b8152600481018290526024016108ec565b600080614e4c61278d565b90506000614e586127b1565b805190915015614e7057805160209091012092915050565b81548015614e7f579392505050565b7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470935050505090565b600080614eb361278d565b90506000614ebf612852565b805190915015614ed757805160209091012092915050565b60018201548015614e7f579392505050565b600080806fa2a8918ca85bafe22016d0b997e4df60600160ff1b03841115614f1a5750600091506003905082614fa4565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa158015614f6e573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116614f9a57506000925060019150829050614fa4565b9250600091508190505b9450945094915050565b60405180610120016040528060006001600160a01b0316815260200160008019168152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b6001600160a01b038116811461084857600080fd5b803561502681615006565b919050565b60006020828403121561503d57600080fd5b813561186c81615006565b6001600160a01b0391909116815260200190565b63ffffffff8116811461084857600080fd5b60006020828403121561508057600080fd5b813561186c8161505c565b60008083601f84011261509d57600080fd5b5081356001600160401b038111156150b457600080fd5b6020830191508360208285010111156134be57600080fd5b6000806000604084860312156150e157600080fd5b83356150ec81615006565b925060208401356001600160401b0381111561510757600080fd5b6151138682870161508b565b9497909650939450505050565b801515811461084857600080fd5b6000806040838503121561514157600080fd5b823561514c81615006565b9150602083013561515c81615120565b809150509250929050565b60006020828403121561517957600080fd5b5035919050565b63ffffffff92831681529116602082015260400190565b60005b838110156151b257818101518382015260200161519a565b50506000910152565b600081518084526151d3816020860160208601615197565b601f01601f19169290920160200192915050565b83815260606020820152600061520060608301856151bb565b828103604084015261521281856151bb565b9695505050505050565b6001600160401b0392831681529116602082015260400190565b60008060006060848603121561524b57600080fd5b833561525681615006565b9250602084013561526681615006565b929592945050506040919091013590565b918252602082015260400190565b60ff60f81b8816815260e0602082015260006152a460e08301896151bb565b82810360408401526152b681896151bb565b606084018890526001600160a01b038716608085015260a0840186905283810360c08501528451808252602080870193509091019060005b8181101561530c5783518352602093840193909201916001016152ee565b50909b9a5050505050505050505050565b6000806020838503121561533057600080fd5b82356001600160401b0381111561534657600080fd5b8301601f8101851361535757600080fd5b80356001600160401b0381111561536d57600080fd5b8560208260051b840101111561538257600080fd5b6020919091019590945092505050565b6000602082016020835280845180835260408501915060408160051b86010192506020860160005b828110156153eb57603f198786030184526153d68583516151bb565b945060209384019391909101906001016153ba565b50929695505050505050565b6000806000806060858703121561540d57600080fd5b843561541881615006565b935060208501356003811061542c57600080fd5b925060408501356001600160401b0381111561544757600080fd5b6154538782880161508b565b95989497509550505050565b6000806000806080858703121561547557600080fd5b843561548081615006565b93506020850135925060408501356154978161505c565b9396929550929360600135925050565b600080604083850312156154ba57600080fd5b82356154c581615006565b9150602083013561515c81615006565b6001600160a01b0393841681529183166020830152909116604082015260600190565b60006020828403121561550a57600080fd5b815161186c81615120565b6001600160a01b0392831681529116602082015260400190565b634e487b7160e01b600052604160045260246000fd5b60405161014081016001600160401b03811182821017156155685761556861552f565b60405290565b604080519081016001600160401b03811182821017156155685761556861552f565b60405160e081016001600160401b03811182821017156155685761556861552f565b600082601f8301126155c357600080fd5b8135602083016000806001600160401b038411156155e3576155e361552f565b50604051601f19601f85018116603f011681018181106001600160401b03821117156156115761561161552f565b60405283815290508082840187101561562957600080fd5b838360208301376000602085830101528094505050505092915050565b60008060006060848603121561565b57600080fd5b83356001600160401b0381111561567157600080fd5b61567d868287016155b2565b93505060208401356001600160401b0381111561569957600080fd5b6156a5868287016155b2565b92505060408401356156b681615006565b809150509250925092565b600181811c908216806156d557607f821691505b6020821081036156f557634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115610d3c57806000526020600020601f840160051c810160208510156157225750805b601f840160051c820191505b8181101561306f576000815560010161572e565b81516001600160401b0381111561575b5761575b61552f565b61576f8161576984546156c1565b846156fb565b6020601f8211600181146157a3576000831561578b5750848201515b600019600385901b1c1916600184901b17845561306f565b600084815260208120601f198516915b828110156157d357878501518255602094850194600190920191016157b3565b50848210156157f15786840151600019600387901b60f8161c191681555b50505050600190811b01905550565b60208152816020820152818360408301376000818301604090810191909152601f909201601f19160101919050565b634e487b7160e01b600052601160045260246000fd5b818103818111156112b8576112b861582f565b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261588557600080fd5b8301803591506001600160401b0382111561589f57600080fd5b6020019150368190038213156134be57600080fd5b8284823760008382016000815283516158d1818360208801615197565b0195945050505050565b634e487b7160e01b600052602160045260246000fd5b6003811061590f57634e487b7160e01b600052602160045260246000fd5b9052565b602081016112b882846158f1565b6000806040838503121561593457600080fd5b50508035926020909101359150565b6000806000806080858703121561595957600080fd5b8435935060208501359250604085013561597281615006565b915060608501356001600160401b0381111561598d57600080fd5b615999878288016155b2565b91505092959194509250565b80516150268161505c565b6001600160401b038116811461084857600080fd5b8051615026816159b0565b60006101408284031280156159e457600080fd5b5060006159ef615545565b835181526020808501519082015260408085015190820152615a13606085016159a5565b6060820152615a24608085016159c5565b6080820152615a3560a085016159c5565b60a0820152615a4660c085016159a5565b60c0820152615a5760e085016159c5565b60e082015261010084810151908201526101209384015193810193909352509092915050565b600060208284031215615a8f57600080fd5b5051919050565b600060208284031215615aa857600080fd5b815161186c8161505c565b600060208284031215615ac557600080fd5b815161186c816159b0565b6001600160a01b03929092168252602082015260400190565b808201808211156112b8576112b861582f565b60008251615b0e818460208701615197565b9190910192915050565b8035615026816159b0565b80356001600160801b038116811461502657600080fd5b60008060408385031215615b4d57600080fd5b82356001600160401b03811115615b6357600080fd5b830160408186031215615b7557600080fd5b615b7d61556e565b81356001600160401b03811115615b9357600080fd5b820160e08188031215615ba557600080fd5b615bad615590565b81358152615bbd6020830161501b565b6020820152615bce6040830161501b565b6040820152615bdf6060830161501b565b6060820152615bf060808301615b18565b6080820152615c0160a08301615b23565b60a082015260c08201356001600160401b03811115615c1f57600080fd5b615c2b898285016155b2565b60c08301525082525060208201356001600160401b03811115615c4d57600080fd5b615c59878285016155b2565b60208381019190915291979590910135955050505050565b615c7b81856158f1565b606060208201526000615c9160608301856151bb565b9050826040830152949350505050565b80820281158282048414176112b8576112b861582f565b600080600060608486031215615ccd57600080fd5b8335615cd881615006565b92506020840135915060408401356001600160401b03811115615cfa57600080fd5b615d06868287016155b2565b9150509250925092565b608081526000615d2360808301876151bb565b6020830195909552506040810192909252606090910152919050565b60008060408385031215615d5257600080fd5b8251602084015190925061515c81615006565b600081615d7457615d7461582f565b506000190190565b600060018201615d8e57615d8e61582f565b5060010190565b6001600160a01b03938416815291909216602082015263ffffffff909116604082015260600190565b606080825284516040838301819052815160a085015260208201516001600160a01b0390811660c086015290820151811660e08501529181015190911661010083015260808101516001600160401b038116610120840152600091905060a08101516001600160801b0381166101408501525060c0015160e0610160840152615e4b6101808401826151bb565b90506020860151605f19848303016080850152615e6882826151bb565b9250505083602083015261333560408301846001600160a01b03169052565b6001600160a01b038481168252831660208201526060810161333560408301846158f1565b600060a0828403128015615ebf57600080fd5b5060405160009060a081016001600160401b0381118282101715615ee557615ee561552f565b6040908152845182526020808601519083015284810151908201526060808501519082015260809384015193810193909352509092915050565b6001600160a01b039384168152919092166020820152604081019190915260600190565b86815285602082015284604082015283606082015260c060808201526000615f6e60c08301856151bb565b90508260a0830152979650505050505050565b600082615f9e57634e487b7160e01b600052601260045260246000fd5b50049056fea2646970667358221220b85de947a2adf153b4d5d66360454c8d0624bca998d3fc8f12bd17e31d74127864736f6c634300081b0033", + "linkReferences": {}, + "deployedLinkReferences": {} +} \ No newline at end of file diff --git a/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/SubgraphServiceProxies#TransparentUpgradeableProxy_DisputeManager.json b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/SubgraphServiceProxies#TransparentUpgradeableProxy_DisputeManager.json new file mode 100644 index 000000000..700f93578 --- /dev/null +++ b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/SubgraphServiceProxies#TransparentUpgradeableProxy_DisputeManager.json @@ -0,0 +1,116 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "TransparentUpgradeableProxy", + "sourceName": "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "initialOwner", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + } + ], + "name": "AddressEmptyCode", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "admin", + "type": "address" + } + ], + "name": "ERC1967InvalidAdmin", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "ERC1967InvalidImplementation", + "type": "error" + }, + { + "inputs": [], + "name": "ERC1967NonPayable", + "type": "error" + }, + { + "inputs": [], + "name": "FailedCall", + "type": "error" + }, + { + "inputs": [], + "name": "ProxyDeniedAdminAccess", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + } + ], + "bytecode": "0x60a0604052604051610eae380380610eae8339810160408190526100229161039d565b828161002e828261008f565b50508160405161003d9061033a565b6001600160a01b039091168152602001604051809103906000f080158015610069573d6000803e3d6000fd5b506001600160a01b031660805261008761008260805190565b6100ee565b50505061048f565b6100988261015c565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a28051156100e2576100dd82826101db565b505050565b6100ea610252565b5050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61012e600080516020610e8e833981519152546001600160a01b031690565b604080516001600160a01b03928316815291841660208301520160405180910390a161015981610273565b50565b806001600160a01b03163b60000361019757604051634c9c8ce360e01b81526001600160a01b03821660048201526024015b60405180910390fd5b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5b80546001600160a01b0319166001600160a01b039290921691909117905550565b6060600080846001600160a01b0316846040516101f89190610473565b600060405180830381855af49150503d8060008114610233576040519150601f19603f3d011682016040523d82523d6000602084013e610238565b606091505b5090925090506102498583836102b2565b95945050505050565b34156102715760405163b398979f60e01b815260040160405180910390fd5b565b6001600160a01b03811661029d57604051633173bdd160e11b81526000600482015260240161018e565b80600080516020610e8e8339815191526101ba565b6060826102c7576102c282610311565b61030a565b81511580156102de57506001600160a01b0384163b155b1561030757604051639996b31560e01b81526001600160a01b038516600482015260240161018e565b50805b9392505050565b8051156103215780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b6105538061093b83390190565b80516001600160a01b038116811461035e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561039457818101518382015260200161037c565b50506000910152565b6000806000606084860312156103b257600080fd5b6103bb84610347565b92506103c960208501610347565b60408501519092506001600160401b038111156103e557600080fd5b8401601f810186136103f657600080fd5b80516001600160401b0381111561040f5761040f610363565b604051601f8201601f19908116603f011681016001600160401b038111828210171561043d5761043d610363565b60405281815282820160200188101561045557600080fd5b610466826020830160208601610379565b8093505050509250925092565b60008251610485818460208701610379565b9190910192915050565b6080516104926104a96000396000601001526104926000f3fe608060405261000c61000e565b005b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316330361007b576000356001600160e01b03191663278f794360e11b14610071576040516334ad5dbb60e21b815260040160405180910390fd5b610079610083565b565b6100796100b2565b6000806100933660048184610304565b8101906100a09190610344565b915091506100ae82826100c2565b5050565b6100796100bd61011d565b610155565b6100cb82610179565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a28051156101155761011082826101f0565b505050565b6100ae610266565b60006101507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b3660008037600080366000845af43d6000803e808015610174573d6000f35b3d6000fd5b806001600160a01b03163b6000036101af5780604051634c9c8ce360e01b81526004016101a69190610419565b60405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080846001600160a01b03168460405161020d919061042d565b600060405180830381855af49150503d8060008114610248576040519150601f19603f3d011682016040523d82523d6000602084013e61024d565b606091505b509150915061025d858383610285565b95945050505050565b34156100795760405163b398979f60e01b815260040160405180910390fd5b60608261029a57610295826102db565b6102d4565b81511580156102b157506001600160a01b0384163b155b156102d15783604051639996b31560e01b81526004016101a69190610419565b50805b9392505050565b8051156102eb5780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b6000808585111561031457600080fd5b8386111561032157600080fd5b5050820193919092039150565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561035757600080fd5b82356001600160a01b038116811461036e57600080fd5b915060208301356001600160401b0381111561038957600080fd5b8301601f8101851361039a57600080fd5b80356001600160401b038111156103b3576103b361032e565b604051601f8201601f19908116603f011681016001600160401b03811182821017156103e1576103e161032e565b6040528181528282016020018710156103f957600080fd5b816020840160208301376000602083830101528093505050509250929050565b6001600160a01b0391909116815260200190565b6000825160005b8181101561044e5760208186018101518583015201610434565b50600092019182525091905056fea2646970667358221220079092acd5c0b5783781c6719b8677b2804315edab5ec07af0a0f7a7a9b7803c64736f6c634300081b0033608060405234801561001057600080fd5b5060405161055338038061055383398101604081905261002f916100be565b806001600160a01b03811661005e57604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b6100678161006e565b50506100ee565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000602082840312156100d057600080fd5b81516001600160a01b03811681146100e757600080fd5b9392505050565b610456806100fd6000396000f3fe60806040526004361061004a5760003560e01c8063715018a61461004f5780638da5cb5b146100665780639623609d14610091578063ad3cb1cc146100a4578063f2fde38b146100e2575b600080fd5b34801561005b57600080fd5b50610064610102565b005b34801561007257600080fd5b5061007b610116565b604051610088919061025d565b60405180910390f35b61006461009f36600461029c565b610125565b3480156100b057600080fd5b506100d5604051806040016040528060058152602001640352e302e360dc1b81525081565b60405161008891906103bd565b3480156100ee57600080fd5b506100646100fd3660046103d7565b610194565b61010a6101db565b610114600061020d565b565b6000546001600160a01b031690565b61012d6101db565b60405163278f794360e11b81526001600160a01b03841690634f1ef28690349061015d90869086906004016103f4565b6000604051808303818588803b15801561017657600080fd5b505af115801561018a573d6000803e3d6000fd5b5050505050505050565b61019c6101db565b6001600160a01b0381166101cf576000604051631e4fbdf760e01b81526004016101c6919061025d565b60405180910390fd5b6101d88161020d565b50565b336101e4610116565b6001600160a01b031614610114573360405163118cdaa760e01b81526004016101c6919061025d565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b0391909116815260200190565b6001600160a01b03811681146101d857600080fd5b634e487b7160e01b600052604160045260246000fd5b6000806000606084860312156102b157600080fd5b83356102bc81610271565b925060208401356102cc81610271565b915060408401356001600160401b038111156102e757600080fd5b8401601f810186136102f857600080fd5b80356001600160401b0381111561031157610311610286565b604051601f8201601f19908116603f011681016001600160401b038111828210171561033f5761033f610286565b60405281815282820160200188101561035757600080fd5b816020840160208301376000602083830101528093505050509250925092565b6000815180845260005b8181101561039d57602081850181015186830182015201610381565b506000602082860101526020601f19601f83011685010191505092915050565b6020815260006103d06020830184610377565b9392505050565b6000602082840312156103e957600080fd5b81356103d081610271565b6001600160a01b038316815260406020820181905260009061041890830184610377565b94935050505056fea2646970667358221220e77af71a19651e50da550702ce9a5b1b89dda100ca5f41a9c778b943df55af8064736f6c634300081b0033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103", + "deployedBytecode": "0x608060405261000c61000e565b005b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316330361007b576000356001600160e01b03191663278f794360e11b14610071576040516334ad5dbb60e21b815260040160405180910390fd5b610079610083565b565b6100796100b2565b6000806100933660048184610304565b8101906100a09190610344565b915091506100ae82826100c2565b5050565b6100796100bd61011d565b610155565b6100cb82610179565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a28051156101155761011082826101f0565b505050565b6100ae610266565b60006101507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b3660008037600080366000845af43d6000803e808015610174573d6000f35b3d6000fd5b806001600160a01b03163b6000036101af5780604051634c9c8ce360e01b81526004016101a69190610419565b60405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080846001600160a01b03168460405161020d919061042d565b600060405180830381855af49150503d8060008114610248576040519150601f19603f3d011682016040523d82523d6000602084013e61024d565b606091505b509150915061025d858383610285565b95945050505050565b34156100795760405163b398979f60e01b815260040160405180910390fd5b60608261029a57610295826102db565b6102d4565b81511580156102b157506001600160a01b0384163b155b156102d15783604051639996b31560e01b81526004016101a69190610419565b50805b9392505050565b8051156102eb5780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b6000808585111561031457600080fd5b8386111561032157600080fd5b5050820193919092039150565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561035757600080fd5b82356001600160a01b038116811461036e57600080fd5b915060208301356001600160401b0381111561038957600080fd5b8301601f8101851361039a57600080fd5b80356001600160401b038111156103b3576103b361032e565b604051601f8201601f19908116603f011681016001600160401b03811182821017156103e1576103e161032e565b6040528181528282016020018710156103f957600080fd5b816020840160208301376000602083830101528093505050509250929050565b6001600160a01b0391909116815260200190565b6000825160005b8181101561044e5760208186018101518583015201610434565b50600092019182525091905056fea2646970667358221220079092acd5c0b5783781c6719b8677b2804315edab5ec07af0a0f7a7a9b7803c64736f6c634300081b0033", + "linkReferences": {}, + "deployedLinkReferences": {} +} \ No newline at end of file diff --git a/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/SubgraphServiceProxies#TransparentUpgradeableProxy_SubgraphService.json b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/SubgraphServiceProxies#TransparentUpgradeableProxy_SubgraphService.json new file mode 100644 index 000000000..700f93578 --- /dev/null +++ b/packages/subgraph-service/ignition/deployments/chain-421614/artifacts/SubgraphServiceProxies#TransparentUpgradeableProxy_SubgraphService.json @@ -0,0 +1,116 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "TransparentUpgradeableProxy", + "sourceName": "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "initialOwner", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + } + ], + "name": "AddressEmptyCode", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "admin", + "type": "address" + } + ], + "name": "ERC1967InvalidAdmin", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "ERC1967InvalidImplementation", + "type": "error" + }, + { + "inputs": [], + "name": "ERC1967NonPayable", + "type": "error" + }, + { + "inputs": [], + "name": "FailedCall", + "type": "error" + }, + { + "inputs": [], + "name": "ProxyDeniedAdminAccess", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + } + ], + "bytecode": "0x60a0604052604051610eae380380610eae8339810160408190526100229161039d565b828161002e828261008f565b50508160405161003d9061033a565b6001600160a01b039091168152602001604051809103906000f080158015610069573d6000803e3d6000fd5b506001600160a01b031660805261008761008260805190565b6100ee565b50505061048f565b6100988261015c565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a28051156100e2576100dd82826101db565b505050565b6100ea610252565b5050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61012e600080516020610e8e833981519152546001600160a01b031690565b604080516001600160a01b03928316815291841660208301520160405180910390a161015981610273565b50565b806001600160a01b03163b60000361019757604051634c9c8ce360e01b81526001600160a01b03821660048201526024015b60405180910390fd5b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5b80546001600160a01b0319166001600160a01b039290921691909117905550565b6060600080846001600160a01b0316846040516101f89190610473565b600060405180830381855af49150503d8060008114610233576040519150601f19603f3d011682016040523d82523d6000602084013e610238565b606091505b5090925090506102498583836102b2565b95945050505050565b34156102715760405163b398979f60e01b815260040160405180910390fd5b565b6001600160a01b03811661029d57604051633173bdd160e11b81526000600482015260240161018e565b80600080516020610e8e8339815191526101ba565b6060826102c7576102c282610311565b61030a565b81511580156102de57506001600160a01b0384163b155b1561030757604051639996b31560e01b81526001600160a01b038516600482015260240161018e565b50805b9392505050565b8051156103215780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b6105538061093b83390190565b80516001600160a01b038116811461035e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561039457818101518382015260200161037c565b50506000910152565b6000806000606084860312156103b257600080fd5b6103bb84610347565b92506103c960208501610347565b60408501519092506001600160401b038111156103e557600080fd5b8401601f810186136103f657600080fd5b80516001600160401b0381111561040f5761040f610363565b604051601f8201601f19908116603f011681016001600160401b038111828210171561043d5761043d610363565b60405281815282820160200188101561045557600080fd5b610466826020830160208601610379565b8093505050509250925092565b60008251610485818460208701610379565b9190910192915050565b6080516104926104a96000396000601001526104926000f3fe608060405261000c61000e565b005b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316330361007b576000356001600160e01b03191663278f794360e11b14610071576040516334ad5dbb60e21b815260040160405180910390fd5b610079610083565b565b6100796100b2565b6000806100933660048184610304565b8101906100a09190610344565b915091506100ae82826100c2565b5050565b6100796100bd61011d565b610155565b6100cb82610179565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a28051156101155761011082826101f0565b505050565b6100ae610266565b60006101507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b3660008037600080366000845af43d6000803e808015610174573d6000f35b3d6000fd5b806001600160a01b03163b6000036101af5780604051634c9c8ce360e01b81526004016101a69190610419565b60405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080846001600160a01b03168460405161020d919061042d565b600060405180830381855af49150503d8060008114610248576040519150601f19603f3d011682016040523d82523d6000602084013e61024d565b606091505b509150915061025d858383610285565b95945050505050565b34156100795760405163b398979f60e01b815260040160405180910390fd5b60608261029a57610295826102db565b6102d4565b81511580156102b157506001600160a01b0384163b155b156102d15783604051639996b31560e01b81526004016101a69190610419565b50805b9392505050565b8051156102eb5780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b6000808585111561031457600080fd5b8386111561032157600080fd5b5050820193919092039150565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561035757600080fd5b82356001600160a01b038116811461036e57600080fd5b915060208301356001600160401b0381111561038957600080fd5b8301601f8101851361039a57600080fd5b80356001600160401b038111156103b3576103b361032e565b604051601f8201601f19908116603f011681016001600160401b03811182821017156103e1576103e161032e565b6040528181528282016020018710156103f957600080fd5b816020840160208301376000602083830101528093505050509250929050565b6001600160a01b0391909116815260200190565b6000825160005b8181101561044e5760208186018101518583015201610434565b50600092019182525091905056fea2646970667358221220079092acd5c0b5783781c6719b8677b2804315edab5ec07af0a0f7a7a9b7803c64736f6c634300081b0033608060405234801561001057600080fd5b5060405161055338038061055383398101604081905261002f916100be565b806001600160a01b03811661005e57604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b6100678161006e565b50506100ee565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000602082840312156100d057600080fd5b81516001600160a01b03811681146100e757600080fd5b9392505050565b610456806100fd6000396000f3fe60806040526004361061004a5760003560e01c8063715018a61461004f5780638da5cb5b146100665780639623609d14610091578063ad3cb1cc146100a4578063f2fde38b146100e2575b600080fd5b34801561005b57600080fd5b50610064610102565b005b34801561007257600080fd5b5061007b610116565b604051610088919061025d565b60405180910390f35b61006461009f36600461029c565b610125565b3480156100b057600080fd5b506100d5604051806040016040528060058152602001640352e302e360dc1b81525081565b60405161008891906103bd565b3480156100ee57600080fd5b506100646100fd3660046103d7565b610194565b61010a6101db565b610114600061020d565b565b6000546001600160a01b031690565b61012d6101db565b60405163278f794360e11b81526001600160a01b03841690634f1ef28690349061015d90869086906004016103f4565b6000604051808303818588803b15801561017657600080fd5b505af115801561018a573d6000803e3d6000fd5b5050505050505050565b61019c6101db565b6001600160a01b0381166101cf576000604051631e4fbdf760e01b81526004016101c6919061025d565b60405180910390fd5b6101d88161020d565b50565b336101e4610116565b6001600160a01b031614610114573360405163118cdaa760e01b81526004016101c6919061025d565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b0391909116815260200190565b6001600160a01b03811681146101d857600080fd5b634e487b7160e01b600052604160045260246000fd5b6000806000606084860312156102b157600080fd5b83356102bc81610271565b925060208401356102cc81610271565b915060408401356001600160401b038111156102e757600080fd5b8401601f810186136102f857600080fd5b80356001600160401b0381111561031157610311610286565b604051601f8201601f19908116603f011681016001600160401b038111828210171561033f5761033f610286565b60405281815282820160200188101561035757600080fd5b816020840160208301376000602083830101528093505050509250925092565b6000815180845260005b8181101561039d57602081850181015186830182015201610381565b506000602082860101526020601f19601f83011685010191505092915050565b6020815260006103d06020830184610377565b9392505050565b6000602082840312156103e957600080fd5b81356103d081610271565b6001600160a01b038316815260406020820181905260009061041890830184610377565b94935050505056fea2646970667358221220e77af71a19651e50da550702ce9a5b1b89dda100ca5f41a9c778b943df55af8064736f6c634300081b0033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103", + "deployedBytecode": "0x608060405261000c61000e565b005b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316330361007b576000356001600160e01b03191663278f794360e11b14610071576040516334ad5dbb60e21b815260040160405180910390fd5b610079610083565b565b6100796100b2565b6000806100933660048184610304565b8101906100a09190610344565b915091506100ae82826100c2565b5050565b6100796100bd61011d565b610155565b6100cb82610179565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a28051156101155761011082826101f0565b505050565b6100ae610266565b60006101507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b3660008037600080366000845af43d6000803e808015610174573d6000f35b3d6000fd5b806001600160a01b03163b6000036101af5780604051634c9c8ce360e01b81526004016101a69190610419565b60405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080846001600160a01b03168460405161020d919061042d565b600060405180830381855af49150503d8060008114610248576040519150601f19603f3d011682016040523d82523d6000602084013e61024d565b606091505b509150915061025d858383610285565b95945050505050565b34156100795760405163b398979f60e01b815260040160405180910390fd5b60608261029a57610295826102db565b6102d4565b81511580156102b157506001600160a01b0384163b155b156102d15783604051639996b31560e01b81526004016101a69190610419565b50805b9392505050565b8051156102eb5780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b6000808585111561031457600080fd5b8386111561032157600080fd5b5050820193919092039150565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561035757600080fd5b82356001600160a01b038116811461036e57600080fd5b915060208301356001600160401b0381111561038957600080fd5b8301601f8101851361039a57600080fd5b80356001600160401b038111156103b3576103b361032e565b604051601f8201601f19908116603f011681016001600160401b03811182821017156103e1576103e161032e565b6040528181528282016020018710156103f957600080fd5b816020840160208301376000602083830101528093505050509250929050565b6001600160a01b0391909116815260200190565b6000825160005b8181101561044e5760208186018101518583015201610434565b50600092019182525091905056fea2646970667358221220079092acd5c0b5783781c6719b8677b2804315edab5ec07af0a0f7a7a9b7803c64736f6c634300081b0033", + "linkReferences": {}, + "deployedLinkReferences": {} +} \ No newline at end of file diff --git a/packages/subgraph-service/ignition/deployments/chain-421614/build-info/81754efc7e2eec76b7d493cc60c0f970.json b/packages/subgraph-service/ignition/deployments/chain-421614/build-info/81754efc7e2eec76b7d493cc60c0f970.json new file mode 100644 index 000000000..03954694c --- /dev/null +++ b/packages/subgraph-service/ignition/deployments/chain-421614/build-info/81754efc7e2eec76b7d493cc60c0f970.json @@ -0,0 +1,315165 @@ +{ + "id": "81754efc7e2eec76b7d493cc60c0f970", + "_format": "hh-sol-build-info-1", + "solcVersion": "0.8.27", + "solcLongVersion": "0.8.27+commit.40a35a09", + "input": { + "language": "Solidity", + "sources": { + "@graphprotocol/contracts/contracts/arbitrum/ITokenGateway.sol": { + "content": "// SPDX-License-Identifier: Apache-2.0\n\n/*\n * Copyright 2020, Offchain Labs, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * Originally copied from:\n * https://github.com/OffchainLabs/arbitrum/tree/e3a6307ad8a2dc2cad35728a2a9908cfd8dd8ef9/packages/arb-bridge-peripherals\n *\n * MODIFIED from Offchain Labs' implementation:\n * - Changed solidity version to 0.7.6 (pablo@edgeandnode.com)\n *\n */\n\npragma solidity ^0.7.6 || 0.8.27;\n\ninterface ITokenGateway {\n /// @notice event deprecated in favor of DepositInitiated and WithdrawalInitiated\n // event OutboundTransferInitiated(\n // address token,\n // address indexed _from,\n // address indexed _to,\n // uint256 indexed _transferId,\n // uint256 _amount,\n // bytes _data\n // );\n\n /// @notice event deprecated in favor of DepositFinalized and WithdrawalFinalized\n // event InboundTransferFinalized(\n // address token,\n // address indexed _from,\n // address indexed _to,\n // uint256 indexed _transferId,\n // uint256 _amount,\n // bytes _data\n // );\n\n function outboundTransfer(\n address token,\n address to,\n uint256 amunt,\n uint256 maxas,\n uint256 gasPiceBid,\n bytes calldata data\n ) external payable returns (bytes memory);\n\n function finalizeInboundTransfer(\n address token,\n address from,\n address to,\n uint256 amount,\n bytes calldata data\n ) external payable;\n\n /**\n * @notice Calculate the address used when bridging an ERC20 token\n * @dev the L1 and L2 address oracles may not always be in sync.\n * For example, a custom token may have been registered but not deployed or the contract self destructed.\n * @param l1ERC20 address of L1 token\n * @return L2 address of a bridged ERC20 token\n */\n function calculateL2TokenAddress(address l1ERC20) external view returns (address);\n}\n" + }, + "@graphprotocol/contracts/contracts/curation/ICuration.sol": { + "content": "// SPDX-License-Identifier: GPL-2.0-or-later\n\npragma solidity ^0.7.6 || 0.8.27;\n\n/**\n * @title Curation Interface\n * @dev Interface for the Curation contract (and L2Curation too)\n */\ninterface ICuration {\n // -- Configuration --\n\n /**\n * @notice Update the default reserve ratio to `_defaultReserveRatio`\n * @param _defaultReserveRatio Reserve ratio (in PPM)\n */\n function setDefaultReserveRatio(uint32 _defaultReserveRatio) external;\n\n /**\n * @notice Update the minimum deposit amount needed to intialize a new subgraph\n * @param _minimumCurationDeposit Minimum amount of tokens required deposit\n */\n function setMinimumCurationDeposit(uint256 _minimumCurationDeposit) external;\n\n /**\n * @notice Set the curation tax percentage to charge when a curator deposits GRT tokens.\n * @param _percentage Curation tax percentage charged when depositing GRT tokens\n */\n function setCurationTaxPercentage(uint32 _percentage) external;\n\n /**\n * @notice Set the master copy to use as clones for the curation token.\n * @param _curationTokenMaster Address of implementation contract to use for curation tokens\n */\n function setCurationTokenMaster(address _curationTokenMaster) external;\n\n // -- Curation --\n\n /**\n * @notice Deposit Graph Tokens in exchange for signal of a SubgraphDeployment curation pool.\n * @param _subgraphDeploymentID Subgraph deployment pool from where to mint signal\n * @param _tokensIn Amount of Graph Tokens to deposit\n * @param _signalOutMin Expected minimum amount of signal to receive\n * @return Amount of signal minted\n * @return Amount of curation tax burned\n */\n function mint(\n bytes32 _subgraphDeploymentID,\n uint256 _tokensIn,\n uint256 _signalOutMin\n ) external returns (uint256, uint256);\n\n /**\n * @notice Burn _signal from the SubgraphDeployment curation pool\n * @param _subgraphDeploymentID SubgraphDeployment the curator is returning signal\n * @param _signalIn Amount of signal to return\n * @param _tokensOutMin Expected minimum amount of tokens to receive\n * @return Tokens returned\n */\n function burn(bytes32 _subgraphDeploymentID, uint256 _signalIn, uint256 _tokensOutMin) external returns (uint256);\n\n /**\n * @notice Assign Graph Tokens collected as curation fees to the curation pool reserve.\n * @param _subgraphDeploymentID SubgraphDeployment where funds should be allocated as reserves\n * @param _tokens Amount of Graph Tokens to add to reserves\n */\n function collect(bytes32 _subgraphDeploymentID, uint256 _tokens) external;\n\n // -- Getters --\n\n /**\n * @notice Check if any GRT tokens are deposited for a SubgraphDeployment.\n * @param _subgraphDeploymentID SubgraphDeployment to check if curated\n * @return True if curated, false otherwise\n */\n function isCurated(bytes32 _subgraphDeploymentID) external view returns (bool);\n\n /**\n * @notice Get the amount of signal a curator has in a curation pool.\n * @param _curator Curator owning the signal tokens\n * @param _subgraphDeploymentID Subgraph deployment curation pool\n * @return Amount of signal owned by a curator for the subgraph deployment\n */\n function getCuratorSignal(address _curator, bytes32 _subgraphDeploymentID) external view returns (uint256);\n\n /**\n * @notice Get the amount of signal in a curation pool.\n * @param _subgraphDeploymentID Subgraph deployment curation pool\n * @return Amount of signal minted for the subgraph deployment\n */\n function getCurationPoolSignal(bytes32 _subgraphDeploymentID) external view returns (uint256);\n\n /**\n * @notice Get the amount of token reserves in a curation pool.\n * @param _subgraphDeploymentID Subgraph deployment curation pool\n * @return Amount of token reserves in the curation pool\n */\n function getCurationPoolTokens(bytes32 _subgraphDeploymentID) external view returns (uint256);\n\n /**\n * @notice Calculate amount of signal that can be bought with tokens in a curation pool.\n * This function considers and excludes the deposit tax.\n * @param _subgraphDeploymentID Subgraph deployment to mint signal\n * @param _tokensIn Amount of tokens used to mint signal\n * @return Amount of signal that can be bought\n * @return Amount of tokens that will be burned as curation tax\n */\n function tokensToSignal(bytes32 _subgraphDeploymentID, uint256 _tokensIn) external view returns (uint256, uint256);\n\n /**\n * @notice Calculate number of tokens to get when burning signal from a curation pool.\n * @param _subgraphDeploymentID Subgraph deployment to burn signal\n * @param _signalIn Amount of signal to burn\n * @return Amount of tokens to get for the specified amount of signal\n */\n function signalToTokens(bytes32 _subgraphDeploymentID, uint256 _signalIn) external view returns (uint256);\n\n /**\n * @notice Tax charged when curators deposit funds.\n * Parts per million. (Allows for 4 decimal points, 999,999 = 99.9999%)\n * @return Curation tax percentage expressed in PPM\n */\n function curationTaxPercentage() external view returns (uint32);\n}\n" + }, + "@graphprotocol/contracts/contracts/disputes/IDisputeManager.sol": { + "content": "// SPDX-License-Identifier: GPL-2.0-or-later\n\npragma solidity >=0.6.12 <0.8.0 || 0.8.27;\npragma abicoder v2;\n\ninterface IDisputeManager {\n // -- Dispute --\n\n enum DisputeType {\n Null,\n IndexingDispute,\n QueryDispute\n }\n\n enum DisputeStatus {\n Null,\n Accepted,\n Rejected,\n Drawn,\n Pending\n }\n\n // Disputes contain info necessary for the Arbitrator to verify and resolve\n struct Dispute {\n address indexer;\n address fisherman;\n uint256 deposit;\n bytes32 relatedDisputeID;\n DisputeType disputeType;\n DisputeStatus status;\n }\n\n // -- Attestation --\n\n // Receipt content sent from indexer in response to request\n struct Receipt {\n bytes32 requestCID;\n bytes32 responseCID;\n bytes32 subgraphDeploymentID;\n }\n\n // Attestation sent from indexer in response to a request\n struct Attestation {\n bytes32 requestCID;\n bytes32 responseCID;\n bytes32 subgraphDeploymentID;\n bytes32 r;\n bytes32 s;\n uint8 v;\n }\n\n // -- Configuration --\n\n function setArbitrator(address _arbitrator) external;\n\n function setMinimumDeposit(uint256 _minimumDeposit) external;\n\n function setFishermanRewardPercentage(uint32 _percentage) external;\n\n function setSlashingPercentage(uint32 _qryPercentage, uint32 _idxPercentage) external;\n\n // -- Getters --\n\n function isDisputeCreated(bytes32 _disputeID) external view returns (bool);\n\n function encodeHashReceipt(Receipt memory _receipt) external view returns (bytes32);\n\n function areConflictingAttestations(\n Attestation memory _attestation1,\n Attestation memory _attestation2\n ) external pure returns (bool);\n\n function getAttestationIndexer(Attestation memory _attestation) external view returns (address);\n\n // -- Dispute --\n\n function createQueryDispute(bytes calldata _attestationData, uint256 _deposit) external returns (bytes32);\n\n function createQueryDisputeConflict(\n bytes calldata _attestationData1,\n bytes calldata _attestationData2\n ) external returns (bytes32, bytes32);\n\n function createIndexingDispute(address _allocationID, uint256 _deposit) external returns (bytes32);\n\n function acceptDispute(bytes32 _disputeID) external;\n\n function rejectDispute(bytes32 _disputeID) external;\n\n function drawDispute(bytes32 _disputeID) external;\n}\n" + }, + "@graphprotocol/contracts/contracts/epochs/IEpochManager.sol": { + "content": "// SPDX-License-Identifier: GPL-2.0-or-later\n\npragma solidity ^0.7.6 || 0.8.27;\n\ninterface IEpochManager {\n // -- Configuration --\n\n function setEpochLength(uint256 _epochLength) external;\n\n // -- Epochs\n\n function runEpoch() external;\n\n // -- Getters --\n\n function isCurrentEpochRun() external view returns (bool);\n\n function blockNum() external view returns (uint256);\n\n function blockHash(uint256 _block) external view returns (bytes32);\n\n function currentEpoch() external view returns (uint256);\n\n function currentEpochBlock() external view returns (uint256);\n\n function currentEpochBlockSinceStart() external view returns (uint256);\n\n function epochsSince(uint256 _epoch) external view returns (uint256);\n\n function epochsSinceUpdate() external view returns (uint256);\n}\n" + }, + "@graphprotocol/contracts/contracts/gateway/ICallhookReceiver.sol": { + "content": "// SPDX-License-Identifier: GPL-2.0-or-later\n\n/**\n * @title Interface for contracts that can receive callhooks through the Arbitrum GRT bridge\n * @dev Any contract that can receive a callhook on L2, sent through the bridge from L1, must\n * be allowlisted by the governor, but also implement this interface that contains\n * the function that will actually be called by the L2GraphTokenGateway.\n */\npragma solidity ^0.7.6 || 0.8.27;\n\ninterface ICallhookReceiver {\n /**\n * @notice Receive tokens with a callhook from the bridge\n * @param _from Token sender in L1\n * @param _amount Amount of tokens that were transferred\n * @param _data ABI-encoded callhook data\n */\n function onTokenTransfer(address _from, uint256 _amount, bytes calldata _data) external;\n}\n" + }, + "@graphprotocol/contracts/contracts/governance/IController.sol": { + "content": "// SPDX-License-Identifier: GPL-2.0-or-later\n\npragma solidity ^0.7.6 || 0.8.27;\n\ninterface IController {\n function getGovernor() external view returns (address);\n\n // -- Registry --\n\n function setContractProxy(bytes32 _id, address _contractAddress) external;\n\n function unsetContractProxy(bytes32 _id) external;\n\n function updateController(bytes32 _id, address _controller) external;\n\n function getContractProxy(bytes32 _id) external view returns (address);\n\n // -- Pausing --\n\n function setPartialPaused(bool _partialPaused) external;\n\n function setPaused(bool _paused) external;\n\n function setPauseGuardian(address _newPauseGuardian) external;\n\n function paused() external view returns (bool);\n\n function partialPaused() external view returns (bool);\n}\n" + }, + "@graphprotocol/contracts/contracts/l2/curation/IL2Curation.sol": { + "content": "// SPDX-License-Identifier: GPL-2.0-or-later\n\npragma solidity ^0.7.6 || 0.8.27;\n\n/**\n * @title Interface of the L2 Curation contract.\n */\ninterface IL2Curation {\n /**\n * @notice Set the subgraph service address.\n * @param _subgraphService Address of the SubgraphService contract\n */\n function setSubgraphService(address _subgraphService) external;\n\n /**\n * @notice Deposit Graph Tokens in exchange for signal of a SubgraphDeployment curation pool.\n * @dev This function charges no tax and can only be called by GNS in specific scenarios (for now\n * only during an L1-L2 transfer).\n * @param _subgraphDeploymentID Subgraph deployment pool from where to mint signal\n * @param _tokensIn Amount of Graph Tokens to deposit\n * @return Signal minted\n */\n function mintTaxFree(bytes32 _subgraphDeploymentID, uint256 _tokensIn) external returns (uint256);\n\n /**\n * @notice Calculate amount of signal that can be bought with tokens in a curation pool,\n * without accounting for curation tax.\n * @param _subgraphDeploymentID Subgraph deployment for which to mint signal\n * @param _tokensIn Amount of tokens used to mint signal\n * @return Amount of signal that can be bought\n */\n function tokensToSignalNoTax(bytes32 _subgraphDeploymentID, uint256 _tokensIn) external view returns (uint256);\n\n /**\n * @notice Calculate the amount of tokens that would be recovered if minting signal with\n * the input tokens and then burning it. This can be used to compute rounding error.\n * This function does not account for curation tax.\n * @param _subgraphDeploymentID Subgraph deployment for which to mint signal\n * @param _tokensIn Amount of tokens used to mint signal\n * @return Amount of tokens that would be recovered after minting and burning signal\n */\n function tokensToSignalToTokensNoTax(\n bytes32 _subgraphDeploymentID,\n uint256 _tokensIn\n ) external view returns (uint256);\n}\n" + }, + "@graphprotocol/contracts/contracts/l2/discovery/IL2GNS.sol": { + "content": "// SPDX-License-Identifier: GPL-2.0-or-later\n\npragma solidity ^0.7.6 || 0.8.27;\n\nimport { ICallhookReceiver } from \"../../gateway/ICallhookReceiver.sol\";\n\n/**\n * @title Interface for the L2GNS contract.\n */\ninterface IL2GNS is ICallhookReceiver {\n enum L1MessageCodes {\n RECEIVE_SUBGRAPH_CODE,\n RECEIVE_CURATOR_BALANCE_CODE\n }\n\n /**\n * @dev The SubgraphL2TransferData struct holds information\n * about a subgraph related to its transfer from L1 to L2.\n */\n struct SubgraphL2TransferData {\n uint256 tokens; // GRT that will be sent to L2 to mint signal\n mapping(address => bool) curatorBalanceClaimed; // True for curators whose balance has been claimed in L2\n bool l2Done; // Transfer finished on L2 side\n uint256 subgraphReceivedOnL2BlockNumber; // Block number when the subgraph was received on L2\n }\n\n /**\n * @notice Finish a subgraph transfer from L1.\n * The subgraph must have been previously sent through the bridge\n * using the sendSubgraphToL2 function on L1GNS.\n * @param _l2SubgraphID Subgraph ID in L2 (aliased from the L1 subgraph ID)\n * @param _subgraphDeploymentID Latest subgraph deployment to assign to the subgraph\n * @param _subgraphMetadata IPFS hash of the subgraph metadata\n * @param _versionMetadata IPFS hash of the version metadata\n */\n function finishSubgraphTransferFromL1(\n uint256 _l2SubgraphID,\n bytes32 _subgraphDeploymentID,\n bytes32 _subgraphMetadata,\n bytes32 _versionMetadata\n ) external;\n\n /**\n * @notice Return the aliased L2 subgraph ID from a transferred L1 subgraph ID\n * @param _l1SubgraphID L1 subgraph ID\n * @return L2 subgraph ID\n */\n function getAliasedL2SubgraphID(uint256 _l1SubgraphID) external pure returns (uint256);\n\n /**\n * @notice Return the unaliased L1 subgraph ID from a transferred L2 subgraph ID\n * @param _l2SubgraphID L2 subgraph ID\n * @return L1subgraph ID\n */\n function getUnaliasedL1SubgraphID(uint256 _l2SubgraphID) external pure returns (uint256);\n}\n" + }, + "@graphprotocol/contracts/contracts/rewards/IRewardsIssuer.sol": { + "content": "// SPDX-License-Identifier: GPL-2.0-or-later\n\npragma solidity ^0.7.6 || 0.8.27;\n\ninterface IRewardsIssuer {\n /**\n * @dev Get allocation data to calculate rewards issuance\n * \n * @param allocationId The allocation Id\n * @return isActive Whether the allocation is active or not\n * @return indexer The indexer address\n * @return subgraphDeploymentId Subgraph deployment id for the allocation\n * @return tokens Amount of allocated tokens\n * @return accRewardsPerAllocatedToken Rewards snapshot\n * @return accRewardsPending Snapshot of accumulated rewards from previous allocation resizing, pending to be claimed\n */\n function getAllocationData(\n address allocationId\n )\n external\n view\n returns (\n bool isActive,\n address indexer,\n bytes32 subgraphDeploymentId,\n uint256 tokens,\n uint256 accRewardsPerAllocatedToken,\n uint256 accRewardsPending\n );\n\n /**\n * @notice Return the total amount of tokens allocated to subgraph.\n * @param _subgraphDeploymentId Deployment Id for the subgraph\n * @return Total tokens allocated to subgraph\n */\n function getSubgraphAllocatedTokens(bytes32 _subgraphDeploymentId) external view returns (uint256);\n}\n" + }, + "@graphprotocol/contracts/contracts/rewards/IRewardsManager.sol": { + "content": "// SPDX-License-Identifier: GPL-2.0-or-later\n\npragma solidity ^0.7.6 || 0.8.27;\n\ninterface IRewardsManager {\n /**\n * @dev Stores accumulated rewards and snapshots related to a particular SubgraphDeployment.\n */\n struct Subgraph {\n uint256 accRewardsForSubgraph;\n uint256 accRewardsForSubgraphSnapshot;\n uint256 accRewardsPerSignalSnapshot;\n uint256 accRewardsPerAllocatedToken;\n }\n\n // -- Config --\n\n function setIssuancePerBlock(uint256 _issuancePerBlock) external;\n\n function setMinimumSubgraphSignal(uint256 _minimumSubgraphSignal) external;\n\n function setSubgraphService(address _subgraphService) external;\n\n // -- Denylist --\n\n function setSubgraphAvailabilityOracle(address _subgraphAvailabilityOracle) external;\n\n function setDenied(bytes32 _subgraphDeploymentID, bool _deny) external;\n\n function isDenied(bytes32 _subgraphDeploymentID) external view returns (bool);\n\n // -- Getters --\n\n function getNewRewardsPerSignal() external view returns (uint256);\n\n function getAccRewardsPerSignal() external view returns (uint256);\n\n function getAccRewardsForSubgraph(bytes32 _subgraphDeploymentID) external view returns (uint256);\n\n function getAccRewardsPerAllocatedToken(bytes32 _subgraphDeploymentID) external view returns (uint256, uint256);\n\n function getRewards(address _rewardsIssuer, address _allocationID) external view returns (uint256);\n\n function calcRewards(uint256 _tokens, uint256 _accRewardsPerAllocatedToken) external pure returns (uint256);\n\n // -- Updates --\n\n function updateAccRewardsPerSignal() external returns (uint256);\n\n function takeRewards(address _allocationID) external returns (uint256);\n\n // -- Hooks --\n\n function onSubgraphSignalUpdate(bytes32 _subgraphDeploymentID) external returns (uint256);\n\n function onSubgraphAllocationUpdate(bytes32 _subgraphDeploymentID) external returns (uint256);\n}\n" + }, + "@graphprotocol/contracts/contracts/token/IGraphToken.sol": { + "content": "// SPDX-License-Identifier: GPL-2.0-or-later\n\npragma solidity ^0.7.6 || 0.8.27;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\ninterface IGraphToken is IERC20 {\n // -- Mint and Burn --\n\n function burn(uint256 amount) external;\n\n function burnFrom(address _from, uint256 amount) external;\n\n function mint(address _to, uint256 _amount) external;\n\n // -- Mint Admin --\n\n function addMinter(address _account) external;\n\n function removeMinter(address _account) external;\n\n function renounceMinter() external;\n\n function isMinter(address _account) external view returns (bool);\n\n // -- Permit --\n\n function permit(\n address _owner,\n address _spender,\n uint256 _value,\n uint256 _deadline,\n uint8 _v,\n bytes32 _r,\n bytes32 _s\n ) external;\n\n // -- Allowance --\n\n function increaseAllowance(address spender, uint256 addedValue) external returns (bool);\n\n function decreaseAllowance(address spender, uint256 subtractedValue) external returns (bool);\n}\n" + }, + "@graphprotocol/contracts/contracts/utils/TokenUtils.sol": { + "content": "// SPDX-License-Identifier: GPL-2.0-or-later\n\npragma solidity ^0.7.6 || 0.8.27;\n\nimport \"../token/IGraphToken.sol\";\n\n/**\n * @title TokenUtils library\n * @notice This library contains utility functions for handling tokens (transfers and burns).\n * It is specifically adapted for the GraphToken, so does not need to handle edge cases\n * for other tokens.\n */\nlibrary TokenUtils {\n /**\n * @dev Pull tokens from an address to this contract.\n * @param _graphToken Token to transfer\n * @param _from Address sending the tokens\n * @param _amount Amount of tokens to transfer\n */\n function pullTokens(IGraphToken _graphToken, address _from, uint256 _amount) internal {\n if (_amount > 0) {\n require(_graphToken.transferFrom(_from, address(this), _amount), \"!transfer\");\n }\n }\n\n /**\n * @dev Push tokens from this contract to a receiving address.\n * @param _graphToken Token to transfer\n * @param _to Address receiving the tokens\n * @param _amount Amount of tokens to transfer\n */\n function pushTokens(IGraphToken _graphToken, address _to, uint256 _amount) internal {\n if (_amount > 0) {\n require(_graphToken.transfer(_to, _amount), \"!transfer\");\n }\n }\n\n /**\n * @dev Burn tokens held by this contract.\n * @param _graphToken Token to burn\n * @param _amount Amount of tokens to burn\n */\n function burnTokens(IGraphToken _graphToken, uint256 _amount) internal {\n if (_amount > 0) {\n _graphToken.burn(_amount);\n }\n }\n}\n" + }, + "@graphprotocol/horizon/contracts/data-service/DataService.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0-or-later\npragma solidity 0.8.27;\n\nimport { IDataService } from \"./interfaces/IDataService.sol\";\n\nimport { DataServiceV1Storage } from \"./DataServiceStorage.sol\";\nimport { GraphDirectory } from \"../utilities/GraphDirectory.sol\";\nimport { ProvisionManager } from \"./utilities/ProvisionManager.sol\";\n\n/**\n * @title DataService contract\n * @dev Implementation of the {IDataService} interface.\n * @notice This implementation provides base functionality for a data service:\n * - GraphDirectory, allows the data service to interact with Graph Horizon contracts\n * - ProvisionManager, provides functionality to manage provisions\n *\n * The derived contract MUST implement all the interfaces described in {IDataService} and in\n * accordance with the Data Service framework.\n * @dev A note on upgradeability: this base contract can be inherited by upgradeable or non upgradeable\n * contracts.\n * - If the data service implementation is upgradeable, it must initialize the contract via an external\n * initializer function with the `initializer` modifier that calls {__DataService_init} or\n * {__DataService_init_unchained}. It's recommended the implementation constructor to also call\n * {_disableInitializers} to prevent the implementation from being initialized.\n * - If the data service implementation is NOT upgradeable, it must initialize the contract by calling\n * {__DataService_init} or {__DataService_init_unchained} in the constructor. Note that the `initializer`\n * will be required in the constructor.\n * - Note that in both cases if using {__DataService_init_unchained} variant the corresponding parent\n * initializers must be called in the implementation.\n * @custom:security-contact Please email security+contracts@thegraph.com if you find any\n * bugs. We may have an active bug bounty program.\n */\nabstract contract DataService is GraphDirectory, ProvisionManager, DataServiceV1Storage, IDataService {\n /**\n * @dev Addresses in GraphDirectory are immutables, they can only be set in this constructor.\n * @param controller The address of the Graph Horizon controller contract.\n */\n constructor(address controller) GraphDirectory(controller) {}\n\n /// @inheritdoc IDataService\n function getThawingPeriodRange() external view returns (uint64, uint64) {\n return _getThawingPeriodRange();\n }\n\n /// @inheritdoc IDataService\n function getVerifierCutRange() external view returns (uint32, uint32) {\n return _getVerifierCutRange();\n }\n\n /// @inheritdoc IDataService\n function getProvisionTokensRange() external view returns (uint256, uint256) {\n return _getProvisionTokensRange();\n }\n\n /// @inheritdoc IDataService\n function getDelegationRatio() external view returns (uint32) {\n return _getDelegationRatio();\n }\n\n /**\n * @notice Initializes the contract and any parent contracts.\n */\n function __DataService_init() internal onlyInitializing {\n __ProvisionManager_init_unchained();\n __DataService_init_unchained();\n }\n\n /**\n * @notice Initializes the contract.\n */\n function __DataService_init_unchained() internal onlyInitializing {}\n}\n" + }, + "@graphprotocol/horizon/contracts/data-service/DataServiceStorage.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0-or-later\npragma solidity 0.8.27;\n\n/**\n * @title DataServiceStorage\n * @dev This contract holds the storage variables for the DataService contract.\n * @custom:security-contact Please email security+contracts@thegraph.com if you find any\n * bugs. We may have an active bug bounty program.\n */\nabstract contract DataServiceV1Storage {\n /// @dev Gap to allow adding variables in future upgrades\n /// Note that this contract is not upgradeable but might be inherited by an upgradeable contract\n uint256[50] private __gap;\n}\n" + }, + "@graphprotocol/horizon/contracts/data-service/extensions/DataServiceFees.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0-or-later\npragma solidity 0.8.27;\n\nimport { IDataServiceFees } from \"../interfaces/IDataServiceFees.sol\";\n\nimport { ProvisionTracker } from \"../libraries/ProvisionTracker.sol\";\nimport { LinkedList } from \"../../libraries/LinkedList.sol\";\n\nimport { DataService } from \"../DataService.sol\";\nimport { DataServiceFeesV1Storage } from \"./DataServiceFeesStorage.sol\";\n\n/**\n * @title DataServiceFees contract\n * @dev Implementation of the {IDataServiceFees} interface.\n * @notice Extension for the {IDataService} contract to handle payment collateralization\n * using a Horizon provision. See {IDataServiceFees} for more details.\n * @dev This contract inherits from {DataService} which needs to be initialized, please see\n * {DataService} for detailed instructions.\n * @custom:security-contact Please email security+contracts@thegraph.com if you find any\n * bugs. We may have an active bug bounty program.\n */\nabstract contract DataServiceFees is DataService, DataServiceFeesV1Storage, IDataServiceFees {\n using ProvisionTracker for mapping(address => uint256);\n using LinkedList for LinkedList.List;\n\n /// @inheritdoc IDataServiceFees\n function releaseStake(uint256 numClaimsToRelease) external virtual override {\n _releaseStake(msg.sender, numClaimsToRelease);\n }\n\n /**\n * @notice Locks stake for a service provider to back a payment.\n * Creates a stake claim, which is stored in a linked list by service provider.\n * @dev Requirements:\n * - The associated provision must have enough available tokens to lock the stake.\n *\n * Emits a {StakeClaimLocked} event.\n *\n * @param _serviceProvider The address of the service provider\n * @param _tokens The amount of tokens to lock in the claim\n * @param _unlockTimestamp The timestamp when the tokens can be released\n */\n function _lockStake(address _serviceProvider, uint256 _tokens, uint256 _unlockTimestamp) internal {\n require(_tokens != 0, DataServiceFeesZeroTokens());\n feesProvisionTracker.lock(_graphStaking(), _serviceProvider, _tokens, _delegationRatio);\n\n LinkedList.List storage claimsList = claimsLists[_serviceProvider];\n\n // Save item and add to list\n bytes32 claimId = _buildStakeClaimId(_serviceProvider, claimsList.nonce);\n claims[claimId] = StakeClaim({\n tokens: _tokens,\n createdAt: block.timestamp,\n releasableAt: _unlockTimestamp,\n nextClaim: bytes32(0)\n });\n if (claimsList.count != 0) claims[claimsList.tail].nextClaim = claimId;\n claimsList.addTail(claimId);\n\n emit StakeClaimLocked(_serviceProvider, claimId, _tokens, _unlockTimestamp);\n }\n\n /**\n * @notice Releases expired stake claims for a service provider.\n * @dev This function can be overriden and/or disabled.\n * @dev Note that the list is traversed by creation date not by releasableAt date. Traversing will stop\n * when the first stake claim that is not yet expired is found even if later stake claims have expired. This\n * could happen if stake claims are genereted with different unlock periods.\n * @dev Emits a {StakeClaimsReleased} event, and a {StakeClaimReleased} event for each claim released.\n * @param _serviceProvider The address of the service provider\n * @param _numClaimsToRelease Amount of stake claims to process. If 0, all stake claims are processed.\n */\n function _releaseStake(address _serviceProvider, uint256 _numClaimsToRelease) internal {\n LinkedList.List storage claimsList = claimsLists[_serviceProvider];\n (uint256 claimsReleased, bytes memory data) = claimsList.traverse(\n _getNextStakeClaim,\n _processStakeClaim,\n _deleteStakeClaim,\n abi.encode(0, _serviceProvider),\n _numClaimsToRelease\n );\n\n emit StakeClaimsReleased(_serviceProvider, claimsReleased, abi.decode(data, (uint256)));\n }\n\n /**\n * @notice Processes a stake claim, releasing the tokens if the claim has expired.\n * @dev This function is used as a callback in the stake claims linked list traversal.\n * @param _claimId The id of the stake claim\n * @param _acc The accumulator for the stake claims being processed\n * @return Whether the stake claim is still locked, indicating that the traversal should continue or stop.\n * @return The updated accumulator data\n */\n function _processStakeClaim(bytes32 _claimId, bytes memory _acc) private returns (bool, bytes memory) {\n StakeClaim memory claim = _getStakeClaim(_claimId);\n\n // early exit\n if (claim.releasableAt > block.timestamp) {\n return (true, LinkedList.NULL_BYTES);\n }\n\n // decode\n (uint256 tokensClaimed, address serviceProvider) = abi.decode(_acc, (uint256, address));\n\n // process\n feesProvisionTracker.release(serviceProvider, claim.tokens);\n emit StakeClaimReleased(serviceProvider, _claimId, claim.tokens, claim.releasableAt);\n\n // encode\n _acc = abi.encode(tokensClaimed + claim.tokens, serviceProvider);\n return (false, _acc);\n }\n\n /**\n * @notice Deletes a stake claim.\n * @dev This function is used as a callback in the stake claims linked list traversal.\n * @param _claimId The ID of the stake claim to delete\n */\n function _deleteStakeClaim(bytes32 _claimId) private {\n delete claims[_claimId];\n }\n\n /**\n * @notice Gets the details of a stake claim\n * @param _claimId The ID of the stake claim\n * @return The stake claim details\n */\n function _getStakeClaim(bytes32 _claimId) private view returns (StakeClaim memory) {\n StakeClaim memory claim = claims[_claimId];\n require(claim.createdAt != 0, DataServiceFeesClaimNotFound(_claimId));\n return claim;\n }\n\n /**\n * @notice Gets the next stake claim in the linked list\n * @dev This function is used as a callback in the stake claims linked list traversal.\n * @param _claimId The ID of the stake claim\n * @return The next stake claim ID\n */\n function _getNextStakeClaim(bytes32 _claimId) private view returns (bytes32) {\n return claims[_claimId].nextClaim;\n }\n\n /**\n * @notice Builds a stake claim ID\n * @param _serviceProvider The address of the service provider\n * @param _nonce A nonce of the stake claim\n * @return The stake claim ID\n */\n function _buildStakeClaimId(address _serviceProvider, uint256 _nonce) private view returns (bytes32) {\n return keccak256(abi.encodePacked(address(this), _serviceProvider, _nonce));\n }\n}\n" + }, + "@graphprotocol/horizon/contracts/data-service/extensions/DataServiceFeesStorage.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0-or-later\npragma solidity 0.8.27;\n\nimport { IDataServiceFees } from \"../interfaces/IDataServiceFees.sol\";\n\nimport { LinkedList } from \"../../libraries/LinkedList.sol\";\n\n/**\n * @title Storage layout for the {DataServiceFees} extension contract.\n * @custom:security-contact Please email security+contracts@thegraph.com if you find any\n * bugs. We may have an active bug bounty program.\n */\nabstract contract DataServiceFeesV1Storage {\n /// @notice The amount of tokens locked in stake claims for each service provider\n mapping(address serviceProvider => uint256 tokens) public feesProvisionTracker;\n\n /// @notice List of all locked stake claims to be released to service providers\n mapping(bytes32 claimId => IDataServiceFees.StakeClaim claim) public claims;\n\n /// @notice Service providers registered in the data service\n mapping(address serviceProvider => LinkedList.List list) public claimsLists;\n\n /// @dev Gap to allow adding variables in future upgrades\n /// Note that this contract is not upgradeable but might be inherited by an upgradeable contract\n uint256[50] private __gap;\n}\n" + }, + "@graphprotocol/horizon/contracts/data-service/extensions/DataServicePausableUpgradeable.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0-or-later\npragma solidity 0.8.27;\n\nimport { IDataServicePausable } from \"../interfaces/IDataServicePausable.sol\";\n\nimport { PausableUpgradeable } from \"@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol\";\nimport { DataService } from \"../DataService.sol\";\n\n/**\n * @title DataServicePausableUpgradeable contract\n * @dev Implementation of the {IDataServicePausable} interface.\n * @dev Upgradeable version of the {DataServicePausable} contract.\n * @dev This contract inherits from {DataService} which needs to be initialized, please see\n * {DataService} for detailed instructions.\n * @custom:security-contact Please email security+contracts@thegraph.com if you find any\n * bugs. We may have an active bug bounty program.\n */\nabstract contract DataServicePausableUpgradeable is PausableUpgradeable, DataService, IDataServicePausable {\n /// @notice List of pause guardians and their allowed status\n mapping(address pauseGuardian => bool allowed) public pauseGuardians;\n\n /// @dev Gap to allow adding variables in future upgrades\n uint256[50] private __gap;\n\n /**\n * @notice Checks if the caller is a pause guardian.\n */\n modifier onlyPauseGuardian() {\n require(pauseGuardians[msg.sender], DataServicePausableNotPauseGuardian(msg.sender));\n _;\n }\n\n /// @inheritdoc IDataServicePausable\n function pause() external override onlyPauseGuardian {\n _pause();\n }\n\n /// @inheritdoc IDataServicePausable\n function unpause() external override onlyPauseGuardian {\n _unpause();\n }\n\n /**\n * @notice Initializes the contract and parent contracts\n */\n function __DataServicePausable_init() internal onlyInitializing {\n __Pausable_init_unchained();\n __DataServicePausable_init_unchained();\n }\n\n /**\n * @notice Initializes the contract\n */\n function __DataServicePausable_init_unchained() internal onlyInitializing {}\n\n /**\n * @notice Sets a pause guardian.\n * @dev Internal function to be used by the derived contract to set pause guardians.\n *\n * Emits a {PauseGuardianSet} event.\n *\n * @param _pauseGuardian The address of the pause guardian\n * @param _allowed The allowed status of the pause guardian\n */\n function _setPauseGuardian(address _pauseGuardian, bool _allowed) internal {\n require(\n pauseGuardians[_pauseGuardian] == !_allowed,\n DataServicePausablePauseGuardianNoChange(_pauseGuardian, _allowed)\n );\n pauseGuardians[_pauseGuardian] = _allowed;\n emit PauseGuardianSet(_pauseGuardian, _allowed);\n }\n}\n" + }, + "@graphprotocol/horizon/contracts/data-service/interfaces/IDataService.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0-or-later\npragma solidity 0.8.27;\n\nimport { IGraphPayments } from \"../../interfaces/IGraphPayments.sol\";\n\n/**\n * @title Interface of the base {DataService} contract as defined by the Graph Horizon specification.\n * @notice This interface provides a guardrail for contracts that use the Data Service framework\n * to implement a data service on Graph Horizon. Much of the specification is intentionally loose\n * to allow for greater flexibility when designing a data service. It's not possible to guarantee that\n * an implementation will honor the Data Service framework guidelines so it's advised to always review\n * the implementation code and the documentation.\n * @dev This interface is expected to be inherited and extended by a data service interface. It can be\n * used to interact with it however it's advised to use the more specific parent interface.\n * @custom:security-contact Please email security+contracts@thegraph.com if you find any\n * bugs. We may have an active bug bounty program.\n */\ninterface IDataService {\n /**\n * @notice Emitted when a service provider is registered with the data service.\n * @param serviceProvider The address of the service provider.\n * @param data Custom data, usage defined by the data service.\n */\n event ServiceProviderRegistered(address indexed serviceProvider, bytes data);\n\n /**\n * @notice Emitted when a service provider accepts a provision in {Graph Horizon staking contract}.\n * @param serviceProvider The address of the service provider.\n */\n event ProvisionPendingParametersAccepted(address indexed serviceProvider);\n\n /**\n * @notice Emitted when a service provider starts providing the service.\n * @param serviceProvider The address of the service provider.\n * @param data Custom data, usage defined by the data service.\n */\n event ServiceStarted(address indexed serviceProvider, bytes data);\n\n /**\n * @notice Emitted when a service provider stops providing the service.\n * @param serviceProvider The address of the service provider.\n * @param data Custom data, usage defined by the data service.\n */\n event ServiceStopped(address indexed serviceProvider, bytes data);\n\n /**\n * @notice Emitted when a service provider collects payment.\n * @param serviceProvider The address of the service provider.\n * @param feeType The type of fee to collect as defined in {GraphPayments}.\n * @param tokens The amount of tokens collected.\n */\n event ServicePaymentCollected(\n address indexed serviceProvider,\n IGraphPayments.PaymentTypes indexed feeType,\n uint256 tokens\n );\n\n /**\n * @notice Emitted when a service provider is slashed.\n * @param serviceProvider The address of the service provider.\n * @param tokens The amount of tokens slashed.\n */\n event ServiceProviderSlashed(address indexed serviceProvider, uint256 tokens);\n\n /**\n * @notice Registers a service provider with the data service. The service provider can now\n * start providing the service.\n * @dev Before registering, the service provider must have created a provision in the\n * Graph Horizon staking contract with parameters that are compatible with the data service.\n *\n * Verifies provision parameters and rejects registration in the event they are not valid.\n *\n * Emits a {ServiceProviderRegistered} event.\n *\n * NOTE: Failing to accept the provision will result in the service provider operating\n * on an unverified provision. Depending on of the data service this can be a security\n * risk as the protocol won't be able to guarantee economic security for the consumer.\n * @param serviceProvider The address of the service provider.\n * @param data Custom data, usage defined by the data service.\n */\n function register(address serviceProvider, bytes calldata data) external;\n\n /**\n * @notice Accepts pending parameters in the provision of a service provider in the {Graph Horizon staking\n * contract}.\n * @dev Provides a way for the data service to validate and accept provision parameter changes. Call {_acceptProvision}.\n *\n * Emits a {ProvisionPendingParametersAccepted} event.\n *\n * @param serviceProvider The address of the service provider.\n * @param data Custom data, usage defined by the data service.\n */\n function acceptProvisionPendingParameters(address serviceProvider, bytes calldata data) external;\n\n /**\n * @notice Service provider starts providing the service.\n * @dev Emits a {ServiceStarted} event.\n * @param serviceProvider The address of the service provider.\n * @param data Custom data, usage defined by the data service.\n */\n function startService(address serviceProvider, bytes calldata data) external;\n\n /**\n * @notice Service provider stops providing the service.\n * @dev Emits a {ServiceStopped} event.\n * @param serviceProvider The address of the service provider.\n * @param data Custom data, usage defined by the data service.\n */\n function stopService(address serviceProvider, bytes calldata data) external;\n\n /**\n * @notice Collects payment earnt by the service provider.\n * @dev The implementation of this function is expected to interact with {GraphPayments}\n * to collect payment from the service payer, which is done via {IGraphPayments-collect}.\n *\n * Emits a {ServicePaymentCollected} event.\n *\n * NOTE: Data services that are vetted by the Graph Council might qualify for a portion of\n * protocol issuance to cover for these payments. In this case, the funds are taken by\n * interacting with the rewards manager contract instead of the {GraphPayments} contract.\n * @param serviceProvider The address of the service provider.\n * @param feeType The type of fee to collect as defined in {GraphPayments}.\n * @param data Custom data, usage defined by the data service.\n * @return The amount of tokens collected.\n */\n function collect(\n address serviceProvider,\n IGraphPayments.PaymentTypes feeType,\n bytes calldata data\n ) external returns (uint256);\n\n /**\n * @notice Slash a service provider for misbehaviour.\n * @dev To slash the service provider's provision the function should call\n * {Staking-slash}.\n *\n * Emits a {ServiceProviderSlashed} event.\n *\n * @param serviceProvider The address of the service provider.\n * @param data Custom data, usage defined by the data service.\n */\n function slash(address serviceProvider, bytes calldata data) external;\n\n /**\n * @notice External getter for the thawing period range\n * @return Minimum thawing period allowed\n * @return Maximum thawing period allowed\n */\n function getThawingPeriodRange() external view returns (uint64, uint64);\n\n /**\n * @notice External getter for the verifier cut range\n * @return Minimum verifier cut allowed\n * @return Maximum verifier cut allowed\n */\n function getVerifierCutRange() external view returns (uint32, uint32);\n\n /**\n * @notice External getter for the provision tokens range\n * @return Minimum provision tokens allowed\n * @return Maximum provision tokens allowed\n */\n function getProvisionTokensRange() external view returns (uint256, uint256);\n\n /**\n * @notice External getter for the delegation ratio\n * @return The delegation ratio\n */\n function getDelegationRatio() external view returns (uint32);\n}\n" + }, + "@graphprotocol/horizon/contracts/data-service/interfaces/IDataServiceFees.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0-or-later\npragma solidity 0.8.27;\n\nimport { IDataService } from \"./IDataService.sol\";\n\n/**\n * @title Interface for the {DataServiceFees} contract.\n * @notice Extension for the {IDataService} contract to handle payment collateralization\n * using a Horizon provision.\n *\n * It's designed to be used with the Data Service framework:\n * - When a service provider collects payment with {IDataService.collect} the data service should lock\n * stake to back the payment using {_lockStake}.\n * - Every time there is a payment collection with {IDataService.collect}, the data service should\n * attempt to release any expired stake claims by calling {_releaseStake}.\n * - Stake claims can also be manually released by calling {releaseStake} directly.\n *\n * @dev Note that this implementation uses the entire provisioned stake as collateral for the payment.\n * It can be used to provide economic security for the payments collected as long as the provisioned\n * stake is not being used for other purposes.\n * @custom:security-contact Please email security+contracts@thegraph.com if you find any\n * bugs. We may have an active bug bounty program.\n */\ninterface IDataServiceFees is IDataService {\n /**\n * @notice A stake claim, representing provisioned stake that gets locked\n * to be released to a service provider.\n * @dev StakeClaims are stored in linked lists by service provider, ordered by\n * creation timestamp.\n * @param tokens The amount of tokens to be locked in the claim\n * @param createdAt The timestamp when the claim was created\n * @param releasableAt The timestamp when the tokens can be released\n * @param nextClaim The next claim in the linked list\n */\n struct StakeClaim {\n uint256 tokens;\n uint256 createdAt;\n uint256 releasableAt;\n bytes32 nextClaim;\n }\n\n /**\n * @notice Emitted when a stake claim is created and stake is locked.\n * @param serviceProvider The address of the service provider\n * @param claimId The id of the stake claim\n * @param tokens The amount of tokens to lock in the claim\n * @param unlockTimestamp The timestamp when the tokens can be released\n */\n event StakeClaimLocked(\n address indexed serviceProvider,\n bytes32 indexed claimId,\n uint256 tokens,\n uint256 unlockTimestamp\n );\n\n /**\n * @notice Emitted when a stake claim is released and stake is unlocked.\n * @param serviceProvider The address of the service provider\n * @param claimId The id of the stake claim\n * @param tokens The amount of tokens released\n * @param releasableAt The timestamp when the tokens were released\n */\n event StakeClaimReleased(\n address indexed serviceProvider,\n bytes32 indexed claimId,\n uint256 tokens,\n uint256 releasableAt\n );\n\n /**\n * @notice Emitted when a series of stake claims are released.\n * @param serviceProvider The address of the service provider\n * @param claimsCount The number of stake claims being released\n * @param tokensReleased The total amount of tokens being released\n */\n event StakeClaimsReleased(address indexed serviceProvider, uint256 claimsCount, uint256 tokensReleased);\n\n /**\n * @notice Thrown when attempting to get a stake claim that does not exist.\n * @param claimId The id of the stake claim\n */\n error DataServiceFeesClaimNotFound(bytes32 claimId);\n\n /**\n * @notice Emitted when trying to lock zero tokens in a stake claim\n */\n error DataServiceFeesZeroTokens();\n\n /**\n * @notice Releases expired stake claims for the caller.\n * @dev This function is only meant to be called if the service provider has enough\n * stake claims that releasing them all at once would exceed the block gas limit.\n * @dev This function can be overriden and/or disabled.\n * @dev Emits a {StakeClaimsReleased} event, and a {StakeClaimReleased} event for each claim released.\n * @param numClaimsToRelease Amount of stake claims to process. If 0, all stake claims are processed.\n */\n function releaseStake(uint256 numClaimsToRelease) external;\n}\n" + }, + "@graphprotocol/horizon/contracts/data-service/interfaces/IDataServicePausable.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0-or-later\npragma solidity 0.8.27;\n\nimport { IDataService } from \"./IDataService.sol\";\n\n/**\n * @title Interface for the {DataServicePausable} contract.\n * @notice Extension for the {IDataService} contract, adds pausing functionality\n * to the data service. Pausing is controlled by privileged accounts called\n * pause guardians.\n * @custom:security-contact Please email security+contracts@thegraph.com if you find any\n * bugs. We may have an active bug bounty program.\n */\ninterface IDataServicePausable is IDataService {\n /**\n * @notice Emitted when a pause guardian is set.\n * @param account The address of the pause guardian\n * @param allowed The allowed status of the pause guardian\n */\n event PauseGuardianSet(address indexed account, bool allowed);\n\n /**\n * @notice Emitted when a the caller is not a pause guardian\n * @param account The address of the pause guardian\n */\n error DataServicePausableNotPauseGuardian(address account);\n\n /**\n * @notice Emitted when a pause guardian is set to the same allowed status\n * @param account The address of the pause guardian\n * @param allowed The allowed status of the pause guardian\n */\n error DataServicePausablePauseGuardianNoChange(address account, bool allowed);\n\n /**\n * @notice Pauses the data service.\n * @dev Note that only functions using the modifiers `whenNotPaused`\n * and `whenPaused` will be affected by the pause.\n *\n * Requirements:\n * - The contract must not be already paused\n */\n function pause() external;\n\n /**\n * @notice Unpauses the data service.\n * @dev Note that only functions using the modifiers `whenNotPaused`\n * and `whenPaused` will be affected by the pause.\n *\n * Requirements:\n * - The contract must be paused\n */\n function unpause() external;\n}\n" + }, + "@graphprotocol/horizon/contracts/data-service/libraries/ProvisionTracker.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0-or-later\npragma solidity 0.8.27;\n\nimport { IHorizonStaking } from \"../../interfaces/IHorizonStaking.sol\";\n\n/**\n * @title ProvisionTracker library\n * @notice A library to facilitate tracking of \"used tokens\" on Graph Horizon provisions. This can be used to\n * ensure data services have enough economic security (provisioned stake) to back the payments they collect for\n * their services.\n * The library provides two primitives, lock and release to signal token usage and free up tokens respectively. It\n * does not make any assumptions about the conditions under which tokens are locked or released.\n * @custom:security-contact Please email security+contracts@thegraph.com if you find any\n * bugs. We may have an active bug bounty program.\n */\nlibrary ProvisionTracker {\n /**\n * @notice Thrown when trying to lock more tokens than available\n * @param tokensAvailable The amount of tokens available\n * @param tokensRequired The amount of tokens required\n */\n error ProvisionTrackerInsufficientTokens(uint256 tokensAvailable, uint256 tokensRequired);\n\n /**\n * @notice Locks tokens for a service provider\n * @dev Requirements:\n * - `tokens` must be less than or equal to the amount of tokens available, as reported by the HorizonStaking contract\n * @param self The provision tracker mapping\n * @param graphStaking The HorizonStaking contract\n * @param serviceProvider The service provider address\n * @param tokens The amount of tokens to lock\n * @param delegationRatio A delegation ratio to limit the amount of delegation that's usable\n */\n function lock(\n mapping(address => uint256) storage self,\n IHorizonStaking graphStaking,\n address serviceProvider,\n uint256 tokens,\n uint32 delegationRatio\n ) internal {\n if (tokens == 0) return;\n\n uint256 tokensRequired = self[serviceProvider] + tokens;\n uint256 tokensAvailable = graphStaking.getTokensAvailable(serviceProvider, address(this), delegationRatio);\n require(tokensRequired <= tokensAvailable, ProvisionTrackerInsufficientTokens(tokensAvailable, tokensRequired));\n self[serviceProvider] += tokens;\n }\n\n /**\n * @notice Releases tokens for a service provider\n * @dev Requirements:\n * - `tokens` must be less than or equal to the amount of tokens locked for the service provider\n * @param self The provision tracker mapping\n * @param serviceProvider The service provider address\n * @param tokens The amount of tokens to release\n */\n function release(mapping(address => uint256) storage self, address serviceProvider, uint256 tokens) internal {\n if (tokens == 0) return;\n require(self[serviceProvider] >= tokens, ProvisionTrackerInsufficientTokens(self[serviceProvider], tokens));\n self[serviceProvider] -= tokens;\n }\n\n /**\n * @notice Checks if a service provider has enough tokens available to lock\n * @param self The provision tracker mapping\n * @param graphStaking The HorizonStaking contract\n * @param serviceProvider The service provider address\n * @param delegationRatio A delegation ratio to limit the amount of delegation that's usable\n * @return true if the service provider has enough tokens available to lock, false otherwise\n */\n function check(\n mapping(address => uint256) storage self,\n IHorizonStaking graphStaking,\n address serviceProvider,\n uint32 delegationRatio\n ) internal view returns (bool) {\n uint256 tokensAvailable = graphStaking.getTokensAvailable(serviceProvider, address(this), delegationRatio);\n return self[serviceProvider] <= tokensAvailable;\n }\n}\n" + }, + "@graphprotocol/horizon/contracts/data-service/utilities/ProvisionManager.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0-or-later\npragma solidity 0.8.27;\n\nimport { IHorizonStaking } from \"../../interfaces/IHorizonStaking.sol\";\n\nimport { UintRange } from \"../../libraries/UintRange.sol\";\nimport { PPMMath } from \"../../libraries/PPMMath.sol\";\n\nimport { Initializable } from \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\nimport { GraphDirectory } from \"../../utilities/GraphDirectory.sol\";\nimport { ProvisionManagerV1Storage } from \"./ProvisionManagerStorage.sol\";\n\n/**\n * @title ProvisionManager contract\n * @notice A helper contract that implements several provision management functions.\n * @dev Provides utilities to verify provision parameters are within an acceptable range. Each\n * parameter has an overridable setter and getter for the validity range, and a checker that reverts\n * if the parameter is out of range.\n * The parameters are:\n * - Provision parameters (thawing period and verifier cut)\n * - Provision tokens\n *\n * Note that default values for all provision parameters provide the most permissive configuration, it's\n * highly recommended to override them at the data service level.\n *\n * @custom:security-contact Please email security+contracts@thegraph.com if you find any\n * bugs. We may have an active bug bounty program.\n */\nabstract contract ProvisionManager is Initializable, GraphDirectory, ProvisionManagerV1Storage {\n using UintRange for uint256;\n\n /// @notice The default minimum verifier cut.\n uint32 internal constant DEFAULT_MIN_VERIFIER_CUT = type(uint32).min;\n\n /// @notice The default maximum verifier cut.\n uint32 internal constant DEFAULT_MAX_VERIFIER_CUT = uint32(PPMMath.MAX_PPM);\n\n /// @notice The default minimum thawing period.\n uint64 internal constant DEFAULT_MIN_THAWING_PERIOD = type(uint64).min;\n\n /// @notice The default maximum thawing period.\n uint64 internal constant DEFAULT_MAX_THAWING_PERIOD = type(uint64).max;\n\n /// @notice The default minimum provision tokens.\n uint256 internal constant DEFAULT_MIN_PROVISION_TOKENS = type(uint256).min;\n\n /// @notice The default maximum provision tokens.\n uint256 internal constant DEFAULT_MAX_PROVISION_TOKENS = type(uint256).max;\n\n /// @notice The default delegation ratio.\n uint32 internal constant DEFAULT_DELEGATION_RATIO = type(uint32).max;\n\n /**\n * @notice Emitted when the provision tokens range is set.\n * @param min The minimum allowed value for the provision tokens.\n * @param max The maximum allowed value for the provision tokens.\n */\n event ProvisionTokensRangeSet(uint256 min, uint256 max);\n\n /**\n * @notice Emitted when the delegation ratio is set.\n * @param ratio The delegation ratio\n */\n event DelegationRatioSet(uint32 ratio);\n\n /**\n * @notice Emitted when the verifier cut range is set.\n * @param min The minimum allowed value for the max verifier cut.\n * @param max The maximum allowed value for the max verifier cut.\n */\n event VerifierCutRangeSet(uint32 min, uint32 max);\n\n /**\n * @notice Emitted when the thawing period range is set.\n * @param min The minimum allowed value for the thawing period.\n * @param max The maximum allowed value for the thawing period.\n */\n event ThawingPeriodRangeSet(uint64 min, uint64 max);\n\n /**\n * @notice Thrown when a provision parameter is out of range.\n * @param message The error message.\n * @param value The value that is out of range.\n * @param min The minimum allowed value.\n * @param max The maximum allowed value.\n */\n error ProvisionManagerInvalidValue(bytes message, uint256 value, uint256 min, uint256 max);\n\n /**\n * @notice Thrown when attempting to set a range where min is greater than max.\n * @param min The minimum value.\n * @param max The maximum value.\n */\n error ProvisionManagerInvalidRange(uint256 min, uint256 max);\n\n /**\n * @notice Thrown when the caller is not authorized to manage the provision of a service provider.\n * @param serviceProvider The address of the serviceProvider.\n * @param caller The address of the caller.\n */\n error ProvisionManagerNotAuthorized(address serviceProvider, address caller);\n\n /**\n * @notice Thrown when a provision is not found.\n * @param serviceProvider The address of the service provider.\n */\n error ProvisionManagerProvisionNotFound(address serviceProvider);\n\n /**\n * @notice Checks if the caller is authorized to manage the provision of a service provider.\n * @param serviceProvider The address of the service provider.\n */\n modifier onlyAuthorizedForProvision(address serviceProvider) {\n require(\n _graphStaking().isAuthorized(serviceProvider, address(this), msg.sender),\n ProvisionManagerNotAuthorized(serviceProvider, msg.sender)\n );\n _;\n }\n\n /**\n * @notice Checks if a provision of a service provider is valid according\n * to the parameter ranges established.\n * @param serviceProvider The address of the service provider.\n */\n modifier onlyValidProvision(address serviceProvider) virtual {\n IHorizonStaking.Provision memory provision = _getProvision(serviceProvider);\n _checkProvisionTokens(provision);\n _checkProvisionParameters(provision, false);\n _;\n }\n\n /**\n * @notice Initializes the contract and any parent contracts.\n */\n function __ProvisionManager_init() internal onlyInitializing {\n __ProvisionManager_init_unchained();\n }\n\n /**\n * @notice Initializes the contract.\n * @dev All parameters set to their entire range as valid.\n */\n function __ProvisionManager_init_unchained() internal onlyInitializing {\n _setProvisionTokensRange(DEFAULT_MIN_PROVISION_TOKENS, DEFAULT_MAX_PROVISION_TOKENS);\n _setVerifierCutRange(DEFAULT_MIN_VERIFIER_CUT, DEFAULT_MAX_VERIFIER_CUT);\n _setThawingPeriodRange(DEFAULT_MIN_THAWING_PERIOD, DEFAULT_MAX_THAWING_PERIOD);\n _setDelegationRatio(DEFAULT_DELEGATION_RATIO);\n }\n\n /**\n * @notice Verifies and accepts the provision parameters of a service provider in\n * the {HorizonStaking} contract.\n * @dev Checks the pending provision parameters, not the current ones.\n *\n * @param _serviceProvider The address of the service provider.\n */\n function _acceptProvisionParameters(address _serviceProvider) internal {\n _checkProvisionParameters(_serviceProvider, true);\n _graphStaking().acceptProvisionParameters(_serviceProvider);\n }\n\n // -- setters --\n /**\n * @notice Sets the delegation ratio.\n * @param _ratio The delegation ratio to be set\n */\n function _setDelegationRatio(uint32 _ratio) internal {\n _delegationRatio = _ratio;\n emit DelegationRatioSet(_ratio);\n }\n\n /**\n * @notice Sets the range for the provision tokens.\n * @param _min The minimum allowed value for the provision tokens.\n * @param _max The maximum allowed value for the provision tokens.\n */\n function _setProvisionTokensRange(uint256 _min, uint256 _max) internal {\n require(_min <= _max, ProvisionManagerInvalidRange(_min, _max));\n _minimumProvisionTokens = _min;\n _maximumProvisionTokens = _max;\n emit ProvisionTokensRangeSet(_min, _max);\n }\n\n /**\n * @notice Sets the range for the verifier cut.\n * @param _min The minimum allowed value for the max verifier cut.\n * @param _max The maximum allowed value for the max verifier cut.\n */\n function _setVerifierCutRange(uint32 _min, uint32 _max) internal {\n require(_min <= _max, ProvisionManagerInvalidRange(_min, _max));\n require(PPMMath.isValidPPM(_max), ProvisionManagerInvalidRange(_min, _max));\n _minimumVerifierCut = _min;\n _maximumVerifierCut = _max;\n emit VerifierCutRangeSet(_min, _max);\n }\n\n /**\n * @notice Sets the range for the thawing period.\n * @param _min The minimum allowed value for the thawing period.\n * @param _max The maximum allowed value for the thawing period.\n */\n function _setThawingPeriodRange(uint64 _min, uint64 _max) internal {\n require(_min <= _max, ProvisionManagerInvalidRange(_min, _max));\n _minimumThawingPeriod = _min;\n _maximumThawingPeriod = _max;\n emit ThawingPeriodRangeSet(_min, _max);\n }\n\n // -- checks --\n\n /**\n * @notice Checks if the provision tokens of a service provider are within the valid range.\n * @param _serviceProvider The address of the service provider.\n */\n function _checkProvisionTokens(address _serviceProvider) internal view virtual {\n IHorizonStaking.Provision memory provision = _getProvision(_serviceProvider);\n _checkProvisionTokens(provision);\n }\n\n /**\n * @notice Checks if the provision tokens of a service provider are within the valid range.\n * Note that thawing tokens are not considered in this check.\n * @param _provision The provision to check.\n */\n function _checkProvisionTokens(IHorizonStaking.Provision memory _provision) internal view virtual {\n _checkValueInRange(\n _provision.tokens - _provision.tokensThawing,\n _minimumProvisionTokens,\n _maximumProvisionTokens,\n \"tokens\"\n );\n }\n\n /**\n * @notice Checks if the provision parameters of a service provider are within the valid range.\n * @param _serviceProvider The address of the service provider.\n * @param _checkPending If true, checks the pending provision parameters.\n */\n function _checkProvisionParameters(address _serviceProvider, bool _checkPending) internal view virtual {\n IHorizonStaking.Provision memory provision = _getProvision(_serviceProvider);\n _checkProvisionParameters(provision, _checkPending);\n }\n\n /**\n * @notice Checks if the provision parameters of a service provider are within the valid range.\n * @param _provision The provision to check.\n * @param _checkPending If true, checks the pending provision parameters instead of the current ones.\n */\n function _checkProvisionParameters(\n IHorizonStaking.Provision memory _provision,\n bool _checkPending\n ) internal view virtual {\n (uint64 thawingPeriodMin, uint64 thawingPeriodMax) = _getThawingPeriodRange();\n uint64 thawingPeriodToCheck = _checkPending ? _provision.thawingPeriodPending : _provision.thawingPeriod;\n _checkValueInRange(thawingPeriodToCheck, thawingPeriodMin, thawingPeriodMax, \"thawingPeriod\");\n\n (uint32 verifierCutMin, uint32 verifierCutMax) = _getVerifierCutRange();\n uint32 maxVerifierCutToCheck = _checkPending ? _provision.maxVerifierCutPending : _provision.maxVerifierCut;\n _checkValueInRange(maxVerifierCutToCheck, verifierCutMin, verifierCutMax, \"maxVerifierCut\");\n }\n\n // -- getters --\n\n /**\n * @notice Gets the delegation ratio.\n * @return The delegation ratio\n */\n function _getDelegationRatio() internal view returns (uint32) {\n return _delegationRatio;\n }\n\n /**\n * @notice Gets the range for the provision tokens.\n * @return The minimum allowed value for the provision tokens.\n * @return The maximum allowed value for the provision tokens.\n */\n function _getProvisionTokensRange() internal view virtual returns (uint256, uint256) {\n return (_minimumProvisionTokens, _maximumProvisionTokens);\n }\n\n /**\n * @notice Gets the range for the thawing period.\n * @return The minimum allowed value for the thawing period.\n * @return The maximum allowed value for the thawing period.\n */\n function _getThawingPeriodRange() internal view virtual returns (uint64, uint64) {\n return (_minimumThawingPeriod, _maximumThawingPeriod);\n }\n\n /**\n * @notice Gets the range for the verifier cut.\n * @return The minimum allowed value for the max verifier cut.\n * @return The maximum allowed value for the max verifier cut.\n */\n function _getVerifierCutRange() internal view virtual returns (uint32, uint32) {\n return (_minimumVerifierCut, _maximumVerifierCut);\n }\n\n /**\n * @notice Gets a provision from the {HorizonStaking} contract.\n * @dev Requirements:\n * - The provision must exist.\n * @param _serviceProvider The address of the service provider.\n * @return The provision.\n */\n function _getProvision(address _serviceProvider) internal view returns (IHorizonStaking.Provision memory) {\n IHorizonStaking.Provision memory provision = _graphStaking().getProvision(_serviceProvider, address(this));\n require(provision.createdAt != 0, ProvisionManagerProvisionNotFound(_serviceProvider));\n return provision;\n }\n\n /**\n * @notice Checks if a value is within a valid range.\n * @param _value The value to check.\n * @param _min The minimum allowed value.\n * @param _max The maximum allowed value.\n * @param _revertMessage The revert message to display if the value is out of range.\n */\n function _checkValueInRange(uint256 _value, uint256 _min, uint256 _max, bytes memory _revertMessage) private pure {\n require(_value.isInRange(_min, _max), ProvisionManagerInvalidValue(_revertMessage, _value, _min, _max));\n }\n}\n" + }, + "@graphprotocol/horizon/contracts/data-service/utilities/ProvisionManagerStorage.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0-or-later\npragma solidity 0.8.27;\n\n/**\n * @title Storage layout for the {ProvisionManager} helper contract.\n * @custom:security-contact Please email security+contracts@thegraph.com if you find any\n * bugs. We may have an active bug bounty program.\n */\nabstract contract ProvisionManagerV1Storage {\n /// @notice The minimum amount of tokens required to register a provision in the data service\n uint256 internal _minimumProvisionTokens;\n\n /// @notice The maximum amount of tokens allowed to register a provision in the data service\n uint256 internal _maximumProvisionTokens;\n\n /// @notice The minimum thawing period required to register a provision in the data service\n uint64 internal _minimumThawingPeriod;\n\n /// @notice The maximum thawing period allowed to register a provision in the data service\n uint64 internal _maximumThawingPeriod;\n\n /// @notice The minimum verifier cut required to register a provision in the data service (in PPM)\n uint32 internal _minimumVerifierCut;\n\n /// @notice The maximum verifier cut allowed to register a provision in the data service (in PPM)\n uint32 internal _maximumVerifierCut;\n\n /// @notice How much delegation the service provider can effectively use\n /// @dev Max calculated as service provider's stake * delegationRatio\n uint32 internal _delegationRatio;\n\n /// @dev Gap to allow adding variables in future upgrades\n /// Note that this contract is not upgradeable but might be inherited by an upgradeable contract\n uint256[50] private __gap;\n}\n" + }, + "@graphprotocol/horizon/contracts/interfaces/IGraphPayments.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0-or-later\npragma solidity 0.8.27;\n\n/**\n * @title Interface for the {GraphPayments} contract\n * @notice This contract is part of the Graph Horizon payments protocol. It's designed\n * to pull funds (GRT) from the {PaymentsEscrow} and distribute them according to a\n * set of pre established rules.\n * @custom:security-contact Please email security+contracts@thegraph.com if you find any\n * bugs. We may have an active bug bounty program.\n */\ninterface IGraphPayments {\n /**\n * @notice Types of payments that are supported by the payments protocol\n * @dev\n */\n enum PaymentTypes {\n QueryFee,\n IndexingFee,\n IndexingRewards\n }\n\n /**\n * @notice Emitted when a payment is collected\n * @param paymentType The type of payment as defined in {IGraphPayments}\n * @param payer The address of the payer\n * @param receiver The address of the receiver\n * @param dataService The address of the data service\n * @param tokens The total amount of tokens being collected\n * @param tokensProtocol Amount of tokens charged as protocol tax\n * @param tokensDataService Amount of tokens for the data service\n * @param tokensDelegationPool Amount of tokens for delegators\n * @param tokensReceiver Amount of tokens for the receiver\n * @param receiverDestination The address where the receiver's payment cut is sent.\n */\n event GraphPaymentCollected(\n PaymentTypes indexed paymentType,\n address indexed payer,\n address receiver,\n address indexed dataService,\n uint256 tokens,\n uint256 tokensProtocol,\n uint256 tokensDataService,\n uint256 tokensDelegationPool,\n uint256 tokensReceiver,\n address receiverDestination\n );\n\n /**\n * @notice Thrown when the protocol payment cut is invalid\n * @param protocolPaymentCut The protocol payment cut\n */\n error GraphPaymentsInvalidProtocolPaymentCut(uint256 protocolPaymentCut);\n\n /**\n * @notice Thrown when trying to use a cut that is not expressed in PPM\n * @param cut The cut\n */\n error GraphPaymentsInvalidCut(uint256 cut);\n\n /**\n * @notice Initialize the contract\n */\n function initialize() external;\n\n /**\n * @notice Collects funds from a payer.\n * It will pay cuts to all relevant parties and forward the rest to the receiver destination address. If the\n * destination address is zero the funds are automatically staked to the receiver. Note that the receiver \n * destination address can be set to the receiver address to collect funds on the receiver without re-staking.\n *\n * Note that the collected amount can be zero.\n *\n * @param paymentType The type of payment as defined in {IGraphPayments}\n * @param receiver The address of the receiver\n * @param tokens The amount of tokens being collected.\n * @param dataService The address of the data service\n * @param dataServiceCut The data service cut in PPM\n * @param receiverDestination The address where the receiver's payment cut is sent.\n */\n function collect(\n PaymentTypes paymentType,\n address receiver,\n uint256 tokens,\n address dataService,\n uint256 dataServiceCut,\n address receiverDestination\n ) external;\n}\n" + }, + "@graphprotocol/horizon/contracts/interfaces/IGraphProxyAdmin.sol": { + "content": "// SPDX-License-Identifier: GPL-2.0-or-later\n\npragma solidity 0.8.27;\n\n/**\n * @title IGraphProxyAdmin\n * @dev Empty interface to allow the GraphProxyAdmin contract to be used\n * in the GraphDirectory contract.\n * @custom:security-contact Please email security+contracts@thegraph.com if you find any\n * bugs. We may have an active bug bounty program.\n */\ninterface IGraphProxyAdmin {}\n" + }, + "@graphprotocol/horizon/contracts/interfaces/IGraphTallyCollector.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0-or-later\npragma solidity 0.8.27;\n\nimport { IPaymentsCollector } from \"./IPaymentsCollector.sol\";\nimport { IGraphPayments } from \"./IGraphPayments.sol\";\n\n/**\n * @title Interface for the {GraphTallyCollector} contract\n * @dev Implements the {IPaymentCollector} interface as defined by the Graph\n * Horizon payments protocol.\n * @notice Implements a payments collector contract that can be used to collect\n * payments using a GraphTally RAV (Receipt Aggregate Voucher).\n * @custom:security-contact Please email security+contracts@thegraph.com if you find any\n * bugs. We may have an active bug bounty program.\n */\ninterface IGraphTallyCollector is IPaymentsCollector {\n /**\n * @notice The Receipt Aggregate Voucher (RAV) struct\n * @param collectionId The ID of the collection \"bucket\" the RAV belongs to. Note that multiple RAVs can be collected for the same collection id.\n * @param payer The address of the payer the RAV was issued by\n * @param serviceProvider The address of the service provider the RAV was issued to\n * @param dataService The address of the data service the RAV was issued to\n * @param timestampNs The RAV timestamp, indicating the latest GraphTally Receipt in the RAV\n * @param valueAggregate The total amount owed to the service provider since the beginning of the payer-service provider relationship, including all debt that is already paid for.\n * @param metadata Arbitrary metadata to extend functionality if a data service requires it\n */\n struct ReceiptAggregateVoucher {\n bytes32 collectionId;\n address payer;\n address serviceProvider;\n address dataService;\n uint64 timestampNs;\n uint128 valueAggregate;\n bytes metadata;\n }\n\n /**\n * @notice A struct representing a signed RAV\n * @param rav The RAV\n * @param signature The signature of the RAV - 65 bytes: r (32 Bytes) || s (32 Bytes) || v (1 Byte)\n */\n struct SignedRAV {\n ReceiptAggregateVoucher rav;\n bytes signature;\n }\n\n /**\n * @notice Emitted when a RAV is collected\n * @param collectionId The ID of the collection \"bucket\" the RAV belongs to.\n * @param payer The address of the payer\n * @param dataService The address of the data service\n * @param serviceProvider The address of the service provider\n * @param timestampNs The timestamp of the RAV\n * @param valueAggregate The total amount owed to the service provider\n * @param metadata Arbitrary metadata\n * @param signature The signature of the RAV\n */\n event RAVCollected(\n bytes32 indexed collectionId,\n address indexed payer,\n address serviceProvider,\n address indexed dataService,\n uint64 timestampNs,\n uint128 valueAggregate,\n bytes metadata,\n bytes signature\n );\n\n /**\n * @notice Thrown when the RAV signer is invalid\n */\n error GraphTallyCollectorInvalidRAVSigner();\n\n /**\n * @notice Thrown when the RAV is for a data service the service provider has no provision for\n * @param dataService The address of the data service\n */\n error GraphTallyCollectorUnauthorizedDataService(address dataService);\n\n /**\n * @notice Thrown when the caller is not the data service the RAV was issued to\n * @param caller The address of the caller\n * @param dataService The address of the data service\n */\n error GraphTallyCollectorCallerNotDataService(address caller, address dataService);\n\n /**\n * @notice Thrown when the tokens collected are inconsistent with the collection history\n * Each RAV should have a value greater than the previous one\n * @param tokens The amount of tokens in the RAV\n * @param tokensCollected The amount of tokens already collected\n */\n error GraphTallyCollectorInconsistentRAVTokens(uint256 tokens, uint256 tokensCollected);\n\n /**\n * @notice Thrown when the attempting to collect more tokens than what it's owed\n * @param tokensToCollect The amount of tokens to collect\n * @param maxTokensToCollect The maximum amount of tokens to collect\n */\n error GraphTallyCollectorInvalidTokensToCollectAmount(uint256 tokensToCollect, uint256 maxTokensToCollect);\n\n /**\n * @notice See {IPaymentsCollector.collect}\n * This variant adds the ability to partially collect a RAV by specifying the amount of tokens to collect.\n *\n * Requirements:\n * - The amount of tokens to collect must be less than or equal to the total amount of tokens in the RAV minus\n * the tokens already collected.\n * @param paymentType The payment type to collect\n * @param data Additional data required for the payment collection. Encoded as follows:\n * - SignedRAV `signedRAV`: The signed RAV\n * - uint256 `dataServiceCut`: The data service cut in PPM\n * - address `receiverDestination`: The address where the receiver's payment should be sent.\n * @param tokensToCollect The amount of tokens to collect\n * @return The amount of tokens collected\n */\n function collect(\n IGraphPayments.PaymentTypes paymentType,\n bytes calldata data,\n uint256 tokensToCollect\n ) external returns (uint256);\n\n /**\n * @dev Recovers the signer address of a signed ReceiptAggregateVoucher (RAV).\n * @param signedRAV The SignedRAV containing the RAV and its signature.\n * @return The address of the signer.\n */\n function recoverRAVSigner(SignedRAV calldata signedRAV) external view returns (address);\n\n /**\n * @dev Computes the hash of a ReceiptAggregateVoucher (RAV).\n * @param rav The RAV for which to compute the hash.\n * @return The hash of the RAV.\n */\n function encodeRAV(ReceiptAggregateVoucher calldata rav) external view returns (bytes32);\n}\n" + }, + "@graphprotocol/horizon/contracts/interfaces/IHorizonStaking.sol": { + "content": "// SPDX-License-Identifier: GPL-2.0-or-later\n\npragma solidity 0.8.27;\n\nimport { IHorizonStakingTypes } from \"./internal/IHorizonStakingTypes.sol\";\nimport { IHorizonStakingMain } from \"./internal/IHorizonStakingMain.sol\";\nimport { IHorizonStakingBase } from \"./internal/IHorizonStakingBase.sol\";\nimport { IHorizonStakingExtension } from \"./internal/IHorizonStakingExtension.sol\";\n\n/**\n * @title Complete interface for the Horizon Staking contract\n * @notice This interface exposes all functions implemented by the {HorizonStaking} contract and its extension\n * {HorizonStakingExtension} as well as the custom data types used by the contract.\n * @dev Use this interface to interact with the Horizon Staking contract.\n * @custom:security-contact Please email security+contracts@thegraph.com if you find any\n * bugs. We may have an active bug bounty program.\n */\ninterface IHorizonStaking is IHorizonStakingTypes, IHorizonStakingBase, IHorizonStakingMain, IHorizonStakingExtension {}\n" + }, + "@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingBase.sol": { + "content": "// SPDX-License-Identifier: GPL-2.0-or-later\n\npragma solidity 0.8.27;\n\nimport { IHorizonStakingTypes } from \"./IHorizonStakingTypes.sol\";\nimport { IGraphPayments } from \"../IGraphPayments.sol\";\n\nimport { LinkedList } from \"../../libraries/LinkedList.sol\";\n\n/**\n * @title Interface for the {HorizonStakingBase} contract.\n * @notice Provides getters for {HorizonStaking} and {HorizonStakingExtension} storage variables.\n * @dev Most functions operate over {HorizonStaking} provisions. To uniquely identify a provision\n * functions take `serviceProvider` and `verifier` addresses.\n * @custom:security-contact Please email security+contracts@thegraph.com if you find any\n * bugs. We may have an active bug bounty program.\n */\ninterface IHorizonStakingBase {\n /**\n * @notice Emitted when a service provider stakes tokens.\n * @dev TRANSITION PERIOD: After transition period move to IHorizonStakingMain. Temporarily it\n * needs to be here since it's emitted by {_stake} which is used by both {HorizonStaking}\n * and {HorizonStakingExtension}.\n * @param serviceProvider The address of the service provider.\n * @param tokens The amount of tokens staked.\n */\n event HorizonStakeDeposited(address indexed serviceProvider, uint256 tokens);\n\n /**\n * @notice Thrown when using an invalid thaw request type.\n */\n error HorizonStakingInvalidThawRequestType();\n\n /**\n * @notice Gets the details of a service provider.\n * @param serviceProvider The address of the service provider.\n * @return The service provider details.\n */\n function getServiceProvider(\n address serviceProvider\n ) external view returns (IHorizonStakingTypes.ServiceProvider memory);\n\n /**\n * @notice Gets the stake of a service provider.\n * @param serviceProvider The address of the service provider.\n * @return The amount of tokens staked.\n */\n function getStake(address serviceProvider) external view returns (uint256);\n\n /**\n * @notice Gets the service provider's idle stake which is the stake that is not being\n * used for any provision. Note that this only includes service provider's self stake.\n * @param serviceProvider The address of the service provider.\n * @return The amount of tokens that are idle.\n */\n function getIdleStake(address serviceProvider) external view returns (uint256);\n\n /**\n * @notice Gets the details of delegation pool.\n * @param serviceProvider The address of the service provider.\n * @param verifier The address of the verifier.\n * @return The delegation pool details.\n */\n function getDelegationPool(\n address serviceProvider,\n address verifier\n ) external view returns (IHorizonStakingTypes.DelegationPool memory);\n\n /**\n * @notice Gets the details of a delegation.\n * @param serviceProvider The address of the service provider.\n * @param verifier The address of the verifier.\n * @param delegator The address of the delegator.\n * @return The delegation details.\n */\n function getDelegation(\n address serviceProvider,\n address verifier,\n address delegator\n ) external view returns (IHorizonStakingTypes.Delegation memory);\n\n /**\n * @notice Gets the delegation fee cut for a payment type.\n * @param serviceProvider The address of the service provider.\n * @param verifier The address of the verifier.\n * @param paymentType The payment type as defined by {IGraphPayments.PaymentTypes}.\n * @return The delegation fee cut in PPM.\n */\n function getDelegationFeeCut(\n address serviceProvider,\n address verifier,\n IGraphPayments.PaymentTypes paymentType\n ) external view returns (uint256);\n\n /**\n * @notice Gets the details of a provision.\n * @param serviceProvider The address of the service provider.\n * @param verifier The address of the verifier.\n * @return The provision details.\n */\n function getProvision(\n address serviceProvider,\n address verifier\n ) external view returns (IHorizonStakingTypes.Provision memory);\n\n /**\n * @notice Gets the tokens available in a provision.\n * Tokens available are the tokens in a provision that are not thawing. Includes service\n * provider's and delegator's stake.\n *\n * Allows specifying a `delegationRatio` which caps the amount of delegated tokens that are\n * considered available.\n *\n * @param serviceProvider The address of the service provider.\n * @param verifier The address of the verifier.\n * @param delegationRatio The delegation ratio.\n * @return The amount of tokens available.\n */\n function getTokensAvailable(\n address serviceProvider,\n address verifier,\n uint32 delegationRatio\n ) external view returns (uint256);\n\n /**\n * @notice Gets the service provider's tokens available in a provision.\n * @dev Calculated as the tokens available minus the tokens thawing.\n * @param serviceProvider The address of the service provider.\n * @param verifier The address of the verifier.\n * @return The amount of tokens available.\n */\n function getProviderTokensAvailable(address serviceProvider, address verifier) external view returns (uint256);\n\n /**\n * @notice Gets the delegator's tokens available in a provision.\n * @dev Calculated as the tokens available minus the tokens thawing.\n * @param serviceProvider The address of the service provider.\n * @param verifier The address of the verifier.\n * @return The amount of tokens available.\n */\n function getDelegatedTokensAvailable(address serviceProvider, address verifier) external view returns (uint256);\n\n /**\n * @notice Gets a thaw request.\n * @param thawRequestType The type of thaw request.\n * @param thawRequestId The id of the thaw request.\n * @return The thaw request details.\n */\n function getThawRequest(\n IHorizonStakingTypes.ThawRequestType thawRequestType,\n bytes32 thawRequestId\n ) external view returns (IHorizonStakingTypes.ThawRequest memory);\n\n /**\n * @notice Gets the metadata of a thaw request list.\n * Service provider and delegators each have their own thaw request list per provision.\n * Metadata includes the head and tail of the list, plus the total number of thaw requests.\n * @param thawRequestType The type of thaw request.\n * @param serviceProvider The address of the service provider.\n * @param verifier The address of the verifier.\n * @param owner The owner of the thaw requests. Use either the service provider or delegator address.\n * @return The thaw requests list metadata.\n */\n function getThawRequestList(\n IHorizonStakingTypes.ThawRequestType thawRequestType,\n address serviceProvider,\n address verifier,\n address owner\n ) external view returns (LinkedList.List memory);\n\n /**\n * @notice Gets the amount of thawed tokens that can be releasedfor a given provision.\n * @dev Note that the value returned by this function does not return the total amount of thawed tokens\n * but only those that can be released. If thaw requests are created with different thawing periods it's\n * possible that an unexpired thaw request temporarily blocks the release of other ones that have already\n * expired. This function will stop counting when it encounters the first thaw request that is not yet expired.\n * @param thawRequestType The type of thaw request.\n * @param serviceProvider The address of the service provider.\n * @param verifier The address of the verifier.\n * @param owner The owner of the thaw requests. Use either the service provider or delegator address.\n * @return The amount of thawed tokens.\n */\n function getThawedTokens(\n IHorizonStakingTypes.ThawRequestType thawRequestType,\n address serviceProvider,\n address verifier,\n address owner\n ) external view returns (uint256);\n\n /**\n * @notice Gets the maximum allowed thawing period for a provision.\n * @return The maximum allowed thawing period in seconds.\n */\n function getMaxThawingPeriod() external view returns (uint64);\n\n /**\n * @notice Return true if the verifier is an allowed locked verifier.\n * @param verifier Address of the verifier\n * @return True if verifier is allowed locked verifier, false otherwise\n */\n function isAllowedLockedVerifier(address verifier) external view returns (bool);\n\n /**\n * @notice Return true if delegation slashing is enabled, false otherwise.\n * @return True if delegation slashing is enabled, false otherwise\n */\n function isDelegationSlashingEnabled() external view returns (bool);\n}\n" + }, + "@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingExtension.sol": { + "content": "// SPDX-License-Identifier: GPL-2.0-or-later\n\npragma solidity 0.8.27;\n\nimport { IRewardsIssuer } from \"@graphprotocol/contracts/contracts/rewards/IRewardsIssuer.sol\";\n\n/**\n * @title Interface for {HorizonStakingExtension} contract.\n * @notice Provides functions for managing legacy allocations.\n * @custom:security-contact Please email security+contracts@thegraph.com if you find any\n * bugs. We may have an active bug bounty program.\n */\ninterface IHorizonStakingExtension is IRewardsIssuer {\n /**\n * @dev Allocate GRT tokens for the purpose of serving queries of a subgraph deployment\n * An allocation is created in the allocate() function and closed in closeAllocation()\n * @param indexer The indexer address\n * @param subgraphDeploymentID The subgraph deployment ID\n * @param tokens The amount of tokens allocated to the subgraph deployment\n * @param createdAtEpoch The epoch when the allocation was created\n * @param closedAtEpoch The epoch when the allocation was closed\n * @param collectedFees The amount of collected fees for the allocation\n * @param __DEPRECATED_effectiveAllocation Deprecated field.\n * @param accRewardsPerAllocatedToken Snapshot used for reward calculation\n * @param distributedRebates The amount of collected rebates that have been rebated\n */\n struct Allocation {\n address indexer;\n bytes32 subgraphDeploymentID;\n uint256 tokens;\n uint256 createdAtEpoch;\n uint256 closedAtEpoch;\n uint256 collectedFees;\n uint256 __DEPRECATED_effectiveAllocation;\n uint256 accRewardsPerAllocatedToken;\n uint256 distributedRebates;\n }\n\n /**\n * @dev Possible states an allocation can be.\n * States:\n * - Null = indexer == address(0)\n * - Active = not Null && tokens > 0\n * - Closed = Active && closedAtEpoch != 0\n */\n enum AllocationState {\n Null,\n Active,\n Closed\n }\n\n /**\n * @dev Emitted when `indexer` close an allocation in `epoch` for `allocationID`.\n * An amount of `tokens` get unallocated from `subgraphDeploymentID`.\n * This event also emits the POI (proof of indexing) submitted by the indexer.\n * `isPublic` is true if the sender was someone other than the indexer.\n * @param indexer The indexer address\n * @param subgraphDeploymentID The subgraph deployment ID\n * @param epoch The protocol epoch the allocation was closed on\n * @param tokens The amount of tokens unallocated from the allocation\n * @param allocationID The allocation identifier\n * @param sender The address closing the allocation\n * @param poi The proof of indexing submitted by the sender\n * @param isPublic True if the allocation was force closed by someone other than the indexer/operator\n */\n event AllocationClosed(\n address indexed indexer,\n bytes32 indexed subgraphDeploymentID,\n uint256 epoch,\n uint256 tokens,\n address indexed allocationID,\n address sender,\n bytes32 poi,\n bool isPublic\n );\n\n /**\n * @dev Emitted when `indexer` collects a rebate on `subgraphDeploymentID` for `allocationID`.\n * `epoch` is the protocol epoch the rebate was collected on\n * The rebate is for `tokens` amount which are being provided by `assetHolder`; `queryFees`\n * is the amount up for rebate after `curationFees` are distributed and `protocolTax` is burnt.\n * `queryRebates` is the amount distributed to the `indexer` with `delegationFees` collected\n * and sent to the delegation pool.\n * @param assetHolder The address of the asset holder, the entity paying the query fees\n * @param indexer The indexer address\n * @param subgraphDeploymentID The subgraph deployment ID\n * @param allocationID The allocation identifier\n * @param epoch The protocol epoch the rebate was collected on\n * @param tokens The amount of tokens collected\n * @param protocolTax The amount of tokens burnt as protocol tax\n * @param curationFees The amount of tokens distributed to the curation pool\n * @param queryFees The amount of tokens collected as query fees\n * @param queryRebates The amount of tokens distributed to the indexer\n * @param delegationRewards The amount of tokens collected from the delegation pool\n */\n event RebateCollected(\n address assetHolder,\n address indexed indexer,\n bytes32 indexed subgraphDeploymentID,\n address indexed allocationID,\n uint256 epoch,\n uint256 tokens,\n uint256 protocolTax,\n uint256 curationFees,\n uint256 queryFees,\n uint256 queryRebates,\n uint256 delegationRewards\n );\n\n /**\n * @dev Emitted when `indexer` was slashed for a total of `tokens` amount.\n * Tracks `reward` amount of tokens given to `beneficiary`.\n * @param indexer The indexer address\n * @param tokens The amount of tokens slashed\n * @param reward The amount of reward tokens to send to a beneficiary\n * @param beneficiary The address of a beneficiary to receive a reward for the slashing\n */\n event StakeSlashed(address indexed indexer, uint256 tokens, uint256 reward, address beneficiary);\n\n /**\n * @notice Close an allocation and free the staked tokens.\n * To be eligible for rewards a proof of indexing must be presented.\n * Presenting a bad proof is subject to slashable condition.\n * To opt out of rewards set _poi to 0x0\n * @param allocationID The allocation identifier\n * @param poi Proof of indexing submitted for the allocated period\n */\n function closeAllocation(address allocationID, bytes32 poi) external;\n\n /**\n * @dev Collect and rebate query fees to the indexer\n * This function will accept calls with zero tokens.\n * We use an exponential rebate formula to calculate the amount of tokens to rebate to the indexer.\n * This implementation allows collecting multiple times on the same allocation, keeping track of the\n * total amount rebated, the total amount collected and compensating the indexer for the difference.\n * @param tokens Amount of tokens to collect\n * @param allocationID Allocation where the tokens will be assigned\n */\n function collect(uint256 tokens, address allocationID) external;\n\n /**\n * @notice Slash the indexer stake. Delegated tokens are not subject to slashing.\n * Note that depending on the state of the indexer's stake, the slashed amount might be smaller than the\n * requested slash amount. This can happen if the indexer has moved a significant part of their stake to\n * a provision. Any outstanding slashing amount should be settled using Horizon's slash function\n * {IHorizonStaking.slash}.\n * @dev Can only be called by the slasher role.\n * @param indexer Address of indexer to slash\n * @param tokens Amount of tokens to slash from the indexer stake\n * @param reward Amount of reward tokens to send to a beneficiary\n * @param beneficiary Address of a beneficiary to receive a reward for the slashing\n */\n function legacySlash(address indexer, uint256 tokens, uint256 reward, address beneficiary) external;\n\n /**\n * @notice (Legacy) Return true if operator is allowed for the service provider on the subgraph data service.\n * @param operator Address of the operator\n * @param indexer Address of the service provider\n * @return True if operator is allowed for indexer, false otherwise\n */\n function isOperator(address operator, address indexer) external view returns (bool);\n\n /**\n * @notice Getter that returns if an indexer has any stake.\n * @param indexer Address of the indexer\n * @return True if indexer has staked tokens\n */\n function hasStake(address indexer) external view returns (bool);\n\n /**\n * @notice Get the total amount of tokens staked by the indexer.\n * @param indexer Address of the indexer\n * @return Amount of tokens staked by the indexer\n */\n function getIndexerStakedTokens(address indexer) external view returns (uint256);\n\n /**\n * @notice Return the allocation by ID.\n * @param allocationID Address used as allocation identifier\n * @return Allocation data\n */\n function getAllocation(address allocationID) external view returns (Allocation memory);\n\n /**\n * @notice Return the current state of an allocation\n * @param allocationID Allocation identifier\n * @return AllocationState enum with the state of the allocation\n */\n function getAllocationState(address allocationID) external view returns (AllocationState);\n\n /**\n * @notice Return if allocationID is used.\n * @param allocationID Address used as signer by the indexer for an allocation\n * @return True if allocationID already used\n */\n function isAllocation(address allocationID) external view returns (bool);\n\n /**\n * @notice Return the time in blocks to unstake\n * Deprecated, now enforced by each data service (verifier)\n * @return Thawing period in blocks\n */\n function __DEPRECATED_getThawingPeriod() external view returns (uint64);\n\n /**\n * @notice Return the address of the subgraph data service.\n * @dev TRANSITION PERIOD: After transition period move to main HorizonStaking contract\n * @return Address of the subgraph data service\n */\n function getSubgraphService() external view returns (address);\n}\n" + }, + "@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingMain.sol": { + "content": "// SPDX-License-Identifier: GPL-2.0-or-later\n\npragma solidity 0.8.27;\n\nimport { IGraphPayments } from \"../../interfaces/IGraphPayments.sol\";\nimport { IHorizonStakingTypes } from \"./IHorizonStakingTypes.sol\";\n\n/**\n * @title Inferface for the {HorizonStaking} contract.\n * @notice Provides functions for managing stake, provisions, delegations, and slashing.\n * @dev Note that this interface only includes the functions implemented by {HorizonStaking} contract,\n * and not those implemented by {HorizonStakingExtension}.\n * Do not use this interface to interface with the {HorizonStaking} contract, use {IHorizonStaking} for\n * the complete interface.\n * @dev Most functions operate over {HorizonStaking} provisions. To uniquely identify a provision\n * functions take `serviceProvider` and `verifier` addresses.\n * @dev TRANSITION PERIOD: After transition period rename to IHorizonStaking.\n * @custom:security-contact Please email security+contracts@thegraph.com if you find any\n * bugs. We may have an active bug bounty program.\n */\ninterface IHorizonStakingMain {\n // -- Events: stake --\n\n /**\n * @notice Emitted when a service provider unstakes tokens during the transition period.\n * @param serviceProvider The address of the service provider\n * @param tokens The amount of tokens now locked (including previously locked tokens)\n * @param until The block number until the stake is locked\n */\n event HorizonStakeLocked(address indexed serviceProvider, uint256 tokens, uint256 until);\n\n /**\n * @notice Emitted when a service provider withdraws tokens during the transition period.\n * @param serviceProvider The address of the service provider\n * @param tokens The amount of tokens withdrawn\n */\n event HorizonStakeWithdrawn(address indexed serviceProvider, uint256 tokens);\n\n // -- Events: provision --\n\n /**\n * @notice Emitted when a service provider provisions staked tokens to a verifier.\n * @param serviceProvider The address of the service provider\n * @param verifier The address of the verifier\n * @param tokens The amount of tokens provisioned\n * @param maxVerifierCut The maximum cut, expressed in PPM of the slashed amount, that a verifier can take for themselves when slashing\n * @param thawingPeriod The period in seconds that the tokens will be thawing before they can be removed from the provision\n */\n event ProvisionCreated(\n address indexed serviceProvider,\n address indexed verifier,\n uint256 tokens,\n uint32 maxVerifierCut,\n uint64 thawingPeriod\n );\n\n /**\n * @notice Emitted whenever staked tokens are added to an existing provision\n * @param serviceProvider The address of the service provider\n * @param verifier The address of the verifier\n * @param tokens The amount of tokens added to the provision\n */\n event ProvisionIncreased(address indexed serviceProvider, address indexed verifier, uint256 tokens);\n\n /**\n * @notice Emitted when a service provider thaws tokens from a provision.\n * @param serviceProvider The address of the service provider\n * @param verifier The address of the verifier\n * @param tokens The amount of tokens thawed\n */\n event ProvisionThawed(address indexed serviceProvider, address indexed verifier, uint256 tokens);\n\n /**\n * @notice Emitted when a service provider removes tokens from a provision.\n * @param serviceProvider The address of the service provider\n * @param verifier The address of the verifier\n * @param tokens The amount of tokens removed\n */\n event TokensDeprovisioned(address indexed serviceProvider, address indexed verifier, uint256 tokens);\n\n /**\n * @notice Emitted when a service provider stages a provision parameter update.\n * @param serviceProvider The address of the service provider\n * @param verifier The address of the verifier\n * @param maxVerifierCut The proposed maximum cut, expressed in PPM of the slashed amount, that a verifier can take for\n * themselves when slashing\n * @param thawingPeriod The proposed period in seconds that the tokens will be thawing before they can be removed from\n * the provision\n */\n event ProvisionParametersStaged(\n address indexed serviceProvider,\n address indexed verifier,\n uint32 maxVerifierCut,\n uint64 thawingPeriod\n );\n\n /**\n * @notice Emitted when a service provider accepts a staged provision parameter update.\n * @param serviceProvider The address of the service provider\n * @param verifier The address of the verifier\n * @param maxVerifierCut The new maximum cut, expressed in PPM of the slashed amount, that a verifier can take for themselves\n * when slashing\n * @param thawingPeriod The new period in seconds that the tokens will be thawing before they can be removed from the provision\n */\n event ProvisionParametersSet(\n address indexed serviceProvider,\n address indexed verifier,\n uint32 maxVerifierCut,\n uint64 thawingPeriod\n );\n\n /**\n * @dev Emitted when an operator is allowed or denied by a service provider for a particular verifier\n * @param serviceProvider The address of the service provider\n * @param verifier The address of the verifier\n * @param operator The address of the operator\n * @param allowed Whether the operator is allowed or denied\n */\n event OperatorSet(\n address indexed serviceProvider,\n address indexed verifier,\n address indexed operator,\n bool allowed\n );\n\n // -- Events: slashing --\n\n /**\n * @notice Emitted when a provision is slashed by a verifier.\n * @param serviceProvider The address of the service provider\n * @param verifier The address of the verifier\n * @param tokens The amount of tokens slashed (note this only represents service provider's slashed stake)\n */\n event ProvisionSlashed(address indexed serviceProvider, address indexed verifier, uint256 tokens);\n\n /**\n * @notice Emitted when a delegation pool is slashed by a verifier.\n * @param serviceProvider The address of the service provider\n * @param verifier The address of the verifier\n * @param tokens The amount of tokens slashed (note this only represents delegation pool's slashed stake)\n */\n event DelegationSlashed(address indexed serviceProvider, address indexed verifier, uint256 tokens);\n\n /**\n * @notice Emitted when a delegation pool would have been slashed by a verifier, but the slashing was skipped\n * because delegation slashing global parameter is not enabled.\n * @param serviceProvider The address of the service provider\n * @param verifier The address of the verifier\n * @param tokens The amount of tokens that would have been slashed (note this only represents delegation pool's slashed stake)\n */\n event DelegationSlashingSkipped(address indexed serviceProvider, address indexed verifier, uint256 tokens);\n\n /**\n * @notice Emitted when the verifier cut is sent to the verifier after slashing a provision.\n * @param serviceProvider The address of the service provider\n * @param verifier The address of the verifier\n * @param destination The address where the verifier cut is sent\n * @param tokens The amount of tokens sent to the verifier\n */\n event VerifierTokensSent(\n address indexed serviceProvider,\n address indexed verifier,\n address indexed destination,\n uint256 tokens\n );\n\n // -- Events: delegation --\n\n /**\n * @notice Emitted when tokens are delegated to a provision.\n * @param serviceProvider The address of the service provider\n * @param verifier The address of the verifier\n * @param delegator The address of the delegator\n * @param tokens The amount of tokens delegated\n * @param shares The amount of shares delegated\n */\n event TokensDelegated(\n address indexed serviceProvider,\n address indexed verifier,\n address indexed delegator,\n uint256 tokens,\n uint256 shares\n );\n\n /**\n * @notice Emitted when a delegator undelegates tokens from a provision and starts\n * thawing them.\n * @param serviceProvider The address of the service provider\n * @param verifier The address of the verifier\n * @param delegator The address of the delegator\n * @param tokens The amount of tokens undelegated\n * @param shares The amount of shares undelegated\n */\n event TokensUndelegated(\n address indexed serviceProvider,\n address indexed verifier,\n address indexed delegator,\n uint256 tokens,\n uint256 shares\n );\n\n /**\n * @notice Emitted when a delegator withdraws tokens from a provision after thawing.\n * @param serviceProvider The address of the service provider\n * @param verifier The address of the verifier\n * @param delegator The address of the delegator\n * @param tokens The amount of tokens withdrawn\n */\n event DelegatedTokensWithdrawn(\n address indexed serviceProvider,\n address indexed verifier,\n address indexed delegator,\n uint256 tokens\n );\n\n /**\n * @notice Emitted when `delegator` withdrew delegated `tokens` from `indexer` using `withdrawDelegated`.\n * @dev This event is for the legacy `withdrawDelegated` function.\n * @param indexer The address of the indexer\n * @param delegator The address of the delegator\n * @param tokens The amount of tokens withdrawn\n */\n event StakeDelegatedWithdrawn(address indexed indexer, address indexed delegator, uint256 tokens);\n\n /**\n * @notice Emitted when tokens are added to a delegation pool's reserve.\n * @param serviceProvider The address of the service provider\n * @param verifier The address of the verifier\n * @param tokens The amount of tokens withdrawn\n */\n event TokensToDelegationPoolAdded(address indexed serviceProvider, address indexed verifier, uint256 tokens);\n\n /**\n * @notice Emitted when a service provider sets delegation fee cuts for a verifier.\n * @param serviceProvider The address of the service provider\n * @param verifier The address of the verifier\n * @param paymentType The payment type for which the fee cut is set, as defined in {IGraphPayments}\n * @param feeCut The fee cut set, in PPM\n */\n event DelegationFeeCutSet(\n address indexed serviceProvider,\n address indexed verifier,\n IGraphPayments.PaymentTypes indexed paymentType,\n uint256 feeCut\n );\n\n // -- Events: thawing --\n\n /**\n * @notice Emitted when a thaw request is created.\n * @dev Can be emitted by the service provider when thawing stake or by the delegator when undelegating.\n * @param requestType The type of thaw request\n * @param serviceProvider The address of the service provider\n * @param verifier The address of the verifier\n * @param owner The address of the owner of the thaw request.\n * @param shares The amount of shares being thawed\n * @param thawingUntil The timestamp until the stake is thawed\n * @param thawRequestId The ID of the thaw request\n * @param nonce The nonce of the thaw request\n */\n event ThawRequestCreated(\n IHorizonStakingTypes.ThawRequestType indexed requestType,\n address indexed serviceProvider,\n address indexed verifier,\n address owner,\n uint256 shares,\n uint64 thawingUntil,\n bytes32 thawRequestId,\n uint256 nonce\n );\n\n /**\n * @notice Emitted when a thaw request is fulfilled, meaning the stake is released.\n * @param requestType The type of thaw request\n * @param thawRequestId The ID of the thaw request\n * @param tokens The amount of tokens being released\n * @param shares The amount of shares being released\n * @param thawingUntil The timestamp until the stake has thawed\n * @param valid Whether the thaw request was valid at the time of fulfillment\n */\n event ThawRequestFulfilled(\n IHorizonStakingTypes.ThawRequestType indexed requestType,\n bytes32 indexed thawRequestId,\n uint256 tokens,\n uint256 shares,\n uint64 thawingUntil,\n bool valid\n );\n\n /**\n * @notice Emitted when a series of thaw requests are fulfilled.\n * @param serviceProvider The address of the service provider\n * @param verifier The address of the verifier\n * @param owner The address of the owner of the thaw requests\n * @param thawRequestsFulfilled The number of thaw requests fulfilled\n * @param tokens The total amount of tokens being released\n * @param requestType The type of thaw request\n */\n event ThawRequestsFulfilled(\n IHorizonStakingTypes.ThawRequestType indexed requestType,\n address indexed serviceProvider,\n address indexed verifier,\n address owner,\n uint256 thawRequestsFulfilled,\n uint256 tokens\n );\n\n // -- Events: governance --\n\n /**\n * @notice Emitted when the global maximum thawing period allowed for provisions is set.\n * @param maxThawingPeriod The new maximum thawing period\n */\n event MaxThawingPeriodSet(uint64 maxThawingPeriod);\n\n /**\n * @notice Emitted when a verifier is allowed or disallowed to be used for locked provisions.\n * @param verifier The address of the verifier\n * @param allowed Whether the verifier is allowed or disallowed\n */\n event AllowedLockedVerifierSet(address indexed verifier, bool allowed);\n\n /**\n * @notice Emitted when the legacy global thawing period is set to zero.\n * @dev This marks the end of the transition period.\n */\n event ThawingPeriodCleared();\n\n /**\n * @notice Emitted when the delegation slashing global flag is set.\n */\n event DelegationSlashingEnabled();\n\n // -- Errors: tokens\n\n /**\n * @notice Thrown when operating a zero token amount is not allowed.\n */\n error HorizonStakingInvalidZeroTokens();\n\n /**\n * @notice Thrown when a minimum token amount is required to operate but it's not met.\n * @param tokens The actual token amount\n * @param minRequired The minimum required token amount\n */\n error HorizonStakingInsufficientTokens(uint256 tokens, uint256 minRequired);\n\n /**\n * @notice Thrown when the amount of tokens exceeds the maximum allowed to operate.\n * @param tokens The actual token amount\n * @param maxTokens The maximum allowed token amount\n */\n error HorizonStakingTooManyTokens(uint256 tokens, uint256 maxTokens);\n\n // -- Errors: provision --\n\n /**\n * @notice Thrown when attempting to operate with a provision that does not exist.\n * @param serviceProvider The service provider address\n * @param verifier The verifier address\n */\n error HorizonStakingInvalidProvision(address serviceProvider, address verifier);\n\n /**\n * @notice Thrown when the caller is not authorized to operate on a provision.\n * @param caller The caller address\n * @param serviceProvider The service provider address\n * @param verifier The verifier address\n */\n error HorizonStakingNotAuthorized(address serviceProvider, address verifier, address caller);\n\n /**\n * @notice Thrown when attempting to create a provision with a verifier other than the\n * subgraph data service. This restriction only applies during the transition period.\n * @param verifier The verifier address\n */\n error HorizonStakingInvalidVerifier(address verifier);\n\n /**\n * @notice Thrown when attempting to create a provision with an invalid maximum verifier cut.\n * @param maxVerifierCut The maximum verifier cut\n */\n error HorizonStakingInvalidMaxVerifierCut(uint32 maxVerifierCut);\n\n /**\n * @notice Thrown when attempting to create a provision with an invalid thawing period.\n * @param thawingPeriod The thawing period\n * @param maxThawingPeriod The maximum `thawingPeriod` allowed\n */\n error HorizonStakingInvalidThawingPeriod(uint64 thawingPeriod, uint64 maxThawingPeriod);\n\n /**\n * @notice Thrown when attempting to create a provision for a data service that already has a provision.\n */\n error HorizonStakingProvisionAlreadyExists();\n\n // -- Errors: stake --\n\n /**\n * @notice Thrown when the service provider has insufficient idle stake to operate.\n * @param tokens The actual token amount\n * @param minTokens The minimum required token amount\n */\n error HorizonStakingInsufficientIdleStake(uint256 tokens, uint256 minTokens);\n\n /**\n * @notice Thrown during the transition period when the service provider has insufficient stake to\n * cover their existing legacy allocations.\n * @param tokens The actual token amount\n * @param minTokens The minimum required token amount\n */\n error HorizonStakingInsufficientStakeForLegacyAllocations(uint256 tokens, uint256 minTokens);\n\n // -- Errors: delegation --\n\n /**\n * @notice Thrown when delegation shares obtained are below the expected amount.\n * @param shares The actual share amount\n * @param minShares The minimum required share amount\n */\n error HorizonStakingSlippageProtection(uint256 shares, uint256 minShares);\n\n /**\n * @notice Thrown when operating a zero share amount is not allowed.\n */\n error HorizonStakingInvalidZeroShares();\n\n /**\n * @notice Thrown when a minimum share amount is required to operate but it's not met.\n * @param shares The actual share amount\n * @param minShares The minimum required share amount\n */\n error HorizonStakingInsufficientShares(uint256 shares, uint256 minShares);\n\n /**\n * @notice Thrown when as a result of slashing delegation pool has no tokens but has shares.\n * @param serviceProvider The service provider address\n * @param verifier The verifier address\n */\n error HorizonStakingInvalidDelegationPoolState(address serviceProvider, address verifier);\n\n /**\n * @notice Thrown when attempting to operate with a delegation pool that does not exist.\n * @param serviceProvider The service provider address\n * @param verifier The verifier address\n */\n error HorizonStakingInvalidDelegationPool(address serviceProvider, address verifier);\n\n /**\n * @notice Thrown when the minimum token amount required for delegation is not met.\n * @param tokens The actual token amount\n * @param minTokens The minimum required token amount\n */\n error HorizonStakingInsufficientDelegationTokens(uint256 tokens, uint256 minTokens);\n\n /**\n * @notice Thrown when attempting to redelegate with a serivce provider that is the zero address.\n */\n error HorizonStakingInvalidServiceProviderZeroAddress();\n\n /**\n * @notice Thrown when attempting to redelegate with a verifier that is the zero address.\n */\n error HorizonStakingInvalidVerifierZeroAddress();\n\n // -- Errors: thaw requests --\n\n /**\n * @notice Thrown when attempting to fulfill a thaw request but there is nothing thawing.\n */\n error HorizonStakingNothingThawing();\n\n /**\n * @notice Thrown when a service provider has too many thaw requests.\n */\n error HorizonStakingTooManyThawRequests();\n\n /**\n * @notice Thrown when attempting to withdraw tokens that have not thawed (legacy undelegate).\n */\n error HorizonStakingNothingToWithdraw();\n\n // -- Errors: misc --\n /**\n * @notice Thrown during the transition period when attempting to withdraw tokens that are still thawing.\n * @dev Note this thawing refers to the global thawing period applied to legacy allocated tokens,\n * it does not refer to thaw requests.\n * @param until The block number until the stake is locked\n */\n error HorizonStakingStillThawing(uint256 until);\n\n /**\n * @notice Thrown when a service provider attempts to operate on verifiers that are not allowed.\n * @dev Only applies to stake from locked wallets.\n * @param verifier The verifier address\n */\n error HorizonStakingVerifierNotAllowed(address verifier);\n\n /**\n * @notice Thrown when a service provider attempts to change their own operator access.\n */\n error HorizonStakingCallerIsServiceProvider();\n\n /**\n * @notice Thrown when trying to set a delegation fee cut that is not valid.\n * @param feeCut The fee cut\n */\n error HorizonStakingInvalidDelegationFeeCut(uint256 feeCut);\n\n /**\n * @notice Thrown when a legacy slash fails.\n */\n error HorizonStakingLegacySlashFailed();\n\n /**\n * @notice Thrown when there attempting to slash a provision with no tokens to slash.\n */\n error HorizonStakingNoTokensToSlash();\n\n // -- Functions --\n\n /**\n * @notice Deposit tokens on the staking contract.\n * @dev Pulls tokens from the caller.\n *\n * Requirements:\n * - `_tokens` cannot be zero.\n * - Caller must have previously approved this contract to pull tokens from their balance.\n *\n * Emits a {HorizonStakeDeposited} event.\n *\n * @param tokens Amount of tokens to stake\n */\n function stake(uint256 tokens) external;\n\n /**\n * @notice Deposit tokens on the service provider stake, on behalf of the service provider.\n * @dev Pulls tokens from the caller.\n *\n * Requirements:\n * - `_tokens` cannot be zero.\n * - Caller must have previously approved this contract to pull tokens from their balance.\n *\n * Emits a {HorizonStakeDeposited} event.\n *\n * @param serviceProvider Address of the service provider\n * @param tokens Amount of tokens to stake\n */\n function stakeTo(address serviceProvider, uint256 tokens) external;\n\n /**\n * @notice Deposit tokens on the service provider stake, on behalf of the service provider,\n * provisioned to a specific verifier.\n * @dev This function can be called by the service provider, by an authorized operator or by the verifier itself.\n * @dev Requirements:\n * - The `serviceProvider` must have previously provisioned stake to `verifier`.\n * - `_tokens` cannot be zero.\n * - Caller must have previously approved this contract to pull tokens from their balance.\n *\n * Emits {HorizonStakeDeposited} and {ProvisionIncreased} events.\n *\n * @param serviceProvider Address of the service provider\n * @param verifier Address of the verifier\n * @param tokens Amount of tokens to stake\n */\n function stakeToProvision(address serviceProvider, address verifier, uint256 tokens) external;\n\n /**\n * @notice Move idle stake back to the owner's account.\n * Stake is removed from the protocol:\n * - During the transition period it's locked for a period of time before it can be withdrawn\n * by calling {withdraw}.\n * - After the transition period it's immediately withdrawn.\n * Note that after the transition period if there are tokens still locked they will have to be\n * withdrawn by calling {withdraw}.\n * @dev Requirements:\n * - `_tokens` cannot be zero.\n * - `_serviceProvider` must have enough idle stake to cover the staking amount and any\n * legacy allocation.\n *\n * Emits a {HorizonStakeLocked} event during the transition period.\n * Emits a {HorizonStakeWithdrawn} event after the transition period.\n *\n * @param tokens Amount of tokens to unstake\n */\n function unstake(uint256 tokens) external;\n\n /**\n * @notice Withdraw service provider tokens once the thawing period (initiated by {unstake}) has passed.\n * All thawed tokens are withdrawn.\n * @dev This is only needed during the transition period while we still have\n * a global lock. After that, unstake() will automatically withdraw.\n */\n function withdraw() external;\n\n /**\n * @notice Provision stake to a verifier. The tokens will be locked with a thawing period\n * and will be slashable by the verifier. This is the main mechanism to provision stake to a data\n * service, where the data service is the verifier.\n * This function can be called by the service provider or by an operator authorized by the provider\n * for this specific verifier.\n * @dev During the transition period, only the subgraph data service can be used as a verifier. This\n * prevents an escape hatch for legacy allocation stake.\n * @dev Requirements:\n * - `tokens` cannot be zero.\n * - The `serviceProvider` must have enough idle stake to cover the tokens to provision.\n * - `maxVerifierCut` must be a valid PPM.\n * - `thawingPeriod` must be less than or equal to `_maxThawingPeriod`.\n *\n * Emits a {ProvisionCreated} event.\n *\n * @param serviceProvider The service provider address\n * @param verifier The verifier address for which the tokens are provisioned (who will be able to slash the tokens)\n * @param tokens The amount of tokens that will be locked and slashable\n * @param maxVerifierCut The maximum cut, expressed in PPM, that a verifier can transfer instead of burning when slashing\n * @param thawingPeriod The period in seconds that the tokens will be thawing before they can be removed from the provision\n */\n function provision(\n address serviceProvider,\n address verifier,\n uint256 tokens,\n uint32 maxVerifierCut,\n uint64 thawingPeriod\n ) external;\n\n /**\n * @notice Adds tokens from the service provider's idle stake to a provision\n * @dev\n *\n * Requirements:\n * - The `serviceProvider` must have previously provisioned stake to `verifier`.\n * - `tokens` cannot be zero.\n * - The `serviceProvider` must have enough idle stake to cover the tokens to add.\n *\n * Emits a {ProvisionIncreased} event.\n *\n * @param serviceProvider The service provider address\n * @param verifier The verifier address\n * @param tokens The amount of tokens to add to the provision\n */\n function addToProvision(address serviceProvider, address verifier, uint256 tokens) external;\n\n /**\n * @notice Start thawing tokens to remove them from a provision.\n * This function can be called by the service provider or by an operator authorized by the provider\n * for this specific verifier.\n *\n * Note that removing tokens from a provision is a two step process:\n * - First the tokens are thawed using this function.\n * - Then after the thawing period, the tokens are removed from the provision using {deprovision}\n * or {reprovision}.\n *\n * @dev Requirements:\n * - The provision must have enough tokens available to thaw.\n * - `tokens` cannot be zero.\n *\n * Emits {ProvisionThawed} and {ThawRequestCreated} events.\n *\n * @param serviceProvider The service provider address\n * @param verifier The verifier address for which the tokens are provisioned\n * @param tokens The amount of tokens to thaw\n * @return The ID of the thaw request\n */\n function thaw(address serviceProvider, address verifier, uint256 tokens) external returns (bytes32);\n\n /**\n * @notice Remove tokens from a provision and move them back to the service provider's idle stake.\n * @dev The parameter `nThawRequests` can be set to a non zero value to fulfill a specific number of thaw\n * requests in the event that fulfilling all of them results in a gas limit error. Otherwise, the function\n * will attempt to fulfill all thaw requests until the first one that is not yet expired is found.\n *\n * Requirements:\n * - Must have previously initiated a thaw request using {thaw}.\n *\n * Emits {ThawRequestFulfilled}, {ThawRequestsFulfilled} and {TokensDeprovisioned} events.\n *\n * @param serviceProvider The service provider address\n * @param verifier The verifier address\n * @param nThawRequests The number of thaw requests to fulfill. Set to 0 to fulfill all thaw requests.\n */\n function deprovision(address serviceProvider, address verifier, uint256 nThawRequests) external;\n\n /**\n * @notice Move already thawed stake from one provision into another provision\n * This function can be called by the service provider or by an operator authorized by the provider\n * for the two corresponding verifiers.\n * @dev Requirements:\n * - Must have previously initiated a thaw request using {thaw}.\n * - `tokens` cannot be zero.\n * - The `serviceProvider` must have previously provisioned stake to `newVerifier`.\n * - The `serviceProvider` must have enough idle stake to cover the tokens to add.\n *\n * Emits {ThawRequestFulfilled}, {ThawRequestsFulfilled}, {TokensDeprovisioned} and {ProvisionIncreased}\n * events.\n *\n * @param serviceProvider The service provider address\n * @param oldVerifier The verifier address for which the tokens are currently provisioned\n * @param newVerifier The verifier address for which the tokens will be provisioned\n * @param nThawRequests The number of thaw requests to fulfill. Set to 0 to fulfill all thaw requests.\n */\n function reprovision(\n address serviceProvider,\n address oldVerifier,\n address newVerifier,\n uint256 nThawRequests\n ) external;\n\n /**\n * @notice Stages a provision parameter update. Note that the change is not effective until the verifier calls\n * {acceptProvisionParameters}. Calling this function is a no-op if the new parameters are the same as the current\n * ones.\n * @dev This two step update process prevents the service provider from changing the parameters\n * without the verifier's consent.\n *\n * Requirements:\n * - `thawingPeriod` must be less than or equal to `_maxThawingPeriod`. Note that if `_maxThawingPeriod` changes the\n * function will not revert if called with the same thawing period as the current one.\n *\n * Emits a {ProvisionParametersStaged} event if at least one of the parameters changed.\n *\n * @param serviceProvider The service provider address\n * @param verifier The verifier address\n * @param maxVerifierCut The proposed maximum cut, expressed in PPM of the slashed amount, that a verifier can take for\n * themselves when slashing\n * @param thawingPeriod The proposed period in seconds that the tokens will be thawing before they can be removed from\n * the provision\n */\n function setProvisionParameters(\n address serviceProvider,\n address verifier,\n uint32 maxVerifierCut,\n uint64 thawingPeriod\n ) external;\n\n /**\n * @notice Accepts a staged provision parameter update.\n * @dev Only the provision's verifier can call this function.\n *\n * Emits a {ProvisionParametersSet} event.\n *\n * @param serviceProvider The service provider address\n */\n function acceptProvisionParameters(address serviceProvider) external;\n\n /**\n * @notice Delegate tokens to a provision.\n * @dev Requirements:\n * - `tokens` cannot be zero.\n * - Caller must have previously approved this contract to pull tokens from their balance.\n * - The provision must exist.\n *\n * Emits a {TokensDelegated} event.\n *\n * @param serviceProvider The service provider address\n * @param verifier The verifier address\n * @param tokens The amount of tokens to delegate\n * @param minSharesOut The minimum amount of shares to accept, slippage protection.\n */\n function delegate(address serviceProvider, address verifier, uint256 tokens, uint256 minSharesOut) external;\n\n /**\n * @notice Add tokens to a delegation pool without issuing shares.\n * Used by data services to pay delegation fees/rewards.\n * Delegators SHOULD NOT call this function.\n *\n * @dev Requirements:\n * - `tokens` cannot be zero.\n * - Caller must have previously approved this contract to pull tokens from their balance.\n *\n * Emits a {TokensToDelegationPoolAdded} event.\n *\n * @param serviceProvider The service provider address\n * @param verifier The verifier address for which the tokens are provisioned\n * @param tokens The amount of tokens to add to the delegation pool\n */\n function addToDelegationPool(address serviceProvider, address verifier, uint256 tokens) external;\n\n /**\n * @notice Undelegate tokens from a provision and start thawing them.\n * Note that undelegating tokens from a provision is a two step process:\n * - First the tokens are thawed using this function.\n * - Then after the thawing period, the tokens are removed from the provision using {withdrawDelegated}.\n *\n * Requirements:\n * - `shares` cannot be zero.\n *\n * Emits a {TokensUndelegated} and {ThawRequestCreated} event.\n *\n * @param serviceProvider The service provider address\n * @param verifier The verifier address\n * @param shares The amount of shares to undelegate\n * @return The ID of the thaw request\n */\n function undelegate(address serviceProvider, address verifier, uint256 shares) external returns (bytes32);\n\n /**\n * @notice Withdraw undelegated tokens from a provision after thawing.\n * @dev The parameter `nThawRequests` can be set to a non zero value to fulfill a specific number of thaw\n * requests in the event that fulfilling all of them results in a gas limit error. Otherwise, the function\n * will attempt to fulfill all thaw requests until the first one that is not yet expired is found.\n * @dev If the delegation pool was completely slashed before withdrawing, calling this function will fulfill\n * the thaw requests with an amount equal to zero.\n *\n * Requirements:\n * - Must have previously initiated a thaw request using {undelegate}.\n *\n * Emits {ThawRequestFulfilled}, {ThawRequestsFulfilled} and {DelegatedTokensWithdrawn} events.\n *\n * @param serviceProvider The service provider address\n * @param verifier The verifier address\n * @param nThawRequests The number of thaw requests to fulfill. Set to 0 to fulfill all thaw requests.\n */\n function withdrawDelegated(address serviceProvider, address verifier, uint256 nThawRequests) external;\n\n /**\n * @notice Re-delegate undelegated tokens from a provision after thawing to a `newServiceProvider` and `newVerifier`.\n * @dev The parameter `nThawRequests` can be set to a non zero value to fulfill a specific number of thaw\n * requests in the event that fulfilling all of them results in a gas limit error.\n *\n * Requirements:\n * - Must have previously initiated a thaw request using {undelegate}.\n * - `newServiceProvider` and `newVerifier` must not be the zero address.\n * - `newServiceProvider` must have previously provisioned stake to `newVerifier`.\n *\n * Emits {ThawRequestFulfilled}, {ThawRequestsFulfilled} and {DelegatedTokensWithdrawn} events.\n *\n * @param oldServiceProvider The old service provider address\n * @param oldVerifier The old verifier address\n * @param newServiceProvider The address of a new service provider\n * @param newVerifier The address of a new verifier\n * @param minSharesForNewProvider The minimum amount of shares to accept for the new service provider\n * @param nThawRequests The number of thaw requests to fulfill. Set to 0 to fulfill all thaw requests.\n */\n function redelegate(\n address oldServiceProvider,\n address oldVerifier,\n address newServiceProvider,\n address newVerifier,\n uint256 minSharesForNewProvider,\n uint256 nThawRequests\n ) external;\n\n /**\n * @notice Set the fee cut for a verifier on a specific payment type.\n * @dev Emits a {DelegationFeeCutSet} event.\n * @param serviceProvider The service provider address\n * @param verifier The verifier address\n * @param paymentType The payment type for which the fee cut is set, as defined in {IGraphPayments}\n * @param feeCut The fee cut to set, in PPM\n */\n function setDelegationFeeCut(\n address serviceProvider,\n address verifier,\n IGraphPayments.PaymentTypes paymentType,\n uint256 feeCut\n ) external;\n\n /**\n * @notice Delegate tokens to the subgraph data service provision.\n * This function is for backwards compatibility with the legacy staking contract.\n * It only allows delegating to the subgraph data service and DOES NOT have slippage protection.\n * @dev See {delegate}.\n * @param serviceProvider The service provider address\n * @param tokens The amount of tokens to delegate\n */\n function delegate(address serviceProvider, uint256 tokens) external;\n\n /**\n * @notice Undelegate tokens from the subgraph data service provision and start thawing them.\n * This function is for backwards compatibility with the legacy staking contract.\n * It only allows undelegating from the subgraph data service.\n * @dev See {undelegate}.\n * @param serviceProvider The service provider address\n * @param shares The amount of shares to undelegate\n */\n function undelegate(address serviceProvider, uint256 shares) external;\n\n /**\n * @notice Withdraw undelegated tokens from the subgraph data service provision after thawing.\n * This function is for backwards compatibility with the legacy staking contract.\n * It only allows withdrawing tokens undelegated before horizon upgrade.\n * @dev See {delegate}.\n * @param serviceProvider The service provider address\n * @param deprecated Deprecated parameter kept for backwards compatibility\n * @return The amount of tokens withdrawn\n */\n function withdrawDelegated(\n address serviceProvider,\n address deprecated // kept for backwards compatibility\n ) external returns (uint256);\n\n /**\n * @notice Slash a service provider. This can only be called by a verifier to which\n * the provider has provisioned stake, and up to the amount of tokens they have provisioned.\n * If the service provider's stake is not enough, the associated delegation pool might be slashed\n * depending on the value of the global delegation slashing flag.\n *\n * Part of the slashed tokens are sent to the `verifierDestination` as a reward.\n *\n * @dev Requirements:\n * - `tokens` must be less than or equal to the amount of tokens provisioned by the service provider.\n * - `tokensVerifier` must be less than the provision's tokens times the provision's maximum verifier cut.\n *\n * Emits a {ProvisionSlashed} and {VerifierTokensSent} events.\n * Emits a {DelegationSlashed} or {DelegationSlashingSkipped} event depending on the global delegation slashing\n * flag.\n *\n * @param serviceProvider The service provider to slash\n * @param tokens The amount of tokens to slash\n * @param tokensVerifier The amount of tokens to transfer instead of burning\n * @param verifierDestination The address to transfer the verifier cut to\n */\n function slash(\n address serviceProvider,\n uint256 tokens,\n uint256 tokensVerifier,\n address verifierDestination\n ) external;\n\n /**\n * @notice Provision stake to a verifier using locked tokens (i.e. from GraphTokenLockWallets).\n * @dev See {provision}.\n *\n * Additional requirements:\n * - The `verifier` must be allowed to be used for locked provisions.\n *\n * @param serviceProvider The service provider address\n * @param verifier The verifier address for which the tokens are provisioned (who will be able to slash the tokens)\n * @param tokens The amount of tokens that will be locked and slashable\n * @param maxVerifierCut The maximum cut, expressed in PPM, that a verifier can transfer instead of burning when slashing\n * @param thawingPeriod The period in seconds that the tokens will be thawing before they can be removed from the provision\n */\n function provisionLocked(\n address serviceProvider,\n address verifier,\n uint256 tokens,\n uint32 maxVerifierCut,\n uint64 thawingPeriod\n ) external;\n\n /**\n * @notice Authorize or unauthorize an address to be an operator for the caller on a verifier.\n *\n * @dev See {setOperator}.\n * Additional requirements:\n * - The `verifier` must be allowed to be used for locked provisions.\n *\n * @param verifier The verifier / data service on which they'll be allowed to operate\n * @param operator Address to authorize or unauthorize\n * @param allowed Whether the operator is authorized or not\n */\n function setOperatorLocked(address verifier, address operator, bool allowed) external;\n\n /**\n * @notice Sets a verifier as a globally allowed verifier for locked provisions.\n * @dev This function can only be called by the contract governor, it's used to maintain\n * a whitelist of verifiers that do not allow the stake from a locked wallet to escape the lock.\n * @dev Emits a {AllowedLockedVerifierSet} event.\n * @param verifier The verifier address\n * @param allowed Whether the verifier is allowed or not\n */\n function setAllowedLockedVerifier(address verifier, bool allowed) external;\n\n /**\n * @notice Set the global delegation slashing flag to true.\n * @dev This function can only be called by the contract governor.\n */\n function setDelegationSlashingEnabled() external;\n\n /**\n * @notice Clear the legacy global thawing period.\n * This signifies the end of the transition period, after which no legacy allocations should be left.\n * @dev This function can only be called by the contract governor.\n * @dev Emits a {ThawingPeriodCleared} event.\n */\n function clearThawingPeriod() external;\n\n /**\n * @notice Sets the global maximum thawing period allowed for provisions.\n * @param maxThawingPeriod The new maximum thawing period, in seconds\n */\n function setMaxThawingPeriod(uint64 maxThawingPeriod) external;\n\n /**\n * @notice Authorize or unauthorize an address to be an operator for the caller on a data service.\n * @dev Emits a {OperatorSet} event.\n * @param verifier The verifier / data service on which they'll be allowed to operate\n * @param operator Address to authorize or unauthorize\n * @param allowed Whether the operator is authorized or not\n */\n function setOperator(address verifier, address operator, bool allowed) external;\n\n /**\n * @notice Check if an operator is authorized for the caller on a specific verifier / data service.\n * @param serviceProvider The service provider on behalf of whom they're claiming to act\n * @param verifier The verifier / data service on which they're claiming to act\n * @param operator The address to check for auth\n * @return Whether the operator is authorized or not\n */\n function isAuthorized(address serviceProvider, address verifier, address operator) external view returns (bool);\n\n /**\n * @notice Get the address of the staking extension.\n * @return The address of the staking extension\n */\n function getStakingExtension() external view returns (address);\n}\n" + }, + "@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingTypes.sol": { + "content": "// SPDX-License-Identifier: GPL-2.0-or-later\n\npragma solidity 0.8.27;\n\n/**\n * @title Defines the data types used in the Horizon staking contract\n * @dev In order to preserve storage compatibility some data structures keep deprecated fields.\n * These structures have then two representations, an internal one used by the contract storage and a public one.\n * Getter functions should retrieve internal representations, remove deprecated fields and return the public representation.\n * @custom:security-contact Please email security+contracts@thegraph.com if you find any\n * bugs. We may have an active bug bounty program.\n */\ninterface IHorizonStakingTypes {\n /**\n * @notice Represents stake assigned to a specific verifier/data service.\n * Provisioned stake is locked and can be used as economic security by a data service.\n * @param tokens Service provider tokens in the provision (does not include delegated tokens)\n * @param tokensThawing Service provider tokens that are being thawed (and will stop being slashable soon)\n * @param sharesThawing Shares representing the thawing tokens\n * @param maxVerifierCut Max amount that can be taken by the verifier when slashing, expressed in parts-per-million of the amount slashed\n * @param thawingPeriod Time, in seconds, tokens must thaw before being withdrawn\n * @param createdAt Timestamp when the provision was created\n * @param maxVerifierCutPending Pending value for `maxVerifierCut`. Verifier needs to accept it before it becomes active.\n * @param thawingPeriodPending Pending value for `thawingPeriod`. Verifier needs to accept it before it becomes active.\n * @param lastParametersStagedAt Timestamp when the provision parameters were last staged. Can be used by data service implementation to\n * implement arbitrary parameter update logic.\n * @param thawingNonce Value of the current thawing nonce. Thaw requests with older nonces are invalid.\n */\n struct Provision {\n uint256 tokens;\n uint256 tokensThawing;\n uint256 sharesThawing;\n uint32 maxVerifierCut;\n uint64 thawingPeriod;\n uint64 createdAt;\n uint32 maxVerifierCutPending;\n uint64 thawingPeriodPending;\n uint256 lastParametersStagedAt;\n uint256 thawingNonce;\n }\n\n /**\n * @notice Public representation of a service provider.\n * @dev See {ServiceProviderInternal} for the actual storage representation\n * @param tokensStaked Total amount of tokens on the provider stake (only staked by the provider, includes all provisions)\n * @param tokensProvisioned Total amount of tokens locked in provisions (only staked by the provider)\n */\n struct ServiceProvider {\n uint256 tokensStaked;\n uint256 tokensProvisioned;\n }\n\n /**\n * @notice Internal representation of a service provider.\n * @dev It contains deprecated fields from the `Indexer` struct to maintain storage compatibility.\n * @param tokensStaked Total amount of tokens on the provider stake (only staked by the provider, includes all provisions)\n * @param __DEPRECATED_tokensAllocated (Deprecated) Tokens used in allocations\n * @param __DEPRECATED_tokensLocked (Deprecated) Tokens locked for withdrawal subject to thawing period\n * @param __DEPRECATED_tokensLockedUntil (Deprecated) Block when locked tokens can be withdrawn\n * @param tokensProvisioned Total amount of tokens locked in provisions (only staked by the provider)\n */\n struct ServiceProviderInternal {\n uint256 tokensStaked;\n uint256 __DEPRECATED_tokensAllocated;\n uint256 __DEPRECATED_tokensLocked;\n uint256 __DEPRECATED_tokensLockedUntil;\n uint256 tokensProvisioned;\n }\n\n /**\n * @notice Public representation of a delegation pool.\n * @dev See {DelegationPoolInternal} for the actual storage representation\n * @param tokens Total tokens as pool reserves\n * @param shares Total shares minted in the pool\n * @param tokensThawing Tokens thawing in the pool\n * @param sharesThawing Shares representing the thawing tokens\n * @param thawingNonce Value of the current thawing nonce. Thaw requests with older nonces are invalid.\n */\n struct DelegationPool {\n uint256 tokens;\n uint256 shares;\n uint256 tokensThawing;\n uint256 sharesThawing;\n uint256 thawingNonce;\n }\n\n /**\n * @notice Internal representation of a delegation pool.\n * @dev It contains deprecated fields from the previous version of the `DelegationPool` struct\n * to maintain storage compatibility.\n * @param __DEPRECATED_cooldownBlocks (Deprecated) Time, in blocks, an indexer must wait before updating delegation parameters\n * @param __DEPRECATED_indexingRewardCut (Deprecated) Percentage of indexing rewards for the service provider, in PPM\n * @param __DEPRECATED_queryFeeCut (Deprecated) Percentage of query fees for the service provider, in PPM\n * @param __DEPRECATED_updatedAtBlock (Deprecated) Block when the delegation parameters were last updated\n * @param tokens Total tokens as pool reserves\n * @param shares Total shares minted in the pool\n * @param delegators Delegation details by delegator\n * @param tokensThawing Tokens thawing in the pool\n * @param sharesThawing Shares representing the thawing tokens\n * @param thawingNonce Value of the current thawing nonce. Thaw requests with older nonces are invalid.\n */\n struct DelegationPoolInternal {\n uint32 __DEPRECATED_cooldownBlocks;\n uint32 __DEPRECATED_indexingRewardCut;\n uint32 __DEPRECATED_queryFeeCut;\n uint256 __DEPRECATED_updatedAtBlock;\n uint256 tokens;\n uint256 shares;\n mapping(address delegator => DelegationInternal delegation) delegators;\n uint256 tokensThawing;\n uint256 sharesThawing;\n uint256 thawingNonce;\n }\n\n /**\n * @notice Public representation of delegation details.\n * @dev See {DelegationInternal} for the actual storage representation\n * @param shares Shares owned by a delegator in the pool\n */\n struct Delegation {\n uint256 shares;\n }\n\n /**\n * @notice Internal representation of delegation details.\n * @dev It contains deprecated fields from the previous version of the `Delegation` struct\n * to maintain storage compatibility.\n * @param shares Shares owned by the delegator in the pool\n * @param __DEPRECATED_tokensLocked Tokens locked for undelegation\n * @param __DEPRECATED_tokensLockedUntil Epoch when locked tokens can be withdrawn\n */\n struct DelegationInternal {\n uint256 shares;\n uint256 __DEPRECATED_tokensLocked;\n uint256 __DEPRECATED_tokensLockedUntil;\n }\n\n /**\n * @dev Enum to specify the type of thaw request.\n * @param Provision Represents a thaw request for a provision.\n * @param Delegation Represents a thaw request for a delegation.\n */\n enum ThawRequestType {\n Provision,\n Delegation\n }\n\n /**\n * @notice Details of a stake thawing operation.\n * @dev ThawRequests are stored in linked lists by service provider/delegator,\n * ordered by creation timestamp.\n * @param shares Shares that represent the tokens being thawed\n * @param thawingUntil The timestamp when the thawed funds can be removed from the provision\n * @param nextRequest Id of the next thaw request in the linked list\n * @param thawingNonce Used to invalidate unfulfilled thaw requests\n */\n struct ThawRequest {\n uint256 shares;\n uint64 thawingUntil;\n bytes32 nextRequest;\n uint256 thawingNonce;\n }\n\n /**\n * @notice Parameters to fulfill thaw requests.\n * @dev This struct is used to avoid stack too deep error in the `fulfillThawRequests` function.\n * @param requestType The type of thaw request (Provision or Delegation)\n * @param serviceProvider The address of the service provider\n * @param verifier The address of the verifier\n * @param owner The address of the owner of the thaw request\n * @param tokensThawing The current amount of tokens already thawing\n * @param sharesThawing The current amount of shares already thawing\n * @param nThawRequests The number of thaw requests to fulfill. If set to 0, all thaw requests are fulfilled.\n * @param thawingNonce The current valid thawing nonce. Any thaw request with a different nonce is invalid and should be ignored.\n */\n struct FulfillThawRequestsParams {\n ThawRequestType requestType;\n address serviceProvider;\n address verifier;\n address owner;\n uint256 tokensThawing;\n uint256 sharesThawing;\n uint256 nThawRequests;\n uint256 thawingNonce;\n }\n\n /**\n * @notice Results of the traversal of thaw requests.\n * @dev This struct is used to avoid stack too deep error in the `fulfillThawRequests` function.\n * @param requestsFulfilled The number of thaw requests fulfilled\n * @param tokensThawed The total amount of tokens thawed\n * @param tokensThawing The total amount of tokens thawing\n * @param sharesThawing The total amount of shares thawing\n */\n struct TraverseThawRequestsResults {\n uint256 requestsFulfilled;\n uint256 tokensThawed;\n uint256 tokensThawing;\n uint256 sharesThawing;\n }\n}\n" + }, + "@graphprotocol/horizon/contracts/interfaces/IPaymentsCollector.sol": { + "content": "// SPDX-License-Identifier: GPL-2.0-or-later\n\npragma solidity 0.8.27;\n\nimport { IGraphPayments } from \"./IGraphPayments.sol\";\n\n/**\n * @title Interface for a payments collector contract as defined by Graph Horizon payments protocol\n * @notice Contracts implementing this interface can be used with the payments protocol. First, a payer must\n * approve the collector to collect payments on their behalf. Only then can payment collection be initiated\n * using the collector contract.\n *\n * @dev It's important to note that it's the collector contract's responsibility to validate the payment\n * request is legitimate.\n * @custom:security-contact Please email security+contracts@thegraph.com if you find any\n * bugs. We may have an active bug bounty program.\n */\ninterface IPaymentsCollector {\n /**\n * @notice Emitted when a payment is collected\n * @param paymentType The payment type collected as defined by {IGraphPayments}\n * @param collectionId The id for the collection. Can be used at the discretion of the collector to group multiple payments.\n * @param payer The address of the payer\n * @param receiver The address of the receiver\n * @param dataService The address of the data service\n * @param tokens The amount of tokens being collected\n */\n event PaymentCollected(\n IGraphPayments.PaymentTypes paymentType,\n bytes32 indexed collectionId,\n address indexed payer,\n address receiver,\n address indexed dataService,\n uint256 tokens\n );\n\n /**\n * @notice Initiate a payment collection through the payments protocol\n * @dev This function should require the caller to present some form of evidence of the payer's debt to\n * the receiver. The collector should validate this evidence and, if valid, collect the payment.\n *\n * Emits a {PaymentCollected} event\n *\n * @param paymentType The payment type to collect, as defined by {IGraphPayments}\n * @param data Additional data required for the payment collection. Will vary depending on the collector\n * implementation.\n * @return The amount of tokens collected\n */\n function collect(IGraphPayments.PaymentTypes paymentType, bytes memory data) external returns (uint256);\n}\n" + }, + "@graphprotocol/horizon/contracts/interfaces/IPaymentsEscrow.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0-or-later\npragma solidity 0.8.27;\n\nimport { IGraphPayments } from \"./IGraphPayments.sol\";\n\n/**\n * @title Interface for the {PaymentsEscrow} contract\n * @notice This contract is part of the Graph Horizon payments protocol. It holds the funds (GRT)\n * for payments made through the payments protocol for services provided\n * via a Graph Horizon data service.\n *\n * Payers deposit funds on the escrow, signalling their ability to pay for a service, and only\n * being able to retrieve them after a thawing period. Receivers collect funds from the escrow,\n * provided the payer has authorized them. The payer authorization is delegated to a payment\n * collector contract which implements the {IPaymentsCollector} interface.\n * @custom:security-contact Please email security+contracts@thegraph.com if you find any\n * bugs. We may have an active bug bounty program.\n */\ninterface IPaymentsEscrow {\n /**\n * @notice Escrow account for a payer-collector-receiver tuple\n * @param balance The total token balance for the payer-collector-receiver tuple\n * @param tokensThawing The amount of tokens currently being thawed\n * @param thawEndTimestamp The timestamp at which thawing period ends (zero if not thawing)\n */\n struct EscrowAccount {\n uint256 balance;\n uint256 tokensThawing;\n uint256 thawEndTimestamp;\n }\n\n /**\n * @notice Emitted when a payer deposits funds into the escrow for a payer-collector-receiver tuple\n * @param payer The address of the payer\n * @param collector The address of the collector\n * @param receiver The address of the receiver\n * @param tokens The amount of tokens deposited\n */\n event Deposit(address indexed payer, address indexed collector, address indexed receiver, uint256 tokens);\n\n /**\n * @notice Emitted when a payer cancels an escrow thawing\n * @param payer The address of the payer\n * @param collector The address of the collector\n * @param receiver The address of the receiver\n * @param tokensThawing The amount of tokens that were being thawed\n * @param thawEndTimestamp The timestamp at which the thawing period was ending\n */\n event CancelThaw(\n address indexed payer,\n address indexed collector,\n address indexed receiver,\n uint256 tokensThawing,\n uint256 thawEndTimestamp\n );\n\n /**\n * @notice Emitted when a payer thaws funds from the escrow for a payer-collector-receiver tuple\n * @param payer The address of the payer\n * @param collector The address of the collector\n * @param receiver The address of the receiver\n * @param tokens The amount of tokens being thawed\n * @param thawEndTimestamp The timestamp at which the thawing period ends\n */\n event Thaw(\n address indexed payer,\n address indexed collector,\n address indexed receiver,\n uint256 tokens,\n uint256 thawEndTimestamp\n );\n\n /**\n * @notice Emitted when a payer withdraws funds from the escrow for a payer-collector-receiver tuple\n * @param payer The address of the payer\n * @param collector The address of the collector\n * @param receiver The address of the receiver\n * @param tokens The amount of tokens withdrawn\n */\n event Withdraw(address indexed payer, address indexed collector, address indexed receiver, uint256 tokens);\n\n /**\n * @notice Emitted when a collector collects funds from the escrow for a payer-collector-receiver tuple\n * @param paymentType The type of payment being collected as defined in the {IGraphPayments} interface\n * @param payer The address of the payer\n * @param collector The address of the collector\n * @param receiver The address of the receiver\n * @param tokens The amount of tokens collected\n * @param receiverDestination The address where the receiver's payment should be sent.\n */\n event EscrowCollected(\n IGraphPayments.PaymentTypes indexed paymentType,\n address indexed payer,\n address indexed collector,\n address receiver,\n uint256 tokens,\n address receiverDestination\n );\n\n // -- Errors --\n\n /**\n * @notice Thrown when a protected function is called and the contract is paused.\n */\n error PaymentsEscrowIsPaused();\n\n /**\n * @notice Thrown when the available balance is insufficient to perform an operation\n * @param balance The current balance\n * @param minBalance The minimum required balance\n */\n error PaymentsEscrowInsufficientBalance(uint256 balance, uint256 minBalance);\n\n /**\n * @notice Thrown when a thawing is expected to be in progress but it is not\n */\n error PaymentsEscrowNotThawing();\n\n /**\n * @notice Thrown when a thawing is still in progress\n * @param currentTimestamp The current timestamp\n * @param thawEndTimestamp The timestamp at which the thawing period ends\n */\n error PaymentsEscrowStillThawing(uint256 currentTimestamp, uint256 thawEndTimestamp);\n\n /**\n * @notice Thrown when setting the thawing period to a value greater than the maximum\n * @param thawingPeriod The thawing period\n * @param maxWaitPeriod The maximum wait period\n */\n error PaymentsEscrowThawingPeriodTooLong(uint256 thawingPeriod, uint256 maxWaitPeriod);\n\n /**\n * @notice Thrown when the contract balance is not consistent with the collection amount\n * @param balanceBefore The balance before the collection\n * @param balanceAfter The balance after the collection\n * @param tokens The amount of tokens collected\n */\n error PaymentsEscrowInconsistentCollection(uint256 balanceBefore, uint256 balanceAfter, uint256 tokens);\n\n /**\n * @notice Thrown when operating a zero token amount is not allowed.\n */\n error PaymentsEscrowInvalidZeroTokens();\n\n /**\n * @notice Initialize the contract\n */\n function initialize() external;\n\n /**\n * @notice Deposits funds into the escrow for a payer-collector-receiver tuple, where\n * the payer is the transaction caller.\n * @dev Emits a {Deposit} event\n * @param collector The address of the collector\n * @param receiver The address of the receiver\n * @param tokens The amount of tokens to deposit\n */\n function deposit(address collector, address receiver, uint256 tokens) external;\n\n /**\n * @notice Deposits funds into the escrow for a payer-collector-receiver tuple, where\n * the payer can be specified.\n * @dev Emits a {Deposit} event\n * @param payer The address of the payer\n * @param collector The address of the collector\n * @param receiver The address of the receiver\n * @param tokens The amount of tokens to deposit\n */\n function depositTo(address payer, address collector, address receiver, uint256 tokens) external;\n\n /**\n * @notice Thaw a specific amount of escrow from a payer-collector-receiver's escrow account.\n * The payer is the transaction caller.\n * Note that repeated calls to this function will overwrite the previous thawing amount\n * and reset the thawing period.\n * @dev Requirements:\n * - `tokens` must be less than or equal to the available balance\n *\n * Emits a {Thaw} event.\n *\n * @param collector The address of the collector\n * @param receiver The address of the receiver\n * @param tokens The amount of tokens to thaw\n */\n function thaw(address collector, address receiver, uint256 tokens) external;\n\n /**\n * @notice Cancels the thawing of escrow from a payer-collector-receiver's escrow account.\n * @param collector The address of the collector\n * @param receiver The address of the receiver\n * @dev Requirements:\n * - The payer must be thawing funds\n * Emits a {CancelThaw} event.\n */\n function cancelThaw(address collector, address receiver) external;\n\n /**\n * @notice Withdraws all thawed escrow from a payer-collector-receiver's escrow account.\n * The payer is the transaction caller.\n * Note that the withdrawn funds might be less than the thawed amount if there were\n * payment collections in the meantime.\n * @dev Requirements:\n * - Funds must be thawed\n *\n * Emits a {Withdraw} event\n *\n * @param collector The address of the collector\n * @param receiver The address of the receiver\n */\n function withdraw(address collector, address receiver) external;\n\n /**\n * @notice Collects funds from the payer-collector-receiver's escrow and sends them to {GraphPayments} for\n * distribution using the Graph Horizon Payments protocol.\n * The function will revert if there are not enough funds in the escrow.\n *\n * Emits an {EscrowCollected} event\n *\n * @param paymentType The type of payment being collected as defined in the {IGraphPayments} interface\n * @param payer The address of the payer\n * @param receiver The address of the receiver\n * @param tokens The amount of tokens to collect\n * @param dataService The address of the data service\n * @param dataServiceCut The data service cut in PPM that {GraphPayments} should send\n * @param receiverDestination The address where the receiver's payment should be sent.\n */\n function collect(\n IGraphPayments.PaymentTypes paymentType,\n address payer,\n address receiver,\n uint256 tokens,\n address dataService,\n uint256 dataServiceCut,\n address receiverDestination\n ) external;\n\n /**\n * @notice Get the balance of a payer-collector-receiver tuple\n * This function will return 0 if the current balance is less than the amount of funds being thawed.\n * @param payer The address of the payer\n * @param collector The address of the collector\n * @param receiver The address of the receiver\n * @return The balance of the payer-collector-receiver tuple\n */\n function getBalance(address payer, address collector, address receiver) external view returns (uint256);\n}\n" + }, + "@graphprotocol/horizon/contracts/libraries/LinkedList.sol": { + "content": "// SPDX-License-Identifier: GPL-2.0-or-later\n\npragma solidity 0.8.27;\n\n/**\n * @title LinkedList library\n * @notice A library to manage singly linked lists.\n *\n * The library makes no assumptions about the contents of the items, the only\n * requirements on the items are:\n * - they must be represented by a unique bytes32 id\n * - the id of the item must not be bytes32(0)\n * - each item must have a reference to the next item in the list\n * - the list cannot have more than `MAX_ITEMS` items\n *\n * A contract using this library must store:\n * - a LinkedList.List to keep track of the list metadata\n * - a mapping from bytes32 to the item data\n * @custom:security-contact Please email security+contracts@thegraph.com if you find any\n * bugs. We may have an active bug bounty program.\n */\nlibrary LinkedList {\n using LinkedList for List;\n\n /**\n * @notice Represents a linked list\n * @param head The head of the list\n * @param tail The tail of the list\n * @param nonce A nonce, which can optionally be used to generate unique ids\n * @param count The number of items in the list\n */\n struct List {\n bytes32 head;\n bytes32 tail;\n uint256 nonce;\n uint256 count;\n }\n\n /// @notice Empty bytes constant\n bytes internal constant NULL_BYTES = bytes(\"\");\n\n /// @notice Maximum amount of items allowed in the list\n uint256 internal constant MAX_ITEMS = 10_000;\n\n /**\n * @notice Thrown when trying to remove an item from an empty list\n */\n error LinkedListEmptyList();\n\n /**\n * @notice Thrown when trying to add an item to a list that has reached the maximum number of elements\n */\n error LinkedListMaxElementsExceeded();\n\n /**\n * @notice Thrown when trying to traverse a list with more iterations than elements\n */\n error LinkedListInvalidIterations();\n\n /**\n * @notice Thrown when trying to add an item with id equal to bytes32(0)\n */\n error LinkedListInvalidZeroId();\n\n /**\n * @notice Adds an item to the list.\n * The item is added to the end of the list.\n * @dev Note that this function will not take care of linking the\n * old tail to the new item. The caller should take care of this.\n * It will also not ensure id uniqueness.\n * @dev There is a maximum number of elements that can be added to the list.\n * @param self The list metadata\n * @param id The id of the item to add\n */\n function addTail(List storage self, bytes32 id) internal {\n require(self.count < MAX_ITEMS, LinkedListMaxElementsExceeded());\n require(id != bytes32(0), LinkedListInvalidZeroId());\n self.tail = id;\n self.nonce += 1;\n if (self.count == 0) self.head = id;\n self.count += 1;\n }\n\n /**\n * @notice Removes an item from the list.\n * The item is removed from the beginning of the list.\n * @param self The list metadata\n * @param getNextItem A function to get the next item in the list. It should take\n * the id of the current item and return the id of the next item.\n * @param deleteItem A function to delete an item. This should delete the item from\n * the contract storage. It takes the id of the item to delete.\n * @return The id of the head of the list.\n */\n function removeHead(\n List storage self,\n function(bytes32) view returns (bytes32) getNextItem,\n function(bytes32) deleteItem\n ) internal returns (bytes32) {\n require(self.count > 0, LinkedListEmptyList());\n bytes32 nextItem = getNextItem(self.head);\n deleteItem(self.head);\n self.count -= 1;\n self.head = nextItem;\n if (self.count == 0) self.tail = bytes32(0);\n return self.head;\n }\n\n /**\n * @notice Traverses the list and processes each item.\n * It deletes the processed items from both the list and the storage mapping.\n * @param self The list metadata\n * @param getNextItem A function to get the next item in the list. It should take\n * the id of the current item and return the id of the next item.\n * @param processItem A function to process an item. The function should take the id of the item\n * and an accumulator, and return:\n * - a boolean indicating whether the traversal should stop\n * - an accumulator to pass data between iterations\n * @param deleteItem A function to delete an item. This should delete the item from\n * the contract storage. It takes the id of the item to delete.\n * @param processInitAcc The initial accumulator data\n * @param iterations The maximum number of iterations to perform. If 0, the traversal will continue\n * until the end of the list.\n * @return The number of items processed\n * @return The final accumulator data.\n */\n function traverse(\n List storage self,\n function(bytes32) view returns (bytes32) getNextItem,\n function(bytes32, bytes memory) returns (bool, bytes memory) processItem,\n function(bytes32) deleteItem,\n bytes memory processInitAcc,\n uint256 iterations\n ) internal returns (uint256, bytes memory) {\n require(iterations <= self.count, LinkedListInvalidIterations());\n\n uint256 itemCount = 0;\n iterations = (iterations == 0) ? self.count : iterations;\n\n bytes32 cursor = self.head;\n\n while (cursor != bytes32(0) && iterations > 0) {\n (bool shouldBreak, bytes memory acc_) = processItem(cursor, processInitAcc);\n\n if (shouldBreak) break;\n\n processInitAcc = acc_;\n cursor = self.removeHead(getNextItem, deleteItem);\n\n iterations--;\n itemCount++;\n }\n\n return (itemCount, processInitAcc);\n }\n}\n" + }, + "@graphprotocol/horizon/contracts/libraries/MathUtils.sol": { + "content": "// SPDX-License-Identifier: GPL-2.0-or-later\n\npragma solidity 0.8.27;\n\n/**\n * @title MathUtils Library\n * @notice A collection of functions to perform math operations\n * @custom:security-contact Please email security+contracts@thegraph.com if you find any\n * bugs. We may have an active bug bounty program.\n */\nlibrary MathUtils {\n /**\n * @dev Calculates the weighted average of two values pondering each of these\n * values based on configured weights. The contribution of each value N is\n * weightN/(weightA + weightB). The calculation rounds up to ensure the result\n * is always equal or greater than the smallest of the two values.\n * @param valueA The amount for value A\n * @param weightA The weight to use for value A\n * @param valueB The amount for value B\n * @param weightB The weight to use for value B\n */\n function weightedAverageRoundingUp(\n uint256 valueA,\n uint256 weightA,\n uint256 valueB,\n uint256 weightB\n ) internal pure returns (uint256) {\n return ((valueA * weightA) + (valueB * weightB) + (weightA + weightB - 1)) / (weightA + weightB);\n }\n\n /**\n * @dev Returns the minimum of two numbers.\n * @param x The first number\n * @param y The second number\n * @return The minimum of the two numbers\n */\n function min(uint256 x, uint256 y) internal pure returns (uint256) {\n return x <= y ? x : y;\n }\n\n /**\n * @dev Returns the difference between two numbers or zero if negative.\n * @param x The first number\n * @param y The second number\n * @return The difference between the two numbers or zero if negative\n */\n function diffOrZero(uint256 x, uint256 y) internal pure returns (uint256) {\n return (x > y) ? x - y : 0;\n }\n}\n" + }, + "@graphprotocol/horizon/contracts/libraries/PPMMath.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0-or-later\npragma solidity 0.8.27;\n\n/**\n * @title PPMMath library\n * @notice A library for handling calculations with parts per million (PPM) amounts.\n * @custom:security-contact Please email security+contracts@thegraph.com if you find any\n * bugs. We may have an active bug bounty program.\n */\nlibrary PPMMath {\n /// @notice Maximum value (100%) in parts per million (PPM).\n uint256 internal constant MAX_PPM = 1_000_000;\n\n /**\n * @notice Thrown when a value is expected to be in PPM but is not.\n * @param value The value that is not in PPM.\n */\n error PPMMathInvalidPPM(uint256 value);\n\n /**\n * @notice Thrown when no value in a multiplication is in PPM.\n * @param a The first value in the multiplication.\n * @param b The second value in the multiplication.\n */\n error PPMMathInvalidMulPPM(uint256 a, uint256 b);\n\n /**\n * @notice Multiplies two values, one of which must be in PPM.\n * @param a The first value.\n * @param b The second value.\n * @return The result of the multiplication.\n */\n function mulPPM(uint256 a, uint256 b) internal pure returns (uint256) {\n require(isValidPPM(a) || isValidPPM(b), PPMMathInvalidMulPPM(a, b));\n return (a * b) / MAX_PPM;\n }\n\n /**\n * @notice Multiplies two values, the second one must be in PPM, and rounds up the result.\n * @dev requirements:\n * - The second value must be in PPM.\n * @param a The first value.\n * @param b The second value.\n * @return The result of the multiplication.\n */\n function mulPPMRoundUp(uint256 a, uint256 b) internal pure returns (uint256) {\n require(isValidPPM(b), PPMMathInvalidPPM(b));\n return a - mulPPM(a, MAX_PPM - b);\n }\n\n /**\n * @notice Checks if a value is in PPM.\n * @dev A valid PPM value is between 0 and MAX_PPM.\n * @param value The value to check.\n * @return true if the value is in PPM, false otherwise.\n */\n function isValidPPM(uint256 value) internal pure returns (bool) {\n return value <= MAX_PPM;\n }\n}\n" + }, + "@graphprotocol/horizon/contracts/libraries/UintRange.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0-or-later\npragma solidity 0.8.27;\n\n/**\n * @title UintRange library\n * @notice A library for handling range checks on uint256 values.\n * @custom:security-contact Please email security+contracts@thegraph.com if you find any\n * bugs. We may have an active bug bounty program.\n */\nlibrary UintRange {\n /**\n * @notice Checks if a value is in the range [`min`, `max`].\n * @param value The value to check.\n * @param min The minimum value of the range.\n * @param max The maximum value of the range.\n * @return true if the value is in the range, false otherwise.\n */\n function isInRange(uint256 value, uint256 min, uint256 max) internal pure returns (bool) {\n return value >= min && value <= max;\n }\n}\n" + }, + "@graphprotocol/horizon/contracts/utilities/GraphDirectory.sol": { + "content": "// SPDX-License-Identifier: GPL-2.0-or-later\n\npragma solidity 0.8.27;\n\nimport { IGraphToken } from \"@graphprotocol/contracts/contracts/token/IGraphToken.sol\";\nimport { IHorizonStaking } from \"../interfaces/IHorizonStaking.sol\";\nimport { IGraphPayments } from \"../interfaces/IGraphPayments.sol\";\nimport { IPaymentsEscrow } from \"../interfaces/IPaymentsEscrow.sol\";\n\nimport { IController } from \"@graphprotocol/contracts/contracts/governance/IController.sol\";\nimport { IEpochManager } from \"@graphprotocol/contracts/contracts/epochs/IEpochManager.sol\";\nimport { IRewardsManager } from \"@graphprotocol/contracts/contracts/rewards/IRewardsManager.sol\";\nimport { ITokenGateway } from \"@graphprotocol/contracts/contracts/arbitrum/ITokenGateway.sol\";\nimport { IGraphProxyAdmin } from \"../interfaces/IGraphProxyAdmin.sol\";\n\nimport { ICuration } from \"@graphprotocol/contracts/contracts/curation/ICuration.sol\";\n\n/**\n * @title GraphDirectory contract\n * @notice This contract is meant to be inherited by other contracts that\n * need to keep track of the addresses in Graph Horizon contracts.\n * It fetches the addresses from the Controller supplied during construction,\n * and uses immutable variables to minimize gas costs.\n */\nabstract contract GraphDirectory {\n // -- Graph Horizon contracts --\n\n /// @notice The Graph Token contract address\n IGraphToken private immutable GRAPH_TOKEN;\n\n /// @notice The Horizon Staking contract address\n IHorizonStaking private immutable GRAPH_STAKING;\n\n /// @notice The Graph Payments contract address\n IGraphPayments private immutable GRAPH_PAYMENTS;\n\n /// @notice The Payments Escrow contract address\n IPaymentsEscrow private immutable GRAPH_PAYMENTS_ESCROW;\n\n // -- Graph periphery contracts --\n\n /// @notice The Graph Controller contract address\n IController private immutable GRAPH_CONTROLLER;\n\n /// @notice The Epoch Manager contract address\n IEpochManager private immutable GRAPH_EPOCH_MANAGER;\n\n /// @notice The Rewards Manager contract address\n IRewardsManager private immutable GRAPH_REWARDS_MANAGER;\n\n /// @notice The Token Gateway contract address\n ITokenGateway private immutable GRAPH_TOKEN_GATEWAY;\n\n /// @notice The Graph Proxy Admin contract address\n IGraphProxyAdmin private immutable GRAPH_PROXY_ADMIN;\n\n // -- Legacy Graph contracts --\n // These are required for backwards compatibility on HorizonStakingExtension\n // TRANSITION PERIOD: remove these once HorizonStakingExtension is removed\n\n /// @notice The Curation contract address\n ICuration private immutable GRAPH_CURATION;\n\n /**\n * @notice Emitted when the GraphDirectory is initialized\n * @param graphToken The Graph Token contract address\n * @param graphStaking The Horizon Staking contract address\n * @param graphPayments The Graph Payments contract address\n * @param graphEscrow The Payments Escrow contract address\n * @param graphController The Graph Controller contract address\n * @param graphEpochManager The Epoch Manager contract address\n * @param graphRewardsManager The Rewards Manager contract address\n * @param graphTokenGateway The Token Gateway contract address\n * @param graphProxyAdmin The Graph Proxy Admin contract address\n * @param graphCuration The Curation contract address\n */\n event GraphDirectoryInitialized(\n address indexed graphToken,\n address indexed graphStaking,\n address graphPayments,\n address graphEscrow,\n address indexed graphController,\n address graphEpochManager,\n address graphRewardsManager,\n address graphTokenGateway,\n address graphProxyAdmin,\n address graphCuration\n );\n\n /**\n * @notice Thrown when either the controller is the zero address or a contract address is not found\n * on the controller\n * @param contractName The name of the contract that was not found, or the controller\n */\n error GraphDirectoryInvalidZeroAddress(bytes contractName);\n\n /**\n * @notice Constructor for the GraphDirectory contract\n * @dev Requirements:\n * - `controller` cannot be zero address\n *\n * Emits a {GraphDirectoryInitialized} event\n *\n * @param controller The address of the Graph Controller contract.\n */\n constructor(address controller) {\n require(controller != address(0), GraphDirectoryInvalidZeroAddress(\"Controller\"));\n\n GRAPH_CONTROLLER = IController(controller);\n GRAPH_TOKEN = IGraphToken(_getContractFromController(\"GraphToken\"));\n GRAPH_STAKING = IHorizonStaking(_getContractFromController(\"Staking\"));\n GRAPH_PAYMENTS = IGraphPayments(_getContractFromController(\"GraphPayments\"));\n GRAPH_PAYMENTS_ESCROW = IPaymentsEscrow(_getContractFromController(\"PaymentsEscrow\"));\n GRAPH_EPOCH_MANAGER = IEpochManager(_getContractFromController(\"EpochManager\"));\n GRAPH_REWARDS_MANAGER = IRewardsManager(_getContractFromController(\"RewardsManager\"));\n GRAPH_TOKEN_GATEWAY = ITokenGateway(_getContractFromController(\"GraphTokenGateway\"));\n GRAPH_PROXY_ADMIN = IGraphProxyAdmin(_getContractFromController(\"GraphProxyAdmin\"));\n GRAPH_CURATION = ICuration(_getContractFromController(\"Curation\"));\n\n emit GraphDirectoryInitialized(\n address(GRAPH_TOKEN),\n address(GRAPH_STAKING),\n address(GRAPH_PAYMENTS),\n address(GRAPH_PAYMENTS_ESCROW),\n address(GRAPH_CONTROLLER),\n address(GRAPH_EPOCH_MANAGER),\n address(GRAPH_REWARDS_MANAGER),\n address(GRAPH_TOKEN_GATEWAY),\n address(GRAPH_PROXY_ADMIN),\n address(GRAPH_CURATION)\n );\n }\n\n /**\n * @notice Get the Graph Token contract\n * @return The Graph Token contract\n */\n function _graphToken() internal view returns (IGraphToken) {\n return GRAPH_TOKEN;\n }\n\n /**\n * @notice Get the Horizon Staking contract\n * @return The Horizon Staking contract\n */\n function _graphStaking() internal view returns (IHorizonStaking) {\n return GRAPH_STAKING;\n }\n\n /**\n * @notice Get the Graph Payments contract\n * @return The Graph Payments contract\n */\n function _graphPayments() internal view returns (IGraphPayments) {\n return GRAPH_PAYMENTS;\n }\n\n /**\n * @notice Get the Payments Escrow contract\n * @return The Payments Escrow contract\n */\n function _graphPaymentsEscrow() internal view returns (IPaymentsEscrow) {\n return GRAPH_PAYMENTS_ESCROW;\n }\n\n /**\n * @notice Get the Graph Controller contract\n * @return The Graph Controller contract\n */\n function _graphController() internal view returns (IController) {\n return GRAPH_CONTROLLER;\n }\n\n /**\n * @notice Get the Epoch Manager contract\n * @return The Epoch Manager contract\n */\n function _graphEpochManager() internal view returns (IEpochManager) {\n return GRAPH_EPOCH_MANAGER;\n }\n\n /**\n * @notice Get the Rewards Manager contract\n * @return The Rewards Manager contract address\n */\n function _graphRewardsManager() internal view returns (IRewardsManager) {\n return GRAPH_REWARDS_MANAGER;\n }\n\n /**\n * @notice Get the Graph Token Gateway contract\n * @return The Graph Token Gateway contract\n */\n function _graphTokenGateway() internal view returns (ITokenGateway) {\n return GRAPH_TOKEN_GATEWAY;\n }\n\n /**\n * @notice Get the Graph Proxy Admin contract\n * @return The Graph Proxy Admin contract\n */\n function _graphProxyAdmin() internal view returns (IGraphProxyAdmin) {\n return GRAPH_PROXY_ADMIN;\n }\n\n /**\n * @notice Get the Curation contract\n * @return The Curation contract\n */\n function _graphCuration() internal view returns (ICuration) {\n return GRAPH_CURATION;\n }\n\n /**\n * @notice Get a contract address from the controller\n * @dev Requirements:\n * - The `_contractName` must be registered in the controller\n * @param _contractName The name of the contract to fetch from the controller\n * @return The address of the contract\n */\n function _getContractFromController(bytes memory _contractName) private view returns (address) {\n address contractAddress = GRAPH_CONTROLLER.getContractProxy(keccak256(_contractName));\n require(contractAddress != address(0), GraphDirectoryInvalidZeroAddress(_contractName));\n return contractAddress;\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)\n\npragma solidity ^0.8.20;\n\nimport {ContextUpgradeable} from \"../utils/ContextUpgradeable.sol\";\nimport {Initializable} from \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * The initial owner is set to the address provided by the deployer. This can\n * later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\n /// @custom:storage-location erc7201:openzeppelin.storage.Ownable\n struct OwnableStorage {\n address _owner;\n }\n\n // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.Ownable\")) - 1)) & ~bytes32(uint256(0xff))\n bytes32 private constant OwnableStorageLocation = 0x9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300;\n\n function _getOwnableStorage() private pure returns (OwnableStorage storage $) {\n assembly {\n $.slot := OwnableStorageLocation\n }\n }\n\n /**\n * @dev The caller account is not authorized to perform an operation.\n */\n error OwnableUnauthorizedAccount(address account);\n\n /**\n * @dev The owner is not a valid owner account. (eg. `address(0)`)\n */\n error OwnableInvalidOwner(address owner);\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the address provided by the deployer as the initial owner.\n */\n function __Ownable_init(address initialOwner) internal onlyInitializing {\n __Ownable_init_unchained(initialOwner);\n }\n\n function __Ownable_init_unchained(address initialOwner) internal onlyInitializing {\n if (initialOwner == address(0)) {\n revert OwnableInvalidOwner(address(0));\n }\n _transferOwnership(initialOwner);\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n _checkOwner();\n _;\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n OwnableStorage storage $ = _getOwnableStorage();\n return $._owner;\n }\n\n /**\n * @dev Throws if the sender is not the owner.\n */\n function _checkOwner() internal view virtual {\n if (owner() != _msgSender()) {\n revert OwnableUnauthorizedAccount(_msgSender());\n }\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby disabling any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n if (newOwner == address(0)) {\n revert OwnableInvalidOwner(address(0));\n }\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n OwnableStorage storage $ = _getOwnableStorage();\n address oldOwner = $._owner;\n $._owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.3.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\n * reused. This mechanism prevents re-execution of each \"step\" but allows the creation of new initialization steps in\n * case an upgrade adds a module that needs to be initialized.\n *\n * For example:\n *\n * [.hljs-theme-light.nopadding]\n * ```solidity\n * contract MyToken is ERC20Upgradeable {\n * function initialize() initializer public {\n * __ERC20_init(\"MyToken\", \"MTK\");\n * }\n * }\n *\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\n * function initializeV2() reinitializer(2) public {\n * __ERC20Permit_init(\"MyToken\");\n * }\n * }\n * ```\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() {\n * _disableInitializers();\n * }\n * ```\n * ====\n */\nabstract contract Initializable {\n /**\n * @dev Storage of the initializable contract.\n *\n * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions\n * when using with upgradeable contracts.\n *\n * @custom:storage-location erc7201:openzeppelin.storage.Initializable\n */\n struct InitializableStorage {\n /**\n * @dev Indicates that the contract has been initialized.\n */\n uint64 _initialized;\n /**\n * @dev Indicates that the contract is in the process of being initialized.\n */\n bool _initializing;\n }\n\n // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.Initializable\")) - 1)) & ~bytes32(uint256(0xff))\n bytes32 private constant INITIALIZABLE_STORAGE = 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00;\n\n /**\n * @dev The contract is already initialized.\n */\n error InvalidInitialization();\n\n /**\n * @dev The contract is not initializing.\n */\n error NotInitializing();\n\n /**\n * @dev Triggered when the contract has been initialized or reinitialized.\n */\n event Initialized(uint64 version);\n\n /**\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\n * `onlyInitializing` functions can be used to initialize parent contracts.\n *\n * Similar to `reinitializer(1)`, except that in the context of a constructor an `initializer` may be invoked any\n * number of times. This behavior in the constructor can be useful during testing and is not expected to be used in\n * production.\n *\n * Emits an {Initialized} event.\n */\n modifier initializer() {\n // solhint-disable-next-line var-name-mixedcase\n InitializableStorage storage $ = _getInitializableStorage();\n\n // Cache values to avoid duplicated sloads\n bool isTopLevelCall = !$._initializing;\n uint64 initialized = $._initialized;\n\n // Allowed calls:\n // - initialSetup: the contract is not in the initializing state and no previous version was\n // initialized\n // - construction: the contract is initialized at version 1 (no reinitialization) and the\n // current contract is just being deployed\n bool initialSetup = initialized == 0 && isTopLevelCall;\n bool construction = initialized == 1 && address(this).code.length == 0;\n\n if (!initialSetup && !construction) {\n revert InvalidInitialization();\n }\n $._initialized = 1;\n if (isTopLevelCall) {\n $._initializing = true;\n }\n _;\n if (isTopLevelCall) {\n $._initializing = false;\n emit Initialized(1);\n }\n }\n\n /**\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\n * used to initialize parent contracts.\n *\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\n * are added through upgrades and that require initialization.\n *\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\n * cannot be nested. If one is invoked in the context of another, execution will revert.\n *\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\n * a contract, executing them in the right order is up to the developer or operator.\n *\n * WARNING: Setting the version to 2**64 - 1 will prevent any future reinitialization.\n *\n * Emits an {Initialized} event.\n */\n modifier reinitializer(uint64 version) {\n // solhint-disable-next-line var-name-mixedcase\n InitializableStorage storage $ = _getInitializableStorage();\n\n if ($._initializing || $._initialized >= version) {\n revert InvalidInitialization();\n }\n $._initialized = version;\n $._initializing = true;\n _;\n $._initializing = false;\n emit Initialized(version);\n }\n\n /**\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\n */\n modifier onlyInitializing() {\n _checkInitializing();\n _;\n }\n\n /**\n * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.\n */\n function _checkInitializing() internal view virtual {\n if (!_isInitializing()) {\n revert NotInitializing();\n }\n }\n\n /**\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\n * through proxies.\n *\n * Emits an {Initialized} event the first time it is successfully executed.\n */\n function _disableInitializers() internal virtual {\n // solhint-disable-next-line var-name-mixedcase\n InitializableStorage storage $ = _getInitializableStorage();\n\n if ($._initializing) {\n revert InvalidInitialization();\n }\n if ($._initialized != type(uint64).max) {\n $._initialized = type(uint64).max;\n emit Initialized(type(uint64).max);\n }\n }\n\n /**\n * @dev Returns the highest version that has been initialized. See {reinitializer}.\n */\n function _getInitializedVersion() internal view returns (uint64) {\n return _getInitializableStorage()._initialized;\n }\n\n /**\n * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\n */\n function _isInitializing() internal view returns (bool) {\n return _getInitializableStorage()._initializing;\n }\n\n /**\n * @dev Pointer to storage slot. Allows integrators to override it with a custom storage location.\n *\n * NOTE: Consider following the ERC-7201 formula to derive storage locations.\n */\n function _initializableStorageSlot() internal pure virtual returns (bytes32) {\n return INITIALIZABLE_STORAGE;\n }\n\n /**\n * @dev Returns a pointer to the storage namespace.\n */\n // solhint-disable-next-line var-name-mixedcase\n function _getInitializableStorage() private pure returns (InitializableStorage storage $) {\n bytes32 slot = _initializableStorageSlot();\n assembly {\n $.slot := slot\n }\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\npragma solidity ^0.8.20;\nimport {Initializable} from \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract ContextUpgradeable is Initializable {\n function __Context_init() internal onlyInitializing {\n }\n\n function __Context_init_unchained() internal onlyInitializing {\n }\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n function _contextSuffixLength() internal view virtual returns (uint256) {\n return 0;\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.3.0) (utils/cryptography/EIP712.sol)\n\npragma solidity ^0.8.20;\n\nimport {MessageHashUtils} from \"@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol\";\nimport {IERC5267} from \"@openzeppelin/contracts/interfaces/IERC5267.sol\";\nimport {Initializable} from \"../../proxy/utils/Initializable.sol\";\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP-712] is a standard for hashing and signing of typed structured data.\n *\n * The encoding scheme specified in the EIP requires a domain separator and a hash of the typed structured data, whose\n * encoding is very generic and therefore its implementation in Solidity is not feasible, thus this contract\n * does not implement the encoding itself. Protocols need to implement the type-specific encoding they need in order to\n * produce the hash of their typed data using a combination of `abi.encode` and `keccak256`.\n *\n * This contract implements the EIP-712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\n * ({_hashTypedDataV4}).\n *\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\n * the chain id to protect against replay attacks on an eventual fork of the chain.\n *\n * NOTE: This contract implements the version of the encoding known as \"v4\", as implemented by the JSON RPC method\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\n *\n * NOTE: In the upgradeable version of this contract, the cached values will correspond to the address, and the domain\n * separator of the implementation contract. This will cause the {_domainSeparatorV4} function to always rebuild the\n * separator from the immutable values, which is cheaper than accessing a cached version in cold storage.\n */\nabstract contract EIP712Upgradeable is Initializable, IERC5267 {\n bytes32 private constant TYPE_HASH =\n keccak256(\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\");\n\n /// @custom:storage-location erc7201:openzeppelin.storage.EIP712\n struct EIP712Storage {\n /// @custom:oz-renamed-from _HASHED_NAME\n bytes32 _hashedName;\n /// @custom:oz-renamed-from _HASHED_VERSION\n bytes32 _hashedVersion;\n\n string _name;\n string _version;\n }\n\n // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.EIP712\")) - 1)) & ~bytes32(uint256(0xff))\n bytes32 private constant EIP712StorageLocation = 0xa16a46d94261c7517cc8ff89f61c0ce93598e3c849801011dee649a6a557d100;\n\n function _getEIP712Storage() private pure returns (EIP712Storage storage $) {\n assembly {\n $.slot := EIP712StorageLocation\n }\n }\n\n /**\n * @dev Initializes the domain separator and parameter caches.\n *\n * The meaning of `name` and `version` is specified in\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP-712]:\n *\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\n * - `version`: the current major version of the signing domain.\n *\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\n * contract upgrade].\n */\n function __EIP712_init(string memory name, string memory version) internal onlyInitializing {\n __EIP712_init_unchained(name, version);\n }\n\n function __EIP712_init_unchained(string memory name, string memory version) internal onlyInitializing {\n EIP712Storage storage $ = _getEIP712Storage();\n $._name = name;\n $._version = version;\n\n // Reset prior values in storage if upgrading\n $._hashedName = 0;\n $._hashedVersion = 0;\n }\n\n /**\n * @dev Returns the domain separator for the current chain.\n */\n function _domainSeparatorV4() internal view returns (bytes32) {\n return _buildDomainSeparator();\n }\n\n function _buildDomainSeparator() private view returns (bytes32) {\n return keccak256(abi.encode(TYPE_HASH, _EIP712NameHash(), _EIP712VersionHash(), block.chainid, address(this)));\n }\n\n /**\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\n * function returns the hash of the fully encoded EIP712 message for this domain.\n *\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\n *\n * ```solidity\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\n * keccak256(\"Mail(address to,string contents)\"),\n * mailTo,\n * keccak256(bytes(mailContents))\n * )));\n * address signer = ECDSA.recover(digest, signature);\n * ```\n */\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\n return MessageHashUtils.toTypedDataHash(_domainSeparatorV4(), structHash);\n }\n\n /**\n * @inheritdoc IERC5267\n */\n function eip712Domain()\n public\n view\n virtual\n returns (\n bytes1 fields,\n string memory name,\n string memory version,\n uint256 chainId,\n address verifyingContract,\n bytes32 salt,\n uint256[] memory extensions\n )\n {\n EIP712Storage storage $ = _getEIP712Storage();\n // If the hashed name and version in storage are non-zero, the contract hasn't been properly initialized\n // and the EIP712 domain is not reliable, as it will be missing name and version.\n require($._hashedName == 0 && $._hashedVersion == 0, \"EIP712: Uninitialized\");\n\n return (\n hex\"0f\", // 01111\n _EIP712Name(),\n _EIP712Version(),\n block.chainid,\n address(this),\n bytes32(0),\n new uint256[](0)\n );\n }\n\n /**\n * @dev The name parameter for the EIP712 domain.\n *\n * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\n * are a concern.\n */\n function _EIP712Name() internal view virtual returns (string memory) {\n EIP712Storage storage $ = _getEIP712Storage();\n return $._name;\n }\n\n /**\n * @dev The version parameter for the EIP712 domain.\n *\n * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\n * are a concern.\n */\n function _EIP712Version() internal view virtual returns (string memory) {\n EIP712Storage storage $ = _getEIP712Storage();\n return $._version;\n }\n\n /**\n * @dev The hash of the name parameter for the EIP712 domain.\n *\n * NOTE: In previous versions this function was virtual. In this version you should override `_EIP712Name` instead.\n */\n function _EIP712NameHash() internal view returns (bytes32) {\n EIP712Storage storage $ = _getEIP712Storage();\n string memory name = _EIP712Name();\n if (bytes(name).length > 0) {\n return keccak256(bytes(name));\n } else {\n // If the name is empty, the contract may have been upgraded without initializing the new storage.\n // We return the name hash in storage if non-zero, otherwise we assume the name is empty by design.\n bytes32 hashedName = $._hashedName;\n if (hashedName != 0) {\n return hashedName;\n } else {\n return keccak256(\"\");\n }\n }\n }\n\n /**\n * @dev The hash of the version parameter for the EIP712 domain.\n *\n * NOTE: In previous versions this function was virtual. In this version you should override `_EIP712Version` instead.\n */\n function _EIP712VersionHash() internal view returns (bytes32) {\n EIP712Storage storage $ = _getEIP712Storage();\n string memory version = _EIP712Version();\n if (bytes(version).length > 0) {\n return keccak256(bytes(version));\n } else {\n // If the version is empty, the contract may have been upgraded without initializing the new storage.\n // We return the version hash in storage if non-zero, otherwise we assume the version is empty by design.\n bytes32 hashedVersion = $._hashedVersion;\n if (hashedVersion != 0) {\n return hashedVersion;\n } else {\n return keccak256(\"\");\n }\n }\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/MulticallUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.3.0) (utils/Multicall.sol)\n\npragma solidity ^0.8.20;\n\nimport {Address} from \"@openzeppelin/contracts/utils/Address.sol\";\nimport {ContextUpgradeable} from \"./ContextUpgradeable.sol\";\nimport {Initializable} from \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Provides a function to batch together multiple calls in a single external call.\n *\n * Consider any assumption about calldata validation performed by the sender may be violated if it's not especially\n * careful about sending transactions invoking {multicall}. For example, a relay address that filters function\n * selectors won't filter calls nested within a {multicall} operation.\n *\n * NOTE: Since 5.0.1 and 4.9.4, this contract identifies non-canonical contexts (i.e. `msg.sender` is not {Context-_msgSender}).\n * If a non-canonical context is identified, the following self `delegatecall` appends the last bytes of `msg.data`\n * to the subcall. This makes it safe to use with {ERC2771Context}. Contexts that don't affect the resolution of\n * {Context-_msgSender} are not propagated to subcalls.\n */\nabstract contract MulticallUpgradeable is Initializable, ContextUpgradeable {\n function __Multicall_init() internal onlyInitializing {\n }\n\n function __Multicall_init_unchained() internal onlyInitializing {\n }\n /**\n * @dev Receives and executes a batch of function calls on this contract.\n * @custom:oz-upgrades-unsafe-allow-reachable delegatecall\n */\n function multicall(bytes[] calldata data) external virtual returns (bytes[] memory results) {\n bytes memory context = msg.sender == _msgSender()\n ? new bytes(0)\n : msg.data[msg.data.length - _contextSuffixLength():];\n\n results = new bytes[](data.length);\n for (uint256 i = 0; i < data.length; i++) {\n results[i] = Address.functionDelegateCall(address(this), bytes.concat(data[i], context));\n }\n return results;\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.3.0) (utils/Pausable.sol)\n\npragma solidity ^0.8.20;\n\nimport {ContextUpgradeable} from \"../utils/ContextUpgradeable.sol\";\nimport {Initializable} from \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module which allows children to implement an emergency stop\n * mechanism that can be triggered by an authorized account.\n *\n * This module is used through inheritance. It will make available the\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\n * the functions of your contract. Note that they will not be pausable by\n * simply including this module, only once the modifiers are put in place.\n */\nabstract contract PausableUpgradeable is Initializable, ContextUpgradeable {\n /// @custom:storage-location erc7201:openzeppelin.storage.Pausable\n struct PausableStorage {\n bool _paused;\n }\n\n // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.Pausable\")) - 1)) & ~bytes32(uint256(0xff))\n bytes32 private constant PausableStorageLocation = 0xcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f03300;\n\n function _getPausableStorage() private pure returns (PausableStorage storage $) {\n assembly {\n $.slot := PausableStorageLocation\n }\n }\n\n /**\n * @dev Emitted when the pause is triggered by `account`.\n */\n event Paused(address account);\n\n /**\n * @dev Emitted when the pause is lifted by `account`.\n */\n event Unpaused(address account);\n\n /**\n * @dev The operation failed because the contract is paused.\n */\n error EnforcedPause();\n\n /**\n * @dev The operation failed because the contract is not paused.\n */\n error ExpectedPause();\n\n /**\n * @dev Modifier to make a function callable only when the contract is not paused.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n modifier whenNotPaused() {\n _requireNotPaused();\n _;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is paused.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n modifier whenPaused() {\n _requirePaused();\n _;\n }\n\n function __Pausable_init() internal onlyInitializing {\n }\n\n function __Pausable_init_unchained() internal onlyInitializing {\n }\n /**\n * @dev Returns true if the contract is paused, and false otherwise.\n */\n function paused() public view virtual returns (bool) {\n PausableStorage storage $ = _getPausableStorage();\n return $._paused;\n }\n\n /**\n * @dev Throws if the contract is paused.\n */\n function _requireNotPaused() internal view virtual {\n if (paused()) {\n revert EnforcedPause();\n }\n }\n\n /**\n * @dev Throws if the contract is not paused.\n */\n function _requirePaused() internal view virtual {\n if (!paused()) {\n revert ExpectedPause();\n }\n }\n\n /**\n * @dev Triggers stopped state.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n function _pause() internal virtual whenNotPaused {\n PausableStorage storage $ = _getPausableStorage();\n $._paused = true;\n emit Paused(_msgSender());\n }\n\n /**\n * @dev Returns to normal state.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n function _unpause() internal virtual whenPaused {\n PausableStorage storage $ = _getPausableStorage();\n $._paused = false;\n emit Unpaused(_msgSender());\n }\n}\n" + }, + "@openzeppelin/contracts/interfaces/IERC5267.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC5267.sol)\n\npragma solidity ^0.8.20;\n\ninterface IERC5267 {\n /**\n * @dev MAY be emitted to signal that the domain could have changed.\n */\n event EIP712DomainChanged();\n\n /**\n * @dev returns the fields and values that describe the domain separator used by this contract for EIP-712\n * signature.\n */\n function eip712Domain()\n external\n view\n returns (\n bytes1 fields,\n string memory name,\n string memory version,\n uint256 chainId,\n address verifyingContract,\n bytes32 salt,\n uint256[] memory extensions\n );\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Interface of the ERC-20 standard as defined in the ERC.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the value of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the value of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves a `value` amount of tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 value) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\n * caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 value) external returns (bool);\n\n /**\n * @dev Moves a `value` amount of tokens from `from` to `to` using the\n * allowance mechanism. `value` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address from, address to, uint256 value) external returns (bool);\n}\n" + }, + "@openzeppelin/contracts/utils/Address.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.2.0) (utils/Address.sol)\n\npragma solidity ^0.8.20;\n\nimport {Errors} from \"./Errors.sol\";\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev There's no code at `target` (it is not a contract).\n */\n error AddressEmptyCode(address target);\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n if (address(this).balance < amount) {\n revert Errors.InsufficientBalance(address(this).balance, amount);\n }\n\n (bool success, bytes memory returndata) = recipient.call{value: amount}(\"\");\n if (!success) {\n _revert(returndata);\n }\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason or custom error, it is bubbled\n * up by this function (like regular Solidity function calls). However, if\n * the call reverted with no returned reason, this function reverts with a\n * {Errors.FailedCall} error.\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n if (address(this).balance < value) {\n revert Errors.InsufficientBalance(address(this).balance, value);\n }\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target\n * was not a contract or bubbling up the revert reason (falling back to {Errors.FailedCall}) in case\n * of an unsuccessful call.\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata\n ) internal view returns (bytes memory) {\n if (!success) {\n _revert(returndata);\n } else {\n // only check if target is a contract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n if (returndata.length == 0 && target.code.length == 0) {\n revert AddressEmptyCode(target);\n }\n return returndata;\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the\n * revert reason or with a default {Errors.FailedCall} error.\n */\n function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {\n if (!success) {\n _revert(returndata);\n } else {\n return returndata;\n }\n }\n\n /**\n * @dev Reverts with returndata if present. Otherwise reverts with {Errors.FailedCall}.\n */\n function _revert(bytes memory returndata) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n assembly (\"memory-safe\") {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert Errors.FailedCall();\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/cryptography/ECDSA.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/ECDSA.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\n *\n * These functions can be used to verify that a message was signed by the holder\n * of the private keys of a given address.\n */\nlibrary ECDSA {\n enum RecoverError {\n NoError,\n InvalidSignature,\n InvalidSignatureLength,\n InvalidSignatureS\n }\n\n /**\n * @dev The signature derives the `address(0)`.\n */\n error ECDSAInvalidSignature();\n\n /**\n * @dev The signature has an invalid length.\n */\n error ECDSAInvalidSignatureLength(uint256 length);\n\n /**\n * @dev The signature has an S value that is in the upper half order.\n */\n error ECDSAInvalidSignatureS(bytes32 s);\n\n /**\n * @dev Returns the address that signed a hashed message (`hash`) with `signature` or an error. This will not\n * return address(0) without also returning an error description. Errors are documented using an enum (error type)\n * and a bytes32 providing additional information about the error.\n *\n * If no error is returned, then the address can be used for verification purposes.\n *\n * The `ecrecover` EVM precompile allows for malleable (non-unique) signatures:\n * this function rejects them by requiring the `s` value to be in the lower\n * half order, and the `v` value to be either 27 or 28.\n *\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\n * verification to be secure: it is possible to craft signatures that\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\n * this is by receiving a hash of the original message (which may otherwise\n * be too long), and then calling {MessageHashUtils-toEthSignedMessageHash} on it.\n *\n * Documentation for signature generation:\n * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]\n * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]\n */\n function tryRecover(\n bytes32 hash,\n bytes memory signature\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\n if (signature.length == 65) {\n bytes32 r;\n bytes32 s;\n uint8 v;\n // ecrecover takes the signature parameters, and the only way to get them\n // currently is to use assembly.\n assembly (\"memory-safe\") {\n r := mload(add(signature, 0x20))\n s := mload(add(signature, 0x40))\n v := byte(0, mload(add(signature, 0x60)))\n }\n return tryRecover(hash, v, r, s);\n } else {\n return (address(0), RecoverError.InvalidSignatureLength, bytes32(signature.length));\n }\n }\n\n /**\n * @dev Returns the address that signed a hashed message (`hash`) with\n * `signature`. This address can then be used for verification purposes.\n *\n * The `ecrecover` EVM precompile allows for malleable (non-unique) signatures:\n * this function rejects them by requiring the `s` value to be in the lower\n * half order, and the `v` value to be either 27 or 28.\n *\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\n * verification to be secure: it is possible to craft signatures that\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\n * this is by receiving a hash of the original message (which may otherwise\n * be too long), and then calling {MessageHashUtils-toEthSignedMessageHash} on it.\n */\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\n (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, signature);\n _throwError(error, errorArg);\n return recovered;\n }\n\n /**\n * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.\n *\n * See https://eips.ethereum.org/EIPS/eip-2098[ERC-2098 short signatures]\n */\n function tryRecover(\n bytes32 hash,\n bytes32 r,\n bytes32 vs\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\n unchecked {\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\n // We do not check for an overflow here since the shift operation results in 0 or 1.\n uint8 v = uint8((uint256(vs) >> 255) + 27);\n return tryRecover(hash, v, r, s);\n }\n }\n\n /**\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\n */\n function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) {\n (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, r, vs);\n _throwError(error, errorArg);\n return recovered;\n }\n\n /**\n * @dev Overload of {ECDSA-tryRecover} that receives the `v`,\n * `r` and `s` signature fields separately.\n */\n function tryRecover(\n bytes32 hash,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\n // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\n // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\n // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most\n // signatures from current libraries generate a unique signature with an s-value in the lower half order.\n //\n // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\n // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\n // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\n // these malleable signatures as well.\n if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\n return (address(0), RecoverError.InvalidSignatureS, s);\n }\n\n // If the signature is valid (and not malleable), return the signer address\n address signer = ecrecover(hash, v, r, s);\n if (signer == address(0)) {\n return (address(0), RecoverError.InvalidSignature, bytes32(0));\n }\n\n return (signer, RecoverError.NoError, bytes32(0));\n }\n\n /**\n * @dev Overload of {ECDSA-recover} that receives the `v`,\n * `r` and `s` signature fields separately.\n */\n function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) {\n (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, v, r, s);\n _throwError(error, errorArg);\n return recovered;\n }\n\n /**\n * @dev Optionally reverts with the corresponding custom error according to the `error` argument provided.\n */\n function _throwError(RecoverError error, bytes32 errorArg) private pure {\n if (error == RecoverError.NoError) {\n return; // no error: do nothing\n } else if (error == RecoverError.InvalidSignature) {\n revert ECDSAInvalidSignature();\n } else if (error == RecoverError.InvalidSignatureLength) {\n revert ECDSAInvalidSignatureLength(uint256(errorArg));\n } else if (error == RecoverError.InvalidSignatureS) {\n revert ECDSAInvalidSignatureS(errorArg);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.3.0) (utils/cryptography/MessageHashUtils.sol)\n\npragma solidity ^0.8.20;\n\nimport {Strings} from \"../Strings.sol\";\n\n/**\n * @dev Signature message hash utilities for producing digests to be consumed by {ECDSA} recovery or signing.\n *\n * The library provides methods for generating a hash of a message that conforms to the\n * https://eips.ethereum.org/EIPS/eip-191[ERC-191] and https://eips.ethereum.org/EIPS/eip-712[EIP 712]\n * specifications.\n */\nlibrary MessageHashUtils {\n /**\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\n * `0x45` (`personal_sign` messages).\n *\n * The digest is calculated by prefixing a bytes32 `messageHash` with\n * `\"\\x19Ethereum Signed Message:\\n32\"` and hashing the result. It corresponds with the\n * hash signed when using the https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sign[`eth_sign`] JSON-RPC method.\n *\n * NOTE: The `messageHash` parameter is intended to be the result of hashing a raw message with\n * keccak256, although any bytes32 value can be safely used because the final digest will\n * be re-hashed.\n *\n * See {ECDSA-recover}.\n */\n function toEthSignedMessageHash(bytes32 messageHash) internal pure returns (bytes32 digest) {\n assembly (\"memory-safe\") {\n mstore(0x00, \"\\x19Ethereum Signed Message:\\n32\") // 32 is the bytes-length of messageHash\n mstore(0x1c, messageHash) // 0x1c (28) is the length of the prefix\n digest := keccak256(0x00, 0x3c) // 0x3c is the length of the prefix (0x1c) + messageHash (0x20)\n }\n }\n\n /**\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\n * `0x45` (`personal_sign` messages).\n *\n * The digest is calculated by prefixing an arbitrary `message` with\n * `\"\\x19Ethereum Signed Message:\\n\" + len(message)` and hashing the result. It corresponds with the\n * hash signed when using the https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sign[`eth_sign`] JSON-RPC method.\n *\n * See {ECDSA-recover}.\n */\n function toEthSignedMessageHash(bytes memory message) internal pure returns (bytes32) {\n return\n keccak256(bytes.concat(\"\\x19Ethereum Signed Message:\\n\", bytes(Strings.toString(message.length)), message));\n }\n\n /**\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\n * `0x00` (data with intended validator).\n *\n * The digest is calculated by prefixing an arbitrary `data` with `\"\\x19\\x00\"` and the intended\n * `validator` address. Then hashing the result.\n *\n * See {ECDSA-recover}.\n */\n function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) {\n return keccak256(abi.encodePacked(hex\"19_00\", validator, data));\n }\n\n /**\n * @dev Variant of {toDataWithIntendedValidatorHash-address-bytes} optimized for cases where `data` is a bytes32.\n */\n function toDataWithIntendedValidatorHash(\n address validator,\n bytes32 messageHash\n ) internal pure returns (bytes32 digest) {\n assembly (\"memory-safe\") {\n mstore(0x00, hex\"19_00\")\n mstore(0x02, shl(96, validator))\n mstore(0x16, messageHash)\n digest := keccak256(0x00, 0x36)\n }\n }\n\n /**\n * @dev Returns the keccak256 digest of an EIP-712 typed data (ERC-191 version `0x01`).\n *\n * The digest is calculated from a `domainSeparator` and a `structHash`, by prefixing them with\n * `\\x19\\x01` and hashing the result. It corresponds to the hash signed by the\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] JSON-RPC method as part of EIP-712.\n *\n * See {ECDSA-recover}.\n */\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 digest) {\n assembly (\"memory-safe\") {\n let ptr := mload(0x40)\n mstore(ptr, hex\"19_01\")\n mstore(add(ptr, 0x02), domainSeparator)\n mstore(add(ptr, 0x22), structHash)\n digest := keccak256(ptr, 0x42)\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Errors.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Errors.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Collection of common custom errors used in multiple contracts\n *\n * IMPORTANT: Backwards compatibility is not guaranteed in future versions of the library.\n * It is recommended to avoid relying on the error API for critical functionality.\n *\n * _Available since v5.1._\n */\nlibrary Errors {\n /**\n * @dev The ETH balance of the account is not enough to perform the operation.\n */\n error InsufficientBalance(uint256 balance, uint256 needed);\n\n /**\n * @dev A call to an address target failed. The target may have reverted.\n */\n error FailedCall();\n\n /**\n * @dev The deployment failed.\n */\n error FailedDeployment();\n\n /**\n * @dev A necessary precompile is missing.\n */\n error MissingPrecompile(address);\n}\n" + }, + "@openzeppelin/contracts/utils/math/Math.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.3.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.20;\n\nimport {Panic} from \"../Panic.sol\";\nimport {SafeCast} from \"./SafeCast.sol\";\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n enum Rounding {\n Floor, // Toward negative infinity\n Ceil, // Toward positive infinity\n Trunc, // Toward zero\n Expand // Away from zero\n }\n\n /**\n * @dev Return the 512-bit addition of two uint256.\n *\n * The result is stored in two 256 variables such that sum = high * 2²⁵⁶ + low.\n */\n function add512(uint256 a, uint256 b) internal pure returns (uint256 high, uint256 low) {\n assembly (\"memory-safe\") {\n low := add(a, b)\n high := lt(low, a)\n }\n }\n\n /**\n * @dev Return the 512-bit multiplication of two uint256.\n *\n * The result is stored in two 256 variables such that product = high * 2²⁵⁶ + low.\n */\n function mul512(uint256 a, uint256 b) internal pure returns (uint256 high, uint256 low) {\n // 512-bit multiply [high low] = x * y. Compute the product mod 2²⁵⁶ and mod 2²⁵⁶ - 1, then use\n // the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n // variables such that product = high * 2²⁵⁶ + low.\n assembly (\"memory-safe\") {\n let mm := mulmod(a, b, not(0))\n low := mul(a, b)\n high := sub(sub(mm, low), lt(mm, low))\n }\n }\n\n /**\n * @dev Returns the addition of two unsigned integers, with a success flag (no overflow).\n */\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n uint256 c = a + b;\n success = c >= a;\n result = c * SafeCast.toUint(success);\n }\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, with a success flag (no overflow).\n */\n function trySub(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n uint256 c = a - b;\n success = c <= a;\n result = c * SafeCast.toUint(success);\n }\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, with a success flag (no overflow).\n */\n function tryMul(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n uint256 c = a * b;\n assembly (\"memory-safe\") {\n // Only true when the multiplication doesn't overflow\n // (c / a == b) || (a == 0)\n success := or(eq(div(c, a), b), iszero(a))\n }\n // equivalent to: success ? c : 0\n result = c * SafeCast.toUint(success);\n }\n }\n\n /**\n * @dev Returns the division of two unsigned integers, with a success flag (no division by zero).\n */\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n success = b > 0;\n assembly (\"memory-safe\") {\n // The `DIV` opcode returns zero when the denominator is 0.\n result := div(a, b)\n }\n }\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers, with a success flag (no division by zero).\n */\n function tryMod(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n success = b > 0;\n assembly (\"memory-safe\") {\n // The `MOD` opcode returns zero when the denominator is 0.\n result := mod(a, b)\n }\n }\n }\n\n /**\n * @dev Unsigned saturating addition, bounds to `2²⁵⁶ - 1` instead of overflowing.\n */\n function saturatingAdd(uint256 a, uint256 b) internal pure returns (uint256) {\n (bool success, uint256 result) = tryAdd(a, b);\n return ternary(success, result, type(uint256).max);\n }\n\n /**\n * @dev Unsigned saturating subtraction, bounds to zero instead of overflowing.\n */\n function saturatingSub(uint256 a, uint256 b) internal pure returns (uint256) {\n (, uint256 result) = trySub(a, b);\n return result;\n }\n\n /**\n * @dev Unsigned saturating multiplication, bounds to `2²⁵⁶ - 1` instead of overflowing.\n */\n function saturatingMul(uint256 a, uint256 b) internal pure returns (uint256) {\n (bool success, uint256 result) = tryMul(a, b);\n return ternary(success, result, type(uint256).max);\n }\n\n /**\n * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\n *\n * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\n * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\n * one branch when needed, making this function more expensive.\n */\n function ternary(bool condition, uint256 a, uint256 b) internal pure returns (uint256) {\n unchecked {\n // branchless ternary works because:\n // b ^ (a ^ b) == a\n // b ^ 0 == b\n return b ^ ((a ^ b) * SafeCast.toUint(condition));\n }\n }\n\n /**\n * @dev Returns the largest of two numbers.\n */\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return ternary(a > b, a, b);\n }\n\n /**\n * @dev Returns the smallest of two numbers.\n */\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return ternary(a < b, a, b);\n }\n\n /**\n * @dev Returns the average of two numbers. The result is rounded towards\n * zero.\n */\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b) / 2 can overflow.\n return (a & b) + (a ^ b) / 2;\n }\n\n /**\n * @dev Returns the ceiling of the division of two numbers.\n *\n * This differs from standard division with `/` in that it rounds towards infinity instead\n * of rounding towards zero.\n */\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n if (b == 0) {\n // Guarantee the same behavior as in a regular Solidity division.\n Panic.panic(Panic.DIVISION_BY_ZERO);\n }\n\n // The following calculation ensures accurate ceiling division without overflow.\n // Since a is non-zero, (a - 1) / b will not overflow.\n // The largest possible result occurs when (a - 1) / b is type(uint256).max,\n // but the largest value we can obtain is type(uint256).max - 1, which happens\n // when a = type(uint256).max and b = 1.\n unchecked {\n return SafeCast.toUint(a > 0) * ((a - 1) / b + 1);\n }\n }\n\n /**\n * @dev Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or\n * denominator == 0.\n *\n * Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by\n * Uniswap Labs also under MIT license.\n */\n function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {\n unchecked {\n (uint256 high, uint256 low) = mul512(x, y);\n\n // Handle non-overflow cases, 256 by 256 division.\n if (high == 0) {\n // Solidity will revert if denominator == 0, unlike the div opcode on its own.\n // The surrounding unchecked block does not change this fact.\n // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.\n return low / denominator;\n }\n\n // Make sure the result is less than 2²⁵⁶. Also prevents denominator == 0.\n if (denominator <= high) {\n Panic.panic(ternary(denominator == 0, Panic.DIVISION_BY_ZERO, Panic.UNDER_OVERFLOW));\n }\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [high low].\n uint256 remainder;\n assembly (\"memory-safe\") {\n // Compute remainder using mulmod.\n remainder := mulmod(x, y, denominator)\n\n // Subtract 256 bit number from 512 bit number.\n high := sub(high, gt(remainder, low))\n low := sub(low, remainder)\n }\n\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator.\n // Always >= 1. See https://cs.stackexchange.com/q/138556/92363.\n\n uint256 twos = denominator & (0 - denominator);\n assembly (\"memory-safe\") {\n // Divide denominator by twos.\n denominator := div(denominator, twos)\n\n // Divide [high low] by twos.\n low := div(low, twos)\n\n // Flip twos such that it is 2²⁵⁶ / twos. If twos is zero, then it becomes one.\n twos := add(div(sub(0, twos), twos), 1)\n }\n\n // Shift in bits from high into low.\n low |= high * twos;\n\n // Invert denominator mod 2²⁵⁶. Now that denominator is an odd number, it has an inverse modulo 2²⁵⁶ such\n // that denominator * inv ≡ 1 mod 2²⁵⁶. Compute the inverse by starting with a seed that is correct for\n // four bits. That is, denominator * inv ≡ 1 mod 2⁴.\n uint256 inverse = (3 * denominator) ^ 2;\n\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also\n // works in modular arithmetic, doubling the correct bits in each step.\n inverse *= 2 - denominator * inverse; // inverse mod 2⁸\n inverse *= 2 - denominator * inverse; // inverse mod 2¹⁶\n inverse *= 2 - denominator * inverse; // inverse mod 2³²\n inverse *= 2 - denominator * inverse; // inverse mod 2⁶⁴\n inverse *= 2 - denominator * inverse; // inverse mod 2¹²⁸\n inverse *= 2 - denominator * inverse; // inverse mod 2²⁵⁶\n\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n // This will give us the correct result modulo 2²⁵⁶. Since the preconditions guarantee that the outcome is\n // less than 2²⁵⁶, this is the final result. We don't need to compute the high bits of the result and high\n // is no longer required.\n result = low * inverse;\n return result;\n }\n }\n\n /**\n * @dev Calculates x * y / denominator with full precision, following the selected rounding direction.\n */\n function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {\n return mulDiv(x, y, denominator) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0);\n }\n\n /**\n * @dev Calculates floor(x * y >> n) with full precision. Throws if result overflows a uint256.\n */\n function mulShr(uint256 x, uint256 y, uint8 n) internal pure returns (uint256 result) {\n unchecked {\n (uint256 high, uint256 low) = mul512(x, y);\n if (high >= 1 << n) {\n Panic.panic(Panic.UNDER_OVERFLOW);\n }\n return (high << (256 - n)) | (low >> n);\n }\n }\n\n /**\n * @dev Calculates x * y >> n with full precision, following the selected rounding direction.\n */\n function mulShr(uint256 x, uint256 y, uint8 n, Rounding rounding) internal pure returns (uint256) {\n return mulShr(x, y, n) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, 1 << n) > 0);\n }\n\n /**\n * @dev Calculate the modular multiplicative inverse of a number in Z/nZ.\n *\n * If n is a prime, then Z/nZ is a field. In that case all elements are inversible, except 0.\n * If n is not a prime, then Z/nZ is not a field, and some elements might not be inversible.\n *\n * If the input value is not inversible, 0 is returned.\n *\n * NOTE: If you know for sure that n is (big) a prime, it may be cheaper to use Fermat's little theorem and get the\n * inverse using `Math.modExp(a, n - 2, n)`. See {invModPrime}.\n */\n function invMod(uint256 a, uint256 n) internal pure returns (uint256) {\n unchecked {\n if (n == 0) return 0;\n\n // The inverse modulo is calculated using the Extended Euclidean Algorithm (iterative version)\n // Used to compute integers x and y such that: ax + ny = gcd(a, n).\n // When the gcd is 1, then the inverse of a modulo n exists and it's x.\n // ax + ny = 1\n // ax = 1 + (-y)n\n // ax ≡ 1 (mod n) # x is the inverse of a modulo n\n\n // If the remainder is 0 the gcd is n right away.\n uint256 remainder = a % n;\n uint256 gcd = n;\n\n // Therefore the initial coefficients are:\n // ax + ny = gcd(a, n) = n\n // 0a + 1n = n\n int256 x = 0;\n int256 y = 1;\n\n while (remainder != 0) {\n uint256 quotient = gcd / remainder;\n\n (gcd, remainder) = (\n // The old remainder is the next gcd to try.\n remainder,\n // Compute the next remainder.\n // Can't overflow given that (a % gcd) * (gcd // (a % gcd)) <= gcd\n // where gcd is at most n (capped to type(uint256).max)\n gcd - remainder * quotient\n );\n\n (x, y) = (\n // Increment the coefficient of a.\n y,\n // Decrement the coefficient of n.\n // Can overflow, but the result is casted to uint256 so that the\n // next value of y is \"wrapped around\" to a value between 0 and n - 1.\n x - y * int256(quotient)\n );\n }\n\n if (gcd != 1) return 0; // No inverse exists.\n return ternary(x < 0, n - uint256(-x), uint256(x)); // Wrap the result if it's negative.\n }\n }\n\n /**\n * @dev Variant of {invMod}. More efficient, but only works if `p` is known to be a prime greater than `2`.\n *\n * From https://en.wikipedia.org/wiki/Fermat%27s_little_theorem[Fermat's little theorem], we know that if p is\n * prime, then `a**(p-1) ≡ 1 mod p`. As a consequence, we have `a * a**(p-2) ≡ 1 mod p`, which means that\n * `a**(p-2)` is the modular multiplicative inverse of a in Fp.\n *\n * NOTE: this function does NOT check that `p` is a prime greater than `2`.\n */\n function invModPrime(uint256 a, uint256 p) internal view returns (uint256) {\n unchecked {\n return Math.modExp(a, p - 2, p);\n }\n }\n\n /**\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m)\n *\n * Requirements:\n * - modulus can't be zero\n * - underlying staticcall to precompile must succeed\n *\n * IMPORTANT: The result is only valid if the underlying call succeeds. When using this function, make\n * sure the chain you're using it on supports the precompiled contract for modular exponentiation\n * at address 0x05 as specified in https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise,\n * the underlying function will succeed given the lack of a revert, but the result may be incorrectly\n * interpreted as 0.\n */\n function modExp(uint256 b, uint256 e, uint256 m) internal view returns (uint256) {\n (bool success, uint256 result) = tryModExp(b, e, m);\n if (!success) {\n Panic.panic(Panic.DIVISION_BY_ZERO);\n }\n return result;\n }\n\n /**\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m).\n * It includes a success flag indicating if the operation succeeded. Operation will be marked as failed if trying\n * to operate modulo 0 or if the underlying precompile reverted.\n *\n * IMPORTANT: The result is only valid if the success flag is true. When using this function, make sure the chain\n * you're using it on supports the precompiled contract for modular exponentiation at address 0x05 as specified in\n * https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, the underlying function will succeed given the lack\n * of a revert, but the result may be incorrectly interpreted as 0.\n */\n function tryModExp(uint256 b, uint256 e, uint256 m) internal view returns (bool success, uint256 result) {\n if (m == 0) return (false, 0);\n assembly (\"memory-safe\") {\n let ptr := mload(0x40)\n // | Offset | Content | Content (Hex) |\n // |-----------|------------|--------------------------------------------------------------------|\n // | 0x00:0x1f | size of b | 0x0000000000000000000000000000000000000000000000000000000000000020 |\n // | 0x20:0x3f | size of e | 0x0000000000000000000000000000000000000000000000000000000000000020 |\n // | 0x40:0x5f | size of m | 0x0000000000000000000000000000000000000000000000000000000000000020 |\n // | 0x60:0x7f | value of b | 0x<.............................................................b> |\n // | 0x80:0x9f | value of e | 0x<.............................................................e> |\n // | 0xa0:0xbf | value of m | 0x<.............................................................m> |\n mstore(ptr, 0x20)\n mstore(add(ptr, 0x20), 0x20)\n mstore(add(ptr, 0x40), 0x20)\n mstore(add(ptr, 0x60), b)\n mstore(add(ptr, 0x80), e)\n mstore(add(ptr, 0xa0), m)\n\n // Given the result < m, it's guaranteed to fit in 32 bytes,\n // so we can use the memory scratch space located at offset 0.\n success := staticcall(gas(), 0x05, ptr, 0xc0, 0x00, 0x20)\n result := mload(0x00)\n }\n }\n\n /**\n * @dev Variant of {modExp} that supports inputs of arbitrary length.\n */\n function modExp(bytes memory b, bytes memory e, bytes memory m) internal view returns (bytes memory) {\n (bool success, bytes memory result) = tryModExp(b, e, m);\n if (!success) {\n Panic.panic(Panic.DIVISION_BY_ZERO);\n }\n return result;\n }\n\n /**\n * @dev Variant of {tryModExp} that supports inputs of arbitrary length.\n */\n function tryModExp(\n bytes memory b,\n bytes memory e,\n bytes memory m\n ) internal view returns (bool success, bytes memory result) {\n if (_zeroBytes(m)) return (false, new bytes(0));\n\n uint256 mLen = m.length;\n\n // Encode call args in result and move the free memory pointer\n result = abi.encodePacked(b.length, e.length, mLen, b, e, m);\n\n assembly (\"memory-safe\") {\n let dataPtr := add(result, 0x20)\n // Write result on top of args to avoid allocating extra memory.\n success := staticcall(gas(), 0x05, dataPtr, mload(result), dataPtr, mLen)\n // Overwrite the length.\n // result.length > returndatasize() is guaranteed because returndatasize() == m.length\n mstore(result, mLen)\n // Set the memory pointer after the returned data.\n mstore(0x40, add(dataPtr, mLen))\n }\n }\n\n /**\n * @dev Returns whether the provided byte array is zero.\n */\n function _zeroBytes(bytes memory byteArray) private pure returns (bool) {\n for (uint256 i = 0; i < byteArray.length; ++i) {\n if (byteArray[i] != 0) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded\n * towards zero.\n *\n * This method is based on Newton's method for computing square roots; the algorithm is restricted to only\n * using integer operations.\n */\n function sqrt(uint256 a) internal pure returns (uint256) {\n unchecked {\n // Take care of easy edge cases when a == 0 or a == 1\n if (a <= 1) {\n return a;\n }\n\n // In this function, we use Newton's method to get a root of `f(x) := x² - a`. It involves building a\n // sequence x_n that converges toward sqrt(a). For each iteration x_n, we also define the error between\n // the current value as `ε_n = | x_n - sqrt(a) |`.\n //\n // For our first estimation, we consider `e` the smallest power of 2 which is bigger than the square root\n // of the target. (i.e. `2**(e-1) ≤ sqrt(a) < 2**e`). We know that `e ≤ 128` because `(2¹²⁸)² = 2²⁵⁶` is\n // bigger than any uint256.\n //\n // By noticing that\n // `2**(e-1) ≤ sqrt(a) < 2**e → (2**(e-1))² ≤ a < (2**e)² → 2**(2*e-2) ≤ a < 2**(2*e)`\n // we can deduce that `e - 1` is `log2(a) / 2`. We can thus compute `x_n = 2**(e-1)` using a method similar\n // to the msb function.\n uint256 aa = a;\n uint256 xn = 1;\n\n if (aa >= (1 << 128)) {\n aa >>= 128;\n xn <<= 64;\n }\n if (aa >= (1 << 64)) {\n aa >>= 64;\n xn <<= 32;\n }\n if (aa >= (1 << 32)) {\n aa >>= 32;\n xn <<= 16;\n }\n if (aa >= (1 << 16)) {\n aa >>= 16;\n xn <<= 8;\n }\n if (aa >= (1 << 8)) {\n aa >>= 8;\n xn <<= 4;\n }\n if (aa >= (1 << 4)) {\n aa >>= 4;\n xn <<= 2;\n }\n if (aa >= (1 << 2)) {\n xn <<= 1;\n }\n\n // We now have x_n such that `x_n = 2**(e-1) ≤ sqrt(a) < 2**e = 2 * x_n`. This implies ε_n ≤ 2**(e-1).\n //\n // We can refine our estimation by noticing that the middle of that interval minimizes the error.\n // If we move x_n to equal 2**(e-1) + 2**(e-2), then we reduce the error to ε_n ≤ 2**(e-2).\n // This is going to be our x_0 (and ε_0)\n xn = (3 * xn) >> 1; // ε_0 := | x_0 - sqrt(a) | ≤ 2**(e-2)\n\n // From here, Newton's method give us:\n // x_{n+1} = (x_n + a / x_n) / 2\n //\n // One should note that:\n // x_{n+1}² - a = ((x_n + a / x_n) / 2)² - a\n // = ((x_n² + a) / (2 * x_n))² - a\n // = (x_n⁴ + 2 * a * x_n² + a²) / (4 * x_n²) - a\n // = (x_n⁴ + 2 * a * x_n² + a² - 4 * a * x_n²) / (4 * x_n²)\n // = (x_n⁴ - 2 * a * x_n² + a²) / (4 * x_n²)\n // = (x_n² - a)² / (2 * x_n)²\n // = ((x_n² - a) / (2 * x_n))²\n // ≥ 0\n // Which proves that for all n ≥ 1, sqrt(a) ≤ x_n\n //\n // This gives us the proof of quadratic convergence of the sequence:\n // ε_{n+1} = | x_{n+1} - sqrt(a) |\n // = | (x_n + a / x_n) / 2 - sqrt(a) |\n // = | (x_n² + a - 2*x_n*sqrt(a)) / (2 * x_n) |\n // = | (x_n - sqrt(a))² / (2 * x_n) |\n // = | ε_n² / (2 * x_n) |\n // = ε_n² / | (2 * x_n) |\n //\n // For the first iteration, we have a special case where x_0 is known:\n // ε_1 = ε_0² / | (2 * x_0) |\n // ≤ (2**(e-2))² / (2 * (2**(e-1) + 2**(e-2)))\n // ≤ 2**(2*e-4) / (3 * 2**(e-1))\n // ≤ 2**(e-3) / 3\n // ≤ 2**(e-3-log2(3))\n // ≤ 2**(e-4.5)\n //\n // For the following iterations, we use the fact that, 2**(e-1) ≤ sqrt(a) ≤ x_n:\n // ε_{n+1} = ε_n² / | (2 * x_n) |\n // ≤ (2**(e-k))² / (2 * 2**(e-1))\n // ≤ 2**(2*e-2*k) / 2**e\n // ≤ 2**(e-2*k)\n xn = (xn + a / xn) >> 1; // ε_1 := | x_1 - sqrt(a) | ≤ 2**(e-4.5) -- special case, see above\n xn = (xn + a / xn) >> 1; // ε_2 := | x_2 - sqrt(a) | ≤ 2**(e-9) -- general case with k = 4.5\n xn = (xn + a / xn) >> 1; // ε_3 := | x_3 - sqrt(a) | ≤ 2**(e-18) -- general case with k = 9\n xn = (xn + a / xn) >> 1; // ε_4 := | x_4 - sqrt(a) | ≤ 2**(e-36) -- general case with k = 18\n xn = (xn + a / xn) >> 1; // ε_5 := | x_5 - sqrt(a) | ≤ 2**(e-72) -- general case with k = 36\n xn = (xn + a / xn) >> 1; // ε_6 := | x_6 - sqrt(a) | ≤ 2**(e-144) -- general case with k = 72\n\n // Because e ≤ 128 (as discussed during the first estimation phase), we know have reached a precision\n // ε_6 ≤ 2**(e-144) < 1. Given we're operating on integers, then we can ensure that xn is now either\n // sqrt(a) or sqrt(a) + 1.\n return xn - SafeCast.toUint(xn > a / xn);\n }\n }\n\n /**\n * @dev Calculates sqrt(a), following the selected rounding direction.\n */\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = sqrt(a);\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && result * result < a);\n }\n }\n\n /**\n * @dev Return the log in base 2 of a positive value rounded towards zero.\n * Returns 0 if given 0.\n */\n function log2(uint256 x) internal pure returns (uint256 r) {\n // If value has upper 128 bits set, log2 result is at least 128\n r = SafeCast.toUint(x > 0xffffffffffffffffffffffffffffffff) << 7;\n // If upper 64 bits of 128-bit half set, add 64 to result\n r |= SafeCast.toUint((x >> r) > 0xffffffffffffffff) << 6;\n // If upper 32 bits of 64-bit half set, add 32 to result\n r |= SafeCast.toUint((x >> r) > 0xffffffff) << 5;\n // If upper 16 bits of 32-bit half set, add 16 to result\n r |= SafeCast.toUint((x >> r) > 0xffff) << 4;\n // If upper 8 bits of 16-bit half set, add 8 to result\n r |= SafeCast.toUint((x >> r) > 0xff) << 3;\n // If upper 4 bits of 8-bit half set, add 4 to result\n r |= SafeCast.toUint((x >> r) > 0xf) << 2;\n\n // Shifts value right by the current result and use it as an index into this lookup table:\n //\n // | x (4 bits) | index | table[index] = MSB position |\n // |------------|---------|-----------------------------|\n // | 0000 | 0 | table[0] = 0 |\n // | 0001 | 1 | table[1] = 0 |\n // | 0010 | 2 | table[2] = 1 |\n // | 0011 | 3 | table[3] = 1 |\n // | 0100 | 4 | table[4] = 2 |\n // | 0101 | 5 | table[5] = 2 |\n // | 0110 | 6 | table[6] = 2 |\n // | 0111 | 7 | table[7] = 2 |\n // | 1000 | 8 | table[8] = 3 |\n // | 1001 | 9 | table[9] = 3 |\n // | 1010 | 10 | table[10] = 3 |\n // | 1011 | 11 | table[11] = 3 |\n // | 1100 | 12 | table[12] = 3 |\n // | 1101 | 13 | table[13] = 3 |\n // | 1110 | 14 | table[14] = 3 |\n // | 1111 | 15 | table[15] = 3 |\n //\n // The lookup table is represented as a 32-byte value with the MSB positions for 0-15 in the last 16 bytes.\n assembly (\"memory-safe\") {\n r := or(r, byte(shr(r, x), 0x0000010102020202030303030303030300000000000000000000000000000000))\n }\n }\n\n /**\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log2(value);\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << result < value);\n }\n }\n\n /**\n * @dev Return the log in base 10 of a positive value rounded towards zero.\n * Returns 0 if given 0.\n */\n function log10(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >= 10 ** 64) {\n value /= 10 ** 64;\n result += 64;\n }\n if (value >= 10 ** 32) {\n value /= 10 ** 32;\n result += 32;\n }\n if (value >= 10 ** 16) {\n value /= 10 ** 16;\n result += 16;\n }\n if (value >= 10 ** 8) {\n value /= 10 ** 8;\n result += 8;\n }\n if (value >= 10 ** 4) {\n value /= 10 ** 4;\n result += 4;\n }\n if (value >= 10 ** 2) {\n value /= 10 ** 2;\n result += 2;\n }\n if (value >= 10 ** 1) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log10(value);\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 10 ** result < value);\n }\n }\n\n /**\n * @dev Return the log in base 256 of a positive value rounded towards zero.\n * Returns 0 if given 0.\n *\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n */\n function log256(uint256 x) internal pure returns (uint256 r) {\n // If value has upper 128 bits set, log2 result is at least 128\n r = SafeCast.toUint(x > 0xffffffffffffffffffffffffffffffff) << 7;\n // If upper 64 bits of 128-bit half set, add 64 to result\n r |= SafeCast.toUint((x >> r) > 0xffffffffffffffff) << 6;\n // If upper 32 bits of 64-bit half set, add 32 to result\n r |= SafeCast.toUint((x >> r) > 0xffffffff) << 5;\n // If upper 16 bits of 32-bit half set, add 16 to result\n r |= SafeCast.toUint((x >> r) > 0xffff) << 4;\n // Add 1 if upper 8 bits of 16-bit half set, and divide accumulated result by 8\n return (r >> 3) | SafeCast.toUint((x >> r) > 0xff);\n }\n\n /**\n * @dev Return the log in base 256, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log256(value);\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << (result << 3) < value);\n }\n }\n\n /**\n * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.\n */\n function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {\n return uint8(rounding) % 2 == 1;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/math/SafeCast.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SafeCast.sol)\n// This file was procedurally generated from scripts/generate/templates/SafeCast.js.\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Wrappers over Solidity's uintXX/intXX/bool casting operators with added overflow\n * checks.\n *\n * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can\n * easily result in undesired exploitation or bugs, since developers usually\n * assume that overflows raise errors. `SafeCast` restores this intuition by\n * reverting the transaction when such an operation overflows.\n *\n * Using this library instead of the unchecked operations eliminates an entire\n * class of bugs, so it's recommended to use it always.\n */\nlibrary SafeCast {\n /**\n * @dev Value doesn't fit in an uint of `bits` size.\n */\n error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value);\n\n /**\n * @dev An int value doesn't fit in an uint of `bits` size.\n */\n error SafeCastOverflowedIntToUint(int256 value);\n\n /**\n * @dev Value doesn't fit in an int of `bits` size.\n */\n error SafeCastOverflowedIntDowncast(uint8 bits, int256 value);\n\n /**\n * @dev An uint value doesn't fit in an int of `bits` size.\n */\n error SafeCastOverflowedUintToInt(uint256 value);\n\n /**\n * @dev Returns the downcasted uint248 from uint256, reverting on\n * overflow (when the input is greater than largest uint248).\n *\n * Counterpart to Solidity's `uint248` operator.\n *\n * Requirements:\n *\n * - input must fit into 248 bits\n */\n function toUint248(uint256 value) internal pure returns (uint248) {\n if (value > type(uint248).max) {\n revert SafeCastOverflowedUintDowncast(248, value);\n }\n return uint248(value);\n }\n\n /**\n * @dev Returns the downcasted uint240 from uint256, reverting on\n * overflow (when the input is greater than largest uint240).\n *\n * Counterpart to Solidity's `uint240` operator.\n *\n * Requirements:\n *\n * - input must fit into 240 bits\n */\n function toUint240(uint256 value) internal pure returns (uint240) {\n if (value > type(uint240).max) {\n revert SafeCastOverflowedUintDowncast(240, value);\n }\n return uint240(value);\n }\n\n /**\n * @dev Returns the downcasted uint232 from uint256, reverting on\n * overflow (when the input is greater than largest uint232).\n *\n * Counterpart to Solidity's `uint232` operator.\n *\n * Requirements:\n *\n * - input must fit into 232 bits\n */\n function toUint232(uint256 value) internal pure returns (uint232) {\n if (value > type(uint232).max) {\n revert SafeCastOverflowedUintDowncast(232, value);\n }\n return uint232(value);\n }\n\n /**\n * @dev Returns the downcasted uint224 from uint256, reverting on\n * overflow (when the input is greater than largest uint224).\n *\n * Counterpart to Solidity's `uint224` operator.\n *\n * Requirements:\n *\n * - input must fit into 224 bits\n */\n function toUint224(uint256 value) internal pure returns (uint224) {\n if (value > type(uint224).max) {\n revert SafeCastOverflowedUintDowncast(224, value);\n }\n return uint224(value);\n }\n\n /**\n * @dev Returns the downcasted uint216 from uint256, reverting on\n * overflow (when the input is greater than largest uint216).\n *\n * Counterpart to Solidity's `uint216` operator.\n *\n * Requirements:\n *\n * - input must fit into 216 bits\n */\n function toUint216(uint256 value) internal pure returns (uint216) {\n if (value > type(uint216).max) {\n revert SafeCastOverflowedUintDowncast(216, value);\n }\n return uint216(value);\n }\n\n /**\n * @dev Returns the downcasted uint208 from uint256, reverting on\n * overflow (when the input is greater than largest uint208).\n *\n * Counterpart to Solidity's `uint208` operator.\n *\n * Requirements:\n *\n * - input must fit into 208 bits\n */\n function toUint208(uint256 value) internal pure returns (uint208) {\n if (value > type(uint208).max) {\n revert SafeCastOverflowedUintDowncast(208, value);\n }\n return uint208(value);\n }\n\n /**\n * @dev Returns the downcasted uint200 from uint256, reverting on\n * overflow (when the input is greater than largest uint200).\n *\n * Counterpart to Solidity's `uint200` operator.\n *\n * Requirements:\n *\n * - input must fit into 200 bits\n */\n function toUint200(uint256 value) internal pure returns (uint200) {\n if (value > type(uint200).max) {\n revert SafeCastOverflowedUintDowncast(200, value);\n }\n return uint200(value);\n }\n\n /**\n * @dev Returns the downcasted uint192 from uint256, reverting on\n * overflow (when the input is greater than largest uint192).\n *\n * Counterpart to Solidity's `uint192` operator.\n *\n * Requirements:\n *\n * - input must fit into 192 bits\n */\n function toUint192(uint256 value) internal pure returns (uint192) {\n if (value > type(uint192).max) {\n revert SafeCastOverflowedUintDowncast(192, value);\n }\n return uint192(value);\n }\n\n /**\n * @dev Returns the downcasted uint184 from uint256, reverting on\n * overflow (when the input is greater than largest uint184).\n *\n * Counterpart to Solidity's `uint184` operator.\n *\n * Requirements:\n *\n * - input must fit into 184 bits\n */\n function toUint184(uint256 value) internal pure returns (uint184) {\n if (value > type(uint184).max) {\n revert SafeCastOverflowedUintDowncast(184, value);\n }\n return uint184(value);\n }\n\n /**\n * @dev Returns the downcasted uint176 from uint256, reverting on\n * overflow (when the input is greater than largest uint176).\n *\n * Counterpart to Solidity's `uint176` operator.\n *\n * Requirements:\n *\n * - input must fit into 176 bits\n */\n function toUint176(uint256 value) internal pure returns (uint176) {\n if (value > type(uint176).max) {\n revert SafeCastOverflowedUintDowncast(176, value);\n }\n return uint176(value);\n }\n\n /**\n * @dev Returns the downcasted uint168 from uint256, reverting on\n * overflow (when the input is greater than largest uint168).\n *\n * Counterpart to Solidity's `uint168` operator.\n *\n * Requirements:\n *\n * - input must fit into 168 bits\n */\n function toUint168(uint256 value) internal pure returns (uint168) {\n if (value > type(uint168).max) {\n revert SafeCastOverflowedUintDowncast(168, value);\n }\n return uint168(value);\n }\n\n /**\n * @dev Returns the downcasted uint160 from uint256, reverting on\n * overflow (when the input is greater than largest uint160).\n *\n * Counterpart to Solidity's `uint160` operator.\n *\n * Requirements:\n *\n * - input must fit into 160 bits\n */\n function toUint160(uint256 value) internal pure returns (uint160) {\n if (value > type(uint160).max) {\n revert SafeCastOverflowedUintDowncast(160, value);\n }\n return uint160(value);\n }\n\n /**\n * @dev Returns the downcasted uint152 from uint256, reverting on\n * overflow (when the input is greater than largest uint152).\n *\n * Counterpart to Solidity's `uint152` operator.\n *\n * Requirements:\n *\n * - input must fit into 152 bits\n */\n function toUint152(uint256 value) internal pure returns (uint152) {\n if (value > type(uint152).max) {\n revert SafeCastOverflowedUintDowncast(152, value);\n }\n return uint152(value);\n }\n\n /**\n * @dev Returns the downcasted uint144 from uint256, reverting on\n * overflow (when the input is greater than largest uint144).\n *\n * Counterpart to Solidity's `uint144` operator.\n *\n * Requirements:\n *\n * - input must fit into 144 bits\n */\n function toUint144(uint256 value) internal pure returns (uint144) {\n if (value > type(uint144).max) {\n revert SafeCastOverflowedUintDowncast(144, value);\n }\n return uint144(value);\n }\n\n /**\n * @dev Returns the downcasted uint136 from uint256, reverting on\n * overflow (when the input is greater than largest uint136).\n *\n * Counterpart to Solidity's `uint136` operator.\n *\n * Requirements:\n *\n * - input must fit into 136 bits\n */\n function toUint136(uint256 value) internal pure returns (uint136) {\n if (value > type(uint136).max) {\n revert SafeCastOverflowedUintDowncast(136, value);\n }\n return uint136(value);\n }\n\n /**\n * @dev Returns the downcasted uint128 from uint256, reverting on\n * overflow (when the input is greater than largest uint128).\n *\n * Counterpart to Solidity's `uint128` operator.\n *\n * Requirements:\n *\n * - input must fit into 128 bits\n */\n function toUint128(uint256 value) internal pure returns (uint128) {\n if (value > type(uint128).max) {\n revert SafeCastOverflowedUintDowncast(128, value);\n }\n return uint128(value);\n }\n\n /**\n * @dev Returns the downcasted uint120 from uint256, reverting on\n * overflow (when the input is greater than largest uint120).\n *\n * Counterpart to Solidity's `uint120` operator.\n *\n * Requirements:\n *\n * - input must fit into 120 bits\n */\n function toUint120(uint256 value) internal pure returns (uint120) {\n if (value > type(uint120).max) {\n revert SafeCastOverflowedUintDowncast(120, value);\n }\n return uint120(value);\n }\n\n /**\n * @dev Returns the downcasted uint112 from uint256, reverting on\n * overflow (when the input is greater than largest uint112).\n *\n * Counterpart to Solidity's `uint112` operator.\n *\n * Requirements:\n *\n * - input must fit into 112 bits\n */\n function toUint112(uint256 value) internal pure returns (uint112) {\n if (value > type(uint112).max) {\n revert SafeCastOverflowedUintDowncast(112, value);\n }\n return uint112(value);\n }\n\n /**\n * @dev Returns the downcasted uint104 from uint256, reverting on\n * overflow (when the input is greater than largest uint104).\n *\n * Counterpart to Solidity's `uint104` operator.\n *\n * Requirements:\n *\n * - input must fit into 104 bits\n */\n function toUint104(uint256 value) internal pure returns (uint104) {\n if (value > type(uint104).max) {\n revert SafeCastOverflowedUintDowncast(104, value);\n }\n return uint104(value);\n }\n\n /**\n * @dev Returns the downcasted uint96 from uint256, reverting on\n * overflow (when the input is greater than largest uint96).\n *\n * Counterpart to Solidity's `uint96` operator.\n *\n * Requirements:\n *\n * - input must fit into 96 bits\n */\n function toUint96(uint256 value) internal pure returns (uint96) {\n if (value > type(uint96).max) {\n revert SafeCastOverflowedUintDowncast(96, value);\n }\n return uint96(value);\n }\n\n /**\n * @dev Returns the downcasted uint88 from uint256, reverting on\n * overflow (when the input is greater than largest uint88).\n *\n * Counterpart to Solidity's `uint88` operator.\n *\n * Requirements:\n *\n * - input must fit into 88 bits\n */\n function toUint88(uint256 value) internal pure returns (uint88) {\n if (value > type(uint88).max) {\n revert SafeCastOverflowedUintDowncast(88, value);\n }\n return uint88(value);\n }\n\n /**\n * @dev Returns the downcasted uint80 from uint256, reverting on\n * overflow (when the input is greater than largest uint80).\n *\n * Counterpart to Solidity's `uint80` operator.\n *\n * Requirements:\n *\n * - input must fit into 80 bits\n */\n function toUint80(uint256 value) internal pure returns (uint80) {\n if (value > type(uint80).max) {\n revert SafeCastOverflowedUintDowncast(80, value);\n }\n return uint80(value);\n }\n\n /**\n * @dev Returns the downcasted uint72 from uint256, reverting on\n * overflow (when the input is greater than largest uint72).\n *\n * Counterpart to Solidity's `uint72` operator.\n *\n * Requirements:\n *\n * - input must fit into 72 bits\n */\n function toUint72(uint256 value) internal pure returns (uint72) {\n if (value > type(uint72).max) {\n revert SafeCastOverflowedUintDowncast(72, value);\n }\n return uint72(value);\n }\n\n /**\n * @dev Returns the downcasted uint64 from uint256, reverting on\n * overflow (when the input is greater than largest uint64).\n *\n * Counterpart to Solidity's `uint64` operator.\n *\n * Requirements:\n *\n * - input must fit into 64 bits\n */\n function toUint64(uint256 value) internal pure returns (uint64) {\n if (value > type(uint64).max) {\n revert SafeCastOverflowedUintDowncast(64, value);\n }\n return uint64(value);\n }\n\n /**\n * @dev Returns the downcasted uint56 from uint256, reverting on\n * overflow (when the input is greater than largest uint56).\n *\n * Counterpart to Solidity's `uint56` operator.\n *\n * Requirements:\n *\n * - input must fit into 56 bits\n */\n function toUint56(uint256 value) internal pure returns (uint56) {\n if (value > type(uint56).max) {\n revert SafeCastOverflowedUintDowncast(56, value);\n }\n return uint56(value);\n }\n\n /**\n * @dev Returns the downcasted uint48 from uint256, reverting on\n * overflow (when the input is greater than largest uint48).\n *\n * Counterpart to Solidity's `uint48` operator.\n *\n * Requirements:\n *\n * - input must fit into 48 bits\n */\n function toUint48(uint256 value) internal pure returns (uint48) {\n if (value > type(uint48).max) {\n revert SafeCastOverflowedUintDowncast(48, value);\n }\n return uint48(value);\n }\n\n /**\n * @dev Returns the downcasted uint40 from uint256, reverting on\n * overflow (when the input is greater than largest uint40).\n *\n * Counterpart to Solidity's `uint40` operator.\n *\n * Requirements:\n *\n * - input must fit into 40 bits\n */\n function toUint40(uint256 value) internal pure returns (uint40) {\n if (value > type(uint40).max) {\n revert SafeCastOverflowedUintDowncast(40, value);\n }\n return uint40(value);\n }\n\n /**\n * @dev Returns the downcasted uint32 from uint256, reverting on\n * overflow (when the input is greater than largest uint32).\n *\n * Counterpart to Solidity's `uint32` operator.\n *\n * Requirements:\n *\n * - input must fit into 32 bits\n */\n function toUint32(uint256 value) internal pure returns (uint32) {\n if (value > type(uint32).max) {\n revert SafeCastOverflowedUintDowncast(32, value);\n }\n return uint32(value);\n }\n\n /**\n * @dev Returns the downcasted uint24 from uint256, reverting on\n * overflow (when the input is greater than largest uint24).\n *\n * Counterpart to Solidity's `uint24` operator.\n *\n * Requirements:\n *\n * - input must fit into 24 bits\n */\n function toUint24(uint256 value) internal pure returns (uint24) {\n if (value > type(uint24).max) {\n revert SafeCastOverflowedUintDowncast(24, value);\n }\n return uint24(value);\n }\n\n /**\n * @dev Returns the downcasted uint16 from uint256, reverting on\n * overflow (when the input is greater than largest uint16).\n *\n * Counterpart to Solidity's `uint16` operator.\n *\n * Requirements:\n *\n * - input must fit into 16 bits\n */\n function toUint16(uint256 value) internal pure returns (uint16) {\n if (value > type(uint16).max) {\n revert SafeCastOverflowedUintDowncast(16, value);\n }\n return uint16(value);\n }\n\n /**\n * @dev Returns the downcasted uint8 from uint256, reverting on\n * overflow (when the input is greater than largest uint8).\n *\n * Counterpart to Solidity's `uint8` operator.\n *\n * Requirements:\n *\n * - input must fit into 8 bits\n */\n function toUint8(uint256 value) internal pure returns (uint8) {\n if (value > type(uint8).max) {\n revert SafeCastOverflowedUintDowncast(8, value);\n }\n return uint8(value);\n }\n\n /**\n * @dev Converts a signed int256 into an unsigned uint256.\n *\n * Requirements:\n *\n * - input must be greater than or equal to 0.\n */\n function toUint256(int256 value) internal pure returns (uint256) {\n if (value < 0) {\n revert SafeCastOverflowedIntToUint(value);\n }\n return uint256(value);\n }\n\n /**\n * @dev Returns the downcasted int248 from int256, reverting on\n * overflow (when the input is less than smallest int248 or\n * greater than largest int248).\n *\n * Counterpart to Solidity's `int248` operator.\n *\n * Requirements:\n *\n * - input must fit into 248 bits\n */\n function toInt248(int256 value) internal pure returns (int248 downcasted) {\n downcasted = int248(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(248, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int240 from int256, reverting on\n * overflow (when the input is less than smallest int240 or\n * greater than largest int240).\n *\n * Counterpart to Solidity's `int240` operator.\n *\n * Requirements:\n *\n * - input must fit into 240 bits\n */\n function toInt240(int256 value) internal pure returns (int240 downcasted) {\n downcasted = int240(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(240, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int232 from int256, reverting on\n * overflow (when the input is less than smallest int232 or\n * greater than largest int232).\n *\n * Counterpart to Solidity's `int232` operator.\n *\n * Requirements:\n *\n * - input must fit into 232 bits\n */\n function toInt232(int256 value) internal pure returns (int232 downcasted) {\n downcasted = int232(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(232, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int224 from int256, reverting on\n * overflow (when the input is less than smallest int224 or\n * greater than largest int224).\n *\n * Counterpart to Solidity's `int224` operator.\n *\n * Requirements:\n *\n * - input must fit into 224 bits\n */\n function toInt224(int256 value) internal pure returns (int224 downcasted) {\n downcasted = int224(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(224, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int216 from int256, reverting on\n * overflow (when the input is less than smallest int216 or\n * greater than largest int216).\n *\n * Counterpart to Solidity's `int216` operator.\n *\n * Requirements:\n *\n * - input must fit into 216 bits\n */\n function toInt216(int256 value) internal pure returns (int216 downcasted) {\n downcasted = int216(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(216, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int208 from int256, reverting on\n * overflow (when the input is less than smallest int208 or\n * greater than largest int208).\n *\n * Counterpart to Solidity's `int208` operator.\n *\n * Requirements:\n *\n * - input must fit into 208 bits\n */\n function toInt208(int256 value) internal pure returns (int208 downcasted) {\n downcasted = int208(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(208, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int200 from int256, reverting on\n * overflow (when the input is less than smallest int200 or\n * greater than largest int200).\n *\n * Counterpart to Solidity's `int200` operator.\n *\n * Requirements:\n *\n * - input must fit into 200 bits\n */\n function toInt200(int256 value) internal pure returns (int200 downcasted) {\n downcasted = int200(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(200, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int192 from int256, reverting on\n * overflow (when the input is less than smallest int192 or\n * greater than largest int192).\n *\n * Counterpart to Solidity's `int192` operator.\n *\n * Requirements:\n *\n * - input must fit into 192 bits\n */\n function toInt192(int256 value) internal pure returns (int192 downcasted) {\n downcasted = int192(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(192, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int184 from int256, reverting on\n * overflow (when the input is less than smallest int184 or\n * greater than largest int184).\n *\n * Counterpart to Solidity's `int184` operator.\n *\n * Requirements:\n *\n * - input must fit into 184 bits\n */\n function toInt184(int256 value) internal pure returns (int184 downcasted) {\n downcasted = int184(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(184, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int176 from int256, reverting on\n * overflow (when the input is less than smallest int176 or\n * greater than largest int176).\n *\n * Counterpart to Solidity's `int176` operator.\n *\n * Requirements:\n *\n * - input must fit into 176 bits\n */\n function toInt176(int256 value) internal pure returns (int176 downcasted) {\n downcasted = int176(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(176, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int168 from int256, reverting on\n * overflow (when the input is less than smallest int168 or\n * greater than largest int168).\n *\n * Counterpart to Solidity's `int168` operator.\n *\n * Requirements:\n *\n * - input must fit into 168 bits\n */\n function toInt168(int256 value) internal pure returns (int168 downcasted) {\n downcasted = int168(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(168, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int160 from int256, reverting on\n * overflow (when the input is less than smallest int160 or\n * greater than largest int160).\n *\n * Counterpart to Solidity's `int160` operator.\n *\n * Requirements:\n *\n * - input must fit into 160 bits\n */\n function toInt160(int256 value) internal pure returns (int160 downcasted) {\n downcasted = int160(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(160, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int152 from int256, reverting on\n * overflow (when the input is less than smallest int152 or\n * greater than largest int152).\n *\n * Counterpart to Solidity's `int152` operator.\n *\n * Requirements:\n *\n * - input must fit into 152 bits\n */\n function toInt152(int256 value) internal pure returns (int152 downcasted) {\n downcasted = int152(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(152, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int144 from int256, reverting on\n * overflow (when the input is less than smallest int144 or\n * greater than largest int144).\n *\n * Counterpart to Solidity's `int144` operator.\n *\n * Requirements:\n *\n * - input must fit into 144 bits\n */\n function toInt144(int256 value) internal pure returns (int144 downcasted) {\n downcasted = int144(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(144, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int136 from int256, reverting on\n * overflow (when the input is less than smallest int136 or\n * greater than largest int136).\n *\n * Counterpart to Solidity's `int136` operator.\n *\n * Requirements:\n *\n * - input must fit into 136 bits\n */\n function toInt136(int256 value) internal pure returns (int136 downcasted) {\n downcasted = int136(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(136, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int128 from int256, reverting on\n * overflow (when the input is less than smallest int128 or\n * greater than largest int128).\n *\n * Counterpart to Solidity's `int128` operator.\n *\n * Requirements:\n *\n * - input must fit into 128 bits\n */\n function toInt128(int256 value) internal pure returns (int128 downcasted) {\n downcasted = int128(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(128, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int120 from int256, reverting on\n * overflow (when the input is less than smallest int120 or\n * greater than largest int120).\n *\n * Counterpart to Solidity's `int120` operator.\n *\n * Requirements:\n *\n * - input must fit into 120 bits\n */\n function toInt120(int256 value) internal pure returns (int120 downcasted) {\n downcasted = int120(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(120, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int112 from int256, reverting on\n * overflow (when the input is less than smallest int112 or\n * greater than largest int112).\n *\n * Counterpart to Solidity's `int112` operator.\n *\n * Requirements:\n *\n * - input must fit into 112 bits\n */\n function toInt112(int256 value) internal pure returns (int112 downcasted) {\n downcasted = int112(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(112, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int104 from int256, reverting on\n * overflow (when the input is less than smallest int104 or\n * greater than largest int104).\n *\n * Counterpart to Solidity's `int104` operator.\n *\n * Requirements:\n *\n * - input must fit into 104 bits\n */\n function toInt104(int256 value) internal pure returns (int104 downcasted) {\n downcasted = int104(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(104, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int96 from int256, reverting on\n * overflow (when the input is less than smallest int96 or\n * greater than largest int96).\n *\n * Counterpart to Solidity's `int96` operator.\n *\n * Requirements:\n *\n * - input must fit into 96 bits\n */\n function toInt96(int256 value) internal pure returns (int96 downcasted) {\n downcasted = int96(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(96, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int88 from int256, reverting on\n * overflow (when the input is less than smallest int88 or\n * greater than largest int88).\n *\n * Counterpart to Solidity's `int88` operator.\n *\n * Requirements:\n *\n * - input must fit into 88 bits\n */\n function toInt88(int256 value) internal pure returns (int88 downcasted) {\n downcasted = int88(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(88, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int80 from int256, reverting on\n * overflow (when the input is less than smallest int80 or\n * greater than largest int80).\n *\n * Counterpart to Solidity's `int80` operator.\n *\n * Requirements:\n *\n * - input must fit into 80 bits\n */\n function toInt80(int256 value) internal pure returns (int80 downcasted) {\n downcasted = int80(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(80, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int72 from int256, reverting on\n * overflow (when the input is less than smallest int72 or\n * greater than largest int72).\n *\n * Counterpart to Solidity's `int72` operator.\n *\n * Requirements:\n *\n * - input must fit into 72 bits\n */\n function toInt72(int256 value) internal pure returns (int72 downcasted) {\n downcasted = int72(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(72, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int64 from int256, reverting on\n * overflow (when the input is less than smallest int64 or\n * greater than largest int64).\n *\n * Counterpart to Solidity's `int64` operator.\n *\n * Requirements:\n *\n * - input must fit into 64 bits\n */\n function toInt64(int256 value) internal pure returns (int64 downcasted) {\n downcasted = int64(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(64, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int56 from int256, reverting on\n * overflow (when the input is less than smallest int56 or\n * greater than largest int56).\n *\n * Counterpart to Solidity's `int56` operator.\n *\n * Requirements:\n *\n * - input must fit into 56 bits\n */\n function toInt56(int256 value) internal pure returns (int56 downcasted) {\n downcasted = int56(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(56, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int48 from int256, reverting on\n * overflow (when the input is less than smallest int48 or\n * greater than largest int48).\n *\n * Counterpart to Solidity's `int48` operator.\n *\n * Requirements:\n *\n * - input must fit into 48 bits\n */\n function toInt48(int256 value) internal pure returns (int48 downcasted) {\n downcasted = int48(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(48, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int40 from int256, reverting on\n * overflow (when the input is less than smallest int40 or\n * greater than largest int40).\n *\n * Counterpart to Solidity's `int40` operator.\n *\n * Requirements:\n *\n * - input must fit into 40 bits\n */\n function toInt40(int256 value) internal pure returns (int40 downcasted) {\n downcasted = int40(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(40, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int32 from int256, reverting on\n * overflow (when the input is less than smallest int32 or\n * greater than largest int32).\n *\n * Counterpart to Solidity's `int32` operator.\n *\n * Requirements:\n *\n * - input must fit into 32 bits\n */\n function toInt32(int256 value) internal pure returns (int32 downcasted) {\n downcasted = int32(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(32, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int24 from int256, reverting on\n * overflow (when the input is less than smallest int24 or\n * greater than largest int24).\n *\n * Counterpart to Solidity's `int24` operator.\n *\n * Requirements:\n *\n * - input must fit into 24 bits\n */\n function toInt24(int256 value) internal pure returns (int24 downcasted) {\n downcasted = int24(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(24, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int16 from int256, reverting on\n * overflow (when the input is less than smallest int16 or\n * greater than largest int16).\n *\n * Counterpart to Solidity's `int16` operator.\n *\n * Requirements:\n *\n * - input must fit into 16 bits\n */\n function toInt16(int256 value) internal pure returns (int16 downcasted) {\n downcasted = int16(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(16, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int8 from int256, reverting on\n * overflow (when the input is less than smallest int8 or\n * greater than largest int8).\n *\n * Counterpart to Solidity's `int8` operator.\n *\n * Requirements:\n *\n * - input must fit into 8 bits\n */\n function toInt8(int256 value) internal pure returns (int8 downcasted) {\n downcasted = int8(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(8, value);\n }\n }\n\n /**\n * @dev Converts an unsigned uint256 into a signed int256.\n *\n * Requirements:\n *\n * - input must be less than or equal to maxInt256.\n */\n function toInt256(uint256 value) internal pure returns (int256) {\n // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive\n if (value > uint256(type(int256).max)) {\n revert SafeCastOverflowedUintToInt(value);\n }\n return int256(value);\n }\n\n /**\n * @dev Cast a boolean (false or true) to a uint256 (0 or 1) with no jump.\n */\n function toUint(bool b) internal pure returns (uint256 u) {\n assembly (\"memory-safe\") {\n u := iszero(iszero(b))\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/math/SignedMath.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SignedMath.sol)\n\npragma solidity ^0.8.20;\n\nimport {SafeCast} from \"./SafeCast.sol\";\n\n/**\n * @dev Standard signed math utilities missing in the Solidity language.\n */\nlibrary SignedMath {\n /**\n * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\n *\n * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\n * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\n * one branch when needed, making this function more expensive.\n */\n function ternary(bool condition, int256 a, int256 b) internal pure returns (int256) {\n unchecked {\n // branchless ternary works because:\n // b ^ (a ^ b) == a\n // b ^ 0 == b\n return b ^ ((a ^ b) * int256(SafeCast.toUint(condition)));\n }\n }\n\n /**\n * @dev Returns the largest of two signed numbers.\n */\n function max(int256 a, int256 b) internal pure returns (int256) {\n return ternary(a > b, a, b);\n }\n\n /**\n * @dev Returns the smallest of two signed numbers.\n */\n function min(int256 a, int256 b) internal pure returns (int256) {\n return ternary(a < b, a, b);\n }\n\n /**\n * @dev Returns the average of two signed numbers without overflow.\n * The result is rounded towards zero.\n */\n function average(int256 a, int256 b) internal pure returns (int256) {\n // Formula from the book \"Hacker's Delight\"\n int256 x = (a & b) + ((a ^ b) >> 1);\n return x + (int256(uint256(x) >> 255) & (a ^ b));\n }\n\n /**\n * @dev Returns the absolute unsigned value of a signed value.\n */\n function abs(int256 n) internal pure returns (uint256) {\n unchecked {\n // Formula from the \"Bit Twiddling Hacks\" by Sean Eron Anderson.\n // Since `n` is a signed integer, the generated bytecode will use the SAR opcode to perform the right shift,\n // taking advantage of the most significant (or \"sign\" bit) in two's complement representation.\n // This opcode adds new most significant bits set to the value of the previous most significant bit. As a result,\n // the mask will either be `bytes32(0)` (if n is positive) or `~bytes32(0)` (if n is negative).\n int256 mask = n >> 255;\n\n // A `bytes32(0)` mask leaves the input unchanged, while a `~bytes32(0)` mask complements it.\n return uint256((n + mask) ^ mask);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Panic.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Panic.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Helper library for emitting standardized panic codes.\n *\n * ```solidity\n * contract Example {\n * using Panic for uint256;\n *\n * // Use any of the declared internal constants\n * function foo() { Panic.GENERIC.panic(); }\n *\n * // Alternatively\n * function foo() { Panic.panic(Panic.GENERIC); }\n * }\n * ```\n *\n * Follows the list from https://github.com/ethereum/solidity/blob/v0.8.24/libsolutil/ErrorCodes.h[libsolutil].\n *\n * _Available since v5.1._\n */\n// slither-disable-next-line unused-state\nlibrary Panic {\n /// @dev generic / unspecified error\n uint256 internal constant GENERIC = 0x00;\n /// @dev used by the assert() builtin\n uint256 internal constant ASSERT = 0x01;\n /// @dev arithmetic underflow or overflow\n uint256 internal constant UNDER_OVERFLOW = 0x11;\n /// @dev division or modulo by zero\n uint256 internal constant DIVISION_BY_ZERO = 0x12;\n /// @dev enum conversion error\n uint256 internal constant ENUM_CONVERSION_ERROR = 0x21;\n /// @dev invalid encoding in storage\n uint256 internal constant STORAGE_ENCODING_ERROR = 0x22;\n /// @dev empty array pop\n uint256 internal constant EMPTY_ARRAY_POP = 0x31;\n /// @dev array out of bounds access\n uint256 internal constant ARRAY_OUT_OF_BOUNDS = 0x32;\n /// @dev resource error (too large allocation or too large array)\n uint256 internal constant RESOURCE_ERROR = 0x41;\n /// @dev calling invalid internal function\n uint256 internal constant INVALID_INTERNAL_FUNCTION = 0x51;\n\n /// @dev Reverts with a panic code. Recommended to use with\n /// the internal constants with predefined codes.\n function panic(uint256 code) internal pure {\n assembly (\"memory-safe\") {\n mstore(0x00, 0x4e487b71)\n mstore(0x20, code)\n revert(0x1c, 0x24)\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Strings.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.3.0) (utils/Strings.sol)\n\npragma solidity ^0.8.20;\n\nimport {Math} from \"./math/Math.sol\";\nimport {SafeCast} from \"./math/SafeCast.sol\";\nimport {SignedMath} from \"./math/SignedMath.sol\";\n\n/**\n * @dev String operations.\n */\nlibrary Strings {\n using SafeCast for *;\n\n bytes16 private constant HEX_DIGITS = \"0123456789abcdef\";\n uint8 private constant ADDRESS_LENGTH = 20;\n uint256 private constant SPECIAL_CHARS_LOOKUP =\n (1 << 0x08) | // backspace\n (1 << 0x09) | // tab\n (1 << 0x0a) | // newline\n (1 << 0x0c) | // form feed\n (1 << 0x0d) | // carriage return\n (1 << 0x22) | // double quote\n (1 << 0x5c); // backslash\n\n /**\n * @dev The `value` string doesn't fit in the specified `length`.\n */\n error StringsInsufficientHexLength(uint256 value, uint256 length);\n\n /**\n * @dev The string being parsed contains characters that are not in scope of the given base.\n */\n error StringsInvalidChar();\n\n /**\n * @dev The string being parsed is not a properly formatted address.\n */\n error StringsInvalidAddressFormat();\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\n */\n function toString(uint256 value) internal pure returns (string memory) {\n unchecked {\n uint256 length = Math.log10(value) + 1;\n string memory buffer = new string(length);\n uint256 ptr;\n assembly (\"memory-safe\") {\n ptr := add(buffer, add(32, length))\n }\n while (true) {\n ptr--;\n assembly (\"memory-safe\") {\n mstore8(ptr, byte(mod(value, 10), HEX_DIGITS))\n }\n value /= 10;\n if (value == 0) break;\n }\n return buffer;\n }\n }\n\n /**\n * @dev Converts a `int256` to its ASCII `string` decimal representation.\n */\n function toStringSigned(int256 value) internal pure returns (string memory) {\n return string.concat(value < 0 ? \"-\" : \"\", toString(SignedMath.abs(value)));\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\n */\n function toHexString(uint256 value) internal pure returns (string memory) {\n unchecked {\n return toHexString(value, Math.log256(value) + 1);\n }\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\n */\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\n uint256 localValue = value;\n bytes memory buffer = new bytes(2 * length + 2);\n buffer[0] = \"0\";\n buffer[1] = \"x\";\n for (uint256 i = 2 * length + 1; i > 1; --i) {\n buffer[i] = HEX_DIGITS[localValue & 0xf];\n localValue >>= 4;\n }\n if (localValue != 0) {\n revert StringsInsufficientHexLength(value, length);\n }\n return string(buffer);\n }\n\n /**\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal\n * representation.\n */\n function toHexString(address addr) internal pure returns (string memory) {\n return toHexString(uint256(uint160(addr)), ADDRESS_LENGTH);\n }\n\n /**\n * @dev Converts an `address` with fixed length of 20 bytes to its checksummed ASCII `string` hexadecimal\n * representation, according to EIP-55.\n */\n function toChecksumHexString(address addr) internal pure returns (string memory) {\n bytes memory buffer = bytes(toHexString(addr));\n\n // hash the hex part of buffer (skip length + 2 bytes, length 40)\n uint256 hashValue;\n assembly (\"memory-safe\") {\n hashValue := shr(96, keccak256(add(buffer, 0x22), 40))\n }\n\n for (uint256 i = 41; i > 1; --i) {\n // possible values for buffer[i] are 48 (0) to 57 (9) and 97 (a) to 102 (f)\n if (hashValue & 0xf > 7 && uint8(buffer[i]) > 96) {\n // case shift by xoring with 0x20\n buffer[i] ^= 0x20;\n }\n hashValue >>= 4;\n }\n return string(buffer);\n }\n\n /**\n * @dev Returns true if the two strings are equal.\n */\n function equal(string memory a, string memory b) internal pure returns (bool) {\n return bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b));\n }\n\n /**\n * @dev Parse a decimal string and returns the value as a `uint256`.\n *\n * Requirements:\n * - The string must be formatted as `[0-9]*`\n * - The result must fit into an `uint256` type\n */\n function parseUint(string memory input) internal pure returns (uint256) {\n return parseUint(input, 0, bytes(input).length);\n }\n\n /**\n * @dev Variant of {parseUint-string} that parses a substring of `input` located between position `begin` (included) and\n * `end` (excluded).\n *\n * Requirements:\n * - The substring must be formatted as `[0-9]*`\n * - The result must fit into an `uint256` type\n */\n function parseUint(string memory input, uint256 begin, uint256 end) internal pure returns (uint256) {\n (bool success, uint256 value) = tryParseUint(input, begin, end);\n if (!success) revert StringsInvalidChar();\n return value;\n }\n\n /**\n * @dev Variant of {parseUint-string} that returns false if the parsing fails because of an invalid character.\n *\n * NOTE: This function will revert if the result does not fit in a `uint256`.\n */\n function tryParseUint(string memory input) internal pure returns (bool success, uint256 value) {\n return _tryParseUintUncheckedBounds(input, 0, bytes(input).length);\n }\n\n /**\n * @dev Variant of {parseUint-string-uint256-uint256} that returns false if the parsing fails because of an invalid\n * character.\n *\n * NOTE: This function will revert if the result does not fit in a `uint256`.\n */\n function tryParseUint(\n string memory input,\n uint256 begin,\n uint256 end\n ) internal pure returns (bool success, uint256 value) {\n if (end > bytes(input).length || begin > end) return (false, 0);\n return _tryParseUintUncheckedBounds(input, begin, end);\n }\n\n /**\n * @dev Implementation of {tryParseUint-string-uint256-uint256} that does not check bounds. Caller should make sure that\n * `begin <= end <= input.length`. Other inputs would result in undefined behavior.\n */\n function _tryParseUintUncheckedBounds(\n string memory input,\n uint256 begin,\n uint256 end\n ) private pure returns (bool success, uint256 value) {\n bytes memory buffer = bytes(input);\n\n uint256 result = 0;\n for (uint256 i = begin; i < end; ++i) {\n uint8 chr = _tryParseChr(bytes1(_unsafeReadBytesOffset(buffer, i)));\n if (chr > 9) return (false, 0);\n result *= 10;\n result += chr;\n }\n return (true, result);\n }\n\n /**\n * @dev Parse a decimal string and returns the value as a `int256`.\n *\n * Requirements:\n * - The string must be formatted as `[-+]?[0-9]*`\n * - The result must fit in an `int256` type.\n */\n function parseInt(string memory input) internal pure returns (int256) {\n return parseInt(input, 0, bytes(input).length);\n }\n\n /**\n * @dev Variant of {parseInt-string} that parses a substring of `input` located between position `begin` (included) and\n * `end` (excluded).\n *\n * Requirements:\n * - The substring must be formatted as `[-+]?[0-9]*`\n * - The result must fit in an `int256` type.\n */\n function parseInt(string memory input, uint256 begin, uint256 end) internal pure returns (int256) {\n (bool success, int256 value) = tryParseInt(input, begin, end);\n if (!success) revert StringsInvalidChar();\n return value;\n }\n\n /**\n * @dev Variant of {parseInt-string} that returns false if the parsing fails because of an invalid character or if\n * the result does not fit in a `int256`.\n *\n * NOTE: This function will revert if the absolute value of the result does not fit in a `uint256`.\n */\n function tryParseInt(string memory input) internal pure returns (bool success, int256 value) {\n return _tryParseIntUncheckedBounds(input, 0, bytes(input).length);\n }\n\n uint256 private constant ABS_MIN_INT256 = 2 ** 255;\n\n /**\n * @dev Variant of {parseInt-string-uint256-uint256} that returns false if the parsing fails because of an invalid\n * character or if the result does not fit in a `int256`.\n *\n * NOTE: This function will revert if the absolute value of the result does not fit in a `uint256`.\n */\n function tryParseInt(\n string memory input,\n uint256 begin,\n uint256 end\n ) internal pure returns (bool success, int256 value) {\n if (end > bytes(input).length || begin > end) return (false, 0);\n return _tryParseIntUncheckedBounds(input, begin, end);\n }\n\n /**\n * @dev Implementation of {tryParseInt-string-uint256-uint256} that does not check bounds. Caller should make sure that\n * `begin <= end <= input.length`. Other inputs would result in undefined behavior.\n */\n function _tryParseIntUncheckedBounds(\n string memory input,\n uint256 begin,\n uint256 end\n ) private pure returns (bool success, int256 value) {\n bytes memory buffer = bytes(input);\n\n // Check presence of a negative sign.\n bytes1 sign = begin == end ? bytes1(0) : bytes1(_unsafeReadBytesOffset(buffer, begin)); // don't do out-of-bound (possibly unsafe) read if sub-string is empty\n bool positiveSign = sign == bytes1(\"+\");\n bool negativeSign = sign == bytes1(\"-\");\n uint256 offset = (positiveSign || negativeSign).toUint();\n\n (bool absSuccess, uint256 absValue) = tryParseUint(input, begin + offset, end);\n\n if (absSuccess && absValue < ABS_MIN_INT256) {\n return (true, negativeSign ? -int256(absValue) : int256(absValue));\n } else if (absSuccess && negativeSign && absValue == ABS_MIN_INT256) {\n return (true, type(int256).min);\n } else return (false, 0);\n }\n\n /**\n * @dev Parse a hexadecimal string (with or without \"0x\" prefix), and returns the value as a `uint256`.\n *\n * Requirements:\n * - The string must be formatted as `(0x)?[0-9a-fA-F]*`\n * - The result must fit in an `uint256` type.\n */\n function parseHexUint(string memory input) internal pure returns (uint256) {\n return parseHexUint(input, 0, bytes(input).length);\n }\n\n /**\n * @dev Variant of {parseHexUint-string} that parses a substring of `input` located between position `begin` (included) and\n * `end` (excluded).\n *\n * Requirements:\n * - The substring must be formatted as `(0x)?[0-9a-fA-F]*`\n * - The result must fit in an `uint256` type.\n */\n function parseHexUint(string memory input, uint256 begin, uint256 end) internal pure returns (uint256) {\n (bool success, uint256 value) = tryParseHexUint(input, begin, end);\n if (!success) revert StringsInvalidChar();\n return value;\n }\n\n /**\n * @dev Variant of {parseHexUint-string} that returns false if the parsing fails because of an invalid character.\n *\n * NOTE: This function will revert if the result does not fit in a `uint256`.\n */\n function tryParseHexUint(string memory input) internal pure returns (bool success, uint256 value) {\n return _tryParseHexUintUncheckedBounds(input, 0, bytes(input).length);\n }\n\n /**\n * @dev Variant of {parseHexUint-string-uint256-uint256} that returns false if the parsing fails because of an\n * invalid character.\n *\n * NOTE: This function will revert if the result does not fit in a `uint256`.\n */\n function tryParseHexUint(\n string memory input,\n uint256 begin,\n uint256 end\n ) internal pure returns (bool success, uint256 value) {\n if (end > bytes(input).length || begin > end) return (false, 0);\n return _tryParseHexUintUncheckedBounds(input, begin, end);\n }\n\n /**\n * @dev Implementation of {tryParseHexUint-string-uint256-uint256} that does not check bounds. Caller should make sure that\n * `begin <= end <= input.length`. Other inputs would result in undefined behavior.\n */\n function _tryParseHexUintUncheckedBounds(\n string memory input,\n uint256 begin,\n uint256 end\n ) private pure returns (bool success, uint256 value) {\n bytes memory buffer = bytes(input);\n\n // skip 0x prefix if present\n bool hasPrefix = (end > begin + 1) && bytes2(_unsafeReadBytesOffset(buffer, begin)) == bytes2(\"0x\"); // don't do out-of-bound (possibly unsafe) read if sub-string is empty\n uint256 offset = hasPrefix.toUint() * 2;\n\n uint256 result = 0;\n for (uint256 i = begin + offset; i < end; ++i) {\n uint8 chr = _tryParseChr(bytes1(_unsafeReadBytesOffset(buffer, i)));\n if (chr > 15) return (false, 0);\n result *= 16;\n unchecked {\n // Multiplying by 16 is equivalent to a shift of 4 bits (with additional overflow check).\n // This guarantees that adding a value < 16 will not cause an overflow, hence the unchecked.\n result += chr;\n }\n }\n return (true, result);\n }\n\n /**\n * @dev Parse a hexadecimal string (with or without \"0x\" prefix), and returns the value as an `address`.\n *\n * Requirements:\n * - The string must be formatted as `(0x)?[0-9a-fA-F]{40}`\n */\n function parseAddress(string memory input) internal pure returns (address) {\n return parseAddress(input, 0, bytes(input).length);\n }\n\n /**\n * @dev Variant of {parseAddress-string} that parses a substring of `input` located between position `begin` (included) and\n * `end` (excluded).\n *\n * Requirements:\n * - The substring must be formatted as `(0x)?[0-9a-fA-F]{40}`\n */\n function parseAddress(string memory input, uint256 begin, uint256 end) internal pure returns (address) {\n (bool success, address value) = tryParseAddress(input, begin, end);\n if (!success) revert StringsInvalidAddressFormat();\n return value;\n }\n\n /**\n * @dev Variant of {parseAddress-string} that returns false if the parsing fails because the input is not a properly\n * formatted address. See {parseAddress-string} requirements.\n */\n function tryParseAddress(string memory input) internal pure returns (bool success, address value) {\n return tryParseAddress(input, 0, bytes(input).length);\n }\n\n /**\n * @dev Variant of {parseAddress-string-uint256-uint256} that returns false if the parsing fails because input is not a properly\n * formatted address. See {parseAddress-string-uint256-uint256} requirements.\n */\n function tryParseAddress(\n string memory input,\n uint256 begin,\n uint256 end\n ) internal pure returns (bool success, address value) {\n if (end > bytes(input).length || begin > end) return (false, address(0));\n\n bool hasPrefix = (end > begin + 1) && bytes2(_unsafeReadBytesOffset(bytes(input), begin)) == bytes2(\"0x\"); // don't do out-of-bound (possibly unsafe) read if sub-string is empty\n uint256 expectedLength = 40 + hasPrefix.toUint() * 2;\n\n // check that input is the correct length\n if (end - begin == expectedLength) {\n // length guarantees that this does not overflow, and value is at most type(uint160).max\n (bool s, uint256 v) = _tryParseHexUintUncheckedBounds(input, begin, end);\n return (s, address(uint160(v)));\n } else {\n return (false, address(0));\n }\n }\n\n function _tryParseChr(bytes1 chr) private pure returns (uint8) {\n uint8 value = uint8(chr);\n\n // Try to parse `chr`:\n // - Case 1: [0-9]\n // - Case 2: [a-f]\n // - Case 3: [A-F]\n // - otherwise not supported\n unchecked {\n if (value > 47 && value < 58) value -= 48;\n else if (value > 96 && value < 103) value -= 87;\n else if (value > 64 && value < 71) value -= 55;\n else return type(uint8).max;\n }\n\n return value;\n }\n\n /**\n * @dev Escape special characters in JSON strings. This can be useful to prevent JSON injection in NFT metadata.\n *\n * WARNING: This function should only be used in double quoted JSON strings. Single quotes are not escaped.\n *\n * NOTE: This function escapes all unicode characters, and not just the ones in ranges defined in section 2.5 of\n * RFC-4627 (U+0000 to U+001F, U+0022 and U+005C). ECMAScript's `JSON.parse` does recover escaped unicode\n * characters that are not in this range, but other tooling may provide different results.\n */\n function escapeJSON(string memory input) internal pure returns (string memory) {\n bytes memory buffer = bytes(input);\n bytes memory output = new bytes(2 * buffer.length); // worst case scenario\n uint256 outputLength = 0;\n\n for (uint256 i; i < buffer.length; ++i) {\n bytes1 char = bytes1(_unsafeReadBytesOffset(buffer, i));\n if (((SPECIAL_CHARS_LOOKUP & (1 << uint8(char))) != 0)) {\n output[outputLength++] = \"\\\\\";\n if (char == 0x08) output[outputLength++] = \"b\";\n else if (char == 0x09) output[outputLength++] = \"t\";\n else if (char == 0x0a) output[outputLength++] = \"n\";\n else if (char == 0x0c) output[outputLength++] = \"f\";\n else if (char == 0x0d) output[outputLength++] = \"r\";\n else if (char == 0x5c) output[outputLength++] = \"\\\\\";\n else if (char == 0x22) {\n // solhint-disable-next-line quotes\n output[outputLength++] = '\"';\n }\n } else {\n output[outputLength++] = char;\n }\n }\n // write the actual length and deallocate unused memory\n assembly (\"memory-safe\") {\n mstore(output, outputLength)\n mstore(0x40, add(output, shl(5, shr(5, add(outputLength, 63)))))\n }\n\n return string(output);\n }\n\n /**\n * @dev Reads a bytes32 from a bytes array without bounds checking.\n *\n * NOTE: making this function internal would mean it could be used with memory unsafe offset, and marking the\n * assembly block as such would prevent some optimizations.\n */\n function _unsafeReadBytesOffset(bytes memory buffer, uint256 offset) private pure returns (bytes32 value) {\n // This is not memory safe in the general case, but all calls to this private function are within bounds.\n assembly (\"memory-safe\") {\n value := mload(add(buffer, add(0x20, offset)))\n }\n }\n}\n" + }, + "contracts/DisputeManager.sol": { + "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity 0.8.27;\n\nimport { IGraphToken } from \"@graphprotocol/contracts/contracts/token/IGraphToken.sol\";\nimport { IHorizonStaking } from \"@graphprotocol/horizon/contracts/interfaces/IHorizonStaking.sol\";\nimport { IDisputeManager } from \"./interfaces/IDisputeManager.sol\";\nimport { ISubgraphService } from \"./interfaces/ISubgraphService.sol\";\n\nimport { TokenUtils } from \"@graphprotocol/contracts/contracts/utils/TokenUtils.sol\";\nimport { PPMMath } from \"@graphprotocol/horizon/contracts/libraries/PPMMath.sol\";\nimport { MathUtils } from \"@graphprotocol/horizon/contracts/libraries/MathUtils.sol\";\nimport { Allocation } from \"./libraries/Allocation.sol\";\nimport { Attestation } from \"./libraries/Attestation.sol\";\n\nimport { OwnableUpgradeable } from \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\nimport { Initializable } from \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\nimport { GraphDirectory } from \"@graphprotocol/horizon/contracts/utilities/GraphDirectory.sol\";\nimport { DisputeManagerV1Storage } from \"./DisputeManagerStorage.sol\";\nimport { AttestationManager } from \"./utilities/AttestationManager.sol\";\n\n/**\n * @title DisputeManager\n * @notice Provides a way to permissionlessly create disputes for incorrect behavior in the Subgraph Service.\n *\n * There are two types of disputes that can be created: Query disputes and Indexing disputes.\n *\n * Query Disputes:\n * Graph nodes receive queries and return responses with signed receipts called attestations.\n * An attestation can be disputed if the consumer thinks the query response was invalid.\n * Indexers use the derived private key for an allocation to sign attestations.\n *\n * Indexing Disputes:\n * Indexers periodically present a Proof of Indexing (POI) to prove they are indexing a subgraph.\n * The Subgraph Service contract emits that proof which includes the POI. Any fisherman can dispute the\n * validity of a POI by submitting a dispute to this contract along with a deposit.\n *\n * Arbitration:\n * Disputes can only be accepted, rejected or drawn by the arbitrator role that can be delegated\n * to a EOA or DAO.\n * @custom:security-contact Please email security+contracts@thegraph.com if you find any\n * bugs. We may have an active bug bounty program.\n */\ncontract DisputeManager is\n Initializable,\n OwnableUpgradeable,\n GraphDirectory,\n AttestationManager,\n DisputeManagerV1Storage,\n IDisputeManager\n{\n using TokenUtils for IGraphToken;\n using PPMMath for uint256;\n\n // -- Constants --\n\n /// @notice Maximum value for fisherman reward cut in PPM\n uint32 public constant MAX_FISHERMAN_REWARD_CUT = 500000; // 50%\n\n /// @notice Minimum value for dispute deposit\n uint256 public constant MIN_DISPUTE_DEPOSIT = 1e18; // 1 GRT\n\n // -- Modifiers --\n\n /**\n * @notice Check if the caller is the arbitrator.\n */\n modifier onlyArbitrator() {\n require(msg.sender == arbitrator, DisputeManagerNotArbitrator());\n _;\n }\n\n /**\n * @notice Check if the dispute exists and is pending.\n * @param disputeId The dispute Id\n */\n modifier onlyPendingDispute(bytes32 disputeId) {\n require(isDisputeCreated(disputeId), DisputeManagerInvalidDispute(disputeId));\n require(\n disputes[disputeId].status == IDisputeManager.DisputeStatus.Pending,\n DisputeManagerDisputeNotPending(disputes[disputeId].status)\n );\n _;\n }\n\n /**\n * @notice Check if the caller is the fisherman of the dispute.\n * @param disputeId The dispute Id\n */\n modifier onlyFisherman(bytes32 disputeId) {\n require(isDisputeCreated(disputeId), DisputeManagerInvalidDispute(disputeId));\n require(msg.sender == disputes[disputeId].fisherman, DisputeManagerNotFisherman());\n _;\n }\n\n /**\n * @notice Contract constructor\n * @param controller Address of the controller\n */\n constructor(address controller) GraphDirectory(controller) {\n _disableInitializers();\n }\n\n /// @inheritdoc IDisputeManager\n function initialize(\n address owner,\n address arbitrator_,\n uint64 disputePeriod_,\n uint256 disputeDeposit_,\n uint32 fishermanRewardCut_,\n uint32 maxSlashingCut_\n ) external override initializer {\n __Ownable_init(owner);\n __AttestationManager_init();\n\n _setArbitrator(arbitrator_);\n _setDisputePeriod(disputePeriod_);\n _setDisputeDeposit(disputeDeposit_);\n _setFishermanRewardCut(fishermanRewardCut_);\n _setMaxSlashingCut(maxSlashingCut_);\n }\n\n /// @inheritdoc IDisputeManager\n function createIndexingDispute(address allocationId, bytes32 poi) external override returns (bytes32) {\n // Get funds from fisherman\n _graphToken().pullTokens(msg.sender, disputeDeposit);\n\n // Create a dispute\n return _createIndexingDisputeWithAllocation(msg.sender, disputeDeposit, allocationId, poi);\n }\n\n /// @inheritdoc IDisputeManager\n function createQueryDispute(bytes calldata attestationData) external override returns (bytes32) {\n // Get funds from fisherman\n _graphToken().pullTokens(msg.sender, disputeDeposit);\n\n // Create a dispute\n return\n _createQueryDisputeWithAttestation(\n msg.sender,\n disputeDeposit,\n Attestation.parse(attestationData),\n attestationData\n );\n }\n\n /// @inheritdoc IDisputeManager\n function createQueryDisputeConflict(\n bytes calldata attestationData1,\n bytes calldata attestationData2\n ) external override returns (bytes32, bytes32) {\n address fisherman = msg.sender;\n\n // Parse each attestation\n Attestation.State memory attestation1 = Attestation.parse(attestationData1);\n Attestation.State memory attestation2 = Attestation.parse(attestationData2);\n\n // Test that attestations are conflicting\n require(\n Attestation.areConflicting(attestation1, attestation2),\n DisputeManagerNonConflictingAttestations(\n attestation1.requestCID,\n attestation1.responseCID,\n attestation1.subgraphDeploymentId,\n attestation2.requestCID,\n attestation2.responseCID,\n attestation2.subgraphDeploymentId\n )\n );\n\n // Get funds from fisherman\n _graphToken().pullTokens(msg.sender, disputeDeposit);\n\n // Create the disputes\n // The deposit is zero for conflicting attestations\n bytes32 dId1 = _createQueryDisputeWithAttestation(\n fisherman,\n disputeDeposit / 2,\n attestation1,\n attestationData1\n );\n bytes32 dId2 = _createQueryDisputeWithAttestation(\n fisherman,\n disputeDeposit / 2,\n attestation2,\n attestationData2\n );\n\n // Store the linked disputes to be resolved\n disputes[dId1].relatedDisputeId = dId2;\n disputes[dId2].relatedDisputeId = dId1;\n\n // Emit event that links the two created disputes\n emit DisputeLinked(dId1, dId2);\n\n return (dId1, dId2);\n }\n\n /// @inheritdoc IDisputeManager\n function createAndAcceptLegacyDispute(\n address allocationId,\n address fisherman,\n uint256 tokensSlash,\n uint256 tokensRewards\n ) external override onlyArbitrator returns (bytes32) {\n // Create a disputeId\n bytes32 disputeId = keccak256(abi.encodePacked(allocationId, \"legacy\"));\n\n // Get the indexer for the legacy allocation\n address indexer = _graphStaking().getAllocation(allocationId).indexer;\n require(indexer != address(0), DisputeManagerIndexerNotFound(allocationId));\n\n // Store dispute\n disputes[disputeId] = Dispute(\n indexer,\n fisherman,\n 0,\n 0,\n DisputeType.LegacyDispute,\n IDisputeManager.DisputeStatus.Accepted,\n block.timestamp,\n block.timestamp + disputePeriod,\n 0\n );\n\n // Slash the indexer\n ISubgraphService subgraphService_ = _getSubgraphService();\n subgraphService_.slash(indexer, abi.encode(tokensSlash, tokensRewards));\n\n // Reward the fisherman\n _graphToken().pushTokens(fisherman, tokensRewards);\n\n emit LegacyDisputeCreated(disputeId, indexer, fisherman, allocationId, tokensSlash, tokensRewards);\n emit DisputeAccepted(disputeId, indexer, fisherman, tokensRewards);\n\n return disputeId;\n }\n\n /// @inheritdoc IDisputeManager\n function acceptDispute(\n bytes32 disputeId,\n uint256 tokensSlash\n ) external override onlyArbitrator onlyPendingDispute(disputeId) {\n require(!_isDisputeInConflict(disputes[disputeId]), DisputeManagerDisputeInConflict(disputeId));\n Dispute storage dispute = disputes[disputeId];\n _acceptDispute(disputeId, dispute, tokensSlash);\n }\n\n /// @inheritdoc IDisputeManager\n function acceptDisputeConflict(\n bytes32 disputeId,\n uint256 tokensSlash,\n bool acceptDisputeInConflict,\n uint256 tokensSlashRelated\n ) external override onlyArbitrator onlyPendingDispute(disputeId) {\n require(_isDisputeInConflict(disputes[disputeId]), DisputeManagerDisputeNotInConflict(disputeId));\n Dispute storage dispute = disputes[disputeId];\n _acceptDispute(disputeId, dispute, tokensSlash);\n\n if (acceptDisputeInConflict) {\n _acceptDispute(dispute.relatedDisputeId, disputes[dispute.relatedDisputeId], tokensSlashRelated);\n } else {\n _drawDispute(dispute.relatedDisputeId, disputes[dispute.relatedDisputeId]);\n }\n }\n\n /// @inheritdoc IDisputeManager\n function rejectDispute(bytes32 disputeId) external override onlyArbitrator onlyPendingDispute(disputeId) {\n Dispute storage dispute = disputes[disputeId];\n require(!_isDisputeInConflict(dispute), DisputeManagerDisputeInConflict(disputeId));\n _rejectDispute(disputeId, dispute);\n }\n\n /// @inheritdoc IDisputeManager\n function drawDispute(bytes32 disputeId) external override onlyArbitrator onlyPendingDispute(disputeId) {\n Dispute storage dispute = disputes[disputeId];\n _drawDispute(disputeId, dispute);\n\n if (_isDisputeInConflict(dispute)) {\n _drawDispute(dispute.relatedDisputeId, disputes[dispute.relatedDisputeId]);\n }\n }\n\n /// @inheritdoc IDisputeManager\n function cancelDispute(bytes32 disputeId) external override onlyFisherman(disputeId) onlyPendingDispute(disputeId) {\n Dispute storage dispute = disputes[disputeId];\n\n // Check if dispute period has finished\n require(dispute.cancellableAt <= block.timestamp, DisputeManagerDisputePeriodNotFinished());\n _cancelDispute(disputeId, dispute);\n\n if (_isDisputeInConflict(dispute)) {\n _cancelDispute(dispute.relatedDisputeId, disputes[dispute.relatedDisputeId]);\n }\n }\n\n /// @inheritdoc IDisputeManager\n function setArbitrator(address arbitrator) external override onlyOwner {\n _setArbitrator(arbitrator);\n }\n\n /// @inheritdoc IDisputeManager\n function setDisputePeriod(uint64 disputePeriod) external override onlyOwner {\n _setDisputePeriod(disputePeriod);\n }\n\n /// @inheritdoc IDisputeManager\n function setDisputeDeposit(uint256 disputeDeposit) external override onlyOwner {\n _setDisputeDeposit(disputeDeposit);\n }\n\n /// @inheritdoc IDisputeManager\n function setFishermanRewardCut(uint32 fishermanRewardCut_) external override onlyOwner {\n _setFishermanRewardCut(fishermanRewardCut_);\n }\n\n /// @inheritdoc IDisputeManager\n function setMaxSlashingCut(uint32 maxSlashingCut_) external override onlyOwner {\n _setMaxSlashingCut(maxSlashingCut_);\n }\n\n /// @inheritdoc IDisputeManager\n function setSubgraphService(address subgraphService_) external override onlyOwner {\n _setSubgraphService(subgraphService_);\n }\n\n /// @inheritdoc IDisputeManager\n function encodeReceipt(Attestation.Receipt calldata receipt) external view override returns (bytes32) {\n return _encodeReceipt(receipt);\n }\n\n /// @inheritdoc IDisputeManager\n function getFishermanRewardCut() external view override returns (uint32) {\n return fishermanRewardCut;\n }\n\n /// @inheritdoc IDisputeManager\n function getDisputePeriod() external view override returns (uint64) {\n return disputePeriod;\n }\n\n /// @inheritdoc IDisputeManager\n function getStakeSnapshot(address indexer) external view override returns (uint256) {\n IHorizonStaking.Provision memory provision = _graphStaking().getProvision(\n indexer,\n address(_getSubgraphService())\n );\n return _getStakeSnapshot(indexer, provision.tokens);\n }\n\n /// @inheritdoc IDisputeManager\n function areConflictingAttestations(\n Attestation.State calldata attestation1,\n Attestation.State calldata attestation2\n ) external pure override returns (bool) {\n return Attestation.areConflicting(attestation1, attestation2);\n }\n\n /// @inheritdoc IDisputeManager\n function getAttestationIndexer(Attestation.State memory attestation) public view returns (address) {\n // Get attestation signer. Indexers signs with the allocationId\n address allocationId = _recoverSigner(attestation);\n\n Allocation.State memory alloc = _getSubgraphService().getAllocation(allocationId);\n require(alloc.indexer != address(0), DisputeManagerIndexerNotFound(allocationId));\n require(\n alloc.subgraphDeploymentId == attestation.subgraphDeploymentId,\n DisputeManagerNonMatchingSubgraphDeployment(alloc.subgraphDeploymentId, attestation.subgraphDeploymentId)\n );\n return alloc.indexer;\n }\n\n /// @inheritdoc IDisputeManager\n function isDisputeCreated(bytes32 disputeId) public view override returns (bool) {\n return disputes[disputeId].status != DisputeStatus.Null;\n }\n\n /**\n * @notice Create a query dispute passing the parsed attestation.\n * To be used in createQueryDispute() and createQueryDisputeConflict()\n * to avoid calling parseAttestation() multiple times\n * `attestationData` is only passed to be emitted\n * @param _fisherman Creator of dispute\n * @param _deposit Amount of tokens staked as deposit\n * @param _attestation Attestation struct parsed from bytes\n * @param _attestationData Attestation bytes submitted by the fisherman\n * @return DisputeId\n */\n function _createQueryDisputeWithAttestation(\n address _fisherman,\n uint256 _deposit,\n Attestation.State memory _attestation,\n bytes memory _attestationData\n ) private returns (bytes32) {\n // Get the indexer that signed the attestation\n address indexer = getAttestationIndexer(_attestation);\n\n // The indexer is disputable\n IHorizonStaking.Provision memory provision = _graphStaking().getProvision(\n indexer,\n address(_getSubgraphService())\n );\n require(provision.tokens != 0, DisputeManagerZeroTokens());\n\n // Create a disputeId\n bytes32 disputeId = keccak256(\n abi.encodePacked(\n _attestation.requestCID,\n _attestation.responseCID,\n _attestation.subgraphDeploymentId,\n indexer,\n _fisherman\n )\n );\n\n // Only one dispute at a time\n require(!isDisputeCreated(disputeId), DisputeManagerDisputeAlreadyCreated(disputeId));\n\n // Store dispute\n uint256 stakeSnapshot = _getStakeSnapshot(indexer, provision.tokens);\n uint256 cancellableAt = block.timestamp + disputePeriod;\n disputes[disputeId] = Dispute(\n indexer,\n _fisherman,\n _deposit,\n 0, // no related dispute,\n DisputeType.QueryDispute,\n IDisputeManager.DisputeStatus.Pending,\n block.timestamp,\n cancellableAt,\n stakeSnapshot\n );\n\n emit QueryDisputeCreated(\n disputeId,\n indexer,\n _fisherman,\n _deposit,\n _attestation.subgraphDeploymentId,\n _attestationData,\n cancellableAt,\n stakeSnapshot\n );\n\n return disputeId;\n }\n\n /**\n * @notice Create indexing dispute internal function.\n * @param _fisherman The fisherman creating the dispute\n * @param _deposit Amount of tokens staked as deposit\n * @param _allocationId Allocation disputed\n * @param _poi The POI being disputed\n * @return The dispute id\n */\n function _createIndexingDisputeWithAllocation(\n address _fisherman,\n uint256 _deposit,\n address _allocationId,\n bytes32 _poi\n ) private returns (bytes32) {\n // Create a disputeId\n bytes32 disputeId = keccak256(abi.encodePacked(_allocationId, _poi));\n\n // Only one dispute for an allocationId at a time\n require(!isDisputeCreated(disputeId), DisputeManagerDisputeAlreadyCreated(disputeId));\n\n // Allocation must exist\n ISubgraphService subgraphService_ = _getSubgraphService();\n Allocation.State memory alloc = subgraphService_.getAllocation(_allocationId);\n address indexer = alloc.indexer;\n require(indexer != address(0), DisputeManagerIndexerNotFound(_allocationId));\n\n // The indexer must be disputable\n IHorizonStaking.Provision memory provision = _graphStaking().getProvision(indexer, address(subgraphService_));\n require(provision.tokens != 0, DisputeManagerZeroTokens());\n\n // Store dispute\n uint256 stakeSnapshot = _getStakeSnapshot(indexer, provision.tokens);\n uint256 cancellableAt = block.timestamp + disputePeriod;\n disputes[disputeId] = Dispute(\n alloc.indexer,\n _fisherman,\n _deposit,\n 0,\n DisputeType.IndexingDispute,\n IDisputeManager.DisputeStatus.Pending,\n block.timestamp,\n cancellableAt,\n stakeSnapshot\n );\n\n emit IndexingDisputeCreated(\n disputeId,\n alloc.indexer,\n _fisherman,\n _deposit,\n _allocationId,\n _poi,\n stakeSnapshot,\n cancellableAt\n );\n\n return disputeId;\n }\n\n /**\n * @notice Accept a dispute\n * @param _disputeId The id of the dispute\n * @param _dispute The dispute\n * @param _tokensSlashed The amount of tokens to slash\n */\n function _acceptDispute(bytes32 _disputeId, Dispute storage _dispute, uint256 _tokensSlashed) private {\n uint256 tokensToReward = _slashIndexer(_dispute.indexer, _tokensSlashed, _dispute.stakeSnapshot);\n _dispute.status = IDisputeManager.DisputeStatus.Accepted;\n _graphToken().pushTokens(_dispute.fisherman, tokensToReward + _dispute.deposit);\n\n emit DisputeAccepted(_disputeId, _dispute.indexer, _dispute.fisherman, _dispute.deposit + tokensToReward);\n }\n\n /**\n * @notice Reject a dispute\n * @param _disputeId The id of the dispute\n * @param _dispute The dispute\n */\n function _rejectDispute(bytes32 _disputeId, Dispute storage _dispute) private {\n _dispute.status = IDisputeManager.DisputeStatus.Rejected;\n _graphToken().burnTokens(_dispute.deposit);\n\n emit DisputeRejected(_disputeId, _dispute.indexer, _dispute.fisherman, _dispute.deposit);\n }\n\n /**\n * @notice Draw a dispute\n * @param _disputeId The id of the dispute\n * @param _dispute The dispute\n */\n function _drawDispute(bytes32 _disputeId, Dispute storage _dispute) private {\n _dispute.status = IDisputeManager.DisputeStatus.Drawn;\n _graphToken().pushTokens(_dispute.fisherman, _dispute.deposit);\n\n emit DisputeDrawn(_disputeId, _dispute.indexer, _dispute.fisherman, _dispute.deposit);\n }\n\n /**\n * @notice Cancel a dispute\n * @param _disputeId The id of the dispute\n * @param _dispute The dispute\n */\n function _cancelDispute(bytes32 _disputeId, Dispute storage _dispute) private {\n _dispute.status = IDisputeManager.DisputeStatus.Cancelled;\n _graphToken().pushTokens(_dispute.fisherman, _dispute.deposit);\n\n emit DisputeCancelled(_disputeId, _dispute.indexer, _dispute.fisherman, _dispute.deposit);\n }\n\n /**\n * @notice Make the subgraph service contract slash the indexer and reward the fisherman.\n * Give the fisherman a reward equal to the fishermanRewardCut of slashed amount\n * @param _indexer Address of the indexer\n * @param _tokensSlash Amount of tokens to slash from the indexer\n * @param _tokensStakeSnapshot Snapshot of the indexer's stake at the time of the dispute creation\n * @return The amount of tokens rewarded to the fisherman\n */\n function _slashIndexer(\n address _indexer,\n uint256 _tokensSlash,\n uint256 _tokensStakeSnapshot\n ) private returns (uint256) {\n ISubgraphService subgraphService_ = _getSubgraphService();\n\n // Get slashable amount for indexer\n IHorizonStaking.Provision memory provision = _graphStaking().getProvision(_indexer, address(subgraphService_));\n\n // Ensure slash amount is within the cap\n uint256 maxTokensSlash = _tokensStakeSnapshot.mulPPM(maxSlashingCut);\n require(\n _tokensSlash != 0 && _tokensSlash <= maxTokensSlash,\n DisputeManagerInvalidTokensSlash(_tokensSlash, maxTokensSlash)\n );\n\n // Rewards calculation:\n // - Rewards can only be extracted from service provider tokens so we grab the minimum between the slash\n // amount and indexer's tokens\n // - The applied cut is the minimum between the provision's maxVerifierCut and the current fishermanRewardCut. This\n // protects the indexer from sudden changes to the fishermanRewardCut while ensuring the slashing does not revert due\n // to excessive rewards being requested.\n uint256 maxRewardableTokens = MathUtils.min(_tokensSlash, provision.tokens);\n uint256 effectiveCut = MathUtils.min(provision.maxVerifierCut, fishermanRewardCut);\n uint256 tokensRewards = effectiveCut.mulPPM(maxRewardableTokens);\n\n subgraphService_.slash(_indexer, abi.encode(_tokensSlash, tokensRewards));\n return tokensRewards;\n }\n\n /**\n * @notice Set the arbitrator address.\n * @dev Update the arbitrator to `_arbitrator`\n * @param _arbitrator The address of the arbitration contract or party\n */\n function _setArbitrator(address _arbitrator) private {\n require(_arbitrator != address(0), DisputeManagerInvalidZeroAddress());\n arbitrator = _arbitrator;\n emit ArbitratorSet(_arbitrator);\n }\n\n /**\n * @notice Set the dispute period.\n * @dev Update the dispute period to `_disputePeriod` in seconds\n * @param _disputePeriod Dispute period in seconds\n */\n function _setDisputePeriod(uint64 _disputePeriod) private {\n require(_disputePeriod != 0, DisputeManagerDisputePeriodZero());\n disputePeriod = _disputePeriod;\n emit DisputePeriodSet(_disputePeriod);\n }\n\n /**\n * @notice Set the dispute deposit required to create a dispute.\n * @dev Update the dispute deposit to `_disputeDeposit` Graph Tokens\n * @param _disputeDeposit The dispute deposit in Graph Tokens\n */\n function _setDisputeDeposit(uint256 _disputeDeposit) private {\n require(_disputeDeposit >= MIN_DISPUTE_DEPOSIT, DisputeManagerInvalidDisputeDeposit(_disputeDeposit));\n disputeDeposit = _disputeDeposit;\n emit DisputeDepositSet(_disputeDeposit);\n }\n\n /**\n * @notice Set the reward cut that the fisherman gets when slashing occurs.\n * @dev Update the reward cut to `_fishermanRewardCut`\n * @param _fishermanRewardCut The fisherman reward cut, in PPM\n */\n function _setFishermanRewardCut(uint32 _fishermanRewardCut) private {\n require(\n _fishermanRewardCut <= MAX_FISHERMAN_REWARD_CUT,\n DisputeManagerInvalidFishermanReward(_fishermanRewardCut)\n );\n fishermanRewardCut = _fishermanRewardCut;\n emit FishermanRewardCutSet(_fishermanRewardCut);\n }\n\n /**\n * @notice Set the maximum cut that can be used for slashing indexers.\n * @param _maxSlashingCut Max slashing cut, in PPM\n */\n function _setMaxSlashingCut(uint32 _maxSlashingCut) private {\n require(PPMMath.isValidPPM(_maxSlashingCut), DisputeManagerInvalidMaxSlashingCut(_maxSlashingCut));\n maxSlashingCut = _maxSlashingCut;\n emit MaxSlashingCutSet(maxSlashingCut);\n }\n\n /**\n * @notice Set the subgraph service address.\n * @dev Update the subgraph service to `_subgraphService`\n * @param _subgraphService The address of the subgraph service contract\n */\n function _setSubgraphService(address _subgraphService) private {\n require(_subgraphService != address(0), DisputeManagerInvalidZeroAddress());\n subgraphService = ISubgraphService(_subgraphService);\n emit SubgraphServiceSet(_subgraphService);\n }\n\n /**\n * @notice Get the address of the subgraph service\n * @dev Will revert if the subgraph service is not set\n * @return The subgraph service address\n */\n function _getSubgraphService() private view returns (ISubgraphService) {\n require(address(subgraphService) != address(0), DisputeManagerSubgraphServiceNotSet());\n return subgraphService;\n }\n\n /**\n * @notice Returns whether the dispute is for a conflicting attestation or not.\n * @param _dispute Dispute\n * @return True conflicting attestation dispute\n */\n function _isDisputeInConflict(Dispute storage _dispute) private view returns (bool) {\n return _dispute.relatedDisputeId != bytes32(0);\n }\n\n /**\n * @notice Get the total stake snapshot for and indexer.\n * @dev A few considerations:\n * - We include both indexer and delegators stake.\n * - Thawing stake is not excluded from the snapshot.\n * - Delegators stake is capped at the delegation ratio to prevent delegators from inflating the snapshot\n * to increase the indexer slash amount.\n *\n * Note that the snapshot can be inflated by delegators front-running the dispute creation with a delegation\n * to the indexer. Given the snapshot is a cap, the dispute outcome is uncertain and considering the cost of capital\n * and slashing risk, this is not a concern.\n * @param _indexer Indexer address\n * @param _indexerStake Indexer's stake\n * @return Total stake snapshot\n */\n function _getStakeSnapshot(address _indexer, uint256 _indexerStake) private view returns (uint256) {\n uint256 delegatorsStake = _graphStaking().getDelegationPool(_indexer, address(_getSubgraphService())).tokens;\n return _indexerStake + delegatorsStake;\n }\n}\n" + }, + "contracts/DisputeManagerStorage.sol": { + "content": "// SPDX-License-Identifier: GPL-2.0-or-later\n\npragma solidity 0.8.27;\n\nimport { IDisputeManager } from \"./interfaces/IDisputeManager.sol\";\nimport { ISubgraphService } from \"./interfaces/ISubgraphService.sol\";\n\n/**\n * @title DisputeManagerStorage\n * @notice This contract holds all the storage variables for the Dispute Manager contract.\n * @custom:security-contact Please email security+contracts@thegraph.com if you find any\n * bugs. We may have an active bug bounty program.\n */\nabstract contract DisputeManagerV1Storage {\n /// @notice The Subgraph Service contract address\n ISubgraphService public subgraphService;\n\n /// @notice The arbitrator is solely in control of arbitrating disputes\n address public arbitrator;\n\n /// @notice dispute period in seconds\n uint64 public disputePeriod;\n\n /// @notice Deposit required to create a Dispute\n uint256 public disputeDeposit;\n\n /// @notice Percentage of indexer slashed funds to assign as a reward to fisherman in successful dispute. In PPM.\n uint32 public fishermanRewardCut;\n\n /// @notice Maximum percentage of indexer stake that can be slashed on a dispute. In PPM.\n uint32 public maxSlashingCut;\n\n /// @notice List of disputes created\n mapping(bytes32 disputeId => IDisputeManager.Dispute dispute) public disputes;\n}\n" + }, + "contracts/interfaces/IDisputeManager.sol": { + "content": "// SPDX-License-Identifier: GPL-2.0-or-later\n\npragma solidity 0.8.27;\n\nimport { Attestation } from \"../libraries/Attestation.sol\";\n\n/**\n * @title IDisputeManager\n * @notice Interface for the {Dispute Manager} contract.\n * @custom:security-contact Please email security+contracts@thegraph.com if you find any\n * bugs. We may have an active bug bounty program.\n */\ninterface IDisputeManager {\n /// @notice Types of disputes that can be created\n enum DisputeType {\n Null,\n IndexingDispute,\n QueryDispute,\n LegacyDispute\n }\n\n /// @notice Status of a dispute\n enum DisputeStatus {\n Null,\n Accepted,\n Rejected,\n Drawn,\n Pending,\n Cancelled\n }\n\n /**\n * @notice Dispute details\n * @param indexer The indexer that is being disputed\n * @param fisherman The fisherman that created the dispute\n * @param deposit The amount of tokens deposited by the fisherman\n * @param relatedDisputeId The link to a related dispute, used when creating dispute via conflicting attestations\n * @param disputeType The type of dispute\n * @param status The status of the dispute\n * @param createdAt The timestamp when the dispute was created\n * @param cancellableAt The timestamp when the dispute can be cancelled\n * @param stakeSnapshot The stake snapshot of the indexer at the time of the dispute (includes delegation up to the delegation ratio)\n */\n struct Dispute {\n address indexer;\n address fisherman;\n uint256 deposit;\n bytes32 relatedDisputeId;\n DisputeType disputeType;\n DisputeStatus status;\n uint256 createdAt;\n uint256 cancellableAt;\n uint256 stakeSnapshot;\n }\n\n /**\n * @notice Emitted when arbitrator is set.\n * @param arbitrator The address of the arbitrator.\n */\n event ArbitratorSet(address indexed arbitrator);\n\n /**\n * @notice Emitted when dispute period is set.\n * @param disputePeriod The dispute period in seconds.\n */\n event DisputePeriodSet(uint64 disputePeriod);\n\n /**\n * @notice Emitted when dispute deposit is set.\n * @param disputeDeposit The dispute deposit required to create a dispute.\n */\n event DisputeDepositSet(uint256 disputeDeposit);\n\n /**\n * @notice Emitted when max slashing cut is set.\n * @param maxSlashingCut The maximum slashing cut that can be set.\n */\n event MaxSlashingCutSet(uint32 maxSlashingCut);\n\n /**\n * @notice Emitted when fisherman reward cut is set.\n * @param fishermanRewardCut The fisherman reward cut.\n */\n event FishermanRewardCutSet(uint32 fishermanRewardCut);\n\n /**\n * @notice Emitted when subgraph service is set.\n * @param subgraphService The address of the subgraph service.\n */\n event SubgraphServiceSet(address indexed subgraphService);\n\n /**\n * @dev Emitted when a query dispute is created for `subgraphDeploymentId` and `indexer`\n * by `fisherman`.\n * The event emits the amount of `tokens` deposited by the fisherman and `attestation` submitted.\n * @param disputeId The dispute id\n * @param indexer The indexer address\n * @param fisherman The fisherman address\n * @param tokens The amount of tokens deposited by the fisherman\n * @param subgraphDeploymentId The subgraph deployment id\n * @param attestation The attestation\n * @param cancellableAt The timestamp when the dispute can be cancelled\n * @param stakeSnapshot The stake snapshot of the indexer at the time of the dispute\n */\n event QueryDisputeCreated(\n bytes32 indexed disputeId,\n address indexed indexer,\n address indexed fisherman,\n uint256 tokens,\n bytes32 subgraphDeploymentId,\n bytes attestation,\n uint256 stakeSnapshot,\n uint256 cancellableAt\n );\n\n /**\n * @dev Emitted when an indexing dispute is created for `allocationId` and `indexer`\n * by `fisherman`.\n * The event emits the amount of `tokens` deposited by the fisherman.\n * @param disputeId The dispute id\n * @param indexer The indexer address\n * @param fisherman The fisherman address\n * @param tokens The amount of tokens deposited by the fisherman\n * @param allocationId The allocation id\n * @param poi The POI\n * @param stakeSnapshot The stake snapshot of the indexer at the time of the dispute\n * @param cancellableAt The timestamp when the dispute can be cancelled\n */\n event IndexingDisputeCreated(\n bytes32 indexed disputeId,\n address indexed indexer,\n address indexed fisherman,\n uint256 tokens,\n address allocationId,\n bytes32 poi,\n uint256 stakeSnapshot,\n uint256 cancellableAt\n );\n\n /**\n * @dev Emitted when a legacy dispute is created for `allocationId` and `fisherman`.\n * The event emits the amount of `tokensSlash` to slash and `tokensRewards` to reward the fisherman.\n * @param disputeId The dispute id\n * @param indexer The indexer address\n * @param fisherman The fisherman address to be credited with the rewards\n * @param allocationId The allocation id\n * @param tokensSlash The amount of tokens to slash\n * @param tokensRewards The amount of tokens to reward the fisherman\n */\n event LegacyDisputeCreated(\n bytes32 indexed disputeId,\n address indexed indexer,\n address indexed fisherman,\n address allocationId,\n uint256 tokensSlash,\n uint256 tokensRewards\n );\n\n /**\n * @dev Emitted when arbitrator accepts a `disputeId` to `indexer` created by `fisherman`.\n * The event emits the amount `tokens` transferred to the fisherman, the deposit plus reward.\n * @param disputeId The dispute id\n * @param indexer The indexer address\n * @param fisherman The fisherman address\n * @param tokens The amount of tokens transferred to the fisherman, the deposit plus reward\n */\n event DisputeAccepted(\n bytes32 indexed disputeId,\n address indexed indexer,\n address indexed fisherman,\n uint256 tokens\n );\n\n /**\n * @dev Emitted when arbitrator rejects a `disputeId` for `indexer` created by `fisherman`.\n * The event emits the amount `tokens` burned from the fisherman deposit.\n * @param disputeId The dispute id\n * @param indexer The indexer address\n * @param fisherman The fisherman address\n * @param tokens The amount of tokens burned from the fisherman deposit\n */\n event DisputeRejected(\n bytes32 indexed disputeId,\n address indexed indexer,\n address indexed fisherman,\n uint256 tokens\n );\n\n /**\n * @dev Emitted when arbitrator draw a `disputeId` for `indexer` created by `fisherman`.\n * The event emits the amount `tokens` used as deposit and returned to the fisherman.\n * @param disputeId The dispute id\n * @param indexer The indexer address\n * @param fisherman The fisherman address\n * @param tokens The amount of tokens returned to the fisherman - the deposit\n */\n event DisputeDrawn(bytes32 indexed disputeId, address indexed indexer, address indexed fisherman, uint256 tokens);\n\n /**\n * @dev Emitted when two disputes are in conflict to link them.\n * This event will be emitted after each DisputeCreated event is emitted\n * for each of the individual disputes.\n * @param disputeId1 The first dispute id\n * @param disputeId2 The second dispute id\n */\n event DisputeLinked(bytes32 indexed disputeId1, bytes32 indexed disputeId2);\n\n /**\n * @dev Emitted when a dispute is cancelled by the fisherman.\n * The event emits the amount `tokens` returned to the fisherman.\n * @param disputeId The dispute id\n * @param indexer The indexer address\n * @param fisherman The fisherman address\n * @param tokens The amount of tokens returned to the fisherman - the deposit\n */\n event DisputeCancelled(\n bytes32 indexed disputeId,\n address indexed indexer,\n address indexed fisherman,\n uint256 tokens\n );\n\n // -- Errors --\n\n /**\n * @notice Thrown when the caller is not the arbitrator\n */\n error DisputeManagerNotArbitrator();\n\n /**\n * @notice Thrown when the caller is not the fisherman\n */\n error DisputeManagerNotFisherman();\n\n /**\n * @notice Thrown when the address is the zero address\n */\n error DisputeManagerInvalidZeroAddress();\n\n /**\n * @notice Thrown when the dispute period is zero\n */\n error DisputeManagerDisputePeriodZero();\n\n /**\n * @notice Thrown when the indexer being disputed has no provisioned tokens\n */\n error DisputeManagerZeroTokens();\n\n /**\n * @notice Thrown when the dispute id is invalid\n * @param disputeId The dispute id\n */\n error DisputeManagerInvalidDispute(bytes32 disputeId);\n\n /**\n * @notice Thrown when the dispute deposit is invalid - less than the minimum dispute deposit\n * @param disputeDeposit The dispute deposit\n */\n error DisputeManagerInvalidDisputeDeposit(uint256 disputeDeposit);\n\n /**\n * @notice Thrown when the fisherman reward cut is invalid\n * @param cut The fisherman reward cut\n */\n error DisputeManagerInvalidFishermanReward(uint32 cut);\n\n /**\n * @notice Thrown when the max slashing cut is invalid\n * @param maxSlashingCut The max slashing cut\n */\n error DisputeManagerInvalidMaxSlashingCut(uint32 maxSlashingCut);\n\n /**\n * @notice Thrown when the tokens slash is invalid\n * @param tokensSlash The tokens slash\n * @param maxTokensSlash The max tokens slash\n */\n error DisputeManagerInvalidTokensSlash(uint256 tokensSlash, uint256 maxTokensSlash);\n\n /**\n * @notice Thrown when the dispute is not pending\n * @param status The status of the dispute\n */\n error DisputeManagerDisputeNotPending(IDisputeManager.DisputeStatus status);\n\n /**\n * @notice Thrown when the dispute is already created\n * @param disputeId The dispute id\n */\n error DisputeManagerDisputeAlreadyCreated(bytes32 disputeId);\n\n /**\n * @notice Thrown when the dispute period is not finished\n */\n error DisputeManagerDisputePeriodNotFinished();\n\n /**\n * @notice Thrown when the dispute is in conflict\n * @param disputeId The dispute id\n */\n error DisputeManagerDisputeInConflict(bytes32 disputeId);\n\n /**\n * @notice Thrown when the dispute is not in conflict\n * @param disputeId The dispute id\n */\n error DisputeManagerDisputeNotInConflict(bytes32 disputeId);\n\n /**\n * @notice Thrown when the dispute must be accepted\n * @param disputeId The dispute id\n * @param relatedDisputeId The related dispute id\n */\n error DisputeManagerMustAcceptRelatedDispute(bytes32 disputeId, bytes32 relatedDisputeId);\n\n /**\n * @notice Thrown when the indexer is not found\n * @param allocationId The allocation id\n */\n error DisputeManagerIndexerNotFound(address allocationId);\n\n /**\n * @notice Thrown when the subgraph deployment is not matching\n * @param subgraphDeploymentId1 The subgraph deployment id of the first attestation\n * @param subgraphDeploymentId2 The subgraph deployment id of the second attestation\n */\n error DisputeManagerNonMatchingSubgraphDeployment(bytes32 subgraphDeploymentId1, bytes32 subgraphDeploymentId2);\n\n /**\n * @notice Thrown when the attestations are not conflicting\n * @param requestCID1 The request CID of the first attestation\n * @param responseCID1 The response CID of the first attestation\n * @param subgraphDeploymentId1 The subgraph deployment id of the first attestation\n * @param requestCID2 The request CID of the second attestation\n * @param responseCID2 The response CID of the second attestation\n * @param subgraphDeploymentId2 The subgraph deployment id of the second attestation\n */\n error DisputeManagerNonConflictingAttestations(\n bytes32 requestCID1,\n bytes32 responseCID1,\n bytes32 subgraphDeploymentId1,\n bytes32 requestCID2,\n bytes32 responseCID2,\n bytes32 subgraphDeploymentId2\n );\n\n /**\n * @notice Thrown when attempting to get the subgraph service before it is set\n */\n error DisputeManagerSubgraphServiceNotSet();\n\n /**\n * @notice Initialize this contract.\n * @param owner The owner of the contract\n * @param arbitrator Arbitrator role\n * @param disputePeriod Dispute period in seconds\n * @param disputeDeposit Deposit required to create a Dispute\n * @param fishermanRewardCut_ Percent of slashed funds for fisherman (ppm)\n * @param maxSlashingCut_ Maximum percentage of indexer stake that can be slashed (ppm)\n */\n function initialize(\n address owner,\n address arbitrator,\n uint64 disputePeriod,\n uint256 disputeDeposit,\n uint32 fishermanRewardCut_,\n uint32 maxSlashingCut_\n ) external;\n\n /**\n * @notice Set the dispute period.\n * @dev Update the dispute period to `_disputePeriod` in seconds\n * @param disputePeriod Dispute period in seconds\n */\n function setDisputePeriod(uint64 disputePeriod) external;\n\n /**\n * @notice Set the arbitrator address.\n * @dev Update the arbitrator to `_arbitrator`\n * @param arbitrator The address of the arbitration contract or party\n */\n function setArbitrator(address arbitrator) external;\n\n /**\n * @notice Set the dispute deposit required to create a dispute.\n * @dev Update the dispute deposit to `_disputeDeposit` Graph Tokens\n * @param disputeDeposit The dispute deposit in Graph Tokens\n */\n function setDisputeDeposit(uint256 disputeDeposit) external;\n\n /**\n * @notice Set the percent reward that the fisherman gets when slashing occurs.\n * @dev Update the reward percentage to `_percentage`\n * @param fishermanRewardCut_ Reward as a percentage of indexer stake\n */\n function setFishermanRewardCut(uint32 fishermanRewardCut_) external;\n\n /**\n * @notice Set the maximum percentage that can be used for slashing indexers.\n * @param maxSlashingCut_ Max percentage slashing for disputes\n */\n function setMaxSlashingCut(uint32 maxSlashingCut_) external;\n\n /**\n * @notice Set the subgraph service address.\n * @dev Update the subgraph service to `_subgraphService`\n * @param subgraphService The address of the subgraph service contract\n */\n function setSubgraphService(address subgraphService) external;\n\n // -- Dispute --\n\n /**\n * @notice Create a query dispute for the arbitrator to resolve.\n * This function is called by a fisherman and it will pull `disputeDeposit` GRT tokens.\n *\n * * Requirements:\n * - fisherman must have previously approved this contract to pull `disputeDeposit` amount\n * of tokens from their balance.\n *\n * @param attestationData Attestation bytes submitted by the fisherman\n * @return The dispute id\n */\n function createQueryDispute(bytes calldata attestationData) external returns (bytes32);\n\n /**\n * @notice Create query disputes for two conflicting attestations.\n * A conflicting attestation is a proof presented by two different indexers\n * where for the same request on a subgraph the response is different.\n * Two linked disputes will be created and if the arbitrator resolve one, the other\n * one will be automatically resolved. Note that:\n * - it's not possible to reject a conflicting query dispute as by definition at least one\n * of the attestations is incorrect.\n * - if both attestations are proven to be incorrect, the arbitrator can slash the indexer twice.\n * Requirements:\n * - fisherman must have previously approved this contract to pull `disputeDeposit` amount\n * of tokens from their balance.\n * @param attestationData1 First attestation data submitted\n * @param attestationData2 Second attestation data submitted\n * @return The first dispute id\n * @return The second dispute id\n */\n function createQueryDisputeConflict(\n bytes calldata attestationData1,\n bytes calldata attestationData2\n ) external returns (bytes32, bytes32);\n\n /**\n * @notice Create an indexing dispute for the arbitrator to resolve.\n * The disputes are created in reference to an allocationId and specifically\n * a POI for that allocation.\n * This function is called by a fisherman and it will pull `disputeDeposit` GRT tokens.\n *\n * Requirements:\n * - fisherman must have previously approved this contract to pull `disputeDeposit` amount\n * of tokens from their balance.\n *\n * @param allocationId The allocation to dispute\n * @param poi The Proof of Indexing (POI) being disputed\n * @return The dispute id\n */\n function createIndexingDispute(address allocationId, bytes32 poi) external returns (bytes32);\n\n /**\n * @notice Creates and auto-accepts a legacy dispute.\n * This disputes can be created to settle outstanding slashing amounts with an indexer that has been\n * \"legacy slashed\" during or shortly after the transition period. See {HorizonStakingExtension.legacySlash}\n * for more details.\n *\n * Note that this type of dispute:\n * - can only be created by the arbitrator\n * - does not require a bond\n * - is automatically accepted when created\n *\n * Additionally, note that this type of disputes allow the arbitrator to directly set the slash and rewards\n * amounts, bypassing the usual mechanisms that impose restrictions on those. This is done to give arbitrators\n * maximum flexibility to ensure outstanding slashing amounts are settled fairly. This function needs to be removed\n * after the transition period.\n *\n * Requirements:\n * - Indexer must have been legacy slashed during or shortly after the transition period\n * - Indexer must have provisioned funds to the Subgraph Service\n *\n * @param allocationId The allocation to dispute\n * @param fisherman The fisherman address to be credited with the rewards\n * @param tokensSlash The amount of tokens to slash\n * @param tokensRewards The amount of tokens to reward the fisherman\n * @return The dispute id\n */\n function createAndAcceptLegacyDispute(\n address allocationId,\n address fisherman,\n uint256 tokensSlash,\n uint256 tokensRewards\n ) external returns (bytes32);\n\n // -- Arbitrator --\n\n /**\n * @notice The arbitrator accepts a dispute as being valid.\n * This function will revert if the indexer is not slashable, whether because it does not have\n * any stake available or the slashing percentage is configured to be zero. In those cases\n * a dispute must be resolved using drawDispute or rejectDispute.\n * This function will also revert if the dispute is in conflict, to accept a conflicting dispute\n * use acceptDisputeConflict.\n * @dev Accept a dispute with Id `disputeId`\n * @param disputeId Id of the dispute to be accepted\n * @param tokensSlash Amount of tokens to slash from the indexer\n */\n function acceptDispute(bytes32 disputeId, uint256 tokensSlash) external;\n\n /**\n * @notice The arbitrator accepts a conflicting dispute as being valid.\n * This function will revert if the indexer is not slashable, whether because it does not have\n * any stake available or the slashing percentage is configured to be zero. In those cases\n * a dispute must be resolved using drawDispute.\n * @param disputeId Id of the dispute to be accepted\n * @param tokensSlash Amount of tokens to slash from the indexer for the first dispute\n * @param acceptDisputeInConflict Accept the conflicting dispute. Otherwise it will be drawn automatically\n * @param tokensSlashRelated Amount of tokens to slash from the indexer for the related dispute in case\n * acceptDisputeInConflict is true, otherwise it will be ignored\n */\n function acceptDisputeConflict(\n bytes32 disputeId,\n uint256 tokensSlash,\n bool acceptDisputeInConflict,\n uint256 tokensSlashRelated\n ) external;\n\n /**\n * @notice The arbitrator rejects a dispute as being invalid.\n * Note that conflicting query disputes cannot be rejected.\n * @dev Reject a dispute with Id `disputeId`\n * @param disputeId Id of the dispute to be rejected\n */\n function rejectDispute(bytes32 disputeId) external;\n\n /**\n * @notice The arbitrator draws dispute.\n * Note that drawing a conflicting query dispute should not be possible however it is allowed\n * to give arbitrators greater flexibility when resolving disputes.\n * @dev Ignore a dispute with Id `disputeId`\n * @param disputeId Id of the dispute to be disregarded\n */\n function drawDispute(bytes32 disputeId) external;\n\n /**\n * @notice Once the dispute period ends, if the dispute status remains Pending,\n * the fisherman can cancel the dispute and get back their initial deposit.\n * Note that cancelling a conflicting query dispute will also cancel the related dispute.\n * @dev Cancel a dispute with Id `disputeId`\n * @param disputeId Id of the dispute to be cancelled\n */\n function cancelDispute(bytes32 disputeId) external;\n\n // -- Getters --\n\n /**\n * @notice Get the fisherman reward cut.\n * @return Fisherman reward cut in percentage (ppm)\n */\n function getFishermanRewardCut() external view returns (uint32);\n\n /**\n * @notice Get the dispute period.\n * @return Dispute period in seconds\n */\n function getDisputePeriod() external view returns (uint64);\n\n /**\n * @notice Return whether a dispute exists or not.\n * @dev Return if dispute with Id `disputeId` exists\n * @param disputeId True if dispute already exists\n * @return True if dispute already exists\n */\n function isDisputeCreated(bytes32 disputeId) external view returns (bool);\n\n /**\n * @notice Get the message hash that a indexer used to sign the receipt.\n * Encodes a receipt using a domain separator, as described on\n * https://github.com/ethereum/EIPs/blob/master/EIPS/eip-712.md#specification.\n * @dev Return the message hash used to sign the receipt\n * @param receipt Receipt returned by indexer and submitted by fisherman\n * @return Message hash used to sign the receipt\n */\n function encodeReceipt(Attestation.Receipt memory receipt) external view returns (bytes32);\n\n /**\n * @notice Returns the indexer that signed an attestation.\n * @param attestation Attestation\n * @return indexer address\n */\n function getAttestationIndexer(Attestation.State memory attestation) external view returns (address);\n\n /**\n * @notice Get the stake snapshot for an indexer.\n * @param indexer The indexer address\n * @return The stake snapshot\n */\n function getStakeSnapshot(address indexer) external view returns (uint256);\n\n /**\n * @notice Checks if two attestations are conflicting\n * @param attestation1 The first attestation\n * @param attestation2 The second attestation\n * @return Whether the attestations are conflicting\n */\n function areConflictingAttestations(\n Attestation.State memory attestation1,\n Attestation.State memory attestation2\n ) external pure returns (bool);\n}\n" + }, + "contracts/interfaces/ISubgraphService.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0-or-later\npragma solidity 0.8.27;\n\nimport { IDataServiceFees } from \"@graphprotocol/horizon/contracts/data-service/interfaces/IDataServiceFees.sol\";\nimport { IGraphPayments } from \"@graphprotocol/horizon/contracts/interfaces/IGraphPayments.sol\";\n\nimport { Allocation } from \"../libraries/Allocation.sol\";\nimport { LegacyAllocation } from \"../libraries/LegacyAllocation.sol\";\n\n/**\n * @title Interface for the {SubgraphService} contract\n * @dev This interface extends {IDataServiceFees} and {IDataService}.\n * @notice The Subgraph Service is a data service built on top of Graph Horizon that supports the use case of\n * subgraph indexing and querying. The {SubgraphService} contract implements the flows described in the Data\n * Service framework to allow indexers to register as subgraph service providers, create allocations to signal\n * their commitment to index a subgraph, and collect fees for indexing and querying services.\n * @custom:security-contact Please email security+contracts@thegraph.com if you find any\n * bugs. We may have an active bug bounty program.\n */\ninterface ISubgraphService is IDataServiceFees {\n /**\n * @notice Indexer details\n * @param registeredAt The timestamp when the indexer registered\n * @param url The URL where the indexer can be reached at for queries\n * @param geoHash The indexer's geo location, expressed as a geo hash\n */\n struct Indexer {\n uint256 registeredAt;\n string url;\n string geoHash;\n }\n\n /**\n * @notice Emitted when a subgraph service collects query fees from Graph Payments\n * @param serviceProvider The address of the service provider\n * @param payer The address paying for the query fees\n * @param allocationId The id of the allocation\n * @param subgraphDeploymentId The id of the subgraph deployment\n * @param tokensCollected The amount of tokens collected\n * @param tokensCurators The amount of tokens curators receive\n */\n event QueryFeesCollected(\n address indexed serviceProvider,\n address indexed payer,\n address indexed allocationId,\n bytes32 subgraphDeploymentId,\n uint256 tokensCollected,\n uint256 tokensCurators\n );\n\n /**\n * @notice Emitted when an indexer sets a new payments destination\n * @param indexer The address of the indexer\n * @param paymentsDestination The address where payments should be sent\n */\n event PaymentsDestinationSet(address indexed indexer, address indexed paymentsDestination);\n\n /**\n * @notice Emitted when the stake to fees ratio is set.\n * @param ratio The stake to fees ratio\n */\n event StakeToFeesRatioSet(uint256 ratio);\n\n /**\n * @notice Emitted when curator cuts are set\n * @param curationCut The curation cut\n */\n event CurationCutSet(uint256 curationCut);\n\n /**\n * @notice Thrown when trying to set a curation cut that is not a valid PPM value\n * @param curationCut The curation cut value\n */\n error SubgraphServiceInvalidCurationCut(uint256 curationCut);\n\n /**\n * @notice Thrown when an indexer tries to register with an empty URL\n */\n error SubgraphServiceEmptyUrl();\n\n /**\n * @notice Thrown when an indexer tries to register with an empty geohash\n */\n error SubgraphServiceEmptyGeohash();\n\n /**\n * @notice Thrown when an indexer tries to register but they are already registered\n */\n error SubgraphServiceIndexerAlreadyRegistered();\n\n /**\n * @notice Thrown when an indexer tries to perform an operation but they are not registered\n * @param indexer The address of the indexer that is not registered\n */\n error SubgraphServiceIndexerNotRegistered(address indexer);\n\n /**\n * @notice Thrown when an indexer tries to collect fees for an unsupported payment type\n * @param paymentType The payment type that is not supported\n */\n error SubgraphServiceInvalidPaymentType(IGraphPayments.PaymentTypes paymentType);\n\n /**\n * @notice Thrown when the contract GRT balance is inconsistent after collecting from Graph Payments\n * @param balanceBefore The contract GRT balance before the collection\n * @param balanceAfter The contract GRT balance after the collection\n */\n error SubgraphServiceInconsistentCollection(uint256 balanceBefore, uint256 balanceAfter);\n\n /**\n * @notice @notice Thrown when the service provider in the RAV does not match the expected indexer.\n * @param providedIndexer The address of the provided indexer.\n * @param expectedIndexer The address of the expected indexer.\n */\n error SubgraphServiceIndexerMismatch(address providedIndexer, address expectedIndexer);\n\n /**\n * @notice Thrown when the indexer in the allocation state does not match the expected indexer.\n * @param indexer The address of the expected indexer.\n * @param allocationId The id of the allocation.\n */\n error SubgraphServiceAllocationNotAuthorized(address indexer, address allocationId);\n\n /**\n * @notice Thrown when collecting a RAV where the RAV indexer is not the same as the allocation indexer\n * @param ravIndexer The address of the RAV indexer\n * @param allocationIndexer The address of the allocation indexer\n */\n error SubgraphServiceInvalidRAV(address ravIndexer, address allocationIndexer);\n\n /**\n * @notice Thrown when trying to force close an allocation that is not stale and the indexer is not over-allocated\n * @param allocationId The id of the allocation\n */\n error SubgraphServiceCannotForceCloseAllocation(address allocationId);\n\n /**\n * @notice Thrown when trying to force close an altruistic allocation\n * @param allocationId The id of the allocation\n */\n error SubgraphServiceAllocationIsAltruistic(address allocationId);\n\n /**\n * @notice Thrown when trying to set stake to fees ratio to zero\n */\n error SubgraphServiceInvalidZeroStakeToFeesRatio();\n\n /**\n * @notice Thrown when collectionId is not a valid address\n * @param collectionId The collectionId\n */\n error SubgraphServiceInvalidCollectionId(bytes32 collectionId);\n\n /**\n * @notice Initialize the contract\n * @dev The thawingPeriod and verifierCut ranges are not set here because they are variables\n * on the DisputeManager. We use the {ProvisionManager} overrideable getters to get the ranges.\n * @param owner The owner of the contract\n * @param minimumProvisionTokens The minimum amount of provisioned tokens required to create an allocation\n * @param maximumDelegationRatio The maximum delegation ratio allowed for an allocation\n * @param stakeToFeesRatio The ratio of stake to fees to lock when collecting query fees\n */\n function initialize(\n address owner,\n uint256 minimumProvisionTokens,\n uint32 maximumDelegationRatio,\n uint256 stakeToFeesRatio\n ) external;\n\n /**\n * @notice Force close a stale allocation\n * @dev This function can be permissionlessly called when the allocation is stale. This\n * ensures that rewards for other allocations are not diluted by an inactive allocation.\n *\n * Requirements:\n * - Allocation must exist and be open\n * - Allocation must be stale\n * - Allocation cannot be altruistic\n *\n * Emits a {AllocationClosed} event.\n *\n * @param allocationId The id of the allocation\n */\n function closeStaleAllocation(address allocationId) external;\n\n /**\n * @notice Change the amount of tokens in an allocation\n * @dev Requirements:\n * - The indexer must be registered\n * - The provision must be valid according to the subgraph service rules\n * - `tokens` must be different from the current allocation size\n * - The indexer must have enough available tokens to allocate if they are upsizing the allocation\n *\n * Emits a {AllocationResized} event.\n *\n * See {AllocationManager-_resizeAllocation} for more details.\n *\n * @param indexer The address of the indexer\n * @param allocationId The id of the allocation\n * @param tokens The new amount of tokens in the allocation\n */\n function resizeAllocation(address indexer, address allocationId, uint256 tokens) external;\n\n /**\n * @notice Imports a legacy allocation id into the subgraph service\n * This is a governor only action that is required to prevent indexers from re-using allocation ids from the\n * legacy staking contract.\n * @param indexer The address of the indexer\n * @param allocationId The id of the allocation\n * @param subgraphDeploymentId The id of the subgraph deployment\n */\n function migrateLegacyAllocation(address indexer, address allocationId, bytes32 subgraphDeploymentId) external;\n\n /**\n * @notice Sets a pause guardian\n * @param pauseGuardian The address of the pause guardian\n * @param allowed True if the pause guardian is allowed to pause the contract, false otherwise\n */\n function setPauseGuardian(address pauseGuardian, bool allowed) external;\n\n /**\n * @notice Sets the minimum amount of provisioned tokens required to create an allocation\n * @param minimumProvisionTokens The minimum amount of provisioned tokens required to create an allocation\n */\n function setMinimumProvisionTokens(uint256 minimumProvisionTokens) external;\n\n /**\n * @notice Sets the delegation ratio\n * @param delegationRatio The delegation ratio\n */\n function setDelegationRatio(uint32 delegationRatio) external;\n\n /**\n * @notice Sets the stake to fees ratio\n * @param stakeToFeesRatio The stake to fees ratio\n */\n function setStakeToFeesRatio(uint256 stakeToFeesRatio) external;\n\n /**\n * @notice Sets the max POI staleness\n * See {AllocationManagerV1Storage-maxPOIStaleness} for more details.\n * @param maxPOIStaleness The max POI staleness in seconds\n */\n function setMaxPOIStaleness(uint256 maxPOIStaleness) external;\n\n /**\n * @notice Sets the curators payment cut for query fees\n * @dev Emits a {CuratorCutSet} event\n * @param curationCut The curation cut for the payment type\n */\n function setCurationCut(uint256 curationCut) external;\n\n /**\n * @notice Sets the payments destination for an indexer to receive payments\n * @dev Emits a {PaymentsDestinationSet} event\n * @param paymentsDestination The address where payments should be sent\n */\n function setPaymentsDestination(address paymentsDestination) external;\n\n /**\n * @notice Gets the details of an allocation\n * For legacy allocations use {getLegacyAllocation}\n * @param allocationId The id of the allocation\n * @return The allocation details\n */\n function getAllocation(address allocationId) external view returns (Allocation.State memory);\n\n /**\n * @notice Gets the details of a legacy allocation\n * For non-legacy allocations use {getAllocation}\n * @param allocationId The id of the allocation\n * @return The legacy allocation details\n */\n function getLegacyAllocation(address allocationId) external view returns (LegacyAllocation.State memory);\n\n /**\n * @notice Encodes the allocation proof for EIP712 signing\n * @param indexer The address of the indexer\n * @param allocationId The id of the allocation\n * @return The encoded allocation proof\n */\n function encodeAllocationProof(address indexer, address allocationId) external view returns (bytes32);\n\n /**\n * @notice Checks if an indexer is over-allocated\n * @param allocationId The id of the allocation\n * @return True if the indexer is over-allocated, false otherwise\n */\n function isOverAllocated(address allocationId) external view returns (bool);\n\n /**\n * @notice Gets the address of the dispute manager\n * @return The address of the dispute manager\n */\n function getDisputeManager() external view returns (address);\n\n /**\n * @notice Gets the address of the graph tally collector\n * @return The address of the graph tally collector\n */\n function getGraphTallyCollector() external view returns (address);\n\n /**\n * @notice Gets the address of the curation contract\n * @return The address of the curation contract\n */\n function getCuration() external view returns (address);\n}\n" + }, + "contracts/libraries/Allocation.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0-or-later\npragma solidity 0.8.27;\n\nimport { Math } from \"@openzeppelin/contracts/utils/math/Math.sol\";\n\n/**\n * @title Allocation library\n * @notice A library to handle Allocations.\n * @custom:security-contact Please email security+contracts@thegraph.com if you find any\n * bugs. We may have an active bug bounty program.\n */\nlibrary Allocation {\n using Allocation for State;\n\n /**\n * @notice Allocation details\n * @param indexer The indexer that owns the allocation\n * @param subgraphDeploymentId The subgraph deployment id the allocation is for\n * @param tokens The number of tokens allocated\n * @param createdAt The timestamp when the allocation was created\n * @param closedAt The timestamp when the allocation was closed\n * @param lastPOIPresentedAt The timestamp when the last POI was presented\n * @param accRewardsPerAllocatedToken The accumulated rewards per allocated token\n * @param accRewardsPending The accumulated rewards that are pending to be claimed due allocation resize\n * @param createdAtEpoch The epoch when the allocation was created\n */\n struct State {\n address indexer;\n bytes32 subgraphDeploymentId;\n uint256 tokens;\n uint256 createdAt;\n uint256 closedAt;\n uint256 lastPOIPresentedAt;\n uint256 accRewardsPerAllocatedToken;\n uint256 accRewardsPending;\n uint256 createdAtEpoch;\n }\n\n /**\n * @notice Thrown when attempting to create an allocation with an existing id\n * @param allocationId The allocation id\n */\n error AllocationAlreadyExists(address allocationId);\n\n /**\n * @notice Thrown when trying to perform an operation on a non-existent allocation\n * @param allocationId The allocation id\n */\n error AllocationDoesNotExist(address allocationId);\n\n /**\n * @notice Thrown when trying to perform an operation on a closed allocation\n * @param allocationId The allocation id\n * @param closedAt The timestamp when the allocation was closed\n */\n error AllocationClosed(address allocationId, uint256 closedAt);\n\n /**\n * @notice Create a new allocation\n * @dev Requirements:\n * - The allocation must not exist\n * @param self The allocation list mapping\n * @param indexer The indexer that owns the allocation\n * @param allocationId The allocation id\n * @param subgraphDeploymentId The subgraph deployment id the allocation is for\n * @param tokens The number of tokens allocated\n * @param accRewardsPerAllocatedToken The initial accumulated rewards per allocated token\n * @param createdAtEpoch The epoch when the allocation was created\n * @return The allocation\n */\n function create(\n mapping(address => State) storage self,\n address indexer,\n address allocationId,\n bytes32 subgraphDeploymentId,\n uint256 tokens,\n uint256 accRewardsPerAllocatedToken,\n uint256 createdAtEpoch\n ) internal returns (State memory) {\n require(!self[allocationId].exists(), AllocationAlreadyExists(allocationId));\n\n State memory allocation = State({\n indexer: indexer,\n subgraphDeploymentId: subgraphDeploymentId,\n tokens: tokens,\n createdAt: block.timestamp,\n closedAt: 0,\n lastPOIPresentedAt: 0,\n accRewardsPerAllocatedToken: accRewardsPerAllocatedToken,\n accRewardsPending: 0,\n createdAtEpoch: createdAtEpoch\n });\n\n self[allocationId] = allocation;\n\n return allocation;\n }\n\n /**\n * @notice Present a POI for an allocation\n * @dev It only updates the last POI presented timestamp.\n * Requirements:\n * - The allocation must be open\n * @param self The allocation list mapping\n * @param allocationId The allocation id\n */\n function presentPOI(mapping(address => State) storage self, address allocationId) internal {\n State storage allocation = _get(self, allocationId);\n require(allocation.isOpen(), AllocationClosed(allocationId, allocation.closedAt));\n allocation.lastPOIPresentedAt = block.timestamp;\n }\n\n /**\n * @notice Update the accumulated rewards per allocated token for an allocation\n * @dev Requirements:\n * - The allocation must be open\n * @param self The allocation list mapping\n * @param allocationId The allocation id\n * @param accRewardsPerAllocatedToken The new accumulated rewards per allocated token\n */\n function snapshotRewards(\n mapping(address => State) storage self,\n address allocationId,\n uint256 accRewardsPerAllocatedToken\n ) internal {\n State storage allocation = _get(self, allocationId);\n require(allocation.isOpen(), AllocationClosed(allocationId, allocation.closedAt));\n allocation.accRewardsPerAllocatedToken = accRewardsPerAllocatedToken;\n }\n\n /**\n * @notice Update the accumulated rewards pending to be claimed for an allocation\n * @dev Requirements:\n * - The allocation must be open\n * @param self The allocation list mapping\n * @param allocationId The allocation id\n */\n function clearPendingRewards(mapping(address => State) storage self, address allocationId) internal {\n State storage allocation = _get(self, allocationId);\n require(allocation.isOpen(), AllocationClosed(allocationId, allocation.closedAt));\n allocation.accRewardsPending = 0;\n }\n\n /**\n * @notice Close an allocation\n * @dev Requirements:\n * - The allocation must be open\n * @param self The allocation list mapping\n * @param allocationId The allocation id\n */\n function close(mapping(address => State) storage self, address allocationId) internal {\n State storage allocation = _get(self, allocationId);\n require(allocation.isOpen(), AllocationClosed(allocationId, allocation.closedAt));\n allocation.closedAt = block.timestamp;\n }\n\n /**\n * @notice Get an allocation\n * @param self The allocation list mapping\n * @param allocationId The allocation id\n * @return The allocation\n */\n function get(mapping(address => State) storage self, address allocationId) internal view returns (State memory) {\n return _get(self, allocationId);\n }\n\n /**\n * @notice Checks if an allocation is stale\n * @param self The allocation\n * @param staleThreshold The time in blocks to consider an allocation stale\n * @return True if the allocation is stale\n */\n function isStale(State memory self, uint256 staleThreshold) internal view returns (bool) {\n uint256 timeSinceLastPOI = block.timestamp - Math.max(self.createdAt, self.lastPOIPresentedAt);\n return self.isOpen() && timeSinceLastPOI > staleThreshold;\n }\n\n /**\n * @notice Checks if an allocation exists\n * @param self The allocation\n * @return True if the allocation exists\n */\n function exists(State memory self) internal pure returns (bool) {\n return self.createdAt != 0;\n }\n\n /**\n * @notice Checks if an allocation is open\n * @param self The allocation\n * @return True if the allocation is open\n */\n function isOpen(State memory self) internal pure returns (bool) {\n return self.exists() && self.closedAt == 0;\n }\n\n /**\n * @notice Checks if an allocation is alturistic\n * @param self The allocation\n * @return True if the allocation is alturistic\n */\n function isAltruistic(State memory self) internal pure returns (bool) {\n return self.exists() && self.tokens == 0;\n }\n\n /**\n * @notice Get the allocation for an allocation id\n * @dev Reverts if the allocation does not exist\n * @param self The allocation list mapping\n * @param allocationId The allocation id\n * @return The allocation\n */\n function _get(mapping(address => State) storage self, address allocationId) private view returns (State storage) {\n State storage allocation = self[allocationId];\n require(allocation.exists(), AllocationDoesNotExist(allocationId));\n return allocation;\n }\n}\n" + }, + "contracts/libraries/Attestation.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0-or-later\npragma solidity 0.8.27;\n\n/**\n * @title Attestation library\n * @notice A library to handle Attestation.\n * @custom:security-contact Please email security+contracts@thegraph.com if you find any\n * bugs. We may have an active bug bounty program.\n */\nlibrary Attestation {\n /**\n * @notice Receipt content sent from the service provider in response to request\n * @param requestCID The request CID\n * @param responseCID The response CID\n * @param subgraphDeploymentId The subgraph deployment id\n */\n struct Receipt {\n bytes32 requestCID;\n bytes32 responseCID;\n bytes32 subgraphDeploymentId;\n }\n\n /**\n * @notice Attestation sent from the service provider in response to a request\n * @param requestCID The request CID\n * @param responseCID The response CID\n * @param subgraphDeploymentId The subgraph deployment id\n * @param r The r value of the signature\n * @param s The s value of the signature\n * @param v The v value of the signature\n */\n struct State {\n bytes32 requestCID;\n bytes32 responseCID;\n bytes32 subgraphDeploymentId;\n bytes32 r;\n bytes32 s;\n uint8 v;\n }\n\n /// @notice Attestation size is the sum of the receipt (96) + signature (65)\n uint256 private constant RECEIPT_SIZE_BYTES = 96;\n\n /// @notice The length of the r value of the signature\n uint256 private constant SIG_R_LENGTH = 32;\n\n /// @notice The length of the s value of the signature\n uint256 private constant SIG_S_LENGTH = 32;\n\n /// @notice The length of the v value of the signature\n uint256 private constant SIG_V_LENGTH = 1;\n\n /// @notice The offset of the r value of the signature\n uint256 private constant SIG_R_OFFSET = RECEIPT_SIZE_BYTES;\n\n /// @notice The offset of the s value of the signature\n uint256 private constant SIG_S_OFFSET = RECEIPT_SIZE_BYTES + SIG_R_LENGTH;\n\n /// @notice The offset of the v value of the signature\n uint256 private constant SIG_V_OFFSET = RECEIPT_SIZE_BYTES + SIG_R_LENGTH + SIG_S_LENGTH;\n\n /// @notice The size of the signature\n uint256 private constant SIG_SIZE_BYTES = SIG_R_LENGTH + SIG_S_LENGTH + SIG_V_LENGTH;\n\n /// @notice The size of the attestation\n uint256 private constant ATTESTATION_SIZE_BYTES = RECEIPT_SIZE_BYTES + SIG_SIZE_BYTES;\n\n /// @notice The length of the uint8 value\n uint256 private constant UINT8_BYTE_LENGTH = 1;\n\n /// @notice The length of the bytes32 value\n uint256 private constant BYTES32_BYTE_LENGTH = 32;\n\n /**\n * @notice The error thrown when the attestation data length is invalid\n * @param length The length of the attestation data\n * @param expectedLength The expected length of the attestation data\n */\n error AttestationInvalidBytesLength(uint256 length, uint256 expectedLength);\n\n /**\n * @dev Returns if two attestations are conflicting.\n * Everything must match except for the responseId.\n * @param _attestation1 Attestation\n * @param _attestation2 Attestation\n * @return True if the two attestations are conflicting\n */\n function areConflicting(\n Attestation.State memory _attestation1,\n Attestation.State memory _attestation2\n ) internal pure returns (bool) {\n return (_attestation1.requestCID == _attestation2.requestCID &&\n _attestation1.subgraphDeploymentId == _attestation2.subgraphDeploymentId &&\n _attestation1.responseCID != _attestation2.responseCID);\n }\n\n /**\n * @dev Parse the bytes attestation into a struct from `_data`.\n * @param _data The bytes to parse\n * @return Attestation struct\n */\n function parse(bytes memory _data) internal pure returns (State memory) {\n // Check attestation data length\n require(\n _data.length == ATTESTATION_SIZE_BYTES,\n AttestationInvalidBytesLength(_data.length, ATTESTATION_SIZE_BYTES)\n );\n\n // Decode receipt\n (bytes32 requestCID, bytes32 responseCID, bytes32 subgraphDeploymentId) = abi.decode(\n _data,\n (bytes32, bytes32, bytes32)\n );\n\n // Decode signature\n // Signature is expected to be in the order defined in the Attestation struct\n bytes32 r = _toBytes32(_data, SIG_R_OFFSET);\n bytes32 s = _toBytes32(_data, SIG_S_OFFSET);\n uint8 v = _toUint8(_data, SIG_V_OFFSET);\n\n return State(requestCID, responseCID, subgraphDeploymentId, r, s, v);\n }\n\n /**\n * @dev Parse a uint8 from `_bytes` starting at offset `_start`.\n * @param _bytes The bytes to parse\n * @param _start The start offset\n * @return uint8 value\n */\n function _toUint8(bytes memory _bytes, uint256 _start) private pure returns (uint8) {\n require(\n _bytes.length >= _start + UINT8_BYTE_LENGTH,\n AttestationInvalidBytesLength(_bytes.length, _start + UINT8_BYTE_LENGTH)\n );\n uint8 tempUint;\n\n // solhint-disable-next-line no-inline-assembly\n assembly {\n // Load the 32-byte word from memory starting at `_bytes + _start + 1`\n // The `0x1` accounts for the fact that we want only the first byte (uint8)\n // of the loaded 32 bytes.\n tempUint := mload(add(add(_bytes, 0x1), _start))\n }\n\n return tempUint;\n }\n\n /**\n * @dev Parse a bytes32 from `_bytes` starting at offset `_start`.\n * @param _bytes The bytes to parse\n * @param _start The start offset\n * @return bytes32 value\n */\n function _toBytes32(bytes memory _bytes, uint256 _start) private pure returns (bytes32) {\n require(\n _bytes.length >= _start + BYTES32_BYTE_LENGTH,\n AttestationInvalidBytesLength(_bytes.length, _start + BYTES32_BYTE_LENGTH)\n );\n bytes32 tempBytes32;\n\n // solhint-disable-next-line no-inline-assembly\n assembly {\n tempBytes32 := mload(add(add(_bytes, 0x20), _start))\n }\n\n return tempBytes32;\n }\n}\n" + }, + "contracts/libraries/LegacyAllocation.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0-or-later\npragma solidity 0.8.27;\n\nimport { IHorizonStaking } from \"@graphprotocol/horizon/contracts/interfaces/IHorizonStaking.sol\";\n\n/**\n * @title LegacyAllocation library\n * @notice A library to handle legacy Allocations.\n * @custom:security-contact Please email security+contracts@thegraph.com if you find any\n * bugs. We may have an active bug bounty program.\n */\nlibrary LegacyAllocation {\n using LegacyAllocation for State;\n\n /**\n * @notice Legacy allocation details\n * @dev Note that we are only storing the indexer and subgraphDeploymentId. The main point of tracking legacy allocations\n * is to prevent them from being re used on the Subgraph Service. We don't need to store the rest of the allocation details.\n * @param indexer The indexer that owns the allocation\n * @param subgraphDeploymentId The subgraph deployment id the allocation is for\n */\n struct State {\n address indexer;\n bytes32 subgraphDeploymentId;\n }\n\n /**\n * @notice Thrown when attempting to migrate an allocation with an existing id\n * @param allocationId The allocation id\n */\n error LegacyAllocationAlreadyExists(address allocationId);\n\n /**\n * @notice Thrown when trying to get a non-existent allocation\n * @param allocationId The allocation id\n */\n error LegacyAllocationDoesNotExist(address allocationId);\n\n /**\n * @notice Migrate a legacy allocation\n * @dev Requirements:\n * - The allocation must not have been previously migrated\n * @param self The legacy allocation list mapping\n * @param indexer The indexer that owns the allocation\n * @param allocationId The allocation id\n * @param subgraphDeploymentId The subgraph deployment id the allocation is for\n * @custom:error LegacyAllocationAlreadyMigrated if the allocation has already been migrated\n */\n function migrate(\n mapping(address => State) storage self,\n address indexer,\n address allocationId,\n bytes32 subgraphDeploymentId\n ) internal {\n require(!self[allocationId].exists(), LegacyAllocationAlreadyExists(allocationId));\n\n self[allocationId] = State({ indexer: indexer, subgraphDeploymentId: subgraphDeploymentId });\n }\n\n /**\n * @notice Get a legacy allocation\n * @param self The legacy allocation list mapping\n * @param allocationId The allocation id\n * @return The legacy allocation details\n */\n function get(mapping(address => State) storage self, address allocationId) internal view returns (State memory) {\n return _get(self, allocationId);\n }\n\n /**\n * @notice Revert if a legacy allocation exists\n * @dev We first check the migrated mapping then the old staking contract.\n * @dev TRANSITION PERIOD: after the transition period when all the allocations are migrated we can\n * remove the call to the staking contract.\n * @param self The legacy allocation list mapping\n * @param graphStaking The Horizon Staking contract\n * @param allocationId The allocation id\n */\n function revertIfExists(\n mapping(address => State) storage self,\n IHorizonStaking graphStaking,\n address allocationId\n ) internal view {\n require(!self[allocationId].exists(), LegacyAllocationAlreadyExists(allocationId));\n require(!graphStaking.isAllocation(allocationId), LegacyAllocationAlreadyExists(allocationId));\n }\n\n /**\n * @notice Check if a legacy allocation exists\n * @param self The legacy allocation\n * @return True if the allocation exists\n */\n function exists(State memory self) internal pure returns (bool) {\n return self.indexer != address(0);\n }\n\n /**\n * @notice Get a legacy allocation\n * @param self The legacy allocation list mapping\n * @param allocationId The allocation id\n * @return The legacy allocation details\n */\n function _get(mapping(address => State) storage self, address allocationId) private view returns (State storage) {\n State storage allocation = self[allocationId];\n require(allocation.exists(), LegacyAllocationDoesNotExist(allocationId));\n return allocation;\n }\n}\n" + }, + "contracts/mocks/imports.sol": { + "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity ^0.7.6 || 0.8.27;\n\n// These are needed to get artifacts for toolshed\nimport \"@graphprotocol/contracts/contracts/l2/curation/IL2Curation.sol\";\nimport \"@graphprotocol/contracts/contracts/l2/discovery/IL2GNS.sol\";\nimport \"@graphprotocol/contracts/contracts/disputes/IDisputeManager.sol\";\n" + }, + "contracts/SubgraphService.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0-or-later\npragma solidity 0.8.27;\n\nimport { IGraphPayments } from \"@graphprotocol/horizon/contracts/interfaces/IGraphPayments.sol\";\nimport { IGraphToken } from \"@graphprotocol/contracts/contracts/token/IGraphToken.sol\";\nimport { IGraphTallyCollector } from \"@graphprotocol/horizon/contracts/interfaces/IGraphTallyCollector.sol\";\nimport { IRewardsIssuer } from \"@graphprotocol/contracts/contracts/rewards/IRewardsIssuer.sol\";\nimport { IDataService } from \"@graphprotocol/horizon/contracts/data-service/interfaces/IDataService.sol\";\nimport { ISubgraphService } from \"./interfaces/ISubgraphService.sol\";\n\nimport { OwnableUpgradeable } from \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\nimport { MulticallUpgradeable } from \"@openzeppelin/contracts-upgradeable/utils/MulticallUpgradeable.sol\";\nimport { Initializable } from \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\nimport { DataServicePausableUpgradeable } from \"@graphprotocol/horizon/contracts/data-service/extensions/DataServicePausableUpgradeable.sol\";\nimport { DataService } from \"@graphprotocol/horizon/contracts/data-service/DataService.sol\";\nimport { DataServiceFees } from \"@graphprotocol/horizon/contracts/data-service/extensions/DataServiceFees.sol\";\nimport { Directory } from \"./utilities/Directory.sol\";\nimport { AllocationManager } from \"./utilities/AllocationManager.sol\";\nimport { SubgraphServiceV1Storage } from \"./SubgraphServiceStorage.sol\";\n\nimport { TokenUtils } from \"@graphprotocol/contracts/contracts/utils/TokenUtils.sol\";\nimport { PPMMath } from \"@graphprotocol/horizon/contracts/libraries/PPMMath.sol\";\nimport { Allocation } from \"./libraries/Allocation.sol\";\nimport { LegacyAllocation } from \"./libraries/LegacyAllocation.sol\";\n\n/**\n * @title SubgraphService contract\n * @custom:security-contact Please email security+contracts@thegraph.com if you find any\n * bugs. We may have an active bug bounty program.\n */\ncontract SubgraphService is\n Initializable,\n OwnableUpgradeable,\n MulticallUpgradeable,\n DataService,\n DataServicePausableUpgradeable,\n DataServiceFees,\n Directory,\n AllocationManager,\n SubgraphServiceV1Storage,\n IRewardsIssuer,\n ISubgraphService\n{\n using PPMMath for uint256;\n using Allocation for mapping(address => Allocation.State);\n using Allocation for Allocation.State;\n using TokenUtils for IGraphToken;\n\n /**\n * @notice Checks that an indexer is registered\n * @param indexer The address of the indexer\n */\n modifier onlyRegisteredIndexer(address indexer) {\n require(indexers[indexer].registeredAt != 0, SubgraphServiceIndexerNotRegistered(indexer));\n _;\n }\n\n /**\n * @notice Constructor for the SubgraphService contract\n * @dev DataService and Directory constructors set a bunch of immutable variables\n * @param graphController The address of the Graph Controller contract\n * @param disputeManager The address of the DisputeManager contract\n * @param graphTallyCollector The address of the GraphTallyCollector contract\n * @param curation The address of the Curation contract\n */\n constructor(\n address graphController,\n address disputeManager,\n address graphTallyCollector,\n address curation\n ) DataService(graphController) Directory(address(this), disputeManager, graphTallyCollector, curation) {\n _disableInitializers();\n }\n\n /// @inheritdoc ISubgraphService\n function initialize(\n address owner,\n uint256 minimumProvisionTokens,\n uint32 maximumDelegationRatio,\n uint256 stakeToFeesRatio_\n ) external initializer {\n __Ownable_init(owner);\n __Multicall_init();\n __DataService_init();\n __DataServicePausable_init();\n __AllocationManager_init(\"SubgraphService\", \"1.0\");\n\n _setProvisionTokensRange(minimumProvisionTokens, type(uint256).max);\n _setDelegationRatio(maximumDelegationRatio);\n _setStakeToFeesRatio(stakeToFeesRatio_);\n }\n\n /**\n * @notice\n * @dev Implements {IDataService.register}\n *\n * Requirements:\n * - The indexer must not be already registered\n * - The URL must not be empty\n * - The provision must be valid according to the subgraph service rules\n *\n * Emits a {ServiceProviderRegistered} event\n *\n * @param indexer The address of the indexer to register\n * @param data Encoded registration data:\n * - string `url`: The URL of the indexer\n * - string `geohash`: The geohash of the indexer\n * - address `paymentsDestination`: The address where the indexer wants to receive payments.\n * Use zero address for automatically restaking payments.\n */\n /// @inheritdoc IDataService\n function register(\n address indexer,\n bytes calldata data\n ) external override onlyAuthorizedForProvision(indexer) onlyValidProvision(indexer) whenNotPaused {\n (string memory url, string memory geohash, address paymentsDestination_) = abi.decode(\n data,\n (string, string, address)\n );\n\n require(bytes(url).length > 0, SubgraphServiceEmptyUrl());\n require(bytes(geohash).length > 0, SubgraphServiceEmptyGeohash());\n require(indexers[indexer].registeredAt == 0, SubgraphServiceIndexerAlreadyRegistered());\n\n // Register the indexer\n indexers[indexer] = Indexer({ registeredAt: block.timestamp, url: url, geoHash: geohash });\n if (paymentsDestination_ != address(0)) {\n _setPaymentsDestination(indexer, paymentsDestination_);\n }\n\n emit ServiceProviderRegistered(indexer, data);\n }\n\n /**\n * @notice Accept staged parameters in the provision of a service provider\n * @dev Implements {IDataService-acceptProvisionPendingParameters}\n *\n * Requirements:\n * - The indexer must be registered\n * - Must have previously staged provision parameters, using {IHorizonStaking-setProvisionParameters}\n * - The new provision parameters must be valid according to the subgraph service rules\n *\n * Emits a {ProvisionPendingParametersAccepted} event\n *\n * @param indexer The address of the indexer to accept the provision for\n */\n /// @inheritdoc IDataService\n function acceptProvisionPendingParameters(\n address indexer,\n bytes calldata\n ) external override onlyAuthorizedForProvision(indexer) whenNotPaused {\n _acceptProvisionParameters(indexer);\n emit ProvisionPendingParametersAccepted(indexer);\n }\n\n /**\n * @notice Allocates tokens to subgraph deployment, manifesting the indexer's commitment to index it\n * @dev This is the equivalent of the `allocate` function in the legacy Staking contract.\n *\n * Requirements:\n * - The indexer must be registered\n * - The provision must be valid according to the subgraph service rules\n * - Allocation id cannot be zero\n * - Allocation id cannot be reused from the legacy staking contract\n * - The indexer must have enough available tokens to allocate\n *\n * The `allocationProof` is a 65-bytes Ethereum signed message of `keccak256(indexerAddress,allocationId)`.\n *\n * See {AllocationManager-allocate} for more details.\n *\n * Emits {ServiceStarted} and {AllocationCreated} events\n *\n * @param indexer The address of the indexer\n * @param data Encoded data:\n * - bytes32 `subgraphDeploymentId`: The id of the subgraph deployment\n * - uint256 `tokens`: The amount of tokens to allocate\n * - address `allocationId`: The id of the allocation\n * - bytes `allocationProof`: Signed proof of the allocation id address ownership\n */\n /// @inheritdoc IDataService\n function startService(\n address indexer,\n bytes calldata data\n )\n external\n override\n onlyAuthorizedForProvision(indexer)\n onlyValidProvision(indexer)\n onlyRegisteredIndexer(indexer)\n whenNotPaused\n {\n (bytes32 subgraphDeploymentId, uint256 tokens, address allocationId, bytes memory allocationProof) = abi.decode(\n data,\n (bytes32, uint256, address, bytes)\n );\n _allocate(indexer, allocationId, subgraphDeploymentId, tokens, allocationProof, _delegationRatio);\n emit ServiceStarted(indexer, data);\n }\n\n /**\n * @notice Close an allocation, indicating that the indexer has stopped indexing the subgraph deployment\n * @dev This is the equivalent of the `closeAllocation` function in the legacy Staking contract.\n * There are a few notable differences with the legacy function:\n * - allocations are nowlong lived. All service payments, including indexing rewards, should be collected periodically\n * without the need of closing the allocation. Allocations should only be closed when indexers want to reclaim the allocated\n * tokens for other purposes.\n * - No POI is required to close an allocation. Indexers should present POIs to collect indexing rewards using {collect}.\n *\n * Requirements:\n * - The indexer must be registered\n * - Allocation must exist and be open\n *\n * Emits {ServiceStopped} and {AllocationClosed} events\n *\n * @param indexer The address of the indexer\n * @param data Encoded data:\n * - address `allocationId`: The id of the allocation\n */\n /// @inheritdoc IDataService\n function stopService(\n address indexer,\n bytes calldata data\n ) external override onlyAuthorizedForProvision(indexer) onlyRegisteredIndexer(indexer) whenNotPaused {\n address allocationId = abi.decode(data, (address));\n require(\n _allocations.get(allocationId).indexer == indexer,\n SubgraphServiceAllocationNotAuthorized(indexer, allocationId)\n );\n _closeAllocation(allocationId, false);\n emit ServiceStopped(indexer, data);\n }\n\n /**\n * @notice Collects payment for the service provided by the indexer\n * Allows collecting different types of payments such as query fees and indexing rewards.\n * It uses Graph Horizon payments protocol to process payments.\n * Reverts if the payment type is not supported.\n * @dev This function is the equivalent of the `collect` function for query fees and the `closeAllocation` function\n * for indexing rewards in the legacy Staking contract.\n *\n * Requirements:\n * - The indexer must be registered\n * - The provision must be valid according to the subgraph service rules\n *\n * Emits a {ServicePaymentCollected} event. Emits payment type specific events.\n *\n * For query fees, see {SubgraphService-_collectQueryFees} for more details.\n * For indexing rewards, see {AllocationManager-_collectIndexingRewards} for more details.\n *\n * @param indexer The address of the indexer\n * @param paymentType The type of payment to collect as defined in {IGraphPayments}\n * @param data Encoded data:\n * - For query fees:\n * - IGraphTallyCollector.SignedRAV `signedRav`: The signed RAV\n * - For indexing rewards:\n * - address `allocationId`: The id of the allocation\n * - bytes32 `poi`: The POI being presented\n * - bytes `poiMetadata`: The metadata associated with the POI. See {AllocationManager-_collectIndexingRewards} for more details.\n */\n /// @inheritdoc IDataService\n function collect(\n address indexer,\n IGraphPayments.PaymentTypes paymentType,\n bytes calldata data\n )\n external\n override\n onlyAuthorizedForProvision(indexer)\n onlyValidProvision(indexer)\n onlyRegisteredIndexer(indexer)\n whenNotPaused\n returns (uint256)\n {\n uint256 paymentCollected = 0;\n\n if (paymentType == IGraphPayments.PaymentTypes.QueryFee) {\n paymentCollected = _collectQueryFees(indexer, data);\n } else if (paymentType == IGraphPayments.PaymentTypes.IndexingRewards) {\n paymentCollected = _collectIndexingRewards(indexer, data);\n } else {\n revert SubgraphServiceInvalidPaymentType(paymentType);\n }\n\n emit ServicePaymentCollected(indexer, paymentType, paymentCollected);\n return paymentCollected;\n }\n\n /**\n * @notice See {IHorizonStaking-slash} for more details.\n * @dev Slashing is delegated to the {DisputeManager} contract which is the only one that can call this\n * function.\n */\n /// @inheritdoc IDataService\n function slash(address indexer, bytes calldata data) external override onlyDisputeManager {\n (uint256 tokens, uint256 reward) = abi.decode(data, (uint256, uint256));\n _graphStaking().slash(indexer, tokens, reward, address(_disputeManager()));\n emit ServiceProviderSlashed(indexer, tokens);\n }\n\n /// @inheritdoc ISubgraphService\n function closeStaleAllocation(address allocationId) external override whenNotPaused {\n Allocation.State memory allocation = _allocations.get(allocationId);\n require(allocation.isStale(maxPOIStaleness), SubgraphServiceCannotForceCloseAllocation(allocationId));\n require(!allocation.isAltruistic(), SubgraphServiceAllocationIsAltruistic(allocationId));\n _closeAllocation(allocationId, true);\n }\n\n /// @inheritdoc ISubgraphService\n function resizeAllocation(\n address indexer,\n address allocationId,\n uint256 tokens\n )\n external\n onlyAuthorizedForProvision(indexer)\n onlyValidProvision(indexer)\n onlyRegisteredIndexer(indexer)\n whenNotPaused\n {\n require(\n _allocations.get(allocationId).indexer == indexer,\n SubgraphServiceAllocationNotAuthorized(indexer, allocationId)\n );\n _resizeAllocation(allocationId, tokens, _delegationRatio);\n }\n\n /// @inheritdoc ISubgraphService\n function migrateLegacyAllocation(\n address indexer,\n address allocationId,\n bytes32 subgraphDeploymentID\n ) external override onlyOwner {\n _migrateLegacyAllocation(indexer, allocationId, subgraphDeploymentID);\n }\n\n /// @inheritdoc ISubgraphService\n function setPauseGuardian(address pauseGuardian, bool allowed) external override onlyOwner {\n _setPauseGuardian(pauseGuardian, allowed);\n }\n\n /// @inheritdoc ISubgraphService\n function setPaymentsDestination(address paymentsDestination_) external override {\n _setPaymentsDestination(msg.sender, paymentsDestination_);\n }\n\n /// @inheritdoc ISubgraphService\n function setMinimumProvisionTokens(uint256 minimumProvisionTokens) external override onlyOwner {\n _setProvisionTokensRange(minimumProvisionTokens, DEFAULT_MAX_PROVISION_TOKENS);\n }\n\n /// @inheritdoc ISubgraphService\n function setDelegationRatio(uint32 delegationRatio) external override onlyOwner {\n _setDelegationRatio(delegationRatio);\n }\n\n /// @inheritdoc ISubgraphService\n function setStakeToFeesRatio(uint256 stakeToFeesRatio_) external override onlyOwner {\n _setStakeToFeesRatio(stakeToFeesRatio_);\n }\n\n /// @inheritdoc ISubgraphService\n function setMaxPOIStaleness(uint256 maxPOIStaleness_) external override onlyOwner {\n _setMaxPOIStaleness(maxPOIStaleness_);\n }\n\n /// @inheritdoc ISubgraphService\n function setCurationCut(uint256 curationCut) external override onlyOwner {\n require(PPMMath.isValidPPM(curationCut), SubgraphServiceInvalidCurationCut(curationCut));\n curationFeesCut = curationCut;\n emit CurationCutSet(curationCut);\n }\n\n /// @inheritdoc ISubgraphService\n function getAllocation(address allocationId) external view override returns (Allocation.State memory) {\n return _allocations[allocationId];\n }\n\n /// @inheritdoc IRewardsIssuer\n function getAllocationData(\n address allocationId\n ) external view override returns (bool, address, bytes32, uint256, uint256, uint256) {\n Allocation.State memory allo = _allocations[allocationId];\n return (\n allo.isOpen(),\n allo.indexer,\n allo.subgraphDeploymentId,\n allo.tokens,\n allo.accRewardsPerAllocatedToken,\n allo.accRewardsPending\n );\n }\n\n /// @inheritdoc IRewardsIssuer\n function getSubgraphAllocatedTokens(bytes32 subgraphDeploymentId) external view override returns (uint256) {\n return _subgraphAllocatedTokens[subgraphDeploymentId];\n }\n\n /// @inheritdoc ISubgraphService\n function getLegacyAllocation(address allocationId) external view override returns (LegacyAllocation.State memory) {\n return _legacyAllocations[allocationId];\n }\n\n /// @inheritdoc ISubgraphService\n function getDisputeManager() external view override returns (address) {\n return address(_disputeManager());\n }\n\n /// @inheritdoc ISubgraphService\n function getGraphTallyCollector() external view override returns (address) {\n return address(_graphTallyCollector());\n }\n\n /// @inheritdoc ISubgraphService\n function getCuration() external view override returns (address) {\n return address(_curation());\n }\n\n /// @inheritdoc ISubgraphService\n function encodeAllocationProof(address indexer, address allocationId) external view override returns (bytes32) {\n return _encodeAllocationProof(indexer, allocationId);\n }\n\n /// @inheritdoc ISubgraphService\n function isOverAllocated(address indexer) external view override returns (bool) {\n return _isOverAllocated(indexer, _delegationRatio);\n }\n\n // -- Data service parameter getters --\n /**\n * @notice Getter for the accepted thawing period range for provisions\n * The accepted range is just the dispute period defined by {DisputeManager-getDisputePeriod}\n * @dev This override ensures {ProvisionManager} uses the thawing period from the {DisputeManager}\n * @return The minimum thawing period - the dispute period\n * @return The maximum thawing period - the dispute period\n */\n function _getThawingPeriodRange() internal view override returns (uint64, uint64) {\n uint64 disputePeriod = _disputeManager().getDisputePeriod();\n return (disputePeriod, disputePeriod);\n }\n\n /**\n * @notice Getter for the accepted verifier cut range for provisions\n * @return The minimum verifier cut which is defined by the fisherman reward cut {DisputeManager-getFishermanRewardCut}\n * @return The maximum is 100% in PPM\n */\n function _getVerifierCutRange() internal view override returns (uint32, uint32) {\n return (_disputeManager().getFishermanRewardCut(), DEFAULT_MAX_VERIFIER_CUT);\n }\n\n /**\n * @notice Collect query fees\n * Stake equal to the amount being collected times the `stakeToFeesRatio` is locked into a stake claim.\n * This claim can be released at a later stage once expired.\n *\n * It's important to note that before collecting this function will attempt to release any expired stake claims.\n * This could lead to an out of gas error if there are too many expired claims. In that case, the indexer will need to\n * manually release the claims, see {IDataServiceFees-releaseStake}, before attempting to collect again.\n *\n * @dev This function is the equivalent of the legacy `collect` function for query fees.\n * @dev Uses the {GraphTallyCollector} to collect payment from Graph Horizon payments protocol.\n * Fees are distributed to service provider and delegators by {GraphPayments}, though curators\n * share is distributed by this function.\n *\n * Query fees can be collected on closed allocations.\n *\n * Requirements:\n * - Indexer must have enough available tokens to lock as economic security for fees\n *\n * Emits a {StakeClaimsReleased} event, and a {StakeClaimReleased} event for each claim released.\n * Emits a {StakeClaimLocked} event.\n * Emits a {QueryFeesCollected} event.\n *\n * @param indexer The address of the indexer\n * @param data Encoded data:\n * - IGraphTallyCollector.SignedRAV `signedRav`: The signed RAV\n * - uint256 `tokensToCollect`: The amount of tokens to collect. Allows partially collecting a RAV. If 0, the entire RAV will\n * be collected.\n * @return The amount of fees collected\n */\n function _collectQueryFees(address indexer, bytes calldata data) private returns (uint256) {\n (IGraphTallyCollector.SignedRAV memory signedRav, uint256 tokensToCollect) = abi.decode(\n data,\n (IGraphTallyCollector.SignedRAV, uint256)\n );\n require(\n signedRav.rav.serviceProvider == indexer,\n SubgraphServiceIndexerMismatch(signedRav.rav.serviceProvider, indexer)\n );\n\n // Check that collectionId (256 bits) is a valid address (160 bits)\n // collectionId is expected to be a zero padded address so it's safe to cast to uint160\n require(\n uint256(signedRav.rav.collectionId) <= type(uint160).max,\n SubgraphServiceInvalidCollectionId(signedRav.rav.collectionId)\n );\n address allocationId = address(uint160(uint256(signedRav.rav.collectionId)));\n Allocation.State memory allocation = _allocations.get(allocationId);\n\n // Check RAV is consistent - RAV indexer must match the allocation's indexer\n require(allocation.indexer == indexer, SubgraphServiceInvalidRAV(indexer, allocation.indexer));\n bytes32 subgraphDeploymentId = allocation.subgraphDeploymentId;\n\n // release expired stake claims\n _releaseStake(indexer, 0);\n\n // Collect from GraphPayments - only curators cut is sent back to the subgraph service\n uint256 tokensCollected;\n uint256 tokensCurators;\n {\n uint256 balanceBefore = _graphToken().balanceOf(address(this));\n\n tokensCollected = _graphTallyCollector().collect(\n IGraphPayments.PaymentTypes.QueryFee,\n _encodeGraphTallyData(signedRav, _curation().isCurated(subgraphDeploymentId) ? curationFeesCut : 0),\n tokensToCollect\n );\n\n uint256 balanceAfter = _graphToken().balanceOf(address(this));\n require(balanceAfter >= balanceBefore, SubgraphServiceInconsistentCollection(balanceBefore, balanceAfter));\n tokensCurators = balanceAfter - balanceBefore;\n }\n\n if (tokensCollected > 0) {\n // lock stake as economic security for fees\n _lockStake(\n indexer,\n tokensCollected * stakeToFeesRatio,\n block.timestamp + _disputeManager().getDisputePeriod()\n );\n\n if (tokensCurators > 0) {\n // curation collection changes subgraph signal so we take rewards snapshot\n _graphRewardsManager().onSubgraphSignalUpdate(subgraphDeploymentId);\n\n // Send GRT and bookkeep by calling collect()\n _graphToken().pushTokens(address(_curation()), tokensCurators);\n _curation().collect(subgraphDeploymentId, tokensCurators);\n }\n }\n\n emit QueryFeesCollected(\n indexer,\n signedRav.rav.payer,\n allocationId,\n subgraphDeploymentId,\n tokensCollected,\n tokensCurators\n );\n return tokensCollected;\n }\n\n /**\n * @notice Collect indexing rewards\n * @param indexer The address of the indexer\n * @param data Encoded data:\n * - address `allocationId`: The id of the allocation\n * - bytes32 `poi`: The POI being presented\n * - bytes `poiMetadata`: The metadata associated with the POI. See {AllocationManager-_presentPOI} for more details.\n * @return The amount of indexing rewards collected\n */\n function _collectIndexingRewards(address indexer, bytes calldata data) private returns (uint256) {\n (address allocationId, bytes32 poi_, bytes memory poiMetadata_) = abi.decode(data, (address, bytes32, bytes));\n require(\n _allocations.get(allocationId).indexer == indexer,\n SubgraphServiceAllocationNotAuthorized(indexer, allocationId)\n );\n return _presentPOI(allocationId, poi_, poiMetadata_, _delegationRatio, paymentsDestination[indexer]);\n }\n\n /**\n * @notice Sets the payments destination for an indexer to receive payments\n * @dev Emits a {PaymentsDestinationSet} event\n * @param _indexer The address of the indexer\n * @param _paymentsDestination The address where payments should be sent\n */\n function _setPaymentsDestination(address _indexer, address _paymentsDestination) internal {\n paymentsDestination[_indexer] = _paymentsDestination;\n emit PaymentsDestinationSet(_indexer, _paymentsDestination);\n }\n\n /**\n * @notice Set the stake to fees ratio.\n * @param _stakeToFeesRatio The stake to fees ratio\n */\n function _setStakeToFeesRatio(uint256 _stakeToFeesRatio) private {\n require(_stakeToFeesRatio != 0, SubgraphServiceInvalidZeroStakeToFeesRatio());\n stakeToFeesRatio = _stakeToFeesRatio;\n emit StakeToFeesRatioSet(_stakeToFeesRatio);\n }\n\n /**\n * @notice Encodes the data for the GraphTallyCollector\n * @dev The purpose of this function is just to avoid stack too deep errors\n * @param signedRav The signed RAV\n * @param curationCut The curation cut\n * @return The encoded data\n */\n function _encodeGraphTallyData(\n IGraphTallyCollector.SignedRAV memory signedRav,\n uint256 curationCut\n ) private view returns (bytes memory) {\n return abi.encode(signedRav, curationCut, paymentsDestination[signedRav.rav.serviceProvider]);\n }\n}\n" + }, + "contracts/SubgraphServiceStorage.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0-or-later\npragma solidity 0.8.27;\n\nimport { ISubgraphService } from \"./interfaces/ISubgraphService.sol\";\n\n/**\n * @title SubgraphServiceStorage\n * @notice This contract holds all the storage variables for the Subgraph Service contract.\n * @custom:security-contact Please email security+contracts@thegraph.com if you find any\n * bugs. We may have an active bug bounty program.\n */\nabstract contract SubgraphServiceV1Storage {\n /// @notice Service providers registered in the data service\n mapping(address indexer => ISubgraphService.Indexer details) public indexers;\n\n ///@notice Multiplier for how many tokens back collected query fees\n uint256 public stakeToFeesRatio;\n\n /// @notice The cut curators take from query fee payments. In PPM.\n uint256 public curationFeesCut;\n\n /// @notice Destination of indexer payments\n mapping(address indexer => address destination) public paymentsDestination;\n}\n" + }, + "contracts/utilities/AllocationManager.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0-or-later\npragma solidity 0.8.27;\n\nimport { IGraphPayments } from \"@graphprotocol/horizon/contracts/interfaces/IGraphPayments.sol\";\nimport { IGraphToken } from \"@graphprotocol/contracts/contracts/token/IGraphToken.sol\";\nimport { IHorizonStakingTypes } from \"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingTypes.sol\";\n\nimport { GraphDirectory } from \"@graphprotocol/horizon/contracts/utilities/GraphDirectory.sol\";\nimport { AllocationManagerV1Storage } from \"./AllocationManagerStorage.sol\";\n\nimport { TokenUtils } from \"@graphprotocol/contracts/contracts/utils/TokenUtils.sol\";\nimport { ECDSA } from \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport { EIP712Upgradeable } from \"@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol\";\nimport { Allocation } from \"../libraries/Allocation.sol\";\nimport { LegacyAllocation } from \"../libraries/LegacyAllocation.sol\";\nimport { PPMMath } from \"@graphprotocol/horizon/contracts/libraries/PPMMath.sol\";\nimport { ProvisionTracker } from \"@graphprotocol/horizon/contracts/data-service/libraries/ProvisionTracker.sol\";\n\n/**\n * @title AllocationManager contract\n * @notice A helper contract implementing allocation lifecycle management.\n * Allows opening, resizing, and closing allocations, as well as collecting indexing rewards by presenting a Proof\n * of Indexing (POI).\n * @custom:security-contact Please email security+contracts@thegraph.com if you find any\n * bugs. We may have an active bug bounty program.\n */\nabstract contract AllocationManager is EIP712Upgradeable, GraphDirectory, AllocationManagerV1Storage {\n using ProvisionTracker for mapping(address => uint256);\n using Allocation for mapping(address => Allocation.State);\n using Allocation for Allocation.State;\n using LegacyAllocation for mapping(address => LegacyAllocation.State);\n using PPMMath for uint256;\n using TokenUtils for IGraphToken;\n\n ///@dev EIP712 typehash for allocation id proof\n bytes32 private constant EIP712_ALLOCATION_ID_PROOF_TYPEHASH =\n keccak256(\"AllocationIdProof(address indexer,address allocationId)\");\n\n /**\n * @notice Emitted when an indexer creates an allocation\n * @param indexer The address of the indexer\n * @param allocationId The id of the allocation\n * @param subgraphDeploymentId The id of the subgraph deployment\n * @param tokens The amount of tokens allocated\n * @param currentEpoch The current epoch\n */\n event AllocationCreated(\n address indexed indexer,\n address indexed allocationId,\n bytes32 indexed subgraphDeploymentId,\n uint256 tokens,\n uint256 currentEpoch\n );\n\n /**\n * @notice Emitted when an indexer collects indexing rewards for an allocation\n * @param indexer The address of the indexer\n * @param allocationId The id of the allocation\n * @param subgraphDeploymentId The id of the subgraph deployment\n * @param tokensRewards The amount of tokens collected\n * @param tokensIndexerRewards The amount of tokens collected for the indexer\n * @param tokensDelegationRewards The amount of tokens collected for delegators\n * @param poi The POI presented\n * @param currentEpoch The current epoch\n * @param poiMetadata The metadata associated with the POI\n */\n event IndexingRewardsCollected(\n address indexed indexer,\n address indexed allocationId,\n bytes32 indexed subgraphDeploymentId,\n uint256 tokensRewards,\n uint256 tokensIndexerRewards,\n uint256 tokensDelegationRewards,\n bytes32 poi,\n bytes poiMetadata,\n uint256 currentEpoch\n );\n\n /**\n * @notice Emitted when an indexer resizes an allocation\n * @param indexer The address of the indexer\n * @param allocationId The id of the allocation\n * @param subgraphDeploymentId The id of the subgraph deployment\n * @param newTokens The new amount of tokens allocated\n * @param oldTokens The old amount of tokens allocated\n */\n event AllocationResized(\n address indexed indexer,\n address indexed allocationId,\n bytes32 indexed subgraphDeploymentId,\n uint256 newTokens,\n uint256 oldTokens\n );\n\n /**\n * @dev Emitted when an indexer closes an allocation\n * @param indexer The address of the indexer\n * @param allocationId The id of the allocation\n * @param subgraphDeploymentId The id of the subgraph deployment\n * @param tokens The amount of tokens allocated\n * @param forceClosed Whether the allocation was force closed\n */\n event AllocationClosed(\n address indexed indexer,\n address indexed allocationId,\n bytes32 indexed subgraphDeploymentId,\n uint256 tokens,\n bool forceClosed\n );\n\n /**\n * @notice Emitted when a legacy allocation is migrated into the subgraph service\n * @param indexer The address of the indexer\n * @param allocationId The id of the allocation\n * @param subgraphDeploymentId The id of the subgraph deployment\n */\n event LegacyAllocationMigrated(\n address indexed indexer,\n address indexed allocationId,\n bytes32 indexed subgraphDeploymentId\n );\n\n /**\n * @notice Emitted when the maximum POI staleness is updated\n * @param maxPOIStaleness The max POI staleness in seconds\n */\n event MaxPOIStalenessSet(uint256 maxPOIStaleness);\n\n /**\n * @notice Thrown when an allocation proof is invalid\n * Both `signer` and `allocationId` should match for a valid proof.\n * @param signer The address that signed the proof\n * @param allocationId The id of the allocation\n */\n error AllocationManagerInvalidAllocationProof(address signer, address allocationId);\n\n /**\n * @notice Thrown when attempting to create an allocation with a zero allocation id\n */\n error AllocationManagerInvalidZeroAllocationId();\n\n /**\n * @notice Thrown when attempting to collect indexing rewards on a closed allocationl\n * @param allocationId The id of the allocation\n */\n error AllocationManagerAllocationClosed(address allocationId);\n\n /**\n * @notice Thrown when attempting to resize an allocation with the same size\n * @param allocationId The id of the allocation\n * @param tokens The amount of tokens\n */\n error AllocationManagerAllocationSameSize(address allocationId, uint256 tokens);\n\n /**\n * @notice Initializes the contract and parent contracts\n * @param _name The name to use for EIP712 domain separation\n * @param _version The version to use for EIP712 domain separation\n */\n function __AllocationManager_init(string memory _name, string memory _version) internal onlyInitializing {\n __EIP712_init(_name, _version);\n __AllocationManager_init_unchained();\n }\n\n /**\n * @notice Initializes the contract\n */\n function __AllocationManager_init_unchained() internal onlyInitializing {}\n\n /**\n * @notice Imports a legacy allocation id into the subgraph service\n * This is a governor only action that is required to prevent indexers from re-using allocation ids from the\n * legacy staking contract. It will revert with LegacyAllocationAlreadyMigrated if the allocation has already been migrated.\n * @param _indexer The address of the indexer\n * @param _allocationId The id of the allocation\n * @param _subgraphDeploymentId The id of the subgraph deployment\n */\n function _migrateLegacyAllocation(address _indexer, address _allocationId, bytes32 _subgraphDeploymentId) internal {\n _legacyAllocations.migrate(_indexer, _allocationId, _subgraphDeploymentId);\n emit LegacyAllocationMigrated(_indexer, _allocationId, _subgraphDeploymentId);\n }\n\n /**\n * @notice Create an allocation\n * @dev The `_allocationProof` is a 65-bytes Ethereum signed message of `keccak256(indexerAddress,allocationId)`\n *\n * Requirements:\n * - `_allocationId` must not be the zero address\n *\n * Emits a {AllocationCreated} event\n *\n * @param _indexer The address of the indexer\n * @param _allocationId The id of the allocation to be created\n * @param _subgraphDeploymentId The subgraph deployment Id\n * @param _tokens The amount of tokens to allocate\n * @param _allocationProof Signed proof of allocation id address ownership\n * @param _delegationRatio The delegation ratio to consider when locking tokens\n */\n function _allocate(\n address _indexer,\n address _allocationId,\n bytes32 _subgraphDeploymentId,\n uint256 _tokens,\n bytes memory _allocationProof,\n uint32 _delegationRatio\n ) internal {\n require(_allocationId != address(0), AllocationManagerInvalidZeroAllocationId());\n\n _verifyAllocationProof(_indexer, _allocationId, _allocationProof);\n\n // Ensure allocation id is not reused\n // need to check both subgraph service (on allocations.create()) and legacy allocations\n _legacyAllocations.revertIfExists(_graphStaking(), _allocationId);\n\n uint256 currentEpoch = _graphEpochManager().currentEpoch();\n Allocation.State memory allocation = _allocations.create(\n _indexer,\n _allocationId,\n _subgraphDeploymentId,\n _tokens,\n _graphRewardsManager().onSubgraphAllocationUpdate(_subgraphDeploymentId),\n currentEpoch\n );\n\n // Check that the indexer has enough tokens available\n // Note that the delegation ratio ensures overdelegation cannot be used\n allocationProvisionTracker.lock(_graphStaking(), _indexer, _tokens, _delegationRatio);\n\n // Update total allocated tokens for the subgraph deployment\n _subgraphAllocatedTokens[allocation.subgraphDeploymentId] =\n _subgraphAllocatedTokens[allocation.subgraphDeploymentId] +\n allocation.tokens;\n\n emit AllocationCreated(_indexer, _allocationId, _subgraphDeploymentId, allocation.tokens, currentEpoch);\n }\n\n /**\n * @notice Present a POI to collect indexing rewards for an allocation\n * This function will mint indexing rewards using the {RewardsManager} and distribute them to the indexer and delegators.\n *\n * Conditions to qualify for indexing rewards:\n * - POI must be non-zero\n * - POI must not be stale, i.e: older than `maxPOIStaleness`\n * - allocation must not be altruistic (allocated tokens = 0)\n * - allocation must be open for at least one epoch\n *\n * Note that indexers are required to periodically (at most every `maxPOIStaleness`) present POIs to collect rewards.\n * Rewards will not be issued to stale POIs, which means that indexers are advised to present a zero POI if they are\n * unable to present a valid one to prevent being locked out of future rewards.\n *\n * Note on allocation duration restriction: this is required to ensure that non protocol chains have a valid block number for\n * which to calculate POIs. EBO posts once per epoch typically at each epoch change, so we restrict rewards to allocations\n * that have gone through at least one epoch change.\n *\n * Emits a {IndexingRewardsCollected} event.\n *\n * @param _allocationId The id of the allocation to collect rewards for\n * @param _poi The POI being presented\n * @param _poiMetadata The metadata associated with the POI. The data and encoding format is for off-chain components to define, this function will only emit the value in an event as-is.\n * @param _delegationRatio The delegation ratio to consider when locking tokens\n * @param _paymentsDestination The address where indexing rewards should be sent\n * @return The amount of tokens collected\n */\n function _presentPOI(\n address _allocationId,\n bytes32 _poi,\n bytes memory _poiMetadata,\n uint32 _delegationRatio,\n address _paymentsDestination\n ) internal returns (uint256) {\n Allocation.State memory allocation = _allocations.get(_allocationId);\n require(allocation.isOpen(), AllocationManagerAllocationClosed(_allocationId));\n\n // Mint indexing rewards if all conditions are met\n uint256 tokensRewards = (!allocation.isStale(maxPOIStaleness) &&\n !allocation.isAltruistic() &&\n _poi != bytes32(0)) && _graphEpochManager().currentEpoch() > allocation.createdAtEpoch\n ? _graphRewardsManager().takeRewards(_allocationId)\n : 0;\n\n // ... but we still take a snapshot to ensure the rewards are not accumulated for the next valid POI\n _allocations.snapshotRewards(\n _allocationId,\n _graphRewardsManager().onSubgraphAllocationUpdate(allocation.subgraphDeploymentId)\n );\n _allocations.presentPOI(_allocationId);\n\n // Any pending rewards should have been collected now\n _allocations.clearPendingRewards(_allocationId);\n\n uint256 tokensIndexerRewards = 0;\n uint256 tokensDelegationRewards = 0;\n if (tokensRewards != 0) {\n // Distribute rewards to delegators\n uint256 delegatorCut = _graphStaking().getDelegationFeeCut(\n allocation.indexer,\n address(this),\n IGraphPayments.PaymentTypes.IndexingRewards\n );\n IHorizonStakingTypes.DelegationPool memory delegationPool = _graphStaking().getDelegationPool(\n allocation.indexer,\n address(this)\n );\n // If delegation pool has no shares then we don't need to distribute rewards to delegators\n tokensDelegationRewards = delegationPool.shares > 0 ? tokensRewards.mulPPM(delegatorCut) : 0;\n if (tokensDelegationRewards > 0) {\n _graphToken().approve(address(_graphStaking()), tokensDelegationRewards);\n _graphStaking().addToDelegationPool(allocation.indexer, address(this), tokensDelegationRewards);\n }\n\n // Distribute rewards to indexer\n tokensIndexerRewards = tokensRewards - tokensDelegationRewards;\n if (tokensIndexerRewards > 0) {\n if (_paymentsDestination == address(0)) {\n _graphToken().approve(address(_graphStaking()), tokensIndexerRewards);\n _graphStaking().stakeToProvision(allocation.indexer, address(this), tokensIndexerRewards);\n } else {\n _graphToken().pushTokens(_paymentsDestination, tokensIndexerRewards);\n }\n }\n }\n\n emit IndexingRewardsCollected(\n allocation.indexer,\n _allocationId,\n allocation.subgraphDeploymentId,\n tokensRewards,\n tokensIndexerRewards,\n tokensDelegationRewards,\n _poi,\n _poiMetadata,\n _graphEpochManager().currentEpoch()\n );\n\n // Check if the indexer is over-allocated and force close the allocation if necessary\n if (_isOverAllocated(allocation.indexer, _delegationRatio)) {\n _closeAllocation(_allocationId, true);\n }\n\n return tokensRewards;\n }\n\n /**\n * @notice Resize an allocation\n * @dev Will lock or release tokens in the provision tracker depending on the new allocation size.\n * Rewards accrued but not issued before the resize will be accounted for as pending rewards.\n * These will be paid out when the indexer presents a POI.\n *\n * Requirements:\n * - `_indexer` must be the owner of the allocation\n * - Allocation must be open\n * - `_tokens` must be different from the current allocation size\n *\n * Emits a {AllocationResized} event.\n *\n * @param _allocationId The id of the allocation to be resized\n * @param _tokens The new amount of tokens to allocate\n * @param _delegationRatio The delegation ratio to consider when locking tokens\n */\n function _resizeAllocation(address _allocationId, uint256 _tokens, uint32 _delegationRatio) internal {\n Allocation.State memory allocation = _allocations.get(_allocationId);\n require(allocation.isOpen(), AllocationManagerAllocationClosed(_allocationId));\n require(_tokens != allocation.tokens, AllocationManagerAllocationSameSize(_allocationId, _tokens));\n\n // Update provision tracker\n uint256 oldTokens = allocation.tokens;\n if (_tokens > oldTokens) {\n allocationProvisionTracker.lock(_graphStaking(), allocation.indexer, _tokens - oldTokens, _delegationRatio);\n } else {\n allocationProvisionTracker.release(allocation.indexer, oldTokens - _tokens);\n }\n\n // Calculate rewards that have been accrued since the last snapshot but not yet issued\n uint256 accRewardsPerAllocatedToken = _graphRewardsManager().onSubgraphAllocationUpdate(\n allocation.subgraphDeploymentId\n );\n uint256 accRewardsPerAllocatedTokenPending = !allocation.isAltruistic()\n ? accRewardsPerAllocatedToken - allocation.accRewardsPerAllocatedToken\n : 0;\n\n // Update the allocation\n _allocations[_allocationId].tokens = _tokens;\n _allocations[_allocationId].accRewardsPerAllocatedToken = accRewardsPerAllocatedToken;\n _allocations[_allocationId].accRewardsPending += _graphRewardsManager().calcRewards(\n oldTokens,\n accRewardsPerAllocatedTokenPending\n );\n\n // Update total allocated tokens for the subgraph deployment\n if (_tokens > oldTokens) {\n _subgraphAllocatedTokens[allocation.subgraphDeploymentId] += (_tokens - oldTokens);\n } else {\n _subgraphAllocatedTokens[allocation.subgraphDeploymentId] -= (oldTokens - _tokens);\n }\n\n emit AllocationResized(allocation.indexer, _allocationId, allocation.subgraphDeploymentId, _tokens, oldTokens);\n }\n\n /**\n * @notice Close an allocation\n * Does not require presenting a POI, use {_collectIndexingRewards} to present a POI and collect rewards\n * @dev Note that allocations are nowlong lived. All service payments, including indexing rewards, should be collected periodically\n * without the need of closing the allocation. Allocations should only be closed when indexers want to reclaim the allocated\n * tokens for other purposes.\n *\n * Emits a {AllocationClosed} event\n *\n * @param _allocationId The id of the allocation to be closed\n * @param _forceClosed Whether the allocation was force closed\n */\n function _closeAllocation(address _allocationId, bool _forceClosed) internal {\n Allocation.State memory allocation = _allocations.get(_allocationId);\n\n // Take rewards snapshot to prevent other allos from counting tokens from this allo\n _allocations.snapshotRewards(\n _allocationId,\n _graphRewardsManager().onSubgraphAllocationUpdate(allocation.subgraphDeploymentId)\n );\n\n _allocations.close(_allocationId);\n allocationProvisionTracker.release(allocation.indexer, allocation.tokens);\n\n // Update total allocated tokens for the subgraph deployment\n _subgraphAllocatedTokens[allocation.subgraphDeploymentId] =\n _subgraphAllocatedTokens[allocation.subgraphDeploymentId] -\n allocation.tokens;\n\n emit AllocationClosed(\n allocation.indexer,\n _allocationId,\n allocation.subgraphDeploymentId,\n allocation.tokens,\n _forceClosed\n );\n }\n\n /**\n * @notice Sets the maximum amount of time, in seconds, allowed between presenting POIs to qualify for indexing rewards\n * @dev Emits a {MaxPOIStalenessSet} event\n * @param _maxPOIStaleness The max POI staleness in seconds\n */\n function _setMaxPOIStaleness(uint256 _maxPOIStaleness) internal {\n maxPOIStaleness = _maxPOIStaleness;\n emit MaxPOIStalenessSet(_maxPOIStaleness);\n }\n\n /**\n * @notice Encodes the allocation proof for EIP712 signing\n * @param _indexer The address of the indexer\n * @param _allocationId The id of the allocation\n * @return The encoded allocation proof\n */\n function _encodeAllocationProof(address _indexer, address _allocationId) internal view returns (bytes32) {\n return _hashTypedDataV4(keccak256(abi.encode(EIP712_ALLOCATION_ID_PROOF_TYPEHASH, _indexer, _allocationId)));\n }\n\n /**\n * @notice Checks if an allocation is over-allocated\n * @param _indexer The address of the indexer\n * @param _delegationRatio The delegation ratio to consider when locking tokens\n * @return True if the allocation is over-allocated, false otherwise\n */\n function _isOverAllocated(address _indexer, uint32 _delegationRatio) internal view returns (bool) {\n return !allocationProvisionTracker.check(_graphStaking(), _indexer, _delegationRatio);\n }\n\n /**\n * @notice Verifies ownership of an allocation id by verifying an EIP712 allocation proof\n * @dev Requirements:\n * - Signer must be the allocation id address\n * @param _indexer The address of the indexer\n * @param _allocationId The id of the allocation\n * @param _proof The EIP712 proof, an EIP712 signed message of (indexer,allocationId)\n */\n function _verifyAllocationProof(address _indexer, address _allocationId, bytes memory _proof) private view {\n address signer = ECDSA.recover(_encodeAllocationProof(_indexer, _allocationId), _proof);\n require(signer == _allocationId, AllocationManagerInvalidAllocationProof(signer, _allocationId));\n }\n}\n" + }, + "contracts/utilities/AllocationManagerStorage.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0-or-later\npragma solidity 0.8.27;\n\nimport { Allocation } from \"../libraries/Allocation.sol\";\nimport { LegacyAllocation } from \"../libraries/LegacyAllocation.sol\";\n\n/**\n * @title AllocationManagerStorage\n * @notice This contract holds all the storage variables for the Allocation Manager contract.\n * @custom:security-contact Please email security+contracts@thegraph.com if you find any\n * bugs. We may have an active bug bounty program.\n */\nabstract contract AllocationManagerV1Storage {\n /// @notice Allocation details\n mapping(address allocationId => Allocation.State allocation) internal _allocations;\n\n /// @notice Legacy allocation details\n mapping(address allocationId => LegacyAllocation.State allocation) internal _legacyAllocations;\n\n /// @notice Tracks allocated tokens per indexer\n mapping(address indexer => uint256 tokens) public allocationProvisionTracker;\n\n /// @notice Maximum amount of time, in seconds, allowed between presenting POIs to qualify for indexing rewards\n uint256 public maxPOIStaleness;\n\n /// @notice Track total tokens allocated per subgraph deployment\n /// @dev Used to calculate indexing rewards\n mapping(bytes32 subgraphDeploymentId => uint256 tokens) internal _subgraphAllocatedTokens;\n\n /// @dev Gap to allow adding variables in future upgrades\n uint256[50] private __gap;\n}\n" + }, + "contracts/utilities/AttestationManager.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0-or-later\npragma solidity 0.8.27;\n\nimport { AttestationManagerV1Storage } from \"./AttestationManagerStorage.sol\";\n\nimport { ECDSA } from \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport { Initializable } from \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\nimport { Attestation } from \"../libraries/Attestation.sol\";\n\n/**\n * @title AttestationManager contract\n * @notice A helper contract implementing attestation verification.\n * Uses a custom implementation of EIP712 for backwards compatibility with attestations.\n * @custom:security-contact Please email security+contracts@thegraph.com if you find any\n * bugs. We may have an active bug bounty program.\n */\nabstract contract AttestationManager is Initializable, AttestationManagerV1Storage {\n /// @notice EIP712 type hash for Receipt struct\n bytes32 private constant RECEIPT_TYPE_HASH =\n keccak256(\"Receipt(bytes32 requestCID,bytes32 responseCID,bytes32 subgraphDeploymentID)\");\n\n /// @notice EIP712 domain type hash\n bytes32 private constant DOMAIN_TYPE_HASH =\n keccak256(\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract,bytes32 salt)\");\n\n /// @notice EIP712 domain name\n bytes32 private constant DOMAIN_NAME_HASH = keccak256(\"Graph Protocol\");\n\n /// @notice EIP712 domain version\n bytes32 private constant DOMAIN_VERSION_HASH = keccak256(\"0\");\n\n /// @notice EIP712 domain salt\n bytes32 private constant DOMAIN_SALT = 0xa070ffb1cd7409649bf77822cce74495468e06dbfaef09556838bf188679b9c2;\n\n /**\n * @dev Initialize the AttestationManager contract and parent contracts\n */\n // solhint-disable-next-line func-name-mixedcase\n function __AttestationManager_init() internal onlyInitializing {\n __AttestationManager_init_unchained();\n }\n\n /**\n * @dev Initialize the AttestationManager contract\n */\n // solhint-disable-next-line func-name-mixedcase\n function __AttestationManager_init_unchained() internal onlyInitializing {\n _domainSeparator = keccak256(\n abi.encode(\n DOMAIN_TYPE_HASH,\n DOMAIN_NAME_HASH,\n DOMAIN_VERSION_HASH,\n block.chainid,\n address(this),\n DOMAIN_SALT\n )\n );\n }\n\n /**\n * @dev Recover the signer address of the `_attestation`.\n * @param _attestation The attestation struct\n * @return Signer address\n */\n function _recoverSigner(Attestation.State memory _attestation) internal view returns (address) {\n // Obtain the hash of the fully-encoded message, per EIP-712 encoding\n Attestation.Receipt memory receipt = Attestation.Receipt(\n _attestation.requestCID,\n _attestation.responseCID,\n _attestation.subgraphDeploymentId\n );\n bytes32 messageHash = _encodeReceipt(receipt);\n\n // Obtain the signer of the fully-encoded EIP-712 message hash\n // NOTE: The signer of the attestation is the indexer that served the request\n return ECDSA.recover(messageHash, abi.encodePacked(_attestation.r, _attestation.s, _attestation.v));\n }\n\n /**\n * @dev Get the message hash that a indexer used to sign the receipt.\n * Encodes a receipt using a domain separator, as described on\n * https://github.com/ethereum/EIPs/blob/master/EIPS/eip-712.md#specification.\n * @notice Return the message hash used to sign the receipt\n * @param _receipt Receipt returned by indexer and submitted by fisherman\n * @return Message hash used to sign the receipt\n */\n function _encodeReceipt(Attestation.Receipt memory _receipt) internal view returns (bytes32) {\n return\n keccak256(\n abi.encodePacked(\n \"\\x19\\x01\", // EIP-191 encoding pad, EIP-712 version 1\n _domainSeparator,\n keccak256(\n abi.encode(\n RECEIPT_TYPE_HASH,\n _receipt.requestCID,\n _receipt.responseCID,\n _receipt.subgraphDeploymentId\n ) // EIP 712-encoded message hash\n )\n )\n );\n }\n}\n" + }, + "contracts/utilities/AttestationManagerStorage.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0-or-later\npragma solidity 0.8.27;\n\n/**\n * @title AttestationManagerStorage\n * @notice This contract holds all the storage variables for the Attestation Manager contract.\n * @custom:security-contact Please email security+contracts@thegraph.com if you find any\n * bugs. We may have an active bug bounty program.\n */\nabstract contract AttestationManagerV1Storage {\n /// @dev EIP712 domain separator\n bytes32 internal _domainSeparator;\n\n /// @dev Gap to allow adding variables in future upgrades\n uint256[50] private __gap;\n}\n" + }, + "contracts/utilities/Directory.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0-or-later\npragma solidity 0.8.27;\n\nimport { IDisputeManager } from \"../interfaces/IDisputeManager.sol\";\nimport { ISubgraphService } from \"../interfaces/ISubgraphService.sol\";\nimport { IGraphTallyCollector } from \"@graphprotocol/horizon/contracts/interfaces/IGraphTallyCollector.sol\";\nimport { ICuration } from \"@graphprotocol/contracts/contracts/curation/ICuration.sol\";\n\n/**\n * @title Directory contract\n * @notice This contract is meant to be inherited by {SubgraphService} contract.\n * It contains the addresses of the contracts that the contract interacts with.\n * Uses immutable variables to minimize gas costs.\n * @custom:security-contact Please email security+contracts@thegraph.com if you find any\n * bugs. We may have an active bug bounty program.\n */\nabstract contract Directory {\n /// @notice The Subgraph Service contract address\n ISubgraphService private immutable SUBGRAPH_SERVICE;\n\n /// @notice The Dispute Manager contract address\n IDisputeManager private immutable DISPUTE_MANAGER;\n\n /// @notice The Graph Tally Collector contract address\n /// @dev Required to collect payments via Graph Horizon payments protocol\n IGraphTallyCollector private immutable GRAPH_TALLY_COLLECTOR;\n\n /// @notice The Curation contract address\n /// @dev Required for curation fees distribution\n ICuration private immutable CURATION;\n\n /**\n * @notice Emitted when the Directory is initialized\n * @param subgraphService The Subgraph Service contract address\n * @param disputeManager The Dispute Manager contract address\n * @param graphTallyCollector The Graph Tally Collector contract address\n * @param curation The Curation contract address\n */\n event SubgraphServiceDirectoryInitialized(\n address subgraphService,\n address disputeManager,\n address graphTallyCollector,\n address curation\n );\n\n /**\n * @notice Thrown when the caller is not the Dispute Manager\n * @param caller The caller address\n * @param disputeManager The Dispute Manager address\n */\n error DirectoryNotDisputeManager(address caller, address disputeManager);\n\n /**\n * @notice Checks that the caller is the Dispute Manager\n */\n modifier onlyDisputeManager() {\n require(\n msg.sender == address(DISPUTE_MANAGER),\n DirectoryNotDisputeManager(msg.sender, address(DISPUTE_MANAGER))\n );\n _;\n }\n\n /**\n * @notice Constructor for the Directory contract\n * @param subgraphService The Subgraph Service contract address\n * @param disputeManager The Dispute Manager contract address\n * @param graphTallyCollector The Graph Tally Collector contract address\n * @param curation The Curation contract address\n */\n constructor(address subgraphService, address disputeManager, address graphTallyCollector, address curation) {\n SUBGRAPH_SERVICE = ISubgraphService(subgraphService);\n DISPUTE_MANAGER = IDisputeManager(disputeManager);\n GRAPH_TALLY_COLLECTOR = IGraphTallyCollector(graphTallyCollector);\n CURATION = ICuration(curation);\n\n emit SubgraphServiceDirectoryInitialized(subgraphService, disputeManager, graphTallyCollector, curation);\n }\n\n /**\n * @notice Returns the Subgraph Service contract address\n * @return The Subgraph Service contract\n */\n function _subgraphService() internal view returns (ISubgraphService) {\n return SUBGRAPH_SERVICE;\n }\n\n /**\n * @notice Returns the Dispute Manager contract address\n * @return The Dispute Manager contract\n */\n function _disputeManager() internal view returns (IDisputeManager) {\n return DISPUTE_MANAGER;\n }\n\n /**\n * @notice Returns the Graph Tally Collector contract address\n * @return The Graph Tally Collector contract\n */\n function _graphTallyCollector() internal view returns (IGraphTallyCollector) {\n return GRAPH_TALLY_COLLECTOR;\n }\n\n /**\n * @notice Returns the Curation contract address\n * @return The Curation contract\n */\n function _curation() internal view returns (ICuration) {\n return CURATION;\n }\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 10 + }, + "evmVersion": "paris", + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata" + ], + "": [ + "ast" + ] + } + } + } + }, + "output": { + "sources": { + "@graphprotocol/contracts/contracts/arbitrum/ITokenGateway.sol": { + "ast": { + "absolutePath": "@graphprotocol/contracts/contracts/arbitrum/ITokenGateway.sol", + "exportedSymbols": { + "ITokenGateway": [ + 41 + ] + }, + "id": 42, + "license": "Apache-2.0", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 1, + "literals": [ + "solidity", + "^", + "0.7", + ".6", + "||", + "0.8", + ".27" + ], + "nodeType": "PragmaDirective", + "src": "913:33:0" + }, + { + "abstract": false, + "baseContracts": [], + "canonicalName": "ITokenGateway", + "contractDependencies": [], + "contractKind": "interface", + "fullyImplemented": false, + "id": 41, + "linearizedBaseContracts": [ + 41 + ], + "name": "ITokenGateway", + "nameLocation": "958:13:0", + "nodeType": "ContractDefinition", + "nodes": [ + { + "documentation": { + "id": 2, + "nodeType": "StructuredDocumentation", + "src": "1298:81:0", + "text": "@notice event deprecated in favor of DepositFinalized and WithdrawalFinalized" + }, + "functionSelector": "d2ce7d65", + "id": 19, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "outboundTransfer", + "nameLocation": "1626:16:0", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 15, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 4, + "mutability": "mutable", + "name": "token", + "nameLocation": "1660:5:0", + "nodeType": "VariableDeclaration", + "scope": 19, + "src": "1652:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1652:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 6, + "mutability": "mutable", + "name": "to", + "nameLocation": "1683:2:0", + "nodeType": "VariableDeclaration", + "scope": 19, + "src": "1675:10:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 5, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1675:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 8, + "mutability": "mutable", + "name": "amunt", + "nameLocation": "1703:5:0", + "nodeType": "VariableDeclaration", + "scope": 19, + "src": "1695:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 7, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1695:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 10, + "mutability": "mutable", + "name": "maxas", + "nameLocation": "1726:5:0", + "nodeType": "VariableDeclaration", + "scope": 19, + "src": "1718:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 9, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1718:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 12, + "mutability": "mutable", + "name": "gasPiceBid", + "nameLocation": "1749:10:0", + "nodeType": "VariableDeclaration", + "scope": 19, + "src": "1741:18:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 11, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1741:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 14, + "mutability": "mutable", + "name": "data", + "nameLocation": "1784:4:0", + "nodeType": "VariableDeclaration", + "scope": 19, + "src": "1769:19:0", + "stateVariable": false, + "storageLocation": "calldata", + "typeDescriptions": { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 13, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "1769:5:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "src": "1642:152:0" + }, + "returnParameters": { + "id": 18, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 17, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 19, + "src": "1821:12:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 16, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "1821:5:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "src": "1820:14:0" + }, + "scope": 41, + "src": "1617:218:0", + "stateMutability": "payable", + "virtual": false, + "visibility": "external" + }, + { + "functionSelector": "2e567b36", + "id": 32, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "finalizeInboundTransfer", + "nameLocation": "1850:23:0", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 30, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 21, + "mutability": "mutable", + "name": "token", + "nameLocation": "1891:5:0", + "nodeType": "VariableDeclaration", + "scope": 32, + "src": "1883:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 20, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1883:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 23, + "mutability": "mutable", + "name": "from", + "nameLocation": "1914:4:0", + "nodeType": "VariableDeclaration", + "scope": 32, + "src": "1906:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 22, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1906:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 25, + "mutability": "mutable", + "name": "to", + "nameLocation": "1936:2:0", + "nodeType": "VariableDeclaration", + "scope": 32, + "src": "1928:10:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 24, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1928:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 27, + "mutability": "mutable", + "name": "amount", + "nameLocation": "1956:6:0", + "nodeType": "VariableDeclaration", + "scope": 32, + "src": "1948:14:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 26, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1948:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 29, + "mutability": "mutable", + "name": "data", + "nameLocation": "1987:4:0", + "nodeType": "VariableDeclaration", + "scope": 32, + "src": "1972:19:0", + "stateVariable": false, + "storageLocation": "calldata", + "typeDescriptions": { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 28, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "1972:5:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "src": "1873:124:0" + }, + "returnParameters": { + "id": 31, + "nodeType": "ParameterList", + "parameters": [], + "src": "2014:0:0" + }, + "scope": 41, + "src": "1841:174:0", + "stateMutability": "payable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 33, + "nodeType": "StructuredDocumentation", + "src": "2021:354:0", + "text": " @notice Calculate the address used when bridging an ERC20 token\n @dev the L1 and L2 address oracles may not always be in sync.\n For example, a custom token may have been registered but not deployed or the contract self destructed.\n @param l1ERC20 address of L1 token\n @return L2 address of a bridged ERC20 token" + }, + "functionSelector": "a7e28d48", + "id": 40, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "calculateL2TokenAddress", + "nameLocation": "2389:23:0", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 36, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 35, + "mutability": "mutable", + "name": "l1ERC20", + "nameLocation": "2421:7:0", + "nodeType": "VariableDeclaration", + "scope": 40, + "src": "2413:15:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 34, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2413:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "2412:17:0" + }, + "returnParameters": { + "id": 39, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 38, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 40, + "src": "2453:7:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 37, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2453:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "2452:9:0" + }, + "scope": 41, + "src": "2380:82:0", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + } + ], + "scope": 42, + "src": "948:1516:0", + "usedErrors": [], + "usedEvents": [] + } + ], + "src": "913:1552:0" + }, + "id": 0 + }, + "@graphprotocol/contracts/contracts/curation/ICuration.sol": { + "ast": { + "absolutePath": "@graphprotocol/contracts/contracts/curation/ICuration.sol", + "exportedSymbols": { + "ICuration": [ + 165 + ] + }, + "id": 166, + "license": "GPL-2.0-or-later", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 43, + "literals": [ + "solidity", + "^", + "0.7", + ".6", + "||", + "0.8", + ".27" + ], + "nodeType": "PragmaDirective", + "src": "46:33:1" + }, + { + "abstract": false, + "baseContracts": [], + "canonicalName": "ICuration", + "contractDependencies": [], + "contractKind": "interface", + "documentation": { + "id": 44, + "nodeType": "StructuredDocumentation", + "src": "81:101:1", + "text": " @title Curation Interface\n @dev Interface for the Curation contract (and L2Curation too)" + }, + "fullyImplemented": false, + "id": 165, + "linearizedBaseContracts": [ + 165 + ], + "name": "ICuration", + "nameLocation": "193:9:1", + "nodeType": "ContractDefinition", + "nodes": [ + { + "documentation": { + "id": 45, + "nodeType": "StructuredDocumentation", + "src": "237:143:1", + "text": " @notice Update the default reserve ratio to `_defaultReserveRatio`\n @param _defaultReserveRatio Reserve ratio (in PPM)" + }, + "functionSelector": "cd0ad4a2", + "id": 50, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "setDefaultReserveRatio", + "nameLocation": "394:22:1", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 48, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 47, + "mutability": "mutable", + "name": "_defaultReserveRatio", + "nameLocation": "424:20:1", + "nodeType": "VariableDeclaration", + "scope": 50, + "src": "417:27:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 46, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "417:6:1", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + } + ], + "src": "416:29:1" + }, + "returnParameters": { + "id": 49, + "nodeType": "ParameterList", + "parameters": [], + "src": "454:0:1" + }, + "scope": 165, + "src": "385:70:1", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 51, + "nodeType": "StructuredDocumentation", + "src": "461:175:1", + "text": " @notice Update the minimum deposit amount needed to intialize a new subgraph\n @param _minimumCurationDeposit Minimum amount of tokens required deposit" + }, + "functionSelector": "6536fe32", + "id": 56, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "setMinimumCurationDeposit", + "nameLocation": "650:25:1", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 54, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 53, + "mutability": "mutable", + "name": "_minimumCurationDeposit", + "nameLocation": "684:23:1", + "nodeType": "VariableDeclaration", + "scope": 56, + "src": "676:31:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 52, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "676:7:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "675:33:1" + }, + "returnParameters": { + "id": 55, + "nodeType": "ParameterList", + "parameters": [], + "src": "717:0:1" + }, + "scope": 165, + "src": "641:77:1", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 57, + "nodeType": "StructuredDocumentation", + "src": "724:189:1", + "text": " @notice Set the curation tax percentage to charge when a curator deposits GRT tokens.\n @param _percentage Curation tax percentage charged when depositing GRT tokens" + }, + "functionSelector": "cd18119e", + "id": 62, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "setCurationTaxPercentage", + "nameLocation": "927:24:1", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 60, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 59, + "mutability": "mutable", + "name": "_percentage", + "nameLocation": "959:11:1", + "nodeType": "VariableDeclaration", + "scope": 62, + "src": "952:18:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 58, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "952:6:1", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + } + ], + "src": "951:20:1" + }, + "returnParameters": { + "id": 61, + "nodeType": "ParameterList", + "parameters": [], + "src": "980:0:1" + }, + "scope": 165, + "src": "918:63:1", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 63, + "nodeType": "StructuredDocumentation", + "src": "987:184:1", + "text": " @notice Set the master copy to use as clones for the curation token.\n @param _curationTokenMaster Address of implementation contract to use for curation tokens" + }, + "functionSelector": "9b4d9f33", + "id": 68, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "setCurationTokenMaster", + "nameLocation": "1185:22:1", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 66, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 65, + "mutability": "mutable", + "name": "_curationTokenMaster", + "nameLocation": "1216:20:1", + "nodeType": "VariableDeclaration", + "scope": 68, + "src": "1208:28:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 64, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1208:7:1", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "1207:30:1" + }, + "returnParameters": { + "id": 67, + "nodeType": "ParameterList", + "parameters": [], + "src": "1246:0:1" + }, + "scope": 165, + "src": "1176:71:1", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 69, + "nodeType": "StructuredDocumentation", + "src": "1276:411:1", + "text": " @notice Deposit Graph Tokens in exchange for signal of a SubgraphDeployment curation pool.\n @param _subgraphDeploymentID Subgraph deployment pool from where to mint signal\n @param _tokensIn Amount of Graph Tokens to deposit\n @param _signalOutMin Expected minimum amount of signal to receive\n @return Amount of signal minted\n @return Amount of curation tax burned" + }, + "functionSelector": "375a54ab", + "id": 82, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "mint", + "nameLocation": "1701:4:1", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 76, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 71, + "mutability": "mutable", + "name": "_subgraphDeploymentID", + "nameLocation": "1723:21:1", + "nodeType": "VariableDeclaration", + "scope": 82, + "src": "1715:29:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 70, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1715:7:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 73, + "mutability": "mutable", + "name": "_tokensIn", + "nameLocation": "1762:9:1", + "nodeType": "VariableDeclaration", + "scope": 82, + "src": "1754:17:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 72, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1754:7:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 75, + "mutability": "mutable", + "name": "_signalOutMin", + "nameLocation": "1789:13:1", + "nodeType": "VariableDeclaration", + "scope": 82, + "src": "1781:21:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 74, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1781:7:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "1705:103:1" + }, + "returnParameters": { + "id": 81, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 78, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 82, + "src": "1827:7:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 77, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1827:7:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 80, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 82, + "src": "1836:7:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 79, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1836:7:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "1826:18:1" + }, + "scope": 165, + "src": "1692:153:1", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 83, + "nodeType": "StructuredDocumentation", + "src": "1851:323:1", + "text": " @notice Burn _signal from the SubgraphDeployment curation pool\n @param _subgraphDeploymentID SubgraphDeployment the curator is returning signal\n @param _signalIn Amount of signal to return\n @param _tokensOutMin Expected minimum amount of tokens to receive\n @return Tokens returned" + }, + "functionSelector": "24bdeec7", + "id": 94, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "burn", + "nameLocation": "2188:4:1", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 90, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 85, + "mutability": "mutable", + "name": "_subgraphDeploymentID", + "nameLocation": "2201:21:1", + "nodeType": "VariableDeclaration", + "scope": 94, + "src": "2193:29:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 84, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "2193:7:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 87, + "mutability": "mutable", + "name": "_signalIn", + "nameLocation": "2232:9:1", + "nodeType": "VariableDeclaration", + "scope": 94, + "src": "2224:17:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 86, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2224:7:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 89, + "mutability": "mutable", + "name": "_tokensOutMin", + "nameLocation": "2251:13:1", + "nodeType": "VariableDeclaration", + "scope": 94, + "src": "2243:21:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 88, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2243:7:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "2192:73:1" + }, + "returnParameters": { + "id": 93, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 92, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 94, + "src": "2284:7:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 91, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2284:7:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "2283:9:1" + }, + "scope": 165, + "src": "2179:114:1", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 95, + "nodeType": "StructuredDocumentation", + "src": "2299:266:1", + "text": " @notice Assign Graph Tokens collected as curation fees to the curation pool reserve.\n @param _subgraphDeploymentID SubgraphDeployment where funds should be allocated as reserves\n @param _tokens Amount of Graph Tokens to add to reserves" + }, + "functionSelector": "81573288", + "id": 102, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "collect", + "nameLocation": "2579:7:1", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 100, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 97, + "mutability": "mutable", + "name": "_subgraphDeploymentID", + "nameLocation": "2595:21:1", + "nodeType": "VariableDeclaration", + "scope": 102, + "src": "2587:29:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 96, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "2587:7:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 99, + "mutability": "mutable", + "name": "_tokens", + "nameLocation": "2626:7:1", + "nodeType": "VariableDeclaration", + "scope": 102, + "src": "2618:15:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 98, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2618:7:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "2586:48:1" + }, + "returnParameters": { + "id": 101, + "nodeType": "ParameterList", + "parameters": [], + "src": "2643:0:1" + }, + "scope": 165, + "src": "2570:74:1", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 103, + "nodeType": "StructuredDocumentation", + "src": "2672:213:1", + "text": " @notice Check if any GRT tokens are deposited for a SubgraphDeployment.\n @param _subgraphDeploymentID SubgraphDeployment to check if curated\n @return True if curated, false otherwise" + }, + "functionSelector": "4c4ea0ed", + "id": 110, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "isCurated", + "nameLocation": "2899:9:1", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 106, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 105, + "mutability": "mutable", + "name": "_subgraphDeploymentID", + "nameLocation": "2917:21:1", + "nodeType": "VariableDeclaration", + "scope": 110, + "src": "2909:29:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 104, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "2909:7:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "2908:31:1" + }, + "returnParameters": { + "id": 109, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 108, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 110, + "src": "2963:4:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 107, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "2963:4:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "src": "2962:6:1" + }, + "scope": 165, + "src": "2890:79:1", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 111, + "nodeType": "StructuredDocumentation", + "src": "2975:290:1", + "text": " @notice Get the amount of signal a curator has in a curation pool.\n @param _curator Curator owning the signal tokens\n @param _subgraphDeploymentID Subgraph deployment curation pool\n @return Amount of signal owned by a curator for the subgraph deployment" + }, + "functionSelector": "9f94c667", + "id": 120, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "getCuratorSignal", + "nameLocation": "3279:16:1", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 116, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 113, + "mutability": "mutable", + "name": "_curator", + "nameLocation": "3304:8:1", + "nodeType": "VariableDeclaration", + "scope": 120, + "src": "3296:16:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 112, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3296:7:1", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 115, + "mutability": "mutable", + "name": "_subgraphDeploymentID", + "nameLocation": "3322:21:1", + "nodeType": "VariableDeclaration", + "scope": 120, + "src": "3314:29:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 114, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "3314:7:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "3295:49:1" + }, + "returnParameters": { + "id": 119, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 118, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 120, + "src": "3368:7:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 117, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "3368:7:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "3367:9:1" + }, + "scope": 165, + "src": "3270:107:1", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 121, + "nodeType": "StructuredDocumentation", + "src": "3383:208:1", + "text": " @notice Get the amount of signal in a curation pool.\n @param _subgraphDeploymentID Subgraph deployment curation pool\n @return Amount of signal minted for the subgraph deployment" + }, + "functionSelector": "99439fee", + "id": 128, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "getCurationPoolSignal", + "nameLocation": "3605:21:1", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 124, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 123, + "mutability": "mutable", + "name": "_subgraphDeploymentID", + "nameLocation": "3635:21:1", + "nodeType": "VariableDeclaration", + "scope": 128, + "src": "3627:29:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 122, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "3627:7:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "3626:31:1" + }, + "returnParameters": { + "id": 127, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 126, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 128, + "src": "3681:7:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 125, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "3681:7:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "3680:9:1" + }, + "scope": 165, + "src": "3596:94:1", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 129, + "nodeType": "StructuredDocumentation", + "src": "3696:210:1", + "text": " @notice Get the amount of token reserves in a curation pool.\n @param _subgraphDeploymentID Subgraph deployment curation pool\n @return Amount of token reserves in the curation pool" + }, + "functionSelector": "46e855da", + "id": 136, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "getCurationPoolTokens", + "nameLocation": "3920:21:1", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 132, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 131, + "mutability": "mutable", + "name": "_subgraphDeploymentID", + "nameLocation": "3950:21:1", + "nodeType": "VariableDeclaration", + "scope": 136, + "src": "3942:29:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 130, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "3942:7:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "3941:31:1" + }, + "returnParameters": { + "id": 135, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 134, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 136, + "src": "3996:7:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 133, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "3996:7:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "3995:9:1" + }, + "scope": 165, + "src": "3911:94:1", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 137, + "nodeType": "StructuredDocumentation", + "src": "4011:416:1", + "text": " @notice Calculate amount of signal that can be bought with tokens in a curation pool.\n This function considers and excludes the deposit tax.\n @param _subgraphDeploymentID Subgraph deployment to mint signal\n @param _tokensIn Amount of tokens used to mint signal\n @return Amount of signal that can be bought\n @return Amount of tokens that will be burned as curation tax" + }, + "functionSelector": "f049b900", + "id": 148, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "tokensToSignal", + "nameLocation": "4441:14:1", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 142, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 139, + "mutability": "mutable", + "name": "_subgraphDeploymentID", + "nameLocation": "4464:21:1", + "nodeType": "VariableDeclaration", + "scope": 148, + "src": "4456:29:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 138, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "4456:7:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 141, + "mutability": "mutable", + "name": "_tokensIn", + "nameLocation": "4495:9:1", + "nodeType": "VariableDeclaration", + "scope": 148, + "src": "4487:17:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 140, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "4487:7:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "4455:50:1" + }, + "returnParameters": { + "id": 147, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 144, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 148, + "src": "4529:7:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 143, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "4529:7:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 146, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 148, + "src": "4538:7:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 145, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "4538:7:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "4528:18:1" + }, + "scope": 165, + "src": "4432:115:1", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 149, + "nodeType": "StructuredDocumentation", + "src": "4553:296:1", + "text": " @notice Calculate number of tokens to get when burning signal from a curation pool.\n @param _subgraphDeploymentID Subgraph deployment to burn signal\n @param _signalIn Amount of signal to burn\n @return Amount of tokens to get for the specified amount of signal" + }, + "functionSelector": "0faaf87f", + "id": 158, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "signalToTokens", + "nameLocation": "4863:14:1", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 154, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 151, + "mutability": "mutable", + "name": "_subgraphDeploymentID", + "nameLocation": "4886:21:1", + "nodeType": "VariableDeclaration", + "scope": 158, + "src": "4878:29:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 150, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "4878:7:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 153, + "mutability": "mutable", + "name": "_signalIn", + "nameLocation": "4917:9:1", + "nodeType": "VariableDeclaration", + "scope": 158, + "src": "4909:17:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 152, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "4909:7:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "4877:50:1" + }, + "returnParameters": { + "id": 157, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 156, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 158, + "src": "4951:7:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 155, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "4951:7:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "4950:9:1" + }, + "scope": 165, + "src": "4854:106:1", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 159, + "nodeType": "StructuredDocumentation", + "src": "4966:199:1", + "text": " @notice Tax charged when curators deposit funds.\n Parts per million. (Allows for 4 decimal points, 999,999 = 99.9999%)\n @return Curation tax percentage expressed in PPM" + }, + "functionSelector": "f115c427", + "id": 164, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "curationTaxPercentage", + "nameLocation": "5179:21:1", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 160, + "nodeType": "ParameterList", + "parameters": [], + "src": "5200:2:1" + }, + "returnParameters": { + "id": 163, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 162, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 164, + "src": "5226:6:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 161, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "5226:6:1", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + } + ], + "src": "5225:8:1" + }, + "scope": 165, + "src": "5170:64:1", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + } + ], + "scope": 166, + "src": "183:5053:1", + "usedErrors": [], + "usedEvents": [] + } + ], + "src": "46:5191:1" + }, + "id": 1 + }, + "@graphprotocol/contracts/contracts/disputes/IDisputeManager.sol": { + "ast": { + "absolutePath": "@graphprotocol/contracts/contracts/disputes/IDisputeManager.sol", + "exportedSymbols": { + "IDisputeManager": [ + 314 + ] + }, + "id": 315, + "license": "GPL-2.0-or-later", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 167, + "literals": [ + "solidity", + ">=", + "0.6", + ".12", + "<", + "0.8", + ".0", + "||", + "0.8", + ".27" + ], + "nodeType": "PragmaDirective", + "src": "46:42:2" + }, + { + "id": 168, + "literals": [ + "abicoder", + "v2" + ], + "nodeType": "PragmaDirective", + "src": "89:19:2" + }, + { + "abstract": false, + "baseContracts": [], + "canonicalName": "IDisputeManager", + "contractDependencies": [], + "contractKind": "interface", + "fullyImplemented": false, + "id": 314, + "linearizedBaseContracts": [ + 314 + ], + "name": "IDisputeManager", + "nameLocation": "120:15:2", + "nodeType": "ContractDefinition", + "nodes": [ + { + "canonicalName": "IDisputeManager.DisputeType", + "id": 172, + "members": [ + { + "id": 169, + "name": "Null", + "nameLocation": "191:4:2", + "nodeType": "EnumValue", + "src": "191:4:2" + }, + { + "id": 170, + "name": "IndexingDispute", + "nameLocation": "205:15:2", + "nodeType": "EnumValue", + "src": "205:15:2" + }, + { + "id": 171, + "name": "QueryDispute", + "nameLocation": "230:12:2", + "nodeType": "EnumValue", + "src": "230:12:2" + } + ], + "name": "DisputeType", + "nameLocation": "169:11:2", + "nodeType": "EnumDefinition", + "src": "164:84:2" + }, + { + "canonicalName": "IDisputeManager.DisputeStatus", + "id": 178, + "members": [ + { + "id": 173, + "name": "Null", + "nameLocation": "283:4:2", + "nodeType": "EnumValue", + "src": "283:4:2" + }, + { + "id": 174, + "name": "Accepted", + "nameLocation": "297:8:2", + "nodeType": "EnumValue", + "src": "297:8:2" + }, + { + "id": 175, + "name": "Rejected", + "nameLocation": "315:8:2", + "nodeType": "EnumValue", + "src": "315:8:2" + }, + { + "id": 176, + "name": "Drawn", + "nameLocation": "333:5:2", + "nodeType": "EnumValue", + "src": "333:5:2" + }, + { + "id": 177, + "name": "Pending", + "nameLocation": "348:7:2", + "nodeType": "EnumValue", + "src": "348:7:2" + } + ], + "name": "DisputeStatus", + "nameLocation": "259:13:2", + "nodeType": "EnumDefinition", + "src": "254:107:2" + }, + { + "canonicalName": "IDisputeManager.Dispute", + "id": 193, + "members": [ + { + "constant": false, + "id": 180, + "mutability": "mutable", + "name": "indexer", + "nameLocation": "480:7:2", + "nodeType": "VariableDeclaration", + "scope": 193, + "src": "472:15:2", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 179, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "472:7:2", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 182, + "mutability": "mutable", + "name": "fisherman", + "nameLocation": "505:9:2", + "nodeType": "VariableDeclaration", + "scope": 193, + "src": "497:17:2", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 181, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "497:7:2", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 184, + "mutability": "mutable", + "name": "deposit", + "nameLocation": "532:7:2", + "nodeType": "VariableDeclaration", + "scope": 193, + "src": "524:15:2", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 183, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "524:7:2", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 186, + "mutability": "mutable", + "name": "relatedDisputeID", + "nameLocation": "557:16:2", + "nodeType": "VariableDeclaration", + "scope": 193, + "src": "549:24:2", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 185, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "549:7:2", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 189, + "mutability": "mutable", + "name": "disputeType", + "nameLocation": "595:11:2", + "nodeType": "VariableDeclaration", + "scope": 193, + "src": "583:23:2", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_DisputeType_$172", + "typeString": "enum IDisputeManager.DisputeType" + }, + "typeName": { + "id": 188, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 187, + "name": "DisputeType", + "nameLocations": [ + "583:11:2" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 172, + "src": "583:11:2" + }, + "referencedDeclaration": 172, + "src": "583:11:2", + "typeDescriptions": { + "typeIdentifier": "t_enum$_DisputeType_$172", + "typeString": "enum IDisputeManager.DisputeType" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 192, + "mutability": "mutable", + "name": "status", + "nameLocation": "630:6:2", + "nodeType": "VariableDeclaration", + "scope": 193, + "src": "616:20:2", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_DisputeStatus_$178", + "typeString": "enum IDisputeManager.DisputeStatus" + }, + "typeName": { + "id": 191, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 190, + "name": "DisputeStatus", + "nameLocations": [ + "616:13:2" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 178, + "src": "616:13:2" + }, + "referencedDeclaration": 178, + "src": "616:13:2", + "typeDescriptions": { + "typeIdentifier": "t_enum$_DisputeStatus_$178", + "typeString": "enum IDisputeManager.DisputeStatus" + } + }, + "visibility": "internal" + } + ], + "name": "Dispute", + "nameLocation": "454:7:2", + "nodeType": "StructDefinition", + "scope": 314, + "src": "447:196:2", + "visibility": "public" + }, + { + "canonicalName": "IDisputeManager.Receipt", + "id": 200, + "members": [ + { + "constant": false, + "id": 195, + "mutability": "mutable", + "name": "requestCID", + "nameLocation": "772:10:2", + "nodeType": "VariableDeclaration", + "scope": 200, + "src": "764:18:2", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 194, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "764:7:2", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 197, + "mutability": "mutable", + "name": "responseCID", + "nameLocation": "800:11:2", + "nodeType": "VariableDeclaration", + "scope": 200, + "src": "792:19:2", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 196, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "792:7:2", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 199, + "mutability": "mutable", + "name": "subgraphDeploymentID", + "nameLocation": "829:20:2", + "nodeType": "VariableDeclaration", + "scope": 200, + "src": "821:28:2", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 198, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "821:7:2", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "name": "Receipt", + "nameLocation": "746:7:2", + "nodeType": "StructDefinition", + "scope": 314, + "src": "739:117:2", + "visibility": "public" + }, + { + "canonicalName": "IDisputeManager.Attestation", + "id": 213, + "members": [ + { + "constant": false, + "id": 202, + "mutability": "mutable", + "name": "requestCID", + "nameLocation": "961:10:2", + "nodeType": "VariableDeclaration", + "scope": 213, + "src": "953:18:2", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 201, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "953:7:2", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 204, + "mutability": "mutable", + "name": "responseCID", + "nameLocation": "989:11:2", + "nodeType": "VariableDeclaration", + "scope": 213, + "src": "981:19:2", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 203, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "981:7:2", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 206, + "mutability": "mutable", + "name": "subgraphDeploymentID", + "nameLocation": "1018:20:2", + "nodeType": "VariableDeclaration", + "scope": 213, + "src": "1010:28:2", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 205, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1010:7:2", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 208, + "mutability": "mutable", + "name": "r", + "nameLocation": "1056:1:2", + "nodeType": "VariableDeclaration", + "scope": 213, + "src": "1048:9:2", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 207, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1048:7:2", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 210, + "mutability": "mutable", + "name": "s", + "nameLocation": "1075:1:2", + "nodeType": "VariableDeclaration", + "scope": 213, + "src": "1067:9:2", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 209, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1067:7:2", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 212, + "mutability": "mutable", + "name": "v", + "nameLocation": "1092:1:2", + "nodeType": "VariableDeclaration", + "scope": 213, + "src": "1086:7:2", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "typeName": { + "id": 211, + "name": "uint8", + "nodeType": "ElementaryTypeName", + "src": "1086:5:2", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "visibility": "internal" + } + ], + "name": "Attestation", + "nameLocation": "931:11:2", + "nodeType": "StructDefinition", + "scope": 314, + "src": "924:176:2", + "visibility": "public" + }, + { + "functionSelector": "b0eefabe", + "id": 218, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "setArbitrator", + "nameLocation": "1143:13:2", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 216, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 215, + "mutability": "mutable", + "name": "_arbitrator", + "nameLocation": "1165:11:2", + "nodeType": "VariableDeclaration", + "scope": 218, + "src": "1157:19:2", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 214, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1157:7:2", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "1156:21:2" + }, + "returnParameters": { + "id": 217, + "nodeType": "ParameterList", + "parameters": [], + "src": "1186:0:2" + }, + "scope": 314, + "src": "1134:53:2", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "functionSelector": "e78ec42e", + "id": 223, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "setMinimumDeposit", + "nameLocation": "1202:17:2", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 221, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 220, + "mutability": "mutable", + "name": "_minimumDeposit", + "nameLocation": "1228:15:2", + "nodeType": "VariableDeclaration", + "scope": 223, + "src": "1220:23:2", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 219, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1220:7:2", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "1219:25:2" + }, + "returnParameters": { + "id": 222, + "nodeType": "ParameterList", + "parameters": [], + "src": "1253:0:2" + }, + "scope": 314, + "src": "1193:61:2", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "functionSelector": "991a8355", + "id": 228, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "setFishermanRewardPercentage", + "nameLocation": "1269:28:2", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 226, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 225, + "mutability": "mutable", + "name": "_percentage", + "nameLocation": "1305:11:2", + "nodeType": "VariableDeclaration", + "scope": 228, + "src": "1298:18:2", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 224, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "1298:6:2", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + } + ], + "src": "1297:20:2" + }, + "returnParameters": { + "id": 227, + "nodeType": "ParameterList", + "parameters": [], + "src": "1326:0:2" + }, + "scope": 314, + "src": "1260:67:2", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "functionSelector": "8bbb33b4", + "id": 235, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "setSlashingPercentage", + "nameLocation": "1342:21:2", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 233, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 230, + "mutability": "mutable", + "name": "_qryPercentage", + "nameLocation": "1371:14:2", + "nodeType": "VariableDeclaration", + "scope": 235, + "src": "1364:21:2", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 229, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "1364:6:2", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 232, + "mutability": "mutable", + "name": "_idxPercentage", + "nameLocation": "1394:14:2", + "nodeType": "VariableDeclaration", + "scope": 235, + "src": "1387:21:2", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 231, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "1387:6:2", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + } + ], + "src": "1363:46:2" + }, + "returnParameters": { + "id": 234, + "nodeType": "ParameterList", + "parameters": [], + "src": "1418:0:2" + }, + "scope": 314, + "src": "1333:86:2", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "functionSelector": "be41f384", + "id": 242, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "isDisputeCreated", + "nameLocation": "1456:16:2", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 238, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 237, + "mutability": "mutable", + "name": "_disputeID", + "nameLocation": "1481:10:2", + "nodeType": "VariableDeclaration", + "scope": 242, + "src": "1473:18:2", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 236, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1473:7:2", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "1472:20:2" + }, + "returnParameters": { + "id": 241, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 240, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 242, + "src": "1516:4:2", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 239, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "1516:4:2", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "src": "1515:6:2" + }, + "scope": 314, + "src": "1447:75:2", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "functionSelector": "460967df", + "id": 250, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "encodeHashReceipt", + "nameLocation": "1537:17:2", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 246, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 245, + "mutability": "mutable", + "name": "_receipt", + "nameLocation": "1570:8:2", + "nodeType": "VariableDeclaration", + "scope": 250, + "src": "1555:23:2", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Receipt_$200_memory_ptr", + "typeString": "struct IDisputeManager.Receipt" + }, + "typeName": { + "id": 244, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 243, + "name": "Receipt", + "nameLocations": [ + "1555:7:2" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 200, + "src": "1555:7:2" + }, + "referencedDeclaration": 200, + "src": "1555:7:2", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Receipt_$200_storage_ptr", + "typeString": "struct IDisputeManager.Receipt" + } + }, + "visibility": "internal" + } + ], + "src": "1554:25:2" + }, + "returnParameters": { + "id": 249, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 248, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 250, + "src": "1603:7:2", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 247, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1603:7:2", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "1602:9:2" + }, + "scope": 314, + "src": "1528:84:2", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "functionSelector": "d36fc9d4", + "id": 261, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "areConflictingAttestations", + "nameLocation": "1627:26:2", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 257, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 253, + "mutability": "mutable", + "name": "_attestation1", + "nameLocation": "1682:13:2", + "nodeType": "VariableDeclaration", + "scope": 261, + "src": "1663:32:2", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Attestation_$213_memory_ptr", + "typeString": "struct IDisputeManager.Attestation" + }, + "typeName": { + "id": 252, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 251, + "name": "Attestation", + "nameLocations": [ + "1663:11:2" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 213, + "src": "1663:11:2" + }, + "referencedDeclaration": 213, + "src": "1663:11:2", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Attestation_$213_storage_ptr", + "typeString": "struct IDisputeManager.Attestation" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 256, + "mutability": "mutable", + "name": "_attestation2", + "nameLocation": "1724:13:2", + "nodeType": "VariableDeclaration", + "scope": 261, + "src": "1705:32:2", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Attestation_$213_memory_ptr", + "typeString": "struct IDisputeManager.Attestation" + }, + "typeName": { + "id": 255, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 254, + "name": "Attestation", + "nameLocations": [ + "1705:11:2" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 213, + "src": "1705:11:2" + }, + "referencedDeclaration": 213, + "src": "1705:11:2", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Attestation_$213_storage_ptr", + "typeString": "struct IDisputeManager.Attestation" + } + }, + "visibility": "internal" + } + ], + "src": "1653:90:2" + }, + "returnParameters": { + "id": 260, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 259, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 261, + "src": "1767:4:2", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 258, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "1767:4:2", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "src": "1766:6:2" + }, + "scope": 314, + "src": "1618:155:2", + "stateMutability": "pure", + "virtual": false, + "visibility": "external" + }, + { + "functionSelector": "c9747f51", + "id": 269, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "getAttestationIndexer", + "nameLocation": "1788:21:2", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 265, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 264, + "mutability": "mutable", + "name": "_attestation", + "nameLocation": "1829:12:2", + "nodeType": "VariableDeclaration", + "scope": 269, + "src": "1810:31:2", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Attestation_$213_memory_ptr", + "typeString": "struct IDisputeManager.Attestation" + }, + "typeName": { + "id": 263, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 262, + "name": "Attestation", + "nameLocations": [ + "1810:11:2" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 213, + "src": "1810:11:2" + }, + "referencedDeclaration": 213, + "src": "1810:11:2", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Attestation_$213_storage_ptr", + "typeString": "struct IDisputeManager.Attestation" + } + }, + "visibility": "internal" + } + ], + "src": "1809:33:2" + }, + "returnParameters": { + "id": 268, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 267, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 269, + "src": "1866:7:2", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 266, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1866:7:2", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "1865:9:2" + }, + "scope": 314, + "src": "1779:96:2", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "functionSelector": "131610b1", + "id": 278, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "createQueryDispute", + "nameLocation": "1912:18:2", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 274, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 271, + "mutability": "mutable", + "name": "_attestationData", + "nameLocation": "1946:16:2", + "nodeType": "VariableDeclaration", + "scope": 278, + "src": "1931:31:2", + "stateVariable": false, + "storageLocation": "calldata", + "typeDescriptions": { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 270, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "1931:5:2", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 273, + "mutability": "mutable", + "name": "_deposit", + "nameLocation": "1972:8:2", + "nodeType": "VariableDeclaration", + "scope": 278, + "src": "1964:16:2", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 272, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1964:7:2", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "1930:51:2" + }, + "returnParameters": { + "id": 277, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 276, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 278, + "src": "2000:7:2", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 275, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "2000:7:2", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "1999:9:2" + }, + "scope": 314, + "src": "1903:106:2", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "functionSelector": "c894222e", + "id": 289, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "createQueryDisputeConflict", + "nameLocation": "2024:26:2", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 283, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 280, + "mutability": "mutable", + "name": "_attestationData1", + "nameLocation": "2075:17:2", + "nodeType": "VariableDeclaration", + "scope": 289, + "src": "2060:32:2", + "stateVariable": false, + "storageLocation": "calldata", + "typeDescriptions": { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 279, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "2060:5:2", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 282, + "mutability": "mutable", + "name": "_attestationData2", + "nameLocation": "2117:17:2", + "nodeType": "VariableDeclaration", + "scope": 289, + "src": "2102:32:2", + "stateVariable": false, + "storageLocation": "calldata", + "typeDescriptions": { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 281, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "2102:5:2", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "src": "2050:90:2" + }, + "returnParameters": { + "id": 288, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 285, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 289, + "src": "2159:7:2", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 284, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "2159:7:2", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 287, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 289, + "src": "2168:7:2", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 286, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "2168:7:2", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "2158:18:2" + }, + "scope": 314, + "src": "2015:162:2", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "functionSelector": "c8792217", + "id": 298, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "createIndexingDispute", + "nameLocation": "2192:21:2", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 294, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 291, + "mutability": "mutable", + "name": "_allocationID", + "nameLocation": "2222:13:2", + "nodeType": "VariableDeclaration", + "scope": 298, + "src": "2214:21:2", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 290, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2214:7:2", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 293, + "mutability": "mutable", + "name": "_deposit", + "nameLocation": "2245:8:2", + "nodeType": "VariableDeclaration", + "scope": 298, + "src": "2237:16:2", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 292, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2237:7:2", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "2213:41:2" + }, + "returnParameters": { + "id": 297, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 296, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 298, + "src": "2273:7:2", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 295, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "2273:7:2", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "2272:9:2" + }, + "scope": 314, + "src": "2183:99:2", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "functionSelector": "11b42611", + "id": 303, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "acceptDispute", + "nameLocation": "2297:13:2", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 301, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 300, + "mutability": "mutable", + "name": "_disputeID", + "nameLocation": "2319:10:2", + "nodeType": "VariableDeclaration", + "scope": 303, + "src": "2311:18:2", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 299, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "2311:7:2", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "2310:20:2" + }, + "returnParameters": { + "id": 302, + "nodeType": "ParameterList", + "parameters": [], + "src": "2339:0:2" + }, + "scope": 314, + "src": "2288:52:2", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "functionSelector": "36167e03", + "id": 308, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "rejectDispute", + "nameLocation": "2355:13:2", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 306, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 305, + "mutability": "mutable", + "name": "_disputeID", + "nameLocation": "2377:10:2", + "nodeType": "VariableDeclaration", + "scope": 308, + "src": "2369:18:2", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 304, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "2369:7:2", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "2368:20:2" + }, + "returnParameters": { + "id": 307, + "nodeType": "ParameterList", + "parameters": [], + "src": "2397:0:2" + }, + "scope": 314, + "src": "2346:52:2", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "functionSelector": "9334ea52", + "id": 313, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "drawDispute", + "nameLocation": "2413:11:2", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 311, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 310, + "mutability": "mutable", + "name": "_disputeID", + "nameLocation": "2433:10:2", + "nodeType": "VariableDeclaration", + "scope": 313, + "src": "2425:18:2", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 309, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "2425:7:2", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "2424:20:2" + }, + "returnParameters": { + "id": 312, + "nodeType": "ParameterList", + "parameters": [], + "src": "2453:0:2" + }, + "scope": 314, + "src": "2404:50:2", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + } + ], + "scope": 315, + "src": "110:2346:2", + "usedErrors": [], + "usedEvents": [] + } + ], + "src": "46:2411:2" + }, + "id": 2 + }, + "@graphprotocol/contracts/contracts/epochs/IEpochManager.sol": { + "ast": { + "absolutePath": "@graphprotocol/contracts/contracts/epochs/IEpochManager.sol", + "exportedSymbols": { + "IEpochManager": [ + 369 + ] + }, + "id": 370, + "license": "GPL-2.0-or-later", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 316, + "literals": [ + "solidity", + "^", + "0.7", + ".6", + "||", + "0.8", + ".27" + ], + "nodeType": "PragmaDirective", + "src": "46:33:3" + }, + { + "abstract": false, + "baseContracts": [], + "canonicalName": "IEpochManager", + "contractDependencies": [], + "contractKind": "interface", + "fullyImplemented": false, + "id": 369, + "linearizedBaseContracts": [ + 369 + ], + "name": "IEpochManager", + "nameLocation": "91:13:3", + "nodeType": "ContractDefinition", + "nodes": [ + { + "functionSelector": "54eea796", + "id": 321, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "setEpochLength", + "nameLocation": "148:14:3", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 319, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 318, + "mutability": "mutable", + "name": "_epochLength", + "nameLocation": "171:12:3", + "nodeType": "VariableDeclaration", + "scope": 321, + "src": "163:20:3", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 317, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "163:7:3", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "162:22:3" + }, + "returnParameters": { + "id": 320, + "nodeType": "ParameterList", + "parameters": [], + "src": "193:0:3" + }, + "scope": 369, + "src": "139:55:3", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "functionSelector": "c46e58eb", + "id": 324, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "runEpoch", + "nameLocation": "227:8:3", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 322, + "nodeType": "ParameterList", + "parameters": [], + "src": "235:2:3" + }, + "returnParameters": { + "id": 323, + "nodeType": "ParameterList", + "parameters": [], + "src": "246:0:3" + }, + "scope": 369, + "src": "218:29:3", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "functionSelector": "1ce05d38", + "id": 329, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "isCurrentEpochRun", + "nameLocation": "284:17:3", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 325, + "nodeType": "ParameterList", + "parameters": [], + "src": "301:2:3" + }, + "returnParameters": { + "id": 328, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 327, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 329, + "src": "327:4:3", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 326, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "327:4:3", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "src": "326:6:3" + }, + "scope": 369, + "src": "275:58:3", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "functionSelector": "8ae63d6d", + "id": 334, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "blockNum", + "nameLocation": "348:8:3", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 330, + "nodeType": "ParameterList", + "parameters": [], + "src": "356:2:3" + }, + "returnParameters": { + "id": 333, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 332, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 334, + "src": "382:7:3", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 331, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "382:7:3", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "381:9:3" + }, + "scope": 369, + "src": "339:52:3", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "functionSelector": "85df51fd", + "id": 341, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "blockHash", + "nameLocation": "406:9:3", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 337, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 336, + "mutability": "mutable", + "name": "_block", + "nameLocation": "424:6:3", + "nodeType": "VariableDeclaration", + "scope": 341, + "src": "416:14:3", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 335, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "416:7:3", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "415:16:3" + }, + "returnParameters": { + "id": 340, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 339, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 341, + "src": "455:7:3", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 338, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "455:7:3", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "454:9:3" + }, + "scope": 369, + "src": "397:67:3", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "functionSelector": "76671808", + "id": 346, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "currentEpoch", + "nameLocation": "479:12:3", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 342, + "nodeType": "ParameterList", + "parameters": [], + "src": "491:2:3" + }, + "returnParameters": { + "id": 345, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 344, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 346, + "src": "517:7:3", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 343, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "517:7:3", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "516:9:3" + }, + "scope": 369, + "src": "470:56:3", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "functionSelector": "ab93122c", + "id": 351, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "currentEpochBlock", + "nameLocation": "541:17:3", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 347, + "nodeType": "ParameterList", + "parameters": [], + "src": "558:2:3" + }, + "returnParameters": { + "id": 350, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 349, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 351, + "src": "584:7:3", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 348, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "584:7:3", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "583:9:3" + }, + "scope": 369, + "src": "532:61:3", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "functionSelector": "d0cfa46e", + "id": 356, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "currentEpochBlockSinceStart", + "nameLocation": "608:27:3", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 352, + "nodeType": "ParameterList", + "parameters": [], + "src": "635:2:3" + }, + "returnParameters": { + "id": 355, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 354, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 356, + "src": "661:7:3", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 353, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "661:7:3", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "660:9:3" + }, + "scope": 369, + "src": "599:71:3", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "functionSelector": "1b28126d", + "id": 363, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "epochsSince", + "nameLocation": "685:11:3", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 359, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 358, + "mutability": "mutable", + "name": "_epoch", + "nameLocation": "705:6:3", + "nodeType": "VariableDeclaration", + "scope": 363, + "src": "697:14:3", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 357, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "697:7:3", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "696:16:3" + }, + "returnParameters": { + "id": 362, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 361, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 363, + "src": "736:7:3", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 360, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "736:7:3", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "735:9:3" + }, + "scope": 369, + "src": "676:69:3", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "functionSelector": "19c3b82d", + "id": 368, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "epochsSinceUpdate", + "nameLocation": "760:17:3", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 364, + "nodeType": "ParameterList", + "parameters": [], + "src": "777:2:3" + }, + "returnParameters": { + "id": 367, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 366, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 368, + "src": "803:7:3", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 365, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "803:7:3", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "802:9:3" + }, + "scope": 369, + "src": "751:61:3", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + } + ], + "scope": 370, + "src": "81:733:3", + "usedErrors": [], + "usedEvents": [] + } + ], + "src": "46:769:3" + }, + "id": 3 + }, + "@graphprotocol/contracts/contracts/gateway/ICallhookReceiver.sol": { + "ast": { + "absolutePath": "@graphprotocol/contracts/contracts/gateway/ICallhookReceiver.sol", + "exportedSymbols": { + "ICallhookReceiver": [ + 382 + ] + }, + "id": 383, + "license": "GPL-2.0-or-later", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 371, + "literals": [ + "solidity", + "^", + "0.7", + ".6", + "||", + "0.8", + ".27" + ], + "nodeType": "PragmaDirective", + "src": "397:33:4" + }, + { + "abstract": false, + "baseContracts": [], + "canonicalName": "ICallhookReceiver", + "contractDependencies": [], + "contractKind": "interface", + "fullyImplemented": false, + "id": 382, + "linearizedBaseContracts": [ + 382 + ], + "name": "ICallhookReceiver", + "nameLocation": "442:17:4", + "nodeType": "ContractDefinition", + "nodes": [ + { + "documentation": { + "id": 372, + "nodeType": "StructuredDocumentation", + "src": "466:219:4", + "text": " @notice Receive tokens with a callhook from the bridge\n @param _from Token sender in L1\n @param _amount Amount of tokens that were transferred\n @param _data ABI-encoded callhook data" + }, + "functionSelector": "a4c0ed36", + "id": 381, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "onTokenTransfer", + "nameLocation": "699:15:4", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 379, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 374, + "mutability": "mutable", + "name": "_from", + "nameLocation": "723:5:4", + "nodeType": "VariableDeclaration", + "scope": 381, + "src": "715:13:4", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 373, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "715:7:4", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 376, + "mutability": "mutable", + "name": "_amount", + "nameLocation": "738:7:4", + "nodeType": "VariableDeclaration", + "scope": 381, + "src": "730:15:4", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 375, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "730:7:4", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 378, + "mutability": "mutable", + "name": "_data", + "nameLocation": "762:5:4", + "nodeType": "VariableDeclaration", + "scope": 381, + "src": "747:20:4", + "stateVariable": false, + "storageLocation": "calldata", + "typeDescriptions": { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 377, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "747:5:4", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "src": "714:54:4" + }, + "returnParameters": { + "id": 380, + "nodeType": "ParameterList", + "parameters": [], + "src": "777:0:4" + }, + "scope": 382, + "src": "690:88:4", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + } + ], + "scope": 383, + "src": "432:348:4", + "usedErrors": [], + "usedEvents": [] + } + ], + "src": "397:384:4" + }, + "id": 4 + }, + "@graphprotocol/contracts/contracts/governance/IController.sol": { + "ast": { + "absolutePath": "@graphprotocol/contracts/contracts/governance/IController.sol", + "exportedSymbols": { + "IController": [ + 441 + ] + }, + "id": 442, + "license": "GPL-2.0-or-later", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 384, + "literals": [ + "solidity", + "^", + "0.7", + ".6", + "||", + "0.8", + ".27" + ], + "nodeType": "PragmaDirective", + "src": "46:33:5" + }, + { + "abstract": false, + "baseContracts": [], + "canonicalName": "IController", + "contractDependencies": [], + "contractKind": "interface", + "fullyImplemented": false, + "id": 441, + "linearizedBaseContracts": [ + 441 + ], + "name": "IController", + "nameLocation": "91:11:5", + "nodeType": "ContractDefinition", + "nodes": [ + { + "functionSelector": "4fc07d75", + "id": 389, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "getGovernor", + "nameLocation": "118:11:5", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 385, + "nodeType": "ParameterList", + "parameters": [], + "src": "129:2:5" + }, + "returnParameters": { + "id": 388, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 387, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 389, + "src": "155:7:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 386, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "155:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "154:9:5" + }, + "scope": 441, + "src": "109:55:5", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "functionSelector": "e0e99292", + "id": 396, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "setContractProxy", + "nameLocation": "202:16:5", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 394, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 391, + "mutability": "mutable", + "name": "_id", + "nameLocation": "227:3:5", + "nodeType": "VariableDeclaration", + "scope": 396, + "src": "219:11:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 390, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "219:7:5", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 393, + "mutability": "mutable", + "name": "_contractAddress", + "nameLocation": "240:16:5", + "nodeType": "VariableDeclaration", + "scope": 396, + "src": "232:24:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 392, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "232:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "218:39:5" + }, + "returnParameters": { + "id": 395, + "nodeType": "ParameterList", + "parameters": [], + "src": "266:0:5" + }, + "scope": 441, + "src": "193:74:5", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "functionSelector": "9181df9c", + "id": 401, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "unsetContractProxy", + "nameLocation": "282:18:5", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 399, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 398, + "mutability": "mutable", + "name": "_id", + "nameLocation": "309:3:5", + "nodeType": "VariableDeclaration", + "scope": 401, + "src": "301:11:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 397, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "301:7:5", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "300:13:5" + }, + "returnParameters": { + "id": 400, + "nodeType": "ParameterList", + "parameters": [], + "src": "322:0:5" + }, + "scope": 441, + "src": "273:50:5", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "functionSelector": "eb5dd94f", + "id": 408, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "updateController", + "nameLocation": "338:16:5", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 406, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 403, + "mutability": "mutable", + "name": "_id", + "nameLocation": "363:3:5", + "nodeType": "VariableDeclaration", + "scope": 408, + "src": "355:11:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 402, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "355:7:5", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 405, + "mutability": "mutable", + "name": "_controller", + "nameLocation": "376:11:5", + "nodeType": "VariableDeclaration", + "scope": 408, + "src": "368:19:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 404, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "368:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "354:34:5" + }, + "returnParameters": { + "id": 407, + "nodeType": "ParameterList", + "parameters": [], + "src": "397:0:5" + }, + "scope": 441, + "src": "329:69:5", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "functionSelector": "f7641a5e", + "id": 415, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "getContractProxy", + "nameLocation": "413:16:5", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 411, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 410, + "mutability": "mutable", + "name": "_id", + "nameLocation": "438:3:5", + "nodeType": "VariableDeclaration", + "scope": 415, + "src": "430:11:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 409, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "430:7:5", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "429:13:5" + }, + "returnParameters": { + "id": 414, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 413, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 415, + "src": "466:7:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 412, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "466:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "465:9:5" + }, + "scope": 441, + "src": "404:71:5", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "functionSelector": "56371bd8", + "id": 420, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "setPartialPaused", + "nameLocation": "512:16:5", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 418, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 417, + "mutability": "mutable", + "name": "_partialPaused", + "nameLocation": "534:14:5", + "nodeType": "VariableDeclaration", + "scope": 420, + "src": "529:19:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 416, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "529:4:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "src": "528:21:5" + }, + "returnParameters": { + "id": 419, + "nodeType": "ParameterList", + "parameters": [], + "src": "558:0:5" + }, + "scope": 441, + "src": "503:56:5", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "functionSelector": "16c38b3c", + "id": 425, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "setPaused", + "nameLocation": "574:9:5", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 423, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 422, + "mutability": "mutable", + "name": "_paused", + "nameLocation": "589:7:5", + "nodeType": "VariableDeclaration", + "scope": 425, + "src": "584:12:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 421, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "584:4:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "src": "583:14:5" + }, + "returnParameters": { + "id": 424, + "nodeType": "ParameterList", + "parameters": [], + "src": "606:0:5" + }, + "scope": 441, + "src": "565:42:5", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "functionSelector": "48bde20c", + "id": 430, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "setPauseGuardian", + "nameLocation": "622:16:5", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 428, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 427, + "mutability": "mutable", + "name": "_newPauseGuardian", + "nameLocation": "647:17:5", + "nodeType": "VariableDeclaration", + "scope": 430, + "src": "639:25:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 426, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "639:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "638:27:5" + }, + "returnParameters": { + "id": 429, + "nodeType": "ParameterList", + "parameters": [], + "src": "674:0:5" + }, + "scope": 441, + "src": "613:62:5", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "functionSelector": "5c975abb", + "id": 435, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "paused", + "nameLocation": "690:6:5", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 431, + "nodeType": "ParameterList", + "parameters": [], + "src": "696:2:5" + }, + "returnParameters": { + "id": 434, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 433, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 435, + "src": "722:4:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 432, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "722:4:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "src": "721:6:5" + }, + "scope": 441, + "src": "681:47:5", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "functionSelector": "2e292fc7", + "id": 440, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "partialPaused", + "nameLocation": "743:13:5", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 436, + "nodeType": "ParameterList", + "parameters": [], + "src": "756:2:5" + }, + "returnParameters": { + "id": 439, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 438, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 440, + "src": "782:4:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 437, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "782:4:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "src": "781:6:5" + }, + "scope": 441, + "src": "734:54:5", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + } + ], + "scope": 442, + "src": "81:709:5", + "usedErrors": [], + "usedEvents": [] + } + ], + "src": "46:745:5" + }, + "id": 5 + }, + "@graphprotocol/contracts/contracts/l2/curation/IL2Curation.sol": { + "ast": { + "absolutePath": "@graphprotocol/contracts/contracts/l2/curation/IL2Curation.sol", + "exportedSymbols": { + "IL2Curation": [ + 481 + ] + }, + "id": 482, + "license": "GPL-2.0-or-later", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 443, + "literals": [ + "solidity", + "^", + "0.7", + ".6", + "||", + "0.8", + ".27" + ], + "nodeType": "PragmaDirective", + "src": "46:33:6" + }, + { + "abstract": false, + "baseContracts": [], + "canonicalName": "IL2Curation", + "contractDependencies": [], + "contractKind": "interface", + "documentation": { + "id": 444, + "nodeType": "StructuredDocumentation", + "src": "81:56:6", + "text": " @title Interface of the L2 Curation contract." + }, + "fullyImplemented": false, + "id": 481, + "linearizedBaseContracts": [ + 481 + ], + "name": "IL2Curation", + "nameLocation": "148:11:6", + "nodeType": "ContractDefinition", + "nodes": [ + { + "documentation": { + "id": 445, + "nodeType": "StructuredDocumentation", + "src": "166:131:6", + "text": " @notice Set the subgraph service address.\n @param _subgraphService Address of the SubgraphService contract" + }, + "functionSelector": "93a90a1e", + "id": 450, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "setSubgraphService", + "nameLocation": "311:18:6", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 448, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 447, + "mutability": "mutable", + "name": "_subgraphService", + "nameLocation": "338:16:6", + "nodeType": "VariableDeclaration", + "scope": 450, + "src": "330:24:6", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 446, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "330:7:6", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "329:26:6" + }, + "returnParameters": { + "id": 449, + "nodeType": "ParameterList", + "parameters": [], + "src": "364:0:6" + }, + "scope": 481, + "src": "302:63:6", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 451, + "nodeType": "StructuredDocumentation", + "src": "371:424:6", + "text": " @notice Deposit Graph Tokens in exchange for signal of a SubgraphDeployment curation pool.\n @dev This function charges no tax and can only be called by GNS in specific scenarios (for now\n only during an L1-L2 transfer).\n @param _subgraphDeploymentID Subgraph deployment pool from where to mint signal\n @param _tokensIn Amount of Graph Tokens to deposit\n @return Signal minted" + }, + "functionSelector": "3718896d", + "id": 460, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "mintTaxFree", + "nameLocation": "809:11:6", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 456, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 453, + "mutability": "mutable", + "name": "_subgraphDeploymentID", + "nameLocation": "829:21:6", + "nodeType": "VariableDeclaration", + "scope": 460, + "src": "821:29:6", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 452, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "821:7:6", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 455, + "mutability": "mutable", + "name": "_tokensIn", + "nameLocation": "860:9:6", + "nodeType": "VariableDeclaration", + "scope": 460, + "src": "852:17:6", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 454, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "852:7:6", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "820:50:6" + }, + "returnParameters": { + "id": 459, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 458, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 460, + "src": "889:7:6", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 457, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "889:7:6", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "888:9:6" + }, + "scope": 481, + "src": "800:98:6", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 461, + "nodeType": "StructuredDocumentation", + "src": "904:341:6", + "text": " @notice Calculate amount of signal that can be bought with tokens in a curation pool,\n without accounting for curation tax.\n @param _subgraphDeploymentID Subgraph deployment for which to mint signal\n @param _tokensIn Amount of tokens used to mint signal\n @return Amount of signal that can be bought" + }, + "functionSelector": "7a2a45b8", + "id": 470, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "tokensToSignalNoTax", + "nameLocation": "1259:19:6", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 466, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 463, + "mutability": "mutable", + "name": "_subgraphDeploymentID", + "nameLocation": "1287:21:6", + "nodeType": "VariableDeclaration", + "scope": 470, + "src": "1279:29:6", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 462, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1279:7:6", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 465, + "mutability": "mutable", + "name": "_tokensIn", + "nameLocation": "1318:9:6", + "nodeType": "VariableDeclaration", + "scope": 470, + "src": "1310:17:6", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 464, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1310:7:6", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "1278:50:6" + }, + "returnParameters": { + "id": 469, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 468, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 470, + "src": "1352:7:6", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 467, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1352:7:6", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "1351:9:6" + }, + "scope": 481, + "src": "1250:111:6", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 471, + "nodeType": "StructuredDocumentation", + "src": "1367:480:6", + "text": " @notice Calculate the amount of tokens that would be recovered if minting signal with\n the input tokens and then burning it. This can be used to compute rounding error.\n This function does not account for curation tax.\n @param _subgraphDeploymentID Subgraph deployment for which to mint signal\n @param _tokensIn Amount of tokens used to mint signal\n @return Amount of tokens that would be recovered after minting and burning signal" + }, + "functionSelector": "69db11a1", + "id": 480, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "tokensToSignalToTokensNoTax", + "nameLocation": "1861:27:6", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 476, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 473, + "mutability": "mutable", + "name": "_subgraphDeploymentID", + "nameLocation": "1906:21:6", + "nodeType": "VariableDeclaration", + "scope": 480, + "src": "1898:29:6", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 472, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1898:7:6", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 475, + "mutability": "mutable", + "name": "_tokensIn", + "nameLocation": "1945:9:6", + "nodeType": "VariableDeclaration", + "scope": 480, + "src": "1937:17:6", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 474, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1937:7:6", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "1888:72:6" + }, + "returnParameters": { + "id": 479, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 478, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 480, + "src": "1984:7:6", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 477, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1984:7:6", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "1983:9:6" + }, + "scope": 481, + "src": "1852:141:6", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + } + ], + "scope": 482, + "src": "138:1857:6", + "usedErrors": [], + "usedEvents": [] + } + ], + "src": "46:1950:6" + }, + "id": 6 + }, + "@graphprotocol/contracts/contracts/l2/discovery/IL2GNS.sol": { + "ast": { + "absolutePath": "@graphprotocol/contracts/contracts/l2/discovery/IL2GNS.sol", + "exportedSymbols": { + "ICallhookReceiver": [ + 382 + ], + "IL2GNS": [ + 532 + ] + }, + "id": 533, + "license": "GPL-2.0-or-later", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 483, + "literals": [ + "solidity", + "^", + "0.7", + ".6", + "||", + "0.8", + ".27" + ], + "nodeType": "PragmaDirective", + "src": "46:33:7" + }, + { + "absolutePath": "@graphprotocol/contracts/contracts/gateway/ICallhookReceiver.sol", + "file": "../../gateway/ICallhookReceiver.sol", + "id": 485, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 533, + "sourceUnit": 383, + "src": "81:72:7", + "symbolAliases": [ + { + "foreign": { + "id": 484, + "name": "ICallhookReceiver", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 382, + "src": "90:17:7", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "abstract": false, + "baseContracts": [ + { + "baseName": { + "id": 487, + "name": "ICallhookReceiver", + "nameLocations": [ + "227:17:7" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 382, + "src": "227:17:7" + }, + "id": 488, + "nodeType": "InheritanceSpecifier", + "src": "227:17:7" + } + ], + "canonicalName": "IL2GNS", + "contractDependencies": [], + "contractKind": "interface", + "documentation": { + "id": 486, + "nodeType": "StructuredDocumentation", + "src": "155:51:7", + "text": " @title Interface for the L2GNS contract." + }, + "fullyImplemented": false, + "id": 532, + "linearizedBaseContracts": [ + 532, + 382 + ], + "name": "IL2GNS", + "nameLocation": "217:6:7", + "nodeType": "ContractDefinition", + "nodes": [ + { + "canonicalName": "IL2GNS.L1MessageCodes", + "id": 491, + "members": [ + { + "id": 489, + "name": "RECEIVE_SUBGRAPH_CODE", + "nameLocation": "281:21:7", + "nodeType": "EnumValue", + "src": "281:21:7" + }, + { + "id": 490, + "name": "RECEIVE_CURATOR_BALANCE_CODE", + "nameLocation": "312:28:7", + "nodeType": "EnumValue", + "src": "312:28:7" + } + ], + "name": "L1MessageCodes", + "nameLocation": "256:14:7", + "nodeType": "EnumDefinition", + "src": "251:95:7" + }, + { + "canonicalName": "IL2GNS.SubgraphL2TransferData", + "documentation": { + "id": 492, + "nodeType": "StructuredDocumentation", + "src": "352:138:7", + "text": " @dev The SubgraphL2TransferData struct holds information\n about a subgraph related to its transfer from L1 to L2." + }, + "id": 503, + "members": [ + { + "constant": false, + "id": 494, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "543:6:7", + "nodeType": "VariableDeclaration", + "scope": 503, + "src": "535:14:7", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 493, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "535:7:7", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 498, + "mutability": "mutable", + "name": "curatorBalanceClaimed", + "nameLocation": "630:21:7", + "nodeType": "VariableDeclaration", + "scope": 503, + "src": "605:46:7", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_bool_$", + "typeString": "mapping(address => bool)" + }, + "typeName": { + "id": 497, + "keyName": "", + "keyNameLocation": "-1:-1:-1", + "keyType": { + "id": 495, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "613:7:7", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "605:24:7", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_bool_$", + "typeString": "mapping(address => bool)" + }, + "valueName": "", + "valueNameLocation": "-1:-1:-1", + "valueType": { + "id": 496, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "624:4:7", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 500, + "mutability": "mutable", + "name": "l2Done", + "nameLocation": "724:6:7", + "nodeType": "VariableDeclaration", + "scope": 503, + "src": "719:11:7", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 499, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "719:4:7", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 502, + "mutability": "mutable", + "name": "subgraphReceivedOnL2BlockNumber", + "nameLocation": "780:31:7", + "nodeType": "VariableDeclaration", + "scope": 503, + "src": "772:39:7", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 501, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "772:7:7", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "name": "SubgraphL2TransferData", + "nameLocation": "502:22:7", + "nodeType": "StructDefinition", + "scope": 532, + "src": "495:376:7", + "visibility": "public" + }, + { + "documentation": { + "id": 504, + "nodeType": "StructuredDocumentation", + "src": "877:486:7", + "text": " @notice Finish a subgraph transfer from L1.\n The subgraph must have been previously sent through the bridge\n using the sendSubgraphToL2 function on L1GNS.\n @param _l2SubgraphID Subgraph ID in L2 (aliased from the L1 subgraph ID)\n @param _subgraphDeploymentID Latest subgraph deployment to assign to the subgraph\n @param _subgraphMetadata IPFS hash of the subgraph metadata\n @param _versionMetadata IPFS hash of the version metadata" + }, + "functionSelector": "d1a80612", + "id": 515, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "finishSubgraphTransferFromL1", + "nameLocation": "1377:28:7", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 513, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 506, + "mutability": "mutable", + "name": "_l2SubgraphID", + "nameLocation": "1423:13:7", + "nodeType": "VariableDeclaration", + "scope": 515, + "src": "1415:21:7", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 505, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1415:7:7", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 508, + "mutability": "mutable", + "name": "_subgraphDeploymentID", + "nameLocation": "1454:21:7", + "nodeType": "VariableDeclaration", + "scope": 515, + "src": "1446:29:7", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 507, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1446:7:7", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 510, + "mutability": "mutable", + "name": "_subgraphMetadata", + "nameLocation": "1493:17:7", + "nodeType": "VariableDeclaration", + "scope": 515, + "src": "1485:25:7", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 509, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1485:7:7", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 512, + "mutability": "mutable", + "name": "_versionMetadata", + "nameLocation": "1528:16:7", + "nodeType": "VariableDeclaration", + "scope": 515, + "src": "1520:24:7", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 511, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1520:7:7", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "1405:145:7" + }, + "returnParameters": { + "id": 514, + "nodeType": "ParameterList", + "parameters": [], + "src": "1559:0:7" + }, + "scope": 532, + "src": "1368:192:7", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 516, + "nodeType": "StructuredDocumentation", + "src": "1566:167:7", + "text": " @notice Return the aliased L2 subgraph ID from a transferred L1 subgraph ID\n @param _l1SubgraphID L1 subgraph ID\n @return L2 subgraph ID" + }, + "functionSelector": "ea0f2eba", + "id": 523, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "getAliasedL2SubgraphID", + "nameLocation": "1747:22:7", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 519, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 518, + "mutability": "mutable", + "name": "_l1SubgraphID", + "nameLocation": "1778:13:7", + "nodeType": "VariableDeclaration", + "scope": 523, + "src": "1770:21:7", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 517, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1770:7:7", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "1769:23:7" + }, + "returnParameters": { + "id": 522, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 521, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 523, + "src": "1816:7:7", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 520, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1816:7:7", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "1815:9:7" + }, + "scope": 532, + "src": "1738:87:7", + "stateMutability": "pure", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 524, + "nodeType": "StructuredDocumentation", + "src": "1831:168:7", + "text": " @notice Return the unaliased L1 subgraph ID from a transferred L2 subgraph ID\n @param _l2SubgraphID L2 subgraph ID\n @return L1subgraph ID" + }, + "functionSelector": "9c6c022b", + "id": 531, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "getUnaliasedL1SubgraphID", + "nameLocation": "2013:24:7", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 527, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 526, + "mutability": "mutable", + "name": "_l2SubgraphID", + "nameLocation": "2046:13:7", + "nodeType": "VariableDeclaration", + "scope": 531, + "src": "2038:21:7", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 525, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2038:7:7", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "2037:23:7" + }, + "returnParameters": { + "id": 530, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 529, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 531, + "src": "2084:7:7", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 528, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2084:7:7", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "2083:9:7" + }, + "scope": 532, + "src": "2004:89:7", + "stateMutability": "pure", + "virtual": false, + "visibility": "external" + } + ], + "scope": 533, + "src": "207:1888:7", + "usedErrors": [], + "usedEvents": [] + } + ], + "src": "46:2050:7" + }, + "id": 7 + }, + "@graphprotocol/contracts/contracts/rewards/IRewardsIssuer.sol": { + "ast": { + "absolutePath": "@graphprotocol/contracts/contracts/rewards/IRewardsIssuer.sol", + "exportedSymbols": { + "IRewardsIssuer": [ + 561 + ] + }, + "id": 562, + "license": "GPL-2.0-or-later", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 534, + "literals": [ + "solidity", + "^", + "0.7", + ".6", + "||", + "0.8", + ".27" + ], + "nodeType": "PragmaDirective", + "src": "46:33:8" + }, + { + "abstract": false, + "baseContracts": [], + "canonicalName": "IRewardsIssuer", + "contractDependencies": [], + "contractKind": "interface", + "fullyImplemented": false, + "id": 561, + "linearizedBaseContracts": [ + 561 + ], + "name": "IRewardsIssuer", + "nameLocation": "91:14:8", + "nodeType": "ContractDefinition", + "nodes": [ + { + "documentation": { + "id": 535, + "nodeType": "StructuredDocumentation", + "src": "112:542:8", + "text": " @dev Get allocation data to calculate rewards issuance\n \n @param allocationId The allocation Id\n @return isActive Whether the allocation is active or not\n @return indexer The indexer address\n @return subgraphDeploymentId Subgraph deployment id for the allocation\n @return tokens Amount of allocated tokens\n @return accRewardsPerAllocatedToken Rewards snapshot\n @return accRewardsPending Snapshot of accumulated rewards from previous allocation resizing, pending to be claimed" + }, + "functionSelector": "55c85269", + "id": 552, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "getAllocationData", + "nameLocation": "668:17:8", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 538, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 537, + "mutability": "mutable", + "name": "allocationId", + "nameLocation": "703:12:8", + "nodeType": "VariableDeclaration", + "scope": 552, + "src": "695:20:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 536, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "695:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "685:36:8" + }, + "returnParameters": { + "id": 551, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 540, + "mutability": "mutable", + "name": "isActive", + "nameLocation": "787:8:8", + "nodeType": "VariableDeclaration", + "scope": 552, + "src": "782:13:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 539, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "782:4:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 542, + "mutability": "mutable", + "name": "indexer", + "nameLocation": "817:7:8", + "nodeType": "VariableDeclaration", + "scope": 552, + "src": "809:15:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 541, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "809:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 544, + "mutability": "mutable", + "name": "subgraphDeploymentId", + "nameLocation": "846:20:8", + "nodeType": "VariableDeclaration", + "scope": 552, + "src": "838:28:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 543, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "838:7:8", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 546, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "888:6:8", + "nodeType": "VariableDeclaration", + "scope": 552, + "src": "880:14:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 545, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "880:7:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 548, + "mutability": "mutable", + "name": "accRewardsPerAllocatedToken", + "nameLocation": "916:27:8", + "nodeType": "VariableDeclaration", + "scope": 552, + "src": "908:35:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 547, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "908:7:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 550, + "mutability": "mutable", + "name": "accRewardsPending", + "nameLocation": "965:17:8", + "nodeType": "VariableDeclaration", + "scope": 552, + "src": "957:25:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 549, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "957:7:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "768:224:8" + }, + "scope": 561, + "src": "659:334:8", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 553, + "nodeType": "StructuredDocumentation", + "src": "999:200:8", + "text": " @notice Return the total amount of tokens allocated to subgraph.\n @param _subgraphDeploymentId Deployment Id for the subgraph\n @return Total tokens allocated to subgraph" + }, + "functionSelector": "e2e1e8e9", + "id": 560, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "getSubgraphAllocatedTokens", + "nameLocation": "1213:26:8", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 556, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 555, + "mutability": "mutable", + "name": "_subgraphDeploymentId", + "nameLocation": "1248:21:8", + "nodeType": "VariableDeclaration", + "scope": 560, + "src": "1240:29:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 554, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1240:7:8", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "1239:31:8" + }, + "returnParameters": { + "id": 559, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 558, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 560, + "src": "1294:7:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 557, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1294:7:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "1293:9:8" + }, + "scope": 561, + "src": "1204:99:8", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + } + ], + "scope": 562, + "src": "81:1224:8", + "usedErrors": [], + "usedEvents": [] + } + ], + "src": "46:1260:8" + }, + "id": 8 + }, + "@graphprotocol/contracts/contracts/rewards/IRewardsManager.sol": { + "ast": { + "absolutePath": "@graphprotocol/contracts/contracts/rewards/IRewardsManager.sol", + "exportedSymbols": { + "IRewardsManager": [ + 678 + ] + }, + "id": 679, + "license": "GPL-2.0-or-later", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 563, + "literals": [ + "solidity", + "^", + "0.7", + ".6", + "||", + "0.8", + ".27" + ], + "nodeType": "PragmaDirective", + "src": "46:33:9" + }, + { + "abstract": false, + "baseContracts": [], + "canonicalName": "IRewardsManager", + "contractDependencies": [], + "contractKind": "interface", + "fullyImplemented": false, + "id": 678, + "linearizedBaseContracts": [ + 678 + ], + "name": "IRewardsManager", + "nameLocation": "91:15:9", + "nodeType": "ContractDefinition", + "nodes": [ + { + "canonicalName": "IRewardsManager.Subgraph", + "documentation": { + "id": 564, + "nodeType": "StructuredDocumentation", + "src": "113:108:9", + "text": " @dev Stores accumulated rewards and snapshots related to a particular SubgraphDeployment." + }, + "id": 573, + "members": [ + { + "constant": false, + "id": 566, + "mutability": "mutable", + "name": "accRewardsForSubgraph", + "nameLocation": "260:21:9", + "nodeType": "VariableDeclaration", + "scope": 573, + "src": "252:29:9", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 565, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "252:7:9", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 568, + "mutability": "mutable", + "name": "accRewardsForSubgraphSnapshot", + "nameLocation": "299:29:9", + "nodeType": "VariableDeclaration", + "scope": 573, + "src": "291:37:9", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 567, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "291:7:9", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 570, + "mutability": "mutable", + "name": "accRewardsPerSignalSnapshot", + "nameLocation": "346:27:9", + "nodeType": "VariableDeclaration", + "scope": 573, + "src": "338:35:9", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 569, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "338:7:9", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 572, + "mutability": "mutable", + "name": "accRewardsPerAllocatedToken", + "nameLocation": "391:27:9", + "nodeType": "VariableDeclaration", + "scope": 573, + "src": "383:35:9", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 571, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "383:7:9", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "name": "Subgraph", + "nameLocation": "233:8:9", + "nodeType": "StructDefinition", + "scope": 678, + "src": "226:199:9", + "visibility": "public" + }, + { + "functionSelector": "1156bdc1", + "id": 578, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "setIssuancePerBlock", + "nameLocation": "461:19:9", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 576, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 575, + "mutability": "mutable", + "name": "_issuancePerBlock", + "nameLocation": "489:17:9", + "nodeType": "VariableDeclaration", + "scope": 578, + "src": "481:25:9", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 574, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "481:7:9", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "480:27:9" + }, + "returnParameters": { + "id": 577, + "nodeType": "ParameterList", + "parameters": [], + "src": "516:0:9" + }, + "scope": 678, + "src": "452:65:9", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "functionSelector": "4bbfc1c5", + "id": 583, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "setMinimumSubgraphSignal", + "nameLocation": "532:24:9", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 581, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 580, + "mutability": "mutable", + "name": "_minimumSubgraphSignal", + "nameLocation": "565:22:9", + "nodeType": "VariableDeclaration", + "scope": 583, + "src": "557:30:9", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 579, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "557:7:9", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "556:32:9" + }, + "returnParameters": { + "id": 582, + "nodeType": "ParameterList", + "parameters": [], + "src": "597:0:9" + }, + "scope": 678, + "src": "523:75:9", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "functionSelector": "93a90a1e", + "id": 588, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "setSubgraphService", + "nameLocation": "613:18:9", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 586, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 585, + "mutability": "mutable", + "name": "_subgraphService", + "nameLocation": "640:16:9", + "nodeType": "VariableDeclaration", + "scope": 588, + "src": "632:24:9", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 584, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "632:7:9", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "631:26:9" + }, + "returnParameters": { + "id": 587, + "nodeType": "ParameterList", + "parameters": [], + "src": "666:0:9" + }, + "scope": 678, + "src": "604:63:9", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "functionSelector": "0903c094", + "id": 593, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "setSubgraphAvailabilityOracle", + "nameLocation": "705:29:9", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 591, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 590, + "mutability": "mutable", + "name": "_subgraphAvailabilityOracle", + "nameLocation": "743:27:9", + "nodeType": "VariableDeclaration", + "scope": 593, + "src": "735:35:9", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 589, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "735:7:9", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "734:37:9" + }, + "returnParameters": { + "id": 592, + "nodeType": "ParameterList", + "parameters": [], + "src": "780:0:9" + }, + "scope": 678, + "src": "696:85:9", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "functionSelector": "1324a506", + "id": 600, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "setDenied", + "nameLocation": "796:9:9", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 598, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 595, + "mutability": "mutable", + "name": "_subgraphDeploymentID", + "nameLocation": "814:21:9", + "nodeType": "VariableDeclaration", + "scope": 600, + "src": "806:29:9", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 594, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "806:7:9", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 597, + "mutability": "mutable", + "name": "_deny", + "nameLocation": "842:5:9", + "nodeType": "VariableDeclaration", + "scope": 600, + "src": "837:10:9", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 596, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "837:4:9", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "src": "805:43:9" + }, + "returnParameters": { + "id": 599, + "nodeType": "ParameterList", + "parameters": [], + "src": "857:0:9" + }, + "scope": 678, + "src": "787:71:9", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "functionSelector": "e820e284", + "id": 607, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "isDenied", + "nameLocation": "873:8:9", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 603, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 602, + "mutability": "mutable", + "name": "_subgraphDeploymentID", + "nameLocation": "890:21:9", + "nodeType": "VariableDeclaration", + "scope": 607, + "src": "882:29:9", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 601, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "882:7:9", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "881:31:9" + }, + "returnParameters": { + "id": 606, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 605, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 607, + "src": "936:4:9", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 604, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "936:4:9", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "src": "935:6:9" + }, + "scope": 678, + "src": "864:78:9", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "functionSelector": "e284f848", + "id": 612, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "getNewRewardsPerSignal", + "nameLocation": "979:22:9", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 608, + "nodeType": "ParameterList", + "parameters": [], + "src": "1001:2:9" + }, + "returnParameters": { + "id": 611, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 610, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 612, + "src": "1027:7:9", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 609, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1027:7:9", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "1026:9:9" + }, + "scope": 678, + "src": "970:66:9", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "functionSelector": "a8cc0ee2", + "id": 617, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "getAccRewardsPerSignal", + "nameLocation": "1051:22:9", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 613, + "nodeType": "ParameterList", + "parameters": [], + "src": "1073:2:9" + }, + "returnParameters": { + "id": 616, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 615, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 617, + "src": "1099:7:9", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 614, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1099:7:9", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "1098:9:9" + }, + "scope": 678, + "src": "1042:66:9", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "functionSelector": "5c6cbd59", + "id": 624, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "getAccRewardsForSubgraph", + "nameLocation": "1123:24:9", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 620, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 619, + "mutability": "mutable", + "name": "_subgraphDeploymentID", + "nameLocation": "1156:21:9", + "nodeType": "VariableDeclaration", + "scope": 624, + "src": "1148:29:9", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 618, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1148:7:9", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "1147:31:9" + }, + "returnParameters": { + "id": 623, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 622, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 624, + "src": "1202:7:9", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 621, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1202:7:9", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "1201:9:9" + }, + "scope": 678, + "src": "1114:97:9", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "functionSelector": "702a280e", + "id": 633, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "getAccRewardsPerAllocatedToken", + "nameLocation": "1226:30:9", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 627, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 626, + "mutability": "mutable", + "name": "_subgraphDeploymentID", + "nameLocation": "1265:21:9", + "nodeType": "VariableDeclaration", + "scope": 633, + "src": "1257:29:9", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 625, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1257:7:9", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "1256:31:9" + }, + "returnParameters": { + "id": 632, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 629, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 633, + "src": "1311:7:9", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 628, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1311:7:9", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 631, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 633, + "src": "1320:7:9", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 630, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1320:7:9", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "1310:18:9" + }, + "scope": 678, + "src": "1217:112:9", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "functionSelector": "779bcb9b", + "id": 642, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "getRewards", + "nameLocation": "1344:10:9", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 638, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 635, + "mutability": "mutable", + "name": "_rewardsIssuer", + "nameLocation": "1363:14:9", + "nodeType": "VariableDeclaration", + "scope": 642, + "src": "1355:22:9", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 634, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1355:7:9", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 637, + "mutability": "mutable", + "name": "_allocationID", + "nameLocation": "1387:13:9", + "nodeType": "VariableDeclaration", + "scope": 642, + "src": "1379:21:9", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 636, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1379:7:9", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "1354:47:9" + }, + "returnParameters": { + "id": 641, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 640, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 642, + "src": "1425:7:9", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 639, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1425:7:9", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "1424:9:9" + }, + "scope": 678, + "src": "1335:99:9", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "functionSelector": "c8a5f81e", + "id": 651, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "calcRewards", + "nameLocation": "1449:11:9", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 647, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 644, + "mutability": "mutable", + "name": "_tokens", + "nameLocation": "1469:7:9", + "nodeType": "VariableDeclaration", + "scope": 651, + "src": "1461:15:9", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 643, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1461:7:9", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 646, + "mutability": "mutable", + "name": "_accRewardsPerAllocatedToken", + "nameLocation": "1486:28:9", + "nodeType": "VariableDeclaration", + "scope": 651, + "src": "1478:36:9", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 645, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1478:7:9", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "1460:55:9" + }, + "returnParameters": { + "id": 650, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 649, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 651, + "src": "1539:7:9", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 648, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1539:7:9", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "1538:9:9" + }, + "scope": 678, + "src": "1440:108:9", + "stateMutability": "pure", + "virtual": false, + "visibility": "external" + }, + { + "functionSelector": "c7d1117d", + "id": 656, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "updateAccRewardsPerSignal", + "nameLocation": "1585:25:9", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 652, + "nodeType": "ParameterList", + "parameters": [], + "src": "1610:2:9" + }, + "returnParameters": { + "id": 655, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 654, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 656, + "src": "1631:7:9", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 653, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1631:7:9", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "1630:9:9" + }, + "scope": 678, + "src": "1576:64:9", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "functionSelector": "db750926", + "id": 663, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "takeRewards", + "nameLocation": "1655:11:9", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 659, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 658, + "mutability": "mutable", + "name": "_allocationID", + "nameLocation": "1675:13:9", + "nodeType": "VariableDeclaration", + "scope": 663, + "src": "1667:21:9", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 657, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1667:7:9", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "1666:23:9" + }, + "returnParameters": { + "id": 662, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 661, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 663, + "src": "1708:7:9", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 660, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1708:7:9", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "1707:9:9" + }, + "scope": 678, + "src": "1646:71:9", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "functionSelector": "1d1c2fec", + "id": 670, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "onSubgraphSignalUpdate", + "nameLocation": "1752:22:9", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 666, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 665, + "mutability": "mutable", + "name": "_subgraphDeploymentID", + "nameLocation": "1783:21:9", + "nodeType": "VariableDeclaration", + "scope": 670, + "src": "1775:29:9", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 664, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1775:7:9", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "1774:31:9" + }, + "returnParameters": { + "id": 669, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 668, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 670, + "src": "1824:7:9", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 667, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1824:7:9", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "1823:9:9" + }, + "scope": 678, + "src": "1743:90:9", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "functionSelector": "eeac3e0e", + "id": 677, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "onSubgraphAllocationUpdate", + "nameLocation": "1848:26:9", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 673, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 672, + "mutability": "mutable", + "name": "_subgraphDeploymentID", + "nameLocation": "1883:21:9", + "nodeType": "VariableDeclaration", + "scope": 677, + "src": "1875:29:9", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 671, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1875:7:9", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "1874:31:9" + }, + "returnParameters": { + "id": 676, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 675, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 677, + "src": "1924:7:9", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 674, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1924:7:9", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "1923:9:9" + }, + "scope": 678, + "src": "1839:94:9", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + } + ], + "scope": 679, + "src": "81:1854:9", + "usedErrors": [], + "usedEvents": [] + } + ], + "src": "46:1890:9" + }, + "id": 9 + }, + "@graphprotocol/contracts/contracts/token/IGraphToken.sol": { + "ast": { + "absolutePath": "@graphprotocol/contracts/contracts/token/IGraphToken.sol", + "exportedSymbols": { + "IERC20": [ + 6147 + ], + "IGraphToken": [ + 758 + ] + }, + "id": 759, + "license": "GPL-2.0-or-later", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 680, + "literals": [ + "solidity", + "^", + "0.7", + ".6", + "||", + "0.8", + ".27" + ], + "nodeType": "PragmaDirective", + "src": "46:33:10" + }, + { + "absolutePath": "@openzeppelin/contracts/token/ERC20/IERC20.sol", + "file": "@openzeppelin/contracts/token/ERC20/IERC20.sol", + "id": 681, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 759, + "sourceUnit": 6148, + "src": "81:56:10", + "symbolAliases": [], + "unitAlias": "" + }, + { + "abstract": false, + "baseContracts": [ + { + "baseName": { + "id": 682, + "name": "IERC20", + "nameLocations": [ + "164:6:10" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 6147, + "src": "164:6:10" + }, + "id": 683, + "nodeType": "InheritanceSpecifier", + "src": "164:6:10" + } + ], + "canonicalName": "IGraphToken", + "contractDependencies": [], + "contractKind": "interface", + "fullyImplemented": false, + "id": 758, + "linearizedBaseContracts": [ + 758, + 6147 + ], + "name": "IGraphToken", + "nameLocation": "149:11:10", + "nodeType": "ContractDefinition", + "nodes": [ + { + "functionSelector": "42966c68", + "id": 688, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "burn", + "nameLocation": "214:4:10", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 686, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 685, + "mutability": "mutable", + "name": "amount", + "nameLocation": "227:6:10", + "nodeType": "VariableDeclaration", + "scope": 688, + "src": "219:14:10", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 684, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "219:7:10", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "218:16:10" + }, + "returnParameters": { + "id": 687, + "nodeType": "ParameterList", + "parameters": [], + "src": "243:0:10" + }, + "scope": 758, + "src": "205:39:10", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "functionSelector": "79cc6790", + "id": 695, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "burnFrom", + "nameLocation": "259:8:10", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 693, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 690, + "mutability": "mutable", + "name": "_from", + "nameLocation": "276:5:10", + "nodeType": "VariableDeclaration", + "scope": 695, + "src": "268:13:10", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 689, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "268:7:10", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 692, + "mutability": "mutable", + "name": "amount", + "nameLocation": "291:6:10", + "nodeType": "VariableDeclaration", + "scope": 695, + "src": "283:14:10", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 691, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "283:7:10", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "267:31:10" + }, + "returnParameters": { + "id": 694, + "nodeType": "ParameterList", + "parameters": [], + "src": "307:0:10" + }, + "scope": 758, + "src": "250:58:10", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "functionSelector": "40c10f19", + "id": 702, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "mint", + "nameLocation": "323:4:10", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 700, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 697, + "mutability": "mutable", + "name": "_to", + "nameLocation": "336:3:10", + "nodeType": "VariableDeclaration", + "scope": 702, + "src": "328:11:10", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 696, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "328:7:10", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 699, + "mutability": "mutable", + "name": "_amount", + "nameLocation": "349:7:10", + "nodeType": "VariableDeclaration", + "scope": 702, + "src": "341:15:10", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 698, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "341:7:10", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "327:30:10" + }, + "returnParameters": { + "id": 701, + "nodeType": "ParameterList", + "parameters": [], + "src": "366:0:10" + }, + "scope": 758, + "src": "314:53:10", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "functionSelector": "983b2d56", + "id": 707, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "addMinter", + "nameLocation": "407:9:10", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 705, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 704, + "mutability": "mutable", + "name": "_account", + "nameLocation": "425:8:10", + "nodeType": "VariableDeclaration", + "scope": 707, + "src": "417:16:10", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 703, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "417:7:10", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "416:18:10" + }, + "returnParameters": { + "id": 706, + "nodeType": "ParameterList", + "parameters": [], + "src": "443:0:10" + }, + "scope": 758, + "src": "398:46:10", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "functionSelector": "3092afd5", + "id": 712, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "removeMinter", + "nameLocation": "459:12:10", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 710, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 709, + "mutability": "mutable", + "name": "_account", + "nameLocation": "480:8:10", + "nodeType": "VariableDeclaration", + "scope": 712, + "src": "472:16:10", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 708, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "472:7:10", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "471:18:10" + }, + "returnParameters": { + "id": 711, + "nodeType": "ParameterList", + "parameters": [], + "src": "498:0:10" + }, + "scope": 758, + "src": "450:49:10", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "functionSelector": "98650275", + "id": 715, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "renounceMinter", + "nameLocation": "514:14:10", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 713, + "nodeType": "ParameterList", + "parameters": [], + "src": "528:2:10" + }, + "returnParameters": { + "id": 714, + "nodeType": "ParameterList", + "parameters": [], + "src": "539:0:10" + }, + "scope": 758, + "src": "505:35:10", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "functionSelector": "aa271e1a", + "id": 722, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "isMinter", + "nameLocation": "555:8:10", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 718, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 717, + "mutability": "mutable", + "name": "_account", + "nameLocation": "572:8:10", + "nodeType": "VariableDeclaration", + "scope": 722, + "src": "564:16:10", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 716, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "564:7:10", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "563:18:10" + }, + "returnParameters": { + "id": 721, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 720, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 722, + "src": "605:4:10", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 719, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "605:4:10", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "src": "604:6:10" + }, + "scope": 758, + "src": "546:65:10", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "functionSelector": "d505accf", + "id": 739, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "permit", + "nameLocation": "647:6:10", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 737, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 724, + "mutability": "mutable", + "name": "_owner", + "nameLocation": "671:6:10", + "nodeType": "VariableDeclaration", + "scope": 739, + "src": "663:14:10", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 723, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "663:7:10", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 726, + "mutability": "mutable", + "name": "_spender", + "nameLocation": "695:8:10", + "nodeType": "VariableDeclaration", + "scope": 739, + "src": "687:16:10", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 725, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "687:7:10", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 728, + "mutability": "mutable", + "name": "_value", + "nameLocation": "721:6:10", + "nodeType": "VariableDeclaration", + "scope": 739, + "src": "713:14:10", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 727, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "713:7:10", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 730, + "mutability": "mutable", + "name": "_deadline", + "nameLocation": "745:9:10", + "nodeType": "VariableDeclaration", + "scope": 739, + "src": "737:17:10", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 729, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "737:7:10", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 732, + "mutability": "mutable", + "name": "_v", + "nameLocation": "770:2:10", + "nodeType": "VariableDeclaration", + "scope": 739, + "src": "764:8:10", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "typeName": { + "id": 731, + "name": "uint8", + "nodeType": "ElementaryTypeName", + "src": "764:5:10", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 734, + "mutability": "mutable", + "name": "_r", + "nameLocation": "790:2:10", + "nodeType": "VariableDeclaration", + "scope": 739, + "src": "782:10:10", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 733, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "782:7:10", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 736, + "mutability": "mutable", + "name": "_s", + "nameLocation": "810:2:10", + "nodeType": "VariableDeclaration", + "scope": 739, + "src": "802:10:10", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 735, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "802:7:10", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "653:165:10" + }, + "returnParameters": { + "id": 738, + "nodeType": "ParameterList", + "parameters": [], + "src": "827:0:10" + }, + "scope": 758, + "src": "638:190:10", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "functionSelector": "39509351", + "id": 748, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "increaseAllowance", + "nameLocation": "867:17:10", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 744, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 741, + "mutability": "mutable", + "name": "spender", + "nameLocation": "893:7:10", + "nodeType": "VariableDeclaration", + "scope": 748, + "src": "885:15:10", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 740, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "885:7:10", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 743, + "mutability": "mutable", + "name": "addedValue", + "nameLocation": "910:10:10", + "nodeType": "VariableDeclaration", + "scope": 748, + "src": "902:18:10", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 742, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "902:7:10", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "884:37:10" + }, + "returnParameters": { + "id": 747, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 746, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 748, + "src": "940:4:10", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 745, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "940:4:10", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "src": "939:6:10" + }, + "scope": 758, + "src": "858:88:10", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "functionSelector": "a457c2d7", + "id": 757, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "decreaseAllowance", + "nameLocation": "961:17:10", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 753, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 750, + "mutability": "mutable", + "name": "spender", + "nameLocation": "987:7:10", + "nodeType": "VariableDeclaration", + "scope": 757, + "src": "979:15:10", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 749, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "979:7:10", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 752, + "mutability": "mutable", + "name": "subtractedValue", + "nameLocation": "1004:15:10", + "nodeType": "VariableDeclaration", + "scope": 757, + "src": "996:23:10", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 751, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "996:7:10", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "978:42:10" + }, + "returnParameters": { + "id": 756, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 755, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 757, + "src": "1039:4:10", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 754, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "1039:4:10", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "src": "1038:6:10" + }, + "scope": 758, + "src": "952:93:10", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + } + ], + "scope": 759, + "src": "139:908:10", + "usedErrors": [], + "usedEvents": [ + 6081, + 6090 + ] + } + ], + "src": "46:1002:10" + }, + "id": 10 + }, + "@graphprotocol/contracts/contracts/utils/TokenUtils.sol": { + "ast": { + "absolutePath": "@graphprotocol/contracts/contracts/utils/TokenUtils.sol", + "exportedSymbols": { + "IERC20": [ + 6147 + ], + "IGraphToken": [ + 758 + ], + "TokenUtils": [ + 840 + ] + }, + "id": 841, + "license": "GPL-2.0-or-later", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 760, + "literals": [ + "solidity", + "^", + "0.7", + ".6", + "||", + "0.8", + ".27" + ], + "nodeType": "PragmaDirective", + "src": "46:33:11" + }, + { + "absolutePath": "@graphprotocol/contracts/contracts/token/IGraphToken.sol", + "file": "../token/IGraphToken.sol", + "id": 761, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 841, + "sourceUnit": 759, + "src": "81:34:11", + "symbolAliases": [], + "unitAlias": "" + }, + { + "abstract": false, + "baseContracts": [], + "canonicalName": "TokenUtils", + "contractDependencies": [], + "contractKind": "library", + "documentation": { + "id": 762, + "nodeType": "StructuredDocumentation", + "src": "117:239:11", + "text": " @title TokenUtils library\n @notice This library contains utility functions for handling tokens (transfers and burns).\n It is specifically adapted for the GraphToken, so does not need to handle edge cases\n for other tokens." + }, + "fullyImplemented": true, + "id": 840, + "linearizedBaseContracts": [ + 840 + ], + "name": "TokenUtils", + "nameLocation": "365:10:11", + "nodeType": "ContractDefinition", + "nodes": [ + { + "body": { + "id": 791, + "nodeType": "Block", + "src": "684:135:11", + "statements": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 775, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 773, + "name": "_amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 770, + "src": "698:7:11", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "hexValue": "30", + "id": 774, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "708:1:11", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "698:11:11", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 790, + "nodeType": "IfStatement", + "src": "694:119:11", + "trueBody": { + "id": 789, + "nodeType": "Block", + "src": "711:102:11", + "statements": [ + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "id": 779, + "name": "_from", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 768, + "src": "758:5:11", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "arguments": [ + { + "id": 782, + "name": "this", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -28, + "src": "773:4:11", + "typeDescriptions": { + "typeIdentifier": "t_contract$_TokenUtils_$840", + "typeString": "library TokenUtils" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_TokenUtils_$840", + "typeString": "library TokenUtils" + } + ], + "id": 781, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "765:7:11", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 780, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "765:7:11", + "typeDescriptions": {} + } + }, + "id": 783, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "765:13:11", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 784, + "name": "_amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 770, + "src": "780:7:11", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "id": 777, + "name": "_graphToken", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 766, + "src": "733:11:11", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IGraphToken_$758", + "typeString": "contract IGraphToken" + } + }, + "id": 778, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "745:12:11", + "memberName": "transferFrom", + "nodeType": "MemberAccess", + "referencedDeclaration": 6146, + "src": "733:24:11", + "typeDescriptions": { + "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$_t_bool_$", + "typeString": "function (address,address,uint256) external returns (bool)" + } + }, + "id": 785, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "733:55:11", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "hexValue": "217472616e73666572", + "id": 786, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "790:11:11", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_aaf3daf27360df170a52f29a0edeebb3d20b8e3dc84a13c5eaf056803b549f50", + "typeString": "literal_string \"!transfer\"" + }, + "value": "!transfer" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_aaf3daf27360df170a52f29a0edeebb3d20b8e3dc84a13c5eaf056803b549f50", + "typeString": "literal_string \"!transfer\"" + } + ], + "id": 776, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "725:7:11", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 787, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "725:77:11", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 788, + "nodeType": "ExpressionStatement", + "src": "725:77:11" + } + ] + } + } + ] + }, + "documentation": { + "id": 763, + "nodeType": "StructuredDocumentation", + "src": "382:211:11", + "text": " @dev Pull tokens from an address to this contract.\n @param _graphToken Token to transfer\n @param _from Address sending the tokens\n @param _amount Amount of tokens to transfer" + }, + "id": 792, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "pullTokens", + "nameLocation": "607:10:11", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 771, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 766, + "mutability": "mutable", + "name": "_graphToken", + "nameLocation": "630:11:11", + "nodeType": "VariableDeclaration", + "scope": 792, + "src": "618:23:11", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IGraphToken_$758", + "typeString": "contract IGraphToken" + }, + "typeName": { + "id": 765, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 764, + "name": "IGraphToken", + "nameLocations": [ + "618:11:11" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 758, + "src": "618:11:11" + }, + "referencedDeclaration": 758, + "src": "618:11:11", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IGraphToken_$758", + "typeString": "contract IGraphToken" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 768, + "mutability": "mutable", + "name": "_from", + "nameLocation": "651:5:11", + "nodeType": "VariableDeclaration", + "scope": 792, + "src": "643:13:11", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 767, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "643:7:11", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 770, + "mutability": "mutable", + "name": "_amount", + "nameLocation": "666:7:11", + "nodeType": "VariableDeclaration", + "scope": 792, + "src": "658:15:11", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 769, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "658:7:11", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "617:57:11" + }, + "returnParameters": { + "id": 772, + "nodeType": "ParameterList", + "parameters": [], + "src": "684:0:11" + }, + "scope": 840, + "src": "598:221:11", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 817, + "nodeType": "Block", + "src": "1134:114:11", + "statements": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 805, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 803, + "name": "_amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 800, + "src": "1148:7:11", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "hexValue": "30", + "id": 804, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1158:1:11", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "1148:11:11", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 816, + "nodeType": "IfStatement", + "src": "1144:98:11", + "trueBody": { + "id": 815, + "nodeType": "Block", + "src": "1161:81:11", + "statements": [ + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "id": 809, + "name": "_to", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 798, + "src": "1204:3:11", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 810, + "name": "_amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 800, + "src": "1209:7:11", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "id": 807, + "name": "_graphToken", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 796, + "src": "1183:11:11", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IGraphToken_$758", + "typeString": "contract IGraphToken" + } + }, + "id": 808, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "1195:8:11", + "memberName": "transfer", + "nodeType": "MemberAccess", + "referencedDeclaration": 6114, + "src": "1183:20:11", + "typeDescriptions": { + "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$returns$_t_bool_$", + "typeString": "function (address,uint256) external returns (bool)" + } + }, + "id": 811, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "1183:34:11", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "hexValue": "217472616e73666572", + "id": 812, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1219:11:11", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_aaf3daf27360df170a52f29a0edeebb3d20b8e3dc84a13c5eaf056803b549f50", + "typeString": "literal_string \"!transfer\"" + }, + "value": "!transfer" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_aaf3daf27360df170a52f29a0edeebb3d20b8e3dc84a13c5eaf056803b549f50", + "typeString": "literal_string \"!transfer\"" + } + ], + "id": 806, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "1175:7:11", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 813, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "1175:56:11", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 814, + "nodeType": "ExpressionStatement", + "src": "1175:56:11" + } + ] + } + } + ] + }, + "documentation": { + "id": 793, + "nodeType": "StructuredDocumentation", + "src": "825:220:11", + "text": " @dev Push tokens from this contract to a receiving address.\n @param _graphToken Token to transfer\n @param _to Address receiving the tokens\n @param _amount Amount of tokens to transfer" + }, + "id": 818, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "pushTokens", + "nameLocation": "1059:10:11", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 801, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 796, + "mutability": "mutable", + "name": "_graphToken", + "nameLocation": "1082:11:11", + "nodeType": "VariableDeclaration", + "scope": 818, + "src": "1070:23:11", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IGraphToken_$758", + "typeString": "contract IGraphToken" + }, + "typeName": { + "id": 795, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 794, + "name": "IGraphToken", + "nameLocations": [ + "1070:11:11" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 758, + "src": "1070:11:11" + }, + "referencedDeclaration": 758, + "src": "1070:11:11", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IGraphToken_$758", + "typeString": "contract IGraphToken" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 798, + "mutability": "mutable", + "name": "_to", + "nameLocation": "1103:3:11", + "nodeType": "VariableDeclaration", + "scope": 818, + "src": "1095:11:11", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 797, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1095:7:11", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 800, + "mutability": "mutable", + "name": "_amount", + "nameLocation": "1116:7:11", + "nodeType": "VariableDeclaration", + "scope": 818, + "src": "1108:15:11", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 799, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1108:7:11", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "1069:55:11" + }, + "returnParameters": { + "id": 802, + "nodeType": "ParameterList", + "parameters": [], + "src": "1134:0:11" + }, + "scope": 840, + "src": "1050:198:11", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 838, + "nodeType": "Block", + "src": "1475:83:11", + "statements": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 829, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 827, + "name": "_amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 824, + "src": "1489:7:11", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "hexValue": "30", + "id": 828, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1499:1:11", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "1489:11:11", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 837, + "nodeType": "IfStatement", + "src": "1485:67:11", + "trueBody": { + "id": 836, + "nodeType": "Block", + "src": "1502:50:11", + "statements": [ + { + "expression": { + "arguments": [ + { + "id": 833, + "name": "_amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 824, + "src": "1533:7:11", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "id": 830, + "name": "_graphToken", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 822, + "src": "1516:11:11", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IGraphToken_$758", + "typeString": "contract IGraphToken" + } + }, + "id": 832, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "1528:4:11", + "memberName": "burn", + "nodeType": "MemberAccess", + "referencedDeclaration": 688, + "src": "1516:16:11", + "typeDescriptions": { + "typeIdentifier": "t_function_external_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256) external" + } + }, + "id": 834, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "1516:25:11", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 835, + "nodeType": "ExpressionStatement", + "src": "1516:25:11" + } + ] + } + } + ] + }, + "documentation": { + "id": 819, + "nodeType": "StructuredDocumentation", + "src": "1254:145:11", + "text": " @dev Burn tokens held by this contract.\n @param _graphToken Token to burn\n @param _amount Amount of tokens to burn" + }, + "id": 839, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "burnTokens", + "nameLocation": "1413:10:11", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 825, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 822, + "mutability": "mutable", + "name": "_graphToken", + "nameLocation": "1436:11:11", + "nodeType": "VariableDeclaration", + "scope": 839, + "src": "1424:23:11", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IGraphToken_$758", + "typeString": "contract IGraphToken" + }, + "typeName": { + "id": 821, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 820, + "name": "IGraphToken", + "nameLocations": [ + "1424:11:11" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 758, + "src": "1424:11:11" + }, + "referencedDeclaration": 758, + "src": "1424:11:11", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IGraphToken_$758", + "typeString": "contract IGraphToken" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 824, + "mutability": "mutable", + "name": "_amount", + "nameLocation": "1457:7:11", + "nodeType": "VariableDeclaration", + "scope": 839, + "src": "1449:15:11", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 823, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1449:7:11", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "1423:42:11" + }, + "returnParameters": { + "id": 826, + "nodeType": "ParameterList", + "parameters": [], + "src": "1475:0:11" + }, + "scope": 840, + "src": "1404:154:11", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + } + ], + "scope": 841, + "src": "357:1203:11", + "usedErrors": [], + "usedEvents": [] + } + ], + "src": "46:1515:11" + }, + "id": 11 + }, + "@graphprotocol/horizon/contracts/data-service/DataService.sol": { + "ast": { + "absolutePath": "@graphprotocol/horizon/contracts/data-service/DataService.sol", + "exportedSymbols": { + "DataService": [ + 936 + ], + "DataServiceV1Storage": [ + 945 + ], + "GraphDirectory": [ + 4928 + ], + "IDataService": [ + 1557 + ], + "ProvisionManager": [ + 2395 + ] + }, + "id": 937, + "license": "GPL-3.0-or-later", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 842, + "literals": [ + "solidity", + "0.8", + ".27" + ], + "nodeType": "PragmaDirective", + "src": "45:23:12" + }, + { + "absolutePath": "@graphprotocol/horizon/contracts/data-service/interfaces/IDataService.sol", + "file": "./interfaces/IDataService.sol", + "id": 844, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 937, + "sourceUnit": 1558, + "src": "70:61:12", + "symbolAliases": [ + { + "foreign": { + "id": 843, + "name": "IDataService", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1557, + "src": "79:12:12", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "@graphprotocol/horizon/contracts/data-service/DataServiceStorage.sol", + "file": "./DataServiceStorage.sol", + "id": 846, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 937, + "sourceUnit": 946, + "src": "133:64:12", + "symbolAliases": [ + { + "foreign": { + "id": 845, + "name": "DataServiceV1Storage", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 945, + "src": "142:20:12", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "@graphprotocol/horizon/contracts/utilities/GraphDirectory.sol", + "file": "../utilities/GraphDirectory.sol", + "id": 848, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 937, + "sourceUnit": 4929, + "src": "198:65:12", + "symbolAliases": [ + { + "foreign": { + "id": 847, + "name": "GraphDirectory", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4928, + "src": "207:14:12", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "@graphprotocol/horizon/contracts/data-service/utilities/ProvisionManager.sol", + "file": "./utilities/ProvisionManager.sol", + "id": 850, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 937, + "sourceUnit": 2396, + "src": "264:68:12", + "symbolAliases": [ + { + "foreign": { + "id": 849, + "name": "ProvisionManager", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2395, + "src": "273:16:12", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "abstract": true, + "baseContracts": [ + { + "baseName": { + "id": 852, + "name": "GraphDirectory", + "nameLocations": [ + "1871:14:12" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 4928, + "src": "1871:14:12" + }, + "id": 853, + "nodeType": "InheritanceSpecifier", + "src": "1871:14:12" + }, + { + "baseName": { + "id": 854, + "name": "ProvisionManager", + "nameLocations": [ + "1887:16:12" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 2395, + "src": "1887:16:12" + }, + "id": 855, + "nodeType": "InheritanceSpecifier", + "src": "1887:16:12" + }, + { + "baseName": { + "id": 856, + "name": "DataServiceV1Storage", + "nameLocations": [ + "1905:20:12" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 945, + "src": "1905:20:12" + }, + "id": 857, + "nodeType": "InheritanceSpecifier", + "src": "1905:20:12" + }, + { + "baseName": { + "id": 858, + "name": "IDataService", + "nameLocations": [ + "1927:12:12" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 1557, + "src": "1927:12:12" + }, + "id": 859, + "nodeType": "InheritanceSpecifier", + "src": "1927:12:12" + } + ], + "canonicalName": "DataService", + "contractDependencies": [], + "contractKind": "contract", + "documentation": { + "id": 851, + "nodeType": "StructuredDocumentation", + "src": "334:1503:12", + "text": " @title DataService contract\n @dev Implementation of the {IDataService} interface.\n @notice This implementation provides base functionality for a data service:\n - GraphDirectory, allows the data service to interact with Graph Horizon contracts\n - ProvisionManager, provides functionality to manage provisions\n The derived contract MUST implement all the interfaces described in {IDataService} and in\n accordance with the Data Service framework.\n @dev A note on upgradeability: this base contract can be inherited by upgradeable or non upgradeable\n contracts.\n - If the data service implementation is upgradeable, it must initialize the contract via an external\n initializer function with the `initializer` modifier that calls {__DataService_init} or\n {__DataService_init_unchained}. It's recommended the implementation constructor to also call\n {_disableInitializers} to prevent the implementation from being initialized.\n - If the data service implementation is NOT upgradeable, it must initialize the contract by calling\n {__DataService_init} or {__DataService_init_unchained} in the constructor. Note that the `initializer`\n will be required in the constructor.\n - Note that in both cases if using {__DataService_init_unchained} variant the corresponding parent\n initializers must be called in the implementation.\n @custom:security-contact Please email security+contracts@thegraph.com if you find any\n bugs. We may have an active bug bounty program." + }, + "fullyImplemented": false, + "id": 936, + "linearizedBaseContracts": [ + 936, + 1557, + 945, + 2395, + 2425, + 4928, + 5391 + ], + "name": "DataService", + "nameLocation": "1856:11:12", + "nodeType": "ContractDefinition", + "nodes": [ + { + "body": { + "id": 868, + "nodeType": "Block", + "src": "2198:2:12", + "statements": [] + }, + "documentation": { + "id": 860, + "nodeType": "StructuredDocumentation", + "src": "1946:188:12", + "text": " @dev Addresses in GraphDirectory are immutables, they can only be set in this constructor.\n @param controller The address of the Graph Horizon controller contract." + }, + "id": 869, + "implemented": true, + "kind": "constructor", + "modifiers": [ + { + "arguments": [ + { + "id": 865, + "name": "controller", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 862, + "src": "2186:10:12", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "id": 866, + "kind": "baseConstructorSpecifier", + "modifierName": { + "id": 864, + "name": "GraphDirectory", + "nameLocations": [ + "2171:14:12" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 4928, + "src": "2171:14:12" + }, + "nodeType": "ModifierInvocation", + "src": "2171:26:12" + } + ], + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 863, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 862, + "mutability": "mutable", + "name": "controller", + "nameLocation": "2159:10:12", + "nodeType": "VariableDeclaration", + "scope": 869, + "src": "2151:18:12", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 861, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2151:7:12", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "2150:20:12" + }, + "returnParameters": { + "id": 867, + "nodeType": "ParameterList", + "parameters": [], + "src": "2198:0:12" + }, + "scope": 936, + "src": "2139:61:12", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + }, + { + "baseFunctions": [ + 1534 + ], + "body": { + "id": 880, + "nodeType": "Block", + "src": "2311:48:12", + "statements": [ + { + "expression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 877, + "name": "_getThawingPeriodRange", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2317, + "src": "2328:22:12", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint64_$_t_uint64_$", + "typeString": "function () view returns (uint64,uint64)" + } + }, + "id": 878, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2328:24:12", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_uint64_$_t_uint64_$", + "typeString": "tuple(uint64,uint64)" + } + }, + "functionReturnParameters": 876, + "id": 879, + "nodeType": "Return", + "src": "2321:31:12" + } + ] + }, + "documentation": { + "id": 870, + "nodeType": "StructuredDocumentation", + "src": "2206:28:12", + "text": "@inheritdoc IDataService" + }, + "functionSelector": "71ce020a", + "id": 881, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getThawingPeriodRange", + "nameLocation": "2248:21:12", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 871, + "nodeType": "ParameterList", + "parameters": [], + "src": "2269:2:12" + }, + "returnParameters": { + "id": 876, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 873, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 881, + "src": "2295:6:12", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + }, + "typeName": { + "id": 872, + "name": "uint64", + "nodeType": "ElementaryTypeName", + "src": "2295:6:12", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 875, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 881, + "src": "2303:6:12", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + }, + "typeName": { + "id": 874, + "name": "uint64", + "nodeType": "ElementaryTypeName", + "src": "2303:6:12", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "visibility": "internal" + } + ], + "src": "2294:16:12" + }, + "scope": 936, + "src": "2239:120:12", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "baseFunctions": [ + 1542 + ], + "body": { + "id": 892, + "nodeType": "Block", + "src": "2468:46:12", + "statements": [ + { + "expression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 889, + "name": "_getVerifierCutRange", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2330, + "src": "2485:20:12", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint32_$_t_uint32_$", + "typeString": "function () view returns (uint32,uint32)" + } + }, + "id": 890, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2485:22:12", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_uint32_$_t_uint32_$", + "typeString": "tuple(uint32,uint32)" + } + }, + "functionReturnParameters": 888, + "id": 891, + "nodeType": "Return", + "src": "2478:29:12" + } + ] + }, + "documentation": { + "id": 882, + "nodeType": "StructuredDocumentation", + "src": "2365:28:12", + "text": "@inheritdoc IDataService" + }, + "functionSelector": "482468b7", + "id": 893, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getVerifierCutRange", + "nameLocation": "2407:19:12", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 883, + "nodeType": "ParameterList", + "parameters": [], + "src": "2426:2:12" + }, + "returnParameters": { + "id": 888, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 885, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 893, + "src": "2452:6:12", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 884, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "2452:6:12", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 887, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 893, + "src": "2460:6:12", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 886, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "2460:6:12", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + } + ], + "src": "2451:16:12" + }, + "scope": 936, + "src": "2398:116:12", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "baseFunctions": [ + 1550 + ], + "body": { + "id": 904, + "nodeType": "Block", + "src": "2629:50:12", + "statements": [ + { + "expression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 901, + "name": "_getProvisionTokensRange", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2304, + "src": "2646:24:12", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$_t_uint256_$", + "typeString": "function () view returns (uint256,uint256)" + } + }, + "id": 902, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2646:26:12", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$", + "typeString": "tuple(uint256,uint256)" + } + }, + "functionReturnParameters": 900, + "id": 903, + "nodeType": "Return", + "src": "2639:33:12" + } + ] + }, + "documentation": { + "id": 894, + "nodeType": "StructuredDocumentation", + "src": "2520:28:12", + "text": "@inheritdoc IDataService" + }, + "functionSelector": "819ba366", + "id": 905, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getProvisionTokensRange", + "nameLocation": "2562:23:12", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 895, + "nodeType": "ParameterList", + "parameters": [], + "src": "2585:2:12" + }, + "returnParameters": { + "id": 900, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 897, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 905, + "src": "2611:7:12", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 896, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2611:7:12", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 899, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 905, + "src": "2620:7:12", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 898, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2620:7:12", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "2610:18:12" + }, + "scope": 936, + "src": "2553:126:12", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "baseFunctions": [ + 1556 + ], + "body": { + "id": 914, + "nodeType": "Block", + "src": "2779:45:12", + "statements": [ + { + "expression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 911, + "name": "_getDelegationRatio", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2291, + "src": "2796:19:12", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint32_$", + "typeString": "function () view returns (uint32)" + } + }, + "id": 912, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2796:21:12", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "functionReturnParameters": 910, + "id": 913, + "nodeType": "Return", + "src": "2789:28:12" + } + ] + }, + "documentation": { + "id": 906, + "nodeType": "StructuredDocumentation", + "src": "2685:28:12", + "text": "@inheritdoc IDataService" + }, + "functionSelector": "1ebb7c30", + "id": 915, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getDelegationRatio", + "nameLocation": "2727:18:12", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 907, + "nodeType": "ParameterList", + "parameters": [], + "src": "2745:2:12" + }, + "returnParameters": { + "id": 910, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 909, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 915, + "src": "2771:6:12", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 908, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "2771:6:12", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + } + ], + "src": "2770:8:12" + }, + "scope": 936, + "src": "2718:106:12", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "body": { + "id": 927, + "nodeType": "Block", + "src": "2968:92:12", + "statements": [ + { + "expression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 921, + "name": "__ProvisionManager_init_unchained", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2024, + "src": "2978:33:12", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$__$returns$__$", + "typeString": "function ()" + } + }, + "id": 922, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2978:35:12", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 923, + "nodeType": "ExpressionStatement", + "src": "2978:35:12" + }, + { + "expression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 924, + "name": "__DataService_init_unchained", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 935, + "src": "3023:28:12", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$__$returns$__$", + "typeString": "function ()" + } + }, + "id": 925, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3023:30:12", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 926, + "nodeType": "ExpressionStatement", + "src": "3023:30:12" + } + ] + }, + "documentation": { + "id": 916, + "nodeType": "StructuredDocumentation", + "src": "2830:77:12", + "text": " @notice Initializes the contract and any parent contracts." + }, + "id": 928, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "id": 919, + "kind": "modifierInvocation", + "modifierName": { + "id": 918, + "name": "onlyInitializing", + "nameLocations": [ + "2951:16:12" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5286, + "src": "2951:16:12" + }, + "nodeType": "ModifierInvocation", + "src": "2951:16:12" + } + ], + "name": "__DataService_init", + "nameLocation": "2921:18:12", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 917, + "nodeType": "ParameterList", + "parameters": [], + "src": "2939:2:12" + }, + "returnParameters": { + "id": 920, + "nodeType": "ParameterList", + "parameters": [], + "src": "2968:0:12" + }, + "scope": 936, + "src": "2912:148:12", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 934, + "nodeType": "Block", + "src": "3189:2:12", + "statements": [] + }, + "documentation": { + "id": 929, + "nodeType": "StructuredDocumentation", + "src": "3066:52:12", + "text": " @notice Initializes the contract." + }, + "id": 935, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "id": 932, + "kind": "modifierInvocation", + "modifierName": { + "id": 931, + "name": "onlyInitializing", + "nameLocations": [ + "3172:16:12" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5286, + "src": "3172:16:12" + }, + "nodeType": "ModifierInvocation", + "src": "3172:16:12" + } + ], + "name": "__DataService_init_unchained", + "nameLocation": "3132:28:12", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 930, + "nodeType": "ParameterList", + "parameters": [], + "src": "3160:2:12" + }, + "returnParameters": { + "id": 933, + "nodeType": "ParameterList", + "parameters": [], + "src": "3189:0:12" + }, + "scope": 936, + "src": "3123:68:12", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + } + ], + "scope": 937, + "src": "1838:1355:12", + "usedErrors": [ + 1918, + 1925, + 1932, + 1937, + 4655, + 5140, + 5143 + ], + "usedEvents": [ + 1437, + 1442, + 1449, + 1456, + 1466, + 1473, + 1888, + 1893, + 1900, + 1907, + 4650, + 5148 + ] + } + ], + "src": "45:3149:12" + }, + "id": 12 + }, + "@graphprotocol/horizon/contracts/data-service/DataServiceStorage.sol": { + "ast": { + "absolutePath": "@graphprotocol/horizon/contracts/data-service/DataServiceStorage.sol", + "exportedSymbols": { + "DataServiceV1Storage": [ + 945 + ] + }, + "id": 946, + "license": "GPL-3.0-or-later", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 938, + "literals": [ + "solidity", + "0.8", + ".27" + ], + "nodeType": "PragmaDirective", + "src": "45:23:13" + }, + { + "abstract": true, + "baseContracts": [], + "canonicalName": "DataServiceV1Storage", + "contractDependencies": [], + "contractKind": "contract", + "documentation": { + "id": 939, + "nodeType": "StructuredDocumentation", + "src": "70:256:13", + "text": " @title DataServiceStorage\n @dev This contract holds the storage variables for the DataService contract.\n @custom:security-contact Please email security+contracts@thegraph.com if you find any\n bugs. We may have an active bug bounty program." + }, + "fullyImplemented": true, + "id": 945, + "linearizedBaseContracts": [ + 945 + ], + "name": "DataServiceV1Storage", + "nameLocation": "345:20:13", + "nodeType": "ContractDefinition", + "nodes": [ + { + "constant": false, + "documentation": { + "id": 940, + "nodeType": "StructuredDocumentation", + "src": "372:158:13", + "text": "@dev Gap to allow adding variables in future upgrades\n Note that this contract is not upgradeable but might be inherited by an upgradeable contract" + }, + "id": 944, + "mutability": "mutable", + "name": "__gap", + "nameLocation": "555:5:13", + "nodeType": "VariableDeclaration", + "scope": 945, + "src": "535:25:13", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$50_storage", + "typeString": "uint256[50]" + }, + "typeName": { + "baseType": { + "id": 941, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "535:7:13", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 943, + "length": { + "hexValue": "3530", + "id": 942, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "543:2:13", + "typeDescriptions": { + "typeIdentifier": "t_rational_50_by_1", + "typeString": "int_const 50" + }, + "value": "50" + }, + "nodeType": "ArrayTypeName", + "src": "535:11:13", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$50_storage_ptr", + "typeString": "uint256[50]" + } + }, + "visibility": "private" + } + ], + "scope": 946, + "src": "327:236:13", + "usedErrors": [], + "usedEvents": [] + } + ], + "src": "45:519:13" + }, + "id": 13 + }, + "@graphprotocol/horizon/contracts/data-service/extensions/DataServiceFees.sol": { + "ast": { + "absolutePath": "@graphprotocol/horizon/contracts/data-service/extensions/DataServiceFees.sol", + "exportedSymbols": { + "DataService": [ + 936 + ], + "DataServiceFees": [ + 1278 + ], + "DataServiceFeesV1Storage": [ + 1308 + ], + "IDataServiceFees": [ + 1620 + ], + "LinkedList": [ + 4364 + ], + "ProvisionTracker": [ + 1801 + ] + }, + "id": 1279, + "license": "GPL-3.0-or-later", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 947, + "literals": [ + "solidity", + "0.8", + ".27" + ], + "nodeType": "PragmaDirective", + "src": "45:23:14" + }, + { + "absolutePath": "@graphprotocol/horizon/contracts/data-service/interfaces/IDataServiceFees.sol", + "file": "../interfaces/IDataServiceFees.sol", + "id": 949, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 1279, + "sourceUnit": 1621, + "src": "70:70:14", + "symbolAliases": [ + { + "foreign": { + "id": 948, + "name": "IDataServiceFees", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1620, + "src": "79:16:14", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "@graphprotocol/horizon/contracts/data-service/libraries/ProvisionTracker.sol", + "file": "../libraries/ProvisionTracker.sol", + "id": 951, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 1279, + "sourceUnit": 1802, + "src": "142:69:14", + "symbolAliases": [ + { + "foreign": { + "id": 950, + "name": "ProvisionTracker", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1801, + "src": "151:16:14", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "@graphprotocol/horizon/contracts/libraries/LinkedList.sol", + "file": "../../libraries/LinkedList.sol", + "id": 953, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 1279, + "sourceUnit": 4365, + "src": "212:60:14", + "symbolAliases": [ + { + "foreign": { + "id": 952, + "name": "LinkedList", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4364, + "src": "221:10:14", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "@graphprotocol/horizon/contracts/data-service/DataService.sol", + "file": "../DataService.sol", + "id": 955, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 1279, + "sourceUnit": 937, + "src": "274:49:14", + "symbolAliases": [ + { + "foreign": { + "id": 954, + "name": "DataService", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 936, + "src": "283:11:14", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "@graphprotocol/horizon/contracts/data-service/extensions/DataServiceFeesStorage.sol", + "file": "./DataServiceFeesStorage.sol", + "id": 957, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 1279, + "sourceUnit": 1309, + "src": "324:72:14", + "symbolAliases": [ + { + "foreign": { + "id": 956, + "name": "DataServiceFeesV1Storage", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1308, + "src": "333:24:14", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "abstract": true, + "baseContracts": [ + { + "baseName": { + "id": 959, + "name": "DataService", + "nameLocations": [ + "974:11:14" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 936, + "src": "974:11:14" + }, + "id": 960, + "nodeType": "InheritanceSpecifier", + "src": "974:11:14" + }, + { + "baseName": { + "id": 961, + "name": "DataServiceFeesV1Storage", + "nameLocations": [ + "987:24:14" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 1308, + "src": "987:24:14" + }, + "id": 962, + "nodeType": "InheritanceSpecifier", + "src": "987:24:14" + }, + { + "baseName": { + "id": 963, + "name": "IDataServiceFees", + "nameLocations": [ + "1013:16:14" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 1620, + "src": "1013:16:14" + }, + "id": 964, + "nodeType": "InheritanceSpecifier", + "src": "1013:16:14" + } + ], + "canonicalName": "DataServiceFees", + "contractDependencies": [], + "contractKind": "contract", + "documentation": { + "id": 958, + "nodeType": "StructuredDocumentation", + "src": "398:538:14", + "text": " @title DataServiceFees contract\n @dev Implementation of the {IDataServiceFees} interface.\n @notice Extension for the {IDataService} contract to handle payment collateralization\n using a Horizon provision. See {IDataServiceFees} for more details.\n @dev This contract inherits from {DataService} which needs to be initialized, please see\n {DataService} for detailed instructions.\n @custom:security-contact Please email security+contracts@thegraph.com if you find any\n bugs. We may have an active bug bounty program." + }, + "fullyImplemented": false, + "id": 1278, + "internalFunctionIDs": { + "1199": 1, + "1211": 2, + "1254": 3 + }, + "linearizedBaseContracts": [ + 1278, + 1620, + 1308, + 936, + 1557, + 945, + 2395, + 2425, + 4928, + 5391 + ], + "name": "DataServiceFees", + "nameLocation": "955:15:14", + "nodeType": "ContractDefinition", + "nodes": [ + { + "global": false, + "id": 969, + "libraryName": { + "id": 965, + "name": "ProvisionTracker", + "nameLocations": [ + "1042:16:14" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 1801, + "src": "1042:16:14" + }, + "nodeType": "UsingForDirective", + "src": "1036:55:14", + "typeName": { + "id": 968, + "keyName": "", + "keyNameLocation": "-1:-1:-1", + "keyType": { + "id": 966, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1071:7:14", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "1063:27:14", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", + "typeString": "mapping(address => uint256)" + }, + "valueName": "", + "valueNameLocation": "-1:-1:-1", + "valueType": { + "id": 967, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1082:7:14", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + } + }, + { + "global": false, + "id": 973, + "libraryName": { + "id": 970, + "name": "LinkedList", + "nameLocations": [ + "1102:10:14" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 4364, + "src": "1102:10:14" + }, + "nodeType": "UsingForDirective", + "src": "1096:37:14", + "typeName": { + "id": 972, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 971, + "name": "LinkedList.List", + "nameLocations": [ + "1117:10:14", + "1128:4:14" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 4090, + "src": "1117:15:14" + }, + "referencedDeclaration": 4090, + "src": "1117:15:14", + "typeDescriptions": { + "typeIdentifier": "t_struct$_List_$4090_storage_ptr", + "typeString": "struct LinkedList.List" + } + } + }, + { + "baseFunctions": [ + 1619 + ], + "body": { + "id": 986, + "nodeType": "Block", + "src": "1252:62:14", + "statements": [ + { + "expression": { + "arguments": [ + { + "expression": { + "id": 981, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "1276:3:14", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 982, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "1280:6:14", + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "1276:10:14", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 983, + "name": "numClaimsToRelease", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 976, + "src": "1288:18:14", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 980, + "name": "_releaseStake", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1121, + "src": "1262:13:14", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,uint256)" + } + }, + "id": 984, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "1262:45:14", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 985, + "nodeType": "ExpressionStatement", + "src": "1262:45:14" + } + ] + }, + "documentation": { + "id": 974, + "nodeType": "StructuredDocumentation", + "src": "1139:32:14", + "text": "@inheritdoc IDataServiceFees" + }, + "functionSelector": "45f54485", + "id": 987, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "releaseStake", + "nameLocation": "1185:12:14", + "nodeType": "FunctionDefinition", + "overrides": { + "id": 978, + "nodeType": "OverrideSpecifier", + "overrides": [], + "src": "1243:8:14" + }, + "parameters": { + "id": 977, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 976, + "mutability": "mutable", + "name": "numClaimsToRelease", + "nameLocation": "1206:18:14", + "nodeType": "VariableDeclaration", + "scope": 987, + "src": "1198:26:14", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 975, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1198:7:14", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "1197:28:14" + }, + "returnParameters": { + "id": 979, + "nodeType": "ParameterList", + "parameters": [], + "src": "1252:0:14" + }, + "scope": 1278, + "src": "1176:138:14", + "stateMutability": "nonpayable", + "virtual": true, + "visibility": "external" + }, + { + "body": { + "id": 1073, + "nodeType": "Block", + "src": "1963:762:14", + "statements": [ + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 1000, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 998, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 992, + "src": "1981:7:14", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "hexValue": "30", + "id": 999, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1992:1:14", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "1981:12:14", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 1001, + "name": "DataServiceFeesZeroTokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1613, + "src": "1995:25:14", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$__$returns$_t_error_$", + "typeString": "function () pure returns (error)" + } + }, + "id": 1002, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "1995:27:14", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 997, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "1973:7:14", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 1003, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "1973:50:14", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1004, + "nodeType": "ExpressionStatement", + "src": "1973:50:14" + }, + { + "expression": { + "arguments": [ + { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 1008, + "name": "_graphStaking", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4815, + "src": "2059:13:14", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_contract$_IHorizonStaking_$2625_$", + "typeString": "function () view returns (contract IHorizonStaking)" + } + }, + "id": 1009, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2059:15:14", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_IHorizonStaking_$2625", + "typeString": "contract IHorizonStaking" + } + }, + { + "id": 1010, + "name": "_serviceProvider", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 990, + "src": "2076:16:14", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 1011, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 992, + "src": "2094:7:14", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 1012, + "name": "_delegationRatio", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2419, + "src": "2103:16:14", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_IHorizonStaking_$2625", + "typeString": "contract IHorizonStaking" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + ], + "expression": { + "id": 1005, + "name": "feesProvisionTracker", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1290, + "src": "2033:20:14", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", + "typeString": "mapping(address => uint256)" + } + }, + "id": 1007, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "2054:4:14", + "memberName": "lock", + "nodeType": "MemberAccess", + "referencedDeclaration": 1726, + "src": "2033:25:14", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_mapping$_t_address_$_t_uint256_$_$_t_contract$_IHorizonStaking_$2625_$_t_address_$_t_uint256_$_t_uint32_$returns$__$attached_to$_t_mapping$_t_address_$_t_uint256_$_$", + "typeString": "function (mapping(address => uint256),contract IHorizonStaking,address,uint256,uint32)" + } + }, + "id": 1013, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2033:87:14", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1014, + "nodeType": "ExpressionStatement", + "src": "2033:87:14" + }, + { + "assignments": [ + 1019 + ], + "declarations": [ + { + "constant": false, + "id": 1019, + "mutability": "mutable", + "name": "claimsList", + "nameLocation": "2155:10:14", + "nodeType": "VariableDeclaration", + "scope": 1073, + "src": "2131:34:14", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_List_$4090_storage_ptr", + "typeString": "struct LinkedList.List" + }, + "typeName": { + "id": 1018, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 1017, + "name": "LinkedList.List", + "nameLocations": [ + "2131:10:14", + "2142:4:14" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 4090, + "src": "2131:15:14" + }, + "referencedDeclaration": 4090, + "src": "2131:15:14", + "typeDescriptions": { + "typeIdentifier": "t_struct$_List_$4090_storage_ptr", + "typeString": "struct LinkedList.List" + } + }, + "visibility": "internal" + } + ], + "id": 1023, + "initialValue": { + "baseExpression": { + "id": 1020, + "name": "claimsLists", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1302, + "src": "2168:11:14", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_List_$4090_storage_$", + "typeString": "mapping(address => struct LinkedList.List storage ref)" + } + }, + "id": 1022, + "indexExpression": { + "id": 1021, + "name": "_serviceProvider", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 990, + "src": "2180:16:14", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "2168:29:14", + "typeDescriptions": { + "typeIdentifier": "t_struct$_List_$4090_storage", + "typeString": "struct LinkedList.List storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "2131:66:14" + }, + { + "assignments": [ + 1025 + ], + "declarations": [ + { + "constant": false, + "id": 1025, + "mutability": "mutable", + "name": "claimId", + "nameLocation": "2253:7:14", + "nodeType": "VariableDeclaration", + "scope": 1073, + "src": "2245:15:14", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 1024, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "2245:7:14", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "id": 1031, + "initialValue": { + "arguments": [ + { + "id": 1027, + "name": "_serviceProvider", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 990, + "src": "2282:16:14", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "expression": { + "id": 1028, + "name": "claimsList", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1019, + "src": "2300:10:14", + "typeDescriptions": { + "typeIdentifier": "t_struct$_List_$4090_storage_ptr", + "typeString": "struct LinkedList.List storage pointer" + } + }, + "id": 1029, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "2311:5:14", + "memberName": "nonce", + "nodeType": "MemberAccess", + "referencedDeclaration": 4087, + "src": "2300:16:14", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 1026, + "name": "_buildStakeClaimId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1277, + "src": "2263:18:14", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_address_$_t_uint256_$returns$_t_bytes32_$", + "typeString": "function (address,uint256) view returns (bytes32)" + } + }, + "id": 1030, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2263:54:14", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "2245:72:14" + }, + { + "expression": { + "id": 1045, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "baseExpression": { + "id": 1032, + "name": "claims", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1296, + "src": "2327:6:14", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_StakeClaim_$1574_storage_$", + "typeString": "mapping(bytes32 => struct IDataServiceFees.StakeClaim storage ref)" + } + }, + "id": 1034, + "indexExpression": { + "id": 1033, + "name": "claimId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1025, + "src": "2334:7:14", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "2327:15:14", + "typeDescriptions": { + "typeIdentifier": "t_struct$_StakeClaim_$1574_storage", + "typeString": "struct IDataServiceFees.StakeClaim storage ref" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "id": 1036, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 992, + "src": "2378:7:14", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "expression": { + "id": 1037, + "name": "block", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -4, + "src": "2410:5:14", + "typeDescriptions": { + "typeIdentifier": "t_magic_block", + "typeString": "block" + } + }, + "id": 1038, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "2416:9:14", + "memberName": "timestamp", + "nodeType": "MemberAccess", + "src": "2410:15:14", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 1039, + "name": "_unlockTimestamp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 994, + "src": "2453:16:14", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "arguments": [ + { + "hexValue": "30", + "id": 1042, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2502:1:14", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 1041, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "2494:7:14", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes32_$", + "typeString": "type(bytes32)" + }, + "typeName": { + "id": 1040, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "2494:7:14", + "typeDescriptions": {} + } + }, + "id": 1043, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2494:10:14", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 1035, + "name": "StakeClaim", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1574, + "src": "2345:10:14", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_struct$_StakeClaim_$1574_storage_ptr_$", + "typeString": "type(struct IDataServiceFees.StakeClaim storage pointer)" + } + }, + "id": 1044, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "structConstructorCall", + "lValueRequested": false, + "nameLocations": [ + "2370:6:14", + "2399:9:14", + "2439:12:14", + "2483:9:14" + ], + "names": [ + "tokens", + "createdAt", + "releasableAt", + "nextClaim" + ], + "nodeType": "FunctionCall", + "src": "2345:170:14", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_StakeClaim_$1574_memory_ptr", + "typeString": "struct IDataServiceFees.StakeClaim memory" + } + }, + "src": "2327:188:14", + "typeDescriptions": { + "typeIdentifier": "t_struct$_StakeClaim_$1574_storage", + "typeString": "struct IDataServiceFees.StakeClaim storage ref" + } + }, + "id": 1046, + "nodeType": "ExpressionStatement", + "src": "2327:188:14" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 1050, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 1047, + "name": "claimsList", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1019, + "src": "2529:10:14", + "typeDescriptions": { + "typeIdentifier": "t_struct$_List_$4090_storage_ptr", + "typeString": "struct LinkedList.List storage pointer" + } + }, + "id": 1048, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "2540:5:14", + "memberName": "count", + "nodeType": "MemberAccess", + "referencedDeclaration": 4089, + "src": "2529:16:14", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "hexValue": "30", + "id": 1049, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2549:1:14", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "2529:21:14", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 1059, + "nodeType": "IfStatement", + "src": "2525:70:14", + "trueBody": { + "expression": { + "id": 1057, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "baseExpression": { + "id": 1051, + "name": "claims", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1296, + "src": "2552:6:14", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_StakeClaim_$1574_storage_$", + "typeString": "mapping(bytes32 => struct IDataServiceFees.StakeClaim storage ref)" + } + }, + "id": 1054, + "indexExpression": { + "expression": { + "id": 1052, + "name": "claimsList", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1019, + "src": "2559:10:14", + "typeDescriptions": { + "typeIdentifier": "t_struct$_List_$4090_storage_ptr", + "typeString": "struct LinkedList.List storage pointer" + } + }, + "id": 1053, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "2570:4:14", + "memberName": "tail", + "nodeType": "MemberAccess", + "referencedDeclaration": 4085, + "src": "2559:15:14", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "2552:23:14", + "typeDescriptions": { + "typeIdentifier": "t_struct$_StakeClaim_$1574_storage", + "typeString": "struct IDataServiceFees.StakeClaim storage ref" + } + }, + "id": 1055, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberLocation": "2576:9:14", + "memberName": "nextClaim", + "nodeType": "MemberAccess", + "referencedDeclaration": 1573, + "src": "2552:33:14", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "id": 1056, + "name": "claimId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1025, + "src": "2588:7:14", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "src": "2552:43:14", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "id": 1058, + "nodeType": "ExpressionStatement", + "src": "2552:43:14" + } + }, + { + "expression": { + "arguments": [ + { + "id": 1063, + "name": "claimId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1025, + "src": "2624:7:14", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "expression": { + "id": 1060, + "name": "claimsList", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1019, + "src": "2605:10:14", + "typeDescriptions": { + "typeIdentifier": "t_struct$_List_$4090_storage_ptr", + "typeString": "struct LinkedList.List storage pointer" + } + }, + "id": 1062, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "2616:7:14", + "memberName": "addTail", + "nodeType": "MemberAccess", + "referencedDeclaration": 4172, + "src": "2605:18:14", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_struct$_List_$4090_storage_ptr_$_t_bytes32_$returns$__$attached_to$_t_struct$_List_$4090_storage_ptr_$", + "typeString": "function (struct LinkedList.List storage pointer,bytes32)" + } + }, + "id": 1064, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2605:27:14", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1065, + "nodeType": "ExpressionStatement", + "src": "2605:27:14" + }, + { + "eventCall": { + "arguments": [ + { + "id": 1067, + "name": "_serviceProvider", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 990, + "src": "2665:16:14", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 1068, + "name": "claimId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1025, + "src": "2683:7:14", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "id": 1069, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 992, + "src": "2692:7:14", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 1070, + "name": "_unlockTimestamp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 994, + "src": "2701:16:14", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 1066, + "name": "StakeClaimLocked", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1585, + "src": "2648:16:14", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_bytes32_$_t_uint256_$_t_uint256_$returns$__$", + "typeString": "function (address,bytes32,uint256,uint256)" + } + }, + "id": 1071, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2648:70:14", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1072, + "nodeType": "EmitStatement", + "src": "2643:75:14" + } + ] + }, + "documentation": { + "id": 988, + "nodeType": "StructuredDocumentation", + "src": "1320:540:14", + "text": " @notice Locks stake for a service provider to back a payment.\n Creates a stake claim, which is stored in a linked list by service provider.\n @dev Requirements:\n - The associated provision must have enough available tokens to lock the stake.\n Emits a {StakeClaimLocked} event.\n @param _serviceProvider The address of the service provider\n @param _tokens The amount of tokens to lock in the claim\n @param _unlockTimestamp The timestamp when the tokens can be released" + }, + "id": 1074, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_lockStake", + "nameLocation": "1874:10:14", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 995, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 990, + "mutability": "mutable", + "name": "_serviceProvider", + "nameLocation": "1893:16:14", + "nodeType": "VariableDeclaration", + "scope": 1074, + "src": "1885:24:14", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 989, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1885:7:14", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 992, + "mutability": "mutable", + "name": "_tokens", + "nameLocation": "1919:7:14", + "nodeType": "VariableDeclaration", + "scope": 1074, + "src": "1911:15:14", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 991, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1911:7:14", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 994, + "mutability": "mutable", + "name": "_unlockTimestamp", + "nameLocation": "1936:16:14", + "nodeType": "VariableDeclaration", + "scope": 1074, + "src": "1928:24:14", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 993, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1928:7:14", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "1884:69:14" + }, + "returnParameters": { + "id": 996, + "nodeType": "ParameterList", + "parameters": [], + "src": "1963:0:14" + }, + "scope": 1278, + "src": "1865:860:14", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 1120, + "nodeType": "Block", + "src": "3546:439:14", + "statements": [ + { + "assignments": [ + 1086 + ], + "declarations": [ + { + "constant": false, + "id": 1086, + "mutability": "mutable", + "name": "claimsList", + "nameLocation": "3580:10:14", + "nodeType": "VariableDeclaration", + "scope": 1120, + "src": "3556:34:14", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_List_$4090_storage_ptr", + "typeString": "struct LinkedList.List" + }, + "typeName": { + "id": 1085, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 1084, + "name": "LinkedList.List", + "nameLocations": [ + "3556:10:14", + "3567:4:14" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 4090, + "src": "3556:15:14" + }, + "referencedDeclaration": 4090, + "src": "3556:15:14", + "typeDescriptions": { + "typeIdentifier": "t_struct$_List_$4090_storage_ptr", + "typeString": "struct LinkedList.List" + } + }, + "visibility": "internal" + } + ], + "id": 1090, + "initialValue": { + "baseExpression": { + "id": 1087, + "name": "claimsLists", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1302, + "src": "3593:11:14", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_List_$4090_storage_$", + "typeString": "mapping(address => struct LinkedList.List storage ref)" + } + }, + "id": 1089, + "indexExpression": { + "id": 1088, + "name": "_serviceProvider", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1077, + "src": "3605:16:14", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3593:29:14", + "typeDescriptions": { + "typeIdentifier": "t_struct$_List_$4090_storage", + "typeString": "struct LinkedList.List storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "3556:66:14" + }, + { + "assignments": [ + 1092, + 1094 + ], + "declarations": [ + { + "constant": false, + "id": 1092, + "mutability": "mutable", + "name": "claimsReleased", + "nameLocation": "3641:14:14", + "nodeType": "VariableDeclaration", + "scope": 1120, + "src": "3633:22:14", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1091, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "3633:7:14", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 1094, + "mutability": "mutable", + "name": "data", + "nameLocation": "3670:4:14", + "nodeType": "VariableDeclaration", + "scope": 1120, + "src": "3657:17:14", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 1093, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "3657:5:14", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "id": 1107, + "initialValue": { + "arguments": [ + { + "id": 1097, + "name": "_getNextStakeClaim", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1254, + "src": "3711:18:14", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_bytes32_$", + "typeString": "function (bytes32) view returns (bytes32)" + } + }, + { + "id": 1098, + "name": "_processStakeClaim", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1199, + "src": "3743:18:14", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$_t_bytes_memory_ptr_$returns$_t_bool_$_t_bytes_memory_ptr_$", + "typeString": "function (bytes32,bytes memory) returns (bool,bytes memory)" + } + }, + { + "id": 1099, + "name": "_deleteStakeClaim", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1211, + "src": "3775:17:14", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$returns$__$", + "typeString": "function (bytes32)" + } + }, + { + "arguments": [ + { + "hexValue": "30", + "id": 1102, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3817:1:14", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + { + "id": 1103, + "name": "_serviceProvider", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1077, + "src": "3820:16:14", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "expression": { + "id": 1100, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -1, + "src": "3806:3:14", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 1101, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "3810:6:14", + "memberName": "encode", + "nodeType": "MemberAccess", + "src": "3806:10:14", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencode_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 1104, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3806:31:14", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + { + "id": 1105, + "name": "_numClaimsToRelease", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1079, + "src": "3851:19:14", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_bytes32_$", + "typeString": "function (bytes32) view returns (bytes32)" + }, + { + "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$_t_bytes_memory_ptr_$returns$_t_bool_$_t_bytes_memory_ptr_$", + "typeString": "function (bytes32,bytes memory) returns (bool,bytes memory)" + }, + { + "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$returns$__$", + "typeString": "function (bytes32)" + }, + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "id": 1095, + "name": "claimsList", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1086, + "src": "3678:10:14", + "typeDescriptions": { + "typeIdentifier": "t_struct$_List_$4090_storage_ptr", + "typeString": "struct LinkedList.List storage pointer" + } + }, + "id": 1096, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "3689:8:14", + "memberName": "traverse", + "nodeType": "MemberAccess", + "referencedDeclaration": 4363, + "src": "3678:19:14", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_struct$_List_$4090_storage_ptr_$_t_function_internal_view$_t_bytes32_$returns$_t_bytes32_$_$_t_function_internal_nonpayable$_t_bytes32_$_t_bytes_memory_ptr_$returns$_t_bool_$_t_bytes_memory_ptr_$_$_t_function_internal_nonpayable$_t_bytes32_$returns$__$_$_t_bytes_memory_ptr_$_t_uint256_$returns$_t_uint256_$_t_bytes_memory_ptr_$attached_to$_t_struct$_List_$4090_storage_ptr_$", + "typeString": "function (struct LinkedList.List storage pointer,function (bytes32) view returns (bytes32),function (bytes32,bytes memory) returns (bool,bytes memory),function (bytes32),bytes memory,uint256) returns (uint256,bytes memory)" + } + }, + "id": 1106, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3678:202:14", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_uint256_$_t_bytes_memory_ptr_$", + "typeString": "tuple(uint256,bytes memory)" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "3632:248:14" + }, + { + "eventCall": { + "arguments": [ + { + "id": 1109, + "name": "_serviceProvider", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1077, + "src": "3916:16:14", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 1110, + "name": "claimsReleased", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1092, + "src": "3934:14:14", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "arguments": [ + { + "id": 1113, + "name": "data", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1094, + "src": "3961:4:14", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + { + "components": [ + { + "id": 1115, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "3968:7:14", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + }, + "typeName": { + "id": 1114, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "3968:7:14", + "typeDescriptions": {} + } + } + ], + "id": 1116, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "3967:9:14", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + }, + { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + } + ], + "expression": { + "id": 1111, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -1, + "src": "3950:3:14", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 1112, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "3954:6:14", + "memberName": "decode", + "nodeType": "MemberAccess", + "src": "3950:10:14", + "typeDescriptions": { + "typeIdentifier": "t_function_abidecode_pure$__$returns$__$", + "typeString": "function () pure" + } + }, + "id": 1117, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3950:27:14", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 1108, + "name": "StakeClaimsReleased", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1605, + "src": "3896:19:14", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_uint256_$_t_uint256_$returns$__$", + "typeString": "function (address,uint256,uint256)" + } + }, + "id": 1118, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3896:82:14", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1119, + "nodeType": "EmitStatement", + "src": "3891:87:14" + } + ] + }, + "documentation": { + "id": 1075, + "nodeType": "StructuredDocumentation", + "src": "2731:723:14", + "text": " @notice Releases expired stake claims for a service provider.\n @dev This function can be overriden and/or disabled.\n @dev Note that the list is traversed by creation date not by releasableAt date. Traversing will stop\n when the first stake claim that is not yet expired is found even if later stake claims have expired. This\n could happen if stake claims are genereted with different unlock periods.\n @dev Emits a {StakeClaimsReleased} event, and a {StakeClaimReleased} event for each claim released.\n @param _serviceProvider The address of the service provider\n @param _numClaimsToRelease Amount of stake claims to process. If 0, all stake claims are processed." + }, + "id": 1121, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_releaseStake", + "nameLocation": "3468:13:14", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1080, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1077, + "mutability": "mutable", + "name": "_serviceProvider", + "nameLocation": "3490:16:14", + "nodeType": "VariableDeclaration", + "scope": 1121, + "src": "3482:24:14", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1076, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3482:7:14", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 1079, + "mutability": "mutable", + "name": "_numClaimsToRelease", + "nameLocation": "3516:19:14", + "nodeType": "VariableDeclaration", + "scope": 1121, + "src": "3508:27:14", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1078, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "3508:7:14", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "3481:55:14" + }, + "returnParameters": { + "id": 1081, + "nodeType": "ParameterList", + "parameters": [], + "src": "3546:0:14" + }, + "scope": 1278, + "src": "3459:526:14", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 1198, + "nodeType": "Block", + "src": "4563:624:14", + "statements": [ + { + "assignments": [ + 1135 + ], + "declarations": [ + { + "constant": false, + "id": 1135, + "mutability": "mutable", + "name": "claim", + "nameLocation": "4591:5:14", + "nodeType": "VariableDeclaration", + "scope": 1198, + "src": "4573:23:14", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_StakeClaim_$1574_memory_ptr", + "typeString": "struct IDataServiceFees.StakeClaim" + }, + "typeName": { + "id": 1134, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 1133, + "name": "StakeClaim", + "nameLocations": [ + "4573:10:14" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 1574, + "src": "4573:10:14" + }, + "referencedDeclaration": 1574, + "src": "4573:10:14", + "typeDescriptions": { + "typeIdentifier": "t_struct$_StakeClaim_$1574_storage_ptr", + "typeString": "struct IDataServiceFees.StakeClaim" + } + }, + "visibility": "internal" + } + ], + "id": 1139, + "initialValue": { + "arguments": [ + { + "id": 1137, + "name": "_claimId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1124, + "src": "4614:8:14", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 1136, + "name": "_getStakeClaim", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1240, + "src": "4599:14:14", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_struct$_StakeClaim_$1574_memory_ptr_$", + "typeString": "function (bytes32) view returns (struct IDataServiceFees.StakeClaim memory)" + } + }, + "id": 1138, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4599:24:14", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_StakeClaim_$1574_memory_ptr", + "typeString": "struct IDataServiceFees.StakeClaim memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "4573:50:14" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 1144, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 1140, + "name": "claim", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1135, + "src": "4660:5:14", + "typeDescriptions": { + "typeIdentifier": "t_struct$_StakeClaim_$1574_memory_ptr", + "typeString": "struct IDataServiceFees.StakeClaim memory" + } + }, + "id": 1141, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "4666:12:14", + "memberName": "releasableAt", + "nodeType": "MemberAccess", + "referencedDeclaration": 1571, + "src": "4660:18:14", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "expression": { + "id": 1142, + "name": "block", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -4, + "src": "4681:5:14", + "typeDescriptions": { + "typeIdentifier": "t_magic_block", + "typeString": "block" + } + }, + "id": 1143, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "4687:9:14", + "memberName": "timestamp", + "nodeType": "MemberAccess", + "src": "4681:15:14", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "4660:36:14", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 1151, + "nodeType": "IfStatement", + "src": "4656:103:14", + "trueBody": { + "id": 1150, + "nodeType": "Block", + "src": "4698:61:14", + "statements": [ + { + "expression": { + "components": [ + { + "hexValue": "74727565", + "id": 1145, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4720:4:14", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "true" + }, + { + "expression": { + "id": 1146, + "name": "LinkedList", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4364, + "src": "4726:10:14", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_LinkedList_$4364_$", + "typeString": "type(library LinkedList)" + } + }, + "id": 1147, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "4737:10:14", + "memberName": "NULL_BYTES", + "nodeType": "MemberAccess", + "referencedDeclaration": 4097, + "src": "4726:21:14", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "id": 1148, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "4719:29:14", + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_bool_$_t_bytes_memory_ptr_$", + "typeString": "tuple(bool,bytes memory)" + } + }, + "functionReturnParameters": 1132, + "id": 1149, + "nodeType": "Return", + "src": "4712:36:14" + } + ] + } + }, + { + "assignments": [ + 1153, + 1155 + ], + "declarations": [ + { + "constant": false, + "id": 1153, + "mutability": "mutable", + "name": "tokensClaimed", + "nameLocation": "4796:13:14", + "nodeType": "VariableDeclaration", + "scope": 1198, + "src": "4788:21:14", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1152, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "4788:7:14", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 1155, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "4819:15:14", + "nodeType": "VariableDeclaration", + "scope": 1198, + "src": "4811:23:14", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1154, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4811:7:14", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "id": 1165, + "initialValue": { + "arguments": [ + { + "id": 1158, + "name": "_acc", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1126, + "src": "4849:4:14", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + { + "components": [ + { + "id": 1160, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "4856:7:14", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + }, + "typeName": { + "id": 1159, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "4856:7:14", + "typeDescriptions": {} + } + }, + { + "id": 1162, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "4865:7:14", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 1161, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4865:7:14", + "typeDescriptions": {} + } + } + ], + "id": 1163, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "4855:18:14", + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_type$_t_uint256_$_$_t_type$_t_address_$_$", + "typeString": "tuple(type(uint256),type(address))" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + }, + { + "typeIdentifier": "t_tuple$_t_type$_t_uint256_$_$_t_type$_t_address_$_$", + "typeString": "tuple(type(uint256),type(address))" + } + ], + "expression": { + "id": 1156, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -1, + "src": "4838:3:14", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 1157, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "4842:6:14", + "memberName": "decode", + "nodeType": "MemberAccess", + "src": "4838:10:14", + "typeDescriptions": { + "typeIdentifier": "t_function_abidecode_pure$__$returns$__$", + "typeString": "function () pure" + } + }, + "id": 1164, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4838:36:14", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_uint256_$_t_address_payable_$", + "typeString": "tuple(uint256,address payable)" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "4787:87:14" + }, + { + "expression": { + "arguments": [ + { + "id": 1169, + "name": "serviceProvider", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1155, + "src": "4933:15:14", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "expression": { + "id": 1170, + "name": "claim", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1135, + "src": "4950:5:14", + "typeDescriptions": { + "typeIdentifier": "t_struct$_StakeClaim_$1574_memory_ptr", + "typeString": "struct IDataServiceFees.StakeClaim memory" + } + }, + "id": 1171, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "4956:6:14", + "memberName": "tokens", + "nodeType": "MemberAccess", + "referencedDeclaration": 1567, + "src": "4950:12:14", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "id": 1166, + "name": "feesProvisionTracker", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1290, + "src": "4904:20:14", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", + "typeString": "mapping(address => uint256)" + } + }, + "id": 1168, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "4925:7:14", + "memberName": "release", + "nodeType": "MemberAccess", + "referencedDeclaration": 1764, + "src": "4904:28:14", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_mapping$_t_address_$_t_uint256_$_$_t_address_$_t_uint256_$returns$__$attached_to$_t_mapping$_t_address_$_t_uint256_$_$", + "typeString": "function (mapping(address => uint256),address,uint256)" + } + }, + "id": 1172, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4904:59:14", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1173, + "nodeType": "ExpressionStatement", + "src": "4904:59:14" + }, + { + "eventCall": { + "arguments": [ + { + "id": 1175, + "name": "serviceProvider", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1155, + "src": "4997:15:14", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 1176, + "name": "_claimId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1124, + "src": "5014:8:14", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "expression": { + "id": 1177, + "name": "claim", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1135, + "src": "5024:5:14", + "typeDescriptions": { + "typeIdentifier": "t_struct$_StakeClaim_$1574_memory_ptr", + "typeString": "struct IDataServiceFees.StakeClaim memory" + } + }, + "id": 1178, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "5030:6:14", + "memberName": "tokens", + "nodeType": "MemberAccess", + "referencedDeclaration": 1567, + "src": "5024:12:14", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "expression": { + "id": 1179, + "name": "claim", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1135, + "src": "5038:5:14", + "typeDescriptions": { + "typeIdentifier": "t_struct$_StakeClaim_$1574_memory_ptr", + "typeString": "struct IDataServiceFees.StakeClaim memory" + } + }, + "id": 1180, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "5044:12:14", + "memberName": "releasableAt", + "nodeType": "MemberAccess", + "referencedDeclaration": 1571, + "src": "5038:18:14", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 1174, + "name": "StakeClaimReleased", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1596, + "src": "4978:18:14", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_bytes32_$_t_uint256_$_t_uint256_$returns$__$", + "typeString": "function (address,bytes32,uint256,uint256)" + } + }, + "id": 1181, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4978:79:14", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1182, + "nodeType": "EmitStatement", + "src": "4973:84:14" + }, + { + "expression": { + "id": 1192, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 1183, + "name": "_acc", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1126, + "src": "5086:4:14", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 1189, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 1186, + "name": "tokensClaimed", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1153, + "src": "5104:13:14", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "expression": { + "id": 1187, + "name": "claim", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1135, + "src": "5120:5:14", + "typeDescriptions": { + "typeIdentifier": "t_struct$_StakeClaim_$1574_memory_ptr", + "typeString": "struct IDataServiceFees.StakeClaim memory" + } + }, + "id": 1188, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "5126:6:14", + "memberName": "tokens", + "nodeType": "MemberAccess", + "referencedDeclaration": 1567, + "src": "5120:12:14", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "5104:28:14", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 1190, + "name": "serviceProvider", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1155, + "src": "5134:15:14", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "expression": { + "id": 1184, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -1, + "src": "5093:3:14", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 1185, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "5097:6:14", + "memberName": "encode", + "nodeType": "MemberAccess", + "src": "5093:10:14", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencode_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 1191, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5093:57:14", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "src": "5086:64:14", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 1193, + "nodeType": "ExpressionStatement", + "src": "5086:64:14" + }, + { + "expression": { + "components": [ + { + "hexValue": "66616c7365", + "id": 1194, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "5168:5:14", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + }, + { + "id": 1195, + "name": "_acc", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1126, + "src": "5175:4:14", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "id": 1196, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "5167:13:14", + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_bool_$_t_bytes_memory_ptr_$", + "typeString": "tuple(bool,bytes memory)" + } + }, + "functionReturnParameters": 1132, + "id": 1197, + "nodeType": "Return", + "src": "5160:20:14" + } + ] + }, + "documentation": { + "id": 1122, + "nodeType": "StructuredDocumentation", + "src": "3991:465:14", + "text": " @notice Processes a stake claim, releasing the tokens if the claim has expired.\n @dev This function is used as a callback in the stake claims linked list traversal.\n @param _claimId The id of the stake claim\n @param _acc The accumulator for the stake claims being processed\n @return Whether the stake claim is still locked, indicating that the traversal should continue or stop.\n @return The updated accumulator data" + }, + "id": 1199, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_processStakeClaim", + "nameLocation": "4470:18:14", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1127, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1124, + "mutability": "mutable", + "name": "_claimId", + "nameLocation": "4497:8:14", + "nodeType": "VariableDeclaration", + "scope": 1199, + "src": "4489:16:14", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 1123, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "4489:7:14", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 1126, + "mutability": "mutable", + "name": "_acc", + "nameLocation": "4520:4:14", + "nodeType": "VariableDeclaration", + "scope": 1199, + "src": "4507:17:14", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 1125, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "4507:5:14", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "src": "4488:37:14" + }, + "returnParameters": { + "id": 1132, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1129, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 1199, + "src": "4543:4:14", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 1128, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "4543:4:14", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 1131, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 1199, + "src": "4549:12:14", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 1130, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "4549:5:14", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "src": "4542:20:14" + }, + "scope": 1278, + "src": "4461:726:14", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "private" + }, + { + "body": { + "id": 1210, + "nodeType": "Block", + "src": "5450:40:14", + "statements": [ + { + "expression": { + "id": 1208, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "delete", + "prefix": true, + "src": "5460:23:14", + "subExpression": { + "baseExpression": { + "id": 1205, + "name": "claims", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1296, + "src": "5467:6:14", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_StakeClaim_$1574_storage_$", + "typeString": "mapping(bytes32 => struct IDataServiceFees.StakeClaim storage ref)" + } + }, + "id": 1207, + "indexExpression": { + "id": 1206, + "name": "_claimId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1202, + "src": "5474:8:14", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "5467:16:14", + "typeDescriptions": { + "typeIdentifier": "t_struct$_StakeClaim_$1574_storage", + "typeString": "struct IDataServiceFees.StakeClaim storage ref" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1209, + "nodeType": "ExpressionStatement", + "src": "5460:23:14" + } + ] + }, + "documentation": { + "id": 1200, + "nodeType": "StructuredDocumentation", + "src": "5193:199:14", + "text": " @notice Deletes a stake claim.\n @dev This function is used as a callback in the stake claims linked list traversal.\n @param _claimId The ID of the stake claim to delete" + }, + "id": 1211, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_deleteStakeClaim", + "nameLocation": "5406:17:14", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1203, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1202, + "mutability": "mutable", + "name": "_claimId", + "nameLocation": "5432:8:14", + "nodeType": "VariableDeclaration", + "scope": 1211, + "src": "5424:16:14", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 1201, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "5424:7:14", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "5423:18:14" + }, + "returnParameters": { + "id": 1204, + "nodeType": "ParameterList", + "parameters": [], + "src": "5450:0:14" + }, + "scope": 1278, + "src": "5397:93:14", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "private" + }, + { + "body": { + "id": 1239, + "nodeType": "Block", + "src": "5732:160:14", + "statements": [ + { + "assignments": [ + 1222 + ], + "declarations": [ + { + "constant": false, + "id": 1222, + "mutability": "mutable", + "name": "claim", + "nameLocation": "5760:5:14", + "nodeType": "VariableDeclaration", + "scope": 1239, + "src": "5742:23:14", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_StakeClaim_$1574_memory_ptr", + "typeString": "struct IDataServiceFees.StakeClaim" + }, + "typeName": { + "id": 1221, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 1220, + "name": "StakeClaim", + "nameLocations": [ + "5742:10:14" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 1574, + "src": "5742:10:14" + }, + "referencedDeclaration": 1574, + "src": "5742:10:14", + "typeDescriptions": { + "typeIdentifier": "t_struct$_StakeClaim_$1574_storage_ptr", + "typeString": "struct IDataServiceFees.StakeClaim" + } + }, + "visibility": "internal" + } + ], + "id": 1226, + "initialValue": { + "baseExpression": { + "id": 1223, + "name": "claims", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1296, + "src": "5768:6:14", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_StakeClaim_$1574_storage_$", + "typeString": "mapping(bytes32 => struct IDataServiceFees.StakeClaim storage ref)" + } + }, + "id": 1225, + "indexExpression": { + "id": 1224, + "name": "_claimId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1214, + "src": "5775:8:14", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "5768:16:14", + "typeDescriptions": { + "typeIdentifier": "t_struct$_StakeClaim_$1574_storage", + "typeString": "struct IDataServiceFees.StakeClaim storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "5742:42:14" + }, + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 1231, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 1228, + "name": "claim", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1222, + "src": "5802:5:14", + "typeDescriptions": { + "typeIdentifier": "t_struct$_StakeClaim_$1574_memory_ptr", + "typeString": "struct IDataServiceFees.StakeClaim memory" + } + }, + "id": 1229, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "5808:9:14", + "memberName": "createdAt", + "nodeType": "MemberAccess", + "referencedDeclaration": 1569, + "src": "5802:15:14", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "hexValue": "30", + "id": 1230, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "5821:1:14", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "5802:20:14", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [ + { + "id": 1233, + "name": "_claimId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1214, + "src": "5853:8:14", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 1232, + "name": "DataServiceFeesClaimNotFound", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1610, + "src": "5824:28:14", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_bytes32_$returns$_t_error_$", + "typeString": "function (bytes32) pure returns (error)" + } + }, + "id": 1234, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5824:38:14", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 1227, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "5794:7:14", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 1235, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5794:69:14", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1236, + "nodeType": "ExpressionStatement", + "src": "5794:69:14" + }, + { + "expression": { + "id": 1237, + "name": "claim", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1222, + "src": "5880:5:14", + "typeDescriptions": { + "typeIdentifier": "t_struct$_StakeClaim_$1574_memory_ptr", + "typeString": "struct IDataServiceFees.StakeClaim memory" + } + }, + "functionReturnParameters": 1219, + "id": 1238, + "nodeType": "Return", + "src": "5873:12:14" + } + ] + }, + "documentation": { + "id": 1212, + "nodeType": "StructuredDocumentation", + "src": "5496:148:14", + "text": " @notice Gets the details of a stake claim\n @param _claimId The ID of the stake claim\n @return The stake claim details" + }, + "id": 1240, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_getStakeClaim", + "nameLocation": "5658:14:14", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1215, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1214, + "mutability": "mutable", + "name": "_claimId", + "nameLocation": "5681:8:14", + "nodeType": "VariableDeclaration", + "scope": 1240, + "src": "5673:16:14", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 1213, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "5673:7:14", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "5672:18:14" + }, + "returnParameters": { + "id": 1219, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1218, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 1240, + "src": "5713:17:14", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_StakeClaim_$1574_memory_ptr", + "typeString": "struct IDataServiceFees.StakeClaim" + }, + "typeName": { + "id": 1217, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 1216, + "name": "StakeClaim", + "nameLocations": [ + "5713:10:14" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 1574, + "src": "5713:10:14" + }, + "referencedDeclaration": 1574, + "src": "5713:10:14", + "typeDescriptions": { + "typeIdentifier": "t_struct$_StakeClaim_$1574_storage_ptr", + "typeString": "struct IDataServiceFees.StakeClaim" + } + }, + "visibility": "internal" + } + ], + "src": "5712:19:14" + }, + "scope": 1278, + "src": "5649:243:14", + "stateMutability": "view", + "virtual": false, + "visibility": "private" + }, + { + "body": { + "id": 1253, + "nodeType": "Block", + "src": "6230:50:14", + "statements": [ + { + "expression": { + "expression": { + "baseExpression": { + "id": 1248, + "name": "claims", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1296, + "src": "6247:6:14", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_StakeClaim_$1574_storage_$", + "typeString": "mapping(bytes32 => struct IDataServiceFees.StakeClaim storage ref)" + } + }, + "id": 1250, + "indexExpression": { + "id": 1249, + "name": "_claimId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1243, + "src": "6254:8:14", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "6247:16:14", + "typeDescriptions": { + "typeIdentifier": "t_struct$_StakeClaim_$1574_storage", + "typeString": "struct IDataServiceFees.StakeClaim storage ref" + } + }, + "id": 1251, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "6264:9:14", + "memberName": "nextClaim", + "nodeType": "MemberAccess", + "referencedDeclaration": 1573, + "src": "6247:26:14", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "functionReturnParameters": 1247, + "id": 1252, + "nodeType": "Return", + "src": "6240:33:14" + } + ] + }, + "documentation": { + "id": 1241, + "nodeType": "StructuredDocumentation", + "src": "5898:250:14", + "text": " @notice Gets the next stake claim in the linked list\n @dev This function is used as a callback in the stake claims linked list traversal.\n @param _claimId The ID of the stake claim\n @return The next stake claim ID" + }, + "id": 1254, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_getNextStakeClaim", + "nameLocation": "6162:18:14", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1244, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1243, + "mutability": "mutable", + "name": "_claimId", + "nameLocation": "6189:8:14", + "nodeType": "VariableDeclaration", + "scope": 1254, + "src": "6181:16:14", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 1242, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "6181:7:14", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "6180:18:14" + }, + "returnParameters": { + "id": 1247, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1246, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 1254, + "src": "6221:7:14", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 1245, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "6221:7:14", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "6220:9:14" + }, + "scope": 1278, + "src": "6153:127:14", + "stateMutability": "view", + "virtual": false, + "visibility": "private" + }, + { + "body": { + "id": 1276, + "nodeType": "Block", + "src": "6591:92:14", + "statements": [ + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "arguments": [ + { + "id": 1269, + "name": "this", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -28, + "src": "6643:4:14", + "typeDescriptions": { + "typeIdentifier": "t_contract$_DataServiceFees_$1278", + "typeString": "contract DataServiceFees" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_DataServiceFees_$1278", + "typeString": "contract DataServiceFees" + } + ], + "id": 1268, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "6635:7:14", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 1267, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6635:7:14", + "typeDescriptions": {} + } + }, + "id": 1270, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "6635:13:14", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 1271, + "name": "_serviceProvider", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1257, + "src": "6650:16:14", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 1272, + "name": "_nonce", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1259, + "src": "6668:6:14", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "id": 1265, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -1, + "src": "6618:3:14", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 1266, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "6622:12:14", + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "src": "6618:16:14", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 1273, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "6618:57:14", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 1264, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -8, + "src": "6608:9:14", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 1274, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "6608:68:14", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "functionReturnParameters": 1263, + "id": 1275, + "nodeType": "Return", + "src": "6601:75:14" + } + ] + }, + "documentation": { + "id": 1255, + "nodeType": "StructuredDocumentation", + "src": "6286:199:14", + "text": " @notice Builds a stake claim ID\n @param _serviceProvider The address of the service provider\n @param _nonce A nonce of the stake claim\n @return The stake claim ID" + }, + "id": 1277, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_buildStakeClaimId", + "nameLocation": "6499:18:14", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1260, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1257, + "mutability": "mutable", + "name": "_serviceProvider", + "nameLocation": "6526:16:14", + "nodeType": "VariableDeclaration", + "scope": 1277, + "src": "6518:24:14", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1256, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6518:7:14", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 1259, + "mutability": "mutable", + "name": "_nonce", + "nameLocation": "6552:6:14", + "nodeType": "VariableDeclaration", + "scope": 1277, + "src": "6544:14:14", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1258, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "6544:7:14", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "6517:42:14" + }, + "returnParameters": { + "id": 1263, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1262, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 1277, + "src": "6582:7:14", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 1261, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "6582:7:14", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "6581:9:14" + }, + "scope": 1278, + "src": "6490:193:14", + "stateMutability": "view", + "virtual": false, + "visibility": "private" + } + ], + "scope": 1279, + "src": "937:5748:14", + "usedErrors": [ + 1610, + 1613, + 1667, + 1918, + 1925, + 1932, + 1937, + 4104, + 4110, + 4655, + 5140, + 5143 + ], + "usedEvents": [ + 1437, + 1442, + 1449, + 1456, + 1466, + 1473, + 1585, + 1596, + 1605, + 1888, + 1893, + 1900, + 1907, + 4650, + 5148 + ] + } + ], + "src": "45:6641:14" + }, + "id": 14 + }, + "@graphprotocol/horizon/contracts/data-service/extensions/DataServiceFeesStorage.sol": { + "ast": { + "absolutePath": "@graphprotocol/horizon/contracts/data-service/extensions/DataServiceFeesStorage.sol", + "exportedSymbols": { + "DataServiceFeesV1Storage": [ + 1308 + ], + "IDataServiceFees": [ + 1620 + ], + "LinkedList": [ + 4364 + ] + }, + "id": 1309, + "license": "GPL-3.0-or-later", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 1280, + "literals": [ + "solidity", + "0.8", + ".27" + ], + "nodeType": "PragmaDirective", + "src": "45:23:15" + }, + { + "absolutePath": "@graphprotocol/horizon/contracts/data-service/interfaces/IDataServiceFees.sol", + "file": "../interfaces/IDataServiceFees.sol", + "id": 1282, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 1309, + "sourceUnit": 1621, + "src": "70:70:15", + "symbolAliases": [ + { + "foreign": { + "id": 1281, + "name": "IDataServiceFees", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1620, + "src": "79:16:15", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "@graphprotocol/horizon/contracts/libraries/LinkedList.sol", + "file": "../../libraries/LinkedList.sol", + "id": 1284, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 1309, + "sourceUnit": 4365, + "src": "142:60:15", + "symbolAliases": [ + { + "foreign": { + "id": 1283, + "name": "LinkedList", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4364, + "src": "151:10:15", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "abstract": true, + "baseContracts": [], + "canonicalName": "DataServiceFeesV1Storage", + "contractDependencies": [], + "contractKind": "contract", + "documentation": { + "id": 1285, + "nodeType": "StructuredDocumentation", + "src": "204:218:15", + "text": " @title Storage layout for the {DataServiceFees} extension contract.\n @custom:security-contact Please email security+contracts@thegraph.com if you find any\n bugs. We may have an active bug bounty program." + }, + "fullyImplemented": true, + "id": 1308, + "linearizedBaseContracts": [ + 1308 + ], + "name": "DataServiceFeesV1Storage", + "nameLocation": "441:24:15", + "nodeType": "ContractDefinition", + "nodes": [ + { + "constant": false, + "documentation": { + "id": 1286, + "nodeType": "StructuredDocumentation", + "src": "472:81:15", + "text": "@notice The amount of tokens locked in stake claims for each service provider" + }, + "functionSelector": "cbe5f3f2", + "id": 1290, + "mutability": "mutable", + "name": "feesProvisionTracker", + "nameLocation": "616:20:15", + "nodeType": "VariableDeclaration", + "scope": 1308, + "src": "558:78:15", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", + "typeString": "mapping(address => uint256)" + }, + "typeName": { + "id": 1289, + "keyName": "serviceProvider", + "keyNameLocation": "574:15:15", + "keyType": { + "id": 1287, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "566:7:15", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "558:50:15", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", + "typeString": "mapping(address => uint256)" + }, + "valueName": "tokens", + "valueNameLocation": "601:6:15", + "valueType": { + "id": 1288, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "593:7:15", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + }, + "visibility": "public" + }, + { + "constant": false, + "documentation": { + "id": 1291, + "nodeType": "StructuredDocumentation", + "src": "643:79:15", + "text": "@notice List of all locked stake claims to be released to service providers" + }, + "functionSelector": "eff0f592", + "id": 1296, + "mutability": "mutable", + "name": "claims", + "nameLocation": "796:6:15", + "nodeType": "VariableDeclaration", + "scope": 1308, + "src": "727:75:15", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_StakeClaim_$1574_storage_$", + "typeString": "mapping(bytes32 => struct IDataServiceFees.StakeClaim)" + }, + "typeName": { + "id": 1295, + "keyName": "claimId", + "keyNameLocation": "743:7:15", + "keyType": { + "id": 1292, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "735:7:15", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "Mapping", + "src": "727:61:15", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_StakeClaim_$1574_storage_$", + "typeString": "mapping(bytes32 => struct IDataServiceFees.StakeClaim)" + }, + "valueName": "claim", + "valueNameLocation": "782:5:15", + "valueType": { + "id": 1294, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 1293, + "name": "IDataServiceFees.StakeClaim", + "nameLocations": [ + "754:16:15", + "771:10:15" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 1574, + "src": "754:27:15" + }, + "referencedDeclaration": 1574, + "src": "754:27:15", + "typeDescriptions": { + "typeIdentifier": "t_struct$_StakeClaim_$1574_storage_ptr", + "typeString": "struct IDataServiceFees.StakeClaim" + } + } + }, + "visibility": "public" + }, + { + "constant": false, + "documentation": { + "id": 1297, + "nodeType": "StructuredDocumentation", + "src": "809:60:15", + "text": "@notice Service providers registered in the data service" + }, + "functionSelector": "13c474c9", + "id": 1302, + "mutability": "mutable", + "name": "claimsLists", + "nameLocation": "938:11:15", + "nodeType": "VariableDeclaration", + "scope": 1308, + "src": "874:75:15", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_List_$4090_storage_$", + "typeString": "mapping(address => struct LinkedList.List)" + }, + "typeName": { + "id": 1301, + "keyName": "serviceProvider", + "keyNameLocation": "890:15:15", + "keyType": { + "id": 1298, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "882:7:15", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "874:56:15", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_List_$4090_storage_$", + "typeString": "mapping(address => struct LinkedList.List)" + }, + "valueName": "list", + "valueNameLocation": "925:4:15", + "valueType": { + "id": 1300, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 1299, + "name": "LinkedList.List", + "nameLocations": [ + "909:10:15", + "920:4:15" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 4090, + "src": "909:15:15" + }, + "referencedDeclaration": 4090, + "src": "909:15:15", + "typeDescriptions": { + "typeIdentifier": "t_struct$_List_$4090_storage_ptr", + "typeString": "struct LinkedList.List" + } + } + }, + "visibility": "public" + }, + { + "constant": false, + "documentation": { + "id": 1303, + "nodeType": "StructuredDocumentation", + "src": "956:158:15", + "text": "@dev Gap to allow adding variables in future upgrades\n Note that this contract is not upgradeable but might be inherited by an upgradeable contract" + }, + "id": 1307, + "mutability": "mutable", + "name": "__gap", + "nameLocation": "1139:5:15", + "nodeType": "VariableDeclaration", + "scope": 1308, + "src": "1119:25:15", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$50_storage", + "typeString": "uint256[50]" + }, + "typeName": { + "baseType": { + "id": 1304, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1119:7:15", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 1306, + "length": { + "hexValue": "3530", + "id": 1305, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1127:2:15", + "typeDescriptions": { + "typeIdentifier": "t_rational_50_by_1", + "typeString": "int_const 50" + }, + "value": "50" + }, + "nodeType": "ArrayTypeName", + "src": "1119:11:15", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$50_storage_ptr", + "typeString": "uint256[50]" + } + }, + "visibility": "private" + } + ], + "scope": 1309, + "src": "423:724:15", + "usedErrors": [], + "usedEvents": [] + } + ], + "src": "45:1103:15" + }, + "id": 15 + }, + "@graphprotocol/horizon/contracts/data-service/extensions/DataServicePausableUpgradeable.sol": { + "ast": { + "absolutePath": "@graphprotocol/horizon/contracts/data-service/extensions/DataServicePausableUpgradeable.sol", + "exportedSymbols": { + "DataService": [ + 936 + ], + "DataServicePausableUpgradeable": [ + 1425 + ], + "IDataServicePausable": [ + 1655 + ], + "PausableUpgradeable": [ + 5700 + ] + }, + "id": 1426, + "license": "GPL-3.0-or-later", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 1310, + "literals": [ + "solidity", + "0.8", + ".27" + ], + "nodeType": "PragmaDirective", + "src": "45:23:16" + }, + { + "absolutePath": "@graphprotocol/horizon/contracts/data-service/interfaces/IDataServicePausable.sol", + "file": "../interfaces/IDataServicePausable.sol", + "id": 1312, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 1426, + "sourceUnit": 1656, + "src": "70:78:16", + "symbolAliases": [ + { + "foreign": { + "id": 1311, + "name": "IDataServicePausable", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1655, + "src": "79:20:16", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol", + "file": "@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol", + "id": 1314, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 1426, + "sourceUnit": 5701, + "src": "150:104:16", + "symbolAliases": [ + { + "foreign": { + "id": 1313, + "name": "PausableUpgradeable", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5700, + "src": "159:19:16", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "@graphprotocol/horizon/contracts/data-service/DataService.sol", + "file": "../DataService.sol", + "id": 1316, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 1426, + "sourceUnit": 937, + "src": "255:49:16", + "symbolAliases": [ + { + "foreign": { + "id": 1315, + "name": "DataService", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 936, + "src": "264:11:16", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "abstract": true, + "baseContracts": [ + { + "baseName": { + "id": 1318, + "name": "PausableUpgradeable", + "nameLocations": [ + "823:19:16" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5700, + "src": "823:19:16" + }, + "id": 1319, + "nodeType": "InheritanceSpecifier", + "src": "823:19:16" + }, + { + "baseName": { + "id": 1320, + "name": "DataService", + "nameLocations": [ + "844:11:16" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 936, + "src": "844:11:16" + }, + "id": 1321, + "nodeType": "InheritanceSpecifier", + "src": "844:11:16" + }, + { + "baseName": { + "id": 1322, + "name": "IDataServicePausable", + "nameLocations": [ + "857:20:16" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 1655, + "src": "857:20:16" + }, + "id": 1323, + "nodeType": "InheritanceSpecifier", + "src": "857:20:16" + } + ], + "canonicalName": "DataServicePausableUpgradeable", + "contractDependencies": [], + "contractKind": "contract", + "documentation": { + "id": 1317, + "nodeType": "StructuredDocumentation", + "src": "306:464:16", + "text": " @title DataServicePausableUpgradeable contract\n @dev Implementation of the {IDataServicePausable} interface.\n @dev Upgradeable version of the {DataServicePausable} contract.\n @dev This contract inherits from {DataService} which needs to be initialized, please see\n {DataService} for detailed instructions.\n @custom:security-contact Please email security+contracts@thegraph.com if you find any\n bugs. We may have an active bug bounty program." + }, + "fullyImplemented": false, + "id": 1425, + "linearizedBaseContracts": [ + 1425, + 1655, + 936, + 1557, + 945, + 2395, + 2425, + 4928, + 5700, + 5437, + 5391 + ], + "name": "DataServicePausableUpgradeable", + "nameLocation": "789:30:16", + "nodeType": "ContractDefinition", + "nodes": [ + { + "constant": false, + "documentation": { + "id": 1324, + "nodeType": "StructuredDocumentation", + "src": "884:60:16", + "text": "@notice List of pause guardians and their allowed status" + }, + "functionSelector": "9384e078", + "id": 1328, + "mutability": "mutable", + "name": "pauseGuardians", + "nameLocation": "1003:14:16", + "nodeType": "VariableDeclaration", + "scope": 1425, + "src": "949:68:16", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_bool_$", + "typeString": "mapping(address => bool)" + }, + "typeName": { + "id": 1327, + "keyName": "pauseGuardian", + "keyNameLocation": "965:13:16", + "keyType": { + "id": 1325, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "957:7:16", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "949:46:16", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_bool_$", + "typeString": "mapping(address => bool)" + }, + "valueName": "allowed", + "valueNameLocation": "987:7:16", + "valueType": { + "id": 1326, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "982:4:16", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + }, + "visibility": "public" + }, + { + "constant": false, + "documentation": { + "id": 1329, + "nodeType": "StructuredDocumentation", + "src": "1024:57:16", + "text": "@dev Gap to allow adding variables in future upgrades" + }, + "id": 1333, + "mutability": "mutable", + "name": "__gap", + "nameLocation": "1106:5:16", + "nodeType": "VariableDeclaration", + "scope": 1425, + "src": "1086:25:16", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$50_storage", + "typeString": "uint256[50]" + }, + "typeName": { + "baseType": { + "id": 1330, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1086:7:16", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 1332, + "length": { + "hexValue": "3530", + "id": 1331, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1094:2:16", + "typeDescriptions": { + "typeIdentifier": "t_rational_50_by_1", + "typeString": "int_const 50" + }, + "value": "50" + }, + "nodeType": "ArrayTypeName", + "src": "1086:11:16", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$50_storage_ptr", + "typeString": "uint256[50]" + } + }, + "visibility": "private" + }, + { + "body": { + "id": 1348, + "nodeType": "Block", + "src": "1220:112:16", + "statements": [ + { + "expression": { + "arguments": [ + { + "baseExpression": { + "id": 1337, + "name": "pauseGuardians", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1328, + "src": "1238:14:16", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_bool_$", + "typeString": "mapping(address => bool)" + } + }, + "id": 1340, + "indexExpression": { + "expression": { + "id": 1338, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "1253:3:16", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1339, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "1257:6:16", + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "1253:10:16", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "1238:26:16", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [ + { + "expression": { + "id": 1342, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "1302:3:16", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1343, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "1306:6:16", + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "1302:10:16", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 1341, + "name": "DataServicePausableNotPauseGuardian", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1639, + "src": "1266:35:16", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_address_$returns$_t_error_$", + "typeString": "function (address) pure returns (error)" + } + }, + "id": 1344, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "1266:47:16", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 1336, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "1230:7:16", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 1345, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "1230:84:16", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1346, + "nodeType": "ExpressionStatement", + "src": "1230:84:16" + }, + { + "id": 1347, + "nodeType": "PlaceholderStatement", + "src": "1324:1:16" + } + ] + }, + "documentation": { + "id": 1334, + "nodeType": "StructuredDocumentation", + "src": "1118:68:16", + "text": " @notice Checks if the caller is a pause guardian." + }, + "id": 1349, + "name": "onlyPauseGuardian", + "nameLocation": "1200:17:16", + "nodeType": "ModifierDefinition", + "parameters": { + "id": 1335, + "nodeType": "ParameterList", + "parameters": [], + "src": "1217:2:16" + }, + "src": "1191:141:16", + "virtual": false, + "visibility": "internal" + }, + { + "baseFunctions": [ + 1650 + ], + "body": { + "id": 1359, + "nodeType": "Block", + "src": "1432:25:16", + "statements": [ + { + "expression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 1356, + "name": "_pause", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5675, + "src": "1442:6:16", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$__$returns$__$", + "typeString": "function ()" + } + }, + "id": 1357, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "1442:8:16", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1358, + "nodeType": "ExpressionStatement", + "src": "1442:8:16" + } + ] + }, + "documentation": { + "id": 1350, + "nodeType": "StructuredDocumentation", + "src": "1338:36:16", + "text": "@inheritdoc IDataServicePausable" + }, + "functionSelector": "8456cb59", + "id": 1360, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "id": 1354, + "kind": "modifierInvocation", + "modifierName": { + "id": 1353, + "name": "onlyPauseGuardian", + "nameLocations": [ + "1414:17:16" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 1349, + "src": "1414:17:16" + }, + "nodeType": "ModifierInvocation", + "src": "1414:17:16" + } + ], + "name": "pause", + "nameLocation": "1388:5:16", + "nodeType": "FunctionDefinition", + "overrides": { + "id": 1352, + "nodeType": "OverrideSpecifier", + "overrides": [], + "src": "1405:8:16" + }, + "parameters": { + "id": 1351, + "nodeType": "ParameterList", + "parameters": [], + "src": "1393:2:16" + }, + "returnParameters": { + "id": 1355, + "nodeType": "ParameterList", + "parameters": [], + "src": "1432:0:16" + }, + "scope": 1425, + "src": "1379:78:16", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "baseFunctions": [ + 1654 + ], + "body": { + "id": 1370, + "nodeType": "Block", + "src": "1559:27:16", + "statements": [ + { + "expression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 1367, + "name": "_unpause", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5699, + "src": "1569:8:16", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$__$returns$__$", + "typeString": "function ()" + } + }, + "id": 1368, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "1569:10:16", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1369, + "nodeType": "ExpressionStatement", + "src": "1569:10:16" + } + ] + }, + "documentation": { + "id": 1361, + "nodeType": "StructuredDocumentation", + "src": "1463:36:16", + "text": "@inheritdoc IDataServicePausable" + }, + "functionSelector": "3f4ba83a", + "id": 1371, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "id": 1365, + "kind": "modifierInvocation", + "modifierName": { + "id": 1364, + "name": "onlyPauseGuardian", + "nameLocations": [ + "1541:17:16" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 1349, + "src": "1541:17:16" + }, + "nodeType": "ModifierInvocation", + "src": "1541:17:16" + } + ], + "name": "unpause", + "nameLocation": "1513:7:16", + "nodeType": "FunctionDefinition", + "overrides": { + "id": 1363, + "nodeType": "OverrideSpecifier", + "overrides": [], + "src": "1532:8:16" + }, + "parameters": { + "id": 1362, + "nodeType": "ParameterList", + "parameters": [], + "src": "1520:2:16" + }, + "returnParameters": { + "id": 1366, + "nodeType": "ParameterList", + "parameters": [], + "src": "1559:0:16" + }, + "scope": 1425, + "src": "1504:82:16", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "body": { + "id": 1383, + "nodeType": "Block", + "src": "1733:92:16", + "statements": [ + { + "expression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 1377, + "name": "__Pausable_init_unchained", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5610, + "src": "1743:25:16", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$__$returns$__$", + "typeString": "function ()" + } + }, + "id": 1378, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "1743:27:16", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1379, + "nodeType": "ExpressionStatement", + "src": "1743:27:16" + }, + { + "expression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 1380, + "name": "__DataServicePausable_init_unchained", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1391, + "src": "1780:36:16", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$__$returns$__$", + "typeString": "function ()" + } + }, + "id": 1381, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "1780:38:16", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1382, + "nodeType": "ExpressionStatement", + "src": "1780:38:16" + } + ] + }, + "documentation": { + "id": 1372, + "nodeType": "StructuredDocumentation", + "src": "1592:72:16", + "text": " @notice Initializes the contract and parent contracts" + }, + "id": 1384, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "id": 1375, + "kind": "modifierInvocation", + "modifierName": { + "id": 1374, + "name": "onlyInitializing", + "nameLocations": [ + "1716:16:16" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5286, + "src": "1716:16:16" + }, + "nodeType": "ModifierInvocation", + "src": "1716:16:16" + } + ], + "name": "__DataServicePausable_init", + "nameLocation": "1678:26:16", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1373, + "nodeType": "ParameterList", + "parameters": [], + "src": "1704:2:16" + }, + "returnParameters": { + "id": 1376, + "nodeType": "ParameterList", + "parameters": [], + "src": "1733:0:16" + }, + "scope": 1425, + "src": "1669:156:16", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 1390, + "nodeType": "Block", + "src": "1961:2:16", + "statements": [] + }, + "documentation": { + "id": 1385, + "nodeType": "StructuredDocumentation", + "src": "1831:51:16", + "text": " @notice Initializes the contract" + }, + "id": 1391, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "id": 1388, + "kind": "modifierInvocation", + "modifierName": { + "id": 1387, + "name": "onlyInitializing", + "nameLocations": [ + "1944:16:16" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5286, + "src": "1944:16:16" + }, + "nodeType": "ModifierInvocation", + "src": "1944:16:16" + } + ], + "name": "__DataServicePausable_init_unchained", + "nameLocation": "1896:36:16", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1386, + "nodeType": "ParameterList", + "parameters": [], + "src": "1932:2:16" + }, + "returnParameters": { + "id": 1389, + "nodeType": "ParameterList", + "parameters": [], + "src": "1961:0:16" + }, + "scope": 1425, + "src": "1887:76:16", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 1423, + "nodeType": "Block", + "src": "2369:279:16", + "statements": [ + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 1405, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "baseExpression": { + "id": 1400, + "name": "pauseGuardians", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1328, + "src": "2400:14:16", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_bool_$", + "typeString": "mapping(address => bool)" + } + }, + "id": 1402, + "indexExpression": { + "id": 1401, + "name": "_pauseGuardian", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1394, + "src": "2415:14:16", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "2400:30:16", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "id": 1404, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "2434:9:16", + "subExpression": { + "id": 1403, + "name": "_allowed", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1396, + "src": "2435:8:16", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "2400:43:16", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [ + { + "id": 1407, + "name": "_pauseGuardian", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1394, + "src": "2498:14:16", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 1408, + "name": "_allowed", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1396, + "src": "2514:8:16", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 1406, + "name": "DataServicePausablePauseGuardianNoChange", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1646, + "src": "2457:40:16", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_address_$_t_bool_$returns$_t_error_$", + "typeString": "function (address,bool) pure returns (error)" + } + }, + "id": 1409, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2457:66:16", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 1399, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "2379:7:16", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 1410, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2379:154:16", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1411, + "nodeType": "ExpressionStatement", + "src": "2379:154:16" + }, + { + "expression": { + "id": 1416, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "baseExpression": { + "id": 1412, + "name": "pauseGuardians", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1328, + "src": "2543:14:16", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_bool_$", + "typeString": "mapping(address => bool)" + } + }, + "id": 1414, + "indexExpression": { + "id": 1413, + "name": "_pauseGuardian", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1394, + "src": "2558:14:16", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "2543:30:16", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "id": 1415, + "name": "_allowed", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1396, + "src": "2576:8:16", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "2543:41:16", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 1417, + "nodeType": "ExpressionStatement", + "src": "2543:41:16" + }, + { + "eventCall": { + "arguments": [ + { + "id": 1419, + "name": "_pauseGuardian", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1394, + "src": "2616:14:16", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 1420, + "name": "_allowed", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1396, + "src": "2632:8:16", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 1418, + "name": "PauseGuardianSet", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1634, + "src": "2599:16:16", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_bool_$returns$__$", + "typeString": "function (address,bool)" + } + }, + "id": 1421, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2599:42:16", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1422, + "nodeType": "EmitStatement", + "src": "2594:47:16" + } + ] + }, + "documentation": { + "id": 1392, + "nodeType": "StructuredDocumentation", + "src": "1969:320:16", + "text": " @notice Sets a pause guardian.\n @dev Internal function to be used by the derived contract to set pause guardians.\n Emits a {PauseGuardianSet} event.\n @param _pauseGuardian The address of the pause guardian\n @param _allowed The allowed status of the pause guardian" + }, + "id": 1424, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_setPauseGuardian", + "nameLocation": "2303:17:16", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1397, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1394, + "mutability": "mutable", + "name": "_pauseGuardian", + "nameLocation": "2329:14:16", + "nodeType": "VariableDeclaration", + "scope": 1424, + "src": "2321:22:16", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1393, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2321:7:16", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 1396, + "mutability": "mutable", + "name": "_allowed", + "nameLocation": "2350:8:16", + "nodeType": "VariableDeclaration", + "scope": 1424, + "src": "2345:13:16", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 1395, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "2345:4:16", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "src": "2320:39:16" + }, + "returnParameters": { + "id": 1398, + "nodeType": "ParameterList", + "parameters": [], + "src": "2369:0:16" + }, + "scope": 1425, + "src": "2294:354:16", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + } + ], + "scope": 1426, + "src": "771:1879:16", + "usedErrors": [ + 1639, + 1646, + 1918, + 1925, + 1932, + 1937, + 4655, + 5140, + 5143, + 5579, + 5582 + ], + "usedEvents": [ + 1437, + 1442, + 1449, + 1456, + 1466, + 1473, + 1634, + 1888, + 1893, + 1900, + 1907, + 4650, + 5148, + 5571, + 5576 + ] + } + ], + "src": "45:2606:16" + }, + "id": 16 + }, + "@graphprotocol/horizon/contracts/data-service/interfaces/IDataService.sol": { + "ast": { + "absolutePath": "@graphprotocol/horizon/contracts/data-service/interfaces/IDataService.sol", + "exportedSymbols": { + "IDataService": [ + 1557 + ], + "IGraphPayments": [ + 2489 + ] + }, + "id": 1558, + "license": "GPL-3.0-or-later", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 1427, + "literals": [ + "solidity", + "0.8", + ".27" + ], + "nodeType": "PragmaDirective", + "src": "45:23:17" + }, + { + "absolutePath": "@graphprotocol/horizon/contracts/interfaces/IGraphPayments.sol", + "file": "../../interfaces/IGraphPayments.sol", + "id": 1429, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 1558, + "sourceUnit": 2490, + "src": "70:69:17", + "symbolAliases": [ + { + "foreign": { + "id": 1428, + "name": "IGraphPayments", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2489, + "src": "79:14:17", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "abstract": false, + "baseContracts": [], + "canonicalName": "IDataService", + "contractDependencies": [], + "contractKind": "interface", + "documentation": { + "id": 1430, + "nodeType": "StructuredDocumentation", + "src": "141:895:17", + "text": " @title Interface of the base {DataService} contract as defined by the Graph Horizon specification.\n @notice This interface provides a guardrail for contracts that use the Data Service framework\n to implement a data service on Graph Horizon. Much of the specification is intentionally loose\n to allow for greater flexibility when designing a data service. It's not possible to guarantee that\n an implementation will honor the Data Service framework guidelines so it's advised to always review\n the implementation code and the documentation.\n @dev This interface is expected to be inherited and extended by a data service interface. It can be\n used to interact with it however it's advised to use the more specific parent interface.\n @custom:security-contact Please email security+contracts@thegraph.com if you find any\n bugs. We may have an active bug bounty program." + }, + "fullyImplemented": false, + "id": 1557, + "linearizedBaseContracts": [ + 1557 + ], + "name": "IDataService", + "nameLocation": "1047:12:17", + "nodeType": "ContractDefinition", + "nodes": [ + { + "anonymous": false, + "documentation": { + "id": 1431, + "nodeType": "StructuredDocumentation", + "src": "1066:229:17", + "text": " @notice Emitted when a service provider is registered with the data service.\n @param serviceProvider The address of the service provider.\n @param data Custom data, usage defined by the data service." + }, + "eventSelector": "159567bea25499a91f60e1fbb349ff2a1f8c1b2883198f25c1e12c99eddb44fa", + "id": 1437, + "name": "ServiceProviderRegistered", + "nameLocation": "1306:25:17", + "nodeType": "EventDefinition", + "parameters": { + "id": 1436, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1433, + "indexed": true, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "1348:15:17", + "nodeType": "VariableDeclaration", + "scope": 1437, + "src": "1332:31:17", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1432, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1332:7:17", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 1435, + "indexed": false, + "mutability": "mutable", + "name": "data", + "nameLocation": "1371:4:17", + "nodeType": "VariableDeclaration", + "scope": 1437, + "src": "1365:10:17", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 1434, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "1365:5:17", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "src": "1331:45:17" + }, + "src": "1300:77:17" + }, + { + "anonymous": false, + "documentation": { + "id": 1438, + "nodeType": "StructuredDocumentation", + "src": "1383:182:17", + "text": " @notice Emitted when a service provider accepts a provision in {Graph Horizon staking contract}.\n @param serviceProvider The address of the service provider." + }, + "eventSelector": "f53cf6521a1b5fc0c04bffa70374a4dc2e3474f2b2ac1643c3bcc54e2db4a939", + "id": 1442, + "name": "ProvisionPendingParametersAccepted", + "nameLocation": "1576:34:17", + "nodeType": "EventDefinition", + "parameters": { + "id": 1441, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1440, + "indexed": true, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "1627:15:17", + "nodeType": "VariableDeclaration", + "scope": 1442, + "src": "1611:31:17", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1439, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1611:7:17", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "1610:33:17" + }, + "src": "1570:74:17" + }, + { + "anonymous": false, + "documentation": { + "id": 1443, + "nodeType": "StructuredDocumentation", + "src": "1650:222:17", + "text": " @notice Emitted when a service provider starts providing the service.\n @param serviceProvider The address of the service provider.\n @param data Custom data, usage defined by the data service." + }, + "eventSelector": "d3803eb82ef5b4cdff8646734ebbaf5b37441e96314b27ffd3d0940f12a038e7", + "id": 1449, + "name": "ServiceStarted", + "nameLocation": "1883:14:17", + "nodeType": "EventDefinition", + "parameters": { + "id": 1448, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1445, + "indexed": true, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "1914:15:17", + "nodeType": "VariableDeclaration", + "scope": 1449, + "src": "1898:31:17", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1444, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1898:7:17", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 1447, + "indexed": false, + "mutability": "mutable", + "name": "data", + "nameLocation": "1937:4:17", + "nodeType": "VariableDeclaration", + "scope": 1449, + "src": "1931:10:17", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 1446, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "1931:5:17", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "src": "1897:45:17" + }, + "src": "1877:66:17" + }, + { + "anonymous": false, + "documentation": { + "id": 1450, + "nodeType": "StructuredDocumentation", + "src": "1949:221:17", + "text": " @notice Emitted when a service provider stops providing the service.\n @param serviceProvider The address of the service provider.\n @param data Custom data, usage defined by the data service." + }, + "eventSelector": "73330c218a680717e9eee625c262df66eddfdf99ecb388d25f6b32d66b9a318a", + "id": 1456, + "name": "ServiceStopped", + "nameLocation": "2181:14:17", + "nodeType": "EventDefinition", + "parameters": { + "id": 1455, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1452, + "indexed": true, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "2212:15:17", + "nodeType": "VariableDeclaration", + "scope": 1456, + "src": "2196:31:17", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1451, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2196:7:17", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 1454, + "indexed": false, + "mutability": "mutable", + "name": "data", + "nameLocation": "2235:4:17", + "nodeType": "VariableDeclaration", + "scope": 1456, + "src": "2229:10:17", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 1453, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "2229:5:17", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "src": "2195:45:17" + }, + "src": "2175:66:17" + }, + { + "anonymous": false, + "documentation": { + "id": 1457, + "nodeType": "StructuredDocumentation", + "src": "2247:276:17", + "text": " @notice Emitted when a service provider collects payment.\n @param serviceProvider The address of the service provider.\n @param feeType The type of fee to collect as defined in {GraphPayments}.\n @param tokens The amount of tokens collected." + }, + "eventSelector": "54fe682bfb66381a9382e13e4b95a3dd4f960eafbae063fdea3539d144ff3ff5", + "id": 1466, + "name": "ServicePaymentCollected", + "nameLocation": "2534:23:17", + "nodeType": "EventDefinition", + "parameters": { + "id": 1465, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1459, + "indexed": true, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "2583:15:17", + "nodeType": "VariableDeclaration", + "scope": 1466, + "src": "2567:31:17", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1458, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2567:7:17", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 1462, + "indexed": true, + "mutability": "mutable", + "name": "feeType", + "nameLocation": "2644:7:17", + "nodeType": "VariableDeclaration", + "scope": 1466, + "src": "2608:43:17", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_PaymentTypes_$2433", + "typeString": "enum IGraphPayments.PaymentTypes" + }, + "typeName": { + "id": 1461, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 1460, + "name": "IGraphPayments.PaymentTypes", + "nameLocations": [ + "2608:14:17", + "2623:12:17" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 2433, + "src": "2608:27:17" + }, + "referencedDeclaration": 2433, + "src": "2608:27:17", + "typeDescriptions": { + "typeIdentifier": "t_enum$_PaymentTypes_$2433", + "typeString": "enum IGraphPayments.PaymentTypes" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 1464, + "indexed": false, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "2669:6:17", + "nodeType": "VariableDeclaration", + "scope": 1466, + "src": "2661:14:17", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1463, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2661:7:17", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "2557:124:17" + }, + "src": "2528:154:17" + }, + { + "anonymous": false, + "documentation": { + "id": 1467, + "nodeType": "StructuredDocumentation", + "src": "2688:188:17", + "text": " @notice Emitted when a service provider is slashed.\n @param serviceProvider The address of the service provider.\n @param tokens The amount of tokens slashed." + }, + "eventSelector": "02f2e74a11116e05b39159372cceb6739257b08d72f7171d208ff27bb6466c58", + "id": 1473, + "name": "ServiceProviderSlashed", + "nameLocation": "2887:22:17", + "nodeType": "EventDefinition", + "parameters": { + "id": 1472, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1469, + "indexed": true, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "2926:15:17", + "nodeType": "VariableDeclaration", + "scope": 1473, + "src": "2910:31:17", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1468, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2910:7:17", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 1471, + "indexed": false, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "2951:6:17", + "nodeType": "VariableDeclaration", + "scope": 1473, + "src": "2943:14:17", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1470, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2943:7:17", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "2909:49:17" + }, + "src": "2881:78:17" + }, + { + "documentation": { + "id": 1474, + "nodeType": "StructuredDocumentation", + "src": "2965:903:17", + "text": " @notice Registers a service provider with the data service. The service provider can now\n start providing the service.\n @dev Before registering, the service provider must have created a provision in the\n Graph Horizon staking contract with parameters that are compatible with the data service.\n Verifies provision parameters and rejects registration in the event they are not valid.\n Emits a {ServiceProviderRegistered} event.\n NOTE: Failing to accept the provision will result in the service provider operating\n on an unverified provision. Depending on of the data service this can be a security\n risk as the protocol won't be able to guarantee economic security for the consumer.\n @param serviceProvider The address of the service provider.\n @param data Custom data, usage defined by the data service." + }, + "functionSelector": "24b8fbf6", + "id": 1481, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "register", + "nameLocation": "3882:8:17", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1479, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1476, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "3899:15:17", + "nodeType": "VariableDeclaration", + "scope": 1481, + "src": "3891:23:17", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1475, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3891:7:17", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 1478, + "mutability": "mutable", + "name": "data", + "nameLocation": "3931:4:17", + "nodeType": "VariableDeclaration", + "scope": 1481, + "src": "3916:19:17", + "stateVariable": false, + "storageLocation": "calldata", + "typeDescriptions": { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 1477, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "3916:5:17", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "src": "3890:46:17" + }, + "returnParameters": { + "id": 1480, + "nodeType": "ParameterList", + "parameters": [], + "src": "3945:0:17" + }, + "scope": 1557, + "src": "3873:73:17", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 1482, + "nodeType": "StructuredDocumentation", + "src": "3952:472:17", + "text": " @notice Accepts pending parameters in the provision of a service provider in the {Graph Horizon staking\n contract}.\n @dev Provides a way for the data service to validate and accept provision parameter changes. Call {_acceptProvision}.\n Emits a {ProvisionPendingParametersAccepted} event.\n @param serviceProvider The address of the service provider.\n @param data Custom data, usage defined by the data service." + }, + "functionSelector": "ce0fc0cc", + "id": 1489, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "acceptProvisionPendingParameters", + "nameLocation": "4438:32:17", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1487, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1484, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "4479:15:17", + "nodeType": "VariableDeclaration", + "scope": 1489, + "src": "4471:23:17", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1483, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4471:7:17", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 1486, + "mutability": "mutable", + "name": "data", + "nameLocation": "4511:4:17", + "nodeType": "VariableDeclaration", + "scope": 1489, + "src": "4496:19:17", + "stateVariable": false, + "storageLocation": "calldata", + "typeDescriptions": { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 1485, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "4496:5:17", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "src": "4470:46:17" + }, + "returnParameters": { + "id": 1488, + "nodeType": "ParameterList", + "parameters": [], + "src": "4525:0:17" + }, + "scope": 1557, + "src": "4429:97:17", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 1490, + "nodeType": "StructuredDocumentation", + "src": "4532:251:17", + "text": " @notice Service provider starts providing the service.\n @dev Emits a {ServiceStarted} event.\n @param serviceProvider The address of the service provider.\n @param data Custom data, usage defined by the data service." + }, + "functionSelector": "dedf6726", + "id": 1497, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "startService", + "nameLocation": "4797:12:17", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1495, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1492, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "4818:15:17", + "nodeType": "VariableDeclaration", + "scope": 1497, + "src": "4810:23:17", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1491, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4810:7:17", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 1494, + "mutability": "mutable", + "name": "data", + "nameLocation": "4850:4:17", + "nodeType": "VariableDeclaration", + "scope": 1497, + "src": "4835:19:17", + "stateVariable": false, + "storageLocation": "calldata", + "typeDescriptions": { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 1493, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "4835:5:17", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "src": "4809:46:17" + }, + "returnParameters": { + "id": 1496, + "nodeType": "ParameterList", + "parameters": [], + "src": "4864:0:17" + }, + "scope": 1557, + "src": "4788:77:17", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 1498, + "nodeType": "StructuredDocumentation", + "src": "4871:250:17", + "text": " @notice Service provider stops providing the service.\n @dev Emits a {ServiceStopped} event.\n @param serviceProvider The address of the service provider.\n @param data Custom data, usage defined by the data service." + }, + "functionSelector": "8180083b", + "id": 1505, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "stopService", + "nameLocation": "5135:11:17", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1503, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1500, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "5155:15:17", + "nodeType": "VariableDeclaration", + "scope": 1505, + "src": "5147:23:17", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1499, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5147:7:17", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 1502, + "mutability": "mutable", + "name": "data", + "nameLocation": "5187:4:17", + "nodeType": "VariableDeclaration", + "scope": 1505, + "src": "5172:19:17", + "stateVariable": false, + "storageLocation": "calldata", + "typeDescriptions": { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 1501, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "5172:5:17", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "src": "5146:46:17" + }, + "returnParameters": { + "id": 1504, + "nodeType": "ParameterList", + "parameters": [], + "src": "5201:0:17" + }, + "scope": 1557, + "src": "5126:76:17", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 1506, + "nodeType": "StructuredDocumentation", + "src": "5208:864:17", + "text": " @notice Collects payment earnt by the service provider.\n @dev The implementation of this function is expected to interact with {GraphPayments}\n to collect payment from the service payer, which is done via {IGraphPayments-collect}.\n Emits a {ServicePaymentCollected} event.\n NOTE: Data services that are vetted by the Graph Council might qualify for a portion of\n protocol issuance to cover for these payments. In this case, the funds are taken by\n interacting with the rewards manager contract instead of the {GraphPayments} contract.\n @param serviceProvider The address of the service provider.\n @param feeType The type of fee to collect as defined in {GraphPayments}.\n @param data Custom data, usage defined by the data service.\n @return The amount of tokens collected." + }, + "functionSelector": "b15d2a2c", + "id": 1518, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "collect", + "nameLocation": "6086:7:17", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1514, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1508, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "6111:15:17", + "nodeType": "VariableDeclaration", + "scope": 1518, + "src": "6103:23:17", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1507, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6103:7:17", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 1511, + "mutability": "mutable", + "name": "feeType", + "nameLocation": "6164:7:17", + "nodeType": "VariableDeclaration", + "scope": 1518, + "src": "6136:35:17", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_PaymentTypes_$2433", + "typeString": "enum IGraphPayments.PaymentTypes" + }, + "typeName": { + "id": 1510, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 1509, + "name": "IGraphPayments.PaymentTypes", + "nameLocations": [ + "6136:14:17", + "6151:12:17" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 2433, + "src": "6136:27:17" + }, + "referencedDeclaration": 2433, + "src": "6136:27:17", + "typeDescriptions": { + "typeIdentifier": "t_enum$_PaymentTypes_$2433", + "typeString": "enum IGraphPayments.PaymentTypes" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 1513, + "mutability": "mutable", + "name": "data", + "nameLocation": "6196:4:17", + "nodeType": "VariableDeclaration", + "scope": 1518, + "src": "6181:19:17", + "stateVariable": false, + "storageLocation": "calldata", + "typeDescriptions": { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 1512, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "6181:5:17", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "src": "6093:113:17" + }, + "returnParameters": { + "id": 1517, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1516, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 1518, + "src": "6225:7:17", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1515, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "6225:7:17", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "6224:9:17" + }, + "scope": 1557, + "src": "6077:157:17", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 1519, + "nodeType": "StructuredDocumentation", + "src": "6240:367:17", + "text": " @notice Slash a service provider for misbehaviour.\n @dev To slash the service provider's provision the function should call\n {Staking-slash}.\n Emits a {ServiceProviderSlashed} event.\n @param serviceProvider The address of the service provider.\n @param data Custom data, usage defined by the data service." + }, + "functionSelector": "cb8347fe", + "id": 1526, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "slash", + "nameLocation": "6621:5:17", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1524, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1521, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "6635:15:17", + "nodeType": "VariableDeclaration", + "scope": 1526, + "src": "6627:23:17", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1520, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6627:7:17", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 1523, + "mutability": "mutable", + "name": "data", + "nameLocation": "6667:4:17", + "nodeType": "VariableDeclaration", + "scope": 1526, + "src": "6652:19:17", + "stateVariable": false, + "storageLocation": "calldata", + "typeDescriptions": { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 1522, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "6652:5:17", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "src": "6626:46:17" + }, + "returnParameters": { + "id": 1525, + "nodeType": "ParameterList", + "parameters": [], + "src": "6681:0:17" + }, + "scope": 1557, + "src": "6612:70:17", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 1527, + "nodeType": "StructuredDocumentation", + "src": "6688:163:17", + "text": " @notice External getter for the thawing period range\n @return Minimum thawing period allowed\n @return Maximum thawing period allowed" + }, + "functionSelector": "71ce020a", + "id": 1534, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "getThawingPeriodRange", + "nameLocation": "6865:21:17", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1528, + "nodeType": "ParameterList", + "parameters": [], + "src": "6886:2:17" + }, + "returnParameters": { + "id": 1533, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1530, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 1534, + "src": "6912:6:17", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + }, + "typeName": { + "id": 1529, + "name": "uint64", + "nodeType": "ElementaryTypeName", + "src": "6912:6:17", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 1532, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 1534, + "src": "6920:6:17", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + }, + "typeName": { + "id": 1531, + "name": "uint64", + "nodeType": "ElementaryTypeName", + "src": "6920:6:17", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "visibility": "internal" + } + ], + "src": "6911:16:17" + }, + "scope": 1557, + "src": "6856:72:17", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 1535, + "nodeType": "StructuredDocumentation", + "src": "6934:157:17", + "text": " @notice External getter for the verifier cut range\n @return Minimum verifier cut allowed\n @return Maximum verifier cut allowed" + }, + "functionSelector": "482468b7", + "id": 1542, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "getVerifierCutRange", + "nameLocation": "7105:19:17", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1536, + "nodeType": "ParameterList", + "parameters": [], + "src": "7124:2:17" + }, + "returnParameters": { + "id": 1541, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1538, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 1542, + "src": "7150:6:17", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 1537, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "7150:6:17", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 1540, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 1542, + "src": "7158:6:17", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 1539, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "7158:6:17", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + } + ], + "src": "7149:16:17" + }, + "scope": 1557, + "src": "7096:70:17", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 1543, + "nodeType": "StructuredDocumentation", + "src": "7172:169:17", + "text": " @notice External getter for the provision tokens range\n @return Minimum provision tokens allowed\n @return Maximum provision tokens allowed" + }, + "functionSelector": "819ba366", + "id": 1550, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "getProvisionTokensRange", + "nameLocation": "7355:23:17", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1544, + "nodeType": "ParameterList", + "parameters": [], + "src": "7378:2:17" + }, + "returnParameters": { + "id": 1549, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1546, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 1550, + "src": "7404:7:17", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1545, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "7404:7:17", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 1548, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 1550, + "src": "7413:7:17", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1547, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "7413:7:17", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "7403:18:17" + }, + "scope": 1557, + "src": "7346:76:17", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 1551, + "nodeType": "StructuredDocumentation", + "src": "7428:103:17", + "text": " @notice External getter for the delegation ratio\n @return The delegation ratio" + }, + "functionSelector": "1ebb7c30", + "id": 1556, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "getDelegationRatio", + "nameLocation": "7545:18:17", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1552, + "nodeType": "ParameterList", + "parameters": [], + "src": "7563:2:17" + }, + "returnParameters": { + "id": 1555, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1554, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 1556, + "src": "7589:6:17", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 1553, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "7589:6:17", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + } + ], + "src": "7588:8:17" + }, + "scope": 1557, + "src": "7536:61:17", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + } + ], + "scope": 1558, + "src": "1037:6562:17", + "usedErrors": [], + "usedEvents": [ + 1437, + 1442, + 1449, + 1456, + 1466, + 1473 + ] + } + ], + "src": "45:7555:17" + }, + "id": 17 + }, + "@graphprotocol/horizon/contracts/data-service/interfaces/IDataServiceFees.sol": { + "ast": { + "absolutePath": "@graphprotocol/horizon/contracts/data-service/interfaces/IDataServiceFees.sol", + "exportedSymbols": { + "IDataService": [ + 1557 + ], + "IDataServiceFees": [ + 1620 + ] + }, + "id": 1621, + "license": "GPL-3.0-or-later", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 1559, + "literals": [ + "solidity", + "0.8", + ".27" + ], + "nodeType": "PragmaDirective", + "src": "45:23:18" + }, + { + "absolutePath": "@graphprotocol/horizon/contracts/data-service/interfaces/IDataService.sol", + "file": "./IDataService.sol", + "id": 1561, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 1621, + "sourceUnit": 1558, + "src": "70:50:18", + "symbolAliases": [ + { + "foreign": { + "id": 1560, + "name": "IDataService", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1557, + "src": "79:12:18", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "abstract": false, + "baseContracts": [ + { + "baseName": { + "id": 1563, + "name": "IDataService", + "nameLocations": [ + "1207:12:18" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 1557, + "src": "1207:12:18" + }, + "id": 1564, + "nodeType": "InheritanceSpecifier", + "src": "1207:12:18" + } + ], + "canonicalName": "IDataServiceFees", + "contractDependencies": [], + "contractKind": "interface", + "documentation": { + "id": 1562, + "nodeType": "StructuredDocumentation", + "src": "122:1054:18", + "text": " @title Interface for the {DataServiceFees} contract.\n @notice Extension for the {IDataService} contract to handle payment collateralization\n using a Horizon provision.\n It's designed to be used with the Data Service framework:\n - When a service provider collects payment with {IDataService.collect} the data service should lock\n stake to back the payment using {_lockStake}.\n - Every time there is a payment collection with {IDataService.collect}, the data service should\n attempt to release any expired stake claims by calling {_releaseStake}.\n - Stake claims can also be manually released by calling {releaseStake} directly.\n @dev Note that this implementation uses the entire provisioned stake as collateral for the payment.\n It can be used to provide economic security for the payments collected as long as the provisioned\n stake is not being used for other purposes.\n @custom:security-contact Please email security+contracts@thegraph.com if you find any\n bugs. We may have an active bug bounty program." + }, + "fullyImplemented": false, + "id": 1620, + "linearizedBaseContracts": [ + 1620, + 1557 + ], + "name": "IDataServiceFees", + "nameLocation": "1187:16:18", + "nodeType": "ContractDefinition", + "nodes": [ + { + "canonicalName": "IDataServiceFees.StakeClaim", + "documentation": { + "id": 1565, + "nodeType": "StructuredDocumentation", + "src": "1226:508:18", + "text": " @notice A stake claim, representing provisioned stake that gets locked\n to be released to a service provider.\n @dev StakeClaims are stored in linked lists by service provider, ordered by\n creation timestamp.\n @param tokens The amount of tokens to be locked in the claim\n @param createdAt The timestamp when the claim was created\n @param releasableAt The timestamp when the tokens can be released\n @param nextClaim The next claim in the linked list" + }, + "id": 1574, + "members": [ + { + "constant": false, + "id": 1567, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "1775:6:18", + "nodeType": "VariableDeclaration", + "scope": 1574, + "src": "1767:14:18", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1566, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1767:7:18", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 1569, + "mutability": "mutable", + "name": "createdAt", + "nameLocation": "1799:9:18", + "nodeType": "VariableDeclaration", + "scope": 1574, + "src": "1791:17:18", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1568, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1791:7:18", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 1571, + "mutability": "mutable", + "name": "releasableAt", + "nameLocation": "1826:12:18", + "nodeType": "VariableDeclaration", + "scope": 1574, + "src": "1818:20:18", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1570, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1818:7:18", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 1573, + "mutability": "mutable", + "name": "nextClaim", + "nameLocation": "1856:9:18", + "nodeType": "VariableDeclaration", + "scope": 1574, + "src": "1848:17:18", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 1572, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1848:7:18", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "name": "StakeClaim", + "nameLocation": "1746:10:18", + "nodeType": "StructDefinition", + "scope": 1620, + "src": "1739:133:18", + "visibility": "public" + }, + { + "anonymous": false, + "documentation": { + "id": 1575, + "nodeType": "StructuredDocumentation", + "src": "1878:338:18", + "text": " @notice Emitted when a stake claim is created and stake is locked.\n @param serviceProvider The address of the service provider\n @param claimId The id of the stake claim\n @param tokens The amount of tokens to lock in the claim\n @param unlockTimestamp The timestamp when the tokens can be released" + }, + "eventSelector": "5d9e2c5278e41138269f5f980cfbea016d8c59816754502abc4d2f87aaea987f", + "id": 1585, + "name": "StakeClaimLocked", + "nameLocation": "2227:16:18", + "nodeType": "EventDefinition", + "parameters": { + "id": 1584, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1577, + "indexed": true, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "2269:15:18", + "nodeType": "VariableDeclaration", + "scope": 1585, + "src": "2253:31:18", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1576, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2253:7:18", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 1579, + "indexed": true, + "mutability": "mutable", + "name": "claimId", + "nameLocation": "2310:7:18", + "nodeType": "VariableDeclaration", + "scope": 1585, + "src": "2294:23:18", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 1578, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "2294:7:18", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 1581, + "indexed": false, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "2335:6:18", + "nodeType": "VariableDeclaration", + "scope": 1585, + "src": "2327:14:18", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1580, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2327:7:18", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 1583, + "indexed": false, + "mutability": "mutable", + "name": "unlockTimestamp", + "nameLocation": "2359:15:18", + "nodeType": "VariableDeclaration", + "scope": 1585, + "src": "2351:23:18", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1582, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2351:7:18", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "2243:137:18" + }, + "src": "2221:160:18" + }, + { + "anonymous": false, + "documentation": { + "id": 1586, + "nodeType": "StructuredDocumentation", + "src": "2387:324:18", + "text": " @notice Emitted when a stake claim is released and stake is unlocked.\n @param serviceProvider The address of the service provider\n @param claimId The id of the stake claim\n @param tokens The amount of tokens released\n @param releasableAt The timestamp when the tokens were released" + }, + "eventSelector": "4c06b68820628a39c787d2db1faa0eeacd7b9474847b198b1e871fe6e5b93f44", + "id": 1596, + "name": "StakeClaimReleased", + "nameLocation": "2722:18:18", + "nodeType": "EventDefinition", + "parameters": { + "id": 1595, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1588, + "indexed": true, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "2766:15:18", + "nodeType": "VariableDeclaration", + "scope": 1596, + "src": "2750:31:18", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1587, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2750:7:18", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 1590, + "indexed": true, + "mutability": "mutable", + "name": "claimId", + "nameLocation": "2807:7:18", + "nodeType": "VariableDeclaration", + "scope": 1596, + "src": "2791:23:18", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 1589, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "2791:7:18", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 1592, + "indexed": false, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "2832:6:18", + "nodeType": "VariableDeclaration", + "scope": 1596, + "src": "2824:14:18", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1591, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2824:7:18", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 1594, + "indexed": false, + "mutability": "mutable", + "name": "releasableAt", + "nameLocation": "2856:12:18", + "nodeType": "VariableDeclaration", + "scope": 1596, + "src": "2848:20:18", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1593, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2848:7:18", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "2740:134:18" + }, + "src": "2716:159:18" + }, + { + "anonymous": false, + "documentation": { + "id": 1597, + "nodeType": "StructuredDocumentation", + "src": "2881:283:18", + "text": " @notice Emitted when a series of stake claims are released.\n @param serviceProvider The address of the service provider\n @param claimsCount The number of stake claims being released\n @param tokensReleased The total amount of tokens being released" + }, + "eventSelector": "13f3fa9f0e54af1af76d8b5d11c3973d7c2aed6312b61efff2f7b49d73ad67eb", + "id": 1605, + "name": "StakeClaimsReleased", + "nameLocation": "3175:19:18", + "nodeType": "EventDefinition", + "parameters": { + "id": 1604, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1599, + "indexed": true, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "3211:15:18", + "nodeType": "VariableDeclaration", + "scope": 1605, + "src": "3195:31:18", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1598, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3195:7:18", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 1601, + "indexed": false, + "mutability": "mutable", + "name": "claimsCount", + "nameLocation": "3236:11:18", + "nodeType": "VariableDeclaration", + "scope": 1605, + "src": "3228:19:18", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1600, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "3228:7:18", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 1603, + "indexed": false, + "mutability": "mutable", + "name": "tokensReleased", + "nameLocation": "3257:14:18", + "nodeType": "VariableDeclaration", + "scope": 1605, + "src": "3249:22:18", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1602, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "3249:7:18", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "3194:78:18" + }, + "src": "3169:104:18" + }, + { + "documentation": { + "id": 1606, + "nodeType": "StructuredDocumentation", + "src": "3279:139:18", + "text": " @notice Thrown when attempting to get a stake claim that does not exist.\n @param claimId The id of the stake claim" + }, + "errorSelector": "41cd26a4", + "id": 1610, + "name": "DataServiceFeesClaimNotFound", + "nameLocation": "3429:28:18", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 1609, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1608, + "mutability": "mutable", + "name": "claimId", + "nameLocation": "3466:7:18", + "nodeType": "VariableDeclaration", + "scope": 1610, + "src": "3458:15:18", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 1607, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "3458:7:18", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "3457:17:18" + }, + "src": "3423:52:18" + }, + { + "documentation": { + "id": 1611, + "nodeType": "StructuredDocumentation", + "src": "3481:83:18", + "text": " @notice Emitted when trying to lock zero tokens in a stake claim" + }, + "errorSelector": "8f4c63d9", + "id": 1613, + "name": "DataServiceFeesZeroTokens", + "nameLocation": "3575:25:18", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 1612, + "nodeType": "ParameterList", + "parameters": [], + "src": "3600:2:18" + }, + "src": "3569:34:18" + }, + { + "documentation": { + "id": 1614, + "nodeType": "StructuredDocumentation", + "src": "3609:519:18", + "text": " @notice Releases expired stake claims for the caller.\n @dev This function is only meant to be called if the service provider has enough\n stake claims that releasing them all at once would exceed the block gas limit.\n @dev This function can be overriden and/or disabled.\n @dev Emits a {StakeClaimsReleased} event, and a {StakeClaimReleased} event for each claim released.\n @param numClaimsToRelease Amount of stake claims to process. If 0, all stake claims are processed." + }, + "functionSelector": "45f54485", + "id": 1619, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "releaseStake", + "nameLocation": "4142:12:18", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1617, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1616, + "mutability": "mutable", + "name": "numClaimsToRelease", + "nameLocation": "4163:18:18", + "nodeType": "VariableDeclaration", + "scope": 1619, + "src": "4155:26:18", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1615, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "4155:7:18", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "4154:28:18" + }, + "returnParameters": { + "id": 1618, + "nodeType": "ParameterList", + "parameters": [], + "src": "4191:0:18" + }, + "scope": 1620, + "src": "4133:59:18", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + } + ], + "scope": 1621, + "src": "1177:3017:18", + "usedErrors": [ + 1610, + 1613 + ], + "usedEvents": [ + 1437, + 1442, + 1449, + 1456, + 1466, + 1473, + 1585, + 1596, + 1605 + ] + } + ], + "src": "45:4150:18" + }, + "id": 18 + }, + "@graphprotocol/horizon/contracts/data-service/interfaces/IDataServicePausable.sol": { + "ast": { + "absolutePath": "@graphprotocol/horizon/contracts/data-service/interfaces/IDataServicePausable.sol", + "exportedSymbols": { + "IDataService": [ + 1557 + ], + "IDataServicePausable": [ + 1655 + ] + }, + "id": 1656, + "license": "GPL-3.0-or-later", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 1622, + "literals": [ + "solidity", + "0.8", + ".27" + ], + "nodeType": "PragmaDirective", + "src": "45:23:19" + }, + { + "absolutePath": "@graphprotocol/horizon/contracts/data-service/interfaces/IDataService.sol", + "file": "./IDataService.sol", + "id": 1624, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 1656, + "sourceUnit": 1558, + "src": "70:50:19", + "symbolAliases": [ + { + "foreign": { + "id": 1623, + "name": "IDataService", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1557, + "src": "79:12:19", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "abstract": false, + "baseContracts": [ + { + "baseName": { + "id": 1626, + "name": "IDataService", + "nameLocations": [ + "541:12:19" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 1557, + "src": "541:12:19" + }, + "id": 1627, + "nodeType": "InheritanceSpecifier", + "src": "541:12:19" + } + ], + "canonicalName": "IDataServicePausable", + "contractDependencies": [], + "contractKind": "interface", + "documentation": { + "id": 1625, + "nodeType": "StructuredDocumentation", + "src": "122:384:19", + "text": " @title Interface for the {DataServicePausable} contract.\n @notice Extension for the {IDataService} contract, adds pausing functionality\n to the data service. Pausing is controlled by privileged accounts called\n pause guardians.\n @custom:security-contact Please email security+contracts@thegraph.com if you find any\n bugs. We may have an active bug bounty program." + }, + "fullyImplemented": false, + "id": 1655, + "linearizedBaseContracts": [ + 1655, + 1557 + ], + "name": "IDataServicePausable", + "nameLocation": "517:20:19", + "nodeType": "ContractDefinition", + "nodes": [ + { + "anonymous": false, + "documentation": { + "id": 1628, + "nodeType": "StructuredDocumentation", + "src": "560:183:19", + "text": " @notice Emitted when a pause guardian is set.\n @param account The address of the pause guardian\n @param allowed The allowed status of the pause guardian" + }, + "eventSelector": "a95bac2f3df0d40e8278281c1d39d53c60e4f2bf3550ca5665738d0916e89789", + "id": 1634, + "name": "PauseGuardianSet", + "nameLocation": "754:16:19", + "nodeType": "EventDefinition", + "parameters": { + "id": 1633, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1630, + "indexed": true, + "mutability": "mutable", + "name": "account", + "nameLocation": "787:7:19", + "nodeType": "VariableDeclaration", + "scope": 1634, + "src": "771:23:19", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1629, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "771:7:19", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 1632, + "indexed": false, + "mutability": "mutable", + "name": "allowed", + "nameLocation": "801:7:19", + "nodeType": "VariableDeclaration", + "scope": 1634, + "src": "796:12:19", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 1631, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "796:4:19", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "src": "770:39:19" + }, + "src": "748:62:19" + }, + { + "documentation": { + "id": 1635, + "nodeType": "StructuredDocumentation", + "src": "816:132:19", + "text": " @notice Emitted when a the caller is not a pause guardian\n @param account The address of the pause guardian" + }, + "errorSelector": "72e3ef97", + "id": 1639, + "name": "DataServicePausableNotPauseGuardian", + "nameLocation": "959:35:19", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 1638, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1637, + "mutability": "mutable", + "name": "account", + "nameLocation": "1003:7:19", + "nodeType": "VariableDeclaration", + "scope": 1639, + "src": "995:15:19", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1636, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "995:7:19", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "994:17:19" + }, + "src": "953:59:19" + }, + { + "documentation": { + "id": 1640, + "nodeType": "StructuredDocumentation", + "src": "1018:209:19", + "text": " @notice Emitted when a pause guardian is set to the same allowed status\n @param account The address of the pause guardian\n @param allowed The allowed status of the pause guardian" + }, + "errorSelector": "5e67e54b", + "id": 1646, + "name": "DataServicePausablePauseGuardianNoChange", + "nameLocation": "1238:40:19", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 1645, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1642, + "mutability": "mutable", + "name": "account", + "nameLocation": "1287:7:19", + "nodeType": "VariableDeclaration", + "scope": 1646, + "src": "1279:15:19", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1641, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1279:7:19", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 1644, + "mutability": "mutable", + "name": "allowed", + "nameLocation": "1301:7:19", + "nodeType": "VariableDeclaration", + "scope": 1646, + "src": "1296:12:19", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 1643, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "1296:4:19", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "src": "1278:31:19" + }, + "src": "1232:78:19" + }, + { + "documentation": { + "id": 1647, + "nodeType": "StructuredDocumentation", + "src": "1316:256:19", + "text": " @notice Pauses the data service.\n @dev Note that only functions using the modifiers `whenNotPaused`\n and `whenPaused` will be affected by the pause.\n Requirements:\n - The contract must not be already paused" + }, + "functionSelector": "8456cb59", + "id": 1650, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "pause", + "nameLocation": "1586:5:19", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1648, + "nodeType": "ParameterList", + "parameters": [], + "src": "1591:2:19" + }, + "returnParameters": { + "id": 1649, + "nodeType": "ParameterList", + "parameters": [], + "src": "1602:0:19" + }, + "scope": 1655, + "src": "1577:26:19", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 1651, + "nodeType": "StructuredDocumentation", + "src": "1609:246:19", + "text": " @notice Unpauses the data service.\n @dev Note that only functions using the modifiers `whenNotPaused`\n and `whenPaused` will be affected by the pause.\n Requirements:\n - The contract must be paused" + }, + "functionSelector": "3f4ba83a", + "id": 1654, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "unpause", + "nameLocation": "1869:7:19", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1652, + "nodeType": "ParameterList", + "parameters": [], + "src": "1876:2:19" + }, + "returnParameters": { + "id": 1653, + "nodeType": "ParameterList", + "parameters": [], + "src": "1887:0:19" + }, + "scope": 1655, + "src": "1860:28:19", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + } + ], + "scope": 1656, + "src": "507:1383:19", + "usedErrors": [ + 1639, + 1646 + ], + "usedEvents": [ + 1437, + 1442, + 1449, + 1456, + 1466, + 1473, + 1634 + ] + } + ], + "src": "45:1846:19" + }, + "id": 19 + }, + "@graphprotocol/horizon/contracts/data-service/libraries/ProvisionTracker.sol": { + "ast": { + "absolutePath": "@graphprotocol/horizon/contracts/data-service/libraries/ProvisionTracker.sol", + "exportedSymbols": { + "IHorizonStaking": [ + 2625 + ], + "ProvisionTracker": [ + 1801 + ] + }, + "id": 1802, + "license": "GPL-3.0-or-later", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 1657, + "literals": [ + "solidity", + "0.8", + ".27" + ], + "nodeType": "PragmaDirective", + "src": "45:23:20" + }, + { + "absolutePath": "@graphprotocol/horizon/contracts/interfaces/IHorizonStaking.sol", + "file": "../../interfaces/IHorizonStaking.sol", + "id": 1659, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 1802, + "sourceUnit": 2626, + "src": "70:71:20", + "symbolAliases": [ + { + "foreign": { + "id": 1658, + "name": "IHorizonStaking", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2625, + "src": "79:15:20", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "abstract": false, + "baseContracts": [], + "canonicalName": "ProvisionTracker", + "contractDependencies": [], + "contractKind": "library", + "documentation": { + "id": 1660, + "nodeType": "StructuredDocumentation", + "src": "143:635:20", + "text": " @title ProvisionTracker library\n @notice A library to facilitate tracking of \"used tokens\" on Graph Horizon provisions. This can be used to\n ensure data services have enough economic security (provisioned stake) to back the payments they collect for\n their services.\n The library provides two primitives, lock and release to signal token usage and free up tokens respectively. It\n does not make any assumptions about the conditions under which tokens are locked or released.\n @custom:security-contact Please email security+contracts@thegraph.com if you find any\n bugs. We may have an active bug bounty program." + }, + "fullyImplemented": true, + "id": 1801, + "linearizedBaseContracts": [ + 1801 + ], + "name": "ProvisionTracker", + "nameLocation": "787:16:20", + "nodeType": "ContractDefinition", + "nodes": [ + { + "documentation": { + "id": 1661, + "nodeType": "StructuredDocumentation", + "src": "810:200:20", + "text": " @notice Thrown when trying to lock more tokens than available\n @param tokensAvailable The amount of tokens available\n @param tokensRequired The amount of tokens required" + }, + "errorSelector": "5f8ec709", + "id": 1667, + "name": "ProvisionTrackerInsufficientTokens", + "nameLocation": "1021:34:20", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 1666, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1663, + "mutability": "mutable", + "name": "tokensAvailable", + "nameLocation": "1064:15:20", + "nodeType": "VariableDeclaration", + "scope": 1667, + "src": "1056:23:20", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1662, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1056:7:20", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 1665, + "mutability": "mutable", + "name": "tokensRequired", + "nameLocation": "1089:14:20", + "nodeType": "VariableDeclaration", + "scope": 1667, + "src": "1081:22:20", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1664, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1081:7:20", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "1055:49:20" + }, + "src": "1015:90:20" + }, + { + "body": { + "id": 1725, + "nodeType": "Block", + "src": "1843:384:20", + "statements": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 1686, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 1684, + "name": "tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1679, + "src": "1857:6:20", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "30", + "id": 1685, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1867:1:20", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "1857:11:20", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 1688, + "nodeType": "IfStatement", + "src": "1853:24:20", + "trueBody": { + "functionReturnParameters": 1683, + "id": 1687, + "nodeType": "Return", + "src": "1870:7:20" + } + }, + { + "assignments": [ + 1690 + ], + "declarations": [ + { + "constant": false, + "id": 1690, + "mutability": "mutable", + "name": "tokensRequired", + "nameLocation": "1895:14:20", + "nodeType": "VariableDeclaration", + "scope": 1725, + "src": "1887:22:20", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1689, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1887:7:20", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 1696, + "initialValue": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 1695, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "baseExpression": { + "id": 1691, + "name": "self", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1672, + "src": "1912:4:20", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", + "typeString": "mapping(address => uint256)" + } + }, + "id": 1693, + "indexExpression": { + "id": 1692, + "name": "serviceProvider", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1677, + "src": "1917:15:20", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "1912:21:20", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "id": 1694, + "name": "tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1679, + "src": "1936:6:20", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "1912:30:20", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "1887:55:20" + }, + { + "assignments": [ + 1698 + ], + "declarations": [ + { + "constant": false, + "id": 1698, + "mutability": "mutable", + "name": "tokensAvailable", + "nameLocation": "1960:15:20", + "nodeType": "VariableDeclaration", + "scope": 1725, + "src": "1952:23:20", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1697, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1952:7:20", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 1708, + "initialValue": { + "arguments": [ + { + "id": 1701, + "name": "serviceProvider", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1677, + "src": "2010:15:20", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "arguments": [ + { + "id": 1704, + "name": "this", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -28, + "src": "2035:4:20", + "typeDescriptions": { + "typeIdentifier": "t_contract$_ProvisionTracker_$1801", + "typeString": "library ProvisionTracker" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_ProvisionTracker_$1801", + "typeString": "library ProvisionTracker" + } + ], + "id": 1703, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "2027:7:20", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 1702, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2027:7:20", + "typeDescriptions": {} + } + }, + "id": 1705, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2027:13:20", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 1706, + "name": "delegationRatio", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1681, + "src": "2042:15:20", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + ], + "expression": { + "id": 1699, + "name": "graphStaking", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1675, + "src": "1978:12:20", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IHorizonStaking_$2625", + "typeString": "contract IHorizonStaking" + } + }, + "id": 1700, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "1991:18:20", + "memberName": "getTokensAvailable", + "nodeType": "MemberAccess", + "referencedDeclaration": 2962, + "src": "1978:31:20", + "typeDescriptions": { + "typeIdentifier": "t_function_external_view$_t_address_$_t_address_$_t_uint32_$returns$_t_uint256_$", + "typeString": "function (address,address,uint32) view external returns (uint256)" + } + }, + "id": 1707, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "1978:80:20", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "1952:106:20" + }, + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 1712, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 1710, + "name": "tokensRequired", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1690, + "src": "2076:14:20", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "id": 1711, + "name": "tokensAvailable", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1698, + "src": "2094:15:20", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "2076:33:20", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [ + { + "id": 1714, + "name": "tokensAvailable", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1698, + "src": "2146:15:20", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 1715, + "name": "tokensRequired", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1690, + "src": "2163:14:20", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 1713, + "name": "ProvisionTrackerInsufficientTokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1667, + "src": "2111:34:20", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint256_$_t_uint256_$returns$_t_error_$", + "typeString": "function (uint256,uint256) pure returns (error)" + } + }, + "id": 1716, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2111:67:20", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 1709, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "2068:7:20", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 1717, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2068:111:20", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1718, + "nodeType": "ExpressionStatement", + "src": "2068:111:20" + }, + { + "expression": { + "id": 1723, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "baseExpression": { + "id": 1719, + "name": "self", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1672, + "src": "2189:4:20", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", + "typeString": "mapping(address => uint256)" + } + }, + "id": 1721, + "indexExpression": { + "id": 1720, + "name": "serviceProvider", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1677, + "src": "2194:15:20", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "2189:21:20", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "+=", + "rightHandSide": { + "id": 1722, + "name": "tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1679, + "src": "2214:6:20", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "2189:31:20", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 1724, + "nodeType": "ExpressionStatement", + "src": "2189:31:20" + } + ] + }, + "documentation": { + "id": 1668, + "nodeType": "StructuredDocumentation", + "src": "1111:521:20", + "text": " @notice Locks tokens for a service provider\n @dev Requirements:\n - `tokens` must be less than or equal to the amount of tokens available, as reported by the HorizonStaking contract\n @param self The provision tracker mapping\n @param graphStaking The HorizonStaking contract\n @param serviceProvider The service provider address\n @param tokens The amount of tokens to lock\n @param delegationRatio A delegation ratio to limit the amount of delegation that's usable" + }, + "id": 1726, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "lock", + "nameLocation": "1646:4:20", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1682, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1672, + "mutability": "mutable", + "name": "self", + "nameLocation": "1696:4:20", + "nodeType": "VariableDeclaration", + "scope": 1726, + "src": "1660:40:20", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", + "typeString": "mapping(address => uint256)" + }, + "typeName": { + "id": 1671, + "keyName": "", + "keyNameLocation": "-1:-1:-1", + "keyType": { + "id": 1669, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1668:7:20", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "1660:27:20", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", + "typeString": "mapping(address => uint256)" + }, + "valueName": "", + "valueNameLocation": "-1:-1:-1", + "valueType": { + "id": 1670, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1679:7:20", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 1675, + "mutability": "mutable", + "name": "graphStaking", + "nameLocation": "1726:12:20", + "nodeType": "VariableDeclaration", + "scope": 1726, + "src": "1710:28:20", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IHorizonStaking_$2625", + "typeString": "contract IHorizonStaking" + }, + "typeName": { + "id": 1674, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 1673, + "name": "IHorizonStaking", + "nameLocations": [ + "1710:15:20" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 2625, + "src": "1710:15:20" + }, + "referencedDeclaration": 2625, + "src": "1710:15:20", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IHorizonStaking_$2625", + "typeString": "contract IHorizonStaking" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 1677, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "1756:15:20", + "nodeType": "VariableDeclaration", + "scope": 1726, + "src": "1748:23:20", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1676, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1748:7:20", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 1679, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "1789:6:20", + "nodeType": "VariableDeclaration", + "scope": 1726, + "src": "1781:14:20", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1678, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1781:7:20", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 1681, + "mutability": "mutable", + "name": "delegationRatio", + "nameLocation": "1812:15:20", + "nodeType": "VariableDeclaration", + "scope": 1726, + "src": "1805:22:20", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 1680, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "1805:6:20", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + } + ], + "src": "1650:183:20" + }, + "returnParameters": { + "id": 1683, + "nodeType": "ParameterList", + "parameters": [], + "src": "1843:0:20" + }, + "scope": 1801, + "src": "1637:590:20", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 1763, + "nodeType": "Block", + "src": "2700:198:20", + "statements": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 1740, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 1738, + "name": "tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1735, + "src": "2714:6:20", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "30", + "id": 1739, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2724:1:20", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "2714:11:20", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 1742, + "nodeType": "IfStatement", + "src": "2710:24:20", + "trueBody": { + "functionReturnParameters": 1737, + "id": 1741, + "nodeType": "Return", + "src": "2727:7:20" + } + }, + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 1748, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "baseExpression": { + "id": 1744, + "name": "self", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1731, + "src": "2751:4:20", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", + "typeString": "mapping(address => uint256)" + } + }, + "id": 1746, + "indexExpression": { + "id": 1745, + "name": "serviceProvider", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1733, + "src": "2756:15:20", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "2751:21:20", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "id": 1747, + "name": "tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1735, + "src": "2776:6:20", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "2751:31:20", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [ + { + "baseExpression": { + "id": 1750, + "name": "self", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1731, + "src": "2819:4:20", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", + "typeString": "mapping(address => uint256)" + } + }, + "id": 1752, + "indexExpression": { + "id": 1751, + "name": "serviceProvider", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1733, + "src": "2824:15:20", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "2819:21:20", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 1753, + "name": "tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1735, + "src": "2842:6:20", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 1749, + "name": "ProvisionTrackerInsufficientTokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1667, + "src": "2784:34:20", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint256_$_t_uint256_$returns$_t_error_$", + "typeString": "function (uint256,uint256) pure returns (error)" + } + }, + "id": 1754, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2784:65:20", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 1743, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "2743:7:20", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 1755, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2743:107:20", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1756, + "nodeType": "ExpressionStatement", + "src": "2743:107:20" + }, + { + "expression": { + "id": 1761, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "baseExpression": { + "id": 1757, + "name": "self", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1731, + "src": "2860:4:20", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", + "typeString": "mapping(address => uint256)" + } + }, + "id": 1759, + "indexExpression": { + "id": 1758, + "name": "serviceProvider", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1733, + "src": "2865:15:20", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "2860:21:20", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "-=", + "rightHandSide": { + "id": 1760, + "name": "tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1735, + "src": "2885:6:20", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "2860:31:20", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 1762, + "nodeType": "ExpressionStatement", + "src": "2860:31:20" + } + ] + }, + "documentation": { + "id": 1727, + "nodeType": "StructuredDocumentation", + "src": "2233:353:20", + "text": " @notice Releases tokens for a service provider\n @dev Requirements:\n - `tokens` must be less than or equal to the amount of tokens locked for the service provider\n @param self The provision tracker mapping\n @param serviceProvider The service provider address\n @param tokens The amount of tokens to release" + }, + "id": 1764, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "release", + "nameLocation": "2600:7:20", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1736, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1731, + "mutability": "mutable", + "name": "self", + "nameLocation": "2644:4:20", + "nodeType": "VariableDeclaration", + "scope": 1764, + "src": "2608:40:20", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", + "typeString": "mapping(address => uint256)" + }, + "typeName": { + "id": 1730, + "keyName": "", + "keyNameLocation": "-1:-1:-1", + "keyType": { + "id": 1728, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2616:7:20", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "2608:27:20", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", + "typeString": "mapping(address => uint256)" + }, + "valueName": "", + "valueNameLocation": "-1:-1:-1", + "valueType": { + "id": 1729, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2627:7:20", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 1733, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "2658:15:20", + "nodeType": "VariableDeclaration", + "scope": 1764, + "src": "2650:23:20", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1732, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2650:7:20", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 1735, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "2683:6:20", + "nodeType": "VariableDeclaration", + "scope": 1764, + "src": "2675:14:20", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1734, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2675:7:20", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "2607:83:20" + }, + "returnParameters": { + "id": 1737, + "nodeType": "ParameterList", + "parameters": [], + "src": "2700:0:20" + }, + "scope": 1801, + "src": "2591:307:20", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 1799, + "nodeType": "Block", + "src": "3560:180:20", + "statements": [ + { + "assignments": [ + 1782 + ], + "declarations": [ + { + "constant": false, + "id": 1782, + "mutability": "mutable", + "name": "tokensAvailable", + "nameLocation": "3578:15:20", + "nodeType": "VariableDeclaration", + "scope": 1799, + "src": "3570:23:20", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1781, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "3570:7:20", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 1792, + "initialValue": { + "arguments": [ + { + "id": 1785, + "name": "serviceProvider", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1774, + "src": "3628:15:20", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "arguments": [ + { + "id": 1788, + "name": "this", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -28, + "src": "3653:4:20", + "typeDescriptions": { + "typeIdentifier": "t_contract$_ProvisionTracker_$1801", + "typeString": "library ProvisionTracker" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_ProvisionTracker_$1801", + "typeString": "library ProvisionTracker" + } + ], + "id": 1787, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "3645:7:20", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 1786, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3645:7:20", + "typeDescriptions": {} + } + }, + "id": 1789, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3645:13:20", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 1790, + "name": "delegationRatio", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1776, + "src": "3660:15:20", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + ], + "expression": { + "id": 1783, + "name": "graphStaking", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1772, + "src": "3596:12:20", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IHorizonStaking_$2625", + "typeString": "contract IHorizonStaking" + } + }, + "id": 1784, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "3609:18:20", + "memberName": "getTokensAvailable", + "nodeType": "MemberAccess", + "referencedDeclaration": 2962, + "src": "3596:31:20", + "typeDescriptions": { + "typeIdentifier": "t_function_external_view$_t_address_$_t_address_$_t_uint32_$returns$_t_uint256_$", + "typeString": "function (address,address,uint32) view external returns (uint256)" + } + }, + "id": 1791, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3596:80:20", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "3570:106:20" + }, + { + "expression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 1797, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "baseExpression": { + "id": 1793, + "name": "self", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1769, + "src": "3693:4:20", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", + "typeString": "mapping(address => uint256)" + } + }, + "id": 1795, + "indexExpression": { + "id": 1794, + "name": "serviceProvider", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1774, + "src": "3698:15:20", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3693:21:20", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "id": 1796, + "name": "tokensAvailable", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1782, + "src": "3718:15:20", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "3693:40:20", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "functionReturnParameters": 1780, + "id": 1798, + "nodeType": "Return", + "src": "3686:47:20" + } + ] + }, + "documentation": { + "id": 1765, + "nodeType": "StructuredDocumentation", + "src": "2904:448:20", + "text": " @notice Checks if a service provider has enough tokens available to lock\n @param self The provision tracker mapping\n @param graphStaking The HorizonStaking contract\n @param serviceProvider The service provider address\n @param delegationRatio A delegation ratio to limit the amount of delegation that's usable\n @return true if the service provider has enough tokens available to lock, false otherwise" + }, + "id": 1800, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "check", + "nameLocation": "3366:5:20", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1777, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1769, + "mutability": "mutable", + "name": "self", + "nameLocation": "3417:4:20", + "nodeType": "VariableDeclaration", + "scope": 1800, + "src": "3381:40:20", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", + "typeString": "mapping(address => uint256)" + }, + "typeName": { + "id": 1768, + "keyName": "", + "keyNameLocation": "-1:-1:-1", + "keyType": { + "id": 1766, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3389:7:20", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "3381:27:20", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", + "typeString": "mapping(address => uint256)" + }, + "valueName": "", + "valueNameLocation": "-1:-1:-1", + "valueType": { + "id": 1767, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "3400:7:20", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 1772, + "mutability": "mutable", + "name": "graphStaking", + "nameLocation": "3447:12:20", + "nodeType": "VariableDeclaration", + "scope": 1800, + "src": "3431:28:20", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IHorizonStaking_$2625", + "typeString": "contract IHorizonStaking" + }, + "typeName": { + "id": 1771, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 1770, + "name": "IHorizonStaking", + "nameLocations": [ + "3431:15:20" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 2625, + "src": "3431:15:20" + }, + "referencedDeclaration": 2625, + "src": "3431:15:20", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IHorizonStaking_$2625", + "typeString": "contract IHorizonStaking" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 1774, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "3477:15:20", + "nodeType": "VariableDeclaration", + "scope": 1800, + "src": "3469:23:20", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1773, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3469:7:20", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 1776, + "mutability": "mutable", + "name": "delegationRatio", + "nameLocation": "3509:15:20", + "nodeType": "VariableDeclaration", + "scope": 1800, + "src": "3502:22:20", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 1775, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "3502:6:20", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + } + ], + "src": "3371:159:20" + }, + "returnParameters": { + "id": 1780, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1779, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 1800, + "src": "3554:4:20", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 1778, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "3554:4:20", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "src": "3553:6:20" + }, + "scope": 1801, + "src": "3357:383:20", + "stateMutability": "view", + "virtual": false, + "visibility": "internal" + } + ], + "scope": 1802, + "src": "779:2963:20", + "usedErrors": [ + 1667 + ], + "usedEvents": [] + } + ], + "src": "45:3698:20" + }, + "id": 20 + }, + "@graphprotocol/horizon/contracts/data-service/utilities/ProvisionManager.sol": { + "ast": { + "absolutePath": "@graphprotocol/horizon/contracts/data-service/utilities/ProvisionManager.sol", + "exportedSymbols": { + "GraphDirectory": [ + 4928 + ], + "IHorizonStaking": [ + 2625 + ], + "Initializable": [ + 5391 + ], + "PPMMath": [ + 4539 + ], + "ProvisionManager": [ + 2395 + ], + "ProvisionManagerV1Storage": [ + 2425 + ], + "UintRange": [ + 4564 + ] + }, + "id": 2396, + "license": "GPL-3.0-or-later", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 1803, + "literals": [ + "solidity", + "0.8", + ".27" + ], + "nodeType": "PragmaDirective", + "src": "45:23:21" + }, + { + "absolutePath": "@graphprotocol/horizon/contracts/interfaces/IHorizonStaking.sol", + "file": "../../interfaces/IHorizonStaking.sol", + "id": 1805, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 2396, + "sourceUnit": 2626, + "src": "70:71:21", + "symbolAliases": [ + { + "foreign": { + "id": 1804, + "name": "IHorizonStaking", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2625, + "src": "79:15:21", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "@graphprotocol/horizon/contracts/libraries/UintRange.sol", + "file": "../../libraries/UintRange.sol", + "id": 1807, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 2396, + "sourceUnit": 4565, + "src": "143:58:21", + "symbolAliases": [ + { + "foreign": { + "id": 1806, + "name": "UintRange", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4564, + "src": "152:9:21", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "@graphprotocol/horizon/contracts/libraries/PPMMath.sol", + "file": "../../libraries/PPMMath.sol", + "id": 1809, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 2396, + "sourceUnit": 4540, + "src": "202:54:21", + "symbolAliases": [ + { + "foreign": { + "id": 1808, + "name": "PPMMath", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4539, + "src": "211:7:21", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol", + "file": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol", + "id": 1811, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 2396, + "sourceUnit": 5392, + "src": "258:98:21", + "symbolAliases": [ + { + "foreign": { + "id": 1810, + "name": "Initializable", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5391, + "src": "267:13:21", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "@graphprotocol/horizon/contracts/utilities/GraphDirectory.sol", + "file": "../../utilities/GraphDirectory.sol", + "id": 1813, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 2396, + "sourceUnit": 4929, + "src": "357:68:21", + "symbolAliases": [ + { + "foreign": { + "id": 1812, + "name": "GraphDirectory", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4928, + "src": "366:14:21", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "@graphprotocol/horizon/contracts/data-service/utilities/ProvisionManagerStorage.sol", + "file": "./ProvisionManagerStorage.sol", + "id": 1815, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 2396, + "sourceUnit": 2426, + "src": "426:74:21", + "symbolAliases": [ + { + "foreign": { + "id": 1814, + "name": "ProvisionManagerV1Storage", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2425, + "src": "435:25:21", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "abstract": true, + "baseContracts": [ + { + "baseName": { + "id": 1817, + "name": "Initializable", + "nameLocations": [ + "1324:13:21" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5391, + "src": "1324:13:21" + }, + "id": 1818, + "nodeType": "InheritanceSpecifier", + "src": "1324:13:21" + }, + { + "baseName": { + "id": 1819, + "name": "GraphDirectory", + "nameLocations": [ + "1339:14:21" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 4928, + "src": "1339:14:21" + }, + "id": 1820, + "nodeType": "InheritanceSpecifier", + "src": "1339:14:21" + }, + { + "baseName": { + "id": 1821, + "name": "ProvisionManagerV1Storage", + "nameLocations": [ + "1355:25:21" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 2425, + "src": "1355:25:21" + }, + "id": 1822, + "nodeType": "InheritanceSpecifier", + "src": "1355:25:21" + } + ], + "canonicalName": "ProvisionManager", + "contractDependencies": [], + "contractKind": "contract", + "documentation": { + "id": 1816, + "nodeType": "StructuredDocumentation", + "src": "502:783:21", + "text": " @title ProvisionManager contract\n @notice A helper contract that implements several provision management functions.\n @dev Provides utilities to verify provision parameters are within an acceptable range. Each\n parameter has an overridable setter and getter for the validity range, and a checker that reverts\n if the parameter is out of range.\n The parameters are:\n - Provision parameters (thawing period and verifier cut)\n - Provision tokens\n Note that default values for all provision parameters provide the most permissive configuration, it's\n highly recommended to override them at the data service level.\n @custom:security-contact Please email security+contracts@thegraph.com if you find any\n bugs. We may have an active bug bounty program." + }, + "fullyImplemented": true, + "id": 2395, + "linearizedBaseContracts": [ + 2395, + 2425, + 4928, + 5391 + ], + "name": "ProvisionManager", + "nameLocation": "1304:16:21", + "nodeType": "ContractDefinition", + "nodes": [ + { + "global": false, + "id": 1825, + "libraryName": { + "id": 1823, + "name": "UintRange", + "nameLocations": [ + "1393:9:21" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 4564, + "src": "1393:9:21" + }, + "nodeType": "UsingForDirective", + "src": "1387:28:21", + "typeName": { + "id": 1824, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1407:7:21", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + }, + { + "constant": true, + "documentation": { + "id": 1826, + "nodeType": "StructuredDocumentation", + "src": "1421:45:21", + "text": "@notice The default minimum verifier cut." + }, + "id": 1833, + "mutability": "constant", + "name": "DEFAULT_MIN_VERIFIER_CUT", + "nameLocation": "1496:24:21", + "nodeType": "VariableDeclaration", + "scope": 2395, + "src": "1471:68:21", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 1827, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "1471:6:21", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "value": { + "expression": { + "arguments": [ + { + "id": 1830, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "1528:6:21", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint32_$", + "typeString": "type(uint32)" + }, + "typeName": { + "id": 1829, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "1528:6:21", + "typeDescriptions": {} + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_type$_t_uint32_$", + "typeString": "type(uint32)" + } + ], + "id": 1828, + "name": "type", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -27, + "src": "1523:4:21", + "typeDescriptions": { + "typeIdentifier": "t_function_metatype_pure$__$returns$__$", + "typeString": "function () pure" + } + }, + "id": 1831, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "1523:12:21", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_magic_meta_type_t_uint32", + "typeString": "type(uint32)" + } + }, + "id": 1832, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "1536:3:21", + "memberName": "min", + "nodeType": "MemberAccess", + "src": "1523:16:21", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + }, + { + "constant": true, + "documentation": { + "id": 1834, + "nodeType": "StructuredDocumentation", + "src": "1546:45:21", + "text": "@notice The default maximum verifier cut." + }, + "id": 1841, + "mutability": "constant", + "name": "DEFAULT_MAX_VERIFIER_CUT", + "nameLocation": "1621:24:21", + "nodeType": "VariableDeclaration", + "scope": 2395, + "src": "1596:75:21", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 1835, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "1596:6:21", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "value": { + "arguments": [ + { + "expression": { + "id": 1838, + "name": "PPMMath", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4539, + "src": "1655:7:21", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_PPMMath_$4539_$", + "typeString": "type(library PPMMath)" + } + }, + "id": 1839, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "1663:7:21", + "memberName": "MAX_PPM", + "nodeType": "MemberAccess", + "referencedDeclaration": 4452, + "src": "1655:15:21", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 1837, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "1648:6:21", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint32_$", + "typeString": "type(uint32)" + }, + "typeName": { + "id": 1836, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "1648:6:21", + "typeDescriptions": {} + } + }, + "id": 1840, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "1648:23:21", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + }, + { + "constant": true, + "documentation": { + "id": 1842, + "nodeType": "StructuredDocumentation", + "src": "1678:47:21", + "text": "@notice The default minimum thawing period." + }, + "id": 1849, + "mutability": "constant", + "name": "DEFAULT_MIN_THAWING_PERIOD", + "nameLocation": "1755:26:21", + "nodeType": "VariableDeclaration", + "scope": 2395, + "src": "1730:70:21", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + }, + "typeName": { + "id": 1843, + "name": "uint64", + "nodeType": "ElementaryTypeName", + "src": "1730:6:21", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "value": { + "expression": { + "arguments": [ + { + "id": 1846, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "1789:6:21", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint64_$", + "typeString": "type(uint64)" + }, + "typeName": { + "id": 1845, + "name": "uint64", + "nodeType": "ElementaryTypeName", + "src": "1789:6:21", + "typeDescriptions": {} + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_type$_t_uint64_$", + "typeString": "type(uint64)" + } + ], + "id": 1844, + "name": "type", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -27, + "src": "1784:4:21", + "typeDescriptions": { + "typeIdentifier": "t_function_metatype_pure$__$returns$__$", + "typeString": "function () pure" + } + }, + "id": 1847, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "1784:12:21", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_magic_meta_type_t_uint64", + "typeString": "type(uint64)" + } + }, + "id": 1848, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "1797:3:21", + "memberName": "min", + "nodeType": "MemberAccess", + "src": "1784:16:21", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "visibility": "internal" + }, + { + "constant": true, + "documentation": { + "id": 1850, + "nodeType": "StructuredDocumentation", + "src": "1807:47:21", + "text": "@notice The default maximum thawing period." + }, + "id": 1857, + "mutability": "constant", + "name": "DEFAULT_MAX_THAWING_PERIOD", + "nameLocation": "1884:26:21", + "nodeType": "VariableDeclaration", + "scope": 2395, + "src": "1859:70:21", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + }, + "typeName": { + "id": 1851, + "name": "uint64", + "nodeType": "ElementaryTypeName", + "src": "1859:6:21", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "value": { + "expression": { + "arguments": [ + { + "id": 1854, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "1918:6:21", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint64_$", + "typeString": "type(uint64)" + }, + "typeName": { + "id": 1853, + "name": "uint64", + "nodeType": "ElementaryTypeName", + "src": "1918:6:21", + "typeDescriptions": {} + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_type$_t_uint64_$", + "typeString": "type(uint64)" + } + ], + "id": 1852, + "name": "type", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -27, + "src": "1913:4:21", + "typeDescriptions": { + "typeIdentifier": "t_function_metatype_pure$__$returns$__$", + "typeString": "function () pure" + } + }, + "id": 1855, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "1913:12:21", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_magic_meta_type_t_uint64", + "typeString": "type(uint64)" + } + }, + "id": 1856, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "1926:3:21", + "memberName": "max", + "nodeType": "MemberAccess", + "src": "1913:16:21", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "visibility": "internal" + }, + { + "constant": true, + "documentation": { + "id": 1858, + "nodeType": "StructuredDocumentation", + "src": "1936:49:21", + "text": "@notice The default minimum provision tokens." + }, + "id": 1865, + "mutability": "constant", + "name": "DEFAULT_MIN_PROVISION_TOKENS", + "nameLocation": "2016:28:21", + "nodeType": "VariableDeclaration", + "scope": 2395, + "src": "1990:74:21", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1859, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1990:7:21", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": { + "expression": { + "arguments": [ + { + "id": 1862, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "2052:7:21", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + }, + "typeName": { + "id": 1861, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2052:7:21", + "typeDescriptions": {} + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + } + ], + "id": 1860, + "name": "type", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -27, + "src": "2047:4:21", + "typeDescriptions": { + "typeIdentifier": "t_function_metatype_pure$__$returns$__$", + "typeString": "function () pure" + } + }, + "id": 1863, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2047:13:21", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_magic_meta_type_t_uint256", + "typeString": "type(uint256)" + } + }, + "id": 1864, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "2061:3:21", + "memberName": "min", + "nodeType": "MemberAccess", + "src": "2047:17:21", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": true, + "documentation": { + "id": 1866, + "nodeType": "StructuredDocumentation", + "src": "2071:49:21", + "text": "@notice The default maximum provision tokens." + }, + "id": 1873, + "mutability": "constant", + "name": "DEFAULT_MAX_PROVISION_TOKENS", + "nameLocation": "2151:28:21", + "nodeType": "VariableDeclaration", + "scope": 2395, + "src": "2125:74:21", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1867, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2125:7:21", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": { + "expression": { + "arguments": [ + { + "id": 1870, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "2187:7:21", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + }, + "typeName": { + "id": 1869, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2187:7:21", + "typeDescriptions": {} + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + } + ], + "id": 1868, + "name": "type", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -27, + "src": "2182:4:21", + "typeDescriptions": { + "typeIdentifier": "t_function_metatype_pure$__$returns$__$", + "typeString": "function () pure" + } + }, + "id": 1871, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2182:13:21", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_magic_meta_type_t_uint256", + "typeString": "type(uint256)" + } + }, + "id": 1872, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "2196:3:21", + "memberName": "max", + "nodeType": "MemberAccess", + "src": "2182:17:21", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": true, + "documentation": { + "id": 1874, + "nodeType": "StructuredDocumentation", + "src": "2206:41:21", + "text": "@notice The default delegation ratio." + }, + "id": 1881, + "mutability": "constant", + "name": "DEFAULT_DELEGATION_RATIO", + "nameLocation": "2277:24:21", + "nodeType": "VariableDeclaration", + "scope": 2395, + "src": "2252:68:21", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 1875, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "2252:6:21", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "value": { + "expression": { + "arguments": [ + { + "id": 1878, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "2309:6:21", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint32_$", + "typeString": "type(uint32)" + }, + "typeName": { + "id": 1877, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "2309:6:21", + "typeDescriptions": {} + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_type$_t_uint32_$", + "typeString": "type(uint32)" + } + ], + "id": 1876, + "name": "type", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -27, + "src": "2304:4:21", + "typeDescriptions": { + "typeIdentifier": "t_function_metatype_pure$__$returns$__$", + "typeString": "function () pure" + } + }, + "id": 1879, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2304:12:21", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_magic_meta_type_t_uint32", + "typeString": "type(uint32)" + } + }, + "id": 1880, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "2317:3:21", + "memberName": "max", + "nodeType": "MemberAccess", + "src": "2304:16:21", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + }, + { + "anonymous": false, + "documentation": { + "id": 1882, + "nodeType": "StructuredDocumentation", + "src": "2327:214:21", + "text": " @notice Emitted when the provision tokens range is set.\n @param min The minimum allowed value for the provision tokens.\n @param max The maximum allowed value for the provision tokens." + }, + "eventSelector": "90699b8b4bf48918fea1129c85f9bc7b51285df7ecc982910813c7805f568849", + "id": 1888, + "name": "ProvisionTokensRangeSet", + "nameLocation": "2552:23:21", + "nodeType": "EventDefinition", + "parameters": { + "id": 1887, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1884, + "indexed": false, + "mutability": "mutable", + "name": "min", + "nameLocation": "2584:3:21", + "nodeType": "VariableDeclaration", + "scope": 1888, + "src": "2576:11:21", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1883, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2576:7:21", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 1886, + "indexed": false, + "mutability": "mutable", + "name": "max", + "nameLocation": "2597:3:21", + "nodeType": "VariableDeclaration", + "scope": 1888, + "src": "2589:11:21", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1885, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2589:7:21", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "2575:26:21" + }, + "src": "2546:56:21" + }, + { + "anonymous": false, + "documentation": { + "id": 1889, + "nodeType": "StructuredDocumentation", + "src": "2608:109:21", + "text": " @notice Emitted when the delegation ratio is set.\n @param ratio The delegation ratio" + }, + "eventSelector": "472aba493f9fd1d136ec54986f619f3aa5caff964f0e731a9909fb9a1270211f", + "id": 1893, + "name": "DelegationRatioSet", + "nameLocation": "2728:18:21", + "nodeType": "EventDefinition", + "parameters": { + "id": 1892, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1891, + "indexed": false, + "mutability": "mutable", + "name": "ratio", + "nameLocation": "2754:5:21", + "nodeType": "VariableDeclaration", + "scope": 1893, + "src": "2747:12:21", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 1890, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "2747:6:21", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + } + ], + "src": "2746:14:21" + }, + "src": "2722:39:21" + }, + { + "anonymous": false, + "documentation": { + "id": 1894, + "nodeType": "StructuredDocumentation", + "src": "2767:210:21", + "text": " @notice Emitted when the verifier cut range is set.\n @param min The minimum allowed value for the max verifier cut.\n @param max The maximum allowed value for the max verifier cut." + }, + "eventSelector": "2fe5a7039987697813605cc0b9d6db7aab575408e3fc59e8a457bef8d7bc0a36", + "id": 1900, + "name": "VerifierCutRangeSet", + "nameLocation": "2988:19:21", + "nodeType": "EventDefinition", + "parameters": { + "id": 1899, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1896, + "indexed": false, + "mutability": "mutable", + "name": "min", + "nameLocation": "3015:3:21", + "nodeType": "VariableDeclaration", + "scope": 1900, + "src": "3008:10:21", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 1895, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "3008:6:21", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 1898, + "indexed": false, + "mutability": "mutable", + "name": "max", + "nameLocation": "3027:3:21", + "nodeType": "VariableDeclaration", + "scope": 1900, + "src": "3020:10:21", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 1897, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "3020:6:21", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + } + ], + "src": "3007:24:21" + }, + "src": "2982:50:21" + }, + { + "anonymous": false, + "documentation": { + "id": 1901, + "nodeType": "StructuredDocumentation", + "src": "3038:208:21", + "text": " @notice Emitted when the thawing period range is set.\n @param min The minimum allowed value for the thawing period.\n @param max The maximum allowed value for the thawing period." + }, + "eventSelector": "2867e04c500e438761486b78021d4f9eb97c77ff45d10c1183f5583ba4cbf7d1", + "id": 1907, + "name": "ThawingPeriodRangeSet", + "nameLocation": "3257:21:21", + "nodeType": "EventDefinition", + "parameters": { + "id": 1906, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1903, + "indexed": false, + "mutability": "mutable", + "name": "min", + "nameLocation": "3286:3:21", + "nodeType": "VariableDeclaration", + "scope": 1907, + "src": "3279:10:21", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + }, + "typeName": { + "id": 1902, + "name": "uint64", + "nodeType": "ElementaryTypeName", + "src": "3279:6:21", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 1905, + "indexed": false, + "mutability": "mutable", + "name": "max", + "nameLocation": "3298:3:21", + "nodeType": "VariableDeclaration", + "scope": 1907, + "src": "3291:10:21", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + }, + "typeName": { + "id": 1904, + "name": "uint64", + "nodeType": "ElementaryTypeName", + "src": "3291:6:21", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "visibility": "internal" + } + ], + "src": "3278:24:21" + }, + "src": "3251:52:21" + }, + { + "documentation": { + "id": 1908, + "nodeType": "StructuredDocumentation", + "src": "3309:260:21", + "text": " @notice Thrown when a provision parameter is out of range.\n @param message The error message.\n @param value The value that is out of range.\n @param min The minimum allowed value.\n @param max The maximum allowed value." + }, + "errorSelector": "0871e13d", + "id": 1918, + "name": "ProvisionManagerInvalidValue", + "nameLocation": "3580:28:21", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 1917, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1910, + "mutability": "mutable", + "name": "message", + "nameLocation": "3615:7:21", + "nodeType": "VariableDeclaration", + "scope": 1918, + "src": "3609:13:21", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 1909, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "3609:5:21", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 1912, + "mutability": "mutable", + "name": "value", + "nameLocation": "3632:5:21", + "nodeType": "VariableDeclaration", + "scope": 1918, + "src": "3624:13:21", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1911, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "3624:7:21", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 1914, + "mutability": "mutable", + "name": "min", + "nameLocation": "3647:3:21", + "nodeType": "VariableDeclaration", + "scope": 1918, + "src": "3639:11:21", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1913, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "3639:7:21", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 1916, + "mutability": "mutable", + "name": "max", + "nameLocation": "3660:3:21", + "nodeType": "VariableDeclaration", + "scope": 1918, + "src": "3652:11:21", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1915, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "3652:7:21", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "3608:56:21" + }, + "src": "3574:91:21" + }, + { + "documentation": { + "id": 1919, + "nodeType": "StructuredDocumentation", + "src": "3671:169:21", + "text": " @notice Thrown when attempting to set a range where min is greater than max.\n @param min The minimum value.\n @param max The maximum value." + }, + "errorSelector": "ccccdafb", + "id": 1925, + "name": "ProvisionManagerInvalidRange", + "nameLocation": "3851:28:21", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 1924, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1921, + "mutability": "mutable", + "name": "min", + "nameLocation": "3888:3:21", + "nodeType": "VariableDeclaration", + "scope": 1925, + "src": "3880:11:21", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1920, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "3880:7:21", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 1923, + "mutability": "mutable", + "name": "max", + "nameLocation": "3901:3:21", + "nodeType": "VariableDeclaration", + "scope": 1925, + "src": "3893:11:21", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1922, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "3893:7:21", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "3879:26:21" + }, + "src": "3845:61:21" + }, + { + "documentation": { + "id": 1926, + "nodeType": "StructuredDocumentation", + "src": "3912:228:21", + "text": " @notice Thrown when the caller is not authorized to manage the provision of a service provider.\n @param serviceProvider The address of the serviceProvider.\n @param caller The address of the caller." + }, + "errorSelector": "cc5d3c8b", + "id": 1932, + "name": "ProvisionManagerNotAuthorized", + "nameLocation": "4151:29:21", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 1931, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1928, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "4189:15:21", + "nodeType": "VariableDeclaration", + "scope": 1932, + "src": "4181:23:21", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1927, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4181:7:21", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 1930, + "mutability": "mutable", + "name": "caller", + "nameLocation": "4214:6:21", + "nodeType": "VariableDeclaration", + "scope": 1932, + "src": "4206:14:21", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1929, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4206:7:21", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "4180:41:21" + }, + "src": "4145:77:21" + }, + { + "documentation": { + "id": 1933, + "nodeType": "StructuredDocumentation", + "src": "4228:131:21", + "text": " @notice Thrown when a provision is not found.\n @param serviceProvider The address of the service provider." + }, + "errorSelector": "7b3c09bf", + "id": 1937, + "name": "ProvisionManagerProvisionNotFound", + "nameLocation": "4370:33:21", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 1936, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1935, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "4412:15:21", + "nodeType": "VariableDeclaration", + "scope": 1937, + "src": "4404:23:21", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1934, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4404:7:21", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "4403:25:21" + }, + "src": "4364:65:21" + }, + { + "body": { + "id": 1962, + "nodeType": "Block", + "src": "4676:203:21", + "statements": [ + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "id": 1946, + "name": "serviceProvider", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1940, + "src": "4736:15:21", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "arguments": [ + { + "id": 1949, + "name": "this", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -28, + "src": "4761:4:21", + "typeDescriptions": { + "typeIdentifier": "t_contract$_ProvisionManager_$2395", + "typeString": "contract ProvisionManager" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_ProvisionManager_$2395", + "typeString": "contract ProvisionManager" + } + ], + "id": 1948, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "4753:7:21", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 1947, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4753:7:21", + "typeDescriptions": {} + } + }, + "id": 1950, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4753:13:21", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "expression": { + "id": 1951, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "4768:3:21", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1952, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "4772:6:21", + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "4768:10:21", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "expression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 1943, + "name": "_graphStaking", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4815, + "src": "4707:13:21", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_contract$_IHorizonStaking_$2625_$", + "typeString": "function () view returns (contract IHorizonStaking)" + } + }, + "id": 1944, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4707:15:21", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_IHorizonStaking_$2625", + "typeString": "contract IHorizonStaking" + } + }, + "id": 1945, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "4723:12:21", + "memberName": "isAuthorized", + "nodeType": "MemberAccess", + "referencedDeclaration": 3930, + "src": "4707:28:21", + "typeDescriptions": { + "typeIdentifier": "t_function_external_view$_t_address_$_t_address_$_t_address_$returns$_t_bool_$", + "typeString": "function (address,address,address) view external returns (bool)" + } + }, + "id": 1953, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4707:72:21", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [ + { + "id": 1955, + "name": "serviceProvider", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1940, + "src": "4823:15:21", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "expression": { + "id": 1956, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "4840:3:21", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1957, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "4844:6:21", + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "4840:10:21", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 1954, + "name": "ProvisionManagerNotAuthorized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1932, + "src": "4793:29:21", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_address_$_t_address_$returns$_t_error_$", + "typeString": "function (address,address) pure returns (error)" + } + }, + "id": 1958, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4793:58:21", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 1942, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "4686:7:21", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 1959, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4686:175:21", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1960, + "nodeType": "ExpressionStatement", + "src": "4686:175:21" + }, + { + "id": 1961, + "nodeType": "PlaceholderStatement", + "src": "4871:1:21" + } + ] + }, + "documentation": { + "id": 1938, + "nodeType": "StructuredDocumentation", + "src": "4435:175:21", + "text": " @notice Checks if the caller is authorized to manage the provision of a service provider.\n @param serviceProvider The address of the service provider." + }, + "id": 1963, + "name": "onlyAuthorizedForProvision", + "nameLocation": "4624:26:21", + "nodeType": "ModifierDefinition", + "parameters": { + "id": 1941, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1940, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "4659:15:21", + "nodeType": "VariableDeclaration", + "scope": 1963, + "src": "4651:23:21", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1939, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4651:7:21", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "4650:25:21" + }, + "src": "4615:264:21", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 1987, + "nodeType": "Block", + "src": "5151:198:21", + "statements": [ + { + "assignments": [ + 1972 + ], + "declarations": [ + { + "constant": false, + "id": 1972, + "mutability": "mutable", + "name": "provision", + "nameLocation": "5194:9:21", + "nodeType": "VariableDeclaration", + "scope": 1987, + "src": "5161:42:21", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Provision_$3962_memory_ptr", + "typeString": "struct IHorizonStakingTypes.Provision" + }, + "typeName": { + "id": 1971, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 1970, + "name": "IHorizonStaking.Provision", + "nameLocations": [ + "5161:15:21", + "5177:9:21" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 3962, + "src": "5161:25:21" + }, + "referencedDeclaration": 3962, + "src": "5161:25:21", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Provision_$3962_storage_ptr", + "typeString": "struct IHorizonStakingTypes.Provision" + } + }, + "visibility": "internal" + } + ], + "id": 1976, + "initialValue": { + "arguments": [ + { + "id": 1974, + "name": "serviceProvider", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1966, + "src": "5220:15:21", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 1973, + "name": "_getProvision", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2367, + "src": "5206:13:21", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_address_$returns$_t_struct$_Provision_$3962_memory_ptr_$", + "typeString": "function (address) view returns (struct IHorizonStakingTypes.Provision memory)" + } + }, + "id": 1975, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5206:30:21", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_Provision_$3962_memory_ptr", + "typeString": "struct IHorizonStakingTypes.Provision memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "5161:75:21" + }, + { + "expression": { + "arguments": [ + { + "id": 1978, + "name": "provision", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1972, + "src": "5268:9:21", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Provision_$3962_memory_ptr", + "typeString": "struct IHorizonStakingTypes.Provision memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_struct$_Provision_$3962_memory_ptr", + "typeString": "struct IHorizonStakingTypes.Provision memory" + } + ], + "id": 1977, + "name": "_checkProvisionTokens", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 2184, + 2203 + ], + "referencedDeclaration": 2203, + "src": "5246:21:21", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_struct$_Provision_$3962_memory_ptr_$returns$__$", + "typeString": "function (struct IHorizonStakingTypes.Provision memory) view" + } + }, + "id": 1979, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5246:32:21", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1980, + "nodeType": "ExpressionStatement", + "src": "5246:32:21" + }, + { + "expression": { + "arguments": [ + { + "id": 1982, + "name": "provision", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1972, + "src": "5314:9:21", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Provision_$3962_memory_ptr", + "typeString": "struct IHorizonStakingTypes.Provision memory" + } + }, + { + "hexValue": "66616c7365", + "id": 1983, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "5325:5:21", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_struct$_Provision_$3962_memory_ptr", + "typeString": "struct IHorizonStakingTypes.Provision memory" + }, + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 1981, + "name": "_checkProvisionParameters", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 2226, + 2282 + ], + "referencedDeclaration": 2282, + "src": "5288:25:21", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_struct$_Provision_$3962_memory_ptr_$_t_bool_$returns$__$", + "typeString": "function (struct IHorizonStakingTypes.Provision memory,bool) view" + } + }, + "id": 1984, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5288:43:21", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1985, + "nodeType": "ExpressionStatement", + "src": "5288:43:21" + }, + { + "id": 1986, + "nodeType": "PlaceholderStatement", + "src": "5341:1:21" + } + ] + }, + "documentation": { + "id": 1964, + "nodeType": "StructuredDocumentation", + "src": "4885:200:21", + "text": " @notice Checks if a provision of a service provider is valid according\n to the parameter ranges established.\n @param serviceProvider The address of the service provider." + }, + "id": 1988, + "name": "onlyValidProvision", + "nameLocation": "5099:18:21", + "nodeType": "ModifierDefinition", + "parameters": { + "id": 1967, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1966, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "5126:15:21", + "nodeType": "VariableDeclaration", + "scope": 1988, + "src": "5118:23:21", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1965, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5118:7:21", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "5117:25:21" + }, + "src": "5090:259:21", + "virtual": true, + "visibility": "internal" + }, + { + "body": { + "id": 1997, + "nodeType": "Block", + "src": "5498:52:21", + "statements": [ + { + "expression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 1994, + "name": "__ProvisionManager_init_unchained", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2024, + "src": "5508:33:21", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$__$returns$__$", + "typeString": "function ()" + } + }, + "id": 1995, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5508:35:21", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1996, + "nodeType": "ExpressionStatement", + "src": "5508:35:21" + } + ] + }, + "documentation": { + "id": 1989, + "nodeType": "StructuredDocumentation", + "src": "5355:77:21", + "text": " @notice Initializes the contract and any parent contracts." + }, + "id": 1998, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "id": 1992, + "kind": "modifierInvocation", + "modifierName": { + "id": 1991, + "name": "onlyInitializing", + "nameLocations": [ + "5481:16:21" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5286, + "src": "5481:16:21" + }, + "nodeType": "ModifierInvocation", + "src": "5481:16:21" + } + ], + "name": "__ProvisionManager_init", + "nameLocation": "5446:23:21", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1990, + "nodeType": "ParameterList", + "parameters": [], + "src": "5469:2:21" + }, + "returnParameters": { + "id": 1993, + "nodeType": "ParameterList", + "parameters": [], + "src": "5498:0:21" + }, + "scope": 2395, + "src": "5437:113:21", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 2023, + "nodeType": "Block", + "src": "5747:326:21", + "statements": [ + { + "expression": { + "arguments": [ + { + "id": 2005, + "name": "DEFAULT_MIN_PROVISION_TOKENS", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1865, + "src": "5782:28:21", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 2006, + "name": "DEFAULT_MAX_PROVISION_TOKENS", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1873, + "src": "5812:28:21", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2004, + "name": "_setProvisionTokensRange", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2089, + "src": "5757:24:21", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$_t_uint256_$returns$__$", + "typeString": "function (uint256,uint256)" + } + }, + "id": 2007, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5757:84:21", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2008, + "nodeType": "ExpressionStatement", + "src": "5757:84:21" + }, + { + "expression": { + "arguments": [ + { + "id": 2010, + "name": "DEFAULT_MIN_VERIFIER_CUT", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1833, + "src": "5872:24:21", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + { + "id": 2011, + "name": "DEFAULT_MAX_VERIFIER_CUT", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1841, + "src": "5898:24:21", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + ], + "id": 2009, + "name": "_setVerifierCutRange", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2132, + "src": "5851:20:21", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_uint32_$_t_uint32_$returns$__$", + "typeString": "function (uint32,uint32)" + } + }, + "id": 2012, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5851:72:21", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2013, + "nodeType": "ExpressionStatement", + "src": "5851:72:21" + }, + { + "expression": { + "arguments": [ + { + "id": 2015, + "name": "DEFAULT_MIN_THAWING_PERIOD", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1849, + "src": "5956:26:21", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + { + "id": 2016, + "name": "DEFAULT_MAX_THAWING_PERIOD", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1857, + "src": "5984:26:21", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + }, + { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + ], + "id": 2014, + "name": "_setThawingPeriodRange", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2164, + "src": "5933:22:21", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_uint64_$_t_uint64_$returns$__$", + "typeString": "function (uint64,uint64)" + } + }, + "id": 2017, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5933:78:21", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2018, + "nodeType": "ExpressionStatement", + "src": "5933:78:21" + }, + { + "expression": { + "arguments": [ + { + "id": 2020, + "name": "DEFAULT_DELEGATION_RATIO", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1881, + "src": "6041:24:21", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + ], + "id": 2019, + "name": "_setDelegationRatio", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2057, + "src": "6021:19:21", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_uint32_$returns$__$", + "typeString": "function (uint32)" + } + }, + "id": 2021, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "6021:45:21", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2022, + "nodeType": "ExpressionStatement", + "src": "6021:45:21" + } + ] + }, + "documentation": { + "id": 1999, + "nodeType": "StructuredDocumentation", + "src": "5556:115:21", + "text": " @notice Initializes the contract.\n @dev All parameters set to their entire range as valid." + }, + "id": 2024, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "id": 2002, + "kind": "modifierInvocation", + "modifierName": { + "id": 2001, + "name": "onlyInitializing", + "nameLocations": [ + "5730:16:21" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5286, + "src": "5730:16:21" + }, + "nodeType": "ModifierInvocation", + "src": "5730:16:21" + } + ], + "name": "__ProvisionManager_init_unchained", + "nameLocation": "5685:33:21", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2000, + "nodeType": "ParameterList", + "parameters": [], + "src": "5718:2:21" + }, + "returnParameters": { + "id": 2003, + "nodeType": "ParameterList", + "parameters": [], + "src": "5747:0:21" + }, + "scope": 2395, + "src": "5676:397:21", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 2041, + "nodeType": "Block", + "src": "6440:135:21", + "statements": [ + { + "expression": { + "arguments": [ + { + "id": 2031, + "name": "_serviceProvider", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2027, + "src": "6476:16:21", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "hexValue": "74727565", + "id": 2032, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6494:4:21", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "true" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 2030, + "name": "_checkProvisionParameters", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 2226, + 2282 + ], + "referencedDeclaration": 2226, + "src": "6450:25:21", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_address_$_t_bool_$returns$__$", + "typeString": "function (address,bool) view" + } + }, + "id": 2033, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "6450:49:21", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2034, + "nodeType": "ExpressionStatement", + "src": "6450:49:21" + }, + { + "expression": { + "arguments": [ + { + "id": 2038, + "name": "_serviceProvider", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2027, + "src": "6551:16:21", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "expression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 2035, + "name": "_graphStaking", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4815, + "src": "6509:13:21", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_contract$_IHorizonStaking_$2625_$", + "typeString": "function () view returns (contract IHorizonStaking)" + } + }, + "id": 2036, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "6509:15:21", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_IHorizonStaking_$2625", + "typeString": "contract IHorizonStaking" + } + }, + "id": 2037, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "6525:25:21", + "memberName": "acceptProvisionParameters", + "nodeType": "MemberAccess", + "referencedDeclaration": 3751, + "src": "6509:41:21", + "typeDescriptions": { + "typeIdentifier": "t_function_external_nonpayable$_t_address_$returns$__$", + "typeString": "function (address) external" + } + }, + "id": 2039, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "6509:59:21", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2040, + "nodeType": "ExpressionStatement", + "src": "6509:59:21" + } + ] + }, + "documentation": { + "id": 2025, + "nodeType": "StructuredDocumentation", + "src": "6079:285:21", + "text": " @notice Verifies and accepts the provision parameters of a service provider in\n the {HorizonStaking} contract.\n @dev Checks the pending provision parameters, not the current ones.\n @param _serviceProvider The address of the service provider." + }, + "id": 2042, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_acceptProvisionParameters", + "nameLocation": "6378:26:21", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2028, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2027, + "mutability": "mutable", + "name": "_serviceProvider", + "nameLocation": "6413:16:21", + "nodeType": "VariableDeclaration", + "scope": 2042, + "src": "6405:24:21", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2026, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6405:7:21", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "6404:26:21" + }, + "returnParameters": { + "id": 2029, + "nodeType": "ParameterList", + "parameters": [], + "src": "6440:0:21" + }, + "scope": 2395, + "src": "6369:206:21", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 2056, + "nodeType": "Block", + "src": "6765:83:21", + "statements": [ + { + "expression": { + "id": 2050, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 2048, + "name": "_delegationRatio", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2419, + "src": "6775:16:21", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "id": 2049, + "name": "_ratio", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2045, + "src": "6794:6:21", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "src": "6775:25:21", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "id": 2051, + "nodeType": "ExpressionStatement", + "src": "6775:25:21" + }, + { + "eventCall": { + "arguments": [ + { + "id": 2053, + "name": "_ratio", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2045, + "src": "6834:6:21", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + ], + "id": 2052, + "name": "DelegationRatioSet", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1893, + "src": "6815:18:21", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_uint32_$returns$__$", + "typeString": "function (uint32)" + } + }, + "id": 2054, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "6815:26:21", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2055, + "nodeType": "EmitStatement", + "src": "6810:31:21" + } + ] + }, + "documentation": { + "id": 2043, + "nodeType": "StructuredDocumentation", + "src": "6602:105:21", + "text": " @notice Sets the delegation ratio.\n @param _ratio The delegation ratio to be set" + }, + "id": 2057, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_setDelegationRatio", + "nameLocation": "6721:19:21", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2046, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2045, + "mutability": "mutable", + "name": "_ratio", + "nameLocation": "6748:6:21", + "nodeType": "VariableDeclaration", + "scope": 2057, + "src": "6741:13:21", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 2044, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "6741:6:21", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + } + ], + "src": "6740:15:21" + }, + "returnParameters": { + "id": 2047, + "nodeType": "ParameterList", + "parameters": [], + "src": "6765:0:21" + }, + "scope": 2395, + "src": "6712:136:21", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 2088, + "nodeType": "Block", + "src": "7139:210:21", + "statements": [ + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2068, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 2066, + "name": "_min", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2060, + "src": "7157:4:21", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "id": 2067, + "name": "_max", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2062, + "src": "7165:4:21", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "7157:12:21", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [ + { + "id": 2070, + "name": "_min", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2060, + "src": "7200:4:21", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 2071, + "name": "_max", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2062, + "src": "7206:4:21", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2069, + "name": "ProvisionManagerInvalidRange", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1925, + "src": "7171:28:21", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint256_$_t_uint256_$returns$_t_error_$", + "typeString": "function (uint256,uint256) pure returns (error)" + } + }, + "id": 2072, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "7171:40:21", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 2065, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "7149:7:21", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 2073, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "7149:63:21", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2074, + "nodeType": "ExpressionStatement", + "src": "7149:63:21" + }, + { + "expression": { + "id": 2077, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 2075, + "name": "_minimumProvisionTokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2401, + "src": "7222:23:21", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "id": 2076, + "name": "_min", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2060, + "src": "7248:4:21", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "7222:30:21", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 2078, + "nodeType": "ExpressionStatement", + "src": "7222:30:21" + }, + { + "expression": { + "id": 2081, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 2079, + "name": "_maximumProvisionTokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2404, + "src": "7262:23:21", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "id": 2080, + "name": "_max", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2062, + "src": "7288:4:21", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "7262:30:21", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 2082, + "nodeType": "ExpressionStatement", + "src": "7262:30:21" + }, + { + "eventCall": { + "arguments": [ + { + "id": 2084, + "name": "_min", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2060, + "src": "7331:4:21", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 2085, + "name": "_max", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2062, + "src": "7337:4:21", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2083, + "name": "ProvisionTokensRangeSet", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1888, + "src": "7307:23:21", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_uint256_$returns$__$", + "typeString": "function (uint256,uint256)" + } + }, + "id": 2086, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "7307:35:21", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2087, + "nodeType": "EmitStatement", + "src": "7302:40:21" + } + ] + }, + "documentation": { + "id": 2058, + "nodeType": "StructuredDocumentation", + "src": "6854:209:21", + "text": " @notice Sets the range for the provision tokens.\n @param _min The minimum allowed value for the provision tokens.\n @param _max The maximum allowed value for the provision tokens." + }, + "id": 2089, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_setProvisionTokensRange", + "nameLocation": "7077:24:21", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2063, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2060, + "mutability": "mutable", + "name": "_min", + "nameLocation": "7110:4:21", + "nodeType": "VariableDeclaration", + "scope": 2089, + "src": "7102:12:21", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2059, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "7102:7:21", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2062, + "mutability": "mutable", + "name": "_max", + "nameLocation": "7124:4:21", + "nodeType": "VariableDeclaration", + "scope": 2089, + "src": "7116:12:21", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2061, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "7116:7:21", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "7101:28:21" + }, + "returnParameters": { + "id": 2064, + "nodeType": "ParameterList", + "parameters": [], + "src": "7139:0:21" + }, + "scope": 2395, + "src": "7068:281:21", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 2131, + "nodeType": "Block", + "src": "7630:283:21", + "statements": [ + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "id": 2100, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 2098, + "name": "_min", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2092, + "src": "7648:4:21", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "id": 2099, + "name": "_max", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2094, + "src": "7656:4:21", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "src": "7648:12:21", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [ + { + "id": 2102, + "name": "_min", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2092, + "src": "7691:4:21", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + { + "id": 2103, + "name": "_max", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2094, + "src": "7697:4:21", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + ], + "id": 2101, + "name": "ProvisionManagerInvalidRange", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1925, + "src": "7662:28:21", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint256_$_t_uint256_$returns$_t_error_$", + "typeString": "function (uint256,uint256) pure returns (error)" + } + }, + "id": 2104, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "7662:40:21", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 2097, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "7640:7:21", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 2105, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "7640:63:21", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2106, + "nodeType": "ExpressionStatement", + "src": "7640:63:21" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "id": 2110, + "name": "_max", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2094, + "src": "7740:4:21", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + ], + "expression": { + "id": 2108, + "name": "PPMMath", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4539, + "src": "7721:7:21", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_PPMMath_$4539_$", + "typeString": "type(library PPMMath)" + } + }, + "id": 2109, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "7729:10:21", + "memberName": "isValidPPM", + "nodeType": "MemberAccess", + "referencedDeclaration": 4538, + "src": "7721:18:21", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$returns$_t_bool_$", + "typeString": "function (uint256) pure returns (bool)" + } + }, + "id": 2111, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "7721:24:21", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [ + { + "id": 2113, + "name": "_min", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2092, + "src": "7776:4:21", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + { + "id": 2114, + "name": "_max", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2094, + "src": "7782:4:21", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + ], + "id": 2112, + "name": "ProvisionManagerInvalidRange", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1925, + "src": "7747:28:21", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint256_$_t_uint256_$returns$_t_error_$", + "typeString": "function (uint256,uint256) pure returns (error)" + } + }, + "id": 2115, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "7747:40:21", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 2107, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "7713:7:21", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 2116, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "7713:75:21", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2117, + "nodeType": "ExpressionStatement", + "src": "7713:75:21" + }, + { + "expression": { + "id": 2120, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 2118, + "name": "_minimumVerifierCut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2413, + "src": "7798:19:21", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "id": 2119, + "name": "_min", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2092, + "src": "7820:4:21", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "src": "7798:26:21", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "id": 2121, + "nodeType": "ExpressionStatement", + "src": "7798:26:21" + }, + { + "expression": { + "id": 2124, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 2122, + "name": "_maximumVerifierCut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2416, + "src": "7834:19:21", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "id": 2123, + "name": "_max", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2094, + "src": "7856:4:21", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "src": "7834:26:21", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "id": 2125, + "nodeType": "ExpressionStatement", + "src": "7834:26:21" + }, + { + "eventCall": { + "arguments": [ + { + "id": 2127, + "name": "_min", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2092, + "src": "7895:4:21", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + { + "id": 2128, + "name": "_max", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2094, + "src": "7901:4:21", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + ], + "id": 2126, + "name": "VerifierCutRangeSet", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1900, + "src": "7875:19:21", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_uint32_$_t_uint32_$returns$__$", + "typeString": "function (uint32,uint32)" + } + }, + "id": 2129, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "7875:31:21", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2130, + "nodeType": "EmitStatement", + "src": "7870:36:21" + } + ] + }, + "documentation": { + "id": 2090, + "nodeType": "StructuredDocumentation", + "src": "7355:205:21", + "text": " @notice Sets the range for the verifier cut.\n @param _min The minimum allowed value for the max verifier cut.\n @param _max The maximum allowed value for the max verifier cut." + }, + "id": 2132, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_setVerifierCutRange", + "nameLocation": "7574:20:21", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2095, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2092, + "mutability": "mutable", + "name": "_min", + "nameLocation": "7602:4:21", + "nodeType": "VariableDeclaration", + "scope": 2132, + "src": "7595:11:21", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 2091, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "7595:6:21", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2094, + "mutability": "mutable", + "name": "_max", + "nameLocation": "7615:4:21", + "nodeType": "VariableDeclaration", + "scope": 2132, + "src": "7608:11:21", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 2093, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "7608:6:21", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + } + ], + "src": "7594:26:21" + }, + "returnParameters": { + "id": 2096, + "nodeType": "ParameterList", + "parameters": [], + "src": "7630:0:21" + }, + "scope": 2395, + "src": "7565:348:21", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 2163, + "nodeType": "Block", + "src": "8194:204:21", + "statements": [ + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + }, + "id": 2143, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 2141, + "name": "_min", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2135, + "src": "8212:4:21", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "id": 2142, + "name": "_max", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2137, + "src": "8220:4:21", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "src": "8212:12:21", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [ + { + "id": 2145, + "name": "_min", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2135, + "src": "8255:4:21", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + { + "id": 2146, + "name": "_max", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2137, + "src": "8261:4:21", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + }, + { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + ], + "id": 2144, + "name": "ProvisionManagerInvalidRange", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1925, + "src": "8226:28:21", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint256_$_t_uint256_$returns$_t_error_$", + "typeString": "function (uint256,uint256) pure returns (error)" + } + }, + "id": 2147, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "8226:40:21", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 2140, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "8204:7:21", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 2148, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "8204:63:21", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2149, + "nodeType": "ExpressionStatement", + "src": "8204:63:21" + }, + { + "expression": { + "id": 2152, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 2150, + "name": "_minimumThawingPeriod", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2407, + "src": "8277:21:21", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "id": 2151, + "name": "_min", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2135, + "src": "8301:4:21", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "src": "8277:28:21", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "id": 2153, + "nodeType": "ExpressionStatement", + "src": "8277:28:21" + }, + { + "expression": { + "id": 2156, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 2154, + "name": "_maximumThawingPeriod", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2410, + "src": "8315:21:21", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "id": 2155, + "name": "_max", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2137, + "src": "8339:4:21", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "src": "8315:28:21", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "id": 2157, + "nodeType": "ExpressionStatement", + "src": "8315:28:21" + }, + { + "eventCall": { + "arguments": [ + { + "id": 2159, + "name": "_min", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2135, + "src": "8380:4:21", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + { + "id": 2160, + "name": "_max", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2137, + "src": "8386:4:21", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + }, + { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + ], + "id": 2158, + "name": "ThawingPeriodRangeSet", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1907, + "src": "8358:21:21", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_uint64_$_t_uint64_$returns$__$", + "typeString": "function (uint64,uint64)" + } + }, + "id": 2161, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "8358:33:21", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2162, + "nodeType": "EmitStatement", + "src": "8353:38:21" + } + ] + }, + "documentation": { + "id": 2133, + "nodeType": "StructuredDocumentation", + "src": "7919:203:21", + "text": " @notice Sets the range for the thawing period.\n @param _min The minimum allowed value for the thawing period.\n @param _max The maximum allowed value for the thawing period." + }, + "id": 2164, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_setThawingPeriodRange", + "nameLocation": "8136:22:21", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2138, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2135, + "mutability": "mutable", + "name": "_min", + "nameLocation": "8166:4:21", + "nodeType": "VariableDeclaration", + "scope": 2164, + "src": "8159:11:21", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + }, + "typeName": { + "id": 2134, + "name": "uint64", + "nodeType": "ElementaryTypeName", + "src": "8159:6:21", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2137, + "mutability": "mutable", + "name": "_max", + "nameLocation": "8179:4:21", + "nodeType": "VariableDeclaration", + "scope": 2164, + "src": "8172:11:21", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + }, + "typeName": { + "id": 2136, + "name": "uint64", + "nodeType": "ElementaryTypeName", + "src": "8172:6:21", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "visibility": "internal" + } + ], + "src": "8158:26:21" + }, + "returnParameters": { + "id": 2139, + "nodeType": "ParameterList", + "parameters": [], + "src": "8194:0:21" + }, + "scope": 2395, + "src": "8127:271:21", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 2183, + "nodeType": "Block", + "src": "8684:135:21", + "statements": [ + { + "assignments": [ + 2174 + ], + "declarations": [ + { + "constant": false, + "id": 2174, + "mutability": "mutable", + "name": "provision", + "nameLocation": "8727:9:21", + "nodeType": "VariableDeclaration", + "scope": 2183, + "src": "8694:42:21", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Provision_$3962_memory_ptr", + "typeString": "struct IHorizonStakingTypes.Provision" + }, + "typeName": { + "id": 2173, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 2172, + "name": "IHorizonStaking.Provision", + "nameLocations": [ + "8694:15:21", + "8710:9:21" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 3962, + "src": "8694:25:21" + }, + "referencedDeclaration": 3962, + "src": "8694:25:21", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Provision_$3962_storage_ptr", + "typeString": "struct IHorizonStakingTypes.Provision" + } + }, + "visibility": "internal" + } + ], + "id": 2178, + "initialValue": { + "arguments": [ + { + "id": 2176, + "name": "_serviceProvider", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2167, + "src": "8753:16:21", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 2175, + "name": "_getProvision", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2367, + "src": "8739:13:21", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_address_$returns$_t_struct$_Provision_$3962_memory_ptr_$", + "typeString": "function (address) view returns (struct IHorizonStakingTypes.Provision memory)" + } + }, + "id": 2177, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "8739:31:21", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_Provision_$3962_memory_ptr", + "typeString": "struct IHorizonStakingTypes.Provision memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "8694:76:21" + }, + { + "expression": { + "arguments": [ + { + "id": 2180, + "name": "provision", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2174, + "src": "8802:9:21", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Provision_$3962_memory_ptr", + "typeString": "struct IHorizonStakingTypes.Provision memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_struct$_Provision_$3962_memory_ptr", + "typeString": "struct IHorizonStakingTypes.Provision memory" + } + ], + "id": 2179, + "name": "_checkProvisionTokens", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 2184, + 2203 + ], + "referencedDeclaration": 2203, + "src": "8780:21:21", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_struct$_Provision_$3962_memory_ptr_$returns$__$", + "typeString": "function (struct IHorizonStakingTypes.Provision memory) view" + } + }, + "id": 2181, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "8780:32:21", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2182, + "nodeType": "ExpressionStatement", + "src": "8780:32:21" + } + ] + }, + "documentation": { + "id": 2165, + "nodeType": "StructuredDocumentation", + "src": "8425:175:21", + "text": " @notice Checks if the provision tokens of a service provider are within the valid range.\n @param _serviceProvider The address of the service provider." + }, + "id": 2184, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_checkProvisionTokens", + "nameLocation": "8614:21:21", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2168, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2167, + "mutability": "mutable", + "name": "_serviceProvider", + "nameLocation": "8644:16:21", + "nodeType": "VariableDeclaration", + "scope": 2184, + "src": "8636:24:21", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2166, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "8636:7:21", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "8635:26:21" + }, + "returnParameters": { + "id": 2169, + "nodeType": "ParameterList", + "parameters": [], + "src": "8684:0:21" + }, + "scope": 2395, + "src": "8605:214:21", + "stateMutability": "view", + "virtual": true, + "visibility": "internal" + }, + { + "body": { + "id": 2202, + "nodeType": "Block", + "src": "9150:199:21", + "statements": [ + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2196, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 2192, + "name": "_provision", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2188, + "src": "9192:10:21", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Provision_$3962_memory_ptr", + "typeString": "struct IHorizonStakingTypes.Provision memory" + } + }, + "id": 2193, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "9203:6:21", + "memberName": "tokens", + "nodeType": "MemberAccess", + "referencedDeclaration": 3943, + "src": "9192:17:21", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "expression": { + "id": 2194, + "name": "_provision", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2188, + "src": "9212:10:21", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Provision_$3962_memory_ptr", + "typeString": "struct IHorizonStakingTypes.Provision memory" + } + }, + "id": 2195, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "9223:13:21", + "memberName": "tokensThawing", + "nodeType": "MemberAccess", + "referencedDeclaration": 3945, + "src": "9212:24:21", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "9192:44:21", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 2197, + "name": "_minimumProvisionTokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2401, + "src": "9250:23:21", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 2198, + "name": "_maximumProvisionTokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2404, + "src": "9287:23:21", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "hexValue": "746f6b656e73", + "id": 2199, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "9324:8:21", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_680989b8ba4329dbb34fe099c4644fce6e521152facc82d70e978bdc51facd5c", + "typeString": "literal_string \"tokens\"" + }, + "value": "tokens" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_stringliteral_680989b8ba4329dbb34fe099c4644fce6e521152facc82d70e978bdc51facd5c", + "typeString": "literal_string \"tokens\"" + } + ], + "id": 2191, + "name": "_checkValueInRange", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2394, + "src": "9160:18:21", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$_t_uint256_$_t_bytes_memory_ptr_$returns$__$", + "typeString": "function (uint256,uint256,uint256,bytes memory) pure" + } + }, + "id": 2200, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "9160:182:21", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2201, + "nodeType": "ExpressionStatement", + "src": "9160:182:21" + } + ] + }, + "documentation": { + "id": 2185, + "nodeType": "StructuredDocumentation", + "src": "8825:222:21", + "text": " @notice Checks if the provision tokens of a service provider are within the valid range.\n Note that thawing tokens are not considered in this check.\n @param _provision The provision to check." + }, + "id": 2203, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_checkProvisionTokens", + "nameLocation": "9061:21:21", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2189, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2188, + "mutability": "mutable", + "name": "_provision", + "nameLocation": "9116:10:21", + "nodeType": "VariableDeclaration", + "scope": 2203, + "src": "9083:43:21", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Provision_$3962_memory_ptr", + "typeString": "struct IHorizonStakingTypes.Provision" + }, + "typeName": { + "id": 2187, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 2186, + "name": "IHorizonStaking.Provision", + "nameLocations": [ + "9083:15:21", + "9099:9:21" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 3962, + "src": "9083:25:21" + }, + "referencedDeclaration": 3962, + "src": "9083:25:21", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Provision_$3962_storage_ptr", + "typeString": "struct IHorizonStakingTypes.Provision" + } + }, + "visibility": "internal" + } + ], + "src": "9082:45:21" + }, + "returnParameters": { + "id": 2190, + "nodeType": "ParameterList", + "parameters": [], + "src": "9150:0:21" + }, + "scope": 2395, + "src": "9052:297:21", + "stateMutability": "view", + "virtual": true, + "visibility": "internal" + }, + { + "body": { + "id": 2225, + "nodeType": "Block", + "src": "9720:154:21", + "statements": [ + { + "assignments": [ + 2215 + ], + "declarations": [ + { + "constant": false, + "id": 2215, + "mutability": "mutable", + "name": "provision", + "nameLocation": "9763:9:21", + "nodeType": "VariableDeclaration", + "scope": 2225, + "src": "9730:42:21", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Provision_$3962_memory_ptr", + "typeString": "struct IHorizonStakingTypes.Provision" + }, + "typeName": { + "id": 2214, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 2213, + "name": "IHorizonStaking.Provision", + "nameLocations": [ + "9730:15:21", + "9746:9:21" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 3962, + "src": "9730:25:21" + }, + "referencedDeclaration": 3962, + "src": "9730:25:21", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Provision_$3962_storage_ptr", + "typeString": "struct IHorizonStakingTypes.Provision" + } + }, + "visibility": "internal" + } + ], + "id": 2219, + "initialValue": { + "arguments": [ + { + "id": 2217, + "name": "_serviceProvider", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2206, + "src": "9789:16:21", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 2216, + "name": "_getProvision", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2367, + "src": "9775:13:21", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_address_$returns$_t_struct$_Provision_$3962_memory_ptr_$", + "typeString": "function (address) view returns (struct IHorizonStakingTypes.Provision memory)" + } + }, + "id": 2218, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "9775:31:21", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_Provision_$3962_memory_ptr", + "typeString": "struct IHorizonStakingTypes.Provision memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "9730:76:21" + }, + { + "expression": { + "arguments": [ + { + "id": 2221, + "name": "provision", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2215, + "src": "9842:9:21", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Provision_$3962_memory_ptr", + "typeString": "struct IHorizonStakingTypes.Provision memory" + } + }, + { + "id": 2222, + "name": "_checkPending", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2208, + "src": "9853:13:21", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_struct$_Provision_$3962_memory_ptr", + "typeString": "struct IHorizonStakingTypes.Provision memory" + }, + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 2220, + "name": "_checkProvisionParameters", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 2226, + 2282 + ], + "referencedDeclaration": 2282, + "src": "9816:25:21", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_struct$_Provision_$3962_memory_ptr_$_t_bool_$returns$__$", + "typeString": "function (struct IHorizonStakingTypes.Provision memory,bool) view" + } + }, + "id": 2223, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "9816:51:21", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2224, + "nodeType": "ExpressionStatement", + "src": "9816:51:21" + } + ] + }, + "documentation": { + "id": 2204, + "nodeType": "StructuredDocumentation", + "src": "9355:257:21", + "text": " @notice Checks if the provision parameters of a service provider are within the valid range.\n @param _serviceProvider The address of the service provider.\n @param _checkPending If true, checks the pending provision parameters." + }, + "id": 2226, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_checkProvisionParameters", + "nameLocation": "9626:25:21", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2209, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2206, + "mutability": "mutable", + "name": "_serviceProvider", + "nameLocation": "9660:16:21", + "nodeType": "VariableDeclaration", + "scope": 2226, + "src": "9652:24:21", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2205, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "9652:7:21", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2208, + "mutability": "mutable", + "name": "_checkPending", + "nameLocation": "9683:13:21", + "nodeType": "VariableDeclaration", + "scope": 2226, + "src": "9678:18:21", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 2207, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "9678:4:21", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "src": "9651:46:21" + }, + "returnParameters": { + "id": 2210, + "nodeType": "ParameterList", + "parameters": [], + "src": "9720:0:21" + }, + "scope": 2395, + "src": "9617:257:21", + "stateMutability": "view", + "virtual": true, + "visibility": "internal" + }, + { + "body": { + "id": 2281, + "nodeType": "Block", + "src": "10295:611:21", + "statements": [ + { + "assignments": [ + 2236, + 2238 + ], + "declarations": [ + { + "constant": false, + "id": 2236, + "mutability": "mutable", + "name": "thawingPeriodMin", + "nameLocation": "10313:16:21", + "nodeType": "VariableDeclaration", + "scope": 2281, + "src": "10306:23:21", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + }, + "typeName": { + "id": 2235, + "name": "uint64", + "nodeType": "ElementaryTypeName", + "src": "10306:6:21", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2238, + "mutability": "mutable", + "name": "thawingPeriodMax", + "nameLocation": "10338:16:21", + "nodeType": "VariableDeclaration", + "scope": 2281, + "src": "10331:23:21", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + }, + "typeName": { + "id": 2237, + "name": "uint64", + "nodeType": "ElementaryTypeName", + "src": "10331:6:21", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "visibility": "internal" + } + ], + "id": 2241, + "initialValue": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 2239, + "name": "_getThawingPeriodRange", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2317, + "src": "10358:22:21", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint64_$_t_uint64_$", + "typeString": "function () view returns (uint64,uint64)" + } + }, + "id": 2240, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "10358:24:21", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_uint64_$_t_uint64_$", + "typeString": "tuple(uint64,uint64)" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "10305:77:21" + }, + { + "assignments": [ + 2243 + ], + "declarations": [ + { + "constant": false, + "id": 2243, + "mutability": "mutable", + "name": "thawingPeriodToCheck", + "nameLocation": "10399:20:21", + "nodeType": "VariableDeclaration", + "scope": 2281, + "src": "10392:27:21", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + }, + "typeName": { + "id": 2242, + "name": "uint64", + "nodeType": "ElementaryTypeName", + "src": "10392:6:21", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "visibility": "internal" + } + ], + "id": 2250, + "initialValue": { + "condition": { + "id": 2244, + "name": "_checkPending", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2232, + "src": "10422:13:21", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseExpression": { + "expression": { + "id": 2247, + "name": "_provision", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2230, + "src": "10472:10:21", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Provision_$3962_memory_ptr", + "typeString": "struct IHorizonStakingTypes.Provision memory" + } + }, + "id": 2248, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "10483:13:21", + "memberName": "thawingPeriod", + "nodeType": "MemberAccess", + "referencedDeclaration": 3951, + "src": "10472:24:21", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "id": 2249, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "Conditional", + "src": "10422:74:21", + "trueExpression": { + "expression": { + "id": 2245, + "name": "_provision", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2230, + "src": "10438:10:21", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Provision_$3962_memory_ptr", + "typeString": "struct IHorizonStakingTypes.Provision memory" + } + }, + "id": 2246, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "10449:20:21", + "memberName": "thawingPeriodPending", + "nodeType": "MemberAccess", + "referencedDeclaration": 3957, + "src": "10438:31:21", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "10392:104:21" + }, + { + "expression": { + "arguments": [ + { + "id": 2252, + "name": "thawingPeriodToCheck", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2243, + "src": "10525:20:21", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + { + "id": 2253, + "name": "thawingPeriodMin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2236, + "src": "10547:16:21", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + { + "id": 2254, + "name": "thawingPeriodMax", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2238, + "src": "10565:16:21", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + { + "hexValue": "74686177696e67506572696f64", + "id": 2255, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10583:15:21", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_305ab1a02b7b2a803db444b8e35c7e19e6475b5dd6b215ff165ee071bbd360ee", + "typeString": "literal_string \"thawingPeriod\"" + }, + "value": "thawingPeriod" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + }, + { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + }, + { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + }, + { + "typeIdentifier": "t_stringliteral_305ab1a02b7b2a803db444b8e35c7e19e6475b5dd6b215ff165ee071bbd360ee", + "typeString": "literal_string \"thawingPeriod\"" + } + ], + "id": 2251, + "name": "_checkValueInRange", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2394, + "src": "10506:18:21", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$_t_uint256_$_t_bytes_memory_ptr_$returns$__$", + "typeString": "function (uint256,uint256,uint256,bytes memory) pure" + } + }, + "id": 2256, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "10506:93:21", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2257, + "nodeType": "ExpressionStatement", + "src": "10506:93:21" + }, + { + "assignments": [ + 2259, + 2261 + ], + "declarations": [ + { + "constant": false, + "id": 2259, + "mutability": "mutable", + "name": "verifierCutMin", + "nameLocation": "10618:14:21", + "nodeType": "VariableDeclaration", + "scope": 2281, + "src": "10611:21:21", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 2258, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "10611:6:21", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2261, + "mutability": "mutable", + "name": "verifierCutMax", + "nameLocation": "10641:14:21", + "nodeType": "VariableDeclaration", + "scope": 2281, + "src": "10634:21:21", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 2260, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "10634:6:21", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + } + ], + "id": 2264, + "initialValue": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 2262, + "name": "_getVerifierCutRange", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2330, + "src": "10659:20:21", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint32_$_t_uint32_$", + "typeString": "function () view returns (uint32,uint32)" + } + }, + "id": 2263, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "10659:22:21", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_uint32_$_t_uint32_$", + "typeString": "tuple(uint32,uint32)" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "10610:71:21" + }, + { + "assignments": [ + 2266 + ], + "declarations": [ + { + "constant": false, + "id": 2266, + "mutability": "mutable", + "name": "maxVerifierCutToCheck", + "nameLocation": "10698:21:21", + "nodeType": "VariableDeclaration", + "scope": 2281, + "src": "10691:28:21", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 2265, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "10691:6:21", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + } + ], + "id": 2273, + "initialValue": { + "condition": { + "id": 2267, + "name": "_checkPending", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2232, + "src": "10722:13:21", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseExpression": { + "expression": { + "id": 2270, + "name": "_provision", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2230, + "src": "10773:10:21", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Provision_$3962_memory_ptr", + "typeString": "struct IHorizonStakingTypes.Provision memory" + } + }, + "id": 2271, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "10784:14:21", + "memberName": "maxVerifierCut", + "nodeType": "MemberAccess", + "referencedDeclaration": 3949, + "src": "10773:25:21", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "id": 2272, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "Conditional", + "src": "10722:76:21", + "trueExpression": { + "expression": { + "id": 2268, + "name": "_provision", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2230, + "src": "10738:10:21", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Provision_$3962_memory_ptr", + "typeString": "struct IHorizonStakingTypes.Provision memory" + } + }, + "id": 2269, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "10749:21:21", + "memberName": "maxVerifierCutPending", + "nodeType": "MemberAccess", + "referencedDeclaration": 3955, + "src": "10738:32:21", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "10691:107:21" + }, + { + "expression": { + "arguments": [ + { + "id": 2275, + "name": "maxVerifierCutToCheck", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2266, + "src": "10827:21:21", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + { + "id": 2276, + "name": "verifierCutMin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2259, + "src": "10850:14:21", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + { + "id": 2277, + "name": "verifierCutMax", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2261, + "src": "10866:14:21", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + { + "hexValue": "6d61785665726966696572437574", + "id": 2278, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10882:16:21", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_68fc3345e83d56ef118660e3367c327aecf533ff1f8bdee8e3dd2ce1b31b5e0c", + "typeString": "literal_string \"maxVerifierCut\"" + }, + "value": "maxVerifierCut" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + { + "typeIdentifier": "t_stringliteral_68fc3345e83d56ef118660e3367c327aecf533ff1f8bdee8e3dd2ce1b31b5e0c", + "typeString": "literal_string \"maxVerifierCut\"" + } + ], + "id": 2274, + "name": "_checkValueInRange", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2394, + "src": "10808:18:21", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$_t_uint256_$_t_bytes_memory_ptr_$returns$__$", + "typeString": "function (uint256,uint256,uint256,bytes memory) pure" + } + }, + "id": 2279, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "10808:91:21", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2280, + "nodeType": "ExpressionStatement", + "src": "10808:91:21" + } + ] + }, + "documentation": { + "id": 2227, + "nodeType": "StructuredDocumentation", + "src": "9880:266:21", + "text": " @notice Checks if the provision parameters of a service provider are within the valid range.\n @param _provision The provision to check.\n @param _checkPending If true, checks the pending provision parameters instead of the current ones." + }, + "id": 2282, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_checkProvisionParameters", + "nameLocation": "10160:25:21", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2233, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2230, + "mutability": "mutable", + "name": "_provision", + "nameLocation": "10228:10:21", + "nodeType": "VariableDeclaration", + "scope": 2282, + "src": "10195:43:21", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Provision_$3962_memory_ptr", + "typeString": "struct IHorizonStakingTypes.Provision" + }, + "typeName": { + "id": 2229, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 2228, + "name": "IHorizonStaking.Provision", + "nameLocations": [ + "10195:15:21", + "10211:9:21" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 3962, + "src": "10195:25:21" + }, + "referencedDeclaration": 3962, + "src": "10195:25:21", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Provision_$3962_storage_ptr", + "typeString": "struct IHorizonStakingTypes.Provision" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2232, + "mutability": "mutable", + "name": "_checkPending", + "nameLocation": "10253:13:21", + "nodeType": "VariableDeclaration", + "scope": 2282, + "src": "10248:18:21", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 2231, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "10248:4:21", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "src": "10185:87:21" + }, + "returnParameters": { + "id": 2234, + "nodeType": "ParameterList", + "parameters": [], + "src": "10295:0:21" + }, + "scope": 2395, + "src": "10151:755:21", + "stateMutability": "view", + "virtual": true, + "visibility": "internal" + }, + { + "body": { + "id": 2290, + "nodeType": "Block", + "src": "11090:40:21", + "statements": [ + { + "expression": { + "id": 2288, + "name": "_delegationRatio", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2419, + "src": "11107:16:21", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "functionReturnParameters": 2287, + "id": 2289, + "nodeType": "Return", + "src": "11100:23:21" + } + ] + }, + "documentation": { + "id": 2283, + "nodeType": "StructuredDocumentation", + "src": "10934:89:21", + "text": " @notice Gets the delegation ratio.\n @return The delegation ratio" + }, + "id": 2291, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_getDelegationRatio", + "nameLocation": "11037:19:21", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2284, + "nodeType": "ParameterList", + "parameters": [], + "src": "11056:2:21" + }, + "returnParameters": { + "id": 2287, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2286, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 2291, + "src": "11082:6:21", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 2285, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "11082:6:21", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + } + ], + "src": "11081:8:21" + }, + "scope": 2395, + "src": "11028:102:21", + "stateMutability": "view", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 2303, + "nodeType": "Block", + "src": "11427:74:21", + "statements": [ + { + "expression": { + "components": [ + { + "id": 2299, + "name": "_minimumProvisionTokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2401, + "src": "11445:23:21", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 2300, + "name": "_maximumProvisionTokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2404, + "src": "11470:23:21", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 2301, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "11444:50:21", + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$", + "typeString": "tuple(uint256,uint256)" + } + }, + "functionReturnParameters": 2298, + "id": 2302, + "nodeType": "Return", + "src": "11437:57:21" + } + ] + }, + "documentation": { + "id": 2292, + "nodeType": "StructuredDocumentation", + "src": "11136:201:21", + "text": " @notice Gets the range for the provision tokens.\n @return The minimum allowed value for the provision tokens.\n @return The maximum allowed value for the provision tokens." + }, + "id": 2304, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_getProvisionTokensRange", + "nameLocation": "11351:24:21", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2293, + "nodeType": "ParameterList", + "parameters": [], + "src": "11375:2:21" + }, + "returnParameters": { + "id": 2298, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2295, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 2304, + "src": "11409:7:21", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2294, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "11409:7:21", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2297, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 2304, + "src": "11418:7:21", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2296, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "11418:7:21", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "11408:18:21" + }, + "scope": 2395, + "src": "11342:159:21", + "stateMutability": "view", + "virtual": true, + "visibility": "internal" + }, + { + "body": { + "id": 2316, + "nodeType": "Block", + "src": "11789:70:21", + "statements": [ + { + "expression": { + "components": [ + { + "id": 2312, + "name": "_minimumThawingPeriod", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2407, + "src": "11807:21:21", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + { + "id": 2313, + "name": "_maximumThawingPeriod", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2410, + "src": "11830:21:21", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + } + ], + "id": 2314, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "11806:46:21", + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_uint64_$_t_uint64_$", + "typeString": "tuple(uint64,uint64)" + } + }, + "functionReturnParameters": 2311, + "id": 2315, + "nodeType": "Return", + "src": "11799:53:21" + } + ] + }, + "documentation": { + "id": 2305, + "nodeType": "StructuredDocumentation", + "src": "11507:196:21", + "text": " @notice Gets the range for the thawing period.\n @return The minimum allowed value for the thawing period.\n @return The maximum allowed value for the thawing period." + }, + "id": 2317, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_getThawingPeriodRange", + "nameLocation": "11717:22:21", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2306, + "nodeType": "ParameterList", + "parameters": [], + "src": "11739:2:21" + }, + "returnParameters": { + "id": 2311, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2308, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 2317, + "src": "11773:6:21", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + }, + "typeName": { + "id": 2307, + "name": "uint64", + "nodeType": "ElementaryTypeName", + "src": "11773:6:21", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2310, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 2317, + "src": "11781:6:21", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + }, + "typeName": { + "id": 2309, + "name": "uint64", + "nodeType": "ElementaryTypeName", + "src": "11781:6:21", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "visibility": "internal" + } + ], + "src": "11772:16:21" + }, + "scope": 2395, + "src": "11708:151:21", + "stateMutability": "view", + "virtual": true, + "visibility": "internal" + }, + { + "body": { + "id": 2329, + "nodeType": "Block", + "src": "12146:66:21", + "statements": [ + { + "expression": { + "components": [ + { + "id": 2325, + "name": "_minimumVerifierCut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2413, + "src": "12164:19:21", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + { + "id": 2326, + "name": "_maximumVerifierCut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2416, + "src": "12185:19:21", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + } + ], + "id": 2327, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "12163:42:21", + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_uint32_$_t_uint32_$", + "typeString": "tuple(uint32,uint32)" + } + }, + "functionReturnParameters": 2324, + "id": 2328, + "nodeType": "Return", + "src": "12156:49:21" + } + ] + }, + "documentation": { + "id": 2318, + "nodeType": "StructuredDocumentation", + "src": "11865:197:21", + "text": " @notice Gets the range for the verifier cut.\n @return The minimum allowed value for the max verifier cut.\n @return The maximum allowed value for the max verifier cut." + }, + "id": 2330, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_getVerifierCutRange", + "nameLocation": "12076:20:21", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2319, + "nodeType": "ParameterList", + "parameters": [], + "src": "12096:2:21" + }, + "returnParameters": { + "id": 2324, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2321, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 2330, + "src": "12130:6:21", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 2320, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "12130:6:21", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2323, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 2330, + "src": "12138:6:21", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 2322, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "12138:6:21", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + } + ], + "src": "12129:16:21" + }, + "scope": 2395, + "src": "12067:145:21", + "stateMutability": "view", + "virtual": true, + "visibility": "internal" + }, + { + "body": { + "id": 2366, + "nodeType": "Block", + "src": "12567:245:21", + "statements": [ + { + "assignments": [ + 2343 + ], + "declarations": [ + { + "constant": false, + "id": 2343, + "mutability": "mutable", + "name": "provision", + "nameLocation": "12610:9:21", + "nodeType": "VariableDeclaration", + "scope": 2366, + "src": "12577:42:21", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Provision_$3962_memory_ptr", + "typeString": "struct IHorizonStakingTypes.Provision" + }, + "typeName": { + "id": 2342, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 2341, + "name": "IHorizonStaking.Provision", + "nameLocations": [ + "12577:15:21", + "12593:9:21" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 3962, + "src": "12577:25:21" + }, + "referencedDeclaration": 3962, + "src": "12577:25:21", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Provision_$3962_storage_ptr", + "typeString": "struct IHorizonStakingTypes.Provision" + } + }, + "visibility": "internal" + } + ], + "id": 2353, + "initialValue": { + "arguments": [ + { + "id": 2347, + "name": "_serviceProvider", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2333, + "src": "12651:16:21", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "arguments": [ + { + "id": 2350, + "name": "this", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -28, + "src": "12677:4:21", + "typeDescriptions": { + "typeIdentifier": "t_contract$_ProvisionManager_$2395", + "typeString": "contract ProvisionManager" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_ProvisionManager_$2395", + "typeString": "contract ProvisionManager" + } + ], + "id": 2349, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "12669:7:21", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 2348, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "12669:7:21", + "typeDescriptions": {} + } + }, + "id": 2351, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "12669:13:21", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "expression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 2344, + "name": "_graphStaking", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4815, + "src": "12622:13:21", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_contract$_IHorizonStaking_$2625_$", + "typeString": "function () view returns (contract IHorizonStaking)" + } + }, + "id": 2345, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "12622:15:21", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_IHorizonStaking_$2625", + "typeString": "contract IHorizonStaking" + } + }, + "id": 2346, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "12638:12:21", + "memberName": "getProvision", + "nodeType": "MemberAccess", + "referencedDeclaration": 2950, + "src": "12622:28:21", + "typeDescriptions": { + "typeIdentifier": "t_function_external_view$_t_address_$_t_address_$returns$_t_struct$_Provision_$3962_memory_ptr_$", + "typeString": "function (address,address) view external returns (struct IHorizonStakingTypes.Provision memory)" + } + }, + "id": 2352, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "12622:61:21", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_Provision_$3962_memory_ptr", + "typeString": "struct IHorizonStakingTypes.Provision memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "12577:106:21" + }, + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + }, + "id": 2358, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 2355, + "name": "provision", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2343, + "src": "12701:9:21", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Provision_$3962_memory_ptr", + "typeString": "struct IHorizonStakingTypes.Provision memory" + } + }, + "id": 2356, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "12711:9:21", + "memberName": "createdAt", + "nodeType": "MemberAccess", + "referencedDeclaration": 3953, + "src": "12701:19:21", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "hexValue": "30", + "id": 2357, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12724:1:21", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "12701:24:21", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [ + { + "id": 2360, + "name": "_serviceProvider", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2333, + "src": "12761:16:21", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 2359, + "name": "ProvisionManagerProvisionNotFound", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1937, + "src": "12727:33:21", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_address_$returns$_t_error_$", + "typeString": "function (address) pure returns (error)" + } + }, + "id": 2361, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "12727:51:21", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 2354, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "12693:7:21", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 2362, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "12693:86:21", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2363, + "nodeType": "ExpressionStatement", + "src": "12693:86:21" + }, + { + "expression": { + "id": 2364, + "name": "provision", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2343, + "src": "12796:9:21", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Provision_$3962_memory_ptr", + "typeString": "struct IHorizonStakingTypes.Provision memory" + } + }, + "functionReturnParameters": 2338, + "id": 2365, + "nodeType": "Return", + "src": "12789:16:21" + } + ] + }, + "documentation": { + "id": 2331, + "nodeType": "StructuredDocumentation", + "src": "12218:238:21", + "text": " @notice Gets a provision from the {HorizonStaking} contract.\n @dev Requirements:\n - The provision must exist.\n @param _serviceProvider The address of the service provider.\n @return The provision." + }, + "id": 2367, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_getProvision", + "nameLocation": "12470:13:21", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2334, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2333, + "mutability": "mutable", + "name": "_serviceProvider", + "nameLocation": "12492:16:21", + "nodeType": "VariableDeclaration", + "scope": 2367, + "src": "12484:24:21", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2332, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "12484:7:21", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "12483:26:21" + }, + "returnParameters": { + "id": 2338, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2337, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 2367, + "src": "12533:32:21", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Provision_$3962_memory_ptr", + "typeString": "struct IHorizonStakingTypes.Provision" + }, + "typeName": { + "id": 2336, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 2335, + "name": "IHorizonStaking.Provision", + "nameLocations": [ + "12533:15:21", + "12549:9:21" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 3962, + "src": "12533:25:21" + }, + "referencedDeclaration": 3962, + "src": "12533:25:21", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Provision_$3962_storage_ptr", + "typeString": "struct IHorizonStakingTypes.Provision" + } + }, + "visibility": "internal" + } + ], + "src": "12532:34:21" + }, + "scope": 2395, + "src": "12461:351:21", + "stateMutability": "view", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 2393, + "nodeType": "Block", + "src": "13228:120:21", + "statements": [ + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "id": 2382, + "name": "_min", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2372, + "src": "13263:4:21", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 2383, + "name": "_max", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2374, + "src": "13269:4:21", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "id": 2380, + "name": "_value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2370, + "src": "13246:6:21", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 2381, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "13253:9:21", + "memberName": "isInRange", + "nodeType": "MemberAccess", + "referencedDeclaration": 4563, + "src": "13246:16:21", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_bool_$attached_to$_t_uint256_$", + "typeString": "function (uint256,uint256,uint256) pure returns (bool)" + } + }, + "id": 2384, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "13246:28:21", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [ + { + "id": 2386, + "name": "_revertMessage", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2376, + "src": "13305:14:21", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + { + "id": 2387, + "name": "_value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2370, + "src": "13321:6:21", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 2388, + "name": "_min", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2372, + "src": "13329:4:21", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 2389, + "name": "_max", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2374, + "src": "13335:4:21", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2385, + "name": "ProvisionManagerInvalidValue", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1918, + "src": "13276:28:21", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_bytes_memory_ptr_$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_error_$", + "typeString": "function (bytes memory,uint256,uint256,uint256) pure returns (error)" + } + }, + "id": 2390, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "13276:64:21", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 2379, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "13238:7:21", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 2391, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "13238:103:21", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2392, + "nodeType": "ExpressionStatement", + "src": "13238:103:21" + } + ] + }, + "documentation": { + "id": 2368, + "nodeType": "StructuredDocumentation", + "src": "12818:291:21", + "text": " @notice Checks if a value is within a valid range.\n @param _value The value to check.\n @param _min The minimum allowed value.\n @param _max The maximum allowed value.\n @param _revertMessage The revert message to display if the value is out of range." + }, + "id": 2394, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_checkValueInRange", + "nameLocation": "13123:18:21", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2377, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2370, + "mutability": "mutable", + "name": "_value", + "nameLocation": "13150:6:21", + "nodeType": "VariableDeclaration", + "scope": 2394, + "src": "13142:14:21", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2369, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "13142:7:21", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2372, + "mutability": "mutable", + "name": "_min", + "nameLocation": "13166:4:21", + "nodeType": "VariableDeclaration", + "scope": 2394, + "src": "13158:12:21", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2371, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "13158:7:21", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2374, + "mutability": "mutable", + "name": "_max", + "nameLocation": "13180:4:21", + "nodeType": "VariableDeclaration", + "scope": 2394, + "src": "13172:12:21", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2373, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "13172:7:21", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2376, + "mutability": "mutable", + "name": "_revertMessage", + "nameLocation": "13199:14:21", + "nodeType": "VariableDeclaration", + "scope": 2394, + "src": "13186:27:21", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 2375, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "13186:5:21", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "src": "13141:73:21" + }, + "returnParameters": { + "id": 2378, + "nodeType": "ParameterList", + "parameters": [], + "src": "13228:0:21" + }, + "scope": 2395, + "src": "13114:234:21", + "stateMutability": "pure", + "virtual": false, + "visibility": "private" + } + ], + "scope": 2396, + "src": "1286:12064:21", + "usedErrors": [ + 1918, + 1925, + 1932, + 1937, + 4655, + 5140, + 5143 + ], + "usedEvents": [ + 1888, + 1893, + 1900, + 1907, + 4650, + 5148 + ] + } + ], + "src": "45:13306:21" + }, + "id": 21 + }, + "@graphprotocol/horizon/contracts/data-service/utilities/ProvisionManagerStorage.sol": { + "ast": { + "absolutePath": "@graphprotocol/horizon/contracts/data-service/utilities/ProvisionManagerStorage.sol", + "exportedSymbols": { + "ProvisionManagerV1Storage": [ + 2425 + ] + }, + "id": 2426, + "license": "GPL-3.0-or-later", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 2397, + "literals": [ + "solidity", + "0.8", + ".27" + ], + "nodeType": "PragmaDirective", + "src": "45:23:22" + }, + { + "abstract": true, + "baseContracts": [], + "canonicalName": "ProvisionManagerV1Storage", + "contractDependencies": [], + "contractKind": "contract", + "documentation": { + "id": 2398, + "nodeType": "StructuredDocumentation", + "src": "70:216:22", + "text": " @title Storage layout for the {ProvisionManager} helper contract.\n @custom:security-contact Please email security+contracts@thegraph.com if you find any\n bugs. We may have an active bug bounty program." + }, + "fullyImplemented": true, + "id": 2425, + "linearizedBaseContracts": [ + 2425 + ], + "name": "ProvisionManagerV1Storage", + "nameLocation": "305:25:22", + "nodeType": "ContractDefinition", + "nodes": [ + { + "constant": false, + "documentation": { + "id": 2399, + "nodeType": "StructuredDocumentation", + "src": "337:93:22", + "text": "@notice The minimum amount of tokens required to register a provision in the data service" + }, + "id": 2401, + "mutability": "mutable", + "name": "_minimumProvisionTokens", + "nameLocation": "452:23:22", + "nodeType": "VariableDeclaration", + "scope": 2425, + "src": "435:40:22", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2400, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "435:7:22", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "documentation": { + "id": 2402, + "nodeType": "StructuredDocumentation", + "src": "482:92:22", + "text": "@notice The maximum amount of tokens allowed to register a provision in the data service" + }, + "id": 2404, + "mutability": "mutable", + "name": "_maximumProvisionTokens", + "nameLocation": "596:23:22", + "nodeType": "VariableDeclaration", + "scope": 2425, + "src": "579:40:22", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2403, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "579:7:22", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "documentation": { + "id": 2405, + "nodeType": "StructuredDocumentation", + "src": "626:91:22", + "text": "@notice The minimum thawing period required to register a provision in the data service" + }, + "id": 2407, + "mutability": "mutable", + "name": "_minimumThawingPeriod", + "nameLocation": "738:21:22", + "nodeType": "VariableDeclaration", + "scope": 2425, + "src": "722:37:22", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + }, + "typeName": { + "id": 2406, + "name": "uint64", + "nodeType": "ElementaryTypeName", + "src": "722:6:22", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "documentation": { + "id": 2408, + "nodeType": "StructuredDocumentation", + "src": "766:90:22", + "text": "@notice The maximum thawing period allowed to register a provision in the data service" + }, + "id": 2410, + "mutability": "mutable", + "name": "_maximumThawingPeriod", + "nameLocation": "877:21:22", + "nodeType": "VariableDeclaration", + "scope": 2425, + "src": "861:37:22", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + }, + "typeName": { + "id": 2409, + "name": "uint64", + "nodeType": "ElementaryTypeName", + "src": "861:6:22", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "documentation": { + "id": 2411, + "nodeType": "StructuredDocumentation", + "src": "905:98:22", + "text": "@notice The minimum verifier cut required to register a provision in the data service (in PPM)" + }, + "id": 2413, + "mutability": "mutable", + "name": "_minimumVerifierCut", + "nameLocation": "1024:19:22", + "nodeType": "VariableDeclaration", + "scope": 2425, + "src": "1008:35:22", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 2412, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "1008:6:22", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "documentation": { + "id": 2414, + "nodeType": "StructuredDocumentation", + "src": "1050:97:22", + "text": "@notice The maximum verifier cut allowed to register a provision in the data service (in PPM)" + }, + "id": 2416, + "mutability": "mutable", + "name": "_maximumVerifierCut", + "nameLocation": "1168:19:22", + "nodeType": "VariableDeclaration", + "scope": 2425, + "src": "1152:35:22", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 2415, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "1152:6:22", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "documentation": { + "id": 2417, + "nodeType": "StructuredDocumentation", + "src": "1194:146:22", + "text": "@notice How much delegation the service provider can effectively use\n @dev Max calculated as service provider's stake * delegationRatio" + }, + "id": 2419, + "mutability": "mutable", + "name": "_delegationRatio", + "nameLocation": "1361:16:22", + "nodeType": "VariableDeclaration", + "scope": 2425, + "src": "1345:32:22", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 2418, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "1345:6:22", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "documentation": { + "id": 2420, + "nodeType": "StructuredDocumentation", + "src": "1384:158:22", + "text": "@dev Gap to allow adding variables in future upgrades\n Note that this contract is not upgradeable but might be inherited by an upgradeable contract" + }, + "id": 2424, + "mutability": "mutable", + "name": "__gap", + "nameLocation": "1567:5:22", + "nodeType": "VariableDeclaration", + "scope": 2425, + "src": "1547:25:22", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$50_storage", + "typeString": "uint256[50]" + }, + "typeName": { + "baseType": { + "id": 2421, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1547:7:22", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 2423, + "length": { + "hexValue": "3530", + "id": 2422, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1555:2:22", + "typeDescriptions": { + "typeIdentifier": "t_rational_50_by_1", + "typeString": "int_const 50" + }, + "value": "50" + }, + "nodeType": "ArrayTypeName", + "src": "1547:11:22", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$50_storage_ptr", + "typeString": "uint256[50]" + } + }, + "visibility": "private" + } + ], + "scope": 2426, + "src": "287:1288:22", + "usedErrors": [], + "usedEvents": [] + } + ], + "src": "45:1531:22" + }, + "id": 22 + }, + "@graphprotocol/horizon/contracts/interfaces/IGraphPayments.sol": { + "ast": { + "absolutePath": "@graphprotocol/horizon/contracts/interfaces/IGraphPayments.sol", + "exportedSymbols": { + "IGraphPayments": [ + 2489 + ] + }, + "id": 2490, + "license": "GPL-3.0-or-later", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 2427, + "literals": [ + "solidity", + "0.8", + ".27" + ], + "nodeType": "PragmaDirective", + "src": "45:23:23" + }, + { + "abstract": false, + "baseContracts": [], + "canonicalName": "IGraphPayments", + "contractDependencies": [], + "contractKind": "interface", + "documentation": { + "id": 2428, + "nodeType": "StructuredDocumentation", + "src": "70:404:23", + "text": " @title Interface for the {GraphPayments} contract\n @notice This contract is part of the Graph Horizon payments protocol. It's designed\n to pull funds (GRT) from the {PaymentsEscrow} and distribute them according to a\n set of pre established rules.\n @custom:security-contact Please email security+contracts@thegraph.com if you find any\n bugs. We may have an active bug bounty program." + }, + "fullyImplemented": false, + "id": 2489, + "linearizedBaseContracts": [ + 2489 + ], + "name": "IGraphPayments", + "nameLocation": "485:14:23", + "nodeType": "ContractDefinition", + "nodes": [ + { + "canonicalName": "IGraphPayments.PaymentTypes", + "documentation": { + "id": 2429, + "nodeType": "StructuredDocumentation", + "src": "506:100:23", + "text": " @notice Types of payments that are supported by the payments protocol\n @dev" + }, + "id": 2433, + "members": [ + { + "id": 2430, + "name": "QueryFee", + "nameLocation": "639:8:23", + "nodeType": "EnumValue", + "src": "639:8:23" + }, + { + "id": 2431, + "name": "IndexingFee", + "nameLocation": "657:11:23", + "nodeType": "EnumValue", + "src": "657:11:23" + }, + { + "id": 2432, + "name": "IndexingRewards", + "nameLocation": "678:15:23", + "nodeType": "EnumValue", + "src": "678:15:23" + } + ], + "name": "PaymentTypes", + "nameLocation": "616:12:23", + "nodeType": "EnumDefinition", + "src": "611:88:23" + }, + { + "anonymous": false, + "documentation": { + "id": 2434, + "nodeType": "StructuredDocumentation", + "src": "705:715:23", + "text": " @notice Emitted when a payment is collected\n @param paymentType The type of payment as defined in {IGraphPayments}\n @param payer The address of the payer\n @param receiver The address of the receiver\n @param dataService The address of the data service\n @param tokens The total amount of tokens being collected\n @param tokensProtocol Amount of tokens charged as protocol tax\n @param tokensDataService Amount of tokens for the data service\n @param tokensDelegationPool Amount of tokens for delegators\n @param tokensReceiver Amount of tokens for the receiver\n @param receiverDestination The address where the receiver's payment cut is sent." + }, + "eventSelector": "b1ac8b16683562f4b1b5ecbe3321151b400058de5cdd25ac44d5bfacb106765f", + "id": 2457, + "name": "GraphPaymentCollected", + "nameLocation": "1431:21:23", + "nodeType": "EventDefinition", + "parameters": { + "id": 2456, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2437, + "indexed": true, + "mutability": "mutable", + "name": "paymentType", + "nameLocation": "1483:11:23", + "nodeType": "VariableDeclaration", + "scope": 2457, + "src": "1462:32:23", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_PaymentTypes_$2433", + "typeString": "enum IGraphPayments.PaymentTypes" + }, + "typeName": { + "id": 2436, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 2435, + "name": "PaymentTypes", + "nameLocations": [ + "1462:12:23" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 2433, + "src": "1462:12:23" + }, + "referencedDeclaration": 2433, + "src": "1462:12:23", + "typeDescriptions": { + "typeIdentifier": "t_enum$_PaymentTypes_$2433", + "typeString": "enum IGraphPayments.PaymentTypes" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2439, + "indexed": true, + "mutability": "mutable", + "name": "payer", + "nameLocation": "1520:5:23", + "nodeType": "VariableDeclaration", + "scope": 2457, + "src": "1504:21:23", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2438, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1504:7:23", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2441, + "indexed": false, + "mutability": "mutable", + "name": "receiver", + "nameLocation": "1543:8:23", + "nodeType": "VariableDeclaration", + "scope": 2457, + "src": "1535:16:23", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2440, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1535:7:23", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2443, + "indexed": true, + "mutability": "mutable", + "name": "dataService", + "nameLocation": "1577:11:23", + "nodeType": "VariableDeclaration", + "scope": 2457, + "src": "1561:27:23", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2442, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1561:7:23", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2445, + "indexed": false, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "1606:6:23", + "nodeType": "VariableDeclaration", + "scope": 2457, + "src": "1598:14:23", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2444, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1598:7:23", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2447, + "indexed": false, + "mutability": "mutable", + "name": "tokensProtocol", + "nameLocation": "1630:14:23", + "nodeType": "VariableDeclaration", + "scope": 2457, + "src": "1622:22:23", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2446, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1622:7:23", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2449, + "indexed": false, + "mutability": "mutable", + "name": "tokensDataService", + "nameLocation": "1662:17:23", + "nodeType": "VariableDeclaration", + "scope": 2457, + "src": "1654:25:23", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2448, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1654:7:23", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2451, + "indexed": false, + "mutability": "mutable", + "name": "tokensDelegationPool", + "nameLocation": "1697:20:23", + "nodeType": "VariableDeclaration", + "scope": 2457, + "src": "1689:28:23", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2450, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1689:7:23", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2453, + "indexed": false, + "mutability": "mutable", + "name": "tokensReceiver", + "nameLocation": "1735:14:23", + "nodeType": "VariableDeclaration", + "scope": 2457, + "src": "1727:22:23", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2452, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1727:7:23", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2455, + "indexed": false, + "mutability": "mutable", + "name": "receiverDestination", + "nameLocation": "1767:19:23", + "nodeType": "VariableDeclaration", + "scope": 2457, + "src": "1759:27:23", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2454, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1759:7:23", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "1452:340:23" + }, + "src": "1425:368:23" + }, + { + "documentation": { + "id": 2458, + "nodeType": "StructuredDocumentation", + "src": "1799:132:23", + "text": " @notice Thrown when the protocol payment cut is invalid\n @param protocolPaymentCut The protocol payment cut" + }, + "errorSelector": "d3097bcb", + "id": 2462, + "name": "GraphPaymentsInvalidProtocolPaymentCut", + "nameLocation": "1942:38:23", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 2461, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2460, + "mutability": "mutable", + "name": "protocolPaymentCut", + "nameLocation": "1989:18:23", + "nodeType": "VariableDeclaration", + "scope": 2462, + "src": "1981:26:23", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2459, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1981:7:23", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "1980:28:23" + }, + "src": "1936:73:23" + }, + { + "documentation": { + "id": 2463, + "nodeType": "StructuredDocumentation", + "src": "2015:113:23", + "text": " @notice Thrown when trying to use a cut that is not expressed in PPM\n @param cut The cut" + }, + "errorSelector": "e6dd8b94", + "id": 2467, + "name": "GraphPaymentsInvalidCut", + "nameLocation": "2139:23:23", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 2466, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2465, + "mutability": "mutable", + "name": "cut", + "nameLocation": "2171:3:23", + "nodeType": "VariableDeclaration", + "scope": 2467, + "src": "2163:11:23", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2464, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2163:7:23", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "2162:13:23" + }, + "src": "2133:43:23" + }, + { + "documentation": { + "id": 2468, + "nodeType": "StructuredDocumentation", + "src": "2182:50:23", + "text": " @notice Initialize the contract" + }, + "functionSelector": "8129fc1c", + "id": 2471, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "initialize", + "nameLocation": "2246:10:23", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2469, + "nodeType": "ParameterList", + "parameters": [], + "src": "2256:2:23" + }, + "returnParameters": { + "id": 2470, + "nodeType": "ParameterList", + "parameters": [], + "src": "2267:0:23" + }, + "scope": 2489, + "src": "2237:31:23", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 2472, + "nodeType": "StructuredDocumentation", + "src": "2274:849:23", + "text": " @notice Collects funds from a payer.\n It will pay cuts to all relevant parties and forward the rest to the receiver destination address. If the\n destination address is zero the funds are automatically staked to the receiver. Note that the receiver \n destination address can be set to the receiver address to collect funds on the receiver without re-staking.\n Note that the collected amount can be zero.\n @param paymentType The type of payment as defined in {IGraphPayments}\n @param receiver The address of the receiver\n @param tokens The amount of tokens being collected.\n @param dataService The address of the data service\n @param dataServiceCut The data service cut in PPM\n @param receiverDestination The address where the receiver's payment cut is sent." + }, + "functionSelector": "81cd11a0", + "id": 2488, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "collect", + "nameLocation": "3137:7:23", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2486, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2475, + "mutability": "mutable", + "name": "paymentType", + "nameLocation": "3167:11:23", + "nodeType": "VariableDeclaration", + "scope": 2488, + "src": "3154:24:23", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_PaymentTypes_$2433", + "typeString": "enum IGraphPayments.PaymentTypes" + }, + "typeName": { + "id": 2474, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 2473, + "name": "PaymentTypes", + "nameLocations": [ + "3154:12:23" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 2433, + "src": "3154:12:23" + }, + "referencedDeclaration": 2433, + "src": "3154:12:23", + "typeDescriptions": { + "typeIdentifier": "t_enum$_PaymentTypes_$2433", + "typeString": "enum IGraphPayments.PaymentTypes" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2477, + "mutability": "mutable", + "name": "receiver", + "nameLocation": "3196:8:23", + "nodeType": "VariableDeclaration", + "scope": 2488, + "src": "3188:16:23", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2476, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3188:7:23", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2479, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "3222:6:23", + "nodeType": "VariableDeclaration", + "scope": 2488, + "src": "3214:14:23", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2478, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "3214:7:23", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2481, + "mutability": "mutable", + "name": "dataService", + "nameLocation": "3246:11:23", + "nodeType": "VariableDeclaration", + "scope": 2488, + "src": "3238:19:23", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2480, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3238:7:23", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2483, + "mutability": "mutable", + "name": "dataServiceCut", + "nameLocation": "3275:14:23", + "nodeType": "VariableDeclaration", + "scope": 2488, + "src": "3267:22:23", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2482, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "3267:7:23", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2485, + "mutability": "mutable", + "name": "receiverDestination", + "nameLocation": "3307:19:23", + "nodeType": "VariableDeclaration", + "scope": 2488, + "src": "3299:27:23", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2484, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3299:7:23", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "3144:188:23" + }, + "returnParameters": { + "id": 2487, + "nodeType": "ParameterList", + "parameters": [], + "src": "3341:0:23" + }, + "scope": 2489, + "src": "3128:214:23", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + } + ], + "scope": 2490, + "src": "475:2869:23", + "usedErrors": [ + 2462, + 2467 + ], + "usedEvents": [ + 2457 + ] + } + ], + "src": "45:3300:23" + }, + "id": 23 + }, + "@graphprotocol/horizon/contracts/interfaces/IGraphProxyAdmin.sol": { + "ast": { + "absolutePath": "@graphprotocol/horizon/contracts/interfaces/IGraphProxyAdmin.sol", + "exportedSymbols": { + "IGraphProxyAdmin": [ + 2493 + ] + }, + "id": 2494, + "license": "GPL-2.0-or-later", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 2491, + "literals": [ + "solidity", + "0.8", + ".27" + ], + "nodeType": "PragmaDirective", + "src": "46:23:24" + }, + { + "abstract": false, + "baseContracts": [], + "canonicalName": "IGraphProxyAdmin", + "contractDependencies": [], + "contractKind": "interface", + "documentation": { + "id": 2492, + "nodeType": "StructuredDocumentation", + "src": "71:282:24", + "text": " @title IGraphProxyAdmin\n @dev Empty interface to allow the GraphProxyAdmin contract to be used\n in the GraphDirectory contract.\n @custom:security-contact Please email security+contracts@thegraph.com if you find any\n bugs. We may have an active bug bounty program." + }, + "fullyImplemented": true, + "id": 2493, + "linearizedBaseContracts": [ + 2493 + ], + "name": "IGraphProxyAdmin", + "nameLocation": "364:16:24", + "nodeType": "ContractDefinition", + "nodes": [], + "scope": 2494, + "src": "354:29:24", + "usedErrors": [], + "usedEvents": [] + } + ], + "src": "46:338:24" + }, + "id": 24 + }, + "@graphprotocol/horizon/contracts/interfaces/IGraphTallyCollector.sol": { + "ast": { + "absolutePath": "@graphprotocol/horizon/contracts/interfaces/IGraphTallyCollector.sol", + "exportedSymbols": { + "IGraphPayments": [ + 2489 + ], + "IGraphTallyCollector": [ + 2605 + ], + "IPaymentsCollector": [ + 2658 + ] + }, + "id": 2606, + "license": "GPL-3.0-or-later", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 2495, + "literals": [ + "solidity", + "0.8", + ".27" + ], + "nodeType": "PragmaDirective", + "src": "45:23:25" + }, + { + "absolutePath": "@graphprotocol/horizon/contracts/interfaces/IPaymentsCollector.sol", + "file": "./IPaymentsCollector.sol", + "id": 2497, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 2606, + "sourceUnit": 2659, + "src": "70:62:25", + "symbolAliases": [ + { + "foreign": { + "id": 2496, + "name": "IPaymentsCollector", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2658, + "src": "79:18:25", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "@graphprotocol/horizon/contracts/interfaces/IGraphPayments.sol", + "file": "./IGraphPayments.sol", + "id": 2499, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 2606, + "sourceUnit": 2490, + "src": "133:54:25", + "symbolAliases": [ + { + "foreign": { + "id": 2498, + "name": "IGraphPayments", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2489, + "src": "142:14:25", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "abstract": false, + "baseContracts": [ + { + "baseName": { + "id": 2501, + "name": "IPaymentsCollector", + "nameLocations": [ + "681:18:25" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 2658, + "src": "681:18:25" + }, + "id": 2502, + "nodeType": "InheritanceSpecifier", + "src": "681:18:25" + } + ], + "canonicalName": "IGraphTallyCollector", + "contractDependencies": [], + "contractKind": "interface", + "documentation": { + "id": 2500, + "nodeType": "StructuredDocumentation", + "src": "189:457:25", + "text": " @title Interface for the {GraphTallyCollector} contract\n @dev Implements the {IPaymentCollector} interface as defined by the Graph\n Horizon payments protocol.\n @notice Implements a payments collector contract that can be used to collect\n payments using a GraphTally RAV (Receipt Aggregate Voucher).\n @custom:security-contact Please email security+contracts@thegraph.com if you find any\n bugs. We may have an active bug bounty program." + }, + "fullyImplemented": false, + "id": 2605, + "linearizedBaseContracts": [ + 2605, + 2658 + ], + "name": "IGraphTallyCollector", + "nameLocation": "657:20:25", + "nodeType": "ContractDefinition", + "nodes": [ + { + "canonicalName": "IGraphTallyCollector.ReceiptAggregateVoucher", + "documentation": { + "id": 2503, + "nodeType": "StructuredDocumentation", + "src": "706:831:25", + "text": " @notice The Receipt Aggregate Voucher (RAV) struct\n @param collectionId The ID of the collection \"bucket\" the RAV belongs to. Note that multiple RAVs can be collected for the same collection id.\n @param payer The address of the payer the RAV was issued by\n @param serviceProvider The address of the service provider the RAV was issued to\n @param dataService The address of the data service the RAV was issued to\n @param timestampNs The RAV timestamp, indicating the latest GraphTally Receipt in the RAV\n @param valueAggregate The total amount owed to the service provider since the beginning of the payer-service provider relationship, including all debt that is already paid for.\n @param metadata Arbitrary metadata to extend functionality if a data service requires it" + }, + "id": 2518, + "members": [ + { + "constant": false, + "id": 2505, + "mutability": "mutable", + "name": "collectionId", + "nameLocation": "1591:12:25", + "nodeType": "VariableDeclaration", + "scope": 2518, + "src": "1583:20:25", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 2504, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1583:7:25", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2507, + "mutability": "mutable", + "name": "payer", + "nameLocation": "1621:5:25", + "nodeType": "VariableDeclaration", + "scope": 2518, + "src": "1613:13:25", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2506, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1613:7:25", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2509, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "1644:15:25", + "nodeType": "VariableDeclaration", + "scope": 2518, + "src": "1636:23:25", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2508, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1636:7:25", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2511, + "mutability": "mutable", + "name": "dataService", + "nameLocation": "1677:11:25", + "nodeType": "VariableDeclaration", + "scope": 2518, + "src": "1669:19:25", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2510, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1669:7:25", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2513, + "mutability": "mutable", + "name": "timestampNs", + "nameLocation": "1705:11:25", + "nodeType": "VariableDeclaration", + "scope": 2518, + "src": "1698:18:25", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + }, + "typeName": { + "id": 2512, + "name": "uint64", + "nodeType": "ElementaryTypeName", + "src": "1698:6:25", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2515, + "mutability": "mutable", + "name": "valueAggregate", + "nameLocation": "1734:14:25", + "nodeType": "VariableDeclaration", + "scope": 2518, + "src": "1726:22:25", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint128", + "typeString": "uint128" + }, + "typeName": { + "id": 2514, + "name": "uint128", + "nodeType": "ElementaryTypeName", + "src": "1726:7:25", + "typeDescriptions": { + "typeIdentifier": "t_uint128", + "typeString": "uint128" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2517, + "mutability": "mutable", + "name": "metadata", + "nameLocation": "1764:8:25", + "nodeType": "VariableDeclaration", + "scope": 2518, + "src": "1758:14:25", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 2516, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "1758:5:25", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "name": "ReceiptAggregateVoucher", + "nameLocation": "1549:23:25", + "nodeType": "StructDefinition", + "scope": 2605, + "src": "1542:237:25", + "visibility": "public" + }, + { + "canonicalName": "IGraphTallyCollector.SignedRAV", + "documentation": { + "id": 2519, + "nodeType": "StructuredDocumentation", + "src": "1785:191:25", + "text": " @notice A struct representing a signed RAV\n @param rav The RAV\n @param signature The signature of the RAV - 65 bytes: r (32 Bytes) || s (32 Bytes) || v (1 Byte)" + }, + "id": 2525, + "members": [ + { + "constant": false, + "id": 2522, + "mutability": "mutable", + "name": "rav", + "nameLocation": "2032:3:25", + "nodeType": "VariableDeclaration", + "scope": 2525, + "src": "2008:27:25", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_struct$_ReceiptAggregateVoucher_$2518_storage_ptr", + "typeString": "struct IGraphTallyCollector.ReceiptAggregateVoucher" + }, + "typeName": { + "id": 2521, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 2520, + "name": "ReceiptAggregateVoucher", + "nameLocations": [ + "2008:23:25" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 2518, + "src": "2008:23:25" + }, + "referencedDeclaration": 2518, + "src": "2008:23:25", + "typeDescriptions": { + "typeIdentifier": "t_struct$_ReceiptAggregateVoucher_$2518_storage_ptr", + "typeString": "struct IGraphTallyCollector.ReceiptAggregateVoucher" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2524, + "mutability": "mutable", + "name": "signature", + "nameLocation": "2051:9:25", + "nodeType": "VariableDeclaration", + "scope": 2525, + "src": "2045:15:25", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 2523, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "2045:5:25", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "name": "SignedRAV", + "nameLocation": "1988:9:25", + "nodeType": "StructDefinition", + "scope": 2605, + "src": "1981:86:25", + "visibility": "public" + }, + { + "anonymous": false, + "documentation": { + "id": 2526, + "nodeType": "StructuredDocumentation", + "src": "2073:525:25", + "text": " @notice Emitted when a RAV is collected\n @param collectionId The ID of the collection \"bucket\" the RAV belongs to.\n @param payer The address of the payer\n @param dataService The address of the data service\n @param serviceProvider The address of the service provider\n @param timestampNs The timestamp of the RAV\n @param valueAggregate The total amount owed to the service provider\n @param metadata Arbitrary metadata\n @param signature The signature of the RAV" + }, + "eventSelector": "3943fc3b19ec289c87b57de7a8bf1448d81ced03d1806144ecaca4ba9e976056", + "id": 2544, + "name": "RAVCollected", + "nameLocation": "2609:12:25", + "nodeType": "EventDefinition", + "parameters": { + "id": 2543, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2528, + "indexed": true, + "mutability": "mutable", + "name": "collectionId", + "nameLocation": "2647:12:25", + "nodeType": "VariableDeclaration", + "scope": 2544, + "src": "2631:28:25", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 2527, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "2631:7:25", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2530, + "indexed": true, + "mutability": "mutable", + "name": "payer", + "nameLocation": "2685:5:25", + "nodeType": "VariableDeclaration", + "scope": 2544, + "src": "2669:21:25", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2529, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2669:7:25", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2532, + "indexed": false, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "2708:15:25", + "nodeType": "VariableDeclaration", + "scope": 2544, + "src": "2700:23:25", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2531, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2700:7:25", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2534, + "indexed": true, + "mutability": "mutable", + "name": "dataService", + "nameLocation": "2749:11:25", + "nodeType": "VariableDeclaration", + "scope": 2544, + "src": "2733:27:25", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2533, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2733:7:25", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2536, + "indexed": false, + "mutability": "mutable", + "name": "timestampNs", + "nameLocation": "2777:11:25", + "nodeType": "VariableDeclaration", + "scope": 2544, + "src": "2770:18:25", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + }, + "typeName": { + "id": 2535, + "name": "uint64", + "nodeType": "ElementaryTypeName", + "src": "2770:6:25", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2538, + "indexed": false, + "mutability": "mutable", + "name": "valueAggregate", + "nameLocation": "2806:14:25", + "nodeType": "VariableDeclaration", + "scope": 2544, + "src": "2798:22:25", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint128", + "typeString": "uint128" + }, + "typeName": { + "id": 2537, + "name": "uint128", + "nodeType": "ElementaryTypeName", + "src": "2798:7:25", + "typeDescriptions": { + "typeIdentifier": "t_uint128", + "typeString": "uint128" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2540, + "indexed": false, + "mutability": "mutable", + "name": "metadata", + "nameLocation": "2836:8:25", + "nodeType": "VariableDeclaration", + "scope": 2544, + "src": "2830:14:25", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 2539, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "2830:5:25", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2542, + "indexed": false, + "mutability": "mutable", + "name": "signature", + "nameLocation": "2860:9:25", + "nodeType": "VariableDeclaration", + "scope": 2544, + "src": "2854:15:25", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 2541, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "2854:5:25", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "src": "2621:254:25" + }, + "src": "2603:273:25" + }, + { + "documentation": { + "id": 2545, + "nodeType": "StructuredDocumentation", + "src": "2882:64:25", + "text": " @notice Thrown when the RAV signer is invalid" + }, + "errorSelector": "aa415c33", + "id": 2547, + "name": "GraphTallyCollectorInvalidRAVSigner", + "nameLocation": "2957:35:25", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 2546, + "nodeType": "ParameterList", + "parameters": [], + "src": "2992:2:25" + }, + "src": "2951:44:25" + }, + { + "documentation": { + "id": 2548, + "nodeType": "StructuredDocumentation", + "src": "3001:168:25", + "text": " @notice Thrown when the RAV is for a data service the service provider has no provision for\n @param dataService The address of the data service" + }, + "errorSelector": "de8b47c0", + "id": 2552, + "name": "GraphTallyCollectorUnauthorizedDataService", + "nameLocation": "3180:42:25", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 2551, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2550, + "mutability": "mutable", + "name": "dataService", + "nameLocation": "3231:11:25", + "nodeType": "VariableDeclaration", + "scope": 2552, + "src": "3223:19:25", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2549, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3223:7:25", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "3222:21:25" + }, + "src": "3174:70:25" + }, + { + "documentation": { + "id": 2553, + "nodeType": "StructuredDocumentation", + "src": "3250:200:25", + "text": " @notice Thrown when the caller is not the data service the RAV was issued to\n @param caller The address of the caller\n @param dataService The address of the data service" + }, + "errorSelector": "56cbc92e", + "id": 2559, + "name": "GraphTallyCollectorCallerNotDataService", + "nameLocation": "3461:39:25", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 2558, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2555, + "mutability": "mutable", + "name": "caller", + "nameLocation": "3509:6:25", + "nodeType": "VariableDeclaration", + "scope": 2559, + "src": "3501:14:25", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2554, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3501:7:25", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2557, + "mutability": "mutable", + "name": "dataService", + "nameLocation": "3525:11:25", + "nodeType": "VariableDeclaration", + "scope": 2559, + "src": "3517:19:25", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2556, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3517:7:25", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "3500:37:25" + }, + "src": "3455:83:25" + }, + { + "documentation": { + "id": 2560, + "nodeType": "StructuredDocumentation", + "src": "3544:292:25", + "text": " @notice Thrown when the tokens collected are inconsistent with the collection history\n Each RAV should have a value greater than the previous one\n @param tokens The amount of tokens in the RAV\n @param tokensCollected The amount of tokens already collected" + }, + "errorSelector": "7007d4a1", + "id": 2566, + "name": "GraphTallyCollectorInconsistentRAVTokens", + "nameLocation": "3847:40:25", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 2565, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2562, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "3896:6:25", + "nodeType": "VariableDeclaration", + "scope": 2566, + "src": "3888:14:25", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2561, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "3888:7:25", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2564, + "mutability": "mutable", + "name": "tokensCollected", + "nameLocation": "3912:15:25", + "nodeType": "VariableDeclaration", + "scope": 2566, + "src": "3904:23:25", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2563, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "3904:7:25", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "3887:41:25" + }, + "src": "3841:88:25" + }, + { + "documentation": { + "id": 2567, + "nodeType": "StructuredDocumentation", + "src": "3935:231:25", + "text": " @notice Thrown when the attempting to collect more tokens than what it's owed\n @param tokensToCollect The amount of tokens to collect\n @param maxTokensToCollect The maximum amount of tokens to collect" + }, + "errorSelector": "c5602bb1", + "id": 2573, + "name": "GraphTallyCollectorInvalidTokensToCollectAmount", + "nameLocation": "4177:47:25", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 2572, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2569, + "mutability": "mutable", + "name": "tokensToCollect", + "nameLocation": "4233:15:25", + "nodeType": "VariableDeclaration", + "scope": 2573, + "src": "4225:23:25", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2568, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "4225:7:25", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2571, + "mutability": "mutable", + "name": "maxTokensToCollect", + "nameLocation": "4258:18:25", + "nodeType": "VariableDeclaration", + "scope": 2573, + "src": "4250:26:25", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2570, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "4250:7:25", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "4224:53:25" + }, + "src": "4171:107:25" + }, + { + "documentation": { + "id": 2574, + "nodeType": "StructuredDocumentation", + "src": "4284:813:25", + "text": " @notice See {IPaymentsCollector.collect}\n This variant adds the ability to partially collect a RAV by specifying the amount of tokens to collect.\n Requirements:\n - The amount of tokens to collect must be less than or equal to the total amount of tokens in the RAV minus\n the tokens already collected.\n @param paymentType The payment type to collect\n @param data Additional data required for the payment collection. Encoded as follows:\n - SignedRAV `signedRAV`: The signed RAV\n - uint256 `dataServiceCut`: The data service cut in PPM\n - address `receiverDestination`: The address where the receiver's payment should be sent.\n @param tokensToCollect The amount of tokens to collect\n @return The amount of tokens collected" + }, + "functionSelector": "692209ce", + "id": 2586, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "collect", + "nameLocation": "5111:7:25", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2582, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2577, + "mutability": "mutable", + "name": "paymentType", + "nameLocation": "5156:11:25", + "nodeType": "VariableDeclaration", + "scope": 2586, + "src": "5128:39:25", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_PaymentTypes_$2433", + "typeString": "enum IGraphPayments.PaymentTypes" + }, + "typeName": { + "id": 2576, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 2575, + "name": "IGraphPayments.PaymentTypes", + "nameLocations": [ + "5128:14:25", + "5143:12:25" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 2433, + "src": "5128:27:25" + }, + "referencedDeclaration": 2433, + "src": "5128:27:25", + "typeDescriptions": { + "typeIdentifier": "t_enum$_PaymentTypes_$2433", + "typeString": "enum IGraphPayments.PaymentTypes" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2579, + "mutability": "mutable", + "name": "data", + "nameLocation": "5192:4:25", + "nodeType": "VariableDeclaration", + "scope": 2586, + "src": "5177:19:25", + "stateVariable": false, + "storageLocation": "calldata", + "typeDescriptions": { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 2578, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "5177:5:25", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2581, + "mutability": "mutable", + "name": "tokensToCollect", + "nameLocation": "5214:15:25", + "nodeType": "VariableDeclaration", + "scope": 2586, + "src": "5206:23:25", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2580, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "5206:7:25", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "5118:117:25" + }, + "returnParameters": { + "id": 2585, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2584, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 2586, + "src": "5254:7:25", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2583, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "5254:7:25", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "5253:9:25" + }, + "scope": 2605, + "src": "5102:161:25", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 2587, + "nodeType": "StructuredDocumentation", + "src": "5269:212:25", + "text": " @dev Recovers the signer address of a signed ReceiptAggregateVoucher (RAV).\n @param signedRAV The SignedRAV containing the RAV and its signature.\n @return The address of the signer." + }, + "functionSelector": "63648817", + "id": 2595, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "recoverRAVSigner", + "nameLocation": "5495:16:25", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2591, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2590, + "mutability": "mutable", + "name": "signedRAV", + "nameLocation": "5531:9:25", + "nodeType": "VariableDeclaration", + "scope": 2595, + "src": "5512:28:25", + "stateVariable": false, + "storageLocation": "calldata", + "typeDescriptions": { + "typeIdentifier": "t_struct$_SignedRAV_$2525_calldata_ptr", + "typeString": "struct IGraphTallyCollector.SignedRAV" + }, + "typeName": { + "id": 2589, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 2588, + "name": "SignedRAV", + "nameLocations": [ + "5512:9:25" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 2525, + "src": "5512:9:25" + }, + "referencedDeclaration": 2525, + "src": "5512:9:25", + "typeDescriptions": { + "typeIdentifier": "t_struct$_SignedRAV_$2525_storage_ptr", + "typeString": "struct IGraphTallyCollector.SignedRAV" + } + }, + "visibility": "internal" + } + ], + "src": "5511:30:25" + }, + "returnParameters": { + "id": 2594, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2593, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 2595, + "src": "5565:7:25", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2592, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5565:7:25", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "5564:9:25" + }, + "scope": 2605, + "src": "5486:88:25", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 2596, + "nodeType": "StructuredDocumentation", + "src": "5580:170:25", + "text": " @dev Computes the hash of a ReceiptAggregateVoucher (RAV).\n @param rav The RAV for which to compute the hash.\n @return The hash of the RAV." + }, + "functionSelector": "26969c4c", + "id": 2604, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "encodeRAV", + "nameLocation": "5764:9:25", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2600, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2599, + "mutability": "mutable", + "name": "rav", + "nameLocation": "5807:3:25", + "nodeType": "VariableDeclaration", + "scope": 2604, + "src": "5774:36:25", + "stateVariable": false, + "storageLocation": "calldata", + "typeDescriptions": { + "typeIdentifier": "t_struct$_ReceiptAggregateVoucher_$2518_calldata_ptr", + "typeString": "struct IGraphTallyCollector.ReceiptAggregateVoucher" + }, + "typeName": { + "id": 2598, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 2597, + "name": "ReceiptAggregateVoucher", + "nameLocations": [ + "5774:23:25" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 2518, + "src": "5774:23:25" + }, + "referencedDeclaration": 2518, + "src": "5774:23:25", + "typeDescriptions": { + "typeIdentifier": "t_struct$_ReceiptAggregateVoucher_$2518_storage_ptr", + "typeString": "struct IGraphTallyCollector.ReceiptAggregateVoucher" + } + }, + "visibility": "internal" + } + ], + "src": "5773:38:25" + }, + "returnParameters": { + "id": 2603, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2602, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 2604, + "src": "5835:7:25", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 2601, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "5835:7:25", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "5834:9:25" + }, + "scope": 2605, + "src": "5755:89:25", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + } + ], + "scope": 2606, + "src": "647:5199:25", + "usedErrors": [ + 2547, + 2552, + 2559, + 2566, + 2573 + ], + "usedEvents": [ + 2544, + 2646 + ] + } + ], + "src": "45:5802:25" + }, + "id": 25 + }, + "@graphprotocol/horizon/contracts/interfaces/IHorizonStaking.sol": { + "ast": { + "absolutePath": "@graphprotocol/horizon/contracts/interfaces/IHorizonStaking.sol", + "exportedSymbols": { + "IHorizonStaking": [ + 2625 + ], + "IHorizonStakingBase": [ + 3046 + ], + "IHorizonStakingExtension": [ + 3226 + ], + "IHorizonStakingMain": [ + 3937 + ], + "IHorizonStakingTypes": [ + 4073 + ] + }, + "id": 2626, + "license": "GPL-2.0-or-later", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 2607, + "literals": [ + "solidity", + "0.8", + ".27" + ], + "nodeType": "PragmaDirective", + "src": "46:23:26" + }, + { + "absolutePath": "@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingTypes.sol", + "file": "./internal/IHorizonStakingTypes.sol", + "id": 2609, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 2626, + "sourceUnit": 4074, + "src": "71:75:26", + "symbolAliases": [ + { + "foreign": { + "id": 2608, + "name": "IHorizonStakingTypes", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4073, + "src": "80:20:26", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingMain.sol", + "file": "./internal/IHorizonStakingMain.sol", + "id": 2611, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 2626, + "sourceUnit": 3938, + "src": "147:73:26", + "symbolAliases": [ + { + "foreign": { + "id": 2610, + "name": "IHorizonStakingMain", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3937, + "src": "156:19:26", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingBase.sol", + "file": "./internal/IHorizonStakingBase.sol", + "id": 2613, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 2626, + "sourceUnit": 3047, + "src": "221:73:26", + "symbolAliases": [ + { + "foreign": { + "id": 2612, + "name": "IHorizonStakingBase", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3046, + "src": "230:19:26", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingExtension.sol", + "file": "./internal/IHorizonStakingExtension.sol", + "id": 2615, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 2626, + "sourceUnit": 3227, + "src": "295:83:26", + "symbolAliases": [ + { + "foreign": { + "id": 2614, + "name": "IHorizonStakingExtension", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3226, + "src": "304:24:26", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "abstract": false, + "baseContracts": [ + { + "baseName": { + "id": 2617, + "name": "IHorizonStakingTypes", + "nameLocations": [ + "888:20:26" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 4073, + "src": "888:20:26" + }, + "id": 2618, + "nodeType": "InheritanceSpecifier", + "src": "888:20:26" + }, + { + "baseName": { + "id": 2619, + "name": "IHorizonStakingBase", + "nameLocations": [ + "910:19:26" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 3046, + "src": "910:19:26" + }, + "id": 2620, + "nodeType": "InheritanceSpecifier", + "src": "910:19:26" + }, + { + "baseName": { + "id": 2621, + "name": "IHorizonStakingMain", + "nameLocations": [ + "931:19:26" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 3937, + "src": "931:19:26" + }, + "id": 2622, + "nodeType": "InheritanceSpecifier", + "src": "931:19:26" + }, + { + "baseName": { + "id": 2623, + "name": "IHorizonStakingExtension", + "nameLocations": [ + "952:24:26" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 3226, + "src": "952:24:26" + }, + "id": 2624, + "nodeType": "InheritanceSpecifier", + "src": "952:24:26" + } + ], + "canonicalName": "IHorizonStaking", + "contractDependencies": [], + "contractKind": "interface", + "documentation": { + "id": 2616, + "nodeType": "StructuredDocumentation", + "src": "380:478:26", + "text": " @title Complete interface for the Horizon Staking contract\n @notice This interface exposes all functions implemented by the {HorizonStaking} contract and its extension\n {HorizonStakingExtension} as well as the custom data types used by the contract.\n @dev Use this interface to interact with the Horizon Staking contract.\n @custom:security-contact Please email security+contracts@thegraph.com if you find any\n bugs. We may have an active bug bounty program." + }, + "fullyImplemented": false, + "id": 2625, + "linearizedBaseContracts": [ + 2625, + 3226, + 561, + 3937, + 3046, + 4073 + ], + "name": "IHorizonStaking", + "nameLocation": "869:15:26", + "nodeType": "ContractDefinition", + "nodes": [], + "scope": 2626, + "src": "859:120:26", + "usedErrors": [ + 2877, + 3500, + 3507, + 3514, + 3521, + 3530, + 3535, + 3540, + 3547, + 3550, + 3557, + 3564, + 3571, + 3574, + 3581, + 3588, + 3595, + 3602, + 3605, + 3608, + 3611, + 3614, + 3617, + 3622, + 3627, + 3630, + 3635, + 3638, + 3641 + ], + "usedEvents": [ + 2874, + 3097, + 3122, + 3133, + 3242, + 3249, + 3262, + 3271, + 3280, + 3289, + 3300, + 3311, + 3322, + 3331, + 3340, + 3349, + 3360, + 3373, + 3386, + 3397, + 3406, + 3415, + 3427, + 3447, + 3463, + 3479, + 3484, + 3491, + 3494, + 3497 + ] + } + ], + "src": "46:934:26" + }, + "id": 26 + }, + "@graphprotocol/horizon/contracts/interfaces/IPaymentsCollector.sol": { + "ast": { + "absolutePath": "@graphprotocol/horizon/contracts/interfaces/IPaymentsCollector.sol", + "exportedSymbols": { + "IGraphPayments": [ + 2489 + ], + "IPaymentsCollector": [ + 2658 + ] + }, + "id": 2659, + "license": "GPL-2.0-or-later", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 2627, + "literals": [ + "solidity", + "0.8", + ".27" + ], + "nodeType": "PragmaDirective", + "src": "46:23:27" + }, + { + "absolutePath": "@graphprotocol/horizon/contracts/interfaces/IGraphPayments.sol", + "file": "./IGraphPayments.sol", + "id": 2629, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 2659, + "sourceUnit": 2490, + "src": "71:54:27", + "symbolAliases": [ + { + "foreign": { + "id": 2628, + "name": "IGraphPayments", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2489, + "src": "80:14:27", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "abstract": false, + "baseContracts": [], + "canonicalName": "IPaymentsCollector", + "contractDependencies": [], + "contractKind": "interface", + "documentation": { + "id": 2630, + "nodeType": "StructuredDocumentation", + "src": "127:631:27", + "text": " @title Interface for a payments collector contract as defined by Graph Horizon payments protocol\n @notice Contracts implementing this interface can be used with the payments protocol. First, a payer must\n approve the collector to collect payments on their behalf. Only then can payment collection be initiated\n using the collector contract.\n @dev It's important to note that it's the collector contract's responsibility to validate the payment\n request is legitimate.\n @custom:security-contact Please email security+contracts@thegraph.com if you find any\n bugs. We may have an active bug bounty program." + }, + "fullyImplemented": false, + "id": 2658, + "linearizedBaseContracts": [ + 2658 + ], + "name": "IPaymentsCollector", + "nameLocation": "769:18:27", + "nodeType": "ContractDefinition", + "nodes": [ + { + "anonymous": false, + "documentation": { + "id": 2631, + "nodeType": "StructuredDocumentation", + "src": "794:487:27", + "text": " @notice Emitted when a payment is collected\n @param paymentType The payment type collected as defined by {IGraphPayments}\n @param collectionId The id for the collection. Can be used at the discretion of the collector to group multiple payments.\n @param payer The address of the payer\n @param receiver The address of the receiver\n @param dataService The address of the data service\n @param tokens The amount of tokens being collected" + }, + "eventSelector": "481a17595c709e8f745444fb9ffc8f0b5e98458de94463971947f548e12bbdb4", + "id": 2646, + "name": "PaymentCollected", + "nameLocation": "1292:16:27", + "nodeType": "EventDefinition", + "parameters": { + "id": 2645, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2634, + "indexed": false, + "mutability": "mutable", + "name": "paymentType", + "nameLocation": "1346:11:27", + "nodeType": "VariableDeclaration", + "scope": 2646, + "src": "1318:39:27", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_PaymentTypes_$2433", + "typeString": "enum IGraphPayments.PaymentTypes" + }, + "typeName": { + "id": 2633, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 2632, + "name": "IGraphPayments.PaymentTypes", + "nameLocations": [ + "1318:14:27", + "1333:12:27" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 2433, + "src": "1318:27:27" + }, + "referencedDeclaration": 2433, + "src": "1318:27:27", + "typeDescriptions": { + "typeIdentifier": "t_enum$_PaymentTypes_$2433", + "typeString": "enum IGraphPayments.PaymentTypes" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2636, + "indexed": true, + "mutability": "mutable", + "name": "collectionId", + "nameLocation": "1383:12:27", + "nodeType": "VariableDeclaration", + "scope": 2646, + "src": "1367:28:27", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 2635, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1367:7:27", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2638, + "indexed": true, + "mutability": "mutable", + "name": "payer", + "nameLocation": "1421:5:27", + "nodeType": "VariableDeclaration", + "scope": 2646, + "src": "1405:21:27", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2637, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1405:7:27", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2640, + "indexed": false, + "mutability": "mutable", + "name": "receiver", + "nameLocation": "1444:8:27", + "nodeType": "VariableDeclaration", + "scope": 2646, + "src": "1436:16:27", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2639, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1436:7:27", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2642, + "indexed": true, + "mutability": "mutable", + "name": "dataService", + "nameLocation": "1478:11:27", + "nodeType": "VariableDeclaration", + "scope": 2646, + "src": "1462:27:27", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2641, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1462:7:27", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2644, + "indexed": false, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "1507:6:27", + "nodeType": "VariableDeclaration", + "scope": 2646, + "src": "1499:14:27", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2643, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1499:7:27", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "1308:211:27" + }, + "src": "1286:234:27" + }, + { + "documentation": { + "id": 2647, + "nodeType": "StructuredDocumentation", + "src": "1526:613:27", + "text": " @notice Initiate a payment collection through the payments protocol\n @dev This function should require the caller to present some form of evidence of the payer's debt to\n the receiver. The collector should validate this evidence and, if valid, collect the payment.\n Emits a {PaymentCollected} event\n @param paymentType The payment type to collect, as defined by {IGraphPayments}\n @param data Additional data required for the payment collection. Will vary depending on the collector\n implementation.\n @return The amount of tokens collected" + }, + "functionSelector": "7f07d283", + "id": 2657, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "collect", + "nameLocation": "2153:7:27", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2653, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2650, + "mutability": "mutable", + "name": "paymentType", + "nameLocation": "2189:11:27", + "nodeType": "VariableDeclaration", + "scope": 2657, + "src": "2161:39:27", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_PaymentTypes_$2433", + "typeString": "enum IGraphPayments.PaymentTypes" + }, + "typeName": { + "id": 2649, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 2648, + "name": "IGraphPayments.PaymentTypes", + "nameLocations": [ + "2161:14:27", + "2176:12:27" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 2433, + "src": "2161:27:27" + }, + "referencedDeclaration": 2433, + "src": "2161:27:27", + "typeDescriptions": { + "typeIdentifier": "t_enum$_PaymentTypes_$2433", + "typeString": "enum IGraphPayments.PaymentTypes" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2652, + "mutability": "mutable", + "name": "data", + "nameLocation": "2215:4:27", + "nodeType": "VariableDeclaration", + "scope": 2657, + "src": "2202:17:27", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 2651, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "2202:5:27", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "src": "2160:60:27" + }, + "returnParameters": { + "id": 2656, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2655, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 2657, + "src": "2239:7:27", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2654, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2239:7:27", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "2238:9:27" + }, + "scope": 2658, + "src": "2144:104:27", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + } + ], + "scope": 2659, + "src": "759:1491:27", + "usedErrors": [], + "usedEvents": [ + 2646 + ] + } + ], + "src": "46:2205:27" + }, + "id": 27 + }, + "@graphprotocol/horizon/contracts/interfaces/IPaymentsEscrow.sol": { + "ast": { + "absolutePath": "@graphprotocol/horizon/contracts/interfaces/IPaymentsEscrow.sol", + "exportedSymbols": { + "IGraphPayments": [ + 2489 + ], + "IPaymentsEscrow": [ + 2858 + ] + }, + "id": 2859, + "license": "GPL-3.0-or-later", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 2660, + "literals": [ + "solidity", + "0.8", + ".27" + ], + "nodeType": "PragmaDirective", + "src": "45:23:28" + }, + { + "absolutePath": "@graphprotocol/horizon/contracts/interfaces/IGraphPayments.sol", + "file": "./IGraphPayments.sol", + "id": 2662, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 2859, + "sourceUnit": 2490, + "src": "70:54:28", + "symbolAliases": [ + { + "foreign": { + "id": 2661, + "name": "IGraphPayments", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2489, + "src": "79:14:28", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "abstract": false, + "baseContracts": [], + "canonicalName": "IPaymentsEscrow", + "contractDependencies": [], + "contractKind": "interface", + "documentation": { + "id": 2663, + "nodeType": "StructuredDocumentation", + "src": "126:771:28", + "text": " @title Interface for the {PaymentsEscrow} contract\n @notice This contract is part of the Graph Horizon payments protocol. It holds the funds (GRT)\n for payments made through the payments protocol for services provided\n via a Graph Horizon data service.\n Payers deposit funds on the escrow, signalling their ability to pay for a service, and only\n being able to retrieve them after a thawing period. Receivers collect funds from the escrow,\n provided the payer has authorized them. The payer authorization is delegated to a payment\n collector contract which implements the {IPaymentsCollector} interface.\n @custom:security-contact Please email security+contracts@thegraph.com if you find any\n bugs. We may have an active bug bounty program." + }, + "fullyImplemented": false, + "id": 2858, + "linearizedBaseContracts": [ + 2858 + ], + "name": "IPaymentsEscrow", + "nameLocation": "908:15:28", + "nodeType": "ContractDefinition", + "nodes": [ + { + "canonicalName": "IPaymentsEscrow.EscrowAccount", + "documentation": { + "id": 2664, + "nodeType": "StructuredDocumentation", + "src": "930:331:28", + "text": " @notice Escrow account for a payer-collector-receiver tuple\n @param balance The total token balance for the payer-collector-receiver tuple\n @param tokensThawing The amount of tokens currently being thawed\n @param thawEndTimestamp The timestamp at which thawing period ends (zero if not thawing)" + }, + "id": 2671, + "members": [ + { + "constant": false, + "id": 2666, + "mutability": "mutable", + "name": "balance", + "nameLocation": "1305:7:28", + "nodeType": "VariableDeclaration", + "scope": 2671, + "src": "1297:15:28", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2665, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1297:7:28", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2668, + "mutability": "mutable", + "name": "tokensThawing", + "nameLocation": "1330:13:28", + "nodeType": "VariableDeclaration", + "scope": 2671, + "src": "1322:21:28", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2667, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1322:7:28", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2670, + "mutability": "mutable", + "name": "thawEndTimestamp", + "nameLocation": "1361:16:28", + "nodeType": "VariableDeclaration", + "scope": 2671, + "src": "1353:24:28", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2669, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1353:7:28", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "name": "EscrowAccount", + "nameLocation": "1273:13:28", + "nodeType": "StructDefinition", + "scope": 2858, + "src": "1266:118:28", + "visibility": "public" + }, + { + "anonymous": false, + "documentation": { + "id": 2672, + "nodeType": "StructuredDocumentation", + "src": "1390:316:28", + "text": " @notice Emitted when a payer deposits funds into the escrow for a payer-collector-receiver tuple\n @param payer The address of the payer\n @param collector The address of the collector\n @param receiver The address of the receiver\n @param tokens The amount of tokens deposited" + }, + "eventSelector": "7cfff908a4b583f36430b25d75964c458d8ede8a99bd61be750e97ee1b2f3a96", + "id": 2682, + "name": "Deposit", + "nameLocation": "1717:7:28", + "nodeType": "EventDefinition", + "parameters": { + "id": 2681, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2674, + "indexed": true, + "mutability": "mutable", + "name": "payer", + "nameLocation": "1741:5:28", + "nodeType": "VariableDeclaration", + "scope": 2682, + "src": "1725:21:28", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2673, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1725:7:28", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2676, + "indexed": true, + "mutability": "mutable", + "name": "collector", + "nameLocation": "1764:9:28", + "nodeType": "VariableDeclaration", + "scope": 2682, + "src": "1748:25:28", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2675, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1748:7:28", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2678, + "indexed": true, + "mutability": "mutable", + "name": "receiver", + "nameLocation": "1791:8:28", + "nodeType": "VariableDeclaration", + "scope": 2682, + "src": "1775:24:28", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2677, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1775:7:28", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2680, + "indexed": false, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "1809:6:28", + "nodeType": "VariableDeclaration", + "scope": 2682, + "src": "1801:14:28", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2679, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1801:7:28", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "1724:92:28" + }, + "src": "1711:106:28" + }, + { + "anonymous": false, + "documentation": { + "id": 2683, + "nodeType": "StructuredDocumentation", + "src": "1823:378:28", + "text": " @notice Emitted when a payer cancels an escrow thawing\n @param payer The address of the payer\n @param collector The address of the collector\n @param receiver The address of the receiver\n @param tokensThawing The amount of tokens that were being thawed\n @param thawEndTimestamp The timestamp at which the thawing period was ending" + }, + "eventSelector": "6c4ed34e7347a8682024ee40d393e45f4075c46c593aaaed3cc3e49dd6933535", + "id": 2695, + "name": "CancelThaw", + "nameLocation": "2212:10:28", + "nodeType": "EventDefinition", + "parameters": { + "id": 2694, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2685, + "indexed": true, + "mutability": "mutable", + "name": "payer", + "nameLocation": "2248:5:28", + "nodeType": "VariableDeclaration", + "scope": 2695, + "src": "2232:21:28", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2684, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2232:7:28", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2687, + "indexed": true, + "mutability": "mutable", + "name": "collector", + "nameLocation": "2279:9:28", + "nodeType": "VariableDeclaration", + "scope": 2695, + "src": "2263:25:28", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2686, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2263:7:28", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2689, + "indexed": true, + "mutability": "mutable", + "name": "receiver", + "nameLocation": "2314:8:28", + "nodeType": "VariableDeclaration", + "scope": 2695, + "src": "2298:24:28", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2688, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2298:7:28", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2691, + "indexed": false, + "mutability": "mutable", + "name": "tokensThawing", + "nameLocation": "2340:13:28", + "nodeType": "VariableDeclaration", + "scope": 2695, + "src": "2332:21:28", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2690, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2332:7:28", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2693, + "indexed": false, + "mutability": "mutable", + "name": "thawEndTimestamp", + "nameLocation": "2371:16:28", + "nodeType": "VariableDeclaration", + "scope": 2695, + "src": "2363:24:28", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2692, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2363:7:28", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "2222:171:28" + }, + "src": "2206:188:28" + }, + { + "anonymous": false, + "documentation": { + "id": 2696, + "nodeType": "StructuredDocumentation", + "src": "2400:394:28", + "text": " @notice Emitted when a payer thaws funds from the escrow for a payer-collector-receiver tuple\n @param payer The address of the payer\n @param collector The address of the collector\n @param receiver The address of the receiver\n @param tokens The amount of tokens being thawed\n @param thawEndTimestamp The timestamp at which the thawing period ends" + }, + "eventSelector": "ba109e8a47e57c895aa1802554cd51025499c2b07c3c9b467c70413a4434ffbc", + "id": 2708, + "name": "Thaw", + "nameLocation": "2805:4:28", + "nodeType": "EventDefinition", + "parameters": { + "id": 2707, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2698, + "indexed": true, + "mutability": "mutable", + "name": "payer", + "nameLocation": "2835:5:28", + "nodeType": "VariableDeclaration", + "scope": 2708, + "src": "2819:21:28", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2697, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2819:7:28", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2700, + "indexed": true, + "mutability": "mutable", + "name": "collector", + "nameLocation": "2866:9:28", + "nodeType": "VariableDeclaration", + "scope": 2708, + "src": "2850:25:28", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2699, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2850:7:28", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2702, + "indexed": true, + "mutability": "mutable", + "name": "receiver", + "nameLocation": "2901:8:28", + "nodeType": "VariableDeclaration", + "scope": 2708, + "src": "2885:24:28", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2701, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2885:7:28", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2704, + "indexed": false, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "2927:6:28", + "nodeType": "VariableDeclaration", + "scope": 2708, + "src": "2919:14:28", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2703, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2919:7:28", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2706, + "indexed": false, + "mutability": "mutable", + "name": "thawEndTimestamp", + "nameLocation": "2951:16:28", + "nodeType": "VariableDeclaration", + "scope": 2708, + "src": "2943:24:28", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2705, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2943:7:28", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "2809:164:28" + }, + "src": "2799:175:28" + }, + { + "anonymous": false, + "documentation": { + "id": 2709, + "nodeType": "StructuredDocumentation", + "src": "2980:317:28", + "text": " @notice Emitted when a payer withdraws funds from the escrow for a payer-collector-receiver tuple\n @param payer The address of the payer\n @param collector The address of the collector\n @param receiver The address of the receiver\n @param tokens The amount of tokens withdrawn" + }, + "eventSelector": "3115d1449a7b732c986cba18244e897a450f61e1bb8d589cd2e69e6c8924f9f7", + "id": 2719, + "name": "Withdraw", + "nameLocation": "3308:8:28", + "nodeType": "EventDefinition", + "parameters": { + "id": 2718, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2711, + "indexed": true, + "mutability": "mutable", + "name": "payer", + "nameLocation": "3333:5:28", + "nodeType": "VariableDeclaration", + "scope": 2719, + "src": "3317:21:28", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2710, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3317:7:28", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2713, + "indexed": true, + "mutability": "mutable", + "name": "collector", + "nameLocation": "3356:9:28", + "nodeType": "VariableDeclaration", + "scope": 2719, + "src": "3340:25:28", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2712, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3340:7:28", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2715, + "indexed": true, + "mutability": "mutable", + "name": "receiver", + "nameLocation": "3383:8:28", + "nodeType": "VariableDeclaration", + "scope": 2719, + "src": "3367:24:28", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2714, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3367:7:28", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2717, + "indexed": false, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "3401:6:28", + "nodeType": "VariableDeclaration", + "scope": 2719, + "src": "3393:14:28", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2716, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "3393:7:28", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "3316:92:28" + }, + "src": "3302:107:28" + }, + { + "anonymous": false, + "documentation": { + "id": 2720, + "nodeType": "StructuredDocumentation", + "src": "3415:518:28", + "text": " @notice Emitted when a collector collects funds from the escrow for a payer-collector-receiver tuple\n @param paymentType The type of payment being collected as defined in the {IGraphPayments} interface\n @param payer The address of the payer\n @param collector The address of the collector\n @param receiver The address of the receiver\n @param tokens The amount of tokens collected\n @param receiverDestination The address where the receiver's payment should be sent." + }, + "eventSelector": "399b99b484be516eace7ececa486139581a25b0d2d12dac8bfa0948d07a8c913", + "id": 2735, + "name": "EscrowCollected", + "nameLocation": "3944:15:28", + "nodeType": "EventDefinition", + "parameters": { + "id": 2734, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2723, + "indexed": true, + "mutability": "mutable", + "name": "paymentType", + "nameLocation": "4005:11:28", + "nodeType": "VariableDeclaration", + "scope": 2735, + "src": "3969:47:28", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_PaymentTypes_$2433", + "typeString": "enum IGraphPayments.PaymentTypes" + }, + "typeName": { + "id": 2722, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 2721, + "name": "IGraphPayments.PaymentTypes", + "nameLocations": [ + "3969:14:28", + "3984:12:28" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 2433, + "src": "3969:27:28" + }, + "referencedDeclaration": 2433, + "src": "3969:27:28", + "typeDescriptions": { + "typeIdentifier": "t_enum$_PaymentTypes_$2433", + "typeString": "enum IGraphPayments.PaymentTypes" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2725, + "indexed": true, + "mutability": "mutable", + "name": "payer", + "nameLocation": "4042:5:28", + "nodeType": "VariableDeclaration", + "scope": 2735, + "src": "4026:21:28", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2724, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4026:7:28", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2727, + "indexed": true, + "mutability": "mutable", + "name": "collector", + "nameLocation": "4073:9:28", + "nodeType": "VariableDeclaration", + "scope": 2735, + "src": "4057:25:28", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2726, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4057:7:28", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2729, + "indexed": false, + "mutability": "mutable", + "name": "receiver", + "nameLocation": "4100:8:28", + "nodeType": "VariableDeclaration", + "scope": 2735, + "src": "4092:16:28", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2728, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4092:7:28", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2731, + "indexed": false, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "4126:6:28", + "nodeType": "VariableDeclaration", + "scope": 2735, + "src": "4118:14:28", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2730, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "4118:7:28", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2733, + "indexed": false, + "mutability": "mutable", + "name": "receiverDestination", + "nameLocation": "4150:19:28", + "nodeType": "VariableDeclaration", + "scope": 2735, + "src": "4142:27:28", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2732, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4142:7:28", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "3959:216:28" + }, + "src": "3938:238:28" + }, + { + "documentation": { + "id": 2736, + "nodeType": "StructuredDocumentation", + "src": "4203:97:28", + "text": " @notice Thrown when a protected function is called and the contract is paused." + }, + "errorSelector": "9e68cf0b", + "id": 2738, + "name": "PaymentsEscrowIsPaused", + "nameLocation": "4311:22:28", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 2737, + "nodeType": "ParameterList", + "parameters": [], + "src": "4333:2:28" + }, + "src": "4305:31:28" + }, + { + "documentation": { + "id": 2739, + "nodeType": "StructuredDocumentation", + "src": "4342:196:28", + "text": " @notice Thrown when the available balance is insufficient to perform an operation\n @param balance The current balance\n @param minBalance The minimum required balance" + }, + "errorSelector": "3db4e691", + "id": 2745, + "name": "PaymentsEscrowInsufficientBalance", + "nameLocation": "4549:33:28", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 2744, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2741, + "mutability": "mutable", + "name": "balance", + "nameLocation": "4591:7:28", + "nodeType": "VariableDeclaration", + "scope": 2745, + "src": "4583:15:28", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2740, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "4583:7:28", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2743, + "mutability": "mutable", + "name": "minBalance", + "nameLocation": "4608:10:28", + "nodeType": "VariableDeclaration", + "scope": 2745, + "src": "4600:18:28", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2742, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "4600:7:28", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "4582:37:28" + }, + "src": "4543:77:28" + }, + { + "documentation": { + "id": 2746, + "nodeType": "StructuredDocumentation", + "src": "4626:92:28", + "text": " @notice Thrown when a thawing is expected to be in progress but it is not" + }, + "errorSelector": "8cbd172f", + "id": 2748, + "name": "PaymentsEscrowNotThawing", + "nameLocation": "4729:24:28", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 2747, + "nodeType": "ParameterList", + "parameters": [], + "src": "4753:2:28" + }, + "src": "4723:33:28" + }, + { + "documentation": { + "id": 2749, + "nodeType": "StructuredDocumentation", + "src": "4762:200:28", + "text": " @notice Thrown when a thawing is still in progress\n @param currentTimestamp The current timestamp\n @param thawEndTimestamp The timestamp at which the thawing period ends" + }, + "errorSelector": "78a1b6f2", + "id": 2755, + "name": "PaymentsEscrowStillThawing", + "nameLocation": "4973:26:28", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 2754, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2751, + "mutability": "mutable", + "name": "currentTimestamp", + "nameLocation": "5008:16:28", + "nodeType": "VariableDeclaration", + "scope": 2755, + "src": "5000:24:28", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2750, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "5000:7:28", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2753, + "mutability": "mutable", + "name": "thawEndTimestamp", + "nameLocation": "5034:16:28", + "nodeType": "VariableDeclaration", + "scope": 2755, + "src": "5026:24:28", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2752, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "5026:7:28", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "4999:52:28" + }, + "src": "4967:85:28" + }, + { + "documentation": { + "id": 2756, + "nodeType": "StructuredDocumentation", + "src": "5058:200:28", + "text": " @notice Thrown when setting the thawing period to a value greater than the maximum\n @param thawingPeriod The thawing period\n @param maxWaitPeriod The maximum wait period" + }, + "errorSelector": "5c0f65a1", + "id": 2762, + "name": "PaymentsEscrowThawingPeriodTooLong", + "nameLocation": "5269:34:28", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 2761, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2758, + "mutability": "mutable", + "name": "thawingPeriod", + "nameLocation": "5312:13:28", + "nodeType": "VariableDeclaration", + "scope": 2762, + "src": "5304:21:28", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2757, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "5304:7:28", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2760, + "mutability": "mutable", + "name": "maxWaitPeriod", + "nameLocation": "5335:13:28", + "nodeType": "VariableDeclaration", + "scope": 2762, + "src": "5327:21:28", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2759, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "5327:7:28", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "5303:46:28" + }, + "src": "5263:87:28" + }, + { + "documentation": { + "id": 2763, + "nodeType": "StructuredDocumentation", + "src": "5356:278:28", + "text": " @notice Thrown when the contract balance is not consistent with the collection amount\n @param balanceBefore The balance before the collection\n @param balanceAfter The balance after the collection\n @param tokens The amount of tokens collected" + }, + "errorSelector": "7e09c9ac", + "id": 2771, + "name": "PaymentsEscrowInconsistentCollection", + "nameLocation": "5645:36:28", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 2770, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2765, + "mutability": "mutable", + "name": "balanceBefore", + "nameLocation": "5690:13:28", + "nodeType": "VariableDeclaration", + "scope": 2771, + "src": "5682:21:28", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2764, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "5682:7:28", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2767, + "mutability": "mutable", + "name": "balanceAfter", + "nameLocation": "5713:12:28", + "nodeType": "VariableDeclaration", + "scope": 2771, + "src": "5705:20:28", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2766, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "5705:7:28", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2769, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "5735:6:28", + "nodeType": "VariableDeclaration", + "scope": 2771, + "src": "5727:14:28", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2768, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "5727:7:28", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "5681:61:28" + }, + "src": "5639:104:28" + }, + { + "documentation": { + "id": 2772, + "nodeType": "StructuredDocumentation", + "src": "5749:84:28", + "text": " @notice Thrown when operating a zero token amount is not allowed." + }, + "errorSelector": "ebfc7cdc", + "id": 2774, + "name": "PaymentsEscrowInvalidZeroTokens", + "nameLocation": "5844:31:28", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 2773, + "nodeType": "ParameterList", + "parameters": [], + "src": "5875:2:28" + }, + "src": "5838:40:28" + }, + { + "documentation": { + "id": 2775, + "nodeType": "StructuredDocumentation", + "src": "5884:50:28", + "text": " @notice Initialize the contract" + }, + "functionSelector": "8129fc1c", + "id": 2778, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "initialize", + "nameLocation": "5948:10:28", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2776, + "nodeType": "ParameterList", + "parameters": [], + "src": "5958:2:28" + }, + "returnParameters": { + "id": 2777, + "nodeType": "ParameterList", + "parameters": [], + "src": "5969:0:28" + }, + "scope": 2858, + "src": "5939:31:28", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 2779, + "nodeType": "StructuredDocumentation", + "src": "5976:338:28", + "text": " @notice Deposits funds into the escrow for a payer-collector-receiver tuple, where\n the payer is the transaction caller.\n @dev Emits a {Deposit} event\n @param collector The address of the collector\n @param receiver The address of the receiver\n @param tokens The amount of tokens to deposit" + }, + "functionSelector": "8340f549", + "id": 2788, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "deposit", + "nameLocation": "6328:7:28", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2786, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2781, + "mutability": "mutable", + "name": "collector", + "nameLocation": "6344:9:28", + "nodeType": "VariableDeclaration", + "scope": 2788, + "src": "6336:17:28", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2780, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6336:7:28", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2783, + "mutability": "mutable", + "name": "receiver", + "nameLocation": "6363:8:28", + "nodeType": "VariableDeclaration", + "scope": 2788, + "src": "6355:16:28", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2782, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6355:7:28", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2785, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "6381:6:28", + "nodeType": "VariableDeclaration", + "scope": 2788, + "src": "6373:14:28", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2784, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "6373:7:28", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "6335:53:28" + }, + "returnParameters": { + "id": 2787, + "nodeType": "ParameterList", + "parameters": [], + "src": "6397:0:28" + }, + "scope": 2858, + "src": "6319:79:28", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 2789, + "nodeType": "StructuredDocumentation", + "src": "6404:374:28", + "text": " @notice Deposits funds into the escrow for a payer-collector-receiver tuple, where\n the payer can be specified.\n @dev Emits a {Deposit} event\n @param payer The address of the payer\n @param collector The address of the collector\n @param receiver The address of the receiver\n @param tokens The amount of tokens to deposit" + }, + "functionSelector": "72eb521e", + "id": 2800, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "depositTo", + "nameLocation": "6792:9:28", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2798, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2791, + "mutability": "mutable", + "name": "payer", + "nameLocation": "6810:5:28", + "nodeType": "VariableDeclaration", + "scope": 2800, + "src": "6802:13:28", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2790, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6802:7:28", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2793, + "mutability": "mutable", + "name": "collector", + "nameLocation": "6825:9:28", + "nodeType": "VariableDeclaration", + "scope": 2800, + "src": "6817:17:28", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2792, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6817:7:28", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2795, + "mutability": "mutable", + "name": "receiver", + "nameLocation": "6844:8:28", + "nodeType": "VariableDeclaration", + "scope": 2800, + "src": "6836:16:28", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2794, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6836:7:28", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2797, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "6862:6:28", + "nodeType": "VariableDeclaration", + "scope": 2800, + "src": "6854:14:28", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2796, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "6854:7:28", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "6801:68:28" + }, + "returnParameters": { + "id": 2799, + "nodeType": "ParameterList", + "parameters": [], + "src": "6878:0:28" + }, + "scope": 2858, + "src": "6783:96:28", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 2801, + "nodeType": "StructuredDocumentation", + "src": "6885:575:28", + "text": " @notice Thaw a specific amount of escrow from a payer-collector-receiver's escrow account.\n The payer is the transaction caller.\n Note that repeated calls to this function will overwrite the previous thawing amount\n and reset the thawing period.\n @dev Requirements:\n - `tokens` must be less than or equal to the available balance\n Emits a {Thaw} event.\n @param collector The address of the collector\n @param receiver The address of the receiver\n @param tokens The amount of tokens to thaw" + }, + "functionSelector": "f93f1cd0", + "id": 2810, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "thaw", + "nameLocation": "7474:4:28", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2808, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2803, + "mutability": "mutable", + "name": "collector", + "nameLocation": "7487:9:28", + "nodeType": "VariableDeclaration", + "scope": 2810, + "src": "7479:17:28", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2802, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "7479:7:28", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2805, + "mutability": "mutable", + "name": "receiver", + "nameLocation": "7506:8:28", + "nodeType": "VariableDeclaration", + "scope": 2810, + "src": "7498:16:28", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2804, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "7498:7:28", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2807, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "7524:6:28", + "nodeType": "VariableDeclaration", + "scope": 2810, + "src": "7516:14:28", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2806, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "7516:7:28", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "7478:53:28" + }, + "returnParameters": { + "id": 2809, + "nodeType": "ParameterList", + "parameters": [], + "src": "7540:0:28" + }, + "scope": 2858, + "src": "7465:76:28", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 2811, + "nodeType": "StructuredDocumentation", + "src": "7547:312:28", + "text": " @notice Cancels the thawing of escrow from a payer-collector-receiver's escrow account.\n @param collector The address of the collector\n @param receiver The address of the receiver\n @dev Requirements:\n - The payer must be thawing funds\n Emits a {CancelThaw} event." + }, + "functionSelector": "b1d07de4", + "id": 2818, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "cancelThaw", + "nameLocation": "7873:10:28", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2816, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2813, + "mutability": "mutable", + "name": "collector", + "nameLocation": "7892:9:28", + "nodeType": "VariableDeclaration", + "scope": 2818, + "src": "7884:17:28", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2812, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "7884:7:28", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2815, + "mutability": "mutable", + "name": "receiver", + "nameLocation": "7911:8:28", + "nodeType": "VariableDeclaration", + "scope": 2818, + "src": "7903:16:28", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2814, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "7903:7:28", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "7883:37:28" + }, + "returnParameters": { + "id": 2817, + "nodeType": "ParameterList", + "parameters": [], + "src": "7929:0:28" + }, + "scope": 2858, + "src": "7864:66:28", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 2819, + "nodeType": "StructuredDocumentation", + "src": "7936:486:28", + "text": " @notice Withdraws all thawed escrow from a payer-collector-receiver's escrow account.\n The payer is the transaction caller.\n Note that the withdrawn funds might be less than the thawed amount if there were\n payment collections in the meantime.\n @dev Requirements:\n - Funds must be thawed\n Emits a {Withdraw} event\n @param collector The address of the collector\n @param receiver The address of the receiver" + }, + "functionSelector": "f940e385", + "id": 2826, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "withdraw", + "nameLocation": "8436:8:28", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2824, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2821, + "mutability": "mutable", + "name": "collector", + "nameLocation": "8453:9:28", + "nodeType": "VariableDeclaration", + "scope": 2826, + "src": "8445:17:28", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2820, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "8445:7:28", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2823, + "mutability": "mutable", + "name": "receiver", + "nameLocation": "8472:8:28", + "nodeType": "VariableDeclaration", + "scope": 2826, + "src": "8464:16:28", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2822, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "8464:7:28", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "8444:37:28" + }, + "returnParameters": { + "id": 2825, + "nodeType": "ParameterList", + "parameters": [], + "src": "8490:0:28" + }, + "scope": 2858, + "src": "8427:64:28", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 2827, + "nodeType": "StructuredDocumentation", + "src": "8497:811:28", + "text": " @notice Collects funds from the payer-collector-receiver's escrow and sends them to {GraphPayments} for\n distribution using the Graph Horizon Payments protocol.\n The function will revert if there are not enough funds in the escrow.\n Emits an {EscrowCollected} event\n @param paymentType The type of payment being collected as defined in the {IGraphPayments} interface\n @param payer The address of the payer\n @param receiver The address of the receiver\n @param tokens The amount of tokens to collect\n @param dataService The address of the data service\n @param dataServiceCut The data service cut in PPM that {GraphPayments} should send\n @param receiverDestination The address where the receiver's payment should be sent." + }, + "functionSelector": "1230fa3e", + "id": 2845, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "collect", + "nameLocation": "9322:7:28", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2843, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2830, + "mutability": "mutable", + "name": "paymentType", + "nameLocation": "9367:11:28", + "nodeType": "VariableDeclaration", + "scope": 2845, + "src": "9339:39:28", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_PaymentTypes_$2433", + "typeString": "enum IGraphPayments.PaymentTypes" + }, + "typeName": { + "id": 2829, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 2828, + "name": "IGraphPayments.PaymentTypes", + "nameLocations": [ + "9339:14:28", + "9354:12:28" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 2433, + "src": "9339:27:28" + }, + "referencedDeclaration": 2433, + "src": "9339:27:28", + "typeDescriptions": { + "typeIdentifier": "t_enum$_PaymentTypes_$2433", + "typeString": "enum IGraphPayments.PaymentTypes" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2832, + "mutability": "mutable", + "name": "payer", + "nameLocation": "9396:5:28", + "nodeType": "VariableDeclaration", + "scope": 2845, + "src": "9388:13:28", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2831, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "9388:7:28", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2834, + "mutability": "mutable", + "name": "receiver", + "nameLocation": "9419:8:28", + "nodeType": "VariableDeclaration", + "scope": 2845, + "src": "9411:16:28", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2833, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "9411:7:28", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2836, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "9445:6:28", + "nodeType": "VariableDeclaration", + "scope": 2845, + "src": "9437:14:28", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2835, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "9437:7:28", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2838, + "mutability": "mutable", + "name": "dataService", + "nameLocation": "9469:11:28", + "nodeType": "VariableDeclaration", + "scope": 2845, + "src": "9461:19:28", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2837, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "9461:7:28", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2840, + "mutability": "mutable", + "name": "dataServiceCut", + "nameLocation": "9498:14:28", + "nodeType": "VariableDeclaration", + "scope": 2845, + "src": "9490:22:28", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2839, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "9490:7:28", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2842, + "mutability": "mutable", + "name": "receiverDestination", + "nameLocation": "9530:19:28", + "nodeType": "VariableDeclaration", + "scope": 2845, + "src": "9522:27:28", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2841, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "9522:7:28", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "9329:226:28" + }, + "returnParameters": { + "id": 2844, + "nodeType": "ParameterList", + "parameters": [], + "src": "9564:0:28" + }, + "scope": 2858, + "src": "9313:252:28", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 2846, + "nodeType": "StructuredDocumentation", + "src": "9571:397:28", + "text": " @notice Get the balance of a payer-collector-receiver tuple\n This function will return 0 if the current balance is less than the amount of funds being thawed.\n @param payer The address of the payer\n @param collector The address of the collector\n @param receiver The address of the receiver\n @return The balance of the payer-collector-receiver tuple" + }, + "functionSelector": "d6bd603c", + "id": 2857, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "getBalance", + "nameLocation": "9982:10:28", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2853, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2848, + "mutability": "mutable", + "name": "payer", + "nameLocation": "10001:5:28", + "nodeType": "VariableDeclaration", + "scope": 2857, + "src": "9993:13:28", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2847, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "9993:7:28", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2850, + "mutability": "mutable", + "name": "collector", + "nameLocation": "10016:9:28", + "nodeType": "VariableDeclaration", + "scope": 2857, + "src": "10008:17:28", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2849, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "10008:7:28", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2852, + "mutability": "mutable", + "name": "receiver", + "nameLocation": "10035:8:28", + "nodeType": "VariableDeclaration", + "scope": 2857, + "src": "10027:16:28", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2851, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "10027:7:28", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "9992:52:28" + }, + "returnParameters": { + "id": 2856, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2855, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 2857, + "src": "10068:7:28", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2854, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "10068:7:28", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "10067:9:28" + }, + "scope": 2858, + "src": "9973:104:28", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + } + ], + "scope": 2859, + "src": "898:9181:28", + "usedErrors": [ + 2738, + 2745, + 2748, + 2755, + 2762, + 2771, + 2774 + ], + "usedEvents": [ + 2682, + 2695, + 2708, + 2719, + 2735 + ] + } + ], + "src": "45:10035:28" + }, + "id": 28 + }, + "@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingBase.sol": { + "ast": { + "absolutePath": "@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingBase.sol", + "exportedSymbols": { + "IGraphPayments": [ + 2489 + ], + "IHorizonStakingBase": [ + 3046 + ], + "IHorizonStakingTypes": [ + 4073 + ], + "LinkedList": [ + 4364 + ] + }, + "id": 3047, + "license": "GPL-2.0-or-later", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 2860, + "literals": [ + "solidity", + "0.8", + ".27" + ], + "nodeType": "PragmaDirective", + "src": "46:23:29" + }, + { + "absolutePath": "@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingTypes.sol", + "file": "./IHorizonStakingTypes.sol", + "id": 2862, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 3047, + "sourceUnit": 4074, + "src": "71:66:29", + "symbolAliases": [ + { + "foreign": { + "id": 2861, + "name": "IHorizonStakingTypes", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4073, + "src": "80:20:29", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "@graphprotocol/horizon/contracts/interfaces/IGraphPayments.sol", + "file": "../IGraphPayments.sol", + "id": 2864, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 3047, + "sourceUnit": 2490, + "src": "138:55:29", + "symbolAliases": [ + { + "foreign": { + "id": 2863, + "name": "IGraphPayments", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2489, + "src": "147:14:29", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "@graphprotocol/horizon/contracts/libraries/LinkedList.sol", + "file": "../../libraries/LinkedList.sol", + "id": 2866, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 3047, + "sourceUnit": 4365, + "src": "195:60:29", + "symbolAliases": [ + { + "foreign": { + "id": 2865, + "name": "LinkedList", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4364, + "src": "204:10:29", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "abstract": false, + "baseContracts": [], + "canonicalName": "IHorizonStakingBase", + "contractDependencies": [], + "contractKind": "interface", + "documentation": { + "id": 2867, + "nodeType": "StructuredDocumentation", + "src": "257:464:29", + "text": " @title Interface for the {HorizonStakingBase} contract.\n @notice Provides getters for {HorizonStaking} and {HorizonStakingExtension} storage variables.\n @dev Most functions operate over {HorizonStaking} provisions. To uniquely identify a provision\n functions take `serviceProvider` and `verifier` addresses.\n @custom:security-contact Please email security+contracts@thegraph.com if you find any\n bugs. We may have an active bug bounty program." + }, + "fullyImplemented": false, + "id": 3046, + "linearizedBaseContracts": [ + 3046 + ], + "name": "IHorizonStakingBase", + "nameLocation": "732:19:29", + "nodeType": "ContractDefinition", + "nodes": [ + { + "anonymous": false, + "documentation": { + "id": 2868, + "nodeType": "StructuredDocumentation", + "src": "758:421:29", + "text": " @notice Emitted when a service provider stakes tokens.\n @dev TRANSITION PERIOD: After transition period move to IHorizonStakingMain. Temporarily it\n needs to be here since it's emitted by {_stake} which is used by both {HorizonStaking}\n and {HorizonStakingExtension}.\n @param serviceProvider The address of the service provider.\n @param tokens The amount of tokens staked." + }, + "eventSelector": "48c384dd8bdf1e06d8afecd810c4acfc3d553ac5d879dec5a69875dbbd90e14b", + "id": 2874, + "name": "HorizonStakeDeposited", + "nameLocation": "1190:21:29", + "nodeType": "EventDefinition", + "parameters": { + "id": 2873, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2870, + "indexed": true, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "1228:15:29", + "nodeType": "VariableDeclaration", + "scope": 2874, + "src": "1212:31:29", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2869, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1212:7:29", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2872, + "indexed": false, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "1253:6:29", + "nodeType": "VariableDeclaration", + "scope": 2874, + "src": "1245:14:29", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2871, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1245:7:29", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "1211:49:29" + }, + "src": "1184:77:29" + }, + { + "documentation": { + "id": 2875, + "nodeType": "StructuredDocumentation", + "src": "1267:74:29", + "text": " @notice Thrown when using an invalid thaw request type." + }, + "errorSelector": "d7a3f74e", + "id": 2877, + "name": "HorizonStakingInvalidThawRequestType", + "nameLocation": "1352:36:29", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 2876, + "nodeType": "ParameterList", + "parameters": [], + "src": "1388:2:29" + }, + "src": "1346:45:29" + }, + { + "documentation": { + "id": 2878, + "nodeType": "StructuredDocumentation", + "src": "1397:178:29", + "text": " @notice Gets the details of a service provider.\n @param serviceProvider The address of the service provider.\n @return The service provider details." + }, + "functionSelector": "8cc01c86", + "id": 2886, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "getServiceProvider", + "nameLocation": "1589:18:29", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2881, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2880, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "1625:15:29", + "nodeType": "VariableDeclaration", + "scope": 2886, + "src": "1617:23:29", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2879, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1617:7:29", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "1607:39:29" + }, + "returnParameters": { + "id": 2885, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2884, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 2886, + "src": "1670:43:29", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_ServiceProvider_$3968_memory_ptr", + "typeString": "struct IHorizonStakingTypes.ServiceProvider" + }, + "typeName": { + "id": 2883, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 2882, + "name": "IHorizonStakingTypes.ServiceProvider", + "nameLocations": [ + "1670:20:29", + "1691:15:29" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 3968, + "src": "1670:36:29" + }, + "referencedDeclaration": 3968, + "src": "1670:36:29", + "typeDescriptions": { + "typeIdentifier": "t_struct$_ServiceProvider_$3968_storage_ptr", + "typeString": "struct IHorizonStakingTypes.ServiceProvider" + } + }, + "visibility": "internal" + } + ], + "src": "1669:45:29" + }, + "scope": 3046, + "src": "1580:135:29", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 2887, + "nodeType": "StructuredDocumentation", + "src": "1721:175:29", + "text": " @notice Gets the stake of a service provider.\n @param serviceProvider The address of the service provider.\n @return The amount of tokens staked." + }, + "functionSelector": "7a766460", + "id": 2894, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "getStake", + "nameLocation": "1910:8:29", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2890, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2889, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "1927:15:29", + "nodeType": "VariableDeclaration", + "scope": 2894, + "src": "1919:23:29", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2888, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1919:7:29", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "1918:25:29" + }, + "returnParameters": { + "id": 2893, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2892, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 2894, + "src": "1967:7:29", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2891, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1967:7:29", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "1966:9:29" + }, + "scope": 3046, + "src": "1901:75:29", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 2895, + "nodeType": "StructuredDocumentation", + "src": "1982:311:29", + "text": " @notice Gets the service provider's idle stake which is the stake that is not being\n used for any provision. Note that this only includes service provider's self stake.\n @param serviceProvider The address of the service provider.\n @return The amount of tokens that are idle." + }, + "functionSelector": "a784d498", + "id": 2902, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "getIdleStake", + "nameLocation": "2307:12:29", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2898, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2897, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "2328:15:29", + "nodeType": "VariableDeclaration", + "scope": 2902, + "src": "2320:23:29", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2896, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2320:7:29", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "2319:25:29" + }, + "returnParameters": { + "id": 2901, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2900, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 2902, + "src": "2368:7:29", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2899, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2368:7:29", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "2367:9:29" + }, + "scope": 3046, + "src": "2298:79:29", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 2903, + "nodeType": "StructuredDocumentation", + "src": "2383:226:29", + "text": " @notice Gets the details of delegation pool.\n @param serviceProvider The address of the service provider.\n @param verifier The address of the verifier.\n @return The delegation pool details." + }, + "functionSelector": "561285e4", + "id": 2913, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "getDelegationPool", + "nameLocation": "2623:17:29", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2908, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2905, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "2658:15:29", + "nodeType": "VariableDeclaration", + "scope": 2913, + "src": "2650:23:29", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2904, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2650:7:29", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2907, + "mutability": "mutable", + "name": "verifier", + "nameLocation": "2691:8:29", + "nodeType": "VariableDeclaration", + "scope": 2913, + "src": "2683:16:29", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2906, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2683:7:29", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "2640:65:29" + }, + "returnParameters": { + "id": 2912, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2911, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 2913, + "src": "2729:42:29", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_DelegationPool_$3992_memory_ptr", + "typeString": "struct IHorizonStakingTypes.DelegationPool" + }, + "typeName": { + "id": 2910, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 2909, + "name": "IHorizonStakingTypes.DelegationPool", + "nameLocations": [ + "2729:20:29", + "2750:14:29" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 3992, + "src": "2729:35:29" + }, + "referencedDeclaration": 3992, + "src": "2729:35:29", + "typeDescriptions": { + "typeIdentifier": "t_struct$_DelegationPool_$3992_storage_ptr", + "typeString": "struct IHorizonStakingTypes.DelegationPool" + } + }, + "visibility": "internal" + } + ], + "src": "2728:44:29" + }, + "scope": 3046, + "src": "2614:159:29", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 2914, + "nodeType": "StructuredDocumentation", + "src": "2779:272:29", + "text": " @notice Gets the details of a delegation.\n @param serviceProvider The address of the service provider.\n @param verifier The address of the verifier.\n @param delegator The address of the delegator.\n @return The delegation details." + }, + "functionSelector": "ccebcabb", + "id": 2926, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "getDelegation", + "nameLocation": "3065:13:29", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2921, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2916, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "3096:15:29", + "nodeType": "VariableDeclaration", + "scope": 2926, + "src": "3088:23:29", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2915, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3088:7:29", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2918, + "mutability": "mutable", + "name": "verifier", + "nameLocation": "3129:8:29", + "nodeType": "VariableDeclaration", + "scope": 2926, + "src": "3121:16:29", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2917, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3121:7:29", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2920, + "mutability": "mutable", + "name": "delegator", + "nameLocation": "3155:9:29", + "nodeType": "VariableDeclaration", + "scope": 2926, + "src": "3147:17:29", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2919, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3147:7:29", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "3078:92:29" + }, + "returnParameters": { + "id": 2925, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2924, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 2926, + "src": "3194:38:29", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegation_$4021_memory_ptr", + "typeString": "struct IHorizonStakingTypes.Delegation" + }, + "typeName": { + "id": 2923, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 2922, + "name": "IHorizonStakingTypes.Delegation", + "nameLocations": [ + "3194:20:29", + "3215:10:29" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 4021, + "src": "3194:31:29" + }, + "referencedDeclaration": 4021, + "src": "3194:31:29", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegation_$4021_storage_ptr", + "typeString": "struct IHorizonStakingTypes.Delegation" + } + }, + "visibility": "internal" + } + ], + "src": "3193:40:29" + }, + "scope": 3046, + "src": "3056:178:29", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 2927, + "nodeType": "StructuredDocumentation", + "src": "3240:327:29", + "text": " @notice Gets the delegation fee cut for a payment type.\n @param serviceProvider The address of the service provider.\n @param verifier The address of the verifier.\n @param paymentType The payment type as defined by {IGraphPayments.PaymentTypes}.\n @return The delegation fee cut in PPM." + }, + "functionSelector": "7573ef4f", + "id": 2939, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "getDelegationFeeCut", + "nameLocation": "3581:19:29", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2935, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2929, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "3618:15:29", + "nodeType": "VariableDeclaration", + "scope": 2939, + "src": "3610:23:29", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2928, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3610:7:29", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2931, + "mutability": "mutable", + "name": "verifier", + "nameLocation": "3651:8:29", + "nodeType": "VariableDeclaration", + "scope": 2939, + "src": "3643:16:29", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2930, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3643:7:29", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2934, + "mutability": "mutable", + "name": "paymentType", + "nameLocation": "3697:11:29", + "nodeType": "VariableDeclaration", + "scope": 2939, + "src": "3669:39:29", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_PaymentTypes_$2433", + "typeString": "enum IGraphPayments.PaymentTypes" + }, + "typeName": { + "id": 2933, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 2932, + "name": "IGraphPayments.PaymentTypes", + "nameLocations": [ + "3669:14:29", + "3684:12:29" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 2433, + "src": "3669:27:29" + }, + "referencedDeclaration": 2433, + "src": "3669:27:29", + "typeDescriptions": { + "typeIdentifier": "t_enum$_PaymentTypes_$2433", + "typeString": "enum IGraphPayments.PaymentTypes" + } + }, + "visibility": "internal" + } + ], + "src": "3600:114:29" + }, + "returnParameters": { + "id": 2938, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2937, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 2939, + "src": "3738:7:29", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2936, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "3738:7:29", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "3737:9:29" + }, + "scope": 3046, + "src": "3572:175:29", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 2940, + "nodeType": "StructuredDocumentation", + "src": "3753:216:29", + "text": " @notice Gets the details of a provision.\n @param serviceProvider The address of the service provider.\n @param verifier The address of the verifier.\n @return The provision details." + }, + "functionSelector": "25d9897e", + "id": 2950, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "getProvision", + "nameLocation": "3983:12:29", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2945, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2942, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "4013:15:29", + "nodeType": "VariableDeclaration", + "scope": 2950, + "src": "4005:23:29", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2941, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4005:7:29", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2944, + "mutability": "mutable", + "name": "verifier", + "nameLocation": "4046:8:29", + "nodeType": "VariableDeclaration", + "scope": 2950, + "src": "4038:16:29", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2943, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4038:7:29", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "3995:65:29" + }, + "returnParameters": { + "id": 2949, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2948, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 2950, + "src": "4084:37:29", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Provision_$3962_memory_ptr", + "typeString": "struct IHorizonStakingTypes.Provision" + }, + "typeName": { + "id": 2947, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 2946, + "name": "IHorizonStakingTypes.Provision", + "nameLocations": [ + "4084:20:29", + "4105:9:29" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 3962, + "src": "4084:30:29" + }, + "referencedDeclaration": 3962, + "src": "4084:30:29", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Provision_$3962_storage_ptr", + "typeString": "struct IHorizonStakingTypes.Provision" + } + }, + "visibility": "internal" + } + ], + "src": "4083:39:29" + }, + "scope": 3046, + "src": "3974:149:29", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 2951, + "nodeType": "StructuredDocumentation", + "src": "4129:559:29", + "text": " @notice Gets the tokens available in a provision.\n Tokens available are the tokens in a provision that are not thawing. Includes service\n provider's and delegator's stake.\n Allows specifying a `delegationRatio` which caps the amount of delegated tokens that are\n considered available.\n @param serviceProvider The address of the service provider.\n @param verifier The address of the verifier.\n @param delegationRatio The delegation ratio.\n @return The amount of tokens available." + }, + "functionSelector": "872d0489", + "id": 2962, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "getTokensAvailable", + "nameLocation": "4702:18:29", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2958, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2953, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "4738:15:29", + "nodeType": "VariableDeclaration", + "scope": 2962, + "src": "4730:23:29", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2952, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4730:7:29", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2955, + "mutability": "mutable", + "name": "verifier", + "nameLocation": "4771:8:29", + "nodeType": "VariableDeclaration", + "scope": 2962, + "src": "4763:16:29", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2954, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4763:7:29", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2957, + "mutability": "mutable", + "name": "delegationRatio", + "nameLocation": "4796:15:29", + "nodeType": "VariableDeclaration", + "scope": 2962, + "src": "4789:22:29", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 2956, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "4789:6:29", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + } + ], + "src": "4720:97:29" + }, + "returnParameters": { + "id": 2961, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2960, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 2962, + "src": "4841:7:29", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2959, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "4841:7:29", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "4840:9:29" + }, + "scope": 3046, + "src": "4693:157:29", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 2963, + "nodeType": "StructuredDocumentation", + "src": "4856:326:29", + "text": " @notice Gets the service provider's tokens available in a provision.\n @dev Calculated as the tokens available minus the tokens thawing.\n @param serviceProvider The address of the service provider.\n @param verifier The address of the verifier.\n @return The amount of tokens available." + }, + "functionSelector": "08ce5f68", + "id": 2972, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "getProviderTokensAvailable", + "nameLocation": "5196:26:29", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2968, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2965, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "5231:15:29", + "nodeType": "VariableDeclaration", + "scope": 2972, + "src": "5223:23:29", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2964, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5223:7:29", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2967, + "mutability": "mutable", + "name": "verifier", + "nameLocation": "5256:8:29", + "nodeType": "VariableDeclaration", + "scope": 2972, + "src": "5248:16:29", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2966, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5248:7:29", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "5222:43:29" + }, + "returnParameters": { + "id": 2971, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2970, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 2972, + "src": "5289:7:29", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2969, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "5289:7:29", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "5288:9:29" + }, + "scope": 3046, + "src": "5187:111:29", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 2973, + "nodeType": "StructuredDocumentation", + "src": "5304:319:29", + "text": " @notice Gets the delegator's tokens available in a provision.\n @dev Calculated as the tokens available minus the tokens thawing.\n @param serviceProvider The address of the service provider.\n @param verifier The address of the verifier.\n @return The amount of tokens available." + }, + "functionSelector": "fb744cc0", + "id": 2982, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "getDelegatedTokensAvailable", + "nameLocation": "5637:27:29", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2978, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2975, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "5673:15:29", + "nodeType": "VariableDeclaration", + "scope": 2982, + "src": "5665:23:29", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2974, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5665:7:29", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2977, + "mutability": "mutable", + "name": "verifier", + "nameLocation": "5698:8:29", + "nodeType": "VariableDeclaration", + "scope": 2982, + "src": "5690:16:29", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2976, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5690:7:29", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "5664:43:29" + }, + "returnParameters": { + "id": 2981, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2980, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 2982, + "src": "5731:7:29", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2979, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "5731:7:29", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "5730:9:29" + }, + "scope": 3046, + "src": "5628:112:29", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 2983, + "nodeType": "StructuredDocumentation", + "src": "5746:200:29", + "text": " @notice Gets a thaw request.\n @param thawRequestType The type of thaw request.\n @param thawRequestId The id of the thaw request.\n @return The thaw request details." + }, + "functionSelector": "d48de845", + "id": 2994, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "getThawRequest", + "nameLocation": "5960:14:29", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2989, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2986, + "mutability": "mutable", + "name": "thawRequestType", + "nameLocation": "6021:15:29", + "nodeType": "VariableDeclaration", + "scope": 2994, + "src": "5984:52:29", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_ThawRequestType_$4033", + "typeString": "enum IHorizonStakingTypes.ThawRequestType" + }, + "typeName": { + "id": 2985, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 2984, + "name": "IHorizonStakingTypes.ThawRequestType", + "nameLocations": [ + "5984:20:29", + "6005:15:29" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 4033, + "src": "5984:36:29" + }, + "referencedDeclaration": 4033, + "src": "5984:36:29", + "typeDescriptions": { + "typeIdentifier": "t_enum$_ThawRequestType_$4033", + "typeString": "enum IHorizonStakingTypes.ThawRequestType" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 2988, + "mutability": "mutable", + "name": "thawRequestId", + "nameLocation": "6054:13:29", + "nodeType": "VariableDeclaration", + "scope": 2994, + "src": "6046:21:29", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 2987, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "6046:7:29", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "5974:99:29" + }, + "returnParameters": { + "id": 2993, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2992, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 2994, + "src": "6097:39:29", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_ThawRequest_$4043_memory_ptr", + "typeString": "struct IHorizonStakingTypes.ThawRequest" + }, + "typeName": { + "id": 2991, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 2990, + "name": "IHorizonStakingTypes.ThawRequest", + "nameLocations": [ + "6097:20:29", + "6118:11:29" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 4043, + "src": "6097:32:29" + }, + "referencedDeclaration": 4043, + "src": "6097:32:29", + "typeDescriptions": { + "typeIdentifier": "t_struct$_ThawRequest_$4043_storage_ptr", + "typeString": "struct IHorizonStakingTypes.ThawRequest" + } + }, + "visibility": "internal" + } + ], + "src": "6096:41:29" + }, + "scope": 3046, + "src": "5951:187:29", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 2995, + "nodeType": "StructuredDocumentation", + "src": "6144:585:29", + "text": " @notice Gets the metadata of a thaw request list.\n Service provider and delegators each have their own thaw request list per provision.\n Metadata includes the head and tail of the list, plus the total number of thaw requests.\n @param thawRequestType The type of thaw request.\n @param serviceProvider The address of the service provider.\n @param verifier The address of the verifier.\n @param owner The owner of the thaw requests. Use either the service provider or delegator address.\n @return The thaw requests list metadata." + }, + "functionSelector": "e56f8a1d", + "id": 3010, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "getThawRequestList", + "nameLocation": "6743:18:29", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3005, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2998, + "mutability": "mutable", + "name": "thawRequestType", + "nameLocation": "6808:15:29", + "nodeType": "VariableDeclaration", + "scope": 3010, + "src": "6771:52:29", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_ThawRequestType_$4033", + "typeString": "enum IHorizonStakingTypes.ThawRequestType" + }, + "typeName": { + "id": 2997, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 2996, + "name": "IHorizonStakingTypes.ThawRequestType", + "nameLocations": [ + "6771:20:29", + "6792:15:29" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 4033, + "src": "6771:36:29" + }, + "referencedDeclaration": 4033, + "src": "6771:36:29", + "typeDescriptions": { + "typeIdentifier": "t_enum$_ThawRequestType_$4033", + "typeString": "enum IHorizonStakingTypes.ThawRequestType" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3000, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "6841:15:29", + "nodeType": "VariableDeclaration", + "scope": 3010, + "src": "6833:23:29", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2999, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6833:7:29", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3002, + "mutability": "mutable", + "name": "verifier", + "nameLocation": "6874:8:29", + "nodeType": "VariableDeclaration", + "scope": 3010, + "src": "6866:16:29", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3001, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6866:7:29", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3004, + "mutability": "mutable", + "name": "owner", + "nameLocation": "6900:5:29", + "nodeType": "VariableDeclaration", + "scope": 3010, + "src": "6892:13:29", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3003, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6892:7:29", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "6761:150:29" + }, + "returnParameters": { + "id": 3009, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3008, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 3010, + "src": "6935:22:29", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_List_$4090_memory_ptr", + "typeString": "struct LinkedList.List" + }, + "typeName": { + "id": 3007, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 3006, + "name": "LinkedList.List", + "nameLocations": [ + "6935:10:29", + "6946:4:29" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 4090, + "src": "6935:15:29" + }, + "referencedDeclaration": 4090, + "src": "6935:15:29", + "typeDescriptions": { + "typeIdentifier": "t_struct$_List_$4090_storage_ptr", + "typeString": "struct LinkedList.List" + } + }, + "visibility": "internal" + } + ], + "src": "6934:24:29" + }, + "scope": 3046, + "src": "6734:225:29", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 3011, + "nodeType": "StructuredDocumentation", + "src": "6965:870:29", + "text": " @notice Gets the amount of thawed tokens that can be releasedfor a given provision.\n @dev Note that the value returned by this function does not return the total amount of thawed tokens\n but only those that can be released. If thaw requests are created with different thawing periods it's\n possible that an unexpired thaw request temporarily blocks the release of other ones that have already\n expired. This function will stop counting when it encounters the first thaw request that is not yet expired.\n @param thawRequestType The type of thaw request.\n @param serviceProvider The address of the service provider.\n @param verifier The address of the verifier.\n @param owner The owner of the thaw requests. Use either the service provider or delegator address.\n @return The amount of thawed tokens." + }, + "functionSelector": "2f7cc501", + "id": 3025, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "getThawedTokens", + "nameLocation": "7849:15:29", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3021, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3014, + "mutability": "mutable", + "name": "thawRequestType", + "nameLocation": "7911:15:29", + "nodeType": "VariableDeclaration", + "scope": 3025, + "src": "7874:52:29", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_ThawRequestType_$4033", + "typeString": "enum IHorizonStakingTypes.ThawRequestType" + }, + "typeName": { + "id": 3013, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 3012, + "name": "IHorizonStakingTypes.ThawRequestType", + "nameLocations": [ + "7874:20:29", + "7895:15:29" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 4033, + "src": "7874:36:29" + }, + "referencedDeclaration": 4033, + "src": "7874:36:29", + "typeDescriptions": { + "typeIdentifier": "t_enum$_ThawRequestType_$4033", + "typeString": "enum IHorizonStakingTypes.ThawRequestType" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3016, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "7944:15:29", + "nodeType": "VariableDeclaration", + "scope": 3025, + "src": "7936:23:29", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3015, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "7936:7:29", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3018, + "mutability": "mutable", + "name": "verifier", + "nameLocation": "7977:8:29", + "nodeType": "VariableDeclaration", + "scope": 3025, + "src": "7969:16:29", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3017, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "7969:7:29", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3020, + "mutability": "mutable", + "name": "owner", + "nameLocation": "8003:5:29", + "nodeType": "VariableDeclaration", + "scope": 3025, + "src": "7995:13:29", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3019, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "7995:7:29", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "7864:150:29" + }, + "returnParameters": { + "id": 3024, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3023, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 3025, + "src": "8038:7:29", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3022, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "8038:7:29", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "8037:9:29" + }, + "scope": 3046, + "src": "7840:207:29", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 3026, + "nodeType": "StructuredDocumentation", + "src": "8053:145:29", + "text": " @notice Gets the maximum allowed thawing period for a provision.\n @return The maximum allowed thawing period in seconds." + }, + "functionSelector": "39514ad2", + "id": 3031, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "getMaxThawingPeriod", + "nameLocation": "8212:19:29", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3027, + "nodeType": "ParameterList", + "parameters": [], + "src": "8231:2:29" + }, + "returnParameters": { + "id": 3030, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3029, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 3031, + "src": "8257:6:29", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + }, + "typeName": { + "id": 3028, + "name": "uint64", + "nodeType": "ElementaryTypeName", + "src": "8257:6:29", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "visibility": "internal" + } + ], + "src": "8256:8:29" + }, + "scope": 3046, + "src": "8203:62:29", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 3032, + "nodeType": "StructuredDocumentation", + "src": "8271:208:29", + "text": " @notice Return true if the verifier is an allowed locked verifier.\n @param verifier Address of the verifier\n @return True if verifier is allowed locked verifier, false otherwise" + }, + "functionSelector": "ae4fe67a", + "id": 3039, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "isAllowedLockedVerifier", + "nameLocation": "8493:23:29", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3035, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3034, + "mutability": "mutable", + "name": "verifier", + "nameLocation": "8525:8:29", + "nodeType": "VariableDeclaration", + "scope": 3039, + "src": "8517:16:29", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3033, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "8517:7:29", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "8516:18:29" + }, + "returnParameters": { + "id": 3038, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3037, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 3039, + "src": "8558:4:29", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 3036, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "8558:4:29", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "src": "8557:6:29" + }, + "scope": 3046, + "src": "8484:80:29", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 3040, + "nodeType": "StructuredDocumentation", + "src": "8570:161:29", + "text": " @notice Return true if delegation slashing is enabled, false otherwise.\n @return True if delegation slashing is enabled, false otherwise" + }, + "functionSelector": "fc54fb27", + "id": 3045, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "isDelegationSlashingEnabled", + "nameLocation": "8745:27:29", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3041, + "nodeType": "ParameterList", + "parameters": [], + "src": "8772:2:29" + }, + "returnParameters": { + "id": 3044, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3043, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 3045, + "src": "8798:4:29", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 3042, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "8798:4:29", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "src": "8797:6:29" + }, + "scope": 3046, + "src": "8736:68:29", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + } + ], + "scope": 3047, + "src": "722:8084:29", + "usedErrors": [ + 2877 + ], + "usedEvents": [ + 2874 + ] + } + ], + "src": "46:8761:29" + }, + "id": 29 + }, + "@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingExtension.sol": { + "ast": { + "absolutePath": "@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingExtension.sol", + "exportedSymbols": { + "IHorizonStakingExtension": [ + 3226 + ], + "IRewardsIssuer": [ + 561 + ] + }, + "id": 3227, + "license": "GPL-2.0-or-later", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 3048, + "literals": [ + "solidity", + "0.8", + ".27" + ], + "nodeType": "PragmaDirective", + "src": "46:23:30" + }, + { + "absolutePath": "@graphprotocol/contracts/contracts/rewards/IRewardsIssuer.sol", + "file": "@graphprotocol/contracts/contracts/rewards/IRewardsIssuer.sol", + "id": 3050, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 3227, + "sourceUnit": 562, + "src": "71:95:30", + "symbolAliases": [ + { + "foreign": { + "id": 3049, + "name": "IRewardsIssuer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 561, + "src": "80:14:30", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "abstract": false, + "baseContracts": [ + { + "baseName": { + "id": 3052, + "name": "IRewardsIssuer", + "nameLocations": [ + "477:14:30" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 561, + "src": "477:14:30" + }, + "id": 3053, + "nodeType": "InheritanceSpecifier", + "src": "477:14:30" + } + ], + "canonicalName": "IHorizonStakingExtension", + "contractDependencies": [], + "contractKind": "interface", + "documentation": { + "id": 3051, + "nodeType": "StructuredDocumentation", + "src": "168:270:30", + "text": " @title Interface for {HorizonStakingExtension} contract.\n @notice Provides functions for managing legacy allocations.\n @custom:security-contact Please email security+contracts@thegraph.com if you find any\n bugs. We may have an active bug bounty program." + }, + "fullyImplemented": false, + "id": 3226, + "linearizedBaseContracts": [ + 3226, + 561 + ], + "name": "IHorizonStakingExtension", + "nameLocation": "449:24:30", + "nodeType": "ContractDefinition", + "nodes": [ + { + "canonicalName": "IHorizonStakingExtension.Allocation", + "documentation": { + "id": 3054, + "nodeType": "StructuredDocumentation", + "src": "498:825:30", + "text": " @dev Allocate GRT tokens for the purpose of serving queries of a subgraph deployment\n An allocation is created in the allocate() function and closed in closeAllocation()\n @param indexer The indexer address\n @param subgraphDeploymentID The subgraph deployment ID\n @param tokens The amount of tokens allocated to the subgraph deployment\n @param createdAtEpoch The epoch when the allocation was created\n @param closedAtEpoch The epoch when the allocation was closed\n @param collectedFees The amount of collected fees for the allocation\n @param __DEPRECATED_effectiveAllocation Deprecated field.\n @param accRewardsPerAllocatedToken Snapshot used for reward calculation\n @param distributedRebates The amount of collected rebates that have been rebated" + }, + "id": 3073, + "members": [ + { + "constant": false, + "id": 3056, + "mutability": "mutable", + "name": "indexer", + "nameLocation": "1364:7:30", + "nodeType": "VariableDeclaration", + "scope": 3073, + "src": "1356:15:30", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3055, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1356:7:30", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3058, + "mutability": "mutable", + "name": "subgraphDeploymentID", + "nameLocation": "1389:20:30", + "nodeType": "VariableDeclaration", + "scope": 3073, + "src": "1381:28:30", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 3057, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1381:7:30", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3060, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "1427:6:30", + "nodeType": "VariableDeclaration", + "scope": 3073, + "src": "1419:14:30", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3059, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1419:7:30", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3062, + "mutability": "mutable", + "name": "createdAtEpoch", + "nameLocation": "1451:14:30", + "nodeType": "VariableDeclaration", + "scope": 3073, + "src": "1443:22:30", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3061, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1443:7:30", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3064, + "mutability": "mutable", + "name": "closedAtEpoch", + "nameLocation": "1483:13:30", + "nodeType": "VariableDeclaration", + "scope": 3073, + "src": "1475:21:30", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3063, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1475:7:30", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3066, + "mutability": "mutable", + "name": "collectedFees", + "nameLocation": "1514:13:30", + "nodeType": "VariableDeclaration", + "scope": 3073, + "src": "1506:21:30", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3065, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1506:7:30", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3068, + "mutability": "mutable", + "name": "__DEPRECATED_effectiveAllocation", + "nameLocation": "1545:32:30", + "nodeType": "VariableDeclaration", + "scope": 3073, + "src": "1537:40:30", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3067, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1537:7:30", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3070, + "mutability": "mutable", + "name": "accRewardsPerAllocatedToken", + "nameLocation": "1595:27:30", + "nodeType": "VariableDeclaration", + "scope": 3073, + "src": "1587:35:30", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3069, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1587:7:30", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3072, + "mutability": "mutable", + "name": "distributedRebates", + "nameLocation": "1640:18:30", + "nodeType": "VariableDeclaration", + "scope": 3073, + "src": "1632:26:30", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3071, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1632:7:30", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "name": "Allocation", + "nameLocation": "1335:10:30", + "nodeType": "StructDefinition", + "scope": 3226, + "src": "1328:337:30", + "visibility": "public" + }, + { + "canonicalName": "IHorizonStakingExtension.AllocationState", + "documentation": { + "id": 3074, + "nodeType": "StructuredDocumentation", + "src": "1671:202:30", + "text": " @dev Possible states an allocation can be.\n States:\n - Null = indexer == address(0)\n - Active = not Null && tokens > 0\n - Closed = Active && closedAtEpoch != 0" + }, + "id": 3078, + "members": [ + { + "id": 3075, + "name": "Null", + "nameLocation": "1909:4:30", + "nodeType": "EnumValue", + "src": "1909:4:30" + }, + { + "id": 3076, + "name": "Active", + "nameLocation": "1923:6:30", + "nodeType": "EnumValue", + "src": "1923:6:30" + }, + { + "id": 3077, + "name": "Closed", + "nameLocation": "1939:6:30", + "nodeType": "EnumValue", + "src": "1939:6:30" + } + ], + "name": "AllocationState", + "nameLocation": "1883:15:30", + "nodeType": "EnumDefinition", + "src": "1878:73:30" + }, + { + "anonymous": false, + "documentation": { + "id": 3079, + "nodeType": "StructuredDocumentation", + "src": "1957:855:30", + "text": " @dev Emitted when `indexer` close an allocation in `epoch` for `allocationID`.\n An amount of `tokens` get unallocated from `subgraphDeploymentID`.\n This event also emits the POI (proof of indexing) submitted by the indexer.\n `isPublic` is true if the sender was someone other than the indexer.\n @param indexer The indexer address\n @param subgraphDeploymentID The subgraph deployment ID\n @param epoch The protocol epoch the allocation was closed on\n @param tokens The amount of tokens unallocated from the allocation\n @param allocationID The allocation identifier\n @param sender The address closing the allocation\n @param poi The proof of indexing submitted by the sender\n @param isPublic True if the allocation was force closed by someone other than the indexer/operator" + }, + "eventSelector": "f6725dd105a6fc88bb79a6e4627f128577186c567a17c94818d201c2a4ce1403", + "id": 3097, + "name": "AllocationClosed", + "nameLocation": "2823:16:30", + "nodeType": "EventDefinition", + "parameters": { + "id": 3096, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3081, + "indexed": true, + "mutability": "mutable", + "name": "indexer", + "nameLocation": "2865:7:30", + "nodeType": "VariableDeclaration", + "scope": 3097, + "src": "2849:23:30", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3080, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2849:7:30", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3083, + "indexed": true, + "mutability": "mutable", + "name": "subgraphDeploymentID", + "nameLocation": "2898:20:30", + "nodeType": "VariableDeclaration", + "scope": 3097, + "src": "2882:36:30", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 3082, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "2882:7:30", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3085, + "indexed": false, + "mutability": "mutable", + "name": "epoch", + "nameLocation": "2936:5:30", + "nodeType": "VariableDeclaration", + "scope": 3097, + "src": "2928:13:30", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3084, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2928:7:30", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3087, + "indexed": false, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "2959:6:30", + "nodeType": "VariableDeclaration", + "scope": 3097, + "src": "2951:14:30", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3086, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2951:7:30", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3089, + "indexed": true, + "mutability": "mutable", + "name": "allocationID", + "nameLocation": "2991:12:30", + "nodeType": "VariableDeclaration", + "scope": 3097, + "src": "2975:28:30", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3088, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2975:7:30", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3091, + "indexed": false, + "mutability": "mutable", + "name": "sender", + "nameLocation": "3021:6:30", + "nodeType": "VariableDeclaration", + "scope": 3097, + "src": "3013:14:30", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3090, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3013:7:30", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3093, + "indexed": false, + "mutability": "mutable", + "name": "poi", + "nameLocation": "3045:3:30", + "nodeType": "VariableDeclaration", + "scope": 3097, + "src": "3037:11:30", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 3092, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "3037:7:30", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3095, + "indexed": false, + "mutability": "mutable", + "name": "isPublic", + "nameLocation": "3063:8:30", + "nodeType": "VariableDeclaration", + "scope": 3097, + "src": "3058:13:30", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 3094, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "3058:4:30", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "src": "2839:238:30" + }, + "src": "2817:261:30" + }, + { + "anonymous": false, + "documentation": { + "id": 3098, + "nodeType": "StructuredDocumentation", + "src": "3084:1258:30", + "text": " @dev Emitted when `indexer` collects a rebate on `subgraphDeploymentID` for `allocationID`.\n `epoch` is the protocol epoch the rebate was collected on\n The rebate is for `tokens` amount which are being provided by `assetHolder`; `queryFees`\n is the amount up for rebate after `curationFees` are distributed and `protocolTax` is burnt.\n `queryRebates` is the amount distributed to the `indexer` with `delegationFees` collected\n and sent to the delegation pool.\n @param assetHolder The address of the asset holder, the entity paying the query fees\n @param indexer The indexer address\n @param subgraphDeploymentID The subgraph deployment ID\n @param allocationID The allocation identifier\n @param epoch The protocol epoch the rebate was collected on\n @param tokens The amount of tokens collected\n @param protocolTax The amount of tokens burnt as protocol tax\n @param curationFees The amount of tokens distributed to the curation pool\n @param queryFees The amount of tokens collected as query fees\n @param queryRebates The amount of tokens distributed to the indexer\n @param delegationRewards The amount of tokens collected from the delegation pool" + }, + "eventSelector": "f5ded07502b6feba4c13b19a0c6646efd4b4119f439bcbd49076e4f0ed1eec4b", + "id": 3122, + "name": "RebateCollected", + "nameLocation": "4353:15:30", + "nodeType": "EventDefinition", + "parameters": { + "id": 3121, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3100, + "indexed": false, + "mutability": "mutable", + "name": "assetHolder", + "nameLocation": "4386:11:30", + "nodeType": "VariableDeclaration", + "scope": 3122, + "src": "4378:19:30", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3099, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4378:7:30", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3102, + "indexed": true, + "mutability": "mutable", + "name": "indexer", + "nameLocation": "4423:7:30", + "nodeType": "VariableDeclaration", + "scope": 3122, + "src": "4407:23:30", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3101, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4407:7:30", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3104, + "indexed": true, + "mutability": "mutable", + "name": "subgraphDeploymentID", + "nameLocation": "4456:20:30", + "nodeType": "VariableDeclaration", + "scope": 3122, + "src": "4440:36:30", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 3103, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "4440:7:30", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3106, + "indexed": true, + "mutability": "mutable", + "name": "allocationID", + "nameLocation": "4502:12:30", + "nodeType": "VariableDeclaration", + "scope": 3122, + "src": "4486:28:30", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3105, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4486:7:30", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3108, + "indexed": false, + "mutability": "mutable", + "name": "epoch", + "nameLocation": "4532:5:30", + "nodeType": "VariableDeclaration", + "scope": 3122, + "src": "4524:13:30", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3107, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "4524:7:30", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3110, + "indexed": false, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "4555:6:30", + "nodeType": "VariableDeclaration", + "scope": 3122, + "src": "4547:14:30", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3109, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "4547:7:30", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3112, + "indexed": false, + "mutability": "mutable", + "name": "protocolTax", + "nameLocation": "4579:11:30", + "nodeType": "VariableDeclaration", + "scope": 3122, + "src": "4571:19:30", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3111, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "4571:7:30", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3114, + "indexed": false, + "mutability": "mutable", + "name": "curationFees", + "nameLocation": "4608:12:30", + "nodeType": "VariableDeclaration", + "scope": 3122, + "src": "4600:20:30", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3113, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "4600:7:30", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3116, + "indexed": false, + "mutability": "mutable", + "name": "queryFees", + "nameLocation": "4638:9:30", + "nodeType": "VariableDeclaration", + "scope": 3122, + "src": "4630:17:30", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3115, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "4630:7:30", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3118, + "indexed": false, + "mutability": "mutable", + "name": "queryRebates", + "nameLocation": "4665:12:30", + "nodeType": "VariableDeclaration", + "scope": 3122, + "src": "4657:20:30", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3117, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "4657:7:30", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3120, + "indexed": false, + "mutability": "mutable", + "name": "delegationRewards", + "nameLocation": "4695:17:30", + "nodeType": "VariableDeclaration", + "scope": 3122, + "src": "4687:25:30", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3119, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "4687:7:30", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "4368:350:30" + }, + "src": "4347:372:30" + }, + { + "anonymous": false, + "documentation": { + "id": 3123, + "nodeType": "StructuredDocumentation", + "src": "4725:412:30", + "text": " @dev Emitted when `indexer` was slashed for a total of `tokens` amount.\n Tracks `reward` amount of tokens given to `beneficiary`.\n @param indexer The indexer address\n @param tokens The amount of tokens slashed\n @param reward The amount of reward tokens to send to a beneficiary\n @param beneficiary The address of a beneficiary to receive a reward for the slashing" + }, + "eventSelector": "f2717be2f27d9d2d7d265e42dc556e40d2d9aeaba02f49c5286030f30c0571f3", + "id": 3133, + "name": "StakeSlashed", + "nameLocation": "5148:12:30", + "nodeType": "EventDefinition", + "parameters": { + "id": 3132, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3125, + "indexed": true, + "mutability": "mutable", + "name": "indexer", + "nameLocation": "5177:7:30", + "nodeType": "VariableDeclaration", + "scope": 3133, + "src": "5161:23:30", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3124, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5161:7:30", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3127, + "indexed": false, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "5194:6:30", + "nodeType": "VariableDeclaration", + "scope": 3133, + "src": "5186:14:30", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3126, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "5186:7:30", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3129, + "indexed": false, + "mutability": "mutable", + "name": "reward", + "nameLocation": "5210:6:30", + "nodeType": "VariableDeclaration", + "scope": 3133, + "src": "5202:14:30", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3128, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "5202:7:30", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3131, + "indexed": false, + "mutability": "mutable", + "name": "beneficiary", + "nameLocation": "5226:11:30", + "nodeType": "VariableDeclaration", + "scope": 3133, + "src": "5218:19:30", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3130, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5218:7:30", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "5160:78:30" + }, + "src": "5142:97:30" + }, + { + "documentation": { + "id": 3134, + "nodeType": "StructuredDocumentation", + "src": "5245:381:30", + "text": " @notice Close an allocation and free the staked tokens.\n To be eligible for rewards a proof of indexing must be presented.\n Presenting a bad proof is subject to slashable condition.\n To opt out of rewards set _poi to 0x0\n @param allocationID The allocation identifier\n @param poi Proof of indexing submitted for the allocated period" + }, + "functionSelector": "44c32a61", + "id": 3141, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "closeAllocation", + "nameLocation": "5640:15:30", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3139, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3136, + "mutability": "mutable", + "name": "allocationID", + "nameLocation": "5664:12:30", + "nodeType": "VariableDeclaration", + "scope": 3141, + "src": "5656:20:30", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3135, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5656:7:30", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3138, + "mutability": "mutable", + "name": "poi", + "nameLocation": "5686:3:30", + "nodeType": "VariableDeclaration", + "scope": 3141, + "src": "5678:11:30", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 3137, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "5678:7:30", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "5655:35:30" + }, + "returnParameters": { + "id": 3140, + "nodeType": "ParameterList", + "parameters": [], + "src": "5699:0:30" + }, + "scope": 3226, + "src": "5631:69:30", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 3142, + "nodeType": "StructuredDocumentation", + "src": "5706:560:30", + "text": " @dev Collect and rebate query fees to the indexer\n This function will accept calls with zero tokens.\n We use an exponential rebate formula to calculate the amount of tokens to rebate to the indexer.\n This implementation allows collecting multiple times on the same allocation, keeping track of the\n total amount rebated, the total amount collected and compensating the indexer for the difference.\n @param tokens Amount of tokens to collect\n @param allocationID Allocation where the tokens will be assigned" + }, + "functionSelector": "8d3c100a", + "id": 3149, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "collect", + "nameLocation": "6280:7:30", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3147, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3144, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "6296:6:30", + "nodeType": "VariableDeclaration", + "scope": 3149, + "src": "6288:14:30", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3143, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "6288:7:30", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3146, + "mutability": "mutable", + "name": "allocationID", + "nameLocation": "6312:12:30", + "nodeType": "VariableDeclaration", + "scope": 3149, + "src": "6304:20:30", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3145, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6304:7:30", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "6287:38:30" + }, + "returnParameters": { + "id": 3148, + "nodeType": "ParameterList", + "parameters": [], + "src": "6334:0:30" + }, + "scope": 3226, + "src": "6271:64:30", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 3150, + "nodeType": "StructuredDocumentation", + "src": "6341:778:30", + "text": " @notice Slash the indexer stake. Delegated tokens are not subject to slashing.\n Note that depending on the state of the indexer's stake, the slashed amount might be smaller than the\n requested slash amount. This can happen if the indexer has moved a significant part of their stake to\n a provision. Any outstanding slashing amount should be settled using Horizon's slash function\n {IHorizonStaking.slash}.\n @dev Can only be called by the slasher role.\n @param indexer Address of indexer to slash\n @param tokens Amount of tokens to slash from the indexer stake\n @param reward Amount of reward tokens to send to a beneficiary\n @param beneficiary Address of a beneficiary to receive a reward for the slashing" + }, + "functionSelector": "4488a382", + "id": 3161, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "legacySlash", + "nameLocation": "7133:11:30", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3159, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3152, + "mutability": "mutable", + "name": "indexer", + "nameLocation": "7153:7:30", + "nodeType": "VariableDeclaration", + "scope": 3161, + "src": "7145:15:30", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3151, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "7145:7:30", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3154, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "7170:6:30", + "nodeType": "VariableDeclaration", + "scope": 3161, + "src": "7162:14:30", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3153, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "7162:7:30", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3156, + "mutability": "mutable", + "name": "reward", + "nameLocation": "7186:6:30", + "nodeType": "VariableDeclaration", + "scope": 3161, + "src": "7178:14:30", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3155, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "7178:7:30", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3158, + "mutability": "mutable", + "name": "beneficiary", + "nameLocation": "7202:11:30", + "nodeType": "VariableDeclaration", + "scope": 3161, + "src": "7194:19:30", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3157, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "7194:7:30", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "7144:70:30" + }, + "returnParameters": { + "id": 3160, + "nodeType": "ParameterList", + "parameters": [], + "src": "7223:0:30" + }, + "scope": 3226, + "src": "7124:100:30", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 3162, + "nodeType": "StructuredDocumentation", + "src": "7230:298:30", + "text": " @notice (Legacy) Return true if operator is allowed for the service provider on the subgraph data service.\n @param operator Address of the operator\n @param indexer Address of the service provider\n @return True if operator is allowed for indexer, false otherwise" + }, + "functionSelector": "b6363cf2", + "id": 3171, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "isOperator", + "nameLocation": "7542:10:30", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3167, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3164, + "mutability": "mutable", + "name": "operator", + "nameLocation": "7561:8:30", + "nodeType": "VariableDeclaration", + "scope": 3171, + "src": "7553:16:30", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3163, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "7553:7:30", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3166, + "mutability": "mutable", + "name": "indexer", + "nameLocation": "7579:7:30", + "nodeType": "VariableDeclaration", + "scope": 3171, + "src": "7571:15:30", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3165, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "7571:7:30", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "7552:35:30" + }, + "returnParameters": { + "id": 3170, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3169, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 3171, + "src": "7611:4:30", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 3168, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "7611:4:30", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "src": "7610:6:30" + }, + "scope": 3226, + "src": "7533:84:30", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 3172, + "nodeType": "StructuredDocumentation", + "src": "7623:169:30", + "text": " @notice Getter that returns if an indexer has any stake.\n @param indexer Address of the indexer\n @return True if indexer has staked tokens" + }, + "functionSelector": "e73e14bf", + "id": 3179, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "hasStake", + "nameLocation": "7806:8:30", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3175, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3174, + "mutability": "mutable", + "name": "indexer", + "nameLocation": "7823:7:30", + "nodeType": "VariableDeclaration", + "scope": 3179, + "src": "7815:15:30", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3173, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "7815:7:30", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "7814:17:30" + }, + "returnParameters": { + "id": 3178, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3177, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 3179, + "src": "7855:4:30", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 3176, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "7855:4:30", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "src": "7854:6:30" + }, + "scope": 3226, + "src": "7797:64:30", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 3180, + "nodeType": "StructuredDocumentation", + "src": "7867:179:30", + "text": " @notice Get the total amount of tokens staked by the indexer.\n @param indexer Address of the indexer\n @return Amount of tokens staked by the indexer" + }, + "functionSelector": "1787e69f", + "id": 3187, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "getIndexerStakedTokens", + "nameLocation": "8060:22:30", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3183, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3182, + "mutability": "mutable", + "name": "indexer", + "nameLocation": "8091:7:30", + "nodeType": "VariableDeclaration", + "scope": 3187, + "src": "8083:15:30", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3181, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "8083:7:30", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "8082:17:30" + }, + "returnParameters": { + "id": 3186, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3185, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 3187, + "src": "8123:7:30", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3184, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "8123:7:30", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "8122:9:30" + }, + "scope": 3226, + "src": "8051:81:30", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 3188, + "nodeType": "StructuredDocumentation", + "src": "8138:151:30", + "text": " @notice Return the allocation by ID.\n @param allocationID Address used as allocation identifier\n @return Allocation data" + }, + "functionSelector": "0e022923", + "id": 3196, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "getAllocation", + "nameLocation": "8303:13:30", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3191, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3190, + "mutability": "mutable", + "name": "allocationID", + "nameLocation": "8325:12:30", + "nodeType": "VariableDeclaration", + "scope": 3196, + "src": "8317:20:30", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3189, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "8317:7:30", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "8316:22:30" + }, + "returnParameters": { + "id": 3195, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3194, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 3196, + "src": "8362:17:30", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allocation_$3073_memory_ptr", + "typeString": "struct IHorizonStakingExtension.Allocation" + }, + "typeName": { + "id": 3193, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 3192, + "name": "Allocation", + "nameLocations": [ + "8362:10:30" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 3073, + "src": "8362:10:30" + }, + "referencedDeclaration": 3073, + "src": "8362:10:30", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allocation_$3073_storage_ptr", + "typeString": "struct IHorizonStakingExtension.Allocation" + } + }, + "visibility": "internal" + } + ], + "src": "8361:19:30" + }, + "scope": 3226, + "src": "8294:87:30", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 3197, + "nodeType": "StructuredDocumentation", + "src": "8387:186:30", + "text": " @notice Return the current state of an allocation\n @param allocationID Allocation identifier\n @return AllocationState enum with the state of the allocation" + }, + "functionSelector": "98c657dc", + "id": 3205, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "getAllocationState", + "nameLocation": "8587:18:30", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3200, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3199, + "mutability": "mutable", + "name": "allocationID", + "nameLocation": "8614:12:30", + "nodeType": "VariableDeclaration", + "scope": 3205, + "src": "8606:20:30", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3198, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "8606:7:30", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "8605:22:30" + }, + "returnParameters": { + "id": 3204, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3203, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 3205, + "src": "8651:15:30", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_AllocationState_$3078", + "typeString": "enum IHorizonStakingExtension.AllocationState" + }, + "typeName": { + "id": 3202, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 3201, + "name": "AllocationState", + "nameLocations": [ + "8651:15:30" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 3078, + "src": "8651:15:30" + }, + "referencedDeclaration": 3078, + "src": "8651:15:30", + "typeDescriptions": { + "typeIdentifier": "t_enum$_AllocationState_$3078", + "typeString": "enum IHorizonStakingExtension.AllocationState" + } + }, + "visibility": "internal" + } + ], + "src": "8650:17:30" + }, + "scope": 3226, + "src": "8578:90:30", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 3206, + "nodeType": "StructuredDocumentation", + "src": "8674:190:30", + "text": " @notice Return if allocationID is used.\n @param allocationID Address used as signer by the indexer for an allocation\n @return True if allocationID already used" + }, + "functionSelector": "f1d60d66", + "id": 3213, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "isAllocation", + "nameLocation": "8878:12:30", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3209, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3208, + "mutability": "mutable", + "name": "allocationID", + "nameLocation": "8899:12:30", + "nodeType": "VariableDeclaration", + "scope": 3213, + "src": "8891:20:30", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3207, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "8891:7:30", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "8890:22:30" + }, + "returnParameters": { + "id": 3212, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3211, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 3213, + "src": "8936:4:30", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 3210, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "8936:4:30", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "src": "8935:6:30" + }, + "scope": 3226, + "src": "8869:73:30", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 3214, + "nodeType": "StructuredDocumentation", + "src": "8948:167:30", + "text": " @notice Return the time in blocks to unstake\n Deprecated, now enforced by each data service (verifier)\n @return Thawing period in blocks" + }, + "functionSelector": "c0641994", + "id": 3219, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "__DEPRECATED_getThawingPeriod", + "nameLocation": "9129:29:30", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3215, + "nodeType": "ParameterList", + "parameters": [], + "src": "9158:2:30" + }, + "returnParameters": { + "id": 3218, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3217, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 3219, + "src": "9184:6:30", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + }, + "typeName": { + "id": 3216, + "name": "uint64", + "nodeType": "ElementaryTypeName", + "src": "9184:6:30", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "visibility": "internal" + } + ], + "src": "9183:8:30" + }, + "scope": 3226, + "src": "9120:72:30", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 3220, + "nodeType": "StructuredDocumentation", + "src": "9198:219:30", + "text": " @notice Return the address of the subgraph data service.\n @dev TRANSITION PERIOD: After transition period move to main HorizonStaking contract\n @return Address of the subgraph data service" + }, + "functionSelector": "9363c522", + "id": 3225, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "getSubgraphService", + "nameLocation": "9431:18:30", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3221, + "nodeType": "ParameterList", + "parameters": [], + "src": "9449:2:30" + }, + "returnParameters": { + "id": 3224, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3223, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 3225, + "src": "9475:7:30", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3222, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "9475:7:30", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "9474:9:30" + }, + "scope": 3226, + "src": "9422:62:30", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + } + ], + "scope": 3227, + "src": "439:9047:30", + "usedErrors": [], + "usedEvents": [ + 3097, + 3122, + 3133 + ] + } + ], + "src": "46:9441:30" + }, + "id": 30 + }, + "@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingMain.sol": { + "ast": { + "absolutePath": "@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingMain.sol", + "exportedSymbols": { + "IGraphPayments": [ + 2489 + ], + "IHorizonStakingMain": [ + 3937 + ], + "IHorizonStakingTypes": [ + 4073 + ] + }, + "id": 3938, + "license": "GPL-2.0-or-later", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 3228, + "literals": [ + "solidity", + "0.8", + ".27" + ], + "nodeType": "PragmaDirective", + "src": "46:23:31" + }, + { + "absolutePath": "@graphprotocol/horizon/contracts/interfaces/IGraphPayments.sol", + "file": "../../interfaces/IGraphPayments.sol", + "id": 3230, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 3938, + "sourceUnit": 2490, + "src": "71:69:31", + "symbolAliases": [ + { + "foreign": { + "id": 3229, + "name": "IGraphPayments", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2489, + "src": "80:14:31", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingTypes.sol", + "file": "./IHorizonStakingTypes.sol", + "id": 3232, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 3938, + "sourceUnit": 4074, + "src": "141:66:31", + "symbolAliases": [ + { + "foreign": { + "id": 3231, + "name": "IHorizonStakingTypes", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4073, + "src": "150:20:31", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "abstract": false, + "baseContracts": [], + "canonicalName": "IHorizonStakingMain", + "contractDependencies": [], + "contractKind": "interface", + "documentation": { + "id": 3233, + "nodeType": "StructuredDocumentation", + "src": "209:822:31", + "text": " @title Inferface for the {HorizonStaking} contract.\n @notice Provides functions for managing stake, provisions, delegations, and slashing.\n @dev Note that this interface only includes the functions implemented by {HorizonStaking} contract,\n and not those implemented by {HorizonStakingExtension}.\n Do not use this interface to interface with the {HorizonStaking} contract, use {IHorizonStaking} for\n the complete interface.\n @dev Most functions operate over {HorizonStaking} provisions. To uniquely identify a provision\n functions take `serviceProvider` and `verifier` addresses.\n @dev TRANSITION PERIOD: After transition period rename to IHorizonStaking.\n @custom:security-contact Please email security+contracts@thegraph.com if you find any\n bugs. We may have an active bug bounty program." + }, + "fullyImplemented": false, + "id": 3937, + "linearizedBaseContracts": [ + 3937 + ], + "name": "IHorizonStakingMain", + "nameLocation": "1042:19:31", + "nodeType": "ContractDefinition", + "nodes": [ + { + "anonymous": false, + "documentation": { + "id": 3234, + "nodeType": "StructuredDocumentation", + "src": "1096:323:31", + "text": " @notice Emitted when a service provider unstakes tokens during the transition period.\n @param serviceProvider The address of the service provider\n @param tokens The amount of tokens now locked (including previously locked tokens)\n @param until The block number until the stake is locked" + }, + "eventSelector": "91642f23a1196e1424949fafa2a428c3b5d1f699763942ff08a6fbe9d4d7e980", + "id": 3242, + "name": "HorizonStakeLocked", + "nameLocation": "1430:18:31", + "nodeType": "EventDefinition", + "parameters": { + "id": 3241, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3236, + "indexed": true, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "1465:15:31", + "nodeType": "VariableDeclaration", + "scope": 3242, + "src": "1449:31:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3235, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1449:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3238, + "indexed": false, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "1490:6:31", + "nodeType": "VariableDeclaration", + "scope": 3242, + "src": "1482:14:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3237, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1482:7:31", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3240, + "indexed": false, + "mutability": "mutable", + "name": "until", + "nameLocation": "1506:5:31", + "nodeType": "VariableDeclaration", + "scope": 3242, + "src": "1498:13:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3239, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1498:7:31", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "1448:64:31" + }, + "src": "1424:89:31" + }, + { + "anonymous": false, + "documentation": { + "id": 3243, + "nodeType": "StructuredDocumentation", + "src": "1519:223:31", + "text": " @notice Emitted when a service provider withdraws tokens during the transition period.\n @param serviceProvider The address of the service provider\n @param tokens The amount of tokens withdrawn" + }, + "eventSelector": "32eed9ebc5696170068a371fdbea4c076da1bc21b305e78ca0a5e65ee913be83", + "id": 3249, + "name": "HorizonStakeWithdrawn", + "nameLocation": "1753:21:31", + "nodeType": "EventDefinition", + "parameters": { + "id": 3248, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3245, + "indexed": true, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "1791:15:31", + "nodeType": "VariableDeclaration", + "scope": 3249, + "src": "1775:31:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3244, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1775:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3247, + "indexed": false, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "1816:6:31", + "nodeType": "VariableDeclaration", + "scope": 3249, + "src": "1808:14:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3246, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1808:7:31", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "1774:49:31" + }, + "src": "1747:77:31" + }, + { + "anonymous": false, + "documentation": { + "id": 3250, + "nodeType": "StructuredDocumentation", + "src": "1862:537:31", + "text": " @notice Emitted when a service provider provisions staked tokens to a verifier.\n @param serviceProvider The address of the service provider\n @param verifier The address of the verifier\n @param tokens The amount of tokens provisioned\n @param maxVerifierCut The maximum cut, expressed in PPM of the slashed amount, that a verifier can take for themselves when slashing\n @param thawingPeriod The period in seconds that the tokens will be thawing before they can be removed from the provision" + }, + "eventSelector": "88b4c2d08cea0f01a24841ff5d14814ddb5b14ac44b05e0835fcc0dcd8c7bc25", + "id": 3262, + "name": "ProvisionCreated", + "nameLocation": "2410:16:31", + "nodeType": "EventDefinition", + "parameters": { + "id": 3261, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3252, + "indexed": true, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "2452:15:31", + "nodeType": "VariableDeclaration", + "scope": 3262, + "src": "2436:31:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3251, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2436:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3254, + "indexed": true, + "mutability": "mutable", + "name": "verifier", + "nameLocation": "2493:8:31", + "nodeType": "VariableDeclaration", + "scope": 3262, + "src": "2477:24:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3253, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2477:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3256, + "indexed": false, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "2519:6:31", + "nodeType": "VariableDeclaration", + "scope": 3262, + "src": "2511:14:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3255, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2511:7:31", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3258, + "indexed": false, + "mutability": "mutable", + "name": "maxVerifierCut", + "nameLocation": "2542:14:31", + "nodeType": "VariableDeclaration", + "scope": 3262, + "src": "2535:21:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 3257, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "2535:6:31", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3260, + "indexed": false, + "mutability": "mutable", + "name": "thawingPeriod", + "nameLocation": "2573:13:31", + "nodeType": "VariableDeclaration", + "scope": 3262, + "src": "2566:20:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + }, + "typeName": { + "id": 3259, + "name": "uint64", + "nodeType": "ElementaryTypeName", + "src": "2566:6:31", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "visibility": "internal" + } + ], + "src": "2426:166:31" + }, + "src": "2404:189:31" + }, + { + "anonymous": false, + "documentation": { + "id": 3263, + "nodeType": "StructuredDocumentation", + "src": "2599:274:31", + "text": " @notice Emitted whenever staked tokens are added to an existing provision\n @param serviceProvider The address of the service provider\n @param verifier The address of the verifier\n @param tokens The amount of tokens added to the provision" + }, + "eventSelector": "eaf6ea3a42ed2fd1b6d575f818cbda593af9524aa94bd30e65302ac4dc234745", + "id": 3271, + "name": "ProvisionIncreased", + "nameLocation": "2884:18:31", + "nodeType": "EventDefinition", + "parameters": { + "id": 3270, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3265, + "indexed": true, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "2919:15:31", + "nodeType": "VariableDeclaration", + "scope": 3271, + "src": "2903:31:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3264, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2903:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3267, + "indexed": true, + "mutability": "mutable", + "name": "verifier", + "nameLocation": "2952:8:31", + "nodeType": "VariableDeclaration", + "scope": 3271, + "src": "2936:24:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3266, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2936:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3269, + "indexed": false, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "2970:6:31", + "nodeType": "VariableDeclaration", + "scope": 3271, + "src": "2962:14:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3268, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2962:7:31", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "2902:75:31" + }, + "src": "2878:100:31" + }, + { + "anonymous": false, + "documentation": { + "id": 3272, + "nodeType": "StructuredDocumentation", + "src": "2984:255:31", + "text": " @notice Emitted when a service provider thaws tokens from a provision.\n @param serviceProvider The address of the service provider\n @param verifier The address of the verifier\n @param tokens The amount of tokens thawed" + }, + "eventSelector": "3b81913739097ced1e7fa748c6058d34e2c00b961fb501094543b397b198fdaa", + "id": 3280, + "name": "ProvisionThawed", + "nameLocation": "3250:15:31", + "nodeType": "EventDefinition", + "parameters": { + "id": 3279, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3274, + "indexed": true, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "3282:15:31", + "nodeType": "VariableDeclaration", + "scope": 3280, + "src": "3266:31:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3273, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3266:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3276, + "indexed": true, + "mutability": "mutable", + "name": "verifier", + "nameLocation": "3315:8:31", + "nodeType": "VariableDeclaration", + "scope": 3280, + "src": "3299:24:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3275, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3299:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3278, + "indexed": false, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "3333:6:31", + "nodeType": "VariableDeclaration", + "scope": 3280, + "src": "3325:14:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3277, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "3325:7:31", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "3265:75:31" + }, + "src": "3244:97:31" + }, + { + "anonymous": false, + "documentation": { + "id": 3281, + "nodeType": "StructuredDocumentation", + "src": "3347:258:31", + "text": " @notice Emitted when a service provider removes tokens from a provision.\n @param serviceProvider The address of the service provider\n @param verifier The address of the verifier\n @param tokens The amount of tokens removed" + }, + "eventSelector": "9008d731ddfbec70bc364780efd63057c6877bee8027c4708a104b365395885d", + "id": 3289, + "name": "TokensDeprovisioned", + "nameLocation": "3616:19:31", + "nodeType": "EventDefinition", + "parameters": { + "id": 3288, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3283, + "indexed": true, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "3652:15:31", + "nodeType": "VariableDeclaration", + "scope": 3289, + "src": "3636:31:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3282, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3636:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3285, + "indexed": true, + "mutability": "mutable", + "name": "verifier", + "nameLocation": "3685:8:31", + "nodeType": "VariableDeclaration", + "scope": 3289, + "src": "3669:24:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3284, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3669:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3287, + "indexed": false, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "3703:6:31", + "nodeType": "VariableDeclaration", + "scope": 3289, + "src": "3695:14:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3286, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "3695:7:31", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "3635:75:31" + }, + "src": "3610:101:31" + }, + { + "anonymous": false, + "documentation": { + "id": 3290, + "nodeType": "StructuredDocumentation", + "src": "3717:512:31", + "text": " @notice Emitted when a service provider stages a provision parameter update.\n @param serviceProvider The address of the service provider\n @param verifier The address of the verifier\n @param maxVerifierCut The proposed maximum cut, expressed in PPM of the slashed amount, that a verifier can take for\n themselves when slashing\n @param thawingPeriod The proposed period in seconds that the tokens will be thawing before they can be removed from\n the provision" + }, + "eventSelector": "e89cbb9d63ba60af555547b12dde6817283e88cbdd45feb2059f2ba71ea346ba", + "id": 3300, + "name": "ProvisionParametersStaged", + "nameLocation": "4240:25:31", + "nodeType": "EventDefinition", + "parameters": { + "id": 3299, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3292, + "indexed": true, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "4291:15:31", + "nodeType": "VariableDeclaration", + "scope": 3300, + "src": "4275:31:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3291, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4275:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3294, + "indexed": true, + "mutability": "mutable", + "name": "verifier", + "nameLocation": "4332:8:31", + "nodeType": "VariableDeclaration", + "scope": 3300, + "src": "4316:24:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3293, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4316:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3296, + "indexed": false, + "mutability": "mutable", + "name": "maxVerifierCut", + "nameLocation": "4357:14:31", + "nodeType": "VariableDeclaration", + "scope": 3300, + "src": "4350:21:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 3295, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "4350:6:31", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3298, + "indexed": false, + "mutability": "mutable", + "name": "thawingPeriod", + "nameLocation": "4388:13:31", + "nodeType": "VariableDeclaration", + "scope": 3300, + "src": "4381:20:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + }, + "typeName": { + "id": 3297, + "name": "uint64", + "nodeType": "ElementaryTypeName", + "src": "4381:6:31", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "visibility": "internal" + } + ], + "src": "4265:142:31" + }, + "src": "4234:174:31" + }, + { + "anonymous": false, + "documentation": { + "id": 3301, + "nodeType": "StructuredDocumentation", + "src": "4414:503:31", + "text": " @notice Emitted when a service provider accepts a staged provision parameter update.\n @param serviceProvider The address of the service provider\n @param verifier The address of the verifier\n @param maxVerifierCut The new maximum cut, expressed in PPM of the slashed amount, that a verifier can take for themselves\n when slashing\n @param thawingPeriod The new period in seconds that the tokens will be thawing before they can be removed from the provision" + }, + "eventSelector": "a4c005afae9298a5ca51e7710c334ac406fb3d914588ade970850f917cedb1c6", + "id": 3311, + "name": "ProvisionParametersSet", + "nameLocation": "4928:22:31", + "nodeType": "EventDefinition", + "parameters": { + "id": 3310, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3303, + "indexed": true, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "4976:15:31", + "nodeType": "VariableDeclaration", + "scope": 3311, + "src": "4960:31:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3302, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4960:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3305, + "indexed": true, + "mutability": "mutable", + "name": "verifier", + "nameLocation": "5017:8:31", + "nodeType": "VariableDeclaration", + "scope": 3311, + "src": "5001:24:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3304, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5001:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3307, + "indexed": false, + "mutability": "mutable", + "name": "maxVerifierCut", + "nameLocation": "5042:14:31", + "nodeType": "VariableDeclaration", + "scope": 3311, + "src": "5035:21:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 3306, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "5035:6:31", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3309, + "indexed": false, + "mutability": "mutable", + "name": "thawingPeriod", + "nameLocation": "5073:13:31", + "nodeType": "VariableDeclaration", + "scope": 3311, + "src": "5066:20:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + }, + "typeName": { + "id": 3308, + "name": "uint64", + "nodeType": "ElementaryTypeName", + "src": "5066:6:31", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "visibility": "internal" + } + ], + "src": "4950:142:31" + }, + "src": "4922:171:31" + }, + { + "anonymous": false, + "documentation": { + "id": 3312, + "nodeType": "StructuredDocumentation", + "src": "5099:349:31", + "text": " @dev Emitted when an operator is allowed or denied by a service provider for a particular verifier\n @param serviceProvider The address of the service provider\n @param verifier The address of the verifier\n @param operator The address of the operator\n @param allowed Whether the operator is allowed or denied" + }, + "eventSelector": "aa5a59b38e8f68292982382bf635c2f263ca37137bbc52956acd808fd7bf976f", + "id": 3322, + "name": "OperatorSet", + "nameLocation": "5459:11:31", + "nodeType": "EventDefinition", + "parameters": { + "id": 3321, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3314, + "indexed": true, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "5496:15:31", + "nodeType": "VariableDeclaration", + "scope": 3322, + "src": "5480:31:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3313, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5480:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3316, + "indexed": true, + "mutability": "mutable", + "name": "verifier", + "nameLocation": "5537:8:31", + "nodeType": "VariableDeclaration", + "scope": 3322, + "src": "5521:24:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3315, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5521:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3318, + "indexed": true, + "mutability": "mutable", + "name": "operator", + "nameLocation": "5571:8:31", + "nodeType": "VariableDeclaration", + "scope": 3322, + "src": "5555:24:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3317, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5555:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3320, + "indexed": false, + "mutability": "mutable", + "name": "allowed", + "nameLocation": "5594:7:31", + "nodeType": "VariableDeclaration", + "scope": 3322, + "src": "5589:12:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 3319, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "5589:4:31", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "src": "5470:137:31" + }, + "src": "5453:155:31" + }, + { + "anonymous": false, + "documentation": { + "id": 3323, + "nodeType": "StructuredDocumentation", + "src": "5645:305:31", + "text": " @notice Emitted when a provision is slashed by a verifier.\n @param serviceProvider The address of the service provider\n @param verifier The address of the verifier\n @param tokens The amount of tokens slashed (note this only represents service provider's slashed stake)" + }, + "eventSelector": "e7b110f13cde981d5079ab7faa4249c5f331f5c292dbc6031969d2ce694188a3", + "id": 3331, + "name": "ProvisionSlashed", + "nameLocation": "5961:16:31", + "nodeType": "EventDefinition", + "parameters": { + "id": 3330, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3325, + "indexed": true, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "5994:15:31", + "nodeType": "VariableDeclaration", + "scope": 3331, + "src": "5978:31:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3324, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5978:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3327, + "indexed": true, + "mutability": "mutable", + "name": "verifier", + "nameLocation": "6027:8:31", + "nodeType": "VariableDeclaration", + "scope": 3331, + "src": "6011:24:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3326, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6011:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3329, + "indexed": false, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "6045:6:31", + "nodeType": "VariableDeclaration", + "scope": 3331, + "src": "6037:14:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3328, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "6037:7:31", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "5977:75:31" + }, + "src": "5955:98:31" + }, + { + "anonymous": false, + "documentation": { + "id": 3332, + "nodeType": "StructuredDocumentation", + "src": "6059:310:31", + "text": " @notice Emitted when a delegation pool is slashed by a verifier.\n @param serviceProvider The address of the service provider\n @param verifier The address of the verifier\n @param tokens The amount of tokens slashed (note this only represents delegation pool's slashed stake)" + }, + "eventSelector": "c5d16dbb577cf07678b577232717c9a606197a014f61847e623d47fc6bf6b771", + "id": 3340, + "name": "DelegationSlashed", + "nameLocation": "6380:17:31", + "nodeType": "EventDefinition", + "parameters": { + "id": 3339, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3334, + "indexed": true, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "6414:15:31", + "nodeType": "VariableDeclaration", + "scope": 3340, + "src": "6398:31:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3333, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6398:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3336, + "indexed": true, + "mutability": "mutable", + "name": "verifier", + "nameLocation": "6447:8:31", + "nodeType": "VariableDeclaration", + "scope": 3340, + "src": "6431:24:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3335, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6431:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3338, + "indexed": false, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "6465:6:31", + "nodeType": "VariableDeclaration", + "scope": 3340, + "src": "6457:14:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3337, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "6457:7:31", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "6397:75:31" + }, + "src": "6374:99:31" + }, + { + "anonymous": false, + "documentation": { + "id": 3341, + "nodeType": "StructuredDocumentation", + "src": "6479:441:31", + "text": " @notice Emitted when a delegation pool would have been slashed by a verifier, but the slashing was skipped\n because delegation slashing global parameter is not enabled.\n @param serviceProvider The address of the service provider\n @param verifier The address of the verifier\n @param tokens The amount of tokens that would have been slashed (note this only represents delegation pool's slashed stake)" + }, + "eventSelector": "dce44f0aeed2089c75db59f5a517b9a19a734bf0213412fa129f0d0434126b24", + "id": 3349, + "name": "DelegationSlashingSkipped", + "nameLocation": "6931:25:31", + "nodeType": "EventDefinition", + "parameters": { + "id": 3348, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3343, + "indexed": true, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "6973:15:31", + "nodeType": "VariableDeclaration", + "scope": 3349, + "src": "6957:31:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3342, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6957:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3345, + "indexed": true, + "mutability": "mutable", + "name": "verifier", + "nameLocation": "7006:8:31", + "nodeType": "VariableDeclaration", + "scope": 3349, + "src": "6990:24:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3344, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6990:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3347, + "indexed": false, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "7024:6:31", + "nodeType": "VariableDeclaration", + "scope": 3349, + "src": "7016:14:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3346, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "7016:7:31", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "6956:75:31" + }, + "src": "6925:107:31" + }, + { + "anonymous": false, + "documentation": { + "id": 3350, + "nodeType": "StructuredDocumentation", + "src": "7038:357:31", + "text": " @notice Emitted when the verifier cut is sent to the verifier after slashing a provision.\n @param serviceProvider The address of the service provider\n @param verifier The address of the verifier\n @param destination The address where the verifier cut is sent\n @param tokens The amount of tokens sent to the verifier" + }, + "eventSelector": "95ff4196cd75fa49180ba673948ea43935f59e7c4ba101fa09b9fe0ec266d582", + "id": 3360, + "name": "VerifierTokensSent", + "nameLocation": "7406:18:31", + "nodeType": "EventDefinition", + "parameters": { + "id": 3359, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3352, + "indexed": true, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "7450:15:31", + "nodeType": "VariableDeclaration", + "scope": 3360, + "src": "7434:31:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3351, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "7434:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3354, + "indexed": true, + "mutability": "mutable", + "name": "verifier", + "nameLocation": "7491:8:31", + "nodeType": "VariableDeclaration", + "scope": 3360, + "src": "7475:24:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3353, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "7475:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3356, + "indexed": true, + "mutability": "mutable", + "name": "destination", + "nameLocation": "7525:11:31", + "nodeType": "VariableDeclaration", + "scope": 3360, + "src": "7509:27:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3355, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "7509:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3358, + "indexed": false, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "7554:6:31", + "nodeType": "VariableDeclaration", + "scope": 3360, + "src": "7546:14:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3357, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "7546:7:31", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "7424:142:31" + }, + "src": "7400:167:31" + }, + { + "anonymous": false, + "documentation": { + "id": 3361, + "nodeType": "StructuredDocumentation", + "src": "7606:350:31", + "text": " @notice Emitted when tokens are delegated to a provision.\n @param serviceProvider The address of the service provider\n @param verifier The address of the verifier\n @param delegator The address of the delegator\n @param tokens The amount of tokens delegated\n @param shares The amount of shares delegated" + }, + "eventSelector": "237818af8bb47710142edd8fc301fbc507064fb357cf122fb161ca447e3cb13e", + "id": 3373, + "name": "TokensDelegated", + "nameLocation": "7967:15:31", + "nodeType": "EventDefinition", + "parameters": { + "id": 3372, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3363, + "indexed": true, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "8008:15:31", + "nodeType": "VariableDeclaration", + "scope": 3373, + "src": "7992:31:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3362, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "7992:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3365, + "indexed": true, + "mutability": "mutable", + "name": "verifier", + "nameLocation": "8049:8:31", + "nodeType": "VariableDeclaration", + "scope": 3373, + "src": "8033:24:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3364, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "8033:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3367, + "indexed": true, + "mutability": "mutable", + "name": "delegator", + "nameLocation": "8083:9:31", + "nodeType": "VariableDeclaration", + "scope": 3373, + "src": "8067:25:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3366, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "8067:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3369, + "indexed": false, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "8110:6:31", + "nodeType": "VariableDeclaration", + "scope": 3373, + "src": "8102:14:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3368, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "8102:7:31", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3371, + "indexed": false, + "mutability": "mutable", + "name": "shares", + "nameLocation": "8134:6:31", + "nodeType": "VariableDeclaration", + "scope": 3373, + "src": "8126:14:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3370, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "8126:7:31", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "7982:164:31" + }, + "src": "7961:186:31" + }, + { + "anonymous": false, + "documentation": { + "id": 3374, + "nodeType": "StructuredDocumentation", + "src": "8153:397:31", + "text": " @notice Emitted when a delegator undelegates tokens from a provision and starts\n thawing them.\n @param serviceProvider The address of the service provider\n @param verifier The address of the verifier\n @param delegator The address of the delegator\n @param tokens The amount of tokens undelegated\n @param shares The amount of shares undelegated" + }, + "eventSelector": "0525d6ad1aa78abc571b5c1984b5e1ea4f1412368c1cc348ca408dbb1085c9a1", + "id": 3386, + "name": "TokensUndelegated", + "nameLocation": "8561:17:31", + "nodeType": "EventDefinition", + "parameters": { + "id": 3385, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3376, + "indexed": true, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "8604:15:31", + "nodeType": "VariableDeclaration", + "scope": 3386, + "src": "8588:31:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3375, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "8588:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3378, + "indexed": true, + "mutability": "mutable", + "name": "verifier", + "nameLocation": "8645:8:31", + "nodeType": "VariableDeclaration", + "scope": 3386, + "src": "8629:24:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3377, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "8629:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3380, + "indexed": true, + "mutability": "mutable", + "name": "delegator", + "nameLocation": "8679:9:31", + "nodeType": "VariableDeclaration", + "scope": 3386, + "src": "8663:25:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3379, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "8663:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3382, + "indexed": false, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "8706:6:31", + "nodeType": "VariableDeclaration", + "scope": 3386, + "src": "8698:14:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3381, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "8698:7:31", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3384, + "indexed": false, + "mutability": "mutable", + "name": "shares", + "nameLocation": "8730:6:31", + "nodeType": "VariableDeclaration", + "scope": 3386, + "src": "8722:14:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3383, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "8722:7:31", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "8578:164:31" + }, + "src": "8555:188:31" + }, + { + "anonymous": false, + "documentation": { + "id": 3387, + "nodeType": "StructuredDocumentation", + "src": "8749:322:31", + "text": " @notice Emitted when a delegator withdraws tokens from a provision after thawing.\n @param serviceProvider The address of the service provider\n @param verifier The address of the verifier\n @param delegator The address of the delegator\n @param tokens The amount of tokens withdrawn" + }, + "eventSelector": "305f519d8909c676ffd870495d4563032eb0b506891a6dd9827490256cc9914e", + "id": 3397, + "name": "DelegatedTokensWithdrawn", + "nameLocation": "9082:24:31", + "nodeType": "EventDefinition", + "parameters": { + "id": 3396, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3389, + "indexed": true, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "9132:15:31", + "nodeType": "VariableDeclaration", + "scope": 3397, + "src": "9116:31:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3388, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "9116:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3391, + "indexed": true, + "mutability": "mutable", + "name": "verifier", + "nameLocation": "9173:8:31", + "nodeType": "VariableDeclaration", + "scope": 3397, + "src": "9157:24:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3390, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "9157:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3393, + "indexed": true, + "mutability": "mutable", + "name": "delegator", + "nameLocation": "9207:9:31", + "nodeType": "VariableDeclaration", + "scope": 3397, + "src": "9191:25:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3392, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "9191:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3395, + "indexed": false, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "9234:6:31", + "nodeType": "VariableDeclaration", + "scope": 3397, + "src": "9226:14:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3394, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "9226:7:31", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "9106:140:31" + }, + "src": "9076:171:31" + }, + { + "anonymous": false, + "documentation": { + "id": 3398, + "nodeType": "StructuredDocumentation", + "src": "9253:346:31", + "text": " @notice Emitted when `delegator` withdrew delegated `tokens` from `indexer` using `withdrawDelegated`.\n @dev This event is for the legacy `withdrawDelegated` function.\n @param indexer The address of the indexer\n @param delegator The address of the delegator\n @param tokens The amount of tokens withdrawn" + }, + "eventSelector": "1b2e7737e043c5cf1b587ceb4daeb7ae00148b9bda8f79f1093eead08f141952", + "id": 3406, + "name": "StakeDelegatedWithdrawn", + "nameLocation": "9610:23:31", + "nodeType": "EventDefinition", + "parameters": { + "id": 3405, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3400, + "indexed": true, + "mutability": "mutable", + "name": "indexer", + "nameLocation": "9650:7:31", + "nodeType": "VariableDeclaration", + "scope": 3406, + "src": "9634:23:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3399, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "9634:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3402, + "indexed": true, + "mutability": "mutable", + "name": "delegator", + "nameLocation": "9675:9:31", + "nodeType": "VariableDeclaration", + "scope": 3406, + "src": "9659:25:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3401, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "9659:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3404, + "indexed": false, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "9694:6:31", + "nodeType": "VariableDeclaration", + "scope": 3406, + "src": "9686:14:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3403, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "9686:7:31", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "9633:68:31" + }, + "src": "9604:98:31" + }, + { + "anonymous": false, + "documentation": { + "id": 3407, + "nodeType": "StructuredDocumentation", + "src": "9708:257:31", + "text": " @notice Emitted when tokens are added to a delegation pool's reserve.\n @param serviceProvider The address of the service provider\n @param verifier The address of the verifier\n @param tokens The amount of tokens withdrawn" + }, + "eventSelector": "673007a04e501145e79f59aea5e0413b6e88344fdaf10326254530d6a1511530", + "id": 3415, + "name": "TokensToDelegationPoolAdded", + "nameLocation": "9976:27:31", + "nodeType": "EventDefinition", + "parameters": { + "id": 3414, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3409, + "indexed": true, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "10020:15:31", + "nodeType": "VariableDeclaration", + "scope": 3415, + "src": "10004:31:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3408, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "10004:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3411, + "indexed": true, + "mutability": "mutable", + "name": "verifier", + "nameLocation": "10053:8:31", + "nodeType": "VariableDeclaration", + "scope": 3415, + "src": "10037:24:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3410, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "10037:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3413, + "indexed": false, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "10071:6:31", + "nodeType": "VariableDeclaration", + "scope": 3415, + "src": "10063:14:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3412, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "10063:7:31", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "10003:75:31" + }, + "src": "9970:109:31" + }, + { + "anonymous": false, + "documentation": { + "id": 3416, + "nodeType": "StructuredDocumentation", + "src": "10085:365:31", + "text": " @notice Emitted when a service provider sets delegation fee cuts for a verifier.\n @param serviceProvider The address of the service provider\n @param verifier The address of the verifier\n @param paymentType The payment type for which the fee cut is set, as defined in {IGraphPayments}\n @param feeCut The fee cut set, in PPM" + }, + "eventSelector": "3474eba30406cacbfbc5a596a7e471662bbcccf206f8d244dbb6f4cc578c5220", + "id": 3427, + "name": "DelegationFeeCutSet", + "nameLocation": "10461:19:31", + "nodeType": "EventDefinition", + "parameters": { + "id": 3426, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3418, + "indexed": true, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "10506:15:31", + "nodeType": "VariableDeclaration", + "scope": 3427, + "src": "10490:31:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3417, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "10490:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3420, + "indexed": true, + "mutability": "mutable", + "name": "verifier", + "nameLocation": "10547:8:31", + "nodeType": "VariableDeclaration", + "scope": 3427, + "src": "10531:24:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3419, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "10531:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3423, + "indexed": true, + "mutability": "mutable", + "name": "paymentType", + "nameLocation": "10601:11:31", + "nodeType": "VariableDeclaration", + "scope": 3427, + "src": "10565:47:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_PaymentTypes_$2433", + "typeString": "enum IGraphPayments.PaymentTypes" + }, + "typeName": { + "id": 3422, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 3421, + "name": "IGraphPayments.PaymentTypes", + "nameLocations": [ + "10565:14:31", + "10580:12:31" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 2433, + "src": "10565:27:31" + }, + "referencedDeclaration": 2433, + "src": "10565:27:31", + "typeDescriptions": { + "typeIdentifier": "t_enum$_PaymentTypes_$2433", + "typeString": "enum IGraphPayments.PaymentTypes" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3425, + "indexed": false, + "mutability": "mutable", + "name": "feeCut", + "nameLocation": "10630:6:31", + "nodeType": "VariableDeclaration", + "scope": 3427, + "src": "10622:14:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3424, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "10622:7:31", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "10480:162:31" + }, + "src": "10455:188:31" + }, + { + "anonymous": false, + "documentation": { + "id": 3428, + "nodeType": "StructuredDocumentation", + "src": "10679:636:31", + "text": " @notice Emitted when a thaw request is created.\n @dev Can be emitted by the service provider when thawing stake or by the delegator when undelegating.\n @param requestType The type of thaw request\n @param serviceProvider The address of the service provider\n @param verifier The address of the verifier\n @param owner The address of the owner of the thaw request.\n @param shares The amount of shares being thawed\n @param thawingUntil The timestamp until the stake is thawed\n @param thawRequestId The ID of the thaw request\n @param nonce The nonce of the thaw request" + }, + "eventSelector": "036538df4a591a5cc74b68cfc7f8c61e8173dbc81627e1d62600b61e82046178", + "id": 3447, + "name": "ThawRequestCreated", + "nameLocation": "11326:18:31", + "nodeType": "EventDefinition", + "parameters": { + "id": 3446, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3431, + "indexed": true, + "mutability": "mutable", + "name": "requestType", + "nameLocation": "11399:11:31", + "nodeType": "VariableDeclaration", + "scope": 3447, + "src": "11354:56:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_ThawRequestType_$4033", + "typeString": "enum IHorizonStakingTypes.ThawRequestType" + }, + "typeName": { + "id": 3430, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 3429, + "name": "IHorizonStakingTypes.ThawRequestType", + "nameLocations": [ + "11354:20:31", + "11375:15:31" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 4033, + "src": "11354:36:31" + }, + "referencedDeclaration": 4033, + "src": "11354:36:31", + "typeDescriptions": { + "typeIdentifier": "t_enum$_ThawRequestType_$4033", + "typeString": "enum IHorizonStakingTypes.ThawRequestType" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3433, + "indexed": true, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "11436:15:31", + "nodeType": "VariableDeclaration", + "scope": 3447, + "src": "11420:31:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3432, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "11420:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3435, + "indexed": true, + "mutability": "mutable", + "name": "verifier", + "nameLocation": "11477:8:31", + "nodeType": "VariableDeclaration", + "scope": 3447, + "src": "11461:24:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3434, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "11461:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3437, + "indexed": false, + "mutability": "mutable", + "name": "owner", + "nameLocation": "11503:5:31", + "nodeType": "VariableDeclaration", + "scope": 3447, + "src": "11495:13:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3436, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "11495:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3439, + "indexed": false, + "mutability": "mutable", + "name": "shares", + "nameLocation": "11526:6:31", + "nodeType": "VariableDeclaration", + "scope": 3447, + "src": "11518:14:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3438, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "11518:7:31", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3441, + "indexed": false, + "mutability": "mutable", + "name": "thawingUntil", + "nameLocation": "11549:12:31", + "nodeType": "VariableDeclaration", + "scope": 3447, + "src": "11542:19:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + }, + "typeName": { + "id": 3440, + "name": "uint64", + "nodeType": "ElementaryTypeName", + "src": "11542:6:31", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3443, + "indexed": false, + "mutability": "mutable", + "name": "thawRequestId", + "nameLocation": "11579:13:31", + "nodeType": "VariableDeclaration", + "scope": 3447, + "src": "11571:21:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 3442, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "11571:7:31", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3445, + "indexed": false, + "mutability": "mutable", + "name": "nonce", + "nameLocation": "11610:5:31", + "nodeType": "VariableDeclaration", + "scope": 3447, + "src": "11602:13:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3444, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "11602:7:31", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "11344:277:31" + }, + "src": "11320:302:31" + }, + { + "anonymous": false, + "documentation": { + "id": 3448, + "nodeType": "StructuredDocumentation", + "src": "11628:469:31", + "text": " @notice Emitted when a thaw request is fulfilled, meaning the stake is released.\n @param requestType The type of thaw request\n @param thawRequestId The ID of the thaw request\n @param tokens The amount of tokens being released\n @param shares The amount of shares being released\n @param thawingUntil The timestamp until the stake has thawed\n @param valid Whether the thaw request was valid at the time of fulfillment" + }, + "eventSelector": "469e89d0a4e0e5deb2eb1ade5b3fa67fdfbeb4787c3a7c1e8e89aaf28562cab2", + "id": 3463, + "name": "ThawRequestFulfilled", + "nameLocation": "12108:20:31", + "nodeType": "EventDefinition", + "parameters": { + "id": 3462, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3451, + "indexed": true, + "mutability": "mutable", + "name": "requestType", + "nameLocation": "12183:11:31", + "nodeType": "VariableDeclaration", + "scope": 3463, + "src": "12138:56:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_ThawRequestType_$4033", + "typeString": "enum IHorizonStakingTypes.ThawRequestType" + }, + "typeName": { + "id": 3450, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 3449, + "name": "IHorizonStakingTypes.ThawRequestType", + "nameLocations": [ + "12138:20:31", + "12159:15:31" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 4033, + "src": "12138:36:31" + }, + "referencedDeclaration": 4033, + "src": "12138:36:31", + "typeDescriptions": { + "typeIdentifier": "t_enum$_ThawRequestType_$4033", + "typeString": "enum IHorizonStakingTypes.ThawRequestType" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3453, + "indexed": true, + "mutability": "mutable", + "name": "thawRequestId", + "nameLocation": "12220:13:31", + "nodeType": "VariableDeclaration", + "scope": 3463, + "src": "12204:29:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 3452, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "12204:7:31", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3455, + "indexed": false, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "12251:6:31", + "nodeType": "VariableDeclaration", + "scope": 3463, + "src": "12243:14:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3454, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "12243:7:31", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3457, + "indexed": false, + "mutability": "mutable", + "name": "shares", + "nameLocation": "12275:6:31", + "nodeType": "VariableDeclaration", + "scope": 3463, + "src": "12267:14:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3456, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "12267:7:31", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3459, + "indexed": false, + "mutability": "mutable", + "name": "thawingUntil", + "nameLocation": "12298:12:31", + "nodeType": "VariableDeclaration", + "scope": 3463, + "src": "12291:19:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + }, + "typeName": { + "id": 3458, + "name": "uint64", + "nodeType": "ElementaryTypeName", + "src": "12291:6:31", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3461, + "indexed": false, + "mutability": "mutable", + "name": "valid", + "nameLocation": "12325:5:31", + "nodeType": "VariableDeclaration", + "scope": 3463, + "src": "12320:10:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 3460, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "12320:4:31", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "src": "12128:208:31" + }, + "src": "12102:235:31" + }, + { + "anonymous": false, + "documentation": { + "id": 3464, + "nodeType": "StructuredDocumentation", + "src": "12343:451:31", + "text": " @notice Emitted when a series of thaw requests are fulfilled.\n @param serviceProvider The address of the service provider\n @param verifier The address of the verifier\n @param owner The address of the owner of the thaw requests\n @param thawRequestsFulfilled The number of thaw requests fulfilled\n @param tokens The total amount of tokens being released\n @param requestType The type of thaw request" + }, + "eventSelector": "86c2f162872d7c46d7ee0caad366da6dc430889b9d8f27e4bed3785548f9954b", + "id": 3479, + "name": "ThawRequestsFulfilled", + "nameLocation": "12805:21:31", + "nodeType": "EventDefinition", + "parameters": { + "id": 3478, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3467, + "indexed": true, + "mutability": "mutable", + "name": "requestType", + "nameLocation": "12881:11:31", + "nodeType": "VariableDeclaration", + "scope": 3479, + "src": "12836:56:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_ThawRequestType_$4033", + "typeString": "enum IHorizonStakingTypes.ThawRequestType" + }, + "typeName": { + "id": 3466, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 3465, + "name": "IHorizonStakingTypes.ThawRequestType", + "nameLocations": [ + "12836:20:31", + "12857:15:31" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 4033, + "src": "12836:36:31" + }, + "referencedDeclaration": 4033, + "src": "12836:36:31", + "typeDescriptions": { + "typeIdentifier": "t_enum$_ThawRequestType_$4033", + "typeString": "enum IHorizonStakingTypes.ThawRequestType" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3469, + "indexed": true, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "12918:15:31", + "nodeType": "VariableDeclaration", + "scope": 3479, + "src": "12902:31:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3468, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "12902:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3471, + "indexed": true, + "mutability": "mutable", + "name": "verifier", + "nameLocation": "12959:8:31", + "nodeType": "VariableDeclaration", + "scope": 3479, + "src": "12943:24:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3470, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "12943:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3473, + "indexed": false, + "mutability": "mutable", + "name": "owner", + "nameLocation": "12985:5:31", + "nodeType": "VariableDeclaration", + "scope": 3479, + "src": "12977:13:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3472, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "12977:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3475, + "indexed": false, + "mutability": "mutable", + "name": "thawRequestsFulfilled", + "nameLocation": "13008:21:31", + "nodeType": "VariableDeclaration", + "scope": 3479, + "src": "13000:29:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3474, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "13000:7:31", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3477, + "indexed": false, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "13047:6:31", + "nodeType": "VariableDeclaration", + "scope": 3479, + "src": "13039:14:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3476, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "13039:7:31", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "12826:233:31" + }, + "src": "12799:261:31" + }, + { + "anonymous": false, + "documentation": { + "id": 3480, + "nodeType": "StructuredDocumentation", + "src": "13099:166:31", + "text": " @notice Emitted when the global maximum thawing period allowed for provisions is set.\n @param maxThawingPeriod The new maximum thawing period" + }, + "eventSelector": "e8526be46fa99b6313d439293c9be3491ffb067741bc8fce9d30c270cbb8459f", + "id": 3484, + "name": "MaxThawingPeriodSet", + "nameLocation": "13276:19:31", + "nodeType": "EventDefinition", + "parameters": { + "id": 3483, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3482, + "indexed": false, + "mutability": "mutable", + "name": "maxThawingPeriod", + "nameLocation": "13303:16:31", + "nodeType": "VariableDeclaration", + "scope": 3484, + "src": "13296:23:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + }, + "typeName": { + "id": 3481, + "name": "uint64", + "nodeType": "ElementaryTypeName", + "src": "13296:6:31", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "visibility": "internal" + } + ], + "src": "13295:25:31" + }, + "src": "13270:51:31" + }, + { + "anonymous": false, + "documentation": { + "id": 3485, + "nodeType": "StructuredDocumentation", + "src": "13327:228:31", + "text": " @notice Emitted when a verifier is allowed or disallowed to be used for locked provisions.\n @param verifier The address of the verifier\n @param allowed Whether the verifier is allowed or disallowed" + }, + "eventSelector": "4542960abc7f2d26dab244fc440acf511e3dd0f5cefad571ca802283b4751bbb", + "id": 3491, + "name": "AllowedLockedVerifierSet", + "nameLocation": "13566:24:31", + "nodeType": "EventDefinition", + "parameters": { + "id": 3490, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3487, + "indexed": true, + "mutability": "mutable", + "name": "verifier", + "nameLocation": "13607:8:31", + "nodeType": "VariableDeclaration", + "scope": 3491, + "src": "13591:24:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3486, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "13591:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3489, + "indexed": false, + "mutability": "mutable", + "name": "allowed", + "nameLocation": "13622:7:31", + "nodeType": "VariableDeclaration", + "scope": 3491, + "src": "13617:12:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 3488, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "13617:4:31", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "src": "13590:40:31" + }, + "src": "13560:71:31" + }, + { + "anonymous": false, + "documentation": { + "id": 3492, + "nodeType": "StructuredDocumentation", + "src": "13637:145:31", + "text": " @notice Emitted when the legacy global thawing period is set to zero.\n @dev This marks the end of the transition period." + }, + "eventSelector": "93be484d290d119d9cf99cce69d173c732f9403333ad84f69c807b590203d109", + "id": 3494, + "name": "ThawingPeriodCleared", + "nameLocation": "13793:20:31", + "nodeType": "EventDefinition", + "parameters": { + "id": 3493, + "nodeType": "ParameterList", + "parameters": [], + "src": "13813:2:31" + }, + "src": "13787:29:31" + }, + { + "anonymous": false, + "documentation": { + "id": 3495, + "nodeType": "StructuredDocumentation", + "src": "13822:83:31", + "text": " @notice Emitted when the delegation slashing global flag is set." + }, + "eventSelector": "2192802a8934dbf383338406b279ec7f3eccee31e58d6c0444d6dd6bfff24b35", + "id": 3497, + "name": "DelegationSlashingEnabled", + "nameLocation": "13916:25:31", + "nodeType": "EventDefinition", + "parameters": { + "id": 3496, + "nodeType": "ParameterList", + "parameters": [], + "src": "13941:2:31" + }, + "src": "13910:34:31" + }, + { + "documentation": { + "id": 3498, + "nodeType": "StructuredDocumentation", + "src": "13976:84:31", + "text": " @notice Thrown when operating a zero token amount is not allowed." + }, + "errorSelector": "14549cb6", + "id": 3500, + "name": "HorizonStakingInvalidZeroTokens", + "nameLocation": "14071:31:31", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 3499, + "nodeType": "ParameterList", + "parameters": [], + "src": "14102:2:31" + }, + "src": "14065:40:31" + }, + { + "documentation": { + "id": 3501, + "nodeType": "StructuredDocumentation", + "src": "14111:207:31", + "text": " @notice Thrown when a minimum token amount is required to operate but it's not met.\n @param tokens The actual token amount\n @param minRequired The minimum required token amount" + }, + "errorSelector": "b0f57356", + "id": 3507, + "name": "HorizonStakingInsufficientTokens", + "nameLocation": "14329:32:31", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 3506, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3503, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "14370:6:31", + "nodeType": "VariableDeclaration", + "scope": 3507, + "src": "14362:14:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3502, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "14362:7:31", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3505, + "mutability": "mutable", + "name": "minRequired", + "nameLocation": "14386:11:31", + "nodeType": "VariableDeclaration", + "scope": 3507, + "src": "14378:19:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3504, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "14378:7:31", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "14361:37:31" + }, + "src": "14323:76:31" + }, + { + "documentation": { + "id": 3508, + "nodeType": "StructuredDocumentation", + "src": "14405:201:31", + "text": " @notice Thrown when the amount of tokens exceeds the maximum allowed to operate.\n @param tokens The actual token amount\n @param maxTokens The maximum allowed token amount" + }, + "errorSelector": "bd45355c", + "id": 3514, + "name": "HorizonStakingTooManyTokens", + "nameLocation": "14617:27:31", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 3513, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3510, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "14653:6:31", + "nodeType": "VariableDeclaration", + "scope": 3514, + "src": "14645:14:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3509, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "14645:7:31", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3512, + "mutability": "mutable", + "name": "maxTokens", + "nameLocation": "14669:9:31", + "nodeType": "VariableDeclaration", + "scope": 3514, + "src": "14661:17:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3511, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "14661:7:31", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "14644:35:31" + }, + "src": "14611:69:31" + }, + { + "documentation": { + "id": 3515, + "nodeType": "StructuredDocumentation", + "src": "14718:201:31", + "text": " @notice Thrown when attempting to operate with a provision that does not exist.\n @param serviceProvider The service provider address\n @param verifier The verifier address" + }, + "errorSelector": "6159d41a", + "id": 3521, + "name": "HorizonStakingInvalidProvision", + "nameLocation": "14930:30:31", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 3520, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3517, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "14969:15:31", + "nodeType": "VariableDeclaration", + "scope": 3521, + "src": "14961:23:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3516, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "14961:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3519, + "mutability": "mutable", + "name": "verifier", + "nameLocation": "14994:8:31", + "nodeType": "VariableDeclaration", + "scope": 3521, + "src": "14986:16:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3518, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "14986:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "14960:43:31" + }, + "src": "14924:80:31" + }, + { + "documentation": { + "id": 3522, + "nodeType": "StructuredDocumentation", + "src": "15010:237:31", + "text": " @notice Thrown when the caller is not authorized to operate on a provision.\n @param caller The caller address\n @param serviceProvider The service provider address\n @param verifier The verifier address" + }, + "errorSelector": "c76b97b0", + "id": 3530, + "name": "HorizonStakingNotAuthorized", + "nameLocation": "15258:27:31", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 3529, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3524, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "15294:15:31", + "nodeType": "VariableDeclaration", + "scope": 3530, + "src": "15286:23:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3523, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "15286:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3526, + "mutability": "mutable", + "name": "verifier", + "nameLocation": "15319:8:31", + "nodeType": "VariableDeclaration", + "scope": 3530, + "src": "15311:16:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3525, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "15311:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3528, + "mutability": "mutable", + "name": "caller", + "nameLocation": "15337:6:31", + "nodeType": "VariableDeclaration", + "scope": 3530, + "src": "15329:14:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3527, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "15329:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "15285:59:31" + }, + "src": "15252:93:31" + }, + { + "documentation": { + "id": 3531, + "nodeType": "StructuredDocumentation", + "src": "15351:236:31", + "text": " @notice Thrown when attempting to create a provision with a verifier other than the\n subgraph data service. This restriction only applies during the transition period.\n @param verifier The verifier address" + }, + "errorSelector": "353666ff", + "id": 3535, + "name": "HorizonStakingInvalidVerifier", + "nameLocation": "15598:29:31", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 3534, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3533, + "mutability": "mutable", + "name": "verifier", + "nameLocation": "15636:8:31", + "nodeType": "VariableDeclaration", + "scope": 3535, + "src": "15628:16:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3532, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "15628:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "15627:18:31" + }, + "src": "15592:54:31" + }, + { + "documentation": { + "id": 3536, + "nodeType": "StructuredDocumentation", + "src": "15652:163:31", + "text": " @notice Thrown when attempting to create a provision with an invalid maximum verifier cut.\n @param maxVerifierCut The maximum verifier cut" + }, + "errorSelector": "29bff5f5", + "id": 3540, + "name": "HorizonStakingInvalidMaxVerifierCut", + "nameLocation": "15826:35:31", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 3539, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3538, + "mutability": "mutable", + "name": "maxVerifierCut", + "nameLocation": "15869:14:31", + "nodeType": "VariableDeclaration", + "scope": 3540, + "src": "15862:21:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 3537, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "15862:6:31", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + } + ], + "src": "15861:23:31" + }, + "src": "15820:65:31" + }, + { + "documentation": { + "id": 3541, + "nodeType": "StructuredDocumentation", + "src": "15891:217:31", + "text": " @notice Thrown when attempting to create a provision with an invalid thawing period.\n @param thawingPeriod The thawing period\n @param maxThawingPeriod The maximum `thawingPeriod` allowed" + }, + "errorSelector": "ee5602e1", + "id": 3547, + "name": "HorizonStakingInvalidThawingPeriod", + "nameLocation": "16119:34:31", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 3546, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3543, + "mutability": "mutable", + "name": "thawingPeriod", + "nameLocation": "16161:13:31", + "nodeType": "VariableDeclaration", + "scope": 3547, + "src": "16154:20:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + }, + "typeName": { + "id": 3542, + "name": "uint64", + "nodeType": "ElementaryTypeName", + "src": "16154:6:31", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3545, + "mutability": "mutable", + "name": "maxThawingPeriod", + "nameLocation": "16183:16:31", + "nodeType": "VariableDeclaration", + "scope": 3547, + "src": "16176:23:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + }, + "typeName": { + "id": 3544, + "name": "uint64", + "nodeType": "ElementaryTypeName", + "src": "16176:6:31", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "visibility": "internal" + } + ], + "src": "16153:47:31" + }, + "src": "16113:88:31" + }, + { + "documentation": { + "id": 3548, + "nodeType": "StructuredDocumentation", + "src": "16207:120:31", + "text": " @notice Thrown when attempting to create a provision for a data service that already has a provision." + }, + "errorSelector": "56a8581a", + "id": 3550, + "name": "HorizonStakingProvisionAlreadyExists", + "nameLocation": "16338:36:31", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 3549, + "nodeType": "ParameterList", + "parameters": [], + "src": "16374:2:31" + }, + "src": "16332:45:31" + }, + { + "documentation": { + "id": 3551, + "nodeType": "StructuredDocumentation", + "src": "16411:202:31", + "text": " @notice Thrown when the service provider has insufficient idle stake to operate.\n @param tokens The actual token amount\n @param minTokens The minimum required token amount" + }, + "errorSelector": "ccaf28a9", + "id": 3557, + "name": "HorizonStakingInsufficientIdleStake", + "nameLocation": "16624:35:31", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 3556, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3553, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "16668:6:31", + "nodeType": "VariableDeclaration", + "scope": 3557, + "src": "16660:14:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3552, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "16660:7:31", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3555, + "mutability": "mutable", + "name": "minTokens", + "nameLocation": "16684:9:31", + "nodeType": "VariableDeclaration", + "scope": 3557, + "src": "16676:17:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3554, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "16676:7:31", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "16659:35:31" + }, + "src": "16618:77:31" + }, + { + "documentation": { + "id": 3558, + "nodeType": "StructuredDocumentation", + "src": "16701:265:31", + "text": " @notice Thrown during the transition period when the service provider has insufficient stake to\n cover their existing legacy allocations.\n @param tokens The actual token amount\n @param minTokens The minimum required token amount" + }, + "errorSelector": "5dd9b9c7", + "id": 3564, + "name": "HorizonStakingInsufficientStakeForLegacyAllocations", + "nameLocation": "16977:51:31", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 3563, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3560, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "17037:6:31", + "nodeType": "VariableDeclaration", + "scope": 3564, + "src": "17029:14:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3559, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "17029:7:31", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3562, + "mutability": "mutable", + "name": "minTokens", + "nameLocation": "17053:9:31", + "nodeType": "VariableDeclaration", + "scope": 3564, + "src": "17045:17:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3561, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "17045:7:31", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "17028:35:31" + }, + "src": "16971:93:31" + }, + { + "documentation": { + "id": 3565, + "nodeType": "StructuredDocumentation", + "src": "17103:199:31", + "text": " @notice Thrown when delegation shares obtained are below the expected amount.\n @param shares The actual share amount\n @param minShares The minimum required share amount" + }, + "errorSelector": "5d88e8d1", + "id": 3571, + "name": "HorizonStakingSlippageProtection", + "nameLocation": "17313:32:31", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 3570, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3567, + "mutability": "mutable", + "name": "shares", + "nameLocation": "17354:6:31", + "nodeType": "VariableDeclaration", + "scope": 3571, + "src": "17346:14:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3566, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "17346:7:31", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3569, + "mutability": "mutable", + "name": "minShares", + "nameLocation": "17370:9:31", + "nodeType": "VariableDeclaration", + "scope": 3571, + "src": "17362:17:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3568, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "17362:7:31", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "17345:35:31" + }, + "src": "17307:74:31" + }, + { + "documentation": { + "id": 3572, + "nodeType": "StructuredDocumentation", + "src": "17387:84:31", + "text": " @notice Thrown when operating a zero share amount is not allowed." + }, + "errorSelector": "7318ad99", + "id": 3574, + "name": "HorizonStakingInvalidZeroShares", + "nameLocation": "17482:31:31", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 3573, + "nodeType": "ParameterList", + "parameters": [], + "src": "17513:2:31" + }, + "src": "17476:40:31" + }, + { + "documentation": { + "id": 3575, + "nodeType": "StructuredDocumentation", + "src": "17522:205:31", + "text": " @notice Thrown when a minimum share amount is required to operate but it's not met.\n @param shares The actual share amount\n @param minShares The minimum required share amount" + }, + "errorSelector": "ab997935", + "id": 3581, + "name": "HorizonStakingInsufficientShares", + "nameLocation": "17738:32:31", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 3580, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3577, + "mutability": "mutable", + "name": "shares", + "nameLocation": "17779:6:31", + "nodeType": "VariableDeclaration", + "scope": 3581, + "src": "17771:14:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3576, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "17771:7:31", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3579, + "mutability": "mutable", + "name": "minShares", + "nameLocation": "17795:9:31", + "nodeType": "VariableDeclaration", + "scope": 3581, + "src": "17787:17:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3578, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "17787:7:31", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "17770:35:31" + }, + "src": "17732:74:31" + }, + { + "documentation": { + "id": 3582, + "nodeType": "StructuredDocumentation", + "src": "17812:211:31", + "text": " @notice Thrown when as a result of slashing delegation pool has no tokens but has shares.\n @param serviceProvider The service provider address\n @param verifier The verifier address" + }, + "errorSelector": "cc276f78", + "id": 3588, + "name": "HorizonStakingInvalidDelegationPoolState", + "nameLocation": "18034:40:31", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 3587, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3584, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "18083:15:31", + "nodeType": "VariableDeclaration", + "scope": 3588, + "src": "18075:23:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3583, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "18075:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3586, + "mutability": "mutable", + "name": "verifier", + "nameLocation": "18108:8:31", + "nodeType": "VariableDeclaration", + "scope": 3588, + "src": "18100:16:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3585, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "18100:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "18074:43:31" + }, + "src": "18028:90:31" + }, + { + "documentation": { + "id": 3589, + "nodeType": "StructuredDocumentation", + "src": "18124:207:31", + "text": " @notice Thrown when attempting to operate with a delegation pool that does not exist.\n @param serviceProvider The service provider address\n @param verifier The verifier address" + }, + "errorSelector": "b6a70b3b", + "id": 3595, + "name": "HorizonStakingInvalidDelegationPool", + "nameLocation": "18342:35:31", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 3594, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3591, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "18386:15:31", + "nodeType": "VariableDeclaration", + "scope": 3595, + "src": "18378:23:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3590, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "18378:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3593, + "mutability": "mutable", + "name": "verifier", + "nameLocation": "18411:8:31", + "nodeType": "VariableDeclaration", + "scope": 3595, + "src": "18403:16:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3592, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "18403:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "18377:43:31" + }, + "src": "18336:85:31" + }, + { + "documentation": { + "id": 3596, + "nodeType": "StructuredDocumentation", + "src": "18427:202:31", + "text": " @notice Thrown when the minimum token amount required for delegation is not met.\n @param tokens The actual token amount\n @param minTokens The minimum required token amount" + }, + "errorSelector": "b86d8857", + "id": 3602, + "name": "HorizonStakingInsufficientDelegationTokens", + "nameLocation": "18640:42:31", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 3601, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3598, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "18691:6:31", + "nodeType": "VariableDeclaration", + "scope": 3602, + "src": "18683:14:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3597, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "18683:7:31", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3600, + "mutability": "mutable", + "name": "minTokens", + "nameLocation": "18707:9:31", + "nodeType": "VariableDeclaration", + "scope": 3602, + "src": "18699:17:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3599, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "18699:7:31", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "18682:35:31" + }, + "src": "18634:84:31" + }, + { + "documentation": { + "id": 3603, + "nodeType": "StructuredDocumentation", + "src": "18724:113:31", + "text": " @notice Thrown when attempting to redelegate with a serivce provider that is the zero address." + }, + "errorSelector": "88d1f59c", + "id": 3605, + "name": "HorizonStakingInvalidServiceProviderZeroAddress", + "nameLocation": "18848:47:31", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 3604, + "nodeType": "ParameterList", + "parameters": [], + "src": "18895:2:31" + }, + "src": "18842:56:31" + }, + { + "documentation": { + "id": 3606, + "nodeType": "StructuredDocumentation", + "src": "18904:105:31", + "text": " @notice Thrown when attempting to redelegate with a verifier that is the zero address." + }, + "errorSelector": "a9626059", + "id": 3608, + "name": "HorizonStakingInvalidVerifierZeroAddress", + "nameLocation": "19020:40:31", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 3607, + "nodeType": "ParameterList", + "parameters": [], + "src": "19060:2:31" + }, + "src": "19014:49:31" + }, + { + "documentation": { + "id": 3609, + "nodeType": "StructuredDocumentation", + "src": "19105:105:31", + "text": " @notice Thrown when attempting to fulfill a thaw request but there is nothing thawing." + }, + "errorSelector": "3f199628", + "id": 3611, + "name": "HorizonStakingNothingThawing", + "nameLocation": "19221:28:31", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 3610, + "nodeType": "ParameterList", + "parameters": [], + "src": "19249:2:31" + }, + "src": "19215:37:31" + }, + { + "documentation": { + "id": 3612, + "nodeType": "StructuredDocumentation", + "src": "19258:85:31", + "text": " @notice Thrown when a service provider has too many thaw requests." + }, + "errorSelector": "66570a56", + "id": 3614, + "name": "HorizonStakingTooManyThawRequests", + "nameLocation": "19354:33:31", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 3613, + "nodeType": "ParameterList", + "parameters": [], + "src": "19387:2:31" + }, + "src": "19348:42:31" + }, + { + "documentation": { + "id": 3615, + "nodeType": "StructuredDocumentation", + "src": "19396:110:31", + "text": " @notice Thrown when attempting to withdraw tokens that have not thawed (legacy undelegate)." + }, + "errorSelector": "19e9a8e0", + "id": 3617, + "name": "HorizonStakingNothingToWithdraw", + "nameLocation": "19517:31:31", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 3616, + "nodeType": "ParameterList", + "parameters": [], + "src": "19548:2:31" + }, + "src": "19511:40:31" + }, + { + "documentation": { + "id": 3618, + "nodeType": "StructuredDocumentation", + "src": "19583:329:31", + "text": " @notice Thrown during the transition period when attempting to withdraw tokens that are still thawing.\n @dev Note this thawing refers to the global thawing period applied to legacy allocated tokens,\n it does not refer to thaw requests.\n @param until The block number until the stake is locked" + }, + "errorSelector": "e91178d8", + "id": 3622, + "name": "HorizonStakingStillThawing", + "nameLocation": "19923:26:31", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 3621, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3620, + "mutability": "mutable", + "name": "until", + "nameLocation": "19958:5:31", + "nodeType": "VariableDeclaration", + "scope": 3622, + "src": "19950:13:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3619, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "19950:7:31", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "19949:15:31" + }, + "src": "19917:48:31" + }, + { + "documentation": { + "id": 3623, + "nodeType": "StructuredDocumentation", + "src": "19971:211:31", + "text": " @notice Thrown when a service provider attempts to operate on verifiers that are not allowed.\n @dev Only applies to stake from locked wallets.\n @param verifier The verifier address" + }, + "errorSelector": "00a483dc", + "id": 3627, + "name": "HorizonStakingVerifierNotAllowed", + "nameLocation": "20193:32:31", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 3626, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3625, + "mutability": "mutable", + "name": "verifier", + "nameLocation": "20234:8:31", + "nodeType": "VariableDeclaration", + "scope": 3627, + "src": "20226:16:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3624, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "20226:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "20225:18:31" + }, + "src": "20187:57:31" + }, + { + "documentation": { + "id": 3628, + "nodeType": "StructuredDocumentation", + "src": "20250:103:31", + "text": " @notice Thrown when a service provider attempts to change their own operator access." + }, + "errorSelector": "01230653", + "id": 3630, + "name": "HorizonStakingCallerIsServiceProvider", + "nameLocation": "20364:37:31", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 3629, + "nodeType": "ParameterList", + "parameters": [], + "src": "20401:2:31" + }, + "src": "20358:46:31" + }, + { + "documentation": { + "id": 3631, + "nodeType": "StructuredDocumentation", + "src": "20410:125:31", + "text": " @notice Thrown when trying to set a delegation fee cut that is not valid.\n @param feeCut The fee cut" + }, + "errorSelector": "54125404", + "id": 3635, + "name": "HorizonStakingInvalidDelegationFeeCut", + "nameLocation": "20546:37:31", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 3634, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3633, + "mutability": "mutable", + "name": "feeCut", + "nameLocation": "20592:6:31", + "nodeType": "VariableDeclaration", + "scope": 3635, + "src": "20584:14:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3632, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "20584:7:31", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "20583:16:31" + }, + "src": "20540:60:31" + }, + { + "documentation": { + "id": 3636, + "nodeType": "StructuredDocumentation", + "src": "20606:60:31", + "text": " @notice Thrown when a legacy slash fails." + }, + "errorSelector": "ef370f51", + "id": 3638, + "name": "HorizonStakingLegacySlashFailed", + "nameLocation": "20677:31:31", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 3637, + "nodeType": "ParameterList", + "parameters": [], + "src": "20708:2:31" + }, + "src": "20671:40:31" + }, + { + "documentation": { + "id": 3639, + "nodeType": "StructuredDocumentation", + "src": "20717:101:31", + "text": " @notice Thrown when there attempting to slash a provision with no tokens to slash." + }, + "errorSelector": "5452ae48", + "id": 3641, + "name": "HorizonStakingNoTokensToSlash", + "nameLocation": "20829:29:31", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 3640, + "nodeType": "ParameterList", + "parameters": [], + "src": "20858:2:31" + }, + "src": "20823:38:31" + }, + { + "documentation": { + "id": 3642, + "nodeType": "StructuredDocumentation", + "src": "20891:373:31", + "text": " @notice Deposit tokens on the staking contract.\n @dev Pulls tokens from the caller.\n Requirements:\n - `_tokens` cannot be zero.\n - Caller must have previously approved this contract to pull tokens from their balance.\n Emits a {HorizonStakeDeposited} event.\n @param tokens Amount of tokens to stake" + }, + "functionSelector": "a694fc3a", + "id": 3647, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "stake", + "nameLocation": "21278:5:31", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3645, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3644, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "21292:6:31", + "nodeType": "VariableDeclaration", + "scope": 3647, + "src": "21284:14:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3643, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "21284:7:31", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "21283:16:31" + }, + "returnParameters": { + "id": 3646, + "nodeType": "ParameterList", + "parameters": [], + "src": "21308:0:31" + }, + "scope": 3937, + "src": "21269:40:31", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 3648, + "nodeType": "StructuredDocumentation", + "src": "21315:476:31", + "text": " @notice Deposit tokens on the service provider stake, on behalf of the service provider.\n @dev Pulls tokens from the caller.\n Requirements:\n - `_tokens` cannot be zero.\n - Caller must have previously approved this contract to pull tokens from their balance.\n Emits a {HorizonStakeDeposited} event.\n @param serviceProvider Address of the service provider\n @param tokens Amount of tokens to stake" + }, + "functionSelector": "a2a31722", + "id": 3655, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "stakeTo", + "nameLocation": "21805:7:31", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3653, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3650, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "21821:15:31", + "nodeType": "VariableDeclaration", + "scope": 3655, + "src": "21813:23:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3649, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "21813:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3652, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "21846:6:31", + "nodeType": "VariableDeclaration", + "scope": 3655, + "src": "21838:14:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3651, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "21838:7:31", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "21812:41:31" + }, + "returnParameters": { + "id": 3654, + "nodeType": "ParameterList", + "parameters": [], + "src": "21862:0:31" + }, + "scope": 3937, + "src": "21796:67:31", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 3656, + "nodeType": "StructuredDocumentation", + "src": "21869:749:31", + "text": " @notice Deposit tokens on the service provider stake, on behalf of the service provider,\n provisioned to a specific verifier.\n @dev This function can be called by the service provider, by an authorized operator or by the verifier itself.\n @dev Requirements:\n - The `serviceProvider` must have previously provisioned stake to `verifier`.\n - `_tokens` cannot be zero.\n - Caller must have previously approved this contract to pull tokens from their balance.\n Emits {HorizonStakeDeposited} and {ProvisionIncreased} events.\n @param serviceProvider Address of the service provider\n @param verifier Address of the verifier\n @param tokens Amount of tokens to stake" + }, + "functionSelector": "74612092", + "id": 3665, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "stakeToProvision", + "nameLocation": "22632:16:31", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3663, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3658, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "22657:15:31", + "nodeType": "VariableDeclaration", + "scope": 3665, + "src": "22649:23:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3657, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "22649:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3660, + "mutability": "mutable", + "name": "verifier", + "nameLocation": "22682:8:31", + "nodeType": "VariableDeclaration", + "scope": 3665, + "src": "22674:16:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3659, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "22674:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3662, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "22700:6:31", + "nodeType": "VariableDeclaration", + "scope": 3665, + "src": "22692:14:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3661, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "22692:7:31", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "22648:59:31" + }, + "returnParameters": { + "id": 3664, + "nodeType": "ParameterList", + "parameters": [], + "src": "22716:0:31" + }, + "scope": 3937, + "src": "22623:94:31", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 3666, + "nodeType": "StructuredDocumentation", + "src": "22723:838:31", + "text": " @notice Move idle stake back to the owner's account.\n Stake is removed from the protocol:\n - During the transition period it's locked for a period of time before it can be withdrawn\n by calling {withdraw}.\n - After the transition period it's immediately withdrawn.\n Note that after the transition period if there are tokens still locked they will have to be\n withdrawn by calling {withdraw}.\n @dev Requirements:\n - `_tokens` cannot be zero.\n - `_serviceProvider` must have enough idle stake to cover the staking amount and any\n legacy allocation.\n Emits a {HorizonStakeLocked} event during the transition period.\n Emits a {HorizonStakeWithdrawn} event after the transition period.\n @param tokens Amount of tokens to unstake" + }, + "functionSelector": "2e17de78", + "id": 3671, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "unstake", + "nameLocation": "23575:7:31", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3669, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3668, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "23591:6:31", + "nodeType": "VariableDeclaration", + "scope": 3671, + "src": "23583:14:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3667, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "23583:7:31", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "23582:16:31" + }, + "returnParameters": { + "id": 3670, + "nodeType": "ParameterList", + "parameters": [], + "src": "23607:0:31" + }, + "scope": 3937, + "src": "23566:42:31", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 3672, + "nodeType": "StructuredDocumentation", + "src": "23614:314:31", + "text": " @notice Withdraw service provider tokens once the thawing period (initiated by {unstake}) has passed.\n All thawed tokens are withdrawn.\n @dev This is only needed during the transition period while we still have\n a global lock. After that, unstake() will automatically withdraw." + }, + "functionSelector": "3ccfd60b", + "id": 3675, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "withdraw", + "nameLocation": "23942:8:31", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3673, + "nodeType": "ParameterList", + "parameters": [], + "src": "23950:2:31" + }, + "returnParameters": { + "id": 3674, + "nodeType": "ParameterList", + "parameters": [], + "src": "23961:0:31" + }, + "scope": 3937, + "src": "23933:29:31", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 3676, + "nodeType": "StructuredDocumentation", + "src": "23968:1408:31", + "text": " @notice Provision stake to a verifier. The tokens will be locked with a thawing period\n and will be slashable by the verifier. This is the main mechanism to provision stake to a data\n service, where the data service is the verifier.\n This function can be called by the service provider or by an operator authorized by the provider\n for this specific verifier.\n @dev During the transition period, only the subgraph data service can be used as a verifier. This\n prevents an escape hatch for legacy allocation stake.\n @dev Requirements:\n - `tokens` cannot be zero.\n - The `serviceProvider` must have enough idle stake to cover the tokens to provision.\n - `maxVerifierCut` must be a valid PPM.\n - `thawingPeriod` must be less than or equal to `_maxThawingPeriod`.\n Emits a {ProvisionCreated} event.\n @param serviceProvider The service provider address\n @param verifier The verifier address for which the tokens are provisioned (who will be able to slash the tokens)\n @param tokens The amount of tokens that will be locked and slashable\n @param maxVerifierCut The maximum cut, expressed in PPM, that a verifier can transfer instead of burning when slashing\n @param thawingPeriod The period in seconds that the tokens will be thawing before they can be removed from the provision" + }, + "functionSelector": "010167e5", + "id": 3689, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "provision", + "nameLocation": "25390:9:31", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3687, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3678, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "25417:15:31", + "nodeType": "VariableDeclaration", + "scope": 3689, + "src": "25409:23:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3677, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "25409:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3680, + "mutability": "mutable", + "name": "verifier", + "nameLocation": "25450:8:31", + "nodeType": "VariableDeclaration", + "scope": 3689, + "src": "25442:16:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3679, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "25442:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3682, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "25476:6:31", + "nodeType": "VariableDeclaration", + "scope": 3689, + "src": "25468:14:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3681, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "25468:7:31", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3684, + "mutability": "mutable", + "name": "maxVerifierCut", + "nameLocation": "25499:14:31", + "nodeType": "VariableDeclaration", + "scope": 3689, + "src": "25492:21:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 3683, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "25492:6:31", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3686, + "mutability": "mutable", + "name": "thawingPeriod", + "nameLocation": "25530:13:31", + "nodeType": "VariableDeclaration", + "scope": 3689, + "src": "25523:20:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + }, + "typeName": { + "id": 3685, + "name": "uint64", + "nodeType": "ElementaryTypeName", + "src": "25523:6:31", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "visibility": "internal" + } + ], + "src": "25399:150:31" + }, + "returnParameters": { + "id": 3688, + "nodeType": "ParameterList", + "parameters": [], + "src": "25558:0:31" + }, + "scope": 3937, + "src": "25381:178:31", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 3690, + "nodeType": "StructuredDocumentation", + "src": "25565:564:31", + "text": " @notice Adds tokens from the service provider's idle stake to a provision\n @dev\n Requirements:\n - The `serviceProvider` must have previously provisioned stake to `verifier`.\n - `tokens` cannot be zero.\n - The `serviceProvider` must have enough idle stake to cover the tokens to add.\n Emits a {ProvisionIncreased} event.\n @param serviceProvider The service provider address\n @param verifier The verifier address\n @param tokens The amount of tokens to add to the provision" + }, + "functionSelector": "fecc9cc1", + "id": 3699, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "addToProvision", + "nameLocation": "26143:14:31", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3697, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3692, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "26166:15:31", + "nodeType": "VariableDeclaration", + "scope": 3699, + "src": "26158:23:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3691, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "26158:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3694, + "mutability": "mutable", + "name": "verifier", + "nameLocation": "26191:8:31", + "nodeType": "VariableDeclaration", + "scope": 3699, + "src": "26183:16:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3693, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "26183:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3696, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "26209:6:31", + "nodeType": "VariableDeclaration", + "scope": 3699, + "src": "26201:14:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3695, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "26201:7:31", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "26157:59:31" + }, + "returnParameters": { + "id": 3698, + "nodeType": "ParameterList", + "parameters": [], + "src": "26225:0:31" + }, + "scope": 3937, + "src": "26134:92:31", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 3700, + "nodeType": "StructuredDocumentation", + "src": "26232:929:31", + "text": " @notice Start thawing tokens to remove them from a provision.\n This function can be called by the service provider or by an operator authorized by the provider\n for this specific verifier.\n Note that removing tokens from a provision is a two step process:\n - First the tokens are thawed using this function.\n - Then after the thawing period, the tokens are removed from the provision using {deprovision}\n or {reprovision}.\n @dev Requirements:\n - The provision must have enough tokens available to thaw.\n - `tokens` cannot be zero.\n Emits {ProvisionThawed} and {ThawRequestCreated} events.\n @param serviceProvider The service provider address\n @param verifier The verifier address for which the tokens are provisioned\n @param tokens The amount of tokens to thaw\n @return The ID of the thaw request" + }, + "functionSelector": "f93f1cd0", + "id": 3711, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "thaw", + "nameLocation": "27175:4:31", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3707, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3702, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "27188:15:31", + "nodeType": "VariableDeclaration", + "scope": 3711, + "src": "27180:23:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3701, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "27180:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3704, + "mutability": "mutable", + "name": "verifier", + "nameLocation": "27213:8:31", + "nodeType": "VariableDeclaration", + "scope": 3711, + "src": "27205:16:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3703, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "27205:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3706, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "27231:6:31", + "nodeType": "VariableDeclaration", + "scope": 3711, + "src": "27223:14:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3705, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "27223:7:31", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "27179:59:31" + }, + "returnParameters": { + "id": 3710, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3709, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 3711, + "src": "27257:7:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 3708, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "27257:7:31", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "27256:9:31" + }, + "scope": 3937, + "src": "27166:100:31", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 3712, + "nodeType": "StructuredDocumentation", + "src": "27272:854:31", + "text": " @notice Remove tokens from a provision and move them back to the service provider's idle stake.\n @dev The parameter `nThawRequests` can be set to a non zero value to fulfill a specific number of thaw\n requests in the event that fulfilling all of them results in a gas limit error. Otherwise, the function\n will attempt to fulfill all thaw requests until the first one that is not yet expired is found.\n Requirements:\n - Must have previously initiated a thaw request using {thaw}.\n Emits {ThawRequestFulfilled}, {ThawRequestsFulfilled} and {TokensDeprovisioned} events.\n @param serviceProvider The service provider address\n @param verifier The verifier address\n @param nThawRequests The number of thaw requests to fulfill. Set to 0 to fulfill all thaw requests." + }, + "functionSelector": "21195373", + "id": 3721, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "deprovision", + "nameLocation": "28140:11:31", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3719, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3714, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "28160:15:31", + "nodeType": "VariableDeclaration", + "scope": 3721, + "src": "28152:23:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3713, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "28152:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3716, + "mutability": "mutable", + "name": "verifier", + "nameLocation": "28185:8:31", + "nodeType": "VariableDeclaration", + "scope": 3721, + "src": "28177:16:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3715, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "28177:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3718, + "mutability": "mutable", + "name": "nThawRequests", + "nameLocation": "28203:13:31", + "nodeType": "VariableDeclaration", + "scope": 3721, + "src": "28195:21:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3717, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "28195:7:31", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "28151:66:31" + }, + "returnParameters": { + "id": 3720, + "nodeType": "ParameterList", + "parameters": [], + "src": "28226:0:31" + }, + "scope": 3937, + "src": "28131:96:31", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 3722, + "nodeType": "StructuredDocumentation", + "src": "28233:1032:31", + "text": " @notice Move already thawed stake from one provision into another provision\n This function can be called by the service provider or by an operator authorized by the provider\n for the two corresponding verifiers.\n @dev Requirements:\n - Must have previously initiated a thaw request using {thaw}.\n - `tokens` cannot be zero.\n - The `serviceProvider` must have previously provisioned stake to `newVerifier`.\n - The `serviceProvider` must have enough idle stake to cover the tokens to add.\n Emits {ThawRequestFulfilled}, {ThawRequestsFulfilled}, {TokensDeprovisioned} and {ProvisionIncreased}\n events.\n @param serviceProvider The service provider address\n @param oldVerifier The verifier address for which the tokens are currently provisioned\n @param newVerifier The verifier address for which the tokens will be provisioned\n @param nThawRequests The number of thaw requests to fulfill. Set to 0 to fulfill all thaw requests." + }, + "functionSelector": "ba7fb0b4", + "id": 3733, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "reprovision", + "nameLocation": "29279:11:31", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3731, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3724, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "29308:15:31", + "nodeType": "VariableDeclaration", + "scope": 3733, + "src": "29300:23:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3723, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "29300:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3726, + "mutability": "mutable", + "name": "oldVerifier", + "nameLocation": "29341:11:31", + "nodeType": "VariableDeclaration", + "scope": 3733, + "src": "29333:19:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3725, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "29333:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3728, + "mutability": "mutable", + "name": "newVerifier", + "nameLocation": "29370:11:31", + "nodeType": "VariableDeclaration", + "scope": 3733, + "src": "29362:19:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3727, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "29362:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3730, + "mutability": "mutable", + "name": "nThawRequests", + "nameLocation": "29399:13:31", + "nodeType": "VariableDeclaration", + "scope": 3733, + "src": "29391:21:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3729, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "29391:7:31", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "29290:128:31" + }, + "returnParameters": { + "id": 3732, + "nodeType": "ParameterList", + "parameters": [], + "src": "29427:0:31" + }, + "scope": 3937, + "src": "29270:158:31", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 3734, + "nodeType": "StructuredDocumentation", + "src": "29434:1146:31", + "text": " @notice Stages a provision parameter update. Note that the change is not effective until the verifier calls\n {acceptProvisionParameters}. Calling this function is a no-op if the new parameters are the same as the current\n ones.\n @dev This two step update process prevents the service provider from changing the parameters\n without the verifier's consent.\n Requirements:\n - `thawingPeriod` must be less than or equal to `_maxThawingPeriod`. Note that if `_maxThawingPeriod` changes the\n function will not revert if called with the same thawing period as the current one.\n Emits a {ProvisionParametersStaged} event if at least one of the parameters changed.\n @param serviceProvider The service provider address\n @param verifier The verifier address\n @param maxVerifierCut The proposed maximum cut, expressed in PPM of the slashed amount, that a verifier can take for\n themselves when slashing\n @param thawingPeriod The proposed period in seconds that the tokens will be thawing before they can be removed from\n the provision" + }, + "functionSelector": "81e21b56", + "id": 3745, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "setProvisionParameters", + "nameLocation": "30594:22:31", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3743, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3736, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "30634:15:31", + "nodeType": "VariableDeclaration", + "scope": 3745, + "src": "30626:23:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3735, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "30626:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3738, + "mutability": "mutable", + "name": "verifier", + "nameLocation": "30667:8:31", + "nodeType": "VariableDeclaration", + "scope": 3745, + "src": "30659:16:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3737, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "30659:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3740, + "mutability": "mutable", + "name": "maxVerifierCut", + "nameLocation": "30692:14:31", + "nodeType": "VariableDeclaration", + "scope": 3745, + "src": "30685:21:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 3739, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "30685:6:31", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3742, + "mutability": "mutable", + "name": "thawingPeriod", + "nameLocation": "30723:13:31", + "nodeType": "VariableDeclaration", + "scope": 3745, + "src": "30716:20:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + }, + "typeName": { + "id": 3741, + "name": "uint64", + "nodeType": "ElementaryTypeName", + "src": "30716:6:31", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "visibility": "internal" + } + ], + "src": "30616:126:31" + }, + "returnParameters": { + "id": 3744, + "nodeType": "ParameterList", + "parameters": [], + "src": "30751:0:31" + }, + "scope": 3937, + "src": "30585:167:31", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 3746, + "nodeType": "StructuredDocumentation", + "src": "30758:257:31", + "text": " @notice Accepts a staged provision parameter update.\n @dev Only the provision's verifier can call this function.\n Emits a {ProvisionParametersSet} event.\n @param serviceProvider The service provider address" + }, + "functionSelector": "3a78b732", + "id": 3751, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "acceptProvisionParameters", + "nameLocation": "31029:25:31", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3749, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3748, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "31063:15:31", + "nodeType": "VariableDeclaration", + "scope": 3751, + "src": "31055:23:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3747, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "31055:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "31054:25:31" + }, + "returnParameters": { + "id": 3750, + "nodeType": "ParameterList", + "parameters": [], + "src": "31088:0:31" + }, + "scope": 3937, + "src": "31020:69:31", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 3752, + "nodeType": "StructuredDocumentation", + "src": "31095:547:31", + "text": " @notice Delegate tokens to a provision.\n @dev Requirements:\n - `tokens` cannot be zero.\n - Caller must have previously approved this contract to pull tokens from their balance.\n - The provision must exist.\n Emits a {TokensDelegated} event.\n @param serviceProvider The service provider address\n @param verifier The verifier address\n @param tokens The amount of tokens to delegate\n @param minSharesOut The minimum amount of shares to accept, slippage protection." + }, + "functionSelector": "6230001a", + "id": 3763, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "delegate", + "nameLocation": "31656:8:31", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3761, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3754, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "31673:15:31", + "nodeType": "VariableDeclaration", + "scope": 3763, + "src": "31665:23:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3753, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "31665:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3756, + "mutability": "mutable", + "name": "verifier", + "nameLocation": "31698:8:31", + "nodeType": "VariableDeclaration", + "scope": 3763, + "src": "31690:16:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3755, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "31690:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3758, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "31716:6:31", + "nodeType": "VariableDeclaration", + "scope": 3763, + "src": "31708:14:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3757, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "31708:7:31", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3760, + "mutability": "mutable", + "name": "minSharesOut", + "nameLocation": "31732:12:31", + "nodeType": "VariableDeclaration", + "scope": 3763, + "src": "31724:20:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3759, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "31724:7:31", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "31664:81:31" + }, + "returnParameters": { + "id": 3762, + "nodeType": "ParameterList", + "parameters": [], + "src": "31754:0:31" + }, + "scope": 3937, + "src": "31647:108:31", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 3764, + "nodeType": "StructuredDocumentation", + "src": "31761:632:31", + "text": " @notice Add tokens to a delegation pool without issuing shares.\n Used by data services to pay delegation fees/rewards.\n Delegators SHOULD NOT call this function.\n @dev Requirements:\n - `tokens` cannot be zero.\n - Caller must have previously approved this contract to pull tokens from their balance.\n Emits a {TokensToDelegationPoolAdded} event.\n @param serviceProvider The service provider address\n @param verifier The verifier address for which the tokens are provisioned\n @param tokens The amount of tokens to add to the delegation pool" + }, + "functionSelector": "ca94b0e9", + "id": 3773, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "addToDelegationPool", + "nameLocation": "32407:19:31", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3771, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3766, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "32435:15:31", + "nodeType": "VariableDeclaration", + "scope": 3773, + "src": "32427:23:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3765, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "32427:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3768, + "mutability": "mutable", + "name": "verifier", + "nameLocation": "32460:8:31", + "nodeType": "VariableDeclaration", + "scope": 3773, + "src": "32452:16:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3767, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "32452:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3770, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "32478:6:31", + "nodeType": "VariableDeclaration", + "scope": 3773, + "src": "32470:14:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3769, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "32470:7:31", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "32426:59:31" + }, + "returnParameters": { + "id": 3772, + "nodeType": "ParameterList", + "parameters": [], + "src": "32494:0:31" + }, + "scope": 3937, + "src": "32398:97:31", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 3774, + "nodeType": "StructuredDocumentation", + "src": "32501:673:31", + "text": " @notice Undelegate tokens from a provision and start thawing them.\n Note that undelegating tokens from a provision is a two step process:\n - First the tokens are thawed using this function.\n - Then after the thawing period, the tokens are removed from the provision using {withdrawDelegated}.\n Requirements:\n - `shares` cannot be zero.\n Emits a {TokensUndelegated} and {ThawRequestCreated} event.\n @param serviceProvider The service provider address\n @param verifier The verifier address\n @param shares The amount of shares to undelegate\n @return The ID of the thaw request" + }, + "functionSelector": "a02b9426", + "id": 3785, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "undelegate", + "nameLocation": "33188:10:31", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3781, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3776, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "33207:15:31", + "nodeType": "VariableDeclaration", + "scope": 3785, + "src": "33199:23:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3775, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "33199:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3778, + "mutability": "mutable", + "name": "verifier", + "nameLocation": "33232:8:31", + "nodeType": "VariableDeclaration", + "scope": 3785, + "src": "33224:16:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3777, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "33224:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3780, + "mutability": "mutable", + "name": "shares", + "nameLocation": "33250:6:31", + "nodeType": "VariableDeclaration", + "scope": 3785, + "src": "33242:14:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3779, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "33242:7:31", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "33198:59:31" + }, + "returnParameters": { + "id": 3784, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3783, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 3785, + "src": "33276:7:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 3782, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "33276:7:31", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "33275:9:31" + }, + "scope": 3937, + "src": "33179:106:31", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 3786, + "nodeType": "StructuredDocumentation", + "src": "33291:1005:31", + "text": " @notice Withdraw undelegated tokens from a provision after thawing.\n @dev The parameter `nThawRequests` can be set to a non zero value to fulfill a specific number of thaw\n requests in the event that fulfilling all of them results in a gas limit error. Otherwise, the function\n will attempt to fulfill all thaw requests until the first one that is not yet expired is found.\n @dev If the delegation pool was completely slashed before withdrawing, calling this function will fulfill\n the thaw requests with an amount equal to zero.\n Requirements:\n - Must have previously initiated a thaw request using {undelegate}.\n Emits {ThawRequestFulfilled}, {ThawRequestsFulfilled} and {DelegatedTokensWithdrawn} events.\n @param serviceProvider The service provider address\n @param verifier The verifier address\n @param nThawRequests The number of thaw requests to fulfill. Set to 0 to fulfill all thaw requests." + }, + "functionSelector": "3993d849", + "id": 3795, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "withdrawDelegated", + "nameLocation": "34310:17:31", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3793, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3788, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "34336:15:31", + "nodeType": "VariableDeclaration", + "scope": 3795, + "src": "34328:23:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3787, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "34328:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3790, + "mutability": "mutable", + "name": "verifier", + "nameLocation": "34361:8:31", + "nodeType": "VariableDeclaration", + "scope": 3795, + "src": "34353:16:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3789, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "34353:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3792, + "mutability": "mutable", + "name": "nThawRequests", + "nameLocation": "34379:13:31", + "nodeType": "VariableDeclaration", + "scope": 3795, + "src": "34371:21:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3791, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "34371:7:31", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "34327:66:31" + }, + "returnParameters": { + "id": 3794, + "nodeType": "ParameterList", + "parameters": [], + "src": "34402:0:31" + }, + "scope": 3937, + "src": "34301:102:31", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 3796, + "nodeType": "StructuredDocumentation", + "src": "34409:1169:31", + "text": " @notice Re-delegate undelegated tokens from a provision after thawing to a `newServiceProvider` and `newVerifier`.\n @dev The parameter `nThawRequests` can be set to a non zero value to fulfill a specific number of thaw\n requests in the event that fulfilling all of them results in a gas limit error.\n Requirements:\n - Must have previously initiated a thaw request using {undelegate}.\n - `newServiceProvider` and `newVerifier` must not be the zero address.\n - `newServiceProvider` must have previously provisioned stake to `newVerifier`.\n Emits {ThawRequestFulfilled}, {ThawRequestsFulfilled} and {DelegatedTokensWithdrawn} events.\n @param oldServiceProvider The old service provider address\n @param oldVerifier The old verifier address\n @param newServiceProvider The address of a new service provider\n @param newVerifier The address of a new verifier\n @param minSharesForNewProvider The minimum amount of shares to accept for the new service provider\n @param nThawRequests The number of thaw requests to fulfill. Set to 0 to fulfill all thaw requests." + }, + "functionSelector": "f64b3598", + "id": 3811, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "redelegate", + "nameLocation": "35592:10:31", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3809, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3798, + "mutability": "mutable", + "name": "oldServiceProvider", + "nameLocation": "35620:18:31", + "nodeType": "VariableDeclaration", + "scope": 3811, + "src": "35612:26:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3797, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "35612:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3800, + "mutability": "mutable", + "name": "oldVerifier", + "nameLocation": "35656:11:31", + "nodeType": "VariableDeclaration", + "scope": 3811, + "src": "35648:19:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3799, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "35648:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3802, + "mutability": "mutable", + "name": "newServiceProvider", + "nameLocation": "35685:18:31", + "nodeType": "VariableDeclaration", + "scope": 3811, + "src": "35677:26:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3801, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "35677:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3804, + "mutability": "mutable", + "name": "newVerifier", + "nameLocation": "35721:11:31", + "nodeType": "VariableDeclaration", + "scope": 3811, + "src": "35713:19:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3803, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "35713:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3806, + "mutability": "mutable", + "name": "minSharesForNewProvider", + "nameLocation": "35750:23:31", + "nodeType": "VariableDeclaration", + "scope": 3811, + "src": "35742:31:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3805, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "35742:7:31", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3808, + "mutability": "mutable", + "name": "nThawRequests", + "nameLocation": "35791:13:31", + "nodeType": "VariableDeclaration", + "scope": 3811, + "src": "35783:21:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3807, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "35783:7:31", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "35602:208:31" + }, + "returnParameters": { + "id": 3810, + "nodeType": "ParameterList", + "parameters": [], + "src": "35819:0:31" + }, + "scope": 3937, + "src": "35583:237:31", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 3812, + "nodeType": "StructuredDocumentation", + "src": "35826:389:31", + "text": " @notice Set the fee cut for a verifier on a specific payment type.\n @dev Emits a {DelegationFeeCutSet} event.\n @param serviceProvider The service provider address\n @param verifier The verifier address\n @param paymentType The payment type for which the fee cut is set, as defined in {IGraphPayments}\n @param feeCut The fee cut to set, in PPM" + }, + "functionSelector": "42c51693", + "id": 3824, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "setDelegationFeeCut", + "nameLocation": "36229:19:31", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3822, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3814, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "36266:15:31", + "nodeType": "VariableDeclaration", + "scope": 3824, + "src": "36258:23:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3813, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "36258:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3816, + "mutability": "mutable", + "name": "verifier", + "nameLocation": "36299:8:31", + "nodeType": "VariableDeclaration", + "scope": 3824, + "src": "36291:16:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3815, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "36291:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3819, + "mutability": "mutable", + "name": "paymentType", + "nameLocation": "36345:11:31", + "nodeType": "VariableDeclaration", + "scope": 3824, + "src": "36317:39:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_PaymentTypes_$2433", + "typeString": "enum IGraphPayments.PaymentTypes" + }, + "typeName": { + "id": 3818, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 3817, + "name": "IGraphPayments.PaymentTypes", + "nameLocations": [ + "36317:14:31", + "36332:12:31" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 2433, + "src": "36317:27:31" + }, + "referencedDeclaration": 2433, + "src": "36317:27:31", + "typeDescriptions": { + "typeIdentifier": "t_enum$_PaymentTypes_$2433", + "typeString": "enum IGraphPayments.PaymentTypes" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3821, + "mutability": "mutable", + "name": "feeCut", + "nameLocation": "36374:6:31", + "nodeType": "VariableDeclaration", + "scope": 3824, + "src": "36366:14:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3820, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "36366:7:31", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "36248:138:31" + }, + "returnParameters": { + "id": 3823, + "nodeType": "ParameterList", + "parameters": [], + "src": "36395:0:31" + }, + "scope": 3937, + "src": "36220:176:31", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 3825, + "nodeType": "StructuredDocumentation", + "src": "36402:410:31", + "text": " @notice Delegate tokens to the subgraph data service provision.\n This function is for backwards compatibility with the legacy staking contract.\n It only allows delegating to the subgraph data service and DOES NOT have slippage protection.\n @dev See {delegate}.\n @param serviceProvider The service provider address\n @param tokens The amount of tokens to delegate" + }, + "functionSelector": "026e402b", + "id": 3832, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "delegate", + "nameLocation": "36826:8:31", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3830, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3827, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "36843:15:31", + "nodeType": "VariableDeclaration", + "scope": 3832, + "src": "36835:23:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3826, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "36835:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3829, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "36868:6:31", + "nodeType": "VariableDeclaration", + "scope": 3832, + "src": "36860:14:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3828, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "36860:7:31", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "36834:41:31" + }, + "returnParameters": { + "id": 3831, + "nodeType": "ParameterList", + "parameters": [], + "src": "36884:0:31" + }, + "scope": 3937, + "src": "36817:68:31", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 3833, + "nodeType": "StructuredDocumentation", + "src": "36891:407:31", + "text": " @notice Undelegate tokens from the subgraph data service provision and start thawing them.\n This function is for backwards compatibility with the legacy staking contract.\n It only allows undelegating from the subgraph data service.\n @dev See {undelegate}.\n @param serviceProvider The service provider address\n @param shares The amount of shares to undelegate" + }, + "functionSelector": "4d99dd16", + "id": 3840, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "undelegate", + "nameLocation": "37312:10:31", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3838, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3835, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "37331:15:31", + "nodeType": "VariableDeclaration", + "scope": 3840, + "src": "37323:23:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3834, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "37323:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3837, + "mutability": "mutable", + "name": "shares", + "nameLocation": "37356:6:31", + "nodeType": "VariableDeclaration", + "scope": 3840, + "src": "37348:14:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3836, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "37348:7:31", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "37322:41:31" + }, + "returnParameters": { + "id": 3839, + "nodeType": "ParameterList", + "parameters": [], + "src": "37372:0:31" + }, + "scope": 3937, + "src": "37303:70:31", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 3841, + "nodeType": "StructuredDocumentation", + "src": "37379:485:31", + "text": " @notice Withdraw undelegated tokens from the subgraph data service provision after thawing.\n This function is for backwards compatibility with the legacy staking contract.\n It only allows withdrawing tokens undelegated before horizon upgrade.\n @dev See {delegate}.\n @param serviceProvider The service provider address\n @param deprecated Deprecated parameter kept for backwards compatibility\n @return The amount of tokens withdrawn" + }, + "functionSelector": "51a60b02", + "id": 3850, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "withdrawDelegated", + "nameLocation": "37878:17:31", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3846, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3843, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "37913:15:31", + "nodeType": "VariableDeclaration", + "scope": 3850, + "src": "37905:23:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3842, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "37905:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3845, + "mutability": "mutable", + "name": "deprecated", + "nameLocation": "37946:10:31", + "nodeType": "VariableDeclaration", + "scope": 3850, + "src": "37938:18:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3844, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "37938:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "37895:103:31" + }, + "returnParameters": { + "id": 3849, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3848, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 3850, + "src": "38017:7:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3847, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "38017:7:31", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "38016:9:31" + }, + "scope": 3937, + "src": "37869:157:31", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 3851, + "nodeType": "StructuredDocumentation", + "src": "38032:1190:31", + "text": " @notice Slash a service provider. This can only be called by a verifier to which\n the provider has provisioned stake, and up to the amount of tokens they have provisioned.\n If the service provider's stake is not enough, the associated delegation pool might be slashed\n depending on the value of the global delegation slashing flag.\n Part of the slashed tokens are sent to the `verifierDestination` as a reward.\n @dev Requirements:\n - `tokens` must be less than or equal to the amount of tokens provisioned by the service provider.\n - `tokensVerifier` must be less than the provision's tokens times the provision's maximum verifier cut.\n Emits a {ProvisionSlashed} and {VerifierTokensSent} events.\n Emits a {DelegationSlashed} or {DelegationSlashingSkipped} event depending on the global delegation slashing\n flag.\n @param serviceProvider The service provider to slash\n @param tokens The amount of tokens to slash\n @param tokensVerifier The amount of tokens to transfer instead of burning\n @param verifierDestination The address to transfer the verifier cut to" + }, + "functionSelector": "e76fede6", + "id": 3862, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "slash", + "nameLocation": "39236:5:31", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3860, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3853, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "39259:15:31", + "nodeType": "VariableDeclaration", + "scope": 3862, + "src": "39251:23:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3852, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "39251:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3855, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "39292:6:31", + "nodeType": "VariableDeclaration", + "scope": 3862, + "src": "39284:14:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3854, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "39284:7:31", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3857, + "mutability": "mutable", + "name": "tokensVerifier", + "nameLocation": "39316:14:31", + "nodeType": "VariableDeclaration", + "scope": 3862, + "src": "39308:22:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3856, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "39308:7:31", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3859, + "mutability": "mutable", + "name": "verifierDestination", + "nameLocation": "39348:19:31", + "nodeType": "VariableDeclaration", + "scope": 3862, + "src": "39340:27:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3858, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "39340:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "39241:132:31" + }, + "returnParameters": { + "id": 3861, + "nodeType": "ParameterList", + "parameters": [], + "src": "39382:0:31" + }, + "scope": 3937, + "src": "39227:156:31", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 3863, + "nodeType": "StructuredDocumentation", + "src": "39389:769:31", + "text": " @notice Provision stake to a verifier using locked tokens (i.e. from GraphTokenLockWallets).\n @dev See {provision}.\n Additional requirements:\n - The `verifier` must be allowed to be used for locked provisions.\n @param serviceProvider The service provider address\n @param verifier The verifier address for which the tokens are provisioned (who will be able to slash the tokens)\n @param tokens The amount of tokens that will be locked and slashable\n @param maxVerifierCut The maximum cut, expressed in PPM, that a verifier can transfer instead of burning when slashing\n @param thawingPeriod The period in seconds that the tokens will be thawing before they can be removed from the provision" + }, + "functionSelector": "82d66cb8", + "id": 3876, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "provisionLocked", + "nameLocation": "40172:15:31", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3874, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3865, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "40205:15:31", + "nodeType": "VariableDeclaration", + "scope": 3876, + "src": "40197:23:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3864, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "40197:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3867, + "mutability": "mutable", + "name": "verifier", + "nameLocation": "40238:8:31", + "nodeType": "VariableDeclaration", + "scope": 3876, + "src": "40230:16:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3866, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "40230:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3869, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "40264:6:31", + "nodeType": "VariableDeclaration", + "scope": 3876, + "src": "40256:14:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3868, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "40256:7:31", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3871, + "mutability": "mutable", + "name": "maxVerifierCut", + "nameLocation": "40287:14:31", + "nodeType": "VariableDeclaration", + "scope": 3876, + "src": "40280:21:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 3870, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "40280:6:31", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3873, + "mutability": "mutable", + "name": "thawingPeriod", + "nameLocation": "40318:13:31", + "nodeType": "VariableDeclaration", + "scope": 3876, + "src": "40311:20:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + }, + "typeName": { + "id": 3872, + "name": "uint64", + "nodeType": "ElementaryTypeName", + "src": "40311:6:31", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "visibility": "internal" + } + ], + "src": "40187:150:31" + }, + "returnParameters": { + "id": 3875, + "nodeType": "ParameterList", + "parameters": [], + "src": "40346:0:31" + }, + "scope": 3937, + "src": "40163:184:31", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 3877, + "nodeType": "StructuredDocumentation", + "src": "40353:474:31", + "text": " @notice Authorize or unauthorize an address to be an operator for the caller on a verifier.\n @dev See {setOperator}.\n Additional requirements:\n - The `verifier` must be allowed to be used for locked provisions.\n @param verifier The verifier / data service on which they'll be allowed to operate\n @param operator Address to authorize or unauthorize\n @param allowed Whether the operator is authorized or not" + }, + "functionSelector": "ad4d35b5", + "id": 3886, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "setOperatorLocked", + "nameLocation": "40841:17:31", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3884, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3879, + "mutability": "mutable", + "name": "verifier", + "nameLocation": "40867:8:31", + "nodeType": "VariableDeclaration", + "scope": 3886, + "src": "40859:16:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3878, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "40859:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3881, + "mutability": "mutable", + "name": "operator", + "nameLocation": "40885:8:31", + "nodeType": "VariableDeclaration", + "scope": 3886, + "src": "40877:16:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3880, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "40877:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3883, + "mutability": "mutable", + "name": "allowed", + "nameLocation": "40900:7:31", + "nodeType": "VariableDeclaration", + "scope": 3886, + "src": "40895:12:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 3882, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "40895:4:31", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "src": "40858:50:31" + }, + "returnParameters": { + "id": 3885, + "nodeType": "ParameterList", + "parameters": [], + "src": "40917:0:31" + }, + "scope": 3937, + "src": "40832:86:31", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 3887, + "nodeType": "StructuredDocumentation", + "src": "40924:449:31", + "text": " @notice Sets a verifier as a globally allowed verifier for locked provisions.\n @dev This function can only be called by the contract governor, it's used to maintain\n a whitelist of verifiers that do not allow the stake from a locked wallet to escape the lock.\n @dev Emits a {AllowedLockedVerifierSet} event.\n @param verifier The verifier address\n @param allowed Whether the verifier is allowed or not" + }, + "functionSelector": "4ca7ac22", + "id": 3894, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "setAllowedLockedVerifier", + "nameLocation": "41387:24:31", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3892, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3889, + "mutability": "mutable", + "name": "verifier", + "nameLocation": "41420:8:31", + "nodeType": "VariableDeclaration", + "scope": 3894, + "src": "41412:16:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3888, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "41412:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3891, + "mutability": "mutable", + "name": "allowed", + "nameLocation": "41435:7:31", + "nodeType": "VariableDeclaration", + "scope": 3894, + "src": "41430:12:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 3890, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "41430:4:31", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "src": "41411:32:31" + }, + "returnParameters": { + "id": 3893, + "nodeType": "ParameterList", + "parameters": [], + "src": "41452:0:31" + }, + "scope": 3937, + "src": "41378:75:31", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 3895, + "nodeType": "StructuredDocumentation", + "src": "41459:146:31", + "text": " @notice Set the global delegation slashing flag to true.\n @dev This function can only be called by the contract governor." + }, + "functionSelector": "ef58bd67", + "id": 3898, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "setDelegationSlashingEnabled", + "nameLocation": "41619:28:31", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3896, + "nodeType": "ParameterList", + "parameters": [], + "src": "41647:2:31" + }, + "returnParameters": { + "id": 3897, + "nodeType": "ParameterList", + "parameters": [], + "src": "41658:0:31" + }, + "scope": 3937, + "src": "41610:49:31", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 3899, + "nodeType": "StructuredDocumentation", + "src": "41665:293:31", + "text": " @notice Clear the legacy global thawing period.\n This signifies the end of the transition period, after which no legacy allocations should be left.\n @dev This function can only be called by the contract governor.\n @dev Emits a {ThawingPeriodCleared} event." + }, + "functionSelector": "e473522a", + "id": 3902, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "clearThawingPeriod", + "nameLocation": "41972:18:31", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3900, + "nodeType": "ParameterList", + "parameters": [], + "src": "41990:2:31" + }, + "returnParameters": { + "id": 3901, + "nodeType": "ParameterList", + "parameters": [], + "src": "42001:0:31" + }, + "scope": 3937, + "src": "41963:39:31", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 3903, + "nodeType": "StructuredDocumentation", + "src": "42008:163:31", + "text": " @notice Sets the global maximum thawing period allowed for provisions.\n @param maxThawingPeriod The new maximum thawing period, in seconds" + }, + "functionSelector": "259bc435", + "id": 3908, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "setMaxThawingPeriod", + "nameLocation": "42185:19:31", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3906, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3905, + "mutability": "mutable", + "name": "maxThawingPeriod", + "nameLocation": "42212:16:31", + "nodeType": "VariableDeclaration", + "scope": 3908, + "src": "42205:23:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + }, + "typeName": { + "id": 3904, + "name": "uint64", + "nodeType": "ElementaryTypeName", + "src": "42205:6:31", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "visibility": "internal" + } + ], + "src": "42204:25:31" + }, + "returnParameters": { + "id": 3907, + "nodeType": "ParameterList", + "parameters": [], + "src": "42238:0:31" + }, + "scope": 3937, + "src": "42176:63:31", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 3909, + "nodeType": "StructuredDocumentation", + "src": "42245:368:31", + "text": " @notice Authorize or unauthorize an address to be an operator for the caller on a data service.\n @dev Emits a {OperatorSet} event.\n @param verifier The verifier / data service on which they'll be allowed to operate\n @param operator Address to authorize or unauthorize\n @param allowed Whether the operator is authorized or not" + }, + "functionSelector": "bc735d90", + "id": 3918, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "setOperator", + "nameLocation": "42627:11:31", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3916, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3911, + "mutability": "mutable", + "name": "verifier", + "nameLocation": "42647:8:31", + "nodeType": "VariableDeclaration", + "scope": 3918, + "src": "42639:16:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3910, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "42639:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3913, + "mutability": "mutable", + "name": "operator", + "nameLocation": "42665:8:31", + "nodeType": "VariableDeclaration", + "scope": 3918, + "src": "42657:16:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3912, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "42657:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3915, + "mutability": "mutable", + "name": "allowed", + "nameLocation": "42680:7:31", + "nodeType": "VariableDeclaration", + "scope": 3918, + "src": "42675:12:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 3914, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "42675:4:31", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "src": "42638:50:31" + }, + "returnParameters": { + "id": 3917, + "nodeType": "ParameterList", + "parameters": [], + "src": "42697:0:31" + }, + "scope": 3937, + "src": "42618:80:31", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 3919, + "nodeType": "StructuredDocumentation", + "src": "42704:402:31", + "text": " @notice Check if an operator is authorized for the caller on a specific verifier / data service.\n @param serviceProvider The service provider on behalf of whom they're claiming to act\n @param verifier The verifier / data service on which they're claiming to act\n @param operator The address to check for auth\n @return Whether the operator is authorized or not" + }, + "functionSelector": "7c145cc7", + "id": 3930, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "isAuthorized", + "nameLocation": "43120:12:31", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3926, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3921, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "43141:15:31", + "nodeType": "VariableDeclaration", + "scope": 3930, + "src": "43133:23:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3920, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "43133:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3923, + "mutability": "mutable", + "name": "verifier", + "nameLocation": "43166:8:31", + "nodeType": "VariableDeclaration", + "scope": 3930, + "src": "43158:16:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3922, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "43158:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3925, + "mutability": "mutable", + "name": "operator", + "nameLocation": "43184:8:31", + "nodeType": "VariableDeclaration", + "scope": 3930, + "src": "43176:16:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3924, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "43176:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "43132:61:31" + }, + "returnParameters": { + "id": 3929, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3928, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 3930, + "src": "43217:4:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 3927, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "43217:4:31", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "src": "43216:6:31" + }, + "scope": 3937, + "src": "43111:112:31", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 3931, + "nodeType": "StructuredDocumentation", + "src": "43229:120:31", + "text": " @notice Get the address of the staking extension.\n @return The address of the staking extension" + }, + "functionSelector": "66ee1b28", + "id": 3936, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "getStakingExtension", + "nameLocation": "43363:19:31", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3932, + "nodeType": "ParameterList", + "parameters": [], + "src": "43382:2:31" + }, + "returnParameters": { + "id": 3935, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3934, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 3936, + "src": "43408:7:31", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3933, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "43408:7:31", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "43407:9:31" + }, + "scope": 3937, + "src": "43354:63:31", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + } + ], + "scope": 3938, + "src": "1032:42387:31", + "usedErrors": [ + 3500, + 3507, + 3514, + 3521, + 3530, + 3535, + 3540, + 3547, + 3550, + 3557, + 3564, + 3571, + 3574, + 3581, + 3588, + 3595, + 3602, + 3605, + 3608, + 3611, + 3614, + 3617, + 3622, + 3627, + 3630, + 3635, + 3638, + 3641 + ], + "usedEvents": [ + 3242, + 3249, + 3262, + 3271, + 3280, + 3289, + 3300, + 3311, + 3322, + 3331, + 3340, + 3349, + 3360, + 3373, + 3386, + 3397, + 3406, + 3415, + 3427, + 3447, + 3463, + 3479, + 3484, + 3491, + 3494, + 3497 + ] + } + ], + "src": "46:43374:31" + }, + "id": 31 + }, + "@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingTypes.sol": { + "ast": { + "absolutePath": "@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingTypes.sol", + "exportedSymbols": { + "IHorizonStakingTypes": [ + 4073 + ] + }, + "id": 4074, + "license": "GPL-2.0-or-later", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 3939, + "literals": [ + "solidity", + "0.8", + ".27" + ], + "nodeType": "PragmaDirective", + "src": "46:23:32" + }, + { + "abstract": false, + "baseContracts": [], + "canonicalName": "IHorizonStakingTypes", + "contractDependencies": [], + "contractKind": "interface", + "documentation": { + "id": 3940, + "nodeType": "StructuredDocumentation", + "src": "71:552:32", + "text": " @title Defines the data types used in the Horizon staking contract\n @dev In order to preserve storage compatibility some data structures keep deprecated fields.\n These structures have then two representations, an internal one used by the contract storage and a public one.\n Getter functions should retrieve internal representations, remove deprecated fields and return the public representation.\n @custom:security-contact Please email security+contracts@thegraph.com if you find any\n bugs. We may have an active bug bounty program." + }, + "fullyImplemented": true, + "id": 4073, + "linearizedBaseContracts": [ + 4073 + ], + "name": "IHorizonStakingTypes", + "nameLocation": "634:20:32", + "nodeType": "ContractDefinition", + "nodes": [ + { + "canonicalName": "IHorizonStakingTypes.Provision", + "documentation": { + "id": 3941, + "nodeType": "StructuredDocumentation", + "src": "661:1299:32", + "text": " @notice Represents stake assigned to a specific verifier/data service.\n Provisioned stake is locked and can be used as economic security by a data service.\n @param tokens Service provider tokens in the provision (does not include delegated tokens)\n @param tokensThawing Service provider tokens that are being thawed (and will stop being slashable soon)\n @param sharesThawing Shares representing the thawing tokens\n @param maxVerifierCut Max amount that can be taken by the verifier when slashing, expressed in parts-per-million of the amount slashed\n @param thawingPeriod Time, in seconds, tokens must thaw before being withdrawn\n @param createdAt Timestamp when the provision was created\n @param maxVerifierCutPending Pending value for `maxVerifierCut`. Verifier needs to accept it before it becomes active.\n @param thawingPeriodPending Pending value for `thawingPeriod`. Verifier needs to accept it before it becomes active.\n @param lastParametersStagedAt Timestamp when the provision parameters were last staged. Can be used by data service implementation to\n implement arbitrary parameter update logic.\n @param thawingNonce Value of the current thawing nonce. Thaw requests with older nonces are invalid." + }, + "id": 3962, + "members": [ + { + "constant": false, + "id": 3943, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "2000:6:32", + "nodeType": "VariableDeclaration", + "scope": 3962, + "src": "1992:14:32", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3942, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1992:7:32", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3945, + "mutability": "mutable", + "name": "tokensThawing", + "nameLocation": "2024:13:32", + "nodeType": "VariableDeclaration", + "scope": 3962, + "src": "2016:21:32", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3944, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2016:7:32", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3947, + "mutability": "mutable", + "name": "sharesThawing", + "nameLocation": "2055:13:32", + "nodeType": "VariableDeclaration", + "scope": 3962, + "src": "2047:21:32", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3946, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2047:7:32", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3949, + "mutability": "mutable", + "name": "maxVerifierCut", + "nameLocation": "2085:14:32", + "nodeType": "VariableDeclaration", + "scope": 3962, + "src": "2078:21:32", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 3948, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "2078:6:32", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3951, + "mutability": "mutable", + "name": "thawingPeriod", + "nameLocation": "2116:13:32", + "nodeType": "VariableDeclaration", + "scope": 3962, + "src": "2109:20:32", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + }, + "typeName": { + "id": 3950, + "name": "uint64", + "nodeType": "ElementaryTypeName", + "src": "2109:6:32", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3953, + "mutability": "mutable", + "name": "createdAt", + "nameLocation": "2146:9:32", + "nodeType": "VariableDeclaration", + "scope": 3962, + "src": "2139:16:32", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + }, + "typeName": { + "id": 3952, + "name": "uint64", + "nodeType": "ElementaryTypeName", + "src": "2139:6:32", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3955, + "mutability": "mutable", + "name": "maxVerifierCutPending", + "nameLocation": "2172:21:32", + "nodeType": "VariableDeclaration", + "scope": 3962, + "src": "2165:28:32", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 3954, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "2165:6:32", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3957, + "mutability": "mutable", + "name": "thawingPeriodPending", + "nameLocation": "2210:20:32", + "nodeType": "VariableDeclaration", + "scope": 3962, + "src": "2203:27:32", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + }, + "typeName": { + "id": 3956, + "name": "uint64", + "nodeType": "ElementaryTypeName", + "src": "2203:6:32", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3959, + "mutability": "mutable", + "name": "lastParametersStagedAt", + "nameLocation": "2248:22:32", + "nodeType": "VariableDeclaration", + "scope": 3962, + "src": "2240:30:32", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3958, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2240:7:32", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3961, + "mutability": "mutable", + "name": "thawingNonce", + "nameLocation": "2288:12:32", + "nodeType": "VariableDeclaration", + "scope": 3962, + "src": "2280:20:32", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3960, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2280:7:32", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "name": "Provision", + "nameLocation": "1972:9:32", + "nodeType": "StructDefinition", + "scope": 4073, + "src": "1965:342:32", + "visibility": "public" + }, + { + "canonicalName": "IHorizonStakingTypes.ServiceProvider", + "documentation": { + "id": 3963, + "nodeType": "StructuredDocumentation", + "src": "2313:384:32", + "text": " @notice Public representation of a service provider.\n @dev See {ServiceProviderInternal} for the actual storage representation\n @param tokensStaked Total amount of tokens on the provider stake (only staked by the provider, includes all provisions)\n @param tokensProvisioned Total amount of tokens locked in provisions (only staked by the provider)" + }, + "id": 3968, + "members": [ + { + "constant": false, + "id": 3965, + "mutability": "mutable", + "name": "tokensStaked", + "nameLocation": "2743:12:32", + "nodeType": "VariableDeclaration", + "scope": 3968, + "src": "2735:20:32", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3964, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2735:7:32", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3967, + "mutability": "mutable", + "name": "tokensProvisioned", + "nameLocation": "2773:17:32", + "nodeType": "VariableDeclaration", + "scope": 3968, + "src": "2765:25:32", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3966, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2765:7:32", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "name": "ServiceProvider", + "nameLocation": "2709:15:32", + "nodeType": "StructDefinition", + "scope": 4073, + "src": "2702:95:32", + "visibility": "public" + }, + { + "canonicalName": "IHorizonStakingTypes.ServiceProviderInternal", + "documentation": { + "id": 3969, + "nodeType": "StructuredDocumentation", + "src": "2803:700:32", + "text": " @notice Internal representation of a service provider.\n @dev It contains deprecated fields from the `Indexer` struct to maintain storage compatibility.\n @param tokensStaked Total amount of tokens on the provider stake (only staked by the provider, includes all provisions)\n @param __DEPRECATED_tokensAllocated (Deprecated) Tokens used in allocations\n @param __DEPRECATED_tokensLocked (Deprecated) Tokens locked for withdrawal subject to thawing period\n @param __DEPRECATED_tokensLockedUntil (Deprecated) Block when locked tokens can be withdrawn\n @param tokensProvisioned Total amount of tokens locked in provisions (only staked by the provider)" + }, + "id": 3980, + "members": [ + { + "constant": false, + "id": 3971, + "mutability": "mutable", + "name": "tokensStaked", + "nameLocation": "3557:12:32", + "nodeType": "VariableDeclaration", + "scope": 3980, + "src": "3549:20:32", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3970, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "3549:7:32", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3973, + "mutability": "mutable", + "name": "__DEPRECATED_tokensAllocated", + "nameLocation": "3587:28:32", + "nodeType": "VariableDeclaration", + "scope": 3980, + "src": "3579:36:32", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3972, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "3579:7:32", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3975, + "mutability": "mutable", + "name": "__DEPRECATED_tokensLocked", + "nameLocation": "3633:25:32", + "nodeType": "VariableDeclaration", + "scope": 3980, + "src": "3625:33:32", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3974, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "3625:7:32", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3977, + "mutability": "mutable", + "name": "__DEPRECATED_tokensLockedUntil", + "nameLocation": "3676:30:32", + "nodeType": "VariableDeclaration", + "scope": 3980, + "src": "3668:38:32", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3976, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "3668:7:32", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3979, + "mutability": "mutable", + "name": "tokensProvisioned", + "nameLocation": "3724:17:32", + "nodeType": "VariableDeclaration", + "scope": 3980, + "src": "3716:25:32", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3978, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "3716:7:32", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "name": "ServiceProviderInternal", + "nameLocation": "3515:23:32", + "nodeType": "StructDefinition", + "scope": 4073, + "src": "3508:240:32", + "visibility": "public" + }, + { + "canonicalName": "IHorizonStakingTypes.DelegationPool", + "documentation": { + "id": 3981, + "nodeType": "StructuredDocumentation", + "src": "3754:483:32", + "text": " @notice Public representation of a delegation pool.\n @dev See {DelegationPoolInternal} for the actual storage representation\n @param tokens Total tokens as pool reserves\n @param shares Total shares minted in the pool\n @param tokensThawing Tokens thawing in the pool\n @param sharesThawing Shares representing the thawing tokens\n @param thawingNonce Value of the current thawing nonce. Thaw requests with older nonces are invalid." + }, + "id": 3992, + "members": [ + { + "constant": false, + "id": 3983, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "4282:6:32", + "nodeType": "VariableDeclaration", + "scope": 3992, + "src": "4274:14:32", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3982, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "4274:7:32", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3985, + "mutability": "mutable", + "name": "shares", + "nameLocation": "4306:6:32", + "nodeType": "VariableDeclaration", + "scope": 3992, + "src": "4298:14:32", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3984, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "4298:7:32", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3987, + "mutability": "mutable", + "name": "tokensThawing", + "nameLocation": "4330:13:32", + "nodeType": "VariableDeclaration", + "scope": 3992, + "src": "4322:21:32", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3986, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "4322:7:32", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3989, + "mutability": "mutable", + "name": "sharesThawing", + "nameLocation": "4361:13:32", + "nodeType": "VariableDeclaration", + "scope": 3992, + "src": "4353:21:32", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3988, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "4353:7:32", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3991, + "mutability": "mutable", + "name": "thawingNonce", + "nameLocation": "4392:12:32", + "nodeType": "VariableDeclaration", + "scope": 3992, + "src": "4384:20:32", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3990, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "4384:7:32", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "name": "DelegationPool", + "nameLocation": "4249:14:32", + "nodeType": "StructDefinition", + "scope": 4073, + "src": "4242:169:32", + "visibility": "public" + }, + { + "canonicalName": "IHorizonStakingTypes.DelegationPoolInternal", + "documentation": { + "id": 3993, + "nodeType": "StructuredDocumentation", + "src": "4417:1077:32", + "text": " @notice Internal representation of a delegation pool.\n @dev It contains deprecated fields from the previous version of the `DelegationPool` struct\n to maintain storage compatibility.\n @param __DEPRECATED_cooldownBlocks (Deprecated) Time, in blocks, an indexer must wait before updating delegation parameters\n @param __DEPRECATED_indexingRewardCut (Deprecated) Percentage of indexing rewards for the service provider, in PPM\n @param __DEPRECATED_queryFeeCut (Deprecated) Percentage of query fees for the service provider, in PPM\n @param __DEPRECATED_updatedAtBlock (Deprecated) Block when the delegation parameters were last updated\n @param tokens Total tokens as pool reserves\n @param shares Total shares minted in the pool\n @param delegators Delegation details by delegator\n @param tokensThawing Tokens thawing in the pool\n @param sharesThawing Shares representing the thawing tokens\n @param thawingNonce Value of the current thawing nonce. Thaw requests with older nonces are invalid." + }, + "id": 4017, + "members": [ + { + "constant": false, + "id": 3995, + "mutability": "mutable", + "name": "__DEPRECATED_cooldownBlocks", + "nameLocation": "5546:27:32", + "nodeType": "VariableDeclaration", + "scope": 4017, + "src": "5539:34:32", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 3994, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "5539:6:32", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3997, + "mutability": "mutable", + "name": "__DEPRECATED_indexingRewardCut", + "nameLocation": "5590:30:32", + "nodeType": "VariableDeclaration", + "scope": 4017, + "src": "5583:37:32", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 3996, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "5583:6:32", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 3999, + "mutability": "mutable", + "name": "__DEPRECATED_queryFeeCut", + "nameLocation": "5637:24:32", + "nodeType": "VariableDeclaration", + "scope": 4017, + "src": "5630:31:32", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 3998, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "5630:6:32", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 4001, + "mutability": "mutable", + "name": "__DEPRECATED_updatedAtBlock", + "nameLocation": "5679:27:32", + "nodeType": "VariableDeclaration", + "scope": 4017, + "src": "5671:35:32", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4000, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "5671:7:32", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 4003, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "5724:6:32", + "nodeType": "VariableDeclaration", + "scope": 4017, + "src": "5716:14:32", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4002, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "5716:7:32", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 4005, + "mutability": "mutable", + "name": "shares", + "nameLocation": "5748:6:32", + "nodeType": "VariableDeclaration", + "scope": 4017, + "src": "5740:14:32", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4004, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "5740:7:32", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 4010, + "mutability": "mutable", + "name": "delegators", + "nameLocation": "5824:10:32", + "nodeType": "VariableDeclaration", + "scope": 4017, + "src": "5764:70:32", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_DelegationInternal_$4029_storage_$", + "typeString": "mapping(address => struct IHorizonStakingTypes.DelegationInternal)" + }, + "typeName": { + "id": 4009, + "keyName": "delegator", + "keyNameLocation": "5780:9:32", + "keyType": { + "id": 4006, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5772:7:32", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "5764:59:32", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_DelegationInternal_$4029_storage_$", + "typeString": "mapping(address => struct IHorizonStakingTypes.DelegationInternal)" + }, + "valueName": "delegation", + "valueNameLocation": "5812:10:32", + "valueType": { + "id": 4008, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 4007, + "name": "DelegationInternal", + "nameLocations": [ + "5793:18:32" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 4029, + "src": "5793:18:32" + }, + "referencedDeclaration": 4029, + "src": "5793:18:32", + "typeDescriptions": { + "typeIdentifier": "t_struct$_DelegationInternal_$4029_storage_ptr", + "typeString": "struct IHorizonStakingTypes.DelegationInternal" + } + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 4012, + "mutability": "mutable", + "name": "tokensThawing", + "nameLocation": "5852:13:32", + "nodeType": "VariableDeclaration", + "scope": 4017, + "src": "5844:21:32", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4011, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "5844:7:32", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 4014, + "mutability": "mutable", + "name": "sharesThawing", + "nameLocation": "5883:13:32", + "nodeType": "VariableDeclaration", + "scope": 4017, + "src": "5875:21:32", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4013, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "5875:7:32", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 4016, + "mutability": "mutable", + "name": "thawingNonce", + "nameLocation": "5914:12:32", + "nodeType": "VariableDeclaration", + "scope": 4017, + "src": "5906:20:32", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4015, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "5906:7:32", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "name": "DelegationPoolInternal", + "nameLocation": "5506:22:32", + "nodeType": "StructDefinition", + "scope": 4073, + "src": "5499:434:32", + "visibility": "public" + }, + { + "canonicalName": "IHorizonStakingTypes.Delegation", + "documentation": { + "id": 4018, + "nodeType": "StructuredDocumentation", + "src": "5939:207:32", + "text": " @notice Public representation of delegation details.\n @dev See {DelegationInternal} for the actual storage representation\n @param shares Shares owned by a delegator in the pool" + }, + "id": 4021, + "members": [ + { + "constant": false, + "id": 4020, + "mutability": "mutable", + "name": "shares", + "nameLocation": "6187:6:32", + "nodeType": "VariableDeclaration", + "scope": 4021, + "src": "6179:14:32", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4019, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "6179:7:32", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "name": "Delegation", + "nameLocation": "6158:10:32", + "nodeType": "StructDefinition", + "scope": 4073, + "src": "6151:49:32", + "visibility": "public" + }, + { + "canonicalName": "IHorizonStakingTypes.DelegationInternal", + "documentation": { + "id": 4022, + "nodeType": "StructuredDocumentation", + "src": "6206:431:32", + "text": " @notice Internal representation of delegation details.\n @dev It contains deprecated fields from the previous version of the `Delegation` struct\n to maintain storage compatibility.\n @param shares Shares owned by the delegator in the pool\n @param __DEPRECATED_tokensLocked Tokens locked for undelegation\n @param __DEPRECATED_tokensLockedUntil Epoch when locked tokens can be withdrawn" + }, + "id": 4029, + "members": [ + { + "constant": false, + "id": 4024, + "mutability": "mutable", + "name": "shares", + "nameLocation": "6686:6:32", + "nodeType": "VariableDeclaration", + "scope": 4029, + "src": "6678:14:32", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4023, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "6678:7:32", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 4026, + "mutability": "mutable", + "name": "__DEPRECATED_tokensLocked", + "nameLocation": "6710:25:32", + "nodeType": "VariableDeclaration", + "scope": 4029, + "src": "6702:33:32", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4025, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "6702:7:32", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 4028, + "mutability": "mutable", + "name": "__DEPRECATED_tokensLockedUntil", + "nameLocation": "6753:30:32", + "nodeType": "VariableDeclaration", + "scope": 4029, + "src": "6745:38:32", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4027, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "6745:7:32", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "name": "DelegationInternal", + "nameLocation": "6649:18:32", + "nodeType": "StructDefinition", + "scope": 4073, + "src": "6642:148:32", + "visibility": "public" + }, + { + "canonicalName": "IHorizonStakingTypes.ThawRequestType", + "documentation": { + "id": 4030, + "nodeType": "StructuredDocumentation", + "src": "6796:201:32", + "text": " @dev Enum to specify the type of thaw request.\n @param Provision Represents a thaw request for a provision.\n @param Delegation Represents a thaw request for a delegation." + }, + "id": 4033, + "members": [ + { + "id": 4031, + "name": "Provision", + "nameLocation": "7033:9:32", + "nodeType": "EnumValue", + "src": "7033:9:32" + }, + { + "id": 4032, + "name": "Delegation", + "nameLocation": "7052:10:32", + "nodeType": "EnumValue", + "src": "7052:10:32" + } + ], + "name": "ThawRequestType", + "nameLocation": "7007:15:32", + "nodeType": "EnumDefinition", + "src": "7002:66:32" + }, + { + "canonicalName": "IHorizonStakingTypes.ThawRequest", + "documentation": { + "id": 4034, + "nodeType": "StructuredDocumentation", + "src": "7074:494:32", + "text": " @notice Details of a stake thawing operation.\n @dev ThawRequests are stored in linked lists by service provider/delegator,\n ordered by creation timestamp.\n @param shares Shares that represent the tokens being thawed\n @param thawingUntil The timestamp when the thawed funds can be removed from the provision\n @param nextRequest Id of the next thaw request in the linked list\n @param thawingNonce Used to invalidate unfulfilled thaw requests" + }, + "id": 4043, + "members": [ + { + "constant": false, + "id": 4036, + "mutability": "mutable", + "name": "shares", + "nameLocation": "7610:6:32", + "nodeType": "VariableDeclaration", + "scope": 4043, + "src": "7602:14:32", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4035, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "7602:7:32", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 4038, + "mutability": "mutable", + "name": "thawingUntil", + "nameLocation": "7633:12:32", + "nodeType": "VariableDeclaration", + "scope": 4043, + "src": "7626:19:32", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + }, + "typeName": { + "id": 4037, + "name": "uint64", + "nodeType": "ElementaryTypeName", + "src": "7626:6:32", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 4040, + "mutability": "mutable", + "name": "nextRequest", + "nameLocation": "7663:11:32", + "nodeType": "VariableDeclaration", + "scope": 4043, + "src": "7655:19:32", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 4039, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "7655:7:32", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 4042, + "mutability": "mutable", + "name": "thawingNonce", + "nameLocation": "7692:12:32", + "nodeType": "VariableDeclaration", + "scope": 4043, + "src": "7684:20:32", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4041, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "7684:7:32", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "name": "ThawRequest", + "nameLocation": "7580:11:32", + "nodeType": "StructDefinition", + "scope": 4073, + "src": "7573:138:32", + "visibility": "public" + }, + { + "canonicalName": "IHorizonStakingTypes.FulfillThawRequestsParams", + "documentation": { + "id": 4044, + "nodeType": "StructuredDocumentation", + "src": "7717:817:32", + "text": " @notice Parameters to fulfill thaw requests.\n @dev This struct is used to avoid stack too deep error in the `fulfillThawRequests` function.\n @param requestType The type of thaw request (Provision or Delegation)\n @param serviceProvider The address of the service provider\n @param verifier The address of the verifier\n @param owner The address of the owner of the thaw request\n @param tokensThawing The current amount of tokens already thawing\n @param sharesThawing The current amount of shares already thawing\n @param nThawRequests The number of thaw requests to fulfill. If set to 0, all thaw requests are fulfilled.\n @param thawingNonce The current valid thawing nonce. Any thaw request with a different nonce is invalid and should be ignored." + }, + "id": 4062, + "members": [ + { + "constant": false, + "id": 4047, + "mutability": "mutable", + "name": "requestType", + "nameLocation": "8598:11:32", + "nodeType": "VariableDeclaration", + "scope": 4062, + "src": "8582:27:32", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_ThawRequestType_$4033", + "typeString": "enum IHorizonStakingTypes.ThawRequestType" + }, + "typeName": { + "id": 4046, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 4045, + "name": "ThawRequestType", + "nameLocations": [ + "8582:15:32" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 4033, + "src": "8582:15:32" + }, + "referencedDeclaration": 4033, + "src": "8582:15:32", + "typeDescriptions": { + "typeIdentifier": "t_enum$_ThawRequestType_$4033", + "typeString": "enum IHorizonStakingTypes.ThawRequestType" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 4049, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "8627:15:32", + "nodeType": "VariableDeclaration", + "scope": 4062, + "src": "8619:23:32", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 4048, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "8619:7:32", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 4051, + "mutability": "mutable", + "name": "verifier", + "nameLocation": "8660:8:32", + "nodeType": "VariableDeclaration", + "scope": 4062, + "src": "8652:16:32", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 4050, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "8652:7:32", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 4053, + "mutability": "mutable", + "name": "owner", + "nameLocation": "8686:5:32", + "nodeType": "VariableDeclaration", + "scope": 4062, + "src": "8678:13:32", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 4052, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "8678:7:32", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 4055, + "mutability": "mutable", + "name": "tokensThawing", + "nameLocation": "8709:13:32", + "nodeType": "VariableDeclaration", + "scope": 4062, + "src": "8701:21:32", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4054, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "8701:7:32", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 4057, + "mutability": "mutable", + "name": "sharesThawing", + "nameLocation": "8740:13:32", + "nodeType": "VariableDeclaration", + "scope": 4062, + "src": "8732:21:32", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4056, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "8732:7:32", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 4059, + "mutability": "mutable", + "name": "nThawRequests", + "nameLocation": "8771:13:32", + "nodeType": "VariableDeclaration", + "scope": 4062, + "src": "8763:21:32", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4058, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "8763:7:32", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 4061, + "mutability": "mutable", + "name": "thawingNonce", + "nameLocation": "8802:12:32", + "nodeType": "VariableDeclaration", + "scope": 4062, + "src": "8794:20:32", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4060, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "8794:7:32", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "name": "FulfillThawRequestsParams", + "nameLocation": "8546:25:32", + "nodeType": "StructDefinition", + "scope": 4073, + "src": "8539:282:32", + "visibility": "public" + }, + { + "canonicalName": "IHorizonStakingTypes.TraverseThawRequestsResults", + "documentation": { + "id": 4063, + "nodeType": "StructuredDocumentation", + "src": "8827:427:32", + "text": " @notice Results of the traversal of thaw requests.\n @dev This struct is used to avoid stack too deep error in the `fulfillThawRequests` function.\n @param requestsFulfilled The number of thaw requests fulfilled\n @param tokensThawed The total amount of tokens thawed\n @param tokensThawing The total amount of tokens thawing\n @param sharesThawing The total amount of shares thawing" + }, + "id": 4072, + "members": [ + { + "constant": false, + "id": 4065, + "mutability": "mutable", + "name": "requestsFulfilled", + "nameLocation": "9312:17:32", + "nodeType": "VariableDeclaration", + "scope": 4072, + "src": "9304:25:32", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4064, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "9304:7:32", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 4067, + "mutability": "mutable", + "name": "tokensThawed", + "nameLocation": "9347:12:32", + "nodeType": "VariableDeclaration", + "scope": 4072, + "src": "9339:20:32", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4066, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "9339:7:32", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 4069, + "mutability": "mutable", + "name": "tokensThawing", + "nameLocation": "9377:13:32", + "nodeType": "VariableDeclaration", + "scope": 4072, + "src": "9369:21:32", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4068, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "9369:7:32", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 4071, + "mutability": "mutable", + "name": "sharesThawing", + "nameLocation": "9408:13:32", + "nodeType": "VariableDeclaration", + "scope": 4072, + "src": "9400:21:32", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4070, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "9400:7:32", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "name": "TraverseThawRequestsResults", + "nameLocation": "9266:27:32", + "nodeType": "StructDefinition", + "scope": 4073, + "src": "9259:169:32", + "visibility": "public" + } + ], + "scope": 4074, + "src": "624:8806:32", + "usedErrors": [], + "usedEvents": [] + } + ], + "src": "46:9385:32" + }, + "id": 32 + }, + "@graphprotocol/horizon/contracts/libraries/LinkedList.sol": { + "ast": { + "absolutePath": "@graphprotocol/horizon/contracts/libraries/LinkedList.sol", + "exportedSymbols": { + "LinkedList": [ + 4364 + ] + }, + "id": 4365, + "license": "GPL-2.0-or-later", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 4075, + "literals": [ + "solidity", + "0.8", + ".27" + ], + "nodeType": "PragmaDirective", + "src": "46:23:33" + }, + { + "abstract": false, + "baseContracts": [], + "canonicalName": "LinkedList", + "contractDependencies": [], + "contractKind": "library", + "documentation": { + "id": 4076, + "nodeType": "StructuredDocumentation", + "src": "71:714:33", + "text": " @title LinkedList library\n @notice A library to manage singly linked lists.\n The library makes no assumptions about the contents of the items, the only\n requirements on the items are:\n - they must be represented by a unique bytes32 id\n - the id of the item must not be bytes32(0)\n - each item must have a reference to the next item in the list\n - the list cannot have more than `MAX_ITEMS` items\n A contract using this library must store:\n - a LinkedList.List to keep track of the list metadata\n - a mapping from bytes32 to the item data\n @custom:security-contact Please email security+contracts@thegraph.com if you find any\n bugs. We may have an active bug bounty program." + }, + "fullyImplemented": true, + "id": 4364, + "linearizedBaseContracts": [ + 4364 + ], + "name": "LinkedList", + "nameLocation": "794:10:33", + "nodeType": "ContractDefinition", + "nodes": [ + { + "global": false, + "id": 4080, + "libraryName": { + "id": 4077, + "name": "LinkedList", + "nameLocations": [ + "817:10:33" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 4364, + "src": "817:10:33" + }, + "nodeType": "UsingForDirective", + "src": "811:26:33", + "typeName": { + "id": 4079, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 4078, + "name": "List", + "nameLocations": [ + "832:4:33" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 4090, + "src": "832:4:33" + }, + "referencedDeclaration": 4090, + "src": "832:4:33", + "typeDescriptions": { + "typeIdentifier": "t_struct$_List_$4090_storage_ptr", + "typeString": "struct LinkedList.List" + } + } + }, + { + "canonicalName": "LinkedList.List", + "documentation": { + "id": 4081, + "nodeType": "StructuredDocumentation", + "src": "843:264:33", + "text": " @notice Represents a linked list\n @param head The head of the list\n @param tail The tail of the list\n @param nonce A nonce, which can optionally be used to generate unique ids\n @param count The number of items in the list" + }, + "id": 4090, + "members": [ + { + "constant": false, + "id": 4083, + "mutability": "mutable", + "name": "head", + "nameLocation": "1142:4:33", + "nodeType": "VariableDeclaration", + "scope": 4090, + "src": "1134:12:33", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 4082, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1134:7:33", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 4085, + "mutability": "mutable", + "name": "tail", + "nameLocation": "1164:4:33", + "nodeType": "VariableDeclaration", + "scope": 4090, + "src": "1156:12:33", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 4084, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1156:7:33", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 4087, + "mutability": "mutable", + "name": "nonce", + "nameLocation": "1186:5:33", + "nodeType": "VariableDeclaration", + "scope": 4090, + "src": "1178:13:33", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4086, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1178:7:33", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 4089, + "mutability": "mutable", + "name": "count", + "nameLocation": "1209:5:33", + "nodeType": "VariableDeclaration", + "scope": 4090, + "src": "1201:13:33", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4088, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1201:7:33", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "name": "List", + "nameLocation": "1119:4:33", + "nodeType": "StructDefinition", + "scope": 4364, + "src": "1112:109:33", + "visibility": "public" + }, + { + "constant": true, + "documentation": { + "id": 4091, + "nodeType": "StructuredDocumentation", + "src": "1227:32:33", + "text": "@notice Empty bytes constant" + }, + "id": 4097, + "mutability": "constant", + "name": "NULL_BYTES", + "nameLocation": "1288:10:33", + "nodeType": "VariableDeclaration", + "scope": 4364, + "src": "1264:46:33", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 4092, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "1264:5:33", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "value": { + "arguments": [ + { + "hexValue": "", + "id": 4095, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1307:2:33", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470", + "typeString": "literal_string \"\"" + }, + "value": "" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_stringliteral_c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470", + "typeString": "literal_string \"\"" + } + ], + "id": 4094, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "1301:5:33", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes_storage_ptr_$", + "typeString": "type(bytes storage pointer)" + }, + "typeName": { + "id": 4093, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "1301:5:33", + "typeDescriptions": {} + } + }, + "id": 4096, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "1301:9:33", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "visibility": "internal" + }, + { + "constant": true, + "documentation": { + "id": 4098, + "nodeType": "StructuredDocumentation", + "src": "1317:55:33", + "text": "@notice Maximum amount of items allowed in the list" + }, + "id": 4101, + "mutability": "constant", + "name": "MAX_ITEMS", + "nameLocation": "1403:9:33", + "nodeType": "VariableDeclaration", + "scope": 4364, + "src": "1377:44:33", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4099, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1377:7:33", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": { + "hexValue": "31305f303030", + "id": 4100, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1415:6:33", + "typeDescriptions": { + "typeIdentifier": "t_rational_10000_by_1", + "typeString": "int_const 10000" + }, + "value": "10_000" + }, + "visibility": "internal" + }, + { + "documentation": { + "id": 4102, + "nodeType": "StructuredDocumentation", + "src": "1428:82:33", + "text": " @notice Thrown when trying to remove an item from an empty list" + }, + "errorSelector": "ddaf8f21", + "id": 4104, + "name": "LinkedListEmptyList", + "nameLocation": "1521:19:33", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 4103, + "nodeType": "ParameterList", + "parameters": [], + "src": "1540:2:33" + }, + "src": "1515:28:33" + }, + { + "documentation": { + "id": 4105, + "nodeType": "StructuredDocumentation", + "src": "1549:118:33", + "text": " @notice Thrown when trying to add an item to a list that has reached the maximum number of elements" + }, + "errorSelector": "ea315ac0", + "id": 4107, + "name": "LinkedListMaxElementsExceeded", + "nameLocation": "1678:29:33", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 4106, + "nodeType": "ParameterList", + "parameters": [], + "src": "1707:2:33" + }, + "src": "1672:38:33" + }, + { + "documentation": { + "id": 4108, + "nodeType": "StructuredDocumentation", + "src": "1716:99:33", + "text": " @notice Thrown when trying to traverse a list with more iterations than elements" + }, + "errorSelector": "9482373a", + "id": 4110, + "name": "LinkedListInvalidIterations", + "nameLocation": "1826:27:33", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 4109, + "nodeType": "ParameterList", + "parameters": [], + "src": "1853:2:33" + }, + "src": "1820:36:33" + }, + { + "documentation": { + "id": 4111, + "nodeType": "StructuredDocumentation", + "src": "1862:88:33", + "text": " @notice Thrown when trying to add an item with id equal to bytes32(0)" + }, + "errorSelector": "8f4a893d", + "id": 4113, + "name": "LinkedListInvalidZeroId", + "nameLocation": "1961:23:33", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 4112, + "nodeType": "ParameterList", + "parameters": [], + "src": "1984:2:33" + }, + "src": "1955:32:33" + }, + { + "body": { + "id": 4171, + "nodeType": "Block", + "src": "2503:262:33", + "statements": [ + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 4126, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 4123, + "name": "self", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4117, + "src": "2521:4:33", + "typeDescriptions": { + "typeIdentifier": "t_struct$_List_$4090_storage_ptr", + "typeString": "struct LinkedList.List storage pointer" + } + }, + "id": 4124, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "2526:5:33", + "memberName": "count", + "nodeType": "MemberAccess", + "referencedDeclaration": 4089, + "src": "2521:10:33", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "id": 4125, + "name": "MAX_ITEMS", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4101, + "src": "2534:9:33", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "2521:22:33", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 4127, + "name": "LinkedListMaxElementsExceeded", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4107, + "src": "2545:29:33", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$__$returns$_t_error_$", + "typeString": "function () pure returns (error)" + } + }, + "id": 4128, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2545:31:33", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 4122, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "2513:7:33", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 4129, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2513:64:33", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 4130, + "nodeType": "ExpressionStatement", + "src": "2513:64:33" + }, + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "id": 4137, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 4132, + "name": "id", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4119, + "src": "2595:2:33", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "arguments": [ + { + "hexValue": "30", + "id": 4135, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2609:1:33", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 4134, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "2601:7:33", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes32_$", + "typeString": "type(bytes32)" + }, + "typeName": { + "id": 4133, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "2601:7:33", + "typeDescriptions": {} + } + }, + "id": 4136, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2601:10:33", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "src": "2595:16:33", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 4138, + "name": "LinkedListInvalidZeroId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4113, + "src": "2613:23:33", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$__$returns$_t_error_$", + "typeString": "function () pure returns (error)" + } + }, + "id": 4139, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2613:25:33", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 4131, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "2587:7:33", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 4140, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2587:52:33", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 4141, + "nodeType": "ExpressionStatement", + "src": "2587:52:33" + }, + { + "expression": { + "id": 4146, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 4142, + "name": "self", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4117, + "src": "2649:4:33", + "typeDescriptions": { + "typeIdentifier": "t_struct$_List_$4090_storage_ptr", + "typeString": "struct LinkedList.List storage pointer" + } + }, + "id": 4144, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberLocation": "2654:4:33", + "memberName": "tail", + "nodeType": "MemberAccess", + "referencedDeclaration": 4085, + "src": "2649:9:33", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "id": 4145, + "name": "id", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4119, + "src": "2661:2:33", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "src": "2649:14:33", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "id": 4147, + "nodeType": "ExpressionStatement", + "src": "2649:14:33" + }, + { + "expression": { + "id": 4152, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 4148, + "name": "self", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4117, + "src": "2673:4:33", + "typeDescriptions": { + "typeIdentifier": "t_struct$_List_$4090_storage_ptr", + "typeString": "struct LinkedList.List storage pointer" + } + }, + "id": 4150, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberLocation": "2678:5:33", + "memberName": "nonce", + "nodeType": "MemberAccess", + "referencedDeclaration": 4087, + "src": "2673:10:33", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "+=", + "rightHandSide": { + "hexValue": "31", + "id": 4151, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2687:1:33", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "2673:15:33", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 4153, + "nodeType": "ExpressionStatement", + "src": "2673:15:33" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 4157, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 4154, + "name": "self", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4117, + "src": "2702:4:33", + "typeDescriptions": { + "typeIdentifier": "t_struct$_List_$4090_storage_ptr", + "typeString": "struct LinkedList.List storage pointer" + } + }, + "id": 4155, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "2707:5:33", + "memberName": "count", + "nodeType": "MemberAccess", + "referencedDeclaration": 4089, + "src": "2702:10:33", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "30", + "id": 4156, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2716:1:33", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "2702:15:33", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 4164, + "nodeType": "IfStatement", + "src": "2698:35:33", + "trueBody": { + "expression": { + "id": 4162, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 4158, + "name": "self", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4117, + "src": "2719:4:33", + "typeDescriptions": { + "typeIdentifier": "t_struct$_List_$4090_storage_ptr", + "typeString": "struct LinkedList.List storage pointer" + } + }, + "id": 4160, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberLocation": "2724:4:33", + "memberName": "head", + "nodeType": "MemberAccess", + "referencedDeclaration": 4083, + "src": "2719:9:33", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "id": 4161, + "name": "id", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4119, + "src": "2731:2:33", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "src": "2719:14:33", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "id": 4163, + "nodeType": "ExpressionStatement", + "src": "2719:14:33" + } + }, + { + "expression": { + "id": 4169, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 4165, + "name": "self", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4117, + "src": "2743:4:33", + "typeDescriptions": { + "typeIdentifier": "t_struct$_List_$4090_storage_ptr", + "typeString": "struct LinkedList.List storage pointer" + } + }, + "id": 4167, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberLocation": "2748:5:33", + "memberName": "count", + "nodeType": "MemberAccess", + "referencedDeclaration": 4089, + "src": "2743:10:33", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "+=", + "rightHandSide": { + "hexValue": "31", + "id": 4168, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2757:1:33", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "2743:15:33", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 4170, + "nodeType": "ExpressionStatement", + "src": "2743:15:33" + } + ] + }, + "documentation": { + "id": 4114, + "nodeType": "StructuredDocumentation", + "src": "1993:448:33", + "text": " @notice Adds an item to the list.\n The item is added to the end of the list.\n @dev Note that this function will not take care of linking the\n old tail to the new item. The caller should take care of this.\n It will also not ensure id uniqueness.\n @dev There is a maximum number of elements that can be added to the list.\n @param self The list metadata\n @param id The id of the item to add" + }, + "id": 4172, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "addTail", + "nameLocation": "2455:7:33", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 4120, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 4117, + "mutability": "mutable", + "name": "self", + "nameLocation": "2476:4:33", + "nodeType": "VariableDeclaration", + "scope": 4172, + "src": "2463:17:33", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_List_$4090_storage_ptr", + "typeString": "struct LinkedList.List" + }, + "typeName": { + "id": 4116, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 4115, + "name": "List", + "nameLocations": [ + "2463:4:33" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 4090, + "src": "2463:4:33" + }, + "referencedDeclaration": 4090, + "src": "2463:4:33", + "typeDescriptions": { + "typeIdentifier": "t_struct$_List_$4090_storage_ptr", + "typeString": "struct LinkedList.List" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 4119, + "mutability": "mutable", + "name": "id", + "nameLocation": "2490:2:33", + "nodeType": "VariableDeclaration", + "scope": 4172, + "src": "2482:10:33", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 4118, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "2482:7:33", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "2462:31:33" + }, + "returnParameters": { + "id": 4121, + "nodeType": "ParameterList", + "parameters": [], + "src": "2503:0:33" + }, + "scope": 4364, + "src": "2446:319:33", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 4245, + "nodeType": "Block", + "src": "3468:279:33", + "statements": [ + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 4199, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 4196, + "name": "self", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4176, + "src": "3486:4:33", + "typeDescriptions": { + "typeIdentifier": "t_struct$_List_$4090_storage_ptr", + "typeString": "struct LinkedList.List storage pointer" + } + }, + "id": 4197, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "3491:5:33", + "memberName": "count", + "nodeType": "MemberAccess", + "referencedDeclaration": 4089, + "src": "3486:10:33", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "hexValue": "30", + "id": 4198, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3499:1:33", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "3486:14:33", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 4200, + "name": "LinkedListEmptyList", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4104, + "src": "3502:19:33", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$__$returns$_t_error_$", + "typeString": "function () pure returns (error)" + } + }, + "id": 4201, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3502:21:33", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 4195, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "3478:7:33", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 4202, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3478:46:33", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 4203, + "nodeType": "ExpressionStatement", + "src": "3478:46:33" + }, + { + "assignments": [ + 4205 + ], + "declarations": [ + { + "constant": false, + "id": 4205, + "mutability": "mutable", + "name": "nextItem", + "nameLocation": "3542:8:33", + "nodeType": "VariableDeclaration", + "scope": 4245, + "src": "3534:16:33", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 4204, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "3534:7:33", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "id": 4210, + "initialValue": { + "arguments": [ + { + "expression": { + "id": 4207, + "name": "self", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4176, + "src": "3565:4:33", + "typeDescriptions": { + "typeIdentifier": "t_struct$_List_$4090_storage_ptr", + "typeString": "struct LinkedList.List storage pointer" + } + }, + "id": 4208, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "3570:4:33", + "memberName": "head", + "nodeType": "MemberAccess", + "referencedDeclaration": 4083, + "src": "3565:9:33", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 4206, + "name": "getNextItem", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4184, + "src": "3553:11:33", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_bytes32_$", + "typeString": "function (bytes32) view returns (bytes32)" + } + }, + "id": 4209, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3553:22:33", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "3534:41:33" + }, + { + "expression": { + "arguments": [ + { + "expression": { + "id": 4212, + "name": "self", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4176, + "src": "3596:4:33", + "typeDescriptions": { + "typeIdentifier": "t_struct$_List_$4090_storage_ptr", + "typeString": "struct LinkedList.List storage pointer" + } + }, + "id": 4213, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "3601:4:33", + "memberName": "head", + "nodeType": "MemberAccess", + "referencedDeclaration": 4083, + "src": "3596:9:33", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 4211, + "name": "deleteItem", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4190, + "src": "3585:10:33", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$returns$__$", + "typeString": "function (bytes32)" + } + }, + "id": 4214, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3585:21:33", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 4215, + "nodeType": "ExpressionStatement", + "src": "3585:21:33" + }, + { + "expression": { + "id": 4220, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 4216, + "name": "self", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4176, + "src": "3616:4:33", + "typeDescriptions": { + "typeIdentifier": "t_struct$_List_$4090_storage_ptr", + "typeString": "struct LinkedList.List storage pointer" + } + }, + "id": 4218, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberLocation": "3621:5:33", + "memberName": "count", + "nodeType": "MemberAccess", + "referencedDeclaration": 4089, + "src": "3616:10:33", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "-=", + "rightHandSide": { + "hexValue": "31", + "id": 4219, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3630:1:33", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "3616:15:33", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 4221, + "nodeType": "ExpressionStatement", + "src": "3616:15:33" + }, + { + "expression": { + "id": 4226, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 4222, + "name": "self", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4176, + "src": "3641:4:33", + "typeDescriptions": { + "typeIdentifier": "t_struct$_List_$4090_storage_ptr", + "typeString": "struct LinkedList.List storage pointer" + } + }, + "id": 4224, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberLocation": "3646:4:33", + "memberName": "head", + "nodeType": "MemberAccess", + "referencedDeclaration": 4083, + "src": "3641:9:33", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "id": 4225, + "name": "nextItem", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4205, + "src": "3653:8:33", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "src": "3641:20:33", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "id": 4227, + "nodeType": "ExpressionStatement", + "src": "3641:20:33" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 4231, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 4228, + "name": "self", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4176, + "src": "3675:4:33", + "typeDescriptions": { + "typeIdentifier": "t_struct$_List_$4090_storage_ptr", + "typeString": "struct LinkedList.List storage pointer" + } + }, + "id": 4229, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "3680:5:33", + "memberName": "count", + "nodeType": "MemberAccess", + "referencedDeclaration": 4089, + "src": "3675:10:33", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "30", + "id": 4230, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3689:1:33", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "3675:15:33", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 4241, + "nodeType": "IfStatement", + "src": "3671:43:33", + "trueBody": { + "expression": { + "id": 4239, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 4232, + "name": "self", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4176, + "src": "3692:4:33", + "typeDescriptions": { + "typeIdentifier": "t_struct$_List_$4090_storage_ptr", + "typeString": "struct LinkedList.List storage pointer" + } + }, + "id": 4234, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberLocation": "3697:4:33", + "memberName": "tail", + "nodeType": "MemberAccess", + "referencedDeclaration": 4085, + "src": "3692:9:33", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "hexValue": "30", + "id": 4237, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3712:1:33", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 4236, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "3704:7:33", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes32_$", + "typeString": "type(bytes32)" + }, + "typeName": { + "id": 4235, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "3704:7:33", + "typeDescriptions": {} + } + }, + "id": 4238, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3704:10:33", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "src": "3692:22:33", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "id": 4240, + "nodeType": "ExpressionStatement", + "src": "3692:22:33" + } + }, + { + "expression": { + "expression": { + "id": 4242, + "name": "self", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4176, + "src": "3731:4:33", + "typeDescriptions": { + "typeIdentifier": "t_struct$_List_$4090_storage_ptr", + "typeString": "struct LinkedList.List storage pointer" + } + }, + "id": 4243, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "3736:4:33", + "memberName": "head", + "nodeType": "MemberAccess", + "referencedDeclaration": 4083, + "src": "3731:9:33", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "functionReturnParameters": 4194, + "id": 4244, + "nodeType": "Return", + "src": "3724:16:33" + } + ] + }, + "documentation": { + "id": 4173, + "nodeType": "StructuredDocumentation", + "src": "2771:512:33", + "text": " @notice Removes an item from the list.\n The item is removed from the beginning of the list.\n @param self The list metadata\n @param getNextItem A function to get the next item in the list. It should take\n the id of the current item and return the id of the next item.\n @param deleteItem A function to delete an item. This should delete the item from\n the contract storage. It takes the id of the item to delete.\n @return The id of the head of the list." + }, + "id": 4246, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "removeHead", + "nameLocation": "3297:10:33", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 4191, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 4176, + "mutability": "mutable", + "name": "self", + "nameLocation": "3330:4:33", + "nodeType": "VariableDeclaration", + "scope": 4246, + "src": "3317:17:33", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_List_$4090_storage_ptr", + "typeString": "struct LinkedList.List" + }, + "typeName": { + "id": 4175, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 4174, + "name": "List", + "nameLocations": [ + "3317:4:33" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 4090, + "src": "3317:4:33" + }, + "referencedDeclaration": 4090, + "src": "3317:4:33", + "typeDescriptions": { + "typeIdentifier": "t_struct$_List_$4090_storage_ptr", + "typeString": "struct LinkedList.List" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 4184, + "mutability": "mutable", + "name": "getNextItem", + "nameLocation": "3385:11:33", + "nodeType": "VariableDeclaration", + "scope": 4246, + "src": "3344:52:33", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_bytes32_$", + "typeString": "function (bytes32) view returns (bytes32)" + }, + "typeName": { + "id": 4183, + "nodeType": "FunctionTypeName", + "parameterTypes": { + "id": 4179, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 4178, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 4183, + "src": "3353:7:33", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 4177, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "3353:7:33", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "3352:9:33" + }, + "returnParameterTypes": { + "id": 4182, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 4181, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 4183, + "src": "3376:7:33", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 4180, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "3376:7:33", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "3375:9:33" + }, + "src": "3344:52:33", + "stateMutability": "view", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_bytes32_$", + "typeString": "function (bytes32) view returns (bytes32)" + }, + "visibility": "internal" + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 4190, + "mutability": "mutable", + "name": "deleteItem", + "nameLocation": "3424:10:33", + "nodeType": "VariableDeclaration", + "scope": 4246, + "src": "3406:28:33", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$returns$__$", + "typeString": "function (bytes32)" + }, + "typeName": { + "id": 4189, + "nodeType": "FunctionTypeName", + "parameterTypes": { + "id": 4187, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 4186, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 4189, + "src": "3415:7:33", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 4185, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "3415:7:33", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "3414:9:33" + }, + "returnParameterTypes": { + "id": 4188, + "nodeType": "ParameterList", + "parameters": [], + "src": "3424:0:33" + }, + "src": "3406:28:33", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$returns$__$", + "typeString": "function (bytes32)" + }, + "visibility": "internal" + }, + "visibility": "internal" + } + ], + "src": "3307:133:33" + }, + "returnParameters": { + "id": 4194, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 4193, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 4246, + "src": "3459:7:33", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 4192, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "3459:7:33", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "3458:9:33" + }, + "scope": 4364, + "src": "3288:459:33", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 4362, + "nodeType": "Block", + "src": "5142:606:33", + "statements": [ + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 4291, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 4288, + "name": "iterations", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4280, + "src": "5160:10:33", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "expression": { + "id": 4289, + "name": "self", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4250, + "src": "5174:4:33", + "typeDescriptions": { + "typeIdentifier": "t_struct$_List_$4090_storage_ptr", + "typeString": "struct LinkedList.List storage pointer" + } + }, + "id": 4290, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "5179:5:33", + "memberName": "count", + "nodeType": "MemberAccess", + "referencedDeclaration": 4089, + "src": "5174:10:33", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "5160:24:33", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 4292, + "name": "LinkedListInvalidIterations", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4110, + "src": "5186:27:33", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$__$returns$_t_error_$", + "typeString": "function () pure returns (error)" + } + }, + "id": 4293, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5186:29:33", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 4287, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "5152:7:33", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 4294, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5152:64:33", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 4295, + "nodeType": "ExpressionStatement", + "src": "5152:64:33" + }, + { + "assignments": [ + 4297 + ], + "declarations": [ + { + "constant": false, + "id": 4297, + "mutability": "mutable", + "name": "itemCount", + "nameLocation": "5235:9:33", + "nodeType": "VariableDeclaration", + "scope": 4362, + "src": "5227:17:33", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4296, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "5227:7:33", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 4299, + "initialValue": { + "hexValue": "30", + "id": 4298, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "5247:1:33", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "nodeType": "VariableDeclarationStatement", + "src": "5227:21:33" + }, + { + "expression": { + "id": 4309, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 4300, + "name": "iterations", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4280, + "src": "5258:10:33", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "condition": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 4303, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 4301, + "name": "iterations", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4280, + "src": "5272:10:33", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "30", + "id": 4302, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "5286:1:33", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "5272:15:33", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "id": 4304, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "5271:17:33", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseExpression": { + "id": 4307, + "name": "iterations", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4280, + "src": "5304:10:33", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 4308, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "Conditional", + "src": "5271:43:33", + "trueExpression": { + "expression": { + "id": 4305, + "name": "self", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4250, + "src": "5291:4:33", + "typeDescriptions": { + "typeIdentifier": "t_struct$_List_$4090_storage_ptr", + "typeString": "struct LinkedList.List storage pointer" + } + }, + "id": 4306, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "5296:5:33", + "memberName": "count", + "nodeType": "MemberAccess", + "referencedDeclaration": 4089, + "src": "5291:10:33", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "5258:56:33", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 4310, + "nodeType": "ExpressionStatement", + "src": "5258:56:33" + }, + { + "assignments": [ + 4312 + ], + "declarations": [ + { + "constant": false, + "id": 4312, + "mutability": "mutable", + "name": "cursor", + "nameLocation": "5333:6:33", + "nodeType": "VariableDeclaration", + "scope": 4362, + "src": "5325:14:33", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 4311, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "5325:7:33", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "id": 4315, + "initialValue": { + "expression": { + "id": 4313, + "name": "self", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4250, + "src": "5342:4:33", + "typeDescriptions": { + "typeIdentifier": "t_struct$_List_$4090_storage_ptr", + "typeString": "struct LinkedList.List storage pointer" + } + }, + "id": 4314, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "5347:4:33", + "memberName": "head", + "nodeType": "MemberAccess", + "referencedDeclaration": 4083, + "src": "5342:9:33", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "5325:26:33" + }, + { + "body": { + "id": 4356, + "nodeType": "Block", + "src": "5409:288:33", + "statements": [ + { + "assignments": [ + 4327, + 4329 + ], + "declarations": [ + { + "constant": false, + "id": 4327, + "mutability": "mutable", + "name": "shouldBreak", + "nameLocation": "5429:11:33", + "nodeType": "VariableDeclaration", + "scope": 4356, + "src": "5424:16:33", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 4326, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "5424:4:33", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 4329, + "mutability": "mutable", + "name": "acc_", + "nameLocation": "5455:4:33", + "nodeType": "VariableDeclaration", + "scope": 4356, + "src": "5442:17:33", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 4328, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "5442:5:33", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "id": 4334, + "initialValue": { + "arguments": [ + { + "id": 4331, + "name": "cursor", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4312, + "src": "5475:6:33", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "id": 4332, + "name": "processInitAcc", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4278, + "src": "5483:14:33", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 4330, + "name": "processItem", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4270, + "src": "5463:11:33", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$_t_bytes_memory_ptr_$returns$_t_bool_$_t_bytes_memory_ptr_$", + "typeString": "function (bytes32,bytes memory) returns (bool,bytes memory)" + } + }, + "id": 4333, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5463:35:33", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_bool_$_t_bytes_memory_ptr_$", + "typeString": "tuple(bool,bytes memory)" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "5423:75:33" + }, + { + "condition": { + "id": 4335, + "name": "shouldBreak", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4327, + "src": "5517:11:33", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 4337, + "nodeType": "IfStatement", + "src": "5513:22:33", + "trueBody": { + "id": 4336, + "nodeType": "Break", + "src": "5530:5:33" + } + }, + { + "expression": { + "id": 4340, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 4338, + "name": "processInitAcc", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4278, + "src": "5550:14:33", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "id": 4339, + "name": "acc_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4329, + "src": "5567:4:33", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "src": "5550:21:33", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 4341, + "nodeType": "ExpressionStatement", + "src": "5550:21:33" + }, + { + "expression": { + "id": 4348, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 4342, + "name": "cursor", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4312, + "src": "5585:6:33", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "id": 4345, + "name": "getNextItem", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4258, + "src": "5610:11:33", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_bytes32_$", + "typeString": "function (bytes32) view returns (bytes32)" + } + }, + { + "id": 4346, + "name": "deleteItem", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4276, + "src": "5623:10:33", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$returns$__$", + "typeString": "function (bytes32)" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_bytes32_$", + "typeString": "function (bytes32) view returns (bytes32)" + }, + { + "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$returns$__$", + "typeString": "function (bytes32)" + } + ], + "expression": { + "id": 4343, + "name": "self", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4250, + "src": "5594:4:33", + "typeDescriptions": { + "typeIdentifier": "t_struct$_List_$4090_storage_ptr", + "typeString": "struct LinkedList.List storage pointer" + } + }, + "id": 4344, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "5599:10:33", + "memberName": "removeHead", + "nodeType": "MemberAccess", + "referencedDeclaration": 4246, + "src": "5594:15:33", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_struct$_List_$4090_storage_ptr_$_t_function_internal_view$_t_bytes32_$returns$_t_bytes32_$_$_t_function_internal_nonpayable$_t_bytes32_$returns$__$_$returns$_t_bytes32_$attached_to$_t_struct$_List_$4090_storage_ptr_$", + "typeString": "function (struct LinkedList.List storage pointer,function (bytes32) view returns (bytes32),function (bytes32)) returns (bytes32)" + } + }, + "id": 4347, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5594:40:33", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "src": "5585:49:33", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "id": 4349, + "nodeType": "ExpressionStatement", + "src": "5585:49:33" + }, + { + "expression": { + "id": 4351, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "--", + "prefix": false, + "src": "5649:12:33", + "subExpression": { + "id": 4350, + "name": "iterations", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4280, + "src": "5649:10:33", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 4352, + "nodeType": "ExpressionStatement", + "src": "5649:12:33" + }, + { + "expression": { + "id": 4354, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "5675:11:33", + "subExpression": { + "id": 4353, + "name": "itemCount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4297, + "src": "5675:9:33", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 4355, + "nodeType": "ExpressionStatement", + "src": "5675:11:33" + } + ] + }, + "condition": { + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 4325, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "commonType": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "id": 4321, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 4316, + "name": "cursor", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4312, + "src": "5369:6:33", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "arguments": [ + { + "hexValue": "30", + "id": 4319, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "5387:1:33", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 4318, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "5379:7:33", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes32_$", + "typeString": "type(bytes32)" + }, + "typeName": { + "id": 4317, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "5379:7:33", + "typeDescriptions": {} + } + }, + "id": 4320, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5379:10:33", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "src": "5369:20:33", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "&&", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 4324, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 4322, + "name": "iterations", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4280, + "src": "5393:10:33", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "hexValue": "30", + "id": 4323, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "5406:1:33", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "5393:14:33", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "5369:38:33", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 4357, + "nodeType": "WhileStatement", + "src": "5362:335:33" + }, + { + "expression": { + "components": [ + { + "id": 4358, + "name": "itemCount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4297, + "src": "5715:9:33", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 4359, + "name": "processInitAcc", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4278, + "src": "5726:14:33", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "id": 4360, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "5714:27:33", + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_uint256_$_t_bytes_memory_ptr_$", + "typeString": "tuple(uint256,bytes memory)" + } + }, + "functionReturnParameters": 4286, + "id": 4361, + "nodeType": "Return", + "src": "5707:34:33" + } + ] + }, + "documentation": { + "id": 4247, + "nodeType": "StructuredDocumentation", + "src": "3753:1045:33", + "text": " @notice Traverses the list and processes each item.\n It deletes the processed items from both the list and the storage mapping.\n @param self The list metadata\n @param getNextItem A function to get the next item in the list. It should take\n the id of the current item and return the id of the next item.\n @param processItem A function to process an item. The function should take the id of the item\n and an accumulator, and return:\n - a boolean indicating whether the traversal should stop\n - an accumulator to pass data between iterations\n @param deleteItem A function to delete an item. This should delete the item from\n the contract storage. It takes the id of the item to delete.\n @param processInitAcc The initial accumulator data\n @param iterations The maximum number of iterations to perform. If 0, the traversal will continue\n until the end of the list.\n @return The number of items processed\n @return The final accumulator data." + }, + "id": 4363, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "traverse", + "nameLocation": "4812:8:33", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 4281, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 4250, + "mutability": "mutable", + "name": "self", + "nameLocation": "4843:4:33", + "nodeType": "VariableDeclaration", + "scope": 4363, + "src": "4830:17:33", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_List_$4090_storage_ptr", + "typeString": "struct LinkedList.List" + }, + "typeName": { + "id": 4249, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 4248, + "name": "List", + "nameLocations": [ + "4830:4:33" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 4090, + "src": "4830:4:33" + }, + "referencedDeclaration": 4090, + "src": "4830:4:33", + "typeDescriptions": { + "typeIdentifier": "t_struct$_List_$4090_storage_ptr", + "typeString": "struct LinkedList.List" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 4258, + "mutability": "mutable", + "name": "getNextItem", + "nameLocation": "4898:11:33", + "nodeType": "VariableDeclaration", + "scope": 4363, + "src": "4857:52:33", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_bytes32_$", + "typeString": "function (bytes32) view returns (bytes32)" + }, + "typeName": { + "id": 4257, + "nodeType": "FunctionTypeName", + "parameterTypes": { + "id": 4253, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 4252, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 4257, + "src": "4866:7:33", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 4251, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "4866:7:33", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "4865:9:33" + }, + "returnParameterTypes": { + "id": 4256, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 4255, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 4257, + "src": "4889:7:33", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 4254, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "4889:7:33", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "4888:9:33" + }, + "src": "4857:52:33", + "stateMutability": "view", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_bytes32_$", + "typeString": "function (bytes32) view returns (bytes32)" + }, + "visibility": "internal" + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 4270, + "mutability": "mutable", + "name": "processItem", + "nameLocation": "4980:11:33", + "nodeType": "VariableDeclaration", + "scope": 4363, + "src": "4919:72:33", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$_t_bytes_memory_ptr_$returns$_t_bool_$_t_bytes_memory_ptr_$", + "typeString": "function (bytes32,bytes) returns (bool,bytes)" + }, + "typeName": { + "id": 4269, + "nodeType": "FunctionTypeName", + "parameterTypes": { + "id": 4263, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 4260, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 4269, + "src": "4928:7:33", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 4259, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "4928:7:33", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 4262, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 4269, + "src": "4937:12:33", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 4261, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "4937:5:33", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "src": "4927:23:33" + }, + "returnParameterTypes": { + "id": 4268, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 4265, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 4269, + "src": "4960:4:33", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 4264, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "4960:4:33", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 4267, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 4269, + "src": "4966:12:33", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 4266, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "4966:5:33", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "src": "4959:20:33" + }, + "src": "4919:72:33", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$_t_bytes_memory_ptr_$returns$_t_bool_$_t_bytes_memory_ptr_$", + "typeString": "function (bytes32,bytes) returns (bool,bytes)" + }, + "visibility": "internal" + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 4276, + "mutability": "mutable", + "name": "deleteItem", + "nameLocation": "5019:10:33", + "nodeType": "VariableDeclaration", + "scope": 4363, + "src": "5001:28:33", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$returns$__$", + "typeString": "function (bytes32)" + }, + "typeName": { + "id": 4275, + "nodeType": "FunctionTypeName", + "parameterTypes": { + "id": 4273, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 4272, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 4275, + "src": "5010:7:33", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 4271, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "5010:7:33", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "5009:9:33" + }, + "returnParameterTypes": { + "id": 4274, + "nodeType": "ParameterList", + "parameters": [], + "src": "5019:0:33" + }, + "src": "5001:28:33", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$returns$__$", + "typeString": "function (bytes32)" + }, + "visibility": "internal" + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 4278, + "mutability": "mutable", + "name": "processInitAcc", + "nameLocation": "5052:14:33", + "nodeType": "VariableDeclaration", + "scope": 4363, + "src": "5039:27:33", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 4277, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "5039:5:33", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 4280, + "mutability": "mutable", + "name": "iterations", + "nameLocation": "5084:10:33", + "nodeType": "VariableDeclaration", + "scope": 4363, + "src": "5076:18:33", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4279, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "5076:7:33", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "4820:280:33" + }, + "returnParameters": { + "id": 4286, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 4283, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 4363, + "src": "5119:7:33", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4282, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "5119:7:33", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 4285, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 4363, + "src": "5128:12:33", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 4284, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "5128:5:33", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "src": "5118:23:33" + }, + "scope": 4364, + "src": "4803:945:33", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + } + ], + "scope": 4365, + "src": "786:4964:33", + "usedErrors": [ + 4104, + 4107, + 4110, + 4113 + ], + "usedEvents": [] + } + ], + "src": "46:5705:33" + }, + "id": 33 + }, + "@graphprotocol/horizon/contracts/libraries/MathUtils.sol": { + "ast": { + "absolutePath": "@graphprotocol/horizon/contracts/libraries/MathUtils.sol", + "exportedSymbols": { + "MathUtils": [ + 4445 + ] + }, + "id": 4446, + "license": "GPL-2.0-or-later", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 4366, + "literals": [ + "solidity", + "0.8", + ".27" + ], + "nodeType": "PragmaDirective", + "src": "46:23:34" + }, + { + "abstract": false, + "baseContracts": [], + "canonicalName": "MathUtils", + "contractDependencies": [], + "contractKind": "library", + "documentation": { + "id": 4367, + "nodeType": "StructuredDocumentation", + "src": "71:239:34", + "text": " @title MathUtils Library\n @notice A collection of functions to perform math operations\n @custom:security-contact Please email security+contracts@thegraph.com if you find any\n bugs. We may have an active bug bounty program." + }, + "fullyImplemented": true, + "id": 4445, + "linearizedBaseContracts": [ + 4445 + ], + "name": "MathUtils", + "nameLocation": "319:9:34", + "nodeType": "ContractDefinition", + "nodes": [ + { + "body": { + "id": 4404, + "nodeType": "Block", + "src": "1029:113:34", + "statements": [ + { + "expression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 4402, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 4396, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 4389, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 4383, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 4381, + "name": "valueA", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4370, + "src": "1048:6:34", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "*", + "rightExpression": { + "id": 4382, + "name": "weightA", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4372, + "src": "1057:7:34", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "1048:16:34", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 4384, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "1047:18:34", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 4387, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 4385, + "name": "valueB", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4374, + "src": "1069:6:34", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "*", + "rightExpression": { + "id": 4386, + "name": "weightB", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4376, + "src": "1078:7:34", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "1069:16:34", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 4388, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "1068:18:34", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "1047:39:34", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 4394, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 4392, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 4390, + "name": "weightA", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4372, + "src": "1090:7:34", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "id": 4391, + "name": "weightB", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4376, + "src": "1100:7:34", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "1090:17:34", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "hexValue": "31", + "id": 4393, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1110:1:34", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "1090:21:34", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 4395, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "1089:23:34", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "1047:65:34", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 4397, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "1046:67:34", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "/", + "rightExpression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 4400, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 4398, + "name": "weightA", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4372, + "src": "1117:7:34", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "id": 4399, + "name": "weightB", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4376, + "src": "1127:7:34", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "1117:17:34", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 4401, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "1116:19:34", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "1046:89:34", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 4380, + "id": 4403, + "nodeType": "Return", + "src": "1039:96:34" + } + ] + }, + "documentation": { + "id": 4368, + "nodeType": "StructuredDocumentation", + "src": "335:518:34", + "text": " @dev Calculates the weighted average of two values pondering each of these\n values based on configured weights. The contribution of each value N is\n weightN/(weightA + weightB). The calculation rounds up to ensure the result\n is always equal or greater than the smallest of the two values.\n @param valueA The amount for value A\n @param weightA The weight to use for value A\n @param valueB The amount for value B\n @param weightB The weight to use for value B" + }, + "id": 4405, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "weightedAverageRoundingUp", + "nameLocation": "867:25:34", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 4377, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 4370, + "mutability": "mutable", + "name": "valueA", + "nameLocation": "910:6:34", + "nodeType": "VariableDeclaration", + "scope": 4405, + "src": "902:14:34", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4369, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "902:7:34", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 4372, + "mutability": "mutable", + "name": "weightA", + "nameLocation": "934:7:34", + "nodeType": "VariableDeclaration", + "scope": 4405, + "src": "926:15:34", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4371, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "926:7:34", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 4374, + "mutability": "mutable", + "name": "valueB", + "nameLocation": "959:6:34", + "nodeType": "VariableDeclaration", + "scope": 4405, + "src": "951:14:34", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4373, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "951:7:34", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 4376, + "mutability": "mutable", + "name": "weightB", + "nameLocation": "983:7:34", + "nodeType": "VariableDeclaration", + "scope": 4405, + "src": "975:15:34", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4375, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "975:7:34", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "892:104:34" + }, + "returnParameters": { + "id": 4380, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 4379, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 4405, + "src": "1020:7:34", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4378, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1020:7:34", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "1019:9:34" + }, + "scope": 4445, + "src": "858:284:34", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 4422, + "nodeType": "Block", + "src": "1392:38:34", + "statements": [ + { + "expression": { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 4417, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 4415, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4408, + "src": "1409:1:34", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "id": 4416, + "name": "y", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4410, + "src": "1414:1:34", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "1409:6:34", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseExpression": { + "id": 4419, + "name": "y", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4410, + "src": "1422:1:34", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 4420, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "Conditional", + "src": "1409:14:34", + "trueExpression": { + "id": 4418, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4408, + "src": "1418:1:34", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 4414, + "id": 4421, + "nodeType": "Return", + "src": "1402:21:34" + } + ] + }, + "documentation": { + "id": 4406, + "nodeType": "StructuredDocumentation", + "src": "1148:172:34", + "text": " @dev Returns the minimum of two numbers.\n @param x The first number\n @param y The second number\n @return The minimum of the two numbers" + }, + "id": 4423, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "min", + "nameLocation": "1334:3:34", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 4411, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 4408, + "mutability": "mutable", + "name": "x", + "nameLocation": "1346:1:34", + "nodeType": "VariableDeclaration", + "scope": 4423, + "src": "1338:9:34", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4407, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1338:7:34", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 4410, + "mutability": "mutable", + "name": "y", + "nameLocation": "1357:1:34", + "nodeType": "VariableDeclaration", + "scope": 4423, + "src": "1349:9:34", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4409, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1349:7:34", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "1337:22:34" + }, + "returnParameters": { + "id": 4414, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 4413, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 4423, + "src": "1383:7:34", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4412, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1383:7:34", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "1382:9:34" + }, + "scope": 4445, + "src": "1325:105:34", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 4443, + "nodeType": "Block", + "src": "1743:43:34", + "statements": [ + { + "expression": { + "condition": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 4435, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 4433, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4426, + "src": "1761:1:34", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "id": 4434, + "name": "y", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4428, + "src": "1765:1:34", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "1761:5:34", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "id": 4436, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "1760:7:34", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseExpression": { + "hexValue": "30", + "id": 4440, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1778:1:34", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "id": 4441, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "Conditional", + "src": "1760:19:34", + "trueExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 4439, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 4437, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4426, + "src": "1770:1:34", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "id": 4438, + "name": "y", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4428, + "src": "1774:1:34", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "1770:5:34", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 4432, + "id": 4442, + "nodeType": "Return", + "src": "1753:26:34" + } + ] + }, + "documentation": { + "id": 4424, + "nodeType": "StructuredDocumentation", + "src": "1436:228:34", + "text": " @dev Returns the difference between two numbers or zero if negative.\n @param x The first number\n @param y The second number\n @return The difference between the two numbers or zero if negative" + }, + "id": 4444, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "diffOrZero", + "nameLocation": "1678:10:34", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 4429, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 4426, + "mutability": "mutable", + "name": "x", + "nameLocation": "1697:1:34", + "nodeType": "VariableDeclaration", + "scope": 4444, + "src": "1689:9:34", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4425, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1689:7:34", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 4428, + "mutability": "mutable", + "name": "y", + "nameLocation": "1708:1:34", + "nodeType": "VariableDeclaration", + "scope": 4444, + "src": "1700:9:34", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4427, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1700:7:34", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "1688:22:34" + }, + "returnParameters": { + "id": 4432, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 4431, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 4444, + "src": "1734:7:34", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4430, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1734:7:34", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "1733:9:34" + }, + "scope": 4445, + "src": "1669:117:34", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + } + ], + "scope": 4446, + "src": "311:1477:34", + "usedErrors": [], + "usedEvents": [] + } + ], + "src": "46:1743:34" + }, + "id": 34 + }, + "@graphprotocol/horizon/contracts/libraries/PPMMath.sol": { + "ast": { + "absolutePath": "@graphprotocol/horizon/contracts/libraries/PPMMath.sol", + "exportedSymbols": { + "PPMMath": [ + 4539 + ] + }, + "id": 4540, + "license": "GPL-3.0-or-later", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 4447, + "literals": [ + "solidity", + "0.8", + ".27" + ], + "nodeType": "PragmaDirective", + "src": "45:23:35" + }, + { + "abstract": false, + "baseContracts": [], + "canonicalName": "PPMMath", + "contractDependencies": [], + "contractKind": "library", + "documentation": { + "id": 4448, + "nodeType": "StructuredDocumentation", + "src": "70:258:35", + "text": " @title PPMMath library\n @notice A library for handling calculations with parts per million (PPM) amounts.\n @custom:security-contact Please email security+contracts@thegraph.com if you find any\n bugs. We may have an active bug bounty program." + }, + "fullyImplemented": true, + "id": 4539, + "linearizedBaseContracts": [ + 4539 + ], + "name": "PPMMath", + "nameLocation": "337:7:35", + "nodeType": "ContractDefinition", + "nodes": [ + { + "constant": true, + "documentation": { + "id": 4449, + "nodeType": "StructuredDocumentation", + "src": "351:60:35", + "text": "@notice Maximum value (100%) in parts per million (PPM)." + }, + "id": 4452, + "mutability": "constant", + "name": "MAX_PPM", + "nameLocation": "442:7:35", + "nodeType": "VariableDeclaration", + "scope": 4539, + "src": "416:45:35", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4450, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "416:7:35", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": { + "hexValue": "315f3030305f303030", + "id": 4451, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "452:9:35", + "typeDescriptions": { + "typeIdentifier": "t_rational_1000000_by_1", + "typeString": "int_const 1000000" + }, + "value": "1_000_000" + }, + "visibility": "internal" + }, + { + "documentation": { + "id": 4453, + "nodeType": "StructuredDocumentation", + "src": "468:133:35", + "text": " @notice Thrown when a value is expected to be in PPM but is not.\n @param value The value that is not in PPM." + }, + "errorSelector": "3dc311df", + "id": 4457, + "name": "PPMMathInvalidPPM", + "nameLocation": "612:17:35", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 4456, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 4455, + "mutability": "mutable", + "name": "value", + "nameLocation": "638:5:35", + "nodeType": "VariableDeclaration", + "scope": 4457, + "src": "630:13:35", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4454, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "630:7:35", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "629:15:35" + }, + "src": "606:39:35" + }, + { + "documentation": { + "id": 4458, + "nodeType": "StructuredDocumentation", + "src": "651:189:35", + "text": " @notice Thrown when no value in a multiplication is in PPM.\n @param a The first value in the multiplication.\n @param b The second value in the multiplication." + }, + "errorSelector": "ed17e1d6", + "id": 4464, + "name": "PPMMathInvalidMulPPM", + "nameLocation": "851:20:35", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 4463, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 4460, + "mutability": "mutable", + "name": "a", + "nameLocation": "880:1:35", + "nodeType": "VariableDeclaration", + "scope": 4464, + "src": "872:9:35", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4459, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "872:7:35", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 4462, + "mutability": "mutable", + "name": "b", + "nameLocation": "891:1:35", + "nodeType": "VariableDeclaration", + "scope": 4464, + "src": "883:9:35", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4461, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "883:7:35", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "871:22:35" + }, + "src": "845:49:35" + }, + { + "body": { + "id": 4495, + "nodeType": "Block", + "src": "1169:118:35", + "statements": [ + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 4481, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "arguments": [ + { + "id": 4476, + "name": "a", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4467, + "src": "1198:1:35", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 4475, + "name": "isValidPPM", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4538, + "src": "1187:10:35", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$returns$_t_bool_$", + "typeString": "function (uint256) pure returns (bool)" + } + }, + "id": 4477, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "1187:13:35", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "||", + "rightExpression": { + "arguments": [ + { + "id": 4479, + "name": "b", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4469, + "src": "1215:1:35", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 4478, + "name": "isValidPPM", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4538, + "src": "1204:10:35", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$returns$_t_bool_$", + "typeString": "function (uint256) pure returns (bool)" + } + }, + "id": 4480, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "1204:13:35", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "1187:30:35", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [ + { + "id": 4483, + "name": "a", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4467, + "src": "1240:1:35", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 4484, + "name": "b", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4469, + "src": "1243:1:35", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 4482, + "name": "PPMMathInvalidMulPPM", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4464, + "src": "1219:20:35", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint256_$_t_uint256_$returns$_t_error_$", + "typeString": "function (uint256,uint256) pure returns (error)" + } + }, + "id": 4485, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "1219:26:35", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 4474, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "1179:7:35", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 4486, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "1179:67:35", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 4487, + "nodeType": "ExpressionStatement", + "src": "1179:67:35" + }, + { + "expression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 4493, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 4490, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 4488, + "name": "a", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4467, + "src": "1264:1:35", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "*", + "rightExpression": { + "id": 4489, + "name": "b", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4469, + "src": "1268:1:35", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "1264:5:35", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 4491, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "1263:7:35", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "/", + "rightExpression": { + "id": 4492, + "name": "MAX_PPM", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4452, + "src": "1273:7:35", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "1263:17:35", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 4473, + "id": 4494, + "nodeType": "Return", + "src": "1256:24:35" + } + ] + }, + "documentation": { + "id": 4465, + "nodeType": "StructuredDocumentation", + "src": "900:194:35", + "text": " @notice Multiplies two values, one of which must be in PPM.\n @param a The first value.\n @param b The second value.\n @return The result of the multiplication." + }, + "id": 4496, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "mulPPM", + "nameLocation": "1108:6:35", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 4470, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 4467, + "mutability": "mutable", + "name": "a", + "nameLocation": "1123:1:35", + "nodeType": "VariableDeclaration", + "scope": 4496, + "src": "1115:9:35", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4466, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1115:7:35", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 4469, + "mutability": "mutable", + "name": "b", + "nameLocation": "1134:1:35", + "nodeType": "VariableDeclaration", + "scope": 4496, + "src": "1126:9:35", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4468, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1126:7:35", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "1114:22:35" + }, + "returnParameters": { + "id": 4473, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 4472, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 4496, + "src": "1160:7:35", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4471, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1160:7:35", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "1159:9:35" + }, + "scope": 4539, + "src": "1099:188:35", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 4524, + "nodeType": "Block", + "src": "1665:104:35", + "statements": [ + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "id": 4508, + "name": "b", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4501, + "src": "1694:1:35", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 4507, + "name": "isValidPPM", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4538, + "src": "1683:10:35", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$returns$_t_bool_$", + "typeString": "function (uint256) pure returns (bool)" + } + }, + "id": 4509, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "1683:13:35", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [ + { + "id": 4511, + "name": "b", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4501, + "src": "1716:1:35", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 4510, + "name": "PPMMathInvalidPPM", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4457, + "src": "1698:17:35", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint256_$returns$_t_error_$", + "typeString": "function (uint256) pure returns (error)" + } + }, + "id": 4512, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "1698:20:35", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 4506, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "1675:7:35", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 4513, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "1675:44:35", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 4514, + "nodeType": "ExpressionStatement", + "src": "1675:44:35" + }, + { + "expression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 4522, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 4515, + "name": "a", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4499, + "src": "1736:1:35", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "arguments": [ + { + "id": 4517, + "name": "a", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4499, + "src": "1747:1:35", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 4520, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 4518, + "name": "MAX_PPM", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4452, + "src": "1750:7:35", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "id": 4519, + "name": "b", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4501, + "src": "1760:1:35", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "1750:11:35", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 4516, + "name": "mulPPM", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4496, + "src": "1740:6:35", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 4521, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "1740:22:35", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "1736:26:35", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 4505, + "id": 4523, + "nodeType": "Return", + "src": "1729:33:35" + } + ] + }, + "documentation": { + "id": 4497, + "nodeType": "StructuredDocumentation", + "src": "1293:290:35", + "text": " @notice Multiplies two values, the second one must be in PPM, and rounds up the result.\n @dev requirements:\n - The second value must be in PPM.\n @param a The first value.\n @param b The second value.\n @return The result of the multiplication." + }, + "id": 4525, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "mulPPMRoundUp", + "nameLocation": "1597:13:35", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 4502, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 4499, + "mutability": "mutable", + "name": "a", + "nameLocation": "1619:1:35", + "nodeType": "VariableDeclaration", + "scope": 4525, + "src": "1611:9:35", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4498, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1611:7:35", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 4501, + "mutability": "mutable", + "name": "b", + "nameLocation": "1630:1:35", + "nodeType": "VariableDeclaration", + "scope": 4525, + "src": "1622:9:35", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4500, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1622:7:35", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "1610:22:35" + }, + "returnParameters": { + "id": 4505, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 4504, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 4525, + "src": "1656:7:35", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4503, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1656:7:35", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "1655:9:35" + }, + "scope": 4539, + "src": "1588:181:35", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 4537, + "nodeType": "Block", + "src": "2056:40:35", + "statements": [ + { + "expression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 4535, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 4533, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4528, + "src": "2073:5:35", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "id": 4534, + "name": "MAX_PPM", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4452, + "src": "2082:7:35", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "2073:16:35", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "functionReturnParameters": 4532, + "id": 4536, + "nodeType": "Return", + "src": "2066:23:35" + } + ] + }, + "documentation": { + "id": 4526, + "nodeType": "StructuredDocumentation", + "src": "1775:212:35", + "text": " @notice Checks if a value is in PPM.\n @dev A valid PPM value is between 0 and MAX_PPM.\n @param value The value to check.\n @return true if the value is in PPM, false otherwise." + }, + "id": 4538, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "isValidPPM", + "nameLocation": "2001:10:35", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 4529, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 4528, + "mutability": "mutable", + "name": "value", + "nameLocation": "2020:5:35", + "nodeType": "VariableDeclaration", + "scope": 4538, + "src": "2012:13:35", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4527, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2012:7:35", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "2011:15:35" + }, + "returnParameters": { + "id": 4532, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 4531, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 4538, + "src": "2050:4:35", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 4530, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "2050:4:35", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "src": "2049:6:35" + }, + "scope": 4539, + "src": "1992:104:35", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + } + ], + "scope": 4540, + "src": "329:1769:35", + "usedErrors": [ + 4457, + 4464 + ], + "usedEvents": [] + } + ], + "src": "45:2054:35" + }, + "id": 35 + }, + "@graphprotocol/horizon/contracts/libraries/UintRange.sol": { + "ast": { + "absolutePath": "@graphprotocol/horizon/contracts/libraries/UintRange.sol", + "exportedSymbols": { + "UintRange": [ + 4564 + ] + }, + "id": 4565, + "license": "GPL-3.0-or-later", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 4541, + "literals": [ + "solidity", + "0.8", + ".27" + ], + "nodeType": "PragmaDirective", + "src": "45:23:36" + }, + { + "abstract": false, + "baseContracts": [], + "canonicalName": "UintRange", + "contractDependencies": [], + "contractKind": "library", + "documentation": { + "id": 4542, + "nodeType": "StructuredDocumentation", + "src": "70:241:36", + "text": " @title UintRange library\n @notice A library for handling range checks on uint256 values.\n @custom:security-contact Please email security+contracts@thegraph.com if you find any\n bugs. We may have an active bug bounty program." + }, + "fullyImplemented": true, + "id": 4564, + "linearizedBaseContracts": [ + 4564 + ], + "name": "UintRange", + "nameLocation": "320:9:36", + "nodeType": "ContractDefinition", + "nodes": [ + { + "body": { + "id": 4562, + "nodeType": "Block", + "src": "713:52:36", + "statements": [ + { + "expression": { + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 4560, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 4556, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 4554, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4545, + "src": "730:5:36", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "id": 4555, + "name": "min", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4547, + "src": "739:3:36", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "730:12:36", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "&&", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 4559, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 4557, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4545, + "src": "746:5:36", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "id": 4558, + "name": "max", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4549, + "src": "755:3:36", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "746:12:36", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "730:28:36", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "functionReturnParameters": 4553, + "id": 4561, + "nodeType": "Return", + "src": "723:35:36" + } + ] + }, + "documentation": { + "id": 4543, + "nodeType": "StructuredDocumentation", + "src": "336:283:36", + "text": " @notice Checks if a value is in the range [`min`, `max`].\n @param value The value to check.\n @param min The minimum value of the range.\n @param max The maximum value of the range.\n @return true if the value is in the range, false otherwise." + }, + "id": 4563, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "isInRange", + "nameLocation": "633:9:36", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 4550, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 4545, + "mutability": "mutable", + "name": "value", + "nameLocation": "651:5:36", + "nodeType": "VariableDeclaration", + "scope": 4563, + "src": "643:13:36", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4544, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "643:7:36", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 4547, + "mutability": "mutable", + "name": "min", + "nameLocation": "666:3:36", + "nodeType": "VariableDeclaration", + "scope": 4563, + "src": "658:11:36", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4546, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "658:7:36", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 4549, + "mutability": "mutable", + "name": "max", + "nameLocation": "679:3:36", + "nodeType": "VariableDeclaration", + "scope": 4563, + "src": "671:11:36", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4548, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "671:7:36", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "642:41:36" + }, + "returnParameters": { + "id": 4553, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 4552, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 4563, + "src": "707:4:36", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 4551, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "707:4:36", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "src": "706:6:36" + }, + "scope": 4564, + "src": "624:141:36", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + } + ], + "scope": 4565, + "src": "312:455:36", + "usedErrors": [], + "usedEvents": [] + } + ], + "src": "45:723:36" + }, + "id": 36 + }, + "@graphprotocol/horizon/contracts/utilities/GraphDirectory.sol": { + "ast": { + "absolutePath": "@graphprotocol/horizon/contracts/utilities/GraphDirectory.sol", + "exportedSymbols": { + "GraphDirectory": [ + 4928 + ], + "IController": [ + 441 + ], + "ICuration": [ + 165 + ], + "IEpochManager": [ + 369 + ], + "IGraphPayments": [ + 2489 + ], + "IGraphProxyAdmin": [ + 2493 + ], + "IGraphToken": [ + 758 + ], + "IHorizonStaking": [ + 2625 + ], + "IPaymentsEscrow": [ + 2858 + ], + "IRewardsManager": [ + 678 + ], + "ITokenGateway": [ + 41 + ] + }, + "id": 4929, + "license": "GPL-2.0-or-later", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 4566, + "literals": [ + "solidity", + "0.8", + ".27" + ], + "nodeType": "PragmaDirective", + "src": "46:23:37" + }, + { + "absolutePath": "@graphprotocol/contracts/contracts/token/IGraphToken.sol", + "file": "@graphprotocol/contracts/contracts/token/IGraphToken.sol", + "id": 4568, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 4929, + "sourceUnit": 759, + "src": "71:87:37", + "symbolAliases": [ + { + "foreign": { + "id": 4567, + "name": "IGraphToken", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 758, + "src": "80:11:37", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "@graphprotocol/horizon/contracts/interfaces/IHorizonStaking.sol", + "file": "../interfaces/IHorizonStaking.sol", + "id": 4570, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 4929, + "sourceUnit": 2626, + "src": "159:68:37", + "symbolAliases": [ + { + "foreign": { + "id": 4569, + "name": "IHorizonStaking", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2625, + "src": "168:15:37", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "@graphprotocol/horizon/contracts/interfaces/IGraphPayments.sol", + "file": "../interfaces/IGraphPayments.sol", + "id": 4572, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 4929, + "sourceUnit": 2490, + "src": "228:66:37", + "symbolAliases": [ + { + "foreign": { + "id": 4571, + "name": "IGraphPayments", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2489, + "src": "237:14:37", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "@graphprotocol/horizon/contracts/interfaces/IPaymentsEscrow.sol", + "file": "../interfaces/IPaymentsEscrow.sol", + "id": 4574, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 4929, + "sourceUnit": 2859, + "src": "295:68:37", + "symbolAliases": [ + { + "foreign": { + "id": 4573, + "name": "IPaymentsEscrow", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2858, + "src": "304:15:37", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "@graphprotocol/contracts/contracts/governance/IController.sol", + "file": "@graphprotocol/contracts/contracts/governance/IController.sol", + "id": 4576, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 4929, + "sourceUnit": 442, + "src": "365:92:37", + "symbolAliases": [ + { + "foreign": { + "id": 4575, + "name": "IController", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 441, + "src": "374:11:37", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "@graphprotocol/contracts/contracts/epochs/IEpochManager.sol", + "file": "@graphprotocol/contracts/contracts/epochs/IEpochManager.sol", + "id": 4578, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 4929, + "sourceUnit": 370, + "src": "458:92:37", + "symbolAliases": [ + { + "foreign": { + "id": 4577, + "name": "IEpochManager", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 369, + "src": "467:13:37", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "@graphprotocol/contracts/contracts/rewards/IRewardsManager.sol", + "file": "@graphprotocol/contracts/contracts/rewards/IRewardsManager.sol", + "id": 4580, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 4929, + "sourceUnit": 679, + "src": "551:97:37", + "symbolAliases": [ + { + "foreign": { + "id": 4579, + "name": "IRewardsManager", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 678, + "src": "560:15:37", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "@graphprotocol/contracts/contracts/arbitrum/ITokenGateway.sol", + "file": "@graphprotocol/contracts/contracts/arbitrum/ITokenGateway.sol", + "id": 4582, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 4929, + "sourceUnit": 42, + "src": "649:94:37", + "symbolAliases": [ + { + "foreign": { + "id": 4581, + "name": "ITokenGateway", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 41, + "src": "658:13:37", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "@graphprotocol/horizon/contracts/interfaces/IGraphProxyAdmin.sol", + "file": "../interfaces/IGraphProxyAdmin.sol", + "id": 4584, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 4929, + "sourceUnit": 2494, + "src": "744:70:37", + "symbolAliases": [ + { + "foreign": { + "id": 4583, + "name": "IGraphProxyAdmin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2493, + "src": "753:16:37", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "@graphprotocol/contracts/contracts/curation/ICuration.sol", + "file": "@graphprotocol/contracts/contracts/curation/ICuration.sol", + "id": 4586, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 4929, + "sourceUnit": 166, + "src": "816:86:37", + "symbolAliases": [ + { + "foreign": { + "id": 4585, + "name": "ICuration", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 165, + "src": "825:9:37", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "abstract": true, + "baseContracts": [], + "canonicalName": "GraphDirectory", + "contractDependencies": [], + "contractKind": "contract", + "documentation": { + "id": 4587, + "nodeType": "StructuredDocumentation", + "src": "904:315:37", + "text": " @title GraphDirectory contract\n @notice This contract is meant to be inherited by other contracts that\n need to keep track of the addresses in Graph Horizon contracts.\n It fetches the addresses from the Controller supplied during construction,\n and uses immutable variables to minimize gas costs." + }, + "fullyImplemented": true, + "id": 4928, + "linearizedBaseContracts": [ + 4928 + ], + "name": "GraphDirectory", + "nameLocation": "1238:14:37", + "nodeType": "ContractDefinition", + "nodes": [ + { + "constant": false, + "documentation": { + "id": 4588, + "nodeType": "StructuredDocumentation", + "src": "1297:44:37", + "text": "@notice The Graph Token contract address" + }, + "id": 4591, + "mutability": "immutable", + "name": "GRAPH_TOKEN", + "nameLocation": "1376:11:37", + "nodeType": "VariableDeclaration", + "scope": 4928, + "src": "1346:41:37", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IGraphToken_$758", + "typeString": "contract IGraphToken" + }, + "typeName": { + "id": 4590, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 4589, + "name": "IGraphToken", + "nameLocations": [ + "1346:11:37" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 758, + "src": "1346:11:37" + }, + "referencedDeclaration": 758, + "src": "1346:11:37", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IGraphToken_$758", + "typeString": "contract IGraphToken" + } + }, + "visibility": "private" + }, + { + "constant": false, + "documentation": { + "id": 4592, + "nodeType": "StructuredDocumentation", + "src": "1394:48:37", + "text": "@notice The Horizon Staking contract address" + }, + "id": 4595, + "mutability": "immutable", + "name": "GRAPH_STAKING", + "nameLocation": "1481:13:37", + "nodeType": "VariableDeclaration", + "scope": 4928, + "src": "1447:47:37", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IHorizonStaking_$2625", + "typeString": "contract IHorizonStaking" + }, + "typeName": { + "id": 4594, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 4593, + "name": "IHorizonStaking", + "nameLocations": [ + "1447:15:37" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 2625, + "src": "1447:15:37" + }, + "referencedDeclaration": 2625, + "src": "1447:15:37", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IHorizonStaking_$2625", + "typeString": "contract IHorizonStaking" + } + }, + "visibility": "private" + }, + { + "constant": false, + "documentation": { + "id": 4596, + "nodeType": "StructuredDocumentation", + "src": "1501:47:37", + "text": "@notice The Graph Payments contract address" + }, + "id": 4599, + "mutability": "immutable", + "name": "GRAPH_PAYMENTS", + "nameLocation": "1586:14:37", + "nodeType": "VariableDeclaration", + "scope": 4928, + "src": "1553:47:37", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IGraphPayments_$2489", + "typeString": "contract IGraphPayments" + }, + "typeName": { + "id": 4598, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 4597, + "name": "IGraphPayments", + "nameLocations": [ + "1553:14:37" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 2489, + "src": "1553:14:37" + }, + "referencedDeclaration": 2489, + "src": "1553:14:37", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IGraphPayments_$2489", + "typeString": "contract IGraphPayments" + } + }, + "visibility": "private" + }, + { + "constant": false, + "documentation": { + "id": 4600, + "nodeType": "StructuredDocumentation", + "src": "1607:48:37", + "text": "@notice The Payments Escrow contract address" + }, + "id": 4603, + "mutability": "immutable", + "name": "GRAPH_PAYMENTS_ESCROW", + "nameLocation": "1694:21:37", + "nodeType": "VariableDeclaration", + "scope": 4928, + "src": "1660:55:37", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IPaymentsEscrow_$2858", + "typeString": "contract IPaymentsEscrow" + }, + "typeName": { + "id": 4602, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 4601, + "name": "IPaymentsEscrow", + "nameLocations": [ + "1660:15:37" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 2858, + "src": "1660:15:37" + }, + "referencedDeclaration": 2858, + "src": "1660:15:37", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IPaymentsEscrow_$2858", + "typeString": "contract IPaymentsEscrow" + } + }, + "visibility": "private" + }, + { + "constant": false, + "documentation": { + "id": 4604, + "nodeType": "StructuredDocumentation", + "src": "1762:49:37", + "text": "@notice The Graph Controller contract address" + }, + "id": 4607, + "mutability": "immutable", + "name": "GRAPH_CONTROLLER", + "nameLocation": "1846:16:37", + "nodeType": "VariableDeclaration", + "scope": 4928, + "src": "1816:46:37", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IController_$441", + "typeString": "contract IController" + }, + "typeName": { + "id": 4606, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 4605, + "name": "IController", + "nameLocations": [ + "1816:11:37" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 441, + "src": "1816:11:37" + }, + "referencedDeclaration": 441, + "src": "1816:11:37", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IController_$441", + "typeString": "contract IController" + } + }, + "visibility": "private" + }, + { + "constant": false, + "documentation": { + "id": 4608, + "nodeType": "StructuredDocumentation", + "src": "1869:46:37", + "text": "@notice The Epoch Manager contract address" + }, + "id": 4611, + "mutability": "immutable", + "name": "GRAPH_EPOCH_MANAGER", + "nameLocation": "1952:19:37", + "nodeType": "VariableDeclaration", + "scope": 4928, + "src": "1920:51:37", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IEpochManager_$369", + "typeString": "contract IEpochManager" + }, + "typeName": { + "id": 4610, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 4609, + "name": "IEpochManager", + "nameLocations": [ + "1920:13:37" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 369, + "src": "1920:13:37" + }, + "referencedDeclaration": 369, + "src": "1920:13:37", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IEpochManager_$369", + "typeString": "contract IEpochManager" + } + }, + "visibility": "private" + }, + { + "constant": false, + "documentation": { + "id": 4612, + "nodeType": "StructuredDocumentation", + "src": "1978:48:37", + "text": "@notice The Rewards Manager contract address" + }, + "id": 4615, + "mutability": "immutable", + "name": "GRAPH_REWARDS_MANAGER", + "nameLocation": "2065:21:37", + "nodeType": "VariableDeclaration", + "scope": 4928, + "src": "2031:55:37", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IRewardsManager_$678", + "typeString": "contract IRewardsManager" + }, + "typeName": { + "id": 4614, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 4613, + "name": "IRewardsManager", + "nameLocations": [ + "2031:15:37" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 678, + "src": "2031:15:37" + }, + "referencedDeclaration": 678, + "src": "2031:15:37", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IRewardsManager_$678", + "typeString": "contract IRewardsManager" + } + }, + "visibility": "private" + }, + { + "constant": false, + "documentation": { + "id": 4616, + "nodeType": "StructuredDocumentation", + "src": "2093:46:37", + "text": "@notice The Token Gateway contract address" + }, + "id": 4619, + "mutability": "immutable", + "name": "GRAPH_TOKEN_GATEWAY", + "nameLocation": "2176:19:37", + "nodeType": "VariableDeclaration", + "scope": 4928, + "src": "2144:51:37", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_contract$_ITokenGateway_$41", + "typeString": "contract ITokenGateway" + }, + "typeName": { + "id": 4618, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 4617, + "name": "ITokenGateway", + "nameLocations": [ + "2144:13:37" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 41, + "src": "2144:13:37" + }, + "referencedDeclaration": 41, + "src": "2144:13:37", + "typeDescriptions": { + "typeIdentifier": "t_contract$_ITokenGateway_$41", + "typeString": "contract ITokenGateway" + } + }, + "visibility": "private" + }, + { + "constant": false, + "documentation": { + "id": 4620, + "nodeType": "StructuredDocumentation", + "src": "2202:50:37", + "text": "@notice The Graph Proxy Admin contract address" + }, + "id": 4623, + "mutability": "immutable", + "name": "GRAPH_PROXY_ADMIN", + "nameLocation": "2292:17:37", + "nodeType": "VariableDeclaration", + "scope": 4928, + "src": "2257:52:37", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IGraphProxyAdmin_$2493", + "typeString": "contract IGraphProxyAdmin" + }, + "typeName": { + "id": 4622, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 4621, + "name": "IGraphProxyAdmin", + "nameLocations": [ + "2257:16:37" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 2493, + "src": "2257:16:37" + }, + "referencedDeclaration": 2493, + "src": "2257:16:37", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IGraphProxyAdmin_$2493", + "typeString": "contract IGraphProxyAdmin" + } + }, + "visibility": "private" + }, + { + "constant": false, + "documentation": { + "id": 4624, + "nodeType": "StructuredDocumentation", + "src": "2513:41:37", + "text": "@notice The Curation contract address" + }, + "id": 4627, + "mutability": "immutable", + "name": "GRAPH_CURATION", + "nameLocation": "2587:14:37", + "nodeType": "VariableDeclaration", + "scope": 4928, + "src": "2559:42:37", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_contract$_ICuration_$165", + "typeString": "contract ICuration" + }, + "typeName": { + "id": 4626, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 4625, + "name": "ICuration", + "nameLocations": [ + "2559:9:37" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 165, + "src": "2559:9:37" + }, + "referencedDeclaration": 165, + "src": "2559:9:37", + "typeDescriptions": { + "typeIdentifier": "t_contract$_ICuration_$165", + "typeString": "contract ICuration" + } + }, + "visibility": "private" + }, + { + "anonymous": false, + "documentation": { + "id": 4628, + "nodeType": "StructuredDocumentation", + "src": "2608:722:37", + "text": " @notice Emitted when the GraphDirectory is initialized\n @param graphToken The Graph Token contract address\n @param graphStaking The Horizon Staking contract address\n @param graphPayments The Graph Payments contract address\n @param graphEscrow The Payments Escrow contract address\n @param graphController The Graph Controller contract address\n @param graphEpochManager The Epoch Manager contract address\n @param graphRewardsManager The Rewards Manager contract address\n @param graphTokenGateway The Token Gateway contract address\n @param graphProxyAdmin The Graph Proxy Admin contract address\n @param graphCuration The Curation contract address" + }, + "eventSelector": "ef5021414834d86e36470f5c1cecf6544fb2bb723f2ca51a4c86fcd8c5919a43", + "id": 4650, + "name": "GraphDirectoryInitialized", + "nameLocation": "3341:25:37", + "nodeType": "EventDefinition", + "parameters": { + "id": 4649, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 4630, + "indexed": true, + "mutability": "mutable", + "name": "graphToken", + "nameLocation": "3392:10:37", + "nodeType": "VariableDeclaration", + "scope": 4650, + "src": "3376:26:37", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 4629, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3376:7:37", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 4632, + "indexed": true, + "mutability": "mutable", + "name": "graphStaking", + "nameLocation": "3428:12:37", + "nodeType": "VariableDeclaration", + "scope": 4650, + "src": "3412:28:37", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 4631, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3412:7:37", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 4634, + "indexed": false, + "mutability": "mutable", + "name": "graphPayments", + "nameLocation": "3458:13:37", + "nodeType": "VariableDeclaration", + "scope": 4650, + "src": "3450:21:37", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 4633, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3450:7:37", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 4636, + "indexed": false, + "mutability": "mutable", + "name": "graphEscrow", + "nameLocation": "3489:11:37", + "nodeType": "VariableDeclaration", + "scope": 4650, + "src": "3481:19:37", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 4635, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3481:7:37", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 4638, + "indexed": true, + "mutability": "mutable", + "name": "graphController", + "nameLocation": "3526:15:37", + "nodeType": "VariableDeclaration", + "scope": 4650, + "src": "3510:31:37", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 4637, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3510:7:37", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 4640, + "indexed": false, + "mutability": "mutable", + "name": "graphEpochManager", + "nameLocation": "3559:17:37", + "nodeType": "VariableDeclaration", + "scope": 4650, + "src": "3551:25:37", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 4639, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3551:7:37", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 4642, + "indexed": false, + "mutability": "mutable", + "name": "graphRewardsManager", + "nameLocation": "3594:19:37", + "nodeType": "VariableDeclaration", + "scope": 4650, + "src": "3586:27:37", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 4641, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3586:7:37", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 4644, + "indexed": false, + "mutability": "mutable", + "name": "graphTokenGateway", + "nameLocation": "3631:17:37", + "nodeType": "VariableDeclaration", + "scope": 4650, + "src": "3623:25:37", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 4643, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3623:7:37", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 4646, + "indexed": false, + "mutability": "mutable", + "name": "graphProxyAdmin", + "nameLocation": "3666:15:37", + "nodeType": "VariableDeclaration", + "scope": 4650, + "src": "3658:23:37", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 4645, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3658:7:37", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 4648, + "indexed": false, + "mutability": "mutable", + "name": "graphCuration", + "nameLocation": "3699:13:37", + "nodeType": "VariableDeclaration", + "scope": 4650, + "src": "3691:21:37", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 4647, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3691:7:37", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "3366:352:37" + }, + "src": "3335:384:37" + }, + { + "documentation": { + "id": 4651, + "nodeType": "StructuredDocumentation", + "src": "3725:230:37", + "text": " @notice Thrown when either the controller is the zero address or a contract address is not found\n on the controller\n @param contractName The name of the contract that was not found, or the controller" + }, + "errorSelector": "431eb5ba", + "id": 4655, + "name": "GraphDirectoryInvalidZeroAddress", + "nameLocation": "3966:32:37", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 4654, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 4653, + "mutability": "mutable", + "name": "contractName", + "nameLocation": "4005:12:37", + "nodeType": "VariableDeclaration", + "scope": 4655, + "src": "3999:18:37", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 4652, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "3999:5:37", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "src": "3998:20:37" + }, + "src": "3960:59:37" + }, + { + "body": { + "id": 4794, + "nodeType": "Block", + "src": "4337:1382:37", + "statements": [ + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 4667, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 4662, + "name": "controller", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4658, + "src": "4355:10:37", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "arguments": [ + { + "hexValue": "30", + "id": 4665, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4377:1:37", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 4664, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "4369:7:37", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 4663, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4369:7:37", + "typeDescriptions": {} + } + }, + "id": 4666, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4369:10:37", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "4355:24:37", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [ + { + "hexValue": "436f6e74726f6c6c6572", + "id": 4669, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4414:12:37", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_7c20e2bbcd91c5aaa7898ba022ab8867ac32d84e959c236484db066900aa363a", + "typeString": "literal_string \"Controller\"" + }, + "value": "Controller" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_stringliteral_7c20e2bbcd91c5aaa7898ba022ab8867ac32d84e959c236484db066900aa363a", + "typeString": "literal_string \"Controller\"" + } + ], + "id": 4668, + "name": "GraphDirectoryInvalidZeroAddress", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4655, + "src": "4381:32:37", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_bytes_memory_ptr_$returns$_t_error_$", + "typeString": "function (bytes memory) pure returns (error)" + } + }, + "id": 4670, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4381:46:37", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 4661, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "4347:7:37", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 4671, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4347:81:37", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 4672, + "nodeType": "ExpressionStatement", + "src": "4347:81:37" + }, + { + "expression": { + "id": 4677, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 4673, + "name": "GRAPH_CONTROLLER", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4607, + "src": "4439:16:37", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IController_$441", + "typeString": "contract IController" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "id": 4675, + "name": "controller", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4658, + "src": "4470:10:37", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 4674, + "name": "IController", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 441, + "src": "4458:11:37", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_IController_$441_$", + "typeString": "type(contract IController)" + } + }, + "id": 4676, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4458:23:37", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_IController_$441", + "typeString": "contract IController" + } + }, + "src": "4439:42:37", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IController_$441", + "typeString": "contract IController" + } + }, + "id": 4678, + "nodeType": "ExpressionStatement", + "src": "4439:42:37" + }, + { + "expression": { + "id": 4685, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 4679, + "name": "GRAPH_TOKEN", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4591, + "src": "4491:11:37", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IGraphToken_$758", + "typeString": "contract IGraphToken" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "arguments": [ + { + "hexValue": "4772617068546f6b656e", + "id": 4682, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4544:12:37", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_45fc200c7e4544e457d3c5709bfe0d520442c30bbcbdaede89e8d4a4bbc19247", + "typeString": "literal_string \"GraphToken\"" + }, + "value": "GraphToken" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_stringliteral_45fc200c7e4544e457d3c5709bfe0d520442c30bbcbdaede89e8d4a4bbc19247", + "typeString": "literal_string \"GraphToken\"" + } + ], + "id": 4681, + "name": "_getContractFromController", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4927, + "src": "4517:26:37", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_bytes_memory_ptr_$returns$_t_address_$", + "typeString": "function (bytes memory) view returns (address)" + } + }, + "id": 4683, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4517:40:37", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 4680, + "name": "IGraphToken", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 758, + "src": "4505:11:37", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_IGraphToken_$758_$", + "typeString": "type(contract IGraphToken)" + } + }, + "id": 4684, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4505:53:37", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_IGraphToken_$758", + "typeString": "contract IGraphToken" + } + }, + "src": "4491:67:37", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IGraphToken_$758", + "typeString": "contract IGraphToken" + } + }, + "id": 4686, + "nodeType": "ExpressionStatement", + "src": "4491:67:37" + }, + { + "expression": { + "id": 4693, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 4687, + "name": "GRAPH_STAKING", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4595, + "src": "4568:13:37", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IHorizonStaking_$2625", + "typeString": "contract IHorizonStaking" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "arguments": [ + { + "hexValue": "5374616b696e67", + "id": 4690, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4627:9:37", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_1df41cd916959d1163dc8f0671a666ea8a3e434c13e40faef527133b5d167034", + "typeString": "literal_string \"Staking\"" + }, + "value": "Staking" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_stringliteral_1df41cd916959d1163dc8f0671a666ea8a3e434c13e40faef527133b5d167034", + "typeString": "literal_string \"Staking\"" + } + ], + "id": 4689, + "name": "_getContractFromController", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4927, + "src": "4600:26:37", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_bytes_memory_ptr_$returns$_t_address_$", + "typeString": "function (bytes memory) view returns (address)" + } + }, + "id": 4691, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4600:37:37", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 4688, + "name": "IHorizonStaking", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2625, + "src": "4584:15:37", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_IHorizonStaking_$2625_$", + "typeString": "type(contract IHorizonStaking)" + } + }, + "id": 4692, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4584:54:37", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_IHorizonStaking_$2625", + "typeString": "contract IHorizonStaking" + } + }, + "src": "4568:70:37", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IHorizonStaking_$2625", + "typeString": "contract IHorizonStaking" + } + }, + "id": 4694, + "nodeType": "ExpressionStatement", + "src": "4568:70:37" + }, + { + "expression": { + "id": 4701, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 4695, + "name": "GRAPH_PAYMENTS", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4599, + "src": "4648:14:37", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IGraphPayments_$2489", + "typeString": "contract IGraphPayments" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "arguments": [ + { + "hexValue": "47726170685061796d656e7473", + "id": 4698, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4707:15:37", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_88cae14a9889b95b4cfd9472fc7dcbca2da791846a1e314bac9c1f8a234cbf9f", + "typeString": "literal_string \"GraphPayments\"" + }, + "value": "GraphPayments" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_stringliteral_88cae14a9889b95b4cfd9472fc7dcbca2da791846a1e314bac9c1f8a234cbf9f", + "typeString": "literal_string \"GraphPayments\"" + } + ], + "id": 4697, + "name": "_getContractFromController", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4927, + "src": "4680:26:37", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_bytes_memory_ptr_$returns$_t_address_$", + "typeString": "function (bytes memory) view returns (address)" + } + }, + "id": 4699, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4680:43:37", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 4696, + "name": "IGraphPayments", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2489, + "src": "4665:14:37", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_IGraphPayments_$2489_$", + "typeString": "type(contract IGraphPayments)" + } + }, + "id": 4700, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4665:59:37", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_IGraphPayments_$2489", + "typeString": "contract IGraphPayments" + } + }, + "src": "4648:76:37", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IGraphPayments_$2489", + "typeString": "contract IGraphPayments" + } + }, + "id": 4702, + "nodeType": "ExpressionStatement", + "src": "4648:76:37" + }, + { + "expression": { + "id": 4709, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 4703, + "name": "GRAPH_PAYMENTS_ESCROW", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4603, + "src": "4734:21:37", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IPaymentsEscrow_$2858", + "typeString": "contract IPaymentsEscrow" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "arguments": [ + { + "hexValue": "5061796d656e7473457363726f77", + "id": 4706, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4801:16:37", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_628f67391f8b955553cabfadbf5f1b6a31d2a2d0fea175f5594af9d40b0bedc9", + "typeString": "literal_string \"PaymentsEscrow\"" + }, + "value": "PaymentsEscrow" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_stringliteral_628f67391f8b955553cabfadbf5f1b6a31d2a2d0fea175f5594af9d40b0bedc9", + "typeString": "literal_string \"PaymentsEscrow\"" + } + ], + "id": 4705, + "name": "_getContractFromController", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4927, + "src": "4774:26:37", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_bytes_memory_ptr_$returns$_t_address_$", + "typeString": "function (bytes memory) view returns (address)" + } + }, + "id": 4707, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4774:44:37", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 4704, + "name": "IPaymentsEscrow", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2858, + "src": "4758:15:37", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_IPaymentsEscrow_$2858_$", + "typeString": "type(contract IPaymentsEscrow)" + } + }, + "id": 4708, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4758:61:37", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_IPaymentsEscrow_$2858", + "typeString": "contract IPaymentsEscrow" + } + }, + "src": "4734:85:37", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IPaymentsEscrow_$2858", + "typeString": "contract IPaymentsEscrow" + } + }, + "id": 4710, + "nodeType": "ExpressionStatement", + "src": "4734:85:37" + }, + { + "expression": { + "id": 4717, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 4711, + "name": "GRAPH_EPOCH_MANAGER", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4611, + "src": "4829:19:37", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IEpochManager_$369", + "typeString": "contract IEpochManager" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "arguments": [ + { + "hexValue": "45706f63684d616e61676572", + "id": 4714, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4892:14:37", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_c713c3df6d14cdf946460395d09af88993ee2b948b1a808161494e32c5f67063", + "typeString": "literal_string \"EpochManager\"" + }, + "value": "EpochManager" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_stringliteral_c713c3df6d14cdf946460395d09af88993ee2b948b1a808161494e32c5f67063", + "typeString": "literal_string \"EpochManager\"" + } + ], + "id": 4713, + "name": "_getContractFromController", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4927, + "src": "4865:26:37", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_bytes_memory_ptr_$returns$_t_address_$", + "typeString": "function (bytes memory) view returns (address)" + } + }, + "id": 4715, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4865:42:37", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 4712, + "name": "IEpochManager", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 369, + "src": "4851:13:37", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_IEpochManager_$369_$", + "typeString": "type(contract IEpochManager)" + } + }, + "id": 4716, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4851:57:37", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_IEpochManager_$369", + "typeString": "contract IEpochManager" + } + }, + "src": "4829:79:37", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IEpochManager_$369", + "typeString": "contract IEpochManager" + } + }, + "id": 4718, + "nodeType": "ExpressionStatement", + "src": "4829:79:37" + }, + { + "expression": { + "id": 4725, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 4719, + "name": "GRAPH_REWARDS_MANAGER", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4615, + "src": "4918:21:37", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IRewardsManager_$678", + "typeString": "contract IRewardsManager" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "arguments": [ + { + "hexValue": "526577617264734d616e61676572", + "id": 4722, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4985:16:37", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_966f1e8d8d8014e05f6ec4a57138da9be1f7c5a7f802928a18072f7c53180761", + "typeString": "literal_string \"RewardsManager\"" + }, + "value": "RewardsManager" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_stringliteral_966f1e8d8d8014e05f6ec4a57138da9be1f7c5a7f802928a18072f7c53180761", + "typeString": "literal_string \"RewardsManager\"" + } + ], + "id": 4721, + "name": "_getContractFromController", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4927, + "src": "4958:26:37", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_bytes_memory_ptr_$returns$_t_address_$", + "typeString": "function (bytes memory) view returns (address)" + } + }, + "id": 4723, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4958:44:37", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 4720, + "name": "IRewardsManager", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 678, + "src": "4942:15:37", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_IRewardsManager_$678_$", + "typeString": "type(contract IRewardsManager)" + } + }, + "id": 4724, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4942:61:37", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_IRewardsManager_$678", + "typeString": "contract IRewardsManager" + } + }, + "src": "4918:85:37", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IRewardsManager_$678", + "typeString": "contract IRewardsManager" + } + }, + "id": 4726, + "nodeType": "ExpressionStatement", + "src": "4918:85:37" + }, + { + "expression": { + "id": 4733, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 4727, + "name": "GRAPH_TOKEN_GATEWAY", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4619, + "src": "5013:19:37", + "typeDescriptions": { + "typeIdentifier": "t_contract$_ITokenGateway_$41", + "typeString": "contract ITokenGateway" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "arguments": [ + { + "hexValue": "4772617068546f6b656e47617465776179", + "id": 4730, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "5076:19:37", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_d362cac9cb75c10d67bcc0b7eeb0b1ef48bb5420b556c092d4fd7f758816fcf0", + "typeString": "literal_string \"GraphTokenGateway\"" + }, + "value": "GraphTokenGateway" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_stringliteral_d362cac9cb75c10d67bcc0b7eeb0b1ef48bb5420b556c092d4fd7f758816fcf0", + "typeString": "literal_string \"GraphTokenGateway\"" + } + ], + "id": 4729, + "name": "_getContractFromController", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4927, + "src": "5049:26:37", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_bytes_memory_ptr_$returns$_t_address_$", + "typeString": "function (bytes memory) view returns (address)" + } + }, + "id": 4731, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5049:47:37", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 4728, + "name": "ITokenGateway", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 41, + "src": "5035:13:37", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_ITokenGateway_$41_$", + "typeString": "type(contract ITokenGateway)" + } + }, + "id": 4732, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5035:62:37", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_ITokenGateway_$41", + "typeString": "contract ITokenGateway" + } + }, + "src": "5013:84:37", + "typeDescriptions": { + "typeIdentifier": "t_contract$_ITokenGateway_$41", + "typeString": "contract ITokenGateway" + } + }, + "id": 4734, + "nodeType": "ExpressionStatement", + "src": "5013:84:37" + }, + { + "expression": { + "id": 4741, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 4735, + "name": "GRAPH_PROXY_ADMIN", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4623, + "src": "5107:17:37", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IGraphProxyAdmin_$2493", + "typeString": "contract IGraphProxyAdmin" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "arguments": [ + { + "hexValue": "477261706850726f787941646d696e", + "id": 4738, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "5171:17:37", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_ed734418922426bf2cc8783754bd80fc4d441a4dbe994549aee8a2f03136fcdb", + "typeString": "literal_string \"GraphProxyAdmin\"" + }, + "value": "GraphProxyAdmin" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_stringliteral_ed734418922426bf2cc8783754bd80fc4d441a4dbe994549aee8a2f03136fcdb", + "typeString": "literal_string \"GraphProxyAdmin\"" + } + ], + "id": 4737, + "name": "_getContractFromController", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4927, + "src": "5144:26:37", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_bytes_memory_ptr_$returns$_t_address_$", + "typeString": "function (bytes memory) view returns (address)" + } + }, + "id": 4739, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5144:45:37", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 4736, + "name": "IGraphProxyAdmin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2493, + "src": "5127:16:37", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_IGraphProxyAdmin_$2493_$", + "typeString": "type(contract IGraphProxyAdmin)" + } + }, + "id": 4740, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5127:63:37", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_IGraphProxyAdmin_$2493", + "typeString": "contract IGraphProxyAdmin" + } + }, + "src": "5107:83:37", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IGraphProxyAdmin_$2493", + "typeString": "contract IGraphProxyAdmin" + } + }, + "id": 4742, + "nodeType": "ExpressionStatement", + "src": "5107:83:37" + }, + { + "expression": { + "id": 4749, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 4743, + "name": "GRAPH_CURATION", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4627, + "src": "5200:14:37", + "typeDescriptions": { + "typeIdentifier": "t_contract$_ICuration_$165", + "typeString": "contract ICuration" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "arguments": [ + { + "hexValue": "4375726174696f6e", + "id": 4746, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "5254:10:37", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_e6876326c1291dfcbbd3864a6816d698cd591defc7aa2153d7f9c4c04016c89f", + "typeString": "literal_string \"Curation\"" + }, + "value": "Curation" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_stringliteral_e6876326c1291dfcbbd3864a6816d698cd591defc7aa2153d7f9c4c04016c89f", + "typeString": "literal_string \"Curation\"" + } + ], + "id": 4745, + "name": "_getContractFromController", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4927, + "src": "5227:26:37", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_bytes_memory_ptr_$returns$_t_address_$", + "typeString": "function (bytes memory) view returns (address)" + } + }, + "id": 4747, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5227:38:37", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 4744, + "name": "ICuration", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 165, + "src": "5217:9:37", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_ICuration_$165_$", + "typeString": "type(contract ICuration)" + } + }, + "id": 4748, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5217:49:37", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_ICuration_$165", + "typeString": "contract ICuration" + } + }, + "src": "5200:66:37", + "typeDescriptions": { + "typeIdentifier": "t_contract$_ICuration_$165", + "typeString": "contract ICuration" + } + }, + "id": 4750, + "nodeType": "ExpressionStatement", + "src": "5200:66:37" + }, + { + "eventCall": { + "arguments": [ + { + "arguments": [ + { + "id": 4754, + "name": "GRAPH_TOKEN", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4591, + "src": "5329:11:37", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IGraphToken_$758", + "typeString": "contract IGraphToken" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_IGraphToken_$758", + "typeString": "contract IGraphToken" + } + ], + "id": 4753, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "5321:7:37", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 4752, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5321:7:37", + "typeDescriptions": {} + } + }, + "id": 4755, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5321:20:37", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "arguments": [ + { + "id": 4758, + "name": "GRAPH_STAKING", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4595, + "src": "5363:13:37", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IHorizonStaking_$2625", + "typeString": "contract IHorizonStaking" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_IHorizonStaking_$2625", + "typeString": "contract IHorizonStaking" + } + ], + "id": 4757, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "5355:7:37", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 4756, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5355:7:37", + "typeDescriptions": {} + } + }, + "id": 4759, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5355:22:37", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "arguments": [ + { + "id": 4762, + "name": "GRAPH_PAYMENTS", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4599, + "src": "5399:14:37", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IGraphPayments_$2489", + "typeString": "contract IGraphPayments" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_IGraphPayments_$2489", + "typeString": "contract IGraphPayments" + } + ], + "id": 4761, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "5391:7:37", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 4760, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5391:7:37", + "typeDescriptions": {} + } + }, + "id": 4763, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5391:23:37", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "arguments": [ + { + "id": 4766, + "name": "GRAPH_PAYMENTS_ESCROW", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4603, + "src": "5436:21:37", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IPaymentsEscrow_$2858", + "typeString": "contract IPaymentsEscrow" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_IPaymentsEscrow_$2858", + "typeString": "contract IPaymentsEscrow" + } + ], + "id": 4765, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "5428:7:37", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 4764, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5428:7:37", + "typeDescriptions": {} + } + }, + "id": 4767, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5428:30:37", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "arguments": [ + { + "id": 4770, + "name": "GRAPH_CONTROLLER", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4607, + "src": "5480:16:37", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IController_$441", + "typeString": "contract IController" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_IController_$441", + "typeString": "contract IController" + } + ], + "id": 4769, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "5472:7:37", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 4768, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5472:7:37", + "typeDescriptions": {} + } + }, + "id": 4771, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5472:25:37", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "arguments": [ + { + "id": 4774, + "name": "GRAPH_EPOCH_MANAGER", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4611, + "src": "5519:19:37", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IEpochManager_$369", + "typeString": "contract IEpochManager" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_IEpochManager_$369", + "typeString": "contract IEpochManager" + } + ], + "id": 4773, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "5511:7:37", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 4772, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5511:7:37", + "typeDescriptions": {} + } + }, + "id": 4775, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5511:28:37", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "arguments": [ + { + "id": 4778, + "name": "GRAPH_REWARDS_MANAGER", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4615, + "src": "5561:21:37", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IRewardsManager_$678", + "typeString": "contract IRewardsManager" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_IRewardsManager_$678", + "typeString": "contract IRewardsManager" + } + ], + "id": 4777, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "5553:7:37", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 4776, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5553:7:37", + "typeDescriptions": {} + } + }, + "id": 4779, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5553:30:37", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "arguments": [ + { + "id": 4782, + "name": "GRAPH_TOKEN_GATEWAY", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4619, + "src": "5605:19:37", + "typeDescriptions": { + "typeIdentifier": "t_contract$_ITokenGateway_$41", + "typeString": "contract ITokenGateway" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_ITokenGateway_$41", + "typeString": "contract ITokenGateway" + } + ], + "id": 4781, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "5597:7:37", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 4780, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5597:7:37", + "typeDescriptions": {} + } + }, + "id": 4783, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5597:28:37", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "arguments": [ + { + "id": 4786, + "name": "GRAPH_PROXY_ADMIN", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4623, + "src": "5647:17:37", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IGraphProxyAdmin_$2493", + "typeString": "contract IGraphProxyAdmin" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_IGraphProxyAdmin_$2493", + "typeString": "contract IGraphProxyAdmin" + } + ], + "id": 4785, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "5639:7:37", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 4784, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5639:7:37", + "typeDescriptions": {} + } + }, + "id": 4787, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5639:26:37", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "arguments": [ + { + "id": 4790, + "name": "GRAPH_CURATION", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4627, + "src": "5687:14:37", + "typeDescriptions": { + "typeIdentifier": "t_contract$_ICuration_$165", + "typeString": "contract ICuration" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_ICuration_$165", + "typeString": "contract ICuration" + } + ], + "id": 4789, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "5679:7:37", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 4788, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5679:7:37", + "typeDescriptions": {} + } + }, + "id": 4791, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5679:23:37", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 4751, + "name": "GraphDirectoryInitialized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4650, + "src": "5282:25:37", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_address_$_t_address_$_t_address_$_t_address_$_t_address_$_t_address_$_t_address_$_t_address_$returns$__$", + "typeString": "function (address,address,address,address,address,address,address,address,address,address)" + } + }, + "id": 4792, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5282:430:37", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 4793, + "nodeType": "EmitStatement", + "src": "5277:435:37" + } + ] + }, + "documentation": { + "id": 4656, + "nodeType": "StructuredDocumentation", + "src": "4025:275:37", + "text": " @notice Constructor for the GraphDirectory contract\n @dev Requirements:\n - `controller` cannot be zero address\n Emits a {GraphDirectoryInitialized} event\n @param controller The address of the Graph Controller contract." + }, + "id": 4795, + "implemented": true, + "kind": "constructor", + "modifiers": [], + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 4659, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 4658, + "mutability": "mutable", + "name": "controller", + "nameLocation": "4325:10:37", + "nodeType": "VariableDeclaration", + "scope": 4795, + "src": "4317:18:37", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 4657, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4317:7:37", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "4316:20:37" + }, + "returnParameters": { + "id": 4660, + "nodeType": "ParameterList", + "parameters": [], + "src": "4337:0:37" + }, + "scope": 4928, + "src": "4305:1414:37", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 4804, + "nodeType": "Block", + "src": "5884:35:37", + "statements": [ + { + "expression": { + "id": 4802, + "name": "GRAPH_TOKEN", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4591, + "src": "5901:11:37", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IGraphToken_$758", + "typeString": "contract IGraphToken" + } + }, + "functionReturnParameters": 4801, + "id": 4803, + "nodeType": "Return", + "src": "5894:18:37" + } + ] + }, + "documentation": { + "id": 4796, + "nodeType": "StructuredDocumentation", + "src": "5725:95:37", + "text": " @notice Get the Graph Token contract\n @return The Graph Token contract" + }, + "id": 4805, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_graphToken", + "nameLocation": "5834:11:37", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 4797, + "nodeType": "ParameterList", + "parameters": [], + "src": "5845:2:37" + }, + "returnParameters": { + "id": 4801, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 4800, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 4805, + "src": "5871:11:37", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IGraphToken_$758", + "typeString": "contract IGraphToken" + }, + "typeName": { + "id": 4799, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 4798, + "name": "IGraphToken", + "nameLocations": [ + "5871:11:37" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 758, + "src": "5871:11:37" + }, + "referencedDeclaration": 758, + "src": "5871:11:37", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IGraphToken_$758", + "typeString": "contract IGraphToken" + } + }, + "visibility": "internal" + } + ], + "src": "5870:13:37" + }, + "scope": 4928, + "src": "5825:94:37", + "stateMutability": "view", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 4814, + "nodeType": "Block", + "src": "6098:37:37", + "statements": [ + { + "expression": { + "id": 4812, + "name": "GRAPH_STAKING", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4595, + "src": "6115:13:37", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IHorizonStaking_$2625", + "typeString": "contract IHorizonStaking" + } + }, + "functionReturnParameters": 4811, + "id": 4813, + "nodeType": "Return", + "src": "6108:20:37" + } + ] + }, + "documentation": { + "id": 4806, + "nodeType": "StructuredDocumentation", + "src": "5925:103:37", + "text": " @notice Get the Horizon Staking contract\n @return The Horizon Staking contract" + }, + "id": 4815, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_graphStaking", + "nameLocation": "6042:13:37", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 4807, + "nodeType": "ParameterList", + "parameters": [], + "src": "6055:2:37" + }, + "returnParameters": { + "id": 4811, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 4810, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 4815, + "src": "6081:15:37", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IHorizonStaking_$2625", + "typeString": "contract IHorizonStaking" + }, + "typeName": { + "id": 4809, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 4808, + "name": "IHorizonStaking", + "nameLocations": [ + "6081:15:37" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 2625, + "src": "6081:15:37" + }, + "referencedDeclaration": 2625, + "src": "6081:15:37", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IHorizonStaking_$2625", + "typeString": "contract IHorizonStaking" + } + }, + "visibility": "internal" + } + ], + "src": "6080:17:37" + }, + "scope": 4928, + "src": "6033:102:37", + "stateMutability": "view", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 4824, + "nodeType": "Block", + "src": "6312:38:37", + "statements": [ + { + "expression": { + "id": 4822, + "name": "GRAPH_PAYMENTS", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4599, + "src": "6329:14:37", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IGraphPayments_$2489", + "typeString": "contract IGraphPayments" + } + }, + "functionReturnParameters": 4821, + "id": 4823, + "nodeType": "Return", + "src": "6322:21:37" + } + ] + }, + "documentation": { + "id": 4816, + "nodeType": "StructuredDocumentation", + "src": "6141:101:37", + "text": " @notice Get the Graph Payments contract\n @return The Graph Payments contract" + }, + "id": 4825, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_graphPayments", + "nameLocation": "6256:14:37", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 4817, + "nodeType": "ParameterList", + "parameters": [], + "src": "6270:2:37" + }, + "returnParameters": { + "id": 4821, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 4820, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 4825, + "src": "6296:14:37", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IGraphPayments_$2489", + "typeString": "contract IGraphPayments" + }, + "typeName": { + "id": 4819, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 4818, + "name": "IGraphPayments", + "nameLocations": [ + "6296:14:37" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 2489, + "src": "6296:14:37" + }, + "referencedDeclaration": 2489, + "src": "6296:14:37", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IGraphPayments_$2489", + "typeString": "contract IGraphPayments" + } + }, + "visibility": "internal" + } + ], + "src": "6295:16:37" + }, + "scope": 4928, + "src": "6247:103:37", + "stateMutability": "view", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 4834, + "nodeType": "Block", + "src": "6536:45:37", + "statements": [ + { + "expression": { + "id": 4832, + "name": "GRAPH_PAYMENTS_ESCROW", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4603, + "src": "6553:21:37", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IPaymentsEscrow_$2858", + "typeString": "contract IPaymentsEscrow" + } + }, + "functionReturnParameters": 4831, + "id": 4833, + "nodeType": "Return", + "src": "6546:28:37" + } + ] + }, + "documentation": { + "id": 4826, + "nodeType": "StructuredDocumentation", + "src": "6356:103:37", + "text": " @notice Get the Payments Escrow contract\n @return The Payments Escrow contract" + }, + "id": 4835, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_graphPaymentsEscrow", + "nameLocation": "6473:20:37", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 4827, + "nodeType": "ParameterList", + "parameters": [], + "src": "6493:2:37" + }, + "returnParameters": { + "id": 4831, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 4830, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 4835, + "src": "6519:15:37", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IPaymentsEscrow_$2858", + "typeString": "contract IPaymentsEscrow" + }, + "typeName": { + "id": 4829, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 4828, + "name": "IPaymentsEscrow", + "nameLocations": [ + "6519:15:37" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 2858, + "src": "6519:15:37" + }, + "referencedDeclaration": 2858, + "src": "6519:15:37", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IPaymentsEscrow_$2858", + "typeString": "contract IPaymentsEscrow" + } + }, + "visibility": "internal" + } + ], + "src": "6518:17:37" + }, + "scope": 4928, + "src": "6464:117:37", + "stateMutability": "view", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 4844, + "nodeType": "Block", + "src": "6761:40:37", + "statements": [ + { + "expression": { + "id": 4842, + "name": "GRAPH_CONTROLLER", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4607, + "src": "6778:16:37", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IController_$441", + "typeString": "contract IController" + } + }, + "functionReturnParameters": 4841, + "id": 4843, + "nodeType": "Return", + "src": "6771:23:37" + } + ] + }, + "documentation": { + "id": 4836, + "nodeType": "StructuredDocumentation", + "src": "6587:105:37", + "text": " @notice Get the Graph Controller contract\n @return The Graph Controller contract" + }, + "id": 4845, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_graphController", + "nameLocation": "6706:16:37", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 4837, + "nodeType": "ParameterList", + "parameters": [], + "src": "6722:2:37" + }, + "returnParameters": { + "id": 4841, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 4840, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 4845, + "src": "6748:11:37", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IController_$441", + "typeString": "contract IController" + }, + "typeName": { + "id": 4839, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 4838, + "name": "IController", + "nameLocations": [ + "6748:11:37" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 441, + "src": "6748:11:37" + }, + "referencedDeclaration": 441, + "src": "6748:11:37", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IController_$441", + "typeString": "contract IController" + } + }, + "visibility": "internal" + } + ], + "src": "6747:13:37" + }, + "scope": 4928, + "src": "6697:104:37", + "stateMutability": "view", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 4854, + "nodeType": "Block", + "src": "6979:43:37", + "statements": [ + { + "expression": { + "id": 4852, + "name": "GRAPH_EPOCH_MANAGER", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4611, + "src": "6996:19:37", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IEpochManager_$369", + "typeString": "contract IEpochManager" + } + }, + "functionReturnParameters": 4851, + "id": 4853, + "nodeType": "Return", + "src": "6989:26:37" + } + ] + }, + "documentation": { + "id": 4846, + "nodeType": "StructuredDocumentation", + "src": "6807:99:37", + "text": " @notice Get the Epoch Manager contract\n @return The Epoch Manager contract" + }, + "id": 4855, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_graphEpochManager", + "nameLocation": "6920:18:37", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 4847, + "nodeType": "ParameterList", + "parameters": [], + "src": "6938:2:37" + }, + "returnParameters": { + "id": 4851, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 4850, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 4855, + "src": "6964:13:37", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IEpochManager_$369", + "typeString": "contract IEpochManager" + }, + "typeName": { + "id": 4849, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 4848, + "name": "IEpochManager", + "nameLocations": [ + "6964:13:37" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 369, + "src": "6964:13:37" + }, + "referencedDeclaration": 369, + "src": "6964:13:37", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IEpochManager_$369", + "typeString": "contract IEpochManager" + } + }, + "visibility": "internal" + } + ], + "src": "6963:15:37" + }, + "scope": 4928, + "src": "6911:111:37", + "stateMutability": "view", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 4864, + "nodeType": "Block", + "src": "7216:45:37", + "statements": [ + { + "expression": { + "id": 4862, + "name": "GRAPH_REWARDS_MANAGER", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4615, + "src": "7233:21:37", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IRewardsManager_$678", + "typeString": "contract IRewardsManager" + } + }, + "functionReturnParameters": 4861, + "id": 4863, + "nodeType": "Return", + "src": "7226:28:37" + } + ] + }, + "documentation": { + "id": 4856, + "nodeType": "StructuredDocumentation", + "src": "7028:111:37", + "text": " @notice Get the Rewards Manager contract\n @return The Rewards Manager contract address" + }, + "id": 4865, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_graphRewardsManager", + "nameLocation": "7153:20:37", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 4857, + "nodeType": "ParameterList", + "parameters": [], + "src": "7173:2:37" + }, + "returnParameters": { + "id": 4861, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 4860, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 4865, + "src": "7199:15:37", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IRewardsManager_$678", + "typeString": "contract IRewardsManager" + }, + "typeName": { + "id": 4859, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 4858, + "name": "IRewardsManager", + "nameLocations": [ + "7199:15:37" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 678, + "src": "7199:15:37" + }, + "referencedDeclaration": 678, + "src": "7199:15:37", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IRewardsManager_$678", + "typeString": "contract IRewardsManager" + } + }, + "visibility": "internal" + } + ], + "src": "7198:17:37" + }, + "scope": 4928, + "src": "7144:117:37", + "stateMutability": "view", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 4874, + "nodeType": "Block", + "src": "7451:43:37", + "statements": [ + { + "expression": { + "id": 4872, + "name": "GRAPH_TOKEN_GATEWAY", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4619, + "src": "7468:19:37", + "typeDescriptions": { + "typeIdentifier": "t_contract$_ITokenGateway_$41", + "typeString": "contract ITokenGateway" + } + }, + "functionReturnParameters": 4871, + "id": 4873, + "nodeType": "Return", + "src": "7461:26:37" + } + ] + }, + "documentation": { + "id": 4866, + "nodeType": "StructuredDocumentation", + "src": "7267:111:37", + "text": " @notice Get the Graph Token Gateway contract\n @return The Graph Token Gateway contract" + }, + "id": 4875, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_graphTokenGateway", + "nameLocation": "7392:18:37", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 4867, + "nodeType": "ParameterList", + "parameters": [], + "src": "7410:2:37" + }, + "returnParameters": { + "id": 4871, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 4870, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 4875, + "src": "7436:13:37", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_contract$_ITokenGateway_$41", + "typeString": "contract ITokenGateway" + }, + "typeName": { + "id": 4869, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 4868, + "name": "ITokenGateway", + "nameLocations": [ + "7436:13:37" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 41, + "src": "7436:13:37" + }, + "referencedDeclaration": 41, + "src": "7436:13:37", + "typeDescriptions": { + "typeIdentifier": "t_contract$_ITokenGateway_$41", + "typeString": "contract ITokenGateway" + } + }, + "visibility": "internal" + } + ], + "src": "7435:15:37" + }, + "scope": 4928, + "src": "7383:111:37", + "stateMutability": "view", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 4884, + "nodeType": "Block", + "src": "7681:41:37", + "statements": [ + { + "expression": { + "id": 4882, + "name": "GRAPH_PROXY_ADMIN", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4623, + "src": "7698:17:37", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IGraphProxyAdmin_$2493", + "typeString": "contract IGraphProxyAdmin" + } + }, + "functionReturnParameters": 4881, + "id": 4883, + "nodeType": "Return", + "src": "7691:24:37" + } + ] + }, + "documentation": { + "id": 4876, + "nodeType": "StructuredDocumentation", + "src": "7500:107:37", + "text": " @notice Get the Graph Proxy Admin contract\n @return The Graph Proxy Admin contract" + }, + "id": 4885, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_graphProxyAdmin", + "nameLocation": "7621:16:37", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 4877, + "nodeType": "ParameterList", + "parameters": [], + "src": "7637:2:37" + }, + "returnParameters": { + "id": 4881, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 4880, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 4885, + "src": "7663:16:37", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IGraphProxyAdmin_$2493", + "typeString": "contract IGraphProxyAdmin" + }, + "typeName": { + "id": 4879, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 4878, + "name": "IGraphProxyAdmin", + "nameLocations": [ + "7663:16:37" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 2493, + "src": "7663:16:37" + }, + "referencedDeclaration": 2493, + "src": "7663:16:37", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IGraphProxyAdmin_$2493", + "typeString": "contract IGraphProxyAdmin" + } + }, + "visibility": "internal" + } + ], + "src": "7662:18:37" + }, + "scope": 4928, + "src": "7612:110:37", + "stateMutability": "view", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 4894, + "nodeType": "Block", + "src": "7882:38:37", + "statements": [ + { + "expression": { + "id": 4892, + "name": "GRAPH_CURATION", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4627, + "src": "7899:14:37", + "typeDescriptions": { + "typeIdentifier": "t_contract$_ICuration_$165", + "typeString": "contract ICuration" + } + }, + "functionReturnParameters": 4891, + "id": 4893, + "nodeType": "Return", + "src": "7892:21:37" + } + ] + }, + "documentation": { + "id": 4886, + "nodeType": "StructuredDocumentation", + "src": "7728:89:37", + "text": " @notice Get the Curation contract\n @return The Curation contract" + }, + "id": 4895, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_graphCuration", + "nameLocation": "7831:14:37", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 4887, + "nodeType": "ParameterList", + "parameters": [], + "src": "7845:2:37" + }, + "returnParameters": { + "id": 4891, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 4890, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 4895, + "src": "7871:9:37", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_contract$_ICuration_$165", + "typeString": "contract ICuration" + }, + "typeName": { + "id": 4889, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 4888, + "name": "ICuration", + "nameLocations": [ + "7871:9:37" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 165, + "src": "7871:9:37" + }, + "referencedDeclaration": 165, + "src": "7871:9:37", + "typeDescriptions": { + "typeIdentifier": "t_contract$_ICuration_$165", + "typeString": "contract ICuration" + } + }, + "visibility": "internal" + } + ], + "src": "7870:11:37" + }, + "scope": 4928, + "src": "7822:98:37", + "stateMutability": "view", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 4926, + "nodeType": "Block", + "src": "8312:231:37", + "statements": [ + { + "assignments": [ + 4904 + ], + "declarations": [ + { + "constant": false, + "id": 4904, + "mutability": "mutable", + "name": "contractAddress", + "nameLocation": "8330:15:37", + "nodeType": "VariableDeclaration", + "scope": 4926, + "src": "8322:23:37", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 4903, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "8322:7:37", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "id": 4911, + "initialValue": { + "arguments": [ + { + "arguments": [ + { + "id": 4908, + "name": "_contractName", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4898, + "src": "8392:13:37", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 4907, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -8, + "src": "8382:9:37", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 4909, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "8382:24:37", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "expression": { + "id": 4905, + "name": "GRAPH_CONTROLLER", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4607, + "src": "8348:16:37", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IController_$441", + "typeString": "contract IController" + } + }, + "id": 4906, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "8365:16:37", + "memberName": "getContractProxy", + "nodeType": "MemberAccess", + "referencedDeclaration": 415, + "src": "8348:33:37", + "typeDescriptions": { + "typeIdentifier": "t_function_external_view$_t_bytes32_$returns$_t_address_$", + "typeString": "function (bytes32) view external returns (address)" + } + }, + "id": 4910, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "8348:59:37", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "8322:85:37" + }, + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 4918, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 4913, + "name": "contractAddress", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4904, + "src": "8425:15:37", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "arguments": [ + { + "hexValue": "30", + "id": 4916, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8452:1:37", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 4915, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "8444:7:37", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 4914, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "8444:7:37", + "typeDescriptions": {} + } + }, + "id": 4917, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "8444:10:37", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "8425:29:37", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [ + { + "id": 4920, + "name": "_contractName", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4898, + "src": "8489:13:37", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 4919, + "name": "GraphDirectoryInvalidZeroAddress", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4655, + "src": "8456:32:37", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_bytes_memory_ptr_$returns$_t_error_$", + "typeString": "function (bytes memory) pure returns (error)" + } + }, + "id": 4921, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "8456:47:37", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 4912, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "8417:7:37", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 4922, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "8417:87:37", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 4923, + "nodeType": "ExpressionStatement", + "src": "8417:87:37" + }, + { + "expression": { + "id": 4924, + "name": "contractAddress", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4904, + "src": "8521:15:37", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "functionReturnParameters": 4902, + "id": 4925, + "nodeType": "Return", + "src": "8514:22:37" + } + ] + }, + "documentation": { + "id": 4896, + "nodeType": "StructuredDocumentation", + "src": "7926:286:37", + "text": " @notice Get a contract address from the controller\n @dev Requirements:\n - The `_contractName` must be registered in the controller\n @param _contractName The name of the contract to fetch from the controller\n @return The address of the contract" + }, + "id": 4927, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_getContractFromController", + "nameLocation": "8226:26:37", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 4899, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 4898, + "mutability": "mutable", + "name": "_contractName", + "nameLocation": "8266:13:37", + "nodeType": "VariableDeclaration", + "scope": 4927, + "src": "8253:26:37", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 4897, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "8253:5:37", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "src": "8252:28:37" + }, + "returnParameters": { + "id": 4902, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 4901, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 4927, + "src": "8303:7:37", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 4900, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "8303:7:37", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "8302:9:37" + }, + "scope": 4928, + "src": "8217:326:37", + "stateMutability": "view", + "virtual": false, + "visibility": "private" + } + ], + "scope": 4929, + "src": "1220:7325:37", + "usedErrors": [ + 4655 + ], + "usedEvents": [ + 4650 + ] + } + ], + "src": "46:8500:37" + }, + "id": 37 + }, + "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol": { + "ast": { + "absolutePath": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol", + "exportedSymbols": { + "ContextUpgradeable": [ + 5437 + ], + "Initializable": [ + 5391 + ], + "OwnableUpgradeable": [ + 5123 + ] + }, + "id": 5124, + "license": "MIT", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 4930, + "literals": [ + "solidity", + "^", + "0.8", + ".20" + ], + "nodeType": "PragmaDirective", + "src": "102:24:38" + }, + { + "absolutePath": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol", + "file": "../utils/ContextUpgradeable.sol", + "id": 4932, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 5124, + "sourceUnit": 5438, + "src": "128:67:38", + "symbolAliases": [ + { + "foreign": { + "id": 4931, + "name": "ContextUpgradeable", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5437, + "src": "136:18:38", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol", + "file": "../proxy/utils/Initializable.sol", + "id": 4934, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 5124, + "sourceUnit": 5392, + "src": "196:63:38", + "symbolAliases": [ + { + "foreign": { + "id": 4933, + "name": "Initializable", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5391, + "src": "204:13:38", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "abstract": true, + "baseContracts": [ + { + "baseName": { + "id": 4936, + "name": "Initializable", + "nameLocations": [ + "789:13:38" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5391, + "src": "789:13:38" + }, + "id": 4937, + "nodeType": "InheritanceSpecifier", + "src": "789:13:38" + }, + { + "baseName": { + "id": 4938, + "name": "ContextUpgradeable", + "nameLocations": [ + "804:18:38" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5437, + "src": "804:18:38" + }, + "id": 4939, + "nodeType": "InheritanceSpecifier", + "src": "804:18:38" + } + ], + "canonicalName": "OwnableUpgradeable", + "contractDependencies": [], + "contractKind": "contract", + "documentation": { + "id": 4935, + "nodeType": "StructuredDocumentation", + "src": "261:487:38", + "text": " @dev Contract module which provides a basic access control mechanism, where\n there is an account (an owner) that can be granted exclusive access to\n specific functions.\n The initial owner is set to the address provided by the deployer. This can\n later be changed with {transferOwnership}.\n This module is used through inheritance. It will make available the modifier\n `onlyOwner`, which can be applied to your functions to restrict their use to\n the owner." + }, + "fullyImplemented": true, + "id": 5123, + "linearizedBaseContracts": [ + 5123, + 5437, + 5391 + ], + "name": "OwnableUpgradeable", + "nameLocation": "767:18:38", + "nodeType": "ContractDefinition", + "nodes": [ + { + "canonicalName": "OwnableUpgradeable.OwnableStorage", + "documentation": { + "id": 4940, + "nodeType": "StructuredDocumentation", + "src": "829:65:38", + "text": "@custom:storage-location erc7201:openzeppelin.storage.Ownable" + }, + "id": 4943, + "members": [ + { + "constant": false, + "id": 4942, + "mutability": "mutable", + "name": "_owner", + "nameLocation": "939:6:38", + "nodeType": "VariableDeclaration", + "scope": 4943, + "src": "931:14:38", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 4941, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "931:7:38", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "name": "OwnableStorage", + "nameLocation": "906:14:38", + "nodeType": "StructDefinition", + "scope": 5123, + "src": "899:53:38", + "visibility": "public" + }, + { + "constant": true, + "id": 4946, + "mutability": "constant", + "name": "OwnableStorageLocation", + "nameLocation": "1094:22:38", + "nodeType": "VariableDeclaration", + "scope": 5123, + "src": "1069:116:38", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 4944, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1069:7:38", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": { + "hexValue": "307839303136643039643732643430666461653266643863656163366236323334633737303632313466643339633163643165363039613035323863313939333030", + "id": 4945, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1119:66:38", + "typeDescriptions": { + "typeIdentifier": "t_rational_65173360639460082030725920392146925864023520599682862633725751242436743107328_by_1", + "typeString": "int_const 6517...(69 digits omitted)...7328" + }, + "value": "0x9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300" + }, + "visibility": "private" + }, + { + "body": { + "id": 4953, + "nodeType": "Block", + "src": "1270:81:38", + "statements": [ + { + "AST": { + "nativeSrc": "1289:56:38", + "nodeType": "YulBlock", + "src": "1289:56:38", + "statements": [ + { + "nativeSrc": "1303:32:38", + "nodeType": "YulAssignment", + "src": "1303:32:38", + "value": { + "name": "OwnableStorageLocation", + "nativeSrc": "1313:22:38", + "nodeType": "YulIdentifier", + "src": "1313:22:38" + }, + "variableNames": [ + { + "name": "$.slot", + "nativeSrc": "1303:6:38", + "nodeType": "YulIdentifier", + "src": "1303:6:38" + } + ] + } + ] + }, + "evmVersion": "paris", + "externalReferences": [ + { + "declaration": 4950, + "isOffset": false, + "isSlot": true, + "src": "1303:6:38", + "suffix": "slot", + "valueSize": 1 + }, + { + "declaration": 4946, + "isOffset": false, + "isSlot": false, + "src": "1313:22:38", + "valueSize": 1 + } + ], + "id": 4952, + "nodeType": "InlineAssembly", + "src": "1280:65:38" + } + ] + }, + "id": 4954, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_getOwnableStorage", + "nameLocation": "1201:18:38", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 4947, + "nodeType": "ParameterList", + "parameters": [], + "src": "1219:2:38" + }, + "returnParameters": { + "id": 4951, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 4950, + "mutability": "mutable", + "name": "$", + "nameLocation": "1267:1:38", + "nodeType": "VariableDeclaration", + "scope": 4954, + "src": "1244:24:38", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_OwnableStorage_$4943_storage_ptr", + "typeString": "struct OwnableUpgradeable.OwnableStorage" + }, + "typeName": { + "id": 4949, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 4948, + "name": "OwnableStorage", + "nameLocations": [ + "1244:14:38" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 4943, + "src": "1244:14:38" + }, + "referencedDeclaration": 4943, + "src": "1244:14:38", + "typeDescriptions": { + "typeIdentifier": "t_struct$_OwnableStorage_$4943_storage_ptr", + "typeString": "struct OwnableUpgradeable.OwnableStorage" + } + }, + "visibility": "internal" + } + ], + "src": "1243:26:38" + }, + "scope": 5123, + "src": "1192:159:38", + "stateMutability": "pure", + "virtual": false, + "visibility": "private" + }, + { + "documentation": { + "id": 4955, + "nodeType": "StructuredDocumentation", + "src": "1357:85:38", + "text": " @dev The caller account is not authorized to perform an operation." + }, + "errorSelector": "118cdaa7", + "id": 4959, + "name": "OwnableUnauthorizedAccount", + "nameLocation": "1453:26:38", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 4958, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 4957, + "mutability": "mutable", + "name": "account", + "nameLocation": "1488:7:38", + "nodeType": "VariableDeclaration", + "scope": 4959, + "src": "1480:15:38", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 4956, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1480:7:38", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "1479:17:38" + }, + "src": "1447:50:38" + }, + { + "documentation": { + "id": 4960, + "nodeType": "StructuredDocumentation", + "src": "1503:82:38", + "text": " @dev The owner is not a valid owner account. (eg. `address(0)`)" + }, + "errorSelector": "1e4fbdf7", + "id": 4964, + "name": "OwnableInvalidOwner", + "nameLocation": "1596:19:38", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 4963, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 4962, + "mutability": "mutable", + "name": "owner", + "nameLocation": "1624:5:38", + "nodeType": "VariableDeclaration", + "scope": 4964, + "src": "1616:13:38", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 4961, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1616:7:38", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "1615:15:38" + }, + "src": "1590:41:38" + }, + { + "anonymous": false, + "eventSelector": "8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "id": 4970, + "name": "OwnershipTransferred", + "nameLocation": "1643:20:38", + "nodeType": "EventDefinition", + "parameters": { + "id": 4969, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 4966, + "indexed": true, + "mutability": "mutable", + "name": "previousOwner", + "nameLocation": "1680:13:38", + "nodeType": "VariableDeclaration", + "scope": 4970, + "src": "1664:29:38", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 4965, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1664:7:38", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 4968, + "indexed": true, + "mutability": "mutable", + "name": "newOwner", + "nameLocation": "1711:8:38", + "nodeType": "VariableDeclaration", + "scope": 4970, + "src": "1695:24:38", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 4967, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1695:7:38", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "1663:57:38" + }, + "src": "1637:84:38" + }, + { + "body": { + "id": 4982, + "nodeType": "Block", + "src": "1919:55:38", + "statements": [ + { + "expression": { + "arguments": [ + { + "id": 4979, + "name": "initialOwner", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4973, + "src": "1954:12:38", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 4978, + "name": "__Ownable_init_unchained", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5010, + "src": "1929:24:38", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$__$", + "typeString": "function (address)" + } + }, + "id": 4980, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "1929:38:38", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 4981, + "nodeType": "ExpressionStatement", + "src": "1929:38:38" + } + ] + }, + "documentation": { + "id": 4971, + "nodeType": "StructuredDocumentation", + "src": "1727:115:38", + "text": " @dev Initializes the contract setting the address provided by the deployer as the initial owner." + }, + "id": 4983, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "id": 4976, + "kind": "modifierInvocation", + "modifierName": { + "id": 4975, + "name": "onlyInitializing", + "nameLocations": [ + "1902:16:38" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5286, + "src": "1902:16:38" + }, + "nodeType": "ModifierInvocation", + "src": "1902:16:38" + } + ], + "name": "__Ownable_init", + "nameLocation": "1856:14:38", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 4974, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 4973, + "mutability": "mutable", + "name": "initialOwner", + "nameLocation": "1879:12:38", + "nodeType": "VariableDeclaration", + "scope": 4983, + "src": "1871:20:38", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 4972, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1871:7:38", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "1870:22:38" + }, + "returnParameters": { + "id": 4977, + "nodeType": "ParameterList", + "parameters": [], + "src": "1919:0:38" + }, + "scope": 5123, + "src": "1847:127:38", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 5009, + "nodeType": "Block", + "src": "2062:153:38", + "statements": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 4995, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 4990, + "name": "initialOwner", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4985, + "src": "2076:12:38", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "arguments": [ + { + "hexValue": "30", + "id": 4993, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2100:1:38", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 4992, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "2092:7:38", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 4991, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2092:7:38", + "typeDescriptions": {} + } + }, + "id": 4994, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2092:10:38", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "2076:26:38", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 5004, + "nodeType": "IfStatement", + "src": "2072:95:38", + "trueBody": { + "id": 5003, + "nodeType": "Block", + "src": "2104:63:38", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "arguments": [ + { + "hexValue": "30", + "id": 4999, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2153:1:38", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 4998, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "2145:7:38", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 4997, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2145:7:38", + "typeDescriptions": {} + } + }, + "id": 5000, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2145:10:38", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 4996, + "name": "OwnableInvalidOwner", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4964, + "src": "2125:19:38", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_address_$returns$_t_error_$", + "typeString": "function (address) pure returns (error)" + } + }, + "id": 5001, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2125:31:38", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 5002, + "nodeType": "RevertStatement", + "src": "2118:38:38" + } + ] + } + }, + { + "expression": { + "arguments": [ + { + "id": 5006, + "name": "initialOwner", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4985, + "src": "2195:12:38", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 5005, + "name": "_transferOwnership", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5122, + "src": "2176:18:38", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$__$", + "typeString": "function (address)" + } + }, + "id": 5007, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2176:32:38", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 5008, + "nodeType": "ExpressionStatement", + "src": "2176:32:38" + } + ] + }, + "id": 5010, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "id": 4988, + "kind": "modifierInvocation", + "modifierName": { + "id": 4987, + "name": "onlyInitializing", + "nameLocations": [ + "2045:16:38" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5286, + "src": "2045:16:38" + }, + "nodeType": "ModifierInvocation", + "src": "2045:16:38" + } + ], + "name": "__Ownable_init_unchained", + "nameLocation": "1989:24:38", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 4986, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 4985, + "mutability": "mutable", + "name": "initialOwner", + "nameLocation": "2022:12:38", + "nodeType": "VariableDeclaration", + "scope": 5010, + "src": "2014:20:38", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 4984, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2014:7:38", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "2013:22:38" + }, + "returnParameters": { + "id": 4989, + "nodeType": "ParameterList", + "parameters": [], + "src": "2062:0:38" + }, + "scope": 5123, + "src": "1980:235:38", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 5017, + "nodeType": "Block", + "src": "2324:41:38", + "statements": [ + { + "expression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 5013, + "name": "_checkOwner", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5051, + "src": "2334:11:38", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$__$", + "typeString": "function () view" + } + }, + "id": 5014, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2334:13:38", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 5015, + "nodeType": "ExpressionStatement", + "src": "2334:13:38" + }, + { + "id": 5016, + "nodeType": "PlaceholderStatement", + "src": "2357:1:38" + } + ] + }, + "documentation": { + "id": 5011, + "nodeType": "StructuredDocumentation", + "src": "2221:77:38", + "text": " @dev Throws if called by any account other than the owner." + }, + "id": 5018, + "name": "onlyOwner", + "nameLocation": "2312:9:38", + "nodeType": "ModifierDefinition", + "parameters": { + "id": 5012, + "nodeType": "ParameterList", + "parameters": [], + "src": "2321:2:38" + }, + "src": "2303:62:38", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 5033, + "nodeType": "Block", + "src": "2496:89:38", + "statements": [ + { + "assignments": [ + 5026 + ], + "declarations": [ + { + "constant": false, + "id": 5026, + "mutability": "mutable", + "name": "$", + "nameLocation": "2529:1:38", + "nodeType": "VariableDeclaration", + "scope": 5033, + "src": "2506:24:38", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_OwnableStorage_$4943_storage_ptr", + "typeString": "struct OwnableUpgradeable.OwnableStorage" + }, + "typeName": { + "id": 5025, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 5024, + "name": "OwnableStorage", + "nameLocations": [ + "2506:14:38" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 4943, + "src": "2506:14:38" + }, + "referencedDeclaration": 4943, + "src": "2506:14:38", + "typeDescriptions": { + "typeIdentifier": "t_struct$_OwnableStorage_$4943_storage_ptr", + "typeString": "struct OwnableUpgradeable.OwnableStorage" + } + }, + "visibility": "internal" + } + ], + "id": 5029, + "initialValue": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 5027, + "name": "_getOwnableStorage", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4954, + "src": "2533:18:38", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$__$returns$_t_struct$_OwnableStorage_$4943_storage_ptr_$", + "typeString": "function () pure returns (struct OwnableUpgradeable.OwnableStorage storage pointer)" + } + }, + "id": 5028, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2533:20:38", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_OwnableStorage_$4943_storage_ptr", + "typeString": "struct OwnableUpgradeable.OwnableStorage storage pointer" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "2506:47:38" + }, + { + "expression": { + "expression": { + "id": 5030, + "name": "$", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5026, + "src": "2570:1:38", + "typeDescriptions": { + "typeIdentifier": "t_struct$_OwnableStorage_$4943_storage_ptr", + "typeString": "struct OwnableUpgradeable.OwnableStorage storage pointer" + } + }, + "id": 5031, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "2572:6:38", + "memberName": "_owner", + "nodeType": "MemberAccess", + "referencedDeclaration": 4942, + "src": "2570:8:38", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "functionReturnParameters": 5023, + "id": 5032, + "nodeType": "Return", + "src": "2563:15:38" + } + ] + }, + "documentation": { + "id": 5019, + "nodeType": "StructuredDocumentation", + "src": "2371:65:38", + "text": " @dev Returns the address of the current owner." + }, + "functionSelector": "8da5cb5b", + "id": 5034, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "owner", + "nameLocation": "2450:5:38", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 5020, + "nodeType": "ParameterList", + "parameters": [], + "src": "2455:2:38" + }, + "returnParameters": { + "id": 5023, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 5022, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 5034, + "src": "2487:7:38", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 5021, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2487:7:38", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "2486:9:38" + }, + "scope": 5123, + "src": "2441:144:38", + "stateMutability": "view", + "virtual": true, + "visibility": "public" + }, + { + "body": { + "id": 5050, + "nodeType": "Block", + "src": "2703:117:38", + "statements": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 5042, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 5038, + "name": "owner", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5034, + "src": "2717:5:38", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_address_$", + "typeString": "function () view returns (address)" + } + }, + "id": 5039, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2717:7:38", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 5040, + "name": "_msgSender", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5419, + "src": "2728:10:38", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_address_$", + "typeString": "function () view returns (address)" + } + }, + "id": 5041, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2728:12:38", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "2717:23:38", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 5049, + "nodeType": "IfStatement", + "src": "2713:101:38", + "trueBody": { + "id": 5048, + "nodeType": "Block", + "src": "2742:72:38", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 5044, + "name": "_msgSender", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5419, + "src": "2790:10:38", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_address_$", + "typeString": "function () view returns (address)" + } + }, + "id": 5045, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2790:12:38", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 5043, + "name": "OwnableUnauthorizedAccount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4959, + "src": "2763:26:38", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_address_$returns$_t_error_$", + "typeString": "function (address) pure returns (error)" + } + }, + "id": 5046, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2763:40:38", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 5047, + "nodeType": "RevertStatement", + "src": "2756:47:38" + } + ] + } + } + ] + }, + "documentation": { + "id": 5035, + "nodeType": "StructuredDocumentation", + "src": "2591:62:38", + "text": " @dev Throws if the sender is not the owner." + }, + "id": 5051, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_checkOwner", + "nameLocation": "2667:11:38", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 5036, + "nodeType": "ParameterList", + "parameters": [], + "src": "2678:2:38" + }, + "returnParameters": { + "id": 5037, + "nodeType": "ParameterList", + "parameters": [], + "src": "2703:0:38" + }, + "scope": 5123, + "src": "2658:162:38", + "stateMutability": "view", + "virtual": true, + "visibility": "internal" + }, + { + "body": { + "id": 5064, + "nodeType": "Block", + "src": "3209:47:38", + "statements": [ + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "hexValue": "30", + "id": 5060, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3246:1:38", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 5059, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "3238:7:38", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 5058, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3238:7:38", + "typeDescriptions": {} + } + }, + "id": 5061, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3238:10:38", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 5057, + "name": "_transferOwnership", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5122, + "src": "3219:18:38", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$__$", + "typeString": "function (address)" + } + }, + "id": 5062, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3219:30:38", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 5063, + "nodeType": "ExpressionStatement", + "src": "3219:30:38" + } + ] + }, + "documentation": { + "id": 5052, + "nodeType": "StructuredDocumentation", + "src": "2826:324:38", + "text": " @dev Leaves the contract without owner. It will not be possible to call\n `onlyOwner` functions. Can only be called by the current owner.\n NOTE: Renouncing ownership will leave the contract without an owner,\n thereby disabling any functionality that is only available to the owner." + }, + "functionSelector": "715018a6", + "id": 5065, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "id": 5055, + "kind": "modifierInvocation", + "modifierName": { + "id": 5054, + "name": "onlyOwner", + "nameLocations": [ + "3199:9:38" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5018, + "src": "3199:9:38" + }, + "nodeType": "ModifierInvocation", + "src": "3199:9:38" + } + ], + "name": "renounceOwnership", + "nameLocation": "3164:17:38", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 5053, + "nodeType": "ParameterList", + "parameters": [], + "src": "3181:2:38" + }, + "returnParameters": { + "id": 5056, + "nodeType": "ParameterList", + "parameters": [], + "src": "3209:0:38" + }, + "scope": 5123, + "src": "3155:101:38", + "stateMutability": "nonpayable", + "virtual": true, + "visibility": "public" + }, + { + "body": { + "id": 5092, + "nodeType": "Block", + "src": "3475:145:38", + "statements": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 5078, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 5073, + "name": "newOwner", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5068, + "src": "3489:8:38", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "arguments": [ + { + "hexValue": "30", + "id": 5076, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3509:1:38", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 5075, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "3501:7:38", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 5074, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3501:7:38", + "typeDescriptions": {} + } + }, + "id": 5077, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3501:10:38", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "3489:22:38", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 5087, + "nodeType": "IfStatement", + "src": "3485:91:38", + "trueBody": { + "id": 5086, + "nodeType": "Block", + "src": "3513:63:38", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "arguments": [ + { + "hexValue": "30", + "id": 5082, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3562:1:38", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 5081, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "3554:7:38", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 5080, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3554:7:38", + "typeDescriptions": {} + } + }, + "id": 5083, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3554:10:38", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 5079, + "name": "OwnableInvalidOwner", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4964, + "src": "3534:19:38", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_address_$returns$_t_error_$", + "typeString": "function (address) pure returns (error)" + } + }, + "id": 5084, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3534:31:38", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 5085, + "nodeType": "RevertStatement", + "src": "3527:38:38" + } + ] + } + }, + { + "expression": { + "arguments": [ + { + "id": 5089, + "name": "newOwner", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5068, + "src": "3604:8:38", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 5088, + "name": "_transferOwnership", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5122, + "src": "3585:18:38", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$__$", + "typeString": "function (address)" + } + }, + "id": 5090, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3585:28:38", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 5091, + "nodeType": "ExpressionStatement", + "src": "3585:28:38" + } + ] + }, + "documentation": { + "id": 5066, + "nodeType": "StructuredDocumentation", + "src": "3262:138:38", + "text": " @dev Transfers ownership of the contract to a new account (`newOwner`).\n Can only be called by the current owner." + }, + "functionSelector": "f2fde38b", + "id": 5093, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "id": 5071, + "kind": "modifierInvocation", + "modifierName": { + "id": 5070, + "name": "onlyOwner", + "nameLocations": [ + "3465:9:38" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5018, + "src": "3465:9:38" + }, + "nodeType": "ModifierInvocation", + "src": "3465:9:38" + } + ], + "name": "transferOwnership", + "nameLocation": "3414:17:38", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 5069, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 5068, + "mutability": "mutable", + "name": "newOwner", + "nameLocation": "3440:8:38", + "nodeType": "VariableDeclaration", + "scope": 5093, + "src": "3432:16:38", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 5067, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3432:7:38", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "3431:18:38" + }, + "returnParameters": { + "id": 5072, + "nodeType": "ParameterList", + "parameters": [], + "src": "3475:0:38" + }, + "scope": 5123, + "src": "3405:215:38", + "stateMutability": "nonpayable", + "virtual": true, + "visibility": "public" + }, + { + "body": { + "id": 5121, + "nodeType": "Block", + "src": "3837:185:38", + "statements": [ + { + "assignments": [ + 5101 + ], + "declarations": [ + { + "constant": false, + "id": 5101, + "mutability": "mutable", + "name": "$", + "nameLocation": "3870:1:38", + "nodeType": "VariableDeclaration", + "scope": 5121, + "src": "3847:24:38", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_OwnableStorage_$4943_storage_ptr", + "typeString": "struct OwnableUpgradeable.OwnableStorage" + }, + "typeName": { + "id": 5100, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 5099, + "name": "OwnableStorage", + "nameLocations": [ + "3847:14:38" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 4943, + "src": "3847:14:38" + }, + "referencedDeclaration": 4943, + "src": "3847:14:38", + "typeDescriptions": { + "typeIdentifier": "t_struct$_OwnableStorage_$4943_storage_ptr", + "typeString": "struct OwnableUpgradeable.OwnableStorage" + } + }, + "visibility": "internal" + } + ], + "id": 5104, + "initialValue": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 5102, + "name": "_getOwnableStorage", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4954, + "src": "3874:18:38", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$__$returns$_t_struct$_OwnableStorage_$4943_storage_ptr_$", + "typeString": "function () pure returns (struct OwnableUpgradeable.OwnableStorage storage pointer)" + } + }, + "id": 5103, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3874:20:38", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_OwnableStorage_$4943_storage_ptr", + "typeString": "struct OwnableUpgradeable.OwnableStorage storage pointer" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "3847:47:38" + }, + { + "assignments": [ + 5106 + ], + "declarations": [ + { + "constant": false, + "id": 5106, + "mutability": "mutable", + "name": "oldOwner", + "nameLocation": "3912:8:38", + "nodeType": "VariableDeclaration", + "scope": 5121, + "src": "3904:16:38", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 5105, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3904:7:38", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "id": 5109, + "initialValue": { + "expression": { + "id": 5107, + "name": "$", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5101, + "src": "3923:1:38", + "typeDescriptions": { + "typeIdentifier": "t_struct$_OwnableStorage_$4943_storage_ptr", + "typeString": "struct OwnableUpgradeable.OwnableStorage storage pointer" + } + }, + "id": 5108, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "3925:6:38", + "memberName": "_owner", + "nodeType": "MemberAccess", + "referencedDeclaration": 4942, + "src": "3923:8:38", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "3904:27:38" + }, + { + "expression": { + "id": 5114, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 5110, + "name": "$", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5101, + "src": "3941:1:38", + "typeDescriptions": { + "typeIdentifier": "t_struct$_OwnableStorage_$4943_storage_ptr", + "typeString": "struct OwnableUpgradeable.OwnableStorage storage pointer" + } + }, + "id": 5112, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberLocation": "3943:6:38", + "memberName": "_owner", + "nodeType": "MemberAccess", + "referencedDeclaration": 4942, + "src": "3941:8:38", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "id": 5113, + "name": "newOwner", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5096, + "src": "3952:8:38", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "3941:19:38", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 5115, + "nodeType": "ExpressionStatement", + "src": "3941:19:38" + }, + { + "eventCall": { + "arguments": [ + { + "id": 5117, + "name": "oldOwner", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5106, + "src": "3996:8:38", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 5118, + "name": "newOwner", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5096, + "src": "4006:8:38", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 5116, + "name": "OwnershipTransferred", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4970, + "src": "3975:20:38", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$returns$__$", + "typeString": "function (address,address)" + } + }, + "id": 5119, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3975:40:38", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 5120, + "nodeType": "EmitStatement", + "src": "3970:45:38" + } + ] + }, + "documentation": { + "id": 5094, + "nodeType": "StructuredDocumentation", + "src": "3626:143:38", + "text": " @dev Transfers ownership of the contract to a new account (`newOwner`).\n Internal function without access restriction." + }, + "id": 5122, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_transferOwnership", + "nameLocation": "3783:18:38", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 5097, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 5096, + "mutability": "mutable", + "name": "newOwner", + "nameLocation": "3810:8:38", + "nodeType": "VariableDeclaration", + "scope": 5122, + "src": "3802:16:38", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 5095, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3802:7:38", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "3801:18:38" + }, + "returnParameters": { + "id": 5098, + "nodeType": "ParameterList", + "parameters": [], + "src": "3837:0:38" + }, + "scope": 5123, + "src": "3774:248:38", + "stateMutability": "nonpayable", + "virtual": true, + "visibility": "internal" + } + ], + "scope": 5124, + "src": "749:3275:38", + "usedErrors": [ + 4959, + 4964, + 5140, + 5143 + ], + "usedEvents": [ + 4970, + 5148 + ] + } + ], + "src": "102:3923:38" + }, + "id": 38 + }, + "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol": { + "ast": { + "absolutePath": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol", + "exportedSymbols": { + "Initializable": [ + 5391 + ] + }, + "id": 5392, + "license": "MIT", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 5125, + "literals": [ + "solidity", + "^", + "0.8", + ".20" + ], + "nodeType": "PragmaDirective", + "src": "113:24:39" + }, + { + "abstract": true, + "baseContracts": [], + "canonicalName": "Initializable", + "contractDependencies": [], + "contractKind": "contract", + "documentation": { + "id": 5126, + "nodeType": "StructuredDocumentation", + "src": "139:2209:39", + "text": " @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\n reused. This mechanism prevents re-execution of each \"step\" but allows the creation of new initialization steps in\n case an upgrade adds a module that needs to be initialized.\n For example:\n [.hljs-theme-light.nopadding]\n ```solidity\n contract MyToken is ERC20Upgradeable {\n function initialize() initializer public {\n __ERC20_init(\"MyToken\", \"MTK\");\n }\n }\n contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\n function initializeV2() reinitializer(2) public {\n __ERC20Permit_init(\"MyToken\");\n }\n }\n ```\n TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n [CAUTION]\n ====\n Avoid leaving a contract uninitialized.\n An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\n the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\n [.hljs-theme-light.nopadding]\n ```\n /// @custom:oz-upgrades-unsafe-allow constructor\n constructor() {\n _disableInitializers();\n }\n ```\n ====" + }, + "fullyImplemented": true, + "id": 5391, + "linearizedBaseContracts": [ + 5391 + ], + "name": "Initializable", + "nameLocation": "2367:13:39", + "nodeType": "ContractDefinition", + "nodes": [ + { + "canonicalName": "Initializable.InitializableStorage", + "documentation": { + "id": 5127, + "nodeType": "StructuredDocumentation", + "src": "2387:293:39", + "text": " @dev Storage of the initializable contract.\n It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions\n when using with upgradeable contracts.\n @custom:storage-location erc7201:openzeppelin.storage.Initializable" + }, + "id": 5134, + "members": [ + { + "constant": false, + "id": 5130, + "mutability": "mutable", + "name": "_initialized", + "nameLocation": "2820:12:39", + "nodeType": "VariableDeclaration", + "scope": 5134, + "src": "2813:19:39", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + }, + "typeName": { + "id": 5129, + "name": "uint64", + "nodeType": "ElementaryTypeName", + "src": "2813:6:39", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 5133, + "mutability": "mutable", + "name": "_initializing", + "nameLocation": "2955:13:39", + "nodeType": "VariableDeclaration", + "scope": 5134, + "src": "2950:18:39", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 5132, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "2950:4:39", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "name": "InitializableStorage", + "nameLocation": "2692:20:39", + "nodeType": "StructDefinition", + "scope": 5391, + "src": "2685:290:39", + "visibility": "public" + }, + { + "constant": true, + "id": 5137, + "mutability": "constant", + "name": "INITIALIZABLE_STORAGE", + "nameLocation": "3123:21:39", + "nodeType": "VariableDeclaration", + "scope": 5391, + "src": "3098:115:39", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 5135, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "3098:7:39", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": { + "hexValue": "307866306335376531363834306466303430663135303838646332663831666533393163333932336265633733653233613936363265666339633232396336613030", + "id": 5136, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3147:66:39", + "typeDescriptions": { + "typeIdentifier": "t_rational_108904022758810753673719992590105913556127789646572562039383141376366747609600_by_1", + "typeString": "int_const 1089...(70 digits omitted)...9600" + }, + "value": "0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00" + }, + "visibility": "private" + }, + { + "documentation": { + "id": 5138, + "nodeType": "StructuredDocumentation", + "src": "3220:60:39", + "text": " @dev The contract is already initialized." + }, + "errorSelector": "f92ee8a9", + "id": 5140, + "name": "InvalidInitialization", + "nameLocation": "3291:21:39", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 5139, + "nodeType": "ParameterList", + "parameters": [], + "src": "3312:2:39" + }, + "src": "3285:30:39" + }, + { + "documentation": { + "id": 5141, + "nodeType": "StructuredDocumentation", + "src": "3321:57:39", + "text": " @dev The contract is not initializing." + }, + "errorSelector": "d7e6bcf8", + "id": 5143, + "name": "NotInitializing", + "nameLocation": "3389:15:39", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 5142, + "nodeType": "ParameterList", + "parameters": [], + "src": "3404:2:39" + }, + "src": "3383:24:39" + }, + { + "anonymous": false, + "documentation": { + "id": 5144, + "nodeType": "StructuredDocumentation", + "src": "3413:90:39", + "text": " @dev Triggered when the contract has been initialized or reinitialized." + }, + "eventSelector": "c7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2", + "id": 5148, + "name": "Initialized", + "nameLocation": "3514:11:39", + "nodeType": "EventDefinition", + "parameters": { + "id": 5147, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 5146, + "indexed": false, + "mutability": "mutable", + "name": "version", + "nameLocation": "3533:7:39", + "nodeType": "VariableDeclaration", + "scope": 5148, + "src": "3526:14:39", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + }, + "typeName": { + "id": 5145, + "name": "uint64", + "nodeType": "ElementaryTypeName", + "src": "3526:6:39", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "visibility": "internal" + } + ], + "src": "3525:16:39" + }, + "src": "3508:34:39" + }, + { + "body": { + "id": 5230, + "nodeType": "Block", + "src": "4092:1079:39", + "statements": [ + { + "assignments": [ + 5153 + ], + "declarations": [ + { + "constant": false, + "id": 5153, + "mutability": "mutable", + "name": "$", + "nameLocation": "4187:1:39", + "nodeType": "VariableDeclaration", + "scope": 5230, + "src": "4158:30:39", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_InitializableStorage_$5134_storage_ptr", + "typeString": "struct Initializable.InitializableStorage" + }, + "typeName": { + "id": 5152, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 5151, + "name": "InitializableStorage", + "nameLocations": [ + "4158:20:39" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5134, + "src": "4158:20:39" + }, + "referencedDeclaration": 5134, + "src": "4158:20:39", + "typeDescriptions": { + "typeIdentifier": "t_struct$_InitializableStorage_$5134_storage_ptr", + "typeString": "struct Initializable.InitializableStorage" + } + }, + "visibility": "internal" + } + ], + "id": 5156, + "initialValue": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 5154, + "name": "_getInitializableStorage", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5390, + "src": "4191:24:39", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$__$returns$_t_struct$_InitializableStorage_$5134_storage_ptr_$", + "typeString": "function () pure returns (struct Initializable.InitializableStorage storage pointer)" + } + }, + "id": 5155, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4191:26:39", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_InitializableStorage_$5134_storage_ptr", + "typeString": "struct Initializable.InitializableStorage storage pointer" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "4158:59:39" + }, + { + "assignments": [ + 5158 + ], + "declarations": [ + { + "constant": false, + "id": 5158, + "mutability": "mutable", + "name": "isTopLevelCall", + "nameLocation": "4284:14:39", + "nodeType": "VariableDeclaration", + "scope": 5230, + "src": "4279:19:39", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 5157, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "4279:4:39", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "id": 5162, + "initialValue": { + "id": 5161, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "4301:16:39", + "subExpression": { + "expression": { + "id": 5159, + "name": "$", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5153, + "src": "4302:1:39", + "typeDescriptions": { + "typeIdentifier": "t_struct$_InitializableStorage_$5134_storage_ptr", + "typeString": "struct Initializable.InitializableStorage storage pointer" + } + }, + "id": 5160, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "4304:13:39", + "memberName": "_initializing", + "nodeType": "MemberAccess", + "referencedDeclaration": 5133, + "src": "4302:15:39", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "4279:38:39" + }, + { + "assignments": [ + 5164 + ], + "declarations": [ + { + "constant": false, + "id": 5164, + "mutability": "mutable", + "name": "initialized", + "nameLocation": "4334:11:39", + "nodeType": "VariableDeclaration", + "scope": 5230, + "src": "4327:18:39", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + }, + "typeName": { + "id": 5163, + "name": "uint64", + "nodeType": "ElementaryTypeName", + "src": "4327:6:39", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "visibility": "internal" + } + ], + "id": 5167, + "initialValue": { + "expression": { + "id": 5165, + "name": "$", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5153, + "src": "4348:1:39", + "typeDescriptions": { + "typeIdentifier": "t_struct$_InitializableStorage_$5134_storage_ptr", + "typeString": "struct Initializable.InitializableStorage storage pointer" + } + }, + "id": 5166, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "4350:12:39", + "memberName": "_initialized", + "nodeType": "MemberAccess", + "referencedDeclaration": 5130, + "src": "4348:14:39", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "4327:35:39" + }, + { + "assignments": [ + 5169 + ], + "declarations": [ + { + "constant": false, + "id": 5169, + "mutability": "mutable", + "name": "initialSetup", + "nameLocation": "4709:12:39", + "nodeType": "VariableDeclaration", + "scope": 5230, + "src": "4704:17:39", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 5168, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "4704:4:39", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "id": 5175, + "initialValue": { + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 5174, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "commonType": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + }, + "id": 5172, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 5170, + "name": "initialized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5164, + "src": "4724:11:39", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "30", + "id": 5171, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4739:1:39", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "4724:16:39", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "&&", + "rightExpression": { + "id": 5173, + "name": "isTopLevelCall", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5158, + "src": "4744:14:39", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "4724:34:39", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "4704:54:39" + }, + { + "assignments": [ + 5177 + ], + "declarations": [ + { + "constant": false, + "id": 5177, + "mutability": "mutable", + "name": "construction", + "nameLocation": "4773:12:39", + "nodeType": "VariableDeclaration", + "scope": 5230, + "src": "4768:17:39", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 5176, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "4768:4:39", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "id": 5190, + "initialValue": { + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 5189, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "commonType": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + }, + "id": 5180, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 5178, + "name": "initialized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5164, + "src": "4788:11:39", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "31", + "id": 5179, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4803:1:39", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "4788:16:39", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "&&", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 5188, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "expression": { + "arguments": [ + { + "id": 5183, + "name": "this", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -28, + "src": "4816:4:39", + "typeDescriptions": { + "typeIdentifier": "t_contract$_Initializable_$5391", + "typeString": "contract Initializable" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_Initializable_$5391", + "typeString": "contract Initializable" + } + ], + "id": 5182, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "4808:7:39", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 5181, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4808:7:39", + "typeDescriptions": {} + } + }, + "id": 5184, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4808:13:39", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 5185, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "4822:4:39", + "memberName": "code", + "nodeType": "MemberAccess", + "src": "4808:18:39", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 5186, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "4827:6:39", + "memberName": "length", + "nodeType": "MemberAccess", + "src": "4808:25:39", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "30", + "id": 5187, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4837:1:39", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "4808:30:39", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "4788:50:39", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "4768:70:39" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 5195, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 5192, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "4853:13:39", + "subExpression": { + "id": 5191, + "name": "initialSetup", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5169, + "src": "4854:12:39", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "&&", + "rightExpression": { + "id": 5194, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "4870:13:39", + "subExpression": { + "id": 5193, + "name": "construction", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5177, + "src": "4871:12:39", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "4853:30:39", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 5200, + "nodeType": "IfStatement", + "src": "4849:91:39", + "trueBody": { + "id": 5199, + "nodeType": "Block", + "src": "4885:55:39", + "statements": [ + { + "errorCall": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 5196, + "name": "InvalidInitialization", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5140, + "src": "4906:21:39", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$__$returns$_t_error_$", + "typeString": "function () pure returns (error)" + } + }, + "id": 5197, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4906:23:39", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 5198, + "nodeType": "RevertStatement", + "src": "4899:30:39" + } + ] + } + }, + { + "expression": { + "id": 5205, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 5201, + "name": "$", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5153, + "src": "4949:1:39", + "typeDescriptions": { + "typeIdentifier": "t_struct$_InitializableStorage_$5134_storage_ptr", + "typeString": "struct Initializable.InitializableStorage storage pointer" + } + }, + "id": 5203, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberLocation": "4951:12:39", + "memberName": "_initialized", + "nodeType": "MemberAccess", + "referencedDeclaration": 5130, + "src": "4949:14:39", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "hexValue": "31", + "id": 5204, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4966:1:39", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "4949:18:39", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "id": 5206, + "nodeType": "ExpressionStatement", + "src": "4949:18:39" + }, + { + "condition": { + "id": 5207, + "name": "isTopLevelCall", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5158, + "src": "4981:14:39", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 5215, + "nodeType": "IfStatement", + "src": "4977:67:39", + "trueBody": { + "id": 5214, + "nodeType": "Block", + "src": "4997:47:39", + "statements": [ + { + "expression": { + "id": 5212, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 5208, + "name": "$", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5153, + "src": "5011:1:39", + "typeDescriptions": { + "typeIdentifier": "t_struct$_InitializableStorage_$5134_storage_ptr", + "typeString": "struct Initializable.InitializableStorage storage pointer" + } + }, + "id": 5210, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberLocation": "5013:13:39", + "memberName": "_initializing", + "nodeType": "MemberAccess", + "referencedDeclaration": 5133, + "src": "5011:15:39", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "hexValue": "74727565", + "id": 5211, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "5029:4:39", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "true" + }, + "src": "5011:22:39", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 5213, + "nodeType": "ExpressionStatement", + "src": "5011:22:39" + } + ] + } + }, + { + "id": 5216, + "nodeType": "PlaceholderStatement", + "src": "5053:1:39" + }, + { + "condition": { + "id": 5217, + "name": "isTopLevelCall", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5158, + "src": "5068:14:39", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 5229, + "nodeType": "IfStatement", + "src": "5064:101:39", + "trueBody": { + "id": 5228, + "nodeType": "Block", + "src": "5084:81:39", + "statements": [ + { + "expression": { + "id": 5222, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 5218, + "name": "$", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5153, + "src": "5098:1:39", + "typeDescriptions": { + "typeIdentifier": "t_struct$_InitializableStorage_$5134_storage_ptr", + "typeString": "struct Initializable.InitializableStorage storage pointer" + } + }, + "id": 5220, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberLocation": "5100:13:39", + "memberName": "_initializing", + "nodeType": "MemberAccess", + "referencedDeclaration": 5133, + "src": "5098:15:39", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "hexValue": "66616c7365", + "id": 5221, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "5116:5:39", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + }, + "src": "5098:23:39", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 5223, + "nodeType": "ExpressionStatement", + "src": "5098:23:39" + }, + { + "eventCall": { + "arguments": [ + { + "hexValue": "31", + "id": 5225, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "5152:1:39", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + } + ], + "id": 5224, + "name": "Initialized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5148, + "src": "5140:11:39", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_uint64_$returns$__$", + "typeString": "function (uint64)" + } + }, + "id": 5226, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5140:14:39", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 5227, + "nodeType": "EmitStatement", + "src": "5135:19:39" + } + ] + } + } + ] + }, + "documentation": { + "id": 5149, + "nodeType": "StructuredDocumentation", + "src": "3548:516:39", + "text": " @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\n `onlyInitializing` functions can be used to initialize parent contracts.\n Similar to `reinitializer(1)`, except that in the context of a constructor an `initializer` may be invoked any\n number of times. This behavior in the constructor can be useful during testing and is not expected to be used in\n production.\n Emits an {Initialized} event." + }, + "id": 5231, + "name": "initializer", + "nameLocation": "4078:11:39", + "nodeType": "ModifierDefinition", + "parameters": { + "id": 5150, + "nodeType": "ParameterList", + "parameters": [], + "src": "4089:2:39" + }, + "src": "4069:1102:39", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 5277, + "nodeType": "Block", + "src": "6289:392:39", + "statements": [ + { + "assignments": [ + 5238 + ], + "declarations": [ + { + "constant": false, + "id": 5238, + "mutability": "mutable", + "name": "$", + "nameLocation": "6384:1:39", + "nodeType": "VariableDeclaration", + "scope": 5277, + "src": "6355:30:39", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_InitializableStorage_$5134_storage_ptr", + "typeString": "struct Initializable.InitializableStorage" + }, + "typeName": { + "id": 5237, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 5236, + "name": "InitializableStorage", + "nameLocations": [ + "6355:20:39" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5134, + "src": "6355:20:39" + }, + "referencedDeclaration": 5134, + "src": "6355:20:39", + "typeDescriptions": { + "typeIdentifier": "t_struct$_InitializableStorage_$5134_storage_ptr", + "typeString": "struct Initializable.InitializableStorage" + } + }, + "visibility": "internal" + } + ], + "id": 5241, + "initialValue": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 5239, + "name": "_getInitializableStorage", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5390, + "src": "6388:24:39", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$__$returns$_t_struct$_InitializableStorage_$5134_storage_ptr_$", + "typeString": "function () pure returns (struct Initializable.InitializableStorage storage pointer)" + } + }, + "id": 5240, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "6388:26:39", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_InitializableStorage_$5134_storage_ptr", + "typeString": "struct Initializable.InitializableStorage storage pointer" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "6355:59:39" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 5248, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 5242, + "name": "$", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5238, + "src": "6429:1:39", + "typeDescriptions": { + "typeIdentifier": "t_struct$_InitializableStorage_$5134_storage_ptr", + "typeString": "struct Initializable.InitializableStorage storage pointer" + } + }, + "id": 5243, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "6431:13:39", + "memberName": "_initializing", + "nodeType": "MemberAccess", + "referencedDeclaration": 5133, + "src": "6429:15:39", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "||", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + }, + "id": 5247, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 5244, + "name": "$", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5238, + "src": "6448:1:39", + "typeDescriptions": { + "typeIdentifier": "t_struct$_InitializableStorage_$5134_storage_ptr", + "typeString": "struct Initializable.InitializableStorage storage pointer" + } + }, + "id": 5245, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "6450:12:39", + "memberName": "_initialized", + "nodeType": "MemberAccess", + "referencedDeclaration": 5130, + "src": "6448:14:39", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "id": 5246, + "name": "version", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5234, + "src": "6466:7:39", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "src": "6448:25:39", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "6429:44:39", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 5253, + "nodeType": "IfStatement", + "src": "6425:105:39", + "trueBody": { + "id": 5252, + "nodeType": "Block", + "src": "6475:55:39", + "statements": [ + { + "errorCall": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 5249, + "name": "InvalidInitialization", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5140, + "src": "6496:21:39", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$__$returns$_t_error_$", + "typeString": "function () pure returns (error)" + } + }, + "id": 5250, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "6496:23:39", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 5251, + "nodeType": "RevertStatement", + "src": "6489:30:39" + } + ] + } + }, + { + "expression": { + "id": 5258, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 5254, + "name": "$", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5238, + "src": "6539:1:39", + "typeDescriptions": { + "typeIdentifier": "t_struct$_InitializableStorage_$5134_storage_ptr", + "typeString": "struct Initializable.InitializableStorage storage pointer" + } + }, + "id": 5256, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberLocation": "6541:12:39", + "memberName": "_initialized", + "nodeType": "MemberAccess", + "referencedDeclaration": 5130, + "src": "6539:14:39", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "id": 5257, + "name": "version", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5234, + "src": "6556:7:39", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "src": "6539:24:39", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "id": 5259, + "nodeType": "ExpressionStatement", + "src": "6539:24:39" + }, + { + "expression": { + "id": 5264, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 5260, + "name": "$", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5238, + "src": "6573:1:39", + "typeDescriptions": { + "typeIdentifier": "t_struct$_InitializableStorage_$5134_storage_ptr", + "typeString": "struct Initializable.InitializableStorage storage pointer" + } + }, + "id": 5262, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberLocation": "6575:13:39", + "memberName": "_initializing", + "nodeType": "MemberAccess", + "referencedDeclaration": 5133, + "src": "6573:15:39", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "hexValue": "74727565", + "id": 5263, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6591:4:39", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "true" + }, + "src": "6573:22:39", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 5265, + "nodeType": "ExpressionStatement", + "src": "6573:22:39" + }, + { + "id": 5266, + "nodeType": "PlaceholderStatement", + "src": "6605:1:39" + }, + { + "expression": { + "id": 5271, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 5267, + "name": "$", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5238, + "src": "6616:1:39", + "typeDescriptions": { + "typeIdentifier": "t_struct$_InitializableStorage_$5134_storage_ptr", + "typeString": "struct Initializable.InitializableStorage storage pointer" + } + }, + "id": 5269, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberLocation": "6618:13:39", + "memberName": "_initializing", + "nodeType": "MemberAccess", + "referencedDeclaration": 5133, + "src": "6616:15:39", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "hexValue": "66616c7365", + "id": 5270, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6634:5:39", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + }, + "src": "6616:23:39", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 5272, + "nodeType": "ExpressionStatement", + "src": "6616:23:39" + }, + { + "eventCall": { + "arguments": [ + { + "id": 5274, + "name": "version", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5234, + "src": "6666:7:39", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + ], + "id": 5273, + "name": "Initialized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5148, + "src": "6654:11:39", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_uint64_$returns$__$", + "typeString": "function (uint64)" + } + }, + "id": 5275, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "6654:20:39", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 5276, + "nodeType": "EmitStatement", + "src": "6649:25:39" + } + ] + }, + "documentation": { + "id": 5232, + "nodeType": "StructuredDocumentation", + "src": "5177:1068:39", + "text": " @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\n contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\n used to initialize parent contracts.\n A reinitializer may be used after the original initialization step. This is essential to configure modules that\n are added through upgrades and that require initialization.\n When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\n cannot be nested. If one is invoked in the context of another, execution will revert.\n Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\n a contract, executing them in the right order is up to the developer or operator.\n WARNING: Setting the version to 2**64 - 1 will prevent any future reinitialization.\n Emits an {Initialized} event." + }, + "id": 5278, + "name": "reinitializer", + "nameLocation": "6259:13:39", + "nodeType": "ModifierDefinition", + "parameters": { + "id": 5235, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 5234, + "mutability": "mutable", + "name": "version", + "nameLocation": "6280:7:39", + "nodeType": "VariableDeclaration", + "scope": 5278, + "src": "6273:14:39", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + }, + "typeName": { + "id": 5233, + "name": "uint64", + "nodeType": "ElementaryTypeName", + "src": "6273:6:39", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "visibility": "internal" + } + ], + "src": "6272:16:39" + }, + "src": "6250:431:39", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 5285, + "nodeType": "Block", + "src": "6919:48:39", + "statements": [ + { + "expression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 5281, + "name": "_checkInitializing", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5299, + "src": "6929:18:39", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$__$", + "typeString": "function () view" + } + }, + "id": 5282, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "6929:20:39", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 5283, + "nodeType": "ExpressionStatement", + "src": "6929:20:39" + }, + { + "id": 5284, + "nodeType": "PlaceholderStatement", + "src": "6959:1:39" + } + ] + }, + "documentation": { + "id": 5279, + "nodeType": "StructuredDocumentation", + "src": "6687:199:39", + "text": " @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n {initializer} and {reinitializer} modifiers, directly or indirectly." + }, + "id": 5286, + "name": "onlyInitializing", + "nameLocation": "6900:16:39", + "nodeType": "ModifierDefinition", + "parameters": { + "id": 5280, + "nodeType": "ParameterList", + "parameters": [], + "src": "6916:2:39" + }, + "src": "6891:76:39", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 5298, + "nodeType": "Block", + "src": "7134:89:39", + "statements": [ + { + "condition": { + "id": 5292, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "7148:18:39", + "subExpression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 5290, + "name": "_isInitializing", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5367, + "src": "7149:15:39", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_bool_$", + "typeString": "function () view returns (bool)" + } + }, + "id": 5291, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "7149:17:39", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 5297, + "nodeType": "IfStatement", + "src": "7144:73:39", + "trueBody": { + "id": 5296, + "nodeType": "Block", + "src": "7168:49:39", + "statements": [ + { + "errorCall": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 5293, + "name": "NotInitializing", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5143, + "src": "7189:15:39", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$__$returns$_t_error_$", + "typeString": "function () pure returns (error)" + } + }, + "id": 5294, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "7189:17:39", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 5295, + "nodeType": "RevertStatement", + "src": "7182:24:39" + } + ] + } + } + ] + }, + "documentation": { + "id": 5287, + "nodeType": "StructuredDocumentation", + "src": "6973:104:39", + "text": " @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}." + }, + "id": 5299, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_checkInitializing", + "nameLocation": "7091:18:39", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 5288, + "nodeType": "ParameterList", + "parameters": [], + "src": "7109:2:39" + }, + "returnParameters": { + "id": 5289, + "nodeType": "ParameterList", + "parameters": [], + "src": "7134:0:39" + }, + "scope": 5391, + "src": "7082:141:39", + "stateMutability": "view", + "virtual": true, + "visibility": "internal" + }, + { + "body": { + "id": 5344, + "nodeType": "Block", + "src": "7758:373:39", + "statements": [ + { + "assignments": [ + 5305 + ], + "declarations": [ + { + "constant": false, + "id": 5305, + "mutability": "mutable", + "name": "$", + "nameLocation": "7853:1:39", + "nodeType": "VariableDeclaration", + "scope": 5344, + "src": "7824:30:39", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_InitializableStorage_$5134_storage_ptr", + "typeString": "struct Initializable.InitializableStorage" + }, + "typeName": { + "id": 5304, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 5303, + "name": "InitializableStorage", + "nameLocations": [ + "7824:20:39" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5134, + "src": "7824:20:39" + }, + "referencedDeclaration": 5134, + "src": "7824:20:39", + "typeDescriptions": { + "typeIdentifier": "t_struct$_InitializableStorage_$5134_storage_ptr", + "typeString": "struct Initializable.InitializableStorage" + } + }, + "visibility": "internal" + } + ], + "id": 5308, + "initialValue": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 5306, + "name": "_getInitializableStorage", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5390, + "src": "7857:24:39", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$__$returns$_t_struct$_InitializableStorage_$5134_storage_ptr_$", + "typeString": "function () pure returns (struct Initializable.InitializableStorage storage pointer)" + } + }, + "id": 5307, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "7857:26:39", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_InitializableStorage_$5134_storage_ptr", + "typeString": "struct Initializable.InitializableStorage storage pointer" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "7824:59:39" + }, + { + "condition": { + "expression": { + "id": 5309, + "name": "$", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5305, + "src": "7898:1:39", + "typeDescriptions": { + "typeIdentifier": "t_struct$_InitializableStorage_$5134_storage_ptr", + "typeString": "struct Initializable.InitializableStorage storage pointer" + } + }, + "id": 5310, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "7900:13:39", + "memberName": "_initializing", + "nodeType": "MemberAccess", + "referencedDeclaration": 5133, + "src": "7898:15:39", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 5315, + "nodeType": "IfStatement", + "src": "7894:76:39", + "trueBody": { + "id": 5314, + "nodeType": "Block", + "src": "7915:55:39", + "statements": [ + { + "errorCall": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 5311, + "name": "InvalidInitialization", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5140, + "src": "7936:21:39", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$__$returns$_t_error_$", + "typeString": "function () pure returns (error)" + } + }, + "id": 5312, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "7936:23:39", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 5313, + "nodeType": "RevertStatement", + "src": "7929:30:39" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + }, + "id": 5323, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 5316, + "name": "$", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5305, + "src": "7983:1:39", + "typeDescriptions": { + "typeIdentifier": "t_struct$_InitializableStorage_$5134_storage_ptr", + "typeString": "struct Initializable.InitializableStorage storage pointer" + } + }, + "id": 5317, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "7985:12:39", + "memberName": "_initialized", + "nodeType": "MemberAccess", + "referencedDeclaration": 5130, + "src": "7983:14:39", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "expression": { + "arguments": [ + { + "id": 5320, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "8006:6:39", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint64_$", + "typeString": "type(uint64)" + }, + "typeName": { + "id": 5319, + "name": "uint64", + "nodeType": "ElementaryTypeName", + "src": "8006:6:39", + "typeDescriptions": {} + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_type$_t_uint64_$", + "typeString": "type(uint64)" + } + ], + "id": 5318, + "name": "type", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -27, + "src": "8001:4:39", + "typeDescriptions": { + "typeIdentifier": "t_function_metatype_pure$__$returns$__$", + "typeString": "function () pure" + } + }, + "id": 5321, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "8001:12:39", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_magic_meta_type_t_uint64", + "typeString": "type(uint64)" + } + }, + "id": 5322, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "8014:3:39", + "memberName": "max", + "nodeType": "MemberAccess", + "src": "8001:16:39", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "src": "7983:34:39", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 5343, + "nodeType": "IfStatement", + "src": "7979:146:39", + "trueBody": { + "id": 5342, + "nodeType": "Block", + "src": "8019:106:39", + "statements": [ + { + "expression": { + "id": 5332, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 5324, + "name": "$", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5305, + "src": "8033:1:39", + "typeDescriptions": { + "typeIdentifier": "t_struct$_InitializableStorage_$5134_storage_ptr", + "typeString": "struct Initializable.InitializableStorage storage pointer" + } + }, + "id": 5326, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberLocation": "8035:12:39", + "memberName": "_initialized", + "nodeType": "MemberAccess", + "referencedDeclaration": 5130, + "src": "8033:14:39", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "expression": { + "arguments": [ + { + "id": 5329, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "8055:6:39", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint64_$", + "typeString": "type(uint64)" + }, + "typeName": { + "id": 5328, + "name": "uint64", + "nodeType": "ElementaryTypeName", + "src": "8055:6:39", + "typeDescriptions": {} + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_type$_t_uint64_$", + "typeString": "type(uint64)" + } + ], + "id": 5327, + "name": "type", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -27, + "src": "8050:4:39", + "typeDescriptions": { + "typeIdentifier": "t_function_metatype_pure$__$returns$__$", + "typeString": "function () pure" + } + }, + "id": 5330, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "8050:12:39", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_magic_meta_type_t_uint64", + "typeString": "type(uint64)" + } + }, + "id": 5331, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "8063:3:39", + "memberName": "max", + "nodeType": "MemberAccess", + "src": "8050:16:39", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "src": "8033:33:39", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "id": 5333, + "nodeType": "ExpressionStatement", + "src": "8033:33:39" + }, + { + "eventCall": { + "arguments": [ + { + "expression": { + "arguments": [ + { + "id": 5337, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "8102:6:39", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint64_$", + "typeString": "type(uint64)" + }, + "typeName": { + "id": 5336, + "name": "uint64", + "nodeType": "ElementaryTypeName", + "src": "8102:6:39", + "typeDescriptions": {} + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_type$_t_uint64_$", + "typeString": "type(uint64)" + } + ], + "id": 5335, + "name": "type", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -27, + "src": "8097:4:39", + "typeDescriptions": { + "typeIdentifier": "t_function_metatype_pure$__$returns$__$", + "typeString": "function () pure" + } + }, + "id": 5338, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "8097:12:39", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_magic_meta_type_t_uint64", + "typeString": "type(uint64)" + } + }, + "id": 5339, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "8110:3:39", + "memberName": "max", + "nodeType": "MemberAccess", + "src": "8097:16:39", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + ], + "id": 5334, + "name": "Initialized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5148, + "src": "8085:11:39", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_uint64_$returns$__$", + "typeString": "function (uint64)" + } + }, + "id": 5340, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "8085:29:39", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 5341, + "nodeType": "EmitStatement", + "src": "8080:34:39" + } + ] + } + } + ] + }, + "documentation": { + "id": 5300, + "nodeType": "StructuredDocumentation", + "src": "7229:475:39", + "text": " @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\n Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\n to any version. It is recommended to use this to lock implementation contracts that are designed to be called\n through proxies.\n Emits an {Initialized} event the first time it is successfully executed." + }, + "id": 5345, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_disableInitializers", + "nameLocation": "7718:20:39", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 5301, + "nodeType": "ParameterList", + "parameters": [], + "src": "7738:2:39" + }, + "returnParameters": { + "id": 5302, + "nodeType": "ParameterList", + "parameters": [], + "src": "7758:0:39" + }, + "scope": 5391, + "src": "7709:422:39", + "stateMutability": "nonpayable", + "virtual": true, + "visibility": "internal" + }, + { + "body": { + "id": 5355, + "nodeType": "Block", + "src": "8306:63:39", + "statements": [ + { + "expression": { + "expression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 5351, + "name": "_getInitializableStorage", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5390, + "src": "8323:24:39", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$__$returns$_t_struct$_InitializableStorage_$5134_storage_ptr_$", + "typeString": "function () pure returns (struct Initializable.InitializableStorage storage pointer)" + } + }, + "id": 5352, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "8323:26:39", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_InitializableStorage_$5134_storage_ptr", + "typeString": "struct Initializable.InitializableStorage storage pointer" + } + }, + "id": 5353, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "8350:12:39", + "memberName": "_initialized", + "nodeType": "MemberAccess", + "referencedDeclaration": 5130, + "src": "8323:39:39", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "functionReturnParameters": 5350, + "id": 5354, + "nodeType": "Return", + "src": "8316:46:39" + } + ] + }, + "documentation": { + "id": 5346, + "nodeType": "StructuredDocumentation", + "src": "8137:99:39", + "text": " @dev Returns the highest version that has been initialized. See {reinitializer}." + }, + "id": 5356, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_getInitializedVersion", + "nameLocation": "8250:22:39", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 5347, + "nodeType": "ParameterList", + "parameters": [], + "src": "8272:2:39" + }, + "returnParameters": { + "id": 5350, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 5349, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 5356, + "src": "8298:6:39", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + }, + "typeName": { + "id": 5348, + "name": "uint64", + "nodeType": "ElementaryTypeName", + "src": "8298:6:39", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "visibility": "internal" + } + ], + "src": "8297:8:39" + }, + "scope": 5391, + "src": "8241:128:39", + "stateMutability": "view", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 5366, + "nodeType": "Block", + "src": "8541:64:39", + "statements": [ + { + "expression": { + "expression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 5362, + "name": "_getInitializableStorage", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5390, + "src": "8558:24:39", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$__$returns$_t_struct$_InitializableStorage_$5134_storage_ptr_$", + "typeString": "function () pure returns (struct Initializable.InitializableStorage storage pointer)" + } + }, + "id": 5363, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "8558:26:39", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_InitializableStorage_$5134_storage_ptr", + "typeString": "struct Initializable.InitializableStorage storage pointer" + } + }, + "id": 5364, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "8585:13:39", + "memberName": "_initializing", + "nodeType": "MemberAccess", + "referencedDeclaration": 5133, + "src": "8558:40:39", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "functionReturnParameters": 5361, + "id": 5365, + "nodeType": "Return", + "src": "8551:47:39" + } + ] + }, + "documentation": { + "id": 5357, + "nodeType": "StructuredDocumentation", + "src": "8375:105:39", + "text": " @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}." + }, + "id": 5367, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_isInitializing", + "nameLocation": "8494:15:39", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 5358, + "nodeType": "ParameterList", + "parameters": [], + "src": "8509:2:39" + }, + "returnParameters": { + "id": 5361, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 5360, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 5367, + "src": "8535:4:39", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 5359, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "8535:4:39", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "src": "8534:6:39" + }, + "scope": 5391, + "src": "8485:120:39", + "stateMutability": "view", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 5375, + "nodeType": "Block", + "src": "8896:45:39", + "statements": [ + { + "expression": { + "id": 5373, + "name": "INITIALIZABLE_STORAGE", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5137, + "src": "8913:21:39", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "functionReturnParameters": 5372, + "id": 5374, + "nodeType": "Return", + "src": "8906:28:39" + } + ] + }, + "documentation": { + "id": 5368, + "nodeType": "StructuredDocumentation", + "src": "8611:203:39", + "text": " @dev Pointer to storage slot. Allows integrators to override it with a custom storage location.\n NOTE: Consider following the ERC-7201 formula to derive storage locations." + }, + "id": 5376, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_initializableStorageSlot", + "nameLocation": "8828:25:39", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 5369, + "nodeType": "ParameterList", + "parameters": [], + "src": "8853:2:39" + }, + "returnParameters": { + "id": 5372, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 5371, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 5376, + "src": "8887:7:39", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 5370, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "8887:7:39", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "8886:9:39" + }, + "scope": 5391, + "src": "8819:122:39", + "stateMutability": "pure", + "virtual": true, + "visibility": "internal" + }, + { + "body": { + "id": 5389, + "nodeType": "Block", + "src": "9161:115:39", + "statements": [ + { + "assignments": [ + 5384 + ], + "declarations": [ + { + "constant": false, + "id": 5384, + "mutability": "mutable", + "name": "slot", + "nameLocation": "9179:4:39", + "nodeType": "VariableDeclaration", + "scope": 5389, + "src": "9171:12:39", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 5383, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "9171:7:39", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "id": 5387, + "initialValue": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 5385, + "name": "_initializableStorageSlot", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5376, + "src": "9186:25:39", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$__$returns$_t_bytes32_$", + "typeString": "function () pure returns (bytes32)" + } + }, + "id": 5386, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "9186:27:39", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "9171:42:39" + }, + { + "AST": { + "nativeSrc": "9232:38:39", + "nodeType": "YulBlock", + "src": "9232:38:39", + "statements": [ + { + "nativeSrc": "9246:14:39", + "nodeType": "YulAssignment", + "src": "9246:14:39", + "value": { + "name": "slot", + "nativeSrc": "9256:4:39", + "nodeType": "YulIdentifier", + "src": "9256:4:39" + }, + "variableNames": [ + { + "name": "$.slot", + "nativeSrc": "9246:6:39", + "nodeType": "YulIdentifier", + "src": "9246:6:39" + } + ] + } + ] + }, + "evmVersion": "paris", + "externalReferences": [ + { + "declaration": 5381, + "isOffset": false, + "isSlot": true, + "src": "9246:6:39", + "suffix": "slot", + "valueSize": 1 + }, + { + "declaration": 5384, + "isOffset": false, + "isSlot": false, + "src": "9256:4:39", + "valueSize": 1 + } + ], + "id": 5388, + "nodeType": "InlineAssembly", + "src": "9223:47:39" + } + ] + }, + "documentation": { + "id": 5377, + "nodeType": "StructuredDocumentation", + "src": "8947:67:39", + "text": " @dev Returns a pointer to the storage namespace." + }, + "id": 5390, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_getInitializableStorage", + "nameLocation": "9080:24:39", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 5378, + "nodeType": "ParameterList", + "parameters": [], + "src": "9104:2:39" + }, + "returnParameters": { + "id": 5382, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 5381, + "mutability": "mutable", + "name": "$", + "nameLocation": "9158:1:39", + "nodeType": "VariableDeclaration", + "scope": 5390, + "src": "9129:30:39", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_InitializableStorage_$5134_storage_ptr", + "typeString": "struct Initializable.InitializableStorage" + }, + "typeName": { + "id": 5380, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 5379, + "name": "InitializableStorage", + "nameLocations": [ + "9129:20:39" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5134, + "src": "9129:20:39" + }, + "referencedDeclaration": 5134, + "src": "9129:20:39", + "typeDescriptions": { + "typeIdentifier": "t_struct$_InitializableStorage_$5134_storage_ptr", + "typeString": "struct Initializable.InitializableStorage" + } + }, + "visibility": "internal" + } + ], + "src": "9128:32:39" + }, + "scope": 5391, + "src": "9071:205:39", + "stateMutability": "pure", + "virtual": false, + "visibility": "private" + } + ], + "scope": 5392, + "src": "2349:6929:39", + "usedErrors": [ + 5140, + 5143 + ], + "usedEvents": [ + 5148 + ] + } + ], + "src": "113:9166:39" + }, + "id": 39 + }, + "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol": { + "ast": { + "absolutePath": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol", + "exportedSymbols": { + "ContextUpgradeable": [ + 5437 + ], + "Initializable": [ + 5391 + ] + }, + "id": 5438, + "license": "MIT", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 5393, + "literals": [ + "solidity", + "^", + "0.8", + ".20" + ], + "nodeType": "PragmaDirective", + "src": "101:24:40" + }, + { + "absolutePath": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol", + "file": "../proxy/utils/Initializable.sol", + "id": 5395, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 5438, + "sourceUnit": 5392, + "src": "126:63:40", + "symbolAliases": [ + { + "foreign": { + "id": 5394, + "name": "Initializable", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5391, + "src": "134:13:40", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "abstract": true, + "baseContracts": [ + { + "baseName": { + "id": 5397, + "name": "Initializable", + "nameLocations": [ + "728:13:40" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5391, + "src": "728:13:40" + }, + "id": 5398, + "nodeType": "InheritanceSpecifier", + "src": "728:13:40" + } + ], + "canonicalName": "ContextUpgradeable", + "contractDependencies": [], + "contractKind": "contract", + "documentation": { + "id": 5396, + "nodeType": "StructuredDocumentation", + "src": "191:496:40", + "text": " @dev Provides information about the current execution context, including the\n sender of the transaction and its data. While these are generally available\n via msg.sender and msg.data, they should not be accessed in such a direct\n manner, since when dealing with meta-transactions the account sending and\n paying for execution may not be the actual sender (as far as an application\n is concerned).\n This contract is only required for intermediate, library-like contracts." + }, + "fullyImplemented": true, + "id": 5437, + "linearizedBaseContracts": [ + 5437, + 5391 + ], + "name": "ContextUpgradeable", + "nameLocation": "706:18:40", + "nodeType": "ContractDefinition", + "nodes": [ + { + "body": { + "id": 5403, + "nodeType": "Block", + "src": "800:7:40", + "statements": [] + }, + "id": 5404, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "id": 5401, + "kind": "modifierInvocation", + "modifierName": { + "id": 5400, + "name": "onlyInitializing", + "nameLocations": [ + "783:16:40" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5286, + "src": "783:16:40" + }, + "nodeType": "ModifierInvocation", + "src": "783:16:40" + } + ], + "name": "__Context_init", + "nameLocation": "757:14:40", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 5399, + "nodeType": "ParameterList", + "parameters": [], + "src": "771:2:40" + }, + "returnParameters": { + "id": 5402, + "nodeType": "ParameterList", + "parameters": [], + "src": "800:0:40" + }, + "scope": 5437, + "src": "748:59:40", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 5409, + "nodeType": "Block", + "src": "875:7:40", + "statements": [] + }, + "id": 5410, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "id": 5407, + "kind": "modifierInvocation", + "modifierName": { + "id": 5406, + "name": "onlyInitializing", + "nameLocations": [ + "858:16:40" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5286, + "src": "858:16:40" + }, + "nodeType": "ModifierInvocation", + "src": "858:16:40" + } + ], + "name": "__Context_init_unchained", + "nameLocation": "822:24:40", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 5405, + "nodeType": "ParameterList", + "parameters": [], + "src": "846:2:40" + }, + "returnParameters": { + "id": 5408, + "nodeType": "ParameterList", + "parameters": [], + "src": "875:0:40" + }, + "scope": 5437, + "src": "813:69:40", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 5418, + "nodeType": "Block", + "src": "949:34:40", + "statements": [ + { + "expression": { + "expression": { + "id": 5415, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "966:3:40", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 5416, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "970:6:40", + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "966:10:40", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "functionReturnParameters": 5414, + "id": 5417, + "nodeType": "Return", + "src": "959:17:40" + } + ] + }, + "id": 5419, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_msgSender", + "nameLocation": "896:10:40", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 5411, + "nodeType": "ParameterList", + "parameters": [], + "src": "906:2:40" + }, + "returnParameters": { + "id": 5414, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 5413, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 5419, + "src": "940:7:40", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 5412, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "940:7:40", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "939:9:40" + }, + "scope": 5437, + "src": "887:96:40", + "stateMutability": "view", + "virtual": true, + "visibility": "internal" + }, + { + "body": { + "id": 5427, + "nodeType": "Block", + "src": "1056:32:40", + "statements": [ + { + "expression": { + "expression": { + "id": 5424, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "1073:3:40", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 5425, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "1077:4:40", + "memberName": "data", + "nodeType": "MemberAccess", + "src": "1073:8:40", + "typeDescriptions": { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes calldata" + } + }, + "functionReturnParameters": 5423, + "id": 5426, + "nodeType": "Return", + "src": "1066:15:40" + } + ] + }, + "id": 5428, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_msgData", + "nameLocation": "998:8:40", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 5420, + "nodeType": "ParameterList", + "parameters": [], + "src": "1006:2:40" + }, + "returnParameters": { + "id": 5423, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 5422, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 5428, + "src": "1040:14:40", + "stateVariable": false, + "storageLocation": "calldata", + "typeDescriptions": { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 5421, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "1040:5:40", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "src": "1039:16:40" + }, + "scope": 5437, + "src": "989:99:40", + "stateMutability": "view", + "virtual": true, + "visibility": "internal" + }, + { + "body": { + "id": 5435, + "nodeType": "Block", + "src": "1166:25:40", + "statements": [ + { + "expression": { + "hexValue": "30", + "id": 5433, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1183:1:40", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "functionReturnParameters": 5432, + "id": 5434, + "nodeType": "Return", + "src": "1176:8:40" + } + ] + }, + "id": 5436, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_contextSuffixLength", + "nameLocation": "1103:20:40", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 5429, + "nodeType": "ParameterList", + "parameters": [], + "src": "1123:2:40" + }, + "returnParameters": { + "id": 5432, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 5431, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 5436, + "src": "1157:7:40", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 5430, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1157:7:40", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "1156:9:40" + }, + "scope": 5437, + "src": "1094:97:40", + "stateMutability": "view", + "virtual": true, + "visibility": "internal" + } + ], + "scope": 5438, + "src": "688:505:40", + "usedErrors": [ + 5140, + 5143 + ], + "usedEvents": [ + 5148 + ] + } + ], + "src": "101:1093:40" + }, + "id": 40 + }, + "@openzeppelin/contracts-upgradeable/utils/MulticallUpgradeable.sol": { + "ast": { + "absolutePath": "@openzeppelin/contracts-upgradeable/utils/MulticallUpgradeable.sol", + "exportedSymbols": { + "Address": [ + 6407 + ], + "ContextUpgradeable": [ + 5437 + ], + "Initializable": [ + 5391 + ], + "MulticallUpgradeable": [ + 5540 + ] + }, + "id": 5541, + "license": "MIT", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 5439, + "literals": [ + "solidity", + "^", + "0.8", + ".20" + ], + "nodeType": "PragmaDirective", + "src": "103:24:41" + }, + { + "absolutePath": "@openzeppelin/contracts/utils/Address.sol", + "file": "@openzeppelin/contracts/utils/Address.sol", + "id": 5441, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 5541, + "sourceUnit": 6408, + "src": "129:66:41", + "symbolAliases": [ + { + "foreign": { + "id": 5440, + "name": "Address", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6407, + "src": "137:7:41", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol", + "file": "./ContextUpgradeable.sol", + "id": 5443, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 5541, + "sourceUnit": 5438, + "src": "196:60:41", + "symbolAliases": [ + { + "foreign": { + "id": 5442, + "name": "ContextUpgradeable", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5437, + "src": "204:18:41", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol", + "file": "../proxy/utils/Initializable.sol", + "id": 5445, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 5541, + "sourceUnit": 5392, + "src": "257:63:41", + "symbolAliases": [ + { + "foreign": { + "id": 5444, + "name": "Initializable", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5391, + "src": "265:13:41", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "abstract": true, + "baseContracts": [ + { + "baseName": { + "id": 5447, + "name": "Initializable", + "nameLocations": [ + "1178:13:41" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5391, + "src": "1178:13:41" + }, + "id": 5448, + "nodeType": "InheritanceSpecifier", + "src": "1178:13:41" + }, + { + "baseName": { + "id": 5449, + "name": "ContextUpgradeable", + "nameLocations": [ + "1193:18:41" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5437, + "src": "1193:18:41" + }, + "id": 5450, + "nodeType": "InheritanceSpecifier", + "src": "1193:18:41" + } + ], + "canonicalName": "MulticallUpgradeable", + "contractDependencies": [], + "contractKind": "contract", + "documentation": { + "id": 5446, + "nodeType": "StructuredDocumentation", + "src": "322:813:41", + "text": " @dev Provides a function to batch together multiple calls in a single external call.\n Consider any assumption about calldata validation performed by the sender may be violated if it's not especially\n careful about sending transactions invoking {multicall}. For example, a relay address that filters function\n selectors won't filter calls nested within a {multicall} operation.\n NOTE: Since 5.0.1 and 4.9.4, this contract identifies non-canonical contexts (i.e. `msg.sender` is not {Context-_msgSender}).\n If a non-canonical context is identified, the following self `delegatecall` appends the last bytes of `msg.data`\n to the subcall. This makes it safe to use with {ERC2771Context}. Contexts that don't affect the resolution of\n {Context-_msgSender} are not propagated to subcalls." + }, + "fullyImplemented": true, + "id": 5540, + "linearizedBaseContracts": [ + 5540, + 5437, + 5391 + ], + "name": "MulticallUpgradeable", + "nameLocation": "1154:20:41", + "nodeType": "ContractDefinition", + "nodes": [ + { + "body": { + "id": 5455, + "nodeType": "Block", + "src": "1272:7:41", + "statements": [] + }, + "id": 5456, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "id": 5453, + "kind": "modifierInvocation", + "modifierName": { + "id": 5452, + "name": "onlyInitializing", + "nameLocations": [ + "1255:16:41" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5286, + "src": "1255:16:41" + }, + "nodeType": "ModifierInvocation", + "src": "1255:16:41" + } + ], + "name": "__Multicall_init", + "nameLocation": "1227:16:41", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 5451, + "nodeType": "ParameterList", + "parameters": [], + "src": "1243:2:41" + }, + "returnParameters": { + "id": 5454, + "nodeType": "ParameterList", + "parameters": [], + "src": "1272:0:41" + }, + "scope": 5540, + "src": "1218:61:41", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 5461, + "nodeType": "Block", + "src": "1349:7:41", + "statements": [] + }, + "id": 5462, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "id": 5459, + "kind": "modifierInvocation", + "modifierName": { + "id": 5458, + "name": "onlyInitializing", + "nameLocations": [ + "1332:16:41" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5286, + "src": "1332:16:41" + }, + "nodeType": "ModifierInvocation", + "src": "1332:16:41" + } + ], + "name": "__Multicall_init_unchained", + "nameLocation": "1294:26:41", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 5457, + "nodeType": "ParameterList", + "parameters": [], + "src": "1320:2:41" + }, + "returnParameters": { + "id": 5460, + "nodeType": "ParameterList", + "parameters": [], + "src": "1349:0:41" + }, + "scope": 5540, + "src": "1285:71:41", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 5538, + "nodeType": "Block", + "src": "1610:392:41", + "statements": [ + { + "assignments": [ + 5473 + ], + "declarations": [ + { + "constant": false, + "id": 5473, + "mutability": "mutable", + "name": "context", + "nameLocation": "1633:7:41", + "nodeType": "VariableDeclaration", + "scope": 5538, + "src": "1620:20:41", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 5472, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "1620:5:41", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "id": 5493, + "initialValue": { + "condition": { + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 5478, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 5474, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "1643:3:41", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 5475, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "1647:6:41", + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "1643:10:41", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 5476, + "name": "_msgSender", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5419, + "src": "1657:10:41", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_address_$", + "typeString": "function () view returns (address)" + } + }, + "id": 5477, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "1657:12:41", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "1643:26:41", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseExpression": { + "baseExpression": { + "expression": { + "id": 5483, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "1711:3:41", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 5484, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "1715:4:41", + "memberName": "data", + "nodeType": "MemberAccess", + "src": "1711:8:41", + "typeDescriptions": { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes calldata" + } + }, + "id": 5491, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexRangeAccess", + "src": "1711:51:41", + "startExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 5490, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "expression": { + "id": 5485, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "1720:3:41", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 5486, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "1724:4:41", + "memberName": "data", + "nodeType": "MemberAccess", + "src": "1720:8:41", + "typeDescriptions": { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes calldata" + } + }, + "id": 5487, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "1729:6:41", + "memberName": "length", + "nodeType": "MemberAccess", + "src": "1720:15:41", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 5488, + "name": "_contextSuffixLength", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5436, + "src": "1738:20:41", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", + "typeString": "function () view returns (uint256)" + } + }, + "id": 5489, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "1738:22:41", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "1720:40:41", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bytes_calldata_ptr_slice", + "typeString": "bytes calldata slice" + } + }, + "id": 5492, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "Conditional", + "src": "1643:119:41", + "trueExpression": { + "arguments": [ + { + "hexValue": "30", + "id": 5481, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1694:1:41", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 5480, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "NewExpression", + "src": "1684:9:41", + "typeDescriptions": { + "typeIdentifier": "t_function_objectcreation_pure$_t_uint256_$returns$_t_bytes_memory_ptr_$", + "typeString": "function (uint256) pure returns (bytes memory)" + }, + "typeName": { + "id": 5479, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "1688:5:41", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + } + }, + "id": 5482, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "1684:12:41", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "1620:142:41" + }, + { + "expression": { + "id": 5501, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 5494, + "name": "results", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5470, + "src": "1773:7:41", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_bytes_memory_ptr_$dyn_memory_ptr", + "typeString": "bytes memory[] memory" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "expression": { + "id": 5498, + "name": "data", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5466, + "src": "1795:4:41", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_bytes_calldata_ptr_$dyn_calldata_ptr", + "typeString": "bytes calldata[] calldata" + } + }, + "id": 5499, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "1800:6:41", + "memberName": "length", + "nodeType": "MemberAccess", + "src": "1795:11:41", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 5497, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "NewExpression", + "src": "1783:11:41", + "typeDescriptions": { + "typeIdentifier": "t_function_objectcreation_pure$_t_uint256_$returns$_t_array$_t_bytes_memory_ptr_$dyn_memory_ptr_$", + "typeString": "function (uint256) pure returns (bytes memory[] memory)" + }, + "typeName": { + "baseType": { + "id": 5495, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "1787:5:41", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "id": 5496, + "nodeType": "ArrayTypeName", + "src": "1787:7:41", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_bytes_storage_$dyn_storage_ptr", + "typeString": "bytes[]" + } + } + }, + "id": 5500, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "1783:24:41", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_array$_t_bytes_memory_ptr_$dyn_memory_ptr", + "typeString": "bytes memory[] memory" + } + }, + "src": "1773:34:41", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_bytes_memory_ptr_$dyn_memory_ptr", + "typeString": "bytes memory[] memory" + } + }, + "id": 5502, + "nodeType": "ExpressionStatement", + "src": "1773:34:41" + }, + { + "body": { + "id": 5534, + "nodeType": "Block", + "src": "1859:113:41", + "statements": [ + { + "expression": { + "id": 5532, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "baseExpression": { + "id": 5514, + "name": "results", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5470, + "src": "1873:7:41", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_bytes_memory_ptr_$dyn_memory_ptr", + "typeString": "bytes memory[] memory" + } + }, + "id": 5516, + "indexExpression": { + "id": 5515, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5504, + "src": "1881:1:41", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "1873:10:41", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "arguments": [ + { + "id": 5521, + "name": "this", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -28, + "src": "1923:4:41", + "typeDescriptions": { + "typeIdentifier": "t_contract$_MulticallUpgradeable_$5540", + "typeString": "contract MulticallUpgradeable" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_MulticallUpgradeable_$5540", + "typeString": "contract MulticallUpgradeable" + } + ], + "id": 5520, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "1915:7:41", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 5519, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1915:7:41", + "typeDescriptions": {} + } + }, + "id": 5522, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "1915:13:41", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "arguments": [ + { + "baseExpression": { + "id": 5526, + "name": "data", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5466, + "src": "1943:4:41", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_bytes_calldata_ptr_$dyn_calldata_ptr", + "typeString": "bytes calldata[] calldata" + } + }, + "id": 5528, + "indexExpression": { + "id": 5527, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5504, + "src": "1948:1:41", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "1943:7:41", + "typeDescriptions": { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes calldata" + } + }, + { + "id": 5529, + "name": "context", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5473, + "src": "1952:7:41", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes calldata" + }, + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "expression": { + "id": 5524, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "1930:5:41", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes_storage_ptr_$", + "typeString": "type(bytes storage pointer)" + }, + "typeName": { + "id": 5523, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "1930:5:41", + "typeDescriptions": {} + } + }, + "id": 5525, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "1936:6:41", + "memberName": "concat", + "nodeType": "MemberAccess", + "src": "1930:12:41", + "typeDescriptions": { + "typeIdentifier": "t_function_bytesconcat_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 5530, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "1930:30:41", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "expression": { + "id": 5517, + "name": "Address", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6407, + "src": "1886:7:41", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_Address_$6407_$", + "typeString": "type(library Address)" + } + }, + "id": 5518, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "1894:20:41", + "memberName": "functionDelegateCall", + "nodeType": "MemberAccess", + "referencedDeclaration": 6324, + "src": "1886:28:41", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_bytes_memory_ptr_$returns$_t_bytes_memory_ptr_$", + "typeString": "function (address,bytes memory) returns (bytes memory)" + } + }, + "id": 5531, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "1886:75:41", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "src": "1873:88:41", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 5533, + "nodeType": "ExpressionStatement", + "src": "1873:88:41" + } + ] + }, + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 5510, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 5507, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5504, + "src": "1837:1:41", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "expression": { + "id": 5508, + "name": "data", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5466, + "src": "1841:4:41", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_bytes_calldata_ptr_$dyn_calldata_ptr", + "typeString": "bytes calldata[] calldata" + } + }, + "id": 5509, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "1846:6:41", + "memberName": "length", + "nodeType": "MemberAccess", + "src": "1841:11:41", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "1837:15:41", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 5535, + "initializationExpression": { + "assignments": [ + 5504 + ], + "declarations": [ + { + "constant": false, + "id": 5504, + "mutability": "mutable", + "name": "i", + "nameLocation": "1830:1:41", + "nodeType": "VariableDeclaration", + "scope": 5535, + "src": "1822:9:41", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 5503, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1822:7:41", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 5506, + "initialValue": { + "hexValue": "30", + "id": 5505, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1834:1:41", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "nodeType": "VariableDeclarationStatement", + "src": "1822:13:41" + }, + "isSimpleCounterLoop": true, + "loopExpression": { + "expression": { + "id": 5512, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "1854:3:41", + "subExpression": { + "id": 5511, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5504, + "src": "1854:1:41", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 5513, + "nodeType": "ExpressionStatement", + "src": "1854:3:41" + }, + "nodeType": "ForStatement", + "src": "1817:155:41" + }, + { + "expression": { + "id": 5536, + "name": "results", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5470, + "src": "1988:7:41", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_bytes_memory_ptr_$dyn_memory_ptr", + "typeString": "bytes memory[] memory" + } + }, + "functionReturnParameters": 5471, + "id": 5537, + "nodeType": "Return", + "src": "1981:14:41" + } + ] + }, + "documentation": { + "id": 5463, + "nodeType": "StructuredDocumentation", + "src": "1361:152:41", + "text": " @dev Receives and executes a batch of function calls on this contract.\n @custom:oz-upgrades-unsafe-allow-reachable delegatecall" + }, + "functionSelector": "ac9650d8", + "id": 5539, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "multicall", + "nameLocation": "1527:9:41", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 5467, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 5466, + "mutability": "mutable", + "name": "data", + "nameLocation": "1554:4:41", + "nodeType": "VariableDeclaration", + "scope": 5539, + "src": "1537:21:41", + "stateVariable": false, + "storageLocation": "calldata", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_bytes_calldata_ptr_$dyn_calldata_ptr", + "typeString": "bytes[]" + }, + "typeName": { + "baseType": { + "id": 5464, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "1537:5:41", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "id": 5465, + "nodeType": "ArrayTypeName", + "src": "1537:7:41", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_bytes_storage_$dyn_storage_ptr", + "typeString": "bytes[]" + } + }, + "visibility": "internal" + } + ], + "src": "1536:23:41" + }, + "returnParameters": { + "id": 5471, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 5470, + "mutability": "mutable", + "name": "results", + "nameLocation": "1601:7:41", + "nodeType": "VariableDeclaration", + "scope": 5539, + "src": "1586:22:41", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_bytes_memory_ptr_$dyn_memory_ptr", + "typeString": "bytes[]" + }, + "typeName": { + "baseType": { + "id": 5468, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "1586:5:41", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "id": 5469, + "nodeType": "ArrayTypeName", + "src": "1586:7:41", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_bytes_storage_$dyn_storage_ptr", + "typeString": "bytes[]" + } + }, + "visibility": "internal" + } + ], + "src": "1585:24:41" + }, + "scope": 5540, + "src": "1518:484:41", + "stateMutability": "nonpayable", + "virtual": true, + "visibility": "external" + } + ], + "scope": 5541, + "src": "1136:868:41", + "usedErrors": [ + 5140, + 5143, + 6157, + 6420 + ], + "usedEvents": [ + 5148 + ] + } + ], + "src": "103:1902:41" + }, + "id": 41 + }, + "@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol": { + "ast": { + "absolutePath": "@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol", + "exportedSymbols": { + "ContextUpgradeable": [ + 5437 + ], + "Initializable": [ + 5391 + ], + "PausableUpgradeable": [ + 5700 + ] + }, + "id": 5701, + "license": "MIT", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 5542, + "literals": [ + "solidity", + "^", + "0.8", + ".20" + ], + "nodeType": "PragmaDirective", + "src": "102:24:42" + }, + { + "absolutePath": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol", + "file": "../utils/ContextUpgradeable.sol", + "id": 5544, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 5701, + "sourceUnit": 5438, + "src": "128:67:42", + "symbolAliases": [ + { + "foreign": { + "id": 5543, + "name": "ContextUpgradeable", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5437, + "src": "136:18:42", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol", + "file": "../proxy/utils/Initializable.sol", + "id": 5546, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 5701, + "sourceUnit": 5392, + "src": "196:63:42", + "symbolAliases": [ + { + "foreign": { + "id": 5545, + "name": "Initializable", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5391, + "src": "204:13:42", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "abstract": true, + "baseContracts": [ + { + "baseName": { + "id": 5548, + "name": "Initializable", + "nameLocations": [ + "742:13:42" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5391, + "src": "742:13:42" + }, + "id": 5549, + "nodeType": "InheritanceSpecifier", + "src": "742:13:42" + }, + { + "baseName": { + "id": 5550, + "name": "ContextUpgradeable", + "nameLocations": [ + "757:18:42" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5437, + "src": "757:18:42" + }, + "id": 5551, + "nodeType": "InheritanceSpecifier", + "src": "757:18:42" + } + ], + "canonicalName": "PausableUpgradeable", + "contractDependencies": [], + "contractKind": "contract", + "documentation": { + "id": 5547, + "nodeType": "StructuredDocumentation", + "src": "261:439:42", + "text": " @dev Contract module which allows children to implement an emergency stop\n mechanism that can be triggered by an authorized account.\n This module is used through inheritance. It will make available the\n modifiers `whenNotPaused` and `whenPaused`, which can be applied to\n the functions of your contract. Note that they will not be pausable by\n simply including this module, only once the modifiers are put in place." + }, + "fullyImplemented": true, + "id": 5700, + "linearizedBaseContracts": [ + 5700, + 5437, + 5391 + ], + "name": "PausableUpgradeable", + "nameLocation": "719:19:42", + "nodeType": "ContractDefinition", + "nodes": [ + { + "canonicalName": "PausableUpgradeable.PausableStorage", + "documentation": { + "id": 5552, + "nodeType": "StructuredDocumentation", + "src": "782:66:42", + "text": "@custom:storage-location erc7201:openzeppelin.storage.Pausable" + }, + "id": 5555, + "members": [ + { + "constant": false, + "id": 5554, + "mutability": "mutable", + "name": "_paused", + "nameLocation": "891:7:42", + "nodeType": "VariableDeclaration", + "scope": 5555, + "src": "886:12:42", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 5553, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "886:4:42", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "name": "PausableStorage", + "nameLocation": "860:15:42", + "nodeType": "StructDefinition", + "scope": 5700, + "src": "853:52:42", + "visibility": "public" + }, + { + "constant": true, + "id": 5558, + "mutability": "constant", + "name": "PausableStorageLocation", + "nameLocation": "1048:23:42", + "nodeType": "VariableDeclaration", + "scope": 5700, + "src": "1023:117:42", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 5556, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1023:7:42", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": { + "hexValue": "307863643565643135633665313837653737653961656538383138346332316634663231383261623538323763623362376530376662656463643633663033333030", + "id": 5557, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1074:66:42", + "typeDescriptions": { + "typeIdentifier": "t_rational_92891662540554778686986514950364265630913525426840345632122912437671245656832_by_1", + "typeString": "int_const 9289...(69 digits omitted)...6832" + }, + "value": "0xcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f03300" + }, + "visibility": "private" + }, + { + "body": { + "id": 5565, + "nodeType": "Block", + "src": "1227:82:42", + "statements": [ + { + "AST": { + "nativeSrc": "1246:57:42", + "nodeType": "YulBlock", + "src": "1246:57:42", + "statements": [ + { + "nativeSrc": "1260:33:42", + "nodeType": "YulAssignment", + "src": "1260:33:42", + "value": { + "name": "PausableStorageLocation", + "nativeSrc": "1270:23:42", + "nodeType": "YulIdentifier", + "src": "1270:23:42" + }, + "variableNames": [ + { + "name": "$.slot", + "nativeSrc": "1260:6:42", + "nodeType": "YulIdentifier", + "src": "1260:6:42" + } + ] + } + ] + }, + "evmVersion": "paris", + "externalReferences": [ + { + "declaration": 5562, + "isOffset": false, + "isSlot": true, + "src": "1260:6:42", + "suffix": "slot", + "valueSize": 1 + }, + { + "declaration": 5558, + "isOffset": false, + "isSlot": false, + "src": "1270:23:42", + "valueSize": 1 + } + ], + "id": 5564, + "nodeType": "InlineAssembly", + "src": "1237:66:42" + } + ] + }, + "id": 5566, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_getPausableStorage", + "nameLocation": "1156:19:42", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 5559, + "nodeType": "ParameterList", + "parameters": [], + "src": "1175:2:42" + }, + "returnParameters": { + "id": 5563, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 5562, + "mutability": "mutable", + "name": "$", + "nameLocation": "1224:1:42", + "nodeType": "VariableDeclaration", + "scope": 5566, + "src": "1200:25:42", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_PausableStorage_$5555_storage_ptr", + "typeString": "struct PausableUpgradeable.PausableStorage" + }, + "typeName": { + "id": 5561, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 5560, + "name": "PausableStorage", + "nameLocations": [ + "1200:15:42" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5555, + "src": "1200:15:42" + }, + "referencedDeclaration": 5555, + "src": "1200:15:42", + "typeDescriptions": { + "typeIdentifier": "t_struct$_PausableStorage_$5555_storage_ptr", + "typeString": "struct PausableUpgradeable.PausableStorage" + } + }, + "visibility": "internal" + } + ], + "src": "1199:27:42" + }, + "scope": 5700, + "src": "1147:162:42", + "stateMutability": "pure", + "virtual": false, + "visibility": "private" + }, + { + "anonymous": false, + "documentation": { + "id": 5567, + "nodeType": "StructuredDocumentation", + "src": "1315:73:42", + "text": " @dev Emitted when the pause is triggered by `account`." + }, + "eventSelector": "62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258", + "id": 5571, + "name": "Paused", + "nameLocation": "1399:6:42", + "nodeType": "EventDefinition", + "parameters": { + "id": 5570, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 5569, + "indexed": false, + "mutability": "mutable", + "name": "account", + "nameLocation": "1414:7:42", + "nodeType": "VariableDeclaration", + "scope": 5571, + "src": "1406:15:42", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 5568, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1406:7:42", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "1405:17:42" + }, + "src": "1393:30:42" + }, + { + "anonymous": false, + "documentation": { + "id": 5572, + "nodeType": "StructuredDocumentation", + "src": "1429:70:42", + "text": " @dev Emitted when the pause is lifted by `account`." + }, + "eventSelector": "5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa", + "id": 5576, + "name": "Unpaused", + "nameLocation": "1510:8:42", + "nodeType": "EventDefinition", + "parameters": { + "id": 5575, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 5574, + "indexed": false, + "mutability": "mutable", + "name": "account", + "nameLocation": "1527:7:42", + "nodeType": "VariableDeclaration", + "scope": 5576, + "src": "1519:15:42", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 5573, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1519:7:42", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "1518:17:42" + }, + "src": "1504:32:42" + }, + { + "documentation": { + "id": 5577, + "nodeType": "StructuredDocumentation", + "src": "1542:76:42", + "text": " @dev The operation failed because the contract is paused." + }, + "errorSelector": "d93c0665", + "id": 5579, + "name": "EnforcedPause", + "nameLocation": "1629:13:42", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 5578, + "nodeType": "ParameterList", + "parameters": [], + "src": "1642:2:42" + }, + "src": "1623:22:42" + }, + { + "documentation": { + "id": 5580, + "nodeType": "StructuredDocumentation", + "src": "1651:80:42", + "text": " @dev The operation failed because the contract is not paused." + }, + "errorSelector": "8dfc202b", + "id": 5582, + "name": "ExpectedPause", + "nameLocation": "1742:13:42", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 5581, + "nodeType": "ParameterList", + "parameters": [], + "src": "1755:2:42" + }, + "src": "1736:22:42" + }, + { + "body": { + "id": 5589, + "nodeType": "Block", + "src": "1969:47:42", + "statements": [ + { + "expression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 5585, + "name": "_requireNotPaused", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5638, + "src": "1979:17:42", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$__$", + "typeString": "function () view" + } + }, + "id": 5586, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "1979:19:42", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 5587, + "nodeType": "ExpressionStatement", + "src": "1979:19:42" + }, + { + "id": 5588, + "nodeType": "PlaceholderStatement", + "src": "2008:1:42" + } + ] + }, + "documentation": { + "id": 5583, + "nodeType": "StructuredDocumentation", + "src": "1764:175:42", + "text": " @dev Modifier to make a function callable only when the contract is not paused.\n Requirements:\n - The contract must not be paused." + }, + "id": 5590, + "name": "whenNotPaused", + "nameLocation": "1953:13:42", + "nodeType": "ModifierDefinition", + "parameters": { + "id": 5584, + "nodeType": "ParameterList", + "parameters": [], + "src": "1966:2:42" + }, + "src": "1944:72:42", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 5597, + "nodeType": "Block", + "src": "2216:44:42", + "statements": [ + { + "expression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 5593, + "name": "_requirePaused", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5651, + "src": "2226:14:42", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$__$", + "typeString": "function () view" + } + }, + "id": 5594, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2226:16:42", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 5595, + "nodeType": "ExpressionStatement", + "src": "2226:16:42" + }, + { + "id": 5596, + "nodeType": "PlaceholderStatement", + "src": "2252:1:42" + } + ] + }, + "documentation": { + "id": 5591, + "nodeType": "StructuredDocumentation", + "src": "2022:167:42", + "text": " @dev Modifier to make a function callable only when the contract is paused.\n Requirements:\n - The contract must be paused." + }, + "id": 5598, + "name": "whenPaused", + "nameLocation": "2203:10:42", + "nodeType": "ModifierDefinition", + "parameters": { + "id": 5592, + "nodeType": "ParameterList", + "parameters": [], + "src": "2213:2:42" + }, + "src": "2194:66:42", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 5603, + "nodeType": "Block", + "src": "2319:7:42", + "statements": [] + }, + "id": 5604, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "id": 5601, + "kind": "modifierInvocation", + "modifierName": { + "id": 5600, + "name": "onlyInitializing", + "nameLocations": [ + "2302:16:42" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5286, + "src": "2302:16:42" + }, + "nodeType": "ModifierInvocation", + "src": "2302:16:42" + } + ], + "name": "__Pausable_init", + "nameLocation": "2275:15:42", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 5599, + "nodeType": "ParameterList", + "parameters": [], + "src": "2290:2:42" + }, + "returnParameters": { + "id": 5602, + "nodeType": "ParameterList", + "parameters": [], + "src": "2319:0:42" + }, + "scope": 5700, + "src": "2266:60:42", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 5609, + "nodeType": "Block", + "src": "2395:7:42", + "statements": [] + }, + "id": 5610, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "id": 5607, + "kind": "modifierInvocation", + "modifierName": { + "id": 5606, + "name": "onlyInitializing", + "nameLocations": [ + "2378:16:42" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5286, + "src": "2378:16:42" + }, + "nodeType": "ModifierInvocation", + "src": "2378:16:42" + } + ], + "name": "__Pausable_init_unchained", + "nameLocation": "2341:25:42", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 5605, + "nodeType": "ParameterList", + "parameters": [], + "src": "2366:2:42" + }, + "returnParameters": { + "id": 5608, + "nodeType": "ParameterList", + "parameters": [], + "src": "2395:0:42" + }, + "scope": 5700, + "src": "2332:70:42", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 5625, + "nodeType": "Block", + "src": "2549:92:42", + "statements": [ + { + "assignments": [ + 5618 + ], + "declarations": [ + { + "constant": false, + "id": 5618, + "mutability": "mutable", + "name": "$", + "nameLocation": "2583:1:42", + "nodeType": "VariableDeclaration", + "scope": 5625, + "src": "2559:25:42", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_PausableStorage_$5555_storage_ptr", + "typeString": "struct PausableUpgradeable.PausableStorage" + }, + "typeName": { + "id": 5617, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 5616, + "name": "PausableStorage", + "nameLocations": [ + "2559:15:42" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5555, + "src": "2559:15:42" + }, + "referencedDeclaration": 5555, + "src": "2559:15:42", + "typeDescriptions": { + "typeIdentifier": "t_struct$_PausableStorage_$5555_storage_ptr", + "typeString": "struct PausableUpgradeable.PausableStorage" + } + }, + "visibility": "internal" + } + ], + "id": 5621, + "initialValue": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 5619, + "name": "_getPausableStorage", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5566, + "src": "2587:19:42", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$__$returns$_t_struct$_PausableStorage_$5555_storage_ptr_$", + "typeString": "function () pure returns (struct PausableUpgradeable.PausableStorage storage pointer)" + } + }, + "id": 5620, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2587:21:42", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_PausableStorage_$5555_storage_ptr", + "typeString": "struct PausableUpgradeable.PausableStorage storage pointer" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "2559:49:42" + }, + { + "expression": { + "expression": { + "id": 5622, + "name": "$", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5618, + "src": "2625:1:42", + "typeDescriptions": { + "typeIdentifier": "t_struct$_PausableStorage_$5555_storage_ptr", + "typeString": "struct PausableUpgradeable.PausableStorage storage pointer" + } + }, + "id": 5623, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "2627:7:42", + "memberName": "_paused", + "nodeType": "MemberAccess", + "referencedDeclaration": 5554, + "src": "2625:9:42", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "functionReturnParameters": 5615, + "id": 5624, + "nodeType": "Return", + "src": "2618:16:42" + } + ] + }, + "documentation": { + "id": 5611, + "nodeType": "StructuredDocumentation", + "src": "2407:84:42", + "text": " @dev Returns true if the contract is paused, and false otherwise." + }, + "functionSelector": "5c975abb", + "id": 5626, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "paused", + "nameLocation": "2505:6:42", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 5612, + "nodeType": "ParameterList", + "parameters": [], + "src": "2511:2:42" + }, + "returnParameters": { + "id": 5615, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 5614, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 5626, + "src": "2543:4:42", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 5613, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "2543:4:42", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "src": "2542:6:42" + }, + "scope": 5700, + "src": "2496:145:42", + "stateMutability": "view", + "virtual": true, + "visibility": "public" + }, + { + "body": { + "id": 5637, + "nodeType": "Block", + "src": "2760:77:42", + "statements": [ + { + "condition": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 5630, + "name": "paused", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5626, + "src": "2774:6:42", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_bool_$", + "typeString": "function () view returns (bool)" + } + }, + "id": 5631, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2774:8:42", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 5636, + "nodeType": "IfStatement", + "src": "2770:61:42", + "trueBody": { + "id": 5635, + "nodeType": "Block", + "src": "2784:47:42", + "statements": [ + { + "errorCall": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 5632, + "name": "EnforcedPause", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5579, + "src": "2805:13:42", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$__$returns$_t_error_$", + "typeString": "function () pure returns (error)" + } + }, + "id": 5633, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2805:15:42", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 5634, + "nodeType": "RevertStatement", + "src": "2798:22:42" + } + ] + } + } + ] + }, + "documentation": { + "id": 5627, + "nodeType": "StructuredDocumentation", + "src": "2647:57:42", + "text": " @dev Throws if the contract is paused." + }, + "id": 5638, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_requireNotPaused", + "nameLocation": "2718:17:42", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 5628, + "nodeType": "ParameterList", + "parameters": [], + "src": "2735:2:42" + }, + "returnParameters": { + "id": 5629, + "nodeType": "ParameterList", + "parameters": [], + "src": "2760:0:42" + }, + "scope": 5700, + "src": "2709:128:42", + "stateMutability": "view", + "virtual": true, + "visibility": "internal" + }, + { + "body": { + "id": 5650, + "nodeType": "Block", + "src": "2957:78:42", + "statements": [ + { + "condition": { + "id": 5644, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "2971:9:42", + "subExpression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 5642, + "name": "paused", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5626, + "src": "2972:6:42", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_bool_$", + "typeString": "function () view returns (bool)" + } + }, + "id": 5643, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2972:8:42", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 5649, + "nodeType": "IfStatement", + "src": "2967:62:42", + "trueBody": { + "id": 5648, + "nodeType": "Block", + "src": "2982:47:42", + "statements": [ + { + "errorCall": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 5645, + "name": "ExpectedPause", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5582, + "src": "3003:13:42", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$__$returns$_t_error_$", + "typeString": "function () pure returns (error)" + } + }, + "id": 5646, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3003:15:42", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 5647, + "nodeType": "RevertStatement", + "src": "2996:22:42" + } + ] + } + } + ] + }, + "documentation": { + "id": 5639, + "nodeType": "StructuredDocumentation", + "src": "2843:61:42", + "text": " @dev Throws if the contract is not paused." + }, + "id": 5651, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_requirePaused", + "nameLocation": "2918:14:42", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 5640, + "nodeType": "ParameterList", + "parameters": [], + "src": "2932:2:42" + }, + "returnParameters": { + "id": 5641, + "nodeType": "ParameterList", + "parameters": [], + "src": "2957:0:42" + }, + "scope": 5700, + "src": "2909:126:42", + "stateMutability": "view", + "virtual": true, + "visibility": "internal" + }, + { + "body": { + "id": 5674, + "nodeType": "Block", + "src": "3219:127:42", + "statements": [ + { + "assignments": [ + 5659 + ], + "declarations": [ + { + "constant": false, + "id": 5659, + "mutability": "mutable", + "name": "$", + "nameLocation": "3253:1:42", + "nodeType": "VariableDeclaration", + "scope": 5674, + "src": "3229:25:42", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_PausableStorage_$5555_storage_ptr", + "typeString": "struct PausableUpgradeable.PausableStorage" + }, + "typeName": { + "id": 5658, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 5657, + "name": "PausableStorage", + "nameLocations": [ + "3229:15:42" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5555, + "src": "3229:15:42" + }, + "referencedDeclaration": 5555, + "src": "3229:15:42", + "typeDescriptions": { + "typeIdentifier": "t_struct$_PausableStorage_$5555_storage_ptr", + "typeString": "struct PausableUpgradeable.PausableStorage" + } + }, + "visibility": "internal" + } + ], + "id": 5662, + "initialValue": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 5660, + "name": "_getPausableStorage", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5566, + "src": "3257:19:42", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$__$returns$_t_struct$_PausableStorage_$5555_storage_ptr_$", + "typeString": "function () pure returns (struct PausableUpgradeable.PausableStorage storage pointer)" + } + }, + "id": 5661, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3257:21:42", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_PausableStorage_$5555_storage_ptr", + "typeString": "struct PausableUpgradeable.PausableStorage storage pointer" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "3229:49:42" + }, + { + "expression": { + "id": 5667, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 5663, + "name": "$", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5659, + "src": "3288:1:42", + "typeDescriptions": { + "typeIdentifier": "t_struct$_PausableStorage_$5555_storage_ptr", + "typeString": "struct PausableUpgradeable.PausableStorage storage pointer" + } + }, + "id": 5665, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberLocation": "3290:7:42", + "memberName": "_paused", + "nodeType": "MemberAccess", + "referencedDeclaration": 5554, + "src": "3288:9:42", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "hexValue": "74727565", + "id": 5666, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3300:4:42", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "true" + }, + "src": "3288:16:42", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 5668, + "nodeType": "ExpressionStatement", + "src": "3288:16:42" + }, + { + "eventCall": { + "arguments": [ + { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 5670, + "name": "_msgSender", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5419, + "src": "3326:10:42", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_address_$", + "typeString": "function () view returns (address)" + } + }, + "id": 5671, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3326:12:42", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 5669, + "name": "Paused", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5571, + "src": "3319:6:42", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$returns$__$", + "typeString": "function (address)" + } + }, + "id": 5672, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3319:20:42", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 5673, + "nodeType": "EmitStatement", + "src": "3314:25:42" + } + ] + }, + "documentation": { + "id": 5652, + "nodeType": "StructuredDocumentation", + "src": "3041:124:42", + "text": " @dev Triggers stopped state.\n Requirements:\n - The contract must not be paused." + }, + "id": 5675, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "id": 5655, + "kind": "modifierInvocation", + "modifierName": { + "id": 5654, + "name": "whenNotPaused", + "nameLocations": [ + "3205:13:42" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5590, + "src": "3205:13:42" + }, + "nodeType": "ModifierInvocation", + "src": "3205:13:42" + } + ], + "name": "_pause", + "nameLocation": "3179:6:42", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 5653, + "nodeType": "ParameterList", + "parameters": [], + "src": "3185:2:42" + }, + "returnParameters": { + "id": 5656, + "nodeType": "ParameterList", + "parameters": [], + "src": "3219:0:42" + }, + "scope": 5700, + "src": "3170:176:42", + "stateMutability": "nonpayable", + "virtual": true, + "visibility": "internal" + }, + { + "body": { + "id": 5698, + "nodeType": "Block", + "src": "3526:130:42", + "statements": [ + { + "assignments": [ + 5683 + ], + "declarations": [ + { + "constant": false, + "id": 5683, + "mutability": "mutable", + "name": "$", + "nameLocation": "3560:1:42", + "nodeType": "VariableDeclaration", + "scope": 5698, + "src": "3536:25:42", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_PausableStorage_$5555_storage_ptr", + "typeString": "struct PausableUpgradeable.PausableStorage" + }, + "typeName": { + "id": 5682, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 5681, + "name": "PausableStorage", + "nameLocations": [ + "3536:15:42" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5555, + "src": "3536:15:42" + }, + "referencedDeclaration": 5555, + "src": "3536:15:42", + "typeDescriptions": { + "typeIdentifier": "t_struct$_PausableStorage_$5555_storage_ptr", + "typeString": "struct PausableUpgradeable.PausableStorage" + } + }, + "visibility": "internal" + } + ], + "id": 5686, + "initialValue": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 5684, + "name": "_getPausableStorage", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5566, + "src": "3564:19:42", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$__$returns$_t_struct$_PausableStorage_$5555_storage_ptr_$", + "typeString": "function () pure returns (struct PausableUpgradeable.PausableStorage storage pointer)" + } + }, + "id": 5685, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3564:21:42", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_PausableStorage_$5555_storage_ptr", + "typeString": "struct PausableUpgradeable.PausableStorage storage pointer" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "3536:49:42" + }, + { + "expression": { + "id": 5691, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 5687, + "name": "$", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5683, + "src": "3595:1:42", + "typeDescriptions": { + "typeIdentifier": "t_struct$_PausableStorage_$5555_storage_ptr", + "typeString": "struct PausableUpgradeable.PausableStorage storage pointer" + } + }, + "id": 5689, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberLocation": "3597:7:42", + "memberName": "_paused", + "nodeType": "MemberAccess", + "referencedDeclaration": 5554, + "src": "3595:9:42", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "hexValue": "66616c7365", + "id": 5690, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3607:5:42", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + }, + "src": "3595:17:42", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 5692, + "nodeType": "ExpressionStatement", + "src": "3595:17:42" + }, + { + "eventCall": { + "arguments": [ + { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 5694, + "name": "_msgSender", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5419, + "src": "3636:10:42", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_address_$", + "typeString": "function () view returns (address)" + } + }, + "id": 5695, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3636:12:42", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 5693, + "name": "Unpaused", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5576, + "src": "3627:8:42", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$returns$__$", + "typeString": "function (address)" + } + }, + "id": 5696, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3627:22:42", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 5697, + "nodeType": "EmitStatement", + "src": "3622:27:42" + } + ] + }, + "documentation": { + "id": 5676, + "nodeType": "StructuredDocumentation", + "src": "3352:121:42", + "text": " @dev Returns to normal state.\n Requirements:\n - The contract must be paused." + }, + "id": 5699, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "id": 5679, + "kind": "modifierInvocation", + "modifierName": { + "id": 5678, + "name": "whenPaused", + "nameLocations": [ + "3515:10:42" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5598, + "src": "3515:10:42" + }, + "nodeType": "ModifierInvocation", + "src": "3515:10:42" + } + ], + "name": "_unpause", + "nameLocation": "3487:8:42", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 5677, + "nodeType": "ParameterList", + "parameters": [], + "src": "3495:2:42" + }, + "returnParameters": { + "id": 5680, + "nodeType": "ParameterList", + "parameters": [], + "src": "3526:0:42" + }, + "scope": 5700, + "src": "3478:178:42", + "stateMutability": "nonpayable", + "virtual": true, + "visibility": "internal" + } + ], + "scope": 5701, + "src": "701:2957:42", + "usedErrors": [ + 5140, + 5143, + 5579, + 5582 + ], + "usedEvents": [ + 5148, + 5571, + 5576 + ] + } + ], + "src": "102:3557:42" + }, + "id": 42 + }, + "@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol": { + "ast": { + "absolutePath": "@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol", + "exportedSymbols": { + "EIP712Upgradeable": [ + 6044 + ], + "IERC5267": [ + 6069 + ], + "Initializable": [ + 5391 + ], + "MessageHashUtils": [ + 8317 + ] + }, + "id": 6045, + "license": "MIT", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 5702, + "literals": [ + "solidity", + "^", + "0.8", + ".20" + ], + "nodeType": "PragmaDirective", + "src": "113:24:43" + }, + { + "absolutePath": "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol", + "file": "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol", + "id": 5704, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 6045, + "sourceUnit": 8318, + "src": "139:97:43", + "symbolAliases": [ + { + "foreign": { + "id": 5703, + "name": "MessageHashUtils", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8317, + "src": "147:16:43", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "@openzeppelin/contracts/interfaces/IERC5267.sol", + "file": "@openzeppelin/contracts/interfaces/IERC5267.sol", + "id": 5706, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 6045, + "sourceUnit": 6070, + "src": "237:73:43", + "symbolAliases": [ + { + "foreign": { + "id": 5705, + "name": "IERC5267", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6069, + "src": "245:8:43", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol", + "file": "../../proxy/utils/Initializable.sol", + "id": 5708, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 6045, + "sourceUnit": 5392, + "src": "311:66:43", + "symbolAliases": [ + { + "foreign": { + "id": 5707, + "name": "Initializable", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5391, + "src": "319:13:43", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "abstract": true, + "baseContracts": [ + { + "baseName": { + "id": 5710, + "name": "Initializable", + "nameLocations": [ + "1998:13:43" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5391, + "src": "1998:13:43" + }, + "id": 5711, + "nodeType": "InheritanceSpecifier", + "src": "1998:13:43" + }, + { + "baseName": { + "id": 5712, + "name": "IERC5267", + "nameLocations": [ + "2013:8:43" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 6069, + "src": "2013:8:43" + }, + "id": 5713, + "nodeType": "InheritanceSpecifier", + "src": "2013:8:43" + } + ], + "canonicalName": "EIP712Upgradeable", + "contractDependencies": [], + "contractKind": "contract", + "documentation": { + "id": 5709, + "nodeType": "StructuredDocumentation", + "src": "379:1579:43", + "text": " @dev https://eips.ethereum.org/EIPS/eip-712[EIP-712] is a standard for hashing and signing of typed structured data.\n The encoding scheme specified in the EIP requires a domain separator and a hash of the typed structured data, whose\n encoding is very generic and therefore its implementation in Solidity is not feasible, thus this contract\n does not implement the encoding itself. Protocols need to implement the type-specific encoding they need in order to\n produce the hash of their typed data using a combination of `abi.encode` and `keccak256`.\n This contract implements the EIP-712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\n scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\n ({_hashTypedDataV4}).\n The implementation of the domain separator was designed to be as efficient as possible while still properly updating\n the chain id to protect against replay attacks on an eventual fork of the chain.\n NOTE: This contract implements the version of the encoding known as \"v4\", as implemented by the JSON RPC method\n https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\n NOTE: In the upgradeable version of this contract, the cached values will correspond to the address, and the domain\n separator of the implementation contract. This will cause the {_domainSeparatorV4} function to always rebuild the\n separator from the immutable values, which is cheaper than accessing a cached version in cold storage." + }, + "fullyImplemented": true, + "id": 6044, + "linearizedBaseContracts": [ + 6044, + 6069, + 5391 + ], + "name": "EIP712Upgradeable", + "nameLocation": "1977:17:43", + "nodeType": "ContractDefinition", + "nodes": [ + { + "constant": true, + "id": 5718, + "mutability": "constant", + "name": "TYPE_HASH", + "nameLocation": "2053:9:43", + "nodeType": "VariableDeclaration", + "scope": 6044, + "src": "2028:140:43", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 5714, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "2028:7:43", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": { + "arguments": [ + { + "hexValue": "454950373132446f6d61696e28737472696e67206e616d652c737472696e672076657273696f6e2c75696e7432353620636861696e49642c6164647265737320766572696679696e67436f6e747261637429", + "id": 5716, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2083:84:43", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f", + "typeString": "literal_string \"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\"" + }, + "value": "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_stringliteral_8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f", + "typeString": "literal_string \"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\"" + } + ], + "id": 5715, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -8, + "src": "2073:9:43", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 5717, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2073:95:43", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "private" + }, + { + "canonicalName": "EIP712Upgradeable.EIP712Storage", + "documentation": { + "id": 5719, + "nodeType": "StructuredDocumentation", + "src": "2175:64:43", + "text": "@custom:storage-location erc7201:openzeppelin.storage.EIP712" + }, + "id": 5730, + "members": [ + { + "constant": false, + "id": 5722, + "mutability": "mutable", + "name": "_hashedName", + "nameLocation": "2332:11:43", + "nodeType": "VariableDeclaration", + "scope": 5730, + "src": "2324:19:43", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 5721, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "2324:7:43", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 5725, + "mutability": "mutable", + "name": "_hashedVersion", + "nameLocation": "2413:14:43", + "nodeType": "VariableDeclaration", + "scope": 5730, + "src": "2405:22:43", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 5724, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "2405:7:43", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 5727, + "mutability": "mutable", + "name": "_name", + "nameLocation": "2445:5:43", + "nodeType": "VariableDeclaration", + "scope": 5730, + "src": "2438:12:43", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + }, + "typeName": { + "id": 5726, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "2438:6:43", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 5729, + "mutability": "mutable", + "name": "_version", + "nameLocation": "2467:8:43", + "nodeType": "VariableDeclaration", + "scope": 5730, + "src": "2460:15:43", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + }, + "typeName": { + "id": 5728, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "2460:6:43", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "visibility": "internal" + } + ], + "name": "EIP712Storage", + "nameLocation": "2251:13:43", + "nodeType": "StructDefinition", + "scope": 6044, + "src": "2244:238:43", + "visibility": "public" + }, + { + "constant": true, + "id": 5733, + "mutability": "constant", + "name": "EIP712StorageLocation", + "nameLocation": "2623:21:43", + "nodeType": "VariableDeclaration", + "scope": 6044, + "src": "2598:115:43", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 5731, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "2598:7:43", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": { + "hexValue": "307861313661343664393432363163373531376363386666383966363163306365393335393865336338343938303130313164656536343961366135353764313030", + "id": 5732, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2647:66:43", + "typeDescriptions": { + "typeIdentifier": "t_rational_73010143390315934406010559831118728393600729754696197287367516085911467577600_by_1", + "typeString": "int_const 7301...(69 digits omitted)...7600" + }, + "value": "0xa16a46d94261c7517cc8ff89f61c0ce93598e3c849801011dee649a6a557d100" + }, + "visibility": "private" + }, + { + "body": { + "id": 5740, + "nodeType": "Block", + "src": "2796:80:43", + "statements": [ + { + "AST": { + "nativeSrc": "2815:55:43", + "nodeType": "YulBlock", + "src": "2815:55:43", + "statements": [ + { + "nativeSrc": "2829:31:43", + "nodeType": "YulAssignment", + "src": "2829:31:43", + "value": { + "name": "EIP712StorageLocation", + "nativeSrc": "2839:21:43", + "nodeType": "YulIdentifier", + "src": "2839:21:43" + }, + "variableNames": [ + { + "name": "$.slot", + "nativeSrc": "2829:6:43", + "nodeType": "YulIdentifier", + "src": "2829:6:43" + } + ] + } + ] + }, + "evmVersion": "paris", + "externalReferences": [ + { + "declaration": 5737, + "isOffset": false, + "isSlot": true, + "src": "2829:6:43", + "suffix": "slot", + "valueSize": 1 + }, + { + "declaration": 5733, + "isOffset": false, + "isSlot": false, + "src": "2839:21:43", + "valueSize": 1 + } + ], + "id": 5739, + "nodeType": "InlineAssembly", + "src": "2806:64:43" + } + ] + }, + "id": 5741, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_getEIP712Storage", + "nameLocation": "2729:17:43", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 5734, + "nodeType": "ParameterList", + "parameters": [], + "src": "2746:2:43" + }, + "returnParameters": { + "id": 5738, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 5737, + "mutability": "mutable", + "name": "$", + "nameLocation": "2793:1:43", + "nodeType": "VariableDeclaration", + "scope": 5741, + "src": "2771:23:43", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_EIP712Storage_$5730_storage_ptr", + "typeString": "struct EIP712Upgradeable.EIP712Storage" + }, + "typeName": { + "id": 5736, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 5735, + "name": "EIP712Storage", + "nameLocations": [ + "2771:13:43" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5730, + "src": "2771:13:43" + }, + "referencedDeclaration": 5730, + "src": "2771:13:43", + "typeDescriptions": { + "typeIdentifier": "t_struct$_EIP712Storage_$5730_storage_ptr", + "typeString": "struct EIP712Upgradeable.EIP712Storage" + } + }, + "visibility": "internal" + } + ], + "src": "2770:25:43" + }, + "scope": 6044, + "src": "2720:156:43", + "stateMutability": "pure", + "virtual": false, + "visibility": "private" + }, + { + "body": { + "id": 5756, + "nodeType": "Block", + "src": "3538:55:43", + "statements": [ + { + "expression": { + "arguments": [ + { + "id": 5752, + "name": "name", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5744, + "src": "3572:4:43", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + }, + { + "id": 5753, + "name": "version", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5746, + "src": "3578:7:43", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + }, + { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + ], + "id": 5751, + "name": "__EIP712_init_unchained", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5797, + "src": "3548:23:43", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_string_memory_ptr_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (string memory,string memory)" + } + }, + "id": 5754, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3548:38:43", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 5755, + "nodeType": "ExpressionStatement", + "src": "3548:38:43" + } + ] + }, + "documentation": { + "id": 5742, + "nodeType": "StructuredDocumentation", + "src": "2882:559:43", + "text": " @dev Initializes the domain separator and parameter caches.\n The meaning of `name` and `version` is specified in\n https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP-712]:\n - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\n - `version`: the current major version of the signing domain.\n NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\n contract upgrade]." + }, + "id": 5757, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "id": 5749, + "kind": "modifierInvocation", + "modifierName": { + "id": 5748, + "name": "onlyInitializing", + "nameLocations": [ + "3521:16:43" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5286, + "src": "3521:16:43" + }, + "nodeType": "ModifierInvocation", + "src": "3521:16:43" + } + ], + "name": "__EIP712_init", + "nameLocation": "3455:13:43", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 5747, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 5744, + "mutability": "mutable", + "name": "name", + "nameLocation": "3483:4:43", + "nodeType": "VariableDeclaration", + "scope": 5757, + "src": "3469:18:43", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 5743, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "3469:6:43", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 5746, + "mutability": "mutable", + "name": "version", + "nameLocation": "3503:7:43", + "nodeType": "VariableDeclaration", + "scope": 5757, + "src": "3489:21:43", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 5745, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "3489:6:43", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "visibility": "internal" + } + ], + "src": "3468:43:43" + }, + "returnParameters": { + "id": 5750, + "nodeType": "ParameterList", + "parameters": [], + "src": "3538:0:43" + }, + "scope": 6044, + "src": "3446:147:43", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 5796, + "nodeType": "Block", + "src": "3701:228:43", + "statements": [ + { + "assignments": [ + 5768 + ], + "declarations": [ + { + "constant": false, + "id": 5768, + "mutability": "mutable", + "name": "$", + "nameLocation": "3733:1:43", + "nodeType": "VariableDeclaration", + "scope": 5796, + "src": "3711:23:43", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_EIP712Storage_$5730_storage_ptr", + "typeString": "struct EIP712Upgradeable.EIP712Storage" + }, + "typeName": { + "id": 5767, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 5766, + "name": "EIP712Storage", + "nameLocations": [ + "3711:13:43" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5730, + "src": "3711:13:43" + }, + "referencedDeclaration": 5730, + "src": "3711:13:43", + "typeDescriptions": { + "typeIdentifier": "t_struct$_EIP712Storage_$5730_storage_ptr", + "typeString": "struct EIP712Upgradeable.EIP712Storage" + } + }, + "visibility": "internal" + } + ], + "id": 5771, + "initialValue": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 5769, + "name": "_getEIP712Storage", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5741, + "src": "3737:17:43", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$__$returns$_t_struct$_EIP712Storage_$5730_storage_ptr_$", + "typeString": "function () pure returns (struct EIP712Upgradeable.EIP712Storage storage pointer)" + } + }, + "id": 5770, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3737:19:43", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_EIP712Storage_$5730_storage_ptr", + "typeString": "struct EIP712Upgradeable.EIP712Storage storage pointer" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "3711:45:43" + }, + { + "expression": { + "id": 5776, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 5772, + "name": "$", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5768, + "src": "3766:1:43", + "typeDescriptions": { + "typeIdentifier": "t_struct$_EIP712Storage_$5730_storage_ptr", + "typeString": "struct EIP712Upgradeable.EIP712Storage storage pointer" + } + }, + "id": 5774, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberLocation": "3768:5:43", + "memberName": "_name", + "nodeType": "MemberAccess", + "referencedDeclaration": 5727, + "src": "3766:7:43", + "typeDescriptions": { + "typeIdentifier": "t_string_storage", + "typeString": "string storage ref" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "id": 5775, + "name": "name", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5759, + "src": "3776:4:43", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + }, + "src": "3766:14:43", + "typeDescriptions": { + "typeIdentifier": "t_string_storage", + "typeString": "string storage ref" + } + }, + "id": 5777, + "nodeType": "ExpressionStatement", + "src": "3766:14:43" + }, + { + "expression": { + "id": 5782, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 5778, + "name": "$", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5768, + "src": "3790:1:43", + "typeDescriptions": { + "typeIdentifier": "t_struct$_EIP712Storage_$5730_storage_ptr", + "typeString": "struct EIP712Upgradeable.EIP712Storage storage pointer" + } + }, + "id": 5780, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberLocation": "3792:8:43", + "memberName": "_version", + "nodeType": "MemberAccess", + "referencedDeclaration": 5729, + "src": "3790:10:43", + "typeDescriptions": { + "typeIdentifier": "t_string_storage", + "typeString": "string storage ref" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "id": 5781, + "name": "version", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5761, + "src": "3803:7:43", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + }, + "src": "3790:20:43", + "typeDescriptions": { + "typeIdentifier": "t_string_storage", + "typeString": "string storage ref" + } + }, + "id": 5783, + "nodeType": "ExpressionStatement", + "src": "3790:20:43" + }, + { + "expression": { + "id": 5788, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 5784, + "name": "$", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5768, + "src": "3875:1:43", + "typeDescriptions": { + "typeIdentifier": "t_struct$_EIP712Storage_$5730_storage_ptr", + "typeString": "struct EIP712Upgradeable.EIP712Storage storage pointer" + } + }, + "id": 5786, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberLocation": "3877:11:43", + "memberName": "_hashedName", + "nodeType": "MemberAccess", + "referencedDeclaration": 5722, + "src": "3875:13:43", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "hexValue": "30", + "id": 5787, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3891:1:43", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "3875:17:43", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "id": 5789, + "nodeType": "ExpressionStatement", + "src": "3875:17:43" + }, + { + "expression": { + "id": 5794, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 5790, + "name": "$", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5768, + "src": "3902:1:43", + "typeDescriptions": { + "typeIdentifier": "t_struct$_EIP712Storage_$5730_storage_ptr", + "typeString": "struct EIP712Upgradeable.EIP712Storage storage pointer" + } + }, + "id": 5792, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberLocation": "3904:14:43", + "memberName": "_hashedVersion", + "nodeType": "MemberAccess", + "referencedDeclaration": 5725, + "src": "3902:16:43", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "hexValue": "30", + "id": 5793, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3921:1:43", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "3902:20:43", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "id": 5795, + "nodeType": "ExpressionStatement", + "src": "3902:20:43" + } + ] + }, + "id": 5797, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "id": 5764, + "kind": "modifierInvocation", + "modifierName": { + "id": 5763, + "name": "onlyInitializing", + "nameLocations": [ + "3684:16:43" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5286, + "src": "3684:16:43" + }, + "nodeType": "ModifierInvocation", + "src": "3684:16:43" + } + ], + "name": "__EIP712_init_unchained", + "nameLocation": "3608:23:43", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 5762, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 5759, + "mutability": "mutable", + "name": "name", + "nameLocation": "3646:4:43", + "nodeType": "VariableDeclaration", + "scope": 5797, + "src": "3632:18:43", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 5758, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "3632:6:43", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 5761, + "mutability": "mutable", + "name": "version", + "nameLocation": "3666:7:43", + "nodeType": "VariableDeclaration", + "scope": 5797, + "src": "3652:21:43", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 5760, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "3652:6:43", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "visibility": "internal" + } + ], + "src": "3631:43:43" + }, + "returnParameters": { + "id": 5765, + "nodeType": "ParameterList", + "parameters": [], + "src": "3701:0:43" + }, + "scope": 6044, + "src": "3599:330:43", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 5806, + "nodeType": "Block", + "src": "4077:47:43", + "statements": [ + { + "expression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 5803, + "name": "_buildDomainSeparator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5830, + "src": "4094:21:43", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_bytes32_$", + "typeString": "function () view returns (bytes32)" + } + }, + "id": 5804, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4094:23:43", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "functionReturnParameters": 5802, + "id": 5805, + "nodeType": "Return", + "src": "4087:30:43" + } + ] + }, + "documentation": { + "id": 5798, + "nodeType": "StructuredDocumentation", + "src": "3935:75:43", + "text": " @dev Returns the domain separator for the current chain." + }, + "id": 5807, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_domainSeparatorV4", + "nameLocation": "4024:18:43", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 5799, + "nodeType": "ParameterList", + "parameters": [], + "src": "4042:2:43" + }, + "returnParameters": { + "id": 5802, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 5801, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 5807, + "src": "4068:7:43", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 5800, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "4068:7:43", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "4067:9:43" + }, + "scope": 6044, + "src": "4015:109:43", + "stateMutability": "view", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 5829, + "nodeType": "Block", + "src": "4194:127:43", + "statements": [ + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "id": 5815, + "name": "TYPE_HASH", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5718, + "src": "4232:9:43", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 5816, + "name": "_EIP712NameHash", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5991, + "src": "4243:15:43", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_bytes32_$", + "typeString": "function () view returns (bytes32)" + } + }, + "id": 5817, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4243:17:43", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 5818, + "name": "_EIP712VersionHash", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6043, + "src": "4262:18:43", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_bytes32_$", + "typeString": "function () view returns (bytes32)" + } + }, + "id": 5819, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4262:20:43", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "expression": { + "id": 5820, + "name": "block", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -4, + "src": "4284:5:43", + "typeDescriptions": { + "typeIdentifier": "t_magic_block", + "typeString": "block" + } + }, + "id": 5821, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "4290:7:43", + "memberName": "chainid", + "nodeType": "MemberAccess", + "src": "4284:13:43", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "arguments": [ + { + "id": 5824, + "name": "this", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -28, + "src": "4307:4:43", + "typeDescriptions": { + "typeIdentifier": "t_contract$_EIP712Upgradeable_$6044", + "typeString": "contract EIP712Upgradeable" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_EIP712Upgradeable_$6044", + "typeString": "contract EIP712Upgradeable" + } + ], + "id": 5823, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "4299:7:43", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 5822, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4299:7:43", + "typeDescriptions": {} + } + }, + "id": 5825, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4299:13:43", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "expression": { + "id": 5813, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -1, + "src": "4221:3:43", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 5814, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "4225:6:43", + "memberName": "encode", + "nodeType": "MemberAccess", + "src": "4221:10:43", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencode_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 5826, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4221:92:43", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 5812, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -8, + "src": "4211:9:43", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 5827, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4211:103:43", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "functionReturnParameters": 5811, + "id": 5828, + "nodeType": "Return", + "src": "4204:110:43" + } + ] + }, + "id": 5830, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_buildDomainSeparator", + "nameLocation": "4139:21:43", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 5808, + "nodeType": "ParameterList", + "parameters": [], + "src": "4160:2:43" + }, + "returnParameters": { + "id": 5811, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 5810, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 5830, + "src": "4185:7:43", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 5809, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "4185:7:43", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "4184:9:43" + }, + "scope": 6044, + "src": "4130:191:43", + "stateMutability": "view", + "virtual": false, + "visibility": "private" + }, + { + "body": { + "id": 5845, + "nodeType": "Block", + "src": "5032:90:43", + "statements": [ + { + "expression": { + "arguments": [ + { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 5840, + "name": "_domainSeparatorV4", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5807, + "src": "5082:18:43", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_bytes32_$", + "typeString": "function () view returns (bytes32)" + } + }, + "id": 5841, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5082:20:43", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "id": 5842, + "name": "structHash", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5833, + "src": "5104:10:43", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "expression": { + "id": 5838, + "name": "MessageHashUtils", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8317, + "src": "5049:16:43", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_MessageHashUtils_$8317_$", + "typeString": "type(library MessageHashUtils)" + } + }, + "id": 5839, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "5066:15:43", + "memberName": "toTypedDataHash", + "nodeType": "MemberAccess", + "referencedDeclaration": 8316, + "src": "5049:32:43", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_bytes32_$_t_bytes32_$returns$_t_bytes32_$", + "typeString": "function (bytes32,bytes32) pure returns (bytes32)" + } + }, + "id": 5843, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5049:66:43", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "functionReturnParameters": 5837, + "id": 5844, + "nodeType": "Return", + "src": "5042:73:43" + } + ] + }, + "documentation": { + "id": 5831, + "nodeType": "StructuredDocumentation", + "src": "4327:614:43", + "text": " @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\n function returns the hash of the fully encoded EIP712 message for this domain.\n This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\n ```solidity\n bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\n keccak256(\"Mail(address to,string contents)\"),\n mailTo,\n keccak256(bytes(mailContents))\n )));\n address signer = ECDSA.recover(digest, signature);\n ```" + }, + "id": 5846, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_hashTypedDataV4", + "nameLocation": "4955:16:43", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 5834, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 5833, + "mutability": "mutable", + "name": "structHash", + "nameLocation": "4980:10:43", + "nodeType": "VariableDeclaration", + "scope": 5846, + "src": "4972:18:43", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 5832, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "4972:7:43", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "4971:20:43" + }, + "returnParameters": { + "id": 5837, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 5836, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 5846, + "src": "5023:7:43", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 5835, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "5023:7:43", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "5022:9:43" + }, + "scope": 6044, + "src": "4946:176:43", + "stateMutability": "view", + "virtual": true, + "visibility": "internal" + }, + { + "baseFunctions": [ + 6068 + ], + "body": { + "id": 5906, + "nodeType": "Block", + "src": "5500:575:43", + "statements": [ + { + "assignments": [ + 5867 + ], + "declarations": [ + { + "constant": false, + "id": 5867, + "mutability": "mutable", + "name": "$", + "nameLocation": "5532:1:43", + "nodeType": "VariableDeclaration", + "scope": 5906, + "src": "5510:23:43", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_EIP712Storage_$5730_storage_ptr", + "typeString": "struct EIP712Upgradeable.EIP712Storage" + }, + "typeName": { + "id": 5866, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 5865, + "name": "EIP712Storage", + "nameLocations": [ + "5510:13:43" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5730, + "src": "5510:13:43" + }, + "referencedDeclaration": 5730, + "src": "5510:13:43", + "typeDescriptions": { + "typeIdentifier": "t_struct$_EIP712Storage_$5730_storage_ptr", + "typeString": "struct EIP712Upgradeable.EIP712Storage" + } + }, + "visibility": "internal" + } + ], + "id": 5870, + "initialValue": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 5868, + "name": "_getEIP712Storage", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5741, + "src": "5536:17:43", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$__$returns$_t_struct$_EIP712Storage_$5730_storage_ptr_$", + "typeString": "function () pure returns (struct EIP712Upgradeable.EIP712Storage storage pointer)" + } + }, + "id": 5869, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5536:19:43", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_EIP712Storage_$5730_storage_ptr", + "typeString": "struct EIP712Upgradeable.EIP712Storage storage pointer" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "5510:45:43" + }, + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 5880, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "commonType": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "id": 5875, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 5872, + "name": "$", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5867, + "src": "5776:1:43", + "typeDescriptions": { + "typeIdentifier": "t_struct$_EIP712Storage_$5730_storage_ptr", + "typeString": "struct EIP712Upgradeable.EIP712Storage storage pointer" + } + }, + "id": 5873, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "5778:11:43", + "memberName": "_hashedName", + "nodeType": "MemberAccess", + "referencedDeclaration": 5722, + "src": "5776:13:43", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "30", + "id": 5874, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "5793:1:43", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "5776:18:43", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "&&", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "id": 5879, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 5876, + "name": "$", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5867, + "src": "5798:1:43", + "typeDescriptions": { + "typeIdentifier": "t_struct$_EIP712Storage_$5730_storage_ptr", + "typeString": "struct EIP712Upgradeable.EIP712Storage storage pointer" + } + }, + "id": 5877, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "5800:14:43", + "memberName": "_hashedVersion", + "nodeType": "MemberAccess", + "referencedDeclaration": 5725, + "src": "5798:16:43", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "30", + "id": 5878, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "5818:1:43", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "5798:21:43", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "5776:43:43", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "hexValue": "4549503731323a20556e696e697469616c697a6564", + "id": 5881, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "5821:23:43", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_2e5045ff73280aa8e8acd8c82710f23812497f87f7f576e2220a2ddd0d45eade", + "typeString": "literal_string \"EIP712: Uninitialized\"" + }, + "value": "EIP712: Uninitialized" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_2e5045ff73280aa8e8acd8c82710f23812497f87f7f576e2220a2ddd0d45eade", + "typeString": "literal_string \"EIP712: Uninitialized\"" + } + ], + "id": 5871, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "5768:7:43", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 5882, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5768:77:43", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 5883, + "nodeType": "ExpressionStatement", + "src": "5768:77:43" + }, + { + "expression": { + "components": [ + { + "hexValue": "0f", + "id": 5884, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "hexString", + "lValueRequested": false, + "nodeType": "Literal", + "src": "5877:7:43", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_3d725c5ee53025f027da36bea8d3af3b6a3e9d2d1542d47c162631de48e66c1c", + "typeString": "literal_string hex\"0f\"" + }, + "value": "\u000f" + }, + { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 5885, + "name": "_EIP712Name", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5923, + "src": "5907:11:43", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_string_memory_ptr_$", + "typeString": "function () view returns (string memory)" + } + }, + "id": 5886, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5907:13:43", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + }, + { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 5887, + "name": "_EIP712Version", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5939, + "src": "5934:14:43", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_string_memory_ptr_$", + "typeString": "function () view returns (string memory)" + } + }, + "id": 5888, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5934:16:43", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + }, + { + "expression": { + "id": 5889, + "name": "block", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -4, + "src": "5964:5:43", + "typeDescriptions": { + "typeIdentifier": "t_magic_block", + "typeString": "block" + } + }, + "id": 5890, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "5970:7:43", + "memberName": "chainid", + "nodeType": "MemberAccess", + "src": "5964:13:43", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "arguments": [ + { + "id": 5893, + "name": "this", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -28, + "src": "5999:4:43", + "typeDescriptions": { + "typeIdentifier": "t_contract$_EIP712Upgradeable_$6044", + "typeString": "contract EIP712Upgradeable" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_EIP712Upgradeable_$6044", + "typeString": "contract EIP712Upgradeable" + } + ], + "id": 5892, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "5991:7:43", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 5891, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5991:7:43", + "typeDescriptions": {} + } + }, + "id": 5894, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5991:13:43", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "arguments": [ + { + "hexValue": "30", + "id": 5897, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6026:1:43", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 5896, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "6018:7:43", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes32_$", + "typeString": "type(bytes32)" + }, + "typeName": { + "id": 5895, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "6018:7:43", + "typeDescriptions": {} + } + }, + "id": 5898, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "6018:10:43", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "arguments": [ + { + "hexValue": "30", + "id": 5902, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6056:1:43", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 5901, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "NewExpression", + "src": "6042:13:43", + "typeDescriptions": { + "typeIdentifier": "t_function_objectcreation_pure$_t_uint256_$returns$_t_array$_t_uint256_$dyn_memory_ptr_$", + "typeString": "function (uint256) pure returns (uint256[] memory)" + }, + "typeName": { + "baseType": { + "id": 5899, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "6046:7:43", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 5900, + "nodeType": "ArrayTypeName", + "src": "6046:9:43", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", + "typeString": "uint256[]" + } + } + }, + "id": 5903, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "6042:16:43", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" + } + } + ], + "id": 5904, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "5863:205:43", + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_stringliteral_3d725c5ee53025f027da36bea8d3af3b6a3e9d2d1542d47c162631de48e66c1c_$_t_string_memory_ptr_$_t_string_memory_ptr_$_t_uint256_$_t_address_$_t_bytes32_$_t_array$_t_uint256_$dyn_memory_ptr_$", + "typeString": "tuple(literal_string hex\"0f\",string memory,string memory,uint256,address,bytes32,uint256[] memory)" + } + }, + "functionReturnParameters": 5864, + "id": 5905, + "nodeType": "Return", + "src": "5856:212:43" + } + ] + }, + "documentation": { + "id": 5847, + "nodeType": "StructuredDocumentation", + "src": "5128:39:43", + "text": " @inheritdoc IERC5267" + }, + "functionSelector": "84b0196e", + "id": 5907, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "eip712Domain", + "nameLocation": "5181:12:43", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 5848, + "nodeType": "ParameterList", + "parameters": [], + "src": "5193:2:43" + }, + "returnParameters": { + "id": 5864, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 5850, + "mutability": "mutable", + "name": "fields", + "nameLocation": "5277:6:43", + "nodeType": "VariableDeclaration", + "scope": 5907, + "src": "5270:13:43", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + }, + "typeName": { + "id": 5849, + "name": "bytes1", + "nodeType": "ElementaryTypeName", + "src": "5270:6:43", + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 5852, + "mutability": "mutable", + "name": "name", + "nameLocation": "5311:4:43", + "nodeType": "VariableDeclaration", + "scope": 5907, + "src": "5297:18:43", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 5851, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "5297:6:43", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 5854, + "mutability": "mutable", + "name": "version", + "nameLocation": "5343:7:43", + "nodeType": "VariableDeclaration", + "scope": 5907, + "src": "5329:21:43", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 5853, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "5329:6:43", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 5856, + "mutability": "mutable", + "name": "chainId", + "nameLocation": "5372:7:43", + "nodeType": "VariableDeclaration", + "scope": 5907, + "src": "5364:15:43", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 5855, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "5364:7:43", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 5858, + "mutability": "mutable", + "name": "verifyingContract", + "nameLocation": "5401:17:43", + "nodeType": "VariableDeclaration", + "scope": 5907, + "src": "5393:25:43", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 5857, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5393:7:43", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 5860, + "mutability": "mutable", + "name": "salt", + "nameLocation": "5440:4:43", + "nodeType": "VariableDeclaration", + "scope": 5907, + "src": "5432:12:43", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 5859, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "5432:7:43", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 5863, + "mutability": "mutable", + "name": "extensions", + "nameLocation": "5475:10:43", + "nodeType": "VariableDeclaration", + "scope": 5907, + "src": "5458:27:43", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[]" + }, + "typeName": { + "baseType": { + "id": 5861, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "5458:7:43", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 5862, + "nodeType": "ArrayTypeName", + "src": "5458:9:43", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", + "typeString": "uint256[]" + } + }, + "visibility": "internal" + } + ], + "src": "5256:239:43" + }, + "scope": 6044, + "src": "5172:903:43", + "stateMutability": "view", + "virtual": true, + "visibility": "public" + }, + { + "body": { + "id": 5922, + "nodeType": "Block", + "src": "6368:86:43", + "statements": [ + { + "assignments": [ + 5915 + ], + "declarations": [ + { + "constant": false, + "id": 5915, + "mutability": "mutable", + "name": "$", + "nameLocation": "6400:1:43", + "nodeType": "VariableDeclaration", + "scope": 5922, + "src": "6378:23:43", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_EIP712Storage_$5730_storage_ptr", + "typeString": "struct EIP712Upgradeable.EIP712Storage" + }, + "typeName": { + "id": 5914, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 5913, + "name": "EIP712Storage", + "nameLocations": [ + "6378:13:43" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5730, + "src": "6378:13:43" + }, + "referencedDeclaration": 5730, + "src": "6378:13:43", + "typeDescriptions": { + "typeIdentifier": "t_struct$_EIP712Storage_$5730_storage_ptr", + "typeString": "struct EIP712Upgradeable.EIP712Storage" + } + }, + "visibility": "internal" + } + ], + "id": 5918, + "initialValue": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 5916, + "name": "_getEIP712Storage", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5741, + "src": "6404:17:43", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$__$returns$_t_struct$_EIP712Storage_$5730_storage_ptr_$", + "typeString": "function () pure returns (struct EIP712Upgradeable.EIP712Storage storage pointer)" + } + }, + "id": 5917, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "6404:19:43", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_EIP712Storage_$5730_storage_ptr", + "typeString": "struct EIP712Upgradeable.EIP712Storage storage pointer" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "6378:45:43" + }, + { + "expression": { + "expression": { + "id": 5919, + "name": "$", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5915, + "src": "6440:1:43", + "typeDescriptions": { + "typeIdentifier": "t_struct$_EIP712Storage_$5730_storage_ptr", + "typeString": "struct EIP712Upgradeable.EIP712Storage storage pointer" + } + }, + "id": 5920, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "6442:5:43", + "memberName": "_name", + "nodeType": "MemberAccess", + "referencedDeclaration": 5727, + "src": "6440:7:43", + "typeDescriptions": { + "typeIdentifier": "t_string_storage", + "typeString": "string storage ref" + } + }, + "functionReturnParameters": 5912, + "id": 5921, + "nodeType": "Return", + "src": "6433:14:43" + } + ] + }, + "documentation": { + "id": 5908, + "nodeType": "StructuredDocumentation", + "src": "6081:213:43", + "text": " @dev The name parameter for the EIP712 domain.\n NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\n are a concern." + }, + "id": 5923, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_EIP712Name", + "nameLocation": "6308:11:43", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 5909, + "nodeType": "ParameterList", + "parameters": [], + "src": "6319:2:43" + }, + "returnParameters": { + "id": 5912, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 5911, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 5923, + "src": "6353:13:43", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 5910, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "6353:6:43", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "visibility": "internal" + } + ], + "src": "6352:15:43" + }, + "scope": 6044, + "src": "6299:155:43", + "stateMutability": "view", + "virtual": true, + "visibility": "internal" + }, + { + "body": { + "id": 5938, + "nodeType": "Block", + "src": "6753:89:43", + "statements": [ + { + "assignments": [ + 5931 + ], + "declarations": [ + { + "constant": false, + "id": 5931, + "mutability": "mutable", + "name": "$", + "nameLocation": "6785:1:43", + "nodeType": "VariableDeclaration", + "scope": 5938, + "src": "6763:23:43", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_EIP712Storage_$5730_storage_ptr", + "typeString": "struct EIP712Upgradeable.EIP712Storage" + }, + "typeName": { + "id": 5930, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 5929, + "name": "EIP712Storage", + "nameLocations": [ + "6763:13:43" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5730, + "src": "6763:13:43" + }, + "referencedDeclaration": 5730, + "src": "6763:13:43", + "typeDescriptions": { + "typeIdentifier": "t_struct$_EIP712Storage_$5730_storage_ptr", + "typeString": "struct EIP712Upgradeable.EIP712Storage" + } + }, + "visibility": "internal" + } + ], + "id": 5934, + "initialValue": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 5932, + "name": "_getEIP712Storage", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5741, + "src": "6789:17:43", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$__$returns$_t_struct$_EIP712Storage_$5730_storage_ptr_$", + "typeString": "function () pure returns (struct EIP712Upgradeable.EIP712Storage storage pointer)" + } + }, + "id": 5933, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "6789:19:43", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_EIP712Storage_$5730_storage_ptr", + "typeString": "struct EIP712Upgradeable.EIP712Storage storage pointer" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "6763:45:43" + }, + { + "expression": { + "expression": { + "id": 5935, + "name": "$", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5931, + "src": "6825:1:43", + "typeDescriptions": { + "typeIdentifier": "t_struct$_EIP712Storage_$5730_storage_ptr", + "typeString": "struct EIP712Upgradeable.EIP712Storage storage pointer" + } + }, + "id": 5936, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "6827:8:43", + "memberName": "_version", + "nodeType": "MemberAccess", + "referencedDeclaration": 5729, + "src": "6825:10:43", + "typeDescriptions": { + "typeIdentifier": "t_string_storage", + "typeString": "string storage ref" + } + }, + "functionReturnParameters": 5928, + "id": 5937, + "nodeType": "Return", + "src": "6818:17:43" + } + ] + }, + "documentation": { + "id": 5924, + "nodeType": "StructuredDocumentation", + "src": "6460:216:43", + "text": " @dev The version parameter for the EIP712 domain.\n NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\n are a concern." + }, + "id": 5939, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_EIP712Version", + "nameLocation": "6690:14:43", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 5925, + "nodeType": "ParameterList", + "parameters": [], + "src": "6704:2:43" + }, + "returnParameters": { + "id": 5928, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 5927, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 5939, + "src": "6738:13:43", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 5926, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "6738:6:43", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "visibility": "internal" + } + ], + "src": "6737:15:43" + }, + "scope": 6044, + "src": "6681:161:43", + "stateMutability": "view", + "virtual": true, + "visibility": "internal" + }, + { + "body": { + "id": 5990, + "nodeType": "Block", + "src": "7116:628:43", + "statements": [ + { + "assignments": [ + 5947 + ], + "declarations": [ + { + "constant": false, + "id": 5947, + "mutability": "mutable", + "name": "$", + "nameLocation": "7148:1:43", + "nodeType": "VariableDeclaration", + "scope": 5990, + "src": "7126:23:43", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_EIP712Storage_$5730_storage_ptr", + "typeString": "struct EIP712Upgradeable.EIP712Storage" + }, + "typeName": { + "id": 5946, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 5945, + "name": "EIP712Storage", + "nameLocations": [ + "7126:13:43" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5730, + "src": "7126:13:43" + }, + "referencedDeclaration": 5730, + "src": "7126:13:43", + "typeDescriptions": { + "typeIdentifier": "t_struct$_EIP712Storage_$5730_storage_ptr", + "typeString": "struct EIP712Upgradeable.EIP712Storage" + } + }, + "visibility": "internal" + } + ], + "id": 5950, + "initialValue": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 5948, + "name": "_getEIP712Storage", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5741, + "src": "7152:17:43", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$__$returns$_t_struct$_EIP712Storage_$5730_storage_ptr_$", + "typeString": "function () pure returns (struct EIP712Upgradeable.EIP712Storage storage pointer)" + } + }, + "id": 5949, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "7152:19:43", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_EIP712Storage_$5730_storage_ptr", + "typeString": "struct EIP712Upgradeable.EIP712Storage storage pointer" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "7126:45:43" + }, + { + "assignments": [ + 5952 + ], + "declarations": [ + { + "constant": false, + "id": 5952, + "mutability": "mutable", + "name": "name", + "nameLocation": "7195:4:43", + "nodeType": "VariableDeclaration", + "scope": 5990, + "src": "7181:18:43", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 5951, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "7181:6:43", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "visibility": "internal" + } + ], + "id": 5955, + "initialValue": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 5953, + "name": "_EIP712Name", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5923, + "src": "7202:11:43", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_string_memory_ptr_$", + "typeString": "function () view returns (string memory)" + } + }, + "id": 5954, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "7202:13:43", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "7181:34:43" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 5962, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "arguments": [ + { + "id": 5958, + "name": "name", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5952, + "src": "7235:4:43", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + ], + "id": 5957, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "7229:5:43", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes_storage_ptr_$", + "typeString": "type(bytes storage pointer)" + }, + "typeName": { + "id": 5956, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "7229:5:43", + "typeDescriptions": {} + } + }, + "id": 5959, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "7229:11:43", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 5960, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "7241:6:43", + "memberName": "length", + "nodeType": "MemberAccess", + "src": "7229:18:43", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "hexValue": "30", + "id": 5961, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7250:1:43", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "7229:22:43", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "id": 5988, + "nodeType": "Block", + "src": "7313:425:43", + "statements": [ + { + "assignments": [ + 5972 + ], + "declarations": [ + { + "constant": false, + "id": 5972, + "mutability": "mutable", + "name": "hashedName", + "nameLocation": "7558:10:43", + "nodeType": "VariableDeclaration", + "scope": 5988, + "src": "7550:18:43", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 5971, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "7550:7:43", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "id": 5975, + "initialValue": { + "expression": { + "id": 5973, + "name": "$", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5947, + "src": "7571:1:43", + "typeDescriptions": { + "typeIdentifier": "t_struct$_EIP712Storage_$5730_storage_ptr", + "typeString": "struct EIP712Upgradeable.EIP712Storage storage pointer" + } + }, + "id": 5974, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "7573:11:43", + "memberName": "_hashedName", + "nodeType": "MemberAccess", + "referencedDeclaration": 5722, + "src": "7571:13:43", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "7550:34:43" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "id": 5978, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 5976, + "name": "hashedName", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5972, + "src": "7602:10:43", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "hexValue": "30", + "id": 5977, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7616:1:43", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "7602:15:43", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "id": 5986, + "nodeType": "Block", + "src": "7675:53:43", + "statements": [ + { + "expression": { + "arguments": [ + { + "hexValue": "", + "id": 5983, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7710:2:43", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470", + "typeString": "literal_string \"\"" + }, + "value": "" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_stringliteral_c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470", + "typeString": "literal_string \"\"" + } + ], + "id": 5982, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -8, + "src": "7700:9:43", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 5984, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "7700:13:43", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "functionReturnParameters": 5944, + "id": 5985, + "nodeType": "Return", + "src": "7693:20:43" + } + ] + }, + "id": 5987, + "nodeType": "IfStatement", + "src": "7598:130:43", + "trueBody": { + "id": 5981, + "nodeType": "Block", + "src": "7619:50:43", + "statements": [ + { + "expression": { + "id": 5979, + "name": "hashedName", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5972, + "src": "7644:10:43", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "functionReturnParameters": 5944, + "id": 5980, + "nodeType": "Return", + "src": "7637:17:43" + } + ] + } + } + ] + }, + "id": 5989, + "nodeType": "IfStatement", + "src": "7225:513:43", + "trueBody": { + "id": 5970, + "nodeType": "Block", + "src": "7253:54:43", + "statements": [ + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "id": 5966, + "name": "name", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5952, + "src": "7290:4:43", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + ], + "id": 5965, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "7284:5:43", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes_storage_ptr_$", + "typeString": "type(bytes storage pointer)" + }, + "typeName": { + "id": 5964, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "7284:5:43", + "typeDescriptions": {} + } + }, + "id": 5967, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "7284:11:43", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 5963, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -8, + "src": "7274:9:43", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 5968, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "7274:22:43", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "functionReturnParameters": 5944, + "id": 5969, + "nodeType": "Return", + "src": "7267:29:43" + } + ] + } + } + ] + }, + "documentation": { + "id": 5940, + "nodeType": "StructuredDocumentation", + "src": "6848:204:43", + "text": " @dev The hash of the name parameter for the EIP712 domain.\n NOTE: In previous versions this function was virtual. In this version you should override `_EIP712Name` instead." + }, + "id": 5991, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_EIP712NameHash", + "nameLocation": "7066:15:43", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 5941, + "nodeType": "ParameterList", + "parameters": [], + "src": "7081:2:43" + }, + "returnParameters": { + "id": 5944, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 5943, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 5991, + "src": "7107:7:43", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 5942, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "7107:7:43", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "7106:9:43" + }, + "scope": 6044, + "src": "7057:687:43", + "stateMutability": "view", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 6042, + "nodeType": "Block", + "src": "8027:661:43", + "statements": [ + { + "assignments": [ + 5999 + ], + "declarations": [ + { + "constant": false, + "id": 5999, + "mutability": "mutable", + "name": "$", + "nameLocation": "8059:1:43", + "nodeType": "VariableDeclaration", + "scope": 6042, + "src": "8037:23:43", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_EIP712Storage_$5730_storage_ptr", + "typeString": "struct EIP712Upgradeable.EIP712Storage" + }, + "typeName": { + "id": 5998, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 5997, + "name": "EIP712Storage", + "nameLocations": [ + "8037:13:43" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5730, + "src": "8037:13:43" + }, + "referencedDeclaration": 5730, + "src": "8037:13:43", + "typeDescriptions": { + "typeIdentifier": "t_struct$_EIP712Storage_$5730_storage_ptr", + "typeString": "struct EIP712Upgradeable.EIP712Storage" + } + }, + "visibility": "internal" + } + ], + "id": 6002, + "initialValue": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 6000, + "name": "_getEIP712Storage", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5741, + "src": "8063:17:43", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$__$returns$_t_struct$_EIP712Storage_$5730_storage_ptr_$", + "typeString": "function () pure returns (struct EIP712Upgradeable.EIP712Storage storage pointer)" + } + }, + "id": 6001, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "8063:19:43", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_EIP712Storage_$5730_storage_ptr", + "typeString": "struct EIP712Upgradeable.EIP712Storage storage pointer" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "8037:45:43" + }, + { + "assignments": [ + 6004 + ], + "declarations": [ + { + "constant": false, + "id": 6004, + "mutability": "mutable", + "name": "version", + "nameLocation": "8106:7:43", + "nodeType": "VariableDeclaration", + "scope": 6042, + "src": "8092:21:43", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 6003, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "8092:6:43", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "visibility": "internal" + } + ], + "id": 6007, + "initialValue": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 6005, + "name": "_EIP712Version", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5939, + "src": "8116:14:43", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_string_memory_ptr_$", + "typeString": "function () view returns (string memory)" + } + }, + "id": 6006, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "8116:16:43", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "8092:40:43" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 6014, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "arguments": [ + { + "id": 6010, + "name": "version", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6004, + "src": "8152:7:43", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + ], + "id": 6009, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "8146:5:43", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes_storage_ptr_$", + "typeString": "type(bytes storage pointer)" + }, + "typeName": { + "id": 6008, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "8146:5:43", + "typeDescriptions": {} + } + }, + "id": 6011, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "8146:14:43", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 6012, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "8161:6:43", + "memberName": "length", + "nodeType": "MemberAccess", + "src": "8146:21:43", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "hexValue": "30", + "id": 6013, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8170:1:43", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "8146:25:43", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "id": 6040, + "nodeType": "Block", + "src": "8236:446:43", + "statements": [ + { + "assignments": [ + 6024 + ], + "declarations": [ + { + "constant": false, + "id": 6024, + "mutability": "mutable", + "name": "hashedVersion", + "nameLocation": "8490:13:43", + "nodeType": "VariableDeclaration", + "scope": 6040, + "src": "8482:21:43", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 6023, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "8482:7:43", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "id": 6027, + "initialValue": { + "expression": { + "id": 6025, + "name": "$", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5999, + "src": "8506:1:43", + "typeDescriptions": { + "typeIdentifier": "t_struct$_EIP712Storage_$5730_storage_ptr", + "typeString": "struct EIP712Upgradeable.EIP712Storage storage pointer" + } + }, + "id": 6026, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "8508:14:43", + "memberName": "_hashedVersion", + "nodeType": "MemberAccess", + "referencedDeclaration": 5725, + "src": "8506:16:43", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "8482:40:43" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "id": 6030, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 6028, + "name": "hashedVersion", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6024, + "src": "8540:13:43", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "hexValue": "30", + "id": 6029, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8557:1:43", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "8540:18:43", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "id": 6038, + "nodeType": "Block", + "src": "8619:53:43", + "statements": [ + { + "expression": { + "arguments": [ + { + "hexValue": "", + "id": 6035, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8654:2:43", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470", + "typeString": "literal_string \"\"" + }, + "value": "" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_stringliteral_c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470", + "typeString": "literal_string \"\"" + } + ], + "id": 6034, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -8, + "src": "8644:9:43", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 6036, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "8644:13:43", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "functionReturnParameters": 5996, + "id": 6037, + "nodeType": "Return", + "src": "8637:20:43" + } + ] + }, + "id": 6039, + "nodeType": "IfStatement", + "src": "8536:136:43", + "trueBody": { + "id": 6033, + "nodeType": "Block", + "src": "8560:53:43", + "statements": [ + { + "expression": { + "id": 6031, + "name": "hashedVersion", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6024, + "src": "8585:13:43", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "functionReturnParameters": 5996, + "id": 6032, + "nodeType": "Return", + "src": "8578:20:43" + } + ] + } + } + ] + }, + "id": 6041, + "nodeType": "IfStatement", + "src": "8142:540:43", + "trueBody": { + "id": 6022, + "nodeType": "Block", + "src": "8173:57:43", + "statements": [ + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "id": 6018, + "name": "version", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6004, + "src": "8210:7:43", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + ], + "id": 6017, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "8204:5:43", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes_storage_ptr_$", + "typeString": "type(bytes storage pointer)" + }, + "typeName": { + "id": 6016, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "8204:5:43", + "typeDescriptions": {} + } + }, + "id": 6019, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "8204:14:43", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 6015, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -8, + "src": "8194:9:43", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 6020, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "8194:25:43", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "functionReturnParameters": 5996, + "id": 6021, + "nodeType": "Return", + "src": "8187:32:43" + } + ] + } + } + ] + }, + "documentation": { + "id": 5992, + "nodeType": "StructuredDocumentation", + "src": "7750:210:43", + "text": " @dev The hash of the version parameter for the EIP712 domain.\n NOTE: In previous versions this function was virtual. In this version you should override `_EIP712Version` instead." + }, + "id": 6043, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_EIP712VersionHash", + "nameLocation": "7974:18:43", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 5993, + "nodeType": "ParameterList", + "parameters": [], + "src": "7992:2:43" + }, + "returnParameters": { + "id": 5996, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 5995, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 6043, + "src": "8018:7:43", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 5994, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "8018:7:43", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "8017:9:43" + }, + "scope": 6044, + "src": "7965:723:43", + "stateMutability": "view", + "virtual": false, + "visibility": "internal" + } + ], + "scope": 6045, + "src": "1959:6731:43", + "usedErrors": [ + 5140, + 5143 + ], + "usedEvents": [ + 5148, + 6049 + ] + } + ], + "src": "113:8578:43" + }, + "id": 43 + }, + "@openzeppelin/contracts/interfaces/IERC5267.sol": { + "ast": { + "absolutePath": "@openzeppelin/contracts/interfaces/IERC5267.sol", + "exportedSymbols": { + "IERC5267": [ + 6069 + ] + }, + "id": 6070, + "license": "MIT", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 6046, + "literals": [ + "solidity", + "^", + "0.8", + ".20" + ], + "nodeType": "PragmaDirective", + "src": "107:24:44" + }, + { + "abstract": false, + "baseContracts": [], + "canonicalName": "IERC5267", + "contractDependencies": [], + "contractKind": "interface", + "fullyImplemented": false, + "id": 6069, + "linearizedBaseContracts": [ + 6069 + ], + "name": "IERC5267", + "nameLocation": "143:8:44", + "nodeType": "ContractDefinition", + "nodes": [ + { + "anonymous": false, + "documentation": { + "id": 6047, + "nodeType": "StructuredDocumentation", + "src": "158:84:44", + "text": " @dev MAY be emitted to signal that the domain could have changed." + }, + "eventSelector": "0a6387c9ea3628b88a633bb4f3b151770f70085117a15f9bf3787cda53f13d31", + "id": 6049, + "name": "EIP712DomainChanged", + "nameLocation": "253:19:44", + "nodeType": "EventDefinition", + "parameters": { + "id": 6048, + "nodeType": "ParameterList", + "parameters": [], + "src": "272:2:44" + }, + "src": "247:28:44" + }, + { + "documentation": { + "id": 6050, + "nodeType": "StructuredDocumentation", + "src": "281:140:44", + "text": " @dev returns the fields and values that describe the domain separator used by this contract for EIP-712\n signature." + }, + "functionSelector": "84b0196e", + "id": 6068, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "eip712Domain", + "nameLocation": "435:12:44", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 6051, + "nodeType": "ParameterList", + "parameters": [], + "src": "447:2:44" + }, + "returnParameters": { + "id": 6067, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 6053, + "mutability": "mutable", + "name": "fields", + "nameLocation": "517:6:44", + "nodeType": "VariableDeclaration", + "scope": 6068, + "src": "510:13:44", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + }, + "typeName": { + "id": 6052, + "name": "bytes1", + "nodeType": "ElementaryTypeName", + "src": "510:6:44", + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 6055, + "mutability": "mutable", + "name": "name", + "nameLocation": "551:4:44", + "nodeType": "VariableDeclaration", + "scope": 6068, + "src": "537:18:44", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 6054, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "537:6:44", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 6057, + "mutability": "mutable", + "name": "version", + "nameLocation": "583:7:44", + "nodeType": "VariableDeclaration", + "scope": 6068, + "src": "569:21:44", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 6056, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "569:6:44", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 6059, + "mutability": "mutable", + "name": "chainId", + "nameLocation": "612:7:44", + "nodeType": "VariableDeclaration", + "scope": 6068, + "src": "604:15:44", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 6058, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "604:7:44", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 6061, + "mutability": "mutable", + "name": "verifyingContract", + "nameLocation": "641:17:44", + "nodeType": "VariableDeclaration", + "scope": 6068, + "src": "633:25:44", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 6060, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "633:7:44", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 6063, + "mutability": "mutable", + "name": "salt", + "nameLocation": "680:4:44", + "nodeType": "VariableDeclaration", + "scope": 6068, + "src": "672:12:44", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 6062, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "672:7:44", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 6066, + "mutability": "mutable", + "name": "extensions", + "nameLocation": "715:10:44", + "nodeType": "VariableDeclaration", + "scope": 6068, + "src": "698:27:44", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[]" + }, + "typeName": { + "baseType": { + "id": 6064, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "698:7:44", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 6065, + "nodeType": "ArrayTypeName", + "src": "698:9:44", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", + "typeString": "uint256[]" + } + }, + "visibility": "internal" + } + ], + "src": "496:239:44" + }, + "scope": 6069, + "src": "426:310:44", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + } + ], + "scope": 6070, + "src": "133:605:44", + "usedErrors": [], + "usedEvents": [ + 6049 + ] + } + ], + "src": "107:632:44" + }, + "id": 44 + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "ast": { + "absolutePath": "@openzeppelin/contracts/token/ERC20/IERC20.sol", + "exportedSymbols": { + "IERC20": [ + 6147 + ] + }, + "id": 6148, + "license": "MIT", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 6071, + "literals": [ + "solidity", + "^", + "0.8", + ".20" + ], + "nodeType": "PragmaDirective", + "src": "106:24:45" + }, + { + "abstract": false, + "baseContracts": [], + "canonicalName": "IERC20", + "contractDependencies": [], + "contractKind": "interface", + "documentation": { + "id": 6072, + "nodeType": "StructuredDocumentation", + "src": "132:71:45", + "text": " @dev Interface of the ERC-20 standard as defined in the ERC." + }, + "fullyImplemented": false, + "id": 6147, + "linearizedBaseContracts": [ + 6147 + ], + "name": "IERC20", + "nameLocation": "214:6:45", + "nodeType": "ContractDefinition", + "nodes": [ + { + "anonymous": false, + "documentation": { + "id": 6073, + "nodeType": "StructuredDocumentation", + "src": "227:158:45", + "text": " @dev Emitted when `value` tokens are moved from one account (`from`) to\n another (`to`).\n Note that `value` may be zero." + }, + "eventSelector": "ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "id": 6081, + "name": "Transfer", + "nameLocation": "396:8:45", + "nodeType": "EventDefinition", + "parameters": { + "id": 6080, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 6075, + "indexed": true, + "mutability": "mutable", + "name": "from", + "nameLocation": "421:4:45", + "nodeType": "VariableDeclaration", + "scope": 6081, + "src": "405:20:45", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 6074, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "405:7:45", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 6077, + "indexed": true, + "mutability": "mutable", + "name": "to", + "nameLocation": "443:2:45", + "nodeType": "VariableDeclaration", + "scope": 6081, + "src": "427:18:45", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 6076, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "427:7:45", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 6079, + "indexed": false, + "mutability": "mutable", + "name": "value", + "nameLocation": "455:5:45", + "nodeType": "VariableDeclaration", + "scope": 6081, + "src": "447:13:45", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 6078, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "447:7:45", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "404:57:45" + }, + "src": "390:72:45" + }, + { + "anonymous": false, + "documentation": { + "id": 6082, + "nodeType": "StructuredDocumentation", + "src": "468:148:45", + "text": " @dev Emitted when the allowance of a `spender` for an `owner` is set by\n a call to {approve}. `value` is the new allowance." + }, + "eventSelector": "8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", + "id": 6090, + "name": "Approval", + "nameLocation": "627:8:45", + "nodeType": "EventDefinition", + "parameters": { + "id": 6089, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 6084, + "indexed": true, + "mutability": "mutable", + "name": "owner", + "nameLocation": "652:5:45", + "nodeType": "VariableDeclaration", + "scope": 6090, + "src": "636:21:45", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 6083, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "636:7:45", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 6086, + "indexed": true, + "mutability": "mutable", + "name": "spender", + "nameLocation": "675:7:45", + "nodeType": "VariableDeclaration", + "scope": 6090, + "src": "659:23:45", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 6085, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "659:7:45", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 6088, + "indexed": false, + "mutability": "mutable", + "name": "value", + "nameLocation": "692:5:45", + "nodeType": "VariableDeclaration", + "scope": 6090, + "src": "684:13:45", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 6087, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "684:7:45", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "635:63:45" + }, + "src": "621:78:45" + }, + { + "documentation": { + "id": 6091, + "nodeType": "StructuredDocumentation", + "src": "705:65:45", + "text": " @dev Returns the value of tokens in existence." + }, + "functionSelector": "18160ddd", + "id": 6096, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "totalSupply", + "nameLocation": "784:11:45", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 6092, + "nodeType": "ParameterList", + "parameters": [], + "src": "795:2:45" + }, + "returnParameters": { + "id": 6095, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 6094, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 6096, + "src": "821:7:45", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 6093, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "821:7:45", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "820:9:45" + }, + "scope": 6147, + "src": "775:55:45", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 6097, + "nodeType": "StructuredDocumentation", + "src": "836:71:45", + "text": " @dev Returns the value of tokens owned by `account`." + }, + "functionSelector": "70a08231", + "id": 6104, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "balanceOf", + "nameLocation": "921:9:45", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 6100, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 6099, + "mutability": "mutable", + "name": "account", + "nameLocation": "939:7:45", + "nodeType": "VariableDeclaration", + "scope": 6104, + "src": "931:15:45", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 6098, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "931:7:45", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "930:17:45" + }, + "returnParameters": { + "id": 6103, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 6102, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 6104, + "src": "971:7:45", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 6101, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "971:7:45", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "970:9:45" + }, + "scope": 6147, + "src": "912:68:45", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 6105, + "nodeType": "StructuredDocumentation", + "src": "986:213:45", + "text": " @dev Moves a `value` amount of tokens from the caller's account to `to`.\n Returns a boolean value indicating whether the operation succeeded.\n Emits a {Transfer} event." + }, + "functionSelector": "a9059cbb", + "id": 6114, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "transfer", + "nameLocation": "1213:8:45", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 6110, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 6107, + "mutability": "mutable", + "name": "to", + "nameLocation": "1230:2:45", + "nodeType": "VariableDeclaration", + "scope": 6114, + "src": "1222:10:45", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 6106, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1222:7:45", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 6109, + "mutability": "mutable", + "name": "value", + "nameLocation": "1242:5:45", + "nodeType": "VariableDeclaration", + "scope": 6114, + "src": "1234:13:45", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 6108, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1234:7:45", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "1221:27:45" + }, + "returnParameters": { + "id": 6113, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 6112, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 6114, + "src": "1267:4:45", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 6111, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "1267:4:45", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "src": "1266:6:45" + }, + "scope": 6147, + "src": "1204:69:45", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 6115, + "nodeType": "StructuredDocumentation", + "src": "1279:264:45", + "text": " @dev Returns the remaining number of tokens that `spender` will be\n allowed to spend on behalf of `owner` through {transferFrom}. This is\n zero by default.\n This value changes when {approve} or {transferFrom} are called." + }, + "functionSelector": "dd62ed3e", + "id": 6124, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "allowance", + "nameLocation": "1557:9:45", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 6120, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 6117, + "mutability": "mutable", + "name": "owner", + "nameLocation": "1575:5:45", + "nodeType": "VariableDeclaration", + "scope": 6124, + "src": "1567:13:45", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 6116, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1567:7:45", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 6119, + "mutability": "mutable", + "name": "spender", + "nameLocation": "1590:7:45", + "nodeType": "VariableDeclaration", + "scope": 6124, + "src": "1582:15:45", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 6118, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1582:7:45", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "1566:32:45" + }, + "returnParameters": { + "id": 6123, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 6122, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 6124, + "src": "1622:7:45", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 6121, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1622:7:45", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "1621:9:45" + }, + "scope": 6147, + "src": "1548:83:45", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 6125, + "nodeType": "StructuredDocumentation", + "src": "1637:667:45", + "text": " @dev Sets a `value` amount of tokens as the allowance of `spender` over the\n caller's tokens.\n Returns a boolean value indicating whether the operation succeeded.\n IMPORTANT: Beware that changing an allowance with this method brings the risk\n that someone may use both the old and the new allowance by unfortunate\n transaction ordering. One possible solution to mitigate this race\n condition is to first reduce the spender's allowance to 0 and set the\n desired value afterwards:\n https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n Emits an {Approval} event." + }, + "functionSelector": "095ea7b3", + "id": 6134, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "approve", + "nameLocation": "2318:7:45", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 6130, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 6127, + "mutability": "mutable", + "name": "spender", + "nameLocation": "2334:7:45", + "nodeType": "VariableDeclaration", + "scope": 6134, + "src": "2326:15:45", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 6126, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2326:7:45", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 6129, + "mutability": "mutable", + "name": "value", + "nameLocation": "2351:5:45", + "nodeType": "VariableDeclaration", + "scope": 6134, + "src": "2343:13:45", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 6128, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2343:7:45", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "2325:32:45" + }, + "returnParameters": { + "id": 6133, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 6132, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 6134, + "src": "2376:4:45", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 6131, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "2376:4:45", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "src": "2375:6:45" + }, + "scope": 6147, + "src": "2309:73:45", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 6135, + "nodeType": "StructuredDocumentation", + "src": "2388:297:45", + "text": " @dev Moves a `value` amount of tokens from `from` to `to` using the\n allowance mechanism. `value` is then deducted from the caller's\n allowance.\n Returns a boolean value indicating whether the operation succeeded.\n Emits a {Transfer} event." + }, + "functionSelector": "23b872dd", + "id": 6146, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "transferFrom", + "nameLocation": "2699:12:45", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 6142, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 6137, + "mutability": "mutable", + "name": "from", + "nameLocation": "2720:4:45", + "nodeType": "VariableDeclaration", + "scope": 6146, + "src": "2712:12:45", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 6136, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2712:7:45", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 6139, + "mutability": "mutable", + "name": "to", + "nameLocation": "2734:2:45", + "nodeType": "VariableDeclaration", + "scope": 6146, + "src": "2726:10:45", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 6138, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2726:7:45", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 6141, + "mutability": "mutable", + "name": "value", + "nameLocation": "2746:5:45", + "nodeType": "VariableDeclaration", + "scope": 6146, + "src": "2738:13:45", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 6140, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2738:7:45", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "2711:41:45" + }, + "returnParameters": { + "id": 6145, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 6144, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 6146, + "src": "2771:4:45", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 6143, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "2771:4:45", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "src": "2770:6:45" + }, + "scope": 6147, + "src": "2690:87:45", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + } + ], + "scope": 6148, + "src": "204:2575:45", + "usedErrors": [], + "usedEvents": [ + 6081, + 6090 + ] + } + ], + "src": "106:2674:45" + }, + "id": 45 + }, + "@openzeppelin/contracts/utils/Address.sol": { + "ast": { + "absolutePath": "@openzeppelin/contracts/utils/Address.sol", + "exportedSymbols": { + "Address": [ + 6407 + ], + "Errors": [ + 6429 + ] + }, + "id": 6408, + "license": "MIT", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 6149, + "literals": [ + "solidity", + "^", + "0.8", + ".20" + ], + "nodeType": "PragmaDirective", + "src": "101:24:46" + }, + { + "absolutePath": "@openzeppelin/contracts/utils/Errors.sol", + "file": "./Errors.sol", + "id": 6151, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 6408, + "sourceUnit": 6430, + "src": "127:36:46", + "symbolAliases": [ + { + "foreign": { + "id": 6150, + "name": "Errors", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6429, + "src": "135:6:46", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "abstract": false, + "baseContracts": [], + "canonicalName": "Address", + "contractDependencies": [], + "contractKind": "library", + "documentation": { + "id": 6152, + "nodeType": "StructuredDocumentation", + "src": "165:67:46", + "text": " @dev Collection of functions related to the address type" + }, + "fullyImplemented": true, + "id": 6407, + "linearizedBaseContracts": [ + 6407 + ], + "name": "Address", + "nameLocation": "241:7:46", + "nodeType": "ContractDefinition", + "nodes": [ + { + "documentation": { + "id": 6153, + "nodeType": "StructuredDocumentation", + "src": "255:75:46", + "text": " @dev There's no code at `target` (it is not a contract)." + }, + "errorSelector": "9996b315", + "id": 6157, + "name": "AddressEmptyCode", + "nameLocation": "341:16:46", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 6156, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 6155, + "mutability": "mutable", + "name": "target", + "nameLocation": "366:6:46", + "nodeType": "VariableDeclaration", + "scope": 6157, + "src": "358:14:46", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 6154, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "358:7:46", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "357:16:46" + }, + "src": "335:39:46" + }, + { + "body": { + "id": 6204, + "nodeType": "Block", + "src": "1361:294:46", + "statements": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 6171, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "arguments": [ + { + "id": 6167, + "name": "this", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -28, + "src": "1383:4:46", + "typeDescriptions": { + "typeIdentifier": "t_contract$_Address_$6407", + "typeString": "library Address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_Address_$6407", + "typeString": "library Address" + } + ], + "id": 6166, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "1375:7:46", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 6165, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1375:7:46", + "typeDescriptions": {} + } + }, + "id": 6168, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "1375:13:46", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 6169, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "1389:7:46", + "memberName": "balance", + "nodeType": "MemberAccess", + "src": "1375:21:46", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "id": 6170, + "name": "amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6162, + "src": "1399:6:46", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "1375:30:46", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 6184, + "nodeType": "IfStatement", + "src": "1371:125:46", + "trueBody": { + "id": 6183, + "nodeType": "Block", + "src": "1407:89:46", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "expression": { + "arguments": [ + { + "id": 6177, + "name": "this", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -28, + "src": "1463:4:46", + "typeDescriptions": { + "typeIdentifier": "t_contract$_Address_$6407", + "typeString": "library Address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_Address_$6407", + "typeString": "library Address" + } + ], + "id": 6176, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "1455:7:46", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 6175, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1455:7:46", + "typeDescriptions": {} + } + }, + "id": 6178, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "1455:13:46", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 6179, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "1469:7:46", + "memberName": "balance", + "nodeType": "MemberAccess", + "src": "1455:21:46", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 6180, + "name": "amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6162, + "src": "1478:6:46", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "id": 6172, + "name": "Errors", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6429, + "src": "1428:6:46", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_Errors_$6429_$", + "typeString": "type(library Errors)" + } + }, + "id": 6174, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "1435:19:46", + "memberName": "InsufficientBalance", + "nodeType": "MemberAccess", + "referencedDeclaration": 6417, + "src": "1428:26:46", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint256_$_t_uint256_$returns$_t_error_$", + "typeString": "function (uint256,uint256) pure returns (error)" + } + }, + "id": 6181, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "1428:57:46", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 6182, + "nodeType": "RevertStatement", + "src": "1421:64:46" + } + ] + } + }, + { + "assignments": [ + 6186, + 6188 + ], + "declarations": [ + { + "constant": false, + "id": 6186, + "mutability": "mutable", + "name": "success", + "nameLocation": "1512:7:46", + "nodeType": "VariableDeclaration", + "scope": 6204, + "src": "1507:12:46", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 6185, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "1507:4:46", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 6188, + "mutability": "mutable", + "name": "returndata", + "nameLocation": "1534:10:46", + "nodeType": "VariableDeclaration", + "scope": 6204, + "src": "1521:23:46", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 6187, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "1521:5:46", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "id": 6195, + "initialValue": { + "arguments": [ + { + "hexValue": "", + "id": 6193, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1578:2:46", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470", + "typeString": "literal_string \"\"" + }, + "value": "" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_stringliteral_c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470", + "typeString": "literal_string \"\"" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_stringliteral_c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470", + "typeString": "literal_string \"\"" + } + ], + "expression": { + "id": 6189, + "name": "recipient", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6160, + "src": "1548:9:46", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "id": 6190, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "1558:4:46", + "memberName": "call", + "nodeType": "MemberAccess", + "src": "1548:14:46", + "typeDescriptions": { + "typeIdentifier": "t_function_barecall_payable$_t_bytes_memory_ptr_$returns$_t_bool_$_t_bytes_memory_ptr_$", + "typeString": "function (bytes memory) payable returns (bool,bytes memory)" + } + }, + "id": 6192, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "names": [ + "value" + ], + "nodeType": "FunctionCallOptions", + "options": [ + { + "id": 6191, + "name": "amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6162, + "src": "1570:6:46", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "src": "1548:29:46", + "typeDescriptions": { + "typeIdentifier": "t_function_barecall_payable$_t_bytes_memory_ptr_$returns$_t_bool_$_t_bytes_memory_ptr_$value", + "typeString": "function (bytes memory) payable returns (bool,bytes memory)" + } + }, + "id": 6194, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "1548:33:46", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_bool_$_t_bytes_memory_ptr_$", + "typeString": "tuple(bool,bytes memory)" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "1506:75:46" + }, + { + "condition": { + "id": 6197, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "1595:8:46", + "subExpression": { + "id": 6196, + "name": "success", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6186, + "src": "1596:7:46", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 6203, + "nodeType": "IfStatement", + "src": "1591:58:46", + "trueBody": { + "id": 6202, + "nodeType": "Block", + "src": "1605:44:46", + "statements": [ + { + "expression": { + "arguments": [ + { + "id": 6199, + "name": "returndata", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6188, + "src": "1627:10:46", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 6198, + "name": "_revert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6406, + "src": "1619:7:46", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$returns$__$", + "typeString": "function (bytes memory) pure" + } + }, + "id": 6200, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "1619:19:46", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 6201, + "nodeType": "ExpressionStatement", + "src": "1619:19:46" + } + ] + } + } + ] + }, + "documentation": { + "id": 6158, + "nodeType": "StructuredDocumentation", + "src": "380:905:46", + "text": " @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n `recipient`, forwarding all available gas and reverting on errors.\n https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n of certain opcodes, possibly making contracts go over the 2300 gas limit\n imposed by `transfer`, making them unable to receive funds via\n `transfer`. {sendValue} removes this limitation.\n https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n IMPORTANT: because control is transferred to `recipient`, care must be\n taken to not create reentrancy vulnerabilities. Consider using\n {ReentrancyGuard} or the\n https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]." + }, + "id": 6205, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "sendValue", + "nameLocation": "1299:9:46", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 6163, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 6160, + "mutability": "mutable", + "name": "recipient", + "nameLocation": "1325:9:46", + "nodeType": "VariableDeclaration", + "scope": 6205, + "src": "1309:25:46", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + "typeName": { + "id": 6159, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1309:15:46", + "stateMutability": "payable", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 6162, + "mutability": "mutable", + "name": "amount", + "nameLocation": "1344:6:46", + "nodeType": "VariableDeclaration", + "scope": 6205, + "src": "1336:14:46", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 6161, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1336:7:46", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "1308:43:46" + }, + "returnParameters": { + "id": 6164, + "nodeType": "ParameterList", + "parameters": [], + "src": "1361:0:46" + }, + "scope": 6407, + "src": "1290:365:46", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 6221, + "nodeType": "Block", + "src": "2589:62:46", + "statements": [ + { + "expression": { + "arguments": [ + { + "id": 6216, + "name": "target", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6208, + "src": "2628:6:46", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 6217, + "name": "data", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6210, + "src": "2636:4:46", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + { + "hexValue": "30", + "id": 6218, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2642:1:46", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + }, + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 6215, + "name": "functionCallWithValue", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6272, + "src": "2606:21:46", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_bytes_memory_ptr_$_t_uint256_$returns$_t_bytes_memory_ptr_$", + "typeString": "function (address,bytes memory,uint256) returns (bytes memory)" + } + }, + "id": 6219, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2606:38:46", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "functionReturnParameters": 6214, + "id": 6220, + "nodeType": "Return", + "src": "2599:45:46" + } + ] + }, + "documentation": { + "id": 6206, + "nodeType": "StructuredDocumentation", + "src": "1661:834:46", + "text": " @dev Performs a Solidity function call using a low level `call`. A\n plain `call` is an unsafe replacement for a function call: use this\n function instead.\n If `target` reverts with a revert reason or custom error, it is bubbled\n up by this function (like regular Solidity function calls). However, if\n the call reverted with no returned reason, this function reverts with a\n {Errors.FailedCall} error.\n Returns the raw returned data. To convert to the expected return value,\n use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n Requirements:\n - `target` must be a contract.\n - calling `target` with `data` must not revert." + }, + "id": 6222, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "functionCall", + "nameLocation": "2509:12:46", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 6211, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 6208, + "mutability": "mutable", + "name": "target", + "nameLocation": "2530:6:46", + "nodeType": "VariableDeclaration", + "scope": 6222, + "src": "2522:14:46", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 6207, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2522:7:46", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 6210, + "mutability": "mutable", + "name": "data", + "nameLocation": "2551:4:46", + "nodeType": "VariableDeclaration", + "scope": 6222, + "src": "2538:17:46", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 6209, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "2538:5:46", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "src": "2521:35:46" + }, + "returnParameters": { + "id": 6214, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 6213, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 6222, + "src": "2575:12:46", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 6212, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "2575:5:46", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "src": "2574:14:46" + }, + "scope": 6407, + "src": "2500:151:46", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 6271, + "nodeType": "Block", + "src": "3088:294:46", + "statements": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 6240, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "arguments": [ + { + "id": 6236, + "name": "this", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -28, + "src": "3110:4:46", + "typeDescriptions": { + "typeIdentifier": "t_contract$_Address_$6407", + "typeString": "library Address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_Address_$6407", + "typeString": "library Address" + } + ], + "id": 6235, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "3102:7:46", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 6234, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3102:7:46", + "typeDescriptions": {} + } + }, + "id": 6237, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3102:13:46", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 6238, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "3116:7:46", + "memberName": "balance", + "nodeType": "MemberAccess", + "src": "3102:21:46", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "id": 6239, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6229, + "src": "3126:5:46", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "3102:29:46", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 6253, + "nodeType": "IfStatement", + "src": "3098:123:46", + "trueBody": { + "id": 6252, + "nodeType": "Block", + "src": "3133:88:46", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "expression": { + "arguments": [ + { + "id": 6246, + "name": "this", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -28, + "src": "3189:4:46", + "typeDescriptions": { + "typeIdentifier": "t_contract$_Address_$6407", + "typeString": "library Address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_Address_$6407", + "typeString": "library Address" + } + ], + "id": 6245, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "3181:7:46", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 6244, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3181:7:46", + "typeDescriptions": {} + } + }, + "id": 6247, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3181:13:46", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 6248, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "3195:7:46", + "memberName": "balance", + "nodeType": "MemberAccess", + "src": "3181:21:46", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 6249, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6229, + "src": "3204:5:46", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "id": 6241, + "name": "Errors", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6429, + "src": "3154:6:46", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_Errors_$6429_$", + "typeString": "type(library Errors)" + } + }, + "id": 6243, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "3161:19:46", + "memberName": "InsufficientBalance", + "nodeType": "MemberAccess", + "referencedDeclaration": 6417, + "src": "3154:26:46", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint256_$_t_uint256_$returns$_t_error_$", + "typeString": "function (uint256,uint256) pure returns (error)" + } + }, + "id": 6250, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3154:56:46", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 6251, + "nodeType": "RevertStatement", + "src": "3147:63:46" + } + ] + } + }, + { + "assignments": [ + 6255, + 6257 + ], + "declarations": [ + { + "constant": false, + "id": 6255, + "mutability": "mutable", + "name": "success", + "nameLocation": "3236:7:46", + "nodeType": "VariableDeclaration", + "scope": 6271, + "src": "3231:12:46", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 6254, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "3231:4:46", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 6257, + "mutability": "mutable", + "name": "returndata", + "nameLocation": "3258:10:46", + "nodeType": "VariableDeclaration", + "scope": 6271, + "src": "3245:23:46", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 6256, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "3245:5:46", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "id": 6264, + "initialValue": { + "arguments": [ + { + "id": 6262, + "name": "data", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6227, + "src": "3298:4:46", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "expression": { + "id": 6258, + "name": "target", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6225, + "src": "3272:6:46", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 6259, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "3279:4:46", + "memberName": "call", + "nodeType": "MemberAccess", + "src": "3272:11:46", + "typeDescriptions": { + "typeIdentifier": "t_function_barecall_payable$_t_bytes_memory_ptr_$returns$_t_bool_$_t_bytes_memory_ptr_$", + "typeString": "function (bytes memory) payable returns (bool,bytes memory)" + } + }, + "id": 6261, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "names": [ + "value" + ], + "nodeType": "FunctionCallOptions", + "options": [ + { + "id": 6260, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6229, + "src": "3291:5:46", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "src": "3272:25:46", + "typeDescriptions": { + "typeIdentifier": "t_function_barecall_payable$_t_bytes_memory_ptr_$returns$_t_bool_$_t_bytes_memory_ptr_$value", + "typeString": "function (bytes memory) payable returns (bool,bytes memory)" + } + }, + "id": 6263, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3272:31:46", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_bool_$_t_bytes_memory_ptr_$", + "typeString": "tuple(bool,bytes memory)" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "3230:73:46" + }, + { + "expression": { + "arguments": [ + { + "id": 6266, + "name": "target", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6225, + "src": "3347:6:46", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 6267, + "name": "success", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6255, + "src": "3355:7:46", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "id": 6268, + "name": "returndata", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6257, + "src": "3364:10:46", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 6265, + "name": "verifyCallResultFromTarget", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6364, + "src": "3320:26:46", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_address_$_t_bool_$_t_bytes_memory_ptr_$returns$_t_bytes_memory_ptr_$", + "typeString": "function (address,bool,bytes memory) view returns (bytes memory)" + } + }, + "id": 6269, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3320:55:46", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "functionReturnParameters": 6233, + "id": 6270, + "nodeType": "Return", + "src": "3313:62:46" + } + ] + }, + "documentation": { + "id": 6223, + "nodeType": "StructuredDocumentation", + "src": "2657:313:46", + "text": " @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n but also transferring `value` wei to `target`.\n Requirements:\n - the calling contract must have an ETH balance of at least `value`.\n - the called Solidity function must be `payable`." + }, + "id": 6272, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "functionCallWithValue", + "nameLocation": "2984:21:46", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 6230, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 6225, + "mutability": "mutable", + "name": "target", + "nameLocation": "3014:6:46", + "nodeType": "VariableDeclaration", + "scope": 6272, + "src": "3006:14:46", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 6224, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3006:7:46", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 6227, + "mutability": "mutable", + "name": "data", + "nameLocation": "3035:4:46", + "nodeType": "VariableDeclaration", + "scope": 6272, + "src": "3022:17:46", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 6226, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "3022:5:46", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 6229, + "mutability": "mutable", + "name": "value", + "nameLocation": "3049:5:46", + "nodeType": "VariableDeclaration", + "scope": 6272, + "src": "3041:13:46", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 6228, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "3041:7:46", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "3005:50:46" + }, + "returnParameters": { + "id": 6233, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 6232, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 6272, + "src": "3074:12:46", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 6231, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "3074:5:46", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "src": "3073:14:46" + }, + "scope": 6407, + "src": "2975:407:46", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 6297, + "nodeType": "Block", + "src": "3621:154:46", + "statements": [ + { + "assignments": [ + 6283, + 6285 + ], + "declarations": [ + { + "constant": false, + "id": 6283, + "mutability": "mutable", + "name": "success", + "nameLocation": "3637:7:46", + "nodeType": "VariableDeclaration", + "scope": 6297, + "src": "3632:12:46", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 6282, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "3632:4:46", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 6285, + "mutability": "mutable", + "name": "returndata", + "nameLocation": "3659:10:46", + "nodeType": "VariableDeclaration", + "scope": 6297, + "src": "3646:23:46", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 6284, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "3646:5:46", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "id": 6290, + "initialValue": { + "arguments": [ + { + "id": 6288, + "name": "data", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6277, + "src": "3691:4:46", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "expression": { + "id": 6286, + "name": "target", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6275, + "src": "3673:6:46", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 6287, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "3680:10:46", + "memberName": "staticcall", + "nodeType": "MemberAccess", + "src": "3673:17:46", + "typeDescriptions": { + "typeIdentifier": "t_function_barestaticcall_view$_t_bytes_memory_ptr_$returns$_t_bool_$_t_bytes_memory_ptr_$", + "typeString": "function (bytes memory) view returns (bool,bytes memory)" + } + }, + "id": 6289, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3673:23:46", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_bool_$_t_bytes_memory_ptr_$", + "typeString": "tuple(bool,bytes memory)" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "3631:65:46" + }, + { + "expression": { + "arguments": [ + { + "id": 6292, + "name": "target", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6275, + "src": "3740:6:46", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 6293, + "name": "success", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6283, + "src": "3748:7:46", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "id": 6294, + "name": "returndata", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6285, + "src": "3757:10:46", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 6291, + "name": "verifyCallResultFromTarget", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6364, + "src": "3713:26:46", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_address_$_t_bool_$_t_bytes_memory_ptr_$returns$_t_bytes_memory_ptr_$", + "typeString": "function (address,bool,bytes memory) view returns (bytes memory)" + } + }, + "id": 6295, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3713:55:46", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "functionReturnParameters": 6281, + "id": 6296, + "nodeType": "Return", + "src": "3706:62:46" + } + ] + }, + "documentation": { + "id": 6273, + "nodeType": "StructuredDocumentation", + "src": "3388:128:46", + "text": " @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n but performing a static call." + }, + "id": 6298, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "functionStaticCall", + "nameLocation": "3530:18:46", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 6278, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 6275, + "mutability": "mutable", + "name": "target", + "nameLocation": "3557:6:46", + "nodeType": "VariableDeclaration", + "scope": 6298, + "src": "3549:14:46", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 6274, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3549:7:46", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 6277, + "mutability": "mutable", + "name": "data", + "nameLocation": "3578:4:46", + "nodeType": "VariableDeclaration", + "scope": 6298, + "src": "3565:17:46", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 6276, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "3565:5:46", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "src": "3548:35:46" + }, + "returnParameters": { + "id": 6281, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 6280, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 6298, + "src": "3607:12:46", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 6279, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "3607:5:46", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "src": "3606:14:46" + }, + "scope": 6407, + "src": "3521:254:46", + "stateMutability": "view", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 6323, + "nodeType": "Block", + "src": "4013:156:46", + "statements": [ + { + "assignments": [ + 6309, + 6311 + ], + "declarations": [ + { + "constant": false, + "id": 6309, + "mutability": "mutable", + "name": "success", + "nameLocation": "4029:7:46", + "nodeType": "VariableDeclaration", + "scope": 6323, + "src": "4024:12:46", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 6308, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "4024:4:46", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 6311, + "mutability": "mutable", + "name": "returndata", + "nameLocation": "4051:10:46", + "nodeType": "VariableDeclaration", + "scope": 6323, + "src": "4038:23:46", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 6310, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "4038:5:46", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "id": 6316, + "initialValue": { + "arguments": [ + { + "id": 6314, + "name": "data", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6303, + "src": "4085:4:46", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "expression": { + "id": 6312, + "name": "target", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6301, + "src": "4065:6:46", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 6313, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "4072:12:46", + "memberName": "delegatecall", + "nodeType": "MemberAccess", + "src": "4065:19:46", + "typeDescriptions": { + "typeIdentifier": "t_function_baredelegatecall_nonpayable$_t_bytes_memory_ptr_$returns$_t_bool_$_t_bytes_memory_ptr_$", + "typeString": "function (bytes memory) returns (bool,bytes memory)" + } + }, + "id": 6315, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4065:25:46", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_bool_$_t_bytes_memory_ptr_$", + "typeString": "tuple(bool,bytes memory)" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "4023:67:46" + }, + { + "expression": { + "arguments": [ + { + "id": 6318, + "name": "target", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6301, + "src": "4134:6:46", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 6319, + "name": "success", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6309, + "src": "4142:7:46", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "id": 6320, + "name": "returndata", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6311, + "src": "4151:10:46", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 6317, + "name": "verifyCallResultFromTarget", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6364, + "src": "4107:26:46", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_address_$_t_bool_$_t_bytes_memory_ptr_$returns$_t_bytes_memory_ptr_$", + "typeString": "function (address,bool,bytes memory) view returns (bytes memory)" + } + }, + "id": 6321, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4107:55:46", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "functionReturnParameters": 6307, + "id": 6322, + "nodeType": "Return", + "src": "4100:62:46" + } + ] + }, + "documentation": { + "id": 6299, + "nodeType": "StructuredDocumentation", + "src": "3781:130:46", + "text": " @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n but performing a delegate call." + }, + "id": 6324, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "functionDelegateCall", + "nameLocation": "3925:20:46", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 6304, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 6301, + "mutability": "mutable", + "name": "target", + "nameLocation": "3954:6:46", + "nodeType": "VariableDeclaration", + "scope": 6324, + "src": "3946:14:46", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 6300, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3946:7:46", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 6303, + "mutability": "mutable", + "name": "data", + "nameLocation": "3975:4:46", + "nodeType": "VariableDeclaration", + "scope": 6324, + "src": "3962:17:46", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 6302, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "3962:5:46", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "src": "3945:35:46" + }, + "returnParameters": { + "id": 6307, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 6306, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 6324, + "src": "3999:12:46", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 6305, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "3999:5:46", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "src": "3998:14:46" + }, + "scope": 6407, + "src": "3916:253:46", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 6363, + "nodeType": "Block", + "src": "4595:424:46", + "statements": [ + { + "condition": { + "id": 6337, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "4609:8:46", + "subExpression": { + "id": 6336, + "name": "success", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6329, + "src": "4610:7:46", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "id": 6361, + "nodeType": "Block", + "src": "4669:344:46", + "statements": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 6352, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 6346, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 6343, + "name": "returndata", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6331, + "src": "4857:10:46", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 6344, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "4868:6:46", + "memberName": "length", + "nodeType": "MemberAccess", + "src": "4857:17:46", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "30", + "id": 6345, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4878:1:46", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "4857:22:46", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "&&", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 6351, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "expression": { + "id": 6347, + "name": "target", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6327, + "src": "4883:6:46", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 6348, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "4890:4:46", + "memberName": "code", + "nodeType": "MemberAccess", + "src": "4883:11:46", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 6349, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "4895:6:46", + "memberName": "length", + "nodeType": "MemberAccess", + "src": "4883:18:46", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "30", + "id": 6350, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4905:1:46", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "4883:23:46", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "4857:49:46", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 6358, + "nodeType": "IfStatement", + "src": "4853:119:46", + "trueBody": { + "id": 6357, + "nodeType": "Block", + "src": "4908:64:46", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "id": 6354, + "name": "target", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6327, + "src": "4950:6:46", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 6353, + "name": "AddressEmptyCode", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6157, + "src": "4933:16:46", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_address_$returns$_t_error_$", + "typeString": "function (address) pure returns (error)" + } + }, + "id": 6355, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4933:24:46", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 6356, + "nodeType": "RevertStatement", + "src": "4926:31:46" + } + ] + } + }, + { + "expression": { + "id": 6359, + "name": "returndata", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6331, + "src": "4992:10:46", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "functionReturnParameters": 6335, + "id": 6360, + "nodeType": "Return", + "src": "4985:17:46" + } + ] + }, + "id": 6362, + "nodeType": "IfStatement", + "src": "4605:408:46", + "trueBody": { + "id": 6342, + "nodeType": "Block", + "src": "4619:44:46", + "statements": [ + { + "expression": { + "arguments": [ + { + "id": 6339, + "name": "returndata", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6331, + "src": "4641:10:46", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 6338, + "name": "_revert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6406, + "src": "4633:7:46", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$returns$__$", + "typeString": "function (bytes memory) pure" + } + }, + "id": 6340, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4633:19:46", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 6341, + "nodeType": "ExpressionStatement", + "src": "4633:19:46" + } + ] + } + } + ] + }, + "documentation": { + "id": 6325, + "nodeType": "StructuredDocumentation", + "src": "4175:257:46", + "text": " @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target\n was not a contract or bubbling up the revert reason (falling back to {Errors.FailedCall}) in case\n of an unsuccessful call." + }, + "id": 6364, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "verifyCallResultFromTarget", + "nameLocation": "4446:26:46", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 6332, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 6327, + "mutability": "mutable", + "name": "target", + "nameLocation": "4490:6:46", + "nodeType": "VariableDeclaration", + "scope": 6364, + "src": "4482:14:46", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 6326, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4482:7:46", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 6329, + "mutability": "mutable", + "name": "success", + "nameLocation": "4511:7:46", + "nodeType": "VariableDeclaration", + "scope": 6364, + "src": "4506:12:46", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 6328, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "4506:4:46", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 6331, + "mutability": "mutable", + "name": "returndata", + "nameLocation": "4541:10:46", + "nodeType": "VariableDeclaration", + "scope": 6364, + "src": "4528:23:46", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 6330, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "4528:5:46", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "src": "4472:85:46" + }, + "returnParameters": { + "id": 6335, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 6334, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 6364, + "src": "4581:12:46", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 6333, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "4581:5:46", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "src": "4580:14:46" + }, + "scope": 6407, + "src": "4437:582:46", + "stateMutability": "view", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 6385, + "nodeType": "Block", + "src": "5323:122:46", + "statements": [ + { + "condition": { + "id": 6375, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "5337:8:46", + "subExpression": { + "id": 6374, + "name": "success", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6367, + "src": "5338:7:46", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "id": 6383, + "nodeType": "Block", + "src": "5397:42:46", + "statements": [ + { + "expression": { + "id": 6381, + "name": "returndata", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6369, + "src": "5418:10:46", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "functionReturnParameters": 6373, + "id": 6382, + "nodeType": "Return", + "src": "5411:17:46" + } + ] + }, + "id": 6384, + "nodeType": "IfStatement", + "src": "5333:106:46", + "trueBody": { + "id": 6380, + "nodeType": "Block", + "src": "5347:44:46", + "statements": [ + { + "expression": { + "arguments": [ + { + "id": 6377, + "name": "returndata", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6369, + "src": "5369:10:46", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 6376, + "name": "_revert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6406, + "src": "5361:7:46", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$returns$__$", + "typeString": "function (bytes memory) pure" + } + }, + "id": 6378, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5361:19:46", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 6379, + "nodeType": "ExpressionStatement", + "src": "5361:19:46" + } + ] + } + } + ] + }, + "documentation": { + "id": 6365, + "nodeType": "StructuredDocumentation", + "src": "5025:191:46", + "text": " @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the\n revert reason or with a default {Errors.FailedCall} error." + }, + "id": 6386, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "verifyCallResult", + "nameLocation": "5230:16:46", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 6370, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 6367, + "mutability": "mutable", + "name": "success", + "nameLocation": "5252:7:46", + "nodeType": "VariableDeclaration", + "scope": 6386, + "src": "5247:12:46", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 6366, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "5247:4:46", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 6369, + "mutability": "mutable", + "name": "returndata", + "nameLocation": "5274:10:46", + "nodeType": "VariableDeclaration", + "scope": 6386, + "src": "5261:23:46", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 6368, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "5261:5:46", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "src": "5246:39:46" + }, + "returnParameters": { + "id": 6373, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 6372, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 6386, + "src": "5309:12:46", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 6371, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "5309:5:46", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "src": "5308:14:46" + }, + "scope": 6407, + "src": "5221:224:46", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 6405, + "nodeType": "Block", + "src": "5614:432:46", + "statements": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 6395, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 6392, + "name": "returndata", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6389, + "src": "5690:10:46", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 6393, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "5701:6:46", + "memberName": "length", + "nodeType": "MemberAccess", + "src": "5690:17:46", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "hexValue": "30", + "id": 6394, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "5710:1:46", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "5690:21:46", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "id": 6403, + "nodeType": "Block", + "src": "5989:51:46", + "statements": [ + { + "errorCall": { + "arguments": [], + "expression": { + "argumentTypes": [], + "expression": { + "id": 6398, + "name": "Errors", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6429, + "src": "6010:6:46", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_Errors_$6429_$", + "typeString": "type(library Errors)" + } + }, + "id": 6400, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "6017:10:46", + "memberName": "FailedCall", + "nodeType": "MemberAccess", + "referencedDeclaration": 6420, + "src": "6010:17:46", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$__$returns$_t_error_$", + "typeString": "function () pure returns (error)" + } + }, + "id": 6401, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "6010:19:46", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 6402, + "nodeType": "RevertStatement", + "src": "6003:26:46" + } + ] + }, + "id": 6404, + "nodeType": "IfStatement", + "src": "5686:354:46", + "trueBody": { + "id": 6397, + "nodeType": "Block", + "src": "5713:270:46", + "statements": [ + { + "AST": { + "nativeSrc": "5840:133:46", + "nodeType": "YulBlock", + "src": "5840:133:46", + "statements": [ + { + "nativeSrc": "5858:40:46", + "nodeType": "YulVariableDeclaration", + "src": "5858:40:46", + "value": { + "arguments": [ + { + "name": "returndata", + "nativeSrc": "5887:10:46", + "nodeType": "YulIdentifier", + "src": "5887:10:46" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "5881:5:46", + "nodeType": "YulIdentifier", + "src": "5881:5:46" + }, + "nativeSrc": "5881:17:46", + "nodeType": "YulFunctionCall", + "src": "5881:17:46" + }, + "variables": [ + { + "name": "returndata_size", + "nativeSrc": "5862:15:46", + "nodeType": "YulTypedName", + "src": "5862:15:46", + "type": "" + } + ] + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "5926:2:46", + "nodeType": "YulLiteral", + "src": "5926:2:46", + "type": "", + "value": "32" + }, + { + "name": "returndata", + "nativeSrc": "5930:10:46", + "nodeType": "YulIdentifier", + "src": "5930:10:46" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "5922:3:46", + "nodeType": "YulIdentifier", + "src": "5922:3:46" + }, + "nativeSrc": "5922:19:46", + "nodeType": "YulFunctionCall", + "src": "5922:19:46" + }, + { + "name": "returndata_size", + "nativeSrc": "5943:15:46", + "nodeType": "YulIdentifier", + "src": "5943:15:46" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "5915:6:46", + "nodeType": "YulIdentifier", + "src": "5915:6:46" + }, + "nativeSrc": "5915:44:46", + "nodeType": "YulFunctionCall", + "src": "5915:44:46" + }, + "nativeSrc": "5915:44:46", + "nodeType": "YulExpressionStatement", + "src": "5915:44:46" + } + ] + }, + "evmVersion": "paris", + "externalReferences": [ + { + "declaration": 6389, + "isOffset": false, + "isSlot": false, + "src": "5887:10:46", + "valueSize": 1 + }, + { + "declaration": 6389, + "isOffset": false, + "isSlot": false, + "src": "5930:10:46", + "valueSize": 1 + } + ], + "flags": [ + "memory-safe" + ], + "id": 6396, + "nodeType": "InlineAssembly", + "src": "5815:158:46" + } + ] + } + } + ] + }, + "documentation": { + "id": 6387, + "nodeType": "StructuredDocumentation", + "src": "5451:103:46", + "text": " @dev Reverts with returndata if present. Otherwise reverts with {Errors.FailedCall}." + }, + "id": 6406, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_revert", + "nameLocation": "5568:7:46", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 6390, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 6389, + "mutability": "mutable", + "name": "returndata", + "nameLocation": "5589:10:46", + "nodeType": "VariableDeclaration", + "scope": 6406, + "src": "5576:23:46", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 6388, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "5576:5:46", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "src": "5575:25:46" + }, + "returnParameters": { + "id": 6391, + "nodeType": "ParameterList", + "parameters": [], + "src": "5614:0:46" + }, + "scope": 6407, + "src": "5559:487:46", + "stateMutability": "pure", + "virtual": false, + "visibility": "private" + } + ], + "scope": 6408, + "src": "233:5815:46", + "usedErrors": [ + 6157 + ], + "usedEvents": [] + } + ], + "src": "101:5948:46" + }, + "id": 46 + }, + "@openzeppelin/contracts/utils/Errors.sol": { + "ast": { + "absolutePath": "@openzeppelin/contracts/utils/Errors.sol", + "exportedSymbols": { + "Errors": [ + 6429 + ] + }, + "id": 6430, + "license": "MIT", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 6409, + "literals": [ + "solidity", + "^", + "0.8", + ".20" + ], + "nodeType": "PragmaDirective", + "src": "100:24:47" + }, + { + "abstract": false, + "baseContracts": [], + "canonicalName": "Errors", + "contractDependencies": [], + "contractKind": "library", + "documentation": { + "id": 6410, + "nodeType": "StructuredDocumentation", + "src": "126:284:47", + "text": " @dev Collection of common custom errors used in multiple contracts\n IMPORTANT: Backwards compatibility is not guaranteed in future versions of the library.\n It is recommended to avoid relying on the error API for critical functionality.\n _Available since v5.1._" + }, + "fullyImplemented": true, + "id": 6429, + "linearizedBaseContracts": [ + 6429 + ], + "name": "Errors", + "nameLocation": "419:6:47", + "nodeType": "ContractDefinition", + "nodes": [ + { + "documentation": { + "id": 6411, + "nodeType": "StructuredDocumentation", + "src": "432:94:47", + "text": " @dev The ETH balance of the account is not enough to perform the operation." + }, + "errorSelector": "cf479181", + "id": 6417, + "name": "InsufficientBalance", + "nameLocation": "537:19:47", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 6416, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 6413, + "mutability": "mutable", + "name": "balance", + "nameLocation": "565:7:47", + "nodeType": "VariableDeclaration", + "scope": 6417, + "src": "557:15:47", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 6412, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "557:7:47", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 6415, + "mutability": "mutable", + "name": "needed", + "nameLocation": "582:6:47", + "nodeType": "VariableDeclaration", + "scope": 6417, + "src": "574:14:47", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 6414, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "574:7:47", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "556:33:47" + }, + "src": "531:59:47" + }, + { + "documentation": { + "id": 6418, + "nodeType": "StructuredDocumentation", + "src": "596:89:47", + "text": " @dev A call to an address target failed. The target may have reverted." + }, + "errorSelector": "d6bda275", + "id": 6420, + "name": "FailedCall", + "nameLocation": "696:10:47", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 6419, + "nodeType": "ParameterList", + "parameters": [], + "src": "706:2:47" + }, + "src": "690:19:47" + }, + { + "documentation": { + "id": 6421, + "nodeType": "StructuredDocumentation", + "src": "715:46:47", + "text": " @dev The deployment failed." + }, + "errorSelector": "b06ebf3d", + "id": 6423, + "name": "FailedDeployment", + "nameLocation": "772:16:47", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 6422, + "nodeType": "ParameterList", + "parameters": [], + "src": "788:2:47" + }, + "src": "766:25:47" + }, + { + "documentation": { + "id": 6424, + "nodeType": "StructuredDocumentation", + "src": "797:58:47", + "text": " @dev A necessary precompile is missing." + }, + "errorSelector": "42b01bce", + "id": 6428, + "name": "MissingPrecompile", + "nameLocation": "866:17:47", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 6427, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 6426, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 6428, + "src": "884:7:47", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 6425, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "884:7:47", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "883:9:47" + }, + "src": "860:33:47" + } + ], + "scope": 6430, + "src": "411:484:47", + "usedErrors": [ + 6417, + 6420, + 6423, + 6428 + ], + "usedEvents": [] + } + ], + "src": "100:796:47" + }, + "id": 47 + }, + "@openzeppelin/contracts/utils/Panic.sol": { + "ast": { + "absolutePath": "@openzeppelin/contracts/utils/Panic.sol", + "exportedSymbols": { + "Panic": [ + 6481 + ] + }, + "id": 6482, + "license": "MIT", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 6431, + "literals": [ + "solidity", + "^", + "0.8", + ".20" + ], + "nodeType": "PragmaDirective", + "src": "99:24:48" + }, + { + "abstract": false, + "baseContracts": [], + "canonicalName": "Panic", + "contractDependencies": [], + "contractKind": "library", + "documentation": { + "id": 6432, + "nodeType": "StructuredDocumentation", + "src": "125:489:48", + "text": " @dev Helper library for emitting standardized panic codes.\n ```solidity\n contract Example {\n using Panic for uint256;\n // Use any of the declared internal constants\n function foo() { Panic.GENERIC.panic(); }\n // Alternatively\n function foo() { Panic.panic(Panic.GENERIC); }\n }\n ```\n Follows the list from https://github.com/ethereum/solidity/blob/v0.8.24/libsolutil/ErrorCodes.h[libsolutil].\n _Available since v5.1._" + }, + "fullyImplemented": true, + "id": 6481, + "linearizedBaseContracts": [ + 6481 + ], + "name": "Panic", + "nameLocation": "665:5:48", + "nodeType": "ContractDefinition", + "nodes": [ + { + "constant": true, + "documentation": { + "id": 6433, + "nodeType": "StructuredDocumentation", + "src": "677:36:48", + "text": "@dev generic / unspecified error" + }, + "id": 6436, + "mutability": "constant", + "name": "GENERIC", + "nameLocation": "744:7:48", + "nodeType": "VariableDeclaration", + "scope": 6481, + "src": "718:40:48", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 6434, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "718:7:48", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": { + "hexValue": "30783030", + "id": 6435, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "754:4:48", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0x00" + }, + "visibility": "internal" + }, + { + "constant": true, + "documentation": { + "id": 6437, + "nodeType": "StructuredDocumentation", + "src": "764:37:48", + "text": "@dev used by the assert() builtin" + }, + "id": 6440, + "mutability": "constant", + "name": "ASSERT", + "nameLocation": "832:6:48", + "nodeType": "VariableDeclaration", + "scope": 6481, + "src": "806:39:48", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 6438, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "806:7:48", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": { + "hexValue": "30783031", + "id": 6439, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "841:4:48", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "0x01" + }, + "visibility": "internal" + }, + { + "constant": true, + "documentation": { + "id": 6441, + "nodeType": "StructuredDocumentation", + "src": "851:41:48", + "text": "@dev arithmetic underflow or overflow" + }, + "id": 6444, + "mutability": "constant", + "name": "UNDER_OVERFLOW", + "nameLocation": "923:14:48", + "nodeType": "VariableDeclaration", + "scope": 6481, + "src": "897:47:48", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 6442, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "897:7:48", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": { + "hexValue": "30783131", + "id": 6443, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "940:4:48", + "typeDescriptions": { + "typeIdentifier": "t_rational_17_by_1", + "typeString": "int_const 17" + }, + "value": "0x11" + }, + "visibility": "internal" + }, + { + "constant": true, + "documentation": { + "id": 6445, + "nodeType": "StructuredDocumentation", + "src": "950:35:48", + "text": "@dev division or modulo by zero" + }, + "id": 6448, + "mutability": "constant", + "name": "DIVISION_BY_ZERO", + "nameLocation": "1016:16:48", + "nodeType": "VariableDeclaration", + "scope": 6481, + "src": "990:49:48", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 6446, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "990:7:48", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": { + "hexValue": "30783132", + "id": 6447, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1035:4:48", + "typeDescriptions": { + "typeIdentifier": "t_rational_18_by_1", + "typeString": "int_const 18" + }, + "value": "0x12" + }, + "visibility": "internal" + }, + { + "constant": true, + "documentation": { + "id": 6449, + "nodeType": "StructuredDocumentation", + "src": "1045:30:48", + "text": "@dev enum conversion error" + }, + "id": 6452, + "mutability": "constant", + "name": "ENUM_CONVERSION_ERROR", + "nameLocation": "1106:21:48", + "nodeType": "VariableDeclaration", + "scope": 6481, + "src": "1080:54:48", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 6450, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1080:7:48", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": { + "hexValue": "30783231", + "id": 6451, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1130:4:48", + "typeDescriptions": { + "typeIdentifier": "t_rational_33_by_1", + "typeString": "int_const 33" + }, + "value": "0x21" + }, + "visibility": "internal" + }, + { + "constant": true, + "documentation": { + "id": 6453, + "nodeType": "StructuredDocumentation", + "src": "1140:36:48", + "text": "@dev invalid encoding in storage" + }, + "id": 6456, + "mutability": "constant", + "name": "STORAGE_ENCODING_ERROR", + "nameLocation": "1207:22:48", + "nodeType": "VariableDeclaration", + "scope": 6481, + "src": "1181:55:48", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 6454, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1181:7:48", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": { + "hexValue": "30783232", + "id": 6455, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1232:4:48", + "typeDescriptions": { + "typeIdentifier": "t_rational_34_by_1", + "typeString": "int_const 34" + }, + "value": "0x22" + }, + "visibility": "internal" + }, + { + "constant": true, + "documentation": { + "id": 6457, + "nodeType": "StructuredDocumentation", + "src": "1242:24:48", + "text": "@dev empty array pop" + }, + "id": 6460, + "mutability": "constant", + "name": "EMPTY_ARRAY_POP", + "nameLocation": "1297:15:48", + "nodeType": "VariableDeclaration", + "scope": 6481, + "src": "1271:48:48", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 6458, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1271:7:48", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": { + "hexValue": "30783331", + "id": 6459, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1315:4:48", + "typeDescriptions": { + "typeIdentifier": "t_rational_49_by_1", + "typeString": "int_const 49" + }, + "value": "0x31" + }, + "visibility": "internal" + }, + { + "constant": true, + "documentation": { + "id": 6461, + "nodeType": "StructuredDocumentation", + "src": "1325:35:48", + "text": "@dev array out of bounds access" + }, + "id": 6464, + "mutability": "constant", + "name": "ARRAY_OUT_OF_BOUNDS", + "nameLocation": "1391:19:48", + "nodeType": "VariableDeclaration", + "scope": 6481, + "src": "1365:52:48", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 6462, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1365:7:48", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": { + "hexValue": "30783332", + "id": 6463, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1413:4:48", + "typeDescriptions": { + "typeIdentifier": "t_rational_50_by_1", + "typeString": "int_const 50" + }, + "value": "0x32" + }, + "visibility": "internal" + }, + { + "constant": true, + "documentation": { + "id": 6465, + "nodeType": "StructuredDocumentation", + "src": "1423:65:48", + "text": "@dev resource error (too large allocation or too large array)" + }, + "id": 6468, + "mutability": "constant", + "name": "RESOURCE_ERROR", + "nameLocation": "1519:14:48", + "nodeType": "VariableDeclaration", + "scope": 6481, + "src": "1493:47:48", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 6466, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1493:7:48", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": { + "hexValue": "30783431", + "id": 6467, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1536:4:48", + "typeDescriptions": { + "typeIdentifier": "t_rational_65_by_1", + "typeString": "int_const 65" + }, + "value": "0x41" + }, + "visibility": "internal" + }, + { + "constant": true, + "documentation": { + "id": 6469, + "nodeType": "StructuredDocumentation", + "src": "1546:42:48", + "text": "@dev calling invalid internal function" + }, + "id": 6472, + "mutability": "constant", + "name": "INVALID_INTERNAL_FUNCTION", + "nameLocation": "1619:25:48", + "nodeType": "VariableDeclaration", + "scope": 6481, + "src": "1593:58:48", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 6470, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1593:7:48", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": { + "hexValue": "30783531", + "id": 6471, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1647:4:48", + "typeDescriptions": { + "typeIdentifier": "t_rational_81_by_1", + "typeString": "int_const 81" + }, + "value": "0x51" + }, + "visibility": "internal" + }, + { + "body": { + "id": 6479, + "nodeType": "Block", + "src": "1819:151:48", + "statements": [ + { + "AST": { + "nativeSrc": "1854:110:48", + "nodeType": "YulBlock", + "src": "1854:110:48", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "1875:4:48", + "nodeType": "YulLiteral", + "src": "1875:4:48", + "type": "", + "value": "0x00" + }, + { + "kind": "number", + "nativeSrc": "1881:10:48", + "nodeType": "YulLiteral", + "src": "1881:10:48", + "type": "", + "value": "0x4e487b71" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "1868:6:48", + "nodeType": "YulIdentifier", + "src": "1868:6:48" + }, + "nativeSrc": "1868:24:48", + "nodeType": "YulFunctionCall", + "src": "1868:24:48" + }, + "nativeSrc": "1868:24:48", + "nodeType": "YulExpressionStatement", + "src": "1868:24:48" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "1912:4:48", + "nodeType": "YulLiteral", + "src": "1912:4:48", + "type": "", + "value": "0x20" + }, + { + "name": "code", + "nativeSrc": "1918:4:48", + "nodeType": "YulIdentifier", + "src": "1918:4:48" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "1905:6:48", + "nodeType": "YulIdentifier", + "src": "1905:6:48" + }, + "nativeSrc": "1905:18:48", + "nodeType": "YulFunctionCall", + "src": "1905:18:48" + }, + "nativeSrc": "1905:18:48", + "nodeType": "YulExpressionStatement", + "src": "1905:18:48" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "1943:4:48", + "nodeType": "YulLiteral", + "src": "1943:4:48", + "type": "", + "value": "0x1c" + }, + { + "kind": "number", + "nativeSrc": "1949:4:48", + "nodeType": "YulLiteral", + "src": "1949:4:48", + "type": "", + "value": "0x24" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "1936:6:48", + "nodeType": "YulIdentifier", + "src": "1936:6:48" + }, + "nativeSrc": "1936:18:48", + "nodeType": "YulFunctionCall", + "src": "1936:18:48" + }, + "nativeSrc": "1936:18:48", + "nodeType": "YulExpressionStatement", + "src": "1936:18:48" + } + ] + }, + "evmVersion": "paris", + "externalReferences": [ + { + "declaration": 6475, + "isOffset": false, + "isSlot": false, + "src": "1918:4:48", + "valueSize": 1 + } + ], + "flags": [ + "memory-safe" + ], + "id": 6478, + "nodeType": "InlineAssembly", + "src": "1829:135:48" + } + ] + }, + "documentation": { + "id": 6473, + "nodeType": "StructuredDocumentation", + "src": "1658:113:48", + "text": "@dev Reverts with a panic code. Recommended to use with\n the internal constants with predefined codes." + }, + "id": 6480, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "panic", + "nameLocation": "1785:5:48", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 6476, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 6475, + "mutability": "mutable", + "name": "code", + "nameLocation": "1799:4:48", + "nodeType": "VariableDeclaration", + "scope": 6480, + "src": "1791:12:48", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 6474, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1791:7:48", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "1790:14:48" + }, + "returnParameters": { + "id": 6477, + "nodeType": "ParameterList", + "parameters": [], + "src": "1819:0:48" + }, + "scope": 6481, + "src": "1776:194:48", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + } + ], + "scope": 6482, + "src": "657:1315:48", + "usedErrors": [], + "usedEvents": [] + } + ], + "src": "99:1874:48" + }, + "id": 48 + }, + "@openzeppelin/contracts/utils/Strings.sol": { + "ast": { + "absolutePath": "@openzeppelin/contracts/utils/Strings.sol", + "exportedSymbols": { + "Math": [ + 9938 + ], + "SafeCast": [ + 11703 + ], + "SignedMath": [ + 11847 + ], + "Strings": [ + 7883 + ] + }, + "id": 7884, + "license": "MIT", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 6483, + "literals": [ + "solidity", + "^", + "0.8", + ".20" + ], + "nodeType": "PragmaDirective", + "src": "101:24:49" + }, + { + "absolutePath": "@openzeppelin/contracts/utils/math/Math.sol", + "file": "./math/Math.sol", + "id": 6485, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 7884, + "sourceUnit": 9939, + "src": "127:37:49", + "symbolAliases": [ + { + "foreign": { + "id": 6484, + "name": "Math", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9938, + "src": "135:4:49", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "@openzeppelin/contracts/utils/math/SafeCast.sol", + "file": "./math/SafeCast.sol", + "id": 6487, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 7884, + "sourceUnit": 11704, + "src": "165:45:49", + "symbolAliases": [ + { + "foreign": { + "id": 6486, + "name": "SafeCast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11703, + "src": "173:8:49", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "@openzeppelin/contracts/utils/math/SignedMath.sol", + "file": "./math/SignedMath.sol", + "id": 6489, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 7884, + "sourceUnit": 11848, + "src": "211:49:49", + "symbolAliases": [ + { + "foreign": { + "id": 6488, + "name": "SignedMath", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11847, + "src": "219:10:49", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "abstract": false, + "baseContracts": [], + "canonicalName": "Strings", + "contractDependencies": [], + "contractKind": "library", + "documentation": { + "id": 6490, + "nodeType": "StructuredDocumentation", + "src": "262:34:49", + "text": " @dev String operations." + }, + "fullyImplemented": true, + "id": 7883, + "linearizedBaseContracts": [ + 7883 + ], + "name": "Strings", + "nameLocation": "305:7:49", + "nodeType": "ContractDefinition", + "nodes": [ + { + "global": false, + "id": 6492, + "libraryName": { + "id": 6491, + "name": "SafeCast", + "nameLocations": [ + "325:8:49" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 11703, + "src": "325:8:49" + }, + "nodeType": "UsingForDirective", + "src": "319:21:49" + }, + { + "constant": true, + "id": 6495, + "mutability": "constant", + "name": "HEX_DIGITS", + "nameLocation": "371:10:49", + "nodeType": "VariableDeclaration", + "scope": 7883, + "src": "346:56:49", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes16", + "typeString": "bytes16" + }, + "typeName": { + "id": 6493, + "name": "bytes16", + "nodeType": "ElementaryTypeName", + "src": "346:7:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes16", + "typeString": "bytes16" + } + }, + "value": { + "hexValue": "30313233343536373839616263646566", + "id": 6494, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "384:18:49", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_cb29997ed99ead0db59ce4d12b7d3723198c827273e5796737c926d78019c39f", + "typeString": "literal_string \"0123456789abcdef\"" + }, + "value": "0123456789abcdef" + }, + "visibility": "private" + }, + { + "constant": true, + "id": 6498, + "mutability": "constant", + "name": "ADDRESS_LENGTH", + "nameLocation": "431:14:49", + "nodeType": "VariableDeclaration", + "scope": 7883, + "src": "408:42:49", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "typeName": { + "id": 6496, + "name": "uint8", + "nodeType": "ElementaryTypeName", + "src": "408:5:49", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "value": { + "hexValue": "3230", + "id": 6497, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "448:2:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_20_by_1", + "typeString": "int_const 20" + }, + "value": "20" + }, + "visibility": "private" + }, + { + "constant": true, + "id": 6534, + "mutability": "constant", + "name": "SPECIAL_CHARS_LOOKUP", + "nameLocation": "481:20:49", + "nodeType": "VariableDeclaration", + "scope": 7883, + "src": "456:302:49", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 6499, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "456:7:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": { + "commonType": { + "typeIdentifier": "t_rational_4951760157141521116776380160_by_1", + "typeString": "int_const 4951760157141521116776380160" + }, + "id": 6533, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "leftExpression": { + "commonType": { + "typeIdentifier": "t_rational_17179883264_by_1", + "typeString": "int_const 17179883264" + }, + "id": 6528, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "leftExpression": { + "commonType": { + "typeIdentifier": "t_rational_14080_by_1", + "typeString": "int_const 14080" + }, + "id": 6523, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "leftExpression": { + "commonType": { + "typeIdentifier": "t_rational_5888_by_1", + "typeString": "int_const 5888" + }, + "id": 6518, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "leftExpression": { + "commonType": { + "typeIdentifier": "t_rational_1792_by_1", + "typeString": "int_const 1792" + }, + "id": 6513, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "leftExpression": { + "commonType": { + "typeIdentifier": "t_rational_768_by_1", + "typeString": "int_const 768" + }, + "id": 6508, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "leftExpression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_rational_256_by_1", + "typeString": "int_const 256" + }, + "id": 6502, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "leftExpression": { + "hexValue": "31", + "id": 6500, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "513:1:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "nodeType": "BinaryOperation", + "operator": "<<", + "rightExpression": { + "hexValue": "30783038", + "id": 6501, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "518:4:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_8_by_1", + "typeString": "int_const 8" + }, + "value": "0x08" + }, + "src": "513:9:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_256_by_1", + "typeString": "int_const 256" + } + } + ], + "id": 6503, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "512:11:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_256_by_1", + "typeString": "int_const 256" + } + }, + "nodeType": "BinaryOperation", + "operator": "|", + "rightExpression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_rational_512_by_1", + "typeString": "int_const 512" + }, + "id": 6506, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "leftExpression": { + "hexValue": "31", + "id": 6504, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "552:1:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "nodeType": "BinaryOperation", + "operator": "<<", + "rightExpression": { + "hexValue": "30783039", + "id": 6505, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "557:4:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_9_by_1", + "typeString": "int_const 9" + }, + "value": "0x09" + }, + "src": "552:9:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_512_by_1", + "typeString": "int_const 512" + } + } + ], + "id": 6507, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "551:11:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_512_by_1", + "typeString": "int_const 512" + } + }, + "src": "512:50:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_768_by_1", + "typeString": "int_const 768" + } + }, + "nodeType": "BinaryOperation", + "operator": "|", + "rightExpression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_rational_1024_by_1", + "typeString": "int_const 1024" + }, + "id": 6511, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "leftExpression": { + "hexValue": "31", + "id": 6509, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "585:1:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "nodeType": "BinaryOperation", + "operator": "<<", + "rightExpression": { + "hexValue": "30783061", + "id": 6510, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "590:4:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_10_by_1", + "typeString": "int_const 10" + }, + "value": "0x0a" + }, + "src": "585:9:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_1024_by_1", + "typeString": "int_const 1024" + } + } + ], + "id": 6512, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "584:11:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_1024_by_1", + "typeString": "int_const 1024" + } + }, + "src": "512:83:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_1792_by_1", + "typeString": "int_const 1792" + } + }, + "nodeType": "BinaryOperation", + "operator": "|", + "rightExpression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_rational_4096_by_1", + "typeString": "int_const 4096" + }, + "id": 6516, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "leftExpression": { + "hexValue": "31", + "id": 6514, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "622:1:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "nodeType": "BinaryOperation", + "operator": "<<", + "rightExpression": { + "hexValue": "30783063", + "id": 6515, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "627:4:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_12_by_1", + "typeString": "int_const 12" + }, + "value": "0x0c" + }, + "src": "622:9:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_4096_by_1", + "typeString": "int_const 4096" + } + } + ], + "id": 6517, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "621:11:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_4096_by_1", + "typeString": "int_const 4096" + } + }, + "src": "512:120:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_5888_by_1", + "typeString": "int_const 5888" + } + }, + "nodeType": "BinaryOperation", + "operator": "|", + "rightExpression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_rational_8192_by_1", + "typeString": "int_const 8192" + }, + "id": 6521, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "leftExpression": { + "hexValue": "31", + "id": 6519, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "661:1:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "nodeType": "BinaryOperation", + "operator": "<<", + "rightExpression": { + "hexValue": "30783064", + "id": 6520, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "666:4:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_13_by_1", + "typeString": "int_const 13" + }, + "value": "0x0d" + }, + "src": "661:9:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_8192_by_1", + "typeString": "int_const 8192" + } + } + ], + "id": 6522, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "660:11:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_8192_by_1", + "typeString": "int_const 8192" + } + }, + "src": "512:159:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_14080_by_1", + "typeString": "int_const 14080" + } + }, + "nodeType": "BinaryOperation", + "operator": "|", + "rightExpression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_rational_17179869184_by_1", + "typeString": "int_const 17179869184" + }, + "id": 6526, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "leftExpression": { + "hexValue": "31", + "id": 6524, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "706:1:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "nodeType": "BinaryOperation", + "operator": "<<", + "rightExpression": { + "hexValue": "30783232", + "id": 6525, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "711:4:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_34_by_1", + "typeString": "int_const 34" + }, + "value": "0x22" + }, + "src": "706:9:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_17179869184_by_1", + "typeString": "int_const 17179869184" + } + } + ], + "id": 6527, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "705:11:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_17179869184_by_1", + "typeString": "int_const 17179869184" + } + }, + "src": "512:204:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_17179883264_by_1", + "typeString": "int_const 17179883264" + } + }, + "nodeType": "BinaryOperation", + "operator": "|", + "rightExpression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_rational_4951760157141521099596496896_by_1", + "typeString": "int_const 4951760157141521099596496896" + }, + "id": 6531, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "leftExpression": { + "hexValue": "31", + "id": 6529, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "748:1:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "nodeType": "BinaryOperation", + "operator": "<<", + "rightExpression": { + "hexValue": "30783563", + "id": 6530, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "753:4:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_92_by_1", + "typeString": "int_const 92" + }, + "value": "0x5c" + }, + "src": "748:9:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_4951760157141521099596496896_by_1", + "typeString": "int_const 4951760157141521099596496896" + } + } + ], + "id": 6532, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "747:11:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_4951760157141521099596496896_by_1", + "typeString": "int_const 4951760157141521099596496896" + } + }, + "src": "512:246:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_4951760157141521116776380160_by_1", + "typeString": "int_const 4951760157141521116776380160" + } + }, + "visibility": "private" + }, + { + "documentation": { + "id": 6535, + "nodeType": "StructuredDocumentation", + "src": "778:81:49", + "text": " @dev The `value` string doesn't fit in the specified `length`." + }, + "errorSelector": "e22e27eb", + "id": 6541, + "name": "StringsInsufficientHexLength", + "nameLocation": "870:28:49", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 6540, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 6537, + "mutability": "mutable", + "name": "value", + "nameLocation": "907:5:49", + "nodeType": "VariableDeclaration", + "scope": 6541, + "src": "899:13:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 6536, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "899:7:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 6539, + "mutability": "mutable", + "name": "length", + "nameLocation": "922:6:49", + "nodeType": "VariableDeclaration", + "scope": 6541, + "src": "914:14:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 6538, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "914:7:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "898:31:49" + }, + "src": "864:66:49" + }, + { + "documentation": { + "id": 6542, + "nodeType": "StructuredDocumentation", + "src": "936:108:49", + "text": " @dev The string being parsed contains characters that are not in scope of the given base." + }, + "errorSelector": "94e2737e", + "id": 6544, + "name": "StringsInvalidChar", + "nameLocation": "1055:18:49", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 6543, + "nodeType": "ParameterList", + "parameters": [], + "src": "1073:2:49" + }, + "src": "1049:27:49" + }, + { + "documentation": { + "id": 6545, + "nodeType": "StructuredDocumentation", + "src": "1082:84:49", + "text": " @dev The string being parsed is not a properly formatted address." + }, + "errorSelector": "1d15ae44", + "id": 6547, + "name": "StringsInvalidAddressFormat", + "nameLocation": "1177:27:49", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 6546, + "nodeType": "ParameterList", + "parameters": [], + "src": "1204:2:49" + }, + "src": "1171:36:49" + }, + { + "body": { + "id": 6594, + "nodeType": "Block", + "src": "1379:561:49", + "statements": [ + { + "id": 6593, + "nodeType": "UncheckedBlock", + "src": "1389:545:49", + "statements": [ + { + "assignments": [ + 6556 + ], + "declarations": [ + { + "constant": false, + "id": 6556, + "mutability": "mutable", + "name": "length", + "nameLocation": "1421:6:49", + "nodeType": "VariableDeclaration", + "scope": 6593, + "src": "1413:14:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 6555, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1413:7:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 6563, + "initialValue": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 6562, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "arguments": [ + { + "id": 6559, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6550, + "src": "1441:5:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "id": 6557, + "name": "Math", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9938, + "src": "1430:4:49", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_Math_$9938_$", + "typeString": "type(library Math)" + } + }, + "id": 6558, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "1435:5:49", + "memberName": "log10", + "nodeType": "MemberAccess", + "referencedDeclaration": 9770, + "src": "1430:10:49", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256) pure returns (uint256)" + } + }, + "id": 6560, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "1430:17:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "hexValue": "31", + "id": 6561, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1450:1:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "1430:21:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "1413:38:49" + }, + { + "assignments": [ + 6565 + ], + "declarations": [ + { + "constant": false, + "id": 6565, + "mutability": "mutable", + "name": "buffer", + "nameLocation": "1479:6:49", + "nodeType": "VariableDeclaration", + "scope": 6593, + "src": "1465:20:49", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 6564, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "1465:6:49", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "visibility": "internal" + } + ], + "id": 6570, + "initialValue": { + "arguments": [ + { + "id": 6568, + "name": "length", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6556, + "src": "1499:6:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 6567, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "NewExpression", + "src": "1488:10:49", + "typeDescriptions": { + "typeIdentifier": "t_function_objectcreation_pure$_t_uint256_$returns$_t_string_memory_ptr_$", + "typeString": "function (uint256) pure returns (string memory)" + }, + "typeName": { + "id": 6566, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "1492:6:49", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + } + }, + "id": 6569, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "1488:18:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "1465:41:49" + }, + { + "assignments": [ + 6572 + ], + "declarations": [ + { + "constant": false, + "id": 6572, + "mutability": "mutable", + "name": "ptr", + "nameLocation": "1528:3:49", + "nodeType": "VariableDeclaration", + "scope": 6593, + "src": "1520:11:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 6571, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1520:7:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 6573, + "nodeType": "VariableDeclarationStatement", + "src": "1520:11:49" + }, + { + "AST": { + "nativeSrc": "1570:67:49", + "nodeType": "YulBlock", + "src": "1570:67:49", + "statements": [ + { + "nativeSrc": "1588:35:49", + "nodeType": "YulAssignment", + "src": "1588:35:49", + "value": { + "arguments": [ + { + "name": "buffer", + "nativeSrc": "1599:6:49", + "nodeType": "YulIdentifier", + "src": "1599:6:49" + }, + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "1611:2:49", + "nodeType": "YulLiteral", + "src": "1611:2:49", + "type": "", + "value": "32" + }, + { + "name": "length", + "nativeSrc": "1615:6:49", + "nodeType": "YulIdentifier", + "src": "1615:6:49" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "1607:3:49", + "nodeType": "YulIdentifier", + "src": "1607:3:49" + }, + "nativeSrc": "1607:15:49", + "nodeType": "YulFunctionCall", + "src": "1607:15:49" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "1595:3:49", + "nodeType": "YulIdentifier", + "src": "1595:3:49" + }, + "nativeSrc": "1595:28:49", + "nodeType": "YulFunctionCall", + "src": "1595:28:49" + }, + "variableNames": [ + { + "name": "ptr", + "nativeSrc": "1588:3:49", + "nodeType": "YulIdentifier", + "src": "1588:3:49" + } + ] + } + ] + }, + "evmVersion": "paris", + "externalReferences": [ + { + "declaration": 6565, + "isOffset": false, + "isSlot": false, + "src": "1599:6:49", + "valueSize": 1 + }, + { + "declaration": 6556, + "isOffset": false, + "isSlot": false, + "src": "1615:6:49", + "valueSize": 1 + }, + { + "declaration": 6572, + "isOffset": false, + "isSlot": false, + "src": "1588:3:49", + "valueSize": 1 + } + ], + "flags": [ + "memory-safe" + ], + "id": 6574, + "nodeType": "InlineAssembly", + "src": "1545:92:49" + }, + { + "body": { + "id": 6589, + "nodeType": "Block", + "src": "1663:234:49", + "statements": [ + { + "expression": { + "id": 6577, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "--", + "prefix": false, + "src": "1681:5:49", + "subExpression": { + "id": 6576, + "name": "ptr", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6572, + "src": "1681:3:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 6578, + "nodeType": "ExpressionStatement", + "src": "1681:5:49" + }, + { + "AST": { + "nativeSrc": "1729:86:49", + "nodeType": "YulBlock", + "src": "1729:86:49", + "statements": [ + { + "expression": { + "arguments": [ + { + "name": "ptr", + "nativeSrc": "1759:3:49", + "nodeType": "YulIdentifier", + "src": "1759:3:49" + }, + { + "arguments": [ + { + "arguments": [ + { + "name": "value", + "nativeSrc": "1773:5:49", + "nodeType": "YulIdentifier", + "src": "1773:5:49" + }, + { + "kind": "number", + "nativeSrc": "1780:2:49", + "nodeType": "YulLiteral", + "src": "1780:2:49", + "type": "", + "value": "10" + } + ], + "functionName": { + "name": "mod", + "nativeSrc": "1769:3:49", + "nodeType": "YulIdentifier", + "src": "1769:3:49" + }, + "nativeSrc": "1769:14:49", + "nodeType": "YulFunctionCall", + "src": "1769:14:49" + }, + { + "name": "HEX_DIGITS", + "nativeSrc": "1785:10:49", + "nodeType": "YulIdentifier", + "src": "1785:10:49" + } + ], + "functionName": { + "name": "byte", + "nativeSrc": "1764:4:49", + "nodeType": "YulIdentifier", + "src": "1764:4:49" + }, + "nativeSrc": "1764:32:49", + "nodeType": "YulFunctionCall", + "src": "1764:32:49" + } + ], + "functionName": { + "name": "mstore8", + "nativeSrc": "1751:7:49", + "nodeType": "YulIdentifier", + "src": "1751:7:49" + }, + "nativeSrc": "1751:46:49", + "nodeType": "YulFunctionCall", + "src": "1751:46:49" + }, + "nativeSrc": "1751:46:49", + "nodeType": "YulExpressionStatement", + "src": "1751:46:49" + } + ] + }, + "evmVersion": "paris", + "externalReferences": [ + { + "declaration": 6495, + "isOffset": false, + "isSlot": false, + "src": "1785:10:49", + "valueSize": 1 + }, + { + "declaration": 6572, + "isOffset": false, + "isSlot": false, + "src": "1759:3:49", + "valueSize": 1 + }, + { + "declaration": 6550, + "isOffset": false, + "isSlot": false, + "src": "1773:5:49", + "valueSize": 1 + } + ], + "flags": [ + "memory-safe" + ], + "id": 6579, + "nodeType": "InlineAssembly", + "src": "1704:111:49" + }, + { + "expression": { + "id": 6582, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 6580, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6550, + "src": "1832:5:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "/=", + "rightHandSide": { + "hexValue": "3130", + "id": 6581, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1841:2:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_10_by_1", + "typeString": "int_const 10" + }, + "value": "10" + }, + "src": "1832:11:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 6583, + "nodeType": "ExpressionStatement", + "src": "1832:11:49" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 6586, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 6584, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6550, + "src": "1865:5:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "30", + "id": 6585, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1874:1:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "1865:10:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 6588, + "nodeType": "IfStatement", + "src": "1861:21:49", + "trueBody": { + "id": 6587, + "nodeType": "Break", + "src": "1877:5:49" + } + } + ] + }, + "condition": { + "hexValue": "74727565", + "id": 6575, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1657:4:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "true" + }, + "id": 6590, + "nodeType": "WhileStatement", + "src": "1650:247:49" + }, + { + "expression": { + "id": 6591, + "name": "buffer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6565, + "src": "1917:6:49", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + }, + "functionReturnParameters": 6554, + "id": 6592, + "nodeType": "Return", + "src": "1910:13:49" + } + ] + } + ] + }, + "documentation": { + "id": 6548, + "nodeType": "StructuredDocumentation", + "src": "1213:90:49", + "text": " @dev Converts a `uint256` to its ASCII `string` decimal representation." + }, + "id": 6595, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toString", + "nameLocation": "1317:8:49", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 6551, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 6550, + "mutability": "mutable", + "name": "value", + "nameLocation": "1334:5:49", + "nodeType": "VariableDeclaration", + "scope": 6595, + "src": "1326:13:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 6549, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1326:7:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "1325:15:49" + }, + "returnParameters": { + "id": 6554, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 6553, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 6595, + "src": "1364:13:49", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 6552, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "1364:6:49", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "visibility": "internal" + } + ], + "src": "1363:15:49" + }, + "scope": 7883, + "src": "1308:632:49", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 6620, + "nodeType": "Block", + "src": "2116:92:49", + "statements": [ + { + "expression": { + "arguments": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 6608, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 6606, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6598, + "src": "2147:5:49", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "hexValue": "30", + "id": 6607, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2155:1:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "2147:9:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseExpression": { + "hexValue": "", + "id": 6610, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2165:2:49", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470", + "typeString": "literal_string \"\"" + }, + "value": "" + }, + "id": 6611, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "Conditional", + "src": "2147:20:49", + "trueExpression": { + "hexValue": "2d", + "id": 6609, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2159:3:49", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_d3b8281179950f98149eefdb158d0e1acb56f56e8e343aa9fefafa7e36959561", + "typeString": "literal_string \"-\"" + }, + "value": "-" + }, + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + }, + { + "arguments": [ + { + "arguments": [ + { + "id": 6615, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6598, + "src": "2193:5:49", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + ], + "expression": { + "id": 6613, + "name": "SignedMath", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11847, + "src": "2178:10:49", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_SignedMath_$11847_$", + "typeString": "type(library SignedMath)" + } + }, + "id": 6614, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "2189:3:49", + "memberName": "abs", + "nodeType": "MemberAccess", + "referencedDeclaration": 11846, + "src": "2178:14:49", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_int256_$returns$_t_uint256_$", + "typeString": "function (int256) pure returns (uint256)" + } + }, + "id": 6616, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2178:21:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 6612, + "name": "toString", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6595, + "src": "2169:8:49", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$returns$_t_string_memory_ptr_$", + "typeString": "function (uint256) pure returns (string memory)" + } + }, + "id": 6617, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2169:31:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + }, + { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + ], + "expression": { + "id": 6604, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "2133:6:49", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_string_storage_ptr_$", + "typeString": "type(string storage pointer)" + }, + "typeName": { + "id": 6603, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "2133:6:49", + "typeDescriptions": {} + } + }, + "id": 6605, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "2140:6:49", + "memberName": "concat", + "nodeType": "MemberAccess", + "src": "2133:13:49", + "typeDescriptions": { + "typeIdentifier": "t_function_stringconcat_pure$__$returns$_t_string_memory_ptr_$", + "typeString": "function () pure returns (string memory)" + } + }, + "id": 6618, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2133:68:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + }, + "functionReturnParameters": 6602, + "id": 6619, + "nodeType": "Return", + "src": "2126:75:49" + } + ] + }, + "documentation": { + "id": 6596, + "nodeType": "StructuredDocumentation", + "src": "1946:89:49", + "text": " @dev Converts a `int256` to its ASCII `string` decimal representation." + }, + "id": 6621, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toStringSigned", + "nameLocation": "2049:14:49", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 6599, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 6598, + "mutability": "mutable", + "name": "value", + "nameLocation": "2071:5:49", + "nodeType": "VariableDeclaration", + "scope": 6621, + "src": "2064:12:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "typeName": { + "id": 6597, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "2064:6:49", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "visibility": "internal" + } + ], + "src": "2063:14:49" + }, + "returnParameters": { + "id": 6602, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 6601, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 6621, + "src": "2101:13:49", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 6600, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "2101:6:49", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "visibility": "internal" + } + ], + "src": "2100:15:49" + }, + "scope": 7883, + "src": "2040:168:49", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 6640, + "nodeType": "Block", + "src": "2387:100:49", + "statements": [ + { + "id": 6639, + "nodeType": "UncheckedBlock", + "src": "2397:84:49", + "statements": [ + { + "expression": { + "arguments": [ + { + "id": 6630, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6624, + "src": "2440:5:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 6636, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "arguments": [ + { + "id": 6633, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6624, + "src": "2459:5:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "id": 6631, + "name": "Math", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9938, + "src": "2447:4:49", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_Math_$9938_$", + "typeString": "type(library Math)" + } + }, + "id": 6632, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "2452:6:49", + "memberName": "log256", + "nodeType": "MemberAccess", + "referencedDeclaration": 9881, + "src": "2447:11:49", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256) pure returns (uint256)" + } + }, + "id": 6634, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2447:18:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "hexValue": "31", + "id": 6635, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2468:1:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "2447:22:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 6629, + "name": "toHexString", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 6641, + 6724, + 6744 + ], + "referencedDeclaration": 6724, + "src": "2428:11:49", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_string_memory_ptr_$", + "typeString": "function (uint256,uint256) pure returns (string memory)" + } + }, + "id": 6637, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2428:42:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + }, + "functionReturnParameters": 6628, + "id": 6638, + "nodeType": "Return", + "src": "2421:49:49" + } + ] + } + ] + }, + "documentation": { + "id": 6622, + "nodeType": "StructuredDocumentation", + "src": "2214:94:49", + "text": " @dev Converts a `uint256` to its ASCII `string` hexadecimal representation." + }, + "id": 6641, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toHexString", + "nameLocation": "2322:11:49", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 6625, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 6624, + "mutability": "mutable", + "name": "value", + "nameLocation": "2342:5:49", + "nodeType": "VariableDeclaration", + "scope": 6641, + "src": "2334:13:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 6623, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2334:7:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "2333:15:49" + }, + "returnParameters": { + "id": 6628, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 6627, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 6641, + "src": "2372:13:49", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 6626, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "2372:6:49", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "visibility": "internal" + } + ], + "src": "2371:15:49" + }, + "scope": 7883, + "src": "2313:174:49", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 6723, + "nodeType": "Block", + "src": "2700:435:49", + "statements": [ + { + "assignments": [ + 6652 + ], + "declarations": [ + { + "constant": false, + "id": 6652, + "mutability": "mutable", + "name": "localValue", + "nameLocation": "2718:10:49", + "nodeType": "VariableDeclaration", + "scope": 6723, + "src": "2710:18:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 6651, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2710:7:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 6654, + "initialValue": { + "id": 6653, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6644, + "src": "2731:5:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "2710:26:49" + }, + { + "assignments": [ + 6656 + ], + "declarations": [ + { + "constant": false, + "id": 6656, + "mutability": "mutable", + "name": "buffer", + "nameLocation": "2759:6:49", + "nodeType": "VariableDeclaration", + "scope": 6723, + "src": "2746:19:49", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 6655, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "2746:5:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "id": 6665, + "initialValue": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 6663, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 6661, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "hexValue": "32", + "id": 6659, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2778:1:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_2_by_1", + "typeString": "int_const 2" + }, + "value": "2" + }, + "nodeType": "BinaryOperation", + "operator": "*", + "rightExpression": { + "id": 6660, + "name": "length", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6646, + "src": "2782:6:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "2778:10:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "hexValue": "32", + "id": 6662, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2791:1:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_2_by_1", + "typeString": "int_const 2" + }, + "value": "2" + }, + "src": "2778:14:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 6658, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "NewExpression", + "src": "2768:9:49", + "typeDescriptions": { + "typeIdentifier": "t_function_objectcreation_pure$_t_uint256_$returns$_t_bytes_memory_ptr_$", + "typeString": "function (uint256) pure returns (bytes memory)" + }, + "typeName": { + "id": 6657, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "2772:5:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + } + }, + "id": 6664, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2768:25:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "2746:47:49" + }, + { + "expression": { + "id": 6670, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "baseExpression": { + "id": 6666, + "name": "buffer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6656, + "src": "2803:6:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 6668, + "indexExpression": { + "hexValue": "30", + "id": 6667, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2810:1:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "2803:9:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "hexValue": "30", + "id": 6669, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2815:3:49", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_044852b2a670ade5407e78fb2863c51de9fcb96542a07186fe3aeda6bb8a116d", + "typeString": "literal_string \"0\"" + }, + "value": "0" + }, + "src": "2803:15:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + "id": 6671, + "nodeType": "ExpressionStatement", + "src": "2803:15:49" + }, + { + "expression": { + "id": 6676, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "baseExpression": { + "id": 6672, + "name": "buffer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6656, + "src": "2828:6:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 6674, + "indexExpression": { + "hexValue": "31", + "id": 6673, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2835:1:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "2828:9:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "hexValue": "78", + "id": 6675, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2840:3:49", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_7521d1cadbcfa91eec65aa16715b94ffc1c9654ba57ea2ef1a2127bca1127a83", + "typeString": "literal_string \"x\"" + }, + "value": "x" + }, + "src": "2828:15:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + "id": 6677, + "nodeType": "ExpressionStatement", + "src": "2828:15:49" + }, + { + "body": { + "id": 6706, + "nodeType": "Block", + "src": "2898:95:49", + "statements": [ + { + "expression": { + "id": 6700, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "baseExpression": { + "id": 6692, + "name": "buffer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6656, + "src": "2912:6:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 6694, + "indexExpression": { + "id": 6693, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6679, + "src": "2919:1:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "2912:9:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "baseExpression": { + "id": 6695, + "name": "HEX_DIGITS", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6495, + "src": "2924:10:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes16", + "typeString": "bytes16" + } + }, + "id": 6699, + "indexExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 6698, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 6696, + "name": "localValue", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6652, + "src": "2935:10:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "&", + "rightExpression": { + "hexValue": "307866", + "id": 6697, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2948:3:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_15_by_1", + "typeString": "int_const 15" + }, + "value": "0xf" + }, + "src": "2935:16:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "2924:28:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + "src": "2912:40:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + "id": 6701, + "nodeType": "ExpressionStatement", + "src": "2912:40:49" + }, + { + "expression": { + "id": 6704, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 6702, + "name": "localValue", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6652, + "src": "2966:10:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": ">>=", + "rightHandSide": { + "hexValue": "34", + "id": 6703, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2981:1:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_4_by_1", + "typeString": "int_const 4" + }, + "value": "4" + }, + "src": "2966:16:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 6705, + "nodeType": "ExpressionStatement", + "src": "2966:16:49" + } + ] + }, + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 6688, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 6686, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6679, + "src": "2886:1:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "hexValue": "31", + "id": 6687, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2890:1:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "2886:5:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 6707, + "initializationExpression": { + "assignments": [ + 6679 + ], + "declarations": [ + { + "constant": false, + "id": 6679, + "mutability": "mutable", + "name": "i", + "nameLocation": "2866:1:49", + "nodeType": "VariableDeclaration", + "scope": 6707, + "src": "2858:9:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 6678, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2858:7:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 6685, + "initialValue": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 6684, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 6682, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "hexValue": "32", + "id": 6680, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2870:1:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_2_by_1", + "typeString": "int_const 2" + }, + "value": "2" + }, + "nodeType": "BinaryOperation", + "operator": "*", + "rightExpression": { + "id": 6681, + "name": "length", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6646, + "src": "2874:6:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "2870:10:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "hexValue": "31", + "id": 6683, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2883:1:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "2870:14:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "2858:26:49" + }, + "isSimpleCounterLoop": false, + "loopExpression": { + "expression": { + "id": 6690, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "--", + "prefix": true, + "src": "2893:3:49", + "subExpression": { + "id": 6689, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6679, + "src": "2895:1:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 6691, + "nodeType": "ExpressionStatement", + "src": "2893:3:49" + }, + "nodeType": "ForStatement", + "src": "2853:140:49" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 6710, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 6708, + "name": "localValue", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6652, + "src": "3006:10:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "hexValue": "30", + "id": 6709, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3020:1:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "3006:15:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 6717, + "nodeType": "IfStatement", + "src": "3002:96:49", + "trueBody": { + "id": 6716, + "nodeType": "Block", + "src": "3023:75:49", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "id": 6712, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6644, + "src": "3073:5:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 6713, + "name": "length", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6646, + "src": "3080:6:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 6711, + "name": "StringsInsufficientHexLength", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6541, + "src": "3044:28:49", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint256_$_t_uint256_$returns$_t_error_$", + "typeString": "function (uint256,uint256) pure returns (error)" + } + }, + "id": 6714, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3044:43:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 6715, + "nodeType": "RevertStatement", + "src": "3037:50:49" + } + ] + } + }, + { + "expression": { + "arguments": [ + { + "id": 6720, + "name": "buffer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6656, + "src": "3121:6:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 6719, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "3114:6:49", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_string_storage_ptr_$", + "typeString": "type(string storage pointer)" + }, + "typeName": { + "id": 6718, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "3114:6:49", + "typeDescriptions": {} + } + }, + "id": 6721, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3114:14:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + }, + "functionReturnParameters": 6650, + "id": 6722, + "nodeType": "Return", + "src": "3107:21:49" + } + ] + }, + "documentation": { + "id": 6642, + "nodeType": "StructuredDocumentation", + "src": "2493:112:49", + "text": " @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length." + }, + "id": 6724, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toHexString", + "nameLocation": "2619:11:49", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 6647, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 6644, + "mutability": "mutable", + "name": "value", + "nameLocation": "2639:5:49", + "nodeType": "VariableDeclaration", + "scope": 6724, + "src": "2631:13:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 6643, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2631:7:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 6646, + "mutability": "mutable", + "name": "length", + "nameLocation": "2654:6:49", + "nodeType": "VariableDeclaration", + "scope": 6724, + "src": "2646:14:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 6645, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2646:7:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "2630:31:49" + }, + "returnParameters": { + "id": 6650, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 6649, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 6724, + "src": "2685:13:49", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 6648, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "2685:6:49", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "visibility": "internal" + } + ], + "src": "2684:15:49" + }, + "scope": 7883, + "src": "2610:525:49", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 6743, + "nodeType": "Block", + "src": "3367:75:49", + "statements": [ + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "arguments": [ + { + "id": 6737, + "name": "addr", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6727, + "src": "3412:4:49", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 6736, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "3404:7:49", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint160_$", + "typeString": "type(uint160)" + }, + "typeName": { + "id": 6735, + "name": "uint160", + "nodeType": "ElementaryTypeName", + "src": "3404:7:49", + "typeDescriptions": {} + } + }, + "id": 6738, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3404:13:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint160", + "typeString": "uint160" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint160", + "typeString": "uint160" + } + ], + "id": 6734, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "3396:7:49", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + }, + "typeName": { + "id": 6733, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "3396:7:49", + "typeDescriptions": {} + } + }, + "id": 6739, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3396:22:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 6740, + "name": "ADDRESS_LENGTH", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6498, + "src": "3420:14:49", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + ], + "id": 6732, + "name": "toHexString", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 6641, + 6724, + 6744 + ], + "referencedDeclaration": 6724, + "src": "3384:11:49", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_string_memory_ptr_$", + "typeString": "function (uint256,uint256) pure returns (string memory)" + } + }, + "id": 6741, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3384:51:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + }, + "functionReturnParameters": 6731, + "id": 6742, + "nodeType": "Return", + "src": "3377:58:49" + } + ] + }, + "documentation": { + "id": 6725, + "nodeType": "StructuredDocumentation", + "src": "3141:148:49", + "text": " @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal\n representation." + }, + "id": 6744, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toHexString", + "nameLocation": "3303:11:49", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 6728, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 6727, + "mutability": "mutable", + "name": "addr", + "nameLocation": "3323:4:49", + "nodeType": "VariableDeclaration", + "scope": 6744, + "src": "3315:12:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 6726, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3315:7:49", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "3314:14:49" + }, + "returnParameters": { + "id": 6731, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 6730, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 6744, + "src": "3352:13:49", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 6729, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "3352:6:49", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "visibility": "internal" + } + ], + "src": "3351:15:49" + }, + "scope": 7883, + "src": "3294:148:49", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 6808, + "nodeType": "Block", + "src": "3699:642:49", + "statements": [ + { + "assignments": [ + 6753 + ], + "declarations": [ + { + "constant": false, + "id": 6753, + "mutability": "mutable", + "name": "buffer", + "nameLocation": "3722:6:49", + "nodeType": "VariableDeclaration", + "scope": 6808, + "src": "3709:19:49", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 6752, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "3709:5:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "id": 6760, + "initialValue": { + "arguments": [ + { + "arguments": [ + { + "id": 6757, + "name": "addr", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6747, + "src": "3749:4:49", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 6756, + "name": "toHexString", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 6641, + 6724, + 6744 + ], + "referencedDeclaration": 6744, + "src": "3737:11:49", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_address_$returns$_t_string_memory_ptr_$", + "typeString": "function (address) pure returns (string memory)" + } + }, + "id": 6758, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3737:17:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + ], + "id": 6755, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "3731:5:49", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes_storage_ptr_$", + "typeString": "type(bytes storage pointer)" + }, + "typeName": { + "id": 6754, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "3731:5:49", + "typeDescriptions": {} + } + }, + "id": 6759, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3731:24:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "3709:46:49" + }, + { + "assignments": [ + 6762 + ], + "declarations": [ + { + "constant": false, + "id": 6762, + "mutability": "mutable", + "name": "hashValue", + "nameLocation": "3848:9:49", + "nodeType": "VariableDeclaration", + "scope": 6808, + "src": "3840:17:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 6761, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "3840:7:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 6763, + "nodeType": "VariableDeclarationStatement", + "src": "3840:17:49" + }, + { + "AST": { + "nativeSrc": "3892:78:49", + "nodeType": "YulBlock", + "src": "3892:78:49", + "statements": [ + { + "nativeSrc": "3906:54:49", + "nodeType": "YulAssignment", + "src": "3906:54:49", + "value": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "3923:2:49", + "nodeType": "YulLiteral", + "src": "3923:2:49", + "type": "", + "value": "96" + }, + { + "arguments": [ + { + "arguments": [ + { + "name": "buffer", + "nativeSrc": "3941:6:49", + "nodeType": "YulIdentifier", + "src": "3941:6:49" + }, + { + "kind": "number", + "nativeSrc": "3949:4:49", + "nodeType": "YulLiteral", + "src": "3949:4:49", + "type": "", + "value": "0x22" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "3937:3:49", + "nodeType": "YulIdentifier", + "src": "3937:3:49" + }, + "nativeSrc": "3937:17:49", + "nodeType": "YulFunctionCall", + "src": "3937:17:49" + }, + { + "kind": "number", + "nativeSrc": "3956:2:49", + "nodeType": "YulLiteral", + "src": "3956:2:49", + "type": "", + "value": "40" + } + ], + "functionName": { + "name": "keccak256", + "nativeSrc": "3927:9:49", + "nodeType": "YulIdentifier", + "src": "3927:9:49" + }, + "nativeSrc": "3927:32:49", + "nodeType": "YulFunctionCall", + "src": "3927:32:49" + } + ], + "functionName": { + "name": "shr", + "nativeSrc": "3919:3:49", + "nodeType": "YulIdentifier", + "src": "3919:3:49" + }, + "nativeSrc": "3919:41:49", + "nodeType": "YulFunctionCall", + "src": "3919:41:49" + }, + "variableNames": [ + { + "name": "hashValue", + "nativeSrc": "3906:9:49", + "nodeType": "YulIdentifier", + "src": "3906:9:49" + } + ] + } + ] + }, + "evmVersion": "paris", + "externalReferences": [ + { + "declaration": 6753, + "isOffset": false, + "isSlot": false, + "src": "3941:6:49", + "valueSize": 1 + }, + { + "declaration": 6762, + "isOffset": false, + "isSlot": false, + "src": "3906:9:49", + "valueSize": 1 + } + ], + "flags": [ + "memory-safe" + ], + "id": 6764, + "nodeType": "InlineAssembly", + "src": "3867:103:49" + }, + { + "body": { + "id": 6801, + "nodeType": "Block", + "src": "4013:291:49", + "statements": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 6788, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 6779, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 6777, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 6775, + "name": "hashValue", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6762, + "src": "4119:9:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "&", + "rightExpression": { + "hexValue": "307866", + "id": 6776, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4131:3:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_15_by_1", + "typeString": "int_const 15" + }, + "value": "0xf" + }, + "src": "4119:15:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "hexValue": "37", + "id": 6778, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4137:1:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_7_by_1", + "typeString": "int_const 7" + }, + "value": "7" + }, + "src": "4119:19:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "&&", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "id": 6787, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "arguments": [ + { + "baseExpression": { + "id": 6782, + "name": "buffer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6753, + "src": "4148:6:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 6784, + "indexExpression": { + "id": 6783, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6766, + "src": "4155:1:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "4148:9:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + ], + "id": 6781, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "4142:5:49", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint8_$", + "typeString": "type(uint8)" + }, + "typeName": { + "id": 6780, + "name": "uint8", + "nodeType": "ElementaryTypeName", + "src": "4142:5:49", + "typeDescriptions": {} + } + }, + "id": 6785, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4142:16:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "hexValue": "3936", + "id": 6786, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4161:2:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_96_by_1", + "typeString": "int_const 96" + }, + "value": "96" + }, + "src": "4142:21:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "4119:44:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 6796, + "nodeType": "IfStatement", + "src": "4115:150:49", + "trueBody": { + "id": 6795, + "nodeType": "Block", + "src": "4165:100:49", + "statements": [ + { + "expression": { + "id": 6793, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "baseExpression": { + "id": 6789, + "name": "buffer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6753, + "src": "4233:6:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 6791, + "indexExpression": { + "id": 6790, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6766, + "src": "4240:1:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "4233:9:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + "nodeType": "Assignment", + "operator": "^=", + "rightHandSide": { + "hexValue": "30783230", + "id": 6792, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4246:4:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_32_by_1", + "typeString": "int_const 32" + }, + "value": "0x20" + }, + "src": "4233:17:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + "id": 6794, + "nodeType": "ExpressionStatement", + "src": "4233:17:49" + } + ] + } + }, + { + "expression": { + "id": 6799, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 6797, + "name": "hashValue", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6762, + "src": "4278:9:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": ">>=", + "rightHandSide": { + "hexValue": "34", + "id": 6798, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4292:1:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_4_by_1", + "typeString": "int_const 4" + }, + "value": "4" + }, + "src": "4278:15:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 6800, + "nodeType": "ExpressionStatement", + "src": "4278:15:49" + } + ] + }, + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 6771, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 6769, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6766, + "src": "4001:1:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "hexValue": "31", + "id": 6770, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4005:1:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "4001:5:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 6802, + "initializationExpression": { + "assignments": [ + 6766 + ], + "declarations": [ + { + "constant": false, + "id": 6766, + "mutability": "mutable", + "name": "i", + "nameLocation": "3993:1:49", + "nodeType": "VariableDeclaration", + "scope": 6802, + "src": "3985:9:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 6765, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "3985:7:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 6768, + "initialValue": { + "hexValue": "3431", + "id": 6767, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3997:2:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_41_by_1", + "typeString": "int_const 41" + }, + "value": "41" + }, + "nodeType": "VariableDeclarationStatement", + "src": "3985:14:49" + }, + "isSimpleCounterLoop": false, + "loopExpression": { + "expression": { + "id": 6773, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "--", + "prefix": true, + "src": "4008:3:49", + "subExpression": { + "id": 6772, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6766, + "src": "4010:1:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 6774, + "nodeType": "ExpressionStatement", + "src": "4008:3:49" + }, + "nodeType": "ForStatement", + "src": "3980:324:49" + }, + { + "expression": { + "arguments": [ + { + "id": 6805, + "name": "buffer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6753, + "src": "4327:6:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 6804, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "4320:6:49", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_string_storage_ptr_$", + "typeString": "type(string storage pointer)" + }, + "typeName": { + "id": 6803, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "4320:6:49", + "typeDescriptions": {} + } + }, + "id": 6806, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4320:14:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + }, + "functionReturnParameters": 6751, + "id": 6807, + "nodeType": "Return", + "src": "4313:21:49" + } + ] + }, + "documentation": { + "id": 6745, + "nodeType": "StructuredDocumentation", + "src": "3448:165:49", + "text": " @dev Converts an `address` with fixed length of 20 bytes to its checksummed ASCII `string` hexadecimal\n representation, according to EIP-55." + }, + "id": 6809, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toChecksumHexString", + "nameLocation": "3627:19:49", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 6748, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 6747, + "mutability": "mutable", + "name": "addr", + "nameLocation": "3655:4:49", + "nodeType": "VariableDeclaration", + "scope": 6809, + "src": "3647:12:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 6746, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3647:7:49", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "3646:14:49" + }, + "returnParameters": { + "id": 6751, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 6750, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 6809, + "src": "3684:13:49", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 6749, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "3684:6:49", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "visibility": "internal" + } + ], + "src": "3683:15:49" + }, + "scope": 7883, + "src": "3618:723:49", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 6845, + "nodeType": "Block", + "src": "4496:104:49", + "statements": [ + { + "expression": { + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 6843, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 6829, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "arguments": [ + { + "id": 6821, + "name": "a", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6812, + "src": "4519:1:49", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + ], + "id": 6820, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "4513:5:49", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes_storage_ptr_$", + "typeString": "type(bytes storage pointer)" + }, + "typeName": { + "id": 6819, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "4513:5:49", + "typeDescriptions": {} + } + }, + "id": 6822, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4513:8:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 6823, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "4522:6:49", + "memberName": "length", + "nodeType": "MemberAccess", + "src": "4513:15:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "expression": { + "arguments": [ + { + "id": 6826, + "name": "b", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6814, + "src": "4538:1:49", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + ], + "id": 6825, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "4532:5:49", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes_storage_ptr_$", + "typeString": "type(bytes storage pointer)" + }, + "typeName": { + "id": 6824, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "4532:5:49", + "typeDescriptions": {} + } + }, + "id": 6827, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4532:8:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 6828, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "4541:6:49", + "memberName": "length", + "nodeType": "MemberAccess", + "src": "4532:15:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "4513:34:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "&&", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "id": 6842, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "arguments": [ + { + "arguments": [ + { + "id": 6833, + "name": "a", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6812, + "src": "4567:1:49", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + ], + "id": 6832, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "4561:5:49", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes_storage_ptr_$", + "typeString": "type(bytes storage pointer)" + }, + "typeName": { + "id": 6831, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "4561:5:49", + "typeDescriptions": {} + } + }, + "id": 6834, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4561:8:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 6830, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -8, + "src": "4551:9:49", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 6835, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4551:19:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "arguments": [ + { + "arguments": [ + { + "id": 6839, + "name": "b", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6814, + "src": "4590:1:49", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + ], + "id": 6838, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "4584:5:49", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes_storage_ptr_$", + "typeString": "type(bytes storage pointer)" + }, + "typeName": { + "id": 6837, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "4584:5:49", + "typeDescriptions": {} + } + }, + "id": 6840, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4584:8:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 6836, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -8, + "src": "4574:9:49", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 6841, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4574:19:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "src": "4551:42:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "4513:80:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "functionReturnParameters": 6818, + "id": 6844, + "nodeType": "Return", + "src": "4506:87:49" + } + ] + }, + "documentation": { + "id": 6810, + "nodeType": "StructuredDocumentation", + "src": "4347:66:49", + "text": " @dev Returns true if the two strings are equal." + }, + "id": 6846, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "equal", + "nameLocation": "4427:5:49", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 6815, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 6812, + "mutability": "mutable", + "name": "a", + "nameLocation": "4447:1:49", + "nodeType": "VariableDeclaration", + "scope": 6846, + "src": "4433:15:49", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 6811, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "4433:6:49", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 6814, + "mutability": "mutable", + "name": "b", + "nameLocation": "4464:1:49", + "nodeType": "VariableDeclaration", + "scope": 6846, + "src": "4450:15:49", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 6813, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "4450:6:49", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "visibility": "internal" + } + ], + "src": "4432:34:49" + }, + "returnParameters": { + "id": 6818, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 6817, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 6846, + "src": "4490:4:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 6816, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "4490:4:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "src": "4489:6:49" + }, + "scope": 7883, + "src": "4418:182:49", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 6864, + "nodeType": "Block", + "src": "4897:64:49", + "statements": [ + { + "expression": { + "arguments": [ + { + "id": 6855, + "name": "input", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6849, + "src": "4924:5:49", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + }, + { + "hexValue": "30", + "id": 6856, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4931:1:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + { + "expression": { + "arguments": [ + { + "id": 6859, + "name": "input", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6849, + "src": "4940:5:49", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + ], + "id": 6858, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "4934:5:49", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes_storage_ptr_$", + "typeString": "type(bytes storage pointer)" + }, + "typeName": { + "id": 6857, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "4934:5:49", + "typeDescriptions": {} + } + }, + "id": 6860, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4934:12:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 6861, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "4947:6:49", + "memberName": "length", + "nodeType": "MemberAccess", + "src": "4934:19:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + }, + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 6854, + "name": "parseUint", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 6865, + 6896 + ], + "referencedDeclaration": 6896, + "src": "4914:9:49", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_string_memory_ptr_$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (string memory,uint256,uint256) pure returns (uint256)" + } + }, + "id": 6862, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4914:40:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 6853, + "id": 6863, + "nodeType": "Return", + "src": "4907:47:49" + } + ] + }, + "documentation": { + "id": 6847, + "nodeType": "StructuredDocumentation", + "src": "4606:214:49", + "text": " @dev Parse a decimal string and returns the value as a `uint256`.\n Requirements:\n - The string must be formatted as `[0-9]*`\n - The result must fit into an `uint256` type" + }, + "id": 6865, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "parseUint", + "nameLocation": "4834:9:49", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 6850, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 6849, + "mutability": "mutable", + "name": "input", + "nameLocation": "4858:5:49", + "nodeType": "VariableDeclaration", + "scope": 6865, + "src": "4844:19:49", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 6848, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "4844:6:49", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "visibility": "internal" + } + ], + "src": "4843:21:49" + }, + "returnParameters": { + "id": 6853, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 6852, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 6865, + "src": "4888:7:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 6851, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "4888:7:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "4887:9:49" + }, + "scope": 7883, + "src": "4825:136:49", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 6895, + "nodeType": "Block", + "src": "5366:153:49", + "statements": [ + { + "assignments": [ + 6878, + 6880 + ], + "declarations": [ + { + "constant": false, + "id": 6878, + "mutability": "mutable", + "name": "success", + "nameLocation": "5382:7:49", + "nodeType": "VariableDeclaration", + "scope": 6895, + "src": "5377:12:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 6877, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "5377:4:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 6880, + "mutability": "mutable", + "name": "value", + "nameLocation": "5399:5:49", + "nodeType": "VariableDeclaration", + "scope": 6895, + "src": "5391:13:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 6879, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "5391:7:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 6886, + "initialValue": { + "arguments": [ + { + "id": 6882, + "name": "input", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6868, + "src": "5421:5:49", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + }, + { + "id": 6883, + "name": "begin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6870, + "src": "5428:5:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 6884, + "name": "end", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6872, + "src": "5435:3:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 6881, + "name": "tryParseUint", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 6917, + 6954 + ], + "referencedDeclaration": 6954, + "src": "5408:12:49", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_string_memory_ptr_$_t_uint256_$_t_uint256_$returns$_t_bool_$_t_uint256_$", + "typeString": "function (string memory,uint256,uint256) pure returns (bool,uint256)" + } + }, + "id": 6885, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5408:31:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_bool_$_t_uint256_$", + "typeString": "tuple(bool,uint256)" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "5376:63:49" + }, + { + "condition": { + "id": 6888, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "5453:8:49", + "subExpression": { + "id": 6887, + "name": "success", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6878, + "src": "5454:7:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 6892, + "nodeType": "IfStatement", + "src": "5449:41:49", + "trueBody": { + "errorCall": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 6889, + "name": "StringsInvalidChar", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6544, + "src": "5470:18:49", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$__$returns$_t_error_$", + "typeString": "function () pure returns (error)" + } + }, + "id": 6890, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5470:20:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 6891, + "nodeType": "RevertStatement", + "src": "5463:27:49" + } + }, + { + "expression": { + "id": 6893, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6880, + "src": "5507:5:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 6876, + "id": 6894, + "nodeType": "Return", + "src": "5500:12:49" + } + ] + }, + "documentation": { + "id": 6866, + "nodeType": "StructuredDocumentation", + "src": "4967:294:49", + "text": " @dev Variant of {parseUint-string} that parses a substring of `input` located between position `begin` (included) and\n `end` (excluded).\n Requirements:\n - The substring must be formatted as `[0-9]*`\n - The result must fit into an `uint256` type" + }, + "id": 6896, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "parseUint", + "nameLocation": "5275:9:49", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 6873, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 6868, + "mutability": "mutable", + "name": "input", + "nameLocation": "5299:5:49", + "nodeType": "VariableDeclaration", + "scope": 6896, + "src": "5285:19:49", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 6867, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "5285:6:49", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 6870, + "mutability": "mutable", + "name": "begin", + "nameLocation": "5314:5:49", + "nodeType": "VariableDeclaration", + "scope": 6896, + "src": "5306:13:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 6869, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "5306:7:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 6872, + "mutability": "mutable", + "name": "end", + "nameLocation": "5329:3:49", + "nodeType": "VariableDeclaration", + "scope": 6896, + "src": "5321:11:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 6871, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "5321:7:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "5284:49:49" + }, + "returnParameters": { + "id": 6876, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 6875, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 6896, + "src": "5357:7:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 6874, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "5357:7:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "5356:9:49" + }, + "scope": 7883, + "src": "5266:253:49", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 6916, + "nodeType": "Block", + "src": "5840:83:49", + "statements": [ + { + "expression": { + "arguments": [ + { + "id": 6907, + "name": "input", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6899, + "src": "5886:5:49", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + }, + { + "hexValue": "30", + "id": 6908, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "5893:1:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + { + "expression": { + "arguments": [ + { + "id": 6911, + "name": "input", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6899, + "src": "5902:5:49", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + ], + "id": 6910, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "5896:5:49", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes_storage_ptr_$", + "typeString": "type(bytes storage pointer)" + }, + "typeName": { + "id": 6909, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "5896:5:49", + "typeDescriptions": {} + } + }, + "id": 6912, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5896:12:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 6913, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "5909:6:49", + "memberName": "length", + "nodeType": "MemberAccess", + "src": "5896:19:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + }, + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 6906, + "name": "_tryParseUintUncheckedBounds", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7024, + "src": "5857:28:49", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_string_memory_ptr_$_t_uint256_$_t_uint256_$returns$_t_bool_$_t_uint256_$", + "typeString": "function (string memory,uint256,uint256) pure returns (bool,uint256)" + } + }, + "id": 6914, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5857:59:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_bool_$_t_uint256_$", + "typeString": "tuple(bool,uint256)" + } + }, + "functionReturnParameters": 6905, + "id": 6915, + "nodeType": "Return", + "src": "5850:66:49" + } + ] + }, + "documentation": { + "id": 6897, + "nodeType": "StructuredDocumentation", + "src": "5525:215:49", + "text": " @dev Variant of {parseUint-string} that returns false if the parsing fails because of an invalid character.\n NOTE: This function will revert if the result does not fit in a `uint256`." + }, + "id": 6917, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "tryParseUint", + "nameLocation": "5754:12:49", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 6900, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 6899, + "mutability": "mutable", + "name": "input", + "nameLocation": "5781:5:49", + "nodeType": "VariableDeclaration", + "scope": 6917, + "src": "5767:19:49", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 6898, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "5767:6:49", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "visibility": "internal" + } + ], + "src": "5766:21:49" + }, + "returnParameters": { + "id": 6905, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 6902, + "mutability": "mutable", + "name": "success", + "nameLocation": "5816:7:49", + "nodeType": "VariableDeclaration", + "scope": 6917, + "src": "5811:12:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 6901, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "5811:4:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 6904, + "mutability": "mutable", + "name": "value", + "nameLocation": "5833:5:49", + "nodeType": "VariableDeclaration", + "scope": 6917, + "src": "5825:13:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 6903, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "5825:7:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "5810:29:49" + }, + "scope": 7883, + "src": "5745:178:49", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 6953, + "nodeType": "Block", + "src": "6325:144:49", + "statements": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 6941, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 6937, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 6931, + "name": "end", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6924, + "src": "6339:3:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "expression": { + "arguments": [ + { + "id": 6934, + "name": "input", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6920, + "src": "6351:5:49", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + ], + "id": 6933, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "6345:5:49", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes_storage_ptr_$", + "typeString": "type(bytes storage pointer)" + }, + "typeName": { + "id": 6932, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "6345:5:49", + "typeDescriptions": {} + } + }, + "id": 6935, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "6345:12:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 6936, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "6358:6:49", + "memberName": "length", + "nodeType": "MemberAccess", + "src": "6345:19:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "6339:25:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "||", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 6940, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 6938, + "name": "begin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6922, + "src": "6368:5:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "id": 6939, + "name": "end", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6924, + "src": "6376:3:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "6368:11:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "6339:40:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 6946, + "nodeType": "IfStatement", + "src": "6335:63:49", + "trueBody": { + "expression": { + "components": [ + { + "hexValue": "66616c7365", + "id": 6942, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6389:5:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + }, + { + "hexValue": "30", + "id": 6943, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6396:1:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "id": 6944, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "6388:10:49", + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_bool_$_t_rational_0_by_1_$", + "typeString": "tuple(bool,int_const 0)" + } + }, + "functionReturnParameters": 6930, + "id": 6945, + "nodeType": "Return", + "src": "6381:17:49" + } + }, + { + "expression": { + "arguments": [ + { + "id": 6948, + "name": "input", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6920, + "src": "6444:5:49", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + }, + { + "id": 6949, + "name": "begin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6922, + "src": "6451:5:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 6950, + "name": "end", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6924, + "src": "6458:3:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 6947, + "name": "_tryParseUintUncheckedBounds", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7024, + "src": "6415:28:49", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_string_memory_ptr_$_t_uint256_$_t_uint256_$returns$_t_bool_$_t_uint256_$", + "typeString": "function (string memory,uint256,uint256) pure returns (bool,uint256)" + } + }, + "id": 6951, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "6415:47:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_bool_$_t_uint256_$", + "typeString": "tuple(bool,uint256)" + } + }, + "functionReturnParameters": 6930, + "id": 6952, + "nodeType": "Return", + "src": "6408:54:49" + } + ] + }, + "documentation": { + "id": 6918, + "nodeType": "StructuredDocumentation", + "src": "5929:238:49", + "text": " @dev Variant of {parseUint-string-uint256-uint256} that returns false if the parsing fails because of an invalid\n character.\n NOTE: This function will revert if the result does not fit in a `uint256`." + }, + "id": 6954, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "tryParseUint", + "nameLocation": "6181:12:49", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 6925, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 6920, + "mutability": "mutable", + "name": "input", + "nameLocation": "6217:5:49", + "nodeType": "VariableDeclaration", + "scope": 6954, + "src": "6203:19:49", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 6919, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "6203:6:49", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 6922, + "mutability": "mutable", + "name": "begin", + "nameLocation": "6240:5:49", + "nodeType": "VariableDeclaration", + "scope": 6954, + "src": "6232:13:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 6921, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "6232:7:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 6924, + "mutability": "mutable", + "name": "end", + "nameLocation": "6263:3:49", + "nodeType": "VariableDeclaration", + "scope": 6954, + "src": "6255:11:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 6923, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "6255:7:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "6193:79:49" + }, + "returnParameters": { + "id": 6930, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 6927, + "mutability": "mutable", + "name": "success", + "nameLocation": "6301:7:49", + "nodeType": "VariableDeclaration", + "scope": 6954, + "src": "6296:12:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 6926, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "6296:4:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 6929, + "mutability": "mutable", + "name": "value", + "nameLocation": "6318:5:49", + "nodeType": "VariableDeclaration", + "scope": 6954, + "src": "6310:13:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 6928, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "6310:7:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "6295:29:49" + }, + "scope": 7883, + "src": "6172:297:49", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 7023, + "nodeType": "Block", + "src": "6872:347:49", + "statements": [ + { + "assignments": [ + 6969 + ], + "declarations": [ + { + "constant": false, + "id": 6969, + "mutability": "mutable", + "name": "buffer", + "nameLocation": "6895:6:49", + "nodeType": "VariableDeclaration", + "scope": 7023, + "src": "6882:19:49", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 6968, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "6882:5:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "id": 6974, + "initialValue": { + "arguments": [ + { + "id": 6972, + "name": "input", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6957, + "src": "6910:5:49", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + ], + "id": 6971, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "6904:5:49", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes_storage_ptr_$", + "typeString": "type(bytes storage pointer)" + }, + "typeName": { + "id": 6970, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "6904:5:49", + "typeDescriptions": {} + } + }, + "id": 6973, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "6904:12:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "6882:34:49" + }, + { + "assignments": [ + 6976 + ], + "declarations": [ + { + "constant": false, + "id": 6976, + "mutability": "mutable", + "name": "result", + "nameLocation": "6935:6:49", + "nodeType": "VariableDeclaration", + "scope": 7023, + "src": "6927:14:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 6975, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "6927:7:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 6978, + "initialValue": { + "hexValue": "30", + "id": 6977, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6944:1:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "nodeType": "VariableDeclarationStatement", + "src": "6927:18:49" + }, + { + "body": { + "id": 7017, + "nodeType": "Block", + "src": "6993:189:49", + "statements": [ + { + "assignments": [ + 6990 + ], + "declarations": [ + { + "constant": false, + "id": 6990, + "mutability": "mutable", + "name": "chr", + "nameLocation": "7013:3:49", + "nodeType": "VariableDeclaration", + "scope": 7017, + "src": "7007:9:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "typeName": { + "id": 6989, + "name": "uint8", + "nodeType": "ElementaryTypeName", + "src": "7007:5:49", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "visibility": "internal" + } + ], + "id": 7000, + "initialValue": { + "arguments": [ + { + "arguments": [ + { + "arguments": [ + { + "id": 6995, + "name": "buffer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6969, + "src": "7062:6:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + { + "id": 6996, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6980, + "src": "7070:1:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 6994, + "name": "_unsafeReadBytesOffset", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7882, + "src": "7039:22:49", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$_t_uint256_$returns$_t_bytes32_$", + "typeString": "function (bytes memory,uint256) pure returns (bytes32)" + } + }, + "id": 6997, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "7039:33:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 6993, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "7032:6:49", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes1_$", + "typeString": "type(bytes1)" + }, + "typeName": { + "id": 6992, + "name": "bytes1", + "nodeType": "ElementaryTypeName", + "src": "7032:6:49", + "typeDescriptions": {} + } + }, + "id": 6998, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "7032:41:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + ], + "id": 6991, + "name": "_tryParseChr", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7704, + "src": "7019:12:49", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_bytes1_$returns$_t_uint8_$", + "typeString": "function (bytes1) pure returns (uint8)" + } + }, + "id": 6999, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "7019:55:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "7007:67:49" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "id": 7003, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 7001, + "name": "chr", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6990, + "src": "7092:3:49", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "hexValue": "39", + "id": 7002, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7098:1:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_9_by_1", + "typeString": "int_const 9" + }, + "value": "9" + }, + "src": "7092:7:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 7008, + "nodeType": "IfStatement", + "src": "7088:30:49", + "trueBody": { + "expression": { + "components": [ + { + "hexValue": "66616c7365", + "id": 7004, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7109:5:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + }, + { + "hexValue": "30", + "id": 7005, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7116:1:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "id": 7006, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "7108:10:49", + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_bool_$_t_rational_0_by_1_$", + "typeString": "tuple(bool,int_const 0)" + } + }, + "functionReturnParameters": 6967, + "id": 7007, + "nodeType": "Return", + "src": "7101:17:49" + } + }, + { + "expression": { + "id": 7011, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 7009, + "name": "result", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6976, + "src": "7132:6:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "*=", + "rightHandSide": { + "hexValue": "3130", + "id": 7010, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7142:2:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_10_by_1", + "typeString": "int_const 10" + }, + "value": "10" + }, + "src": "7132:12:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 7012, + "nodeType": "ExpressionStatement", + "src": "7132:12:49" + }, + { + "expression": { + "id": 7015, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 7013, + "name": "result", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6976, + "src": "7158:6:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "+=", + "rightHandSide": { + "id": 7014, + "name": "chr", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6990, + "src": "7168:3:49", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "src": "7158:13:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 7016, + "nodeType": "ExpressionStatement", + "src": "7158:13:49" + } + ] + }, + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 6985, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 6983, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6980, + "src": "6979:1:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "id": 6984, + "name": "end", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6961, + "src": "6983:3:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "6979:7:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 7018, + "initializationExpression": { + "assignments": [ + 6980 + ], + "declarations": [ + { + "constant": false, + "id": 6980, + "mutability": "mutable", + "name": "i", + "nameLocation": "6968:1:49", + "nodeType": "VariableDeclaration", + "scope": 7018, + "src": "6960:9:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 6979, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "6960:7:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 6982, + "initialValue": { + "id": 6981, + "name": "begin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6959, + "src": "6972:5:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "6960:17:49" + }, + "isSimpleCounterLoop": true, + "loopExpression": { + "expression": { + "id": 6987, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": true, + "src": "6988:3:49", + "subExpression": { + "id": 6986, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6980, + "src": "6990:1:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 6988, + "nodeType": "ExpressionStatement", + "src": "6988:3:49" + }, + "nodeType": "ForStatement", + "src": "6955:227:49" + }, + { + "expression": { + "components": [ + { + "hexValue": "74727565", + "id": 7019, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7199:4:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "true" + }, + { + "id": 7020, + "name": "result", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6976, + "src": "7205:6:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 7021, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "7198:14:49", + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_bool_$_t_uint256_$", + "typeString": "tuple(bool,uint256)" + } + }, + "functionReturnParameters": 6967, + "id": 7022, + "nodeType": "Return", + "src": "7191:21:49" + } + ] + }, + "documentation": { + "id": 6955, + "nodeType": "StructuredDocumentation", + "src": "6475:224:49", + "text": " @dev Implementation of {tryParseUint-string-uint256-uint256} that does not check bounds. Caller should make sure that\n `begin <= end <= input.length`. Other inputs would result in undefined behavior." + }, + "id": 7024, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_tryParseUintUncheckedBounds", + "nameLocation": "6713:28:49", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 6962, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 6957, + "mutability": "mutable", + "name": "input", + "nameLocation": "6765:5:49", + "nodeType": "VariableDeclaration", + "scope": 7024, + "src": "6751:19:49", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 6956, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "6751:6:49", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 6959, + "mutability": "mutable", + "name": "begin", + "nameLocation": "6788:5:49", + "nodeType": "VariableDeclaration", + "scope": 7024, + "src": "6780:13:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 6958, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "6780:7:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 6961, + "mutability": "mutable", + "name": "end", + "nameLocation": "6811:3:49", + "nodeType": "VariableDeclaration", + "scope": 7024, + "src": "6803:11:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 6960, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "6803:7:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "6741:79:49" + }, + "returnParameters": { + "id": 6967, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 6964, + "mutability": "mutable", + "name": "success", + "nameLocation": "6848:7:49", + "nodeType": "VariableDeclaration", + "scope": 7024, + "src": "6843:12:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 6963, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "6843:4:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 6966, + "mutability": "mutable", + "name": "value", + "nameLocation": "6865:5:49", + "nodeType": "VariableDeclaration", + "scope": 7024, + "src": "6857:13:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 6965, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "6857:7:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "6842:29:49" + }, + "scope": 7883, + "src": "6704:515:49", + "stateMutability": "pure", + "virtual": false, + "visibility": "private" + }, + { + "body": { + "id": 7042, + "nodeType": "Block", + "src": "7516:63:49", + "statements": [ + { + "expression": { + "arguments": [ + { + "id": 7033, + "name": "input", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7027, + "src": "7542:5:49", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + }, + { + "hexValue": "30", + "id": 7034, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7549:1:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + { + "expression": { + "arguments": [ + { + "id": 7037, + "name": "input", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7027, + "src": "7558:5:49", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + ], + "id": 7036, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "7552:5:49", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes_storage_ptr_$", + "typeString": "type(bytes storage pointer)" + }, + "typeName": { + "id": 7035, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "7552:5:49", + "typeDescriptions": {} + } + }, + "id": 7038, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "7552:12:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 7039, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "7565:6:49", + "memberName": "length", + "nodeType": "MemberAccess", + "src": "7552:19:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + }, + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 7032, + "name": "parseInt", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 7043, + 7074 + ], + "referencedDeclaration": 7074, + "src": "7533:8:49", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_string_memory_ptr_$_t_uint256_$_t_uint256_$returns$_t_int256_$", + "typeString": "function (string memory,uint256,uint256) pure returns (int256)" + } + }, + "id": 7040, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "7533:39:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "functionReturnParameters": 7031, + "id": 7041, + "nodeType": "Return", + "src": "7526:46:49" + } + ] + }, + "documentation": { + "id": 7025, + "nodeType": "StructuredDocumentation", + "src": "7225:216:49", + "text": " @dev Parse a decimal string and returns the value as a `int256`.\n Requirements:\n - The string must be formatted as `[-+]?[0-9]*`\n - The result must fit in an `int256` type." + }, + "id": 7043, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "parseInt", + "nameLocation": "7455:8:49", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 7028, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 7027, + "mutability": "mutable", + "name": "input", + "nameLocation": "7478:5:49", + "nodeType": "VariableDeclaration", + "scope": 7043, + "src": "7464:19:49", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 7026, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "7464:6:49", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "visibility": "internal" + } + ], + "src": "7463:21:49" + }, + "returnParameters": { + "id": 7031, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 7030, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 7043, + "src": "7508:6:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "typeName": { + "id": 7029, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "7508:6:49", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "visibility": "internal" + } + ], + "src": "7507:8:49" + }, + "scope": 7883, + "src": "7446:133:49", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 7073, + "nodeType": "Block", + "src": "7984:151:49", + "statements": [ + { + "assignments": [ + 7056, + 7058 + ], + "declarations": [ + { + "constant": false, + "id": 7056, + "mutability": "mutable", + "name": "success", + "nameLocation": "8000:7:49", + "nodeType": "VariableDeclaration", + "scope": 7073, + "src": "7995:12:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 7055, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "7995:4:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 7058, + "mutability": "mutable", + "name": "value", + "nameLocation": "8016:5:49", + "nodeType": "VariableDeclaration", + "scope": 7073, + "src": "8009:12:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "typeName": { + "id": 7057, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "8009:6:49", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "visibility": "internal" + } + ], + "id": 7064, + "initialValue": { + "arguments": [ + { + "id": 7060, + "name": "input", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7046, + "src": "8037:5:49", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + }, + { + "id": 7061, + "name": "begin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7048, + "src": "8044:5:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 7062, + "name": "end", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7050, + "src": "8051:3:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 7059, + "name": "tryParseInt", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 7095, + 7137 + ], + "referencedDeclaration": 7137, + "src": "8025:11:49", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_string_memory_ptr_$_t_uint256_$_t_uint256_$returns$_t_bool_$_t_int256_$", + "typeString": "function (string memory,uint256,uint256) pure returns (bool,int256)" + } + }, + "id": 7063, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "8025:30:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_bool_$_t_int256_$", + "typeString": "tuple(bool,int256)" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "7994:61:49" + }, + { + "condition": { + "id": 7066, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "8069:8:49", + "subExpression": { + "id": 7065, + "name": "success", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7056, + "src": "8070:7:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 7070, + "nodeType": "IfStatement", + "src": "8065:41:49", + "trueBody": { + "errorCall": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 7067, + "name": "StringsInvalidChar", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6544, + "src": "8086:18:49", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$__$returns$_t_error_$", + "typeString": "function () pure returns (error)" + } + }, + "id": 7068, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "8086:20:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 7069, + "nodeType": "RevertStatement", + "src": "8079:27:49" + } + }, + { + "expression": { + "id": 7071, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7058, + "src": "8123:5:49", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "functionReturnParameters": 7054, + "id": 7072, + "nodeType": "Return", + "src": "8116:12:49" + } + ] + }, + "documentation": { + "id": 7044, + "nodeType": "StructuredDocumentation", + "src": "7585:296:49", + "text": " @dev Variant of {parseInt-string} that parses a substring of `input` located between position `begin` (included) and\n `end` (excluded).\n Requirements:\n - The substring must be formatted as `[-+]?[0-9]*`\n - The result must fit in an `int256` type." + }, + "id": 7074, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "parseInt", + "nameLocation": "7895:8:49", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 7051, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 7046, + "mutability": "mutable", + "name": "input", + "nameLocation": "7918:5:49", + "nodeType": "VariableDeclaration", + "scope": 7074, + "src": "7904:19:49", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 7045, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "7904:6:49", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 7048, + "mutability": "mutable", + "name": "begin", + "nameLocation": "7933:5:49", + "nodeType": "VariableDeclaration", + "scope": 7074, + "src": "7925:13:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 7047, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "7925:7:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 7050, + "mutability": "mutable", + "name": "end", + "nameLocation": "7948:3:49", + "nodeType": "VariableDeclaration", + "scope": 7074, + "src": "7940:11:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 7049, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "7940:7:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "7903:49:49" + }, + "returnParameters": { + "id": 7054, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 7053, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 7074, + "src": "7976:6:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "typeName": { + "id": 7052, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "7976:6:49", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "visibility": "internal" + } + ], + "src": "7975:8:49" + }, + "scope": 7883, + "src": "7886:249:49", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 7094, + "nodeType": "Block", + "src": "8526:82:49", + "statements": [ + { + "expression": { + "arguments": [ + { + "id": 7085, + "name": "input", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7077, + "src": "8571:5:49", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + }, + { + "hexValue": "30", + "id": 7086, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8578:1:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + { + "expression": { + "arguments": [ + { + "id": 7089, + "name": "input", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7077, + "src": "8587:5:49", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + ], + "id": 7088, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "8581:5:49", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes_storage_ptr_$", + "typeString": "type(bytes storage pointer)" + }, + "typeName": { + "id": 7087, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "8581:5:49", + "typeDescriptions": {} + } + }, + "id": 7090, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "8581:12:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 7091, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "8594:6:49", + "memberName": "length", + "nodeType": "MemberAccess", + "src": "8581:19:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + }, + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 7084, + "name": "_tryParseIntUncheckedBounds", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7258, + "src": "8543:27:49", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_string_memory_ptr_$_t_uint256_$_t_uint256_$returns$_t_bool_$_t_int256_$", + "typeString": "function (string memory,uint256,uint256) pure returns (bool,int256)" + } + }, + "id": 7092, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "8543:58:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_bool_$_t_int256_$", + "typeString": "tuple(bool,int256)" + } + }, + "functionReturnParameters": 7083, + "id": 7093, + "nodeType": "Return", + "src": "8536:65:49" + } + ] + }, + "documentation": { + "id": 7075, + "nodeType": "StructuredDocumentation", + "src": "8141:287:49", + "text": " @dev Variant of {parseInt-string} that returns false if the parsing fails because of an invalid character or if\n the result does not fit in a `int256`.\n NOTE: This function will revert if the absolute value of the result does not fit in a `uint256`." + }, + "id": 7095, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "tryParseInt", + "nameLocation": "8442:11:49", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 7078, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 7077, + "mutability": "mutable", + "name": "input", + "nameLocation": "8468:5:49", + "nodeType": "VariableDeclaration", + "scope": 7095, + "src": "8454:19:49", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 7076, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "8454:6:49", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "visibility": "internal" + } + ], + "src": "8453:21:49" + }, + "returnParameters": { + "id": 7083, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 7080, + "mutability": "mutable", + "name": "success", + "nameLocation": "8503:7:49", + "nodeType": "VariableDeclaration", + "scope": 7095, + "src": "8498:12:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 7079, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "8498:4:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 7082, + "mutability": "mutable", + "name": "value", + "nameLocation": "8519:5:49", + "nodeType": "VariableDeclaration", + "scope": 7095, + "src": "8512:12:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "typeName": { + "id": 7081, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "8512:6:49", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "visibility": "internal" + } + ], + "src": "8497:28:49" + }, + "scope": 7883, + "src": "8433:175:49", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "constant": true, + "id": 7100, + "mutability": "constant", + "name": "ABS_MIN_INT256", + "nameLocation": "8639:14:49", + "nodeType": "VariableDeclaration", + "scope": 7883, + "src": "8614:50:49", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 7096, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "8614:7:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": { + "commonType": { + "typeIdentifier": "t_rational_57896044618658097711785492504343953926634992332820282019728792003956564819968_by_1", + "typeString": "int_const 5789...(69 digits omitted)...9968" + }, + "id": 7099, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "leftExpression": { + "hexValue": "32", + "id": 7097, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8656:1:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_2_by_1", + "typeString": "int_const 2" + }, + "value": "2" + }, + "nodeType": "BinaryOperation", + "operator": "**", + "rightExpression": { + "hexValue": "323535", + "id": 7098, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8661:3:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_255_by_1", + "typeString": "int_const 255" + }, + "value": "255" + }, + "src": "8656:8:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_57896044618658097711785492504343953926634992332820282019728792003956564819968_by_1", + "typeString": "int_const 5789...(69 digits omitted)...9968" + } + }, + "visibility": "private" + }, + { + "body": { + "id": 7136, + "nodeType": "Block", + "src": "9130:143:49", + "statements": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 7124, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 7120, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 7114, + "name": "end", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7107, + "src": "9144:3:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "expression": { + "arguments": [ + { + "id": 7117, + "name": "input", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7103, + "src": "9156:5:49", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + ], + "id": 7116, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "9150:5:49", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes_storage_ptr_$", + "typeString": "type(bytes storage pointer)" + }, + "typeName": { + "id": 7115, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "9150:5:49", + "typeDescriptions": {} + } + }, + "id": 7118, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "9150:12:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 7119, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "9163:6:49", + "memberName": "length", + "nodeType": "MemberAccess", + "src": "9150:19:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "9144:25:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "||", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 7123, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 7121, + "name": "begin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7105, + "src": "9173:5:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "id": 7122, + "name": "end", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7107, + "src": "9181:3:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "9173:11:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "9144:40:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 7129, + "nodeType": "IfStatement", + "src": "9140:63:49", + "trueBody": { + "expression": { + "components": [ + { + "hexValue": "66616c7365", + "id": 7125, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "9194:5:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + }, + { + "hexValue": "30", + "id": 7126, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "9201:1:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "id": 7127, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "9193:10:49", + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_bool_$_t_rational_0_by_1_$", + "typeString": "tuple(bool,int_const 0)" + } + }, + "functionReturnParameters": 7113, + "id": 7128, + "nodeType": "Return", + "src": "9186:17:49" + } + }, + { + "expression": { + "arguments": [ + { + "id": 7131, + "name": "input", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7103, + "src": "9248:5:49", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + }, + { + "id": 7132, + "name": "begin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7105, + "src": "9255:5:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 7133, + "name": "end", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7107, + "src": "9262:3:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 7130, + "name": "_tryParseIntUncheckedBounds", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7258, + "src": "9220:27:49", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_string_memory_ptr_$_t_uint256_$_t_uint256_$returns$_t_bool_$_t_int256_$", + "typeString": "function (string memory,uint256,uint256) pure returns (bool,int256)" + } + }, + "id": 7134, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "9220:46:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_bool_$_t_int256_$", + "typeString": "tuple(bool,int256)" + } + }, + "functionReturnParameters": 7113, + "id": 7135, + "nodeType": "Return", + "src": "9213:53:49" + } + ] + }, + "documentation": { + "id": 7101, + "nodeType": "StructuredDocumentation", + "src": "8671:303:49", + "text": " @dev Variant of {parseInt-string-uint256-uint256} that returns false if the parsing fails because of an invalid\n character or if the result does not fit in a `int256`.\n NOTE: This function will revert if the absolute value of the result does not fit in a `uint256`." + }, + "id": 7137, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "tryParseInt", + "nameLocation": "8988:11:49", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 7108, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 7103, + "mutability": "mutable", + "name": "input", + "nameLocation": "9023:5:49", + "nodeType": "VariableDeclaration", + "scope": 7137, + "src": "9009:19:49", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 7102, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "9009:6:49", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 7105, + "mutability": "mutable", + "name": "begin", + "nameLocation": "9046:5:49", + "nodeType": "VariableDeclaration", + "scope": 7137, + "src": "9038:13:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 7104, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "9038:7:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 7107, + "mutability": "mutable", + "name": "end", + "nameLocation": "9069:3:49", + "nodeType": "VariableDeclaration", + "scope": 7137, + "src": "9061:11:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 7106, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "9061:7:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "8999:79:49" + }, + "returnParameters": { + "id": 7113, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 7110, + "mutability": "mutable", + "name": "success", + "nameLocation": "9107:7:49", + "nodeType": "VariableDeclaration", + "scope": 7137, + "src": "9102:12:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 7109, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "9102:4:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 7112, + "mutability": "mutable", + "name": "value", + "nameLocation": "9123:5:49", + "nodeType": "VariableDeclaration", + "scope": 7137, + "src": "9116:12:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "typeName": { + "id": 7111, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "9116:6:49", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "visibility": "internal" + } + ], + "src": "9101:28:49" + }, + "scope": 7883, + "src": "8979:294:49", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 7257, + "nodeType": "Block", + "src": "9673:812:49", + "statements": [ + { + "assignments": [ + 7152 + ], + "declarations": [ + { + "constant": false, + "id": 7152, + "mutability": "mutable", + "name": "buffer", + "nameLocation": "9696:6:49", + "nodeType": "VariableDeclaration", + "scope": 7257, + "src": "9683:19:49", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 7151, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "9683:5:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "id": 7157, + "initialValue": { + "arguments": [ + { + "id": 7155, + "name": "input", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7140, + "src": "9711:5:49", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + ], + "id": 7154, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "9705:5:49", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes_storage_ptr_$", + "typeString": "type(bytes storage pointer)" + }, + "typeName": { + "id": 7153, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "9705:5:49", + "typeDescriptions": {} + } + }, + "id": 7156, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "9705:12:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "9683:34:49" + }, + { + "assignments": [ + 7159 + ], + "declarations": [ + { + "constant": false, + "id": 7159, + "mutability": "mutable", + "name": "sign", + "nameLocation": "9781:4:49", + "nodeType": "VariableDeclaration", + "scope": 7257, + "src": "9774:11:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + }, + "typeName": { + "id": 7158, + "name": "bytes1", + "nodeType": "ElementaryTypeName", + "src": "9774:6:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + "visibility": "internal" + } + ], + "id": 7175, + "initialValue": { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 7162, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 7160, + "name": "begin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7142, + "src": "9788:5:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "id": 7161, + "name": "end", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7144, + "src": "9797:3:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "9788:12:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseExpression": { + "arguments": [ + { + "arguments": [ + { + "id": 7170, + "name": "buffer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7152, + "src": "9845:6:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + { + "id": 7171, + "name": "begin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7142, + "src": "9853:5:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 7169, + "name": "_unsafeReadBytesOffset", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7882, + "src": "9822:22:49", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$_t_uint256_$returns$_t_bytes32_$", + "typeString": "function (bytes memory,uint256) pure returns (bytes32)" + } + }, + "id": 7172, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "9822:37:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 7168, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "9815:6:49", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes1_$", + "typeString": "type(bytes1)" + }, + "typeName": { + "id": 7167, + "name": "bytes1", + "nodeType": "ElementaryTypeName", + "src": "9815:6:49", + "typeDescriptions": {} + } + }, + "id": 7173, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "9815:45:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + "id": 7174, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "Conditional", + "src": "9788:72:49", + "trueExpression": { + "arguments": [ + { + "hexValue": "30", + "id": 7165, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "9810:1:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 7164, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "9803:6:49", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes1_$", + "typeString": "type(bytes1)" + }, + "typeName": { + "id": 7163, + "name": "bytes1", + "nodeType": "ElementaryTypeName", + "src": "9803:6:49", + "typeDescriptions": {} + } + }, + "id": 7166, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "9803:9:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "9774:86:49" + }, + { + "assignments": [ + 7177 + ], + "declarations": [ + { + "constant": false, + "id": 7177, + "mutability": "mutable", + "name": "positiveSign", + "nameLocation": "9946:12:49", + "nodeType": "VariableDeclaration", + "scope": 7257, + "src": "9941:17:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 7176, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "9941:4:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "id": 7184, + "initialValue": { + "commonType": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + }, + "id": 7183, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 7178, + "name": "sign", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7159, + "src": "9961:4:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "arguments": [ + { + "hexValue": "2b", + "id": 7181, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "9976:3:49", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_728b8dbbe730d9acd55e30e768e6a28a04bea0c61b88108287c2c87d79c98bb8", + "typeString": "literal_string \"+\"" + }, + "value": "+" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_stringliteral_728b8dbbe730d9acd55e30e768e6a28a04bea0c61b88108287c2c87d79c98bb8", + "typeString": "literal_string \"+\"" + } + ], + "id": 7180, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "9969:6:49", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes1_$", + "typeString": "type(bytes1)" + }, + "typeName": { + "id": 7179, + "name": "bytes1", + "nodeType": "ElementaryTypeName", + "src": "9969:6:49", + "typeDescriptions": {} + } + }, + "id": 7182, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "9969:11:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + "src": "9961:19:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "9941:39:49" + }, + { + "assignments": [ + 7186 + ], + "declarations": [ + { + "constant": false, + "id": 7186, + "mutability": "mutable", + "name": "negativeSign", + "nameLocation": "9995:12:49", + "nodeType": "VariableDeclaration", + "scope": 7257, + "src": "9990:17:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 7185, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "9990:4:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "id": 7193, + "initialValue": { + "commonType": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + }, + "id": 7192, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 7187, + "name": "sign", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7159, + "src": "10010:4:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "arguments": [ + { + "hexValue": "2d", + "id": 7190, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10025:3:49", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_d3b8281179950f98149eefdb158d0e1acb56f56e8e343aa9fefafa7e36959561", + "typeString": "literal_string \"-\"" + }, + "value": "-" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_stringliteral_d3b8281179950f98149eefdb158d0e1acb56f56e8e343aa9fefafa7e36959561", + "typeString": "literal_string \"-\"" + } + ], + "id": 7189, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "10018:6:49", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes1_$", + "typeString": "type(bytes1)" + }, + "typeName": { + "id": 7188, + "name": "bytes1", + "nodeType": "ElementaryTypeName", + "src": "10018:6:49", + "typeDescriptions": {} + } + }, + "id": 7191, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "10018:11:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + "src": "10010:19:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "9990:39:49" + }, + { + "assignments": [ + 7195 + ], + "declarations": [ + { + "constant": false, + "id": 7195, + "mutability": "mutable", + "name": "offset", + "nameLocation": "10047:6:49", + "nodeType": "VariableDeclaration", + "scope": 7257, + "src": "10039:14:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 7194, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "10039:7:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 7202, + "initialValue": { + "arguments": [], + "expression": { + "argumentTypes": [], + "expression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 7198, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 7196, + "name": "positiveSign", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7177, + "src": "10057:12:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "||", + "rightExpression": { + "id": 7197, + "name": "negativeSign", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7186, + "src": "10073:12:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "10057:28:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "id": 7199, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "10056:30:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 7200, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "10087:6:49", + "memberName": "toUint", + "nodeType": "MemberAccess", + "referencedDeclaration": 11702, + "src": "10056:37:49", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_bool_$returns$_t_uint256_$attached_to$_t_bool_$", + "typeString": "function (bool) pure returns (uint256)" + } + }, + "id": 7201, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "10056:39:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "10039:56:49" + }, + { + "assignments": [ + 7204, + 7206 + ], + "declarations": [ + { + "constant": false, + "id": 7204, + "mutability": "mutable", + "name": "absSuccess", + "nameLocation": "10112:10:49", + "nodeType": "VariableDeclaration", + "scope": 7257, + "src": "10107:15:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 7203, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "10107:4:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 7206, + "mutability": "mutable", + "name": "absValue", + "nameLocation": "10132:8:49", + "nodeType": "VariableDeclaration", + "scope": 7257, + "src": "10124:16:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 7205, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "10124:7:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 7214, + "initialValue": { + "arguments": [ + { + "id": 7208, + "name": "input", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7140, + "src": "10157:5:49", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + }, + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 7211, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 7209, + "name": "begin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7142, + "src": "10164:5:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "id": 7210, + "name": "offset", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7195, + "src": "10172:6:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "10164:14:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 7212, + "name": "end", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7144, + "src": "10180:3:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 7207, + "name": "tryParseUint", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 6917, + 6954 + ], + "referencedDeclaration": 6954, + "src": "10144:12:49", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_string_memory_ptr_$_t_uint256_$_t_uint256_$returns$_t_bool_$_t_uint256_$", + "typeString": "function (string memory,uint256,uint256) pure returns (bool,uint256)" + } + }, + "id": 7213, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "10144:40:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_bool_$_t_uint256_$", + "typeString": "tuple(bool,uint256)" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "10106:78:49" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 7219, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 7215, + "name": "absSuccess", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7204, + "src": "10199:10:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "&&", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 7218, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 7216, + "name": "absValue", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7206, + "src": "10213:8:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "id": 7217, + "name": "ABS_MIN_INT256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7100, + "src": "10224:14:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "10213:25:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "10199:39:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "condition": { + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 7241, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 7237, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 7235, + "name": "absSuccess", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7204, + "src": "10341:10:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "&&", + "rightExpression": { + "id": 7236, + "name": "negativeSign", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7186, + "src": "10355:12:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "10341:26:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "&&", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 7240, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 7238, + "name": "absValue", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7206, + "src": "10371:8:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "id": 7239, + "name": "ABS_MIN_INT256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7100, + "src": "10383:14:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "10371:26:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "10341:56:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "expression": { + "components": [ + { + "hexValue": "66616c7365", + "id": 7251, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10469:5:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + }, + { + "hexValue": "30", + "id": 7252, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10476:1:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "id": 7253, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "10468:10:49", + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_bool_$_t_rational_0_by_1_$", + "typeString": "tuple(bool,int_const 0)" + } + }, + "functionReturnParameters": 7150, + "id": 7254, + "nodeType": "Return", + "src": "10461:17:49" + }, + "id": 7255, + "nodeType": "IfStatement", + "src": "10337:141:49", + "trueBody": { + "id": 7250, + "nodeType": "Block", + "src": "10399:56:49", + "statements": [ + { + "expression": { + "components": [ + { + "hexValue": "74727565", + "id": 7242, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10421:4:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "true" + }, + { + "expression": { + "arguments": [ + { + "id": 7245, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "10432:6:49", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_int256_$", + "typeString": "type(int256)" + }, + "typeName": { + "id": 7244, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "10432:6:49", + "typeDescriptions": {} + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_type$_t_int256_$", + "typeString": "type(int256)" + } + ], + "id": 7243, + "name": "type", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -27, + "src": "10427:4:49", + "typeDescriptions": { + "typeIdentifier": "t_function_metatype_pure$__$returns$__$", + "typeString": "function () pure" + } + }, + "id": 7246, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "10427:12:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_magic_meta_type_t_int256", + "typeString": "type(int256)" + } + }, + "id": 7247, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "10440:3:49", + "memberName": "min", + "nodeType": "MemberAccess", + "src": "10427:16:49", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "id": 7248, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "10420:24:49", + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_bool_$_t_int256_$", + "typeString": "tuple(bool,int256)" + } + }, + "functionReturnParameters": 7150, + "id": 7249, + "nodeType": "Return", + "src": "10413:31:49" + } + ] + } + }, + "id": 7256, + "nodeType": "IfStatement", + "src": "10195:283:49", + "trueBody": { + "id": 7234, + "nodeType": "Block", + "src": "10240:91:49", + "statements": [ + { + "expression": { + "components": [ + { + "hexValue": "74727565", + "id": 7220, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10262:4:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "true" + }, + { + "condition": { + "id": 7221, + "name": "negativeSign", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7186, + "src": "10268:12:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseExpression": { + "arguments": [ + { + "id": 7229, + "name": "absValue", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7206, + "src": "10310:8:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 7228, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "10303:6:49", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_int256_$", + "typeString": "type(int256)" + }, + "typeName": { + "id": 7227, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "10303:6:49", + "typeDescriptions": {} + } + }, + "id": 7230, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "10303:16:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "id": 7231, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "Conditional", + "src": "10268:51:49", + "trueExpression": { + "id": 7226, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "-", + "prefix": true, + "src": "10283:17:49", + "subExpression": { + "arguments": [ + { + "id": 7224, + "name": "absValue", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7206, + "src": "10291:8:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 7223, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "10284:6:49", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_int256_$", + "typeString": "type(int256)" + }, + "typeName": { + "id": 7222, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "10284:6:49", + "typeDescriptions": {} + } + }, + "id": 7225, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "10284:16:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "id": 7232, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "10261:59:49", + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_bool_$_t_int256_$", + "typeString": "tuple(bool,int256)" + } + }, + "functionReturnParameters": 7150, + "id": 7233, + "nodeType": "Return", + "src": "10254:66:49" + } + ] + } + } + ] + }, + "documentation": { + "id": 7138, + "nodeType": "StructuredDocumentation", + "src": "9279:223:49", + "text": " @dev Implementation of {tryParseInt-string-uint256-uint256} that does not check bounds. Caller should make sure that\n `begin <= end <= input.length`. Other inputs would result in undefined behavior." + }, + "id": 7258, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_tryParseIntUncheckedBounds", + "nameLocation": "9516:27:49", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 7145, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 7140, + "mutability": "mutable", + "name": "input", + "nameLocation": "9567:5:49", + "nodeType": "VariableDeclaration", + "scope": 7258, + "src": "9553:19:49", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 7139, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "9553:6:49", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 7142, + "mutability": "mutable", + "name": "begin", + "nameLocation": "9590:5:49", + "nodeType": "VariableDeclaration", + "scope": 7258, + "src": "9582:13:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 7141, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "9582:7:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 7144, + "mutability": "mutable", + "name": "end", + "nameLocation": "9613:3:49", + "nodeType": "VariableDeclaration", + "scope": 7258, + "src": "9605:11:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 7143, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "9605:7:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "9543:79:49" + }, + "returnParameters": { + "id": 7150, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 7147, + "mutability": "mutable", + "name": "success", + "nameLocation": "9650:7:49", + "nodeType": "VariableDeclaration", + "scope": 7258, + "src": "9645:12:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 7146, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "9645:4:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 7149, + "mutability": "mutable", + "name": "value", + "nameLocation": "9666:5:49", + "nodeType": "VariableDeclaration", + "scope": 7258, + "src": "9659:12:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "typeName": { + "id": 7148, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "9659:6:49", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "visibility": "internal" + } + ], + "src": "9644:28:49" + }, + "scope": 7883, + "src": "9507:978:49", + "stateMutability": "pure", + "virtual": false, + "visibility": "private" + }, + { + "body": { + "id": 7276, + "nodeType": "Block", + "src": "10830:67:49", + "statements": [ + { + "expression": { + "arguments": [ + { + "id": 7267, + "name": "input", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7261, + "src": "10860:5:49", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + }, + { + "hexValue": "30", + "id": 7268, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10867:1:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + { + "expression": { + "arguments": [ + { + "id": 7271, + "name": "input", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7261, + "src": "10876:5:49", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + ], + "id": 7270, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "10870:5:49", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes_storage_ptr_$", + "typeString": "type(bytes storage pointer)" + }, + "typeName": { + "id": 7269, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "10870:5:49", + "typeDescriptions": {} + } + }, + "id": 7272, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "10870:12:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 7273, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "10883:6:49", + "memberName": "length", + "nodeType": "MemberAccess", + "src": "10870:19:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + }, + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 7266, + "name": "parseHexUint", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 7277, + 7308 + ], + "referencedDeclaration": 7308, + "src": "10847:12:49", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_string_memory_ptr_$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (string memory,uint256,uint256) pure returns (uint256)" + } + }, + "id": 7274, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "10847:43:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 7265, + "id": 7275, + "nodeType": "Return", + "src": "10840:50:49" + } + ] + }, + "documentation": { + "id": 7259, + "nodeType": "StructuredDocumentation", + "src": "10491:259:49", + "text": " @dev Parse a hexadecimal string (with or without \"0x\" prefix), and returns the value as a `uint256`.\n Requirements:\n - The string must be formatted as `(0x)?[0-9a-fA-F]*`\n - The result must fit in an `uint256` type." + }, + "id": 7277, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "parseHexUint", + "nameLocation": "10764:12:49", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 7262, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 7261, + "mutability": "mutable", + "name": "input", + "nameLocation": "10791:5:49", + "nodeType": "VariableDeclaration", + "scope": 7277, + "src": "10777:19:49", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 7260, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "10777:6:49", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "visibility": "internal" + } + ], + "src": "10776:21:49" + }, + "returnParameters": { + "id": 7265, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 7264, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 7277, + "src": "10821:7:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 7263, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "10821:7:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "10820:9:49" + }, + "scope": 7883, + "src": "10755:142:49", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 7307, + "nodeType": "Block", + "src": "11318:156:49", + "statements": [ + { + "assignments": [ + 7290, + 7292 + ], + "declarations": [ + { + "constant": false, + "id": 7290, + "mutability": "mutable", + "name": "success", + "nameLocation": "11334:7:49", + "nodeType": "VariableDeclaration", + "scope": 7307, + "src": "11329:12:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 7289, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "11329:4:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 7292, + "mutability": "mutable", + "name": "value", + "nameLocation": "11351:5:49", + "nodeType": "VariableDeclaration", + "scope": 7307, + "src": "11343:13:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 7291, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "11343:7:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 7298, + "initialValue": { + "arguments": [ + { + "id": 7294, + "name": "input", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7280, + "src": "11376:5:49", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + }, + { + "id": 7295, + "name": "begin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7282, + "src": "11383:5:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 7296, + "name": "end", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7284, + "src": "11390:3:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 7293, + "name": "tryParseHexUint", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 7329, + 7366 + ], + "referencedDeclaration": 7366, + "src": "11360:15:49", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_string_memory_ptr_$_t_uint256_$_t_uint256_$returns$_t_bool_$_t_uint256_$", + "typeString": "function (string memory,uint256,uint256) pure returns (bool,uint256)" + } + }, + "id": 7297, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "11360:34:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_bool_$_t_uint256_$", + "typeString": "tuple(bool,uint256)" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "11328:66:49" + }, + { + "condition": { + "id": 7300, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "11408:8:49", + "subExpression": { + "id": 7299, + "name": "success", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7290, + "src": "11409:7:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 7304, + "nodeType": "IfStatement", + "src": "11404:41:49", + "trueBody": { + "errorCall": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 7301, + "name": "StringsInvalidChar", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6544, + "src": "11425:18:49", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$__$returns$_t_error_$", + "typeString": "function () pure returns (error)" + } + }, + "id": 7302, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "11425:20:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 7303, + "nodeType": "RevertStatement", + "src": "11418:27:49" + } + }, + { + "expression": { + "id": 7305, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7292, + "src": "11462:5:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 7288, + "id": 7306, + "nodeType": "Return", + "src": "11455:12:49" + } + ] + }, + "documentation": { + "id": 7278, + "nodeType": "StructuredDocumentation", + "src": "10903:307:49", + "text": " @dev Variant of {parseHexUint-string} that parses a substring of `input` located between position `begin` (included) and\n `end` (excluded).\n Requirements:\n - The substring must be formatted as `(0x)?[0-9a-fA-F]*`\n - The result must fit in an `uint256` type." + }, + "id": 7308, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "parseHexUint", + "nameLocation": "11224:12:49", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 7285, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 7280, + "mutability": "mutable", + "name": "input", + "nameLocation": "11251:5:49", + "nodeType": "VariableDeclaration", + "scope": 7308, + "src": "11237:19:49", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 7279, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "11237:6:49", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 7282, + "mutability": "mutable", + "name": "begin", + "nameLocation": "11266:5:49", + "nodeType": "VariableDeclaration", + "scope": 7308, + "src": "11258:13:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 7281, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "11258:7:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 7284, + "mutability": "mutable", + "name": "end", + "nameLocation": "11281:3:49", + "nodeType": "VariableDeclaration", + "scope": 7308, + "src": "11273:11:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 7283, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "11273:7:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "11236:49:49" + }, + "returnParameters": { + "id": 7288, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 7287, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 7308, + "src": "11309:7:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 7286, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "11309:7:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "11308:9:49" + }, + "scope": 7883, + "src": "11215:259:49", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 7328, + "nodeType": "Block", + "src": "11801:86:49", + "statements": [ + { + "expression": { + "arguments": [ + { + "id": 7319, + "name": "input", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7311, + "src": "11850:5:49", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + }, + { + "hexValue": "30", + "id": 7320, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "11857:1:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + { + "expression": { + "arguments": [ + { + "id": 7323, + "name": "input", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7311, + "src": "11866:5:49", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + ], + "id": 7322, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "11860:5:49", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes_storage_ptr_$", + "typeString": "type(bytes storage pointer)" + }, + "typeName": { + "id": 7321, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "11860:5:49", + "typeDescriptions": {} + } + }, + "id": 7324, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "11860:12:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 7325, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "11873:6:49", + "memberName": "length", + "nodeType": "MemberAccess", + "src": "11860:19:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + }, + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 7318, + "name": "_tryParseHexUintUncheckedBounds", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7469, + "src": "11818:31:49", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_string_memory_ptr_$_t_uint256_$_t_uint256_$returns$_t_bool_$_t_uint256_$", + "typeString": "function (string memory,uint256,uint256) pure returns (bool,uint256)" + } + }, + "id": 7326, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "11818:62:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_bool_$_t_uint256_$", + "typeString": "tuple(bool,uint256)" + } + }, + "functionReturnParameters": 7317, + "id": 7327, + "nodeType": "Return", + "src": "11811:69:49" + } + ] + }, + "documentation": { + "id": 7309, + "nodeType": "StructuredDocumentation", + "src": "11480:218:49", + "text": " @dev Variant of {parseHexUint-string} that returns false if the parsing fails because of an invalid character.\n NOTE: This function will revert if the result does not fit in a `uint256`." + }, + "id": 7329, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "tryParseHexUint", + "nameLocation": "11712:15:49", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 7312, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 7311, + "mutability": "mutable", + "name": "input", + "nameLocation": "11742:5:49", + "nodeType": "VariableDeclaration", + "scope": 7329, + "src": "11728:19:49", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 7310, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "11728:6:49", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "visibility": "internal" + } + ], + "src": "11727:21:49" + }, + "returnParameters": { + "id": 7317, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 7314, + "mutability": "mutable", + "name": "success", + "nameLocation": "11777:7:49", + "nodeType": "VariableDeclaration", + "scope": 7329, + "src": "11772:12:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 7313, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "11772:4:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 7316, + "mutability": "mutable", + "name": "value", + "nameLocation": "11794:5:49", + "nodeType": "VariableDeclaration", + "scope": 7329, + "src": "11786:13:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 7315, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "11786:7:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "11771:29:49" + }, + "scope": 7883, + "src": "11703:184:49", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 7365, + "nodeType": "Block", + "src": "12295:147:49", + "statements": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 7353, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 7349, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 7343, + "name": "end", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7336, + "src": "12309:3:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "expression": { + "arguments": [ + { + "id": 7346, + "name": "input", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7332, + "src": "12321:5:49", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + ], + "id": 7345, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "12315:5:49", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes_storage_ptr_$", + "typeString": "type(bytes storage pointer)" + }, + "typeName": { + "id": 7344, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "12315:5:49", + "typeDescriptions": {} + } + }, + "id": 7347, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "12315:12:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 7348, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "12328:6:49", + "memberName": "length", + "nodeType": "MemberAccess", + "src": "12315:19:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "12309:25:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "||", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 7352, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 7350, + "name": "begin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7334, + "src": "12338:5:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "id": 7351, + "name": "end", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7336, + "src": "12346:3:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "12338:11:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "12309:40:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 7358, + "nodeType": "IfStatement", + "src": "12305:63:49", + "trueBody": { + "expression": { + "components": [ + { + "hexValue": "66616c7365", + "id": 7354, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12359:5:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + }, + { + "hexValue": "30", + "id": 7355, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12366:1:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "id": 7356, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "12358:10:49", + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_bool_$_t_rational_0_by_1_$", + "typeString": "tuple(bool,int_const 0)" + } + }, + "functionReturnParameters": 7342, + "id": 7357, + "nodeType": "Return", + "src": "12351:17:49" + } + }, + { + "expression": { + "arguments": [ + { + "id": 7360, + "name": "input", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7332, + "src": "12417:5:49", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + }, + { + "id": 7361, + "name": "begin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7334, + "src": "12424:5:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 7362, + "name": "end", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7336, + "src": "12431:3:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 7359, + "name": "_tryParseHexUintUncheckedBounds", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7469, + "src": "12385:31:49", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_string_memory_ptr_$_t_uint256_$_t_uint256_$returns$_t_bool_$_t_uint256_$", + "typeString": "function (string memory,uint256,uint256) pure returns (bool,uint256)" + } + }, + "id": 7363, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "12385:50:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_bool_$_t_uint256_$", + "typeString": "tuple(bool,uint256)" + } + }, + "functionReturnParameters": 7342, + "id": 7364, + "nodeType": "Return", + "src": "12378:57:49" + } + ] + }, + "documentation": { + "id": 7330, + "nodeType": "StructuredDocumentation", + "src": "11893:241:49", + "text": " @dev Variant of {parseHexUint-string-uint256-uint256} that returns false if the parsing fails because of an\n invalid character.\n NOTE: This function will revert if the result does not fit in a `uint256`." + }, + "id": 7366, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "tryParseHexUint", + "nameLocation": "12148:15:49", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 7337, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 7332, + "mutability": "mutable", + "name": "input", + "nameLocation": "12187:5:49", + "nodeType": "VariableDeclaration", + "scope": 7366, + "src": "12173:19:49", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 7331, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "12173:6:49", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 7334, + "mutability": "mutable", + "name": "begin", + "nameLocation": "12210:5:49", + "nodeType": "VariableDeclaration", + "scope": 7366, + "src": "12202:13:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 7333, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "12202:7:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 7336, + "mutability": "mutable", + "name": "end", + "nameLocation": "12233:3:49", + "nodeType": "VariableDeclaration", + "scope": 7366, + "src": "12225:11:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 7335, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "12225:7:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "12163:79:49" + }, + "returnParameters": { + "id": 7342, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 7339, + "mutability": "mutable", + "name": "success", + "nameLocation": "12271:7:49", + "nodeType": "VariableDeclaration", + "scope": 7366, + "src": "12266:12:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 7338, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "12266:4:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 7341, + "mutability": "mutable", + "name": "value", + "nameLocation": "12288:5:49", + "nodeType": "VariableDeclaration", + "scope": 7366, + "src": "12280:13:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 7340, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "12280:7:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "12265:29:49" + }, + "scope": 7883, + "src": "12139:303:49", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 7468, + "nodeType": "Block", + "src": "12851:881:49", + "statements": [ + { + "assignments": [ + 7381 + ], + "declarations": [ + { + "constant": false, + "id": 7381, + "mutability": "mutable", + "name": "buffer", + "nameLocation": "12874:6:49", + "nodeType": "VariableDeclaration", + "scope": 7468, + "src": "12861:19:49", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 7380, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "12861:5:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "id": 7386, + "initialValue": { + "arguments": [ + { + "id": 7384, + "name": "input", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7369, + "src": "12889:5:49", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + ], + "id": 7383, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "12883:5:49", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes_storage_ptr_$", + "typeString": "type(bytes storage pointer)" + }, + "typeName": { + "id": 7382, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "12883:5:49", + "typeDescriptions": {} + } + }, + "id": 7385, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "12883:12:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "12861:34:49" + }, + { + "assignments": [ + 7388 + ], + "declarations": [ + { + "constant": false, + "id": 7388, + "mutability": "mutable", + "name": "hasPrefix", + "nameLocation": "12948:9:49", + "nodeType": "VariableDeclaration", + "scope": 7468, + "src": "12943:14:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 7387, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "12943:4:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "id": 7408, + "initialValue": { + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 7407, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 7393, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 7389, + "name": "end", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7373, + "src": "12961:3:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 7392, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 7390, + "name": "begin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7371, + "src": "12967:5:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "hexValue": "31", + "id": 7391, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12975:1:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "12967:9:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "12961:15:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "id": 7394, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "12960:17:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "&&", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_bytes2", + "typeString": "bytes2" + }, + "id": 7406, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "arguments": [ + { + "arguments": [ + { + "id": 7398, + "name": "buffer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7381, + "src": "13011:6:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + { + "id": 7399, + "name": "begin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7371, + "src": "13019:5:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 7397, + "name": "_unsafeReadBytesOffset", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7882, + "src": "12988:22:49", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$_t_uint256_$returns$_t_bytes32_$", + "typeString": "function (bytes memory,uint256) pure returns (bytes32)" + } + }, + "id": 7400, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "12988:37:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 7396, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "12981:6:49", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes2_$", + "typeString": "type(bytes2)" + }, + "typeName": { + "id": 7395, + "name": "bytes2", + "nodeType": "ElementaryTypeName", + "src": "12981:6:49", + "typeDescriptions": {} + } + }, + "id": 7401, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "12981:45:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes2", + "typeString": "bytes2" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "arguments": [ + { + "hexValue": "3078", + "id": 7404, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13037:4:49", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_39bef1777deb3dfb14f64b9f81ced092c501fee72f90e93d03bb95ee89df9837", + "typeString": "literal_string \"0x\"" + }, + "value": "0x" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_stringliteral_39bef1777deb3dfb14f64b9f81ced092c501fee72f90e93d03bb95ee89df9837", + "typeString": "literal_string \"0x\"" + } + ], + "id": 7403, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "13030:6:49", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes2_$", + "typeString": "type(bytes2)" + }, + "typeName": { + "id": 7402, + "name": "bytes2", + "nodeType": "ElementaryTypeName", + "src": "13030:6:49", + "typeDescriptions": {} + } + }, + "id": 7405, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "13030:12:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes2", + "typeString": "bytes2" + } + }, + "src": "12981:61:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "12960:82:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "12943:99:49" + }, + { + "assignments": [ + 7410 + ], + "declarations": [ + { + "constant": false, + "id": 7410, + "mutability": "mutable", + "name": "offset", + "nameLocation": "13131:6:49", + "nodeType": "VariableDeclaration", + "scope": 7468, + "src": "13123:14:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 7409, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "13123:7:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 7416, + "initialValue": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 7415, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "expression": { + "id": 7411, + "name": "hasPrefix", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7388, + "src": "13140:9:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 7412, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "13150:6:49", + "memberName": "toUint", + "nodeType": "MemberAccess", + "referencedDeclaration": 11702, + "src": "13140:16:49", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_bool_$returns$_t_uint256_$attached_to$_t_bool_$", + "typeString": "function (bool) pure returns (uint256)" + } + }, + "id": 7413, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "13140:18:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "*", + "rightExpression": { + "hexValue": "32", + "id": 7414, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13161:1:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_2_by_1", + "typeString": "int_const 2" + }, + "value": "2" + }, + "src": "13140:22:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "13123:39:49" + }, + { + "assignments": [ + 7418 + ], + "declarations": [ + { + "constant": false, + "id": 7418, + "mutability": "mutable", + "name": "result", + "nameLocation": "13181:6:49", + "nodeType": "VariableDeclaration", + "scope": 7468, + "src": "13173:14:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 7417, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "13173:7:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 7420, + "initialValue": { + "hexValue": "30", + "id": 7419, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13190:1:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "nodeType": "VariableDeclarationStatement", + "src": "13173:18:49" + }, + { + "body": { + "id": 7462, + "nodeType": "Block", + "src": "13248:447:49", + "statements": [ + { + "assignments": [ + 7434 + ], + "declarations": [ + { + "constant": false, + "id": 7434, + "mutability": "mutable", + "name": "chr", + "nameLocation": "13268:3:49", + "nodeType": "VariableDeclaration", + "scope": 7462, + "src": "13262:9:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "typeName": { + "id": 7433, + "name": "uint8", + "nodeType": "ElementaryTypeName", + "src": "13262:5:49", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "visibility": "internal" + } + ], + "id": 7444, + "initialValue": { + "arguments": [ + { + "arguments": [ + { + "arguments": [ + { + "id": 7439, + "name": "buffer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7381, + "src": "13317:6:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + { + "id": 7440, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7422, + "src": "13325:1:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 7438, + "name": "_unsafeReadBytesOffset", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7882, + "src": "13294:22:49", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$_t_uint256_$returns$_t_bytes32_$", + "typeString": "function (bytes memory,uint256) pure returns (bytes32)" + } + }, + "id": 7441, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "13294:33:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 7437, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "13287:6:49", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes1_$", + "typeString": "type(bytes1)" + }, + "typeName": { + "id": 7436, + "name": "bytes1", + "nodeType": "ElementaryTypeName", + "src": "13287:6:49", + "typeDescriptions": {} + } + }, + "id": 7442, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "13287:41:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + ], + "id": 7435, + "name": "_tryParseChr", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7704, + "src": "13274:12:49", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_bytes1_$returns$_t_uint8_$", + "typeString": "function (bytes1) pure returns (uint8)" + } + }, + "id": 7443, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "13274:55:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "13262:67:49" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "id": 7447, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 7445, + "name": "chr", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7434, + "src": "13347:3:49", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "hexValue": "3135", + "id": 7446, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13353:2:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_15_by_1", + "typeString": "int_const 15" + }, + "value": "15" + }, + "src": "13347:8:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 7452, + "nodeType": "IfStatement", + "src": "13343:31:49", + "trueBody": { + "expression": { + "components": [ + { + "hexValue": "66616c7365", + "id": 7448, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13365:5:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + }, + { + "hexValue": "30", + "id": 7449, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13372:1:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "id": 7450, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "13364:10:49", + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_bool_$_t_rational_0_by_1_$", + "typeString": "tuple(bool,int_const 0)" + } + }, + "functionReturnParameters": 7379, + "id": 7451, + "nodeType": "Return", + "src": "13357:17:49" + } + }, + { + "expression": { + "id": 7455, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 7453, + "name": "result", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7418, + "src": "13388:6:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "*=", + "rightHandSide": { + "hexValue": "3136", + "id": 7454, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13398:2:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_16_by_1", + "typeString": "int_const 16" + }, + "value": "16" + }, + "src": "13388:12:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 7456, + "nodeType": "ExpressionStatement", + "src": "13388:12:49" + }, + { + "id": 7461, + "nodeType": "UncheckedBlock", + "src": "13414:271:49", + "statements": [ + { + "expression": { + "id": 7459, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 7457, + "name": "result", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7418, + "src": "13657:6:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "+=", + "rightHandSide": { + "id": 7458, + "name": "chr", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7434, + "src": "13667:3:49", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "src": "13657:13:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 7460, + "nodeType": "ExpressionStatement", + "src": "13657:13:49" + } + ] + } + ] + }, + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 7429, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 7427, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7422, + "src": "13234:1:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "id": 7428, + "name": "end", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7373, + "src": "13238:3:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "13234:7:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 7463, + "initializationExpression": { + "assignments": [ + 7422 + ], + "declarations": [ + { + "constant": false, + "id": 7422, + "mutability": "mutable", + "name": "i", + "nameLocation": "13214:1:49", + "nodeType": "VariableDeclaration", + "scope": 7463, + "src": "13206:9:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 7421, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "13206:7:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 7426, + "initialValue": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 7425, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 7423, + "name": "begin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7371, + "src": "13218:5:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "id": 7424, + "name": "offset", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7410, + "src": "13226:6:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "13218:14:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "13206:26:49" + }, + "isSimpleCounterLoop": true, + "loopExpression": { + "expression": { + "id": 7431, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": true, + "src": "13243:3:49", + "subExpression": { + "id": 7430, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7422, + "src": "13245:1:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 7432, + "nodeType": "ExpressionStatement", + "src": "13243:3:49" + }, + "nodeType": "ForStatement", + "src": "13201:494:49" + }, + { + "expression": { + "components": [ + { + "hexValue": "74727565", + "id": 7464, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13712:4:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "true" + }, + { + "id": 7465, + "name": "result", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7418, + "src": "13718:6:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 7466, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "13711:14:49", + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_bool_$_t_uint256_$", + "typeString": "tuple(bool,uint256)" + } + }, + "functionReturnParameters": 7379, + "id": 7467, + "nodeType": "Return", + "src": "13704:21:49" + } + ] + }, + "documentation": { + "id": 7367, + "nodeType": "StructuredDocumentation", + "src": "12448:227:49", + "text": " @dev Implementation of {tryParseHexUint-string-uint256-uint256} that does not check bounds. Caller should make sure that\n `begin <= end <= input.length`. Other inputs would result in undefined behavior." + }, + "id": 7469, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_tryParseHexUintUncheckedBounds", + "nameLocation": "12689:31:49", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 7374, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 7369, + "mutability": "mutable", + "name": "input", + "nameLocation": "12744:5:49", + "nodeType": "VariableDeclaration", + "scope": 7469, + "src": "12730:19:49", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 7368, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "12730:6:49", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 7371, + "mutability": "mutable", + "name": "begin", + "nameLocation": "12767:5:49", + "nodeType": "VariableDeclaration", + "scope": 7469, + "src": "12759:13:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 7370, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "12759:7:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 7373, + "mutability": "mutable", + "name": "end", + "nameLocation": "12790:3:49", + "nodeType": "VariableDeclaration", + "scope": 7469, + "src": "12782:11:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 7372, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "12782:7:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "12720:79:49" + }, + "returnParameters": { + "id": 7379, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 7376, + "mutability": "mutable", + "name": "success", + "nameLocation": "12827:7:49", + "nodeType": "VariableDeclaration", + "scope": 7469, + "src": "12822:12:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 7375, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "12822:4:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 7378, + "mutability": "mutable", + "name": "value", + "nameLocation": "12844:5:49", + "nodeType": "VariableDeclaration", + "scope": 7469, + "src": "12836:13:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 7377, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "12836:7:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "12821:29:49" + }, + "scope": 7883, + "src": "12680:1052:49", + "stateMutability": "pure", + "virtual": false, + "visibility": "private" + }, + { + "body": { + "id": 7487, + "nodeType": "Block", + "src": "14030:67:49", + "statements": [ + { + "expression": { + "arguments": [ + { + "id": 7478, + "name": "input", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7472, + "src": "14060:5:49", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + }, + { + "hexValue": "30", + "id": 7479, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "14067:1:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + { + "expression": { + "arguments": [ + { + "id": 7482, + "name": "input", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7472, + "src": "14076:5:49", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + ], + "id": 7481, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "14070:5:49", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes_storage_ptr_$", + "typeString": "type(bytes storage pointer)" + }, + "typeName": { + "id": 7480, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "14070:5:49", + "typeDescriptions": {} + } + }, + "id": 7483, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "14070:12:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 7484, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "14083:6:49", + "memberName": "length", + "nodeType": "MemberAccess", + "src": "14070:19:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + }, + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 7477, + "name": "parseAddress", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 7488, + 7519 + ], + "referencedDeclaration": 7519, + "src": "14047:12:49", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_string_memory_ptr_$_t_uint256_$_t_uint256_$returns$_t_address_$", + "typeString": "function (string memory,uint256,uint256) pure returns (address)" + } + }, + "id": 7485, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "14047:43:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "functionReturnParameters": 7476, + "id": 7486, + "nodeType": "Return", + "src": "14040:50:49" + } + ] + }, + "documentation": { + "id": 7470, + "nodeType": "StructuredDocumentation", + "src": "13738:212:49", + "text": " @dev Parse a hexadecimal string (with or without \"0x\" prefix), and returns the value as an `address`.\n Requirements:\n - The string must be formatted as `(0x)?[0-9a-fA-F]{40}`" + }, + "id": 7488, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "parseAddress", + "nameLocation": "13964:12:49", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 7473, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 7472, + "mutability": "mutable", + "name": "input", + "nameLocation": "13991:5:49", + "nodeType": "VariableDeclaration", + "scope": 7488, + "src": "13977:19:49", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 7471, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "13977:6:49", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "visibility": "internal" + } + ], + "src": "13976:21:49" + }, + "returnParameters": { + "id": 7476, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 7475, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 7488, + "src": "14021:7:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 7474, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "14021:7:49", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "14020:9:49" + }, + "scope": 7883, + "src": "13955:142:49", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 7518, + "nodeType": "Block", + "src": "14470:165:49", + "statements": [ + { + "assignments": [ + 7501, + 7503 + ], + "declarations": [ + { + "constant": false, + "id": 7501, + "mutability": "mutable", + "name": "success", + "nameLocation": "14486:7:49", + "nodeType": "VariableDeclaration", + "scope": 7518, + "src": "14481:12:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 7500, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "14481:4:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 7503, + "mutability": "mutable", + "name": "value", + "nameLocation": "14503:5:49", + "nodeType": "VariableDeclaration", + "scope": 7518, + "src": "14495:13:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 7502, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "14495:7:49", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "id": 7509, + "initialValue": { + "arguments": [ + { + "id": 7505, + "name": "input", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7491, + "src": "14528:5:49", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + }, + { + "id": 7506, + "name": "begin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7493, + "src": "14535:5:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 7507, + "name": "end", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7495, + "src": "14542:3:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 7504, + "name": "tryParseAddress", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 7540, + 7644 + ], + "referencedDeclaration": 7644, + "src": "14512:15:49", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_string_memory_ptr_$_t_uint256_$_t_uint256_$returns$_t_bool_$_t_address_$", + "typeString": "function (string memory,uint256,uint256) pure returns (bool,address)" + } + }, + "id": 7508, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "14512:34:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_bool_$_t_address_$", + "typeString": "tuple(bool,address)" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "14480:66:49" + }, + { + "condition": { + "id": 7511, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "14560:8:49", + "subExpression": { + "id": 7510, + "name": "success", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7501, + "src": "14561:7:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 7515, + "nodeType": "IfStatement", + "src": "14556:50:49", + "trueBody": { + "errorCall": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 7512, + "name": "StringsInvalidAddressFormat", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6547, + "src": "14577:27:49", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$__$returns$_t_error_$", + "typeString": "function () pure returns (error)" + } + }, + "id": 7513, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "14577:29:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 7514, + "nodeType": "RevertStatement", + "src": "14570:36:49" + } + }, + { + "expression": { + "id": 7516, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7503, + "src": "14623:5:49", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "functionReturnParameters": 7499, + "id": 7517, + "nodeType": "Return", + "src": "14616:12:49" + } + ] + }, + "documentation": { + "id": 7489, + "nodeType": "StructuredDocumentation", + "src": "14103:259:49", + "text": " @dev Variant of {parseAddress-string} that parses a substring of `input` located between position `begin` (included) and\n `end` (excluded).\n Requirements:\n - The substring must be formatted as `(0x)?[0-9a-fA-F]{40}`" + }, + "id": 7519, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "parseAddress", + "nameLocation": "14376:12:49", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 7496, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 7491, + "mutability": "mutable", + "name": "input", + "nameLocation": "14403:5:49", + "nodeType": "VariableDeclaration", + "scope": 7519, + "src": "14389:19:49", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 7490, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "14389:6:49", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 7493, + "mutability": "mutable", + "name": "begin", + "nameLocation": "14418:5:49", + "nodeType": "VariableDeclaration", + "scope": 7519, + "src": "14410:13:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 7492, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "14410:7:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 7495, + "mutability": "mutable", + "name": "end", + "nameLocation": "14433:3:49", + "nodeType": "VariableDeclaration", + "scope": 7519, + "src": "14425:11:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 7494, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "14425:7:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "14388:49:49" + }, + "returnParameters": { + "id": 7499, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 7498, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 7519, + "src": "14461:7:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 7497, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "14461:7:49", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "14460:9:49" + }, + "scope": 7883, + "src": "14367:268:49", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 7539, + "nodeType": "Block", + "src": "14942:70:49", + "statements": [ + { + "expression": { + "arguments": [ + { + "id": 7530, + "name": "input", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7522, + "src": "14975:5:49", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + }, + { + "hexValue": "30", + "id": 7531, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "14982:1:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + { + "expression": { + "arguments": [ + { + "id": 7534, + "name": "input", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7522, + "src": "14991:5:49", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + ], + "id": 7533, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "14985:5:49", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes_storage_ptr_$", + "typeString": "type(bytes storage pointer)" + }, + "typeName": { + "id": 7532, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "14985:5:49", + "typeDescriptions": {} + } + }, + "id": 7535, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "14985:12:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 7536, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "14998:6:49", + "memberName": "length", + "nodeType": "MemberAccess", + "src": "14985:19:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + }, + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 7529, + "name": "tryParseAddress", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 7540, + 7644 + ], + "referencedDeclaration": 7644, + "src": "14959:15:49", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_string_memory_ptr_$_t_uint256_$_t_uint256_$returns$_t_bool_$_t_address_$", + "typeString": "function (string memory,uint256,uint256) pure returns (bool,address)" + } + }, + "id": 7537, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "14959:46:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_bool_$_t_address_$", + "typeString": "tuple(bool,address)" + } + }, + "functionReturnParameters": 7528, + "id": 7538, + "nodeType": "Return", + "src": "14952:53:49" + } + ] + }, + "documentation": { + "id": 7520, + "nodeType": "StructuredDocumentation", + "src": "14641:198:49", + "text": " @dev Variant of {parseAddress-string} that returns false if the parsing fails because the input is not a properly\n formatted address. See {parseAddress-string} requirements." + }, + "id": 7540, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "tryParseAddress", + "nameLocation": "14853:15:49", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 7523, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 7522, + "mutability": "mutable", + "name": "input", + "nameLocation": "14883:5:49", + "nodeType": "VariableDeclaration", + "scope": 7540, + "src": "14869:19:49", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 7521, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "14869:6:49", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "visibility": "internal" + } + ], + "src": "14868:21:49" + }, + "returnParameters": { + "id": 7528, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 7525, + "mutability": "mutable", + "name": "success", + "nameLocation": "14918:7:49", + "nodeType": "VariableDeclaration", + "scope": 7540, + "src": "14913:12:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 7524, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "14913:4:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 7527, + "mutability": "mutable", + "name": "value", + "nameLocation": "14935:5:49", + "nodeType": "VariableDeclaration", + "scope": 7540, + "src": "14927:13:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 7526, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "14927:7:49", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "14912:29:49" + }, + "scope": 7883, + "src": "14844:168:49", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 7643, + "nodeType": "Block", + "src": "15405:733:49", + "statements": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 7564, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 7560, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 7554, + "name": "end", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7547, + "src": "15419:3:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "expression": { + "arguments": [ + { + "id": 7557, + "name": "input", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7543, + "src": "15431:5:49", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + ], + "id": 7556, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "15425:5:49", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes_storage_ptr_$", + "typeString": "type(bytes storage pointer)" + }, + "typeName": { + "id": 7555, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "15425:5:49", + "typeDescriptions": {} + } + }, + "id": 7558, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "15425:12:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 7559, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "15438:6:49", + "memberName": "length", + "nodeType": "MemberAccess", + "src": "15425:19:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "15419:25:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "||", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 7563, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 7561, + "name": "begin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7545, + "src": "15448:5:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "id": 7562, + "name": "end", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7547, + "src": "15456:3:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "15448:11:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "15419:40:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 7572, + "nodeType": "IfStatement", + "src": "15415:72:49", + "trueBody": { + "expression": { + "components": [ + { + "hexValue": "66616c7365", + "id": 7565, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "15469:5:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + }, + { + "arguments": [ + { + "hexValue": "30", + "id": 7568, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "15484:1:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 7567, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "15476:7:49", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 7566, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "15476:7:49", + "typeDescriptions": {} + } + }, + "id": 7569, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "15476:10:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "id": 7570, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "15468:19:49", + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_bool_$_t_address_$", + "typeString": "tuple(bool,address)" + } + }, + "functionReturnParameters": 7553, + "id": 7571, + "nodeType": "Return", + "src": "15461:26:49" + } + }, + { + "assignments": [ + 7574 + ], + "declarations": [ + { + "constant": false, + "id": 7574, + "mutability": "mutable", + "name": "hasPrefix", + "nameLocation": "15503:9:49", + "nodeType": "VariableDeclaration", + "scope": 7643, + "src": "15498:14:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 7573, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "15498:4:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "id": 7597, + "initialValue": { + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 7596, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 7579, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 7575, + "name": "end", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7547, + "src": "15516:3:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 7578, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 7576, + "name": "begin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7545, + "src": "15522:5:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "hexValue": "31", + "id": 7577, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "15530:1:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "15522:9:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "15516:15:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "id": 7580, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "15515:17:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "&&", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_bytes2", + "typeString": "bytes2" + }, + "id": 7595, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "arguments": [ + { + "arguments": [ + { + "arguments": [ + { + "id": 7586, + "name": "input", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7543, + "src": "15572:5:49", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + ], + "id": 7585, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "15566:5:49", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes_storage_ptr_$", + "typeString": "type(bytes storage pointer)" + }, + "typeName": { + "id": 7584, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "15566:5:49", + "typeDescriptions": {} + } + }, + "id": 7587, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "15566:12:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + { + "id": 7588, + "name": "begin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7545, + "src": "15580:5:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 7583, + "name": "_unsafeReadBytesOffset", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7882, + "src": "15543:22:49", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$_t_uint256_$returns$_t_bytes32_$", + "typeString": "function (bytes memory,uint256) pure returns (bytes32)" + } + }, + "id": 7589, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "15543:43:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 7582, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "15536:6:49", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes2_$", + "typeString": "type(bytes2)" + }, + "typeName": { + "id": 7581, + "name": "bytes2", + "nodeType": "ElementaryTypeName", + "src": "15536:6:49", + "typeDescriptions": {} + } + }, + "id": 7590, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "15536:51:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes2", + "typeString": "bytes2" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "arguments": [ + { + "hexValue": "3078", + "id": 7593, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "15598:4:49", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_39bef1777deb3dfb14f64b9f81ced092c501fee72f90e93d03bb95ee89df9837", + "typeString": "literal_string \"0x\"" + }, + "value": "0x" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_stringliteral_39bef1777deb3dfb14f64b9f81ced092c501fee72f90e93d03bb95ee89df9837", + "typeString": "literal_string \"0x\"" + } + ], + "id": 7592, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "15591:6:49", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes2_$", + "typeString": "type(bytes2)" + }, + "typeName": { + "id": 7591, + "name": "bytes2", + "nodeType": "ElementaryTypeName", + "src": "15591:6:49", + "typeDescriptions": {} + } + }, + "id": 7594, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "15591:12:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes2", + "typeString": "bytes2" + } + }, + "src": "15536:67:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "15515:88:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "15498:105:49" + }, + { + "assignments": [ + 7599 + ], + "declarations": [ + { + "constant": false, + "id": 7599, + "mutability": "mutable", + "name": "expectedLength", + "nameLocation": "15692:14:49", + "nodeType": "VariableDeclaration", + "scope": 7643, + "src": "15684:22:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 7598, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "15684:7:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 7607, + "initialValue": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 7606, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "hexValue": "3430", + "id": 7600, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "15709:2:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_40_by_1", + "typeString": "int_const 40" + }, + "value": "40" + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 7605, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "expression": { + "id": 7601, + "name": "hasPrefix", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7574, + "src": "15714:9:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 7602, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "15724:6:49", + "memberName": "toUint", + "nodeType": "MemberAccess", + "referencedDeclaration": 11702, + "src": "15714:16:49", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_bool_$returns$_t_uint256_$attached_to$_t_bool_$", + "typeString": "function (bool) pure returns (uint256)" + } + }, + "id": 7603, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "15714:18:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "*", + "rightExpression": { + "hexValue": "32", + "id": 7604, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "15735:1:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_2_by_1", + "typeString": "int_const 2" + }, + "value": "2" + }, + "src": "15714:22:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "15709:27:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "15684:52:49" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 7612, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 7610, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 7608, + "name": "end", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7547, + "src": "15801:3:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "id": 7609, + "name": "begin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7545, + "src": "15807:5:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "15801:11:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "id": 7611, + "name": "expectedLength", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7599, + "src": "15816:14:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "15801:29:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "id": 7641, + "nodeType": "Block", + "src": "16081:51:49", + "statements": [ + { + "expression": { + "components": [ + { + "hexValue": "66616c7365", + "id": 7634, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "16103:5:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + }, + { + "arguments": [ + { + "hexValue": "30", + "id": 7637, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "16118:1:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 7636, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "16110:7:49", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 7635, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "16110:7:49", + "typeDescriptions": {} + } + }, + "id": 7638, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "16110:10:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "id": 7639, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "16102:19:49", + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_bool_$_t_address_$", + "typeString": "tuple(bool,address)" + } + }, + "functionReturnParameters": 7553, + "id": 7640, + "nodeType": "Return", + "src": "16095:26:49" + } + ] + }, + "id": 7642, + "nodeType": "IfStatement", + "src": "15797:335:49", + "trueBody": { + "id": 7633, + "nodeType": "Block", + "src": "15832:243:49", + "statements": [ + { + "assignments": [ + 7614, + 7616 + ], + "declarations": [ + { + "constant": false, + "id": 7614, + "mutability": "mutable", + "name": "s", + "nameLocation": "15953:1:49", + "nodeType": "VariableDeclaration", + "scope": 7633, + "src": "15948:6:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 7613, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "15948:4:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 7616, + "mutability": "mutable", + "name": "v", + "nameLocation": "15964:1:49", + "nodeType": "VariableDeclaration", + "scope": 7633, + "src": "15956:9:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 7615, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "15956:7:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 7622, + "initialValue": { + "arguments": [ + { + "id": 7618, + "name": "input", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7543, + "src": "16001:5:49", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + }, + { + "id": 7619, + "name": "begin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7545, + "src": "16008:5:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 7620, + "name": "end", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7547, + "src": "16015:3:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 7617, + "name": "_tryParseHexUintUncheckedBounds", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7469, + "src": "15969:31:49", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_string_memory_ptr_$_t_uint256_$_t_uint256_$returns$_t_bool_$_t_uint256_$", + "typeString": "function (string memory,uint256,uint256) pure returns (bool,uint256)" + } + }, + "id": 7621, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "15969:50:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_bool_$_t_uint256_$", + "typeString": "tuple(bool,uint256)" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "15947:72:49" + }, + { + "expression": { + "components": [ + { + "id": 7623, + "name": "s", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7614, + "src": "16041:1:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [ + { + "arguments": [ + { + "id": 7628, + "name": "v", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7616, + "src": "16060:1:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 7627, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "16052:7:49", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint160_$", + "typeString": "type(uint160)" + }, + "typeName": { + "id": 7626, + "name": "uint160", + "nodeType": "ElementaryTypeName", + "src": "16052:7:49", + "typeDescriptions": {} + } + }, + "id": 7629, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "16052:10:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint160", + "typeString": "uint160" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint160", + "typeString": "uint160" + } + ], + "id": 7625, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "16044:7:49", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 7624, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "16044:7:49", + "typeDescriptions": {} + } + }, + "id": 7630, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "16044:19:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "id": 7631, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "16040:24:49", + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_bool_$_t_address_$", + "typeString": "tuple(bool,address)" + } + }, + "functionReturnParameters": 7553, + "id": 7632, + "nodeType": "Return", + "src": "16033:31:49" + } + ] + } + } + ] + }, + "documentation": { + "id": 7541, + "nodeType": "StructuredDocumentation", + "src": "15018:226:49", + "text": " @dev Variant of {parseAddress-string-uint256-uint256} that returns false if the parsing fails because input is not a properly\n formatted address. See {parseAddress-string-uint256-uint256} requirements." + }, + "id": 7644, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "tryParseAddress", + "nameLocation": "15258:15:49", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 7548, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 7543, + "mutability": "mutable", + "name": "input", + "nameLocation": "15297:5:49", + "nodeType": "VariableDeclaration", + "scope": 7644, + "src": "15283:19:49", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 7542, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "15283:6:49", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 7545, + "mutability": "mutable", + "name": "begin", + "nameLocation": "15320:5:49", + "nodeType": "VariableDeclaration", + "scope": 7644, + "src": "15312:13:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 7544, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "15312:7:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 7547, + "mutability": "mutable", + "name": "end", + "nameLocation": "15343:3:49", + "nodeType": "VariableDeclaration", + "scope": 7644, + "src": "15335:11:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 7546, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "15335:7:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "15273:79:49" + }, + "returnParameters": { + "id": 7553, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 7550, + "mutability": "mutable", + "name": "success", + "nameLocation": "15381:7:49", + "nodeType": "VariableDeclaration", + "scope": 7644, + "src": "15376:12:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 7549, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "15376:4:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 7552, + "mutability": "mutable", + "name": "value", + "nameLocation": "15398:5:49", + "nodeType": "VariableDeclaration", + "scope": 7644, + "src": "15390:13:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 7551, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "15390:7:49", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "15375:29:49" + }, + "scope": 7883, + "src": "15249:889:49", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 7703, + "nodeType": "Block", + "src": "16207:461:49", + "statements": [ + { + "assignments": [ + 7652 + ], + "declarations": [ + { + "constant": false, + "id": 7652, + "mutability": "mutable", + "name": "value", + "nameLocation": "16223:5:49", + "nodeType": "VariableDeclaration", + "scope": 7703, + "src": "16217:11:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "typeName": { + "id": 7651, + "name": "uint8", + "nodeType": "ElementaryTypeName", + "src": "16217:5:49", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "visibility": "internal" + } + ], + "id": 7657, + "initialValue": { + "arguments": [ + { + "id": 7655, + "name": "chr", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7646, + "src": "16237:3:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + ], + "id": 7654, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "16231:5:49", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint8_$", + "typeString": "type(uint8)" + }, + "typeName": { + "id": 7653, + "name": "uint8", + "nodeType": "ElementaryTypeName", + "src": "16231:5:49", + "typeDescriptions": {} + } + }, + "id": 7656, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "16231:10:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "16217:24:49" + }, + { + "id": 7700, + "nodeType": "UncheckedBlock", + "src": "16401:238:49", + "statements": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 7664, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "commonType": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "id": 7660, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 7658, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7652, + "src": "16429:5:49", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "hexValue": "3437", + "id": 7659, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "16437:2:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_47_by_1", + "typeString": "int_const 47" + }, + "value": "47" + }, + "src": "16429:10:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "&&", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "id": 7663, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 7661, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7652, + "src": "16443:5:49", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "hexValue": "3538", + "id": 7662, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "16451:2:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_58_by_1", + "typeString": "int_const 58" + }, + "value": "58" + }, + "src": "16443:10:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "16429:24:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "condition": { + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 7675, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "commonType": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "id": 7671, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 7669, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7652, + "src": "16489:5:49", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "hexValue": "3936", + "id": 7670, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "16497:2:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_96_by_1", + "typeString": "int_const 96" + }, + "value": "96" + }, + "src": "16489:10:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "&&", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "id": 7674, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 7672, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7652, + "src": "16503:5:49", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "hexValue": "313033", + "id": 7673, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "16511:3:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_103_by_1", + "typeString": "int_const 103" + }, + "value": "103" + }, + "src": "16503:11:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "16489:25:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "condition": { + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 7686, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "commonType": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "id": 7682, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 7680, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7652, + "src": "16550:5:49", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "hexValue": "3634", + "id": 7681, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "16558:2:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_64_by_1", + "typeString": "int_const 64" + }, + "value": "64" + }, + "src": "16550:10:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "&&", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "id": 7685, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 7683, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7652, + "src": "16564:5:49", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "hexValue": "3731", + "id": 7684, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "16572:2:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_71_by_1", + "typeString": "int_const 71" + }, + "value": "71" + }, + "src": "16564:10:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "16550:24:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "expression": { + "expression": { + "arguments": [ + { + "id": 7693, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "16618:5:49", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint8_$", + "typeString": "type(uint8)" + }, + "typeName": { + "id": 7692, + "name": "uint8", + "nodeType": "ElementaryTypeName", + "src": "16618:5:49", + "typeDescriptions": {} + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_type$_t_uint8_$", + "typeString": "type(uint8)" + } + ], + "id": 7691, + "name": "type", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -27, + "src": "16613:4:49", + "typeDescriptions": { + "typeIdentifier": "t_function_metatype_pure$__$returns$__$", + "typeString": "function () pure" + } + }, + "id": 7694, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "16613:11:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_magic_meta_type_t_uint8", + "typeString": "type(uint8)" + } + }, + "id": 7695, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "16625:3:49", + "memberName": "max", + "nodeType": "MemberAccess", + "src": "16613:15:49", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "functionReturnParameters": 7650, + "id": 7696, + "nodeType": "Return", + "src": "16606:22:49" + }, + "id": 7697, + "nodeType": "IfStatement", + "src": "16546:82:49", + "trueBody": { + "expression": { + "id": 7689, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 7687, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7652, + "src": "16576:5:49", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "nodeType": "Assignment", + "operator": "-=", + "rightHandSide": { + "hexValue": "3535", + "id": 7688, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "16585:2:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_55_by_1", + "typeString": "int_const 55" + }, + "value": "55" + }, + "src": "16576:11:49", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "id": 7690, + "nodeType": "ExpressionStatement", + "src": "16576:11:49" + } + }, + "id": 7698, + "nodeType": "IfStatement", + "src": "16485:143:49", + "trueBody": { + "expression": { + "id": 7678, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 7676, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7652, + "src": "16516:5:49", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "nodeType": "Assignment", + "operator": "-=", + "rightHandSide": { + "hexValue": "3837", + "id": 7677, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "16525:2:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_87_by_1", + "typeString": "int_const 87" + }, + "value": "87" + }, + "src": "16516:11:49", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "id": 7679, + "nodeType": "ExpressionStatement", + "src": "16516:11:49" + } + }, + "id": 7699, + "nodeType": "IfStatement", + "src": "16425:203:49", + "trueBody": { + "expression": { + "id": 7667, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 7665, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7652, + "src": "16455:5:49", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "nodeType": "Assignment", + "operator": "-=", + "rightHandSide": { + "hexValue": "3438", + "id": 7666, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "16464:2:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_48_by_1", + "typeString": "int_const 48" + }, + "value": "48" + }, + "src": "16455:11:49", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "id": 7668, + "nodeType": "ExpressionStatement", + "src": "16455:11:49" + } + } + ] + }, + { + "expression": { + "id": 7701, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7652, + "src": "16656:5:49", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "functionReturnParameters": 7650, + "id": 7702, + "nodeType": "Return", + "src": "16649:12:49" + } + ] + }, + "id": 7704, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_tryParseChr", + "nameLocation": "16153:12:49", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 7647, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 7646, + "mutability": "mutable", + "name": "chr", + "nameLocation": "16173:3:49", + "nodeType": "VariableDeclaration", + "scope": 7704, + "src": "16166:10:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + }, + "typeName": { + "id": 7645, + "name": "bytes1", + "nodeType": "ElementaryTypeName", + "src": "16166:6:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + "visibility": "internal" + } + ], + "src": "16165:12:49" + }, + "returnParameters": { + "id": 7650, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 7649, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 7704, + "src": "16200:5:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "typeName": { + "id": 7648, + "name": "uint8", + "nodeType": "ElementaryTypeName", + "src": "16200:5:49", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "visibility": "internal" + } + ], + "src": "16199:7:49" + }, + "scope": 7883, + "src": "16144:524:49", + "stateMutability": "pure", + "virtual": false, + "visibility": "private" + }, + { + "body": { + "id": 7869, + "nodeType": "Block", + "src": "17334:1331:49", + "statements": [ + { + "assignments": [ + 7713 + ], + "declarations": [ + { + "constant": false, + "id": 7713, + "mutability": "mutable", + "name": "buffer", + "nameLocation": "17357:6:49", + "nodeType": "VariableDeclaration", + "scope": 7869, + "src": "17344:19:49", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 7712, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "17344:5:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "id": 7718, + "initialValue": { + "arguments": [ + { + "id": 7716, + "name": "input", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7707, + "src": "17372:5:49", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + ], + "id": 7715, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "17366:5:49", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes_storage_ptr_$", + "typeString": "type(bytes storage pointer)" + }, + "typeName": { + "id": 7714, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "17366:5:49", + "typeDescriptions": {} + } + }, + "id": 7717, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "17366:12:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "17344:34:49" + }, + { + "assignments": [ + 7720 + ], + "declarations": [ + { + "constant": false, + "id": 7720, + "mutability": "mutable", + "name": "output", + "nameLocation": "17401:6:49", + "nodeType": "VariableDeclaration", + "scope": 7869, + "src": "17388:19:49", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 7719, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "17388:5:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "id": 7728, + "initialValue": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 7726, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "hexValue": "32", + "id": 7723, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "17420:1:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_2_by_1", + "typeString": "int_const 2" + }, + "value": "2" + }, + "nodeType": "BinaryOperation", + "operator": "*", + "rightExpression": { + "expression": { + "id": 7724, + "name": "buffer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7713, + "src": "17424:6:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 7725, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "17431:6:49", + "memberName": "length", + "nodeType": "MemberAccess", + "src": "17424:13:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "17420:17:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 7722, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "NewExpression", + "src": "17410:9:49", + "typeDescriptions": { + "typeIdentifier": "t_function_objectcreation_pure$_t_uint256_$returns$_t_bytes_memory_ptr_$", + "typeString": "function (uint256) pure returns (bytes memory)" + }, + "typeName": { + "id": 7721, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "17414:5:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + } + }, + "id": 7727, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "17410:28:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "17388:50:49" + }, + { + "assignments": [ + 7730 + ], + "declarations": [ + { + "constant": false, + "id": 7730, + "mutability": "mutable", + "name": "outputLength", + "nameLocation": "17479:12:49", + "nodeType": "VariableDeclaration", + "scope": 7869, + "src": "17471:20:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 7729, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "17471:7:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 7732, + "initialValue": { + "hexValue": "30", + "id": 7731, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "17494:1:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "nodeType": "VariableDeclarationStatement", + "src": "17471:24:49" + }, + { + "body": { + "id": 7861, + "nodeType": "Block", + "src": "17546:854:49", + "statements": [ + { + "assignments": [ + 7744 + ], + "declarations": [ + { + "constant": false, + "id": 7744, + "mutability": "mutable", + "name": "char", + "nameLocation": "17567:4:49", + "nodeType": "VariableDeclaration", + "scope": 7861, + "src": "17560:11:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + }, + "typeName": { + "id": 7743, + "name": "bytes1", + "nodeType": "ElementaryTypeName", + "src": "17560:6:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + "visibility": "internal" + } + ], + "id": 7752, + "initialValue": { + "arguments": [ + { + "arguments": [ + { + "id": 7748, + "name": "buffer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7713, + "src": "17604:6:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + { + "id": 7749, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7734, + "src": "17612:1:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 7747, + "name": "_unsafeReadBytesOffset", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7882, + "src": "17581:22:49", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$_t_uint256_$returns$_t_bytes32_$", + "typeString": "function (bytes memory,uint256) pure returns (bytes32)" + } + }, + "id": 7750, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "17581:33:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 7746, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "17574:6:49", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes1_$", + "typeString": "type(bytes1)" + }, + "typeName": { + "id": 7745, + "name": "bytes1", + "nodeType": "ElementaryTypeName", + "src": "17574:6:49", + "typeDescriptions": {} + } + }, + "id": 7751, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "17574:41:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "17560:55:49" + }, + { + "condition": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 7764, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 7761, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 7753, + "name": "SPECIAL_CHARS_LOOKUP", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6534, + "src": "17635:20:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "&", + "rightExpression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 7759, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "hexValue": "31", + "id": 7754, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "17659:1:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "nodeType": "BinaryOperation", + "operator": "<<", + "rightExpression": { + "arguments": [ + { + "id": 7757, + "name": "char", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7744, + "src": "17670:4:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + ], + "id": 7756, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "17664:5:49", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint8_$", + "typeString": "type(uint8)" + }, + "typeName": { + "id": 7755, + "name": "uint8", + "nodeType": "ElementaryTypeName", + "src": "17664:5:49", + "typeDescriptions": {} + } + }, + "id": 7758, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "17664:11:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "src": "17659:16:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 7760, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "17658:18:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "17635:41:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 7762, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "17634:43:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "hexValue": "30", + "id": 7763, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "17681:1:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "17634:48:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "id": 7765, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "17633:50:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "id": 7859, + "nodeType": "Block", + "src": "18328:62:49", + "statements": [ + { + "expression": { + "id": 7857, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "baseExpression": { + "id": 7852, + "name": "output", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7720, + "src": "18346:6:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 7855, + "indexExpression": { + "id": 7854, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "18353:14:49", + "subExpression": { + "id": 7853, + "name": "outputLength", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7730, + "src": "18353:12:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "18346:22:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "id": 7856, + "name": "char", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7744, + "src": "18371:4:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + "src": "18346:29:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + "id": 7858, + "nodeType": "ExpressionStatement", + "src": "18346:29:49" + } + ] + }, + "id": 7860, + "nodeType": "IfStatement", + "src": "17629:761:49", + "trueBody": { + "id": 7851, + "nodeType": "Block", + "src": "17685:637:49", + "statements": [ + { + "expression": { + "id": 7771, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "baseExpression": { + "id": 7766, + "name": "output", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7720, + "src": "17703:6:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 7769, + "indexExpression": { + "id": 7768, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "17710:14:49", + "subExpression": { + "id": 7767, + "name": "outputLength", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7730, + "src": "17710:12:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "17703:22:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "hexValue": "5c", + "id": 7770, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "17728:4:49", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_731553fa98541ade8b78284229adfe09a819380dee9244baac20dd1e0aa24095", + "typeString": "literal_string \"\\\"" + }, + "value": "\\" + }, + "src": "17703:29:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + "id": 7772, + "nodeType": "ExpressionStatement", + "src": "17703:29:49" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + }, + "id": 7775, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 7773, + "name": "char", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7744, + "src": "17754:4:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "30783038", + "id": 7774, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "17762:4:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_8_by_1", + "typeString": "int_const 8" + }, + "value": "0x08" + }, + "src": "17754:12:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "condition": { + "commonType": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + }, + "id": 7785, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 7783, + "name": "char", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7744, + "src": "17823:4:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "30783039", + "id": 7784, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "17831:4:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_9_by_1", + "typeString": "int_const 9" + }, + "value": "0x09" + }, + "src": "17823:12:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "condition": { + "commonType": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + }, + "id": 7795, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 7793, + "name": "char", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7744, + "src": "17892:4:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "30783061", + "id": 7794, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "17900:4:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_10_by_1", + "typeString": "int_const 10" + }, + "value": "0x0a" + }, + "src": "17892:12:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "condition": { + "commonType": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + }, + "id": 7805, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 7803, + "name": "char", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7744, + "src": "17961:4:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "30783063", + "id": 7804, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "17969:4:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_12_by_1", + "typeString": "int_const 12" + }, + "value": "0x0c" + }, + "src": "17961:12:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "condition": { + "commonType": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + }, + "id": 7815, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 7813, + "name": "char", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7744, + "src": "18030:4:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "30783064", + "id": 7814, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "18038:4:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_13_by_1", + "typeString": "int_const 13" + }, + "value": "0x0d" + }, + "src": "18030:12:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "condition": { + "commonType": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + }, + "id": 7825, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 7823, + "name": "char", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7744, + "src": "18099:4:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "30783563", + "id": 7824, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "18107:4:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_92_by_1", + "typeString": "int_const 92" + }, + "value": "0x5c" + }, + "src": "18099:12:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "condition": { + "commonType": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + }, + "id": 7835, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 7833, + "name": "char", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7744, + "src": "18169:4:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "30783232", + "id": 7834, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "18177:4:49", + "typeDescriptions": { + "typeIdentifier": "t_rational_34_by_1", + "typeString": "int_const 34" + }, + "value": "0x22" + }, + "src": "18169:12:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 7844, + "nodeType": "IfStatement", + "src": "18165:143:49", + "trueBody": { + "id": 7843, + "nodeType": "Block", + "src": "18183:125:49", + "statements": [ + { + "expression": { + "id": 7841, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "baseExpression": { + "id": 7836, + "name": "output", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7720, + "src": "18261:6:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 7839, + "indexExpression": { + "id": 7838, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "18268:14:49", + "subExpression": { + "id": 7837, + "name": "outputLength", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7730, + "src": "18268:12:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "18261:22:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "hexValue": "22", + "id": 7840, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "18286:3:49", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_6e9f33448a4153023cdaf3eb759f1afdc24aba433a3e18b683f8c04a6eaa69f0", + "typeString": "literal_string \"\"\"" + }, + "value": "\"" + }, + "src": "18261:28:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + "id": 7842, + "nodeType": "ExpressionStatement", + "src": "18261:28:49" + } + ] + } + }, + "id": 7845, + "nodeType": "IfStatement", + "src": "18095:213:49", + "trueBody": { + "expression": { + "id": 7831, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "baseExpression": { + "id": 7826, + "name": "output", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7720, + "src": "18113:6:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 7829, + "indexExpression": { + "id": 7828, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "18120:14:49", + "subExpression": { + "id": 7827, + "name": "outputLength", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7730, + "src": "18120:12:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "18113:22:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "hexValue": "5c", + "id": 7830, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "18138:4:49", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_731553fa98541ade8b78284229adfe09a819380dee9244baac20dd1e0aa24095", + "typeString": "literal_string \"\\\"" + }, + "value": "\\" + }, + "src": "18113:29:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + "id": 7832, + "nodeType": "ExpressionStatement", + "src": "18113:29:49" + } + }, + "id": 7846, + "nodeType": "IfStatement", + "src": "18026:282:49", + "trueBody": { + "expression": { + "id": 7821, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "baseExpression": { + "id": 7816, + "name": "output", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7720, + "src": "18044:6:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 7819, + "indexExpression": { + "id": 7818, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "18051:14:49", + "subExpression": { + "id": 7817, + "name": "outputLength", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7730, + "src": "18051:12:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "18044:22:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "hexValue": "72", + "id": 7820, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "18069:3:49", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_414f72a4d550cad29f17d9d99a4af64b3776ec5538cd440cef0f03fef2e9e010", + "typeString": "literal_string \"r\"" + }, + "value": "r" + }, + "src": "18044:28:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + "id": 7822, + "nodeType": "ExpressionStatement", + "src": "18044:28:49" + } + }, + "id": 7847, + "nodeType": "IfStatement", + "src": "17957:351:49", + "trueBody": { + "expression": { + "id": 7811, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "baseExpression": { + "id": 7806, + "name": "output", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7720, + "src": "17975:6:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 7809, + "indexExpression": { + "id": 7808, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "17982:14:49", + "subExpression": { + "id": 7807, + "name": "outputLength", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7730, + "src": "17982:12:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "17975:22:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "hexValue": "66", + "id": 7810, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "18000:3:49", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_d1e8aeb79500496ef3dc2e57ba746a8315d048b7a664a2bf948db4fa91960483", + "typeString": "literal_string \"f\"" + }, + "value": "f" + }, + "src": "17975:28:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + "id": 7812, + "nodeType": "ExpressionStatement", + "src": "17975:28:49" + } + }, + "id": 7848, + "nodeType": "IfStatement", + "src": "17888:420:49", + "trueBody": { + "expression": { + "id": 7801, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "baseExpression": { + "id": 7796, + "name": "output", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7720, + "src": "17906:6:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 7799, + "indexExpression": { + "id": 7798, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "17913:14:49", + "subExpression": { + "id": 7797, + "name": "outputLength", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7730, + "src": "17913:12:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "17906:22:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "hexValue": "6e", + "id": 7800, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "17931:3:49", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_4b4ecedb4964a40fe416b16c7bd8b46092040ec42ef0aa69e59f09872f105cf3", + "typeString": "literal_string \"n\"" + }, + "value": "n" + }, + "src": "17906:28:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + "id": 7802, + "nodeType": "ExpressionStatement", + "src": "17906:28:49" + } + }, + "id": 7849, + "nodeType": "IfStatement", + "src": "17819:489:49", + "trueBody": { + "expression": { + "id": 7791, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "baseExpression": { + "id": 7786, + "name": "output", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7720, + "src": "17837:6:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 7789, + "indexExpression": { + "id": 7788, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "17844:14:49", + "subExpression": { + "id": 7787, + "name": "outputLength", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7730, + "src": "17844:12:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "17837:22:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "hexValue": "74", + "id": 7790, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "17862:3:49", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_cac1bb71f0a97c8ac94ca9546b43178a9ad254c7b757ac07433aa6df35cd8089", + "typeString": "literal_string \"t\"" + }, + "value": "t" + }, + "src": "17837:28:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + "id": 7792, + "nodeType": "ExpressionStatement", + "src": "17837:28:49" + } + }, + "id": 7850, + "nodeType": "IfStatement", + "src": "17750:558:49", + "trueBody": { + "expression": { + "id": 7781, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "baseExpression": { + "id": 7776, + "name": "output", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7720, + "src": "17768:6:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 7779, + "indexExpression": { + "id": 7778, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "17775:14:49", + "subExpression": { + "id": 7777, + "name": "outputLength", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7730, + "src": "17775:12:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "17768:22:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "hexValue": "62", + "id": 7780, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "17793:3:49", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_b5553de315e0edf504d9150af82dafa5c4667fa618ed0a6f19c69b41166c5510", + "typeString": "literal_string \"b\"" + }, + "value": "b" + }, + "src": "17768:28:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + "id": 7782, + "nodeType": "ExpressionStatement", + "src": "17768:28:49" + } + } + ] + } + } + ] + }, + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 7739, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 7736, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7734, + "src": "17522:1:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "expression": { + "id": 7737, + "name": "buffer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7713, + "src": "17526:6:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 7738, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "17533:6:49", + "memberName": "length", + "nodeType": "MemberAccess", + "src": "17526:13:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "17522:17:49", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 7862, + "initializationExpression": { + "assignments": [ + 7734 + ], + "declarations": [ + { + "constant": false, + "id": 7734, + "mutability": "mutable", + "name": "i", + "nameLocation": "17519:1:49", + "nodeType": "VariableDeclaration", + "scope": 7862, + "src": "17511:9:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 7733, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "17511:7:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 7735, + "nodeType": "VariableDeclarationStatement", + "src": "17511:9:49" + }, + "isSimpleCounterLoop": true, + "loopExpression": { + "expression": { + "id": 7741, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": true, + "src": "17541:3:49", + "subExpression": { + "id": 7740, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7734, + "src": "17543:1:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 7742, + "nodeType": "ExpressionStatement", + "src": "17541:3:49" + }, + "nodeType": "ForStatement", + "src": "17506:894:49" + }, + { + "AST": { + "nativeSrc": "18498:129:49", + "nodeType": "YulBlock", + "src": "18498:129:49", + "statements": [ + { + "expression": { + "arguments": [ + { + "name": "output", + "nativeSrc": "18519:6:49", + "nodeType": "YulIdentifier", + "src": "18519:6:49" + }, + { + "name": "outputLength", + "nativeSrc": "18527:12:49", + "nodeType": "YulIdentifier", + "src": "18527:12:49" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "18512:6:49", + "nodeType": "YulIdentifier", + "src": "18512:6:49" + }, + "nativeSrc": "18512:28:49", + "nodeType": "YulFunctionCall", + "src": "18512:28:49" + }, + "nativeSrc": "18512:28:49", + "nodeType": "YulExpressionStatement", + "src": "18512:28:49" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "18560:4:49", + "nodeType": "YulLiteral", + "src": "18560:4:49", + "type": "", + "value": "0x40" + }, + { + "arguments": [ + { + "name": "output", + "nativeSrc": "18570:6:49", + "nodeType": "YulIdentifier", + "src": "18570:6:49" + }, + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "18582:1:49", + "nodeType": "YulLiteral", + "src": "18582:1:49", + "type": "", + "value": "5" + }, + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "18589:1:49", + "nodeType": "YulLiteral", + "src": "18589:1:49", + "type": "", + "value": "5" + }, + { + "arguments": [ + { + "name": "outputLength", + "nativeSrc": "18596:12:49", + "nodeType": "YulIdentifier", + "src": "18596:12:49" + }, + { + "kind": "number", + "nativeSrc": "18610:2:49", + "nodeType": "YulLiteral", + "src": "18610:2:49", + "type": "", + "value": "63" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "18592:3:49", + "nodeType": "YulIdentifier", + "src": "18592:3:49" + }, + "nativeSrc": "18592:21:49", + "nodeType": "YulFunctionCall", + "src": "18592:21:49" + } + ], + "functionName": { + "name": "shr", + "nativeSrc": "18585:3:49", + "nodeType": "YulIdentifier", + "src": "18585:3:49" + }, + "nativeSrc": "18585:29:49", + "nodeType": "YulFunctionCall", + "src": "18585:29:49" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "18578:3:49", + "nodeType": "YulIdentifier", + "src": "18578:3:49" + }, + "nativeSrc": "18578:37:49", + "nodeType": "YulFunctionCall", + "src": "18578:37:49" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "18566:3:49", + "nodeType": "YulIdentifier", + "src": "18566:3:49" + }, + "nativeSrc": "18566:50:49", + "nodeType": "YulFunctionCall", + "src": "18566:50:49" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "18553:6:49", + "nodeType": "YulIdentifier", + "src": "18553:6:49" + }, + "nativeSrc": "18553:64:49", + "nodeType": "YulFunctionCall", + "src": "18553:64:49" + }, + "nativeSrc": "18553:64:49", + "nodeType": "YulExpressionStatement", + "src": "18553:64:49" + } + ] + }, + "evmVersion": "paris", + "externalReferences": [ + { + "declaration": 7720, + "isOffset": false, + "isSlot": false, + "src": "18519:6:49", + "valueSize": 1 + }, + { + "declaration": 7720, + "isOffset": false, + "isSlot": false, + "src": "18570:6:49", + "valueSize": 1 + }, + { + "declaration": 7730, + "isOffset": false, + "isSlot": false, + "src": "18527:12:49", + "valueSize": 1 + }, + { + "declaration": 7730, + "isOffset": false, + "isSlot": false, + "src": "18596:12:49", + "valueSize": 1 + } + ], + "flags": [ + "memory-safe" + ], + "id": 7863, + "nodeType": "InlineAssembly", + "src": "18473:154:49" + }, + { + "expression": { + "arguments": [ + { + "id": 7866, + "name": "output", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7720, + "src": "18651:6:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 7865, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "18644:6:49", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_string_storage_ptr_$", + "typeString": "type(string storage pointer)" + }, + "typeName": { + "id": 7864, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "18644:6:49", + "typeDescriptions": {} + } + }, + "id": 7867, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "18644:14:49", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + }, + "functionReturnParameters": 7711, + "id": 7868, + "nodeType": "Return", + "src": "18637:21:49" + } + ] + }, + "documentation": { + "id": 7705, + "nodeType": "StructuredDocumentation", + "src": "16674:576:49", + "text": " @dev Escape special characters in JSON strings. This can be useful to prevent JSON injection in NFT metadata.\n WARNING: This function should only be used in double quoted JSON strings. Single quotes are not escaped.\n NOTE: This function escapes all unicode characters, and not just the ones in ranges defined in section 2.5 of\n RFC-4627 (U+0000 to U+001F, U+0022 and U+005C). ECMAScript's `JSON.parse` does recover escaped unicode\n characters that are not in this range, but other tooling may provide different results." + }, + "id": 7870, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "escapeJSON", + "nameLocation": "17264:10:49", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 7708, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 7707, + "mutability": "mutable", + "name": "input", + "nameLocation": "17289:5:49", + "nodeType": "VariableDeclaration", + "scope": 7870, + "src": "17275:19:49", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 7706, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "17275:6:49", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "visibility": "internal" + } + ], + "src": "17274:21:49" + }, + "returnParameters": { + "id": 7711, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 7710, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 7870, + "src": "17319:13:49", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 7709, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "17319:6:49", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "visibility": "internal" + } + ], + "src": "17318:15:49" + }, + "scope": 7883, + "src": "17255:1410:49", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 7881, + "nodeType": "Block", + "src": "19050:225:49", + "statements": [ + { + "AST": { + "nativeSrc": "19199:70:49", + "nodeType": "YulBlock", + "src": "19199:70:49", + "statements": [ + { + "nativeSrc": "19213:46:49", + "nodeType": "YulAssignment", + "src": "19213:46:49", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "buffer", + "nativeSrc": "19232:6:49", + "nodeType": "YulIdentifier", + "src": "19232:6:49" + }, + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "19244:4:49", + "nodeType": "YulLiteral", + "src": "19244:4:49", + "type": "", + "value": "0x20" + }, + { + "name": "offset", + "nativeSrc": "19250:6:49", + "nodeType": "YulIdentifier", + "src": "19250:6:49" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "19240:3:49", + "nodeType": "YulIdentifier", + "src": "19240:3:49" + }, + "nativeSrc": "19240:17:49", + "nodeType": "YulFunctionCall", + "src": "19240:17:49" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "19228:3:49", + "nodeType": "YulIdentifier", + "src": "19228:3:49" + }, + "nativeSrc": "19228:30:49", + "nodeType": "YulFunctionCall", + "src": "19228:30:49" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "19222:5:49", + "nodeType": "YulIdentifier", + "src": "19222:5:49" + }, + "nativeSrc": "19222:37:49", + "nodeType": "YulFunctionCall", + "src": "19222:37:49" + }, + "variableNames": [ + { + "name": "value", + "nativeSrc": "19213:5:49", + "nodeType": "YulIdentifier", + "src": "19213:5:49" + } + ] + } + ] + }, + "evmVersion": "paris", + "externalReferences": [ + { + "declaration": 7873, + "isOffset": false, + "isSlot": false, + "src": "19232:6:49", + "valueSize": 1 + }, + { + "declaration": 7875, + "isOffset": false, + "isSlot": false, + "src": "19250:6:49", + "valueSize": 1 + }, + { + "declaration": 7878, + "isOffset": false, + "isSlot": false, + "src": "19213:5:49", + "valueSize": 1 + } + ], + "flags": [ + "memory-safe" + ], + "id": 7880, + "nodeType": "InlineAssembly", + "src": "19174:95:49" + } + ] + }, + "documentation": { + "id": 7871, + "nodeType": "StructuredDocumentation", + "src": "18671:268:49", + "text": " @dev Reads a bytes32 from a bytes array without bounds checking.\n NOTE: making this function internal would mean it could be used with memory unsafe offset, and marking the\n assembly block as such would prevent some optimizations." + }, + "id": 7882, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_unsafeReadBytesOffset", + "nameLocation": "18953:22:49", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 7876, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 7873, + "mutability": "mutable", + "name": "buffer", + "nameLocation": "18989:6:49", + "nodeType": "VariableDeclaration", + "scope": 7882, + "src": "18976:19:49", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 7872, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "18976:5:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 7875, + "mutability": "mutable", + "name": "offset", + "nameLocation": "19005:6:49", + "nodeType": "VariableDeclaration", + "scope": 7882, + "src": "18997:14:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 7874, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "18997:7:49", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "18975:37:49" + }, + "returnParameters": { + "id": 7879, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 7878, + "mutability": "mutable", + "name": "value", + "nameLocation": "19043:5:49", + "nodeType": "VariableDeclaration", + "scope": 7882, + "src": "19035:13:49", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 7877, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "19035:7:49", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "19034:15:49" + }, + "scope": 7883, + "src": "18944:331:49", + "stateMutability": "pure", + "virtual": false, + "visibility": "private" + } + ], + "scope": 7884, + "src": "297:18980:49", + "usedErrors": [ + 6541, + 6544, + 6547 + ], + "usedEvents": [] + } + ], + "src": "101:19177:49" + }, + "id": 49 + }, + "@openzeppelin/contracts/utils/cryptography/ECDSA.sol": { + "ast": { + "absolutePath": "@openzeppelin/contracts/utils/cryptography/ECDSA.sol", + "exportedSymbols": { + "ECDSA": [ + 8231 + ] + }, + "id": 8232, + "license": "MIT", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 7885, + "literals": [ + "solidity", + "^", + "0.8", + ".20" + ], + "nodeType": "PragmaDirective", + "src": "112:24:50" + }, + { + "abstract": false, + "baseContracts": [], + "canonicalName": "ECDSA", + "contractDependencies": [], + "contractKind": "library", + "documentation": { + "id": 7886, + "nodeType": "StructuredDocumentation", + "src": "138:205:50", + "text": " @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\n These functions can be used to verify that a message was signed by the holder\n of the private keys of a given address." + }, + "fullyImplemented": true, + "id": 8231, + "linearizedBaseContracts": [ + 8231 + ], + "name": "ECDSA", + "nameLocation": "352:5:50", + "nodeType": "ContractDefinition", + "nodes": [ + { + "canonicalName": "ECDSA.RecoverError", + "id": 7891, + "members": [ + { + "id": 7887, + "name": "NoError", + "nameLocation": "392:7:50", + "nodeType": "EnumValue", + "src": "392:7:50" + }, + { + "id": 7888, + "name": "InvalidSignature", + "nameLocation": "409:16:50", + "nodeType": "EnumValue", + "src": "409:16:50" + }, + { + "id": 7889, + "name": "InvalidSignatureLength", + "nameLocation": "435:22:50", + "nodeType": "EnumValue", + "src": "435:22:50" + }, + { + "id": 7890, + "name": "InvalidSignatureS", + "nameLocation": "467:17:50", + "nodeType": "EnumValue", + "src": "467:17:50" + } + ], + "name": "RecoverError", + "nameLocation": "369:12:50", + "nodeType": "EnumDefinition", + "src": "364:126:50" + }, + { + "documentation": { + "id": 7892, + "nodeType": "StructuredDocumentation", + "src": "496:63:50", + "text": " @dev The signature derives the `address(0)`." + }, + "errorSelector": "f645eedf", + "id": 7894, + "name": "ECDSAInvalidSignature", + "nameLocation": "570:21:50", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 7893, + "nodeType": "ParameterList", + "parameters": [], + "src": "591:2:50" + }, + "src": "564:30:50" + }, + { + "documentation": { + "id": 7895, + "nodeType": "StructuredDocumentation", + "src": "600:60:50", + "text": " @dev The signature has an invalid length." + }, + "errorSelector": "fce698f7", + "id": 7899, + "name": "ECDSAInvalidSignatureLength", + "nameLocation": "671:27:50", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 7898, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 7897, + "mutability": "mutable", + "name": "length", + "nameLocation": "707:6:50", + "nodeType": "VariableDeclaration", + "scope": 7899, + "src": "699:14:50", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 7896, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "699:7:50", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "698:16:50" + }, + "src": "665:50:50" + }, + { + "documentation": { + "id": 7900, + "nodeType": "StructuredDocumentation", + "src": "721:85:50", + "text": " @dev The signature has an S value that is in the upper half order." + }, + "errorSelector": "d78bce0c", + "id": 7904, + "name": "ECDSAInvalidSignatureS", + "nameLocation": "817:22:50", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 7903, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 7902, + "mutability": "mutable", + "name": "s", + "nameLocation": "848:1:50", + "nodeType": "VariableDeclaration", + "scope": 7904, + "src": "840:9:50", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 7901, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "840:7:50", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "839:11:50" + }, + "src": "811:40:50" + }, + { + "body": { + "id": 7956, + "nodeType": "Block", + "src": "2285:622:50", + "statements": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 7922, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 7919, + "name": "signature", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7909, + "src": "2299:9:50", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 7920, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "2309:6:50", + "memberName": "length", + "nodeType": "MemberAccess", + "src": "2299:16:50", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "3635", + "id": 7921, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2319:2:50", + "typeDescriptions": { + "typeIdentifier": "t_rational_65_by_1", + "typeString": "int_const 65" + }, + "value": "65" + }, + "src": "2299:22:50", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "id": 7954, + "nodeType": "Block", + "src": "2793:108:50", + "statements": [ + { + "expression": { + "components": [ + { + "arguments": [ + { + "hexValue": "30", + "id": 7943, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2823:1:50", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 7942, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "2815:7:50", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 7941, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2815:7:50", + "typeDescriptions": {} + } + }, + "id": 7944, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2815:10:50", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "expression": { + "id": 7945, + "name": "RecoverError", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7891, + "src": "2827:12:50", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_RecoverError_$7891_$", + "typeString": "type(enum ECDSA.RecoverError)" + } + }, + "id": 7946, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "2840:22:50", + "memberName": "InvalidSignatureLength", + "nodeType": "MemberAccess", + "referencedDeclaration": 7889, + "src": "2827:35:50", + "typeDescriptions": { + "typeIdentifier": "t_enum$_RecoverError_$7891", + "typeString": "enum ECDSA.RecoverError" + } + }, + { + "arguments": [ + { + "expression": { + "id": 7949, + "name": "signature", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7909, + "src": "2872:9:50", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 7950, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "2882:6:50", + "memberName": "length", + "nodeType": "MemberAccess", + "src": "2872:16:50", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 7948, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "2864:7:50", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes32_$", + "typeString": "type(bytes32)" + }, + "typeName": { + "id": 7947, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "2864:7:50", + "typeDescriptions": {} + } + }, + "id": 7951, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2864:25:50", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "id": 7952, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "2814:76:50", + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_address_$_t_enum$_RecoverError_$7891_$_t_bytes32_$", + "typeString": "tuple(address,enum ECDSA.RecoverError,bytes32)" + } + }, + "functionReturnParameters": 7918, + "id": 7953, + "nodeType": "Return", + "src": "2807:83:50" + } + ] + }, + "id": 7955, + "nodeType": "IfStatement", + "src": "2295:606:50", + "trueBody": { + "id": 7940, + "nodeType": "Block", + "src": "2323:464:50", + "statements": [ + { + "assignments": [ + 7924 + ], + "declarations": [ + { + "constant": false, + "id": 7924, + "mutability": "mutable", + "name": "r", + "nameLocation": "2345:1:50", + "nodeType": "VariableDeclaration", + "scope": 7940, + "src": "2337:9:50", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 7923, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "2337:7:50", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "id": 7925, + "nodeType": "VariableDeclarationStatement", + "src": "2337:9:50" + }, + { + "assignments": [ + 7927 + ], + "declarations": [ + { + "constant": false, + "id": 7927, + "mutability": "mutable", + "name": "s", + "nameLocation": "2368:1:50", + "nodeType": "VariableDeclaration", + "scope": 7940, + "src": "2360:9:50", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 7926, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "2360:7:50", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "id": 7928, + "nodeType": "VariableDeclarationStatement", + "src": "2360:9:50" + }, + { + "assignments": [ + 7930 + ], + "declarations": [ + { + "constant": false, + "id": 7930, + "mutability": "mutable", + "name": "v", + "nameLocation": "2389:1:50", + "nodeType": "VariableDeclaration", + "scope": 7940, + "src": "2383:7:50", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "typeName": { + "id": 7929, + "name": "uint8", + "nodeType": "ElementaryTypeName", + "src": "2383:5:50", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "visibility": "internal" + } + ], + "id": 7931, + "nodeType": "VariableDeclarationStatement", + "src": "2383:7:50" + }, + { + "AST": { + "nativeSrc": "2560:171:50", + "nodeType": "YulBlock", + "src": "2560:171:50", + "statements": [ + { + "nativeSrc": "2578:32:50", + "nodeType": "YulAssignment", + "src": "2578:32:50", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "signature", + "nativeSrc": "2593:9:50", + "nodeType": "YulIdentifier", + "src": "2593:9:50" + }, + { + "kind": "number", + "nativeSrc": "2604:4:50", + "nodeType": "YulLiteral", + "src": "2604:4:50", + "type": "", + "value": "0x20" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "2589:3:50", + "nodeType": "YulIdentifier", + "src": "2589:3:50" + }, + "nativeSrc": "2589:20:50", + "nodeType": "YulFunctionCall", + "src": "2589:20:50" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "2583:5:50", + "nodeType": "YulIdentifier", + "src": "2583:5:50" + }, + "nativeSrc": "2583:27:50", + "nodeType": "YulFunctionCall", + "src": "2583:27:50" + }, + "variableNames": [ + { + "name": "r", + "nativeSrc": "2578:1:50", + "nodeType": "YulIdentifier", + "src": "2578:1:50" + } + ] + }, + { + "nativeSrc": "2627:32:50", + "nodeType": "YulAssignment", + "src": "2627:32:50", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "signature", + "nativeSrc": "2642:9:50", + "nodeType": "YulIdentifier", + "src": "2642:9:50" + }, + { + "kind": "number", + "nativeSrc": "2653:4:50", + "nodeType": "YulLiteral", + "src": "2653:4:50", + "type": "", + "value": "0x40" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "2638:3:50", + "nodeType": "YulIdentifier", + "src": "2638:3:50" + }, + "nativeSrc": "2638:20:50", + "nodeType": "YulFunctionCall", + "src": "2638:20:50" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "2632:5:50", + "nodeType": "YulIdentifier", + "src": "2632:5:50" + }, + "nativeSrc": "2632:27:50", + "nodeType": "YulFunctionCall", + "src": "2632:27:50" + }, + "variableNames": [ + { + "name": "s", + "nativeSrc": "2627:1:50", + "nodeType": "YulIdentifier", + "src": "2627:1:50" + } + ] + }, + { + "nativeSrc": "2676:41:50", + "nodeType": "YulAssignment", + "src": "2676:41:50", + "value": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "2686:1:50", + "nodeType": "YulLiteral", + "src": "2686:1:50", + "type": "", + "value": "0" + }, + { + "arguments": [ + { + "arguments": [ + { + "name": "signature", + "nativeSrc": "2699:9:50", + "nodeType": "YulIdentifier", + "src": "2699:9:50" + }, + { + "kind": "number", + "nativeSrc": "2710:4:50", + "nodeType": "YulLiteral", + "src": "2710:4:50", + "type": "", + "value": "0x60" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "2695:3:50", + "nodeType": "YulIdentifier", + "src": "2695:3:50" + }, + "nativeSrc": "2695:20:50", + "nodeType": "YulFunctionCall", + "src": "2695:20:50" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "2689:5:50", + "nodeType": "YulIdentifier", + "src": "2689:5:50" + }, + "nativeSrc": "2689:27:50", + "nodeType": "YulFunctionCall", + "src": "2689:27:50" + } + ], + "functionName": { + "name": "byte", + "nativeSrc": "2681:4:50", + "nodeType": "YulIdentifier", + "src": "2681:4:50" + }, + "nativeSrc": "2681:36:50", + "nodeType": "YulFunctionCall", + "src": "2681:36:50" + }, + "variableNames": [ + { + "name": "v", + "nativeSrc": "2676:1:50", + "nodeType": "YulIdentifier", + "src": "2676:1:50" + } + ] + } + ] + }, + "evmVersion": "paris", + "externalReferences": [ + { + "declaration": 7924, + "isOffset": false, + "isSlot": false, + "src": "2578:1:50", + "valueSize": 1 + }, + { + "declaration": 7927, + "isOffset": false, + "isSlot": false, + "src": "2627:1:50", + "valueSize": 1 + }, + { + "declaration": 7909, + "isOffset": false, + "isSlot": false, + "src": "2593:9:50", + "valueSize": 1 + }, + { + "declaration": 7909, + "isOffset": false, + "isSlot": false, + "src": "2642:9:50", + "valueSize": 1 + }, + { + "declaration": 7909, + "isOffset": false, + "isSlot": false, + "src": "2699:9:50", + "valueSize": 1 + }, + { + "declaration": 7930, + "isOffset": false, + "isSlot": false, + "src": "2676:1:50", + "valueSize": 1 + } + ], + "flags": [ + "memory-safe" + ], + "id": 7932, + "nodeType": "InlineAssembly", + "src": "2535:196:50" + }, + { + "expression": { + "arguments": [ + { + "id": 7934, + "name": "hash", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7907, + "src": "2762:4:50", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "id": 7935, + "name": "v", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7930, + "src": "2768:1:50", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + { + "id": 7936, + "name": "r", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7924, + "src": "2771:1:50", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "id": 7937, + "name": "s", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7927, + "src": "2774:1:50", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 7933, + "name": "tryRecover", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 7957, + 8037, + 8145 + ], + "referencedDeclaration": 8145, + "src": "2751:10:50", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_bytes32_$_t_uint8_$_t_bytes32_$_t_bytes32_$returns$_t_address_$_t_enum$_RecoverError_$7891_$_t_bytes32_$", + "typeString": "function (bytes32,uint8,bytes32,bytes32) pure returns (address,enum ECDSA.RecoverError,bytes32)" + } + }, + "id": 7938, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2751:25:50", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_address_$_t_enum$_RecoverError_$7891_$_t_bytes32_$", + "typeString": "tuple(address,enum ECDSA.RecoverError,bytes32)" + } + }, + "functionReturnParameters": 7918, + "id": 7939, + "nodeType": "Return", + "src": "2744:32:50" + } + ] + } + } + ] + }, + "documentation": { + "id": 7905, + "nodeType": "StructuredDocumentation", + "src": "857:1267:50", + "text": " @dev Returns the address that signed a hashed message (`hash`) with `signature` or an error. This will not\n return address(0) without also returning an error description. Errors are documented using an enum (error type)\n and a bytes32 providing additional information about the error.\n If no error is returned, then the address can be used for verification purposes.\n The `ecrecover` EVM precompile allows for malleable (non-unique) signatures:\n this function rejects them by requiring the `s` value to be in the lower\n half order, and the `v` value to be either 27 or 28.\n IMPORTANT: `hash` _must_ be the result of a hash operation for the\n verification to be secure: it is possible to craft signatures that\n recover to arbitrary addresses for non-hashed data. A safe way to ensure\n this is by receiving a hash of the original message (which may otherwise\n be too long), and then calling {MessageHashUtils-toEthSignedMessageHash} on it.\n Documentation for signature generation:\n - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]\n - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]" + }, + "id": 7957, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "tryRecover", + "nameLocation": "2138:10:50", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 7910, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 7907, + "mutability": "mutable", + "name": "hash", + "nameLocation": "2166:4:50", + "nodeType": "VariableDeclaration", + "scope": 7957, + "src": "2158:12:50", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 7906, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "2158:7:50", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 7909, + "mutability": "mutable", + "name": "signature", + "nameLocation": "2193:9:50", + "nodeType": "VariableDeclaration", + "scope": 7957, + "src": "2180:22:50", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 7908, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "2180:5:50", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "src": "2148:60:50" + }, + "returnParameters": { + "id": 7918, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 7912, + "mutability": "mutable", + "name": "recovered", + "nameLocation": "2240:9:50", + "nodeType": "VariableDeclaration", + "scope": 7957, + "src": "2232:17:50", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 7911, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2232:7:50", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 7915, + "mutability": "mutable", + "name": "err", + "nameLocation": "2264:3:50", + "nodeType": "VariableDeclaration", + "scope": 7957, + "src": "2251:16:50", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_RecoverError_$7891", + "typeString": "enum ECDSA.RecoverError" + }, + "typeName": { + "id": 7914, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 7913, + "name": "RecoverError", + "nameLocations": [ + "2251:12:50" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 7891, + "src": "2251:12:50" + }, + "referencedDeclaration": 7891, + "src": "2251:12:50", + "typeDescriptions": { + "typeIdentifier": "t_enum$_RecoverError_$7891", + "typeString": "enum ECDSA.RecoverError" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 7917, + "mutability": "mutable", + "name": "errArg", + "nameLocation": "2277:6:50", + "nodeType": "VariableDeclaration", + "scope": 7957, + "src": "2269:14:50", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 7916, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "2269:7:50", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "2231:53:50" + }, + "scope": 8231, + "src": "2129:778:50", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 7986, + "nodeType": "Block", + "src": "3801:168:50", + "statements": [ + { + "assignments": [ + 7968, + 7971, + 7973 + ], + "declarations": [ + { + "constant": false, + "id": 7968, + "mutability": "mutable", + "name": "recovered", + "nameLocation": "3820:9:50", + "nodeType": "VariableDeclaration", + "scope": 7986, + "src": "3812:17:50", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 7967, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3812:7:50", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 7971, + "mutability": "mutable", + "name": "error", + "nameLocation": "3844:5:50", + "nodeType": "VariableDeclaration", + "scope": 7986, + "src": "3831:18:50", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_RecoverError_$7891", + "typeString": "enum ECDSA.RecoverError" + }, + "typeName": { + "id": 7970, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 7969, + "name": "RecoverError", + "nameLocations": [ + "3831:12:50" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 7891, + "src": "3831:12:50" + }, + "referencedDeclaration": 7891, + "src": "3831:12:50", + "typeDescriptions": { + "typeIdentifier": "t_enum$_RecoverError_$7891", + "typeString": "enum ECDSA.RecoverError" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 7973, + "mutability": "mutable", + "name": "errorArg", + "nameLocation": "3859:8:50", + "nodeType": "VariableDeclaration", + "scope": 7986, + "src": "3851:16:50", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 7972, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "3851:7:50", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "id": 7978, + "initialValue": { + "arguments": [ + { + "id": 7975, + "name": "hash", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7960, + "src": "3882:4:50", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "id": 7976, + "name": "signature", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7962, + "src": "3888:9:50", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 7974, + "name": "tryRecover", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 7957, + 8037, + 8145 + ], + "referencedDeclaration": 7957, + "src": "3871:10:50", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_bytes32_$_t_bytes_memory_ptr_$returns$_t_address_$_t_enum$_RecoverError_$7891_$_t_bytes32_$", + "typeString": "function (bytes32,bytes memory) pure returns (address,enum ECDSA.RecoverError,bytes32)" + } + }, + "id": 7977, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3871:27:50", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_address_$_t_enum$_RecoverError_$7891_$_t_bytes32_$", + "typeString": "tuple(address,enum ECDSA.RecoverError,bytes32)" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "3811:87:50" + }, + { + "expression": { + "arguments": [ + { + "id": 7980, + "name": "error", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7971, + "src": "3920:5:50", + "typeDescriptions": { + "typeIdentifier": "t_enum$_RecoverError_$7891", + "typeString": "enum ECDSA.RecoverError" + } + }, + { + "id": 7981, + "name": "errorArg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7973, + "src": "3927:8:50", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_RecoverError_$7891", + "typeString": "enum ECDSA.RecoverError" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 7979, + "name": "_throwError", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8230, + "src": "3908:11:50", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_enum$_RecoverError_$7891_$_t_bytes32_$returns$__$", + "typeString": "function (enum ECDSA.RecoverError,bytes32) pure" + } + }, + "id": 7982, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3908:28:50", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 7983, + "nodeType": "ExpressionStatement", + "src": "3908:28:50" + }, + { + "expression": { + "id": 7984, + "name": "recovered", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7968, + "src": "3953:9:50", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "functionReturnParameters": 7966, + "id": 7985, + "nodeType": "Return", + "src": "3946:16:50" + } + ] + }, + "documentation": { + "id": 7958, + "nodeType": "StructuredDocumentation", + "src": "2913:796:50", + "text": " @dev Returns the address that signed a hashed message (`hash`) with\n `signature`. This address can then be used for verification purposes.\n The `ecrecover` EVM precompile allows for malleable (non-unique) signatures:\n this function rejects them by requiring the `s` value to be in the lower\n half order, and the `v` value to be either 27 or 28.\n IMPORTANT: `hash` _must_ be the result of a hash operation for the\n verification to be secure: it is possible to craft signatures that\n recover to arbitrary addresses for non-hashed data. A safe way to ensure\n this is by receiving a hash of the original message (which may otherwise\n be too long), and then calling {MessageHashUtils-toEthSignedMessageHash} on it." + }, + "id": 7987, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "recover", + "nameLocation": "3723:7:50", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 7963, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 7960, + "mutability": "mutable", + "name": "hash", + "nameLocation": "3739:4:50", + "nodeType": "VariableDeclaration", + "scope": 7987, + "src": "3731:12:50", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 7959, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "3731:7:50", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 7962, + "mutability": "mutable", + "name": "signature", + "nameLocation": "3758:9:50", + "nodeType": "VariableDeclaration", + "scope": 7987, + "src": "3745:22:50", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 7961, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "3745:5:50", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "src": "3730:38:50" + }, + "returnParameters": { + "id": 7966, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 7965, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 7987, + "src": "3792:7:50", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 7964, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3792:7:50", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "3791:9:50" + }, + "scope": 8231, + "src": "3714:255:50", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 8036, + "nodeType": "Block", + "src": "4348:342:50", + "statements": [ + { + "id": 8035, + "nodeType": "UncheckedBlock", + "src": "4358:326:50", + "statements": [ + { + "assignments": [ + 8005 + ], + "declarations": [ + { + "constant": false, + "id": 8005, + "mutability": "mutable", + "name": "s", + "nameLocation": "4390:1:50", + "nodeType": "VariableDeclaration", + "scope": 8035, + "src": "4382:9:50", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 8004, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "4382:7:50", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "id": 8012, + "initialValue": { + "commonType": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "id": 8011, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 8006, + "name": "vs", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7994, + "src": "4394:2:50", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "BinaryOperation", + "operator": "&", + "rightExpression": { + "arguments": [ + { + "hexValue": "307837666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666", + "id": 8009, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4407:66:50", + "typeDescriptions": { + "typeIdentifier": "t_rational_57896044618658097711785492504343953926634992332820282019728792003956564819967_by_1", + "typeString": "int_const 5789...(69 digits omitted)...9967" + }, + "value": "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_57896044618658097711785492504343953926634992332820282019728792003956564819967_by_1", + "typeString": "int_const 5789...(69 digits omitted)...9967" + } + ], + "id": 8008, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "4399:7:50", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes32_$", + "typeString": "type(bytes32)" + }, + "typeName": { + "id": 8007, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "4399:7:50", + "typeDescriptions": {} + } + }, + "id": 8010, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4399:75:50", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "src": "4394:80:50", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "4382:92:50" + }, + { + "assignments": [ + 8014 + ], + "declarations": [ + { + "constant": false, + "id": 8014, + "mutability": "mutable", + "name": "v", + "nameLocation": "4591:1:50", + "nodeType": "VariableDeclaration", + "scope": 8035, + "src": "4585:7:50", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "typeName": { + "id": 8013, + "name": "uint8", + "nodeType": "ElementaryTypeName", + "src": "4585:5:50", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "visibility": "internal" + } + ], + "id": 8027, + "initialValue": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 8025, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 8022, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "arguments": [ + { + "id": 8019, + "name": "vs", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7994, + "src": "4610:2:50", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 8018, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "4602:7:50", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + }, + "typeName": { + "id": 8017, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "4602:7:50", + "typeDescriptions": {} + } + }, + "id": 8020, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4602:11:50", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">>", + "rightExpression": { + "hexValue": "323535", + "id": 8021, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4617:3:50", + "typeDescriptions": { + "typeIdentifier": "t_rational_255_by_1", + "typeString": "int_const 255" + }, + "value": "255" + }, + "src": "4602:18:50", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 8023, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "4601:20:50", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "hexValue": "3237", + "id": 8024, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4624:2:50", + "typeDescriptions": { + "typeIdentifier": "t_rational_27_by_1", + "typeString": "int_const 27" + }, + "value": "27" + }, + "src": "4601:25:50", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 8016, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "4595:5:50", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint8_$", + "typeString": "type(uint8)" + }, + "typeName": { + "id": 8015, + "name": "uint8", + "nodeType": "ElementaryTypeName", + "src": "4595:5:50", + "typeDescriptions": {} + } + }, + "id": 8026, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4595:32:50", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "4585:42:50" + }, + { + "expression": { + "arguments": [ + { + "id": 8029, + "name": "hash", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7990, + "src": "4659:4:50", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "id": 8030, + "name": "v", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8014, + "src": "4665:1:50", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + { + "id": 8031, + "name": "r", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7992, + "src": "4668:1:50", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "id": 8032, + "name": "s", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8005, + "src": "4671:1:50", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 8028, + "name": "tryRecover", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 7957, + 8037, + 8145 + ], + "referencedDeclaration": 8145, + "src": "4648:10:50", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_bytes32_$_t_uint8_$_t_bytes32_$_t_bytes32_$returns$_t_address_$_t_enum$_RecoverError_$7891_$_t_bytes32_$", + "typeString": "function (bytes32,uint8,bytes32,bytes32) pure returns (address,enum ECDSA.RecoverError,bytes32)" + } + }, + "id": 8033, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4648:25:50", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_address_$_t_enum$_RecoverError_$7891_$_t_bytes32_$", + "typeString": "tuple(address,enum ECDSA.RecoverError,bytes32)" + } + }, + "functionReturnParameters": 8003, + "id": 8034, + "nodeType": "Return", + "src": "4641:32:50" + } + ] + } + ] + }, + "documentation": { + "id": 7988, + "nodeType": "StructuredDocumentation", + "src": "3975:205:50", + "text": " @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.\n See https://eips.ethereum.org/EIPS/eip-2098[ERC-2098 short signatures]" + }, + "id": 8037, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "tryRecover", + "nameLocation": "4194:10:50", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 7995, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 7990, + "mutability": "mutable", + "name": "hash", + "nameLocation": "4222:4:50", + "nodeType": "VariableDeclaration", + "scope": 8037, + "src": "4214:12:50", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 7989, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "4214:7:50", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 7992, + "mutability": "mutable", + "name": "r", + "nameLocation": "4244:1:50", + "nodeType": "VariableDeclaration", + "scope": 8037, + "src": "4236:9:50", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 7991, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "4236:7:50", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 7994, + "mutability": "mutable", + "name": "vs", + "nameLocation": "4263:2:50", + "nodeType": "VariableDeclaration", + "scope": 8037, + "src": "4255:10:50", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 7993, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "4255:7:50", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "4204:67:50" + }, + "returnParameters": { + "id": 8003, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 7997, + "mutability": "mutable", + "name": "recovered", + "nameLocation": "4303:9:50", + "nodeType": "VariableDeclaration", + "scope": 8037, + "src": "4295:17:50", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 7996, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4295:7:50", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 8000, + "mutability": "mutable", + "name": "err", + "nameLocation": "4327:3:50", + "nodeType": "VariableDeclaration", + "scope": 8037, + "src": "4314:16:50", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_RecoverError_$7891", + "typeString": "enum ECDSA.RecoverError" + }, + "typeName": { + "id": 7999, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 7998, + "name": "RecoverError", + "nameLocations": [ + "4314:12:50" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 7891, + "src": "4314:12:50" + }, + "referencedDeclaration": 7891, + "src": "4314:12:50", + "typeDescriptions": { + "typeIdentifier": "t_enum$_RecoverError_$7891", + "typeString": "enum ECDSA.RecoverError" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 8002, + "mutability": "mutable", + "name": "errArg", + "nameLocation": "4340:6:50", + "nodeType": "VariableDeclaration", + "scope": 8037, + "src": "4332:14:50", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 8001, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "4332:7:50", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "4294:53:50" + }, + "scope": 8231, + "src": "4185:505:50", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 8069, + "nodeType": "Block", + "src": "4903:164:50", + "statements": [ + { + "assignments": [ + 8050, + 8053, + 8055 + ], + "declarations": [ + { + "constant": false, + "id": 8050, + "mutability": "mutable", + "name": "recovered", + "nameLocation": "4922:9:50", + "nodeType": "VariableDeclaration", + "scope": 8069, + "src": "4914:17:50", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 8049, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4914:7:50", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 8053, + "mutability": "mutable", + "name": "error", + "nameLocation": "4946:5:50", + "nodeType": "VariableDeclaration", + "scope": 8069, + "src": "4933:18:50", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_RecoverError_$7891", + "typeString": "enum ECDSA.RecoverError" + }, + "typeName": { + "id": 8052, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 8051, + "name": "RecoverError", + "nameLocations": [ + "4933:12:50" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 7891, + "src": "4933:12:50" + }, + "referencedDeclaration": 7891, + "src": "4933:12:50", + "typeDescriptions": { + "typeIdentifier": "t_enum$_RecoverError_$7891", + "typeString": "enum ECDSA.RecoverError" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 8055, + "mutability": "mutable", + "name": "errorArg", + "nameLocation": "4961:8:50", + "nodeType": "VariableDeclaration", + "scope": 8069, + "src": "4953:16:50", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 8054, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "4953:7:50", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "id": 8061, + "initialValue": { + "arguments": [ + { + "id": 8057, + "name": "hash", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8040, + "src": "4984:4:50", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "id": 8058, + "name": "r", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8042, + "src": "4990:1:50", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "id": 8059, + "name": "vs", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8044, + "src": "4993:2:50", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 8056, + "name": "tryRecover", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 7957, + 8037, + 8145 + ], + "referencedDeclaration": 8037, + "src": "4973:10:50", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_bytes32_$_t_bytes32_$_t_bytes32_$returns$_t_address_$_t_enum$_RecoverError_$7891_$_t_bytes32_$", + "typeString": "function (bytes32,bytes32,bytes32) pure returns (address,enum ECDSA.RecoverError,bytes32)" + } + }, + "id": 8060, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4973:23:50", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_address_$_t_enum$_RecoverError_$7891_$_t_bytes32_$", + "typeString": "tuple(address,enum ECDSA.RecoverError,bytes32)" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "4913:83:50" + }, + { + "expression": { + "arguments": [ + { + "id": 8063, + "name": "error", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8053, + "src": "5018:5:50", + "typeDescriptions": { + "typeIdentifier": "t_enum$_RecoverError_$7891", + "typeString": "enum ECDSA.RecoverError" + } + }, + { + "id": 8064, + "name": "errorArg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8055, + "src": "5025:8:50", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_RecoverError_$7891", + "typeString": "enum ECDSA.RecoverError" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 8062, + "name": "_throwError", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8230, + "src": "5006:11:50", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_enum$_RecoverError_$7891_$_t_bytes32_$returns$__$", + "typeString": "function (enum ECDSA.RecoverError,bytes32) pure" + } + }, + "id": 8065, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5006:28:50", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 8066, + "nodeType": "ExpressionStatement", + "src": "5006:28:50" + }, + { + "expression": { + "id": 8067, + "name": "recovered", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8050, + "src": "5051:9:50", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "functionReturnParameters": 8048, + "id": 8068, + "nodeType": "Return", + "src": "5044:16:50" + } + ] + }, + "documentation": { + "id": 8038, + "nodeType": "StructuredDocumentation", + "src": "4696:116:50", + "text": " @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately." + }, + "id": 8070, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "recover", + "nameLocation": "4826:7:50", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 8045, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8040, + "mutability": "mutable", + "name": "hash", + "nameLocation": "4842:4:50", + "nodeType": "VariableDeclaration", + "scope": 8070, + "src": "4834:12:50", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 8039, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "4834:7:50", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 8042, + "mutability": "mutable", + "name": "r", + "nameLocation": "4856:1:50", + "nodeType": "VariableDeclaration", + "scope": 8070, + "src": "4848:9:50", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 8041, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "4848:7:50", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 8044, + "mutability": "mutable", + "name": "vs", + "nameLocation": "4867:2:50", + "nodeType": "VariableDeclaration", + "scope": 8070, + "src": "4859:10:50", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 8043, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "4859:7:50", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "4833:37:50" + }, + "returnParameters": { + "id": 8048, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8047, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 8070, + "src": "4894:7:50", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 8046, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4894:7:50", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "4893:9:50" + }, + "scope": 8231, + "src": "4817:250:50", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 8144, + "nodeType": "Block", + "src": "5382:1372:50", + "statements": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 8094, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "arguments": [ + { + "id": 8091, + "name": "s", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8079, + "src": "6278:1:50", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 8090, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "6270:7:50", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + }, + "typeName": { + "id": 8089, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "6270:7:50", + "typeDescriptions": {} + } + }, + "id": 8092, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "6270:10:50", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "hexValue": "307837464646464646464646464646464646464646464646464646464646464646463544353736453733353741343530314444464539324634363638314232304130", + "id": 8093, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6283:66:50", + "typeDescriptions": { + "typeIdentifier": "t_rational_57896044618658097711785492504343953926418782139537452191302581570759080747168_by_1", + "typeString": "int_const 5789...(69 digits omitted)...7168" + }, + "value": "0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0" + }, + "src": "6270:79:50", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 8105, + "nodeType": "IfStatement", + "src": "6266:164:50", + "trueBody": { + "id": 8104, + "nodeType": "Block", + "src": "6351:79:50", + "statements": [ + { + "expression": { + "components": [ + { + "arguments": [ + { + "hexValue": "30", + "id": 8097, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6381:1:50", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 8096, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "6373:7:50", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 8095, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6373:7:50", + "typeDescriptions": {} + } + }, + "id": 8098, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "6373:10:50", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "expression": { + "id": 8099, + "name": "RecoverError", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7891, + "src": "6385:12:50", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_RecoverError_$7891_$", + "typeString": "type(enum ECDSA.RecoverError)" + } + }, + "id": 8100, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "6398:17:50", + "memberName": "InvalidSignatureS", + "nodeType": "MemberAccess", + "referencedDeclaration": 7890, + "src": "6385:30:50", + "typeDescriptions": { + "typeIdentifier": "t_enum$_RecoverError_$7891", + "typeString": "enum ECDSA.RecoverError" + } + }, + { + "id": 8101, + "name": "s", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8079, + "src": "6417:1:50", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "id": 8102, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "6372:47:50", + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_address_$_t_enum$_RecoverError_$7891_$_t_bytes32_$", + "typeString": "tuple(address,enum ECDSA.RecoverError,bytes32)" + } + }, + "functionReturnParameters": 8088, + "id": 8103, + "nodeType": "Return", + "src": "6365:54:50" + } + ] + } + }, + { + "assignments": [ + 8107 + ], + "declarations": [ + { + "constant": false, + "id": 8107, + "mutability": "mutable", + "name": "signer", + "nameLocation": "6532:6:50", + "nodeType": "VariableDeclaration", + "scope": 8144, + "src": "6524:14:50", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 8106, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6524:7:50", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "id": 8114, + "initialValue": { + "arguments": [ + { + "id": 8109, + "name": "hash", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8073, + "src": "6551:4:50", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "id": 8110, + "name": "v", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8075, + "src": "6557:1:50", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + { + "id": 8111, + "name": "r", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8077, + "src": "6560:1:50", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "id": 8112, + "name": "s", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8079, + "src": "6563:1:50", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 8108, + "name": "ecrecover", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -6, + "src": "6541:9:50", + "typeDescriptions": { + "typeIdentifier": "t_function_ecrecover_pure$_t_bytes32_$_t_uint8_$_t_bytes32_$_t_bytes32_$returns$_t_address_$", + "typeString": "function (bytes32,uint8,bytes32,bytes32) pure returns (address)" + } + }, + "id": 8113, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "6541:24:50", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "6524:41:50" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 8120, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 8115, + "name": "signer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8107, + "src": "6579:6:50", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "arguments": [ + { + "hexValue": "30", + "id": 8118, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6597:1:50", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 8117, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "6589:7:50", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 8116, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6589:7:50", + "typeDescriptions": {} + } + }, + "id": 8119, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "6589:10:50", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "6579:20:50", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 8134, + "nodeType": "IfStatement", + "src": "6575:113:50", + "trueBody": { + "id": 8133, + "nodeType": "Block", + "src": "6601:87:50", + "statements": [ + { + "expression": { + "components": [ + { + "arguments": [ + { + "hexValue": "30", + "id": 8123, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6631:1:50", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 8122, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "6623:7:50", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 8121, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6623:7:50", + "typeDescriptions": {} + } + }, + "id": 8124, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "6623:10:50", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "expression": { + "id": 8125, + "name": "RecoverError", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7891, + "src": "6635:12:50", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_RecoverError_$7891_$", + "typeString": "type(enum ECDSA.RecoverError)" + } + }, + "id": 8126, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "6648:16:50", + "memberName": "InvalidSignature", + "nodeType": "MemberAccess", + "referencedDeclaration": 7888, + "src": "6635:29:50", + "typeDescriptions": { + "typeIdentifier": "t_enum$_RecoverError_$7891", + "typeString": "enum ECDSA.RecoverError" + } + }, + { + "arguments": [ + { + "hexValue": "30", + "id": 8129, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6674:1:50", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 8128, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "6666:7:50", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes32_$", + "typeString": "type(bytes32)" + }, + "typeName": { + "id": 8127, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "6666:7:50", + "typeDescriptions": {} + } + }, + "id": 8130, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "6666:10:50", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "id": 8131, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "6622:55:50", + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_address_$_t_enum$_RecoverError_$7891_$_t_bytes32_$", + "typeString": "tuple(address,enum ECDSA.RecoverError,bytes32)" + } + }, + "functionReturnParameters": 8088, + "id": 8132, + "nodeType": "Return", + "src": "6615:62:50" + } + ] + } + }, + { + "expression": { + "components": [ + { + "id": 8135, + "name": "signer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8107, + "src": "6706:6:50", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "expression": { + "id": 8136, + "name": "RecoverError", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7891, + "src": "6714:12:50", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_RecoverError_$7891_$", + "typeString": "type(enum ECDSA.RecoverError)" + } + }, + "id": 8137, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "6727:7:50", + "memberName": "NoError", + "nodeType": "MemberAccess", + "referencedDeclaration": 7887, + "src": "6714:20:50", + "typeDescriptions": { + "typeIdentifier": "t_enum$_RecoverError_$7891", + "typeString": "enum ECDSA.RecoverError" + } + }, + { + "arguments": [ + { + "hexValue": "30", + "id": 8140, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6744:1:50", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 8139, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "6736:7:50", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes32_$", + "typeString": "type(bytes32)" + }, + "typeName": { + "id": 8138, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "6736:7:50", + "typeDescriptions": {} + } + }, + "id": 8141, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "6736:10:50", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "id": 8142, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "6705:42:50", + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_address_$_t_enum$_RecoverError_$7891_$_t_bytes32_$", + "typeString": "tuple(address,enum ECDSA.RecoverError,bytes32)" + } + }, + "functionReturnParameters": 8088, + "id": 8143, + "nodeType": "Return", + "src": "6698:49:50" + } + ] + }, + "documentation": { + "id": 8071, + "nodeType": "StructuredDocumentation", + "src": "5073:125:50", + "text": " @dev Overload of {ECDSA-tryRecover} that receives the `v`,\n `r` and `s` signature fields separately." + }, + "id": 8145, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "tryRecover", + "nameLocation": "5212:10:50", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 8080, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8073, + "mutability": "mutable", + "name": "hash", + "nameLocation": "5240:4:50", + "nodeType": "VariableDeclaration", + "scope": 8145, + "src": "5232:12:50", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 8072, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "5232:7:50", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 8075, + "mutability": "mutable", + "name": "v", + "nameLocation": "5260:1:50", + "nodeType": "VariableDeclaration", + "scope": 8145, + "src": "5254:7:50", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "typeName": { + "id": 8074, + "name": "uint8", + "nodeType": "ElementaryTypeName", + "src": "5254:5:50", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 8077, + "mutability": "mutable", + "name": "r", + "nameLocation": "5279:1:50", + "nodeType": "VariableDeclaration", + "scope": 8145, + "src": "5271:9:50", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 8076, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "5271:7:50", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 8079, + "mutability": "mutable", + "name": "s", + "nameLocation": "5298:1:50", + "nodeType": "VariableDeclaration", + "scope": 8145, + "src": "5290:9:50", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 8078, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "5290:7:50", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "5222:83:50" + }, + "returnParameters": { + "id": 8088, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8082, + "mutability": "mutable", + "name": "recovered", + "nameLocation": "5337:9:50", + "nodeType": "VariableDeclaration", + "scope": 8145, + "src": "5329:17:50", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 8081, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5329:7:50", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 8085, + "mutability": "mutable", + "name": "err", + "nameLocation": "5361:3:50", + "nodeType": "VariableDeclaration", + "scope": 8145, + "src": "5348:16:50", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_RecoverError_$7891", + "typeString": "enum ECDSA.RecoverError" + }, + "typeName": { + "id": 8084, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 8083, + "name": "RecoverError", + "nameLocations": [ + "5348:12:50" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 7891, + "src": "5348:12:50" + }, + "referencedDeclaration": 7891, + "src": "5348:12:50", + "typeDescriptions": { + "typeIdentifier": "t_enum$_RecoverError_$7891", + "typeString": "enum ECDSA.RecoverError" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 8087, + "mutability": "mutable", + "name": "errArg", + "nameLocation": "5374:6:50", + "nodeType": "VariableDeclaration", + "scope": 8145, + "src": "5366:14:50", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 8086, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "5366:7:50", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "5328:53:50" + }, + "scope": 8231, + "src": "5203:1551:50", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 8180, + "nodeType": "Block", + "src": "6981:166:50", + "statements": [ + { + "assignments": [ + 8160, + 8163, + 8165 + ], + "declarations": [ + { + "constant": false, + "id": 8160, + "mutability": "mutable", + "name": "recovered", + "nameLocation": "7000:9:50", + "nodeType": "VariableDeclaration", + "scope": 8180, + "src": "6992:17:50", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 8159, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6992:7:50", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 8163, + "mutability": "mutable", + "name": "error", + "nameLocation": "7024:5:50", + "nodeType": "VariableDeclaration", + "scope": 8180, + "src": "7011:18:50", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_RecoverError_$7891", + "typeString": "enum ECDSA.RecoverError" + }, + "typeName": { + "id": 8162, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 8161, + "name": "RecoverError", + "nameLocations": [ + "7011:12:50" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 7891, + "src": "7011:12:50" + }, + "referencedDeclaration": 7891, + "src": "7011:12:50", + "typeDescriptions": { + "typeIdentifier": "t_enum$_RecoverError_$7891", + "typeString": "enum ECDSA.RecoverError" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 8165, + "mutability": "mutable", + "name": "errorArg", + "nameLocation": "7039:8:50", + "nodeType": "VariableDeclaration", + "scope": 8180, + "src": "7031:16:50", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 8164, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "7031:7:50", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "id": 8172, + "initialValue": { + "arguments": [ + { + "id": 8167, + "name": "hash", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8148, + "src": "7062:4:50", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "id": 8168, + "name": "v", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8150, + "src": "7068:1:50", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + { + "id": 8169, + "name": "r", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8152, + "src": "7071:1:50", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "id": 8170, + "name": "s", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8154, + "src": "7074:1:50", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 8166, + "name": "tryRecover", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 7957, + 8037, + 8145 + ], + "referencedDeclaration": 8145, + "src": "7051:10:50", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_bytes32_$_t_uint8_$_t_bytes32_$_t_bytes32_$returns$_t_address_$_t_enum$_RecoverError_$7891_$_t_bytes32_$", + "typeString": "function (bytes32,uint8,bytes32,bytes32) pure returns (address,enum ECDSA.RecoverError,bytes32)" + } + }, + "id": 8171, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "7051:25:50", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_address_$_t_enum$_RecoverError_$7891_$_t_bytes32_$", + "typeString": "tuple(address,enum ECDSA.RecoverError,bytes32)" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "6991:85:50" + }, + { + "expression": { + "arguments": [ + { + "id": 8174, + "name": "error", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8163, + "src": "7098:5:50", + "typeDescriptions": { + "typeIdentifier": "t_enum$_RecoverError_$7891", + "typeString": "enum ECDSA.RecoverError" + } + }, + { + "id": 8175, + "name": "errorArg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8165, + "src": "7105:8:50", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_RecoverError_$7891", + "typeString": "enum ECDSA.RecoverError" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 8173, + "name": "_throwError", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8230, + "src": "7086:11:50", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_enum$_RecoverError_$7891_$_t_bytes32_$returns$__$", + "typeString": "function (enum ECDSA.RecoverError,bytes32) pure" + } + }, + "id": 8176, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "7086:28:50", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 8177, + "nodeType": "ExpressionStatement", + "src": "7086:28:50" + }, + { + "expression": { + "id": 8178, + "name": "recovered", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8160, + "src": "7131:9:50", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "functionReturnParameters": 8158, + "id": 8179, + "nodeType": "Return", + "src": "7124:16:50" + } + ] + }, + "documentation": { + "id": 8146, + "nodeType": "StructuredDocumentation", + "src": "6760:122:50", + "text": " @dev Overload of {ECDSA-recover} that receives the `v`,\n `r` and `s` signature fields separately." + }, + "id": 8181, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "recover", + "nameLocation": "6896:7:50", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 8155, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8148, + "mutability": "mutable", + "name": "hash", + "nameLocation": "6912:4:50", + "nodeType": "VariableDeclaration", + "scope": 8181, + "src": "6904:12:50", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 8147, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "6904:7:50", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 8150, + "mutability": "mutable", + "name": "v", + "nameLocation": "6924:1:50", + "nodeType": "VariableDeclaration", + "scope": 8181, + "src": "6918:7:50", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "typeName": { + "id": 8149, + "name": "uint8", + "nodeType": "ElementaryTypeName", + "src": "6918:5:50", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 8152, + "mutability": "mutable", + "name": "r", + "nameLocation": "6935:1:50", + "nodeType": "VariableDeclaration", + "scope": 8181, + "src": "6927:9:50", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 8151, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "6927:7:50", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 8154, + "mutability": "mutable", + "name": "s", + "nameLocation": "6946:1:50", + "nodeType": "VariableDeclaration", + "scope": 8181, + "src": "6938:9:50", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 8153, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "6938:7:50", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "6903:45:50" + }, + "returnParameters": { + "id": 8158, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8157, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 8181, + "src": "6972:7:50", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 8156, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6972:7:50", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "6971:9:50" + }, + "scope": 8231, + "src": "6887:260:50", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 8229, + "nodeType": "Block", + "src": "7352:460:50", + "statements": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_enum$_RecoverError_$7891", + "typeString": "enum ECDSA.RecoverError" + }, + "id": 8193, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 8190, + "name": "error", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8185, + "src": "7366:5:50", + "typeDescriptions": { + "typeIdentifier": "t_enum$_RecoverError_$7891", + "typeString": "enum ECDSA.RecoverError" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "expression": { + "id": 8191, + "name": "RecoverError", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7891, + "src": "7375:12:50", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_RecoverError_$7891_$", + "typeString": "type(enum ECDSA.RecoverError)" + } + }, + "id": 8192, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "7388:7:50", + "memberName": "NoError", + "nodeType": "MemberAccess", + "referencedDeclaration": 7887, + "src": "7375:20:50", + "typeDescriptions": { + "typeIdentifier": "t_enum$_RecoverError_$7891", + "typeString": "enum ECDSA.RecoverError" + } + }, + "src": "7366:29:50", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "condition": { + "commonType": { + "typeIdentifier": "t_enum$_RecoverError_$7891", + "typeString": "enum ECDSA.RecoverError" + }, + "id": 8199, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 8196, + "name": "error", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8185, + "src": "7462:5:50", + "typeDescriptions": { + "typeIdentifier": "t_enum$_RecoverError_$7891", + "typeString": "enum ECDSA.RecoverError" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "expression": { + "id": 8197, + "name": "RecoverError", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7891, + "src": "7471:12:50", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_RecoverError_$7891_$", + "typeString": "type(enum ECDSA.RecoverError)" + } + }, + "id": 8198, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "7484:16:50", + "memberName": "InvalidSignature", + "nodeType": "MemberAccess", + "referencedDeclaration": 7888, + "src": "7471:29:50", + "typeDescriptions": { + "typeIdentifier": "t_enum$_RecoverError_$7891", + "typeString": "enum ECDSA.RecoverError" + } + }, + "src": "7462:38:50", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "condition": { + "commonType": { + "typeIdentifier": "t_enum$_RecoverError_$7891", + "typeString": "enum ECDSA.RecoverError" + }, + "id": 8207, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 8204, + "name": "error", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8185, + "src": "7567:5:50", + "typeDescriptions": { + "typeIdentifier": "t_enum$_RecoverError_$7891", + "typeString": "enum ECDSA.RecoverError" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "expression": { + "id": 8205, + "name": "RecoverError", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7891, + "src": "7576:12:50", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_RecoverError_$7891_$", + "typeString": "type(enum ECDSA.RecoverError)" + } + }, + "id": 8206, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "7589:22:50", + "memberName": "InvalidSignatureLength", + "nodeType": "MemberAccess", + "referencedDeclaration": 7889, + "src": "7576:35:50", + "typeDescriptions": { + "typeIdentifier": "t_enum$_RecoverError_$7891", + "typeString": "enum ECDSA.RecoverError" + } + }, + "src": "7567:44:50", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "condition": { + "commonType": { + "typeIdentifier": "t_enum$_RecoverError_$7891", + "typeString": "enum ECDSA.RecoverError" + }, + "id": 8219, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 8216, + "name": "error", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8185, + "src": "7701:5:50", + "typeDescriptions": { + "typeIdentifier": "t_enum$_RecoverError_$7891", + "typeString": "enum ECDSA.RecoverError" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "expression": { + "id": 8217, + "name": "RecoverError", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7891, + "src": "7710:12:50", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_RecoverError_$7891_$", + "typeString": "type(enum ECDSA.RecoverError)" + } + }, + "id": 8218, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "7723:17:50", + "memberName": "InvalidSignatureS", + "nodeType": "MemberAccess", + "referencedDeclaration": 7890, + "src": "7710:30:50", + "typeDescriptions": { + "typeIdentifier": "t_enum$_RecoverError_$7891", + "typeString": "enum ECDSA.RecoverError" + } + }, + "src": "7701:39:50", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 8225, + "nodeType": "IfStatement", + "src": "7697:109:50", + "trueBody": { + "id": 8224, + "nodeType": "Block", + "src": "7742:64:50", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "id": 8221, + "name": "errorArg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8187, + "src": "7786:8:50", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 8220, + "name": "ECDSAInvalidSignatureS", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7904, + "src": "7763:22:50", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_bytes32_$returns$_t_error_$", + "typeString": "function (bytes32) pure returns (error)" + } + }, + "id": 8222, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "7763:32:50", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 8223, + "nodeType": "RevertStatement", + "src": "7756:39:50" + } + ] + } + }, + "id": 8226, + "nodeType": "IfStatement", + "src": "7563:243:50", + "trueBody": { + "id": 8215, + "nodeType": "Block", + "src": "7613:78:50", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "arguments": [ + { + "id": 8211, + "name": "errorArg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8187, + "src": "7670:8:50", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 8210, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "7662:7:50", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + }, + "typeName": { + "id": 8209, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "7662:7:50", + "typeDescriptions": {} + } + }, + "id": 8212, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "7662:17:50", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 8208, + "name": "ECDSAInvalidSignatureLength", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7899, + "src": "7634:27:50", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint256_$returns$_t_error_$", + "typeString": "function (uint256) pure returns (error)" + } + }, + "id": 8213, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "7634:46:50", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 8214, + "nodeType": "RevertStatement", + "src": "7627:53:50" + } + ] + } + }, + "id": 8227, + "nodeType": "IfStatement", + "src": "7458:348:50", + "trueBody": { + "id": 8203, + "nodeType": "Block", + "src": "7502:55:50", + "statements": [ + { + "errorCall": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 8200, + "name": "ECDSAInvalidSignature", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7894, + "src": "7523:21:50", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$__$returns$_t_error_$", + "typeString": "function () pure returns (error)" + } + }, + "id": 8201, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "7523:23:50", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 8202, + "nodeType": "RevertStatement", + "src": "7516:30:50" + } + ] + } + }, + "id": 8228, + "nodeType": "IfStatement", + "src": "7362:444:50", + "trueBody": { + "id": 8195, + "nodeType": "Block", + "src": "7397:55:50", + "statements": [ + { + "functionReturnParameters": 8189, + "id": 8194, + "nodeType": "Return", + "src": "7411:7:50" + } + ] + } + } + ] + }, + "documentation": { + "id": 8182, + "nodeType": "StructuredDocumentation", + "src": "7153:122:50", + "text": " @dev Optionally reverts with the corresponding custom error according to the `error` argument provided." + }, + "id": 8230, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_throwError", + "nameLocation": "7289:11:50", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 8188, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8185, + "mutability": "mutable", + "name": "error", + "nameLocation": "7314:5:50", + "nodeType": "VariableDeclaration", + "scope": 8230, + "src": "7301:18:50", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_RecoverError_$7891", + "typeString": "enum ECDSA.RecoverError" + }, + "typeName": { + "id": 8184, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 8183, + "name": "RecoverError", + "nameLocations": [ + "7301:12:50" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 7891, + "src": "7301:12:50" + }, + "referencedDeclaration": 7891, + "src": "7301:12:50", + "typeDescriptions": { + "typeIdentifier": "t_enum$_RecoverError_$7891", + "typeString": "enum ECDSA.RecoverError" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 8187, + "mutability": "mutable", + "name": "errorArg", + "nameLocation": "7329:8:50", + "nodeType": "VariableDeclaration", + "scope": 8230, + "src": "7321:16:50", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 8186, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "7321:7:50", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "7300:38:50" + }, + "returnParameters": { + "id": 8189, + "nodeType": "ParameterList", + "parameters": [], + "src": "7352:0:50" + }, + "scope": 8231, + "src": "7280:532:50", + "stateMutability": "pure", + "virtual": false, + "visibility": "private" + } + ], + "scope": 8232, + "src": "344:7470:50", + "usedErrors": [ + 7894, + 7899, + 7904 + ], + "usedEvents": [] + } + ], + "src": "112:7703:50" + }, + "id": 50 + }, + "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol": { + "ast": { + "absolutePath": "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol", + "exportedSymbols": { + "MessageHashUtils": [ + 8317 + ], + "Strings": [ + 7883 + ] + }, + "id": 8318, + "license": "MIT", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 8233, + "literals": [ + "solidity", + "^", + "0.8", + ".20" + ], + "nodeType": "PragmaDirective", + "src": "123:24:51" + }, + { + "absolutePath": "@openzeppelin/contracts/utils/Strings.sol", + "file": "../Strings.sol", + "id": 8235, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 8318, + "sourceUnit": 7884, + "src": "149:39:51", + "symbolAliases": [ + { + "foreign": { + "id": 8234, + "name": "Strings", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7883, + "src": "157:7:51", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "abstract": false, + "baseContracts": [], + "canonicalName": "MessageHashUtils", + "contractDependencies": [], + "contractKind": "library", + "documentation": { + "id": 8236, + "nodeType": "StructuredDocumentation", + "src": "190:330:51", + "text": " @dev Signature message hash utilities for producing digests to be consumed by {ECDSA} recovery or signing.\n The library provides methods for generating a hash of a message that conforms to the\n https://eips.ethereum.org/EIPS/eip-191[ERC-191] and https://eips.ethereum.org/EIPS/eip-712[EIP 712]\n specifications." + }, + "fullyImplemented": true, + "id": 8317, + "linearizedBaseContracts": [ + 8317 + ], + "name": "MessageHashUtils", + "nameLocation": "529:16:51", + "nodeType": "ContractDefinition", + "nodes": [ + { + "body": { + "id": 8245, + "nodeType": "Block", + "src": "1339:341:51", + "statements": [ + { + "AST": { + "nativeSrc": "1374:300:51", + "nodeType": "YulBlock", + "src": "1374:300:51", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "1395:4:51", + "nodeType": "YulLiteral", + "src": "1395:4:51", + "type": "", + "value": "0x00" + }, + { + "hexValue": "19457468657265756d205369676e6564204d6573736167653a0a3332", + "kind": "string", + "nativeSrc": "1401:34:51", + "nodeType": "YulLiteral", + "src": "1401:34:51", + "type": "", + "value": "\u0019Ethereum Signed Message:\n32" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "1388:6:51", + "nodeType": "YulIdentifier", + "src": "1388:6:51" + }, + "nativeSrc": "1388:48:51", + "nodeType": "YulFunctionCall", + "src": "1388:48:51" + }, + "nativeSrc": "1388:48:51", + "nodeType": "YulExpressionStatement", + "src": "1388:48:51" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "1497:4:51", + "nodeType": "YulLiteral", + "src": "1497:4:51", + "type": "", + "value": "0x1c" + }, + { + "name": "messageHash", + "nativeSrc": "1503:11:51", + "nodeType": "YulIdentifier", + "src": "1503:11:51" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "1490:6:51", + "nodeType": "YulIdentifier", + "src": "1490:6:51" + }, + "nativeSrc": "1490:25:51", + "nodeType": "YulFunctionCall", + "src": "1490:25:51" + }, + "nativeSrc": "1490:25:51", + "nodeType": "YulExpressionStatement", + "src": "1490:25:51" + }, + { + "nativeSrc": "1569:31:51", + "nodeType": "YulAssignment", + "src": "1569:31:51", + "value": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "1589:4:51", + "nodeType": "YulLiteral", + "src": "1589:4:51", + "type": "", + "value": "0x00" + }, + { + "kind": "number", + "nativeSrc": "1595:4:51", + "nodeType": "YulLiteral", + "src": "1595:4:51", + "type": "", + "value": "0x3c" + } + ], + "functionName": { + "name": "keccak256", + "nativeSrc": "1579:9:51", + "nodeType": "YulIdentifier", + "src": "1579:9:51" + }, + "nativeSrc": "1579:21:51", + "nodeType": "YulFunctionCall", + "src": "1579:21:51" + }, + "variableNames": [ + { + "name": "digest", + "nativeSrc": "1569:6:51", + "nodeType": "YulIdentifier", + "src": "1569:6:51" + } + ] + } + ] + }, + "evmVersion": "paris", + "externalReferences": [ + { + "declaration": 8242, + "isOffset": false, + "isSlot": false, + "src": "1569:6:51", + "valueSize": 1 + }, + { + "declaration": 8239, + "isOffset": false, + "isSlot": false, + "src": "1503:11:51", + "valueSize": 1 + } + ], + "flags": [ + "memory-safe" + ], + "id": 8244, + "nodeType": "InlineAssembly", + "src": "1349:325:51" + } + ] + }, + "documentation": { + "id": 8237, + "nodeType": "StructuredDocumentation", + "src": "552:690:51", + "text": " @dev Returns the keccak256 digest of an ERC-191 signed data with version\n `0x45` (`personal_sign` messages).\n The digest is calculated by prefixing a bytes32 `messageHash` with\n `\"\\x19Ethereum Signed Message:\\n32\"` and hashing the result. It corresponds with the\n hash signed when using the https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sign[`eth_sign`] JSON-RPC method.\n NOTE: The `messageHash` parameter is intended to be the result of hashing a raw message with\n keccak256, although any bytes32 value can be safely used because the final digest will\n be re-hashed.\n See {ECDSA-recover}." + }, + "id": 8246, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toEthSignedMessageHash", + "nameLocation": "1256:22:51", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 8240, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8239, + "mutability": "mutable", + "name": "messageHash", + "nameLocation": "1287:11:51", + "nodeType": "VariableDeclaration", + "scope": 8246, + "src": "1279:19:51", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 8238, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1279:7:51", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "1278:21:51" + }, + "returnParameters": { + "id": 8243, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8242, + "mutability": "mutable", + "name": "digest", + "nameLocation": "1331:6:51", + "nodeType": "VariableDeclaration", + "scope": 8246, + "src": "1323:14:51", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 8241, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1323:7:51", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "1322:16:51" + }, + "scope": 8317, + "src": "1247:433:51", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 8271, + "nodeType": "Block", + "src": "2257:143:51", + "statements": [ + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "hexValue": "19457468657265756d205369676e6564204d6573736167653a0a", + "id": 8258, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2309:32:51", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_9af2d9c228f6cfddaa6d1e5b94e0bce4ab16bd9a472a2b7fbfd74ebff4c720b4", + "typeString": "literal_string hex\"19457468657265756d205369676e6564204d6573736167653a0a\"" + }, + "value": "\u0019Ethereum Signed Message:\n" + }, + { + "arguments": [ + { + "arguments": [ + { + "expression": { + "id": 8263, + "name": "message", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8249, + "src": "2366:7:51", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 8264, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "2374:6:51", + "memberName": "length", + "nodeType": "MemberAccess", + "src": "2366:14:51", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "id": 8261, + "name": "Strings", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7883, + "src": "2349:7:51", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_Strings_$7883_$", + "typeString": "type(library Strings)" + } + }, + "id": 8262, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "2357:8:51", + "memberName": "toString", + "nodeType": "MemberAccess", + "referencedDeclaration": 6595, + "src": "2349:16:51", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$returns$_t_string_memory_ptr_$", + "typeString": "function (uint256) pure returns (string memory)" + } + }, + "id": 8265, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2349:32:51", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + ], + "id": 8260, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "2343:5:51", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes_storage_ptr_$", + "typeString": "type(bytes storage pointer)" + }, + "typeName": { + "id": 8259, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "2343:5:51", + "typeDescriptions": {} + } + }, + "id": 8266, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2343:39:51", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + { + "id": 8267, + "name": "message", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8249, + "src": "2384:7:51", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_stringliteral_9af2d9c228f6cfddaa6d1e5b94e0bce4ab16bd9a472a2b7fbfd74ebff4c720b4", + "typeString": "literal_string hex\"19457468657265756d205369676e6564204d6573736167653a0a\"" + }, + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + }, + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "expression": { + "id": 8256, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "2296:5:51", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes_storage_ptr_$", + "typeString": "type(bytes storage pointer)" + }, + "typeName": { + "id": 8255, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "2296:5:51", + "typeDescriptions": {} + } + }, + "id": 8257, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "2302:6:51", + "memberName": "concat", + "nodeType": "MemberAccess", + "src": "2296:12:51", + "typeDescriptions": { + "typeIdentifier": "t_function_bytesconcat_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 8268, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2296:96:51", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 8254, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -8, + "src": "2286:9:51", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 8269, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2286:107:51", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "functionReturnParameters": 8253, + "id": 8270, + "nodeType": "Return", + "src": "2267:126:51" + } + ] + }, + "documentation": { + "id": 8247, + "nodeType": "StructuredDocumentation", + "src": "1686:480:51", + "text": " @dev Returns the keccak256 digest of an ERC-191 signed data with version\n `0x45` (`personal_sign` messages).\n The digest is calculated by prefixing an arbitrary `message` with\n `\"\\x19Ethereum Signed Message:\\n\" + len(message)` and hashing the result. It corresponds with the\n hash signed when using the https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sign[`eth_sign`] JSON-RPC method.\n See {ECDSA-recover}." + }, + "id": 8272, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toEthSignedMessageHash", + "nameLocation": "2180:22:51", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 8250, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8249, + "mutability": "mutable", + "name": "message", + "nameLocation": "2216:7:51", + "nodeType": "VariableDeclaration", + "scope": 8272, + "src": "2203:20:51", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 8248, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "2203:5:51", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "src": "2202:22:51" + }, + "returnParameters": { + "id": 8253, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8252, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 8272, + "src": "2248:7:51", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 8251, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "2248:7:51", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "2247:9:51" + }, + "scope": 8317, + "src": "2171:229:51", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 8291, + "nodeType": "Block", + "src": "2854:80:51", + "statements": [ + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "hexValue": "1900", + "id": 8285, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "hexString", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2898:10:51", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_73fd5d154550a4a103564cb191928cd38898034de1b952dc21b290898b4b697a", + "typeString": "literal_string hex\"1900\"" + }, + "value": "\u0019\u0000" + }, + { + "id": 8286, + "name": "validator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8275, + "src": "2910:9:51", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 8287, + "name": "data", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8277, + "src": "2921:4:51", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_stringliteral_73fd5d154550a4a103564cb191928cd38898034de1b952dc21b290898b4b697a", + "typeString": "literal_string hex\"1900\"" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "expression": { + "id": 8283, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -1, + "src": "2881:3:51", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 8284, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "2885:12:51", + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "src": "2881:16:51", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 8288, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2881:45:51", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 8282, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -8, + "src": "2871:9:51", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 8289, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2871:56:51", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "functionReturnParameters": 8281, + "id": 8290, + "nodeType": "Return", + "src": "2864:63:51" + } + ] + }, + "documentation": { + "id": 8273, + "nodeType": "StructuredDocumentation", + "src": "2406:332:51", + "text": " @dev Returns the keccak256 digest of an ERC-191 signed data with version\n `0x00` (data with intended validator).\n The digest is calculated by prefixing an arbitrary `data` with `\"\\x19\\x00\"` and the intended\n `validator` address. Then hashing the result.\n See {ECDSA-recover}." + }, + "id": 8292, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toDataWithIntendedValidatorHash", + "nameLocation": "2752:31:51", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 8278, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8275, + "mutability": "mutable", + "name": "validator", + "nameLocation": "2792:9:51", + "nodeType": "VariableDeclaration", + "scope": 8292, + "src": "2784:17:51", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 8274, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2784:7:51", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 8277, + "mutability": "mutable", + "name": "data", + "nameLocation": "2816:4:51", + "nodeType": "VariableDeclaration", + "scope": 8292, + "src": "2803:17:51", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 8276, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "2803:5:51", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "src": "2783:38:51" + }, + "returnParameters": { + "id": 8281, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8280, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 8292, + "src": "2845:7:51", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 8279, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "2845:7:51", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "2844:9:51" + }, + "scope": 8317, + "src": "2743:191:51", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 8303, + "nodeType": "Block", + "src": "3216:216:51", + "statements": [ + { + "AST": { + "nativeSrc": "3251:175:51", + "nodeType": "YulBlock", + "src": "3251:175:51", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "3272:4:51", + "nodeType": "YulLiteral", + "src": "3272:4:51", + "type": "", + "value": "0x00" + }, + { + "hexValue": "1900", + "kind": "string", + "nativeSrc": "3278:10:51", + "nodeType": "YulLiteral", + "src": "3278:10:51", + "type": "", + "value": "\u0019\u0000" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "3265:6:51", + "nodeType": "YulIdentifier", + "src": "3265:6:51" + }, + "nativeSrc": "3265:24:51", + "nodeType": "YulFunctionCall", + "src": "3265:24:51" + }, + "nativeSrc": "3265:24:51", + "nodeType": "YulExpressionStatement", + "src": "3265:24:51" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "3309:4:51", + "nodeType": "YulLiteral", + "src": "3309:4:51", + "type": "", + "value": "0x02" + }, + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "3319:2:51", + "nodeType": "YulLiteral", + "src": "3319:2:51", + "type": "", + "value": "96" + }, + { + "name": "validator", + "nativeSrc": "3323:9:51", + "nodeType": "YulIdentifier", + "src": "3323:9:51" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "3315:3:51", + "nodeType": "YulIdentifier", + "src": "3315:3:51" + }, + "nativeSrc": "3315:18:51", + "nodeType": "YulFunctionCall", + "src": "3315:18:51" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "3302:6:51", + "nodeType": "YulIdentifier", + "src": "3302:6:51" + }, + "nativeSrc": "3302:32:51", + "nodeType": "YulFunctionCall", + "src": "3302:32:51" + }, + "nativeSrc": "3302:32:51", + "nodeType": "YulExpressionStatement", + "src": "3302:32:51" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "3354:4:51", + "nodeType": "YulLiteral", + "src": "3354:4:51", + "type": "", + "value": "0x16" + }, + { + "name": "messageHash", + "nativeSrc": "3360:11:51", + "nodeType": "YulIdentifier", + "src": "3360:11:51" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "3347:6:51", + "nodeType": "YulIdentifier", + "src": "3347:6:51" + }, + "nativeSrc": "3347:25:51", + "nodeType": "YulFunctionCall", + "src": "3347:25:51" + }, + "nativeSrc": "3347:25:51", + "nodeType": "YulExpressionStatement", + "src": "3347:25:51" + }, + { + "nativeSrc": "3385:31:51", + "nodeType": "YulAssignment", + "src": "3385:31:51", + "value": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "3405:4:51", + "nodeType": "YulLiteral", + "src": "3405:4:51", + "type": "", + "value": "0x00" + }, + { + "kind": "number", + "nativeSrc": "3411:4:51", + "nodeType": "YulLiteral", + "src": "3411:4:51", + "type": "", + "value": "0x36" + } + ], + "functionName": { + "name": "keccak256", + "nativeSrc": "3395:9:51", + "nodeType": "YulIdentifier", + "src": "3395:9:51" + }, + "nativeSrc": "3395:21:51", + "nodeType": "YulFunctionCall", + "src": "3395:21:51" + }, + "variableNames": [ + { + "name": "digest", + "nativeSrc": "3385:6:51", + "nodeType": "YulIdentifier", + "src": "3385:6:51" + } + ] + } + ] + }, + "evmVersion": "paris", + "externalReferences": [ + { + "declaration": 8300, + "isOffset": false, + "isSlot": false, + "src": "3385:6:51", + "valueSize": 1 + }, + { + "declaration": 8297, + "isOffset": false, + "isSlot": false, + "src": "3360:11:51", + "valueSize": 1 + }, + { + "declaration": 8295, + "isOffset": false, + "isSlot": false, + "src": "3323:9:51", + "valueSize": 1 + } + ], + "flags": [ + "memory-safe" + ], + "id": 8302, + "nodeType": "InlineAssembly", + "src": "3226:200:51" + } + ] + }, + "documentation": { + "id": 8293, + "nodeType": "StructuredDocumentation", + "src": "2940:129:51", + "text": " @dev Variant of {toDataWithIntendedValidatorHash-address-bytes} optimized for cases where `data` is a bytes32." + }, + "id": 8304, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toDataWithIntendedValidatorHash", + "nameLocation": "3083:31:51", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 8298, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8295, + "mutability": "mutable", + "name": "validator", + "nameLocation": "3132:9:51", + "nodeType": "VariableDeclaration", + "scope": 8304, + "src": "3124:17:51", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 8294, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3124:7:51", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 8297, + "mutability": "mutable", + "name": "messageHash", + "nameLocation": "3159:11:51", + "nodeType": "VariableDeclaration", + "scope": 8304, + "src": "3151:19:51", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 8296, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "3151:7:51", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "3114:62:51" + }, + "returnParameters": { + "id": 8301, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8300, + "mutability": "mutable", + "name": "digest", + "nameLocation": "3208:6:51", + "nodeType": "VariableDeclaration", + "scope": 8304, + "src": "3200:14:51", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 8299, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "3200:7:51", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "3199:16:51" + }, + "scope": 8317, + "src": "3074:358:51", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 8315, + "nodeType": "Block", + "src": "3983:265:51", + "statements": [ + { + "AST": { + "nativeSrc": "4018:224:51", + "nodeType": "YulBlock", + "src": "4018:224:51", + "statements": [ + { + "nativeSrc": "4032:22:51", + "nodeType": "YulVariableDeclaration", + "src": "4032:22:51", + "value": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "4049:4:51", + "nodeType": "YulLiteral", + "src": "4049:4:51", + "type": "", + "value": "0x40" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "4043:5:51", + "nodeType": "YulIdentifier", + "src": "4043:5:51" + }, + "nativeSrc": "4043:11:51", + "nodeType": "YulFunctionCall", + "src": "4043:11:51" + }, + "variables": [ + { + "name": "ptr", + "nativeSrc": "4036:3:51", + "nodeType": "YulTypedName", + "src": "4036:3:51", + "type": "" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "ptr", + "nativeSrc": "4074:3:51", + "nodeType": "YulIdentifier", + "src": "4074:3:51" + }, + { + "hexValue": "1901", + "kind": "string", + "nativeSrc": "4079:10:51", + "nodeType": "YulLiteral", + "src": "4079:10:51", + "type": "", + "value": "\u0019\u0001" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "4067:6:51", + "nodeType": "YulIdentifier", + "src": "4067:6:51" + }, + "nativeSrc": "4067:23:51", + "nodeType": "YulFunctionCall", + "src": "4067:23:51" + }, + "nativeSrc": "4067:23:51", + "nodeType": "YulExpressionStatement", + "src": "4067:23:51" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "ptr", + "nativeSrc": "4114:3:51", + "nodeType": "YulIdentifier", + "src": "4114:3:51" + }, + { + "kind": "number", + "nativeSrc": "4119:4:51", + "nodeType": "YulLiteral", + "src": "4119:4:51", + "type": "", + "value": "0x02" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "4110:3:51", + "nodeType": "YulIdentifier", + "src": "4110:3:51" + }, + "nativeSrc": "4110:14:51", + "nodeType": "YulFunctionCall", + "src": "4110:14:51" + }, + { + "name": "domainSeparator", + "nativeSrc": "4126:15:51", + "nodeType": "YulIdentifier", + "src": "4126:15:51" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "4103:6:51", + "nodeType": "YulIdentifier", + "src": "4103:6:51" + }, + "nativeSrc": "4103:39:51", + "nodeType": "YulFunctionCall", + "src": "4103:39:51" + }, + "nativeSrc": "4103:39:51", + "nodeType": "YulExpressionStatement", + "src": "4103:39:51" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "ptr", + "nativeSrc": "4166:3:51", + "nodeType": "YulIdentifier", + "src": "4166:3:51" + }, + { + "kind": "number", + "nativeSrc": "4171:4:51", + "nodeType": "YulLiteral", + "src": "4171:4:51", + "type": "", + "value": "0x22" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "4162:3:51", + "nodeType": "YulIdentifier", + "src": "4162:3:51" + }, + "nativeSrc": "4162:14:51", + "nodeType": "YulFunctionCall", + "src": "4162:14:51" + }, + { + "name": "structHash", + "nativeSrc": "4178:10:51", + "nodeType": "YulIdentifier", + "src": "4178:10:51" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "4155:6:51", + "nodeType": "YulIdentifier", + "src": "4155:6:51" + }, + "nativeSrc": "4155:34:51", + "nodeType": "YulFunctionCall", + "src": "4155:34:51" + }, + "nativeSrc": "4155:34:51", + "nodeType": "YulExpressionStatement", + "src": "4155:34:51" + }, + { + "nativeSrc": "4202:30:51", + "nodeType": "YulAssignment", + "src": "4202:30:51", + "value": { + "arguments": [ + { + "name": "ptr", + "nativeSrc": "4222:3:51", + "nodeType": "YulIdentifier", + "src": "4222:3:51" + }, + { + "kind": "number", + "nativeSrc": "4227:4:51", + "nodeType": "YulLiteral", + "src": "4227:4:51", + "type": "", + "value": "0x42" + } + ], + "functionName": { + "name": "keccak256", + "nativeSrc": "4212:9:51", + "nodeType": "YulIdentifier", + "src": "4212:9:51" + }, + "nativeSrc": "4212:20:51", + "nodeType": "YulFunctionCall", + "src": "4212:20:51" + }, + "variableNames": [ + { + "name": "digest", + "nativeSrc": "4202:6:51", + "nodeType": "YulIdentifier", + "src": "4202:6:51" + } + ] + } + ] + }, + "evmVersion": "paris", + "externalReferences": [ + { + "declaration": 8312, + "isOffset": false, + "isSlot": false, + "src": "4202:6:51", + "valueSize": 1 + }, + { + "declaration": 8307, + "isOffset": false, + "isSlot": false, + "src": "4126:15:51", + "valueSize": 1 + }, + { + "declaration": 8309, + "isOffset": false, + "isSlot": false, + "src": "4178:10:51", + "valueSize": 1 + } + ], + "flags": [ + "memory-safe" + ], + "id": 8314, + "nodeType": "InlineAssembly", + "src": "3993:249:51" + } + ] + }, + "documentation": { + "id": 8305, + "nodeType": "StructuredDocumentation", + "src": "3438:431:51", + "text": " @dev Returns the keccak256 digest of an EIP-712 typed data (ERC-191 version `0x01`).\n The digest is calculated from a `domainSeparator` and a `structHash`, by prefixing them with\n `\\x19\\x01` and hashing the result. It corresponds to the hash signed by the\n https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] JSON-RPC method as part of EIP-712.\n See {ECDSA-recover}." + }, + "id": 8316, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toTypedDataHash", + "nameLocation": "3883:15:51", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 8310, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8307, + "mutability": "mutable", + "name": "domainSeparator", + "nameLocation": "3907:15:51", + "nodeType": "VariableDeclaration", + "scope": 8316, + "src": "3899:23:51", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 8306, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "3899:7:51", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 8309, + "mutability": "mutable", + "name": "structHash", + "nameLocation": "3932:10:51", + "nodeType": "VariableDeclaration", + "scope": 8316, + "src": "3924:18:51", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 8308, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "3924:7:51", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "3898:45:51" + }, + "returnParameters": { + "id": 8313, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8312, + "mutability": "mutable", + "name": "digest", + "nameLocation": "3975:6:51", + "nodeType": "VariableDeclaration", + "scope": 8316, + "src": "3967:14:51", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 8311, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "3967:7:51", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "3966:16:51" + }, + "scope": 8317, + "src": "3874:374:51", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + } + ], + "scope": 8318, + "src": "521:3729:51", + "usedErrors": [], + "usedEvents": [] + } + ], + "src": "123:4128:51" + }, + "id": 51 + }, + "@openzeppelin/contracts/utils/math/Math.sol": { + "ast": { + "absolutePath": "@openzeppelin/contracts/utils/math/Math.sol", + "exportedSymbols": { + "Math": [ + 9938 + ], + "Panic": [ + 6481 + ], + "SafeCast": [ + 11703 + ] + }, + "id": 9939, + "license": "MIT", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 8319, + "literals": [ + "solidity", + "^", + "0.8", + ".20" + ], + "nodeType": "PragmaDirective", + "src": "103:24:52" + }, + { + "absolutePath": "@openzeppelin/contracts/utils/Panic.sol", + "file": "../Panic.sol", + "id": 8321, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 9939, + "sourceUnit": 6482, + "src": "129:35:52", + "symbolAliases": [ + { + "foreign": { + "id": 8320, + "name": "Panic", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6481, + "src": "137:5:52", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "@openzeppelin/contracts/utils/math/SafeCast.sol", + "file": "./SafeCast.sol", + "id": 8323, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 9939, + "sourceUnit": 11704, + "src": "165:40:52", + "symbolAliases": [ + { + "foreign": { + "id": 8322, + "name": "SafeCast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11703, + "src": "173:8:52", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "abstract": false, + "baseContracts": [], + "canonicalName": "Math", + "contractDependencies": [], + "contractKind": "library", + "documentation": { + "id": 8324, + "nodeType": "StructuredDocumentation", + "src": "207:73:52", + "text": " @dev Standard math utilities missing in the Solidity language." + }, + "fullyImplemented": true, + "id": 9938, + "linearizedBaseContracts": [ + 9938 + ], + "name": "Math", + "nameLocation": "289:4:52", + "nodeType": "ContractDefinition", + "nodes": [ + { + "canonicalName": "Math.Rounding", + "id": 8329, + "members": [ + { + "id": 8325, + "name": "Floor", + "nameLocation": "324:5:52", + "nodeType": "EnumValue", + "src": "324:5:52" + }, + { + "id": 8326, + "name": "Ceil", + "nameLocation": "367:4:52", + "nodeType": "EnumValue", + "src": "367:4:52" + }, + { + "id": 8327, + "name": "Trunc", + "nameLocation": "409:5:52", + "nodeType": "EnumValue", + "src": "409:5:52" + }, + { + "id": 8328, + "name": "Expand", + "nameLocation": "439:6:52", + "nodeType": "EnumValue", + "src": "439:6:52" + } + ], + "name": "Rounding", + "nameLocation": "305:8:52", + "nodeType": "EnumDefinition", + "src": "300:169:52" + }, + { + "body": { + "id": 8342, + "nodeType": "Block", + "src": "731:112:52", + "statements": [ + { + "AST": { + "nativeSrc": "766:71:52", + "nodeType": "YulBlock", + "src": "766:71:52", + "statements": [ + { + "nativeSrc": "780:16:52", + "nodeType": "YulAssignment", + "src": "780:16:52", + "value": { + "arguments": [ + { + "name": "a", + "nativeSrc": "791:1:52", + "nodeType": "YulIdentifier", + "src": "791:1:52" + }, + { + "name": "b", + "nativeSrc": "794:1:52", + "nodeType": "YulIdentifier", + "src": "794:1:52" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "787:3:52", + "nodeType": "YulIdentifier", + "src": "787:3:52" + }, + "nativeSrc": "787:9:52", + "nodeType": "YulFunctionCall", + "src": "787:9:52" + }, + "variableNames": [ + { + "name": "low", + "nativeSrc": "780:3:52", + "nodeType": "YulIdentifier", + "src": "780:3:52" + } + ] + }, + { + "nativeSrc": "809:18:52", + "nodeType": "YulAssignment", + "src": "809:18:52", + "value": { + "arguments": [ + { + "name": "low", + "nativeSrc": "820:3:52", + "nodeType": "YulIdentifier", + "src": "820:3:52" + }, + { + "name": "a", + "nativeSrc": "825:1:52", + "nodeType": "YulIdentifier", + "src": "825:1:52" + } + ], + "functionName": { + "name": "lt", + "nativeSrc": "817:2:52", + "nodeType": "YulIdentifier", + "src": "817:2:52" + }, + "nativeSrc": "817:10:52", + "nodeType": "YulFunctionCall", + "src": "817:10:52" + }, + "variableNames": [ + { + "name": "high", + "nativeSrc": "809:4:52", + "nodeType": "YulIdentifier", + "src": "809:4:52" + } + ] + } + ] + }, + "evmVersion": "paris", + "externalReferences": [ + { + "declaration": 8332, + "isOffset": false, + "isSlot": false, + "src": "791:1:52", + "valueSize": 1 + }, + { + "declaration": 8332, + "isOffset": false, + "isSlot": false, + "src": "825:1:52", + "valueSize": 1 + }, + { + "declaration": 8334, + "isOffset": false, + "isSlot": false, + "src": "794:1:52", + "valueSize": 1 + }, + { + "declaration": 8337, + "isOffset": false, + "isSlot": false, + "src": "809:4:52", + "valueSize": 1 + }, + { + "declaration": 8339, + "isOffset": false, + "isSlot": false, + "src": "780:3:52", + "valueSize": 1 + }, + { + "declaration": 8339, + "isOffset": false, + "isSlot": false, + "src": "820:3:52", + "valueSize": 1 + } + ], + "flags": [ + "memory-safe" + ], + "id": 8341, + "nodeType": "InlineAssembly", + "src": "741:96:52" + } + ] + }, + "documentation": { + "id": 8330, + "nodeType": "StructuredDocumentation", + "src": "475:163:52", + "text": " @dev Return the 512-bit addition of two uint256.\n The result is stored in two 256 variables such that sum = high * 2²⁵⁶ + low." + }, + "id": 8343, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "add512", + "nameLocation": "652:6:52", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 8335, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8332, + "mutability": "mutable", + "name": "a", + "nameLocation": "667:1:52", + "nodeType": "VariableDeclaration", + "scope": 8343, + "src": "659:9:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8331, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "659:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 8334, + "mutability": "mutable", + "name": "b", + "nameLocation": "678:1:52", + "nodeType": "VariableDeclaration", + "scope": 8343, + "src": "670:9:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8333, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "670:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "658:22:52" + }, + "returnParameters": { + "id": 8340, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8337, + "mutability": "mutable", + "name": "high", + "nameLocation": "712:4:52", + "nodeType": "VariableDeclaration", + "scope": 8343, + "src": "704:12:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8336, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "704:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 8339, + "mutability": "mutable", + "name": "low", + "nameLocation": "726:3:52", + "nodeType": "VariableDeclaration", + "scope": 8343, + "src": "718:11:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8338, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "718:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "703:27:52" + }, + "scope": 9938, + "src": "643:200:52", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 8356, + "nodeType": "Block", + "src": "1115:462:52", + "statements": [ + { + "AST": { + "nativeSrc": "1437:134:52", + "nodeType": "YulBlock", + "src": "1437:134:52", + "statements": [ + { + "nativeSrc": "1451:30:52", + "nodeType": "YulVariableDeclaration", + "src": "1451:30:52", + "value": { + "arguments": [ + { + "name": "a", + "nativeSrc": "1468:1:52", + "nodeType": "YulIdentifier", + "src": "1468:1:52" + }, + { + "name": "b", + "nativeSrc": "1471:1:52", + "nodeType": "YulIdentifier", + "src": "1471:1:52" + }, + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "1478:1:52", + "nodeType": "YulLiteral", + "src": "1478:1:52", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "not", + "nativeSrc": "1474:3:52", + "nodeType": "YulIdentifier", + "src": "1474:3:52" + }, + "nativeSrc": "1474:6:52", + "nodeType": "YulFunctionCall", + "src": "1474:6:52" + } + ], + "functionName": { + "name": "mulmod", + "nativeSrc": "1461:6:52", + "nodeType": "YulIdentifier", + "src": "1461:6:52" + }, + "nativeSrc": "1461:20:52", + "nodeType": "YulFunctionCall", + "src": "1461:20:52" + }, + "variables": [ + { + "name": "mm", + "nativeSrc": "1455:2:52", + "nodeType": "YulTypedName", + "src": "1455:2:52", + "type": "" + } + ] + }, + { + "nativeSrc": "1494:16:52", + "nodeType": "YulAssignment", + "src": "1494:16:52", + "value": { + "arguments": [ + { + "name": "a", + "nativeSrc": "1505:1:52", + "nodeType": "YulIdentifier", + "src": "1505:1:52" + }, + { + "name": "b", + "nativeSrc": "1508:1:52", + "nodeType": "YulIdentifier", + "src": "1508:1:52" + } + ], + "functionName": { + "name": "mul", + "nativeSrc": "1501:3:52", + "nodeType": "YulIdentifier", + "src": "1501:3:52" + }, + "nativeSrc": "1501:9:52", + "nodeType": "YulFunctionCall", + "src": "1501:9:52" + }, + "variableNames": [ + { + "name": "low", + "nativeSrc": "1494:3:52", + "nodeType": "YulIdentifier", + "src": "1494:3:52" + } + ] + }, + { + "nativeSrc": "1523:38:52", + "nodeType": "YulAssignment", + "src": "1523:38:52", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "mm", + "nativeSrc": "1539:2:52", + "nodeType": "YulIdentifier", + "src": "1539:2:52" + }, + { + "name": "low", + "nativeSrc": "1543:3:52", + "nodeType": "YulIdentifier", + "src": "1543:3:52" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "1535:3:52", + "nodeType": "YulIdentifier", + "src": "1535:3:52" + }, + "nativeSrc": "1535:12:52", + "nodeType": "YulFunctionCall", + "src": "1535:12:52" + }, + { + "arguments": [ + { + "name": "mm", + "nativeSrc": "1552:2:52", + "nodeType": "YulIdentifier", + "src": "1552:2:52" + }, + { + "name": "low", + "nativeSrc": "1556:3:52", + "nodeType": "YulIdentifier", + "src": "1556:3:52" + } + ], + "functionName": { + "name": "lt", + "nativeSrc": "1549:2:52", + "nodeType": "YulIdentifier", + "src": "1549:2:52" + }, + "nativeSrc": "1549:11:52", + "nodeType": "YulFunctionCall", + "src": "1549:11:52" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "1531:3:52", + "nodeType": "YulIdentifier", + "src": "1531:3:52" + }, + "nativeSrc": "1531:30:52", + "nodeType": "YulFunctionCall", + "src": "1531:30:52" + }, + "variableNames": [ + { + "name": "high", + "nativeSrc": "1523:4:52", + "nodeType": "YulIdentifier", + "src": "1523:4:52" + } + ] + } + ] + }, + "evmVersion": "paris", + "externalReferences": [ + { + "declaration": 8346, + "isOffset": false, + "isSlot": false, + "src": "1468:1:52", + "valueSize": 1 + }, + { + "declaration": 8346, + "isOffset": false, + "isSlot": false, + "src": "1505:1:52", + "valueSize": 1 + }, + { + "declaration": 8348, + "isOffset": false, + "isSlot": false, + "src": "1471:1:52", + "valueSize": 1 + }, + { + "declaration": 8348, + "isOffset": false, + "isSlot": false, + "src": "1508:1:52", + "valueSize": 1 + }, + { + "declaration": 8351, + "isOffset": false, + "isSlot": false, + "src": "1523:4:52", + "valueSize": 1 + }, + { + "declaration": 8353, + "isOffset": false, + "isSlot": false, + "src": "1494:3:52", + "valueSize": 1 + }, + { + "declaration": 8353, + "isOffset": false, + "isSlot": false, + "src": "1543:3:52", + "valueSize": 1 + }, + { + "declaration": 8353, + "isOffset": false, + "isSlot": false, + "src": "1556:3:52", + "valueSize": 1 + } + ], + "flags": [ + "memory-safe" + ], + "id": 8355, + "nodeType": "InlineAssembly", + "src": "1412:159:52" + } + ] + }, + "documentation": { + "id": 8344, + "nodeType": "StructuredDocumentation", + "src": "849:173:52", + "text": " @dev Return the 512-bit multiplication of two uint256.\n The result is stored in two 256 variables such that product = high * 2²⁵⁶ + low." + }, + "id": 8357, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "mul512", + "nameLocation": "1036:6:52", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 8349, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8346, + "mutability": "mutable", + "name": "a", + "nameLocation": "1051:1:52", + "nodeType": "VariableDeclaration", + "scope": 8357, + "src": "1043:9:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8345, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1043:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 8348, + "mutability": "mutable", + "name": "b", + "nameLocation": "1062:1:52", + "nodeType": "VariableDeclaration", + "scope": 8357, + "src": "1054:9:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8347, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1054:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "1042:22:52" + }, + "returnParameters": { + "id": 8354, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8351, + "mutability": "mutable", + "name": "high", + "nameLocation": "1096:4:52", + "nodeType": "VariableDeclaration", + "scope": 8357, + "src": "1088:12:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8350, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1088:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 8353, + "mutability": "mutable", + "name": "low", + "nameLocation": "1110:3:52", + "nodeType": "VariableDeclaration", + "scope": 8357, + "src": "1102:11:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8352, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1102:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "1087:27:52" + }, + "scope": 9938, + "src": "1027:550:52", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 8391, + "nodeType": "Block", + "src": "1784:149:52", + "statements": [ + { + "id": 8390, + "nodeType": "UncheckedBlock", + "src": "1794:133:52", + "statements": [ + { + "assignments": [ + 8370 + ], + "declarations": [ + { + "constant": false, + "id": 8370, + "mutability": "mutable", + "name": "c", + "nameLocation": "1826:1:52", + "nodeType": "VariableDeclaration", + "scope": 8390, + "src": "1818:9:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8369, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1818:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 8374, + "initialValue": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 8373, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 8371, + "name": "a", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8360, + "src": "1830:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "id": 8372, + "name": "b", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8362, + "src": "1834:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "1830:5:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "1818:17:52" + }, + { + "expression": { + "id": 8379, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 8375, + "name": "success", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8365, + "src": "1849:7:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 8378, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 8376, + "name": "c", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8370, + "src": "1859:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "id": 8377, + "name": "a", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8360, + "src": "1864:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "1859:6:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "1849:16:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 8380, + "nodeType": "ExpressionStatement", + "src": "1849:16:52" + }, + { + "expression": { + "id": 8388, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 8381, + "name": "result", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8367, + "src": "1879:6:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 8387, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 8382, + "name": "c", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8370, + "src": "1888:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "*", + "rightExpression": { + "arguments": [ + { + "id": 8385, + "name": "success", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8365, + "src": "1908:7:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "expression": { + "id": 8383, + "name": "SafeCast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11703, + "src": "1892:8:52", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_SafeCast_$11703_$", + "typeString": "type(library SafeCast)" + } + }, + "id": 8384, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "1901:6:52", + "memberName": "toUint", + "nodeType": "MemberAccess", + "referencedDeclaration": 11702, + "src": "1892:15:52", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_bool_$returns$_t_uint256_$", + "typeString": "function (bool) pure returns (uint256)" + } + }, + "id": 8386, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "1892:24:52", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "1888:28:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "1879:37:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 8389, + "nodeType": "ExpressionStatement", + "src": "1879:37:52" + } + ] + } + ] + }, + "documentation": { + "id": 8358, + "nodeType": "StructuredDocumentation", + "src": "1583:105:52", + "text": " @dev Returns the addition of two unsigned integers, with a success flag (no overflow)." + }, + "id": 8392, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "tryAdd", + "nameLocation": "1702:6:52", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 8363, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8360, + "mutability": "mutable", + "name": "a", + "nameLocation": "1717:1:52", + "nodeType": "VariableDeclaration", + "scope": 8392, + "src": "1709:9:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8359, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1709:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 8362, + "mutability": "mutable", + "name": "b", + "nameLocation": "1728:1:52", + "nodeType": "VariableDeclaration", + "scope": 8392, + "src": "1720:9:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8361, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1720:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "1708:22:52" + }, + "returnParameters": { + "id": 8368, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8365, + "mutability": "mutable", + "name": "success", + "nameLocation": "1759:7:52", + "nodeType": "VariableDeclaration", + "scope": 8392, + "src": "1754:12:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 8364, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "1754:4:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 8367, + "mutability": "mutable", + "name": "result", + "nameLocation": "1776:6:52", + "nodeType": "VariableDeclaration", + "scope": 8392, + "src": "1768:14:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8366, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1768:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "1753:30:52" + }, + "scope": 9938, + "src": "1693:240:52", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 8426, + "nodeType": "Block", + "src": "2143:149:52", + "statements": [ + { + "id": 8425, + "nodeType": "UncheckedBlock", + "src": "2153:133:52", + "statements": [ + { + "assignments": [ + 8405 + ], + "declarations": [ + { + "constant": false, + "id": 8405, + "mutability": "mutable", + "name": "c", + "nameLocation": "2185:1:52", + "nodeType": "VariableDeclaration", + "scope": 8425, + "src": "2177:9:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8404, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2177:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 8409, + "initialValue": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 8408, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 8406, + "name": "a", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8395, + "src": "2189:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "id": 8407, + "name": "b", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8397, + "src": "2193:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "2189:5:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "2177:17:52" + }, + { + "expression": { + "id": 8414, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 8410, + "name": "success", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8400, + "src": "2208:7:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 8413, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 8411, + "name": "c", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8405, + "src": "2218:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "id": 8412, + "name": "a", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8395, + "src": "2223:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "2218:6:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "2208:16:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 8415, + "nodeType": "ExpressionStatement", + "src": "2208:16:52" + }, + { + "expression": { + "id": 8423, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 8416, + "name": "result", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8402, + "src": "2238:6:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 8422, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 8417, + "name": "c", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8405, + "src": "2247:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "*", + "rightExpression": { + "arguments": [ + { + "id": 8420, + "name": "success", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8400, + "src": "2267:7:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "expression": { + "id": 8418, + "name": "SafeCast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11703, + "src": "2251:8:52", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_SafeCast_$11703_$", + "typeString": "type(library SafeCast)" + } + }, + "id": 8419, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "2260:6:52", + "memberName": "toUint", + "nodeType": "MemberAccess", + "referencedDeclaration": 11702, + "src": "2251:15:52", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_bool_$returns$_t_uint256_$", + "typeString": "function (bool) pure returns (uint256)" + } + }, + "id": 8421, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2251:24:52", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "2247:28:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "2238:37:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 8424, + "nodeType": "ExpressionStatement", + "src": "2238:37:52" + } + ] + } + ] + }, + "documentation": { + "id": 8393, + "nodeType": "StructuredDocumentation", + "src": "1939:108:52", + "text": " @dev Returns the subtraction of two unsigned integers, with a success flag (no overflow)." + }, + "id": 8427, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "trySub", + "nameLocation": "2061:6:52", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 8398, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8395, + "mutability": "mutable", + "name": "a", + "nameLocation": "2076:1:52", + "nodeType": "VariableDeclaration", + "scope": 8427, + "src": "2068:9:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8394, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2068:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 8397, + "mutability": "mutable", + "name": "b", + "nameLocation": "2087:1:52", + "nodeType": "VariableDeclaration", + "scope": 8427, + "src": "2079:9:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8396, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2079:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "2067:22:52" + }, + "returnParameters": { + "id": 8403, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8400, + "mutability": "mutable", + "name": "success", + "nameLocation": "2118:7:52", + "nodeType": "VariableDeclaration", + "scope": 8427, + "src": "2113:12:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 8399, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "2113:4:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 8402, + "mutability": "mutable", + "name": "result", + "nameLocation": "2135:6:52", + "nodeType": "VariableDeclaration", + "scope": 8427, + "src": "2127:14:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8401, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2127:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "2112:30:52" + }, + "scope": 9938, + "src": "2052:240:52", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 8456, + "nodeType": "Block", + "src": "2505:391:52", + "statements": [ + { + "id": 8455, + "nodeType": "UncheckedBlock", + "src": "2515:375:52", + "statements": [ + { + "assignments": [ + 8440 + ], + "declarations": [ + { + "constant": false, + "id": 8440, + "mutability": "mutable", + "name": "c", + "nameLocation": "2547:1:52", + "nodeType": "VariableDeclaration", + "scope": 8455, + "src": "2539:9:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8439, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2539:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 8444, + "initialValue": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 8443, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 8441, + "name": "a", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8430, + "src": "2551:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "*", + "rightExpression": { + "id": 8442, + "name": "b", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8432, + "src": "2555:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "2551:5:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "2539:17:52" + }, + { + "AST": { + "nativeSrc": "2595:188:52", + "nodeType": "YulBlock", + "src": "2595:188:52", + "statements": [ + { + "nativeSrc": "2727:42:52", + "nodeType": "YulAssignment", + "src": "2727:42:52", + "value": { + "arguments": [ + { + "arguments": [ + { + "arguments": [ + { + "name": "c", + "nativeSrc": "2748:1:52", + "nodeType": "YulIdentifier", + "src": "2748:1:52" + }, + { + "name": "a", + "nativeSrc": "2751:1:52", + "nodeType": "YulIdentifier", + "src": "2751:1:52" + } + ], + "functionName": { + "name": "div", + "nativeSrc": "2744:3:52", + "nodeType": "YulIdentifier", + "src": "2744:3:52" + }, + "nativeSrc": "2744:9:52", + "nodeType": "YulFunctionCall", + "src": "2744:9:52" + }, + { + "name": "b", + "nativeSrc": "2755:1:52", + "nodeType": "YulIdentifier", + "src": "2755:1:52" + } + ], + "functionName": { + "name": "eq", + "nativeSrc": "2741:2:52", + "nodeType": "YulIdentifier", + "src": "2741:2:52" + }, + "nativeSrc": "2741:16:52", + "nodeType": "YulFunctionCall", + "src": "2741:16:52" + }, + { + "arguments": [ + { + "name": "a", + "nativeSrc": "2766:1:52", + "nodeType": "YulIdentifier", + "src": "2766:1:52" + } + ], + "functionName": { + "name": "iszero", + "nativeSrc": "2759:6:52", + "nodeType": "YulIdentifier", + "src": "2759:6:52" + }, + "nativeSrc": "2759:9:52", + "nodeType": "YulFunctionCall", + "src": "2759:9:52" + } + ], + "functionName": { + "name": "or", + "nativeSrc": "2738:2:52", + "nodeType": "YulIdentifier", + "src": "2738:2:52" + }, + "nativeSrc": "2738:31:52", + "nodeType": "YulFunctionCall", + "src": "2738:31:52" + }, + "variableNames": [ + { + "name": "success", + "nativeSrc": "2727:7:52", + "nodeType": "YulIdentifier", + "src": "2727:7:52" + } + ] + } + ] + }, + "evmVersion": "paris", + "externalReferences": [ + { + "declaration": 8430, + "isOffset": false, + "isSlot": false, + "src": "2751:1:52", + "valueSize": 1 + }, + { + "declaration": 8430, + "isOffset": false, + "isSlot": false, + "src": "2766:1:52", + "valueSize": 1 + }, + { + "declaration": 8432, + "isOffset": false, + "isSlot": false, + "src": "2755:1:52", + "valueSize": 1 + }, + { + "declaration": 8440, + "isOffset": false, + "isSlot": false, + "src": "2748:1:52", + "valueSize": 1 + }, + { + "declaration": 8435, + "isOffset": false, + "isSlot": false, + "src": "2727:7:52", + "valueSize": 1 + } + ], + "flags": [ + "memory-safe" + ], + "id": 8445, + "nodeType": "InlineAssembly", + "src": "2570:213:52" + }, + { + "expression": { + "id": 8453, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 8446, + "name": "result", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8437, + "src": "2842:6:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 8452, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 8447, + "name": "c", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8440, + "src": "2851:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "*", + "rightExpression": { + "arguments": [ + { + "id": 8450, + "name": "success", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8435, + "src": "2871:7:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "expression": { + "id": 8448, + "name": "SafeCast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11703, + "src": "2855:8:52", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_SafeCast_$11703_$", + "typeString": "type(library SafeCast)" + } + }, + "id": 8449, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "2864:6:52", + "memberName": "toUint", + "nodeType": "MemberAccess", + "referencedDeclaration": 11702, + "src": "2855:15:52", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_bool_$returns$_t_uint256_$", + "typeString": "function (bool) pure returns (uint256)" + } + }, + "id": 8451, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2855:24:52", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "2851:28:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "2842:37:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 8454, + "nodeType": "ExpressionStatement", + "src": "2842:37:52" + } + ] + } + ] + }, + "documentation": { + "id": 8428, + "nodeType": "StructuredDocumentation", + "src": "2298:111:52", + "text": " @dev Returns the multiplication of two unsigned integers, with a success flag (no overflow)." + }, + "id": 8457, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "tryMul", + "nameLocation": "2423:6:52", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 8433, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8430, + "mutability": "mutable", + "name": "a", + "nameLocation": "2438:1:52", + "nodeType": "VariableDeclaration", + "scope": 8457, + "src": "2430:9:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8429, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2430:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 8432, + "mutability": "mutable", + "name": "b", + "nameLocation": "2449:1:52", + "nodeType": "VariableDeclaration", + "scope": 8457, + "src": "2441:9:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8431, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2441:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "2429:22:52" + }, + "returnParameters": { + "id": 8438, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8435, + "mutability": "mutable", + "name": "success", + "nameLocation": "2480:7:52", + "nodeType": "VariableDeclaration", + "scope": 8457, + "src": "2475:12:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 8434, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "2475:4:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 8437, + "mutability": "mutable", + "name": "result", + "nameLocation": "2497:6:52", + "nodeType": "VariableDeclaration", + "scope": 8457, + "src": "2489:14:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8436, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2489:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "2474:30:52" + }, + "scope": 9938, + "src": "2414:482:52", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 8477, + "nodeType": "Block", + "src": "3111:231:52", + "statements": [ + { + "id": 8476, + "nodeType": "UncheckedBlock", + "src": "3121:215:52", + "statements": [ + { + "expression": { + "id": 8473, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 8469, + "name": "success", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8465, + "src": "3145:7:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 8472, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 8470, + "name": "b", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8462, + "src": "3155:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "hexValue": "30", + "id": 8471, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3159:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "3155:5:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "3145:15:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 8474, + "nodeType": "ExpressionStatement", + "src": "3145:15:52" + }, + { + "AST": { + "nativeSrc": "3199:127:52", + "nodeType": "YulBlock", + "src": "3199:127:52", + "statements": [ + { + "nativeSrc": "3293:19:52", + "nodeType": "YulAssignment", + "src": "3293:19:52", + "value": { + "arguments": [ + { + "name": "a", + "nativeSrc": "3307:1:52", + "nodeType": "YulIdentifier", + "src": "3307:1:52" + }, + { + "name": "b", + "nativeSrc": "3310:1:52", + "nodeType": "YulIdentifier", + "src": "3310:1:52" + } + ], + "functionName": { + "name": "div", + "nativeSrc": "3303:3:52", + "nodeType": "YulIdentifier", + "src": "3303:3:52" + }, + "nativeSrc": "3303:9:52", + "nodeType": "YulFunctionCall", + "src": "3303:9:52" + }, + "variableNames": [ + { + "name": "result", + "nativeSrc": "3293:6:52", + "nodeType": "YulIdentifier", + "src": "3293:6:52" + } + ] + } + ] + }, + "evmVersion": "paris", + "externalReferences": [ + { + "declaration": 8460, + "isOffset": false, + "isSlot": false, + "src": "3307:1:52", + "valueSize": 1 + }, + { + "declaration": 8462, + "isOffset": false, + "isSlot": false, + "src": "3310:1:52", + "valueSize": 1 + }, + { + "declaration": 8467, + "isOffset": false, + "isSlot": false, + "src": "3293:6:52", + "valueSize": 1 + } + ], + "flags": [ + "memory-safe" + ], + "id": 8475, + "nodeType": "InlineAssembly", + "src": "3174:152:52" + } + ] + } + ] + }, + "documentation": { + "id": 8458, + "nodeType": "StructuredDocumentation", + "src": "2902:113:52", + "text": " @dev Returns the division of two unsigned integers, with a success flag (no division by zero)." + }, + "id": 8478, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "tryDiv", + "nameLocation": "3029:6:52", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 8463, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8460, + "mutability": "mutable", + "name": "a", + "nameLocation": "3044:1:52", + "nodeType": "VariableDeclaration", + "scope": 8478, + "src": "3036:9:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8459, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "3036:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 8462, + "mutability": "mutable", + "name": "b", + "nameLocation": "3055:1:52", + "nodeType": "VariableDeclaration", + "scope": 8478, + "src": "3047:9:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8461, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "3047:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "3035:22:52" + }, + "returnParameters": { + "id": 8468, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8465, + "mutability": "mutable", + "name": "success", + "nameLocation": "3086:7:52", + "nodeType": "VariableDeclaration", + "scope": 8478, + "src": "3081:12:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 8464, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "3081:4:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 8467, + "mutability": "mutable", + "name": "result", + "nameLocation": "3103:6:52", + "nodeType": "VariableDeclaration", + "scope": 8478, + "src": "3095:14:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8466, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "3095:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "3080:30:52" + }, + "scope": 9938, + "src": "3020:322:52", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 8498, + "nodeType": "Block", + "src": "3567:231:52", + "statements": [ + { + "id": 8497, + "nodeType": "UncheckedBlock", + "src": "3577:215:52", + "statements": [ + { + "expression": { + "id": 8494, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 8490, + "name": "success", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8486, + "src": "3601:7:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 8493, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 8491, + "name": "b", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8483, + "src": "3611:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "hexValue": "30", + "id": 8492, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3615:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "3611:5:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "3601:15:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 8495, + "nodeType": "ExpressionStatement", + "src": "3601:15:52" + }, + { + "AST": { + "nativeSrc": "3655:127:52", + "nodeType": "YulBlock", + "src": "3655:127:52", + "statements": [ + { + "nativeSrc": "3749:19:52", + "nodeType": "YulAssignment", + "src": "3749:19:52", + "value": { + "arguments": [ + { + "name": "a", + "nativeSrc": "3763:1:52", + "nodeType": "YulIdentifier", + "src": "3763:1:52" + }, + { + "name": "b", + "nativeSrc": "3766:1:52", + "nodeType": "YulIdentifier", + "src": "3766:1:52" + } + ], + "functionName": { + "name": "mod", + "nativeSrc": "3759:3:52", + "nodeType": "YulIdentifier", + "src": "3759:3:52" + }, + "nativeSrc": "3759:9:52", + "nodeType": "YulFunctionCall", + "src": "3759:9:52" + }, + "variableNames": [ + { + "name": "result", + "nativeSrc": "3749:6:52", + "nodeType": "YulIdentifier", + "src": "3749:6:52" + } + ] + } + ] + }, + "evmVersion": "paris", + "externalReferences": [ + { + "declaration": 8481, + "isOffset": false, + "isSlot": false, + "src": "3763:1:52", + "valueSize": 1 + }, + { + "declaration": 8483, + "isOffset": false, + "isSlot": false, + "src": "3766:1:52", + "valueSize": 1 + }, + { + "declaration": 8488, + "isOffset": false, + "isSlot": false, + "src": "3749:6:52", + "valueSize": 1 + } + ], + "flags": [ + "memory-safe" + ], + "id": 8496, + "nodeType": "InlineAssembly", + "src": "3630:152:52" + } + ] + } + ] + }, + "documentation": { + "id": 8479, + "nodeType": "StructuredDocumentation", + "src": "3348:123:52", + "text": " @dev Returns the remainder of dividing two unsigned integers, with a success flag (no division by zero)." + }, + "id": 8499, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "tryMod", + "nameLocation": "3485:6:52", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 8484, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8481, + "mutability": "mutable", + "name": "a", + "nameLocation": "3500:1:52", + "nodeType": "VariableDeclaration", + "scope": 8499, + "src": "3492:9:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8480, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "3492:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 8483, + "mutability": "mutable", + "name": "b", + "nameLocation": "3511:1:52", + "nodeType": "VariableDeclaration", + "scope": 8499, + "src": "3503:9:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8482, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "3503:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "3491:22:52" + }, + "returnParameters": { + "id": 8489, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8486, + "mutability": "mutable", + "name": "success", + "nameLocation": "3542:7:52", + "nodeType": "VariableDeclaration", + "scope": 8499, + "src": "3537:12:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 8485, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "3537:4:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 8488, + "mutability": "mutable", + "name": "result", + "nameLocation": "3559:6:52", + "nodeType": "VariableDeclaration", + "scope": 8499, + "src": "3551:14:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8487, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "3551:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "3536:30:52" + }, + "scope": 9938, + "src": "3476:322:52", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 8528, + "nodeType": "Block", + "src": "3989:122:52", + "statements": [ + { + "assignments": [ + 8510, + 8512 + ], + "declarations": [ + { + "constant": false, + "id": 8510, + "mutability": "mutable", + "name": "success", + "nameLocation": "4005:7:52", + "nodeType": "VariableDeclaration", + "scope": 8528, + "src": "4000:12:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 8509, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "4000:4:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 8512, + "mutability": "mutable", + "name": "result", + "nameLocation": "4022:6:52", + "nodeType": "VariableDeclaration", + "scope": 8528, + "src": "4014:14:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8511, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "4014:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 8517, + "initialValue": { + "arguments": [ + { + "id": 8514, + "name": "a", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8502, + "src": "4039:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 8515, + "name": "b", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8504, + "src": "4042:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 8513, + "name": "tryAdd", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8392, + "src": "4032:6:52", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_bool_$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (bool,uint256)" + } + }, + "id": 8516, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4032:12:52", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_bool_$_t_uint256_$", + "typeString": "tuple(bool,uint256)" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "3999:45:52" + }, + { + "expression": { + "arguments": [ + { + "id": 8519, + "name": "success", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8510, + "src": "4069:7:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "id": 8520, + "name": "result", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8512, + "src": "4078:6:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "expression": { + "arguments": [ + { + "id": 8523, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "4091:7:52", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + }, + "typeName": { + "id": 8522, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "4091:7:52", + "typeDescriptions": {} + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + } + ], + "id": 8521, + "name": "type", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -27, + "src": "4086:4:52", + "typeDescriptions": { + "typeIdentifier": "t_function_metatype_pure$__$returns$__$", + "typeString": "function () pure" + } + }, + "id": 8524, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4086:13:52", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_magic_meta_type_t_uint256", + "typeString": "type(uint256)" + } + }, + "id": 8525, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "4100:3:52", + "memberName": "max", + "nodeType": "MemberAccess", + "src": "4086:17:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 8518, + "name": "ternary", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8606, + "src": "4061:7:52", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_bool_$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (bool,uint256,uint256) pure returns (uint256)" + } + }, + "id": 8526, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4061:43:52", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 8508, + "id": 8527, + "nodeType": "Return", + "src": "4054:50:52" + } + ] + }, + "documentation": { + "id": 8500, + "nodeType": "StructuredDocumentation", + "src": "3804:103:52", + "text": " @dev Unsigned saturating addition, bounds to `2²⁵⁶ - 1` instead of overflowing." + }, + "id": 8529, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "saturatingAdd", + "nameLocation": "3921:13:52", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 8505, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8502, + "mutability": "mutable", + "name": "a", + "nameLocation": "3943:1:52", + "nodeType": "VariableDeclaration", + "scope": 8529, + "src": "3935:9:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8501, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "3935:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 8504, + "mutability": "mutable", + "name": "b", + "nameLocation": "3954:1:52", + "nodeType": "VariableDeclaration", + "scope": 8529, + "src": "3946:9:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8503, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "3946:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "3934:22:52" + }, + "returnParameters": { + "id": 8508, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8507, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 8529, + "src": "3980:7:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8506, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "3980:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "3979:9:52" + }, + "scope": 9938, + "src": "3912:199:52", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 8548, + "nodeType": "Block", + "src": "4294:73:52", + "statements": [ + { + "assignments": [ + null, + 8540 + ], + "declarations": [ + null, + { + "constant": false, + "id": 8540, + "mutability": "mutable", + "name": "result", + "nameLocation": "4315:6:52", + "nodeType": "VariableDeclaration", + "scope": 8548, + "src": "4307:14:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8539, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "4307:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 8545, + "initialValue": { + "arguments": [ + { + "id": 8542, + "name": "a", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8532, + "src": "4332:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 8543, + "name": "b", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8534, + "src": "4335:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 8541, + "name": "trySub", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8427, + "src": "4325:6:52", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_bool_$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (bool,uint256)" + } + }, + "id": 8544, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4325:12:52", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_bool_$_t_uint256_$", + "typeString": "tuple(bool,uint256)" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "4304:33:52" + }, + { + "expression": { + "id": 8546, + "name": "result", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8540, + "src": "4354:6:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 8538, + "id": 8547, + "nodeType": "Return", + "src": "4347:13:52" + } + ] + }, + "documentation": { + "id": 8530, + "nodeType": "StructuredDocumentation", + "src": "4117:95:52", + "text": " @dev Unsigned saturating subtraction, bounds to zero instead of overflowing." + }, + "id": 8549, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "saturatingSub", + "nameLocation": "4226:13:52", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 8535, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8532, + "mutability": "mutable", + "name": "a", + "nameLocation": "4248:1:52", + "nodeType": "VariableDeclaration", + "scope": 8549, + "src": "4240:9:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8531, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "4240:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 8534, + "mutability": "mutable", + "name": "b", + "nameLocation": "4259:1:52", + "nodeType": "VariableDeclaration", + "scope": 8549, + "src": "4251:9:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8533, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "4251:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "4239:22:52" + }, + "returnParameters": { + "id": 8538, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8537, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 8549, + "src": "4285:7:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8536, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "4285:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "4284:9:52" + }, + "scope": 9938, + "src": "4217:150:52", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 8578, + "nodeType": "Block", + "src": "4564:122:52", + "statements": [ + { + "assignments": [ + 8560, + 8562 + ], + "declarations": [ + { + "constant": false, + "id": 8560, + "mutability": "mutable", + "name": "success", + "nameLocation": "4580:7:52", + "nodeType": "VariableDeclaration", + "scope": 8578, + "src": "4575:12:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 8559, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "4575:4:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 8562, + "mutability": "mutable", + "name": "result", + "nameLocation": "4597:6:52", + "nodeType": "VariableDeclaration", + "scope": 8578, + "src": "4589:14:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8561, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "4589:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 8567, + "initialValue": { + "arguments": [ + { + "id": 8564, + "name": "a", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8552, + "src": "4614:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 8565, + "name": "b", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8554, + "src": "4617:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 8563, + "name": "tryMul", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8457, + "src": "4607:6:52", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_bool_$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (bool,uint256)" + } + }, + "id": 8566, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4607:12:52", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_bool_$_t_uint256_$", + "typeString": "tuple(bool,uint256)" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "4574:45:52" + }, + { + "expression": { + "arguments": [ + { + "id": 8569, + "name": "success", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8560, + "src": "4644:7:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "id": 8570, + "name": "result", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8562, + "src": "4653:6:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "expression": { + "arguments": [ + { + "id": 8573, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "4666:7:52", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + }, + "typeName": { + "id": 8572, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "4666:7:52", + "typeDescriptions": {} + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + } + ], + "id": 8571, + "name": "type", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -27, + "src": "4661:4:52", + "typeDescriptions": { + "typeIdentifier": "t_function_metatype_pure$__$returns$__$", + "typeString": "function () pure" + } + }, + "id": 8574, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4661:13:52", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_magic_meta_type_t_uint256", + "typeString": "type(uint256)" + } + }, + "id": 8575, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "4675:3:52", + "memberName": "max", + "nodeType": "MemberAccess", + "src": "4661:17:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 8568, + "name": "ternary", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8606, + "src": "4636:7:52", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_bool_$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (bool,uint256,uint256) pure returns (uint256)" + } + }, + "id": 8576, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4636:43:52", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 8558, + "id": 8577, + "nodeType": "Return", + "src": "4629:50:52" + } + ] + }, + "documentation": { + "id": 8550, + "nodeType": "StructuredDocumentation", + "src": "4373:109:52", + "text": " @dev Unsigned saturating multiplication, bounds to `2²⁵⁶ - 1` instead of overflowing." + }, + "id": 8579, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "saturatingMul", + "nameLocation": "4496:13:52", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 8555, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8552, + "mutability": "mutable", + "name": "a", + "nameLocation": "4518:1:52", + "nodeType": "VariableDeclaration", + "scope": 8579, + "src": "4510:9:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8551, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "4510:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 8554, + "mutability": "mutable", + "name": "b", + "nameLocation": "4529:1:52", + "nodeType": "VariableDeclaration", + "scope": 8579, + "src": "4521:9:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8553, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "4521:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "4509:22:52" + }, + "returnParameters": { + "id": 8558, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8557, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 8579, + "src": "4555:7:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8556, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "4555:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "4554:9:52" + }, + "scope": 9938, + "src": "4487:199:52", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 8605, + "nodeType": "Block", + "src": "5158:207:52", + "statements": [ + { + "id": 8604, + "nodeType": "UncheckedBlock", + "src": "5168:191:52", + "statements": [ + { + "expression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 8602, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 8591, + "name": "b", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8586, + "src": "5306:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "^", + "rightExpression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 8600, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 8594, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 8592, + "name": "a", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8584, + "src": "5312:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "^", + "rightExpression": { + "id": 8593, + "name": "b", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8586, + "src": "5316:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "5312:5:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 8595, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "5311:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "*", + "rightExpression": { + "arguments": [ + { + "id": 8598, + "name": "condition", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8582, + "src": "5337:9:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "expression": { + "id": 8596, + "name": "SafeCast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11703, + "src": "5321:8:52", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_SafeCast_$11703_$", + "typeString": "type(library SafeCast)" + } + }, + "id": 8597, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "5330:6:52", + "memberName": "toUint", + "nodeType": "MemberAccess", + "referencedDeclaration": 11702, + "src": "5321:15:52", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_bool_$returns$_t_uint256_$", + "typeString": "function (bool) pure returns (uint256)" + } + }, + "id": 8599, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5321:26:52", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "5311:36:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 8601, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "5310:38:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "5306:42:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 8590, + "id": 8603, + "nodeType": "Return", + "src": "5299:49:52" + } + ] + } + ] + }, + "documentation": { + "id": 8580, + "nodeType": "StructuredDocumentation", + "src": "4692:374:52", + "text": " @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\n IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\n However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\n one branch when needed, making this function more expensive." + }, + "id": 8606, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "ternary", + "nameLocation": "5080:7:52", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 8587, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8582, + "mutability": "mutable", + "name": "condition", + "nameLocation": "5093:9:52", + "nodeType": "VariableDeclaration", + "scope": 8606, + "src": "5088:14:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 8581, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "5088:4:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 8584, + "mutability": "mutable", + "name": "a", + "nameLocation": "5112:1:52", + "nodeType": "VariableDeclaration", + "scope": 8606, + "src": "5104:9:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8583, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "5104:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 8586, + "mutability": "mutable", + "name": "b", + "nameLocation": "5123:1:52", + "nodeType": "VariableDeclaration", + "scope": 8606, + "src": "5115:9:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8585, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "5115:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "5087:38:52" + }, + "returnParameters": { + "id": 8590, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8589, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 8606, + "src": "5149:7:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8588, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "5149:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "5148:9:52" + }, + "scope": 9938, + "src": "5071:294:52", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 8624, + "nodeType": "Block", + "src": "5502:44:52", + "statements": [ + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 8619, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 8617, + "name": "a", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8609, + "src": "5527:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "id": 8618, + "name": "b", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8611, + "src": "5531:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "5527:5:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "id": 8620, + "name": "a", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8609, + "src": "5534:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 8621, + "name": "b", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8611, + "src": "5537:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 8616, + "name": "ternary", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8606, + "src": "5519:7:52", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_bool_$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (bool,uint256,uint256) pure returns (uint256)" + } + }, + "id": 8622, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5519:20:52", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 8615, + "id": 8623, + "nodeType": "Return", + "src": "5512:27:52" + } + ] + }, + "documentation": { + "id": 8607, + "nodeType": "StructuredDocumentation", + "src": "5371:59:52", + "text": " @dev Returns the largest of two numbers." + }, + "id": 8625, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "max", + "nameLocation": "5444:3:52", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 8612, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8609, + "mutability": "mutable", + "name": "a", + "nameLocation": "5456:1:52", + "nodeType": "VariableDeclaration", + "scope": 8625, + "src": "5448:9:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8608, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "5448:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 8611, + "mutability": "mutable", + "name": "b", + "nameLocation": "5467:1:52", + "nodeType": "VariableDeclaration", + "scope": 8625, + "src": "5459:9:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8610, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "5459:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "5447:22:52" + }, + "returnParameters": { + "id": 8615, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8614, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 8625, + "src": "5493:7:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8613, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "5493:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "5492:9:52" + }, + "scope": 9938, + "src": "5435:111:52", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 8643, + "nodeType": "Block", + "src": "5684:44:52", + "statements": [ + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 8638, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 8636, + "name": "a", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8628, + "src": "5709:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "id": 8637, + "name": "b", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8630, + "src": "5713:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "5709:5:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "id": 8639, + "name": "a", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8628, + "src": "5716:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 8640, + "name": "b", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8630, + "src": "5719:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 8635, + "name": "ternary", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8606, + "src": "5701:7:52", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_bool_$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (bool,uint256,uint256) pure returns (uint256)" + } + }, + "id": 8641, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5701:20:52", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 8634, + "id": 8642, + "nodeType": "Return", + "src": "5694:27:52" + } + ] + }, + "documentation": { + "id": 8626, + "nodeType": "StructuredDocumentation", + "src": "5552:60:52", + "text": " @dev Returns the smallest of two numbers." + }, + "id": 8644, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "min", + "nameLocation": "5626:3:52", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 8631, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8628, + "mutability": "mutable", + "name": "a", + "nameLocation": "5638:1:52", + "nodeType": "VariableDeclaration", + "scope": 8644, + "src": "5630:9:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8627, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "5630:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 8630, + "mutability": "mutable", + "name": "b", + "nameLocation": "5649:1:52", + "nodeType": "VariableDeclaration", + "scope": 8644, + "src": "5641:9:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8629, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "5641:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "5629:22:52" + }, + "returnParameters": { + "id": 8634, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8633, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 8644, + "src": "5675:7:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8632, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "5675:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "5674:9:52" + }, + "scope": 9938, + "src": "5617:111:52", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 8666, + "nodeType": "Block", + "src": "5912:82:52", + "statements": [ + { + "expression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 8664, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 8656, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 8654, + "name": "a", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8647, + "src": "5967:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "&", + "rightExpression": { + "id": 8655, + "name": "b", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8649, + "src": "5971:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "5967:5:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 8657, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "5966:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 8663, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 8660, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 8658, + "name": "a", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8647, + "src": "5977:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "^", + "rightExpression": { + "id": 8659, + "name": "b", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8649, + "src": "5981:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "5977:5:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 8661, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "5976:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "/", + "rightExpression": { + "hexValue": "32", + "id": 8662, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "5986:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_2_by_1", + "typeString": "int_const 2" + }, + "value": "2" + }, + "src": "5976:11:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "5966:21:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 8653, + "id": 8665, + "nodeType": "Return", + "src": "5959:28:52" + } + ] + }, + "documentation": { + "id": 8645, + "nodeType": "StructuredDocumentation", + "src": "5734:102:52", + "text": " @dev Returns the average of two numbers. The result is rounded towards\n zero." + }, + "id": 8667, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "average", + "nameLocation": "5850:7:52", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 8650, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8647, + "mutability": "mutable", + "name": "a", + "nameLocation": "5866:1:52", + "nodeType": "VariableDeclaration", + "scope": 8667, + "src": "5858:9:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8646, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "5858:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 8649, + "mutability": "mutable", + "name": "b", + "nameLocation": "5877:1:52", + "nodeType": "VariableDeclaration", + "scope": 8667, + "src": "5869:9:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8648, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "5869:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "5857:22:52" + }, + "returnParameters": { + "id": 8653, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8652, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 8667, + "src": "5903:7:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8651, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "5903:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "5902:9:52" + }, + "scope": 9938, + "src": "5841:153:52", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 8707, + "nodeType": "Block", + "src": "6286:633:52", + "statements": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 8679, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 8677, + "name": "b", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8672, + "src": "6300:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "30", + "id": 8678, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6305:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "6300:6:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 8688, + "nodeType": "IfStatement", + "src": "6296:150:52", + "trueBody": { + "id": 8687, + "nodeType": "Block", + "src": "6308:138:52", + "statements": [ + { + "expression": { + "arguments": [ + { + "expression": { + "id": 8683, + "name": "Panic", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6481, + "src": "6412:5:52", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_Panic_$6481_$", + "typeString": "type(library Panic)" + } + }, + "id": 8684, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "6418:16:52", + "memberName": "DIVISION_BY_ZERO", + "nodeType": "MemberAccess", + "referencedDeclaration": 6448, + "src": "6412:22:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "id": 8680, + "name": "Panic", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6481, + "src": "6400:5:52", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_Panic_$6481_$", + "typeString": "type(library Panic)" + } + }, + "id": 8682, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "6406:5:52", + "memberName": "panic", + "nodeType": "MemberAccess", + "referencedDeclaration": 6480, + "src": "6400:11:52", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$returns$__$", + "typeString": "function (uint256) pure" + } + }, + "id": 8685, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "6400:35:52", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 8686, + "nodeType": "ExpressionStatement", + "src": "6400:35:52" + } + ] + } + }, + { + "id": 8706, + "nodeType": "UncheckedBlock", + "src": "6829:84:52", + "statements": [ + { + "expression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 8704, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 8693, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 8691, + "name": "a", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8670, + "src": "6876:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "hexValue": "30", + "id": 8692, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6880:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "6876:5:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "expression": { + "id": 8689, + "name": "SafeCast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11703, + "src": "6860:8:52", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_SafeCast_$11703_$", + "typeString": "type(library SafeCast)" + } + }, + "id": 8690, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "6869:6:52", + "memberName": "toUint", + "nodeType": "MemberAccess", + "referencedDeclaration": 11702, + "src": "6860:15:52", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_bool_$returns$_t_uint256_$", + "typeString": "function (bool) pure returns (uint256)" + } + }, + "id": 8694, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "6860:22:52", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "*", + "rightExpression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 8702, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 8700, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 8697, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 8695, + "name": "a", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8670, + "src": "6887:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "hexValue": "31", + "id": 8696, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6891:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "6887:5:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 8698, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "6886:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "/", + "rightExpression": { + "id": 8699, + "name": "b", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8672, + "src": "6896:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "6886:11:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "hexValue": "31", + "id": 8701, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6900:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "6886:15:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 8703, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "6885:17:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "6860:42:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 8676, + "id": 8705, + "nodeType": "Return", + "src": "6853:49:52" + } + ] + } + ] + }, + "documentation": { + "id": 8668, + "nodeType": "StructuredDocumentation", + "src": "6000:210:52", + "text": " @dev Returns the ceiling of the division of two numbers.\n This differs from standard division with `/` in that it rounds towards infinity instead\n of rounding towards zero." + }, + "id": 8708, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "ceilDiv", + "nameLocation": "6224:7:52", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 8673, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8670, + "mutability": "mutable", + "name": "a", + "nameLocation": "6240:1:52", + "nodeType": "VariableDeclaration", + "scope": 8708, + "src": "6232:9:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8669, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "6232:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 8672, + "mutability": "mutable", + "name": "b", + "nameLocation": "6251:1:52", + "nodeType": "VariableDeclaration", + "scope": 8708, + "src": "6243:9:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8671, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "6243:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "6231:22:52" + }, + "returnParameters": { + "id": 8676, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8675, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 8708, + "src": "6277:7:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8674, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "6277:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "6276:9:52" + }, + "scope": 9938, + "src": "6215:704:52", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 8843, + "nodeType": "Block", + "src": "7340:3585:52", + "statements": [ + { + "id": 8842, + "nodeType": "UncheckedBlock", + "src": "7350:3569:52", + "statements": [ + { + "assignments": [ + 8721, + 8723 + ], + "declarations": [ + { + "constant": false, + "id": 8721, + "mutability": "mutable", + "name": "high", + "nameLocation": "7383:4:52", + "nodeType": "VariableDeclaration", + "scope": 8842, + "src": "7375:12:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8720, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "7375:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 8723, + "mutability": "mutable", + "name": "low", + "nameLocation": "7397:3:52", + "nodeType": "VariableDeclaration", + "scope": 8842, + "src": "7389:11:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8722, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "7389:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 8728, + "initialValue": { + "arguments": [ + { + "id": 8725, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8711, + "src": "7411:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 8726, + "name": "y", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8713, + "src": "7414:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 8724, + "name": "mul512", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8357, + "src": "7404:6:52", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256,uint256)" + } + }, + "id": 8727, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "7404:12:52", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$", + "typeString": "tuple(uint256,uint256)" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "7374:42:52" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 8731, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 8729, + "name": "high", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8721, + "src": "7498:4:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "30", + "id": 8730, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7506:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "7498:9:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 8737, + "nodeType": "IfStatement", + "src": "7494:365:52", + "trueBody": { + "id": 8736, + "nodeType": "Block", + "src": "7509:350:52", + "statements": [ + { + "expression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 8734, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 8732, + "name": "low", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8723, + "src": "7827:3:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "/", + "rightExpression": { + "id": 8733, + "name": "denominator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8715, + "src": "7833:11:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "7827:17:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 8719, + "id": 8735, + "nodeType": "Return", + "src": "7820:24:52" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 8740, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 8738, + "name": "denominator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8715, + "src": "7969:11:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "id": 8739, + "name": "high", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8721, + "src": "7984:4:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "7969:19:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 8756, + "nodeType": "IfStatement", + "src": "7965:142:52", + "trueBody": { + "id": 8755, + "nodeType": "Block", + "src": "7990:117:52", + "statements": [ + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 8747, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 8745, + "name": "denominator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8715, + "src": "8028:11:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "30", + "id": 8746, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8043:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "8028:16:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "expression": { + "id": 8748, + "name": "Panic", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6481, + "src": "8046:5:52", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_Panic_$6481_$", + "typeString": "type(library Panic)" + } + }, + "id": 8749, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "8052:16:52", + "memberName": "DIVISION_BY_ZERO", + "nodeType": "MemberAccess", + "referencedDeclaration": 6448, + "src": "8046:22:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "expression": { + "id": 8750, + "name": "Panic", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6481, + "src": "8070:5:52", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_Panic_$6481_$", + "typeString": "type(library Panic)" + } + }, + "id": 8751, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "8076:14:52", + "memberName": "UNDER_OVERFLOW", + "nodeType": "MemberAccess", + "referencedDeclaration": 6444, + "src": "8070:20:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 8744, + "name": "ternary", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8606, + "src": "8020:7:52", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_bool_$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (bool,uint256,uint256) pure returns (uint256)" + } + }, + "id": 8752, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "8020:71:52", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "id": 8741, + "name": "Panic", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6481, + "src": "8008:5:52", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_Panic_$6481_$", + "typeString": "type(library Panic)" + } + }, + "id": 8743, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "8014:5:52", + "memberName": "panic", + "nodeType": "MemberAccess", + "referencedDeclaration": 6480, + "src": "8008:11:52", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$returns$__$", + "typeString": "function (uint256) pure" + } + }, + "id": 8753, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "8008:84:52", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 8754, + "nodeType": "ExpressionStatement", + "src": "8008:84:52" + } + ] + } + }, + { + "assignments": [ + 8758 + ], + "declarations": [ + { + "constant": false, + "id": 8758, + "mutability": "mutable", + "name": "remainder", + "nameLocation": "8367:9:52", + "nodeType": "VariableDeclaration", + "scope": 8842, + "src": "8359:17:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8757, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "8359:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 8759, + "nodeType": "VariableDeclarationStatement", + "src": "8359:17:52" + }, + { + "AST": { + "nativeSrc": "8415:283:52", + "nodeType": "YulBlock", + "src": "8415:283:52", + "statements": [ + { + "nativeSrc": "8484:38:52", + "nodeType": "YulAssignment", + "src": "8484:38:52", + "value": { + "arguments": [ + { + "name": "x", + "nativeSrc": "8504:1:52", + "nodeType": "YulIdentifier", + "src": "8504:1:52" + }, + { + "name": "y", + "nativeSrc": "8507:1:52", + "nodeType": "YulIdentifier", + "src": "8507:1:52" + }, + { + "name": "denominator", + "nativeSrc": "8510:11:52", + "nodeType": "YulIdentifier", + "src": "8510:11:52" + } + ], + "functionName": { + "name": "mulmod", + "nativeSrc": "8497:6:52", + "nodeType": "YulIdentifier", + "src": "8497:6:52" + }, + "nativeSrc": "8497:25:52", + "nodeType": "YulFunctionCall", + "src": "8497:25:52" + }, + "variableNames": [ + { + "name": "remainder", + "nativeSrc": "8484:9:52", + "nodeType": "YulIdentifier", + "src": "8484:9:52" + } + ] + }, + { + "nativeSrc": "8604:37:52", + "nodeType": "YulAssignment", + "src": "8604:37:52", + "value": { + "arguments": [ + { + "name": "high", + "nativeSrc": "8616:4:52", + "nodeType": "YulIdentifier", + "src": "8616:4:52" + }, + { + "arguments": [ + { + "name": "remainder", + "nativeSrc": "8625:9:52", + "nodeType": "YulIdentifier", + "src": "8625:9:52" + }, + { + "name": "low", + "nativeSrc": "8636:3:52", + "nodeType": "YulIdentifier", + "src": "8636:3:52" + } + ], + "functionName": { + "name": "gt", + "nativeSrc": "8622:2:52", + "nodeType": "YulIdentifier", + "src": "8622:2:52" + }, + "nativeSrc": "8622:18:52", + "nodeType": "YulFunctionCall", + "src": "8622:18:52" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "8612:3:52", + "nodeType": "YulIdentifier", + "src": "8612:3:52" + }, + "nativeSrc": "8612:29:52", + "nodeType": "YulFunctionCall", + "src": "8612:29:52" + }, + "variableNames": [ + { + "name": "high", + "nativeSrc": "8604:4:52", + "nodeType": "YulIdentifier", + "src": "8604:4:52" + } + ] + }, + { + "nativeSrc": "8658:26:52", + "nodeType": "YulAssignment", + "src": "8658:26:52", + "value": { + "arguments": [ + { + "name": "low", + "nativeSrc": "8669:3:52", + "nodeType": "YulIdentifier", + "src": "8669:3:52" + }, + { + "name": "remainder", + "nativeSrc": "8674:9:52", + "nodeType": "YulIdentifier", + "src": "8674:9:52" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "8665:3:52", + "nodeType": "YulIdentifier", + "src": "8665:3:52" + }, + "nativeSrc": "8665:19:52", + "nodeType": "YulFunctionCall", + "src": "8665:19:52" + }, + "variableNames": [ + { + "name": "low", + "nativeSrc": "8658:3:52", + "nodeType": "YulIdentifier", + "src": "8658:3:52" + } + ] + } + ] + }, + "evmVersion": "paris", + "externalReferences": [ + { + "declaration": 8715, + "isOffset": false, + "isSlot": false, + "src": "8510:11:52", + "valueSize": 1 + }, + { + "declaration": 8721, + "isOffset": false, + "isSlot": false, + "src": "8604:4:52", + "valueSize": 1 + }, + { + "declaration": 8721, + "isOffset": false, + "isSlot": false, + "src": "8616:4:52", + "valueSize": 1 + }, + { + "declaration": 8723, + "isOffset": false, + "isSlot": false, + "src": "8636:3:52", + "valueSize": 1 + }, + { + "declaration": 8723, + "isOffset": false, + "isSlot": false, + "src": "8658:3:52", + "valueSize": 1 + }, + { + "declaration": 8723, + "isOffset": false, + "isSlot": false, + "src": "8669:3:52", + "valueSize": 1 + }, + { + "declaration": 8758, + "isOffset": false, + "isSlot": false, + "src": "8484:9:52", + "valueSize": 1 + }, + { + "declaration": 8758, + "isOffset": false, + "isSlot": false, + "src": "8625:9:52", + "valueSize": 1 + }, + { + "declaration": 8758, + "isOffset": false, + "isSlot": false, + "src": "8674:9:52", + "valueSize": 1 + }, + { + "declaration": 8711, + "isOffset": false, + "isSlot": false, + "src": "8504:1:52", + "valueSize": 1 + }, + { + "declaration": 8713, + "isOffset": false, + "isSlot": false, + "src": "8507:1:52", + "valueSize": 1 + } + ], + "flags": [ + "memory-safe" + ], + "id": 8760, + "nodeType": "InlineAssembly", + "src": "8390:308:52" + }, + { + "assignments": [ + 8762 + ], + "declarations": [ + { + "constant": false, + "id": 8762, + "mutability": "mutable", + "name": "twos", + "nameLocation": "8910:4:52", + "nodeType": "VariableDeclaration", + "scope": 8842, + "src": "8902:12:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8761, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "8902:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 8769, + "initialValue": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 8768, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 8763, + "name": "denominator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8715, + "src": "8917:11:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "&", + "rightExpression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 8766, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "hexValue": "30", + "id": 8764, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8932:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "id": 8765, + "name": "denominator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8715, + "src": "8936:11:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "8932:15:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 8767, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "8931:17:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "8917:31:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "8902:46:52" + }, + { + "AST": { + "nativeSrc": "8987:359:52", + "nodeType": "YulBlock", + "src": "8987:359:52", + "statements": [ + { + "nativeSrc": "9052:37:52", + "nodeType": "YulAssignment", + "src": "9052:37:52", + "value": { + "arguments": [ + { + "name": "denominator", + "nativeSrc": "9071:11:52", + "nodeType": "YulIdentifier", + "src": "9071:11:52" + }, + { + "name": "twos", + "nativeSrc": "9084:4:52", + "nodeType": "YulIdentifier", + "src": "9084:4:52" + } + ], + "functionName": { + "name": "div", + "nativeSrc": "9067:3:52", + "nodeType": "YulIdentifier", + "src": "9067:3:52" + }, + "nativeSrc": "9067:22:52", + "nodeType": "YulFunctionCall", + "src": "9067:22:52" + }, + "variableNames": [ + { + "name": "denominator", + "nativeSrc": "9052:11:52", + "nodeType": "YulIdentifier", + "src": "9052:11:52" + } + ] + }, + { + "nativeSrc": "9153:21:52", + "nodeType": "YulAssignment", + "src": "9153:21:52", + "value": { + "arguments": [ + { + "name": "low", + "nativeSrc": "9164:3:52", + "nodeType": "YulIdentifier", + "src": "9164:3:52" + }, + { + "name": "twos", + "nativeSrc": "9169:4:52", + "nodeType": "YulIdentifier", + "src": "9169:4:52" + } + ], + "functionName": { + "name": "div", + "nativeSrc": "9160:3:52", + "nodeType": "YulIdentifier", + "src": "9160:3:52" + }, + "nativeSrc": "9160:14:52", + "nodeType": "YulFunctionCall", + "src": "9160:14:52" + }, + "variableNames": [ + { + "name": "low", + "nativeSrc": "9153:3:52", + "nodeType": "YulIdentifier", + "src": "9153:3:52" + } + ] + }, + { + "nativeSrc": "9293:39:52", + "nodeType": "YulAssignment", + "src": "9293:39:52", + "value": { + "arguments": [ + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "9313:1:52", + "nodeType": "YulLiteral", + "src": "9313:1:52", + "type": "", + "value": "0" + }, + { + "name": "twos", + "nativeSrc": "9316:4:52", + "nodeType": "YulIdentifier", + "src": "9316:4:52" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "9309:3:52", + "nodeType": "YulIdentifier", + "src": "9309:3:52" + }, + "nativeSrc": "9309:12:52", + "nodeType": "YulFunctionCall", + "src": "9309:12:52" + }, + { + "name": "twos", + "nativeSrc": "9323:4:52", + "nodeType": "YulIdentifier", + "src": "9323:4:52" + } + ], + "functionName": { + "name": "div", + "nativeSrc": "9305:3:52", + "nodeType": "YulIdentifier", + "src": "9305:3:52" + }, + "nativeSrc": "9305:23:52", + "nodeType": "YulFunctionCall", + "src": "9305:23:52" + }, + { + "kind": "number", + "nativeSrc": "9330:1:52", + "nodeType": "YulLiteral", + "src": "9330:1:52", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "9301:3:52", + "nodeType": "YulIdentifier", + "src": "9301:3:52" + }, + "nativeSrc": "9301:31:52", + "nodeType": "YulFunctionCall", + "src": "9301:31:52" + }, + "variableNames": [ + { + "name": "twos", + "nativeSrc": "9293:4:52", + "nodeType": "YulIdentifier", + "src": "9293:4:52" + } + ] + } + ] + }, + "evmVersion": "paris", + "externalReferences": [ + { + "declaration": 8715, + "isOffset": false, + "isSlot": false, + "src": "9052:11:52", + "valueSize": 1 + }, + { + "declaration": 8715, + "isOffset": false, + "isSlot": false, + "src": "9071:11:52", + "valueSize": 1 + }, + { + "declaration": 8723, + "isOffset": false, + "isSlot": false, + "src": "9153:3:52", + "valueSize": 1 + }, + { + "declaration": 8723, + "isOffset": false, + "isSlot": false, + "src": "9164:3:52", + "valueSize": 1 + }, + { + "declaration": 8762, + "isOffset": false, + "isSlot": false, + "src": "9084:4:52", + "valueSize": 1 + }, + { + "declaration": 8762, + "isOffset": false, + "isSlot": false, + "src": "9169:4:52", + "valueSize": 1 + }, + { + "declaration": 8762, + "isOffset": false, + "isSlot": false, + "src": "9293:4:52", + "valueSize": 1 + }, + { + "declaration": 8762, + "isOffset": false, + "isSlot": false, + "src": "9316:4:52", + "valueSize": 1 + }, + { + "declaration": 8762, + "isOffset": false, + "isSlot": false, + "src": "9323:4:52", + "valueSize": 1 + } + ], + "flags": [ + "memory-safe" + ], + "id": 8770, + "nodeType": "InlineAssembly", + "src": "8962:384:52" + }, + { + "expression": { + "id": 8775, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 8771, + "name": "low", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8723, + "src": "9409:3:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "|=", + "rightHandSide": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 8774, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 8772, + "name": "high", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8721, + "src": "9416:4:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "*", + "rightExpression": { + "id": 8773, + "name": "twos", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8762, + "src": "9423:4:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "9416:11:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "9409:18:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 8776, + "nodeType": "ExpressionStatement", + "src": "9409:18:52" + }, + { + "assignments": [ + 8778 + ], + "declarations": [ + { + "constant": false, + "id": 8778, + "mutability": "mutable", + "name": "inverse", + "nameLocation": "9770:7:52", + "nodeType": "VariableDeclaration", + "scope": 8842, + "src": "9762:15:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8777, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "9762:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 8785, + "initialValue": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 8784, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 8781, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "hexValue": "33", + "id": 8779, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "9781:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_3_by_1", + "typeString": "int_const 3" + }, + "value": "3" + }, + "nodeType": "BinaryOperation", + "operator": "*", + "rightExpression": { + "id": 8780, + "name": "denominator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8715, + "src": "9785:11:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "9781:15:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 8782, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "9780:17:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "^", + "rightExpression": { + "hexValue": "32", + "id": 8783, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "9800:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_2_by_1", + "typeString": "int_const 2" + }, + "value": "2" + }, + "src": "9780:21:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "9762:39:52" + }, + { + "expression": { + "id": 8792, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 8786, + "name": "inverse", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8778, + "src": "10018:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "*=", + "rightHandSide": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 8791, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "hexValue": "32", + "id": 8787, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10029:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_2_by_1", + "typeString": "int_const 2" + }, + "value": "2" + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 8790, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 8788, + "name": "denominator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8715, + "src": "10033:11:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "*", + "rightExpression": { + "id": 8789, + "name": "inverse", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8778, + "src": "10047:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "10033:21:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "10029:25:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "10018:36:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 8793, + "nodeType": "ExpressionStatement", + "src": "10018:36:52" + }, + { + "expression": { + "id": 8800, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 8794, + "name": "inverse", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8778, + "src": "10088:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "*=", + "rightHandSide": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 8799, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "hexValue": "32", + "id": 8795, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10099:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_2_by_1", + "typeString": "int_const 2" + }, + "value": "2" + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 8798, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 8796, + "name": "denominator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8715, + "src": "10103:11:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "*", + "rightExpression": { + "id": 8797, + "name": "inverse", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8778, + "src": "10117:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "10103:21:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "10099:25:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "10088:36:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 8801, + "nodeType": "ExpressionStatement", + "src": "10088:36:52" + }, + { + "expression": { + "id": 8808, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 8802, + "name": "inverse", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8778, + "src": "10160:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "*=", + "rightHandSide": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 8807, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "hexValue": "32", + "id": 8803, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10171:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_2_by_1", + "typeString": "int_const 2" + }, + "value": "2" + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 8806, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 8804, + "name": "denominator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8715, + "src": "10175:11:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "*", + "rightExpression": { + "id": 8805, + "name": "inverse", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8778, + "src": "10189:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "10175:21:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "10171:25:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "10160:36:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 8809, + "nodeType": "ExpressionStatement", + "src": "10160:36:52" + }, + { + "expression": { + "id": 8816, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 8810, + "name": "inverse", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8778, + "src": "10231:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "*=", + "rightHandSide": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 8815, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "hexValue": "32", + "id": 8811, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10242:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_2_by_1", + "typeString": "int_const 2" + }, + "value": "2" + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 8814, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 8812, + "name": "denominator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8715, + "src": "10246:11:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "*", + "rightExpression": { + "id": 8813, + "name": "inverse", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8778, + "src": "10260:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "10246:21:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "10242:25:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "10231:36:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 8817, + "nodeType": "ExpressionStatement", + "src": "10231:36:52" + }, + { + "expression": { + "id": 8824, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 8818, + "name": "inverse", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8778, + "src": "10304:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "*=", + "rightHandSide": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 8823, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "hexValue": "32", + "id": 8819, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10315:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_2_by_1", + "typeString": "int_const 2" + }, + "value": "2" + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 8822, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 8820, + "name": "denominator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8715, + "src": "10319:11:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "*", + "rightExpression": { + "id": 8821, + "name": "inverse", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8778, + "src": "10333:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "10319:21:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "10315:25:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "10304:36:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 8825, + "nodeType": "ExpressionStatement", + "src": "10304:36:52" + }, + { + "expression": { + "id": 8832, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 8826, + "name": "inverse", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8778, + "src": "10378:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "*=", + "rightHandSide": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 8831, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "hexValue": "32", + "id": 8827, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10389:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_2_by_1", + "typeString": "int_const 2" + }, + "value": "2" + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 8830, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 8828, + "name": "denominator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8715, + "src": "10393:11:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "*", + "rightExpression": { + "id": 8829, + "name": "inverse", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8778, + "src": "10407:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "10393:21:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "10389:25:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "10378:36:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 8833, + "nodeType": "ExpressionStatement", + "src": "10378:36:52" + }, + { + "expression": { + "id": 8838, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 8834, + "name": "result", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8718, + "src": "10859:6:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 8837, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 8835, + "name": "low", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8723, + "src": "10868:3:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "*", + "rightExpression": { + "id": 8836, + "name": "inverse", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8778, + "src": "10874:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "10868:13:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "10859:22:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 8839, + "nodeType": "ExpressionStatement", + "src": "10859:22:52" + }, + { + "expression": { + "id": 8840, + "name": "result", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8718, + "src": "10902:6:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 8719, + "id": 8841, + "nodeType": "Return", + "src": "10895:13:52" + } + ] + } + ] + }, + "documentation": { + "id": 8709, + "nodeType": "StructuredDocumentation", + "src": "6925:312:52", + "text": " @dev Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or\n denominator == 0.\n Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by\n Uniswap Labs also under MIT license." + }, + "id": 8844, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "mulDiv", + "nameLocation": "7251:6:52", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 8716, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8711, + "mutability": "mutable", + "name": "x", + "nameLocation": "7266:1:52", + "nodeType": "VariableDeclaration", + "scope": 8844, + "src": "7258:9:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8710, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "7258:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 8713, + "mutability": "mutable", + "name": "y", + "nameLocation": "7277:1:52", + "nodeType": "VariableDeclaration", + "scope": 8844, + "src": "7269:9:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8712, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "7269:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 8715, + "mutability": "mutable", + "name": "denominator", + "nameLocation": "7288:11:52", + "nodeType": "VariableDeclaration", + "scope": 8844, + "src": "7280:19:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8714, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "7280:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "7257:43:52" + }, + "returnParameters": { + "id": 8719, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8718, + "mutability": "mutable", + "name": "result", + "nameLocation": "7332:6:52", + "nodeType": "VariableDeclaration", + "scope": 8844, + "src": "7324:14:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8717, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "7324:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "7323:16:52" + }, + "scope": 9938, + "src": "7242:3683:52", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 8880, + "nodeType": "Block", + "src": "11164:128:52", + "statements": [ + { + "expression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 8878, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "arguments": [ + { + "id": 8860, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8847, + "src": "11188:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 8861, + "name": "y", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8849, + "src": "11191:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 8862, + "name": "denominator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8851, + "src": "11194:11:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 8859, + "name": "mulDiv", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 8844, + 8881 + ], + "referencedDeclaration": 8844, + "src": "11181:6:52", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256,uint256) pure returns (uint256)" + } + }, + "id": 8863, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "11181:25:52", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 8876, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "arguments": [ + { + "id": 8867, + "name": "rounding", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8854, + "src": "11242:8:52", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Rounding_$8329", + "typeString": "enum Math.Rounding" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_Rounding_$8329", + "typeString": "enum Math.Rounding" + } + ], + "id": 8866, + "name": "unsignedRoundsUp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9937, + "src": "11225:16:52", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_enum$_Rounding_$8329_$returns$_t_bool_$", + "typeString": "function (enum Math.Rounding) pure returns (bool)" + } + }, + "id": 8868, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "11225:26:52", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "&&", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 8875, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "arguments": [ + { + "id": 8870, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8847, + "src": "11262:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 8871, + "name": "y", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8849, + "src": "11265:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 8872, + "name": "denominator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8851, + "src": "11268:11:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 8869, + "name": "mulmod", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -16, + "src": "11255:6:52", + "typeDescriptions": { + "typeIdentifier": "t_function_mulmod_pure$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256,uint256) pure returns (uint256)" + } + }, + "id": 8873, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "11255:25:52", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "hexValue": "30", + "id": 8874, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "11283:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "11255:29:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "11225:59:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "expression": { + "id": 8864, + "name": "SafeCast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11703, + "src": "11209:8:52", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_SafeCast_$11703_$", + "typeString": "type(library SafeCast)" + } + }, + "id": 8865, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "11218:6:52", + "memberName": "toUint", + "nodeType": "MemberAccess", + "referencedDeclaration": 11702, + "src": "11209:15:52", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_bool_$returns$_t_uint256_$", + "typeString": "function (bool) pure returns (uint256)" + } + }, + "id": 8877, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "11209:76:52", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "11181:104:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 8858, + "id": 8879, + "nodeType": "Return", + "src": "11174:111:52" + } + ] + }, + "documentation": { + "id": 8845, + "nodeType": "StructuredDocumentation", + "src": "10931:118:52", + "text": " @dev Calculates x * y / denominator with full precision, following the selected rounding direction." + }, + "id": 8881, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "mulDiv", + "nameLocation": "11063:6:52", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 8855, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8847, + "mutability": "mutable", + "name": "x", + "nameLocation": "11078:1:52", + "nodeType": "VariableDeclaration", + "scope": 8881, + "src": "11070:9:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8846, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "11070:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 8849, + "mutability": "mutable", + "name": "y", + "nameLocation": "11089:1:52", + "nodeType": "VariableDeclaration", + "scope": 8881, + "src": "11081:9:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8848, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "11081:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 8851, + "mutability": "mutable", + "name": "denominator", + "nameLocation": "11100:11:52", + "nodeType": "VariableDeclaration", + "scope": 8881, + "src": "11092:19:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8850, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "11092:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 8854, + "mutability": "mutable", + "name": "rounding", + "nameLocation": "11122:8:52", + "nodeType": "VariableDeclaration", + "scope": 8881, + "src": "11113:17:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Rounding_$8329", + "typeString": "enum Math.Rounding" + }, + "typeName": { + "id": 8853, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 8852, + "name": "Rounding", + "nameLocations": [ + "11113:8:52" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 8329, + "src": "11113:8:52" + }, + "referencedDeclaration": 8329, + "src": "11113:8:52", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Rounding_$8329", + "typeString": "enum Math.Rounding" + } + }, + "visibility": "internal" + } + ], + "src": "11069:62:52" + }, + "returnParameters": { + "id": 8858, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8857, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 8881, + "src": "11155:7:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8856, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "11155:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "11154:9:52" + }, + "scope": 9938, + "src": "11054:238:52", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 8930, + "nodeType": "Block", + "src": "11500:245:52", + "statements": [ + { + "id": 8929, + "nodeType": "UncheckedBlock", + "src": "11510:229:52", + "statements": [ + { + "assignments": [ + 8894, + 8896 + ], + "declarations": [ + { + "constant": false, + "id": 8894, + "mutability": "mutable", + "name": "high", + "nameLocation": "11543:4:52", + "nodeType": "VariableDeclaration", + "scope": 8929, + "src": "11535:12:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8893, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "11535:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 8896, + "mutability": "mutable", + "name": "low", + "nameLocation": "11557:3:52", + "nodeType": "VariableDeclaration", + "scope": 8929, + "src": "11549:11:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8895, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "11549:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 8901, + "initialValue": { + "arguments": [ + { + "id": 8898, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8884, + "src": "11571:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 8899, + "name": "y", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8886, + "src": "11574:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 8897, + "name": "mul512", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8357, + "src": "11564:6:52", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256,uint256)" + } + }, + "id": 8900, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "11564:12:52", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$", + "typeString": "tuple(uint256,uint256)" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "11534:42:52" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 8906, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 8902, + "name": "high", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8894, + "src": "11594:4:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 8905, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "hexValue": "31", + "id": 8903, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "11602:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "nodeType": "BinaryOperation", + "operator": "<<", + "rightExpression": { + "id": 8904, + "name": "n", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8888, + "src": "11607:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "src": "11602:6:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "11594:14:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 8915, + "nodeType": "IfStatement", + "src": "11590:86:52", + "trueBody": { + "id": 8914, + "nodeType": "Block", + "src": "11610:66:52", + "statements": [ + { + "expression": { + "arguments": [ + { + "expression": { + "id": 8910, + "name": "Panic", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6481, + "src": "11640:5:52", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_Panic_$6481_$", + "typeString": "type(library Panic)" + } + }, + "id": 8911, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "11646:14:52", + "memberName": "UNDER_OVERFLOW", + "nodeType": "MemberAccess", + "referencedDeclaration": 6444, + "src": "11640:20:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "id": 8907, + "name": "Panic", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6481, + "src": "11628:5:52", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_Panic_$6481_$", + "typeString": "type(library Panic)" + } + }, + "id": 8909, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "11634:5:52", + "memberName": "panic", + "nodeType": "MemberAccess", + "referencedDeclaration": 6480, + "src": "11628:11:52", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$returns$__$", + "typeString": "function (uint256) pure" + } + }, + "id": 8912, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "11628:33:52", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 8913, + "nodeType": "ExpressionStatement", + "src": "11628:33:52" + } + ] + } + }, + { + "expression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 8927, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 8921, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 8916, + "name": "high", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8894, + "src": "11697:4:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<<", + "rightExpression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + }, + "id": 8919, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "hexValue": "323536", + "id": 8917, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "11706:3:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_256_by_1", + "typeString": "int_const 256" + }, + "value": "256" + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "id": 8918, + "name": "n", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8888, + "src": "11712:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "src": "11706:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + } + ], + "id": 8920, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "11705:9:52", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "src": "11697:17:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 8922, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "11696:19:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "|", + "rightExpression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 8925, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 8923, + "name": "low", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8896, + "src": "11719:3:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">>", + "rightExpression": { + "id": 8924, + "name": "n", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8888, + "src": "11726:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "src": "11719:8:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 8926, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "11718:10:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "11696:32:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 8892, + "id": 8928, + "nodeType": "Return", + "src": "11689:39:52" + } + ] + } + ] + }, + "documentation": { + "id": 8882, + "nodeType": "StructuredDocumentation", + "src": "11298:111:52", + "text": " @dev Calculates floor(x * y >> n) with full precision. Throws if result overflows a uint256." + }, + "id": 8931, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "mulShr", + "nameLocation": "11423:6:52", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 8889, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8884, + "mutability": "mutable", + "name": "x", + "nameLocation": "11438:1:52", + "nodeType": "VariableDeclaration", + "scope": 8931, + "src": "11430:9:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8883, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "11430:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 8886, + "mutability": "mutable", + "name": "y", + "nameLocation": "11449:1:52", + "nodeType": "VariableDeclaration", + "scope": 8931, + "src": "11441:9:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8885, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "11441:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 8888, + "mutability": "mutable", + "name": "n", + "nameLocation": "11458:1:52", + "nodeType": "VariableDeclaration", + "scope": 8931, + "src": "11452:7:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "typeName": { + "id": 8887, + "name": "uint8", + "nodeType": "ElementaryTypeName", + "src": "11452:5:52", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "visibility": "internal" + } + ], + "src": "11429:31:52" + }, + "returnParameters": { + "id": 8892, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8891, + "mutability": "mutable", + "name": "result", + "nameLocation": "11492:6:52", + "nodeType": "VariableDeclaration", + "scope": 8931, + "src": "11484:14:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8890, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "11484:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "11483:16:52" + }, + "scope": 9938, + "src": "11414:331:52", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 8969, + "nodeType": "Block", + "src": "11963:113:52", + "statements": [ + { + "expression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 8967, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "arguments": [ + { + "id": 8947, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8934, + "src": "11987:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 8948, + "name": "y", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8936, + "src": "11990:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 8949, + "name": "n", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8938, + "src": "11993:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + ], + "id": 8946, + "name": "mulShr", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 8931, + 8970 + ], + "referencedDeclaration": 8931, + "src": "11980:6:52", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$_t_uint8_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256,uint8) pure returns (uint256)" + } + }, + "id": 8950, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "11980:15:52", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 8965, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "arguments": [ + { + "id": 8954, + "name": "rounding", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8941, + "src": "12031:8:52", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Rounding_$8329", + "typeString": "enum Math.Rounding" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_Rounding_$8329", + "typeString": "enum Math.Rounding" + } + ], + "id": 8953, + "name": "unsignedRoundsUp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9937, + "src": "12014:16:52", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_enum$_Rounding_$8329_$returns$_t_bool_$", + "typeString": "function (enum Math.Rounding) pure returns (bool)" + } + }, + "id": 8955, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "12014:26:52", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "&&", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 8964, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "arguments": [ + { + "id": 8957, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8934, + "src": "12051:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 8958, + "name": "y", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8936, + "src": "12054:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 8961, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "hexValue": "31", + "id": 8959, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12057:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "nodeType": "BinaryOperation", + "operator": "<<", + "rightExpression": { + "id": 8960, + "name": "n", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8938, + "src": "12062:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "src": "12057:6:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 8956, + "name": "mulmod", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -16, + "src": "12044:6:52", + "typeDescriptions": { + "typeIdentifier": "t_function_mulmod_pure$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256,uint256) pure returns (uint256)" + } + }, + "id": 8962, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "12044:20:52", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "hexValue": "30", + "id": 8963, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12067:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "12044:24:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "12014:54:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "expression": { + "id": 8951, + "name": "SafeCast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11703, + "src": "11998:8:52", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_SafeCast_$11703_$", + "typeString": "type(library SafeCast)" + } + }, + "id": 8952, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "12007:6:52", + "memberName": "toUint", + "nodeType": "MemberAccess", + "referencedDeclaration": 11702, + "src": "11998:15:52", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_bool_$returns$_t_uint256_$", + "typeString": "function (bool) pure returns (uint256)" + } + }, + "id": 8966, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "11998:71:52", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "11980:89:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 8945, + "id": 8968, + "nodeType": "Return", + "src": "11973:96:52" + } + ] + }, + "documentation": { + "id": 8932, + "nodeType": "StructuredDocumentation", + "src": "11751:109:52", + "text": " @dev Calculates x * y >> n with full precision, following the selected rounding direction." + }, + "id": 8970, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "mulShr", + "nameLocation": "11874:6:52", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 8942, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8934, + "mutability": "mutable", + "name": "x", + "nameLocation": "11889:1:52", + "nodeType": "VariableDeclaration", + "scope": 8970, + "src": "11881:9:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8933, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "11881:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 8936, + "mutability": "mutable", + "name": "y", + "nameLocation": "11900:1:52", + "nodeType": "VariableDeclaration", + "scope": 8970, + "src": "11892:9:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8935, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "11892:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 8938, + "mutability": "mutable", + "name": "n", + "nameLocation": "11909:1:52", + "nodeType": "VariableDeclaration", + "scope": 8970, + "src": "11903:7:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "typeName": { + "id": 8937, + "name": "uint8", + "nodeType": "ElementaryTypeName", + "src": "11903:5:52", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 8941, + "mutability": "mutable", + "name": "rounding", + "nameLocation": "11921:8:52", + "nodeType": "VariableDeclaration", + "scope": 8970, + "src": "11912:17:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Rounding_$8329", + "typeString": "enum Math.Rounding" + }, + "typeName": { + "id": 8940, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 8939, + "name": "Rounding", + "nameLocations": [ + "11912:8:52" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 8329, + "src": "11912:8:52" + }, + "referencedDeclaration": 8329, + "src": "11912:8:52", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Rounding_$8329", + "typeString": "enum Math.Rounding" + } + }, + "visibility": "internal" + } + ], + "src": "11880:50:52" + }, + "returnParameters": { + "id": 8945, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8944, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 8970, + "src": "11954:7:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8943, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "11954:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "11953:9:52" + }, + "scope": 9938, + "src": "11865:211:52", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 9066, + "nodeType": "Block", + "src": "12710:1849:52", + "statements": [ + { + "id": 9065, + "nodeType": "UncheckedBlock", + "src": "12720:1833:52", + "statements": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 8982, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 8980, + "name": "n", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8975, + "src": "12748:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "30", + "id": 8981, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12753:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "12748:6:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 8985, + "nodeType": "IfStatement", + "src": "12744:20:52", + "trueBody": { + "expression": { + "hexValue": "30", + "id": 8983, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12763:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "functionReturnParameters": 8979, + "id": 8984, + "nodeType": "Return", + "src": "12756:8:52" + } + }, + { + "assignments": [ + 8987 + ], + "declarations": [ + { + "constant": false, + "id": 8987, + "mutability": "mutable", + "name": "remainder", + "nameLocation": "13243:9:52", + "nodeType": "VariableDeclaration", + "scope": 9065, + "src": "13235:17:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8986, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "13235:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 8991, + "initialValue": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 8990, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 8988, + "name": "a", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8973, + "src": "13255:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "%", + "rightExpression": { + "id": 8989, + "name": "n", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8975, + "src": "13259:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "13255:5:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "13235:25:52" + }, + { + "assignments": [ + 8993 + ], + "declarations": [ + { + "constant": false, + "id": 8993, + "mutability": "mutable", + "name": "gcd", + "nameLocation": "13282:3:52", + "nodeType": "VariableDeclaration", + "scope": 9065, + "src": "13274:11:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8992, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "13274:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 8995, + "initialValue": { + "id": 8994, + "name": "n", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8975, + "src": "13288:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "13274:15:52" + }, + { + "assignments": [ + 8997 + ], + "declarations": [ + { + "constant": false, + "id": 8997, + "mutability": "mutable", + "name": "x", + "nameLocation": "13432:1:52", + "nodeType": "VariableDeclaration", + "scope": 9065, + "src": "13425:8:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "typeName": { + "id": 8996, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "13425:6:52", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "visibility": "internal" + } + ], + "id": 8999, + "initialValue": { + "hexValue": "30", + "id": 8998, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13436:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "nodeType": "VariableDeclarationStatement", + "src": "13425:12:52" + }, + { + "assignments": [ + 9001 + ], + "declarations": [ + { + "constant": false, + "id": 9001, + "mutability": "mutable", + "name": "y", + "nameLocation": "13458:1:52", + "nodeType": "VariableDeclaration", + "scope": 9065, + "src": "13451:8:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "typeName": { + "id": 9000, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "13451:6:52", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "visibility": "internal" + } + ], + "id": 9003, + "initialValue": { + "hexValue": "31", + "id": 9002, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13462:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "nodeType": "VariableDeclarationStatement", + "src": "13451:12:52" + }, + { + "body": { + "id": 9040, + "nodeType": "Block", + "src": "13501:882:52", + "statements": [ + { + "assignments": [ + 9008 + ], + "declarations": [ + { + "constant": false, + "id": 9008, + "mutability": "mutable", + "name": "quotient", + "nameLocation": "13527:8:52", + "nodeType": "VariableDeclaration", + "scope": 9040, + "src": "13519:16:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 9007, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "13519:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 9012, + "initialValue": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9011, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 9009, + "name": "gcd", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8993, + "src": "13538:3:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "/", + "rightExpression": { + "id": 9010, + "name": "remainder", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8987, + "src": "13544:9:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "13538:15:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "13519:34:52" + }, + { + "expression": { + "id": 9023, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "components": [ + { + "id": 9013, + "name": "gcd", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8993, + "src": "13573:3:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 9014, + "name": "remainder", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8987, + "src": "13578:9:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 9015, + "isConstant": false, + "isInlineArray": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "TupleExpression", + "src": "13572:16:52", + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$", + "typeString": "tuple(uint256,uint256)" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "components": [ + { + "id": 9016, + "name": "remainder", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8987, + "src": "13678:9:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9021, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 9017, + "name": "gcd", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8993, + "src": "13923:3:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9020, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 9018, + "name": "remainder", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8987, + "src": "13929:9:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "*", + "rightExpression": { + "id": 9019, + "name": "quotient", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9008, + "src": "13941:8:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "13929:20:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "13923:26:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 9022, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "13591:376:52", + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$", + "typeString": "tuple(uint256,uint256)" + } + }, + "src": "13572:395:52", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 9024, + "nodeType": "ExpressionStatement", + "src": "13572:395:52" + }, + { + "expression": { + "id": 9038, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "components": [ + { + "id": 9025, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8997, + "src": "13987:1:52", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + { + "id": 9026, + "name": "y", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9001, + "src": "13990:1:52", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "id": 9027, + "isConstant": false, + "isInlineArray": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "TupleExpression", + "src": "13986:6:52", + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_int256_$_t_int256_$", + "typeString": "tuple(int256,int256)" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "components": [ + { + "id": 9028, + "name": "y", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9001, + "src": "14072:1:52", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 9036, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 9029, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8997, + "src": "14326:1:52", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 9035, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 9030, + "name": "y", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9001, + "src": "14330:1:52", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": "*", + "rightExpression": { + "arguments": [ + { + "id": 9033, + "name": "quotient", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9008, + "src": "14341:8:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 9032, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "14334:6:52", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_int256_$", + "typeString": "type(int256)" + }, + "typeName": { + "id": 9031, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "14334:6:52", + "typeDescriptions": {} + } + }, + "id": 9034, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "14334:16:52", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "src": "14330:20:52", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "src": "14326:24:52", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "id": 9037, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "13995:373:52", + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_int256_$_t_int256_$", + "typeString": "tuple(int256,int256)" + } + }, + "src": "13986:382:52", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 9039, + "nodeType": "ExpressionStatement", + "src": "13986:382:52" + } + ] + }, + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9006, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 9004, + "name": "remainder", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8987, + "src": "13485:9:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "hexValue": "30", + "id": 9005, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13498:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "13485:14:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 9041, + "nodeType": "WhileStatement", + "src": "13478:905:52" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9044, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 9042, + "name": "gcd", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8993, + "src": "14401:3:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "hexValue": "31", + "id": 9043, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "14408:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "14401:8:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 9047, + "nodeType": "IfStatement", + "src": "14397:22:52", + "trueBody": { + "expression": { + "hexValue": "30", + "id": 9045, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "14418:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "functionReturnParameters": 8979, + "id": 9046, + "nodeType": "Return", + "src": "14411:8:52" + } + }, + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 9051, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 9049, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8997, + "src": "14470:1:52", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "hexValue": "30", + "id": 9050, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "14474:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "14470:5:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9058, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 9052, + "name": "n", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8975, + "src": "14477:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "arguments": [ + { + "id": 9056, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "-", + "prefix": true, + "src": "14489:2:52", + "subExpression": { + "id": 9055, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8997, + "src": "14490:1:52", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + ], + "id": 9054, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "14481:7:52", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + }, + "typeName": { + "id": 9053, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "14481:7:52", + "typeDescriptions": {} + } + }, + "id": 9057, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "14481:11:52", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "14477:15:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "arguments": [ + { + "id": 9061, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8997, + "src": "14502:1:52", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + ], + "id": 9060, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "14494:7:52", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + }, + "typeName": { + "id": 9059, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "14494:7:52", + "typeDescriptions": {} + } + }, + "id": 9062, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "14494:10:52", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 9048, + "name": "ternary", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8606, + "src": "14462:7:52", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_bool_$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (bool,uint256,uint256) pure returns (uint256)" + } + }, + "id": 9063, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "14462:43:52", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 8979, + "id": 9064, + "nodeType": "Return", + "src": "14455:50:52" + } + ] + } + ] + }, + "documentation": { + "id": 8971, + "nodeType": "StructuredDocumentation", + "src": "12082:553:52", + "text": " @dev Calculate the modular multiplicative inverse of a number in Z/nZ.\n If n is a prime, then Z/nZ is a field. In that case all elements are inversible, except 0.\n If n is not a prime, then Z/nZ is not a field, and some elements might not be inversible.\n If the input value is not inversible, 0 is returned.\n NOTE: If you know for sure that n is (big) a prime, it may be cheaper to use Fermat's little theorem and get the\n inverse using `Math.modExp(a, n - 2, n)`. See {invModPrime}." + }, + "id": 9067, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "invMod", + "nameLocation": "12649:6:52", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 8976, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8973, + "mutability": "mutable", + "name": "a", + "nameLocation": "12664:1:52", + "nodeType": "VariableDeclaration", + "scope": 9067, + "src": "12656:9:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8972, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "12656:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 8975, + "mutability": "mutable", + "name": "n", + "nameLocation": "12675:1:52", + "nodeType": "VariableDeclaration", + "scope": 9067, + "src": "12667:9:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8974, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "12667:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "12655:22:52" + }, + "returnParameters": { + "id": 8979, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 8978, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 9067, + "src": "12701:7:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8977, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "12701:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "12700:9:52" + }, + "scope": 9938, + "src": "12640:1919:52", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 9087, + "nodeType": "Block", + "src": "15159:82:52", + "statements": [ + { + "id": 9086, + "nodeType": "UncheckedBlock", + "src": "15169:66:52", + "statements": [ + { + "expression": { + "arguments": [ + { + "id": 9079, + "name": "a", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9070, + "src": "15212:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9082, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 9080, + "name": "p", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9072, + "src": "15215:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "hexValue": "32", + "id": 9081, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "15219:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_2_by_1", + "typeString": "int_const 2" + }, + "value": "2" + }, + "src": "15215:5:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 9083, + "name": "p", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9072, + "src": "15222:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "id": 9077, + "name": "Math", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9938, + "src": "15200:4:52", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_Math_$9938_$", + "typeString": "type(library Math)" + } + }, + "id": 9078, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "15205:6:52", + "memberName": "modExp", + "nodeType": "MemberAccess", + "referencedDeclaration": 9124, + "src": "15200:11:52", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256,uint256) view returns (uint256)" + } + }, + "id": 9084, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "15200:24:52", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 9076, + "id": 9085, + "nodeType": "Return", + "src": "15193:31:52" + } + ] + } + ] + }, + "documentation": { + "id": 9068, + "nodeType": "StructuredDocumentation", + "src": "14565:514:52", + "text": " @dev Variant of {invMod}. More efficient, but only works if `p` is known to be a prime greater than `2`.\n From https://en.wikipedia.org/wiki/Fermat%27s_little_theorem[Fermat's little theorem], we know that if p is\n prime, then `a**(p-1) ≡ 1 mod p`. As a consequence, we have `a * a**(p-2) ≡ 1 mod p`, which means that\n `a**(p-2)` is the modular multiplicative inverse of a in Fp.\n NOTE: this function does NOT check that `p` is a prime greater than `2`." + }, + "id": 9088, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "invModPrime", + "nameLocation": "15093:11:52", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 9073, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 9070, + "mutability": "mutable", + "name": "a", + "nameLocation": "15113:1:52", + "nodeType": "VariableDeclaration", + "scope": 9088, + "src": "15105:9:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 9069, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "15105:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 9072, + "mutability": "mutable", + "name": "p", + "nameLocation": "15124:1:52", + "nodeType": "VariableDeclaration", + "scope": 9088, + "src": "15116:9:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 9071, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "15116:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "15104:22:52" + }, + "returnParameters": { + "id": 9076, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 9075, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 9088, + "src": "15150:7:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 9074, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "15150:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "15149:9:52" + }, + "scope": 9938, + "src": "15084:157:52", + "stateMutability": "view", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 9123, + "nodeType": "Block", + "src": "16011:174:52", + "statements": [ + { + "assignments": [ + 9101, + 9103 + ], + "declarations": [ + { + "constant": false, + "id": 9101, + "mutability": "mutable", + "name": "success", + "nameLocation": "16027:7:52", + "nodeType": "VariableDeclaration", + "scope": 9123, + "src": "16022:12:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 9100, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "16022:4:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 9103, + "mutability": "mutable", + "name": "result", + "nameLocation": "16044:6:52", + "nodeType": "VariableDeclaration", + "scope": 9123, + "src": "16036:14:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 9102, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "16036:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 9109, + "initialValue": { + "arguments": [ + { + "id": 9105, + "name": "b", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9091, + "src": "16064:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 9106, + "name": "e", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9093, + "src": "16067:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 9107, + "name": "m", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9095, + "src": "16070:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 9104, + "name": "tryModExp", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 9148, + 9230 + ], + "referencedDeclaration": 9148, + "src": "16054:9:52", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_bool_$_t_uint256_$", + "typeString": "function (uint256,uint256,uint256) view returns (bool,uint256)" + } + }, + "id": 9108, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "16054:18:52", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_bool_$_t_uint256_$", + "typeString": "tuple(bool,uint256)" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "16021:51:52" + }, + { + "condition": { + "id": 9111, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "16086:8:52", + "subExpression": { + "id": 9110, + "name": "success", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9101, + "src": "16087:7:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 9120, + "nodeType": "IfStatement", + "src": "16082:74:52", + "trueBody": { + "id": 9119, + "nodeType": "Block", + "src": "16096:60:52", + "statements": [ + { + "expression": { + "arguments": [ + { + "expression": { + "id": 9115, + "name": "Panic", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6481, + "src": "16122:5:52", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_Panic_$6481_$", + "typeString": "type(library Panic)" + } + }, + "id": 9116, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "16128:16:52", + "memberName": "DIVISION_BY_ZERO", + "nodeType": "MemberAccess", + "referencedDeclaration": 6448, + "src": "16122:22:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "id": 9112, + "name": "Panic", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6481, + "src": "16110:5:52", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_Panic_$6481_$", + "typeString": "type(library Panic)" + } + }, + "id": 9114, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "16116:5:52", + "memberName": "panic", + "nodeType": "MemberAccess", + "referencedDeclaration": 6480, + "src": "16110:11:52", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$returns$__$", + "typeString": "function (uint256) pure" + } + }, + "id": 9117, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "16110:35:52", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 9118, + "nodeType": "ExpressionStatement", + "src": "16110:35:52" + } + ] + } + }, + { + "expression": { + "id": 9121, + "name": "result", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9103, + "src": "16172:6:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 9099, + "id": 9122, + "nodeType": "Return", + "src": "16165:13:52" + } + ] + }, + "documentation": { + "id": 9089, + "nodeType": "StructuredDocumentation", + "src": "15247:678:52", + "text": " @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m)\n Requirements:\n - modulus can't be zero\n - underlying staticcall to precompile must succeed\n IMPORTANT: The result is only valid if the underlying call succeeds. When using this function, make\n sure the chain you're using it on supports the precompiled contract for modular exponentiation\n at address 0x05 as specified in https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise,\n the underlying function will succeed given the lack of a revert, but the result may be incorrectly\n interpreted as 0." + }, + "id": 9124, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "modExp", + "nameLocation": "15939:6:52", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 9096, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 9091, + "mutability": "mutable", + "name": "b", + "nameLocation": "15954:1:52", + "nodeType": "VariableDeclaration", + "scope": 9124, + "src": "15946:9:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 9090, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "15946:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 9093, + "mutability": "mutable", + "name": "e", + "nameLocation": "15965:1:52", + "nodeType": "VariableDeclaration", + "scope": 9124, + "src": "15957:9:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 9092, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "15957:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 9095, + "mutability": "mutable", + "name": "m", + "nameLocation": "15976:1:52", + "nodeType": "VariableDeclaration", + "scope": 9124, + "src": "15968:9:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 9094, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "15968:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "15945:33:52" + }, + "returnParameters": { + "id": 9099, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 9098, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 9124, + "src": "16002:7:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 9097, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "16002:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "16001:9:52" + }, + "scope": 9938, + "src": "15930:255:52", + "stateMutability": "view", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 9147, + "nodeType": "Block", + "src": "17039:1493:52", + "statements": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9140, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 9138, + "name": "m", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9131, + "src": "17053:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "30", + "id": 9139, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "17058:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "17053:6:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 9145, + "nodeType": "IfStatement", + "src": "17049:29:52", + "trueBody": { + "expression": { + "components": [ + { + "hexValue": "66616c7365", + "id": 9141, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "17069:5:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + }, + { + "hexValue": "30", + "id": 9142, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "17076:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "id": 9143, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "17068:10:52", + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_bool_$_t_rational_0_by_1_$", + "typeString": "tuple(bool,int_const 0)" + } + }, + "functionReturnParameters": 9137, + "id": 9144, + "nodeType": "Return", + "src": "17061:17:52" + } + }, + { + "AST": { + "nativeSrc": "17113:1413:52", + "nodeType": "YulBlock", + "src": "17113:1413:52", + "statements": [ + { + "nativeSrc": "17127:22:52", + "nodeType": "YulVariableDeclaration", + "src": "17127:22:52", + "value": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "17144:4:52", + "nodeType": "YulLiteral", + "src": "17144:4:52", + "type": "", + "value": "0x40" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "17138:5:52", + "nodeType": "YulIdentifier", + "src": "17138:5:52" + }, + "nativeSrc": "17138:11:52", + "nodeType": "YulFunctionCall", + "src": "17138:11:52" + }, + "variables": [ + { + "name": "ptr", + "nativeSrc": "17131:3:52", + "nodeType": "YulTypedName", + "src": "17131:3:52", + "type": "" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "ptr", + "nativeSrc": "18057:3:52", + "nodeType": "YulIdentifier", + "src": "18057:3:52" + }, + { + "kind": "number", + "nativeSrc": "18062:4:52", + "nodeType": "YulLiteral", + "src": "18062:4:52", + "type": "", + "value": "0x20" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "18050:6:52", + "nodeType": "YulIdentifier", + "src": "18050:6:52" + }, + "nativeSrc": "18050:17:52", + "nodeType": "YulFunctionCall", + "src": "18050:17:52" + }, + "nativeSrc": "18050:17:52", + "nodeType": "YulExpressionStatement", + "src": "18050:17:52" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "ptr", + "nativeSrc": "18091:3:52", + "nodeType": "YulIdentifier", + "src": "18091:3:52" + }, + { + "kind": "number", + "nativeSrc": "18096:4:52", + "nodeType": "YulLiteral", + "src": "18096:4:52", + "type": "", + "value": "0x20" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "18087:3:52", + "nodeType": "YulIdentifier", + "src": "18087:3:52" + }, + "nativeSrc": "18087:14:52", + "nodeType": "YulFunctionCall", + "src": "18087:14:52" + }, + { + "kind": "number", + "nativeSrc": "18103:4:52", + "nodeType": "YulLiteral", + "src": "18103:4:52", + "type": "", + "value": "0x20" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "18080:6:52", + "nodeType": "YulIdentifier", + "src": "18080:6:52" + }, + "nativeSrc": "18080:28:52", + "nodeType": "YulFunctionCall", + "src": "18080:28:52" + }, + "nativeSrc": "18080:28:52", + "nodeType": "YulExpressionStatement", + "src": "18080:28:52" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "ptr", + "nativeSrc": "18132:3:52", + "nodeType": "YulIdentifier", + "src": "18132:3:52" + }, + { + "kind": "number", + "nativeSrc": "18137:4:52", + "nodeType": "YulLiteral", + "src": "18137:4:52", + "type": "", + "value": "0x40" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "18128:3:52", + "nodeType": "YulIdentifier", + "src": "18128:3:52" + }, + "nativeSrc": "18128:14:52", + "nodeType": "YulFunctionCall", + "src": "18128:14:52" + }, + { + "kind": "number", + "nativeSrc": "18144:4:52", + "nodeType": "YulLiteral", + "src": "18144:4:52", + "type": "", + "value": "0x20" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "18121:6:52", + "nodeType": "YulIdentifier", + "src": "18121:6:52" + }, + "nativeSrc": "18121:28:52", + "nodeType": "YulFunctionCall", + "src": "18121:28:52" + }, + "nativeSrc": "18121:28:52", + "nodeType": "YulExpressionStatement", + "src": "18121:28:52" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "ptr", + "nativeSrc": "18173:3:52", + "nodeType": "YulIdentifier", + "src": "18173:3:52" + }, + { + "kind": "number", + "nativeSrc": "18178:4:52", + "nodeType": "YulLiteral", + "src": "18178:4:52", + "type": "", + "value": "0x60" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "18169:3:52", + "nodeType": "YulIdentifier", + "src": "18169:3:52" + }, + "nativeSrc": "18169:14:52", + "nodeType": "YulFunctionCall", + "src": "18169:14:52" + }, + { + "name": "b", + "nativeSrc": "18185:1:52", + "nodeType": "YulIdentifier", + "src": "18185:1:52" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "18162:6:52", + "nodeType": "YulIdentifier", + "src": "18162:6:52" + }, + "nativeSrc": "18162:25:52", + "nodeType": "YulFunctionCall", + "src": "18162:25:52" + }, + "nativeSrc": "18162:25:52", + "nodeType": "YulExpressionStatement", + "src": "18162:25:52" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "ptr", + "nativeSrc": "18211:3:52", + "nodeType": "YulIdentifier", + "src": "18211:3:52" + }, + { + "kind": "number", + "nativeSrc": "18216:4:52", + "nodeType": "YulLiteral", + "src": "18216:4:52", + "type": "", + "value": "0x80" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "18207:3:52", + "nodeType": "YulIdentifier", + "src": "18207:3:52" + }, + "nativeSrc": "18207:14:52", + "nodeType": "YulFunctionCall", + "src": "18207:14:52" + }, + { + "name": "e", + "nativeSrc": "18223:1:52", + "nodeType": "YulIdentifier", + "src": "18223:1:52" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "18200:6:52", + "nodeType": "YulIdentifier", + "src": "18200:6:52" + }, + "nativeSrc": "18200:25:52", + "nodeType": "YulFunctionCall", + "src": "18200:25:52" + }, + "nativeSrc": "18200:25:52", + "nodeType": "YulExpressionStatement", + "src": "18200:25:52" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "ptr", + "nativeSrc": "18249:3:52", + "nodeType": "YulIdentifier", + "src": "18249:3:52" + }, + { + "kind": "number", + "nativeSrc": "18254:4:52", + "nodeType": "YulLiteral", + "src": "18254:4:52", + "type": "", + "value": "0xa0" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "18245:3:52", + "nodeType": "YulIdentifier", + "src": "18245:3:52" + }, + "nativeSrc": "18245:14:52", + "nodeType": "YulFunctionCall", + "src": "18245:14:52" + }, + { + "name": "m", + "nativeSrc": "18261:1:52", + "nodeType": "YulIdentifier", + "src": "18261:1:52" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "18238:6:52", + "nodeType": "YulIdentifier", + "src": "18238:6:52" + }, + "nativeSrc": "18238:25:52", + "nodeType": "YulFunctionCall", + "src": "18238:25:52" + }, + "nativeSrc": "18238:25:52", + "nodeType": "YulExpressionStatement", + "src": "18238:25:52" + }, + { + "nativeSrc": "18425:57:52", + "nodeType": "YulAssignment", + "src": "18425:57:52", + "value": { + "arguments": [ + { + "arguments": [], + "functionName": { + "name": "gas", + "nativeSrc": "18447:3:52", + "nodeType": "YulIdentifier", + "src": "18447:3:52" + }, + "nativeSrc": "18447:5:52", + "nodeType": "YulFunctionCall", + "src": "18447:5:52" + }, + { + "kind": "number", + "nativeSrc": "18454:4:52", + "nodeType": "YulLiteral", + "src": "18454:4:52", + "type": "", + "value": "0x05" + }, + { + "name": "ptr", + "nativeSrc": "18460:3:52", + "nodeType": "YulIdentifier", + "src": "18460:3:52" + }, + { + "kind": "number", + "nativeSrc": "18465:4:52", + "nodeType": "YulLiteral", + "src": "18465:4:52", + "type": "", + "value": "0xc0" + }, + { + "kind": "number", + "nativeSrc": "18471:4:52", + "nodeType": "YulLiteral", + "src": "18471:4:52", + "type": "", + "value": "0x00" + }, + { + "kind": "number", + "nativeSrc": "18477:4:52", + "nodeType": "YulLiteral", + "src": "18477:4:52", + "type": "", + "value": "0x20" + } + ], + "functionName": { + "name": "staticcall", + "nativeSrc": "18436:10:52", + "nodeType": "YulIdentifier", + "src": "18436:10:52" + }, + "nativeSrc": "18436:46:52", + "nodeType": "YulFunctionCall", + "src": "18436:46:52" + }, + "variableNames": [ + { + "name": "success", + "nativeSrc": "18425:7:52", + "nodeType": "YulIdentifier", + "src": "18425:7:52" + } + ] + }, + { + "nativeSrc": "18495:21:52", + "nodeType": "YulAssignment", + "src": "18495:21:52", + "value": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "18511:4:52", + "nodeType": "YulLiteral", + "src": "18511:4:52", + "type": "", + "value": "0x00" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "18505:5:52", + "nodeType": "YulIdentifier", + "src": "18505:5:52" + }, + "nativeSrc": "18505:11:52", + "nodeType": "YulFunctionCall", + "src": "18505:11:52" + }, + "variableNames": [ + { + "name": "result", + "nativeSrc": "18495:6:52", + "nodeType": "YulIdentifier", + "src": "18495:6:52" + } + ] + } + ] + }, + "evmVersion": "paris", + "externalReferences": [ + { + "declaration": 9127, + "isOffset": false, + "isSlot": false, + "src": "18185:1:52", + "valueSize": 1 + }, + { + "declaration": 9129, + "isOffset": false, + "isSlot": false, + "src": "18223:1:52", + "valueSize": 1 + }, + { + "declaration": 9131, + "isOffset": false, + "isSlot": false, + "src": "18261:1:52", + "valueSize": 1 + }, + { + "declaration": 9136, + "isOffset": false, + "isSlot": false, + "src": "18495:6:52", + "valueSize": 1 + }, + { + "declaration": 9134, + "isOffset": false, + "isSlot": false, + "src": "18425:7:52", + "valueSize": 1 + } + ], + "flags": [ + "memory-safe" + ], + "id": 9146, + "nodeType": "InlineAssembly", + "src": "17088:1438:52" + } + ] + }, + "documentation": { + "id": 9125, + "nodeType": "StructuredDocumentation", + "src": "16191:738:52", + "text": " @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m).\n It includes a success flag indicating if the operation succeeded. Operation will be marked as failed if trying\n to operate modulo 0 or if the underlying precompile reverted.\n IMPORTANT: The result is only valid if the success flag is true. When using this function, make sure the chain\n you're using it on supports the precompiled contract for modular exponentiation at address 0x05 as specified in\n https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, the underlying function will succeed given the lack\n of a revert, but the result may be incorrectly interpreted as 0." + }, + "id": 9148, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "tryModExp", + "nameLocation": "16943:9:52", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 9132, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 9127, + "mutability": "mutable", + "name": "b", + "nameLocation": "16961:1:52", + "nodeType": "VariableDeclaration", + "scope": 9148, + "src": "16953:9:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 9126, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "16953:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 9129, + "mutability": "mutable", + "name": "e", + "nameLocation": "16972:1:52", + "nodeType": "VariableDeclaration", + "scope": 9148, + "src": "16964:9:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 9128, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "16964:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 9131, + "mutability": "mutable", + "name": "m", + "nameLocation": "16983:1:52", + "nodeType": "VariableDeclaration", + "scope": 9148, + "src": "16975:9:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 9130, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "16975:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "16952:33:52" + }, + "returnParameters": { + "id": 9137, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 9134, + "mutability": "mutable", + "name": "success", + "nameLocation": "17014:7:52", + "nodeType": "VariableDeclaration", + "scope": 9148, + "src": "17009:12:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 9133, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "17009:4:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 9136, + "mutability": "mutable", + "name": "result", + "nameLocation": "17031:6:52", + "nodeType": "VariableDeclaration", + "scope": 9148, + "src": "17023:14:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 9135, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "17023:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "17008:30:52" + }, + "scope": 9938, + "src": "16934:1598:52", + "stateMutability": "view", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 9183, + "nodeType": "Block", + "src": "18729:179:52", + "statements": [ + { + "assignments": [ + 9161, + 9163 + ], + "declarations": [ + { + "constant": false, + "id": 9161, + "mutability": "mutable", + "name": "success", + "nameLocation": "18745:7:52", + "nodeType": "VariableDeclaration", + "scope": 9183, + "src": "18740:12:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 9160, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "18740:4:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 9163, + "mutability": "mutable", + "name": "result", + "nameLocation": "18767:6:52", + "nodeType": "VariableDeclaration", + "scope": 9183, + "src": "18754:19:52", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 9162, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "18754:5:52", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "id": 9169, + "initialValue": { + "arguments": [ + { + "id": 9165, + "name": "b", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9151, + "src": "18787:1:52", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + { + "id": 9166, + "name": "e", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9153, + "src": "18790:1:52", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + { + "id": 9167, + "name": "m", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9155, + "src": "18793:1:52", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + }, + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + }, + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 9164, + "name": "tryModExp", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 9148, + 9230 + ], + "referencedDeclaration": 9230, + "src": "18777:9:52", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_bytes_memory_ptr_$_t_bytes_memory_ptr_$_t_bytes_memory_ptr_$returns$_t_bool_$_t_bytes_memory_ptr_$", + "typeString": "function (bytes memory,bytes memory,bytes memory) view returns (bool,bytes memory)" + } + }, + "id": 9168, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "18777:18:52", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_bool_$_t_bytes_memory_ptr_$", + "typeString": "tuple(bool,bytes memory)" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "18739:56:52" + }, + { + "condition": { + "id": 9171, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "18809:8:52", + "subExpression": { + "id": 9170, + "name": "success", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9161, + "src": "18810:7:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 9180, + "nodeType": "IfStatement", + "src": "18805:74:52", + "trueBody": { + "id": 9179, + "nodeType": "Block", + "src": "18819:60:52", + "statements": [ + { + "expression": { + "arguments": [ + { + "expression": { + "id": 9175, + "name": "Panic", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6481, + "src": "18845:5:52", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_Panic_$6481_$", + "typeString": "type(library Panic)" + } + }, + "id": 9176, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "18851:16:52", + "memberName": "DIVISION_BY_ZERO", + "nodeType": "MemberAccess", + "referencedDeclaration": 6448, + "src": "18845:22:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "id": 9172, + "name": "Panic", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6481, + "src": "18833:5:52", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_Panic_$6481_$", + "typeString": "type(library Panic)" + } + }, + "id": 9174, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "18839:5:52", + "memberName": "panic", + "nodeType": "MemberAccess", + "referencedDeclaration": 6480, + "src": "18833:11:52", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$returns$__$", + "typeString": "function (uint256) pure" + } + }, + "id": 9177, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "18833:35:52", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 9178, + "nodeType": "ExpressionStatement", + "src": "18833:35:52" + } + ] + } + }, + { + "expression": { + "id": 9181, + "name": "result", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9163, + "src": "18895:6:52", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "functionReturnParameters": 9159, + "id": 9182, + "nodeType": "Return", + "src": "18888:13:52" + } + ] + }, + "documentation": { + "id": 9149, + "nodeType": "StructuredDocumentation", + "src": "18538:85:52", + "text": " @dev Variant of {modExp} that supports inputs of arbitrary length." + }, + "id": 9184, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "modExp", + "nameLocation": "18637:6:52", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 9156, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 9151, + "mutability": "mutable", + "name": "b", + "nameLocation": "18657:1:52", + "nodeType": "VariableDeclaration", + "scope": 9184, + "src": "18644:14:52", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 9150, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "18644:5:52", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 9153, + "mutability": "mutable", + "name": "e", + "nameLocation": "18673:1:52", + "nodeType": "VariableDeclaration", + "scope": 9184, + "src": "18660:14:52", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 9152, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "18660:5:52", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 9155, + "mutability": "mutable", + "name": "m", + "nameLocation": "18689:1:52", + "nodeType": "VariableDeclaration", + "scope": 9184, + "src": "18676:14:52", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 9154, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "18676:5:52", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "src": "18643:48:52" + }, + "returnParameters": { + "id": 9159, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 9158, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 9184, + "src": "18715:12:52", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 9157, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "18715:5:52", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "src": "18714:14:52" + }, + "scope": 9938, + "src": "18628:280:52", + "stateMutability": "view", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 9229, + "nodeType": "Block", + "src": "19162:771:52", + "statements": [ + { + "condition": { + "arguments": [ + { + "id": 9199, + "name": "m", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9191, + "src": "19187:1:52", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 9198, + "name": "_zeroBytes", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9263, + "src": "19176:10:52", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$returns$_t_bool_$", + "typeString": "function (bytes memory) pure returns (bool)" + } + }, + "id": 9200, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "19176:13:52", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 9208, + "nodeType": "IfStatement", + "src": "19172:47:52", + "trueBody": { + "expression": { + "components": [ + { + "hexValue": "66616c7365", + "id": 9201, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "19199:5:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + }, + { + "arguments": [ + { + "hexValue": "30", + "id": 9204, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "19216:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 9203, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "NewExpression", + "src": "19206:9:52", + "typeDescriptions": { + "typeIdentifier": "t_function_objectcreation_pure$_t_uint256_$returns$_t_bytes_memory_ptr_$", + "typeString": "function (uint256) pure returns (bytes memory)" + }, + "typeName": { + "id": 9202, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "19210:5:52", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + } + }, + "id": 9205, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "19206:12:52", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "id": 9206, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "19198:21:52", + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_bool_$_t_bytes_memory_ptr_$", + "typeString": "tuple(bool,bytes memory)" + } + }, + "functionReturnParameters": 9197, + "id": 9207, + "nodeType": "Return", + "src": "19191:28:52" + } + }, + { + "assignments": [ + 9210 + ], + "declarations": [ + { + "constant": false, + "id": 9210, + "mutability": "mutable", + "name": "mLen", + "nameLocation": "19238:4:52", + "nodeType": "VariableDeclaration", + "scope": 9229, + "src": "19230:12:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 9209, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "19230:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 9213, + "initialValue": { + "expression": { + "id": 9211, + "name": "m", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9191, + "src": "19245:1:52", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 9212, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "19247:6:52", + "memberName": "length", + "nodeType": "MemberAccess", + "src": "19245:8:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "19230:23:52" + }, + { + "expression": { + "id": 9226, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 9214, + "name": "result", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9196, + "src": "19335:6:52", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "expression": { + "id": 9217, + "name": "b", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9187, + "src": "19361:1:52", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 9218, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "19363:6:52", + "memberName": "length", + "nodeType": "MemberAccess", + "src": "19361:8:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "expression": { + "id": 9219, + "name": "e", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9189, + "src": "19371:1:52", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 9220, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "19373:6:52", + "memberName": "length", + "nodeType": "MemberAccess", + "src": "19371:8:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 9221, + "name": "mLen", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9210, + "src": "19381:4:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 9222, + "name": "b", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9187, + "src": "19387:1:52", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + { + "id": 9223, + "name": "e", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9189, + "src": "19390:1:52", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + { + "id": 9224, + "name": "m", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9191, + "src": "19393:1:52", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + }, + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + }, + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "expression": { + "id": 9215, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -1, + "src": "19344:3:52", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 9216, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "19348:12:52", + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "src": "19344:16:52", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 9225, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "19344:51:52", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "src": "19335:60:52", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 9227, + "nodeType": "ExpressionStatement", + "src": "19335:60:52" + }, + { + "AST": { + "nativeSrc": "19431:496:52", + "nodeType": "YulBlock", + "src": "19431:496:52", + "statements": [ + { + "nativeSrc": "19445:32:52", + "nodeType": "YulVariableDeclaration", + "src": "19445:32:52", + "value": { + "arguments": [ + { + "name": "result", + "nativeSrc": "19464:6:52", + "nodeType": "YulIdentifier", + "src": "19464:6:52" + }, + { + "kind": "number", + "nativeSrc": "19472:4:52", + "nodeType": "YulLiteral", + "src": "19472:4:52", + "type": "", + "value": "0x20" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "19460:3:52", + "nodeType": "YulIdentifier", + "src": "19460:3:52" + }, + "nativeSrc": "19460:17:52", + "nodeType": "YulFunctionCall", + "src": "19460:17:52" + }, + "variables": [ + { + "name": "dataPtr", + "nativeSrc": "19449:7:52", + "nodeType": "YulTypedName", + "src": "19449:7:52", + "type": "" + } + ] + }, + { + "nativeSrc": "19567:73:52", + "nodeType": "YulAssignment", + "src": "19567:73:52", + "value": { + "arguments": [ + { + "arguments": [], + "functionName": { + "name": "gas", + "nativeSrc": "19589:3:52", + "nodeType": "YulIdentifier", + "src": "19589:3:52" + }, + "nativeSrc": "19589:5:52", + "nodeType": "YulFunctionCall", + "src": "19589:5:52" + }, + { + "kind": "number", + "nativeSrc": "19596:4:52", + "nodeType": "YulLiteral", + "src": "19596:4:52", + "type": "", + "value": "0x05" + }, + { + "name": "dataPtr", + "nativeSrc": "19602:7:52", + "nodeType": "YulIdentifier", + "src": "19602:7:52" + }, + { + "arguments": [ + { + "name": "result", + "nativeSrc": "19617:6:52", + "nodeType": "YulIdentifier", + "src": "19617:6:52" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "19611:5:52", + "nodeType": "YulIdentifier", + "src": "19611:5:52" + }, + "nativeSrc": "19611:13:52", + "nodeType": "YulFunctionCall", + "src": "19611:13:52" + }, + { + "name": "dataPtr", + "nativeSrc": "19626:7:52", + "nodeType": "YulIdentifier", + "src": "19626:7:52" + }, + { + "name": "mLen", + "nativeSrc": "19635:4:52", + "nodeType": "YulIdentifier", + "src": "19635:4:52" + } + ], + "functionName": { + "name": "staticcall", + "nativeSrc": "19578:10:52", + "nodeType": "YulIdentifier", + "src": "19578:10:52" + }, + "nativeSrc": "19578:62:52", + "nodeType": "YulFunctionCall", + "src": "19578:62:52" + }, + "variableNames": [ + { + "name": "success", + "nativeSrc": "19567:7:52", + "nodeType": "YulIdentifier", + "src": "19567:7:52" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "result", + "nativeSrc": "19796:6:52", + "nodeType": "YulIdentifier", + "src": "19796:6:52" + }, + { + "name": "mLen", + "nativeSrc": "19804:4:52", + "nodeType": "YulIdentifier", + "src": "19804:4:52" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "19789:6:52", + "nodeType": "YulIdentifier", + "src": "19789:6:52" + }, + "nativeSrc": "19789:20:52", + "nodeType": "YulFunctionCall", + "src": "19789:20:52" + }, + "nativeSrc": "19789:20:52", + "nodeType": "YulExpressionStatement", + "src": "19789:20:52" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "19892:4:52", + "nodeType": "YulLiteral", + "src": "19892:4:52", + "type": "", + "value": "0x40" + }, + { + "arguments": [ + { + "name": "dataPtr", + "nativeSrc": "19902:7:52", + "nodeType": "YulIdentifier", + "src": "19902:7:52" + }, + { + "name": "mLen", + "nativeSrc": "19911:4:52", + "nodeType": "YulIdentifier", + "src": "19911:4:52" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "19898:3:52", + "nodeType": "YulIdentifier", + "src": "19898:3:52" + }, + "nativeSrc": "19898:18:52", + "nodeType": "YulFunctionCall", + "src": "19898:18:52" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "19885:6:52", + "nodeType": "YulIdentifier", + "src": "19885:6:52" + }, + "nativeSrc": "19885:32:52", + "nodeType": "YulFunctionCall", + "src": "19885:32:52" + }, + "nativeSrc": "19885:32:52", + "nodeType": "YulExpressionStatement", + "src": "19885:32:52" + } + ] + }, + "evmVersion": "paris", + "externalReferences": [ + { + "declaration": 9210, + "isOffset": false, + "isSlot": false, + "src": "19635:4:52", + "valueSize": 1 + }, + { + "declaration": 9210, + "isOffset": false, + "isSlot": false, + "src": "19804:4:52", + "valueSize": 1 + }, + { + "declaration": 9210, + "isOffset": false, + "isSlot": false, + "src": "19911:4:52", + "valueSize": 1 + }, + { + "declaration": 9196, + "isOffset": false, + "isSlot": false, + "src": "19464:6:52", + "valueSize": 1 + }, + { + "declaration": 9196, + "isOffset": false, + "isSlot": false, + "src": "19617:6:52", + "valueSize": 1 + }, + { + "declaration": 9196, + "isOffset": false, + "isSlot": false, + "src": "19796:6:52", + "valueSize": 1 + }, + { + "declaration": 9194, + "isOffset": false, + "isSlot": false, + "src": "19567:7:52", + "valueSize": 1 + } + ], + "flags": [ + "memory-safe" + ], + "id": 9228, + "nodeType": "InlineAssembly", + "src": "19406:521:52" + } + ] + }, + "documentation": { + "id": 9185, + "nodeType": "StructuredDocumentation", + "src": "18914:88:52", + "text": " @dev Variant of {tryModExp} that supports inputs of arbitrary length." + }, + "id": 9230, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "tryModExp", + "nameLocation": "19016:9:52", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 9192, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 9187, + "mutability": "mutable", + "name": "b", + "nameLocation": "19048:1:52", + "nodeType": "VariableDeclaration", + "scope": 9230, + "src": "19035:14:52", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 9186, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "19035:5:52", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 9189, + "mutability": "mutable", + "name": "e", + "nameLocation": "19072:1:52", + "nodeType": "VariableDeclaration", + "scope": 9230, + "src": "19059:14:52", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 9188, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "19059:5:52", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 9191, + "mutability": "mutable", + "name": "m", + "nameLocation": "19096:1:52", + "nodeType": "VariableDeclaration", + "scope": 9230, + "src": "19083:14:52", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 9190, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "19083:5:52", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "src": "19025:78:52" + }, + "returnParameters": { + "id": 9197, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 9194, + "mutability": "mutable", + "name": "success", + "nameLocation": "19132:7:52", + "nodeType": "VariableDeclaration", + "scope": 9230, + "src": "19127:12:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 9193, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "19127:4:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 9196, + "mutability": "mutable", + "name": "result", + "nameLocation": "19154:6:52", + "nodeType": "VariableDeclaration", + "scope": 9230, + "src": "19141:19:52", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 9195, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "19141:5:52", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "src": "19126:35:52" + }, + "scope": 9938, + "src": "19007:926:52", + "stateMutability": "view", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 9262, + "nodeType": "Block", + "src": "20088:176:52", + "statements": [ + { + "body": { + "id": 9258, + "nodeType": "Block", + "src": "20145:92:52", + "statements": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + }, + "id": 9253, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "baseExpression": { + "id": 9249, + "name": "byteArray", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9233, + "src": "20163:9:52", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 9251, + "indexExpression": { + "id": 9250, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9239, + "src": "20173:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "20163:12:52", + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "hexValue": "30", + "id": 9252, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "20179:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "20163:17:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 9257, + "nodeType": "IfStatement", + "src": "20159:68:52", + "trueBody": { + "id": 9256, + "nodeType": "Block", + "src": "20182:45:52", + "statements": [ + { + "expression": { + "hexValue": "66616c7365", + "id": 9254, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "20207:5:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + }, + "functionReturnParameters": 9237, + "id": 9255, + "nodeType": "Return", + "src": "20200:12:52" + } + ] + } + } + ] + }, + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9245, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 9242, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9239, + "src": "20118:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "expression": { + "id": 9243, + "name": "byteArray", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9233, + "src": "20122:9:52", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 9244, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "20132:6:52", + "memberName": "length", + "nodeType": "MemberAccess", + "src": "20122:16:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "20118:20:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 9259, + "initializationExpression": { + "assignments": [ + 9239 + ], + "declarations": [ + { + "constant": false, + "id": 9239, + "mutability": "mutable", + "name": "i", + "nameLocation": "20111:1:52", + "nodeType": "VariableDeclaration", + "scope": 9259, + "src": "20103:9:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 9238, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "20103:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 9241, + "initialValue": { + "hexValue": "30", + "id": 9240, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "20115:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "nodeType": "VariableDeclarationStatement", + "src": "20103:13:52" + }, + "isSimpleCounterLoop": true, + "loopExpression": { + "expression": { + "id": 9247, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": true, + "src": "20140:3:52", + "subExpression": { + "id": 9246, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9239, + "src": "20142:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 9248, + "nodeType": "ExpressionStatement", + "src": "20140:3:52" + }, + "nodeType": "ForStatement", + "src": "20098:139:52" + }, + { + "expression": { + "hexValue": "74727565", + "id": 9260, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "20253:4:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "true" + }, + "functionReturnParameters": 9237, + "id": 9261, + "nodeType": "Return", + "src": "20246:11:52" + } + ] + }, + "documentation": { + "id": 9231, + "nodeType": "StructuredDocumentation", + "src": "19939:72:52", + "text": " @dev Returns whether the provided byte array is zero." + }, + "id": 9263, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_zeroBytes", + "nameLocation": "20025:10:52", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 9234, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 9233, + "mutability": "mutable", + "name": "byteArray", + "nameLocation": "20049:9:52", + "nodeType": "VariableDeclaration", + "scope": 9263, + "src": "20036:22:52", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 9232, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "20036:5:52", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "src": "20035:24:52" + }, + "returnParameters": { + "id": 9237, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 9236, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 9263, + "src": "20082:4:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 9235, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "20082:4:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "src": "20081:6:52" + }, + "scope": 9938, + "src": "20016:248:52", + "stateMutability": "pure", + "virtual": false, + "visibility": "private" + }, + { + "body": { + "id": 9481, + "nodeType": "Block", + "src": "20624:5124:52", + "statements": [ + { + "id": 9480, + "nodeType": "UncheckedBlock", + "src": "20634:5108:52", + "statements": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9273, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 9271, + "name": "a", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9266, + "src": "20728:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "hexValue": "31", + "id": 9272, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "20733:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "20728:6:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 9277, + "nodeType": "IfStatement", + "src": "20724:53:52", + "trueBody": { + "id": 9276, + "nodeType": "Block", + "src": "20736:41:52", + "statements": [ + { + "expression": { + "id": 9274, + "name": "a", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9266, + "src": "20761:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 9270, + "id": 9275, + "nodeType": "Return", + "src": "20754:8:52" + } + ] + } + }, + { + "assignments": [ + 9279 + ], + "declarations": [ + { + "constant": false, + "id": 9279, + "mutability": "mutable", + "name": "aa", + "nameLocation": "21712:2:52", + "nodeType": "VariableDeclaration", + "scope": 9480, + "src": "21704:10:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 9278, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "21704:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 9281, + "initialValue": { + "id": 9280, + "name": "a", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9266, + "src": "21717:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "21704:14:52" + }, + { + "assignments": [ + 9283 + ], + "declarations": [ + { + "constant": false, + "id": 9283, + "mutability": "mutable", + "name": "xn", + "nameLocation": "21740:2:52", + "nodeType": "VariableDeclaration", + "scope": 9480, + "src": "21732:10:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 9282, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "21732:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 9285, + "initialValue": { + "hexValue": "31", + "id": 9284, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "21745:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "nodeType": "VariableDeclarationStatement", + "src": "21732:14:52" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9291, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 9286, + "name": "aa", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9279, + "src": "21765:2:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_rational_340282366920938463463374607431768211456_by_1", + "typeString": "int_const 3402...(31 digits omitted)...1456" + }, + "id": 9289, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "leftExpression": { + "hexValue": "31", + "id": 9287, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "21772:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "nodeType": "BinaryOperation", + "operator": "<<", + "rightExpression": { + "hexValue": "313238", + "id": 9288, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "21777:3:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_128_by_1", + "typeString": "int_const 128" + }, + "value": "128" + }, + "src": "21772:8:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_340282366920938463463374607431768211456_by_1", + "typeString": "int_const 3402...(31 digits omitted)...1456" + } + } + ], + "id": 9290, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "21771:10:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_340282366920938463463374607431768211456_by_1", + "typeString": "int_const 3402...(31 digits omitted)...1456" + } + }, + "src": "21765:16:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 9301, + "nodeType": "IfStatement", + "src": "21761:92:52", + "trueBody": { + "id": 9300, + "nodeType": "Block", + "src": "21783:70:52", + "statements": [ + { + "expression": { + "id": 9294, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 9292, + "name": "aa", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9279, + "src": "21801:2:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": ">>=", + "rightHandSide": { + "hexValue": "313238", + "id": 9293, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "21808:3:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_128_by_1", + "typeString": "int_const 128" + }, + "value": "128" + }, + "src": "21801:10:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 9295, + "nodeType": "ExpressionStatement", + "src": "21801:10:52" + }, + { + "expression": { + "id": 9298, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 9296, + "name": "xn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9283, + "src": "21829:2:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "<<=", + "rightHandSide": { + "hexValue": "3634", + "id": 9297, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "21836:2:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_64_by_1", + "typeString": "int_const 64" + }, + "value": "64" + }, + "src": "21829:9:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 9299, + "nodeType": "ExpressionStatement", + "src": "21829:9:52" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9307, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 9302, + "name": "aa", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9279, + "src": "21870:2:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_rational_18446744073709551616_by_1", + "typeString": "int_const 18446744073709551616" + }, + "id": 9305, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "leftExpression": { + "hexValue": "31", + "id": 9303, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "21877:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "nodeType": "BinaryOperation", + "operator": "<<", + "rightExpression": { + "hexValue": "3634", + "id": 9304, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "21882:2:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_64_by_1", + "typeString": "int_const 64" + }, + "value": "64" + }, + "src": "21877:7:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_18446744073709551616_by_1", + "typeString": "int_const 18446744073709551616" + } + } + ], + "id": 9306, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "21876:9:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_18446744073709551616_by_1", + "typeString": "int_const 18446744073709551616" + } + }, + "src": "21870:15:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 9317, + "nodeType": "IfStatement", + "src": "21866:90:52", + "trueBody": { + "id": 9316, + "nodeType": "Block", + "src": "21887:69:52", + "statements": [ + { + "expression": { + "id": 9310, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 9308, + "name": "aa", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9279, + "src": "21905:2:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": ">>=", + "rightHandSide": { + "hexValue": "3634", + "id": 9309, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "21912:2:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_64_by_1", + "typeString": "int_const 64" + }, + "value": "64" + }, + "src": "21905:9:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 9311, + "nodeType": "ExpressionStatement", + "src": "21905:9:52" + }, + { + "expression": { + "id": 9314, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 9312, + "name": "xn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9283, + "src": "21932:2:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "<<=", + "rightHandSide": { + "hexValue": "3332", + "id": 9313, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "21939:2:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_32_by_1", + "typeString": "int_const 32" + }, + "value": "32" + }, + "src": "21932:9:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 9315, + "nodeType": "ExpressionStatement", + "src": "21932:9:52" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9323, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 9318, + "name": "aa", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9279, + "src": "21973:2:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_rational_4294967296_by_1", + "typeString": "int_const 4294967296" + }, + "id": 9321, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "leftExpression": { + "hexValue": "31", + "id": 9319, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "21980:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "nodeType": "BinaryOperation", + "operator": "<<", + "rightExpression": { + "hexValue": "3332", + "id": 9320, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "21985:2:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_32_by_1", + "typeString": "int_const 32" + }, + "value": "32" + }, + "src": "21980:7:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_4294967296_by_1", + "typeString": "int_const 4294967296" + } + } + ], + "id": 9322, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "21979:9:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_4294967296_by_1", + "typeString": "int_const 4294967296" + } + }, + "src": "21973:15:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 9333, + "nodeType": "IfStatement", + "src": "21969:90:52", + "trueBody": { + "id": 9332, + "nodeType": "Block", + "src": "21990:69:52", + "statements": [ + { + "expression": { + "id": 9326, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 9324, + "name": "aa", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9279, + "src": "22008:2:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": ">>=", + "rightHandSide": { + "hexValue": "3332", + "id": 9325, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "22015:2:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_32_by_1", + "typeString": "int_const 32" + }, + "value": "32" + }, + "src": "22008:9:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 9327, + "nodeType": "ExpressionStatement", + "src": "22008:9:52" + }, + { + "expression": { + "id": 9330, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 9328, + "name": "xn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9283, + "src": "22035:2:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "<<=", + "rightHandSide": { + "hexValue": "3136", + "id": 9329, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "22042:2:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_16_by_1", + "typeString": "int_const 16" + }, + "value": "16" + }, + "src": "22035:9:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 9331, + "nodeType": "ExpressionStatement", + "src": "22035:9:52" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9339, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 9334, + "name": "aa", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9279, + "src": "22076:2:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_rational_65536_by_1", + "typeString": "int_const 65536" + }, + "id": 9337, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "leftExpression": { + "hexValue": "31", + "id": 9335, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "22083:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "nodeType": "BinaryOperation", + "operator": "<<", + "rightExpression": { + "hexValue": "3136", + "id": 9336, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "22088:2:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_16_by_1", + "typeString": "int_const 16" + }, + "value": "16" + }, + "src": "22083:7:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_65536_by_1", + "typeString": "int_const 65536" + } + } + ], + "id": 9338, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "22082:9:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_65536_by_1", + "typeString": "int_const 65536" + } + }, + "src": "22076:15:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 9349, + "nodeType": "IfStatement", + "src": "22072:89:52", + "trueBody": { + "id": 9348, + "nodeType": "Block", + "src": "22093:68:52", + "statements": [ + { + "expression": { + "id": 9342, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 9340, + "name": "aa", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9279, + "src": "22111:2:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": ">>=", + "rightHandSide": { + "hexValue": "3136", + "id": 9341, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "22118:2:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_16_by_1", + "typeString": "int_const 16" + }, + "value": "16" + }, + "src": "22111:9:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 9343, + "nodeType": "ExpressionStatement", + "src": "22111:9:52" + }, + { + "expression": { + "id": 9346, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 9344, + "name": "xn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9283, + "src": "22138:2:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "<<=", + "rightHandSide": { + "hexValue": "38", + "id": 9345, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "22145:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_8_by_1", + "typeString": "int_const 8" + }, + "value": "8" + }, + "src": "22138:8:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 9347, + "nodeType": "ExpressionStatement", + "src": "22138:8:52" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9355, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 9350, + "name": "aa", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9279, + "src": "22178:2:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_rational_256_by_1", + "typeString": "int_const 256" + }, + "id": 9353, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "leftExpression": { + "hexValue": "31", + "id": 9351, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "22185:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "nodeType": "BinaryOperation", + "operator": "<<", + "rightExpression": { + "hexValue": "38", + "id": 9352, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "22190:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_8_by_1", + "typeString": "int_const 8" + }, + "value": "8" + }, + "src": "22185:6:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_256_by_1", + "typeString": "int_const 256" + } + } + ], + "id": 9354, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "22184:8:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_256_by_1", + "typeString": "int_const 256" + } + }, + "src": "22178:14:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 9365, + "nodeType": "IfStatement", + "src": "22174:87:52", + "trueBody": { + "id": 9364, + "nodeType": "Block", + "src": "22194:67:52", + "statements": [ + { + "expression": { + "id": 9358, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 9356, + "name": "aa", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9279, + "src": "22212:2:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": ">>=", + "rightHandSide": { + "hexValue": "38", + "id": 9357, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "22219:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_8_by_1", + "typeString": "int_const 8" + }, + "value": "8" + }, + "src": "22212:8:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 9359, + "nodeType": "ExpressionStatement", + "src": "22212:8:52" + }, + { + "expression": { + "id": 9362, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 9360, + "name": "xn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9283, + "src": "22238:2:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "<<=", + "rightHandSide": { + "hexValue": "34", + "id": 9361, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "22245:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_4_by_1", + "typeString": "int_const 4" + }, + "value": "4" + }, + "src": "22238:8:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 9363, + "nodeType": "ExpressionStatement", + "src": "22238:8:52" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9371, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 9366, + "name": "aa", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9279, + "src": "22278:2:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_rational_16_by_1", + "typeString": "int_const 16" + }, + "id": 9369, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "leftExpression": { + "hexValue": "31", + "id": 9367, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "22285:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "nodeType": "BinaryOperation", + "operator": "<<", + "rightExpression": { + "hexValue": "34", + "id": 9368, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "22290:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_4_by_1", + "typeString": "int_const 4" + }, + "value": "4" + }, + "src": "22285:6:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_16_by_1", + "typeString": "int_const 16" + } + } + ], + "id": 9370, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "22284:8:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_16_by_1", + "typeString": "int_const 16" + } + }, + "src": "22278:14:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 9381, + "nodeType": "IfStatement", + "src": "22274:87:52", + "trueBody": { + "id": 9380, + "nodeType": "Block", + "src": "22294:67:52", + "statements": [ + { + "expression": { + "id": 9374, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 9372, + "name": "aa", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9279, + "src": "22312:2:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": ">>=", + "rightHandSide": { + "hexValue": "34", + "id": 9373, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "22319:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_4_by_1", + "typeString": "int_const 4" + }, + "value": "4" + }, + "src": "22312:8:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 9375, + "nodeType": "ExpressionStatement", + "src": "22312:8:52" + }, + { + "expression": { + "id": 9378, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 9376, + "name": "xn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9283, + "src": "22338:2:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "<<=", + "rightHandSide": { + "hexValue": "32", + "id": 9377, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "22345:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_2_by_1", + "typeString": "int_const 2" + }, + "value": "2" + }, + "src": "22338:8:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 9379, + "nodeType": "ExpressionStatement", + "src": "22338:8:52" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9387, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 9382, + "name": "aa", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9279, + "src": "22378:2:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_rational_4_by_1", + "typeString": "int_const 4" + }, + "id": 9385, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "leftExpression": { + "hexValue": "31", + "id": 9383, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "22385:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "nodeType": "BinaryOperation", + "operator": "<<", + "rightExpression": { + "hexValue": "32", + "id": 9384, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "22390:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_2_by_1", + "typeString": "int_const 2" + }, + "value": "2" + }, + "src": "22385:6:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_4_by_1", + "typeString": "int_const 4" + } + } + ], + "id": 9386, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "22384:8:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_4_by_1", + "typeString": "int_const 4" + } + }, + "src": "22378:14:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 9393, + "nodeType": "IfStatement", + "src": "22374:61:52", + "trueBody": { + "id": 9392, + "nodeType": "Block", + "src": "22394:41:52", + "statements": [ + { + "expression": { + "id": 9390, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 9388, + "name": "xn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9283, + "src": "22412:2:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "<<=", + "rightHandSide": { + "hexValue": "31", + "id": 9389, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "22419:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "22412:8:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 9391, + "nodeType": "ExpressionStatement", + "src": "22412:8:52" + } + ] + } + }, + { + "expression": { + "id": 9401, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 9394, + "name": "xn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9283, + "src": "22855:2:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9400, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9397, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "hexValue": "33", + "id": 9395, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "22861:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_3_by_1", + "typeString": "int_const 3" + }, + "value": "3" + }, + "nodeType": "BinaryOperation", + "operator": "*", + "rightExpression": { + "id": 9396, + "name": "xn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9283, + "src": "22865:2:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "22861:6:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 9398, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "22860:8:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">>", + "rightExpression": { + "hexValue": "31", + "id": 9399, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "22872:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "22860:13:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "22855:18:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 9402, + "nodeType": "ExpressionStatement", + "src": "22855:18:52" + }, + { + "expression": { + "id": 9412, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 9403, + "name": "xn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9283, + "src": "24760:2:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9411, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9408, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 9404, + "name": "xn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9283, + "src": "24766:2:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9407, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 9405, + "name": "a", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9266, + "src": "24771:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "/", + "rightExpression": { + "id": 9406, + "name": "xn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9283, + "src": "24775:2:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "24771:6:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "24766:11:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 9409, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "24765:13:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">>", + "rightExpression": { + "hexValue": "31", + "id": 9410, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "24782:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "24765:18:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "24760:23:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 9413, + "nodeType": "ExpressionStatement", + "src": "24760:23:52" + }, + { + "expression": { + "id": 9423, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 9414, + "name": "xn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9283, + "src": "24869:2:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9422, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9419, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 9415, + "name": "xn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9283, + "src": "24875:2:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9418, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 9416, + "name": "a", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9266, + "src": "24880:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "/", + "rightExpression": { + "id": 9417, + "name": "xn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9283, + "src": "24884:2:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "24880:6:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "24875:11:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 9420, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "24874:13:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">>", + "rightExpression": { + "hexValue": "31", + "id": 9421, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "24891:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "24874:18:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "24869:23:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 9424, + "nodeType": "ExpressionStatement", + "src": "24869:23:52" + }, + { + "expression": { + "id": 9434, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 9425, + "name": "xn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9283, + "src": "24980:2:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9433, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9430, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 9426, + "name": "xn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9283, + "src": "24986:2:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9429, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 9427, + "name": "a", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9266, + "src": "24991:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "/", + "rightExpression": { + "id": 9428, + "name": "xn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9283, + "src": "24995:2:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "24991:6:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "24986:11:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 9431, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "24985:13:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">>", + "rightExpression": { + "hexValue": "31", + "id": 9432, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "25002:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "24985:18:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "24980:23:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 9435, + "nodeType": "ExpressionStatement", + "src": "24980:23:52" + }, + { + "expression": { + "id": 9445, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 9436, + "name": "xn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9283, + "src": "25089:2:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9444, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9441, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 9437, + "name": "xn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9283, + "src": "25095:2:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9440, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 9438, + "name": "a", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9266, + "src": "25100:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "/", + "rightExpression": { + "id": 9439, + "name": "xn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9283, + "src": "25104:2:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "25100:6:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "25095:11:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 9442, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "25094:13:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">>", + "rightExpression": { + "hexValue": "31", + "id": 9443, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "25111:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "25094:18:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "25089:23:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 9446, + "nodeType": "ExpressionStatement", + "src": "25089:23:52" + }, + { + "expression": { + "id": 9456, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 9447, + "name": "xn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9283, + "src": "25199:2:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9455, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9452, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 9448, + "name": "xn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9283, + "src": "25205:2:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9451, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 9449, + "name": "a", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9266, + "src": "25210:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "/", + "rightExpression": { + "id": 9450, + "name": "xn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9283, + "src": "25214:2:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "25210:6:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "25205:11:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 9453, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "25204:13:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">>", + "rightExpression": { + "hexValue": "31", + "id": 9454, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "25221:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "25204:18:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "25199:23:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 9457, + "nodeType": "ExpressionStatement", + "src": "25199:23:52" + }, + { + "expression": { + "id": 9467, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 9458, + "name": "xn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9283, + "src": "25309:2:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9466, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9463, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 9459, + "name": "xn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9283, + "src": "25315:2:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9462, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 9460, + "name": "a", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9266, + "src": "25320:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "/", + "rightExpression": { + "id": 9461, + "name": "xn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9283, + "src": "25324:2:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "25320:6:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "25315:11:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 9464, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "25314:13:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">>", + "rightExpression": { + "hexValue": "31", + "id": 9465, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "25331:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "25314:18:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "25309:23:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 9468, + "nodeType": "ExpressionStatement", + "src": "25309:23:52" + }, + { + "expression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9478, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 9469, + "name": "xn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9283, + "src": "25698:2:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9476, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 9472, + "name": "xn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9283, + "src": "25719:2:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9475, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 9473, + "name": "a", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9266, + "src": "25724:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "/", + "rightExpression": { + "id": 9474, + "name": "xn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9283, + "src": "25728:2:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "25724:6:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "25719:11:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "expression": { + "id": 9470, + "name": "SafeCast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11703, + "src": "25703:8:52", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_SafeCast_$11703_$", + "typeString": "type(library SafeCast)" + } + }, + "id": 9471, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "25712:6:52", + "memberName": "toUint", + "nodeType": "MemberAccess", + "referencedDeclaration": 11702, + "src": "25703:15:52", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_bool_$returns$_t_uint256_$", + "typeString": "function (bool) pure returns (uint256)" + } + }, + "id": 9477, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "25703:28:52", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "25698:33:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 9270, + "id": 9479, + "nodeType": "Return", + "src": "25691:40:52" + } + ] + } + ] + }, + "documentation": { + "id": 9264, + "nodeType": "StructuredDocumentation", + "src": "20270:292:52", + "text": " @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded\n towards zero.\n This method is based on Newton's method for computing square roots; the algorithm is restricted to only\n using integer operations." + }, + "id": 9482, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "sqrt", + "nameLocation": "20576:4:52", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 9267, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 9266, + "mutability": "mutable", + "name": "a", + "nameLocation": "20589:1:52", + "nodeType": "VariableDeclaration", + "scope": 9482, + "src": "20581:9:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 9265, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "20581:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "20580:11:52" + }, + "returnParameters": { + "id": 9270, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 9269, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 9482, + "src": "20615:7:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 9268, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "20615:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "20614:9:52" + }, + "scope": 9938, + "src": "20567:5181:52", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 9515, + "nodeType": "Block", + "src": "25921:171:52", + "statements": [ + { + "id": 9514, + "nodeType": "UncheckedBlock", + "src": "25931:155:52", + "statements": [ + { + "assignments": [ + 9494 + ], + "declarations": [ + { + "constant": false, + "id": 9494, + "mutability": "mutable", + "name": "result", + "nameLocation": "25963:6:52", + "nodeType": "VariableDeclaration", + "scope": 9514, + "src": "25955:14:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 9493, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "25955:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 9498, + "initialValue": { + "arguments": [ + { + "id": 9496, + "name": "a", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9485, + "src": "25977:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 9495, + "name": "sqrt", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 9482, + 9516 + ], + "referencedDeclaration": 9482, + "src": "25972:4:52", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256) pure returns (uint256)" + } + }, + "id": 9497, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "25972:7:52", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "25955:24:52" + }, + { + "expression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9512, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 9499, + "name": "result", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9494, + "src": "26000:6:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 9510, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "arguments": [ + { + "id": 9503, + "name": "rounding", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9488, + "src": "26042:8:52", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Rounding_$8329", + "typeString": "enum Math.Rounding" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_Rounding_$8329", + "typeString": "enum Math.Rounding" + } + ], + "id": 9502, + "name": "unsignedRoundsUp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9937, + "src": "26025:16:52", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_enum$_Rounding_$8329_$returns$_t_bool_$", + "typeString": "function (enum Math.Rounding) pure returns (bool)" + } + }, + "id": 9504, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "26025:26:52", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "&&", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9509, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9507, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 9505, + "name": "result", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9494, + "src": "26055:6:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "*", + "rightExpression": { + "id": 9506, + "name": "result", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9494, + "src": "26064:6:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "26055:15:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "id": 9508, + "name": "a", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9485, + "src": "26073:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "26055:19:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "26025:49:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "expression": { + "id": 9500, + "name": "SafeCast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11703, + "src": "26009:8:52", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_SafeCast_$11703_$", + "typeString": "type(library SafeCast)" + } + }, + "id": 9501, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "26018:6:52", + "memberName": "toUint", + "nodeType": "MemberAccess", + "referencedDeclaration": 11702, + "src": "26009:15:52", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_bool_$returns$_t_uint256_$", + "typeString": "function (bool) pure returns (uint256)" + } + }, + "id": 9511, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "26009:66:52", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "26000:75:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 9492, + "id": 9513, + "nodeType": "Return", + "src": "25993:82:52" + } + ] + } + ] + }, + "documentation": { + "id": 9483, + "nodeType": "StructuredDocumentation", + "src": "25754:86:52", + "text": " @dev Calculates sqrt(a), following the selected rounding direction." + }, + "id": 9516, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "sqrt", + "nameLocation": "25854:4:52", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 9489, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 9485, + "mutability": "mutable", + "name": "a", + "nameLocation": "25867:1:52", + "nodeType": "VariableDeclaration", + "scope": 9516, + "src": "25859:9:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 9484, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "25859:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 9488, + "mutability": "mutable", + "name": "rounding", + "nameLocation": "25879:8:52", + "nodeType": "VariableDeclaration", + "scope": 9516, + "src": "25870:17:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Rounding_$8329", + "typeString": "enum Math.Rounding" + }, + "typeName": { + "id": 9487, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 9486, + "name": "Rounding", + "nameLocations": [ + "25870:8:52" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 8329, + "src": "25870:8:52" + }, + "referencedDeclaration": 8329, + "src": "25870:8:52", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Rounding_$8329", + "typeString": "enum Math.Rounding" + } + }, + "visibility": "internal" + } + ], + "src": "25858:30:52" + }, + "returnParameters": { + "id": 9492, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 9491, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 9516, + "src": "25912:7:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 9490, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "25912:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "25911:9:52" + }, + "scope": 9938, + "src": "25845:247:52", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 9606, + "nodeType": "Block", + "src": "26281:2334:52", + "statements": [ + { + "expression": { + "id": 9533, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 9524, + "name": "r", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9522, + "src": "26363:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9532, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9529, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 9527, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9519, + "src": "26383:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "hexValue": "30786666666666666666666666666666666666666666666666666666666666666666", + "id": 9528, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "26387:34:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_340282366920938463463374607431768211455_by_1", + "typeString": "int_const 3402...(31 digits omitted)...1455" + }, + "value": "0xffffffffffffffffffffffffffffffff" + }, + "src": "26383:38:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "expression": { + "id": 9525, + "name": "SafeCast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11703, + "src": "26367:8:52", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_SafeCast_$11703_$", + "typeString": "type(library SafeCast)" + } + }, + "id": 9526, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "26376:6:52", + "memberName": "toUint", + "nodeType": "MemberAccess", + "referencedDeclaration": 11702, + "src": "26367:15:52", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_bool_$returns$_t_uint256_$", + "typeString": "function (bool) pure returns (uint256)" + } + }, + "id": 9530, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "26367:55:52", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<<", + "rightExpression": { + "hexValue": "37", + "id": 9531, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "26426:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_7_by_1", + "typeString": "int_const 7" + }, + "value": "7" + }, + "src": "26367:60:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "26363:64:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 9534, + "nodeType": "ExpressionStatement", + "src": "26363:64:52" + }, + { + "expression": { + "id": 9547, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 9535, + "name": "r", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9522, + "src": "26503:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "|=", + "rightHandSide": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9546, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9543, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9540, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 9538, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9519, + "src": "26525:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">>", + "rightExpression": { + "id": 9539, + "name": "r", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9522, + "src": "26530:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "26525:6:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 9541, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "26524:8:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "hexValue": "307866666666666666666666666666666666", + "id": 9542, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "26535:18:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_18446744073709551615_by_1", + "typeString": "int_const 18446744073709551615" + }, + "value": "0xffffffffffffffff" + }, + "src": "26524:29:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "expression": { + "id": 9536, + "name": "SafeCast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11703, + "src": "26508:8:52", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_SafeCast_$11703_$", + "typeString": "type(library SafeCast)" + } + }, + "id": 9537, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "26517:6:52", + "memberName": "toUint", + "nodeType": "MemberAccess", + "referencedDeclaration": 11702, + "src": "26508:15:52", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_bool_$returns$_t_uint256_$", + "typeString": "function (bool) pure returns (uint256)" + } + }, + "id": 9544, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "26508:46:52", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<<", + "rightExpression": { + "hexValue": "36", + "id": 9545, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "26558:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_6_by_1", + "typeString": "int_const 6" + }, + "value": "6" + }, + "src": "26508:51:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "26503:56:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 9548, + "nodeType": "ExpressionStatement", + "src": "26503:56:52" + }, + { + "expression": { + "id": 9561, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 9549, + "name": "r", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9522, + "src": "26634:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "|=", + "rightHandSide": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9560, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9557, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9554, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 9552, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9519, + "src": "26656:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">>", + "rightExpression": { + "id": 9553, + "name": "r", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9522, + "src": "26661:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "26656:6:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 9555, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "26655:8:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "hexValue": "30786666666666666666", + "id": 9556, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "26666:10:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_4294967295_by_1", + "typeString": "int_const 4294967295" + }, + "value": "0xffffffff" + }, + "src": "26655:21:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "expression": { + "id": 9550, + "name": "SafeCast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11703, + "src": "26639:8:52", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_SafeCast_$11703_$", + "typeString": "type(library SafeCast)" + } + }, + "id": 9551, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "26648:6:52", + "memberName": "toUint", + "nodeType": "MemberAccess", + "referencedDeclaration": 11702, + "src": "26639:15:52", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_bool_$returns$_t_uint256_$", + "typeString": "function (bool) pure returns (uint256)" + } + }, + "id": 9558, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "26639:38:52", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<<", + "rightExpression": { + "hexValue": "35", + "id": 9559, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "26681:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_5_by_1", + "typeString": "int_const 5" + }, + "value": "5" + }, + "src": "26639:43:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "26634:48:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 9562, + "nodeType": "ExpressionStatement", + "src": "26634:48:52" + }, + { + "expression": { + "id": 9575, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 9563, + "name": "r", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9522, + "src": "26757:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "|=", + "rightHandSide": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9574, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9571, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9568, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 9566, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9519, + "src": "26779:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">>", + "rightExpression": { + "id": 9567, + "name": "r", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9522, + "src": "26784:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "26779:6:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 9569, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "26778:8:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "hexValue": "307866666666", + "id": 9570, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "26789:6:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_65535_by_1", + "typeString": "int_const 65535" + }, + "value": "0xffff" + }, + "src": "26778:17:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "expression": { + "id": 9564, + "name": "SafeCast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11703, + "src": "26762:8:52", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_SafeCast_$11703_$", + "typeString": "type(library SafeCast)" + } + }, + "id": 9565, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "26771:6:52", + "memberName": "toUint", + "nodeType": "MemberAccess", + "referencedDeclaration": 11702, + "src": "26762:15:52", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_bool_$returns$_t_uint256_$", + "typeString": "function (bool) pure returns (uint256)" + } + }, + "id": 9572, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "26762:34:52", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<<", + "rightExpression": { + "hexValue": "34", + "id": 9573, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "26800:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_4_by_1", + "typeString": "int_const 4" + }, + "value": "4" + }, + "src": "26762:39:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "26757:44:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 9576, + "nodeType": "ExpressionStatement", + "src": "26757:44:52" + }, + { + "expression": { + "id": 9589, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 9577, + "name": "r", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9522, + "src": "26874:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "|=", + "rightHandSide": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9588, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9585, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9582, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 9580, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9519, + "src": "26896:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">>", + "rightExpression": { + "id": 9581, + "name": "r", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9522, + "src": "26901:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "26896:6:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 9583, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "26895:8:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "hexValue": "30786666", + "id": 9584, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "26906:4:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_255_by_1", + "typeString": "int_const 255" + }, + "value": "0xff" + }, + "src": "26895:15:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "expression": { + "id": 9578, + "name": "SafeCast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11703, + "src": "26879:8:52", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_SafeCast_$11703_$", + "typeString": "type(library SafeCast)" + } + }, + "id": 9579, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "26888:6:52", + "memberName": "toUint", + "nodeType": "MemberAccess", + "referencedDeclaration": 11702, + "src": "26879:15:52", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_bool_$returns$_t_uint256_$", + "typeString": "function (bool) pure returns (uint256)" + } + }, + "id": 9586, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "26879:32:52", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<<", + "rightExpression": { + "hexValue": "33", + "id": 9587, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "26915:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_3_by_1", + "typeString": "int_const 3" + }, + "value": "3" + }, + "src": "26879:37:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "26874:42:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 9590, + "nodeType": "ExpressionStatement", + "src": "26874:42:52" + }, + { + "expression": { + "id": 9603, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 9591, + "name": "r", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9522, + "src": "26988:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "|=", + "rightHandSide": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9602, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9599, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9596, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 9594, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9519, + "src": "27010:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">>", + "rightExpression": { + "id": 9595, + "name": "r", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9522, + "src": "27015:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "27010:6:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 9597, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "27009:8:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "hexValue": "307866", + "id": 9598, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "27020:3:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_15_by_1", + "typeString": "int_const 15" + }, + "value": "0xf" + }, + "src": "27009:14:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "expression": { + "id": 9592, + "name": "SafeCast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11703, + "src": "26993:8:52", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_SafeCast_$11703_$", + "typeString": "type(library SafeCast)" + } + }, + "id": 9593, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "27002:6:52", + "memberName": "toUint", + "nodeType": "MemberAccess", + "referencedDeclaration": 11702, + "src": "26993:15:52", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_bool_$returns$_t_uint256_$", + "typeString": "function (bool) pure returns (uint256)" + } + }, + "id": 9600, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "26993:31:52", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<<", + "rightExpression": { + "hexValue": "32", + "id": 9601, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "27028:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_2_by_1", + "typeString": "int_const 2" + }, + "value": "2" + }, + "src": "26993:36:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "26988:41:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 9604, + "nodeType": "ExpressionStatement", + "src": "26988:41:52" + }, + { + "AST": { + "nativeSrc": "28490:119:52", + "nodeType": "YulBlock", + "src": "28490:119:52", + "statements": [ + { + "nativeSrc": "28504:95:52", + "nodeType": "YulAssignment", + "src": "28504:95:52", + "value": { + "arguments": [ + { + "name": "r", + "nativeSrc": "28512:1:52", + "nodeType": "YulIdentifier", + "src": "28512:1:52" + }, + { + "arguments": [ + { + "arguments": [ + { + "name": "r", + "nativeSrc": "28524:1:52", + "nodeType": "YulIdentifier", + "src": "28524:1:52" + }, + { + "name": "x", + "nativeSrc": "28527:1:52", + "nodeType": "YulIdentifier", + "src": "28527:1:52" + } + ], + "functionName": { + "name": "shr", + "nativeSrc": "28520:3:52", + "nodeType": "YulIdentifier", + "src": "28520:3:52" + }, + "nativeSrc": "28520:9:52", + "nodeType": "YulFunctionCall", + "src": "28520:9:52" + }, + { + "kind": "number", + "nativeSrc": "28531:66:52", + "nodeType": "YulLiteral", + "src": "28531:66:52", + "type": "", + "value": "0x0000010102020202030303030303030300000000000000000000000000000000" + } + ], + "functionName": { + "name": "byte", + "nativeSrc": "28515:4:52", + "nodeType": "YulIdentifier", + "src": "28515:4:52" + }, + "nativeSrc": "28515:83:52", + "nodeType": "YulFunctionCall", + "src": "28515:83:52" + } + ], + "functionName": { + "name": "or", + "nativeSrc": "28509:2:52", + "nodeType": "YulIdentifier", + "src": "28509:2:52" + }, + "nativeSrc": "28509:90:52", + "nodeType": "YulFunctionCall", + "src": "28509:90:52" + }, + "variableNames": [ + { + "name": "r", + "nativeSrc": "28504:1:52", + "nodeType": "YulIdentifier", + "src": "28504:1:52" + } + ] + } + ] + }, + "evmVersion": "paris", + "externalReferences": [ + { + "declaration": 9522, + "isOffset": false, + "isSlot": false, + "src": "28504:1:52", + "valueSize": 1 + }, + { + "declaration": 9522, + "isOffset": false, + "isSlot": false, + "src": "28512:1:52", + "valueSize": 1 + }, + { + "declaration": 9522, + "isOffset": false, + "isSlot": false, + "src": "28524:1:52", + "valueSize": 1 + }, + { + "declaration": 9519, + "isOffset": false, + "isSlot": false, + "src": "28527:1:52", + "valueSize": 1 + } + ], + "flags": [ + "memory-safe" + ], + "id": 9605, + "nodeType": "InlineAssembly", + "src": "28465:144:52" + } + ] + }, + "documentation": { + "id": 9517, + "nodeType": "StructuredDocumentation", + "src": "26098:119:52", + "text": " @dev Return the log in base 2 of a positive value rounded towards zero.\n Returns 0 if given 0." + }, + "id": 9607, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "log2", + "nameLocation": "26231:4:52", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 9520, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 9519, + "mutability": "mutable", + "name": "x", + "nameLocation": "26244:1:52", + "nodeType": "VariableDeclaration", + "scope": 9607, + "src": "26236:9:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 9518, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "26236:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "26235:11:52" + }, + "returnParameters": { + "id": 9523, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 9522, + "mutability": "mutable", + "name": "r", + "nameLocation": "26278:1:52", + "nodeType": "VariableDeclaration", + "scope": 9607, + "src": "26270:9:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 9521, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "26270:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "26269:11:52" + }, + "scope": 9938, + "src": "26222:2393:52", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 9640, + "nodeType": "Block", + "src": "28848:175:52", + "statements": [ + { + "id": 9639, + "nodeType": "UncheckedBlock", + "src": "28858:159:52", + "statements": [ + { + "assignments": [ + 9619 + ], + "declarations": [ + { + "constant": false, + "id": 9619, + "mutability": "mutable", + "name": "result", + "nameLocation": "28890:6:52", + "nodeType": "VariableDeclaration", + "scope": 9639, + "src": "28882:14:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 9618, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "28882:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 9623, + "initialValue": { + "arguments": [ + { + "id": 9621, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9610, + "src": "28904:5:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 9620, + "name": "log2", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 9607, + 9641 + ], + "referencedDeclaration": 9607, + "src": "28899:4:52", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256) pure returns (uint256)" + } + }, + "id": 9622, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "28899:11:52", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "28882:28:52" + }, + { + "expression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9637, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 9624, + "name": "result", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9619, + "src": "28931:6:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 9635, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "arguments": [ + { + "id": 9628, + "name": "rounding", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9613, + "src": "28973:8:52", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Rounding_$8329", + "typeString": "enum Math.Rounding" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_Rounding_$8329", + "typeString": "enum Math.Rounding" + } + ], + "id": 9627, + "name": "unsignedRoundsUp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9937, + "src": "28956:16:52", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_enum$_Rounding_$8329_$returns$_t_bool_$", + "typeString": "function (enum Math.Rounding) pure returns (bool)" + } + }, + "id": 9629, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "28956:26:52", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "&&", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9634, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9632, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "hexValue": "31", + "id": 9630, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "28986:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "nodeType": "BinaryOperation", + "operator": "<<", + "rightExpression": { + "id": 9631, + "name": "result", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9619, + "src": "28991:6:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "28986:11:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "id": 9633, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9610, + "src": "29000:5:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "28986:19:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "28956:49:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "expression": { + "id": 9625, + "name": "SafeCast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11703, + "src": "28940:8:52", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_SafeCast_$11703_$", + "typeString": "type(library SafeCast)" + } + }, + "id": 9626, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "28949:6:52", + "memberName": "toUint", + "nodeType": "MemberAccess", + "referencedDeclaration": 11702, + "src": "28940:15:52", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_bool_$returns$_t_uint256_$", + "typeString": "function (bool) pure returns (uint256)" + } + }, + "id": 9636, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "28940:66:52", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "28931:75:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 9617, + "id": 9638, + "nodeType": "Return", + "src": "28924:82:52" + } + ] + } + ] + }, + "documentation": { + "id": 9608, + "nodeType": "StructuredDocumentation", + "src": "28621:142:52", + "text": " @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n Returns 0 if given 0." + }, + "id": 9641, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "log2", + "nameLocation": "28777:4:52", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 9614, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 9610, + "mutability": "mutable", + "name": "value", + "nameLocation": "28790:5:52", + "nodeType": "VariableDeclaration", + "scope": 9641, + "src": "28782:13:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 9609, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "28782:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 9613, + "mutability": "mutable", + "name": "rounding", + "nameLocation": "28806:8:52", + "nodeType": "VariableDeclaration", + "scope": 9641, + "src": "28797:17:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Rounding_$8329", + "typeString": "enum Math.Rounding" + }, + "typeName": { + "id": 9612, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 9611, + "name": "Rounding", + "nameLocations": [ + "28797:8:52" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 8329, + "src": "28797:8:52" + }, + "referencedDeclaration": 8329, + "src": "28797:8:52", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Rounding_$8329", + "typeString": "enum Math.Rounding" + } + }, + "visibility": "internal" + } + ], + "src": "28781:34:52" + }, + "returnParameters": { + "id": 9617, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 9616, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 9641, + "src": "28839:7:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 9615, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "28839:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "28838:9:52" + }, + "scope": 9938, + "src": "28768:255:52", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 9769, + "nodeType": "Block", + "src": "29216:854:52", + "statements": [ + { + "assignments": [ + 9650 + ], + "declarations": [ + { + "constant": false, + "id": 9650, + "mutability": "mutable", + "name": "result", + "nameLocation": "29234:6:52", + "nodeType": "VariableDeclaration", + "scope": 9769, + "src": "29226:14:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 9649, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "29226:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 9652, + "initialValue": { + "hexValue": "30", + "id": 9651, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "29243:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "nodeType": "VariableDeclarationStatement", + "src": "29226:18:52" + }, + { + "id": 9766, + "nodeType": "UncheckedBlock", + "src": "29254:787:52", + "statements": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9657, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 9653, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9644, + "src": "29282:5:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_rational_10000000000000000000000000000000000000000000000000000000000000000_by_1", + "typeString": "int_const 1000...(57 digits omitted)...0000" + }, + "id": 9656, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "leftExpression": { + "hexValue": "3130", + "id": 9654, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "29291:2:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_10_by_1", + "typeString": "int_const 10" + }, + "value": "10" + }, + "nodeType": "BinaryOperation", + "operator": "**", + "rightExpression": { + "hexValue": "3634", + "id": 9655, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "29297:2:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_64_by_1", + "typeString": "int_const 64" + }, + "value": "64" + }, + "src": "29291:8:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_10000000000000000000000000000000000000000000000000000000000000000_by_1", + "typeString": "int_const 1000...(57 digits omitted)...0000" + } + }, + "src": "29282:17:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 9669, + "nodeType": "IfStatement", + "src": "29278:103:52", + "trueBody": { + "id": 9668, + "nodeType": "Block", + "src": "29301:80:52", + "statements": [ + { + "expression": { + "id": 9662, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 9658, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9644, + "src": "29319:5:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "/=", + "rightHandSide": { + "commonType": { + "typeIdentifier": "t_rational_10000000000000000000000000000000000000000000000000000000000000000_by_1", + "typeString": "int_const 1000...(57 digits omitted)...0000" + }, + "id": 9661, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "leftExpression": { + "hexValue": "3130", + "id": 9659, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "29328:2:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_10_by_1", + "typeString": "int_const 10" + }, + "value": "10" + }, + "nodeType": "BinaryOperation", + "operator": "**", + "rightExpression": { + "hexValue": "3634", + "id": 9660, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "29334:2:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_64_by_1", + "typeString": "int_const 64" + }, + "value": "64" + }, + "src": "29328:8:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_10000000000000000000000000000000000000000000000000000000000000000_by_1", + "typeString": "int_const 1000...(57 digits omitted)...0000" + } + }, + "src": "29319:17:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 9663, + "nodeType": "ExpressionStatement", + "src": "29319:17:52" + }, + { + "expression": { + "id": 9666, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 9664, + "name": "result", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9650, + "src": "29354:6:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "+=", + "rightHandSide": { + "hexValue": "3634", + "id": 9665, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "29364:2:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_64_by_1", + "typeString": "int_const 64" + }, + "value": "64" + }, + "src": "29354:12:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 9667, + "nodeType": "ExpressionStatement", + "src": "29354:12:52" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9674, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 9670, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9644, + "src": "29398:5:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_rational_100000000000000000000000000000000_by_1", + "typeString": "int_const 1000...(25 digits omitted)...0000" + }, + "id": 9673, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "leftExpression": { + "hexValue": "3130", + "id": 9671, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "29407:2:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_10_by_1", + "typeString": "int_const 10" + }, + "value": "10" + }, + "nodeType": "BinaryOperation", + "operator": "**", + "rightExpression": { + "hexValue": "3332", + "id": 9672, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "29413:2:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_32_by_1", + "typeString": "int_const 32" + }, + "value": "32" + }, + "src": "29407:8:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_100000000000000000000000000000000_by_1", + "typeString": "int_const 1000...(25 digits omitted)...0000" + } + }, + "src": "29398:17:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 9686, + "nodeType": "IfStatement", + "src": "29394:103:52", + "trueBody": { + "id": 9685, + "nodeType": "Block", + "src": "29417:80:52", + "statements": [ + { + "expression": { + "id": 9679, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 9675, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9644, + "src": "29435:5:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "/=", + "rightHandSide": { + "commonType": { + "typeIdentifier": "t_rational_100000000000000000000000000000000_by_1", + "typeString": "int_const 1000...(25 digits omitted)...0000" + }, + "id": 9678, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "leftExpression": { + "hexValue": "3130", + "id": 9676, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "29444:2:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_10_by_1", + "typeString": "int_const 10" + }, + "value": "10" + }, + "nodeType": "BinaryOperation", + "operator": "**", + "rightExpression": { + "hexValue": "3332", + "id": 9677, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "29450:2:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_32_by_1", + "typeString": "int_const 32" + }, + "value": "32" + }, + "src": "29444:8:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_100000000000000000000000000000000_by_1", + "typeString": "int_const 1000...(25 digits omitted)...0000" + } + }, + "src": "29435:17:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 9680, + "nodeType": "ExpressionStatement", + "src": "29435:17:52" + }, + { + "expression": { + "id": 9683, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 9681, + "name": "result", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9650, + "src": "29470:6:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "+=", + "rightHandSide": { + "hexValue": "3332", + "id": 9682, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "29480:2:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_32_by_1", + "typeString": "int_const 32" + }, + "value": "32" + }, + "src": "29470:12:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 9684, + "nodeType": "ExpressionStatement", + "src": "29470:12:52" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9691, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 9687, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9644, + "src": "29514:5:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_rational_10000000000000000_by_1", + "typeString": "int_const 10000000000000000" + }, + "id": 9690, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "leftExpression": { + "hexValue": "3130", + "id": 9688, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "29523:2:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_10_by_1", + "typeString": "int_const 10" + }, + "value": "10" + }, + "nodeType": "BinaryOperation", + "operator": "**", + "rightExpression": { + "hexValue": "3136", + "id": 9689, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "29529:2:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_16_by_1", + "typeString": "int_const 16" + }, + "value": "16" + }, + "src": "29523:8:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_10000000000000000_by_1", + "typeString": "int_const 10000000000000000" + } + }, + "src": "29514:17:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 9703, + "nodeType": "IfStatement", + "src": "29510:103:52", + "trueBody": { + "id": 9702, + "nodeType": "Block", + "src": "29533:80:52", + "statements": [ + { + "expression": { + "id": 9696, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 9692, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9644, + "src": "29551:5:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "/=", + "rightHandSide": { + "commonType": { + "typeIdentifier": "t_rational_10000000000000000_by_1", + "typeString": "int_const 10000000000000000" + }, + "id": 9695, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "leftExpression": { + "hexValue": "3130", + "id": 9693, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "29560:2:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_10_by_1", + "typeString": "int_const 10" + }, + "value": "10" + }, + "nodeType": "BinaryOperation", + "operator": "**", + "rightExpression": { + "hexValue": "3136", + "id": 9694, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "29566:2:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_16_by_1", + "typeString": "int_const 16" + }, + "value": "16" + }, + "src": "29560:8:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_10000000000000000_by_1", + "typeString": "int_const 10000000000000000" + } + }, + "src": "29551:17:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 9697, + "nodeType": "ExpressionStatement", + "src": "29551:17:52" + }, + { + "expression": { + "id": 9700, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 9698, + "name": "result", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9650, + "src": "29586:6:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "+=", + "rightHandSide": { + "hexValue": "3136", + "id": 9699, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "29596:2:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_16_by_1", + "typeString": "int_const 16" + }, + "value": "16" + }, + "src": "29586:12:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 9701, + "nodeType": "ExpressionStatement", + "src": "29586:12:52" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9708, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 9704, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9644, + "src": "29630:5:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_rational_100000000_by_1", + "typeString": "int_const 100000000" + }, + "id": 9707, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "leftExpression": { + "hexValue": "3130", + "id": 9705, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "29639:2:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_10_by_1", + "typeString": "int_const 10" + }, + "value": "10" + }, + "nodeType": "BinaryOperation", + "operator": "**", + "rightExpression": { + "hexValue": "38", + "id": 9706, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "29645:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_8_by_1", + "typeString": "int_const 8" + }, + "value": "8" + }, + "src": "29639:7:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_100000000_by_1", + "typeString": "int_const 100000000" + } + }, + "src": "29630:16:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 9720, + "nodeType": "IfStatement", + "src": "29626:100:52", + "trueBody": { + "id": 9719, + "nodeType": "Block", + "src": "29648:78:52", + "statements": [ + { + "expression": { + "id": 9713, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 9709, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9644, + "src": "29666:5:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "/=", + "rightHandSide": { + "commonType": { + "typeIdentifier": "t_rational_100000000_by_1", + "typeString": "int_const 100000000" + }, + "id": 9712, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "leftExpression": { + "hexValue": "3130", + "id": 9710, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "29675:2:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_10_by_1", + "typeString": "int_const 10" + }, + "value": "10" + }, + "nodeType": "BinaryOperation", + "operator": "**", + "rightExpression": { + "hexValue": "38", + "id": 9711, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "29681:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_8_by_1", + "typeString": "int_const 8" + }, + "value": "8" + }, + "src": "29675:7:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_100000000_by_1", + "typeString": "int_const 100000000" + } + }, + "src": "29666:16:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 9714, + "nodeType": "ExpressionStatement", + "src": "29666:16:52" + }, + { + "expression": { + "id": 9717, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 9715, + "name": "result", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9650, + "src": "29700:6:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "+=", + "rightHandSide": { + "hexValue": "38", + "id": 9716, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "29710:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_8_by_1", + "typeString": "int_const 8" + }, + "value": "8" + }, + "src": "29700:11:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 9718, + "nodeType": "ExpressionStatement", + "src": "29700:11:52" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9725, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 9721, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9644, + "src": "29743:5:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_rational_10000_by_1", + "typeString": "int_const 10000" + }, + "id": 9724, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "leftExpression": { + "hexValue": "3130", + "id": 9722, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "29752:2:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_10_by_1", + "typeString": "int_const 10" + }, + "value": "10" + }, + "nodeType": "BinaryOperation", + "operator": "**", + "rightExpression": { + "hexValue": "34", + "id": 9723, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "29758:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_4_by_1", + "typeString": "int_const 4" + }, + "value": "4" + }, + "src": "29752:7:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_10000_by_1", + "typeString": "int_const 10000" + } + }, + "src": "29743:16:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 9737, + "nodeType": "IfStatement", + "src": "29739:100:52", + "trueBody": { + "id": 9736, + "nodeType": "Block", + "src": "29761:78:52", + "statements": [ + { + "expression": { + "id": 9730, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 9726, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9644, + "src": "29779:5:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "/=", + "rightHandSide": { + "commonType": { + "typeIdentifier": "t_rational_10000_by_1", + "typeString": "int_const 10000" + }, + "id": 9729, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "leftExpression": { + "hexValue": "3130", + "id": 9727, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "29788:2:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_10_by_1", + "typeString": "int_const 10" + }, + "value": "10" + }, + "nodeType": "BinaryOperation", + "operator": "**", + "rightExpression": { + "hexValue": "34", + "id": 9728, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "29794:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_4_by_1", + "typeString": "int_const 4" + }, + "value": "4" + }, + "src": "29788:7:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_10000_by_1", + "typeString": "int_const 10000" + } + }, + "src": "29779:16:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 9731, + "nodeType": "ExpressionStatement", + "src": "29779:16:52" + }, + { + "expression": { + "id": 9734, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 9732, + "name": "result", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9650, + "src": "29813:6:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "+=", + "rightHandSide": { + "hexValue": "34", + "id": 9733, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "29823:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_4_by_1", + "typeString": "int_const 4" + }, + "value": "4" + }, + "src": "29813:11:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 9735, + "nodeType": "ExpressionStatement", + "src": "29813:11:52" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9742, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 9738, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9644, + "src": "29856:5:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_rational_100_by_1", + "typeString": "int_const 100" + }, + "id": 9741, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "leftExpression": { + "hexValue": "3130", + "id": 9739, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "29865:2:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_10_by_1", + "typeString": "int_const 10" + }, + "value": "10" + }, + "nodeType": "BinaryOperation", + "operator": "**", + "rightExpression": { + "hexValue": "32", + "id": 9740, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "29871:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_2_by_1", + "typeString": "int_const 2" + }, + "value": "2" + }, + "src": "29865:7:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_100_by_1", + "typeString": "int_const 100" + } + }, + "src": "29856:16:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 9754, + "nodeType": "IfStatement", + "src": "29852:100:52", + "trueBody": { + "id": 9753, + "nodeType": "Block", + "src": "29874:78:52", + "statements": [ + { + "expression": { + "id": 9747, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 9743, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9644, + "src": "29892:5:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "/=", + "rightHandSide": { + "commonType": { + "typeIdentifier": "t_rational_100_by_1", + "typeString": "int_const 100" + }, + "id": 9746, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "leftExpression": { + "hexValue": "3130", + "id": 9744, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "29901:2:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_10_by_1", + "typeString": "int_const 10" + }, + "value": "10" + }, + "nodeType": "BinaryOperation", + "operator": "**", + "rightExpression": { + "hexValue": "32", + "id": 9745, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "29907:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_2_by_1", + "typeString": "int_const 2" + }, + "value": "2" + }, + "src": "29901:7:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_100_by_1", + "typeString": "int_const 100" + } + }, + "src": "29892:16:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 9748, + "nodeType": "ExpressionStatement", + "src": "29892:16:52" + }, + { + "expression": { + "id": 9751, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 9749, + "name": "result", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9650, + "src": "29926:6:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "+=", + "rightHandSide": { + "hexValue": "32", + "id": 9750, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "29936:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_2_by_1", + "typeString": "int_const 2" + }, + "value": "2" + }, + "src": "29926:11:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 9752, + "nodeType": "ExpressionStatement", + "src": "29926:11:52" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9759, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 9755, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9644, + "src": "29969:5:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_rational_10_by_1", + "typeString": "int_const 10" + }, + "id": 9758, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "leftExpression": { + "hexValue": "3130", + "id": 9756, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "29978:2:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_10_by_1", + "typeString": "int_const 10" + }, + "value": "10" + }, + "nodeType": "BinaryOperation", + "operator": "**", + "rightExpression": { + "hexValue": "31", + "id": 9757, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "29984:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "29978:7:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_10_by_1", + "typeString": "int_const 10" + } + }, + "src": "29969:16:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 9765, + "nodeType": "IfStatement", + "src": "29965:66:52", + "trueBody": { + "id": 9764, + "nodeType": "Block", + "src": "29987:44:52", + "statements": [ + { + "expression": { + "id": 9762, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 9760, + "name": "result", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9650, + "src": "30005:6:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "+=", + "rightHandSide": { + "hexValue": "31", + "id": 9761, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "30015:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "30005:11:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 9763, + "nodeType": "ExpressionStatement", + "src": "30005:11:52" + } + ] + } + } + ] + }, + { + "expression": { + "id": 9767, + "name": "result", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9650, + "src": "30057:6:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 9648, + "id": 9768, + "nodeType": "Return", + "src": "30050:13:52" + } + ] + }, + "documentation": { + "id": 9642, + "nodeType": "StructuredDocumentation", + "src": "29029:120:52", + "text": " @dev Return the log in base 10 of a positive value rounded towards zero.\n Returns 0 if given 0." + }, + "id": 9770, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "log10", + "nameLocation": "29163:5:52", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 9645, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 9644, + "mutability": "mutable", + "name": "value", + "nameLocation": "29177:5:52", + "nodeType": "VariableDeclaration", + "scope": 9770, + "src": "29169:13:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 9643, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "29169:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "29168:15:52" + }, + "returnParameters": { + "id": 9648, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 9647, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 9770, + "src": "29207:7:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 9646, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "29207:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "29206:9:52" + }, + "scope": 9938, + "src": "29154:916:52", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 9803, + "nodeType": "Block", + "src": "30305:177:52", + "statements": [ + { + "id": 9802, + "nodeType": "UncheckedBlock", + "src": "30315:161:52", + "statements": [ + { + "assignments": [ + 9782 + ], + "declarations": [ + { + "constant": false, + "id": 9782, + "mutability": "mutable", + "name": "result", + "nameLocation": "30347:6:52", + "nodeType": "VariableDeclaration", + "scope": 9802, + "src": "30339:14:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 9781, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "30339:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 9786, + "initialValue": { + "arguments": [ + { + "id": 9784, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9773, + "src": "30362:5:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 9783, + "name": "log10", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 9770, + 9804 + ], + "referencedDeclaration": 9770, + "src": "30356:5:52", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256) pure returns (uint256)" + } + }, + "id": 9785, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "30356:12:52", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "30339:29:52" + }, + { + "expression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9800, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 9787, + "name": "result", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9782, + "src": "30389:6:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 9798, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "arguments": [ + { + "id": 9791, + "name": "rounding", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9776, + "src": "30431:8:52", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Rounding_$8329", + "typeString": "enum Math.Rounding" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_Rounding_$8329", + "typeString": "enum Math.Rounding" + } + ], + "id": 9790, + "name": "unsignedRoundsUp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9937, + "src": "30414:16:52", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_enum$_Rounding_$8329_$returns$_t_bool_$", + "typeString": "function (enum Math.Rounding) pure returns (bool)" + } + }, + "id": 9792, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "30414:26:52", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "&&", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9797, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9795, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "hexValue": "3130", + "id": 9793, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "30444:2:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_10_by_1", + "typeString": "int_const 10" + }, + "value": "10" + }, + "nodeType": "BinaryOperation", + "operator": "**", + "rightExpression": { + "id": 9794, + "name": "result", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9782, + "src": "30450:6:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "30444:12:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "id": 9796, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9773, + "src": "30459:5:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "30444:20:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "30414:50:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "expression": { + "id": 9788, + "name": "SafeCast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11703, + "src": "30398:8:52", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_SafeCast_$11703_$", + "typeString": "type(library SafeCast)" + } + }, + "id": 9789, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "30407:6:52", + "memberName": "toUint", + "nodeType": "MemberAccess", + "referencedDeclaration": 11702, + "src": "30398:15:52", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_bool_$returns$_t_uint256_$", + "typeString": "function (bool) pure returns (uint256)" + } + }, + "id": 9799, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "30398:67:52", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "30389:76:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 9780, + "id": 9801, + "nodeType": "Return", + "src": "30382:83:52" + } + ] + } + ] + }, + "documentation": { + "id": 9771, + "nodeType": "StructuredDocumentation", + "src": "30076:143:52", + "text": " @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n Returns 0 if given 0." + }, + "id": 9804, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "log10", + "nameLocation": "30233:5:52", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 9777, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 9773, + "mutability": "mutable", + "name": "value", + "nameLocation": "30247:5:52", + "nodeType": "VariableDeclaration", + "scope": 9804, + "src": "30239:13:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 9772, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "30239:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 9776, + "mutability": "mutable", + "name": "rounding", + "nameLocation": "30263:8:52", + "nodeType": "VariableDeclaration", + "scope": 9804, + "src": "30254:17:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Rounding_$8329", + "typeString": "enum Math.Rounding" + }, + "typeName": { + "id": 9775, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 9774, + "name": "Rounding", + "nameLocations": [ + "30254:8:52" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 8329, + "src": "30254:8:52" + }, + "referencedDeclaration": 8329, + "src": "30254:8:52", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Rounding_$8329", + "typeString": "enum Math.Rounding" + } + }, + "visibility": "internal" + } + ], + "src": "30238:34:52" + }, + "returnParameters": { + "id": 9780, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 9779, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 9804, + "src": "30296:7:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 9778, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "30296:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "30295:9:52" + }, + "scope": 9938, + "src": "30224:258:52", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 9880, + "nodeType": "Block", + "src": "30800:675:52", + "statements": [ + { + "expression": { + "id": 9821, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 9812, + "name": "r", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9810, + "src": "30882:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9820, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9817, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 9815, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9807, + "src": "30902:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "hexValue": "30786666666666666666666666666666666666666666666666666666666666666666", + "id": 9816, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "30906:34:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_340282366920938463463374607431768211455_by_1", + "typeString": "int_const 3402...(31 digits omitted)...1455" + }, + "value": "0xffffffffffffffffffffffffffffffff" + }, + "src": "30902:38:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "expression": { + "id": 9813, + "name": "SafeCast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11703, + "src": "30886:8:52", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_SafeCast_$11703_$", + "typeString": "type(library SafeCast)" + } + }, + "id": 9814, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "30895:6:52", + "memberName": "toUint", + "nodeType": "MemberAccess", + "referencedDeclaration": 11702, + "src": "30886:15:52", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_bool_$returns$_t_uint256_$", + "typeString": "function (bool) pure returns (uint256)" + } + }, + "id": 9818, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "30886:55:52", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<<", + "rightExpression": { + "hexValue": "37", + "id": 9819, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "30945:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_7_by_1", + "typeString": "int_const 7" + }, + "value": "7" + }, + "src": "30886:60:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "30882:64:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 9822, + "nodeType": "ExpressionStatement", + "src": "30882:64:52" + }, + { + "expression": { + "id": 9835, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 9823, + "name": "r", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9810, + "src": "31022:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "|=", + "rightHandSide": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9834, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9831, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9828, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 9826, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9807, + "src": "31044:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">>", + "rightExpression": { + "id": 9827, + "name": "r", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9810, + "src": "31049:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "31044:6:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 9829, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "31043:8:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "hexValue": "307866666666666666666666666666666666", + "id": 9830, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "31054:18:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_18446744073709551615_by_1", + "typeString": "int_const 18446744073709551615" + }, + "value": "0xffffffffffffffff" + }, + "src": "31043:29:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "expression": { + "id": 9824, + "name": "SafeCast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11703, + "src": "31027:8:52", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_SafeCast_$11703_$", + "typeString": "type(library SafeCast)" + } + }, + "id": 9825, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "31036:6:52", + "memberName": "toUint", + "nodeType": "MemberAccess", + "referencedDeclaration": 11702, + "src": "31027:15:52", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_bool_$returns$_t_uint256_$", + "typeString": "function (bool) pure returns (uint256)" + } + }, + "id": 9832, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "31027:46:52", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<<", + "rightExpression": { + "hexValue": "36", + "id": 9833, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "31077:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_6_by_1", + "typeString": "int_const 6" + }, + "value": "6" + }, + "src": "31027:51:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "31022:56:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 9836, + "nodeType": "ExpressionStatement", + "src": "31022:56:52" + }, + { + "expression": { + "id": 9849, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 9837, + "name": "r", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9810, + "src": "31153:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "|=", + "rightHandSide": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9848, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9845, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9842, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 9840, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9807, + "src": "31175:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">>", + "rightExpression": { + "id": 9841, + "name": "r", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9810, + "src": "31180:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "31175:6:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 9843, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "31174:8:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "hexValue": "30786666666666666666", + "id": 9844, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "31185:10:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_4294967295_by_1", + "typeString": "int_const 4294967295" + }, + "value": "0xffffffff" + }, + "src": "31174:21:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "expression": { + "id": 9838, + "name": "SafeCast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11703, + "src": "31158:8:52", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_SafeCast_$11703_$", + "typeString": "type(library SafeCast)" + } + }, + "id": 9839, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "31167:6:52", + "memberName": "toUint", + "nodeType": "MemberAccess", + "referencedDeclaration": 11702, + "src": "31158:15:52", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_bool_$returns$_t_uint256_$", + "typeString": "function (bool) pure returns (uint256)" + } + }, + "id": 9846, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "31158:38:52", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<<", + "rightExpression": { + "hexValue": "35", + "id": 9847, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "31200:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_5_by_1", + "typeString": "int_const 5" + }, + "value": "5" + }, + "src": "31158:43:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "31153:48:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 9850, + "nodeType": "ExpressionStatement", + "src": "31153:48:52" + }, + { + "expression": { + "id": 9863, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 9851, + "name": "r", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9810, + "src": "31276:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "|=", + "rightHandSide": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9862, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9859, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9856, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 9854, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9807, + "src": "31298:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">>", + "rightExpression": { + "id": 9855, + "name": "r", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9810, + "src": "31303:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "31298:6:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 9857, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "31297:8:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "hexValue": "307866666666", + "id": 9858, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "31308:6:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_65535_by_1", + "typeString": "int_const 65535" + }, + "value": "0xffff" + }, + "src": "31297:17:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "expression": { + "id": 9852, + "name": "SafeCast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11703, + "src": "31281:8:52", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_SafeCast_$11703_$", + "typeString": "type(library SafeCast)" + } + }, + "id": 9853, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "31290:6:52", + "memberName": "toUint", + "nodeType": "MemberAccess", + "referencedDeclaration": 11702, + "src": "31281:15:52", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_bool_$returns$_t_uint256_$", + "typeString": "function (bool) pure returns (uint256)" + } + }, + "id": 9860, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "31281:34:52", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<<", + "rightExpression": { + "hexValue": "34", + "id": 9861, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "31319:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_4_by_1", + "typeString": "int_const 4" + }, + "value": "4" + }, + "src": "31281:39:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "31276:44:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 9864, + "nodeType": "ExpressionStatement", + "src": "31276:44:52" + }, + { + "expression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9878, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9867, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 9865, + "name": "r", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9810, + "src": "31426:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">>", + "rightExpression": { + "hexValue": "33", + "id": 9866, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "31431:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_3_by_1", + "typeString": "int_const 3" + }, + "value": "3" + }, + "src": "31426:6:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 9868, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "31425:8:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "|", + "rightExpression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9876, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9873, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 9871, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9807, + "src": "31453:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">>", + "rightExpression": { + "id": 9872, + "name": "r", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9810, + "src": "31458:1:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "31453:6:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 9874, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "31452:8:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "hexValue": "30786666", + "id": 9875, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "31463:4:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_255_by_1", + "typeString": "int_const 255" + }, + "value": "0xff" + }, + "src": "31452:15:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "expression": { + "id": 9869, + "name": "SafeCast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11703, + "src": "31436:8:52", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_SafeCast_$11703_$", + "typeString": "type(library SafeCast)" + } + }, + "id": 9870, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "31445:6:52", + "memberName": "toUint", + "nodeType": "MemberAccess", + "referencedDeclaration": 11702, + "src": "31436:15:52", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_bool_$returns$_t_uint256_$", + "typeString": "function (bool) pure returns (uint256)" + } + }, + "id": 9877, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "31436:32:52", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "31425:43:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 9811, + "id": 9879, + "nodeType": "Return", + "src": "31418:50:52" + } + ] + }, + "documentation": { + "id": 9805, + "nodeType": "StructuredDocumentation", + "src": "30488:246:52", + "text": " @dev Return the log in base 256 of a positive value rounded towards zero.\n Returns 0 if given 0.\n Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string." + }, + "id": 9881, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "log256", + "nameLocation": "30748:6:52", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 9808, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 9807, + "mutability": "mutable", + "name": "x", + "nameLocation": "30763:1:52", + "nodeType": "VariableDeclaration", + "scope": 9881, + "src": "30755:9:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 9806, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "30755:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "30754:11:52" + }, + "returnParameters": { + "id": 9811, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 9810, + "mutability": "mutable", + "name": "r", + "nameLocation": "30797:1:52", + "nodeType": "VariableDeclaration", + "scope": 9881, + "src": "30789:9:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 9809, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "30789:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "30788:11:52" + }, + "scope": 9938, + "src": "30739:736:52", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 9917, + "nodeType": "Block", + "src": "31712:184:52", + "statements": [ + { + "id": 9916, + "nodeType": "UncheckedBlock", + "src": "31722:168:52", + "statements": [ + { + "assignments": [ + 9893 + ], + "declarations": [ + { + "constant": false, + "id": 9893, + "mutability": "mutable", + "name": "result", + "nameLocation": "31754:6:52", + "nodeType": "VariableDeclaration", + "scope": 9916, + "src": "31746:14:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 9892, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "31746:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 9897, + "initialValue": { + "arguments": [ + { + "id": 9895, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9884, + "src": "31770:5:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 9894, + "name": "log256", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 9881, + 9918 + ], + "referencedDeclaration": 9881, + "src": "31763:6:52", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256) pure returns (uint256)" + } + }, + "id": 9896, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "31763:13:52", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "31746:30:52" + }, + { + "expression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9914, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 9898, + "name": "result", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9893, + "src": "31797:6:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 9912, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "arguments": [ + { + "id": 9902, + "name": "rounding", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9887, + "src": "31839:8:52", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Rounding_$8329", + "typeString": "enum Math.Rounding" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_Rounding_$8329", + "typeString": "enum Math.Rounding" + } + ], + "id": 9901, + "name": "unsignedRoundsUp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9937, + "src": "31822:16:52", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_enum$_Rounding_$8329_$returns$_t_bool_$", + "typeString": "function (enum Math.Rounding) pure returns (bool)" + } + }, + "id": 9903, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "31822:26:52", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "&&", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9911, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9909, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "hexValue": "31", + "id": 9904, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "31852:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "nodeType": "BinaryOperation", + "operator": "<<", + "rightExpression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9907, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 9905, + "name": "result", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9893, + "src": "31858:6:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<<", + "rightExpression": { + "hexValue": "33", + "id": 9906, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "31868:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_3_by_1", + "typeString": "int_const 3" + }, + "value": "3" + }, + "src": "31858:11:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 9908, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "31857:13:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "31852:18:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "id": 9910, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9884, + "src": "31873:5:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "31852:26:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "31822:56:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "expression": { + "id": 9899, + "name": "SafeCast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11703, + "src": "31806:8:52", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_SafeCast_$11703_$", + "typeString": "type(library SafeCast)" + } + }, + "id": 9900, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "31815:6:52", + "memberName": "toUint", + "nodeType": "MemberAccess", + "referencedDeclaration": 11702, + "src": "31806:15:52", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_bool_$returns$_t_uint256_$", + "typeString": "function (bool) pure returns (uint256)" + } + }, + "id": 9913, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "31806:73:52", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "31797:82:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 9891, + "id": 9915, + "nodeType": "Return", + "src": "31790:89:52" + } + ] + } + ] + }, + "documentation": { + "id": 9882, + "nodeType": "StructuredDocumentation", + "src": "31481:144:52", + "text": " @dev Return the log in base 256, following the selected rounding direction, of a positive value.\n Returns 0 if given 0." + }, + "id": 9918, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "log256", + "nameLocation": "31639:6:52", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 9888, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 9884, + "mutability": "mutable", + "name": "value", + "nameLocation": "31654:5:52", + "nodeType": "VariableDeclaration", + "scope": 9918, + "src": "31646:13:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 9883, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "31646:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 9887, + "mutability": "mutable", + "name": "rounding", + "nameLocation": "31670:8:52", + "nodeType": "VariableDeclaration", + "scope": 9918, + "src": "31661:17:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Rounding_$8329", + "typeString": "enum Math.Rounding" + }, + "typeName": { + "id": 9886, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 9885, + "name": "Rounding", + "nameLocations": [ + "31661:8:52" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 8329, + "src": "31661:8:52" + }, + "referencedDeclaration": 8329, + "src": "31661:8:52", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Rounding_$8329", + "typeString": "enum Math.Rounding" + } + }, + "visibility": "internal" + } + ], + "src": "31645:34:52" + }, + "returnParameters": { + "id": 9891, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 9890, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 9918, + "src": "31703:7:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 9889, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "31703:7:52", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "31702:9:52" + }, + "scope": 9938, + "src": "31630:266:52", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 9936, + "nodeType": "Block", + "src": "32094:48:52", + "statements": [ + { + "expression": { + "commonType": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "id": 9934, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "commonType": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "id": 9932, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "arguments": [ + { + "id": 9929, + "name": "rounding", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9922, + "src": "32117:8:52", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Rounding_$8329", + "typeString": "enum Math.Rounding" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_Rounding_$8329", + "typeString": "enum Math.Rounding" + } + ], + "id": 9928, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "32111:5:52", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint8_$", + "typeString": "type(uint8)" + }, + "typeName": { + "id": 9927, + "name": "uint8", + "nodeType": "ElementaryTypeName", + "src": "32111:5:52", + "typeDescriptions": {} + } + }, + "id": 9930, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "32111:15:52", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "nodeType": "BinaryOperation", + "operator": "%", + "rightExpression": { + "hexValue": "32", + "id": 9931, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "32129:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_2_by_1", + "typeString": "int_const 2" + }, + "value": "2" + }, + "src": "32111:19:52", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "31", + "id": 9933, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "32134:1:52", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "32111:24:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "functionReturnParameters": 9926, + "id": 9935, + "nodeType": "Return", + "src": "32104:31:52" + } + ] + }, + "documentation": { + "id": 9919, + "nodeType": "StructuredDocumentation", + "src": "31902:113:52", + "text": " @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers." + }, + "id": 9937, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "unsignedRoundsUp", + "nameLocation": "32029:16:52", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 9923, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 9922, + "mutability": "mutable", + "name": "rounding", + "nameLocation": "32055:8:52", + "nodeType": "VariableDeclaration", + "scope": 9937, + "src": "32046:17:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Rounding_$8329", + "typeString": "enum Math.Rounding" + }, + "typeName": { + "id": 9921, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 9920, + "name": "Rounding", + "nameLocations": [ + "32046:8:52" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 8329, + "src": "32046:8:52" + }, + "referencedDeclaration": 8329, + "src": "32046:8:52", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Rounding_$8329", + "typeString": "enum Math.Rounding" + } + }, + "visibility": "internal" + } + ], + "src": "32045:19:52" + }, + "returnParameters": { + "id": 9926, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 9925, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 9937, + "src": "32088:4:52", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 9924, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "32088:4:52", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "src": "32087:6:52" + }, + "scope": 9938, + "src": "32020:122:52", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + } + ], + "scope": 9939, + "src": "281:31863:52", + "usedErrors": [], + "usedEvents": [] + } + ], + "src": "103:32042:52" + }, + "id": 52 + }, + "@openzeppelin/contracts/utils/math/SafeCast.sol": { + "ast": { + "absolutePath": "@openzeppelin/contracts/utils/math/SafeCast.sol", + "exportedSymbols": { + "SafeCast": [ + 11703 + ] + }, + "id": 11704, + "license": "MIT", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 9940, + "literals": [ + "solidity", + "^", + "0.8", + ".20" + ], + "nodeType": "PragmaDirective", + "src": "192:24:53" + }, + { + "abstract": false, + "baseContracts": [], + "canonicalName": "SafeCast", + "contractDependencies": [], + "contractKind": "library", + "documentation": { + "id": 9941, + "nodeType": "StructuredDocumentation", + "src": "218:550:53", + "text": " @dev Wrappers over Solidity's uintXX/intXX/bool casting operators with added overflow\n checks.\n Downcasting from uint256/int256 in Solidity does not revert on overflow. This can\n easily result in undesired exploitation or bugs, since developers usually\n assume that overflows raise errors. `SafeCast` restores this intuition by\n reverting the transaction when such an operation overflows.\n Using this library instead of the unchecked operations eliminates an entire\n class of bugs, so it's recommended to use it always." + }, + "fullyImplemented": true, + "id": 11703, + "linearizedBaseContracts": [ + 11703 + ], + "name": "SafeCast", + "nameLocation": "777:8:53", + "nodeType": "ContractDefinition", + "nodes": [ + { + "documentation": { + "id": 9942, + "nodeType": "StructuredDocumentation", + "src": "792:68:53", + "text": " @dev Value doesn't fit in an uint of `bits` size." + }, + "errorSelector": "6dfcc650", + "id": 9948, + "name": "SafeCastOverflowedUintDowncast", + "nameLocation": "871:30:53", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 9947, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 9944, + "mutability": "mutable", + "name": "bits", + "nameLocation": "908:4:53", + "nodeType": "VariableDeclaration", + "scope": 9948, + "src": "902:10:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "typeName": { + "id": 9943, + "name": "uint8", + "nodeType": "ElementaryTypeName", + "src": "902:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 9946, + "mutability": "mutable", + "name": "value", + "nameLocation": "922:5:53", + "nodeType": "VariableDeclaration", + "scope": 9948, + "src": "914:13:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 9945, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "914:7:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "901:27:53" + }, + "src": "865:64:53" + }, + { + "documentation": { + "id": 9949, + "nodeType": "StructuredDocumentation", + "src": "935:75:53", + "text": " @dev An int value doesn't fit in an uint of `bits` size." + }, + "errorSelector": "a8ce4432", + "id": 9953, + "name": "SafeCastOverflowedIntToUint", + "nameLocation": "1021:27:53", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 9952, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 9951, + "mutability": "mutable", + "name": "value", + "nameLocation": "1056:5:53", + "nodeType": "VariableDeclaration", + "scope": 9953, + "src": "1049:12:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "typeName": { + "id": 9950, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "1049:6:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "visibility": "internal" + } + ], + "src": "1048:14:53" + }, + "src": "1015:48:53" + }, + { + "documentation": { + "id": 9954, + "nodeType": "StructuredDocumentation", + "src": "1069:67:53", + "text": " @dev Value doesn't fit in an int of `bits` size." + }, + "errorSelector": "327269a7", + "id": 9960, + "name": "SafeCastOverflowedIntDowncast", + "nameLocation": "1147:29:53", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 9959, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 9956, + "mutability": "mutable", + "name": "bits", + "nameLocation": "1183:4:53", + "nodeType": "VariableDeclaration", + "scope": 9960, + "src": "1177:10:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "typeName": { + "id": 9955, + "name": "uint8", + "nodeType": "ElementaryTypeName", + "src": "1177:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 9958, + "mutability": "mutable", + "name": "value", + "nameLocation": "1196:5:53", + "nodeType": "VariableDeclaration", + "scope": 9960, + "src": "1189:12:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "typeName": { + "id": 9957, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "1189:6:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "visibility": "internal" + } + ], + "src": "1176:26:53" + }, + "src": "1141:62:53" + }, + { + "documentation": { + "id": 9961, + "nodeType": "StructuredDocumentation", + "src": "1209:75:53", + "text": " @dev An uint value doesn't fit in an int of `bits` size." + }, + "errorSelector": "24775e06", + "id": 9965, + "name": "SafeCastOverflowedUintToInt", + "nameLocation": "1295:27:53", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 9964, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 9963, + "mutability": "mutable", + "name": "value", + "nameLocation": "1331:5:53", + "nodeType": "VariableDeclaration", + "scope": 9965, + "src": "1323:13:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 9962, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1323:7:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "1322:15:53" + }, + "src": "1289:49:53" + }, + { + "body": { + "id": 9992, + "nodeType": "Block", + "src": "1695:152:53", + "statements": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 9979, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 9973, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9968, + "src": "1709:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "expression": { + "arguments": [ + { + "id": 9976, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "1722:7:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint248_$", + "typeString": "type(uint248)" + }, + "typeName": { + "id": 9975, + "name": "uint248", + "nodeType": "ElementaryTypeName", + "src": "1722:7:53", + "typeDescriptions": {} + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_type$_t_uint248_$", + "typeString": "type(uint248)" + } + ], + "id": 9974, + "name": "type", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -27, + "src": "1717:4:53", + "typeDescriptions": { + "typeIdentifier": "t_function_metatype_pure$__$returns$__$", + "typeString": "function () pure" + } + }, + "id": 9977, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "1717:13:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_magic_meta_type_t_uint248", + "typeString": "type(uint248)" + } + }, + "id": 9978, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "1731:3:53", + "memberName": "max", + "nodeType": "MemberAccess", + "src": "1717:17:53", + "typeDescriptions": { + "typeIdentifier": "t_uint248", + "typeString": "uint248" + } + }, + "src": "1709:25:53", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 9986, + "nodeType": "IfStatement", + "src": "1705:105:53", + "trueBody": { + "id": 9985, + "nodeType": "Block", + "src": "1736:74:53", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "hexValue": "323438", + "id": 9981, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1788:3:53", + "typeDescriptions": { + "typeIdentifier": "t_rational_248_by_1", + "typeString": "int_const 248" + }, + "value": "248" + }, + { + "id": 9982, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9968, + "src": "1793:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_248_by_1", + "typeString": "int_const 248" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 9980, + "name": "SafeCastOverflowedUintDowncast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9948, + "src": "1757:30:53", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint8_$_t_uint256_$returns$_t_error_$", + "typeString": "function (uint8,uint256) pure returns (error)" + } + }, + "id": 9983, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "1757:42:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 9984, + "nodeType": "RevertStatement", + "src": "1750:49:53" + } + ] + } + }, + { + "expression": { + "arguments": [ + { + "id": 9989, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9968, + "src": "1834:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 9988, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "1826:7:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint248_$", + "typeString": "type(uint248)" + }, + "typeName": { + "id": 9987, + "name": "uint248", + "nodeType": "ElementaryTypeName", + "src": "1826:7:53", + "typeDescriptions": {} + } + }, + "id": 9990, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "1826:14:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint248", + "typeString": "uint248" + } + }, + "functionReturnParameters": 9972, + "id": 9991, + "nodeType": "Return", + "src": "1819:21:53" + } + ] + }, + "documentation": { + "id": 9966, + "nodeType": "StructuredDocumentation", + "src": "1344:280:53", + "text": " @dev Returns the downcasted uint248 from uint256, reverting on\n overflow (when the input is greater than largest uint248).\n Counterpart to Solidity's `uint248` operator.\n Requirements:\n - input must fit into 248 bits" + }, + "id": 9993, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toUint248", + "nameLocation": "1638:9:53", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 9969, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 9968, + "mutability": "mutable", + "name": "value", + "nameLocation": "1656:5:53", + "nodeType": "VariableDeclaration", + "scope": 9993, + "src": "1648:13:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 9967, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1648:7:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "1647:15:53" + }, + "returnParameters": { + "id": 9972, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 9971, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 9993, + "src": "1686:7:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint248", + "typeString": "uint248" + }, + "typeName": { + "id": 9970, + "name": "uint248", + "nodeType": "ElementaryTypeName", + "src": "1686:7:53", + "typeDescriptions": { + "typeIdentifier": "t_uint248", + "typeString": "uint248" + } + }, + "visibility": "internal" + } + ], + "src": "1685:9:53" + }, + "scope": 11703, + "src": "1629:218:53", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 10020, + "nodeType": "Block", + "src": "2204:152:53", + "statements": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 10007, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 10001, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9996, + "src": "2218:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "expression": { + "arguments": [ + { + "id": 10004, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "2231:7:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint240_$", + "typeString": "type(uint240)" + }, + "typeName": { + "id": 10003, + "name": "uint240", + "nodeType": "ElementaryTypeName", + "src": "2231:7:53", + "typeDescriptions": {} + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_type$_t_uint240_$", + "typeString": "type(uint240)" + } + ], + "id": 10002, + "name": "type", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -27, + "src": "2226:4:53", + "typeDescriptions": { + "typeIdentifier": "t_function_metatype_pure$__$returns$__$", + "typeString": "function () pure" + } + }, + "id": 10005, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2226:13:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_magic_meta_type_t_uint240", + "typeString": "type(uint240)" + } + }, + "id": 10006, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "2240:3:53", + "memberName": "max", + "nodeType": "MemberAccess", + "src": "2226:17:53", + "typeDescriptions": { + "typeIdentifier": "t_uint240", + "typeString": "uint240" + } + }, + "src": "2218:25:53", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 10014, + "nodeType": "IfStatement", + "src": "2214:105:53", + "trueBody": { + "id": 10013, + "nodeType": "Block", + "src": "2245:74:53", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "hexValue": "323430", + "id": 10009, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2297:3:53", + "typeDescriptions": { + "typeIdentifier": "t_rational_240_by_1", + "typeString": "int_const 240" + }, + "value": "240" + }, + { + "id": 10010, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9996, + "src": "2302:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_240_by_1", + "typeString": "int_const 240" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 10008, + "name": "SafeCastOverflowedUintDowncast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9948, + "src": "2266:30:53", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint8_$_t_uint256_$returns$_t_error_$", + "typeString": "function (uint8,uint256) pure returns (error)" + } + }, + "id": 10011, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2266:42:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 10012, + "nodeType": "RevertStatement", + "src": "2259:49:53" + } + ] + } + }, + { + "expression": { + "arguments": [ + { + "id": 10017, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9996, + "src": "2343:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 10016, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "2335:7:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint240_$", + "typeString": "type(uint240)" + }, + "typeName": { + "id": 10015, + "name": "uint240", + "nodeType": "ElementaryTypeName", + "src": "2335:7:53", + "typeDescriptions": {} + } + }, + "id": 10018, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2335:14:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint240", + "typeString": "uint240" + } + }, + "functionReturnParameters": 10000, + "id": 10019, + "nodeType": "Return", + "src": "2328:21:53" + } + ] + }, + "documentation": { + "id": 9994, + "nodeType": "StructuredDocumentation", + "src": "1853:280:53", + "text": " @dev Returns the downcasted uint240 from uint256, reverting on\n overflow (when the input is greater than largest uint240).\n Counterpart to Solidity's `uint240` operator.\n Requirements:\n - input must fit into 240 bits" + }, + "id": 10021, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toUint240", + "nameLocation": "2147:9:53", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 9997, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 9996, + "mutability": "mutable", + "name": "value", + "nameLocation": "2165:5:53", + "nodeType": "VariableDeclaration", + "scope": 10021, + "src": "2157:13:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 9995, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2157:7:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "2156:15:53" + }, + "returnParameters": { + "id": 10000, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 9999, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 10021, + "src": "2195:7:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint240", + "typeString": "uint240" + }, + "typeName": { + "id": 9998, + "name": "uint240", + "nodeType": "ElementaryTypeName", + "src": "2195:7:53", + "typeDescriptions": { + "typeIdentifier": "t_uint240", + "typeString": "uint240" + } + }, + "visibility": "internal" + } + ], + "src": "2194:9:53" + }, + "scope": 11703, + "src": "2138:218:53", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 10048, + "nodeType": "Block", + "src": "2713:152:53", + "statements": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 10035, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 10029, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10024, + "src": "2727:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "expression": { + "arguments": [ + { + "id": 10032, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "2740:7:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint232_$", + "typeString": "type(uint232)" + }, + "typeName": { + "id": 10031, + "name": "uint232", + "nodeType": "ElementaryTypeName", + "src": "2740:7:53", + "typeDescriptions": {} + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_type$_t_uint232_$", + "typeString": "type(uint232)" + } + ], + "id": 10030, + "name": "type", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -27, + "src": "2735:4:53", + "typeDescriptions": { + "typeIdentifier": "t_function_metatype_pure$__$returns$__$", + "typeString": "function () pure" + } + }, + "id": 10033, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2735:13:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_magic_meta_type_t_uint232", + "typeString": "type(uint232)" + } + }, + "id": 10034, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "2749:3:53", + "memberName": "max", + "nodeType": "MemberAccess", + "src": "2735:17:53", + "typeDescriptions": { + "typeIdentifier": "t_uint232", + "typeString": "uint232" + } + }, + "src": "2727:25:53", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 10042, + "nodeType": "IfStatement", + "src": "2723:105:53", + "trueBody": { + "id": 10041, + "nodeType": "Block", + "src": "2754:74:53", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "hexValue": "323332", + "id": 10037, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2806:3:53", + "typeDescriptions": { + "typeIdentifier": "t_rational_232_by_1", + "typeString": "int_const 232" + }, + "value": "232" + }, + { + "id": 10038, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10024, + "src": "2811:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_232_by_1", + "typeString": "int_const 232" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 10036, + "name": "SafeCastOverflowedUintDowncast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9948, + "src": "2775:30:53", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint8_$_t_uint256_$returns$_t_error_$", + "typeString": "function (uint8,uint256) pure returns (error)" + } + }, + "id": 10039, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2775:42:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 10040, + "nodeType": "RevertStatement", + "src": "2768:49:53" + } + ] + } + }, + { + "expression": { + "arguments": [ + { + "id": 10045, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10024, + "src": "2852:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 10044, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "2844:7:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint232_$", + "typeString": "type(uint232)" + }, + "typeName": { + "id": 10043, + "name": "uint232", + "nodeType": "ElementaryTypeName", + "src": "2844:7:53", + "typeDescriptions": {} + } + }, + "id": 10046, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2844:14:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint232", + "typeString": "uint232" + } + }, + "functionReturnParameters": 10028, + "id": 10047, + "nodeType": "Return", + "src": "2837:21:53" + } + ] + }, + "documentation": { + "id": 10022, + "nodeType": "StructuredDocumentation", + "src": "2362:280:53", + "text": " @dev Returns the downcasted uint232 from uint256, reverting on\n overflow (when the input is greater than largest uint232).\n Counterpart to Solidity's `uint232` operator.\n Requirements:\n - input must fit into 232 bits" + }, + "id": 10049, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toUint232", + "nameLocation": "2656:9:53", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 10025, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10024, + "mutability": "mutable", + "name": "value", + "nameLocation": "2674:5:53", + "nodeType": "VariableDeclaration", + "scope": 10049, + "src": "2666:13:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 10023, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2666:7:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "2665:15:53" + }, + "returnParameters": { + "id": 10028, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10027, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 10049, + "src": "2704:7:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint232", + "typeString": "uint232" + }, + "typeName": { + "id": 10026, + "name": "uint232", + "nodeType": "ElementaryTypeName", + "src": "2704:7:53", + "typeDescriptions": { + "typeIdentifier": "t_uint232", + "typeString": "uint232" + } + }, + "visibility": "internal" + } + ], + "src": "2703:9:53" + }, + "scope": 11703, + "src": "2647:218:53", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 10076, + "nodeType": "Block", + "src": "3222:152:53", + "statements": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 10063, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 10057, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10052, + "src": "3236:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "expression": { + "arguments": [ + { + "id": 10060, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "3249:7:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint224_$", + "typeString": "type(uint224)" + }, + "typeName": { + "id": 10059, + "name": "uint224", + "nodeType": "ElementaryTypeName", + "src": "3249:7:53", + "typeDescriptions": {} + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_type$_t_uint224_$", + "typeString": "type(uint224)" + } + ], + "id": 10058, + "name": "type", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -27, + "src": "3244:4:53", + "typeDescriptions": { + "typeIdentifier": "t_function_metatype_pure$__$returns$__$", + "typeString": "function () pure" + } + }, + "id": 10061, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3244:13:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_magic_meta_type_t_uint224", + "typeString": "type(uint224)" + } + }, + "id": 10062, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "3258:3:53", + "memberName": "max", + "nodeType": "MemberAccess", + "src": "3244:17:53", + "typeDescriptions": { + "typeIdentifier": "t_uint224", + "typeString": "uint224" + } + }, + "src": "3236:25:53", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 10070, + "nodeType": "IfStatement", + "src": "3232:105:53", + "trueBody": { + "id": 10069, + "nodeType": "Block", + "src": "3263:74:53", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "hexValue": "323234", + "id": 10065, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3315:3:53", + "typeDescriptions": { + "typeIdentifier": "t_rational_224_by_1", + "typeString": "int_const 224" + }, + "value": "224" + }, + { + "id": 10066, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10052, + "src": "3320:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_224_by_1", + "typeString": "int_const 224" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 10064, + "name": "SafeCastOverflowedUintDowncast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9948, + "src": "3284:30:53", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint8_$_t_uint256_$returns$_t_error_$", + "typeString": "function (uint8,uint256) pure returns (error)" + } + }, + "id": 10067, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3284:42:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 10068, + "nodeType": "RevertStatement", + "src": "3277:49:53" + } + ] + } + }, + { + "expression": { + "arguments": [ + { + "id": 10073, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10052, + "src": "3361:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 10072, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "3353:7:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint224_$", + "typeString": "type(uint224)" + }, + "typeName": { + "id": 10071, + "name": "uint224", + "nodeType": "ElementaryTypeName", + "src": "3353:7:53", + "typeDescriptions": {} + } + }, + "id": 10074, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3353:14:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint224", + "typeString": "uint224" + } + }, + "functionReturnParameters": 10056, + "id": 10075, + "nodeType": "Return", + "src": "3346:21:53" + } + ] + }, + "documentation": { + "id": 10050, + "nodeType": "StructuredDocumentation", + "src": "2871:280:53", + "text": " @dev Returns the downcasted uint224 from uint256, reverting on\n overflow (when the input is greater than largest uint224).\n Counterpart to Solidity's `uint224` operator.\n Requirements:\n - input must fit into 224 bits" + }, + "id": 10077, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toUint224", + "nameLocation": "3165:9:53", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 10053, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10052, + "mutability": "mutable", + "name": "value", + "nameLocation": "3183:5:53", + "nodeType": "VariableDeclaration", + "scope": 10077, + "src": "3175:13:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 10051, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "3175:7:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "3174:15:53" + }, + "returnParameters": { + "id": 10056, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10055, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 10077, + "src": "3213:7:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint224", + "typeString": "uint224" + }, + "typeName": { + "id": 10054, + "name": "uint224", + "nodeType": "ElementaryTypeName", + "src": "3213:7:53", + "typeDescriptions": { + "typeIdentifier": "t_uint224", + "typeString": "uint224" + } + }, + "visibility": "internal" + } + ], + "src": "3212:9:53" + }, + "scope": 11703, + "src": "3156:218:53", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 10104, + "nodeType": "Block", + "src": "3731:152:53", + "statements": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 10091, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 10085, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10080, + "src": "3745:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "expression": { + "arguments": [ + { + "id": 10088, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "3758:7:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint216_$", + "typeString": "type(uint216)" + }, + "typeName": { + "id": 10087, + "name": "uint216", + "nodeType": "ElementaryTypeName", + "src": "3758:7:53", + "typeDescriptions": {} + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_type$_t_uint216_$", + "typeString": "type(uint216)" + } + ], + "id": 10086, + "name": "type", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -27, + "src": "3753:4:53", + "typeDescriptions": { + "typeIdentifier": "t_function_metatype_pure$__$returns$__$", + "typeString": "function () pure" + } + }, + "id": 10089, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3753:13:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_magic_meta_type_t_uint216", + "typeString": "type(uint216)" + } + }, + "id": 10090, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "3767:3:53", + "memberName": "max", + "nodeType": "MemberAccess", + "src": "3753:17:53", + "typeDescriptions": { + "typeIdentifier": "t_uint216", + "typeString": "uint216" + } + }, + "src": "3745:25:53", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 10098, + "nodeType": "IfStatement", + "src": "3741:105:53", + "trueBody": { + "id": 10097, + "nodeType": "Block", + "src": "3772:74:53", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "hexValue": "323136", + "id": 10093, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3824:3:53", + "typeDescriptions": { + "typeIdentifier": "t_rational_216_by_1", + "typeString": "int_const 216" + }, + "value": "216" + }, + { + "id": 10094, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10080, + "src": "3829:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_216_by_1", + "typeString": "int_const 216" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 10092, + "name": "SafeCastOverflowedUintDowncast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9948, + "src": "3793:30:53", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint8_$_t_uint256_$returns$_t_error_$", + "typeString": "function (uint8,uint256) pure returns (error)" + } + }, + "id": 10095, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3793:42:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 10096, + "nodeType": "RevertStatement", + "src": "3786:49:53" + } + ] + } + }, + { + "expression": { + "arguments": [ + { + "id": 10101, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10080, + "src": "3870:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 10100, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "3862:7:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint216_$", + "typeString": "type(uint216)" + }, + "typeName": { + "id": 10099, + "name": "uint216", + "nodeType": "ElementaryTypeName", + "src": "3862:7:53", + "typeDescriptions": {} + } + }, + "id": 10102, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3862:14:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint216", + "typeString": "uint216" + } + }, + "functionReturnParameters": 10084, + "id": 10103, + "nodeType": "Return", + "src": "3855:21:53" + } + ] + }, + "documentation": { + "id": 10078, + "nodeType": "StructuredDocumentation", + "src": "3380:280:53", + "text": " @dev Returns the downcasted uint216 from uint256, reverting on\n overflow (when the input is greater than largest uint216).\n Counterpart to Solidity's `uint216` operator.\n Requirements:\n - input must fit into 216 bits" + }, + "id": 10105, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toUint216", + "nameLocation": "3674:9:53", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 10081, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10080, + "mutability": "mutable", + "name": "value", + "nameLocation": "3692:5:53", + "nodeType": "VariableDeclaration", + "scope": 10105, + "src": "3684:13:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 10079, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "3684:7:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "3683:15:53" + }, + "returnParameters": { + "id": 10084, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10083, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 10105, + "src": "3722:7:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint216", + "typeString": "uint216" + }, + "typeName": { + "id": 10082, + "name": "uint216", + "nodeType": "ElementaryTypeName", + "src": "3722:7:53", + "typeDescriptions": { + "typeIdentifier": "t_uint216", + "typeString": "uint216" + } + }, + "visibility": "internal" + } + ], + "src": "3721:9:53" + }, + "scope": 11703, + "src": "3665:218:53", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 10132, + "nodeType": "Block", + "src": "4240:152:53", + "statements": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 10119, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 10113, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10108, + "src": "4254:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "expression": { + "arguments": [ + { + "id": 10116, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "4267:7:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint208_$", + "typeString": "type(uint208)" + }, + "typeName": { + "id": 10115, + "name": "uint208", + "nodeType": "ElementaryTypeName", + "src": "4267:7:53", + "typeDescriptions": {} + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_type$_t_uint208_$", + "typeString": "type(uint208)" + } + ], + "id": 10114, + "name": "type", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -27, + "src": "4262:4:53", + "typeDescriptions": { + "typeIdentifier": "t_function_metatype_pure$__$returns$__$", + "typeString": "function () pure" + } + }, + "id": 10117, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4262:13:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_magic_meta_type_t_uint208", + "typeString": "type(uint208)" + } + }, + "id": 10118, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "4276:3:53", + "memberName": "max", + "nodeType": "MemberAccess", + "src": "4262:17:53", + "typeDescriptions": { + "typeIdentifier": "t_uint208", + "typeString": "uint208" + } + }, + "src": "4254:25:53", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 10126, + "nodeType": "IfStatement", + "src": "4250:105:53", + "trueBody": { + "id": 10125, + "nodeType": "Block", + "src": "4281:74:53", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "hexValue": "323038", + "id": 10121, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4333:3:53", + "typeDescriptions": { + "typeIdentifier": "t_rational_208_by_1", + "typeString": "int_const 208" + }, + "value": "208" + }, + { + "id": 10122, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10108, + "src": "4338:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_208_by_1", + "typeString": "int_const 208" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 10120, + "name": "SafeCastOverflowedUintDowncast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9948, + "src": "4302:30:53", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint8_$_t_uint256_$returns$_t_error_$", + "typeString": "function (uint8,uint256) pure returns (error)" + } + }, + "id": 10123, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4302:42:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 10124, + "nodeType": "RevertStatement", + "src": "4295:49:53" + } + ] + } + }, + { + "expression": { + "arguments": [ + { + "id": 10129, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10108, + "src": "4379:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 10128, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "4371:7:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint208_$", + "typeString": "type(uint208)" + }, + "typeName": { + "id": 10127, + "name": "uint208", + "nodeType": "ElementaryTypeName", + "src": "4371:7:53", + "typeDescriptions": {} + } + }, + "id": 10130, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4371:14:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint208", + "typeString": "uint208" + } + }, + "functionReturnParameters": 10112, + "id": 10131, + "nodeType": "Return", + "src": "4364:21:53" + } + ] + }, + "documentation": { + "id": 10106, + "nodeType": "StructuredDocumentation", + "src": "3889:280:53", + "text": " @dev Returns the downcasted uint208 from uint256, reverting on\n overflow (when the input is greater than largest uint208).\n Counterpart to Solidity's `uint208` operator.\n Requirements:\n - input must fit into 208 bits" + }, + "id": 10133, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toUint208", + "nameLocation": "4183:9:53", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 10109, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10108, + "mutability": "mutable", + "name": "value", + "nameLocation": "4201:5:53", + "nodeType": "VariableDeclaration", + "scope": 10133, + "src": "4193:13:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 10107, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "4193:7:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "4192:15:53" + }, + "returnParameters": { + "id": 10112, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10111, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 10133, + "src": "4231:7:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint208", + "typeString": "uint208" + }, + "typeName": { + "id": 10110, + "name": "uint208", + "nodeType": "ElementaryTypeName", + "src": "4231:7:53", + "typeDescriptions": { + "typeIdentifier": "t_uint208", + "typeString": "uint208" + } + }, + "visibility": "internal" + } + ], + "src": "4230:9:53" + }, + "scope": 11703, + "src": "4174:218:53", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 10160, + "nodeType": "Block", + "src": "4749:152:53", + "statements": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 10147, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 10141, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10136, + "src": "4763:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "expression": { + "arguments": [ + { + "id": 10144, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "4776:7:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint200_$", + "typeString": "type(uint200)" + }, + "typeName": { + "id": 10143, + "name": "uint200", + "nodeType": "ElementaryTypeName", + "src": "4776:7:53", + "typeDescriptions": {} + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_type$_t_uint200_$", + "typeString": "type(uint200)" + } + ], + "id": 10142, + "name": "type", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -27, + "src": "4771:4:53", + "typeDescriptions": { + "typeIdentifier": "t_function_metatype_pure$__$returns$__$", + "typeString": "function () pure" + } + }, + "id": 10145, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4771:13:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_magic_meta_type_t_uint200", + "typeString": "type(uint200)" + } + }, + "id": 10146, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "4785:3:53", + "memberName": "max", + "nodeType": "MemberAccess", + "src": "4771:17:53", + "typeDescriptions": { + "typeIdentifier": "t_uint200", + "typeString": "uint200" + } + }, + "src": "4763:25:53", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 10154, + "nodeType": "IfStatement", + "src": "4759:105:53", + "trueBody": { + "id": 10153, + "nodeType": "Block", + "src": "4790:74:53", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "hexValue": "323030", + "id": 10149, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4842:3:53", + "typeDescriptions": { + "typeIdentifier": "t_rational_200_by_1", + "typeString": "int_const 200" + }, + "value": "200" + }, + { + "id": 10150, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10136, + "src": "4847:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_200_by_1", + "typeString": "int_const 200" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 10148, + "name": "SafeCastOverflowedUintDowncast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9948, + "src": "4811:30:53", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint8_$_t_uint256_$returns$_t_error_$", + "typeString": "function (uint8,uint256) pure returns (error)" + } + }, + "id": 10151, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4811:42:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 10152, + "nodeType": "RevertStatement", + "src": "4804:49:53" + } + ] + } + }, + { + "expression": { + "arguments": [ + { + "id": 10157, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10136, + "src": "4888:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 10156, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "4880:7:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint200_$", + "typeString": "type(uint200)" + }, + "typeName": { + "id": 10155, + "name": "uint200", + "nodeType": "ElementaryTypeName", + "src": "4880:7:53", + "typeDescriptions": {} + } + }, + "id": 10158, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4880:14:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint200", + "typeString": "uint200" + } + }, + "functionReturnParameters": 10140, + "id": 10159, + "nodeType": "Return", + "src": "4873:21:53" + } + ] + }, + "documentation": { + "id": 10134, + "nodeType": "StructuredDocumentation", + "src": "4398:280:53", + "text": " @dev Returns the downcasted uint200 from uint256, reverting on\n overflow (when the input is greater than largest uint200).\n Counterpart to Solidity's `uint200` operator.\n Requirements:\n - input must fit into 200 bits" + }, + "id": 10161, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toUint200", + "nameLocation": "4692:9:53", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 10137, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10136, + "mutability": "mutable", + "name": "value", + "nameLocation": "4710:5:53", + "nodeType": "VariableDeclaration", + "scope": 10161, + "src": "4702:13:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 10135, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "4702:7:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "4701:15:53" + }, + "returnParameters": { + "id": 10140, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10139, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 10161, + "src": "4740:7:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint200", + "typeString": "uint200" + }, + "typeName": { + "id": 10138, + "name": "uint200", + "nodeType": "ElementaryTypeName", + "src": "4740:7:53", + "typeDescriptions": { + "typeIdentifier": "t_uint200", + "typeString": "uint200" + } + }, + "visibility": "internal" + } + ], + "src": "4739:9:53" + }, + "scope": 11703, + "src": "4683:218:53", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 10188, + "nodeType": "Block", + "src": "5258:152:53", + "statements": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 10175, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 10169, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10164, + "src": "5272:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "expression": { + "arguments": [ + { + "id": 10172, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "5285:7:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint192_$", + "typeString": "type(uint192)" + }, + "typeName": { + "id": 10171, + "name": "uint192", + "nodeType": "ElementaryTypeName", + "src": "5285:7:53", + "typeDescriptions": {} + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_type$_t_uint192_$", + "typeString": "type(uint192)" + } + ], + "id": 10170, + "name": "type", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -27, + "src": "5280:4:53", + "typeDescriptions": { + "typeIdentifier": "t_function_metatype_pure$__$returns$__$", + "typeString": "function () pure" + } + }, + "id": 10173, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5280:13:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_magic_meta_type_t_uint192", + "typeString": "type(uint192)" + } + }, + "id": 10174, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "5294:3:53", + "memberName": "max", + "nodeType": "MemberAccess", + "src": "5280:17:53", + "typeDescriptions": { + "typeIdentifier": "t_uint192", + "typeString": "uint192" + } + }, + "src": "5272:25:53", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 10182, + "nodeType": "IfStatement", + "src": "5268:105:53", + "trueBody": { + "id": 10181, + "nodeType": "Block", + "src": "5299:74:53", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "hexValue": "313932", + "id": 10177, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "5351:3:53", + "typeDescriptions": { + "typeIdentifier": "t_rational_192_by_1", + "typeString": "int_const 192" + }, + "value": "192" + }, + { + "id": 10178, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10164, + "src": "5356:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_192_by_1", + "typeString": "int_const 192" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 10176, + "name": "SafeCastOverflowedUintDowncast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9948, + "src": "5320:30:53", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint8_$_t_uint256_$returns$_t_error_$", + "typeString": "function (uint8,uint256) pure returns (error)" + } + }, + "id": 10179, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5320:42:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 10180, + "nodeType": "RevertStatement", + "src": "5313:49:53" + } + ] + } + }, + { + "expression": { + "arguments": [ + { + "id": 10185, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10164, + "src": "5397:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 10184, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "5389:7:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint192_$", + "typeString": "type(uint192)" + }, + "typeName": { + "id": 10183, + "name": "uint192", + "nodeType": "ElementaryTypeName", + "src": "5389:7:53", + "typeDescriptions": {} + } + }, + "id": 10186, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5389:14:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint192", + "typeString": "uint192" + } + }, + "functionReturnParameters": 10168, + "id": 10187, + "nodeType": "Return", + "src": "5382:21:53" + } + ] + }, + "documentation": { + "id": 10162, + "nodeType": "StructuredDocumentation", + "src": "4907:280:53", + "text": " @dev Returns the downcasted uint192 from uint256, reverting on\n overflow (when the input is greater than largest uint192).\n Counterpart to Solidity's `uint192` operator.\n Requirements:\n - input must fit into 192 bits" + }, + "id": 10189, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toUint192", + "nameLocation": "5201:9:53", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 10165, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10164, + "mutability": "mutable", + "name": "value", + "nameLocation": "5219:5:53", + "nodeType": "VariableDeclaration", + "scope": 10189, + "src": "5211:13:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 10163, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "5211:7:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "5210:15:53" + }, + "returnParameters": { + "id": 10168, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10167, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 10189, + "src": "5249:7:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint192", + "typeString": "uint192" + }, + "typeName": { + "id": 10166, + "name": "uint192", + "nodeType": "ElementaryTypeName", + "src": "5249:7:53", + "typeDescriptions": { + "typeIdentifier": "t_uint192", + "typeString": "uint192" + } + }, + "visibility": "internal" + } + ], + "src": "5248:9:53" + }, + "scope": 11703, + "src": "5192:218:53", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 10216, + "nodeType": "Block", + "src": "5767:152:53", + "statements": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 10203, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 10197, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10192, + "src": "5781:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "expression": { + "arguments": [ + { + "id": 10200, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "5794:7:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint184_$", + "typeString": "type(uint184)" + }, + "typeName": { + "id": 10199, + "name": "uint184", + "nodeType": "ElementaryTypeName", + "src": "5794:7:53", + "typeDescriptions": {} + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_type$_t_uint184_$", + "typeString": "type(uint184)" + } + ], + "id": 10198, + "name": "type", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -27, + "src": "5789:4:53", + "typeDescriptions": { + "typeIdentifier": "t_function_metatype_pure$__$returns$__$", + "typeString": "function () pure" + } + }, + "id": 10201, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5789:13:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_magic_meta_type_t_uint184", + "typeString": "type(uint184)" + } + }, + "id": 10202, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "5803:3:53", + "memberName": "max", + "nodeType": "MemberAccess", + "src": "5789:17:53", + "typeDescriptions": { + "typeIdentifier": "t_uint184", + "typeString": "uint184" + } + }, + "src": "5781:25:53", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 10210, + "nodeType": "IfStatement", + "src": "5777:105:53", + "trueBody": { + "id": 10209, + "nodeType": "Block", + "src": "5808:74:53", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "hexValue": "313834", + "id": 10205, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "5860:3:53", + "typeDescriptions": { + "typeIdentifier": "t_rational_184_by_1", + "typeString": "int_const 184" + }, + "value": "184" + }, + { + "id": 10206, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10192, + "src": "5865:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_184_by_1", + "typeString": "int_const 184" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 10204, + "name": "SafeCastOverflowedUintDowncast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9948, + "src": "5829:30:53", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint8_$_t_uint256_$returns$_t_error_$", + "typeString": "function (uint8,uint256) pure returns (error)" + } + }, + "id": 10207, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5829:42:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 10208, + "nodeType": "RevertStatement", + "src": "5822:49:53" + } + ] + } + }, + { + "expression": { + "arguments": [ + { + "id": 10213, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10192, + "src": "5906:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 10212, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "5898:7:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint184_$", + "typeString": "type(uint184)" + }, + "typeName": { + "id": 10211, + "name": "uint184", + "nodeType": "ElementaryTypeName", + "src": "5898:7:53", + "typeDescriptions": {} + } + }, + "id": 10214, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5898:14:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint184", + "typeString": "uint184" + } + }, + "functionReturnParameters": 10196, + "id": 10215, + "nodeType": "Return", + "src": "5891:21:53" + } + ] + }, + "documentation": { + "id": 10190, + "nodeType": "StructuredDocumentation", + "src": "5416:280:53", + "text": " @dev Returns the downcasted uint184 from uint256, reverting on\n overflow (when the input is greater than largest uint184).\n Counterpart to Solidity's `uint184` operator.\n Requirements:\n - input must fit into 184 bits" + }, + "id": 10217, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toUint184", + "nameLocation": "5710:9:53", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 10193, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10192, + "mutability": "mutable", + "name": "value", + "nameLocation": "5728:5:53", + "nodeType": "VariableDeclaration", + "scope": 10217, + "src": "5720:13:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 10191, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "5720:7:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "5719:15:53" + }, + "returnParameters": { + "id": 10196, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10195, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 10217, + "src": "5758:7:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint184", + "typeString": "uint184" + }, + "typeName": { + "id": 10194, + "name": "uint184", + "nodeType": "ElementaryTypeName", + "src": "5758:7:53", + "typeDescriptions": { + "typeIdentifier": "t_uint184", + "typeString": "uint184" + } + }, + "visibility": "internal" + } + ], + "src": "5757:9:53" + }, + "scope": 11703, + "src": "5701:218:53", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 10244, + "nodeType": "Block", + "src": "6276:152:53", + "statements": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 10231, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 10225, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10220, + "src": "6290:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "expression": { + "arguments": [ + { + "id": 10228, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "6303:7:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint176_$", + "typeString": "type(uint176)" + }, + "typeName": { + "id": 10227, + "name": "uint176", + "nodeType": "ElementaryTypeName", + "src": "6303:7:53", + "typeDescriptions": {} + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_type$_t_uint176_$", + "typeString": "type(uint176)" + } + ], + "id": 10226, + "name": "type", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -27, + "src": "6298:4:53", + "typeDescriptions": { + "typeIdentifier": "t_function_metatype_pure$__$returns$__$", + "typeString": "function () pure" + } + }, + "id": 10229, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "6298:13:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_magic_meta_type_t_uint176", + "typeString": "type(uint176)" + } + }, + "id": 10230, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "6312:3:53", + "memberName": "max", + "nodeType": "MemberAccess", + "src": "6298:17:53", + "typeDescriptions": { + "typeIdentifier": "t_uint176", + "typeString": "uint176" + } + }, + "src": "6290:25:53", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 10238, + "nodeType": "IfStatement", + "src": "6286:105:53", + "trueBody": { + "id": 10237, + "nodeType": "Block", + "src": "6317:74:53", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "hexValue": "313736", + "id": 10233, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6369:3:53", + "typeDescriptions": { + "typeIdentifier": "t_rational_176_by_1", + "typeString": "int_const 176" + }, + "value": "176" + }, + { + "id": 10234, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10220, + "src": "6374:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_176_by_1", + "typeString": "int_const 176" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 10232, + "name": "SafeCastOverflowedUintDowncast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9948, + "src": "6338:30:53", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint8_$_t_uint256_$returns$_t_error_$", + "typeString": "function (uint8,uint256) pure returns (error)" + } + }, + "id": 10235, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "6338:42:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 10236, + "nodeType": "RevertStatement", + "src": "6331:49:53" + } + ] + } + }, + { + "expression": { + "arguments": [ + { + "id": 10241, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10220, + "src": "6415:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 10240, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "6407:7:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint176_$", + "typeString": "type(uint176)" + }, + "typeName": { + "id": 10239, + "name": "uint176", + "nodeType": "ElementaryTypeName", + "src": "6407:7:53", + "typeDescriptions": {} + } + }, + "id": 10242, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "6407:14:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint176", + "typeString": "uint176" + } + }, + "functionReturnParameters": 10224, + "id": 10243, + "nodeType": "Return", + "src": "6400:21:53" + } + ] + }, + "documentation": { + "id": 10218, + "nodeType": "StructuredDocumentation", + "src": "5925:280:53", + "text": " @dev Returns the downcasted uint176 from uint256, reverting on\n overflow (when the input is greater than largest uint176).\n Counterpart to Solidity's `uint176` operator.\n Requirements:\n - input must fit into 176 bits" + }, + "id": 10245, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toUint176", + "nameLocation": "6219:9:53", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 10221, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10220, + "mutability": "mutable", + "name": "value", + "nameLocation": "6237:5:53", + "nodeType": "VariableDeclaration", + "scope": 10245, + "src": "6229:13:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 10219, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "6229:7:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "6228:15:53" + }, + "returnParameters": { + "id": 10224, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10223, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 10245, + "src": "6267:7:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint176", + "typeString": "uint176" + }, + "typeName": { + "id": 10222, + "name": "uint176", + "nodeType": "ElementaryTypeName", + "src": "6267:7:53", + "typeDescriptions": { + "typeIdentifier": "t_uint176", + "typeString": "uint176" + } + }, + "visibility": "internal" + } + ], + "src": "6266:9:53" + }, + "scope": 11703, + "src": "6210:218:53", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 10272, + "nodeType": "Block", + "src": "6785:152:53", + "statements": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 10259, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 10253, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10248, + "src": "6799:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "expression": { + "arguments": [ + { + "id": 10256, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "6812:7:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint168_$", + "typeString": "type(uint168)" + }, + "typeName": { + "id": 10255, + "name": "uint168", + "nodeType": "ElementaryTypeName", + "src": "6812:7:53", + "typeDescriptions": {} + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_type$_t_uint168_$", + "typeString": "type(uint168)" + } + ], + "id": 10254, + "name": "type", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -27, + "src": "6807:4:53", + "typeDescriptions": { + "typeIdentifier": "t_function_metatype_pure$__$returns$__$", + "typeString": "function () pure" + } + }, + "id": 10257, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "6807:13:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_magic_meta_type_t_uint168", + "typeString": "type(uint168)" + } + }, + "id": 10258, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "6821:3:53", + "memberName": "max", + "nodeType": "MemberAccess", + "src": "6807:17:53", + "typeDescriptions": { + "typeIdentifier": "t_uint168", + "typeString": "uint168" + } + }, + "src": "6799:25:53", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 10266, + "nodeType": "IfStatement", + "src": "6795:105:53", + "trueBody": { + "id": 10265, + "nodeType": "Block", + "src": "6826:74:53", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "hexValue": "313638", + "id": 10261, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6878:3:53", + "typeDescriptions": { + "typeIdentifier": "t_rational_168_by_1", + "typeString": "int_const 168" + }, + "value": "168" + }, + { + "id": 10262, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10248, + "src": "6883:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_168_by_1", + "typeString": "int_const 168" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 10260, + "name": "SafeCastOverflowedUintDowncast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9948, + "src": "6847:30:53", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint8_$_t_uint256_$returns$_t_error_$", + "typeString": "function (uint8,uint256) pure returns (error)" + } + }, + "id": 10263, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "6847:42:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 10264, + "nodeType": "RevertStatement", + "src": "6840:49:53" + } + ] + } + }, + { + "expression": { + "arguments": [ + { + "id": 10269, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10248, + "src": "6924:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 10268, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "6916:7:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint168_$", + "typeString": "type(uint168)" + }, + "typeName": { + "id": 10267, + "name": "uint168", + "nodeType": "ElementaryTypeName", + "src": "6916:7:53", + "typeDescriptions": {} + } + }, + "id": 10270, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "6916:14:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint168", + "typeString": "uint168" + } + }, + "functionReturnParameters": 10252, + "id": 10271, + "nodeType": "Return", + "src": "6909:21:53" + } + ] + }, + "documentation": { + "id": 10246, + "nodeType": "StructuredDocumentation", + "src": "6434:280:53", + "text": " @dev Returns the downcasted uint168 from uint256, reverting on\n overflow (when the input is greater than largest uint168).\n Counterpart to Solidity's `uint168` operator.\n Requirements:\n - input must fit into 168 bits" + }, + "id": 10273, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toUint168", + "nameLocation": "6728:9:53", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 10249, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10248, + "mutability": "mutable", + "name": "value", + "nameLocation": "6746:5:53", + "nodeType": "VariableDeclaration", + "scope": 10273, + "src": "6738:13:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 10247, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "6738:7:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "6737:15:53" + }, + "returnParameters": { + "id": 10252, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10251, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 10273, + "src": "6776:7:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint168", + "typeString": "uint168" + }, + "typeName": { + "id": 10250, + "name": "uint168", + "nodeType": "ElementaryTypeName", + "src": "6776:7:53", + "typeDescriptions": { + "typeIdentifier": "t_uint168", + "typeString": "uint168" + } + }, + "visibility": "internal" + } + ], + "src": "6775:9:53" + }, + "scope": 11703, + "src": "6719:218:53", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 10300, + "nodeType": "Block", + "src": "7294:152:53", + "statements": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 10287, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 10281, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10276, + "src": "7308:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "expression": { + "arguments": [ + { + "id": 10284, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "7321:7:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint160_$", + "typeString": "type(uint160)" + }, + "typeName": { + "id": 10283, + "name": "uint160", + "nodeType": "ElementaryTypeName", + "src": "7321:7:53", + "typeDescriptions": {} + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_type$_t_uint160_$", + "typeString": "type(uint160)" + } + ], + "id": 10282, + "name": "type", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -27, + "src": "7316:4:53", + "typeDescriptions": { + "typeIdentifier": "t_function_metatype_pure$__$returns$__$", + "typeString": "function () pure" + } + }, + "id": 10285, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "7316:13:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_magic_meta_type_t_uint160", + "typeString": "type(uint160)" + } + }, + "id": 10286, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "7330:3:53", + "memberName": "max", + "nodeType": "MemberAccess", + "src": "7316:17:53", + "typeDescriptions": { + "typeIdentifier": "t_uint160", + "typeString": "uint160" + } + }, + "src": "7308:25:53", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 10294, + "nodeType": "IfStatement", + "src": "7304:105:53", + "trueBody": { + "id": 10293, + "nodeType": "Block", + "src": "7335:74:53", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "hexValue": "313630", + "id": 10289, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7387:3:53", + "typeDescriptions": { + "typeIdentifier": "t_rational_160_by_1", + "typeString": "int_const 160" + }, + "value": "160" + }, + { + "id": 10290, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10276, + "src": "7392:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_160_by_1", + "typeString": "int_const 160" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 10288, + "name": "SafeCastOverflowedUintDowncast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9948, + "src": "7356:30:53", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint8_$_t_uint256_$returns$_t_error_$", + "typeString": "function (uint8,uint256) pure returns (error)" + } + }, + "id": 10291, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "7356:42:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 10292, + "nodeType": "RevertStatement", + "src": "7349:49:53" + } + ] + } + }, + { + "expression": { + "arguments": [ + { + "id": 10297, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10276, + "src": "7433:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 10296, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "7425:7:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint160_$", + "typeString": "type(uint160)" + }, + "typeName": { + "id": 10295, + "name": "uint160", + "nodeType": "ElementaryTypeName", + "src": "7425:7:53", + "typeDescriptions": {} + } + }, + "id": 10298, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "7425:14:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint160", + "typeString": "uint160" + } + }, + "functionReturnParameters": 10280, + "id": 10299, + "nodeType": "Return", + "src": "7418:21:53" + } + ] + }, + "documentation": { + "id": 10274, + "nodeType": "StructuredDocumentation", + "src": "6943:280:53", + "text": " @dev Returns the downcasted uint160 from uint256, reverting on\n overflow (when the input is greater than largest uint160).\n Counterpart to Solidity's `uint160` operator.\n Requirements:\n - input must fit into 160 bits" + }, + "id": 10301, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toUint160", + "nameLocation": "7237:9:53", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 10277, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10276, + "mutability": "mutable", + "name": "value", + "nameLocation": "7255:5:53", + "nodeType": "VariableDeclaration", + "scope": 10301, + "src": "7247:13:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 10275, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "7247:7:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "7246:15:53" + }, + "returnParameters": { + "id": 10280, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10279, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 10301, + "src": "7285:7:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint160", + "typeString": "uint160" + }, + "typeName": { + "id": 10278, + "name": "uint160", + "nodeType": "ElementaryTypeName", + "src": "7285:7:53", + "typeDescriptions": { + "typeIdentifier": "t_uint160", + "typeString": "uint160" + } + }, + "visibility": "internal" + } + ], + "src": "7284:9:53" + }, + "scope": 11703, + "src": "7228:218:53", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 10328, + "nodeType": "Block", + "src": "7803:152:53", + "statements": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 10315, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 10309, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10304, + "src": "7817:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "expression": { + "arguments": [ + { + "id": 10312, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "7830:7:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint152_$", + "typeString": "type(uint152)" + }, + "typeName": { + "id": 10311, + "name": "uint152", + "nodeType": "ElementaryTypeName", + "src": "7830:7:53", + "typeDescriptions": {} + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_type$_t_uint152_$", + "typeString": "type(uint152)" + } + ], + "id": 10310, + "name": "type", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -27, + "src": "7825:4:53", + "typeDescriptions": { + "typeIdentifier": "t_function_metatype_pure$__$returns$__$", + "typeString": "function () pure" + } + }, + "id": 10313, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "7825:13:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_magic_meta_type_t_uint152", + "typeString": "type(uint152)" + } + }, + "id": 10314, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "7839:3:53", + "memberName": "max", + "nodeType": "MemberAccess", + "src": "7825:17:53", + "typeDescriptions": { + "typeIdentifier": "t_uint152", + "typeString": "uint152" + } + }, + "src": "7817:25:53", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 10322, + "nodeType": "IfStatement", + "src": "7813:105:53", + "trueBody": { + "id": 10321, + "nodeType": "Block", + "src": "7844:74:53", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "hexValue": "313532", + "id": 10317, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7896:3:53", + "typeDescriptions": { + "typeIdentifier": "t_rational_152_by_1", + "typeString": "int_const 152" + }, + "value": "152" + }, + { + "id": 10318, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10304, + "src": "7901:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_152_by_1", + "typeString": "int_const 152" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 10316, + "name": "SafeCastOverflowedUintDowncast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9948, + "src": "7865:30:53", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint8_$_t_uint256_$returns$_t_error_$", + "typeString": "function (uint8,uint256) pure returns (error)" + } + }, + "id": 10319, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "7865:42:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 10320, + "nodeType": "RevertStatement", + "src": "7858:49:53" + } + ] + } + }, + { + "expression": { + "arguments": [ + { + "id": 10325, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10304, + "src": "7942:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 10324, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "7934:7:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint152_$", + "typeString": "type(uint152)" + }, + "typeName": { + "id": 10323, + "name": "uint152", + "nodeType": "ElementaryTypeName", + "src": "7934:7:53", + "typeDescriptions": {} + } + }, + "id": 10326, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "7934:14:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint152", + "typeString": "uint152" + } + }, + "functionReturnParameters": 10308, + "id": 10327, + "nodeType": "Return", + "src": "7927:21:53" + } + ] + }, + "documentation": { + "id": 10302, + "nodeType": "StructuredDocumentation", + "src": "7452:280:53", + "text": " @dev Returns the downcasted uint152 from uint256, reverting on\n overflow (when the input is greater than largest uint152).\n Counterpart to Solidity's `uint152` operator.\n Requirements:\n - input must fit into 152 bits" + }, + "id": 10329, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toUint152", + "nameLocation": "7746:9:53", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 10305, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10304, + "mutability": "mutable", + "name": "value", + "nameLocation": "7764:5:53", + "nodeType": "VariableDeclaration", + "scope": 10329, + "src": "7756:13:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 10303, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "7756:7:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "7755:15:53" + }, + "returnParameters": { + "id": 10308, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10307, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 10329, + "src": "7794:7:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint152", + "typeString": "uint152" + }, + "typeName": { + "id": 10306, + "name": "uint152", + "nodeType": "ElementaryTypeName", + "src": "7794:7:53", + "typeDescriptions": { + "typeIdentifier": "t_uint152", + "typeString": "uint152" + } + }, + "visibility": "internal" + } + ], + "src": "7793:9:53" + }, + "scope": 11703, + "src": "7737:218:53", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 10356, + "nodeType": "Block", + "src": "8312:152:53", + "statements": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 10343, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 10337, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10332, + "src": "8326:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "expression": { + "arguments": [ + { + "id": 10340, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "8339:7:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint144_$", + "typeString": "type(uint144)" + }, + "typeName": { + "id": 10339, + "name": "uint144", + "nodeType": "ElementaryTypeName", + "src": "8339:7:53", + "typeDescriptions": {} + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_type$_t_uint144_$", + "typeString": "type(uint144)" + } + ], + "id": 10338, + "name": "type", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -27, + "src": "8334:4:53", + "typeDescriptions": { + "typeIdentifier": "t_function_metatype_pure$__$returns$__$", + "typeString": "function () pure" + } + }, + "id": 10341, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "8334:13:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_magic_meta_type_t_uint144", + "typeString": "type(uint144)" + } + }, + "id": 10342, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "8348:3:53", + "memberName": "max", + "nodeType": "MemberAccess", + "src": "8334:17:53", + "typeDescriptions": { + "typeIdentifier": "t_uint144", + "typeString": "uint144" + } + }, + "src": "8326:25:53", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 10350, + "nodeType": "IfStatement", + "src": "8322:105:53", + "trueBody": { + "id": 10349, + "nodeType": "Block", + "src": "8353:74:53", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "hexValue": "313434", + "id": 10345, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8405:3:53", + "typeDescriptions": { + "typeIdentifier": "t_rational_144_by_1", + "typeString": "int_const 144" + }, + "value": "144" + }, + { + "id": 10346, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10332, + "src": "8410:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_144_by_1", + "typeString": "int_const 144" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 10344, + "name": "SafeCastOverflowedUintDowncast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9948, + "src": "8374:30:53", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint8_$_t_uint256_$returns$_t_error_$", + "typeString": "function (uint8,uint256) pure returns (error)" + } + }, + "id": 10347, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "8374:42:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 10348, + "nodeType": "RevertStatement", + "src": "8367:49:53" + } + ] + } + }, + { + "expression": { + "arguments": [ + { + "id": 10353, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10332, + "src": "8451:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 10352, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "8443:7:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint144_$", + "typeString": "type(uint144)" + }, + "typeName": { + "id": 10351, + "name": "uint144", + "nodeType": "ElementaryTypeName", + "src": "8443:7:53", + "typeDescriptions": {} + } + }, + "id": 10354, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "8443:14:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint144", + "typeString": "uint144" + } + }, + "functionReturnParameters": 10336, + "id": 10355, + "nodeType": "Return", + "src": "8436:21:53" + } + ] + }, + "documentation": { + "id": 10330, + "nodeType": "StructuredDocumentation", + "src": "7961:280:53", + "text": " @dev Returns the downcasted uint144 from uint256, reverting on\n overflow (when the input is greater than largest uint144).\n Counterpart to Solidity's `uint144` operator.\n Requirements:\n - input must fit into 144 bits" + }, + "id": 10357, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toUint144", + "nameLocation": "8255:9:53", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 10333, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10332, + "mutability": "mutable", + "name": "value", + "nameLocation": "8273:5:53", + "nodeType": "VariableDeclaration", + "scope": 10357, + "src": "8265:13:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 10331, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "8265:7:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "8264:15:53" + }, + "returnParameters": { + "id": 10336, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10335, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 10357, + "src": "8303:7:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint144", + "typeString": "uint144" + }, + "typeName": { + "id": 10334, + "name": "uint144", + "nodeType": "ElementaryTypeName", + "src": "8303:7:53", + "typeDescriptions": { + "typeIdentifier": "t_uint144", + "typeString": "uint144" + } + }, + "visibility": "internal" + } + ], + "src": "8302:9:53" + }, + "scope": 11703, + "src": "8246:218:53", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 10384, + "nodeType": "Block", + "src": "8821:152:53", + "statements": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 10371, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 10365, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10360, + "src": "8835:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "expression": { + "arguments": [ + { + "id": 10368, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "8848:7:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint136_$", + "typeString": "type(uint136)" + }, + "typeName": { + "id": 10367, + "name": "uint136", + "nodeType": "ElementaryTypeName", + "src": "8848:7:53", + "typeDescriptions": {} + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_type$_t_uint136_$", + "typeString": "type(uint136)" + } + ], + "id": 10366, + "name": "type", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -27, + "src": "8843:4:53", + "typeDescriptions": { + "typeIdentifier": "t_function_metatype_pure$__$returns$__$", + "typeString": "function () pure" + } + }, + "id": 10369, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "8843:13:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_magic_meta_type_t_uint136", + "typeString": "type(uint136)" + } + }, + "id": 10370, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "8857:3:53", + "memberName": "max", + "nodeType": "MemberAccess", + "src": "8843:17:53", + "typeDescriptions": { + "typeIdentifier": "t_uint136", + "typeString": "uint136" + } + }, + "src": "8835:25:53", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 10378, + "nodeType": "IfStatement", + "src": "8831:105:53", + "trueBody": { + "id": 10377, + "nodeType": "Block", + "src": "8862:74:53", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "hexValue": "313336", + "id": 10373, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8914:3:53", + "typeDescriptions": { + "typeIdentifier": "t_rational_136_by_1", + "typeString": "int_const 136" + }, + "value": "136" + }, + { + "id": 10374, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10360, + "src": "8919:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_136_by_1", + "typeString": "int_const 136" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 10372, + "name": "SafeCastOverflowedUintDowncast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9948, + "src": "8883:30:53", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint8_$_t_uint256_$returns$_t_error_$", + "typeString": "function (uint8,uint256) pure returns (error)" + } + }, + "id": 10375, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "8883:42:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 10376, + "nodeType": "RevertStatement", + "src": "8876:49:53" + } + ] + } + }, + { + "expression": { + "arguments": [ + { + "id": 10381, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10360, + "src": "8960:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 10380, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "8952:7:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint136_$", + "typeString": "type(uint136)" + }, + "typeName": { + "id": 10379, + "name": "uint136", + "nodeType": "ElementaryTypeName", + "src": "8952:7:53", + "typeDescriptions": {} + } + }, + "id": 10382, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "8952:14:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint136", + "typeString": "uint136" + } + }, + "functionReturnParameters": 10364, + "id": 10383, + "nodeType": "Return", + "src": "8945:21:53" + } + ] + }, + "documentation": { + "id": 10358, + "nodeType": "StructuredDocumentation", + "src": "8470:280:53", + "text": " @dev Returns the downcasted uint136 from uint256, reverting on\n overflow (when the input is greater than largest uint136).\n Counterpart to Solidity's `uint136` operator.\n Requirements:\n - input must fit into 136 bits" + }, + "id": 10385, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toUint136", + "nameLocation": "8764:9:53", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 10361, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10360, + "mutability": "mutable", + "name": "value", + "nameLocation": "8782:5:53", + "nodeType": "VariableDeclaration", + "scope": 10385, + "src": "8774:13:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 10359, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "8774:7:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "8773:15:53" + }, + "returnParameters": { + "id": 10364, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10363, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 10385, + "src": "8812:7:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint136", + "typeString": "uint136" + }, + "typeName": { + "id": 10362, + "name": "uint136", + "nodeType": "ElementaryTypeName", + "src": "8812:7:53", + "typeDescriptions": { + "typeIdentifier": "t_uint136", + "typeString": "uint136" + } + }, + "visibility": "internal" + } + ], + "src": "8811:9:53" + }, + "scope": 11703, + "src": "8755:218:53", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 10412, + "nodeType": "Block", + "src": "9330:152:53", + "statements": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 10399, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 10393, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10388, + "src": "9344:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "expression": { + "arguments": [ + { + "id": 10396, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "9357:7:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint128_$", + "typeString": "type(uint128)" + }, + "typeName": { + "id": 10395, + "name": "uint128", + "nodeType": "ElementaryTypeName", + "src": "9357:7:53", + "typeDescriptions": {} + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_type$_t_uint128_$", + "typeString": "type(uint128)" + } + ], + "id": 10394, + "name": "type", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -27, + "src": "9352:4:53", + "typeDescriptions": { + "typeIdentifier": "t_function_metatype_pure$__$returns$__$", + "typeString": "function () pure" + } + }, + "id": 10397, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "9352:13:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_magic_meta_type_t_uint128", + "typeString": "type(uint128)" + } + }, + "id": 10398, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "9366:3:53", + "memberName": "max", + "nodeType": "MemberAccess", + "src": "9352:17:53", + "typeDescriptions": { + "typeIdentifier": "t_uint128", + "typeString": "uint128" + } + }, + "src": "9344:25:53", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 10406, + "nodeType": "IfStatement", + "src": "9340:105:53", + "trueBody": { + "id": 10405, + "nodeType": "Block", + "src": "9371:74:53", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "hexValue": "313238", + "id": 10401, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "9423:3:53", + "typeDescriptions": { + "typeIdentifier": "t_rational_128_by_1", + "typeString": "int_const 128" + }, + "value": "128" + }, + { + "id": 10402, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10388, + "src": "9428:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_128_by_1", + "typeString": "int_const 128" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 10400, + "name": "SafeCastOverflowedUintDowncast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9948, + "src": "9392:30:53", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint8_$_t_uint256_$returns$_t_error_$", + "typeString": "function (uint8,uint256) pure returns (error)" + } + }, + "id": 10403, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "9392:42:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 10404, + "nodeType": "RevertStatement", + "src": "9385:49:53" + } + ] + } + }, + { + "expression": { + "arguments": [ + { + "id": 10409, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10388, + "src": "9469:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 10408, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "9461:7:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint128_$", + "typeString": "type(uint128)" + }, + "typeName": { + "id": 10407, + "name": "uint128", + "nodeType": "ElementaryTypeName", + "src": "9461:7:53", + "typeDescriptions": {} + } + }, + "id": 10410, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "9461:14:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint128", + "typeString": "uint128" + } + }, + "functionReturnParameters": 10392, + "id": 10411, + "nodeType": "Return", + "src": "9454:21:53" + } + ] + }, + "documentation": { + "id": 10386, + "nodeType": "StructuredDocumentation", + "src": "8979:280:53", + "text": " @dev Returns the downcasted uint128 from uint256, reverting on\n overflow (when the input is greater than largest uint128).\n Counterpart to Solidity's `uint128` operator.\n Requirements:\n - input must fit into 128 bits" + }, + "id": 10413, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toUint128", + "nameLocation": "9273:9:53", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 10389, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10388, + "mutability": "mutable", + "name": "value", + "nameLocation": "9291:5:53", + "nodeType": "VariableDeclaration", + "scope": 10413, + "src": "9283:13:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 10387, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "9283:7:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "9282:15:53" + }, + "returnParameters": { + "id": 10392, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10391, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 10413, + "src": "9321:7:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint128", + "typeString": "uint128" + }, + "typeName": { + "id": 10390, + "name": "uint128", + "nodeType": "ElementaryTypeName", + "src": "9321:7:53", + "typeDescriptions": { + "typeIdentifier": "t_uint128", + "typeString": "uint128" + } + }, + "visibility": "internal" + } + ], + "src": "9320:9:53" + }, + "scope": 11703, + "src": "9264:218:53", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 10440, + "nodeType": "Block", + "src": "9839:152:53", + "statements": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 10427, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 10421, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10416, + "src": "9853:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "expression": { + "arguments": [ + { + "id": 10424, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "9866:7:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint120_$", + "typeString": "type(uint120)" + }, + "typeName": { + "id": 10423, + "name": "uint120", + "nodeType": "ElementaryTypeName", + "src": "9866:7:53", + "typeDescriptions": {} + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_type$_t_uint120_$", + "typeString": "type(uint120)" + } + ], + "id": 10422, + "name": "type", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -27, + "src": "9861:4:53", + "typeDescriptions": { + "typeIdentifier": "t_function_metatype_pure$__$returns$__$", + "typeString": "function () pure" + } + }, + "id": 10425, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "9861:13:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_magic_meta_type_t_uint120", + "typeString": "type(uint120)" + } + }, + "id": 10426, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "9875:3:53", + "memberName": "max", + "nodeType": "MemberAccess", + "src": "9861:17:53", + "typeDescriptions": { + "typeIdentifier": "t_uint120", + "typeString": "uint120" + } + }, + "src": "9853:25:53", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 10434, + "nodeType": "IfStatement", + "src": "9849:105:53", + "trueBody": { + "id": 10433, + "nodeType": "Block", + "src": "9880:74:53", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "hexValue": "313230", + "id": 10429, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "9932:3:53", + "typeDescriptions": { + "typeIdentifier": "t_rational_120_by_1", + "typeString": "int_const 120" + }, + "value": "120" + }, + { + "id": 10430, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10416, + "src": "9937:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_120_by_1", + "typeString": "int_const 120" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 10428, + "name": "SafeCastOverflowedUintDowncast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9948, + "src": "9901:30:53", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint8_$_t_uint256_$returns$_t_error_$", + "typeString": "function (uint8,uint256) pure returns (error)" + } + }, + "id": 10431, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "9901:42:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 10432, + "nodeType": "RevertStatement", + "src": "9894:49:53" + } + ] + } + }, + { + "expression": { + "arguments": [ + { + "id": 10437, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10416, + "src": "9978:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 10436, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "9970:7:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint120_$", + "typeString": "type(uint120)" + }, + "typeName": { + "id": 10435, + "name": "uint120", + "nodeType": "ElementaryTypeName", + "src": "9970:7:53", + "typeDescriptions": {} + } + }, + "id": 10438, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "9970:14:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint120", + "typeString": "uint120" + } + }, + "functionReturnParameters": 10420, + "id": 10439, + "nodeType": "Return", + "src": "9963:21:53" + } + ] + }, + "documentation": { + "id": 10414, + "nodeType": "StructuredDocumentation", + "src": "9488:280:53", + "text": " @dev Returns the downcasted uint120 from uint256, reverting on\n overflow (when the input is greater than largest uint120).\n Counterpart to Solidity's `uint120` operator.\n Requirements:\n - input must fit into 120 bits" + }, + "id": 10441, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toUint120", + "nameLocation": "9782:9:53", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 10417, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10416, + "mutability": "mutable", + "name": "value", + "nameLocation": "9800:5:53", + "nodeType": "VariableDeclaration", + "scope": 10441, + "src": "9792:13:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 10415, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "9792:7:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "9791:15:53" + }, + "returnParameters": { + "id": 10420, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10419, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 10441, + "src": "9830:7:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint120", + "typeString": "uint120" + }, + "typeName": { + "id": 10418, + "name": "uint120", + "nodeType": "ElementaryTypeName", + "src": "9830:7:53", + "typeDescriptions": { + "typeIdentifier": "t_uint120", + "typeString": "uint120" + } + }, + "visibility": "internal" + } + ], + "src": "9829:9:53" + }, + "scope": 11703, + "src": "9773:218:53", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 10468, + "nodeType": "Block", + "src": "10348:152:53", + "statements": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 10455, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 10449, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10444, + "src": "10362:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "expression": { + "arguments": [ + { + "id": 10452, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "10375:7:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint112_$", + "typeString": "type(uint112)" + }, + "typeName": { + "id": 10451, + "name": "uint112", + "nodeType": "ElementaryTypeName", + "src": "10375:7:53", + "typeDescriptions": {} + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_type$_t_uint112_$", + "typeString": "type(uint112)" + } + ], + "id": 10450, + "name": "type", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -27, + "src": "10370:4:53", + "typeDescriptions": { + "typeIdentifier": "t_function_metatype_pure$__$returns$__$", + "typeString": "function () pure" + } + }, + "id": 10453, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "10370:13:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_magic_meta_type_t_uint112", + "typeString": "type(uint112)" + } + }, + "id": 10454, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "10384:3:53", + "memberName": "max", + "nodeType": "MemberAccess", + "src": "10370:17:53", + "typeDescriptions": { + "typeIdentifier": "t_uint112", + "typeString": "uint112" + } + }, + "src": "10362:25:53", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 10462, + "nodeType": "IfStatement", + "src": "10358:105:53", + "trueBody": { + "id": 10461, + "nodeType": "Block", + "src": "10389:74:53", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "hexValue": "313132", + "id": 10457, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10441:3:53", + "typeDescriptions": { + "typeIdentifier": "t_rational_112_by_1", + "typeString": "int_const 112" + }, + "value": "112" + }, + { + "id": 10458, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10444, + "src": "10446:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_112_by_1", + "typeString": "int_const 112" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 10456, + "name": "SafeCastOverflowedUintDowncast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9948, + "src": "10410:30:53", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint8_$_t_uint256_$returns$_t_error_$", + "typeString": "function (uint8,uint256) pure returns (error)" + } + }, + "id": 10459, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "10410:42:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 10460, + "nodeType": "RevertStatement", + "src": "10403:49:53" + } + ] + } + }, + { + "expression": { + "arguments": [ + { + "id": 10465, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10444, + "src": "10487:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 10464, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "10479:7:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint112_$", + "typeString": "type(uint112)" + }, + "typeName": { + "id": 10463, + "name": "uint112", + "nodeType": "ElementaryTypeName", + "src": "10479:7:53", + "typeDescriptions": {} + } + }, + "id": 10466, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "10479:14:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint112", + "typeString": "uint112" + } + }, + "functionReturnParameters": 10448, + "id": 10467, + "nodeType": "Return", + "src": "10472:21:53" + } + ] + }, + "documentation": { + "id": 10442, + "nodeType": "StructuredDocumentation", + "src": "9997:280:53", + "text": " @dev Returns the downcasted uint112 from uint256, reverting on\n overflow (when the input is greater than largest uint112).\n Counterpart to Solidity's `uint112` operator.\n Requirements:\n - input must fit into 112 bits" + }, + "id": 10469, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toUint112", + "nameLocation": "10291:9:53", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 10445, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10444, + "mutability": "mutable", + "name": "value", + "nameLocation": "10309:5:53", + "nodeType": "VariableDeclaration", + "scope": 10469, + "src": "10301:13:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 10443, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "10301:7:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "10300:15:53" + }, + "returnParameters": { + "id": 10448, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10447, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 10469, + "src": "10339:7:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint112", + "typeString": "uint112" + }, + "typeName": { + "id": 10446, + "name": "uint112", + "nodeType": "ElementaryTypeName", + "src": "10339:7:53", + "typeDescriptions": { + "typeIdentifier": "t_uint112", + "typeString": "uint112" + } + }, + "visibility": "internal" + } + ], + "src": "10338:9:53" + }, + "scope": 11703, + "src": "10282:218:53", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 10496, + "nodeType": "Block", + "src": "10857:152:53", + "statements": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 10483, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 10477, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10472, + "src": "10871:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "expression": { + "arguments": [ + { + "id": 10480, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "10884:7:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint104_$", + "typeString": "type(uint104)" + }, + "typeName": { + "id": 10479, + "name": "uint104", + "nodeType": "ElementaryTypeName", + "src": "10884:7:53", + "typeDescriptions": {} + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_type$_t_uint104_$", + "typeString": "type(uint104)" + } + ], + "id": 10478, + "name": "type", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -27, + "src": "10879:4:53", + "typeDescriptions": { + "typeIdentifier": "t_function_metatype_pure$__$returns$__$", + "typeString": "function () pure" + } + }, + "id": 10481, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "10879:13:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_magic_meta_type_t_uint104", + "typeString": "type(uint104)" + } + }, + "id": 10482, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "10893:3:53", + "memberName": "max", + "nodeType": "MemberAccess", + "src": "10879:17:53", + "typeDescriptions": { + "typeIdentifier": "t_uint104", + "typeString": "uint104" + } + }, + "src": "10871:25:53", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 10490, + "nodeType": "IfStatement", + "src": "10867:105:53", + "trueBody": { + "id": 10489, + "nodeType": "Block", + "src": "10898:74:53", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "hexValue": "313034", + "id": 10485, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10950:3:53", + "typeDescriptions": { + "typeIdentifier": "t_rational_104_by_1", + "typeString": "int_const 104" + }, + "value": "104" + }, + { + "id": 10486, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10472, + "src": "10955:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_104_by_1", + "typeString": "int_const 104" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 10484, + "name": "SafeCastOverflowedUintDowncast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9948, + "src": "10919:30:53", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint8_$_t_uint256_$returns$_t_error_$", + "typeString": "function (uint8,uint256) pure returns (error)" + } + }, + "id": 10487, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "10919:42:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 10488, + "nodeType": "RevertStatement", + "src": "10912:49:53" + } + ] + } + }, + { + "expression": { + "arguments": [ + { + "id": 10493, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10472, + "src": "10996:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 10492, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "10988:7:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint104_$", + "typeString": "type(uint104)" + }, + "typeName": { + "id": 10491, + "name": "uint104", + "nodeType": "ElementaryTypeName", + "src": "10988:7:53", + "typeDescriptions": {} + } + }, + "id": 10494, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "10988:14:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint104", + "typeString": "uint104" + } + }, + "functionReturnParameters": 10476, + "id": 10495, + "nodeType": "Return", + "src": "10981:21:53" + } + ] + }, + "documentation": { + "id": 10470, + "nodeType": "StructuredDocumentation", + "src": "10506:280:53", + "text": " @dev Returns the downcasted uint104 from uint256, reverting on\n overflow (when the input is greater than largest uint104).\n Counterpart to Solidity's `uint104` operator.\n Requirements:\n - input must fit into 104 bits" + }, + "id": 10497, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toUint104", + "nameLocation": "10800:9:53", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 10473, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10472, + "mutability": "mutable", + "name": "value", + "nameLocation": "10818:5:53", + "nodeType": "VariableDeclaration", + "scope": 10497, + "src": "10810:13:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 10471, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "10810:7:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "10809:15:53" + }, + "returnParameters": { + "id": 10476, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10475, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 10497, + "src": "10848:7:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint104", + "typeString": "uint104" + }, + "typeName": { + "id": 10474, + "name": "uint104", + "nodeType": "ElementaryTypeName", + "src": "10848:7:53", + "typeDescriptions": { + "typeIdentifier": "t_uint104", + "typeString": "uint104" + } + }, + "visibility": "internal" + } + ], + "src": "10847:9:53" + }, + "scope": 11703, + "src": "10791:218:53", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 10524, + "nodeType": "Block", + "src": "11360:149:53", + "statements": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 10511, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 10505, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10500, + "src": "11374:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "expression": { + "arguments": [ + { + "id": 10508, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "11387:6:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint96_$", + "typeString": "type(uint96)" + }, + "typeName": { + "id": 10507, + "name": "uint96", + "nodeType": "ElementaryTypeName", + "src": "11387:6:53", + "typeDescriptions": {} + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_type$_t_uint96_$", + "typeString": "type(uint96)" + } + ], + "id": 10506, + "name": "type", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -27, + "src": "11382:4:53", + "typeDescriptions": { + "typeIdentifier": "t_function_metatype_pure$__$returns$__$", + "typeString": "function () pure" + } + }, + "id": 10509, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "11382:12:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_magic_meta_type_t_uint96", + "typeString": "type(uint96)" + } + }, + "id": 10510, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "11395:3:53", + "memberName": "max", + "nodeType": "MemberAccess", + "src": "11382:16:53", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "src": "11374:24:53", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 10518, + "nodeType": "IfStatement", + "src": "11370:103:53", + "trueBody": { + "id": 10517, + "nodeType": "Block", + "src": "11400:73:53", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "hexValue": "3936", + "id": 10513, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "11452:2:53", + "typeDescriptions": { + "typeIdentifier": "t_rational_96_by_1", + "typeString": "int_const 96" + }, + "value": "96" + }, + { + "id": 10514, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10500, + "src": "11456:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_96_by_1", + "typeString": "int_const 96" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 10512, + "name": "SafeCastOverflowedUintDowncast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9948, + "src": "11421:30:53", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint8_$_t_uint256_$returns$_t_error_$", + "typeString": "function (uint8,uint256) pure returns (error)" + } + }, + "id": 10515, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "11421:41:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 10516, + "nodeType": "RevertStatement", + "src": "11414:48:53" + } + ] + } + }, + { + "expression": { + "arguments": [ + { + "id": 10521, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10500, + "src": "11496:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 10520, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "11489:6:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint96_$", + "typeString": "type(uint96)" + }, + "typeName": { + "id": 10519, + "name": "uint96", + "nodeType": "ElementaryTypeName", + "src": "11489:6:53", + "typeDescriptions": {} + } + }, + "id": 10522, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "11489:13:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "functionReturnParameters": 10504, + "id": 10523, + "nodeType": "Return", + "src": "11482:20:53" + } + ] + }, + "documentation": { + "id": 10498, + "nodeType": "StructuredDocumentation", + "src": "11015:276:53", + "text": " @dev Returns the downcasted uint96 from uint256, reverting on\n overflow (when the input is greater than largest uint96).\n Counterpart to Solidity's `uint96` operator.\n Requirements:\n - input must fit into 96 bits" + }, + "id": 10525, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toUint96", + "nameLocation": "11305:8:53", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 10501, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10500, + "mutability": "mutable", + "name": "value", + "nameLocation": "11322:5:53", + "nodeType": "VariableDeclaration", + "scope": 10525, + "src": "11314:13:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 10499, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "11314:7:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "11313:15:53" + }, + "returnParameters": { + "id": 10504, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10503, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 10525, + "src": "11352:6:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "typeName": { + "id": 10502, + "name": "uint96", + "nodeType": "ElementaryTypeName", + "src": "11352:6:53", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "visibility": "internal" + } + ], + "src": "11351:8:53" + }, + "scope": 11703, + "src": "11296:213:53", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 10552, + "nodeType": "Block", + "src": "11860:149:53", + "statements": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 10539, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 10533, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10528, + "src": "11874:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "expression": { + "arguments": [ + { + "id": 10536, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "11887:6:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint88_$", + "typeString": "type(uint88)" + }, + "typeName": { + "id": 10535, + "name": "uint88", + "nodeType": "ElementaryTypeName", + "src": "11887:6:53", + "typeDescriptions": {} + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_type$_t_uint88_$", + "typeString": "type(uint88)" + } + ], + "id": 10534, + "name": "type", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -27, + "src": "11882:4:53", + "typeDescriptions": { + "typeIdentifier": "t_function_metatype_pure$__$returns$__$", + "typeString": "function () pure" + } + }, + "id": 10537, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "11882:12:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_magic_meta_type_t_uint88", + "typeString": "type(uint88)" + } + }, + "id": 10538, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "11895:3:53", + "memberName": "max", + "nodeType": "MemberAccess", + "src": "11882:16:53", + "typeDescriptions": { + "typeIdentifier": "t_uint88", + "typeString": "uint88" + } + }, + "src": "11874:24:53", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 10546, + "nodeType": "IfStatement", + "src": "11870:103:53", + "trueBody": { + "id": 10545, + "nodeType": "Block", + "src": "11900:73:53", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "hexValue": "3838", + "id": 10541, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "11952:2:53", + "typeDescriptions": { + "typeIdentifier": "t_rational_88_by_1", + "typeString": "int_const 88" + }, + "value": "88" + }, + { + "id": 10542, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10528, + "src": "11956:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_88_by_1", + "typeString": "int_const 88" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 10540, + "name": "SafeCastOverflowedUintDowncast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9948, + "src": "11921:30:53", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint8_$_t_uint256_$returns$_t_error_$", + "typeString": "function (uint8,uint256) pure returns (error)" + } + }, + "id": 10543, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "11921:41:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 10544, + "nodeType": "RevertStatement", + "src": "11914:48:53" + } + ] + } + }, + { + "expression": { + "arguments": [ + { + "id": 10549, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10528, + "src": "11996:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 10548, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "11989:6:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint88_$", + "typeString": "type(uint88)" + }, + "typeName": { + "id": 10547, + "name": "uint88", + "nodeType": "ElementaryTypeName", + "src": "11989:6:53", + "typeDescriptions": {} + } + }, + "id": 10550, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "11989:13:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint88", + "typeString": "uint88" + } + }, + "functionReturnParameters": 10532, + "id": 10551, + "nodeType": "Return", + "src": "11982:20:53" + } + ] + }, + "documentation": { + "id": 10526, + "nodeType": "StructuredDocumentation", + "src": "11515:276:53", + "text": " @dev Returns the downcasted uint88 from uint256, reverting on\n overflow (when the input is greater than largest uint88).\n Counterpart to Solidity's `uint88` operator.\n Requirements:\n - input must fit into 88 bits" + }, + "id": 10553, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toUint88", + "nameLocation": "11805:8:53", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 10529, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10528, + "mutability": "mutable", + "name": "value", + "nameLocation": "11822:5:53", + "nodeType": "VariableDeclaration", + "scope": 10553, + "src": "11814:13:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 10527, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "11814:7:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "11813:15:53" + }, + "returnParameters": { + "id": 10532, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10531, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 10553, + "src": "11852:6:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint88", + "typeString": "uint88" + }, + "typeName": { + "id": 10530, + "name": "uint88", + "nodeType": "ElementaryTypeName", + "src": "11852:6:53", + "typeDescriptions": { + "typeIdentifier": "t_uint88", + "typeString": "uint88" + } + }, + "visibility": "internal" + } + ], + "src": "11851:8:53" + }, + "scope": 11703, + "src": "11796:213:53", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 10580, + "nodeType": "Block", + "src": "12360:149:53", + "statements": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 10567, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 10561, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10556, + "src": "12374:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "expression": { + "arguments": [ + { + "id": 10564, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "12387:6:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint80_$", + "typeString": "type(uint80)" + }, + "typeName": { + "id": 10563, + "name": "uint80", + "nodeType": "ElementaryTypeName", + "src": "12387:6:53", + "typeDescriptions": {} + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_type$_t_uint80_$", + "typeString": "type(uint80)" + } + ], + "id": 10562, + "name": "type", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -27, + "src": "12382:4:53", + "typeDescriptions": { + "typeIdentifier": "t_function_metatype_pure$__$returns$__$", + "typeString": "function () pure" + } + }, + "id": 10565, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "12382:12:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_magic_meta_type_t_uint80", + "typeString": "type(uint80)" + } + }, + "id": 10566, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "12395:3:53", + "memberName": "max", + "nodeType": "MemberAccess", + "src": "12382:16:53", + "typeDescriptions": { + "typeIdentifier": "t_uint80", + "typeString": "uint80" + } + }, + "src": "12374:24:53", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 10574, + "nodeType": "IfStatement", + "src": "12370:103:53", + "trueBody": { + "id": 10573, + "nodeType": "Block", + "src": "12400:73:53", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "hexValue": "3830", + "id": 10569, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12452:2:53", + "typeDescriptions": { + "typeIdentifier": "t_rational_80_by_1", + "typeString": "int_const 80" + }, + "value": "80" + }, + { + "id": 10570, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10556, + "src": "12456:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_80_by_1", + "typeString": "int_const 80" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 10568, + "name": "SafeCastOverflowedUintDowncast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9948, + "src": "12421:30:53", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint8_$_t_uint256_$returns$_t_error_$", + "typeString": "function (uint8,uint256) pure returns (error)" + } + }, + "id": 10571, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "12421:41:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 10572, + "nodeType": "RevertStatement", + "src": "12414:48:53" + } + ] + } + }, + { + "expression": { + "arguments": [ + { + "id": 10577, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10556, + "src": "12496:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 10576, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "12489:6:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint80_$", + "typeString": "type(uint80)" + }, + "typeName": { + "id": 10575, + "name": "uint80", + "nodeType": "ElementaryTypeName", + "src": "12489:6:53", + "typeDescriptions": {} + } + }, + "id": 10578, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "12489:13:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint80", + "typeString": "uint80" + } + }, + "functionReturnParameters": 10560, + "id": 10579, + "nodeType": "Return", + "src": "12482:20:53" + } + ] + }, + "documentation": { + "id": 10554, + "nodeType": "StructuredDocumentation", + "src": "12015:276:53", + "text": " @dev Returns the downcasted uint80 from uint256, reverting on\n overflow (when the input is greater than largest uint80).\n Counterpart to Solidity's `uint80` operator.\n Requirements:\n - input must fit into 80 bits" + }, + "id": 10581, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toUint80", + "nameLocation": "12305:8:53", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 10557, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10556, + "mutability": "mutable", + "name": "value", + "nameLocation": "12322:5:53", + "nodeType": "VariableDeclaration", + "scope": 10581, + "src": "12314:13:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 10555, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "12314:7:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "12313:15:53" + }, + "returnParameters": { + "id": 10560, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10559, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 10581, + "src": "12352:6:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint80", + "typeString": "uint80" + }, + "typeName": { + "id": 10558, + "name": "uint80", + "nodeType": "ElementaryTypeName", + "src": "12352:6:53", + "typeDescriptions": { + "typeIdentifier": "t_uint80", + "typeString": "uint80" + } + }, + "visibility": "internal" + } + ], + "src": "12351:8:53" + }, + "scope": 11703, + "src": "12296:213:53", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 10608, + "nodeType": "Block", + "src": "12860:149:53", + "statements": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 10595, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 10589, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10584, + "src": "12874:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "expression": { + "arguments": [ + { + "id": 10592, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "12887:6:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint72_$", + "typeString": "type(uint72)" + }, + "typeName": { + "id": 10591, + "name": "uint72", + "nodeType": "ElementaryTypeName", + "src": "12887:6:53", + "typeDescriptions": {} + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_type$_t_uint72_$", + "typeString": "type(uint72)" + } + ], + "id": 10590, + "name": "type", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -27, + "src": "12882:4:53", + "typeDescriptions": { + "typeIdentifier": "t_function_metatype_pure$__$returns$__$", + "typeString": "function () pure" + } + }, + "id": 10593, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "12882:12:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_magic_meta_type_t_uint72", + "typeString": "type(uint72)" + } + }, + "id": 10594, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "12895:3:53", + "memberName": "max", + "nodeType": "MemberAccess", + "src": "12882:16:53", + "typeDescriptions": { + "typeIdentifier": "t_uint72", + "typeString": "uint72" + } + }, + "src": "12874:24:53", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 10602, + "nodeType": "IfStatement", + "src": "12870:103:53", + "trueBody": { + "id": 10601, + "nodeType": "Block", + "src": "12900:73:53", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "hexValue": "3732", + "id": 10597, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12952:2:53", + "typeDescriptions": { + "typeIdentifier": "t_rational_72_by_1", + "typeString": "int_const 72" + }, + "value": "72" + }, + { + "id": 10598, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10584, + "src": "12956:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_72_by_1", + "typeString": "int_const 72" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 10596, + "name": "SafeCastOverflowedUintDowncast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9948, + "src": "12921:30:53", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint8_$_t_uint256_$returns$_t_error_$", + "typeString": "function (uint8,uint256) pure returns (error)" + } + }, + "id": 10599, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "12921:41:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 10600, + "nodeType": "RevertStatement", + "src": "12914:48:53" + } + ] + } + }, + { + "expression": { + "arguments": [ + { + "id": 10605, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10584, + "src": "12996:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 10604, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "12989:6:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint72_$", + "typeString": "type(uint72)" + }, + "typeName": { + "id": 10603, + "name": "uint72", + "nodeType": "ElementaryTypeName", + "src": "12989:6:53", + "typeDescriptions": {} + } + }, + "id": 10606, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "12989:13:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint72", + "typeString": "uint72" + } + }, + "functionReturnParameters": 10588, + "id": 10607, + "nodeType": "Return", + "src": "12982:20:53" + } + ] + }, + "documentation": { + "id": 10582, + "nodeType": "StructuredDocumentation", + "src": "12515:276:53", + "text": " @dev Returns the downcasted uint72 from uint256, reverting on\n overflow (when the input is greater than largest uint72).\n Counterpart to Solidity's `uint72` operator.\n Requirements:\n - input must fit into 72 bits" + }, + "id": 10609, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toUint72", + "nameLocation": "12805:8:53", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 10585, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10584, + "mutability": "mutable", + "name": "value", + "nameLocation": "12822:5:53", + "nodeType": "VariableDeclaration", + "scope": 10609, + "src": "12814:13:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 10583, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "12814:7:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "12813:15:53" + }, + "returnParameters": { + "id": 10588, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10587, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 10609, + "src": "12852:6:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint72", + "typeString": "uint72" + }, + "typeName": { + "id": 10586, + "name": "uint72", + "nodeType": "ElementaryTypeName", + "src": "12852:6:53", + "typeDescriptions": { + "typeIdentifier": "t_uint72", + "typeString": "uint72" + } + }, + "visibility": "internal" + } + ], + "src": "12851:8:53" + }, + "scope": 11703, + "src": "12796:213:53", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 10636, + "nodeType": "Block", + "src": "13360:149:53", + "statements": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 10623, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 10617, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10612, + "src": "13374:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "expression": { + "arguments": [ + { + "id": 10620, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "13387:6:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint64_$", + "typeString": "type(uint64)" + }, + "typeName": { + "id": 10619, + "name": "uint64", + "nodeType": "ElementaryTypeName", + "src": "13387:6:53", + "typeDescriptions": {} + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_type$_t_uint64_$", + "typeString": "type(uint64)" + } + ], + "id": 10618, + "name": "type", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -27, + "src": "13382:4:53", + "typeDescriptions": { + "typeIdentifier": "t_function_metatype_pure$__$returns$__$", + "typeString": "function () pure" + } + }, + "id": 10621, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "13382:12:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_magic_meta_type_t_uint64", + "typeString": "type(uint64)" + } + }, + "id": 10622, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "13395:3:53", + "memberName": "max", + "nodeType": "MemberAccess", + "src": "13382:16:53", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "src": "13374:24:53", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 10630, + "nodeType": "IfStatement", + "src": "13370:103:53", + "trueBody": { + "id": 10629, + "nodeType": "Block", + "src": "13400:73:53", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "hexValue": "3634", + "id": 10625, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13452:2:53", + "typeDescriptions": { + "typeIdentifier": "t_rational_64_by_1", + "typeString": "int_const 64" + }, + "value": "64" + }, + { + "id": 10626, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10612, + "src": "13456:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_64_by_1", + "typeString": "int_const 64" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 10624, + "name": "SafeCastOverflowedUintDowncast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9948, + "src": "13421:30:53", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint8_$_t_uint256_$returns$_t_error_$", + "typeString": "function (uint8,uint256) pure returns (error)" + } + }, + "id": 10627, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "13421:41:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 10628, + "nodeType": "RevertStatement", + "src": "13414:48:53" + } + ] + } + }, + { + "expression": { + "arguments": [ + { + "id": 10633, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10612, + "src": "13496:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 10632, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "13489:6:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint64_$", + "typeString": "type(uint64)" + }, + "typeName": { + "id": 10631, + "name": "uint64", + "nodeType": "ElementaryTypeName", + "src": "13489:6:53", + "typeDescriptions": {} + } + }, + "id": 10634, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "13489:13:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "functionReturnParameters": 10616, + "id": 10635, + "nodeType": "Return", + "src": "13482:20:53" + } + ] + }, + "documentation": { + "id": 10610, + "nodeType": "StructuredDocumentation", + "src": "13015:276:53", + "text": " @dev Returns the downcasted uint64 from uint256, reverting on\n overflow (when the input is greater than largest uint64).\n Counterpart to Solidity's `uint64` operator.\n Requirements:\n - input must fit into 64 bits" + }, + "id": 10637, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toUint64", + "nameLocation": "13305:8:53", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 10613, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10612, + "mutability": "mutable", + "name": "value", + "nameLocation": "13322:5:53", + "nodeType": "VariableDeclaration", + "scope": 10637, + "src": "13314:13:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 10611, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "13314:7:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "13313:15:53" + }, + "returnParameters": { + "id": 10616, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10615, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 10637, + "src": "13352:6:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + }, + "typeName": { + "id": 10614, + "name": "uint64", + "nodeType": "ElementaryTypeName", + "src": "13352:6:53", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "visibility": "internal" + } + ], + "src": "13351:8:53" + }, + "scope": 11703, + "src": "13296:213:53", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 10664, + "nodeType": "Block", + "src": "13860:149:53", + "statements": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 10651, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 10645, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10640, + "src": "13874:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "expression": { + "arguments": [ + { + "id": 10648, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "13887:6:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint56_$", + "typeString": "type(uint56)" + }, + "typeName": { + "id": 10647, + "name": "uint56", + "nodeType": "ElementaryTypeName", + "src": "13887:6:53", + "typeDescriptions": {} + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_type$_t_uint56_$", + "typeString": "type(uint56)" + } + ], + "id": 10646, + "name": "type", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -27, + "src": "13882:4:53", + "typeDescriptions": { + "typeIdentifier": "t_function_metatype_pure$__$returns$__$", + "typeString": "function () pure" + } + }, + "id": 10649, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "13882:12:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_magic_meta_type_t_uint56", + "typeString": "type(uint56)" + } + }, + "id": 10650, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "13895:3:53", + "memberName": "max", + "nodeType": "MemberAccess", + "src": "13882:16:53", + "typeDescriptions": { + "typeIdentifier": "t_uint56", + "typeString": "uint56" + } + }, + "src": "13874:24:53", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 10658, + "nodeType": "IfStatement", + "src": "13870:103:53", + "trueBody": { + "id": 10657, + "nodeType": "Block", + "src": "13900:73:53", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "hexValue": "3536", + "id": 10653, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13952:2:53", + "typeDescriptions": { + "typeIdentifier": "t_rational_56_by_1", + "typeString": "int_const 56" + }, + "value": "56" + }, + { + "id": 10654, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10640, + "src": "13956:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_56_by_1", + "typeString": "int_const 56" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 10652, + "name": "SafeCastOverflowedUintDowncast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9948, + "src": "13921:30:53", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint8_$_t_uint256_$returns$_t_error_$", + "typeString": "function (uint8,uint256) pure returns (error)" + } + }, + "id": 10655, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "13921:41:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 10656, + "nodeType": "RevertStatement", + "src": "13914:48:53" + } + ] + } + }, + { + "expression": { + "arguments": [ + { + "id": 10661, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10640, + "src": "13996:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 10660, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "13989:6:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint56_$", + "typeString": "type(uint56)" + }, + "typeName": { + "id": 10659, + "name": "uint56", + "nodeType": "ElementaryTypeName", + "src": "13989:6:53", + "typeDescriptions": {} + } + }, + "id": 10662, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "13989:13:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint56", + "typeString": "uint56" + } + }, + "functionReturnParameters": 10644, + "id": 10663, + "nodeType": "Return", + "src": "13982:20:53" + } + ] + }, + "documentation": { + "id": 10638, + "nodeType": "StructuredDocumentation", + "src": "13515:276:53", + "text": " @dev Returns the downcasted uint56 from uint256, reverting on\n overflow (when the input is greater than largest uint56).\n Counterpart to Solidity's `uint56` operator.\n Requirements:\n - input must fit into 56 bits" + }, + "id": 10665, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toUint56", + "nameLocation": "13805:8:53", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 10641, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10640, + "mutability": "mutable", + "name": "value", + "nameLocation": "13822:5:53", + "nodeType": "VariableDeclaration", + "scope": 10665, + "src": "13814:13:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 10639, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "13814:7:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "13813:15:53" + }, + "returnParameters": { + "id": 10644, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10643, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 10665, + "src": "13852:6:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint56", + "typeString": "uint56" + }, + "typeName": { + "id": 10642, + "name": "uint56", + "nodeType": "ElementaryTypeName", + "src": "13852:6:53", + "typeDescriptions": { + "typeIdentifier": "t_uint56", + "typeString": "uint56" + } + }, + "visibility": "internal" + } + ], + "src": "13851:8:53" + }, + "scope": 11703, + "src": "13796:213:53", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 10692, + "nodeType": "Block", + "src": "14360:149:53", + "statements": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 10679, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 10673, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10668, + "src": "14374:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "expression": { + "arguments": [ + { + "id": 10676, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "14387:6:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint48_$", + "typeString": "type(uint48)" + }, + "typeName": { + "id": 10675, + "name": "uint48", + "nodeType": "ElementaryTypeName", + "src": "14387:6:53", + "typeDescriptions": {} + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_type$_t_uint48_$", + "typeString": "type(uint48)" + } + ], + "id": 10674, + "name": "type", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -27, + "src": "14382:4:53", + "typeDescriptions": { + "typeIdentifier": "t_function_metatype_pure$__$returns$__$", + "typeString": "function () pure" + } + }, + "id": 10677, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "14382:12:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_magic_meta_type_t_uint48", + "typeString": "type(uint48)" + } + }, + "id": 10678, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "14395:3:53", + "memberName": "max", + "nodeType": "MemberAccess", + "src": "14382:16:53", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "src": "14374:24:53", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 10686, + "nodeType": "IfStatement", + "src": "14370:103:53", + "trueBody": { + "id": 10685, + "nodeType": "Block", + "src": "14400:73:53", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "hexValue": "3438", + "id": 10681, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "14452:2:53", + "typeDescriptions": { + "typeIdentifier": "t_rational_48_by_1", + "typeString": "int_const 48" + }, + "value": "48" + }, + { + "id": 10682, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10668, + "src": "14456:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_48_by_1", + "typeString": "int_const 48" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 10680, + "name": "SafeCastOverflowedUintDowncast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9948, + "src": "14421:30:53", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint8_$_t_uint256_$returns$_t_error_$", + "typeString": "function (uint8,uint256) pure returns (error)" + } + }, + "id": 10683, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "14421:41:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 10684, + "nodeType": "RevertStatement", + "src": "14414:48:53" + } + ] + } + }, + { + "expression": { + "arguments": [ + { + "id": 10689, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10668, + "src": "14496:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 10688, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "14489:6:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint48_$", + "typeString": "type(uint48)" + }, + "typeName": { + "id": 10687, + "name": "uint48", + "nodeType": "ElementaryTypeName", + "src": "14489:6:53", + "typeDescriptions": {} + } + }, + "id": 10690, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "14489:13:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "functionReturnParameters": 10672, + "id": 10691, + "nodeType": "Return", + "src": "14482:20:53" + } + ] + }, + "documentation": { + "id": 10666, + "nodeType": "StructuredDocumentation", + "src": "14015:276:53", + "text": " @dev Returns the downcasted uint48 from uint256, reverting on\n overflow (when the input is greater than largest uint48).\n Counterpart to Solidity's `uint48` operator.\n Requirements:\n - input must fit into 48 bits" + }, + "id": 10693, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toUint48", + "nameLocation": "14305:8:53", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 10669, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10668, + "mutability": "mutable", + "name": "value", + "nameLocation": "14322:5:53", + "nodeType": "VariableDeclaration", + "scope": 10693, + "src": "14314:13:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 10667, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "14314:7:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "14313:15:53" + }, + "returnParameters": { + "id": 10672, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10671, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 10693, + "src": "14352:6:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + }, + "typeName": { + "id": 10670, + "name": "uint48", + "nodeType": "ElementaryTypeName", + "src": "14352:6:53", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "visibility": "internal" + } + ], + "src": "14351:8:53" + }, + "scope": 11703, + "src": "14296:213:53", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 10720, + "nodeType": "Block", + "src": "14860:149:53", + "statements": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 10707, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 10701, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10696, + "src": "14874:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "expression": { + "arguments": [ + { + "id": 10704, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "14887:6:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint40_$", + "typeString": "type(uint40)" + }, + "typeName": { + "id": 10703, + "name": "uint40", + "nodeType": "ElementaryTypeName", + "src": "14887:6:53", + "typeDescriptions": {} + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_type$_t_uint40_$", + "typeString": "type(uint40)" + } + ], + "id": 10702, + "name": "type", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -27, + "src": "14882:4:53", + "typeDescriptions": { + "typeIdentifier": "t_function_metatype_pure$__$returns$__$", + "typeString": "function () pure" + } + }, + "id": 10705, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "14882:12:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_magic_meta_type_t_uint40", + "typeString": "type(uint40)" + } + }, + "id": 10706, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "14895:3:53", + "memberName": "max", + "nodeType": "MemberAccess", + "src": "14882:16:53", + "typeDescriptions": { + "typeIdentifier": "t_uint40", + "typeString": "uint40" + } + }, + "src": "14874:24:53", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 10714, + "nodeType": "IfStatement", + "src": "14870:103:53", + "trueBody": { + "id": 10713, + "nodeType": "Block", + "src": "14900:73:53", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "hexValue": "3430", + "id": 10709, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "14952:2:53", + "typeDescriptions": { + "typeIdentifier": "t_rational_40_by_1", + "typeString": "int_const 40" + }, + "value": "40" + }, + { + "id": 10710, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10696, + "src": "14956:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_40_by_1", + "typeString": "int_const 40" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 10708, + "name": "SafeCastOverflowedUintDowncast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9948, + "src": "14921:30:53", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint8_$_t_uint256_$returns$_t_error_$", + "typeString": "function (uint8,uint256) pure returns (error)" + } + }, + "id": 10711, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "14921:41:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 10712, + "nodeType": "RevertStatement", + "src": "14914:48:53" + } + ] + } + }, + { + "expression": { + "arguments": [ + { + "id": 10717, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10696, + "src": "14996:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 10716, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "14989:6:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint40_$", + "typeString": "type(uint40)" + }, + "typeName": { + "id": 10715, + "name": "uint40", + "nodeType": "ElementaryTypeName", + "src": "14989:6:53", + "typeDescriptions": {} + } + }, + "id": 10718, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "14989:13:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint40", + "typeString": "uint40" + } + }, + "functionReturnParameters": 10700, + "id": 10719, + "nodeType": "Return", + "src": "14982:20:53" + } + ] + }, + "documentation": { + "id": 10694, + "nodeType": "StructuredDocumentation", + "src": "14515:276:53", + "text": " @dev Returns the downcasted uint40 from uint256, reverting on\n overflow (when the input is greater than largest uint40).\n Counterpart to Solidity's `uint40` operator.\n Requirements:\n - input must fit into 40 bits" + }, + "id": 10721, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toUint40", + "nameLocation": "14805:8:53", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 10697, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10696, + "mutability": "mutable", + "name": "value", + "nameLocation": "14822:5:53", + "nodeType": "VariableDeclaration", + "scope": 10721, + "src": "14814:13:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 10695, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "14814:7:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "14813:15:53" + }, + "returnParameters": { + "id": 10700, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10699, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 10721, + "src": "14852:6:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint40", + "typeString": "uint40" + }, + "typeName": { + "id": 10698, + "name": "uint40", + "nodeType": "ElementaryTypeName", + "src": "14852:6:53", + "typeDescriptions": { + "typeIdentifier": "t_uint40", + "typeString": "uint40" + } + }, + "visibility": "internal" + } + ], + "src": "14851:8:53" + }, + "scope": 11703, + "src": "14796:213:53", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 10748, + "nodeType": "Block", + "src": "15360:149:53", + "statements": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 10735, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 10729, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10724, + "src": "15374:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "expression": { + "arguments": [ + { + "id": 10732, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "15387:6:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint32_$", + "typeString": "type(uint32)" + }, + "typeName": { + "id": 10731, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "15387:6:53", + "typeDescriptions": {} + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_type$_t_uint32_$", + "typeString": "type(uint32)" + } + ], + "id": 10730, + "name": "type", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -27, + "src": "15382:4:53", + "typeDescriptions": { + "typeIdentifier": "t_function_metatype_pure$__$returns$__$", + "typeString": "function () pure" + } + }, + "id": 10733, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "15382:12:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_magic_meta_type_t_uint32", + "typeString": "type(uint32)" + } + }, + "id": 10734, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "15395:3:53", + "memberName": "max", + "nodeType": "MemberAccess", + "src": "15382:16:53", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "src": "15374:24:53", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 10742, + "nodeType": "IfStatement", + "src": "15370:103:53", + "trueBody": { + "id": 10741, + "nodeType": "Block", + "src": "15400:73:53", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "hexValue": "3332", + "id": 10737, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "15452:2:53", + "typeDescriptions": { + "typeIdentifier": "t_rational_32_by_1", + "typeString": "int_const 32" + }, + "value": "32" + }, + { + "id": 10738, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10724, + "src": "15456:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_32_by_1", + "typeString": "int_const 32" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 10736, + "name": "SafeCastOverflowedUintDowncast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9948, + "src": "15421:30:53", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint8_$_t_uint256_$returns$_t_error_$", + "typeString": "function (uint8,uint256) pure returns (error)" + } + }, + "id": 10739, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "15421:41:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 10740, + "nodeType": "RevertStatement", + "src": "15414:48:53" + } + ] + } + }, + { + "expression": { + "arguments": [ + { + "id": 10745, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10724, + "src": "15496:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 10744, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "15489:6:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint32_$", + "typeString": "type(uint32)" + }, + "typeName": { + "id": 10743, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "15489:6:53", + "typeDescriptions": {} + } + }, + "id": 10746, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "15489:13:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "functionReturnParameters": 10728, + "id": 10747, + "nodeType": "Return", + "src": "15482:20:53" + } + ] + }, + "documentation": { + "id": 10722, + "nodeType": "StructuredDocumentation", + "src": "15015:276:53", + "text": " @dev Returns the downcasted uint32 from uint256, reverting on\n overflow (when the input is greater than largest uint32).\n Counterpart to Solidity's `uint32` operator.\n Requirements:\n - input must fit into 32 bits" + }, + "id": 10749, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toUint32", + "nameLocation": "15305:8:53", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 10725, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10724, + "mutability": "mutable", + "name": "value", + "nameLocation": "15322:5:53", + "nodeType": "VariableDeclaration", + "scope": 10749, + "src": "15314:13:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 10723, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "15314:7:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "15313:15:53" + }, + "returnParameters": { + "id": 10728, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10727, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 10749, + "src": "15352:6:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 10726, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "15352:6:53", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + } + ], + "src": "15351:8:53" + }, + "scope": 11703, + "src": "15296:213:53", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 10776, + "nodeType": "Block", + "src": "15860:149:53", + "statements": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 10763, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 10757, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10752, + "src": "15874:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "expression": { + "arguments": [ + { + "id": 10760, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "15887:6:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint24_$", + "typeString": "type(uint24)" + }, + "typeName": { + "id": 10759, + "name": "uint24", + "nodeType": "ElementaryTypeName", + "src": "15887:6:53", + "typeDescriptions": {} + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_type$_t_uint24_$", + "typeString": "type(uint24)" + } + ], + "id": 10758, + "name": "type", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -27, + "src": "15882:4:53", + "typeDescriptions": { + "typeIdentifier": "t_function_metatype_pure$__$returns$__$", + "typeString": "function () pure" + } + }, + "id": 10761, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "15882:12:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_magic_meta_type_t_uint24", + "typeString": "type(uint24)" + } + }, + "id": 10762, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "15895:3:53", + "memberName": "max", + "nodeType": "MemberAccess", + "src": "15882:16:53", + "typeDescriptions": { + "typeIdentifier": "t_uint24", + "typeString": "uint24" + } + }, + "src": "15874:24:53", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 10770, + "nodeType": "IfStatement", + "src": "15870:103:53", + "trueBody": { + "id": 10769, + "nodeType": "Block", + "src": "15900:73:53", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "hexValue": "3234", + "id": 10765, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "15952:2:53", + "typeDescriptions": { + "typeIdentifier": "t_rational_24_by_1", + "typeString": "int_const 24" + }, + "value": "24" + }, + { + "id": 10766, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10752, + "src": "15956:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_24_by_1", + "typeString": "int_const 24" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 10764, + "name": "SafeCastOverflowedUintDowncast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9948, + "src": "15921:30:53", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint8_$_t_uint256_$returns$_t_error_$", + "typeString": "function (uint8,uint256) pure returns (error)" + } + }, + "id": 10767, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "15921:41:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 10768, + "nodeType": "RevertStatement", + "src": "15914:48:53" + } + ] + } + }, + { + "expression": { + "arguments": [ + { + "id": 10773, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10752, + "src": "15996:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 10772, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "15989:6:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint24_$", + "typeString": "type(uint24)" + }, + "typeName": { + "id": 10771, + "name": "uint24", + "nodeType": "ElementaryTypeName", + "src": "15989:6:53", + "typeDescriptions": {} + } + }, + "id": 10774, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "15989:13:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint24", + "typeString": "uint24" + } + }, + "functionReturnParameters": 10756, + "id": 10775, + "nodeType": "Return", + "src": "15982:20:53" + } + ] + }, + "documentation": { + "id": 10750, + "nodeType": "StructuredDocumentation", + "src": "15515:276:53", + "text": " @dev Returns the downcasted uint24 from uint256, reverting on\n overflow (when the input is greater than largest uint24).\n Counterpart to Solidity's `uint24` operator.\n Requirements:\n - input must fit into 24 bits" + }, + "id": 10777, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toUint24", + "nameLocation": "15805:8:53", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 10753, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10752, + "mutability": "mutable", + "name": "value", + "nameLocation": "15822:5:53", + "nodeType": "VariableDeclaration", + "scope": 10777, + "src": "15814:13:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 10751, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "15814:7:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "15813:15:53" + }, + "returnParameters": { + "id": 10756, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10755, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 10777, + "src": "15852:6:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint24", + "typeString": "uint24" + }, + "typeName": { + "id": 10754, + "name": "uint24", + "nodeType": "ElementaryTypeName", + "src": "15852:6:53", + "typeDescriptions": { + "typeIdentifier": "t_uint24", + "typeString": "uint24" + } + }, + "visibility": "internal" + } + ], + "src": "15851:8:53" + }, + "scope": 11703, + "src": "15796:213:53", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 10804, + "nodeType": "Block", + "src": "16360:149:53", + "statements": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 10791, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 10785, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10780, + "src": "16374:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "expression": { + "arguments": [ + { + "id": 10788, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "16387:6:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint16_$", + "typeString": "type(uint16)" + }, + "typeName": { + "id": 10787, + "name": "uint16", + "nodeType": "ElementaryTypeName", + "src": "16387:6:53", + "typeDescriptions": {} + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_type$_t_uint16_$", + "typeString": "type(uint16)" + } + ], + "id": 10786, + "name": "type", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -27, + "src": "16382:4:53", + "typeDescriptions": { + "typeIdentifier": "t_function_metatype_pure$__$returns$__$", + "typeString": "function () pure" + } + }, + "id": 10789, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "16382:12:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_magic_meta_type_t_uint16", + "typeString": "type(uint16)" + } + }, + "id": 10790, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "16395:3:53", + "memberName": "max", + "nodeType": "MemberAccess", + "src": "16382:16:53", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "src": "16374:24:53", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 10798, + "nodeType": "IfStatement", + "src": "16370:103:53", + "trueBody": { + "id": 10797, + "nodeType": "Block", + "src": "16400:73:53", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "hexValue": "3136", + "id": 10793, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "16452:2:53", + "typeDescriptions": { + "typeIdentifier": "t_rational_16_by_1", + "typeString": "int_const 16" + }, + "value": "16" + }, + { + "id": 10794, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10780, + "src": "16456:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_16_by_1", + "typeString": "int_const 16" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 10792, + "name": "SafeCastOverflowedUintDowncast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9948, + "src": "16421:30:53", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint8_$_t_uint256_$returns$_t_error_$", + "typeString": "function (uint8,uint256) pure returns (error)" + } + }, + "id": 10795, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "16421:41:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 10796, + "nodeType": "RevertStatement", + "src": "16414:48:53" + } + ] + } + }, + { + "expression": { + "arguments": [ + { + "id": 10801, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10780, + "src": "16496:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 10800, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "16489:6:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint16_$", + "typeString": "type(uint16)" + }, + "typeName": { + "id": 10799, + "name": "uint16", + "nodeType": "ElementaryTypeName", + "src": "16489:6:53", + "typeDescriptions": {} + } + }, + "id": 10802, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "16489:13:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "functionReturnParameters": 10784, + "id": 10803, + "nodeType": "Return", + "src": "16482:20:53" + } + ] + }, + "documentation": { + "id": 10778, + "nodeType": "StructuredDocumentation", + "src": "16015:276:53", + "text": " @dev Returns the downcasted uint16 from uint256, reverting on\n overflow (when the input is greater than largest uint16).\n Counterpart to Solidity's `uint16` operator.\n Requirements:\n - input must fit into 16 bits" + }, + "id": 10805, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toUint16", + "nameLocation": "16305:8:53", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 10781, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10780, + "mutability": "mutable", + "name": "value", + "nameLocation": "16322:5:53", + "nodeType": "VariableDeclaration", + "scope": 10805, + "src": "16314:13:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 10779, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "16314:7:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "16313:15:53" + }, + "returnParameters": { + "id": 10784, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10783, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 10805, + "src": "16352:6:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + }, + "typeName": { + "id": 10782, + "name": "uint16", + "nodeType": "ElementaryTypeName", + "src": "16352:6:53", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "visibility": "internal" + } + ], + "src": "16351:8:53" + }, + "scope": 11703, + "src": "16296:213:53", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 10832, + "nodeType": "Block", + "src": "16854:146:53", + "statements": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 10819, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 10813, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10808, + "src": "16868:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "expression": { + "arguments": [ + { + "id": 10816, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "16881:5:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint8_$", + "typeString": "type(uint8)" + }, + "typeName": { + "id": 10815, + "name": "uint8", + "nodeType": "ElementaryTypeName", + "src": "16881:5:53", + "typeDescriptions": {} + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_type$_t_uint8_$", + "typeString": "type(uint8)" + } + ], + "id": 10814, + "name": "type", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -27, + "src": "16876:4:53", + "typeDescriptions": { + "typeIdentifier": "t_function_metatype_pure$__$returns$__$", + "typeString": "function () pure" + } + }, + "id": 10817, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "16876:11:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_magic_meta_type_t_uint8", + "typeString": "type(uint8)" + } + }, + "id": 10818, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "16888:3:53", + "memberName": "max", + "nodeType": "MemberAccess", + "src": "16876:15:53", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "src": "16868:23:53", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 10826, + "nodeType": "IfStatement", + "src": "16864:101:53", + "trueBody": { + "id": 10825, + "nodeType": "Block", + "src": "16893:72:53", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "hexValue": "38", + "id": 10821, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "16945:1:53", + "typeDescriptions": { + "typeIdentifier": "t_rational_8_by_1", + "typeString": "int_const 8" + }, + "value": "8" + }, + { + "id": 10822, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10808, + "src": "16948:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_8_by_1", + "typeString": "int_const 8" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 10820, + "name": "SafeCastOverflowedUintDowncast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9948, + "src": "16914:30:53", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint8_$_t_uint256_$returns$_t_error_$", + "typeString": "function (uint8,uint256) pure returns (error)" + } + }, + "id": 10823, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "16914:40:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 10824, + "nodeType": "RevertStatement", + "src": "16907:47:53" + } + ] + } + }, + { + "expression": { + "arguments": [ + { + "id": 10829, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10808, + "src": "16987:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 10828, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "16981:5:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint8_$", + "typeString": "type(uint8)" + }, + "typeName": { + "id": 10827, + "name": "uint8", + "nodeType": "ElementaryTypeName", + "src": "16981:5:53", + "typeDescriptions": {} + } + }, + "id": 10830, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "16981:12:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "functionReturnParameters": 10812, + "id": 10831, + "nodeType": "Return", + "src": "16974:19:53" + } + ] + }, + "documentation": { + "id": 10806, + "nodeType": "StructuredDocumentation", + "src": "16515:272:53", + "text": " @dev Returns the downcasted uint8 from uint256, reverting on\n overflow (when the input is greater than largest uint8).\n Counterpart to Solidity's `uint8` operator.\n Requirements:\n - input must fit into 8 bits" + }, + "id": 10833, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toUint8", + "nameLocation": "16801:7:53", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 10809, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10808, + "mutability": "mutable", + "name": "value", + "nameLocation": "16817:5:53", + "nodeType": "VariableDeclaration", + "scope": 10833, + "src": "16809:13:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 10807, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "16809:7:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "16808:15:53" + }, + "returnParameters": { + "id": 10812, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10811, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 10833, + "src": "16847:5:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "typeName": { + "id": 10810, + "name": "uint8", + "nodeType": "ElementaryTypeName", + "src": "16847:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "visibility": "internal" + } + ], + "src": "16846:7:53" + }, + "scope": 11703, + "src": "16792:208:53", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 10855, + "nodeType": "Block", + "src": "17236:128:53", + "statements": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 10843, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 10841, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10836, + "src": "17250:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "hexValue": "30", + "id": 10842, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "17258:1:53", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "17250:9:53", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 10849, + "nodeType": "IfStatement", + "src": "17246:81:53", + "trueBody": { + "id": 10848, + "nodeType": "Block", + "src": "17261:66:53", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "id": 10845, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10836, + "src": "17310:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + ], + "id": 10844, + "name": "SafeCastOverflowedIntToUint", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9953, + "src": "17282:27:53", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_int256_$returns$_t_error_$", + "typeString": "function (int256) pure returns (error)" + } + }, + "id": 10846, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "17282:34:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 10847, + "nodeType": "RevertStatement", + "src": "17275:41:53" + } + ] + } + }, + { + "expression": { + "arguments": [ + { + "id": 10852, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10836, + "src": "17351:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + ], + "id": 10851, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "17343:7:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + }, + "typeName": { + "id": 10850, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "17343:7:53", + "typeDescriptions": {} + } + }, + "id": 10853, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "17343:14:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 10840, + "id": 10854, + "nodeType": "Return", + "src": "17336:21:53" + } + ] + }, + "documentation": { + "id": 10834, + "nodeType": "StructuredDocumentation", + "src": "17006:160:53", + "text": " @dev Converts a signed int256 into an unsigned uint256.\n Requirements:\n - input must be greater than or equal to 0." + }, + "id": 10856, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toUint256", + "nameLocation": "17180:9:53", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 10837, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10836, + "mutability": "mutable", + "name": "value", + "nameLocation": "17197:5:53", + "nodeType": "VariableDeclaration", + "scope": 10856, + "src": "17190:12:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "typeName": { + "id": 10835, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "17190:6:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "visibility": "internal" + } + ], + "src": "17189:14:53" + }, + "returnParameters": { + "id": 10840, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10839, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 10856, + "src": "17227:7:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 10838, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "17227:7:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "17226:9:53" + }, + "scope": 11703, + "src": "17171:193:53", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 10881, + "nodeType": "Block", + "src": "17761:150:53", + "statements": [ + { + "expression": { + "id": 10869, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 10864, + "name": "downcasted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10862, + "src": "17771:10:53", + "typeDescriptions": { + "typeIdentifier": "t_int248", + "typeString": "int248" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "id": 10867, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10859, + "src": "17791:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + ], + "id": 10866, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "17784:6:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_int248_$", + "typeString": "type(int248)" + }, + "typeName": { + "id": 10865, + "name": "int248", + "nodeType": "ElementaryTypeName", + "src": "17784:6:53", + "typeDescriptions": {} + } + }, + "id": 10868, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "17784:13:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_int248", + "typeString": "int248" + } + }, + "src": "17771:26:53", + "typeDescriptions": { + "typeIdentifier": "t_int248", + "typeString": "int248" + } + }, + "id": 10870, + "nodeType": "ExpressionStatement", + "src": "17771:26:53" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 10873, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 10871, + "name": "downcasted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10862, + "src": "17811:10:53", + "typeDescriptions": { + "typeIdentifier": "t_int248", + "typeString": "int248" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "id": 10872, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10859, + "src": "17825:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "src": "17811:19:53", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 10880, + "nodeType": "IfStatement", + "src": "17807:98:53", + "trueBody": { + "id": 10879, + "nodeType": "Block", + "src": "17832:73:53", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "hexValue": "323438", + "id": 10875, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "17883:3:53", + "typeDescriptions": { + "typeIdentifier": "t_rational_248_by_1", + "typeString": "int_const 248" + }, + "value": "248" + }, + { + "id": 10876, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10859, + "src": "17888:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_248_by_1", + "typeString": "int_const 248" + }, + { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + ], + "id": 10874, + "name": "SafeCastOverflowedIntDowncast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9960, + "src": "17853:29:53", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint8_$_t_int256_$returns$_t_error_$", + "typeString": "function (uint8,int256) pure returns (error)" + } + }, + "id": 10877, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "17853:41:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 10878, + "nodeType": "RevertStatement", + "src": "17846:48:53" + } + ] + } + } + ] + }, + "documentation": { + "id": 10857, + "nodeType": "StructuredDocumentation", + "src": "17370:312:53", + "text": " @dev Returns the downcasted int248 from int256, reverting on\n overflow (when the input is less than smallest int248 or\n greater than largest int248).\n Counterpart to Solidity's `int248` operator.\n Requirements:\n - input must fit into 248 bits" + }, + "id": 10882, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toInt248", + "nameLocation": "17696:8:53", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 10860, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10859, + "mutability": "mutable", + "name": "value", + "nameLocation": "17712:5:53", + "nodeType": "VariableDeclaration", + "scope": 10882, + "src": "17705:12:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "typeName": { + "id": 10858, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "17705:6:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "visibility": "internal" + } + ], + "src": "17704:14:53" + }, + "returnParameters": { + "id": 10863, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10862, + "mutability": "mutable", + "name": "downcasted", + "nameLocation": "17749:10:53", + "nodeType": "VariableDeclaration", + "scope": 10882, + "src": "17742:17:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int248", + "typeString": "int248" + }, + "typeName": { + "id": 10861, + "name": "int248", + "nodeType": "ElementaryTypeName", + "src": "17742:6:53", + "typeDescriptions": { + "typeIdentifier": "t_int248", + "typeString": "int248" + } + }, + "visibility": "internal" + } + ], + "src": "17741:19:53" + }, + "scope": 11703, + "src": "17687:224:53", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 10907, + "nodeType": "Block", + "src": "18308:150:53", + "statements": [ + { + "expression": { + "id": 10895, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 10890, + "name": "downcasted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10888, + "src": "18318:10:53", + "typeDescriptions": { + "typeIdentifier": "t_int240", + "typeString": "int240" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "id": 10893, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10885, + "src": "18338:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + ], + "id": 10892, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "18331:6:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_int240_$", + "typeString": "type(int240)" + }, + "typeName": { + "id": 10891, + "name": "int240", + "nodeType": "ElementaryTypeName", + "src": "18331:6:53", + "typeDescriptions": {} + } + }, + "id": 10894, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "18331:13:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_int240", + "typeString": "int240" + } + }, + "src": "18318:26:53", + "typeDescriptions": { + "typeIdentifier": "t_int240", + "typeString": "int240" + } + }, + "id": 10896, + "nodeType": "ExpressionStatement", + "src": "18318:26:53" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 10899, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 10897, + "name": "downcasted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10888, + "src": "18358:10:53", + "typeDescriptions": { + "typeIdentifier": "t_int240", + "typeString": "int240" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "id": 10898, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10885, + "src": "18372:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "src": "18358:19:53", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 10906, + "nodeType": "IfStatement", + "src": "18354:98:53", + "trueBody": { + "id": 10905, + "nodeType": "Block", + "src": "18379:73:53", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "hexValue": "323430", + "id": 10901, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "18430:3:53", + "typeDescriptions": { + "typeIdentifier": "t_rational_240_by_1", + "typeString": "int_const 240" + }, + "value": "240" + }, + { + "id": 10902, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10885, + "src": "18435:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_240_by_1", + "typeString": "int_const 240" + }, + { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + ], + "id": 10900, + "name": "SafeCastOverflowedIntDowncast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9960, + "src": "18400:29:53", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint8_$_t_int256_$returns$_t_error_$", + "typeString": "function (uint8,int256) pure returns (error)" + } + }, + "id": 10903, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "18400:41:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 10904, + "nodeType": "RevertStatement", + "src": "18393:48:53" + } + ] + } + } + ] + }, + "documentation": { + "id": 10883, + "nodeType": "StructuredDocumentation", + "src": "17917:312:53", + "text": " @dev Returns the downcasted int240 from int256, reverting on\n overflow (when the input is less than smallest int240 or\n greater than largest int240).\n Counterpart to Solidity's `int240` operator.\n Requirements:\n - input must fit into 240 bits" + }, + "id": 10908, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toInt240", + "nameLocation": "18243:8:53", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 10886, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10885, + "mutability": "mutable", + "name": "value", + "nameLocation": "18259:5:53", + "nodeType": "VariableDeclaration", + "scope": 10908, + "src": "18252:12:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "typeName": { + "id": 10884, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "18252:6:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "visibility": "internal" + } + ], + "src": "18251:14:53" + }, + "returnParameters": { + "id": 10889, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10888, + "mutability": "mutable", + "name": "downcasted", + "nameLocation": "18296:10:53", + "nodeType": "VariableDeclaration", + "scope": 10908, + "src": "18289:17:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int240", + "typeString": "int240" + }, + "typeName": { + "id": 10887, + "name": "int240", + "nodeType": "ElementaryTypeName", + "src": "18289:6:53", + "typeDescriptions": { + "typeIdentifier": "t_int240", + "typeString": "int240" + } + }, + "visibility": "internal" + } + ], + "src": "18288:19:53" + }, + "scope": 11703, + "src": "18234:224:53", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 10933, + "nodeType": "Block", + "src": "18855:150:53", + "statements": [ + { + "expression": { + "id": 10921, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 10916, + "name": "downcasted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10914, + "src": "18865:10:53", + "typeDescriptions": { + "typeIdentifier": "t_int232", + "typeString": "int232" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "id": 10919, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10911, + "src": "18885:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + ], + "id": 10918, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "18878:6:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_int232_$", + "typeString": "type(int232)" + }, + "typeName": { + "id": 10917, + "name": "int232", + "nodeType": "ElementaryTypeName", + "src": "18878:6:53", + "typeDescriptions": {} + } + }, + "id": 10920, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "18878:13:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_int232", + "typeString": "int232" + } + }, + "src": "18865:26:53", + "typeDescriptions": { + "typeIdentifier": "t_int232", + "typeString": "int232" + } + }, + "id": 10922, + "nodeType": "ExpressionStatement", + "src": "18865:26:53" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 10925, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 10923, + "name": "downcasted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10914, + "src": "18905:10:53", + "typeDescriptions": { + "typeIdentifier": "t_int232", + "typeString": "int232" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "id": 10924, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10911, + "src": "18919:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "src": "18905:19:53", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 10932, + "nodeType": "IfStatement", + "src": "18901:98:53", + "trueBody": { + "id": 10931, + "nodeType": "Block", + "src": "18926:73:53", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "hexValue": "323332", + "id": 10927, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "18977:3:53", + "typeDescriptions": { + "typeIdentifier": "t_rational_232_by_1", + "typeString": "int_const 232" + }, + "value": "232" + }, + { + "id": 10928, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10911, + "src": "18982:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_232_by_1", + "typeString": "int_const 232" + }, + { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + ], + "id": 10926, + "name": "SafeCastOverflowedIntDowncast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9960, + "src": "18947:29:53", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint8_$_t_int256_$returns$_t_error_$", + "typeString": "function (uint8,int256) pure returns (error)" + } + }, + "id": 10929, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "18947:41:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 10930, + "nodeType": "RevertStatement", + "src": "18940:48:53" + } + ] + } + } + ] + }, + "documentation": { + "id": 10909, + "nodeType": "StructuredDocumentation", + "src": "18464:312:53", + "text": " @dev Returns the downcasted int232 from int256, reverting on\n overflow (when the input is less than smallest int232 or\n greater than largest int232).\n Counterpart to Solidity's `int232` operator.\n Requirements:\n - input must fit into 232 bits" + }, + "id": 10934, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toInt232", + "nameLocation": "18790:8:53", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 10912, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10911, + "mutability": "mutable", + "name": "value", + "nameLocation": "18806:5:53", + "nodeType": "VariableDeclaration", + "scope": 10934, + "src": "18799:12:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "typeName": { + "id": 10910, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "18799:6:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "visibility": "internal" + } + ], + "src": "18798:14:53" + }, + "returnParameters": { + "id": 10915, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10914, + "mutability": "mutable", + "name": "downcasted", + "nameLocation": "18843:10:53", + "nodeType": "VariableDeclaration", + "scope": 10934, + "src": "18836:17:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int232", + "typeString": "int232" + }, + "typeName": { + "id": 10913, + "name": "int232", + "nodeType": "ElementaryTypeName", + "src": "18836:6:53", + "typeDescriptions": { + "typeIdentifier": "t_int232", + "typeString": "int232" + } + }, + "visibility": "internal" + } + ], + "src": "18835:19:53" + }, + "scope": 11703, + "src": "18781:224:53", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 10959, + "nodeType": "Block", + "src": "19402:150:53", + "statements": [ + { + "expression": { + "id": 10947, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 10942, + "name": "downcasted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10940, + "src": "19412:10:53", + "typeDescriptions": { + "typeIdentifier": "t_int224", + "typeString": "int224" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "id": 10945, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10937, + "src": "19432:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + ], + "id": 10944, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "19425:6:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_int224_$", + "typeString": "type(int224)" + }, + "typeName": { + "id": 10943, + "name": "int224", + "nodeType": "ElementaryTypeName", + "src": "19425:6:53", + "typeDescriptions": {} + } + }, + "id": 10946, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "19425:13:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_int224", + "typeString": "int224" + } + }, + "src": "19412:26:53", + "typeDescriptions": { + "typeIdentifier": "t_int224", + "typeString": "int224" + } + }, + "id": 10948, + "nodeType": "ExpressionStatement", + "src": "19412:26:53" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 10951, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 10949, + "name": "downcasted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10940, + "src": "19452:10:53", + "typeDescriptions": { + "typeIdentifier": "t_int224", + "typeString": "int224" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "id": 10950, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10937, + "src": "19466:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "src": "19452:19:53", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 10958, + "nodeType": "IfStatement", + "src": "19448:98:53", + "trueBody": { + "id": 10957, + "nodeType": "Block", + "src": "19473:73:53", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "hexValue": "323234", + "id": 10953, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "19524:3:53", + "typeDescriptions": { + "typeIdentifier": "t_rational_224_by_1", + "typeString": "int_const 224" + }, + "value": "224" + }, + { + "id": 10954, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10937, + "src": "19529:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_224_by_1", + "typeString": "int_const 224" + }, + { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + ], + "id": 10952, + "name": "SafeCastOverflowedIntDowncast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9960, + "src": "19494:29:53", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint8_$_t_int256_$returns$_t_error_$", + "typeString": "function (uint8,int256) pure returns (error)" + } + }, + "id": 10955, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "19494:41:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 10956, + "nodeType": "RevertStatement", + "src": "19487:48:53" + } + ] + } + } + ] + }, + "documentation": { + "id": 10935, + "nodeType": "StructuredDocumentation", + "src": "19011:312:53", + "text": " @dev Returns the downcasted int224 from int256, reverting on\n overflow (when the input is less than smallest int224 or\n greater than largest int224).\n Counterpart to Solidity's `int224` operator.\n Requirements:\n - input must fit into 224 bits" + }, + "id": 10960, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toInt224", + "nameLocation": "19337:8:53", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 10938, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10937, + "mutability": "mutable", + "name": "value", + "nameLocation": "19353:5:53", + "nodeType": "VariableDeclaration", + "scope": 10960, + "src": "19346:12:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "typeName": { + "id": 10936, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "19346:6:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "visibility": "internal" + } + ], + "src": "19345:14:53" + }, + "returnParameters": { + "id": 10941, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10940, + "mutability": "mutable", + "name": "downcasted", + "nameLocation": "19390:10:53", + "nodeType": "VariableDeclaration", + "scope": 10960, + "src": "19383:17:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int224", + "typeString": "int224" + }, + "typeName": { + "id": 10939, + "name": "int224", + "nodeType": "ElementaryTypeName", + "src": "19383:6:53", + "typeDescriptions": { + "typeIdentifier": "t_int224", + "typeString": "int224" + } + }, + "visibility": "internal" + } + ], + "src": "19382:19:53" + }, + "scope": 11703, + "src": "19328:224:53", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 10985, + "nodeType": "Block", + "src": "19949:150:53", + "statements": [ + { + "expression": { + "id": 10973, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 10968, + "name": "downcasted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10966, + "src": "19959:10:53", + "typeDescriptions": { + "typeIdentifier": "t_int216", + "typeString": "int216" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "id": 10971, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10963, + "src": "19979:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + ], + "id": 10970, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "19972:6:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_int216_$", + "typeString": "type(int216)" + }, + "typeName": { + "id": 10969, + "name": "int216", + "nodeType": "ElementaryTypeName", + "src": "19972:6:53", + "typeDescriptions": {} + } + }, + "id": 10972, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "19972:13:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_int216", + "typeString": "int216" + } + }, + "src": "19959:26:53", + "typeDescriptions": { + "typeIdentifier": "t_int216", + "typeString": "int216" + } + }, + "id": 10974, + "nodeType": "ExpressionStatement", + "src": "19959:26:53" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 10977, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 10975, + "name": "downcasted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10966, + "src": "19999:10:53", + "typeDescriptions": { + "typeIdentifier": "t_int216", + "typeString": "int216" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "id": 10976, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10963, + "src": "20013:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "src": "19999:19:53", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 10984, + "nodeType": "IfStatement", + "src": "19995:98:53", + "trueBody": { + "id": 10983, + "nodeType": "Block", + "src": "20020:73:53", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "hexValue": "323136", + "id": 10979, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "20071:3:53", + "typeDescriptions": { + "typeIdentifier": "t_rational_216_by_1", + "typeString": "int_const 216" + }, + "value": "216" + }, + { + "id": 10980, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10963, + "src": "20076:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_216_by_1", + "typeString": "int_const 216" + }, + { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + ], + "id": 10978, + "name": "SafeCastOverflowedIntDowncast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9960, + "src": "20041:29:53", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint8_$_t_int256_$returns$_t_error_$", + "typeString": "function (uint8,int256) pure returns (error)" + } + }, + "id": 10981, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "20041:41:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 10982, + "nodeType": "RevertStatement", + "src": "20034:48:53" + } + ] + } + } + ] + }, + "documentation": { + "id": 10961, + "nodeType": "StructuredDocumentation", + "src": "19558:312:53", + "text": " @dev Returns the downcasted int216 from int256, reverting on\n overflow (when the input is less than smallest int216 or\n greater than largest int216).\n Counterpart to Solidity's `int216` operator.\n Requirements:\n - input must fit into 216 bits" + }, + "id": 10986, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toInt216", + "nameLocation": "19884:8:53", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 10964, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10963, + "mutability": "mutable", + "name": "value", + "nameLocation": "19900:5:53", + "nodeType": "VariableDeclaration", + "scope": 10986, + "src": "19893:12:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "typeName": { + "id": 10962, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "19893:6:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "visibility": "internal" + } + ], + "src": "19892:14:53" + }, + "returnParameters": { + "id": 10967, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10966, + "mutability": "mutable", + "name": "downcasted", + "nameLocation": "19937:10:53", + "nodeType": "VariableDeclaration", + "scope": 10986, + "src": "19930:17:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int216", + "typeString": "int216" + }, + "typeName": { + "id": 10965, + "name": "int216", + "nodeType": "ElementaryTypeName", + "src": "19930:6:53", + "typeDescriptions": { + "typeIdentifier": "t_int216", + "typeString": "int216" + } + }, + "visibility": "internal" + } + ], + "src": "19929:19:53" + }, + "scope": 11703, + "src": "19875:224:53", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 11011, + "nodeType": "Block", + "src": "20496:150:53", + "statements": [ + { + "expression": { + "id": 10999, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 10994, + "name": "downcasted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10992, + "src": "20506:10:53", + "typeDescriptions": { + "typeIdentifier": "t_int208", + "typeString": "int208" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "id": 10997, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10989, + "src": "20526:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + ], + "id": 10996, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "20519:6:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_int208_$", + "typeString": "type(int208)" + }, + "typeName": { + "id": 10995, + "name": "int208", + "nodeType": "ElementaryTypeName", + "src": "20519:6:53", + "typeDescriptions": {} + } + }, + "id": 10998, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "20519:13:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_int208", + "typeString": "int208" + } + }, + "src": "20506:26:53", + "typeDescriptions": { + "typeIdentifier": "t_int208", + "typeString": "int208" + } + }, + "id": 11000, + "nodeType": "ExpressionStatement", + "src": "20506:26:53" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 11003, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 11001, + "name": "downcasted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10992, + "src": "20546:10:53", + "typeDescriptions": { + "typeIdentifier": "t_int208", + "typeString": "int208" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "id": 11002, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10989, + "src": "20560:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "src": "20546:19:53", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 11010, + "nodeType": "IfStatement", + "src": "20542:98:53", + "trueBody": { + "id": 11009, + "nodeType": "Block", + "src": "20567:73:53", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "hexValue": "323038", + "id": 11005, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "20618:3:53", + "typeDescriptions": { + "typeIdentifier": "t_rational_208_by_1", + "typeString": "int_const 208" + }, + "value": "208" + }, + { + "id": 11006, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10989, + "src": "20623:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_208_by_1", + "typeString": "int_const 208" + }, + { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + ], + "id": 11004, + "name": "SafeCastOverflowedIntDowncast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9960, + "src": "20588:29:53", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint8_$_t_int256_$returns$_t_error_$", + "typeString": "function (uint8,int256) pure returns (error)" + } + }, + "id": 11007, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "20588:41:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 11008, + "nodeType": "RevertStatement", + "src": "20581:48:53" + } + ] + } + } + ] + }, + "documentation": { + "id": 10987, + "nodeType": "StructuredDocumentation", + "src": "20105:312:53", + "text": " @dev Returns the downcasted int208 from int256, reverting on\n overflow (when the input is less than smallest int208 or\n greater than largest int208).\n Counterpart to Solidity's `int208` operator.\n Requirements:\n - input must fit into 208 bits" + }, + "id": 11012, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toInt208", + "nameLocation": "20431:8:53", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 10990, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10989, + "mutability": "mutable", + "name": "value", + "nameLocation": "20447:5:53", + "nodeType": "VariableDeclaration", + "scope": 11012, + "src": "20440:12:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "typeName": { + "id": 10988, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "20440:6:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "visibility": "internal" + } + ], + "src": "20439:14:53" + }, + "returnParameters": { + "id": 10993, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 10992, + "mutability": "mutable", + "name": "downcasted", + "nameLocation": "20484:10:53", + "nodeType": "VariableDeclaration", + "scope": 11012, + "src": "20477:17:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int208", + "typeString": "int208" + }, + "typeName": { + "id": 10991, + "name": "int208", + "nodeType": "ElementaryTypeName", + "src": "20477:6:53", + "typeDescriptions": { + "typeIdentifier": "t_int208", + "typeString": "int208" + } + }, + "visibility": "internal" + } + ], + "src": "20476:19:53" + }, + "scope": 11703, + "src": "20422:224:53", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 11037, + "nodeType": "Block", + "src": "21043:150:53", + "statements": [ + { + "expression": { + "id": 11025, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 11020, + "name": "downcasted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11018, + "src": "21053:10:53", + "typeDescriptions": { + "typeIdentifier": "t_int200", + "typeString": "int200" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "id": 11023, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11015, + "src": "21073:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + ], + "id": 11022, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "21066:6:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_int200_$", + "typeString": "type(int200)" + }, + "typeName": { + "id": 11021, + "name": "int200", + "nodeType": "ElementaryTypeName", + "src": "21066:6:53", + "typeDescriptions": {} + } + }, + "id": 11024, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "21066:13:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_int200", + "typeString": "int200" + } + }, + "src": "21053:26:53", + "typeDescriptions": { + "typeIdentifier": "t_int200", + "typeString": "int200" + } + }, + "id": 11026, + "nodeType": "ExpressionStatement", + "src": "21053:26:53" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 11029, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 11027, + "name": "downcasted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11018, + "src": "21093:10:53", + "typeDescriptions": { + "typeIdentifier": "t_int200", + "typeString": "int200" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "id": 11028, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11015, + "src": "21107:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "src": "21093:19:53", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 11036, + "nodeType": "IfStatement", + "src": "21089:98:53", + "trueBody": { + "id": 11035, + "nodeType": "Block", + "src": "21114:73:53", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "hexValue": "323030", + "id": 11031, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "21165:3:53", + "typeDescriptions": { + "typeIdentifier": "t_rational_200_by_1", + "typeString": "int_const 200" + }, + "value": "200" + }, + { + "id": 11032, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11015, + "src": "21170:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_200_by_1", + "typeString": "int_const 200" + }, + { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + ], + "id": 11030, + "name": "SafeCastOverflowedIntDowncast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9960, + "src": "21135:29:53", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint8_$_t_int256_$returns$_t_error_$", + "typeString": "function (uint8,int256) pure returns (error)" + } + }, + "id": 11033, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "21135:41:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 11034, + "nodeType": "RevertStatement", + "src": "21128:48:53" + } + ] + } + } + ] + }, + "documentation": { + "id": 11013, + "nodeType": "StructuredDocumentation", + "src": "20652:312:53", + "text": " @dev Returns the downcasted int200 from int256, reverting on\n overflow (when the input is less than smallest int200 or\n greater than largest int200).\n Counterpart to Solidity's `int200` operator.\n Requirements:\n - input must fit into 200 bits" + }, + "id": 11038, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toInt200", + "nameLocation": "20978:8:53", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 11016, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 11015, + "mutability": "mutable", + "name": "value", + "nameLocation": "20994:5:53", + "nodeType": "VariableDeclaration", + "scope": 11038, + "src": "20987:12:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "typeName": { + "id": 11014, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "20987:6:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "visibility": "internal" + } + ], + "src": "20986:14:53" + }, + "returnParameters": { + "id": 11019, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 11018, + "mutability": "mutable", + "name": "downcasted", + "nameLocation": "21031:10:53", + "nodeType": "VariableDeclaration", + "scope": 11038, + "src": "21024:17:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int200", + "typeString": "int200" + }, + "typeName": { + "id": 11017, + "name": "int200", + "nodeType": "ElementaryTypeName", + "src": "21024:6:53", + "typeDescriptions": { + "typeIdentifier": "t_int200", + "typeString": "int200" + } + }, + "visibility": "internal" + } + ], + "src": "21023:19:53" + }, + "scope": 11703, + "src": "20969:224:53", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 11063, + "nodeType": "Block", + "src": "21590:150:53", + "statements": [ + { + "expression": { + "id": 11051, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 11046, + "name": "downcasted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11044, + "src": "21600:10:53", + "typeDescriptions": { + "typeIdentifier": "t_int192", + "typeString": "int192" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "id": 11049, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11041, + "src": "21620:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + ], + "id": 11048, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "21613:6:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_int192_$", + "typeString": "type(int192)" + }, + "typeName": { + "id": 11047, + "name": "int192", + "nodeType": "ElementaryTypeName", + "src": "21613:6:53", + "typeDescriptions": {} + } + }, + "id": 11050, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "21613:13:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_int192", + "typeString": "int192" + } + }, + "src": "21600:26:53", + "typeDescriptions": { + "typeIdentifier": "t_int192", + "typeString": "int192" + } + }, + "id": 11052, + "nodeType": "ExpressionStatement", + "src": "21600:26:53" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 11055, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 11053, + "name": "downcasted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11044, + "src": "21640:10:53", + "typeDescriptions": { + "typeIdentifier": "t_int192", + "typeString": "int192" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "id": 11054, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11041, + "src": "21654:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "src": "21640:19:53", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 11062, + "nodeType": "IfStatement", + "src": "21636:98:53", + "trueBody": { + "id": 11061, + "nodeType": "Block", + "src": "21661:73:53", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "hexValue": "313932", + "id": 11057, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "21712:3:53", + "typeDescriptions": { + "typeIdentifier": "t_rational_192_by_1", + "typeString": "int_const 192" + }, + "value": "192" + }, + { + "id": 11058, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11041, + "src": "21717:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_192_by_1", + "typeString": "int_const 192" + }, + { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + ], + "id": 11056, + "name": "SafeCastOverflowedIntDowncast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9960, + "src": "21682:29:53", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint8_$_t_int256_$returns$_t_error_$", + "typeString": "function (uint8,int256) pure returns (error)" + } + }, + "id": 11059, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "21682:41:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 11060, + "nodeType": "RevertStatement", + "src": "21675:48:53" + } + ] + } + } + ] + }, + "documentation": { + "id": 11039, + "nodeType": "StructuredDocumentation", + "src": "21199:312:53", + "text": " @dev Returns the downcasted int192 from int256, reverting on\n overflow (when the input is less than smallest int192 or\n greater than largest int192).\n Counterpart to Solidity's `int192` operator.\n Requirements:\n - input must fit into 192 bits" + }, + "id": 11064, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toInt192", + "nameLocation": "21525:8:53", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 11042, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 11041, + "mutability": "mutable", + "name": "value", + "nameLocation": "21541:5:53", + "nodeType": "VariableDeclaration", + "scope": 11064, + "src": "21534:12:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "typeName": { + "id": 11040, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "21534:6:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "visibility": "internal" + } + ], + "src": "21533:14:53" + }, + "returnParameters": { + "id": 11045, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 11044, + "mutability": "mutable", + "name": "downcasted", + "nameLocation": "21578:10:53", + "nodeType": "VariableDeclaration", + "scope": 11064, + "src": "21571:17:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int192", + "typeString": "int192" + }, + "typeName": { + "id": 11043, + "name": "int192", + "nodeType": "ElementaryTypeName", + "src": "21571:6:53", + "typeDescriptions": { + "typeIdentifier": "t_int192", + "typeString": "int192" + } + }, + "visibility": "internal" + } + ], + "src": "21570:19:53" + }, + "scope": 11703, + "src": "21516:224:53", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 11089, + "nodeType": "Block", + "src": "22137:150:53", + "statements": [ + { + "expression": { + "id": 11077, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 11072, + "name": "downcasted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11070, + "src": "22147:10:53", + "typeDescriptions": { + "typeIdentifier": "t_int184", + "typeString": "int184" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "id": 11075, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11067, + "src": "22167:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + ], + "id": 11074, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "22160:6:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_int184_$", + "typeString": "type(int184)" + }, + "typeName": { + "id": 11073, + "name": "int184", + "nodeType": "ElementaryTypeName", + "src": "22160:6:53", + "typeDescriptions": {} + } + }, + "id": 11076, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "22160:13:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_int184", + "typeString": "int184" + } + }, + "src": "22147:26:53", + "typeDescriptions": { + "typeIdentifier": "t_int184", + "typeString": "int184" + } + }, + "id": 11078, + "nodeType": "ExpressionStatement", + "src": "22147:26:53" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 11081, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 11079, + "name": "downcasted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11070, + "src": "22187:10:53", + "typeDescriptions": { + "typeIdentifier": "t_int184", + "typeString": "int184" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "id": 11080, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11067, + "src": "22201:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "src": "22187:19:53", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 11088, + "nodeType": "IfStatement", + "src": "22183:98:53", + "trueBody": { + "id": 11087, + "nodeType": "Block", + "src": "22208:73:53", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "hexValue": "313834", + "id": 11083, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "22259:3:53", + "typeDescriptions": { + "typeIdentifier": "t_rational_184_by_1", + "typeString": "int_const 184" + }, + "value": "184" + }, + { + "id": 11084, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11067, + "src": "22264:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_184_by_1", + "typeString": "int_const 184" + }, + { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + ], + "id": 11082, + "name": "SafeCastOverflowedIntDowncast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9960, + "src": "22229:29:53", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint8_$_t_int256_$returns$_t_error_$", + "typeString": "function (uint8,int256) pure returns (error)" + } + }, + "id": 11085, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "22229:41:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 11086, + "nodeType": "RevertStatement", + "src": "22222:48:53" + } + ] + } + } + ] + }, + "documentation": { + "id": 11065, + "nodeType": "StructuredDocumentation", + "src": "21746:312:53", + "text": " @dev Returns the downcasted int184 from int256, reverting on\n overflow (when the input is less than smallest int184 or\n greater than largest int184).\n Counterpart to Solidity's `int184` operator.\n Requirements:\n - input must fit into 184 bits" + }, + "id": 11090, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toInt184", + "nameLocation": "22072:8:53", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 11068, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 11067, + "mutability": "mutable", + "name": "value", + "nameLocation": "22088:5:53", + "nodeType": "VariableDeclaration", + "scope": 11090, + "src": "22081:12:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "typeName": { + "id": 11066, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "22081:6:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "visibility": "internal" + } + ], + "src": "22080:14:53" + }, + "returnParameters": { + "id": 11071, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 11070, + "mutability": "mutable", + "name": "downcasted", + "nameLocation": "22125:10:53", + "nodeType": "VariableDeclaration", + "scope": 11090, + "src": "22118:17:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int184", + "typeString": "int184" + }, + "typeName": { + "id": 11069, + "name": "int184", + "nodeType": "ElementaryTypeName", + "src": "22118:6:53", + "typeDescriptions": { + "typeIdentifier": "t_int184", + "typeString": "int184" + } + }, + "visibility": "internal" + } + ], + "src": "22117:19:53" + }, + "scope": 11703, + "src": "22063:224:53", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 11115, + "nodeType": "Block", + "src": "22684:150:53", + "statements": [ + { + "expression": { + "id": 11103, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 11098, + "name": "downcasted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11096, + "src": "22694:10:53", + "typeDescriptions": { + "typeIdentifier": "t_int176", + "typeString": "int176" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "id": 11101, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11093, + "src": "22714:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + ], + "id": 11100, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "22707:6:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_int176_$", + "typeString": "type(int176)" + }, + "typeName": { + "id": 11099, + "name": "int176", + "nodeType": "ElementaryTypeName", + "src": "22707:6:53", + "typeDescriptions": {} + } + }, + "id": 11102, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "22707:13:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_int176", + "typeString": "int176" + } + }, + "src": "22694:26:53", + "typeDescriptions": { + "typeIdentifier": "t_int176", + "typeString": "int176" + } + }, + "id": 11104, + "nodeType": "ExpressionStatement", + "src": "22694:26:53" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 11107, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 11105, + "name": "downcasted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11096, + "src": "22734:10:53", + "typeDescriptions": { + "typeIdentifier": "t_int176", + "typeString": "int176" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "id": 11106, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11093, + "src": "22748:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "src": "22734:19:53", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 11114, + "nodeType": "IfStatement", + "src": "22730:98:53", + "trueBody": { + "id": 11113, + "nodeType": "Block", + "src": "22755:73:53", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "hexValue": "313736", + "id": 11109, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "22806:3:53", + "typeDescriptions": { + "typeIdentifier": "t_rational_176_by_1", + "typeString": "int_const 176" + }, + "value": "176" + }, + { + "id": 11110, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11093, + "src": "22811:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_176_by_1", + "typeString": "int_const 176" + }, + { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + ], + "id": 11108, + "name": "SafeCastOverflowedIntDowncast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9960, + "src": "22776:29:53", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint8_$_t_int256_$returns$_t_error_$", + "typeString": "function (uint8,int256) pure returns (error)" + } + }, + "id": 11111, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "22776:41:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 11112, + "nodeType": "RevertStatement", + "src": "22769:48:53" + } + ] + } + } + ] + }, + "documentation": { + "id": 11091, + "nodeType": "StructuredDocumentation", + "src": "22293:312:53", + "text": " @dev Returns the downcasted int176 from int256, reverting on\n overflow (when the input is less than smallest int176 or\n greater than largest int176).\n Counterpart to Solidity's `int176` operator.\n Requirements:\n - input must fit into 176 bits" + }, + "id": 11116, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toInt176", + "nameLocation": "22619:8:53", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 11094, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 11093, + "mutability": "mutable", + "name": "value", + "nameLocation": "22635:5:53", + "nodeType": "VariableDeclaration", + "scope": 11116, + "src": "22628:12:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "typeName": { + "id": 11092, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "22628:6:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "visibility": "internal" + } + ], + "src": "22627:14:53" + }, + "returnParameters": { + "id": 11097, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 11096, + "mutability": "mutable", + "name": "downcasted", + "nameLocation": "22672:10:53", + "nodeType": "VariableDeclaration", + "scope": 11116, + "src": "22665:17:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int176", + "typeString": "int176" + }, + "typeName": { + "id": 11095, + "name": "int176", + "nodeType": "ElementaryTypeName", + "src": "22665:6:53", + "typeDescriptions": { + "typeIdentifier": "t_int176", + "typeString": "int176" + } + }, + "visibility": "internal" + } + ], + "src": "22664:19:53" + }, + "scope": 11703, + "src": "22610:224:53", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 11141, + "nodeType": "Block", + "src": "23231:150:53", + "statements": [ + { + "expression": { + "id": 11129, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 11124, + "name": "downcasted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11122, + "src": "23241:10:53", + "typeDescriptions": { + "typeIdentifier": "t_int168", + "typeString": "int168" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "id": 11127, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11119, + "src": "23261:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + ], + "id": 11126, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "23254:6:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_int168_$", + "typeString": "type(int168)" + }, + "typeName": { + "id": 11125, + "name": "int168", + "nodeType": "ElementaryTypeName", + "src": "23254:6:53", + "typeDescriptions": {} + } + }, + "id": 11128, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "23254:13:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_int168", + "typeString": "int168" + } + }, + "src": "23241:26:53", + "typeDescriptions": { + "typeIdentifier": "t_int168", + "typeString": "int168" + } + }, + "id": 11130, + "nodeType": "ExpressionStatement", + "src": "23241:26:53" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 11133, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 11131, + "name": "downcasted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11122, + "src": "23281:10:53", + "typeDescriptions": { + "typeIdentifier": "t_int168", + "typeString": "int168" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "id": 11132, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11119, + "src": "23295:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "src": "23281:19:53", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 11140, + "nodeType": "IfStatement", + "src": "23277:98:53", + "trueBody": { + "id": 11139, + "nodeType": "Block", + "src": "23302:73:53", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "hexValue": "313638", + "id": 11135, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "23353:3:53", + "typeDescriptions": { + "typeIdentifier": "t_rational_168_by_1", + "typeString": "int_const 168" + }, + "value": "168" + }, + { + "id": 11136, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11119, + "src": "23358:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_168_by_1", + "typeString": "int_const 168" + }, + { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + ], + "id": 11134, + "name": "SafeCastOverflowedIntDowncast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9960, + "src": "23323:29:53", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint8_$_t_int256_$returns$_t_error_$", + "typeString": "function (uint8,int256) pure returns (error)" + } + }, + "id": 11137, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "23323:41:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 11138, + "nodeType": "RevertStatement", + "src": "23316:48:53" + } + ] + } + } + ] + }, + "documentation": { + "id": 11117, + "nodeType": "StructuredDocumentation", + "src": "22840:312:53", + "text": " @dev Returns the downcasted int168 from int256, reverting on\n overflow (when the input is less than smallest int168 or\n greater than largest int168).\n Counterpart to Solidity's `int168` operator.\n Requirements:\n - input must fit into 168 bits" + }, + "id": 11142, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toInt168", + "nameLocation": "23166:8:53", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 11120, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 11119, + "mutability": "mutable", + "name": "value", + "nameLocation": "23182:5:53", + "nodeType": "VariableDeclaration", + "scope": 11142, + "src": "23175:12:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "typeName": { + "id": 11118, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "23175:6:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "visibility": "internal" + } + ], + "src": "23174:14:53" + }, + "returnParameters": { + "id": 11123, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 11122, + "mutability": "mutable", + "name": "downcasted", + "nameLocation": "23219:10:53", + "nodeType": "VariableDeclaration", + "scope": 11142, + "src": "23212:17:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int168", + "typeString": "int168" + }, + "typeName": { + "id": 11121, + "name": "int168", + "nodeType": "ElementaryTypeName", + "src": "23212:6:53", + "typeDescriptions": { + "typeIdentifier": "t_int168", + "typeString": "int168" + } + }, + "visibility": "internal" + } + ], + "src": "23211:19:53" + }, + "scope": 11703, + "src": "23157:224:53", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 11167, + "nodeType": "Block", + "src": "23778:150:53", + "statements": [ + { + "expression": { + "id": 11155, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 11150, + "name": "downcasted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11148, + "src": "23788:10:53", + "typeDescriptions": { + "typeIdentifier": "t_int160", + "typeString": "int160" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "id": 11153, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11145, + "src": "23808:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + ], + "id": 11152, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "23801:6:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_int160_$", + "typeString": "type(int160)" + }, + "typeName": { + "id": 11151, + "name": "int160", + "nodeType": "ElementaryTypeName", + "src": "23801:6:53", + "typeDescriptions": {} + } + }, + "id": 11154, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "23801:13:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_int160", + "typeString": "int160" + } + }, + "src": "23788:26:53", + "typeDescriptions": { + "typeIdentifier": "t_int160", + "typeString": "int160" + } + }, + "id": 11156, + "nodeType": "ExpressionStatement", + "src": "23788:26:53" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 11159, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 11157, + "name": "downcasted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11148, + "src": "23828:10:53", + "typeDescriptions": { + "typeIdentifier": "t_int160", + "typeString": "int160" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "id": 11158, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11145, + "src": "23842:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "src": "23828:19:53", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 11166, + "nodeType": "IfStatement", + "src": "23824:98:53", + "trueBody": { + "id": 11165, + "nodeType": "Block", + "src": "23849:73:53", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "hexValue": "313630", + "id": 11161, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "23900:3:53", + "typeDescriptions": { + "typeIdentifier": "t_rational_160_by_1", + "typeString": "int_const 160" + }, + "value": "160" + }, + { + "id": 11162, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11145, + "src": "23905:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_160_by_1", + "typeString": "int_const 160" + }, + { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + ], + "id": 11160, + "name": "SafeCastOverflowedIntDowncast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9960, + "src": "23870:29:53", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint8_$_t_int256_$returns$_t_error_$", + "typeString": "function (uint8,int256) pure returns (error)" + } + }, + "id": 11163, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "23870:41:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 11164, + "nodeType": "RevertStatement", + "src": "23863:48:53" + } + ] + } + } + ] + }, + "documentation": { + "id": 11143, + "nodeType": "StructuredDocumentation", + "src": "23387:312:53", + "text": " @dev Returns the downcasted int160 from int256, reverting on\n overflow (when the input is less than smallest int160 or\n greater than largest int160).\n Counterpart to Solidity's `int160` operator.\n Requirements:\n - input must fit into 160 bits" + }, + "id": 11168, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toInt160", + "nameLocation": "23713:8:53", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 11146, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 11145, + "mutability": "mutable", + "name": "value", + "nameLocation": "23729:5:53", + "nodeType": "VariableDeclaration", + "scope": 11168, + "src": "23722:12:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "typeName": { + "id": 11144, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "23722:6:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "visibility": "internal" + } + ], + "src": "23721:14:53" + }, + "returnParameters": { + "id": 11149, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 11148, + "mutability": "mutable", + "name": "downcasted", + "nameLocation": "23766:10:53", + "nodeType": "VariableDeclaration", + "scope": 11168, + "src": "23759:17:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int160", + "typeString": "int160" + }, + "typeName": { + "id": 11147, + "name": "int160", + "nodeType": "ElementaryTypeName", + "src": "23759:6:53", + "typeDescriptions": { + "typeIdentifier": "t_int160", + "typeString": "int160" + } + }, + "visibility": "internal" + } + ], + "src": "23758:19:53" + }, + "scope": 11703, + "src": "23704:224:53", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 11193, + "nodeType": "Block", + "src": "24325:150:53", + "statements": [ + { + "expression": { + "id": 11181, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 11176, + "name": "downcasted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11174, + "src": "24335:10:53", + "typeDescriptions": { + "typeIdentifier": "t_int152", + "typeString": "int152" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "id": 11179, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11171, + "src": "24355:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + ], + "id": 11178, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "24348:6:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_int152_$", + "typeString": "type(int152)" + }, + "typeName": { + "id": 11177, + "name": "int152", + "nodeType": "ElementaryTypeName", + "src": "24348:6:53", + "typeDescriptions": {} + } + }, + "id": 11180, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "24348:13:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_int152", + "typeString": "int152" + } + }, + "src": "24335:26:53", + "typeDescriptions": { + "typeIdentifier": "t_int152", + "typeString": "int152" + } + }, + "id": 11182, + "nodeType": "ExpressionStatement", + "src": "24335:26:53" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 11185, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 11183, + "name": "downcasted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11174, + "src": "24375:10:53", + "typeDescriptions": { + "typeIdentifier": "t_int152", + "typeString": "int152" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "id": 11184, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11171, + "src": "24389:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "src": "24375:19:53", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 11192, + "nodeType": "IfStatement", + "src": "24371:98:53", + "trueBody": { + "id": 11191, + "nodeType": "Block", + "src": "24396:73:53", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "hexValue": "313532", + "id": 11187, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "24447:3:53", + "typeDescriptions": { + "typeIdentifier": "t_rational_152_by_1", + "typeString": "int_const 152" + }, + "value": "152" + }, + { + "id": 11188, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11171, + "src": "24452:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_152_by_1", + "typeString": "int_const 152" + }, + { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + ], + "id": 11186, + "name": "SafeCastOverflowedIntDowncast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9960, + "src": "24417:29:53", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint8_$_t_int256_$returns$_t_error_$", + "typeString": "function (uint8,int256) pure returns (error)" + } + }, + "id": 11189, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "24417:41:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 11190, + "nodeType": "RevertStatement", + "src": "24410:48:53" + } + ] + } + } + ] + }, + "documentation": { + "id": 11169, + "nodeType": "StructuredDocumentation", + "src": "23934:312:53", + "text": " @dev Returns the downcasted int152 from int256, reverting on\n overflow (when the input is less than smallest int152 or\n greater than largest int152).\n Counterpart to Solidity's `int152` operator.\n Requirements:\n - input must fit into 152 bits" + }, + "id": 11194, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toInt152", + "nameLocation": "24260:8:53", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 11172, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 11171, + "mutability": "mutable", + "name": "value", + "nameLocation": "24276:5:53", + "nodeType": "VariableDeclaration", + "scope": 11194, + "src": "24269:12:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "typeName": { + "id": 11170, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "24269:6:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "visibility": "internal" + } + ], + "src": "24268:14:53" + }, + "returnParameters": { + "id": 11175, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 11174, + "mutability": "mutable", + "name": "downcasted", + "nameLocation": "24313:10:53", + "nodeType": "VariableDeclaration", + "scope": 11194, + "src": "24306:17:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int152", + "typeString": "int152" + }, + "typeName": { + "id": 11173, + "name": "int152", + "nodeType": "ElementaryTypeName", + "src": "24306:6:53", + "typeDescriptions": { + "typeIdentifier": "t_int152", + "typeString": "int152" + } + }, + "visibility": "internal" + } + ], + "src": "24305:19:53" + }, + "scope": 11703, + "src": "24251:224:53", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 11219, + "nodeType": "Block", + "src": "24872:150:53", + "statements": [ + { + "expression": { + "id": 11207, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 11202, + "name": "downcasted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11200, + "src": "24882:10:53", + "typeDescriptions": { + "typeIdentifier": "t_int144", + "typeString": "int144" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "id": 11205, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11197, + "src": "24902:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + ], + "id": 11204, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "24895:6:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_int144_$", + "typeString": "type(int144)" + }, + "typeName": { + "id": 11203, + "name": "int144", + "nodeType": "ElementaryTypeName", + "src": "24895:6:53", + "typeDescriptions": {} + } + }, + "id": 11206, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "24895:13:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_int144", + "typeString": "int144" + } + }, + "src": "24882:26:53", + "typeDescriptions": { + "typeIdentifier": "t_int144", + "typeString": "int144" + } + }, + "id": 11208, + "nodeType": "ExpressionStatement", + "src": "24882:26:53" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 11211, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 11209, + "name": "downcasted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11200, + "src": "24922:10:53", + "typeDescriptions": { + "typeIdentifier": "t_int144", + "typeString": "int144" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "id": 11210, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11197, + "src": "24936:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "src": "24922:19:53", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 11218, + "nodeType": "IfStatement", + "src": "24918:98:53", + "trueBody": { + "id": 11217, + "nodeType": "Block", + "src": "24943:73:53", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "hexValue": "313434", + "id": 11213, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "24994:3:53", + "typeDescriptions": { + "typeIdentifier": "t_rational_144_by_1", + "typeString": "int_const 144" + }, + "value": "144" + }, + { + "id": 11214, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11197, + "src": "24999:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_144_by_1", + "typeString": "int_const 144" + }, + { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + ], + "id": 11212, + "name": "SafeCastOverflowedIntDowncast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9960, + "src": "24964:29:53", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint8_$_t_int256_$returns$_t_error_$", + "typeString": "function (uint8,int256) pure returns (error)" + } + }, + "id": 11215, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "24964:41:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 11216, + "nodeType": "RevertStatement", + "src": "24957:48:53" + } + ] + } + } + ] + }, + "documentation": { + "id": 11195, + "nodeType": "StructuredDocumentation", + "src": "24481:312:53", + "text": " @dev Returns the downcasted int144 from int256, reverting on\n overflow (when the input is less than smallest int144 or\n greater than largest int144).\n Counterpart to Solidity's `int144` operator.\n Requirements:\n - input must fit into 144 bits" + }, + "id": 11220, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toInt144", + "nameLocation": "24807:8:53", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 11198, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 11197, + "mutability": "mutable", + "name": "value", + "nameLocation": "24823:5:53", + "nodeType": "VariableDeclaration", + "scope": 11220, + "src": "24816:12:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "typeName": { + "id": 11196, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "24816:6:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "visibility": "internal" + } + ], + "src": "24815:14:53" + }, + "returnParameters": { + "id": 11201, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 11200, + "mutability": "mutable", + "name": "downcasted", + "nameLocation": "24860:10:53", + "nodeType": "VariableDeclaration", + "scope": 11220, + "src": "24853:17:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int144", + "typeString": "int144" + }, + "typeName": { + "id": 11199, + "name": "int144", + "nodeType": "ElementaryTypeName", + "src": "24853:6:53", + "typeDescriptions": { + "typeIdentifier": "t_int144", + "typeString": "int144" + } + }, + "visibility": "internal" + } + ], + "src": "24852:19:53" + }, + "scope": 11703, + "src": "24798:224:53", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 11245, + "nodeType": "Block", + "src": "25419:150:53", + "statements": [ + { + "expression": { + "id": 11233, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 11228, + "name": "downcasted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11226, + "src": "25429:10:53", + "typeDescriptions": { + "typeIdentifier": "t_int136", + "typeString": "int136" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "id": 11231, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11223, + "src": "25449:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + ], + "id": 11230, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "25442:6:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_int136_$", + "typeString": "type(int136)" + }, + "typeName": { + "id": 11229, + "name": "int136", + "nodeType": "ElementaryTypeName", + "src": "25442:6:53", + "typeDescriptions": {} + } + }, + "id": 11232, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "25442:13:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_int136", + "typeString": "int136" + } + }, + "src": "25429:26:53", + "typeDescriptions": { + "typeIdentifier": "t_int136", + "typeString": "int136" + } + }, + "id": 11234, + "nodeType": "ExpressionStatement", + "src": "25429:26:53" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 11237, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 11235, + "name": "downcasted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11226, + "src": "25469:10:53", + "typeDescriptions": { + "typeIdentifier": "t_int136", + "typeString": "int136" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "id": 11236, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11223, + "src": "25483:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "src": "25469:19:53", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 11244, + "nodeType": "IfStatement", + "src": "25465:98:53", + "trueBody": { + "id": 11243, + "nodeType": "Block", + "src": "25490:73:53", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "hexValue": "313336", + "id": 11239, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "25541:3:53", + "typeDescriptions": { + "typeIdentifier": "t_rational_136_by_1", + "typeString": "int_const 136" + }, + "value": "136" + }, + { + "id": 11240, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11223, + "src": "25546:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_136_by_1", + "typeString": "int_const 136" + }, + { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + ], + "id": 11238, + "name": "SafeCastOverflowedIntDowncast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9960, + "src": "25511:29:53", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint8_$_t_int256_$returns$_t_error_$", + "typeString": "function (uint8,int256) pure returns (error)" + } + }, + "id": 11241, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "25511:41:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 11242, + "nodeType": "RevertStatement", + "src": "25504:48:53" + } + ] + } + } + ] + }, + "documentation": { + "id": 11221, + "nodeType": "StructuredDocumentation", + "src": "25028:312:53", + "text": " @dev Returns the downcasted int136 from int256, reverting on\n overflow (when the input is less than smallest int136 or\n greater than largest int136).\n Counterpart to Solidity's `int136` operator.\n Requirements:\n - input must fit into 136 bits" + }, + "id": 11246, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toInt136", + "nameLocation": "25354:8:53", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 11224, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 11223, + "mutability": "mutable", + "name": "value", + "nameLocation": "25370:5:53", + "nodeType": "VariableDeclaration", + "scope": 11246, + "src": "25363:12:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "typeName": { + "id": 11222, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "25363:6:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "visibility": "internal" + } + ], + "src": "25362:14:53" + }, + "returnParameters": { + "id": 11227, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 11226, + "mutability": "mutable", + "name": "downcasted", + "nameLocation": "25407:10:53", + "nodeType": "VariableDeclaration", + "scope": 11246, + "src": "25400:17:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int136", + "typeString": "int136" + }, + "typeName": { + "id": 11225, + "name": "int136", + "nodeType": "ElementaryTypeName", + "src": "25400:6:53", + "typeDescriptions": { + "typeIdentifier": "t_int136", + "typeString": "int136" + } + }, + "visibility": "internal" + } + ], + "src": "25399:19:53" + }, + "scope": 11703, + "src": "25345:224:53", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 11271, + "nodeType": "Block", + "src": "25966:150:53", + "statements": [ + { + "expression": { + "id": 11259, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 11254, + "name": "downcasted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11252, + "src": "25976:10:53", + "typeDescriptions": { + "typeIdentifier": "t_int128", + "typeString": "int128" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "id": 11257, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11249, + "src": "25996:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + ], + "id": 11256, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "25989:6:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_int128_$", + "typeString": "type(int128)" + }, + "typeName": { + "id": 11255, + "name": "int128", + "nodeType": "ElementaryTypeName", + "src": "25989:6:53", + "typeDescriptions": {} + } + }, + "id": 11258, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "25989:13:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_int128", + "typeString": "int128" + } + }, + "src": "25976:26:53", + "typeDescriptions": { + "typeIdentifier": "t_int128", + "typeString": "int128" + } + }, + "id": 11260, + "nodeType": "ExpressionStatement", + "src": "25976:26:53" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 11263, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 11261, + "name": "downcasted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11252, + "src": "26016:10:53", + "typeDescriptions": { + "typeIdentifier": "t_int128", + "typeString": "int128" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "id": 11262, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11249, + "src": "26030:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "src": "26016:19:53", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 11270, + "nodeType": "IfStatement", + "src": "26012:98:53", + "trueBody": { + "id": 11269, + "nodeType": "Block", + "src": "26037:73:53", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "hexValue": "313238", + "id": 11265, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "26088:3:53", + "typeDescriptions": { + "typeIdentifier": "t_rational_128_by_1", + "typeString": "int_const 128" + }, + "value": "128" + }, + { + "id": 11266, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11249, + "src": "26093:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_128_by_1", + "typeString": "int_const 128" + }, + { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + ], + "id": 11264, + "name": "SafeCastOverflowedIntDowncast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9960, + "src": "26058:29:53", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint8_$_t_int256_$returns$_t_error_$", + "typeString": "function (uint8,int256) pure returns (error)" + } + }, + "id": 11267, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "26058:41:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 11268, + "nodeType": "RevertStatement", + "src": "26051:48:53" + } + ] + } + } + ] + }, + "documentation": { + "id": 11247, + "nodeType": "StructuredDocumentation", + "src": "25575:312:53", + "text": " @dev Returns the downcasted int128 from int256, reverting on\n overflow (when the input is less than smallest int128 or\n greater than largest int128).\n Counterpart to Solidity's `int128` operator.\n Requirements:\n - input must fit into 128 bits" + }, + "id": 11272, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toInt128", + "nameLocation": "25901:8:53", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 11250, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 11249, + "mutability": "mutable", + "name": "value", + "nameLocation": "25917:5:53", + "nodeType": "VariableDeclaration", + "scope": 11272, + "src": "25910:12:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "typeName": { + "id": 11248, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "25910:6:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "visibility": "internal" + } + ], + "src": "25909:14:53" + }, + "returnParameters": { + "id": 11253, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 11252, + "mutability": "mutable", + "name": "downcasted", + "nameLocation": "25954:10:53", + "nodeType": "VariableDeclaration", + "scope": 11272, + "src": "25947:17:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int128", + "typeString": "int128" + }, + "typeName": { + "id": 11251, + "name": "int128", + "nodeType": "ElementaryTypeName", + "src": "25947:6:53", + "typeDescriptions": { + "typeIdentifier": "t_int128", + "typeString": "int128" + } + }, + "visibility": "internal" + } + ], + "src": "25946:19:53" + }, + "scope": 11703, + "src": "25892:224:53", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 11297, + "nodeType": "Block", + "src": "26513:150:53", + "statements": [ + { + "expression": { + "id": 11285, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 11280, + "name": "downcasted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11278, + "src": "26523:10:53", + "typeDescriptions": { + "typeIdentifier": "t_int120", + "typeString": "int120" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "id": 11283, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11275, + "src": "26543:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + ], + "id": 11282, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "26536:6:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_int120_$", + "typeString": "type(int120)" + }, + "typeName": { + "id": 11281, + "name": "int120", + "nodeType": "ElementaryTypeName", + "src": "26536:6:53", + "typeDescriptions": {} + } + }, + "id": 11284, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "26536:13:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_int120", + "typeString": "int120" + } + }, + "src": "26523:26:53", + "typeDescriptions": { + "typeIdentifier": "t_int120", + "typeString": "int120" + } + }, + "id": 11286, + "nodeType": "ExpressionStatement", + "src": "26523:26:53" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 11289, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 11287, + "name": "downcasted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11278, + "src": "26563:10:53", + "typeDescriptions": { + "typeIdentifier": "t_int120", + "typeString": "int120" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "id": 11288, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11275, + "src": "26577:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "src": "26563:19:53", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 11296, + "nodeType": "IfStatement", + "src": "26559:98:53", + "trueBody": { + "id": 11295, + "nodeType": "Block", + "src": "26584:73:53", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "hexValue": "313230", + "id": 11291, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "26635:3:53", + "typeDescriptions": { + "typeIdentifier": "t_rational_120_by_1", + "typeString": "int_const 120" + }, + "value": "120" + }, + { + "id": 11292, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11275, + "src": "26640:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_120_by_1", + "typeString": "int_const 120" + }, + { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + ], + "id": 11290, + "name": "SafeCastOverflowedIntDowncast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9960, + "src": "26605:29:53", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint8_$_t_int256_$returns$_t_error_$", + "typeString": "function (uint8,int256) pure returns (error)" + } + }, + "id": 11293, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "26605:41:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 11294, + "nodeType": "RevertStatement", + "src": "26598:48:53" + } + ] + } + } + ] + }, + "documentation": { + "id": 11273, + "nodeType": "StructuredDocumentation", + "src": "26122:312:53", + "text": " @dev Returns the downcasted int120 from int256, reverting on\n overflow (when the input is less than smallest int120 or\n greater than largest int120).\n Counterpart to Solidity's `int120` operator.\n Requirements:\n - input must fit into 120 bits" + }, + "id": 11298, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toInt120", + "nameLocation": "26448:8:53", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 11276, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 11275, + "mutability": "mutable", + "name": "value", + "nameLocation": "26464:5:53", + "nodeType": "VariableDeclaration", + "scope": 11298, + "src": "26457:12:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "typeName": { + "id": 11274, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "26457:6:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "visibility": "internal" + } + ], + "src": "26456:14:53" + }, + "returnParameters": { + "id": 11279, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 11278, + "mutability": "mutable", + "name": "downcasted", + "nameLocation": "26501:10:53", + "nodeType": "VariableDeclaration", + "scope": 11298, + "src": "26494:17:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int120", + "typeString": "int120" + }, + "typeName": { + "id": 11277, + "name": "int120", + "nodeType": "ElementaryTypeName", + "src": "26494:6:53", + "typeDescriptions": { + "typeIdentifier": "t_int120", + "typeString": "int120" + } + }, + "visibility": "internal" + } + ], + "src": "26493:19:53" + }, + "scope": 11703, + "src": "26439:224:53", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 11323, + "nodeType": "Block", + "src": "27060:150:53", + "statements": [ + { + "expression": { + "id": 11311, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 11306, + "name": "downcasted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11304, + "src": "27070:10:53", + "typeDescriptions": { + "typeIdentifier": "t_int112", + "typeString": "int112" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "id": 11309, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11301, + "src": "27090:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + ], + "id": 11308, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "27083:6:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_int112_$", + "typeString": "type(int112)" + }, + "typeName": { + "id": 11307, + "name": "int112", + "nodeType": "ElementaryTypeName", + "src": "27083:6:53", + "typeDescriptions": {} + } + }, + "id": 11310, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "27083:13:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_int112", + "typeString": "int112" + } + }, + "src": "27070:26:53", + "typeDescriptions": { + "typeIdentifier": "t_int112", + "typeString": "int112" + } + }, + "id": 11312, + "nodeType": "ExpressionStatement", + "src": "27070:26:53" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 11315, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 11313, + "name": "downcasted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11304, + "src": "27110:10:53", + "typeDescriptions": { + "typeIdentifier": "t_int112", + "typeString": "int112" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "id": 11314, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11301, + "src": "27124:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "src": "27110:19:53", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 11322, + "nodeType": "IfStatement", + "src": "27106:98:53", + "trueBody": { + "id": 11321, + "nodeType": "Block", + "src": "27131:73:53", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "hexValue": "313132", + "id": 11317, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "27182:3:53", + "typeDescriptions": { + "typeIdentifier": "t_rational_112_by_1", + "typeString": "int_const 112" + }, + "value": "112" + }, + { + "id": 11318, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11301, + "src": "27187:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_112_by_1", + "typeString": "int_const 112" + }, + { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + ], + "id": 11316, + "name": "SafeCastOverflowedIntDowncast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9960, + "src": "27152:29:53", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint8_$_t_int256_$returns$_t_error_$", + "typeString": "function (uint8,int256) pure returns (error)" + } + }, + "id": 11319, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "27152:41:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 11320, + "nodeType": "RevertStatement", + "src": "27145:48:53" + } + ] + } + } + ] + }, + "documentation": { + "id": 11299, + "nodeType": "StructuredDocumentation", + "src": "26669:312:53", + "text": " @dev Returns the downcasted int112 from int256, reverting on\n overflow (when the input is less than smallest int112 or\n greater than largest int112).\n Counterpart to Solidity's `int112` operator.\n Requirements:\n - input must fit into 112 bits" + }, + "id": 11324, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toInt112", + "nameLocation": "26995:8:53", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 11302, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 11301, + "mutability": "mutable", + "name": "value", + "nameLocation": "27011:5:53", + "nodeType": "VariableDeclaration", + "scope": 11324, + "src": "27004:12:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "typeName": { + "id": 11300, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "27004:6:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "visibility": "internal" + } + ], + "src": "27003:14:53" + }, + "returnParameters": { + "id": 11305, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 11304, + "mutability": "mutable", + "name": "downcasted", + "nameLocation": "27048:10:53", + "nodeType": "VariableDeclaration", + "scope": 11324, + "src": "27041:17:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int112", + "typeString": "int112" + }, + "typeName": { + "id": 11303, + "name": "int112", + "nodeType": "ElementaryTypeName", + "src": "27041:6:53", + "typeDescriptions": { + "typeIdentifier": "t_int112", + "typeString": "int112" + } + }, + "visibility": "internal" + } + ], + "src": "27040:19:53" + }, + "scope": 11703, + "src": "26986:224:53", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 11349, + "nodeType": "Block", + "src": "27607:150:53", + "statements": [ + { + "expression": { + "id": 11337, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 11332, + "name": "downcasted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11330, + "src": "27617:10:53", + "typeDescriptions": { + "typeIdentifier": "t_int104", + "typeString": "int104" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "id": 11335, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11327, + "src": "27637:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + ], + "id": 11334, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "27630:6:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_int104_$", + "typeString": "type(int104)" + }, + "typeName": { + "id": 11333, + "name": "int104", + "nodeType": "ElementaryTypeName", + "src": "27630:6:53", + "typeDescriptions": {} + } + }, + "id": 11336, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "27630:13:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_int104", + "typeString": "int104" + } + }, + "src": "27617:26:53", + "typeDescriptions": { + "typeIdentifier": "t_int104", + "typeString": "int104" + } + }, + "id": 11338, + "nodeType": "ExpressionStatement", + "src": "27617:26:53" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 11341, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 11339, + "name": "downcasted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11330, + "src": "27657:10:53", + "typeDescriptions": { + "typeIdentifier": "t_int104", + "typeString": "int104" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "id": 11340, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11327, + "src": "27671:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "src": "27657:19:53", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 11348, + "nodeType": "IfStatement", + "src": "27653:98:53", + "trueBody": { + "id": 11347, + "nodeType": "Block", + "src": "27678:73:53", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "hexValue": "313034", + "id": 11343, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "27729:3:53", + "typeDescriptions": { + "typeIdentifier": "t_rational_104_by_1", + "typeString": "int_const 104" + }, + "value": "104" + }, + { + "id": 11344, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11327, + "src": "27734:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_104_by_1", + "typeString": "int_const 104" + }, + { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + ], + "id": 11342, + "name": "SafeCastOverflowedIntDowncast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9960, + "src": "27699:29:53", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint8_$_t_int256_$returns$_t_error_$", + "typeString": "function (uint8,int256) pure returns (error)" + } + }, + "id": 11345, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "27699:41:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 11346, + "nodeType": "RevertStatement", + "src": "27692:48:53" + } + ] + } + } + ] + }, + "documentation": { + "id": 11325, + "nodeType": "StructuredDocumentation", + "src": "27216:312:53", + "text": " @dev Returns the downcasted int104 from int256, reverting on\n overflow (when the input is less than smallest int104 or\n greater than largest int104).\n Counterpart to Solidity's `int104` operator.\n Requirements:\n - input must fit into 104 bits" + }, + "id": 11350, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toInt104", + "nameLocation": "27542:8:53", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 11328, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 11327, + "mutability": "mutable", + "name": "value", + "nameLocation": "27558:5:53", + "nodeType": "VariableDeclaration", + "scope": 11350, + "src": "27551:12:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "typeName": { + "id": 11326, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "27551:6:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "visibility": "internal" + } + ], + "src": "27550:14:53" + }, + "returnParameters": { + "id": 11331, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 11330, + "mutability": "mutable", + "name": "downcasted", + "nameLocation": "27595:10:53", + "nodeType": "VariableDeclaration", + "scope": 11350, + "src": "27588:17:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int104", + "typeString": "int104" + }, + "typeName": { + "id": 11329, + "name": "int104", + "nodeType": "ElementaryTypeName", + "src": "27588:6:53", + "typeDescriptions": { + "typeIdentifier": "t_int104", + "typeString": "int104" + } + }, + "visibility": "internal" + } + ], + "src": "27587:19:53" + }, + "scope": 11703, + "src": "27533:224:53", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 11375, + "nodeType": "Block", + "src": "28147:148:53", + "statements": [ + { + "expression": { + "id": 11363, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 11358, + "name": "downcasted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11356, + "src": "28157:10:53", + "typeDescriptions": { + "typeIdentifier": "t_int96", + "typeString": "int96" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "id": 11361, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11353, + "src": "28176:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + ], + "id": 11360, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "28170:5:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_int96_$", + "typeString": "type(int96)" + }, + "typeName": { + "id": 11359, + "name": "int96", + "nodeType": "ElementaryTypeName", + "src": "28170:5:53", + "typeDescriptions": {} + } + }, + "id": 11362, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "28170:12:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_int96", + "typeString": "int96" + } + }, + "src": "28157:25:53", + "typeDescriptions": { + "typeIdentifier": "t_int96", + "typeString": "int96" + } + }, + "id": 11364, + "nodeType": "ExpressionStatement", + "src": "28157:25:53" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 11367, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 11365, + "name": "downcasted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11356, + "src": "28196:10:53", + "typeDescriptions": { + "typeIdentifier": "t_int96", + "typeString": "int96" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "id": 11366, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11353, + "src": "28210:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "src": "28196:19:53", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 11374, + "nodeType": "IfStatement", + "src": "28192:97:53", + "trueBody": { + "id": 11373, + "nodeType": "Block", + "src": "28217:72:53", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "hexValue": "3936", + "id": 11369, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "28268:2:53", + "typeDescriptions": { + "typeIdentifier": "t_rational_96_by_1", + "typeString": "int_const 96" + }, + "value": "96" + }, + { + "id": 11370, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11353, + "src": "28272:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_96_by_1", + "typeString": "int_const 96" + }, + { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + ], + "id": 11368, + "name": "SafeCastOverflowedIntDowncast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9960, + "src": "28238:29:53", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint8_$_t_int256_$returns$_t_error_$", + "typeString": "function (uint8,int256) pure returns (error)" + } + }, + "id": 11371, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "28238:40:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 11372, + "nodeType": "RevertStatement", + "src": "28231:47:53" + } + ] + } + } + ] + }, + "documentation": { + "id": 11351, + "nodeType": "StructuredDocumentation", + "src": "27763:307:53", + "text": " @dev Returns the downcasted int96 from int256, reverting on\n overflow (when the input is less than smallest int96 or\n greater than largest int96).\n Counterpart to Solidity's `int96` operator.\n Requirements:\n - input must fit into 96 bits" + }, + "id": 11376, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toInt96", + "nameLocation": "28084:7:53", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 11354, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 11353, + "mutability": "mutable", + "name": "value", + "nameLocation": "28099:5:53", + "nodeType": "VariableDeclaration", + "scope": 11376, + "src": "28092:12:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "typeName": { + "id": 11352, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "28092:6:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "visibility": "internal" + } + ], + "src": "28091:14:53" + }, + "returnParameters": { + "id": 11357, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 11356, + "mutability": "mutable", + "name": "downcasted", + "nameLocation": "28135:10:53", + "nodeType": "VariableDeclaration", + "scope": 11376, + "src": "28129:16:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int96", + "typeString": "int96" + }, + "typeName": { + "id": 11355, + "name": "int96", + "nodeType": "ElementaryTypeName", + "src": "28129:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int96", + "typeString": "int96" + } + }, + "visibility": "internal" + } + ], + "src": "28128:18:53" + }, + "scope": 11703, + "src": "28075:220:53", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 11401, + "nodeType": "Block", + "src": "28685:148:53", + "statements": [ + { + "expression": { + "id": 11389, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 11384, + "name": "downcasted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11382, + "src": "28695:10:53", + "typeDescriptions": { + "typeIdentifier": "t_int88", + "typeString": "int88" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "id": 11387, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11379, + "src": "28714:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + ], + "id": 11386, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "28708:5:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_int88_$", + "typeString": "type(int88)" + }, + "typeName": { + "id": 11385, + "name": "int88", + "nodeType": "ElementaryTypeName", + "src": "28708:5:53", + "typeDescriptions": {} + } + }, + "id": 11388, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "28708:12:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_int88", + "typeString": "int88" + } + }, + "src": "28695:25:53", + "typeDescriptions": { + "typeIdentifier": "t_int88", + "typeString": "int88" + } + }, + "id": 11390, + "nodeType": "ExpressionStatement", + "src": "28695:25:53" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 11393, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 11391, + "name": "downcasted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11382, + "src": "28734:10:53", + "typeDescriptions": { + "typeIdentifier": "t_int88", + "typeString": "int88" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "id": 11392, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11379, + "src": "28748:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "src": "28734:19:53", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 11400, + "nodeType": "IfStatement", + "src": "28730:97:53", + "trueBody": { + "id": 11399, + "nodeType": "Block", + "src": "28755:72:53", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "hexValue": "3838", + "id": 11395, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "28806:2:53", + "typeDescriptions": { + "typeIdentifier": "t_rational_88_by_1", + "typeString": "int_const 88" + }, + "value": "88" + }, + { + "id": 11396, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11379, + "src": "28810:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_88_by_1", + "typeString": "int_const 88" + }, + { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + ], + "id": 11394, + "name": "SafeCastOverflowedIntDowncast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9960, + "src": "28776:29:53", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint8_$_t_int256_$returns$_t_error_$", + "typeString": "function (uint8,int256) pure returns (error)" + } + }, + "id": 11397, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "28776:40:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 11398, + "nodeType": "RevertStatement", + "src": "28769:47:53" + } + ] + } + } + ] + }, + "documentation": { + "id": 11377, + "nodeType": "StructuredDocumentation", + "src": "28301:307:53", + "text": " @dev Returns the downcasted int88 from int256, reverting on\n overflow (when the input is less than smallest int88 or\n greater than largest int88).\n Counterpart to Solidity's `int88` operator.\n Requirements:\n - input must fit into 88 bits" + }, + "id": 11402, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toInt88", + "nameLocation": "28622:7:53", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 11380, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 11379, + "mutability": "mutable", + "name": "value", + "nameLocation": "28637:5:53", + "nodeType": "VariableDeclaration", + "scope": 11402, + "src": "28630:12:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "typeName": { + "id": 11378, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "28630:6:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "visibility": "internal" + } + ], + "src": "28629:14:53" + }, + "returnParameters": { + "id": 11383, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 11382, + "mutability": "mutable", + "name": "downcasted", + "nameLocation": "28673:10:53", + "nodeType": "VariableDeclaration", + "scope": 11402, + "src": "28667:16:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int88", + "typeString": "int88" + }, + "typeName": { + "id": 11381, + "name": "int88", + "nodeType": "ElementaryTypeName", + "src": "28667:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int88", + "typeString": "int88" + } + }, + "visibility": "internal" + } + ], + "src": "28666:18:53" + }, + "scope": 11703, + "src": "28613:220:53", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 11427, + "nodeType": "Block", + "src": "29223:148:53", + "statements": [ + { + "expression": { + "id": 11415, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 11410, + "name": "downcasted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11408, + "src": "29233:10:53", + "typeDescriptions": { + "typeIdentifier": "t_int80", + "typeString": "int80" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "id": 11413, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11405, + "src": "29252:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + ], + "id": 11412, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "29246:5:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_int80_$", + "typeString": "type(int80)" + }, + "typeName": { + "id": 11411, + "name": "int80", + "nodeType": "ElementaryTypeName", + "src": "29246:5:53", + "typeDescriptions": {} + } + }, + "id": 11414, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "29246:12:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_int80", + "typeString": "int80" + } + }, + "src": "29233:25:53", + "typeDescriptions": { + "typeIdentifier": "t_int80", + "typeString": "int80" + } + }, + "id": 11416, + "nodeType": "ExpressionStatement", + "src": "29233:25:53" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 11419, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 11417, + "name": "downcasted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11408, + "src": "29272:10:53", + "typeDescriptions": { + "typeIdentifier": "t_int80", + "typeString": "int80" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "id": 11418, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11405, + "src": "29286:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "src": "29272:19:53", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 11426, + "nodeType": "IfStatement", + "src": "29268:97:53", + "trueBody": { + "id": 11425, + "nodeType": "Block", + "src": "29293:72:53", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "hexValue": "3830", + "id": 11421, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "29344:2:53", + "typeDescriptions": { + "typeIdentifier": "t_rational_80_by_1", + "typeString": "int_const 80" + }, + "value": "80" + }, + { + "id": 11422, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11405, + "src": "29348:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_80_by_1", + "typeString": "int_const 80" + }, + { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + ], + "id": 11420, + "name": "SafeCastOverflowedIntDowncast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9960, + "src": "29314:29:53", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint8_$_t_int256_$returns$_t_error_$", + "typeString": "function (uint8,int256) pure returns (error)" + } + }, + "id": 11423, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "29314:40:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 11424, + "nodeType": "RevertStatement", + "src": "29307:47:53" + } + ] + } + } + ] + }, + "documentation": { + "id": 11403, + "nodeType": "StructuredDocumentation", + "src": "28839:307:53", + "text": " @dev Returns the downcasted int80 from int256, reverting on\n overflow (when the input is less than smallest int80 or\n greater than largest int80).\n Counterpart to Solidity's `int80` operator.\n Requirements:\n - input must fit into 80 bits" + }, + "id": 11428, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toInt80", + "nameLocation": "29160:7:53", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 11406, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 11405, + "mutability": "mutable", + "name": "value", + "nameLocation": "29175:5:53", + "nodeType": "VariableDeclaration", + "scope": 11428, + "src": "29168:12:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "typeName": { + "id": 11404, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "29168:6:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "visibility": "internal" + } + ], + "src": "29167:14:53" + }, + "returnParameters": { + "id": 11409, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 11408, + "mutability": "mutable", + "name": "downcasted", + "nameLocation": "29211:10:53", + "nodeType": "VariableDeclaration", + "scope": 11428, + "src": "29205:16:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int80", + "typeString": "int80" + }, + "typeName": { + "id": 11407, + "name": "int80", + "nodeType": "ElementaryTypeName", + "src": "29205:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int80", + "typeString": "int80" + } + }, + "visibility": "internal" + } + ], + "src": "29204:18:53" + }, + "scope": 11703, + "src": "29151:220:53", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 11453, + "nodeType": "Block", + "src": "29761:148:53", + "statements": [ + { + "expression": { + "id": 11441, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 11436, + "name": "downcasted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11434, + "src": "29771:10:53", + "typeDescriptions": { + "typeIdentifier": "t_int72", + "typeString": "int72" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "id": 11439, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11431, + "src": "29790:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + ], + "id": 11438, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "29784:5:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_int72_$", + "typeString": "type(int72)" + }, + "typeName": { + "id": 11437, + "name": "int72", + "nodeType": "ElementaryTypeName", + "src": "29784:5:53", + "typeDescriptions": {} + } + }, + "id": 11440, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "29784:12:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_int72", + "typeString": "int72" + } + }, + "src": "29771:25:53", + "typeDescriptions": { + "typeIdentifier": "t_int72", + "typeString": "int72" + } + }, + "id": 11442, + "nodeType": "ExpressionStatement", + "src": "29771:25:53" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 11445, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 11443, + "name": "downcasted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11434, + "src": "29810:10:53", + "typeDescriptions": { + "typeIdentifier": "t_int72", + "typeString": "int72" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "id": 11444, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11431, + "src": "29824:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "src": "29810:19:53", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 11452, + "nodeType": "IfStatement", + "src": "29806:97:53", + "trueBody": { + "id": 11451, + "nodeType": "Block", + "src": "29831:72:53", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "hexValue": "3732", + "id": 11447, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "29882:2:53", + "typeDescriptions": { + "typeIdentifier": "t_rational_72_by_1", + "typeString": "int_const 72" + }, + "value": "72" + }, + { + "id": 11448, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11431, + "src": "29886:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_72_by_1", + "typeString": "int_const 72" + }, + { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + ], + "id": 11446, + "name": "SafeCastOverflowedIntDowncast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9960, + "src": "29852:29:53", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint8_$_t_int256_$returns$_t_error_$", + "typeString": "function (uint8,int256) pure returns (error)" + } + }, + "id": 11449, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "29852:40:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 11450, + "nodeType": "RevertStatement", + "src": "29845:47:53" + } + ] + } + } + ] + }, + "documentation": { + "id": 11429, + "nodeType": "StructuredDocumentation", + "src": "29377:307:53", + "text": " @dev Returns the downcasted int72 from int256, reverting on\n overflow (when the input is less than smallest int72 or\n greater than largest int72).\n Counterpart to Solidity's `int72` operator.\n Requirements:\n - input must fit into 72 bits" + }, + "id": 11454, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toInt72", + "nameLocation": "29698:7:53", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 11432, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 11431, + "mutability": "mutable", + "name": "value", + "nameLocation": "29713:5:53", + "nodeType": "VariableDeclaration", + "scope": 11454, + "src": "29706:12:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "typeName": { + "id": 11430, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "29706:6:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "visibility": "internal" + } + ], + "src": "29705:14:53" + }, + "returnParameters": { + "id": 11435, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 11434, + "mutability": "mutable", + "name": "downcasted", + "nameLocation": "29749:10:53", + "nodeType": "VariableDeclaration", + "scope": 11454, + "src": "29743:16:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int72", + "typeString": "int72" + }, + "typeName": { + "id": 11433, + "name": "int72", + "nodeType": "ElementaryTypeName", + "src": "29743:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int72", + "typeString": "int72" + } + }, + "visibility": "internal" + } + ], + "src": "29742:18:53" + }, + "scope": 11703, + "src": "29689:220:53", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 11479, + "nodeType": "Block", + "src": "30299:148:53", + "statements": [ + { + "expression": { + "id": 11467, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 11462, + "name": "downcasted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11460, + "src": "30309:10:53", + "typeDescriptions": { + "typeIdentifier": "t_int64", + "typeString": "int64" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "id": 11465, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11457, + "src": "30328:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + ], + "id": 11464, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "30322:5:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_int64_$", + "typeString": "type(int64)" + }, + "typeName": { + "id": 11463, + "name": "int64", + "nodeType": "ElementaryTypeName", + "src": "30322:5:53", + "typeDescriptions": {} + } + }, + "id": 11466, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "30322:12:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_int64", + "typeString": "int64" + } + }, + "src": "30309:25:53", + "typeDescriptions": { + "typeIdentifier": "t_int64", + "typeString": "int64" + } + }, + "id": 11468, + "nodeType": "ExpressionStatement", + "src": "30309:25:53" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 11471, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 11469, + "name": "downcasted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11460, + "src": "30348:10:53", + "typeDescriptions": { + "typeIdentifier": "t_int64", + "typeString": "int64" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "id": 11470, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11457, + "src": "30362:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "src": "30348:19:53", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 11478, + "nodeType": "IfStatement", + "src": "30344:97:53", + "trueBody": { + "id": 11477, + "nodeType": "Block", + "src": "30369:72:53", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "hexValue": "3634", + "id": 11473, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "30420:2:53", + "typeDescriptions": { + "typeIdentifier": "t_rational_64_by_1", + "typeString": "int_const 64" + }, + "value": "64" + }, + { + "id": 11474, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11457, + "src": "30424:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_64_by_1", + "typeString": "int_const 64" + }, + { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + ], + "id": 11472, + "name": "SafeCastOverflowedIntDowncast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9960, + "src": "30390:29:53", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint8_$_t_int256_$returns$_t_error_$", + "typeString": "function (uint8,int256) pure returns (error)" + } + }, + "id": 11475, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "30390:40:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 11476, + "nodeType": "RevertStatement", + "src": "30383:47:53" + } + ] + } + } + ] + }, + "documentation": { + "id": 11455, + "nodeType": "StructuredDocumentation", + "src": "29915:307:53", + "text": " @dev Returns the downcasted int64 from int256, reverting on\n overflow (when the input is less than smallest int64 or\n greater than largest int64).\n Counterpart to Solidity's `int64` operator.\n Requirements:\n - input must fit into 64 bits" + }, + "id": 11480, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toInt64", + "nameLocation": "30236:7:53", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 11458, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 11457, + "mutability": "mutable", + "name": "value", + "nameLocation": "30251:5:53", + "nodeType": "VariableDeclaration", + "scope": 11480, + "src": "30244:12:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "typeName": { + "id": 11456, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "30244:6:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "visibility": "internal" + } + ], + "src": "30243:14:53" + }, + "returnParameters": { + "id": 11461, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 11460, + "mutability": "mutable", + "name": "downcasted", + "nameLocation": "30287:10:53", + "nodeType": "VariableDeclaration", + "scope": 11480, + "src": "30281:16:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int64", + "typeString": "int64" + }, + "typeName": { + "id": 11459, + "name": "int64", + "nodeType": "ElementaryTypeName", + "src": "30281:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int64", + "typeString": "int64" + } + }, + "visibility": "internal" + } + ], + "src": "30280:18:53" + }, + "scope": 11703, + "src": "30227:220:53", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 11505, + "nodeType": "Block", + "src": "30837:148:53", + "statements": [ + { + "expression": { + "id": 11493, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 11488, + "name": "downcasted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11486, + "src": "30847:10:53", + "typeDescriptions": { + "typeIdentifier": "t_int56", + "typeString": "int56" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "id": 11491, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11483, + "src": "30866:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + ], + "id": 11490, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "30860:5:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_int56_$", + "typeString": "type(int56)" + }, + "typeName": { + "id": 11489, + "name": "int56", + "nodeType": "ElementaryTypeName", + "src": "30860:5:53", + "typeDescriptions": {} + } + }, + "id": 11492, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "30860:12:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_int56", + "typeString": "int56" + } + }, + "src": "30847:25:53", + "typeDescriptions": { + "typeIdentifier": "t_int56", + "typeString": "int56" + } + }, + "id": 11494, + "nodeType": "ExpressionStatement", + "src": "30847:25:53" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 11497, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 11495, + "name": "downcasted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11486, + "src": "30886:10:53", + "typeDescriptions": { + "typeIdentifier": "t_int56", + "typeString": "int56" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "id": 11496, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11483, + "src": "30900:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "src": "30886:19:53", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 11504, + "nodeType": "IfStatement", + "src": "30882:97:53", + "trueBody": { + "id": 11503, + "nodeType": "Block", + "src": "30907:72:53", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "hexValue": "3536", + "id": 11499, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "30958:2:53", + "typeDescriptions": { + "typeIdentifier": "t_rational_56_by_1", + "typeString": "int_const 56" + }, + "value": "56" + }, + { + "id": 11500, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11483, + "src": "30962:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_56_by_1", + "typeString": "int_const 56" + }, + { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + ], + "id": 11498, + "name": "SafeCastOverflowedIntDowncast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9960, + "src": "30928:29:53", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint8_$_t_int256_$returns$_t_error_$", + "typeString": "function (uint8,int256) pure returns (error)" + } + }, + "id": 11501, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "30928:40:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 11502, + "nodeType": "RevertStatement", + "src": "30921:47:53" + } + ] + } + } + ] + }, + "documentation": { + "id": 11481, + "nodeType": "StructuredDocumentation", + "src": "30453:307:53", + "text": " @dev Returns the downcasted int56 from int256, reverting on\n overflow (when the input is less than smallest int56 or\n greater than largest int56).\n Counterpart to Solidity's `int56` operator.\n Requirements:\n - input must fit into 56 bits" + }, + "id": 11506, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toInt56", + "nameLocation": "30774:7:53", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 11484, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 11483, + "mutability": "mutable", + "name": "value", + "nameLocation": "30789:5:53", + "nodeType": "VariableDeclaration", + "scope": 11506, + "src": "30782:12:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "typeName": { + "id": 11482, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "30782:6:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "visibility": "internal" + } + ], + "src": "30781:14:53" + }, + "returnParameters": { + "id": 11487, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 11486, + "mutability": "mutable", + "name": "downcasted", + "nameLocation": "30825:10:53", + "nodeType": "VariableDeclaration", + "scope": 11506, + "src": "30819:16:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int56", + "typeString": "int56" + }, + "typeName": { + "id": 11485, + "name": "int56", + "nodeType": "ElementaryTypeName", + "src": "30819:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int56", + "typeString": "int56" + } + }, + "visibility": "internal" + } + ], + "src": "30818:18:53" + }, + "scope": 11703, + "src": "30765:220:53", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 11531, + "nodeType": "Block", + "src": "31375:148:53", + "statements": [ + { + "expression": { + "id": 11519, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 11514, + "name": "downcasted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11512, + "src": "31385:10:53", + "typeDescriptions": { + "typeIdentifier": "t_int48", + "typeString": "int48" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "id": 11517, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11509, + "src": "31404:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + ], + "id": 11516, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "31398:5:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_int48_$", + "typeString": "type(int48)" + }, + "typeName": { + "id": 11515, + "name": "int48", + "nodeType": "ElementaryTypeName", + "src": "31398:5:53", + "typeDescriptions": {} + } + }, + "id": 11518, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "31398:12:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_int48", + "typeString": "int48" + } + }, + "src": "31385:25:53", + "typeDescriptions": { + "typeIdentifier": "t_int48", + "typeString": "int48" + } + }, + "id": 11520, + "nodeType": "ExpressionStatement", + "src": "31385:25:53" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 11523, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 11521, + "name": "downcasted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11512, + "src": "31424:10:53", + "typeDescriptions": { + "typeIdentifier": "t_int48", + "typeString": "int48" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "id": 11522, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11509, + "src": "31438:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "src": "31424:19:53", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 11530, + "nodeType": "IfStatement", + "src": "31420:97:53", + "trueBody": { + "id": 11529, + "nodeType": "Block", + "src": "31445:72:53", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "hexValue": "3438", + "id": 11525, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "31496:2:53", + "typeDescriptions": { + "typeIdentifier": "t_rational_48_by_1", + "typeString": "int_const 48" + }, + "value": "48" + }, + { + "id": 11526, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11509, + "src": "31500:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_48_by_1", + "typeString": "int_const 48" + }, + { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + ], + "id": 11524, + "name": "SafeCastOverflowedIntDowncast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9960, + "src": "31466:29:53", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint8_$_t_int256_$returns$_t_error_$", + "typeString": "function (uint8,int256) pure returns (error)" + } + }, + "id": 11527, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "31466:40:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 11528, + "nodeType": "RevertStatement", + "src": "31459:47:53" + } + ] + } + } + ] + }, + "documentation": { + "id": 11507, + "nodeType": "StructuredDocumentation", + "src": "30991:307:53", + "text": " @dev Returns the downcasted int48 from int256, reverting on\n overflow (when the input is less than smallest int48 or\n greater than largest int48).\n Counterpart to Solidity's `int48` operator.\n Requirements:\n - input must fit into 48 bits" + }, + "id": 11532, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toInt48", + "nameLocation": "31312:7:53", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 11510, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 11509, + "mutability": "mutable", + "name": "value", + "nameLocation": "31327:5:53", + "nodeType": "VariableDeclaration", + "scope": 11532, + "src": "31320:12:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "typeName": { + "id": 11508, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "31320:6:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "visibility": "internal" + } + ], + "src": "31319:14:53" + }, + "returnParameters": { + "id": 11513, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 11512, + "mutability": "mutable", + "name": "downcasted", + "nameLocation": "31363:10:53", + "nodeType": "VariableDeclaration", + "scope": 11532, + "src": "31357:16:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int48", + "typeString": "int48" + }, + "typeName": { + "id": 11511, + "name": "int48", + "nodeType": "ElementaryTypeName", + "src": "31357:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int48", + "typeString": "int48" + } + }, + "visibility": "internal" + } + ], + "src": "31356:18:53" + }, + "scope": 11703, + "src": "31303:220:53", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 11557, + "nodeType": "Block", + "src": "31913:148:53", + "statements": [ + { + "expression": { + "id": 11545, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 11540, + "name": "downcasted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11538, + "src": "31923:10:53", + "typeDescriptions": { + "typeIdentifier": "t_int40", + "typeString": "int40" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "id": 11543, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11535, + "src": "31942:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + ], + "id": 11542, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "31936:5:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_int40_$", + "typeString": "type(int40)" + }, + "typeName": { + "id": 11541, + "name": "int40", + "nodeType": "ElementaryTypeName", + "src": "31936:5:53", + "typeDescriptions": {} + } + }, + "id": 11544, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "31936:12:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_int40", + "typeString": "int40" + } + }, + "src": "31923:25:53", + "typeDescriptions": { + "typeIdentifier": "t_int40", + "typeString": "int40" + } + }, + "id": 11546, + "nodeType": "ExpressionStatement", + "src": "31923:25:53" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 11549, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 11547, + "name": "downcasted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11538, + "src": "31962:10:53", + "typeDescriptions": { + "typeIdentifier": "t_int40", + "typeString": "int40" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "id": 11548, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11535, + "src": "31976:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "src": "31962:19:53", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 11556, + "nodeType": "IfStatement", + "src": "31958:97:53", + "trueBody": { + "id": 11555, + "nodeType": "Block", + "src": "31983:72:53", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "hexValue": "3430", + "id": 11551, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "32034:2:53", + "typeDescriptions": { + "typeIdentifier": "t_rational_40_by_1", + "typeString": "int_const 40" + }, + "value": "40" + }, + { + "id": 11552, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11535, + "src": "32038:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_40_by_1", + "typeString": "int_const 40" + }, + { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + ], + "id": 11550, + "name": "SafeCastOverflowedIntDowncast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9960, + "src": "32004:29:53", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint8_$_t_int256_$returns$_t_error_$", + "typeString": "function (uint8,int256) pure returns (error)" + } + }, + "id": 11553, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "32004:40:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 11554, + "nodeType": "RevertStatement", + "src": "31997:47:53" + } + ] + } + } + ] + }, + "documentation": { + "id": 11533, + "nodeType": "StructuredDocumentation", + "src": "31529:307:53", + "text": " @dev Returns the downcasted int40 from int256, reverting on\n overflow (when the input is less than smallest int40 or\n greater than largest int40).\n Counterpart to Solidity's `int40` operator.\n Requirements:\n - input must fit into 40 bits" + }, + "id": 11558, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toInt40", + "nameLocation": "31850:7:53", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 11536, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 11535, + "mutability": "mutable", + "name": "value", + "nameLocation": "31865:5:53", + "nodeType": "VariableDeclaration", + "scope": 11558, + "src": "31858:12:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "typeName": { + "id": 11534, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "31858:6:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "visibility": "internal" + } + ], + "src": "31857:14:53" + }, + "returnParameters": { + "id": 11539, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 11538, + "mutability": "mutable", + "name": "downcasted", + "nameLocation": "31901:10:53", + "nodeType": "VariableDeclaration", + "scope": 11558, + "src": "31895:16:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int40", + "typeString": "int40" + }, + "typeName": { + "id": 11537, + "name": "int40", + "nodeType": "ElementaryTypeName", + "src": "31895:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int40", + "typeString": "int40" + } + }, + "visibility": "internal" + } + ], + "src": "31894:18:53" + }, + "scope": 11703, + "src": "31841:220:53", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 11583, + "nodeType": "Block", + "src": "32451:148:53", + "statements": [ + { + "expression": { + "id": 11571, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 11566, + "name": "downcasted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11564, + "src": "32461:10:53", + "typeDescriptions": { + "typeIdentifier": "t_int32", + "typeString": "int32" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "id": 11569, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11561, + "src": "32480:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + ], + "id": 11568, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "32474:5:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_int32_$", + "typeString": "type(int32)" + }, + "typeName": { + "id": 11567, + "name": "int32", + "nodeType": "ElementaryTypeName", + "src": "32474:5:53", + "typeDescriptions": {} + } + }, + "id": 11570, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "32474:12:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_int32", + "typeString": "int32" + } + }, + "src": "32461:25:53", + "typeDescriptions": { + "typeIdentifier": "t_int32", + "typeString": "int32" + } + }, + "id": 11572, + "nodeType": "ExpressionStatement", + "src": "32461:25:53" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 11575, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 11573, + "name": "downcasted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11564, + "src": "32500:10:53", + "typeDescriptions": { + "typeIdentifier": "t_int32", + "typeString": "int32" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "id": 11574, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11561, + "src": "32514:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "src": "32500:19:53", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 11582, + "nodeType": "IfStatement", + "src": "32496:97:53", + "trueBody": { + "id": 11581, + "nodeType": "Block", + "src": "32521:72:53", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "hexValue": "3332", + "id": 11577, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "32572:2:53", + "typeDescriptions": { + "typeIdentifier": "t_rational_32_by_1", + "typeString": "int_const 32" + }, + "value": "32" + }, + { + "id": 11578, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11561, + "src": "32576:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_32_by_1", + "typeString": "int_const 32" + }, + { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + ], + "id": 11576, + "name": "SafeCastOverflowedIntDowncast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9960, + "src": "32542:29:53", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint8_$_t_int256_$returns$_t_error_$", + "typeString": "function (uint8,int256) pure returns (error)" + } + }, + "id": 11579, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "32542:40:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 11580, + "nodeType": "RevertStatement", + "src": "32535:47:53" + } + ] + } + } + ] + }, + "documentation": { + "id": 11559, + "nodeType": "StructuredDocumentation", + "src": "32067:307:53", + "text": " @dev Returns the downcasted int32 from int256, reverting on\n overflow (when the input is less than smallest int32 or\n greater than largest int32).\n Counterpart to Solidity's `int32` operator.\n Requirements:\n - input must fit into 32 bits" + }, + "id": 11584, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toInt32", + "nameLocation": "32388:7:53", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 11562, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 11561, + "mutability": "mutable", + "name": "value", + "nameLocation": "32403:5:53", + "nodeType": "VariableDeclaration", + "scope": 11584, + "src": "32396:12:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "typeName": { + "id": 11560, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "32396:6:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "visibility": "internal" + } + ], + "src": "32395:14:53" + }, + "returnParameters": { + "id": 11565, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 11564, + "mutability": "mutable", + "name": "downcasted", + "nameLocation": "32439:10:53", + "nodeType": "VariableDeclaration", + "scope": 11584, + "src": "32433:16:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int32", + "typeString": "int32" + }, + "typeName": { + "id": 11563, + "name": "int32", + "nodeType": "ElementaryTypeName", + "src": "32433:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int32", + "typeString": "int32" + } + }, + "visibility": "internal" + } + ], + "src": "32432:18:53" + }, + "scope": 11703, + "src": "32379:220:53", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 11609, + "nodeType": "Block", + "src": "32989:148:53", + "statements": [ + { + "expression": { + "id": 11597, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 11592, + "name": "downcasted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11590, + "src": "32999:10:53", + "typeDescriptions": { + "typeIdentifier": "t_int24", + "typeString": "int24" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "id": 11595, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11587, + "src": "33018:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + ], + "id": 11594, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "33012:5:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_int24_$", + "typeString": "type(int24)" + }, + "typeName": { + "id": 11593, + "name": "int24", + "nodeType": "ElementaryTypeName", + "src": "33012:5:53", + "typeDescriptions": {} + } + }, + "id": 11596, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "33012:12:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_int24", + "typeString": "int24" + } + }, + "src": "32999:25:53", + "typeDescriptions": { + "typeIdentifier": "t_int24", + "typeString": "int24" + } + }, + "id": 11598, + "nodeType": "ExpressionStatement", + "src": "32999:25:53" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 11601, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 11599, + "name": "downcasted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11590, + "src": "33038:10:53", + "typeDescriptions": { + "typeIdentifier": "t_int24", + "typeString": "int24" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "id": 11600, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11587, + "src": "33052:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "src": "33038:19:53", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 11608, + "nodeType": "IfStatement", + "src": "33034:97:53", + "trueBody": { + "id": 11607, + "nodeType": "Block", + "src": "33059:72:53", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "hexValue": "3234", + "id": 11603, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "33110:2:53", + "typeDescriptions": { + "typeIdentifier": "t_rational_24_by_1", + "typeString": "int_const 24" + }, + "value": "24" + }, + { + "id": 11604, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11587, + "src": "33114:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_24_by_1", + "typeString": "int_const 24" + }, + { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + ], + "id": 11602, + "name": "SafeCastOverflowedIntDowncast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9960, + "src": "33080:29:53", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint8_$_t_int256_$returns$_t_error_$", + "typeString": "function (uint8,int256) pure returns (error)" + } + }, + "id": 11605, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "33080:40:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 11606, + "nodeType": "RevertStatement", + "src": "33073:47:53" + } + ] + } + } + ] + }, + "documentation": { + "id": 11585, + "nodeType": "StructuredDocumentation", + "src": "32605:307:53", + "text": " @dev Returns the downcasted int24 from int256, reverting on\n overflow (when the input is less than smallest int24 or\n greater than largest int24).\n Counterpart to Solidity's `int24` operator.\n Requirements:\n - input must fit into 24 bits" + }, + "id": 11610, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toInt24", + "nameLocation": "32926:7:53", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 11588, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 11587, + "mutability": "mutable", + "name": "value", + "nameLocation": "32941:5:53", + "nodeType": "VariableDeclaration", + "scope": 11610, + "src": "32934:12:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "typeName": { + "id": 11586, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "32934:6:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "visibility": "internal" + } + ], + "src": "32933:14:53" + }, + "returnParameters": { + "id": 11591, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 11590, + "mutability": "mutable", + "name": "downcasted", + "nameLocation": "32977:10:53", + "nodeType": "VariableDeclaration", + "scope": 11610, + "src": "32971:16:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int24", + "typeString": "int24" + }, + "typeName": { + "id": 11589, + "name": "int24", + "nodeType": "ElementaryTypeName", + "src": "32971:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int24", + "typeString": "int24" + } + }, + "visibility": "internal" + } + ], + "src": "32970:18:53" + }, + "scope": 11703, + "src": "32917:220:53", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 11635, + "nodeType": "Block", + "src": "33527:148:53", + "statements": [ + { + "expression": { + "id": 11623, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 11618, + "name": "downcasted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11616, + "src": "33537:10:53", + "typeDescriptions": { + "typeIdentifier": "t_int16", + "typeString": "int16" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "id": 11621, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11613, + "src": "33556:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + ], + "id": 11620, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "33550:5:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_int16_$", + "typeString": "type(int16)" + }, + "typeName": { + "id": 11619, + "name": "int16", + "nodeType": "ElementaryTypeName", + "src": "33550:5:53", + "typeDescriptions": {} + } + }, + "id": 11622, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "33550:12:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_int16", + "typeString": "int16" + } + }, + "src": "33537:25:53", + "typeDescriptions": { + "typeIdentifier": "t_int16", + "typeString": "int16" + } + }, + "id": 11624, + "nodeType": "ExpressionStatement", + "src": "33537:25:53" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 11627, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 11625, + "name": "downcasted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11616, + "src": "33576:10:53", + "typeDescriptions": { + "typeIdentifier": "t_int16", + "typeString": "int16" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "id": 11626, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11613, + "src": "33590:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "src": "33576:19:53", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 11634, + "nodeType": "IfStatement", + "src": "33572:97:53", + "trueBody": { + "id": 11633, + "nodeType": "Block", + "src": "33597:72:53", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "hexValue": "3136", + "id": 11629, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "33648:2:53", + "typeDescriptions": { + "typeIdentifier": "t_rational_16_by_1", + "typeString": "int_const 16" + }, + "value": "16" + }, + { + "id": 11630, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11613, + "src": "33652:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_16_by_1", + "typeString": "int_const 16" + }, + { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + ], + "id": 11628, + "name": "SafeCastOverflowedIntDowncast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9960, + "src": "33618:29:53", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint8_$_t_int256_$returns$_t_error_$", + "typeString": "function (uint8,int256) pure returns (error)" + } + }, + "id": 11631, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "33618:40:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 11632, + "nodeType": "RevertStatement", + "src": "33611:47:53" + } + ] + } + } + ] + }, + "documentation": { + "id": 11611, + "nodeType": "StructuredDocumentation", + "src": "33143:307:53", + "text": " @dev Returns the downcasted int16 from int256, reverting on\n overflow (when the input is less than smallest int16 or\n greater than largest int16).\n Counterpart to Solidity's `int16` operator.\n Requirements:\n - input must fit into 16 bits" + }, + "id": 11636, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toInt16", + "nameLocation": "33464:7:53", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 11614, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 11613, + "mutability": "mutable", + "name": "value", + "nameLocation": "33479:5:53", + "nodeType": "VariableDeclaration", + "scope": 11636, + "src": "33472:12:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "typeName": { + "id": 11612, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "33472:6:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "visibility": "internal" + } + ], + "src": "33471:14:53" + }, + "returnParameters": { + "id": 11617, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 11616, + "mutability": "mutable", + "name": "downcasted", + "nameLocation": "33515:10:53", + "nodeType": "VariableDeclaration", + "scope": 11636, + "src": "33509:16:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int16", + "typeString": "int16" + }, + "typeName": { + "id": 11615, + "name": "int16", + "nodeType": "ElementaryTypeName", + "src": "33509:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int16", + "typeString": "int16" + } + }, + "visibility": "internal" + } + ], + "src": "33508:18:53" + }, + "scope": 11703, + "src": "33455:220:53", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 11661, + "nodeType": "Block", + "src": "34058:146:53", + "statements": [ + { + "expression": { + "id": 11649, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 11644, + "name": "downcasted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11642, + "src": "34068:10:53", + "typeDescriptions": { + "typeIdentifier": "t_int8", + "typeString": "int8" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "id": 11647, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11639, + "src": "34086:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + ], + "id": 11646, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "34081:4:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_int8_$", + "typeString": "type(int8)" + }, + "typeName": { + "id": 11645, + "name": "int8", + "nodeType": "ElementaryTypeName", + "src": "34081:4:53", + "typeDescriptions": {} + } + }, + "id": 11648, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "34081:11:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_int8", + "typeString": "int8" + } + }, + "src": "34068:24:53", + "typeDescriptions": { + "typeIdentifier": "t_int8", + "typeString": "int8" + } + }, + "id": 11650, + "nodeType": "ExpressionStatement", + "src": "34068:24:53" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 11653, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 11651, + "name": "downcasted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11642, + "src": "34106:10:53", + "typeDescriptions": { + "typeIdentifier": "t_int8", + "typeString": "int8" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "id": 11652, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11639, + "src": "34120:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "src": "34106:19:53", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 11660, + "nodeType": "IfStatement", + "src": "34102:96:53", + "trueBody": { + "id": 11659, + "nodeType": "Block", + "src": "34127:71:53", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "hexValue": "38", + "id": 11655, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "34178:1:53", + "typeDescriptions": { + "typeIdentifier": "t_rational_8_by_1", + "typeString": "int_const 8" + }, + "value": "8" + }, + { + "id": 11656, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11639, + "src": "34181:5:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_8_by_1", + "typeString": "int_const 8" + }, + { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + ], + "id": 11654, + "name": "SafeCastOverflowedIntDowncast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9960, + "src": "34148:29:53", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint8_$_t_int256_$returns$_t_error_$", + "typeString": "function (uint8,int256) pure returns (error)" + } + }, + "id": 11657, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "34148:39:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 11658, + "nodeType": "RevertStatement", + "src": "34141:46:53" + } + ] + } + } + ] + }, + "documentation": { + "id": 11637, + "nodeType": "StructuredDocumentation", + "src": "33681:302:53", + "text": " @dev Returns the downcasted int8 from int256, reverting on\n overflow (when the input is less than smallest int8 or\n greater than largest int8).\n Counterpart to Solidity's `int8` operator.\n Requirements:\n - input must fit into 8 bits" + }, + "id": 11662, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toInt8", + "nameLocation": "33997:6:53", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 11640, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 11639, + "mutability": "mutable", + "name": "value", + "nameLocation": "34011:5:53", + "nodeType": "VariableDeclaration", + "scope": 11662, + "src": "34004:12:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "typeName": { + "id": 11638, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "34004:6:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "visibility": "internal" + } + ], + "src": "34003:14:53" + }, + "returnParameters": { + "id": 11643, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 11642, + "mutability": "mutable", + "name": "downcasted", + "nameLocation": "34046:10:53", + "nodeType": "VariableDeclaration", + "scope": 11662, + "src": "34041:15:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int8", + "typeString": "int8" + }, + "typeName": { + "id": 11641, + "name": "int8", + "nodeType": "ElementaryTypeName", + "src": "34041:4:53", + "typeDescriptions": { + "typeIdentifier": "t_int8", + "typeString": "int8" + } + }, + "visibility": "internal" + } + ], + "src": "34040:17:53" + }, + "scope": 11703, + "src": "33988:216:53", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 11691, + "nodeType": "Block", + "src": "34444:250:53", + "statements": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 11679, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 11670, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11665, + "src": "34557:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "arguments": [ + { + "expression": { + "arguments": [ + { + "id": 11675, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "34578:6:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_int256_$", + "typeString": "type(int256)" + }, + "typeName": { + "id": 11674, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "34578:6:53", + "typeDescriptions": {} + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_type$_t_int256_$", + "typeString": "type(int256)" + } + ], + "id": 11673, + "name": "type", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -27, + "src": "34573:4:53", + "typeDescriptions": { + "typeIdentifier": "t_function_metatype_pure$__$returns$__$", + "typeString": "function () pure" + } + }, + "id": 11676, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "34573:12:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_magic_meta_type_t_int256", + "typeString": "type(int256)" + } + }, + "id": 11677, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "34586:3:53", + "memberName": "max", + "nodeType": "MemberAccess", + "src": "34573:16:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + ], + "id": 11672, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "34565:7:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + }, + "typeName": { + "id": 11671, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "34565:7:53", + "typeDescriptions": {} + } + }, + "id": 11678, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "34565:25:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "34557:33:53", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 11685, + "nodeType": "IfStatement", + "src": "34553:105:53", + "trueBody": { + "id": 11684, + "nodeType": "Block", + "src": "34592:66:53", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "id": 11681, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11665, + "src": "34641:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 11680, + "name": "SafeCastOverflowedUintToInt", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9965, + "src": "34613:27:53", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint256_$returns$_t_error_$", + "typeString": "function (uint256) pure returns (error)" + } + }, + "id": 11682, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "34613:34:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 11683, + "nodeType": "RevertStatement", + "src": "34606:41:53" + } + ] + } + }, + { + "expression": { + "arguments": [ + { + "id": 11688, + "name": "value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11665, + "src": "34681:5:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 11687, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "34674:6:53", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_int256_$", + "typeString": "type(int256)" + }, + "typeName": { + "id": 11686, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "34674:6:53", + "typeDescriptions": {} + } + }, + "id": 11689, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "34674:13:53", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "functionReturnParameters": 11669, + "id": 11690, + "nodeType": "Return", + "src": "34667:20:53" + } + ] + }, + "documentation": { + "id": 11663, + "nodeType": "StructuredDocumentation", + "src": "34210:165:53", + "text": " @dev Converts an unsigned uint256 into a signed int256.\n Requirements:\n - input must be less than or equal to maxInt256." + }, + "id": 11692, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toInt256", + "nameLocation": "34389:8:53", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 11666, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 11665, + "mutability": "mutable", + "name": "value", + "nameLocation": "34406:5:53", + "nodeType": "VariableDeclaration", + "scope": 11692, + "src": "34398:13:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 11664, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "34398:7:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "34397:15:53" + }, + "returnParameters": { + "id": 11669, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 11668, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 11692, + "src": "34436:6:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "typeName": { + "id": 11667, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "34436:6:53", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "visibility": "internal" + } + ], + "src": "34435:8:53" + }, + "scope": 11703, + "src": "34380:314:53", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 11701, + "nodeType": "Block", + "src": "34853:87:53", + "statements": [ + { + "AST": { + "nativeSrc": "34888:46:53", + "nodeType": "YulBlock", + "src": "34888:46:53", + "statements": [ + { + "nativeSrc": "34902:22:53", + "nodeType": "YulAssignment", + "src": "34902:22:53", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "b", + "nativeSrc": "34921:1:53", + "nodeType": "YulIdentifier", + "src": "34921:1:53" + } + ], + "functionName": { + "name": "iszero", + "nativeSrc": "34914:6:53", + "nodeType": "YulIdentifier", + "src": "34914:6:53" + }, + "nativeSrc": "34914:9:53", + "nodeType": "YulFunctionCall", + "src": "34914:9:53" + } + ], + "functionName": { + "name": "iszero", + "nativeSrc": "34907:6:53", + "nodeType": "YulIdentifier", + "src": "34907:6:53" + }, + "nativeSrc": "34907:17:53", + "nodeType": "YulFunctionCall", + "src": "34907:17:53" + }, + "variableNames": [ + { + "name": "u", + "nativeSrc": "34902:1:53", + "nodeType": "YulIdentifier", + "src": "34902:1:53" + } + ] + } + ] + }, + "evmVersion": "paris", + "externalReferences": [ + { + "declaration": 11695, + "isOffset": false, + "isSlot": false, + "src": "34921:1:53", + "valueSize": 1 + }, + { + "declaration": 11698, + "isOffset": false, + "isSlot": false, + "src": "34902:1:53", + "valueSize": 1 + } + ], + "flags": [ + "memory-safe" + ], + "id": 11700, + "nodeType": "InlineAssembly", + "src": "34863:71:53" + } + ] + }, + "documentation": { + "id": 11693, + "nodeType": "StructuredDocumentation", + "src": "34700:90:53", + "text": " @dev Cast a boolean (false or true) to a uint256 (0 or 1) with no jump." + }, + "id": 11702, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toUint", + "nameLocation": "34804:6:53", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 11696, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 11695, + "mutability": "mutable", + "name": "b", + "nameLocation": "34816:1:53", + "nodeType": "VariableDeclaration", + "scope": 11702, + "src": "34811:6:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 11694, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "34811:4:53", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "src": "34810:8:53" + }, + "returnParameters": { + "id": 11699, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 11698, + "mutability": "mutable", + "name": "u", + "nameLocation": "34850:1:53", + "nodeType": "VariableDeclaration", + "scope": 11702, + "src": "34842:9:53", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 11697, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "34842:7:53", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "34841:11:53" + }, + "scope": 11703, + "src": "34795:145:53", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + } + ], + "scope": 11704, + "src": "769:34173:53", + "usedErrors": [ + 9948, + 9953, + 9960, + 9965 + ], + "usedEvents": [] + } + ], + "src": "192:34751:53" + }, + "id": 53 + }, + "@openzeppelin/contracts/utils/math/SignedMath.sol": { + "ast": { + "absolutePath": "@openzeppelin/contracts/utils/math/SignedMath.sol", + "exportedSymbols": { + "SafeCast": [ + 11703 + ], + "SignedMath": [ + 11847 + ] + }, + "id": 11848, + "license": "MIT", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 11705, + "literals": [ + "solidity", + "^", + "0.8", + ".20" + ], + "nodeType": "PragmaDirective", + "src": "109:24:54" + }, + { + "absolutePath": "@openzeppelin/contracts/utils/math/SafeCast.sol", + "file": "./SafeCast.sol", + "id": 11707, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 11848, + "sourceUnit": 11704, + "src": "135:40:54", + "symbolAliases": [ + { + "foreign": { + "id": 11706, + "name": "SafeCast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11703, + "src": "143:8:54", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "abstract": false, + "baseContracts": [], + "canonicalName": "SignedMath", + "contractDependencies": [], + "contractKind": "library", + "documentation": { + "id": 11708, + "nodeType": "StructuredDocumentation", + "src": "177:80:54", + "text": " @dev Standard signed math utilities missing in the Solidity language." + }, + "fullyImplemented": true, + "id": 11847, + "linearizedBaseContracts": [ + 11847 + ], + "name": "SignedMath", + "nameLocation": "266:10:54", + "nodeType": "ContractDefinition", + "nodes": [ + { + "body": { + "id": 11737, + "nodeType": "Block", + "src": "746:215:54", + "statements": [ + { + "id": 11736, + "nodeType": "UncheckedBlock", + "src": "756:199:54", + "statements": [ + { + "expression": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 11734, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 11720, + "name": "b", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11715, + "src": "894:1:54", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": "^", + "rightExpression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 11732, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 11723, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 11721, + "name": "a", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11713, + "src": "900:1:54", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": "^", + "rightExpression": { + "id": 11722, + "name": "b", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11715, + "src": "904:1:54", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "src": "900:5:54", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "id": 11724, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "899:7:54", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": "*", + "rightExpression": { + "arguments": [ + { + "arguments": [ + { + "id": 11729, + "name": "condition", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11711, + "src": "932:9:54", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "expression": { + "id": 11727, + "name": "SafeCast", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11703, + "src": "916:8:54", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_SafeCast_$11703_$", + "typeString": "type(library SafeCast)" + } + }, + "id": 11728, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "925:6:54", + "memberName": "toUint", + "nodeType": "MemberAccess", + "referencedDeclaration": 11702, + "src": "916:15:54", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_bool_$returns$_t_uint256_$", + "typeString": "function (bool) pure returns (uint256)" + } + }, + "id": 11730, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "916:26:54", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 11726, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "909:6:54", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_int256_$", + "typeString": "type(int256)" + }, + "typeName": { + "id": 11725, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "909:6:54", + "typeDescriptions": {} + } + }, + "id": 11731, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "909:34:54", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "src": "899:44:54", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "id": 11733, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "898:46:54", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "src": "894:50:54", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "functionReturnParameters": 11719, + "id": 11735, + "nodeType": "Return", + "src": "887:57:54" + } + ] + } + ] + }, + "documentation": { + "id": 11709, + "nodeType": "StructuredDocumentation", + "src": "283:374:54", + "text": " @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\n IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\n However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\n one branch when needed, making this function more expensive." + }, + "id": 11738, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "ternary", + "nameLocation": "671:7:54", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 11716, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 11711, + "mutability": "mutable", + "name": "condition", + "nameLocation": "684:9:54", + "nodeType": "VariableDeclaration", + "scope": 11738, + "src": "679:14:54", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 11710, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "679:4:54", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 11713, + "mutability": "mutable", + "name": "a", + "nameLocation": "702:1:54", + "nodeType": "VariableDeclaration", + "scope": 11738, + "src": "695:8:54", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "typeName": { + "id": 11712, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "695:6:54", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 11715, + "mutability": "mutable", + "name": "b", + "nameLocation": "712:1:54", + "nodeType": "VariableDeclaration", + "scope": 11738, + "src": "705:8:54", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "typeName": { + "id": 11714, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "705:6:54", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "visibility": "internal" + } + ], + "src": "678:36:54" + }, + "returnParameters": { + "id": 11719, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 11718, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 11738, + "src": "738:6:54", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "typeName": { + "id": 11717, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "738:6:54", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "visibility": "internal" + } + ], + "src": "737:8:54" + }, + "scope": 11847, + "src": "662:299:54", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 11756, + "nodeType": "Block", + "src": "1102:44:54", + "statements": [ + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 11751, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 11749, + "name": "a", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11741, + "src": "1127:1:54", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "id": 11750, + "name": "b", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11743, + "src": "1131:1:54", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "src": "1127:5:54", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "id": 11752, + "name": "a", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11741, + "src": "1134:1:54", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + { + "id": 11753, + "name": "b", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11743, + "src": "1137:1:54", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + ], + "id": 11748, + "name": "ternary", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11738, + "src": "1119:7:54", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_bool_$_t_int256_$_t_int256_$returns$_t_int256_$", + "typeString": "function (bool,int256,int256) pure returns (int256)" + } + }, + "id": 11754, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "1119:20:54", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "functionReturnParameters": 11747, + "id": 11755, + "nodeType": "Return", + "src": "1112:27:54" + } + ] + }, + "documentation": { + "id": 11739, + "nodeType": "StructuredDocumentation", + "src": "967:66:54", + "text": " @dev Returns the largest of two signed numbers." + }, + "id": 11757, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "max", + "nameLocation": "1047:3:54", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 11744, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 11741, + "mutability": "mutable", + "name": "a", + "nameLocation": "1058:1:54", + "nodeType": "VariableDeclaration", + "scope": 11757, + "src": "1051:8:54", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "typeName": { + "id": 11740, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "1051:6:54", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 11743, + "mutability": "mutable", + "name": "b", + "nameLocation": "1068:1:54", + "nodeType": "VariableDeclaration", + "scope": 11757, + "src": "1061:8:54", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "typeName": { + "id": 11742, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "1061:6:54", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "visibility": "internal" + } + ], + "src": "1050:20:54" + }, + "returnParameters": { + "id": 11747, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 11746, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 11757, + "src": "1094:6:54", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "typeName": { + "id": 11745, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "1094:6:54", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "visibility": "internal" + } + ], + "src": "1093:8:54" + }, + "scope": 11847, + "src": "1038:108:54", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 11775, + "nodeType": "Block", + "src": "1288:44:54", + "statements": [ + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 11770, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 11768, + "name": "a", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11760, + "src": "1313:1:54", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "id": 11769, + "name": "b", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11762, + "src": "1317:1:54", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "src": "1313:5:54", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "id": 11771, + "name": "a", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11760, + "src": "1320:1:54", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + { + "id": 11772, + "name": "b", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11762, + "src": "1323:1:54", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + ], + "id": 11767, + "name": "ternary", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11738, + "src": "1305:7:54", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_bool_$_t_int256_$_t_int256_$returns$_t_int256_$", + "typeString": "function (bool,int256,int256) pure returns (int256)" + } + }, + "id": 11773, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "1305:20:54", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "functionReturnParameters": 11766, + "id": 11774, + "nodeType": "Return", + "src": "1298:27:54" + } + ] + }, + "documentation": { + "id": 11758, + "nodeType": "StructuredDocumentation", + "src": "1152:67:54", + "text": " @dev Returns the smallest of two signed numbers." + }, + "id": 11776, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "min", + "nameLocation": "1233:3:54", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 11763, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 11760, + "mutability": "mutable", + "name": "a", + "nameLocation": "1244:1:54", + "nodeType": "VariableDeclaration", + "scope": 11776, + "src": "1237:8:54", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "typeName": { + "id": 11759, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "1237:6:54", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 11762, + "mutability": "mutable", + "name": "b", + "nameLocation": "1254:1:54", + "nodeType": "VariableDeclaration", + "scope": 11776, + "src": "1247:8:54", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "typeName": { + "id": 11761, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "1247:6:54", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "visibility": "internal" + } + ], + "src": "1236:20:54" + }, + "returnParameters": { + "id": 11766, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 11765, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 11776, + "src": "1280:6:54", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "typeName": { + "id": 11764, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "1280:6:54", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "visibility": "internal" + } + ], + "src": "1279:8:54" + }, + "scope": 11847, + "src": "1224:108:54", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 11819, + "nodeType": "Block", + "src": "1537:162:54", + "statements": [ + { + "assignments": [ + 11787 + ], + "declarations": [ + { + "constant": false, + "id": 11787, + "mutability": "mutable", + "name": "x", + "nameLocation": "1606:1:54", + "nodeType": "VariableDeclaration", + "scope": 11819, + "src": "1599:8:54", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "typeName": { + "id": 11786, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "1599:6:54", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "visibility": "internal" + } + ], + "id": 11800, + "initialValue": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 11799, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 11790, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 11788, + "name": "a", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11779, + "src": "1611:1:54", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": "&", + "rightExpression": { + "id": 11789, + "name": "b", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11781, + "src": "1615:1:54", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "src": "1611:5:54", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "id": 11791, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "1610:7:54", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 11797, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 11794, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 11792, + "name": "a", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11779, + "src": "1622:1:54", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": "^", + "rightExpression": { + "id": 11793, + "name": "b", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11781, + "src": "1626:1:54", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "src": "1622:5:54", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "id": 11795, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "1621:7:54", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">>", + "rightExpression": { + "hexValue": "31", + "id": 11796, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1632:1:54", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "1621:12:54", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "id": 11798, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "1620:14:54", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "src": "1610:24:54", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "1599:35:54" + }, + { + "expression": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 11817, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 11801, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11787, + "src": "1651:1:54", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 11815, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 11809, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "arguments": [ + { + "id": 11806, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11787, + "src": "1671:1:54", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + ], + "id": 11805, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "1663:7:54", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + }, + "typeName": { + "id": 11804, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1663:7:54", + "typeDescriptions": {} + } + }, + "id": 11807, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "1663:10:54", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">>", + "rightExpression": { + "hexValue": "323535", + "id": 11808, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1677:3:54", + "typeDescriptions": { + "typeIdentifier": "t_rational_255_by_1", + "typeString": "int_const 255" + }, + "value": "255" + }, + "src": "1663:17:54", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 11803, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "1656:6:54", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_int256_$", + "typeString": "type(int256)" + }, + "typeName": { + "id": 11802, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "1656:6:54", + "typeDescriptions": {} + } + }, + "id": 11810, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "1656:25:54", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": "&", + "rightExpression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 11813, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 11811, + "name": "a", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11779, + "src": "1685:1:54", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": "^", + "rightExpression": { + "id": 11812, + "name": "b", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11781, + "src": "1689:1:54", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "src": "1685:5:54", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "id": 11814, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "1684:7:54", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "src": "1656:35:54", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "id": 11816, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "1655:37:54", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "src": "1651:41:54", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "functionReturnParameters": 11785, + "id": 11818, + "nodeType": "Return", + "src": "1644:48:54" + } + ] + }, + "documentation": { + "id": 11777, + "nodeType": "StructuredDocumentation", + "src": "1338:126:54", + "text": " @dev Returns the average of two signed numbers without overflow.\n The result is rounded towards zero." + }, + "id": 11820, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "average", + "nameLocation": "1478:7:54", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 11782, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 11779, + "mutability": "mutable", + "name": "a", + "nameLocation": "1493:1:54", + "nodeType": "VariableDeclaration", + "scope": 11820, + "src": "1486:8:54", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "typeName": { + "id": 11778, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "1486:6:54", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 11781, + "mutability": "mutable", + "name": "b", + "nameLocation": "1503:1:54", + "nodeType": "VariableDeclaration", + "scope": 11820, + "src": "1496:8:54", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "typeName": { + "id": 11780, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "1496:6:54", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "visibility": "internal" + } + ], + "src": "1485:20:54" + }, + "returnParameters": { + "id": 11785, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 11784, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 11820, + "src": "1529:6:54", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "typeName": { + "id": 11783, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "1529:6:54", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "visibility": "internal" + } + ], + "src": "1528:8:54" + }, + "scope": 11847, + "src": "1469:230:54", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 11845, + "nodeType": "Block", + "src": "1843:767:54", + "statements": [ + { + "id": 11844, + "nodeType": "UncheckedBlock", + "src": "1853:751:54", + "statements": [ + { + "assignments": [ + 11829 + ], + "declarations": [ + { + "constant": false, + "id": 11829, + "mutability": "mutable", + "name": "mask", + "nameLocation": "2424:4:54", + "nodeType": "VariableDeclaration", + "scope": 11844, + "src": "2417:11:54", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "typeName": { + "id": 11828, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "2417:6:54", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "visibility": "internal" + } + ], + "id": 11833, + "initialValue": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 11832, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 11830, + "name": "n", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11823, + "src": "2431:1:54", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">>", + "rightExpression": { + "hexValue": "323535", + "id": 11831, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2436:3:54", + "typeDescriptions": { + "typeIdentifier": "t_rational_255_by_1", + "typeString": "int_const 255" + }, + "value": "255" + }, + "src": "2431:8:54", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "2417:22:54" + }, + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 11841, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 11838, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 11836, + "name": "n", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11823, + "src": "2576:1:54", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "id": 11837, + "name": "mask", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11829, + "src": "2580:4:54", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "src": "2576:8:54", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "id": 11839, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "2575:10:54", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": "^", + "rightExpression": { + "id": 11840, + "name": "mask", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11829, + "src": "2588:4:54", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "src": "2575:17:54", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + ], + "id": 11835, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "2567:7:54", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + }, + "typeName": { + "id": 11834, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2567:7:54", + "typeDescriptions": {} + } + }, + "id": 11842, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2567:26:54", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 11827, + "id": 11843, + "nodeType": "Return", + "src": "2560:33:54" + } + ] + } + ] + }, + "documentation": { + "id": 11821, + "nodeType": "StructuredDocumentation", + "src": "1705:78:54", + "text": " @dev Returns the absolute unsigned value of a signed value." + }, + "id": 11846, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "abs", + "nameLocation": "1797:3:54", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 11824, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 11823, + "mutability": "mutable", + "name": "n", + "nameLocation": "1808:1:54", + "nodeType": "VariableDeclaration", + "scope": 11846, + "src": "1801:8:54", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "typeName": { + "id": 11822, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "1801:6:54", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "visibility": "internal" + } + ], + "src": "1800:10:54" + }, + "returnParameters": { + "id": 11827, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 11826, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 11846, + "src": "1834:7:54", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 11825, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1834:7:54", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "1833:9:54" + }, + "scope": 11847, + "src": "1788:822:54", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + } + ], + "scope": 11848, + "src": "258:2354:54", + "usedErrors": [], + "usedEvents": [] + } + ], + "src": "109:2504:54" + }, + "id": 54 + }, + "contracts/DisputeManager.sol": { + "ast": { + "absolutePath": "contracts/DisputeManager.sol", + "exportedSymbols": { + "Allocation": [ + 16033 + ], + "Attestation": [ + 16290 + ], + "AttestationManager": [ + 17555 + ], + "DisputeManager": [ + 13542 + ], + "DisputeManagerV1Storage": [ + 13575 + ], + "GraphDirectory": [ + 4928 + ], + "IDisputeManager": [ + 15373 + ], + "IGraphToken": [ + 758 + ], + "IHorizonStaking": [ + 2625 + ], + "ISubgraphService": [ + 15634 + ], + "Initializable": [ + 5391 + ], + "MathUtils": [ + 4445 + ], + "OwnableUpgradeable": [ + 5123 + ], + "PPMMath": [ + 4539 + ], + "TokenUtils": [ + 840 + ] + }, + "id": 13543, + "license": "GPL-2.0-or-later", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 11849, + "literals": [ + "solidity", + "0.8", + ".27" + ], + "nodeType": "PragmaDirective", + "src": "45:23:55" + }, + { + "absolutePath": "@graphprotocol/contracts/contracts/token/IGraphToken.sol", + "file": "@graphprotocol/contracts/contracts/token/IGraphToken.sol", + "id": 11851, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 13543, + "sourceUnit": 759, + "src": "70:87:55", + "symbolAliases": [ + { + "foreign": { + "id": 11850, + "name": "IGraphToken", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 758, + "src": "79:11:55", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "@graphprotocol/horizon/contracts/interfaces/IHorizonStaking.sol", + "file": "@graphprotocol/horizon/contracts/interfaces/IHorizonStaking.sol", + "id": 11853, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 13543, + "sourceUnit": 2626, + "src": "158:98:55", + "symbolAliases": [ + { + "foreign": { + "id": 11852, + "name": "IHorizonStaking", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2625, + "src": "167:15:55", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "contracts/interfaces/IDisputeManager.sol", + "file": "./interfaces/IDisputeManager.sol", + "id": 11855, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 13543, + "sourceUnit": 15374, + "src": "257:67:55", + "symbolAliases": [ + { + "foreign": { + "id": 11854, + "name": "IDisputeManager", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15373, + "src": "266:15:55", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "contracts/interfaces/ISubgraphService.sol", + "file": "./interfaces/ISubgraphService.sol", + "id": 11857, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 13543, + "sourceUnit": 15635, + "src": "325:69:55", + "symbolAliases": [ + { + "foreign": { + "id": 11856, + "name": "ISubgraphService", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15634, + "src": "334:16:55", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "@graphprotocol/contracts/contracts/utils/TokenUtils.sol", + "file": "@graphprotocol/contracts/contracts/utils/TokenUtils.sol", + "id": 11859, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 13543, + "sourceUnit": 841, + "src": "396:85:55", + "symbolAliases": [ + { + "foreign": { + "id": 11858, + "name": "TokenUtils", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 840, + "src": "405:10:55", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "@graphprotocol/horizon/contracts/libraries/PPMMath.sol", + "file": "@graphprotocol/horizon/contracts/libraries/PPMMath.sol", + "id": 11861, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 13543, + "sourceUnit": 4540, + "src": "482:81:55", + "symbolAliases": [ + { + "foreign": { + "id": 11860, + "name": "PPMMath", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4539, + "src": "491:7:55", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "@graphprotocol/horizon/contracts/libraries/MathUtils.sol", + "file": "@graphprotocol/horizon/contracts/libraries/MathUtils.sol", + "id": 11863, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 13543, + "sourceUnit": 4446, + "src": "564:85:55", + "symbolAliases": [ + { + "foreign": { + "id": 11862, + "name": "MathUtils", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4445, + "src": "573:9:55", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "contracts/libraries/Allocation.sol", + "file": "./libraries/Allocation.sol", + "id": 11865, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 13543, + "sourceUnit": 16034, + "src": "650:56:55", + "symbolAliases": [ + { + "foreign": { + "id": 11864, + "name": "Allocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16033, + "src": "659:10:55", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "contracts/libraries/Attestation.sol", + "file": "./libraries/Attestation.sol", + "id": 11867, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 13543, + "sourceUnit": 16291, + "src": "707:58:55", + "symbolAliases": [ + { + "foreign": { + "id": 11866, + "name": "Attestation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16290, + "src": "716:11:55", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol", + "file": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol", + "id": 11869, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 13543, + "sourceUnit": 5124, + "src": "767:103:55", + "symbolAliases": [ + { + "foreign": { + "id": 11868, + "name": "OwnableUpgradeable", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5123, + "src": "776:18:55", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol", + "file": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol", + "id": 11871, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 13543, + "sourceUnit": 5392, + "src": "871:98:55", + "symbolAliases": [ + { + "foreign": { + "id": 11870, + "name": "Initializable", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5391, + "src": "880:13:55", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "@graphprotocol/horizon/contracts/utilities/GraphDirectory.sol", + "file": "@graphprotocol/horizon/contracts/utilities/GraphDirectory.sol", + "id": 11873, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 13543, + "sourceUnit": 4929, + "src": "970:95:55", + "symbolAliases": [ + { + "foreign": { + "id": 11872, + "name": "GraphDirectory", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4928, + "src": "979:14:55", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "contracts/DisputeManagerStorage.sol", + "file": "./DisputeManagerStorage.sol", + "id": 11875, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 13543, + "sourceUnit": 13576, + "src": "1066:70:55", + "symbolAliases": [ + { + "foreign": { + "id": 11874, + "name": "DisputeManagerV1Storage", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13575, + "src": "1075:23:55", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "contracts/utilities/AttestationManager.sol", + "file": "./utilities/AttestationManager.sol", + "id": 11877, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 13543, + "sourceUnit": 17556, + "src": "1137:72:55", + "symbolAliases": [ + { + "foreign": { + "id": 11876, + "name": "AttestationManager", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17555, + "src": "1146:18:55", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "abstract": false, + "baseContracts": [ + { + "baseName": { + "id": 11879, + "name": "Initializable", + "nameLocations": [ + "2354:13:55" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5391, + "src": "2354:13:55" + }, + "id": 11880, + "nodeType": "InheritanceSpecifier", + "src": "2354:13:55" + }, + { + "baseName": { + "id": 11881, + "name": "OwnableUpgradeable", + "nameLocations": [ + "2373:18:55" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5123, + "src": "2373:18:55" + }, + "id": 11882, + "nodeType": "InheritanceSpecifier", + "src": "2373:18:55" + }, + { + "baseName": { + "id": 11883, + "name": "GraphDirectory", + "nameLocations": [ + "2397:14:55" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 4928, + "src": "2397:14:55" + }, + "id": 11884, + "nodeType": "InheritanceSpecifier", + "src": "2397:14:55" + }, + { + "baseName": { + "id": 11885, + "name": "AttestationManager", + "nameLocations": [ + "2417:18:55" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 17555, + "src": "2417:18:55" + }, + "id": 11886, + "nodeType": "InheritanceSpecifier", + "src": "2417:18:55" + }, + { + "baseName": { + "id": 11887, + "name": "DisputeManagerV1Storage", + "nameLocations": [ + "2441:23:55" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 13575, + "src": "2441:23:55" + }, + "id": 11888, + "nodeType": "InheritanceSpecifier", + "src": "2441:23:55" + }, + { + "baseName": { + "id": 11889, + "name": "IDisputeManager", + "nameLocations": [ + "2470:15:55" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 15373, + "src": "2470:15:55" + }, + "id": 11890, + "nodeType": "InheritanceSpecifier", + "src": "2470:15:55" + } + ], + "canonicalName": "DisputeManager", + "contractDependencies": [], + "contractKind": "contract", + "documentation": { + "id": 11878, + "nodeType": "StructuredDocumentation", + "src": "1211:1111:55", + "text": " @title DisputeManager\n @notice Provides a way to permissionlessly create disputes for incorrect behavior in the Subgraph Service.\n There are two types of disputes that can be created: Query disputes and Indexing disputes.\n Query Disputes:\n Graph nodes receive queries and return responses with signed receipts called attestations.\n An attestation can be disputed if the consumer thinks the query response was invalid.\n Indexers use the derived private key for an allocation to sign attestations.\n Indexing Disputes:\n Indexers periodically present a Proof of Indexing (POI) to prove they are indexing a subgraph.\n The Subgraph Service contract emits that proof which includes the POI. Any fisherman can dispute the\n validity of a POI by submitting a dispute to this contract along with a deposit.\n Arbitration:\n Disputes can only be accepted, rejected or drawn by the arbitrator role that can be delegated\n to a EOA or DAO.\n @custom:security-contact Please email security+contracts@thegraph.com if you find any\n bugs. We may have an active bug bounty program." + }, + "fullyImplemented": true, + "id": 13542, + "linearizedBaseContracts": [ + 13542, + 15373, + 13575, + 17555, + 17567, + 4928, + 5123, + 5437, + 5391 + ], + "name": "DisputeManager", + "nameLocation": "2332:14:55", + "nodeType": "ContractDefinition", + "nodes": [ + { + "global": false, + "id": 11894, + "libraryName": { + "id": 11891, + "name": "TokenUtils", + "nameLocations": [ + "2498:10:55" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 840, + "src": "2498:10:55" + }, + "nodeType": "UsingForDirective", + "src": "2492:33:55", + "typeName": { + "id": 11893, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 11892, + "name": "IGraphToken", + "nameLocations": [ + "2513:11:55" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 758, + "src": "2513:11:55" + }, + "referencedDeclaration": 758, + "src": "2513:11:55", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IGraphToken_$758", + "typeString": "contract IGraphToken" + } + } + }, + { + "global": false, + "id": 11897, + "libraryName": { + "id": 11895, + "name": "PPMMath", + "nameLocations": [ + "2536:7:55" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 4539, + "src": "2536:7:55" + }, + "nodeType": "UsingForDirective", + "src": "2530:26:55", + "typeName": { + "id": 11896, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2548:7:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + }, + { + "constant": true, + "documentation": { + "id": 11898, + "nodeType": "StructuredDocumentation", + "src": "2586:57:55", + "text": "@notice Maximum value for fisherman reward cut in PPM" + }, + "functionSelector": "17337b46", + "id": 11901, + "mutability": "constant", + "name": "MAX_FISHERMAN_REWARD_CUT", + "nameLocation": "2671:24:55", + "nodeType": "VariableDeclaration", + "scope": 13542, + "src": "2648:56:55", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 11899, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "2648:6:55", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "value": { + "hexValue": "353030303030", + "id": 11900, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2698:6:55", + "typeDescriptions": { + "typeIdentifier": "t_rational_500000_by_1", + "typeString": "int_const 500000" + }, + "value": "500000" + }, + "visibility": "public" + }, + { + "constant": true, + "documentation": { + "id": 11902, + "nodeType": "StructuredDocumentation", + "src": "2718:45:55", + "text": "@notice Minimum value for dispute deposit" + }, + "functionSelector": "cc2d55cd", + "id": 11905, + "mutability": "constant", + "name": "MIN_DISPUTE_DEPOSIT", + "nameLocation": "2792:19:55", + "nodeType": "VariableDeclaration", + "scope": 13542, + "src": "2768:50:55", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 11903, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2768:7:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": { + "hexValue": "31653138", + "id": 11904, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2814:4:55", + "typeDescriptions": { + "typeIdentifier": "t_rational_1000000000000000000_by_1", + "typeString": "int_const 1000000000000000000" + }, + "value": "1e18" + }, + "visibility": "public" + }, + { + "body": { + "id": 11918, + "nodeType": "Block", + "src": "2954:92:55", + "statements": [ + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 11912, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 11909, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "2972:3:55", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 11910, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "2976:6:55", + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "2972:10:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "id": 11911, + "name": "arbitrator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13556, + "src": "2986:10:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "2972:24:55", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 11913, + "name": "DisputeManagerNotArbitrator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15080, + "src": "2998:27:55", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$__$returns$_t_error_$", + "typeString": "function () pure returns (error)" + } + }, + "id": 11914, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2998:29:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 11908, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "2964:7:55", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 11915, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2964:64:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 11916, + "nodeType": "ExpressionStatement", + "src": "2964:64:55" + }, + { + "id": 11917, + "nodeType": "PlaceholderStatement", + "src": "3038:1:55" + } + ] + }, + "documentation": { + "id": 11906, + "nodeType": "StructuredDocumentation", + "src": "2858:65:55", + "text": " @notice Check if the caller is the arbitrator." + }, + "id": 11919, + "name": "onlyArbitrator", + "nameLocation": "2937:14:55", + "nodeType": "ModifierDefinition", + "parameters": { + "id": 11907, + "nodeType": "ParameterList", + "parameters": [], + "src": "2951:2:55" + }, + "src": "2928:118:55", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 11951, + "nodeType": "Block", + "src": "3213:286:55", + "statements": [ + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "id": 11926, + "name": "disputeId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11922, + "src": "3248:9:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 11925, + "name": "isDisputeCreated", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12801, + "src": "3231:16:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_bool_$", + "typeString": "function (bytes32) view returns (bool)" + } + }, + "id": 11927, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3231:27:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [ + { + "id": 11929, + "name": "disputeId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11922, + "src": "3289:9:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 11928, + "name": "DisputeManagerInvalidDispute", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15097, + "src": "3260:28:55", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_bytes32_$returns$_t_error_$", + "typeString": "function (bytes32) pure returns (error)" + } + }, + "id": 11930, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3260:39:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 11924, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "3223:7:55", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 11931, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3223:77:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 11932, + "nodeType": "ExpressionStatement", + "src": "3223:77:55" + }, + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_enum$_DisputeStatus_$14921", + "typeString": "enum IDisputeManager.DisputeStatus" + }, + "id": 11941, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "baseExpression": { + "id": 11934, + "name": "disputes", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13574, + "src": "3331:8:55", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Dispute_$14943_storage_$", + "typeString": "mapping(bytes32 => struct IDisputeManager.Dispute storage ref)" + } + }, + "id": 11936, + "indexExpression": { + "id": 11935, + "name": "disputeId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11922, + "src": "3340:9:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3331:19:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage", + "typeString": "struct IDisputeManager.Dispute storage ref" + } + }, + "id": 11937, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "3351:6:55", + "memberName": "status", + "nodeType": "MemberAccess", + "referencedDeclaration": 14936, + "src": "3331:26:55", + "typeDescriptions": { + "typeIdentifier": "t_enum$_DisputeStatus_$14921", + "typeString": "enum IDisputeManager.DisputeStatus" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "expression": { + "expression": { + "id": 11938, + "name": "IDisputeManager", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15373, + "src": "3361:15:55", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_IDisputeManager_$15373_$", + "typeString": "type(contract IDisputeManager)" + } + }, + "id": 11939, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "3377:13:55", + "memberName": "DisputeStatus", + "nodeType": "MemberAccess", + "referencedDeclaration": 14921, + "src": "3361:29:55", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_DisputeStatus_$14921_$", + "typeString": "type(enum IDisputeManager.DisputeStatus)" + } + }, + "id": 11940, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "3391:7:55", + "memberName": "Pending", + "nodeType": "MemberAccess", + "referencedDeclaration": 14919, + "src": "3361:37:55", + "typeDescriptions": { + "typeIdentifier": "t_enum$_DisputeStatus_$14921", + "typeString": "enum IDisputeManager.DisputeStatus" + } + }, + "src": "3331:67:55", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [ + { + "expression": { + "baseExpression": { + "id": 11943, + "name": "disputes", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13574, + "src": "3444:8:55", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Dispute_$14943_storage_$", + "typeString": "mapping(bytes32 => struct IDisputeManager.Dispute storage ref)" + } + }, + "id": 11945, + "indexExpression": { + "id": 11944, + "name": "disputeId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11922, + "src": "3453:9:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3444:19:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage", + "typeString": "struct IDisputeManager.Dispute storage ref" + } + }, + "id": 11946, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "3464:6:55", + "memberName": "status", + "nodeType": "MemberAccess", + "referencedDeclaration": 14936, + "src": "3444:26:55", + "typeDescriptions": { + "typeIdentifier": "t_enum$_DisputeStatus_$14921", + "typeString": "enum IDisputeManager.DisputeStatus" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_DisputeStatus_$14921", + "typeString": "enum IDisputeManager.DisputeStatus" + } + ], + "id": 11942, + "name": "DisputeManagerDisputeNotPending", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15125, + "src": "3412:31:55", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_enum$_DisputeStatus_$14921_$returns$_t_error_$", + "typeString": "function (enum IDisputeManager.DisputeStatus) pure returns (error)" + } + }, + "id": 11947, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3412:59:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 11933, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "3310:7:55", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 11948, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3310:171:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 11949, + "nodeType": "ExpressionStatement", + "src": "3310:171:55" + }, + { + "id": 11950, + "nodeType": "PlaceholderStatement", + "src": "3491:1:55" + } + ] + }, + "documentation": { + "id": 11920, + "nodeType": "StructuredDocumentation", + "src": "3052:109:55", + "text": " @notice Check if the dispute exists and is pending.\n @param disputeId The dispute Id" + }, + "id": 11952, + "name": "onlyPendingDispute", + "nameLocation": "3175:18:55", + "nodeType": "ModifierDefinition", + "parameters": { + "id": 11923, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 11922, + "mutability": "mutable", + "name": "disputeId", + "nameLocation": "3202:9:55", + "nodeType": "VariableDeclaration", + "scope": 11952, + "src": "3194:17:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 11921, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "3194:7:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "3193:19:55" + }, + "src": "3166:333:55", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 11979, + "nodeType": "Block", + "src": "3670:197:55", + "statements": [ + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "id": 11959, + "name": "disputeId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11955, + "src": "3705:9:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 11958, + "name": "isDisputeCreated", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12801, + "src": "3688:16:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_bool_$", + "typeString": "function (bytes32) view returns (bool)" + } + }, + "id": 11960, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3688:27:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [ + { + "id": 11962, + "name": "disputeId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11955, + "src": "3746:9:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 11961, + "name": "DisputeManagerInvalidDispute", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15097, + "src": "3717:28:55", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_bytes32_$returns$_t_error_$", + "typeString": "function (bytes32) pure returns (error)" + } + }, + "id": 11963, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3717:39:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 11957, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "3680:7:55", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 11964, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3680:77:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 11965, + "nodeType": "ExpressionStatement", + "src": "3680:77:55" + }, + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 11973, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 11967, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "3775:3:55", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 11968, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "3779:6:55", + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "3775:10:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "expression": { + "baseExpression": { + "id": 11969, + "name": "disputes", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13574, + "src": "3789:8:55", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Dispute_$14943_storage_$", + "typeString": "mapping(bytes32 => struct IDisputeManager.Dispute storage ref)" + } + }, + "id": 11971, + "indexExpression": { + "id": 11970, + "name": "disputeId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11955, + "src": "3798:9:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3789:19:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage", + "typeString": "struct IDisputeManager.Dispute storage ref" + } + }, + "id": 11972, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "3809:9:55", + "memberName": "fisherman", + "nodeType": "MemberAccess", + "referencedDeclaration": 14926, + "src": "3789:29:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "3775:43:55", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 11974, + "name": "DisputeManagerNotFisherman", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15083, + "src": "3820:26:55", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$__$returns$_t_error_$", + "typeString": "function () pure returns (error)" + } + }, + "id": 11975, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3820:28:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 11966, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "3767:7:55", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 11976, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3767:82:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 11977, + "nodeType": "ExpressionStatement", + "src": "3767:82:55" + }, + { + "id": 11978, + "nodeType": "PlaceholderStatement", + "src": "3859:1:55" + } + ] + }, + "documentation": { + "id": 11953, + "nodeType": "StructuredDocumentation", + "src": "3505:118:55", + "text": " @notice Check if the caller is the fisherman of the dispute.\n @param disputeId The dispute Id" + }, + "id": 11980, + "name": "onlyFisherman", + "nameLocation": "3637:13:55", + "nodeType": "ModifierDefinition", + "parameters": { + "id": 11956, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 11955, + "mutability": "mutable", + "name": "disputeId", + "nameLocation": "3659:9:55", + "nodeType": "VariableDeclaration", + "scope": 11980, + "src": "3651:17:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 11954, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "3651:7:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "3650:19:55" + }, + "src": "3628:239:55", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 11992, + "nodeType": "Block", + "src": "4035:39:55", + "statements": [ + { + "expression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 11989, + "name": "_disableInitializers", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5345, + "src": "4045:20:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$__$returns$__$", + "typeString": "function ()" + } + }, + "id": 11990, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4045:22:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 11991, + "nodeType": "ExpressionStatement", + "src": "4045:22:55" + } + ] + }, + "documentation": { + "id": 11981, + "nodeType": "StructuredDocumentation", + "src": "3873:98:55", + "text": " @notice Contract constructor\n @param controller Address of the controller" + }, + "id": 11993, + "implemented": true, + "kind": "constructor", + "modifiers": [ + { + "arguments": [ + { + "id": 11986, + "name": "controller", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11983, + "src": "4023:10:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "id": 11987, + "kind": "baseConstructorSpecifier", + "modifierName": { + "id": 11985, + "name": "GraphDirectory", + "nameLocations": [ + "4008:14:55" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 4928, + "src": "4008:14:55" + }, + "nodeType": "ModifierInvocation", + "src": "4008:26:55" + } + ], + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 11984, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 11983, + "mutability": "mutable", + "name": "controller", + "nameLocation": "3996:10:55", + "nodeType": "VariableDeclaration", + "scope": 11993, + "src": "3988:18:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 11982, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3988:7:55", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "3987:20:55" + }, + "returnParameters": { + "id": 11988, + "nodeType": "ParameterList", + "parameters": [], + "src": "4035:0:55" + }, + "scope": 13542, + "src": "3976:98:55", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "public" + }, + { + "baseFunctions": [ + 15196 + ], + "body": { + "id": 12039, + "nodeType": "Block", + "src": "4356:299:55", + "statements": [ + { + "expression": { + "arguments": [ + { + "id": 12013, + "name": "owner", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11996, + "src": "4381:5:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 12012, + "name": "__Ownable_init", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4983, + "src": "4366:14:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$__$", + "typeString": "function (address)" + } + }, + "id": 12014, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4366:21:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 12015, + "nodeType": "ExpressionStatement", + "src": "4366:21:55" + }, + { + "expression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 12016, + "name": "__AttestationManager_init", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17454, + "src": "4397:25:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$__$returns$__$", + "typeString": "function ()" + } + }, + "id": 12017, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4397:27:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 12018, + "nodeType": "ExpressionStatement", + "src": "4397:27:55" + }, + { + "expression": { + "arguments": [ + { + "id": 12020, + "name": "arbitrator_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11998, + "src": "4450:11:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 12019, + "name": "_setArbitrator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13346, + "src": "4435:14:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$__$", + "typeString": "function (address)" + } + }, + "id": 12021, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4435:27:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 12022, + "nodeType": "ExpressionStatement", + "src": "4435:27:55" + }, + { + "expression": { + "arguments": [ + { + "id": 12024, + "name": "disputePeriod_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12000, + "src": "4490:14:55", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + ], + "id": 12023, + "name": "_setDisputePeriod", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13369, + "src": "4472:17:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_uint64_$returns$__$", + "typeString": "function (uint64)" + } + }, + "id": 12025, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4472:33:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 12026, + "nodeType": "ExpressionStatement", + "src": "4472:33:55" + }, + { + "expression": { + "arguments": [ + { + "id": 12028, + "name": "disputeDeposit_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12002, + "src": "4534:15:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 12027, + "name": "_setDisputeDeposit", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13393, + "src": "4515:18:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256)" + } + }, + "id": 12029, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4515:35:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 12030, + "nodeType": "ExpressionStatement", + "src": "4515:35:55" + }, + { + "expression": { + "arguments": [ + { + "id": 12032, + "name": "fishermanRewardCut_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12004, + "src": "4583:19:55", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + ], + "id": 12031, + "name": "_setFishermanRewardCut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13417, + "src": "4560:22:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_uint32_$returns$__$", + "typeString": "function (uint32)" + } + }, + "id": 12033, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4560:43:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 12034, + "nodeType": "ExpressionStatement", + "src": "4560:43:55" + }, + { + "expression": { + "arguments": [ + { + "id": 12036, + "name": "maxSlashingCut_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12006, + "src": "4632:15:55", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + ], + "id": 12035, + "name": "_setMaxSlashingCut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13442, + "src": "4613:18:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_uint32_$returns$__$", + "typeString": "function (uint32)" + } + }, + "id": 12037, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4613:35:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 12038, + "nodeType": "ExpressionStatement", + "src": "4613:35:55" + } + ] + }, + "documentation": { + "id": 11994, + "nodeType": "StructuredDocumentation", + "src": "4080:31:55", + "text": "@inheritdoc IDisputeManager" + }, + "functionSelector": "0bc7344b", + "id": 12040, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "id": 12010, + "kind": "modifierInvocation", + "modifierName": { + "id": 12009, + "name": "initializer", + "nameLocations": [ + "4344:11:55" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5231, + "src": "4344:11:55" + }, + "nodeType": "ModifierInvocation", + "src": "4344:11:55" + } + ], + "name": "initialize", + "nameLocation": "4125:10:55", + "nodeType": "FunctionDefinition", + "overrides": { + "id": 12008, + "nodeType": "OverrideSpecifier", + "overrides": [], + "src": "4335:8:55" + }, + "parameters": { + "id": 12007, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 11996, + "mutability": "mutable", + "name": "owner", + "nameLocation": "4153:5:55", + "nodeType": "VariableDeclaration", + "scope": 12040, + "src": "4145:13:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 11995, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4145:7:55", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 11998, + "mutability": "mutable", + "name": "arbitrator_", + "nameLocation": "4176:11:55", + "nodeType": "VariableDeclaration", + "scope": 12040, + "src": "4168:19:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 11997, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4168:7:55", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 12000, + "mutability": "mutable", + "name": "disputePeriod_", + "nameLocation": "4204:14:55", + "nodeType": "VariableDeclaration", + "scope": 12040, + "src": "4197:21:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + }, + "typeName": { + "id": 11999, + "name": "uint64", + "nodeType": "ElementaryTypeName", + "src": "4197:6:55", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 12002, + "mutability": "mutable", + "name": "disputeDeposit_", + "nameLocation": "4236:15:55", + "nodeType": "VariableDeclaration", + "scope": 12040, + "src": "4228:23:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 12001, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "4228:7:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 12004, + "mutability": "mutable", + "name": "fishermanRewardCut_", + "nameLocation": "4268:19:55", + "nodeType": "VariableDeclaration", + "scope": 12040, + "src": "4261:26:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 12003, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "4261:6:55", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 12006, + "mutability": "mutable", + "name": "maxSlashingCut_", + "nameLocation": "4304:15:55", + "nodeType": "VariableDeclaration", + "scope": 12040, + "src": "4297:22:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 12005, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "4297:6:55", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + } + ], + "src": "4135:190:55" + }, + "returnParameters": { + "id": 12011, + "nodeType": "ParameterList", + "parameters": [], + "src": "4356:0:55" + }, + "scope": 13542, + "src": "4116:539:55", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "baseFunctions": [ + 15262 + ], + "body": { + "id": 12067, + "nodeType": "Block", + "src": "4799:234:55", + "statements": [ + { + "expression": { + "arguments": [ + { + "expression": { + "id": 12054, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "4870:3:55", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 12055, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "4874:6:55", + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "4870:10:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 12056, + "name": "disputeDeposit", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13562, + "src": "4882:14:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 12051, + "name": "_graphToken", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4805, + "src": "4845:11:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_contract$_IGraphToken_$758_$", + "typeString": "function () view returns (contract IGraphToken)" + } + }, + "id": 12052, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4845:13:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_IGraphToken_$758", + "typeString": "contract IGraphToken" + } + }, + "id": 12053, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "4859:10:55", + "memberName": "pullTokens", + "nodeType": "MemberAccess", + "referencedDeclaration": 792, + "src": "4845:24:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IGraphToken_$758_$_t_address_$_t_uint256_$returns$__$attached_to$_t_contract$_IGraphToken_$758_$", + "typeString": "function (contract IGraphToken,address,uint256)" + } + }, + "id": 12057, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4845:52:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 12058, + "nodeType": "ExpressionStatement", + "src": "4845:52:55" + }, + { + "expression": { + "arguments": [ + { + "expression": { + "id": 12060, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "4980:3:55", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 12061, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "4984:6:55", + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "4980:10:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 12062, + "name": "disputeDeposit", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13562, + "src": "4992:14:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 12063, + "name": "allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12043, + "src": "5008:12:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 12064, + "name": "poi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12045, + "src": "5022:3:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 12059, + "name": "_createIndexingDisputeWithAllocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13065, + "src": "4943:36:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_uint256_$_t_address_$_t_bytes32_$returns$_t_bytes32_$", + "typeString": "function (address,uint256,address,bytes32) returns (bytes32)" + } + }, + "id": 12065, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4943:83:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "functionReturnParameters": 12050, + "id": 12066, + "nodeType": "Return", + "src": "4936:90:55" + } + ] + }, + "documentation": { + "id": 12041, + "nodeType": "StructuredDocumentation", + "src": "4661:31:55", + "text": "@inheritdoc IDisputeManager" + }, + "functionSelector": "4bc5839a", + "id": 12068, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "createIndexingDispute", + "nameLocation": "4706:21:55", + "nodeType": "FunctionDefinition", + "overrides": { + "id": 12047, + "nodeType": "OverrideSpecifier", + "overrides": [], + "src": "4772:8:55" + }, + "parameters": { + "id": 12046, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 12043, + "mutability": "mutable", + "name": "allocationId", + "nameLocation": "4736:12:55", + "nodeType": "VariableDeclaration", + "scope": 12068, + "src": "4728:20:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 12042, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4728:7:55", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 12045, + "mutability": "mutable", + "name": "poi", + "nameLocation": "4758:3:55", + "nodeType": "VariableDeclaration", + "scope": 12068, + "src": "4750:11:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 12044, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "4750:7:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "4727:35:55" + }, + "returnParameters": { + "id": 12050, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 12049, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 12068, + "src": "4790:7:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 12048, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "4790:7:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "4789:9:55" + }, + "scope": 13542, + "src": "4697:336:55", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "baseFunctions": [ + 15240 + ], + "body": { + "id": 12096, + "nodeType": "Block", + "src": "5171:356:55", + "statements": [ + { + "expression": { + "arguments": [ + { + "expression": { + "id": 12080, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "5242:3:55", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 12081, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "5246:6:55", + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "5242:10:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 12082, + "name": "disputeDeposit", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13562, + "src": "5254:14:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 12077, + "name": "_graphToken", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4805, + "src": "5217:11:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_contract$_IGraphToken_$758_$", + "typeString": "function () view returns (contract IGraphToken)" + } + }, + "id": 12078, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5217:13:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_IGraphToken_$758", + "typeString": "contract IGraphToken" + } + }, + "id": 12079, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "5231:10:55", + "memberName": "pullTokens", + "nodeType": "MemberAccess", + "referencedDeclaration": 792, + "src": "5217:24:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IGraphToken_$758_$_t_address_$_t_uint256_$returns$__$attached_to$_t_contract$_IGraphToken_$758_$", + "typeString": "function (contract IGraphToken,address,uint256)" + } + }, + "id": 12083, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5217:52:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 12084, + "nodeType": "ExpressionStatement", + "src": "5217:52:55" + }, + { + "expression": { + "arguments": [ + { + "expression": { + "id": 12086, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "5379:3:55", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 12087, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "5383:6:55", + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "5379:10:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 12088, + "name": "disputeDeposit", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13562, + "src": "5407:14:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "arguments": [ + { + "id": 12091, + "name": "attestationData", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12071, + "src": "5457:15:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes calldata" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes calldata" + } + ], + "expression": { + "id": 12089, + "name": "Attestation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16290, + "src": "5439:11:55", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_Attestation_$16290_$", + "typeString": "type(library Attestation)" + } + }, + "id": 12090, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "5451:5:55", + "memberName": "parse", + "nodeType": "MemberAccess", + "referencedDeclaration": 16223, + "src": "5439:17:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$returns$_t_struct$_State_$16058_memory_ptr_$", + "typeString": "function (bytes memory) pure returns (struct Attestation.State memory)" + } + }, + "id": 12092, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5439:34:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16058_memory_ptr", + "typeString": "struct Attestation.State memory" + } + }, + { + "id": 12093, + "name": "attestationData", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12071, + "src": "5491:15:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes calldata" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_struct$_State_$16058_memory_ptr", + "typeString": "struct Attestation.State memory" + }, + { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes calldata" + } + ], + "id": 12085, + "name": "_createQueryDisputeWithAttestation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12923, + "src": "5327:34:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_uint256_$_t_struct$_State_$16058_memory_ptr_$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (address,uint256,struct Attestation.State memory,bytes memory) returns (bytes32)" + } + }, + "id": 12094, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5327:193:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "functionReturnParameters": 12076, + "id": 12095, + "nodeType": "Return", + "src": "5308:212:55" + } + ] + }, + "documentation": { + "id": 12069, + "nodeType": "StructuredDocumentation", + "src": "5039:31:55", + "text": "@inheritdoc IDisputeManager" + }, + "functionSelector": "c50a77b1", + "id": 12097, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "createQueryDispute", + "nameLocation": "5084:18:55", + "nodeType": "FunctionDefinition", + "overrides": { + "id": 12073, + "nodeType": "OverrideSpecifier", + "overrides": [], + "src": "5144:8:55" + }, + "parameters": { + "id": 12072, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 12071, + "mutability": "mutable", + "name": "attestationData", + "nameLocation": "5118:15:55", + "nodeType": "VariableDeclaration", + "scope": 12097, + "src": "5103:30:55", + "stateVariable": false, + "storageLocation": "calldata", + "typeDescriptions": { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 12070, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "5103:5:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "src": "5102:32:55" + }, + "returnParameters": { + "id": 12076, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 12075, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 12097, + "src": "5162:7:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 12074, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "5162:7:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "5161:9:55" + }, + "scope": 13542, + "src": "5075:452:55", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "baseFunctions": [ + 15252 + ], + "body": { + "id": 12210, + "nodeType": "Block", + "src": "5738:1563:55", + "statements": [ + { + "assignments": [ + 12111 + ], + "declarations": [ + { + "constant": false, + "id": 12111, + "mutability": "mutable", + "name": "fisherman", + "nameLocation": "5756:9:55", + "nodeType": "VariableDeclaration", + "scope": 12210, + "src": "5748:17:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 12110, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5748:7:55", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "id": 12114, + "initialValue": { + "expression": { + "id": 12112, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "5768:3:55", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 12113, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "5772:6:55", + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "5768:10:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "5748:30:55" + }, + { + "assignments": [ + 12119 + ], + "declarations": [ + { + "constant": false, + "id": 12119, + "mutability": "mutable", + "name": "attestation1", + "nameLocation": "5848:12:55", + "nodeType": "VariableDeclaration", + "scope": 12210, + "src": "5823:37:55", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16058_memory_ptr", + "typeString": "struct Attestation.State" + }, + "typeName": { + "id": 12118, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 12117, + "name": "Attestation.State", + "nameLocations": [ + "5823:11:55", + "5835:5:55" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 16058, + "src": "5823:17:55" + }, + "referencedDeclaration": 16058, + "src": "5823:17:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16058_storage_ptr", + "typeString": "struct Attestation.State" + } + }, + "visibility": "internal" + } + ], + "id": 12124, + "initialValue": { + "arguments": [ + { + "id": 12122, + "name": "attestationData1", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12100, + "src": "5881:16:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes calldata" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes calldata" + } + ], + "expression": { + "id": 12120, + "name": "Attestation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16290, + "src": "5863:11:55", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_Attestation_$16290_$", + "typeString": "type(library Attestation)" + } + }, + "id": 12121, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "5875:5:55", + "memberName": "parse", + "nodeType": "MemberAccess", + "referencedDeclaration": 16223, + "src": "5863:17:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$returns$_t_struct$_State_$16058_memory_ptr_$", + "typeString": "function (bytes memory) pure returns (struct Attestation.State memory)" + } + }, + "id": 12123, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5863:35:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16058_memory_ptr", + "typeString": "struct Attestation.State memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "5823:75:55" + }, + { + "assignments": [ + 12129 + ], + "declarations": [ + { + "constant": false, + "id": 12129, + "mutability": "mutable", + "name": "attestation2", + "nameLocation": "5933:12:55", + "nodeType": "VariableDeclaration", + "scope": 12210, + "src": "5908:37:55", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16058_memory_ptr", + "typeString": "struct Attestation.State" + }, + "typeName": { + "id": 12128, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 12127, + "name": "Attestation.State", + "nameLocations": [ + "5908:11:55", + "5920:5:55" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 16058, + "src": "5908:17:55" + }, + "referencedDeclaration": 16058, + "src": "5908:17:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16058_storage_ptr", + "typeString": "struct Attestation.State" + } + }, + "visibility": "internal" + } + ], + "id": 12134, + "initialValue": { + "arguments": [ + { + "id": 12132, + "name": "attestationData2", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12102, + "src": "5966:16:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes calldata" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes calldata" + } + ], + "expression": { + "id": 12130, + "name": "Attestation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16290, + "src": "5948:11:55", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_Attestation_$16290_$", + "typeString": "type(library Attestation)" + } + }, + "id": 12131, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "5960:5:55", + "memberName": "parse", + "nodeType": "MemberAccess", + "referencedDeclaration": 16223, + "src": "5948:17:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$returns$_t_struct$_State_$16058_memory_ptr_$", + "typeString": "function (bytes memory) pure returns (struct Attestation.State memory)" + } + }, + "id": 12133, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5948:35:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16058_memory_ptr", + "typeString": "struct Attestation.State memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "5908:75:55" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "id": 12138, + "name": "attestation1", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12119, + "src": "6092:12:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16058_memory_ptr", + "typeString": "struct Attestation.State memory" + } + }, + { + "id": 12139, + "name": "attestation2", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12129, + "src": "6106:12:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16058_memory_ptr", + "typeString": "struct Attestation.State memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_struct$_State_$16058_memory_ptr", + "typeString": "struct Attestation.State memory" + }, + { + "typeIdentifier": "t_struct$_State_$16058_memory_ptr", + "typeString": "struct Attestation.State memory" + } + ], + "expression": { + "id": 12136, + "name": "Attestation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16290, + "src": "6065:11:55", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_Attestation_$16290_$", + "typeString": "type(library Attestation)" + } + }, + "id": 12137, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "6077:14:55", + "memberName": "areConflicting", + "nodeType": "MemberAccess", + "referencedDeclaration": 16153, + "src": "6065:26:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_struct$_State_$16058_memory_ptr_$_t_struct$_State_$16058_memory_ptr_$returns$_t_bool_$", + "typeString": "function (struct Attestation.State memory,struct Attestation.State memory) pure returns (bool)" + } + }, + "id": 12140, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "6065:54:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [ + { + "expression": { + "id": 12142, + "name": "attestation1", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12119, + "src": "6191:12:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16058_memory_ptr", + "typeString": "struct Attestation.State memory" + } + }, + "id": 12143, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "6204:10:55", + "memberName": "requestCID", + "nodeType": "MemberAccess", + "referencedDeclaration": 16047, + "src": "6191:23:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "expression": { + "id": 12144, + "name": "attestation1", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12119, + "src": "6232:12:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16058_memory_ptr", + "typeString": "struct Attestation.State memory" + } + }, + "id": 12145, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "6245:11:55", + "memberName": "responseCID", + "nodeType": "MemberAccess", + "referencedDeclaration": 16049, + "src": "6232:24:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "expression": { + "id": 12146, + "name": "attestation1", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12119, + "src": "6274:12:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16058_memory_ptr", + "typeString": "struct Attestation.State memory" + } + }, + "id": 12147, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "6287:20:55", + "memberName": "subgraphDeploymentId", + "nodeType": "MemberAccess", + "referencedDeclaration": 16051, + "src": "6274:33:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "expression": { + "id": 12148, + "name": "attestation2", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12129, + "src": "6325:12:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16058_memory_ptr", + "typeString": "struct Attestation.State memory" + } + }, + "id": 12149, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "6338:10:55", + "memberName": "requestCID", + "nodeType": "MemberAccess", + "referencedDeclaration": 16047, + "src": "6325:23:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "expression": { + "id": 12150, + "name": "attestation2", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12129, + "src": "6366:12:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16058_memory_ptr", + "typeString": "struct Attestation.State memory" + } + }, + "id": 12151, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "6379:11:55", + "memberName": "responseCID", + "nodeType": "MemberAccess", + "referencedDeclaration": 16049, + "src": "6366:24:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "expression": { + "id": 12152, + "name": "attestation2", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12129, + "src": "6408:12:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16058_memory_ptr", + "typeString": "struct Attestation.State memory" + } + }, + "id": 12153, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "6421:20:55", + "memberName": "subgraphDeploymentId", + "nodeType": "MemberAccess", + "referencedDeclaration": 16051, + "src": "6408:33:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 12141, + "name": "DisputeManagerNonConflictingAttestations", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15177, + "src": "6133:40:55", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_bytes32_$_t_bytes32_$_t_bytes32_$_t_bytes32_$_t_bytes32_$_t_bytes32_$returns$_t_error_$", + "typeString": "function (bytes32,bytes32,bytes32,bytes32,bytes32,bytes32) pure returns (error)" + } + }, + "id": 12154, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "6133:322:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 12135, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "6044:7:55", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 12155, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "6044:421:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 12156, + "nodeType": "ExpressionStatement", + "src": "6044:421:55" + }, + { + "expression": { + "arguments": [ + { + "expression": { + "id": 12160, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "6537:3:55", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 12161, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "6541:6:55", + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "6537:10:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 12162, + "name": "disputeDeposit", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13562, + "src": "6549:14:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 12157, + "name": "_graphToken", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4805, + "src": "6512:11:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_contract$_IGraphToken_$758_$", + "typeString": "function () view returns (contract IGraphToken)" + } + }, + "id": 12158, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "6512:13:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_IGraphToken_$758", + "typeString": "contract IGraphToken" + } + }, + "id": 12159, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "6526:10:55", + "memberName": "pullTokens", + "nodeType": "MemberAccess", + "referencedDeclaration": 792, + "src": "6512:24:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IGraphToken_$758_$_t_address_$_t_uint256_$returns$__$attached_to$_t_contract$_IGraphToken_$758_$", + "typeString": "function (contract IGraphToken,address,uint256)" + } + }, + "id": 12163, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "6512:52:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 12164, + "nodeType": "ExpressionStatement", + "src": "6512:52:55" + }, + { + "assignments": [ + 12166 + ], + "declarations": [ + { + "constant": false, + "id": 12166, + "mutability": "mutable", + "name": "dId1", + "nameLocation": "6674:4:55", + "nodeType": "VariableDeclaration", + "scope": 12210, + "src": "6666:12:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 12165, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "6666:7:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "id": 12175, + "initialValue": { + "arguments": [ + { + "id": 12168, + "name": "fisherman", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12111, + "src": "6729:9:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 12171, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 12169, + "name": "disputeDeposit", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13562, + "src": "6752:14:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "/", + "rightExpression": { + "hexValue": "32", + "id": 12170, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6769:1:55", + "typeDescriptions": { + "typeIdentifier": "t_rational_2_by_1", + "typeString": "int_const 2" + }, + "value": "2" + }, + "src": "6752:18:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 12172, + "name": "attestation1", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12119, + "src": "6784:12:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16058_memory_ptr", + "typeString": "struct Attestation.State memory" + } + }, + { + "id": 12173, + "name": "attestationData1", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12100, + "src": "6810:16:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes calldata" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_struct$_State_$16058_memory_ptr", + "typeString": "struct Attestation.State memory" + }, + { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes calldata" + } + ], + "id": 12167, + "name": "_createQueryDisputeWithAttestation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12923, + "src": "6681:34:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_uint256_$_t_struct$_State_$16058_memory_ptr_$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (address,uint256,struct Attestation.State memory,bytes memory) returns (bytes32)" + } + }, + "id": 12174, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "6681:155:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "6666:170:55" + }, + { + "assignments": [ + 12177 + ], + "declarations": [ + { + "constant": false, + "id": 12177, + "mutability": "mutable", + "name": "dId2", + "nameLocation": "6854:4:55", + "nodeType": "VariableDeclaration", + "scope": 12210, + "src": "6846:12:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 12176, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "6846:7:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "id": 12186, + "initialValue": { + "arguments": [ + { + "id": 12179, + "name": "fisherman", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12111, + "src": "6909:9:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 12182, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 12180, + "name": "disputeDeposit", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13562, + "src": "6932:14:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "/", + "rightExpression": { + "hexValue": "32", + "id": 12181, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6949:1:55", + "typeDescriptions": { + "typeIdentifier": "t_rational_2_by_1", + "typeString": "int_const 2" + }, + "value": "2" + }, + "src": "6932:18:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 12183, + "name": "attestation2", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12129, + "src": "6964:12:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16058_memory_ptr", + "typeString": "struct Attestation.State memory" + } + }, + { + "id": 12184, + "name": "attestationData2", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12102, + "src": "6990:16:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes calldata" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_struct$_State_$16058_memory_ptr", + "typeString": "struct Attestation.State memory" + }, + { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes calldata" + } + ], + "id": 12178, + "name": "_createQueryDisputeWithAttestation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12923, + "src": "6861:34:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_uint256_$_t_struct$_State_$16058_memory_ptr_$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (address,uint256,struct Attestation.State memory,bytes memory) returns (bytes32)" + } + }, + "id": 12185, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "6861:155:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "6846:170:55" + }, + { + "expression": { + "id": 12192, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "baseExpression": { + "id": 12187, + "name": "disputes", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13574, + "src": "7079:8:55", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Dispute_$14943_storage_$", + "typeString": "mapping(bytes32 => struct IDisputeManager.Dispute storage ref)" + } + }, + "id": 12189, + "indexExpression": { + "id": 12188, + "name": "dId1", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12166, + "src": "7088:4:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "7079:14:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage", + "typeString": "struct IDisputeManager.Dispute storage ref" + } + }, + "id": 12190, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberLocation": "7094:16:55", + "memberName": "relatedDisputeId", + "nodeType": "MemberAccess", + "referencedDeclaration": 14930, + "src": "7079:31:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "id": 12191, + "name": "dId2", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12177, + "src": "7113:4:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "src": "7079:38:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "id": 12193, + "nodeType": "ExpressionStatement", + "src": "7079:38:55" + }, + { + "expression": { + "id": 12199, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "baseExpression": { + "id": 12194, + "name": "disputes", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13574, + "src": "7127:8:55", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Dispute_$14943_storage_$", + "typeString": "mapping(bytes32 => struct IDisputeManager.Dispute storage ref)" + } + }, + "id": 12196, + "indexExpression": { + "id": 12195, + "name": "dId2", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12177, + "src": "7136:4:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "7127:14:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage", + "typeString": "struct IDisputeManager.Dispute storage ref" + } + }, + "id": 12197, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberLocation": "7142:16:55", + "memberName": "relatedDisputeId", + "nodeType": "MemberAccess", + "referencedDeclaration": 14930, + "src": "7127:31:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "id": 12198, + "name": "dId1", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12166, + "src": "7161:4:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "src": "7127:38:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "id": 12200, + "nodeType": "ExpressionStatement", + "src": "7127:38:55" + }, + { + "eventCall": { + "arguments": [ + { + "id": 12202, + "name": "dId1", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12166, + "src": "7253:4:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "id": 12203, + "name": "dId2", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12177, + "src": "7259:4:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 12201, + "name": "DisputeLinked", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15066, + "src": "7239:13:55", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_bytes32_$_t_bytes32_$returns$__$", + "typeString": "function (bytes32,bytes32)" + } + }, + "id": 12204, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "7239:25:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 12205, + "nodeType": "EmitStatement", + "src": "7234:30:55" + }, + { + "expression": { + "components": [ + { + "id": 12206, + "name": "dId1", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12166, + "src": "7283:4:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "id": 12207, + "name": "dId2", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12177, + "src": "7289:4:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "id": 12208, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "7282:12:55", + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_bytes32_$_t_bytes32_$", + "typeString": "tuple(bytes32,bytes32)" + } + }, + "functionReturnParameters": 12109, + "id": 12209, + "nodeType": "Return", + "src": "7275:19:55" + } + ] + }, + "documentation": { + "id": 12098, + "nodeType": "StructuredDocumentation", + "src": "5533:31:55", + "text": "@inheritdoc IDisputeManager" + }, + "functionSelector": "c894222e", + "id": 12211, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "createQueryDisputeConflict", + "nameLocation": "5578:26:55", + "nodeType": "FunctionDefinition", + "overrides": { + "id": 12104, + "nodeType": "OverrideSpecifier", + "overrides": [], + "src": "5702:8:55" + }, + "parameters": { + "id": 12103, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 12100, + "mutability": "mutable", + "name": "attestationData1", + "nameLocation": "5629:16:55", + "nodeType": "VariableDeclaration", + "scope": 12211, + "src": "5614:31:55", + "stateVariable": false, + "storageLocation": "calldata", + "typeDescriptions": { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 12099, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "5614:5:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 12102, + "mutability": "mutable", + "name": "attestationData2", + "nameLocation": "5670:16:55", + "nodeType": "VariableDeclaration", + "scope": 12211, + "src": "5655:31:55", + "stateVariable": false, + "storageLocation": "calldata", + "typeDescriptions": { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 12101, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "5655:5:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "src": "5604:88:55" + }, + "returnParameters": { + "id": 12109, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 12106, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 12211, + "src": "5720:7:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 12105, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "5720:7:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 12108, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 12211, + "src": "5729:7:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 12107, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "5729:7:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "5719:18:55" + }, + "scope": 13542, + "src": "5569:1732:55", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "baseFunctions": [ + 15276 + ], + "body": { + "id": 12324, + "nodeType": "Block", + "src": "7555:1148:55", + "statements": [ + { + "assignments": [ + 12229 + ], + "declarations": [ + { + "constant": false, + "id": 12229, + "mutability": "mutable", + "name": "disputeId", + "nameLocation": "7603:9:55", + "nodeType": "VariableDeclaration", + "scope": 12324, + "src": "7595:17:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 12228, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "7595:7:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "id": 12237, + "initialValue": { + "arguments": [ + { + "arguments": [ + { + "id": 12233, + "name": "allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12214, + "src": "7642:12:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "hexValue": "6c6567616379", + "id": 12234, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7656:8:55", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_b7ccb6878fbded310d2d05350bca9c84568ecb568d4b626c83e0508c3193ce89", + "typeString": "literal_string \"legacy\"" + }, + "value": "legacy" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_stringliteral_b7ccb6878fbded310d2d05350bca9c84568ecb568d4b626c83e0508c3193ce89", + "typeString": "literal_string \"legacy\"" + } + ], + "expression": { + "id": 12231, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -1, + "src": "7625:3:55", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 12232, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "7629:12:55", + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "src": "7625:16:55", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 12235, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "7625:40:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 12230, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -8, + "src": "7615:9:55", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 12236, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "7615:51:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "7595:71:55" + }, + { + "assignments": [ + 12239 + ], + "declarations": [ + { + "constant": false, + "id": 12239, + "mutability": "mutable", + "name": "indexer", + "nameLocation": "7738:7:55", + "nodeType": "VariableDeclaration", + "scope": 12324, + "src": "7730:15:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 12238, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "7730:7:55", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "id": 12246, + "initialValue": { + "expression": { + "arguments": [ + { + "id": 12243, + "name": "allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12214, + "src": "7778:12:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "expression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 12240, + "name": "_graphStaking", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4815, + "src": "7748:13:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_contract$_IHorizonStaking_$2625_$", + "typeString": "function () view returns (contract IHorizonStaking)" + } + }, + "id": 12241, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "7748:15:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_IHorizonStaking_$2625", + "typeString": "contract IHorizonStaking" + } + }, + "id": 12242, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "7764:13:55", + "memberName": "getAllocation", + "nodeType": "MemberAccess", + "referencedDeclaration": 3196, + "src": "7748:29:55", + "typeDescriptions": { + "typeIdentifier": "t_function_external_view$_t_address_$returns$_t_struct$_Allocation_$3073_memory_ptr_$", + "typeString": "function (address) view external returns (struct IHorizonStakingExtension.Allocation memory)" + } + }, + "id": 12244, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "7748:43:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allocation_$3073_memory_ptr", + "typeString": "struct IHorizonStakingExtension.Allocation memory" + } + }, + "id": 12245, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "7792:7:55", + "memberName": "indexer", + "nodeType": "MemberAccess", + "referencedDeclaration": 3056, + "src": "7748:51:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "7730:69:55" + }, + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 12253, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 12248, + "name": "indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12239, + "src": "7817:7:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "arguments": [ + { + "hexValue": "30", + "id": 12251, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7836:1:55", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 12250, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "7828:7:55", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 12249, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "7828:7:55", + "typeDescriptions": {} + } + }, + "id": 12252, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "7828:10:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "7817:21:55", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [ + { + "id": 12255, + "name": "allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12214, + "src": "7870:12:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 12254, + "name": "DisputeManagerIndexerNotFound", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15155, + "src": "7840:29:55", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_address_$returns$_t_error_$", + "typeString": "function (address) pure returns (error)" + } + }, + "id": 12256, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "7840:43:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 12247, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "7809:7:55", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 12257, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "7809:75:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 12258, + "nodeType": "ExpressionStatement", + "src": "7809:75:55" + }, + { + "expression": { + "id": 12280, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "baseExpression": { + "id": 12259, + "name": "disputes", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13574, + "src": "7920:8:55", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Dispute_$14943_storage_$", + "typeString": "mapping(bytes32 => struct IDisputeManager.Dispute storage ref)" + } + }, + "id": 12261, + "indexExpression": { + "id": 12260, + "name": "disputeId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12229, + "src": "7929:9:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "7920:19:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage", + "typeString": "struct IDisputeManager.Dispute storage ref" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "id": 12263, + "name": "indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12239, + "src": "7963:7:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 12264, + "name": "fisherman", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12216, + "src": "7984:9:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "hexValue": "30", + "id": 12265, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8007:1:55", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + { + "hexValue": "30", + "id": 12266, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8022:1:55", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + { + "expression": { + "id": 12267, + "name": "DisputeType", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14913, + "src": "8037:11:55", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_DisputeType_$14913_$", + "typeString": "type(enum IDisputeManager.DisputeType)" + } + }, + "id": 12268, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "8049:13:55", + "memberName": "LegacyDispute", + "nodeType": "MemberAccess", + "referencedDeclaration": 14912, + "src": "8037:25:55", + "typeDescriptions": { + "typeIdentifier": "t_enum$_DisputeType_$14913", + "typeString": "enum IDisputeManager.DisputeType" + } + }, + { + "expression": { + "expression": { + "id": 12269, + "name": "IDisputeManager", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15373, + "src": "8076:15:55", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_IDisputeManager_$15373_$", + "typeString": "type(contract IDisputeManager)" + } + }, + "id": 12270, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "8092:13:55", + "memberName": "DisputeStatus", + "nodeType": "MemberAccess", + "referencedDeclaration": 14921, + "src": "8076:29:55", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_DisputeStatus_$14921_$", + "typeString": "type(enum IDisputeManager.DisputeStatus)" + } + }, + "id": 12271, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "8106:8:55", + "memberName": "Accepted", + "nodeType": "MemberAccess", + "referencedDeclaration": 14916, + "src": "8076:38:55", + "typeDescriptions": { + "typeIdentifier": "t_enum$_DisputeStatus_$14921", + "typeString": "enum IDisputeManager.DisputeStatus" + } + }, + { + "expression": { + "id": 12272, + "name": "block", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -4, + "src": "8128:5:55", + "typeDescriptions": { + "typeIdentifier": "t_magic_block", + "typeString": "block" + } + }, + "id": 12273, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "8134:9:55", + "memberName": "timestamp", + "nodeType": "MemberAccess", + "src": "8128:15:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 12277, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 12274, + "name": "block", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -4, + "src": "8157:5:55", + "typeDescriptions": { + "typeIdentifier": "t_magic_block", + "typeString": "block" + } + }, + "id": 12275, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "8163:9:55", + "memberName": "timestamp", + "nodeType": "MemberAccess", + "src": "8157:15:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "id": 12276, + "name": "disputePeriod", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13559, + "src": "8175:13:55", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "src": "8157:31:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "hexValue": "30", + "id": 12278, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8202:1:55", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + { + "typeIdentifier": "t_enum$_DisputeType_$14913", + "typeString": "enum IDisputeManager.DisputeType" + }, + { + "typeIdentifier": "t_enum$_DisputeStatus_$14921", + "typeString": "enum IDisputeManager.DisputeStatus" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 12262, + "name": "Dispute", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14943, + "src": "7942:7:55", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_struct$_Dispute_$14943_storage_ptr_$", + "typeString": "type(struct IDisputeManager.Dispute storage pointer)" + } + }, + "id": 12279, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "structConstructorCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "7942:271:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_memory_ptr", + "typeString": "struct IDisputeManager.Dispute memory" + } + }, + "src": "7920:293:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage", + "typeString": "struct IDisputeManager.Dispute storage ref" + } + }, + "id": 12281, + "nodeType": "ExpressionStatement", + "src": "7920:293:55" + }, + { + "assignments": [ + 12284 + ], + "declarations": [ + { + "constant": false, + "id": 12284, + "mutability": "mutable", + "name": "subgraphService_", + "nameLocation": "8270:16:55", + "nodeType": "VariableDeclaration", + "scope": 12324, + "src": "8253:33:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_contract$_ISubgraphService_$15634", + "typeString": "contract ISubgraphService" + }, + "typeName": { + "id": 12283, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 12282, + "name": "ISubgraphService", + "nameLocations": [ + "8253:16:55" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 15634, + "src": "8253:16:55" + }, + "referencedDeclaration": 15634, + "src": "8253:16:55", + "typeDescriptions": { + "typeIdentifier": "t_contract$_ISubgraphService_$15634", + "typeString": "contract ISubgraphService" + } + }, + "visibility": "internal" + } + ], + "id": 12287, + "initialValue": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 12285, + "name": "_getSubgraphService", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13494, + "src": "8289:19:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_contract$_ISubgraphService_$15634_$", + "typeString": "function () view returns (contract ISubgraphService)" + } + }, + "id": 12286, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "8289:21:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_ISubgraphService_$15634", + "typeString": "contract ISubgraphService" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "8253:57:55" + }, + { + "expression": { + "arguments": [ + { + "id": 12291, + "name": "indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12239, + "src": "8343:7:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "arguments": [ + { + "id": 12294, + "name": "tokensSlash", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12218, + "src": "8363:11:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 12295, + "name": "tokensRewards", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12220, + "src": "8376:13:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "id": 12292, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -1, + "src": "8352:3:55", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 12293, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "8356:6:55", + "memberName": "encode", + "nodeType": "MemberAccess", + "src": "8352:10:55", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencode_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 12296, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "8352:38:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "expression": { + "id": 12288, + "name": "subgraphService_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12284, + "src": "8320:16:55", + "typeDescriptions": { + "typeIdentifier": "t_contract$_ISubgraphService_$15634", + "typeString": "contract ISubgraphService" + } + }, + "id": 12290, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "8337:5:55", + "memberName": "slash", + "nodeType": "MemberAccess", + "referencedDeclaration": 1526, + "src": "8320:22:55", + "typeDescriptions": { + "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_bytes_memory_ptr_$returns$__$", + "typeString": "function (address,bytes memory) external" + } + }, + "id": 12297, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "8320:71:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 12298, + "nodeType": "ExpressionStatement", + "src": "8320:71:55" + }, + { + "expression": { + "arguments": [ + { + "id": 12302, + "name": "fisherman", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12216, + "src": "8459:9:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 12303, + "name": "tokensRewards", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12220, + "src": "8470:13:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 12299, + "name": "_graphToken", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4805, + "src": "8434:11:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_contract$_IGraphToken_$758_$", + "typeString": "function () view returns (contract IGraphToken)" + } + }, + "id": 12300, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "8434:13:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_IGraphToken_$758", + "typeString": "contract IGraphToken" + } + }, + "id": 12301, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "8448:10:55", + "memberName": "pushTokens", + "nodeType": "MemberAccess", + "referencedDeclaration": 818, + "src": "8434:24:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IGraphToken_$758_$_t_address_$_t_uint256_$returns$__$attached_to$_t_contract$_IGraphToken_$758_$", + "typeString": "function (contract IGraphToken,address,uint256)" + } + }, + "id": 12304, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "8434:50:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 12305, + "nodeType": "ExpressionStatement", + "src": "8434:50:55" + }, + { + "eventCall": { + "arguments": [ + { + "id": 12307, + "name": "disputeId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12229, + "src": "8521:9:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "id": 12308, + "name": "indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12239, + "src": "8532:7:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 12309, + "name": "fisherman", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12216, + "src": "8541:9:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 12310, + "name": "allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12214, + "src": "8552:12:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 12311, + "name": "tokensSlash", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12218, + "src": "8566:11:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 12312, + "name": "tokensRewards", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12220, + "src": "8579:13:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 12306, + "name": "LegacyDisputeCreated", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15026, + "src": "8500:20:55", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_bytes32_$_t_address_$_t_address_$_t_address_$_t_uint256_$_t_uint256_$returns$__$", + "typeString": "function (bytes32,address,address,address,uint256,uint256)" + } + }, + "id": 12313, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "8500:93:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 12314, + "nodeType": "EmitStatement", + "src": "8495:98:55" + }, + { + "eventCall": { + "arguments": [ + { + "id": 12316, + "name": "disputeId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12229, + "src": "8624:9:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "id": 12317, + "name": "indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12239, + "src": "8635:7:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 12318, + "name": "fisherman", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12216, + "src": "8644:9:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 12319, + "name": "tokensRewards", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12220, + "src": "8655:13:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 12315, + "name": "DisputeAccepted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15037, + "src": "8608:15:55", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_bytes32_$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (bytes32,address,address,uint256)" + } + }, + "id": 12320, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "8608:61:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 12321, + "nodeType": "EmitStatement", + "src": "8603:66:55" + }, + { + "expression": { + "id": 12322, + "name": "disputeId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12229, + "src": "8687:9:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "functionReturnParameters": 12227, + "id": 12323, + "nodeType": "Return", + "src": "8680:16:55" + } + ] + }, + "documentation": { + "id": 12212, + "nodeType": "StructuredDocumentation", + "src": "7307:31:55", + "text": "@inheritdoc IDisputeManager" + }, + "functionSelector": "8d4e9008", + "id": 12325, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "id": 12224, + "kind": "modifierInvocation", + "modifierName": { + "id": 12223, + "name": "onlyArbitrator", + "nameLocations": [ + "7522:14:55" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 11919, + "src": "7522:14:55" + }, + "nodeType": "ModifierInvocation", + "src": "7522:14:55" + } + ], + "name": "createAndAcceptLegacyDispute", + "nameLocation": "7352:28:55", + "nodeType": "FunctionDefinition", + "overrides": { + "id": 12222, + "nodeType": "OverrideSpecifier", + "overrides": [], + "src": "7513:8:55" + }, + "parameters": { + "id": 12221, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 12214, + "mutability": "mutable", + "name": "allocationId", + "nameLocation": "7398:12:55", + "nodeType": "VariableDeclaration", + "scope": 12325, + "src": "7390:20:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 12213, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "7390:7:55", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 12216, + "mutability": "mutable", + "name": "fisherman", + "nameLocation": "7428:9:55", + "nodeType": "VariableDeclaration", + "scope": 12325, + "src": "7420:17:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 12215, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "7420:7:55", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 12218, + "mutability": "mutable", + "name": "tokensSlash", + "nameLocation": "7455:11:55", + "nodeType": "VariableDeclaration", + "scope": 12325, + "src": "7447:19:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 12217, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "7447:7:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 12220, + "mutability": "mutable", + "name": "tokensRewards", + "nameLocation": "7484:13:55", + "nodeType": "VariableDeclaration", + "scope": 12325, + "src": "7476:21:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 12219, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "7476:7:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "7380:123:55" + }, + "returnParameters": { + "id": 12227, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 12226, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 12325, + "src": "7546:7:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 12225, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "7546:7:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "7545:9:55" + }, + "scope": 13542, + "src": "7343:1360:55", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "baseFunctions": [ + 15284 + ], + "body": { + "id": 12364, + "nodeType": "Block", + "src": "8893:224:55", + "statements": [ + { + "expression": { + "arguments": [ + { + "id": 12345, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "8911:42:55", + "subExpression": { + "arguments": [ + { + "baseExpression": { + "id": 12341, + "name": "disputes", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13574, + "src": "8933:8:55", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Dispute_$14943_storage_$", + "typeString": "mapping(bytes32 => struct IDisputeManager.Dispute storage ref)" + } + }, + "id": 12343, + "indexExpression": { + "id": 12342, + "name": "disputeId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12328, + "src": "8942:9:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "8933:19:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage", + "typeString": "struct IDisputeManager.Dispute storage ref" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_struct$_Dispute_$14943_storage", + "typeString": "struct IDisputeManager.Dispute storage ref" + } + ], + "id": 12340, + "name": "_isDisputeInConflict", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13512, + "src": "8912:20:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_struct$_Dispute_$14943_storage_ptr_$returns$_t_bool_$", + "typeString": "function (struct IDisputeManager.Dispute storage pointer) view returns (bool)" + } + }, + "id": 12344, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "8912:41:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [ + { + "id": 12347, + "name": "disputeId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12328, + "src": "8987:9:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 12346, + "name": "DisputeManagerDisputeInConflict", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15138, + "src": "8955:31:55", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_bytes32_$returns$_t_error_$", + "typeString": "function (bytes32) pure returns (error)" + } + }, + "id": 12348, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "8955:42:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 12339, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "8903:7:55", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 12349, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "8903:95:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 12350, + "nodeType": "ExpressionStatement", + "src": "8903:95:55" + }, + { + "assignments": [ + 12353 + ], + "declarations": [ + { + "constant": false, + "id": 12353, + "mutability": "mutable", + "name": "dispute", + "nameLocation": "9024:7:55", + "nodeType": "VariableDeclaration", + "scope": 12364, + "src": "9008:23:55", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage_ptr", + "typeString": "struct IDisputeManager.Dispute" + }, + "typeName": { + "id": 12352, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 12351, + "name": "Dispute", + "nameLocations": [ + "9008:7:55" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 14943, + "src": "9008:7:55" + }, + "referencedDeclaration": 14943, + "src": "9008:7:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage_ptr", + "typeString": "struct IDisputeManager.Dispute" + } + }, + "visibility": "internal" + } + ], + "id": 12357, + "initialValue": { + "baseExpression": { + "id": 12354, + "name": "disputes", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13574, + "src": "9034:8:55", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Dispute_$14943_storage_$", + "typeString": "mapping(bytes32 => struct IDisputeManager.Dispute storage ref)" + } + }, + "id": 12356, + "indexExpression": { + "id": 12355, + "name": "disputeId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12328, + "src": "9043:9:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "9034:19:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage", + "typeString": "struct IDisputeManager.Dispute storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "9008:45:55" + }, + { + "expression": { + "arguments": [ + { + "id": 12359, + "name": "disputeId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12328, + "src": "9078:9:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "id": 12360, + "name": "dispute", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12353, + "src": "9089:7:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage_ptr", + "typeString": "struct IDisputeManager.Dispute storage pointer" + } + }, + { + "id": 12361, + "name": "tokensSlash", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12330, + "src": "9098:11:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_struct$_Dispute_$14943_storage_ptr", + "typeString": "struct IDisputeManager.Dispute storage pointer" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 12358, + "name": "_acceptDispute", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13118, + "src": "9063:14:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$_t_struct$_Dispute_$14943_storage_ptr_$_t_uint256_$returns$__$", + "typeString": "function (bytes32,struct IDisputeManager.Dispute storage pointer,uint256)" + } + }, + "id": 12362, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "9063:47:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 12363, + "nodeType": "ExpressionStatement", + "src": "9063:47:55" + } + ] + }, + "documentation": { + "id": 12326, + "nodeType": "StructuredDocumentation", + "src": "8709:31:55", + "text": "@inheritdoc IDisputeManager" + }, + "functionSelector": "050b17ad", + "id": 12365, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "id": 12334, + "kind": "modifierInvocation", + "modifierName": { + "id": 12333, + "name": "onlyArbitrator", + "nameLocations": [ + "8848:14:55" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 11919, + "src": "8848:14:55" + }, + "nodeType": "ModifierInvocation", + "src": "8848:14:55" + }, + { + "arguments": [ + { + "id": 12336, + "name": "disputeId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12328, + "src": "8882:9:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "id": 12337, + "kind": "modifierInvocation", + "modifierName": { + "id": 12335, + "name": "onlyPendingDispute", + "nameLocations": [ + "8863:18:55" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 11952, + "src": "8863:18:55" + }, + "nodeType": "ModifierInvocation", + "src": "8863:29:55" + } + ], + "name": "acceptDispute", + "nameLocation": "8754:13:55", + "nodeType": "FunctionDefinition", + "overrides": { + "id": 12332, + "nodeType": "OverrideSpecifier", + "overrides": [], + "src": "8839:8:55" + }, + "parameters": { + "id": 12331, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 12328, + "mutability": "mutable", + "name": "disputeId", + "nameLocation": "8785:9:55", + "nodeType": "VariableDeclaration", + "scope": 12365, + "src": "8777:17:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 12327, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "8777:7:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 12330, + "mutability": "mutable", + "name": "tokensSlash", + "nameLocation": "8812:11:55", + "nodeType": "VariableDeclaration", + "scope": 12365, + "src": "8804:19:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 12329, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "8804:7:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "8767:62:55" + }, + "returnParameters": { + "id": 12338, + "nodeType": "ParameterList", + "parameters": [], + "src": "8893:0:55" + }, + "scope": 13542, + "src": "8745:372:55", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "baseFunctions": [ + 15296 + ], + "body": { + "id": 12430, + "nodeType": "Block", + "src": "9389:491:55", + "statements": [ + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "baseExpression": { + "id": 12385, + "name": "disputes", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13574, + "src": "9428:8:55", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Dispute_$14943_storage_$", + "typeString": "mapping(bytes32 => struct IDisputeManager.Dispute storage ref)" + } + }, + "id": 12387, + "indexExpression": { + "id": 12386, + "name": "disputeId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12368, + "src": "9437:9:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "9428:19:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage", + "typeString": "struct IDisputeManager.Dispute storage ref" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_struct$_Dispute_$14943_storage", + "typeString": "struct IDisputeManager.Dispute storage ref" + } + ], + "id": 12384, + "name": "_isDisputeInConflict", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13512, + "src": "9407:20:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_struct$_Dispute_$14943_storage_ptr_$returns$_t_bool_$", + "typeString": "function (struct IDisputeManager.Dispute storage pointer) view returns (bool)" + } + }, + "id": 12388, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "9407:41:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [ + { + "id": 12390, + "name": "disputeId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12368, + "src": "9485:9:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 12389, + "name": "DisputeManagerDisputeNotInConflict", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15143, + "src": "9450:34:55", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_bytes32_$returns$_t_error_$", + "typeString": "function (bytes32) pure returns (error)" + } + }, + "id": 12391, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "9450:45:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 12383, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "9399:7:55", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 12392, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "9399:97:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 12393, + "nodeType": "ExpressionStatement", + "src": "9399:97:55" + }, + { + "assignments": [ + 12396 + ], + "declarations": [ + { + "constant": false, + "id": 12396, + "mutability": "mutable", + "name": "dispute", + "nameLocation": "9522:7:55", + "nodeType": "VariableDeclaration", + "scope": 12430, + "src": "9506:23:55", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage_ptr", + "typeString": "struct IDisputeManager.Dispute" + }, + "typeName": { + "id": 12395, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 12394, + "name": "Dispute", + "nameLocations": [ + "9506:7:55" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 14943, + "src": "9506:7:55" + }, + "referencedDeclaration": 14943, + "src": "9506:7:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage_ptr", + "typeString": "struct IDisputeManager.Dispute" + } + }, + "visibility": "internal" + } + ], + "id": 12400, + "initialValue": { + "baseExpression": { + "id": 12397, + "name": "disputes", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13574, + "src": "9532:8:55", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Dispute_$14943_storage_$", + "typeString": "mapping(bytes32 => struct IDisputeManager.Dispute storage ref)" + } + }, + "id": 12399, + "indexExpression": { + "id": 12398, + "name": "disputeId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12368, + "src": "9541:9:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "9532:19:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage", + "typeString": "struct IDisputeManager.Dispute storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "9506:45:55" + }, + { + "expression": { + "arguments": [ + { + "id": 12402, + "name": "disputeId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12368, + "src": "9576:9:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "id": 12403, + "name": "dispute", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12396, + "src": "9587:7:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage_ptr", + "typeString": "struct IDisputeManager.Dispute storage pointer" + } + }, + { + "id": 12404, + "name": "tokensSlash", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12370, + "src": "9596:11:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_struct$_Dispute_$14943_storage_ptr", + "typeString": "struct IDisputeManager.Dispute storage pointer" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 12401, + "name": "_acceptDispute", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13118, + "src": "9561:14:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$_t_struct$_Dispute_$14943_storage_ptr_$_t_uint256_$returns$__$", + "typeString": "function (bytes32,struct IDisputeManager.Dispute storage pointer,uint256)" + } + }, + "id": 12405, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "9561:47:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 12406, + "nodeType": "ExpressionStatement", + "src": "9561:47:55" + }, + { + "condition": { + "id": 12407, + "name": "acceptDisputeInConflict", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12372, + "src": "9623:23:55", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "id": 12428, + "nodeType": "Block", + "src": "9775:99:55", + "statements": [ + { + "expression": { + "arguments": [ + { + "expression": { + "id": 12420, + "name": "dispute", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12396, + "src": "9802:7:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage_ptr", + "typeString": "struct IDisputeManager.Dispute storage pointer" + } + }, + "id": 12421, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "9810:16:55", + "memberName": "relatedDisputeId", + "nodeType": "MemberAccess", + "referencedDeclaration": 14930, + "src": "9802:24:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "baseExpression": { + "id": 12422, + "name": "disputes", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13574, + "src": "9828:8:55", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Dispute_$14943_storage_$", + "typeString": "mapping(bytes32 => struct IDisputeManager.Dispute storage ref)" + } + }, + "id": 12425, + "indexExpression": { + "expression": { + "id": 12423, + "name": "dispute", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12396, + "src": "9837:7:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage_ptr", + "typeString": "struct IDisputeManager.Dispute storage pointer" + } + }, + "id": 12424, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "9845:16:55", + "memberName": "relatedDisputeId", + "nodeType": "MemberAccess", + "referencedDeclaration": 14930, + "src": "9837:24:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "9828:34:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage", + "typeString": "struct IDisputeManager.Dispute storage ref" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_struct$_Dispute_$14943_storage", + "typeString": "struct IDisputeManager.Dispute storage ref" + } + ], + "id": 12419, + "name": "_drawDispute", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13190, + "src": "9789:12:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$_t_struct$_Dispute_$14943_storage_ptr_$returns$__$", + "typeString": "function (bytes32,struct IDisputeManager.Dispute storage pointer)" + } + }, + "id": 12426, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "9789:74:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 12427, + "nodeType": "ExpressionStatement", + "src": "9789:74:55" + } + ] + }, + "id": 12429, + "nodeType": "IfStatement", + "src": "9619:255:55", + "trueBody": { + "id": 12418, + "nodeType": "Block", + "src": "9648:121:55", + "statements": [ + { + "expression": { + "arguments": [ + { + "expression": { + "id": 12409, + "name": "dispute", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12396, + "src": "9677:7:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage_ptr", + "typeString": "struct IDisputeManager.Dispute storage pointer" + } + }, + "id": 12410, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "9685:16:55", + "memberName": "relatedDisputeId", + "nodeType": "MemberAccess", + "referencedDeclaration": 14930, + "src": "9677:24:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "baseExpression": { + "id": 12411, + "name": "disputes", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13574, + "src": "9703:8:55", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Dispute_$14943_storage_$", + "typeString": "mapping(bytes32 => struct IDisputeManager.Dispute storage ref)" + } + }, + "id": 12414, + "indexExpression": { + "expression": { + "id": 12412, + "name": "dispute", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12396, + "src": "9712:7:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage_ptr", + "typeString": "struct IDisputeManager.Dispute storage pointer" + } + }, + "id": 12413, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "9720:16:55", + "memberName": "relatedDisputeId", + "nodeType": "MemberAccess", + "referencedDeclaration": 14930, + "src": "9712:24:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "9703:34:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage", + "typeString": "struct IDisputeManager.Dispute storage ref" + } + }, + { + "id": 12415, + "name": "tokensSlashRelated", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12374, + "src": "9739:18:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_struct$_Dispute_$14943_storage", + "typeString": "struct IDisputeManager.Dispute storage ref" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 12408, + "name": "_acceptDispute", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13118, + "src": "9662:14:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$_t_struct$_Dispute_$14943_storage_ptr_$_t_uint256_$returns$__$", + "typeString": "function (bytes32,struct IDisputeManager.Dispute storage pointer,uint256)" + } + }, + "id": 12416, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "9662:96:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 12417, + "nodeType": "ExpressionStatement", + "src": "9662:96:55" + } + ] + } + } + ] + }, + "documentation": { + "id": 12366, + "nodeType": "StructuredDocumentation", + "src": "9123:31:55", + "text": "@inheritdoc IDisputeManager" + }, + "functionSelector": "b0e2f7e9", + "id": 12431, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "id": 12378, + "kind": "modifierInvocation", + "modifierName": { + "id": 12377, + "name": "onlyArbitrator", + "nameLocations": [ + "9344:14:55" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 11919, + "src": "9344:14:55" + }, + "nodeType": "ModifierInvocation", + "src": "9344:14:55" + }, + { + "arguments": [ + { + "id": 12380, + "name": "disputeId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12368, + "src": "9378:9:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "id": 12381, + "kind": "modifierInvocation", + "modifierName": { + "id": 12379, + "name": "onlyPendingDispute", + "nameLocations": [ + "9359:18:55" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 11952, + "src": "9359:18:55" + }, + "nodeType": "ModifierInvocation", + "src": "9359:29:55" + } + ], + "name": "acceptDisputeConflict", + "nameLocation": "9168:21:55", + "nodeType": "FunctionDefinition", + "overrides": { + "id": 12376, + "nodeType": "OverrideSpecifier", + "overrides": [], + "src": "9335:8:55" + }, + "parameters": { + "id": 12375, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 12368, + "mutability": "mutable", + "name": "disputeId", + "nameLocation": "9207:9:55", + "nodeType": "VariableDeclaration", + "scope": 12431, + "src": "9199:17:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 12367, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "9199:7:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 12370, + "mutability": "mutable", + "name": "tokensSlash", + "nameLocation": "9234:11:55", + "nodeType": "VariableDeclaration", + "scope": 12431, + "src": "9226:19:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 12369, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "9226:7:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 12372, + "mutability": "mutable", + "name": "acceptDisputeInConflict", + "nameLocation": "9260:23:55", + "nodeType": "VariableDeclaration", + "scope": 12431, + "src": "9255:28:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 12371, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "9255:4:55", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 12374, + "mutability": "mutable", + "name": "tokensSlashRelated", + "nameLocation": "9301:18:55", + "nodeType": "VariableDeclaration", + "scope": 12431, + "src": "9293:26:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 12373, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "9293:7:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "9189:136:55" + }, + "returnParameters": { + "id": 12382, + "nodeType": "ParameterList", + "parameters": [], + "src": "9389:0:55" + }, + "scope": 13542, + "src": "9159:721:55", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "baseFunctions": [ + 15302 + ], + "body": { + "id": 12465, + "nodeType": "Block", + "src": "10027:199:55", + "statements": [ + { + "assignments": [ + 12445 + ], + "declarations": [ + { + "constant": false, + "id": 12445, + "mutability": "mutable", + "name": "dispute", + "nameLocation": "10053:7:55", + "nodeType": "VariableDeclaration", + "scope": 12465, + "src": "10037:23:55", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage_ptr", + "typeString": "struct IDisputeManager.Dispute" + }, + "typeName": { + "id": 12444, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 12443, + "name": "Dispute", + "nameLocations": [ + "10037:7:55" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 14943, + "src": "10037:7:55" + }, + "referencedDeclaration": 14943, + "src": "10037:7:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage_ptr", + "typeString": "struct IDisputeManager.Dispute" + } + }, + "visibility": "internal" + } + ], + "id": 12449, + "initialValue": { + "baseExpression": { + "id": 12446, + "name": "disputes", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13574, + "src": "10063:8:55", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Dispute_$14943_storage_$", + "typeString": "mapping(bytes32 => struct IDisputeManager.Dispute storage ref)" + } + }, + "id": 12448, + "indexExpression": { + "id": 12447, + "name": "disputeId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12434, + "src": "10072:9:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "10063:19:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage", + "typeString": "struct IDisputeManager.Dispute storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "10037:45:55" + }, + { + "expression": { + "arguments": [ + { + "id": 12454, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "10100:30:55", + "subExpression": { + "arguments": [ + { + "id": 12452, + "name": "dispute", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12445, + "src": "10122:7:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage_ptr", + "typeString": "struct IDisputeManager.Dispute storage pointer" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_struct$_Dispute_$14943_storage_ptr", + "typeString": "struct IDisputeManager.Dispute storage pointer" + } + ], + "id": 12451, + "name": "_isDisputeInConflict", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13512, + "src": "10101:20:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_struct$_Dispute_$14943_storage_ptr_$returns$_t_bool_$", + "typeString": "function (struct IDisputeManager.Dispute storage pointer) view returns (bool)" + } + }, + "id": 12453, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "10101:29:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [ + { + "id": 12456, + "name": "disputeId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12434, + "src": "10164:9:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 12455, + "name": "DisputeManagerDisputeInConflict", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15138, + "src": "10132:31:55", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_bytes32_$returns$_t_error_$", + "typeString": "function (bytes32) pure returns (error)" + } + }, + "id": 12457, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "10132:42:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 12450, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "10092:7:55", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 12458, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "10092:83:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 12459, + "nodeType": "ExpressionStatement", + "src": "10092:83:55" + }, + { + "expression": { + "arguments": [ + { + "id": 12461, + "name": "disputeId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12434, + "src": "10200:9:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "id": 12462, + "name": "dispute", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12445, + "src": "10211:7:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage_ptr", + "typeString": "struct IDisputeManager.Dispute storage pointer" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_struct$_Dispute_$14943_storage_ptr", + "typeString": "struct IDisputeManager.Dispute storage pointer" + } + ], + "id": 12460, + "name": "_rejectDispute", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13153, + "src": "10185:14:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$_t_struct$_Dispute_$14943_storage_ptr_$returns$__$", + "typeString": "function (bytes32,struct IDisputeManager.Dispute storage pointer)" + } + }, + "id": 12463, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "10185:34:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 12464, + "nodeType": "ExpressionStatement", + "src": "10185:34:55" + } + ] + }, + "documentation": { + "id": 12432, + "nodeType": "StructuredDocumentation", + "src": "9886:31:55", + "text": "@inheritdoc IDisputeManager" + }, + "functionSelector": "36167e03", + "id": 12466, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "id": 12438, + "kind": "modifierInvocation", + "modifierName": { + "id": 12437, + "name": "onlyArbitrator", + "nameLocations": [ + "9982:14:55" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 11919, + "src": "9982:14:55" + }, + "nodeType": "ModifierInvocation", + "src": "9982:14:55" + }, + { + "arguments": [ + { + "id": 12440, + "name": "disputeId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12434, + "src": "10016:9:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "id": 12441, + "kind": "modifierInvocation", + "modifierName": { + "id": 12439, + "name": "onlyPendingDispute", + "nameLocations": [ + "9997:18:55" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 11952, + "src": "9997:18:55" + }, + "nodeType": "ModifierInvocation", + "src": "9997:29:55" + } + ], + "name": "rejectDispute", + "nameLocation": "9931:13:55", + "nodeType": "FunctionDefinition", + "overrides": { + "id": 12436, + "nodeType": "OverrideSpecifier", + "overrides": [], + "src": "9973:8:55" + }, + "parameters": { + "id": 12435, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 12434, + "mutability": "mutable", + "name": "disputeId", + "nameLocation": "9953:9:55", + "nodeType": "VariableDeclaration", + "scope": 12466, + "src": "9945:17:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 12433, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "9945:7:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "9944:19:55" + }, + "returnParameters": { + "id": 12442, + "nodeType": "ParameterList", + "parameters": [], + "src": "10027:0:55" + }, + "scope": 13542, + "src": "9922:304:55", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "baseFunctions": [ + 15308 + ], + "body": { + "id": 12504, + "nodeType": "Block", + "src": "10371:248:55", + "statements": [ + { + "assignments": [ + 12480 + ], + "declarations": [ + { + "constant": false, + "id": 12480, + "mutability": "mutable", + "name": "dispute", + "nameLocation": "10397:7:55", + "nodeType": "VariableDeclaration", + "scope": 12504, + "src": "10381:23:55", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage_ptr", + "typeString": "struct IDisputeManager.Dispute" + }, + "typeName": { + "id": 12479, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 12478, + "name": "Dispute", + "nameLocations": [ + "10381:7:55" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 14943, + "src": "10381:7:55" + }, + "referencedDeclaration": 14943, + "src": "10381:7:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage_ptr", + "typeString": "struct IDisputeManager.Dispute" + } + }, + "visibility": "internal" + } + ], + "id": 12484, + "initialValue": { + "baseExpression": { + "id": 12481, + "name": "disputes", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13574, + "src": "10407:8:55", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Dispute_$14943_storage_$", + "typeString": "mapping(bytes32 => struct IDisputeManager.Dispute storage ref)" + } + }, + "id": 12483, + "indexExpression": { + "id": 12482, + "name": "disputeId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12469, + "src": "10416:9:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "10407:19:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage", + "typeString": "struct IDisputeManager.Dispute storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "10381:45:55" + }, + { + "expression": { + "arguments": [ + { + "id": 12486, + "name": "disputeId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12469, + "src": "10449:9:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "id": 12487, + "name": "dispute", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12480, + "src": "10460:7:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage_ptr", + "typeString": "struct IDisputeManager.Dispute storage pointer" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_struct$_Dispute_$14943_storage_ptr", + "typeString": "struct IDisputeManager.Dispute storage pointer" + } + ], + "id": 12485, + "name": "_drawDispute", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13190, + "src": "10436:12:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$_t_struct$_Dispute_$14943_storage_ptr_$returns$__$", + "typeString": "function (bytes32,struct IDisputeManager.Dispute storage pointer)" + } + }, + "id": 12488, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "10436:32:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 12489, + "nodeType": "ExpressionStatement", + "src": "10436:32:55" + }, + { + "condition": { + "arguments": [ + { + "id": 12491, + "name": "dispute", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12480, + "src": "10504:7:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage_ptr", + "typeString": "struct IDisputeManager.Dispute storage pointer" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_struct$_Dispute_$14943_storage_ptr", + "typeString": "struct IDisputeManager.Dispute storage pointer" + } + ], + "id": 12490, + "name": "_isDisputeInConflict", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13512, + "src": "10483:20:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_struct$_Dispute_$14943_storage_ptr_$returns$_t_bool_$", + "typeString": "function (struct IDisputeManager.Dispute storage pointer) view returns (bool)" + } + }, + "id": 12492, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "10483:29:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 12503, + "nodeType": "IfStatement", + "src": "10479:134:55", + "trueBody": { + "id": 12502, + "nodeType": "Block", + "src": "10514:99:55", + "statements": [ + { + "expression": { + "arguments": [ + { + "expression": { + "id": 12494, + "name": "dispute", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12480, + "src": "10541:7:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage_ptr", + "typeString": "struct IDisputeManager.Dispute storage pointer" + } + }, + "id": 12495, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "10549:16:55", + "memberName": "relatedDisputeId", + "nodeType": "MemberAccess", + "referencedDeclaration": 14930, + "src": "10541:24:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "baseExpression": { + "id": 12496, + "name": "disputes", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13574, + "src": "10567:8:55", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Dispute_$14943_storage_$", + "typeString": "mapping(bytes32 => struct IDisputeManager.Dispute storage ref)" + } + }, + "id": 12499, + "indexExpression": { + "expression": { + "id": 12497, + "name": "dispute", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12480, + "src": "10576:7:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage_ptr", + "typeString": "struct IDisputeManager.Dispute storage pointer" + } + }, + "id": 12498, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "10584:16:55", + "memberName": "relatedDisputeId", + "nodeType": "MemberAccess", + "referencedDeclaration": 14930, + "src": "10576:24:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "10567:34:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage", + "typeString": "struct IDisputeManager.Dispute storage ref" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_struct$_Dispute_$14943_storage", + "typeString": "struct IDisputeManager.Dispute storage ref" + } + ], + "id": 12493, + "name": "_drawDispute", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13190, + "src": "10528:12:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$_t_struct$_Dispute_$14943_storage_ptr_$returns$__$", + "typeString": "function (bytes32,struct IDisputeManager.Dispute storage pointer)" + } + }, + "id": 12500, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "10528:74:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 12501, + "nodeType": "ExpressionStatement", + "src": "10528:74:55" + } + ] + } + } + ] + }, + "documentation": { + "id": 12467, + "nodeType": "StructuredDocumentation", + "src": "10232:31:55", + "text": "@inheritdoc IDisputeManager" + }, + "functionSelector": "9334ea52", + "id": 12505, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "id": 12473, + "kind": "modifierInvocation", + "modifierName": { + "id": 12472, + "name": "onlyArbitrator", + "nameLocations": [ + "10326:14:55" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 11919, + "src": "10326:14:55" + }, + "nodeType": "ModifierInvocation", + "src": "10326:14:55" + }, + { + "arguments": [ + { + "id": 12475, + "name": "disputeId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12469, + "src": "10360:9:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "id": 12476, + "kind": "modifierInvocation", + "modifierName": { + "id": 12474, + "name": "onlyPendingDispute", + "nameLocations": [ + "10341:18:55" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 11952, + "src": "10341:18:55" + }, + "nodeType": "ModifierInvocation", + "src": "10341:29:55" + } + ], + "name": "drawDispute", + "nameLocation": "10277:11:55", + "nodeType": "FunctionDefinition", + "overrides": { + "id": 12471, + "nodeType": "OverrideSpecifier", + "overrides": [], + "src": "10317:8:55" + }, + "parameters": { + "id": 12470, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 12469, + "mutability": "mutable", + "name": "disputeId", + "nameLocation": "10297:9:55", + "nodeType": "VariableDeclaration", + "scope": 12505, + "src": "10289:17:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 12468, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "10289:7:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "10288:19:55" + }, + "returnParameters": { + "id": 12477, + "nodeType": "ParameterList", + "parameters": [], + "src": "10371:0:55" + }, + "scope": 13542, + "src": "10268:351:55", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "baseFunctions": [ + 15314 + ], + "body": { + "id": 12554, + "nodeType": "Block", + "src": "10776:402:55", + "statements": [ + { + "assignments": [ + 12520 + ], + "declarations": [ + { + "constant": false, + "id": 12520, + "mutability": "mutable", + "name": "dispute", + "nameLocation": "10802:7:55", + "nodeType": "VariableDeclaration", + "scope": 12554, + "src": "10786:23:55", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage_ptr", + "typeString": "struct IDisputeManager.Dispute" + }, + "typeName": { + "id": 12519, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 12518, + "name": "Dispute", + "nameLocations": [ + "10786:7:55" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 14943, + "src": "10786:7:55" + }, + "referencedDeclaration": 14943, + "src": "10786:7:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage_ptr", + "typeString": "struct IDisputeManager.Dispute" + } + }, + "visibility": "internal" + } + ], + "id": 12524, + "initialValue": { + "baseExpression": { + "id": 12521, + "name": "disputes", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13574, + "src": "10812:8:55", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Dispute_$14943_storage_$", + "typeString": "mapping(bytes32 => struct IDisputeManager.Dispute storage ref)" + } + }, + "id": 12523, + "indexExpression": { + "id": 12522, + "name": "disputeId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12508, + "src": "10821:9:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "10812:19:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage", + "typeString": "struct IDisputeManager.Dispute storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "10786:45:55" + }, + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 12530, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 12526, + "name": "dispute", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12520, + "src": "10898:7:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage_ptr", + "typeString": "struct IDisputeManager.Dispute storage pointer" + } + }, + "id": 12527, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "10906:13:55", + "memberName": "cancellableAt", + "nodeType": "MemberAccess", + "referencedDeclaration": 14940, + "src": "10898:21:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "expression": { + "id": 12528, + "name": "block", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -4, + "src": "10923:5:55", + "typeDescriptions": { + "typeIdentifier": "t_magic_block", + "typeString": "block" + } + }, + "id": 12529, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "10929:9:55", + "memberName": "timestamp", + "nodeType": "MemberAccess", + "src": "10923:15:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "10898:40:55", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 12531, + "name": "DisputeManagerDisputePeriodNotFinished", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15133, + "src": "10940:38:55", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$__$returns$_t_error_$", + "typeString": "function () pure returns (error)" + } + }, + "id": 12532, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "10940:40:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 12525, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "10890:7:55", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 12533, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "10890:91:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 12534, + "nodeType": "ExpressionStatement", + "src": "10890:91:55" + }, + { + "expression": { + "arguments": [ + { + "id": 12536, + "name": "disputeId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12508, + "src": "11006:9:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "id": 12537, + "name": "dispute", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12520, + "src": "11017:7:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage_ptr", + "typeString": "struct IDisputeManager.Dispute storage pointer" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_struct$_Dispute_$14943_storage_ptr", + "typeString": "struct IDisputeManager.Dispute storage pointer" + } + ], + "id": 12535, + "name": "_cancelDispute", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13227, + "src": "10991:14:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$_t_struct$_Dispute_$14943_storage_ptr_$returns$__$", + "typeString": "function (bytes32,struct IDisputeManager.Dispute storage pointer)" + } + }, + "id": 12538, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "10991:34:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 12539, + "nodeType": "ExpressionStatement", + "src": "10991:34:55" + }, + { + "condition": { + "arguments": [ + { + "id": 12541, + "name": "dispute", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12520, + "src": "11061:7:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage_ptr", + "typeString": "struct IDisputeManager.Dispute storage pointer" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_struct$_Dispute_$14943_storage_ptr", + "typeString": "struct IDisputeManager.Dispute storage pointer" + } + ], + "id": 12540, + "name": "_isDisputeInConflict", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13512, + "src": "11040:20:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_struct$_Dispute_$14943_storage_ptr_$returns$_t_bool_$", + "typeString": "function (struct IDisputeManager.Dispute storage pointer) view returns (bool)" + } + }, + "id": 12542, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "11040:29:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 12553, + "nodeType": "IfStatement", + "src": "11036:136:55", + "trueBody": { + "id": 12552, + "nodeType": "Block", + "src": "11071:101:55", + "statements": [ + { + "expression": { + "arguments": [ + { + "expression": { + "id": 12544, + "name": "dispute", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12520, + "src": "11100:7:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage_ptr", + "typeString": "struct IDisputeManager.Dispute storage pointer" + } + }, + "id": 12545, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "11108:16:55", + "memberName": "relatedDisputeId", + "nodeType": "MemberAccess", + "referencedDeclaration": 14930, + "src": "11100:24:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "baseExpression": { + "id": 12546, + "name": "disputes", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13574, + "src": "11126:8:55", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Dispute_$14943_storage_$", + "typeString": "mapping(bytes32 => struct IDisputeManager.Dispute storage ref)" + } + }, + "id": 12549, + "indexExpression": { + "expression": { + "id": 12547, + "name": "dispute", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12520, + "src": "11135:7:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage_ptr", + "typeString": "struct IDisputeManager.Dispute storage pointer" + } + }, + "id": 12548, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "11143:16:55", + "memberName": "relatedDisputeId", + "nodeType": "MemberAccess", + "referencedDeclaration": 14930, + "src": "11135:24:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "11126:34:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage", + "typeString": "struct IDisputeManager.Dispute storage ref" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_struct$_Dispute_$14943_storage", + "typeString": "struct IDisputeManager.Dispute storage ref" + } + ], + "id": 12543, + "name": "_cancelDispute", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13227, + "src": "11085:14:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$_t_struct$_Dispute_$14943_storage_ptr_$returns$__$", + "typeString": "function (bytes32,struct IDisputeManager.Dispute storage pointer)" + } + }, + "id": 12550, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "11085:76:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 12551, + "nodeType": "ExpressionStatement", + "src": "11085:76:55" + } + ] + } + } + ] + }, + "documentation": { + "id": 12506, + "nodeType": "StructuredDocumentation", + "src": "10625:31:55", + "text": "@inheritdoc IDisputeManager" + }, + "functionSelector": "1792f194", + "id": 12555, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": [ + { + "id": 12512, + "name": "disputeId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12508, + "src": "10735:9:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "id": 12513, + "kind": "modifierInvocation", + "modifierName": { + "id": 12511, + "name": "onlyFisherman", + "nameLocations": [ + "10721:13:55" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 11980, + "src": "10721:13:55" + }, + "nodeType": "ModifierInvocation", + "src": "10721:24:55" + }, + { + "arguments": [ + { + "id": 12515, + "name": "disputeId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12508, + "src": "10765:9:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "id": 12516, + "kind": "modifierInvocation", + "modifierName": { + "id": 12514, + "name": "onlyPendingDispute", + "nameLocations": [ + "10746:18:55" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 11952, + "src": "10746:18:55" + }, + "nodeType": "ModifierInvocation", + "src": "10746:29:55" + } + ], + "name": "cancelDispute", + "nameLocation": "10670:13:55", + "nodeType": "FunctionDefinition", + "overrides": { + "id": 12510, + "nodeType": "OverrideSpecifier", + "overrides": [], + "src": "10712:8:55" + }, + "parameters": { + "id": 12509, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 12508, + "mutability": "mutable", + "name": "disputeId", + "nameLocation": "10692:9:55", + "nodeType": "VariableDeclaration", + "scope": 12555, + "src": "10684:17:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 12507, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "10684:7:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "10683:19:55" + }, + "returnParameters": { + "id": 12517, + "nodeType": "ParameterList", + "parameters": [], + "src": "10776:0:55" + }, + "scope": 13542, + "src": "10661:517:55", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "baseFunctions": [ + 15208 + ], + "body": { + "id": 12568, + "nodeType": "Block", + "src": "11291:43:55", + "statements": [ + { + "expression": { + "arguments": [ + { + "id": 12565, + "name": "arbitrator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12558, + "src": "11316:10:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 12564, + "name": "_setArbitrator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13346, + "src": "11301:14:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$__$", + "typeString": "function (address)" + } + }, + "id": 12566, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "11301:26:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 12567, + "nodeType": "ExpressionStatement", + "src": "11301:26:55" + } + ] + }, + "documentation": { + "id": 12556, + "nodeType": "StructuredDocumentation", + "src": "11184:31:55", + "text": "@inheritdoc IDisputeManager" + }, + "functionSelector": "b0eefabe", + "id": 12569, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "id": 12562, + "kind": "modifierInvocation", + "modifierName": { + "id": 12561, + "name": "onlyOwner", + "nameLocations": [ + "11281:9:55" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5018, + "src": "11281:9:55" + }, + "nodeType": "ModifierInvocation", + "src": "11281:9:55" + } + ], + "name": "setArbitrator", + "nameLocation": "11229:13:55", + "nodeType": "FunctionDefinition", + "overrides": { + "id": 12560, + "nodeType": "OverrideSpecifier", + "overrides": [], + "src": "11272:8:55" + }, + "parameters": { + "id": 12559, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 12558, + "mutability": "mutable", + "name": "arbitrator", + "nameLocation": "11251:10:55", + "nodeType": "VariableDeclaration", + "scope": 12569, + "src": "11243:18:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 12557, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "11243:7:55", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "11242:20:55" + }, + "returnParameters": { + "id": 12563, + "nodeType": "ParameterList", + "parameters": [], + "src": "11291:0:55" + }, + "scope": 13542, + "src": "11220:114:55", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "baseFunctions": [ + 15202 + ], + "body": { + "id": 12582, + "nodeType": "Block", + "src": "11452:49:55", + "statements": [ + { + "expression": { + "arguments": [ + { + "id": 12579, + "name": "disputePeriod", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12572, + "src": "11480:13:55", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + ], + "id": 12578, + "name": "_setDisputePeriod", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13369, + "src": "11462:17:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_uint64_$returns$__$", + "typeString": "function (uint64)" + } + }, + "id": 12580, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "11462:32:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 12581, + "nodeType": "ExpressionStatement", + "src": "11462:32:55" + } + ] + }, + "documentation": { + "id": 12570, + "nodeType": "StructuredDocumentation", + "src": "11340:31:55", + "text": "@inheritdoc IDisputeManager" + }, + "functionSelector": "d76f62d1", + "id": 12583, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "id": 12576, + "kind": "modifierInvocation", + "modifierName": { + "id": 12575, + "name": "onlyOwner", + "nameLocations": [ + "11442:9:55" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5018, + "src": "11442:9:55" + }, + "nodeType": "ModifierInvocation", + "src": "11442:9:55" + } + ], + "name": "setDisputePeriod", + "nameLocation": "11385:16:55", + "nodeType": "FunctionDefinition", + "overrides": { + "id": 12574, + "nodeType": "OverrideSpecifier", + "overrides": [], + "src": "11433:8:55" + }, + "parameters": { + "id": 12573, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 12572, + "mutability": "mutable", + "name": "disputePeriod", + "nameLocation": "11409:13:55", + "nodeType": "VariableDeclaration", + "scope": 12583, + "src": "11402:20:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + }, + "typeName": { + "id": 12571, + "name": "uint64", + "nodeType": "ElementaryTypeName", + "src": "11402:6:55", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "visibility": "internal" + } + ], + "src": "11401:22:55" + }, + "returnParameters": { + "id": 12577, + "nodeType": "ParameterList", + "parameters": [], + "src": "11452:0:55" + }, + "scope": 13542, + "src": "11376:125:55", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "baseFunctions": [ + 15214 + ], + "body": { + "id": 12596, + "nodeType": "Block", + "src": "11622:51:55", + "statements": [ + { + "expression": { + "arguments": [ + { + "id": 12593, + "name": "disputeDeposit", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12586, + "src": "11651:14:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 12592, + "name": "_setDisputeDeposit", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13393, + "src": "11632:18:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256)" + } + }, + "id": 12594, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "11632:34:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 12595, + "nodeType": "ExpressionStatement", + "src": "11632:34:55" + } + ] + }, + "documentation": { + "id": 12584, + "nodeType": "StructuredDocumentation", + "src": "11507:31:55", + "text": "@inheritdoc IDisputeManager" + }, + "functionSelector": "16972978", + "id": 12597, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "id": 12590, + "kind": "modifierInvocation", + "modifierName": { + "id": 12589, + "name": "onlyOwner", + "nameLocations": [ + "11612:9:55" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5018, + "src": "11612:9:55" + }, + "nodeType": "ModifierInvocation", + "src": "11612:9:55" + } + ], + "name": "setDisputeDeposit", + "nameLocation": "11552:17:55", + "nodeType": "FunctionDefinition", + "overrides": { + "id": 12588, + "nodeType": "OverrideSpecifier", + "overrides": [], + "src": "11603:8:55" + }, + "parameters": { + "id": 12587, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 12586, + "mutability": "mutable", + "name": "disputeDeposit", + "nameLocation": "11578:14:55", + "nodeType": "VariableDeclaration", + "scope": 12597, + "src": "11570:22:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 12585, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "11570:7:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "11569:24:55" + }, + "returnParameters": { + "id": 12591, + "nodeType": "ParameterList", + "parameters": [], + "src": "11622:0:55" + }, + "scope": 13542, + "src": "11543:130:55", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "baseFunctions": [ + 15220 + ], + "body": { + "id": 12610, + "nodeType": "Block", + "src": "11802:60:55", + "statements": [ + { + "expression": { + "arguments": [ + { + "id": 12607, + "name": "fishermanRewardCut_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12600, + "src": "11835:19:55", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + ], + "id": 12606, + "name": "_setFishermanRewardCut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13417, + "src": "11812:22:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_uint32_$returns$__$", + "typeString": "function (uint32)" + } + }, + "id": 12608, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "11812:43:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 12609, + "nodeType": "ExpressionStatement", + "src": "11812:43:55" + } + ] + }, + "documentation": { + "id": 12598, + "nodeType": "StructuredDocumentation", + "src": "11679:31:55", + "text": "@inheritdoc IDisputeManager" + }, + "functionSelector": "76c993ae", + "id": 12611, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "id": 12604, + "kind": "modifierInvocation", + "modifierName": { + "id": 12603, + "name": "onlyOwner", + "nameLocations": [ + "11792:9:55" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5018, + "src": "11792:9:55" + }, + "nodeType": "ModifierInvocation", + "src": "11792:9:55" + } + ], + "name": "setFishermanRewardCut", + "nameLocation": "11724:21:55", + "nodeType": "FunctionDefinition", + "overrides": { + "id": 12602, + "nodeType": "OverrideSpecifier", + "overrides": [], + "src": "11783:8:55" + }, + "parameters": { + "id": 12601, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 12600, + "mutability": "mutable", + "name": "fishermanRewardCut_", + "nameLocation": "11753:19:55", + "nodeType": "VariableDeclaration", + "scope": 12611, + "src": "11746:26:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 12599, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "11746:6:55", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + } + ], + "src": "11745:28:55" + }, + "returnParameters": { + "id": 12605, + "nodeType": "ParameterList", + "parameters": [], + "src": "11802:0:55" + }, + "scope": 13542, + "src": "11715:147:55", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "baseFunctions": [ + 15226 + ], + "body": { + "id": 12624, + "nodeType": "Block", + "src": "11983:52:55", + "statements": [ + { + "expression": { + "arguments": [ + { + "id": 12621, + "name": "maxSlashingCut_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12614, + "src": "12012:15:55", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + ], + "id": 12620, + "name": "_setMaxSlashingCut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13442, + "src": "11993:18:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_uint32_$returns$__$", + "typeString": "function (uint32)" + } + }, + "id": 12622, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "11993:35:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 12623, + "nodeType": "ExpressionStatement", + "src": "11993:35:55" + } + ] + }, + "documentation": { + "id": 12612, + "nodeType": "StructuredDocumentation", + "src": "11868:31:55", + "text": "@inheritdoc IDisputeManager" + }, + "functionSelector": "9f81a7cf", + "id": 12625, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "id": 12618, + "kind": "modifierInvocation", + "modifierName": { + "id": 12617, + "name": "onlyOwner", + "nameLocations": [ + "11973:9:55" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5018, + "src": "11973:9:55" + }, + "nodeType": "ModifierInvocation", + "src": "11973:9:55" + } + ], + "name": "setMaxSlashingCut", + "nameLocation": "11913:17:55", + "nodeType": "FunctionDefinition", + "overrides": { + "id": 12616, + "nodeType": "OverrideSpecifier", + "overrides": [], + "src": "11964:8:55" + }, + "parameters": { + "id": 12615, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 12614, + "mutability": "mutable", + "name": "maxSlashingCut_", + "nameLocation": "11938:15:55", + "nodeType": "VariableDeclaration", + "scope": 12625, + "src": "11931:22:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 12613, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "11931:6:55", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + } + ], + "src": "11930:24:55" + }, + "returnParameters": { + "id": 12619, + "nodeType": "ParameterList", + "parameters": [], + "src": "11983:0:55" + }, + "scope": 13542, + "src": "11904:131:55", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "baseFunctions": [ + 15232 + ], + "body": { + "id": 12638, + "nodeType": "Block", + "src": "12159:54:55", + "statements": [ + { + "expression": { + "arguments": [ + { + "id": 12635, + "name": "subgraphService_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12628, + "src": "12189:16:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 12634, + "name": "_setSubgraphService", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13470, + "src": "12169:19:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$__$", + "typeString": "function (address)" + } + }, + "id": 12636, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "12169:37:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 12637, + "nodeType": "ExpressionStatement", + "src": "12169:37:55" + } + ] + }, + "documentation": { + "id": 12626, + "nodeType": "StructuredDocumentation", + "src": "12041:31:55", + "text": "@inheritdoc IDisputeManager" + }, + "functionSelector": "93a90a1e", + "id": 12639, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "id": 12632, + "kind": "modifierInvocation", + "modifierName": { + "id": 12631, + "name": "onlyOwner", + "nameLocations": [ + "12149:9:55" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5018, + "src": "12149:9:55" + }, + "nodeType": "ModifierInvocation", + "src": "12149:9:55" + } + ], + "name": "setSubgraphService", + "nameLocation": "12086:18:55", + "nodeType": "FunctionDefinition", + "overrides": { + "id": 12630, + "nodeType": "OverrideSpecifier", + "overrides": [], + "src": "12140:8:55" + }, + "parameters": { + "id": 12629, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 12628, + "mutability": "mutable", + "name": "subgraphService_", + "nameLocation": "12113:16:55", + "nodeType": "VariableDeclaration", + "scope": 12639, + "src": "12105:24:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 12627, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "12105:7:55", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "12104:26:55" + }, + "returnParameters": { + "id": 12633, + "nodeType": "ParameterList", + "parameters": [], + "src": "12159:0:55" + }, + "scope": 13542, + "src": "12077:136:55", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "baseFunctions": [ + 15343 + ], + "body": { + "id": 12653, + "nodeType": "Block", + "src": "12357:47:55", + "statements": [ + { + "expression": { + "arguments": [ + { + "id": 12650, + "name": "receipt", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12643, + "src": "12389:7:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Receipt_$16044_calldata_ptr", + "typeString": "struct Attestation.Receipt calldata" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_struct$_Receipt_$16044_calldata_ptr", + "typeString": "struct Attestation.Receipt calldata" + } + ], + "id": 12649, + "name": "_encodeReceipt", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17554, + "src": "12374:14:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_struct$_Receipt_$16044_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (struct Attestation.Receipt memory) view returns (bytes32)" + } + }, + "id": 12651, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "12374:23:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "functionReturnParameters": 12648, + "id": 12652, + "nodeType": "Return", + "src": "12367:30:55" + } + ] + }, + "documentation": { + "id": 12640, + "nodeType": "StructuredDocumentation", + "src": "12219:31:55", + "text": "@inheritdoc IDisputeManager" + }, + "functionSelector": "6369df6b", + "id": 12654, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "encodeReceipt", + "nameLocation": "12264:13:55", + "nodeType": "FunctionDefinition", + "overrides": { + "id": 12645, + "nodeType": "OverrideSpecifier", + "overrides": [], + "src": "12330:8:55" + }, + "parameters": { + "id": 12644, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 12643, + "mutability": "mutable", + "name": "receipt", + "nameLocation": "12307:7:55", + "nodeType": "VariableDeclaration", + "scope": 12654, + "src": "12278:36:55", + "stateVariable": false, + "storageLocation": "calldata", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Receipt_$16044_calldata_ptr", + "typeString": "struct Attestation.Receipt" + }, + "typeName": { + "id": 12642, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 12641, + "name": "Attestation.Receipt", + "nameLocations": [ + "12278:11:55", + "12290:7:55" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 16044, + "src": "12278:19:55" + }, + "referencedDeclaration": 16044, + "src": "12278:19:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Receipt_$16044_storage_ptr", + "typeString": "struct Attestation.Receipt" + } + }, + "visibility": "internal" + } + ], + "src": "12277:38:55" + }, + "returnParameters": { + "id": 12648, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 12647, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 12654, + "src": "12348:7:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 12646, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "12348:7:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "12347:9:55" + }, + "scope": 13542, + "src": "12255:149:55", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "baseFunctions": [ + 15320 + ], + "body": { + "id": 12663, + "nodeType": "Block", + "src": "12519:42:55", + "statements": [ + { + "expression": { + "id": 12661, + "name": "fishermanRewardCut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13565, + "src": "12536:18:55", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "functionReturnParameters": 12660, + "id": 12662, + "nodeType": "Return", + "src": "12529:25:55" + } + ] + }, + "documentation": { + "id": 12655, + "nodeType": "StructuredDocumentation", + "src": "12410:31:55", + "text": "@inheritdoc IDisputeManager" + }, + "functionSelector": "bb2a2b47", + "id": 12664, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getFishermanRewardCut", + "nameLocation": "12455:21:55", + "nodeType": "FunctionDefinition", + "overrides": { + "id": 12657, + "nodeType": "OverrideSpecifier", + "overrides": [], + "src": "12493:8:55" + }, + "parameters": { + "id": 12656, + "nodeType": "ParameterList", + "parameters": [], + "src": "12476:2:55" + }, + "returnParameters": { + "id": 12660, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 12659, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 12664, + "src": "12511:6:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 12658, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "12511:6:55", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + } + ], + "src": "12510:8:55" + }, + "scope": 13542, + "src": "12446:115:55", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "baseFunctions": [ + 15326 + ], + "body": { + "id": 12673, + "nodeType": "Block", + "src": "12671:37:55", + "statements": [ + { + "expression": { + "id": 12671, + "name": "disputePeriod", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13559, + "src": "12688:13:55", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "functionReturnParameters": 12670, + "id": 12672, + "nodeType": "Return", + "src": "12681:20:55" + } + ] + }, + "documentation": { + "id": 12665, + "nodeType": "StructuredDocumentation", + "src": "12567:31:55", + "text": "@inheritdoc IDisputeManager" + }, + "functionSelector": "5aea0ec4", + "id": 12674, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getDisputePeriod", + "nameLocation": "12612:16:55", + "nodeType": "FunctionDefinition", + "overrides": { + "id": 12667, + "nodeType": "OverrideSpecifier", + "overrides": [], + "src": "12645:8:55" + }, + "parameters": { + "id": 12666, + "nodeType": "ParameterList", + "parameters": [], + "src": "12628:2:55" + }, + "returnParameters": { + "id": 12670, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 12669, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 12674, + "src": "12663:6:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + }, + "typeName": { + "id": 12668, + "name": "uint64", + "nodeType": "ElementaryTypeName", + "src": "12663:6:55", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "visibility": "internal" + } + ], + "src": "12662:8:55" + }, + "scope": 13542, + "src": "12603:105:55", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "baseFunctions": [ + 15360 + ], + "body": { + "id": 12705, + "nodeType": "Block", + "src": "12834:226:55", + "statements": [ + { + "assignments": [ + 12687 + ], + "declarations": [ + { + "constant": false, + "id": 12687, + "mutability": "mutable", + "name": "provision", + "nameLocation": "12877:9:55", + "nodeType": "VariableDeclaration", + "scope": 12705, + "src": "12844:42:55", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Provision_$3962_memory_ptr", + "typeString": "struct IHorizonStakingTypes.Provision" + }, + "typeName": { + "id": 12686, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 12685, + "name": "IHorizonStaking.Provision", + "nameLocations": [ + "12844:15:55", + "12860:9:55" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 3962, + "src": "12844:25:55" + }, + "referencedDeclaration": 3962, + "src": "12844:25:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Provision_$3962_storage_ptr", + "typeString": "struct IHorizonStakingTypes.Provision" + } + }, + "visibility": "internal" + } + ], + "id": 12698, + "initialValue": { + "arguments": [ + { + "id": 12691, + "name": "indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12677, + "src": "12931:7:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "arguments": [ + { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 12694, + "name": "_getSubgraphService", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13494, + "src": "12960:19:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_contract$_ISubgraphService_$15634_$", + "typeString": "function () view returns (contract ISubgraphService)" + } + }, + "id": 12695, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "12960:21:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_ISubgraphService_$15634", + "typeString": "contract ISubgraphService" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_ISubgraphService_$15634", + "typeString": "contract ISubgraphService" + } + ], + "id": 12693, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "12952:7:55", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 12692, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "12952:7:55", + "typeDescriptions": {} + } + }, + "id": 12696, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "12952:30:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "expression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 12688, + "name": "_graphStaking", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4815, + "src": "12889:13:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_contract$_IHorizonStaking_$2625_$", + "typeString": "function () view returns (contract IHorizonStaking)" + } + }, + "id": 12689, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "12889:15:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_IHorizonStaking_$2625", + "typeString": "contract IHorizonStaking" + } + }, + "id": 12690, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "12905:12:55", + "memberName": "getProvision", + "nodeType": "MemberAccess", + "referencedDeclaration": 2950, + "src": "12889:28:55", + "typeDescriptions": { + "typeIdentifier": "t_function_external_view$_t_address_$_t_address_$returns$_t_struct$_Provision_$3962_memory_ptr_$", + "typeString": "function (address,address) view external returns (struct IHorizonStakingTypes.Provision memory)" + } + }, + "id": 12697, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "12889:103:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_Provision_$3962_memory_ptr", + "typeString": "struct IHorizonStakingTypes.Provision memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "12844:148:55" + }, + { + "expression": { + "arguments": [ + { + "id": 12700, + "name": "indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12677, + "src": "13027:7:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "expression": { + "id": 12701, + "name": "provision", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12687, + "src": "13036:9:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Provision_$3962_memory_ptr", + "typeString": "struct IHorizonStakingTypes.Provision memory" + } + }, + "id": 12702, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "13046:6:55", + "memberName": "tokens", + "nodeType": "MemberAccess", + "referencedDeclaration": 3943, + "src": "13036:16:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 12699, + "name": "_getStakeSnapshot", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13541, + "src": "13009:17:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_address_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (address,uint256) view returns (uint256)" + } + }, + "id": 12703, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "13009:44:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 12682, + "id": 12704, + "nodeType": "Return", + "src": "13002:51:55" + } + ] + }, + "documentation": { + "id": 12675, + "nodeType": "StructuredDocumentation", + "src": "12714:31:55", + "text": "@inheritdoc IDisputeManager" + }, + "functionSelector": "c133b429", + "id": 12706, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getStakeSnapshot", + "nameLocation": "12759:16:55", + "nodeType": "FunctionDefinition", + "overrides": { + "id": 12679, + "nodeType": "OverrideSpecifier", + "overrides": [], + "src": "12807:8:55" + }, + "parameters": { + "id": 12678, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 12677, + "mutability": "mutable", + "name": "indexer", + "nameLocation": "12784:7:55", + "nodeType": "VariableDeclaration", + "scope": 12706, + "src": "12776:15:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 12676, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "12776:7:55", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "12775:17:55" + }, + "returnParameters": { + "id": 12682, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 12681, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 12706, + "src": "12825:7:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 12680, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "12825:7:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "12824:9:55" + }, + "scope": 13542, + "src": "12750:310:55", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "baseFunctions": [ + 15372 + ], + "body": { + "id": 12725, + "nodeType": "Block", + "src": "13280:78:55", + "statements": [ + { + "expression": { + "arguments": [ + { + "id": 12721, + "name": "attestation1", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12710, + "src": "13324:12:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16058_calldata_ptr", + "typeString": "struct Attestation.State calldata" + } + }, + { + "id": 12722, + "name": "attestation2", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12713, + "src": "13338:12:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16058_calldata_ptr", + "typeString": "struct Attestation.State calldata" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_struct$_State_$16058_calldata_ptr", + "typeString": "struct Attestation.State calldata" + }, + { + "typeIdentifier": "t_struct$_State_$16058_calldata_ptr", + "typeString": "struct Attestation.State calldata" + } + ], + "expression": { + "id": 12719, + "name": "Attestation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16290, + "src": "13297:11:55", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_Attestation_$16290_$", + "typeString": "type(library Attestation)" + } + }, + "id": 12720, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "13309:14:55", + "memberName": "areConflicting", + "nodeType": "MemberAccess", + "referencedDeclaration": 16153, + "src": "13297:26:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_struct$_State_$16058_memory_ptr_$_t_struct$_State_$16058_memory_ptr_$returns$_t_bool_$", + "typeString": "function (struct Attestation.State memory,struct Attestation.State memory) pure returns (bool)" + } + }, + "id": 12723, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "13297:54:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "functionReturnParameters": 12718, + "id": 12724, + "nodeType": "Return", + "src": "13290:61:55" + } + ] + }, + "documentation": { + "id": 12707, + "nodeType": "StructuredDocumentation", + "src": "13066:31:55", + "text": "@inheritdoc IDisputeManager" + }, + "functionSelector": "d36fc9d4", + "id": 12726, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "areConflictingAttestations", + "nameLocation": "13111:26:55", + "nodeType": "FunctionDefinition", + "overrides": { + "id": 12715, + "nodeType": "OverrideSpecifier", + "overrides": [], + "src": "13256:8:55" + }, + "parameters": { + "id": 12714, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 12710, + "mutability": "mutable", + "name": "attestation1", + "nameLocation": "13174:12:55", + "nodeType": "VariableDeclaration", + "scope": 12726, + "src": "13147:39:55", + "stateVariable": false, + "storageLocation": "calldata", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16058_calldata_ptr", + "typeString": "struct Attestation.State" + }, + "typeName": { + "id": 12709, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 12708, + "name": "Attestation.State", + "nameLocations": [ + "13147:11:55", + "13159:5:55" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 16058, + "src": "13147:17:55" + }, + "referencedDeclaration": 16058, + "src": "13147:17:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16058_storage_ptr", + "typeString": "struct Attestation.State" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 12713, + "mutability": "mutable", + "name": "attestation2", + "nameLocation": "13223:12:55", + "nodeType": "VariableDeclaration", + "scope": 12726, + "src": "13196:39:55", + "stateVariable": false, + "storageLocation": "calldata", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16058_calldata_ptr", + "typeString": "struct Attestation.State" + }, + "typeName": { + "id": 12712, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 12711, + "name": "Attestation.State", + "nameLocations": [ + "13196:11:55", + "13208:5:55" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 16058, + "src": "13196:17:55" + }, + "referencedDeclaration": 16058, + "src": "13196:17:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16058_storage_ptr", + "typeString": "struct Attestation.State" + } + }, + "visibility": "internal" + } + ], + "src": "13137:104:55" + }, + "returnParameters": { + "id": 12718, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 12717, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 12726, + "src": "13274:4:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 12716, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "13274:4:55", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "src": "13273:6:55" + }, + "scope": 13542, + "src": "13102:256:55", + "stateMutability": "pure", + "virtual": false, + "visibility": "external" + }, + { + "baseFunctions": [ + 15352 + ], + "body": { + "id": 12782, + "nodeType": "Block", + "src": "13499:574:55", + "statements": [ + { + "assignments": [ + 12736 + ], + "declarations": [ + { + "constant": false, + "id": 12736, + "mutability": "mutable", + "name": "allocationId", + "nameLocation": "13589:12:55", + "nodeType": "VariableDeclaration", + "scope": 12782, + "src": "13581:20:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 12735, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "13581:7:55", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "id": 12740, + "initialValue": { + "arguments": [ + { + "id": 12738, + "name": "attestation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12730, + "src": "13619:11:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16058_memory_ptr", + "typeString": "struct Attestation.State memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_struct$_State_$16058_memory_ptr", + "typeString": "struct Attestation.State memory" + } + ], + "id": 12737, + "name": "_recoverSigner", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17524, + "src": "13604:14:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_struct$_State_$16058_memory_ptr_$returns$_t_address_$", + "typeString": "function (struct Attestation.State memory) view returns (address)" + } + }, + "id": 12739, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "13604:27:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "13581:50:55" + }, + { + "assignments": [ + 12745 + ], + "declarations": [ + { + "constant": false, + "id": 12745, + "mutability": "mutable", + "name": "alloc", + "nameLocation": "13666:5:55", + "nodeType": "VariableDeclaration", + "scope": 12782, + "src": "13642:29:55", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State" + }, + "typeName": { + "id": 12744, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 12743, + "name": "Allocation.State", + "nameLocations": [ + "13642:10:55", + "13653:5:55" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 15663, + "src": "13642:16:55" + }, + "referencedDeclaration": 15663, + "src": "13642:16:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_storage_ptr", + "typeString": "struct Allocation.State" + } + }, + "visibility": "internal" + } + ], + "id": 12751, + "initialValue": { + "arguments": [ + { + "id": 12749, + "name": "allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12736, + "src": "13710:12:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "expression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 12746, + "name": "_getSubgraphService", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13494, + "src": "13674:19:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_contract$_ISubgraphService_$15634_$", + "typeString": "function () view returns (contract ISubgraphService)" + } + }, + "id": 12747, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "13674:21:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_ISubgraphService_$15634", + "typeString": "contract ISubgraphService" + } + }, + "id": 12748, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "13696:13:55", + "memberName": "getAllocation", + "nodeType": "MemberAccess", + "referencedDeclaration": 15588, + "src": "13674:35:55", + "typeDescriptions": { + "typeIdentifier": "t_function_external_view$_t_address_$returns$_t_struct$_State_$15663_memory_ptr_$", + "typeString": "function (address) view external returns (struct Allocation.State memory)" + } + }, + "id": 12750, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "13674:49:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "13642:81:55" + }, + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 12759, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 12753, + "name": "alloc", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12745, + "src": "13741:5:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "id": 12754, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "13747:7:55", + "memberName": "indexer", + "nodeType": "MemberAccess", + "referencedDeclaration": 15646, + "src": "13741:13:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "arguments": [ + { + "hexValue": "30", + "id": 12757, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13766:1:55", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 12756, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "13758:7:55", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 12755, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "13758:7:55", + "typeDescriptions": {} + } + }, + "id": 12758, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "13758:10:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "13741:27:55", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [ + { + "id": 12761, + "name": "allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12736, + "src": "13800:12:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 12760, + "name": "DisputeManagerIndexerNotFound", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15155, + "src": "13770:29:55", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_address_$returns$_t_error_$", + "typeString": "function (address) pure returns (error)" + } + }, + "id": 12762, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "13770:43:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 12752, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "13733:7:55", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 12763, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "13733:81:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 12764, + "nodeType": "ExpressionStatement", + "src": "13733:81:55" + }, + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "id": 12770, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 12766, + "name": "alloc", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12745, + "src": "13845:5:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "id": 12767, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "13851:20:55", + "memberName": "subgraphDeploymentId", + "nodeType": "MemberAccess", + "referencedDeclaration": 15648, + "src": "13845:26:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "expression": { + "id": 12768, + "name": "attestation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12730, + "src": "13875:11:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16058_memory_ptr", + "typeString": "struct Attestation.State memory" + } + }, + "id": 12769, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "13887:20:55", + "memberName": "subgraphDeploymentId", + "nodeType": "MemberAccess", + "referencedDeclaration": 16051, + "src": "13875:32:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "src": "13845:62:55", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [ + { + "expression": { + "id": 12772, + "name": "alloc", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12745, + "src": "13965:5:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "id": 12773, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "13971:20:55", + "memberName": "subgraphDeploymentId", + "nodeType": "MemberAccess", + "referencedDeclaration": 15648, + "src": "13965:26:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "expression": { + "id": 12774, + "name": "attestation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12730, + "src": "13993:11:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16058_memory_ptr", + "typeString": "struct Attestation.State memory" + } + }, + "id": 12775, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "14005:20:55", + "memberName": "subgraphDeploymentId", + "nodeType": "MemberAccess", + "referencedDeclaration": 16051, + "src": "13993:32:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 12771, + "name": "DisputeManagerNonMatchingSubgraphDeployment", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15162, + "src": "13921:43:55", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_bytes32_$_t_bytes32_$returns$_t_error_$", + "typeString": "function (bytes32,bytes32) pure returns (error)" + } + }, + "id": 12776, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "13921:105:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 12765, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "13824:7:55", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 12777, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "13824:212:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 12778, + "nodeType": "ExpressionStatement", + "src": "13824:212:55" + }, + { + "expression": { + "expression": { + "id": 12779, + "name": "alloc", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12745, + "src": "14053:5:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "id": 12780, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "14059:7:55", + "memberName": "indexer", + "nodeType": "MemberAccess", + "referencedDeclaration": 15646, + "src": "14053:13:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "functionReturnParameters": 12734, + "id": 12781, + "nodeType": "Return", + "src": "14046:20:55" + } + ] + }, + "documentation": { + "id": 12727, + "nodeType": "StructuredDocumentation", + "src": "13364:31:55", + "text": "@inheritdoc IDisputeManager" + }, + "functionSelector": "c9747f51", + "id": 12783, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getAttestationIndexer", + "nameLocation": "13409:21:55", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 12731, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 12730, + "mutability": "mutable", + "name": "attestation", + "nameLocation": "13456:11:55", + "nodeType": "VariableDeclaration", + "scope": 12783, + "src": "13431:36:55", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16058_memory_ptr", + "typeString": "struct Attestation.State" + }, + "typeName": { + "id": 12729, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 12728, + "name": "Attestation.State", + "nameLocations": [ + "13431:11:55", + "13443:5:55" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 16058, + "src": "13431:17:55" + }, + "referencedDeclaration": 16058, + "src": "13431:17:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16058_storage_ptr", + "typeString": "struct Attestation.State" + } + }, + "visibility": "internal" + } + ], + "src": "13430:38:55" + }, + "returnParameters": { + "id": 12734, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 12733, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 12783, + "src": "13490:7:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 12732, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "13490:7:55", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "13489:9:55" + }, + "scope": 13542, + "src": "13400:673:55", + "stateMutability": "view", + "virtual": false, + "visibility": "public" + }, + { + "baseFunctions": [ + 15334 + ], + "body": { + "id": 12800, + "nodeType": "Block", + "src": "14196:72:55", + "statements": [ + { + "expression": { + "commonType": { + "typeIdentifier": "t_enum$_DisputeStatus_$14921", + "typeString": "enum IDisputeManager.DisputeStatus" + }, + "id": 12798, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "baseExpression": { + "id": 12792, + "name": "disputes", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13574, + "src": "14213:8:55", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Dispute_$14943_storage_$", + "typeString": "mapping(bytes32 => struct IDisputeManager.Dispute storage ref)" + } + }, + "id": 12794, + "indexExpression": { + "id": 12793, + "name": "disputeId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12786, + "src": "14222:9:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "14213:19:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage", + "typeString": "struct IDisputeManager.Dispute storage ref" + } + }, + "id": 12795, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "14233:6:55", + "memberName": "status", + "nodeType": "MemberAccess", + "referencedDeclaration": 14936, + "src": "14213:26:55", + "typeDescriptions": { + "typeIdentifier": "t_enum$_DisputeStatus_$14921", + "typeString": "enum IDisputeManager.DisputeStatus" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "expression": { + "id": 12796, + "name": "DisputeStatus", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14921, + "src": "14243:13:55", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_DisputeStatus_$14921_$", + "typeString": "type(enum IDisputeManager.DisputeStatus)" + } + }, + "id": 12797, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "14257:4:55", + "memberName": "Null", + "nodeType": "MemberAccess", + "referencedDeclaration": 14915, + "src": "14243:18:55", + "typeDescriptions": { + "typeIdentifier": "t_enum$_DisputeStatus_$14921", + "typeString": "enum IDisputeManager.DisputeStatus" + } + }, + "src": "14213:48:55", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "functionReturnParameters": 12791, + "id": 12799, + "nodeType": "Return", + "src": "14206:55:55" + } + ] + }, + "documentation": { + "id": 12784, + "nodeType": "StructuredDocumentation", + "src": "14079:31:55", + "text": "@inheritdoc IDisputeManager" + }, + "functionSelector": "be41f384", + "id": 12801, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "isDisputeCreated", + "nameLocation": "14124:16:55", + "nodeType": "FunctionDefinition", + "overrides": { + "id": 12788, + "nodeType": "OverrideSpecifier", + "overrides": [], + "src": "14172:8:55" + }, + "parameters": { + "id": 12787, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 12786, + "mutability": "mutable", + "name": "disputeId", + "nameLocation": "14149:9:55", + "nodeType": "VariableDeclaration", + "scope": 12801, + "src": "14141:17:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 12785, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "14141:7:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "14140:19:55" + }, + "returnParameters": { + "id": 12791, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 12790, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 12801, + "src": "14190:4:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 12789, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "14190:4:55", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "src": "14189:6:55" + }, + "scope": 13542, + "src": "14115:153:55", + "stateMutability": "view", + "virtual": false, + "visibility": "public" + }, + { + "body": { + "id": 12922, + "nodeType": "Block", + "src": "15030:1622:55", + "statements": [ + { + "assignments": [ + 12817 + ], + "declarations": [ + { + "constant": false, + "id": 12817, + "mutability": "mutable", + "name": "indexer", + "nameLocation": "15103:7:55", + "nodeType": "VariableDeclaration", + "scope": 12922, + "src": "15095:15:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 12816, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "15095:7:55", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "id": 12821, + "initialValue": { + "arguments": [ + { + "id": 12819, + "name": "_attestation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12809, + "src": "15135:12:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16058_memory_ptr", + "typeString": "struct Attestation.State memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_struct$_State_$16058_memory_ptr", + "typeString": "struct Attestation.State memory" + } + ], + "id": 12818, + "name": "getAttestationIndexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12783, + "src": "15113:21:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_struct$_State_$16058_memory_ptr_$returns$_t_address_$", + "typeString": "function (struct Attestation.State memory) view returns (address)" + } + }, + "id": 12820, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "15113:35:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "15095:53:55" + }, + { + "assignments": [ + 12826 + ], + "declarations": [ + { + "constant": false, + "id": 12826, + "mutability": "mutable", + "name": "provision", + "nameLocation": "15229:9:55", + "nodeType": "VariableDeclaration", + "scope": 12922, + "src": "15196:42:55", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Provision_$3962_memory_ptr", + "typeString": "struct IHorizonStakingTypes.Provision" + }, + "typeName": { + "id": 12825, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 12824, + "name": "IHorizonStaking.Provision", + "nameLocations": [ + "15196:15:55", + "15212:9:55" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 3962, + "src": "15196:25:55" + }, + "referencedDeclaration": 3962, + "src": "15196:25:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Provision_$3962_storage_ptr", + "typeString": "struct IHorizonStakingTypes.Provision" + } + }, + "visibility": "internal" + } + ], + "id": 12837, + "initialValue": { + "arguments": [ + { + "id": 12830, + "name": "indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12817, + "src": "15283:7:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "arguments": [ + { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 12833, + "name": "_getSubgraphService", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13494, + "src": "15312:19:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_contract$_ISubgraphService_$15634_$", + "typeString": "function () view returns (contract ISubgraphService)" + } + }, + "id": 12834, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "15312:21:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_ISubgraphService_$15634", + "typeString": "contract ISubgraphService" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_ISubgraphService_$15634", + "typeString": "contract ISubgraphService" + } + ], + "id": 12832, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "15304:7:55", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 12831, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "15304:7:55", + "typeDescriptions": {} + } + }, + "id": 12835, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "15304:30:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "expression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 12827, + "name": "_graphStaking", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4815, + "src": "15241:13:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_contract$_IHorizonStaking_$2625_$", + "typeString": "function () view returns (contract IHorizonStaking)" + } + }, + "id": 12828, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "15241:15:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_IHorizonStaking_$2625", + "typeString": "contract IHorizonStaking" + } + }, + "id": 12829, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "15257:12:55", + "memberName": "getProvision", + "nodeType": "MemberAccess", + "referencedDeclaration": 2950, + "src": "15241:28:55", + "typeDescriptions": { + "typeIdentifier": "t_function_external_view$_t_address_$_t_address_$returns$_t_struct$_Provision_$3962_memory_ptr_$", + "typeString": "function (address,address) view external returns (struct IHorizonStakingTypes.Provision memory)" + } + }, + "id": 12836, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "15241:103:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_Provision_$3962_memory_ptr", + "typeString": "struct IHorizonStakingTypes.Provision memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "15196:148:55" + }, + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 12842, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 12839, + "name": "provision", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12826, + "src": "15362:9:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Provision_$3962_memory_ptr", + "typeString": "struct IHorizonStakingTypes.Provision memory" + } + }, + "id": 12840, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "15372:6:55", + "memberName": "tokens", + "nodeType": "MemberAccess", + "referencedDeclaration": 3943, + "src": "15362:16:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "hexValue": "30", + "id": 12841, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "15382:1:55", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "15362:21:55", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 12843, + "name": "DisputeManagerZeroTokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15092, + "src": "15385:24:55", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$__$returns$_t_error_$", + "typeString": "function () pure returns (error)" + } + }, + "id": 12844, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "15385:26:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 12838, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "15354:7:55", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 12845, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "15354:58:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 12846, + "nodeType": "ExpressionStatement", + "src": "15354:58:55" + }, + { + "assignments": [ + 12848 + ], + "declarations": [ + { + "constant": false, + "id": 12848, + "mutability": "mutable", + "name": "disputeId", + "nameLocation": "15461:9:55", + "nodeType": "VariableDeclaration", + "scope": 12922, + "src": "15453:17:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 12847, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "15453:7:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "id": 12862, + "initialValue": { + "arguments": [ + { + "arguments": [ + { + "expression": { + "id": 12852, + "name": "_attestation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12809, + "src": "15530:12:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16058_memory_ptr", + "typeString": "struct Attestation.State memory" + } + }, + "id": 12853, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "15543:10:55", + "memberName": "requestCID", + "nodeType": "MemberAccess", + "referencedDeclaration": 16047, + "src": "15530:23:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "expression": { + "id": 12854, + "name": "_attestation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12809, + "src": "15571:12:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16058_memory_ptr", + "typeString": "struct Attestation.State memory" + } + }, + "id": 12855, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "15584:11:55", + "memberName": "responseCID", + "nodeType": "MemberAccess", + "referencedDeclaration": 16049, + "src": "15571:24:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "expression": { + "id": 12856, + "name": "_attestation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12809, + "src": "15613:12:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16058_memory_ptr", + "typeString": "struct Attestation.State memory" + } + }, + "id": 12857, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "15626:20:55", + "memberName": "subgraphDeploymentId", + "nodeType": "MemberAccess", + "referencedDeclaration": 16051, + "src": "15613:33:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "id": 12858, + "name": "indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12817, + "src": "15664:7:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 12859, + "name": "_fisherman", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12804, + "src": "15689:10:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "expression": { + "id": 12850, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -1, + "src": "15496:3:55", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 12851, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "15500:12:55", + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "src": "15496:16:55", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 12860, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "15496:217:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 12849, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -8, + "src": "15473:9:55", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 12861, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "15473:250:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "15453:270:55" + }, + { + "expression": { + "arguments": [ + { + "id": 12867, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "15780:28:55", + "subExpression": { + "arguments": [ + { + "id": 12865, + "name": "disputeId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12848, + "src": "15798:9:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 12864, + "name": "isDisputeCreated", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12801, + "src": "15781:16:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_bool_$", + "typeString": "function (bytes32) view returns (bool)" + } + }, + "id": 12866, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "15781:27:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [ + { + "id": 12869, + "name": "disputeId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12848, + "src": "15846:9:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 12868, + "name": "DisputeManagerDisputeAlreadyCreated", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15130, + "src": "15810:35:55", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_bytes32_$returns$_t_error_$", + "typeString": "function (bytes32) pure returns (error)" + } + }, + "id": 12870, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "15810:46:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 12863, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "15772:7:55", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 12871, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "15772:85:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 12872, + "nodeType": "ExpressionStatement", + "src": "15772:85:55" + }, + { + "assignments": [ + 12874 + ], + "declarations": [ + { + "constant": false, + "id": 12874, + "mutability": "mutable", + "name": "stakeSnapshot", + "nameLocation": "15901:13:55", + "nodeType": "VariableDeclaration", + "scope": 12922, + "src": "15893:21:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 12873, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "15893:7:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 12880, + "initialValue": { + "arguments": [ + { + "id": 12876, + "name": "indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12817, + "src": "15935:7:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "expression": { + "id": 12877, + "name": "provision", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12826, + "src": "15944:9:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Provision_$3962_memory_ptr", + "typeString": "struct IHorizonStakingTypes.Provision memory" + } + }, + "id": 12878, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "15954:6:55", + "memberName": "tokens", + "nodeType": "MemberAccess", + "referencedDeclaration": 3943, + "src": "15944:16:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 12875, + "name": "_getStakeSnapshot", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13541, + "src": "15917:17:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_address_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (address,uint256) view returns (uint256)" + } + }, + "id": 12879, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "15917:44:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "15893:68:55" + }, + { + "assignments": [ + 12882 + ], + "declarations": [ + { + "constant": false, + "id": 12882, + "mutability": "mutable", + "name": "cancellableAt", + "nameLocation": "15979:13:55", + "nodeType": "VariableDeclaration", + "scope": 12922, + "src": "15971:21:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 12881, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "15971:7:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 12887, + "initialValue": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 12886, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 12883, + "name": "block", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -4, + "src": "15995:5:55", + "typeDescriptions": { + "typeIdentifier": "t_magic_block", + "typeString": "block" + } + }, + "id": 12884, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "16001:9:55", + "memberName": "timestamp", + "nodeType": "MemberAccess", + "src": "15995:15:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "id": 12885, + "name": "disputePeriod", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13559, + "src": "16013:13:55", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "src": "15995:31:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "15971:55:55" + }, + { + "expression": { + "id": 12906, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "baseExpression": { + "id": 12888, + "name": "disputes", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13574, + "src": "16036:8:55", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Dispute_$14943_storage_$", + "typeString": "mapping(bytes32 => struct IDisputeManager.Dispute storage ref)" + } + }, + "id": 12890, + "indexExpression": { + "id": 12889, + "name": "disputeId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12848, + "src": "16045:9:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "16036:19:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage", + "typeString": "struct IDisputeManager.Dispute storage ref" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "id": 12892, + "name": "indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12817, + "src": "16079:7:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 12893, + "name": "_fisherman", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12804, + "src": "16100:10:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 12894, + "name": "_deposit", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12806, + "src": "16124:8:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "hexValue": "30", + "id": 12895, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "16146:1:55", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + { + "expression": { + "id": 12896, + "name": "DisputeType", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14913, + "src": "16184:11:55", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_DisputeType_$14913_$", + "typeString": "type(enum IDisputeManager.DisputeType)" + } + }, + "id": 12897, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "16196:12:55", + "memberName": "QueryDispute", + "nodeType": "MemberAccess", + "referencedDeclaration": 14911, + "src": "16184:24:55", + "typeDescriptions": { + "typeIdentifier": "t_enum$_DisputeType_$14913", + "typeString": "enum IDisputeManager.DisputeType" + } + }, + { + "expression": { + "expression": { + "id": 12898, + "name": "IDisputeManager", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15373, + "src": "16222:15:55", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_IDisputeManager_$15373_$", + "typeString": "type(contract IDisputeManager)" + } + }, + "id": 12899, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "16238:13:55", + "memberName": "DisputeStatus", + "nodeType": "MemberAccess", + "referencedDeclaration": 14921, + "src": "16222:29:55", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_DisputeStatus_$14921_$", + "typeString": "type(enum IDisputeManager.DisputeStatus)" + } + }, + "id": 12900, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "16252:7:55", + "memberName": "Pending", + "nodeType": "MemberAccess", + "referencedDeclaration": 14919, + "src": "16222:37:55", + "typeDescriptions": { + "typeIdentifier": "t_enum$_DisputeStatus_$14921", + "typeString": "enum IDisputeManager.DisputeStatus" + } + }, + { + "expression": { + "id": 12901, + "name": "block", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -4, + "src": "16273:5:55", + "typeDescriptions": { + "typeIdentifier": "t_magic_block", + "typeString": "block" + } + }, + "id": 12902, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "16279:9:55", + "memberName": "timestamp", + "nodeType": "MemberAccess", + "src": "16273:15:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 12903, + "name": "cancellableAt", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12882, + "src": "16302:13:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 12904, + "name": "stakeSnapshot", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12874, + "src": "16329:13:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + { + "typeIdentifier": "t_enum$_DisputeType_$14913", + "typeString": "enum IDisputeManager.DisputeType" + }, + { + "typeIdentifier": "t_enum$_DisputeStatus_$14921", + "typeString": "enum IDisputeManager.DisputeStatus" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 12891, + "name": "Dispute", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14943, + "src": "16058:7:55", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_struct$_Dispute_$14943_storage_ptr_$", + "typeString": "type(struct IDisputeManager.Dispute storage pointer)" + } + }, + "id": 12905, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "structConstructorCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "16058:294:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_memory_ptr", + "typeString": "struct IDisputeManager.Dispute memory" + } + }, + "src": "16036:316:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage", + "typeString": "struct IDisputeManager.Dispute storage ref" + } + }, + "id": 12907, + "nodeType": "ExpressionStatement", + "src": "16036:316:55" + }, + { + "eventCall": { + "arguments": [ + { + "id": 12909, + "name": "disputeId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12848, + "src": "16401:9:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "id": 12910, + "name": "indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12817, + "src": "16424:7:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 12911, + "name": "_fisherman", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12804, + "src": "16445:10:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 12912, + "name": "_deposit", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12806, + "src": "16469:8:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "expression": { + "id": 12913, + "name": "_attestation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12809, + "src": "16491:12:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16058_memory_ptr", + "typeString": "struct Attestation.State memory" + } + }, + "id": 12914, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "16504:20:55", + "memberName": "subgraphDeploymentId", + "nodeType": "MemberAccess", + "referencedDeclaration": 16051, + "src": "16491:33:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "id": 12915, + "name": "_attestationData", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12811, + "src": "16538:16:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + { + "id": 12916, + "name": "cancellableAt", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12882, + "src": "16568:13:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 12917, + "name": "stakeSnapshot", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12874, + "src": "16595:13:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 12908, + "name": "QueryDisputeCreated", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14992, + "src": "16368:19:55", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_bytes32_$_t_address_$_t_address_$_t_uint256_$_t_bytes32_$_t_bytes_memory_ptr_$_t_uint256_$_t_uint256_$returns$__$", + "typeString": "function (bytes32,address,address,uint256,bytes32,bytes memory,uint256,uint256)" + } + }, + "id": 12918, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "16368:250:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 12919, + "nodeType": "EmitStatement", + "src": "16363:255:55" + }, + { + "expression": { + "id": 12920, + "name": "disputeId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12848, + "src": "16636:9:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "functionReturnParameters": 12815, + "id": 12921, + "nodeType": "Return", + "src": "16629:16:55" + } + ] + }, + "documentation": { + "id": 12802, + "nodeType": "StructuredDocumentation", + "src": "14274:535:55", + "text": " @notice Create a query dispute passing the parsed attestation.\n To be used in createQueryDispute() and createQueryDisputeConflict()\n to avoid calling parseAttestation() multiple times\n `attestationData` is only passed to be emitted\n @param _fisherman Creator of dispute\n @param _deposit Amount of tokens staked as deposit\n @param _attestation Attestation struct parsed from bytes\n @param _attestationData Attestation bytes submitted by the fisherman\n @return DisputeId" + }, + "id": 12923, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_createQueryDisputeWithAttestation", + "nameLocation": "14823:34:55", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 12812, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 12804, + "mutability": "mutable", + "name": "_fisherman", + "nameLocation": "14875:10:55", + "nodeType": "VariableDeclaration", + "scope": 12923, + "src": "14867:18:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 12803, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "14867:7:55", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 12806, + "mutability": "mutable", + "name": "_deposit", + "nameLocation": "14903:8:55", + "nodeType": "VariableDeclaration", + "scope": 12923, + "src": "14895:16:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 12805, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "14895:7:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 12809, + "mutability": "mutable", + "name": "_attestation", + "nameLocation": "14946:12:55", + "nodeType": "VariableDeclaration", + "scope": 12923, + "src": "14921:37:55", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16058_memory_ptr", + "typeString": "struct Attestation.State" + }, + "typeName": { + "id": 12808, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 12807, + "name": "Attestation.State", + "nameLocations": [ + "14921:11:55", + "14933:5:55" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 16058, + "src": "14921:17:55" + }, + "referencedDeclaration": 16058, + "src": "14921:17:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16058_storage_ptr", + "typeString": "struct Attestation.State" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 12811, + "mutability": "mutable", + "name": "_attestationData", + "nameLocation": "14981:16:55", + "nodeType": "VariableDeclaration", + "scope": 12923, + "src": "14968:29:55", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 12810, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "14968:5:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "src": "14857:146:55" + }, + "returnParameters": { + "id": 12815, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 12814, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 12923, + "src": "15021:7:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 12813, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "15021:7:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "15020:9:55" + }, + "scope": 13542, + "src": "14814:1838:55", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "private" + }, + { + "body": { + "id": 13064, + "nodeType": "Block", + "src": "17155:1565:55", + "statements": [ + { + "assignments": [ + 12938 + ], + "declarations": [ + { + "constant": false, + "id": 12938, + "mutability": "mutable", + "name": "disputeId", + "nameLocation": "17203:9:55", + "nodeType": "VariableDeclaration", + "scope": 13064, + "src": "17195:17:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 12937, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "17195:7:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "id": 12946, + "initialValue": { + "arguments": [ + { + "arguments": [ + { + "id": 12942, + "name": "_allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12930, + "src": "17242:13:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 12943, + "name": "_poi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12932, + "src": "17257:4:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "expression": { + "id": 12940, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -1, + "src": "17225:3:55", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 12941, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "17229:12:55", + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "src": "17225:16:55", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 12944, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "17225:37:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 12939, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -8, + "src": "17215:9:55", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 12945, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "17215:48:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "17195:68:55" + }, + { + "expression": { + "arguments": [ + { + "id": 12951, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "17340:28:55", + "subExpression": { + "arguments": [ + { + "id": 12949, + "name": "disputeId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12938, + "src": "17358:9:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 12948, + "name": "isDisputeCreated", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12801, + "src": "17341:16:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_bool_$", + "typeString": "function (bytes32) view returns (bool)" + } + }, + "id": 12950, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "17341:27:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [ + { + "id": 12953, + "name": "disputeId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12938, + "src": "17406:9:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 12952, + "name": "DisputeManagerDisputeAlreadyCreated", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15130, + "src": "17370:35:55", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_bytes32_$returns$_t_error_$", + "typeString": "function (bytes32) pure returns (error)" + } + }, + "id": 12954, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "17370:46:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 12947, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "17332:7:55", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 12955, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "17332:85:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 12956, + "nodeType": "ExpressionStatement", + "src": "17332:85:55" + }, + { + "assignments": [ + 12959 + ], + "declarations": [ + { + "constant": false, + "id": 12959, + "mutability": "mutable", + "name": "subgraphService_", + "nameLocation": "17478:16:55", + "nodeType": "VariableDeclaration", + "scope": 13064, + "src": "17461:33:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_contract$_ISubgraphService_$15634", + "typeString": "contract ISubgraphService" + }, + "typeName": { + "id": 12958, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 12957, + "name": "ISubgraphService", + "nameLocations": [ + "17461:16:55" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 15634, + "src": "17461:16:55" + }, + "referencedDeclaration": 15634, + "src": "17461:16:55", + "typeDescriptions": { + "typeIdentifier": "t_contract$_ISubgraphService_$15634", + "typeString": "contract ISubgraphService" + } + }, + "visibility": "internal" + } + ], + "id": 12962, + "initialValue": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 12960, + "name": "_getSubgraphService", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13494, + "src": "17497:19:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_contract$_ISubgraphService_$15634_$", + "typeString": "function () view returns (contract ISubgraphService)" + } + }, + "id": 12961, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "17497:21:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_ISubgraphService_$15634", + "typeString": "contract ISubgraphService" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "17461:57:55" + }, + { + "assignments": [ + 12967 + ], + "declarations": [ + { + "constant": false, + "id": 12967, + "mutability": "mutable", + "name": "alloc", + "nameLocation": "17552:5:55", + "nodeType": "VariableDeclaration", + "scope": 13064, + "src": "17528:29:55", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State" + }, + "typeName": { + "id": 12966, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 12965, + "name": "Allocation.State", + "nameLocations": [ + "17528:10:55", + "17539:5:55" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 15663, + "src": "17528:16:55" + }, + "referencedDeclaration": 15663, + "src": "17528:16:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_storage_ptr", + "typeString": "struct Allocation.State" + } + }, + "visibility": "internal" + } + ], + "id": 12972, + "initialValue": { + "arguments": [ + { + "id": 12970, + "name": "_allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12930, + "src": "17591:13:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "expression": { + "id": 12968, + "name": "subgraphService_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12959, + "src": "17560:16:55", + "typeDescriptions": { + "typeIdentifier": "t_contract$_ISubgraphService_$15634", + "typeString": "contract ISubgraphService" + } + }, + "id": 12969, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "17577:13:55", + "memberName": "getAllocation", + "nodeType": "MemberAccess", + "referencedDeclaration": 15588, + "src": "17560:30:55", + "typeDescriptions": { + "typeIdentifier": "t_function_external_view$_t_address_$returns$_t_struct$_State_$15663_memory_ptr_$", + "typeString": "function (address) view external returns (struct Allocation.State memory)" + } + }, + "id": 12971, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "17560:45:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "17528:77:55" + }, + { + "assignments": [ + 12974 + ], + "declarations": [ + { + "constant": false, + "id": 12974, + "mutability": "mutable", + "name": "indexer", + "nameLocation": "17623:7:55", + "nodeType": "VariableDeclaration", + "scope": 13064, + "src": "17615:15:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 12973, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "17615:7:55", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "id": 12977, + "initialValue": { + "expression": { + "id": 12975, + "name": "alloc", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12967, + "src": "17633:5:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "id": 12976, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "17639:7:55", + "memberName": "indexer", + "nodeType": "MemberAccess", + "referencedDeclaration": 15646, + "src": "17633:13:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "17615:31:55" + }, + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 12984, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 12979, + "name": "indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12974, + "src": "17664:7:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "arguments": [ + { + "hexValue": "30", + "id": 12982, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "17683:1:55", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 12981, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "17675:7:55", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 12980, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "17675:7:55", + "typeDescriptions": {} + } + }, + "id": 12983, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "17675:10:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "17664:21:55", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [ + { + "id": 12986, + "name": "_allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12930, + "src": "17717:13:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 12985, + "name": "DisputeManagerIndexerNotFound", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15155, + "src": "17687:29:55", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_address_$returns$_t_error_$", + "typeString": "function (address) pure returns (error)" + } + }, + "id": 12987, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "17687:44:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 12978, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "17656:7:55", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 12988, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "17656:76:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 12989, + "nodeType": "ExpressionStatement", + "src": "17656:76:55" + }, + { + "assignments": [ + 12994 + ], + "declarations": [ + { + "constant": false, + "id": 12994, + "mutability": "mutable", + "name": "provision", + "nameLocation": "17818:9:55", + "nodeType": "VariableDeclaration", + "scope": 13064, + "src": "17785:42:55", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Provision_$3962_memory_ptr", + "typeString": "struct IHorizonStakingTypes.Provision" + }, + "typeName": { + "id": 12993, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 12992, + "name": "IHorizonStaking.Provision", + "nameLocations": [ + "17785:15:55", + "17801:9:55" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 3962, + "src": "17785:25:55" + }, + "referencedDeclaration": 3962, + "src": "17785:25:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Provision_$3962_storage_ptr", + "typeString": "struct IHorizonStakingTypes.Provision" + } + }, + "visibility": "internal" + } + ], + "id": 13004, + "initialValue": { + "arguments": [ + { + "id": 12998, + "name": "indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12974, + "src": "17859:7:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "arguments": [ + { + "id": 13001, + "name": "subgraphService_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12959, + "src": "17876:16:55", + "typeDescriptions": { + "typeIdentifier": "t_contract$_ISubgraphService_$15634", + "typeString": "contract ISubgraphService" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_ISubgraphService_$15634", + "typeString": "contract ISubgraphService" + } + ], + "id": 13000, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "17868:7:55", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 12999, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "17868:7:55", + "typeDescriptions": {} + } + }, + "id": 13002, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "17868:25:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "expression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 12995, + "name": "_graphStaking", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4815, + "src": "17830:13:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_contract$_IHorizonStaking_$2625_$", + "typeString": "function () view returns (contract IHorizonStaking)" + } + }, + "id": 12996, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "17830:15:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_IHorizonStaking_$2625", + "typeString": "contract IHorizonStaking" + } + }, + "id": 12997, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "17846:12:55", + "memberName": "getProvision", + "nodeType": "MemberAccess", + "referencedDeclaration": 2950, + "src": "17830:28:55", + "typeDescriptions": { + "typeIdentifier": "t_function_external_view$_t_address_$_t_address_$returns$_t_struct$_Provision_$3962_memory_ptr_$", + "typeString": "function (address,address) view external returns (struct IHorizonStakingTypes.Provision memory)" + } + }, + "id": 13003, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "17830:64:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_Provision_$3962_memory_ptr", + "typeString": "struct IHorizonStakingTypes.Provision memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "17785:109:55" + }, + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 13009, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 13006, + "name": "provision", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12994, + "src": "17912:9:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Provision_$3962_memory_ptr", + "typeString": "struct IHorizonStakingTypes.Provision memory" + } + }, + "id": 13007, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "17922:6:55", + "memberName": "tokens", + "nodeType": "MemberAccess", + "referencedDeclaration": 3943, + "src": "17912:16:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "hexValue": "30", + "id": 13008, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "17932:1:55", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "17912:21:55", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 13010, + "name": "DisputeManagerZeroTokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15092, + "src": "17935:24:55", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$__$returns$_t_error_$", + "typeString": "function () pure returns (error)" + } + }, + "id": 13011, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "17935:26:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 13005, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "17904:7:55", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 13012, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "17904:58:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 13013, + "nodeType": "ExpressionStatement", + "src": "17904:58:55" + }, + { + "assignments": [ + 13015 + ], + "declarations": [ + { + "constant": false, + "id": 13015, + "mutability": "mutable", + "name": "stakeSnapshot", + "nameLocation": "18006:13:55", + "nodeType": "VariableDeclaration", + "scope": 13064, + "src": "17998:21:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 13014, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "17998:7:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 13021, + "initialValue": { + "arguments": [ + { + "id": 13017, + "name": "indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12974, + "src": "18040:7:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "expression": { + "id": 13018, + "name": "provision", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12994, + "src": "18049:9:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Provision_$3962_memory_ptr", + "typeString": "struct IHorizonStakingTypes.Provision memory" + } + }, + "id": 13019, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "18059:6:55", + "memberName": "tokens", + "nodeType": "MemberAccess", + "referencedDeclaration": 3943, + "src": "18049:16:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 13016, + "name": "_getStakeSnapshot", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13541, + "src": "18022:17:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_address_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (address,uint256) view returns (uint256)" + } + }, + "id": 13020, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "18022:44:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "17998:68:55" + }, + { + "assignments": [ + 13023 + ], + "declarations": [ + { + "constant": false, + "id": 13023, + "mutability": "mutable", + "name": "cancellableAt", + "nameLocation": "18084:13:55", + "nodeType": "VariableDeclaration", + "scope": 13064, + "src": "18076:21:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 13022, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "18076:7:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 13028, + "initialValue": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 13027, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 13024, + "name": "block", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -4, + "src": "18100:5:55", + "typeDescriptions": { + "typeIdentifier": "t_magic_block", + "typeString": "block" + } + }, + "id": 13025, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "18106:9:55", + "memberName": "timestamp", + "nodeType": "MemberAccess", + "src": "18100:15:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "id": 13026, + "name": "disputePeriod", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13559, + "src": "18118:13:55", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "src": "18100:31:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "18076:55:55" + }, + { + "expression": { + "id": 13048, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "baseExpression": { + "id": 13029, + "name": "disputes", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13574, + "src": "18141:8:55", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Dispute_$14943_storage_$", + "typeString": "mapping(bytes32 => struct IDisputeManager.Dispute storage ref)" + } + }, + "id": 13031, + "indexExpression": { + "id": 13030, + "name": "disputeId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12938, + "src": "18150:9:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "18141:19:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage", + "typeString": "struct IDisputeManager.Dispute storage ref" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "expression": { + "id": 13033, + "name": "alloc", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12967, + "src": "18184:5:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "id": 13034, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "18190:7:55", + "memberName": "indexer", + "nodeType": "MemberAccess", + "referencedDeclaration": 15646, + "src": "18184:13:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 13035, + "name": "_fisherman", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12926, + "src": "18211:10:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 13036, + "name": "_deposit", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12928, + "src": "18235:8:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "hexValue": "30", + "id": 13037, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "18257:1:55", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + { + "expression": { + "id": 13038, + "name": "DisputeType", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14913, + "src": "18272:11:55", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_DisputeType_$14913_$", + "typeString": "type(enum IDisputeManager.DisputeType)" + } + }, + "id": 13039, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "18284:15:55", + "memberName": "IndexingDispute", + "nodeType": "MemberAccess", + "referencedDeclaration": 14910, + "src": "18272:27:55", + "typeDescriptions": { + "typeIdentifier": "t_enum$_DisputeType_$14913", + "typeString": "enum IDisputeManager.DisputeType" + } + }, + { + "expression": { + "expression": { + "id": 13040, + "name": "IDisputeManager", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15373, + "src": "18313:15:55", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_IDisputeManager_$15373_$", + "typeString": "type(contract IDisputeManager)" + } + }, + "id": 13041, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "18329:13:55", + "memberName": "DisputeStatus", + "nodeType": "MemberAccess", + "referencedDeclaration": 14921, + "src": "18313:29:55", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_DisputeStatus_$14921_$", + "typeString": "type(enum IDisputeManager.DisputeStatus)" + } + }, + "id": 13042, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "18343:7:55", + "memberName": "Pending", + "nodeType": "MemberAccess", + "referencedDeclaration": 14919, + "src": "18313:37:55", + "typeDescriptions": { + "typeIdentifier": "t_enum$_DisputeStatus_$14921", + "typeString": "enum IDisputeManager.DisputeStatus" + } + }, + { + "expression": { + "id": 13043, + "name": "block", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -4, + "src": "18364:5:55", + "typeDescriptions": { + "typeIdentifier": "t_magic_block", + "typeString": "block" + } + }, + "id": 13044, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "18370:9:55", + "memberName": "timestamp", + "nodeType": "MemberAccess", + "src": "18364:15:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 13045, + "name": "cancellableAt", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13023, + "src": "18393:13:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 13046, + "name": "stakeSnapshot", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13015, + "src": "18420:13:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + { + "typeIdentifier": "t_enum$_DisputeType_$14913", + "typeString": "enum IDisputeManager.DisputeType" + }, + { + "typeIdentifier": "t_enum$_DisputeStatus_$14921", + "typeString": "enum IDisputeManager.DisputeStatus" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 13032, + "name": "Dispute", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14943, + "src": "18163:7:55", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_struct$_Dispute_$14943_storage_ptr_$", + "typeString": "type(struct IDisputeManager.Dispute storage pointer)" + } + }, + "id": 13047, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "structConstructorCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "18163:280:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_memory_ptr", + "typeString": "struct IDisputeManager.Dispute memory" + } + }, + "src": "18141:302:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage", + "typeString": "struct IDisputeManager.Dispute storage ref" + } + }, + "id": 13049, + "nodeType": "ExpressionStatement", + "src": "18141:302:55" + }, + { + "eventCall": { + "arguments": [ + { + "id": 13051, + "name": "disputeId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12938, + "src": "18495:9:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "expression": { + "id": 13052, + "name": "alloc", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12967, + "src": "18518:5:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "id": 13053, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "18524:7:55", + "memberName": "indexer", + "nodeType": "MemberAccess", + "referencedDeclaration": 15646, + "src": "18518:13:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 13054, + "name": "_fisherman", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12926, + "src": "18545:10:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 13055, + "name": "_deposit", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12928, + "src": "18569:8:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 13056, + "name": "_allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12930, + "src": "18591:13:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 13057, + "name": "_poi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12932, + "src": "18618:4:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "id": 13058, + "name": "stakeSnapshot", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13015, + "src": "18636:13:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 13059, + "name": "cancellableAt", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13023, + "src": "18663:13:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 13050, + "name": "IndexingDisputeCreated", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15011, + "src": "18459:22:55", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_bytes32_$_t_address_$_t_address_$_t_uint256_$_t_address_$_t_bytes32_$_t_uint256_$_t_uint256_$returns$__$", + "typeString": "function (bytes32,address,address,uint256,address,bytes32,uint256,uint256)" + } + }, + "id": 13060, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "18459:227:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 13061, + "nodeType": "EmitStatement", + "src": "18454:232:55" + }, + { + "expression": { + "id": 13062, + "name": "disputeId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12938, + "src": "18704:9:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "functionReturnParameters": 12936, + "id": 13063, + "nodeType": "Return", + "src": "18697:16:55" + } + ] + }, + "documentation": { + "id": 12924, + "nodeType": "StructuredDocumentation", + "src": "16658:307:55", + "text": " @notice Create indexing dispute internal function.\n @param _fisherman The fisherman creating the dispute\n @param _deposit Amount of tokens staked as deposit\n @param _allocationId Allocation disputed\n @param _poi The POI being disputed\n @return The dispute id" + }, + "id": 13065, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_createIndexingDisputeWithAllocation", + "nameLocation": "16979:36:55", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 12933, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 12926, + "mutability": "mutable", + "name": "_fisherman", + "nameLocation": "17033:10:55", + "nodeType": "VariableDeclaration", + "scope": 13065, + "src": "17025:18:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 12925, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "17025:7:55", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 12928, + "mutability": "mutable", + "name": "_deposit", + "nameLocation": "17061:8:55", + "nodeType": "VariableDeclaration", + "scope": 13065, + "src": "17053:16:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 12927, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "17053:7:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 12930, + "mutability": "mutable", + "name": "_allocationId", + "nameLocation": "17087:13:55", + "nodeType": "VariableDeclaration", + "scope": 13065, + "src": "17079:21:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 12929, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "17079:7:55", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 12932, + "mutability": "mutable", + "name": "_poi", + "nameLocation": "17118:4:55", + "nodeType": "VariableDeclaration", + "scope": 13065, + "src": "17110:12:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 12931, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "17110:7:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "17015:113:55" + }, + "returnParameters": { + "id": 12936, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 12935, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 13065, + "src": "17146:7:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 12934, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "17146:7:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "17145:9:55" + }, + "scope": 13542, + "src": "16970:1750:55", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "private" + }, + { + "body": { + "id": 13117, + "nodeType": "Block", + "src": "19017:384:55", + "statements": [ + { + "assignments": [ + 13077 + ], + "declarations": [ + { + "constant": false, + "id": 13077, + "mutability": "mutable", + "name": "tokensToReward", + "nameLocation": "19035:14:55", + "nodeType": "VariableDeclaration", + "scope": 13117, + "src": "19027:22:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 13076, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "19027:7:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 13085, + "initialValue": { + "arguments": [ + { + "expression": { + "id": 13079, + "name": "_dispute", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13071, + "src": "19066:8:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage_ptr", + "typeString": "struct IDisputeManager.Dispute storage pointer" + } + }, + "id": 13080, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "19075:7:55", + "memberName": "indexer", + "nodeType": "MemberAccess", + "referencedDeclaration": 14924, + "src": "19066:16:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 13081, + "name": "_tokensSlashed", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13073, + "src": "19084:14:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "expression": { + "id": 13082, + "name": "_dispute", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13071, + "src": "19100:8:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage_ptr", + "typeString": "struct IDisputeManager.Dispute storage pointer" + } + }, + "id": 13083, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "19109:13:55", + "memberName": "stakeSnapshot", + "nodeType": "MemberAccess", + "referencedDeclaration": 14942, + "src": "19100:22:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 13078, + "name": "_slashIndexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13320, + "src": "19052:13:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (address,uint256,uint256) returns (uint256)" + } + }, + "id": 13084, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "19052:71:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "19027:96:55" + }, + { + "expression": { + "id": 13092, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 13086, + "name": "_dispute", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13071, + "src": "19133:8:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage_ptr", + "typeString": "struct IDisputeManager.Dispute storage pointer" + } + }, + "id": 13088, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberLocation": "19142:6:55", + "memberName": "status", + "nodeType": "MemberAccess", + "referencedDeclaration": 14936, + "src": "19133:15:55", + "typeDescriptions": { + "typeIdentifier": "t_enum$_DisputeStatus_$14921", + "typeString": "enum IDisputeManager.DisputeStatus" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "expression": { + "expression": { + "id": 13089, + "name": "IDisputeManager", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15373, + "src": "19151:15:55", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_IDisputeManager_$15373_$", + "typeString": "type(contract IDisputeManager)" + } + }, + "id": 13090, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "19167:13:55", + "memberName": "DisputeStatus", + "nodeType": "MemberAccess", + "referencedDeclaration": 14921, + "src": "19151:29:55", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_DisputeStatus_$14921_$", + "typeString": "type(enum IDisputeManager.DisputeStatus)" + } + }, + "id": 13091, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "19181:8:55", + "memberName": "Accepted", + "nodeType": "MemberAccess", + "referencedDeclaration": 14916, + "src": "19151:38:55", + "typeDescriptions": { + "typeIdentifier": "t_enum$_DisputeStatus_$14921", + "typeString": "enum IDisputeManager.DisputeStatus" + } + }, + "src": "19133:56:55", + "typeDescriptions": { + "typeIdentifier": "t_enum$_DisputeStatus_$14921", + "typeString": "enum IDisputeManager.DisputeStatus" + } + }, + "id": 13093, + "nodeType": "ExpressionStatement", + "src": "19133:56:55" + }, + { + "expression": { + "arguments": [ + { + "expression": { + "id": 13097, + "name": "_dispute", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13071, + "src": "19224:8:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage_ptr", + "typeString": "struct IDisputeManager.Dispute storage pointer" + } + }, + "id": 13098, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "19233:9:55", + "memberName": "fisherman", + "nodeType": "MemberAccess", + "referencedDeclaration": 14926, + "src": "19224:18:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 13102, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 13099, + "name": "tokensToReward", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13077, + "src": "19244:14:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "expression": { + "id": 13100, + "name": "_dispute", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13071, + "src": "19261:8:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage_ptr", + "typeString": "struct IDisputeManager.Dispute storage pointer" + } + }, + "id": 13101, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "19270:7:55", + "memberName": "deposit", + "nodeType": "MemberAccess", + "referencedDeclaration": 14928, + "src": "19261:16:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "19244:33:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 13094, + "name": "_graphToken", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4805, + "src": "19199:11:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_contract$_IGraphToken_$758_$", + "typeString": "function () view returns (contract IGraphToken)" + } + }, + "id": 13095, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "19199:13:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_IGraphToken_$758", + "typeString": "contract IGraphToken" + } + }, + "id": 13096, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "19213:10:55", + "memberName": "pushTokens", + "nodeType": "MemberAccess", + "referencedDeclaration": 818, + "src": "19199:24:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IGraphToken_$758_$_t_address_$_t_uint256_$returns$__$attached_to$_t_contract$_IGraphToken_$758_$", + "typeString": "function (contract IGraphToken,address,uint256)" + } + }, + "id": 13103, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "19199:79:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 13104, + "nodeType": "ExpressionStatement", + "src": "19199:79:55" + }, + { + "eventCall": { + "arguments": [ + { + "id": 13106, + "name": "_disputeId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13068, + "src": "19310:10:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "expression": { + "id": 13107, + "name": "_dispute", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13071, + "src": "19322:8:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage_ptr", + "typeString": "struct IDisputeManager.Dispute storage pointer" + } + }, + "id": 13108, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "19331:7:55", + "memberName": "indexer", + "nodeType": "MemberAccess", + "referencedDeclaration": 14924, + "src": "19322:16:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "expression": { + "id": 13109, + "name": "_dispute", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13071, + "src": "19340:8:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage_ptr", + "typeString": "struct IDisputeManager.Dispute storage pointer" + } + }, + "id": 13110, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "19349:9:55", + "memberName": "fisherman", + "nodeType": "MemberAccess", + "referencedDeclaration": 14926, + "src": "19340:18:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 13114, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 13111, + "name": "_dispute", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13071, + "src": "19360:8:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage_ptr", + "typeString": "struct IDisputeManager.Dispute storage pointer" + } + }, + "id": 13112, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "19369:7:55", + "memberName": "deposit", + "nodeType": "MemberAccess", + "referencedDeclaration": 14928, + "src": "19360:16:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "id": 13113, + "name": "tokensToReward", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13077, + "src": "19379:14:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "19360:33:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 13105, + "name": "DisputeAccepted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15037, + "src": "19294:15:55", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_bytes32_$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (bytes32,address,address,uint256)" + } + }, + "id": 13115, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "19294:100:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 13116, + "nodeType": "EmitStatement", + "src": "19289:105:55" + } + ] + }, + "documentation": { + "id": 13066, + "nodeType": "StructuredDocumentation", + "src": "18726:184:55", + "text": " @notice Accept a dispute\n @param _disputeId The id of the dispute\n @param _dispute The dispute\n @param _tokensSlashed The amount of tokens to slash" + }, + "id": 13118, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_acceptDispute", + "nameLocation": "18924:14:55", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 13074, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 13068, + "mutability": "mutable", + "name": "_disputeId", + "nameLocation": "18947:10:55", + "nodeType": "VariableDeclaration", + "scope": 13118, + "src": "18939:18:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 13067, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "18939:7:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 13071, + "mutability": "mutable", + "name": "_dispute", + "nameLocation": "18975:8:55", + "nodeType": "VariableDeclaration", + "scope": 13118, + "src": "18959:24:55", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage_ptr", + "typeString": "struct IDisputeManager.Dispute" + }, + "typeName": { + "id": 13070, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 13069, + "name": "Dispute", + "nameLocations": [ + "18959:7:55" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 14943, + "src": "18959:7:55" + }, + "referencedDeclaration": 14943, + "src": "18959:7:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage_ptr", + "typeString": "struct IDisputeManager.Dispute" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 13073, + "mutability": "mutable", + "name": "_tokensSlashed", + "nameLocation": "18993:14:55", + "nodeType": "VariableDeclaration", + "scope": 13118, + "src": "18985:22:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 13072, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "18985:7:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "18938:70:55" + }, + "returnParameters": { + "id": 13075, + "nodeType": "ParameterList", + "parameters": [], + "src": "19017:0:55" + }, + "scope": 13542, + "src": "18915:486:55", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "private" + }, + { + "body": { + "id": 13152, + "nodeType": "Block", + "src": "19615:224:55", + "statements": [ + { + "expression": { + "id": 13133, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 13127, + "name": "_dispute", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13124, + "src": "19625:8:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage_ptr", + "typeString": "struct IDisputeManager.Dispute storage pointer" + } + }, + "id": 13129, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberLocation": "19634:6:55", + "memberName": "status", + "nodeType": "MemberAccess", + "referencedDeclaration": 14936, + "src": "19625:15:55", + "typeDescriptions": { + "typeIdentifier": "t_enum$_DisputeStatus_$14921", + "typeString": "enum IDisputeManager.DisputeStatus" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "expression": { + "expression": { + "id": 13130, + "name": "IDisputeManager", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15373, + "src": "19643:15:55", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_IDisputeManager_$15373_$", + "typeString": "type(contract IDisputeManager)" + } + }, + "id": 13131, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "19659:13:55", + "memberName": "DisputeStatus", + "nodeType": "MemberAccess", + "referencedDeclaration": 14921, + "src": "19643:29:55", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_DisputeStatus_$14921_$", + "typeString": "type(enum IDisputeManager.DisputeStatus)" + } + }, + "id": 13132, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "19673:8:55", + "memberName": "Rejected", + "nodeType": "MemberAccess", + "referencedDeclaration": 14917, + "src": "19643:38:55", + "typeDescriptions": { + "typeIdentifier": "t_enum$_DisputeStatus_$14921", + "typeString": "enum IDisputeManager.DisputeStatus" + } + }, + "src": "19625:56:55", + "typeDescriptions": { + "typeIdentifier": "t_enum$_DisputeStatus_$14921", + "typeString": "enum IDisputeManager.DisputeStatus" + } + }, + "id": 13134, + "nodeType": "ExpressionStatement", + "src": "19625:56:55" + }, + { + "expression": { + "arguments": [ + { + "expression": { + "id": 13138, + "name": "_dispute", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13124, + "src": "19716:8:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage_ptr", + "typeString": "struct IDisputeManager.Dispute storage pointer" + } + }, + "id": 13139, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "19725:7:55", + "memberName": "deposit", + "nodeType": "MemberAccess", + "referencedDeclaration": 14928, + "src": "19716:16:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 13135, + "name": "_graphToken", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4805, + "src": "19691:11:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_contract$_IGraphToken_$758_$", + "typeString": "function () view returns (contract IGraphToken)" + } + }, + "id": 13136, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "19691:13:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_IGraphToken_$758", + "typeString": "contract IGraphToken" + } + }, + "id": 13137, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "19705:10:55", + "memberName": "burnTokens", + "nodeType": "MemberAccess", + "referencedDeclaration": 839, + "src": "19691:24:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IGraphToken_$758_$_t_uint256_$returns$__$attached_to$_t_contract$_IGraphToken_$758_$", + "typeString": "function (contract IGraphToken,uint256)" + } + }, + "id": 13140, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "19691:42:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 13141, + "nodeType": "ExpressionStatement", + "src": "19691:42:55" + }, + { + "eventCall": { + "arguments": [ + { + "id": 13143, + "name": "_disputeId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13121, + "src": "19765:10:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "expression": { + "id": 13144, + "name": "_dispute", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13124, + "src": "19777:8:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage_ptr", + "typeString": "struct IDisputeManager.Dispute storage pointer" + } + }, + "id": 13145, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "19786:7:55", + "memberName": "indexer", + "nodeType": "MemberAccess", + "referencedDeclaration": 14924, + "src": "19777:16:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "expression": { + "id": 13146, + "name": "_dispute", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13124, + "src": "19795:8:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage_ptr", + "typeString": "struct IDisputeManager.Dispute storage pointer" + } + }, + "id": 13147, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "19804:9:55", + "memberName": "fisherman", + "nodeType": "MemberAccess", + "referencedDeclaration": 14926, + "src": "19795:18:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "expression": { + "id": 13148, + "name": "_dispute", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13124, + "src": "19815:8:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage_ptr", + "typeString": "struct IDisputeManager.Dispute storage pointer" + } + }, + "id": 13149, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "19824:7:55", + "memberName": "deposit", + "nodeType": "MemberAccess", + "referencedDeclaration": 14928, + "src": "19815:16:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 13142, + "name": "DisputeRejected", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15048, + "src": "19749:15:55", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_bytes32_$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (bytes32,address,address,uint256)" + } + }, + "id": 13150, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "19749:83:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 13151, + "nodeType": "EmitStatement", + "src": "19744:88:55" + } + ] + }, + "documentation": { + "id": 13119, + "nodeType": "StructuredDocumentation", + "src": "19407:125:55", + "text": " @notice Reject a dispute\n @param _disputeId The id of the dispute\n @param _dispute The dispute" + }, + "id": 13153, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_rejectDispute", + "nameLocation": "19546:14:55", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 13125, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 13121, + "mutability": "mutable", + "name": "_disputeId", + "nameLocation": "19569:10:55", + "nodeType": "VariableDeclaration", + "scope": 13153, + "src": "19561:18:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 13120, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "19561:7:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 13124, + "mutability": "mutable", + "name": "_dispute", + "nameLocation": "19597:8:55", + "nodeType": "VariableDeclaration", + "scope": 13153, + "src": "19581:24:55", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage_ptr", + "typeString": "struct IDisputeManager.Dispute" + }, + "typeName": { + "id": 13123, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 13122, + "name": "Dispute", + "nameLocations": [ + "19581:7:55" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 14943, + "src": "19581:7:55" + }, + "referencedDeclaration": 14943, + "src": "19581:7:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage_ptr", + "typeString": "struct IDisputeManager.Dispute" + } + }, + "visibility": "internal" + } + ], + "src": "19560:46:55" + }, + "returnParameters": { + "id": 13126, + "nodeType": "ParameterList", + "parameters": [], + "src": "19615:0:55" + }, + "scope": 13542, + "src": "19537:302:55", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "private" + }, + { + "body": { + "id": 13189, + "nodeType": "Block", + "src": "20049:238:55", + "statements": [ + { + "expression": { + "id": 13168, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 13162, + "name": "_dispute", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13159, + "src": "20059:8:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage_ptr", + "typeString": "struct IDisputeManager.Dispute storage pointer" + } + }, + "id": 13164, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberLocation": "20068:6:55", + "memberName": "status", + "nodeType": "MemberAccess", + "referencedDeclaration": 14936, + "src": "20059:15:55", + "typeDescriptions": { + "typeIdentifier": "t_enum$_DisputeStatus_$14921", + "typeString": "enum IDisputeManager.DisputeStatus" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "expression": { + "expression": { + "id": 13165, + "name": "IDisputeManager", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15373, + "src": "20077:15:55", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_IDisputeManager_$15373_$", + "typeString": "type(contract IDisputeManager)" + } + }, + "id": 13166, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "20093:13:55", + "memberName": "DisputeStatus", + "nodeType": "MemberAccess", + "referencedDeclaration": 14921, + "src": "20077:29:55", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_DisputeStatus_$14921_$", + "typeString": "type(enum IDisputeManager.DisputeStatus)" + } + }, + "id": 13167, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "20107:5:55", + "memberName": "Drawn", + "nodeType": "MemberAccess", + "referencedDeclaration": 14918, + "src": "20077:35:55", + "typeDescriptions": { + "typeIdentifier": "t_enum$_DisputeStatus_$14921", + "typeString": "enum IDisputeManager.DisputeStatus" + } + }, + "src": "20059:53:55", + "typeDescriptions": { + "typeIdentifier": "t_enum$_DisputeStatus_$14921", + "typeString": "enum IDisputeManager.DisputeStatus" + } + }, + "id": 13169, + "nodeType": "ExpressionStatement", + "src": "20059:53:55" + }, + { + "expression": { + "arguments": [ + { + "expression": { + "id": 13173, + "name": "_dispute", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13159, + "src": "20147:8:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage_ptr", + "typeString": "struct IDisputeManager.Dispute storage pointer" + } + }, + "id": 13174, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "20156:9:55", + "memberName": "fisherman", + "nodeType": "MemberAccess", + "referencedDeclaration": 14926, + "src": "20147:18:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "expression": { + "id": 13175, + "name": "_dispute", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13159, + "src": "20167:8:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage_ptr", + "typeString": "struct IDisputeManager.Dispute storage pointer" + } + }, + "id": 13176, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "20176:7:55", + "memberName": "deposit", + "nodeType": "MemberAccess", + "referencedDeclaration": 14928, + "src": "20167:16:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 13170, + "name": "_graphToken", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4805, + "src": "20122:11:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_contract$_IGraphToken_$758_$", + "typeString": "function () view returns (contract IGraphToken)" + } + }, + "id": 13171, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "20122:13:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_IGraphToken_$758", + "typeString": "contract IGraphToken" + } + }, + "id": 13172, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "20136:10:55", + "memberName": "pushTokens", + "nodeType": "MemberAccess", + "referencedDeclaration": 818, + "src": "20122:24:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IGraphToken_$758_$_t_address_$_t_uint256_$returns$__$attached_to$_t_contract$_IGraphToken_$758_$", + "typeString": "function (contract IGraphToken,address,uint256)" + } + }, + "id": 13177, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "20122:62:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 13178, + "nodeType": "ExpressionStatement", + "src": "20122:62:55" + }, + { + "eventCall": { + "arguments": [ + { + "id": 13180, + "name": "_disputeId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13156, + "src": "20213:10:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "expression": { + "id": 13181, + "name": "_dispute", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13159, + "src": "20225:8:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage_ptr", + "typeString": "struct IDisputeManager.Dispute storage pointer" + } + }, + "id": 13182, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "20234:7:55", + "memberName": "indexer", + "nodeType": "MemberAccess", + "referencedDeclaration": 14924, + "src": "20225:16:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "expression": { + "id": 13183, + "name": "_dispute", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13159, + "src": "20243:8:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage_ptr", + "typeString": "struct IDisputeManager.Dispute storage pointer" + } + }, + "id": 13184, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "20252:9:55", + "memberName": "fisherman", + "nodeType": "MemberAccess", + "referencedDeclaration": 14926, + "src": "20243:18:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "expression": { + "id": 13185, + "name": "_dispute", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13159, + "src": "20263:8:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage_ptr", + "typeString": "struct IDisputeManager.Dispute storage pointer" + } + }, + "id": 13186, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "20272:7:55", + "memberName": "deposit", + "nodeType": "MemberAccess", + "referencedDeclaration": 14928, + "src": "20263:16:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 13179, + "name": "DisputeDrawn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15059, + "src": "20200:12:55", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_bytes32_$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (bytes32,address,address,uint256)" + } + }, + "id": 13187, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "20200:80:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 13188, + "nodeType": "EmitStatement", + "src": "20195:85:55" + } + ] + }, + "documentation": { + "id": 13154, + "nodeType": "StructuredDocumentation", + "src": "19845:123:55", + "text": " @notice Draw a dispute\n @param _disputeId The id of the dispute\n @param _dispute The dispute" + }, + "id": 13190, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_drawDispute", + "nameLocation": "19982:12:55", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 13160, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 13156, + "mutability": "mutable", + "name": "_disputeId", + "nameLocation": "20003:10:55", + "nodeType": "VariableDeclaration", + "scope": 13190, + "src": "19995:18:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 13155, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "19995:7:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 13159, + "mutability": "mutable", + "name": "_dispute", + "nameLocation": "20031:8:55", + "nodeType": "VariableDeclaration", + "scope": 13190, + "src": "20015:24:55", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage_ptr", + "typeString": "struct IDisputeManager.Dispute" + }, + "typeName": { + "id": 13158, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 13157, + "name": "Dispute", + "nameLocations": [ + "20015:7:55" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 14943, + "src": "20015:7:55" + }, + "referencedDeclaration": 14943, + "src": "20015:7:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage_ptr", + "typeString": "struct IDisputeManager.Dispute" + } + }, + "visibility": "internal" + } + ], + "src": "19994:46:55" + }, + "returnParameters": { + "id": 13161, + "nodeType": "ParameterList", + "parameters": [], + "src": "20049:0:55" + }, + "scope": 13542, + "src": "19973:314:55", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "private" + }, + { + "body": { + "id": 13226, + "nodeType": "Block", + "src": "20501:246:55", + "statements": [ + { + "expression": { + "id": 13205, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 13199, + "name": "_dispute", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13196, + "src": "20511:8:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage_ptr", + "typeString": "struct IDisputeManager.Dispute storage pointer" + } + }, + "id": 13201, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberLocation": "20520:6:55", + "memberName": "status", + "nodeType": "MemberAccess", + "referencedDeclaration": 14936, + "src": "20511:15:55", + "typeDescriptions": { + "typeIdentifier": "t_enum$_DisputeStatus_$14921", + "typeString": "enum IDisputeManager.DisputeStatus" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "expression": { + "expression": { + "id": 13202, + "name": "IDisputeManager", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15373, + "src": "20529:15:55", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_IDisputeManager_$15373_$", + "typeString": "type(contract IDisputeManager)" + } + }, + "id": 13203, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "20545:13:55", + "memberName": "DisputeStatus", + "nodeType": "MemberAccess", + "referencedDeclaration": 14921, + "src": "20529:29:55", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_DisputeStatus_$14921_$", + "typeString": "type(enum IDisputeManager.DisputeStatus)" + } + }, + "id": 13204, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "20559:9:55", + "memberName": "Cancelled", + "nodeType": "MemberAccess", + "referencedDeclaration": 14920, + "src": "20529:39:55", + "typeDescriptions": { + "typeIdentifier": "t_enum$_DisputeStatus_$14921", + "typeString": "enum IDisputeManager.DisputeStatus" + } + }, + "src": "20511:57:55", + "typeDescriptions": { + "typeIdentifier": "t_enum$_DisputeStatus_$14921", + "typeString": "enum IDisputeManager.DisputeStatus" + } + }, + "id": 13206, + "nodeType": "ExpressionStatement", + "src": "20511:57:55" + }, + { + "expression": { + "arguments": [ + { + "expression": { + "id": 13210, + "name": "_dispute", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13196, + "src": "20603:8:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage_ptr", + "typeString": "struct IDisputeManager.Dispute storage pointer" + } + }, + "id": 13211, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "20612:9:55", + "memberName": "fisherman", + "nodeType": "MemberAccess", + "referencedDeclaration": 14926, + "src": "20603:18:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "expression": { + "id": 13212, + "name": "_dispute", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13196, + "src": "20623:8:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage_ptr", + "typeString": "struct IDisputeManager.Dispute storage pointer" + } + }, + "id": 13213, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "20632:7:55", + "memberName": "deposit", + "nodeType": "MemberAccess", + "referencedDeclaration": 14928, + "src": "20623:16:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 13207, + "name": "_graphToken", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4805, + "src": "20578:11:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_contract$_IGraphToken_$758_$", + "typeString": "function () view returns (contract IGraphToken)" + } + }, + "id": 13208, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "20578:13:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_IGraphToken_$758", + "typeString": "contract IGraphToken" + } + }, + "id": 13209, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "20592:10:55", + "memberName": "pushTokens", + "nodeType": "MemberAccess", + "referencedDeclaration": 818, + "src": "20578:24:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IGraphToken_$758_$_t_address_$_t_uint256_$returns$__$attached_to$_t_contract$_IGraphToken_$758_$", + "typeString": "function (contract IGraphToken,address,uint256)" + } + }, + "id": 13214, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "20578:62:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 13215, + "nodeType": "ExpressionStatement", + "src": "20578:62:55" + }, + { + "eventCall": { + "arguments": [ + { + "id": 13217, + "name": "_disputeId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13193, + "src": "20673:10:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "expression": { + "id": 13218, + "name": "_dispute", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13196, + "src": "20685:8:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage_ptr", + "typeString": "struct IDisputeManager.Dispute storage pointer" + } + }, + "id": 13219, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "20694:7:55", + "memberName": "indexer", + "nodeType": "MemberAccess", + "referencedDeclaration": 14924, + "src": "20685:16:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "expression": { + "id": 13220, + "name": "_dispute", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13196, + "src": "20703:8:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage_ptr", + "typeString": "struct IDisputeManager.Dispute storage pointer" + } + }, + "id": 13221, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "20712:9:55", + "memberName": "fisherman", + "nodeType": "MemberAccess", + "referencedDeclaration": 14926, + "src": "20703:18:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "expression": { + "id": 13222, + "name": "_dispute", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13196, + "src": "20723:8:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage_ptr", + "typeString": "struct IDisputeManager.Dispute storage pointer" + } + }, + "id": 13223, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "20732:7:55", + "memberName": "deposit", + "nodeType": "MemberAccess", + "referencedDeclaration": 14928, + "src": "20723:16:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 13216, + "name": "DisputeCancelled", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15077, + "src": "20656:16:55", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_bytes32_$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (bytes32,address,address,uint256)" + } + }, + "id": 13224, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "20656:84:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 13225, + "nodeType": "EmitStatement", + "src": "20651:89:55" + } + ] + }, + "documentation": { + "id": 13191, + "nodeType": "StructuredDocumentation", + "src": "20293:125:55", + "text": " @notice Cancel a dispute\n @param _disputeId The id of the dispute\n @param _dispute The dispute" + }, + "id": 13227, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_cancelDispute", + "nameLocation": "20432:14:55", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 13197, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 13193, + "mutability": "mutable", + "name": "_disputeId", + "nameLocation": "20455:10:55", + "nodeType": "VariableDeclaration", + "scope": 13227, + "src": "20447:18:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 13192, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "20447:7:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 13196, + "mutability": "mutable", + "name": "_dispute", + "nameLocation": "20483:8:55", + "nodeType": "VariableDeclaration", + "scope": 13227, + "src": "20467:24:55", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage_ptr", + "typeString": "struct IDisputeManager.Dispute" + }, + "typeName": { + "id": 13195, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 13194, + "name": "Dispute", + "nameLocations": [ + "20467:7:55" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 14943, + "src": "20467:7:55" + }, + "referencedDeclaration": 14943, + "src": "20467:7:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage_ptr", + "typeString": "struct IDisputeManager.Dispute" + } + }, + "visibility": "internal" + } + ], + "src": "20446:46:55" + }, + "returnParameters": { + "id": 13198, + "nodeType": "ParameterList", + "parameters": [], + "src": "20501:0:55" + }, + "scope": 13542, + "src": "20423:324:55", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "private" + }, + { + "body": { + "id": 13319, + "nodeType": "Block", + "src": "21378:1390:55", + "statements": [ + { + "assignments": [ + 13241 + ], + "declarations": [ + { + "constant": false, + "id": 13241, + "mutability": "mutable", + "name": "subgraphService_", + "nameLocation": "21405:16:55", + "nodeType": "VariableDeclaration", + "scope": 13319, + "src": "21388:33:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_contract$_ISubgraphService_$15634", + "typeString": "contract ISubgraphService" + }, + "typeName": { + "id": 13240, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 13239, + "name": "ISubgraphService", + "nameLocations": [ + "21388:16:55" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 15634, + "src": "21388:16:55" + }, + "referencedDeclaration": 15634, + "src": "21388:16:55", + "typeDescriptions": { + "typeIdentifier": "t_contract$_ISubgraphService_$15634", + "typeString": "contract ISubgraphService" + } + }, + "visibility": "internal" + } + ], + "id": 13244, + "initialValue": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 13242, + "name": "_getSubgraphService", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13494, + "src": "21424:19:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_contract$_ISubgraphService_$15634_$", + "typeString": "function () view returns (contract ISubgraphService)" + } + }, + "id": 13243, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "21424:21:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_ISubgraphService_$15634", + "typeString": "contract ISubgraphService" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "21388:57:55" + }, + { + "assignments": [ + 13249 + ], + "declarations": [ + { + "constant": false, + "id": 13249, + "mutability": "mutable", + "name": "provision", + "nameLocation": "21533:9:55", + "nodeType": "VariableDeclaration", + "scope": 13319, + "src": "21500:42:55", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Provision_$3962_memory_ptr", + "typeString": "struct IHorizonStakingTypes.Provision" + }, + "typeName": { + "id": 13248, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 13247, + "name": "IHorizonStaking.Provision", + "nameLocations": [ + "21500:15:55", + "21516:9:55" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 3962, + "src": "21500:25:55" + }, + "referencedDeclaration": 3962, + "src": "21500:25:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Provision_$3962_storage_ptr", + "typeString": "struct IHorizonStakingTypes.Provision" + } + }, + "visibility": "internal" + } + ], + "id": 13259, + "initialValue": { + "arguments": [ + { + "id": 13253, + "name": "_indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13230, + "src": "21574:8:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "arguments": [ + { + "id": 13256, + "name": "subgraphService_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13241, + "src": "21592:16:55", + "typeDescriptions": { + "typeIdentifier": "t_contract$_ISubgraphService_$15634", + "typeString": "contract ISubgraphService" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_ISubgraphService_$15634", + "typeString": "contract ISubgraphService" + } + ], + "id": 13255, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "21584:7:55", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 13254, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "21584:7:55", + "typeDescriptions": {} + } + }, + "id": 13257, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "21584:25:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "expression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 13250, + "name": "_graphStaking", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4815, + "src": "21545:13:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_contract$_IHorizonStaking_$2625_$", + "typeString": "function () view returns (contract IHorizonStaking)" + } + }, + "id": 13251, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "21545:15:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_IHorizonStaking_$2625", + "typeString": "contract IHorizonStaking" + } + }, + "id": 13252, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "21561:12:55", + "memberName": "getProvision", + "nodeType": "MemberAccess", + "referencedDeclaration": 2950, + "src": "21545:28:55", + "typeDescriptions": { + "typeIdentifier": "t_function_external_view$_t_address_$_t_address_$returns$_t_struct$_Provision_$3962_memory_ptr_$", + "typeString": "function (address,address) view external returns (struct IHorizonStakingTypes.Provision memory)" + } + }, + "id": 13258, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "21545:65:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_Provision_$3962_memory_ptr", + "typeString": "struct IHorizonStakingTypes.Provision memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "21500:110:55" + }, + { + "assignments": [ + 13261 + ], + "declarations": [ + { + "constant": false, + "id": 13261, + "mutability": "mutable", + "name": "maxTokensSlash", + "nameLocation": "21678:14:55", + "nodeType": "VariableDeclaration", + "scope": 13319, + "src": "21670:22:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 13260, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "21670:7:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 13266, + "initialValue": { + "arguments": [ + { + "id": 13264, + "name": "maxSlashingCut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13568, + "src": "21723:14:55", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + ], + "expression": { + "id": 13262, + "name": "_tokensStakeSnapshot", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13234, + "src": "21695:20:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 13263, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "21716:6:55", + "memberName": "mulPPM", + "nodeType": "MemberAccess", + "referencedDeclaration": 4496, + "src": "21695:27:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$attached_to$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 13265, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "21695:43:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "21670:68:55" + }, + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 13274, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 13270, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 13268, + "name": "_tokensSlash", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13232, + "src": "21769:12:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "hexValue": "30", + "id": 13269, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "21785:1:55", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "21769:17:55", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "&&", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 13273, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 13271, + "name": "_tokensSlash", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13232, + "src": "21790:12:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "id": 13272, + "name": "maxTokensSlash", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13261, + "src": "21806:14:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "21790:30:55", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "21769:51:55", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [ + { + "id": 13276, + "name": "_tokensSlash", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13232, + "src": "21867:12:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 13277, + "name": "maxTokensSlash", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13261, + "src": "21881:14:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 13275, + "name": "DisputeManagerInvalidTokensSlash", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15119, + "src": "21834:32:55", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint256_$_t_uint256_$returns$_t_error_$", + "typeString": "function (uint256,uint256) pure returns (error)" + } + }, + "id": 13278, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "21834:62:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 13267, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "21748:7:55", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 13279, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "21748:158:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 13280, + "nodeType": "ExpressionStatement", + "src": "21748:158:55" + }, + { + "assignments": [ + 13282 + ], + "declarations": [ + { + "constant": false, + "id": 13282, + "mutability": "mutable", + "name": "maxRewardableTokens", + "nameLocation": "22414:19:55", + "nodeType": "VariableDeclaration", + "scope": 13319, + "src": "22406:27:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 13281, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "22406:7:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 13289, + "initialValue": { + "arguments": [ + { + "id": 13285, + "name": "_tokensSlash", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13232, + "src": "22450:12:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "expression": { + "id": 13286, + "name": "provision", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13249, + "src": "22464:9:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Provision_$3962_memory_ptr", + "typeString": "struct IHorizonStakingTypes.Provision memory" + } + }, + "id": 13287, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "22474:6:55", + "memberName": "tokens", + "nodeType": "MemberAccess", + "referencedDeclaration": 3943, + "src": "22464:16:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "id": 13283, + "name": "MathUtils", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4445, + "src": "22436:9:55", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_MathUtils_$4445_$", + "typeString": "type(library MathUtils)" + } + }, + "id": 13284, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "22446:3:55", + "memberName": "min", + "nodeType": "MemberAccess", + "referencedDeclaration": 4423, + "src": "22436:13:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 13288, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "22436:45:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "22406:75:55" + }, + { + "assignments": [ + 13291 + ], + "declarations": [ + { + "constant": false, + "id": 13291, + "mutability": "mutable", + "name": "effectiveCut", + "nameLocation": "22499:12:55", + "nodeType": "VariableDeclaration", + "scope": 13319, + "src": "22491:20:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 13290, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "22491:7:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 13298, + "initialValue": { + "arguments": [ + { + "expression": { + "id": 13294, + "name": "provision", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13249, + "src": "22528:9:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Provision_$3962_memory_ptr", + "typeString": "struct IHorizonStakingTypes.Provision memory" + } + }, + "id": 13295, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "22538:14:55", + "memberName": "maxVerifierCut", + "nodeType": "MemberAccess", + "referencedDeclaration": 3949, + "src": "22528:24:55", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + { + "id": 13296, + "name": "fishermanRewardCut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13565, + "src": "22554:18:55", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + ], + "expression": { + "id": 13292, + "name": "MathUtils", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4445, + "src": "22514:9:55", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_MathUtils_$4445_$", + "typeString": "type(library MathUtils)" + } + }, + "id": 13293, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "22524:3:55", + "memberName": "min", + "nodeType": "MemberAccess", + "referencedDeclaration": 4423, + "src": "22514:13:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 13297, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "22514:59:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "22491:82:55" + }, + { + "assignments": [ + 13300 + ], + "declarations": [ + { + "constant": false, + "id": 13300, + "mutability": "mutable", + "name": "tokensRewards", + "nameLocation": "22591:13:55", + "nodeType": "VariableDeclaration", + "scope": 13319, + "src": "22583:21:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 13299, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "22583:7:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 13305, + "initialValue": { + "arguments": [ + { + "id": 13303, + "name": "maxRewardableTokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13282, + "src": "22627:19:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "id": 13301, + "name": "effectiveCut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13291, + "src": "22607:12:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 13302, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "22620:6:55", + "memberName": "mulPPM", + "nodeType": "MemberAccess", + "referencedDeclaration": 4496, + "src": "22607:19:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$attached_to$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 13304, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "22607:40:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "22583:64:55" + }, + { + "expression": { + "arguments": [ + { + "id": 13309, + "name": "_indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13230, + "src": "22681:8:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "arguments": [ + { + "id": 13312, + "name": "_tokensSlash", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13232, + "src": "22702:12:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 13313, + "name": "tokensRewards", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13300, + "src": "22716:13:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "id": 13310, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -1, + "src": "22691:3:55", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 13311, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "22695:6:55", + "memberName": "encode", + "nodeType": "MemberAccess", + "src": "22691:10:55", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencode_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 13314, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "22691:39:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "expression": { + "id": 13306, + "name": "subgraphService_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13241, + "src": "22658:16:55", + "typeDescriptions": { + "typeIdentifier": "t_contract$_ISubgraphService_$15634", + "typeString": "contract ISubgraphService" + } + }, + "id": 13308, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "22675:5:55", + "memberName": "slash", + "nodeType": "MemberAccess", + "referencedDeclaration": 1526, + "src": "22658:22:55", + "typeDescriptions": { + "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_bytes_memory_ptr_$returns$__$", + "typeString": "function (address,bytes memory) external" + } + }, + "id": 13315, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "22658:73:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 13316, + "nodeType": "ExpressionStatement", + "src": "22658:73:55" + }, + { + "expression": { + "id": 13317, + "name": "tokensRewards", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13300, + "src": "22748:13:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 13238, + "id": 13318, + "nodeType": "Return", + "src": "22741:20:55" + } + ] + }, + "documentation": { + "id": 13228, + "nodeType": "StructuredDocumentation", + "src": "20753:471:55", + "text": " @notice Make the subgraph service contract slash the indexer and reward the fisherman.\n Give the fisherman a reward equal to the fishermanRewardCut of slashed amount\n @param _indexer Address of the indexer\n @param _tokensSlash Amount of tokens to slash from the indexer\n @param _tokensStakeSnapshot Snapshot of the indexer's stake at the time of the dispute creation\n @return The amount of tokens rewarded to the fisherman" + }, + "id": 13320, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_slashIndexer", + "nameLocation": "21238:13:55", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 13235, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 13230, + "mutability": "mutable", + "name": "_indexer", + "nameLocation": "21269:8:55", + "nodeType": "VariableDeclaration", + "scope": 13320, + "src": "21261:16:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 13229, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "21261:7:55", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 13232, + "mutability": "mutable", + "name": "_tokensSlash", + "nameLocation": "21295:12:55", + "nodeType": "VariableDeclaration", + "scope": 13320, + "src": "21287:20:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 13231, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "21287:7:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 13234, + "mutability": "mutable", + "name": "_tokensStakeSnapshot", + "nameLocation": "21325:20:55", + "nodeType": "VariableDeclaration", + "scope": 13320, + "src": "21317:28:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 13233, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "21317:7:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "21251:100:55" + }, + "returnParameters": { + "id": 13238, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 13237, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 13320, + "src": "21369:7:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 13236, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "21369:7:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "21368:9:55" + }, + "scope": 13542, + "src": "21229:1539:55", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "private" + }, + { + "body": { + "id": 13345, + "nodeType": "Block", + "src": "23012:162:55", + "statements": [ + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 13332, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 13327, + "name": "_arbitrator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13323, + "src": "23030:11:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "arguments": [ + { + "hexValue": "30", + "id": 13330, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "23053:1:55", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 13329, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "23045:7:55", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 13328, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "23045:7:55", + "typeDescriptions": {} + } + }, + "id": 13331, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "23045:10:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "23030:25:55", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 13333, + "name": "DisputeManagerInvalidZeroAddress", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15086, + "src": "23057:32:55", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$__$returns$_t_error_$", + "typeString": "function () pure returns (error)" + } + }, + "id": 13334, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "23057:34:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 13326, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "23022:7:55", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 13335, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "23022:70:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 13336, + "nodeType": "ExpressionStatement", + "src": "23022:70:55" + }, + { + "expression": { + "id": 13339, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 13337, + "name": "arbitrator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13556, + "src": "23102:10:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "id": 13338, + "name": "_arbitrator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13323, + "src": "23115:11:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "23102:24:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 13340, + "nodeType": "ExpressionStatement", + "src": "23102:24:55" + }, + { + "eventCall": { + "arguments": [ + { + "id": 13342, + "name": "_arbitrator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13323, + "src": "23155:11:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 13341, + "name": "ArbitratorSet", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14948, + "src": "23141:13:55", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$returns$__$", + "typeString": "function (address)" + } + }, + "id": 13343, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "23141:26:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 13344, + "nodeType": "EmitStatement", + "src": "23136:31:55" + } + ] + }, + "documentation": { + "id": 13321, + "nodeType": "StructuredDocumentation", + "src": "22774:180:55", + "text": " @notice Set the arbitrator address.\n @dev Update the arbitrator to `_arbitrator`\n @param _arbitrator The address of the arbitration contract or party" + }, + "id": 13346, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_setArbitrator", + "nameLocation": "22968:14:55", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 13324, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 13323, + "mutability": "mutable", + "name": "_arbitrator", + "nameLocation": "22991:11:55", + "nodeType": "VariableDeclaration", + "scope": 13346, + "src": "22983:19:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 13322, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "22983:7:55", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "22982:21:55" + }, + "returnParameters": { + "id": 13325, + "nodeType": "ParameterList", + "parameters": [], + "src": "23012:0:55" + }, + "scope": 13542, + "src": "22959:215:55", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "private" + }, + { + "body": { + "id": 13368, + "nodeType": "Block", + "src": "23417:167:55", + "statements": [ + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + }, + "id": 13355, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 13353, + "name": "_disputePeriod", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13349, + "src": "23435:14:55", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "hexValue": "30", + "id": 13354, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "23453:1:55", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "23435:19:55", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 13356, + "name": "DisputeManagerDisputePeriodZero", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15089, + "src": "23456:31:55", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$__$returns$_t_error_$", + "typeString": "function () pure returns (error)" + } + }, + "id": 13357, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "23456:33:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 13352, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "23427:7:55", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 13358, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "23427:63:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 13359, + "nodeType": "ExpressionStatement", + "src": "23427:63:55" + }, + { + "expression": { + "id": 13362, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 13360, + "name": "disputePeriod", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13559, + "src": "23500:13:55", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "id": 13361, + "name": "_disputePeriod", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13349, + "src": "23516:14:55", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "src": "23500:30:55", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "id": 13363, + "nodeType": "ExpressionStatement", + "src": "23500:30:55" + }, + { + "eventCall": { + "arguments": [ + { + "id": 13365, + "name": "_disputePeriod", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13349, + "src": "23562:14:55", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + ], + "id": 13364, + "name": "DisputePeriodSet", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14953, + "src": "23545:16:55", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_uint64_$returns$__$", + "typeString": "function (uint64)" + } + }, + "id": 13366, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "23545:32:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 13367, + "nodeType": "EmitStatement", + "src": "23540:37:55" + } + ] + }, + "documentation": { + "id": 13347, + "nodeType": "StructuredDocumentation", + "src": "23180:174:55", + "text": " @notice Set the dispute period.\n @dev Update the dispute period to `_disputePeriod` in seconds\n @param _disputePeriod Dispute period in seconds" + }, + "id": 13369, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_setDisputePeriod", + "nameLocation": "23368:17:55", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 13350, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 13349, + "mutability": "mutable", + "name": "_disputePeriod", + "nameLocation": "23393:14:55", + "nodeType": "VariableDeclaration", + "scope": 13369, + "src": "23386:21:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + }, + "typeName": { + "id": 13348, + "name": "uint64", + "nodeType": "ElementaryTypeName", + "src": "23386:6:55", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "visibility": "internal" + } + ], + "src": "23385:23:55" + }, + "returnParameters": { + "id": 13351, + "nodeType": "ParameterList", + "parameters": [], + "src": "23417:0:55" + }, + "scope": 13542, + "src": "23359:225:55", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "private" + }, + { + "body": { + "id": 13392, + "nodeType": "Block", + "src": "23875:209:55", + "statements": [ + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 13378, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 13376, + "name": "_disputeDeposit", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13372, + "src": "23893:15:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "id": 13377, + "name": "MIN_DISPUTE_DEPOSIT", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11905, + "src": "23912:19:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "23893:38:55", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [ + { + "id": 13380, + "name": "_disputeDeposit", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13372, + "src": "23969:15:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 13379, + "name": "DisputeManagerInvalidDisputeDeposit", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15102, + "src": "23933:35:55", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint256_$returns$_t_error_$", + "typeString": "function (uint256) pure returns (error)" + } + }, + "id": 13381, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "23933:52:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 13375, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "23885:7:55", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 13382, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "23885:101:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 13383, + "nodeType": "ExpressionStatement", + "src": "23885:101:55" + }, + { + "expression": { + "id": 13386, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 13384, + "name": "disputeDeposit", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13562, + "src": "23996:14:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "id": 13385, + "name": "_disputeDeposit", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13372, + "src": "24013:15:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "23996:32:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 13387, + "nodeType": "ExpressionStatement", + "src": "23996:32:55" + }, + { + "eventCall": { + "arguments": [ + { + "id": 13389, + "name": "_disputeDeposit", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13372, + "src": "24061:15:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 13388, + "name": "DisputeDepositSet", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14958, + "src": "24043:17:55", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256)" + } + }, + "id": 13390, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "24043:34:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 13391, + "nodeType": "EmitStatement", + "src": "24038:39:55" + } + ] + }, + "documentation": { + "id": 13370, + "nodeType": "StructuredDocumentation", + "src": "23590:219:55", + "text": " @notice Set the dispute deposit required to create a dispute.\n @dev Update the dispute deposit to `_disputeDeposit` Graph Tokens\n @param _disputeDeposit The dispute deposit in Graph Tokens" + }, + "id": 13393, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_setDisputeDeposit", + "nameLocation": "23823:18:55", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 13373, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 13372, + "mutability": "mutable", + "name": "_disputeDeposit", + "nameLocation": "23850:15:55", + "nodeType": "VariableDeclaration", + "scope": 13393, + "src": "23842:23:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 13371, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "23842:7:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "23841:25:55" + }, + "returnParameters": { + "id": 13374, + "nodeType": "ParameterList", + "parameters": [], + "src": "23875:0:55" + }, + "scope": 13542, + "src": "23814:270:55", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "private" + }, + { + "body": { + "id": 13416, + "nodeType": "Block", + "src": "24380:273:55", + "statements": [ + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "id": 13402, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 13400, + "name": "_fishermanRewardCut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13396, + "src": "24411:19:55", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "id": 13401, + "name": "MAX_FISHERMAN_REWARD_CUT", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11901, + "src": "24434:24:55", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "src": "24411:47:55", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [ + { + "id": 13404, + "name": "_fishermanRewardCut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13396, + "src": "24509:19:55", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + ], + "id": 13403, + "name": "DisputeManagerInvalidFishermanReward", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15107, + "src": "24472:36:55", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint32_$returns$_t_error_$", + "typeString": "function (uint32) pure returns (error)" + } + }, + "id": 13405, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "24472:57:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 13399, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "24390:7:55", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 13406, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "24390:149:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 13407, + "nodeType": "ExpressionStatement", + "src": "24390:149:55" + }, + { + "expression": { + "id": 13410, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 13408, + "name": "fishermanRewardCut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13565, + "src": "24549:18:55", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "id": 13409, + "name": "_fishermanRewardCut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13396, + "src": "24570:19:55", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "src": "24549:40:55", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "id": 13411, + "nodeType": "ExpressionStatement", + "src": "24549:40:55" + }, + { + "eventCall": { + "arguments": [ + { + "id": 13413, + "name": "_fishermanRewardCut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13396, + "src": "24626:19:55", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + ], + "id": 13412, + "name": "FishermanRewardCutSet", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14968, + "src": "24604:21:55", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_uint32_$returns$__$", + "typeString": "function (uint32)" + } + }, + "id": 13414, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "24604:42:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 13415, + "nodeType": "EmitStatement", + "src": "24599:47:55" + } + ] + }, + "documentation": { + "id": 13394, + "nodeType": "StructuredDocumentation", + "src": "24090:217:55", + "text": " @notice Set the reward cut that the fisherman gets when slashing occurs.\n @dev Update the reward cut to `_fishermanRewardCut`\n @param _fishermanRewardCut The fisherman reward cut, in PPM" + }, + "id": 13417, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_setFishermanRewardCut", + "nameLocation": "24321:22:55", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 13397, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 13396, + "mutability": "mutable", + "name": "_fishermanRewardCut", + "nameLocation": "24351:19:55", + "nodeType": "VariableDeclaration", + "scope": 13417, + "src": "24344:26:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 13395, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "24344:6:55", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + } + ], + "src": "24343:28:55" + }, + "returnParameters": { + "id": 13398, + "nodeType": "ParameterList", + "parameters": [], + "src": "24380:0:55" + }, + "scope": 13542, + "src": "24312:341:55", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "private" + }, + { + "body": { + "id": 13441, + "nodeType": "Block", + "src": "24865:205:55", + "statements": [ + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "id": 13426, + "name": "_maxSlashingCut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13420, + "src": "24902:15:55", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + ], + "expression": { + "id": 13424, + "name": "PPMMath", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4539, + "src": "24883:7:55", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_PPMMath_$4539_$", + "typeString": "type(library PPMMath)" + } + }, + "id": 13425, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "24891:10:55", + "memberName": "isValidPPM", + "nodeType": "MemberAccess", + "referencedDeclaration": 4538, + "src": "24883:18:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$returns$_t_bool_$", + "typeString": "function (uint256) pure returns (bool)" + } + }, + "id": 13427, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "24883:35:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [ + { + "id": 13429, + "name": "_maxSlashingCut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13420, + "src": "24956:15:55", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + ], + "id": 13428, + "name": "DisputeManagerInvalidMaxSlashingCut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15112, + "src": "24920:35:55", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint32_$returns$_t_error_$", + "typeString": "function (uint32) pure returns (error)" + } + }, + "id": 13430, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "24920:52:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 13423, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "24875:7:55", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 13431, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "24875:98:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 13432, + "nodeType": "ExpressionStatement", + "src": "24875:98:55" + }, + { + "expression": { + "id": 13435, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 13433, + "name": "maxSlashingCut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13568, + "src": "24983:14:55", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "id": 13434, + "name": "_maxSlashingCut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13420, + "src": "25000:15:55", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "src": "24983:32:55", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "id": 13436, + "nodeType": "ExpressionStatement", + "src": "24983:32:55" + }, + { + "eventCall": { + "arguments": [ + { + "id": 13438, + "name": "maxSlashingCut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13568, + "src": "25048:14:55", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + ], + "id": 13437, + "name": "MaxSlashingCutSet", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14963, + "src": "25030:17:55", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_uint32_$returns$__$", + "typeString": "function (uint32)" + } + }, + "id": 13439, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "25030:33:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 13440, + "nodeType": "EmitStatement", + "src": "25025:38:55" + } + ] + }, + "documentation": { + "id": 13418, + "nodeType": "StructuredDocumentation", + "src": "24659:141:55", + "text": " @notice Set the maximum cut that can be used for slashing indexers.\n @param _maxSlashingCut Max slashing cut, in PPM" + }, + "id": 13442, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_setMaxSlashingCut", + "nameLocation": "24814:18:55", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 13421, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 13420, + "mutability": "mutable", + "name": "_maxSlashingCut", + "nameLocation": "24840:15:55", + "nodeType": "VariableDeclaration", + "scope": 13442, + "src": "24833:22:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 13419, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "24833:6:55", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + } + ], + "src": "24832:24:55" + }, + "returnParameters": { + "id": 13422, + "nodeType": "ParameterList", + "parameters": [], + "src": "24865:0:55" + }, + "scope": 13542, + "src": "24805:265:55", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "private" + }, + { + "body": { + "id": 13469, + "nodeType": "Block", + "src": "25342:205:55", + "statements": [ + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 13454, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 13449, + "name": "_subgraphService", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13445, + "src": "25360:16:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "arguments": [ + { + "hexValue": "30", + "id": 13452, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "25388:1:55", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 13451, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "25380:7:55", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 13450, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "25380:7:55", + "typeDescriptions": {} + } + }, + "id": 13453, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "25380:10:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "25360:30:55", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 13455, + "name": "DisputeManagerInvalidZeroAddress", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15086, + "src": "25392:32:55", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$__$returns$_t_error_$", + "typeString": "function () pure returns (error)" + } + }, + "id": 13456, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "25392:34:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 13448, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "25352:7:55", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 13457, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "25352:75:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 13458, + "nodeType": "ExpressionStatement", + "src": "25352:75:55" + }, + { + "expression": { + "id": 13463, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 13459, + "name": "subgraphService", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13553, + "src": "25437:15:55", + "typeDescriptions": { + "typeIdentifier": "t_contract$_ISubgraphService_$15634", + "typeString": "contract ISubgraphService" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "id": 13461, + "name": "_subgraphService", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13445, + "src": "25472:16:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 13460, + "name": "ISubgraphService", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15634, + "src": "25455:16:55", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_ISubgraphService_$15634_$", + "typeString": "type(contract ISubgraphService)" + } + }, + "id": 13462, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "25455:34:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_ISubgraphService_$15634", + "typeString": "contract ISubgraphService" + } + }, + "src": "25437:52:55", + "typeDescriptions": { + "typeIdentifier": "t_contract$_ISubgraphService_$15634", + "typeString": "contract ISubgraphService" + } + }, + "id": 13464, + "nodeType": "ExpressionStatement", + "src": "25437:52:55" + }, + { + "eventCall": { + "arguments": [ + { + "id": 13466, + "name": "_subgraphService", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13445, + "src": "25523:16:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 13465, + "name": "SubgraphServiceSet", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14973, + "src": "25504:18:55", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$returns$__$", + "typeString": "function (address)" + } + }, + "id": 13467, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "25504:36:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 13468, + "nodeType": "EmitStatement", + "src": "25499:41:55" + } + ] + }, + "documentation": { + "id": 13443, + "nodeType": "StructuredDocumentation", + "src": "25076:198:55", + "text": " @notice Set the subgraph service address.\n @dev Update the subgraph service to `_subgraphService`\n @param _subgraphService The address of the subgraph service contract" + }, + "id": 13470, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_setSubgraphService", + "nameLocation": "25288:19:55", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 13446, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 13445, + "mutability": "mutable", + "name": "_subgraphService", + "nameLocation": "25316:16:55", + "nodeType": "VariableDeclaration", + "scope": 13470, + "src": "25308:24:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 13444, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "25308:7:55", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "25307:26:55" + }, + "returnParameters": { + "id": 13447, + "nodeType": "ParameterList", + "parameters": [], + "src": "25342:0:55" + }, + "scope": 13542, + "src": "25279:268:55", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "private" + }, + { + "body": { + "id": 13493, + "nodeType": "Block", + "src": "25798:135:55", + "statements": [ + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 13486, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "arguments": [ + { + "id": 13480, + "name": "subgraphService", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13553, + "src": "25824:15:55", + "typeDescriptions": { + "typeIdentifier": "t_contract$_ISubgraphService_$15634", + "typeString": "contract ISubgraphService" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_ISubgraphService_$15634", + "typeString": "contract ISubgraphService" + } + ], + "id": 13479, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "25816:7:55", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 13478, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "25816:7:55", + "typeDescriptions": {} + } + }, + "id": 13481, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "25816:24:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "arguments": [ + { + "hexValue": "30", + "id": 13484, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "25852:1:55", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 13483, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "25844:7:55", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 13482, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "25844:7:55", + "typeDescriptions": {} + } + }, + "id": 13485, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "25844:10:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "25816:38:55", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 13487, + "name": "DisputeManagerSubgraphServiceNotSet", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15180, + "src": "25856:35:55", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$__$returns$_t_error_$", + "typeString": "function () pure returns (error)" + } + }, + "id": 13488, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "25856:37:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 13477, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "25808:7:55", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 13489, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "25808:86:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 13490, + "nodeType": "ExpressionStatement", + "src": "25808:86:55" + }, + { + "expression": { + "id": 13491, + "name": "subgraphService", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13553, + "src": "25911:15:55", + "typeDescriptions": { + "typeIdentifier": "t_contract$_ISubgraphService_$15634", + "typeString": "contract ISubgraphService" + } + }, + "functionReturnParameters": 13476, + "id": 13492, + "nodeType": "Return", + "src": "25904:22:55" + } + ] + }, + "documentation": { + "id": 13471, + "nodeType": "StructuredDocumentation", + "src": "25553:169:55", + "text": " @notice Get the address of the subgraph service\n @dev Will revert if the subgraph service is not set\n @return The subgraph service address" + }, + "id": 13494, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_getSubgraphService", + "nameLocation": "25736:19:55", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 13472, + "nodeType": "ParameterList", + "parameters": [], + "src": "25755:2:55" + }, + "returnParameters": { + "id": 13476, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 13475, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 13494, + "src": "25780:16:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_contract$_ISubgraphService_$15634", + "typeString": "contract ISubgraphService" + }, + "typeName": { + "id": 13474, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 13473, + "name": "ISubgraphService", + "nameLocations": [ + "25780:16:55" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 15634, + "src": "25780:16:55" + }, + "referencedDeclaration": 15634, + "src": "25780:16:55", + "typeDescriptions": { + "typeIdentifier": "t_contract$_ISubgraphService_$15634", + "typeString": "contract ISubgraphService" + } + }, + "visibility": "internal" + } + ], + "src": "25779:18:55" + }, + "scope": 13542, + "src": "25727:206:55", + "stateMutability": "view", + "virtual": false, + "visibility": "private" + }, + { + "body": { + "id": 13511, + "nodeType": "Block", + "src": "26206:63:55", + "statements": [ + { + "expression": { + "commonType": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "id": 13509, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 13503, + "name": "_dispute", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13498, + "src": "26223:8:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage_ptr", + "typeString": "struct IDisputeManager.Dispute storage pointer" + } + }, + "id": 13504, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "26232:16:55", + "memberName": "relatedDisputeId", + "nodeType": "MemberAccess", + "referencedDeclaration": 14930, + "src": "26223:25:55", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "arguments": [ + { + "hexValue": "30", + "id": 13507, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "26260:1:55", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 13506, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "26252:7:55", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes32_$", + "typeString": "type(bytes32)" + }, + "typeName": { + "id": 13505, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "26252:7:55", + "typeDescriptions": {} + } + }, + "id": 13508, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "26252:10:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "src": "26223:39:55", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "functionReturnParameters": 13502, + "id": 13510, + "nodeType": "Return", + "src": "26216:46:55" + } + ] + }, + "documentation": { + "id": 13495, + "nodeType": "StructuredDocumentation", + "src": "25939:178:55", + "text": " @notice Returns whether the dispute is for a conflicting attestation or not.\n @param _dispute Dispute\n @return True conflicting attestation dispute" + }, + "id": 13512, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_isDisputeInConflict", + "nameLocation": "26131:20:55", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 13499, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 13498, + "mutability": "mutable", + "name": "_dispute", + "nameLocation": "26168:8:55", + "nodeType": "VariableDeclaration", + "scope": 13512, + "src": "26152:24:55", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage_ptr", + "typeString": "struct IDisputeManager.Dispute" + }, + "typeName": { + "id": 13497, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 13496, + "name": "Dispute", + "nameLocations": [ + "26152:7:55" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 14943, + "src": "26152:7:55" + }, + "referencedDeclaration": 14943, + "src": "26152:7:55", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage_ptr", + "typeString": "struct IDisputeManager.Dispute" + } + }, + "visibility": "internal" + } + ], + "src": "26151:26:55" + }, + "returnParameters": { + "id": 13502, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 13501, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 13512, + "src": "26200:4:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 13500, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "26200:4:55", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "src": "26199:6:55" + }, + "scope": 13542, + "src": "26122:147:55", + "stateMutability": "view", + "virtual": false, + "visibility": "private" + }, + { + "body": { + "id": 13540, + "nodeType": "Block", + "src": "27164:173:55", + "statements": [ + { + "assignments": [ + 13523 + ], + "declarations": [ + { + "constant": false, + "id": 13523, + "mutability": "mutable", + "name": "delegatorsStake", + "nameLocation": "27182:15:55", + "nodeType": "VariableDeclaration", + "scope": 13540, + "src": "27174:23:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 13522, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "27174:7:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 13535, + "initialValue": { + "expression": { + "arguments": [ + { + "id": 13527, + "name": "_indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13515, + "src": "27234:8:55", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "arguments": [ + { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 13530, + "name": "_getSubgraphService", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13494, + "src": "27252:19:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_contract$_ISubgraphService_$15634_$", + "typeString": "function () view returns (contract ISubgraphService)" + } + }, + "id": 13531, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "27252:21:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_ISubgraphService_$15634", + "typeString": "contract ISubgraphService" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_ISubgraphService_$15634", + "typeString": "contract ISubgraphService" + } + ], + "id": 13529, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "27244:7:55", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 13528, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "27244:7:55", + "typeDescriptions": {} + } + }, + "id": 13532, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "27244:30:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "expression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 13524, + "name": "_graphStaking", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4815, + "src": "27200:13:55", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_contract$_IHorizonStaking_$2625_$", + "typeString": "function () view returns (contract IHorizonStaking)" + } + }, + "id": 13525, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "27200:15:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_IHorizonStaking_$2625", + "typeString": "contract IHorizonStaking" + } + }, + "id": 13526, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "27216:17:55", + "memberName": "getDelegationPool", + "nodeType": "MemberAccess", + "referencedDeclaration": 2913, + "src": "27200:33:55", + "typeDescriptions": { + "typeIdentifier": "t_function_external_view$_t_address_$_t_address_$returns$_t_struct$_DelegationPool_$3992_memory_ptr_$", + "typeString": "function (address,address) view external returns (struct IHorizonStakingTypes.DelegationPool memory)" + } + }, + "id": 13533, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "27200:75:55", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_DelegationPool_$3992_memory_ptr", + "typeString": "struct IHorizonStakingTypes.DelegationPool memory" + } + }, + "id": 13534, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "27276:6:55", + "memberName": "tokens", + "nodeType": "MemberAccess", + "referencedDeclaration": 3983, + "src": "27200:82:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "27174:108:55" + }, + { + "expression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 13538, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 13536, + "name": "_indexerStake", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13517, + "src": "27299:13:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "id": 13537, + "name": "delegatorsStake", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13523, + "src": "27315:15:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "27299:31:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 13521, + "id": 13539, + "nodeType": "Return", + "src": "27292:38:55" + } + ] + }, + "documentation": { + "id": 13513, + "nodeType": "StructuredDocumentation", + "src": "26275:785:55", + "text": " @notice Get the total stake snapshot for and indexer.\n @dev A few considerations:\n - We include both indexer and delegators stake.\n - Thawing stake is not excluded from the snapshot.\n - Delegators stake is capped at the delegation ratio to prevent delegators from inflating the snapshot\n to increase the indexer slash amount.\n Note that the snapshot can be inflated by delegators front-running the dispute creation with a delegation\n to the indexer. Given the snapshot is a cap, the dispute outcome is uncertain and considering the cost of capital\n and slashing risk, this is not a concern.\n @param _indexer Indexer address\n @param _indexerStake Indexer's stake\n @return Total stake snapshot" + }, + "id": 13541, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_getStakeSnapshot", + "nameLocation": "27074:17:55", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 13518, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 13515, + "mutability": "mutable", + "name": "_indexer", + "nameLocation": "27100:8:55", + "nodeType": "VariableDeclaration", + "scope": 13541, + "src": "27092:16:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 13514, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "27092:7:55", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 13517, + "mutability": "mutable", + "name": "_indexerStake", + "nameLocation": "27118:13:55", + "nodeType": "VariableDeclaration", + "scope": 13541, + "src": "27110:21:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 13516, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "27110:7:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "27091:41:55" + }, + "returnParameters": { + "id": 13521, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 13520, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 13541, + "src": "27155:7:55", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 13519, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "27155:7:55", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "27154:9:55" + }, + "scope": 13542, + "src": "27065:272:55", + "stateMutability": "view", + "virtual": false, + "visibility": "private" + } + ], + "scope": 13543, + "src": "2323:25016:55", + "usedErrors": [ + 4464, + 4655, + 4959, + 4964, + 5140, + 5143, + 7894, + 7899, + 7904, + 15080, + 15083, + 15086, + 15089, + 15092, + 15097, + 15102, + 15107, + 15112, + 15119, + 15125, + 15130, + 15133, + 15138, + 15143, + 15150, + 15155, + 15162, + 15177, + 15180, + 16121 + ], + "usedEvents": [ + 4650, + 4970, + 5148, + 14948, + 14953, + 14958, + 14963, + 14968, + 14973, + 14992, + 15011, + 15026, + 15037, + 15048, + 15059, + 15066, + 15077 + ] + } + ], + "src": "45:27295:55" + }, + "id": 55 + }, + "contracts/DisputeManagerStorage.sol": { + "ast": { + "absolutePath": "contracts/DisputeManagerStorage.sol", + "exportedSymbols": { + "DisputeManagerV1Storage": [ + 13575 + ], + "IDisputeManager": [ + 15373 + ], + "ISubgraphService": [ + 15634 + ] + }, + "id": 13576, + "license": "GPL-2.0-or-later", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 13544, + "literals": [ + "solidity", + "0.8", + ".27" + ], + "nodeType": "PragmaDirective", + "src": "46:23:56" + }, + { + "absolutePath": "contracts/interfaces/IDisputeManager.sol", + "file": "./interfaces/IDisputeManager.sol", + "id": 13546, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 13576, + "sourceUnit": 15374, + "src": "71:67:56", + "symbolAliases": [ + { + "foreign": { + "id": 13545, + "name": "IDisputeManager", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15373, + "src": "80:15:56", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "contracts/interfaces/ISubgraphService.sol", + "file": "./interfaces/ISubgraphService.sol", + "id": 13548, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 13576, + "sourceUnit": 15635, + "src": "139:69:56", + "symbolAliases": [ + { + "foreign": { + "id": 13547, + "name": "ISubgraphService", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15634, + "src": "148:16:56", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "abstract": true, + "baseContracts": [], + "canonicalName": "DisputeManagerV1Storage", + "contractDependencies": [], + "contractKind": "contract", + "documentation": { + "id": 13549, + "nodeType": "StructuredDocumentation", + "src": "210:270:56", + "text": " @title DisputeManagerStorage\n @notice This contract holds all the storage variables for the Dispute Manager contract.\n @custom:security-contact Please email security+contracts@thegraph.com if you find any\n bugs. We may have an active bug bounty program." + }, + "fullyImplemented": true, + "id": 13575, + "linearizedBaseContracts": [ + 13575 + ], + "name": "DisputeManagerV1Storage", + "nameLocation": "499:23:56", + "nodeType": "ContractDefinition", + "nodes": [ + { + "constant": false, + "documentation": { + "id": 13550, + "nodeType": "StructuredDocumentation", + "src": "529:49:56", + "text": "@notice The Subgraph Service contract address" + }, + "functionSelector": "26058249", + "id": 13553, + "mutability": "mutable", + "name": "subgraphService", + "nameLocation": "607:15:56", + "nodeType": "VariableDeclaration", + "scope": 13575, + "src": "583:39:56", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_contract$_ISubgraphService_$15634", + "typeString": "contract ISubgraphService" + }, + "typeName": { + "id": 13552, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 13551, + "name": "ISubgraphService", + "nameLocations": [ + "583:16:56" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 15634, + "src": "583:16:56" + }, + "referencedDeclaration": 15634, + "src": "583:16:56", + "typeDescriptions": { + "typeIdentifier": "t_contract$_ISubgraphService_$15634", + "typeString": "contract ISubgraphService" + } + }, + "visibility": "public" + }, + { + "constant": false, + "documentation": { + "id": 13554, + "nodeType": "StructuredDocumentation", + "src": "629:71:56", + "text": "@notice The arbitrator is solely in control of arbitrating disputes" + }, + "functionSelector": "6cc6cde1", + "id": 13556, + "mutability": "mutable", + "name": "arbitrator", + "nameLocation": "720:10:56", + "nodeType": "VariableDeclaration", + "scope": 13575, + "src": "705:25:56", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 13555, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "705:7:56", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "public" + }, + { + "constant": false, + "documentation": { + "id": 13557, + "nodeType": "StructuredDocumentation", + "src": "737:37:56", + "text": "@notice dispute period in seconds" + }, + "functionSelector": "5bf31d4d", + "id": 13559, + "mutability": "mutable", + "name": "disputePeriod", + "nameLocation": "793:13:56", + "nodeType": "VariableDeclaration", + "scope": 13575, + "src": "779:27:56", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + }, + "typeName": { + "id": 13558, + "name": "uint64", + "nodeType": "ElementaryTypeName", + "src": "779:6:56", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "visibility": "public" + }, + { + "constant": false, + "documentation": { + "id": 13560, + "nodeType": "StructuredDocumentation", + "src": "813:48:56", + "text": "@notice Deposit required to create a Dispute" + }, + "functionSelector": "29e03ff1", + "id": 13562, + "mutability": "mutable", + "name": "disputeDeposit", + "nameLocation": "881:14:56", + "nodeType": "VariableDeclaration", + "scope": 13575, + "src": "866:29:56", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 13561, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "866:7:56", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "public" + }, + { + "constant": false, + "documentation": { + "id": 13563, + "nodeType": "StructuredDocumentation", + "src": "902:113:56", + "text": "@notice Percentage of indexer slashed funds to assign as a reward to fisherman in successful dispute. In PPM." + }, + "functionSelector": "902a4938", + "id": 13565, + "mutability": "mutable", + "name": "fishermanRewardCut", + "nameLocation": "1034:18:56", + "nodeType": "VariableDeclaration", + "scope": 13575, + "src": "1020:32:56", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 13564, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "1020:6:56", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "public" + }, + { + "constant": false, + "documentation": { + "id": 13566, + "nodeType": "StructuredDocumentation", + "src": "1059:89:56", + "text": "@notice Maximum percentage of indexer stake that can be slashed on a dispute. In PPM." + }, + "functionSelector": "0533e1ba", + "id": 13568, + "mutability": "mutable", + "name": "maxSlashingCut", + "nameLocation": "1167:14:56", + "nodeType": "VariableDeclaration", + "scope": 13575, + "src": "1153:28:56", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 13567, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "1153:6:56", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "public" + }, + { + "constant": false, + "documentation": { + "id": 13569, + "nodeType": "StructuredDocumentation", + "src": "1188:36:56", + "text": "@notice List of disputes created" + }, + "functionSelector": "11be1997", + "id": 13574, + "mutability": "mutable", + "name": "disputes", + "nameLocation": "1298:8:56", + "nodeType": "VariableDeclaration", + "scope": 13575, + "src": "1229:77:56", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Dispute_$14943_storage_$", + "typeString": "mapping(bytes32 => struct IDisputeManager.Dispute)" + }, + "typeName": { + "id": 13573, + "keyName": "disputeId", + "keyNameLocation": "1245:9:56", + "keyType": { + "id": 13570, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1237:7:56", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "Mapping", + "src": "1229:61:56", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Dispute_$14943_storage_$", + "typeString": "mapping(bytes32 => struct IDisputeManager.Dispute)" + }, + "valueName": "dispute", + "valueNameLocation": "1282:7:56", + "valueType": { + "id": 13572, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 13571, + "name": "IDisputeManager.Dispute", + "nameLocations": [ + "1258:15:56", + "1274:7:56" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 14943, + "src": "1258:23:56" + }, + "referencedDeclaration": 14943, + "src": "1258:23:56", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Dispute_$14943_storage_ptr", + "typeString": "struct IDisputeManager.Dispute" + } + } + }, + "visibility": "public" + } + ], + "scope": 13576, + "src": "481:828:56", + "usedErrors": [], + "usedEvents": [] + } + ], + "src": "46:1264:56" + }, + "id": 56 + }, + "contracts/SubgraphService.sol": { + "ast": { + "absolutePath": "contracts/SubgraphService.sol", + "exportedSymbols": { + "Allocation": [ + 16033 + ], + "AllocationManager": [ + 17363 + ], + "DataService": [ + 936 + ], + "DataServiceFees": [ + 1278 + ], + "DataServicePausableUpgradeable": [ + 1425 + ], + "Directory": [ + 17720 + ], + "IDataService": [ + 1557 + ], + "IGraphPayments": [ + 2489 + ], + "IGraphTallyCollector": [ + 2605 + ], + "IGraphToken": [ + 758 + ], + "IRewardsIssuer": [ + 561 + ], + "ISubgraphService": [ + 15634 + ], + "Initializable": [ + 5391 + ], + "LegacyAllocation": [ + 16462 + ], + "MulticallUpgradeable": [ + 5540 + ], + "OwnableUpgradeable": [ + 5123 + ], + "PPMMath": [ + 4539 + ], + "SubgraphService": [ + 14879 + ], + "SubgraphServiceV1Storage": [ + 14902 + ], + "TokenUtils": [ + 840 + ] + }, + "id": 14880, + "license": "GPL-3.0-or-later", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 13577, + "literals": [ + "solidity", + "0.8", + ".27" + ], + "nodeType": "PragmaDirective", + "src": "45:23:57" + }, + { + "absolutePath": "@graphprotocol/horizon/contracts/interfaces/IGraphPayments.sol", + "file": "@graphprotocol/horizon/contracts/interfaces/IGraphPayments.sol", + "id": 13579, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 14880, + "sourceUnit": 2490, + "src": "70:96:57", + "symbolAliases": [ + { + "foreign": { + "id": 13578, + "name": "IGraphPayments", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2489, + "src": "79:14:57", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "@graphprotocol/contracts/contracts/token/IGraphToken.sol", + "file": "@graphprotocol/contracts/contracts/token/IGraphToken.sol", + "id": 13581, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 14880, + "sourceUnit": 759, + "src": "167:87:57", + "symbolAliases": [ + { + "foreign": { + "id": 13580, + "name": "IGraphToken", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 758, + "src": "176:11:57", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "@graphprotocol/horizon/contracts/interfaces/IGraphTallyCollector.sol", + "file": "@graphprotocol/horizon/contracts/interfaces/IGraphTallyCollector.sol", + "id": 13583, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 14880, + "sourceUnit": 2606, + "src": "255:108:57", + "symbolAliases": [ + { + "foreign": { + "id": 13582, + "name": "IGraphTallyCollector", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2605, + "src": "264:20:57", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "@graphprotocol/contracts/contracts/rewards/IRewardsIssuer.sol", + "file": "@graphprotocol/contracts/contracts/rewards/IRewardsIssuer.sol", + "id": 13585, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 14880, + "sourceUnit": 562, + "src": "364:95:57", + "symbolAliases": [ + { + "foreign": { + "id": 13584, + "name": "IRewardsIssuer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 561, + "src": "373:14:57", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "@graphprotocol/horizon/contracts/data-service/interfaces/IDataService.sol", + "file": "@graphprotocol/horizon/contracts/data-service/interfaces/IDataService.sol", + "id": 13587, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 14880, + "sourceUnit": 1558, + "src": "460:105:57", + "symbolAliases": [ + { + "foreign": { + "id": 13586, + "name": "IDataService", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1557, + "src": "469:12:57", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "contracts/interfaces/ISubgraphService.sol", + "file": "./interfaces/ISubgraphService.sol", + "id": 13589, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 14880, + "sourceUnit": 15635, + "src": "566:69:57", + "symbolAliases": [ + { + "foreign": { + "id": 13588, + "name": "ISubgraphService", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15634, + "src": "575:16:57", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol", + "file": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol", + "id": 13591, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 14880, + "sourceUnit": 5124, + "src": "637:103:57", + "symbolAliases": [ + { + "foreign": { + "id": 13590, + "name": "OwnableUpgradeable", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5123, + "src": "646:18:57", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "@openzeppelin/contracts-upgradeable/utils/MulticallUpgradeable.sol", + "file": "@openzeppelin/contracts-upgradeable/utils/MulticallUpgradeable.sol", + "id": 13593, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 14880, + "sourceUnit": 5541, + "src": "741:106:57", + "symbolAliases": [ + { + "foreign": { + "id": 13592, + "name": "MulticallUpgradeable", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5540, + "src": "750:20:57", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol", + "file": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol", + "id": 13595, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 14880, + "sourceUnit": 5392, + "src": "848:98:57", + "symbolAliases": [ + { + "foreign": { + "id": 13594, + "name": "Initializable", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5391, + "src": "857:13:57", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "@graphprotocol/horizon/contracts/data-service/extensions/DataServicePausableUpgradeable.sol", + "file": "@graphprotocol/horizon/contracts/data-service/extensions/DataServicePausableUpgradeable.sol", + "id": 13597, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 14880, + "sourceUnit": 1426, + "src": "947:141:57", + "symbolAliases": [ + { + "foreign": { + "id": 13596, + "name": "DataServicePausableUpgradeable", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1425, + "src": "956:30:57", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "@graphprotocol/horizon/contracts/data-service/DataService.sol", + "file": "@graphprotocol/horizon/contracts/data-service/DataService.sol", + "id": 13599, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 14880, + "sourceUnit": 937, + "src": "1089:92:57", + "symbolAliases": [ + { + "foreign": { + "id": 13598, + "name": "DataService", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 936, + "src": "1098:11:57", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "@graphprotocol/horizon/contracts/data-service/extensions/DataServiceFees.sol", + "file": "@graphprotocol/horizon/contracts/data-service/extensions/DataServiceFees.sol", + "id": 13601, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 14880, + "sourceUnit": 1279, + "src": "1182:111:57", + "symbolAliases": [ + { + "foreign": { + "id": 13600, + "name": "DataServiceFees", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1278, + "src": "1191:15:57", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "contracts/utilities/Directory.sol", + "file": "./utilities/Directory.sol", + "id": 13603, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 14880, + "sourceUnit": 17721, + "src": "1294:54:57", + "symbolAliases": [ + { + "foreign": { + "id": 13602, + "name": "Directory", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17720, + "src": "1303:9:57", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "contracts/utilities/AllocationManager.sol", + "file": "./utilities/AllocationManager.sol", + "id": 13605, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 14880, + "sourceUnit": 17364, + "src": "1349:70:57", + "symbolAliases": [ + { + "foreign": { + "id": 13604, + "name": "AllocationManager", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17363, + "src": "1358:17:57", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "contracts/SubgraphServiceStorage.sol", + "file": "./SubgraphServiceStorage.sol", + "id": 13607, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 14880, + "sourceUnit": 14903, + "src": "1420:72:57", + "symbolAliases": [ + { + "foreign": { + "id": 13606, + "name": "SubgraphServiceV1Storage", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14902, + "src": "1429:24:57", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "@graphprotocol/contracts/contracts/utils/TokenUtils.sol", + "file": "@graphprotocol/contracts/contracts/utils/TokenUtils.sol", + "id": 13609, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 14880, + "sourceUnit": 841, + "src": "1494:85:57", + "symbolAliases": [ + { + "foreign": { + "id": 13608, + "name": "TokenUtils", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 840, + "src": "1503:10:57", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "@graphprotocol/horizon/contracts/libraries/PPMMath.sol", + "file": "@graphprotocol/horizon/contracts/libraries/PPMMath.sol", + "id": 13611, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 14880, + "sourceUnit": 4540, + "src": "1580:81:57", + "symbolAliases": [ + { + "foreign": { + "id": 13610, + "name": "PPMMath", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4539, + "src": "1589:7:57", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "contracts/libraries/Allocation.sol", + "file": "./libraries/Allocation.sol", + "id": 13613, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 14880, + "sourceUnit": 16034, + "src": "1662:56:57", + "symbolAliases": [ + { + "foreign": { + "id": 13612, + "name": "Allocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16033, + "src": "1671:10:57", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "contracts/libraries/LegacyAllocation.sol", + "file": "./libraries/LegacyAllocation.sol", + "id": 13615, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 14880, + "sourceUnit": 16463, + "src": "1719:68:57", + "symbolAliases": [ + { + "foreign": { + "id": 13614, + "name": "LegacyAllocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16462, + "src": "1728:16:57", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "abstract": false, + "baseContracts": [ + { + "baseName": { + "id": 13617, + "name": "Initializable", + "nameLocations": [ + "2004:13:57" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5391, + "src": "2004:13:57" + }, + "id": 13618, + "nodeType": "InheritanceSpecifier", + "src": "2004:13:57" + }, + { + "baseName": { + "id": 13619, + "name": "OwnableUpgradeable", + "nameLocations": [ + "2023:18:57" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5123, + "src": "2023:18:57" + }, + "id": 13620, + "nodeType": "InheritanceSpecifier", + "src": "2023:18:57" + }, + { + "baseName": { + "id": 13621, + "name": "MulticallUpgradeable", + "nameLocations": [ + "2047:20:57" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5540, + "src": "2047:20:57" + }, + "id": 13622, + "nodeType": "InheritanceSpecifier", + "src": "2047:20:57" + }, + { + "baseName": { + "id": 13623, + "name": "DataService", + "nameLocations": [ + "2073:11:57" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 936, + "src": "2073:11:57" + }, + "id": 13624, + "nodeType": "InheritanceSpecifier", + "src": "2073:11:57" + }, + { + "baseName": { + "id": 13625, + "name": "DataServicePausableUpgradeable", + "nameLocations": [ + "2090:30:57" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 1425, + "src": "2090:30:57" + }, + "id": 13626, + "nodeType": "InheritanceSpecifier", + "src": "2090:30:57" + }, + { + "baseName": { + "id": 13627, + "name": "DataServiceFees", + "nameLocations": [ + "2126:15:57" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 1278, + "src": "2126:15:57" + }, + "id": 13628, + "nodeType": "InheritanceSpecifier", + "src": "2126:15:57" + }, + { + "baseName": { + "id": 13629, + "name": "Directory", + "nameLocations": [ + "2147:9:57" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 17720, + "src": "2147:9:57" + }, + "id": 13630, + "nodeType": "InheritanceSpecifier", + "src": "2147:9:57" + }, + { + "baseName": { + "id": 13631, + "name": "AllocationManager", + "nameLocations": [ + "2162:17:57" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 17363, + "src": "2162:17:57" + }, + "id": 13632, + "nodeType": "InheritanceSpecifier", + "src": "2162:17:57" + }, + { + "baseName": { + "id": 13633, + "name": "SubgraphServiceV1Storage", + "nameLocations": [ + "2185:24:57" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 14902, + "src": "2185:24:57" + }, + "id": 13634, + "nodeType": "InheritanceSpecifier", + "src": "2185:24:57" + }, + { + "baseName": { + "id": 13635, + "name": "IRewardsIssuer", + "nameLocations": [ + "2215:14:57" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 561, + "src": "2215:14:57" + }, + "id": 13636, + "nodeType": "InheritanceSpecifier", + "src": "2215:14:57" + }, + { + "baseName": { + "id": 13637, + "name": "ISubgraphService", + "nameLocations": [ + "2235:16:57" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 15634, + "src": "2235:16:57" + }, + "id": 13638, + "nodeType": "InheritanceSpecifier", + "src": "2235:16:57" + } + ], + "canonicalName": "SubgraphService", + "contractDependencies": [], + "contractKind": "contract", + "documentation": { + "id": 13616, + "nodeType": "StructuredDocumentation", + "src": "1789:182:57", + "text": " @title SubgraphService contract\n @custom:security-contact Please email security+contracts@thegraph.com if you find any\n bugs. We may have an active bug bounty program." + }, + "fullyImplemented": true, + "id": 14879, + "internalFunctionIDs": { + "1199": 1, + "1211": 2, + "1254": 3 + }, + "linearizedBaseContracts": [ + 14879, + 15634, + 561, + 14902, + 17363, + 17401, + 17720, + 1278, + 1620, + 1308, + 1425, + 1655, + 936, + 1557, + 945, + 2395, + 2425, + 4928, + 6044, + 6069, + 5700, + 5540, + 5123, + 5437, + 5391 + ], + "name": "SubgraphService", + "nameLocation": "1981:15:57", + "nodeType": "ContractDefinition", + "nodes": [ + { + "global": false, + "id": 13641, + "libraryName": { + "id": 13639, + "name": "PPMMath", + "nameLocations": [ + "2264:7:57" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 4539, + "src": "2264:7:57" + }, + "nodeType": "UsingForDirective", + "src": "2258:26:57", + "typeName": { + "id": 13640, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2276:7:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + }, + { + "global": false, + "id": 13647, + "libraryName": { + "id": 13642, + "name": "Allocation", + "nameLocations": [ + "2295:10:57" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 16033, + "src": "2295:10:57" + }, + "nodeType": "UsingForDirective", + "src": "2289:58:57", + "typeName": { + "id": 13646, + "keyName": "", + "keyNameLocation": "-1:-1:-1", + "keyType": { + "id": 13643, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2318:7:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "2310:36:57", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_State_$15663_storage_$", + "typeString": "mapping(address => struct Allocation.State)" + }, + "valueName": "", + "valueNameLocation": "-1:-1:-1", + "valueType": { + "id": 13645, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 13644, + "name": "Allocation.State", + "nameLocations": [ + "2329:10:57", + "2340:5:57" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 15663, + "src": "2329:16:57" + }, + "referencedDeclaration": 15663, + "src": "2329:16:57", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_storage_ptr", + "typeString": "struct Allocation.State" + } + } + } + }, + { + "global": false, + "id": 13651, + "libraryName": { + "id": 13648, + "name": "Allocation", + "nameLocations": [ + "2358:10:57" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 16033, + "src": "2358:10:57" + }, + "nodeType": "UsingForDirective", + "src": "2352:38:57", + "typeName": { + "id": 13650, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 13649, + "name": "Allocation.State", + "nameLocations": [ + "2373:10:57", + "2384:5:57" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 15663, + "src": "2373:16:57" + }, + "referencedDeclaration": 15663, + "src": "2373:16:57", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_storage_ptr", + "typeString": "struct Allocation.State" + } + } + }, + { + "global": false, + "id": 13655, + "libraryName": { + "id": 13652, + "name": "TokenUtils", + "nameLocations": [ + "2401:10:57" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 840, + "src": "2401:10:57" + }, + "nodeType": "UsingForDirective", + "src": "2395:33:57", + "typeName": { + "id": 13654, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 13653, + "name": "IGraphToken", + "nameLocations": [ + "2416:11:57" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 758, + "src": "2416:11:57" + }, + "referencedDeclaration": 758, + "src": "2416:11:57", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IGraphToken_$758", + "typeString": "contract IGraphToken" + } + } + }, + { + "body": { + "id": 13673, + "nodeType": "Block", + "src": "2599:118:57", + "statements": [ + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 13666, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "baseExpression": { + "id": 13661, + "name": "indexers", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14890, + "src": "2617:8:57", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Indexer_$15394_storage_$", + "typeString": "mapping(address => struct ISubgraphService.Indexer storage ref)" + } + }, + "id": 13663, + "indexExpression": { + "id": 13662, + "name": "indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13658, + "src": "2626:7:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "2617:17:57", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Indexer_$15394_storage", + "typeString": "struct ISubgraphService.Indexer storage ref" + } + }, + "id": 13664, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "2635:12:57", + "memberName": "registeredAt", + "nodeType": "MemberAccess", + "referencedDeclaration": 15389, + "src": "2617:30:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "hexValue": "30", + "id": 13665, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2651:1:57", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "2617:35:57", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [ + { + "id": 13668, + "name": "indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13658, + "src": "2690:7:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 13667, + "name": "SubgraphServiceIndexerNotRegistered", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15445, + "src": "2654:35:57", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_address_$returns$_t_error_$", + "typeString": "function (address) pure returns (error)" + } + }, + "id": 13669, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2654:44:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 13660, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "2609:7:57", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 13670, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2609:90:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 13671, + "nodeType": "ExpressionStatement", + "src": "2609:90:57" + }, + { + "id": 13672, + "nodeType": "PlaceholderStatement", + "src": "2709:1:57" + } + ] + }, + "documentation": { + "id": 13656, + "nodeType": "StructuredDocumentation", + "src": "2434:112:57", + "text": " @notice Checks that an indexer is registered\n @param indexer The address of the indexer" + }, + "id": 13674, + "name": "onlyRegisteredIndexer", + "nameLocation": "2560:21:57", + "nodeType": "ModifierDefinition", + "parameters": { + "id": 13659, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 13658, + "mutability": "mutable", + "name": "indexer", + "nameLocation": "2590:7:57", + "nodeType": "VariableDeclaration", + "scope": 13674, + "src": "2582:15:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 13657, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2582:7:57", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "2581:17:57" + }, + "src": "2551:166:57", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 13701, + "nodeType": "Block", + "src": "3421:39:57", + "statements": [ + { + "expression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 13698, + "name": "_disableInitializers", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5345, + "src": "3431:20:57", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$__$returns$__$", + "typeString": "function ()" + } + }, + "id": 13699, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3431:22:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 13700, + "nodeType": "ExpressionStatement", + "src": "3431:22:57" + } + ] + }, + "documentation": { + "id": 13675, + "nodeType": "StructuredDocumentation", + "src": "2723:446:57", + "text": " @notice Constructor for the SubgraphService contract\n @dev DataService and Directory constructors set a bunch of immutable variables\n @param graphController The address of the Graph Controller contract\n @param disputeManager The address of the DisputeManager contract\n @param graphTallyCollector The address of the GraphTallyCollector contract\n @param curation The address of the Curation contract" + }, + "id": 13702, + "implemented": true, + "kind": "constructor", + "modifiers": [ + { + "arguments": [ + { + "id": 13686, + "name": "graphController", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13677, + "src": "3332:15:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "id": 13687, + "kind": "baseConstructorSpecifier", + "modifierName": { + "id": 13685, + "name": "DataService", + "nameLocations": [ + "3320:11:57" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 936, + "src": "3320:11:57" + }, + "nodeType": "ModifierInvocation", + "src": "3320:28:57" + }, + { + "arguments": [ + { + "arguments": [ + { + "id": 13691, + "name": "this", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -28, + "src": "3367:4:57", + "typeDescriptions": { + "typeIdentifier": "t_contract$_SubgraphService_$14879", + "typeString": "contract SubgraphService" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_SubgraphService_$14879", + "typeString": "contract SubgraphService" + } + ], + "id": 13690, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "3359:7:57", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 13689, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3359:7:57", + "typeDescriptions": {} + } + }, + "id": 13692, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3359:13:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 13693, + "name": "disputeManager", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13679, + "src": "3374:14:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 13694, + "name": "graphTallyCollector", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13681, + "src": "3390:19:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 13695, + "name": "curation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13683, + "src": "3411:8:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "id": 13696, + "kind": "baseConstructorSpecifier", + "modifierName": { + "id": 13688, + "name": "Directory", + "nameLocations": [ + "3349:9:57" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 17720, + "src": "3349:9:57" + }, + "nodeType": "ModifierInvocation", + "src": "3349:71:57" + } + ], + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 13684, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 13677, + "mutability": "mutable", + "name": "graphController", + "nameLocation": "3203:15:57", + "nodeType": "VariableDeclaration", + "scope": 13702, + "src": "3195:23:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 13676, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3195:7:57", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 13679, + "mutability": "mutable", + "name": "disputeManager", + "nameLocation": "3236:14:57", + "nodeType": "VariableDeclaration", + "scope": 13702, + "src": "3228:22:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 13678, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3228:7:57", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 13681, + "mutability": "mutable", + "name": "graphTallyCollector", + "nameLocation": "3268:19:57", + "nodeType": "VariableDeclaration", + "scope": 13702, + "src": "3260:27:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 13680, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3260:7:57", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 13683, + "mutability": "mutable", + "name": "curation", + "nameLocation": "3305:8:57", + "nodeType": "VariableDeclaration", + "scope": 13702, + "src": "3297:16:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 13682, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3297:7:57", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "3185:134:57" + }, + "returnParameters": { + "id": 13697, + "nodeType": "ParameterList", + "parameters": [], + "src": "3421:0:57" + }, + "scope": 14879, + "src": "3174:286:57", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "public" + }, + { + "baseFunctions": [ + 15509 + ], + "body": { + "id": 13751, + "nodeType": "Block", + "src": "3687:374:57", + "statements": [ + { + "expression": { + "arguments": [ + { + "id": 13717, + "name": "owner", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13705, + "src": "3712:5:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 13716, + "name": "__Ownable_init", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4983, + "src": "3697:14:57", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$__$", + "typeString": "function (address)" + } + }, + "id": 13718, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3697:21:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 13719, + "nodeType": "ExpressionStatement", + "src": "3697:21:57" + }, + { + "expression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 13720, + "name": "__Multicall_init", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5456, + "src": "3728:16:57", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$__$returns$__$", + "typeString": "function ()" + } + }, + "id": 13721, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3728:18:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 13722, + "nodeType": "ExpressionStatement", + "src": "3728:18:57" + }, + { + "expression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 13723, + "name": "__DataService_init", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 928, + "src": "3756:18:57", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$__$returns$__$", + "typeString": "function ()" + } + }, + "id": 13724, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3756:20:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 13725, + "nodeType": "ExpressionStatement", + "src": "3756:20:57" + }, + { + "expression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 13726, + "name": "__DataServicePausable_init", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1384, + "src": "3786:26:57", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$__$returns$__$", + "typeString": "function ()" + } + }, + "id": 13727, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3786:28:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 13728, + "nodeType": "ExpressionStatement", + "src": "3786:28:57" + }, + { + "expression": { + "arguments": [ + { + "hexValue": "537562677261706853657276696365", + "id": 13730, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3849:17:57", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_de968410163c85e985eeb4fbd7957aae2a5a7499745e7a8f1fd22402a4e5c8b0", + "typeString": "literal_string \"SubgraphService\"" + }, + "value": "SubgraphService" + }, + { + "hexValue": "312e30", + "id": 13731, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3868:5:57", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_e6bbd6277e1bf288eed5e8d1780f9a50b239e86b153736bceebccf4ea79d90b3", + "typeString": "literal_string \"1.0\"" + }, + "value": "1.0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_stringliteral_de968410163c85e985eeb4fbd7957aae2a5a7499745e7a8f1fd22402a4e5c8b0", + "typeString": "literal_string \"SubgraphService\"" + }, + { + "typeIdentifier": "t_stringliteral_e6bbd6277e1bf288eed5e8d1780f9a50b239e86b153736bceebccf4ea79d90b3", + "typeString": "literal_string \"1.0\"" + } + ], + "id": 13729, + "name": "__AllocationManager_init", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16649, + "src": "3824:24:57", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_string_memory_ptr_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (string memory,string memory)" + } + }, + "id": 13732, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3824:50:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 13733, + "nodeType": "ExpressionStatement", + "src": "3824:50:57" + }, + { + "expression": { + "arguments": [ + { + "id": 13735, + "name": "minimumProvisionTokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13707, + "src": "3910:22:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "expression": { + "arguments": [ + { + "id": 13738, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "3939:7:57", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + }, + "typeName": { + "id": 13737, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "3939:7:57", + "typeDescriptions": {} + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + } + ], + "id": 13736, + "name": "type", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -27, + "src": "3934:4:57", + "typeDescriptions": { + "typeIdentifier": "t_function_metatype_pure$__$returns$__$", + "typeString": "function () pure" + } + }, + "id": 13739, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3934:13:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_magic_meta_type_t_uint256", + "typeString": "type(uint256)" + } + }, + "id": 13740, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "3948:3:57", + "memberName": "max", + "nodeType": "MemberAccess", + "src": "3934:17:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 13734, + "name": "_setProvisionTokensRange", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2089, + "src": "3885:24:57", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$_t_uint256_$returns$__$", + "typeString": "function (uint256,uint256)" + } + }, + "id": 13741, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3885:67:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 13742, + "nodeType": "ExpressionStatement", + "src": "3885:67:57" + }, + { + "expression": { + "arguments": [ + { + "id": 13744, + "name": "maximumDelegationRatio", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13709, + "src": "3982:22:57", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + ], + "id": 13743, + "name": "_setDelegationRatio", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2057, + "src": "3962:19:57", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_uint32_$returns$__$", + "typeString": "function (uint32)" + } + }, + "id": 13745, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3962:43:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 13746, + "nodeType": "ExpressionStatement", + "src": "3962:43:57" + }, + { + "expression": { + "arguments": [ + { + "id": 13748, + "name": "stakeToFeesRatio_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13711, + "src": "4036:17:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 13747, + "name": "_setStakeToFeesRatio", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14855, + "src": "4015:20:57", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256)" + } + }, + "id": 13749, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4015:39:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 13750, + "nodeType": "ExpressionStatement", + "src": "4015:39:57" + } + ] + }, + "documentation": { + "id": 13703, + "nodeType": "StructuredDocumentation", + "src": "3466:32:57", + "text": "@inheritdoc ISubgraphService" + }, + "functionSelector": "c84a5ef3", + "id": 13752, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "id": 13714, + "kind": "modifierInvocation", + "modifierName": { + "id": 13713, + "name": "initializer", + "nameLocations": [ + "3675:11:57" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5231, + "src": "3675:11:57" + }, + "nodeType": "ModifierInvocation", + "src": "3675:11:57" + } + ], + "name": "initialize", + "nameLocation": "3512:10:57", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 13712, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 13705, + "mutability": "mutable", + "name": "owner", + "nameLocation": "3540:5:57", + "nodeType": "VariableDeclaration", + "scope": 13752, + "src": "3532:13:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 13704, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3532:7:57", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 13707, + "mutability": "mutable", + "name": "minimumProvisionTokens", + "nameLocation": "3563:22:57", + "nodeType": "VariableDeclaration", + "scope": 13752, + "src": "3555:30:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 13706, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "3555:7:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 13709, + "mutability": "mutable", + "name": "maximumDelegationRatio", + "nameLocation": "3602:22:57", + "nodeType": "VariableDeclaration", + "scope": 13752, + "src": "3595:29:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 13708, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "3595:6:57", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 13711, + "mutability": "mutable", + "name": "stakeToFeesRatio_", + "nameLocation": "3642:17:57", + "nodeType": "VariableDeclaration", + "scope": 13752, + "src": "3634:25:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 13710, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "3634:7:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "3522:143:57" + }, + "returnParameters": { + "id": 13715, + "nodeType": "ParameterList", + "parameters": [], + "src": "3687:0:57" + }, + "scope": 14879, + "src": "3503:558:57", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "baseFunctions": [ + 1481 + ], + "body": { + "id": 13851, + "nodeType": "Block", + "src": "4979:726:57", + "statements": [ + { + "assignments": [ + 13770, + 13772, + 13774 + ], + "declarations": [ + { + "constant": false, + "id": 13770, + "mutability": "mutable", + "name": "url", + "nameLocation": "5004:3:57", + "nodeType": "VariableDeclaration", + "scope": 13851, + "src": "4990:17:57", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 13769, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "4990:6:57", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 13772, + "mutability": "mutable", + "name": "geohash", + "nameLocation": "5023:7:57", + "nodeType": "VariableDeclaration", + "scope": 13851, + "src": "5009:21:57", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 13771, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "5009:6:57", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 13774, + "mutability": "mutable", + "name": "paymentsDestination_", + "nameLocation": "5040:20:57", + "nodeType": "VariableDeclaration", + "scope": 13851, + "src": "5032:28:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 13773, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5032:7:57", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "id": 13786, + "initialValue": { + "arguments": [ + { + "id": 13777, + "name": "data", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13757, + "src": "5088:4:57", + "typeDescriptions": { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes calldata" + } + }, + { + "components": [ + { + "id": 13779, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "5107:6:57", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_string_storage_ptr_$", + "typeString": "type(string storage pointer)" + }, + "typeName": { + "id": 13778, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "5107:6:57", + "typeDescriptions": {} + } + }, + { + "id": 13781, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "5115:6:57", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_string_storage_ptr_$", + "typeString": "type(string storage pointer)" + }, + "typeName": { + "id": 13780, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "5115:6:57", + "typeDescriptions": {} + } + }, + { + "id": 13783, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "5123:7:57", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 13782, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5123:7:57", + "typeDescriptions": {} + } + } + ], + "id": 13784, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "5106:25:57", + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_type$_t_string_storage_ptr_$_$_t_type$_t_string_storage_ptr_$_$_t_type$_t_address_$_$", + "typeString": "tuple(type(string storage pointer),type(string storage pointer),type(address))" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes calldata" + }, + { + "typeIdentifier": "t_tuple$_t_type$_t_string_storage_ptr_$_$_t_type$_t_string_storage_ptr_$_$_t_type$_t_address_$_$", + "typeString": "tuple(type(string storage pointer),type(string storage pointer),type(address))" + } + ], + "expression": { + "id": 13775, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -1, + "src": "5064:3:57", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 13776, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "5068:6:57", + "memberName": "decode", + "nodeType": "MemberAccess", + "src": "5064:10:57", + "typeDescriptions": { + "typeIdentifier": "t_function_abidecode_pure$__$returns$__$", + "typeString": "function () pure" + } + }, + "id": 13785, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5064:77:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_string_memory_ptr_$_t_string_memory_ptr_$_t_address_payable_$", + "typeString": "tuple(string memory,string memory,address payable)" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "4989:152:57" + }, + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 13794, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "arguments": [ + { + "id": 13790, + "name": "url", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13770, + "src": "5166:3:57", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + ], + "id": 13789, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "5160:5:57", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes_storage_ptr_$", + "typeString": "type(bytes storage pointer)" + }, + "typeName": { + "id": 13788, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "5160:5:57", + "typeDescriptions": {} + } + }, + "id": 13791, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5160:10:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 13792, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "5171:6:57", + "memberName": "length", + "nodeType": "MemberAccess", + "src": "5160:17:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "hexValue": "30", + "id": 13793, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "5180:1:57", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "5160:21:57", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 13795, + "name": "SubgraphServiceEmptyUrl", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15434, + "src": "5183:23:57", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$__$returns$_t_error_$", + "typeString": "function () pure returns (error)" + } + }, + "id": 13796, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5183:25:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 13787, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "5152:7:57", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 13797, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5152:57:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 13798, + "nodeType": "ExpressionStatement", + "src": "5152:57:57" + }, + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 13806, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "arguments": [ + { + "id": 13802, + "name": "geohash", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13772, + "src": "5233:7:57", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + ], + "id": 13801, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "5227:5:57", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes_storage_ptr_$", + "typeString": "type(bytes storage pointer)" + }, + "typeName": { + "id": 13800, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "5227:5:57", + "typeDescriptions": {} + } + }, + "id": 13803, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5227:14:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 13804, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "5242:6:57", + "memberName": "length", + "nodeType": "MemberAccess", + "src": "5227:21:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "hexValue": "30", + "id": 13805, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "5251:1:57", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "5227:25:57", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 13807, + "name": "SubgraphServiceEmptyGeohash", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15437, + "src": "5254:27:57", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$__$returns$_t_error_$", + "typeString": "function () pure returns (error)" + } + }, + "id": 13808, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5254:29:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 13799, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "5219:7:57", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 13809, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5219:65:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 13810, + "nodeType": "ExpressionStatement", + "src": "5219:65:57" + }, + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 13817, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "baseExpression": { + "id": 13812, + "name": "indexers", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14890, + "src": "5302:8:57", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Indexer_$15394_storage_$", + "typeString": "mapping(address => struct ISubgraphService.Indexer storage ref)" + } + }, + "id": 13814, + "indexExpression": { + "id": 13813, + "name": "indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13755, + "src": "5311:7:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "5302:17:57", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Indexer_$15394_storage", + "typeString": "struct ISubgraphService.Indexer storage ref" + } + }, + "id": 13815, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "5320:12:57", + "memberName": "registeredAt", + "nodeType": "MemberAccess", + "referencedDeclaration": 15389, + "src": "5302:30:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "30", + "id": 13816, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "5336:1:57", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "5302:35:57", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 13818, + "name": "SubgraphServiceIndexerAlreadyRegistered", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15440, + "src": "5339:39:57", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$__$returns$_t_error_$", + "typeString": "function () pure returns (error)" + } + }, + "id": 13819, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5339:41:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 13811, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "5294:7:57", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 13820, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5294:87:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 13821, + "nodeType": "ExpressionStatement", + "src": "5294:87:57" + }, + { + "expression": { + "id": 13831, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "baseExpression": { + "id": 13822, + "name": "indexers", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14890, + "src": "5424:8:57", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Indexer_$15394_storage_$", + "typeString": "mapping(address => struct ISubgraphService.Indexer storage ref)" + } + }, + "id": 13824, + "indexExpression": { + "id": 13823, + "name": "indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13755, + "src": "5433:7:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "5424:17:57", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Indexer_$15394_storage", + "typeString": "struct ISubgraphService.Indexer storage ref" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "expression": { + "id": 13826, + "name": "block", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -4, + "src": "5468:5:57", + "typeDescriptions": { + "typeIdentifier": "t_magic_block", + "typeString": "block" + } + }, + "id": 13827, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "5474:9:57", + "memberName": "timestamp", + "nodeType": "MemberAccess", + "src": "5468:15:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 13828, + "name": "url", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13770, + "src": "5490:3:57", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + }, + { + "id": 13829, + "name": "geohash", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13772, + "src": "5504:7:57", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + }, + { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + ], + "id": 13825, + "name": "Indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15394, + "src": "5444:7:57", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_struct$_Indexer_$15394_storage_ptr_$", + "typeString": "type(struct ISubgraphService.Indexer storage pointer)" + } + }, + "id": 13830, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "structConstructorCall", + "lValueRequested": false, + "nameLocations": [ + "5454:12:57", + "5485:3:57", + "5495:7:57" + ], + "names": [ + "registeredAt", + "url", + "geoHash" + ], + "nodeType": "FunctionCall", + "src": "5444:70:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_Indexer_$15394_memory_ptr", + "typeString": "struct ISubgraphService.Indexer memory" + } + }, + "src": "5424:90:57", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Indexer_$15394_storage", + "typeString": "struct ISubgraphService.Indexer storage ref" + } + }, + "id": 13832, + "nodeType": "ExpressionStatement", + "src": "5424:90:57" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 13838, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 13833, + "name": "paymentsDestination_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13774, + "src": "5528:20:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "arguments": [ + { + "hexValue": "30", + "id": 13836, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "5560:1:57", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 13835, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "5552:7:57", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 13834, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5552:7:57", + "typeDescriptions": {} + } + }, + "id": 13837, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5552:10:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "5528:34:57", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 13845, + "nodeType": "IfStatement", + "src": "5524:119:57", + "trueBody": { + "id": 13844, + "nodeType": "Block", + "src": "5564:79:57", + "statements": [ + { + "expression": { + "arguments": [ + { + "id": 13840, + "name": "indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13755, + "src": "5602:7:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 13841, + "name": "paymentsDestination_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13774, + "src": "5611:20:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 13839, + "name": "_setPaymentsDestination", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14832, + "src": "5578:23:57", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$returns$__$", + "typeString": "function (address,address)" + } + }, + "id": 13842, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5578:54:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 13843, + "nodeType": "ExpressionStatement", + "src": "5578:54:57" + } + ] + } + }, + { + "eventCall": { + "arguments": [ + { + "id": 13847, + "name": "indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13755, + "src": "5684:7:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 13848, + "name": "data", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13757, + "src": "5693:4:57", + "typeDescriptions": { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes calldata" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes calldata" + } + ], + "id": 13846, + "name": "ServiceProviderRegistered", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1437, + "src": "5658:25:57", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_bytes_memory_ptr_$returns$__$", + "typeString": "function (address,bytes memory)" + } + }, + "id": 13849, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5658:40:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 13850, + "nodeType": "EmitStatement", + "src": "5653:45:57" + } + ] + }, + "documentation": { + "id": 13753, + "nodeType": "StructuredDocumentation", + "src": "4772:28:57", + "text": "@inheritdoc IDataService" + }, + "functionSelector": "24b8fbf6", + "id": 13852, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": [ + { + "id": 13761, + "name": "indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13755, + "src": "4928:7:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "id": 13762, + "kind": "modifierInvocation", + "modifierName": { + "id": 13760, + "name": "onlyAuthorizedForProvision", + "nameLocations": [ + "4901:26:57" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 1963, + "src": "4901:26:57" + }, + "nodeType": "ModifierInvocation", + "src": "4901:35:57" + }, + { + "arguments": [ + { + "id": 13764, + "name": "indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13755, + "src": "4956:7:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "id": 13765, + "kind": "modifierInvocation", + "modifierName": { + "id": 13763, + "name": "onlyValidProvision", + "nameLocations": [ + "4937:18:57" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 1988, + "src": "4937:18:57" + }, + "nodeType": "ModifierInvocation", + "src": "4937:27:57" + }, + { + "id": 13767, + "kind": "modifierInvocation", + "modifierName": { + "id": 13766, + "name": "whenNotPaused", + "nameLocations": [ + "4965:13:57" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5590, + "src": "4965:13:57" + }, + "nodeType": "ModifierInvocation", + "src": "4965:13:57" + } + ], + "name": "register", + "nameLocation": "4814:8:57", + "nodeType": "FunctionDefinition", + "overrides": { + "id": 13759, + "nodeType": "OverrideSpecifier", + "overrides": [], + "src": "4892:8:57" + }, + "parameters": { + "id": 13758, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 13755, + "mutability": "mutable", + "name": "indexer", + "nameLocation": "4840:7:57", + "nodeType": "VariableDeclaration", + "scope": 13852, + "src": "4832:15:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 13754, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4832:7:57", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 13757, + "mutability": "mutable", + "name": "data", + "nameLocation": "4872:4:57", + "nodeType": "VariableDeclaration", + "scope": 13852, + "src": "4857:19:57", + "stateVariable": false, + "storageLocation": "calldata", + "typeDescriptions": { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 13756, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "4857:5:57", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "src": "4822:60:57" + }, + "returnParameters": { + "id": 13768, + "nodeType": "ParameterList", + "parameters": [], + "src": "4979:0:57" + }, + "scope": 14879, + "src": "4805:900:57", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "baseFunctions": [ + 1489 + ], + "body": { + "id": 13874, + "nodeType": "Block", + "src": "6490:110:57", + "statements": [ + { + "expression": { + "arguments": [ + { + "id": 13867, + "name": "indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13855, + "src": "6527:7:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 13866, + "name": "_acceptProvisionParameters", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2042, + "src": "6500:26:57", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$__$", + "typeString": "function (address)" + } + }, + "id": 13868, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "6500:35:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 13869, + "nodeType": "ExpressionStatement", + "src": "6500:35:57" + }, + { + "eventCall": { + "arguments": [ + { + "id": 13871, + "name": "indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13855, + "src": "6585:7:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 13870, + "name": "ProvisionPendingParametersAccepted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1442, + "src": "6550:34:57", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$returns$__$", + "typeString": "function (address)" + } + }, + "id": 13872, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "6550:43:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 13873, + "nodeType": "EmitStatement", + "src": "6545:48:57" + } + ] + }, + "documentation": { + "id": 13853, + "nodeType": "StructuredDocumentation", + "src": "6292:28:57", + "text": "@inheritdoc IDataService" + }, + "functionSelector": "ce0fc0cc", + "id": 13875, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": [ + { + "id": 13861, + "name": "indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13855, + "src": "6467:7:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "id": 13862, + "kind": "modifierInvocation", + "modifierName": { + "id": 13860, + "name": "onlyAuthorizedForProvision", + "nameLocations": [ + "6440:26:57" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 1963, + "src": "6440:26:57" + }, + "nodeType": "ModifierInvocation", + "src": "6440:35:57" + }, + { + "id": 13864, + "kind": "modifierInvocation", + "modifierName": { + "id": 13863, + "name": "whenNotPaused", + "nameLocations": [ + "6476:13:57" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5590, + "src": "6476:13:57" + }, + "nodeType": "ModifierInvocation", + "src": "6476:13:57" + } + ], + "name": "acceptProvisionPendingParameters", + "nameLocation": "6334:32:57", + "nodeType": "FunctionDefinition", + "overrides": { + "id": 13859, + "nodeType": "OverrideSpecifier", + "overrides": [], + "src": "6431:8:57" + }, + "parameters": { + "id": 13858, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 13855, + "mutability": "mutable", + "name": "indexer", + "nameLocation": "6384:7:57", + "nodeType": "VariableDeclaration", + "scope": 13875, + "src": "6376:15:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 13854, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6376:7:57", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 13857, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 13875, + "src": "6401:14:57", + "stateVariable": false, + "storageLocation": "calldata", + "typeDescriptions": { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 13856, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "6401:5:57", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "src": "6366:55:57" + }, + "returnParameters": { + "id": 13865, + "nodeType": "ParameterList", + "parameters": [], + "src": "6490:0:57" + }, + "scope": 14879, + "src": "6325:275:57", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "baseFunctions": [ + 1497 + ], + "body": { + "id": 13931, + "nodeType": "Block", + "src": "8058:355:57", + "statements": [ + { + "assignments": [ + 13896, + 13898, + 13900, + 13902 + ], + "declarations": [ + { + "constant": false, + "id": 13896, + "mutability": "mutable", + "name": "subgraphDeploymentId", + "nameLocation": "8077:20:57", + "nodeType": "VariableDeclaration", + "scope": 13931, + "src": "8069:28:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 13895, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "8069:7:57", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 13898, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "8107:6:57", + "nodeType": "VariableDeclaration", + "scope": 13931, + "src": "8099:14:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 13897, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "8099:7:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 13900, + "mutability": "mutable", + "name": "allocationId", + "nameLocation": "8123:12:57", + "nodeType": "VariableDeclaration", + "scope": 13931, + "src": "8115:20:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 13899, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "8115:7:57", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 13902, + "mutability": "mutable", + "name": "allocationProof", + "nameLocation": "8150:15:57", + "nodeType": "VariableDeclaration", + "scope": 13931, + "src": "8137:28:57", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 13901, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "8137:5:57", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "id": 13916, + "initialValue": { + "arguments": [ + { + "id": 13905, + "name": "data", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13880, + "src": "8193:4:57", + "typeDescriptions": { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes calldata" + } + }, + { + "components": [ + { + "id": 13907, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "8212:7:57", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes32_$", + "typeString": "type(bytes32)" + }, + "typeName": { + "id": 13906, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "8212:7:57", + "typeDescriptions": {} + } + }, + { + "id": 13909, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "8221:7:57", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + }, + "typeName": { + "id": 13908, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "8221:7:57", + "typeDescriptions": {} + } + }, + { + "id": 13911, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "8230:7:57", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 13910, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "8230:7:57", + "typeDescriptions": {} + } + }, + { + "id": 13913, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "8239:5:57", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes_storage_ptr_$", + "typeString": "type(bytes storage pointer)" + }, + "typeName": { + "id": 13912, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "8239:5:57", + "typeDescriptions": {} + } + } + ], + "id": 13914, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "8211:34:57", + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_type$_t_bytes32_$_$_t_type$_t_uint256_$_$_t_type$_t_address_$_$_t_type$_t_bytes_storage_ptr_$_$", + "typeString": "tuple(type(bytes32),type(uint256),type(address),type(bytes storage pointer))" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes calldata" + }, + { + "typeIdentifier": "t_tuple$_t_type$_t_bytes32_$_$_t_type$_t_uint256_$_$_t_type$_t_address_$_$_t_type$_t_bytes_storage_ptr_$_$", + "typeString": "tuple(type(bytes32),type(uint256),type(address),type(bytes storage pointer))" + } + ], + "expression": { + "id": 13903, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -1, + "src": "8169:3:57", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 13904, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "8173:6:57", + "memberName": "decode", + "nodeType": "MemberAccess", + "src": "8169:10:57", + "typeDescriptions": { + "typeIdentifier": "t_function_abidecode_pure$__$returns$__$", + "typeString": "function () pure" + } + }, + "id": 13915, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "8169:86:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_bytes32_$_t_uint256_$_t_address_payable_$_t_bytes_memory_ptr_$", + "typeString": "tuple(bytes32,uint256,address payable,bytes memory)" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "8068:187:57" + }, + { + "expression": { + "arguments": [ + { + "id": 13918, + "name": "indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13878, + "src": "8275:7:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 13919, + "name": "allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13900, + "src": "8284:12:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 13920, + "name": "subgraphDeploymentId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13896, + "src": "8298:20:57", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "id": 13921, + "name": "tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13898, + "src": "8320:6:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 13922, + "name": "allocationProof", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13902, + "src": "8328:15:57", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + { + "id": 13923, + "name": "_delegationRatio", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2419, + "src": "8345:16:57", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + }, + { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + ], + "id": 13917, + "name": "_allocate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16781, + "src": "8265:9:57", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_bytes32_$_t_uint256_$_t_bytes_memory_ptr_$_t_uint32_$returns$__$", + "typeString": "function (address,address,bytes32,uint256,bytes memory,uint32)" + } + }, + "id": 13924, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "8265:97:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 13925, + "nodeType": "ExpressionStatement", + "src": "8265:97:57" + }, + { + "eventCall": { + "arguments": [ + { + "id": 13927, + "name": "indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13878, + "src": "8392:7:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 13928, + "name": "data", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13880, + "src": "8401:4:57", + "typeDescriptions": { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes calldata" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes calldata" + } + ], + "id": 13926, + "name": "ServiceStarted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1449, + "src": "8377:14:57", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_bytes_memory_ptr_$returns$__$", + "typeString": "function (address,bytes memory)" + } + }, + "id": 13929, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "8377:29:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 13930, + "nodeType": "EmitStatement", + "src": "8372:34:57" + } + ] + }, + "documentation": { + "id": 13876, + "nodeType": "StructuredDocumentation", + "src": "7764:28:57", + "text": "@inheritdoc IDataService" + }, + "functionSelector": "dedf6726", + "id": 13932, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": [ + { + "id": 13884, + "name": "indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13878, + "src": "7948:7:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "id": 13885, + "kind": "modifierInvocation", + "modifierName": { + "id": 13883, + "name": "onlyAuthorizedForProvision", + "nameLocations": [ + "7921:26:57" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 1963, + "src": "7921:26:57" + }, + "nodeType": "ModifierInvocation", + "src": "7921:35:57" + }, + { + "arguments": [ + { + "id": 13887, + "name": "indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13878, + "src": "7984:7:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "id": 13888, + "kind": "modifierInvocation", + "modifierName": { + "id": 13886, + "name": "onlyValidProvision", + "nameLocations": [ + "7965:18:57" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 1988, + "src": "7965:18:57" + }, + "nodeType": "ModifierInvocation", + "src": "7965:27:57" + }, + { + "arguments": [ + { + "id": 13890, + "name": "indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13878, + "src": "8023:7:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "id": 13891, + "kind": "modifierInvocation", + "modifierName": { + "id": 13889, + "name": "onlyRegisteredIndexer", + "nameLocations": [ + "8001:21:57" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 13674, + "src": "8001:21:57" + }, + "nodeType": "ModifierInvocation", + "src": "8001:30:57" + }, + { + "id": 13893, + "kind": "modifierInvocation", + "modifierName": { + "id": 13892, + "name": "whenNotPaused", + "nameLocations": [ + "8040:13:57" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5590, + "src": "8040:13:57" + }, + "nodeType": "ModifierInvocation", + "src": "8040:13:57" + } + ], + "name": "startService", + "nameLocation": "7806:12:57", + "nodeType": "FunctionDefinition", + "overrides": { + "id": 13882, + "nodeType": "OverrideSpecifier", + "overrides": [], + "src": "7904:8:57" + }, + "parameters": { + "id": 13881, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 13878, + "mutability": "mutable", + "name": "indexer", + "nameLocation": "7836:7:57", + "nodeType": "VariableDeclaration", + "scope": 13932, + "src": "7828:15:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 13877, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "7828:7:57", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 13880, + "mutability": "mutable", + "name": "data", + "nameLocation": "7868:4:57", + "nodeType": "VariableDeclaration", + "scope": 13932, + "src": "7853:19:57", + "stateVariable": false, + "storageLocation": "calldata", + "typeDescriptions": { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 13879, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "7853:5:57", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "src": "7818:60:57" + }, + "returnParameters": { + "id": 13894, + "nodeType": "ParameterList", + "parameters": [], + "src": "8058:0:57" + }, + "scope": 14879, + "src": "7797:616:57", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "baseFunctions": [ + 1505 + ], + "body": { + "id": 13983, + "nodeType": "Block", + "src": "9664:323:57", + "statements": [ + { + "assignments": [ + 13950 + ], + "declarations": [ + { + "constant": false, + "id": 13950, + "mutability": "mutable", + "name": "allocationId", + "nameLocation": "9682:12:57", + "nodeType": "VariableDeclaration", + "scope": 13983, + "src": "9674:20:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 13949, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "9674:7:57", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "id": 13958, + "initialValue": { + "arguments": [ + { + "id": 13953, + "name": "data", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13937, + "src": "9708:4:57", + "typeDescriptions": { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes calldata" + } + }, + { + "components": [ + { + "id": 13955, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "9715:7:57", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 13954, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "9715:7:57", + "typeDescriptions": {} + } + } + ], + "id": 13956, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "9714:9:57", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes calldata" + }, + { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + } + ], + "expression": { + "id": 13951, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -1, + "src": "9697:3:57", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 13952, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "9701:6:57", + "memberName": "decode", + "nodeType": "MemberAccess", + "src": "9697:10:57", + "typeDescriptions": { + "typeIdentifier": "t_function_abidecode_pure$__$returns$__$", + "typeString": "function () pure" + } + }, + "id": 13957, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "9697:27:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "9674:50:57" + }, + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 13966, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "arguments": [ + { + "id": 13962, + "name": "allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13950, + "src": "9772:12:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "expression": { + "id": 13960, + "name": "_allocations", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17376, + "src": "9755:12:57", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_State_$15663_storage_$", + "typeString": "mapping(address => struct Allocation.State storage ref)" + } + }, + "id": 13961, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "9768:3:57", + "memberName": "get", + "nodeType": "MemberAccess", + "referencedDeclaration": 15913, + "src": "9755:16:57", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_mapping$_t_address_$_t_struct$_State_$15663_storage_$_$_t_address_$returns$_t_struct$_State_$15663_memory_ptr_$attached_to$_t_mapping$_t_address_$_t_struct$_State_$15663_storage_$_$", + "typeString": "function (mapping(address => struct Allocation.State storage ref),address) view returns (struct Allocation.State memory)" + } + }, + "id": 13963, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "9755:30:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "id": 13964, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "9786:7:57", + "memberName": "indexer", + "nodeType": "MemberAccess", + "referencedDeclaration": 15646, + "src": "9755:38:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "id": 13965, + "name": "indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13935, + "src": "9797:7:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "9755:49:57", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [ + { + "id": 13968, + "name": "indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13935, + "src": "9857:7:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 13969, + "name": "allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13950, + "src": "9866:12:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 13967, + "name": "SubgraphServiceAllocationNotAuthorized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15472, + "src": "9818:38:57", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_address_$_t_address_$returns$_t_error_$", + "typeString": "function (address,address) pure returns (error)" + } + }, + "id": 13970, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "9818:61:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 13959, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "9734:7:57", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 13971, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "9734:155:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 13972, + "nodeType": "ExpressionStatement", + "src": "9734:155:57" + }, + { + "expression": { + "arguments": [ + { + "id": 13974, + "name": "allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13950, + "src": "9916:12:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "hexValue": "66616c7365", + "id": 13975, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "9930:5:57", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 13973, + "name": "_closeAllocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17273, + "src": "9899:16:57", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_bool_$returns$__$", + "typeString": "function (address,bool)" + } + }, + "id": 13976, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "9899:37:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 13977, + "nodeType": "ExpressionStatement", + "src": "9899:37:57" + }, + { + "eventCall": { + "arguments": [ + { + "id": 13979, + "name": "indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13935, + "src": "9966:7:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 13980, + "name": "data", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13937, + "src": "9975:4:57", + "typeDescriptions": { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes calldata" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes calldata" + } + ], + "id": 13978, + "name": "ServiceStopped", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1456, + "src": "9951:14:57", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_bytes_memory_ptr_$returns$__$", + "typeString": "function (address,bytes memory)" + } + }, + "id": 13981, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "9951:29:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 13982, + "nodeType": "EmitStatement", + "src": "9946:34:57" + } + ] + }, + "documentation": { + "id": 13933, + "nodeType": "StructuredDocumentation", + "src": "9451:28:57", + "text": "@inheritdoc IDataService" + }, + "functionSelector": "8180083b", + "id": 13984, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": [ + { + "id": 13941, + "name": "indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13935, + "src": "9610:7:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "id": 13942, + "kind": "modifierInvocation", + "modifierName": { + "id": 13940, + "name": "onlyAuthorizedForProvision", + "nameLocations": [ + "9583:26:57" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 1963, + "src": "9583:26:57" + }, + "nodeType": "ModifierInvocation", + "src": "9583:35:57" + }, + { + "arguments": [ + { + "id": 13944, + "name": "indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13935, + "src": "9641:7:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "id": 13945, + "kind": "modifierInvocation", + "modifierName": { + "id": 13943, + "name": "onlyRegisteredIndexer", + "nameLocations": [ + "9619:21:57" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 13674, + "src": "9619:21:57" + }, + "nodeType": "ModifierInvocation", + "src": "9619:30:57" + }, + { + "id": 13947, + "kind": "modifierInvocation", + "modifierName": { + "id": 13946, + "name": "whenNotPaused", + "nameLocations": [ + "9650:13:57" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5590, + "src": "9650:13:57" + }, + "nodeType": "ModifierInvocation", + "src": "9650:13:57" + } + ], + "name": "stopService", + "nameLocation": "9493:11:57", + "nodeType": "FunctionDefinition", + "overrides": { + "id": 13939, + "nodeType": "OverrideSpecifier", + "overrides": [], + "src": "9574:8:57" + }, + "parameters": { + "id": 13938, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 13935, + "mutability": "mutable", + "name": "indexer", + "nameLocation": "9522:7:57", + "nodeType": "VariableDeclaration", + "scope": 13984, + "src": "9514:15:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 13934, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "9514:7:57", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 13937, + "mutability": "mutable", + "name": "data", + "nameLocation": "9554:4:57", + "nodeType": "VariableDeclaration", + "scope": 13984, + "src": "9539:19:57", + "stateVariable": false, + "storageLocation": "calldata", + "typeDescriptions": { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 13936, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "9539:5:57", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "src": "9504:60:57" + }, + "returnParameters": { + "id": 13948, + "nodeType": "ParameterList", + "parameters": [], + "src": "9664:0:57" + }, + "scope": 14879, + "src": "9484:503:57", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "baseFunctions": [ + 1518 + ], + "body": { + "id": 14054, + "nodeType": "Block", + "src": "11826:536:57", + "statements": [ + { + "assignments": [ + 14010 + ], + "declarations": [ + { + "constant": false, + "id": 14010, + "mutability": "mutable", + "name": "paymentCollected", + "nameLocation": "11844:16:57", + "nodeType": "VariableDeclaration", + "scope": 14054, + "src": "11836:24:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 14009, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "11836:7:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 14012, + "initialValue": { + "hexValue": "30", + "id": 14011, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "11863:1:57", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "nodeType": "VariableDeclarationStatement", + "src": "11836:28:57" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_enum$_PaymentTypes_$2433", + "typeString": "enum IGraphPayments.PaymentTypes" + }, + "id": 14017, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 14013, + "name": "paymentType", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13990, + "src": "11879:11:57", + "typeDescriptions": { + "typeIdentifier": "t_enum$_PaymentTypes_$2433", + "typeString": "enum IGraphPayments.PaymentTypes" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "expression": { + "expression": { + "id": 14014, + "name": "IGraphPayments", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2489, + "src": "11894:14:57", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_IGraphPayments_$2489_$", + "typeString": "type(contract IGraphPayments)" + } + }, + "id": 14015, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "11909:12:57", + "memberName": "PaymentTypes", + "nodeType": "MemberAccess", + "referencedDeclaration": 2433, + "src": "11894:27:57", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_PaymentTypes_$2433_$", + "typeString": "type(enum IGraphPayments.PaymentTypes)" + } + }, + "id": 14016, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "11922:8:57", + "memberName": "QueryFee", + "nodeType": "MemberAccess", + "referencedDeclaration": 2430, + "src": "11894:36:57", + "typeDescriptions": { + "typeIdentifier": "t_enum$_PaymentTypes_$2433", + "typeString": "enum IGraphPayments.PaymentTypes" + } + }, + "src": "11879:51:57", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "condition": { + "commonType": { + "typeIdentifier": "t_enum$_PaymentTypes_$2433", + "typeString": "enum IGraphPayments.PaymentTypes" + }, + "id": 14030, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 14026, + "name": "paymentType", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13990, + "src": "12018:11:57", + "typeDescriptions": { + "typeIdentifier": "t_enum$_PaymentTypes_$2433", + "typeString": "enum IGraphPayments.PaymentTypes" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "expression": { + "expression": { + "id": 14027, + "name": "IGraphPayments", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2489, + "src": "12033:14:57", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_IGraphPayments_$2489_$", + "typeString": "type(contract IGraphPayments)" + } + }, + "id": 14028, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "12048:12:57", + "memberName": "PaymentTypes", + "nodeType": "MemberAccess", + "referencedDeclaration": 2433, + "src": "12033:27:57", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_PaymentTypes_$2433_$", + "typeString": "type(enum IGraphPayments.PaymentTypes)" + } + }, + "id": 14029, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "12061:15:57", + "memberName": "IndexingRewards", + "nodeType": "MemberAccess", + "referencedDeclaration": 2432, + "src": "12033:43:57", + "typeDescriptions": { + "typeIdentifier": "t_enum$_PaymentTypes_$2433", + "typeString": "enum IGraphPayments.PaymentTypes" + } + }, + "src": "12018:58:57", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "id": 14043, + "nodeType": "Block", + "src": "12166:78:57", + "statements": [ + { + "errorCall": { + "arguments": [ + { + "id": 14040, + "name": "paymentType", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13990, + "src": "12221:11:57", + "typeDescriptions": { + "typeIdentifier": "t_enum$_PaymentTypes_$2433", + "typeString": "enum IGraphPayments.PaymentTypes" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_PaymentTypes_$2433", + "typeString": "enum IGraphPayments.PaymentTypes" + } + ], + "id": 14039, + "name": "SubgraphServiceInvalidPaymentType", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15451, + "src": "12187:33:57", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_enum$_PaymentTypes_$2433_$returns$_t_error_$", + "typeString": "function (enum IGraphPayments.PaymentTypes) pure returns (error)" + } + }, + "id": 14041, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "12187:46:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + }, + "id": 14042, + "nodeType": "RevertStatement", + "src": "12180:53:57" + } + ] + }, + "id": 14044, + "nodeType": "IfStatement", + "src": "12014:230:57", + "trueBody": { + "id": 14038, + "nodeType": "Block", + "src": "12078:82:57", + "statements": [ + { + "expression": { + "id": 14036, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 14031, + "name": "paymentCollected", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14010, + "src": "12092:16:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "id": 14033, + "name": "indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13987, + "src": "12135:7:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 14034, + "name": "data", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13992, + "src": "12144:4:57", + "typeDescriptions": { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes calldata" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes calldata" + } + ], + "id": 14032, + "name": "_collectIndexingRewards", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14812, + "src": "12111:23:57", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_bytes_calldata_ptr_$returns$_t_uint256_$", + "typeString": "function (address,bytes calldata) returns (uint256)" + } + }, + "id": 14035, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "12111:38:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "12092:57:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 14037, + "nodeType": "ExpressionStatement", + "src": "12092:57:57" + } + ] + } + }, + "id": 14045, + "nodeType": "IfStatement", + "src": "11875:369:57", + "trueBody": { + "id": 14025, + "nodeType": "Block", + "src": "11932:76:57", + "statements": [ + { + "expression": { + "id": 14023, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 14018, + "name": "paymentCollected", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14010, + "src": "11946:16:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "id": 14020, + "name": "indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13987, + "src": "11983:7:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 14021, + "name": "data", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13992, + "src": "11992:4:57", + "typeDescriptions": { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes calldata" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes calldata" + } + ], + "id": 14019, + "name": "_collectQueryFees", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14759, + "src": "11965:17:57", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_bytes_calldata_ptr_$returns$_t_uint256_$", + "typeString": "function (address,bytes calldata) returns (uint256)" + } + }, + "id": 14022, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "11965:32:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "11946:51:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 14024, + "nodeType": "ExpressionStatement", + "src": "11946:51:57" + } + ] + } + }, + { + "eventCall": { + "arguments": [ + { + "id": 14047, + "name": "indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13987, + "src": "12283:7:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 14048, + "name": "paymentType", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13990, + "src": "12292:11:57", + "typeDescriptions": { + "typeIdentifier": "t_enum$_PaymentTypes_$2433", + "typeString": "enum IGraphPayments.PaymentTypes" + } + }, + { + "id": 14049, + "name": "paymentCollected", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14010, + "src": "12305:16:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_enum$_PaymentTypes_$2433", + "typeString": "enum IGraphPayments.PaymentTypes" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 14046, + "name": "ServicePaymentCollected", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1466, + "src": "12259:23:57", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_enum$_PaymentTypes_$2433_$_t_uint256_$returns$__$", + "typeString": "function (address,enum IGraphPayments.PaymentTypes,uint256)" + } + }, + "id": 14050, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "12259:63:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 14051, + "nodeType": "EmitStatement", + "src": "12254:68:57" + }, + { + "expression": { + "id": 14052, + "name": "paymentCollected", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14010, + "src": "12339:16:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 14008, + "id": 14053, + "nodeType": "Return", + "src": "12332:23:57" + } + ] + }, + "documentation": { + "id": 13985, + "nodeType": "StructuredDocumentation", + "src": "11462:28:57", + "text": "@inheritdoc IDataService" + }, + "functionSelector": "b15d2a2c", + "id": 14055, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": [ + { + "id": 13996, + "name": "indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13987, + "src": "11690:7:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "id": 13997, + "kind": "modifierInvocation", + "modifierName": { + "id": 13995, + "name": "onlyAuthorizedForProvision", + "nameLocations": [ + "11663:26:57" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 1963, + "src": "11663:26:57" + }, + "nodeType": "ModifierInvocation", + "src": "11663:35:57" + }, + { + "arguments": [ + { + "id": 13999, + "name": "indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13987, + "src": "11726:7:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "id": 14000, + "kind": "modifierInvocation", + "modifierName": { + "id": 13998, + "name": "onlyValidProvision", + "nameLocations": [ + "11707:18:57" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 1988, + "src": "11707:18:57" + }, + "nodeType": "ModifierInvocation", + "src": "11707:27:57" + }, + { + "arguments": [ + { + "id": 14002, + "name": "indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13987, + "src": "11765:7:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "id": 14003, + "kind": "modifierInvocation", + "modifierName": { + "id": 14001, + "name": "onlyRegisteredIndexer", + "nameLocations": [ + "11743:21:57" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 13674, + "src": "11743:21:57" + }, + "nodeType": "ModifierInvocation", + "src": "11743:30:57" + }, + { + "id": 14005, + "kind": "modifierInvocation", + "modifierName": { + "id": 14004, + "name": "whenNotPaused", + "nameLocations": [ + "11782:13:57" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5590, + "src": "11782:13:57" + }, + "nodeType": "ModifierInvocation", + "src": "11782:13:57" + } + ], + "name": "collect", + "nameLocation": "11504:7:57", + "nodeType": "FunctionDefinition", + "overrides": { + "id": 13994, + "nodeType": "OverrideSpecifier", + "overrides": [], + "src": "11646:8:57" + }, + "parameters": { + "id": 13993, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 13987, + "mutability": "mutable", + "name": "indexer", + "nameLocation": "11529:7:57", + "nodeType": "VariableDeclaration", + "scope": 14055, + "src": "11521:15:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 13986, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "11521:7:57", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 13990, + "mutability": "mutable", + "name": "paymentType", + "nameLocation": "11574:11:57", + "nodeType": "VariableDeclaration", + "scope": 14055, + "src": "11546:39:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_PaymentTypes_$2433", + "typeString": "enum IGraphPayments.PaymentTypes" + }, + "typeName": { + "id": 13989, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 13988, + "name": "IGraphPayments.PaymentTypes", + "nameLocations": [ + "11546:14:57", + "11561:12:57" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 2433, + "src": "11546:27:57" + }, + "referencedDeclaration": 2433, + "src": "11546:27:57", + "typeDescriptions": { + "typeIdentifier": "t_enum$_PaymentTypes_$2433", + "typeString": "enum IGraphPayments.PaymentTypes" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 13992, + "mutability": "mutable", + "name": "data", + "nameLocation": "11610:4:57", + "nodeType": "VariableDeclaration", + "scope": 14055, + "src": "11595:19:57", + "stateVariable": false, + "storageLocation": "calldata", + "typeDescriptions": { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 13991, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "11595:5:57", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "src": "11511:109:57" + }, + "returnParameters": { + "id": 14008, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 14007, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 14055, + "src": "11813:7:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 14006, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "11813:7:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "11812:9:57" + }, + "scope": 14879, + "src": "11495:867:57", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "baseFunctions": [ + 1526 + ], + "body": { + "id": 14098, + "nodeType": "Block", + "src": "12693:226:57", + "statements": [ + { + "assignments": [ + 14067, + 14069 + ], + "declarations": [ + { + "constant": false, + "id": 14067, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "12712:6:57", + "nodeType": "VariableDeclaration", + "scope": 14098, + "src": "12704:14:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 14066, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "12704:7:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 14069, + "mutability": "mutable", + "name": "reward", + "nameLocation": "12728:6:57", + "nodeType": "VariableDeclaration", + "scope": 14098, + "src": "12720:14:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 14068, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "12720:7:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 14079, + "initialValue": { + "arguments": [ + { + "id": 14072, + "name": "data", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14060, + "src": "12749:4:57", + "typeDescriptions": { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes calldata" + } + }, + { + "components": [ + { + "id": 14074, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "12756:7:57", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + }, + "typeName": { + "id": 14073, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "12756:7:57", + "typeDescriptions": {} + } + }, + { + "id": 14076, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "12765:7:57", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + }, + "typeName": { + "id": 14075, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "12765:7:57", + "typeDescriptions": {} + } + } + ], + "id": 14077, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "12755:18:57", + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_type$_t_uint256_$_$_t_type$_t_uint256_$_$", + "typeString": "tuple(type(uint256),type(uint256))" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes calldata" + }, + { + "typeIdentifier": "t_tuple$_t_type$_t_uint256_$_$_t_type$_t_uint256_$_$", + "typeString": "tuple(type(uint256),type(uint256))" + } + ], + "expression": { + "id": 14070, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -1, + "src": "12738:3:57", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 14071, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "12742:6:57", + "memberName": "decode", + "nodeType": "MemberAccess", + "src": "12738:10:57", + "typeDescriptions": { + "typeIdentifier": "t_function_abidecode_pure$__$returns$__$", + "typeString": "function () pure" + } + }, + "id": 14078, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "12738:36:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$", + "typeString": "tuple(uint256,uint256)" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "12703:71:57" + }, + { + "expression": { + "arguments": [ + { + "id": 14083, + "name": "indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14058, + "src": "12806:7:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 14084, + "name": "tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14067, + "src": "12815:6:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 14085, + "name": "reward", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14069, + "src": "12823:6:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "arguments": [ + { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 14088, + "name": "_disputeManager", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17699, + "src": "12839:15:57", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_contract$_IDisputeManager_$15373_$", + "typeString": "function () view returns (contract IDisputeManager)" + } + }, + "id": 14089, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "12839:17:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_IDisputeManager_$15373", + "typeString": "contract IDisputeManager" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_IDisputeManager_$15373", + "typeString": "contract IDisputeManager" + } + ], + "id": 14087, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "12831:7:57", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 14086, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "12831:7:57", + "typeDescriptions": {} + } + }, + "id": 14090, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "12831:26:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "expression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 14080, + "name": "_graphStaking", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4815, + "src": "12784:13:57", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_contract$_IHorizonStaking_$2625_$", + "typeString": "function () view returns (contract IHorizonStaking)" + } + }, + "id": 14081, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "12784:15:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_IHorizonStaking_$2625", + "typeString": "contract IHorizonStaking" + } + }, + "id": 14082, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "12800:5:57", + "memberName": "slash", + "nodeType": "MemberAccess", + "referencedDeclaration": 3862, + "src": "12784:21:57", + "typeDescriptions": { + "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$_t_uint256_$_t_address_$returns$__$", + "typeString": "function (address,uint256,uint256,address) external" + } + }, + "id": 14091, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "12784:74:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 14092, + "nodeType": "ExpressionStatement", + "src": "12784:74:57" + }, + { + "eventCall": { + "arguments": [ + { + "id": 14094, + "name": "indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14058, + "src": "12896:7:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 14095, + "name": "tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14067, + "src": "12905:6:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 14093, + "name": "ServiceProviderSlashed", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1473, + "src": "12873:22:57", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,uint256)" + } + }, + "id": 14096, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "12873:39:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 14097, + "nodeType": "EmitStatement", + "src": "12868:44:57" + } + ] + }, + "documentation": { + "id": 14056, + "nodeType": "StructuredDocumentation", + "src": "12570:28:57", + "text": "@inheritdoc IDataService" + }, + "functionSelector": "cb8347fe", + "id": 14099, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "id": 14064, + "kind": "modifierInvocation", + "modifierName": { + "id": 14063, + "name": "onlyDisputeManager", + "nameLocations": [ + "12674:18:57" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 17635, + "src": "12674:18:57" + }, + "nodeType": "ModifierInvocation", + "src": "12674:18:57" + } + ], + "name": "slash", + "nameLocation": "12612:5:57", + "nodeType": "FunctionDefinition", + "overrides": { + "id": 14062, + "nodeType": "OverrideSpecifier", + "overrides": [], + "src": "12665:8:57" + }, + "parameters": { + "id": 14061, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 14058, + "mutability": "mutable", + "name": "indexer", + "nameLocation": "12626:7:57", + "nodeType": "VariableDeclaration", + "scope": 14099, + "src": "12618:15:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 14057, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "12618:7:57", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 14060, + "mutability": "mutable", + "name": "data", + "nameLocation": "12650:4:57", + "nodeType": "VariableDeclaration", + "scope": 14099, + "src": "12635:19:57", + "stateVariable": false, + "storageLocation": "calldata", + "typeDescriptions": { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 14059, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "12635:5:57", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "src": "12617:38:57" + }, + "returnParameters": { + "id": 14065, + "nodeType": "ParameterList", + "parameters": [], + "src": "12693:0:57" + }, + "scope": 14879, + "src": "12603:316:57", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "baseFunctions": [ + 15515 + ], + "body": { + "id": 14143, + "nodeType": "Block", + "src": "13046:339:57", + "statements": [ + { + "assignments": [ + 14112 + ], + "declarations": [ + { + "constant": false, + "id": 14112, + "mutability": "mutable", + "name": "allocation", + "nameLocation": "13080:10:57", + "nodeType": "VariableDeclaration", + "scope": 14143, + "src": "13056:34:57", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State" + }, + "typeName": { + "id": 14111, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 14110, + "name": "Allocation.State", + "nameLocations": [ + "13056:10:57", + "13067:5:57" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 15663, + "src": "13056:16:57" + }, + "referencedDeclaration": 15663, + "src": "13056:16:57", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_storage_ptr", + "typeString": "struct Allocation.State" + } + }, + "visibility": "internal" + } + ], + "id": 14117, + "initialValue": { + "arguments": [ + { + "id": 14115, + "name": "allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14102, + "src": "13110:12:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "expression": { + "id": 14113, + "name": "_allocations", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17376, + "src": "13093:12:57", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_State_$15663_storage_$", + "typeString": "mapping(address => struct Allocation.State storage ref)" + } + }, + "id": 14114, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "13106:3:57", + "memberName": "get", + "nodeType": "MemberAccess", + "referencedDeclaration": 15913, + "src": "13093:16:57", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_mapping$_t_address_$_t_struct$_State_$15663_storage_$_$_t_address_$returns$_t_struct$_State_$15663_memory_ptr_$attached_to$_t_mapping$_t_address_$_t_struct$_State_$15663_storage_$_$", + "typeString": "function (mapping(address => struct Allocation.State storage ref),address) view returns (struct Allocation.State memory)" + } + }, + "id": 14116, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "13093:30:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "13056:67:57" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "id": 14121, + "name": "maxPOIStaleness", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17390, + "src": "13160:15:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "id": 14119, + "name": "allocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14112, + "src": "13141:10:57", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "id": 14120, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "13152:7:57", + "memberName": "isStale", + "nodeType": "MemberAccess", + "referencedDeclaration": 15946, + "src": "13141:18:57", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_struct$_State_$15663_memory_ptr_$_t_uint256_$returns$_t_bool_$attached_to$_t_struct$_State_$15663_memory_ptr_$", + "typeString": "function (struct Allocation.State memory,uint256) view returns (bool)" + } + }, + "id": 14122, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "13141:35:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [ + { + "id": 14124, + "name": "allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14102, + "src": "13220:12:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 14123, + "name": "SubgraphServiceCannotForceCloseAllocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15484, + "src": "13178:41:57", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_address_$returns$_t_error_$", + "typeString": "function (address) pure returns (error)" + } + }, + "id": 14125, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "13178:55:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 14118, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "13133:7:57", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 14126, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "13133:101:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 14127, + "nodeType": "ExpressionStatement", + "src": "13133:101:57" + }, + { + "expression": { + "arguments": [ + { + "id": 14132, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "13252:26:57", + "subExpression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "expression": { + "id": 14129, + "name": "allocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14112, + "src": "13253:10:57", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "id": 14130, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "13264:12:57", + "memberName": "isAltruistic", + "nodeType": "MemberAccess", + "referencedDeclaration": 15999, + "src": "13253:23:57", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_struct$_State_$15663_memory_ptr_$returns$_t_bool_$attached_to$_t_struct$_State_$15663_memory_ptr_$", + "typeString": "function (struct Allocation.State memory) pure returns (bool)" + } + }, + "id": 14131, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "13253:25:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [ + { + "id": 14134, + "name": "allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14102, + "src": "13318:12:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 14133, + "name": "SubgraphServiceAllocationIsAltruistic", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15489, + "src": "13280:37:57", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_address_$returns$_t_error_$", + "typeString": "function (address) pure returns (error)" + } + }, + "id": 14135, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "13280:51:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 14128, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "13244:7:57", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 14136, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "13244:88:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 14137, + "nodeType": "ExpressionStatement", + "src": "13244:88:57" + }, + { + "expression": { + "arguments": [ + { + "id": 14139, + "name": "allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14102, + "src": "13359:12:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "hexValue": "74727565", + "id": 14140, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13373:4:57", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "true" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 14138, + "name": "_closeAllocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17273, + "src": "13342:16:57", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_bool_$returns$__$", + "typeString": "function (address,bool)" + } + }, + "id": 14141, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "13342:36:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 14142, + "nodeType": "ExpressionStatement", + "src": "13342:36:57" + } + ] + }, + "documentation": { + "id": 14100, + "nodeType": "StructuredDocumentation", + "src": "12925:32:57", + "text": "@inheritdoc ISubgraphService" + }, + "functionSelector": "ec9c218d", + "id": 14144, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "id": 14106, + "kind": "modifierInvocation", + "modifierName": { + "id": 14105, + "name": "whenNotPaused", + "nameLocations": [ + "13032:13:57" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5590, + "src": "13032:13:57" + }, + "nodeType": "ModifierInvocation", + "src": "13032:13:57" + } + ], + "name": "closeStaleAllocation", + "nameLocation": "12971:20:57", + "nodeType": "FunctionDefinition", + "overrides": { + "id": 14104, + "nodeType": "OverrideSpecifier", + "overrides": [], + "src": "13023:8:57" + }, + "parameters": { + "id": 14103, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 14102, + "mutability": "mutable", + "name": "allocationId", + "nameLocation": "13000:12:57", + "nodeType": "VariableDeclaration", + "scope": 14144, + "src": "12992:20:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 14101, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "12992:7:57", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "12991:22:57" + }, + "returnParameters": { + "id": 14107, + "nodeType": "ParameterList", + "parameters": [], + "src": "13046:0:57" + }, + "scope": 14879, + "src": "12962:423:57", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "baseFunctions": [ + 15525 + ], + "body": { + "id": 14185, + "nodeType": "Block", + "src": "13701:239:57", + "statements": [ + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 14172, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "arguments": [ + { + "id": 14168, + "name": "allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14149, + "src": "13749:12:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "expression": { + "id": 14166, + "name": "_allocations", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17376, + "src": "13732:12:57", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_State_$15663_storage_$", + "typeString": "mapping(address => struct Allocation.State storage ref)" + } + }, + "id": 14167, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "13745:3:57", + "memberName": "get", + "nodeType": "MemberAccess", + "referencedDeclaration": 15913, + "src": "13732:16:57", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_mapping$_t_address_$_t_struct$_State_$15663_storage_$_$_t_address_$returns$_t_struct$_State_$15663_memory_ptr_$attached_to$_t_mapping$_t_address_$_t_struct$_State_$15663_storage_$_$", + "typeString": "function (mapping(address => struct Allocation.State storage ref),address) view returns (struct Allocation.State memory)" + } + }, + "id": 14169, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "13732:30:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "id": 14170, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "13763:7:57", + "memberName": "indexer", + "nodeType": "MemberAccess", + "referencedDeclaration": 15646, + "src": "13732:38:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "id": 14171, + "name": "indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14147, + "src": "13774:7:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "13732:49:57", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [ + { + "id": 14174, + "name": "indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14147, + "src": "13834:7:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 14175, + "name": "allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14149, + "src": "13843:12:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 14173, + "name": "SubgraphServiceAllocationNotAuthorized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15472, + "src": "13795:38:57", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_address_$_t_address_$returns$_t_error_$", + "typeString": "function (address,address) pure returns (error)" + } + }, + "id": 14176, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "13795:61:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 14165, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "13711:7:57", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 14177, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "13711:155:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 14178, + "nodeType": "ExpressionStatement", + "src": "13711:155:57" + }, + { + "expression": { + "arguments": [ + { + "id": 14180, + "name": "allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14149, + "src": "13894:12:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 14181, + "name": "tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14151, + "src": "13908:6:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 14182, + "name": "_delegationRatio", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2419, + "src": "13916:16:57", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + ], + "id": 14179, + "name": "_resizeAllocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17203, + "src": "13876:17:57", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_uint256_$_t_uint32_$returns$__$", + "typeString": "function (address,uint256,uint32)" + } + }, + "id": 14183, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "13876:57:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 14184, + "nodeType": "ExpressionStatement", + "src": "13876:57:57" + } + ] + }, + "documentation": { + "id": 14145, + "nodeType": "StructuredDocumentation", + "src": "13391:32:57", + "text": "@inheritdoc ISubgraphService" + }, + "functionSelector": "81e777a7", + "id": 14186, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": [ + { + "id": 14154, + "name": "indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14147, + "src": "13591:7:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "id": 14155, + "kind": "modifierInvocation", + "modifierName": { + "id": 14153, + "name": "onlyAuthorizedForProvision", + "nameLocations": [ + "13564:26:57" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 1963, + "src": "13564:26:57" + }, + "nodeType": "ModifierInvocation", + "src": "13564:35:57" + }, + { + "arguments": [ + { + "id": 14157, + "name": "indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14147, + "src": "13627:7:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "id": 14158, + "kind": "modifierInvocation", + "modifierName": { + "id": 14156, + "name": "onlyValidProvision", + "nameLocations": [ + "13608:18:57" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 1988, + "src": "13608:18:57" + }, + "nodeType": "ModifierInvocation", + "src": "13608:27:57" + }, + { + "arguments": [ + { + "id": 14160, + "name": "indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14147, + "src": "13666:7:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "id": 14161, + "kind": "modifierInvocation", + "modifierName": { + "id": 14159, + "name": "onlyRegisteredIndexer", + "nameLocations": [ + "13644:21:57" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 13674, + "src": "13644:21:57" + }, + "nodeType": "ModifierInvocation", + "src": "13644:30:57" + }, + { + "id": 14163, + "kind": "modifierInvocation", + "modifierName": { + "id": 14162, + "name": "whenNotPaused", + "nameLocations": [ + "13683:13:57" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5590, + "src": "13683:13:57" + }, + "nodeType": "ModifierInvocation", + "src": "13683:13:57" + } + ], + "name": "resizeAllocation", + "nameLocation": "13437:16:57", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 14152, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 14147, + "mutability": "mutable", + "name": "indexer", + "nameLocation": "13471:7:57", + "nodeType": "VariableDeclaration", + "scope": 14186, + "src": "13463:15:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 14146, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "13463:7:57", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 14149, + "mutability": "mutable", + "name": "allocationId", + "nameLocation": "13496:12:57", + "nodeType": "VariableDeclaration", + "scope": 14186, + "src": "13488:20:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 14148, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "13488:7:57", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 14151, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "13526:6:57", + "nodeType": "VariableDeclaration", + "scope": 14186, + "src": "13518:14:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 14150, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "13518:7:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "13453:85:57" + }, + "returnParameters": { + "id": 14164, + "nodeType": "ParameterList", + "parameters": [], + "src": "13701:0:57" + }, + "scope": 14879, + "src": "13428:512:57", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "baseFunctions": [ + 15535 + ], + "body": { + "id": 14205, + "nodeType": "Block", + "src": "14143:86:57", + "statements": [ + { + "expression": { + "arguments": [ + { + "id": 14200, + "name": "indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14189, + "src": "14178:7:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 14201, + "name": "allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14191, + "src": "14187:12:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 14202, + "name": "subgraphDeploymentID", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14193, + "src": "14201:20:57", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 14199, + "name": "_migrateLegacyAllocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16681, + "src": "14153:24:57", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_bytes32_$returns$__$", + "typeString": "function (address,address,bytes32)" + } + }, + "id": 14203, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "14153:69:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 14204, + "nodeType": "ExpressionStatement", + "src": "14153:69:57" + } + ] + }, + "documentation": { + "id": 14187, + "nodeType": "StructuredDocumentation", + "src": "13946:32:57", + "text": "@inheritdoc ISubgraphService" + }, + "functionSelector": "7dfe6d28", + "id": 14206, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "id": 14197, + "kind": "modifierInvocation", + "modifierName": { + "id": 14196, + "name": "onlyOwner", + "nameLocations": [ + "14133:9:57" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5018, + "src": "14133:9:57" + }, + "nodeType": "ModifierInvocation", + "src": "14133:9:57" + } + ], + "name": "migrateLegacyAllocation", + "nameLocation": "13992:23:57", + "nodeType": "FunctionDefinition", + "overrides": { + "id": 14195, + "nodeType": "OverrideSpecifier", + "overrides": [], + "src": "14124:8:57" + }, + "parameters": { + "id": 14194, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 14189, + "mutability": "mutable", + "name": "indexer", + "nameLocation": "14033:7:57", + "nodeType": "VariableDeclaration", + "scope": 14206, + "src": "14025:15:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 14188, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "14025:7:57", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 14191, + "mutability": "mutable", + "name": "allocationId", + "nameLocation": "14058:12:57", + "nodeType": "VariableDeclaration", + "scope": 14206, + "src": "14050:20:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 14190, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "14050:7:57", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 14193, + "mutability": "mutable", + "name": "subgraphDeploymentID", + "nameLocation": "14088:20:57", + "nodeType": "VariableDeclaration", + "scope": 14206, + "src": "14080:28:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 14192, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "14080:7:57", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "14015:99:57" + }, + "returnParameters": { + "id": 14198, + "nodeType": "ParameterList", + "parameters": [], + "src": "14143:0:57" + }, + "scope": 14879, + "src": "13983:246:57", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "baseFunctions": [ + 15543 + ], + "body": { + "id": 14222, + "nodeType": "Block", + "src": "14363:58:57", + "statements": [ + { + "expression": { + "arguments": [ + { + "id": 14218, + "name": "pauseGuardian", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14209, + "src": "14391:13:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 14219, + "name": "allowed", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14211, + "src": "14406:7:57", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 14217, + "name": "_setPauseGuardian", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1424, + "src": "14373:17:57", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_bool_$returns$__$", + "typeString": "function (address,bool)" + } + }, + "id": 14220, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "14373:41:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 14221, + "nodeType": "ExpressionStatement", + "src": "14373:41:57" + } + ] + }, + "documentation": { + "id": 14207, + "nodeType": "StructuredDocumentation", + "src": "14235:32:57", + "text": "@inheritdoc ISubgraphService" + }, + "functionSelector": "35577962", + "id": 14223, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "id": 14215, + "kind": "modifierInvocation", + "modifierName": { + "id": 14214, + "name": "onlyOwner", + "nameLocations": [ + "14353:9:57" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5018, + "src": "14353:9:57" + }, + "nodeType": "ModifierInvocation", + "src": "14353:9:57" + } + ], + "name": "setPauseGuardian", + "nameLocation": "14281:16:57", + "nodeType": "FunctionDefinition", + "overrides": { + "id": 14213, + "nodeType": "OverrideSpecifier", + "overrides": [], + "src": "14344:8:57" + }, + "parameters": { + "id": 14212, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 14209, + "mutability": "mutable", + "name": "pauseGuardian", + "nameLocation": "14306:13:57", + "nodeType": "VariableDeclaration", + "scope": 14223, + "src": "14298:21:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 14208, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "14298:7:57", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 14211, + "mutability": "mutable", + "name": "allowed", + "nameLocation": "14326:7:57", + "nodeType": "VariableDeclaration", + "scope": 14223, + "src": "14321:12:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 14210, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "14321:4:57", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "src": "14297:37:57" + }, + "returnParameters": { + "id": 14216, + "nodeType": "ParameterList", + "parameters": [], + "src": "14363:0:57" + }, + "scope": 14879, + "src": "14272:149:57", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "baseFunctions": [ + 15579 + ], + "body": { + "id": 14236, + "nodeType": "Block", + "src": "14544:74:57", + "statements": [ + { + "expression": { + "arguments": [ + { + "expression": { + "id": 14231, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "14578:3:57", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 14232, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "14582:6:57", + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "14578:10:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 14233, + "name": "paymentsDestination_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14226, + "src": "14590:20:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 14230, + "name": "_setPaymentsDestination", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14832, + "src": "14554:23:57", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$returns$__$", + "typeString": "function (address,address)" + } + }, + "id": 14234, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "14554:57:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 14235, + "nodeType": "ExpressionStatement", + "src": "14554:57:57" + } + ] + }, + "documentation": { + "id": 14224, + "nodeType": "StructuredDocumentation", + "src": "14427:32:57", + "text": "@inheritdoc ISubgraphService" + }, + "functionSelector": "6ccec5b8", + "id": 14237, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "setPaymentsDestination", + "nameLocation": "14473:22:57", + "nodeType": "FunctionDefinition", + "overrides": { + "id": 14228, + "nodeType": "OverrideSpecifier", + "overrides": [], + "src": "14535:8:57" + }, + "parameters": { + "id": 14227, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 14226, + "mutability": "mutable", + "name": "paymentsDestination_", + "nameLocation": "14504:20:57", + "nodeType": "VariableDeclaration", + "scope": 14237, + "src": "14496:28:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 14225, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "14496:7:57", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "14495:30:57" + }, + "returnParameters": { + "id": 14229, + "nodeType": "ParameterList", + "parameters": [], + "src": "14544:0:57" + }, + "scope": 14879, + "src": "14464:154:57", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "baseFunctions": [ + 15549 + ], + "body": { + "id": 14251, + "nodeType": "Block", + "src": "14756:95:57", + "statements": [ + { + "expression": { + "arguments": [ + { + "id": 14247, + "name": "minimumProvisionTokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14240, + "src": "14791:22:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 14248, + "name": "DEFAULT_MAX_PROVISION_TOKENS", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1873, + "src": "14815:28:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 14246, + "name": "_setProvisionTokensRange", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2089, + "src": "14766:24:57", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$_t_uint256_$returns$__$", + "typeString": "function (uint256,uint256)" + } + }, + "id": 14249, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "14766:78:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 14250, + "nodeType": "ExpressionStatement", + "src": "14766:78:57" + } + ] + }, + "documentation": { + "id": 14238, + "nodeType": "StructuredDocumentation", + "src": "14624:32:57", + "text": "@inheritdoc ISubgraphService" + }, + "functionSelector": "832bc923", + "id": 14252, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "id": 14244, + "kind": "modifierInvocation", + "modifierName": { + "id": 14243, + "name": "onlyOwner", + "nameLocations": [ + "14746:9:57" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5018, + "src": "14746:9:57" + }, + "nodeType": "ModifierInvocation", + "src": "14746:9:57" + } + ], + "name": "setMinimumProvisionTokens", + "nameLocation": "14670:25:57", + "nodeType": "FunctionDefinition", + "overrides": { + "id": 14242, + "nodeType": "OverrideSpecifier", + "overrides": [], + "src": "14737:8:57" + }, + "parameters": { + "id": 14241, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 14240, + "mutability": "mutable", + "name": "minimumProvisionTokens", + "nameLocation": "14704:22:57", + "nodeType": "VariableDeclaration", + "scope": 14252, + "src": "14696:30:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 14239, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "14696:7:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "14695:32:57" + }, + "returnParameters": { + "id": 14245, + "nodeType": "ParameterList", + "parameters": [], + "src": "14756:0:57" + }, + "scope": 14879, + "src": "14661:190:57", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "baseFunctions": [ + 15555 + ], + "body": { + "id": 14265, + "nodeType": "Block", + "src": "14974:53:57", + "statements": [ + { + "expression": { + "arguments": [ + { + "id": 14262, + "name": "delegationRatio", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14255, + "src": "15004:15:57", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + ], + "id": 14261, + "name": "_setDelegationRatio", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2057, + "src": "14984:19:57", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_uint32_$returns$__$", + "typeString": "function (uint32)" + } + }, + "id": 14263, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "14984:36:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 14264, + "nodeType": "ExpressionStatement", + "src": "14984:36:57" + } + ] + }, + "documentation": { + "id": 14253, + "nodeType": "StructuredDocumentation", + "src": "14857:32:57", + "text": "@inheritdoc ISubgraphService" + }, + "functionSelector": "1dd42f60", + "id": 14266, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "id": 14259, + "kind": "modifierInvocation", + "modifierName": { + "id": 14258, + "name": "onlyOwner", + "nameLocations": [ + "14964:9:57" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5018, + "src": "14964:9:57" + }, + "nodeType": "ModifierInvocation", + "src": "14964:9:57" + } + ], + "name": "setDelegationRatio", + "nameLocation": "14903:18:57", + "nodeType": "FunctionDefinition", + "overrides": { + "id": 14257, + "nodeType": "OverrideSpecifier", + "overrides": [], + "src": "14955:8:57" + }, + "parameters": { + "id": 14256, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 14255, + "mutability": "mutable", + "name": "delegationRatio", + "nameLocation": "14929:15:57", + "nodeType": "VariableDeclaration", + "scope": 14266, + "src": "14922:22:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 14254, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "14922:6:57", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + } + ], + "src": "14921:24:57" + }, + "returnParameters": { + "id": 14260, + "nodeType": "ParameterList", + "parameters": [], + "src": "14974:0:57" + }, + "scope": 14879, + "src": "14894:133:57", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "baseFunctions": [ + 15561 + ], + "body": { + "id": 14279, + "nodeType": "Block", + "src": "15154:56:57", + "statements": [ + { + "expression": { + "arguments": [ + { + "id": 14276, + "name": "stakeToFeesRatio_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14269, + "src": "15185:17:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 14275, + "name": "_setStakeToFeesRatio", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14855, + "src": "15164:20:57", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256)" + } + }, + "id": 14277, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "15164:39:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 14278, + "nodeType": "ExpressionStatement", + "src": "15164:39:57" + } + ] + }, + "documentation": { + "id": 14267, + "nodeType": "StructuredDocumentation", + "src": "15033:32:57", + "text": "@inheritdoc ISubgraphService" + }, + "functionSelector": "e6f50054", + "id": 14280, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "id": 14273, + "kind": "modifierInvocation", + "modifierName": { + "id": 14272, + "name": "onlyOwner", + "nameLocations": [ + "15144:9:57" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5018, + "src": "15144:9:57" + }, + "nodeType": "ModifierInvocation", + "src": "15144:9:57" + } + ], + "name": "setStakeToFeesRatio", + "nameLocation": "15079:19:57", + "nodeType": "FunctionDefinition", + "overrides": { + "id": 14271, + "nodeType": "OverrideSpecifier", + "overrides": [], + "src": "15135:8:57" + }, + "parameters": { + "id": 14270, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 14269, + "mutability": "mutable", + "name": "stakeToFeesRatio_", + "nameLocation": "15107:17:57", + "nodeType": "VariableDeclaration", + "scope": 14280, + "src": "15099:25:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 14268, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "15099:7:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "15098:27:57" + }, + "returnParameters": { + "id": 14274, + "nodeType": "ParameterList", + "parameters": [], + "src": "15154:0:57" + }, + "scope": 14879, + "src": "15070:140:57", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "baseFunctions": [ + 15567 + ], + "body": { + "id": 14293, + "nodeType": "Block", + "src": "15335:54:57", + "statements": [ + { + "expression": { + "arguments": [ + { + "id": 14290, + "name": "maxPOIStaleness_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14283, + "src": "15365:16:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 14289, + "name": "_setMaxPOIStaleness", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17288, + "src": "15345:19:57", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256)" + } + }, + "id": 14291, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "15345:37:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 14292, + "nodeType": "ExpressionStatement", + "src": "15345:37:57" + } + ] + }, + "documentation": { + "id": 14281, + "nodeType": "StructuredDocumentation", + "src": "15216:32:57", + "text": "@inheritdoc ISubgraphService" + }, + "functionSelector": "7aa31bce", + "id": 14294, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "id": 14287, + "kind": "modifierInvocation", + "modifierName": { + "id": 14286, + "name": "onlyOwner", + "nameLocations": [ + "15325:9:57" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5018, + "src": "15325:9:57" + }, + "nodeType": "ModifierInvocation", + "src": "15325:9:57" + } + ], + "name": "setMaxPOIStaleness", + "nameLocation": "15262:18:57", + "nodeType": "FunctionDefinition", + "overrides": { + "id": 14285, + "nodeType": "OverrideSpecifier", + "overrides": [], + "src": "15316:8:57" + }, + "parameters": { + "id": 14284, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 14283, + "mutability": "mutable", + "name": "maxPOIStaleness_", + "nameLocation": "15289:16:57", + "nodeType": "VariableDeclaration", + "scope": 14294, + "src": "15281:24:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 14282, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "15281:7:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "15280:26:57" + }, + "returnParameters": { + "id": 14288, + "nodeType": "ParameterList", + "parameters": [], + "src": "15335:0:57" + }, + "scope": 14879, + "src": "15253:136:57", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "baseFunctions": [ + 15573 + ], + "body": { + "id": 14321, + "nodeType": "Block", + "src": "15505:186:57", + "statements": [ + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "id": 14306, + "name": "curationCut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14297, + "src": "15542:11:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "id": 14304, + "name": "PPMMath", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4539, + "src": "15523:7:57", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_PPMMath_$4539_$", + "typeString": "type(library PPMMath)" + } + }, + "id": 14305, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "15531:10:57", + "memberName": "isValidPPM", + "nodeType": "MemberAccess", + "referencedDeclaration": 4538, + "src": "15523:18:57", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$returns$_t_bool_$", + "typeString": "function (uint256) pure returns (bool)" + } + }, + "id": 14307, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "15523:31:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [ + { + "id": 14309, + "name": "curationCut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14297, + "src": "15590:11:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 14308, + "name": "SubgraphServiceInvalidCurationCut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15431, + "src": "15556:33:57", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint256_$returns$_t_error_$", + "typeString": "function (uint256) pure returns (error)" + } + }, + "id": 14310, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "15556:46:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 14303, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "15515:7:57", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 14311, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "15515:88:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 14312, + "nodeType": "ExpressionStatement", + "src": "15515:88:57" + }, + { + "expression": { + "id": 14315, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 14313, + "name": "curationFeesCut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14896, + "src": "15613:15:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "id": 14314, + "name": "curationCut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14297, + "src": "15631:11:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "15613:29:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 14316, + "nodeType": "ExpressionStatement", + "src": "15613:29:57" + }, + { + "eventCall": { + "arguments": [ + { + "id": 14318, + "name": "curationCut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14297, + "src": "15672:11:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 14317, + "name": "CurationCutSet", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15426, + "src": "15657:14:57", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256)" + } + }, + "id": 14319, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "15657:27:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 14320, + "nodeType": "EmitStatement", + "src": "15652:32:57" + } + ] + }, + "documentation": { + "id": 14295, + "nodeType": "StructuredDocumentation", + "src": "15395:32:57", + "text": "@inheritdoc ISubgraphService" + }, + "functionSelector": "7e89bac3", + "id": 14322, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "id": 14301, + "kind": "modifierInvocation", + "modifierName": { + "id": 14300, + "name": "onlyOwner", + "nameLocations": [ + "15495:9:57" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5018, + "src": "15495:9:57" + }, + "nodeType": "ModifierInvocation", + "src": "15495:9:57" + } + ], + "name": "setCurationCut", + "nameLocation": "15441:14:57", + "nodeType": "FunctionDefinition", + "overrides": { + "id": 14299, + "nodeType": "OverrideSpecifier", + "overrides": [], + "src": "15486:8:57" + }, + "parameters": { + "id": 14298, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 14297, + "mutability": "mutable", + "name": "curationCut", + "nameLocation": "15464:11:57", + "nodeType": "VariableDeclaration", + "scope": 14322, + "src": "15456:19:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 14296, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "15456:7:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "15455:21:57" + }, + "returnParameters": { + "id": 14302, + "nodeType": "ParameterList", + "parameters": [], + "src": "15505:0:57" + }, + "scope": 14879, + "src": "15432:259:57", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "baseFunctions": [ + 15588 + ], + "body": { + "id": 14336, + "nodeType": "Block", + "src": "15836:50:57", + "statements": [ + { + "expression": { + "baseExpression": { + "id": 14332, + "name": "_allocations", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17376, + "src": "15853:12:57", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_State_$15663_storage_$", + "typeString": "mapping(address => struct Allocation.State storage ref)" + } + }, + "id": 14334, + "indexExpression": { + "id": 14333, + "name": "allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14325, + "src": "15866:12:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "15853:26:57", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_storage", + "typeString": "struct Allocation.State storage ref" + } + }, + "functionReturnParameters": 14331, + "id": 14335, + "nodeType": "Return", + "src": "15846:33:57" + } + ] + }, + "documentation": { + "id": 14323, + "nodeType": "StructuredDocumentation", + "src": "15697:32:57", + "text": "@inheritdoc ISubgraphService" + }, + "functionSelector": "0e022923", + "id": 14337, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getAllocation", + "nameLocation": "15743:13:57", + "nodeType": "FunctionDefinition", + "overrides": { + "id": 14327, + "nodeType": "OverrideSpecifier", + "overrides": [], + "src": "15793:8:57" + }, + "parameters": { + "id": 14326, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 14325, + "mutability": "mutable", + "name": "allocationId", + "nameLocation": "15765:12:57", + "nodeType": "VariableDeclaration", + "scope": 14337, + "src": "15757:20:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 14324, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "15757:7:57", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "15756:22:57" + }, + "returnParameters": { + "id": 14331, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 14330, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 14337, + "src": "15811:23:57", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State" + }, + "typeName": { + "id": 14329, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 14328, + "name": "Allocation.State", + "nameLocations": [ + "15811:10:57", + "15822:5:57" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 15663, + "src": "15811:16:57" + }, + "referencedDeclaration": 15663, + "src": "15811:16:57", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_storage_ptr", + "typeString": "struct Allocation.State" + } + }, + "visibility": "internal" + } + ], + "src": "15810:25:57" + }, + "scope": 14879, + "src": "15734:152:57", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "baseFunctions": [ + 552 + ], + "body": { + "id": 14380, + "nodeType": "Block", + "src": "16073:300:57", + "statements": [ + { + "assignments": [ + 14360 + ], + "declarations": [ + { + "constant": false, + "id": 14360, + "mutability": "mutable", + "name": "allo", + "nameLocation": "16107:4:57", + "nodeType": "VariableDeclaration", + "scope": 14380, + "src": "16083:28:57", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State" + }, + "typeName": { + "id": 14359, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 14358, + "name": "Allocation.State", + "nameLocations": [ + "16083:10:57", + "16094:5:57" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 15663, + "src": "16083:16:57" + }, + "referencedDeclaration": 15663, + "src": "16083:16:57", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_storage_ptr", + "typeString": "struct Allocation.State" + } + }, + "visibility": "internal" + } + ], + "id": 14364, + "initialValue": { + "baseExpression": { + "id": 14361, + "name": "_allocations", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17376, + "src": "16114:12:57", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_State_$15663_storage_$", + "typeString": "mapping(address => struct Allocation.State storage ref)" + } + }, + "id": 14363, + "indexExpression": { + "id": 14362, + "name": "allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14340, + "src": "16127:12:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "16114:26:57", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_storage", + "typeString": "struct Allocation.State storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "16083:57:57" + }, + { + "expression": { + "components": [ + { + "arguments": [], + "expression": { + "argumentTypes": [], + "expression": { + "id": 14365, + "name": "allo", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14360, + "src": "16171:4:57", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "id": 14366, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "16176:6:57", + "memberName": "isOpen", + "nodeType": "MemberAccess", + "referencedDeclaration": 15980, + "src": "16171:11:57", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_struct$_State_$15663_memory_ptr_$returns$_t_bool_$attached_to$_t_struct$_State_$15663_memory_ptr_$", + "typeString": "function (struct Allocation.State memory) pure returns (bool)" + } + }, + "id": 14367, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "16171:13:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "expression": { + "id": 14368, + "name": "allo", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14360, + "src": "16198:4:57", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "id": 14369, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "16203:7:57", + "memberName": "indexer", + "nodeType": "MemberAccess", + "referencedDeclaration": 15646, + "src": "16198:12:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "expression": { + "id": 14370, + "name": "allo", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14360, + "src": "16224:4:57", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "id": 14371, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "16229:20:57", + "memberName": "subgraphDeploymentId", + "nodeType": "MemberAccess", + "referencedDeclaration": 15648, + "src": "16224:25:57", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "expression": { + "id": 14372, + "name": "allo", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14360, + "src": "16263:4:57", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "id": 14373, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "16268:6:57", + "memberName": "tokens", + "nodeType": "MemberAccess", + "referencedDeclaration": 15650, + "src": "16263:11:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "expression": { + "id": 14374, + "name": "allo", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14360, + "src": "16288:4:57", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "id": 14375, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "16293:27:57", + "memberName": "accRewardsPerAllocatedToken", + "nodeType": "MemberAccess", + "referencedDeclaration": 15658, + "src": "16288:32:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "expression": { + "id": 14376, + "name": "allo", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14360, + "src": "16334:4:57", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "id": 14377, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "16339:17:57", + "memberName": "accRewardsPending", + "nodeType": "MemberAccess", + "referencedDeclaration": 15660, + "src": "16334:22:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 14378, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "16157:209:57", + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_bool_$_t_address_$_t_bytes32_$_t_uint256_$_t_uint256_$_t_uint256_$", + "typeString": "tuple(bool,address,bytes32,uint256,uint256,uint256)" + } + }, + "functionReturnParameters": 14355, + "id": 14379, + "nodeType": "Return", + "src": "16150:216:57" + } + ] + }, + "documentation": { + "id": 14338, + "nodeType": "StructuredDocumentation", + "src": "15892:30:57", + "text": "@inheritdoc IRewardsIssuer" + }, + "functionSelector": "55c85269", + "id": 14381, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getAllocationData", + "nameLocation": "15936:17:57", + "nodeType": "FunctionDefinition", + "overrides": { + "id": 14342, + "nodeType": "OverrideSpecifier", + "overrides": [], + "src": "16004:8:57" + }, + "parameters": { + "id": 14341, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 14340, + "mutability": "mutable", + "name": "allocationId", + "nameLocation": "15971:12:57", + "nodeType": "VariableDeclaration", + "scope": 14381, + "src": "15963:20:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 14339, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "15963:7:57", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "15953:36:57" + }, + "returnParameters": { + "id": 14355, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 14344, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 14381, + "src": "16022:4:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 14343, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "16022:4:57", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 14346, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 14381, + "src": "16028:7:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 14345, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "16028:7:57", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 14348, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 14381, + "src": "16037:7:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 14347, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "16037:7:57", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 14350, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 14381, + "src": "16046:7:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 14349, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "16046:7:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 14352, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 14381, + "src": "16055:7:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 14351, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "16055:7:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 14354, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 14381, + "src": "16064:7:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 14353, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "16064:7:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "16021:51:57" + }, + "scope": 14879, + "src": "15927:446:57", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "baseFunctions": [ + 560 + ], + "body": { + "id": 14394, + "nodeType": "Block", + "src": "16521:70:57", + "statements": [ + { + "expression": { + "baseExpression": { + "id": 14390, + "name": "_subgraphAllocatedTokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17395, + "src": "16538:24:57", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", + "typeString": "mapping(bytes32 => uint256)" + } + }, + "id": 14392, + "indexExpression": { + "id": 14391, + "name": "subgraphDeploymentId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14384, + "src": "16563:20:57", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "16538:46:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 14389, + "id": 14393, + "nodeType": "Return", + "src": "16531:53:57" + } + ] + }, + "documentation": { + "id": 14382, + "nodeType": "StructuredDocumentation", + "src": "16379:30:57", + "text": "@inheritdoc IRewardsIssuer" + }, + "functionSelector": "e2e1e8e9", + "id": 14395, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getSubgraphAllocatedTokens", + "nameLocation": "16423:26:57", + "nodeType": "FunctionDefinition", + "overrides": { + "id": 14386, + "nodeType": "OverrideSpecifier", + "overrides": [], + "src": "16494:8:57" + }, + "parameters": { + "id": 14385, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 14384, + "mutability": "mutable", + "name": "subgraphDeploymentId", + "nameLocation": "16458:20:57", + "nodeType": "VariableDeclaration", + "scope": 14395, + "src": "16450:28:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 14383, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "16450:7:57", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "16449:30:57" + }, + "returnParameters": { + "id": 14389, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 14388, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 14395, + "src": "16512:7:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 14387, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "16512:7:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "16511:9:57" + }, + "scope": 14879, + "src": "16414:177:57", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "baseFunctions": [ + 15597 + ], + "body": { + "id": 14409, + "nodeType": "Block", + "src": "16748:56:57", + "statements": [ + { + "expression": { + "baseExpression": { + "id": 14405, + "name": "_legacyAllocations", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17382, + "src": "16765:18:57", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_State_$16305_storage_$", + "typeString": "mapping(address => struct LegacyAllocation.State storage ref)" + } + }, + "id": 14407, + "indexExpression": { + "id": 14406, + "name": "allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14398, + "src": "16784:12:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "16765:32:57", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16305_storage", + "typeString": "struct LegacyAllocation.State storage ref" + } + }, + "functionReturnParameters": 14404, + "id": 14408, + "nodeType": "Return", + "src": "16758:39:57" + } + ] + }, + "documentation": { + "id": 14396, + "nodeType": "StructuredDocumentation", + "src": "16597:32:57", + "text": "@inheritdoc ISubgraphService" + }, + "functionSelector": "6d9a3951", + "id": 14410, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getLegacyAllocation", + "nameLocation": "16643:19:57", + "nodeType": "FunctionDefinition", + "overrides": { + "id": 14400, + "nodeType": "OverrideSpecifier", + "overrides": [], + "src": "16699:8:57" + }, + "parameters": { + "id": 14399, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 14398, + "mutability": "mutable", + "name": "allocationId", + "nameLocation": "16671:12:57", + "nodeType": "VariableDeclaration", + "scope": 14410, + "src": "16663:20:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 14397, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "16663:7:57", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "16662:22:57" + }, + "returnParameters": { + "id": 14404, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 14403, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 14410, + "src": "16717:29:57", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16305_memory_ptr", + "typeString": "struct LegacyAllocation.State" + }, + "typeName": { + "id": 14402, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 14401, + "name": "LegacyAllocation.State", + "nameLocations": [ + "16717:16:57", + "16734:5:57" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 16305, + "src": "16717:22:57" + }, + "referencedDeclaration": 16305, + "src": "16717:22:57", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16305_storage_ptr", + "typeString": "struct LegacyAllocation.State" + } + }, + "visibility": "internal" + } + ], + "src": "16716:31:57" + }, + "scope": 14879, + "src": "16634:170:57", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "baseFunctions": [ + 15621 + ], + "body": { + "id": 14423, + "nodeType": "Block", + "src": "16917:50:57", + "statements": [ + { + "expression": { + "arguments": [ + { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 14419, + "name": "_disputeManager", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17699, + "src": "16942:15:57", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_contract$_IDisputeManager_$15373_$", + "typeString": "function () view returns (contract IDisputeManager)" + } + }, + "id": 14420, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "16942:17:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_IDisputeManager_$15373", + "typeString": "contract IDisputeManager" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_IDisputeManager_$15373", + "typeString": "contract IDisputeManager" + } + ], + "id": 14418, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "16934:7:57", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 14417, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "16934:7:57", + "typeDescriptions": {} + } + }, + "id": 14421, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "16934:26:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "functionReturnParameters": 14416, + "id": 14422, + "nodeType": "Return", + "src": "16927:33:57" + } + ] + }, + "documentation": { + "id": 14411, + "nodeType": "StructuredDocumentation", + "src": "16810:32:57", + "text": "@inheritdoc ISubgraphService" + }, + "functionSelector": "db9bee46", + "id": 14424, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getDisputeManager", + "nameLocation": "16856:17:57", + "nodeType": "FunctionDefinition", + "overrides": { + "id": 14413, + "nodeType": "OverrideSpecifier", + "overrides": [], + "src": "16890:8:57" + }, + "parameters": { + "id": 14412, + "nodeType": "ParameterList", + "parameters": [], + "src": "16873:2:57" + }, + "returnParameters": { + "id": 14416, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 14415, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 14424, + "src": "16908:7:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 14414, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "16908:7:57", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "16907:9:57" + }, + "scope": 14879, + "src": "16847:120:57", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "baseFunctions": [ + 15627 + ], + "body": { + "id": 14437, + "nodeType": "Block", + "src": "17085:55:57", + "statements": [ + { + "expression": { + "arguments": [ + { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 14433, + "name": "_graphTallyCollector", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17709, + "src": "17110:20:57", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_contract$_IGraphTallyCollector_$2605_$", + "typeString": "function () view returns (contract IGraphTallyCollector)" + } + }, + "id": 14434, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "17110:22:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_IGraphTallyCollector_$2605", + "typeString": "contract IGraphTallyCollector" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_IGraphTallyCollector_$2605", + "typeString": "contract IGraphTallyCollector" + } + ], + "id": 14432, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "17102:7:57", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 14431, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "17102:7:57", + "typeDescriptions": {} + } + }, + "id": 14435, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "17102:31:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "functionReturnParameters": 14430, + "id": 14436, + "nodeType": "Return", + "src": "17095:38:57" + } + ] + }, + "documentation": { + "id": 14425, + "nodeType": "StructuredDocumentation", + "src": "16973:32:57", + "text": "@inheritdoc ISubgraphService" + }, + "functionSelector": "ebf6ddaf", + "id": 14438, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getGraphTallyCollector", + "nameLocation": "17019:22:57", + "nodeType": "FunctionDefinition", + "overrides": { + "id": 14427, + "nodeType": "OverrideSpecifier", + "overrides": [], + "src": "17058:8:57" + }, + "parameters": { + "id": 14426, + "nodeType": "ParameterList", + "parameters": [], + "src": "17041:2:57" + }, + "returnParameters": { + "id": 14430, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 14429, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 14438, + "src": "17076:7:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 14428, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "17076:7:57", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "17075:9:57" + }, + "scope": 14879, + "src": "17010:130:57", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "baseFunctions": [ + 15633 + ], + "body": { + "id": 14451, + "nodeType": "Block", + "src": "17247:44:57", + "statements": [ + { + "expression": { + "arguments": [ + { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 14447, + "name": "_curation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17719, + "src": "17272:9:57", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_contract$_ICuration_$165_$", + "typeString": "function () view returns (contract ICuration)" + } + }, + "id": 14448, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "17272:11:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_ICuration_$165", + "typeString": "contract ICuration" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_ICuration_$165", + "typeString": "contract ICuration" + } + ], + "id": 14446, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "17264:7:57", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 14445, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "17264:7:57", + "typeDescriptions": {} + } + }, + "id": 14449, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "17264:20:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "functionReturnParameters": 14444, + "id": 14450, + "nodeType": "Return", + "src": "17257:27:57" + } + ] + }, + "documentation": { + "id": 14439, + "nodeType": "StructuredDocumentation", + "src": "17146:32:57", + "text": "@inheritdoc ISubgraphService" + }, + "functionSelector": "c0f47497", + "id": 14452, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getCuration", + "nameLocation": "17192:11:57", + "nodeType": "FunctionDefinition", + "overrides": { + "id": 14441, + "nodeType": "OverrideSpecifier", + "overrides": [], + "src": "17220:8:57" + }, + "parameters": { + "id": 14440, + "nodeType": "ParameterList", + "parameters": [], + "src": "17203:2:57" + }, + "returnParameters": { + "id": 14444, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 14443, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 14452, + "src": "17238:7:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 14442, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "17238:7:57", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "17237:9:57" + }, + "scope": 14879, + "src": "17183:108:57", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "baseFunctions": [ + 15607 + ], + "body": { + "id": 14468, + "nodeType": "Block", + "src": "17445:69:57", + "statements": [ + { + "expression": { + "arguments": [ + { + "id": 14464, + "name": "indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14455, + "src": "17485:7:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 14465, + "name": "allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14457, + "src": "17494:12:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 14463, + "name": "_encodeAllocationProof", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17310, + "src": "17462:22:57", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_address_$_t_address_$returns$_t_bytes32_$", + "typeString": "function (address,address) view returns (bytes32)" + } + }, + "id": 14466, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "17462:45:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "functionReturnParameters": 14462, + "id": 14467, + "nodeType": "Return", + "src": "17455:52:57" + } + ] + }, + "documentation": { + "id": 14453, + "nodeType": "StructuredDocumentation", + "src": "17297:32:57", + "text": "@inheritdoc ISubgraphService" + }, + "functionSelector": "ce56c98b", + "id": 14469, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "encodeAllocationProof", + "nameLocation": "17343:21:57", + "nodeType": "FunctionDefinition", + "overrides": { + "id": 14459, + "nodeType": "OverrideSpecifier", + "overrides": [], + "src": "17418:8:57" + }, + "parameters": { + "id": 14458, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 14455, + "mutability": "mutable", + "name": "indexer", + "nameLocation": "17373:7:57", + "nodeType": "VariableDeclaration", + "scope": 14469, + "src": "17365:15:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 14454, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "17365:7:57", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 14457, + "mutability": "mutable", + "name": "allocationId", + "nameLocation": "17390:12:57", + "nodeType": "VariableDeclaration", + "scope": 14469, + "src": "17382:20:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 14456, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "17382:7:57", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "17364:39:57" + }, + "returnParameters": { + "id": 14462, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 14461, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 14469, + "src": "17436:7:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 14460, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "17436:7:57", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "17435:9:57" + }, + "scope": 14879, + "src": "17334:180:57", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "baseFunctions": [ + 15615 + ], + "body": { + "id": 14483, + "nodeType": "Block", + "src": "17637:67:57", + "statements": [ + { + "expression": { + "arguments": [ + { + "id": 14479, + "name": "indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14472, + "src": "17671:7:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 14480, + "name": "_delegationRatio", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2419, + "src": "17680:16:57", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + ], + "id": 14478, + "name": "_isOverAllocated", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17330, + "src": "17654:16:57", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_address_$_t_uint32_$returns$_t_bool_$", + "typeString": "function (address,uint32) view returns (bool)" + } + }, + "id": 14481, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "17654:43:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "functionReturnParameters": 14477, + "id": 14482, + "nodeType": "Return", + "src": "17647:50:57" + } + ] + }, + "documentation": { + "id": 14470, + "nodeType": "StructuredDocumentation", + "src": "17520:32:57", + "text": "@inheritdoc ISubgraphService" + }, + "functionSelector": "ba38f67d", + "id": 14484, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "isOverAllocated", + "nameLocation": "17566:15:57", + "nodeType": "FunctionDefinition", + "overrides": { + "id": 14474, + "nodeType": "OverrideSpecifier", + "overrides": [], + "src": "17613:8:57" + }, + "parameters": { + "id": 14473, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 14472, + "mutability": "mutable", + "name": "indexer", + "nameLocation": "17590:7:57", + "nodeType": "VariableDeclaration", + "scope": 14484, + "src": "17582:15:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 14471, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "17582:7:57", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "17581:17:57" + }, + "returnParameters": { + "id": 14477, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 14476, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 14484, + "src": "17631:4:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 14475, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "17631:4:57", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "src": "17630:6:57" + }, + "scope": 14879, + "src": "17557:147:57", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "baseFunctions": [ + 2317 + ], + "body": { + "id": 14504, + "nodeType": "Block", + "src": "18254:123:57", + "statements": [ + { + "assignments": [ + 14494 + ], + "declarations": [ + { + "constant": false, + "id": 14494, + "mutability": "mutable", + "name": "disputePeriod", + "nameLocation": "18271:13:57", + "nodeType": "VariableDeclaration", + "scope": 14504, + "src": "18264:20:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + }, + "typeName": { + "id": 14493, + "name": "uint64", + "nodeType": "ElementaryTypeName", + "src": "18264:6:57", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "visibility": "internal" + } + ], + "id": 14499, + "initialValue": { + "arguments": [], + "expression": { + "argumentTypes": [], + "expression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 14495, + "name": "_disputeManager", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17699, + "src": "18287:15:57", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_contract$_IDisputeManager_$15373_$", + "typeString": "function () view returns (contract IDisputeManager)" + } + }, + "id": 14496, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "18287:17:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_IDisputeManager_$15373", + "typeString": "contract IDisputeManager" + } + }, + "id": 14497, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "18305:16:57", + "memberName": "getDisputePeriod", + "nodeType": "MemberAccess", + "referencedDeclaration": 15326, + "src": "18287:34:57", + "typeDescriptions": { + "typeIdentifier": "t_function_external_view$__$returns$_t_uint64_$", + "typeString": "function () view external returns (uint64)" + } + }, + "id": 14498, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "18287:36:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "18264:59:57" + }, + { + "expression": { + "components": [ + { + "id": 14500, + "name": "disputePeriod", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14494, + "src": "18341:13:57", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + { + "id": 14501, + "name": "disputePeriod", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14494, + "src": "18356:13:57", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + } + ], + "id": 14502, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "18340:30:57", + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_uint64_$_t_uint64_$", + "typeString": "tuple(uint64,uint64)" + } + }, + "functionReturnParameters": 14492, + "id": 14503, + "nodeType": "Return", + "src": "18333:37:57" + } + ] + }, + "documentation": { + "id": 14485, + "nodeType": "StructuredDocumentation", + "src": "17754:413:57", + "text": " @notice Getter for the accepted thawing period range for provisions\n The accepted range is just the dispute period defined by {DisputeManager-getDisputePeriod}\n @dev This override ensures {ProvisionManager} uses the thawing period from the {DisputeManager}\n @return The minimum thawing period - the dispute period\n @return The maximum thawing period - the dispute period" + }, + "id": 14505, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_getThawingPeriodRange", + "nameLocation": "18181:22:57", + "nodeType": "FunctionDefinition", + "overrides": { + "id": 14487, + "nodeType": "OverrideSpecifier", + "overrides": [], + "src": "18220:8:57" + }, + "parameters": { + "id": 14486, + "nodeType": "ParameterList", + "parameters": [], + "src": "18203:2:57" + }, + "returnParameters": { + "id": 14492, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 14489, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 14505, + "src": "18238:6:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + }, + "typeName": { + "id": 14488, + "name": "uint64", + "nodeType": "ElementaryTypeName", + "src": "18238:6:57", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 14491, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 14505, + "src": "18246:6:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + }, + "typeName": { + "id": 14490, + "name": "uint64", + "nodeType": "ElementaryTypeName", + "src": "18246:6:57", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "visibility": "internal" + } + ], + "src": "18237:16:57" + }, + "scope": 14879, + "src": "18172:205:57", + "stateMutability": "view", + "virtual": false, + "visibility": "internal" + }, + { + "baseFunctions": [ + 2330 + ], + "body": { + "id": 14521, + "nodeType": "Block", + "src": "18718:93:57", + "statements": [ + { + "expression": { + "components": [ + { + "arguments": [], + "expression": { + "argumentTypes": [], + "expression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 14514, + "name": "_disputeManager", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17699, + "src": "18736:15:57", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_contract$_IDisputeManager_$15373_$", + "typeString": "function () view returns (contract IDisputeManager)" + } + }, + "id": 14515, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "18736:17:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_IDisputeManager_$15373", + "typeString": "contract IDisputeManager" + } + }, + "id": 14516, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "18754:21:57", + "memberName": "getFishermanRewardCut", + "nodeType": "MemberAccess", + "referencedDeclaration": 15320, + "src": "18736:39:57", + "typeDescriptions": { + "typeIdentifier": "t_function_external_view$__$returns$_t_uint32_$", + "typeString": "function () view external returns (uint32)" + } + }, + "id": 14517, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "18736:41:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + { + "id": 14518, + "name": "DEFAULT_MAX_VERIFIER_CUT", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1841, + "src": "18779:24:57", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + } + ], + "id": 14519, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "18735:69:57", + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_uint32_$_t_uint32_$", + "typeString": "tuple(uint32,uint32)" + } + }, + "functionReturnParameters": 14513, + "id": 14520, + "nodeType": "Return", + "src": "18728:76:57" + } + ] + }, + "documentation": { + "id": 14506, + "nodeType": "StructuredDocumentation", + "src": "18383:250:57", + "text": " @notice Getter for the accepted verifier cut range for provisions\n @return The minimum verifier cut which is defined by the fisherman reward cut {DisputeManager-getFishermanRewardCut}\n @return The maximum is 100% in PPM" + }, + "id": 14522, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_getVerifierCutRange", + "nameLocation": "18647:20:57", + "nodeType": "FunctionDefinition", + "overrides": { + "id": 14508, + "nodeType": "OverrideSpecifier", + "overrides": [], + "src": "18684:8:57" + }, + "parameters": { + "id": 14507, + "nodeType": "ParameterList", + "parameters": [], + "src": "18667:2:57" + }, + "returnParameters": { + "id": 14513, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 14510, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 14522, + "src": "18702:6:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 14509, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "18702:6:57", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 14512, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 14522, + "src": "18710:6:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 14511, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "18710:6:57", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + } + ], + "src": "18701:16:57" + }, + "scope": 14879, + "src": "18638:173:57", + "stateMutability": "view", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 14758, + "nodeType": "Block", + "src": "20565:2975:57", + "statements": [ + { + "assignments": [ + 14536, + 14538 + ], + "declarations": [ + { + "constant": false, + "id": 14536, + "mutability": "mutable", + "name": "signedRav", + "nameLocation": "20614:9:57", + "nodeType": "VariableDeclaration", + "scope": 14758, + "src": "20576:47:57", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_SignedRAV_$2525_memory_ptr", + "typeString": "struct IGraphTallyCollector.SignedRAV" + }, + "typeName": { + "id": 14535, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 14534, + "name": "IGraphTallyCollector.SignedRAV", + "nameLocations": [ + "20576:20:57", + "20597:9:57" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 2525, + "src": "20576:30:57" + }, + "referencedDeclaration": 2525, + "src": "20576:30:57", + "typeDescriptions": { + "typeIdentifier": "t_struct$_SignedRAV_$2525_storage_ptr", + "typeString": "struct IGraphTallyCollector.SignedRAV" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 14538, + "mutability": "mutable", + "name": "tokensToCollect", + "nameLocation": "20633:15:57", + "nodeType": "VariableDeclaration", + "scope": 14758, + "src": "20625:23:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 14537, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "20625:7:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 14548, + "initialValue": { + "arguments": [ + { + "id": 14541, + "name": "data", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14527, + "src": "20676:4:57", + "typeDescriptions": { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes calldata" + } + }, + { + "components": [ + { + "expression": { + "id": 14542, + "name": "IGraphTallyCollector", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2605, + "src": "20695:20:57", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_IGraphTallyCollector_$2605_$", + "typeString": "type(contract IGraphTallyCollector)" + } + }, + "id": 14543, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "20716:9:57", + "memberName": "SignedRAV", + "nodeType": "MemberAccess", + "referencedDeclaration": 2525, + "src": "20695:30:57", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_struct$_SignedRAV_$2525_storage_ptr_$", + "typeString": "type(struct IGraphTallyCollector.SignedRAV storage pointer)" + } + }, + { + "id": 14545, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "20727:7:57", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + }, + "typeName": { + "id": 14544, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "20727:7:57", + "typeDescriptions": {} + } + } + ], + "id": 14546, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "20694:41:57", + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_type$_t_struct$_SignedRAV_$2525_storage_ptr_$_$_t_type$_t_uint256_$_$", + "typeString": "tuple(type(struct IGraphTallyCollector.SignedRAV storage pointer),type(uint256))" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes calldata" + }, + { + "typeIdentifier": "t_tuple$_t_type$_t_struct$_SignedRAV_$2525_storage_ptr_$_$_t_type$_t_uint256_$_$", + "typeString": "tuple(type(struct IGraphTallyCollector.SignedRAV storage pointer),type(uint256))" + } + ], + "expression": { + "id": 14539, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -1, + "src": "20652:3:57", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 14540, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "20656:6:57", + "memberName": "decode", + "nodeType": "MemberAccess", + "src": "20652:10:57", + "typeDescriptions": { + "typeIdentifier": "t_function_abidecode_pure$__$returns$__$", + "typeString": "function () pure" + } + }, + "id": 14547, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "20652:93:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_struct$_SignedRAV_$2525_memory_ptr_$_t_uint256_$", + "typeString": "tuple(struct IGraphTallyCollector.SignedRAV memory,uint256)" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "20575:170:57" + }, + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 14554, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "expression": { + "id": 14550, + "name": "signedRav", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14536, + "src": "20776:9:57", + "typeDescriptions": { + "typeIdentifier": "t_struct$_SignedRAV_$2525_memory_ptr", + "typeString": "struct IGraphTallyCollector.SignedRAV memory" + } + }, + "id": 14551, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "20786:3:57", + "memberName": "rav", + "nodeType": "MemberAccess", + "referencedDeclaration": 2522, + "src": "20776:13:57", + "typeDescriptions": { + "typeIdentifier": "t_struct$_ReceiptAggregateVoucher_$2518_memory_ptr", + "typeString": "struct IGraphTallyCollector.ReceiptAggregateVoucher memory" + } + }, + "id": 14552, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "20790:15:57", + "memberName": "serviceProvider", + "nodeType": "MemberAccess", + "referencedDeclaration": 2509, + "src": "20776:29:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "id": 14553, + "name": "indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14525, + "src": "20809:7:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "20776:40:57", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [ + { + "expression": { + "expression": { + "id": 14556, + "name": "signedRav", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14536, + "src": "20861:9:57", + "typeDescriptions": { + "typeIdentifier": "t_struct$_SignedRAV_$2525_memory_ptr", + "typeString": "struct IGraphTallyCollector.SignedRAV memory" + } + }, + "id": 14557, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "20871:3:57", + "memberName": "rav", + "nodeType": "MemberAccess", + "referencedDeclaration": 2522, + "src": "20861:13:57", + "typeDescriptions": { + "typeIdentifier": "t_struct$_ReceiptAggregateVoucher_$2518_memory_ptr", + "typeString": "struct IGraphTallyCollector.ReceiptAggregateVoucher memory" + } + }, + "id": 14558, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "20875:15:57", + "memberName": "serviceProvider", + "nodeType": "MemberAccess", + "referencedDeclaration": 2509, + "src": "20861:29:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 14559, + "name": "indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14525, + "src": "20892:7:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 14555, + "name": "SubgraphServiceIndexerMismatch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15465, + "src": "20830:30:57", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_address_$_t_address_$returns$_t_error_$", + "typeString": "function (address,address) pure returns (error)" + } + }, + "id": 14560, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "20830:70:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 14549, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "20755:7:57", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 14561, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "20755:155:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 14562, + "nodeType": "ExpressionStatement", + "src": "20755:155:57" + }, + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 14575, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "arguments": [ + { + "expression": { + "expression": { + "id": 14566, + "name": "signedRav", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14536, + "src": "21122:9:57", + "typeDescriptions": { + "typeIdentifier": "t_struct$_SignedRAV_$2525_memory_ptr", + "typeString": "struct IGraphTallyCollector.SignedRAV memory" + } + }, + "id": 14567, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "21132:3:57", + "memberName": "rav", + "nodeType": "MemberAccess", + "referencedDeclaration": 2522, + "src": "21122:13:57", + "typeDescriptions": { + "typeIdentifier": "t_struct$_ReceiptAggregateVoucher_$2518_memory_ptr", + "typeString": "struct IGraphTallyCollector.ReceiptAggregateVoucher memory" + } + }, + "id": 14568, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "21136:12:57", + "memberName": "collectionId", + "nodeType": "MemberAccess", + "referencedDeclaration": 2505, + "src": "21122:26:57", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 14565, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "21114:7:57", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + }, + "typeName": { + "id": 14564, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "21114:7:57", + "typeDescriptions": {} + } + }, + "id": 14569, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "21114:35:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "expression": { + "arguments": [ + { + "id": 14572, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "21158:7:57", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint160_$", + "typeString": "type(uint160)" + }, + "typeName": { + "id": 14571, + "name": "uint160", + "nodeType": "ElementaryTypeName", + "src": "21158:7:57", + "typeDescriptions": {} + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_type$_t_uint160_$", + "typeString": "type(uint160)" + } + ], + "id": 14570, + "name": "type", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -27, + "src": "21153:4:57", + "typeDescriptions": { + "typeIdentifier": "t_function_metatype_pure$__$returns$__$", + "typeString": "function () pure" + } + }, + "id": 14573, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "21153:13:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_magic_meta_type_t_uint160", + "typeString": "type(uint160)" + } + }, + "id": 14574, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "21167:3:57", + "memberName": "max", + "nodeType": "MemberAccess", + "src": "21153:17:57", + "typeDescriptions": { + "typeIdentifier": "t_uint160", + "typeString": "uint160" + } + }, + "src": "21114:56:57", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [ + { + "expression": { + "expression": { + "id": 14577, + "name": "signedRav", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14536, + "src": "21219:9:57", + "typeDescriptions": { + "typeIdentifier": "t_struct$_SignedRAV_$2525_memory_ptr", + "typeString": "struct IGraphTallyCollector.SignedRAV memory" + } + }, + "id": 14578, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "21229:3:57", + "memberName": "rav", + "nodeType": "MemberAccess", + "referencedDeclaration": 2522, + "src": "21219:13:57", + "typeDescriptions": { + "typeIdentifier": "t_struct$_ReceiptAggregateVoucher_$2518_memory_ptr", + "typeString": "struct IGraphTallyCollector.ReceiptAggregateVoucher memory" + } + }, + "id": 14579, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "21233:12:57", + "memberName": "collectionId", + "nodeType": "MemberAccess", + "referencedDeclaration": 2505, + "src": "21219:26:57", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 14576, + "name": "SubgraphServiceInvalidCollectionId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15497, + "src": "21184:34:57", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_bytes32_$returns$_t_error_$", + "typeString": "function (bytes32) pure returns (error)" + } + }, + "id": 14580, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "21184:62:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 14563, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "21093:7:57", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 14581, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "21093:163:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 14582, + "nodeType": "ExpressionStatement", + "src": "21093:163:57" + }, + { + "assignments": [ + 14584 + ], + "declarations": [ + { + "constant": false, + "id": 14584, + "mutability": "mutable", + "name": "allocationId", + "nameLocation": "21274:12:57", + "nodeType": "VariableDeclaration", + "scope": 14758, + "src": "21266:20:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 14583, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "21266:7:57", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "id": 14597, + "initialValue": { + "arguments": [ + { + "arguments": [ + { + "arguments": [ + { + "expression": { + "expression": { + "id": 14591, + "name": "signedRav", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14536, + "src": "21313:9:57", + "typeDescriptions": { + "typeIdentifier": "t_struct$_SignedRAV_$2525_memory_ptr", + "typeString": "struct IGraphTallyCollector.SignedRAV memory" + } + }, + "id": 14592, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "21323:3:57", + "memberName": "rav", + "nodeType": "MemberAccess", + "referencedDeclaration": 2522, + "src": "21313:13:57", + "typeDescriptions": { + "typeIdentifier": "t_struct$_ReceiptAggregateVoucher_$2518_memory_ptr", + "typeString": "struct IGraphTallyCollector.ReceiptAggregateVoucher memory" + } + }, + "id": 14593, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "21327:12:57", + "memberName": "collectionId", + "nodeType": "MemberAccess", + "referencedDeclaration": 2505, + "src": "21313:26:57", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 14590, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "21305:7:57", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + }, + "typeName": { + "id": 14589, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "21305:7:57", + "typeDescriptions": {} + } + }, + "id": 14594, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "21305:35:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 14588, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "21297:7:57", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint160_$", + "typeString": "type(uint160)" + }, + "typeName": { + "id": 14587, + "name": "uint160", + "nodeType": "ElementaryTypeName", + "src": "21297:7:57", + "typeDescriptions": {} + } + }, + "id": 14595, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "21297:44:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint160", + "typeString": "uint160" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint160", + "typeString": "uint160" + } + ], + "id": 14586, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "21289:7:57", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 14585, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "21289:7:57", + "typeDescriptions": {} + } + }, + "id": 14596, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "21289:53:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "21266:76:57" + }, + { + "assignments": [ + 14602 + ], + "declarations": [ + { + "constant": false, + "id": 14602, + "mutability": "mutable", + "name": "allocation", + "nameLocation": "21376:10:57", + "nodeType": "VariableDeclaration", + "scope": 14758, + "src": "21352:34:57", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State" + }, + "typeName": { + "id": 14601, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 14600, + "name": "Allocation.State", + "nameLocations": [ + "21352:10:57", + "21363:5:57" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 15663, + "src": "21352:16:57" + }, + "referencedDeclaration": 15663, + "src": "21352:16:57", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_storage_ptr", + "typeString": "struct Allocation.State" + } + }, + "visibility": "internal" + } + ], + "id": 14607, + "initialValue": { + "arguments": [ + { + "id": 14605, + "name": "allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14584, + "src": "21406:12:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "expression": { + "id": 14603, + "name": "_allocations", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17376, + "src": "21389:12:57", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_State_$15663_storage_$", + "typeString": "mapping(address => struct Allocation.State storage ref)" + } + }, + "id": 14604, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "21402:3:57", + "memberName": "get", + "nodeType": "MemberAccess", + "referencedDeclaration": 15913, + "src": "21389:16:57", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_mapping$_t_address_$_t_struct$_State_$15663_storage_$_$_t_address_$returns$_t_struct$_State_$15663_memory_ptr_$attached_to$_t_mapping$_t_address_$_t_struct$_State_$15663_storage_$_$", + "typeString": "function (mapping(address => struct Allocation.State storage ref),address) view returns (struct Allocation.State memory)" + } + }, + "id": 14606, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "21389:30:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "21352:67:57" + }, + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 14612, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 14609, + "name": "allocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14602, + "src": "21523:10:57", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "id": 14610, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "21534:7:57", + "memberName": "indexer", + "nodeType": "MemberAccess", + "referencedDeclaration": 15646, + "src": "21523:18:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "id": 14611, + "name": "indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14525, + "src": "21545:7:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "21523:29:57", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [ + { + "id": 14614, + "name": "indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14525, + "src": "21580:7:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "expression": { + "id": 14615, + "name": "allocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14602, + "src": "21589:10:57", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "id": 14616, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "21600:7:57", + "memberName": "indexer", + "nodeType": "MemberAccess", + "referencedDeclaration": 15646, + "src": "21589:18:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 14613, + "name": "SubgraphServiceInvalidRAV", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15479, + "src": "21554:25:57", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_address_$_t_address_$returns$_t_error_$", + "typeString": "function (address,address) pure returns (error)" + } + }, + "id": 14617, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "21554:54:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 14608, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "21515:7:57", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 14618, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "21515:94:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 14619, + "nodeType": "ExpressionStatement", + "src": "21515:94:57" + }, + { + "assignments": [ + 14621 + ], + "declarations": [ + { + "constant": false, + "id": 14621, + "mutability": "mutable", + "name": "subgraphDeploymentId", + "nameLocation": "21627:20:57", + "nodeType": "VariableDeclaration", + "scope": 14758, + "src": "21619:28:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 14620, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "21619:7:57", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "id": 14624, + "initialValue": { + "expression": { + "id": 14622, + "name": "allocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14602, + "src": "21650:10:57", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "id": 14623, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "21661:20:57", + "memberName": "subgraphDeploymentId", + "nodeType": "MemberAccess", + "referencedDeclaration": 15648, + "src": "21650:31:57", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "21619:62:57" + }, + { + "expression": { + "arguments": [ + { + "id": 14626, + "name": "indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14525, + "src": "21746:7:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "hexValue": "30", + "id": 14627, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "21755:1:57", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 14625, + "name": "_releaseStake", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1121, + "src": "21732:13:57", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,uint256)" + } + }, + "id": 14628, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "21732:25:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 14629, + "nodeType": "ExpressionStatement", + "src": "21732:25:57" + }, + { + "assignments": [ + 14631 + ], + "declarations": [ + { + "constant": false, + "id": 14631, + "mutability": "mutable", + "name": "tokensCollected", + "nameLocation": "21871:15:57", + "nodeType": "VariableDeclaration", + "scope": 14758, + "src": "21863:23:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 14630, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "21863:7:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 14632, + "nodeType": "VariableDeclarationStatement", + "src": "21863:23:57" + }, + { + "assignments": [ + 14634 + ], + "declarations": [ + { + "constant": false, + "id": 14634, + "mutability": "mutable", + "name": "tokensCurators", + "nameLocation": "21904:14:57", + "nodeType": "VariableDeclaration", + "scope": 14758, + "src": "21896:22:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 14633, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "21896:7:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 14635, + "nodeType": "VariableDeclarationStatement", + "src": "21896:22:57" + }, + { + "id": 14696, + "nodeType": "Block", + "src": "21928:623:57", + "statements": [ + { + "assignments": [ + 14637 + ], + "declarations": [ + { + "constant": false, + "id": 14637, + "mutability": "mutable", + "name": "balanceBefore", + "nameLocation": "21950:13:57", + "nodeType": "VariableDeclaration", + "scope": 14696, + "src": "21942:21:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 14636, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "21942:7:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 14646, + "initialValue": { + "arguments": [ + { + "arguments": [ + { + "id": 14643, + "name": "this", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -28, + "src": "21998:4:57", + "typeDescriptions": { + "typeIdentifier": "t_contract$_SubgraphService_$14879", + "typeString": "contract SubgraphService" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_SubgraphService_$14879", + "typeString": "contract SubgraphService" + } + ], + "id": 14642, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "21990:7:57", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 14641, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "21990:7:57", + "typeDescriptions": {} + } + }, + "id": 14644, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "21990:13:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "expression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 14638, + "name": "_graphToken", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4805, + "src": "21966:11:57", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_contract$_IGraphToken_$758_$", + "typeString": "function () view returns (contract IGraphToken)" + } + }, + "id": 14639, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "21966:13:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_IGraphToken_$758", + "typeString": "contract IGraphToken" + } + }, + "id": 14640, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "21980:9:57", + "memberName": "balanceOf", + "nodeType": "MemberAccess", + "referencedDeclaration": 6104, + "src": "21966:23:57", + "typeDescriptions": { + "typeIdentifier": "t_function_external_view$_t_address_$returns$_t_uint256_$", + "typeString": "function (address) view external returns (uint256)" + } + }, + "id": 14645, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "21966:38:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "21942:62:57" + }, + { + "expression": { + "id": 14667, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 14647, + "name": "tokensCollected", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14631, + "src": "22019:15:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "expression": { + "expression": { + "id": 14651, + "name": "IGraphPayments", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2489, + "src": "22085:14:57", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_IGraphPayments_$2489_$", + "typeString": "type(contract IGraphPayments)" + } + }, + "id": 14652, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "22100:12:57", + "memberName": "PaymentTypes", + "nodeType": "MemberAccess", + "referencedDeclaration": 2433, + "src": "22085:27:57", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_PaymentTypes_$2433_$", + "typeString": "type(enum IGraphPayments.PaymentTypes)" + } + }, + "id": 14653, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "22113:8:57", + "memberName": "QueryFee", + "nodeType": "MemberAccess", + "referencedDeclaration": 2430, + "src": "22085:36:57", + "typeDescriptions": { + "typeIdentifier": "t_enum$_PaymentTypes_$2433", + "typeString": "enum IGraphPayments.PaymentTypes" + } + }, + { + "arguments": [ + { + "id": 14655, + "name": "signedRav", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14536, + "src": "22161:9:57", + "typeDescriptions": { + "typeIdentifier": "t_struct$_SignedRAV_$2525_memory_ptr", + "typeString": "struct IGraphTallyCollector.SignedRAV memory" + } + }, + { + "condition": { + "arguments": [ + { + "id": 14659, + "name": "subgraphDeploymentId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14621, + "src": "22194:20:57", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "expression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 14656, + "name": "_curation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17719, + "src": "22172:9:57", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_contract$_ICuration_$165_$", + "typeString": "function () view returns (contract ICuration)" + } + }, + "id": 14657, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "22172:11:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_ICuration_$165", + "typeString": "contract ICuration" + } + }, + "id": 14658, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "22184:9:57", + "memberName": "isCurated", + "nodeType": "MemberAccess", + "referencedDeclaration": 110, + "src": "22172:21:57", + "typeDescriptions": { + "typeIdentifier": "t_function_external_view$_t_bytes32_$returns$_t_bool_$", + "typeString": "function (bytes32) view external returns (bool)" + } + }, + "id": 14660, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "22172:43:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseExpression": { + "hexValue": "30", + "id": 14662, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "22236:1:57", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "id": 14663, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "Conditional", + "src": "22172:65:57", + "trueExpression": { + "id": 14661, + "name": "curationFeesCut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14896, + "src": "22218:15:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_struct$_SignedRAV_$2525_memory_ptr", + "typeString": "struct IGraphTallyCollector.SignedRAV memory" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 14654, + "name": "_encodeGraphTallyData", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14878, + "src": "22139:21:57", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_struct$_SignedRAV_$2525_memory_ptr_$_t_uint256_$returns$_t_bytes_memory_ptr_$", + "typeString": "function (struct IGraphTallyCollector.SignedRAV memory,uint256) view returns (bytes memory)" + } + }, + "id": 14664, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "22139:99:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + { + "id": 14665, + "name": "tokensToCollect", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14538, + "src": "22256:15:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_enum$_PaymentTypes_$2433", + "typeString": "enum IGraphPayments.PaymentTypes" + }, + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 14648, + "name": "_graphTallyCollector", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17709, + "src": "22037:20:57", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_contract$_IGraphTallyCollector_$2605_$", + "typeString": "function () view returns (contract IGraphTallyCollector)" + } + }, + "id": 14649, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "22037:22:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_IGraphTallyCollector_$2605", + "typeString": "contract IGraphTallyCollector" + } + }, + "id": 14650, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "22060:7:57", + "memberName": "collect", + "nodeType": "MemberAccess", + "referencedDeclaration": 2586, + "src": "22037:30:57", + "typeDescriptions": { + "typeIdentifier": "t_function_external_nonpayable$_t_enum$_PaymentTypes_$2433_$_t_bytes_memory_ptr_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (enum IGraphPayments.PaymentTypes,bytes memory,uint256) external returns (uint256)" + } + }, + "id": 14666, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "22037:248:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "22019:266:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 14668, + "nodeType": "ExpressionStatement", + "src": "22019:266:57" + }, + { + "assignments": [ + 14670 + ], + "declarations": [ + { + "constant": false, + "id": 14670, + "mutability": "mutable", + "name": "balanceAfter", + "nameLocation": "22308:12:57", + "nodeType": "VariableDeclaration", + "scope": 14696, + "src": "22300:20:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 14669, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "22300:7:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 14679, + "initialValue": { + "arguments": [ + { + "arguments": [ + { + "id": 14676, + "name": "this", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -28, + "src": "22355:4:57", + "typeDescriptions": { + "typeIdentifier": "t_contract$_SubgraphService_$14879", + "typeString": "contract SubgraphService" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_SubgraphService_$14879", + "typeString": "contract SubgraphService" + } + ], + "id": 14675, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "22347:7:57", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 14674, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "22347:7:57", + "typeDescriptions": {} + } + }, + "id": 14677, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "22347:13:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "expression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 14671, + "name": "_graphToken", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4805, + "src": "22323:11:57", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_contract$_IGraphToken_$758_$", + "typeString": "function () view returns (contract IGraphToken)" + } + }, + "id": 14672, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "22323:13:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_IGraphToken_$758", + "typeString": "contract IGraphToken" + } + }, + "id": 14673, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "22337:9:57", + "memberName": "balanceOf", + "nodeType": "MemberAccess", + "referencedDeclaration": 6104, + "src": "22323:23:57", + "typeDescriptions": { + "typeIdentifier": "t_function_external_view$_t_address_$returns$_t_uint256_$", + "typeString": "function (address) view external returns (uint256)" + } + }, + "id": 14678, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "22323:38:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "22300:61:57" + }, + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 14683, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 14681, + "name": "balanceAfter", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14670, + "src": "22383:12:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "id": 14682, + "name": "balanceBefore", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14637, + "src": "22399:13:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "22383:29:57", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [ + { + "id": 14685, + "name": "balanceBefore", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14637, + "src": "22452:13:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 14686, + "name": "balanceAfter", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14670, + "src": "22467:12:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 14684, + "name": "SubgraphServiceInconsistentCollection", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15458, + "src": "22414:37:57", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint256_$_t_uint256_$returns$_t_error_$", + "typeString": "function (uint256,uint256) pure returns (error)" + } + }, + "id": 14687, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "22414:66:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 14680, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "22375:7:57", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 14688, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "22375:106:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 14689, + "nodeType": "ExpressionStatement", + "src": "22375:106:57" + }, + { + "expression": { + "id": 14694, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 14690, + "name": "tokensCurators", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14634, + "src": "22495:14:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 14693, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 14691, + "name": "balanceAfter", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14670, + "src": "22512:12:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "id": 14692, + "name": "balanceBefore", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14637, + "src": "22527:13:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "22512:28:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "22495:45:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 14695, + "nodeType": "ExpressionStatement", + "src": "22495:45:57" + } + ] + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 14699, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 14697, + "name": "tokensCollected", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14631, + "src": "22565:15:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "hexValue": "30", + "id": 14698, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "22583:1:57", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "22565:19:57", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 14744, + "nodeType": "IfStatement", + "src": "22561:726:57", + "trueBody": { + "id": 14743, + "nodeType": "Block", + "src": "22586:701:57", + "statements": [ + { + "expression": { + "arguments": [ + { + "id": 14701, + "name": "indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14525, + "src": "22684:7:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 14704, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 14702, + "name": "tokensCollected", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14631, + "src": "22709:15:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "*", + "rightExpression": { + "id": 14703, + "name": "stakeToFeesRatio", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14893, + "src": "22727:16:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "22709:34:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 14711, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 14705, + "name": "block", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -4, + "src": "22761:5:57", + "typeDescriptions": { + "typeIdentifier": "t_magic_block", + "typeString": "block" + } + }, + "id": 14706, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "22767:9:57", + "memberName": "timestamp", + "nodeType": "MemberAccess", + "src": "22761:15:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "expression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 14707, + "name": "_disputeManager", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17699, + "src": "22779:15:57", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_contract$_IDisputeManager_$15373_$", + "typeString": "function () view returns (contract IDisputeManager)" + } + }, + "id": 14708, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "22779:17:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_IDisputeManager_$15373", + "typeString": "contract IDisputeManager" + } + }, + "id": 14709, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "22797:16:57", + "memberName": "getDisputePeriod", + "nodeType": "MemberAccess", + "referencedDeclaration": 15326, + "src": "22779:34:57", + "typeDescriptions": { + "typeIdentifier": "t_function_external_view$__$returns$_t_uint64_$", + "typeString": "function () view external returns (uint64)" + } + }, + "id": 14710, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "22779:36:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "src": "22761:54:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 14700, + "name": "_lockStake", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1074, + "src": "22656:10:57", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_uint256_$_t_uint256_$returns$__$", + "typeString": "function (address,uint256,uint256)" + } + }, + "id": 14712, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "22656:173:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 14713, + "nodeType": "ExpressionStatement", + "src": "22656:173:57" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 14716, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 14714, + "name": "tokensCurators", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14634, + "src": "22848:14:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "hexValue": "30", + "id": 14715, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "22865:1:57", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "22848:18:57", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 14742, + "nodeType": "IfStatement", + "src": "22844:433:57", + "trueBody": { + "id": 14741, + "nodeType": "Block", + "src": "22868:409:57", + "statements": [ + { + "expression": { + "arguments": [ + { + "id": 14720, + "name": "subgraphDeploymentId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14621, + "src": "23023:20:57", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "expression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 14717, + "name": "_graphRewardsManager", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4865, + "src": "22977:20:57", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_contract$_IRewardsManager_$678_$", + "typeString": "function () view returns (contract IRewardsManager)" + } + }, + "id": 14718, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "22977:22:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_IRewardsManager_$678", + "typeString": "contract IRewardsManager" + } + }, + "id": 14719, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "23000:22:57", + "memberName": "onSubgraphSignalUpdate", + "nodeType": "MemberAccess", + "referencedDeclaration": 670, + "src": "22977:45:57", + "typeDescriptions": { + "typeIdentifier": "t_function_external_nonpayable$_t_bytes32_$returns$_t_uint256_$", + "typeString": "function (bytes32) external returns (uint256)" + } + }, + "id": 14721, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "22977:67:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 14722, + "nodeType": "ExpressionStatement", + "src": "22977:67:57" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 14728, + "name": "_curation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17719, + "src": "23158:9:57", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_contract$_ICuration_$165_$", + "typeString": "function () view returns (contract ICuration)" + } + }, + "id": 14729, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "23158:11:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_ICuration_$165", + "typeString": "contract ICuration" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_ICuration_$165", + "typeString": "contract ICuration" + } + ], + "id": 14727, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "23150:7:57", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 14726, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "23150:7:57", + "typeDescriptions": {} + } + }, + "id": 14730, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "23150:20:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 14731, + "name": "tokensCurators", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14634, + "src": "23172:14:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 14723, + "name": "_graphToken", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4805, + "src": "23125:11:57", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_contract$_IGraphToken_$758_$", + "typeString": "function () view returns (contract IGraphToken)" + } + }, + "id": 14724, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "23125:13:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_IGraphToken_$758", + "typeString": "contract IGraphToken" + } + }, + "id": 14725, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "23139:10:57", + "memberName": "pushTokens", + "nodeType": "MemberAccess", + "referencedDeclaration": 818, + "src": "23125:24:57", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IGraphToken_$758_$_t_address_$_t_uint256_$returns$__$attached_to$_t_contract$_IGraphToken_$758_$", + "typeString": "function (contract IGraphToken,address,uint256)" + } + }, + "id": 14732, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "23125:62:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 14733, + "nodeType": "ExpressionStatement", + "src": "23125:62:57" + }, + { + "expression": { + "arguments": [ + { + "id": 14737, + "name": "subgraphDeploymentId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14621, + "src": "23225:20:57", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "id": 14738, + "name": "tokensCurators", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14634, + "src": "23247:14:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 14734, + "name": "_curation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17719, + "src": "23205:9:57", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_contract$_ICuration_$165_$", + "typeString": "function () view returns (contract ICuration)" + } + }, + "id": 14735, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "23205:11:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_ICuration_$165", + "typeString": "contract ICuration" + } + }, + "id": 14736, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "23217:7:57", + "memberName": "collect", + "nodeType": "MemberAccess", + "referencedDeclaration": 102, + "src": "23205:19:57", + "typeDescriptions": { + "typeIdentifier": "t_function_external_nonpayable$_t_bytes32_$_t_uint256_$returns$__$", + "typeString": "function (bytes32,uint256) external" + } + }, + "id": 14739, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "23205:57:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 14740, + "nodeType": "ExpressionStatement", + "src": "23205:57:57" + } + ] + } + } + ] + } + }, + { + "eventCall": { + "arguments": [ + { + "id": 14746, + "name": "indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14525, + "src": "23334:7:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "expression": { + "expression": { + "id": 14747, + "name": "signedRav", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14536, + "src": "23355:9:57", + "typeDescriptions": { + "typeIdentifier": "t_struct$_SignedRAV_$2525_memory_ptr", + "typeString": "struct IGraphTallyCollector.SignedRAV memory" + } + }, + "id": 14748, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "23365:3:57", + "memberName": "rav", + "nodeType": "MemberAccess", + "referencedDeclaration": 2522, + "src": "23355:13:57", + "typeDescriptions": { + "typeIdentifier": "t_struct$_ReceiptAggregateVoucher_$2518_memory_ptr", + "typeString": "struct IGraphTallyCollector.ReceiptAggregateVoucher memory" + } + }, + "id": 14749, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "23369:5:57", + "memberName": "payer", + "nodeType": "MemberAccess", + "referencedDeclaration": 2507, + "src": "23355:19:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 14750, + "name": "allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14584, + "src": "23388:12:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 14751, + "name": "subgraphDeploymentId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14621, + "src": "23414:20:57", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "id": 14752, + "name": "tokensCollected", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14631, + "src": "23448:15:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 14753, + "name": "tokensCurators", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14634, + "src": "23477:14:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 14745, + "name": "QueryFeesCollected", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15409, + "src": "23302:18:57", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_address_$_t_bytes32_$_t_uint256_$_t_uint256_$returns$__$", + "typeString": "function (address,address,address,bytes32,uint256,uint256)" + } + }, + "id": 14754, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "23302:199:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 14755, + "nodeType": "EmitStatement", + "src": "23297:204:57" + }, + { + "expression": { + "id": 14756, + "name": "tokensCollected", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14631, + "src": "23518:15:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 14531, + "id": 14757, + "nodeType": "Return", + "src": "23511:22:57" + } + ] + }, + "documentation": { + "id": 14523, + "nodeType": "StructuredDocumentation", + "src": "18817:1652:57", + "text": " @notice Collect query fees\n Stake equal to the amount being collected times the `stakeToFeesRatio` is locked into a stake claim.\n This claim can be released at a later stage once expired.\n It's important to note that before collecting this function will attempt to release any expired stake claims.\n This could lead to an out of gas error if there are too many expired claims. In that case, the indexer will need to\n manually release the claims, see {IDataServiceFees-releaseStake}, before attempting to collect again.\n @dev This function is the equivalent of the legacy `collect` function for query fees.\n @dev Uses the {GraphTallyCollector} to collect payment from Graph Horizon payments protocol.\n Fees are distributed to service provider and delegators by {GraphPayments}, though curators\n share is distributed by this function.\n Query fees can be collected on closed allocations.\n Requirements:\n - Indexer must have enough available tokens to lock as economic security for fees\n Emits a {StakeClaimsReleased} event, and a {StakeClaimReleased} event for each claim released.\n Emits a {StakeClaimLocked} event.\n Emits a {QueryFeesCollected} event.\n @param indexer The address of the indexer\n @param data Encoded data:\n - IGraphTallyCollector.SignedRAV `signedRav`: The signed RAV\n - uint256 `tokensToCollect`: The amount of tokens to collect. Allows partially collecting a RAV. If 0, the entire RAV will\n be collected.\n @return The amount of fees collected" + }, + "id": 14759, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_collectQueryFees", + "nameLocation": "20483:17:57", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 14528, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 14525, + "mutability": "mutable", + "name": "indexer", + "nameLocation": "20509:7:57", + "nodeType": "VariableDeclaration", + "scope": 14759, + "src": "20501:15:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 14524, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "20501:7:57", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 14527, + "mutability": "mutable", + "name": "data", + "nameLocation": "20533:4:57", + "nodeType": "VariableDeclaration", + "scope": 14759, + "src": "20518:19:57", + "stateVariable": false, + "storageLocation": "calldata", + "typeDescriptions": { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 14526, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "20518:5:57", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "src": "20500:38:57" + }, + "returnParameters": { + "id": 14531, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 14530, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 14759, + "src": "20556:7:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 14529, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "20556:7:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "20555:9:57" + }, + "scope": 14879, + "src": "20474:3066:57", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "private" + }, + { + "body": { + "id": 14811, + "nodeType": "Block", + "src": "24074:401:57", + "statements": [ + { + "assignments": [ + 14770, + 14772, + 14774 + ], + "declarations": [ + { + "constant": false, + "id": 14770, + "mutability": "mutable", + "name": "allocationId", + "nameLocation": "24093:12:57", + "nodeType": "VariableDeclaration", + "scope": 14811, + "src": "24085:20:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 14769, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "24085:7:57", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 14772, + "mutability": "mutable", + "name": "poi_", + "nameLocation": "24115:4:57", + "nodeType": "VariableDeclaration", + "scope": 14811, + "src": "24107:12:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 14771, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "24107:7:57", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 14774, + "mutability": "mutable", + "name": "poiMetadata_", + "nameLocation": "24134:12:57", + "nodeType": "VariableDeclaration", + "scope": 14811, + "src": "24121:25:57", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 14773, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "24121:5:57", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "id": 14786, + "initialValue": { + "arguments": [ + { + "id": 14777, + "name": "data", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14764, + "src": "24161:4:57", + "typeDescriptions": { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes calldata" + } + }, + { + "components": [ + { + "id": 14779, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "24168:7:57", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 14778, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "24168:7:57", + "typeDescriptions": {} + } + }, + { + "id": 14781, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "24177:7:57", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes32_$", + "typeString": "type(bytes32)" + }, + "typeName": { + "id": 14780, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "24177:7:57", + "typeDescriptions": {} + } + }, + { + "id": 14783, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "24186:5:57", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes_storage_ptr_$", + "typeString": "type(bytes storage pointer)" + }, + "typeName": { + "id": 14782, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "24186:5:57", + "typeDescriptions": {} + } + } + ], + "id": 14784, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "24167:25:57", + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_type$_t_address_$_$_t_type$_t_bytes32_$_$_t_type$_t_bytes_storage_ptr_$_$", + "typeString": "tuple(type(address),type(bytes32),type(bytes storage pointer))" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes calldata" + }, + { + "typeIdentifier": "t_tuple$_t_type$_t_address_$_$_t_type$_t_bytes32_$_$_t_type$_t_bytes_storage_ptr_$_$", + "typeString": "tuple(type(address),type(bytes32),type(bytes storage pointer))" + } + ], + "expression": { + "id": 14775, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -1, + "src": "24150:3:57", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 14776, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "24154:6:57", + "memberName": "decode", + "nodeType": "MemberAccess", + "src": "24150:10:57", + "typeDescriptions": { + "typeIdentifier": "t_function_abidecode_pure$__$returns$__$", + "typeString": "function () pure" + } + }, + "id": 14785, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "24150:43:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_address_payable_$_t_bytes32_$_t_bytes_memory_ptr_$", + "typeString": "tuple(address payable,bytes32,bytes memory)" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "24084:109:57" + }, + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 14794, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "arguments": [ + { + "id": 14790, + "name": "allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14770, + "src": "24241:12:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "expression": { + "id": 14788, + "name": "_allocations", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17376, + "src": "24224:12:57", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_State_$15663_storage_$", + "typeString": "mapping(address => struct Allocation.State storage ref)" + } + }, + "id": 14789, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "24237:3:57", + "memberName": "get", + "nodeType": "MemberAccess", + "referencedDeclaration": 15913, + "src": "24224:16:57", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_mapping$_t_address_$_t_struct$_State_$15663_storage_$_$_t_address_$returns$_t_struct$_State_$15663_memory_ptr_$attached_to$_t_mapping$_t_address_$_t_struct$_State_$15663_storage_$_$", + "typeString": "function (mapping(address => struct Allocation.State storage ref),address) view returns (struct Allocation.State memory)" + } + }, + "id": 14791, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "24224:30:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "id": 14792, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "24255:7:57", + "memberName": "indexer", + "nodeType": "MemberAccess", + "referencedDeclaration": 15646, + "src": "24224:38:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "id": 14793, + "name": "indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14762, + "src": "24266:7:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "24224:49:57", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [ + { + "id": 14796, + "name": "indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14762, + "src": "24326:7:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 14797, + "name": "allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14770, + "src": "24335:12:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 14795, + "name": "SubgraphServiceAllocationNotAuthorized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15472, + "src": "24287:38:57", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_address_$_t_address_$returns$_t_error_$", + "typeString": "function (address,address) pure returns (error)" + } + }, + "id": 14798, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "24287:61:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 14787, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "24203:7:57", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 14799, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "24203:155:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 14800, + "nodeType": "ExpressionStatement", + "src": "24203:155:57" + }, + { + "expression": { + "arguments": [ + { + "id": 14802, + "name": "allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14770, + "src": "24387:12:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 14803, + "name": "poi_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14772, + "src": "24401:4:57", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "id": 14804, + "name": "poiMetadata_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14774, + "src": "24407:12:57", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + { + "id": 14805, + "name": "_delegationRatio", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2419, + "src": "24421:16:57", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + { + "baseExpression": { + "id": 14806, + "name": "paymentsDestination", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14901, + "src": "24439:19:57", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_address_$", + "typeString": "mapping(address => address)" + } + }, + "id": 14808, + "indexExpression": { + "id": 14807, + "name": "indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14762, + "src": "24459:7:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "24439:28:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + }, + { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 14801, + "name": "_presentPOI", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17044, + "src": "24375:11:57", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_bytes32_$_t_bytes_memory_ptr_$_t_uint32_$_t_address_$returns$_t_uint256_$", + "typeString": "function (address,bytes32,bytes memory,uint32,address) returns (uint256)" + } + }, + "id": 14809, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "24375:93:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 14768, + "id": 14810, + "nodeType": "Return", + "src": "24368:100:57" + } + ] + }, + "documentation": { + "id": 14760, + "nodeType": "StructuredDocumentation", + "src": "23546:426:57", + "text": " @notice Collect indexing rewards\n @param indexer The address of the indexer\n @param data Encoded data:\n - address `allocationId`: The id of the allocation\n - bytes32 `poi`: The POI being presented\n - bytes `poiMetadata`: The metadata associated with the POI. See {AllocationManager-_presentPOI} for more details.\n @return The amount of indexing rewards collected" + }, + "id": 14812, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_collectIndexingRewards", + "nameLocation": "23986:23:57", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 14765, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 14762, + "mutability": "mutable", + "name": "indexer", + "nameLocation": "24018:7:57", + "nodeType": "VariableDeclaration", + "scope": 14812, + "src": "24010:15:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 14761, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "24010:7:57", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 14764, + "mutability": "mutable", + "name": "data", + "nameLocation": "24042:4:57", + "nodeType": "VariableDeclaration", + "scope": 14812, + "src": "24027:19:57", + "stateVariable": false, + "storageLocation": "calldata", + "typeDescriptions": { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 14763, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "24027:5:57", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "src": "24009:38:57" + }, + "returnParameters": { + "id": 14768, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 14767, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 14812, + "src": "24065:7:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 14766, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "24065:7:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "24064:9:57" + }, + "scope": 14879, + "src": "23977:498:57", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "private" + }, + { + "body": { + "id": 14831, + "nodeType": "Block", + "src": "24845:138:57", + "statements": [ + { + "expression": { + "id": 14824, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "baseExpression": { + "id": 14820, + "name": "paymentsDestination", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14901, + "src": "24855:19:57", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_address_$", + "typeString": "mapping(address => address)" + } + }, + "id": 14822, + "indexExpression": { + "id": 14821, + "name": "_indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14815, + "src": "24875:8:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "24855:29:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "id": 14823, + "name": "_paymentsDestination", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14817, + "src": "24887:20:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "24855:52:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 14825, + "nodeType": "ExpressionStatement", + "src": "24855:52:57" + }, + { + "eventCall": { + "arguments": [ + { + "id": 14827, + "name": "_indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14815, + "src": "24945:8:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 14828, + "name": "_paymentsDestination", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14817, + "src": "24955:20:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 14826, + "name": "PaymentsDestinationSet", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15416, + "src": "24922:22:57", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$returns$__$", + "typeString": "function (address,address)" + } + }, + "id": 14829, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "24922:54:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 14830, + "nodeType": "EmitStatement", + "src": "24917:59:57" + } + ] + }, + "documentation": { + "id": 14813, + "nodeType": "StructuredDocumentation", + "src": "24481:269:57", + "text": " @notice Sets the payments destination for an indexer to receive payments\n @dev Emits a {PaymentsDestinationSet} event\n @param _indexer The address of the indexer\n @param _paymentsDestination The address where payments should be sent" + }, + "id": 14832, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_setPaymentsDestination", + "nameLocation": "24764:23:57", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 14818, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 14815, + "mutability": "mutable", + "name": "_indexer", + "nameLocation": "24796:8:57", + "nodeType": "VariableDeclaration", + "scope": 14832, + "src": "24788:16:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 14814, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "24788:7:57", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 14817, + "mutability": "mutable", + "name": "_paymentsDestination", + "nameLocation": "24814:20:57", + "nodeType": "VariableDeclaration", + "scope": 14832, + "src": "24806:28:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 14816, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "24806:7:57", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "24787:48:57" + }, + "returnParameters": { + "id": 14819, + "nodeType": "ParameterList", + "parameters": [], + "src": "24845:0:57" + }, + "scope": 14879, + "src": "24755:228:57", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 14854, + "nodeType": "Block", + "src": "25170:193:57", + "statements": [ + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 14841, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 14839, + "name": "_stakeToFeesRatio", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14835, + "src": "25188:17:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "hexValue": "30", + "id": 14840, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "25209:1:57", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "25188:22:57", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 14842, + "name": "SubgraphServiceInvalidZeroStakeToFeesRatio", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15492, + "src": "25212:42:57", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$__$returns$_t_error_$", + "typeString": "function () pure returns (error)" + } + }, + "id": 14843, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "25212:44:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 14838, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "25180:7:57", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 14844, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "25180:77:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 14845, + "nodeType": "ExpressionStatement", + "src": "25180:77:57" + }, + { + "expression": { + "id": 14848, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 14846, + "name": "stakeToFeesRatio", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14893, + "src": "25267:16:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "id": 14847, + "name": "_stakeToFeesRatio", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14835, + "src": "25286:17:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "25267:36:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 14849, + "nodeType": "ExpressionStatement", + "src": "25267:36:57" + }, + { + "eventCall": { + "arguments": [ + { + "id": 14851, + "name": "_stakeToFeesRatio", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14835, + "src": "25338:17:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 14850, + "name": "StakeToFeesRatioSet", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15421, + "src": "25318:19:57", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256)" + } + }, + "id": 14852, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "25318:38:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 14853, + "nodeType": "EmitStatement", + "src": "25313:43:57" + } + ] + }, + "documentation": { + "id": 14833, + "nodeType": "StructuredDocumentation", + "src": "24989:111:57", + "text": " @notice Set the stake to fees ratio.\n @param _stakeToFeesRatio The stake to fees ratio" + }, + "id": 14855, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_setStakeToFeesRatio", + "nameLocation": "25114:20:57", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 14836, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 14835, + "mutability": "mutable", + "name": "_stakeToFeesRatio", + "nameLocation": "25143:17:57", + "nodeType": "VariableDeclaration", + "scope": 14855, + "src": "25135:25:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 14834, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "25135:7:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "25134:27:57" + }, + "returnParameters": { + "id": 14837, + "nodeType": "ParameterList", + "parameters": [], + "src": "25170:0:57" + }, + "scope": 14879, + "src": "25105:258:57", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "private" + }, + { + "body": { + "id": 14877, + "nodeType": "Block", + "src": "25798:110:57", + "statements": [ + { + "expression": { + "arguments": [ + { + "id": 14868, + "name": "signedRav", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14859, + "src": "25826:9:57", + "typeDescriptions": { + "typeIdentifier": "t_struct$_SignedRAV_$2525_memory_ptr", + "typeString": "struct IGraphTallyCollector.SignedRAV memory" + } + }, + { + "id": 14869, + "name": "curationCut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14861, + "src": "25837:11:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "baseExpression": { + "id": 14870, + "name": "paymentsDestination", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14901, + "src": "25850:19:57", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_address_$", + "typeString": "mapping(address => address)" + } + }, + "id": 14874, + "indexExpression": { + "expression": { + "expression": { + "id": 14871, + "name": "signedRav", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14859, + "src": "25870:9:57", + "typeDescriptions": { + "typeIdentifier": "t_struct$_SignedRAV_$2525_memory_ptr", + "typeString": "struct IGraphTallyCollector.SignedRAV memory" + } + }, + "id": 14872, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "25880:3:57", + "memberName": "rav", + "nodeType": "MemberAccess", + "referencedDeclaration": 2522, + "src": "25870:13:57", + "typeDescriptions": { + "typeIdentifier": "t_struct$_ReceiptAggregateVoucher_$2518_memory_ptr", + "typeString": "struct IGraphTallyCollector.ReceiptAggregateVoucher memory" + } + }, + "id": 14873, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "25884:15:57", + "memberName": "serviceProvider", + "nodeType": "MemberAccess", + "referencedDeclaration": 2509, + "src": "25870:29:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "25850:50:57", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_struct$_SignedRAV_$2525_memory_ptr", + "typeString": "struct IGraphTallyCollector.SignedRAV memory" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "expression": { + "id": 14866, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -1, + "src": "25815:3:57", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 14867, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "25819:6:57", + "memberName": "encode", + "nodeType": "MemberAccess", + "src": "25815:10:57", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencode_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 14875, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "25815:86:57", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "functionReturnParameters": 14865, + "id": 14876, + "nodeType": "Return", + "src": "25808:93:57" + } + ] + }, + "documentation": { + "id": 14856, + "nodeType": "StructuredDocumentation", + "src": "25369:265:57", + "text": " @notice Encodes the data for the GraphTallyCollector\n @dev The purpose of this function is just to avoid stack too deep errors\n @param signedRav The signed RAV\n @param curationCut The curation cut\n @return The encoded data" + }, + "id": 14878, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_encodeGraphTallyData", + "nameLocation": "25648:21:57", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 14862, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 14859, + "mutability": "mutable", + "name": "signedRav", + "nameLocation": "25717:9:57", + "nodeType": "VariableDeclaration", + "scope": 14878, + "src": "25679:47:57", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_SignedRAV_$2525_memory_ptr", + "typeString": "struct IGraphTallyCollector.SignedRAV" + }, + "typeName": { + "id": 14858, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 14857, + "name": "IGraphTallyCollector.SignedRAV", + "nameLocations": [ + "25679:20:57", + "25700:9:57" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 2525, + "src": "25679:30:57" + }, + "referencedDeclaration": 2525, + "src": "25679:30:57", + "typeDescriptions": { + "typeIdentifier": "t_struct$_SignedRAV_$2525_storage_ptr", + "typeString": "struct IGraphTallyCollector.SignedRAV" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 14861, + "mutability": "mutable", + "name": "curationCut", + "nameLocation": "25744:11:57", + "nodeType": "VariableDeclaration", + "scope": 14878, + "src": "25736:19:57", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 14860, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "25736:7:57", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "25669:92:57" + }, + "returnParameters": { + "id": 14865, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 14864, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 14878, + "src": "25784:12:57", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 14863, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "25784:5:57", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "src": "25783:14:57" + }, + "scope": 14879, + "src": "25639:269:57", + "stateMutability": "view", + "virtual": false, + "visibility": "private" + } + ], + "scope": 14880, + "src": "1972:23938:57", + "usedErrors": [ + 1610, + 1613, + 1639, + 1646, + 1667, + 1918, + 1925, + 1932, + 1937, + 4104, + 4107, + 4110, + 4113, + 4464, + 4655, + 4959, + 4964, + 5140, + 5143, + 5579, + 5582, + 6157, + 6420, + 7894, + 7899, + 7904, + 15431, + 15434, + 15437, + 15440, + 15445, + 15451, + 15458, + 15465, + 15472, + 15479, + 15484, + 15489, + 15492, + 15497, + 15668, + 15673, + 15680, + 16310, + 16615, + 16618, + 16623, + 16630, + 17612 + ], + "usedEvents": [ + 1437, + 1442, + 1449, + 1456, + 1466, + 1473, + 1585, + 1596, + 1605, + 1634, + 1888, + 1893, + 1900, + 1907, + 4650, + 4970, + 5148, + 5571, + 5576, + 6049, + 15409, + 15416, + 15421, + 15426, + 16547, + 16568, + 16581, + 16594, + 16603, + 16608, + 17605 + ] + } + ], + "src": "45:25866:57" + }, + "id": 57 + }, + "contracts/SubgraphServiceStorage.sol": { + "ast": { + "absolutePath": "contracts/SubgraphServiceStorage.sol", + "exportedSymbols": { + "ISubgraphService": [ + 15634 + ], + "SubgraphServiceV1Storage": [ + 14902 + ] + }, + "id": 14903, + "license": "GPL-3.0-or-later", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 14881, + "literals": [ + "solidity", + "0.8", + ".27" + ], + "nodeType": "PragmaDirective", + "src": "45:23:58" + }, + { + "absolutePath": "contracts/interfaces/ISubgraphService.sol", + "file": "./interfaces/ISubgraphService.sol", + "id": 14883, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 14903, + "sourceUnit": 15635, + "src": "70:69:58", + "symbolAliases": [ + { + "foreign": { + "id": 14882, + "name": "ISubgraphService", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15634, + "src": "79:16:58", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "abstract": true, + "baseContracts": [], + "canonicalName": "SubgraphServiceV1Storage", + "contractDependencies": [], + "contractKind": "contract", + "documentation": { + "id": 14884, + "nodeType": "StructuredDocumentation", + "src": "141:272:58", + "text": " @title SubgraphServiceStorage\n @notice This contract holds all the storage variables for the Subgraph Service contract.\n @custom:security-contact Please email security+contracts@thegraph.com if you find any\n bugs. We may have an active bug bounty program." + }, + "fullyImplemented": true, + "id": 14902, + "linearizedBaseContracts": [ + 14902 + ], + "name": "SubgraphServiceV1Storage", + "nameLocation": "432:24:58", + "nodeType": "ContractDefinition", + "nodes": [ + { + "constant": false, + "documentation": { + "id": 14885, + "nodeType": "StructuredDocumentation", + "src": "463:60:58", + "text": "@notice Service providers registered in the data service" + }, + "functionSelector": "4f793cdc", + "id": 14890, + "mutability": "mutable", + "name": "indexers", + "nameLocation": "596:8:58", + "nodeType": "VariableDeclaration", + "scope": 14902, + "src": "528:76:58", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Indexer_$15394_storage_$", + "typeString": "mapping(address => struct ISubgraphService.Indexer)" + }, + "typeName": { + "id": 14889, + "keyName": "indexer", + "keyNameLocation": "544:7:58", + "keyType": { + "id": 14886, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "536:7:58", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "528:60:58", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Indexer_$15394_storage_$", + "typeString": "mapping(address => struct ISubgraphService.Indexer)" + }, + "valueName": "details", + "valueNameLocation": "580:7:58", + "valueType": { + "id": 14888, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 14887, + "name": "ISubgraphService.Indexer", + "nameLocations": [ + "555:16:58", + "572:7:58" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 15394, + "src": "555:24:58" + }, + "referencedDeclaration": 15394, + "src": "555:24:58", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Indexer_$15394_storage_ptr", + "typeString": "struct ISubgraphService.Indexer" + } + } + }, + "visibility": "public" + }, + { + "constant": false, + "documentation": { + "id": 14891, + "nodeType": "StructuredDocumentation", + "src": "611:67:58", + "text": "@notice Multiplier for how many tokens back collected query fees" + }, + "functionSelector": "d07a7a84", + "id": 14893, + "mutability": "mutable", + "name": "stakeToFeesRatio", + "nameLocation": "698:16:58", + "nodeType": "VariableDeclaration", + "scope": 14902, + "src": "683:31:58", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 14892, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "683:7:58", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "public" + }, + { + "constant": false, + "documentation": { + "id": 14894, + "nodeType": "StructuredDocumentation", + "src": "721:66:58", + "text": "@notice The cut curators take from query fee payments. In PPM." + }, + "functionSelector": "138dea08", + "id": 14896, + "mutability": "mutable", + "name": "curationFeesCut", + "nameLocation": "807:15:58", + "nodeType": "VariableDeclaration", + "scope": 14902, + "src": "792:30:58", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 14895, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "792:7:58", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "public" + }, + { + "constant": false, + "documentation": { + "id": 14897, + "nodeType": "StructuredDocumentation", + "src": "829:43:58", + "text": "@notice Destination of indexer payments" + }, + "functionSelector": "07e736d8", + "id": 14901, + "mutability": "mutable", + "name": "paymentsDestination", + "nameLocation": "932:19:58", + "nodeType": "VariableDeclaration", + "scope": 14902, + "src": "877:74:58", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_address_$", + "typeString": "mapping(address => address)" + }, + "typeName": { + "id": 14900, + "keyName": "indexer", + "keyNameLocation": "893:7:58", + "keyType": { + "id": 14898, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "885:7:58", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "877:47:58", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_address_$", + "typeString": "mapping(address => address)" + }, + "valueName": "destination", + "valueNameLocation": "912:11:58", + "valueType": { + "id": 14899, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "904:7:58", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + }, + "visibility": "public" + } + ], + "scope": 14903, + "src": "414:540:58", + "usedErrors": [], + "usedEvents": [] + } + ], + "src": "45:910:58" + }, + "id": 58 + }, + "contracts/interfaces/IDisputeManager.sol": { + "ast": { + "absolutePath": "contracts/interfaces/IDisputeManager.sol", + "exportedSymbols": { + "Attestation": [ + 16290 + ], + "IDisputeManager": [ + 15373 + ] + }, + "id": 15374, + "license": "GPL-2.0-or-later", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 14904, + "literals": [ + "solidity", + "0.8", + ".27" + ], + "nodeType": "PragmaDirective", + "src": "46:23:59" + }, + { + "absolutePath": "contracts/libraries/Attestation.sol", + "file": "../libraries/Attestation.sol", + "id": 14906, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 15374, + "sourceUnit": 16291, + "src": "71:59:59", + "symbolAliases": [ + { + "foreign": { + "id": 14905, + "name": "Attestation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16290, + "src": "80:11:59", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "abstract": false, + "baseContracts": [], + "canonicalName": "IDisputeManager", + "contractDependencies": [], + "contractKind": "interface", + "documentation": { + "id": 14907, + "nodeType": "StructuredDocumentation", + "src": "132:230:59", + "text": " @title IDisputeManager\n @notice Interface for the {Dispute Manager} contract.\n @custom:security-contact Please email security+contracts@thegraph.com if you find any\n bugs. We may have an active bug bounty program." + }, + "fullyImplemented": false, + "id": 15373, + "linearizedBaseContracts": [ + 15373 + ], + "name": "IDisputeManager", + "nameLocation": "373:15:59", + "nodeType": "ContractDefinition", + "nodes": [ + { + "canonicalName": "IDisputeManager.DisputeType", + "documentation": { + "id": 14908, + "nodeType": "StructuredDocumentation", + "src": "395:49:59", + "text": "@notice Types of disputes that can be created" + }, + "id": 14913, + "members": [ + { + "id": 14909, + "name": "Null", + "nameLocation": "476:4:59", + "nodeType": "EnumValue", + "src": "476:4:59" + }, + { + "id": 14910, + "name": "IndexingDispute", + "nameLocation": "490:15:59", + "nodeType": "EnumValue", + "src": "490:15:59" + }, + { + "id": 14911, + "name": "QueryDispute", + "nameLocation": "515:12:59", + "nodeType": "EnumValue", + "src": "515:12:59" + }, + { + "id": 14912, + "name": "LegacyDispute", + "nameLocation": "537:13:59", + "nodeType": "EnumValue", + "src": "537:13:59" + } + ], + "name": "DisputeType", + "nameLocation": "454:11:59", + "nodeType": "EnumDefinition", + "src": "449:107:59" + }, + { + "canonicalName": "IDisputeManager.DisputeStatus", + "documentation": { + "id": 14914, + "nodeType": "StructuredDocumentation", + "src": "562:31:59", + "text": "@notice Status of a dispute" + }, + "id": 14921, + "members": [ + { + "id": 14915, + "name": "Null", + "nameLocation": "627:4:59", + "nodeType": "EnumValue", + "src": "627:4:59" + }, + { + "id": 14916, + "name": "Accepted", + "nameLocation": "641:8:59", + "nodeType": "EnumValue", + "src": "641:8:59" + }, + { + "id": 14917, + "name": "Rejected", + "nameLocation": "659:8:59", + "nodeType": "EnumValue", + "src": "659:8:59" + }, + { + "id": 14918, + "name": "Drawn", + "nameLocation": "677:5:59", + "nodeType": "EnumValue", + "src": "677:5:59" + }, + { + "id": 14919, + "name": "Pending", + "nameLocation": "692:7:59", + "nodeType": "EnumValue", + "src": "692:7:59" + }, + { + "id": 14920, + "name": "Cancelled", + "nameLocation": "709:9:59", + "nodeType": "EnumValue", + "src": "709:9:59" + } + ], + "name": "DisputeStatus", + "nameLocation": "603:13:59", + "nodeType": "EnumDefinition", + "src": "598:126:59" + }, + { + "canonicalName": "IDisputeManager.Dispute", + "documentation": { + "id": 14922, + "nodeType": "StructuredDocumentation", + "src": "730:724:59", + "text": " @notice Dispute details\n @param indexer The indexer that is being disputed\n @param fisherman The fisherman that created the dispute\n @param deposit The amount of tokens deposited by the fisherman\n @param relatedDisputeId The link to a related dispute, used when creating dispute via conflicting attestations\n @param disputeType The type of dispute\n @param status The status of the dispute\n @param createdAt The timestamp when the dispute was created\n @param cancellableAt The timestamp when the dispute can be cancelled\n @param stakeSnapshot The stake snapshot of the indexer at the time of the dispute (includes delegation up to the delegation ratio)" + }, + "id": 14943, + "members": [ + { + "constant": false, + "id": 14924, + "mutability": "mutable", + "name": "indexer", + "nameLocation": "1492:7:59", + "nodeType": "VariableDeclaration", + "scope": 14943, + "src": "1484:15:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 14923, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1484:7:59", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 14926, + "mutability": "mutable", + "name": "fisherman", + "nameLocation": "1517:9:59", + "nodeType": "VariableDeclaration", + "scope": 14943, + "src": "1509:17:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 14925, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1509:7:59", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 14928, + "mutability": "mutable", + "name": "deposit", + "nameLocation": "1544:7:59", + "nodeType": "VariableDeclaration", + "scope": 14943, + "src": "1536:15:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 14927, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1536:7:59", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 14930, + "mutability": "mutable", + "name": "relatedDisputeId", + "nameLocation": "1569:16:59", + "nodeType": "VariableDeclaration", + "scope": 14943, + "src": "1561:24:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 14929, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1561:7:59", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 14933, + "mutability": "mutable", + "name": "disputeType", + "nameLocation": "1607:11:59", + "nodeType": "VariableDeclaration", + "scope": 14943, + "src": "1595:23:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_DisputeType_$14913", + "typeString": "enum IDisputeManager.DisputeType" + }, + "typeName": { + "id": 14932, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 14931, + "name": "DisputeType", + "nameLocations": [ + "1595:11:59" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 14913, + "src": "1595:11:59" + }, + "referencedDeclaration": 14913, + "src": "1595:11:59", + "typeDescriptions": { + "typeIdentifier": "t_enum$_DisputeType_$14913", + "typeString": "enum IDisputeManager.DisputeType" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 14936, + "mutability": "mutable", + "name": "status", + "nameLocation": "1642:6:59", + "nodeType": "VariableDeclaration", + "scope": 14943, + "src": "1628:20:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_DisputeStatus_$14921", + "typeString": "enum IDisputeManager.DisputeStatus" + }, + "typeName": { + "id": 14935, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 14934, + "name": "DisputeStatus", + "nameLocations": [ + "1628:13:59" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 14921, + "src": "1628:13:59" + }, + "referencedDeclaration": 14921, + "src": "1628:13:59", + "typeDescriptions": { + "typeIdentifier": "t_enum$_DisputeStatus_$14921", + "typeString": "enum IDisputeManager.DisputeStatus" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 14938, + "mutability": "mutable", + "name": "createdAt", + "nameLocation": "1666:9:59", + "nodeType": "VariableDeclaration", + "scope": 14943, + "src": "1658:17:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 14937, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1658:7:59", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 14940, + "mutability": "mutable", + "name": "cancellableAt", + "nameLocation": "1693:13:59", + "nodeType": "VariableDeclaration", + "scope": 14943, + "src": "1685:21:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 14939, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1685:7:59", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 14942, + "mutability": "mutable", + "name": "stakeSnapshot", + "nameLocation": "1724:13:59", + "nodeType": "VariableDeclaration", + "scope": 14943, + "src": "1716:21:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 14941, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1716:7:59", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "name": "Dispute", + "nameLocation": "1466:7:59", + "nodeType": "StructDefinition", + "scope": 15373, + "src": "1459:285:59", + "visibility": "public" + }, + { + "anonymous": false, + "documentation": { + "id": 14944, + "nodeType": "StructuredDocumentation", + "src": "1750:114:59", + "text": " @notice Emitted when arbitrator is set.\n @param arbitrator The address of the arbitrator." + }, + "eventSelector": "51744122301b50e919f4e3d22adf8c53abc92195b8c667eda98c6ef20375672e", + "id": 14948, + "name": "ArbitratorSet", + "nameLocation": "1875:13:59", + "nodeType": "EventDefinition", + "parameters": { + "id": 14947, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 14946, + "indexed": true, + "mutability": "mutable", + "name": "arbitrator", + "nameLocation": "1905:10:59", + "nodeType": "VariableDeclaration", + "scope": 14948, + "src": "1889:26:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 14945, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1889:7:59", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "1888:28:59" + }, + "src": "1869:48:59" + }, + { + "anonymous": false, + "documentation": { + "id": 14949, + "nodeType": "StructuredDocumentation", + "src": "1923:121:59", + "text": " @notice Emitted when dispute period is set.\n @param disputePeriod The dispute period in seconds." + }, + "eventSelector": "310462a9bf49fff4a57910ec647c77cbf8aaf2f13394554ac6cdf14fc68db7e6", + "id": 14953, + "name": "DisputePeriodSet", + "nameLocation": "2055:16:59", + "nodeType": "EventDefinition", + "parameters": { + "id": 14952, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 14951, + "indexed": false, + "mutability": "mutable", + "name": "disputePeriod", + "nameLocation": "2079:13:59", + "nodeType": "VariableDeclaration", + "scope": 14953, + "src": "2072:20:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + }, + "typeName": { + "id": 14950, + "name": "uint64", + "nodeType": "ElementaryTypeName", + "src": "2072:6:59", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "visibility": "internal" + } + ], + "src": "2071:22:59" + }, + "src": "2049:45:59" + }, + { + "anonymous": false, + "documentation": { + "id": 14954, + "nodeType": "StructuredDocumentation", + "src": "2100:142:59", + "text": " @notice Emitted when dispute deposit is set.\n @param disputeDeposit The dispute deposit required to create a dispute." + }, + "eventSelector": "97896b9da0f97f36bf3011570bcff930069299de4b1e89c9cb44909841cac2f8", + "id": 14958, + "name": "DisputeDepositSet", + "nameLocation": "2253:17:59", + "nodeType": "EventDefinition", + "parameters": { + "id": 14957, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 14956, + "indexed": false, + "mutability": "mutable", + "name": "disputeDeposit", + "nameLocation": "2279:14:59", + "nodeType": "VariableDeclaration", + "scope": 14958, + "src": "2271:22:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 14955, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2271:7:59", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "2270:24:59" + }, + "src": "2247:48:59" + }, + { + "anonymous": false, + "documentation": { + "id": 14959, + "nodeType": "StructuredDocumentation", + "src": "2301:135:59", + "text": " @notice Emitted when max slashing cut is set.\n @param maxSlashingCut The maximum slashing cut that can be set." + }, + "eventSelector": "7efaf01bec3cda8d104163bb466d01d7e16f68848301c7eb0749cfa59d680502", + "id": 14963, + "name": "MaxSlashingCutSet", + "nameLocation": "2447:17:59", + "nodeType": "EventDefinition", + "parameters": { + "id": 14962, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 14961, + "indexed": false, + "mutability": "mutable", + "name": "maxSlashingCut", + "nameLocation": "2472:14:59", + "nodeType": "VariableDeclaration", + "scope": 14963, + "src": "2465:21:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 14960, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "2465:6:59", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + } + ], + "src": "2464:23:59" + }, + "src": "2441:47:59" + }, + { + "anonymous": false, + "documentation": { + "id": 14964, + "nodeType": "StructuredDocumentation", + "src": "2494:127:59", + "text": " @notice Emitted when fisherman reward cut is set.\n @param fishermanRewardCut The fisherman reward cut." + }, + "eventSelector": "c573dc0f869f6a1d0a74fc7712a63baabcb5567131d2d98005e163924eddcbab", + "id": 14968, + "name": "FishermanRewardCutSet", + "nameLocation": "2632:21:59", + "nodeType": "EventDefinition", + "parameters": { + "id": 14967, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 14966, + "indexed": false, + "mutability": "mutable", + "name": "fishermanRewardCut", + "nameLocation": "2661:18:59", + "nodeType": "VariableDeclaration", + "scope": 14968, + "src": "2654:25:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 14965, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "2654:6:59", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + } + ], + "src": "2653:27:59" + }, + "src": "2626:55:59" + }, + { + "anonymous": false, + "documentation": { + "id": 14969, + "nodeType": "StructuredDocumentation", + "src": "2687:131:59", + "text": " @notice Emitted when subgraph service is set.\n @param subgraphService The address of the subgraph service." + }, + "eventSelector": "81dcb738da3dabd5bb2adbc7dd107fbbfca936e9c8aecab25f5b17a710a784c7", + "id": 14973, + "name": "SubgraphServiceSet", + "nameLocation": "2829:18:59", + "nodeType": "EventDefinition", + "parameters": { + "id": 14972, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 14971, + "indexed": true, + "mutability": "mutable", + "name": "subgraphService", + "nameLocation": "2864:15:59", + "nodeType": "VariableDeclaration", + "scope": 14973, + "src": "2848:31:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 14970, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2848:7:59", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "2847:33:59" + }, + "src": "2823:58:59" + }, + { + "anonymous": false, + "documentation": { + "id": 14974, + "nodeType": "StructuredDocumentation", + "src": "2887:694:59", + "text": " @dev Emitted when a query dispute is created for `subgraphDeploymentId` and `indexer`\n by `fisherman`.\n The event emits the amount of `tokens` deposited by the fisherman and `attestation` submitted.\n @param disputeId The dispute id\n @param indexer The indexer address\n @param fisherman The fisherman address\n @param tokens The amount of tokens deposited by the fisherman\n @param subgraphDeploymentId The subgraph deployment id\n @param attestation The attestation\n @param cancellableAt The timestamp when the dispute can be cancelled\n @param stakeSnapshot The stake snapshot of the indexer at the time of the dispute" + }, + "eventSelector": "fb70faf7306b83c2cec6d8c1627baad892cb79968a02cc0353174499ecfd8b35", + "id": 14992, + "name": "QueryDisputeCreated", + "nameLocation": "3592:19:59", + "nodeType": "EventDefinition", + "parameters": { + "id": 14991, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 14976, + "indexed": true, + "mutability": "mutable", + "name": "disputeId", + "nameLocation": "3637:9:59", + "nodeType": "VariableDeclaration", + "scope": 14992, + "src": "3621:25:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 14975, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "3621:7:59", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 14978, + "indexed": true, + "mutability": "mutable", + "name": "indexer", + "nameLocation": "3672:7:59", + "nodeType": "VariableDeclaration", + "scope": 14992, + "src": "3656:23:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 14977, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3656:7:59", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 14980, + "indexed": true, + "mutability": "mutable", + "name": "fisherman", + "nameLocation": "3705:9:59", + "nodeType": "VariableDeclaration", + "scope": 14992, + "src": "3689:25:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 14979, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3689:7:59", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 14982, + "indexed": false, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "3732:6:59", + "nodeType": "VariableDeclaration", + "scope": 14992, + "src": "3724:14:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 14981, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "3724:7:59", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 14984, + "indexed": false, + "mutability": "mutable", + "name": "subgraphDeploymentId", + "nameLocation": "3756:20:59", + "nodeType": "VariableDeclaration", + "scope": 14992, + "src": "3748:28:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 14983, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "3748:7:59", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 14986, + "indexed": false, + "mutability": "mutable", + "name": "attestation", + "nameLocation": "3792:11:59", + "nodeType": "VariableDeclaration", + "scope": 14992, + "src": "3786:17:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 14985, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "3786:5:59", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 14988, + "indexed": false, + "mutability": "mutable", + "name": "stakeSnapshot", + "nameLocation": "3821:13:59", + "nodeType": "VariableDeclaration", + "scope": 14992, + "src": "3813:21:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 14987, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "3813:7:59", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 14990, + "indexed": false, + "mutability": "mutable", + "name": "cancellableAt", + "nameLocation": "3852:13:59", + "nodeType": "VariableDeclaration", + "scope": 14992, + "src": "3844:21:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 14989, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "3844:7:59", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "3611:260:59" + }, + "src": "3586:286:59" + }, + { + "anonymous": false, + "documentation": { + "id": 14993, + "nodeType": "StructuredDocumentation", + "src": "3878:629:59", + "text": " @dev Emitted when an indexing dispute is created for `allocationId` and `indexer`\n by `fisherman`.\n The event emits the amount of `tokens` deposited by the fisherman.\n @param disputeId The dispute id\n @param indexer The indexer address\n @param fisherman The fisherman address\n @param tokens The amount of tokens deposited by the fisherman\n @param allocationId The allocation id\n @param poi The POI\n @param stakeSnapshot The stake snapshot of the indexer at the time of the dispute\n @param cancellableAt The timestamp when the dispute can be cancelled" + }, + "eventSelector": "8a1eccecce948a912e2e195de5960359755aeac90ad88a3fde55a77e1a73796b", + "id": 15011, + "name": "IndexingDisputeCreated", + "nameLocation": "4518:22:59", + "nodeType": "EventDefinition", + "parameters": { + "id": 15010, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 14995, + "indexed": true, + "mutability": "mutable", + "name": "disputeId", + "nameLocation": "4566:9:59", + "nodeType": "VariableDeclaration", + "scope": 15011, + "src": "4550:25:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 14994, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "4550:7:59", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 14997, + "indexed": true, + "mutability": "mutable", + "name": "indexer", + "nameLocation": "4601:7:59", + "nodeType": "VariableDeclaration", + "scope": 15011, + "src": "4585:23:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 14996, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4585:7:59", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 14999, + "indexed": true, + "mutability": "mutable", + "name": "fisherman", + "nameLocation": "4634:9:59", + "nodeType": "VariableDeclaration", + "scope": 15011, + "src": "4618:25:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 14998, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4618:7:59", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15001, + "indexed": false, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "4661:6:59", + "nodeType": "VariableDeclaration", + "scope": 15011, + "src": "4653:14:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 15000, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "4653:7:59", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15003, + "indexed": false, + "mutability": "mutable", + "name": "allocationId", + "nameLocation": "4685:12:59", + "nodeType": "VariableDeclaration", + "scope": 15011, + "src": "4677:20:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 15002, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4677:7:59", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15005, + "indexed": false, + "mutability": "mutable", + "name": "poi", + "nameLocation": "4715:3:59", + "nodeType": "VariableDeclaration", + "scope": 15011, + "src": "4707:11:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 15004, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "4707:7:59", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15007, + "indexed": false, + "mutability": "mutable", + "name": "stakeSnapshot", + "nameLocation": "4736:13:59", + "nodeType": "VariableDeclaration", + "scope": 15011, + "src": "4728:21:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 15006, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "4728:7:59", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15009, + "indexed": false, + "mutability": "mutable", + "name": "cancellableAt", + "nameLocation": "4767:13:59", + "nodeType": "VariableDeclaration", + "scope": 15011, + "src": "4759:21:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 15008, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "4759:7:59", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "4540:246:59" + }, + "src": "4512:275:59" + }, + { + "anonymous": false, + "documentation": { + "id": 15012, + "nodeType": "StructuredDocumentation", + "src": "4793:538:59", + "text": " @dev Emitted when a legacy dispute is created for `allocationId` and `fisherman`.\n The event emits the amount of `tokensSlash` to slash and `tokensRewards` to reward the fisherman.\n @param disputeId The dispute id\n @param indexer The indexer address\n @param fisherman The fisherman address to be credited with the rewards\n @param allocationId The allocation id\n @param tokensSlash The amount of tokens to slash\n @param tokensRewards The amount of tokens to reward the fisherman" + }, + "eventSelector": "587a1fc7e80e653a2ab7f63f98c080f5818b8cedcfd1374590c8c786290ed031", + "id": 15026, + "name": "LegacyDisputeCreated", + "nameLocation": "5342:20:59", + "nodeType": "EventDefinition", + "parameters": { + "id": 15025, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15014, + "indexed": true, + "mutability": "mutable", + "name": "disputeId", + "nameLocation": "5388:9:59", + "nodeType": "VariableDeclaration", + "scope": 15026, + "src": "5372:25:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 15013, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "5372:7:59", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15016, + "indexed": true, + "mutability": "mutable", + "name": "indexer", + "nameLocation": "5423:7:59", + "nodeType": "VariableDeclaration", + "scope": 15026, + "src": "5407:23:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 15015, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5407:7:59", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15018, + "indexed": true, + "mutability": "mutable", + "name": "fisherman", + "nameLocation": "5456:9:59", + "nodeType": "VariableDeclaration", + "scope": 15026, + "src": "5440:25:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 15017, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5440:7:59", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15020, + "indexed": false, + "mutability": "mutable", + "name": "allocationId", + "nameLocation": "5483:12:59", + "nodeType": "VariableDeclaration", + "scope": 15026, + "src": "5475:20:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 15019, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5475:7:59", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15022, + "indexed": false, + "mutability": "mutable", + "name": "tokensSlash", + "nameLocation": "5513:11:59", + "nodeType": "VariableDeclaration", + "scope": 15026, + "src": "5505:19:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 15021, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "5505:7:59", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15024, + "indexed": false, + "mutability": "mutable", + "name": "tokensRewards", + "nameLocation": "5542:13:59", + "nodeType": "VariableDeclaration", + "scope": 15026, + "src": "5534:21:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 15023, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "5534:7:59", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "5362:199:59" + }, + "src": "5336:226:59" + }, + { + "anonymous": false, + "documentation": { + "id": 15027, + "nodeType": "StructuredDocumentation", + "src": "5568:427:59", + "text": " @dev Emitted when arbitrator accepts a `disputeId` to `indexer` created by `fisherman`.\n The event emits the amount `tokens` transferred to the fisherman, the deposit plus reward.\n @param disputeId The dispute id\n @param indexer The indexer address\n @param fisherman The fisherman address\n @param tokens The amount of tokens transferred to the fisherman, the deposit plus reward" + }, + "eventSelector": "6d800aaaf64b9a1f321dcd63da04369d33d8a0d49ad0fbba085aab4a98bf31c4", + "id": 15037, + "name": "DisputeAccepted", + "nameLocation": "6006:15:59", + "nodeType": "EventDefinition", + "parameters": { + "id": 15036, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15029, + "indexed": true, + "mutability": "mutable", + "name": "disputeId", + "nameLocation": "6047:9:59", + "nodeType": "VariableDeclaration", + "scope": 15037, + "src": "6031:25:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 15028, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "6031:7:59", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15031, + "indexed": true, + "mutability": "mutable", + "name": "indexer", + "nameLocation": "6082:7:59", + "nodeType": "VariableDeclaration", + "scope": 15037, + "src": "6066:23:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 15030, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6066:7:59", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15033, + "indexed": true, + "mutability": "mutable", + "name": "fisherman", + "nameLocation": "6115:9:59", + "nodeType": "VariableDeclaration", + "scope": 15037, + "src": "6099:25:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 15032, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6099:7:59", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15035, + "indexed": false, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "6142:6:59", + "nodeType": "VariableDeclaration", + "scope": 15037, + "src": "6134:14:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 15034, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "6134:7:59", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "6021:133:59" + }, + "src": "6000:155:59" + }, + { + "anonymous": false, + "documentation": { + "id": 15038, + "nodeType": "StructuredDocumentation", + "src": "6161:388:59", + "text": " @dev Emitted when arbitrator rejects a `disputeId` for `indexer` created by `fisherman`.\n The event emits the amount `tokens` burned from the fisherman deposit.\n @param disputeId The dispute id\n @param indexer The indexer address\n @param fisherman The fisherman address\n @param tokens The amount of tokens burned from the fisherman deposit" + }, + "eventSelector": "2226ebd23625a7938fb786df2248bd171d2e6ad70cb2b654ea1be830ca17224d", + "id": 15048, + "name": "DisputeRejected", + "nameLocation": "6560:15:59", + "nodeType": "EventDefinition", + "parameters": { + "id": 15047, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15040, + "indexed": true, + "mutability": "mutable", + "name": "disputeId", + "nameLocation": "6601:9:59", + "nodeType": "VariableDeclaration", + "scope": 15048, + "src": "6585:25:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 15039, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "6585:7:59", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15042, + "indexed": true, + "mutability": "mutable", + "name": "indexer", + "nameLocation": "6636:7:59", + "nodeType": "VariableDeclaration", + "scope": 15048, + "src": "6620:23:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 15041, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6620:7:59", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15044, + "indexed": true, + "mutability": "mutable", + "name": "fisherman", + "nameLocation": "6669:9:59", + "nodeType": "VariableDeclaration", + "scope": 15048, + "src": "6653:25:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 15043, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6653:7:59", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15046, + "indexed": false, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "6696:6:59", + "nodeType": "VariableDeclaration", + "scope": 15048, + "src": "6688:14:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 15045, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "6688:7:59", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "6575:133:59" + }, + "src": "6554:155:59" + }, + { + "anonymous": false, + "documentation": { + "id": 15049, + "nodeType": "StructuredDocumentation", + "src": "6715:403:59", + "text": " @dev Emitted when arbitrator draw a `disputeId` for `indexer` created by `fisherman`.\n The event emits the amount `tokens` used as deposit and returned to the fisherman.\n @param disputeId The dispute id\n @param indexer The indexer address\n @param fisherman The fisherman address\n @param tokens The amount of tokens returned to the fisherman - the deposit" + }, + "eventSelector": "f0912efb86ea1d65a17d64d48393cdb1ca0ea5220dd2bbe438621199d30955b7", + "id": 15059, + "name": "DisputeDrawn", + "nameLocation": "7129:12:59", + "nodeType": "EventDefinition", + "parameters": { + "id": 15058, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15051, + "indexed": true, + "mutability": "mutable", + "name": "disputeId", + "nameLocation": "7158:9:59", + "nodeType": "VariableDeclaration", + "scope": 15059, + "src": "7142:25:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 15050, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "7142:7:59", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15053, + "indexed": true, + "mutability": "mutable", + "name": "indexer", + "nameLocation": "7185:7:59", + "nodeType": "VariableDeclaration", + "scope": 15059, + "src": "7169:23:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 15052, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "7169:7:59", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15055, + "indexed": true, + "mutability": "mutable", + "name": "fisherman", + "nameLocation": "7210:9:59", + "nodeType": "VariableDeclaration", + "scope": 15059, + "src": "7194:25:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 15054, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "7194:7:59", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15057, + "indexed": false, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "7229:6:59", + "nodeType": "VariableDeclaration", + "scope": 15059, + "src": "7221:14:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 15056, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "7221:7:59", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "7141:95:59" + }, + "src": "7123:114:59" + }, + { + "anonymous": false, + "documentation": { + "id": 15060, + "nodeType": "StructuredDocumentation", + "src": "7243:293:59", + "text": " @dev Emitted when two disputes are in conflict to link them.\n This event will be emitted after each DisputeCreated event is emitted\n for each of the individual disputes.\n @param disputeId1 The first dispute id\n @param disputeId2 The second dispute id" + }, + "eventSelector": "fec135a4cf8e5c6e13dea23be058bf03a8bf8f1f6fb0a021b0a5aeddfba81407", + "id": 15066, + "name": "DisputeLinked", + "nameLocation": "7547:13:59", + "nodeType": "EventDefinition", + "parameters": { + "id": 15065, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15062, + "indexed": true, + "mutability": "mutable", + "name": "disputeId1", + "nameLocation": "7577:10:59", + "nodeType": "VariableDeclaration", + "scope": 15066, + "src": "7561:26:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 15061, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "7561:7:59", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15064, + "indexed": true, + "mutability": "mutable", + "name": "disputeId2", + "nameLocation": "7605:10:59", + "nodeType": "VariableDeclaration", + "scope": 15066, + "src": "7589:26:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 15063, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "7589:7:59", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "7560:56:59" + }, + "src": "7541:76:59" + }, + { + "anonymous": false, + "documentation": { + "id": 15067, + "nodeType": "StructuredDocumentation", + "src": "7623:356:59", + "text": " @dev Emitted when a dispute is cancelled by the fisherman.\n The event emits the amount `tokens` returned to the fisherman.\n @param disputeId The dispute id\n @param indexer The indexer address\n @param fisherman The fisherman address\n @param tokens The amount of tokens returned to the fisherman - the deposit" + }, + "eventSelector": "223103f8eb52e5f43a75655152acd882a605d70df57a5c0fefd30f516b1756d2", + "id": 15077, + "name": "DisputeCancelled", + "nameLocation": "7990:16:59", + "nodeType": "EventDefinition", + "parameters": { + "id": 15076, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15069, + "indexed": true, + "mutability": "mutable", + "name": "disputeId", + "nameLocation": "8032:9:59", + "nodeType": "VariableDeclaration", + "scope": 15077, + "src": "8016:25:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 15068, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "8016:7:59", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15071, + "indexed": true, + "mutability": "mutable", + "name": "indexer", + "nameLocation": "8067:7:59", + "nodeType": "VariableDeclaration", + "scope": 15077, + "src": "8051:23:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 15070, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "8051:7:59", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15073, + "indexed": true, + "mutability": "mutable", + "name": "fisherman", + "nameLocation": "8100:9:59", + "nodeType": "VariableDeclaration", + "scope": 15077, + "src": "8084:25:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 15072, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "8084:7:59", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15075, + "indexed": false, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "8127:6:59", + "nodeType": "VariableDeclaration", + "scope": 15077, + "src": "8119:14:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 15074, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "8119:7:59", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "8006:133:59" + }, + "src": "7984:156:59" + }, + { + "documentation": { + "id": 15078, + "nodeType": "StructuredDocumentation", + "src": "8167:71:59", + "text": " @notice Thrown when the caller is not the arbitrator" + }, + "errorSelector": "a8baf3bb", + "id": 15080, + "name": "DisputeManagerNotArbitrator", + "nameLocation": "8249:27:59", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 15079, + "nodeType": "ParameterList", + "parameters": [], + "src": "8276:2:59" + }, + "src": "8243:36:59" + }, + { + "documentation": { + "id": 15081, + "nodeType": "StructuredDocumentation", + "src": "8285:70:59", + "text": " @notice Thrown when the caller is not the fisherman" + }, + "errorSelector": "82c00550", + "id": 15083, + "name": "DisputeManagerNotFisherman", + "nameLocation": "8366:26:59", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 15082, + "nodeType": "ParameterList", + "parameters": [], + "src": "8392:2:59" + }, + "src": "8360:35:59" + }, + { + "documentation": { + "id": 15084, + "nodeType": "StructuredDocumentation", + "src": "8401:70:59", + "text": " @notice Thrown when the address is the zero address" + }, + "errorSelector": "c2d78882", + "id": 15086, + "name": "DisputeManagerInvalidZeroAddress", + "nameLocation": "8482:32:59", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 15085, + "nodeType": "ParameterList", + "parameters": [], + "src": "8514:2:59" + }, + "src": "8476:41:59" + }, + { + "documentation": { + "id": 15087, + "nodeType": "StructuredDocumentation", + "src": "8523:65:59", + "text": " @notice Thrown when the dispute period is zero" + }, + "errorSelector": "c4411f11", + "id": 15089, + "name": "DisputeManagerDisputePeriodZero", + "nameLocation": "8599:31:59", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 15088, + "nodeType": "ParameterList", + "parameters": [], + "src": "8630:2:59" + }, + "src": "8593:40:59" + }, + { + "documentation": { + "id": 15090, + "nodeType": "StructuredDocumentation", + "src": "8639:91:59", + "text": " @notice Thrown when the indexer being disputed has no provisioned tokens" + }, + "errorSelector": "60fdfb6e", + "id": 15092, + "name": "DisputeManagerZeroTokens", + "nameLocation": "8741:24:59", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 15091, + "nodeType": "ParameterList", + "parameters": [], + "src": "8765:2:59" + }, + "src": "8735:33:59" + }, + { + "documentation": { + "id": 15093, + "nodeType": "StructuredDocumentation", + "src": "8774:103:59", + "text": " @notice Thrown when the dispute id is invalid\n @param disputeId The dispute id" + }, + "errorSelector": "5280eef4", + "id": 15097, + "name": "DisputeManagerInvalidDispute", + "nameLocation": "8888:28:59", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 15096, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15095, + "mutability": "mutable", + "name": "disputeId", + "nameLocation": "8925:9:59", + "nodeType": "VariableDeclaration", + "scope": 15097, + "src": "8917:17:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 15094, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "8917:7:59", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "8916:19:59" + }, + "src": "8882:54:59" + }, + { + "documentation": { + "id": 15098, + "nodeType": "StructuredDocumentation", + "src": "8942:158:59", + "text": " @notice Thrown when the dispute deposit is invalid - less than the minimum dispute deposit\n @param disputeDeposit The dispute deposit" + }, + "errorSelector": "033f4e05", + "id": 15102, + "name": "DisputeManagerInvalidDisputeDeposit", + "nameLocation": "9111:35:59", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 15101, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15100, + "mutability": "mutable", + "name": "disputeDeposit", + "nameLocation": "9155:14:59", + "nodeType": "VariableDeclaration", + "scope": 15102, + "src": "9147:22:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 15099, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "9147:7:59", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "9146:24:59" + }, + "src": "9105:66:59" + }, + { + "documentation": { + "id": 15103, + "nodeType": "StructuredDocumentation", + "src": "9177:117:59", + "text": " @notice Thrown when the fisherman reward cut is invalid\n @param cut The fisherman reward cut" + }, + "errorSelector": "865ccc86", + "id": 15107, + "name": "DisputeManagerInvalidFishermanReward", + "nameLocation": "9305:36:59", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 15106, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15105, + "mutability": "mutable", + "name": "cut", + "nameLocation": "9349:3:59", + "nodeType": "VariableDeclaration", + "scope": 15107, + "src": "9342:10:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 15104, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "9342:6:59", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + } + ], + "src": "9341:12:59" + }, + "src": "9299:55:59" + }, + { + "documentation": { + "id": 15108, + "nodeType": "StructuredDocumentation", + "src": "9360:120:59", + "text": " @notice Thrown when the max slashing cut is invalid\n @param maxSlashingCut The max slashing cut" + }, + "errorSelector": "9d26e9f6", + "id": 15112, + "name": "DisputeManagerInvalidMaxSlashingCut", + "nameLocation": "9491:35:59", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 15111, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15110, + "mutability": "mutable", + "name": "maxSlashingCut", + "nameLocation": "9534:14:59", + "nodeType": "VariableDeclaration", + "scope": 15112, + "src": "9527:21:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 15109, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "9527:6:59", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + } + ], + "src": "9526:23:59" + }, + "src": "9485:65:59" + }, + { + "documentation": { + "id": 15113, + "nodeType": "StructuredDocumentation", + "src": "9556:159:59", + "text": " @notice Thrown when the tokens slash is invalid\n @param tokensSlash The tokens slash\n @param maxTokensSlash The max tokens slash" + }, + "errorSelector": "cc6b7c41", + "id": 15119, + "name": "DisputeManagerInvalidTokensSlash", + "nameLocation": "9726:32:59", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 15118, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15115, + "mutability": "mutable", + "name": "tokensSlash", + "nameLocation": "9767:11:59", + "nodeType": "VariableDeclaration", + "scope": 15119, + "src": "9759:19:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 15114, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "9759:7:59", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15117, + "mutability": "mutable", + "name": "maxTokensSlash", + "nameLocation": "9788:14:59", + "nodeType": "VariableDeclaration", + "scope": 15119, + "src": "9780:22:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 15116, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "9780:7:59", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "9758:45:59" + }, + "src": "9720:84:59" + }, + { + "documentation": { + "id": 15120, + "nodeType": "StructuredDocumentation", + "src": "9810:112:59", + "text": " @notice Thrown when the dispute is not pending\n @param status The status of the dispute" + }, + "errorSelector": "51b9503c", + "id": 15125, + "name": "DisputeManagerDisputeNotPending", + "nameLocation": "9933:31:59", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 15124, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15123, + "mutability": "mutable", + "name": "status", + "nameLocation": "9995:6:59", + "nodeType": "VariableDeclaration", + "scope": 15125, + "src": "9965:36:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_DisputeStatus_$14921", + "typeString": "enum IDisputeManager.DisputeStatus" + }, + "typeName": { + "id": 15122, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 15121, + "name": "IDisputeManager.DisputeStatus", + "nameLocations": [ + "9965:15:59", + "9981:13:59" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 14921, + "src": "9965:29:59" + }, + "referencedDeclaration": 14921, + "src": "9965:29:59", + "typeDescriptions": { + "typeIdentifier": "t_enum$_DisputeStatus_$14921", + "typeString": "enum IDisputeManager.DisputeStatus" + } + }, + "visibility": "internal" + } + ], + "src": "9964:38:59" + }, + "src": "9927:76:59" + }, + { + "documentation": { + "id": 15126, + "nodeType": "StructuredDocumentation", + "src": "10009:108:59", + "text": " @notice Thrown when the dispute is already created\n @param disputeId The dispute id" + }, + "errorSelector": "249447e2", + "id": 15130, + "name": "DisputeManagerDisputeAlreadyCreated", + "nameLocation": "10128:35:59", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 15129, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15128, + "mutability": "mutable", + "name": "disputeId", + "nameLocation": "10172:9:59", + "nodeType": "VariableDeclaration", + "scope": 15130, + "src": "10164:17:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 15127, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "10164:7:59", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "10163:19:59" + }, + "src": "10122:61:59" + }, + { + "documentation": { + "id": 15131, + "nodeType": "StructuredDocumentation", + "src": "10189:73:59", + "text": " @notice Thrown when the dispute period is not finished" + }, + "errorSelector": "3aeea7aa", + "id": 15133, + "name": "DisputeManagerDisputePeriodNotFinished", + "nameLocation": "10273:38:59", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 15132, + "nodeType": "ParameterList", + "parameters": [], + "src": "10311:2:59" + }, + "src": "10267:47:59" + }, + { + "documentation": { + "id": 15134, + "nodeType": "StructuredDocumentation", + "src": "10320:104:59", + "text": " @notice Thrown when the dispute is in conflict\n @param disputeId The dispute id" + }, + "errorSelector": "64d0c32b", + "id": 15138, + "name": "DisputeManagerDisputeInConflict", + "nameLocation": "10435:31:59", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 15137, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15136, + "mutability": "mutable", + "name": "disputeId", + "nameLocation": "10475:9:59", + "nodeType": "VariableDeclaration", + "scope": 15138, + "src": "10467:17:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 15135, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "10467:7:59", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "10466:19:59" + }, + "src": "10429:57:59" + }, + { + "documentation": { + "id": 15139, + "nodeType": "StructuredDocumentation", + "src": "10492:108:59", + "text": " @notice Thrown when the dispute is not in conflict\n @param disputeId The dispute id" + }, + "errorSelector": "ff29d3f9", + "id": 15143, + "name": "DisputeManagerDisputeNotInConflict", + "nameLocation": "10611:34:59", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 15142, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15141, + "mutability": "mutable", + "name": "disputeId", + "nameLocation": "10654:9:59", + "nodeType": "VariableDeclaration", + "scope": 15143, + "src": "10646:17:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 15140, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "10646:7:59", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "10645:19:59" + }, + "src": "10605:60:59" + }, + { + "documentation": { + "id": 15144, + "nodeType": "StructuredDocumentation", + "src": "10671:160:59", + "text": " @notice Thrown when the dispute must be accepted\n @param disputeId The dispute id\n @param relatedDisputeId The related dispute id" + }, + "errorSelector": "826e2b26", + "id": 15150, + "name": "DisputeManagerMustAcceptRelatedDispute", + "nameLocation": "10842:38:59", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 15149, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15146, + "mutability": "mutable", + "name": "disputeId", + "nameLocation": "10889:9:59", + "nodeType": "VariableDeclaration", + "scope": 15150, + "src": "10881:17:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 15145, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "10881:7:59", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15148, + "mutability": "mutable", + "name": "relatedDisputeId", + "nameLocation": "10908:16:59", + "nodeType": "VariableDeclaration", + "scope": 15150, + "src": "10900:24:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 15147, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "10900:7:59", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "10880:45:59" + }, + "src": "10836:90:59" + }, + { + "documentation": { + "id": 15151, + "nodeType": "StructuredDocumentation", + "src": "10932:108:59", + "text": " @notice Thrown when the indexer is not found\n @param allocationId The allocation id" + }, + "errorSelector": "d1e2762c", + "id": 15155, + "name": "DisputeManagerIndexerNotFound", + "nameLocation": "11051:29:59", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 15154, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15153, + "mutability": "mutable", + "name": "allocationId", + "nameLocation": "11089:12:59", + "nodeType": "VariableDeclaration", + "scope": 15155, + "src": "11081:20:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 15152, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "11081:7:59", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "11080:22:59" + }, + "src": "11045:58:59" + }, + { + "documentation": { + "id": 15156, + "nodeType": "StructuredDocumentation", + "src": "11109:255:59", + "text": " @notice Thrown when the subgraph deployment is not matching\n @param subgraphDeploymentId1 The subgraph deployment id of the first attestation\n @param subgraphDeploymentId2 The subgraph deployment id of the second attestation" + }, + "errorSelector": "28933f94", + "id": 15162, + "name": "DisputeManagerNonMatchingSubgraphDeployment", + "nameLocation": "11375:43:59", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 15161, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15158, + "mutability": "mutable", + "name": "subgraphDeploymentId1", + "nameLocation": "11427:21:59", + "nodeType": "VariableDeclaration", + "scope": 15162, + "src": "11419:29:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 15157, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "11419:7:59", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15160, + "mutability": "mutable", + "name": "subgraphDeploymentId2", + "nameLocation": "11458:21:59", + "nodeType": "VariableDeclaration", + "scope": 15162, + "src": "11450:29:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 15159, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "11450:7:59", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "11418:62:59" + }, + "src": "11369:112:59" + }, + { + "documentation": { + "id": 15163, + "nodeType": "StructuredDocumentation", + "src": "11487:526:59", + "text": " @notice Thrown when the attestations are not conflicting\n @param requestCID1 The request CID of the first attestation\n @param responseCID1 The response CID of the first attestation\n @param subgraphDeploymentId1 The subgraph deployment id of the first attestation\n @param requestCID2 The request CID of the second attestation\n @param responseCID2 The response CID of the second attestation\n @param subgraphDeploymentId2 The subgraph deployment id of the second attestation" + }, + "errorSelector": "d574a52e", + "id": 15177, + "name": "DisputeManagerNonConflictingAttestations", + "nameLocation": "12024:40:59", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 15176, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15165, + "mutability": "mutable", + "name": "requestCID1", + "nameLocation": "12082:11:59", + "nodeType": "VariableDeclaration", + "scope": 15177, + "src": "12074:19:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 15164, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "12074:7:59", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15167, + "mutability": "mutable", + "name": "responseCID1", + "nameLocation": "12111:12:59", + "nodeType": "VariableDeclaration", + "scope": 15177, + "src": "12103:20:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 15166, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "12103:7:59", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15169, + "mutability": "mutable", + "name": "subgraphDeploymentId1", + "nameLocation": "12141:21:59", + "nodeType": "VariableDeclaration", + "scope": 15177, + "src": "12133:29:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 15168, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "12133:7:59", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15171, + "mutability": "mutable", + "name": "requestCID2", + "nameLocation": "12180:11:59", + "nodeType": "VariableDeclaration", + "scope": 15177, + "src": "12172:19:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 15170, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "12172:7:59", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15173, + "mutability": "mutable", + "name": "responseCID2", + "nameLocation": "12209:12:59", + "nodeType": "VariableDeclaration", + "scope": 15177, + "src": "12201:20:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 15172, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "12201:7:59", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15175, + "mutability": "mutable", + "name": "subgraphDeploymentId2", + "nameLocation": "12239:21:59", + "nodeType": "VariableDeclaration", + "scope": 15177, + "src": "12231:29:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 15174, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "12231:7:59", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "12064:202:59" + }, + "src": "12018:249:59" + }, + { + "documentation": { + "id": 15178, + "nodeType": "StructuredDocumentation", + "src": "12273:94:59", + "text": " @notice Thrown when attempting to get the subgraph service before it is set" + }, + "errorSelector": "bd088b4f", + "id": 15180, + "name": "DisputeManagerSubgraphServiceNotSet", + "nameLocation": "12378:35:59", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 15179, + "nodeType": "ParameterList", + "parameters": [], + "src": "12413:2:59" + }, + "src": "12372:44:59" + }, + { + "documentation": { + "id": 15181, + "nodeType": "StructuredDocumentation", + "src": "12422:430:59", + "text": " @notice Initialize this contract.\n @param owner The owner of the contract\n @param arbitrator Arbitrator role\n @param disputePeriod Dispute period in seconds\n @param disputeDeposit Deposit required to create a Dispute\n @param fishermanRewardCut_ Percent of slashed funds for fisherman (ppm)\n @param maxSlashingCut_ Maximum percentage of indexer stake that can be slashed (ppm)" + }, + "functionSelector": "0bc7344b", + "id": 15196, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "initialize", + "nameLocation": "12866:10:59", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 15194, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15183, + "mutability": "mutable", + "name": "owner", + "nameLocation": "12894:5:59", + "nodeType": "VariableDeclaration", + "scope": 15196, + "src": "12886:13:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 15182, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "12886:7:59", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15185, + "mutability": "mutable", + "name": "arbitrator", + "nameLocation": "12917:10:59", + "nodeType": "VariableDeclaration", + "scope": 15196, + "src": "12909:18:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 15184, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "12909:7:59", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15187, + "mutability": "mutable", + "name": "disputePeriod", + "nameLocation": "12944:13:59", + "nodeType": "VariableDeclaration", + "scope": 15196, + "src": "12937:20:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + }, + "typeName": { + "id": 15186, + "name": "uint64", + "nodeType": "ElementaryTypeName", + "src": "12937:6:59", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15189, + "mutability": "mutable", + "name": "disputeDeposit", + "nameLocation": "12975:14:59", + "nodeType": "VariableDeclaration", + "scope": 15196, + "src": "12967:22:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 15188, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "12967:7:59", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15191, + "mutability": "mutable", + "name": "fishermanRewardCut_", + "nameLocation": "13006:19:59", + "nodeType": "VariableDeclaration", + "scope": 15196, + "src": "12999:26:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 15190, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "12999:6:59", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15193, + "mutability": "mutable", + "name": "maxSlashingCut_", + "nameLocation": "13042:15:59", + "nodeType": "VariableDeclaration", + "scope": 15196, + "src": "13035:22:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 15192, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "13035:6:59", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + } + ], + "src": "12876:187:59" + }, + "returnParameters": { + "id": 15195, + "nodeType": "ParameterList", + "parameters": [], + "src": "13072:0:59" + }, + "scope": 15373, + "src": "12857:216:59", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 15197, + "nodeType": "StructuredDocumentation", + "src": "13079:173:59", + "text": " @notice Set the dispute period.\n @dev Update the dispute period to `_disputePeriod` in seconds\n @param disputePeriod Dispute period in seconds" + }, + "functionSelector": "d76f62d1", + "id": 15202, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "setDisputePeriod", + "nameLocation": "13266:16:59", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 15200, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15199, + "mutability": "mutable", + "name": "disputePeriod", + "nameLocation": "13290:13:59", + "nodeType": "VariableDeclaration", + "scope": 15202, + "src": "13283:20:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + }, + "typeName": { + "id": 15198, + "name": "uint64", + "nodeType": "ElementaryTypeName", + "src": "13283:6:59", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "visibility": "internal" + } + ], + "src": "13282:22:59" + }, + "returnParameters": { + "id": 15201, + "nodeType": "ParameterList", + "parameters": [], + "src": "13313:0:59" + }, + "scope": 15373, + "src": "13257:57:59", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 15203, + "nodeType": "StructuredDocumentation", + "src": "13320:179:59", + "text": " @notice Set the arbitrator address.\n @dev Update the arbitrator to `_arbitrator`\n @param arbitrator The address of the arbitration contract or party" + }, + "functionSelector": "b0eefabe", + "id": 15208, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "setArbitrator", + "nameLocation": "13513:13:59", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 15206, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15205, + "mutability": "mutable", + "name": "arbitrator", + "nameLocation": "13535:10:59", + "nodeType": "VariableDeclaration", + "scope": 15208, + "src": "13527:18:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 15204, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "13527:7:59", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "13526:20:59" + }, + "returnParameters": { + "id": 15207, + "nodeType": "ParameterList", + "parameters": [], + "src": "13555:0:59" + }, + "scope": 15373, + "src": "13504:52:59", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 15209, + "nodeType": "StructuredDocumentation", + "src": "13562:218:59", + "text": " @notice Set the dispute deposit required to create a dispute.\n @dev Update the dispute deposit to `_disputeDeposit` Graph Tokens\n @param disputeDeposit The dispute deposit in Graph Tokens" + }, + "functionSelector": "16972978", + "id": 15214, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "setDisputeDeposit", + "nameLocation": "13794:17:59", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 15212, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15211, + "mutability": "mutable", + "name": "disputeDeposit", + "nameLocation": "13820:14:59", + "nodeType": "VariableDeclaration", + "scope": 15214, + "src": "13812:22:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 15210, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "13812:7:59", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "13811:24:59" + }, + "returnParameters": { + "id": 15213, + "nodeType": "ParameterList", + "parameters": [], + "src": "13844:0:59" + }, + "scope": 15373, + "src": "13785:60:59", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 15215, + "nodeType": "StructuredDocumentation", + "src": "13851:227:59", + "text": " @notice Set the percent reward that the fisherman gets when slashing occurs.\n @dev Update the reward percentage to `_percentage`\n @param fishermanRewardCut_ Reward as a percentage of indexer stake" + }, + "functionSelector": "76c993ae", + "id": 15220, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "setFishermanRewardCut", + "nameLocation": "14092:21:59", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 15218, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15217, + "mutability": "mutable", + "name": "fishermanRewardCut_", + "nameLocation": "14121:19:59", + "nodeType": "VariableDeclaration", + "scope": 15220, + "src": "14114:26:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 15216, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "14114:6:59", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + } + ], + "src": "14113:28:59" + }, + "returnParameters": { + "id": 15219, + "nodeType": "ParameterList", + "parameters": [], + "src": "14150:0:59" + }, + "scope": 15373, + "src": "14083:68:59", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 15221, + "nodeType": "StructuredDocumentation", + "src": "14157:160:59", + "text": " @notice Set the maximum percentage that can be used for slashing indexers.\n @param maxSlashingCut_ Max percentage slashing for disputes" + }, + "functionSelector": "9f81a7cf", + "id": 15226, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "setMaxSlashingCut", + "nameLocation": "14331:17:59", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 15224, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15223, + "mutability": "mutable", + "name": "maxSlashingCut_", + "nameLocation": "14356:15:59", + "nodeType": "VariableDeclaration", + "scope": 15226, + "src": "14349:22:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 15222, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "14349:6:59", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + } + ], + "src": "14348:24:59" + }, + "returnParameters": { + "id": 15225, + "nodeType": "ParameterList", + "parameters": [], + "src": "14381:0:59" + }, + "scope": 15373, + "src": "14322:60:59", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 15227, + "nodeType": "StructuredDocumentation", + "src": "14388:197:59", + "text": " @notice Set the subgraph service address.\n @dev Update the subgraph service to `_subgraphService`\n @param subgraphService The address of the subgraph service contract" + }, + "functionSelector": "93a90a1e", + "id": 15232, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "setSubgraphService", + "nameLocation": "14599:18:59", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 15230, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15229, + "mutability": "mutable", + "name": "subgraphService", + "nameLocation": "14626:15:59", + "nodeType": "VariableDeclaration", + "scope": 15232, + "src": "14618:23:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 15228, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "14618:7:59", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "14617:25:59" + }, + "returnParameters": { + "id": 15231, + "nodeType": "ParameterList", + "parameters": [], + "src": "14651:0:59" + }, + "scope": 15373, + "src": "14590:62:59", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 15233, + "nodeType": "StructuredDocumentation", + "src": "14680:448:59", + "text": " @notice Create a query dispute for the arbitrator to resolve.\n This function is called by a fisherman and it will pull `disputeDeposit` GRT tokens.\n * Requirements:\n - fisherman must have previously approved this contract to pull `disputeDeposit` amount\n of tokens from their balance.\n @param attestationData Attestation bytes submitted by the fisherman\n @return The dispute id" + }, + "functionSelector": "c50a77b1", + "id": 15240, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "createQueryDispute", + "nameLocation": "15142:18:59", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 15236, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15235, + "mutability": "mutable", + "name": "attestationData", + "nameLocation": "15176:15:59", + "nodeType": "VariableDeclaration", + "scope": 15240, + "src": "15161:30:59", + "stateVariable": false, + "storageLocation": "calldata", + "typeDescriptions": { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 15234, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "15161:5:59", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "src": "15160:32:59" + }, + "returnParameters": { + "id": 15239, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15238, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 15240, + "src": "15211:7:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 15237, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "15211:7:59", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "15210:9:59" + }, + "scope": 15373, + "src": "15133:87:59", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 15241, + "nodeType": "StructuredDocumentation", + "src": "15226:974:59", + "text": " @notice Create query disputes for two conflicting attestations.\n A conflicting attestation is a proof presented by two different indexers\n where for the same request on a subgraph the response is different.\n Two linked disputes will be created and if the arbitrator resolve one, the other\n one will be automatically resolved. Note that:\n - it's not possible to reject a conflicting query dispute as by definition at least one\n of the attestations is incorrect.\n - if both attestations are proven to be incorrect, the arbitrator can slash the indexer twice.\n Requirements:\n - fisherman must have previously approved this contract to pull `disputeDeposit` amount\n of tokens from their balance.\n @param attestationData1 First attestation data submitted\n @param attestationData2 Second attestation data submitted\n @return The first dispute id\n @return The second dispute id" + }, + "functionSelector": "c894222e", + "id": 15252, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "createQueryDisputeConflict", + "nameLocation": "16214:26:59", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 15246, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15243, + "mutability": "mutable", + "name": "attestationData1", + "nameLocation": "16265:16:59", + "nodeType": "VariableDeclaration", + "scope": 15252, + "src": "16250:31:59", + "stateVariable": false, + "storageLocation": "calldata", + "typeDescriptions": { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 15242, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "16250:5:59", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15245, + "mutability": "mutable", + "name": "attestationData2", + "nameLocation": "16306:16:59", + "nodeType": "VariableDeclaration", + "scope": 15252, + "src": "16291:31:59", + "stateVariable": false, + "storageLocation": "calldata", + "typeDescriptions": { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 15244, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "16291:5:59", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "src": "16240:88:59" + }, + "returnParameters": { + "id": 15251, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15248, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 15252, + "src": "16347:7:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 15247, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "16347:7:59", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15250, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 15252, + "src": "16356:7:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 15249, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "16356:7:59", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "16346:18:59" + }, + "scope": 15373, + "src": "16205:160:59", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 15253, + "nodeType": "StructuredDocumentation", + "src": "16371:604:59", + "text": " @notice Create an indexing dispute for the arbitrator to resolve.\n The disputes are created in reference to an allocationId and specifically\n a POI for that allocation.\n This function is called by a fisherman and it will pull `disputeDeposit` GRT tokens.\n Requirements:\n - fisherman must have previously approved this contract to pull `disputeDeposit` amount\n of tokens from their balance.\n @param allocationId The allocation to dispute\n @param poi The Proof of Indexing (POI) being disputed\n @return The dispute id" + }, + "functionSelector": "4bc5839a", + "id": 15262, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "createIndexingDispute", + "nameLocation": "16989:21:59", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 15258, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15255, + "mutability": "mutable", + "name": "allocationId", + "nameLocation": "17019:12:59", + "nodeType": "VariableDeclaration", + "scope": 15262, + "src": "17011:20:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 15254, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "17011:7:59", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15257, + "mutability": "mutable", + "name": "poi", + "nameLocation": "17041:3:59", + "nodeType": "VariableDeclaration", + "scope": 15262, + "src": "17033:11:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 15256, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "17033:7:59", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "17010:35:59" + }, + "returnParameters": { + "id": 15261, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15260, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 15262, + "src": "17064:7:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 15259, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "17064:7:59", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "17063:9:59" + }, + "scope": 15373, + "src": "16980:93:59", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 15263, + "nodeType": "StructuredDocumentation", + "src": "17079:1363:59", + "text": " @notice Creates and auto-accepts a legacy dispute.\n This disputes can be created to settle outstanding slashing amounts with an indexer that has been\n \"legacy slashed\" during or shortly after the transition period. See {HorizonStakingExtension.legacySlash}\n for more details.\n Note that this type of dispute:\n - can only be created by the arbitrator\n - does not require a bond\n - is automatically accepted when created\n Additionally, note that this type of disputes allow the arbitrator to directly set the slash and rewards\n amounts, bypassing the usual mechanisms that impose restrictions on those. This is done to give arbitrators\n maximum flexibility to ensure outstanding slashing amounts are settled fairly. This function needs to be removed\n after the transition period.\n Requirements:\n - Indexer must have been legacy slashed during or shortly after the transition period\n - Indexer must have provisioned funds to the Subgraph Service\n @param allocationId The allocation to dispute\n @param fisherman The fisherman address to be credited with the rewards\n @param tokensSlash The amount of tokens to slash\n @param tokensRewards The amount of tokens to reward the fisherman\n @return The dispute id" + }, + "functionSelector": "8d4e9008", + "id": 15276, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "createAndAcceptLegacyDispute", + "nameLocation": "18456:28:59", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 15272, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15265, + "mutability": "mutable", + "name": "allocationId", + "nameLocation": "18502:12:59", + "nodeType": "VariableDeclaration", + "scope": 15276, + "src": "18494:20:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 15264, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "18494:7:59", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15267, + "mutability": "mutable", + "name": "fisherman", + "nameLocation": "18532:9:59", + "nodeType": "VariableDeclaration", + "scope": 15276, + "src": "18524:17:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 15266, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "18524:7:59", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15269, + "mutability": "mutable", + "name": "tokensSlash", + "nameLocation": "18559:11:59", + "nodeType": "VariableDeclaration", + "scope": 15276, + "src": "18551:19:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 15268, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "18551:7:59", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15271, + "mutability": "mutable", + "name": "tokensRewards", + "nameLocation": "18588:13:59", + "nodeType": "VariableDeclaration", + "scope": 15276, + "src": "18580:21:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 15270, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "18580:7:59", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "18484:123:59" + }, + "returnParameters": { + "id": 15275, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15274, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 15276, + "src": "18626:7:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 15273, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "18626:7:59", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "18625:9:59" + }, + "scope": 15373, + "src": "18447:188:59", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 15277, + "nodeType": "StructuredDocumentation", + "src": "18666:649:59", + "text": " @notice The arbitrator accepts a dispute as being valid.\n This function will revert if the indexer is not slashable, whether because it does not have\n any stake available or the slashing percentage is configured to be zero. In those cases\n a dispute must be resolved using drawDispute or rejectDispute.\n This function will also revert if the dispute is in conflict, to accept a conflicting dispute\n use acceptDisputeConflict.\n @dev Accept a dispute with Id `disputeId`\n @param disputeId Id of the dispute to be accepted\n @param tokensSlash Amount of tokens to slash from the indexer" + }, + "functionSelector": "050b17ad", + "id": 15284, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "acceptDispute", + "nameLocation": "19329:13:59", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 15282, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15279, + "mutability": "mutable", + "name": "disputeId", + "nameLocation": "19351:9:59", + "nodeType": "VariableDeclaration", + "scope": 15284, + "src": "19343:17:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 15278, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "19343:7:59", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15281, + "mutability": "mutable", + "name": "tokensSlash", + "nameLocation": "19370:11:59", + "nodeType": "VariableDeclaration", + "scope": 15284, + "src": "19362:19:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 15280, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "19362:7:59", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "19342:40:59" + }, + "returnParameters": { + "id": 15283, + "nodeType": "ParameterList", + "parameters": [], + "src": "19391:0:59" + }, + "scope": 15373, + "src": "19320:72:59", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 15285, + "nodeType": "StructuredDocumentation", + "src": "19398:770:59", + "text": " @notice The arbitrator accepts a conflicting dispute as being valid.\n This function will revert if the indexer is not slashable, whether because it does not have\n any stake available or the slashing percentage is configured to be zero. In those cases\n a dispute must be resolved using drawDispute.\n @param disputeId Id of the dispute to be accepted\n @param tokensSlash Amount of tokens to slash from the indexer for the first dispute\n @param acceptDisputeInConflict Accept the conflicting dispute. Otherwise it will be drawn automatically\n @param tokensSlashRelated Amount of tokens to slash from the indexer for the related dispute in case\n acceptDisputeInConflict is true, otherwise it will be ignored" + }, + "functionSelector": "b0e2f7e9", + "id": 15296, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "acceptDisputeConflict", + "nameLocation": "20182:21:59", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 15294, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15287, + "mutability": "mutable", + "name": "disputeId", + "nameLocation": "20221:9:59", + "nodeType": "VariableDeclaration", + "scope": 15296, + "src": "20213:17:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 15286, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "20213:7:59", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15289, + "mutability": "mutable", + "name": "tokensSlash", + "nameLocation": "20248:11:59", + "nodeType": "VariableDeclaration", + "scope": 15296, + "src": "20240:19:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 15288, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "20240:7:59", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15291, + "mutability": "mutable", + "name": "acceptDisputeInConflict", + "nameLocation": "20274:23:59", + "nodeType": "VariableDeclaration", + "scope": 15296, + "src": "20269:28:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 15290, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "20269:4:59", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15293, + "mutability": "mutable", + "name": "tokensSlashRelated", + "nameLocation": "20315:18:59", + "nodeType": "VariableDeclaration", + "scope": 15296, + "src": "20307:26:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 15292, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "20307:7:59", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "20203:136:59" + }, + "returnParameters": { + "id": 15295, + "nodeType": "ParameterList", + "parameters": [], + "src": "20348:0:59" + }, + "scope": 15373, + "src": "20173:176:59", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 15297, + "nodeType": "StructuredDocumentation", + "src": "20355:247:59", + "text": " @notice The arbitrator rejects a dispute as being invalid.\n Note that conflicting query disputes cannot be rejected.\n @dev Reject a dispute with Id `disputeId`\n @param disputeId Id of the dispute to be rejected" + }, + "functionSelector": "36167e03", + "id": 15302, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "rejectDispute", + "nameLocation": "20616:13:59", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 15300, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15299, + "mutability": "mutable", + "name": "disputeId", + "nameLocation": "20638:9:59", + "nodeType": "VariableDeclaration", + "scope": 15302, + "src": "20630:17:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 15298, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "20630:7:59", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "20629:19:59" + }, + "returnParameters": { + "id": 15301, + "nodeType": "ParameterList", + "parameters": [], + "src": "20657:0:59" + }, + "scope": 15373, + "src": "20607:51:59", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 15303, + "nodeType": "StructuredDocumentation", + "src": "20664:335:59", + "text": " @notice The arbitrator draws dispute.\n Note that drawing a conflicting query dispute should not be possible however it is allowed\n to give arbitrators greater flexibility when resolving disputes.\n @dev Ignore a dispute with Id `disputeId`\n @param disputeId Id of the dispute to be disregarded" + }, + "functionSelector": "9334ea52", + "id": 15308, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "drawDispute", + "nameLocation": "21013:11:59", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 15306, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15305, + "mutability": "mutable", + "name": "disputeId", + "nameLocation": "21033:9:59", + "nodeType": "VariableDeclaration", + "scope": 15308, + "src": "21025:17:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 15304, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "21025:7:59", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "21024:19:59" + }, + "returnParameters": { + "id": 15307, + "nodeType": "ParameterList", + "parameters": [], + "src": "21052:0:59" + }, + "scope": 15373, + "src": "21004:49:59", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 15309, + "nodeType": "StructuredDocumentation", + "src": "21059:376:59", + "text": " @notice Once the dispute period ends, if the dispute status remains Pending,\n the fisherman can cancel the dispute and get back their initial deposit.\n Note that cancelling a conflicting query dispute will also cancel the related dispute.\n @dev Cancel a dispute with Id `disputeId`\n @param disputeId Id of the dispute to be cancelled" + }, + "functionSelector": "1792f194", + "id": 15314, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "cancelDispute", + "nameLocation": "21449:13:59", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 15312, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15311, + "mutability": "mutable", + "name": "disputeId", + "nameLocation": "21471:9:59", + "nodeType": "VariableDeclaration", + "scope": 15314, + "src": "21463:17:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 15310, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "21463:7:59", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "21462:19:59" + }, + "returnParameters": { + "id": 15313, + "nodeType": "ParameterList", + "parameters": [], + "src": "21490:0:59" + }, + "scope": 15373, + "src": "21440:51:59", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 15315, + "nodeType": "StructuredDocumentation", + "src": "21519:112:59", + "text": " @notice Get the fisherman reward cut.\n @return Fisherman reward cut in percentage (ppm)" + }, + "functionSelector": "bb2a2b47", + "id": 15320, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "getFishermanRewardCut", + "nameLocation": "21645:21:59", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 15316, + "nodeType": "ParameterList", + "parameters": [], + "src": "21666:2:59" + }, + "returnParameters": { + "id": 15319, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15318, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 15320, + "src": "21692:6:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 15317, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "21692:6:59", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + } + ], + "src": "21691:8:59" + }, + "scope": 15373, + "src": "21636:64:59", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 15321, + "nodeType": "StructuredDocumentation", + "src": "21706:91:59", + "text": " @notice Get the dispute period.\n @return Dispute period in seconds" + }, + "functionSelector": "5aea0ec4", + "id": 15326, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "getDisputePeriod", + "nameLocation": "21811:16:59", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 15322, + "nodeType": "ParameterList", + "parameters": [], + "src": "21827:2:59" + }, + "returnParameters": { + "id": 15325, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15324, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 15326, + "src": "21853:6:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + }, + "typeName": { + "id": 15323, + "name": "uint64", + "nodeType": "ElementaryTypeName", + "src": "21853:6:59", + "typeDescriptions": { + "typeIdentifier": "t_uint64", + "typeString": "uint64" + } + }, + "visibility": "internal" + } + ], + "src": "21852:8:59" + }, + "scope": 15373, + "src": "21802:59:59", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 15327, + "nodeType": "StructuredDocumentation", + "src": "21867:224:59", + "text": " @notice Return whether a dispute exists or not.\n @dev Return if dispute with Id `disputeId` exists\n @param disputeId True if dispute already exists\n @return True if dispute already exists" + }, + "functionSelector": "be41f384", + "id": 15334, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "isDisputeCreated", + "nameLocation": "22105:16:59", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 15330, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15329, + "mutability": "mutable", + "name": "disputeId", + "nameLocation": "22130:9:59", + "nodeType": "VariableDeclaration", + "scope": 15334, + "src": "22122:17:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 15328, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "22122:7:59", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "22121:19:59" + }, + "returnParameters": { + "id": 15333, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15332, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 15334, + "src": "22164:4:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 15331, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "22164:4:59", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "src": "22163:6:59" + }, + "scope": 15373, + "src": "22096:74:59", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 15335, + "nodeType": "StructuredDocumentation", + "src": "22176:429:59", + "text": " @notice Get the message hash that a indexer used to sign the receipt.\n Encodes a receipt using a domain separator, as described on\n https://github.com/ethereum/EIPs/blob/master/EIPS/eip-712.md#specification.\n @dev Return the message hash used to sign the receipt\n @param receipt Receipt returned by indexer and submitted by fisherman\n @return Message hash used to sign the receipt" + }, + "functionSelector": "6369df6b", + "id": 15343, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "encodeReceipt", + "nameLocation": "22619:13:59", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 15339, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15338, + "mutability": "mutable", + "name": "receipt", + "nameLocation": "22660:7:59", + "nodeType": "VariableDeclaration", + "scope": 15343, + "src": "22633:34:59", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Receipt_$16044_memory_ptr", + "typeString": "struct Attestation.Receipt" + }, + "typeName": { + "id": 15337, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 15336, + "name": "Attestation.Receipt", + "nameLocations": [ + "22633:11:59", + "22645:7:59" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 16044, + "src": "22633:19:59" + }, + "referencedDeclaration": 16044, + "src": "22633:19:59", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Receipt_$16044_storage_ptr", + "typeString": "struct Attestation.Receipt" + } + }, + "visibility": "internal" + } + ], + "src": "22632:36:59" + }, + "returnParameters": { + "id": 15342, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15341, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 15343, + "src": "22692:7:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 15340, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "22692:7:59", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "22691:9:59" + }, + "scope": 15373, + "src": "22610:91:59", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 15344, + "nodeType": "StructuredDocumentation", + "src": "22707:143:59", + "text": " @notice Returns the indexer that signed an attestation.\n @param attestation Attestation\n @return indexer address" + }, + "functionSelector": "c9747f51", + "id": 15352, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "getAttestationIndexer", + "nameLocation": "22864:21:59", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 15348, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15347, + "mutability": "mutable", + "name": "attestation", + "nameLocation": "22911:11:59", + "nodeType": "VariableDeclaration", + "scope": 15352, + "src": "22886:36:59", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16058_memory_ptr", + "typeString": "struct Attestation.State" + }, + "typeName": { + "id": 15346, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 15345, + "name": "Attestation.State", + "nameLocations": [ + "22886:11:59", + "22898:5:59" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 16058, + "src": "22886:17:59" + }, + "referencedDeclaration": 16058, + "src": "22886:17:59", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16058_storage_ptr", + "typeString": "struct Attestation.State" + } + }, + "visibility": "internal" + } + ], + "src": "22885:38:59" + }, + "returnParameters": { + "id": 15351, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15350, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 15352, + "src": "22947:7:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 15349, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "22947:7:59", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "22946:9:59" + }, + "scope": 15373, + "src": "22855:101:59", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 15353, + "nodeType": "StructuredDocumentation", + "src": "22962:141:59", + "text": " @notice Get the stake snapshot for an indexer.\n @param indexer The indexer address\n @return The stake snapshot" + }, + "functionSelector": "c133b429", + "id": 15360, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "getStakeSnapshot", + "nameLocation": "23117:16:59", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 15356, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15355, + "mutability": "mutable", + "name": "indexer", + "nameLocation": "23142:7:59", + "nodeType": "VariableDeclaration", + "scope": 15360, + "src": "23134:15:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 15354, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "23134:7:59", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "23133:17:59" + }, + "returnParameters": { + "id": 15359, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15358, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 15360, + "src": "23174:7:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 15357, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "23174:7:59", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "23173:9:59" + }, + "scope": 15373, + "src": "23108:75:59", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 15361, + "nodeType": "StructuredDocumentation", + "src": "23189:224:59", + "text": " @notice Checks if two attestations are conflicting\n @param attestation1 The first attestation\n @param attestation2 The second attestation\n @return Whether the attestations are conflicting" + }, + "functionSelector": "d36fc9d4", + "id": 15372, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "areConflictingAttestations", + "nameLocation": "23427:26:59", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 15368, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15364, + "mutability": "mutable", + "name": "attestation1", + "nameLocation": "23488:12:59", + "nodeType": "VariableDeclaration", + "scope": 15372, + "src": "23463:37:59", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16058_memory_ptr", + "typeString": "struct Attestation.State" + }, + "typeName": { + "id": 15363, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 15362, + "name": "Attestation.State", + "nameLocations": [ + "23463:11:59", + "23475:5:59" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 16058, + "src": "23463:17:59" + }, + "referencedDeclaration": 16058, + "src": "23463:17:59", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16058_storage_ptr", + "typeString": "struct Attestation.State" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15367, + "mutability": "mutable", + "name": "attestation2", + "nameLocation": "23535:12:59", + "nodeType": "VariableDeclaration", + "scope": 15372, + "src": "23510:37:59", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16058_memory_ptr", + "typeString": "struct Attestation.State" + }, + "typeName": { + "id": 15366, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 15365, + "name": "Attestation.State", + "nameLocations": [ + "23510:11:59", + "23522:5:59" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 16058, + "src": "23510:17:59" + }, + "referencedDeclaration": 16058, + "src": "23510:17:59", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16058_storage_ptr", + "typeString": "struct Attestation.State" + } + }, + "visibility": "internal" + } + ], + "src": "23453:100:59" + }, + "returnParameters": { + "id": 15371, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15370, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 15372, + "src": "23577:4:59", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 15369, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "23577:4:59", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "src": "23576:6:59" + }, + "scope": 15373, + "src": "23418:165:59", + "stateMutability": "pure", + "virtual": false, + "visibility": "external" + } + ], + "scope": 15374, + "src": "363:23222:59", + "usedErrors": [ + 15080, + 15083, + 15086, + 15089, + 15092, + 15097, + 15102, + 15107, + 15112, + 15119, + 15125, + 15130, + 15133, + 15138, + 15143, + 15150, + 15155, + 15162, + 15177, + 15180 + ], + "usedEvents": [ + 14948, + 14953, + 14958, + 14963, + 14968, + 14973, + 14992, + 15011, + 15026, + 15037, + 15048, + 15059, + 15066, + 15077 + ] + } + ], + "src": "46:23540:59" + }, + "id": 59 + }, + "contracts/interfaces/ISubgraphService.sol": { + "ast": { + "absolutePath": "contracts/interfaces/ISubgraphService.sol", + "exportedSymbols": { + "Allocation": [ + 16033 + ], + "IDataServiceFees": [ + 1620 + ], + "IGraphPayments": [ + 2489 + ], + "ISubgraphService": [ + 15634 + ], + "LegacyAllocation": [ + 16462 + ] + }, + "id": 15635, + "license": "GPL-3.0-or-later", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 15375, + "literals": [ + "solidity", + "0.8", + ".27" + ], + "nodeType": "PragmaDirective", + "src": "45:23:60" + }, + { + "absolutePath": "@graphprotocol/horizon/contracts/data-service/interfaces/IDataServiceFees.sol", + "file": "@graphprotocol/horizon/contracts/data-service/interfaces/IDataServiceFees.sol", + "id": 15377, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 15635, + "sourceUnit": 1621, + "src": "70:113:60", + "symbolAliases": [ + { + "foreign": { + "id": 15376, + "name": "IDataServiceFees", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1620, + "src": "79:16:60", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "@graphprotocol/horizon/contracts/interfaces/IGraphPayments.sol", + "file": "@graphprotocol/horizon/contracts/interfaces/IGraphPayments.sol", + "id": 15379, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 15635, + "sourceUnit": 2490, + "src": "184:96:60", + "symbolAliases": [ + { + "foreign": { + "id": 15378, + "name": "IGraphPayments", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2489, + "src": "193:14:60", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "contracts/libraries/Allocation.sol", + "file": "../libraries/Allocation.sol", + "id": 15381, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 15635, + "sourceUnit": 16034, + "src": "282:57:60", + "symbolAliases": [ + { + "foreign": { + "id": 15380, + "name": "Allocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16033, + "src": "291:10:60", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "contracts/libraries/LegacyAllocation.sol", + "file": "../libraries/LegacyAllocation.sol", + "id": 15383, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 15635, + "sourceUnit": 16463, + "src": "340:69:60", + "symbolAliases": [ + { + "foreign": { + "id": 15382, + "name": "LegacyAllocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16462, + "src": "349:16:60", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "abstract": false, + "baseContracts": [ + { + "baseName": { + "id": 15385, + "name": "IDataServiceFees", + "nameLocations": [ + "1138:16:60" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 1620, + "src": "1138:16:60" + }, + "id": 15386, + "nodeType": "InheritanceSpecifier", + "src": "1138:16:60" + } + ], + "canonicalName": "ISubgraphService", + "contractDependencies": [], + "contractKind": "interface", + "documentation": { + "id": 15384, + "nodeType": "StructuredDocumentation", + "src": "411:696:60", + "text": " @title Interface for the {SubgraphService} contract\n @dev This interface extends {IDataServiceFees} and {IDataService}.\n @notice The Subgraph Service is a data service built on top of Graph Horizon that supports the use case of\n subgraph indexing and querying. The {SubgraphService} contract implements the flows described in the Data\n Service framework to allow indexers to register as subgraph service providers, create allocations to signal\n their commitment to index a subgraph, and collect fees for indexing and querying services.\n @custom:security-contact Please email security+contracts@thegraph.com if you find any\n bugs. We may have an active bug bounty program." + }, + "fullyImplemented": false, + "id": 15634, + "linearizedBaseContracts": [ + 15634, + 1620, + 1557 + ], + "name": "ISubgraphService", + "nameLocation": "1118:16:60", + "nodeType": "ContractDefinition", + "nodes": [ + { + "canonicalName": "ISubgraphService.Indexer", + "documentation": { + "id": 15387, + "nodeType": "StructuredDocumentation", + "src": "1161:259:60", + "text": " @notice Indexer details\n @param registeredAt The timestamp when the indexer registered\n @param url The URL where the indexer can be reached at for queries\n @param geoHash The indexer's geo location, expressed as a geo hash" + }, + "id": 15394, + "members": [ + { + "constant": false, + "id": 15389, + "mutability": "mutable", + "name": "registeredAt", + "nameLocation": "1458:12:60", + "nodeType": "VariableDeclaration", + "scope": 15394, + "src": "1450:20:60", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 15388, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1450:7:60", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15391, + "mutability": "mutable", + "name": "url", + "nameLocation": "1487:3:60", + "nodeType": "VariableDeclaration", + "scope": 15394, + "src": "1480:10:60", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + }, + "typeName": { + "id": 15390, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "1480:6:60", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15393, + "mutability": "mutable", + "name": "geoHash", + "nameLocation": "1507:7:60", + "nodeType": "VariableDeclaration", + "scope": 15394, + "src": "1500:14:60", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + }, + "typeName": { + "id": 15392, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "1500:6:60", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "visibility": "internal" + } + ], + "name": "Indexer", + "nameLocation": "1432:7:60", + "nodeType": "StructDefinition", + "scope": 15634, + "src": "1425:96:60", + "visibility": "public" + }, + { + "anonymous": false, + "documentation": { + "id": 15395, + "nodeType": "StructuredDocumentation", + "src": "1527:471:60", + "text": " @notice Emitted when a subgraph service collects query fees from Graph Payments\n @param serviceProvider The address of the service provider\n @param payer The address paying for the query fees\n @param allocationId The id of the allocation\n @param subgraphDeploymentId The id of the subgraph deployment\n @param tokensCollected The amount of tokens collected\n @param tokensCurators The amount of tokens curators receive" + }, + "eventSelector": "184c452047299395d4f7f147eb8e823458a450798539be54aeed978f13d87ba2", + "id": 15409, + "name": "QueryFeesCollected", + "nameLocation": "2009:18:60", + "nodeType": "EventDefinition", + "parameters": { + "id": 15408, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15397, + "indexed": true, + "mutability": "mutable", + "name": "serviceProvider", + "nameLocation": "2053:15:60", + "nodeType": "VariableDeclaration", + "scope": 15409, + "src": "2037:31:60", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 15396, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2037:7:60", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15399, + "indexed": true, + "mutability": "mutable", + "name": "payer", + "nameLocation": "2094:5:60", + "nodeType": "VariableDeclaration", + "scope": 15409, + "src": "2078:21:60", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 15398, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2078:7:60", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15401, + "indexed": true, + "mutability": "mutable", + "name": "allocationId", + "nameLocation": "2125:12:60", + "nodeType": "VariableDeclaration", + "scope": 15409, + "src": "2109:28:60", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 15400, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2109:7:60", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15403, + "indexed": false, + "mutability": "mutable", + "name": "subgraphDeploymentId", + "nameLocation": "2155:20:60", + "nodeType": "VariableDeclaration", + "scope": 15409, + "src": "2147:28:60", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 15402, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "2147:7:60", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15405, + "indexed": false, + "mutability": "mutable", + "name": "tokensCollected", + "nameLocation": "2193:15:60", + "nodeType": "VariableDeclaration", + "scope": 15409, + "src": "2185:23:60", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 15404, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2185:7:60", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15407, + "indexed": false, + "mutability": "mutable", + "name": "tokensCurators", + "nameLocation": "2226:14:60", + "nodeType": "VariableDeclaration", + "scope": 15409, + "src": "2218:22:60", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 15406, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2218:7:60", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "2027:219:60" + }, + "src": "2003:244:60" + }, + { + "anonymous": false, + "documentation": { + "id": 15410, + "nodeType": "StructuredDocumentation", + "src": "2253:207:60", + "text": " @notice Emitted when an indexer sets a new payments destination\n @param indexer The address of the indexer\n @param paymentsDestination The address where payments should be sent" + }, + "eventSelector": "003215dc05a2fc4e6a1e2c2776311d207c730ee51085aae221acc5cbe6fb55c1", + "id": 15416, + "name": "PaymentsDestinationSet", + "nameLocation": "2471:22:60", + "nodeType": "EventDefinition", + "parameters": { + "id": 15415, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15412, + "indexed": true, + "mutability": "mutable", + "name": "indexer", + "nameLocation": "2510:7:60", + "nodeType": "VariableDeclaration", + "scope": 15416, + "src": "2494:23:60", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 15411, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2494:7:60", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15414, + "indexed": true, + "mutability": "mutable", + "name": "paymentsDestination", + "nameLocation": "2535:19:60", + "nodeType": "VariableDeclaration", + "scope": 15416, + "src": "2519:35:60", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 15413, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2519:7:60", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "2493:62:60" + }, + "src": "2465:91:60" + }, + { + "anonymous": false, + "documentation": { + "id": 15417, + "nodeType": "StructuredDocumentation", + "src": "2562:115:60", + "text": " @notice Emitted when the stake to fees ratio is set.\n @param ratio The stake to fees ratio" + }, + "eventSelector": "2aaaf20b08565eebc0c962cd7c568e54c3c0c2b85a1f942b82cd1bd730fdcd23", + "id": 15421, + "name": "StakeToFeesRatioSet", + "nameLocation": "2688:19:60", + "nodeType": "EventDefinition", + "parameters": { + "id": 15420, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15419, + "indexed": false, + "mutability": "mutable", + "name": "ratio", + "nameLocation": "2716:5:60", + "nodeType": "VariableDeclaration", + "scope": 15421, + "src": "2708:13:60", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 15418, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2708:7:60", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "2707:15:60" + }, + "src": "2682:41:60" + }, + { + "anonymous": false, + "documentation": { + "id": 15422, + "nodeType": "StructuredDocumentation", + "src": "2729:103:60", + "text": " @notice Emitted when curator cuts are set\n @param curationCut The curation cut" + }, + "eventSelector": "6deef78ffe3df79ae5cd8e40b842c36ac6077e13746b9b68a9f327537b01e4e9", + "id": 15426, + "name": "CurationCutSet", + "nameLocation": "2843:14:60", + "nodeType": "EventDefinition", + "parameters": { + "id": 15425, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15424, + "indexed": false, + "mutability": "mutable", + "name": "curationCut", + "nameLocation": "2866:11:60", + "nodeType": "VariableDeclaration", + "scope": 15426, + "src": "2858:19:60", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 15423, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2858:7:60", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "2857:21:60" + }, + "src": "2837:42:60" + }, + { + "documentation": { + "id": 15427, + "nodeType": "StructuredDocumentation", + "src": "2885:146:60", + "text": " @notice Thrown when trying to set a curation cut that is not a valid PPM value\n @param curationCut The curation cut value" + }, + "errorSelector": "1c9c717b", + "id": 15431, + "name": "SubgraphServiceInvalidCurationCut", + "nameLocation": "3042:33:60", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 15430, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15429, + "mutability": "mutable", + "name": "curationCut", + "nameLocation": "3084:11:60", + "nodeType": "VariableDeclaration", + "scope": 15431, + "src": "3076:19:60", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 15428, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "3076:7:60", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "3075:21:60" + }, + "src": "3036:61:60" + }, + { + "documentation": { + "id": 15432, + "nodeType": "StructuredDocumentation", + "src": "3103:85:60", + "text": " @notice Thrown when an indexer tries to register with an empty URL" + }, + "errorSelector": "f0708720", + "id": 15434, + "name": "SubgraphServiceEmptyUrl", + "nameLocation": "3199:23:60", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 15433, + "nodeType": "ParameterList", + "parameters": [], + "src": "3222:2:60" + }, + "src": "3193:32:60" + }, + { + "documentation": { + "id": 15435, + "nodeType": "StructuredDocumentation", + "src": "3231:89:60", + "text": " @notice Thrown when an indexer tries to register with an empty geohash" + }, + "errorSelector": "798ef654", + "id": 15437, + "name": "SubgraphServiceEmptyGeohash", + "nameLocation": "3331:27:60", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 15436, + "nodeType": "ParameterList", + "parameters": [], + "src": "3358:2:60" + }, + "src": "3325:36:60" + }, + { + "documentation": { + "id": 15438, + "nodeType": "StructuredDocumentation", + "src": "3367:99:60", + "text": " @notice Thrown when an indexer tries to register but they are already registered" + }, + "errorSelector": "341a19b4", + "id": 15440, + "name": "SubgraphServiceIndexerAlreadyRegistered", + "nameLocation": "3477:39:60", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 15439, + "nodeType": "ParameterList", + "parameters": [], + "src": "3516:2:60" + }, + "src": "3471:48:60" + }, + { + "documentation": { + "id": 15441, + "nodeType": "StructuredDocumentation", + "src": "3525:179:60", + "text": " @notice Thrown when an indexer tries to perform an operation but they are not registered\n @param indexer The address of the indexer that is not registered" + }, + "errorSelector": "ee271899", + "id": 15445, + "name": "SubgraphServiceIndexerNotRegistered", + "nameLocation": "3715:35:60", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 15444, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15443, + "mutability": "mutable", + "name": "indexer", + "nameLocation": "3759:7:60", + "nodeType": "VariableDeclaration", + "scope": 15445, + "src": "3751:15:60", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 15442, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3751:7:60", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "3750:17:60" + }, + "src": "3709:59:60" + }, + { + "documentation": { + "id": 15446, + "nodeType": "StructuredDocumentation", + "src": "3774:168:60", + "text": " @notice Thrown when an indexer tries to collect fees for an unsupported payment type\n @param paymentType The payment type that is not supported" + }, + "errorSelector": "47031cf0", + "id": 15451, + "name": "SubgraphServiceInvalidPaymentType", + "nameLocation": "3953:33:60", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 15450, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15449, + "mutability": "mutable", + "name": "paymentType", + "nameLocation": "4015:11:60", + "nodeType": "VariableDeclaration", + "scope": 15451, + "src": "3987:39:60", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_PaymentTypes_$2433", + "typeString": "enum IGraphPayments.PaymentTypes" + }, + "typeName": { + "id": 15448, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 15447, + "name": "IGraphPayments.PaymentTypes", + "nameLocations": [ + "3987:14:60", + "4002:12:60" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 2433, + "src": "3987:27:60" + }, + "referencedDeclaration": 2433, + "src": "3987:27:60", + "typeDescriptions": { + "typeIdentifier": "t_enum$_PaymentTypes_$2433", + "typeString": "enum IGraphPayments.PaymentTypes" + } + }, + "visibility": "internal" + } + ], + "src": "3986:41:60" + }, + "src": "3947:81:60" + }, + { + "documentation": { + "id": 15452, + "nodeType": "StructuredDocumentation", + "src": "4034:264:60", + "text": " @notice Thrown when the contract GRT balance is inconsistent after collecting from Graph Payments\n @param balanceBefore The contract GRT balance before the collection\n @param balanceAfter The contract GRT balance after the collection" + }, + "errorSelector": "9db8bc95", + "id": 15458, + "name": "SubgraphServiceInconsistentCollection", + "nameLocation": "4309:37:60", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 15457, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15454, + "mutability": "mutable", + "name": "balanceBefore", + "nameLocation": "4355:13:60", + "nodeType": "VariableDeclaration", + "scope": 15458, + "src": "4347:21:60", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 15453, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "4347:7:60", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15456, + "mutability": "mutable", + "name": "balanceAfter", + "nameLocation": "4378:12:60", + "nodeType": "VariableDeclaration", + "scope": 15458, + "src": "4370:20:60", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 15455, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "4370:7:60", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "4346:45:60" + }, + "src": "4303:89:60" + }, + { + "documentation": { + "id": 15459, + "nodeType": "StructuredDocumentation", + "src": "4398:249:60", + "text": " @notice @notice Thrown when the service provider in the RAV does not match the expected indexer.\n @param providedIndexer The address of the provided indexer.\n @param expectedIndexer The address of the expected indexer." + }, + "errorSelector": "1a071d07", + "id": 15465, + "name": "SubgraphServiceIndexerMismatch", + "nameLocation": "4658:30:60", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 15464, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15461, + "mutability": "mutable", + "name": "providedIndexer", + "nameLocation": "4697:15:60", + "nodeType": "VariableDeclaration", + "scope": 15465, + "src": "4689:23:60", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 15460, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4689:7:60", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15463, + "mutability": "mutable", + "name": "expectedIndexer", + "nameLocation": "4722:15:60", + "nodeType": "VariableDeclaration", + "scope": 15465, + "src": "4714:23:60", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 15462, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4714:7:60", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "4688:50:60" + }, + "src": "4652:87:60" + }, + { + "documentation": { + "id": 15466, + "nodeType": "StructuredDocumentation", + "src": "4745:223:60", + "text": " @notice Thrown when the indexer in the allocation state does not match the expected indexer.\n @param indexer The address of the expected indexer.\n @param allocationId The id of the allocation." + }, + "errorSelector": "c0bbff13", + "id": 15472, + "name": "SubgraphServiceAllocationNotAuthorized", + "nameLocation": "4979:38:60", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 15471, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15468, + "mutability": "mutable", + "name": "indexer", + "nameLocation": "5026:7:60", + "nodeType": "VariableDeclaration", + "scope": 15472, + "src": "5018:15:60", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 15467, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5018:7:60", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15470, + "mutability": "mutable", + "name": "allocationId", + "nameLocation": "5043:12:60", + "nodeType": "VariableDeclaration", + "scope": 15472, + "src": "5035:20:60", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 15469, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5035:7:60", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "5017:39:60" + }, + "src": "4973:84:60" + }, + { + "documentation": { + "id": 15473, + "nodeType": "StructuredDocumentation", + "src": "5063:245:60", + "text": " @notice Thrown when collecting a RAV where the RAV indexer is not the same as the allocation indexer\n @param ravIndexer The address of the RAV indexer\n @param allocationIndexer The address of the allocation indexer" + }, + "errorSelector": "8a11f7ee", + "id": 15479, + "name": "SubgraphServiceInvalidRAV", + "nameLocation": "5319:25:60", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 15478, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15475, + "mutability": "mutable", + "name": "ravIndexer", + "nameLocation": "5353:10:60", + "nodeType": "VariableDeclaration", + "scope": 15479, + "src": "5345:18:60", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 15474, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5345:7:60", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15477, + "mutability": "mutable", + "name": "allocationIndexer", + "nameLocation": "5373:17:60", + "nodeType": "VariableDeclaration", + "scope": 15479, + "src": "5365:25:60", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 15476, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5365:7:60", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "5344:47:60" + }, + "src": "5313:79:60" + }, + { + "documentation": { + "id": 15480, + "nodeType": "StructuredDocumentation", + "src": "5398:182:60", + "text": " @notice Thrown when trying to force close an allocation that is not stale and the indexer is not over-allocated\n @param allocationId The id of the allocation" + }, + "errorSelector": "068ef6a0", + "id": 15484, + "name": "SubgraphServiceCannotForceCloseAllocation", + "nameLocation": "5591:41:60", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 15483, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15482, + "mutability": "mutable", + "name": "allocationId", + "nameLocation": "5641:12:60", + "nodeType": "VariableDeclaration", + "scope": 15484, + "src": "5633:20:60", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 15481, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5633:7:60", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "5632:22:60" + }, + "src": "5585:70:60" + }, + { + "documentation": { + "id": 15485, + "nodeType": "StructuredDocumentation", + "src": "5661:137:60", + "text": " @notice Thrown when trying to force close an altruistic allocation\n @param allocationId The id of the allocation" + }, + "errorSelector": "be3d9ae8", + "id": 15489, + "name": "SubgraphServiceAllocationIsAltruistic", + "nameLocation": "5809:37:60", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 15488, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15487, + "mutability": "mutable", + "name": "allocationId", + "nameLocation": "5855:12:60", + "nodeType": "VariableDeclaration", + "scope": 15489, + "src": "5847:20:60", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 15486, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5847:7:60", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "5846:22:60" + }, + "src": "5803:66:60" + }, + { + "documentation": { + "id": 15490, + "nodeType": "StructuredDocumentation", + "src": "5875:80:60", + "text": " @notice Thrown when trying to set stake to fees ratio to zero" + }, + "errorSelector": "bc71a043", + "id": 15492, + "name": "SubgraphServiceInvalidZeroStakeToFeesRatio", + "nameLocation": "5966:42:60", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 15491, + "nodeType": "ParameterList", + "parameters": [], + "src": "6008:2:60" + }, + "src": "5960:51:60" + }, + { + "documentation": { + "id": 15493, + "nodeType": "StructuredDocumentation", + "src": "6017:118:60", + "text": " @notice Thrown when collectionId is not a valid address\n @param collectionId The collectionId" + }, + "errorSelector": "fa4ac7a7", + "id": 15497, + "name": "SubgraphServiceInvalidCollectionId", + "nameLocation": "6146:34:60", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 15496, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15495, + "mutability": "mutable", + "name": "collectionId", + "nameLocation": "6189:12:60", + "nodeType": "VariableDeclaration", + "scope": 15497, + "src": "6181:20:60", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 15494, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "6181:7:60", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "6180:22:60" + }, + "src": "6140:63:60" + }, + { + "documentation": { + "id": 15498, + "nodeType": "StructuredDocumentation", + "src": "6209:589:60", + "text": " @notice Initialize the contract\n @dev The thawingPeriod and verifierCut ranges are not set here because they are variables\n on the DisputeManager. We use the {ProvisionManager} overrideable getters to get the ranges.\n @param owner The owner of the contract\n @param minimumProvisionTokens The minimum amount of provisioned tokens required to create an allocation\n @param maximumDelegationRatio The maximum delegation ratio allowed for an allocation\n @param stakeToFeesRatio The ratio of stake to fees to lock when collecting query fees" + }, + "functionSelector": "c84a5ef3", + "id": 15509, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "initialize", + "nameLocation": "6812:10:60", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 15507, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15500, + "mutability": "mutable", + "name": "owner", + "nameLocation": "6840:5:60", + "nodeType": "VariableDeclaration", + "scope": 15509, + "src": "6832:13:60", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 15499, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6832:7:60", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15502, + "mutability": "mutable", + "name": "minimumProvisionTokens", + "nameLocation": "6863:22:60", + "nodeType": "VariableDeclaration", + "scope": 15509, + "src": "6855:30:60", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 15501, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "6855:7:60", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15504, + "mutability": "mutable", + "name": "maximumDelegationRatio", + "nameLocation": "6902:22:60", + "nodeType": "VariableDeclaration", + "scope": 15509, + "src": "6895:29:60", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 15503, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "6895:6:60", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15506, + "mutability": "mutable", + "name": "stakeToFeesRatio", + "nameLocation": "6942:16:60", + "nodeType": "VariableDeclaration", + "scope": 15509, + "src": "6934:24:60", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 15505, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "6934:7:60", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "6822:142:60" + }, + "returnParameters": { + "id": 15508, + "nodeType": "ParameterList", + "parameters": [], + "src": "6973:0:60" + }, + "scope": 15634, + "src": "6803:171:60", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 15510, + "nodeType": "StructuredDocumentation", + "src": "6980:495:60", + "text": " @notice Force close a stale allocation\n @dev This function can be permissionlessly called when the allocation is stale. This\n ensures that rewards for other allocations are not diluted by an inactive allocation.\n Requirements:\n - Allocation must exist and be open\n - Allocation must be stale\n - Allocation cannot be altruistic\n Emits a {AllocationClosed} event.\n @param allocationId The id of the allocation" + }, + "functionSelector": "ec9c218d", + "id": 15515, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "closeStaleAllocation", + "nameLocation": "7489:20:60", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 15513, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15512, + "mutability": "mutable", + "name": "allocationId", + "nameLocation": "7518:12:60", + "nodeType": "VariableDeclaration", + "scope": 15515, + "src": "7510:20:60", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 15511, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "7510:7:60", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "7509:22:60" + }, + "returnParameters": { + "id": 15514, + "nodeType": "ParameterList", + "parameters": [], + "src": "7540:0:60" + }, + "scope": 15634, + "src": "7480:61:60", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 15516, + "nodeType": "StructuredDocumentation", + "src": "7547:681:60", + "text": " @notice Change the amount of tokens in an allocation\n @dev Requirements:\n - The indexer must be registered\n - The provision must be valid according to the subgraph service rules\n - `tokens` must be different from the current allocation size\n - The indexer must have enough available tokens to allocate if they are upsizing the allocation\n Emits a {AllocationResized} event.\n See {AllocationManager-_resizeAllocation} for more details.\n @param indexer The address of the indexer\n @param allocationId The id of the allocation\n @param tokens The new amount of tokens in the allocation" + }, + "functionSelector": "81e777a7", + "id": 15525, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "resizeAllocation", + "nameLocation": "8242:16:60", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 15523, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15518, + "mutability": "mutable", + "name": "indexer", + "nameLocation": "8267:7:60", + "nodeType": "VariableDeclaration", + "scope": 15525, + "src": "8259:15:60", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 15517, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "8259:7:60", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15520, + "mutability": "mutable", + "name": "allocationId", + "nameLocation": "8284:12:60", + "nodeType": "VariableDeclaration", + "scope": 15525, + "src": "8276:20:60", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 15519, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "8276:7:60", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15522, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "8306:6:60", + "nodeType": "VariableDeclaration", + "scope": 15525, + "src": "8298:14:60", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 15521, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "8298:7:60", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "8258:55:60" + }, + "returnParameters": { + "id": 15524, + "nodeType": "ParameterList", + "parameters": [], + "src": "8322:0:60" + }, + "scope": 15634, + "src": "8233:90:60", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 15526, + "nodeType": "StructuredDocumentation", + "src": "8329:398:60", + "text": " @notice Imports a legacy allocation id into the subgraph service\n This is a governor only action that is required to prevent indexers from re-using allocation ids from the\n legacy staking contract.\n @param indexer The address of the indexer\n @param allocationId The id of the allocation\n @param subgraphDeploymentId The id of the subgraph deployment" + }, + "functionSelector": "7dfe6d28", + "id": 15535, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "migrateLegacyAllocation", + "nameLocation": "8741:23:60", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 15533, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15528, + "mutability": "mutable", + "name": "indexer", + "nameLocation": "8773:7:60", + "nodeType": "VariableDeclaration", + "scope": 15535, + "src": "8765:15:60", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 15527, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "8765:7:60", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15530, + "mutability": "mutable", + "name": "allocationId", + "nameLocation": "8790:12:60", + "nodeType": "VariableDeclaration", + "scope": 15535, + "src": "8782:20:60", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 15529, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "8782:7:60", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15532, + "mutability": "mutable", + "name": "subgraphDeploymentId", + "nameLocation": "8812:20:60", + "nodeType": "VariableDeclaration", + "scope": 15535, + "src": "8804:28:60", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 15531, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "8804:7:60", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "8764:69:60" + }, + "returnParameters": { + "id": 15534, + "nodeType": "ParameterList", + "parameters": [], + "src": "8842:0:60" + }, + "scope": 15634, + "src": "8732:111:60", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 15536, + "nodeType": "StructuredDocumentation", + "src": "8849:209:60", + "text": " @notice Sets a pause guardian\n @param pauseGuardian The address of the pause guardian\n @param allowed True if the pause guardian is allowed to pause the contract, false otherwise" + }, + "functionSelector": "35577962", + "id": 15543, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "setPauseGuardian", + "nameLocation": "9072:16:60", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 15541, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15538, + "mutability": "mutable", + "name": "pauseGuardian", + "nameLocation": "9097:13:60", + "nodeType": "VariableDeclaration", + "scope": 15543, + "src": "9089:21:60", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 15537, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "9089:7:60", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15540, + "mutability": "mutable", + "name": "allowed", + "nameLocation": "9117:7:60", + "nodeType": "VariableDeclaration", + "scope": 15543, + "src": "9112:12:60", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 15539, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "9112:4:60", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "src": "9088:37:60" + }, + "returnParameters": { + "id": 15542, + "nodeType": "ParameterList", + "parameters": [], + "src": "9134:0:60" + }, + "scope": 15634, + "src": "9063:72:60", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 15544, + "nodeType": "StructuredDocumentation", + "src": "9141:216:60", + "text": " @notice Sets the minimum amount of provisioned tokens required to create an allocation\n @param minimumProvisionTokens The minimum amount of provisioned tokens required to create an allocation" + }, + "functionSelector": "832bc923", + "id": 15549, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "setMinimumProvisionTokens", + "nameLocation": "9371:25:60", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 15547, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15546, + "mutability": "mutable", + "name": "minimumProvisionTokens", + "nameLocation": "9405:22:60", + "nodeType": "VariableDeclaration", + "scope": 15549, + "src": "9397:30:60", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 15545, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "9397:7:60", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "9396:32:60" + }, + "returnParameters": { + "id": 15548, + "nodeType": "ParameterList", + "parameters": [], + "src": "9437:0:60" + }, + "scope": 15634, + "src": "9362:76:60", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 15550, + "nodeType": "StructuredDocumentation", + "src": "9444:103:60", + "text": " @notice Sets the delegation ratio\n @param delegationRatio The delegation ratio" + }, + "functionSelector": "1dd42f60", + "id": 15555, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "setDelegationRatio", + "nameLocation": "9561:18:60", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 15553, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15552, + "mutability": "mutable", + "name": "delegationRatio", + "nameLocation": "9587:15:60", + "nodeType": "VariableDeclaration", + "scope": 15555, + "src": "9580:22:60", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 15551, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "9580:6:60", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + } + ], + "src": "9579:24:60" + }, + "returnParameters": { + "id": 15554, + "nodeType": "ParameterList", + "parameters": [], + "src": "9612:0:60" + }, + "scope": 15634, + "src": "9552:61:60", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 15556, + "nodeType": "StructuredDocumentation", + "src": "9619:110:60", + "text": " @notice Sets the stake to fees ratio\n @param stakeToFeesRatio The stake to fees ratio" + }, + "functionSelector": "e6f50054", + "id": 15561, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "setStakeToFeesRatio", + "nameLocation": "9743:19:60", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 15559, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15558, + "mutability": "mutable", + "name": "stakeToFeesRatio", + "nameLocation": "9771:16:60", + "nodeType": "VariableDeclaration", + "scope": 15561, + "src": "9763:24:60", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 15557, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "9763:7:60", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "9762:26:60" + }, + "returnParameters": { + "id": 15560, + "nodeType": "ParameterList", + "parameters": [], + "src": "9797:0:60" + }, + "scope": 15634, + "src": "9734:64:60", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 15562, + "nodeType": "StructuredDocumentation", + "src": "9804:190:60", + "text": " @notice Sets the max POI staleness\n See {AllocationManagerV1Storage-maxPOIStaleness} for more details.\n @param maxPOIStaleness The max POI staleness in seconds" + }, + "functionSelector": "7aa31bce", + "id": 15567, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "setMaxPOIStaleness", + "nameLocation": "10008:18:60", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 15565, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15564, + "mutability": "mutable", + "name": "maxPOIStaleness", + "nameLocation": "10035:15:60", + "nodeType": "VariableDeclaration", + "scope": 15567, + "src": "10027:23:60", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 15563, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "10027:7:60", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "10026:25:60" + }, + "returnParameters": { + "id": 15566, + "nodeType": "ParameterList", + "parameters": [], + "src": "10060:0:60" + }, + "scope": 15634, + "src": "9999:62:60", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 15568, + "nodeType": "StructuredDocumentation", + "src": "10067:177:60", + "text": " @notice Sets the curators payment cut for query fees\n @dev Emits a {CuratorCutSet} event\n @param curationCut The curation cut for the payment type" + }, + "functionSelector": "7e89bac3", + "id": 15573, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "setCurationCut", + "nameLocation": "10258:14:60", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 15571, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15570, + "mutability": "mutable", + "name": "curationCut", + "nameLocation": "10281:11:60", + "nodeType": "VariableDeclaration", + "scope": 15573, + "src": "10273:19:60", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 15569, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "10273:7:60", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "10272:21:60" + }, + "returnParameters": { + "id": 15572, + "nodeType": "ParameterList", + "parameters": [], + "src": "10302:0:60" + }, + "scope": 15634, + "src": "10249:54:60", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 15574, + "nodeType": "StructuredDocumentation", + "src": "10309:218:60", + "text": " @notice Sets the payments destination for an indexer to receive payments\n @dev Emits a {PaymentsDestinationSet} event\n @param paymentsDestination The address where payments should be sent" + }, + "functionSelector": "6ccec5b8", + "id": 15579, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "setPaymentsDestination", + "nameLocation": "10541:22:60", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 15577, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15576, + "mutability": "mutable", + "name": "paymentsDestination", + "nameLocation": "10572:19:60", + "nodeType": "VariableDeclaration", + "scope": 15579, + "src": "10564:27:60", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 15575, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "10564:7:60", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "10563:29:60" + }, + "returnParameters": { + "id": 15578, + "nodeType": "ParameterList", + "parameters": [], + "src": "10601:0:60" + }, + "scope": 15634, + "src": "10532:70:60", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 15580, + "nodeType": "StructuredDocumentation", + "src": "10608:206:60", + "text": " @notice Gets the details of an allocation\n For legacy allocations use {getLegacyAllocation}\n @param allocationId The id of the allocation\n @return The allocation details" + }, + "functionSelector": "0e022923", + "id": 15588, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "getAllocation", + "nameLocation": "10828:13:60", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 15583, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15582, + "mutability": "mutable", + "name": "allocationId", + "nameLocation": "10850:12:60", + "nodeType": "VariableDeclaration", + "scope": 15588, + "src": "10842:20:60", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 15581, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "10842:7:60", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "10841:22:60" + }, + "returnParameters": { + "id": 15587, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15586, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 15588, + "src": "10887:23:60", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State" + }, + "typeName": { + "id": 15585, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 15584, + "name": "Allocation.State", + "nameLocations": [ + "10887:10:60", + "10898:5:60" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 15663, + "src": "10887:16:60" + }, + "referencedDeclaration": 15663, + "src": "10887:16:60", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_storage_ptr", + "typeString": "struct Allocation.State" + } + }, + "visibility": "internal" + } + ], + "src": "10886:25:60" + }, + "scope": 15634, + "src": "10819:93:60", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 15589, + "nodeType": "StructuredDocumentation", + "src": "10918:217:60", + "text": " @notice Gets the details of a legacy allocation\n For non-legacy allocations use {getAllocation}\n @param allocationId The id of the allocation\n @return The legacy allocation details" + }, + "functionSelector": "6d9a3951", + "id": 15597, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "getLegacyAllocation", + "nameLocation": "11149:19:60", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 15592, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15591, + "mutability": "mutable", + "name": "allocationId", + "nameLocation": "11177:12:60", + "nodeType": "VariableDeclaration", + "scope": 15597, + "src": "11169:20:60", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 15590, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "11169:7:60", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "11168:22:60" + }, + "returnParameters": { + "id": 15596, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15595, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 15597, + "src": "11214:29:60", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16305_memory_ptr", + "typeString": "struct LegacyAllocation.State" + }, + "typeName": { + "id": 15594, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 15593, + "name": "LegacyAllocation.State", + "nameLocations": [ + "11214:16:60", + "11231:5:60" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 16305, + "src": "11214:22:60" + }, + "referencedDeclaration": 16305, + "src": "11214:22:60", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16305_storage_ptr", + "typeString": "struct LegacyAllocation.State" + } + }, + "visibility": "internal" + } + ], + "src": "11213:31:60" + }, + "scope": 15634, + "src": "11140:105:60", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 15598, + "nodeType": "StructuredDocumentation", + "src": "11251:219:60", + "text": " @notice Encodes the allocation proof for EIP712 signing\n @param indexer The address of the indexer\n @param allocationId The id of the allocation\n @return The encoded allocation proof" + }, + "functionSelector": "ce56c98b", + "id": 15607, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "encodeAllocationProof", + "nameLocation": "11484:21:60", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 15603, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15600, + "mutability": "mutable", + "name": "indexer", + "nameLocation": "11514:7:60", + "nodeType": "VariableDeclaration", + "scope": 15607, + "src": "11506:15:60", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 15599, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "11506:7:60", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15602, + "mutability": "mutable", + "name": "allocationId", + "nameLocation": "11531:12:60", + "nodeType": "VariableDeclaration", + "scope": 15607, + "src": "11523:20:60", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 15601, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "11523:7:60", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "11505:39:60" + }, + "returnParameters": { + "id": 15606, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15605, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 15607, + "src": "11568:7:60", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 15604, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "11568:7:60", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "11567:9:60" + }, + "scope": 15634, + "src": "11475:102:60", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 15608, + "nodeType": "StructuredDocumentation", + "src": "11583:187:60", + "text": " @notice Checks if an indexer is over-allocated\n @param allocationId The id of the allocation\n @return True if the indexer is over-allocated, false otherwise" + }, + "functionSelector": "ba38f67d", + "id": 15615, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "isOverAllocated", + "nameLocation": "11784:15:60", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 15611, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15610, + "mutability": "mutable", + "name": "allocationId", + "nameLocation": "11808:12:60", + "nodeType": "VariableDeclaration", + "scope": 15615, + "src": "11800:20:60", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 15609, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "11800:7:60", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "11799:22:60" + }, + "returnParameters": { + "id": 15614, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15613, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 15615, + "src": "11845:4:60", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 15612, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "11845:4:60", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "src": "11844:6:60" + }, + "scope": 15634, + "src": "11775:76:60", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 15616, + "nodeType": "StructuredDocumentation", + "src": "11857:116:60", + "text": " @notice Gets the address of the dispute manager\n @return The address of the dispute manager" + }, + "functionSelector": "db9bee46", + "id": 15621, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "getDisputeManager", + "nameLocation": "11987:17:60", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 15617, + "nodeType": "ParameterList", + "parameters": [], + "src": "12004:2:60" + }, + "returnParameters": { + "id": 15620, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15619, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 15621, + "src": "12030:7:60", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 15618, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "12030:7:60", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "12029:9:60" + }, + "scope": 15634, + "src": "11978:61:60", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 15622, + "nodeType": "StructuredDocumentation", + "src": "12045:128:60", + "text": " @notice Gets the address of the graph tally collector\n @return The address of the graph tally collector" + }, + "functionSelector": "ebf6ddaf", + "id": 15627, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "getGraphTallyCollector", + "nameLocation": "12187:22:60", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 15623, + "nodeType": "ParameterList", + "parameters": [], + "src": "12209:2:60" + }, + "returnParameters": { + "id": 15626, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15625, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 15627, + "src": "12235:7:60", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 15624, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "12235:7:60", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "12234:9:60" + }, + "scope": 15634, + "src": "12178:66:60", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "documentation": { + "id": 15628, + "nodeType": "StructuredDocumentation", + "src": "12250:120:60", + "text": " @notice Gets the address of the curation contract\n @return The address of the curation contract" + }, + "functionSelector": "c0f47497", + "id": 15633, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "getCuration", + "nameLocation": "12384:11:60", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 15629, + "nodeType": "ParameterList", + "parameters": [], + "src": "12395:2:60" + }, + "returnParameters": { + "id": 15632, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15631, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 15633, + "src": "12421:7:60", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 15630, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "12421:7:60", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "12420:9:60" + }, + "scope": 15634, + "src": "12375:55:60", + "stateMutability": "view", + "virtual": false, + "visibility": "external" + } + ], + "scope": 15635, + "src": "1108:11324:60", + "usedErrors": [ + 1610, + 1613, + 15431, + 15434, + 15437, + 15440, + 15445, + 15451, + 15458, + 15465, + 15472, + 15479, + 15484, + 15489, + 15492, + 15497 + ], + "usedEvents": [ + 1437, + 1442, + 1449, + 1456, + 1466, + 1473, + 1585, + 1596, + 1605, + 15409, + 15416, + 15421, + 15426 + ] + } + ], + "src": "45:12388:60" + }, + "id": 60 + }, + "contracts/libraries/Allocation.sol": { + "ast": { + "absolutePath": "contracts/libraries/Allocation.sol", + "exportedSymbols": { + "Allocation": [ + 16033 + ], + "Math": [ + 9938 + ] + }, + "id": 16034, + "license": "GPL-3.0-or-later", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 15636, + "literals": [ + "solidity", + "0.8", + ".27" + ], + "nodeType": "PragmaDirective", + "src": "45:23:61" + }, + { + "absolutePath": "@openzeppelin/contracts/utils/math/Math.sol", + "file": "@openzeppelin/contracts/utils/math/Math.sol", + "id": 15638, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 16034, + "sourceUnit": 9939, + "src": "70:67:61", + "symbolAliases": [ + { + "foreign": { + "id": 15637, + "name": "Math", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9938, + "src": "79:4:61", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "abstract": false, + "baseContracts": [], + "canonicalName": "Allocation", + "contractDependencies": [], + "contractKind": "library", + "documentation": { + "id": 15639, + "nodeType": "StructuredDocumentation", + "src": "139:220:61", + "text": " @title Allocation library\n @notice A library to handle Allocations.\n @custom:security-contact Please email security+contracts@thegraph.com if you find any\n bugs. We may have an active bug bounty program." + }, + "fullyImplemented": true, + "id": 16033, + "linearizedBaseContracts": [ + 16033 + ], + "name": "Allocation", + "nameLocation": "368:10:61", + "nodeType": "ContractDefinition", + "nodes": [ + { + "global": false, + "id": 15643, + "libraryName": { + "id": 15640, + "name": "Allocation", + "nameLocations": [ + "391:10:61" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 16033, + "src": "391:10:61" + }, + "nodeType": "UsingForDirective", + "src": "385:27:61", + "typeName": { + "id": 15642, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 15641, + "name": "State", + "nameLocations": [ + "406:5:61" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 15663, + "src": "406:5:61" + }, + "referencedDeclaration": 15663, + "src": "406:5:61", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_storage_ptr", + "typeString": "struct Allocation.State" + } + } + }, + { + "canonicalName": "Allocation.State", + "documentation": { + "id": 15644, + "nodeType": "StructuredDocumentation", + "src": "418:723:61", + "text": " @notice Allocation details\n @param indexer The indexer that owns the allocation\n @param subgraphDeploymentId The subgraph deployment id the allocation is for\n @param tokens The number of tokens allocated\n @param createdAt The timestamp when the allocation was created\n @param closedAt The timestamp when the allocation was closed\n @param lastPOIPresentedAt The timestamp when the last POI was presented\n @param accRewardsPerAllocatedToken The accumulated rewards per allocated token\n @param accRewardsPending The accumulated rewards that are pending to be claimed due allocation resize\n @param createdAtEpoch The epoch when the allocation was created" + }, + "id": 15663, + "members": [ + { + "constant": false, + "id": 15646, + "mutability": "mutable", + "name": "indexer", + "nameLocation": "1177:7:61", + "nodeType": "VariableDeclaration", + "scope": 15663, + "src": "1169:15:61", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 15645, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1169:7:61", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15648, + "mutability": "mutable", + "name": "subgraphDeploymentId", + "nameLocation": "1202:20:61", + "nodeType": "VariableDeclaration", + "scope": 15663, + "src": "1194:28:61", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 15647, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1194:7:61", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15650, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "1240:6:61", + "nodeType": "VariableDeclaration", + "scope": 15663, + "src": "1232:14:61", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 15649, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1232:7:61", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15652, + "mutability": "mutable", + "name": "createdAt", + "nameLocation": "1264:9:61", + "nodeType": "VariableDeclaration", + "scope": 15663, + "src": "1256:17:61", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 15651, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1256:7:61", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15654, + "mutability": "mutable", + "name": "closedAt", + "nameLocation": "1291:8:61", + "nodeType": "VariableDeclaration", + "scope": 15663, + "src": "1283:16:61", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 15653, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1283:7:61", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15656, + "mutability": "mutable", + "name": "lastPOIPresentedAt", + "nameLocation": "1317:18:61", + "nodeType": "VariableDeclaration", + "scope": 15663, + "src": "1309:26:61", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 15655, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1309:7:61", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15658, + "mutability": "mutable", + "name": "accRewardsPerAllocatedToken", + "nameLocation": "1353:27:61", + "nodeType": "VariableDeclaration", + "scope": 15663, + "src": "1345:35:61", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 15657, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1345:7:61", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15660, + "mutability": "mutable", + "name": "accRewardsPending", + "nameLocation": "1398:17:61", + "nodeType": "VariableDeclaration", + "scope": 15663, + "src": "1390:25:61", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 15659, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1390:7:61", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15662, + "mutability": "mutable", + "name": "createdAtEpoch", + "nameLocation": "1433:14:61", + "nodeType": "VariableDeclaration", + "scope": 15663, + "src": "1425:22:61", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 15661, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1425:7:61", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "name": "State", + "nameLocation": "1153:5:61", + "nodeType": "StructDefinition", + "scope": 16033, + "src": "1146:308:61", + "visibility": "public" + }, + { + "documentation": { + "id": 15664, + "nodeType": "StructuredDocumentation", + "src": "1460:138:61", + "text": " @notice Thrown when attempting to create an allocation with an existing id\n @param allocationId The allocation id" + }, + "errorSelector": "0bc4def5", + "id": 15668, + "name": "AllocationAlreadyExists", + "nameLocation": "1609:23:61", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 15667, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15666, + "mutability": "mutable", + "name": "allocationId", + "nameLocation": "1641:12:61", + "nodeType": "VariableDeclaration", + "scope": 15668, + "src": "1633:20:61", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 15665, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1633:7:61", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "1632:22:61" + }, + "src": "1603:52:61" + }, + { + "documentation": { + "id": 15669, + "nodeType": "StructuredDocumentation", + "src": "1661:143:61", + "text": " @notice Thrown when trying to perform an operation on a non-existent allocation\n @param allocationId The allocation id" + }, + "errorSelector": "42daadaf", + "id": 15673, + "name": "AllocationDoesNotExist", + "nameLocation": "1815:22:61", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 15672, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15671, + "mutability": "mutable", + "name": "allocationId", + "nameLocation": "1846:12:61", + "nodeType": "VariableDeclaration", + "scope": 15673, + "src": "1838:20:61", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 15670, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1838:7:61", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "1837:22:61" + }, + "src": "1809:51:61" + }, + { + "documentation": { + "id": 15674, + "nodeType": "StructuredDocumentation", + "src": "1866:205:61", + "text": " @notice Thrown when trying to perform an operation on a closed allocation\n @param allocationId The allocation id\n @param closedAt The timestamp when the allocation was closed" + }, + "errorSelector": "61b66e0d", + "id": 15680, + "name": "AllocationClosed", + "nameLocation": "2082:16:61", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 15679, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15676, + "mutability": "mutable", + "name": "allocationId", + "nameLocation": "2107:12:61", + "nodeType": "VariableDeclaration", + "scope": 15680, + "src": "2099:20:61", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 15675, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2099:7:61", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15678, + "mutability": "mutable", + "name": "closedAt", + "nameLocation": "2129:8:61", + "nodeType": "VariableDeclaration", + "scope": 15680, + "src": "2121:16:61", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 15677, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2121:7:61", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "2098:40:61" + }, + "src": "2076:63:61" + }, + { + "body": { + "id": 15740, + "nodeType": "Block", + "src": "3043:579:61", + "statements": [ + { + "expression": { + "arguments": [ + { + "id": 15710, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "3061:28:61", + "subExpression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "expression": { + "baseExpression": { + "id": 15705, + "name": "self", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15686, + "src": "3062:4:61", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_State_$15663_storage_$", + "typeString": "mapping(address => struct Allocation.State storage ref)" + } + }, + "id": 15707, + "indexExpression": { + "id": 15706, + "name": "allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15690, + "src": "3067:12:61", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3062:18:61", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_storage", + "typeString": "struct Allocation.State storage ref" + } + }, + "id": 15708, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "3081:6:61", + "memberName": "exists", + "nodeType": "MemberAccess", + "referencedDeclaration": 15961, + "src": "3062:25:61", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_struct$_State_$15663_memory_ptr_$returns$_t_bool_$attached_to$_t_struct$_State_$15663_memory_ptr_$", + "typeString": "function (struct Allocation.State memory) pure returns (bool)" + } + }, + "id": 15709, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3062:27:61", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [ + { + "id": 15712, + "name": "allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15690, + "src": "3115:12:61", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 15711, + "name": "AllocationAlreadyExists", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15668, + "src": "3091:23:61", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_address_$returns$_t_error_$", + "typeString": "function (address) pure returns (error)" + } + }, + "id": 15713, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3091:37:61", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 15704, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "3053:7:61", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 15714, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3053:76:61", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 15715, + "nodeType": "ExpressionStatement", + "src": "3053:76:61" + }, + { + "assignments": [ + 15718 + ], + "declarations": [ + { + "constant": false, + "id": 15718, + "mutability": "mutable", + "name": "allocation", + "nameLocation": "3153:10:61", + "nodeType": "VariableDeclaration", + "scope": 15740, + "src": "3140:23:61", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State" + }, + "typeName": { + "id": 15717, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 15716, + "name": "State", + "nameLocations": [ + "3140:5:61" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 15663, + "src": "3140:5:61" + }, + "referencedDeclaration": 15663, + "src": "3140:5:61", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_storage_ptr", + "typeString": "struct Allocation.State" + } + }, + "visibility": "internal" + } + ], + "id": 15731, + "initialValue": { + "arguments": [ + { + "id": 15720, + "name": "indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15688, + "src": "3195:7:61", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 15721, + "name": "subgraphDeploymentId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15692, + "src": "3238:20:61", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "id": 15722, + "name": "tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15694, + "src": "3280:6:61", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "expression": { + "id": 15723, + "name": "block", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -4, + "src": "3311:5:61", + "typeDescriptions": { + "typeIdentifier": "t_magic_block", + "typeString": "block" + } + }, + "id": 15724, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "3317:9:61", + "memberName": "timestamp", + "nodeType": "MemberAccess", + "src": "3311:15:61", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "hexValue": "30", + "id": 15725, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3350:1:61", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + { + "hexValue": "30", + "id": 15726, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3385:1:61", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + { + "id": 15727, + "name": "accRewardsPerAllocatedToken", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15696, + "src": "3429:27:61", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "hexValue": "30", + "id": 15728, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3489:1:61", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + { + "id": 15729, + "name": "createdAtEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15698, + "src": "3520:14:61", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 15719, + "name": "State", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15663, + "src": "3166:5:61", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_struct$_State_$15663_storage_ptr_$", + "typeString": "type(struct Allocation.State storage pointer)" + } + }, + "id": 15730, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "structConstructorCall", + "lValueRequested": false, + "nameLocations": [ + "3186:7:61", + "3216:20:61", + "3272:6:61", + "3300:9:61", + "3340:8:61", + "3365:18:61", + "3400:27:61", + "3470:17:61", + "3504:14:61" + ], + "names": [ + "indexer", + "subgraphDeploymentId", + "tokens", + "createdAt", + "closedAt", + "lastPOIPresentedAt", + "accRewardsPerAllocatedToken", + "accRewardsPending", + "createdAtEpoch" + ], + "nodeType": "FunctionCall", + "src": "3166:379:61", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "3140:405:61" + }, + { + "expression": { + "id": 15736, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "baseExpression": { + "id": 15732, + "name": "self", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15686, + "src": "3556:4:61", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_State_$15663_storage_$", + "typeString": "mapping(address => struct Allocation.State storage ref)" + } + }, + "id": 15734, + "indexExpression": { + "id": 15733, + "name": "allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15690, + "src": "3561:12:61", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "3556:18:61", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_storage", + "typeString": "struct Allocation.State storage ref" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "id": 15735, + "name": "allocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15718, + "src": "3577:10:61", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "src": "3556:31:61", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_storage", + "typeString": "struct Allocation.State storage ref" + } + }, + "id": 15737, + "nodeType": "ExpressionStatement", + "src": "3556:31:61" + }, + { + "expression": { + "id": 15738, + "name": "allocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15718, + "src": "3605:10:61", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "functionReturnParameters": 15703, + "id": 15739, + "nodeType": "Return", + "src": "3598:17:61" + } + ] + }, + "documentation": { + "id": 15681, + "nodeType": "StructuredDocumentation", + "src": "2145:597:61", + "text": " @notice Create a new allocation\n @dev Requirements:\n - The allocation must not exist\n @param self The allocation list mapping\n @param indexer The indexer that owns the allocation\n @param allocationId The allocation id\n @param subgraphDeploymentId The subgraph deployment id the allocation is for\n @param tokens The number of tokens allocated\n @param accRewardsPerAllocatedToken The initial accumulated rewards per allocated token\n @param createdAtEpoch The epoch when the allocation was created\n @return The allocation" + }, + "id": 15741, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "create", + "nameLocation": "2756:6:61", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 15699, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15686, + "mutability": "mutable", + "name": "self", + "nameLocation": "2806:4:61", + "nodeType": "VariableDeclaration", + "scope": 15741, + "src": "2772:38:61", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_State_$15663_storage_$", + "typeString": "mapping(address => struct Allocation.State)" + }, + "typeName": { + "id": 15685, + "keyName": "", + "keyNameLocation": "-1:-1:-1", + "keyType": { + "id": 15682, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2780:7:61", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "2772:25:61", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_State_$15663_storage_$", + "typeString": "mapping(address => struct Allocation.State)" + }, + "valueName": "", + "valueNameLocation": "-1:-1:-1", + "valueType": { + "id": 15684, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 15683, + "name": "State", + "nameLocations": [ + "2791:5:61" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 15663, + "src": "2791:5:61" + }, + "referencedDeclaration": 15663, + "src": "2791:5:61", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_storage_ptr", + "typeString": "struct Allocation.State" + } + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15688, + "mutability": "mutable", + "name": "indexer", + "nameLocation": "2828:7:61", + "nodeType": "VariableDeclaration", + "scope": 15741, + "src": "2820:15:61", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 15687, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2820:7:61", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15690, + "mutability": "mutable", + "name": "allocationId", + "nameLocation": "2853:12:61", + "nodeType": "VariableDeclaration", + "scope": 15741, + "src": "2845:20:61", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 15689, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2845:7:61", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15692, + "mutability": "mutable", + "name": "subgraphDeploymentId", + "nameLocation": "2883:20:61", + "nodeType": "VariableDeclaration", + "scope": 15741, + "src": "2875:28:61", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 15691, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "2875:7:61", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15694, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "2921:6:61", + "nodeType": "VariableDeclaration", + "scope": 15741, + "src": "2913:14:61", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 15693, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2913:7:61", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15696, + "mutability": "mutable", + "name": "accRewardsPerAllocatedToken", + "nameLocation": "2945:27:61", + "nodeType": "VariableDeclaration", + "scope": 15741, + "src": "2937:35:61", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 15695, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2937:7:61", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15698, + "mutability": "mutable", + "name": "createdAtEpoch", + "nameLocation": "2990:14:61", + "nodeType": "VariableDeclaration", + "scope": 15741, + "src": "2982:22:61", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 15697, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2982:7:61", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "2762:248:61" + }, + "returnParameters": { + "id": 15703, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15702, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 15741, + "src": "3029:12:61", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State" + }, + "typeName": { + "id": 15701, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 15700, + "name": "State", + "nameLocations": [ + "3029:5:61" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 15663, + "src": "3029:5:61" + }, + "referencedDeclaration": 15663, + "src": "3029:5:61", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_storage_ptr", + "typeString": "struct Allocation.State" + } + }, + "visibility": "internal" + } + ], + "src": "3028:14:61" + }, + "scope": 16033, + "src": "2747:875:61", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 15778, + "nodeType": "Block", + "src": "3994:216:61", + "statements": [ + { + "assignments": [ + 15754 + ], + "declarations": [ + { + "constant": false, + "id": 15754, + "mutability": "mutable", + "name": "allocation", + "nameLocation": "4018:10:61", + "nodeType": "VariableDeclaration", + "scope": 15778, + "src": "4004:24:61", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_storage_ptr", + "typeString": "struct Allocation.State" + }, + "typeName": { + "id": 15753, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 15752, + "name": "State", + "nameLocations": [ + "4004:5:61" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 15663, + "src": "4004:5:61" + }, + "referencedDeclaration": 15663, + "src": "4004:5:61", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_storage_ptr", + "typeString": "struct Allocation.State" + } + }, + "visibility": "internal" + } + ], + "id": 15759, + "initialValue": { + "arguments": [ + { + "id": 15756, + "name": "self", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15747, + "src": "4036:4:61", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_State_$15663_storage_$", + "typeString": "mapping(address => struct Allocation.State storage ref)" + } + }, + { + "id": 15757, + "name": "allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15749, + "src": "4042:12:61", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_State_$15663_storage_$", + "typeString": "mapping(address => struct Allocation.State storage ref)" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 15755, + "name": "_get", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16032, + "src": "4031:4:61", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_mapping$_t_address_$_t_struct$_State_$15663_storage_$_$_t_address_$returns$_t_struct$_State_$15663_storage_ptr_$", + "typeString": "function (mapping(address => struct Allocation.State storage ref),address) view returns (struct Allocation.State storage pointer)" + } + }, + "id": 15758, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4031:24:61", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_storage_ptr", + "typeString": "struct Allocation.State storage pointer" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "4004:51:61" + }, + { + "expression": { + "arguments": [ + { + "arguments": [], + "expression": { + "argumentTypes": [], + "expression": { + "id": 15761, + "name": "allocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15754, + "src": "4073:10:61", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_storage_ptr", + "typeString": "struct Allocation.State storage pointer" + } + }, + "id": 15762, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "4084:6:61", + "memberName": "isOpen", + "nodeType": "MemberAccess", + "referencedDeclaration": 15980, + "src": "4073:17:61", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_struct$_State_$15663_memory_ptr_$returns$_t_bool_$attached_to$_t_struct$_State_$15663_memory_ptr_$", + "typeString": "function (struct Allocation.State memory) pure returns (bool)" + } + }, + "id": 15763, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4073:19:61", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [ + { + "id": 15765, + "name": "allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15749, + "src": "4111:12:61", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "expression": { + "id": 15766, + "name": "allocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15754, + "src": "4125:10:61", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_storage_ptr", + "typeString": "struct Allocation.State storage pointer" + } + }, + "id": 15767, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "4136:8:61", + "memberName": "closedAt", + "nodeType": "MemberAccess", + "referencedDeclaration": 15654, + "src": "4125:19:61", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 15764, + "name": "AllocationClosed", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15680, + "src": "4094:16:61", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_address_$_t_uint256_$returns$_t_error_$", + "typeString": "function (address,uint256) pure returns (error)" + } + }, + "id": 15768, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4094:51:61", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 15760, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "4065:7:61", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 15769, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4065:81:61", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 15770, + "nodeType": "ExpressionStatement", + "src": "4065:81:61" + }, + { + "expression": { + "id": 15776, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 15771, + "name": "allocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15754, + "src": "4156:10:61", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_storage_ptr", + "typeString": "struct Allocation.State storage pointer" + } + }, + "id": 15773, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberLocation": "4167:18:61", + "memberName": "lastPOIPresentedAt", + "nodeType": "MemberAccess", + "referencedDeclaration": 15656, + "src": "4156:29:61", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "expression": { + "id": 15774, + "name": "block", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -4, + "src": "4188:5:61", + "typeDescriptions": { + "typeIdentifier": "t_magic_block", + "typeString": "block" + } + }, + "id": 15775, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "4194:9:61", + "memberName": "timestamp", + "nodeType": "MemberAccess", + "src": "4188:15:61", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "4156:47:61", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 15777, + "nodeType": "ExpressionStatement", + "src": "4156:47:61" + } + ] + }, + "documentation": { + "id": 15742, + "nodeType": "StructuredDocumentation", + "src": "3628:270:61", + "text": " @notice Present a POI for an allocation\n @dev It only updates the last POI presented timestamp.\n Requirements:\n - The allocation must be open\n @param self The allocation list mapping\n @param allocationId The allocation id" + }, + "id": 15779, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "presentPOI", + "nameLocation": "3912:10:61", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 15750, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15747, + "mutability": "mutable", + "name": "self", + "nameLocation": "3957:4:61", + "nodeType": "VariableDeclaration", + "scope": 15779, + "src": "3923:38:61", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_State_$15663_storage_$", + "typeString": "mapping(address => struct Allocation.State)" + }, + "typeName": { + "id": 15746, + "keyName": "", + "keyNameLocation": "-1:-1:-1", + "keyType": { + "id": 15743, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3931:7:61", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "3923:25:61", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_State_$15663_storage_$", + "typeString": "mapping(address => struct Allocation.State)" + }, + "valueName": "", + "valueNameLocation": "-1:-1:-1", + "valueType": { + "id": 15745, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 15744, + "name": "State", + "nameLocations": [ + "3942:5:61" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 15663, + "src": "3942:5:61" + }, + "referencedDeclaration": 15663, + "src": "3942:5:61", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_storage_ptr", + "typeString": "struct Allocation.State" + } + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15749, + "mutability": "mutable", + "name": "allocationId", + "nameLocation": "3971:12:61", + "nodeType": "VariableDeclaration", + "scope": 15779, + "src": "3963:20:61", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 15748, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3963:7:61", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "3922:62:61" + }, + "returnParameters": { + "id": 15751, + "nodeType": "ParameterList", + "parameters": [], + "src": "3994:0:61" + }, + "scope": 16033, + "src": "3903:307:61", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 15817, + "nodeType": "Block", + "src": "4724:237:61", + "statements": [ + { + "assignments": [ + 15794 + ], + "declarations": [ + { + "constant": false, + "id": 15794, + "mutability": "mutable", + "name": "allocation", + "nameLocation": "4748:10:61", + "nodeType": "VariableDeclaration", + "scope": 15817, + "src": "4734:24:61", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_storage_ptr", + "typeString": "struct Allocation.State" + }, + "typeName": { + "id": 15793, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 15792, + "name": "State", + "nameLocations": [ + "4734:5:61" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 15663, + "src": "4734:5:61" + }, + "referencedDeclaration": 15663, + "src": "4734:5:61", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_storage_ptr", + "typeString": "struct Allocation.State" + } + }, + "visibility": "internal" + } + ], + "id": 15799, + "initialValue": { + "arguments": [ + { + "id": 15796, + "name": "self", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15785, + "src": "4766:4:61", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_State_$15663_storage_$", + "typeString": "mapping(address => struct Allocation.State storage ref)" + } + }, + { + "id": 15797, + "name": "allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15787, + "src": "4772:12:61", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_State_$15663_storage_$", + "typeString": "mapping(address => struct Allocation.State storage ref)" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 15795, + "name": "_get", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16032, + "src": "4761:4:61", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_mapping$_t_address_$_t_struct$_State_$15663_storage_$_$_t_address_$returns$_t_struct$_State_$15663_storage_ptr_$", + "typeString": "function (mapping(address => struct Allocation.State storage ref),address) view returns (struct Allocation.State storage pointer)" + } + }, + "id": 15798, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4761:24:61", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_storage_ptr", + "typeString": "struct Allocation.State storage pointer" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "4734:51:61" + }, + { + "expression": { + "arguments": [ + { + "arguments": [], + "expression": { + "argumentTypes": [], + "expression": { + "id": 15801, + "name": "allocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15794, + "src": "4803:10:61", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_storage_ptr", + "typeString": "struct Allocation.State storage pointer" + } + }, + "id": 15802, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "4814:6:61", + "memberName": "isOpen", + "nodeType": "MemberAccess", + "referencedDeclaration": 15980, + "src": "4803:17:61", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_struct$_State_$15663_memory_ptr_$returns$_t_bool_$attached_to$_t_struct$_State_$15663_memory_ptr_$", + "typeString": "function (struct Allocation.State memory) pure returns (bool)" + } + }, + "id": 15803, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4803:19:61", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [ + { + "id": 15805, + "name": "allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15787, + "src": "4841:12:61", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "expression": { + "id": 15806, + "name": "allocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15794, + "src": "4855:10:61", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_storage_ptr", + "typeString": "struct Allocation.State storage pointer" + } + }, + "id": 15807, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "4866:8:61", + "memberName": "closedAt", + "nodeType": "MemberAccess", + "referencedDeclaration": 15654, + "src": "4855:19:61", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 15804, + "name": "AllocationClosed", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15680, + "src": "4824:16:61", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_address_$_t_uint256_$returns$_t_error_$", + "typeString": "function (address,uint256) pure returns (error)" + } + }, + "id": 15808, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4824:51:61", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 15800, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "4795:7:61", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 15809, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4795:81:61", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 15810, + "nodeType": "ExpressionStatement", + "src": "4795:81:61" + }, + { + "expression": { + "id": 15815, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 15811, + "name": "allocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15794, + "src": "4886:10:61", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_storage_ptr", + "typeString": "struct Allocation.State storage pointer" + } + }, + "id": 15813, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberLocation": "4897:27:61", + "memberName": "accRewardsPerAllocatedToken", + "nodeType": "MemberAccess", + "referencedDeclaration": 15658, + "src": "4886:38:61", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "id": 15814, + "name": "accRewardsPerAllocatedToken", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15789, + "src": "4927:27:61", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "4886:68:61", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 15816, + "nodeType": "ExpressionStatement", + "src": "4886:68:61" + } + ] + }, + "documentation": { + "id": 15780, + "nodeType": "StructuredDocumentation", + "src": "4216:340:61", + "text": " @notice Update the accumulated rewards per allocated token for an allocation\n @dev Requirements:\n - The allocation must be open\n @param self The allocation list mapping\n @param allocationId The allocation id\n @param accRewardsPerAllocatedToken The new accumulated rewards per allocated token" + }, + "id": 15818, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "snapshotRewards", + "nameLocation": "4570:15:61", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 15790, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15785, + "mutability": "mutable", + "name": "self", + "nameLocation": "4629:4:61", + "nodeType": "VariableDeclaration", + "scope": 15818, + "src": "4595:38:61", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_State_$15663_storage_$", + "typeString": "mapping(address => struct Allocation.State)" + }, + "typeName": { + "id": 15784, + "keyName": "", + "keyNameLocation": "-1:-1:-1", + "keyType": { + "id": 15781, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4603:7:61", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "4595:25:61", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_State_$15663_storage_$", + "typeString": "mapping(address => struct Allocation.State)" + }, + "valueName": "", + "valueNameLocation": "-1:-1:-1", + "valueType": { + "id": 15783, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 15782, + "name": "State", + "nameLocations": [ + "4614:5:61" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 15663, + "src": "4614:5:61" + }, + "referencedDeclaration": 15663, + "src": "4614:5:61", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_storage_ptr", + "typeString": "struct Allocation.State" + } + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15787, + "mutability": "mutable", + "name": "allocationId", + "nameLocation": "4651:12:61", + "nodeType": "VariableDeclaration", + "scope": 15818, + "src": "4643:20:61", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 15786, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4643:7:61", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15789, + "mutability": "mutable", + "name": "accRewardsPerAllocatedToken", + "nameLocation": "4681:27:61", + "nodeType": "VariableDeclaration", + "scope": 15818, + "src": "4673:35:61", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 15788, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "4673:7:61", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "4585:129:61" + }, + "returnParameters": { + "id": 15791, + "nodeType": "ParameterList", + "parameters": [], + "src": "4724:0:61" + }, + "scope": 16033, + "src": "4561:400:61", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 15854, + "nodeType": "Block", + "src": "5324:201:61", + "statements": [ + { + "assignments": [ + 15831 + ], + "declarations": [ + { + "constant": false, + "id": 15831, + "mutability": "mutable", + "name": "allocation", + "nameLocation": "5348:10:61", + "nodeType": "VariableDeclaration", + "scope": 15854, + "src": "5334:24:61", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_storage_ptr", + "typeString": "struct Allocation.State" + }, + "typeName": { + "id": 15830, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 15829, + "name": "State", + "nameLocations": [ + "5334:5:61" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 15663, + "src": "5334:5:61" + }, + "referencedDeclaration": 15663, + "src": "5334:5:61", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_storage_ptr", + "typeString": "struct Allocation.State" + } + }, + "visibility": "internal" + } + ], + "id": 15836, + "initialValue": { + "arguments": [ + { + "id": 15833, + "name": "self", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15824, + "src": "5366:4:61", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_State_$15663_storage_$", + "typeString": "mapping(address => struct Allocation.State storage ref)" + } + }, + { + "id": 15834, + "name": "allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15826, + "src": "5372:12:61", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_State_$15663_storage_$", + "typeString": "mapping(address => struct Allocation.State storage ref)" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 15832, + "name": "_get", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16032, + "src": "5361:4:61", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_mapping$_t_address_$_t_struct$_State_$15663_storage_$_$_t_address_$returns$_t_struct$_State_$15663_storage_ptr_$", + "typeString": "function (mapping(address => struct Allocation.State storage ref),address) view returns (struct Allocation.State storage pointer)" + } + }, + "id": 15835, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5361:24:61", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_storage_ptr", + "typeString": "struct Allocation.State storage pointer" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "5334:51:61" + }, + { + "expression": { + "arguments": [ + { + "arguments": [], + "expression": { + "argumentTypes": [], + "expression": { + "id": 15838, + "name": "allocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15831, + "src": "5403:10:61", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_storage_ptr", + "typeString": "struct Allocation.State storage pointer" + } + }, + "id": 15839, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "5414:6:61", + "memberName": "isOpen", + "nodeType": "MemberAccess", + "referencedDeclaration": 15980, + "src": "5403:17:61", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_struct$_State_$15663_memory_ptr_$returns$_t_bool_$attached_to$_t_struct$_State_$15663_memory_ptr_$", + "typeString": "function (struct Allocation.State memory) pure returns (bool)" + } + }, + "id": 15840, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5403:19:61", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [ + { + "id": 15842, + "name": "allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15826, + "src": "5441:12:61", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "expression": { + "id": 15843, + "name": "allocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15831, + "src": "5455:10:61", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_storage_ptr", + "typeString": "struct Allocation.State storage pointer" + } + }, + "id": 15844, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "5466:8:61", + "memberName": "closedAt", + "nodeType": "MemberAccess", + "referencedDeclaration": 15654, + "src": "5455:19:61", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 15841, + "name": "AllocationClosed", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15680, + "src": "5424:16:61", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_address_$_t_uint256_$returns$_t_error_$", + "typeString": "function (address,uint256) pure returns (error)" + } + }, + "id": 15845, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5424:51:61", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 15837, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "5395:7:61", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 15846, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5395:81:61", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 15847, + "nodeType": "ExpressionStatement", + "src": "5395:81:61" + }, + { + "expression": { + "id": 15852, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 15848, + "name": "allocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15831, + "src": "5486:10:61", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_storage_ptr", + "typeString": "struct Allocation.State storage pointer" + } + }, + "id": 15850, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberLocation": "5497:17:61", + "memberName": "accRewardsPending", + "nodeType": "MemberAccess", + "referencedDeclaration": 15660, + "src": "5486:28:61", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "hexValue": "30", + "id": 15851, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "5517:1:61", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "5486:32:61", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 15853, + "nodeType": "ExpressionStatement", + "src": "5486:32:61" + } + ] + }, + "documentation": { + "id": 15819, + "nodeType": "StructuredDocumentation", + "src": "4967:252:61", + "text": " @notice Update the accumulated rewards pending to be claimed for an allocation\n @dev Requirements:\n - The allocation must be open\n @param self The allocation list mapping\n @param allocationId The allocation id" + }, + "id": 15855, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "clearPendingRewards", + "nameLocation": "5233:19:61", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 15827, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15824, + "mutability": "mutable", + "name": "self", + "nameLocation": "5287:4:61", + "nodeType": "VariableDeclaration", + "scope": 15855, + "src": "5253:38:61", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_State_$15663_storage_$", + "typeString": "mapping(address => struct Allocation.State)" + }, + "typeName": { + "id": 15823, + "keyName": "", + "keyNameLocation": "-1:-1:-1", + "keyType": { + "id": 15820, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5261:7:61", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "5253:25:61", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_State_$15663_storage_$", + "typeString": "mapping(address => struct Allocation.State)" + }, + "valueName": "", + "valueNameLocation": "-1:-1:-1", + "valueType": { + "id": 15822, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 15821, + "name": "State", + "nameLocations": [ + "5272:5:61" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 15663, + "src": "5272:5:61" + }, + "referencedDeclaration": 15663, + "src": "5272:5:61", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_storage_ptr", + "typeString": "struct Allocation.State" + } + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15826, + "mutability": "mutable", + "name": "allocationId", + "nameLocation": "5301:12:61", + "nodeType": "VariableDeclaration", + "scope": 15855, + "src": "5293:20:61", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 15825, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5293:7:61", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "5252:62:61" + }, + "returnParameters": { + "id": 15828, + "nodeType": "ParameterList", + "parameters": [], + "src": "5324:0:61" + }, + "scope": 16033, + "src": "5224:301:61", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 15892, + "nodeType": "Block", + "src": "5823:206:61", + "statements": [ + { + "assignments": [ + 15868 + ], + "declarations": [ + { + "constant": false, + "id": 15868, + "mutability": "mutable", + "name": "allocation", + "nameLocation": "5847:10:61", + "nodeType": "VariableDeclaration", + "scope": 15892, + "src": "5833:24:61", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_storage_ptr", + "typeString": "struct Allocation.State" + }, + "typeName": { + "id": 15867, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 15866, + "name": "State", + "nameLocations": [ + "5833:5:61" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 15663, + "src": "5833:5:61" + }, + "referencedDeclaration": 15663, + "src": "5833:5:61", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_storage_ptr", + "typeString": "struct Allocation.State" + } + }, + "visibility": "internal" + } + ], + "id": 15873, + "initialValue": { + "arguments": [ + { + "id": 15870, + "name": "self", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15861, + "src": "5865:4:61", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_State_$15663_storage_$", + "typeString": "mapping(address => struct Allocation.State storage ref)" + } + }, + { + "id": 15871, + "name": "allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15863, + "src": "5871:12:61", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_State_$15663_storage_$", + "typeString": "mapping(address => struct Allocation.State storage ref)" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 15869, + "name": "_get", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16032, + "src": "5860:4:61", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_mapping$_t_address_$_t_struct$_State_$15663_storage_$_$_t_address_$returns$_t_struct$_State_$15663_storage_ptr_$", + "typeString": "function (mapping(address => struct Allocation.State storage ref),address) view returns (struct Allocation.State storage pointer)" + } + }, + "id": 15872, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5860:24:61", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_storage_ptr", + "typeString": "struct Allocation.State storage pointer" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "5833:51:61" + }, + { + "expression": { + "arguments": [ + { + "arguments": [], + "expression": { + "argumentTypes": [], + "expression": { + "id": 15875, + "name": "allocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15868, + "src": "5902:10:61", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_storage_ptr", + "typeString": "struct Allocation.State storage pointer" + } + }, + "id": 15876, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "5913:6:61", + "memberName": "isOpen", + "nodeType": "MemberAccess", + "referencedDeclaration": 15980, + "src": "5902:17:61", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_struct$_State_$15663_memory_ptr_$returns$_t_bool_$attached_to$_t_struct$_State_$15663_memory_ptr_$", + "typeString": "function (struct Allocation.State memory) pure returns (bool)" + } + }, + "id": 15877, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5902:19:61", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [ + { + "id": 15879, + "name": "allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15863, + "src": "5940:12:61", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "expression": { + "id": 15880, + "name": "allocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15868, + "src": "5954:10:61", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_storage_ptr", + "typeString": "struct Allocation.State storage pointer" + } + }, + "id": 15881, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "5965:8:61", + "memberName": "closedAt", + "nodeType": "MemberAccess", + "referencedDeclaration": 15654, + "src": "5954:19:61", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 15878, + "name": "AllocationClosed", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15680, + "src": "5923:16:61", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_address_$_t_uint256_$returns$_t_error_$", + "typeString": "function (address,uint256) pure returns (error)" + } + }, + "id": 15882, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5923:51:61", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 15874, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "5894:7:61", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 15883, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5894:81:61", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 15884, + "nodeType": "ExpressionStatement", + "src": "5894:81:61" + }, + { + "expression": { + "id": 15890, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 15885, + "name": "allocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15868, + "src": "5985:10:61", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_storage_ptr", + "typeString": "struct Allocation.State storage pointer" + } + }, + "id": 15887, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberLocation": "5996:8:61", + "memberName": "closedAt", + "nodeType": "MemberAccess", + "referencedDeclaration": 15654, + "src": "5985:19:61", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "expression": { + "id": 15888, + "name": "block", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -4, + "src": "6007:5:61", + "typeDescriptions": { + "typeIdentifier": "t_magic_block", + "typeString": "block" + } + }, + "id": 15889, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "6013:9:61", + "memberName": "timestamp", + "nodeType": "MemberAccess", + "src": "6007:15:61", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "5985:37:61", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 15891, + "nodeType": "ExpressionStatement", + "src": "5985:37:61" + } + ] + }, + "documentation": { + "id": 15856, + "nodeType": "StructuredDocumentation", + "src": "5531:201:61", + "text": " @notice Close an allocation\n @dev Requirements:\n - The allocation must be open\n @param self The allocation list mapping\n @param allocationId The allocation id" + }, + "id": 15893, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "close", + "nameLocation": "5746:5:61", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 15864, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15861, + "mutability": "mutable", + "name": "self", + "nameLocation": "5786:4:61", + "nodeType": "VariableDeclaration", + "scope": 15893, + "src": "5752:38:61", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_State_$15663_storage_$", + "typeString": "mapping(address => struct Allocation.State)" + }, + "typeName": { + "id": 15860, + "keyName": "", + "keyNameLocation": "-1:-1:-1", + "keyType": { + "id": 15857, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5760:7:61", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "5752:25:61", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_State_$15663_storage_$", + "typeString": "mapping(address => struct Allocation.State)" + }, + "valueName": "", + "valueNameLocation": "-1:-1:-1", + "valueType": { + "id": 15859, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 15858, + "name": "State", + "nameLocations": [ + "5771:5:61" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 15663, + "src": "5771:5:61" + }, + "referencedDeclaration": 15663, + "src": "5771:5:61", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_storage_ptr", + "typeString": "struct Allocation.State" + } + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15863, + "mutability": "mutable", + "name": "allocationId", + "nameLocation": "5800:12:61", + "nodeType": "VariableDeclaration", + "scope": 15893, + "src": "5792:20:61", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 15862, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5792:7:61", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "5751:62:61" + }, + "returnParameters": { + "id": 15865, + "nodeType": "ParameterList", + "parameters": [], + "src": "5823:0:61" + }, + "scope": 16033, + "src": "5737:292:61", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 15912, + "nodeType": "Block", + "src": "6318:48:61", + "statements": [ + { + "expression": { + "arguments": [ + { + "id": 15908, + "name": "self", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15899, + "src": "6340:4:61", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_State_$15663_storage_$", + "typeString": "mapping(address => struct Allocation.State storage ref)" + } + }, + { + "id": 15909, + "name": "allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15901, + "src": "6346:12:61", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_State_$15663_storage_$", + "typeString": "mapping(address => struct Allocation.State storage ref)" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 15907, + "name": "_get", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16032, + "src": "6335:4:61", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_mapping$_t_address_$_t_struct$_State_$15663_storage_$_$_t_address_$returns$_t_struct$_State_$15663_storage_ptr_$", + "typeString": "function (mapping(address => struct Allocation.State storage ref),address) view returns (struct Allocation.State storage pointer)" + } + }, + "id": 15910, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "6335:24:61", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_storage_ptr", + "typeString": "struct Allocation.State storage pointer" + } + }, + "functionReturnParameters": 15906, + "id": 15911, + "nodeType": "Return", + "src": "6328:31:61" + } + ] + }, + "documentation": { + "id": 15894, + "nodeType": "StructuredDocumentation", + "src": "6035:166:61", + "text": " @notice Get an allocation\n @param self The allocation list mapping\n @param allocationId The allocation id\n @return The allocation" + }, + "id": 15913, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "get", + "nameLocation": "6215:3:61", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 15902, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15899, + "mutability": "mutable", + "name": "self", + "nameLocation": "6253:4:61", + "nodeType": "VariableDeclaration", + "scope": 15913, + "src": "6219:38:61", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_State_$15663_storage_$", + "typeString": "mapping(address => struct Allocation.State)" + }, + "typeName": { + "id": 15898, + "keyName": "", + "keyNameLocation": "-1:-1:-1", + "keyType": { + "id": 15895, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6227:7:61", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "6219:25:61", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_State_$15663_storage_$", + "typeString": "mapping(address => struct Allocation.State)" + }, + "valueName": "", + "valueNameLocation": "-1:-1:-1", + "valueType": { + "id": 15897, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 15896, + "name": "State", + "nameLocations": [ + "6238:5:61" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 15663, + "src": "6238:5:61" + }, + "referencedDeclaration": 15663, + "src": "6238:5:61", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_storage_ptr", + "typeString": "struct Allocation.State" + } + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15901, + "mutability": "mutable", + "name": "allocationId", + "nameLocation": "6267:12:61", + "nodeType": "VariableDeclaration", + "scope": 15913, + "src": "6259:20:61", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 15900, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6259:7:61", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "6218:62:61" + }, + "returnParameters": { + "id": 15906, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15905, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 15913, + "src": "6304:12:61", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State" + }, + "typeName": { + "id": 15904, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 15903, + "name": "State", + "nameLocations": [ + "6304:5:61" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 15663, + "src": "6304:5:61" + }, + "referencedDeclaration": 15663, + "src": "6304:5:61", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_storage_ptr", + "typeString": "struct Allocation.State" + } + }, + "visibility": "internal" + } + ], + "src": "6303:14:61" + }, + "scope": 16033, + "src": "6206:160:61", + "stateMutability": "view", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 15945, + "nodeType": "Block", + "src": "6686:178:61", + "statements": [ + { + "assignments": [ + 15925 + ], + "declarations": [ + { + "constant": false, + "id": 15925, + "mutability": "mutable", + "name": "timeSinceLastPOI", + "nameLocation": "6704:16:61", + "nodeType": "VariableDeclaration", + "scope": 15945, + "src": "6696:24:61", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 15924, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "6696:7:61", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 15936, + "initialValue": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 15935, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 15926, + "name": "block", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -4, + "src": "6723:5:61", + "typeDescriptions": { + "typeIdentifier": "t_magic_block", + "typeString": "block" + } + }, + "id": 15927, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "6729:9:61", + "memberName": "timestamp", + "nodeType": "MemberAccess", + "src": "6723:15:61", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "arguments": [ + { + "expression": { + "id": 15930, + "name": "self", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15917, + "src": "6750:4:61", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "id": 15931, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "6755:9:61", + "memberName": "createdAt", + "nodeType": "MemberAccess", + "referencedDeclaration": 15652, + "src": "6750:14:61", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "expression": { + "id": 15932, + "name": "self", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15917, + "src": "6766:4:61", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "id": 15933, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "6771:18:61", + "memberName": "lastPOIPresentedAt", + "nodeType": "MemberAccess", + "referencedDeclaration": 15656, + "src": "6766:23:61", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "id": 15928, + "name": "Math", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9938, + "src": "6741:4:61", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_Math_$9938_$", + "typeString": "type(library Math)" + } + }, + "id": 15929, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "6746:3:61", + "memberName": "max", + "nodeType": "MemberAccess", + "referencedDeclaration": 8625, + "src": "6741:8:61", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 15934, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "6741:49:61", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "6723:67:61", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "6696:94:61" + }, + { + "expression": { + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 15943, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "expression": { + "id": 15937, + "name": "self", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15917, + "src": "6807:4:61", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "id": 15938, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "6812:6:61", + "memberName": "isOpen", + "nodeType": "MemberAccess", + "referencedDeclaration": 15980, + "src": "6807:11:61", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_struct$_State_$15663_memory_ptr_$returns$_t_bool_$attached_to$_t_struct$_State_$15663_memory_ptr_$", + "typeString": "function (struct Allocation.State memory) pure returns (bool)" + } + }, + "id": 15939, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "6807:13:61", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "&&", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 15942, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 15940, + "name": "timeSinceLastPOI", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15925, + "src": "6824:16:61", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "id": 15941, + "name": "staleThreshold", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15919, + "src": "6843:14:61", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "6824:33:61", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "6807:50:61", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "functionReturnParameters": 15923, + "id": 15944, + "nodeType": "Return", + "src": "6800:57:61" + } + ] + }, + "documentation": { + "id": 15914, + "nodeType": "StructuredDocumentation", + "src": "6372:220:61", + "text": " @notice Checks if an allocation is stale\n @param self The allocation\n @param staleThreshold The time in blocks to consider an allocation stale\n @return True if the allocation is stale" + }, + "id": 15946, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "isStale", + "nameLocation": "6606:7:61", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 15920, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15917, + "mutability": "mutable", + "name": "self", + "nameLocation": "6627:4:61", + "nodeType": "VariableDeclaration", + "scope": 15946, + "src": "6614:17:61", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State" + }, + "typeName": { + "id": 15916, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 15915, + "name": "State", + "nameLocations": [ + "6614:5:61" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 15663, + "src": "6614:5:61" + }, + "referencedDeclaration": 15663, + "src": "6614:5:61", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_storage_ptr", + "typeString": "struct Allocation.State" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 15919, + "mutability": "mutable", + "name": "staleThreshold", + "nameLocation": "6641:14:61", + "nodeType": "VariableDeclaration", + "scope": 15946, + "src": "6633:22:61", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 15918, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "6633:7:61", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "6613:43:61" + }, + "returnParameters": { + "id": 15923, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15922, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 15946, + "src": "6680:4:61", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 15921, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "6680:4:61", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "src": "6679:6:61" + }, + "scope": 16033, + "src": "6597:267:61", + "stateMutability": "view", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 15960, + "nodeType": "Block", + "src": "7075:43:61", + "statements": [ + { + "expression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 15958, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 15955, + "name": "self", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15950, + "src": "7092:4:61", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "id": 15956, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "7097:9:61", + "memberName": "createdAt", + "nodeType": "MemberAccess", + "referencedDeclaration": 15652, + "src": "7092:14:61", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "hexValue": "30", + "id": 15957, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7110:1:61", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "7092:19:61", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "functionReturnParameters": 15954, + "id": 15959, + "nodeType": "Return", + "src": "7085:26:61" + } + ] + }, + "documentation": { + "id": 15947, + "nodeType": "StructuredDocumentation", + "src": "6870:136:61", + "text": " @notice Checks if an allocation exists\n @param self The allocation\n @return True if the allocation exists" + }, + "id": 15961, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "exists", + "nameLocation": "7020:6:61", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 15951, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15950, + "mutability": "mutable", + "name": "self", + "nameLocation": "7040:4:61", + "nodeType": "VariableDeclaration", + "scope": 15961, + "src": "7027:17:61", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State" + }, + "typeName": { + "id": 15949, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 15948, + "name": "State", + "nameLocations": [ + "7027:5:61" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 15663, + "src": "7027:5:61" + }, + "referencedDeclaration": 15663, + "src": "7027:5:61", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_storage_ptr", + "typeString": "struct Allocation.State" + } + }, + "visibility": "internal" + } + ], + "src": "7026:19:61" + }, + "returnParameters": { + "id": 15954, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15953, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 15961, + "src": "7069:4:61", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 15952, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "7069:4:61", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "src": "7068:6:61" + }, + "scope": 16033, + "src": "7011:107:61", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 15979, + "nodeType": "Block", + "src": "7331:59:61", + "statements": [ + { + "expression": { + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 15977, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "expression": { + "id": 15970, + "name": "self", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15965, + "src": "7348:4:61", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "id": 15971, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "7353:6:61", + "memberName": "exists", + "nodeType": "MemberAccess", + "referencedDeclaration": 15961, + "src": "7348:11:61", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_struct$_State_$15663_memory_ptr_$returns$_t_bool_$attached_to$_t_struct$_State_$15663_memory_ptr_$", + "typeString": "function (struct Allocation.State memory) pure returns (bool)" + } + }, + "id": 15972, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "7348:13:61", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "&&", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 15976, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 15973, + "name": "self", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15965, + "src": "7365:4:61", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "id": 15974, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "7370:8:61", + "memberName": "closedAt", + "nodeType": "MemberAccess", + "referencedDeclaration": 15654, + "src": "7365:13:61", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "30", + "id": 15975, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7382:1:61", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "7365:18:61", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "7348:35:61", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "functionReturnParameters": 15969, + "id": 15978, + "nodeType": "Return", + "src": "7341:42:61" + } + ] + }, + "documentation": { + "id": 15962, + "nodeType": "StructuredDocumentation", + "src": "7124:138:61", + "text": " @notice Checks if an allocation is open\n @param self The allocation\n @return True if the allocation is open" + }, + "id": 15980, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "isOpen", + "nameLocation": "7276:6:61", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 15966, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15965, + "mutability": "mutable", + "name": "self", + "nameLocation": "7296:4:61", + "nodeType": "VariableDeclaration", + "scope": 15980, + "src": "7283:17:61", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State" + }, + "typeName": { + "id": 15964, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 15963, + "name": "State", + "nameLocations": [ + "7283:5:61" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 15663, + "src": "7283:5:61" + }, + "referencedDeclaration": 15663, + "src": "7283:5:61", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_storage_ptr", + "typeString": "struct Allocation.State" + } + }, + "visibility": "internal" + } + ], + "src": "7282:19:61" + }, + "returnParameters": { + "id": 15969, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15968, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 15980, + "src": "7325:4:61", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 15967, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "7325:4:61", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "src": "7324:6:61" + }, + "scope": 16033, + "src": "7267:123:61", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 15998, + "nodeType": "Block", + "src": "7621:57:61", + "statements": [ + { + "expression": { + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 15996, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "expression": { + "id": 15989, + "name": "self", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15984, + "src": "7638:4:61", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "id": 15990, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "7643:6:61", + "memberName": "exists", + "nodeType": "MemberAccess", + "referencedDeclaration": 15961, + "src": "7638:11:61", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_struct$_State_$15663_memory_ptr_$returns$_t_bool_$attached_to$_t_struct$_State_$15663_memory_ptr_$", + "typeString": "function (struct Allocation.State memory) pure returns (bool)" + } + }, + "id": 15991, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "7638:13:61", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "&&", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 15995, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 15992, + "name": "self", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15984, + "src": "7655:4:61", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "id": 15993, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "7660:6:61", + "memberName": "tokens", + "nodeType": "MemberAccess", + "referencedDeclaration": 15650, + "src": "7655:11:61", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "30", + "id": 15994, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7670:1:61", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "7655:16:61", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "7638:33:61", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "functionReturnParameters": 15988, + "id": 15997, + "nodeType": "Return", + "src": "7631:40:61" + } + ] + }, + "documentation": { + "id": 15981, + "nodeType": "StructuredDocumentation", + "src": "7396:150:61", + "text": " @notice Checks if an allocation is alturistic\n @param self The allocation\n @return True if the allocation is alturistic" + }, + "id": 15999, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "isAltruistic", + "nameLocation": "7560:12:61", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 15985, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15984, + "mutability": "mutable", + "name": "self", + "nameLocation": "7586:4:61", + "nodeType": "VariableDeclaration", + "scope": 15999, + "src": "7573:17:61", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State" + }, + "typeName": { + "id": 15983, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 15982, + "name": "State", + "nameLocations": [ + "7573:5:61" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 15663, + "src": "7573:5:61" + }, + "referencedDeclaration": 15663, + "src": "7573:5:61", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_storage_ptr", + "typeString": "struct Allocation.State" + } + }, + "visibility": "internal" + } + ], + "src": "7572:19:61" + }, + "returnParameters": { + "id": 15988, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15987, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 15999, + "src": "7615:4:61", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 15986, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "7615:4:61", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "src": "7614:6:61" + }, + "scope": 16033, + "src": "7551:127:61", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 16031, + "nodeType": "Block", + "src": "8043:165:61", + "statements": [ + { + "assignments": [ + 16015 + ], + "declarations": [ + { + "constant": false, + "id": 16015, + "mutability": "mutable", + "name": "allocation", + "nameLocation": "8067:10:61", + "nodeType": "VariableDeclaration", + "scope": 16031, + "src": "8053:24:61", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_storage_ptr", + "typeString": "struct Allocation.State" + }, + "typeName": { + "id": 16014, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 16013, + "name": "State", + "nameLocations": [ + "8053:5:61" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 15663, + "src": "8053:5:61" + }, + "referencedDeclaration": 15663, + "src": "8053:5:61", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_storage_ptr", + "typeString": "struct Allocation.State" + } + }, + "visibility": "internal" + } + ], + "id": 16019, + "initialValue": { + "baseExpression": { + "id": 16016, + "name": "self", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16005, + "src": "8080:4:61", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_State_$15663_storage_$", + "typeString": "mapping(address => struct Allocation.State storage ref)" + } + }, + "id": 16018, + "indexExpression": { + "id": 16017, + "name": "allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16007, + "src": "8085:12:61", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "8080:18:61", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_storage", + "typeString": "struct Allocation.State storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "8053:45:61" + }, + { + "expression": { + "arguments": [ + { + "arguments": [], + "expression": { + "argumentTypes": [], + "expression": { + "id": 16021, + "name": "allocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16015, + "src": "8116:10:61", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_storage_ptr", + "typeString": "struct Allocation.State storage pointer" + } + }, + "id": 16022, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "8127:6:61", + "memberName": "exists", + "nodeType": "MemberAccess", + "referencedDeclaration": 15961, + "src": "8116:17:61", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_struct$_State_$15663_memory_ptr_$returns$_t_bool_$attached_to$_t_struct$_State_$15663_memory_ptr_$", + "typeString": "function (struct Allocation.State memory) pure returns (bool)" + } + }, + "id": 16023, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "8116:19:61", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [ + { + "id": 16025, + "name": "allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16007, + "src": "8160:12:61", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 16024, + "name": "AllocationDoesNotExist", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15673, + "src": "8137:22:61", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_address_$returns$_t_error_$", + "typeString": "function (address) pure returns (error)" + } + }, + "id": 16026, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "8137:36:61", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 16020, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "8108:7:61", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 16027, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "8108:66:61", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 16028, + "nodeType": "ExpressionStatement", + "src": "8108:66:61" + }, + { + "expression": { + "id": 16029, + "name": "allocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16015, + "src": "8191:10:61", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_storage_ptr", + "typeString": "struct Allocation.State storage pointer" + } + }, + "functionReturnParameters": 16012, + "id": 16030, + "nodeType": "Return", + "src": "8184:17:61" + } + ] + }, + "documentation": { + "id": 16000, + "nodeType": "StructuredDocumentation", + "src": "7684:241:61", + "text": " @notice Get the allocation for an allocation id\n @dev Reverts if the allocation does not exist\n @param self The allocation list mapping\n @param allocationId The allocation id\n @return The allocation" + }, + "id": 16032, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_get", + "nameLocation": "7939:4:61", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 16008, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 16005, + "mutability": "mutable", + "name": "self", + "nameLocation": "7978:4:61", + "nodeType": "VariableDeclaration", + "scope": 16032, + "src": "7944:38:61", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_State_$15663_storage_$", + "typeString": "mapping(address => struct Allocation.State)" + }, + "typeName": { + "id": 16004, + "keyName": "", + "keyNameLocation": "-1:-1:-1", + "keyType": { + "id": 16001, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "7952:7:61", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "7944:25:61", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_State_$15663_storage_$", + "typeString": "mapping(address => struct Allocation.State)" + }, + "valueName": "", + "valueNameLocation": "-1:-1:-1", + "valueType": { + "id": 16003, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 16002, + "name": "State", + "nameLocations": [ + "7963:5:61" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 15663, + "src": "7963:5:61" + }, + "referencedDeclaration": 15663, + "src": "7963:5:61", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_storage_ptr", + "typeString": "struct Allocation.State" + } + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 16007, + "mutability": "mutable", + "name": "allocationId", + "nameLocation": "7992:12:61", + "nodeType": "VariableDeclaration", + "scope": 16032, + "src": "7984:20:61", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 16006, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "7984:7:61", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "7943:62:61" + }, + "returnParameters": { + "id": 16012, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 16011, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 16032, + "src": "8028:13:61", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_storage_ptr", + "typeString": "struct Allocation.State" + }, + "typeName": { + "id": 16010, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 16009, + "name": "State", + "nameLocations": [ + "8028:5:61" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 15663, + "src": "8028:5:61" + }, + "referencedDeclaration": 15663, + "src": "8028:5:61", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_storage_ptr", + "typeString": "struct Allocation.State" + } + }, + "visibility": "internal" + } + ], + "src": "8027:15:61" + }, + "scope": 16033, + "src": "7930:278:61", + "stateMutability": "view", + "virtual": false, + "visibility": "private" + } + ], + "scope": 16034, + "src": "360:7850:61", + "usedErrors": [ + 15668, + 15673, + 15680 + ], + "usedEvents": [] + } + ], + "src": "45:8166:61" + }, + "id": 61 + }, + "contracts/libraries/Attestation.sol": { + "ast": { + "absolutePath": "contracts/libraries/Attestation.sol", + "exportedSymbols": { + "Attestation": [ + 16290 + ] + }, + "id": 16291, + "license": "GPL-3.0-or-later", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 16035, + "literals": [ + "solidity", + "0.8", + ".27" + ], + "nodeType": "PragmaDirective", + "src": "45:23:62" + }, + { + "abstract": false, + "baseContracts": [], + "canonicalName": "Attestation", + "contractDependencies": [], + "contractKind": "library", + "documentation": { + "id": 16036, + "nodeType": "StructuredDocumentation", + "src": "70:221:62", + "text": " @title Attestation library\n @notice A library to handle Attestation.\n @custom:security-contact Please email security+contracts@thegraph.com if you find any\n bugs. We may have an active bug bounty program." + }, + "fullyImplemented": true, + "id": 16290, + "linearizedBaseContracts": [ + 16290 + ], + "name": "Attestation", + "nameLocation": "300:11:62", + "nodeType": "ContractDefinition", + "nodes": [ + { + "canonicalName": "Attestation.Receipt", + "documentation": { + "id": 16037, + "nodeType": "StructuredDocumentation", + "src": "318:242:62", + "text": " @notice Receipt content sent from the service provider in response to request\n @param requestCID The request CID\n @param responseCID The response CID\n @param subgraphDeploymentId The subgraph deployment id" + }, + "id": 16044, + "members": [ + { + "constant": false, + "id": 16039, + "mutability": "mutable", + "name": "requestCID", + "nameLocation": "598:10:62", + "nodeType": "VariableDeclaration", + "scope": 16044, + "src": "590:18:62", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 16038, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "590:7:62", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 16041, + "mutability": "mutable", + "name": "responseCID", + "nameLocation": "626:11:62", + "nodeType": "VariableDeclaration", + "scope": 16044, + "src": "618:19:62", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 16040, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "618:7:62", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 16043, + "mutability": "mutable", + "name": "subgraphDeploymentId", + "nameLocation": "655:20:62", + "nodeType": "VariableDeclaration", + "scope": 16044, + "src": "647:28:62", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 16042, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "647:7:62", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "name": "Receipt", + "nameLocation": "572:7:62", + "nodeType": "StructDefinition", + "scope": 16290, + "src": "565:117:62", + "visibility": "public" + }, + { + "canonicalName": "Attestation.State", + "documentation": { + "id": 16045, + "nodeType": "StructuredDocumentation", + "src": "688:375:62", + "text": " @notice Attestation sent from the service provider in response to a request\n @param requestCID The request CID\n @param responseCID The response CID\n @param subgraphDeploymentId The subgraph deployment id\n @param r The r value of the signature\n @param s The s value of the signature\n @param v The v value of the signature" + }, + "id": 16058, + "members": [ + { + "constant": false, + "id": 16047, + "mutability": "mutable", + "name": "requestCID", + "nameLocation": "1099:10:62", + "nodeType": "VariableDeclaration", + "scope": 16058, + "src": "1091:18:62", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 16046, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1091:7:62", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 16049, + "mutability": "mutable", + "name": "responseCID", + "nameLocation": "1127:11:62", + "nodeType": "VariableDeclaration", + "scope": 16058, + "src": "1119:19:62", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 16048, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1119:7:62", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 16051, + "mutability": "mutable", + "name": "subgraphDeploymentId", + "nameLocation": "1156:20:62", + "nodeType": "VariableDeclaration", + "scope": 16058, + "src": "1148:28:62", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 16050, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1148:7:62", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 16053, + "mutability": "mutable", + "name": "r", + "nameLocation": "1194:1:62", + "nodeType": "VariableDeclaration", + "scope": 16058, + "src": "1186:9:62", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 16052, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1186:7:62", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 16055, + "mutability": "mutable", + "name": "s", + "nameLocation": "1213:1:62", + "nodeType": "VariableDeclaration", + "scope": 16058, + "src": "1205:9:62", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 16054, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1205:7:62", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 16057, + "mutability": "mutable", + "name": "v", + "nameLocation": "1230:1:62", + "nodeType": "VariableDeclaration", + "scope": 16058, + "src": "1224:7:62", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "typeName": { + "id": 16056, + "name": "uint8", + "nodeType": "ElementaryTypeName", + "src": "1224:5:62", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "visibility": "internal" + } + ], + "name": "State", + "nameLocation": "1075:5:62", + "nodeType": "StructDefinition", + "scope": 16290, + "src": "1068:170:62", + "visibility": "public" + }, + { + "constant": true, + "documentation": { + "id": 16059, + "nodeType": "StructuredDocumentation", + "src": "1244:76:62", + "text": "@notice Attestation size is the sum of the receipt (96) + signature (65)" + }, + "id": 16062, + "mutability": "constant", + "name": "RECEIPT_SIZE_BYTES", + "nameLocation": "1350:18:62", + "nodeType": "VariableDeclaration", + "scope": 16290, + "src": "1325:48:62", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 16060, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1325:7:62", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": { + "hexValue": "3936", + "id": 16061, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1371:2:62", + "typeDescriptions": { + "typeIdentifier": "t_rational_96_by_1", + "typeString": "int_const 96" + }, + "value": "96" + }, + "visibility": "private" + }, + { + "constant": true, + "documentation": { + "id": 16063, + "nodeType": "StructuredDocumentation", + "src": "1380:54:62", + "text": "@notice The length of the r value of the signature" + }, + "id": 16066, + "mutability": "constant", + "name": "SIG_R_LENGTH", + "nameLocation": "1464:12:62", + "nodeType": "VariableDeclaration", + "scope": 16290, + "src": "1439:42:62", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 16064, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1439:7:62", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": { + "hexValue": "3332", + "id": 16065, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1479:2:62", + "typeDescriptions": { + "typeIdentifier": "t_rational_32_by_1", + "typeString": "int_const 32" + }, + "value": "32" + }, + "visibility": "private" + }, + { + "constant": true, + "documentation": { + "id": 16067, + "nodeType": "StructuredDocumentation", + "src": "1488:54:62", + "text": "@notice The length of the s value of the signature" + }, + "id": 16070, + "mutability": "constant", + "name": "SIG_S_LENGTH", + "nameLocation": "1572:12:62", + "nodeType": "VariableDeclaration", + "scope": 16290, + "src": "1547:42:62", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 16068, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1547:7:62", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": { + "hexValue": "3332", + "id": 16069, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1587:2:62", + "typeDescriptions": { + "typeIdentifier": "t_rational_32_by_1", + "typeString": "int_const 32" + }, + "value": "32" + }, + "visibility": "private" + }, + { + "constant": true, + "documentation": { + "id": 16071, + "nodeType": "StructuredDocumentation", + "src": "1596:54:62", + "text": "@notice The length of the v value of the signature" + }, + "id": 16074, + "mutability": "constant", + "name": "SIG_V_LENGTH", + "nameLocation": "1680:12:62", + "nodeType": "VariableDeclaration", + "scope": 16290, + "src": "1655:41:62", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 16072, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1655:7:62", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": { + "hexValue": "31", + "id": 16073, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1695:1:62", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "visibility": "private" + }, + { + "constant": true, + "documentation": { + "id": 16075, + "nodeType": "StructuredDocumentation", + "src": "1703:54:62", + "text": "@notice The offset of the r value of the signature" + }, + "id": 16078, + "mutability": "constant", + "name": "SIG_R_OFFSET", + "nameLocation": "1787:12:62", + "nodeType": "VariableDeclaration", + "scope": 16290, + "src": "1762:58:62", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 16076, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1762:7:62", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": { + "id": 16077, + "name": "RECEIPT_SIZE_BYTES", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16062, + "src": "1802:18:62", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "private" + }, + { + "constant": true, + "documentation": { + "id": 16079, + "nodeType": "StructuredDocumentation", + "src": "1827:54:62", + "text": "@notice The offset of the s value of the signature" + }, + "id": 16084, + "mutability": "constant", + "name": "SIG_S_OFFSET", + "nameLocation": "1911:12:62", + "nodeType": "VariableDeclaration", + "scope": 16290, + "src": "1886:73:62", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 16080, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1886:7:62", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 16083, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "leftExpression": { + "id": 16081, + "name": "RECEIPT_SIZE_BYTES", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16062, + "src": "1926:18:62", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "id": 16082, + "name": "SIG_R_LENGTH", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16066, + "src": "1947:12:62", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "1926:33:62", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "private" + }, + { + "constant": true, + "documentation": { + "id": 16085, + "nodeType": "StructuredDocumentation", + "src": "1966:54:62", + "text": "@notice The offset of the v value of the signature" + }, + "id": 16092, + "mutability": "constant", + "name": "SIG_V_OFFSET", + "nameLocation": "2050:12:62", + "nodeType": "VariableDeclaration", + "scope": 16290, + "src": "2025:88:62", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 16086, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2025:7:62", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 16091, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "leftExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 16089, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "leftExpression": { + "id": 16087, + "name": "RECEIPT_SIZE_BYTES", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16062, + "src": "2065:18:62", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "id": 16088, + "name": "SIG_R_LENGTH", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16066, + "src": "2086:12:62", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "2065:33:62", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "id": 16090, + "name": "SIG_S_LENGTH", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16070, + "src": "2101:12:62", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "2065:48:62", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "private" + }, + { + "constant": true, + "documentation": { + "id": 16093, + "nodeType": "StructuredDocumentation", + "src": "2120:37:62", + "text": "@notice The size of the signature" + }, + "id": 16100, + "mutability": "constant", + "name": "SIG_SIZE_BYTES", + "nameLocation": "2187:14:62", + "nodeType": "VariableDeclaration", + "scope": 16290, + "src": "2162:84:62", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 16094, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2162:7:62", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 16099, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "leftExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 16097, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "leftExpression": { + "id": 16095, + "name": "SIG_R_LENGTH", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16066, + "src": "2204:12:62", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "id": 16096, + "name": "SIG_S_LENGTH", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16070, + "src": "2219:12:62", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "2204:27:62", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "id": 16098, + "name": "SIG_V_LENGTH", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16074, + "src": "2234:12:62", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "2204:42:62", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "private" + }, + { + "constant": true, + "documentation": { + "id": 16101, + "nodeType": "StructuredDocumentation", + "src": "2253:39:62", + "text": "@notice The size of the attestation" + }, + "id": 16106, + "mutability": "constant", + "name": "ATTESTATION_SIZE_BYTES", + "nameLocation": "2322:22:62", + "nodeType": "VariableDeclaration", + "scope": 16290, + "src": "2297:85:62", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 16102, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2297:7:62", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 16105, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "leftExpression": { + "id": 16103, + "name": "RECEIPT_SIZE_BYTES", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16062, + "src": "2347:18:62", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "id": 16104, + "name": "SIG_SIZE_BYTES", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16100, + "src": "2368:14:62", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "2347:35:62", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "private" + }, + { + "constant": true, + "documentation": { + "id": 16107, + "nodeType": "StructuredDocumentation", + "src": "2389:41:62", + "text": "@notice The length of the uint8 value" + }, + "id": 16110, + "mutability": "constant", + "name": "UINT8_BYTE_LENGTH", + "nameLocation": "2460:17:62", + "nodeType": "VariableDeclaration", + "scope": 16290, + "src": "2435:46:62", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 16108, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2435:7:62", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": { + "hexValue": "31", + "id": 16109, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2480:1:62", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "visibility": "private" + }, + { + "constant": true, + "documentation": { + "id": 16111, + "nodeType": "StructuredDocumentation", + "src": "2488:43:62", + "text": "@notice The length of the bytes32 value" + }, + "id": 16114, + "mutability": "constant", + "name": "BYTES32_BYTE_LENGTH", + "nameLocation": "2561:19:62", + "nodeType": "VariableDeclaration", + "scope": 16290, + "src": "2536:49:62", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 16112, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2536:7:62", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": { + "hexValue": "3332", + "id": 16113, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2583:2:62", + "typeDescriptions": { + "typeIdentifier": "t_rational_32_by_1", + "typeString": "int_const 32" + }, + "value": "32" + }, + "visibility": "private" + }, + { + "documentation": { + "id": 16115, + "nodeType": "StructuredDocumentation", + "src": "2592:216:62", + "text": " @notice The error thrown when the attestation data length is invalid\n @param length The length of the attestation data\n @param expectedLength The expected length of the attestation data" + }, + "errorSelector": "3fdf3423", + "id": 16121, + "name": "AttestationInvalidBytesLength", + "nameLocation": "2819:29:62", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 16120, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 16117, + "mutability": "mutable", + "name": "length", + "nameLocation": "2857:6:62", + "nodeType": "VariableDeclaration", + "scope": 16121, + "src": "2849:14:62", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 16116, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2849:7:62", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 16119, + "mutability": "mutable", + "name": "expectedLength", + "nameLocation": "2873:14:62", + "nodeType": "VariableDeclaration", + "scope": 16121, + "src": "2865:22:62", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 16118, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2865:7:62", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "2848:40:62" + }, + "src": "2813:76:62" + }, + { + "body": { + "id": 16152, + "nodeType": "Block", + "src": "3319:236:62", + "statements": [ + { + "expression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 16149, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 16143, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "commonType": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "id": 16137, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 16133, + "name": "_attestation1", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16125, + "src": "3337:13:62", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16058_memory_ptr", + "typeString": "struct Attestation.State memory" + } + }, + "id": 16134, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "3351:10:62", + "memberName": "requestCID", + "nodeType": "MemberAccess", + "referencedDeclaration": 16047, + "src": "3337:24:62", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "expression": { + "id": 16135, + "name": "_attestation2", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16128, + "src": "3365:13:62", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16058_memory_ptr", + "typeString": "struct Attestation.State memory" + } + }, + "id": 16136, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "3379:10:62", + "memberName": "requestCID", + "nodeType": "MemberAccess", + "referencedDeclaration": 16047, + "src": "3365:24:62", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "src": "3337:52:62", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "&&", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "id": 16142, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 16138, + "name": "_attestation1", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16125, + "src": "3405:13:62", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16058_memory_ptr", + "typeString": "struct Attestation.State memory" + } + }, + "id": 16139, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "3419:20:62", + "memberName": "subgraphDeploymentId", + "nodeType": "MemberAccess", + "referencedDeclaration": 16051, + "src": "3405:34:62", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "expression": { + "id": 16140, + "name": "_attestation2", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16128, + "src": "3443:13:62", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16058_memory_ptr", + "typeString": "struct Attestation.State memory" + } + }, + "id": 16141, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "3457:20:62", + "memberName": "subgraphDeploymentId", + "nodeType": "MemberAccess", + "referencedDeclaration": 16051, + "src": "3443:34:62", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "src": "3405:72:62", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "3337:140:62", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "&&", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "id": 16148, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 16144, + "name": "_attestation1", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16125, + "src": "3493:13:62", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16058_memory_ptr", + "typeString": "struct Attestation.State memory" + } + }, + "id": 16145, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "3507:11:62", + "memberName": "responseCID", + "nodeType": "MemberAccess", + "referencedDeclaration": 16049, + "src": "3493:25:62", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "expression": { + "id": 16146, + "name": "_attestation2", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16128, + "src": "3522:13:62", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16058_memory_ptr", + "typeString": "struct Attestation.State memory" + } + }, + "id": 16147, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "3536:11:62", + "memberName": "responseCID", + "nodeType": "MemberAccess", + "referencedDeclaration": 16049, + "src": "3522:25:62", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "src": "3493:54:62", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "3337:210:62", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "id": 16150, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "3336:212:62", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "functionReturnParameters": 16132, + "id": 16151, + "nodeType": "Return", + "src": "3329:219:62" + } + ] + }, + "documentation": { + "id": 16122, + "nodeType": "StructuredDocumentation", + "src": "2895:264:62", + "text": " @dev Returns if two attestations are conflicting.\n Everything must match except for the responseId.\n @param _attestation1 Attestation\n @param _attestation2 Attestation\n @return True if the two attestations are conflicting" + }, + "id": 16153, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "areConflicting", + "nameLocation": "3173:14:62", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 16129, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 16125, + "mutability": "mutable", + "name": "_attestation1", + "nameLocation": "3222:13:62", + "nodeType": "VariableDeclaration", + "scope": 16153, + "src": "3197:38:62", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16058_memory_ptr", + "typeString": "struct Attestation.State" + }, + "typeName": { + "id": 16124, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 16123, + "name": "Attestation.State", + "nameLocations": [ + "3197:11:62", + "3209:5:62" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 16058, + "src": "3197:17:62" + }, + "referencedDeclaration": 16058, + "src": "3197:17:62", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16058_storage_ptr", + "typeString": "struct Attestation.State" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 16128, + "mutability": "mutable", + "name": "_attestation2", + "nameLocation": "3270:13:62", + "nodeType": "VariableDeclaration", + "scope": 16153, + "src": "3245:38:62", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16058_memory_ptr", + "typeString": "struct Attestation.State" + }, + "typeName": { + "id": 16127, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 16126, + "name": "Attestation.State", + "nameLocations": [ + "3245:11:62", + "3257:5:62" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 16058, + "src": "3245:17:62" + }, + "referencedDeclaration": 16058, + "src": "3245:17:62", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16058_storage_ptr", + "typeString": "struct Attestation.State" + } + }, + "visibility": "internal" + } + ], + "src": "3187:102:62" + }, + "returnParameters": { + "id": 16132, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 16131, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 16153, + "src": "3313:4:62", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 16130, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "3313:4:62", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "src": "3312:6:62" + }, + "scope": 16290, + "src": "3164:391:62", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 16222, + "nodeType": "Block", + "src": "3790:748:62", + "statements": [ + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 16166, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 16163, + "name": "_data", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16156, + "src": "3862:5:62", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 16164, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "3868:6:62", + "memberName": "length", + "nodeType": "MemberAccess", + "src": "3862:12:62", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "id": 16165, + "name": "ATTESTATION_SIZE_BYTES", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16106, + "src": "3878:22:62", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "3862:38:62", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [ + { + "expression": { + "id": 16168, + "name": "_data", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16156, + "src": "3944:5:62", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 16169, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "3950:6:62", + "memberName": "length", + "nodeType": "MemberAccess", + "src": "3944:12:62", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 16170, + "name": "ATTESTATION_SIZE_BYTES", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16106, + "src": "3958:22:62", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 16167, + "name": "AttestationInvalidBytesLength", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16121, + "src": "3914:29:62", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint256_$_t_uint256_$returns$_t_error_$", + "typeString": "function (uint256,uint256) pure returns (error)" + } + }, + "id": 16171, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3914:67:62", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 16162, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "3841:7:62", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 16172, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3841:150:62", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 16173, + "nodeType": "ExpressionStatement", + "src": "3841:150:62" + }, + { + "assignments": [ + 16175, + 16177, + 16179 + ], + "declarations": [ + { + "constant": false, + "id": 16175, + "mutability": "mutable", + "name": "requestCID", + "nameLocation": "4037:10:62", + "nodeType": "VariableDeclaration", + "scope": 16222, + "src": "4029:18:62", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 16174, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "4029:7:62", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 16177, + "mutability": "mutable", + "name": "responseCID", + "nameLocation": "4057:11:62", + "nodeType": "VariableDeclaration", + "scope": 16222, + "src": "4049:19:62", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 16176, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "4049:7:62", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 16179, + "mutability": "mutable", + "name": "subgraphDeploymentId", + "nameLocation": "4078:20:62", + "nodeType": "VariableDeclaration", + "scope": 16222, + "src": "4070:28:62", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 16178, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "4070:7:62", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "id": 16191, + "initialValue": { + "arguments": [ + { + "id": 16182, + "name": "_data", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16156, + "src": "4126:5:62", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + { + "components": [ + { + "id": 16184, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "4146:7:62", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes32_$", + "typeString": "type(bytes32)" + }, + "typeName": { + "id": 16183, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "4146:7:62", + "typeDescriptions": {} + } + }, + { + "id": 16186, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "4155:7:62", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes32_$", + "typeString": "type(bytes32)" + }, + "typeName": { + "id": 16185, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "4155:7:62", + "typeDescriptions": {} + } + }, + { + "id": 16188, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "4164:7:62", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes32_$", + "typeString": "type(bytes32)" + }, + "typeName": { + "id": 16187, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "4164:7:62", + "typeDescriptions": {} + } + } + ], + "id": 16189, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "4145:27:62", + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_type$_t_bytes32_$_$_t_type$_t_bytes32_$_$_t_type$_t_bytes32_$_$", + "typeString": "tuple(type(bytes32),type(bytes32),type(bytes32))" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + }, + { + "typeIdentifier": "t_tuple$_t_type$_t_bytes32_$_$_t_type$_t_bytes32_$_$_t_type$_t_bytes32_$_$", + "typeString": "tuple(type(bytes32),type(bytes32),type(bytes32))" + } + ], + "expression": { + "id": 16180, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -1, + "src": "4102:3:62", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 16181, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "4106:6:62", + "memberName": "decode", + "nodeType": "MemberAccess", + "src": "4102:10:62", + "typeDescriptions": { + "typeIdentifier": "t_function_abidecode_pure$__$returns$__$", + "typeString": "function () pure" + } + }, + "id": 16190, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4102:80:62", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_bytes32_$_t_bytes32_$_t_bytes32_$", + "typeString": "tuple(bytes32,bytes32,bytes32)" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "4028:154:62" + }, + { + "assignments": [ + 16193 + ], + "declarations": [ + { + "constant": false, + "id": 16193, + "mutability": "mutable", + "name": "r", + "nameLocation": "4315:1:62", + "nodeType": "VariableDeclaration", + "scope": 16222, + "src": "4307:9:62", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 16192, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "4307:7:62", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "id": 16198, + "initialValue": { + "arguments": [ + { + "id": 16195, + "name": "_data", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16156, + "src": "4330:5:62", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + { + "id": 16196, + "name": "SIG_R_OFFSET", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16078, + "src": "4337:12:62", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 16194, + "name": "_toBytes32", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16289, + "src": "4319:10:62", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$_t_uint256_$returns$_t_bytes32_$", + "typeString": "function (bytes memory,uint256) pure returns (bytes32)" + } + }, + "id": 16197, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4319:31:62", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "4307:43:62" + }, + { + "assignments": [ + 16200 + ], + "declarations": [ + { + "constant": false, + "id": 16200, + "mutability": "mutable", + "name": "s", + "nameLocation": "4368:1:62", + "nodeType": "VariableDeclaration", + "scope": 16222, + "src": "4360:9:62", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 16199, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "4360:7:62", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "id": 16205, + "initialValue": { + "arguments": [ + { + "id": 16202, + "name": "_data", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16156, + "src": "4383:5:62", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + { + "id": 16203, + "name": "SIG_S_OFFSET", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16084, + "src": "4390:12:62", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 16201, + "name": "_toBytes32", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16289, + "src": "4372:10:62", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$_t_uint256_$returns$_t_bytes32_$", + "typeString": "function (bytes memory,uint256) pure returns (bytes32)" + } + }, + "id": 16204, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4372:31:62", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "4360:43:62" + }, + { + "assignments": [ + 16207 + ], + "declarations": [ + { + "constant": false, + "id": 16207, + "mutability": "mutable", + "name": "v", + "nameLocation": "4419:1:62", + "nodeType": "VariableDeclaration", + "scope": 16222, + "src": "4413:7:62", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "typeName": { + "id": 16206, + "name": "uint8", + "nodeType": "ElementaryTypeName", + "src": "4413:5:62", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "visibility": "internal" + } + ], + "id": 16212, + "initialValue": { + "arguments": [ + { + "id": 16209, + "name": "_data", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16156, + "src": "4432:5:62", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + { + "id": 16210, + "name": "SIG_V_OFFSET", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16092, + "src": "4439:12:62", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 16208, + "name": "_toUint8", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16256, + "src": "4423:8:62", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$_t_uint256_$returns$_t_uint8_$", + "typeString": "function (bytes memory,uint256) pure returns (uint8)" + } + }, + "id": 16211, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4423:29:62", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "4413:39:62" + }, + { + "expression": { + "arguments": [ + { + "id": 16214, + "name": "requestCID", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16175, + "src": "4476:10:62", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "id": 16215, + "name": "responseCID", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16177, + "src": "4488:11:62", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "id": 16216, + "name": "subgraphDeploymentId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16179, + "src": "4501:20:62", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "id": 16217, + "name": "r", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16193, + "src": "4523:1:62", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "id": 16218, + "name": "s", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16200, + "src": "4526:1:62", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "id": 16219, + "name": "v", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16207, + "src": "4529:1:62", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + ], + "id": 16213, + "name": "State", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16058, + "src": "4470:5:62", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_struct$_State_$16058_storage_ptr_$", + "typeString": "type(struct Attestation.State storage pointer)" + } + }, + "id": 16220, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "structConstructorCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4470:61:62", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16058_memory_ptr", + "typeString": "struct Attestation.State memory" + } + }, + "functionReturnParameters": 16161, + "id": 16221, + "nodeType": "Return", + "src": "4463:68:62" + } + ] + }, + "documentation": { + "id": 16154, + "nodeType": "StructuredDocumentation", + "src": "3561:152:62", + "text": " @dev Parse the bytes attestation into a struct from `_data`.\n @param _data The bytes to parse\n @return Attestation struct" + }, + "id": 16223, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "parse", + "nameLocation": "3727:5:62", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 16157, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 16156, + "mutability": "mutable", + "name": "_data", + "nameLocation": "3746:5:62", + "nodeType": "VariableDeclaration", + "scope": 16223, + "src": "3733:18:62", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 16155, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "3733:5:62", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "src": "3732:20:62" + }, + "returnParameters": { + "id": 16161, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 16160, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 16223, + "src": "3776:12:62", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16058_memory_ptr", + "typeString": "struct Attestation.State" + }, + "typeName": { + "id": 16159, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 16158, + "name": "State", + "nameLocations": [ + "3776:5:62" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 16058, + "src": "3776:5:62" + }, + "referencedDeclaration": 16058, + "src": "3776:5:62", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16058_storage_ptr", + "typeString": "struct Attestation.State" + } + }, + "visibility": "internal" + } + ], + "src": "3775:14:62" + }, + "scope": 16290, + "src": "3718:820:62", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 16255, + "nodeType": "Block", + "src": "4818:584:62", + "statements": [ + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 16239, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 16234, + "name": "_bytes", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16226, + "src": "4849:6:62", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 16235, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "4856:6:62", + "memberName": "length", + "nodeType": "MemberAccess", + "src": "4849:13:62", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 16238, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 16236, + "name": "_start", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16228, + "src": "4866:6:62", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "id": 16237, + "name": "UINT8_BYTE_LENGTH", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16110, + "src": "4875:17:62", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "4866:26:62", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "4849:43:62", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [ + { + "expression": { + "id": 16241, + "name": "_bytes", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16226, + "src": "4936:6:62", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 16242, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "4943:6:62", + "memberName": "length", + "nodeType": "MemberAccess", + "src": "4936:13:62", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 16245, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 16243, + "name": "_start", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16228, + "src": "4951:6:62", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "id": 16244, + "name": "UINT8_BYTE_LENGTH", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16110, + "src": "4960:17:62", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "4951:26:62", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 16240, + "name": "AttestationInvalidBytesLength", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16121, + "src": "4906:29:62", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint256_$_t_uint256_$returns$_t_error_$", + "typeString": "function (uint256,uint256) pure returns (error)" + } + }, + "id": 16246, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4906:72:62", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 16233, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "4828:7:62", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 16247, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4828:160:62", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 16248, + "nodeType": "ExpressionStatement", + "src": "4828:160:62" + }, + { + "assignments": [ + 16250 + ], + "declarations": [ + { + "constant": false, + "id": 16250, + "mutability": "mutable", + "name": "tempUint", + "nameLocation": "5004:8:62", + "nodeType": "VariableDeclaration", + "scope": 16255, + "src": "4998:14:62", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "typeName": { + "id": 16249, + "name": "uint8", + "nodeType": "ElementaryTypeName", + "src": "4998:5:62", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "visibility": "internal" + } + ], + "id": 16251, + "nodeType": "VariableDeclarationStatement", + "src": "4998:14:62" + }, + { + "AST": { + "nativeSrc": "5088:282:62", + "nodeType": "YulBlock", + "src": "5088:282:62", + "statements": [ + { + "nativeSrc": "5312:48:62", + "nodeType": "YulAssignment", + "src": "5312:48:62", + "value": { + "arguments": [ + { + "arguments": [ + { + "arguments": [ + { + "name": "_bytes", + "nativeSrc": "5338:6:62", + "nodeType": "YulIdentifier", + "src": "5338:6:62" + }, + { + "kind": "number", + "nativeSrc": "5346:3:62", + "nodeType": "YulLiteral", + "src": "5346:3:62", + "type": "", + "value": "0x1" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "5334:3:62", + "nodeType": "YulIdentifier", + "src": "5334:3:62" + }, + "nativeSrc": "5334:16:62", + "nodeType": "YulFunctionCall", + "src": "5334:16:62" + }, + { + "name": "_start", + "nativeSrc": "5352:6:62", + "nodeType": "YulIdentifier", + "src": "5352:6:62" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "5330:3:62", + "nodeType": "YulIdentifier", + "src": "5330:3:62" + }, + "nativeSrc": "5330:29:62", + "nodeType": "YulFunctionCall", + "src": "5330:29:62" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "5324:5:62", + "nodeType": "YulIdentifier", + "src": "5324:5:62" + }, + "nativeSrc": "5324:36:62", + "nodeType": "YulFunctionCall", + "src": "5324:36:62" + }, + "variableNames": [ + { + "name": "tempUint", + "nativeSrc": "5312:8:62", + "nodeType": "YulIdentifier", + "src": "5312:8:62" + } + ] + } + ] + }, + "evmVersion": "paris", + "externalReferences": [ + { + "declaration": 16226, + "isOffset": false, + "isSlot": false, + "src": "5338:6:62", + "valueSize": 1 + }, + { + "declaration": 16228, + "isOffset": false, + "isSlot": false, + "src": "5352:6:62", + "valueSize": 1 + }, + { + "declaration": 16250, + "isOffset": false, + "isSlot": false, + "src": "5312:8:62", + "valueSize": 1 + } + ], + "id": 16252, + "nodeType": "InlineAssembly", + "src": "5079:291:62" + }, + { + "expression": { + "id": 16253, + "name": "tempUint", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16250, + "src": "5387:8:62", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "functionReturnParameters": 16232, + "id": 16254, + "nodeType": "Return", + "src": "5380:15:62" + } + ] + }, + "documentation": { + "id": 16224, + "nodeType": "StructuredDocumentation", + "src": "4544:185:62", + "text": " @dev Parse a uint8 from `_bytes` starting at offset `_start`.\n @param _bytes The bytes to parse\n @param _start The start offset\n @return uint8 value" + }, + "id": 16256, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_toUint8", + "nameLocation": "4743:8:62", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 16229, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 16226, + "mutability": "mutable", + "name": "_bytes", + "nameLocation": "4765:6:62", + "nodeType": "VariableDeclaration", + "scope": 16256, + "src": "4752:19:62", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 16225, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "4752:5:62", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 16228, + "mutability": "mutable", + "name": "_start", + "nameLocation": "4781:6:62", + "nodeType": "VariableDeclaration", + "scope": 16256, + "src": "4773:14:62", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 16227, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "4773:7:62", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "4751:37:62" + }, + "returnParameters": { + "id": 16232, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 16231, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 16256, + "src": "4811:5:62", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "typeName": { + "id": 16230, + "name": "uint8", + "nodeType": "ElementaryTypeName", + "src": "4811:5:62", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "visibility": "internal" + } + ], + "src": "4810:7:62" + }, + "scope": 16290, + "src": "4734:668:62", + "stateMutability": "pure", + "virtual": false, + "visibility": "private" + }, + { + "body": { + "id": 16288, + "nodeType": "Block", + "src": "5690:390:62", + "statements": [ + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 16272, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 16267, + "name": "_bytes", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16259, + "src": "5721:6:62", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 16268, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "5728:6:62", + "memberName": "length", + "nodeType": "MemberAccess", + "src": "5721:13:62", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 16271, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 16269, + "name": "_start", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16261, + "src": "5738:6:62", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "id": 16270, + "name": "BYTES32_BYTE_LENGTH", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16114, + "src": "5747:19:62", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "5738:28:62", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "5721:45:62", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [ + { + "expression": { + "id": 16274, + "name": "_bytes", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16259, + "src": "5810:6:62", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 16275, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "5817:6:62", + "memberName": "length", + "nodeType": "MemberAccess", + "src": "5810:13:62", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 16278, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 16276, + "name": "_start", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16261, + "src": "5825:6:62", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "id": 16277, + "name": "BYTES32_BYTE_LENGTH", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16114, + "src": "5834:19:62", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "5825:28:62", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 16273, + "name": "AttestationInvalidBytesLength", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16121, + "src": "5780:29:62", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_uint256_$_t_uint256_$returns$_t_error_$", + "typeString": "function (uint256,uint256) pure returns (error)" + } + }, + "id": 16279, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5780:74:62", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 16266, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "5700:7:62", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 16280, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5700:164:62", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 16281, + "nodeType": "ExpressionStatement", + "src": "5700:164:62" + }, + { + "assignments": [ + 16283 + ], + "declarations": [ + { + "constant": false, + "id": 16283, + "mutability": "mutable", + "name": "tempBytes32", + "nameLocation": "5882:11:62", + "nodeType": "VariableDeclaration", + "scope": 16288, + "src": "5874:19:62", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 16282, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "5874:7:62", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "id": 16284, + "nodeType": "VariableDeclarationStatement", + "src": "5874:19:62" + }, + { + "AST": { + "nativeSrc": "5969:76:62", + "nodeType": "YulBlock", + "src": "5969:76:62", + "statements": [ + { + "nativeSrc": "5983:52:62", + "nodeType": "YulAssignment", + "src": "5983:52:62", + "value": { + "arguments": [ + { + "arguments": [ + { + "arguments": [ + { + "name": "_bytes", + "nativeSrc": "6012:6:62", + "nodeType": "YulIdentifier", + "src": "6012:6:62" + }, + { + "kind": "number", + "nativeSrc": "6020:4:62", + "nodeType": "YulLiteral", + "src": "6020:4:62", + "type": "", + "value": "0x20" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "6008:3:62", + "nodeType": "YulIdentifier", + "src": "6008:3:62" + }, + "nativeSrc": "6008:17:62", + "nodeType": "YulFunctionCall", + "src": "6008:17:62" + }, + { + "name": "_start", + "nativeSrc": "6027:6:62", + "nodeType": "YulIdentifier", + "src": "6027:6:62" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "6004:3:62", + "nodeType": "YulIdentifier", + "src": "6004:3:62" + }, + "nativeSrc": "6004:30:62", + "nodeType": "YulFunctionCall", + "src": "6004:30:62" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "5998:5:62", + "nodeType": "YulIdentifier", + "src": "5998:5:62" + }, + "nativeSrc": "5998:37:62", + "nodeType": "YulFunctionCall", + "src": "5998:37:62" + }, + "variableNames": [ + { + "name": "tempBytes32", + "nativeSrc": "5983:11:62", + "nodeType": "YulIdentifier", + "src": "5983:11:62" + } + ] + } + ] + }, + "evmVersion": "paris", + "externalReferences": [ + { + "declaration": 16259, + "isOffset": false, + "isSlot": false, + "src": "6012:6:62", + "valueSize": 1 + }, + { + "declaration": 16261, + "isOffset": false, + "isSlot": false, + "src": "6027:6:62", + "valueSize": 1 + }, + { + "declaration": 16283, + "isOffset": false, + "isSlot": false, + "src": "5983:11:62", + "valueSize": 1 + } + ], + "id": 16285, + "nodeType": "InlineAssembly", + "src": "5960:85:62" + }, + { + "expression": { + "id": 16286, + "name": "tempBytes32", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16283, + "src": "6062:11:62", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "functionReturnParameters": 16265, + "id": 16287, + "nodeType": "Return", + "src": "6055:18:62" + } + ] + }, + "documentation": { + "id": 16257, + "nodeType": "StructuredDocumentation", + "src": "5408:189:62", + "text": " @dev Parse a bytes32 from `_bytes` starting at offset `_start`.\n @param _bytes The bytes to parse\n @param _start The start offset\n @return bytes32 value" + }, + "id": 16289, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_toBytes32", + "nameLocation": "5611:10:62", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 16262, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 16259, + "mutability": "mutable", + "name": "_bytes", + "nameLocation": "5635:6:62", + "nodeType": "VariableDeclaration", + "scope": 16289, + "src": "5622:19:62", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 16258, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "5622:5:62", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 16261, + "mutability": "mutable", + "name": "_start", + "nameLocation": "5651:6:62", + "nodeType": "VariableDeclaration", + "scope": 16289, + "src": "5643:14:62", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 16260, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "5643:7:62", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "5621:37:62" + }, + "returnParameters": { + "id": 16265, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 16264, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 16289, + "src": "5681:7:62", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 16263, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "5681:7:62", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "5680:9:62" + }, + "scope": 16290, + "src": "5602:478:62", + "stateMutability": "pure", + "virtual": false, + "visibility": "private" + } + ], + "scope": 16291, + "src": "292:5790:62", + "usedErrors": [ + 16121 + ], + "usedEvents": [] + } + ], + "src": "45:6038:62" + }, + "id": 62 + }, + "contracts/libraries/LegacyAllocation.sol": { + "ast": { + "absolutePath": "contracts/libraries/LegacyAllocation.sol", + "exportedSymbols": { + "IHorizonStaking": [ + 2625 + ], + "LegacyAllocation": [ + 16462 + ] + }, + "id": 16463, + "license": "GPL-3.0-or-later", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 16292, + "literals": [ + "solidity", + "0.8", + ".27" + ], + "nodeType": "PragmaDirective", + "src": "45:23:63" + }, + { + "absolutePath": "@graphprotocol/horizon/contracts/interfaces/IHorizonStaking.sol", + "file": "@graphprotocol/horizon/contracts/interfaces/IHorizonStaking.sol", + "id": 16294, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 16463, + "sourceUnit": 2626, + "src": "70:98:63", + "symbolAliases": [ + { + "foreign": { + "id": 16293, + "name": "IHorizonStaking", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2625, + "src": "79:15:63", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "abstract": false, + "baseContracts": [], + "canonicalName": "LegacyAllocation", + "contractDependencies": [], + "contractKind": "library", + "documentation": { + "id": 16295, + "nodeType": "StructuredDocumentation", + "src": "170:233:63", + "text": " @title LegacyAllocation library\n @notice A library to handle legacy Allocations.\n @custom:security-contact Please email security+contracts@thegraph.com if you find any\n bugs. We may have an active bug bounty program." + }, + "fullyImplemented": true, + "id": 16462, + "linearizedBaseContracts": [ + 16462 + ], + "name": "LegacyAllocation", + "nameLocation": "412:16:63", + "nodeType": "ContractDefinition", + "nodes": [ + { + "global": false, + "id": 16299, + "libraryName": { + "id": 16296, + "name": "LegacyAllocation", + "nameLocations": [ + "441:16:63" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 16462, + "src": "441:16:63" + }, + "nodeType": "UsingForDirective", + "src": "435:33:63", + "typeName": { + "id": 16298, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 16297, + "name": "State", + "nameLocations": [ + "462:5:63" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 16305, + "src": "462:5:63" + }, + "referencedDeclaration": 16305, + "src": "462:5:63", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16305_storage_ptr", + "typeString": "struct LegacyAllocation.State" + } + } + }, + { + "canonicalName": "LegacyAllocation.State", + "documentation": { + "id": 16300, + "nodeType": "StructuredDocumentation", + "src": "474:450:63", + "text": " @notice Legacy allocation details\n @dev Note that we are only storing the indexer and subgraphDeploymentId. The main point of tracking legacy allocations\n is to prevent them from being re used on the Subgraph Service. We don't need to store the rest of the allocation details.\n @param indexer The indexer that owns the allocation\n @param subgraphDeploymentId The subgraph deployment id the allocation is for" + }, + "id": 16305, + "members": [ + { + "constant": false, + "id": 16302, + "mutability": "mutable", + "name": "indexer", + "nameLocation": "960:7:63", + "nodeType": "VariableDeclaration", + "scope": 16305, + "src": "952:15:63", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 16301, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "952:7:63", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 16304, + "mutability": "mutable", + "name": "subgraphDeploymentId", + "nameLocation": "985:20:63", + "nodeType": "VariableDeclaration", + "scope": 16305, + "src": "977:28:63", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 16303, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "977:7:63", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "name": "State", + "nameLocation": "936:5:63", + "nodeType": "StructDefinition", + "scope": 16462, + "src": "929:83:63", + "visibility": "public" + }, + { + "documentation": { + "id": 16306, + "nodeType": "StructuredDocumentation", + "src": "1018:139:63", + "text": " @notice Thrown when attempting to migrate an allocation with an existing id\n @param allocationId The allocation id" + }, + "errorSelector": "b5f497c4", + "id": 16310, + "name": "LegacyAllocationAlreadyExists", + "nameLocation": "1168:29:63", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 16309, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 16308, + "mutability": "mutable", + "name": "allocationId", + "nameLocation": "1206:12:63", + "nodeType": "VariableDeclaration", + "scope": 16310, + "src": "1198:20:63", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 16307, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1198:7:63", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "1197:22:63" + }, + "src": "1162:58:63" + }, + { + "documentation": { + "id": 16311, + "nodeType": "StructuredDocumentation", + "src": "1226:123:63", + "text": " @notice Thrown when trying to get a non-existent allocation\n @param allocationId The allocation id" + }, + "errorSelector": "40e1fd4a", + "id": 16315, + "name": "LegacyAllocationDoesNotExist", + "nameLocation": "1360:28:63", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 16314, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 16313, + "mutability": "mutable", + "name": "allocationId", + "nameLocation": "1397:12:63", + "nodeType": "VariableDeclaration", + "scope": 16315, + "src": "1389:20:63", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 16312, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1389:7:63", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "1388:22:63" + }, + "src": "1354:57:63" + }, + { + "body": { + "id": 16351, + "nodeType": "Block", + "src": "2077:202:63", + "statements": [ + { + "expression": { + "arguments": [ + { + "id": 16336, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "2095:28:63", + "subExpression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "expression": { + "baseExpression": { + "id": 16331, + "name": "self", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16321, + "src": "2096:4:63", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_State_$16305_storage_$", + "typeString": "mapping(address => struct LegacyAllocation.State storage ref)" + } + }, + "id": 16333, + "indexExpression": { + "id": 16332, + "name": "allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16325, + "src": "2101:12:63", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "2096:18:63", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16305_storage", + "typeString": "struct LegacyAllocation.State storage ref" + } + }, + "id": 16334, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "2115:6:63", + "memberName": "exists", + "nodeType": "MemberAccess", + "referencedDeclaration": 16428, + "src": "2096:25:63", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_struct$_State_$16305_memory_ptr_$returns$_t_bool_$attached_to$_t_struct$_State_$16305_memory_ptr_$", + "typeString": "function (struct LegacyAllocation.State memory) pure returns (bool)" + } + }, + "id": 16335, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2096:27:63", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [ + { + "id": 16338, + "name": "allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16325, + "src": "2155:12:63", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 16337, + "name": "LegacyAllocationAlreadyExists", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16310, + "src": "2125:29:63", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_address_$returns$_t_error_$", + "typeString": "function (address) pure returns (error)" + } + }, + "id": 16339, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2125:43:63", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 16330, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "2087:7:63", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 16340, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2087:82:63", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 16341, + "nodeType": "ExpressionStatement", + "src": "2087:82:63" + }, + { + "expression": { + "id": 16349, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "baseExpression": { + "id": 16342, + "name": "self", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16321, + "src": "2180:4:63", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_State_$16305_storage_$", + "typeString": "mapping(address => struct LegacyAllocation.State storage ref)" + } + }, + "id": 16344, + "indexExpression": { + "id": 16343, + "name": "allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16325, + "src": "2185:12:63", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "2180:18:63", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16305_storage", + "typeString": "struct LegacyAllocation.State storage ref" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "id": 16346, + "name": "indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16323, + "src": "2218:7:63", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 16347, + "name": "subgraphDeploymentId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16327, + "src": "2249:20:63", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 16345, + "name": "State", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16305, + "src": "2201:5:63", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_struct$_State_$16305_storage_ptr_$", + "typeString": "type(struct LegacyAllocation.State storage pointer)" + } + }, + "id": 16348, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "structConstructorCall", + "lValueRequested": false, + "nameLocations": [ + "2209:7:63", + "2227:20:63" + ], + "names": [ + "indexer", + "subgraphDeploymentId" + ], + "nodeType": "FunctionCall", + "src": "2201:71:63", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16305_memory_ptr", + "typeString": "struct LegacyAllocation.State memory" + } + }, + "src": "2180:92:63", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16305_storage", + "typeString": "struct LegacyAllocation.State storage ref" + } + }, + "id": 16350, + "nodeType": "ExpressionStatement", + "src": "2180:92:63" + } + ] + }, + "documentation": { + "id": 16316, + "nodeType": "StructuredDocumentation", + "src": "1417:482:63", + "text": " @notice Migrate a legacy allocation\n @dev Requirements:\n - The allocation must not have been previously migrated\n @param self The legacy allocation list mapping\n @param indexer The indexer that owns the allocation\n @param allocationId The allocation id\n @param subgraphDeploymentId The subgraph deployment id the allocation is for\n @custom:error LegacyAllocationAlreadyMigrated if the allocation has already been migrated" + }, + "id": 16352, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "migrate", + "nameLocation": "1913:7:63", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 16328, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 16321, + "mutability": "mutable", + "name": "self", + "nameLocation": "1964:4:63", + "nodeType": "VariableDeclaration", + "scope": 16352, + "src": "1930:38:63", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_State_$16305_storage_$", + "typeString": "mapping(address => struct LegacyAllocation.State)" + }, + "typeName": { + "id": 16320, + "keyName": "", + "keyNameLocation": "-1:-1:-1", + "keyType": { + "id": 16317, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1938:7:63", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "1930:25:63", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_State_$16305_storage_$", + "typeString": "mapping(address => struct LegacyAllocation.State)" + }, + "valueName": "", + "valueNameLocation": "-1:-1:-1", + "valueType": { + "id": 16319, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 16318, + "name": "State", + "nameLocations": [ + "1949:5:63" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 16305, + "src": "1949:5:63" + }, + "referencedDeclaration": 16305, + "src": "1949:5:63", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16305_storage_ptr", + "typeString": "struct LegacyAllocation.State" + } + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 16323, + "mutability": "mutable", + "name": "indexer", + "nameLocation": "1986:7:63", + "nodeType": "VariableDeclaration", + "scope": 16352, + "src": "1978:15:63", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 16322, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1978:7:63", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 16325, + "mutability": "mutable", + "name": "allocationId", + "nameLocation": "2011:12:63", + "nodeType": "VariableDeclaration", + "scope": 16352, + "src": "2003:20:63", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 16324, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2003:7:63", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 16327, + "mutability": "mutable", + "name": "subgraphDeploymentId", + "nameLocation": "2041:20:63", + "nodeType": "VariableDeclaration", + "scope": 16352, + "src": "2033:28:63", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 16326, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "2033:7:63", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "1920:147:63" + }, + "returnParameters": { + "id": 16329, + "nodeType": "ParameterList", + "parameters": [], + "src": "2077:0:63" + }, + "scope": 16462, + "src": "1904:375:63", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 16371, + "nodeType": "Block", + "src": "2596:48:63", + "statements": [ + { + "expression": { + "arguments": [ + { + "id": 16367, + "name": "self", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16358, + "src": "2618:4:63", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_State_$16305_storage_$", + "typeString": "mapping(address => struct LegacyAllocation.State storage ref)" + } + }, + { + "id": 16368, + "name": "allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16360, + "src": "2624:12:63", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_State_$16305_storage_$", + "typeString": "mapping(address => struct LegacyAllocation.State storage ref)" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 16366, + "name": "_get", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16461, + "src": "2613:4:63", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_mapping$_t_address_$_t_struct$_State_$16305_storage_$_$_t_address_$returns$_t_struct$_State_$16305_storage_ptr_$", + "typeString": "function (mapping(address => struct LegacyAllocation.State storage ref),address) view returns (struct LegacyAllocation.State storage pointer)" + } + }, + "id": 16369, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2613:24:63", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16305_storage_ptr", + "typeString": "struct LegacyAllocation.State storage pointer" + } + }, + "functionReturnParameters": 16365, + "id": 16370, + "nodeType": "Return", + "src": "2606:31:63" + } + ] + }, + "documentation": { + "id": 16353, + "nodeType": "StructuredDocumentation", + "src": "2285:194:63", + "text": " @notice Get a legacy allocation\n @param self The legacy allocation list mapping\n @param allocationId The allocation id\n @return The legacy allocation details" + }, + "id": 16372, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "get", + "nameLocation": "2493:3:63", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 16361, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 16358, + "mutability": "mutable", + "name": "self", + "nameLocation": "2531:4:63", + "nodeType": "VariableDeclaration", + "scope": 16372, + "src": "2497:38:63", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_State_$16305_storage_$", + "typeString": "mapping(address => struct LegacyAllocation.State)" + }, + "typeName": { + "id": 16357, + "keyName": "", + "keyNameLocation": "-1:-1:-1", + "keyType": { + "id": 16354, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2505:7:63", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "2497:25:63", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_State_$16305_storage_$", + "typeString": "mapping(address => struct LegacyAllocation.State)" + }, + "valueName": "", + "valueNameLocation": "-1:-1:-1", + "valueType": { + "id": 16356, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 16355, + "name": "State", + "nameLocations": [ + "2516:5:63" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 16305, + "src": "2516:5:63" + }, + "referencedDeclaration": 16305, + "src": "2516:5:63", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16305_storage_ptr", + "typeString": "struct LegacyAllocation.State" + } + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 16360, + "mutability": "mutable", + "name": "allocationId", + "nameLocation": "2545:12:63", + "nodeType": "VariableDeclaration", + "scope": 16372, + "src": "2537:20:63", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 16359, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2537:7:63", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "2496:62:63" + }, + "returnParameters": { + "id": 16365, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 16364, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 16372, + "src": "2582:12:63", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16305_memory_ptr", + "typeString": "struct LegacyAllocation.State" + }, + "typeName": { + "id": 16363, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 16362, + "name": "State", + "nameLocations": [ + "2582:5:63" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 16305, + "src": "2582:5:63" + }, + "referencedDeclaration": 16305, + "src": "2582:5:63", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16305_storage_ptr", + "typeString": "struct LegacyAllocation.State" + } + }, + "visibility": "internal" + } + ], + "src": "2581:14:63" + }, + "scope": 16462, + "src": "2484:160:63", + "stateMutability": "view", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 16409, + "nodeType": "Block", + "src": "3264:203:63", + "statements": [ + { + "expression": { + "arguments": [ + { + "id": 16392, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "3282:28:63", + "subExpression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "expression": { + "baseExpression": { + "id": 16387, + "name": "self", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16378, + "src": "3283:4:63", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_State_$16305_storage_$", + "typeString": "mapping(address => struct LegacyAllocation.State storage ref)" + } + }, + "id": 16389, + "indexExpression": { + "id": 16388, + "name": "allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16383, + "src": "3288:12:63", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3283:18:63", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16305_storage", + "typeString": "struct LegacyAllocation.State storage ref" + } + }, + "id": 16390, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "3302:6:63", + "memberName": "exists", + "nodeType": "MemberAccess", + "referencedDeclaration": 16428, + "src": "3283:25:63", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_struct$_State_$16305_memory_ptr_$returns$_t_bool_$attached_to$_t_struct$_State_$16305_memory_ptr_$", + "typeString": "function (struct LegacyAllocation.State memory) pure returns (bool)" + } + }, + "id": 16391, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3283:27:63", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [ + { + "id": 16394, + "name": "allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16383, + "src": "3342:12:63", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 16393, + "name": "LegacyAllocationAlreadyExists", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16310, + "src": "3312:29:63", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_address_$returns$_t_error_$", + "typeString": "function (address) pure returns (error)" + } + }, + "id": 16395, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3312:43:63", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 16386, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "3274:7:63", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 16396, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3274:82:63", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 16397, + "nodeType": "ExpressionStatement", + "src": "3274:82:63" + }, + { + "expression": { + "arguments": [ + { + "id": 16403, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "3374:40:63", + "subExpression": { + "arguments": [ + { + "id": 16401, + "name": "allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16383, + "src": "3401:12:63", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "expression": { + "id": 16399, + "name": "graphStaking", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16381, + "src": "3375:12:63", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IHorizonStaking_$2625", + "typeString": "contract IHorizonStaking" + } + }, + "id": 16400, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "3388:12:63", + "memberName": "isAllocation", + "nodeType": "MemberAccess", + "referencedDeclaration": 3213, + "src": "3375:25:63", + "typeDescriptions": { + "typeIdentifier": "t_function_external_view$_t_address_$returns$_t_bool_$", + "typeString": "function (address) view external returns (bool)" + } + }, + "id": 16402, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3375:39:63", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [ + { + "id": 16405, + "name": "allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16383, + "src": "3446:12:63", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 16404, + "name": "LegacyAllocationAlreadyExists", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16310, + "src": "3416:29:63", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_address_$returns$_t_error_$", + "typeString": "function (address) pure returns (error)" + } + }, + "id": 16406, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3416:43:63", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 16398, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "3366:7:63", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 16407, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3366:94:63", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 16408, + "nodeType": "ExpressionStatement", + "src": "3366:94:63" + } + ] + }, + "documentation": { + "id": 16373, + "nodeType": "StructuredDocumentation", + "src": "2650:449:63", + "text": " @notice Revert if a legacy allocation exists\n @dev We first check the migrated mapping then the old staking contract.\n @dev TRANSITION PERIOD: after the transition period when all the allocations are migrated we can\n remove the call to the staking contract.\n @param self The legacy allocation list mapping\n @param graphStaking The Horizon Staking contract\n @param allocationId The allocation id" + }, + "id": 16410, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "revertIfExists", + "nameLocation": "3113:14:63", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 16384, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 16378, + "mutability": "mutable", + "name": "self", + "nameLocation": "3171:4:63", + "nodeType": "VariableDeclaration", + "scope": 16410, + "src": "3137:38:63", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_State_$16305_storage_$", + "typeString": "mapping(address => struct LegacyAllocation.State)" + }, + "typeName": { + "id": 16377, + "keyName": "", + "keyNameLocation": "-1:-1:-1", + "keyType": { + "id": 16374, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3145:7:63", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "3137:25:63", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_State_$16305_storage_$", + "typeString": "mapping(address => struct LegacyAllocation.State)" + }, + "valueName": "", + "valueNameLocation": "-1:-1:-1", + "valueType": { + "id": 16376, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 16375, + "name": "State", + "nameLocations": [ + "3156:5:63" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 16305, + "src": "3156:5:63" + }, + "referencedDeclaration": 16305, + "src": "3156:5:63", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16305_storage_ptr", + "typeString": "struct LegacyAllocation.State" + } + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 16381, + "mutability": "mutable", + "name": "graphStaking", + "nameLocation": "3201:12:63", + "nodeType": "VariableDeclaration", + "scope": 16410, + "src": "3185:28:63", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IHorizonStaking_$2625", + "typeString": "contract IHorizonStaking" + }, + "typeName": { + "id": 16380, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 16379, + "name": "IHorizonStaking", + "nameLocations": [ + "3185:15:63" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 2625, + "src": "3185:15:63" + }, + "referencedDeclaration": 2625, + "src": "3185:15:63", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IHorizonStaking_$2625", + "typeString": "contract IHorizonStaking" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 16383, + "mutability": "mutable", + "name": "allocationId", + "nameLocation": "3231:12:63", + "nodeType": "VariableDeclaration", + "scope": 16410, + "src": "3223:20:63", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 16382, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3223:7:63", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "3127:122:63" + }, + "returnParameters": { + "id": 16385, + "nodeType": "ParameterList", + "parameters": [], + "src": "3264:0:63" + }, + "scope": 16462, + "src": "3104:363:63", + "stateMutability": "view", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 16427, + "nodeType": "Block", + "src": "3690:50:63", + "statements": [ + { + "expression": { + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 16425, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 16419, + "name": "self", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16414, + "src": "3707:4:63", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16305_memory_ptr", + "typeString": "struct LegacyAllocation.State memory" + } + }, + "id": 16420, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "3712:7:63", + "memberName": "indexer", + "nodeType": "MemberAccess", + "referencedDeclaration": 16302, + "src": "3707:12:63", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "arguments": [ + { + "hexValue": "30", + "id": 16423, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3731:1:63", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 16422, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "3723:7:63", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 16421, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3723:7:63", + "typeDescriptions": {} + } + }, + "id": 16424, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3723:10:63", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "3707:26:63", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "functionReturnParameters": 16418, + "id": 16426, + "nodeType": "Return", + "src": "3700:33:63" + } + ] + }, + "documentation": { + "id": 16411, + "nodeType": "StructuredDocumentation", + "src": "3473:148:63", + "text": " @notice Check if a legacy allocation exists\n @param self The legacy allocation\n @return True if the allocation exists" + }, + "id": 16428, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "exists", + "nameLocation": "3635:6:63", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 16415, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 16414, + "mutability": "mutable", + "name": "self", + "nameLocation": "3655:4:63", + "nodeType": "VariableDeclaration", + "scope": 16428, + "src": "3642:17:63", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16305_memory_ptr", + "typeString": "struct LegacyAllocation.State" + }, + "typeName": { + "id": 16413, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 16412, + "name": "State", + "nameLocations": [ + "3642:5:63" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 16305, + "src": "3642:5:63" + }, + "referencedDeclaration": 16305, + "src": "3642:5:63", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16305_storage_ptr", + "typeString": "struct LegacyAllocation.State" + } + }, + "visibility": "internal" + } + ], + "src": "3641:19:63" + }, + "returnParameters": { + "id": 16418, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 16417, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 16428, + "src": "3684:4:63", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 16416, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "3684:4:63", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "src": "3683:6:63" + }, + "scope": 16462, + "src": "3626:114:63", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 16460, + "nodeType": "Block", + "src": "4058:171:63", + "statements": [ + { + "assignments": [ + 16444 + ], + "declarations": [ + { + "constant": false, + "id": 16444, + "mutability": "mutable", + "name": "allocation", + "nameLocation": "4082:10:63", + "nodeType": "VariableDeclaration", + "scope": 16460, + "src": "4068:24:63", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16305_storage_ptr", + "typeString": "struct LegacyAllocation.State" + }, + "typeName": { + "id": 16443, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 16442, + "name": "State", + "nameLocations": [ + "4068:5:63" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 16305, + "src": "4068:5:63" + }, + "referencedDeclaration": 16305, + "src": "4068:5:63", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16305_storage_ptr", + "typeString": "struct LegacyAllocation.State" + } + }, + "visibility": "internal" + } + ], + "id": 16448, + "initialValue": { + "baseExpression": { + "id": 16445, + "name": "self", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16434, + "src": "4095:4:63", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_State_$16305_storage_$", + "typeString": "mapping(address => struct LegacyAllocation.State storage ref)" + } + }, + "id": 16447, + "indexExpression": { + "id": 16446, + "name": "allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16436, + "src": "4100:12:63", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "4095:18:63", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16305_storage", + "typeString": "struct LegacyAllocation.State storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "4068:45:63" + }, + { + "expression": { + "arguments": [ + { + "arguments": [], + "expression": { + "argumentTypes": [], + "expression": { + "id": 16450, + "name": "allocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16444, + "src": "4131:10:63", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16305_storage_ptr", + "typeString": "struct LegacyAllocation.State storage pointer" + } + }, + "id": 16451, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "4142:6:63", + "memberName": "exists", + "nodeType": "MemberAccess", + "referencedDeclaration": 16428, + "src": "4131:17:63", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_struct$_State_$16305_memory_ptr_$returns$_t_bool_$attached_to$_t_struct$_State_$16305_memory_ptr_$", + "typeString": "function (struct LegacyAllocation.State memory) pure returns (bool)" + } + }, + "id": 16452, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4131:19:63", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [ + { + "id": 16454, + "name": "allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16436, + "src": "4181:12:63", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 16453, + "name": "LegacyAllocationDoesNotExist", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16315, + "src": "4152:28:63", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_address_$returns$_t_error_$", + "typeString": "function (address) pure returns (error)" + } + }, + "id": 16455, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4152:42:63", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 16449, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "4123:7:63", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 16456, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4123:72:63", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 16457, + "nodeType": "ExpressionStatement", + "src": "4123:72:63" + }, + { + "expression": { + "id": 16458, + "name": "allocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16444, + "src": "4212:10:63", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16305_storage_ptr", + "typeString": "struct LegacyAllocation.State storage pointer" + } + }, + "functionReturnParameters": 16441, + "id": 16459, + "nodeType": "Return", + "src": "4205:17:63" + } + ] + }, + "documentation": { + "id": 16429, + "nodeType": "StructuredDocumentation", + "src": "3746:194:63", + "text": " @notice Get a legacy allocation\n @param self The legacy allocation list mapping\n @param allocationId The allocation id\n @return The legacy allocation details" + }, + "id": 16461, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_get", + "nameLocation": "3954:4:63", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 16437, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 16434, + "mutability": "mutable", + "name": "self", + "nameLocation": "3993:4:63", + "nodeType": "VariableDeclaration", + "scope": 16461, + "src": "3959:38:63", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_State_$16305_storage_$", + "typeString": "mapping(address => struct LegacyAllocation.State)" + }, + "typeName": { + "id": 16433, + "keyName": "", + "keyNameLocation": "-1:-1:-1", + "keyType": { + "id": 16430, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3967:7:63", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "3959:25:63", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_State_$16305_storage_$", + "typeString": "mapping(address => struct LegacyAllocation.State)" + }, + "valueName": "", + "valueNameLocation": "-1:-1:-1", + "valueType": { + "id": 16432, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 16431, + "name": "State", + "nameLocations": [ + "3978:5:63" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 16305, + "src": "3978:5:63" + }, + "referencedDeclaration": 16305, + "src": "3978:5:63", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16305_storage_ptr", + "typeString": "struct LegacyAllocation.State" + } + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 16436, + "mutability": "mutable", + "name": "allocationId", + "nameLocation": "4007:12:63", + "nodeType": "VariableDeclaration", + "scope": 16461, + "src": "3999:20:63", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 16435, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3999:7:63", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "3958:62:63" + }, + "returnParameters": { + "id": 16441, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 16440, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 16461, + "src": "4043:13:63", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16305_storage_ptr", + "typeString": "struct LegacyAllocation.State" + }, + "typeName": { + "id": 16439, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 16438, + "name": "State", + "nameLocations": [ + "4043:5:63" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 16305, + "src": "4043:5:63" + }, + "referencedDeclaration": 16305, + "src": "4043:5:63", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16305_storage_ptr", + "typeString": "struct LegacyAllocation.State" + } + }, + "visibility": "internal" + } + ], + "src": "4042:15:63" + }, + "scope": 16462, + "src": "3945:284:63", + "stateMutability": "view", + "virtual": false, + "visibility": "private" + } + ], + "scope": 16463, + "src": "404:3827:63", + "usedErrors": [ + 16310, + 16315 + ], + "usedEvents": [] + } + ], + "src": "45:4187:63" + }, + "id": 63 + }, + "contracts/mocks/imports.sol": { + "ast": { + "absolutePath": "contracts/mocks/imports.sol", + "exportedSymbols": { + "ICallhookReceiver": [ + 382 + ], + "IDisputeManager": [ + 314 + ], + "IL2Curation": [ + 481 + ], + "IL2GNS": [ + 532 + ] + }, + "id": 16468, + "license": "GPL-2.0-or-later", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 16464, + "literals": [ + "solidity", + "^", + "0.7", + ".6", + "||", + "0.8", + ".27" + ], + "nodeType": "PragmaDirective", + "src": "45:33:64" + }, + { + "absolutePath": "@graphprotocol/contracts/contracts/l2/curation/IL2Curation.sol", + "file": "@graphprotocol/contracts/contracts/l2/curation/IL2Curation.sol", + "id": 16465, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 16468, + "sourceUnit": 482, + "src": "130:72:64", + "symbolAliases": [], + "unitAlias": "" + }, + { + "absolutePath": "@graphprotocol/contracts/contracts/l2/discovery/IL2GNS.sol", + "file": "@graphprotocol/contracts/contracts/l2/discovery/IL2GNS.sol", + "id": 16466, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 16468, + "sourceUnit": 533, + "src": "203:68:64", + "symbolAliases": [], + "unitAlias": "" + }, + { + "absolutePath": "@graphprotocol/contracts/contracts/disputes/IDisputeManager.sol", + "file": "@graphprotocol/contracts/contracts/disputes/IDisputeManager.sol", + "id": 16467, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 16468, + "sourceUnit": 315, + "src": "272:73:64", + "symbolAliases": [], + "unitAlias": "" + } + ], + "src": "45:301:64" + }, + "id": 64 + }, + "contracts/utilities/AllocationManager.sol": { + "ast": { + "absolutePath": "contracts/utilities/AllocationManager.sol", + "exportedSymbols": { + "Allocation": [ + 16033 + ], + "AllocationManager": [ + 17363 + ], + "AllocationManagerV1Storage": [ + 17401 + ], + "ECDSA": [ + 8231 + ], + "EIP712Upgradeable": [ + 6044 + ], + "GraphDirectory": [ + 4928 + ], + "IGraphPayments": [ + 2489 + ], + "IGraphToken": [ + 758 + ], + "IHorizonStakingTypes": [ + 4073 + ], + "LegacyAllocation": [ + 16462 + ], + "PPMMath": [ + 4539 + ], + "ProvisionTracker": [ + 1801 + ], + "TokenUtils": [ + 840 + ] + }, + "id": 17364, + "license": "GPL-3.0-or-later", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 16469, + "literals": [ + "solidity", + "0.8", + ".27" + ], + "nodeType": "PragmaDirective", + "src": "45:23:65" + }, + { + "absolutePath": "@graphprotocol/horizon/contracts/interfaces/IGraphPayments.sol", + "file": "@graphprotocol/horizon/contracts/interfaces/IGraphPayments.sol", + "id": 16471, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 17364, + "sourceUnit": 2490, + "src": "70:96:65", + "symbolAliases": [ + { + "foreign": { + "id": 16470, + "name": "IGraphPayments", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2489, + "src": "79:14:65", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "@graphprotocol/contracts/contracts/token/IGraphToken.sol", + "file": "@graphprotocol/contracts/contracts/token/IGraphToken.sol", + "id": 16473, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 17364, + "sourceUnit": 759, + "src": "167:87:65", + "symbolAliases": [ + { + "foreign": { + "id": 16472, + "name": "IGraphToken", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 758, + "src": "176:11:65", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingTypes.sol", + "file": "@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingTypes.sol", + "id": 16475, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 17364, + "sourceUnit": 4074, + "src": "255:117:65", + "symbolAliases": [ + { + "foreign": { + "id": 16474, + "name": "IHorizonStakingTypes", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4073, + "src": "264:20:65", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "@graphprotocol/horizon/contracts/utilities/GraphDirectory.sol", + "file": "@graphprotocol/horizon/contracts/utilities/GraphDirectory.sol", + "id": 16477, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 17364, + "sourceUnit": 4929, + "src": "374:95:65", + "symbolAliases": [ + { + "foreign": { + "id": 16476, + "name": "GraphDirectory", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4928, + "src": "383:14:65", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "contracts/utilities/AllocationManagerStorage.sol", + "file": "./AllocationManagerStorage.sol", + "id": 16479, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 17364, + "sourceUnit": 17402, + "src": "470:76:65", + "symbolAliases": [ + { + "foreign": { + "id": 16478, + "name": "AllocationManagerV1Storage", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17401, + "src": "479:26:65", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "@graphprotocol/contracts/contracts/utils/TokenUtils.sol", + "file": "@graphprotocol/contracts/contracts/utils/TokenUtils.sol", + "id": 16481, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 17364, + "sourceUnit": 841, + "src": "548:85:65", + "symbolAliases": [ + { + "foreign": { + "id": 16480, + "name": "TokenUtils", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 840, + "src": "557:10:65", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "@openzeppelin/contracts/utils/cryptography/ECDSA.sol", + "file": "@openzeppelin/contracts/utils/cryptography/ECDSA.sol", + "id": 16483, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 17364, + "sourceUnit": 8232, + "src": "634:77:65", + "symbolAliases": [ + { + "foreign": { + "id": 16482, + "name": "ECDSA", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8231, + "src": "643:5:65", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol", + "file": "@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol", + "id": 16485, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 17364, + "sourceUnit": 6045, + "src": "712:113:65", + "symbolAliases": [ + { + "foreign": { + "id": 16484, + "name": "EIP712Upgradeable", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 6044, + "src": "721:17:65", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "contracts/libraries/Allocation.sol", + "file": "../libraries/Allocation.sol", + "id": 16487, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 17364, + "sourceUnit": 16034, + "src": "826:57:65", + "symbolAliases": [ + { + "foreign": { + "id": 16486, + "name": "Allocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16033, + "src": "835:10:65", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "contracts/libraries/LegacyAllocation.sol", + "file": "../libraries/LegacyAllocation.sol", + "id": 16489, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 17364, + "sourceUnit": 16463, + "src": "884:69:65", + "symbolAliases": [ + { + "foreign": { + "id": 16488, + "name": "LegacyAllocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16462, + "src": "893:16:65", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "@graphprotocol/horizon/contracts/libraries/PPMMath.sol", + "file": "@graphprotocol/horizon/contracts/libraries/PPMMath.sol", + "id": 16491, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 17364, + "sourceUnit": 4540, + "src": "954:81:65", + "symbolAliases": [ + { + "foreign": { + "id": 16490, + "name": "PPMMath", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4539, + "src": "963:7:65", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "@graphprotocol/horizon/contracts/data-service/libraries/ProvisionTracker.sol", + "file": "@graphprotocol/horizon/contracts/data-service/libraries/ProvisionTracker.sol", + "id": 16493, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 17364, + "sourceUnit": 1802, + "src": "1036:112:65", + "symbolAliases": [ + { + "foreign": { + "id": 16492, + "name": "ProvisionTracker", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1801, + "src": "1045:16:65", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "abstract": true, + "baseContracts": [ + { + "baseName": { + "id": 16495, + "name": "EIP712Upgradeable", + "nameLocations": [ + "1586:17:65" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 6044, + "src": "1586:17:65" + }, + "id": 16496, + "nodeType": "InheritanceSpecifier", + "src": "1586:17:65" + }, + { + "baseName": { + "id": 16497, + "name": "GraphDirectory", + "nameLocations": [ + "1605:14:65" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 4928, + "src": "1605:14:65" + }, + "id": 16498, + "nodeType": "InheritanceSpecifier", + "src": "1605:14:65" + }, + { + "baseName": { + "id": 16499, + "name": "AllocationManagerV1Storage", + "nameLocations": [ + "1621:26:65" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 17401, + "src": "1621:26:65" + }, + "id": 16500, + "nodeType": "InheritanceSpecifier", + "src": "1621:26:65" + } + ], + "canonicalName": "AllocationManager", + "contractDependencies": [], + "contractKind": "contract", + "documentation": { + "id": 16494, + "nodeType": "StructuredDocumentation", + "src": "1150:396:65", + "text": " @title AllocationManager contract\n @notice A helper contract implementing allocation lifecycle management.\n Allows opening, resizing, and closing allocations, as well as collecting indexing rewards by presenting a Proof\n of Indexing (POI).\n @custom:security-contact Please email security+contracts@thegraph.com if you find any\n bugs. We may have an active bug bounty program." + }, + "fullyImplemented": true, + "id": 17363, + "linearizedBaseContracts": [ + 17363, + 17401, + 4928, + 6044, + 6069, + 5391 + ], + "name": "AllocationManager", + "nameLocation": "1565:17:65", + "nodeType": "ContractDefinition", + "nodes": [ + { + "global": false, + "id": 16505, + "libraryName": { + "id": 16501, + "name": "ProvisionTracker", + "nameLocations": [ + "1660:16:65" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 1801, + "src": "1660:16:65" + }, + "nodeType": "UsingForDirective", + "src": "1654:55:65", + "typeName": { + "id": 16504, + "keyName": "", + "keyNameLocation": "-1:-1:-1", + "keyType": { + "id": 16502, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1689:7:65", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "1681:27:65", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", + "typeString": "mapping(address => uint256)" + }, + "valueName": "", + "valueNameLocation": "-1:-1:-1", + "valueType": { + "id": 16503, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1700:7:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + } + }, + { + "global": false, + "id": 16511, + "libraryName": { + "id": 16506, + "name": "Allocation", + "nameLocations": [ + "1720:10:65" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 16033, + "src": "1720:10:65" + }, + "nodeType": "UsingForDirective", + "src": "1714:58:65", + "typeName": { + "id": 16510, + "keyName": "", + "keyNameLocation": "-1:-1:-1", + "keyType": { + "id": 16507, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1743:7:65", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "1735:36:65", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_State_$15663_storage_$", + "typeString": "mapping(address => struct Allocation.State)" + }, + "valueName": "", + "valueNameLocation": "-1:-1:-1", + "valueType": { + "id": 16509, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 16508, + "name": "Allocation.State", + "nameLocations": [ + "1754:10:65", + "1765:5:65" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 15663, + "src": "1754:16:65" + }, + "referencedDeclaration": 15663, + "src": "1754:16:65", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_storage_ptr", + "typeString": "struct Allocation.State" + } + } + } + }, + { + "global": false, + "id": 16515, + "libraryName": { + "id": 16512, + "name": "Allocation", + "nameLocations": [ + "1783:10:65" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 16033, + "src": "1783:10:65" + }, + "nodeType": "UsingForDirective", + "src": "1777:38:65", + "typeName": { + "id": 16514, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 16513, + "name": "Allocation.State", + "nameLocations": [ + "1798:10:65", + "1809:5:65" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 15663, + "src": "1798:16:65" + }, + "referencedDeclaration": 15663, + "src": "1798:16:65", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_storage_ptr", + "typeString": "struct Allocation.State" + } + } + }, + { + "global": false, + "id": 16521, + "libraryName": { + "id": 16516, + "name": "LegacyAllocation", + "nameLocations": [ + "1826:16:65" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 16462, + "src": "1826:16:65" + }, + "nodeType": "UsingForDirective", + "src": "1820:70:65", + "typeName": { + "id": 16520, + "keyName": "", + "keyNameLocation": "-1:-1:-1", + "keyType": { + "id": 16517, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1855:7:65", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "1847:42:65", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_State_$16305_storage_$", + "typeString": "mapping(address => struct LegacyAllocation.State)" + }, + "valueName": "", + "valueNameLocation": "-1:-1:-1", + "valueType": { + "id": 16519, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 16518, + "name": "LegacyAllocation.State", + "nameLocations": [ + "1866:16:65", + "1883:5:65" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 16305, + "src": "1866:22:65" + }, + "referencedDeclaration": 16305, + "src": "1866:22:65", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16305_storage_ptr", + "typeString": "struct LegacyAllocation.State" + } + } + } + }, + { + "global": false, + "id": 16524, + "libraryName": { + "id": 16522, + "name": "PPMMath", + "nameLocations": [ + "1901:7:65" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 4539, + "src": "1901:7:65" + }, + "nodeType": "UsingForDirective", + "src": "1895:26:65", + "typeName": { + "id": 16523, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1913:7:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + }, + { + "global": false, + "id": 16528, + "libraryName": { + "id": 16525, + "name": "TokenUtils", + "nameLocations": [ + "1932:10:65" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 840, + "src": "1932:10:65" + }, + "nodeType": "UsingForDirective", + "src": "1926:33:65", + "typeName": { + "id": 16527, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 16526, + "name": "IGraphToken", + "nameLocations": [ + "1947:11:65" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 758, + "src": "1947:11:65" + }, + "referencedDeclaration": 758, + "src": "1947:11:65", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IGraphToken_$758", + "typeString": "contract IGraphToken" + } + } + }, + { + "constant": true, + "documentation": { + "id": 16529, + "nodeType": "StructuredDocumentation", + "src": "1965:47:65", + "text": "@dev EIP712 typehash for allocation id proof" + }, + "id": 16534, + "mutability": "constant", + "name": "EIP712_ALLOCATION_ID_PROOF_TYPEHASH", + "nameLocation": "2042:35:65", + "nodeType": "VariableDeclaration", + "scope": 17363, + "src": "2017:139:65", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 16530, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "2017:7:65", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": { + "arguments": [ + { + "hexValue": "416c6c6f636174696f6e496450726f6f66286164647265737320696e64657865722c6164647265737320616c6c6f636174696f6e496429", + "id": 16532, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2098:57:65", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_4bdee85c4b4a268f4895d1096d553c3e57bb2433c380e7b7ec8cb56cc4f74673", + "typeString": "literal_string \"AllocationIdProof(address indexer,address allocationId)\"" + }, + "value": "AllocationIdProof(address indexer,address allocationId)" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_stringliteral_4bdee85c4b4a268f4895d1096d553c3e57bb2433c380e7b7ec8cb56cc4f74673", + "typeString": "literal_string \"AllocationIdProof(address indexer,address allocationId)\"" + } + ], + "id": 16531, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -8, + "src": "2088:9:65", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 16533, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2088:68:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "private" + }, + { + "anonymous": false, + "documentation": { + "id": 16535, + "nodeType": "StructuredDocumentation", + "src": "2163:339:65", + "text": " @notice Emitted when an indexer creates an allocation\n @param indexer The address of the indexer\n @param allocationId The id of the allocation\n @param subgraphDeploymentId The id of the subgraph deployment\n @param tokens The amount of tokens allocated\n @param currentEpoch The current epoch" + }, + "eventSelector": "e5e185fab2b992c4727ff702a867d78b15fb176dbaa20c9c312a1c351d3f7f83", + "id": 16547, + "name": "AllocationCreated", + "nameLocation": "2513:17:65", + "nodeType": "EventDefinition", + "parameters": { + "id": 16546, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 16537, + "indexed": true, + "mutability": "mutable", + "name": "indexer", + "nameLocation": "2556:7:65", + "nodeType": "VariableDeclaration", + "scope": 16547, + "src": "2540:23:65", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 16536, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2540:7:65", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 16539, + "indexed": true, + "mutability": "mutable", + "name": "allocationId", + "nameLocation": "2589:12:65", + "nodeType": "VariableDeclaration", + "scope": 16547, + "src": "2573:28:65", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 16538, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2573:7:65", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 16541, + "indexed": true, + "mutability": "mutable", + "name": "subgraphDeploymentId", + "nameLocation": "2627:20:65", + "nodeType": "VariableDeclaration", + "scope": 16547, + "src": "2611:36:65", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 16540, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "2611:7:65", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 16543, + "indexed": false, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "2665:6:65", + "nodeType": "VariableDeclaration", + "scope": 16547, + "src": "2657:14:65", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 16542, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2657:7:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 16545, + "indexed": false, + "mutability": "mutable", + "name": "currentEpoch", + "nameLocation": "2689:12:65", + "nodeType": "VariableDeclaration", + "scope": 16547, + "src": "2681:20:65", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 16544, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2681:7:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "2530:177:65" + }, + "src": "2507:201:65" + }, + { + "anonymous": false, + "documentation": { + "id": 16548, + "nodeType": "StructuredDocumentation", + "src": "2714:633:65", + "text": " @notice Emitted when an indexer collects indexing rewards for an allocation\n @param indexer The address of the indexer\n @param allocationId The id of the allocation\n @param subgraphDeploymentId The id of the subgraph deployment\n @param tokensRewards The amount of tokens collected\n @param tokensIndexerRewards The amount of tokens collected for the indexer\n @param tokensDelegationRewards The amount of tokens collected for delegators\n @param poi The POI presented\n @param currentEpoch The current epoch\n @param poiMetadata The metadata associated with the POI" + }, + "eventSelector": "443f56bd2098d273b8c8120398789a41da5925db4ba2f656813fc5299ac57b1f", + "id": 16568, + "name": "IndexingRewardsCollected", + "nameLocation": "3358:24:65", + "nodeType": "EventDefinition", + "parameters": { + "id": 16567, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 16550, + "indexed": true, + "mutability": "mutable", + "name": "indexer", + "nameLocation": "3408:7:65", + "nodeType": "VariableDeclaration", + "scope": 16568, + "src": "3392:23:65", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 16549, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3392:7:65", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 16552, + "indexed": true, + "mutability": "mutable", + "name": "allocationId", + "nameLocation": "3441:12:65", + "nodeType": "VariableDeclaration", + "scope": 16568, + "src": "3425:28:65", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 16551, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3425:7:65", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 16554, + "indexed": true, + "mutability": "mutable", + "name": "subgraphDeploymentId", + "nameLocation": "3479:20:65", + "nodeType": "VariableDeclaration", + "scope": 16568, + "src": "3463:36:65", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 16553, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "3463:7:65", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 16556, + "indexed": false, + "mutability": "mutable", + "name": "tokensRewards", + "nameLocation": "3517:13:65", + "nodeType": "VariableDeclaration", + "scope": 16568, + "src": "3509:21:65", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 16555, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "3509:7:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 16558, + "indexed": false, + "mutability": "mutable", + "name": "tokensIndexerRewards", + "nameLocation": "3548:20:65", + "nodeType": "VariableDeclaration", + "scope": 16568, + "src": "3540:28:65", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 16557, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "3540:7:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 16560, + "indexed": false, + "mutability": "mutable", + "name": "tokensDelegationRewards", + "nameLocation": "3586:23:65", + "nodeType": "VariableDeclaration", + "scope": 16568, + "src": "3578:31:65", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 16559, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "3578:7:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 16562, + "indexed": false, + "mutability": "mutable", + "name": "poi", + "nameLocation": "3627:3:65", + "nodeType": "VariableDeclaration", + "scope": 16568, + "src": "3619:11:65", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 16561, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "3619:7:65", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 16564, + "indexed": false, + "mutability": "mutable", + "name": "poiMetadata", + "nameLocation": "3646:11:65", + "nodeType": "VariableDeclaration", + "scope": 16568, + "src": "3640:17:65", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 16563, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "3640:5:65", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 16566, + "indexed": false, + "mutability": "mutable", + "name": "currentEpoch", + "nameLocation": "3675:12:65", + "nodeType": "VariableDeclaration", + "scope": 16568, + "src": "3667:20:65", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 16565, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "3667:7:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "3382:311:65" + }, + "src": "3352:342:65" + }, + { + "anonymous": false, + "documentation": { + "id": 16569, + "nodeType": "StructuredDocumentation", + "src": "3700:360:65", + "text": " @notice Emitted when an indexer resizes an allocation\n @param indexer The address of the indexer\n @param allocationId The id of the allocation\n @param subgraphDeploymentId The id of the subgraph deployment\n @param newTokens The new amount of tokens allocated\n @param oldTokens The old amount of tokens allocated" + }, + "eventSelector": "6db4a6f9be2d5e72eb2a2af2374ac487971bf342a261ba0bc1cf471bf2a2c31f", + "id": 16581, + "name": "AllocationResized", + "nameLocation": "4071:17:65", + "nodeType": "EventDefinition", + "parameters": { + "id": 16580, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 16571, + "indexed": true, + "mutability": "mutable", + "name": "indexer", + "nameLocation": "4114:7:65", + "nodeType": "VariableDeclaration", + "scope": 16581, + "src": "4098:23:65", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 16570, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4098:7:65", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 16573, + "indexed": true, + "mutability": "mutable", + "name": "allocationId", + "nameLocation": "4147:12:65", + "nodeType": "VariableDeclaration", + "scope": 16581, + "src": "4131:28:65", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 16572, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4131:7:65", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 16575, + "indexed": true, + "mutability": "mutable", + "name": "subgraphDeploymentId", + "nameLocation": "4185:20:65", + "nodeType": "VariableDeclaration", + "scope": 16581, + "src": "4169:36:65", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 16574, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "4169:7:65", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 16577, + "indexed": false, + "mutability": "mutable", + "name": "newTokens", + "nameLocation": "4223:9:65", + "nodeType": "VariableDeclaration", + "scope": 16581, + "src": "4215:17:65", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 16576, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "4215:7:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 16579, + "indexed": false, + "mutability": "mutable", + "name": "oldTokens", + "nameLocation": "4250:9:65", + "nodeType": "VariableDeclaration", + "scope": 16581, + "src": "4242:17:65", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 16578, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "4242:7:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "4088:177:65" + }, + "src": "4065:201:65" + }, + { + "anonymous": false, + "documentation": { + "id": 16582, + "nodeType": "StructuredDocumentation", + "src": "4272:356:65", + "text": " @dev Emitted when an indexer closes an allocation\n @param indexer The address of the indexer\n @param allocationId The id of the allocation\n @param subgraphDeploymentId The id of the subgraph deployment\n @param tokens The amount of tokens allocated\n @param forceClosed Whether the allocation was force closed" + }, + "eventSelector": "08f2f865e0fb62d722a51e4d9873199bf6bf52e7d8ee5a2ee2896c9ef719f545", + "id": 16594, + "name": "AllocationClosed", + "nameLocation": "4639:16:65", + "nodeType": "EventDefinition", + "parameters": { + "id": 16593, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 16584, + "indexed": true, + "mutability": "mutable", + "name": "indexer", + "nameLocation": "4681:7:65", + "nodeType": "VariableDeclaration", + "scope": 16594, + "src": "4665:23:65", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 16583, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4665:7:65", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 16586, + "indexed": true, + "mutability": "mutable", + "name": "allocationId", + "nameLocation": "4714:12:65", + "nodeType": "VariableDeclaration", + "scope": 16594, + "src": "4698:28:65", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 16585, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4698:7:65", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 16588, + "indexed": true, + "mutability": "mutable", + "name": "subgraphDeploymentId", + "nameLocation": "4752:20:65", + "nodeType": "VariableDeclaration", + "scope": 16594, + "src": "4736:36:65", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 16587, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "4736:7:65", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 16590, + "indexed": false, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "4790:6:65", + "nodeType": "VariableDeclaration", + "scope": 16594, + "src": "4782:14:65", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 16589, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "4782:7:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 16592, + "indexed": false, + "mutability": "mutable", + "name": "forceClosed", + "nameLocation": "4811:11:65", + "nodeType": "VariableDeclaration", + "scope": 16594, + "src": "4806:16:65", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 16591, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "4806:4:65", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "src": "4655:173:65" + }, + "src": "4633:196:65" + }, + { + "anonymous": false, + "documentation": { + "id": 16595, + "nodeType": "StructuredDocumentation", + "src": "4835:267:65", + "text": " @notice Emitted when a legacy allocation is migrated into the subgraph service\n @param indexer The address of the indexer\n @param allocationId The id of the allocation\n @param subgraphDeploymentId The id of the subgraph deployment" + }, + "eventSelector": "d54c7abc930f6d506da2d08aa7aead4f2443e1db6d5f560384a2f652ff893e19", + "id": 16603, + "name": "LegacyAllocationMigrated", + "nameLocation": "5113:24:65", + "nodeType": "EventDefinition", + "parameters": { + "id": 16602, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 16597, + "indexed": true, + "mutability": "mutable", + "name": "indexer", + "nameLocation": "5163:7:65", + "nodeType": "VariableDeclaration", + "scope": 16603, + "src": "5147:23:65", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 16596, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5147:7:65", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 16599, + "indexed": true, + "mutability": "mutable", + "name": "allocationId", + "nameLocation": "5196:12:65", + "nodeType": "VariableDeclaration", + "scope": 16603, + "src": "5180:28:65", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 16598, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5180:7:65", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 16601, + "indexed": true, + "mutability": "mutable", + "name": "subgraphDeploymentId", + "nameLocation": "5234:20:65", + "nodeType": "VariableDeclaration", + "scope": 16603, + "src": "5218:36:65", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 16600, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "5218:7:65", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "5137:123:65" + }, + "src": "5107:154:65" + }, + { + "anonymous": false, + "documentation": { + "id": 16604, + "nodeType": "StructuredDocumentation", + "src": "5267:139:65", + "text": " @notice Emitted when the maximum POI staleness is updated\n @param maxPOIStaleness The max POI staleness in seconds" + }, + "eventSelector": "21774046e2611ddb52c8c46e1ad97524eeb2e3fda7dcd9428867868b4c4d06ba", + "id": 16608, + "name": "MaxPOIStalenessSet", + "nameLocation": "5417:18:65", + "nodeType": "EventDefinition", + "parameters": { + "id": 16607, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 16606, + "indexed": false, + "mutability": "mutable", + "name": "maxPOIStaleness", + "nameLocation": "5444:15:65", + "nodeType": "VariableDeclaration", + "scope": 16608, + "src": "5436:23:65", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 16605, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "5436:7:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "5435:25:65" + }, + "src": "5411:50:65" + }, + { + "documentation": { + "id": 16609, + "nodeType": "StructuredDocumentation", + "src": "5467:248:65", + "text": " @notice Thrown when an allocation proof is invalid\n Both `signer` and `allocationId` should match for a valid proof.\n @param signer The address that signed the proof\n @param allocationId The id of the allocation" + }, + "errorSelector": "8c5b935d", + "id": 16615, + "name": "AllocationManagerInvalidAllocationProof", + "nameLocation": "5726:39:65", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 16614, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 16611, + "mutability": "mutable", + "name": "signer", + "nameLocation": "5774:6:65", + "nodeType": "VariableDeclaration", + "scope": 16615, + "src": "5766:14:65", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 16610, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5766:7:65", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 16613, + "mutability": "mutable", + "name": "allocationId", + "nameLocation": "5790:12:65", + "nodeType": "VariableDeclaration", + "scope": 16615, + "src": "5782:20:65", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 16612, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5782:7:65", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "5765:38:65" + }, + "src": "5720:84:65" + }, + { + "documentation": { + "id": 16616, + "nodeType": "StructuredDocumentation", + "src": "5810:99:65", + "text": " @notice Thrown when attempting to create an allocation with a zero allocation id" + }, + "errorSelector": "9ffbebde", + "id": 16618, + "name": "AllocationManagerInvalidZeroAllocationId", + "nameLocation": "5920:40:65", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 16617, + "nodeType": "ParameterList", + "parameters": [], + "src": "5960:2:65" + }, + "src": "5914:49:65" + }, + { + "documentation": { + "id": 16619, + "nodeType": "StructuredDocumentation", + "src": "5969:153:65", + "text": " @notice Thrown when attempting to collect indexing rewards on a closed allocationl\n @param allocationId The id of the allocation" + }, + "errorSelector": "1eb5ff95", + "id": 16623, + "name": "AllocationManagerAllocationClosed", + "nameLocation": "6133:33:65", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 16622, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 16621, + "mutability": "mutable", + "name": "allocationId", + "nameLocation": "6175:12:65", + "nodeType": "VariableDeclaration", + "scope": 16623, + "src": "6167:20:65", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 16620, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6167:7:65", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "6166:22:65" + }, + "src": "6127:62:65" + }, + { + "documentation": { + "id": 16624, + "nodeType": "StructuredDocumentation", + "src": "6195:186:65", + "text": " @notice Thrown when attempting to resize an allocation with the same size\n @param allocationId The id of the allocation\n @param tokens The amount of tokens" + }, + "errorSelector": "f32518cd", + "id": 16630, + "name": "AllocationManagerAllocationSameSize", + "nameLocation": "6392:35:65", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 16629, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 16626, + "mutability": "mutable", + "name": "allocationId", + "nameLocation": "6436:12:65", + "nodeType": "VariableDeclaration", + "scope": 16630, + "src": "6428:20:65", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 16625, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6428:7:65", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 16628, + "mutability": "mutable", + "name": "tokens", + "nameLocation": "6458:6:65", + "nodeType": "VariableDeclaration", + "scope": 16630, + "src": "6450:14:65", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 16627, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "6450:7:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "6427:38:65" + }, + "src": "6386:80:65" + }, + { + "body": { + "id": 16648, + "nodeType": "Block", + "src": "6790:93:65", + "statements": [ + { + "expression": { + "arguments": [ + { + "id": 16641, + "name": "_name", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16633, + "src": "6814:5:65", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + }, + { + "id": 16642, + "name": "_version", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16635, + "src": "6821:8:65", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + }, + { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + ], + "id": 16640, + "name": "__EIP712_init", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5757, + "src": "6800:13:65", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_string_memory_ptr_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (string memory,string memory)" + } + }, + "id": 16643, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "6800:30:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 16644, + "nodeType": "ExpressionStatement", + "src": "6800:30:65" + }, + { + "expression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 16645, + "name": "__AllocationManager_init_unchained", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16656, + "src": "6840:34:65", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$__$returns$__$", + "typeString": "function ()" + } + }, + "id": 16646, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "6840:36:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 16647, + "nodeType": "ExpressionStatement", + "src": "6840:36:65" + } + ] + }, + "documentation": { + "id": 16631, + "nodeType": "StructuredDocumentation", + "src": "6472:208:65", + "text": " @notice Initializes the contract and parent contracts\n @param _name The name to use for EIP712 domain separation\n @param _version The version to use for EIP712 domain separation" + }, + "id": 16649, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "id": 16638, + "kind": "modifierInvocation", + "modifierName": { + "id": 16637, + "name": "onlyInitializing", + "nameLocations": [ + "6773:16:65" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5286, + "src": "6773:16:65" + }, + "nodeType": "ModifierInvocation", + "src": "6773:16:65" + } + ], + "name": "__AllocationManager_init", + "nameLocation": "6694:24:65", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 16636, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 16633, + "mutability": "mutable", + "name": "_name", + "nameLocation": "6733:5:65", + "nodeType": "VariableDeclaration", + "scope": 16649, + "src": "6719:19:65", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 16632, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "6719:6:65", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 16635, + "mutability": "mutable", + "name": "_version", + "nameLocation": "6754:8:65", + "nodeType": "VariableDeclaration", + "scope": 16649, + "src": "6740:22:65", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 16634, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "6740:6:65", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "visibility": "internal" + } + ], + "src": "6718:45:65" + }, + "returnParameters": { + "id": 16639, + "nodeType": "ParameterList", + "parameters": [], + "src": "6790:0:65" + }, + "scope": 17363, + "src": "6685:198:65", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 16655, + "nodeType": "Block", + "src": "7017:2:65", + "statements": [] + }, + "documentation": { + "id": 16650, + "nodeType": "StructuredDocumentation", + "src": "6889:51:65", + "text": " @notice Initializes the contract" + }, + "id": 16656, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "id": 16653, + "kind": "modifierInvocation", + "modifierName": { + "id": 16652, + "name": "onlyInitializing", + "nameLocations": [ + "7000:16:65" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5286, + "src": "7000:16:65" + }, + "nodeType": "ModifierInvocation", + "src": "7000:16:65" + } + ], + "name": "__AllocationManager_init_unchained", + "nameLocation": "6954:34:65", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 16651, + "nodeType": "ParameterList", + "parameters": [], + "src": "6988:2:65" + }, + "returnParameters": { + "id": 16654, + "nodeType": "ParameterList", + "parameters": [], + "src": "7017:0:65" + }, + "scope": 17363, + "src": "6945:74:65", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 16680, + "nodeType": "Block", + "src": "7643:178:65", + "statements": [ + { + "expression": { + "arguments": [ + { + "id": 16669, + "name": "_indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16659, + "src": "7680:8:65", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 16670, + "name": "_allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16661, + "src": "7690:13:65", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 16671, + "name": "_subgraphDeploymentId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16663, + "src": "7705:21:65", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "expression": { + "id": 16666, + "name": "_legacyAllocations", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17382, + "src": "7653:18:65", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_State_$16305_storage_$", + "typeString": "mapping(address => struct LegacyAllocation.State storage ref)" + } + }, + "id": 16668, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "7672:7:65", + "memberName": "migrate", + "nodeType": "MemberAccess", + "referencedDeclaration": 16352, + "src": "7653:26:65", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_mapping$_t_address_$_t_struct$_State_$16305_storage_$_$_t_address_$_t_address_$_t_bytes32_$returns$__$attached_to$_t_mapping$_t_address_$_t_struct$_State_$16305_storage_$_$", + "typeString": "function (mapping(address => struct LegacyAllocation.State storage ref),address,address,bytes32)" + } + }, + "id": 16672, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "7653:74:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 16673, + "nodeType": "ExpressionStatement", + "src": "7653:74:65" + }, + { + "eventCall": { + "arguments": [ + { + "id": 16675, + "name": "_indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16659, + "src": "7767:8:65", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 16676, + "name": "_allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16661, + "src": "7777:13:65", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 16677, + "name": "_subgraphDeploymentId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16663, + "src": "7792:21:65", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 16674, + "name": "LegacyAllocationMigrated", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16603, + "src": "7742:24:65", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_bytes32_$returns$__$", + "typeString": "function (address,address,bytes32)" + } + }, + "id": 16678, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "7742:72:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 16679, + "nodeType": "EmitStatement", + "src": "7737:77:65" + } + ] + }, + "documentation": { + "id": 16657, + "nodeType": "StructuredDocumentation", + "src": "7025:498:65", + "text": " @notice Imports a legacy allocation id into the subgraph service\n This is a governor only action that is required to prevent indexers from re-using allocation ids from the\n legacy staking contract. It will revert with LegacyAllocationAlreadyMigrated if the allocation has already been migrated.\n @param _indexer The address of the indexer\n @param _allocationId The id of the allocation\n @param _subgraphDeploymentId The id of the subgraph deployment" + }, + "id": 16681, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_migrateLegacyAllocation", + "nameLocation": "7537:24:65", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 16664, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 16659, + "mutability": "mutable", + "name": "_indexer", + "nameLocation": "7570:8:65", + "nodeType": "VariableDeclaration", + "scope": 16681, + "src": "7562:16:65", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 16658, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "7562:7:65", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 16661, + "mutability": "mutable", + "name": "_allocationId", + "nameLocation": "7588:13:65", + "nodeType": "VariableDeclaration", + "scope": 16681, + "src": "7580:21:65", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 16660, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "7580:7:65", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 16663, + "mutability": "mutable", + "name": "_subgraphDeploymentId", + "nameLocation": "7611:21:65", + "nodeType": "VariableDeclaration", + "scope": 16681, + "src": "7603:29:65", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 16662, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "7603:7:65", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "7561:72:65" + }, + "returnParameters": { + "id": 16665, + "nodeType": "ParameterList", + "parameters": [], + "src": "7643:0:65" + }, + "scope": 17363, + "src": "7528:293:65", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 16780, + "nodeType": "Block", + "src": "8758:1346:65", + "statements": [ + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 16703, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 16698, + "name": "_allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16686, + "src": "8776:13:65", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "arguments": [ + { + "hexValue": "30", + "id": 16701, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8801:1:65", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 16700, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "8793:7:65", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 16699, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "8793:7:65", + "typeDescriptions": {} + } + }, + "id": 16702, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "8793:10:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "8776:27:65", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 16704, + "name": "AllocationManagerInvalidZeroAllocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16618, + "src": "8805:40:65", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$__$returns$_t_error_$", + "typeString": "function () pure returns (error)" + } + }, + "id": 16705, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "8805:42:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 16697, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "8768:7:65", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 16706, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "8768:80:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 16707, + "nodeType": "ExpressionStatement", + "src": "8768:80:65" + }, + { + "expression": { + "arguments": [ + { + "id": 16709, + "name": "_indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16684, + "src": "8882:8:65", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 16710, + "name": "_allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16686, + "src": "8892:13:65", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 16711, + "name": "_allocationProof", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16692, + "src": "8907:16:65", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 16708, + "name": "_verifyAllocationProof", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17362, + "src": "8859:22:65", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_address_$_t_address_$_t_bytes_memory_ptr_$returns$__$", + "typeString": "function (address,address,bytes memory) view" + } + }, + "id": 16712, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "8859:65:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 16713, + "nodeType": "ExpressionStatement", + "src": "8859:65:65" + }, + { + "expression": { + "arguments": [ + { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 16717, + "name": "_graphStaking", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4815, + "src": "9111:13:65", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_contract$_IHorizonStaking_$2625_$", + "typeString": "function () view returns (contract IHorizonStaking)" + } + }, + "id": 16718, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "9111:15:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_IHorizonStaking_$2625", + "typeString": "contract IHorizonStaking" + } + }, + { + "id": 16719, + "name": "_allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16686, + "src": "9128:13:65", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_IHorizonStaking_$2625", + "typeString": "contract IHorizonStaking" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "expression": { + "id": 16714, + "name": "_legacyAllocations", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17382, + "src": "9077:18:65", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_State_$16305_storage_$", + "typeString": "mapping(address => struct LegacyAllocation.State storage ref)" + } + }, + "id": 16716, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "9096:14:65", + "memberName": "revertIfExists", + "nodeType": "MemberAccess", + "referencedDeclaration": 16410, + "src": "9077:33:65", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_mapping$_t_address_$_t_struct$_State_$16305_storage_$_$_t_contract$_IHorizonStaking_$2625_$_t_address_$returns$__$attached_to$_t_mapping$_t_address_$_t_struct$_State_$16305_storage_$_$", + "typeString": "function (mapping(address => struct LegacyAllocation.State storage ref),contract IHorizonStaking,address) view" + } + }, + "id": 16720, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "9077:65:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 16721, + "nodeType": "ExpressionStatement", + "src": "9077:65:65" + }, + { + "assignments": [ + 16723 + ], + "declarations": [ + { + "constant": false, + "id": 16723, + "mutability": "mutable", + "name": "currentEpoch", + "nameLocation": "9161:12:65", + "nodeType": "VariableDeclaration", + "scope": 16780, + "src": "9153:20:65", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 16722, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "9153:7:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 16728, + "initialValue": { + "arguments": [], + "expression": { + "argumentTypes": [], + "expression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 16724, + "name": "_graphEpochManager", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4855, + "src": "9176:18:65", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_contract$_IEpochManager_$369_$", + "typeString": "function () view returns (contract IEpochManager)" + } + }, + "id": 16725, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "9176:20:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_IEpochManager_$369", + "typeString": "contract IEpochManager" + } + }, + "id": 16726, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "9197:12:65", + "memberName": "currentEpoch", + "nodeType": "MemberAccess", + "referencedDeclaration": 346, + "src": "9176:33:65", + "typeDescriptions": { + "typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$", + "typeString": "function () view external returns (uint256)" + } + }, + "id": 16727, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "9176:35:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "9153:58:65" + }, + { + "assignments": [ + 16733 + ], + "declarations": [ + { + "constant": false, + "id": 16733, + "mutability": "mutable", + "name": "allocation", + "nameLocation": "9245:10:65", + "nodeType": "VariableDeclaration", + "scope": 16780, + "src": "9221:34:65", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State" + }, + "typeName": { + "id": 16732, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 16731, + "name": "Allocation.State", + "nameLocations": [ + "9221:10:65", + "9232:5:65" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 15663, + "src": "9221:16:65" + }, + "referencedDeclaration": 15663, + "src": "9221:16:65", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_storage_ptr", + "typeString": "struct Allocation.State" + } + }, + "visibility": "internal" + } + ], + "id": 16747, + "initialValue": { + "arguments": [ + { + "id": 16736, + "name": "_indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16684, + "src": "9291:8:65", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 16737, + "name": "_allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16686, + "src": "9313:13:65", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 16738, + "name": "_subgraphDeploymentId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16688, + "src": "9340:21:65", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "id": 16739, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16690, + "src": "9375:7:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "arguments": [ + { + "id": 16743, + "name": "_subgraphDeploymentId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16688, + "src": "9446:21:65", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "expression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 16740, + "name": "_graphRewardsManager", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4865, + "src": "9396:20:65", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_contract$_IRewardsManager_$678_$", + "typeString": "function () view returns (contract IRewardsManager)" + } + }, + "id": 16741, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "9396:22:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_IRewardsManager_$678", + "typeString": "contract IRewardsManager" + } + }, + "id": 16742, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "9419:26:65", + "memberName": "onSubgraphAllocationUpdate", + "nodeType": "MemberAccess", + "referencedDeclaration": 677, + "src": "9396:49:65", + "typeDescriptions": { + "typeIdentifier": "t_function_external_nonpayable$_t_bytes32_$returns$_t_uint256_$", + "typeString": "function (bytes32) external returns (uint256)" + } + }, + "id": 16744, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "9396:72:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 16745, + "name": "currentEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16723, + "src": "9482:12:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "id": 16734, + "name": "_allocations", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17376, + "src": "9258:12:65", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_State_$15663_storage_$", + "typeString": "mapping(address => struct Allocation.State storage ref)" + } + }, + "id": 16735, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "9271:6:65", + "memberName": "create", + "nodeType": "MemberAccess", + "referencedDeclaration": 15741, + "src": "9258:19:65", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_mapping$_t_address_$_t_struct$_State_$15663_storage_$_$_t_address_$_t_address_$_t_bytes32_$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_struct$_State_$15663_memory_ptr_$attached_to$_t_mapping$_t_address_$_t_struct$_State_$15663_storage_$_$", + "typeString": "function (mapping(address => struct Allocation.State storage ref),address,address,bytes32,uint256,uint256,uint256) returns (struct Allocation.State memory)" + } + }, + "id": 16746, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "9258:246:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "9221:283:65" + }, + { + "expression": { + "arguments": [ + { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 16751, + "name": "_graphStaking", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4815, + "src": "9689:13:65", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_contract$_IHorizonStaking_$2625_$", + "typeString": "function () view returns (contract IHorizonStaking)" + } + }, + "id": 16752, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "9689:15:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_IHorizonStaking_$2625", + "typeString": "contract IHorizonStaking" + } + }, + { + "id": 16753, + "name": "_indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16684, + "src": "9706:8:65", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 16754, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16690, + "src": "9716:7:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 16755, + "name": "_delegationRatio", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16694, + "src": "9725:16:65", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_IHorizonStaking_$2625", + "typeString": "contract IHorizonStaking" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + ], + "expression": { + "id": 16748, + "name": "allocationProvisionTracker", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17387, + "src": "9657:26:65", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", + "typeString": "mapping(address => uint256)" + } + }, + "id": 16750, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "9684:4:65", + "memberName": "lock", + "nodeType": "MemberAccess", + "referencedDeclaration": 1726, + "src": "9657:31:65", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_mapping$_t_address_$_t_uint256_$_$_t_contract$_IHorizonStaking_$2625_$_t_address_$_t_uint256_$_t_uint32_$returns$__$attached_to$_t_mapping$_t_address_$_t_uint256_$_$", + "typeString": "function (mapping(address => uint256),contract IHorizonStaking,address,uint256,uint32)" + } + }, + "id": 16756, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "9657:85:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 16757, + "nodeType": "ExpressionStatement", + "src": "9657:85:65" + }, + { + "expression": { + "id": 16769, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "baseExpression": { + "id": 16758, + "name": "_subgraphAllocatedTokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17395, + "src": "9822:24:65", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", + "typeString": "mapping(bytes32 => uint256)" + } + }, + "id": 16761, + "indexExpression": { + "expression": { + "id": 16759, + "name": "allocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16733, + "src": "9847:10:65", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "id": 16760, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "9858:20:65", + "memberName": "subgraphDeploymentId", + "nodeType": "MemberAccess", + "referencedDeclaration": 15648, + "src": "9847:31:65", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "9822:57:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 16768, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "baseExpression": { + "id": 16762, + "name": "_subgraphAllocatedTokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17395, + "src": "9894:24:65", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", + "typeString": "mapping(bytes32 => uint256)" + } + }, + "id": 16765, + "indexExpression": { + "expression": { + "id": 16763, + "name": "allocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16733, + "src": "9919:10:65", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "id": 16764, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "9930:20:65", + "memberName": "subgraphDeploymentId", + "nodeType": "MemberAccess", + "referencedDeclaration": 15648, + "src": "9919:31:65", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "9894:57:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "expression": { + "id": 16766, + "name": "allocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16733, + "src": "9966:10:65", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "id": 16767, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "9977:6:65", + "memberName": "tokens", + "nodeType": "MemberAccess", + "referencedDeclaration": 15650, + "src": "9966:17:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "9894:89:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "9822:161:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 16770, + "nodeType": "ExpressionStatement", + "src": "9822:161:65" + }, + { + "eventCall": { + "arguments": [ + { + "id": 16772, + "name": "_indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16684, + "src": "10017:8:65", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 16773, + "name": "_allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16686, + "src": "10027:13:65", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 16774, + "name": "_subgraphDeploymentId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16688, + "src": "10042:21:65", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "expression": { + "id": 16775, + "name": "allocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16733, + "src": "10065:10:65", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "id": 16776, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "10076:6:65", + "memberName": "tokens", + "nodeType": "MemberAccess", + "referencedDeclaration": 15650, + "src": "10065:17:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 16777, + "name": "currentEpoch", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16723, + "src": "10084:12:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 16771, + "name": "AllocationCreated", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16547, + "src": "9999:17:65", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_bytes32_$_t_uint256_$_t_uint256_$returns$__$", + "typeString": "function (address,address,bytes32,uint256,uint256)" + } + }, + "id": 16778, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "9999:98:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 16779, + "nodeType": "EmitStatement", + "src": "9994:103:65" + } + ] + }, + "documentation": { + "id": 16682, + "nodeType": "StructuredDocumentation", + "src": "7827:699:65", + "text": " @notice Create an allocation\n @dev The `_allocationProof` is a 65-bytes Ethereum signed message of `keccak256(indexerAddress,allocationId)`\n Requirements:\n - `_allocationId` must not be the zero address\n Emits a {AllocationCreated} event\n @param _indexer The address of the indexer\n @param _allocationId The id of the allocation to be created\n @param _subgraphDeploymentId The subgraph deployment Id\n @param _tokens The amount of tokens to allocate\n @param _allocationProof Signed proof of allocation id address ownership\n @param _delegationRatio The delegation ratio to consider when locking tokens" + }, + "id": 16781, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_allocate", + "nameLocation": "8540:9:65", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 16695, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 16684, + "mutability": "mutable", + "name": "_indexer", + "nameLocation": "8567:8:65", + "nodeType": "VariableDeclaration", + "scope": 16781, + "src": "8559:16:65", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 16683, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "8559:7:65", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 16686, + "mutability": "mutable", + "name": "_allocationId", + "nameLocation": "8593:13:65", + "nodeType": "VariableDeclaration", + "scope": 16781, + "src": "8585:21:65", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 16685, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "8585:7:65", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 16688, + "mutability": "mutable", + "name": "_subgraphDeploymentId", + "nameLocation": "8624:21:65", + "nodeType": "VariableDeclaration", + "scope": 16781, + "src": "8616:29:65", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 16687, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "8616:7:65", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 16690, + "mutability": "mutable", + "name": "_tokens", + "nameLocation": "8663:7:65", + "nodeType": "VariableDeclaration", + "scope": 16781, + "src": "8655:15:65", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 16689, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "8655:7:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 16692, + "mutability": "mutable", + "name": "_allocationProof", + "nameLocation": "8693:16:65", + "nodeType": "VariableDeclaration", + "scope": 16781, + "src": "8680:29:65", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 16691, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "8680:5:65", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 16694, + "mutability": "mutable", + "name": "_delegationRatio", + "nameLocation": "8726:16:65", + "nodeType": "VariableDeclaration", + "scope": 16781, + "src": "8719:23:65", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 16693, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "8719:6:65", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + } + ], + "src": "8549:199:65" + }, + "returnParameters": { + "id": 16696, + "nodeType": "ParameterList", + "parameters": [], + "src": "8758:0:65" + }, + "scope": 17363, + "src": "8531:1573:65", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 17043, + "nodeType": "Block", + "src": "12059:3207:65", + "statements": [ + { + "assignments": [ + 16801 + ], + "declarations": [ + { + "constant": false, + "id": 16801, + "mutability": "mutable", + "name": "allocation", + "nameLocation": "12093:10:65", + "nodeType": "VariableDeclaration", + "scope": 17043, + "src": "12069:34:65", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State" + }, + "typeName": { + "id": 16800, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 16799, + "name": "Allocation.State", + "nameLocations": [ + "12069:10:65", + "12080:5:65" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 15663, + "src": "12069:16:65" + }, + "referencedDeclaration": 15663, + "src": "12069:16:65", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_storage_ptr", + "typeString": "struct Allocation.State" + } + }, + "visibility": "internal" + } + ], + "id": 16806, + "initialValue": { + "arguments": [ + { + "id": 16804, + "name": "_allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16784, + "src": "12123:13:65", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "expression": { + "id": 16802, + "name": "_allocations", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17376, + "src": "12106:12:65", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_State_$15663_storage_$", + "typeString": "mapping(address => struct Allocation.State storage ref)" + } + }, + "id": 16803, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "12119:3:65", + "memberName": "get", + "nodeType": "MemberAccess", + "referencedDeclaration": 15913, + "src": "12106:16:65", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_mapping$_t_address_$_t_struct$_State_$15663_storage_$_$_t_address_$returns$_t_struct$_State_$15663_memory_ptr_$attached_to$_t_mapping$_t_address_$_t_struct$_State_$15663_storage_$_$", + "typeString": "function (mapping(address => struct Allocation.State storage ref),address) view returns (struct Allocation.State memory)" + } + }, + "id": 16805, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "12106:31:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "12069:68:65" + }, + { + "expression": { + "arguments": [ + { + "arguments": [], + "expression": { + "argumentTypes": [], + "expression": { + "id": 16808, + "name": "allocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16801, + "src": "12155:10:65", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "id": 16809, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "12166:6:65", + "memberName": "isOpen", + "nodeType": "MemberAccess", + "referencedDeclaration": 15980, + "src": "12155:17:65", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_struct$_State_$15663_memory_ptr_$returns$_t_bool_$attached_to$_t_struct$_State_$15663_memory_ptr_$", + "typeString": "function (struct Allocation.State memory) pure returns (bool)" + } + }, + "id": 16810, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "12155:19:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [ + { + "id": 16812, + "name": "_allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16784, + "src": "12210:13:65", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 16811, + "name": "AllocationManagerAllocationClosed", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16623, + "src": "12176:33:65", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_address_$returns$_t_error_$", + "typeString": "function (address) pure returns (error)" + } + }, + "id": 16813, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "12176:48:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 16807, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "12147:7:65", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 16814, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "12147:78:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 16815, + "nodeType": "ExpressionStatement", + "src": "12147:78:65" + }, + { + "assignments": [ + 16817 + ], + "declarations": [ + { + "constant": false, + "id": 16817, + "mutability": "mutable", + "name": "tokensRewards", + "nameLocation": "12303:13:65", + "nodeType": "VariableDeclaration", + "scope": 17043, + "src": "12295:21:65", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 16816, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "12295:7:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 16851, + "initialValue": { + "condition": { + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 16843, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 16834, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 16827, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 16822, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "12320:36:65", + "subExpression": { + "arguments": [ + { + "id": 16820, + "name": "maxPOIStaleness", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17390, + "src": "12340:15:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "id": 16818, + "name": "allocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16801, + "src": "12321:10:65", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "id": 16819, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "12332:7:65", + "memberName": "isStale", + "nodeType": "MemberAccess", + "referencedDeclaration": 15946, + "src": "12321:18:65", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_struct$_State_$15663_memory_ptr_$_t_uint256_$returns$_t_bool_$attached_to$_t_struct$_State_$15663_memory_ptr_$", + "typeString": "function (struct Allocation.State memory,uint256) view returns (bool)" + } + }, + "id": 16821, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "12321:35:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "&&", + "rightExpression": { + "id": 16826, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "12372:26:65", + "subExpression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "expression": { + "id": 16823, + "name": "allocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16801, + "src": "12373:10:65", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "id": 16824, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "12384:12:65", + "memberName": "isAltruistic", + "nodeType": "MemberAccess", + "referencedDeclaration": 15999, + "src": "12373:23:65", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_struct$_State_$15663_memory_ptr_$returns$_t_bool_$attached_to$_t_struct$_State_$15663_memory_ptr_$", + "typeString": "function (struct Allocation.State memory) pure returns (bool)" + } + }, + "id": 16825, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "12373:25:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "12320:78:65", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "&&", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "id": 16833, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 16828, + "name": "_poi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16786, + "src": "12414:4:65", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "arguments": [ + { + "hexValue": "30", + "id": 16831, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12430:1:65", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 16830, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "12422:7:65", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes32_$", + "typeString": "type(bytes32)" + }, + "typeName": { + "id": 16829, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "12422:7:65", + "typeDescriptions": {} + } + }, + "id": 16832, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "12422:10:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "src": "12414:18:65", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "12320:112:65", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "id": 16835, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "12319:114:65", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "&&", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 16842, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "expression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 16836, + "name": "_graphEpochManager", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4855, + "src": "12437:18:65", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_contract$_IEpochManager_$369_$", + "typeString": "function () view returns (contract IEpochManager)" + } + }, + "id": 16837, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "12437:20:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_IEpochManager_$369", + "typeString": "contract IEpochManager" + } + }, + "id": 16838, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "12458:12:65", + "memberName": "currentEpoch", + "nodeType": "MemberAccess", + "referencedDeclaration": 346, + "src": "12437:33:65", + "typeDescriptions": { + "typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$", + "typeString": "function () view external returns (uint256)" + } + }, + "id": 16839, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "12437:35:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "expression": { + "id": 16840, + "name": "allocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16801, + "src": "12475:10:65", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "id": 16841, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "12486:14:65", + "memberName": "createdAtEpoch", + "nodeType": "MemberAccess", + "referencedDeclaration": 15662, + "src": "12475:25:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "12437:63:65", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "12319:181:65", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseExpression": { + "hexValue": "30", + "id": 16849, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12579:1:65", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "id": 16850, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "Conditional", + "src": "12319:261:65", + "trueExpression": { + "arguments": [ + { + "id": 16847, + "name": "_allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16784, + "src": "12550:13:65", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "expression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 16844, + "name": "_graphRewardsManager", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4865, + "src": "12515:20:65", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_contract$_IRewardsManager_$678_$", + "typeString": "function () view returns (contract IRewardsManager)" + } + }, + "id": 16845, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "12515:22:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_IRewardsManager_$678", + "typeString": "contract IRewardsManager" + } + }, + "id": 16846, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "12538:11:65", + "memberName": "takeRewards", + "nodeType": "MemberAccess", + "referencedDeclaration": 663, + "src": "12515:34:65", + "typeDescriptions": { + "typeIdentifier": "t_function_external_nonpayable$_t_address_$returns$_t_uint256_$", + "typeString": "function (address) external returns (uint256)" + } + }, + "id": 16848, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "12515:49:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "12295:285:65" + }, + { + "expression": { + "arguments": [ + { + "id": 16855, + "name": "_allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16784, + "src": "12742:13:65", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "arguments": [ + { + "expression": { + "id": 16859, + "name": "allocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16801, + "src": "12819:10:65", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "id": 16860, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "12830:20:65", + "memberName": "subgraphDeploymentId", + "nodeType": "MemberAccess", + "referencedDeclaration": 15648, + "src": "12819:31:65", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "expression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 16856, + "name": "_graphRewardsManager", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4865, + "src": "12769:20:65", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_contract$_IRewardsManager_$678_$", + "typeString": "function () view returns (contract IRewardsManager)" + } + }, + "id": 16857, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "12769:22:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_IRewardsManager_$678", + "typeString": "contract IRewardsManager" + } + }, + "id": 16858, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "12792:26:65", + "memberName": "onSubgraphAllocationUpdate", + "nodeType": "MemberAccess", + "referencedDeclaration": 677, + "src": "12769:49:65", + "typeDescriptions": { + "typeIdentifier": "t_function_external_nonpayable$_t_bytes32_$returns$_t_uint256_$", + "typeString": "function (bytes32) external returns (uint256)" + } + }, + "id": 16861, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "12769:82:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "id": 16852, + "name": "_allocations", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17376, + "src": "12700:12:65", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_State_$15663_storage_$", + "typeString": "mapping(address => struct Allocation.State storage ref)" + } + }, + "id": 16854, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "12713:15:65", + "memberName": "snapshotRewards", + "nodeType": "MemberAccess", + "referencedDeclaration": 15818, + "src": "12700:28:65", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_mapping$_t_address_$_t_struct$_State_$15663_storage_$_$_t_address_$_t_uint256_$returns$__$attached_to$_t_mapping$_t_address_$_t_struct$_State_$15663_storage_$_$", + "typeString": "function (mapping(address => struct Allocation.State storage ref),address,uint256)" + } + }, + "id": 16862, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "12700:161:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 16863, + "nodeType": "ExpressionStatement", + "src": "12700:161:65" + }, + { + "expression": { + "arguments": [ + { + "id": 16867, + "name": "_allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16784, + "src": "12895:13:65", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "expression": { + "id": 16864, + "name": "_allocations", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17376, + "src": "12871:12:65", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_State_$15663_storage_$", + "typeString": "mapping(address => struct Allocation.State storage ref)" + } + }, + "id": 16866, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "12884:10:65", + "memberName": "presentPOI", + "nodeType": "MemberAccess", + "referencedDeclaration": 15779, + "src": "12871:23:65", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_mapping$_t_address_$_t_struct$_State_$15663_storage_$_$_t_address_$returns$__$attached_to$_t_mapping$_t_address_$_t_struct$_State_$15663_storage_$_$", + "typeString": "function (mapping(address => struct Allocation.State storage ref),address)" + } + }, + "id": 16868, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "12871:38:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 16869, + "nodeType": "ExpressionStatement", + "src": "12871:38:65" + }, + { + "expression": { + "arguments": [ + { + "id": 16873, + "name": "_allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16784, + "src": "13015:13:65", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "expression": { + "id": 16870, + "name": "_allocations", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17376, + "src": "12982:12:65", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_State_$15663_storage_$", + "typeString": "mapping(address => struct Allocation.State storage ref)" + } + }, + "id": 16872, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "12995:19:65", + "memberName": "clearPendingRewards", + "nodeType": "MemberAccess", + "referencedDeclaration": 15855, + "src": "12982:32:65", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_mapping$_t_address_$_t_struct$_State_$15663_storage_$_$_t_address_$returns$__$attached_to$_t_mapping$_t_address_$_t_struct$_State_$15663_storage_$_$", + "typeString": "function (mapping(address => struct Allocation.State storage ref),address)" + } + }, + "id": 16874, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "12982:47:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 16875, + "nodeType": "ExpressionStatement", + "src": "12982:47:65" + }, + { + "assignments": [ + 16877 + ], + "declarations": [ + { + "constant": false, + "id": 16877, + "mutability": "mutable", + "name": "tokensIndexerRewards", + "nameLocation": "13048:20:65", + "nodeType": "VariableDeclaration", + "scope": 17043, + "src": "13040:28:65", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 16876, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "13040:7:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 16879, + "initialValue": { + "hexValue": "30", + "id": 16878, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13071:1:65", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "nodeType": "VariableDeclarationStatement", + "src": "13040:32:65" + }, + { + "assignments": [ + 16881 + ], + "declarations": [ + { + "constant": false, + "id": 16881, + "mutability": "mutable", + "name": "tokensDelegationRewards", + "nameLocation": "13090:23:65", + "nodeType": "VariableDeclaration", + "scope": 17043, + "src": "13082:31:65", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 16880, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "13082:7:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 16883, + "initialValue": { + "hexValue": "30", + "id": 16882, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13116:1:65", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "nodeType": "VariableDeclarationStatement", + "src": "13082:35:65" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 16886, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 16884, + "name": "tokensRewards", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16817, + "src": "13131:13:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "hexValue": "30", + "id": 16885, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13148:1:65", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "13131:18:65", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 17011, + "nodeType": "IfStatement", + "src": "13127:1531:65", + "trueBody": { + "id": 17010, + "nodeType": "Block", + "src": "13151:1507:65", + "statements": [ + { + "assignments": [ + 16888 + ], + "declarations": [ + { + "constant": false, + "id": 16888, + "mutability": "mutable", + "name": "delegatorCut", + "nameLocation": "13221:12:65", + "nodeType": "VariableDeclaration", + "scope": 17010, + "src": "13213:20:65", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 16887, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "13213:7:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 16902, + "initialValue": { + "arguments": [ + { + "expression": { + "id": 16892, + "name": "allocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16801, + "src": "13289:10:65", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "id": 16893, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "13300:7:65", + "memberName": "indexer", + "nodeType": "MemberAccess", + "referencedDeclaration": 15646, + "src": "13289:18:65", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "arguments": [ + { + "id": 16896, + "name": "this", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -28, + "src": "13333:4:65", + "typeDescriptions": { + "typeIdentifier": "t_contract$_AllocationManager_$17363", + "typeString": "contract AllocationManager" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_AllocationManager_$17363", + "typeString": "contract AllocationManager" + } + ], + "id": 16895, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "13325:7:65", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 16894, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "13325:7:65", + "typeDescriptions": {} + } + }, + "id": 16897, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "13325:13:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "expression": { + "expression": { + "id": 16898, + "name": "IGraphPayments", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2489, + "src": "13356:14:65", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_IGraphPayments_$2489_$", + "typeString": "type(contract IGraphPayments)" + } + }, + "id": 16899, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "13371:12:65", + "memberName": "PaymentTypes", + "nodeType": "MemberAccess", + "referencedDeclaration": 2433, + "src": "13356:27:65", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_PaymentTypes_$2433_$", + "typeString": "type(enum IGraphPayments.PaymentTypes)" + } + }, + "id": 16900, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "13384:15:65", + "memberName": "IndexingRewards", + "nodeType": "MemberAccess", + "referencedDeclaration": 2432, + "src": "13356:43:65", + "typeDescriptions": { + "typeIdentifier": "t_enum$_PaymentTypes_$2433", + "typeString": "enum IGraphPayments.PaymentTypes" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_enum$_PaymentTypes_$2433", + "typeString": "enum IGraphPayments.PaymentTypes" + } + ], + "expression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 16889, + "name": "_graphStaking", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4815, + "src": "13236:13:65", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_contract$_IHorizonStaking_$2625_$", + "typeString": "function () view returns (contract IHorizonStaking)" + } + }, + "id": 16890, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "13236:15:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_IHorizonStaking_$2625", + "typeString": "contract IHorizonStaking" + } + }, + "id": 16891, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "13252:19:65", + "memberName": "getDelegationFeeCut", + "nodeType": "MemberAccess", + "referencedDeclaration": 2939, + "src": "13236:35:65", + "typeDescriptions": { + "typeIdentifier": "t_function_external_view$_t_address_$_t_address_$_t_enum$_PaymentTypes_$2433_$returns$_t_uint256_$", + "typeString": "function (address,address,enum IGraphPayments.PaymentTypes) view external returns (uint256)" + } + }, + "id": 16901, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "13236:177:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "13213:200:65" + }, + { + "assignments": [ + 16907 + ], + "declarations": [ + { + "constant": false, + "id": 16907, + "mutability": "mutable", + "name": "delegationPool", + "nameLocation": "13470:14:65", + "nodeType": "VariableDeclaration", + "scope": 17010, + "src": "13427:57:65", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_DelegationPool_$3992_memory_ptr", + "typeString": "struct IHorizonStakingTypes.DelegationPool" + }, + "typeName": { + "id": 16906, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 16905, + "name": "IHorizonStakingTypes.DelegationPool", + "nameLocations": [ + "13427:20:65", + "13448:14:65" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 3992, + "src": "13427:35:65" + }, + "referencedDeclaration": 3992, + "src": "13427:35:65", + "typeDescriptions": { + "typeIdentifier": "t_struct$_DelegationPool_$3992_storage_ptr", + "typeString": "struct IHorizonStakingTypes.DelegationPool" + } + }, + "visibility": "internal" + } + ], + "id": 16918, + "initialValue": { + "arguments": [ + { + "expression": { + "id": 16911, + "name": "allocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16801, + "src": "13538:10:65", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "id": 16912, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "13549:7:65", + "memberName": "indexer", + "nodeType": "MemberAccess", + "referencedDeclaration": 15646, + "src": "13538:18:65", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "arguments": [ + { + "id": 16915, + "name": "this", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -28, + "src": "13582:4:65", + "typeDescriptions": { + "typeIdentifier": "t_contract$_AllocationManager_$17363", + "typeString": "contract AllocationManager" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_AllocationManager_$17363", + "typeString": "contract AllocationManager" + } + ], + "id": 16914, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "13574:7:65", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 16913, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "13574:7:65", + "typeDescriptions": {} + } + }, + "id": 16916, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "13574:13:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "expression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 16908, + "name": "_graphStaking", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4815, + "src": "13487:13:65", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_contract$_IHorizonStaking_$2625_$", + "typeString": "function () view returns (contract IHorizonStaking)" + } + }, + "id": 16909, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "13487:15:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_IHorizonStaking_$2625", + "typeString": "contract IHorizonStaking" + } + }, + "id": 16910, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "13503:17:65", + "memberName": "getDelegationPool", + "nodeType": "MemberAccess", + "referencedDeclaration": 2913, + "src": "13487:33:65", + "typeDescriptions": { + "typeIdentifier": "t_function_external_view$_t_address_$_t_address_$returns$_t_struct$_DelegationPool_$3992_memory_ptr_$", + "typeString": "function (address,address) view external returns (struct IHorizonStakingTypes.DelegationPool memory)" + } + }, + "id": 16917, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "13487:114:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_DelegationPool_$3992_memory_ptr", + "typeString": "struct IHorizonStakingTypes.DelegationPool memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "13427:174:65" + }, + { + "expression": { + "id": 16930, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 16919, + "name": "tokensDelegationRewards", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16881, + "src": "13718:23:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 16923, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 16920, + "name": "delegationPool", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16907, + "src": "13744:14:65", + "typeDescriptions": { + "typeIdentifier": "t_struct$_DelegationPool_$3992_memory_ptr", + "typeString": "struct IHorizonStakingTypes.DelegationPool memory" + } + }, + "id": 16921, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "13759:6:65", + "memberName": "shares", + "nodeType": "MemberAccess", + "referencedDeclaration": 3985, + "src": "13744:21:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "hexValue": "30", + "id": 16922, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13768:1:65", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "13744:25:65", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseExpression": { + "hexValue": "30", + "id": 16928, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13809:1:65", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "id": 16929, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "Conditional", + "src": "13744:66:65", + "trueExpression": { + "arguments": [ + { + "id": 16926, + "name": "delegatorCut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16888, + "src": "13793:12:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "id": 16924, + "name": "tokensRewards", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16817, + "src": "13772:13:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 16925, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "13786:6:65", + "memberName": "mulPPM", + "nodeType": "MemberAccess", + "referencedDeclaration": 4496, + "src": "13772:20:65", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$attached_to$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 16927, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "13772:34:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "13718:92:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 16931, + "nodeType": "ExpressionStatement", + "src": "13718:92:65" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 16934, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 16932, + "name": "tokensDelegationRewards", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16881, + "src": "13828:23:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "hexValue": "30", + "id": 16933, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13854:1:65", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "13828:27:65", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 16959, + "nodeType": "IfStatement", + "src": "13824:251:65", + "trueBody": { + "id": 16958, + "nodeType": "Block", + "src": "13857:218:65", + "statements": [ + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 16940, + "name": "_graphStaking", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4815, + "src": "13905:13:65", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_contract$_IHorizonStaking_$2625_$", + "typeString": "function () view returns (contract IHorizonStaking)" + } + }, + "id": 16941, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "13905:15:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_IHorizonStaking_$2625", + "typeString": "contract IHorizonStaking" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_IHorizonStaking_$2625", + "typeString": "contract IHorizonStaking" + } + ], + "id": 16939, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "13897:7:65", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 16938, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "13897:7:65", + "typeDescriptions": {} + } + }, + "id": 16942, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "13897:24:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 16943, + "name": "tokensDelegationRewards", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16881, + "src": "13923:23:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 16935, + "name": "_graphToken", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4805, + "src": "13875:11:65", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_contract$_IGraphToken_$758_$", + "typeString": "function () view returns (contract IGraphToken)" + } + }, + "id": 16936, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "13875:13:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_IGraphToken_$758", + "typeString": "contract IGraphToken" + } + }, + "id": 16937, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "13889:7:65", + "memberName": "approve", + "nodeType": "MemberAccess", + "referencedDeclaration": 6134, + "src": "13875:21:65", + "typeDescriptions": { + "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$returns$_t_bool_$", + "typeString": "function (address,uint256) external returns (bool)" + } + }, + "id": 16944, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "13875:72:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 16945, + "nodeType": "ExpressionStatement", + "src": "13875:72:65" + }, + { + "expression": { + "arguments": [ + { + "expression": { + "id": 16949, + "name": "allocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16801, + "src": "14001:10:65", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "id": 16950, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "14012:7:65", + "memberName": "indexer", + "nodeType": "MemberAccess", + "referencedDeclaration": 15646, + "src": "14001:18:65", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "arguments": [ + { + "id": 16953, + "name": "this", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -28, + "src": "14029:4:65", + "typeDescriptions": { + "typeIdentifier": "t_contract$_AllocationManager_$17363", + "typeString": "contract AllocationManager" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_AllocationManager_$17363", + "typeString": "contract AllocationManager" + } + ], + "id": 16952, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "14021:7:65", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 16951, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "14021:7:65", + "typeDescriptions": {} + } + }, + "id": 16954, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "14021:13:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 16955, + "name": "tokensDelegationRewards", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16881, + "src": "14036:23:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 16946, + "name": "_graphStaking", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4815, + "src": "13965:13:65", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_contract$_IHorizonStaking_$2625_$", + "typeString": "function () view returns (contract IHorizonStaking)" + } + }, + "id": 16947, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "13965:15:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_IHorizonStaking_$2625", + "typeString": "contract IHorizonStaking" + } + }, + "id": 16948, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "13981:19:65", + "memberName": "addToDelegationPool", + "nodeType": "MemberAccess", + "referencedDeclaration": 3773, + "src": "13965:35:65", + "typeDescriptions": { + "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256) external" + } + }, + "id": 16956, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "13965:95:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 16957, + "nodeType": "ExpressionStatement", + "src": "13965:95:65" + } + ] + } + }, + { + "expression": { + "id": 16964, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 16960, + "name": "tokensIndexerRewards", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16877, + "src": "14134:20:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 16963, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 16961, + "name": "tokensRewards", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16817, + "src": "14157:13:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "id": 16962, + "name": "tokensDelegationRewards", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16881, + "src": "14173:23:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "14157:39:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "14134:62:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 16965, + "nodeType": "ExpressionStatement", + "src": "14134:62:65" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 16968, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 16966, + "name": "tokensIndexerRewards", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16877, + "src": "14214:20:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "hexValue": "30", + "id": 16967, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "14237:1:65", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "14214:24:65", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 17009, + "nodeType": "IfStatement", + "src": "14210:438:65", + "trueBody": { + "id": 17008, + "nodeType": "Block", + "src": "14240:408:65", + "statements": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 16974, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 16969, + "name": "_paymentsDestination", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16792, + "src": "14262:20:65", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "arguments": [ + { + "hexValue": "30", + "id": 16972, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "14294:1:65", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 16971, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "14286:7:65", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 16970, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "14286:7:65", + "typeDescriptions": {} + } + }, + "id": 16973, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "14286:10:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "14262:34:65", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "id": 17006, + "nodeType": "Block", + "src": "14525:109:65", + "statements": [ + { + "expression": { + "arguments": [ + { + "id": 17002, + "name": "_paymentsDestination", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16792, + "src": "14572:20:65", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 17003, + "name": "tokensIndexerRewards", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16877, + "src": "14594:20:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 16999, + "name": "_graphToken", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4805, + "src": "14547:11:65", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_contract$_IGraphToken_$758_$", + "typeString": "function () view returns (contract IGraphToken)" + } + }, + "id": 17000, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "14547:13:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_IGraphToken_$758", + "typeString": "contract IGraphToken" + } + }, + "id": 17001, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "14561:10:65", + "memberName": "pushTokens", + "nodeType": "MemberAccess", + "referencedDeclaration": 818, + "src": "14547:24:65", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IGraphToken_$758_$_t_address_$_t_uint256_$returns$__$attached_to$_t_contract$_IGraphToken_$758_$", + "typeString": "function (contract IGraphToken,address,uint256)" + } + }, + "id": 17004, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "14547:68:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 17005, + "nodeType": "ExpressionStatement", + "src": "14547:68:65" + } + ] + }, + "id": 17007, + "nodeType": "IfStatement", + "src": "14258:376:65", + "trueBody": { + "id": 16998, + "nodeType": "Block", + "src": "14298:221:65", + "statements": [ + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 16980, + "name": "_graphStaking", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4815, + "src": "14350:13:65", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_contract$_IHorizonStaking_$2625_$", + "typeString": "function () view returns (contract IHorizonStaking)" + } + }, + "id": 16981, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "14350:15:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_IHorizonStaking_$2625", + "typeString": "contract IHorizonStaking" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_IHorizonStaking_$2625", + "typeString": "contract IHorizonStaking" + } + ], + "id": 16979, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "14342:7:65", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 16978, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "14342:7:65", + "typeDescriptions": {} + } + }, + "id": 16982, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "14342:24:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 16983, + "name": "tokensIndexerRewards", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16877, + "src": "14368:20:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 16975, + "name": "_graphToken", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4805, + "src": "14320:11:65", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_contract$_IGraphToken_$758_$", + "typeString": "function () view returns (contract IGraphToken)" + } + }, + "id": 16976, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "14320:13:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_IGraphToken_$758", + "typeString": "contract IGraphToken" + } + }, + "id": 16977, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "14334:7:65", + "memberName": "approve", + "nodeType": "MemberAccess", + "referencedDeclaration": 6134, + "src": "14320:21:65", + "typeDescriptions": { + "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$returns$_t_bool_$", + "typeString": "function (address,uint256) external returns (bool)" + } + }, + "id": 16984, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "14320:69:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 16985, + "nodeType": "ExpressionStatement", + "src": "14320:69:65" + }, + { + "expression": { + "arguments": [ + { + "expression": { + "id": 16989, + "name": "allocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16801, + "src": "14444:10:65", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "id": 16990, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "14455:7:65", + "memberName": "indexer", + "nodeType": "MemberAccess", + "referencedDeclaration": 15646, + "src": "14444:18:65", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "arguments": [ + { + "id": 16993, + "name": "this", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -28, + "src": "14472:4:65", + "typeDescriptions": { + "typeIdentifier": "t_contract$_AllocationManager_$17363", + "typeString": "contract AllocationManager" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_AllocationManager_$17363", + "typeString": "contract AllocationManager" + } + ], + "id": 16992, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "14464:7:65", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 16991, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "14464:7:65", + "typeDescriptions": {} + } + }, + "id": 16994, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "14464:13:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 16995, + "name": "tokensIndexerRewards", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16877, + "src": "14479:20:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 16986, + "name": "_graphStaking", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4815, + "src": "14411:13:65", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_contract$_IHorizonStaking_$2625_$", + "typeString": "function () view returns (contract IHorizonStaking)" + } + }, + "id": 16987, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "14411:15:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_IHorizonStaking_$2625", + "typeString": "contract IHorizonStaking" + } + }, + "id": 16988, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "14427:16:65", + "memberName": "stakeToProvision", + "nodeType": "MemberAccess", + "referencedDeclaration": 3665, + "src": "14411:32:65", + "typeDescriptions": { + "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256) external" + } + }, + "id": 16996, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "14411:89:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 16997, + "nodeType": "ExpressionStatement", + "src": "14411:89:65" + } + ] + } + } + ] + } + } + ] + } + }, + { + "eventCall": { + "arguments": [ + { + "expression": { + "id": 17013, + "name": "allocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16801, + "src": "14711:10:65", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "id": 17014, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "14722:7:65", + "memberName": "indexer", + "nodeType": "MemberAccess", + "referencedDeclaration": 15646, + "src": "14711:18:65", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 17015, + "name": "_allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16784, + "src": "14743:13:65", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "expression": { + "id": 17016, + "name": "allocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16801, + "src": "14770:10:65", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "id": 17017, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "14781:20:65", + "memberName": "subgraphDeploymentId", + "nodeType": "MemberAccess", + "referencedDeclaration": 15648, + "src": "14770:31:65", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "id": 17018, + "name": "tokensRewards", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16817, + "src": "14815:13:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 17019, + "name": "tokensIndexerRewards", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16877, + "src": "14842:20:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 17020, + "name": "tokensDelegationRewards", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16881, + "src": "14876:23:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 17021, + "name": "_poi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16786, + "src": "14913:4:65", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "id": 17022, + "name": "_poiMetadata", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16788, + "src": "14931:12:65", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + { + "arguments": [], + "expression": { + "argumentTypes": [], + "expression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 17023, + "name": "_graphEpochManager", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4855, + "src": "14957:18:65", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_contract$_IEpochManager_$369_$", + "typeString": "function () view returns (contract IEpochManager)" + } + }, + "id": 17024, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "14957:20:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_IEpochManager_$369", + "typeString": "contract IEpochManager" + } + }, + "id": 17025, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "14978:12:65", + "memberName": "currentEpoch", + "nodeType": "MemberAccess", + "referencedDeclaration": 346, + "src": "14957:33:65", + "typeDescriptions": { + "typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$", + "typeString": "function () view external returns (uint256)" + } + }, + "id": 17026, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "14957:35:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 17012, + "name": "IndexingRewardsCollected", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16568, + "src": "14673:24:65", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_bytes32_$_t_uint256_$_t_uint256_$_t_uint256_$_t_bytes32_$_t_bytes_memory_ptr_$_t_uint256_$returns$__$", + "typeString": "function (address,address,bytes32,uint256,uint256,uint256,bytes32,bytes memory,uint256)" + } + }, + "id": 17027, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "14673:329:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 17028, + "nodeType": "EmitStatement", + "src": "14668:334:65" + }, + { + "condition": { + "arguments": [ + { + "expression": { + "id": 17030, + "name": "allocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16801, + "src": "15128:10:65", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "id": 17031, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "15139:7:65", + "memberName": "indexer", + "nodeType": "MemberAccess", + "referencedDeclaration": 15646, + "src": "15128:18:65", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 17032, + "name": "_delegationRatio", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16790, + "src": "15148:16:65", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + ], + "id": 17029, + "name": "_isOverAllocated", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17330, + "src": "15111:16:65", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_address_$_t_uint32_$returns$_t_bool_$", + "typeString": "function (address,uint32) view returns (bool)" + } + }, + "id": 17033, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "15111:54:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 17040, + "nodeType": "IfStatement", + "src": "15107:122:65", + "trueBody": { + "id": 17039, + "nodeType": "Block", + "src": "15167:62:65", + "statements": [ + { + "expression": { + "arguments": [ + { + "id": 17035, + "name": "_allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16784, + "src": "15198:13:65", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "hexValue": "74727565", + "id": 17036, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "15213:4:65", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "true" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 17034, + "name": "_closeAllocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17273, + "src": "15181:16:65", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_bool_$returns$__$", + "typeString": "function (address,bool)" + } + }, + "id": 17037, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "15181:37:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 17038, + "nodeType": "ExpressionStatement", + "src": "15181:37:65" + } + ] + } + }, + { + "expression": { + "id": 17041, + "name": "tokensRewards", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16817, + "src": "15246:13:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 16796, + "id": 17042, + "nodeType": "Return", + "src": "15239:20:65" + } + ] + }, + "documentation": { + "id": 16782, + "nodeType": "StructuredDocumentation", + "src": "10110:1731:65", + "text": " @notice Present a POI to collect indexing rewards for an allocation\n This function will mint indexing rewards using the {RewardsManager} and distribute them to the indexer and delegators.\n Conditions to qualify for indexing rewards:\n - POI must be non-zero\n - POI must not be stale, i.e: older than `maxPOIStaleness`\n - allocation must not be altruistic (allocated tokens = 0)\n - allocation must be open for at least one epoch\n Note that indexers are required to periodically (at most every `maxPOIStaleness`) present POIs to collect rewards.\n Rewards will not be issued to stale POIs, which means that indexers are advised to present a zero POI if they are\n unable to present a valid one to prevent being locked out of future rewards.\n Note on allocation duration restriction: this is required to ensure that non protocol chains have a valid block number for\n which to calculate POIs. EBO posts once per epoch typically at each epoch change, so we restrict rewards to allocations\n that have gone through at least one epoch change.\n Emits a {IndexingRewardsCollected} event.\n @param _allocationId The id of the allocation to collect rewards for\n @param _poi The POI being presented\n @param _poiMetadata The metadata associated with the POI. The data and encoding format is for off-chain components to define, this function will only emit the value in an event as-is.\n @param _delegationRatio The delegation ratio to consider when locking tokens\n @param _paymentsDestination The address where indexing rewards should be sent\n @return The amount of tokens collected" + }, + "id": 17044, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_presentPOI", + "nameLocation": "11855:11:65", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 16793, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 16784, + "mutability": "mutable", + "name": "_allocationId", + "nameLocation": "11884:13:65", + "nodeType": "VariableDeclaration", + "scope": 17044, + "src": "11876:21:65", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 16783, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "11876:7:65", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 16786, + "mutability": "mutable", + "name": "_poi", + "nameLocation": "11915:4:65", + "nodeType": "VariableDeclaration", + "scope": 17044, + "src": "11907:12:65", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 16785, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "11907:7:65", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 16788, + "mutability": "mutable", + "name": "_poiMetadata", + "nameLocation": "11942:12:65", + "nodeType": "VariableDeclaration", + "scope": 17044, + "src": "11929:25:65", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 16787, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "11929:5:65", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 16790, + "mutability": "mutable", + "name": "_delegationRatio", + "nameLocation": "11971:16:65", + "nodeType": "VariableDeclaration", + "scope": 17044, + "src": "11964:23:65", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 16789, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "11964:6:65", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 16792, + "mutability": "mutable", + "name": "_paymentsDestination", + "nameLocation": "12005:20:65", + "nodeType": "VariableDeclaration", + "scope": 17044, + "src": "11997:28:65", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 16791, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "11997:7:65", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "11866:165:65" + }, + "returnParameters": { + "id": 16796, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 16795, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 17044, + "src": "12050:7:65", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 16794, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "12050:7:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "12049:9:65" + }, + "scope": 17363, + "src": "11846:3420:65", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 17202, + "nodeType": "Block", + "src": "16142:1867:65", + "statements": [ + { + "assignments": [ + 17058 + ], + "declarations": [ + { + "constant": false, + "id": 17058, + "mutability": "mutable", + "name": "allocation", + "nameLocation": "16176:10:65", + "nodeType": "VariableDeclaration", + "scope": 17202, + "src": "16152:34:65", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State" + }, + "typeName": { + "id": 17057, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 17056, + "name": "Allocation.State", + "nameLocations": [ + "16152:10:65", + "16163:5:65" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 15663, + "src": "16152:16:65" + }, + "referencedDeclaration": 15663, + "src": "16152:16:65", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_storage_ptr", + "typeString": "struct Allocation.State" + } + }, + "visibility": "internal" + } + ], + "id": 17063, + "initialValue": { + "arguments": [ + { + "id": 17061, + "name": "_allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17047, + "src": "16206:13:65", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "expression": { + "id": 17059, + "name": "_allocations", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17376, + "src": "16189:12:65", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_State_$15663_storage_$", + "typeString": "mapping(address => struct Allocation.State storage ref)" + } + }, + "id": 17060, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "16202:3:65", + "memberName": "get", + "nodeType": "MemberAccess", + "referencedDeclaration": 15913, + "src": "16189:16:65", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_mapping$_t_address_$_t_struct$_State_$15663_storage_$_$_t_address_$returns$_t_struct$_State_$15663_memory_ptr_$attached_to$_t_mapping$_t_address_$_t_struct$_State_$15663_storage_$_$", + "typeString": "function (mapping(address => struct Allocation.State storage ref),address) view returns (struct Allocation.State memory)" + } + }, + "id": 17062, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "16189:31:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "16152:68:65" + }, + { + "expression": { + "arguments": [ + { + "arguments": [], + "expression": { + "argumentTypes": [], + "expression": { + "id": 17065, + "name": "allocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17058, + "src": "16238:10:65", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "id": 17066, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "16249:6:65", + "memberName": "isOpen", + "nodeType": "MemberAccess", + "referencedDeclaration": 15980, + "src": "16238:17:65", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_struct$_State_$15663_memory_ptr_$returns$_t_bool_$attached_to$_t_struct$_State_$15663_memory_ptr_$", + "typeString": "function (struct Allocation.State memory) pure returns (bool)" + } + }, + "id": 17067, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "16238:19:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [ + { + "id": 17069, + "name": "_allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17047, + "src": "16293:13:65", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 17068, + "name": "AllocationManagerAllocationClosed", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16623, + "src": "16259:33:65", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_address_$returns$_t_error_$", + "typeString": "function (address) pure returns (error)" + } + }, + "id": 17070, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "16259:48:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 17064, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "16230:7:65", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 17071, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "16230:78:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 17072, + "nodeType": "ExpressionStatement", + "src": "16230:78:65" + }, + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 17077, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 17074, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17049, + "src": "16326:7:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "expression": { + "id": 17075, + "name": "allocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17058, + "src": "16337:10:65", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "id": 17076, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "16348:6:65", + "memberName": "tokens", + "nodeType": "MemberAccess", + "referencedDeclaration": 15650, + "src": "16337:17:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "16326:28:65", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [ + { + "id": 17079, + "name": "_allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17047, + "src": "16392:13:65", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 17080, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17049, + "src": "16407:7:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 17078, + "name": "AllocationManagerAllocationSameSize", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16630, + "src": "16356:35:65", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_address_$_t_uint256_$returns$_t_error_$", + "typeString": "function (address,uint256) pure returns (error)" + } + }, + "id": 17081, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "16356:59:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 17073, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "16318:7:65", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 17082, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "16318:98:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 17083, + "nodeType": "ExpressionStatement", + "src": "16318:98:65" + }, + { + "assignments": [ + 17085 + ], + "declarations": [ + { + "constant": false, + "id": 17085, + "mutability": "mutable", + "name": "oldTokens", + "nameLocation": "16471:9:65", + "nodeType": "VariableDeclaration", + "scope": 17202, + "src": "16463:17:65", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 17084, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "16463:7:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 17088, + "initialValue": { + "expression": { + "id": 17086, + "name": "allocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17058, + "src": "16483:10:65", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "id": 17087, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "16494:6:65", + "memberName": "tokens", + "nodeType": "MemberAccess", + "referencedDeclaration": 15650, + "src": "16483:17:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "16463:37:65" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 17091, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 17089, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17049, + "src": "16514:7:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "id": 17090, + "name": "oldTokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17085, + "src": "16524:9:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "16514:19:65", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "id": 17116, + "nodeType": "Block", + "src": "16673:100:65", + "statements": [ + { + "expression": { + "arguments": [ + { + "expression": { + "id": 17109, + "name": "allocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17058, + "src": "16722:10:65", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "id": 17110, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "16733:7:65", + "memberName": "indexer", + "nodeType": "MemberAccess", + "referencedDeclaration": 15646, + "src": "16722:18:65", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 17113, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 17111, + "name": "oldTokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17085, + "src": "16742:9:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "id": 17112, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17049, + "src": "16754:7:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "16742:19:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "id": 17106, + "name": "allocationProvisionTracker", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17387, + "src": "16687:26:65", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", + "typeString": "mapping(address => uint256)" + } + }, + "id": 17108, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "16714:7:65", + "memberName": "release", + "nodeType": "MemberAccess", + "referencedDeclaration": 1764, + "src": "16687:34:65", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_mapping$_t_address_$_t_uint256_$_$_t_address_$_t_uint256_$returns$__$attached_to$_t_mapping$_t_address_$_t_uint256_$_$", + "typeString": "function (mapping(address => uint256),address,uint256)" + } + }, + "id": 17114, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "16687:75:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 17115, + "nodeType": "ExpressionStatement", + "src": "16687:75:65" + } + ] + }, + "id": 17117, + "nodeType": "IfStatement", + "src": "16510:263:65", + "trueBody": { + "id": 17105, + "nodeType": "Block", + "src": "16535:132:65", + "statements": [ + { + "expression": { + "arguments": [ + { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 17095, + "name": "_graphStaking", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4815, + "src": "16581:13:65", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_contract$_IHorizonStaking_$2625_$", + "typeString": "function () view returns (contract IHorizonStaking)" + } + }, + "id": 17096, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "16581:15:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_IHorizonStaking_$2625", + "typeString": "contract IHorizonStaking" + } + }, + { + "expression": { + "id": 17097, + "name": "allocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17058, + "src": "16598:10:65", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "id": 17098, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "16609:7:65", + "memberName": "indexer", + "nodeType": "MemberAccess", + "referencedDeclaration": 15646, + "src": "16598:18:65", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 17101, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 17099, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17049, + "src": "16618:7:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "id": 17100, + "name": "oldTokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17085, + "src": "16628:9:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "16618:19:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 17102, + "name": "_delegationRatio", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17051, + "src": "16639:16:65", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_IHorizonStaking_$2625", + "typeString": "contract IHorizonStaking" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + ], + "expression": { + "id": 17092, + "name": "allocationProvisionTracker", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17387, + "src": "16549:26:65", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", + "typeString": "mapping(address => uint256)" + } + }, + "id": 17094, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "16576:4:65", + "memberName": "lock", + "nodeType": "MemberAccess", + "referencedDeclaration": 1726, + "src": "16549:31:65", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_mapping$_t_address_$_t_uint256_$_$_t_contract$_IHorizonStaking_$2625_$_t_address_$_t_uint256_$_t_uint32_$returns$__$attached_to$_t_mapping$_t_address_$_t_uint256_$_$", + "typeString": "function (mapping(address => uint256),contract IHorizonStaking,address,uint256,uint32)" + } + }, + "id": 17103, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "16549:107:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 17104, + "nodeType": "ExpressionStatement", + "src": "16549:107:65" + } + ] + } + }, + { + "assignments": [ + 17119 + ], + "declarations": [ + { + "constant": false, + "id": 17119, + "mutability": "mutable", + "name": "accRewardsPerAllocatedToken", + "nameLocation": "16886:27:65", + "nodeType": "VariableDeclaration", + "scope": 17202, + "src": "16878:35:65", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 17118, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "16878:7:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 17126, + "initialValue": { + "arguments": [ + { + "expression": { + "id": 17123, + "name": "allocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17058, + "src": "16979:10:65", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "id": 17124, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "16990:20:65", + "memberName": "subgraphDeploymentId", + "nodeType": "MemberAccess", + "referencedDeclaration": 15648, + "src": "16979:31:65", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "expression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 17120, + "name": "_graphRewardsManager", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4865, + "src": "16916:20:65", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_contract$_IRewardsManager_$678_$", + "typeString": "function () view returns (contract IRewardsManager)" + } + }, + "id": 17121, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "16916:22:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_IRewardsManager_$678", + "typeString": "contract IRewardsManager" + } + }, + "id": 17122, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "16939:26:65", + "memberName": "onSubgraphAllocationUpdate", + "nodeType": "MemberAccess", + "referencedDeclaration": 677, + "src": "16916:49:65", + "typeDescriptions": { + "typeIdentifier": "t_function_external_nonpayable$_t_bytes32_$returns$_t_uint256_$", + "typeString": "function (bytes32) external returns (uint256)" + } + }, + "id": 17125, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "16916:104:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "16878:142:65" + }, + { + "assignments": [ + 17128 + ], + "declarations": [ + { + "constant": false, + "id": 17128, + "mutability": "mutable", + "name": "accRewardsPerAllocatedTokenPending", + "nameLocation": "17038:34:65", + "nodeType": "VariableDeclaration", + "scope": 17202, + "src": "17030:42:65", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 17127, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "17030:7:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 17139, + "initialValue": { + "condition": { + "id": 17132, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "17075:26:65", + "subExpression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "expression": { + "id": 17129, + "name": "allocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17058, + "src": "17076:10:65", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "id": 17130, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "17087:12:65", + "memberName": "isAltruistic", + "nodeType": "MemberAccess", + "referencedDeclaration": 15999, + "src": "17076:23:65", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_struct$_State_$15663_memory_ptr_$returns$_t_bool_$attached_to$_t_struct$_State_$15663_memory_ptr_$", + "typeString": "function (struct Allocation.State memory) pure returns (bool)" + } + }, + "id": 17131, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "17076:25:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseExpression": { + "hexValue": "30", + "id": 17137, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "17199:1:65", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "id": 17138, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "Conditional", + "src": "17075:125:65", + "trueExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 17136, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 17133, + "name": "accRewardsPerAllocatedToken", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17119, + "src": "17116:27:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "expression": { + "id": 17134, + "name": "allocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17058, + "src": "17146:10:65", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "id": 17135, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "17157:27:65", + "memberName": "accRewardsPerAllocatedToken", + "nodeType": "MemberAccess", + "referencedDeclaration": 15658, + "src": "17146:38:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "17116:68:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "17030:170:65" + }, + { + "expression": { + "id": 17145, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "baseExpression": { + "id": 17140, + "name": "_allocations", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17376, + "src": "17244:12:65", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_State_$15663_storage_$", + "typeString": "mapping(address => struct Allocation.State storage ref)" + } + }, + "id": 17142, + "indexExpression": { + "id": 17141, + "name": "_allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17047, + "src": "17257:13:65", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "17244:27:65", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_storage", + "typeString": "struct Allocation.State storage ref" + } + }, + "id": 17143, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberLocation": "17272:6:65", + "memberName": "tokens", + "nodeType": "MemberAccess", + "referencedDeclaration": 15650, + "src": "17244:34:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "id": 17144, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17049, + "src": "17281:7:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "17244:44:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 17146, + "nodeType": "ExpressionStatement", + "src": "17244:44:65" + }, + { + "expression": { + "id": 17152, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "baseExpression": { + "id": 17147, + "name": "_allocations", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17376, + "src": "17298:12:65", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_State_$15663_storage_$", + "typeString": "mapping(address => struct Allocation.State storage ref)" + } + }, + "id": 17149, + "indexExpression": { + "id": 17148, + "name": "_allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17047, + "src": "17311:13:65", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "17298:27:65", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_storage", + "typeString": "struct Allocation.State storage ref" + } + }, + "id": 17150, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberLocation": "17326:27:65", + "memberName": "accRewardsPerAllocatedToken", + "nodeType": "MemberAccess", + "referencedDeclaration": 15658, + "src": "17298:55:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "id": 17151, + "name": "accRewardsPerAllocatedToken", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17119, + "src": "17356:27:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "17298:85:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 17153, + "nodeType": "ExpressionStatement", + "src": "17298:85:65" + }, + { + "expression": { + "id": 17164, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "baseExpression": { + "id": 17154, + "name": "_allocations", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17376, + "src": "17393:12:65", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_State_$15663_storage_$", + "typeString": "mapping(address => struct Allocation.State storage ref)" + } + }, + "id": 17156, + "indexExpression": { + "id": 17155, + "name": "_allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17047, + "src": "17406:13:65", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "17393:27:65", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_storage", + "typeString": "struct Allocation.State storage ref" + } + }, + "id": 17157, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberLocation": "17421:17:65", + "memberName": "accRewardsPending", + "nodeType": "MemberAccess", + "referencedDeclaration": 15660, + "src": "17393:45:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "+=", + "rightHandSide": { + "arguments": [ + { + "id": 17161, + "name": "oldTokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17085, + "src": "17490:9:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 17162, + "name": "accRewardsPerAllocatedTokenPending", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17128, + "src": "17513:34:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 17158, + "name": "_graphRewardsManager", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4865, + "src": "17442:20:65", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_contract$_IRewardsManager_$678_$", + "typeString": "function () view returns (contract IRewardsManager)" + } + }, + "id": 17159, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "17442:22:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_IRewardsManager_$678", + "typeString": "contract IRewardsManager" + } + }, + "id": 17160, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "17465:11:65", + "memberName": "calcRewards", + "nodeType": "MemberAccess", + "referencedDeclaration": 651, + "src": "17442:34:65", + "typeDescriptions": { + "typeIdentifier": "t_function_external_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure external returns (uint256)" + } + }, + "id": 17163, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "17442:115:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "17393:164:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 17165, + "nodeType": "ExpressionStatement", + "src": "17393:164:65" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 17168, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 17166, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17049, + "src": "17641:7:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "id": 17167, + "name": "oldTokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17085, + "src": "17651:9:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "17641:19:65", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "id": 17190, + "nodeType": "Block", + "src": "17775:107:65", + "statements": [ + { + "expression": { + "id": 17188, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "baseExpression": { + "id": 17180, + "name": "_subgraphAllocatedTokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17395, + "src": "17789:24:65", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", + "typeString": "mapping(bytes32 => uint256)" + } + }, + "id": 17183, + "indexExpression": { + "expression": { + "id": 17181, + "name": "allocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17058, + "src": "17814:10:65", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "id": 17182, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "17825:20:65", + "memberName": "subgraphDeploymentId", + "nodeType": "MemberAccess", + "referencedDeclaration": 15648, + "src": "17814:31:65", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "17789:57:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "-=", + "rightHandSide": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 17186, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 17184, + "name": "oldTokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17085, + "src": "17851:9:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "id": 17185, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17049, + "src": "17863:7:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "17851:19:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 17187, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "17850:21:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "17789:82:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 17189, + "nodeType": "ExpressionStatement", + "src": "17789:82:65" + } + ] + }, + "id": 17191, + "nodeType": "IfStatement", + "src": "17637:245:65", + "trueBody": { + "id": 17179, + "nodeType": "Block", + "src": "17662:107:65", + "statements": [ + { + "expression": { + "id": 17177, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "baseExpression": { + "id": 17169, + "name": "_subgraphAllocatedTokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17395, + "src": "17676:24:65", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", + "typeString": "mapping(bytes32 => uint256)" + } + }, + "id": 17172, + "indexExpression": { + "expression": { + "id": 17170, + "name": "allocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17058, + "src": "17701:10:65", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "id": 17171, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "17712:20:65", + "memberName": "subgraphDeploymentId", + "nodeType": "MemberAccess", + "referencedDeclaration": 15648, + "src": "17701:31:65", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "17676:57:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "+=", + "rightHandSide": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 17175, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 17173, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17049, + "src": "17738:7:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "id": 17174, + "name": "oldTokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17085, + "src": "17748:9:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "17738:19:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 17176, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "17737:21:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "17676:82:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 17178, + "nodeType": "ExpressionStatement", + "src": "17676:82:65" + } + ] + } + }, + { + "eventCall": { + "arguments": [ + { + "expression": { + "id": 17193, + "name": "allocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17058, + "src": "17915:10:65", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "id": 17194, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "17926:7:65", + "memberName": "indexer", + "nodeType": "MemberAccess", + "referencedDeclaration": 15646, + "src": "17915:18:65", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 17195, + "name": "_allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17047, + "src": "17935:13:65", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "expression": { + "id": 17196, + "name": "allocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17058, + "src": "17950:10:65", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "id": 17197, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "17961:20:65", + "memberName": "subgraphDeploymentId", + "nodeType": "MemberAccess", + "referencedDeclaration": 15648, + "src": "17950:31:65", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "id": 17198, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17049, + "src": "17983:7:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 17199, + "name": "oldTokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17085, + "src": "17992:9:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 17192, + "name": "AllocationResized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16581, + "src": "17897:17:65", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_bytes32_$_t_uint256_$_t_uint256_$returns$__$", + "typeString": "function (address,address,bytes32,uint256,uint256)" + } + }, + "id": 17200, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "17897:105:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 17201, + "nodeType": "EmitStatement", + "src": "17892:110:65" + } + ] + }, + "documentation": { + "id": 17045, + "nodeType": "StructuredDocumentation", + "src": "15272:764:65", + "text": " @notice Resize an allocation\n @dev Will lock or release tokens in the provision tracker depending on the new allocation size.\n Rewards accrued but not issued before the resize will be accounted for as pending rewards.\n These will be paid out when the indexer presents a POI.\n Requirements:\n - `_indexer` must be the owner of the allocation\n - Allocation must be open\n - `_tokens` must be different from the current allocation size\n Emits a {AllocationResized} event.\n @param _allocationId The id of the allocation to be resized\n @param _tokens The new amount of tokens to allocate\n @param _delegationRatio The delegation ratio to consider when locking tokens" + }, + "id": 17203, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_resizeAllocation", + "nameLocation": "16050:17:65", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 17052, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 17047, + "mutability": "mutable", + "name": "_allocationId", + "nameLocation": "16076:13:65", + "nodeType": "VariableDeclaration", + "scope": 17203, + "src": "16068:21:65", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 17046, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "16068:7:65", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 17049, + "mutability": "mutable", + "name": "_tokens", + "nameLocation": "16099:7:65", + "nodeType": "VariableDeclaration", + "scope": 17203, + "src": "16091:15:65", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 17048, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "16091:7:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 17051, + "mutability": "mutable", + "name": "_delegationRatio", + "nameLocation": "16115:16:65", + "nodeType": "VariableDeclaration", + "scope": 17203, + "src": "16108:23:65", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 17050, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "16108:6:65", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + } + ], + "src": "16067:65:65" + }, + "returnParameters": { + "id": 17053, + "nodeType": "ParameterList", + "parameters": [], + "src": "16142:0:65" + }, + "scope": 17363, + "src": "16041:1968:65", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 17272, + "nodeType": "Block", + "src": "18738:920:65", + "statements": [ + { + "assignments": [ + 17215 + ], + "declarations": [ + { + "constant": false, + "id": 17215, + "mutability": "mutable", + "name": "allocation", + "nameLocation": "18772:10:65", + "nodeType": "VariableDeclaration", + "scope": 17272, + "src": "18748:34:65", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State" + }, + "typeName": { + "id": 17214, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 17213, + "name": "Allocation.State", + "nameLocations": [ + "18748:10:65", + "18759:5:65" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 15663, + "src": "18748:16:65" + }, + "referencedDeclaration": 15663, + "src": "18748:16:65", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_storage_ptr", + "typeString": "struct Allocation.State" + } + }, + "visibility": "internal" + } + ], + "id": 17220, + "initialValue": { + "arguments": [ + { + "id": 17218, + "name": "_allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17206, + "src": "18802:13:65", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "expression": { + "id": 17216, + "name": "_allocations", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17376, + "src": "18785:12:65", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_State_$15663_storage_$", + "typeString": "mapping(address => struct Allocation.State storage ref)" + } + }, + "id": 17217, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "18798:3:65", + "memberName": "get", + "nodeType": "MemberAccess", + "referencedDeclaration": 15913, + "src": "18785:16:65", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_mapping$_t_address_$_t_struct$_State_$15663_storage_$_$_t_address_$returns$_t_struct$_State_$15663_memory_ptr_$attached_to$_t_mapping$_t_address_$_t_struct$_State_$15663_storage_$_$", + "typeString": "function (mapping(address => struct Allocation.State storage ref),address) view returns (struct Allocation.State memory)" + } + }, + "id": 17219, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "18785:31:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "18748:68:65" + }, + { + "expression": { + "arguments": [ + { + "id": 17224, + "name": "_allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17206, + "src": "18961:13:65", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "arguments": [ + { + "expression": { + "id": 17228, + "name": "allocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17215, + "src": "19038:10:65", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "id": 17229, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "19049:20:65", + "memberName": "subgraphDeploymentId", + "nodeType": "MemberAccess", + "referencedDeclaration": 15648, + "src": "19038:31:65", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "expression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 17225, + "name": "_graphRewardsManager", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4865, + "src": "18988:20:65", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_contract$_IRewardsManager_$678_$", + "typeString": "function () view returns (contract IRewardsManager)" + } + }, + "id": 17226, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "18988:22:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_IRewardsManager_$678", + "typeString": "contract IRewardsManager" + } + }, + "id": 17227, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "19011:26:65", + "memberName": "onSubgraphAllocationUpdate", + "nodeType": "MemberAccess", + "referencedDeclaration": 677, + "src": "18988:49:65", + "typeDescriptions": { + "typeIdentifier": "t_function_external_nonpayable$_t_bytes32_$returns$_t_uint256_$", + "typeString": "function (bytes32) external returns (uint256)" + } + }, + "id": 17230, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "18988:82:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "id": 17221, + "name": "_allocations", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17376, + "src": "18919:12:65", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_State_$15663_storage_$", + "typeString": "mapping(address => struct Allocation.State storage ref)" + } + }, + "id": 17223, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "18932:15:65", + "memberName": "snapshotRewards", + "nodeType": "MemberAccess", + "referencedDeclaration": 15818, + "src": "18919:28:65", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_mapping$_t_address_$_t_struct$_State_$15663_storage_$_$_t_address_$_t_uint256_$returns$__$attached_to$_t_mapping$_t_address_$_t_struct$_State_$15663_storage_$_$", + "typeString": "function (mapping(address => struct Allocation.State storage ref),address,uint256)" + } + }, + "id": 17231, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "18919:161:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 17232, + "nodeType": "ExpressionStatement", + "src": "18919:161:65" + }, + { + "expression": { + "arguments": [ + { + "id": 17236, + "name": "_allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17206, + "src": "19110:13:65", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "expression": { + "id": 17233, + "name": "_allocations", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17376, + "src": "19091:12:65", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_State_$15663_storage_$", + "typeString": "mapping(address => struct Allocation.State storage ref)" + } + }, + "id": 17235, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "19104:5:65", + "memberName": "close", + "nodeType": "MemberAccess", + "referencedDeclaration": 15893, + "src": "19091:18:65", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_mapping$_t_address_$_t_struct$_State_$15663_storage_$_$_t_address_$returns$__$attached_to$_t_mapping$_t_address_$_t_struct$_State_$15663_storage_$_$", + "typeString": "function (mapping(address => struct Allocation.State storage ref),address)" + } + }, + "id": 17237, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "19091:33:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 17238, + "nodeType": "ExpressionStatement", + "src": "19091:33:65" + }, + { + "expression": { + "arguments": [ + { + "expression": { + "id": 17242, + "name": "allocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17215, + "src": "19169:10:65", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "id": 17243, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "19180:7:65", + "memberName": "indexer", + "nodeType": "MemberAccess", + "referencedDeclaration": 15646, + "src": "19169:18:65", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "expression": { + "id": 17244, + "name": "allocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17215, + "src": "19189:10:65", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "id": 17245, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "19200:6:65", + "memberName": "tokens", + "nodeType": "MemberAccess", + "referencedDeclaration": 15650, + "src": "19189:17:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "id": 17239, + "name": "allocationProvisionTracker", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17387, + "src": "19134:26:65", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", + "typeString": "mapping(address => uint256)" + } + }, + "id": 17241, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "19161:7:65", + "memberName": "release", + "nodeType": "MemberAccess", + "referencedDeclaration": 1764, + "src": "19134:34:65", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_mapping$_t_address_$_t_uint256_$_$_t_address_$_t_uint256_$returns$__$attached_to$_t_mapping$_t_address_$_t_uint256_$_$", + "typeString": "function (mapping(address => uint256),address,uint256)" + } + }, + "id": 17246, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "19134:73:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 17247, + "nodeType": "ExpressionStatement", + "src": "19134:73:65" + }, + { + "expression": { + "id": 17259, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "baseExpression": { + "id": 17248, + "name": "_subgraphAllocatedTokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17395, + "src": "19287:24:65", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", + "typeString": "mapping(bytes32 => uint256)" + } + }, + "id": 17251, + "indexExpression": { + "expression": { + "id": 17249, + "name": "allocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17215, + "src": "19312:10:65", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "id": 17250, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "19323:20:65", + "memberName": "subgraphDeploymentId", + "nodeType": "MemberAccess", + "referencedDeclaration": 15648, + "src": "19312:31:65", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "19287:57:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 17258, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "baseExpression": { + "id": 17252, + "name": "_subgraphAllocatedTokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17395, + "src": "19359:24:65", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", + "typeString": "mapping(bytes32 => uint256)" + } + }, + "id": 17255, + "indexExpression": { + "expression": { + "id": 17253, + "name": "allocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17215, + "src": "19384:10:65", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "id": 17254, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "19395:20:65", + "memberName": "subgraphDeploymentId", + "nodeType": "MemberAccess", + "referencedDeclaration": 15648, + "src": "19384:31:65", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "19359:57:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "expression": { + "id": 17256, + "name": "allocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17215, + "src": "19431:10:65", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "id": 17257, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "19442:6:65", + "memberName": "tokens", + "nodeType": "MemberAccess", + "referencedDeclaration": 15650, + "src": "19431:17:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "19359:89:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "19287:161:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 17260, + "nodeType": "ExpressionStatement", + "src": "19287:161:65" + }, + { + "eventCall": { + "arguments": [ + { + "expression": { + "id": 17262, + "name": "allocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17215, + "src": "19494:10:65", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "id": 17263, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "19505:7:65", + "memberName": "indexer", + "nodeType": "MemberAccess", + "referencedDeclaration": 15646, + "src": "19494:18:65", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 17264, + "name": "_allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17206, + "src": "19526:13:65", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "expression": { + "id": 17265, + "name": "allocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17215, + "src": "19553:10:65", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "id": 17266, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "19564:20:65", + "memberName": "subgraphDeploymentId", + "nodeType": "MemberAccess", + "referencedDeclaration": 15648, + "src": "19553:31:65", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "expression": { + "id": 17267, + "name": "allocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17215, + "src": "19598:10:65", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_memory_ptr", + "typeString": "struct Allocation.State memory" + } + }, + "id": 17268, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "19609:6:65", + "memberName": "tokens", + "nodeType": "MemberAccess", + "referencedDeclaration": 15650, + "src": "19598:17:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 17269, + "name": "_forceClosed", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17208, + "src": "19629:12:65", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 17261, + "name": "AllocationClosed", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16594, + "src": "19464:16:65", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_bytes32_$_t_uint256_$_t_bool_$returns$__$", + "typeString": "function (address,address,bytes32,uint256,bool)" + } + }, + "id": 17270, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "19464:187:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 17271, + "nodeType": "EmitStatement", + "src": "19459:192:65" + } + ] + }, + "documentation": { + "id": 17204, + "nodeType": "StructuredDocumentation", + "src": "18015:641:65", + "text": " @notice Close an allocation\n Does not require presenting a POI, use {_collectIndexingRewards} to present a POI and collect rewards\n @dev Note that allocations are nowlong lived. All service payments, including indexing rewards, should be collected periodically\n without the need of closing the allocation. Allocations should only be closed when indexers want to reclaim the allocated\n tokens for other purposes.\n Emits a {AllocationClosed} event\n @param _allocationId The id of the allocation to be closed\n @param _forceClosed Whether the allocation was force closed" + }, + "id": 17273, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_closeAllocation", + "nameLocation": "18670:16:65", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 17209, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 17206, + "mutability": "mutable", + "name": "_allocationId", + "nameLocation": "18695:13:65", + "nodeType": "VariableDeclaration", + "scope": 17273, + "src": "18687:21:65", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 17205, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "18687:7:65", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 17208, + "mutability": "mutable", + "name": "_forceClosed", + "nameLocation": "18715:12:65", + "nodeType": "VariableDeclaration", + "scope": 17273, + "src": "18710:17:65", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 17207, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "18710:4:65", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "src": "18686:42:65" + }, + "returnParameters": { + "id": 17210, + "nodeType": "ParameterList", + "parameters": [], + "src": "18738:0:65" + }, + "scope": 17363, + "src": "18661:997:65", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 17287, + "nodeType": "Block", + "src": "19979:102:65", + "statements": [ + { + "expression": { + "id": 17281, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 17279, + "name": "maxPOIStaleness", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17390, + "src": "19989:15:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "id": 17280, + "name": "_maxPOIStaleness", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17276, + "src": "20007:16:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "19989:34:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 17282, + "nodeType": "ExpressionStatement", + "src": "19989:34:65" + }, + { + "eventCall": { + "arguments": [ + { + "id": 17284, + "name": "_maxPOIStaleness", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17276, + "src": "20057:16:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 17283, + "name": "MaxPOIStalenessSet", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16608, + "src": "20038:18:65", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256)" + } + }, + "id": 17285, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "20038:36:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 17286, + "nodeType": "EmitStatement", + "src": "20033:41:65" + } + ] + }, + "documentation": { + "id": 17274, + "nodeType": "StructuredDocumentation", + "src": "19664:246:65", + "text": " @notice Sets the maximum amount of time, in seconds, allowed between presenting POIs to qualify for indexing rewards\n @dev Emits a {MaxPOIStalenessSet} event\n @param _maxPOIStaleness The max POI staleness in seconds" + }, + "id": 17288, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_setMaxPOIStaleness", + "nameLocation": "19924:19:65", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 17277, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 17276, + "mutability": "mutable", + "name": "_maxPOIStaleness", + "nameLocation": "19952:16:65", + "nodeType": "VariableDeclaration", + "scope": 17288, + "src": "19944:24:65", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 17275, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "19944:7:65", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "19943:26:65" + }, + "returnParameters": { + "id": 17278, + "nodeType": "ParameterList", + "parameters": [], + "src": "19979:0:65" + }, + "scope": 17363, + "src": "19915:166:65", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 17309, + "nodeType": "Block", + "src": "20418:125:65", + "statements": [ + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "arguments": [ + { + "id": 17302, + "name": "EIP712_ALLOCATION_ID_PROOF_TYPEHASH", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16534, + "src": "20473:35:65", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "id": 17303, + "name": "_indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17291, + "src": "20510:8:65", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 17304, + "name": "_allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17293, + "src": "20520:13:65", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "expression": { + "id": 17300, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -1, + "src": "20462:3:65", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 17301, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "20466:6:65", + "memberName": "encode", + "nodeType": "MemberAccess", + "src": "20462:10:65", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencode_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 17305, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "20462:72:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 17299, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -8, + "src": "20452:9:65", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 17306, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "20452:83:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 17298, + "name": "_hashTypedDataV4", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5846, + "src": "20435:16:65", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_bytes32_$", + "typeString": "function (bytes32) view returns (bytes32)" + } + }, + "id": 17307, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "20435:101:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "functionReturnParameters": 17297, + "id": 17308, + "nodeType": "Return", + "src": "20428:108:65" + } + ] + }, + "documentation": { + "id": 17289, + "nodeType": "StructuredDocumentation", + "src": "20087:221:65", + "text": " @notice Encodes the allocation proof for EIP712 signing\n @param _indexer The address of the indexer\n @param _allocationId The id of the allocation\n @return The encoded allocation proof" + }, + "id": 17310, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_encodeAllocationProof", + "nameLocation": "20322:22:65", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 17294, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 17291, + "mutability": "mutable", + "name": "_indexer", + "nameLocation": "20353:8:65", + "nodeType": "VariableDeclaration", + "scope": 17310, + "src": "20345:16:65", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 17290, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "20345:7:65", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 17293, + "mutability": "mutable", + "name": "_allocationId", + "nameLocation": "20371:13:65", + "nodeType": "VariableDeclaration", + "scope": 17310, + "src": "20363:21:65", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 17292, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "20363:7:65", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "20344:41:65" + }, + "returnParameters": { + "id": 17297, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 17296, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 17310, + "src": "20409:7:65", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 17295, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "20409:7:65", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "20408:9:65" + }, + "scope": 17363, + "src": "20313:230:65", + "stateMutability": "view", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 17329, + "nodeType": "Block", + "src": "20927:102:65", + "statements": [ + { + "expression": { + "id": 17327, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "20944:78:65", + "subExpression": { + "arguments": [ + { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 17322, + "name": "_graphStaking", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4815, + "src": "20978:13:65", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_contract$_IHorizonStaking_$2625_$", + "typeString": "function () view returns (contract IHorizonStaking)" + } + }, + "id": 17323, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "20978:15:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_IHorizonStaking_$2625", + "typeString": "contract IHorizonStaking" + } + }, + { + "id": 17324, + "name": "_indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17313, + "src": "20995:8:65", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 17325, + "name": "_delegationRatio", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17315, + "src": "21005:16:65", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_IHorizonStaking_$2625", + "typeString": "contract IHorizonStaking" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + ], + "expression": { + "id": 17320, + "name": "allocationProvisionTracker", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17387, + "src": "20945:26:65", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", + "typeString": "mapping(address => uint256)" + } + }, + "id": 17321, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "20972:5:65", + "memberName": "check", + "nodeType": "MemberAccess", + "referencedDeclaration": 1800, + "src": "20945:32:65", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_mapping$_t_address_$_t_uint256_$_$_t_contract$_IHorizonStaking_$2625_$_t_address_$_t_uint32_$returns$_t_bool_$attached_to$_t_mapping$_t_address_$_t_uint256_$_$", + "typeString": "function (mapping(address => uint256),contract IHorizonStaking,address,uint32) view returns (bool)" + } + }, + "id": 17326, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "20945:77:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "functionReturnParameters": 17319, + "id": 17328, + "nodeType": "Return", + "src": "20937:85:65" + } + ] + }, + "documentation": { + "id": 17311, + "nodeType": "StructuredDocumentation", + "src": "20549:275:65", + "text": " @notice Checks if an allocation is over-allocated\n @param _indexer The address of the indexer\n @param _delegationRatio The delegation ratio to consider when locking tokens\n @return True if the allocation is over-allocated, false otherwise" + }, + "id": 17330, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_isOverAllocated", + "nameLocation": "20838:16:65", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 17316, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 17313, + "mutability": "mutable", + "name": "_indexer", + "nameLocation": "20863:8:65", + "nodeType": "VariableDeclaration", + "scope": 17330, + "src": "20855:16:65", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 17312, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "20855:7:65", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 17315, + "mutability": "mutable", + "name": "_delegationRatio", + "nameLocation": "20880:16:65", + "nodeType": "VariableDeclaration", + "scope": 17330, + "src": "20873:23:65", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 17314, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "20873:6:65", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + } + ], + "src": "20854:43:65" + }, + "returnParameters": { + "id": 17319, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 17318, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 17330, + "src": "20921:4:65", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 17317, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "20921:4:65", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "src": "20920:6:65" + }, + "scope": 17363, + "src": "20829:200:65", + "stateMutability": "view", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 17361, + "nodeType": "Block", + "src": "21521:210:65", + "statements": [ + { + "assignments": [ + 17341 + ], + "declarations": [ + { + "constant": false, + "id": 17341, + "mutability": "mutable", + "name": "signer", + "nameLocation": "21539:6:65", + "nodeType": "VariableDeclaration", + "scope": 17361, + "src": "21531:14:65", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 17340, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "21531:7:65", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "id": 17350, + "initialValue": { + "arguments": [ + { + "arguments": [ + { + "id": 17345, + "name": "_indexer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17333, + "src": "21585:8:65", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 17346, + "name": "_allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17335, + "src": "21595:13:65", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 17344, + "name": "_encodeAllocationProof", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17310, + "src": "21562:22:65", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_address_$_t_address_$returns$_t_bytes32_$", + "typeString": "function (address,address) view returns (bytes32)" + } + }, + "id": 17347, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "21562:47:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "id": 17348, + "name": "_proof", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17337, + "src": "21611:6:65", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "expression": { + "id": 17342, + "name": "ECDSA", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8231, + "src": "21548:5:65", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_ECDSA_$8231_$", + "typeString": "type(library ECDSA)" + } + }, + "id": 17343, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "21554:7:65", + "memberName": "recover", + "nodeType": "MemberAccess", + "referencedDeclaration": 7987, + "src": "21548:13:65", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_bytes32_$_t_bytes_memory_ptr_$returns$_t_address_$", + "typeString": "function (bytes32,bytes memory) pure returns (address)" + } + }, + "id": 17349, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "21548:70:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "21531:87:65" + }, + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 17354, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 17352, + "name": "signer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17341, + "src": "21636:6:65", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "id": 17353, + "name": "_allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17335, + "src": "21646:13:65", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "21636:23:65", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [ + { + "id": 17356, + "name": "signer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17341, + "src": "21701:6:65", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 17357, + "name": "_allocationId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17335, + "src": "21709:13:65", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 17355, + "name": "AllocationManagerInvalidAllocationProof", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16615, + "src": "21661:39:65", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_address_$_t_address_$returns$_t_error_$", + "typeString": "function (address,address) pure returns (error)" + } + }, + "id": 17358, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "21661:62:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 17351, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "21628:7:65", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 17359, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "21628:96:65", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 17360, + "nodeType": "ExpressionStatement", + "src": "21628:96:65" + } + ] + }, + "documentation": { + "id": 17331, + "nodeType": "StructuredDocumentation", + "src": "21035:374:65", + "text": " @notice Verifies ownership of an allocation id by verifying an EIP712 allocation proof\n @dev Requirements:\n - Signer must be the allocation id address\n @param _indexer The address of the indexer\n @param _allocationId The id of the allocation\n @param _proof The EIP712 proof, an EIP712 signed message of (indexer,allocationId)" + }, + "id": 17362, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_verifyAllocationProof", + "nameLocation": "21423:22:65", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 17338, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 17333, + "mutability": "mutable", + "name": "_indexer", + "nameLocation": "21454:8:65", + "nodeType": "VariableDeclaration", + "scope": 17362, + "src": "21446:16:65", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 17332, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "21446:7:65", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 17335, + "mutability": "mutable", + "name": "_allocationId", + "nameLocation": "21472:13:65", + "nodeType": "VariableDeclaration", + "scope": 17362, + "src": "21464:21:65", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 17334, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "21464:7:65", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 17337, + "mutability": "mutable", + "name": "_proof", + "nameLocation": "21500:6:65", + "nodeType": "VariableDeclaration", + "scope": 17362, + "src": "21487:19:65", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 17336, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "21487:5:65", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "src": "21445:62:65" + }, + "returnParameters": { + "id": 17339, + "nodeType": "ParameterList", + "parameters": [], + "src": "21521:0:65" + }, + "scope": 17363, + "src": "21414:317:65", + "stateMutability": "view", + "virtual": false, + "visibility": "private" + } + ], + "scope": 17364, + "src": "1547:20186:65", + "usedErrors": [ + 4655, + 5140, + 5143, + 16615, + 16618, + 16623, + 16630 + ], + "usedEvents": [ + 4650, + 5148, + 6049, + 16547, + 16568, + 16581, + 16594, + 16603, + 16608 + ] + } + ], + "src": "45:21689:65" + }, + "id": 65 + }, + "contracts/utilities/AllocationManagerStorage.sol": { + "ast": { + "absolutePath": "contracts/utilities/AllocationManagerStorage.sol", + "exportedSymbols": { + "Allocation": [ + 16033 + ], + "AllocationManagerV1Storage": [ + 17401 + ], + "LegacyAllocation": [ + 16462 + ] + }, + "id": 17402, + "license": "GPL-3.0-or-later", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 17365, + "literals": [ + "solidity", + "0.8", + ".27" + ], + "nodeType": "PragmaDirective", + "src": "45:23:66" + }, + { + "absolutePath": "contracts/libraries/Allocation.sol", + "file": "../libraries/Allocation.sol", + "id": 17367, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 17402, + "sourceUnit": 16034, + "src": "70:57:66", + "symbolAliases": [ + { + "foreign": { + "id": 17366, + "name": "Allocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16033, + "src": "79:10:66", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "contracts/libraries/LegacyAllocation.sol", + "file": "../libraries/LegacyAllocation.sol", + "id": 17369, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 17402, + "sourceUnit": 16463, + "src": "128:69:66", + "symbolAliases": [ + { + "foreign": { + "id": 17368, + "name": "LegacyAllocation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16462, + "src": "137:16:66", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "abstract": true, + "baseContracts": [], + "canonicalName": "AllocationManagerV1Storage", + "contractDependencies": [], + "contractKind": "contract", + "documentation": { + "id": 17370, + "nodeType": "StructuredDocumentation", + "src": "199:276:66", + "text": " @title AllocationManagerStorage\n @notice This contract holds all the storage variables for the Allocation Manager contract.\n @custom:security-contact Please email security+contracts@thegraph.com if you find any\n bugs. We may have an active bug bounty program." + }, + "fullyImplemented": true, + "id": 17401, + "linearizedBaseContracts": [ + 17401 + ], + "name": "AllocationManagerV1Storage", + "nameLocation": "494:26:66", + "nodeType": "ContractDefinition", + "nodes": [ + { + "constant": false, + "documentation": { + "id": 17371, + "nodeType": "StructuredDocumentation", + "src": "527:30:66", + "text": "@notice Allocation details" + }, + "id": 17376, + "mutability": "mutable", + "name": "_allocations", + "nameLocation": "632:12:66", + "nodeType": "VariableDeclaration", + "scope": 17401, + "src": "562:82:66", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_State_$15663_storage_$", + "typeString": "mapping(address => struct Allocation.State)" + }, + "typeName": { + "id": 17375, + "keyName": "allocationId", + "keyNameLocation": "578:12:66", + "keyType": { + "id": 17372, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "570:7:66", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "562:60:66", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_State_$15663_storage_$", + "typeString": "mapping(address => struct Allocation.State)" + }, + "valueName": "allocation", + "valueNameLocation": "611:10:66", + "valueType": { + "id": 17374, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 17373, + "name": "Allocation.State", + "nameLocations": [ + "594:10:66", + "605:5:66" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 15663, + "src": "594:16:66" + }, + "referencedDeclaration": 15663, + "src": "594:16:66", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$15663_storage_ptr", + "typeString": "struct Allocation.State" + } + } + }, + "visibility": "internal" + }, + { + "constant": false, + "documentation": { + "id": 17377, + "nodeType": "StructuredDocumentation", + "src": "651:37:66", + "text": "@notice Legacy allocation details" + }, + "id": 17382, + "mutability": "mutable", + "name": "_legacyAllocations", + "nameLocation": "769:18:66", + "nodeType": "VariableDeclaration", + "scope": 17401, + "src": "693:94:66", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_State_$16305_storage_$", + "typeString": "mapping(address => struct LegacyAllocation.State)" + }, + "typeName": { + "id": 17381, + "keyName": "allocationId", + "keyNameLocation": "709:12:66", + "keyType": { + "id": 17378, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "701:7:66", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "693:66:66", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_State_$16305_storage_$", + "typeString": "mapping(address => struct LegacyAllocation.State)" + }, + "valueName": "allocation", + "valueNameLocation": "748:10:66", + "valueType": { + "id": 17380, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 17379, + "name": "LegacyAllocation.State", + "nameLocations": [ + "725:16:66", + "742:5:66" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 16305, + "src": "725:22:66" + }, + "referencedDeclaration": 16305, + "src": "725:22:66", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16305_storage_ptr", + "typeString": "struct LegacyAllocation.State" + } + } + }, + "visibility": "internal" + }, + { + "constant": false, + "documentation": { + "id": 17383, + "nodeType": "StructuredDocumentation", + "src": "794:47:66", + "text": "@notice Tracks allocated tokens per indexer" + }, + "functionSelector": "6234e216", + "id": 17387, + "mutability": "mutable", + "name": "allocationProvisionTracker", + "nameLocation": "896:26:66", + "nodeType": "VariableDeclaration", + "scope": 17401, + "src": "846:76:66", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", + "typeString": "mapping(address => uint256)" + }, + "typeName": { + "id": 17386, + "keyName": "indexer", + "keyNameLocation": "862:7:66", + "keyType": { + "id": 17384, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "854:7:66", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "846:42:66", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", + "typeString": "mapping(address => uint256)" + }, + "valueName": "tokens", + "valueNameLocation": "881:6:66", + "valueType": { + "id": 17385, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "873:7:66", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + }, + "visibility": "public" + }, + { + "constant": false, + "documentation": { + "id": 17388, + "nodeType": "StructuredDocumentation", + "src": "929:111:66", + "text": "@notice Maximum amount of time, in seconds, allowed between presenting POIs to qualify for indexing rewards" + }, + "functionSelector": "85e82baf", + "id": 17390, + "mutability": "mutable", + "name": "maxPOIStaleness", + "nameLocation": "1060:15:66", + "nodeType": "VariableDeclaration", + "scope": 17401, + "src": "1045:30:66", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 17389, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1045:7:66", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "public" + }, + { + "constant": false, + "documentation": { + "id": 17391, + "nodeType": "StructuredDocumentation", + "src": "1082:112:66", + "text": "@notice Track total tokens allocated per subgraph deployment\n @dev Used to calculate indexing rewards" + }, + "id": 17395, + "mutability": "mutable", + "name": "_subgraphAllocatedTokens", + "nameLocation": "1264:24:66", + "nodeType": "VariableDeclaration", + "scope": 17401, + "src": "1199:89:66", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", + "typeString": "mapping(bytes32 => uint256)" + }, + "typeName": { + "id": 17394, + "keyName": "subgraphDeploymentId", + "keyNameLocation": "1215:20:66", + "keyType": { + "id": 17392, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1207:7:66", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "Mapping", + "src": "1199:55:66", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", + "typeString": "mapping(bytes32 => uint256)" + }, + "valueName": "tokens", + "valueNameLocation": "1247:6:66", + "valueType": { + "id": 17393, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1239:7:66", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + }, + "visibility": "internal" + }, + { + "constant": false, + "documentation": { + "id": 17396, + "nodeType": "StructuredDocumentation", + "src": "1295:57:66", + "text": "@dev Gap to allow adding variables in future upgrades" + }, + "id": 17400, + "mutability": "mutable", + "name": "__gap", + "nameLocation": "1377:5:66", + "nodeType": "VariableDeclaration", + "scope": 17401, + "src": "1357:25:66", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$50_storage", + "typeString": "uint256[50]" + }, + "typeName": { + "baseType": { + "id": 17397, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1357:7:66", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 17399, + "length": { + "hexValue": "3530", + "id": 17398, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1365:2:66", + "typeDescriptions": { + "typeIdentifier": "t_rational_50_by_1", + "typeString": "int_const 50" + }, + "value": "50" + }, + "nodeType": "ArrayTypeName", + "src": "1357:11:66", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$50_storage_ptr", + "typeString": "uint256[50]" + } + }, + "visibility": "private" + } + ], + "scope": 17402, + "src": "476:909:66", + "usedErrors": [], + "usedEvents": [] + } + ], + "src": "45:1341:66" + }, + "id": 66 + }, + "contracts/utilities/AttestationManager.sol": { + "ast": { + "absolutePath": "contracts/utilities/AttestationManager.sol", + "exportedSymbols": { + "Attestation": [ + 16290 + ], + "AttestationManager": [ + 17555 + ], + "AttestationManagerV1Storage": [ + 17567 + ], + "ECDSA": [ + 8231 + ], + "Initializable": [ + 5391 + ] + }, + "id": 17556, + "license": "GPL-3.0-or-later", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 17403, + "literals": [ + "solidity", + "0.8", + ".27" + ], + "nodeType": "PragmaDirective", + "src": "45:23:67" + }, + { + "absolutePath": "contracts/utilities/AttestationManagerStorage.sol", + "file": "./AttestationManagerStorage.sol", + "id": 17405, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 17556, + "sourceUnit": 17568, + "src": "70:78:67", + "symbolAliases": [ + { + "foreign": { + "id": 17404, + "name": "AttestationManagerV1Storage", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17567, + "src": "79:27:67", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "@openzeppelin/contracts/utils/cryptography/ECDSA.sol", + "file": "@openzeppelin/contracts/utils/cryptography/ECDSA.sol", + "id": 17407, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 17556, + "sourceUnit": 8232, + "src": "150:77:67", + "symbolAliases": [ + { + "foreign": { + "id": 17406, + "name": "ECDSA", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8231, + "src": "159:5:67", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol", + "file": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol", + "id": 17409, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 17556, + "sourceUnit": 5392, + "src": "228:98:67", + "symbolAliases": [ + { + "foreign": { + "id": 17408, + "name": "Initializable", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5391, + "src": "237:13:67", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "contracts/libraries/Attestation.sol", + "file": "../libraries/Attestation.sol", + "id": 17411, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 17556, + "sourceUnit": 16291, + "src": "327:59:67", + "symbolAliases": [ + { + "foreign": { + "id": 17410, + "name": "Attestation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16290, + "src": "336:11:67", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "abstract": true, + "baseContracts": [ + { + "baseName": { + "id": 17413, + "name": "Initializable", + "nameLocations": [ + "771:13:67" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5391, + "src": "771:13:67" + }, + "id": 17414, + "nodeType": "InheritanceSpecifier", + "src": "771:13:67" + }, + { + "baseName": { + "id": 17415, + "name": "AttestationManagerV1Storage", + "nameLocations": [ + "786:27:67" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 17567, + "src": "786:27:67" + }, + "id": 17416, + "nodeType": "InheritanceSpecifier", + "src": "786:27:67" + } + ], + "canonicalName": "AttestationManager", + "contractDependencies": [], + "contractKind": "contract", + "documentation": { + "id": 17412, + "nodeType": "StructuredDocumentation", + "src": "388:342:67", + "text": " @title AttestationManager contract\n @notice A helper contract implementing attestation verification.\n Uses a custom implementation of EIP712 for backwards compatibility with attestations.\n @custom:security-contact Please email security+contracts@thegraph.com if you find any\n bugs. We may have an active bug bounty program." + }, + "fullyImplemented": true, + "id": 17555, + "linearizedBaseContracts": [ + 17555, + 17567, + 5391 + ], + "name": "AttestationManager", + "nameLocation": "749:18:67", + "nodeType": "ContractDefinition", + "nodes": [ + { + "constant": true, + "documentation": { + "id": 17417, + "nodeType": "StructuredDocumentation", + "src": "820:47:67", + "text": "@notice EIP712 type hash for Receipt struct" + }, + "id": 17422, + "mutability": "constant", + "name": "RECEIPT_TYPE_HASH", + "nameLocation": "897:17:67", + "nodeType": "VariableDeclaration", + "scope": 17555, + "src": "872:142:67", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 17418, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "872:7:67", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": { + "arguments": [ + { + "hexValue": "52656365697074286279746573333220726571756573744349442c6279746573333220726573706f6e73654349442c627974657333322073756267726170684465706c6f796d656e74494429", + "id": 17420, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "935:78:67", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_32dd026408194a0d7e54cc66a2ab6c856efc55cfcd4dd258fde5b1a55222baa6", + "typeString": "literal_string \"Receipt(bytes32 requestCID,bytes32 responseCID,bytes32 subgraphDeploymentID)\"" + }, + "value": "Receipt(bytes32 requestCID,bytes32 responseCID,bytes32 subgraphDeploymentID)" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_stringliteral_32dd026408194a0d7e54cc66a2ab6c856efc55cfcd4dd258fde5b1a55222baa6", + "typeString": "literal_string \"Receipt(bytes32 requestCID,bytes32 responseCID,bytes32 subgraphDeploymentID)\"" + } + ], + "id": 17419, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -8, + "src": "925:9:67", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 17421, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "925:89:67", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "private" + }, + { + "constant": true, + "documentation": { + "id": 17423, + "nodeType": "StructuredDocumentation", + "src": "1021:35:67", + "text": "@notice EIP712 domain type hash" + }, + "id": 17428, + "mutability": "constant", + "name": "DOMAIN_TYPE_HASH", + "nameLocation": "1086:16:67", + "nodeType": "VariableDeclaration", + "scope": 17555, + "src": "1061:160:67", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 17424, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1061:7:67", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": { + "arguments": [ + { + "hexValue": "454950373132446f6d61696e28737472696e67206e616d652c737472696e672076657273696f6e2c75696e7432353620636861696e49642c6164647265737320766572696679696e67436f6e74726163742c627974657333322073616c7429", + "id": 17426, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1123:97:67", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_d87cd6ef79d4e2b95e15ce8abf732db51ec771f1ca2edccf22a46c729ac56472", + "typeString": "literal_string \"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract,bytes32 salt)\"" + }, + "value": "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract,bytes32 salt)" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_stringliteral_d87cd6ef79d4e2b95e15ce8abf732db51ec771f1ca2edccf22a46c729ac56472", + "typeString": "literal_string \"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract,bytes32 salt)\"" + } + ], + "id": 17425, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -8, + "src": "1113:9:67", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 17427, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "1113:108:67", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "private" + }, + { + "constant": true, + "documentation": { + "id": 17429, + "nodeType": "StructuredDocumentation", + "src": "1228:30:67", + "text": "@notice EIP712 domain name" + }, + "id": 17434, + "mutability": "constant", + "name": "DOMAIN_NAME_HASH", + "nameLocation": "1288:16:67", + "nodeType": "VariableDeclaration", + "scope": 17555, + "src": "1263:71:67", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 17430, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1263:7:67", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": { + "arguments": [ + { + "hexValue": "47726170682050726f746f636f6c", + "id": 17432, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1317:16:67", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_171a7fa058648750a8c5aae430f30db8d0100efc3a5e1b2e8054b1c1ce28b6b4", + "typeString": "literal_string \"Graph Protocol\"" + }, + "value": "Graph Protocol" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_stringliteral_171a7fa058648750a8c5aae430f30db8d0100efc3a5e1b2e8054b1c1ce28b6b4", + "typeString": "literal_string \"Graph Protocol\"" + } + ], + "id": 17431, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -8, + "src": "1307:9:67", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 17433, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "1307:27:67", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "private" + }, + { + "constant": true, + "documentation": { + "id": 17435, + "nodeType": "StructuredDocumentation", + "src": "1341:33:67", + "text": "@notice EIP712 domain version" + }, + "id": 17440, + "mutability": "constant", + "name": "DOMAIN_VERSION_HASH", + "nameLocation": "1404:19:67", + "nodeType": "VariableDeclaration", + "scope": 17555, + "src": "1379:61:67", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 17436, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1379:7:67", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": { + "arguments": [ + { + "hexValue": "30", + "id": 17438, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1436:3:67", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_044852b2a670ade5407e78fb2863c51de9fcb96542a07186fe3aeda6bb8a116d", + "typeString": "literal_string \"0\"" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_stringliteral_044852b2a670ade5407e78fb2863c51de9fcb96542a07186fe3aeda6bb8a116d", + "typeString": "literal_string \"0\"" + } + ], + "id": 17437, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -8, + "src": "1426:9:67", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 17439, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "1426:14:67", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "private" + }, + { + "constant": true, + "documentation": { + "id": 17441, + "nodeType": "StructuredDocumentation", + "src": "1447:30:67", + "text": "@notice EIP712 domain salt" + }, + "id": 17444, + "mutability": "constant", + "name": "DOMAIN_SALT", + "nameLocation": "1507:11:67", + "nodeType": "VariableDeclaration", + "scope": 17555, + "src": "1482:105:67", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 17442, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1482:7:67", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": { + "hexValue": "307861303730666662316364373430393634396266373738323263636537343439353436386530366462666165663039353536383338626631383836373962396332", + "id": 17443, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1521:66:67", + "typeDescriptions": { + "typeIdentifier": "t_rational_72569707383443547382267636376646613935103975378761491950889697921835323734466_by_1", + "typeString": "int_const 7256...(69 digits omitted)...4466" + }, + "value": "0xa070ffb1cd7409649bf77822cce74495468e06dbfaef09556838bf188679b9c2" + }, + "visibility": "private" + }, + { + "body": { + "id": 17453, + "nodeType": "Block", + "src": "1802:54:67", + "statements": [ + { + "expression": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 17450, + "name": "__AttestationManager_init_unchained", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17479, + "src": "1812:35:67", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$__$returns$__$", + "typeString": "function ()" + } + }, + "id": 17451, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "1812:37:67", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 17452, + "nodeType": "ExpressionStatement", + "src": "1812:37:67" + } + ] + }, + "documentation": { + "id": 17445, + "nodeType": "StructuredDocumentation", + "src": "1594:87:67", + "text": " @dev Initialize the AttestationManager contract and parent contracts" + }, + "id": 17454, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "id": 17448, + "kind": "modifierInvocation", + "modifierName": { + "id": 17447, + "name": "onlyInitializing", + "nameLocations": [ + "1785:16:67" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5286, + "src": "1785:16:67" + }, + "nodeType": "ModifierInvocation", + "src": "1785:16:67" + } + ], + "name": "__AttestationManager_init", + "nameLocation": "1748:25:67", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 17446, + "nodeType": "ParameterList", + "parameters": [], + "src": "1773:2:67" + }, + "returnParameters": { + "id": 17449, + "nodeType": "ParameterList", + "parameters": [], + "src": "1802:0:67" + }, + "scope": 17555, + "src": "1739:117:67", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 17478, + "nodeType": "Block", + "src": "2059:289:67", + "statements": [ + { + "expression": { + "id": 17476, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 17460, + "name": "_domainSeparator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17561, + "src": "2069:16:67", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "arguments": [ + { + "id": 17464, + "name": "DOMAIN_TYPE_HASH", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17428, + "src": "2139:16:67", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "id": 17465, + "name": "DOMAIN_NAME_HASH", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17434, + "src": "2173:16:67", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "id": 17466, + "name": "DOMAIN_VERSION_HASH", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17440, + "src": "2207:19:67", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "expression": { + "id": 17467, + "name": "block", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -4, + "src": "2244:5:67", + "typeDescriptions": { + "typeIdentifier": "t_magic_block", + "typeString": "block" + } + }, + "id": 17468, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "2250:7:67", + "memberName": "chainid", + "nodeType": "MemberAccess", + "src": "2244:13:67", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "arguments": [ + { + "id": 17471, + "name": "this", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -28, + "src": "2283:4:67", + "typeDescriptions": { + "typeIdentifier": "t_contract$_AttestationManager_$17555", + "typeString": "contract AttestationManager" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_AttestationManager_$17555", + "typeString": "contract AttestationManager" + } + ], + "id": 17470, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "2275:7:67", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 17469, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2275:7:67", + "typeDescriptions": {} + } + }, + "id": 17472, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2275:13:67", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 17473, + "name": "DOMAIN_SALT", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17444, + "src": "2306:11:67", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "expression": { + "id": 17462, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -1, + "src": "2111:3:67", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 17463, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "2115:6:67", + "memberName": "encode", + "nodeType": "MemberAccess", + "src": "2111:10:67", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencode_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 17474, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2111:220:67", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 17461, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -8, + "src": "2088:9:67", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 17475, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2088:253:67", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "src": "2069:272:67", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "id": 17477, + "nodeType": "ExpressionStatement", + "src": "2069:272:67" + } + ] + }, + "documentation": { + "id": 17455, + "nodeType": "StructuredDocumentation", + "src": "1862:66:67", + "text": " @dev Initialize the AttestationManager contract" + }, + "id": 17479, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "id": 17458, + "kind": "modifierInvocation", + "modifierName": { + "id": 17457, + "name": "onlyInitializing", + "nameLocations": [ + "2042:16:67" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 5286, + "src": "2042:16:67" + }, + "nodeType": "ModifierInvocation", + "src": "2042:16:67" + } + ], + "name": "__AttestationManager_init_unchained", + "nameLocation": "1995:35:67", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 17456, + "nodeType": "ParameterList", + "parameters": [], + "src": "2030:2:67" + }, + "returnParameters": { + "id": 17459, + "nodeType": "ParameterList", + "parameters": [], + "src": "2059:0:67" + }, + "scope": 17555, + "src": "1986:362:67", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 17523, + "nodeType": "Block", + "src": "2607:605:67", + "statements": [ + { + "assignments": [ + 17492 + ], + "declarations": [ + { + "constant": false, + "id": 17492, + "mutability": "mutable", + "name": "receipt", + "nameLocation": "2722:7:67", + "nodeType": "VariableDeclaration", + "scope": 17523, + "src": "2695:34:67", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Receipt_$16044_memory_ptr", + "typeString": "struct Attestation.Receipt" + }, + "typeName": { + "id": 17491, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 17490, + "name": "Attestation.Receipt", + "nameLocations": [ + "2695:11:67", + "2707:7:67" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 16044, + "src": "2695:19:67" + }, + "referencedDeclaration": 16044, + "src": "2695:19:67", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Receipt_$16044_storage_ptr", + "typeString": "struct Attestation.Receipt" + } + }, + "visibility": "internal" + } + ], + "id": 17502, + "initialValue": { + "arguments": [ + { + "expression": { + "id": 17495, + "name": "_attestation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17483, + "src": "2765:12:67", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16058_memory_ptr", + "typeString": "struct Attestation.State memory" + } + }, + "id": 17496, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "2778:10:67", + "memberName": "requestCID", + "nodeType": "MemberAccess", + "referencedDeclaration": 16047, + "src": "2765:23:67", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "expression": { + "id": 17497, + "name": "_attestation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17483, + "src": "2802:12:67", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16058_memory_ptr", + "typeString": "struct Attestation.State memory" + } + }, + "id": 17498, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "2815:11:67", + "memberName": "responseCID", + "nodeType": "MemberAccess", + "referencedDeclaration": 16049, + "src": "2802:24:67", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "expression": { + "id": 17499, + "name": "_attestation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17483, + "src": "2840:12:67", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16058_memory_ptr", + "typeString": "struct Attestation.State memory" + } + }, + "id": 17500, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "2853:20:67", + "memberName": "subgraphDeploymentId", + "nodeType": "MemberAccess", + "referencedDeclaration": 16051, + "src": "2840:33:67", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "expression": { + "id": 17493, + "name": "Attestation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 16290, + "src": "2732:11:67", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_Attestation_$16290_$", + "typeString": "type(library Attestation)" + } + }, + "id": 17494, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "2744:7:67", + "memberName": "Receipt", + "nodeType": "MemberAccess", + "referencedDeclaration": 16044, + "src": "2732:19:67", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_struct$_Receipt_$16044_storage_ptr_$", + "typeString": "type(struct Attestation.Receipt storage pointer)" + } + }, + "id": 17501, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "structConstructorCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2732:151:67", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_Receipt_$16044_memory_ptr", + "typeString": "struct Attestation.Receipt memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "2695:188:67" + }, + { + "assignments": [ + 17504 + ], + "declarations": [ + { + "constant": false, + "id": 17504, + "mutability": "mutable", + "name": "messageHash", + "nameLocation": "2901:11:67", + "nodeType": "VariableDeclaration", + "scope": 17523, + "src": "2893:19:67", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 17503, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "2893:7:67", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "id": 17508, + "initialValue": { + "arguments": [ + { + "id": 17506, + "name": "receipt", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17492, + "src": "2930:7:67", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Receipt_$16044_memory_ptr", + "typeString": "struct Attestation.Receipt memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_struct$_Receipt_$16044_memory_ptr", + "typeString": "struct Attestation.Receipt memory" + } + ], + "id": 17505, + "name": "_encodeReceipt", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17554, + "src": "2915:14:67", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_struct$_Receipt_$16044_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (struct Attestation.Receipt memory) view returns (bytes32)" + } + }, + "id": 17507, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2915:23:67", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "2893:45:67" + }, + { + "expression": { + "arguments": [ + { + "id": 17511, + "name": "messageHash", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17504, + "src": "3127:11:67", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "arguments": [ + { + "expression": { + "id": 17514, + "name": "_attestation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17483, + "src": "3157:12:67", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16058_memory_ptr", + "typeString": "struct Attestation.State memory" + } + }, + "id": 17515, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "3170:1:67", + "memberName": "r", + "nodeType": "MemberAccess", + "referencedDeclaration": 16053, + "src": "3157:14:67", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "expression": { + "id": 17516, + "name": "_attestation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17483, + "src": "3173:12:67", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16058_memory_ptr", + "typeString": "struct Attestation.State memory" + } + }, + "id": 17517, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "3186:1:67", + "memberName": "s", + "nodeType": "MemberAccess", + "referencedDeclaration": 16055, + "src": "3173:14:67", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "expression": { + "id": 17518, + "name": "_attestation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17483, + "src": "3189:12:67", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16058_memory_ptr", + "typeString": "struct Attestation.State memory" + } + }, + "id": 17519, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "3202:1:67", + "memberName": "v", + "nodeType": "MemberAccess", + "referencedDeclaration": 16057, + "src": "3189:14:67", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + ], + "expression": { + "id": 17512, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -1, + "src": "3140:3:67", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 17513, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "3144:12:67", + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "src": "3140:16:67", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 17520, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3140:64:67", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "expression": { + "id": 17509, + "name": "ECDSA", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8231, + "src": "3113:5:67", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_ECDSA_$8231_$", + "typeString": "type(library ECDSA)" + } + }, + "id": 17510, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "3119:7:67", + "memberName": "recover", + "nodeType": "MemberAccess", + "referencedDeclaration": 7987, + "src": "3113:13:67", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_bytes32_$_t_bytes_memory_ptr_$returns$_t_address_$", + "typeString": "function (bytes32,bytes memory) pure returns (address)" + } + }, + "id": 17521, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3113:92:67", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "functionReturnParameters": 17487, + "id": 17522, + "nodeType": "Return", + "src": "3106:99:67" + } + ] + }, + "documentation": { + "id": 17480, + "nodeType": "StructuredDocumentation", + "src": "2354:153:67", + "text": " @dev Recover the signer address of the `_attestation`.\n @param _attestation The attestation struct\n @return Signer address" + }, + "id": 17524, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_recoverSigner", + "nameLocation": "2521:14:67", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 17484, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 17483, + "mutability": "mutable", + "name": "_attestation", + "nameLocation": "2561:12:67", + "nodeType": "VariableDeclaration", + "scope": 17524, + "src": "2536:37:67", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16058_memory_ptr", + "typeString": "struct Attestation.State" + }, + "typeName": { + "id": 17482, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 17481, + "name": "Attestation.State", + "nameLocations": [ + "2536:11:67", + "2548:5:67" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 16058, + "src": "2536:17:67" + }, + "referencedDeclaration": 16058, + "src": "2536:17:67", + "typeDescriptions": { + "typeIdentifier": "t_struct$_State_$16058_storage_ptr", + "typeString": "struct Attestation.State" + } + }, + "visibility": "internal" + } + ], + "src": "2535:39:67" + }, + "returnParameters": { + "id": 17487, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 17486, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 17524, + "src": "2598:7:67", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 17485, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2598:7:67", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "2597:9:67" + }, + "scope": 17555, + "src": "2512:700:67", + "stateMutability": "view", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 17553, + "nodeType": "Block", + "src": "3746:576:67", + "statements": [ + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "hexValue": "1901", + "id": 17536, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3840:10:67", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_301a50b291d33ce1e8e9064e3f6a6c51d902ec22892b50d58abf6357c6a45541", + "typeString": "literal_string hex\"1901\"" + }, + "value": "\u0019\u0001" + }, + { + "id": 17537, + "name": "_domainSeparator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17561, + "src": "3915:16:67", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "arguments": [ + { + "arguments": [ + { + "id": 17541, + "name": "RECEIPT_TYPE_HASH", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17422, + "src": "4028:17:67", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "expression": { + "id": 17542, + "name": "_receipt", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17528, + "src": "4075:8:67", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Receipt_$16044_memory_ptr", + "typeString": "struct Attestation.Receipt memory" + } + }, + "id": 17543, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "4084:10:67", + "memberName": "requestCID", + "nodeType": "MemberAccess", + "referencedDeclaration": 16039, + "src": "4075:19:67", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "expression": { + "id": 17544, + "name": "_receipt", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17528, + "src": "4124:8:67", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Receipt_$16044_memory_ptr", + "typeString": "struct Attestation.Receipt memory" + } + }, + "id": 17545, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "4133:11:67", + "memberName": "responseCID", + "nodeType": "MemberAccess", + "referencedDeclaration": 16041, + "src": "4124:20:67", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "expression": { + "id": 17546, + "name": "_receipt", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17528, + "src": "4174:8:67", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Receipt_$16044_memory_ptr", + "typeString": "struct Attestation.Receipt memory" + } + }, + "id": 17547, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "4183:20:67", + "memberName": "subgraphDeploymentId", + "nodeType": "MemberAccess", + "referencedDeclaration": 16043, + "src": "4174:29:67", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "expression": { + "id": 17539, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -1, + "src": "3988:3:67", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 17540, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "3992:6:67", + "memberName": "encode", + "nodeType": "MemberAccess", + "src": "3988:10:67", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencode_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 17548, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3988:241:67", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 17538, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -8, + "src": "3953:9:67", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 17549, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3953:330:67", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_stringliteral_301a50b291d33ce1e8e9064e3f6a6c51d902ec22892b50d58abf6357c6a45541", + "typeString": "literal_string hex\"1901\"" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "expression": { + "id": 17534, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -1, + "src": "3802:3:67", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 17535, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "3806:12:67", + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "src": "3802:16:67", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 17550, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3802:499:67", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 17533, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -8, + "src": "3775:9:67", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 17551, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3775:540:67", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "functionReturnParameters": 17532, + "id": 17552, + "nodeType": "Return", + "src": "3756:559:67" + } + ] + }, + "documentation": { + "id": 17525, + "nodeType": "StructuredDocumentation", + "src": "3218:430:67", + "text": " @dev Get the message hash that a indexer used to sign the receipt.\n Encodes a receipt using a domain separator, as described on\n https://github.com/ethereum/EIPs/blob/master/EIPS/eip-712.md#specification.\n @notice Return the message hash used to sign the receipt\n @param _receipt Receipt returned by indexer and submitted by fisherman\n @return Message hash used to sign the receipt" + }, + "id": 17554, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_encodeReceipt", + "nameLocation": "3662:14:67", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 17529, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 17528, + "mutability": "mutable", + "name": "_receipt", + "nameLocation": "3704:8:67", + "nodeType": "VariableDeclaration", + "scope": 17554, + "src": "3677:35:67", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Receipt_$16044_memory_ptr", + "typeString": "struct Attestation.Receipt" + }, + "typeName": { + "id": 17527, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 17526, + "name": "Attestation.Receipt", + "nameLocations": [ + "3677:11:67", + "3689:7:67" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 16044, + "src": "3677:19:67" + }, + "referencedDeclaration": 16044, + "src": "3677:19:67", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Receipt_$16044_storage_ptr", + "typeString": "struct Attestation.Receipt" + } + }, + "visibility": "internal" + } + ], + "src": "3676:37:67" + }, + "returnParameters": { + "id": 17532, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 17531, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 17554, + "src": "3737:7:67", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 17530, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "3737:7:67", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "3736:9:67" + }, + "scope": 17555, + "src": "3653:669:67", + "stateMutability": "view", + "virtual": false, + "visibility": "internal" + } + ], + "scope": 17556, + "src": "731:3593:67", + "usedErrors": [ + 5140, + 5143 + ], + "usedEvents": [ + 5148 + ] + } + ], + "src": "45:4280:67" + }, + "id": 67 + }, + "contracts/utilities/AttestationManagerStorage.sol": { + "ast": { + "absolutePath": "contracts/utilities/AttestationManagerStorage.sol", + "exportedSymbols": { + "AttestationManagerV1Storage": [ + 17567 + ] + }, + "id": 17568, + "license": "GPL-3.0-or-later", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 17557, + "literals": [ + "solidity", + "0.8", + ".27" + ], + "nodeType": "PragmaDirective", + "src": "45:23:68" + }, + { + "abstract": true, + "baseContracts": [], + "canonicalName": "AttestationManagerV1Storage", + "contractDependencies": [], + "contractKind": "contract", + "documentation": { + "id": 17558, + "nodeType": "StructuredDocumentation", + "src": "70:278:68", + "text": " @title AttestationManagerStorage\n @notice This contract holds all the storage variables for the Attestation Manager contract.\n @custom:security-contact Please email security+contracts@thegraph.com if you find any\n bugs. We may have an active bug bounty program." + }, + "fullyImplemented": true, + "id": 17567, + "linearizedBaseContracts": [ + 17567 + ], + "name": "AttestationManagerV1Storage", + "nameLocation": "367:27:68", + "nodeType": "ContractDefinition", + "nodes": [ + { + "constant": false, + "documentation": { + "id": 17559, + "nodeType": "StructuredDocumentation", + "src": "401:32:68", + "text": "@dev EIP712 domain separator" + }, + "id": 17561, + "mutability": "mutable", + "name": "_domainSeparator", + "nameLocation": "455:16:68", + "nodeType": "VariableDeclaration", + "scope": 17567, + "src": "438:33:68", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 17560, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "438:7:68", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "documentation": { + "id": 17562, + "nodeType": "StructuredDocumentation", + "src": "478:57:68", + "text": "@dev Gap to allow adding variables in future upgrades" + }, + "id": 17566, + "mutability": "mutable", + "name": "__gap", + "nameLocation": "560:5:68", + "nodeType": "VariableDeclaration", + "scope": 17567, + "src": "540:25:68", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$50_storage", + "typeString": "uint256[50]" + }, + "typeName": { + "baseType": { + "id": 17563, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "540:7:68", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 17565, + "length": { + "hexValue": "3530", + "id": 17564, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "548:2:68", + "typeDescriptions": { + "typeIdentifier": "t_rational_50_by_1", + "typeString": "int_const 50" + }, + "value": "50" + }, + "nodeType": "ArrayTypeName", + "src": "540:11:68", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$50_storage_ptr", + "typeString": "uint256[50]" + } + }, + "visibility": "private" + } + ], + "scope": 17568, + "src": "349:219:68", + "usedErrors": [], + "usedEvents": [] + } + ], + "src": "45:524:68" + }, + "id": 68 + }, + "contracts/utilities/Directory.sol": { + "ast": { + "absolutePath": "contracts/utilities/Directory.sol", + "exportedSymbols": { + "Directory": [ + 17720 + ], + "ICuration": [ + 165 + ], + "IDisputeManager": [ + 15373 + ], + "IGraphTallyCollector": [ + 2605 + ], + "ISubgraphService": [ + 15634 + ] + }, + "id": 17721, + "license": "GPL-3.0-or-later", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 17569, + "literals": [ + "solidity", + "0.8", + ".27" + ], + "nodeType": "PragmaDirective", + "src": "45:23:69" + }, + { + "absolutePath": "contracts/interfaces/IDisputeManager.sol", + "file": "../interfaces/IDisputeManager.sol", + "id": 17571, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 17721, + "sourceUnit": 15374, + "src": "70:68:69", + "symbolAliases": [ + { + "foreign": { + "id": 17570, + "name": "IDisputeManager", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15373, + "src": "79:15:69", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "contracts/interfaces/ISubgraphService.sol", + "file": "../interfaces/ISubgraphService.sol", + "id": 17573, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 17721, + "sourceUnit": 15635, + "src": "139:70:69", + "symbolAliases": [ + { + "foreign": { + "id": 17572, + "name": "ISubgraphService", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15634, + "src": "148:16:69", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "@graphprotocol/horizon/contracts/interfaces/IGraphTallyCollector.sol", + "file": "@graphprotocol/horizon/contracts/interfaces/IGraphTallyCollector.sol", + "id": 17575, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 17721, + "sourceUnit": 2606, + "src": "210:108:69", + "symbolAliases": [ + { + "foreign": { + "id": 17574, + "name": "IGraphTallyCollector", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2605, + "src": "219:20:69", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "absolutePath": "@graphprotocol/contracts/contracts/curation/ICuration.sol", + "file": "@graphprotocol/contracts/contracts/curation/ICuration.sol", + "id": 17577, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 17721, + "sourceUnit": 166, + "src": "319:86:69", + "symbolAliases": [ + { + "foreign": { + "id": 17576, + "name": "ICuration", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 165, + "src": "328:9:69", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" + }, + { + "abstract": true, + "baseContracts": [], + "canonicalName": "Directory", + "contractDependencies": [], + "contractKind": "contract", + "documentation": { + "id": 17578, + "nodeType": "StructuredDocumentation", + "src": "407:388:69", + "text": " @title Directory contract\n @notice This contract is meant to be inherited by {SubgraphService} contract.\n It contains the addresses of the contracts that the contract interacts with.\n Uses immutable variables to minimize gas costs.\n @custom:security-contact Please email security+contracts@thegraph.com if you find any\n bugs. We may have an active bug bounty program." + }, + "fullyImplemented": true, + "id": 17720, + "linearizedBaseContracts": [ + 17720 + ], + "name": "Directory", + "nameLocation": "814:9:69", + "nodeType": "ContractDefinition", + "nodes": [ + { + "constant": false, + "documentation": { + "id": 17579, + "nodeType": "StructuredDocumentation", + "src": "830:49:69", + "text": "@notice The Subgraph Service contract address" + }, + "id": 17582, + "mutability": "immutable", + "name": "SUBGRAPH_SERVICE", + "nameLocation": "919:16:69", + "nodeType": "VariableDeclaration", + "scope": 17720, + "src": "884:51:69", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_contract$_ISubgraphService_$15634", + "typeString": "contract ISubgraphService" + }, + "typeName": { + "id": 17581, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 17580, + "name": "ISubgraphService", + "nameLocations": [ + "884:16:69" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 15634, + "src": "884:16:69" + }, + "referencedDeclaration": 15634, + "src": "884:16:69", + "typeDescriptions": { + "typeIdentifier": "t_contract$_ISubgraphService_$15634", + "typeString": "contract ISubgraphService" + } + }, + "visibility": "private" + }, + { + "constant": false, + "documentation": { + "id": 17583, + "nodeType": "StructuredDocumentation", + "src": "942:48:69", + "text": "@notice The Dispute Manager contract address" + }, + "id": 17586, + "mutability": "immutable", + "name": "DISPUTE_MANAGER", + "nameLocation": "1029:15:69", + "nodeType": "VariableDeclaration", + "scope": 17720, + "src": "995:49:69", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IDisputeManager_$15373", + "typeString": "contract IDisputeManager" + }, + "typeName": { + "id": 17585, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 17584, + "name": "IDisputeManager", + "nameLocations": [ + "995:15:69" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 15373, + "src": "995:15:69" + }, + "referencedDeclaration": 15373, + "src": "995:15:69", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IDisputeManager_$15373", + "typeString": "contract IDisputeManager" + } + }, + "visibility": "private" + }, + { + "constant": false, + "documentation": { + "id": 17587, + "nodeType": "StructuredDocumentation", + "src": "1051:132:69", + "text": "@notice The Graph Tally Collector contract address\n @dev Required to collect payments via Graph Horizon payments protocol" + }, + "id": 17590, + "mutability": "immutable", + "name": "GRAPH_TALLY_COLLECTOR", + "nameLocation": "1227:21:69", + "nodeType": "VariableDeclaration", + "scope": 17720, + "src": "1188:60:69", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IGraphTallyCollector_$2605", + "typeString": "contract IGraphTallyCollector" + }, + "typeName": { + "id": 17589, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 17588, + "name": "IGraphTallyCollector", + "nameLocations": [ + "1188:20:69" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 2605, + "src": "1188:20:69" + }, + "referencedDeclaration": 2605, + "src": "1188:20:69", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IGraphTallyCollector_$2605", + "typeString": "contract IGraphTallyCollector" + } + }, + "visibility": "private" + }, + { + "constant": false, + "documentation": { + "id": 17591, + "nodeType": "StructuredDocumentation", + "src": "1255:94:69", + "text": "@notice The Curation contract address\n @dev Required for curation fees distribution" + }, + "id": 17594, + "mutability": "immutable", + "name": "CURATION", + "nameLocation": "1382:8:69", + "nodeType": "VariableDeclaration", + "scope": 17720, + "src": "1354:36:69", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_contract$_ICuration_$165", + "typeString": "contract ICuration" + }, + "typeName": { + "id": 17593, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 17592, + "name": "ICuration", + "nameLocations": [ + "1354:9:69" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 165, + "src": "1354:9:69" + }, + "referencedDeclaration": 165, + "src": "1354:9:69", + "typeDescriptions": { + "typeIdentifier": "t_contract$_ICuration_$165", + "typeString": "contract ICuration" + } + }, + "visibility": "private" + }, + { + "anonymous": false, + "documentation": { + "id": 17595, + "nodeType": "StructuredDocumentation", + "src": "1397:332:69", + "text": " @notice Emitted when the Directory is initialized\n @param subgraphService The Subgraph Service contract address\n @param disputeManager The Dispute Manager contract address\n @param graphTallyCollector The Graph Tally Collector contract address\n @param curation The Curation contract address" + }, + "eventSelector": "4175b2c37456dbac494e08de8666d31bb8f3f2aee36ea5d9e06894ff3e4ddda7", + "id": 17605, + "name": "SubgraphServiceDirectoryInitialized", + "nameLocation": "1740:35:69", + "nodeType": "EventDefinition", + "parameters": { + "id": 17604, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 17597, + "indexed": false, + "mutability": "mutable", + "name": "subgraphService", + "nameLocation": "1793:15:69", + "nodeType": "VariableDeclaration", + "scope": 17605, + "src": "1785:23:69", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 17596, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1785:7:69", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 17599, + "indexed": false, + "mutability": "mutable", + "name": "disputeManager", + "nameLocation": "1826:14:69", + "nodeType": "VariableDeclaration", + "scope": 17605, + "src": "1818:22:69", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 17598, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1818:7:69", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 17601, + "indexed": false, + "mutability": "mutable", + "name": "graphTallyCollector", + "nameLocation": "1858:19:69", + "nodeType": "VariableDeclaration", + "scope": 17605, + "src": "1850:27:69", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 17600, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1850:7:69", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 17603, + "indexed": false, + "mutability": "mutable", + "name": "curation", + "nameLocation": "1895:8:69", + "nodeType": "VariableDeclaration", + "scope": 17605, + "src": "1887:16:69", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 17602, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1887:7:69", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "1775:134:69" + }, + "src": "1734:176:69" + }, + { + "documentation": { + "id": 17606, + "nodeType": "StructuredDocumentation", + "src": "1916:173:69", + "text": " @notice Thrown when the caller is not the Dispute Manager\n @param caller The caller address\n @param disputeManager The Dispute Manager address" + }, + "errorSelector": "cdc0567f", + "id": 17612, + "name": "DirectoryNotDisputeManager", + "nameLocation": "2100:26:69", + "nodeType": "ErrorDefinition", + "parameters": { + "id": 17611, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 17608, + "mutability": "mutable", + "name": "caller", + "nameLocation": "2135:6:69", + "nodeType": "VariableDeclaration", + "scope": 17612, + "src": "2127:14:69", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 17607, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2127:7:69", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 17610, + "mutability": "mutable", + "name": "disputeManager", + "nameLocation": "2151:14:69", + "nodeType": "VariableDeclaration", + "scope": 17612, + "src": "2143:22:69", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 17609, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2143:7:69", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "2126:40:69" + }, + "src": "2094:73:69" + }, + { + "body": { + "id": 17634, + "nodeType": "Block", + "src": "2280:175:69", + "statements": [ + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 17622, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 17616, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "2311:3:69", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 17617, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "2315:6:69", + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "2311:10:69", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "arguments": [ + { + "id": 17620, + "name": "DISPUTE_MANAGER", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17586, + "src": "2333:15:69", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IDisputeManager_$15373", + "typeString": "contract IDisputeManager" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_IDisputeManager_$15373", + "typeString": "contract IDisputeManager" + } + ], + "id": 17619, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "2325:7:69", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 17618, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2325:7:69", + "typeDescriptions": {} + } + }, + "id": 17621, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2325:24:69", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "2311:38:69", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "arguments": [ + { + "expression": { + "id": 17624, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "2390:3:69", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 17625, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "2394:6:69", + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "2390:10:69", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "arguments": [ + { + "id": 17628, + "name": "DISPUTE_MANAGER", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17586, + "src": "2410:15:69", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IDisputeManager_$15373", + "typeString": "contract IDisputeManager" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_IDisputeManager_$15373", + "typeString": "contract IDisputeManager" + } + ], + "id": 17627, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "2402:7:69", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 17626, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2402:7:69", + "typeDescriptions": {} + } + }, + "id": 17629, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2402:24:69", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 17623, + "name": "DirectoryNotDisputeManager", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17612, + "src": "2363:26:69", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$_t_address_$_t_address_$returns$_t_error_$", + "typeString": "function (address,address) pure returns (error)" + } + }, + "id": 17630, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2363:64:69", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_error", + "typeString": "error" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_error", + "typeString": "error" + } + ], + "id": 17615, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "2290:7:69", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_error_$returns$__$", + "typeString": "function (bool,error) pure" + } + }, + "id": 17631, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2290:147:69", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 17632, + "nodeType": "ExpressionStatement", + "src": "2290:147:69" + }, + { + "id": 17633, + "nodeType": "PlaceholderStatement", + "src": "2447:1:69" + } + ] + }, + "documentation": { + "id": 17613, + "nodeType": "StructuredDocumentation", + "src": "2173:72:69", + "text": " @notice Checks that the caller is the Dispute Manager" + }, + "id": 17635, + "name": "onlyDisputeManager", + "nameLocation": "2259:18:69", + "nodeType": "ModifierDefinition", + "parameters": { + "id": 17614, + "nodeType": "ParameterList", + "parameters": [], + "src": "2277:2:69" + }, + "src": "2250:205:69", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 17678, + "nodeType": "Block", + "src": "2903:358:69", + "statements": [ + { + "expression": { + "id": 17651, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 17647, + "name": "SUBGRAPH_SERVICE", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17582, + "src": "2913:16:69", + "typeDescriptions": { + "typeIdentifier": "t_contract$_ISubgraphService_$15634", + "typeString": "contract ISubgraphService" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "id": 17649, + "name": "subgraphService", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17638, + "src": "2949:15:69", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 17648, + "name": "ISubgraphService", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15634, + "src": "2932:16:69", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_ISubgraphService_$15634_$", + "typeString": "type(contract ISubgraphService)" + } + }, + "id": 17650, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2932:33:69", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_ISubgraphService_$15634", + "typeString": "contract ISubgraphService" + } + }, + "src": "2913:52:69", + "typeDescriptions": { + "typeIdentifier": "t_contract$_ISubgraphService_$15634", + "typeString": "contract ISubgraphService" + } + }, + "id": 17652, + "nodeType": "ExpressionStatement", + "src": "2913:52:69" + }, + { + "expression": { + "id": 17657, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 17653, + "name": "DISPUTE_MANAGER", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17586, + "src": "2975:15:69", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IDisputeManager_$15373", + "typeString": "contract IDisputeManager" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "id": 17655, + "name": "disputeManager", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17640, + "src": "3009:14:69", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 17654, + "name": "IDisputeManager", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 15373, + "src": "2993:15:69", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_IDisputeManager_$15373_$", + "typeString": "type(contract IDisputeManager)" + } + }, + "id": 17656, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2993:31:69", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_IDisputeManager_$15373", + "typeString": "contract IDisputeManager" + } + }, + "src": "2975:49:69", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IDisputeManager_$15373", + "typeString": "contract IDisputeManager" + } + }, + "id": 17658, + "nodeType": "ExpressionStatement", + "src": "2975:49:69" + }, + { + "expression": { + "id": 17663, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 17659, + "name": "GRAPH_TALLY_COLLECTOR", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17590, + "src": "3034:21:69", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IGraphTallyCollector_$2605", + "typeString": "contract IGraphTallyCollector" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "id": 17661, + "name": "graphTallyCollector", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17642, + "src": "3079:19:69", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 17660, + "name": "IGraphTallyCollector", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2605, + "src": "3058:20:69", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_IGraphTallyCollector_$2605_$", + "typeString": "type(contract IGraphTallyCollector)" + } + }, + "id": 17662, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3058:41:69", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_IGraphTallyCollector_$2605", + "typeString": "contract IGraphTallyCollector" + } + }, + "src": "3034:65:69", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IGraphTallyCollector_$2605", + "typeString": "contract IGraphTallyCollector" + } + }, + "id": 17664, + "nodeType": "ExpressionStatement", + "src": "3034:65:69" + }, + { + "expression": { + "id": 17669, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 17665, + "name": "CURATION", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17594, + "src": "3109:8:69", + "typeDescriptions": { + "typeIdentifier": "t_contract$_ICuration_$165", + "typeString": "contract ICuration" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "id": 17667, + "name": "curation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17644, + "src": "3130:8:69", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 17666, + "name": "ICuration", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 165, + "src": "3120:9:69", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_ICuration_$165_$", + "typeString": "type(contract ICuration)" + } + }, + "id": 17668, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3120:19:69", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_ICuration_$165", + "typeString": "contract ICuration" + } + }, + "src": "3109:30:69", + "typeDescriptions": { + "typeIdentifier": "t_contract$_ICuration_$165", + "typeString": "contract ICuration" + } + }, + "id": 17670, + "nodeType": "ExpressionStatement", + "src": "3109:30:69" + }, + { + "eventCall": { + "arguments": [ + { + "id": 17672, + "name": "subgraphService", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17638, + "src": "3191:15:69", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 17673, + "name": "disputeManager", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17640, + "src": "3208:14:69", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 17674, + "name": "graphTallyCollector", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17642, + "src": "3224:19:69", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 17675, + "name": "curation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17644, + "src": "3245:8:69", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 17671, + "name": "SubgraphServiceDirectoryInitialized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17605, + "src": "3155:35:69", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_address_$_t_address_$returns$__$", + "typeString": "function (address,address,address,address)" + } + }, + "id": 17676, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3155:99:69", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 17677, + "nodeType": "EmitStatement", + "src": "3150:104:69" + } + ] + }, + "documentation": { + "id": 17636, + "nodeType": "StructuredDocumentation", + "src": "2461:329:69", + "text": " @notice Constructor for the Directory contract\n @param subgraphService The Subgraph Service contract address\n @param disputeManager The Dispute Manager contract address\n @param graphTallyCollector The Graph Tally Collector contract address\n @param curation The Curation contract address" + }, + "id": 17679, + "implemented": true, + "kind": "constructor", + "modifiers": [], + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 17645, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 17638, + "mutability": "mutable", + "name": "subgraphService", + "nameLocation": "2815:15:69", + "nodeType": "VariableDeclaration", + "scope": 17679, + "src": "2807:23:69", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 17637, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2807:7:69", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 17640, + "mutability": "mutable", + "name": "disputeManager", + "nameLocation": "2840:14:69", + "nodeType": "VariableDeclaration", + "scope": 17679, + "src": "2832:22:69", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 17639, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2832:7:69", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 17642, + "mutability": "mutable", + "name": "graphTallyCollector", + "nameLocation": "2864:19:69", + "nodeType": "VariableDeclaration", + "scope": 17679, + "src": "2856:27:69", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 17641, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2856:7:69", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 17644, + "mutability": "mutable", + "name": "curation", + "nameLocation": "2893:8:69", + "nodeType": "VariableDeclaration", + "scope": 17679, + "src": "2885:16:69", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 17643, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2885:7:69", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "2806:96:69" + }, + "returnParameters": { + "id": 17646, + "nodeType": "ParameterList", + "parameters": [], + "src": "2903:0:69" + }, + "scope": 17720, + "src": "2795:466:69", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 17688, + "nodeType": "Block", + "src": "3458:40:69", + "statements": [ + { + "expression": { + "id": 17686, + "name": "SUBGRAPH_SERVICE", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17582, + "src": "3475:16:69", + "typeDescriptions": { + "typeIdentifier": "t_contract$_ISubgraphService_$15634", + "typeString": "contract ISubgraphService" + } + }, + "functionReturnParameters": 17685, + "id": 17687, + "nodeType": "Return", + "src": "3468:23:69" + } + ] + }, + "documentation": { + "id": 17680, + "nodeType": "StructuredDocumentation", + "src": "3267:117:69", + "text": " @notice Returns the Subgraph Service contract address\n @return The Subgraph Service contract" + }, + "id": 17689, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_subgraphService", + "nameLocation": "3398:16:69", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 17681, + "nodeType": "ParameterList", + "parameters": [], + "src": "3414:2:69" + }, + "returnParameters": { + "id": 17685, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 17684, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 17689, + "src": "3440:16:69", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_contract$_ISubgraphService_$15634", + "typeString": "contract ISubgraphService" + }, + "typeName": { + "id": 17683, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 17682, + "name": "ISubgraphService", + "nameLocations": [ + "3440:16:69" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 15634, + "src": "3440:16:69" + }, + "referencedDeclaration": 15634, + "src": "3440:16:69", + "typeDescriptions": { + "typeIdentifier": "t_contract$_ISubgraphService_$15634", + "typeString": "contract ISubgraphService" + } + }, + "visibility": "internal" + } + ], + "src": "3439:18:69" + }, + "scope": 17720, + "src": "3389:109:69", + "stateMutability": "view", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 17698, + "nodeType": "Block", + "src": "3691:39:69", + "statements": [ + { + "expression": { + "id": 17696, + "name": "DISPUTE_MANAGER", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17586, + "src": "3708:15:69", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IDisputeManager_$15373", + "typeString": "contract IDisputeManager" + } + }, + "functionReturnParameters": 17695, + "id": 17697, + "nodeType": "Return", + "src": "3701:22:69" + } + ] + }, + "documentation": { + "id": 17690, + "nodeType": "StructuredDocumentation", + "src": "3504:115:69", + "text": " @notice Returns the Dispute Manager contract address\n @return The Dispute Manager contract" + }, + "id": 17699, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_disputeManager", + "nameLocation": "3633:15:69", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 17691, + "nodeType": "ParameterList", + "parameters": [], + "src": "3648:2:69" + }, + "returnParameters": { + "id": 17695, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 17694, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 17699, + "src": "3674:15:69", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IDisputeManager_$15373", + "typeString": "contract IDisputeManager" + }, + "typeName": { + "id": 17693, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 17692, + "name": "IDisputeManager", + "nameLocations": [ + "3674:15:69" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 15373, + "src": "3674:15:69" + }, + "referencedDeclaration": 15373, + "src": "3674:15:69", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IDisputeManager_$15373", + "typeString": "contract IDisputeManager" + } + }, + "visibility": "internal" + } + ], + "src": "3673:17:69" + }, + "scope": 17720, + "src": "3624:106:69", + "stateMutability": "view", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 17708, + "nodeType": "Block", + "src": "3945:45:69", + "statements": [ + { + "expression": { + "id": 17706, + "name": "GRAPH_TALLY_COLLECTOR", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17590, + "src": "3962:21:69", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IGraphTallyCollector_$2605", + "typeString": "contract IGraphTallyCollector" + } + }, + "functionReturnParameters": 17705, + "id": 17707, + "nodeType": "Return", + "src": "3955:28:69" + } + ] + }, + "documentation": { + "id": 17700, + "nodeType": "StructuredDocumentation", + "src": "3736:127:69", + "text": " @notice Returns the Graph Tally Collector contract address\n @return The Graph Tally Collector contract" + }, + "id": 17709, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_graphTallyCollector", + "nameLocation": "3877:20:69", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 17701, + "nodeType": "ParameterList", + "parameters": [], + "src": "3897:2:69" + }, + "returnParameters": { + "id": 17705, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 17704, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 17709, + "src": "3923:20:69", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IGraphTallyCollector_$2605", + "typeString": "contract IGraphTallyCollector" + }, + "typeName": { + "id": 17703, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 17702, + "name": "IGraphTallyCollector", + "nameLocations": [ + "3923:20:69" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 2605, + "src": "3923:20:69" + }, + "referencedDeclaration": 2605, + "src": "3923:20:69", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IGraphTallyCollector_$2605", + "typeString": "contract IGraphTallyCollector" + } + }, + "visibility": "internal" + } + ], + "src": "3922:22:69" + }, + "scope": 17720, + "src": "3868:122:69", + "stateMutability": "view", + "virtual": false, + "visibility": "internal" + }, + { + "body": { + "id": 17718, + "nodeType": "Block", + "src": "4157:32:69", + "statements": [ + { + "expression": { + "id": 17716, + "name": "CURATION", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 17594, + "src": "4174:8:69", + "typeDescriptions": { + "typeIdentifier": "t_contract$_ICuration_$165", + "typeString": "contract ICuration" + } + }, + "functionReturnParameters": 17715, + "id": 17717, + "nodeType": "Return", + "src": "4167:15:69" + } + ] + }, + "documentation": { + "id": 17710, + "nodeType": "StructuredDocumentation", + "src": "3996:101:69", + "text": " @notice Returns the Curation contract address\n @return The Curation contract" + }, + "id": 17719, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_curation", + "nameLocation": "4111:9:69", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 17711, + "nodeType": "ParameterList", + "parameters": [], + "src": "4120:2:69" + }, + "returnParameters": { + "id": 17715, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 17714, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 17719, + "src": "4146:9:69", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_contract$_ICuration_$165", + "typeString": "contract ICuration" + }, + "typeName": { + "id": 17713, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 17712, + "name": "ICuration", + "nameLocations": [ + "4146:9:69" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 165, + "src": "4146:9:69" + }, + "referencedDeclaration": 165, + "src": "4146:9:69", + "typeDescriptions": { + "typeIdentifier": "t_contract$_ICuration_$165", + "typeString": "contract ICuration" + } + }, + "visibility": "internal" + } + ], + "src": "4145:11:69" + }, + "scope": 17720, + "src": "4102:87:69", + "stateMutability": "view", + "virtual": false, + "visibility": "internal" + } + ], + "scope": 17721, + "src": "796:3395:69", + "usedErrors": [ + 17612 + ], + "usedEvents": [ + 17605 + ] + } + ], + "src": "45:4147:69" + }, + "id": 69 + } + }, + "contracts": { + "@graphprotocol/contracts/contracts/arbitrum/ITokenGateway.sol": { + "ITokenGateway": { + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "l1ERC20", + "type": "address" + } + ], + "name": "calculateL2TokenAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "finalizeInboundTransfer", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amunt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxas", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "gasPiceBid", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "outboundTransfer", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "function" + } + ], + "evm": { + "bytecode": { + "functionDebugData": {}, + "generatedSources": [], + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "deployedBytecode": { + "functionDebugData": {}, + "generatedSources": [], + "immutableReferences": {}, + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "methodIdentifiers": { + "calculateL2TokenAddress(address)": "a7e28d48", + "finalizeInboundTransfer(address,address,address,uint256,bytes)": "2e567b36", + "outboundTransfer(address,address,uint256,uint256,uint256,bytes)": "d2ce7d65" + } + }, + "metadata": "{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"l1ERC20\",\"type\":\"address\"}],\"name\":\"calculateL2TokenAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"finalizeInboundTransfer\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amunt\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"gasPiceBid\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"outboundTransfer\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"calculateL2TokenAddress(address)\":{\"details\":\"the L1 and L2 address oracles may not always be in sync. For example, a custom token may have been registered but not deployed or the contract self destructed.\",\"params\":{\"l1ERC20\":\"address of L1 token\"},\"returns\":{\"_0\":\"L2 address of a bridged ERC20 token\"}}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"calculateL2TokenAddress(address)\":{\"notice\":\"Calculate the address used when bridging an ERC20 token\"},\"outboundTransfer(address,address,uint256,uint256,uint256,bytes)\":{\"notice\":\"event deprecated in favor of DepositFinalized and WithdrawalFinalized\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@graphprotocol/contracts/contracts/arbitrum/ITokenGateway.sol\":\"ITokenGateway\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10},\"remappings\":[]},\"sources\":{\"@graphprotocol/contracts/contracts/arbitrum/ITokenGateway.sol\":{\"keccak256\":\"0x3cbcc6e4629543a99acacc7ee4ffa6c063b9fb17d3597ccd2f9481008e3633bd\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://d6bb0bb830b67d579e57a261e5f5d9e90b32dc006b02badbecf1f6c82c0a5100\",\"dweb:/ipfs/Qmd38iNXZpinwbNRJPEAA8r9bmmtRwjTSK1SkmH47ge4kJ\"]}},\"version\":1}" + } + }, + "@graphprotocol/contracts/contracts/curation/ICuration.sol": { + "ICuration": { + "abi": [ + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_signalIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_tokensOutMin", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_tokens", + "type": "uint256" + } + ], + "name": "collect", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "curationTaxPercentage", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + } + ], + "name": "getCurationPoolSignal", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + } + ], + "name": "getCurationPoolTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_curator", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + } + ], + "name": "getCuratorSignal", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + } + ], + "name": "isCurated", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_tokensIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_signalOutMin", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "_percentage", + "type": "uint32" + } + ], + "name": "setCurationTaxPercentage", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_curationTokenMaster", + "type": "address" + } + ], + "name": "setCurationTokenMaster", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "_defaultReserveRatio", + "type": "uint32" + } + ], + "name": "setDefaultReserveRatio", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_minimumCurationDeposit", + "type": "uint256" + } + ], + "name": "setMinimumCurationDeposit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_signalIn", + "type": "uint256" + } + ], + "name": "signalToTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_tokensIn", + "type": "uint256" + } + ], + "name": "tokensToSignal", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "evm": { + "bytecode": { + "functionDebugData": {}, + "generatedSources": [], + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "deployedBytecode": { + "functionDebugData": {}, + "generatedSources": [], + "immutableReferences": {}, + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "methodIdentifiers": { + "burn(bytes32,uint256,uint256)": "24bdeec7", + "collect(bytes32,uint256)": "81573288", + "curationTaxPercentage()": "f115c427", + "getCurationPoolSignal(bytes32)": "99439fee", + "getCurationPoolTokens(bytes32)": "46e855da", + "getCuratorSignal(address,bytes32)": "9f94c667", + "isCurated(bytes32)": "4c4ea0ed", + "mint(bytes32,uint256,uint256)": "375a54ab", + "setCurationTaxPercentage(uint32)": "cd18119e", + "setCurationTokenMaster(address)": "9b4d9f33", + "setDefaultReserveRatio(uint32)": "cd0ad4a2", + "setMinimumCurationDeposit(uint256)": "6536fe32", + "signalToTokens(bytes32,uint256)": "0faaf87f", + "tokensToSignal(bytes32,uint256)": "f049b900" + } + }, + "metadata": "{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_subgraphDeploymentID\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"_signalIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_tokensOutMin\",\"type\":\"uint256\"}],\"name\":\"burn\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_subgraphDeploymentID\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"_tokens\",\"type\":\"uint256\"}],\"name\":\"collect\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"curationTaxPercentage\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_subgraphDeploymentID\",\"type\":\"bytes32\"}],\"name\":\"getCurationPoolSignal\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_subgraphDeploymentID\",\"type\":\"bytes32\"}],\"name\":\"getCurationPoolTokens\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_curator\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"_subgraphDeploymentID\",\"type\":\"bytes32\"}],\"name\":\"getCuratorSignal\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_subgraphDeploymentID\",\"type\":\"bytes32\"}],\"name\":\"isCurated\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_subgraphDeploymentID\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"_tokensIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_signalOutMin\",\"type\":\"uint256\"}],\"name\":\"mint\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_percentage\",\"type\":\"uint32\"}],\"name\":\"setCurationTaxPercentage\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_curationTokenMaster\",\"type\":\"address\"}],\"name\":\"setCurationTokenMaster\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_defaultReserveRatio\",\"type\":\"uint32\"}],\"name\":\"setDefaultReserveRatio\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_minimumCurationDeposit\",\"type\":\"uint256\"}],\"name\":\"setMinimumCurationDeposit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_subgraphDeploymentID\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"_signalIn\",\"type\":\"uint256\"}],\"name\":\"signalToTokens\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_subgraphDeploymentID\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"_tokensIn\",\"type\":\"uint256\"}],\"name\":\"tokensToSignal\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"Interface for the Curation contract (and L2Curation too)\",\"kind\":\"dev\",\"methods\":{\"burn(bytes32,uint256,uint256)\":{\"params\":{\"_signalIn\":\"Amount of signal to return\",\"_subgraphDeploymentID\":\"SubgraphDeployment the curator is returning signal\",\"_tokensOutMin\":\"Expected minimum amount of tokens to receive\"},\"returns\":{\"_0\":\"Tokens returned\"}},\"collect(bytes32,uint256)\":{\"params\":{\"_subgraphDeploymentID\":\"SubgraphDeployment where funds should be allocated as reserves\",\"_tokens\":\"Amount of Graph Tokens to add to reserves\"}},\"curationTaxPercentage()\":{\"returns\":{\"_0\":\"Curation tax percentage expressed in PPM\"}},\"getCurationPoolSignal(bytes32)\":{\"params\":{\"_subgraphDeploymentID\":\"Subgraph deployment curation pool\"},\"returns\":{\"_0\":\"Amount of signal minted for the subgraph deployment\"}},\"getCurationPoolTokens(bytes32)\":{\"params\":{\"_subgraphDeploymentID\":\"Subgraph deployment curation pool\"},\"returns\":{\"_0\":\"Amount of token reserves in the curation pool\"}},\"getCuratorSignal(address,bytes32)\":{\"params\":{\"_curator\":\"Curator owning the signal tokens\",\"_subgraphDeploymentID\":\"Subgraph deployment curation pool\"},\"returns\":{\"_0\":\"Amount of signal owned by a curator for the subgraph deployment\"}},\"isCurated(bytes32)\":{\"params\":{\"_subgraphDeploymentID\":\"SubgraphDeployment to check if curated\"},\"returns\":{\"_0\":\"True if curated, false otherwise\"}},\"mint(bytes32,uint256,uint256)\":{\"params\":{\"_signalOutMin\":\"Expected minimum amount of signal to receive\",\"_subgraphDeploymentID\":\"Subgraph deployment pool from where to mint signal\",\"_tokensIn\":\"Amount of Graph Tokens to deposit\"},\"returns\":{\"_0\":\"Amount of signal minted\",\"_1\":\"Amount of curation tax burned\"}},\"setCurationTaxPercentage(uint32)\":{\"params\":{\"_percentage\":\"Curation tax percentage charged when depositing GRT tokens\"}},\"setCurationTokenMaster(address)\":{\"params\":{\"_curationTokenMaster\":\"Address of implementation contract to use for curation tokens\"}},\"setDefaultReserveRatio(uint32)\":{\"params\":{\"_defaultReserveRatio\":\"Reserve ratio (in PPM)\"}},\"setMinimumCurationDeposit(uint256)\":{\"params\":{\"_minimumCurationDeposit\":\"Minimum amount of tokens required deposit\"}},\"signalToTokens(bytes32,uint256)\":{\"params\":{\"_signalIn\":\"Amount of signal to burn\",\"_subgraphDeploymentID\":\"Subgraph deployment to burn signal\"},\"returns\":{\"_0\":\"Amount of tokens to get for the specified amount of signal\"}},\"tokensToSignal(bytes32,uint256)\":{\"params\":{\"_subgraphDeploymentID\":\"Subgraph deployment to mint signal\",\"_tokensIn\":\"Amount of tokens used to mint signal\"},\"returns\":{\"_0\":\"Amount of signal that can be bought\",\"_1\":\"Amount of tokens that will be burned as curation tax\"}}},\"title\":\"Curation Interface\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"burn(bytes32,uint256,uint256)\":{\"notice\":\"Burn _signal from the SubgraphDeployment curation pool\"},\"collect(bytes32,uint256)\":{\"notice\":\"Assign Graph Tokens collected as curation fees to the curation pool reserve.\"},\"curationTaxPercentage()\":{\"notice\":\"Tax charged when curators deposit funds. Parts per million. (Allows for 4 decimal points, 999,999 = 99.9999%)\"},\"getCurationPoolSignal(bytes32)\":{\"notice\":\"Get the amount of signal in a curation pool.\"},\"getCurationPoolTokens(bytes32)\":{\"notice\":\"Get the amount of token reserves in a curation pool.\"},\"getCuratorSignal(address,bytes32)\":{\"notice\":\"Get the amount of signal a curator has in a curation pool.\"},\"isCurated(bytes32)\":{\"notice\":\"Check if any GRT tokens are deposited for a SubgraphDeployment.\"},\"mint(bytes32,uint256,uint256)\":{\"notice\":\"Deposit Graph Tokens in exchange for signal of a SubgraphDeployment curation pool.\"},\"setCurationTaxPercentage(uint32)\":{\"notice\":\"Set the curation tax percentage to charge when a curator deposits GRT tokens.\"},\"setCurationTokenMaster(address)\":{\"notice\":\"Set the master copy to use as clones for the curation token.\"},\"setDefaultReserveRatio(uint32)\":{\"notice\":\"Update the default reserve ratio to `_defaultReserveRatio`\"},\"setMinimumCurationDeposit(uint256)\":{\"notice\":\"Update the minimum deposit amount needed to intialize a new subgraph\"},\"signalToTokens(bytes32,uint256)\":{\"notice\":\"Calculate number of tokens to get when burning signal from a curation pool.\"},\"tokensToSignal(bytes32,uint256)\":{\"notice\":\"Calculate amount of signal that can be bought with tokens in a curation pool. This function considers and excludes the deposit tax.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@graphprotocol/contracts/contracts/curation/ICuration.sol\":\"ICuration\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10},\"remappings\":[]},\"sources\":{\"@graphprotocol/contracts/contracts/curation/ICuration.sol\":{\"keccak256\":\"0x17e4db429003cab08cd2859db94b95e0cee1f9478c1881903a4104def8fdc048\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://52ed58228a0e92aeb3493473a6e02f92d26a4e4eb0c46d38dd446e3bfcb6691e\",\"dweb:/ipfs/QmZzWxHAztdz2Q7cobqVEf4ExGpNuqWJFYgs2oHCgApjW6\"]}},\"version\":1}" + } + }, + "@graphprotocol/contracts/contracts/disputes/IDisputeManager.sol": { + "IDisputeManager": { + "abi": [ + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_disputeID", + "type": "bytes32" + } + ], + "name": "acceptDispute", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "requestCID", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "responseCID", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "subgraphDeploymentID", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + } + ], + "internalType": "struct IDisputeManager.Attestation", + "name": "_attestation1", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "bytes32", + "name": "requestCID", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "responseCID", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "subgraphDeploymentID", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + } + ], + "internalType": "struct IDisputeManager.Attestation", + "name": "_attestation2", + "type": "tuple" + } + ], + "name": "areConflictingAttestations", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_allocationID", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_deposit", + "type": "uint256" + } + ], + "name": "createIndexingDispute", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_attestationData", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "_deposit", + "type": "uint256" + } + ], + "name": "createQueryDispute", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_attestationData1", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "_attestationData2", + "type": "bytes" + } + ], + "name": "createQueryDisputeConflict", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_disputeID", + "type": "bytes32" + } + ], + "name": "drawDispute", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "requestCID", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "responseCID", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "subgraphDeploymentID", + "type": "bytes32" + } + ], + "internalType": "struct IDisputeManager.Receipt", + "name": "_receipt", + "type": "tuple" + } + ], + "name": "encodeHashReceipt", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "requestCID", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "responseCID", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "subgraphDeploymentID", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + } + ], + "internalType": "struct IDisputeManager.Attestation", + "name": "_attestation", + "type": "tuple" + } + ], + "name": "getAttestationIndexer", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_disputeID", + "type": "bytes32" + } + ], + "name": "isDisputeCreated", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_disputeID", + "type": "bytes32" + } + ], + "name": "rejectDispute", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_arbitrator", + "type": "address" + } + ], + "name": "setArbitrator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "_percentage", + "type": "uint32" + } + ], + "name": "setFishermanRewardPercentage", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_minimumDeposit", + "type": "uint256" + } + ], + "name": "setMinimumDeposit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "_qryPercentage", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "_idxPercentage", + "type": "uint32" + } + ], + "name": "setSlashingPercentage", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "evm": { + "bytecode": { + "functionDebugData": {}, + "generatedSources": [], + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "deployedBytecode": { + "functionDebugData": {}, + "generatedSources": [], + "immutableReferences": {}, + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "methodIdentifiers": { + "acceptDispute(bytes32)": "11b42611", + "areConflictingAttestations((bytes32,bytes32,bytes32,bytes32,bytes32,uint8),(bytes32,bytes32,bytes32,bytes32,bytes32,uint8))": "d36fc9d4", + "createIndexingDispute(address,uint256)": "c8792217", + "createQueryDispute(bytes,uint256)": "131610b1", + "createQueryDisputeConflict(bytes,bytes)": "c894222e", + "drawDispute(bytes32)": "9334ea52", + "encodeHashReceipt((bytes32,bytes32,bytes32))": "460967df", + "getAttestationIndexer((bytes32,bytes32,bytes32,bytes32,bytes32,uint8))": "c9747f51", + "isDisputeCreated(bytes32)": "be41f384", + "rejectDispute(bytes32)": "36167e03", + "setArbitrator(address)": "b0eefabe", + "setFishermanRewardPercentage(uint32)": "991a8355", + "setMinimumDeposit(uint256)": "e78ec42e", + "setSlashingPercentage(uint32,uint32)": "8bbb33b4" + } + }, + "metadata": "{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_disputeID\",\"type\":\"bytes32\"}],\"name\":\"acceptDispute\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"requestCID\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"responseCID\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"subgraphDeploymentID\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"}],\"internalType\":\"struct IDisputeManager.Attestation\",\"name\":\"_attestation1\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"requestCID\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"responseCID\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"subgraphDeploymentID\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"}],\"internalType\":\"struct IDisputeManager.Attestation\",\"name\":\"_attestation2\",\"type\":\"tuple\"}],\"name\":\"areConflictingAttestations\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_allocationID\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_deposit\",\"type\":\"uint256\"}],\"name\":\"createIndexingDispute\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_attestationData\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"_deposit\",\"type\":\"uint256\"}],\"name\":\"createQueryDispute\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_attestationData1\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"_attestationData2\",\"type\":\"bytes\"}],\"name\":\"createQueryDisputeConflict\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_disputeID\",\"type\":\"bytes32\"}],\"name\":\"drawDispute\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"requestCID\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"responseCID\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"subgraphDeploymentID\",\"type\":\"bytes32\"}],\"internalType\":\"struct IDisputeManager.Receipt\",\"name\":\"_receipt\",\"type\":\"tuple\"}],\"name\":\"encodeHashReceipt\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"requestCID\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"responseCID\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"subgraphDeploymentID\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"}],\"internalType\":\"struct IDisputeManager.Attestation\",\"name\":\"_attestation\",\"type\":\"tuple\"}],\"name\":\"getAttestationIndexer\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_disputeID\",\"type\":\"bytes32\"}],\"name\":\"isDisputeCreated\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_disputeID\",\"type\":\"bytes32\"}],\"name\":\"rejectDispute\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_arbitrator\",\"type\":\"address\"}],\"name\":\"setArbitrator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_percentage\",\"type\":\"uint32\"}],\"name\":\"setFishermanRewardPercentage\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_minimumDeposit\",\"type\":\"uint256\"}],\"name\":\"setMinimumDeposit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_qryPercentage\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"_idxPercentage\",\"type\":\"uint32\"}],\"name\":\"setSlashingPercentage\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@graphprotocol/contracts/contracts/disputes/IDisputeManager.sol\":\"IDisputeManager\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10},\"remappings\":[]},\"sources\":{\"@graphprotocol/contracts/contracts/disputes/IDisputeManager.sol\":{\"keccak256\":\"0xc0885c741445df7c565f9dd5f3e3ffc654bc681eb718e178b4265f7c36bb597c\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://c7e4d1147147ca3257d6bd2aca0cbbf098b5be3fe46848b7c09c843e24e85391\",\"dweb:/ipfs/QmeTN6Tq9Qzv4Sb6hgyoKeiK2KGqyWPQcJwjFPqRS1ai9a\"]}},\"version\":1}" + } + }, + "@graphprotocol/contracts/contracts/epochs/IEpochManager.sol": { + "IEpochManager": { + "abi": [ + { + "inputs": [ + { + "internalType": "uint256", + "name": "_block", + "type": "uint256" + } + ], + "name": "blockHash", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "blockNum", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "currentEpoch", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "currentEpochBlock", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "currentEpochBlockSinceStart", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_epoch", + "type": "uint256" + } + ], + "name": "epochsSince", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "epochsSinceUpdate", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isCurrentEpochRun", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "runEpoch", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_epochLength", + "type": "uint256" + } + ], + "name": "setEpochLength", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "evm": { + "bytecode": { + "functionDebugData": {}, + "generatedSources": [], + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "deployedBytecode": { + "functionDebugData": {}, + "generatedSources": [], + "immutableReferences": {}, + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "methodIdentifiers": { + "blockHash(uint256)": "85df51fd", + "blockNum()": "8ae63d6d", + "currentEpoch()": "76671808", + "currentEpochBlock()": "ab93122c", + "currentEpochBlockSinceStart()": "d0cfa46e", + "epochsSince(uint256)": "1b28126d", + "epochsSinceUpdate()": "19c3b82d", + "isCurrentEpochRun()": "1ce05d38", + "runEpoch()": "c46e58eb", + "setEpochLength(uint256)": "54eea796" + } + }, + "metadata": "{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_block\",\"type\":\"uint256\"}],\"name\":\"blockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"blockNum\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"currentEpoch\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"currentEpochBlock\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"currentEpochBlockSinceStart\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_epoch\",\"type\":\"uint256\"}],\"name\":\"epochsSince\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"epochsSinceUpdate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isCurrentEpochRun\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"runEpoch\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_epochLength\",\"type\":\"uint256\"}],\"name\":\"setEpochLength\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@graphprotocol/contracts/contracts/epochs/IEpochManager.sol\":\"IEpochManager\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10},\"remappings\":[]},\"sources\":{\"@graphprotocol/contracts/contracts/epochs/IEpochManager.sol\":{\"keccak256\":\"0x0f4b3a3569c023d2610d0d8b37b3ecb0b67f848d77aa063bb311756670017e85\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://df7c43568e554b301134aa2c58e4889ad0d3dcfec40e834b63621a43f39da154\",\"dweb:/ipfs/QmZeSV9AM6FKCkH9QYyF7i5nVggseEJXbvWbtrgUeXqQpo\"]}},\"version\":1}" + } + }, + "@graphprotocol/contracts/contracts/gateway/ICallhookReceiver.sol": { + "ICallhookReceiver": { + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_from", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "onTokenTransfer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "evm": { + "bytecode": { + "functionDebugData": {}, + "generatedSources": [], + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "deployedBytecode": { + "functionDebugData": {}, + "generatedSources": [], + "immutableReferences": {}, + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "methodIdentifiers": { + "onTokenTransfer(address,uint256,bytes)": "a4c0ed36" + } + }, + "metadata": "{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_from\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"onTokenTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"onTokenTransfer(address,uint256,bytes)\":{\"params\":{\"_amount\":\"Amount of tokens that were transferred\",\"_data\":\"ABI-encoded callhook data\",\"_from\":\"Token sender in L1\"}}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"onTokenTransfer(address,uint256,bytes)\":{\"notice\":\"Receive tokens with a callhook from the bridge\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@graphprotocol/contracts/contracts/gateway/ICallhookReceiver.sol\":\"ICallhookReceiver\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10},\"remappings\":[]},\"sources\":{\"@graphprotocol/contracts/contracts/gateway/ICallhookReceiver.sol\":{\"keccak256\":\"0x1a1627520f3d9ad670b46b9e8d08a928b892955161915dece233912b30989794\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://a8e3df46e53b8cf46bced72f229497620c2f45169d512855877acdccf9b06d0f\",\"dweb:/ipfs/QmUgTnaZZxquYZQVz1dDoLKiD6AKRy1yUFzVCj3DrXBLQ4\"]}},\"version\":1}" + } + }, + "@graphprotocol/contracts/contracts/governance/IController.sol": { + "IController": { + "abi": [ + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_id", + "type": "bytes32" + } + ], + "name": "getContractProxy", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getGovernor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "partialPaused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "paused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_id", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "_contractAddress", + "type": "address" + } + ], + "name": "setContractProxy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "_partialPaused", + "type": "bool" + } + ], + "name": "setPartialPaused", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newPauseGuardian", + "type": "address" + } + ], + "name": "setPauseGuardian", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "_paused", + "type": "bool" + } + ], + "name": "setPaused", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_id", + "type": "bytes32" + } + ], + "name": "unsetContractProxy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_id", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "_controller", + "type": "address" + } + ], + "name": "updateController", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "evm": { + "bytecode": { + "functionDebugData": {}, + "generatedSources": [], + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "deployedBytecode": { + "functionDebugData": {}, + "generatedSources": [], + "immutableReferences": {}, + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "methodIdentifiers": { + "getContractProxy(bytes32)": "f7641a5e", + "getGovernor()": "4fc07d75", + "partialPaused()": "2e292fc7", + "paused()": "5c975abb", + "setContractProxy(bytes32,address)": "e0e99292", + "setPartialPaused(bool)": "56371bd8", + "setPauseGuardian(address)": "48bde20c", + "setPaused(bool)": "16c38b3c", + "unsetContractProxy(bytes32)": "9181df9c", + "updateController(bytes32,address)": "eb5dd94f" + } + }, + "metadata": "{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_id\",\"type\":\"bytes32\"}],\"name\":\"getContractProxy\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getGovernor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"partialPaused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"paused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_id\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"_contractAddress\",\"type\":\"address\"}],\"name\":\"setContractProxy\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"_partialPaused\",\"type\":\"bool\"}],\"name\":\"setPartialPaused\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_newPauseGuardian\",\"type\":\"address\"}],\"name\":\"setPauseGuardian\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"_paused\",\"type\":\"bool\"}],\"name\":\"setPaused\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_id\",\"type\":\"bytes32\"}],\"name\":\"unsetContractProxy\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_id\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"_controller\",\"type\":\"address\"}],\"name\":\"updateController\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@graphprotocol/contracts/contracts/governance/IController.sol\":\"IController\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10},\"remappings\":[]},\"sources\":{\"@graphprotocol/contracts/contracts/governance/IController.sol\":{\"keccak256\":\"0xe37df86cdea385d708ba00862cd9e04940e4f2aa50354fb3a9d2d4f505d5509a\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://0f6c9fd2b7a8c5a6b89ef12c7423144df04a5f251d5480be1b73c74a785ff12a\",\"dweb:/ipfs/QmYpiCQoxbDEYQ2FNA39Z4FGfoxfQ8jvH1Z3ccrqguQFMP\"]}},\"version\":1}" + } + }, + "@graphprotocol/contracts/contracts/l2/curation/IL2Curation.sol": { + "IL2Curation": { + "abi": [ + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_tokensIn", + "type": "uint256" + } + ], + "name": "mintTaxFree", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_subgraphService", + "type": "address" + } + ], + "name": "setSubgraphService", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_tokensIn", + "type": "uint256" + } + ], + "name": "tokensToSignalNoTax", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_tokensIn", + "type": "uint256" + } + ], + "name": "tokensToSignalToTokensNoTax", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "evm": { + "bytecode": { + "functionDebugData": {}, + "generatedSources": [], + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "deployedBytecode": { + "functionDebugData": {}, + "generatedSources": [], + "immutableReferences": {}, + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "methodIdentifiers": { + "mintTaxFree(bytes32,uint256)": "3718896d", + "setSubgraphService(address)": "93a90a1e", + "tokensToSignalNoTax(bytes32,uint256)": "7a2a45b8", + "tokensToSignalToTokensNoTax(bytes32,uint256)": "69db11a1" + } + }, + "metadata": "{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_subgraphDeploymentID\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"_tokensIn\",\"type\":\"uint256\"}],\"name\":\"mintTaxFree\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_subgraphService\",\"type\":\"address\"}],\"name\":\"setSubgraphService\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_subgraphDeploymentID\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"_tokensIn\",\"type\":\"uint256\"}],\"name\":\"tokensToSignalNoTax\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_subgraphDeploymentID\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"_tokensIn\",\"type\":\"uint256\"}],\"name\":\"tokensToSignalToTokensNoTax\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"mintTaxFree(bytes32,uint256)\":{\"details\":\"This function charges no tax and can only be called by GNS in specific scenarios (for now only during an L1-L2 transfer).\",\"params\":{\"_subgraphDeploymentID\":\"Subgraph deployment pool from where to mint signal\",\"_tokensIn\":\"Amount of Graph Tokens to deposit\"},\"returns\":{\"_0\":\"Signal minted\"}},\"setSubgraphService(address)\":{\"params\":{\"_subgraphService\":\"Address of the SubgraphService contract\"}},\"tokensToSignalNoTax(bytes32,uint256)\":{\"params\":{\"_subgraphDeploymentID\":\"Subgraph deployment for which to mint signal\",\"_tokensIn\":\"Amount of tokens used to mint signal\"},\"returns\":{\"_0\":\"Amount of signal that can be bought\"}},\"tokensToSignalToTokensNoTax(bytes32,uint256)\":{\"params\":{\"_subgraphDeploymentID\":\"Subgraph deployment for which to mint signal\",\"_tokensIn\":\"Amount of tokens used to mint signal\"},\"returns\":{\"_0\":\"Amount of tokens that would be recovered after minting and burning signal\"}}},\"title\":\"Interface of the L2 Curation contract.\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"mintTaxFree(bytes32,uint256)\":{\"notice\":\"Deposit Graph Tokens in exchange for signal of a SubgraphDeployment curation pool.\"},\"setSubgraphService(address)\":{\"notice\":\"Set the subgraph service address.\"},\"tokensToSignalNoTax(bytes32,uint256)\":{\"notice\":\"Calculate amount of signal that can be bought with tokens in a curation pool, without accounting for curation tax.\"},\"tokensToSignalToTokensNoTax(bytes32,uint256)\":{\"notice\":\"Calculate the amount of tokens that would be recovered if minting signal with the input tokens and then burning it. This can be used to compute rounding error. This function does not account for curation tax.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@graphprotocol/contracts/contracts/l2/curation/IL2Curation.sol\":\"IL2Curation\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10},\"remappings\":[]},\"sources\":{\"@graphprotocol/contracts/contracts/l2/curation/IL2Curation.sol\":{\"keccak256\":\"0x11ecb2e7e916d69c68d08e85bb29f8c1b051f5c86ca93c54919317f2ce6045cc\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://875f33c94088b76c0b6cf737c48747271f2229da5875cbeb8344d22009ebaf47\",\"dweb:/ipfs/QmaqdDDhcB6F6dDJ3s3nv6kvd2HNE6PWA3g2o9bs9jfPCh\"]}},\"version\":1}" + } + }, + "@graphprotocol/contracts/contracts/l2/discovery/IL2GNS.sol": { + "IL2GNS": { + "abi": [ + { + "inputs": [ + { + "internalType": "uint256", + "name": "_l2SubgraphID", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "_subgraphMetadata", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "_versionMetadata", + "type": "bytes32" + } + ], + "name": "finishSubgraphTransferFromL1", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_l1SubgraphID", + "type": "uint256" + } + ], + "name": "getAliasedL2SubgraphID", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_l2SubgraphID", + "type": "uint256" + } + ], + "name": "getUnaliasedL1SubgraphID", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_from", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "onTokenTransfer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "evm": { + "bytecode": { + "functionDebugData": {}, + "generatedSources": [], + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "deployedBytecode": { + "functionDebugData": {}, + "generatedSources": [], + "immutableReferences": {}, + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "methodIdentifiers": { + "finishSubgraphTransferFromL1(uint256,bytes32,bytes32,bytes32)": "d1a80612", + "getAliasedL2SubgraphID(uint256)": "ea0f2eba", + "getUnaliasedL1SubgraphID(uint256)": "9c6c022b", + "onTokenTransfer(address,uint256,bytes)": "a4c0ed36" + } + }, + "metadata": "{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_l2SubgraphID\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"_subgraphDeploymentID\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"_subgraphMetadata\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"_versionMetadata\",\"type\":\"bytes32\"}],\"name\":\"finishSubgraphTransferFromL1\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_l1SubgraphID\",\"type\":\"uint256\"}],\"name\":\"getAliasedL2SubgraphID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_l2SubgraphID\",\"type\":\"uint256\"}],\"name\":\"getUnaliasedL1SubgraphID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_from\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"onTokenTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"finishSubgraphTransferFromL1(uint256,bytes32,bytes32,bytes32)\":{\"params\":{\"_l2SubgraphID\":\"Subgraph ID in L2 (aliased from the L1 subgraph ID)\",\"_subgraphDeploymentID\":\"Latest subgraph deployment to assign to the subgraph\",\"_subgraphMetadata\":\"IPFS hash of the subgraph metadata\",\"_versionMetadata\":\"IPFS hash of the version metadata\"}},\"getAliasedL2SubgraphID(uint256)\":{\"params\":{\"_l1SubgraphID\":\"L1 subgraph ID\"},\"returns\":{\"_0\":\"L2 subgraph ID\"}},\"getUnaliasedL1SubgraphID(uint256)\":{\"params\":{\"_l2SubgraphID\":\"L2 subgraph ID\"},\"returns\":{\"_0\":\"L1subgraph ID\"}},\"onTokenTransfer(address,uint256,bytes)\":{\"params\":{\"_amount\":\"Amount of tokens that were transferred\",\"_data\":\"ABI-encoded callhook data\",\"_from\":\"Token sender in L1\"}}},\"title\":\"Interface for the L2GNS contract.\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"finishSubgraphTransferFromL1(uint256,bytes32,bytes32,bytes32)\":{\"notice\":\"Finish a subgraph transfer from L1. The subgraph must have been previously sent through the bridge using the sendSubgraphToL2 function on L1GNS.\"},\"getAliasedL2SubgraphID(uint256)\":{\"notice\":\"Return the aliased L2 subgraph ID from a transferred L1 subgraph ID\"},\"getUnaliasedL1SubgraphID(uint256)\":{\"notice\":\"Return the unaliased L1 subgraph ID from a transferred L2 subgraph ID\"},\"onTokenTransfer(address,uint256,bytes)\":{\"notice\":\"Receive tokens with a callhook from the bridge\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@graphprotocol/contracts/contracts/l2/discovery/IL2GNS.sol\":\"IL2GNS\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10},\"remappings\":[]},\"sources\":{\"@graphprotocol/contracts/contracts/gateway/ICallhookReceiver.sol\":{\"keccak256\":\"0x1a1627520f3d9ad670b46b9e8d08a928b892955161915dece233912b30989794\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://a8e3df46e53b8cf46bced72f229497620c2f45169d512855877acdccf9b06d0f\",\"dweb:/ipfs/QmUgTnaZZxquYZQVz1dDoLKiD6AKRy1yUFzVCj3DrXBLQ4\"]},\"@graphprotocol/contracts/contracts/l2/discovery/IL2GNS.sol\":{\"keccak256\":\"0xe546e0aed7d7ceaffd1b6acef7007998a0c03cc6e3742739b7d79f0318417e8a\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://a4ddc12539c90207fe78b33dd29813a60100fca0b8ca023843b30359194a7fb9\",\"dweb:/ipfs/QmQxfiHmaS8HpJuMcvEmPL2HV8VAPGcz7TmVT1sspErNYR\"]}},\"version\":1}" + } + }, + "@graphprotocol/contracts/contracts/rewards/IRewardsIssuer.sol": { + "IRewardsIssuer": { + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "getAllocationData", + "outputs": [ + { + "internalType": "bool", + "name": "isActive", + "type": "bool" + }, + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "accRewardsPerAllocatedToken", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "accRewardsPending", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentId", + "type": "bytes32" + } + ], + "name": "getSubgraphAllocatedTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "evm": { + "bytecode": { + "functionDebugData": {}, + "generatedSources": [], + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "deployedBytecode": { + "functionDebugData": {}, + "generatedSources": [], + "immutableReferences": {}, + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "methodIdentifiers": { + "getAllocationData(address)": "55c85269", + "getSubgraphAllocatedTokens(bytes32)": "e2e1e8e9" + } + }, + "metadata": "{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"allocationId\",\"type\":\"address\"}],\"name\":\"getAllocationData\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"isActive\",\"type\":\"bool\"},{\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"subgraphDeploymentId\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"accRewardsPerAllocatedToken\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"accRewardsPending\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_subgraphDeploymentId\",\"type\":\"bytes32\"}],\"name\":\"getSubgraphAllocatedTokens\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"getAllocationData(address)\":{\"details\":\"Get allocation data to calculate rewards issuance \",\"params\":{\"allocationId\":\"The allocation Id\"},\"returns\":{\"accRewardsPending\":\"Snapshot of accumulated rewards from previous allocation resizing, pending to be claimed\",\"accRewardsPerAllocatedToken\":\"Rewards snapshot\",\"indexer\":\"The indexer address\",\"isActive\":\"Whether the allocation is active or not\",\"subgraphDeploymentId\":\"Subgraph deployment id for the allocation\",\"tokens\":\"Amount of allocated tokens\"}},\"getSubgraphAllocatedTokens(bytes32)\":{\"params\":{\"_subgraphDeploymentId\":\"Deployment Id for the subgraph\"},\"returns\":{\"_0\":\"Total tokens allocated to subgraph\"}}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"getSubgraphAllocatedTokens(bytes32)\":{\"notice\":\"Return the total amount of tokens allocated to subgraph.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@graphprotocol/contracts/contracts/rewards/IRewardsIssuer.sol\":\"IRewardsIssuer\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10},\"remappings\":[]},\"sources\":{\"@graphprotocol/contracts/contracts/rewards/IRewardsIssuer.sol\":{\"keccak256\":\"0xe049090c38a64d80b284ba2a7b440bcedba9804d96f2bb8da525e69ac452e03a\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://8b7d1186bd0698bed02d3504ac80c20e605087fba036d5ff392b39a9a3c818e5\",\"dweb:/ipfs/QmRgAfY1dD5rc7fLuuGVyu2mh9Z8qz1AVvuXAcRGnB3dSv\"]}},\"version\":1}" + } + }, + "@graphprotocol/contracts/contracts/rewards/IRewardsManager.sol": { + "IRewardsManager": { + "abi": [ + { + "inputs": [ + { + "internalType": "uint256", + "name": "_tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_accRewardsPerAllocatedToken", + "type": "uint256" + } + ], + "name": "calcRewards", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + } + ], + "name": "getAccRewardsForSubgraph", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + } + ], + "name": "getAccRewardsPerAllocatedToken", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getAccRewardsPerSignal", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getNewRewardsPerSignal", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_rewardsIssuer", + "type": "address" + }, + { + "internalType": "address", + "name": "_allocationID", + "type": "address" + } + ], + "name": "getRewards", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + } + ], + "name": "isDenied", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + } + ], + "name": "onSubgraphAllocationUpdate", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + } + ], + "name": "onSubgraphSignalUpdate", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentID", + "type": "bytes32" + }, + { + "internalType": "bool", + "name": "_deny", + "type": "bool" + } + ], + "name": "setDenied", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_issuancePerBlock", + "type": "uint256" + } + ], + "name": "setIssuancePerBlock", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_minimumSubgraphSignal", + "type": "uint256" + } + ], + "name": "setMinimumSubgraphSignal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_subgraphAvailabilityOracle", + "type": "address" + } + ], + "name": "setSubgraphAvailabilityOracle", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_subgraphService", + "type": "address" + } + ], + "name": "setSubgraphService", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_allocationID", + "type": "address" + } + ], + "name": "takeRewards", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "updateAccRewardsPerSignal", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "evm": { + "bytecode": { + "functionDebugData": {}, + "generatedSources": [], + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "deployedBytecode": { + "functionDebugData": {}, + "generatedSources": [], + "immutableReferences": {}, + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "methodIdentifiers": { + "calcRewards(uint256,uint256)": "c8a5f81e", + "getAccRewardsForSubgraph(bytes32)": "5c6cbd59", + "getAccRewardsPerAllocatedToken(bytes32)": "702a280e", + "getAccRewardsPerSignal()": "a8cc0ee2", + "getNewRewardsPerSignal()": "e284f848", + "getRewards(address,address)": "779bcb9b", + "isDenied(bytes32)": "e820e284", + "onSubgraphAllocationUpdate(bytes32)": "eeac3e0e", + "onSubgraphSignalUpdate(bytes32)": "1d1c2fec", + "setDenied(bytes32,bool)": "1324a506", + "setIssuancePerBlock(uint256)": "1156bdc1", + "setMinimumSubgraphSignal(uint256)": "4bbfc1c5", + "setSubgraphAvailabilityOracle(address)": "0903c094", + "setSubgraphService(address)": "93a90a1e", + "takeRewards(address)": "db750926", + "updateAccRewardsPerSignal()": "c7d1117d" + } + }, + "metadata": "{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_tokens\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_accRewardsPerAllocatedToken\",\"type\":\"uint256\"}],\"name\":\"calcRewards\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_subgraphDeploymentID\",\"type\":\"bytes32\"}],\"name\":\"getAccRewardsForSubgraph\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_subgraphDeploymentID\",\"type\":\"bytes32\"}],\"name\":\"getAccRewardsPerAllocatedToken\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAccRewardsPerSignal\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getNewRewardsPerSignal\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_rewardsIssuer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_allocationID\",\"type\":\"address\"}],\"name\":\"getRewards\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_subgraphDeploymentID\",\"type\":\"bytes32\"}],\"name\":\"isDenied\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_subgraphDeploymentID\",\"type\":\"bytes32\"}],\"name\":\"onSubgraphAllocationUpdate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_subgraphDeploymentID\",\"type\":\"bytes32\"}],\"name\":\"onSubgraphSignalUpdate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_subgraphDeploymentID\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"_deny\",\"type\":\"bool\"}],\"name\":\"setDenied\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_issuancePerBlock\",\"type\":\"uint256\"}],\"name\":\"setIssuancePerBlock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_minimumSubgraphSignal\",\"type\":\"uint256\"}],\"name\":\"setMinimumSubgraphSignal\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_subgraphAvailabilityOracle\",\"type\":\"address\"}],\"name\":\"setSubgraphAvailabilityOracle\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_subgraphService\",\"type\":\"address\"}],\"name\":\"setSubgraphService\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_allocationID\",\"type\":\"address\"}],\"name\":\"takeRewards\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"updateAccRewardsPerSignal\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@graphprotocol/contracts/contracts/rewards/IRewardsManager.sol\":\"IRewardsManager\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10},\"remappings\":[]},\"sources\":{\"@graphprotocol/contracts/contracts/rewards/IRewardsManager.sol\":{\"keccak256\":\"0xee4b213950c2e46481658b9b04f2d5dae0a96c4cce0ee346188b1f1272718d54\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://b26dd767bd6887666a18beef79c322d27a693a3a4f7a61dc6bded7f35796acf5\",\"dweb:/ipfs/QmXDeqmRSeAWUWQTknNLUPBDBnDr8ySYW4h6CBPRGMJoPp\"]}},\"version\":1}" + } + }, + "@graphprotocol/contracts/contracts/token/IGraphToken.sol": { + "IGraphToken": { + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + } + ], + "name": "addMinter", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_from", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "burnFrom", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + } + ], + "name": "isMinter", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_owner", + "type": "address" + }, + { + "internalType": "address", + "name": "_spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "_v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "_r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "_s", + "type": "bytes32" + } + ], + "name": "permit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + } + ], + "name": "removeMinter", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceMinter", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "evm": { + "bytecode": { + "functionDebugData": {}, + "generatedSources": [], + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "deployedBytecode": { + "functionDebugData": {}, + "generatedSources": [], + "immutableReferences": {}, + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "methodIdentifiers": { + "addMinter(address)": "983b2d56", + "allowance(address,address)": "dd62ed3e", + "approve(address,uint256)": "095ea7b3", + "balanceOf(address)": "70a08231", + "burn(uint256)": "42966c68", + "burnFrom(address,uint256)": "79cc6790", + "decreaseAllowance(address,uint256)": "a457c2d7", + "increaseAllowance(address,uint256)": "39509351", + "isMinter(address)": "aa271e1a", + "mint(address,uint256)": "40c10f19", + "permit(address,address,uint256,uint256,uint8,bytes32,bytes32)": "d505accf", + "removeMinter(address)": "3092afd5", + "renounceMinter()": "98650275", + "totalSupply()": "18160ddd", + "transfer(address,uint256)": "a9059cbb", + "transferFrom(address,address,uint256)": "23b872dd" + } + }, + "metadata": "{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"}],\"name\":\"addMinter\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"burn\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_from\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"burnFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"subtractedValue\",\"type\":\"uint256\"}],\"name\":\"decreaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"addedValue\",\"type\":\"uint256\"}],\"name\":\"increaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"}],\"name\":\"isMinter\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"mint\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"_v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"_r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"_s\",\"type\":\"bytes32\"}],\"name\":\"permit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"}],\"name\":\"removeMinter\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceMinter\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"events\":{\"Approval(address,address,uint256)\":{\"details\":\"Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance.\"},\"Transfer(address,address,uint256)\":{\"details\":\"Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero.\"}},\"kind\":\"dev\",\"methods\":{\"allowance(address,address)\":{\"details\":\"Returns the remaining number of tokens that `spender` will be allowed to spend on behalf of `owner` through {transferFrom}. This is zero by default. This value changes when {approve} or {transferFrom} are called.\"},\"approve(address,uint256)\":{\"details\":\"Sets a `value` amount of tokens as the allowance of `spender` over the caller's tokens. Returns a boolean value indicating whether the operation succeeded. IMPORTANT: Beware that changing an allowance with this method brings the risk that someone may use both the old and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 Emits an {Approval} event.\"},\"balanceOf(address)\":{\"details\":\"Returns the value of tokens owned by `account`.\"},\"totalSupply()\":{\"details\":\"Returns the value of tokens in existence.\"},\"transfer(address,uint256)\":{\"details\":\"Moves a `value` amount of tokens from the caller's account to `to`. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event.\"},\"transferFrom(address,address,uint256)\":{\"details\":\"Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism. `value` is then deducted from the caller's allowance. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@graphprotocol/contracts/contracts/token/IGraphToken.sol\":\"IGraphToken\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10},\"remappings\":[]},\"sources\":{\"@graphprotocol/contracts/contracts/token/IGraphToken.sol\":{\"keccak256\":\"0x2ffad6798d641c8d1288730be725c43041c803caceaf6d9985122d000ad5761c\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://5f782a5670037fc9223dc20fd4f99c0277a9bec7d08f7800b0a0733e819a07cb\",\"dweb:/ipfs/QmP3K2QnmukScCh1nzgphYdg7AiAuTaT914jq4txLYNpra\"]},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0xe06a3f08a987af6ad2e1c1e774405d4fe08f1694b67517438b467cecf0da0ef7\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://df6f0c459663c9858b6cba2cda1d14a7d05a985bed6d2de72bd8e78c25ee79db\",\"dweb:/ipfs/QmeTTxZ7qVk9rjEv2R4CpCwdf8UMCcRqDNMvzNxHc3Fnn9\"]}},\"version\":1}" + } + }, + "@graphprotocol/contracts/contracts/utils/TokenUtils.sol": { + "TokenUtils": { + "abi": [], + "evm": { + "bytecode": { + "functionDebugData": {}, + "generatedSources": [], + "linkReferences": {}, + "object": "60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220542683f1c09a402c1717c86ca1ed67c4d870e4a9ea5201b1e94892aa7bfc0a4b64736f6c634300081b0033", + "opcodes": "PUSH1 0x56 PUSH1 0x37 PUSH1 0xB DUP3 DUP3 DUP3 CODECOPY DUP1 MLOAD PUSH1 0x0 BYTE PUSH1 0x73 EQ PUSH1 0x2A JUMPI PUSH4 0x4E487B71 PUSH1 0xE0 SHL PUSH1 0x0 MSTORE PUSH1 0x0 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST ADDRESS PUSH1 0x0 MSTORE PUSH1 0x73 DUP2 MSTORE8 DUP3 DUP2 RETURN INVALID PUSH20 0x0 ADDRESS EQ PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 SLOAD 0x26 DUP4 CALL 0xC0 SWAP11 BLOCKHASH 0x2C OR OR 0xC8 PUSH13 0xA1ED67C4D870E4A9EA5201B1E9 BASEFEE SWAP3 0xAA PUSH28 0xFC0A4B64736F6C634300081B00330000000000000000000000000000 ", + "sourceMap": "357:1203:11:-:0;;;;;;;;;;;;;;;-1:-1:-1;;;357:1203:11;;;;;;;;;;;;;;;;;" + }, + "deployedBytecode": { + "functionDebugData": {}, + "generatedSources": [], + "immutableReferences": {}, + "linkReferences": {}, + "object": "73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220542683f1c09a402c1717c86ca1ed67c4d870e4a9ea5201b1e94892aa7bfc0a4b64736f6c634300081b0033", + "opcodes": "PUSH20 0x0 ADDRESS EQ PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 SLOAD 0x26 DUP4 CALL 0xC0 SWAP11 BLOCKHASH 0x2C OR OR 0xC8 PUSH13 0xA1ED67C4D870E4A9EA5201B1E9 BASEFEE SWAP3 0xAA PUSH28 0xFC0A4B64736F6C634300081B00330000000000000000000000000000 ", + "sourceMap": "357:1203:11:-:0;;;;;;;;" + }, + "methodIdentifiers": {} + }, + "metadata": "{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"title\":\"TokenUtils library\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"notice\":\"This library contains utility functions for handling tokens (transfers and burns). It is specifically adapted for the GraphToken, so does not need to handle edge cases for other tokens.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"@graphprotocol/contracts/contracts/utils/TokenUtils.sol\":\"TokenUtils\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10},\"remappings\":[]},\"sources\":{\"@graphprotocol/contracts/contracts/token/IGraphToken.sol\":{\"keccak256\":\"0x2ffad6798d641c8d1288730be725c43041c803caceaf6d9985122d000ad5761c\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://5f782a5670037fc9223dc20fd4f99c0277a9bec7d08f7800b0a0733e819a07cb\",\"dweb:/ipfs/QmP3K2QnmukScCh1nzgphYdg7AiAuTaT914jq4txLYNpra\"]},\"@graphprotocol/contracts/contracts/utils/TokenUtils.sol\":{\"keccak256\":\"0x7bd336193785ed6f09a3bd847f9208f64aa9b87ad67c40838d00fec41bb153d5\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://d96d83cdb9bbb567e4eafac8bdef3ff6bdaf426338baf76bae277c11afb33cee\",\"dweb:/ipfs/QmNjr4PiJ76Wc5mFqa9H88BjsEMrUfy1jiftNHYTgd6Mp5\"]},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0xe06a3f08a987af6ad2e1c1e774405d4fe08f1694b67517438b467cecf0da0ef7\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://df6f0c459663c9858b6cba2cda1d14a7d05a985bed6d2de72bd8e78c25ee79db\",\"dweb:/ipfs/QmeTTxZ7qVk9rjEv2R4CpCwdf8UMCcRqDNMvzNxHc3Fnn9\"]}},\"version\":1}" + } + }, + "@graphprotocol/horizon/contracts/data-service/DataService.sol": { + "DataService": { + "abi": [ + { + "inputs": [ + { + "internalType": "bytes", + "name": "contractName", + "type": "bytes" + } + ], + "name": "GraphDirectoryInvalidZeroAddress", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidInitialization", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "name": "ProvisionManagerInvalidRange", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "message", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "name": "ProvisionManagerInvalidValue", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "ProvisionManagerNotAuthorized", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + } + ], + "name": "ProvisionManagerProvisionNotFound", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "ratio", + "type": "uint32" + } + ], + "name": "DelegationRatioSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "graphToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "graphStaking", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphPayments", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphEscrow", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "graphController", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphEpochManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphRewardsManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphTokenGateway", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphProxyAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphCuration", + "type": "address" + } + ], + "name": "GraphDirectoryInitialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + } + ], + "name": "ProvisionPendingParametersAccepted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "name": "ProvisionTokensRangeSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "feeType", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "ServicePaymentCollected", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "ServiceProviderRegistered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "ServiceProviderSlashed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "ServiceStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "ServiceStopped", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "min", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "max", + "type": "uint64" + } + ], + "name": "ThawingPeriodRangeSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "min", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "max", + "type": "uint32" + } + ], + "name": "VerifierCutRangeSet", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "acceptProvisionPendingParameters", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "feeType", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "collect", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getDelegationRatio", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getProvisionTokensRange", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getThawingPeriodRange", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getVerifierCutRange", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "register", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "slash", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "startService", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "stopService", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "evm": { + "bytecode": { + "functionDebugData": {}, + "generatedSources": [], + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "deployedBytecode": { + "functionDebugData": {}, + "generatedSources": [], + "immutableReferences": {}, + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "methodIdentifiers": { + "acceptProvisionPendingParameters(address,bytes)": "ce0fc0cc", + "collect(address,uint8,bytes)": "b15d2a2c", + "getDelegationRatio()": "1ebb7c30", + "getProvisionTokensRange()": "819ba366", + "getThawingPeriodRange()": "71ce020a", + "getVerifierCutRange()": "482468b7", + "register(address,bytes)": "24b8fbf6", + "slash(address,bytes)": "cb8347fe", + "startService(address,bytes)": "dedf6726", + "stopService(address,bytes)": "8180083b" + } + }, + "metadata": "{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"contractName\",\"type\":\"bytes\"}],\"name\":\"GraphDirectoryInvalidZeroAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidInitialization\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotInitializing\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"max\",\"type\":\"uint256\"}],\"name\":\"ProvisionManagerInvalidRange\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"max\",\"type\":\"uint256\"}],\"name\":\"ProvisionManagerInvalidValue\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"ProvisionManagerNotAuthorized\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"}],\"name\":\"ProvisionManagerProvisionNotFound\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"ratio\",\"type\":\"uint32\"}],\"name\":\"DelegationRatioSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"graphToken\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"graphStaking\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"graphPayments\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"graphEscrow\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"graphController\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"graphEpochManager\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"graphRewardsManager\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"graphTokenGateway\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"graphProxyAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"graphCuration\",\"type\":\"address\"}],\"name\":\"GraphDirectoryInitialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"version\",\"type\":\"uint64\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"}],\"name\":\"ProvisionPendingParametersAccepted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"min\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"max\",\"type\":\"uint256\"}],\"name\":\"ProvisionTokensRangeSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"enum IGraphPayments.PaymentTypes\",\"name\":\"feeType\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"ServicePaymentCollected\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"ServiceProviderRegistered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"ServiceProviderSlashed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"ServiceStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"ServiceStopped\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"min\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"max\",\"type\":\"uint64\"}],\"name\":\"ThawingPeriodRangeSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"min\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"max\",\"type\":\"uint32\"}],\"name\":\"VerifierCutRangeSet\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"acceptProvisionPendingParameters\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"enum IGraphPayments.PaymentTypes\",\"name\":\"feeType\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"collect\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getDelegationRatio\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getProvisionTokensRange\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getThawingPeriodRange\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getVerifierCutRange\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"register\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"slash\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"startService\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"stopService\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"custom:security-contact\":\"Please email security+contracts@thegraph.com if you find any bugs. We may have an active bug bounty program.\",\"details\":\"Implementation of the {IDataService} interface.A note on upgradeability: this base contract can be inherited by upgradeable or non upgradeable contracts. - If the data service implementation is upgradeable, it must initialize the contract via an external initializer function with the `initializer` modifier that calls {__DataService_init} or {__DataService_init_unchained}. It's recommended the implementation constructor to also call {_disableInitializers} to prevent the implementation from being initialized. - If the data service implementation is NOT upgradeable, it must initialize the contract by calling {__DataService_init} or {__DataService_init_unchained} in the constructor. Note that the `initializer` will be required in the constructor. - Note that in both cases if using {__DataService_init_unchained} variant the corresponding parent initializers must be called in the implementation.\",\"errors\":{\"GraphDirectoryInvalidZeroAddress(bytes)\":[{\"params\":{\"contractName\":\"The name of the contract that was not found, or the controller\"}}],\"InvalidInitialization()\":[{\"details\":\"The contract is already initialized.\"}],\"NotInitializing()\":[{\"details\":\"The contract is not initializing.\"}],\"ProvisionManagerInvalidRange(uint256,uint256)\":[{\"params\":{\"max\":\"The maximum value.\",\"min\":\"The minimum value.\"}}],\"ProvisionManagerInvalidValue(bytes,uint256,uint256,uint256)\":[{\"params\":{\"max\":\"The maximum allowed value.\",\"message\":\"The error message.\",\"min\":\"The minimum allowed value.\",\"value\":\"The value that is out of range.\"}}],\"ProvisionManagerNotAuthorized(address,address)\":[{\"params\":{\"caller\":\"The address of the caller.\",\"serviceProvider\":\"The address of the serviceProvider.\"}}],\"ProvisionManagerProvisionNotFound(address)\":[{\"params\":{\"serviceProvider\":\"The address of the service provider.\"}}]},\"events\":{\"DelegationRatioSet(uint32)\":{\"params\":{\"ratio\":\"The delegation ratio\"}},\"GraphDirectoryInitialized(address,address,address,address,address,address,address,address,address,address)\":{\"params\":{\"graphController\":\"The Graph Controller contract address\",\"graphCuration\":\"The Curation contract address\",\"graphEpochManager\":\"The Epoch Manager contract address\",\"graphEscrow\":\"The Payments Escrow contract address\",\"graphPayments\":\"The Graph Payments contract address\",\"graphProxyAdmin\":\"The Graph Proxy Admin contract address\",\"graphRewardsManager\":\"The Rewards Manager contract address\",\"graphStaking\":\"The Horizon Staking contract address\",\"graphToken\":\"The Graph Token contract address\",\"graphTokenGateway\":\"The Token Gateway contract address\"}},\"Initialized(uint64)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"},\"ProvisionPendingParametersAccepted(address)\":{\"params\":{\"serviceProvider\":\"The address of the service provider.\"}},\"ProvisionTokensRangeSet(uint256,uint256)\":{\"params\":{\"max\":\"The maximum allowed value for the provision tokens.\",\"min\":\"The minimum allowed value for the provision tokens.\"}},\"ServicePaymentCollected(address,uint8,uint256)\":{\"params\":{\"feeType\":\"The type of fee to collect as defined in {GraphPayments}.\",\"serviceProvider\":\"The address of the service provider.\",\"tokens\":\"The amount of tokens collected.\"}},\"ServiceProviderRegistered(address,bytes)\":{\"params\":{\"data\":\"Custom data, usage defined by the data service.\",\"serviceProvider\":\"The address of the service provider.\"}},\"ServiceProviderSlashed(address,uint256)\":{\"params\":{\"serviceProvider\":\"The address of the service provider.\",\"tokens\":\"The amount of tokens slashed.\"}},\"ServiceStarted(address,bytes)\":{\"params\":{\"data\":\"Custom data, usage defined by the data service.\",\"serviceProvider\":\"The address of the service provider.\"}},\"ServiceStopped(address,bytes)\":{\"params\":{\"data\":\"Custom data, usage defined by the data service.\",\"serviceProvider\":\"The address of the service provider.\"}},\"ThawingPeriodRangeSet(uint64,uint64)\":{\"params\":{\"max\":\"The maximum allowed value for the thawing period.\",\"min\":\"The minimum allowed value for the thawing period.\"}},\"VerifierCutRangeSet(uint32,uint32)\":{\"params\":{\"max\":\"The maximum allowed value for the max verifier cut.\",\"min\":\"The minimum allowed value for the max verifier cut.\"}}},\"kind\":\"dev\",\"methods\":{\"acceptProvisionPendingParameters(address,bytes)\":{\"details\":\"Provides a way for the data service to validate and accept provision parameter changes. Call {_acceptProvision}. Emits a {ProvisionPendingParametersAccepted} event.\",\"params\":{\"data\":\"Custom data, usage defined by the data service.\",\"serviceProvider\":\"The address of the service provider.\"}},\"collect(address,uint8,bytes)\":{\"details\":\"The implementation of this function is expected to interact with {GraphPayments} to collect payment from the service payer, which is done via {IGraphPayments-collect}. Emits a {ServicePaymentCollected} event. NOTE: Data services that are vetted by the Graph Council might qualify for a portion of protocol issuance to cover for these payments. In this case, the funds are taken by interacting with the rewards manager contract instead of the {GraphPayments} contract.\",\"params\":{\"data\":\"Custom data, usage defined by the data service.\",\"feeType\":\"The type of fee to collect as defined in {GraphPayments}.\",\"serviceProvider\":\"The address of the service provider.\"},\"returns\":{\"_0\":\"The amount of tokens collected.\"}},\"constructor\":{\"details\":\"Addresses in GraphDirectory are immutables, they can only be set in this constructor.\",\"params\":{\"controller\":\"The address of the Graph Horizon controller contract.\"}},\"getDelegationRatio()\":{\"returns\":{\"_0\":\"The delegation ratio\"}},\"getProvisionTokensRange()\":{\"returns\":{\"_0\":\"Minimum provision tokens allowed\",\"_1\":\"Maximum provision tokens allowed\"}},\"getThawingPeriodRange()\":{\"returns\":{\"_0\":\"Minimum thawing period allowed\",\"_1\":\"Maximum thawing period allowed\"}},\"getVerifierCutRange()\":{\"returns\":{\"_0\":\"Minimum verifier cut allowed\",\"_1\":\"Maximum verifier cut allowed\"}},\"register(address,bytes)\":{\"details\":\"Before registering, the service provider must have created a provision in the Graph Horizon staking contract with parameters that are compatible with the data service. Verifies provision parameters and rejects registration in the event they are not valid. Emits a {ServiceProviderRegistered} event. NOTE: Failing to accept the provision will result in the service provider operating on an unverified provision. Depending on of the data service this can be a security risk as the protocol won't be able to guarantee economic security for the consumer.\",\"params\":{\"data\":\"Custom data, usage defined by the data service.\",\"serviceProvider\":\"The address of the service provider.\"}},\"slash(address,bytes)\":{\"details\":\"To slash the service provider's provision the function should call {Staking-slash}. Emits a {ServiceProviderSlashed} event.\",\"params\":{\"data\":\"Custom data, usage defined by the data service.\",\"serviceProvider\":\"The address of the service provider.\"}},\"startService(address,bytes)\":{\"details\":\"Emits a {ServiceStarted} event.\",\"params\":{\"data\":\"Custom data, usage defined by the data service.\",\"serviceProvider\":\"The address of the service provider.\"}},\"stopService(address,bytes)\":{\"details\":\"Emits a {ServiceStopped} event.\",\"params\":{\"data\":\"Custom data, usage defined by the data service.\",\"serviceProvider\":\"The address of the service provider.\"}}},\"title\":\"DataService contract\",\"version\":1},\"userdoc\":{\"errors\":{\"GraphDirectoryInvalidZeroAddress(bytes)\":[{\"notice\":\"Thrown when either the controller is the zero address or a contract address is not found on the controller\"}],\"ProvisionManagerInvalidRange(uint256,uint256)\":[{\"notice\":\"Thrown when attempting to set a range where min is greater than max.\"}],\"ProvisionManagerInvalidValue(bytes,uint256,uint256,uint256)\":[{\"notice\":\"Thrown when a provision parameter is out of range.\"}],\"ProvisionManagerNotAuthorized(address,address)\":[{\"notice\":\"Thrown when the caller is not authorized to manage the provision of a service provider.\"}],\"ProvisionManagerProvisionNotFound(address)\":[{\"notice\":\"Thrown when a provision is not found.\"}]},\"events\":{\"DelegationRatioSet(uint32)\":{\"notice\":\"Emitted when the delegation ratio is set.\"},\"GraphDirectoryInitialized(address,address,address,address,address,address,address,address,address,address)\":{\"notice\":\"Emitted when the GraphDirectory is initialized\"},\"ProvisionPendingParametersAccepted(address)\":{\"notice\":\"Emitted when a service provider accepts a provision in {Graph Horizon staking contract}.\"},\"ProvisionTokensRangeSet(uint256,uint256)\":{\"notice\":\"Emitted when the provision tokens range is set.\"},\"ServicePaymentCollected(address,uint8,uint256)\":{\"notice\":\"Emitted when a service provider collects payment.\"},\"ServiceProviderRegistered(address,bytes)\":{\"notice\":\"Emitted when a service provider is registered with the data service.\"},\"ServiceProviderSlashed(address,uint256)\":{\"notice\":\"Emitted when a service provider is slashed.\"},\"ServiceStarted(address,bytes)\":{\"notice\":\"Emitted when a service provider starts providing the service.\"},\"ServiceStopped(address,bytes)\":{\"notice\":\"Emitted when a service provider stops providing the service.\"},\"ThawingPeriodRangeSet(uint64,uint64)\":{\"notice\":\"Emitted when the thawing period range is set.\"},\"VerifierCutRangeSet(uint32,uint32)\":{\"notice\":\"Emitted when the verifier cut range is set.\"}},\"kind\":\"user\",\"methods\":{\"acceptProvisionPendingParameters(address,bytes)\":{\"notice\":\"Accepts pending parameters in the provision of a service provider in the {Graph Horizon staking contract}.\"},\"collect(address,uint8,bytes)\":{\"notice\":\"Collects payment earnt by the service provider.\"},\"getDelegationRatio()\":{\"notice\":\"External getter for the delegation ratio\"},\"getProvisionTokensRange()\":{\"notice\":\"External getter for the provision tokens range\"},\"getThawingPeriodRange()\":{\"notice\":\"External getter for the thawing period range\"},\"getVerifierCutRange()\":{\"notice\":\"External getter for the verifier cut range\"},\"register(address,bytes)\":{\"notice\":\"Registers a service provider with the data service. The service provider can now start providing the service.\"},\"slash(address,bytes)\":{\"notice\":\"Slash a service provider for misbehaviour.\"},\"startService(address,bytes)\":{\"notice\":\"Service provider starts providing the service.\"},\"stopService(address,bytes)\":{\"notice\":\"Service provider stops providing the service.\"}},\"notice\":\"This implementation provides base functionality for a data service: - GraphDirectory, allows the data service to interact with Graph Horizon contracts - ProvisionManager, provides functionality to manage provisions The derived contract MUST implement all the interfaces described in {IDataService} and in accordance with the Data Service framework.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"@graphprotocol/horizon/contracts/data-service/DataService.sol\":\"DataService\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10},\"remappings\":[]},\"sources\":{\"@graphprotocol/contracts/contracts/arbitrum/ITokenGateway.sol\":{\"keccak256\":\"0x3cbcc6e4629543a99acacc7ee4ffa6c063b9fb17d3597ccd2f9481008e3633bd\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://d6bb0bb830b67d579e57a261e5f5d9e90b32dc006b02badbecf1f6c82c0a5100\",\"dweb:/ipfs/Qmd38iNXZpinwbNRJPEAA8r9bmmtRwjTSK1SkmH47ge4kJ\"]},\"@graphprotocol/contracts/contracts/curation/ICuration.sol\":{\"keccak256\":\"0x17e4db429003cab08cd2859db94b95e0cee1f9478c1881903a4104def8fdc048\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://52ed58228a0e92aeb3493473a6e02f92d26a4e4eb0c46d38dd446e3bfcb6691e\",\"dweb:/ipfs/QmZzWxHAztdz2Q7cobqVEf4ExGpNuqWJFYgs2oHCgApjW6\"]},\"@graphprotocol/contracts/contracts/epochs/IEpochManager.sol\":{\"keccak256\":\"0x0f4b3a3569c023d2610d0d8b37b3ecb0b67f848d77aa063bb311756670017e85\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://df7c43568e554b301134aa2c58e4889ad0d3dcfec40e834b63621a43f39da154\",\"dweb:/ipfs/QmZeSV9AM6FKCkH9QYyF7i5nVggseEJXbvWbtrgUeXqQpo\"]},\"@graphprotocol/contracts/contracts/governance/IController.sol\":{\"keccak256\":\"0xe37df86cdea385d708ba00862cd9e04940e4f2aa50354fb3a9d2d4f505d5509a\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://0f6c9fd2b7a8c5a6b89ef12c7423144df04a5f251d5480be1b73c74a785ff12a\",\"dweb:/ipfs/QmYpiCQoxbDEYQ2FNA39Z4FGfoxfQ8jvH1Z3ccrqguQFMP\"]},\"@graphprotocol/contracts/contracts/rewards/IRewardsIssuer.sol\":{\"keccak256\":\"0xe049090c38a64d80b284ba2a7b440bcedba9804d96f2bb8da525e69ac452e03a\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://8b7d1186bd0698bed02d3504ac80c20e605087fba036d5ff392b39a9a3c818e5\",\"dweb:/ipfs/QmRgAfY1dD5rc7fLuuGVyu2mh9Z8qz1AVvuXAcRGnB3dSv\"]},\"@graphprotocol/contracts/contracts/rewards/IRewardsManager.sol\":{\"keccak256\":\"0xee4b213950c2e46481658b9b04f2d5dae0a96c4cce0ee346188b1f1272718d54\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://b26dd767bd6887666a18beef79c322d27a693a3a4f7a61dc6bded7f35796acf5\",\"dweb:/ipfs/QmXDeqmRSeAWUWQTknNLUPBDBnDr8ySYW4h6CBPRGMJoPp\"]},\"@graphprotocol/contracts/contracts/token/IGraphToken.sol\":{\"keccak256\":\"0x2ffad6798d641c8d1288730be725c43041c803caceaf6d9985122d000ad5761c\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://5f782a5670037fc9223dc20fd4f99c0277a9bec7d08f7800b0a0733e819a07cb\",\"dweb:/ipfs/QmP3K2QnmukScCh1nzgphYdg7AiAuTaT914jq4txLYNpra\"]},\"@graphprotocol/horizon/contracts/data-service/DataService.sol\":{\"keccak256\":\"0xa57fda8ea4c94a2cda061a6c8f29ae215241b0af03a43df3bc622051d8b2493c\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://7fc433ef0eb71c264224e9058de7e9aea3b2dbfab68dbdf0df8a13de82e90ef6\",\"dweb:/ipfs/QmVrp6kv8Ef1AP38C4soa1cnnRqqmKFnHer2VrXms52Asy\"]},\"@graphprotocol/horizon/contracts/data-service/DataServiceStorage.sol\":{\"keccak256\":\"0x615aac9d5c9cd04216fa9ee21c770f3877a2971a1c023052143c95c08b87610f\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://bd4eb031e9ab86e3a17df29fcb297621e88850c3c5db123925d24b77c802b037\",\"dweb:/ipfs/QmSCNfQqMzui9gaN3Rf8nTNJBPWSFNqFgexbK2k6GBN381\"]},\"@graphprotocol/horizon/contracts/data-service/interfaces/IDataService.sol\":{\"keccak256\":\"0x2208814f64eeca9409eafc1a1fa425c67ff38cffdffc3af0bafbe1c1b338ed32\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://925b32efbd9fe85a98f8f1f51e865e0b7b65d933196cf6c098bd670da7138e0c\",\"dweb:/ipfs/Qmdrp7BGJ4fEKzDgZpVY1FULXKsHAdGXkx4nqRrWvMaumr\"]},\"@graphprotocol/horizon/contracts/data-service/utilities/ProvisionManager.sol\":{\"keccak256\":\"0x63e7f1df10586beb7f8683065719fbff045437508539a9358c25a13fcf989f91\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://b32f9a7be91ae6d9c9a6edbe2404efbcf9fa99c1d503f4a688054be468494a8e\",\"dweb:/ipfs/QmQ5AQXsBPxtJSW24LqRZAaYYaz1518FpUCHfDEdsMfF8F\"]},\"@graphprotocol/horizon/contracts/data-service/utilities/ProvisionManagerStorage.sol\":{\"keccak256\":\"0xe44f72a63c472a6de42e08a2d732044fe1ac9245c4203d4e1eb941b1a2fa2159\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://412708a4f94b5757e46676c5702e47d37fdbdacbe53f70e2ee93d37c5938e028\",\"dweb:/ipfs/Qmdw4uagDdKeCzyS319BKyPzfnWCvM3KCtNYosFBd3xGco\"]},\"@graphprotocol/horizon/contracts/interfaces/IGraphPayments.sol\":{\"keccak256\":\"0xa22dcc47676073113e4ebe30045065662cee5531f9c5f75776c00e70a1929c81\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://8908f30b3c7536798b14dc62fb5ccffc05570d568dbd1bade7c79c1fd2a4b5fe\",\"dweb:/ipfs/QmexZgb5mhDmXVZnYX1Z37cwM7EG2prYyBEVjUSVdKshVr\"]},\"@graphprotocol/horizon/contracts/interfaces/IGraphProxyAdmin.sol\":{\"keccak256\":\"0x4410253d7de56d2cdff50ee141c52fd77fd23f3984440211c3cc90ad560f4f9d\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://da4425a908816c40ffc3c833504843c3732bcb47e745dc544f650e5bc2c23f25\",\"dweb:/ipfs/QmZYDS4cSKBqRXEU3qyjE6sxGModSeNgzQmdZmZCGHuaKt\"]},\"@graphprotocol/horizon/contracts/interfaces/IHorizonStaking.sol\":{\"keccak256\":\"0x4b146f30ee66c4224cb5a82bafc8299f8596d8fe302e793757520f67bba8a166\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://30666c737d72a850223c1966d3b5d02b84f3f808f3c8dae8d0748731646b60c5\",\"dweb:/ipfs/QmQschyZQtU8tTnQ9hNiG5nobuXBx6KeiKdfxvZ4zvQ7ty\"]},\"@graphprotocol/horizon/contracts/interfaces/IPaymentsEscrow.sol\":{\"keccak256\":\"0x99e2a676b539e7b6c223a551f8cb9770c07435a25c8b22f0044a8ce4949edadc\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://f702a3cea214d8328d89a0ef16495c709e30fe13eb86fc29940159c9cb8c7bd5\",\"dweb:/ipfs/QmS25Zgcw85kDZcicApLzRmDcoYNQafpFdMyBEWX8eLWSX\"]},\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingBase.sol\":{\"keccak256\":\"0x9bdab6cb595eabd7d321d7beae03ad3607995c14ef40f0c2f349fb72084766c5\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://6cac2ca3580bd770b98b07b11ebb007e8a922a90cde920e6ec472df7e66fb512\",\"dweb:/ipfs/QmRw1rjT8D8gNp2GRTuwDETwHNHMpHKoHZq4pYBAn9i65F\"]},\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingExtension.sol\":{\"keccak256\":\"0x7923f39746198b5672f0e4d65b7bf14903ae5f7775d74b210effb957eea36c71\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://c29531aff69c71e649fb347d7117ea8c42fc8de09860a1c389ed9b8f097a34e0\",\"dweb:/ipfs/QmS89fww584HiyE1BdPe8Xaqbf5v7FEvL38GTxeHEAsLFm\"]},\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingMain.sol\":{\"keccak256\":\"0xd04bb1f6a427e858e8a625b4b9835c69c8891a324d22beba20293ab2a77e5de7\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://05c9e425eee0b6c109a8dad2edcf9e1c845c64fccf321edf804921394ee048be\",\"dweb:/ipfs/QmbwLWNof534oG5ohzNAWrjdQ5kqJs7M5d5kCRd68XUogB\"]},\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingTypes.sol\":{\"keccak256\":\"0xaaeb9770f8aaae6b395e87bb1876a10fe7c14384d16d97dd33a671c3ea53aa7b\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://8f5c019fdb2df73bafe464fb6e9da792f7833a0c1858734bcd6a6b8d6ae924c7\",\"dweb:/ipfs/QmcubeYTHCYBqQsRncBFpPFtk7JzRz4nFh27LUW1m4hx2K\"]},\"@graphprotocol/horizon/contracts/libraries/LinkedList.sol\":{\"keccak256\":\"0x99058b4da0428b8d9c22d3d112acbaa59900f1fd0a434038b1a4fccfe3c678d6\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://568e03231c6081eacbcb6585a05c0b1bb976b640b611f7bf6155f9b58d887239\",\"dweb:/ipfs/QmdPZQWhkhjf5TUwz487Dwm4ycjX323iNdwb1sQnAiA1Qu\"]},\"@graphprotocol/horizon/contracts/libraries/PPMMath.sol\":{\"keccak256\":\"0xe7fcfd44d2919944b79a11a39da7d4539d49c4bcf510071a59f6b41c37ee8ef2\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://a21b1ff7ca81fa07f153b60aeca136bd1ee57d9d01a2c76635e4a5602e8959fc\",\"dweb:/ipfs/QmQ5C7mUjt4sv1NBt1FH5XVHN3aBsHnvDsdJKWywhLjso8\"]},\"@graphprotocol/horizon/contracts/libraries/UintRange.sol\":{\"keccak256\":\"0x70d69069b2c122becd29ec4ea9a79f2e26cf7cbe7b1918ffced691ee00cdbd82\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://6bddc7d257c3df1fd4940dd3c554e5a1efbc1b23d50f7878415389b75380628c\",\"dweb:/ipfs/QmTQBCsL4pHoXMixVvDwGMdmJnGfEeeDZfHdJkcpKamu58\"]},\"@graphprotocol/horizon/contracts/utilities/GraphDirectory.sol\":{\"keccak256\":\"0x1d09be2f7454873ab80f86ed5d590b9e796fe5146977c4c4a5b1f7ead17eb522\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://e1c7539d26f069c2acabd404601e7811f8878f66976e8b5d4f5438195de793c2\",\"dweb:/ipfs/QmUAybvtDZ275kAnU6r81aQy1FCp7zLscSV87oe9nbwjyU\"]},\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"keccak256\":\"0xdb4d24ee2c087c391d587cd17adfe5b3f9d93b3110b1388c2ab6c7c0ad1dcd05\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://ab7b6d5b9e2b88176312967fe0f0e78f3d9a1422fa5e4b64e2440c35869b5d08\",\"dweb:/ipfs/QmXKYWWyzcLg1B2k7Sb1qkEXgLCYfXecR9wYW5obRzWP1Q\"]},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0xe06a3f08a987af6ad2e1c1e774405d4fe08f1694b67517438b467cecf0da0ef7\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://df6f0c459663c9858b6cba2cda1d14a7d05a985bed6d2de72bd8e78c25ee79db\",\"dweb:/ipfs/QmeTTxZ7qVk9rjEv2R4CpCwdf8UMCcRqDNMvzNxHc3Fnn9\"]}},\"version\":1}" + } + }, + "@graphprotocol/horizon/contracts/data-service/DataServiceStorage.sol": { + "DataServiceV1Storage": { + "abi": [], + "evm": { + "bytecode": { + "functionDebugData": {}, + "generatedSources": [], + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "deployedBytecode": { + "functionDebugData": {}, + "generatedSources": [], + "immutableReferences": {}, + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "methodIdentifiers": {} + }, + "metadata": "{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"custom:security-contact\":\"Please email security+contracts@thegraph.com if you find any bugs. We may have an active bug bounty program.\",\"details\":\"This contract holds the storage variables for the DataService contract.\",\"kind\":\"dev\",\"methods\":{},\"stateVariables\":{\"__gap\":{\"details\":\"Gap to allow adding variables in future upgrades Note that this contract is not upgradeable but might be inherited by an upgradeable contract\"}},\"title\":\"DataServiceStorage\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@graphprotocol/horizon/contracts/data-service/DataServiceStorage.sol\":\"DataServiceV1Storage\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10},\"remappings\":[]},\"sources\":{\"@graphprotocol/horizon/contracts/data-service/DataServiceStorage.sol\":{\"keccak256\":\"0x615aac9d5c9cd04216fa9ee21c770f3877a2971a1c023052143c95c08b87610f\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://bd4eb031e9ab86e3a17df29fcb297621e88850c3c5db123925d24b77c802b037\",\"dweb:/ipfs/QmSCNfQqMzui9gaN3Rf8nTNJBPWSFNqFgexbK2k6GBN381\"]}},\"version\":1}" + } + }, + "@graphprotocol/horizon/contracts/data-service/extensions/DataServiceFees.sol": { + "DataServiceFees": { + "abi": [ + { + "inputs": [ + { + "internalType": "bytes32", + "name": "claimId", + "type": "bytes32" + } + ], + "name": "DataServiceFeesClaimNotFound", + "type": "error" + }, + { + "inputs": [], + "name": "DataServiceFeesZeroTokens", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "contractName", + "type": "bytes" + } + ], + "name": "GraphDirectoryInvalidZeroAddress", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidInitialization", + "type": "error" + }, + { + "inputs": [], + "name": "LinkedListEmptyList", + "type": "error" + }, + { + "inputs": [], + "name": "LinkedListInvalidIterations", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "name": "ProvisionManagerInvalidRange", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "message", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "name": "ProvisionManagerInvalidValue", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "ProvisionManagerNotAuthorized", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + } + ], + "name": "ProvisionManagerProvisionNotFound", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokensAvailable", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokensRequired", + "type": "uint256" + } + ], + "name": "ProvisionTrackerInsufficientTokens", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "ratio", + "type": "uint32" + } + ], + "name": "DelegationRatioSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "graphToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "graphStaking", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphPayments", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphEscrow", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "graphController", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphEpochManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphRewardsManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphTokenGateway", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphProxyAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphCuration", + "type": "address" + } + ], + "name": "GraphDirectoryInitialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + } + ], + "name": "ProvisionPendingParametersAccepted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "name": "ProvisionTokensRangeSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "feeType", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "ServicePaymentCollected", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "ServiceProviderRegistered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "ServiceProviderSlashed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "ServiceStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "ServiceStopped", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "claimId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "unlockTimestamp", + "type": "uint256" + } + ], + "name": "StakeClaimLocked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "claimId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "releasableAt", + "type": "uint256" + } + ], + "name": "StakeClaimReleased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "claimsCount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensReleased", + "type": "uint256" + } + ], + "name": "StakeClaimsReleased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "min", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "max", + "type": "uint64" + } + ], + "name": "ThawingPeriodRangeSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "min", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "max", + "type": "uint32" + } + ], + "name": "VerifierCutRangeSet", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "acceptProvisionPendingParameters", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "claimId", + "type": "bytes32" + } + ], + "name": "claims", + "outputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "createdAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "releasableAt", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "nextClaim", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + } + ], + "name": "claimsLists", + "outputs": [ + { + "internalType": "bytes32", + "name": "head", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "tail", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "count", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "feeType", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "collect", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + } + ], + "name": "feesProvisionTracker", + "outputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getDelegationRatio", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getProvisionTokensRange", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getThawingPeriodRange", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getVerifierCutRange", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "register", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "numClaimsToRelease", + "type": "uint256" + } + ], + "name": "releaseStake", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "slash", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "startService", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "stopService", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "evm": { + "bytecode": { + "functionDebugData": {}, + "generatedSources": [], + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "deployedBytecode": { + "functionDebugData": {}, + "generatedSources": [], + "immutableReferences": {}, + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "methodIdentifiers": { + "acceptProvisionPendingParameters(address,bytes)": "ce0fc0cc", + "claims(bytes32)": "eff0f592", + "claimsLists(address)": "13c474c9", + "collect(address,uint8,bytes)": "b15d2a2c", + "feesProvisionTracker(address)": "cbe5f3f2", + "getDelegationRatio()": "1ebb7c30", + "getProvisionTokensRange()": "819ba366", + "getThawingPeriodRange()": "71ce020a", + "getVerifierCutRange()": "482468b7", + "register(address,bytes)": "24b8fbf6", + "releaseStake(uint256)": "45f54485", + "slash(address,bytes)": "cb8347fe", + "startService(address,bytes)": "dedf6726", + "stopService(address,bytes)": "8180083b" + } + }, + "metadata": "{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"claimId\",\"type\":\"bytes32\"}],\"name\":\"DataServiceFeesClaimNotFound\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DataServiceFeesZeroTokens\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"contractName\",\"type\":\"bytes\"}],\"name\":\"GraphDirectoryInvalidZeroAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidInitialization\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LinkedListEmptyList\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LinkedListInvalidIterations\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotInitializing\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"max\",\"type\":\"uint256\"}],\"name\":\"ProvisionManagerInvalidRange\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"max\",\"type\":\"uint256\"}],\"name\":\"ProvisionManagerInvalidValue\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"ProvisionManagerNotAuthorized\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"}],\"name\":\"ProvisionManagerProvisionNotFound\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokensAvailable\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"tokensRequired\",\"type\":\"uint256\"}],\"name\":\"ProvisionTrackerInsufficientTokens\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"ratio\",\"type\":\"uint32\"}],\"name\":\"DelegationRatioSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"graphToken\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"graphStaking\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"graphPayments\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"graphEscrow\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"graphController\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"graphEpochManager\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"graphRewardsManager\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"graphTokenGateway\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"graphProxyAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"graphCuration\",\"type\":\"address\"}],\"name\":\"GraphDirectoryInitialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"version\",\"type\":\"uint64\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"}],\"name\":\"ProvisionPendingParametersAccepted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"min\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"max\",\"type\":\"uint256\"}],\"name\":\"ProvisionTokensRangeSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"enum IGraphPayments.PaymentTypes\",\"name\":\"feeType\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"ServicePaymentCollected\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"ServiceProviderRegistered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"ServiceProviderSlashed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"ServiceStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"ServiceStopped\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"claimId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"unlockTimestamp\",\"type\":\"uint256\"}],\"name\":\"StakeClaimLocked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"claimId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"releasableAt\",\"type\":\"uint256\"}],\"name\":\"StakeClaimReleased\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"claimsCount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokensReleased\",\"type\":\"uint256\"}],\"name\":\"StakeClaimsReleased\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"min\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"max\",\"type\":\"uint64\"}],\"name\":\"ThawingPeriodRangeSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"min\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"max\",\"type\":\"uint32\"}],\"name\":\"VerifierCutRangeSet\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"acceptProvisionPendingParameters\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"claimId\",\"type\":\"bytes32\"}],\"name\":\"claims\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"createdAt\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"releasableAt\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"nextClaim\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"}],\"name\":\"claimsLists\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"head\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"tail\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"count\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"enum IGraphPayments.PaymentTypes\",\"name\":\"feeType\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"collect\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"}],\"name\":\"feesProvisionTracker\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getDelegationRatio\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getProvisionTokensRange\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getThawingPeriodRange\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getVerifierCutRange\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"register\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"numClaimsToRelease\",\"type\":\"uint256\"}],\"name\":\"releaseStake\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"slash\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"startService\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"stopService\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"custom:security-contact\":\"Please email security+contracts@thegraph.com if you find any bugs. We may have an active bug bounty program.\",\"details\":\"Implementation of the {IDataServiceFees} interface.This contract inherits from {DataService} which needs to be initialized, please see {DataService} for detailed instructions.\",\"errors\":{\"DataServiceFeesClaimNotFound(bytes32)\":[{\"params\":{\"claimId\":\"The id of the stake claim\"}}],\"GraphDirectoryInvalidZeroAddress(bytes)\":[{\"params\":{\"contractName\":\"The name of the contract that was not found, or the controller\"}}],\"InvalidInitialization()\":[{\"details\":\"The contract is already initialized.\"}],\"NotInitializing()\":[{\"details\":\"The contract is not initializing.\"}],\"ProvisionManagerInvalidRange(uint256,uint256)\":[{\"params\":{\"max\":\"The maximum value.\",\"min\":\"The minimum value.\"}}],\"ProvisionManagerInvalidValue(bytes,uint256,uint256,uint256)\":[{\"params\":{\"max\":\"The maximum allowed value.\",\"message\":\"The error message.\",\"min\":\"The minimum allowed value.\",\"value\":\"The value that is out of range.\"}}],\"ProvisionManagerNotAuthorized(address,address)\":[{\"params\":{\"caller\":\"The address of the caller.\",\"serviceProvider\":\"The address of the serviceProvider.\"}}],\"ProvisionManagerProvisionNotFound(address)\":[{\"params\":{\"serviceProvider\":\"The address of the service provider.\"}}],\"ProvisionTrackerInsufficientTokens(uint256,uint256)\":[{\"params\":{\"tokensAvailable\":\"The amount of tokens available\",\"tokensRequired\":\"The amount of tokens required\"}}]},\"events\":{\"DelegationRatioSet(uint32)\":{\"params\":{\"ratio\":\"The delegation ratio\"}},\"GraphDirectoryInitialized(address,address,address,address,address,address,address,address,address,address)\":{\"params\":{\"graphController\":\"The Graph Controller contract address\",\"graphCuration\":\"The Curation contract address\",\"graphEpochManager\":\"The Epoch Manager contract address\",\"graphEscrow\":\"The Payments Escrow contract address\",\"graphPayments\":\"The Graph Payments contract address\",\"graphProxyAdmin\":\"The Graph Proxy Admin contract address\",\"graphRewardsManager\":\"The Rewards Manager contract address\",\"graphStaking\":\"The Horizon Staking contract address\",\"graphToken\":\"The Graph Token contract address\",\"graphTokenGateway\":\"The Token Gateway contract address\"}},\"Initialized(uint64)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"},\"ProvisionPendingParametersAccepted(address)\":{\"params\":{\"serviceProvider\":\"The address of the service provider.\"}},\"ProvisionTokensRangeSet(uint256,uint256)\":{\"params\":{\"max\":\"The maximum allowed value for the provision tokens.\",\"min\":\"The minimum allowed value for the provision tokens.\"}},\"ServicePaymentCollected(address,uint8,uint256)\":{\"params\":{\"feeType\":\"The type of fee to collect as defined in {GraphPayments}.\",\"serviceProvider\":\"The address of the service provider.\",\"tokens\":\"The amount of tokens collected.\"}},\"ServiceProviderRegistered(address,bytes)\":{\"params\":{\"data\":\"Custom data, usage defined by the data service.\",\"serviceProvider\":\"The address of the service provider.\"}},\"ServiceProviderSlashed(address,uint256)\":{\"params\":{\"serviceProvider\":\"The address of the service provider.\",\"tokens\":\"The amount of tokens slashed.\"}},\"ServiceStarted(address,bytes)\":{\"params\":{\"data\":\"Custom data, usage defined by the data service.\",\"serviceProvider\":\"The address of the service provider.\"}},\"ServiceStopped(address,bytes)\":{\"params\":{\"data\":\"Custom data, usage defined by the data service.\",\"serviceProvider\":\"The address of the service provider.\"}},\"StakeClaimLocked(address,bytes32,uint256,uint256)\":{\"params\":{\"claimId\":\"The id of the stake claim\",\"serviceProvider\":\"The address of the service provider\",\"tokens\":\"The amount of tokens to lock in the claim\",\"unlockTimestamp\":\"The timestamp when the tokens can be released\"}},\"StakeClaimReleased(address,bytes32,uint256,uint256)\":{\"params\":{\"claimId\":\"The id of the stake claim\",\"releasableAt\":\"The timestamp when the tokens were released\",\"serviceProvider\":\"The address of the service provider\",\"tokens\":\"The amount of tokens released\"}},\"StakeClaimsReleased(address,uint256,uint256)\":{\"params\":{\"claimsCount\":\"The number of stake claims being released\",\"serviceProvider\":\"The address of the service provider\",\"tokensReleased\":\"The total amount of tokens being released\"}},\"ThawingPeriodRangeSet(uint64,uint64)\":{\"params\":{\"max\":\"The maximum allowed value for the thawing period.\",\"min\":\"The minimum allowed value for the thawing period.\"}},\"VerifierCutRangeSet(uint32,uint32)\":{\"params\":{\"max\":\"The maximum allowed value for the max verifier cut.\",\"min\":\"The minimum allowed value for the max verifier cut.\"}}},\"kind\":\"dev\",\"methods\":{\"acceptProvisionPendingParameters(address,bytes)\":{\"details\":\"Provides a way for the data service to validate and accept provision parameter changes. Call {_acceptProvision}. Emits a {ProvisionPendingParametersAccepted} event.\",\"params\":{\"data\":\"Custom data, usage defined by the data service.\",\"serviceProvider\":\"The address of the service provider.\"}},\"collect(address,uint8,bytes)\":{\"details\":\"The implementation of this function is expected to interact with {GraphPayments} to collect payment from the service payer, which is done via {IGraphPayments-collect}. Emits a {ServicePaymentCollected} event. NOTE: Data services that are vetted by the Graph Council might qualify for a portion of protocol issuance to cover for these payments. In this case, the funds are taken by interacting with the rewards manager contract instead of the {GraphPayments} contract.\",\"params\":{\"data\":\"Custom data, usage defined by the data service.\",\"feeType\":\"The type of fee to collect as defined in {GraphPayments}.\",\"serviceProvider\":\"The address of the service provider.\"},\"returns\":{\"_0\":\"The amount of tokens collected.\"}},\"getDelegationRatio()\":{\"returns\":{\"_0\":\"The delegation ratio\"}},\"getProvisionTokensRange()\":{\"returns\":{\"_0\":\"Minimum provision tokens allowed\",\"_1\":\"Maximum provision tokens allowed\"}},\"getThawingPeriodRange()\":{\"returns\":{\"_0\":\"Minimum thawing period allowed\",\"_1\":\"Maximum thawing period allowed\"}},\"getVerifierCutRange()\":{\"returns\":{\"_0\":\"Minimum verifier cut allowed\",\"_1\":\"Maximum verifier cut allowed\"}},\"register(address,bytes)\":{\"details\":\"Before registering, the service provider must have created a provision in the Graph Horizon staking contract with parameters that are compatible with the data service. Verifies provision parameters and rejects registration in the event they are not valid. Emits a {ServiceProviderRegistered} event. NOTE: Failing to accept the provision will result in the service provider operating on an unverified provision. Depending on of the data service this can be a security risk as the protocol won't be able to guarantee economic security for the consumer.\",\"params\":{\"data\":\"Custom data, usage defined by the data service.\",\"serviceProvider\":\"The address of the service provider.\"}},\"releaseStake(uint256)\":{\"details\":\"This function is only meant to be called if the service provider has enough stake claims that releasing them all at once would exceed the block gas limit.This function can be overriden and/or disabled.Emits a {StakeClaimsReleased} event, and a {StakeClaimReleased} event for each claim released.\",\"params\":{\"numClaimsToRelease\":\"Amount of stake claims to process. If 0, all stake claims are processed.\"}},\"slash(address,bytes)\":{\"details\":\"To slash the service provider's provision the function should call {Staking-slash}. Emits a {ServiceProviderSlashed} event.\",\"params\":{\"data\":\"Custom data, usage defined by the data service.\",\"serviceProvider\":\"The address of the service provider.\"}},\"startService(address,bytes)\":{\"details\":\"Emits a {ServiceStarted} event.\",\"params\":{\"data\":\"Custom data, usage defined by the data service.\",\"serviceProvider\":\"The address of the service provider.\"}},\"stopService(address,bytes)\":{\"details\":\"Emits a {ServiceStopped} event.\",\"params\":{\"data\":\"Custom data, usage defined by the data service.\",\"serviceProvider\":\"The address of the service provider.\"}}},\"title\":\"DataServiceFees contract\",\"version\":1},\"userdoc\":{\"errors\":{\"DataServiceFeesClaimNotFound(bytes32)\":[{\"notice\":\"Thrown when attempting to get a stake claim that does not exist.\"}],\"DataServiceFeesZeroTokens()\":[{\"notice\":\"Emitted when trying to lock zero tokens in a stake claim\"}],\"GraphDirectoryInvalidZeroAddress(bytes)\":[{\"notice\":\"Thrown when either the controller is the zero address or a contract address is not found on the controller\"}],\"LinkedListEmptyList()\":[{\"notice\":\"Thrown when trying to remove an item from an empty list\"}],\"LinkedListInvalidIterations()\":[{\"notice\":\"Thrown when trying to traverse a list with more iterations than elements\"}],\"ProvisionManagerInvalidRange(uint256,uint256)\":[{\"notice\":\"Thrown when attempting to set a range where min is greater than max.\"}],\"ProvisionManagerInvalidValue(bytes,uint256,uint256,uint256)\":[{\"notice\":\"Thrown when a provision parameter is out of range.\"}],\"ProvisionManagerNotAuthorized(address,address)\":[{\"notice\":\"Thrown when the caller is not authorized to manage the provision of a service provider.\"}],\"ProvisionManagerProvisionNotFound(address)\":[{\"notice\":\"Thrown when a provision is not found.\"}],\"ProvisionTrackerInsufficientTokens(uint256,uint256)\":[{\"notice\":\"Thrown when trying to lock more tokens than available\"}]},\"events\":{\"DelegationRatioSet(uint32)\":{\"notice\":\"Emitted when the delegation ratio is set.\"},\"GraphDirectoryInitialized(address,address,address,address,address,address,address,address,address,address)\":{\"notice\":\"Emitted when the GraphDirectory is initialized\"},\"ProvisionPendingParametersAccepted(address)\":{\"notice\":\"Emitted when a service provider accepts a provision in {Graph Horizon staking contract}.\"},\"ProvisionTokensRangeSet(uint256,uint256)\":{\"notice\":\"Emitted when the provision tokens range is set.\"},\"ServicePaymentCollected(address,uint8,uint256)\":{\"notice\":\"Emitted when a service provider collects payment.\"},\"ServiceProviderRegistered(address,bytes)\":{\"notice\":\"Emitted when a service provider is registered with the data service.\"},\"ServiceProviderSlashed(address,uint256)\":{\"notice\":\"Emitted when a service provider is slashed.\"},\"ServiceStarted(address,bytes)\":{\"notice\":\"Emitted when a service provider starts providing the service.\"},\"ServiceStopped(address,bytes)\":{\"notice\":\"Emitted when a service provider stops providing the service.\"},\"StakeClaimLocked(address,bytes32,uint256,uint256)\":{\"notice\":\"Emitted when a stake claim is created and stake is locked.\"},\"StakeClaimReleased(address,bytes32,uint256,uint256)\":{\"notice\":\"Emitted when a stake claim is released and stake is unlocked.\"},\"StakeClaimsReleased(address,uint256,uint256)\":{\"notice\":\"Emitted when a series of stake claims are released.\"},\"ThawingPeriodRangeSet(uint64,uint64)\":{\"notice\":\"Emitted when the thawing period range is set.\"},\"VerifierCutRangeSet(uint32,uint32)\":{\"notice\":\"Emitted when the verifier cut range is set.\"}},\"kind\":\"user\",\"methods\":{\"acceptProvisionPendingParameters(address,bytes)\":{\"notice\":\"Accepts pending parameters in the provision of a service provider in the {Graph Horizon staking contract}.\"},\"claims(bytes32)\":{\"notice\":\"List of all locked stake claims to be released to service providers\"},\"claimsLists(address)\":{\"notice\":\"Service providers registered in the data service\"},\"collect(address,uint8,bytes)\":{\"notice\":\"Collects payment earnt by the service provider.\"},\"feesProvisionTracker(address)\":{\"notice\":\"The amount of tokens locked in stake claims for each service provider\"},\"getDelegationRatio()\":{\"notice\":\"External getter for the delegation ratio\"},\"getProvisionTokensRange()\":{\"notice\":\"External getter for the provision tokens range\"},\"getThawingPeriodRange()\":{\"notice\":\"External getter for the thawing period range\"},\"getVerifierCutRange()\":{\"notice\":\"External getter for the verifier cut range\"},\"register(address,bytes)\":{\"notice\":\"Registers a service provider with the data service. The service provider can now start providing the service.\"},\"releaseStake(uint256)\":{\"notice\":\"Releases expired stake claims for the caller.\"},\"slash(address,bytes)\":{\"notice\":\"Slash a service provider for misbehaviour.\"},\"startService(address,bytes)\":{\"notice\":\"Service provider starts providing the service.\"},\"stopService(address,bytes)\":{\"notice\":\"Service provider stops providing the service.\"}},\"notice\":\"Extension for the {IDataService} contract to handle payment collateralization using a Horizon provision. See {IDataServiceFees} for more details.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"@graphprotocol/horizon/contracts/data-service/extensions/DataServiceFees.sol\":\"DataServiceFees\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10},\"remappings\":[]},\"sources\":{\"@graphprotocol/contracts/contracts/arbitrum/ITokenGateway.sol\":{\"keccak256\":\"0x3cbcc6e4629543a99acacc7ee4ffa6c063b9fb17d3597ccd2f9481008e3633bd\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://d6bb0bb830b67d579e57a261e5f5d9e90b32dc006b02badbecf1f6c82c0a5100\",\"dweb:/ipfs/Qmd38iNXZpinwbNRJPEAA8r9bmmtRwjTSK1SkmH47ge4kJ\"]},\"@graphprotocol/contracts/contracts/curation/ICuration.sol\":{\"keccak256\":\"0x17e4db429003cab08cd2859db94b95e0cee1f9478c1881903a4104def8fdc048\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://52ed58228a0e92aeb3493473a6e02f92d26a4e4eb0c46d38dd446e3bfcb6691e\",\"dweb:/ipfs/QmZzWxHAztdz2Q7cobqVEf4ExGpNuqWJFYgs2oHCgApjW6\"]},\"@graphprotocol/contracts/contracts/epochs/IEpochManager.sol\":{\"keccak256\":\"0x0f4b3a3569c023d2610d0d8b37b3ecb0b67f848d77aa063bb311756670017e85\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://df7c43568e554b301134aa2c58e4889ad0d3dcfec40e834b63621a43f39da154\",\"dweb:/ipfs/QmZeSV9AM6FKCkH9QYyF7i5nVggseEJXbvWbtrgUeXqQpo\"]},\"@graphprotocol/contracts/contracts/governance/IController.sol\":{\"keccak256\":\"0xe37df86cdea385d708ba00862cd9e04940e4f2aa50354fb3a9d2d4f505d5509a\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://0f6c9fd2b7a8c5a6b89ef12c7423144df04a5f251d5480be1b73c74a785ff12a\",\"dweb:/ipfs/QmYpiCQoxbDEYQ2FNA39Z4FGfoxfQ8jvH1Z3ccrqguQFMP\"]},\"@graphprotocol/contracts/contracts/rewards/IRewardsIssuer.sol\":{\"keccak256\":\"0xe049090c38a64d80b284ba2a7b440bcedba9804d96f2bb8da525e69ac452e03a\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://8b7d1186bd0698bed02d3504ac80c20e605087fba036d5ff392b39a9a3c818e5\",\"dweb:/ipfs/QmRgAfY1dD5rc7fLuuGVyu2mh9Z8qz1AVvuXAcRGnB3dSv\"]},\"@graphprotocol/contracts/contracts/rewards/IRewardsManager.sol\":{\"keccak256\":\"0xee4b213950c2e46481658b9b04f2d5dae0a96c4cce0ee346188b1f1272718d54\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://b26dd767bd6887666a18beef79c322d27a693a3a4f7a61dc6bded7f35796acf5\",\"dweb:/ipfs/QmXDeqmRSeAWUWQTknNLUPBDBnDr8ySYW4h6CBPRGMJoPp\"]},\"@graphprotocol/contracts/contracts/token/IGraphToken.sol\":{\"keccak256\":\"0x2ffad6798d641c8d1288730be725c43041c803caceaf6d9985122d000ad5761c\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://5f782a5670037fc9223dc20fd4f99c0277a9bec7d08f7800b0a0733e819a07cb\",\"dweb:/ipfs/QmP3K2QnmukScCh1nzgphYdg7AiAuTaT914jq4txLYNpra\"]},\"@graphprotocol/horizon/contracts/data-service/DataService.sol\":{\"keccak256\":\"0xa57fda8ea4c94a2cda061a6c8f29ae215241b0af03a43df3bc622051d8b2493c\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://7fc433ef0eb71c264224e9058de7e9aea3b2dbfab68dbdf0df8a13de82e90ef6\",\"dweb:/ipfs/QmVrp6kv8Ef1AP38C4soa1cnnRqqmKFnHer2VrXms52Asy\"]},\"@graphprotocol/horizon/contracts/data-service/DataServiceStorage.sol\":{\"keccak256\":\"0x615aac9d5c9cd04216fa9ee21c770f3877a2971a1c023052143c95c08b87610f\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://bd4eb031e9ab86e3a17df29fcb297621e88850c3c5db123925d24b77c802b037\",\"dweb:/ipfs/QmSCNfQqMzui9gaN3Rf8nTNJBPWSFNqFgexbK2k6GBN381\"]},\"@graphprotocol/horizon/contracts/data-service/extensions/DataServiceFees.sol\":{\"keccak256\":\"0xa9e95b7ca9af3987697c06b252fdb12e1d01e5c62c123c17f39f03d96d38876f\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://d86b520570fb3dd76b60fc64eabe6a7104b41a96a9c92e9031c91a799287d749\",\"dweb:/ipfs/QmZGaiEZVfycnQu4EkPWGM7Jg3jo4jdEuLeuZxAMPMg5s6\"]},\"@graphprotocol/horizon/contracts/data-service/extensions/DataServiceFeesStorage.sol\":{\"keccak256\":\"0x9068f639ea7aad02d842eb0054cadc3a5f05044d8d0176dc4c9ff60693775bc0\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://9e22fd5157ea02064104b02952c327ab58b0a5c70c7356d94017f3e03da298d4\",\"dweb:/ipfs/QmdTZAFaZWSpVUvWTnUgednbRNLMbFvUMKZ5FHkjhRk4Qf\"]},\"@graphprotocol/horizon/contracts/data-service/interfaces/IDataService.sol\":{\"keccak256\":\"0x2208814f64eeca9409eafc1a1fa425c67ff38cffdffc3af0bafbe1c1b338ed32\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://925b32efbd9fe85a98f8f1f51e865e0b7b65d933196cf6c098bd670da7138e0c\",\"dweb:/ipfs/Qmdrp7BGJ4fEKzDgZpVY1FULXKsHAdGXkx4nqRrWvMaumr\"]},\"@graphprotocol/horizon/contracts/data-service/interfaces/IDataServiceFees.sol\":{\"keccak256\":\"0x1b82ae2785502fe62d3ca6f55a3ed836b8b038a3b929cced92e1c6b4733f4074\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://5556b2ce53b604427a995fb50f7169acb3fe30f60ef19c7cb5c22bd5ec53177c\",\"dweb:/ipfs/QmXx7dmTeAYAMPbbrGrcsKT31dqEqbcFgXWaPS6LQrANru\"]},\"@graphprotocol/horizon/contracts/data-service/libraries/ProvisionTracker.sol\":{\"keccak256\":\"0xc0f433a20f91fb2c2c588d5accfd311535314d71f7adc4e2b84fa4193ed1a739\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://a920d9446c3e76783921d2f2d980a058f41700de1d59470c9b3892a49ebcaf48\",\"dweb:/ipfs/QmcwmqNkxS1BpJQ7kgf4V9F98w2MKcVvg2N7P3i8KtDSF4\"]},\"@graphprotocol/horizon/contracts/data-service/utilities/ProvisionManager.sol\":{\"keccak256\":\"0x63e7f1df10586beb7f8683065719fbff045437508539a9358c25a13fcf989f91\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://b32f9a7be91ae6d9c9a6edbe2404efbcf9fa99c1d503f4a688054be468494a8e\",\"dweb:/ipfs/QmQ5AQXsBPxtJSW24LqRZAaYYaz1518FpUCHfDEdsMfF8F\"]},\"@graphprotocol/horizon/contracts/data-service/utilities/ProvisionManagerStorage.sol\":{\"keccak256\":\"0xe44f72a63c472a6de42e08a2d732044fe1ac9245c4203d4e1eb941b1a2fa2159\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://412708a4f94b5757e46676c5702e47d37fdbdacbe53f70e2ee93d37c5938e028\",\"dweb:/ipfs/Qmdw4uagDdKeCzyS319BKyPzfnWCvM3KCtNYosFBd3xGco\"]},\"@graphprotocol/horizon/contracts/interfaces/IGraphPayments.sol\":{\"keccak256\":\"0xa22dcc47676073113e4ebe30045065662cee5531f9c5f75776c00e70a1929c81\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://8908f30b3c7536798b14dc62fb5ccffc05570d568dbd1bade7c79c1fd2a4b5fe\",\"dweb:/ipfs/QmexZgb5mhDmXVZnYX1Z37cwM7EG2prYyBEVjUSVdKshVr\"]},\"@graphprotocol/horizon/contracts/interfaces/IGraphProxyAdmin.sol\":{\"keccak256\":\"0x4410253d7de56d2cdff50ee141c52fd77fd23f3984440211c3cc90ad560f4f9d\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://da4425a908816c40ffc3c833504843c3732bcb47e745dc544f650e5bc2c23f25\",\"dweb:/ipfs/QmZYDS4cSKBqRXEU3qyjE6sxGModSeNgzQmdZmZCGHuaKt\"]},\"@graphprotocol/horizon/contracts/interfaces/IHorizonStaking.sol\":{\"keccak256\":\"0x4b146f30ee66c4224cb5a82bafc8299f8596d8fe302e793757520f67bba8a166\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://30666c737d72a850223c1966d3b5d02b84f3f808f3c8dae8d0748731646b60c5\",\"dweb:/ipfs/QmQschyZQtU8tTnQ9hNiG5nobuXBx6KeiKdfxvZ4zvQ7ty\"]},\"@graphprotocol/horizon/contracts/interfaces/IPaymentsEscrow.sol\":{\"keccak256\":\"0x99e2a676b539e7b6c223a551f8cb9770c07435a25c8b22f0044a8ce4949edadc\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://f702a3cea214d8328d89a0ef16495c709e30fe13eb86fc29940159c9cb8c7bd5\",\"dweb:/ipfs/QmS25Zgcw85kDZcicApLzRmDcoYNQafpFdMyBEWX8eLWSX\"]},\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingBase.sol\":{\"keccak256\":\"0x9bdab6cb595eabd7d321d7beae03ad3607995c14ef40f0c2f349fb72084766c5\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://6cac2ca3580bd770b98b07b11ebb007e8a922a90cde920e6ec472df7e66fb512\",\"dweb:/ipfs/QmRw1rjT8D8gNp2GRTuwDETwHNHMpHKoHZq4pYBAn9i65F\"]},\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingExtension.sol\":{\"keccak256\":\"0x7923f39746198b5672f0e4d65b7bf14903ae5f7775d74b210effb957eea36c71\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://c29531aff69c71e649fb347d7117ea8c42fc8de09860a1c389ed9b8f097a34e0\",\"dweb:/ipfs/QmS89fww584HiyE1BdPe8Xaqbf5v7FEvL38GTxeHEAsLFm\"]},\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingMain.sol\":{\"keccak256\":\"0xd04bb1f6a427e858e8a625b4b9835c69c8891a324d22beba20293ab2a77e5de7\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://05c9e425eee0b6c109a8dad2edcf9e1c845c64fccf321edf804921394ee048be\",\"dweb:/ipfs/QmbwLWNof534oG5ohzNAWrjdQ5kqJs7M5d5kCRd68XUogB\"]},\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingTypes.sol\":{\"keccak256\":\"0xaaeb9770f8aaae6b395e87bb1876a10fe7c14384d16d97dd33a671c3ea53aa7b\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://8f5c019fdb2df73bafe464fb6e9da792f7833a0c1858734bcd6a6b8d6ae924c7\",\"dweb:/ipfs/QmcubeYTHCYBqQsRncBFpPFtk7JzRz4nFh27LUW1m4hx2K\"]},\"@graphprotocol/horizon/contracts/libraries/LinkedList.sol\":{\"keccak256\":\"0x99058b4da0428b8d9c22d3d112acbaa59900f1fd0a434038b1a4fccfe3c678d6\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://568e03231c6081eacbcb6585a05c0b1bb976b640b611f7bf6155f9b58d887239\",\"dweb:/ipfs/QmdPZQWhkhjf5TUwz487Dwm4ycjX323iNdwb1sQnAiA1Qu\"]},\"@graphprotocol/horizon/contracts/libraries/PPMMath.sol\":{\"keccak256\":\"0xe7fcfd44d2919944b79a11a39da7d4539d49c4bcf510071a59f6b41c37ee8ef2\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://a21b1ff7ca81fa07f153b60aeca136bd1ee57d9d01a2c76635e4a5602e8959fc\",\"dweb:/ipfs/QmQ5C7mUjt4sv1NBt1FH5XVHN3aBsHnvDsdJKWywhLjso8\"]},\"@graphprotocol/horizon/contracts/libraries/UintRange.sol\":{\"keccak256\":\"0x70d69069b2c122becd29ec4ea9a79f2e26cf7cbe7b1918ffced691ee00cdbd82\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://6bddc7d257c3df1fd4940dd3c554e5a1efbc1b23d50f7878415389b75380628c\",\"dweb:/ipfs/QmTQBCsL4pHoXMixVvDwGMdmJnGfEeeDZfHdJkcpKamu58\"]},\"@graphprotocol/horizon/contracts/utilities/GraphDirectory.sol\":{\"keccak256\":\"0x1d09be2f7454873ab80f86ed5d590b9e796fe5146977c4c4a5b1f7ead17eb522\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://e1c7539d26f069c2acabd404601e7811f8878f66976e8b5d4f5438195de793c2\",\"dweb:/ipfs/QmUAybvtDZ275kAnU6r81aQy1FCp7zLscSV87oe9nbwjyU\"]},\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"keccak256\":\"0xdb4d24ee2c087c391d587cd17adfe5b3f9d93b3110b1388c2ab6c7c0ad1dcd05\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://ab7b6d5b9e2b88176312967fe0f0e78f3d9a1422fa5e4b64e2440c35869b5d08\",\"dweb:/ipfs/QmXKYWWyzcLg1B2k7Sb1qkEXgLCYfXecR9wYW5obRzWP1Q\"]},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0xe06a3f08a987af6ad2e1c1e774405d4fe08f1694b67517438b467cecf0da0ef7\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://df6f0c459663c9858b6cba2cda1d14a7d05a985bed6d2de72bd8e78c25ee79db\",\"dweb:/ipfs/QmeTTxZ7qVk9rjEv2R4CpCwdf8UMCcRqDNMvzNxHc3Fnn9\"]}},\"version\":1}" + } + }, + "@graphprotocol/horizon/contracts/data-service/extensions/DataServiceFeesStorage.sol": { + "DataServiceFeesV1Storage": { + "abi": [ + { + "inputs": [ + { + "internalType": "bytes32", + "name": "claimId", + "type": "bytes32" + } + ], + "name": "claims", + "outputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "createdAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "releasableAt", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "nextClaim", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + } + ], + "name": "claimsLists", + "outputs": [ + { + "internalType": "bytes32", + "name": "head", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "tail", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "count", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + } + ], + "name": "feesProvisionTracker", + "outputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "evm": { + "bytecode": { + "functionDebugData": {}, + "generatedSources": [], + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "deployedBytecode": { + "functionDebugData": {}, + "generatedSources": [], + "immutableReferences": {}, + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "methodIdentifiers": { + "claims(bytes32)": "eff0f592", + "claimsLists(address)": "13c474c9", + "feesProvisionTracker(address)": "cbe5f3f2" + } + }, + "metadata": "{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"claimId\",\"type\":\"bytes32\"}],\"name\":\"claims\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"createdAt\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"releasableAt\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"nextClaim\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"}],\"name\":\"claimsLists\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"head\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"tail\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"count\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"}],\"name\":\"feesProvisionTracker\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"custom:security-contact\":\"Please email security+contracts@thegraph.com if you find any bugs. We may have an active bug bounty program.\",\"kind\":\"dev\",\"methods\":{},\"stateVariables\":{\"__gap\":{\"details\":\"Gap to allow adding variables in future upgrades Note that this contract is not upgradeable but might be inherited by an upgradeable contract\"}},\"title\":\"Storage layout for the {DataServiceFees} extension contract.\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"claims(bytes32)\":{\"notice\":\"List of all locked stake claims to be released to service providers\"},\"claimsLists(address)\":{\"notice\":\"Service providers registered in the data service\"},\"feesProvisionTracker(address)\":{\"notice\":\"The amount of tokens locked in stake claims for each service provider\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@graphprotocol/horizon/contracts/data-service/extensions/DataServiceFeesStorage.sol\":\"DataServiceFeesV1Storage\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10},\"remappings\":[]},\"sources\":{\"@graphprotocol/horizon/contracts/data-service/extensions/DataServiceFeesStorage.sol\":{\"keccak256\":\"0x9068f639ea7aad02d842eb0054cadc3a5f05044d8d0176dc4c9ff60693775bc0\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://9e22fd5157ea02064104b02952c327ab58b0a5c70c7356d94017f3e03da298d4\",\"dweb:/ipfs/QmdTZAFaZWSpVUvWTnUgednbRNLMbFvUMKZ5FHkjhRk4Qf\"]},\"@graphprotocol/horizon/contracts/data-service/interfaces/IDataService.sol\":{\"keccak256\":\"0x2208814f64eeca9409eafc1a1fa425c67ff38cffdffc3af0bafbe1c1b338ed32\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://925b32efbd9fe85a98f8f1f51e865e0b7b65d933196cf6c098bd670da7138e0c\",\"dweb:/ipfs/Qmdrp7BGJ4fEKzDgZpVY1FULXKsHAdGXkx4nqRrWvMaumr\"]},\"@graphprotocol/horizon/contracts/data-service/interfaces/IDataServiceFees.sol\":{\"keccak256\":\"0x1b82ae2785502fe62d3ca6f55a3ed836b8b038a3b929cced92e1c6b4733f4074\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://5556b2ce53b604427a995fb50f7169acb3fe30f60ef19c7cb5c22bd5ec53177c\",\"dweb:/ipfs/QmXx7dmTeAYAMPbbrGrcsKT31dqEqbcFgXWaPS6LQrANru\"]},\"@graphprotocol/horizon/contracts/interfaces/IGraphPayments.sol\":{\"keccak256\":\"0xa22dcc47676073113e4ebe30045065662cee5531f9c5f75776c00e70a1929c81\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://8908f30b3c7536798b14dc62fb5ccffc05570d568dbd1bade7c79c1fd2a4b5fe\",\"dweb:/ipfs/QmexZgb5mhDmXVZnYX1Z37cwM7EG2prYyBEVjUSVdKshVr\"]},\"@graphprotocol/horizon/contracts/libraries/LinkedList.sol\":{\"keccak256\":\"0x99058b4da0428b8d9c22d3d112acbaa59900f1fd0a434038b1a4fccfe3c678d6\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://568e03231c6081eacbcb6585a05c0b1bb976b640b611f7bf6155f9b58d887239\",\"dweb:/ipfs/QmdPZQWhkhjf5TUwz487Dwm4ycjX323iNdwb1sQnAiA1Qu\"]}},\"version\":1}" + } + }, + "@graphprotocol/horizon/contracts/data-service/extensions/DataServicePausableUpgradeable.sol": { + "DataServicePausableUpgradeable": { + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "DataServicePausableNotPauseGuardian", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "DataServicePausablePauseGuardianNoChange", + "type": "error" + }, + { + "inputs": [], + "name": "EnforcedPause", + "type": "error" + }, + { + "inputs": [], + "name": "ExpectedPause", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "contractName", + "type": "bytes" + } + ], + "name": "GraphDirectoryInvalidZeroAddress", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidInitialization", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "name": "ProvisionManagerInvalidRange", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "message", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "name": "ProvisionManagerInvalidValue", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "ProvisionManagerNotAuthorized", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + } + ], + "name": "ProvisionManagerProvisionNotFound", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "ratio", + "type": "uint32" + } + ], + "name": "DelegationRatioSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "graphToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "graphStaking", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphPayments", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphEscrow", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "graphController", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphEpochManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphRewardsManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphTokenGateway", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphProxyAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphCuration", + "type": "address" + } + ], + "name": "GraphDirectoryInitialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "PauseGuardianSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Paused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + } + ], + "name": "ProvisionPendingParametersAccepted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "name": "ProvisionTokensRangeSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "feeType", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "ServicePaymentCollected", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "ServiceProviderRegistered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "ServiceProviderSlashed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "ServiceStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "ServiceStopped", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "min", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "max", + "type": "uint64" + } + ], + "name": "ThawingPeriodRangeSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Unpaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "min", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "max", + "type": "uint32" + } + ], + "name": "VerifierCutRangeSet", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "acceptProvisionPendingParameters", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "feeType", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "collect", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getDelegationRatio", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getProvisionTokensRange", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getThawingPeriodRange", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getVerifierCutRange", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "pauseGuardian", + "type": "address" + } + ], + "name": "pauseGuardians", + "outputs": [ + { + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "paused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "register", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "slash", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "startService", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "stopService", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "unpause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "evm": { + "bytecode": { + "functionDebugData": {}, + "generatedSources": [], + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "deployedBytecode": { + "functionDebugData": {}, + "generatedSources": [], + "immutableReferences": {}, + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "methodIdentifiers": { + "acceptProvisionPendingParameters(address,bytes)": "ce0fc0cc", + "collect(address,uint8,bytes)": "b15d2a2c", + "getDelegationRatio()": "1ebb7c30", + "getProvisionTokensRange()": "819ba366", + "getThawingPeriodRange()": "71ce020a", + "getVerifierCutRange()": "482468b7", + "pause()": "8456cb59", + "pauseGuardians(address)": "9384e078", + "paused()": "5c975abb", + "register(address,bytes)": "24b8fbf6", + "slash(address,bytes)": "cb8347fe", + "startService(address,bytes)": "dedf6726", + "stopService(address,bytes)": "8180083b", + "unpause()": "3f4ba83a" + } + }, + "metadata": "{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"DataServicePausableNotPauseGuardian\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"}],\"name\":\"DataServicePausablePauseGuardianNoChange\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"EnforcedPause\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ExpectedPause\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"contractName\",\"type\":\"bytes\"}],\"name\":\"GraphDirectoryInvalidZeroAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidInitialization\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotInitializing\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"max\",\"type\":\"uint256\"}],\"name\":\"ProvisionManagerInvalidRange\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"max\",\"type\":\"uint256\"}],\"name\":\"ProvisionManagerInvalidValue\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"ProvisionManagerNotAuthorized\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"}],\"name\":\"ProvisionManagerProvisionNotFound\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"ratio\",\"type\":\"uint32\"}],\"name\":\"DelegationRatioSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"graphToken\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"graphStaking\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"graphPayments\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"graphEscrow\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"graphController\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"graphEpochManager\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"graphRewardsManager\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"graphTokenGateway\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"graphProxyAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"graphCuration\",\"type\":\"address\"}],\"name\":\"GraphDirectoryInitialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"version\",\"type\":\"uint64\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"}],\"name\":\"PauseGuardianSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Paused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"}],\"name\":\"ProvisionPendingParametersAccepted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"min\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"max\",\"type\":\"uint256\"}],\"name\":\"ProvisionTokensRangeSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"enum IGraphPayments.PaymentTypes\",\"name\":\"feeType\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"ServicePaymentCollected\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"ServiceProviderRegistered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"ServiceProviderSlashed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"ServiceStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"ServiceStopped\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"min\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"max\",\"type\":\"uint64\"}],\"name\":\"ThawingPeriodRangeSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Unpaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"min\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"max\",\"type\":\"uint32\"}],\"name\":\"VerifierCutRangeSet\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"acceptProvisionPendingParameters\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"enum IGraphPayments.PaymentTypes\",\"name\":\"feeType\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"collect\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getDelegationRatio\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getProvisionTokensRange\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getThawingPeriodRange\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getVerifierCutRange\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"pauseGuardian\",\"type\":\"address\"}],\"name\":\"pauseGuardians\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"paused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"register\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"slash\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"startService\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"stopService\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unpause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"custom:security-contact\":\"Please email security+contracts@thegraph.com if you find any bugs. We may have an active bug bounty program.\",\"details\":\"Implementation of the {IDataServicePausable} interface.Upgradeable version of the {DataServicePausable} contract.This contract inherits from {DataService} which needs to be initialized, please see {DataService} for detailed instructions.\",\"errors\":{\"DataServicePausableNotPauseGuardian(address)\":[{\"params\":{\"account\":\"The address of the pause guardian\"}}],\"DataServicePausablePauseGuardianNoChange(address,bool)\":[{\"params\":{\"account\":\"The address of the pause guardian\",\"allowed\":\"The allowed status of the pause guardian\"}}],\"EnforcedPause()\":[{\"details\":\"The operation failed because the contract is paused.\"}],\"ExpectedPause()\":[{\"details\":\"The operation failed because the contract is not paused.\"}],\"GraphDirectoryInvalidZeroAddress(bytes)\":[{\"params\":{\"contractName\":\"The name of the contract that was not found, or the controller\"}}],\"InvalidInitialization()\":[{\"details\":\"The contract is already initialized.\"}],\"NotInitializing()\":[{\"details\":\"The contract is not initializing.\"}],\"ProvisionManagerInvalidRange(uint256,uint256)\":[{\"params\":{\"max\":\"The maximum value.\",\"min\":\"The minimum value.\"}}],\"ProvisionManagerInvalidValue(bytes,uint256,uint256,uint256)\":[{\"params\":{\"max\":\"The maximum allowed value.\",\"message\":\"The error message.\",\"min\":\"The minimum allowed value.\",\"value\":\"The value that is out of range.\"}}],\"ProvisionManagerNotAuthorized(address,address)\":[{\"params\":{\"caller\":\"The address of the caller.\",\"serviceProvider\":\"The address of the serviceProvider.\"}}],\"ProvisionManagerProvisionNotFound(address)\":[{\"params\":{\"serviceProvider\":\"The address of the service provider.\"}}]},\"events\":{\"DelegationRatioSet(uint32)\":{\"params\":{\"ratio\":\"The delegation ratio\"}},\"GraphDirectoryInitialized(address,address,address,address,address,address,address,address,address,address)\":{\"params\":{\"graphController\":\"The Graph Controller contract address\",\"graphCuration\":\"The Curation contract address\",\"graphEpochManager\":\"The Epoch Manager contract address\",\"graphEscrow\":\"The Payments Escrow contract address\",\"graphPayments\":\"The Graph Payments contract address\",\"graphProxyAdmin\":\"The Graph Proxy Admin contract address\",\"graphRewardsManager\":\"The Rewards Manager contract address\",\"graphStaking\":\"The Horizon Staking contract address\",\"graphToken\":\"The Graph Token contract address\",\"graphTokenGateway\":\"The Token Gateway contract address\"}},\"Initialized(uint64)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"},\"PauseGuardianSet(address,bool)\":{\"params\":{\"account\":\"The address of the pause guardian\",\"allowed\":\"The allowed status of the pause guardian\"}},\"Paused(address)\":{\"details\":\"Emitted when the pause is triggered by `account`.\"},\"ProvisionPendingParametersAccepted(address)\":{\"params\":{\"serviceProvider\":\"The address of the service provider.\"}},\"ProvisionTokensRangeSet(uint256,uint256)\":{\"params\":{\"max\":\"The maximum allowed value for the provision tokens.\",\"min\":\"The minimum allowed value for the provision tokens.\"}},\"ServicePaymentCollected(address,uint8,uint256)\":{\"params\":{\"feeType\":\"The type of fee to collect as defined in {GraphPayments}.\",\"serviceProvider\":\"The address of the service provider.\",\"tokens\":\"The amount of tokens collected.\"}},\"ServiceProviderRegistered(address,bytes)\":{\"params\":{\"data\":\"Custom data, usage defined by the data service.\",\"serviceProvider\":\"The address of the service provider.\"}},\"ServiceProviderSlashed(address,uint256)\":{\"params\":{\"serviceProvider\":\"The address of the service provider.\",\"tokens\":\"The amount of tokens slashed.\"}},\"ServiceStarted(address,bytes)\":{\"params\":{\"data\":\"Custom data, usage defined by the data service.\",\"serviceProvider\":\"The address of the service provider.\"}},\"ServiceStopped(address,bytes)\":{\"params\":{\"data\":\"Custom data, usage defined by the data service.\",\"serviceProvider\":\"The address of the service provider.\"}},\"ThawingPeriodRangeSet(uint64,uint64)\":{\"params\":{\"max\":\"The maximum allowed value for the thawing period.\",\"min\":\"The minimum allowed value for the thawing period.\"}},\"Unpaused(address)\":{\"details\":\"Emitted when the pause is lifted by `account`.\"},\"VerifierCutRangeSet(uint32,uint32)\":{\"params\":{\"max\":\"The maximum allowed value for the max verifier cut.\",\"min\":\"The minimum allowed value for the max verifier cut.\"}}},\"kind\":\"dev\",\"methods\":{\"acceptProvisionPendingParameters(address,bytes)\":{\"details\":\"Provides a way for the data service to validate and accept provision parameter changes. Call {_acceptProvision}. Emits a {ProvisionPendingParametersAccepted} event.\",\"params\":{\"data\":\"Custom data, usage defined by the data service.\",\"serviceProvider\":\"The address of the service provider.\"}},\"collect(address,uint8,bytes)\":{\"details\":\"The implementation of this function is expected to interact with {GraphPayments} to collect payment from the service payer, which is done via {IGraphPayments-collect}. Emits a {ServicePaymentCollected} event. NOTE: Data services that are vetted by the Graph Council might qualify for a portion of protocol issuance to cover for these payments. In this case, the funds are taken by interacting with the rewards manager contract instead of the {GraphPayments} contract.\",\"params\":{\"data\":\"Custom data, usage defined by the data service.\",\"feeType\":\"The type of fee to collect as defined in {GraphPayments}.\",\"serviceProvider\":\"The address of the service provider.\"},\"returns\":{\"_0\":\"The amount of tokens collected.\"}},\"getDelegationRatio()\":{\"returns\":{\"_0\":\"The delegation ratio\"}},\"getProvisionTokensRange()\":{\"returns\":{\"_0\":\"Minimum provision tokens allowed\",\"_1\":\"Maximum provision tokens allowed\"}},\"getThawingPeriodRange()\":{\"returns\":{\"_0\":\"Minimum thawing period allowed\",\"_1\":\"Maximum thawing period allowed\"}},\"getVerifierCutRange()\":{\"returns\":{\"_0\":\"Minimum verifier cut allowed\",\"_1\":\"Maximum verifier cut allowed\"}},\"pause()\":{\"details\":\"Note that only functions using the modifiers `whenNotPaused` and `whenPaused` will be affected by the pause. Requirements: - The contract must not be already paused\"},\"paused()\":{\"details\":\"Returns true if the contract is paused, and false otherwise.\"},\"register(address,bytes)\":{\"details\":\"Before registering, the service provider must have created a provision in the Graph Horizon staking contract with parameters that are compatible with the data service. Verifies provision parameters and rejects registration in the event they are not valid. Emits a {ServiceProviderRegistered} event. NOTE: Failing to accept the provision will result in the service provider operating on an unverified provision. Depending on of the data service this can be a security risk as the protocol won't be able to guarantee economic security for the consumer.\",\"params\":{\"data\":\"Custom data, usage defined by the data service.\",\"serviceProvider\":\"The address of the service provider.\"}},\"slash(address,bytes)\":{\"details\":\"To slash the service provider's provision the function should call {Staking-slash}. Emits a {ServiceProviderSlashed} event.\",\"params\":{\"data\":\"Custom data, usage defined by the data service.\",\"serviceProvider\":\"The address of the service provider.\"}},\"startService(address,bytes)\":{\"details\":\"Emits a {ServiceStarted} event.\",\"params\":{\"data\":\"Custom data, usage defined by the data service.\",\"serviceProvider\":\"The address of the service provider.\"}},\"stopService(address,bytes)\":{\"details\":\"Emits a {ServiceStopped} event.\",\"params\":{\"data\":\"Custom data, usage defined by the data service.\",\"serviceProvider\":\"The address of the service provider.\"}},\"unpause()\":{\"details\":\"Note that only functions using the modifiers `whenNotPaused` and `whenPaused` will be affected by the pause. Requirements: - The contract must be paused\"}},\"stateVariables\":{\"__gap\":{\"details\":\"Gap to allow adding variables in future upgrades\"}},\"title\":\"DataServicePausableUpgradeable contract\",\"version\":1},\"userdoc\":{\"errors\":{\"DataServicePausableNotPauseGuardian(address)\":[{\"notice\":\"Emitted when a the caller is not a pause guardian\"}],\"DataServicePausablePauseGuardianNoChange(address,bool)\":[{\"notice\":\"Emitted when a pause guardian is set to the same allowed status\"}],\"GraphDirectoryInvalidZeroAddress(bytes)\":[{\"notice\":\"Thrown when either the controller is the zero address or a contract address is not found on the controller\"}],\"ProvisionManagerInvalidRange(uint256,uint256)\":[{\"notice\":\"Thrown when attempting to set a range where min is greater than max.\"}],\"ProvisionManagerInvalidValue(bytes,uint256,uint256,uint256)\":[{\"notice\":\"Thrown when a provision parameter is out of range.\"}],\"ProvisionManagerNotAuthorized(address,address)\":[{\"notice\":\"Thrown when the caller is not authorized to manage the provision of a service provider.\"}],\"ProvisionManagerProvisionNotFound(address)\":[{\"notice\":\"Thrown when a provision is not found.\"}]},\"events\":{\"DelegationRatioSet(uint32)\":{\"notice\":\"Emitted when the delegation ratio is set.\"},\"GraphDirectoryInitialized(address,address,address,address,address,address,address,address,address,address)\":{\"notice\":\"Emitted when the GraphDirectory is initialized\"},\"PauseGuardianSet(address,bool)\":{\"notice\":\"Emitted when a pause guardian is set.\"},\"ProvisionPendingParametersAccepted(address)\":{\"notice\":\"Emitted when a service provider accepts a provision in {Graph Horizon staking contract}.\"},\"ProvisionTokensRangeSet(uint256,uint256)\":{\"notice\":\"Emitted when the provision tokens range is set.\"},\"ServicePaymentCollected(address,uint8,uint256)\":{\"notice\":\"Emitted when a service provider collects payment.\"},\"ServiceProviderRegistered(address,bytes)\":{\"notice\":\"Emitted when a service provider is registered with the data service.\"},\"ServiceProviderSlashed(address,uint256)\":{\"notice\":\"Emitted when a service provider is slashed.\"},\"ServiceStarted(address,bytes)\":{\"notice\":\"Emitted when a service provider starts providing the service.\"},\"ServiceStopped(address,bytes)\":{\"notice\":\"Emitted when a service provider stops providing the service.\"},\"ThawingPeriodRangeSet(uint64,uint64)\":{\"notice\":\"Emitted when the thawing period range is set.\"},\"VerifierCutRangeSet(uint32,uint32)\":{\"notice\":\"Emitted when the verifier cut range is set.\"}},\"kind\":\"user\",\"methods\":{\"acceptProvisionPendingParameters(address,bytes)\":{\"notice\":\"Accepts pending parameters in the provision of a service provider in the {Graph Horizon staking contract}.\"},\"collect(address,uint8,bytes)\":{\"notice\":\"Collects payment earnt by the service provider.\"},\"getDelegationRatio()\":{\"notice\":\"External getter for the delegation ratio\"},\"getProvisionTokensRange()\":{\"notice\":\"External getter for the provision tokens range\"},\"getThawingPeriodRange()\":{\"notice\":\"External getter for the thawing period range\"},\"getVerifierCutRange()\":{\"notice\":\"External getter for the verifier cut range\"},\"pause()\":{\"notice\":\"Pauses the data service.\"},\"pauseGuardians(address)\":{\"notice\":\"List of pause guardians and their allowed status\"},\"register(address,bytes)\":{\"notice\":\"Registers a service provider with the data service. The service provider can now start providing the service.\"},\"slash(address,bytes)\":{\"notice\":\"Slash a service provider for misbehaviour.\"},\"startService(address,bytes)\":{\"notice\":\"Service provider starts providing the service.\"},\"stopService(address,bytes)\":{\"notice\":\"Service provider stops providing the service.\"},\"unpause()\":{\"notice\":\"Unpauses the data service.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@graphprotocol/horizon/contracts/data-service/extensions/DataServicePausableUpgradeable.sol\":\"DataServicePausableUpgradeable\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10},\"remappings\":[]},\"sources\":{\"@graphprotocol/contracts/contracts/arbitrum/ITokenGateway.sol\":{\"keccak256\":\"0x3cbcc6e4629543a99acacc7ee4ffa6c063b9fb17d3597ccd2f9481008e3633bd\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://d6bb0bb830b67d579e57a261e5f5d9e90b32dc006b02badbecf1f6c82c0a5100\",\"dweb:/ipfs/Qmd38iNXZpinwbNRJPEAA8r9bmmtRwjTSK1SkmH47ge4kJ\"]},\"@graphprotocol/contracts/contracts/curation/ICuration.sol\":{\"keccak256\":\"0x17e4db429003cab08cd2859db94b95e0cee1f9478c1881903a4104def8fdc048\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://52ed58228a0e92aeb3493473a6e02f92d26a4e4eb0c46d38dd446e3bfcb6691e\",\"dweb:/ipfs/QmZzWxHAztdz2Q7cobqVEf4ExGpNuqWJFYgs2oHCgApjW6\"]},\"@graphprotocol/contracts/contracts/epochs/IEpochManager.sol\":{\"keccak256\":\"0x0f4b3a3569c023d2610d0d8b37b3ecb0b67f848d77aa063bb311756670017e85\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://df7c43568e554b301134aa2c58e4889ad0d3dcfec40e834b63621a43f39da154\",\"dweb:/ipfs/QmZeSV9AM6FKCkH9QYyF7i5nVggseEJXbvWbtrgUeXqQpo\"]},\"@graphprotocol/contracts/contracts/governance/IController.sol\":{\"keccak256\":\"0xe37df86cdea385d708ba00862cd9e04940e4f2aa50354fb3a9d2d4f505d5509a\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://0f6c9fd2b7a8c5a6b89ef12c7423144df04a5f251d5480be1b73c74a785ff12a\",\"dweb:/ipfs/QmYpiCQoxbDEYQ2FNA39Z4FGfoxfQ8jvH1Z3ccrqguQFMP\"]},\"@graphprotocol/contracts/contracts/rewards/IRewardsIssuer.sol\":{\"keccak256\":\"0xe049090c38a64d80b284ba2a7b440bcedba9804d96f2bb8da525e69ac452e03a\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://8b7d1186bd0698bed02d3504ac80c20e605087fba036d5ff392b39a9a3c818e5\",\"dweb:/ipfs/QmRgAfY1dD5rc7fLuuGVyu2mh9Z8qz1AVvuXAcRGnB3dSv\"]},\"@graphprotocol/contracts/contracts/rewards/IRewardsManager.sol\":{\"keccak256\":\"0xee4b213950c2e46481658b9b04f2d5dae0a96c4cce0ee346188b1f1272718d54\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://b26dd767bd6887666a18beef79c322d27a693a3a4f7a61dc6bded7f35796acf5\",\"dweb:/ipfs/QmXDeqmRSeAWUWQTknNLUPBDBnDr8ySYW4h6CBPRGMJoPp\"]},\"@graphprotocol/contracts/contracts/token/IGraphToken.sol\":{\"keccak256\":\"0x2ffad6798d641c8d1288730be725c43041c803caceaf6d9985122d000ad5761c\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://5f782a5670037fc9223dc20fd4f99c0277a9bec7d08f7800b0a0733e819a07cb\",\"dweb:/ipfs/QmP3K2QnmukScCh1nzgphYdg7AiAuTaT914jq4txLYNpra\"]},\"@graphprotocol/horizon/contracts/data-service/DataService.sol\":{\"keccak256\":\"0xa57fda8ea4c94a2cda061a6c8f29ae215241b0af03a43df3bc622051d8b2493c\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://7fc433ef0eb71c264224e9058de7e9aea3b2dbfab68dbdf0df8a13de82e90ef6\",\"dweb:/ipfs/QmVrp6kv8Ef1AP38C4soa1cnnRqqmKFnHer2VrXms52Asy\"]},\"@graphprotocol/horizon/contracts/data-service/DataServiceStorage.sol\":{\"keccak256\":\"0x615aac9d5c9cd04216fa9ee21c770f3877a2971a1c023052143c95c08b87610f\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://bd4eb031e9ab86e3a17df29fcb297621e88850c3c5db123925d24b77c802b037\",\"dweb:/ipfs/QmSCNfQqMzui9gaN3Rf8nTNJBPWSFNqFgexbK2k6GBN381\"]},\"@graphprotocol/horizon/contracts/data-service/extensions/DataServicePausableUpgradeable.sol\":{\"keccak256\":\"0x57790344249a2d9fac827173389665a678619103d3baba0df0f9ec72f514cba7\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://964b818fdefcaf55cfd1c8f7066c44032e8dc82f1569f35d875e86c147b94e23\",\"dweb:/ipfs/QmcsjNPCFbYPdLiTjmykgVSLXbZxA2pJ1N7JXaWtxJzZet\"]},\"@graphprotocol/horizon/contracts/data-service/interfaces/IDataService.sol\":{\"keccak256\":\"0x2208814f64eeca9409eafc1a1fa425c67ff38cffdffc3af0bafbe1c1b338ed32\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://925b32efbd9fe85a98f8f1f51e865e0b7b65d933196cf6c098bd670da7138e0c\",\"dweb:/ipfs/Qmdrp7BGJ4fEKzDgZpVY1FULXKsHAdGXkx4nqRrWvMaumr\"]},\"@graphprotocol/horizon/contracts/data-service/interfaces/IDataServicePausable.sol\":{\"keccak256\":\"0x6e65df59821dce2e4c9c221e1381eac69534464b8c69c83c2f18bff188e120f5\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://bd7f1d4d7b1d9de204580678f24fbe453235bbc1fbb15f65f022619a419b11a8\",\"dweb:/ipfs/QmP7JnK6Buor5bvRFcb427ACJKTwX6mnJb31TJzKL4EnSD\"]},\"@graphprotocol/horizon/contracts/data-service/utilities/ProvisionManager.sol\":{\"keccak256\":\"0x63e7f1df10586beb7f8683065719fbff045437508539a9358c25a13fcf989f91\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://b32f9a7be91ae6d9c9a6edbe2404efbcf9fa99c1d503f4a688054be468494a8e\",\"dweb:/ipfs/QmQ5AQXsBPxtJSW24LqRZAaYYaz1518FpUCHfDEdsMfF8F\"]},\"@graphprotocol/horizon/contracts/data-service/utilities/ProvisionManagerStorage.sol\":{\"keccak256\":\"0xe44f72a63c472a6de42e08a2d732044fe1ac9245c4203d4e1eb941b1a2fa2159\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://412708a4f94b5757e46676c5702e47d37fdbdacbe53f70e2ee93d37c5938e028\",\"dweb:/ipfs/Qmdw4uagDdKeCzyS319BKyPzfnWCvM3KCtNYosFBd3xGco\"]},\"@graphprotocol/horizon/contracts/interfaces/IGraphPayments.sol\":{\"keccak256\":\"0xa22dcc47676073113e4ebe30045065662cee5531f9c5f75776c00e70a1929c81\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://8908f30b3c7536798b14dc62fb5ccffc05570d568dbd1bade7c79c1fd2a4b5fe\",\"dweb:/ipfs/QmexZgb5mhDmXVZnYX1Z37cwM7EG2prYyBEVjUSVdKshVr\"]},\"@graphprotocol/horizon/contracts/interfaces/IGraphProxyAdmin.sol\":{\"keccak256\":\"0x4410253d7de56d2cdff50ee141c52fd77fd23f3984440211c3cc90ad560f4f9d\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://da4425a908816c40ffc3c833504843c3732bcb47e745dc544f650e5bc2c23f25\",\"dweb:/ipfs/QmZYDS4cSKBqRXEU3qyjE6sxGModSeNgzQmdZmZCGHuaKt\"]},\"@graphprotocol/horizon/contracts/interfaces/IHorizonStaking.sol\":{\"keccak256\":\"0x4b146f30ee66c4224cb5a82bafc8299f8596d8fe302e793757520f67bba8a166\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://30666c737d72a850223c1966d3b5d02b84f3f808f3c8dae8d0748731646b60c5\",\"dweb:/ipfs/QmQschyZQtU8tTnQ9hNiG5nobuXBx6KeiKdfxvZ4zvQ7ty\"]},\"@graphprotocol/horizon/contracts/interfaces/IPaymentsEscrow.sol\":{\"keccak256\":\"0x99e2a676b539e7b6c223a551f8cb9770c07435a25c8b22f0044a8ce4949edadc\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://f702a3cea214d8328d89a0ef16495c709e30fe13eb86fc29940159c9cb8c7bd5\",\"dweb:/ipfs/QmS25Zgcw85kDZcicApLzRmDcoYNQafpFdMyBEWX8eLWSX\"]},\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingBase.sol\":{\"keccak256\":\"0x9bdab6cb595eabd7d321d7beae03ad3607995c14ef40f0c2f349fb72084766c5\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://6cac2ca3580bd770b98b07b11ebb007e8a922a90cde920e6ec472df7e66fb512\",\"dweb:/ipfs/QmRw1rjT8D8gNp2GRTuwDETwHNHMpHKoHZq4pYBAn9i65F\"]},\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingExtension.sol\":{\"keccak256\":\"0x7923f39746198b5672f0e4d65b7bf14903ae5f7775d74b210effb957eea36c71\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://c29531aff69c71e649fb347d7117ea8c42fc8de09860a1c389ed9b8f097a34e0\",\"dweb:/ipfs/QmS89fww584HiyE1BdPe8Xaqbf5v7FEvL38GTxeHEAsLFm\"]},\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingMain.sol\":{\"keccak256\":\"0xd04bb1f6a427e858e8a625b4b9835c69c8891a324d22beba20293ab2a77e5de7\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://05c9e425eee0b6c109a8dad2edcf9e1c845c64fccf321edf804921394ee048be\",\"dweb:/ipfs/QmbwLWNof534oG5ohzNAWrjdQ5kqJs7M5d5kCRd68XUogB\"]},\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingTypes.sol\":{\"keccak256\":\"0xaaeb9770f8aaae6b395e87bb1876a10fe7c14384d16d97dd33a671c3ea53aa7b\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://8f5c019fdb2df73bafe464fb6e9da792f7833a0c1858734bcd6a6b8d6ae924c7\",\"dweb:/ipfs/QmcubeYTHCYBqQsRncBFpPFtk7JzRz4nFh27LUW1m4hx2K\"]},\"@graphprotocol/horizon/contracts/libraries/LinkedList.sol\":{\"keccak256\":\"0x99058b4da0428b8d9c22d3d112acbaa59900f1fd0a434038b1a4fccfe3c678d6\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://568e03231c6081eacbcb6585a05c0b1bb976b640b611f7bf6155f9b58d887239\",\"dweb:/ipfs/QmdPZQWhkhjf5TUwz487Dwm4ycjX323iNdwb1sQnAiA1Qu\"]},\"@graphprotocol/horizon/contracts/libraries/PPMMath.sol\":{\"keccak256\":\"0xe7fcfd44d2919944b79a11a39da7d4539d49c4bcf510071a59f6b41c37ee8ef2\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://a21b1ff7ca81fa07f153b60aeca136bd1ee57d9d01a2c76635e4a5602e8959fc\",\"dweb:/ipfs/QmQ5C7mUjt4sv1NBt1FH5XVHN3aBsHnvDsdJKWywhLjso8\"]},\"@graphprotocol/horizon/contracts/libraries/UintRange.sol\":{\"keccak256\":\"0x70d69069b2c122becd29ec4ea9a79f2e26cf7cbe7b1918ffced691ee00cdbd82\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://6bddc7d257c3df1fd4940dd3c554e5a1efbc1b23d50f7878415389b75380628c\",\"dweb:/ipfs/QmTQBCsL4pHoXMixVvDwGMdmJnGfEeeDZfHdJkcpKamu58\"]},\"@graphprotocol/horizon/contracts/utilities/GraphDirectory.sol\":{\"keccak256\":\"0x1d09be2f7454873ab80f86ed5d590b9e796fe5146977c4c4a5b1f7ead17eb522\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://e1c7539d26f069c2acabd404601e7811f8878f66976e8b5d4f5438195de793c2\",\"dweb:/ipfs/QmUAybvtDZ275kAnU6r81aQy1FCp7zLscSV87oe9nbwjyU\"]},\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"keccak256\":\"0xdb4d24ee2c087c391d587cd17adfe5b3f9d93b3110b1388c2ab6c7c0ad1dcd05\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://ab7b6d5b9e2b88176312967fe0f0e78f3d9a1422fa5e4b64e2440c35869b5d08\",\"dweb:/ipfs/QmXKYWWyzcLg1B2k7Sb1qkEXgLCYfXecR9wYW5obRzWP1Q\"]},\"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol\":{\"keccak256\":\"0xdbef5f0c787055227243a7318ef74c8a5a1108ca3a07f2b3a00ef67769e1e397\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://08e39f23d5b4692f9a40803e53a8156b72b4c1f9902a88cd65ba964db103dab9\",\"dweb:/ipfs/QmPKn6EYDgpga7KtpkA8wV2yJCYGMtc9K4LkJfhKX2RVSV\"]},\"@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol\":{\"keccak256\":\"0xa6bf6b7efe0e6625a9dcd30c5ddf52c4c24fe8372f37c7de9dbf5034746768d5\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://8c353ee3705bbf6fadb84c0fb10ef1b736e8ca3ca1867814349d1487ed207beb\",\"dweb:/ipfs/QmcugaPssrzGGE8q4YZKm2ZhnD3kCijjcgdWWg76nWt3FY\"]},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0xe06a3f08a987af6ad2e1c1e774405d4fe08f1694b67517438b467cecf0da0ef7\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://df6f0c459663c9858b6cba2cda1d14a7d05a985bed6d2de72bd8e78c25ee79db\",\"dweb:/ipfs/QmeTTxZ7qVk9rjEv2R4CpCwdf8UMCcRqDNMvzNxHc3Fnn9\"]}},\"version\":1}" + } + }, + "@graphprotocol/horizon/contracts/data-service/interfaces/IDataService.sol": { + "IDataService": { + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + } + ], + "name": "ProvisionPendingParametersAccepted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "feeType", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "ServicePaymentCollected", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "ServiceProviderRegistered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "ServiceProviderSlashed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "ServiceStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "ServiceStopped", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "acceptProvisionPendingParameters", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "feeType", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "collect", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getDelegationRatio", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getProvisionTokensRange", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getThawingPeriodRange", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getVerifierCutRange", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "register", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "slash", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "startService", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "stopService", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "evm": { + "bytecode": { + "functionDebugData": {}, + "generatedSources": [], + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "deployedBytecode": { + "functionDebugData": {}, + "generatedSources": [], + "immutableReferences": {}, + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "methodIdentifiers": { + "acceptProvisionPendingParameters(address,bytes)": "ce0fc0cc", + "collect(address,uint8,bytes)": "b15d2a2c", + "getDelegationRatio()": "1ebb7c30", + "getProvisionTokensRange()": "819ba366", + "getThawingPeriodRange()": "71ce020a", + "getVerifierCutRange()": "482468b7", + "register(address,bytes)": "24b8fbf6", + "slash(address,bytes)": "cb8347fe", + "startService(address,bytes)": "dedf6726", + "stopService(address,bytes)": "8180083b" + } + }, + "metadata": "{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"}],\"name\":\"ProvisionPendingParametersAccepted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"enum IGraphPayments.PaymentTypes\",\"name\":\"feeType\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"ServicePaymentCollected\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"ServiceProviderRegistered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"ServiceProviderSlashed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"ServiceStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"ServiceStopped\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"acceptProvisionPendingParameters\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"enum IGraphPayments.PaymentTypes\",\"name\":\"feeType\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"collect\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getDelegationRatio\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getProvisionTokensRange\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getThawingPeriodRange\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getVerifierCutRange\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"register\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"slash\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"startService\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"stopService\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"custom:security-contact\":\"Please email security+contracts@thegraph.com if you find any bugs. We may have an active bug bounty program.\",\"details\":\"This interface is expected to be inherited and extended by a data service interface. It can be used to interact with it however it's advised to use the more specific parent interface.\",\"events\":{\"ProvisionPendingParametersAccepted(address)\":{\"params\":{\"serviceProvider\":\"The address of the service provider.\"}},\"ServicePaymentCollected(address,uint8,uint256)\":{\"params\":{\"feeType\":\"The type of fee to collect as defined in {GraphPayments}.\",\"serviceProvider\":\"The address of the service provider.\",\"tokens\":\"The amount of tokens collected.\"}},\"ServiceProviderRegistered(address,bytes)\":{\"params\":{\"data\":\"Custom data, usage defined by the data service.\",\"serviceProvider\":\"The address of the service provider.\"}},\"ServiceProviderSlashed(address,uint256)\":{\"params\":{\"serviceProvider\":\"The address of the service provider.\",\"tokens\":\"The amount of tokens slashed.\"}},\"ServiceStarted(address,bytes)\":{\"params\":{\"data\":\"Custom data, usage defined by the data service.\",\"serviceProvider\":\"The address of the service provider.\"}},\"ServiceStopped(address,bytes)\":{\"params\":{\"data\":\"Custom data, usage defined by the data service.\",\"serviceProvider\":\"The address of the service provider.\"}}},\"kind\":\"dev\",\"methods\":{\"acceptProvisionPendingParameters(address,bytes)\":{\"details\":\"Provides a way for the data service to validate and accept provision parameter changes. Call {_acceptProvision}. Emits a {ProvisionPendingParametersAccepted} event.\",\"params\":{\"data\":\"Custom data, usage defined by the data service.\",\"serviceProvider\":\"The address of the service provider.\"}},\"collect(address,uint8,bytes)\":{\"details\":\"The implementation of this function is expected to interact with {GraphPayments} to collect payment from the service payer, which is done via {IGraphPayments-collect}. Emits a {ServicePaymentCollected} event. NOTE: Data services that are vetted by the Graph Council might qualify for a portion of protocol issuance to cover for these payments. In this case, the funds are taken by interacting with the rewards manager contract instead of the {GraphPayments} contract.\",\"params\":{\"data\":\"Custom data, usage defined by the data service.\",\"feeType\":\"The type of fee to collect as defined in {GraphPayments}.\",\"serviceProvider\":\"The address of the service provider.\"},\"returns\":{\"_0\":\"The amount of tokens collected.\"}},\"getDelegationRatio()\":{\"returns\":{\"_0\":\"The delegation ratio\"}},\"getProvisionTokensRange()\":{\"returns\":{\"_0\":\"Minimum provision tokens allowed\",\"_1\":\"Maximum provision tokens allowed\"}},\"getThawingPeriodRange()\":{\"returns\":{\"_0\":\"Minimum thawing period allowed\",\"_1\":\"Maximum thawing period allowed\"}},\"getVerifierCutRange()\":{\"returns\":{\"_0\":\"Minimum verifier cut allowed\",\"_1\":\"Maximum verifier cut allowed\"}},\"register(address,bytes)\":{\"details\":\"Before registering, the service provider must have created a provision in the Graph Horizon staking contract with parameters that are compatible with the data service. Verifies provision parameters and rejects registration in the event they are not valid. Emits a {ServiceProviderRegistered} event. NOTE: Failing to accept the provision will result in the service provider operating on an unverified provision. Depending on of the data service this can be a security risk as the protocol won't be able to guarantee economic security for the consumer.\",\"params\":{\"data\":\"Custom data, usage defined by the data service.\",\"serviceProvider\":\"The address of the service provider.\"}},\"slash(address,bytes)\":{\"details\":\"To slash the service provider's provision the function should call {Staking-slash}. Emits a {ServiceProviderSlashed} event.\",\"params\":{\"data\":\"Custom data, usage defined by the data service.\",\"serviceProvider\":\"The address of the service provider.\"}},\"startService(address,bytes)\":{\"details\":\"Emits a {ServiceStarted} event.\",\"params\":{\"data\":\"Custom data, usage defined by the data service.\",\"serviceProvider\":\"The address of the service provider.\"}},\"stopService(address,bytes)\":{\"details\":\"Emits a {ServiceStopped} event.\",\"params\":{\"data\":\"Custom data, usage defined by the data service.\",\"serviceProvider\":\"The address of the service provider.\"}}},\"title\":\"Interface of the base {DataService} contract as defined by the Graph Horizon specification.\",\"version\":1},\"userdoc\":{\"events\":{\"ProvisionPendingParametersAccepted(address)\":{\"notice\":\"Emitted when a service provider accepts a provision in {Graph Horizon staking contract}.\"},\"ServicePaymentCollected(address,uint8,uint256)\":{\"notice\":\"Emitted when a service provider collects payment.\"},\"ServiceProviderRegistered(address,bytes)\":{\"notice\":\"Emitted when a service provider is registered with the data service.\"},\"ServiceProviderSlashed(address,uint256)\":{\"notice\":\"Emitted when a service provider is slashed.\"},\"ServiceStarted(address,bytes)\":{\"notice\":\"Emitted when a service provider starts providing the service.\"},\"ServiceStopped(address,bytes)\":{\"notice\":\"Emitted when a service provider stops providing the service.\"}},\"kind\":\"user\",\"methods\":{\"acceptProvisionPendingParameters(address,bytes)\":{\"notice\":\"Accepts pending parameters in the provision of a service provider in the {Graph Horizon staking contract}.\"},\"collect(address,uint8,bytes)\":{\"notice\":\"Collects payment earnt by the service provider.\"},\"getDelegationRatio()\":{\"notice\":\"External getter for the delegation ratio\"},\"getProvisionTokensRange()\":{\"notice\":\"External getter for the provision tokens range\"},\"getThawingPeriodRange()\":{\"notice\":\"External getter for the thawing period range\"},\"getVerifierCutRange()\":{\"notice\":\"External getter for the verifier cut range\"},\"register(address,bytes)\":{\"notice\":\"Registers a service provider with the data service. The service provider can now start providing the service.\"},\"slash(address,bytes)\":{\"notice\":\"Slash a service provider for misbehaviour.\"},\"startService(address,bytes)\":{\"notice\":\"Service provider starts providing the service.\"},\"stopService(address,bytes)\":{\"notice\":\"Service provider stops providing the service.\"}},\"notice\":\"This interface provides a guardrail for contracts that use the Data Service framework to implement a data service on Graph Horizon. Much of the specification is intentionally loose to allow for greater flexibility when designing a data service. It's not possible to guarantee that an implementation will honor the Data Service framework guidelines so it's advised to always review the implementation code and the documentation.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"@graphprotocol/horizon/contracts/data-service/interfaces/IDataService.sol\":\"IDataService\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10},\"remappings\":[]},\"sources\":{\"@graphprotocol/horizon/contracts/data-service/interfaces/IDataService.sol\":{\"keccak256\":\"0x2208814f64eeca9409eafc1a1fa425c67ff38cffdffc3af0bafbe1c1b338ed32\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://925b32efbd9fe85a98f8f1f51e865e0b7b65d933196cf6c098bd670da7138e0c\",\"dweb:/ipfs/Qmdrp7BGJ4fEKzDgZpVY1FULXKsHAdGXkx4nqRrWvMaumr\"]},\"@graphprotocol/horizon/contracts/interfaces/IGraphPayments.sol\":{\"keccak256\":\"0xa22dcc47676073113e4ebe30045065662cee5531f9c5f75776c00e70a1929c81\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://8908f30b3c7536798b14dc62fb5ccffc05570d568dbd1bade7c79c1fd2a4b5fe\",\"dweb:/ipfs/QmexZgb5mhDmXVZnYX1Z37cwM7EG2prYyBEVjUSVdKshVr\"]}},\"version\":1}" + } + }, + "@graphprotocol/horizon/contracts/data-service/interfaces/IDataServiceFees.sol": { + "IDataServiceFees": { + "abi": [ + { + "inputs": [ + { + "internalType": "bytes32", + "name": "claimId", + "type": "bytes32" + } + ], + "name": "DataServiceFeesClaimNotFound", + "type": "error" + }, + { + "inputs": [], + "name": "DataServiceFeesZeroTokens", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + } + ], + "name": "ProvisionPendingParametersAccepted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "feeType", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "ServicePaymentCollected", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "ServiceProviderRegistered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "ServiceProviderSlashed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "ServiceStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "ServiceStopped", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "claimId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "unlockTimestamp", + "type": "uint256" + } + ], + "name": "StakeClaimLocked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "claimId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "releasableAt", + "type": "uint256" + } + ], + "name": "StakeClaimReleased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "claimsCount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensReleased", + "type": "uint256" + } + ], + "name": "StakeClaimsReleased", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "acceptProvisionPendingParameters", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "feeType", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "collect", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getDelegationRatio", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getProvisionTokensRange", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getThawingPeriodRange", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getVerifierCutRange", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "register", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "numClaimsToRelease", + "type": "uint256" + } + ], + "name": "releaseStake", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "slash", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "startService", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "stopService", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "evm": { + "bytecode": { + "functionDebugData": {}, + "generatedSources": [], + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "deployedBytecode": { + "functionDebugData": {}, + "generatedSources": [], + "immutableReferences": {}, + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "methodIdentifiers": { + "acceptProvisionPendingParameters(address,bytes)": "ce0fc0cc", + "collect(address,uint8,bytes)": "b15d2a2c", + "getDelegationRatio()": "1ebb7c30", + "getProvisionTokensRange()": "819ba366", + "getThawingPeriodRange()": "71ce020a", + "getVerifierCutRange()": "482468b7", + "register(address,bytes)": "24b8fbf6", + "releaseStake(uint256)": "45f54485", + "slash(address,bytes)": "cb8347fe", + "startService(address,bytes)": "dedf6726", + "stopService(address,bytes)": "8180083b" + } + }, + "metadata": "{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"claimId\",\"type\":\"bytes32\"}],\"name\":\"DataServiceFeesClaimNotFound\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DataServiceFeesZeroTokens\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"}],\"name\":\"ProvisionPendingParametersAccepted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"enum IGraphPayments.PaymentTypes\",\"name\":\"feeType\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"ServicePaymentCollected\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"ServiceProviderRegistered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"ServiceProviderSlashed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"ServiceStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"ServiceStopped\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"claimId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"unlockTimestamp\",\"type\":\"uint256\"}],\"name\":\"StakeClaimLocked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"claimId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"releasableAt\",\"type\":\"uint256\"}],\"name\":\"StakeClaimReleased\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"claimsCount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokensReleased\",\"type\":\"uint256\"}],\"name\":\"StakeClaimsReleased\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"acceptProvisionPendingParameters\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"enum IGraphPayments.PaymentTypes\",\"name\":\"feeType\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"collect\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getDelegationRatio\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getProvisionTokensRange\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getThawingPeriodRange\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getVerifierCutRange\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"register\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"numClaimsToRelease\",\"type\":\"uint256\"}],\"name\":\"releaseStake\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"slash\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"startService\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"stopService\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"custom:security-contact\":\"Please email security+contracts@thegraph.com if you find any bugs. We may have an active bug bounty program.\",\"details\":\"Note that this implementation uses the entire provisioned stake as collateral for the payment. It can be used to provide economic security for the payments collected as long as the provisioned stake is not being used for other purposes.\",\"errors\":{\"DataServiceFeesClaimNotFound(bytes32)\":[{\"params\":{\"claimId\":\"The id of the stake claim\"}}]},\"events\":{\"ProvisionPendingParametersAccepted(address)\":{\"params\":{\"serviceProvider\":\"The address of the service provider.\"}},\"ServicePaymentCollected(address,uint8,uint256)\":{\"params\":{\"feeType\":\"The type of fee to collect as defined in {GraphPayments}.\",\"serviceProvider\":\"The address of the service provider.\",\"tokens\":\"The amount of tokens collected.\"}},\"ServiceProviderRegistered(address,bytes)\":{\"params\":{\"data\":\"Custom data, usage defined by the data service.\",\"serviceProvider\":\"The address of the service provider.\"}},\"ServiceProviderSlashed(address,uint256)\":{\"params\":{\"serviceProvider\":\"The address of the service provider.\",\"tokens\":\"The amount of tokens slashed.\"}},\"ServiceStarted(address,bytes)\":{\"params\":{\"data\":\"Custom data, usage defined by the data service.\",\"serviceProvider\":\"The address of the service provider.\"}},\"ServiceStopped(address,bytes)\":{\"params\":{\"data\":\"Custom data, usage defined by the data service.\",\"serviceProvider\":\"The address of the service provider.\"}},\"StakeClaimLocked(address,bytes32,uint256,uint256)\":{\"params\":{\"claimId\":\"The id of the stake claim\",\"serviceProvider\":\"The address of the service provider\",\"tokens\":\"The amount of tokens to lock in the claim\",\"unlockTimestamp\":\"The timestamp when the tokens can be released\"}},\"StakeClaimReleased(address,bytes32,uint256,uint256)\":{\"params\":{\"claimId\":\"The id of the stake claim\",\"releasableAt\":\"The timestamp when the tokens were released\",\"serviceProvider\":\"The address of the service provider\",\"tokens\":\"The amount of tokens released\"}},\"StakeClaimsReleased(address,uint256,uint256)\":{\"params\":{\"claimsCount\":\"The number of stake claims being released\",\"serviceProvider\":\"The address of the service provider\",\"tokensReleased\":\"The total amount of tokens being released\"}}},\"kind\":\"dev\",\"methods\":{\"acceptProvisionPendingParameters(address,bytes)\":{\"details\":\"Provides a way for the data service to validate and accept provision parameter changes. Call {_acceptProvision}. Emits a {ProvisionPendingParametersAccepted} event.\",\"params\":{\"data\":\"Custom data, usage defined by the data service.\",\"serviceProvider\":\"The address of the service provider.\"}},\"collect(address,uint8,bytes)\":{\"details\":\"The implementation of this function is expected to interact with {GraphPayments} to collect payment from the service payer, which is done via {IGraphPayments-collect}. Emits a {ServicePaymentCollected} event. NOTE: Data services that are vetted by the Graph Council might qualify for a portion of protocol issuance to cover for these payments. In this case, the funds are taken by interacting with the rewards manager contract instead of the {GraphPayments} contract.\",\"params\":{\"data\":\"Custom data, usage defined by the data service.\",\"feeType\":\"The type of fee to collect as defined in {GraphPayments}.\",\"serviceProvider\":\"The address of the service provider.\"},\"returns\":{\"_0\":\"The amount of tokens collected.\"}},\"getDelegationRatio()\":{\"returns\":{\"_0\":\"The delegation ratio\"}},\"getProvisionTokensRange()\":{\"returns\":{\"_0\":\"Minimum provision tokens allowed\",\"_1\":\"Maximum provision tokens allowed\"}},\"getThawingPeriodRange()\":{\"returns\":{\"_0\":\"Minimum thawing period allowed\",\"_1\":\"Maximum thawing period allowed\"}},\"getVerifierCutRange()\":{\"returns\":{\"_0\":\"Minimum verifier cut allowed\",\"_1\":\"Maximum verifier cut allowed\"}},\"register(address,bytes)\":{\"details\":\"Before registering, the service provider must have created a provision in the Graph Horizon staking contract with parameters that are compatible with the data service. Verifies provision parameters and rejects registration in the event they are not valid. Emits a {ServiceProviderRegistered} event. NOTE: Failing to accept the provision will result in the service provider operating on an unverified provision. Depending on of the data service this can be a security risk as the protocol won't be able to guarantee economic security for the consumer.\",\"params\":{\"data\":\"Custom data, usage defined by the data service.\",\"serviceProvider\":\"The address of the service provider.\"}},\"releaseStake(uint256)\":{\"details\":\"This function is only meant to be called if the service provider has enough stake claims that releasing them all at once would exceed the block gas limit.This function can be overriden and/or disabled.Emits a {StakeClaimsReleased} event, and a {StakeClaimReleased} event for each claim released.\",\"params\":{\"numClaimsToRelease\":\"Amount of stake claims to process. If 0, all stake claims are processed.\"}},\"slash(address,bytes)\":{\"details\":\"To slash the service provider's provision the function should call {Staking-slash}. Emits a {ServiceProviderSlashed} event.\",\"params\":{\"data\":\"Custom data, usage defined by the data service.\",\"serviceProvider\":\"The address of the service provider.\"}},\"startService(address,bytes)\":{\"details\":\"Emits a {ServiceStarted} event.\",\"params\":{\"data\":\"Custom data, usage defined by the data service.\",\"serviceProvider\":\"The address of the service provider.\"}},\"stopService(address,bytes)\":{\"details\":\"Emits a {ServiceStopped} event.\",\"params\":{\"data\":\"Custom data, usage defined by the data service.\",\"serviceProvider\":\"The address of the service provider.\"}}},\"title\":\"Interface for the {DataServiceFees} contract.\",\"version\":1},\"userdoc\":{\"errors\":{\"DataServiceFeesClaimNotFound(bytes32)\":[{\"notice\":\"Thrown when attempting to get a stake claim that does not exist.\"}],\"DataServiceFeesZeroTokens()\":[{\"notice\":\"Emitted when trying to lock zero tokens in a stake claim\"}]},\"events\":{\"ProvisionPendingParametersAccepted(address)\":{\"notice\":\"Emitted when a service provider accepts a provision in {Graph Horizon staking contract}.\"},\"ServicePaymentCollected(address,uint8,uint256)\":{\"notice\":\"Emitted when a service provider collects payment.\"},\"ServiceProviderRegistered(address,bytes)\":{\"notice\":\"Emitted when a service provider is registered with the data service.\"},\"ServiceProviderSlashed(address,uint256)\":{\"notice\":\"Emitted when a service provider is slashed.\"},\"ServiceStarted(address,bytes)\":{\"notice\":\"Emitted when a service provider starts providing the service.\"},\"ServiceStopped(address,bytes)\":{\"notice\":\"Emitted when a service provider stops providing the service.\"},\"StakeClaimLocked(address,bytes32,uint256,uint256)\":{\"notice\":\"Emitted when a stake claim is created and stake is locked.\"},\"StakeClaimReleased(address,bytes32,uint256,uint256)\":{\"notice\":\"Emitted when a stake claim is released and stake is unlocked.\"},\"StakeClaimsReleased(address,uint256,uint256)\":{\"notice\":\"Emitted when a series of stake claims are released.\"}},\"kind\":\"user\",\"methods\":{\"acceptProvisionPendingParameters(address,bytes)\":{\"notice\":\"Accepts pending parameters in the provision of a service provider in the {Graph Horizon staking contract}.\"},\"collect(address,uint8,bytes)\":{\"notice\":\"Collects payment earnt by the service provider.\"},\"getDelegationRatio()\":{\"notice\":\"External getter for the delegation ratio\"},\"getProvisionTokensRange()\":{\"notice\":\"External getter for the provision tokens range\"},\"getThawingPeriodRange()\":{\"notice\":\"External getter for the thawing period range\"},\"getVerifierCutRange()\":{\"notice\":\"External getter for the verifier cut range\"},\"register(address,bytes)\":{\"notice\":\"Registers a service provider with the data service. The service provider can now start providing the service.\"},\"releaseStake(uint256)\":{\"notice\":\"Releases expired stake claims for the caller.\"},\"slash(address,bytes)\":{\"notice\":\"Slash a service provider for misbehaviour.\"},\"startService(address,bytes)\":{\"notice\":\"Service provider starts providing the service.\"},\"stopService(address,bytes)\":{\"notice\":\"Service provider stops providing the service.\"}},\"notice\":\"Extension for the {IDataService} contract to handle payment collateralization using a Horizon provision. It's designed to be used with the Data Service framework: - When a service provider collects payment with {IDataService.collect} the data service should lock stake to back the payment using {_lockStake}. - Every time there is a payment collection with {IDataService.collect}, the data service should attempt to release any expired stake claims by calling {_releaseStake}. - Stake claims can also be manually released by calling {releaseStake} directly.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"@graphprotocol/horizon/contracts/data-service/interfaces/IDataServiceFees.sol\":\"IDataServiceFees\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10},\"remappings\":[]},\"sources\":{\"@graphprotocol/horizon/contracts/data-service/interfaces/IDataService.sol\":{\"keccak256\":\"0x2208814f64eeca9409eafc1a1fa425c67ff38cffdffc3af0bafbe1c1b338ed32\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://925b32efbd9fe85a98f8f1f51e865e0b7b65d933196cf6c098bd670da7138e0c\",\"dweb:/ipfs/Qmdrp7BGJ4fEKzDgZpVY1FULXKsHAdGXkx4nqRrWvMaumr\"]},\"@graphprotocol/horizon/contracts/data-service/interfaces/IDataServiceFees.sol\":{\"keccak256\":\"0x1b82ae2785502fe62d3ca6f55a3ed836b8b038a3b929cced92e1c6b4733f4074\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://5556b2ce53b604427a995fb50f7169acb3fe30f60ef19c7cb5c22bd5ec53177c\",\"dweb:/ipfs/QmXx7dmTeAYAMPbbrGrcsKT31dqEqbcFgXWaPS6LQrANru\"]},\"@graphprotocol/horizon/contracts/interfaces/IGraphPayments.sol\":{\"keccak256\":\"0xa22dcc47676073113e4ebe30045065662cee5531f9c5f75776c00e70a1929c81\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://8908f30b3c7536798b14dc62fb5ccffc05570d568dbd1bade7c79c1fd2a4b5fe\",\"dweb:/ipfs/QmexZgb5mhDmXVZnYX1Z37cwM7EG2prYyBEVjUSVdKshVr\"]}},\"version\":1}" + } + }, + "@graphprotocol/horizon/contracts/data-service/interfaces/IDataServicePausable.sol": { + "IDataServicePausable": { + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "DataServicePausableNotPauseGuardian", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "DataServicePausablePauseGuardianNoChange", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "PauseGuardianSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + } + ], + "name": "ProvisionPendingParametersAccepted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "feeType", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "ServicePaymentCollected", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "ServiceProviderRegistered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "ServiceProviderSlashed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "ServiceStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "ServiceStopped", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "acceptProvisionPendingParameters", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "feeType", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "collect", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getDelegationRatio", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getProvisionTokensRange", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getThawingPeriodRange", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getVerifierCutRange", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "register", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "slash", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "startService", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "stopService", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "unpause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "evm": { + "bytecode": { + "functionDebugData": {}, + "generatedSources": [], + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "deployedBytecode": { + "functionDebugData": {}, + "generatedSources": [], + "immutableReferences": {}, + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "methodIdentifiers": { + "acceptProvisionPendingParameters(address,bytes)": "ce0fc0cc", + "collect(address,uint8,bytes)": "b15d2a2c", + "getDelegationRatio()": "1ebb7c30", + "getProvisionTokensRange()": "819ba366", + "getThawingPeriodRange()": "71ce020a", + "getVerifierCutRange()": "482468b7", + "pause()": "8456cb59", + "register(address,bytes)": "24b8fbf6", + "slash(address,bytes)": "cb8347fe", + "startService(address,bytes)": "dedf6726", + "stopService(address,bytes)": "8180083b", + "unpause()": "3f4ba83a" + } + }, + "metadata": "{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"DataServicePausableNotPauseGuardian\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"}],\"name\":\"DataServicePausablePauseGuardianNoChange\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"}],\"name\":\"PauseGuardianSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"}],\"name\":\"ProvisionPendingParametersAccepted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"enum IGraphPayments.PaymentTypes\",\"name\":\"feeType\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"ServicePaymentCollected\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"ServiceProviderRegistered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"ServiceProviderSlashed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"ServiceStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"ServiceStopped\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"acceptProvisionPendingParameters\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"enum IGraphPayments.PaymentTypes\",\"name\":\"feeType\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"collect\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getDelegationRatio\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getProvisionTokensRange\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getThawingPeriodRange\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getVerifierCutRange\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"register\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"slash\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"startService\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"stopService\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unpause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"custom:security-contact\":\"Please email security+contracts@thegraph.com if you find any bugs. We may have an active bug bounty program.\",\"errors\":{\"DataServicePausableNotPauseGuardian(address)\":[{\"params\":{\"account\":\"The address of the pause guardian\"}}],\"DataServicePausablePauseGuardianNoChange(address,bool)\":[{\"params\":{\"account\":\"The address of the pause guardian\",\"allowed\":\"The allowed status of the pause guardian\"}}]},\"events\":{\"PauseGuardianSet(address,bool)\":{\"params\":{\"account\":\"The address of the pause guardian\",\"allowed\":\"The allowed status of the pause guardian\"}},\"ProvisionPendingParametersAccepted(address)\":{\"params\":{\"serviceProvider\":\"The address of the service provider.\"}},\"ServicePaymentCollected(address,uint8,uint256)\":{\"params\":{\"feeType\":\"The type of fee to collect as defined in {GraphPayments}.\",\"serviceProvider\":\"The address of the service provider.\",\"tokens\":\"The amount of tokens collected.\"}},\"ServiceProviderRegistered(address,bytes)\":{\"params\":{\"data\":\"Custom data, usage defined by the data service.\",\"serviceProvider\":\"The address of the service provider.\"}},\"ServiceProviderSlashed(address,uint256)\":{\"params\":{\"serviceProvider\":\"The address of the service provider.\",\"tokens\":\"The amount of tokens slashed.\"}},\"ServiceStarted(address,bytes)\":{\"params\":{\"data\":\"Custom data, usage defined by the data service.\",\"serviceProvider\":\"The address of the service provider.\"}},\"ServiceStopped(address,bytes)\":{\"params\":{\"data\":\"Custom data, usage defined by the data service.\",\"serviceProvider\":\"The address of the service provider.\"}}},\"kind\":\"dev\",\"methods\":{\"acceptProvisionPendingParameters(address,bytes)\":{\"details\":\"Provides a way for the data service to validate and accept provision parameter changes. Call {_acceptProvision}. Emits a {ProvisionPendingParametersAccepted} event.\",\"params\":{\"data\":\"Custom data, usage defined by the data service.\",\"serviceProvider\":\"The address of the service provider.\"}},\"collect(address,uint8,bytes)\":{\"details\":\"The implementation of this function is expected to interact with {GraphPayments} to collect payment from the service payer, which is done via {IGraphPayments-collect}. Emits a {ServicePaymentCollected} event. NOTE: Data services that are vetted by the Graph Council might qualify for a portion of protocol issuance to cover for these payments. In this case, the funds are taken by interacting with the rewards manager contract instead of the {GraphPayments} contract.\",\"params\":{\"data\":\"Custom data, usage defined by the data service.\",\"feeType\":\"The type of fee to collect as defined in {GraphPayments}.\",\"serviceProvider\":\"The address of the service provider.\"},\"returns\":{\"_0\":\"The amount of tokens collected.\"}},\"getDelegationRatio()\":{\"returns\":{\"_0\":\"The delegation ratio\"}},\"getProvisionTokensRange()\":{\"returns\":{\"_0\":\"Minimum provision tokens allowed\",\"_1\":\"Maximum provision tokens allowed\"}},\"getThawingPeriodRange()\":{\"returns\":{\"_0\":\"Minimum thawing period allowed\",\"_1\":\"Maximum thawing period allowed\"}},\"getVerifierCutRange()\":{\"returns\":{\"_0\":\"Minimum verifier cut allowed\",\"_1\":\"Maximum verifier cut allowed\"}},\"pause()\":{\"details\":\"Note that only functions using the modifiers `whenNotPaused` and `whenPaused` will be affected by the pause. Requirements: - The contract must not be already paused\"},\"register(address,bytes)\":{\"details\":\"Before registering, the service provider must have created a provision in the Graph Horizon staking contract with parameters that are compatible with the data service. Verifies provision parameters and rejects registration in the event they are not valid. Emits a {ServiceProviderRegistered} event. NOTE: Failing to accept the provision will result in the service provider operating on an unverified provision. Depending on of the data service this can be a security risk as the protocol won't be able to guarantee economic security for the consumer.\",\"params\":{\"data\":\"Custom data, usage defined by the data service.\",\"serviceProvider\":\"The address of the service provider.\"}},\"slash(address,bytes)\":{\"details\":\"To slash the service provider's provision the function should call {Staking-slash}. Emits a {ServiceProviderSlashed} event.\",\"params\":{\"data\":\"Custom data, usage defined by the data service.\",\"serviceProvider\":\"The address of the service provider.\"}},\"startService(address,bytes)\":{\"details\":\"Emits a {ServiceStarted} event.\",\"params\":{\"data\":\"Custom data, usage defined by the data service.\",\"serviceProvider\":\"The address of the service provider.\"}},\"stopService(address,bytes)\":{\"details\":\"Emits a {ServiceStopped} event.\",\"params\":{\"data\":\"Custom data, usage defined by the data service.\",\"serviceProvider\":\"The address of the service provider.\"}},\"unpause()\":{\"details\":\"Note that only functions using the modifiers `whenNotPaused` and `whenPaused` will be affected by the pause. Requirements: - The contract must be paused\"}},\"title\":\"Interface for the {DataServicePausable} contract.\",\"version\":1},\"userdoc\":{\"errors\":{\"DataServicePausableNotPauseGuardian(address)\":[{\"notice\":\"Emitted when a the caller is not a pause guardian\"}],\"DataServicePausablePauseGuardianNoChange(address,bool)\":[{\"notice\":\"Emitted when a pause guardian is set to the same allowed status\"}]},\"events\":{\"PauseGuardianSet(address,bool)\":{\"notice\":\"Emitted when a pause guardian is set.\"},\"ProvisionPendingParametersAccepted(address)\":{\"notice\":\"Emitted when a service provider accepts a provision in {Graph Horizon staking contract}.\"},\"ServicePaymentCollected(address,uint8,uint256)\":{\"notice\":\"Emitted when a service provider collects payment.\"},\"ServiceProviderRegistered(address,bytes)\":{\"notice\":\"Emitted when a service provider is registered with the data service.\"},\"ServiceProviderSlashed(address,uint256)\":{\"notice\":\"Emitted when a service provider is slashed.\"},\"ServiceStarted(address,bytes)\":{\"notice\":\"Emitted when a service provider starts providing the service.\"},\"ServiceStopped(address,bytes)\":{\"notice\":\"Emitted when a service provider stops providing the service.\"}},\"kind\":\"user\",\"methods\":{\"acceptProvisionPendingParameters(address,bytes)\":{\"notice\":\"Accepts pending parameters in the provision of a service provider in the {Graph Horizon staking contract}.\"},\"collect(address,uint8,bytes)\":{\"notice\":\"Collects payment earnt by the service provider.\"},\"getDelegationRatio()\":{\"notice\":\"External getter for the delegation ratio\"},\"getProvisionTokensRange()\":{\"notice\":\"External getter for the provision tokens range\"},\"getThawingPeriodRange()\":{\"notice\":\"External getter for the thawing period range\"},\"getVerifierCutRange()\":{\"notice\":\"External getter for the verifier cut range\"},\"pause()\":{\"notice\":\"Pauses the data service.\"},\"register(address,bytes)\":{\"notice\":\"Registers a service provider with the data service. The service provider can now start providing the service.\"},\"slash(address,bytes)\":{\"notice\":\"Slash a service provider for misbehaviour.\"},\"startService(address,bytes)\":{\"notice\":\"Service provider starts providing the service.\"},\"stopService(address,bytes)\":{\"notice\":\"Service provider stops providing the service.\"},\"unpause()\":{\"notice\":\"Unpauses the data service.\"}},\"notice\":\"Extension for the {IDataService} contract, adds pausing functionality to the data service. Pausing is controlled by privileged accounts called pause guardians.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"@graphprotocol/horizon/contracts/data-service/interfaces/IDataServicePausable.sol\":\"IDataServicePausable\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10},\"remappings\":[]},\"sources\":{\"@graphprotocol/horizon/contracts/data-service/interfaces/IDataService.sol\":{\"keccak256\":\"0x2208814f64eeca9409eafc1a1fa425c67ff38cffdffc3af0bafbe1c1b338ed32\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://925b32efbd9fe85a98f8f1f51e865e0b7b65d933196cf6c098bd670da7138e0c\",\"dweb:/ipfs/Qmdrp7BGJ4fEKzDgZpVY1FULXKsHAdGXkx4nqRrWvMaumr\"]},\"@graphprotocol/horizon/contracts/data-service/interfaces/IDataServicePausable.sol\":{\"keccak256\":\"0x6e65df59821dce2e4c9c221e1381eac69534464b8c69c83c2f18bff188e120f5\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://bd7f1d4d7b1d9de204580678f24fbe453235bbc1fbb15f65f022619a419b11a8\",\"dweb:/ipfs/QmP7JnK6Buor5bvRFcb427ACJKTwX6mnJb31TJzKL4EnSD\"]},\"@graphprotocol/horizon/contracts/interfaces/IGraphPayments.sol\":{\"keccak256\":\"0xa22dcc47676073113e4ebe30045065662cee5531f9c5f75776c00e70a1929c81\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://8908f30b3c7536798b14dc62fb5ccffc05570d568dbd1bade7c79c1fd2a4b5fe\",\"dweb:/ipfs/QmexZgb5mhDmXVZnYX1Z37cwM7EG2prYyBEVjUSVdKshVr\"]}},\"version\":1}" + } + }, + "@graphprotocol/horizon/contracts/data-service/libraries/ProvisionTracker.sol": { + "ProvisionTracker": { + "abi": [ + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokensAvailable", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokensRequired", + "type": "uint256" + } + ], + "name": "ProvisionTrackerInsufficientTokens", + "type": "error" + } + ], + "evm": { + "bytecode": { + "functionDebugData": {}, + "generatedSources": [], + "linkReferences": {}, + "object": "60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220ed1fd9291ad35d2fe9b4b07415a19a0798fc542c5ed7e8efe6b20ec6d74b95d364736f6c634300081b0033", + "opcodes": "PUSH1 0x56 PUSH1 0x37 PUSH1 0xB DUP3 DUP3 DUP3 CODECOPY DUP1 MLOAD PUSH1 0x0 BYTE PUSH1 0x73 EQ PUSH1 0x2A JUMPI PUSH4 0x4E487B71 PUSH1 0xE0 SHL PUSH1 0x0 MSTORE PUSH1 0x0 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST ADDRESS PUSH1 0x0 MSTORE PUSH1 0x73 DUP2 MSTORE8 DUP3 DUP2 RETURN INVALID PUSH20 0x0 ADDRESS EQ PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0xED 0x1F 0xD9 0x29 BYTE 0xD3 TSTORE 0x2F 0xE9 0xB4 0xB0 PUSH21 0x15A19A0798FC542C5ED7E8EFE6B20EC6D74B95D364 PUSH20 0x6F6C634300081B00330000000000000000000000 ", + "sourceMap": "779:2963:20:-:0;;;;;;;;;;;;;;;-1:-1:-1;;;779:2963:20;;;;;;;;;;;;;;;;;" + }, + "deployedBytecode": { + "functionDebugData": {}, + "generatedSources": [], + "immutableReferences": {}, + "linkReferences": {}, + "object": "73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220ed1fd9291ad35d2fe9b4b07415a19a0798fc542c5ed7e8efe6b20ec6d74b95d364736f6c634300081b0033", + "opcodes": "PUSH20 0x0 ADDRESS EQ PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0xED 0x1F 0xD9 0x29 BYTE 0xD3 TSTORE 0x2F 0xE9 0xB4 0xB0 PUSH21 0x15A19A0798FC542C5ED7E8EFE6B20EC6D74B95D364 PUSH20 0x6F6C634300081B00330000000000000000000000 ", + "sourceMap": "779:2963:20:-:0;;;;;;;;" + }, + "methodIdentifiers": {} + }, + "metadata": "{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokensAvailable\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"tokensRequired\",\"type\":\"uint256\"}],\"name\":\"ProvisionTrackerInsufficientTokens\",\"type\":\"error\"}],\"devdoc\":{\"custom:security-contact\":\"Please email security+contracts@thegraph.com if you find any bugs. We may have an active bug bounty program.\",\"errors\":{\"ProvisionTrackerInsufficientTokens(uint256,uint256)\":[{\"params\":{\"tokensAvailable\":\"The amount of tokens available\",\"tokensRequired\":\"The amount of tokens required\"}}]},\"kind\":\"dev\",\"methods\":{},\"title\":\"ProvisionTracker library\",\"version\":1},\"userdoc\":{\"errors\":{\"ProvisionTrackerInsufficientTokens(uint256,uint256)\":[{\"notice\":\"Thrown when trying to lock more tokens than available\"}]},\"kind\":\"user\",\"methods\":{},\"notice\":\"A library to facilitate tracking of \\\"used tokens\\\" on Graph Horizon provisions. This can be used to ensure data services have enough economic security (provisioned stake) to back the payments they collect for their services. The library provides two primitives, lock and release to signal token usage and free up tokens respectively. It does not make any assumptions about the conditions under which tokens are locked or released.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"@graphprotocol/horizon/contracts/data-service/libraries/ProvisionTracker.sol\":\"ProvisionTracker\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10},\"remappings\":[]},\"sources\":{\"@graphprotocol/contracts/contracts/rewards/IRewardsIssuer.sol\":{\"keccak256\":\"0xe049090c38a64d80b284ba2a7b440bcedba9804d96f2bb8da525e69ac452e03a\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://8b7d1186bd0698bed02d3504ac80c20e605087fba036d5ff392b39a9a3c818e5\",\"dweb:/ipfs/QmRgAfY1dD5rc7fLuuGVyu2mh9Z8qz1AVvuXAcRGnB3dSv\"]},\"@graphprotocol/horizon/contracts/data-service/libraries/ProvisionTracker.sol\":{\"keccak256\":\"0xc0f433a20f91fb2c2c588d5accfd311535314d71f7adc4e2b84fa4193ed1a739\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://a920d9446c3e76783921d2f2d980a058f41700de1d59470c9b3892a49ebcaf48\",\"dweb:/ipfs/QmcwmqNkxS1BpJQ7kgf4V9F98w2MKcVvg2N7P3i8KtDSF4\"]},\"@graphprotocol/horizon/contracts/interfaces/IGraphPayments.sol\":{\"keccak256\":\"0xa22dcc47676073113e4ebe30045065662cee5531f9c5f75776c00e70a1929c81\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://8908f30b3c7536798b14dc62fb5ccffc05570d568dbd1bade7c79c1fd2a4b5fe\",\"dweb:/ipfs/QmexZgb5mhDmXVZnYX1Z37cwM7EG2prYyBEVjUSVdKshVr\"]},\"@graphprotocol/horizon/contracts/interfaces/IHorizonStaking.sol\":{\"keccak256\":\"0x4b146f30ee66c4224cb5a82bafc8299f8596d8fe302e793757520f67bba8a166\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://30666c737d72a850223c1966d3b5d02b84f3f808f3c8dae8d0748731646b60c5\",\"dweb:/ipfs/QmQschyZQtU8tTnQ9hNiG5nobuXBx6KeiKdfxvZ4zvQ7ty\"]},\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingBase.sol\":{\"keccak256\":\"0x9bdab6cb595eabd7d321d7beae03ad3607995c14ef40f0c2f349fb72084766c5\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://6cac2ca3580bd770b98b07b11ebb007e8a922a90cde920e6ec472df7e66fb512\",\"dweb:/ipfs/QmRw1rjT8D8gNp2GRTuwDETwHNHMpHKoHZq4pYBAn9i65F\"]},\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingExtension.sol\":{\"keccak256\":\"0x7923f39746198b5672f0e4d65b7bf14903ae5f7775d74b210effb957eea36c71\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://c29531aff69c71e649fb347d7117ea8c42fc8de09860a1c389ed9b8f097a34e0\",\"dweb:/ipfs/QmS89fww584HiyE1BdPe8Xaqbf5v7FEvL38GTxeHEAsLFm\"]},\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingMain.sol\":{\"keccak256\":\"0xd04bb1f6a427e858e8a625b4b9835c69c8891a324d22beba20293ab2a77e5de7\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://05c9e425eee0b6c109a8dad2edcf9e1c845c64fccf321edf804921394ee048be\",\"dweb:/ipfs/QmbwLWNof534oG5ohzNAWrjdQ5kqJs7M5d5kCRd68XUogB\"]},\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingTypes.sol\":{\"keccak256\":\"0xaaeb9770f8aaae6b395e87bb1876a10fe7c14384d16d97dd33a671c3ea53aa7b\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://8f5c019fdb2df73bafe464fb6e9da792f7833a0c1858734bcd6a6b8d6ae924c7\",\"dweb:/ipfs/QmcubeYTHCYBqQsRncBFpPFtk7JzRz4nFh27LUW1m4hx2K\"]},\"@graphprotocol/horizon/contracts/libraries/LinkedList.sol\":{\"keccak256\":\"0x99058b4da0428b8d9c22d3d112acbaa59900f1fd0a434038b1a4fccfe3c678d6\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://568e03231c6081eacbcb6585a05c0b1bb976b640b611f7bf6155f9b58d887239\",\"dweb:/ipfs/QmdPZQWhkhjf5TUwz487Dwm4ycjX323iNdwb1sQnAiA1Qu\"]}},\"version\":1}" + } + }, + "@graphprotocol/horizon/contracts/data-service/utilities/ProvisionManager.sol": { + "ProvisionManager": { + "abi": [ + { + "inputs": [ + { + "internalType": "bytes", + "name": "contractName", + "type": "bytes" + } + ], + "name": "GraphDirectoryInvalidZeroAddress", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidInitialization", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "name": "ProvisionManagerInvalidRange", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "message", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "name": "ProvisionManagerInvalidValue", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "ProvisionManagerNotAuthorized", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + } + ], + "name": "ProvisionManagerProvisionNotFound", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "ratio", + "type": "uint32" + } + ], + "name": "DelegationRatioSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "graphToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "graphStaking", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphPayments", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphEscrow", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "graphController", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphEpochManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphRewardsManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphTokenGateway", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphProxyAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphCuration", + "type": "address" + } + ], + "name": "GraphDirectoryInitialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "name": "ProvisionTokensRangeSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "min", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "max", + "type": "uint64" + } + ], + "name": "ThawingPeriodRangeSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "min", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "max", + "type": "uint32" + } + ], + "name": "VerifierCutRangeSet", + "type": "event" + } + ], + "evm": { + "bytecode": { + "functionDebugData": {}, + "generatedSources": [], + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "deployedBytecode": { + "functionDebugData": {}, + "generatedSources": [], + "immutableReferences": {}, + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "methodIdentifiers": {} + }, + "metadata": "{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"contractName\",\"type\":\"bytes\"}],\"name\":\"GraphDirectoryInvalidZeroAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidInitialization\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotInitializing\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"max\",\"type\":\"uint256\"}],\"name\":\"ProvisionManagerInvalidRange\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"max\",\"type\":\"uint256\"}],\"name\":\"ProvisionManagerInvalidValue\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"ProvisionManagerNotAuthorized\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"}],\"name\":\"ProvisionManagerProvisionNotFound\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"ratio\",\"type\":\"uint32\"}],\"name\":\"DelegationRatioSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"graphToken\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"graphStaking\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"graphPayments\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"graphEscrow\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"graphController\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"graphEpochManager\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"graphRewardsManager\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"graphTokenGateway\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"graphProxyAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"graphCuration\",\"type\":\"address\"}],\"name\":\"GraphDirectoryInitialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"version\",\"type\":\"uint64\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"min\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"max\",\"type\":\"uint256\"}],\"name\":\"ProvisionTokensRangeSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"min\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"max\",\"type\":\"uint64\"}],\"name\":\"ThawingPeriodRangeSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"min\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"max\",\"type\":\"uint32\"}],\"name\":\"VerifierCutRangeSet\",\"type\":\"event\"}],\"devdoc\":{\"custom:security-contact\":\"Please email security+contracts@thegraph.com if you find any bugs. We may have an active bug bounty program.\",\"details\":\"Provides utilities to verify provision parameters are within an acceptable range. Each parameter has an overridable setter and getter for the validity range, and a checker that reverts if the parameter is out of range. The parameters are: - Provision parameters (thawing period and verifier cut) - Provision tokens Note that default values for all provision parameters provide the most permissive configuration, it's highly recommended to override them at the data service level.\",\"errors\":{\"GraphDirectoryInvalidZeroAddress(bytes)\":[{\"params\":{\"contractName\":\"The name of the contract that was not found, or the controller\"}}],\"InvalidInitialization()\":[{\"details\":\"The contract is already initialized.\"}],\"NotInitializing()\":[{\"details\":\"The contract is not initializing.\"}],\"ProvisionManagerInvalidRange(uint256,uint256)\":[{\"params\":{\"max\":\"The maximum value.\",\"min\":\"The minimum value.\"}}],\"ProvisionManagerInvalidValue(bytes,uint256,uint256,uint256)\":[{\"params\":{\"max\":\"The maximum allowed value.\",\"message\":\"The error message.\",\"min\":\"The minimum allowed value.\",\"value\":\"The value that is out of range.\"}}],\"ProvisionManagerNotAuthorized(address,address)\":[{\"params\":{\"caller\":\"The address of the caller.\",\"serviceProvider\":\"The address of the serviceProvider.\"}}],\"ProvisionManagerProvisionNotFound(address)\":[{\"params\":{\"serviceProvider\":\"The address of the service provider.\"}}]},\"events\":{\"DelegationRatioSet(uint32)\":{\"params\":{\"ratio\":\"The delegation ratio\"}},\"GraphDirectoryInitialized(address,address,address,address,address,address,address,address,address,address)\":{\"params\":{\"graphController\":\"The Graph Controller contract address\",\"graphCuration\":\"The Curation contract address\",\"graphEpochManager\":\"The Epoch Manager contract address\",\"graphEscrow\":\"The Payments Escrow contract address\",\"graphPayments\":\"The Graph Payments contract address\",\"graphProxyAdmin\":\"The Graph Proxy Admin contract address\",\"graphRewardsManager\":\"The Rewards Manager contract address\",\"graphStaking\":\"The Horizon Staking contract address\",\"graphToken\":\"The Graph Token contract address\",\"graphTokenGateway\":\"The Token Gateway contract address\"}},\"Initialized(uint64)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"},\"ProvisionTokensRangeSet(uint256,uint256)\":{\"params\":{\"max\":\"The maximum allowed value for the provision tokens.\",\"min\":\"The minimum allowed value for the provision tokens.\"}},\"ThawingPeriodRangeSet(uint64,uint64)\":{\"params\":{\"max\":\"The maximum allowed value for the thawing period.\",\"min\":\"The minimum allowed value for the thawing period.\"}},\"VerifierCutRangeSet(uint32,uint32)\":{\"params\":{\"max\":\"The maximum allowed value for the max verifier cut.\",\"min\":\"The minimum allowed value for the max verifier cut.\"}}},\"kind\":\"dev\",\"methods\":{},\"title\":\"ProvisionManager contract\",\"version\":1},\"userdoc\":{\"errors\":{\"GraphDirectoryInvalidZeroAddress(bytes)\":[{\"notice\":\"Thrown when either the controller is the zero address or a contract address is not found on the controller\"}],\"ProvisionManagerInvalidRange(uint256,uint256)\":[{\"notice\":\"Thrown when attempting to set a range where min is greater than max.\"}],\"ProvisionManagerInvalidValue(bytes,uint256,uint256,uint256)\":[{\"notice\":\"Thrown when a provision parameter is out of range.\"}],\"ProvisionManagerNotAuthorized(address,address)\":[{\"notice\":\"Thrown when the caller is not authorized to manage the provision of a service provider.\"}],\"ProvisionManagerProvisionNotFound(address)\":[{\"notice\":\"Thrown when a provision is not found.\"}]},\"events\":{\"DelegationRatioSet(uint32)\":{\"notice\":\"Emitted when the delegation ratio is set.\"},\"GraphDirectoryInitialized(address,address,address,address,address,address,address,address,address,address)\":{\"notice\":\"Emitted when the GraphDirectory is initialized\"},\"ProvisionTokensRangeSet(uint256,uint256)\":{\"notice\":\"Emitted when the provision tokens range is set.\"},\"ThawingPeriodRangeSet(uint64,uint64)\":{\"notice\":\"Emitted when the thawing period range is set.\"},\"VerifierCutRangeSet(uint32,uint32)\":{\"notice\":\"Emitted when the verifier cut range is set.\"}},\"kind\":\"user\",\"methods\":{},\"notice\":\"A helper contract that implements several provision management functions.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"@graphprotocol/horizon/contracts/data-service/utilities/ProvisionManager.sol\":\"ProvisionManager\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10},\"remappings\":[]},\"sources\":{\"@graphprotocol/contracts/contracts/arbitrum/ITokenGateway.sol\":{\"keccak256\":\"0x3cbcc6e4629543a99acacc7ee4ffa6c063b9fb17d3597ccd2f9481008e3633bd\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://d6bb0bb830b67d579e57a261e5f5d9e90b32dc006b02badbecf1f6c82c0a5100\",\"dweb:/ipfs/Qmd38iNXZpinwbNRJPEAA8r9bmmtRwjTSK1SkmH47ge4kJ\"]},\"@graphprotocol/contracts/contracts/curation/ICuration.sol\":{\"keccak256\":\"0x17e4db429003cab08cd2859db94b95e0cee1f9478c1881903a4104def8fdc048\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://52ed58228a0e92aeb3493473a6e02f92d26a4e4eb0c46d38dd446e3bfcb6691e\",\"dweb:/ipfs/QmZzWxHAztdz2Q7cobqVEf4ExGpNuqWJFYgs2oHCgApjW6\"]},\"@graphprotocol/contracts/contracts/epochs/IEpochManager.sol\":{\"keccak256\":\"0x0f4b3a3569c023d2610d0d8b37b3ecb0b67f848d77aa063bb311756670017e85\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://df7c43568e554b301134aa2c58e4889ad0d3dcfec40e834b63621a43f39da154\",\"dweb:/ipfs/QmZeSV9AM6FKCkH9QYyF7i5nVggseEJXbvWbtrgUeXqQpo\"]},\"@graphprotocol/contracts/contracts/governance/IController.sol\":{\"keccak256\":\"0xe37df86cdea385d708ba00862cd9e04940e4f2aa50354fb3a9d2d4f505d5509a\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://0f6c9fd2b7a8c5a6b89ef12c7423144df04a5f251d5480be1b73c74a785ff12a\",\"dweb:/ipfs/QmYpiCQoxbDEYQ2FNA39Z4FGfoxfQ8jvH1Z3ccrqguQFMP\"]},\"@graphprotocol/contracts/contracts/rewards/IRewardsIssuer.sol\":{\"keccak256\":\"0xe049090c38a64d80b284ba2a7b440bcedba9804d96f2bb8da525e69ac452e03a\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://8b7d1186bd0698bed02d3504ac80c20e605087fba036d5ff392b39a9a3c818e5\",\"dweb:/ipfs/QmRgAfY1dD5rc7fLuuGVyu2mh9Z8qz1AVvuXAcRGnB3dSv\"]},\"@graphprotocol/contracts/contracts/rewards/IRewardsManager.sol\":{\"keccak256\":\"0xee4b213950c2e46481658b9b04f2d5dae0a96c4cce0ee346188b1f1272718d54\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://b26dd767bd6887666a18beef79c322d27a693a3a4f7a61dc6bded7f35796acf5\",\"dweb:/ipfs/QmXDeqmRSeAWUWQTknNLUPBDBnDr8ySYW4h6CBPRGMJoPp\"]},\"@graphprotocol/contracts/contracts/token/IGraphToken.sol\":{\"keccak256\":\"0x2ffad6798d641c8d1288730be725c43041c803caceaf6d9985122d000ad5761c\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://5f782a5670037fc9223dc20fd4f99c0277a9bec7d08f7800b0a0733e819a07cb\",\"dweb:/ipfs/QmP3K2QnmukScCh1nzgphYdg7AiAuTaT914jq4txLYNpra\"]},\"@graphprotocol/horizon/contracts/data-service/utilities/ProvisionManager.sol\":{\"keccak256\":\"0x63e7f1df10586beb7f8683065719fbff045437508539a9358c25a13fcf989f91\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://b32f9a7be91ae6d9c9a6edbe2404efbcf9fa99c1d503f4a688054be468494a8e\",\"dweb:/ipfs/QmQ5AQXsBPxtJSW24LqRZAaYYaz1518FpUCHfDEdsMfF8F\"]},\"@graphprotocol/horizon/contracts/data-service/utilities/ProvisionManagerStorage.sol\":{\"keccak256\":\"0xe44f72a63c472a6de42e08a2d732044fe1ac9245c4203d4e1eb941b1a2fa2159\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://412708a4f94b5757e46676c5702e47d37fdbdacbe53f70e2ee93d37c5938e028\",\"dweb:/ipfs/Qmdw4uagDdKeCzyS319BKyPzfnWCvM3KCtNYosFBd3xGco\"]},\"@graphprotocol/horizon/contracts/interfaces/IGraphPayments.sol\":{\"keccak256\":\"0xa22dcc47676073113e4ebe30045065662cee5531f9c5f75776c00e70a1929c81\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://8908f30b3c7536798b14dc62fb5ccffc05570d568dbd1bade7c79c1fd2a4b5fe\",\"dweb:/ipfs/QmexZgb5mhDmXVZnYX1Z37cwM7EG2prYyBEVjUSVdKshVr\"]},\"@graphprotocol/horizon/contracts/interfaces/IGraphProxyAdmin.sol\":{\"keccak256\":\"0x4410253d7de56d2cdff50ee141c52fd77fd23f3984440211c3cc90ad560f4f9d\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://da4425a908816c40ffc3c833504843c3732bcb47e745dc544f650e5bc2c23f25\",\"dweb:/ipfs/QmZYDS4cSKBqRXEU3qyjE6sxGModSeNgzQmdZmZCGHuaKt\"]},\"@graphprotocol/horizon/contracts/interfaces/IHorizonStaking.sol\":{\"keccak256\":\"0x4b146f30ee66c4224cb5a82bafc8299f8596d8fe302e793757520f67bba8a166\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://30666c737d72a850223c1966d3b5d02b84f3f808f3c8dae8d0748731646b60c5\",\"dweb:/ipfs/QmQschyZQtU8tTnQ9hNiG5nobuXBx6KeiKdfxvZ4zvQ7ty\"]},\"@graphprotocol/horizon/contracts/interfaces/IPaymentsEscrow.sol\":{\"keccak256\":\"0x99e2a676b539e7b6c223a551f8cb9770c07435a25c8b22f0044a8ce4949edadc\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://f702a3cea214d8328d89a0ef16495c709e30fe13eb86fc29940159c9cb8c7bd5\",\"dweb:/ipfs/QmS25Zgcw85kDZcicApLzRmDcoYNQafpFdMyBEWX8eLWSX\"]},\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingBase.sol\":{\"keccak256\":\"0x9bdab6cb595eabd7d321d7beae03ad3607995c14ef40f0c2f349fb72084766c5\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://6cac2ca3580bd770b98b07b11ebb007e8a922a90cde920e6ec472df7e66fb512\",\"dweb:/ipfs/QmRw1rjT8D8gNp2GRTuwDETwHNHMpHKoHZq4pYBAn9i65F\"]},\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingExtension.sol\":{\"keccak256\":\"0x7923f39746198b5672f0e4d65b7bf14903ae5f7775d74b210effb957eea36c71\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://c29531aff69c71e649fb347d7117ea8c42fc8de09860a1c389ed9b8f097a34e0\",\"dweb:/ipfs/QmS89fww584HiyE1BdPe8Xaqbf5v7FEvL38GTxeHEAsLFm\"]},\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingMain.sol\":{\"keccak256\":\"0xd04bb1f6a427e858e8a625b4b9835c69c8891a324d22beba20293ab2a77e5de7\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://05c9e425eee0b6c109a8dad2edcf9e1c845c64fccf321edf804921394ee048be\",\"dweb:/ipfs/QmbwLWNof534oG5ohzNAWrjdQ5kqJs7M5d5kCRd68XUogB\"]},\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingTypes.sol\":{\"keccak256\":\"0xaaeb9770f8aaae6b395e87bb1876a10fe7c14384d16d97dd33a671c3ea53aa7b\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://8f5c019fdb2df73bafe464fb6e9da792f7833a0c1858734bcd6a6b8d6ae924c7\",\"dweb:/ipfs/QmcubeYTHCYBqQsRncBFpPFtk7JzRz4nFh27LUW1m4hx2K\"]},\"@graphprotocol/horizon/contracts/libraries/LinkedList.sol\":{\"keccak256\":\"0x99058b4da0428b8d9c22d3d112acbaa59900f1fd0a434038b1a4fccfe3c678d6\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://568e03231c6081eacbcb6585a05c0b1bb976b640b611f7bf6155f9b58d887239\",\"dweb:/ipfs/QmdPZQWhkhjf5TUwz487Dwm4ycjX323iNdwb1sQnAiA1Qu\"]},\"@graphprotocol/horizon/contracts/libraries/PPMMath.sol\":{\"keccak256\":\"0xe7fcfd44d2919944b79a11a39da7d4539d49c4bcf510071a59f6b41c37ee8ef2\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://a21b1ff7ca81fa07f153b60aeca136bd1ee57d9d01a2c76635e4a5602e8959fc\",\"dweb:/ipfs/QmQ5C7mUjt4sv1NBt1FH5XVHN3aBsHnvDsdJKWywhLjso8\"]},\"@graphprotocol/horizon/contracts/libraries/UintRange.sol\":{\"keccak256\":\"0x70d69069b2c122becd29ec4ea9a79f2e26cf7cbe7b1918ffced691ee00cdbd82\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://6bddc7d257c3df1fd4940dd3c554e5a1efbc1b23d50f7878415389b75380628c\",\"dweb:/ipfs/QmTQBCsL4pHoXMixVvDwGMdmJnGfEeeDZfHdJkcpKamu58\"]},\"@graphprotocol/horizon/contracts/utilities/GraphDirectory.sol\":{\"keccak256\":\"0x1d09be2f7454873ab80f86ed5d590b9e796fe5146977c4c4a5b1f7ead17eb522\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://e1c7539d26f069c2acabd404601e7811f8878f66976e8b5d4f5438195de793c2\",\"dweb:/ipfs/QmUAybvtDZ275kAnU6r81aQy1FCp7zLscSV87oe9nbwjyU\"]},\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"keccak256\":\"0xdb4d24ee2c087c391d587cd17adfe5b3f9d93b3110b1388c2ab6c7c0ad1dcd05\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://ab7b6d5b9e2b88176312967fe0f0e78f3d9a1422fa5e4b64e2440c35869b5d08\",\"dweb:/ipfs/QmXKYWWyzcLg1B2k7Sb1qkEXgLCYfXecR9wYW5obRzWP1Q\"]},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0xe06a3f08a987af6ad2e1c1e774405d4fe08f1694b67517438b467cecf0da0ef7\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://df6f0c459663c9858b6cba2cda1d14a7d05a985bed6d2de72bd8e78c25ee79db\",\"dweb:/ipfs/QmeTTxZ7qVk9rjEv2R4CpCwdf8UMCcRqDNMvzNxHc3Fnn9\"]}},\"version\":1}" + } + }, + "@graphprotocol/horizon/contracts/data-service/utilities/ProvisionManagerStorage.sol": { + "ProvisionManagerV1Storage": { + "abi": [], + "evm": { + "bytecode": { + "functionDebugData": {}, + "generatedSources": [], + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "deployedBytecode": { + "functionDebugData": {}, + "generatedSources": [], + "immutableReferences": {}, + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "methodIdentifiers": {} + }, + "metadata": "{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"custom:security-contact\":\"Please email security+contracts@thegraph.com if you find any bugs. We may have an active bug bounty program.\",\"kind\":\"dev\",\"methods\":{},\"stateVariables\":{\"__gap\":{\"details\":\"Gap to allow adding variables in future upgrades Note that this contract is not upgradeable but might be inherited by an upgradeable contract\"},\"_delegationRatio\":{\"details\":\"Max calculated as service provider's stake * delegationRatio\"}},\"title\":\"Storage layout for the {ProvisionManager} helper contract.\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@graphprotocol/horizon/contracts/data-service/utilities/ProvisionManagerStorage.sol\":\"ProvisionManagerV1Storage\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10},\"remappings\":[]},\"sources\":{\"@graphprotocol/horizon/contracts/data-service/utilities/ProvisionManagerStorage.sol\":{\"keccak256\":\"0xe44f72a63c472a6de42e08a2d732044fe1ac9245c4203d4e1eb941b1a2fa2159\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://412708a4f94b5757e46676c5702e47d37fdbdacbe53f70e2ee93d37c5938e028\",\"dweb:/ipfs/Qmdw4uagDdKeCzyS319BKyPzfnWCvM3KCtNYosFBd3xGco\"]}},\"version\":1}" + } + }, + "@graphprotocol/horizon/contracts/interfaces/IGraphPayments.sol": { + "IGraphPayments": { + "abi": [ + { + "inputs": [ + { + "internalType": "uint256", + "name": "cut", + "type": "uint256" + } + ], + "name": "GraphPaymentsInvalidCut", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "protocolPaymentCut", + "type": "uint256" + } + ], + "name": "GraphPaymentsInvalidProtocolPaymentCut", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "paymentType", + "type": "uint8" + }, + { + "indexed": true, + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "dataService", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensProtocol", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensDataService", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensDelegationPool", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensReceiver", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "receiverDestination", + "type": "address" + } + ], + "name": "GraphPaymentCollected", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "paymentType", + "type": "uint8" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "address", + "name": "dataService", + "type": "address" + }, + { + "internalType": "uint256", + "name": "dataServiceCut", + "type": "uint256" + }, + { + "internalType": "address", + "name": "receiverDestination", + "type": "address" + } + ], + "name": "collect", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "evm": { + "bytecode": { + "functionDebugData": {}, + "generatedSources": [], + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "deployedBytecode": { + "functionDebugData": {}, + "generatedSources": [], + "immutableReferences": {}, + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "methodIdentifiers": { + "collect(uint8,address,uint256,address,uint256,address)": "81cd11a0", + "initialize()": "8129fc1c" + } + }, + "metadata": "{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"cut\",\"type\":\"uint256\"}],\"name\":\"GraphPaymentsInvalidCut\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"protocolPaymentCut\",\"type\":\"uint256\"}],\"name\":\"GraphPaymentsInvalidProtocolPaymentCut\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"enum IGraphPayments.PaymentTypes\",\"name\":\"paymentType\",\"type\":\"uint8\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"payer\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dataService\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokensProtocol\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokensDataService\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokensDelegationPool\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokensReceiver\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"receiverDestination\",\"type\":\"address\"}],\"name\":\"GraphPaymentCollected\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"enum IGraphPayments.PaymentTypes\",\"name\":\"paymentType\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"dataService\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"dataServiceCut\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"receiverDestination\",\"type\":\"address\"}],\"name\":\"collect\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"custom:security-contact\":\"Please email security+contracts@thegraph.com if you find any bugs. We may have an active bug bounty program.\",\"errors\":{\"GraphPaymentsInvalidCut(uint256)\":[{\"params\":{\"cut\":\"The cut\"}}],\"GraphPaymentsInvalidProtocolPaymentCut(uint256)\":[{\"params\":{\"protocolPaymentCut\":\"The protocol payment cut\"}}]},\"events\":{\"GraphPaymentCollected(uint8,address,address,address,uint256,uint256,uint256,uint256,uint256,address)\":{\"params\":{\"dataService\":\"The address of the data service\",\"payer\":\"The address of the payer\",\"paymentType\":\"The type of payment as defined in {IGraphPayments}\",\"receiver\":\"The address of the receiver\",\"receiverDestination\":\"The address where the receiver's payment cut is sent.\",\"tokens\":\"The total amount of tokens being collected\",\"tokensDataService\":\"Amount of tokens for the data service\",\"tokensDelegationPool\":\"Amount of tokens for delegators\",\"tokensProtocol\":\"Amount of tokens charged as protocol tax\",\"tokensReceiver\":\"Amount of tokens for the receiver\"}}},\"kind\":\"dev\",\"methods\":{\"collect(uint8,address,uint256,address,uint256,address)\":{\"params\":{\"dataService\":\"The address of the data service\",\"dataServiceCut\":\"The data service cut in PPM\",\"paymentType\":\"The type of payment as defined in {IGraphPayments}\",\"receiver\":\"The address of the receiver\",\"receiverDestination\":\"The address where the receiver's payment cut is sent.\",\"tokens\":\"The amount of tokens being collected.\"}}},\"title\":\"Interface for the {GraphPayments} contract\",\"version\":1},\"userdoc\":{\"errors\":{\"GraphPaymentsInvalidCut(uint256)\":[{\"notice\":\"Thrown when trying to use a cut that is not expressed in PPM\"}],\"GraphPaymentsInvalidProtocolPaymentCut(uint256)\":[{\"notice\":\"Thrown when the protocol payment cut is invalid\"}]},\"events\":{\"GraphPaymentCollected(uint8,address,address,address,uint256,uint256,uint256,uint256,uint256,address)\":{\"notice\":\"Emitted when a payment is collected\"}},\"kind\":\"user\",\"methods\":{\"collect(uint8,address,uint256,address,uint256,address)\":{\"notice\":\"Collects funds from a payer. It will pay cuts to all relevant parties and forward the rest to the receiver destination address. If the destination address is zero the funds are automatically staked to the receiver. Note that the receiver destination address can be set to the receiver address to collect funds on the receiver without re-staking. Note that the collected amount can be zero.\"},\"initialize()\":{\"notice\":\"Initialize the contract\"}},\"notice\":\"This contract is part of the Graph Horizon payments protocol. It's designed to pull funds (GRT) from the {PaymentsEscrow} and distribute them according to a set of pre established rules.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"@graphprotocol/horizon/contracts/interfaces/IGraphPayments.sol\":\"IGraphPayments\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10},\"remappings\":[]},\"sources\":{\"@graphprotocol/horizon/contracts/interfaces/IGraphPayments.sol\":{\"keccak256\":\"0xa22dcc47676073113e4ebe30045065662cee5531f9c5f75776c00e70a1929c81\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://8908f30b3c7536798b14dc62fb5ccffc05570d568dbd1bade7c79c1fd2a4b5fe\",\"dweb:/ipfs/QmexZgb5mhDmXVZnYX1Z37cwM7EG2prYyBEVjUSVdKshVr\"]}},\"version\":1}" + } + }, + "@graphprotocol/horizon/contracts/interfaces/IGraphProxyAdmin.sol": { + "IGraphProxyAdmin": { + "abi": [], + "evm": { + "bytecode": { + "functionDebugData": {}, + "generatedSources": [], + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "deployedBytecode": { + "functionDebugData": {}, + "generatedSources": [], + "immutableReferences": {}, + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "methodIdentifiers": {} + }, + "metadata": "{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"custom:security-contact\":\"Please email security+contracts@thegraph.com if you find any bugs. We may have an active bug bounty program.\",\"details\":\"Empty interface to allow the GraphProxyAdmin contract to be used in the GraphDirectory contract.\",\"kind\":\"dev\",\"methods\":{},\"title\":\"IGraphProxyAdmin\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@graphprotocol/horizon/contracts/interfaces/IGraphProxyAdmin.sol\":\"IGraphProxyAdmin\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10},\"remappings\":[]},\"sources\":{\"@graphprotocol/horizon/contracts/interfaces/IGraphProxyAdmin.sol\":{\"keccak256\":\"0x4410253d7de56d2cdff50ee141c52fd77fd23f3984440211c3cc90ad560f4f9d\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://da4425a908816c40ffc3c833504843c3732bcb47e745dc544f650e5bc2c23f25\",\"dweb:/ipfs/QmZYDS4cSKBqRXEU3qyjE6sxGModSeNgzQmdZmZCGHuaKt\"]}},\"version\":1}" + } + }, + "@graphprotocol/horizon/contracts/interfaces/IGraphTallyCollector.sol": { + "IGraphTallyCollector": { + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "internalType": "address", + "name": "dataService", + "type": "address" + } + ], + "name": "GraphTallyCollectorCallerNotDataService", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokensCollected", + "type": "uint256" + } + ], + "name": "GraphTallyCollectorInconsistentRAVTokens", + "type": "error" + }, + { + "inputs": [], + "name": "GraphTallyCollectorInvalidRAVSigner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokensToCollect", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxTokensToCollect", + "type": "uint256" + } + ], + "name": "GraphTallyCollectorInvalidTokensToCollectAmount", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "dataService", + "type": "address" + } + ], + "name": "GraphTallyCollectorUnauthorizedDataService", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "paymentType", + "type": "uint8" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "collectionId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "dataService", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "PaymentCollected", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "collectionId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "dataService", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "timestampNs", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "uint128", + "name": "valueAggregate", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "metadata", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "signature", + "type": "bytes" + } + ], + "name": "RAVCollected", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "paymentType", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "tokensToCollect", + "type": "uint256" + } + ], + "name": "collect", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "paymentType", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "collect", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "collectionId", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "dataService", + "type": "address" + }, + { + "internalType": "uint64", + "name": "timestampNs", + "type": "uint64" + }, + { + "internalType": "uint128", + "name": "valueAggregate", + "type": "uint128" + }, + { + "internalType": "bytes", + "name": "metadata", + "type": "bytes" + } + ], + "internalType": "struct IGraphTallyCollector.ReceiptAggregateVoucher", + "name": "rav", + "type": "tuple" + } + ], + "name": "encodeRAV", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "collectionId", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "dataService", + "type": "address" + }, + { + "internalType": "uint64", + "name": "timestampNs", + "type": "uint64" + }, + { + "internalType": "uint128", + "name": "valueAggregate", + "type": "uint128" + }, + { + "internalType": "bytes", + "name": "metadata", + "type": "bytes" + } + ], + "internalType": "struct IGraphTallyCollector.ReceiptAggregateVoucher", + "name": "rav", + "type": "tuple" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + } + ], + "internalType": "struct IGraphTallyCollector.SignedRAV", + "name": "signedRAV", + "type": "tuple" + } + ], + "name": "recoverRAVSigner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "evm": { + "bytecode": { + "functionDebugData": {}, + "generatedSources": [], + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "deployedBytecode": { + "functionDebugData": {}, + "generatedSources": [], + "immutableReferences": {}, + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "methodIdentifiers": { + "collect(uint8,bytes)": "7f07d283", + "collect(uint8,bytes,uint256)": "692209ce", + "encodeRAV((bytes32,address,address,address,uint64,uint128,bytes))": "26969c4c", + "recoverRAVSigner(((bytes32,address,address,address,uint64,uint128,bytes),bytes))": "63648817" + } + }, + "metadata": "{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"dataService\",\"type\":\"address\"}],\"name\":\"GraphTallyCollectorCallerNotDataService\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"tokensCollected\",\"type\":\"uint256\"}],\"name\":\"GraphTallyCollectorInconsistentRAVTokens\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"GraphTallyCollectorInvalidRAVSigner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokensToCollect\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxTokensToCollect\",\"type\":\"uint256\"}],\"name\":\"GraphTallyCollectorInvalidTokensToCollectAmount\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"dataService\",\"type\":\"address\"}],\"name\":\"GraphTallyCollectorUnauthorizedDataService\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"enum IGraphPayments.PaymentTypes\",\"name\":\"paymentType\",\"type\":\"uint8\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"collectionId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"payer\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dataService\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"PaymentCollected\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"collectionId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"payer\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dataService\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"timestampNs\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"valueAggregate\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"metadata\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"RAVCollected\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"enum IGraphPayments.PaymentTypes\",\"name\":\"paymentType\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"tokensToCollect\",\"type\":\"uint256\"}],\"name\":\"collect\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"enum IGraphPayments.PaymentTypes\",\"name\":\"paymentType\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"collect\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"collectionId\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"payer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"dataService\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"timestampNs\",\"type\":\"uint64\"},{\"internalType\":\"uint128\",\"name\":\"valueAggregate\",\"type\":\"uint128\"},{\"internalType\":\"bytes\",\"name\":\"metadata\",\"type\":\"bytes\"}],\"internalType\":\"struct IGraphTallyCollector.ReceiptAggregateVoucher\",\"name\":\"rav\",\"type\":\"tuple\"}],\"name\":\"encodeRAV\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"collectionId\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"payer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"dataService\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"timestampNs\",\"type\":\"uint64\"},{\"internalType\":\"uint128\",\"name\":\"valueAggregate\",\"type\":\"uint128\"},{\"internalType\":\"bytes\",\"name\":\"metadata\",\"type\":\"bytes\"}],\"internalType\":\"struct IGraphTallyCollector.ReceiptAggregateVoucher\",\"name\":\"rav\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"internalType\":\"struct IGraphTallyCollector.SignedRAV\",\"name\":\"signedRAV\",\"type\":\"tuple\"}],\"name\":\"recoverRAVSigner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"custom:security-contact\":\"Please email security+contracts@thegraph.com if you find any bugs. We may have an active bug bounty program.\",\"details\":\"Implements the {IPaymentCollector} interface as defined by the Graph Horizon payments protocol.\",\"errors\":{\"GraphTallyCollectorCallerNotDataService(address,address)\":[{\"params\":{\"caller\":\"The address of the caller\",\"dataService\":\"The address of the data service\"}}],\"GraphTallyCollectorInconsistentRAVTokens(uint256,uint256)\":[{\"params\":{\"tokens\":\"The amount of tokens in the RAV\",\"tokensCollected\":\"The amount of tokens already collected\"}}],\"GraphTallyCollectorInvalidTokensToCollectAmount(uint256,uint256)\":[{\"params\":{\"maxTokensToCollect\":\"The maximum amount of tokens to collect\",\"tokensToCollect\":\"The amount of tokens to collect\"}}],\"GraphTallyCollectorUnauthorizedDataService(address)\":[{\"params\":{\"dataService\":\"The address of the data service\"}}]},\"events\":{\"PaymentCollected(uint8,bytes32,address,address,address,uint256)\":{\"params\":{\"collectionId\":\"The id for the collection. Can be used at the discretion of the collector to group multiple payments.\",\"dataService\":\"The address of the data service\",\"payer\":\"The address of the payer\",\"paymentType\":\"The payment type collected as defined by {IGraphPayments}\",\"receiver\":\"The address of the receiver\",\"tokens\":\"The amount of tokens being collected\"}},\"RAVCollected(bytes32,address,address,address,uint64,uint128,bytes,bytes)\":{\"params\":{\"collectionId\":\"The ID of the collection \\\"bucket\\\" the RAV belongs to.\",\"dataService\":\"The address of the data service\",\"metadata\":\"Arbitrary metadata\",\"payer\":\"The address of the payer\",\"serviceProvider\":\"The address of the service provider\",\"signature\":\"The signature of the RAV\",\"timestampNs\":\"The timestamp of the RAV\",\"valueAggregate\":\"The total amount owed to the service provider\"}}},\"kind\":\"dev\",\"methods\":{\"collect(uint8,bytes)\":{\"details\":\"This function should require the caller to present some form of evidence of the payer's debt to the receiver. The collector should validate this evidence and, if valid, collect the payment. Emits a {PaymentCollected} event\",\"params\":{\"data\":\"Additional data required for the payment collection. Will vary depending on the collector implementation.\",\"paymentType\":\"The payment type to collect, as defined by {IGraphPayments}\"},\"returns\":{\"_0\":\"The amount of tokens collected\"}},\"collect(uint8,bytes,uint256)\":{\"params\":{\"data\":\"Additional data required for the payment collection. Encoded as follows: - SignedRAV `signedRAV`: The signed RAV - uint256 `dataServiceCut`: The data service cut in PPM - address `receiverDestination`: The address where the receiver's payment should be sent.\",\"paymentType\":\"The payment type to collect\",\"tokensToCollect\":\"The amount of tokens to collect\"},\"returns\":{\"_0\":\"The amount of tokens collected\"}},\"encodeRAV((bytes32,address,address,address,uint64,uint128,bytes))\":{\"details\":\"Computes the hash of a ReceiptAggregateVoucher (RAV).\",\"params\":{\"rav\":\"The RAV for which to compute the hash.\"},\"returns\":{\"_0\":\"The hash of the RAV.\"}},\"recoverRAVSigner(((bytes32,address,address,address,uint64,uint128,bytes),bytes))\":{\"details\":\"Recovers the signer address of a signed ReceiptAggregateVoucher (RAV).\",\"params\":{\"signedRAV\":\"The SignedRAV containing the RAV and its signature.\"},\"returns\":{\"_0\":\"The address of the signer.\"}}},\"title\":\"Interface for the {GraphTallyCollector} contract\",\"version\":1},\"userdoc\":{\"errors\":{\"GraphTallyCollectorCallerNotDataService(address,address)\":[{\"notice\":\"Thrown when the caller is not the data service the RAV was issued to\"}],\"GraphTallyCollectorInconsistentRAVTokens(uint256,uint256)\":[{\"notice\":\"Thrown when the tokens collected are inconsistent with the collection history Each RAV should have a value greater than the previous one\"}],\"GraphTallyCollectorInvalidRAVSigner()\":[{\"notice\":\"Thrown when the RAV signer is invalid\"}],\"GraphTallyCollectorInvalidTokensToCollectAmount(uint256,uint256)\":[{\"notice\":\"Thrown when the attempting to collect more tokens than what it's owed\"}],\"GraphTallyCollectorUnauthorizedDataService(address)\":[{\"notice\":\"Thrown when the RAV is for a data service the service provider has no provision for\"}]},\"events\":{\"PaymentCollected(uint8,bytes32,address,address,address,uint256)\":{\"notice\":\"Emitted when a payment is collected\"},\"RAVCollected(bytes32,address,address,address,uint64,uint128,bytes,bytes)\":{\"notice\":\"Emitted when a RAV is collected\"}},\"kind\":\"user\",\"methods\":{\"collect(uint8,bytes)\":{\"notice\":\"Initiate a payment collection through the payments protocol\"},\"collect(uint8,bytes,uint256)\":{\"notice\":\"See {IPaymentsCollector.collect} This variant adds the ability to partially collect a RAV by specifying the amount of tokens to collect. Requirements: - The amount of tokens to collect must be less than or equal to the total amount of tokens in the RAV minus the tokens already collected.\"}},\"notice\":\"Implements a payments collector contract that can be used to collect payments using a GraphTally RAV (Receipt Aggregate Voucher).\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"@graphprotocol/horizon/contracts/interfaces/IGraphTallyCollector.sol\":\"IGraphTallyCollector\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10},\"remappings\":[]},\"sources\":{\"@graphprotocol/horizon/contracts/interfaces/IGraphPayments.sol\":{\"keccak256\":\"0xa22dcc47676073113e4ebe30045065662cee5531f9c5f75776c00e70a1929c81\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://8908f30b3c7536798b14dc62fb5ccffc05570d568dbd1bade7c79c1fd2a4b5fe\",\"dweb:/ipfs/QmexZgb5mhDmXVZnYX1Z37cwM7EG2prYyBEVjUSVdKshVr\"]},\"@graphprotocol/horizon/contracts/interfaces/IGraphTallyCollector.sol\":{\"keccak256\":\"0x762c26300d098fb1bdc5e6b52e0ffd0b497634e9bcfc9a9cd409df65d8d54590\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://f5c68742e96c1483449c882b082631a9bfafebb27152b87427e1234d34e604f3\",\"dweb:/ipfs/QmYqtSeQpCbKEaKKDXwmeK5DrYFiwSHYVzM3dzanh7MQ3D\"]},\"@graphprotocol/horizon/contracts/interfaces/IPaymentsCollector.sol\":{\"keccak256\":\"0x0871e02129e1fabdb39024f9ac3368b4c747e6b374fdf4fc200d3c225ed82860\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://a5fdf2dbedc15f739e6010a3ce3478ea7ad23bd643a8af3f39ccf631c06ebd52\",\"dweb:/ipfs/QmNusbPTqzzUwGomXBzsWHwbZMJ2HuTkxvgviLJZ6hr9i4\"]}},\"version\":1}" + } + }, + "@graphprotocol/horizon/contracts/interfaces/IHorizonStaking.sol": { + "IHorizonStaking": { + "abi": [ + { + "inputs": [], + "name": "HorizonStakingCallerIsServiceProvider", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minTokens", + "type": "uint256" + } + ], + "name": "HorizonStakingInsufficientDelegationTokens", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minTokens", + "type": "uint256" + } + ], + "name": "HorizonStakingInsufficientIdleStake", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minShares", + "type": "uint256" + } + ], + "name": "HorizonStakingInsufficientShares", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minTokens", + "type": "uint256" + } + ], + "name": "HorizonStakingInsufficientStakeForLegacyAllocations", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minRequired", + "type": "uint256" + } + ], + "name": "HorizonStakingInsufficientTokens", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "feeCut", + "type": "uint256" + } + ], + "name": "HorizonStakingInvalidDelegationFeeCut", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + } + ], + "name": "HorizonStakingInvalidDelegationPool", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + } + ], + "name": "HorizonStakingInvalidDelegationPoolState", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "maxVerifierCut", + "type": "uint32" + } + ], + "name": "HorizonStakingInvalidMaxVerifierCut", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + } + ], + "name": "HorizonStakingInvalidProvision", + "type": "error" + }, + { + "inputs": [], + "name": "HorizonStakingInvalidServiceProviderZeroAddress", + "type": "error" + }, + { + "inputs": [], + "name": "HorizonStakingInvalidThawRequestType", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "thawingPeriod", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "maxThawingPeriod", + "type": "uint64" + } + ], + "name": "HorizonStakingInvalidThawingPeriod", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "verifier", + "type": "address" + } + ], + "name": "HorizonStakingInvalidVerifier", + "type": "error" + }, + { + "inputs": [], + "name": "HorizonStakingInvalidVerifierZeroAddress", + "type": "error" + }, + { + "inputs": [], + "name": "HorizonStakingInvalidZeroShares", + "type": "error" + }, + { + "inputs": [], + "name": "HorizonStakingInvalidZeroTokens", + "type": "error" + }, + { + "inputs": [], + "name": "HorizonStakingLegacySlashFailed", + "type": "error" + }, + { + "inputs": [], + "name": "HorizonStakingNoTokensToSlash", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "HorizonStakingNotAuthorized", + "type": "error" + }, + { + "inputs": [], + "name": "HorizonStakingNothingThawing", + "type": "error" + }, + { + "inputs": [], + "name": "HorizonStakingNothingToWithdraw", + "type": "error" + }, + { + "inputs": [], + "name": "HorizonStakingProvisionAlreadyExists", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minShares", + "type": "uint256" + } + ], + "name": "HorizonStakingSlippageProtection", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "until", + "type": "uint256" + } + ], + "name": "HorizonStakingStillThawing", + "type": "error" + }, + { + "inputs": [], + "name": "HorizonStakingTooManyThawRequests", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxTokens", + "type": "uint256" + } + ], + "name": "HorizonStakingTooManyTokens", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "verifier", + "type": "address" + } + ], + "name": "HorizonStakingVerifierNotAllowed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "subgraphDeploymentID", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "epoch", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "allocationID", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "poi", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bool", + "name": "isPublic", + "type": "bool" + } + ], + "name": "AllocationClosed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "AllowedLockedVerifierSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "delegator", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "DelegatedTokensWithdrawn", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": true, + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "paymentType", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "feeCut", + "type": "uint256" + } + ], + "name": "DelegationFeeCutSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "DelegationSlashed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "DelegationSlashingEnabled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "DelegationSlashingSkipped", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "HorizonStakeDeposited", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "until", + "type": "uint256" + } + ], + "name": "HorizonStakeLocked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "HorizonStakeWithdrawn", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "maxThawingPeriod", + "type": "uint64" + } + ], + "name": "MaxThawingPeriodSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "OperatorSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "maxVerifierCut", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "thawingPeriod", + "type": "uint64" + } + ], + "name": "ProvisionCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "ProvisionIncreased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "maxVerifierCut", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "thawingPeriod", + "type": "uint64" + } + ], + "name": "ProvisionParametersSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "maxVerifierCut", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "thawingPeriod", + "type": "uint64" + } + ], + "name": "ProvisionParametersStaged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "ProvisionSlashed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "ProvisionThawed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "assetHolder", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "subgraphDeploymentID", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "allocationID", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "epoch", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "protocolTax", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "curationFees", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "queryFees", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "queryRebates", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "delegationRewards", + "type": "uint256" + } + ], + "name": "RebateCollected", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "delegator", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "StakeDelegatedWithdrawn", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "reward", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "beneficiary", + "type": "address" + } + ], + "name": "StakeSlashed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "enum IHorizonStakingTypes.ThawRequestType", + "name": "requestType", + "type": "uint8" + }, + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "shares", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "thawingUntil", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "thawRequestId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + } + ], + "name": "ThawRequestCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "enum IHorizonStakingTypes.ThawRequestType", + "name": "requestType", + "type": "uint8" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "thawRequestId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "shares", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "thawingUntil", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "bool", + "name": "valid", + "type": "bool" + } + ], + "name": "ThawRequestFulfilled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "enum IHorizonStakingTypes.ThawRequestType", + "name": "requestType", + "type": "uint8" + }, + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "thawRequestsFulfilled", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "ThawRequestsFulfilled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "ThawingPeriodCleared", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "delegator", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "shares", + "type": "uint256" + } + ], + "name": "TokensDelegated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "TokensDeprovisioned", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "TokensToDelegationPoolAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "delegator", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "shares", + "type": "uint256" + } + ], + "name": "TokensUndelegated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "VerifierTokensSent", + "type": "event" + }, + { + "inputs": [], + "name": "__DEPRECATED_getThawingPeriod", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + } + ], + "name": "acceptProvisionParameters", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "addToDelegationPool", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "addToProvision", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "clearThawingPeriod", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationID", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "poi", + "type": "bytes32" + } + ], + "name": "closeAllocation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "address", + "name": "allocationID", + "type": "address" + } + ], + "name": "collect", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "delegate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minSharesOut", + "type": "uint256" + } + ], + "name": "delegate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "uint256", + "name": "nThawRequests", + "type": "uint256" + } + ], + "name": "deprovision", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationID", + "type": "address" + } + ], + "name": "getAllocation", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "subgraphDeploymentID", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "createdAtEpoch", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "closedAtEpoch", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "collectedFees", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "__DEPRECATED_effectiveAllocation", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "accRewardsPerAllocatedToken", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "distributedRebates", + "type": "uint256" + } + ], + "internalType": "struct IHorizonStakingExtension.Allocation", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "getAllocationData", + "outputs": [ + { + "internalType": "bool", + "name": "isActive", + "type": "bool" + }, + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "accRewardsPerAllocatedToken", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "accRewardsPending", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationID", + "type": "address" + } + ], + "name": "getAllocationState", + "outputs": [ + { + "internalType": "enum IHorizonStakingExtension.AllocationState", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + } + ], + "name": "getDelegatedTokensAvailable", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "address", + "name": "delegator", + "type": "address" + } + ], + "name": "getDelegation", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + } + ], + "internalType": "struct IHorizonStakingTypes.Delegation", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "paymentType", + "type": "uint8" + } + ], + "name": "getDelegationFeeCut", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + } + ], + "name": "getDelegationPool", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokensThawing", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sharesThawing", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "thawingNonce", + "type": "uint256" + } + ], + "internalType": "struct IHorizonStakingTypes.DelegationPool", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + } + ], + "name": "getIdleStake", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + } + ], + "name": "getIndexerStakedTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getMaxThawingPeriod", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + } + ], + "name": "getProviderTokensAvailable", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + } + ], + "name": "getProvision", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokensThawing", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sharesThawing", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "maxVerifierCut", + "type": "uint32" + }, + { + "internalType": "uint64", + "name": "thawingPeriod", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "createdAt", + "type": "uint64" + }, + { + "internalType": "uint32", + "name": "maxVerifierCutPending", + "type": "uint32" + }, + { + "internalType": "uint64", + "name": "thawingPeriodPending", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "lastParametersStagedAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "thawingNonce", + "type": "uint256" + } + ], + "internalType": "struct IHorizonStakingTypes.Provision", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + } + ], + "name": "getServiceProvider", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "tokensStaked", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokensProvisioned", + "type": "uint256" + } + ], + "internalType": "struct IHorizonStakingTypes.ServiceProvider", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + } + ], + "name": "getStake", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getStakingExtension", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentId", + "type": "bytes32" + } + ], + "name": "getSubgraphAllocatedTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getSubgraphService", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "enum IHorizonStakingTypes.ThawRequestType", + "name": "thawRequestType", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "thawRequestId", + "type": "bytes32" + } + ], + "name": "getThawRequest", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + }, + { + "internalType": "uint64", + "name": "thawingUntil", + "type": "uint64" + }, + { + "internalType": "bytes32", + "name": "nextRequest", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "thawingNonce", + "type": "uint256" + } + ], + "internalType": "struct IHorizonStakingTypes.ThawRequest", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "enum IHorizonStakingTypes.ThawRequestType", + "name": "thawRequestType", + "type": "uint8" + }, + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "getThawRequestList", + "outputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "head", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "tail", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "count", + "type": "uint256" + } + ], + "internalType": "struct LinkedList.List", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "enum IHorizonStakingTypes.ThawRequestType", + "name": "thawRequestType", + "type": "uint8" + }, + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "getThawedTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "uint32", + "name": "delegationRatio", + "type": "uint32" + } + ], + "name": "getTokensAvailable", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + } + ], + "name": "hasStake", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationID", + "type": "address" + } + ], + "name": "isAllocation", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "verifier", + "type": "address" + } + ], + "name": "isAllowedLockedVerifier", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "address", + "name": "operator", + "type": "address" + } + ], + "name": "isAuthorized", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isDelegationSlashingEnabled", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "internalType": "address", + "name": "indexer", + "type": "address" + } + ], + "name": "isOperator", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "reward", + "type": "uint256" + }, + { + "internalType": "address", + "name": "beneficiary", + "type": "address" + } + ], + "name": "legacySlash", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "maxVerifierCut", + "type": "uint32" + }, + { + "internalType": "uint64", + "name": "thawingPeriod", + "type": "uint64" + } + ], + "name": "provision", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "maxVerifierCut", + "type": "uint32" + }, + { + "internalType": "uint64", + "name": "thawingPeriod", + "type": "uint64" + } + ], + "name": "provisionLocked", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "oldServiceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "oldVerifier", + "type": "address" + }, + { + "internalType": "address", + "name": "newServiceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "newVerifier", + "type": "address" + }, + { + "internalType": "uint256", + "name": "minSharesForNewProvider", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nThawRequests", + "type": "uint256" + } + ], + "name": "redelegate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "oldVerifier", + "type": "address" + }, + { + "internalType": "address", + "name": "newVerifier", + "type": "address" + }, + { + "internalType": "uint256", + "name": "nThawRequests", + "type": "uint256" + } + ], + "name": "reprovision", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "setAllowedLockedVerifier", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "paymentType", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "feeCut", + "type": "uint256" + } + ], + "name": "setDelegationFeeCut", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "setDelegationSlashingEnabled", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "maxThawingPeriod", + "type": "uint64" + } + ], + "name": "setMaxThawingPeriod", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "setOperator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "setOperatorLocked", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "uint32", + "name": "maxVerifierCut", + "type": "uint32" + }, + { + "internalType": "uint64", + "name": "thawingPeriod", + "type": "uint64" + } + ], + "name": "setProvisionParameters", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokensVerifier", + "type": "uint256" + }, + { + "internalType": "address", + "name": "verifierDestination", + "type": "address" + } + ], + "name": "slash", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "stake", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "stakeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "stakeToProvision", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "thaw", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + } + ], + "name": "undelegate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + } + ], + "name": "undelegate", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "unstake", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "uint256", + "name": "nThawRequests", + "type": "uint256" + } + ], + "name": "withdrawDelegated", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "deprecated", + "type": "address" + } + ], + "name": "withdrawDelegated", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "evm": { + "bytecode": { + "functionDebugData": {}, + "generatedSources": [], + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "deployedBytecode": { + "functionDebugData": {}, + "generatedSources": [], + "immutableReferences": {}, + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "methodIdentifiers": { + "__DEPRECATED_getThawingPeriod()": "c0641994", + "acceptProvisionParameters(address)": "3a78b732", + "addToDelegationPool(address,address,uint256)": "ca94b0e9", + "addToProvision(address,address,uint256)": "fecc9cc1", + "clearThawingPeriod()": "e473522a", + "closeAllocation(address,bytes32)": "44c32a61", + "collect(uint256,address)": "8d3c100a", + "delegate(address,address,uint256,uint256)": "6230001a", + "delegate(address,uint256)": "026e402b", + "deprovision(address,address,uint256)": "21195373", + "getAllocation(address)": "0e022923", + "getAllocationData(address)": "55c85269", + "getAllocationState(address)": "98c657dc", + "getDelegatedTokensAvailable(address,address)": "fb744cc0", + "getDelegation(address,address,address)": "ccebcabb", + "getDelegationFeeCut(address,address,uint8)": "7573ef4f", + "getDelegationPool(address,address)": "561285e4", + "getIdleStake(address)": "a784d498", + "getIndexerStakedTokens(address)": "1787e69f", + "getMaxThawingPeriod()": "39514ad2", + "getProviderTokensAvailable(address,address)": "08ce5f68", + "getProvision(address,address)": "25d9897e", + "getServiceProvider(address)": "8cc01c86", + "getStake(address)": "7a766460", + "getStakingExtension()": "66ee1b28", + "getSubgraphAllocatedTokens(bytes32)": "e2e1e8e9", + "getSubgraphService()": "9363c522", + "getThawRequest(uint8,bytes32)": "d48de845", + "getThawRequestList(uint8,address,address,address)": "e56f8a1d", + "getThawedTokens(uint8,address,address,address)": "2f7cc501", + "getTokensAvailable(address,address,uint32)": "872d0489", + "hasStake(address)": "e73e14bf", + "isAllocation(address)": "f1d60d66", + "isAllowedLockedVerifier(address)": "ae4fe67a", + "isAuthorized(address,address,address)": "7c145cc7", + "isDelegationSlashingEnabled()": "fc54fb27", + "isOperator(address,address)": "b6363cf2", + "legacySlash(address,uint256,uint256,address)": "4488a382", + "provision(address,address,uint256,uint32,uint64)": "010167e5", + "provisionLocked(address,address,uint256,uint32,uint64)": "82d66cb8", + "redelegate(address,address,address,address,uint256,uint256)": "f64b3598", + "reprovision(address,address,address,uint256)": "ba7fb0b4", + "setAllowedLockedVerifier(address,bool)": "4ca7ac22", + "setDelegationFeeCut(address,address,uint8,uint256)": "42c51693", + "setDelegationSlashingEnabled()": "ef58bd67", + "setMaxThawingPeriod(uint64)": "259bc435", + "setOperator(address,address,bool)": "bc735d90", + "setOperatorLocked(address,address,bool)": "ad4d35b5", + "setProvisionParameters(address,address,uint32,uint64)": "81e21b56", + "slash(address,uint256,uint256,address)": "e76fede6", + "stake(uint256)": "a694fc3a", + "stakeTo(address,uint256)": "a2a31722", + "stakeToProvision(address,address,uint256)": "74612092", + "thaw(address,address,uint256)": "f93f1cd0", + "undelegate(address,address,uint256)": "a02b9426", + "undelegate(address,uint256)": "4d99dd16", + "unstake(uint256)": "2e17de78", + "withdraw()": "3ccfd60b", + "withdrawDelegated(address,address)": "51a60b02", + "withdrawDelegated(address,address,uint256)": "3993d849" + } + }, + "metadata": "{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"name\":\"HorizonStakingCallerIsServiceProvider\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minTokens\",\"type\":\"uint256\"}],\"name\":\"HorizonStakingInsufficientDelegationTokens\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minTokens\",\"type\":\"uint256\"}],\"name\":\"HorizonStakingInsufficientIdleStake\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minShares\",\"type\":\"uint256\"}],\"name\":\"HorizonStakingInsufficientShares\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minTokens\",\"type\":\"uint256\"}],\"name\":\"HorizonStakingInsufficientStakeForLegacyAllocations\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minRequired\",\"type\":\"uint256\"}],\"name\":\"HorizonStakingInsufficientTokens\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"feeCut\",\"type\":\"uint256\"}],\"name\":\"HorizonStakingInvalidDelegationFeeCut\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"}],\"name\":\"HorizonStakingInvalidDelegationPool\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"}],\"name\":\"HorizonStakingInvalidDelegationPoolState\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"maxVerifierCut\",\"type\":\"uint32\"}],\"name\":\"HorizonStakingInvalidMaxVerifierCut\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"}],\"name\":\"HorizonStakingInvalidProvision\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"HorizonStakingInvalidServiceProviderZeroAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"HorizonStakingInvalidThawRequestType\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"thawingPeriod\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"maxThawingPeriod\",\"type\":\"uint64\"}],\"name\":\"HorizonStakingInvalidThawingPeriod\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"}],\"name\":\"HorizonStakingInvalidVerifier\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"HorizonStakingInvalidVerifierZeroAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"HorizonStakingInvalidZeroShares\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"HorizonStakingInvalidZeroTokens\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"HorizonStakingLegacySlashFailed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"HorizonStakingNoTokensToSlash\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"HorizonStakingNotAuthorized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"HorizonStakingNothingThawing\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"HorizonStakingNothingToWithdraw\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"HorizonStakingProvisionAlreadyExists\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minShares\",\"type\":\"uint256\"}],\"name\":\"HorizonStakingSlippageProtection\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"until\",\"type\":\"uint256\"}],\"name\":\"HorizonStakingStillThawing\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"HorizonStakingTooManyThawRequests\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxTokens\",\"type\":\"uint256\"}],\"name\":\"HorizonStakingTooManyTokens\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"}],\"name\":\"HorizonStakingVerifierNotAllowed\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"subgraphDeploymentID\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"epoch\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"allocationID\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"poi\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"isPublic\",\"type\":\"bool\"}],\"name\":\"AllocationClosed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"}],\"name\":\"AllowedLockedVerifierSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"delegator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"DelegatedTokensWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"enum IGraphPayments.PaymentTypes\",\"name\":\"paymentType\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"feeCut\",\"type\":\"uint256\"}],\"name\":\"DelegationFeeCutSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"DelegationSlashed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"DelegationSlashingEnabled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"DelegationSlashingSkipped\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"HorizonStakeDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"until\",\"type\":\"uint256\"}],\"name\":\"HorizonStakeLocked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"HorizonStakeWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"maxThawingPeriod\",\"type\":\"uint64\"}],\"name\":\"MaxThawingPeriodSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"}],\"name\":\"OperatorSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"maxVerifierCut\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"thawingPeriod\",\"type\":\"uint64\"}],\"name\":\"ProvisionCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"ProvisionIncreased\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"maxVerifierCut\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"thawingPeriod\",\"type\":\"uint64\"}],\"name\":\"ProvisionParametersSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"maxVerifierCut\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"thawingPeriod\",\"type\":\"uint64\"}],\"name\":\"ProvisionParametersStaged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"ProvisionSlashed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"ProvisionThawed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"assetHolder\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"subgraphDeploymentID\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"allocationID\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"epoch\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"protocolTax\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"curationFees\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"queryFees\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"queryRebates\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"delegationRewards\",\"type\":\"uint256\"}],\"name\":\"RebateCollected\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"delegator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"StakeDelegatedWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"reward\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"}],\"name\":\"StakeSlashed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"enum IHorizonStakingTypes.ThawRequestType\",\"name\":\"requestType\",\"type\":\"uint8\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"thawingUntil\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"thawRequestId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"ThawRequestCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"enum IHorizonStakingTypes.ThawRequestType\",\"name\":\"requestType\",\"type\":\"uint8\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"thawRequestId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"thawingUntil\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"valid\",\"type\":\"bool\"}],\"name\":\"ThawRequestFulfilled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"enum IHorizonStakingTypes.ThawRequestType\",\"name\":\"requestType\",\"type\":\"uint8\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"thawRequestsFulfilled\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"ThawRequestsFulfilled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"ThawingPeriodCleared\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"delegator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"}],\"name\":\"TokensDelegated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"TokensDeprovisioned\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"TokensToDelegationPoolAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"delegator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"}],\"name\":\"TokensUndelegated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"VerifierTokensSent\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"__DEPRECATED_getThawingPeriod\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"}],\"name\":\"acceptProvisionParameters\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"addToDelegationPool\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"addToProvision\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"clearThawingPeriod\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"allocationID\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"poi\",\"type\":\"bytes32\"}],\"name\":\"closeAllocation\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"allocationID\",\"type\":\"address\"}],\"name\":\"collect\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"delegate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minSharesOut\",\"type\":\"uint256\"}],\"name\":\"delegate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nThawRequests\",\"type\":\"uint256\"}],\"name\":\"deprovision\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"allocationID\",\"type\":\"address\"}],\"name\":\"getAllocation\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"subgraphDeploymentID\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"createdAtEpoch\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"closedAtEpoch\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"collectedFees\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"__DEPRECATED_effectiveAllocation\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"accRewardsPerAllocatedToken\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"distributedRebates\",\"type\":\"uint256\"}],\"internalType\":\"struct IHorizonStakingExtension.Allocation\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"allocationId\",\"type\":\"address\"}],\"name\":\"getAllocationData\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"isActive\",\"type\":\"bool\"},{\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"subgraphDeploymentId\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"accRewardsPerAllocatedToken\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"accRewardsPending\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"allocationID\",\"type\":\"address\"}],\"name\":\"getAllocationState\",\"outputs\":[{\"internalType\":\"enum IHorizonStakingExtension.AllocationState\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"}],\"name\":\"getDelegatedTokensAvailable\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"delegator\",\"type\":\"address\"}],\"name\":\"getDelegation\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"}],\"internalType\":\"struct IHorizonStakingTypes.Delegation\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"internalType\":\"enum IGraphPayments.PaymentTypes\",\"name\":\"paymentType\",\"type\":\"uint8\"}],\"name\":\"getDelegationFeeCut\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"}],\"name\":\"getDelegationPool\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"tokensThawing\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"sharesThawing\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"thawingNonce\",\"type\":\"uint256\"}],\"internalType\":\"struct IHorizonStakingTypes.DelegationPool\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"}],\"name\":\"getIdleStake\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"}],\"name\":\"getIndexerStakedTokens\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getMaxThawingPeriod\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"}],\"name\":\"getProviderTokensAvailable\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"}],\"name\":\"getProvision\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"tokensThawing\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"sharesThawing\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"maxVerifierCut\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"thawingPeriod\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"createdAt\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"maxVerifierCutPending\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"thawingPeriodPending\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"lastParametersStagedAt\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"thawingNonce\",\"type\":\"uint256\"}],\"internalType\":\"struct IHorizonStakingTypes.Provision\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"}],\"name\":\"getServiceProvider\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"tokensStaked\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"tokensProvisioned\",\"type\":\"uint256\"}],\"internalType\":\"struct IHorizonStakingTypes.ServiceProvider\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"}],\"name\":\"getStake\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getStakingExtension\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_subgraphDeploymentId\",\"type\":\"bytes32\"}],\"name\":\"getSubgraphAllocatedTokens\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getSubgraphService\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"enum IHorizonStakingTypes.ThawRequestType\",\"name\":\"thawRequestType\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"thawRequestId\",\"type\":\"bytes32\"}],\"name\":\"getThawRequest\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"thawingUntil\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"nextRequest\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"thawingNonce\",\"type\":\"uint256\"}],\"internalType\":\"struct IHorizonStakingTypes.ThawRequest\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"enum IHorizonStakingTypes.ThawRequestType\",\"name\":\"thawRequestType\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"getThawRequestList\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"head\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"tail\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"count\",\"type\":\"uint256\"}],\"internalType\":\"struct LinkedList.List\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"enum IHorizonStakingTypes.ThawRequestType\",\"name\":\"thawRequestType\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"getThawedTokens\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"delegationRatio\",\"type\":\"uint32\"}],\"name\":\"getTokensAvailable\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"}],\"name\":\"hasStake\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"allocationID\",\"type\":\"address\"}],\"name\":\"isAllocation\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"}],\"name\":\"isAllowedLockedVerifier\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"isAuthorized\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isDelegationSlashingEnabled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"}],\"name\":\"isOperator\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"reward\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"}],\"name\":\"legacySlash\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"maxVerifierCut\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"thawingPeriod\",\"type\":\"uint64\"}],\"name\":\"provision\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"maxVerifierCut\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"thawingPeriod\",\"type\":\"uint64\"}],\"name\":\"provisionLocked\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"oldServiceProvider\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"oldVerifier\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"newServiceProvider\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"newVerifier\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"minSharesForNewProvider\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nThawRequests\",\"type\":\"uint256\"}],\"name\":\"redelegate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"oldVerifier\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"newVerifier\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nThawRequests\",\"type\":\"uint256\"}],\"name\":\"reprovision\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"}],\"name\":\"setAllowedLockedVerifier\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"internalType\":\"enum IGraphPayments.PaymentTypes\",\"name\":\"paymentType\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"feeCut\",\"type\":\"uint256\"}],\"name\":\"setDelegationFeeCut\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"setDelegationSlashingEnabled\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"maxThawingPeriod\",\"type\":\"uint64\"}],\"name\":\"setMaxThawingPeriod\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"}],\"name\":\"setOperator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"}],\"name\":\"setOperatorLocked\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"maxVerifierCut\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"thawingPeriod\",\"type\":\"uint64\"}],\"name\":\"setProvisionParameters\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"tokensVerifier\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"verifierDestination\",\"type\":\"address\"}],\"name\":\"slash\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"stake\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"stakeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"stakeToProvision\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"thaw\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"}],\"name\":\"undelegate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"}],\"name\":\"undelegate\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"unstake\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nThawRequests\",\"type\":\"uint256\"}],\"name\":\"withdrawDelegated\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"deprecated\",\"type\":\"address\"}],\"name\":\"withdrawDelegated\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"custom:security-contact\":\"Please email security+contracts@thegraph.com if you find any bugs. We may have an active bug bounty program.\",\"details\":\"Use this interface to interact with the Horizon Staking contract.\",\"errors\":{\"HorizonStakingInsufficientDelegationTokens(uint256,uint256)\":[{\"params\":{\"minTokens\":\"The minimum required token amount\",\"tokens\":\"The actual token amount\"}}],\"HorizonStakingInsufficientIdleStake(uint256,uint256)\":[{\"params\":{\"minTokens\":\"The minimum required token amount\",\"tokens\":\"The actual token amount\"}}],\"HorizonStakingInsufficientShares(uint256,uint256)\":[{\"params\":{\"minShares\":\"The minimum required share amount\",\"shares\":\"The actual share amount\"}}],\"HorizonStakingInsufficientStakeForLegacyAllocations(uint256,uint256)\":[{\"params\":{\"minTokens\":\"The minimum required token amount\",\"tokens\":\"The actual token amount\"}}],\"HorizonStakingInsufficientTokens(uint256,uint256)\":[{\"params\":{\"minRequired\":\"The minimum required token amount\",\"tokens\":\"The actual token amount\"}}],\"HorizonStakingInvalidDelegationFeeCut(uint256)\":[{\"params\":{\"feeCut\":\"The fee cut\"}}],\"HorizonStakingInvalidDelegationPool(address,address)\":[{\"params\":{\"serviceProvider\":\"The service provider address\",\"verifier\":\"The verifier address\"}}],\"HorizonStakingInvalidDelegationPoolState(address,address)\":[{\"params\":{\"serviceProvider\":\"The service provider address\",\"verifier\":\"The verifier address\"}}],\"HorizonStakingInvalidMaxVerifierCut(uint32)\":[{\"params\":{\"maxVerifierCut\":\"The maximum verifier cut\"}}],\"HorizonStakingInvalidProvision(address,address)\":[{\"params\":{\"serviceProvider\":\"The service provider address\",\"verifier\":\"The verifier address\"}}],\"HorizonStakingInvalidThawingPeriod(uint64,uint64)\":[{\"params\":{\"maxThawingPeriod\":\"The maximum `thawingPeriod` allowed\",\"thawingPeriod\":\"The thawing period\"}}],\"HorizonStakingInvalidVerifier(address)\":[{\"params\":{\"verifier\":\"The verifier address\"}}],\"HorizonStakingNotAuthorized(address,address,address)\":[{\"params\":{\"caller\":\"The caller address\",\"serviceProvider\":\"The service provider address\",\"verifier\":\"The verifier address\"}}],\"HorizonStakingSlippageProtection(uint256,uint256)\":[{\"params\":{\"minShares\":\"The minimum required share amount\",\"shares\":\"The actual share amount\"}}],\"HorizonStakingStillThawing(uint256)\":[{\"details\":\"Note this thawing refers to the global thawing period applied to legacy allocated tokens, it does not refer to thaw requests.\",\"params\":{\"until\":\"The block number until the stake is locked\"}}],\"HorizonStakingTooManyTokens(uint256,uint256)\":[{\"params\":{\"maxTokens\":\"The maximum allowed token amount\",\"tokens\":\"The actual token amount\"}}],\"HorizonStakingVerifierNotAllowed(address)\":[{\"details\":\"Only applies to stake from locked wallets.\",\"params\":{\"verifier\":\"The verifier address\"}}]},\"events\":{\"AllocationClosed(address,bytes32,uint256,uint256,address,address,bytes32,bool)\":{\"details\":\"Emitted when `indexer` close an allocation in `epoch` for `allocationID`. An amount of `tokens` get unallocated from `subgraphDeploymentID`. This event also emits the POI (proof of indexing) submitted by the indexer. `isPublic` is true if the sender was someone other than the indexer.\",\"params\":{\"allocationID\":\"The allocation identifier\",\"epoch\":\"The protocol epoch the allocation was closed on\",\"indexer\":\"The indexer address\",\"isPublic\":\"True if the allocation was force closed by someone other than the indexer/operator\",\"poi\":\"The proof of indexing submitted by the sender\",\"sender\":\"The address closing the allocation\",\"subgraphDeploymentID\":\"The subgraph deployment ID\",\"tokens\":\"The amount of tokens unallocated from the allocation\"}},\"AllowedLockedVerifierSet(address,bool)\":{\"params\":{\"allowed\":\"Whether the verifier is allowed or disallowed\",\"verifier\":\"The address of the verifier\"}},\"DelegatedTokensWithdrawn(address,address,address,uint256)\":{\"params\":{\"delegator\":\"The address of the delegator\",\"serviceProvider\":\"The address of the service provider\",\"tokens\":\"The amount of tokens withdrawn\",\"verifier\":\"The address of the verifier\"}},\"DelegationFeeCutSet(address,address,uint8,uint256)\":{\"params\":{\"feeCut\":\"The fee cut set, in PPM\",\"paymentType\":\"The payment type for which the fee cut is set, as defined in {IGraphPayments}\",\"serviceProvider\":\"The address of the service provider\",\"verifier\":\"The address of the verifier\"}},\"DelegationSlashed(address,address,uint256)\":{\"params\":{\"serviceProvider\":\"The address of the service provider\",\"tokens\":\"The amount of tokens slashed (note this only represents delegation pool's slashed stake)\",\"verifier\":\"The address of the verifier\"}},\"DelegationSlashingSkipped(address,address,uint256)\":{\"params\":{\"serviceProvider\":\"The address of the service provider\",\"tokens\":\"The amount of tokens that would have been slashed (note this only represents delegation pool's slashed stake)\",\"verifier\":\"The address of the verifier\"}},\"HorizonStakeDeposited(address,uint256)\":{\"details\":\"TRANSITION PERIOD: After transition period move to IHorizonStakingMain. Temporarily it needs to be here since it's emitted by {_stake} which is used by both {HorizonStaking} and {HorizonStakingExtension}.\",\"params\":{\"serviceProvider\":\"The address of the service provider.\",\"tokens\":\"The amount of tokens staked.\"}},\"HorizonStakeLocked(address,uint256,uint256)\":{\"params\":{\"serviceProvider\":\"The address of the service provider\",\"tokens\":\"The amount of tokens now locked (including previously locked tokens)\",\"until\":\"The block number until the stake is locked\"}},\"HorizonStakeWithdrawn(address,uint256)\":{\"params\":{\"serviceProvider\":\"The address of the service provider\",\"tokens\":\"The amount of tokens withdrawn\"}},\"MaxThawingPeriodSet(uint64)\":{\"params\":{\"maxThawingPeriod\":\"The new maximum thawing period\"}},\"OperatorSet(address,address,address,bool)\":{\"details\":\"Emitted when an operator is allowed or denied by a service provider for a particular verifier\",\"params\":{\"allowed\":\"Whether the operator is allowed or denied\",\"operator\":\"The address of the operator\",\"serviceProvider\":\"The address of the service provider\",\"verifier\":\"The address of the verifier\"}},\"ProvisionCreated(address,address,uint256,uint32,uint64)\":{\"params\":{\"maxVerifierCut\":\"The maximum cut, expressed in PPM of the slashed amount, that a verifier can take for themselves when slashing\",\"serviceProvider\":\"The address of the service provider\",\"thawingPeriod\":\"The period in seconds that the tokens will be thawing before they can be removed from the provision\",\"tokens\":\"The amount of tokens provisioned\",\"verifier\":\"The address of the verifier\"}},\"ProvisionIncreased(address,address,uint256)\":{\"params\":{\"serviceProvider\":\"The address of the service provider\",\"tokens\":\"The amount of tokens added to the provision\",\"verifier\":\"The address of the verifier\"}},\"ProvisionParametersSet(address,address,uint32,uint64)\":{\"params\":{\"maxVerifierCut\":\"The new maximum cut, expressed in PPM of the slashed amount, that a verifier can take for themselves when slashing\",\"serviceProvider\":\"The address of the service provider\",\"thawingPeriod\":\"The new period in seconds that the tokens will be thawing before they can be removed from the provision\",\"verifier\":\"The address of the verifier\"}},\"ProvisionParametersStaged(address,address,uint32,uint64)\":{\"params\":{\"maxVerifierCut\":\"The proposed maximum cut, expressed in PPM of the slashed amount, that a verifier can take for themselves when slashing\",\"serviceProvider\":\"The address of the service provider\",\"thawingPeriod\":\"The proposed period in seconds that the tokens will be thawing before they can be removed from the provision\",\"verifier\":\"The address of the verifier\"}},\"ProvisionSlashed(address,address,uint256)\":{\"params\":{\"serviceProvider\":\"The address of the service provider\",\"tokens\":\"The amount of tokens slashed (note this only represents service provider's slashed stake)\",\"verifier\":\"The address of the verifier\"}},\"ProvisionThawed(address,address,uint256)\":{\"params\":{\"serviceProvider\":\"The address of the service provider\",\"tokens\":\"The amount of tokens thawed\",\"verifier\":\"The address of the verifier\"}},\"RebateCollected(address,address,bytes32,address,uint256,uint256,uint256,uint256,uint256,uint256,uint256)\":{\"details\":\"Emitted when `indexer` collects a rebate on `subgraphDeploymentID` for `allocationID`. `epoch` is the protocol epoch the rebate was collected on The rebate is for `tokens` amount which are being provided by `assetHolder`; `queryFees` is the amount up for rebate after `curationFees` are distributed and `protocolTax` is burnt. `queryRebates` is the amount distributed to the `indexer` with `delegationFees` collected and sent to the delegation pool.\",\"params\":{\"allocationID\":\"The allocation identifier\",\"assetHolder\":\"The address of the asset holder, the entity paying the query fees\",\"curationFees\":\"The amount of tokens distributed to the curation pool\",\"delegationRewards\":\"The amount of tokens collected from the delegation pool\",\"epoch\":\"The protocol epoch the rebate was collected on\",\"indexer\":\"The indexer address\",\"protocolTax\":\"The amount of tokens burnt as protocol tax\",\"queryFees\":\"The amount of tokens collected as query fees\",\"queryRebates\":\"The amount of tokens distributed to the indexer\",\"subgraphDeploymentID\":\"The subgraph deployment ID\",\"tokens\":\"The amount of tokens collected\"}},\"StakeDelegatedWithdrawn(address,address,uint256)\":{\"details\":\"This event is for the legacy `withdrawDelegated` function.\",\"params\":{\"delegator\":\"The address of the delegator\",\"indexer\":\"The address of the indexer\",\"tokens\":\"The amount of tokens withdrawn\"}},\"StakeSlashed(address,uint256,uint256,address)\":{\"details\":\"Emitted when `indexer` was slashed for a total of `tokens` amount. Tracks `reward` amount of tokens given to `beneficiary`.\",\"params\":{\"beneficiary\":\"The address of a beneficiary to receive a reward for the slashing\",\"indexer\":\"The indexer address\",\"reward\":\"The amount of reward tokens to send to a beneficiary\",\"tokens\":\"The amount of tokens slashed\"}},\"ThawRequestCreated(uint8,address,address,address,uint256,uint64,bytes32,uint256)\":{\"details\":\"Can be emitted by the service provider when thawing stake or by the delegator when undelegating.\",\"params\":{\"nonce\":\"The nonce of the thaw request\",\"owner\":\"The address of the owner of the thaw request.\",\"requestType\":\"The type of thaw request\",\"serviceProvider\":\"The address of the service provider\",\"shares\":\"The amount of shares being thawed\",\"thawRequestId\":\"The ID of the thaw request\",\"thawingUntil\":\"The timestamp until the stake is thawed\",\"verifier\":\"The address of the verifier\"}},\"ThawRequestFulfilled(uint8,bytes32,uint256,uint256,uint64,bool)\":{\"params\":{\"requestType\":\"The type of thaw request\",\"shares\":\"The amount of shares being released\",\"thawRequestId\":\"The ID of the thaw request\",\"thawingUntil\":\"The timestamp until the stake has thawed\",\"tokens\":\"The amount of tokens being released\",\"valid\":\"Whether the thaw request was valid at the time of fulfillment\"}},\"ThawRequestsFulfilled(uint8,address,address,address,uint256,uint256)\":{\"params\":{\"owner\":\"The address of the owner of the thaw requests\",\"requestType\":\"The type of thaw request\",\"serviceProvider\":\"The address of the service provider\",\"thawRequestsFulfilled\":\"The number of thaw requests fulfilled\",\"tokens\":\"The total amount of tokens being released\",\"verifier\":\"The address of the verifier\"}},\"ThawingPeriodCleared()\":{\"details\":\"This marks the end of the transition period.\"},\"TokensDelegated(address,address,address,uint256,uint256)\":{\"params\":{\"delegator\":\"The address of the delegator\",\"serviceProvider\":\"The address of the service provider\",\"shares\":\"The amount of shares delegated\",\"tokens\":\"The amount of tokens delegated\",\"verifier\":\"The address of the verifier\"}},\"TokensDeprovisioned(address,address,uint256)\":{\"params\":{\"serviceProvider\":\"The address of the service provider\",\"tokens\":\"The amount of tokens removed\",\"verifier\":\"The address of the verifier\"}},\"TokensToDelegationPoolAdded(address,address,uint256)\":{\"params\":{\"serviceProvider\":\"The address of the service provider\",\"tokens\":\"The amount of tokens withdrawn\",\"verifier\":\"The address of the verifier\"}},\"TokensUndelegated(address,address,address,uint256,uint256)\":{\"params\":{\"delegator\":\"The address of the delegator\",\"serviceProvider\":\"The address of the service provider\",\"shares\":\"The amount of shares undelegated\",\"tokens\":\"The amount of tokens undelegated\",\"verifier\":\"The address of the verifier\"}},\"VerifierTokensSent(address,address,address,uint256)\":{\"params\":{\"destination\":\"The address where the verifier cut is sent\",\"serviceProvider\":\"The address of the service provider\",\"tokens\":\"The amount of tokens sent to the verifier\",\"verifier\":\"The address of the verifier\"}}},\"kind\":\"dev\",\"methods\":{\"__DEPRECATED_getThawingPeriod()\":{\"returns\":{\"_0\":\"Thawing period in blocks\"}},\"acceptProvisionParameters(address)\":{\"details\":\"Only the provision's verifier can call this function. Emits a {ProvisionParametersSet} event.\",\"params\":{\"serviceProvider\":\"The service provider address\"}},\"addToDelegationPool(address,address,uint256)\":{\"details\":\"Requirements: - `tokens` cannot be zero. - Caller must have previously approved this contract to pull tokens from their balance. Emits a {TokensToDelegationPoolAdded} event.\",\"params\":{\"serviceProvider\":\"The service provider address\",\"tokens\":\"The amount of tokens to add to the delegation pool\",\"verifier\":\"The verifier address for which the tokens are provisioned\"}},\"addToProvision(address,address,uint256)\":{\"details\":\"Requirements: - The `serviceProvider` must have previously provisioned stake to `verifier`. - `tokens` cannot be zero. - The `serviceProvider` must have enough idle stake to cover the tokens to add. Emits a {ProvisionIncreased} event.\",\"params\":{\"serviceProvider\":\"The service provider address\",\"tokens\":\"The amount of tokens to add to the provision\",\"verifier\":\"The verifier address\"}},\"clearThawingPeriod()\":{\"details\":\"This function can only be called by the contract governor.Emits a {ThawingPeriodCleared} event.\"},\"closeAllocation(address,bytes32)\":{\"params\":{\"allocationID\":\"The allocation identifier\",\"poi\":\"Proof of indexing submitted for the allocated period\"}},\"collect(uint256,address)\":{\"details\":\"Collect and rebate query fees to the indexer This function will accept calls with zero tokens. We use an exponential rebate formula to calculate the amount of tokens to rebate to the indexer. This implementation allows collecting multiple times on the same allocation, keeping track of the total amount rebated, the total amount collected and compensating the indexer for the difference.\",\"params\":{\"allocationID\":\"Allocation where the tokens will be assigned\",\"tokens\":\"Amount of tokens to collect\"}},\"delegate(address,address,uint256,uint256)\":{\"details\":\"Requirements: - `tokens` cannot be zero. - Caller must have previously approved this contract to pull tokens from their balance. - The provision must exist. Emits a {TokensDelegated} event.\",\"params\":{\"minSharesOut\":\"The minimum amount of shares to accept, slippage protection.\",\"serviceProvider\":\"The service provider address\",\"tokens\":\"The amount of tokens to delegate\",\"verifier\":\"The verifier address\"}},\"delegate(address,uint256)\":{\"details\":\"See {delegate}.\",\"params\":{\"serviceProvider\":\"The service provider address\",\"tokens\":\"The amount of tokens to delegate\"}},\"deprovision(address,address,uint256)\":{\"details\":\"The parameter `nThawRequests` can be set to a non zero value to fulfill a specific number of thaw requests in the event that fulfilling all of them results in a gas limit error. Otherwise, the function will attempt to fulfill all thaw requests until the first one that is not yet expired is found. Requirements: - Must have previously initiated a thaw request using {thaw}. Emits {ThawRequestFulfilled}, {ThawRequestsFulfilled} and {TokensDeprovisioned} events.\",\"params\":{\"nThawRequests\":\"The number of thaw requests to fulfill. Set to 0 to fulfill all thaw requests.\",\"serviceProvider\":\"The service provider address\",\"verifier\":\"The verifier address\"}},\"getAllocation(address)\":{\"params\":{\"allocationID\":\"Address used as allocation identifier\"},\"returns\":{\"_0\":\"Allocation data\"}},\"getAllocationData(address)\":{\"details\":\"Get allocation data to calculate rewards issuance \",\"params\":{\"allocationId\":\"The allocation Id\"},\"returns\":{\"accRewardsPending\":\"Snapshot of accumulated rewards from previous allocation resizing, pending to be claimed\",\"accRewardsPerAllocatedToken\":\"Rewards snapshot\",\"indexer\":\"The indexer address\",\"isActive\":\"Whether the allocation is active or not\",\"subgraphDeploymentId\":\"Subgraph deployment id for the allocation\",\"tokens\":\"Amount of allocated tokens\"}},\"getAllocationState(address)\":{\"params\":{\"allocationID\":\"Allocation identifier\"},\"returns\":{\"_0\":\"AllocationState enum with the state of the allocation\"}},\"getDelegatedTokensAvailable(address,address)\":{\"details\":\"Calculated as the tokens available minus the tokens thawing.\",\"params\":{\"serviceProvider\":\"The address of the service provider.\",\"verifier\":\"The address of the verifier.\"},\"returns\":{\"_0\":\"The amount of tokens available.\"}},\"getDelegation(address,address,address)\":{\"params\":{\"delegator\":\"The address of the delegator.\",\"serviceProvider\":\"The address of the service provider.\",\"verifier\":\"The address of the verifier.\"},\"returns\":{\"_0\":\"The delegation details.\"}},\"getDelegationFeeCut(address,address,uint8)\":{\"params\":{\"paymentType\":\"The payment type as defined by {IGraphPayments.PaymentTypes}.\",\"serviceProvider\":\"The address of the service provider.\",\"verifier\":\"The address of the verifier.\"},\"returns\":{\"_0\":\"The delegation fee cut in PPM.\"}},\"getDelegationPool(address,address)\":{\"params\":{\"serviceProvider\":\"The address of the service provider.\",\"verifier\":\"The address of the verifier.\"},\"returns\":{\"_0\":\"The delegation pool details.\"}},\"getIdleStake(address)\":{\"params\":{\"serviceProvider\":\"The address of the service provider.\"},\"returns\":{\"_0\":\"The amount of tokens that are idle.\"}},\"getIndexerStakedTokens(address)\":{\"params\":{\"indexer\":\"Address of the indexer\"},\"returns\":{\"_0\":\"Amount of tokens staked by the indexer\"}},\"getMaxThawingPeriod()\":{\"returns\":{\"_0\":\"The maximum allowed thawing period in seconds.\"}},\"getProviderTokensAvailable(address,address)\":{\"details\":\"Calculated as the tokens available minus the tokens thawing.\",\"params\":{\"serviceProvider\":\"The address of the service provider.\",\"verifier\":\"The address of the verifier.\"},\"returns\":{\"_0\":\"The amount of tokens available.\"}},\"getProvision(address,address)\":{\"params\":{\"serviceProvider\":\"The address of the service provider.\",\"verifier\":\"The address of the verifier.\"},\"returns\":{\"_0\":\"The provision details.\"}},\"getServiceProvider(address)\":{\"params\":{\"serviceProvider\":\"The address of the service provider.\"},\"returns\":{\"_0\":\"The service provider details.\"}},\"getStake(address)\":{\"params\":{\"serviceProvider\":\"The address of the service provider.\"},\"returns\":{\"_0\":\"The amount of tokens staked.\"}},\"getStakingExtension()\":{\"returns\":{\"_0\":\"The address of the staking extension\"}},\"getSubgraphAllocatedTokens(bytes32)\":{\"params\":{\"_subgraphDeploymentId\":\"Deployment Id for the subgraph\"},\"returns\":{\"_0\":\"Total tokens allocated to subgraph\"}},\"getSubgraphService()\":{\"details\":\"TRANSITION PERIOD: After transition period move to main HorizonStaking contract\",\"returns\":{\"_0\":\"Address of the subgraph data service\"}},\"getThawRequest(uint8,bytes32)\":{\"params\":{\"thawRequestId\":\"The id of the thaw request.\",\"thawRequestType\":\"The type of thaw request.\"},\"returns\":{\"_0\":\"The thaw request details.\"}},\"getThawRequestList(uint8,address,address,address)\":{\"params\":{\"owner\":\"The owner of the thaw requests. Use either the service provider or delegator address.\",\"serviceProvider\":\"The address of the service provider.\",\"thawRequestType\":\"The type of thaw request.\",\"verifier\":\"The address of the verifier.\"},\"returns\":{\"_0\":\"The thaw requests list metadata.\"}},\"getThawedTokens(uint8,address,address,address)\":{\"details\":\"Note that the value returned by this function does not return the total amount of thawed tokens but only those that can be released. If thaw requests are created with different thawing periods it's possible that an unexpired thaw request temporarily blocks the release of other ones that have already expired. This function will stop counting when it encounters the first thaw request that is not yet expired.\",\"params\":{\"owner\":\"The owner of the thaw requests. Use either the service provider or delegator address.\",\"serviceProvider\":\"The address of the service provider.\",\"thawRequestType\":\"The type of thaw request.\",\"verifier\":\"The address of the verifier.\"},\"returns\":{\"_0\":\"The amount of thawed tokens.\"}},\"getTokensAvailable(address,address,uint32)\":{\"params\":{\"delegationRatio\":\"The delegation ratio.\",\"serviceProvider\":\"The address of the service provider.\",\"verifier\":\"The address of the verifier.\"},\"returns\":{\"_0\":\"The amount of tokens available.\"}},\"hasStake(address)\":{\"params\":{\"indexer\":\"Address of the indexer\"},\"returns\":{\"_0\":\"True if indexer has staked tokens\"}},\"isAllocation(address)\":{\"params\":{\"allocationID\":\"Address used as signer by the indexer for an allocation\"},\"returns\":{\"_0\":\"True if allocationID already used\"}},\"isAllowedLockedVerifier(address)\":{\"params\":{\"verifier\":\"Address of the verifier\"},\"returns\":{\"_0\":\"True if verifier is allowed locked verifier, false otherwise\"}},\"isAuthorized(address,address,address)\":{\"params\":{\"operator\":\"The address to check for auth\",\"serviceProvider\":\"The service provider on behalf of whom they're claiming to act\",\"verifier\":\"The verifier / data service on which they're claiming to act\"},\"returns\":{\"_0\":\"Whether the operator is authorized or not\"}},\"isDelegationSlashingEnabled()\":{\"returns\":{\"_0\":\"True if delegation slashing is enabled, false otherwise\"}},\"isOperator(address,address)\":{\"params\":{\"indexer\":\"Address of the service provider\",\"operator\":\"Address of the operator\"},\"returns\":{\"_0\":\"True if operator is allowed for indexer, false otherwise\"}},\"legacySlash(address,uint256,uint256,address)\":{\"details\":\"Can only be called by the slasher role.\",\"params\":{\"beneficiary\":\"Address of a beneficiary to receive a reward for the slashing\",\"indexer\":\"Address of indexer to slash\",\"reward\":\"Amount of reward tokens to send to a beneficiary\",\"tokens\":\"Amount of tokens to slash from the indexer stake\"}},\"provision(address,address,uint256,uint32,uint64)\":{\"details\":\"During the transition period, only the subgraph data service can be used as a verifier. This prevents an escape hatch for legacy allocation stake.Requirements: - `tokens` cannot be zero. - The `serviceProvider` must have enough idle stake to cover the tokens to provision. - `maxVerifierCut` must be a valid PPM. - `thawingPeriod` must be less than or equal to `_maxThawingPeriod`. Emits a {ProvisionCreated} event.\",\"params\":{\"maxVerifierCut\":\"The maximum cut, expressed in PPM, that a verifier can transfer instead of burning when slashing\",\"serviceProvider\":\"The service provider address\",\"thawingPeriod\":\"The period in seconds that the tokens will be thawing before they can be removed from the provision\",\"tokens\":\"The amount of tokens that will be locked and slashable\",\"verifier\":\"The verifier address for which the tokens are provisioned (who will be able to slash the tokens)\"}},\"provisionLocked(address,address,uint256,uint32,uint64)\":{\"details\":\"See {provision}. Additional requirements: - The `verifier` must be allowed to be used for locked provisions.\",\"params\":{\"maxVerifierCut\":\"The maximum cut, expressed in PPM, that a verifier can transfer instead of burning when slashing\",\"serviceProvider\":\"The service provider address\",\"thawingPeriod\":\"The period in seconds that the tokens will be thawing before they can be removed from the provision\",\"tokens\":\"The amount of tokens that will be locked and slashable\",\"verifier\":\"The verifier address for which the tokens are provisioned (who will be able to slash the tokens)\"}},\"redelegate(address,address,address,address,uint256,uint256)\":{\"details\":\"The parameter `nThawRequests` can be set to a non zero value to fulfill a specific number of thaw requests in the event that fulfilling all of them results in a gas limit error. Requirements: - Must have previously initiated a thaw request using {undelegate}. - `newServiceProvider` and `newVerifier` must not be the zero address. - `newServiceProvider` must have previously provisioned stake to `newVerifier`. Emits {ThawRequestFulfilled}, {ThawRequestsFulfilled} and {DelegatedTokensWithdrawn} events.\",\"params\":{\"minSharesForNewProvider\":\"The minimum amount of shares to accept for the new service provider\",\"nThawRequests\":\"The number of thaw requests to fulfill. Set to 0 to fulfill all thaw requests.\",\"newServiceProvider\":\"The address of a new service provider\",\"newVerifier\":\"The address of a new verifier\",\"oldServiceProvider\":\"The old service provider address\",\"oldVerifier\":\"The old verifier address\"}},\"reprovision(address,address,address,uint256)\":{\"details\":\"Requirements: - Must have previously initiated a thaw request using {thaw}. - `tokens` cannot be zero. - The `serviceProvider` must have previously provisioned stake to `newVerifier`. - The `serviceProvider` must have enough idle stake to cover the tokens to add. Emits {ThawRequestFulfilled}, {ThawRequestsFulfilled}, {TokensDeprovisioned} and {ProvisionIncreased} events.\",\"params\":{\"nThawRequests\":\"The number of thaw requests to fulfill. Set to 0 to fulfill all thaw requests.\",\"newVerifier\":\"The verifier address for which the tokens will be provisioned\",\"oldVerifier\":\"The verifier address for which the tokens are currently provisioned\",\"serviceProvider\":\"The service provider address\"}},\"setAllowedLockedVerifier(address,bool)\":{\"details\":\"This function can only be called by the contract governor, it's used to maintain a whitelist of verifiers that do not allow the stake from a locked wallet to escape the lock.Emits a {AllowedLockedVerifierSet} event.\",\"params\":{\"allowed\":\"Whether the verifier is allowed or not\",\"verifier\":\"The verifier address\"}},\"setDelegationFeeCut(address,address,uint8,uint256)\":{\"details\":\"Emits a {DelegationFeeCutSet} event.\",\"params\":{\"feeCut\":\"The fee cut to set, in PPM\",\"paymentType\":\"The payment type for which the fee cut is set, as defined in {IGraphPayments}\",\"serviceProvider\":\"The service provider address\",\"verifier\":\"The verifier address\"}},\"setDelegationSlashingEnabled()\":{\"details\":\"This function can only be called by the contract governor.\"},\"setMaxThawingPeriod(uint64)\":{\"params\":{\"maxThawingPeriod\":\"The new maximum thawing period, in seconds\"}},\"setOperator(address,address,bool)\":{\"details\":\"Emits a {OperatorSet} event.\",\"params\":{\"allowed\":\"Whether the operator is authorized or not\",\"operator\":\"Address to authorize or unauthorize\",\"verifier\":\"The verifier / data service on which they'll be allowed to operate\"}},\"setOperatorLocked(address,address,bool)\":{\"details\":\"See {setOperator}. Additional requirements: - The `verifier` must be allowed to be used for locked provisions.\",\"params\":{\"allowed\":\"Whether the operator is authorized or not\",\"operator\":\"Address to authorize or unauthorize\",\"verifier\":\"The verifier / data service on which they'll be allowed to operate\"}},\"setProvisionParameters(address,address,uint32,uint64)\":{\"details\":\"This two step update process prevents the service provider from changing the parameters without the verifier's consent. Requirements: - `thawingPeriod` must be less than or equal to `_maxThawingPeriod`. Note that if `_maxThawingPeriod` changes the function will not revert if called with the same thawing period as the current one. Emits a {ProvisionParametersStaged} event if at least one of the parameters changed.\",\"params\":{\"maxVerifierCut\":\"The proposed maximum cut, expressed in PPM of the slashed amount, that a verifier can take for themselves when slashing\",\"serviceProvider\":\"The service provider address\",\"thawingPeriod\":\"The proposed period in seconds that the tokens will be thawing before they can be removed from the provision\",\"verifier\":\"The verifier address\"}},\"slash(address,uint256,uint256,address)\":{\"details\":\"Requirements: - `tokens` must be less than or equal to the amount of tokens provisioned by the service provider. - `tokensVerifier` must be less than the provision's tokens times the provision's maximum verifier cut. Emits a {ProvisionSlashed} and {VerifierTokensSent} events. Emits a {DelegationSlashed} or {DelegationSlashingSkipped} event depending on the global delegation slashing flag.\",\"params\":{\"serviceProvider\":\"The service provider to slash\",\"tokens\":\"The amount of tokens to slash\",\"tokensVerifier\":\"The amount of tokens to transfer instead of burning\",\"verifierDestination\":\"The address to transfer the verifier cut to\"}},\"stake(uint256)\":{\"details\":\"Pulls tokens from the caller. Requirements: - `_tokens` cannot be zero. - Caller must have previously approved this contract to pull tokens from their balance. Emits a {HorizonStakeDeposited} event.\",\"params\":{\"tokens\":\"Amount of tokens to stake\"}},\"stakeTo(address,uint256)\":{\"details\":\"Pulls tokens from the caller. Requirements: - `_tokens` cannot be zero. - Caller must have previously approved this contract to pull tokens from their balance. Emits a {HorizonStakeDeposited} event.\",\"params\":{\"serviceProvider\":\"Address of the service provider\",\"tokens\":\"Amount of tokens to stake\"}},\"stakeToProvision(address,address,uint256)\":{\"details\":\"This function can be called by the service provider, by an authorized operator or by the verifier itself.Requirements: - The `serviceProvider` must have previously provisioned stake to `verifier`. - `_tokens` cannot be zero. - Caller must have previously approved this contract to pull tokens from their balance. Emits {HorizonStakeDeposited} and {ProvisionIncreased} events.\",\"params\":{\"serviceProvider\":\"Address of the service provider\",\"tokens\":\"Amount of tokens to stake\",\"verifier\":\"Address of the verifier\"}},\"thaw(address,address,uint256)\":{\"details\":\"Requirements: - The provision must have enough tokens available to thaw. - `tokens` cannot be zero. Emits {ProvisionThawed} and {ThawRequestCreated} events.\",\"params\":{\"serviceProvider\":\"The service provider address\",\"tokens\":\"The amount of tokens to thaw\",\"verifier\":\"The verifier address for which the tokens are provisioned\"},\"returns\":{\"_0\":\"The ID of the thaw request\"}},\"undelegate(address,address,uint256)\":{\"params\":{\"serviceProvider\":\"The service provider address\",\"shares\":\"The amount of shares to undelegate\",\"verifier\":\"The verifier address\"},\"returns\":{\"_0\":\"The ID of the thaw request\"}},\"undelegate(address,uint256)\":{\"details\":\"See {undelegate}.\",\"params\":{\"serviceProvider\":\"The service provider address\",\"shares\":\"The amount of shares to undelegate\"}},\"unstake(uint256)\":{\"details\":\"Requirements: - `_tokens` cannot be zero. - `_serviceProvider` must have enough idle stake to cover the staking amount and any legacy allocation. Emits a {HorizonStakeLocked} event during the transition period. Emits a {HorizonStakeWithdrawn} event after the transition period.\",\"params\":{\"tokens\":\"Amount of tokens to unstake\"}},\"withdraw()\":{\"details\":\"This is only needed during the transition period while we still have a global lock. After that, unstake() will automatically withdraw.\"},\"withdrawDelegated(address,address)\":{\"details\":\"See {delegate}.\",\"params\":{\"deprecated\":\"Deprecated parameter kept for backwards compatibility\",\"serviceProvider\":\"The service provider address\"},\"returns\":{\"_0\":\"The amount of tokens withdrawn\"}},\"withdrawDelegated(address,address,uint256)\":{\"details\":\"The parameter `nThawRequests` can be set to a non zero value to fulfill a specific number of thaw requests in the event that fulfilling all of them results in a gas limit error. Otherwise, the function will attempt to fulfill all thaw requests until the first one that is not yet expired is found.If the delegation pool was completely slashed before withdrawing, calling this function will fulfill the thaw requests with an amount equal to zero. Requirements: - Must have previously initiated a thaw request using {undelegate}. Emits {ThawRequestFulfilled}, {ThawRequestsFulfilled} and {DelegatedTokensWithdrawn} events.\",\"params\":{\"nThawRequests\":\"The number of thaw requests to fulfill. Set to 0 to fulfill all thaw requests.\",\"serviceProvider\":\"The service provider address\",\"verifier\":\"The verifier address\"}}},\"title\":\"Complete interface for the Horizon Staking contract\",\"version\":1},\"userdoc\":{\"errors\":{\"HorizonStakingCallerIsServiceProvider()\":[{\"notice\":\"Thrown when a service provider attempts to change their own operator access.\"}],\"HorizonStakingInsufficientDelegationTokens(uint256,uint256)\":[{\"notice\":\"Thrown when the minimum token amount required for delegation is not met.\"}],\"HorizonStakingInsufficientIdleStake(uint256,uint256)\":[{\"notice\":\"Thrown when the service provider has insufficient idle stake to operate.\"}],\"HorizonStakingInsufficientShares(uint256,uint256)\":[{\"notice\":\"Thrown when a minimum share amount is required to operate but it's not met.\"}],\"HorizonStakingInsufficientStakeForLegacyAllocations(uint256,uint256)\":[{\"notice\":\"Thrown during the transition period when the service provider has insufficient stake to cover their existing legacy allocations.\"}],\"HorizonStakingInsufficientTokens(uint256,uint256)\":[{\"notice\":\"Thrown when a minimum token amount is required to operate but it's not met.\"}],\"HorizonStakingInvalidDelegationFeeCut(uint256)\":[{\"notice\":\"Thrown when trying to set a delegation fee cut that is not valid.\"}],\"HorizonStakingInvalidDelegationPool(address,address)\":[{\"notice\":\"Thrown when attempting to operate with a delegation pool that does not exist.\"}],\"HorizonStakingInvalidDelegationPoolState(address,address)\":[{\"notice\":\"Thrown when as a result of slashing delegation pool has no tokens but has shares.\"}],\"HorizonStakingInvalidMaxVerifierCut(uint32)\":[{\"notice\":\"Thrown when attempting to create a provision with an invalid maximum verifier cut.\"}],\"HorizonStakingInvalidProvision(address,address)\":[{\"notice\":\"Thrown when attempting to operate with a provision that does not exist.\"}],\"HorizonStakingInvalidServiceProviderZeroAddress()\":[{\"notice\":\"Thrown when attempting to redelegate with a serivce provider that is the zero address.\"}],\"HorizonStakingInvalidThawRequestType()\":[{\"notice\":\"Thrown when using an invalid thaw request type.\"}],\"HorizonStakingInvalidThawingPeriod(uint64,uint64)\":[{\"notice\":\"Thrown when attempting to create a provision with an invalid thawing period.\"}],\"HorizonStakingInvalidVerifier(address)\":[{\"notice\":\"Thrown when attempting to create a provision with a verifier other than the subgraph data service. This restriction only applies during the transition period.\"}],\"HorizonStakingInvalidVerifierZeroAddress()\":[{\"notice\":\"Thrown when attempting to redelegate with a verifier that is the zero address.\"}],\"HorizonStakingInvalidZeroShares()\":[{\"notice\":\"Thrown when operating a zero share amount is not allowed.\"}],\"HorizonStakingInvalidZeroTokens()\":[{\"notice\":\"Thrown when operating a zero token amount is not allowed.\"}],\"HorizonStakingLegacySlashFailed()\":[{\"notice\":\"Thrown when a legacy slash fails.\"}],\"HorizonStakingNoTokensToSlash()\":[{\"notice\":\"Thrown when there attempting to slash a provision with no tokens to slash.\"}],\"HorizonStakingNotAuthorized(address,address,address)\":[{\"notice\":\"Thrown when the caller is not authorized to operate on a provision.\"}],\"HorizonStakingNothingThawing()\":[{\"notice\":\"Thrown when attempting to fulfill a thaw request but there is nothing thawing.\"}],\"HorizonStakingNothingToWithdraw()\":[{\"notice\":\"Thrown when attempting to withdraw tokens that have not thawed (legacy undelegate).\"}],\"HorizonStakingProvisionAlreadyExists()\":[{\"notice\":\"Thrown when attempting to create a provision for a data service that already has a provision.\"}],\"HorizonStakingSlippageProtection(uint256,uint256)\":[{\"notice\":\"Thrown when delegation shares obtained are below the expected amount.\"}],\"HorizonStakingStillThawing(uint256)\":[{\"notice\":\"Thrown during the transition period when attempting to withdraw tokens that are still thawing.\"}],\"HorizonStakingTooManyThawRequests()\":[{\"notice\":\"Thrown when a service provider has too many thaw requests.\"}],\"HorizonStakingTooManyTokens(uint256,uint256)\":[{\"notice\":\"Thrown when the amount of tokens exceeds the maximum allowed to operate.\"}],\"HorizonStakingVerifierNotAllowed(address)\":[{\"notice\":\"Thrown when a service provider attempts to operate on verifiers that are not allowed.\"}]},\"events\":{\"AllowedLockedVerifierSet(address,bool)\":{\"notice\":\"Emitted when a verifier is allowed or disallowed to be used for locked provisions.\"},\"DelegatedTokensWithdrawn(address,address,address,uint256)\":{\"notice\":\"Emitted when a delegator withdraws tokens from a provision after thawing.\"},\"DelegationFeeCutSet(address,address,uint8,uint256)\":{\"notice\":\"Emitted when a service provider sets delegation fee cuts for a verifier.\"},\"DelegationSlashed(address,address,uint256)\":{\"notice\":\"Emitted when a delegation pool is slashed by a verifier.\"},\"DelegationSlashingEnabled()\":{\"notice\":\"Emitted when the delegation slashing global flag is set.\"},\"DelegationSlashingSkipped(address,address,uint256)\":{\"notice\":\"Emitted when a delegation pool would have been slashed by a verifier, but the slashing was skipped because delegation slashing global parameter is not enabled.\"},\"HorizonStakeDeposited(address,uint256)\":{\"notice\":\"Emitted when a service provider stakes tokens.\"},\"HorizonStakeLocked(address,uint256,uint256)\":{\"notice\":\"Emitted when a service provider unstakes tokens during the transition period.\"},\"HorizonStakeWithdrawn(address,uint256)\":{\"notice\":\"Emitted when a service provider withdraws tokens during the transition period.\"},\"MaxThawingPeriodSet(uint64)\":{\"notice\":\"Emitted when the global maximum thawing period allowed for provisions is set.\"},\"ProvisionCreated(address,address,uint256,uint32,uint64)\":{\"notice\":\"Emitted when a service provider provisions staked tokens to a verifier.\"},\"ProvisionIncreased(address,address,uint256)\":{\"notice\":\"Emitted whenever staked tokens are added to an existing provision\"},\"ProvisionParametersSet(address,address,uint32,uint64)\":{\"notice\":\"Emitted when a service provider accepts a staged provision parameter update.\"},\"ProvisionParametersStaged(address,address,uint32,uint64)\":{\"notice\":\"Emitted when a service provider stages a provision parameter update.\"},\"ProvisionSlashed(address,address,uint256)\":{\"notice\":\"Emitted when a provision is slashed by a verifier.\"},\"ProvisionThawed(address,address,uint256)\":{\"notice\":\"Emitted when a service provider thaws tokens from a provision.\"},\"StakeDelegatedWithdrawn(address,address,uint256)\":{\"notice\":\"Emitted when `delegator` withdrew delegated `tokens` from `indexer` using `withdrawDelegated`.\"},\"ThawRequestCreated(uint8,address,address,address,uint256,uint64,bytes32,uint256)\":{\"notice\":\"Emitted when a thaw request is created.\"},\"ThawRequestFulfilled(uint8,bytes32,uint256,uint256,uint64,bool)\":{\"notice\":\"Emitted when a thaw request is fulfilled, meaning the stake is released.\"},\"ThawRequestsFulfilled(uint8,address,address,address,uint256,uint256)\":{\"notice\":\"Emitted when a series of thaw requests are fulfilled.\"},\"ThawingPeriodCleared()\":{\"notice\":\"Emitted when the legacy global thawing period is set to zero.\"},\"TokensDelegated(address,address,address,uint256,uint256)\":{\"notice\":\"Emitted when tokens are delegated to a provision.\"},\"TokensDeprovisioned(address,address,uint256)\":{\"notice\":\"Emitted when a service provider removes tokens from a provision.\"},\"TokensToDelegationPoolAdded(address,address,uint256)\":{\"notice\":\"Emitted when tokens are added to a delegation pool's reserve.\"},\"TokensUndelegated(address,address,address,uint256,uint256)\":{\"notice\":\"Emitted when a delegator undelegates tokens from a provision and starts thawing them.\"},\"VerifierTokensSent(address,address,address,uint256)\":{\"notice\":\"Emitted when the verifier cut is sent to the verifier after slashing a provision.\"}},\"kind\":\"user\",\"methods\":{\"__DEPRECATED_getThawingPeriod()\":{\"notice\":\"Return the time in blocks to unstake Deprecated, now enforced by each data service (verifier)\"},\"acceptProvisionParameters(address)\":{\"notice\":\"Accepts a staged provision parameter update.\"},\"addToDelegationPool(address,address,uint256)\":{\"notice\":\"Add tokens to a delegation pool without issuing shares. Used by data services to pay delegation fees/rewards. Delegators SHOULD NOT call this function.\"},\"addToProvision(address,address,uint256)\":{\"notice\":\"Adds tokens from the service provider's idle stake to a provision\"},\"clearThawingPeriod()\":{\"notice\":\"Clear the legacy global thawing period. This signifies the end of the transition period, after which no legacy allocations should be left.\"},\"closeAllocation(address,bytes32)\":{\"notice\":\"Close an allocation and free the staked tokens. To be eligible for rewards a proof of indexing must be presented. Presenting a bad proof is subject to slashable condition. To opt out of rewards set _poi to 0x0\"},\"delegate(address,address,uint256,uint256)\":{\"notice\":\"Delegate tokens to a provision.\"},\"delegate(address,uint256)\":{\"notice\":\"Delegate tokens to the subgraph data service provision. This function is for backwards compatibility with the legacy staking contract. It only allows delegating to the subgraph data service and DOES NOT have slippage protection.\"},\"deprovision(address,address,uint256)\":{\"notice\":\"Remove tokens from a provision and move them back to the service provider's idle stake.\"},\"getAllocation(address)\":{\"notice\":\"Return the allocation by ID.\"},\"getAllocationState(address)\":{\"notice\":\"Return the current state of an allocation\"},\"getDelegatedTokensAvailable(address,address)\":{\"notice\":\"Gets the delegator's tokens available in a provision.\"},\"getDelegation(address,address,address)\":{\"notice\":\"Gets the details of a delegation.\"},\"getDelegationFeeCut(address,address,uint8)\":{\"notice\":\"Gets the delegation fee cut for a payment type.\"},\"getDelegationPool(address,address)\":{\"notice\":\"Gets the details of delegation pool.\"},\"getIdleStake(address)\":{\"notice\":\"Gets the service provider's idle stake which is the stake that is not being used for any provision. Note that this only includes service provider's self stake.\"},\"getIndexerStakedTokens(address)\":{\"notice\":\"Get the total amount of tokens staked by the indexer.\"},\"getMaxThawingPeriod()\":{\"notice\":\"Gets the maximum allowed thawing period for a provision.\"},\"getProviderTokensAvailable(address,address)\":{\"notice\":\"Gets the service provider's tokens available in a provision.\"},\"getProvision(address,address)\":{\"notice\":\"Gets the details of a provision.\"},\"getServiceProvider(address)\":{\"notice\":\"Gets the details of a service provider.\"},\"getStake(address)\":{\"notice\":\"Gets the stake of a service provider.\"},\"getStakingExtension()\":{\"notice\":\"Get the address of the staking extension.\"},\"getSubgraphAllocatedTokens(bytes32)\":{\"notice\":\"Return the total amount of tokens allocated to subgraph.\"},\"getSubgraphService()\":{\"notice\":\"Return the address of the subgraph data service.\"},\"getThawRequest(uint8,bytes32)\":{\"notice\":\"Gets a thaw request.\"},\"getThawRequestList(uint8,address,address,address)\":{\"notice\":\"Gets the metadata of a thaw request list. Service provider and delegators each have their own thaw request list per provision. Metadata includes the head and tail of the list, plus the total number of thaw requests.\"},\"getThawedTokens(uint8,address,address,address)\":{\"notice\":\"Gets the amount of thawed tokens that can be releasedfor a given provision.\"},\"getTokensAvailable(address,address,uint32)\":{\"notice\":\"Gets the tokens available in a provision. Tokens available are the tokens in a provision that are not thawing. Includes service provider's and delegator's stake. Allows specifying a `delegationRatio` which caps the amount of delegated tokens that are considered available.\"},\"hasStake(address)\":{\"notice\":\"Getter that returns if an indexer has any stake.\"},\"isAllocation(address)\":{\"notice\":\"Return if allocationID is used.\"},\"isAllowedLockedVerifier(address)\":{\"notice\":\"Return true if the verifier is an allowed locked verifier.\"},\"isAuthorized(address,address,address)\":{\"notice\":\"Check if an operator is authorized for the caller on a specific verifier / data service.\"},\"isDelegationSlashingEnabled()\":{\"notice\":\"Return true if delegation slashing is enabled, false otherwise.\"},\"isOperator(address,address)\":{\"notice\":\"(Legacy) Return true if operator is allowed for the service provider on the subgraph data service.\"},\"legacySlash(address,uint256,uint256,address)\":{\"notice\":\"Slash the indexer stake. Delegated tokens are not subject to slashing. Note that depending on the state of the indexer's stake, the slashed amount might be smaller than the requested slash amount. This can happen if the indexer has moved a significant part of their stake to a provision. Any outstanding slashing amount should be settled using Horizon's slash function {IHorizonStaking.slash}.\"},\"provision(address,address,uint256,uint32,uint64)\":{\"notice\":\"Provision stake to a verifier. The tokens will be locked with a thawing period and will be slashable by the verifier. This is the main mechanism to provision stake to a data service, where the data service is the verifier. This function can be called by the service provider or by an operator authorized by the provider for this specific verifier.\"},\"provisionLocked(address,address,uint256,uint32,uint64)\":{\"notice\":\"Provision stake to a verifier using locked tokens (i.e. from GraphTokenLockWallets).\"},\"redelegate(address,address,address,address,uint256,uint256)\":{\"notice\":\"Re-delegate undelegated tokens from a provision after thawing to a `newServiceProvider` and `newVerifier`.\"},\"reprovision(address,address,address,uint256)\":{\"notice\":\"Move already thawed stake from one provision into another provision This function can be called by the service provider or by an operator authorized by the provider for the two corresponding verifiers.\"},\"setAllowedLockedVerifier(address,bool)\":{\"notice\":\"Sets a verifier as a globally allowed verifier for locked provisions.\"},\"setDelegationFeeCut(address,address,uint8,uint256)\":{\"notice\":\"Set the fee cut for a verifier on a specific payment type.\"},\"setDelegationSlashingEnabled()\":{\"notice\":\"Set the global delegation slashing flag to true.\"},\"setMaxThawingPeriod(uint64)\":{\"notice\":\"Sets the global maximum thawing period allowed for provisions.\"},\"setOperator(address,address,bool)\":{\"notice\":\"Authorize or unauthorize an address to be an operator for the caller on a data service.\"},\"setOperatorLocked(address,address,bool)\":{\"notice\":\"Authorize or unauthorize an address to be an operator for the caller on a verifier.\"},\"setProvisionParameters(address,address,uint32,uint64)\":{\"notice\":\"Stages a provision parameter update. Note that the change is not effective until the verifier calls {acceptProvisionParameters}. Calling this function is a no-op if the new parameters are the same as the current ones.\"},\"slash(address,uint256,uint256,address)\":{\"notice\":\"Slash a service provider. This can only be called by a verifier to which the provider has provisioned stake, and up to the amount of tokens they have provisioned. If the service provider's stake is not enough, the associated delegation pool might be slashed depending on the value of the global delegation slashing flag. Part of the slashed tokens are sent to the `verifierDestination` as a reward.\"},\"stake(uint256)\":{\"notice\":\"Deposit tokens on the staking contract.\"},\"stakeTo(address,uint256)\":{\"notice\":\"Deposit tokens on the service provider stake, on behalf of the service provider.\"},\"stakeToProvision(address,address,uint256)\":{\"notice\":\"Deposit tokens on the service provider stake, on behalf of the service provider, provisioned to a specific verifier.\"},\"thaw(address,address,uint256)\":{\"notice\":\"Start thawing tokens to remove them from a provision. This function can be called by the service provider or by an operator authorized by the provider for this specific verifier. Note that removing tokens from a provision is a two step process: - First the tokens are thawed using this function. - Then after the thawing period, the tokens are removed from the provision using {deprovision} or {reprovision}.\"},\"undelegate(address,address,uint256)\":{\"notice\":\"Undelegate tokens from a provision and start thawing them. Note that undelegating tokens from a provision is a two step process: - First the tokens are thawed using this function. - Then after the thawing period, the tokens are removed from the provision using {withdrawDelegated}. Requirements: - `shares` cannot be zero. Emits a {TokensUndelegated} and {ThawRequestCreated} event.\"},\"undelegate(address,uint256)\":{\"notice\":\"Undelegate tokens from the subgraph data service provision and start thawing them. This function is for backwards compatibility with the legacy staking contract. It only allows undelegating from the subgraph data service.\"},\"unstake(uint256)\":{\"notice\":\"Move idle stake back to the owner's account. Stake is removed from the protocol: - During the transition period it's locked for a period of time before it can be withdrawn by calling {withdraw}. - After the transition period it's immediately withdrawn. Note that after the transition period if there are tokens still locked they will have to be withdrawn by calling {withdraw}.\"},\"withdraw()\":{\"notice\":\"Withdraw service provider tokens once the thawing period (initiated by {unstake}) has passed. All thawed tokens are withdrawn.\"},\"withdrawDelegated(address,address)\":{\"notice\":\"Withdraw undelegated tokens from the subgraph data service provision after thawing. This function is for backwards compatibility with the legacy staking contract. It only allows withdrawing tokens undelegated before horizon upgrade.\"},\"withdrawDelegated(address,address,uint256)\":{\"notice\":\"Withdraw undelegated tokens from a provision after thawing.\"}},\"notice\":\"This interface exposes all functions implemented by the {HorizonStaking} contract and its extension {HorizonStakingExtension} as well as the custom data types used by the contract.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"@graphprotocol/horizon/contracts/interfaces/IHorizonStaking.sol\":\"IHorizonStaking\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10},\"remappings\":[]},\"sources\":{\"@graphprotocol/contracts/contracts/rewards/IRewardsIssuer.sol\":{\"keccak256\":\"0xe049090c38a64d80b284ba2a7b440bcedba9804d96f2bb8da525e69ac452e03a\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://8b7d1186bd0698bed02d3504ac80c20e605087fba036d5ff392b39a9a3c818e5\",\"dweb:/ipfs/QmRgAfY1dD5rc7fLuuGVyu2mh9Z8qz1AVvuXAcRGnB3dSv\"]},\"@graphprotocol/horizon/contracts/interfaces/IGraphPayments.sol\":{\"keccak256\":\"0xa22dcc47676073113e4ebe30045065662cee5531f9c5f75776c00e70a1929c81\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://8908f30b3c7536798b14dc62fb5ccffc05570d568dbd1bade7c79c1fd2a4b5fe\",\"dweb:/ipfs/QmexZgb5mhDmXVZnYX1Z37cwM7EG2prYyBEVjUSVdKshVr\"]},\"@graphprotocol/horizon/contracts/interfaces/IHorizonStaking.sol\":{\"keccak256\":\"0x4b146f30ee66c4224cb5a82bafc8299f8596d8fe302e793757520f67bba8a166\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://30666c737d72a850223c1966d3b5d02b84f3f808f3c8dae8d0748731646b60c5\",\"dweb:/ipfs/QmQschyZQtU8tTnQ9hNiG5nobuXBx6KeiKdfxvZ4zvQ7ty\"]},\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingBase.sol\":{\"keccak256\":\"0x9bdab6cb595eabd7d321d7beae03ad3607995c14ef40f0c2f349fb72084766c5\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://6cac2ca3580bd770b98b07b11ebb007e8a922a90cde920e6ec472df7e66fb512\",\"dweb:/ipfs/QmRw1rjT8D8gNp2GRTuwDETwHNHMpHKoHZq4pYBAn9i65F\"]},\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingExtension.sol\":{\"keccak256\":\"0x7923f39746198b5672f0e4d65b7bf14903ae5f7775d74b210effb957eea36c71\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://c29531aff69c71e649fb347d7117ea8c42fc8de09860a1c389ed9b8f097a34e0\",\"dweb:/ipfs/QmS89fww584HiyE1BdPe8Xaqbf5v7FEvL38GTxeHEAsLFm\"]},\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingMain.sol\":{\"keccak256\":\"0xd04bb1f6a427e858e8a625b4b9835c69c8891a324d22beba20293ab2a77e5de7\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://05c9e425eee0b6c109a8dad2edcf9e1c845c64fccf321edf804921394ee048be\",\"dweb:/ipfs/QmbwLWNof534oG5ohzNAWrjdQ5kqJs7M5d5kCRd68XUogB\"]},\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingTypes.sol\":{\"keccak256\":\"0xaaeb9770f8aaae6b395e87bb1876a10fe7c14384d16d97dd33a671c3ea53aa7b\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://8f5c019fdb2df73bafe464fb6e9da792f7833a0c1858734bcd6a6b8d6ae924c7\",\"dweb:/ipfs/QmcubeYTHCYBqQsRncBFpPFtk7JzRz4nFh27LUW1m4hx2K\"]},\"@graphprotocol/horizon/contracts/libraries/LinkedList.sol\":{\"keccak256\":\"0x99058b4da0428b8d9c22d3d112acbaa59900f1fd0a434038b1a4fccfe3c678d6\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://568e03231c6081eacbcb6585a05c0b1bb976b640b611f7bf6155f9b58d887239\",\"dweb:/ipfs/QmdPZQWhkhjf5TUwz487Dwm4ycjX323iNdwb1sQnAiA1Qu\"]}},\"version\":1}" + } + }, + "@graphprotocol/horizon/contracts/interfaces/IPaymentsCollector.sol": { + "IPaymentsCollector": { + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "paymentType", + "type": "uint8" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "collectionId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "dataService", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "PaymentCollected", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "paymentType", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "collect", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "evm": { + "bytecode": { + "functionDebugData": {}, + "generatedSources": [], + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "deployedBytecode": { + "functionDebugData": {}, + "generatedSources": [], + "immutableReferences": {}, + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "methodIdentifiers": { + "collect(uint8,bytes)": "7f07d283" + } + }, + "metadata": "{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"enum IGraphPayments.PaymentTypes\",\"name\":\"paymentType\",\"type\":\"uint8\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"collectionId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"payer\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dataService\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"PaymentCollected\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"enum IGraphPayments.PaymentTypes\",\"name\":\"paymentType\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"collect\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"custom:security-contact\":\"Please email security+contracts@thegraph.com if you find any bugs. We may have an active bug bounty program.\",\"details\":\"It's important to note that it's the collector contract's responsibility to validate the payment request is legitimate.\",\"events\":{\"PaymentCollected(uint8,bytes32,address,address,address,uint256)\":{\"params\":{\"collectionId\":\"The id for the collection. Can be used at the discretion of the collector to group multiple payments.\",\"dataService\":\"The address of the data service\",\"payer\":\"The address of the payer\",\"paymentType\":\"The payment type collected as defined by {IGraphPayments}\",\"receiver\":\"The address of the receiver\",\"tokens\":\"The amount of tokens being collected\"}}},\"kind\":\"dev\",\"methods\":{\"collect(uint8,bytes)\":{\"details\":\"This function should require the caller to present some form of evidence of the payer's debt to the receiver. The collector should validate this evidence and, if valid, collect the payment. Emits a {PaymentCollected} event\",\"params\":{\"data\":\"Additional data required for the payment collection. Will vary depending on the collector implementation.\",\"paymentType\":\"The payment type to collect, as defined by {IGraphPayments}\"},\"returns\":{\"_0\":\"The amount of tokens collected\"}}},\"title\":\"Interface for a payments collector contract as defined by Graph Horizon payments protocol\",\"version\":1},\"userdoc\":{\"events\":{\"PaymentCollected(uint8,bytes32,address,address,address,uint256)\":{\"notice\":\"Emitted when a payment is collected\"}},\"kind\":\"user\",\"methods\":{\"collect(uint8,bytes)\":{\"notice\":\"Initiate a payment collection through the payments protocol\"}},\"notice\":\"Contracts implementing this interface can be used with the payments protocol. First, a payer must approve the collector to collect payments on their behalf. Only then can payment collection be initiated using the collector contract.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"@graphprotocol/horizon/contracts/interfaces/IPaymentsCollector.sol\":\"IPaymentsCollector\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10},\"remappings\":[]},\"sources\":{\"@graphprotocol/horizon/contracts/interfaces/IGraphPayments.sol\":{\"keccak256\":\"0xa22dcc47676073113e4ebe30045065662cee5531f9c5f75776c00e70a1929c81\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://8908f30b3c7536798b14dc62fb5ccffc05570d568dbd1bade7c79c1fd2a4b5fe\",\"dweb:/ipfs/QmexZgb5mhDmXVZnYX1Z37cwM7EG2prYyBEVjUSVdKshVr\"]},\"@graphprotocol/horizon/contracts/interfaces/IPaymentsCollector.sol\":{\"keccak256\":\"0x0871e02129e1fabdb39024f9ac3368b4c747e6b374fdf4fc200d3c225ed82860\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://a5fdf2dbedc15f739e6010a3ce3478ea7ad23bd643a8af3f39ccf631c06ebd52\",\"dweb:/ipfs/QmNusbPTqzzUwGomXBzsWHwbZMJ2HuTkxvgviLJZ6hr9i4\"]}},\"version\":1}" + } + }, + "@graphprotocol/horizon/contracts/interfaces/IPaymentsEscrow.sol": { + "IPaymentsEscrow": { + "abi": [ + { + "inputs": [ + { + "internalType": "uint256", + "name": "balanceBefore", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "balanceAfter", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "PaymentsEscrowInconsistentCollection", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minBalance", + "type": "uint256" + } + ], + "name": "PaymentsEscrowInsufficientBalance", + "type": "error" + }, + { + "inputs": [], + "name": "PaymentsEscrowInvalidZeroTokens", + "type": "error" + }, + { + "inputs": [], + "name": "PaymentsEscrowIsPaused", + "type": "error" + }, + { + "inputs": [], + "name": "PaymentsEscrowNotThawing", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "currentTimestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "thawEndTimestamp", + "type": "uint256" + } + ], + "name": "PaymentsEscrowStillThawing", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "thawingPeriod", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxWaitPeriod", + "type": "uint256" + } + ], + "name": "PaymentsEscrowThawingPeriodTooLong", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "collector", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensThawing", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "thawEndTimestamp", + "type": "uint256" + } + ], + "name": "CancelThaw", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "collector", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "Deposit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "paymentType", + "type": "uint8" + }, + { + "indexed": true, + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "collector", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "receiverDestination", + "type": "address" + } + ], + "name": "EscrowCollected", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "collector", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "thawEndTimestamp", + "type": "uint256" + } + ], + "name": "Thaw", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "collector", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "Withdraw", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "collector", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + } + ], + "name": "cancelThaw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "paymentType", + "type": "uint8" + }, + { + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "address", + "name": "dataService", + "type": "address" + }, + { + "internalType": "uint256", + "name": "dataServiceCut", + "type": "uint256" + }, + { + "internalType": "address", + "name": "receiverDestination", + "type": "address" + } + ], + "name": "collect", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "collector", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "deposit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "internalType": "address", + "name": "collector", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "depositTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "internalType": "address", + "name": "collector", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + } + ], + "name": "getBalance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "collector", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "thaw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "collector", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + } + ], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "evm": { + "bytecode": { + "functionDebugData": {}, + "generatedSources": [], + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "deployedBytecode": { + "functionDebugData": {}, + "generatedSources": [], + "immutableReferences": {}, + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "methodIdentifiers": { + "cancelThaw(address,address)": "b1d07de4", + "collect(uint8,address,address,uint256,address,uint256,address)": "1230fa3e", + "deposit(address,address,uint256)": "8340f549", + "depositTo(address,address,address,uint256)": "72eb521e", + "getBalance(address,address,address)": "d6bd603c", + "initialize()": "8129fc1c", + "thaw(address,address,uint256)": "f93f1cd0", + "withdraw(address,address)": "f940e385" + } + }, + "metadata": "{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"balanceBefore\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"balanceAfter\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"PaymentsEscrowInconsistentCollection\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"balance\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minBalance\",\"type\":\"uint256\"}],\"name\":\"PaymentsEscrowInsufficientBalance\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PaymentsEscrowInvalidZeroTokens\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PaymentsEscrowIsPaused\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PaymentsEscrowNotThawing\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"currentTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"thawEndTimestamp\",\"type\":\"uint256\"}],\"name\":\"PaymentsEscrowStillThawing\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"thawingPeriod\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxWaitPeriod\",\"type\":\"uint256\"}],\"name\":\"PaymentsEscrowThawingPeriodTooLong\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"payer\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"collector\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokensThawing\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"thawEndTimestamp\",\"type\":\"uint256\"}],\"name\":\"CancelThaw\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"payer\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"collector\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"Deposit\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"enum IGraphPayments.PaymentTypes\",\"name\":\"paymentType\",\"type\":\"uint8\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"payer\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"collector\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"receiverDestination\",\"type\":\"address\"}],\"name\":\"EscrowCollected\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"payer\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"collector\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"thawEndTimestamp\",\"type\":\"uint256\"}],\"name\":\"Thaw\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"payer\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"collector\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"Withdraw\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"collector\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"}],\"name\":\"cancelThaw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"enum IGraphPayments.PaymentTypes\",\"name\":\"paymentType\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"payer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"dataService\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"dataServiceCut\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"receiverDestination\",\"type\":\"address\"}],\"name\":\"collect\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"collector\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"deposit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"payer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"collector\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"depositTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"payer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"collector\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"}],\"name\":\"getBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"collector\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"thaw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"collector\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"}],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"custom:security-contact\":\"Please email security+contracts@thegraph.com if you find any bugs. We may have an active bug bounty program.\",\"errors\":{\"PaymentsEscrowInconsistentCollection(uint256,uint256,uint256)\":[{\"params\":{\"balanceAfter\":\"The balance after the collection\",\"balanceBefore\":\"The balance before the collection\",\"tokens\":\"The amount of tokens collected\"}}],\"PaymentsEscrowInsufficientBalance(uint256,uint256)\":[{\"params\":{\"balance\":\"The current balance\",\"minBalance\":\"The minimum required balance\"}}],\"PaymentsEscrowStillThawing(uint256,uint256)\":[{\"params\":{\"currentTimestamp\":\"The current timestamp\",\"thawEndTimestamp\":\"The timestamp at which the thawing period ends\"}}],\"PaymentsEscrowThawingPeriodTooLong(uint256,uint256)\":[{\"params\":{\"maxWaitPeriod\":\"The maximum wait period\",\"thawingPeriod\":\"The thawing period\"}}]},\"events\":{\"CancelThaw(address,address,address,uint256,uint256)\":{\"params\":{\"collector\":\"The address of the collector\",\"payer\":\"The address of the payer\",\"receiver\":\"The address of the receiver\",\"thawEndTimestamp\":\"The timestamp at which the thawing period was ending\",\"tokensThawing\":\"The amount of tokens that were being thawed\"}},\"Deposit(address,address,address,uint256)\":{\"params\":{\"collector\":\"The address of the collector\",\"payer\":\"The address of the payer\",\"receiver\":\"The address of the receiver\",\"tokens\":\"The amount of tokens deposited\"}},\"EscrowCollected(uint8,address,address,address,uint256,address)\":{\"params\":{\"collector\":\"The address of the collector\",\"payer\":\"The address of the payer\",\"paymentType\":\"The type of payment being collected as defined in the {IGraphPayments} interface\",\"receiver\":\"The address of the receiver\",\"receiverDestination\":\"The address where the receiver's payment should be sent.\",\"tokens\":\"The amount of tokens collected\"}},\"Thaw(address,address,address,uint256,uint256)\":{\"params\":{\"collector\":\"The address of the collector\",\"payer\":\"The address of the payer\",\"receiver\":\"The address of the receiver\",\"thawEndTimestamp\":\"The timestamp at which the thawing period ends\",\"tokens\":\"The amount of tokens being thawed\"}},\"Withdraw(address,address,address,uint256)\":{\"params\":{\"collector\":\"The address of the collector\",\"payer\":\"The address of the payer\",\"receiver\":\"The address of the receiver\",\"tokens\":\"The amount of tokens withdrawn\"}}},\"kind\":\"dev\",\"methods\":{\"cancelThaw(address,address)\":{\"details\":\"Requirements: - The payer must be thawing funds Emits a {CancelThaw} event.\",\"params\":{\"collector\":\"The address of the collector\",\"receiver\":\"The address of the receiver\"}},\"collect(uint8,address,address,uint256,address,uint256,address)\":{\"params\":{\"dataService\":\"The address of the data service\",\"dataServiceCut\":\"The data service cut in PPM that {GraphPayments} should send\",\"payer\":\"The address of the payer\",\"paymentType\":\"The type of payment being collected as defined in the {IGraphPayments} interface\",\"receiver\":\"The address of the receiver\",\"receiverDestination\":\"The address where the receiver's payment should be sent.\",\"tokens\":\"The amount of tokens to collect\"}},\"deposit(address,address,uint256)\":{\"details\":\"Emits a {Deposit} event\",\"params\":{\"collector\":\"The address of the collector\",\"receiver\":\"The address of the receiver\",\"tokens\":\"The amount of tokens to deposit\"}},\"depositTo(address,address,address,uint256)\":{\"details\":\"Emits a {Deposit} event\",\"params\":{\"collector\":\"The address of the collector\",\"payer\":\"The address of the payer\",\"receiver\":\"The address of the receiver\",\"tokens\":\"The amount of tokens to deposit\"}},\"getBalance(address,address,address)\":{\"params\":{\"collector\":\"The address of the collector\",\"payer\":\"The address of the payer\",\"receiver\":\"The address of the receiver\"},\"returns\":{\"_0\":\"The balance of the payer-collector-receiver tuple\"}},\"thaw(address,address,uint256)\":{\"details\":\"Requirements: - `tokens` must be less than or equal to the available balance Emits a {Thaw} event.\",\"params\":{\"collector\":\"The address of the collector\",\"receiver\":\"The address of the receiver\",\"tokens\":\"The amount of tokens to thaw\"}},\"withdraw(address,address)\":{\"details\":\"Requirements: - Funds must be thawed Emits a {Withdraw} event\",\"params\":{\"collector\":\"The address of the collector\",\"receiver\":\"The address of the receiver\"}}},\"title\":\"Interface for the {PaymentsEscrow} contract\",\"version\":1},\"userdoc\":{\"errors\":{\"PaymentsEscrowInconsistentCollection(uint256,uint256,uint256)\":[{\"notice\":\"Thrown when the contract balance is not consistent with the collection amount\"}],\"PaymentsEscrowInsufficientBalance(uint256,uint256)\":[{\"notice\":\"Thrown when the available balance is insufficient to perform an operation\"}],\"PaymentsEscrowInvalidZeroTokens()\":[{\"notice\":\"Thrown when operating a zero token amount is not allowed.\"}],\"PaymentsEscrowIsPaused()\":[{\"notice\":\"Thrown when a protected function is called and the contract is paused.\"}],\"PaymentsEscrowNotThawing()\":[{\"notice\":\"Thrown when a thawing is expected to be in progress but it is not\"}],\"PaymentsEscrowStillThawing(uint256,uint256)\":[{\"notice\":\"Thrown when a thawing is still in progress\"}],\"PaymentsEscrowThawingPeriodTooLong(uint256,uint256)\":[{\"notice\":\"Thrown when setting the thawing period to a value greater than the maximum\"}]},\"events\":{\"CancelThaw(address,address,address,uint256,uint256)\":{\"notice\":\"Emitted when a payer cancels an escrow thawing\"},\"Deposit(address,address,address,uint256)\":{\"notice\":\"Emitted when a payer deposits funds into the escrow for a payer-collector-receiver tuple\"},\"EscrowCollected(uint8,address,address,address,uint256,address)\":{\"notice\":\"Emitted when a collector collects funds from the escrow for a payer-collector-receiver tuple\"},\"Thaw(address,address,address,uint256,uint256)\":{\"notice\":\"Emitted when a payer thaws funds from the escrow for a payer-collector-receiver tuple\"},\"Withdraw(address,address,address,uint256)\":{\"notice\":\"Emitted when a payer withdraws funds from the escrow for a payer-collector-receiver tuple\"}},\"kind\":\"user\",\"methods\":{\"cancelThaw(address,address)\":{\"notice\":\"Cancels the thawing of escrow from a payer-collector-receiver's escrow account.\"},\"collect(uint8,address,address,uint256,address,uint256,address)\":{\"notice\":\"Collects funds from the payer-collector-receiver's escrow and sends them to {GraphPayments} for distribution using the Graph Horizon Payments protocol. The function will revert if there are not enough funds in the escrow. Emits an {EscrowCollected} event\"},\"deposit(address,address,uint256)\":{\"notice\":\"Deposits funds into the escrow for a payer-collector-receiver tuple, where the payer is the transaction caller.\"},\"depositTo(address,address,address,uint256)\":{\"notice\":\"Deposits funds into the escrow for a payer-collector-receiver tuple, where the payer can be specified.\"},\"getBalance(address,address,address)\":{\"notice\":\"Get the balance of a payer-collector-receiver tuple This function will return 0 if the current balance is less than the amount of funds being thawed.\"},\"initialize()\":{\"notice\":\"Initialize the contract\"},\"thaw(address,address,uint256)\":{\"notice\":\"Thaw a specific amount of escrow from a payer-collector-receiver's escrow account. The payer is the transaction caller. Note that repeated calls to this function will overwrite the previous thawing amount and reset the thawing period.\"},\"withdraw(address,address)\":{\"notice\":\"Withdraws all thawed escrow from a payer-collector-receiver's escrow account. The payer is the transaction caller. Note that the withdrawn funds might be less than the thawed amount if there were payment collections in the meantime.\"}},\"notice\":\"This contract is part of the Graph Horizon payments protocol. It holds the funds (GRT) for payments made through the payments protocol for services provided via a Graph Horizon data service. Payers deposit funds on the escrow, signalling their ability to pay for a service, and only being able to retrieve them after a thawing period. Receivers collect funds from the escrow, provided the payer has authorized them. The payer authorization is delegated to a payment collector contract which implements the {IPaymentsCollector} interface.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"@graphprotocol/horizon/contracts/interfaces/IPaymentsEscrow.sol\":\"IPaymentsEscrow\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10},\"remappings\":[]},\"sources\":{\"@graphprotocol/horizon/contracts/interfaces/IGraphPayments.sol\":{\"keccak256\":\"0xa22dcc47676073113e4ebe30045065662cee5531f9c5f75776c00e70a1929c81\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://8908f30b3c7536798b14dc62fb5ccffc05570d568dbd1bade7c79c1fd2a4b5fe\",\"dweb:/ipfs/QmexZgb5mhDmXVZnYX1Z37cwM7EG2prYyBEVjUSVdKshVr\"]},\"@graphprotocol/horizon/contracts/interfaces/IPaymentsEscrow.sol\":{\"keccak256\":\"0x99e2a676b539e7b6c223a551f8cb9770c07435a25c8b22f0044a8ce4949edadc\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://f702a3cea214d8328d89a0ef16495c709e30fe13eb86fc29940159c9cb8c7bd5\",\"dweb:/ipfs/QmS25Zgcw85kDZcicApLzRmDcoYNQafpFdMyBEWX8eLWSX\"]}},\"version\":1}" + } + }, + "@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingBase.sol": { + "IHorizonStakingBase": { + "abi": [ + { + "inputs": [], + "name": "HorizonStakingInvalidThawRequestType", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "HorizonStakeDeposited", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + } + ], + "name": "getDelegatedTokensAvailable", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "address", + "name": "delegator", + "type": "address" + } + ], + "name": "getDelegation", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + } + ], + "internalType": "struct IHorizonStakingTypes.Delegation", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "paymentType", + "type": "uint8" + } + ], + "name": "getDelegationFeeCut", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + } + ], + "name": "getDelegationPool", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokensThawing", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sharesThawing", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "thawingNonce", + "type": "uint256" + } + ], + "internalType": "struct IHorizonStakingTypes.DelegationPool", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + } + ], + "name": "getIdleStake", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getMaxThawingPeriod", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + } + ], + "name": "getProviderTokensAvailable", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + } + ], + "name": "getProvision", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokensThawing", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sharesThawing", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "maxVerifierCut", + "type": "uint32" + }, + { + "internalType": "uint64", + "name": "thawingPeriod", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "createdAt", + "type": "uint64" + }, + { + "internalType": "uint32", + "name": "maxVerifierCutPending", + "type": "uint32" + }, + { + "internalType": "uint64", + "name": "thawingPeriodPending", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "lastParametersStagedAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "thawingNonce", + "type": "uint256" + } + ], + "internalType": "struct IHorizonStakingTypes.Provision", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + } + ], + "name": "getServiceProvider", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "tokensStaked", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokensProvisioned", + "type": "uint256" + } + ], + "internalType": "struct IHorizonStakingTypes.ServiceProvider", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + } + ], + "name": "getStake", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "enum IHorizonStakingTypes.ThawRequestType", + "name": "thawRequestType", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "thawRequestId", + "type": "bytes32" + } + ], + "name": "getThawRequest", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + }, + { + "internalType": "uint64", + "name": "thawingUntil", + "type": "uint64" + }, + { + "internalType": "bytes32", + "name": "nextRequest", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "thawingNonce", + "type": "uint256" + } + ], + "internalType": "struct IHorizonStakingTypes.ThawRequest", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "enum IHorizonStakingTypes.ThawRequestType", + "name": "thawRequestType", + "type": "uint8" + }, + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "getThawRequestList", + "outputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "head", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "tail", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "count", + "type": "uint256" + } + ], + "internalType": "struct LinkedList.List", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "enum IHorizonStakingTypes.ThawRequestType", + "name": "thawRequestType", + "type": "uint8" + }, + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "getThawedTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "uint32", + "name": "delegationRatio", + "type": "uint32" + } + ], + "name": "getTokensAvailable", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "verifier", + "type": "address" + } + ], + "name": "isAllowedLockedVerifier", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isDelegationSlashingEnabled", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "evm": { + "bytecode": { + "functionDebugData": {}, + "generatedSources": [], + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "deployedBytecode": { + "functionDebugData": {}, + "generatedSources": [], + "immutableReferences": {}, + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "methodIdentifiers": { + "getDelegatedTokensAvailable(address,address)": "fb744cc0", + "getDelegation(address,address,address)": "ccebcabb", + "getDelegationFeeCut(address,address,uint8)": "7573ef4f", + "getDelegationPool(address,address)": "561285e4", + "getIdleStake(address)": "a784d498", + "getMaxThawingPeriod()": "39514ad2", + "getProviderTokensAvailable(address,address)": "08ce5f68", + "getProvision(address,address)": "25d9897e", + "getServiceProvider(address)": "8cc01c86", + "getStake(address)": "7a766460", + "getThawRequest(uint8,bytes32)": "d48de845", + "getThawRequestList(uint8,address,address,address)": "e56f8a1d", + "getThawedTokens(uint8,address,address,address)": "2f7cc501", + "getTokensAvailable(address,address,uint32)": "872d0489", + "isAllowedLockedVerifier(address)": "ae4fe67a", + "isDelegationSlashingEnabled()": "fc54fb27" + } + }, + "metadata": "{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"name\":\"HorizonStakingInvalidThawRequestType\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"HorizonStakeDeposited\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"}],\"name\":\"getDelegatedTokensAvailable\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"delegator\",\"type\":\"address\"}],\"name\":\"getDelegation\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"}],\"internalType\":\"struct IHorizonStakingTypes.Delegation\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"internalType\":\"enum IGraphPayments.PaymentTypes\",\"name\":\"paymentType\",\"type\":\"uint8\"}],\"name\":\"getDelegationFeeCut\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"}],\"name\":\"getDelegationPool\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"tokensThawing\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"sharesThawing\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"thawingNonce\",\"type\":\"uint256\"}],\"internalType\":\"struct IHorizonStakingTypes.DelegationPool\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"}],\"name\":\"getIdleStake\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getMaxThawingPeriod\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"}],\"name\":\"getProviderTokensAvailable\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"}],\"name\":\"getProvision\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"tokensThawing\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"sharesThawing\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"maxVerifierCut\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"thawingPeriod\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"createdAt\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"maxVerifierCutPending\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"thawingPeriodPending\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"lastParametersStagedAt\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"thawingNonce\",\"type\":\"uint256\"}],\"internalType\":\"struct IHorizonStakingTypes.Provision\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"}],\"name\":\"getServiceProvider\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"tokensStaked\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"tokensProvisioned\",\"type\":\"uint256\"}],\"internalType\":\"struct IHorizonStakingTypes.ServiceProvider\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"}],\"name\":\"getStake\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"enum IHorizonStakingTypes.ThawRequestType\",\"name\":\"thawRequestType\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"thawRequestId\",\"type\":\"bytes32\"}],\"name\":\"getThawRequest\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"thawingUntil\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"nextRequest\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"thawingNonce\",\"type\":\"uint256\"}],\"internalType\":\"struct IHorizonStakingTypes.ThawRequest\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"enum IHorizonStakingTypes.ThawRequestType\",\"name\":\"thawRequestType\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"getThawRequestList\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"head\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"tail\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"count\",\"type\":\"uint256\"}],\"internalType\":\"struct LinkedList.List\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"enum IHorizonStakingTypes.ThawRequestType\",\"name\":\"thawRequestType\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"getThawedTokens\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"delegationRatio\",\"type\":\"uint32\"}],\"name\":\"getTokensAvailable\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"}],\"name\":\"isAllowedLockedVerifier\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isDelegationSlashingEnabled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"custom:security-contact\":\"Please email security+contracts@thegraph.com if you find any bugs. We may have an active bug bounty program.\",\"details\":\"Most functions operate over {HorizonStaking} provisions. To uniquely identify a provision functions take `serviceProvider` and `verifier` addresses.\",\"events\":{\"HorizonStakeDeposited(address,uint256)\":{\"details\":\"TRANSITION PERIOD: After transition period move to IHorizonStakingMain. Temporarily it needs to be here since it's emitted by {_stake} which is used by both {HorizonStaking} and {HorizonStakingExtension}.\",\"params\":{\"serviceProvider\":\"The address of the service provider.\",\"tokens\":\"The amount of tokens staked.\"}}},\"kind\":\"dev\",\"methods\":{\"getDelegatedTokensAvailable(address,address)\":{\"details\":\"Calculated as the tokens available minus the tokens thawing.\",\"params\":{\"serviceProvider\":\"The address of the service provider.\",\"verifier\":\"The address of the verifier.\"},\"returns\":{\"_0\":\"The amount of tokens available.\"}},\"getDelegation(address,address,address)\":{\"params\":{\"delegator\":\"The address of the delegator.\",\"serviceProvider\":\"The address of the service provider.\",\"verifier\":\"The address of the verifier.\"},\"returns\":{\"_0\":\"The delegation details.\"}},\"getDelegationFeeCut(address,address,uint8)\":{\"params\":{\"paymentType\":\"The payment type as defined by {IGraphPayments.PaymentTypes}.\",\"serviceProvider\":\"The address of the service provider.\",\"verifier\":\"The address of the verifier.\"},\"returns\":{\"_0\":\"The delegation fee cut in PPM.\"}},\"getDelegationPool(address,address)\":{\"params\":{\"serviceProvider\":\"The address of the service provider.\",\"verifier\":\"The address of the verifier.\"},\"returns\":{\"_0\":\"The delegation pool details.\"}},\"getIdleStake(address)\":{\"params\":{\"serviceProvider\":\"The address of the service provider.\"},\"returns\":{\"_0\":\"The amount of tokens that are idle.\"}},\"getMaxThawingPeriod()\":{\"returns\":{\"_0\":\"The maximum allowed thawing period in seconds.\"}},\"getProviderTokensAvailable(address,address)\":{\"details\":\"Calculated as the tokens available minus the tokens thawing.\",\"params\":{\"serviceProvider\":\"The address of the service provider.\",\"verifier\":\"The address of the verifier.\"},\"returns\":{\"_0\":\"The amount of tokens available.\"}},\"getProvision(address,address)\":{\"params\":{\"serviceProvider\":\"The address of the service provider.\",\"verifier\":\"The address of the verifier.\"},\"returns\":{\"_0\":\"The provision details.\"}},\"getServiceProvider(address)\":{\"params\":{\"serviceProvider\":\"The address of the service provider.\"},\"returns\":{\"_0\":\"The service provider details.\"}},\"getStake(address)\":{\"params\":{\"serviceProvider\":\"The address of the service provider.\"},\"returns\":{\"_0\":\"The amount of tokens staked.\"}},\"getThawRequest(uint8,bytes32)\":{\"params\":{\"thawRequestId\":\"The id of the thaw request.\",\"thawRequestType\":\"The type of thaw request.\"},\"returns\":{\"_0\":\"The thaw request details.\"}},\"getThawRequestList(uint8,address,address,address)\":{\"params\":{\"owner\":\"The owner of the thaw requests. Use either the service provider or delegator address.\",\"serviceProvider\":\"The address of the service provider.\",\"thawRequestType\":\"The type of thaw request.\",\"verifier\":\"The address of the verifier.\"},\"returns\":{\"_0\":\"The thaw requests list metadata.\"}},\"getThawedTokens(uint8,address,address,address)\":{\"details\":\"Note that the value returned by this function does not return the total amount of thawed tokens but only those that can be released. If thaw requests are created with different thawing periods it's possible that an unexpired thaw request temporarily blocks the release of other ones that have already expired. This function will stop counting when it encounters the first thaw request that is not yet expired.\",\"params\":{\"owner\":\"The owner of the thaw requests. Use either the service provider or delegator address.\",\"serviceProvider\":\"The address of the service provider.\",\"thawRequestType\":\"The type of thaw request.\",\"verifier\":\"The address of the verifier.\"},\"returns\":{\"_0\":\"The amount of thawed tokens.\"}},\"getTokensAvailable(address,address,uint32)\":{\"params\":{\"delegationRatio\":\"The delegation ratio.\",\"serviceProvider\":\"The address of the service provider.\",\"verifier\":\"The address of the verifier.\"},\"returns\":{\"_0\":\"The amount of tokens available.\"}},\"isAllowedLockedVerifier(address)\":{\"params\":{\"verifier\":\"Address of the verifier\"},\"returns\":{\"_0\":\"True if verifier is allowed locked verifier, false otherwise\"}},\"isDelegationSlashingEnabled()\":{\"returns\":{\"_0\":\"True if delegation slashing is enabled, false otherwise\"}}},\"title\":\"Interface for the {HorizonStakingBase} contract.\",\"version\":1},\"userdoc\":{\"errors\":{\"HorizonStakingInvalidThawRequestType()\":[{\"notice\":\"Thrown when using an invalid thaw request type.\"}]},\"events\":{\"HorizonStakeDeposited(address,uint256)\":{\"notice\":\"Emitted when a service provider stakes tokens.\"}},\"kind\":\"user\",\"methods\":{\"getDelegatedTokensAvailable(address,address)\":{\"notice\":\"Gets the delegator's tokens available in a provision.\"},\"getDelegation(address,address,address)\":{\"notice\":\"Gets the details of a delegation.\"},\"getDelegationFeeCut(address,address,uint8)\":{\"notice\":\"Gets the delegation fee cut for a payment type.\"},\"getDelegationPool(address,address)\":{\"notice\":\"Gets the details of delegation pool.\"},\"getIdleStake(address)\":{\"notice\":\"Gets the service provider's idle stake which is the stake that is not being used for any provision. Note that this only includes service provider's self stake.\"},\"getMaxThawingPeriod()\":{\"notice\":\"Gets the maximum allowed thawing period for a provision.\"},\"getProviderTokensAvailable(address,address)\":{\"notice\":\"Gets the service provider's tokens available in a provision.\"},\"getProvision(address,address)\":{\"notice\":\"Gets the details of a provision.\"},\"getServiceProvider(address)\":{\"notice\":\"Gets the details of a service provider.\"},\"getStake(address)\":{\"notice\":\"Gets the stake of a service provider.\"},\"getThawRequest(uint8,bytes32)\":{\"notice\":\"Gets a thaw request.\"},\"getThawRequestList(uint8,address,address,address)\":{\"notice\":\"Gets the metadata of a thaw request list. Service provider and delegators each have their own thaw request list per provision. Metadata includes the head and tail of the list, plus the total number of thaw requests.\"},\"getThawedTokens(uint8,address,address,address)\":{\"notice\":\"Gets the amount of thawed tokens that can be releasedfor a given provision.\"},\"getTokensAvailable(address,address,uint32)\":{\"notice\":\"Gets the tokens available in a provision. Tokens available are the tokens in a provision that are not thawing. Includes service provider's and delegator's stake. Allows specifying a `delegationRatio` which caps the amount of delegated tokens that are considered available.\"},\"isAllowedLockedVerifier(address)\":{\"notice\":\"Return true if the verifier is an allowed locked verifier.\"},\"isDelegationSlashingEnabled()\":{\"notice\":\"Return true if delegation slashing is enabled, false otherwise.\"}},\"notice\":\"Provides getters for {HorizonStaking} and {HorizonStakingExtension} storage variables.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingBase.sol\":\"IHorizonStakingBase\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10},\"remappings\":[]},\"sources\":{\"@graphprotocol/horizon/contracts/interfaces/IGraphPayments.sol\":{\"keccak256\":\"0xa22dcc47676073113e4ebe30045065662cee5531f9c5f75776c00e70a1929c81\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://8908f30b3c7536798b14dc62fb5ccffc05570d568dbd1bade7c79c1fd2a4b5fe\",\"dweb:/ipfs/QmexZgb5mhDmXVZnYX1Z37cwM7EG2prYyBEVjUSVdKshVr\"]},\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingBase.sol\":{\"keccak256\":\"0x9bdab6cb595eabd7d321d7beae03ad3607995c14ef40f0c2f349fb72084766c5\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://6cac2ca3580bd770b98b07b11ebb007e8a922a90cde920e6ec472df7e66fb512\",\"dweb:/ipfs/QmRw1rjT8D8gNp2GRTuwDETwHNHMpHKoHZq4pYBAn9i65F\"]},\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingTypes.sol\":{\"keccak256\":\"0xaaeb9770f8aaae6b395e87bb1876a10fe7c14384d16d97dd33a671c3ea53aa7b\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://8f5c019fdb2df73bafe464fb6e9da792f7833a0c1858734bcd6a6b8d6ae924c7\",\"dweb:/ipfs/QmcubeYTHCYBqQsRncBFpPFtk7JzRz4nFh27LUW1m4hx2K\"]},\"@graphprotocol/horizon/contracts/libraries/LinkedList.sol\":{\"keccak256\":\"0x99058b4da0428b8d9c22d3d112acbaa59900f1fd0a434038b1a4fccfe3c678d6\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://568e03231c6081eacbcb6585a05c0b1bb976b640b611f7bf6155f9b58d887239\",\"dweb:/ipfs/QmdPZQWhkhjf5TUwz487Dwm4ycjX323iNdwb1sQnAiA1Qu\"]}},\"version\":1}" + } + }, + "@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingExtension.sol": { + "IHorizonStakingExtension": { + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "subgraphDeploymentID", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "epoch", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "allocationID", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "poi", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bool", + "name": "isPublic", + "type": "bool" + } + ], + "name": "AllocationClosed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "assetHolder", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "subgraphDeploymentID", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "allocationID", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "epoch", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "protocolTax", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "curationFees", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "queryFees", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "queryRebates", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "delegationRewards", + "type": "uint256" + } + ], + "name": "RebateCollected", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "reward", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "beneficiary", + "type": "address" + } + ], + "name": "StakeSlashed", + "type": "event" + }, + { + "inputs": [], + "name": "__DEPRECATED_getThawingPeriod", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationID", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "poi", + "type": "bytes32" + } + ], + "name": "closeAllocation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "address", + "name": "allocationID", + "type": "address" + } + ], + "name": "collect", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationID", + "type": "address" + } + ], + "name": "getAllocation", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "subgraphDeploymentID", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "createdAtEpoch", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "closedAtEpoch", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "collectedFees", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "__DEPRECATED_effectiveAllocation", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "accRewardsPerAllocatedToken", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "distributedRebates", + "type": "uint256" + } + ], + "internalType": "struct IHorizonStakingExtension.Allocation", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "getAllocationData", + "outputs": [ + { + "internalType": "bool", + "name": "isActive", + "type": "bool" + }, + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "accRewardsPerAllocatedToken", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "accRewardsPending", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationID", + "type": "address" + } + ], + "name": "getAllocationState", + "outputs": [ + { + "internalType": "enum IHorizonStakingExtension.AllocationState", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + } + ], + "name": "getIndexerStakedTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_subgraphDeploymentId", + "type": "bytes32" + } + ], + "name": "getSubgraphAllocatedTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getSubgraphService", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + } + ], + "name": "hasStake", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationID", + "type": "address" + } + ], + "name": "isAllocation", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "internalType": "address", + "name": "indexer", + "type": "address" + } + ], + "name": "isOperator", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "reward", + "type": "uint256" + }, + { + "internalType": "address", + "name": "beneficiary", + "type": "address" + } + ], + "name": "legacySlash", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "evm": { + "bytecode": { + "functionDebugData": {}, + "generatedSources": [], + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "deployedBytecode": { + "functionDebugData": {}, + "generatedSources": [], + "immutableReferences": {}, + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "methodIdentifiers": { + "__DEPRECATED_getThawingPeriod()": "c0641994", + "closeAllocation(address,bytes32)": "44c32a61", + "collect(uint256,address)": "8d3c100a", + "getAllocation(address)": "0e022923", + "getAllocationData(address)": "55c85269", + "getAllocationState(address)": "98c657dc", + "getIndexerStakedTokens(address)": "1787e69f", + "getSubgraphAllocatedTokens(bytes32)": "e2e1e8e9", + "getSubgraphService()": "9363c522", + "hasStake(address)": "e73e14bf", + "isAllocation(address)": "f1d60d66", + "isOperator(address,address)": "b6363cf2", + "legacySlash(address,uint256,uint256,address)": "4488a382" + } + }, + "metadata": "{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"subgraphDeploymentID\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"epoch\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"allocationID\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"poi\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"isPublic\",\"type\":\"bool\"}],\"name\":\"AllocationClosed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"assetHolder\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"subgraphDeploymentID\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"allocationID\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"epoch\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"protocolTax\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"curationFees\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"queryFees\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"queryRebates\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"delegationRewards\",\"type\":\"uint256\"}],\"name\":\"RebateCollected\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"reward\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"}],\"name\":\"StakeSlashed\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"__DEPRECATED_getThawingPeriod\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"allocationID\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"poi\",\"type\":\"bytes32\"}],\"name\":\"closeAllocation\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"allocationID\",\"type\":\"address\"}],\"name\":\"collect\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"allocationID\",\"type\":\"address\"}],\"name\":\"getAllocation\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"subgraphDeploymentID\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"createdAtEpoch\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"closedAtEpoch\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"collectedFees\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"__DEPRECATED_effectiveAllocation\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"accRewardsPerAllocatedToken\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"distributedRebates\",\"type\":\"uint256\"}],\"internalType\":\"struct IHorizonStakingExtension.Allocation\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"allocationId\",\"type\":\"address\"}],\"name\":\"getAllocationData\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"isActive\",\"type\":\"bool\"},{\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"subgraphDeploymentId\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"accRewardsPerAllocatedToken\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"accRewardsPending\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"allocationID\",\"type\":\"address\"}],\"name\":\"getAllocationState\",\"outputs\":[{\"internalType\":\"enum IHorizonStakingExtension.AllocationState\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"}],\"name\":\"getIndexerStakedTokens\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_subgraphDeploymentId\",\"type\":\"bytes32\"}],\"name\":\"getSubgraphAllocatedTokens\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getSubgraphService\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"}],\"name\":\"hasStake\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"allocationID\",\"type\":\"address\"}],\"name\":\"isAllocation\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"}],\"name\":\"isOperator\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"reward\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"}],\"name\":\"legacySlash\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"custom:security-contact\":\"Please email security+contracts@thegraph.com if you find any bugs. We may have an active bug bounty program.\",\"events\":{\"AllocationClosed(address,bytes32,uint256,uint256,address,address,bytes32,bool)\":{\"details\":\"Emitted when `indexer` close an allocation in `epoch` for `allocationID`. An amount of `tokens` get unallocated from `subgraphDeploymentID`. This event also emits the POI (proof of indexing) submitted by the indexer. `isPublic` is true if the sender was someone other than the indexer.\",\"params\":{\"allocationID\":\"The allocation identifier\",\"epoch\":\"The protocol epoch the allocation was closed on\",\"indexer\":\"The indexer address\",\"isPublic\":\"True if the allocation was force closed by someone other than the indexer/operator\",\"poi\":\"The proof of indexing submitted by the sender\",\"sender\":\"The address closing the allocation\",\"subgraphDeploymentID\":\"The subgraph deployment ID\",\"tokens\":\"The amount of tokens unallocated from the allocation\"}},\"RebateCollected(address,address,bytes32,address,uint256,uint256,uint256,uint256,uint256,uint256,uint256)\":{\"details\":\"Emitted when `indexer` collects a rebate on `subgraphDeploymentID` for `allocationID`. `epoch` is the protocol epoch the rebate was collected on The rebate is for `tokens` amount which are being provided by `assetHolder`; `queryFees` is the amount up for rebate after `curationFees` are distributed and `protocolTax` is burnt. `queryRebates` is the amount distributed to the `indexer` with `delegationFees` collected and sent to the delegation pool.\",\"params\":{\"allocationID\":\"The allocation identifier\",\"assetHolder\":\"The address of the asset holder, the entity paying the query fees\",\"curationFees\":\"The amount of tokens distributed to the curation pool\",\"delegationRewards\":\"The amount of tokens collected from the delegation pool\",\"epoch\":\"The protocol epoch the rebate was collected on\",\"indexer\":\"The indexer address\",\"protocolTax\":\"The amount of tokens burnt as protocol tax\",\"queryFees\":\"The amount of tokens collected as query fees\",\"queryRebates\":\"The amount of tokens distributed to the indexer\",\"subgraphDeploymentID\":\"The subgraph deployment ID\",\"tokens\":\"The amount of tokens collected\"}},\"StakeSlashed(address,uint256,uint256,address)\":{\"details\":\"Emitted when `indexer` was slashed for a total of `tokens` amount. Tracks `reward` amount of tokens given to `beneficiary`.\",\"params\":{\"beneficiary\":\"The address of a beneficiary to receive a reward for the slashing\",\"indexer\":\"The indexer address\",\"reward\":\"The amount of reward tokens to send to a beneficiary\",\"tokens\":\"The amount of tokens slashed\"}}},\"kind\":\"dev\",\"methods\":{\"__DEPRECATED_getThawingPeriod()\":{\"returns\":{\"_0\":\"Thawing period in blocks\"}},\"closeAllocation(address,bytes32)\":{\"params\":{\"allocationID\":\"The allocation identifier\",\"poi\":\"Proof of indexing submitted for the allocated period\"}},\"collect(uint256,address)\":{\"details\":\"Collect and rebate query fees to the indexer This function will accept calls with zero tokens. We use an exponential rebate formula to calculate the amount of tokens to rebate to the indexer. This implementation allows collecting multiple times on the same allocation, keeping track of the total amount rebated, the total amount collected and compensating the indexer for the difference.\",\"params\":{\"allocationID\":\"Allocation where the tokens will be assigned\",\"tokens\":\"Amount of tokens to collect\"}},\"getAllocation(address)\":{\"params\":{\"allocationID\":\"Address used as allocation identifier\"},\"returns\":{\"_0\":\"Allocation data\"}},\"getAllocationData(address)\":{\"details\":\"Get allocation data to calculate rewards issuance \",\"params\":{\"allocationId\":\"The allocation Id\"},\"returns\":{\"accRewardsPending\":\"Snapshot of accumulated rewards from previous allocation resizing, pending to be claimed\",\"accRewardsPerAllocatedToken\":\"Rewards snapshot\",\"indexer\":\"The indexer address\",\"isActive\":\"Whether the allocation is active or not\",\"subgraphDeploymentId\":\"Subgraph deployment id for the allocation\",\"tokens\":\"Amount of allocated tokens\"}},\"getAllocationState(address)\":{\"params\":{\"allocationID\":\"Allocation identifier\"},\"returns\":{\"_0\":\"AllocationState enum with the state of the allocation\"}},\"getIndexerStakedTokens(address)\":{\"params\":{\"indexer\":\"Address of the indexer\"},\"returns\":{\"_0\":\"Amount of tokens staked by the indexer\"}},\"getSubgraphAllocatedTokens(bytes32)\":{\"params\":{\"_subgraphDeploymentId\":\"Deployment Id for the subgraph\"},\"returns\":{\"_0\":\"Total tokens allocated to subgraph\"}},\"getSubgraphService()\":{\"details\":\"TRANSITION PERIOD: After transition period move to main HorizonStaking contract\",\"returns\":{\"_0\":\"Address of the subgraph data service\"}},\"hasStake(address)\":{\"params\":{\"indexer\":\"Address of the indexer\"},\"returns\":{\"_0\":\"True if indexer has staked tokens\"}},\"isAllocation(address)\":{\"params\":{\"allocationID\":\"Address used as signer by the indexer for an allocation\"},\"returns\":{\"_0\":\"True if allocationID already used\"}},\"isOperator(address,address)\":{\"params\":{\"indexer\":\"Address of the service provider\",\"operator\":\"Address of the operator\"},\"returns\":{\"_0\":\"True if operator is allowed for indexer, false otherwise\"}},\"legacySlash(address,uint256,uint256,address)\":{\"details\":\"Can only be called by the slasher role.\",\"params\":{\"beneficiary\":\"Address of a beneficiary to receive a reward for the slashing\",\"indexer\":\"Address of indexer to slash\",\"reward\":\"Amount of reward tokens to send to a beneficiary\",\"tokens\":\"Amount of tokens to slash from the indexer stake\"}}},\"title\":\"Interface for {HorizonStakingExtension} contract.\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"__DEPRECATED_getThawingPeriod()\":{\"notice\":\"Return the time in blocks to unstake Deprecated, now enforced by each data service (verifier)\"},\"closeAllocation(address,bytes32)\":{\"notice\":\"Close an allocation and free the staked tokens. To be eligible for rewards a proof of indexing must be presented. Presenting a bad proof is subject to slashable condition. To opt out of rewards set _poi to 0x0\"},\"getAllocation(address)\":{\"notice\":\"Return the allocation by ID.\"},\"getAllocationState(address)\":{\"notice\":\"Return the current state of an allocation\"},\"getIndexerStakedTokens(address)\":{\"notice\":\"Get the total amount of tokens staked by the indexer.\"},\"getSubgraphAllocatedTokens(bytes32)\":{\"notice\":\"Return the total amount of tokens allocated to subgraph.\"},\"getSubgraphService()\":{\"notice\":\"Return the address of the subgraph data service.\"},\"hasStake(address)\":{\"notice\":\"Getter that returns if an indexer has any stake.\"},\"isAllocation(address)\":{\"notice\":\"Return if allocationID is used.\"},\"isOperator(address,address)\":{\"notice\":\"(Legacy) Return true if operator is allowed for the service provider on the subgraph data service.\"},\"legacySlash(address,uint256,uint256,address)\":{\"notice\":\"Slash the indexer stake. Delegated tokens are not subject to slashing. Note that depending on the state of the indexer's stake, the slashed amount might be smaller than the requested slash amount. This can happen if the indexer has moved a significant part of their stake to a provision. Any outstanding slashing amount should be settled using Horizon's slash function {IHorizonStaking.slash}.\"}},\"notice\":\"Provides functions for managing legacy allocations.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingExtension.sol\":\"IHorizonStakingExtension\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10},\"remappings\":[]},\"sources\":{\"@graphprotocol/contracts/contracts/rewards/IRewardsIssuer.sol\":{\"keccak256\":\"0xe049090c38a64d80b284ba2a7b440bcedba9804d96f2bb8da525e69ac452e03a\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://8b7d1186bd0698bed02d3504ac80c20e605087fba036d5ff392b39a9a3c818e5\",\"dweb:/ipfs/QmRgAfY1dD5rc7fLuuGVyu2mh9Z8qz1AVvuXAcRGnB3dSv\"]},\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingExtension.sol\":{\"keccak256\":\"0x7923f39746198b5672f0e4d65b7bf14903ae5f7775d74b210effb957eea36c71\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://c29531aff69c71e649fb347d7117ea8c42fc8de09860a1c389ed9b8f097a34e0\",\"dweb:/ipfs/QmS89fww584HiyE1BdPe8Xaqbf5v7FEvL38GTxeHEAsLFm\"]}},\"version\":1}" + } + }, + "@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingMain.sol": { + "IHorizonStakingMain": { + "abi": [ + { + "inputs": [], + "name": "HorizonStakingCallerIsServiceProvider", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minTokens", + "type": "uint256" + } + ], + "name": "HorizonStakingInsufficientDelegationTokens", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minTokens", + "type": "uint256" + } + ], + "name": "HorizonStakingInsufficientIdleStake", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minShares", + "type": "uint256" + } + ], + "name": "HorizonStakingInsufficientShares", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minTokens", + "type": "uint256" + } + ], + "name": "HorizonStakingInsufficientStakeForLegacyAllocations", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minRequired", + "type": "uint256" + } + ], + "name": "HorizonStakingInsufficientTokens", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "feeCut", + "type": "uint256" + } + ], + "name": "HorizonStakingInvalidDelegationFeeCut", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + } + ], + "name": "HorizonStakingInvalidDelegationPool", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + } + ], + "name": "HorizonStakingInvalidDelegationPoolState", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "maxVerifierCut", + "type": "uint32" + } + ], + "name": "HorizonStakingInvalidMaxVerifierCut", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + } + ], + "name": "HorizonStakingInvalidProvision", + "type": "error" + }, + { + "inputs": [], + "name": "HorizonStakingInvalidServiceProviderZeroAddress", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "thawingPeriod", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "maxThawingPeriod", + "type": "uint64" + } + ], + "name": "HorizonStakingInvalidThawingPeriod", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "verifier", + "type": "address" + } + ], + "name": "HorizonStakingInvalidVerifier", + "type": "error" + }, + { + "inputs": [], + "name": "HorizonStakingInvalidVerifierZeroAddress", + "type": "error" + }, + { + "inputs": [], + "name": "HorizonStakingInvalidZeroShares", + "type": "error" + }, + { + "inputs": [], + "name": "HorizonStakingInvalidZeroTokens", + "type": "error" + }, + { + "inputs": [], + "name": "HorizonStakingLegacySlashFailed", + "type": "error" + }, + { + "inputs": [], + "name": "HorizonStakingNoTokensToSlash", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "HorizonStakingNotAuthorized", + "type": "error" + }, + { + "inputs": [], + "name": "HorizonStakingNothingThawing", + "type": "error" + }, + { + "inputs": [], + "name": "HorizonStakingNothingToWithdraw", + "type": "error" + }, + { + "inputs": [], + "name": "HorizonStakingProvisionAlreadyExists", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minShares", + "type": "uint256" + } + ], + "name": "HorizonStakingSlippageProtection", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "until", + "type": "uint256" + } + ], + "name": "HorizonStakingStillThawing", + "type": "error" + }, + { + "inputs": [], + "name": "HorizonStakingTooManyThawRequests", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxTokens", + "type": "uint256" + } + ], + "name": "HorizonStakingTooManyTokens", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "verifier", + "type": "address" + } + ], + "name": "HorizonStakingVerifierNotAllowed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "AllowedLockedVerifierSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "delegator", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "DelegatedTokensWithdrawn", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": true, + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "paymentType", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "feeCut", + "type": "uint256" + } + ], + "name": "DelegationFeeCutSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "DelegationSlashed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "DelegationSlashingEnabled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "DelegationSlashingSkipped", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "until", + "type": "uint256" + } + ], + "name": "HorizonStakeLocked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "HorizonStakeWithdrawn", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "maxThawingPeriod", + "type": "uint64" + } + ], + "name": "MaxThawingPeriodSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "OperatorSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "maxVerifierCut", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "thawingPeriod", + "type": "uint64" + } + ], + "name": "ProvisionCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "ProvisionIncreased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "maxVerifierCut", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "thawingPeriod", + "type": "uint64" + } + ], + "name": "ProvisionParametersSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "maxVerifierCut", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "thawingPeriod", + "type": "uint64" + } + ], + "name": "ProvisionParametersStaged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "ProvisionSlashed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "ProvisionThawed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "delegator", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "StakeDelegatedWithdrawn", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "enum IHorizonStakingTypes.ThawRequestType", + "name": "requestType", + "type": "uint8" + }, + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "shares", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "thawingUntil", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "thawRequestId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + } + ], + "name": "ThawRequestCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "enum IHorizonStakingTypes.ThawRequestType", + "name": "requestType", + "type": "uint8" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "thawRequestId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "shares", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "thawingUntil", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "bool", + "name": "valid", + "type": "bool" + } + ], + "name": "ThawRequestFulfilled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "enum IHorizonStakingTypes.ThawRequestType", + "name": "requestType", + "type": "uint8" + }, + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "thawRequestsFulfilled", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "ThawRequestsFulfilled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "ThawingPeriodCleared", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "delegator", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "shares", + "type": "uint256" + } + ], + "name": "TokensDelegated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "TokensDeprovisioned", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "TokensToDelegationPoolAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "delegator", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "shares", + "type": "uint256" + } + ], + "name": "TokensUndelegated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "VerifierTokensSent", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + } + ], + "name": "acceptProvisionParameters", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "addToDelegationPool", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "addToProvision", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "clearThawingPeriod", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "delegate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minSharesOut", + "type": "uint256" + } + ], + "name": "delegate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "uint256", + "name": "nThawRequests", + "type": "uint256" + } + ], + "name": "deprovision", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getStakingExtension", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "address", + "name": "operator", + "type": "address" + } + ], + "name": "isAuthorized", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "maxVerifierCut", + "type": "uint32" + }, + { + "internalType": "uint64", + "name": "thawingPeriod", + "type": "uint64" + } + ], + "name": "provision", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "maxVerifierCut", + "type": "uint32" + }, + { + "internalType": "uint64", + "name": "thawingPeriod", + "type": "uint64" + } + ], + "name": "provisionLocked", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "oldServiceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "oldVerifier", + "type": "address" + }, + { + "internalType": "address", + "name": "newServiceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "newVerifier", + "type": "address" + }, + { + "internalType": "uint256", + "name": "minSharesForNewProvider", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nThawRequests", + "type": "uint256" + } + ], + "name": "redelegate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "oldVerifier", + "type": "address" + }, + { + "internalType": "address", + "name": "newVerifier", + "type": "address" + }, + { + "internalType": "uint256", + "name": "nThawRequests", + "type": "uint256" + } + ], + "name": "reprovision", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "setAllowedLockedVerifier", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "paymentType", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "feeCut", + "type": "uint256" + } + ], + "name": "setDelegationFeeCut", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "setDelegationSlashingEnabled", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "maxThawingPeriod", + "type": "uint64" + } + ], + "name": "setMaxThawingPeriod", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "setOperator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "setOperatorLocked", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "uint32", + "name": "maxVerifierCut", + "type": "uint32" + }, + { + "internalType": "uint64", + "name": "thawingPeriod", + "type": "uint64" + } + ], + "name": "setProvisionParameters", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokensVerifier", + "type": "uint256" + }, + { + "internalType": "address", + "name": "verifierDestination", + "type": "address" + } + ], + "name": "slash", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "stake", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "stakeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "stakeToProvision", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "thaw", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + } + ], + "name": "undelegate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + } + ], + "name": "undelegate", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "unstake", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "uint256", + "name": "nThawRequests", + "type": "uint256" + } + ], + "name": "withdrawDelegated", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "deprecated", + "type": "address" + } + ], + "name": "withdrawDelegated", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "evm": { + "bytecode": { + "functionDebugData": {}, + "generatedSources": [], + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "deployedBytecode": { + "functionDebugData": {}, + "generatedSources": [], + "immutableReferences": {}, + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "methodIdentifiers": { + "acceptProvisionParameters(address)": "3a78b732", + "addToDelegationPool(address,address,uint256)": "ca94b0e9", + "addToProvision(address,address,uint256)": "fecc9cc1", + "clearThawingPeriod()": "e473522a", + "delegate(address,address,uint256,uint256)": "6230001a", + "delegate(address,uint256)": "026e402b", + "deprovision(address,address,uint256)": "21195373", + "getStakingExtension()": "66ee1b28", + "isAuthorized(address,address,address)": "7c145cc7", + "provision(address,address,uint256,uint32,uint64)": "010167e5", + "provisionLocked(address,address,uint256,uint32,uint64)": "82d66cb8", + "redelegate(address,address,address,address,uint256,uint256)": "f64b3598", + "reprovision(address,address,address,uint256)": "ba7fb0b4", + "setAllowedLockedVerifier(address,bool)": "4ca7ac22", + "setDelegationFeeCut(address,address,uint8,uint256)": "42c51693", + "setDelegationSlashingEnabled()": "ef58bd67", + "setMaxThawingPeriod(uint64)": "259bc435", + "setOperator(address,address,bool)": "bc735d90", + "setOperatorLocked(address,address,bool)": "ad4d35b5", + "setProvisionParameters(address,address,uint32,uint64)": "81e21b56", + "slash(address,uint256,uint256,address)": "e76fede6", + "stake(uint256)": "a694fc3a", + "stakeTo(address,uint256)": "a2a31722", + "stakeToProvision(address,address,uint256)": "74612092", + "thaw(address,address,uint256)": "f93f1cd0", + "undelegate(address,address,uint256)": "a02b9426", + "undelegate(address,uint256)": "4d99dd16", + "unstake(uint256)": "2e17de78", + "withdraw()": "3ccfd60b", + "withdrawDelegated(address,address)": "51a60b02", + "withdrawDelegated(address,address,uint256)": "3993d849" + } + }, + "metadata": "{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"name\":\"HorizonStakingCallerIsServiceProvider\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minTokens\",\"type\":\"uint256\"}],\"name\":\"HorizonStakingInsufficientDelegationTokens\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minTokens\",\"type\":\"uint256\"}],\"name\":\"HorizonStakingInsufficientIdleStake\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minShares\",\"type\":\"uint256\"}],\"name\":\"HorizonStakingInsufficientShares\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minTokens\",\"type\":\"uint256\"}],\"name\":\"HorizonStakingInsufficientStakeForLegacyAllocations\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minRequired\",\"type\":\"uint256\"}],\"name\":\"HorizonStakingInsufficientTokens\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"feeCut\",\"type\":\"uint256\"}],\"name\":\"HorizonStakingInvalidDelegationFeeCut\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"}],\"name\":\"HorizonStakingInvalidDelegationPool\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"}],\"name\":\"HorizonStakingInvalidDelegationPoolState\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"maxVerifierCut\",\"type\":\"uint32\"}],\"name\":\"HorizonStakingInvalidMaxVerifierCut\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"}],\"name\":\"HorizonStakingInvalidProvision\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"HorizonStakingInvalidServiceProviderZeroAddress\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"thawingPeriod\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"maxThawingPeriod\",\"type\":\"uint64\"}],\"name\":\"HorizonStakingInvalidThawingPeriod\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"}],\"name\":\"HorizonStakingInvalidVerifier\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"HorizonStakingInvalidVerifierZeroAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"HorizonStakingInvalidZeroShares\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"HorizonStakingInvalidZeroTokens\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"HorizonStakingLegacySlashFailed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"HorizonStakingNoTokensToSlash\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"HorizonStakingNotAuthorized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"HorizonStakingNothingThawing\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"HorizonStakingNothingToWithdraw\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"HorizonStakingProvisionAlreadyExists\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minShares\",\"type\":\"uint256\"}],\"name\":\"HorizonStakingSlippageProtection\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"until\",\"type\":\"uint256\"}],\"name\":\"HorizonStakingStillThawing\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"HorizonStakingTooManyThawRequests\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxTokens\",\"type\":\"uint256\"}],\"name\":\"HorizonStakingTooManyTokens\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"}],\"name\":\"HorizonStakingVerifierNotAllowed\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"}],\"name\":\"AllowedLockedVerifierSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"delegator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"DelegatedTokensWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"enum IGraphPayments.PaymentTypes\",\"name\":\"paymentType\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"feeCut\",\"type\":\"uint256\"}],\"name\":\"DelegationFeeCutSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"DelegationSlashed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"DelegationSlashingEnabled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"DelegationSlashingSkipped\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"until\",\"type\":\"uint256\"}],\"name\":\"HorizonStakeLocked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"HorizonStakeWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"maxThawingPeriod\",\"type\":\"uint64\"}],\"name\":\"MaxThawingPeriodSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"}],\"name\":\"OperatorSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"maxVerifierCut\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"thawingPeriod\",\"type\":\"uint64\"}],\"name\":\"ProvisionCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"ProvisionIncreased\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"maxVerifierCut\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"thawingPeriod\",\"type\":\"uint64\"}],\"name\":\"ProvisionParametersSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"maxVerifierCut\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"thawingPeriod\",\"type\":\"uint64\"}],\"name\":\"ProvisionParametersStaged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"ProvisionSlashed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"ProvisionThawed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"delegator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"StakeDelegatedWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"enum IHorizonStakingTypes.ThawRequestType\",\"name\":\"requestType\",\"type\":\"uint8\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"thawingUntil\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"thawRequestId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"ThawRequestCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"enum IHorizonStakingTypes.ThawRequestType\",\"name\":\"requestType\",\"type\":\"uint8\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"thawRequestId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"thawingUntil\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"valid\",\"type\":\"bool\"}],\"name\":\"ThawRequestFulfilled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"enum IHorizonStakingTypes.ThawRequestType\",\"name\":\"requestType\",\"type\":\"uint8\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"thawRequestsFulfilled\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"ThawRequestsFulfilled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"ThawingPeriodCleared\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"delegator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"}],\"name\":\"TokensDelegated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"TokensDeprovisioned\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"TokensToDelegationPoolAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"delegator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"}],\"name\":\"TokensUndelegated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"VerifierTokensSent\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"}],\"name\":\"acceptProvisionParameters\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"addToDelegationPool\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"addToProvision\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"clearThawingPeriod\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"delegate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minSharesOut\",\"type\":\"uint256\"}],\"name\":\"delegate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nThawRequests\",\"type\":\"uint256\"}],\"name\":\"deprovision\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getStakingExtension\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"isAuthorized\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"maxVerifierCut\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"thawingPeriod\",\"type\":\"uint64\"}],\"name\":\"provision\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"maxVerifierCut\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"thawingPeriod\",\"type\":\"uint64\"}],\"name\":\"provisionLocked\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"oldServiceProvider\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"oldVerifier\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"newServiceProvider\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"newVerifier\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"minSharesForNewProvider\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nThawRequests\",\"type\":\"uint256\"}],\"name\":\"redelegate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"oldVerifier\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"newVerifier\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nThawRequests\",\"type\":\"uint256\"}],\"name\":\"reprovision\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"}],\"name\":\"setAllowedLockedVerifier\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"internalType\":\"enum IGraphPayments.PaymentTypes\",\"name\":\"paymentType\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"feeCut\",\"type\":\"uint256\"}],\"name\":\"setDelegationFeeCut\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"setDelegationSlashingEnabled\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"maxThawingPeriod\",\"type\":\"uint64\"}],\"name\":\"setMaxThawingPeriod\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"}],\"name\":\"setOperator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"}],\"name\":\"setOperatorLocked\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"maxVerifierCut\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"thawingPeriod\",\"type\":\"uint64\"}],\"name\":\"setProvisionParameters\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"tokensVerifier\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"verifierDestination\",\"type\":\"address\"}],\"name\":\"slash\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"stake\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"stakeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"stakeToProvision\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"thaw\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"}],\"name\":\"undelegate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"}],\"name\":\"undelegate\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"unstake\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nThawRequests\",\"type\":\"uint256\"}],\"name\":\"withdrawDelegated\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"deprecated\",\"type\":\"address\"}],\"name\":\"withdrawDelegated\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"custom:security-contact\":\"Please email security+contracts@thegraph.com if you find any bugs. We may have an active bug bounty program.\",\"details\":\"Note that this interface only includes the functions implemented by {HorizonStaking} contract, and not those implemented by {HorizonStakingExtension}. Do not use this interface to interface with the {HorizonStaking} contract, use {IHorizonStaking} for the complete interface.Most functions operate over {HorizonStaking} provisions. To uniquely identify a provision functions take `serviceProvider` and `verifier` addresses.TRANSITION PERIOD: After transition period rename to IHorizonStaking.\",\"errors\":{\"HorizonStakingInsufficientDelegationTokens(uint256,uint256)\":[{\"params\":{\"minTokens\":\"The minimum required token amount\",\"tokens\":\"The actual token amount\"}}],\"HorizonStakingInsufficientIdleStake(uint256,uint256)\":[{\"params\":{\"minTokens\":\"The minimum required token amount\",\"tokens\":\"The actual token amount\"}}],\"HorizonStakingInsufficientShares(uint256,uint256)\":[{\"params\":{\"minShares\":\"The minimum required share amount\",\"shares\":\"The actual share amount\"}}],\"HorizonStakingInsufficientStakeForLegacyAllocations(uint256,uint256)\":[{\"params\":{\"minTokens\":\"The minimum required token amount\",\"tokens\":\"The actual token amount\"}}],\"HorizonStakingInsufficientTokens(uint256,uint256)\":[{\"params\":{\"minRequired\":\"The minimum required token amount\",\"tokens\":\"The actual token amount\"}}],\"HorizonStakingInvalidDelegationFeeCut(uint256)\":[{\"params\":{\"feeCut\":\"The fee cut\"}}],\"HorizonStakingInvalidDelegationPool(address,address)\":[{\"params\":{\"serviceProvider\":\"The service provider address\",\"verifier\":\"The verifier address\"}}],\"HorizonStakingInvalidDelegationPoolState(address,address)\":[{\"params\":{\"serviceProvider\":\"The service provider address\",\"verifier\":\"The verifier address\"}}],\"HorizonStakingInvalidMaxVerifierCut(uint32)\":[{\"params\":{\"maxVerifierCut\":\"The maximum verifier cut\"}}],\"HorizonStakingInvalidProvision(address,address)\":[{\"params\":{\"serviceProvider\":\"The service provider address\",\"verifier\":\"The verifier address\"}}],\"HorizonStakingInvalidThawingPeriod(uint64,uint64)\":[{\"params\":{\"maxThawingPeriod\":\"The maximum `thawingPeriod` allowed\",\"thawingPeriod\":\"The thawing period\"}}],\"HorizonStakingInvalidVerifier(address)\":[{\"params\":{\"verifier\":\"The verifier address\"}}],\"HorizonStakingNotAuthorized(address,address,address)\":[{\"params\":{\"caller\":\"The caller address\",\"serviceProvider\":\"The service provider address\",\"verifier\":\"The verifier address\"}}],\"HorizonStakingSlippageProtection(uint256,uint256)\":[{\"params\":{\"minShares\":\"The minimum required share amount\",\"shares\":\"The actual share amount\"}}],\"HorizonStakingStillThawing(uint256)\":[{\"details\":\"Note this thawing refers to the global thawing period applied to legacy allocated tokens, it does not refer to thaw requests.\",\"params\":{\"until\":\"The block number until the stake is locked\"}}],\"HorizonStakingTooManyTokens(uint256,uint256)\":[{\"params\":{\"maxTokens\":\"The maximum allowed token amount\",\"tokens\":\"The actual token amount\"}}],\"HorizonStakingVerifierNotAllowed(address)\":[{\"details\":\"Only applies to stake from locked wallets.\",\"params\":{\"verifier\":\"The verifier address\"}}]},\"events\":{\"AllowedLockedVerifierSet(address,bool)\":{\"params\":{\"allowed\":\"Whether the verifier is allowed or disallowed\",\"verifier\":\"The address of the verifier\"}},\"DelegatedTokensWithdrawn(address,address,address,uint256)\":{\"params\":{\"delegator\":\"The address of the delegator\",\"serviceProvider\":\"The address of the service provider\",\"tokens\":\"The amount of tokens withdrawn\",\"verifier\":\"The address of the verifier\"}},\"DelegationFeeCutSet(address,address,uint8,uint256)\":{\"params\":{\"feeCut\":\"The fee cut set, in PPM\",\"paymentType\":\"The payment type for which the fee cut is set, as defined in {IGraphPayments}\",\"serviceProvider\":\"The address of the service provider\",\"verifier\":\"The address of the verifier\"}},\"DelegationSlashed(address,address,uint256)\":{\"params\":{\"serviceProvider\":\"The address of the service provider\",\"tokens\":\"The amount of tokens slashed (note this only represents delegation pool's slashed stake)\",\"verifier\":\"The address of the verifier\"}},\"DelegationSlashingSkipped(address,address,uint256)\":{\"params\":{\"serviceProvider\":\"The address of the service provider\",\"tokens\":\"The amount of tokens that would have been slashed (note this only represents delegation pool's slashed stake)\",\"verifier\":\"The address of the verifier\"}},\"HorizonStakeLocked(address,uint256,uint256)\":{\"params\":{\"serviceProvider\":\"The address of the service provider\",\"tokens\":\"The amount of tokens now locked (including previously locked tokens)\",\"until\":\"The block number until the stake is locked\"}},\"HorizonStakeWithdrawn(address,uint256)\":{\"params\":{\"serviceProvider\":\"The address of the service provider\",\"tokens\":\"The amount of tokens withdrawn\"}},\"MaxThawingPeriodSet(uint64)\":{\"params\":{\"maxThawingPeriod\":\"The new maximum thawing period\"}},\"OperatorSet(address,address,address,bool)\":{\"details\":\"Emitted when an operator is allowed or denied by a service provider for a particular verifier\",\"params\":{\"allowed\":\"Whether the operator is allowed or denied\",\"operator\":\"The address of the operator\",\"serviceProvider\":\"The address of the service provider\",\"verifier\":\"The address of the verifier\"}},\"ProvisionCreated(address,address,uint256,uint32,uint64)\":{\"params\":{\"maxVerifierCut\":\"The maximum cut, expressed in PPM of the slashed amount, that a verifier can take for themselves when slashing\",\"serviceProvider\":\"The address of the service provider\",\"thawingPeriod\":\"The period in seconds that the tokens will be thawing before they can be removed from the provision\",\"tokens\":\"The amount of tokens provisioned\",\"verifier\":\"The address of the verifier\"}},\"ProvisionIncreased(address,address,uint256)\":{\"params\":{\"serviceProvider\":\"The address of the service provider\",\"tokens\":\"The amount of tokens added to the provision\",\"verifier\":\"The address of the verifier\"}},\"ProvisionParametersSet(address,address,uint32,uint64)\":{\"params\":{\"maxVerifierCut\":\"The new maximum cut, expressed in PPM of the slashed amount, that a verifier can take for themselves when slashing\",\"serviceProvider\":\"The address of the service provider\",\"thawingPeriod\":\"The new period in seconds that the tokens will be thawing before they can be removed from the provision\",\"verifier\":\"The address of the verifier\"}},\"ProvisionParametersStaged(address,address,uint32,uint64)\":{\"params\":{\"maxVerifierCut\":\"The proposed maximum cut, expressed in PPM of the slashed amount, that a verifier can take for themselves when slashing\",\"serviceProvider\":\"The address of the service provider\",\"thawingPeriod\":\"The proposed period in seconds that the tokens will be thawing before they can be removed from the provision\",\"verifier\":\"The address of the verifier\"}},\"ProvisionSlashed(address,address,uint256)\":{\"params\":{\"serviceProvider\":\"The address of the service provider\",\"tokens\":\"The amount of tokens slashed (note this only represents service provider's slashed stake)\",\"verifier\":\"The address of the verifier\"}},\"ProvisionThawed(address,address,uint256)\":{\"params\":{\"serviceProvider\":\"The address of the service provider\",\"tokens\":\"The amount of tokens thawed\",\"verifier\":\"The address of the verifier\"}},\"StakeDelegatedWithdrawn(address,address,uint256)\":{\"details\":\"This event is for the legacy `withdrawDelegated` function.\",\"params\":{\"delegator\":\"The address of the delegator\",\"indexer\":\"The address of the indexer\",\"tokens\":\"The amount of tokens withdrawn\"}},\"ThawRequestCreated(uint8,address,address,address,uint256,uint64,bytes32,uint256)\":{\"details\":\"Can be emitted by the service provider when thawing stake or by the delegator when undelegating.\",\"params\":{\"nonce\":\"The nonce of the thaw request\",\"owner\":\"The address of the owner of the thaw request.\",\"requestType\":\"The type of thaw request\",\"serviceProvider\":\"The address of the service provider\",\"shares\":\"The amount of shares being thawed\",\"thawRequestId\":\"The ID of the thaw request\",\"thawingUntil\":\"The timestamp until the stake is thawed\",\"verifier\":\"The address of the verifier\"}},\"ThawRequestFulfilled(uint8,bytes32,uint256,uint256,uint64,bool)\":{\"params\":{\"requestType\":\"The type of thaw request\",\"shares\":\"The amount of shares being released\",\"thawRequestId\":\"The ID of the thaw request\",\"thawingUntil\":\"The timestamp until the stake has thawed\",\"tokens\":\"The amount of tokens being released\",\"valid\":\"Whether the thaw request was valid at the time of fulfillment\"}},\"ThawRequestsFulfilled(uint8,address,address,address,uint256,uint256)\":{\"params\":{\"owner\":\"The address of the owner of the thaw requests\",\"requestType\":\"The type of thaw request\",\"serviceProvider\":\"The address of the service provider\",\"thawRequestsFulfilled\":\"The number of thaw requests fulfilled\",\"tokens\":\"The total amount of tokens being released\",\"verifier\":\"The address of the verifier\"}},\"ThawingPeriodCleared()\":{\"details\":\"This marks the end of the transition period.\"},\"TokensDelegated(address,address,address,uint256,uint256)\":{\"params\":{\"delegator\":\"The address of the delegator\",\"serviceProvider\":\"The address of the service provider\",\"shares\":\"The amount of shares delegated\",\"tokens\":\"The amount of tokens delegated\",\"verifier\":\"The address of the verifier\"}},\"TokensDeprovisioned(address,address,uint256)\":{\"params\":{\"serviceProvider\":\"The address of the service provider\",\"tokens\":\"The amount of tokens removed\",\"verifier\":\"The address of the verifier\"}},\"TokensToDelegationPoolAdded(address,address,uint256)\":{\"params\":{\"serviceProvider\":\"The address of the service provider\",\"tokens\":\"The amount of tokens withdrawn\",\"verifier\":\"The address of the verifier\"}},\"TokensUndelegated(address,address,address,uint256,uint256)\":{\"params\":{\"delegator\":\"The address of the delegator\",\"serviceProvider\":\"The address of the service provider\",\"shares\":\"The amount of shares undelegated\",\"tokens\":\"The amount of tokens undelegated\",\"verifier\":\"The address of the verifier\"}},\"VerifierTokensSent(address,address,address,uint256)\":{\"params\":{\"destination\":\"The address where the verifier cut is sent\",\"serviceProvider\":\"The address of the service provider\",\"tokens\":\"The amount of tokens sent to the verifier\",\"verifier\":\"The address of the verifier\"}}},\"kind\":\"dev\",\"methods\":{\"acceptProvisionParameters(address)\":{\"details\":\"Only the provision's verifier can call this function. Emits a {ProvisionParametersSet} event.\",\"params\":{\"serviceProvider\":\"The service provider address\"}},\"addToDelegationPool(address,address,uint256)\":{\"details\":\"Requirements: - `tokens` cannot be zero. - Caller must have previously approved this contract to pull tokens from their balance. Emits a {TokensToDelegationPoolAdded} event.\",\"params\":{\"serviceProvider\":\"The service provider address\",\"tokens\":\"The amount of tokens to add to the delegation pool\",\"verifier\":\"The verifier address for which the tokens are provisioned\"}},\"addToProvision(address,address,uint256)\":{\"details\":\"Requirements: - The `serviceProvider` must have previously provisioned stake to `verifier`. - `tokens` cannot be zero. - The `serviceProvider` must have enough idle stake to cover the tokens to add. Emits a {ProvisionIncreased} event.\",\"params\":{\"serviceProvider\":\"The service provider address\",\"tokens\":\"The amount of tokens to add to the provision\",\"verifier\":\"The verifier address\"}},\"clearThawingPeriod()\":{\"details\":\"This function can only be called by the contract governor.Emits a {ThawingPeriodCleared} event.\"},\"delegate(address,address,uint256,uint256)\":{\"details\":\"Requirements: - `tokens` cannot be zero. - Caller must have previously approved this contract to pull tokens from their balance. - The provision must exist. Emits a {TokensDelegated} event.\",\"params\":{\"minSharesOut\":\"The minimum amount of shares to accept, slippage protection.\",\"serviceProvider\":\"The service provider address\",\"tokens\":\"The amount of tokens to delegate\",\"verifier\":\"The verifier address\"}},\"delegate(address,uint256)\":{\"details\":\"See {delegate}.\",\"params\":{\"serviceProvider\":\"The service provider address\",\"tokens\":\"The amount of tokens to delegate\"}},\"deprovision(address,address,uint256)\":{\"details\":\"The parameter `nThawRequests` can be set to a non zero value to fulfill a specific number of thaw requests in the event that fulfilling all of them results in a gas limit error. Otherwise, the function will attempt to fulfill all thaw requests until the first one that is not yet expired is found. Requirements: - Must have previously initiated a thaw request using {thaw}. Emits {ThawRequestFulfilled}, {ThawRequestsFulfilled} and {TokensDeprovisioned} events.\",\"params\":{\"nThawRequests\":\"The number of thaw requests to fulfill. Set to 0 to fulfill all thaw requests.\",\"serviceProvider\":\"The service provider address\",\"verifier\":\"The verifier address\"}},\"getStakingExtension()\":{\"returns\":{\"_0\":\"The address of the staking extension\"}},\"isAuthorized(address,address,address)\":{\"params\":{\"operator\":\"The address to check for auth\",\"serviceProvider\":\"The service provider on behalf of whom they're claiming to act\",\"verifier\":\"The verifier / data service on which they're claiming to act\"},\"returns\":{\"_0\":\"Whether the operator is authorized or not\"}},\"provision(address,address,uint256,uint32,uint64)\":{\"details\":\"During the transition period, only the subgraph data service can be used as a verifier. This prevents an escape hatch for legacy allocation stake.Requirements: - `tokens` cannot be zero. - The `serviceProvider` must have enough idle stake to cover the tokens to provision. - `maxVerifierCut` must be a valid PPM. - `thawingPeriod` must be less than or equal to `_maxThawingPeriod`. Emits a {ProvisionCreated} event.\",\"params\":{\"maxVerifierCut\":\"The maximum cut, expressed in PPM, that a verifier can transfer instead of burning when slashing\",\"serviceProvider\":\"The service provider address\",\"thawingPeriod\":\"The period in seconds that the tokens will be thawing before they can be removed from the provision\",\"tokens\":\"The amount of tokens that will be locked and slashable\",\"verifier\":\"The verifier address for which the tokens are provisioned (who will be able to slash the tokens)\"}},\"provisionLocked(address,address,uint256,uint32,uint64)\":{\"details\":\"See {provision}. Additional requirements: - The `verifier` must be allowed to be used for locked provisions.\",\"params\":{\"maxVerifierCut\":\"The maximum cut, expressed in PPM, that a verifier can transfer instead of burning when slashing\",\"serviceProvider\":\"The service provider address\",\"thawingPeriod\":\"The period in seconds that the tokens will be thawing before they can be removed from the provision\",\"tokens\":\"The amount of tokens that will be locked and slashable\",\"verifier\":\"The verifier address for which the tokens are provisioned (who will be able to slash the tokens)\"}},\"redelegate(address,address,address,address,uint256,uint256)\":{\"details\":\"The parameter `nThawRequests` can be set to a non zero value to fulfill a specific number of thaw requests in the event that fulfilling all of them results in a gas limit error. Requirements: - Must have previously initiated a thaw request using {undelegate}. - `newServiceProvider` and `newVerifier` must not be the zero address. - `newServiceProvider` must have previously provisioned stake to `newVerifier`. Emits {ThawRequestFulfilled}, {ThawRequestsFulfilled} and {DelegatedTokensWithdrawn} events.\",\"params\":{\"minSharesForNewProvider\":\"The minimum amount of shares to accept for the new service provider\",\"nThawRequests\":\"The number of thaw requests to fulfill. Set to 0 to fulfill all thaw requests.\",\"newServiceProvider\":\"The address of a new service provider\",\"newVerifier\":\"The address of a new verifier\",\"oldServiceProvider\":\"The old service provider address\",\"oldVerifier\":\"The old verifier address\"}},\"reprovision(address,address,address,uint256)\":{\"details\":\"Requirements: - Must have previously initiated a thaw request using {thaw}. - `tokens` cannot be zero. - The `serviceProvider` must have previously provisioned stake to `newVerifier`. - The `serviceProvider` must have enough idle stake to cover the tokens to add. Emits {ThawRequestFulfilled}, {ThawRequestsFulfilled}, {TokensDeprovisioned} and {ProvisionIncreased} events.\",\"params\":{\"nThawRequests\":\"The number of thaw requests to fulfill. Set to 0 to fulfill all thaw requests.\",\"newVerifier\":\"The verifier address for which the tokens will be provisioned\",\"oldVerifier\":\"The verifier address for which the tokens are currently provisioned\",\"serviceProvider\":\"The service provider address\"}},\"setAllowedLockedVerifier(address,bool)\":{\"details\":\"This function can only be called by the contract governor, it's used to maintain a whitelist of verifiers that do not allow the stake from a locked wallet to escape the lock.Emits a {AllowedLockedVerifierSet} event.\",\"params\":{\"allowed\":\"Whether the verifier is allowed or not\",\"verifier\":\"The verifier address\"}},\"setDelegationFeeCut(address,address,uint8,uint256)\":{\"details\":\"Emits a {DelegationFeeCutSet} event.\",\"params\":{\"feeCut\":\"The fee cut to set, in PPM\",\"paymentType\":\"The payment type for which the fee cut is set, as defined in {IGraphPayments}\",\"serviceProvider\":\"The service provider address\",\"verifier\":\"The verifier address\"}},\"setDelegationSlashingEnabled()\":{\"details\":\"This function can only be called by the contract governor.\"},\"setMaxThawingPeriod(uint64)\":{\"params\":{\"maxThawingPeriod\":\"The new maximum thawing period, in seconds\"}},\"setOperator(address,address,bool)\":{\"details\":\"Emits a {OperatorSet} event.\",\"params\":{\"allowed\":\"Whether the operator is authorized or not\",\"operator\":\"Address to authorize or unauthorize\",\"verifier\":\"The verifier / data service on which they'll be allowed to operate\"}},\"setOperatorLocked(address,address,bool)\":{\"details\":\"See {setOperator}. Additional requirements: - The `verifier` must be allowed to be used for locked provisions.\",\"params\":{\"allowed\":\"Whether the operator is authorized or not\",\"operator\":\"Address to authorize or unauthorize\",\"verifier\":\"The verifier / data service on which they'll be allowed to operate\"}},\"setProvisionParameters(address,address,uint32,uint64)\":{\"details\":\"This two step update process prevents the service provider from changing the parameters without the verifier's consent. Requirements: - `thawingPeriod` must be less than or equal to `_maxThawingPeriod`. Note that if `_maxThawingPeriod` changes the function will not revert if called with the same thawing period as the current one. Emits a {ProvisionParametersStaged} event if at least one of the parameters changed.\",\"params\":{\"maxVerifierCut\":\"The proposed maximum cut, expressed in PPM of the slashed amount, that a verifier can take for themselves when slashing\",\"serviceProvider\":\"The service provider address\",\"thawingPeriod\":\"The proposed period in seconds that the tokens will be thawing before they can be removed from the provision\",\"verifier\":\"The verifier address\"}},\"slash(address,uint256,uint256,address)\":{\"details\":\"Requirements: - `tokens` must be less than or equal to the amount of tokens provisioned by the service provider. - `tokensVerifier` must be less than the provision's tokens times the provision's maximum verifier cut. Emits a {ProvisionSlashed} and {VerifierTokensSent} events. Emits a {DelegationSlashed} or {DelegationSlashingSkipped} event depending on the global delegation slashing flag.\",\"params\":{\"serviceProvider\":\"The service provider to slash\",\"tokens\":\"The amount of tokens to slash\",\"tokensVerifier\":\"The amount of tokens to transfer instead of burning\",\"verifierDestination\":\"The address to transfer the verifier cut to\"}},\"stake(uint256)\":{\"details\":\"Pulls tokens from the caller. Requirements: - `_tokens` cannot be zero. - Caller must have previously approved this contract to pull tokens from their balance. Emits a {HorizonStakeDeposited} event.\",\"params\":{\"tokens\":\"Amount of tokens to stake\"}},\"stakeTo(address,uint256)\":{\"details\":\"Pulls tokens from the caller. Requirements: - `_tokens` cannot be zero. - Caller must have previously approved this contract to pull tokens from their balance. Emits a {HorizonStakeDeposited} event.\",\"params\":{\"serviceProvider\":\"Address of the service provider\",\"tokens\":\"Amount of tokens to stake\"}},\"stakeToProvision(address,address,uint256)\":{\"details\":\"This function can be called by the service provider, by an authorized operator or by the verifier itself.Requirements: - The `serviceProvider` must have previously provisioned stake to `verifier`. - `_tokens` cannot be zero. - Caller must have previously approved this contract to pull tokens from their balance. Emits {HorizonStakeDeposited} and {ProvisionIncreased} events.\",\"params\":{\"serviceProvider\":\"Address of the service provider\",\"tokens\":\"Amount of tokens to stake\",\"verifier\":\"Address of the verifier\"}},\"thaw(address,address,uint256)\":{\"details\":\"Requirements: - The provision must have enough tokens available to thaw. - `tokens` cannot be zero. Emits {ProvisionThawed} and {ThawRequestCreated} events.\",\"params\":{\"serviceProvider\":\"The service provider address\",\"tokens\":\"The amount of tokens to thaw\",\"verifier\":\"The verifier address for which the tokens are provisioned\"},\"returns\":{\"_0\":\"The ID of the thaw request\"}},\"undelegate(address,address,uint256)\":{\"params\":{\"serviceProvider\":\"The service provider address\",\"shares\":\"The amount of shares to undelegate\",\"verifier\":\"The verifier address\"},\"returns\":{\"_0\":\"The ID of the thaw request\"}},\"undelegate(address,uint256)\":{\"details\":\"See {undelegate}.\",\"params\":{\"serviceProvider\":\"The service provider address\",\"shares\":\"The amount of shares to undelegate\"}},\"unstake(uint256)\":{\"details\":\"Requirements: - `_tokens` cannot be zero. - `_serviceProvider` must have enough idle stake to cover the staking amount and any legacy allocation. Emits a {HorizonStakeLocked} event during the transition period. Emits a {HorizonStakeWithdrawn} event after the transition period.\",\"params\":{\"tokens\":\"Amount of tokens to unstake\"}},\"withdraw()\":{\"details\":\"This is only needed during the transition period while we still have a global lock. After that, unstake() will automatically withdraw.\"},\"withdrawDelegated(address,address)\":{\"details\":\"See {delegate}.\",\"params\":{\"deprecated\":\"Deprecated parameter kept for backwards compatibility\",\"serviceProvider\":\"The service provider address\"},\"returns\":{\"_0\":\"The amount of tokens withdrawn\"}},\"withdrawDelegated(address,address,uint256)\":{\"details\":\"The parameter `nThawRequests` can be set to a non zero value to fulfill a specific number of thaw requests in the event that fulfilling all of them results in a gas limit error. Otherwise, the function will attempt to fulfill all thaw requests until the first one that is not yet expired is found.If the delegation pool was completely slashed before withdrawing, calling this function will fulfill the thaw requests with an amount equal to zero. Requirements: - Must have previously initiated a thaw request using {undelegate}. Emits {ThawRequestFulfilled}, {ThawRequestsFulfilled} and {DelegatedTokensWithdrawn} events.\",\"params\":{\"nThawRequests\":\"The number of thaw requests to fulfill. Set to 0 to fulfill all thaw requests.\",\"serviceProvider\":\"The service provider address\",\"verifier\":\"The verifier address\"}}},\"title\":\"Inferface for the {HorizonStaking} contract.\",\"version\":1},\"userdoc\":{\"errors\":{\"HorizonStakingCallerIsServiceProvider()\":[{\"notice\":\"Thrown when a service provider attempts to change their own operator access.\"}],\"HorizonStakingInsufficientDelegationTokens(uint256,uint256)\":[{\"notice\":\"Thrown when the minimum token amount required for delegation is not met.\"}],\"HorizonStakingInsufficientIdleStake(uint256,uint256)\":[{\"notice\":\"Thrown when the service provider has insufficient idle stake to operate.\"}],\"HorizonStakingInsufficientShares(uint256,uint256)\":[{\"notice\":\"Thrown when a minimum share amount is required to operate but it's not met.\"}],\"HorizonStakingInsufficientStakeForLegacyAllocations(uint256,uint256)\":[{\"notice\":\"Thrown during the transition period when the service provider has insufficient stake to cover their existing legacy allocations.\"}],\"HorizonStakingInsufficientTokens(uint256,uint256)\":[{\"notice\":\"Thrown when a minimum token amount is required to operate but it's not met.\"}],\"HorizonStakingInvalidDelegationFeeCut(uint256)\":[{\"notice\":\"Thrown when trying to set a delegation fee cut that is not valid.\"}],\"HorizonStakingInvalidDelegationPool(address,address)\":[{\"notice\":\"Thrown when attempting to operate with a delegation pool that does not exist.\"}],\"HorizonStakingInvalidDelegationPoolState(address,address)\":[{\"notice\":\"Thrown when as a result of slashing delegation pool has no tokens but has shares.\"}],\"HorizonStakingInvalidMaxVerifierCut(uint32)\":[{\"notice\":\"Thrown when attempting to create a provision with an invalid maximum verifier cut.\"}],\"HorizonStakingInvalidProvision(address,address)\":[{\"notice\":\"Thrown when attempting to operate with a provision that does not exist.\"}],\"HorizonStakingInvalidServiceProviderZeroAddress()\":[{\"notice\":\"Thrown when attempting to redelegate with a serivce provider that is the zero address.\"}],\"HorizonStakingInvalidThawingPeriod(uint64,uint64)\":[{\"notice\":\"Thrown when attempting to create a provision with an invalid thawing period.\"}],\"HorizonStakingInvalidVerifier(address)\":[{\"notice\":\"Thrown when attempting to create a provision with a verifier other than the subgraph data service. This restriction only applies during the transition period.\"}],\"HorizonStakingInvalidVerifierZeroAddress()\":[{\"notice\":\"Thrown when attempting to redelegate with a verifier that is the zero address.\"}],\"HorizonStakingInvalidZeroShares()\":[{\"notice\":\"Thrown when operating a zero share amount is not allowed.\"}],\"HorizonStakingInvalidZeroTokens()\":[{\"notice\":\"Thrown when operating a zero token amount is not allowed.\"}],\"HorizonStakingLegacySlashFailed()\":[{\"notice\":\"Thrown when a legacy slash fails.\"}],\"HorizonStakingNoTokensToSlash()\":[{\"notice\":\"Thrown when there attempting to slash a provision with no tokens to slash.\"}],\"HorizonStakingNotAuthorized(address,address,address)\":[{\"notice\":\"Thrown when the caller is not authorized to operate on a provision.\"}],\"HorizonStakingNothingThawing()\":[{\"notice\":\"Thrown when attempting to fulfill a thaw request but there is nothing thawing.\"}],\"HorizonStakingNothingToWithdraw()\":[{\"notice\":\"Thrown when attempting to withdraw tokens that have not thawed (legacy undelegate).\"}],\"HorizonStakingProvisionAlreadyExists()\":[{\"notice\":\"Thrown when attempting to create a provision for a data service that already has a provision.\"}],\"HorizonStakingSlippageProtection(uint256,uint256)\":[{\"notice\":\"Thrown when delegation shares obtained are below the expected amount.\"}],\"HorizonStakingStillThawing(uint256)\":[{\"notice\":\"Thrown during the transition period when attempting to withdraw tokens that are still thawing.\"}],\"HorizonStakingTooManyThawRequests()\":[{\"notice\":\"Thrown when a service provider has too many thaw requests.\"}],\"HorizonStakingTooManyTokens(uint256,uint256)\":[{\"notice\":\"Thrown when the amount of tokens exceeds the maximum allowed to operate.\"}],\"HorizonStakingVerifierNotAllowed(address)\":[{\"notice\":\"Thrown when a service provider attempts to operate on verifiers that are not allowed.\"}]},\"events\":{\"AllowedLockedVerifierSet(address,bool)\":{\"notice\":\"Emitted when a verifier is allowed or disallowed to be used for locked provisions.\"},\"DelegatedTokensWithdrawn(address,address,address,uint256)\":{\"notice\":\"Emitted when a delegator withdraws tokens from a provision after thawing.\"},\"DelegationFeeCutSet(address,address,uint8,uint256)\":{\"notice\":\"Emitted when a service provider sets delegation fee cuts for a verifier.\"},\"DelegationSlashed(address,address,uint256)\":{\"notice\":\"Emitted when a delegation pool is slashed by a verifier.\"},\"DelegationSlashingEnabled()\":{\"notice\":\"Emitted when the delegation slashing global flag is set.\"},\"DelegationSlashingSkipped(address,address,uint256)\":{\"notice\":\"Emitted when a delegation pool would have been slashed by a verifier, but the slashing was skipped because delegation slashing global parameter is not enabled.\"},\"HorizonStakeLocked(address,uint256,uint256)\":{\"notice\":\"Emitted when a service provider unstakes tokens during the transition period.\"},\"HorizonStakeWithdrawn(address,uint256)\":{\"notice\":\"Emitted when a service provider withdraws tokens during the transition period.\"},\"MaxThawingPeriodSet(uint64)\":{\"notice\":\"Emitted when the global maximum thawing period allowed for provisions is set.\"},\"ProvisionCreated(address,address,uint256,uint32,uint64)\":{\"notice\":\"Emitted when a service provider provisions staked tokens to a verifier.\"},\"ProvisionIncreased(address,address,uint256)\":{\"notice\":\"Emitted whenever staked tokens are added to an existing provision\"},\"ProvisionParametersSet(address,address,uint32,uint64)\":{\"notice\":\"Emitted when a service provider accepts a staged provision parameter update.\"},\"ProvisionParametersStaged(address,address,uint32,uint64)\":{\"notice\":\"Emitted when a service provider stages a provision parameter update.\"},\"ProvisionSlashed(address,address,uint256)\":{\"notice\":\"Emitted when a provision is slashed by a verifier.\"},\"ProvisionThawed(address,address,uint256)\":{\"notice\":\"Emitted when a service provider thaws tokens from a provision.\"},\"StakeDelegatedWithdrawn(address,address,uint256)\":{\"notice\":\"Emitted when `delegator` withdrew delegated `tokens` from `indexer` using `withdrawDelegated`.\"},\"ThawRequestCreated(uint8,address,address,address,uint256,uint64,bytes32,uint256)\":{\"notice\":\"Emitted when a thaw request is created.\"},\"ThawRequestFulfilled(uint8,bytes32,uint256,uint256,uint64,bool)\":{\"notice\":\"Emitted when a thaw request is fulfilled, meaning the stake is released.\"},\"ThawRequestsFulfilled(uint8,address,address,address,uint256,uint256)\":{\"notice\":\"Emitted when a series of thaw requests are fulfilled.\"},\"ThawingPeriodCleared()\":{\"notice\":\"Emitted when the legacy global thawing period is set to zero.\"},\"TokensDelegated(address,address,address,uint256,uint256)\":{\"notice\":\"Emitted when tokens are delegated to a provision.\"},\"TokensDeprovisioned(address,address,uint256)\":{\"notice\":\"Emitted when a service provider removes tokens from a provision.\"},\"TokensToDelegationPoolAdded(address,address,uint256)\":{\"notice\":\"Emitted when tokens are added to a delegation pool's reserve.\"},\"TokensUndelegated(address,address,address,uint256,uint256)\":{\"notice\":\"Emitted when a delegator undelegates tokens from a provision and starts thawing them.\"},\"VerifierTokensSent(address,address,address,uint256)\":{\"notice\":\"Emitted when the verifier cut is sent to the verifier after slashing a provision.\"}},\"kind\":\"user\",\"methods\":{\"acceptProvisionParameters(address)\":{\"notice\":\"Accepts a staged provision parameter update.\"},\"addToDelegationPool(address,address,uint256)\":{\"notice\":\"Add tokens to a delegation pool without issuing shares. Used by data services to pay delegation fees/rewards. Delegators SHOULD NOT call this function.\"},\"addToProvision(address,address,uint256)\":{\"notice\":\"Adds tokens from the service provider's idle stake to a provision\"},\"clearThawingPeriod()\":{\"notice\":\"Clear the legacy global thawing period. This signifies the end of the transition period, after which no legacy allocations should be left.\"},\"delegate(address,address,uint256,uint256)\":{\"notice\":\"Delegate tokens to a provision.\"},\"delegate(address,uint256)\":{\"notice\":\"Delegate tokens to the subgraph data service provision. This function is for backwards compatibility with the legacy staking contract. It only allows delegating to the subgraph data service and DOES NOT have slippage protection.\"},\"deprovision(address,address,uint256)\":{\"notice\":\"Remove tokens from a provision and move them back to the service provider's idle stake.\"},\"getStakingExtension()\":{\"notice\":\"Get the address of the staking extension.\"},\"isAuthorized(address,address,address)\":{\"notice\":\"Check if an operator is authorized for the caller on a specific verifier / data service.\"},\"provision(address,address,uint256,uint32,uint64)\":{\"notice\":\"Provision stake to a verifier. The tokens will be locked with a thawing period and will be slashable by the verifier. This is the main mechanism to provision stake to a data service, where the data service is the verifier. This function can be called by the service provider or by an operator authorized by the provider for this specific verifier.\"},\"provisionLocked(address,address,uint256,uint32,uint64)\":{\"notice\":\"Provision stake to a verifier using locked tokens (i.e. from GraphTokenLockWallets).\"},\"redelegate(address,address,address,address,uint256,uint256)\":{\"notice\":\"Re-delegate undelegated tokens from a provision after thawing to a `newServiceProvider` and `newVerifier`.\"},\"reprovision(address,address,address,uint256)\":{\"notice\":\"Move already thawed stake from one provision into another provision This function can be called by the service provider or by an operator authorized by the provider for the two corresponding verifiers.\"},\"setAllowedLockedVerifier(address,bool)\":{\"notice\":\"Sets a verifier as a globally allowed verifier for locked provisions.\"},\"setDelegationFeeCut(address,address,uint8,uint256)\":{\"notice\":\"Set the fee cut for a verifier on a specific payment type.\"},\"setDelegationSlashingEnabled()\":{\"notice\":\"Set the global delegation slashing flag to true.\"},\"setMaxThawingPeriod(uint64)\":{\"notice\":\"Sets the global maximum thawing period allowed for provisions.\"},\"setOperator(address,address,bool)\":{\"notice\":\"Authorize or unauthorize an address to be an operator for the caller on a data service.\"},\"setOperatorLocked(address,address,bool)\":{\"notice\":\"Authorize or unauthorize an address to be an operator for the caller on a verifier.\"},\"setProvisionParameters(address,address,uint32,uint64)\":{\"notice\":\"Stages a provision parameter update. Note that the change is not effective until the verifier calls {acceptProvisionParameters}. Calling this function is a no-op if the new parameters are the same as the current ones.\"},\"slash(address,uint256,uint256,address)\":{\"notice\":\"Slash a service provider. This can only be called by a verifier to which the provider has provisioned stake, and up to the amount of tokens they have provisioned. If the service provider's stake is not enough, the associated delegation pool might be slashed depending on the value of the global delegation slashing flag. Part of the slashed tokens are sent to the `verifierDestination` as a reward.\"},\"stake(uint256)\":{\"notice\":\"Deposit tokens on the staking contract.\"},\"stakeTo(address,uint256)\":{\"notice\":\"Deposit tokens on the service provider stake, on behalf of the service provider.\"},\"stakeToProvision(address,address,uint256)\":{\"notice\":\"Deposit tokens on the service provider stake, on behalf of the service provider, provisioned to a specific verifier.\"},\"thaw(address,address,uint256)\":{\"notice\":\"Start thawing tokens to remove them from a provision. This function can be called by the service provider or by an operator authorized by the provider for this specific verifier. Note that removing tokens from a provision is a two step process: - First the tokens are thawed using this function. - Then after the thawing period, the tokens are removed from the provision using {deprovision} or {reprovision}.\"},\"undelegate(address,address,uint256)\":{\"notice\":\"Undelegate tokens from a provision and start thawing them. Note that undelegating tokens from a provision is a two step process: - First the tokens are thawed using this function. - Then after the thawing period, the tokens are removed from the provision using {withdrawDelegated}. Requirements: - `shares` cannot be zero. Emits a {TokensUndelegated} and {ThawRequestCreated} event.\"},\"undelegate(address,uint256)\":{\"notice\":\"Undelegate tokens from the subgraph data service provision and start thawing them. This function is for backwards compatibility with the legacy staking contract. It only allows undelegating from the subgraph data service.\"},\"unstake(uint256)\":{\"notice\":\"Move idle stake back to the owner's account. Stake is removed from the protocol: - During the transition period it's locked for a period of time before it can be withdrawn by calling {withdraw}. - After the transition period it's immediately withdrawn. Note that after the transition period if there are tokens still locked they will have to be withdrawn by calling {withdraw}.\"},\"withdraw()\":{\"notice\":\"Withdraw service provider tokens once the thawing period (initiated by {unstake}) has passed. All thawed tokens are withdrawn.\"},\"withdrawDelegated(address,address)\":{\"notice\":\"Withdraw undelegated tokens from the subgraph data service provision after thawing. This function is for backwards compatibility with the legacy staking contract. It only allows withdrawing tokens undelegated before horizon upgrade.\"},\"withdrawDelegated(address,address,uint256)\":{\"notice\":\"Withdraw undelegated tokens from a provision after thawing.\"}},\"notice\":\"Provides functions for managing stake, provisions, delegations, and slashing.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingMain.sol\":\"IHorizonStakingMain\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10},\"remappings\":[]},\"sources\":{\"@graphprotocol/horizon/contracts/interfaces/IGraphPayments.sol\":{\"keccak256\":\"0xa22dcc47676073113e4ebe30045065662cee5531f9c5f75776c00e70a1929c81\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://8908f30b3c7536798b14dc62fb5ccffc05570d568dbd1bade7c79c1fd2a4b5fe\",\"dweb:/ipfs/QmexZgb5mhDmXVZnYX1Z37cwM7EG2prYyBEVjUSVdKshVr\"]},\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingMain.sol\":{\"keccak256\":\"0xd04bb1f6a427e858e8a625b4b9835c69c8891a324d22beba20293ab2a77e5de7\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://05c9e425eee0b6c109a8dad2edcf9e1c845c64fccf321edf804921394ee048be\",\"dweb:/ipfs/QmbwLWNof534oG5ohzNAWrjdQ5kqJs7M5d5kCRd68XUogB\"]},\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingTypes.sol\":{\"keccak256\":\"0xaaeb9770f8aaae6b395e87bb1876a10fe7c14384d16d97dd33a671c3ea53aa7b\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://8f5c019fdb2df73bafe464fb6e9da792f7833a0c1858734bcd6a6b8d6ae924c7\",\"dweb:/ipfs/QmcubeYTHCYBqQsRncBFpPFtk7JzRz4nFh27LUW1m4hx2K\"]}},\"version\":1}" + } + }, + "@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingTypes.sol": { + "IHorizonStakingTypes": { + "abi": [], + "evm": { + "bytecode": { + "functionDebugData": {}, + "generatedSources": [], + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "deployedBytecode": { + "functionDebugData": {}, + "generatedSources": [], + "immutableReferences": {}, + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "methodIdentifiers": {} + }, + "metadata": "{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"custom:security-contact\":\"Please email security+contracts@thegraph.com if you find any bugs. We may have an active bug bounty program.\",\"details\":\"In order to preserve storage compatibility some data structures keep deprecated fields. These structures have then two representations, an internal one used by the contract storage and a public one. Getter functions should retrieve internal representations, remove deprecated fields and return the public representation.\",\"kind\":\"dev\",\"methods\":{},\"title\":\"Defines the data types used in the Horizon staking contract\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingTypes.sol\":\"IHorizonStakingTypes\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10},\"remappings\":[]},\"sources\":{\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingTypes.sol\":{\"keccak256\":\"0xaaeb9770f8aaae6b395e87bb1876a10fe7c14384d16d97dd33a671c3ea53aa7b\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://8f5c019fdb2df73bafe464fb6e9da792f7833a0c1858734bcd6a6b8d6ae924c7\",\"dweb:/ipfs/QmcubeYTHCYBqQsRncBFpPFtk7JzRz4nFh27LUW1m4hx2K\"]}},\"version\":1}" + } + }, + "@graphprotocol/horizon/contracts/libraries/LinkedList.sol": { + "LinkedList": { + "abi": [ + { + "inputs": [], + "name": "LinkedListEmptyList", + "type": "error" + }, + { + "inputs": [], + "name": "LinkedListInvalidIterations", + "type": "error" + }, + { + "inputs": [], + "name": "LinkedListInvalidZeroId", + "type": "error" + }, + { + "inputs": [], + "name": "LinkedListMaxElementsExceeded", + "type": "error" + } + ], + "evm": { + "bytecode": { + "functionDebugData": {}, + "generatedSources": [], + "linkReferences": {}, + "object": "60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220634bc6e5aef788fd779dcee4cca795e76964f7e1e5b44586fd8eda2c36fc128764736f6c634300081b0033", + "opcodes": "PUSH1 0x56 PUSH1 0x37 PUSH1 0xB DUP3 DUP3 DUP3 CODECOPY DUP1 MLOAD PUSH1 0x0 BYTE PUSH1 0x73 EQ PUSH1 0x2A JUMPI PUSH4 0x4E487B71 PUSH1 0xE0 SHL PUSH1 0x0 MSTORE PUSH1 0x0 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST ADDRESS PUSH1 0x0 MSTORE PUSH1 0x73 DUP2 MSTORE8 DUP3 DUP2 RETURN INVALID PUSH20 0x0 ADDRESS EQ PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 PUSH4 0x4BC6E5AE 0xF7 DUP9 REVERT PUSH24 0x9DCEE4CCA795E76964F7E1E5B44586FD8EDA2C36FC128764 PUSH20 0x6F6C634300081B00330000000000000000000000 ", + "sourceMap": "786:4964:33:-:0;;;;;;;;;;;;;;;-1:-1:-1;;;786:4964:33;;;;;;;;;;;;;;;;;" + }, + "deployedBytecode": { + "functionDebugData": {}, + "generatedSources": [], + "immutableReferences": {}, + "linkReferences": {}, + "object": "73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220634bc6e5aef788fd779dcee4cca795e76964f7e1e5b44586fd8eda2c36fc128764736f6c634300081b0033", + "opcodes": "PUSH20 0x0 ADDRESS EQ PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 PUSH4 0x4BC6E5AE 0xF7 DUP9 REVERT PUSH24 0x9DCEE4CCA795E76964F7E1E5B44586FD8EDA2C36FC128764 PUSH20 0x6F6C634300081B00330000000000000000000000 ", + "sourceMap": "786:4964:33:-:0;;;;;;;;" + }, + "methodIdentifiers": {} + }, + "metadata": "{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"name\":\"LinkedListEmptyList\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LinkedListInvalidIterations\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LinkedListInvalidZeroId\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LinkedListMaxElementsExceeded\",\"type\":\"error\"}],\"devdoc\":{\"custom:security-contact\":\"Please email security+contracts@thegraph.com if you find any bugs. We may have an active bug bounty program.\",\"kind\":\"dev\",\"methods\":{},\"title\":\"LinkedList library\",\"version\":1},\"userdoc\":{\"errors\":{\"LinkedListEmptyList()\":[{\"notice\":\"Thrown when trying to remove an item from an empty list\"}],\"LinkedListInvalidIterations()\":[{\"notice\":\"Thrown when trying to traverse a list with more iterations than elements\"}],\"LinkedListInvalidZeroId()\":[{\"notice\":\"Thrown when trying to add an item with id equal to bytes32(0)\"}],\"LinkedListMaxElementsExceeded()\":[{\"notice\":\"Thrown when trying to add an item to a list that has reached the maximum number of elements\"}]},\"kind\":\"user\",\"methods\":{},\"notice\":\"A library to manage singly linked lists. The library makes no assumptions about the contents of the items, the only requirements on the items are: - they must be represented by a unique bytes32 id - the id of the item must not be bytes32(0) - each item must have a reference to the next item in the list - the list cannot have more than `MAX_ITEMS` items A contract using this library must store: - a LinkedList.List to keep track of the list metadata - a mapping from bytes32 to the item data\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"@graphprotocol/horizon/contracts/libraries/LinkedList.sol\":\"LinkedList\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10},\"remappings\":[]},\"sources\":{\"@graphprotocol/horizon/contracts/libraries/LinkedList.sol\":{\"keccak256\":\"0x99058b4da0428b8d9c22d3d112acbaa59900f1fd0a434038b1a4fccfe3c678d6\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://568e03231c6081eacbcb6585a05c0b1bb976b640b611f7bf6155f9b58d887239\",\"dweb:/ipfs/QmdPZQWhkhjf5TUwz487Dwm4ycjX323iNdwb1sQnAiA1Qu\"]}},\"version\":1}" + } + }, + "@graphprotocol/horizon/contracts/libraries/MathUtils.sol": { + "MathUtils": { + "abi": [], + "evm": { + "bytecode": { + "functionDebugData": {}, + "generatedSources": [], + "linkReferences": {}, + "object": "60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea264697066735822122090721977f146bc47651e28a67cd8f9ce83518cba11871d05c2c3ef61d8aefbd264736f6c634300081b0033", + "opcodes": "PUSH1 0x56 PUSH1 0x37 PUSH1 0xB DUP3 DUP3 DUP3 CODECOPY DUP1 MLOAD PUSH1 0x0 BYTE PUSH1 0x73 EQ PUSH1 0x2A JUMPI PUSH4 0x4E487B71 PUSH1 0xE0 SHL PUSH1 0x0 MSTORE PUSH1 0x0 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST ADDRESS PUSH1 0x0 MSTORE PUSH1 0x73 DUP2 MSTORE8 DUP3 DUP2 RETURN INVALID PUSH20 0x0 ADDRESS EQ PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 SWAP1 PUSH19 0x1977F146BC47651E28A67CD8F9CE83518CBA11 DUP8 SAR SDIV 0xC2 0xC3 0xEF PUSH2 0xD8AE 0xFB 0xD2 PUSH5 0x736F6C6343 STOP ADDMOD SHL STOP CALLER ", + "sourceMap": "311:1477:34:-:0;;;;;;;;;;;;;;;-1:-1:-1;;;311:1477:34;;;;;;;;;;;;;;;;;" + }, + "deployedBytecode": { + "functionDebugData": {}, + "generatedSources": [], + "immutableReferences": {}, + "linkReferences": {}, + "object": "73000000000000000000000000000000000000000030146080604052600080fdfea264697066735822122090721977f146bc47651e28a67cd8f9ce83518cba11871d05c2c3ef61d8aefbd264736f6c634300081b0033", + "opcodes": "PUSH20 0x0 ADDRESS EQ PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 SWAP1 PUSH19 0x1977F146BC47651E28A67CD8F9CE83518CBA11 DUP8 SAR SDIV 0xC2 0xC3 0xEF PUSH2 0xD8AE 0xFB 0xD2 PUSH5 0x736F6C6343 STOP ADDMOD SHL STOP CALLER ", + "sourceMap": "311:1477:34:-:0;;;;;;;;" + }, + "methodIdentifiers": {} + }, + "metadata": "{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"custom:security-contact\":\"Please email security+contracts@thegraph.com if you find any bugs. We may have an active bug bounty program.\",\"kind\":\"dev\",\"methods\":{},\"title\":\"MathUtils Library\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"notice\":\"A collection of functions to perform math operations\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"@graphprotocol/horizon/contracts/libraries/MathUtils.sol\":\"MathUtils\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10},\"remappings\":[]},\"sources\":{\"@graphprotocol/horizon/contracts/libraries/MathUtils.sol\":{\"keccak256\":\"0x24cd80c0d25f634db1e8101c0a474a284758eb7a2203ae3abf507f578fa12e0a\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://69d03db4aaa31184b3ec9526bf236949683c5a35785c298cad0ac160904b695c\",\"dweb:/ipfs/Qmd2xSKW6ojrapgrRimrXCpc52GTrQ3BMAEYH17UvSfvLV\"]}},\"version\":1}" + } + }, + "@graphprotocol/horizon/contracts/libraries/PPMMath.sol": { + "PPMMath": { + "abi": [ + { + "inputs": [ + { + "internalType": "uint256", + "name": "a", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "b", + "type": "uint256" + } + ], + "name": "PPMMathInvalidMulPPM", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "PPMMathInvalidPPM", + "type": "error" + } + ], + "evm": { + "bytecode": { + "functionDebugData": {}, + "generatedSources": [], + "linkReferences": {}, + "object": "60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220ec389b234df2d4af81896c70e838876b3c31d3925e53798ff4f46249c78f3d4b64736f6c634300081b0033", + "opcodes": "PUSH1 0x56 PUSH1 0x37 PUSH1 0xB DUP3 DUP3 DUP3 CODECOPY DUP1 MLOAD PUSH1 0x0 BYTE PUSH1 0x73 EQ PUSH1 0x2A JUMPI PUSH4 0x4E487B71 PUSH1 0xE0 SHL PUSH1 0x0 MSTORE PUSH1 0x0 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST ADDRESS PUSH1 0x0 MSTORE PUSH1 0x73 DUP2 MSTORE8 DUP3 DUP2 RETURN INVALID PUSH20 0x0 ADDRESS EQ PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0xEC CODESIZE SWAP12 0x23 0x4D CALLCODE 0xD4 0xAF DUP2 DUP10 PUSH13 0x70E838876B3C31D3925E53798F DELEGATECALL DELEGATECALL PUSH3 0x49C78F RETURNDATASIZE 0x4B PUSH5 0x736F6C6343 STOP ADDMOD SHL STOP CALLER ", + "sourceMap": "329:1769:35:-:0;;;;;;;;;;;;;;;-1:-1:-1;;;329:1769:35;;;;;;;;;;;;;;;;;" + }, + "deployedBytecode": { + "functionDebugData": {}, + "generatedSources": [], + "immutableReferences": {}, + "linkReferences": {}, + "object": "73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220ec389b234df2d4af81896c70e838876b3c31d3925e53798ff4f46249c78f3d4b64736f6c634300081b0033", + "opcodes": "PUSH20 0x0 ADDRESS EQ PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0xEC CODESIZE SWAP12 0x23 0x4D CALLCODE 0xD4 0xAF DUP2 DUP10 PUSH13 0x70E838876B3C31D3925E53798F DELEGATECALL DELEGATECALL PUSH3 0x49C78F RETURNDATASIZE 0x4B PUSH5 0x736F6C6343 STOP ADDMOD SHL STOP CALLER ", + "sourceMap": "329:1769:35:-:0;;;;;;;;" + }, + "methodIdentifiers": {} + }, + "metadata": "{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"a\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"b\",\"type\":\"uint256\"}],\"name\":\"PPMMathInvalidMulPPM\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"PPMMathInvalidPPM\",\"type\":\"error\"}],\"devdoc\":{\"custom:security-contact\":\"Please email security+contracts@thegraph.com if you find any bugs. We may have an active bug bounty program.\",\"errors\":{\"PPMMathInvalidMulPPM(uint256,uint256)\":[{\"params\":{\"a\":\"The first value in the multiplication.\",\"b\":\"The second value in the multiplication.\"}}],\"PPMMathInvalidPPM(uint256)\":[{\"params\":{\"value\":\"The value that is not in PPM.\"}}]},\"kind\":\"dev\",\"methods\":{},\"title\":\"PPMMath library\",\"version\":1},\"userdoc\":{\"errors\":{\"PPMMathInvalidMulPPM(uint256,uint256)\":[{\"notice\":\"Thrown when no value in a multiplication is in PPM.\"}],\"PPMMathInvalidPPM(uint256)\":[{\"notice\":\"Thrown when a value is expected to be in PPM but is not.\"}]},\"kind\":\"user\",\"methods\":{},\"notice\":\"A library for handling calculations with parts per million (PPM) amounts.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"@graphprotocol/horizon/contracts/libraries/PPMMath.sol\":\"PPMMath\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10},\"remappings\":[]},\"sources\":{\"@graphprotocol/horizon/contracts/libraries/PPMMath.sol\":{\"keccak256\":\"0xe7fcfd44d2919944b79a11a39da7d4539d49c4bcf510071a59f6b41c37ee8ef2\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://a21b1ff7ca81fa07f153b60aeca136bd1ee57d9d01a2c76635e4a5602e8959fc\",\"dweb:/ipfs/QmQ5C7mUjt4sv1NBt1FH5XVHN3aBsHnvDsdJKWywhLjso8\"]}},\"version\":1}" + } + }, + "@graphprotocol/horizon/contracts/libraries/UintRange.sol": { + "UintRange": { + "abi": [], + "evm": { + "bytecode": { + "functionDebugData": {}, + "generatedSources": [], + "linkReferences": {}, + "object": "60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220202b2a49d0bef5c3760fc54aa977ee0438614d43207535d20e13c7a6105db25f64736f6c634300081b0033", + "opcodes": "PUSH1 0x56 PUSH1 0x37 PUSH1 0xB DUP3 DUP3 DUP3 CODECOPY DUP1 MLOAD PUSH1 0x0 BYTE PUSH1 0x73 EQ PUSH1 0x2A JUMPI PUSH4 0x4E487B71 PUSH1 0xE0 SHL PUSH1 0x0 MSTORE PUSH1 0x0 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST ADDRESS PUSH1 0x0 MSTORE PUSH1 0x73 DUP2 MSTORE8 DUP3 DUP2 RETURN INVALID PUSH20 0x0 ADDRESS EQ PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 KECCAK256 0x2B 0x2A BLOBHASH 0xD0 0xBE CREATE2 0xC3 PUSH23 0xFC54AA977EE0438614D43207535D20E13C7A6105DB25F PUSH5 0x736F6C6343 STOP ADDMOD SHL STOP CALLER ", + "sourceMap": "312:455:36:-:0;;;;;;;;;;;;;;;-1:-1:-1;;;312:455:36;;;;;;;;;;;;;;;;;" + }, + "deployedBytecode": { + "functionDebugData": {}, + "generatedSources": [], + "immutableReferences": {}, + "linkReferences": {}, + "object": "73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220202b2a49d0bef5c3760fc54aa977ee0438614d43207535d20e13c7a6105db25f64736f6c634300081b0033", + "opcodes": "PUSH20 0x0 ADDRESS EQ PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 KECCAK256 0x2B 0x2A BLOBHASH 0xD0 0xBE CREATE2 0xC3 PUSH23 0xFC54AA977EE0438614D43207535D20E13C7A6105DB25F PUSH5 0x736F6C6343 STOP ADDMOD SHL STOP CALLER ", + "sourceMap": "312:455:36:-:0;;;;;;;;" + }, + "methodIdentifiers": {} + }, + "metadata": "{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"custom:security-contact\":\"Please email security+contracts@thegraph.com if you find any bugs. We may have an active bug bounty program.\",\"kind\":\"dev\",\"methods\":{},\"title\":\"UintRange library\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"notice\":\"A library for handling range checks on uint256 values.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"@graphprotocol/horizon/contracts/libraries/UintRange.sol\":\"UintRange\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10},\"remappings\":[]},\"sources\":{\"@graphprotocol/horizon/contracts/libraries/UintRange.sol\":{\"keccak256\":\"0x70d69069b2c122becd29ec4ea9a79f2e26cf7cbe7b1918ffced691ee00cdbd82\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://6bddc7d257c3df1fd4940dd3c554e5a1efbc1b23d50f7878415389b75380628c\",\"dweb:/ipfs/QmTQBCsL4pHoXMixVvDwGMdmJnGfEeeDZfHdJkcpKamu58\"]}},\"version\":1}" + } + }, + "@graphprotocol/horizon/contracts/utilities/GraphDirectory.sol": { + "GraphDirectory": { + "abi": [ + { + "inputs": [ + { + "internalType": "bytes", + "name": "contractName", + "type": "bytes" + } + ], + "name": "GraphDirectoryInvalidZeroAddress", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "graphToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "graphStaking", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphPayments", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphEscrow", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "graphController", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphEpochManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphRewardsManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphTokenGateway", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphProxyAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphCuration", + "type": "address" + } + ], + "name": "GraphDirectoryInitialized", + "type": "event" + } + ], + "evm": { + "bytecode": { + "functionDebugData": {}, + "generatedSources": [], + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "deployedBytecode": { + "functionDebugData": {}, + "generatedSources": [], + "immutableReferences": {}, + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "methodIdentifiers": {} + }, + "metadata": "{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"contractName\",\"type\":\"bytes\"}],\"name\":\"GraphDirectoryInvalidZeroAddress\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"graphToken\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"graphStaking\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"graphPayments\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"graphEscrow\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"graphController\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"graphEpochManager\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"graphRewardsManager\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"graphTokenGateway\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"graphProxyAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"graphCuration\",\"type\":\"address\"}],\"name\":\"GraphDirectoryInitialized\",\"type\":\"event\"}],\"devdoc\":{\"errors\":{\"GraphDirectoryInvalidZeroAddress(bytes)\":[{\"params\":{\"contractName\":\"The name of the contract that was not found, or the controller\"}}]},\"events\":{\"GraphDirectoryInitialized(address,address,address,address,address,address,address,address,address,address)\":{\"params\":{\"graphController\":\"The Graph Controller contract address\",\"graphCuration\":\"The Curation contract address\",\"graphEpochManager\":\"The Epoch Manager contract address\",\"graphEscrow\":\"The Payments Escrow contract address\",\"graphPayments\":\"The Graph Payments contract address\",\"graphProxyAdmin\":\"The Graph Proxy Admin contract address\",\"graphRewardsManager\":\"The Rewards Manager contract address\",\"graphStaking\":\"The Horizon Staking contract address\",\"graphToken\":\"The Graph Token contract address\",\"graphTokenGateway\":\"The Token Gateway contract address\"}}},\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Requirements: - `controller` cannot be zero address Emits a {GraphDirectoryInitialized} event\",\"params\":{\"controller\":\"The address of the Graph Controller contract.\"}}},\"title\":\"GraphDirectory contract\",\"version\":1},\"userdoc\":{\"errors\":{\"GraphDirectoryInvalidZeroAddress(bytes)\":[{\"notice\":\"Thrown when either the controller is the zero address or a contract address is not found on the controller\"}]},\"events\":{\"GraphDirectoryInitialized(address,address,address,address,address,address,address,address,address,address)\":{\"notice\":\"Emitted when the GraphDirectory is initialized\"}},\"kind\":\"user\",\"methods\":{\"constructor\":{\"notice\":\"Constructor for the GraphDirectory contract\"}},\"notice\":\"This contract is meant to be inherited by other contracts that need to keep track of the addresses in Graph Horizon contracts. It fetches the addresses from the Controller supplied during construction, and uses immutable variables to minimize gas costs.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"@graphprotocol/horizon/contracts/utilities/GraphDirectory.sol\":\"GraphDirectory\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10},\"remappings\":[]},\"sources\":{\"@graphprotocol/contracts/contracts/arbitrum/ITokenGateway.sol\":{\"keccak256\":\"0x3cbcc6e4629543a99acacc7ee4ffa6c063b9fb17d3597ccd2f9481008e3633bd\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://d6bb0bb830b67d579e57a261e5f5d9e90b32dc006b02badbecf1f6c82c0a5100\",\"dweb:/ipfs/Qmd38iNXZpinwbNRJPEAA8r9bmmtRwjTSK1SkmH47ge4kJ\"]},\"@graphprotocol/contracts/contracts/curation/ICuration.sol\":{\"keccak256\":\"0x17e4db429003cab08cd2859db94b95e0cee1f9478c1881903a4104def8fdc048\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://52ed58228a0e92aeb3493473a6e02f92d26a4e4eb0c46d38dd446e3bfcb6691e\",\"dweb:/ipfs/QmZzWxHAztdz2Q7cobqVEf4ExGpNuqWJFYgs2oHCgApjW6\"]},\"@graphprotocol/contracts/contracts/epochs/IEpochManager.sol\":{\"keccak256\":\"0x0f4b3a3569c023d2610d0d8b37b3ecb0b67f848d77aa063bb311756670017e85\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://df7c43568e554b301134aa2c58e4889ad0d3dcfec40e834b63621a43f39da154\",\"dweb:/ipfs/QmZeSV9AM6FKCkH9QYyF7i5nVggseEJXbvWbtrgUeXqQpo\"]},\"@graphprotocol/contracts/contracts/governance/IController.sol\":{\"keccak256\":\"0xe37df86cdea385d708ba00862cd9e04940e4f2aa50354fb3a9d2d4f505d5509a\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://0f6c9fd2b7a8c5a6b89ef12c7423144df04a5f251d5480be1b73c74a785ff12a\",\"dweb:/ipfs/QmYpiCQoxbDEYQ2FNA39Z4FGfoxfQ8jvH1Z3ccrqguQFMP\"]},\"@graphprotocol/contracts/contracts/rewards/IRewardsIssuer.sol\":{\"keccak256\":\"0xe049090c38a64d80b284ba2a7b440bcedba9804d96f2bb8da525e69ac452e03a\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://8b7d1186bd0698bed02d3504ac80c20e605087fba036d5ff392b39a9a3c818e5\",\"dweb:/ipfs/QmRgAfY1dD5rc7fLuuGVyu2mh9Z8qz1AVvuXAcRGnB3dSv\"]},\"@graphprotocol/contracts/contracts/rewards/IRewardsManager.sol\":{\"keccak256\":\"0xee4b213950c2e46481658b9b04f2d5dae0a96c4cce0ee346188b1f1272718d54\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://b26dd767bd6887666a18beef79c322d27a693a3a4f7a61dc6bded7f35796acf5\",\"dweb:/ipfs/QmXDeqmRSeAWUWQTknNLUPBDBnDr8ySYW4h6CBPRGMJoPp\"]},\"@graphprotocol/contracts/contracts/token/IGraphToken.sol\":{\"keccak256\":\"0x2ffad6798d641c8d1288730be725c43041c803caceaf6d9985122d000ad5761c\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://5f782a5670037fc9223dc20fd4f99c0277a9bec7d08f7800b0a0733e819a07cb\",\"dweb:/ipfs/QmP3K2QnmukScCh1nzgphYdg7AiAuTaT914jq4txLYNpra\"]},\"@graphprotocol/horizon/contracts/interfaces/IGraphPayments.sol\":{\"keccak256\":\"0xa22dcc47676073113e4ebe30045065662cee5531f9c5f75776c00e70a1929c81\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://8908f30b3c7536798b14dc62fb5ccffc05570d568dbd1bade7c79c1fd2a4b5fe\",\"dweb:/ipfs/QmexZgb5mhDmXVZnYX1Z37cwM7EG2prYyBEVjUSVdKshVr\"]},\"@graphprotocol/horizon/contracts/interfaces/IGraphProxyAdmin.sol\":{\"keccak256\":\"0x4410253d7de56d2cdff50ee141c52fd77fd23f3984440211c3cc90ad560f4f9d\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://da4425a908816c40ffc3c833504843c3732bcb47e745dc544f650e5bc2c23f25\",\"dweb:/ipfs/QmZYDS4cSKBqRXEU3qyjE6sxGModSeNgzQmdZmZCGHuaKt\"]},\"@graphprotocol/horizon/contracts/interfaces/IHorizonStaking.sol\":{\"keccak256\":\"0x4b146f30ee66c4224cb5a82bafc8299f8596d8fe302e793757520f67bba8a166\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://30666c737d72a850223c1966d3b5d02b84f3f808f3c8dae8d0748731646b60c5\",\"dweb:/ipfs/QmQschyZQtU8tTnQ9hNiG5nobuXBx6KeiKdfxvZ4zvQ7ty\"]},\"@graphprotocol/horizon/contracts/interfaces/IPaymentsEscrow.sol\":{\"keccak256\":\"0x99e2a676b539e7b6c223a551f8cb9770c07435a25c8b22f0044a8ce4949edadc\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://f702a3cea214d8328d89a0ef16495c709e30fe13eb86fc29940159c9cb8c7bd5\",\"dweb:/ipfs/QmS25Zgcw85kDZcicApLzRmDcoYNQafpFdMyBEWX8eLWSX\"]},\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingBase.sol\":{\"keccak256\":\"0x9bdab6cb595eabd7d321d7beae03ad3607995c14ef40f0c2f349fb72084766c5\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://6cac2ca3580bd770b98b07b11ebb007e8a922a90cde920e6ec472df7e66fb512\",\"dweb:/ipfs/QmRw1rjT8D8gNp2GRTuwDETwHNHMpHKoHZq4pYBAn9i65F\"]},\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingExtension.sol\":{\"keccak256\":\"0x7923f39746198b5672f0e4d65b7bf14903ae5f7775d74b210effb957eea36c71\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://c29531aff69c71e649fb347d7117ea8c42fc8de09860a1c389ed9b8f097a34e0\",\"dweb:/ipfs/QmS89fww584HiyE1BdPe8Xaqbf5v7FEvL38GTxeHEAsLFm\"]},\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingMain.sol\":{\"keccak256\":\"0xd04bb1f6a427e858e8a625b4b9835c69c8891a324d22beba20293ab2a77e5de7\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://05c9e425eee0b6c109a8dad2edcf9e1c845c64fccf321edf804921394ee048be\",\"dweb:/ipfs/QmbwLWNof534oG5ohzNAWrjdQ5kqJs7M5d5kCRd68XUogB\"]},\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingTypes.sol\":{\"keccak256\":\"0xaaeb9770f8aaae6b395e87bb1876a10fe7c14384d16d97dd33a671c3ea53aa7b\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://8f5c019fdb2df73bafe464fb6e9da792f7833a0c1858734bcd6a6b8d6ae924c7\",\"dweb:/ipfs/QmcubeYTHCYBqQsRncBFpPFtk7JzRz4nFh27LUW1m4hx2K\"]},\"@graphprotocol/horizon/contracts/libraries/LinkedList.sol\":{\"keccak256\":\"0x99058b4da0428b8d9c22d3d112acbaa59900f1fd0a434038b1a4fccfe3c678d6\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://568e03231c6081eacbcb6585a05c0b1bb976b640b611f7bf6155f9b58d887239\",\"dweb:/ipfs/QmdPZQWhkhjf5TUwz487Dwm4ycjX323iNdwb1sQnAiA1Qu\"]},\"@graphprotocol/horizon/contracts/utilities/GraphDirectory.sol\":{\"keccak256\":\"0x1d09be2f7454873ab80f86ed5d590b9e796fe5146977c4c4a5b1f7ead17eb522\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://e1c7539d26f069c2acabd404601e7811f8878f66976e8b5d4f5438195de793c2\",\"dweb:/ipfs/QmUAybvtDZ275kAnU6r81aQy1FCp7zLscSV87oe9nbwjyU\"]},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0xe06a3f08a987af6ad2e1c1e774405d4fe08f1694b67517438b467cecf0da0ef7\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://df6f0c459663c9858b6cba2cda1d14a7d05a985bed6d2de72bd8e78c25ee79db\",\"dweb:/ipfs/QmeTTxZ7qVk9rjEv2R4CpCwdf8UMCcRqDNMvzNxHc3Fnn9\"]}},\"version\":1}" + } + }, + "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol": { + "OwnableUpgradeable": { + "abi": [ + { + "inputs": [], + "name": "InvalidInitialization", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "OwnableInvalidOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "OwnableUnauthorizedAccount", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "evm": { + "bytecode": { + "functionDebugData": {}, + "generatedSources": [], + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "deployedBytecode": { + "functionDebugData": {}, + "generatedSources": [], + "immutableReferences": {}, + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "methodIdentifiers": { + "owner()": "8da5cb5b", + "renounceOwnership()": "715018a6", + "transferOwnership(address)": "f2fde38b" + } + }, + "metadata": "{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"name\":\"InvalidInitialization\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotInitializing\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"OwnableInvalidOwner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"OwnableUnauthorizedAccount\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"version\",\"type\":\"uint64\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"Contract module which provides a basic access control mechanism, where there is an account (an owner) that can be granted exclusive access to specific functions. The initial owner is set to the address provided by the deployer. This can later be changed with {transferOwnership}. This module is used through inheritance. It will make available the modifier `onlyOwner`, which can be applied to your functions to restrict their use to the owner.\",\"errors\":{\"InvalidInitialization()\":[{\"details\":\"The contract is already initialized.\"}],\"NotInitializing()\":[{\"details\":\"The contract is not initializing.\"}],\"OwnableInvalidOwner(address)\":[{\"details\":\"The owner is not a valid owner account. (eg. `address(0)`)\"}],\"OwnableUnauthorizedAccount(address)\":[{\"details\":\"The caller account is not authorized to perform an operation.\"}]},\"events\":{\"Initialized(uint64)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"}},\"kind\":\"dev\",\"methods\":{\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\":\"OwnableUpgradeable\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\":{\"keccak256\":\"0xc163fcf9bb10138631a9ba5564df1fa25db9adff73bd9ee868a8ae1858fe093a\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://9706d43a0124053d9880f6e31a59f31bc0a6a3dc1acd66ce0a16e1111658c5f6\",\"dweb:/ipfs/QmUFmfowzkRwGtDu36cXV9SPTBHJ3n7dG9xQiK5B28jTf2\"]},\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"keccak256\":\"0xdb4d24ee2c087c391d587cd17adfe5b3f9d93b3110b1388c2ab6c7c0ad1dcd05\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://ab7b6d5b9e2b88176312967fe0f0e78f3d9a1422fa5e4b64e2440c35869b5d08\",\"dweb:/ipfs/QmXKYWWyzcLg1B2k7Sb1qkEXgLCYfXecR9wYW5obRzWP1Q\"]},\"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol\":{\"keccak256\":\"0xdbef5f0c787055227243a7318ef74c8a5a1108ca3a07f2b3a00ef67769e1e397\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://08e39f23d5b4692f9a40803e53a8156b72b4c1f9902a88cd65ba964db103dab9\",\"dweb:/ipfs/QmPKn6EYDgpga7KtpkA8wV2yJCYGMtc9K4LkJfhKX2RVSV\"]}},\"version\":1}" + } + }, + "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol": { + "Initializable": { + "abi": [ + { + "inputs": [], + "name": "InvalidInitialization", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + } + ], + "evm": { + "bytecode": { + "functionDebugData": {}, + "generatedSources": [], + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "deployedBytecode": { + "functionDebugData": {}, + "generatedSources": [], + "immutableReferences": {}, + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "methodIdentifiers": {} + }, + "metadata": "{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"name\":\"InvalidInitialization\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotInitializing\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"version\",\"type\":\"uint64\"}],\"name\":\"Initialized\",\"type\":\"event\"}],\"devdoc\":{\"custom:oz-upgrades-unsafe-allow\":\"constructor constructor() { _disableInitializers(); } ``` ====\",\"details\":\"This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. The initialization functions use a version number. Once a version number is used, it is consumed and cannot be reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in case an upgrade adds a module that needs to be initialized. For example: [.hljs-theme-light.nopadding] ```solidity contract MyToken is ERC20Upgradeable { function initialize() initializer public { __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\"); } } contract MyTokenV2 is MyToken, ERC20PermitUpgradeable { function initializeV2() reinitializer(2) public { __ERC20Permit_init(\\\"MyToken\\\"); } } ``` TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. [CAUTION] ==== Avoid leaving a contract uninitialized. An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke the {_disableInitializers} function in the constructor to automatically lock it when it is deployed: [.hljs-theme-light.nopadding] ```\",\"errors\":{\"InvalidInitialization()\":[{\"details\":\"The contract is already initialized.\"}],\"NotInitializing()\":[{\"details\":\"The contract is not initializing.\"}]},\"events\":{\"Initialized(uint64)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"}},\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":\"Initializable\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"keccak256\":\"0xdb4d24ee2c087c391d587cd17adfe5b3f9d93b3110b1388c2ab6c7c0ad1dcd05\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://ab7b6d5b9e2b88176312967fe0f0e78f3d9a1422fa5e4b64e2440c35869b5d08\",\"dweb:/ipfs/QmXKYWWyzcLg1B2k7Sb1qkEXgLCYfXecR9wYW5obRzWP1Q\"]}},\"version\":1}" + } + }, + "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol": { + "ContextUpgradeable": { + "abi": [ + { + "inputs": [], + "name": "InvalidInitialization", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + } + ], + "evm": { + "bytecode": { + "functionDebugData": {}, + "generatedSources": [], + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "deployedBytecode": { + "functionDebugData": {}, + "generatedSources": [], + "immutableReferences": {}, + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "methodIdentifiers": {} + }, + "metadata": "{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"name\":\"InvalidInitialization\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotInitializing\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"version\",\"type\":\"uint64\"}],\"name\":\"Initialized\",\"type\":\"event\"}],\"devdoc\":{\"details\":\"Provides information about the current execution context, including the sender of the transaction and its data. While these are generally available via msg.sender and msg.data, they should not be accessed in such a direct manner, since when dealing with meta-transactions the account sending and paying for execution may not be the actual sender (as far as an application is concerned). This contract is only required for intermediate, library-like contracts.\",\"errors\":{\"InvalidInitialization()\":[{\"details\":\"The contract is already initialized.\"}],\"NotInitializing()\":[{\"details\":\"The contract is not initializing.\"}]},\"events\":{\"Initialized(uint64)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"}},\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol\":\"ContextUpgradeable\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"keccak256\":\"0xdb4d24ee2c087c391d587cd17adfe5b3f9d93b3110b1388c2ab6c7c0ad1dcd05\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://ab7b6d5b9e2b88176312967fe0f0e78f3d9a1422fa5e4b64e2440c35869b5d08\",\"dweb:/ipfs/QmXKYWWyzcLg1B2k7Sb1qkEXgLCYfXecR9wYW5obRzWP1Q\"]},\"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol\":{\"keccak256\":\"0xdbef5f0c787055227243a7318ef74c8a5a1108ca3a07f2b3a00ef67769e1e397\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://08e39f23d5b4692f9a40803e53a8156b72b4c1f9902a88cd65ba964db103dab9\",\"dweb:/ipfs/QmPKn6EYDgpga7KtpkA8wV2yJCYGMtc9K4LkJfhKX2RVSV\"]}},\"version\":1}" + } + }, + "@openzeppelin/contracts-upgradeable/utils/MulticallUpgradeable.sol": { + "MulticallUpgradeable": { + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + } + ], + "name": "AddressEmptyCode", + "type": "error" + }, + { + "inputs": [], + "name": "FailedCall", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidInitialization", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "name": "multicall", + "outputs": [ + { + "internalType": "bytes[]", + "name": "results", + "type": "bytes[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "evm": { + "bytecode": { + "functionDebugData": {}, + "generatedSources": [], + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "deployedBytecode": { + "functionDebugData": {}, + "generatedSources": [], + "immutableReferences": {}, + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "methodIdentifiers": { + "multicall(bytes[])": "ac9650d8" + } + }, + "metadata": "{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"}],\"name\":\"AddressEmptyCode\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedCall\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidInitialization\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotInitializing\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"version\",\"type\":\"uint64\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"bytes[]\",\"name\":\"data\",\"type\":\"bytes[]\"}],\"name\":\"multicall\",\"outputs\":[{\"internalType\":\"bytes[]\",\"name\":\"results\",\"type\":\"bytes[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"Provides a function to batch together multiple calls in a single external call. Consider any assumption about calldata validation performed by the sender may be violated if it's not especially careful about sending transactions invoking {multicall}. For example, a relay address that filters function selectors won't filter calls nested within a {multicall} operation. NOTE: Since 5.0.1 and 4.9.4, this contract identifies non-canonical contexts (i.e. `msg.sender` is not {Context-_msgSender}). If a non-canonical context is identified, the following self `delegatecall` appends the last bytes of `msg.data` to the subcall. This makes it safe to use with {ERC2771Context}. Contexts that don't affect the resolution of {Context-_msgSender} are not propagated to subcalls.\",\"errors\":{\"AddressEmptyCode(address)\":[{\"details\":\"There's no code at `target` (it is not a contract).\"}],\"FailedCall()\":[{\"details\":\"A call to an address target failed. The target may have reverted.\"}],\"InvalidInitialization()\":[{\"details\":\"The contract is already initialized.\"}],\"NotInitializing()\":[{\"details\":\"The contract is not initializing.\"}]},\"events\":{\"Initialized(uint64)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"}},\"kind\":\"dev\",\"methods\":{\"multicall(bytes[])\":{\"custom:oz-upgrades-unsafe-allow-reachable\":\"delegatecall\",\"details\":\"Receives and executes a batch of function calls on this contract.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@openzeppelin/contracts-upgradeable/utils/MulticallUpgradeable.sol\":\"MulticallUpgradeable\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"keccak256\":\"0xdb4d24ee2c087c391d587cd17adfe5b3f9d93b3110b1388c2ab6c7c0ad1dcd05\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://ab7b6d5b9e2b88176312967fe0f0e78f3d9a1422fa5e4b64e2440c35869b5d08\",\"dweb:/ipfs/QmXKYWWyzcLg1B2k7Sb1qkEXgLCYfXecR9wYW5obRzWP1Q\"]},\"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol\":{\"keccak256\":\"0xdbef5f0c787055227243a7318ef74c8a5a1108ca3a07f2b3a00ef67769e1e397\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://08e39f23d5b4692f9a40803e53a8156b72b4c1f9902a88cd65ba964db103dab9\",\"dweb:/ipfs/QmPKn6EYDgpga7KtpkA8wV2yJCYGMtc9K4LkJfhKX2RVSV\"]},\"@openzeppelin/contracts-upgradeable/utils/MulticallUpgradeable.sol\":{\"keccak256\":\"0xe5775eb1fb17165cd191e8f8b2232dbea8765e7e610eaa3d6e52feead793ec5a\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://352614aea75c3d913cbcabb528be3d6c3335c3c77da41d59486a3193069dd095\",\"dweb:/ipfs/QmR3Nabxfme6tHrAMJCyK4MWZtpund2c4R7aFKmea3sGZM\"]},\"@openzeppelin/contracts/utils/Address.sol\":{\"keccak256\":\"0xaaa1d17c1129b127a4a401db2fbd72960e2671474be3d08cae71ccdc42f7624c\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://cb2f27cd3952aa667e198fba0d9b7bcec52fbb12c16f013c25fe6fb52b29cc0e\",\"dweb:/ipfs/QmeuohBFoeyDPZA9JNCTEDz3VBfBD4EABWuWXVhHAuEpKR\"]},\"@openzeppelin/contracts/utils/Errors.sol\":{\"keccak256\":\"0x6afa713bfd42cf0f7656efa91201007ac465e42049d7de1d50753a373648c123\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://ba1d02f4847670a1b83dec9f7d37f0b0418d6043447b69f3a29a5f9efc547fcf\",\"dweb:/ipfs/QmQ7iH2keLNUKgq2xSWcRmuBE5eZ3F5whYAkAGzCNNoEWB\"]}},\"version\":1}" + } + }, + "@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol": { + "PausableUpgradeable": { + "abi": [ + { + "inputs": [], + "name": "EnforcedPause", + "type": "error" + }, + { + "inputs": [], + "name": "ExpectedPause", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidInitialization", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Paused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Unpaused", + "type": "event" + }, + { + "inputs": [], + "name": "paused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "evm": { + "bytecode": { + "functionDebugData": {}, + "generatedSources": [], + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "deployedBytecode": { + "functionDebugData": {}, + "generatedSources": [], + "immutableReferences": {}, + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "methodIdentifiers": { + "paused()": "5c975abb" + } + }, + "metadata": "{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"name\":\"EnforcedPause\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ExpectedPause\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidInitialization\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotInitializing\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"version\",\"type\":\"uint64\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Paused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Unpaused\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"paused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"Contract module which allows children to implement an emergency stop mechanism that can be triggered by an authorized account. This module is used through inheritance. It will make available the modifiers `whenNotPaused` and `whenPaused`, which can be applied to the functions of your contract. Note that they will not be pausable by simply including this module, only once the modifiers are put in place.\",\"errors\":{\"EnforcedPause()\":[{\"details\":\"The operation failed because the contract is paused.\"}],\"ExpectedPause()\":[{\"details\":\"The operation failed because the contract is not paused.\"}],\"InvalidInitialization()\":[{\"details\":\"The contract is already initialized.\"}],\"NotInitializing()\":[{\"details\":\"The contract is not initializing.\"}]},\"events\":{\"Initialized(uint64)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"},\"Paused(address)\":{\"details\":\"Emitted when the pause is triggered by `account`.\"},\"Unpaused(address)\":{\"details\":\"Emitted when the pause is lifted by `account`.\"}},\"kind\":\"dev\",\"methods\":{\"paused()\":{\"details\":\"Returns true if the contract is paused, and false otherwise.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol\":\"PausableUpgradeable\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"keccak256\":\"0xdb4d24ee2c087c391d587cd17adfe5b3f9d93b3110b1388c2ab6c7c0ad1dcd05\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://ab7b6d5b9e2b88176312967fe0f0e78f3d9a1422fa5e4b64e2440c35869b5d08\",\"dweb:/ipfs/QmXKYWWyzcLg1B2k7Sb1qkEXgLCYfXecR9wYW5obRzWP1Q\"]},\"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol\":{\"keccak256\":\"0xdbef5f0c787055227243a7318ef74c8a5a1108ca3a07f2b3a00ef67769e1e397\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://08e39f23d5b4692f9a40803e53a8156b72b4c1f9902a88cd65ba964db103dab9\",\"dweb:/ipfs/QmPKn6EYDgpga7KtpkA8wV2yJCYGMtc9K4LkJfhKX2RVSV\"]},\"@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol\":{\"keccak256\":\"0xa6bf6b7efe0e6625a9dcd30c5ddf52c4c24fe8372f37c7de9dbf5034746768d5\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://8c353ee3705bbf6fadb84c0fb10ef1b736e8ca3ca1867814349d1487ed207beb\",\"dweb:/ipfs/QmcugaPssrzGGE8q4YZKm2ZhnD3kCijjcgdWWg76nWt3FY\"]}},\"version\":1}" + } + }, + "@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol": { + "EIP712Upgradeable": { + "abi": [ + { + "inputs": [], + "name": "InvalidInitialization", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "anonymous": false, + "inputs": [], + "name": "EIP712DomainChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "inputs": [], + "name": "eip712Domain", + "outputs": [ + { + "internalType": "bytes1", + "name": "fields", + "type": "bytes1" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "version", + "type": "string" + }, + { + "internalType": "uint256", + "name": "chainId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "verifyingContract", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "salt", + "type": "bytes32" + }, + { + "internalType": "uint256[]", + "name": "extensions", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "evm": { + "bytecode": { + "functionDebugData": {}, + "generatedSources": [], + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "deployedBytecode": { + "functionDebugData": {}, + "generatedSources": [], + "immutableReferences": {}, + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "methodIdentifiers": { + "eip712Domain()": "84b0196e" + } + }, + "metadata": "{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"name\":\"InvalidInitialization\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotInitializing\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"EIP712DomainChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"version\",\"type\":\"uint64\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"eip712Domain\",\"outputs\":[{\"internalType\":\"bytes1\",\"name\":\"fields\",\"type\":\"bytes1\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"version\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"verifyingContract\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"salt\",\"type\":\"bytes32\"},{\"internalType\":\"uint256[]\",\"name\":\"extensions\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"https://eips.ethereum.org/EIPS/eip-712[EIP-712] is a standard for hashing and signing of typed structured data. The encoding scheme specified in the EIP requires a domain separator and a hash of the typed structured data, whose encoding is very generic and therefore its implementation in Solidity is not feasible, thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding they need in order to produce the hash of their typed data using a combination of `abi.encode` and `keccak256`. This contract implements the EIP-712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA ({_hashTypedDataV4}). The implementation of the domain separator was designed to be as efficient as possible while still properly updating the chain id to protect against replay attacks on an eventual fork of the chain. NOTE: This contract implements the version of the encoding known as \\\"v4\\\", as implemented by the JSON RPC method https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask]. NOTE: In the upgradeable version of this contract, the cached values will correspond to the address, and the domain separator of the implementation contract. This will cause the {_domainSeparatorV4} function to always rebuild the separator from the immutable values, which is cheaper than accessing a cached version in cold storage.\",\"errors\":{\"InvalidInitialization()\":[{\"details\":\"The contract is already initialized.\"}],\"NotInitializing()\":[{\"details\":\"The contract is not initializing.\"}]},\"events\":{\"EIP712DomainChanged()\":{\"details\":\"MAY be emitted to signal that the domain could have changed.\"},\"Initialized(uint64)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"}},\"kind\":\"dev\",\"methods\":{\"eip712Domain()\":{\"details\":\"returns the fields and values that describe the domain separator used by this contract for EIP-712 signature.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol\":\"EIP712Upgradeable\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"keccak256\":\"0xdb4d24ee2c087c391d587cd17adfe5b3f9d93b3110b1388c2ab6c7c0ad1dcd05\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://ab7b6d5b9e2b88176312967fe0f0e78f3d9a1422fa5e4b64e2440c35869b5d08\",\"dweb:/ipfs/QmXKYWWyzcLg1B2k7Sb1qkEXgLCYfXecR9wYW5obRzWP1Q\"]},\"@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol\":{\"keccak256\":\"0xd45a5b1d0e451376b08e1bc7e332426c24382053300acf0ac667be1b8abb6cc2\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://824eb0b8c71db8b95b707218d8540c2046a2fefc642e74b343ae90e5c72e2b52\",\"dweb:/ipfs/QmdQTZTomqxRrySDNdv1FEyh3ZWibxwC9FRdcV3DCuASpx\"]},\"@openzeppelin/contracts/interfaces/IERC5267.sol\":{\"keccak256\":\"0x92aa1df62dc3d33f1656d63bede0923e0df0b706ad4137c8b10b0a8fe549fd92\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://c5c0f29195ad64cbe556da8e257dac8f05f78c53f90323c0d2accf8e6922d33a\",\"dweb:/ipfs/QmQ61TED8uaCZwcbh8KkgRSsCav7x7HbcGHwHts3U4DmUP\"]},\"@openzeppelin/contracts/utils/Panic.sol\":{\"keccak256\":\"0xf7fe324703a64fc51702311dc51562d5cb1497734f074e4f483bfb6717572d7a\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://c6a5ff4f9fd8649b7ee20800b7fa387d3465bd77cf20c2d1068cd5c98e1ed57a\",\"dweb:/ipfs/QmVSaVJf9FXFhdYEYeCEfjMVHrxDh5qL4CGkxdMWpQCrqG\"]},\"@openzeppelin/contracts/utils/Strings.sol\":{\"keccak256\":\"0x81c274a60a7ae232ae3dc9ff3a4011b4849a853c13b0832cd3351bb1bb2f0dae\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://9da0c20dc74358a2a76330818f3bac9d1e2ce3371aec847b9cbf5d147fbae4f6\",\"dweb:/ipfs/QmeczhmnFv1hbXKGLwbYXY6Rrytc9a5A2YaRi5QMMgjPnb\"]},\"@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol\":{\"keccak256\":\"0x26670fef37d4adf55570ba78815eec5f31cb017e708f61886add4fc4da665631\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://b16d45febff462bafd8a5669f904796a835baf607df58a8461916d3bf4f08c59\",\"dweb:/ipfs/QmU2eJFpjmT4vxeJWJyLeQb8Xht1kdB8Y6MKLDPFA9WPux\"]},\"@openzeppelin/contracts/utils/math/Math.sol\":{\"keccak256\":\"0x1225214420c83ebcca88f2ae2b50f053aaa7df7bd684c3e878d334627f2edfc6\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://6c5fab4970634f9ab9a620983dc1c8a30153981a0b1a521666e269d0a11399d3\",\"dweb:/ipfs/QmVRnBC575MESGkEHndjujtR7qub2FzU9RWy9eKLp4hPZB\"]},\"@openzeppelin/contracts/utils/math/SafeCast.sol\":{\"keccak256\":\"0x195533c86d0ef72bcc06456a4f66a9b941f38eb403739b00f21fd7c1abd1ae54\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://b1d578337048cad08c1c03041cca5978eff5428aa130c781b271ad9e5566e1f8\",\"dweb:/ipfs/QmPFKL2r9CBsMwmUqqdcFPfHZB2qcs9g1HDrPxzWSxomvy\"]},\"@openzeppelin/contracts/utils/math/SignedMath.sol\":{\"keccak256\":\"0xb1970fac7b64e6c09611e6691791e848d5e3fe410fa5899e7df2e0afd77a99e3\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://db5fbb3dddd8b7047465b62575d96231ba8a2774d37fb4737fbf23340fabbb03\",\"dweb:/ipfs/QmVUSvooZKEdEdap619tcJjTLcAuH6QBdZqAzWwnAXZAWJ\"]}},\"version\":1}" + } + }, + "@openzeppelin/contracts/interfaces/IERC5267.sol": { + "IERC5267": { + "abi": [ + { + "anonymous": false, + "inputs": [], + "name": "EIP712DomainChanged", + "type": "event" + }, + { + "inputs": [], + "name": "eip712Domain", + "outputs": [ + { + "internalType": "bytes1", + "name": "fields", + "type": "bytes1" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "version", + "type": "string" + }, + { + "internalType": "uint256", + "name": "chainId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "verifyingContract", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "salt", + "type": "bytes32" + }, + { + "internalType": "uint256[]", + "name": "extensions", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "evm": { + "bytecode": { + "functionDebugData": {}, + "generatedSources": [], + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "deployedBytecode": { + "functionDebugData": {}, + "generatedSources": [], + "immutableReferences": {}, + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "methodIdentifiers": { + "eip712Domain()": "84b0196e" + } + }, + "metadata": "{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[],\"name\":\"EIP712DomainChanged\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"eip712Domain\",\"outputs\":[{\"internalType\":\"bytes1\",\"name\":\"fields\",\"type\":\"bytes1\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"version\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"verifyingContract\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"salt\",\"type\":\"bytes32\"},{\"internalType\":\"uint256[]\",\"name\":\"extensions\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"events\":{\"EIP712DomainChanged()\":{\"details\":\"MAY be emitted to signal that the domain could have changed.\"}},\"kind\":\"dev\",\"methods\":{\"eip712Domain()\":{\"details\":\"returns the fields and values that describe the domain separator used by this contract for EIP-712 signature.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@openzeppelin/contracts/interfaces/IERC5267.sol\":\"IERC5267\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/interfaces/IERC5267.sol\":{\"keccak256\":\"0x92aa1df62dc3d33f1656d63bede0923e0df0b706ad4137c8b10b0a8fe549fd92\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://c5c0f29195ad64cbe556da8e257dac8f05f78c53f90323c0d2accf8e6922d33a\",\"dweb:/ipfs/QmQ61TED8uaCZwcbh8KkgRSsCav7x7HbcGHwHts3U4DmUP\"]}},\"version\":1}" + } + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "IERC20": { + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "evm": { + "bytecode": { + "functionDebugData": {}, + "generatedSources": [], + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "deployedBytecode": { + "functionDebugData": {}, + "generatedSources": [], + "immutableReferences": {}, + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "methodIdentifiers": { + "allowance(address,address)": "dd62ed3e", + "approve(address,uint256)": "095ea7b3", + "balanceOf(address)": "70a08231", + "totalSupply()": "18160ddd", + "transfer(address,uint256)": "a9059cbb", + "transferFrom(address,address,uint256)": "23b872dd" + } + }, + "metadata": "{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"Interface of the ERC-20 standard as defined in the ERC.\",\"events\":{\"Approval(address,address,uint256)\":{\"details\":\"Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance.\"},\"Transfer(address,address,uint256)\":{\"details\":\"Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero.\"}},\"kind\":\"dev\",\"methods\":{\"allowance(address,address)\":{\"details\":\"Returns the remaining number of tokens that `spender` will be allowed to spend on behalf of `owner` through {transferFrom}. This is zero by default. This value changes when {approve} or {transferFrom} are called.\"},\"approve(address,uint256)\":{\"details\":\"Sets a `value` amount of tokens as the allowance of `spender` over the caller's tokens. Returns a boolean value indicating whether the operation succeeded. IMPORTANT: Beware that changing an allowance with this method brings the risk that someone may use both the old and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 Emits an {Approval} event.\"},\"balanceOf(address)\":{\"details\":\"Returns the value of tokens owned by `account`.\"},\"totalSupply()\":{\"details\":\"Returns the value of tokens in existence.\"},\"transfer(address,uint256)\":{\"details\":\"Moves a `value` amount of tokens from the caller's account to `to`. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event.\"},\"transferFrom(address,address,uint256)\":{\"details\":\"Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism. `value` is then deducted from the caller's allowance. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":\"IERC20\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0xe06a3f08a987af6ad2e1c1e774405d4fe08f1694b67517438b467cecf0da0ef7\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://df6f0c459663c9858b6cba2cda1d14a7d05a985bed6d2de72bd8e78c25ee79db\",\"dweb:/ipfs/QmeTTxZ7qVk9rjEv2R4CpCwdf8UMCcRqDNMvzNxHc3Fnn9\"]}},\"version\":1}" + } + }, + "@openzeppelin/contracts/utils/Address.sol": { + "Address": { + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + } + ], + "name": "AddressEmptyCode", + "type": "error" + } + ], + "evm": { + "bytecode": { + "functionDebugData": {}, + "generatedSources": [], + "linkReferences": {}, + "object": "60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220781a1d5bdb5668d82b50835cd32ca92ccbec39aad96b67a488f50e9afdae7d5164736f6c634300081b0033", + "opcodes": "PUSH1 0x56 PUSH1 0x37 PUSH1 0xB DUP3 DUP3 DUP3 CODECOPY DUP1 MLOAD PUSH1 0x0 BYTE PUSH1 0x73 EQ PUSH1 0x2A JUMPI PUSH4 0x4E487B71 PUSH1 0xE0 SHL PUSH1 0x0 MSTORE PUSH1 0x0 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST ADDRESS PUSH1 0x0 MSTORE PUSH1 0x73 DUP2 MSTORE8 DUP3 DUP2 RETURN INVALID PUSH20 0x0 ADDRESS EQ PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 PUSH25 0x1A1D5BDB5668D82B50835CD32CA92CCBEC39AAD96B67A488F5 0xE SWAP11 REVERT 0xAE PUSH30 0x5164736F6C634300081B0033000000000000000000000000000000000000 ", + "sourceMap": "233:5815:46:-:0;;;;;;;;;;;;;;;-1:-1:-1;;;233:5815:46;;;;;;;;;;;;;;;;;" + }, + "deployedBytecode": { + "functionDebugData": {}, + "generatedSources": [], + "immutableReferences": {}, + "linkReferences": {}, + "object": "73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220781a1d5bdb5668d82b50835cd32ca92ccbec39aad96b67a488f50e9afdae7d5164736f6c634300081b0033", + "opcodes": "PUSH20 0x0 ADDRESS EQ PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 PUSH25 0x1A1D5BDB5668D82B50835CD32CA92CCBEC39AAD96B67A488F5 0xE SWAP11 REVERT 0xAE PUSH30 0x5164736F6C634300081B0033000000000000000000000000000000000000 ", + "sourceMap": "233:5815:46:-:0;;;;;;;;" + }, + "methodIdentifiers": {} + }, + "metadata": "{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"}],\"name\":\"AddressEmptyCode\",\"type\":\"error\"}],\"devdoc\":{\"details\":\"Collection of functions related to the address type\",\"errors\":{\"AddressEmptyCode(address)\":[{\"details\":\"There's no code at `target` (it is not a contract).\"}]},\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@openzeppelin/contracts/utils/Address.sol\":\"Address\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/utils/Address.sol\":{\"keccak256\":\"0xaaa1d17c1129b127a4a401db2fbd72960e2671474be3d08cae71ccdc42f7624c\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://cb2f27cd3952aa667e198fba0d9b7bcec52fbb12c16f013c25fe6fb52b29cc0e\",\"dweb:/ipfs/QmeuohBFoeyDPZA9JNCTEDz3VBfBD4EABWuWXVhHAuEpKR\"]},\"@openzeppelin/contracts/utils/Errors.sol\":{\"keccak256\":\"0x6afa713bfd42cf0f7656efa91201007ac465e42049d7de1d50753a373648c123\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://ba1d02f4847670a1b83dec9f7d37f0b0418d6043447b69f3a29a5f9efc547fcf\",\"dweb:/ipfs/QmQ7iH2keLNUKgq2xSWcRmuBE5eZ3F5whYAkAGzCNNoEWB\"]}},\"version\":1}" + } + }, + "@openzeppelin/contracts/utils/Errors.sol": { + "Errors": { + "abi": [ + { + "inputs": [], + "name": "FailedCall", + "type": "error" + }, + { + "inputs": [], + "name": "FailedDeployment", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "needed", + "type": "uint256" + } + ], + "name": "InsufficientBalance", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "MissingPrecompile", + "type": "error" + } + ], + "evm": { + "bytecode": { + "functionDebugData": {}, + "generatedSources": [], + "linkReferences": {}, + "object": "60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea264697066735822122044ae8a2f23a1248c5d321b81ea162b8f9c89b21a77e70eb0aba03a267938d51f64736f6c634300081b0033", + "opcodes": "PUSH1 0x56 PUSH1 0x37 PUSH1 0xB DUP3 DUP3 DUP3 CODECOPY DUP1 MLOAD PUSH1 0x0 BYTE PUSH1 0x73 EQ PUSH1 0x2A JUMPI PUSH4 0x4E487B71 PUSH1 0xE0 SHL PUSH1 0x0 MSTORE PUSH1 0x0 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST ADDRESS PUSH1 0x0 MSTORE PUSH1 0x73 DUP2 MSTORE8 DUP3 DUP2 RETURN INVALID PUSH20 0x0 ADDRESS EQ PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 PREVRANDAO 0xAE DUP11 0x2F 0x23 LOG1 0x24 DUP13 TSTORE ORIGIN SHL DUP2 0xEA AND 0x2B DUP16 SWAP13 DUP10 0xB2 BYTE PUSH24 0xE70EB0ABA03A267938D51F64736F6C634300081B00330000 ", + "sourceMap": "411:484:47:-:0;;;;;;;;;;;;;;;-1:-1:-1;;;411:484:47;;;;;;;;;;;;;;;;;" + }, + "deployedBytecode": { + "functionDebugData": {}, + "generatedSources": [], + "immutableReferences": {}, + "linkReferences": {}, + "object": "73000000000000000000000000000000000000000030146080604052600080fdfea264697066735822122044ae8a2f23a1248c5d321b81ea162b8f9c89b21a77e70eb0aba03a267938d51f64736f6c634300081b0033", + "opcodes": "PUSH20 0x0 ADDRESS EQ PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 PREVRANDAO 0xAE DUP11 0x2F 0x23 LOG1 0x24 DUP13 TSTORE ORIGIN SHL DUP2 0xEA AND 0x2B DUP16 SWAP13 DUP10 0xB2 BYTE PUSH24 0xE70EB0ABA03A267938D51F64736F6C634300081B00330000 ", + "sourceMap": "411:484:47:-:0;;;;;;;;" + }, + "methodIdentifiers": {} + }, + "metadata": "{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"name\":\"FailedCall\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedDeployment\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"balance\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"needed\",\"type\":\"uint256\"}],\"name\":\"InsufficientBalance\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"MissingPrecompile\",\"type\":\"error\"}],\"devdoc\":{\"details\":\"Collection of common custom errors used in multiple contracts IMPORTANT: Backwards compatibility is not guaranteed in future versions of the library. It is recommended to avoid relying on the error API for critical functionality. _Available since v5.1._\",\"errors\":{\"FailedCall()\":[{\"details\":\"A call to an address target failed. The target may have reverted.\"}],\"FailedDeployment()\":[{\"details\":\"The deployment failed.\"}],\"InsufficientBalance(uint256,uint256)\":[{\"details\":\"The ETH balance of the account is not enough to perform the operation.\"}],\"MissingPrecompile(address)\":[{\"details\":\"A necessary precompile is missing.\"}]},\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@openzeppelin/contracts/utils/Errors.sol\":\"Errors\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/utils/Errors.sol\":{\"keccak256\":\"0x6afa713bfd42cf0f7656efa91201007ac465e42049d7de1d50753a373648c123\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://ba1d02f4847670a1b83dec9f7d37f0b0418d6043447b69f3a29a5f9efc547fcf\",\"dweb:/ipfs/QmQ7iH2keLNUKgq2xSWcRmuBE5eZ3F5whYAkAGzCNNoEWB\"]}},\"version\":1}" + } + }, + "@openzeppelin/contracts/utils/Panic.sol": { + "Panic": { + "abi": [], + "evm": { + "bytecode": { + "functionDebugData": {}, + "generatedSources": [], + "linkReferences": {}, + "object": "60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea264697066735822122094e995d013dad400678b7d35e8eb7544d9da48ba493c0f2ea19c12592c28629c64736f6c634300081b0033", + "opcodes": "PUSH1 0x56 PUSH1 0x37 PUSH1 0xB DUP3 DUP3 DUP3 CODECOPY DUP1 MLOAD PUSH1 0x0 BYTE PUSH1 0x73 EQ PUSH1 0x2A JUMPI PUSH4 0x4E487B71 PUSH1 0xE0 SHL PUSH1 0x0 MSTORE PUSH1 0x0 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST ADDRESS PUSH1 0x0 MSTORE PUSH1 0x73 DUP2 MSTORE8 DUP3 DUP2 RETURN INVALID PUSH20 0x0 ADDRESS EQ PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 SWAP5 0xE9 SWAP6 0xD0 SGT 0xDA 0xD4 STOP PUSH8 0x8B7D35E8EB7544D9 0xDA BASEFEE 0xBA BLOBHASH EXTCODECOPY 0xF 0x2E LOG1 SWAP13 SLT MSIZE 0x2C 0x28 PUSH3 0x9C6473 PUSH16 0x6C634300081B00330000000000000000 ", + "sourceMap": "657:1315:48:-:0;;;;;;;;;;;;;;;-1:-1:-1;;;657:1315:48;;;;;;;;;;;;;;;;;" + }, + "deployedBytecode": { + "functionDebugData": {}, + "generatedSources": [], + "immutableReferences": {}, + "linkReferences": {}, + "object": "73000000000000000000000000000000000000000030146080604052600080fdfea264697066735822122094e995d013dad400678b7d35e8eb7544d9da48ba493c0f2ea19c12592c28629c64736f6c634300081b0033", + "opcodes": "PUSH20 0x0 ADDRESS EQ PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 SWAP5 0xE9 SWAP6 0xD0 SGT 0xDA 0xD4 STOP PUSH8 0x8B7D35E8EB7544D9 0xDA BASEFEE 0xBA BLOBHASH EXTCODECOPY 0xF 0x2E LOG1 SWAP13 SLT MSIZE 0x2C 0x28 PUSH3 0x9C6473 PUSH16 0x6C634300081B00330000000000000000 ", + "sourceMap": "657:1315:48:-:0;;;;;;;;" + }, + "methodIdentifiers": {} + }, + "metadata": "{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"details\":\"Helper library for emitting standardized panic codes. ```solidity contract Example { using Panic for uint256; // Use any of the declared internal constants function foo() { Panic.GENERIC.panic(); } // Alternatively function foo() { Panic.panic(Panic.GENERIC); } } ``` Follows the list from https://github.com/ethereum/solidity/blob/v0.8.24/libsolutil/ErrorCodes.h[libsolutil]. _Available since v5.1._\",\"kind\":\"dev\",\"methods\":{},\"stateVariables\":{\"ARRAY_OUT_OF_BOUNDS\":{\"details\":\"array out of bounds access\"},\"ASSERT\":{\"details\":\"used by the assert() builtin\"},\"DIVISION_BY_ZERO\":{\"details\":\"division or modulo by zero\"},\"EMPTY_ARRAY_POP\":{\"details\":\"empty array pop\"},\"ENUM_CONVERSION_ERROR\":{\"details\":\"enum conversion error\"},\"GENERIC\":{\"details\":\"generic / unspecified error\"},\"INVALID_INTERNAL_FUNCTION\":{\"details\":\"calling invalid internal function\"},\"RESOURCE_ERROR\":{\"details\":\"resource error (too large allocation or too large array)\"},\"STORAGE_ENCODING_ERROR\":{\"details\":\"invalid encoding in storage\"},\"UNDER_OVERFLOW\":{\"details\":\"arithmetic underflow or overflow\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@openzeppelin/contracts/utils/Panic.sol\":\"Panic\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/utils/Panic.sol\":{\"keccak256\":\"0xf7fe324703a64fc51702311dc51562d5cb1497734f074e4f483bfb6717572d7a\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://c6a5ff4f9fd8649b7ee20800b7fa387d3465bd77cf20c2d1068cd5c98e1ed57a\",\"dweb:/ipfs/QmVSaVJf9FXFhdYEYeCEfjMVHrxDh5qL4CGkxdMWpQCrqG\"]}},\"version\":1}" + } + }, + "@openzeppelin/contracts/utils/Strings.sol": { + "Strings": { + "abi": [ + { + "inputs": [ + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "length", + "type": "uint256" + } + ], + "name": "StringsInsufficientHexLength", + "type": "error" + }, + { + "inputs": [], + "name": "StringsInvalidAddressFormat", + "type": "error" + }, + { + "inputs": [], + "name": "StringsInvalidChar", + "type": "error" + } + ], + "evm": { + "bytecode": { + "functionDebugData": {}, + "generatedSources": [], + "linkReferences": {}, + "object": "60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea264697066735822122058f56da3e94bb4690ff2a315d128d171be8dd3c73ab16dcb6c2f491a33b239af64736f6c634300081b0033", + "opcodes": "PUSH1 0x56 PUSH1 0x37 PUSH1 0xB DUP3 DUP3 DUP3 CODECOPY DUP1 MLOAD PUSH1 0x0 BYTE PUSH1 0x73 EQ PUSH1 0x2A JUMPI PUSH4 0x4E487B71 PUSH1 0xE0 SHL PUSH1 0x0 MSTORE PUSH1 0x0 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST ADDRESS PUSH1 0x0 MSTORE PUSH1 0x73 DUP2 MSTORE8 DUP3 DUP2 RETURN INVALID PUSH20 0x0 ADDRESS EQ PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 PC CREATE2 PUSH14 0xA3E94BB4690FF2A315D128D171BE DUP14 0xD3 0xC7 GASPRICE 0xB1 PUSH14 0xCB6C2F491A33B239AF64736F6C63 NUMBER STOP ADDMOD SHL STOP CALLER ", + "sourceMap": "297:18980:49:-:0;;;;;;;;;;;;;;;-1:-1:-1;;;297:18980:49;;;;;;;;;;;;;;;;;" + }, + "deployedBytecode": { + "functionDebugData": {}, + "generatedSources": [], + "immutableReferences": {}, + "linkReferences": {}, + "object": "73000000000000000000000000000000000000000030146080604052600080fdfea264697066735822122058f56da3e94bb4690ff2a315d128d171be8dd3c73ab16dcb6c2f491a33b239af64736f6c634300081b0033", + "opcodes": "PUSH20 0x0 ADDRESS EQ PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 PC CREATE2 PUSH14 0xA3E94BB4690FF2A315D128D171BE DUP14 0xD3 0xC7 GASPRICE 0xB1 PUSH14 0xCB6C2F491A33B239AF64736F6C63 NUMBER STOP ADDMOD SHL STOP CALLER ", + "sourceMap": "297:18980:49:-:0;;;;;;;;" + }, + "methodIdentifiers": {} + }, + "metadata": "{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"length\",\"type\":\"uint256\"}],\"name\":\"StringsInsufficientHexLength\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"StringsInvalidAddressFormat\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"StringsInvalidChar\",\"type\":\"error\"}],\"devdoc\":{\"details\":\"String operations.\",\"errors\":{\"StringsInsufficientHexLength(uint256,uint256)\":[{\"details\":\"The `value` string doesn't fit in the specified `length`.\"}],\"StringsInvalidAddressFormat()\":[{\"details\":\"The string being parsed is not a properly formatted address.\"}],\"StringsInvalidChar()\":[{\"details\":\"The string being parsed contains characters that are not in scope of the given base.\"}]},\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@openzeppelin/contracts/utils/Strings.sol\":\"Strings\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/utils/Panic.sol\":{\"keccak256\":\"0xf7fe324703a64fc51702311dc51562d5cb1497734f074e4f483bfb6717572d7a\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://c6a5ff4f9fd8649b7ee20800b7fa387d3465bd77cf20c2d1068cd5c98e1ed57a\",\"dweb:/ipfs/QmVSaVJf9FXFhdYEYeCEfjMVHrxDh5qL4CGkxdMWpQCrqG\"]},\"@openzeppelin/contracts/utils/Strings.sol\":{\"keccak256\":\"0x81c274a60a7ae232ae3dc9ff3a4011b4849a853c13b0832cd3351bb1bb2f0dae\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://9da0c20dc74358a2a76330818f3bac9d1e2ce3371aec847b9cbf5d147fbae4f6\",\"dweb:/ipfs/QmeczhmnFv1hbXKGLwbYXY6Rrytc9a5A2YaRi5QMMgjPnb\"]},\"@openzeppelin/contracts/utils/math/Math.sol\":{\"keccak256\":\"0x1225214420c83ebcca88f2ae2b50f053aaa7df7bd684c3e878d334627f2edfc6\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://6c5fab4970634f9ab9a620983dc1c8a30153981a0b1a521666e269d0a11399d3\",\"dweb:/ipfs/QmVRnBC575MESGkEHndjujtR7qub2FzU9RWy9eKLp4hPZB\"]},\"@openzeppelin/contracts/utils/math/SafeCast.sol\":{\"keccak256\":\"0x195533c86d0ef72bcc06456a4f66a9b941f38eb403739b00f21fd7c1abd1ae54\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://b1d578337048cad08c1c03041cca5978eff5428aa130c781b271ad9e5566e1f8\",\"dweb:/ipfs/QmPFKL2r9CBsMwmUqqdcFPfHZB2qcs9g1HDrPxzWSxomvy\"]},\"@openzeppelin/contracts/utils/math/SignedMath.sol\":{\"keccak256\":\"0xb1970fac7b64e6c09611e6691791e848d5e3fe410fa5899e7df2e0afd77a99e3\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://db5fbb3dddd8b7047465b62575d96231ba8a2774d37fb4737fbf23340fabbb03\",\"dweb:/ipfs/QmVUSvooZKEdEdap619tcJjTLcAuH6QBdZqAzWwnAXZAWJ\"]}},\"version\":1}" + } + }, + "@openzeppelin/contracts/utils/cryptography/ECDSA.sol": { + "ECDSA": { + "abi": [ + { + "inputs": [], + "name": "ECDSAInvalidSignature", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "length", + "type": "uint256" + } + ], + "name": "ECDSAInvalidSignatureLength", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "ECDSAInvalidSignatureS", + "type": "error" + } + ], + "evm": { + "bytecode": { + "functionDebugData": {}, + "generatedSources": [], + "linkReferences": {}, + "object": "60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea26469706673582212204a45519caa943036b099b384dc8f08082679ed7bcf35f4f1926155f3a3b94e9964736f6c634300081b0033", + "opcodes": "PUSH1 0x56 PUSH1 0x37 PUSH1 0xB DUP3 DUP3 DUP3 CODECOPY DUP1 MLOAD PUSH1 0x0 BYTE PUSH1 0x73 EQ PUSH1 0x2A JUMPI PUSH4 0x4E487B71 PUSH1 0xE0 SHL PUSH1 0x0 MSTORE PUSH1 0x0 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST ADDRESS PUSH1 0x0 MSTORE PUSH1 0x73 DUP2 MSTORE8 DUP3 DUP2 RETURN INVALID PUSH20 0x0 ADDRESS EQ PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 BLOBBASEFEE GASLIMIT MLOAD SWAP13 0xAA SWAP5 ADDRESS CALLDATASIZE 0xB0 SWAP10 0xB3 DUP5 0xDC DUP16 ADDMOD ADDMOD 0x26 PUSH26 0xED7BCF35F4F1926155F3A3B94E9964736F6C634300081B003300 ", + "sourceMap": "344:7470:50:-:0;;;;;;;;;;;;;;;-1:-1:-1;;;344:7470:50;;;;;;;;;;;;;;;;;" + }, + "deployedBytecode": { + "functionDebugData": {}, + "generatedSources": [], + "immutableReferences": {}, + "linkReferences": {}, + "object": "73000000000000000000000000000000000000000030146080604052600080fdfea26469706673582212204a45519caa943036b099b384dc8f08082679ed7bcf35f4f1926155f3a3b94e9964736f6c634300081b0033", + "opcodes": "PUSH20 0x0 ADDRESS EQ PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 BLOBBASEFEE GASLIMIT MLOAD SWAP13 0xAA SWAP5 ADDRESS CALLDATASIZE 0xB0 SWAP10 0xB3 DUP5 0xDC DUP16 ADDMOD ADDMOD 0x26 PUSH26 0xED7BCF35F4F1926155F3A3B94E9964736F6C634300081B003300 ", + "sourceMap": "344:7470:50:-:0;;;;;;;;" + }, + "methodIdentifiers": {} + }, + "metadata": "{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"name\":\"ECDSAInvalidSignature\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"length\",\"type\":\"uint256\"}],\"name\":\"ECDSAInvalidSignatureLength\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"ECDSAInvalidSignatureS\",\"type\":\"error\"}],\"devdoc\":{\"details\":\"Elliptic Curve Digital Signature Algorithm (ECDSA) operations. These functions can be used to verify that a message was signed by the holder of the private keys of a given address.\",\"errors\":{\"ECDSAInvalidSignature()\":[{\"details\":\"The signature derives the `address(0)`.\"}],\"ECDSAInvalidSignatureLength(uint256)\":[{\"details\":\"The signature has an invalid length.\"}],\"ECDSAInvalidSignatureS(bytes32)\":[{\"details\":\"The signature has an S value that is in the upper half order.\"}]},\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\":\"ECDSA\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\":{\"keccak256\":\"0x69f54c02b7d81d505910ec198c11ed4c6a728418a868b906b4a0cf29946fda84\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://8e25e4bdb7ae1f21d23bfee996e22736fc0ab44cfabedac82a757b1edc5623b9\",\"dweb:/ipfs/QmQdWQvB6JCP9ZMbzi8EvQ1PTETqkcTWrbcVurS7DKpa5n\"]}},\"version\":1}" + } + }, + "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol": { + "MessageHashUtils": { + "abi": [], + "evm": { + "bytecode": { + "functionDebugData": {}, + "generatedSources": [], + "linkReferences": {}, + "object": "60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220739fcbc5433e639277fd7c7dac5e18e07f939d67d86fd83eaafc76605e2ea54e64736f6c634300081b0033", + "opcodes": "PUSH1 0x56 PUSH1 0x37 PUSH1 0xB DUP3 DUP3 DUP3 CODECOPY DUP1 MLOAD PUSH1 0x0 BYTE PUSH1 0x73 EQ PUSH1 0x2A JUMPI PUSH4 0x4E487B71 PUSH1 0xE0 SHL PUSH1 0x0 MSTORE PUSH1 0x0 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST ADDRESS PUSH1 0x0 MSTORE PUSH1 0x73 DUP2 MSTORE8 DUP3 DUP2 RETURN INVALID PUSH20 0x0 ADDRESS EQ PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 PUSH20 0x9FCBC5433E639277FD7C7DAC5E18E07F939D67D8 PUSH16 0xD83EAAFC76605E2EA54E64736F6C6343 STOP ADDMOD SHL STOP CALLER ", + "sourceMap": "521:3729:51:-:0;;;;;;;;;;;;;;;-1:-1:-1;;;521:3729:51;;;;;;;;;;;;;;;;;" + }, + "deployedBytecode": { + "functionDebugData": {}, + "generatedSources": [], + "immutableReferences": {}, + "linkReferences": {}, + "object": "73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220739fcbc5433e639277fd7c7dac5e18e07f939d67d86fd83eaafc76605e2ea54e64736f6c634300081b0033", + "opcodes": "PUSH20 0x0 ADDRESS EQ PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 PUSH20 0x9FCBC5433E639277FD7C7DAC5E18E07F939D67D8 PUSH16 0xD83EAAFC76605E2EA54E64736F6C6343 STOP ADDMOD SHL STOP CALLER ", + "sourceMap": "521:3729:51:-:0;;;;;;;;" + }, + "methodIdentifiers": {} + }, + "metadata": "{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"details\":\"Signature message hash utilities for producing digests to be consumed by {ECDSA} recovery or signing. The library provides methods for generating a hash of a message that conforms to the https://eips.ethereum.org/EIPS/eip-191[ERC-191] and https://eips.ethereum.org/EIPS/eip-712[EIP 712] specifications.\",\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol\":\"MessageHashUtils\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/utils/Panic.sol\":{\"keccak256\":\"0xf7fe324703a64fc51702311dc51562d5cb1497734f074e4f483bfb6717572d7a\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://c6a5ff4f9fd8649b7ee20800b7fa387d3465bd77cf20c2d1068cd5c98e1ed57a\",\"dweb:/ipfs/QmVSaVJf9FXFhdYEYeCEfjMVHrxDh5qL4CGkxdMWpQCrqG\"]},\"@openzeppelin/contracts/utils/Strings.sol\":{\"keccak256\":\"0x81c274a60a7ae232ae3dc9ff3a4011b4849a853c13b0832cd3351bb1bb2f0dae\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://9da0c20dc74358a2a76330818f3bac9d1e2ce3371aec847b9cbf5d147fbae4f6\",\"dweb:/ipfs/QmeczhmnFv1hbXKGLwbYXY6Rrytc9a5A2YaRi5QMMgjPnb\"]},\"@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol\":{\"keccak256\":\"0x26670fef37d4adf55570ba78815eec5f31cb017e708f61886add4fc4da665631\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://b16d45febff462bafd8a5669f904796a835baf607df58a8461916d3bf4f08c59\",\"dweb:/ipfs/QmU2eJFpjmT4vxeJWJyLeQb8Xht1kdB8Y6MKLDPFA9WPux\"]},\"@openzeppelin/contracts/utils/math/Math.sol\":{\"keccak256\":\"0x1225214420c83ebcca88f2ae2b50f053aaa7df7bd684c3e878d334627f2edfc6\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://6c5fab4970634f9ab9a620983dc1c8a30153981a0b1a521666e269d0a11399d3\",\"dweb:/ipfs/QmVRnBC575MESGkEHndjujtR7qub2FzU9RWy9eKLp4hPZB\"]},\"@openzeppelin/contracts/utils/math/SafeCast.sol\":{\"keccak256\":\"0x195533c86d0ef72bcc06456a4f66a9b941f38eb403739b00f21fd7c1abd1ae54\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://b1d578337048cad08c1c03041cca5978eff5428aa130c781b271ad9e5566e1f8\",\"dweb:/ipfs/QmPFKL2r9CBsMwmUqqdcFPfHZB2qcs9g1HDrPxzWSxomvy\"]},\"@openzeppelin/contracts/utils/math/SignedMath.sol\":{\"keccak256\":\"0xb1970fac7b64e6c09611e6691791e848d5e3fe410fa5899e7df2e0afd77a99e3\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://db5fbb3dddd8b7047465b62575d96231ba8a2774d37fb4737fbf23340fabbb03\",\"dweb:/ipfs/QmVUSvooZKEdEdap619tcJjTLcAuH6QBdZqAzWwnAXZAWJ\"]}},\"version\":1}" + } + }, + "@openzeppelin/contracts/utils/math/Math.sol": { + "Math": { + "abi": [], + "evm": { + "bytecode": { + "functionDebugData": {}, + "generatedSources": [], + "linkReferences": {}, + "object": "60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea26469706673582212206d087252d20c33a6b84716edfdc60d52df72243223a4a6e0fb868c95d9ba9d6064736f6c634300081b0033", + "opcodes": "PUSH1 0x56 PUSH1 0x37 PUSH1 0xB DUP3 DUP3 DUP3 CODECOPY DUP1 MLOAD PUSH1 0x0 BYTE PUSH1 0x73 EQ PUSH1 0x2A JUMPI PUSH4 0x4E487B71 PUSH1 0xE0 SHL PUSH1 0x0 MSTORE PUSH1 0x0 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST ADDRESS PUSH1 0x0 MSTORE PUSH1 0x73 DUP2 MSTORE8 DUP3 DUP2 RETURN INVALID PUSH20 0x0 ADDRESS EQ PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 PUSH14 0x87252D20C33A6B84716EDFDC60D MSTORE 0xDF PUSH19 0x243223A4A6E0FB868C95D9BA9D6064736F6C63 NUMBER STOP ADDMOD SHL STOP CALLER ", + "sourceMap": "281:31863:52:-:0;;;;;;;;;;;;;;;-1:-1:-1;;;281:31863:52;;;;;;;;;;;;;;;;;" + }, + "deployedBytecode": { + "functionDebugData": {}, + "generatedSources": [], + "immutableReferences": {}, + "linkReferences": {}, + "object": "73000000000000000000000000000000000000000030146080604052600080fdfea26469706673582212206d087252d20c33a6b84716edfdc60d52df72243223a4a6e0fb868c95d9ba9d6064736f6c634300081b0033", + "opcodes": "PUSH20 0x0 ADDRESS EQ PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 PUSH14 0x87252D20C33A6B84716EDFDC60D MSTORE 0xDF PUSH19 0x243223A4A6E0FB868C95D9BA9D6064736F6C63 NUMBER STOP ADDMOD SHL STOP CALLER ", + "sourceMap": "281:31863:52:-:0;;;;;;;;" + }, + "methodIdentifiers": {} + }, + "metadata": "{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"details\":\"Standard math utilities missing in the Solidity language.\",\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@openzeppelin/contracts/utils/math/Math.sol\":\"Math\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/utils/Panic.sol\":{\"keccak256\":\"0xf7fe324703a64fc51702311dc51562d5cb1497734f074e4f483bfb6717572d7a\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://c6a5ff4f9fd8649b7ee20800b7fa387d3465bd77cf20c2d1068cd5c98e1ed57a\",\"dweb:/ipfs/QmVSaVJf9FXFhdYEYeCEfjMVHrxDh5qL4CGkxdMWpQCrqG\"]},\"@openzeppelin/contracts/utils/math/Math.sol\":{\"keccak256\":\"0x1225214420c83ebcca88f2ae2b50f053aaa7df7bd684c3e878d334627f2edfc6\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://6c5fab4970634f9ab9a620983dc1c8a30153981a0b1a521666e269d0a11399d3\",\"dweb:/ipfs/QmVRnBC575MESGkEHndjujtR7qub2FzU9RWy9eKLp4hPZB\"]},\"@openzeppelin/contracts/utils/math/SafeCast.sol\":{\"keccak256\":\"0x195533c86d0ef72bcc06456a4f66a9b941f38eb403739b00f21fd7c1abd1ae54\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://b1d578337048cad08c1c03041cca5978eff5428aa130c781b271ad9e5566e1f8\",\"dweb:/ipfs/QmPFKL2r9CBsMwmUqqdcFPfHZB2qcs9g1HDrPxzWSxomvy\"]}},\"version\":1}" + } + }, + "@openzeppelin/contracts/utils/math/SafeCast.sol": { + "SafeCast": { + "abi": [ + { + "inputs": [ + { + "internalType": "uint8", + "name": "bits", + "type": "uint8" + }, + { + "internalType": "int256", + "name": "value", + "type": "int256" + } + ], + "name": "SafeCastOverflowedIntDowncast", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "int256", + "name": "value", + "type": "int256" + } + ], + "name": "SafeCastOverflowedIntToUint", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint8", + "name": "bits", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "SafeCastOverflowedUintDowncast", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "SafeCastOverflowedUintToInt", + "type": "error" + } + ], + "evm": { + "bytecode": { + "functionDebugData": {}, + "generatedSources": [], + "linkReferences": {}, + "object": "60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea26469706673582212201f9483f55fcb74a866273ce15b4f1b8be6a52b82c427c107bd5d98b6eb7b5b9664736f6c634300081b0033", + "opcodes": "PUSH1 0x56 PUSH1 0x37 PUSH1 0xB DUP3 DUP3 DUP3 CODECOPY DUP1 MLOAD PUSH1 0x0 BYTE PUSH1 0x73 EQ PUSH1 0x2A JUMPI PUSH4 0x4E487B71 PUSH1 0xE0 SHL PUSH1 0x0 MSTORE PUSH1 0x0 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST ADDRESS PUSH1 0x0 MSTORE PUSH1 0x73 DUP2 MSTORE8 DUP3 DUP2 RETURN INVALID PUSH20 0x0 ADDRESS EQ PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0x1F SWAP5 DUP4 CREATE2 PUSH0 0xCB PUSH21 0xA866273CE15B4F1B8BE6A52B82C427C107BD5D98B6 0xEB PUSH28 0x5B9664736F6C634300081B0033000000000000000000000000000000 ", + "sourceMap": "769:34173:53:-:0;;;;;;;;;;;;;;;-1:-1:-1;;;769:34173:53;;;;;;;;;;;;;;;;;" + }, + "deployedBytecode": { + "functionDebugData": {}, + "generatedSources": [], + "immutableReferences": {}, + "linkReferences": {}, + "object": "73000000000000000000000000000000000000000030146080604052600080fdfea26469706673582212201f9483f55fcb74a866273ce15b4f1b8be6a52b82c427c107bd5d98b6eb7b5b9664736f6c634300081b0033", + "opcodes": "PUSH20 0x0 ADDRESS EQ PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0x1F SWAP5 DUP4 CREATE2 PUSH0 0xCB PUSH21 0xA866273CE15B4F1B8BE6A52B82C427C107BD5D98B6 0xEB PUSH28 0x5B9664736F6C634300081B0033000000000000000000000000000000 ", + "sourceMap": "769:34173:53:-:0;;;;;;;;" + }, + "methodIdentifiers": {} + }, + "metadata": "{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"bits\",\"type\":\"uint8\"},{\"internalType\":\"int256\",\"name\":\"value\",\"type\":\"int256\"}],\"name\":\"SafeCastOverflowedIntDowncast\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"int256\",\"name\":\"value\",\"type\":\"int256\"}],\"name\":\"SafeCastOverflowedIntToUint\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"bits\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"SafeCastOverflowedUintDowncast\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"SafeCastOverflowedUintToInt\",\"type\":\"error\"}],\"devdoc\":{\"details\":\"Wrappers over Solidity's uintXX/intXX/bool casting operators with added overflow checks. Downcasting from uint256/int256 in Solidity does not revert on overflow. This can easily result in undesired exploitation or bugs, since developers usually assume that overflows raise errors. `SafeCast` restores this intuition by reverting the transaction when such an operation overflows. Using this library instead of the unchecked operations eliminates an entire class of bugs, so it's recommended to use it always.\",\"errors\":{\"SafeCastOverflowedIntDowncast(uint8,int256)\":[{\"details\":\"Value doesn't fit in an int of `bits` size.\"}],\"SafeCastOverflowedIntToUint(int256)\":[{\"details\":\"An int value doesn't fit in an uint of `bits` size.\"}],\"SafeCastOverflowedUintDowncast(uint8,uint256)\":[{\"details\":\"Value doesn't fit in an uint of `bits` size.\"}],\"SafeCastOverflowedUintToInt(uint256)\":[{\"details\":\"An uint value doesn't fit in an int of `bits` size.\"}]},\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@openzeppelin/contracts/utils/math/SafeCast.sol\":\"SafeCast\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/utils/math/SafeCast.sol\":{\"keccak256\":\"0x195533c86d0ef72bcc06456a4f66a9b941f38eb403739b00f21fd7c1abd1ae54\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://b1d578337048cad08c1c03041cca5978eff5428aa130c781b271ad9e5566e1f8\",\"dweb:/ipfs/QmPFKL2r9CBsMwmUqqdcFPfHZB2qcs9g1HDrPxzWSxomvy\"]}},\"version\":1}" + } + }, + "@openzeppelin/contracts/utils/math/SignedMath.sol": { + "SignedMath": { + "abi": [], + "evm": { + "bytecode": { + "functionDebugData": {}, + "generatedSources": [], + "linkReferences": {}, + "object": "60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea26469706673582212203f8ce045c06cb3d784cb291e8c3a0485d015860bc9a53fb4b262bab7802a0bc264736f6c634300081b0033", + "opcodes": "PUSH1 0x56 PUSH1 0x37 PUSH1 0xB DUP3 DUP3 DUP3 CODECOPY DUP1 MLOAD PUSH1 0x0 BYTE PUSH1 0x73 EQ PUSH1 0x2A JUMPI PUSH4 0x4E487B71 PUSH1 0xE0 SHL PUSH1 0x0 MSTORE PUSH1 0x0 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST ADDRESS PUSH1 0x0 MSTORE PUSH1 0x73 DUP2 MSTORE8 DUP3 DUP2 RETURN INVALID PUSH20 0x0 ADDRESS EQ PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 EXTCODEHASH DUP13 0xE0 GASLIMIT 0xC0 PUSH13 0xB3D784CB291E8C3A0485D01586 SIGNEXTEND 0xC9 0xA5 EXTCODEHASH 0xB4 0xB2 PUSH3 0xBAB780 0x2A SIGNEXTEND 0xC2 PUSH5 0x736F6C6343 STOP ADDMOD SHL STOP CALLER ", + "sourceMap": "258:2354:54:-:0;;;;;;;;;;;;;;;-1:-1:-1;;;258:2354:54;;;;;;;;;;;;;;;;;" + }, + "deployedBytecode": { + "functionDebugData": {}, + "generatedSources": [], + "immutableReferences": {}, + "linkReferences": {}, + "object": "73000000000000000000000000000000000000000030146080604052600080fdfea26469706673582212203f8ce045c06cb3d784cb291e8c3a0485d015860bc9a53fb4b262bab7802a0bc264736f6c634300081b0033", + "opcodes": "PUSH20 0x0 ADDRESS EQ PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 EXTCODEHASH DUP13 0xE0 GASLIMIT 0xC0 PUSH13 0xB3D784CB291E8C3A0485D01586 SIGNEXTEND 0xC9 0xA5 EXTCODEHASH 0xB4 0xB2 PUSH3 0xBAB780 0x2A SIGNEXTEND 0xC2 PUSH5 0x736F6C6343 STOP ADDMOD SHL STOP CALLER ", + "sourceMap": "258:2354:54:-:0;;;;;;;;" + }, + "methodIdentifiers": {} + }, + "metadata": "{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"details\":\"Standard signed math utilities missing in the Solidity language.\",\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@openzeppelin/contracts/utils/math/SignedMath.sol\":\"SignedMath\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/utils/math/SafeCast.sol\":{\"keccak256\":\"0x195533c86d0ef72bcc06456a4f66a9b941f38eb403739b00f21fd7c1abd1ae54\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://b1d578337048cad08c1c03041cca5978eff5428aa130c781b271ad9e5566e1f8\",\"dweb:/ipfs/QmPFKL2r9CBsMwmUqqdcFPfHZB2qcs9g1HDrPxzWSxomvy\"]},\"@openzeppelin/contracts/utils/math/SignedMath.sol\":{\"keccak256\":\"0xb1970fac7b64e6c09611e6691791e848d5e3fe410fa5899e7df2e0afd77a99e3\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://db5fbb3dddd8b7047465b62575d96231ba8a2774d37fb4737fbf23340fabbb03\",\"dweb:/ipfs/QmVUSvooZKEdEdap619tcJjTLcAuH6QBdZqAzWwnAXZAWJ\"]}},\"version\":1}" + } + }, + "contracts/DisputeManager.sol": { + "DisputeManager": { + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "controller", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "length", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "expectedLength", + "type": "uint256" + } + ], + "name": "AttestationInvalidBytesLength", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + } + ], + "name": "DisputeManagerDisputeAlreadyCreated", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + } + ], + "name": "DisputeManagerDisputeInConflict", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + } + ], + "name": "DisputeManagerDisputeNotInConflict", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "enum IDisputeManager.DisputeStatus", + "name": "status", + "type": "uint8" + } + ], + "name": "DisputeManagerDisputeNotPending", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeManagerDisputePeriodNotFinished", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeManagerDisputePeriodZero", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "DisputeManagerIndexerNotFound", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + } + ], + "name": "DisputeManagerInvalidDispute", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "disputeDeposit", + "type": "uint256" + } + ], + "name": "DisputeManagerInvalidDisputeDeposit", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "cut", + "type": "uint32" + } + ], + "name": "DisputeManagerInvalidFishermanReward", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "maxSlashingCut", + "type": "uint32" + } + ], + "name": "DisputeManagerInvalidMaxSlashingCut", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokensSlash", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxTokensSlash", + "type": "uint256" + } + ], + "name": "DisputeManagerInvalidTokensSlash", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeManagerInvalidZeroAddress", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "relatedDisputeId", + "type": "bytes32" + } + ], + "name": "DisputeManagerMustAcceptRelatedDispute", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "requestCID1", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "responseCID1", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "subgraphDeploymentId1", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "requestCID2", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "responseCID2", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "subgraphDeploymentId2", + "type": "bytes32" + } + ], + "name": "DisputeManagerNonConflictingAttestations", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "subgraphDeploymentId1", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "subgraphDeploymentId2", + "type": "bytes32" + } + ], + "name": "DisputeManagerNonMatchingSubgraphDeployment", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeManagerNotArbitrator", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeManagerNotFisherman", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeManagerSubgraphServiceNotSet", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeManagerZeroTokens", + "type": "error" + }, + { + "inputs": [], + "name": "ECDSAInvalidSignature", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "length", + "type": "uint256" + } + ], + "name": "ECDSAInvalidSignatureLength", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "ECDSAInvalidSignatureS", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "contractName", + "type": "bytes" + } + ], + "name": "GraphDirectoryInvalidZeroAddress", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidInitialization", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "OwnableInvalidOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "OwnableUnauthorizedAccount", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "a", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "b", + "type": "uint256" + } + ], + "name": "PPMMathInvalidMulPPM", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "arbitrator", + "type": "address" + } + ], + "name": "ArbitratorSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "fisherman", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "DisputeAccepted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "fisherman", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "DisputeCancelled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "disputeDeposit", + "type": "uint256" + } + ], + "name": "DisputeDepositSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "fisherman", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "DisputeDrawn", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "disputeId1", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "disputeId2", + "type": "bytes32" + } + ], + "name": "DisputeLinked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "disputePeriod", + "type": "uint64" + } + ], + "name": "DisputePeriodSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "fisherman", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "DisputeRejected", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "fishermanRewardCut", + "type": "uint32" + } + ], + "name": "FishermanRewardCutSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "graphToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "graphStaking", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphPayments", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphEscrow", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "graphController", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphEpochManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphRewardsManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphTokenGateway", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphProxyAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphCuration", + "type": "address" + } + ], + "name": "GraphDirectoryInitialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "fisherman", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "poi", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "stakeSnapshot", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "cancellableAt", + "type": "uint256" + } + ], + "name": "IndexingDisputeCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "fisherman", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensSlash", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensRewards", + "type": "uint256" + } + ], + "name": "LegacyDisputeCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "maxSlashingCut", + "type": "uint32" + } + ], + "name": "MaxSlashingCutSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "fisherman", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "attestation", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "stakeSnapshot", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "cancellableAt", + "type": "uint256" + } + ], + "name": "QueryDisputeCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "subgraphService", + "type": "address" + } + ], + "name": "SubgraphServiceSet", + "type": "event" + }, + { + "inputs": [], + "name": "MAX_FISHERMAN_REWARD_CUT", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MIN_DISPUTE_DEPOSIT", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "tokensSlash", + "type": "uint256" + } + ], + "name": "acceptDispute", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "tokensSlash", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "acceptDisputeInConflict", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "tokensSlashRelated", + "type": "uint256" + } + ], + "name": "acceptDisputeConflict", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "arbitrator", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "requestCID", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "responseCID", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + } + ], + "internalType": "struct Attestation.State", + "name": "attestation1", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "bytes32", + "name": "requestCID", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "responseCID", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + } + ], + "internalType": "struct Attestation.State", + "name": "attestation2", + "type": "tuple" + } + ], + "name": "areConflictingAttestations", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + } + ], + "name": "cancelDispute", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "internalType": "address", + "name": "fisherman", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokensSlash", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokensRewards", + "type": "uint256" + } + ], + "name": "createAndAcceptLegacyDispute", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "poi", + "type": "bytes32" + } + ], + "name": "createIndexingDispute", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "attestationData", + "type": "bytes" + } + ], + "name": "createQueryDispute", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "attestationData1", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "attestationData2", + "type": "bytes" + } + ], + "name": "createQueryDisputeConflict", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "disputeDeposit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "disputePeriod", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + } + ], + "name": "disputes", + "outputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "address", + "name": "fisherman", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deposit", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "relatedDisputeId", + "type": "bytes32" + }, + { + "internalType": "enum IDisputeManager.DisputeType", + "name": "disputeType", + "type": "uint8" + }, + { + "internalType": "enum IDisputeManager.DisputeStatus", + "name": "status", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "createdAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "cancellableAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "stakeSnapshot", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + } + ], + "name": "drawDispute", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "requestCID", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "responseCID", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + } + ], + "internalType": "struct Attestation.Receipt", + "name": "receipt", + "type": "tuple" + } + ], + "name": "encodeReceipt", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "fishermanRewardCut", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "requestCID", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "responseCID", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + } + ], + "internalType": "struct Attestation.State", + "name": "attestation", + "type": "tuple" + } + ], + "name": "getAttestationIndexer", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getDisputePeriod", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getFishermanRewardCut", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + } + ], + "name": "getStakeSnapshot", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "arbitrator_", + "type": "address" + }, + { + "internalType": "uint64", + "name": "disputePeriod_", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "disputeDeposit_", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "fishermanRewardCut_", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "maxSlashingCut_", + "type": "uint32" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + } + ], + "name": "isDisputeCreated", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maxSlashingCut", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + } + ], + "name": "rejectDispute", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "arbitrator", + "type": "address" + } + ], + "name": "setArbitrator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "disputeDeposit", + "type": "uint256" + } + ], + "name": "setDisputeDeposit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "disputePeriod", + "type": "uint64" + } + ], + "name": "setDisputePeriod", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "fishermanRewardCut_", + "type": "uint32" + } + ], + "name": "setFishermanRewardCut", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "maxSlashingCut_", + "type": "uint32" + } + ], + "name": "setMaxSlashingCut", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "subgraphService_", + "type": "address" + } + ], + "name": "setSubgraphService", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "subgraphService", + "outputs": [ + { + "internalType": "contract ISubgraphService", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "evm": { + "bytecode": { + "functionDebugData": { + "@_11993": { + "entryPoint": null, + "id": 11993, + "parameterSlots": 1, + "returnSlots": 0 + }, + "@_4795": { + "entryPoint": null, + "id": 4795, + "parameterSlots": 1, + "returnSlots": 0 + }, + "@_disableInitializers_5345": { + "entryPoint": 1001, + "id": 5345, + "parameterSlots": 0, + "returnSlots": 0 + }, + "@_getContractFromController_4927": { + "entryPoint": 827, + "id": 4927, + "parameterSlots": 1, + "returnSlots": 1 + }, + "@_getInitializableStorage_5390": { + "entryPoint": null, + "id": 5390, + "parameterSlots": 0, + "returnSlots": 1 + }, + "@_initializableStorageSlot_5376": { + "entryPoint": null, + "id": 5376, + "parameterSlots": 0, + "returnSlots": 1 + }, + "abi_decode_tuple_t_address_fromMemory": { + "entryPoint": 1179, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "abi_encode_tuple_t_address_t_address_t_address_t_address_t_address_t_address_t_address__to_t_address_t_address_t_address_t_address_t_address_t_address_t_address__fromStack_reversed": { + "entryPoint": null, + "id": null, + "parameterSlots": 8, + "returnSlots": 1 + }, + "abi_encode_tuple_t_bytes32__to_t_bytes32__fromStack_reversed": { + "entryPoint": null, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "abi_encode_tuple_t_bytes_memory_ptr__to_t_bytes_memory_ptr__fromStack_reversed": { + "entryPoint": 1227, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "abi_encode_tuple_t_stringliteral_7c20e2bbcd91c5aaa7898ba022ab8867ac32d84e959c236484db066900aa363a__to_t_bytes_memory_ptr__fromStack_reversed": { + "entryPoint": null, + "id": null, + "parameterSlots": 1, + "returnSlots": 1 + }, + "abi_encode_tuple_t_uint64__to_t_uint64__fromStack_reversed": { + "entryPoint": null, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + } + }, + "generatedSources": [ + { + "ast": { + "nativeSrc": "0:2355:70", + "nodeType": "YulBlock", + "src": "0:2355:70", + "statements": [ + { + "nativeSrc": "6:3:70", + "nodeType": "YulBlock", + "src": "6:3:70", + "statements": [] + }, + { + "body": { + "nativeSrc": "95:209:70", + "nodeType": "YulBlock", + "src": "95:209:70", + "statements": [ + { + "body": { + "nativeSrc": "141:16:70", + "nodeType": "YulBlock", + "src": "141:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "150:1:70", + "nodeType": "YulLiteral", + "src": "150:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "153:1:70", + "nodeType": "YulLiteral", + "src": "153:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "143:6:70", + "nodeType": "YulIdentifier", + "src": "143:6:70" + }, + "nativeSrc": "143:12:70", + "nodeType": "YulFunctionCall", + "src": "143:12:70" + }, + "nativeSrc": "143:12:70", + "nodeType": "YulExpressionStatement", + "src": "143:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "dataEnd", + "nativeSrc": "116:7:70", + "nodeType": "YulIdentifier", + "src": "116:7:70" + }, + { + "name": "headStart", + "nativeSrc": "125:9:70", + "nodeType": "YulIdentifier", + "src": "125:9:70" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "112:3:70", + "nodeType": "YulIdentifier", + "src": "112:3:70" + }, + "nativeSrc": "112:23:70", + "nodeType": "YulFunctionCall", + "src": "112:23:70" + }, + { + "kind": "number", + "nativeSrc": "137:2:70", + "nodeType": "YulLiteral", + "src": "137:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "slt", + "nativeSrc": "108:3:70", + "nodeType": "YulIdentifier", + "src": "108:3:70" + }, + "nativeSrc": "108:32:70", + "nodeType": "YulFunctionCall", + "src": "108:32:70" + }, + "nativeSrc": "105:52:70", + "nodeType": "YulIf", + "src": "105:52:70" + }, + { + "nativeSrc": "166:29:70", + "nodeType": "YulVariableDeclaration", + "src": "166:29:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "185:9:70", + "nodeType": "YulIdentifier", + "src": "185:9:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "179:5:70", + "nodeType": "YulIdentifier", + "src": "179:5:70" + }, + "nativeSrc": "179:16:70", + "nodeType": "YulFunctionCall", + "src": "179:16:70" + }, + "variables": [ + { + "name": "value", + "nativeSrc": "170:5:70", + "nodeType": "YulTypedName", + "src": "170:5:70", + "type": "" + } + ] + }, + { + "body": { + "nativeSrc": "258:16:70", + "nodeType": "YulBlock", + "src": "258:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "267:1:70", + "nodeType": "YulLiteral", + "src": "267:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "270:1:70", + "nodeType": "YulLiteral", + "src": "270:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "260:6:70", + "nodeType": "YulIdentifier", + "src": "260:6:70" + }, + "nativeSrc": "260:12:70", + "nodeType": "YulFunctionCall", + "src": "260:12:70" + }, + "nativeSrc": "260:12:70", + "nodeType": "YulExpressionStatement", + "src": "260:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "value", + "nativeSrc": "217:5:70", + "nodeType": "YulIdentifier", + "src": "217:5:70" + }, + { + "arguments": [ + { + "name": "value", + "nativeSrc": "228:5:70", + "nodeType": "YulIdentifier", + "src": "228:5:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "243:3:70", + "nodeType": "YulLiteral", + "src": "243:3:70", + "type": "", + "value": "160" + }, + { + "kind": "number", + "nativeSrc": "248:1:70", + "nodeType": "YulLiteral", + "src": "248:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "239:3:70", + "nodeType": "YulIdentifier", + "src": "239:3:70" + }, + "nativeSrc": "239:11:70", + "nodeType": "YulFunctionCall", + "src": "239:11:70" + }, + { + "kind": "number", + "nativeSrc": "252:1:70", + "nodeType": "YulLiteral", + "src": "252:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "235:3:70", + "nodeType": "YulIdentifier", + "src": "235:3:70" + }, + "nativeSrc": "235:19:70", + "nodeType": "YulFunctionCall", + "src": "235:19:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "224:3:70", + "nodeType": "YulIdentifier", + "src": "224:3:70" + }, + "nativeSrc": "224:31:70", + "nodeType": "YulFunctionCall", + "src": "224:31:70" + } + ], + "functionName": { + "name": "eq", + "nativeSrc": "214:2:70", + "nodeType": "YulIdentifier", + "src": "214:2:70" + }, + "nativeSrc": "214:42:70", + "nodeType": "YulFunctionCall", + "src": "214:42:70" + } + ], + "functionName": { + "name": "iszero", + "nativeSrc": "207:6:70", + "nodeType": "YulIdentifier", + "src": "207:6:70" + }, + "nativeSrc": "207:50:70", + "nodeType": "YulFunctionCall", + "src": "207:50:70" + }, + "nativeSrc": "204:70:70", + "nodeType": "YulIf", + "src": "204:70:70" + }, + { + "nativeSrc": "283:15:70", + "nodeType": "YulAssignment", + "src": "283:15:70", + "value": { + "name": "value", + "nativeSrc": "293:5:70", + "nodeType": "YulIdentifier", + "src": "293:5:70" + }, + "variableNames": [ + { + "name": "value0", + "nativeSrc": "283:6:70", + "nodeType": "YulIdentifier", + "src": "283:6:70" + } + ] + } + ] + }, + "name": "abi_decode_tuple_t_address_fromMemory", + "nativeSrc": "14:290:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "61:9:70", + "nodeType": "YulTypedName", + "src": "61:9:70", + "type": "" + }, + { + "name": "dataEnd", + "nativeSrc": "72:7:70", + "nodeType": "YulTypedName", + "src": "72:7:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value0", + "nativeSrc": "84:6:70", + "nodeType": "YulTypedName", + "src": "84:6:70", + "type": "" + } + ], + "src": "14:290:70" + }, + { + "body": { + "nativeSrc": "482:160:70", + "nodeType": "YulBlock", + "src": "482:160:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "499:9:70", + "nodeType": "YulIdentifier", + "src": "499:9:70" + }, + { + "kind": "number", + "nativeSrc": "510:2:70", + "nodeType": "YulLiteral", + "src": "510:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "492:6:70", + "nodeType": "YulIdentifier", + "src": "492:6:70" + }, + "nativeSrc": "492:21:70", + "nodeType": "YulFunctionCall", + "src": "492:21:70" + }, + "nativeSrc": "492:21:70", + "nodeType": "YulExpressionStatement", + "src": "492:21:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "533:9:70", + "nodeType": "YulIdentifier", + "src": "533:9:70" + }, + { + "kind": "number", + "nativeSrc": "544:2:70", + "nodeType": "YulLiteral", + "src": "544:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "529:3:70", + "nodeType": "YulIdentifier", + "src": "529:3:70" + }, + "nativeSrc": "529:18:70", + "nodeType": "YulFunctionCall", + "src": "529:18:70" + }, + { + "kind": "number", + "nativeSrc": "549:2:70", + "nodeType": "YulLiteral", + "src": "549:2:70", + "type": "", + "value": "10" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "522:6:70", + "nodeType": "YulIdentifier", + "src": "522:6:70" + }, + "nativeSrc": "522:30:70", + "nodeType": "YulFunctionCall", + "src": "522:30:70" + }, + "nativeSrc": "522:30:70", + "nodeType": "YulExpressionStatement", + "src": "522:30:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "572:9:70", + "nodeType": "YulIdentifier", + "src": "572:9:70" + }, + { + "kind": "number", + "nativeSrc": "583:2:70", + "nodeType": "YulLiteral", + "src": "583:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "568:3:70", + "nodeType": "YulIdentifier", + "src": "568:3:70" + }, + "nativeSrc": "568:18:70", + "nodeType": "YulFunctionCall", + "src": "568:18:70" + }, + { + "hexValue": "436f6e74726f6c6c6572", + "kind": "string", + "nativeSrc": "588:12:70", + "nodeType": "YulLiteral", + "src": "588:12:70", + "type": "", + "value": "Controller" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "561:6:70", + "nodeType": "YulIdentifier", + "src": "561:6:70" + }, + "nativeSrc": "561:40:70", + "nodeType": "YulFunctionCall", + "src": "561:40:70" + }, + "nativeSrc": "561:40:70", + "nodeType": "YulExpressionStatement", + "src": "561:40:70" + }, + { + "nativeSrc": "610:26:70", + "nodeType": "YulAssignment", + "src": "610:26:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "622:9:70", + "nodeType": "YulIdentifier", + "src": "622:9:70" + }, + { + "kind": "number", + "nativeSrc": "633:2:70", + "nodeType": "YulLiteral", + "src": "633:2:70", + "type": "", + "value": "96" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "618:3:70", + "nodeType": "YulIdentifier", + "src": "618:3:70" + }, + "nativeSrc": "618:18:70", + "nodeType": "YulFunctionCall", + "src": "618:18:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "610:4:70", + "nodeType": "YulIdentifier", + "src": "610:4:70" + } + ] + } + ] + }, + "name": "abi_encode_tuple_t_stringliteral_7c20e2bbcd91c5aaa7898ba022ab8867ac32d84e959c236484db066900aa363a__to_t_bytes_memory_ptr__fromStack_reversed", + "nativeSrc": "309:333:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "459:9:70", + "nodeType": "YulTypedName", + "src": "459:9:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "473:4:70", + "nodeType": "YulTypedName", + "src": "473:4:70", + "type": "" + } + ], + "src": "309:333:70" + }, + { + "body": { + "nativeSrc": "916:520:70", + "nodeType": "YulBlock", + "src": "916:520:70", + "statements": [ + { + "nativeSrc": "926:27:70", + "nodeType": "YulAssignment", + "src": "926:27:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "938:9:70", + "nodeType": "YulIdentifier", + "src": "938:9:70" + }, + { + "kind": "number", + "nativeSrc": "949:3:70", + "nodeType": "YulLiteral", + "src": "949:3:70", + "type": "", + "value": "224" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "934:3:70", + "nodeType": "YulIdentifier", + "src": "934:3:70" + }, + "nativeSrc": "934:19:70", + "nodeType": "YulFunctionCall", + "src": "934:19:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "926:4:70", + "nodeType": "YulIdentifier", + "src": "926:4:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "969:9:70", + "nodeType": "YulIdentifier", + "src": "969:9:70" + }, + { + "arguments": [ + { + "name": "value0", + "nativeSrc": "984:6:70", + "nodeType": "YulIdentifier", + "src": "984:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "1000:3:70", + "nodeType": "YulLiteral", + "src": "1000:3:70", + "type": "", + "value": "160" + }, + { + "kind": "number", + "nativeSrc": "1005:1:70", + "nodeType": "YulLiteral", + "src": "1005:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "996:3:70", + "nodeType": "YulIdentifier", + "src": "996:3:70" + }, + "nativeSrc": "996:11:70", + "nodeType": "YulFunctionCall", + "src": "996:11:70" + }, + { + "kind": "number", + "nativeSrc": "1009:1:70", + "nodeType": "YulLiteral", + "src": "1009:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "992:3:70", + "nodeType": "YulIdentifier", + "src": "992:3:70" + }, + "nativeSrc": "992:19:70", + "nodeType": "YulFunctionCall", + "src": "992:19:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "980:3:70", + "nodeType": "YulIdentifier", + "src": "980:3:70" + }, + "nativeSrc": "980:32:70", + "nodeType": "YulFunctionCall", + "src": "980:32:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "962:6:70", + "nodeType": "YulIdentifier", + "src": "962:6:70" + }, + "nativeSrc": "962:51:70", + "nodeType": "YulFunctionCall", + "src": "962:51:70" + }, + "nativeSrc": "962:51:70", + "nodeType": "YulExpressionStatement", + "src": "962:51:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "1033:9:70", + "nodeType": "YulIdentifier", + "src": "1033:9:70" + }, + { + "kind": "number", + "nativeSrc": "1044:2:70", + "nodeType": "YulLiteral", + "src": "1044:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "1029:3:70", + "nodeType": "YulIdentifier", + "src": "1029:3:70" + }, + "nativeSrc": "1029:18:70", + "nodeType": "YulFunctionCall", + "src": "1029:18:70" + }, + { + "arguments": [ + { + "name": "value1", + "nativeSrc": "1053:6:70", + "nodeType": "YulIdentifier", + "src": "1053:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "1069:3:70", + "nodeType": "YulLiteral", + "src": "1069:3:70", + "type": "", + "value": "160" + }, + { + "kind": "number", + "nativeSrc": "1074:1:70", + "nodeType": "YulLiteral", + "src": "1074:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "1065:3:70", + "nodeType": "YulIdentifier", + "src": "1065:3:70" + }, + "nativeSrc": "1065:11:70", + "nodeType": "YulFunctionCall", + "src": "1065:11:70" + }, + { + "kind": "number", + "nativeSrc": "1078:1:70", + "nodeType": "YulLiteral", + "src": "1078:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "1061:3:70", + "nodeType": "YulIdentifier", + "src": "1061:3:70" + }, + "nativeSrc": "1061:19:70", + "nodeType": "YulFunctionCall", + "src": "1061:19:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "1049:3:70", + "nodeType": "YulIdentifier", + "src": "1049:3:70" + }, + "nativeSrc": "1049:32:70", + "nodeType": "YulFunctionCall", + "src": "1049:32:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "1022:6:70", + "nodeType": "YulIdentifier", + "src": "1022:6:70" + }, + "nativeSrc": "1022:60:70", + "nodeType": "YulFunctionCall", + "src": "1022:60:70" + }, + "nativeSrc": "1022:60:70", + "nodeType": "YulExpressionStatement", + "src": "1022:60:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "1102:9:70", + "nodeType": "YulIdentifier", + "src": "1102:9:70" + }, + { + "kind": "number", + "nativeSrc": "1113:2:70", + "nodeType": "YulLiteral", + "src": "1113:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "1098:3:70", + "nodeType": "YulIdentifier", + "src": "1098:3:70" + }, + "nativeSrc": "1098:18:70", + "nodeType": "YulFunctionCall", + "src": "1098:18:70" + }, + { + "arguments": [ + { + "name": "value2", + "nativeSrc": "1122:6:70", + "nodeType": "YulIdentifier", + "src": "1122:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "1138:3:70", + "nodeType": "YulLiteral", + "src": "1138:3:70", + "type": "", + "value": "160" + }, + { + "kind": "number", + "nativeSrc": "1143:1:70", + "nodeType": "YulLiteral", + "src": "1143:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "1134:3:70", + "nodeType": "YulIdentifier", + "src": "1134:3:70" + }, + "nativeSrc": "1134:11:70", + "nodeType": "YulFunctionCall", + "src": "1134:11:70" + }, + { + "kind": "number", + "nativeSrc": "1147:1:70", + "nodeType": "YulLiteral", + "src": "1147:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "1130:3:70", + "nodeType": "YulIdentifier", + "src": "1130:3:70" + }, + "nativeSrc": "1130:19:70", + "nodeType": "YulFunctionCall", + "src": "1130:19:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "1118:3:70", + "nodeType": "YulIdentifier", + "src": "1118:3:70" + }, + "nativeSrc": "1118:32:70", + "nodeType": "YulFunctionCall", + "src": "1118:32:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "1091:6:70", + "nodeType": "YulIdentifier", + "src": "1091:6:70" + }, + "nativeSrc": "1091:60:70", + "nodeType": "YulFunctionCall", + "src": "1091:60:70" + }, + "nativeSrc": "1091:60:70", + "nodeType": "YulExpressionStatement", + "src": "1091:60:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "1171:9:70", + "nodeType": "YulIdentifier", + "src": "1171:9:70" + }, + { + "kind": "number", + "nativeSrc": "1182:2:70", + "nodeType": "YulLiteral", + "src": "1182:2:70", + "type": "", + "value": "96" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "1167:3:70", + "nodeType": "YulIdentifier", + "src": "1167:3:70" + }, + "nativeSrc": "1167:18:70", + "nodeType": "YulFunctionCall", + "src": "1167:18:70" + }, + { + "arguments": [ + { + "name": "value3", + "nativeSrc": "1191:6:70", + "nodeType": "YulIdentifier", + "src": "1191:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "1207:3:70", + "nodeType": "YulLiteral", + "src": "1207:3:70", + "type": "", + "value": "160" + }, + { + "kind": "number", + "nativeSrc": "1212:1:70", + "nodeType": "YulLiteral", + "src": "1212:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "1203:3:70", + "nodeType": "YulIdentifier", + "src": "1203:3:70" + }, + "nativeSrc": "1203:11:70", + "nodeType": "YulFunctionCall", + "src": "1203:11:70" + }, + { + "kind": "number", + "nativeSrc": "1216:1:70", + "nodeType": "YulLiteral", + "src": "1216:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "1199:3:70", + "nodeType": "YulIdentifier", + "src": "1199:3:70" + }, + "nativeSrc": "1199:19:70", + "nodeType": "YulFunctionCall", + "src": "1199:19:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "1187:3:70", + "nodeType": "YulIdentifier", + "src": "1187:3:70" + }, + "nativeSrc": "1187:32:70", + "nodeType": "YulFunctionCall", + "src": "1187:32:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "1160:6:70", + "nodeType": "YulIdentifier", + "src": "1160:6:70" + }, + "nativeSrc": "1160:60:70", + "nodeType": "YulFunctionCall", + "src": "1160:60:70" + }, + "nativeSrc": "1160:60:70", + "nodeType": "YulExpressionStatement", + "src": "1160:60:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "1240:9:70", + "nodeType": "YulIdentifier", + "src": "1240:9:70" + }, + { + "kind": "number", + "nativeSrc": "1251:3:70", + "nodeType": "YulLiteral", + "src": "1251:3:70", + "type": "", + "value": "128" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "1236:3:70", + "nodeType": "YulIdentifier", + "src": "1236:3:70" + }, + "nativeSrc": "1236:19:70", + "nodeType": "YulFunctionCall", + "src": "1236:19:70" + }, + { + "arguments": [ + { + "name": "value4", + "nativeSrc": "1261:6:70", + "nodeType": "YulIdentifier", + "src": "1261:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "1277:3:70", + "nodeType": "YulLiteral", + "src": "1277:3:70", + "type": "", + "value": "160" + }, + { + "kind": "number", + "nativeSrc": "1282:1:70", + "nodeType": "YulLiteral", + "src": "1282:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "1273:3:70", + "nodeType": "YulIdentifier", + "src": "1273:3:70" + }, + "nativeSrc": "1273:11:70", + "nodeType": "YulFunctionCall", + "src": "1273:11:70" + }, + { + "kind": "number", + "nativeSrc": "1286:1:70", + "nodeType": "YulLiteral", + "src": "1286:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "1269:3:70", + "nodeType": "YulIdentifier", + "src": "1269:3:70" + }, + "nativeSrc": "1269:19:70", + "nodeType": "YulFunctionCall", + "src": "1269:19:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "1257:3:70", + "nodeType": "YulIdentifier", + "src": "1257:3:70" + }, + "nativeSrc": "1257:32:70", + "nodeType": "YulFunctionCall", + "src": "1257:32:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "1229:6:70", + "nodeType": "YulIdentifier", + "src": "1229:6:70" + }, + "nativeSrc": "1229:61:70", + "nodeType": "YulFunctionCall", + "src": "1229:61:70" + }, + "nativeSrc": "1229:61:70", + "nodeType": "YulExpressionStatement", + "src": "1229:61:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "1310:9:70", + "nodeType": "YulIdentifier", + "src": "1310:9:70" + }, + { + "kind": "number", + "nativeSrc": "1321:3:70", + "nodeType": "YulLiteral", + "src": "1321:3:70", + "type": "", + "value": "160" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "1306:3:70", + "nodeType": "YulIdentifier", + "src": "1306:3:70" + }, + "nativeSrc": "1306:19:70", + "nodeType": "YulFunctionCall", + "src": "1306:19:70" + }, + { + "arguments": [ + { + "name": "value5", + "nativeSrc": "1331:6:70", + "nodeType": "YulIdentifier", + "src": "1331:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "1347:3:70", + "nodeType": "YulLiteral", + "src": "1347:3:70", + "type": "", + "value": "160" + }, + { + "kind": "number", + "nativeSrc": "1352:1:70", + "nodeType": "YulLiteral", + "src": "1352:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "1343:3:70", + "nodeType": "YulIdentifier", + "src": "1343:3:70" + }, + "nativeSrc": "1343:11:70", + "nodeType": "YulFunctionCall", + "src": "1343:11:70" + }, + { + "kind": "number", + "nativeSrc": "1356:1:70", + "nodeType": "YulLiteral", + "src": "1356:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "1339:3:70", + "nodeType": "YulIdentifier", + "src": "1339:3:70" + }, + "nativeSrc": "1339:19:70", + "nodeType": "YulFunctionCall", + "src": "1339:19:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "1327:3:70", + "nodeType": "YulIdentifier", + "src": "1327:3:70" + }, + "nativeSrc": "1327:32:70", + "nodeType": "YulFunctionCall", + "src": "1327:32:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "1299:6:70", + "nodeType": "YulIdentifier", + "src": "1299:6:70" + }, + "nativeSrc": "1299:61:70", + "nodeType": "YulFunctionCall", + "src": "1299:61:70" + }, + "nativeSrc": "1299:61:70", + "nodeType": "YulExpressionStatement", + "src": "1299:61:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "1380:9:70", + "nodeType": "YulIdentifier", + "src": "1380:9:70" + }, + { + "kind": "number", + "nativeSrc": "1391:3:70", + "nodeType": "YulLiteral", + "src": "1391:3:70", + "type": "", + "value": "192" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "1376:3:70", + "nodeType": "YulIdentifier", + "src": "1376:3:70" + }, + "nativeSrc": "1376:19:70", + "nodeType": "YulFunctionCall", + "src": "1376:19:70" + }, + { + "arguments": [ + { + "name": "value6", + "nativeSrc": "1401:6:70", + "nodeType": "YulIdentifier", + "src": "1401:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "1417:3:70", + "nodeType": "YulLiteral", + "src": "1417:3:70", + "type": "", + "value": "160" + }, + { + "kind": "number", + "nativeSrc": "1422:1:70", + "nodeType": "YulLiteral", + "src": "1422:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "1413:3:70", + "nodeType": "YulIdentifier", + "src": "1413:3:70" + }, + "nativeSrc": "1413:11:70", + "nodeType": "YulFunctionCall", + "src": "1413:11:70" + }, + { + "kind": "number", + "nativeSrc": "1426:1:70", + "nodeType": "YulLiteral", + "src": "1426:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "1409:3:70", + "nodeType": "YulIdentifier", + "src": "1409:3:70" + }, + "nativeSrc": "1409:19:70", + "nodeType": "YulFunctionCall", + "src": "1409:19:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "1397:3:70", + "nodeType": "YulIdentifier", + "src": "1397:3:70" + }, + "nativeSrc": "1397:32:70", + "nodeType": "YulFunctionCall", + "src": "1397:32:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "1369:6:70", + "nodeType": "YulIdentifier", + "src": "1369:6:70" + }, + "nativeSrc": "1369:61:70", + "nodeType": "YulFunctionCall", + "src": "1369:61:70" + }, + "nativeSrc": "1369:61:70", + "nodeType": "YulExpressionStatement", + "src": "1369:61:70" + } + ] + }, + "name": "abi_encode_tuple_t_address_t_address_t_address_t_address_t_address_t_address_t_address__to_t_address_t_address_t_address_t_address_t_address_t_address_t_address__fromStack_reversed", + "nativeSrc": "647:789:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "837:9:70", + "nodeType": "YulTypedName", + "src": "837:9:70", + "type": "" + }, + { + "name": "value6", + "nativeSrc": "848:6:70", + "nodeType": "YulTypedName", + "src": "848:6:70", + "type": "" + }, + { + "name": "value5", + "nativeSrc": "856:6:70", + "nodeType": "YulTypedName", + "src": "856:6:70", + "type": "" + }, + { + "name": "value4", + "nativeSrc": "864:6:70", + "nodeType": "YulTypedName", + "src": "864:6:70", + "type": "" + }, + { + "name": "value3", + "nativeSrc": "872:6:70", + "nodeType": "YulTypedName", + "src": "872:6:70", + "type": "" + }, + { + "name": "value2", + "nativeSrc": "880:6:70", + "nodeType": "YulTypedName", + "src": "880:6:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "888:6:70", + "nodeType": "YulTypedName", + "src": "888:6:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "896:6:70", + "nodeType": "YulTypedName", + "src": "896:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "907:4:70", + "nodeType": "YulTypedName", + "src": "907:4:70", + "type": "" + } + ], + "src": "647:789:70" + }, + { + "body": { + "nativeSrc": "1542:76:70", + "nodeType": "YulBlock", + "src": "1542:76:70", + "statements": [ + { + "nativeSrc": "1552:26:70", + "nodeType": "YulAssignment", + "src": "1552:26:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "1564:9:70", + "nodeType": "YulIdentifier", + "src": "1564:9:70" + }, + { + "kind": "number", + "nativeSrc": "1575:2:70", + "nodeType": "YulLiteral", + "src": "1575:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "1560:3:70", + "nodeType": "YulIdentifier", + "src": "1560:3:70" + }, + "nativeSrc": "1560:18:70", + "nodeType": "YulFunctionCall", + "src": "1560:18:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "1552:4:70", + "nodeType": "YulIdentifier", + "src": "1552:4:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "1594:9:70", + "nodeType": "YulIdentifier", + "src": "1594:9:70" + }, + { + "name": "value0", + "nativeSrc": "1605:6:70", + "nodeType": "YulIdentifier", + "src": "1605:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "1587:6:70", + "nodeType": "YulIdentifier", + "src": "1587:6:70" + }, + "nativeSrc": "1587:25:70", + "nodeType": "YulFunctionCall", + "src": "1587:25:70" + }, + "nativeSrc": "1587:25:70", + "nodeType": "YulExpressionStatement", + "src": "1587:25:70" + } + ] + }, + "name": "abi_encode_tuple_t_bytes32__to_t_bytes32__fromStack_reversed", + "nativeSrc": "1441:177:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "1511:9:70", + "nodeType": "YulTypedName", + "src": "1511:9:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "1522:6:70", + "nodeType": "YulTypedName", + "src": "1522:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "1533:4:70", + "nodeType": "YulTypedName", + "src": "1533:4:70", + "type": "" + } + ], + "src": "1441:177:70" + }, + { + "body": { + "nativeSrc": "1742:406:70", + "nodeType": "YulBlock", + "src": "1742:406:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "1759:9:70", + "nodeType": "YulIdentifier", + "src": "1759:9:70" + }, + { + "kind": "number", + "nativeSrc": "1770:2:70", + "nodeType": "YulLiteral", + "src": "1770:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "1752:6:70", + "nodeType": "YulIdentifier", + "src": "1752:6:70" + }, + "nativeSrc": "1752:21:70", + "nodeType": "YulFunctionCall", + "src": "1752:21:70" + }, + "nativeSrc": "1752:21:70", + "nodeType": "YulExpressionStatement", + "src": "1752:21:70" + }, + { + "nativeSrc": "1782:27:70", + "nodeType": "YulVariableDeclaration", + "src": "1782:27:70", + "value": { + "arguments": [ + { + "name": "value0", + "nativeSrc": "1802:6:70", + "nodeType": "YulIdentifier", + "src": "1802:6:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "1796:5:70", + "nodeType": "YulIdentifier", + "src": "1796:5:70" + }, + "nativeSrc": "1796:13:70", + "nodeType": "YulFunctionCall", + "src": "1796:13:70" + }, + "variables": [ + { + "name": "length", + "nativeSrc": "1786:6:70", + "nodeType": "YulTypedName", + "src": "1786:6:70", + "type": "" + } + ] + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "1829:9:70", + "nodeType": "YulIdentifier", + "src": "1829:9:70" + }, + { + "kind": "number", + "nativeSrc": "1840:2:70", + "nodeType": "YulLiteral", + "src": "1840:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "1825:3:70", + "nodeType": "YulIdentifier", + "src": "1825:3:70" + }, + "nativeSrc": "1825:18:70", + "nodeType": "YulFunctionCall", + "src": "1825:18:70" + }, + { + "name": "length", + "nativeSrc": "1845:6:70", + "nodeType": "YulIdentifier", + "src": "1845:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "1818:6:70", + "nodeType": "YulIdentifier", + "src": "1818:6:70" + }, + "nativeSrc": "1818:34:70", + "nodeType": "YulFunctionCall", + "src": "1818:34:70" + }, + "nativeSrc": "1818:34:70", + "nodeType": "YulExpressionStatement", + "src": "1818:34:70" + }, + { + "nativeSrc": "1861:10:70", + "nodeType": "YulVariableDeclaration", + "src": "1861:10:70", + "value": { + "kind": "number", + "nativeSrc": "1870:1:70", + "nodeType": "YulLiteral", + "src": "1870:1:70", + "type": "", + "value": "0" + }, + "variables": [ + { + "name": "i", + "nativeSrc": "1865:1:70", + "nodeType": "YulTypedName", + "src": "1865:1:70", + "type": "" + } + ] + }, + { + "body": { + "nativeSrc": "1930:90:70", + "nodeType": "YulBlock", + "src": "1930:90:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "1959:9:70", + "nodeType": "YulIdentifier", + "src": "1959:9:70" + }, + { + "name": "i", + "nativeSrc": "1970:1:70", + "nodeType": "YulIdentifier", + "src": "1970:1:70" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "1955:3:70", + "nodeType": "YulIdentifier", + "src": "1955:3:70" + }, + "nativeSrc": "1955:17:70", + "nodeType": "YulFunctionCall", + "src": "1955:17:70" + }, + { + "kind": "number", + "nativeSrc": "1974:2:70", + "nodeType": "YulLiteral", + "src": "1974:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "1951:3:70", + "nodeType": "YulIdentifier", + "src": "1951:3:70" + }, + "nativeSrc": "1951:26:70", + "nodeType": "YulFunctionCall", + "src": "1951:26:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "arguments": [ + { + "name": "value0", + "nativeSrc": "1993:6:70", + "nodeType": "YulIdentifier", + "src": "1993:6:70" + }, + { + "name": "i", + "nativeSrc": "2001:1:70", + "nodeType": "YulIdentifier", + "src": "2001:1:70" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "1989:3:70", + "nodeType": "YulIdentifier", + "src": "1989:3:70" + }, + "nativeSrc": "1989:14:70", + "nodeType": "YulFunctionCall", + "src": "1989:14:70" + }, + { + "kind": "number", + "nativeSrc": "2005:2:70", + "nodeType": "YulLiteral", + "src": "2005:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "1985:3:70", + "nodeType": "YulIdentifier", + "src": "1985:3:70" + }, + "nativeSrc": "1985:23:70", + "nodeType": "YulFunctionCall", + "src": "1985:23:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "1979:5:70", + "nodeType": "YulIdentifier", + "src": "1979:5:70" + }, + "nativeSrc": "1979:30:70", + "nodeType": "YulFunctionCall", + "src": "1979:30:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "1944:6:70", + "nodeType": "YulIdentifier", + "src": "1944:6:70" + }, + "nativeSrc": "1944:66:70", + "nodeType": "YulFunctionCall", + "src": "1944:66:70" + }, + "nativeSrc": "1944:66:70", + "nodeType": "YulExpressionStatement", + "src": "1944:66:70" + } + ] + }, + "condition": { + "arguments": [ + { + "name": "i", + "nativeSrc": "1891:1:70", + "nodeType": "YulIdentifier", + "src": "1891:1:70" + }, + { + "name": "length", + "nativeSrc": "1894:6:70", + "nodeType": "YulIdentifier", + "src": "1894:6:70" + } + ], + "functionName": { + "name": "lt", + "nativeSrc": "1888:2:70", + "nodeType": "YulIdentifier", + "src": "1888:2:70" + }, + "nativeSrc": "1888:13:70", + "nodeType": "YulFunctionCall", + "src": "1888:13:70" + }, + "nativeSrc": "1880:140:70", + "nodeType": "YulForLoop", + "post": { + "nativeSrc": "1902:19:70", + "nodeType": "YulBlock", + "src": "1902:19:70", + "statements": [ + { + "nativeSrc": "1904:15:70", + "nodeType": "YulAssignment", + "src": "1904:15:70", + "value": { + "arguments": [ + { + "name": "i", + "nativeSrc": "1913:1:70", + "nodeType": "YulIdentifier", + "src": "1913:1:70" + }, + { + "kind": "number", + "nativeSrc": "1916:2:70", + "nodeType": "YulLiteral", + "src": "1916:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "1909:3:70", + "nodeType": "YulIdentifier", + "src": "1909:3:70" + }, + "nativeSrc": "1909:10:70", + "nodeType": "YulFunctionCall", + "src": "1909:10:70" + }, + "variableNames": [ + { + "name": "i", + "nativeSrc": "1904:1:70", + "nodeType": "YulIdentifier", + "src": "1904:1:70" + } + ] + } + ] + }, + "pre": { + "nativeSrc": "1884:3:70", + "nodeType": "YulBlock", + "src": "1884:3:70", + "statements": [] + }, + "src": "1880:140:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "2044:9:70", + "nodeType": "YulIdentifier", + "src": "2044:9:70" + }, + { + "name": "length", + "nativeSrc": "2055:6:70", + "nodeType": "YulIdentifier", + "src": "2055:6:70" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "2040:3:70", + "nodeType": "YulIdentifier", + "src": "2040:3:70" + }, + "nativeSrc": "2040:22:70", + "nodeType": "YulFunctionCall", + "src": "2040:22:70" + }, + { + "kind": "number", + "nativeSrc": "2064:2:70", + "nodeType": "YulLiteral", + "src": "2064:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "2036:3:70", + "nodeType": "YulIdentifier", + "src": "2036:3:70" + }, + "nativeSrc": "2036:31:70", + "nodeType": "YulFunctionCall", + "src": "2036:31:70" + }, + { + "kind": "number", + "nativeSrc": "2069:1:70", + "nodeType": "YulLiteral", + "src": "2069:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "2029:6:70", + "nodeType": "YulIdentifier", + "src": "2029:6:70" + }, + "nativeSrc": "2029:42:70", + "nodeType": "YulFunctionCall", + "src": "2029:42:70" + }, + "nativeSrc": "2029:42:70", + "nodeType": "YulExpressionStatement", + "src": "2029:42:70" + }, + { + "nativeSrc": "2080:62:70", + "nodeType": "YulAssignment", + "src": "2080:62:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "2096:9:70", + "nodeType": "YulIdentifier", + "src": "2096:9:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "name": "length", + "nativeSrc": "2115:6:70", + "nodeType": "YulIdentifier", + "src": "2115:6:70" + }, + { + "kind": "number", + "nativeSrc": "2123:2:70", + "nodeType": "YulLiteral", + "src": "2123:2:70", + "type": "", + "value": "31" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "2111:3:70", + "nodeType": "YulIdentifier", + "src": "2111:3:70" + }, + "nativeSrc": "2111:15:70", + "nodeType": "YulFunctionCall", + "src": "2111:15:70" + }, + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "2132:2:70", + "nodeType": "YulLiteral", + "src": "2132:2:70", + "type": "", + "value": "31" + } + ], + "functionName": { + "name": "not", + "nativeSrc": "2128:3:70", + "nodeType": "YulIdentifier", + "src": "2128:3:70" + }, + "nativeSrc": "2128:7:70", + "nodeType": "YulFunctionCall", + "src": "2128:7:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "2107:3:70", + "nodeType": "YulIdentifier", + "src": "2107:3:70" + }, + "nativeSrc": "2107:29:70", + "nodeType": "YulFunctionCall", + "src": "2107:29:70" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "2092:3:70", + "nodeType": "YulIdentifier", + "src": "2092:3:70" + }, + "nativeSrc": "2092:45:70", + "nodeType": "YulFunctionCall", + "src": "2092:45:70" + }, + { + "kind": "number", + "nativeSrc": "2139:2:70", + "nodeType": "YulLiteral", + "src": "2139:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "2088:3:70", + "nodeType": "YulIdentifier", + "src": "2088:3:70" + }, + "nativeSrc": "2088:54:70", + "nodeType": "YulFunctionCall", + "src": "2088:54:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "2080:4:70", + "nodeType": "YulIdentifier", + "src": "2080:4:70" + } + ] + } + ] + }, + "name": "abi_encode_tuple_t_bytes_memory_ptr__to_t_bytes_memory_ptr__fromStack_reversed", + "nativeSrc": "1623:525:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "1711:9:70", + "nodeType": "YulTypedName", + "src": "1711:9:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "1722:6:70", + "nodeType": "YulTypedName", + "src": "1722:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "1733:4:70", + "nodeType": "YulTypedName", + "src": "1733:4:70", + "type": "" + } + ], + "src": "1623:525:70" + }, + { + "body": { + "nativeSrc": "2252:101:70", + "nodeType": "YulBlock", + "src": "2252:101:70", + "statements": [ + { + "nativeSrc": "2262:26:70", + "nodeType": "YulAssignment", + "src": "2262:26:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "2274:9:70", + "nodeType": "YulIdentifier", + "src": "2274:9:70" + }, + { + "kind": "number", + "nativeSrc": "2285:2:70", + "nodeType": "YulLiteral", + "src": "2285:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "2270:3:70", + "nodeType": "YulIdentifier", + "src": "2270:3:70" + }, + "nativeSrc": "2270:18:70", + "nodeType": "YulFunctionCall", + "src": "2270:18:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "2262:4:70", + "nodeType": "YulIdentifier", + "src": "2262:4:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "2304:9:70", + "nodeType": "YulIdentifier", + "src": "2304:9:70" + }, + { + "arguments": [ + { + "name": "value0", + "nativeSrc": "2319:6:70", + "nodeType": "YulIdentifier", + "src": "2319:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "2335:2:70", + "nodeType": "YulLiteral", + "src": "2335:2:70", + "type": "", + "value": "64" + }, + { + "kind": "number", + "nativeSrc": "2339:1:70", + "nodeType": "YulLiteral", + "src": "2339:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "2331:3:70", + "nodeType": "YulIdentifier", + "src": "2331:3:70" + }, + "nativeSrc": "2331:10:70", + "nodeType": "YulFunctionCall", + "src": "2331:10:70" + }, + { + "kind": "number", + "nativeSrc": "2343:1:70", + "nodeType": "YulLiteral", + "src": "2343:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "2327:3:70", + "nodeType": "YulIdentifier", + "src": "2327:3:70" + }, + "nativeSrc": "2327:18:70", + "nodeType": "YulFunctionCall", + "src": "2327:18:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "2315:3:70", + "nodeType": "YulIdentifier", + "src": "2315:3:70" + }, + "nativeSrc": "2315:31:70", + "nodeType": "YulFunctionCall", + "src": "2315:31:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "2297:6:70", + "nodeType": "YulIdentifier", + "src": "2297:6:70" + }, + "nativeSrc": "2297:50:70", + "nodeType": "YulFunctionCall", + "src": "2297:50:70" + }, + "nativeSrc": "2297:50:70", + "nodeType": "YulExpressionStatement", + "src": "2297:50:70" + } + ] + }, + "name": "abi_encode_tuple_t_uint64__to_t_uint64__fromStack_reversed", + "nativeSrc": "2153:200:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "2221:9:70", + "nodeType": "YulTypedName", + "src": "2221:9:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "2232:6:70", + "nodeType": "YulTypedName", + "src": "2232:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "2243:4:70", + "nodeType": "YulTypedName", + "src": "2243:4:70", + "type": "" + } + ], + "src": "2153:200:70" + } + ] + }, + "contents": "{\n { }\n function abi_decode_tuple_t_address_fromMemory(headStart, dataEnd) -> value0\n {\n if slt(sub(dataEnd, headStart), 32) { revert(0, 0) }\n let value := mload(headStart)\n if iszero(eq(value, and(value, sub(shl(160, 1), 1)))) { revert(0, 0) }\n value0 := value\n }\n function abi_encode_tuple_t_stringliteral_7c20e2bbcd91c5aaa7898ba022ab8867ac32d84e959c236484db066900aa363a__to_t_bytes_memory_ptr__fromStack_reversed(headStart) -> tail\n {\n mstore(headStart, 32)\n mstore(add(headStart, 32), 10)\n mstore(add(headStart, 64), \"Controller\")\n tail := add(headStart, 96)\n }\n function abi_encode_tuple_t_address_t_address_t_address_t_address_t_address_t_address_t_address__to_t_address_t_address_t_address_t_address_t_address_t_address_t_address__fromStack_reversed(headStart, value6, value5, value4, value3, value2, value1, value0) -> tail\n {\n tail := add(headStart, 224)\n mstore(headStart, and(value0, sub(shl(160, 1), 1)))\n mstore(add(headStart, 32), and(value1, sub(shl(160, 1), 1)))\n mstore(add(headStart, 64), and(value2, sub(shl(160, 1), 1)))\n mstore(add(headStart, 96), and(value3, sub(shl(160, 1), 1)))\n mstore(add(headStart, 128), and(value4, sub(shl(160, 1), 1)))\n mstore(add(headStart, 160), and(value5, sub(shl(160, 1), 1)))\n mstore(add(headStart, 192), and(value6, sub(shl(160, 1), 1)))\n }\n function abi_encode_tuple_t_bytes32__to_t_bytes32__fromStack_reversed(headStart, value0) -> tail\n {\n tail := add(headStart, 32)\n mstore(headStart, value0)\n }\n function abi_encode_tuple_t_bytes_memory_ptr__to_t_bytes_memory_ptr__fromStack_reversed(headStart, value0) -> tail\n {\n mstore(headStart, 32)\n let length := mload(value0)\n mstore(add(headStart, 32), length)\n let i := 0\n for { } lt(i, length) { i := add(i, 32) }\n {\n mstore(add(add(headStart, i), 64), mload(add(add(value0, i), 32)))\n }\n mstore(add(add(headStart, length), 64), 0)\n tail := add(add(headStart, and(add(length, 31), not(31))), 64)\n }\n function abi_encode_tuple_t_uint64__to_t_uint64__fromStack_reversed(headStart, value0) -> tail\n {\n tail := add(headStart, 32)\n mstore(headStart, and(value0, sub(shl(64, 1), 1)))\n }\n}", + "id": 70, + "language": "Yul", + "name": "#utility.yul" + } + ], + "linkReferences": {}, + "object": "6101c060405234801561001157600080fd5b50604051613b6e380380613b6e8339810160408190526100309161049b565b806001600160a01b03811661007a5760405163218f5add60e11b815260206004820152600a60248201526921b7b73a3937b63632b960b11b60448201526064015b60405180910390fd5b6001600160a01b0381166101005260408051808201909152600a81526923b930b8342a37b5b2b760b11b60208201526100b29061033b565b6001600160a01b03166080526040805180820190915260078152665374616b696e6760c81b60208201526100e59061033b565b6001600160a01b031660a05260408051808201909152600d81526c47726170685061796d656e747360981b602082015261011e9061033b565b6001600160a01b031660c05260408051808201909152600e81526d5061796d656e7473457363726f7760901b60208201526101589061033b565b6001600160a01b031660e05260408051808201909152600c81526b22b837b1b426b0b730b3b2b960a11b60208201526101909061033b565b6001600160a01b03166101205260408051808201909152600e81526d2932bbb0b93239a6b0b730b3b2b960911b60208201526101cb9061033b565b6001600160a01b0316610140526040805180820190915260118152704772617068546f6b656e4761746577617960781b60208201526102099061033b565b6001600160a01b03166101605260408051808201909152600f81526e23b930b834283937bc3ca0b236b4b760891b60208201526102459061033b565b6001600160a01b03166101805260408051808201909152600881526721bab930ba34b7b760c11b602082015261027a9061033b565b6001600160a01b039081166101a08190526101005160a05160805160c05160e05161012051610140516101605161018051604051988b169a9788169996909716977fef5021414834d86e36470f5c1cecf6544fb2bb723f2ca51a4c86fcd8c5919a43976103249790916001600160a01b03978816815295871660208701529386166040860152918516606085015284166080840152831660a083015290911660c082015260e00190565b60405180910390a4506103356103e9565b50610519565b600080610100516001600160a01b031663f7641a5e84805190602001206040518263ffffffff1660e01b815260040161037691815260200190565b602060405180830381865afa158015610393573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103b7919061049b565b9050826001600160a01b0382166103e25760405163218f5add60e11b815260040161007191906104cb565b5092915050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff16156104395760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b03908116146104985780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b6000602082840312156104ad57600080fd5b81516001600160a01b03811681146104c457600080fd5b9392505050565b602081526000825180602084015260005b818110156104f957602081860181015160408684010152016104dc565b506000604082850101526040601f19601f83011684010191505092915050565b60805160a05160c05160e05161010051610120516101405161016051610180516101a0516135f261057c60003960005050600050506000505060005050600050506000505060005050600050506000611f23015260006119cc01526135f26000f3fe608060405234801561001057600080fd5b50600436106101a15760003560e01c8063050b17ad146101a65780630533e1ba146101bb5780630bc7344b146101e857806311be1997146101fb578063169729781461027857806317337b461461028b5780631792f1941461029557806326058249146102a857806329e03ff1146102c857806336167e03146102df5780634bc5839a146102f25780635aea0ec4146103055780635bf31d4d146103265780636369df6b146103405780636cc6cde114610353578063715018a61461036657806376c993ae1461036e5780638d4e9008146103815780638da5cb5b14610394578063902a49381461039c5780639334ea52146103ac57806393a90a1e146103bf5780639f81a7cf146103d2578063b0e2f7e9146103e5578063b0eefabe146103f8578063bb2a2b471461040b578063be41f38414610419578063c133b4291461043c578063c50a77b11461044f578063c894222e14610462578063c9747f5114610483578063cc2d55cd14610496578063d36fc9d4146104a5578063d76f62d1146104b8578063f2fde38b146104cb575b600080fd5b6101b96101b4366004612c8a565b6104de565b005b6036546101d290600160201b900463ffffffff1681565b6040516101df9190612cac565b60405180910390f35b6101b96101f6366004612cf9565b6105fc565b610263610209366004612d72565b603760205260009081526040902080546001820154600283015460038401546004850154600586015460068701546007909701546001600160a01b039687169796909516959394929360ff80841694610100909404169289565b6040516101df99989796959493929190612db5565b6101b9610286366004612d72565b610734565b6101d26207a12081565b6101b96102a3366004612d72565b610748565b6033546102bb906001600160a01b031681565b6040516101df9190612e20565b6102d160355481565b6040519081526020016101df565b6101b96102ed366004612d72565b6108a8565b6102d1610300366004612e34565b6109ae565b603454600160a01b90046001600160401b03165b6040516101df9190612e60565b60345461031990600160a01b90046001600160401b031681565b6102d161034e366004612e74565b6109e6565b6034546102bb906001600160a01b031681565b6101b96109ff565b6101b961037c366004612e8f565b610a13565b6102d161038f366004612eac565b610a24565b6102bb610dc5565b6036546101d29063ffffffff1681565b6101b96103ba366004612d72565b610de0565b6101b96103cd366004612ef2565b610edf565b6101b96103e0366004612e8f565b610ef0565b6101b96103f3366004612f1d565b610f01565b6101b9610406366004612ef2565b611062565b60365463ffffffff166101d2565b61042c610427366004612d72565b611073565b60405190151581526020016101df565b6102d161044a366004612ef2565b6110a9565b6102d161045d366004612fa4565b611141565b610475610470366004612fe5565b6111d4565b6040516101df929190613054565b6102bb6104913660046130fa565b6113e2565b6102d1670de0b6b3a764000081565b61042c6104b336600461317c565b6114cd565b6101b96104c63660046131b2565b6114f5565b6101b96104d9366004612ef2565b611506565b6034546001600160a01b031633146105095760405163a8baf3bb60e01b815260040160405180910390fd5b8161051381611073565b819061053e576040516314a03bbd60e21b815260040161053591815260200190565b60405180910390fd5b506004600082815260376020526040902060040154610100900460ff16600581111561056c5761056c612d8b565b600083815260376020526040902060040154610100900460ff1691146105a65760405163146e540f60e21b815260040161053591906131cf565b506000838152603760205260409020600301548390156105dc576040516364d0c32b60e01b815260040161053591815260200190565b5060008381526037602052604090206105f6848285611541565b50505050565b60006106066115f2565b805490915060ff600160401b82041615906001600160401b031660008115801561062d5750825b90506000826001600160401b031660011480156106495750303b155b905081158015610657575080155b156106755760405163f92ee8a960e01b815260040160405180910390fd5b84546001600160401b0319166001178555831561069e57845460ff60401b1916600160401b1785555b6106a78b61161b565b6106af61162c565b6106b88a61163c565b6106c1896116ad565b6106ca88611736565b6106d387611799565b6106dc8661180b565b831561072757845460ff60401b191685556040517fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29061071e90600190612e60565b60405180910390a15b5050505050505050505050565b61073c611892565b61074581611736565b50565b8061075281611073565b8190610774576040516314a03bbd60e21b815260040161053591815260200190565b506000818152603760205260409020600101546001600160a01b031633146107af5760405163082c005560e41b815260040160405180910390fd5b816107b981611073565b81906107db576040516314a03bbd60e21b815260040161053591815260200190565b506004600082815260376020526040902060040154610100900460ff16600581111561080957610809612d8b565b600083815260376020526040902060040154610100900460ff1691146108435760405163146e540f60e21b815260040161053591906131cf565b506000838152603760205260409020600681015442101561087757604051631d7753d560e11b815260040160405180910390fd5b61088184826118c4565b6003810154156105f657600381015460008181526037602052604090206105f691906118c4565b6034546001600160a01b031633146108d35760405163a8baf3bb60e01b815260040160405180910390fd5b806108dd81611073565b81906108ff576040516314a03bbd60e21b815260040161053591815260200190565b506004600082815260376020526040902060040154610100900460ff16600581111561092d5761092d612d8b565b600083815260376020526040902060040154610100900460ff1691146109675760405163146e540f60e21b815260040161053591906131cf565b506000828152603760205260409020600381015483901561099e576040516364d0c32b60e01b815260040161053591815260200190565b506109a9838261194b565b505050565b60006109cf336035546109bf6119ca565b6001600160a01b031691906119ee565b6109dd336035548585611aa6565b90505b92915050565b60006109e06109fa368490038401846131dd565b611e28565b610a07611892565b610a116000611ec5565b565b610a1b611892565b61074581611799565b6034546000906001600160a01b03163314610a525760405163a8baf3bb60e01b815260040160405180910390fd5b6040516001600160601b0319606087901b166020820152656c656761637960d01b6034820152600090603a016040516020818303038152906040528051906020012090506000610aa0611f21565b6001600160a01b0316630e022923886040518263ffffffff1660e01b8152600401610acb9190612e20565b61012060405180830381865afa158015610ae9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b0d91906132d9565b519050866001600160a01b038216610b39576040516334789d8b60e21b81526004016105359190612e20565b5060408051610120810182526001600160a01b038381168252881660208201526000918101829052606081019190915260036080820152600160a08201524260c0820181905260345460e0830191610ba191600160a01b90046001600160401b03169061330c565b81526000602091820181905284815260378252604090819020835181546001600160a01b039182166001600160a01b0319918216178355938501516001808401805492909316919095161790559083015160028201556060830151600380830191909155608084015160048301805493949193909260ff1990911691908490811115610c2f57610c2f612d8b565b021790555060a082015160048201805461ff001916610100836005811115610c5957610c59612d8b565b021790555060c0820151600582015560e08201516006820155610100909101516007909101556000610c89611f45565b9050806001600160a01b031663cb8347fe838888604051602001610cae929190613054565b6040516020818303038152906040526040518363ffffffff1660e01b8152600401610cda929190613365565b600060405180830381600087803b158015610cf457600080fd5b505af1158015610d08573d6000803e3d6000fd5b50505050610d298786610d196119ca565b6001600160a01b03169190611f81565b604080516001600160a01b038a81168252602082018990529181018790528189169184169085907f587a1fc7e80e653a2ab7f63f98c080f5818b8cedcfd1374590c8c786290ed0319060600160405180910390a4866001600160a01b0316826001600160a01b03168460008051602061359d83398151915288604051610db191815260200190565b60405180910390a450909695505050505050565b600080610dd0611fbc565b546001600160a01b031692915050565b6034546001600160a01b03163314610e0b5760405163a8baf3bb60e01b815260040160405180910390fd5b80610e1581611073565b8190610e37576040516314a03bbd60e21b815260040161053591815260200190565b506004600082815260376020526040902060040154610100900460ff166005811115610e6557610e65612d8b565b600083815260376020526040902060040154610100900460ff169114610e9f5760405163146e540f60e21b815260040161053591906131cf565b506000828152603760205260409020610eb88382611fe0565b6003810154156109a957600381015460008181526037602052604090206109a99190611fe0565b610ee7611892565b6107458161205f565b610ef8611892565b6107458161180b565b6034546001600160a01b03163314610f2c5760405163a8baf3bb60e01b815260040160405180910390fd5b83610f3681611073565b8190610f58576040516314a03bbd60e21b815260040161053591815260200190565b506004600082815260376020526040902060040154610100900460ff166005811115610f8657610f86612d8b565b600083815260376020526040902060040154610100900460ff169114610fc05760405163146e540f60e21b815260040161053591906131cf565b5060008581526037602052604090206003015415158590610ffa57604051600162d62c0760e01b0319815260040161053591815260200190565b506000858152603760205260409020611014868287611541565b831561103d5760038101546000818152603760205260409020611038919085611541565b61105a565b6003810154600081815260376020526040902061105a9190611fe0565b505050505050565b61106a611892565b6107458161163c565b600080600083815260376020526040902060040154610100900460ff1660058111156110a1576110a1612d8b565b141592915050565b6000806110b4611f21565b6001600160a01b03166325d9897e846110cb611f45565b6040518363ffffffff1660e01b81526004016110e8929190613389565b61014060405180830381865afa158015611106573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061112a91906133b9565b905061113a8382600001516120d0565b9392505050565b6000611152336035546109bf6119ca565b6109dd3360355461119886868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061216592505050565b86868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506122a592505050565b6000806000339050600061121d88888080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061216592505050565b9050600061126087878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061216592505050565b905061126c82826125a4565b825160208085015160408087015186519387015191870151949592949093926112cb57604051636aba529760e11b81526004810196909652602486019490945260448501929092526064840152608483015260a482015260c401610535565b5050505050506112e0336035546109bf6119ca565b60006113328460026035546112f59190613466565b858d8d8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506122a592505050565b905060006113868560026035546113499190613466565b858c8c8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506122a592505050565b60008381526037602052604080822060039081018490558383528183200185905551919250829184917ffec135a4cf8e5c6e13dea23be058bf03a8bf8f1f6fb0a021b0a5aeddfba8140791a3909a909950975050505050505050565b6000806113ee836125d5565b905060006113fa611f45565b6001600160a01b0316630e022923836040518263ffffffff1660e01b81526004016114259190612e20565b61012060405180830381865afa158015611443573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061146791906132d9565b805190915082906001600160a01b0316611495576040516334789d8b60e21b81526004016105359190612e20565b5060408401516020820151908181146114c357604051630a24cfe560e21b8152600401610535929190613054565b5050519392505050565b60006109dd6114e1368590038501856130fa565b6114f0368590038501856130fa565b6125a4565b6114fd611892565b610745816116ad565b61150e611892565b6001600160a01b038116611538576000604051631e4fbdf760e01b81526004016105359190612e20565b61074581611ec5565b81546007830154600091611562916001600160a01b0390911690849061265e565b60048401805461ff001916610100179055600184015460028501549192506115a2916001600160a01b039091169061159a908461330c565b610d196119ca565b6001830154835460028501546001600160a01b039283169290911690869060008051602061359d833981519152906115db90869061330c565b60405190815260200160405180910390a450505050565b6000807ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a006109e0565b61162361280f565b61074581612834565b61163461280f565b610a1161283c565b6001600160a01b0381166116635760405163616bc44160e11b815260040160405180910390fd5b603480546001600160a01b0319166001600160a01b0383169081179091556040517f51744122301b50e919f4e3d22adf8c53abc92195b8c667eda98c6ef20375672e90600090a250565b806001600160401b03166000036116d75760405163c4411f1160e01b815260040160405180910390fd5b60348054600160a01b600160e01b031916600160a01b6001600160401b038416021790556040517f310462a9bf49fff4a57910ec647c77cbf8aaf2f13394554ac6cdf14fc68db7e69061172b908390612e60565b60405180910390a150565b80670de0b6b3a76400008110156117635760405163033f4e0560e01b815260040161053591815260200190565b5060358190556040518181527f97896b9da0f97f36bf3011570bcff930069299de4b1e89c9cb44909841cac2f89060200161172b565b806207a12063ffffffff821611156117c55760405163432e664360e11b81526004016105359190612cac565b506036805463ffffffff191663ffffffff83161790556040517fc573dc0f869f6a1d0a74fc7712a63baabcb5567131d2d98005e163924eddcbab9061172b908390612cac565b8063ffffffff8116620f4240101561183757604051634e9374fb60e11b81526004016105359190612cac565b506036805463ffffffff60201b1916600160201b63ffffffff848116820292909217928390556040517f7efaf01bec3cda8d104163bb466d01d7e16f68848301c7eb0749cfa59d6805029361172b9392900490911690612cac565b3361189b610dc5565b6001600160a01b031614610a11573360405163118cdaa760e01b81526004016105359190612e20565b60048101805461ff001916610500179055600181015460028201546118f5916001600160a01b031690610d196119ca565b6001810154815460028301546040519081526001600160a01b03928316929091169084907f223103f8eb52e5f43a75655152acd882a605d70df57a5c0fefd30f516b1756d2906020015b60405180910390a45050565b60048101805461ff001916610200179055600281015461197c9061196d6119ca565b6001600160a01b03169061290e565b6001810154815460028301546040519081526001600160a01b03928316929091169084907f2226ebd23625a7938fb786df2248bd171d2e6ad70cb2b654ea1be830ca17224d9060200161193f565b7f000000000000000000000000000000000000000000000000000000000000000090565b80156109a9576040516323b872dd60e01b81526001600160a01b038381166004830152306024830152604482018390528416906323b872dd906064015b6020604051808303816000875af1158015611a4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a6e9190613488565b6109a95760405162461bcd60e51b815260206004820152600960248201526810ba3930b739b332b960b91b6044820152606401610535565b6040516001600160601b0319606084901b166020820152603481018290526000908190605401604051602081830303815290604052805190602001209050611aed81611073565b158190611b105760405163124a23f160e11b815260040161053591815260200190565b506000611b1b611f45565b90506000816001600160a01b0316630e022923876040518263ffffffff1660e01b8152600401611b4b9190612e20565b61012060405180830381865afa158015611b69573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b8d91906132d9565b8051909150866001600160a01b038216611bbb576040516334789d8b60e21b81526004016105359190612e20565b506000611bc6611f21565b6001600160a01b03166325d9897e83866040518363ffffffff1660e01b8152600401611bf3929190613389565b61014060405180830381865afa158015611c11573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c3591906133b9565b8051909150600003611c5a5760405163307efdb760e11b815260040160405180910390fd5b6000611c6a8383600001516120d0565b603454909150600090611c8d90600160a01b90046001600160401b03164261330c565b604080516101208101825287516001600160a01b0390811682528f1660208201529081018d905260006060820152909150608081016001815260200160048152426020808301919091526040808301859052606092830186905260008b815260378352819020845181546001600160a01b039182166001600160a01b0319918216178355938601516001808401805492909316919095161790559084015160028201559183015160038084019190915560808401516004840180549193909260ff19909216918490811115611d6457611d64612d8b565b021790555060a082015160048201805461ff001916610100836005811115611d8e57611d8e612d8b565b021790555060c0820151600582015560e08201516006820155610100909101516007909101558451604080518d81526001600160a01b038d811660208301529181018c90526060810185905260808101849052818f16929091169089907f8a1eccecce948a912e2e195de5960359755aeac90ad88a3fde55a77e1a73796b9060a00160405180910390a450949a9950505050505050505050565b600054815160208084015160409485015185517f32dd026408194a0d7e54cc66a2ab6c856efc55cfcd4dd258fde5b1a55222baa6818501528087019490945260608401919091526080808401919091528451808403909101815260a08301855280519082012061190160f01b60c084015260c283019390935260e28083019390935283518083039093018352610102909101909252805191012090565b6000611ecf611fbc565b80546001600160a01b038481166001600160a01b031983168117845560405193945091169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b6033546000906001600160a01b0316611f715760405163bd088b4f60e01b815260040160405180910390fd5b506033546001600160a01b031690565b80156109a95760405163a9059cbb60e01b81526001600160a01b0383811660048301526024820183905284169063a9059cbb90604401611a2b565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930090565b60048101805461ff00191661030017905560018101546002820154612011916001600160a01b031690610d196119ca565b6001810154815460028301546040519081526001600160a01b03928316929091169084907ff0912efb86ea1d65a17d64d48393cdb1ca0ea5220dd2bbe438621199d30955b79060200161193f565b6001600160a01b0381166120865760405163616bc44160e11b815260040160405180910390fd5b603380546001600160a01b0319166001600160a01b0383169081179091556040517f81dcb738da3dabd5bb2adbc7dd107fbbfca936e9c8aecab25f5b17a710a784c790600090a250565b6000806120db611f21565b6001600160a01b031663561285e4856120f2611f45565b6040518363ffffffff1660e01b815260040161210f929190613389565b60a060405180830381865afa15801561212c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061215091906134a5565b51905061215d818461330c565b949350505050565b6040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a081019190915260016121a460208061330c565b6121ae919061330c565b6121b990606061330c565b82519081149060016121cc60208061330c565b6121d6919061330c565b6121e190606061330c565b909161220257604051633fdf342360e01b8152600401610535929190613054565b505060008060008480602001905181019061221d9190613524565b925092509250600061223086606061296e565b90506000612249876122446020606061330c565b61296e565b9050600061226d88602061225e81606061330c565b612268919061330c565b6129b9565b6040805160c081018252978852602088019690965294860193909352606085019190915260808401525060ff1660a082015292915050565b6000806122b1846113e2565b905060006122bd611f21565b6001600160a01b03166325d9897e836122d4611f45565b6040518363ffffffff1660e01b81526004016122f1929190613389565b61014060405180830381865afa15801561230f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061233391906133b9565b80519091506000036123585760405163307efdb760e11b815260040160405180910390fd5b84516020808701516040808901518151938401949094528201526060808201929092526001600160601b031984831b811660808301529189901b909116609482015260009060a8016040516020818303038152906040528051906020012090506123c181611073565b1581906123e45760405163124a23f160e11b815260040161053591815260200190565b5060006123f58484600001516120d0565b60345490915060009061241890600160a01b90046001600160401b03164261330c565b60408051610120810182526001600160a01b0380891682528d1660208201529081018b9052600060608201529091506080810160028152602001600481524260208083019190915260408083018590526060928301869052600087815260378352819020845181546001600160a01b039182166001600160a01b0319918216178355938601516001808401805492909316919095161790559084015160028201559183015160038084019190915560808401516004840180549193909260ff199092169184908111156124ed576124ed612d8b565b021790555060a082015160048201805461ff00191661010083600581111561251757612517612d8b565b021790555060c0820151816005015560e082015181600601556101008201518160070155905050896001600160a01b0316856001600160a01b0316847ffb70faf7306b83c2cec6d8c1627baad892cb79968a02cc0353174499ecfd8b358c8c604001518c878960405161258e959493929190613552565b60405180910390a4509098975050505050505050565b805182516000911480156125bf575081604001518360400151145b80156109dd575050602090810151910151141590565b60408051606081018252825181526020808401519082015282820151918101919091526000908161260582611e28565b905061215d81856060015186608001518760a0015160405160200161264a93929190928352602083019190915260f81b6001600160f81b031916604082015260410190565b604051602081830303815290604052612a04565b600080612669611f45565b90506000612675611f21565b6001600160a01b03166325d9897e87846040518363ffffffff1660e01b81526004016126a2929190613389565b61014060405180830381865afa1580156126c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126e491906133b9565b60365490915060009061270990869063ffffffff600160201b909104811690612a2e16565b9050851580159061271a5750808611155b8682909161273d5760405163cc6b7c4160e01b8152600401610535929190613054565b5050600061274f878460000151612a8e565b60608401516036549192506000916127709163ffffffff9081169116612a8e565b9050600061277e8284612a2e565b9050856001600160a01b031663cb8347fe8b8b846040516020016127a3929190613054565b6040516020818303038152906040526040518363ffffffff1660e01b81526004016127cf929190613365565b600060405180830381600087803b1580156127e957600080fd5b505af11580156127fd573d6000803e3d6000fd5b50929c9b505050505050505050505050565b612817612aa5565b610a1157604051631afcd79f60e31b815260040160405180910390fd5b61150e61280f565b61284461280f565b604080517fd87cd6ef79d4e2b95e15ce8abf732db51ec771f1ca2edccf22a46c729ac5647260208201527f171a7fa058648750a8c5aae430f30db8d0100efc3a5e1b2e8054b1c1ce28b6b4918101919091527f044852b2a670ade5407e78fb2863c51de9fcb96542a07186fe3aeda6bb8a116d60608201524660808201523060a08201527fa070ffb1cd7409649bf77822cce74495468e06dbfaef09556838bf188679b9c260c082015260e00160408051601f198184030181529190528051602090910120600055565b801561296a57604051630852cd8d60e31b8152600481018290526001600160a01b038316906342966c6890602401600060405180830381600087803b15801561295657600080fd5b505af115801561105a573d6000803e3d6000fd5b5050565b600061297b60208361330c565b8351908110159061298d60208561330c565b90916129ae57604051633fdf342360e01b8152600401610535929190613054565b505050016020015190565b60006129c660018361330c565b835190811015906129d860018561330c565b90916129f957604051633fdf342360e01b8152600401610535929190613054565b505050016001015190565b600080600080612a148686612abf565b925092509250612a248282612b0c565b5090949350505050565b6000612a3d83620f4240101590565b80612a505750612a5082620f4240101590565b83839091612a735760405163768bf0eb60e11b8152600401610535929190613054565b50620f42409050612a848385613585565b6109dd9190613466565b600081831115612a9e57816109dd565b5090919050565b6000612aaf6115f2565b54600160401b900460ff16919050565b60008060008351604103612af95760208401516040850151606086015160001a612aeb88828585612bc5565b955095509550505050612b05565b50508151600091506002905b9250925092565b6000826003811115612b2057612b20612d8b565b03612b29575050565b6001826003811115612b3d57612b3d612d8b565b03612b5b5760405163f645eedf60e01b815260040160405180910390fd5b6002826003811115612b6f57612b6f612d8b565b03612b905760405163fce698f760e01b815260048101829052602401610535565b6003826003811115612ba457612ba4612d8b565b0361296a576040516335e2f38360e21b815260048101829052602401610535565b600080806fa2a8918ca85bafe22016d0b997e4df60600160ff1b03841115612bf65750600091506003905082612c80565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa158015612c4a573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116612c7657506000925060019150829050612c80565b9250600091508190505b9450945094915050565b60008060408385031215612c9d57600080fd5b50508035926020909101359150565b63ffffffff91909116815260200190565b6001600160a01b038116811461074557600080fd5b6001600160401b038116811461074557600080fd5b63ffffffff8116811461074557600080fd5b60008060008060008060c08789031215612d1257600080fd5b8635612d1d81612cbd565b95506020870135612d2d81612cbd565b94506040870135612d3d81612cd2565b9350606087013592506080870135612d5481612ce7565b915060a0870135612d6481612ce7565b809150509295509295509295565b600060208284031215612d8457600080fd5b5035919050565b634e487b7160e01b600052602160045260246000fd5b60068110612db157612db1612d8b565b9052565b6001600160a01b038a81168252891660208201526040810188905260608101879052610120810160048710612dec57612dec612d8b565b866080830152612dff60a0830187612da1565b8460c08301528360e0830152826101008301529a9950505050505050505050565b6001600160a01b0391909116815260200190565b60008060408385031215612e4757600080fd5b8235612e5281612cbd565b946020939093013593505050565b6001600160401b0391909116815260200190565b60006060828403128015612e8757600080fd5b509092915050565b600060208284031215612ea157600080fd5b813561113a81612ce7565b60008060008060808587031215612ec257600080fd5b8435612ecd81612cbd565b93506020850135612edd81612cbd565b93969395505050506040820135916060013590565b600060208284031215612f0457600080fd5b813561113a81612cbd565b801515811461074557600080fd5b60008060008060808587031215612f3357600080fd5b84359350602085013592506040850135612f4c81612f0f565b9396929550929360600135925050565b60008083601f840112612f6e57600080fd5b5081356001600160401b03811115612f8557600080fd5b602083019150836020828501011115612f9d57600080fd5b9250929050565b60008060208385031215612fb757600080fd5b82356001600160401b03811115612fcd57600080fd5b612fd985828601612f5c565b90969095509350505050565b60008060008060408587031215612ffb57600080fd5b84356001600160401b0381111561301157600080fd5b61301d87828801612f5c565b90955093505060208501356001600160401b0381111561303c57600080fd5b61304887828801612f5c565b95989497509550505050565b918252602082015260400190565b60405160c081016001600160401b038111828210171561309257634e487b7160e01b600052604160045260246000fd5b60405290565b60405161012081016001600160401b038111828210171561309257634e487b7160e01b600052604160045260246000fd5b60405161014081016001600160401b038111828210171561309257634e487b7160e01b600052604160045260246000fd5b600060c082840312801561310d57600080fd5b506000613118613062565b833581526020808501359082015260408085013590820152606080850135908201526080808501359082015260a084013560ff81168114613157578283fd5b60a0820152949350505050565b600060c0828403121561317657600080fd5b50919050565b600080610180838503121561319057600080fd5b61319a8484613164565b91506131a98460c08501613164565b90509250929050565b6000602082840312156131c457600080fd5b813561113a81612cd2565b602081016109e08284612da1565b600060608284031280156131f057600080fd5b50604051600090606081016001600160401b038111828210171561322257634e487b7160e01b83526041600452602483fd5b604090815284358252602080860135908301529384013593810193909352509092915050565b805161325381612cbd565b919050565b6000610120828403121561326b57600080fd5b613273613098565b905061327e82613248565b81526020828101519082015260408083015190820152606080830151908201526080808301519082015260a0808301519082015260c0808301519082015260e080830151908201526101009182015191810191909152919050565b600061012082840312156132ec57600080fd5b6109dd8383613258565b634e487b7160e01b600052601160045260246000fd5b808201808211156109e0576109e06132f6565b6000815180845260005b8181101561334557602081850181015186830182015201613329565b506000602082860101526020601f19601f83011685010191505092915050565b6001600160a01b038316815260406020820181905260009061215d9083018461331f565b6001600160a01b0392831681529116602082015260400190565b805161325381612ce7565b805161325381612cd2565b60006101408284031280156133cd57600080fd5b5060006133d86130c9565b8351815260208085015190820152604080850151908201526133fc606085016133a3565b606082015261340d608085016133ae565b608082015261341e60a085016133ae565b60a082015261342f60c085016133a3565b60c082015261344060e085016133ae565b60e082015261010084810151908201526101209384015193810193909352509092915050565b60008261348357634e487b7160e01b600052601260045260246000fd5b500490565b60006020828403121561349a57600080fd5b815161113a81612f0f565b600060a08284031280156134b857600080fd5b5060405160009060a081016001600160401b03811182821017156134ea57634e487b7160e01b83526041600452602483fd5b6040908152845182526020808601519083015284810151908201526060808501519082015260809384015193810193909352509092915050565b60008060006060848603121561353957600080fd5b5050815160208301516040909301519094929350919050565b85815284602082015260a06040820152600061357160a083018661331f565b606083019490945250608001529392505050565b80820281158282048414176109e0576109e06132f656fe6d800aaaf64b9a1f321dcd63da04369d33d8a0d49ad0fbba085aab4a98bf31c4a2646970667358221220d50b3dec1e5d2d1d140733dca7d5163900c1fc882947b3208864910c6f452d0e64736f6c634300081b0033", + "opcodes": "PUSH2 0x1C0 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x11 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x40 MLOAD PUSH2 0x3B6E CODESIZE SUB DUP1 PUSH2 0x3B6E DUP4 CODECOPY DUP2 ADD PUSH1 0x40 DUP2 SWAP1 MSTORE PUSH2 0x30 SWAP2 PUSH2 0x49B JUMP JUMPDEST DUP1 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP2 AND PUSH2 0x7A JUMPI PUSH1 0x40 MLOAD PUSH4 0x218F5ADD PUSH1 0xE1 SHL DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0xA PUSH1 0x24 DUP3 ADD MSTORE PUSH10 0x21B7B73A3937B63632B9 PUSH1 0xB1 SHL PUSH1 0x44 DUP3 ADD MSTORE PUSH1 0x64 ADD JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP2 AND PUSH2 0x100 MSTORE PUSH1 0x40 DUP1 MLOAD DUP1 DUP3 ADD SWAP1 SWAP2 MSTORE PUSH1 0xA DUP2 MSTORE PUSH10 0x23B930B8342A37B5B2B7 PUSH1 0xB1 SHL PUSH1 0x20 DUP3 ADD MSTORE PUSH2 0xB2 SWAP1 PUSH2 0x33B JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH1 0x80 MSTORE PUSH1 0x40 DUP1 MLOAD DUP1 DUP3 ADD SWAP1 SWAP2 MSTORE PUSH1 0x7 DUP2 MSTORE PUSH7 0x5374616B696E67 PUSH1 0xC8 SHL PUSH1 0x20 DUP3 ADD MSTORE PUSH2 0xE5 SWAP1 PUSH2 0x33B JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH1 0xA0 MSTORE PUSH1 0x40 DUP1 MLOAD DUP1 DUP3 ADD SWAP1 SWAP2 MSTORE PUSH1 0xD DUP2 MSTORE PUSH13 0x47726170685061796D656E7473 PUSH1 0x98 SHL PUSH1 0x20 DUP3 ADD MSTORE PUSH2 0x11E SWAP1 PUSH2 0x33B JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH1 0xC0 MSTORE PUSH1 0x40 DUP1 MLOAD DUP1 DUP3 ADD SWAP1 SWAP2 MSTORE PUSH1 0xE DUP2 MSTORE PUSH14 0x5061796D656E7473457363726F77 PUSH1 0x90 SHL PUSH1 0x20 DUP3 ADD MSTORE PUSH2 0x158 SWAP1 PUSH2 0x33B JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH1 0xE0 MSTORE PUSH1 0x40 DUP1 MLOAD DUP1 DUP3 ADD SWAP1 SWAP2 MSTORE PUSH1 0xC DUP2 MSTORE PUSH12 0x22B837B1B426B0B730B3B2B9 PUSH1 0xA1 SHL PUSH1 0x20 DUP3 ADD MSTORE PUSH2 0x190 SWAP1 PUSH2 0x33B JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH2 0x120 MSTORE PUSH1 0x40 DUP1 MLOAD DUP1 DUP3 ADD SWAP1 SWAP2 MSTORE PUSH1 0xE DUP2 MSTORE PUSH14 0x2932BBB0B93239A6B0B730B3B2B9 PUSH1 0x91 SHL PUSH1 0x20 DUP3 ADD MSTORE PUSH2 0x1CB SWAP1 PUSH2 0x33B JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH2 0x140 MSTORE PUSH1 0x40 DUP1 MLOAD DUP1 DUP3 ADD SWAP1 SWAP2 MSTORE PUSH1 0x11 DUP2 MSTORE PUSH17 0x4772617068546F6B656E47617465776179 PUSH1 0x78 SHL PUSH1 0x20 DUP3 ADD MSTORE PUSH2 0x209 SWAP1 PUSH2 0x33B JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH2 0x160 MSTORE PUSH1 0x40 DUP1 MLOAD DUP1 DUP3 ADD SWAP1 SWAP2 MSTORE PUSH1 0xF DUP2 MSTORE PUSH15 0x23B930B834283937BC3CA0B236B4B7 PUSH1 0x89 SHL PUSH1 0x20 DUP3 ADD MSTORE PUSH2 0x245 SWAP1 PUSH2 0x33B JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH2 0x180 MSTORE PUSH1 0x40 DUP1 MLOAD DUP1 DUP3 ADD SWAP1 SWAP2 MSTORE PUSH1 0x8 DUP2 MSTORE PUSH8 0x21BAB930BA34B7B7 PUSH1 0xC1 SHL PUSH1 0x20 DUP3 ADD MSTORE PUSH2 0x27A SWAP1 PUSH2 0x33B JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB SWAP1 DUP2 AND PUSH2 0x1A0 DUP2 SWAP1 MSTORE PUSH2 0x100 MLOAD PUSH1 0xA0 MLOAD PUSH1 0x80 MLOAD PUSH1 0xC0 MLOAD PUSH1 0xE0 MLOAD PUSH2 0x120 MLOAD PUSH2 0x140 MLOAD PUSH2 0x160 MLOAD PUSH2 0x180 MLOAD PUSH1 0x40 MLOAD SWAP9 DUP12 AND SWAP11 SWAP8 DUP9 AND SWAP10 SWAP7 SWAP1 SWAP8 AND SWAP8 PUSH32 0xEF5021414834D86E36470F5C1CECF6544FB2BB723F2CA51A4C86FCD8C5919A43 SWAP8 PUSH2 0x324 SWAP8 SWAP1 SWAP2 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB SWAP8 DUP9 AND DUP2 MSTORE SWAP6 DUP8 AND PUSH1 0x20 DUP8 ADD MSTORE SWAP4 DUP7 AND PUSH1 0x40 DUP7 ADD MSTORE SWAP2 DUP6 AND PUSH1 0x60 DUP6 ADD MSTORE DUP5 AND PUSH1 0x80 DUP5 ADD MSTORE DUP4 AND PUSH1 0xA0 DUP4 ADD MSTORE SWAP1 SWAP2 AND PUSH1 0xC0 DUP3 ADD MSTORE PUSH1 0xE0 ADD SWAP1 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG4 POP PUSH2 0x335 PUSH2 0x3E9 JUMP JUMPDEST POP PUSH2 0x519 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0x100 MLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0xF7641A5E DUP5 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD KECCAK256 PUSH1 0x40 MLOAD DUP3 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x376 SWAP2 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP7 GAS STATICCALL ISZERO DUP1 ISZERO PUSH2 0x393 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x3B7 SWAP2 SWAP1 PUSH2 0x49B JUMP JUMPDEST SWAP1 POP DUP3 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP3 AND PUSH2 0x3E2 JUMPI PUSH1 0x40 MLOAD PUSH4 0x218F5ADD PUSH1 0xE1 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x71 SWAP2 SWAP1 PUSH2 0x4CB JUMP JUMPDEST POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH32 0xF0C57E16840DF040F15088DC2F81FE391C3923BEC73E23A9662EFC9C229C6A00 DUP1 SLOAD PUSH9 0x10000000000000000 SWAP1 DIV PUSH1 0xFF AND ISZERO PUSH2 0x439 JUMPI PUSH1 0x40 MLOAD PUSH4 0xF92EE8A9 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST DUP1 SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB SWAP1 DUP2 AND EQ PUSH2 0x498 JUMPI DUP1 SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB NOT AND PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB SWAP1 DUP2 OR DUP3 SSTORE PUSH1 0x40 MLOAD SWAP1 DUP2 MSTORE PUSH32 0xC7F505B2F371AE2175EE4913F4499E1F2633A7B5936321EED1CDAEB6115181D2 SWAP1 PUSH1 0x20 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG1 JUMPDEST POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x4AD JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 MLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP2 AND DUP2 EQ PUSH2 0x4C4 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x20 DUP2 MSTORE PUSH1 0x0 DUP3 MLOAD DUP1 PUSH1 0x20 DUP5 ADD MSTORE PUSH1 0x0 JUMPDEST DUP2 DUP2 LT ISZERO PUSH2 0x4F9 JUMPI PUSH1 0x20 DUP2 DUP7 ADD DUP2 ADD MLOAD PUSH1 0x40 DUP7 DUP5 ADD ADD MSTORE ADD PUSH2 0x4DC JUMP JUMPDEST POP PUSH1 0x0 PUSH1 0x40 DUP3 DUP6 ADD ADD MSTORE PUSH1 0x40 PUSH1 0x1F NOT PUSH1 0x1F DUP4 ADD AND DUP5 ADD ADD SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x80 MLOAD PUSH1 0xA0 MLOAD PUSH1 0xC0 MLOAD PUSH1 0xE0 MLOAD PUSH2 0x100 MLOAD PUSH2 0x120 MLOAD PUSH2 0x140 MLOAD PUSH2 0x160 MLOAD PUSH2 0x180 MLOAD PUSH2 0x1A0 MLOAD PUSH2 0x35F2 PUSH2 0x57C PUSH1 0x0 CODECOPY PUSH1 0x0 POP POP PUSH1 0x0 POP POP PUSH1 0x0 POP POP PUSH1 0x0 POP POP PUSH1 0x0 POP POP PUSH1 0x0 POP POP PUSH1 0x0 POP POP PUSH1 0x0 POP POP PUSH1 0x0 PUSH2 0x1F23 ADD MSTORE PUSH1 0x0 PUSH2 0x19CC ADD MSTORE PUSH2 0x35F2 PUSH1 0x0 RETURN INVALID PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x4 CALLDATASIZE LT PUSH2 0x1A1 JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0x50B17AD EQ PUSH2 0x1A6 JUMPI DUP1 PUSH4 0x533E1BA EQ PUSH2 0x1BB JUMPI DUP1 PUSH4 0xBC7344B EQ PUSH2 0x1E8 JUMPI DUP1 PUSH4 0x11BE1997 EQ PUSH2 0x1FB JUMPI DUP1 PUSH4 0x16972978 EQ PUSH2 0x278 JUMPI DUP1 PUSH4 0x17337B46 EQ PUSH2 0x28B JUMPI DUP1 PUSH4 0x1792F194 EQ PUSH2 0x295 JUMPI DUP1 PUSH4 0x26058249 EQ PUSH2 0x2A8 JUMPI DUP1 PUSH4 0x29E03FF1 EQ PUSH2 0x2C8 JUMPI DUP1 PUSH4 0x36167E03 EQ PUSH2 0x2DF JUMPI DUP1 PUSH4 0x4BC5839A EQ PUSH2 0x2F2 JUMPI DUP1 PUSH4 0x5AEA0EC4 EQ PUSH2 0x305 JUMPI DUP1 PUSH4 0x5BF31D4D EQ PUSH2 0x326 JUMPI DUP1 PUSH4 0x6369DF6B EQ PUSH2 0x340 JUMPI DUP1 PUSH4 0x6CC6CDE1 EQ PUSH2 0x353 JUMPI DUP1 PUSH4 0x715018A6 EQ PUSH2 0x366 JUMPI DUP1 PUSH4 0x76C993AE EQ PUSH2 0x36E JUMPI DUP1 PUSH4 0x8D4E9008 EQ PUSH2 0x381 JUMPI DUP1 PUSH4 0x8DA5CB5B EQ PUSH2 0x394 JUMPI DUP1 PUSH4 0x902A4938 EQ PUSH2 0x39C JUMPI DUP1 PUSH4 0x9334EA52 EQ PUSH2 0x3AC JUMPI DUP1 PUSH4 0x93A90A1E EQ PUSH2 0x3BF JUMPI DUP1 PUSH4 0x9F81A7CF EQ PUSH2 0x3D2 JUMPI DUP1 PUSH4 0xB0E2F7E9 EQ PUSH2 0x3E5 JUMPI DUP1 PUSH4 0xB0EEFABE EQ PUSH2 0x3F8 JUMPI DUP1 PUSH4 0xBB2A2B47 EQ PUSH2 0x40B JUMPI DUP1 PUSH4 0xBE41F384 EQ PUSH2 0x419 JUMPI DUP1 PUSH4 0xC133B429 EQ PUSH2 0x43C JUMPI DUP1 PUSH4 0xC50A77B1 EQ PUSH2 0x44F JUMPI DUP1 PUSH4 0xC894222E EQ PUSH2 0x462 JUMPI DUP1 PUSH4 0xC9747F51 EQ PUSH2 0x483 JUMPI DUP1 PUSH4 0xCC2D55CD EQ PUSH2 0x496 JUMPI DUP1 PUSH4 0xD36FC9D4 EQ PUSH2 0x4A5 JUMPI DUP1 PUSH4 0xD76F62D1 EQ PUSH2 0x4B8 JUMPI DUP1 PUSH4 0xF2FDE38B EQ PUSH2 0x4CB JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1B9 PUSH2 0x1B4 CALLDATASIZE PUSH1 0x4 PUSH2 0x2C8A JUMP JUMPDEST PUSH2 0x4DE JUMP JUMPDEST STOP JUMPDEST PUSH1 0x36 SLOAD PUSH2 0x1D2 SWAP1 PUSH1 0x1 PUSH1 0x20 SHL SWAP1 DIV PUSH4 0xFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1DF SWAP2 SWAP1 PUSH2 0x2CAC JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH2 0x1B9 PUSH2 0x1F6 CALLDATASIZE PUSH1 0x4 PUSH2 0x2CF9 JUMP JUMPDEST PUSH2 0x5FC JUMP JUMPDEST PUSH2 0x263 PUSH2 0x209 CALLDATASIZE PUSH1 0x4 PUSH2 0x2D72 JUMP JUMPDEST PUSH1 0x37 PUSH1 0x20 MSTORE PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP1 KECCAK256 DUP1 SLOAD PUSH1 0x1 DUP3 ADD SLOAD PUSH1 0x2 DUP4 ADD SLOAD PUSH1 0x3 DUP5 ADD SLOAD PUSH1 0x4 DUP6 ADD SLOAD PUSH1 0x5 DUP7 ADD SLOAD PUSH1 0x6 DUP8 ADD SLOAD PUSH1 0x7 SWAP1 SWAP8 ADD SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB SWAP7 DUP8 AND SWAP8 SWAP7 SWAP1 SWAP6 AND SWAP6 SWAP4 SWAP5 SWAP3 SWAP4 PUSH1 0xFF DUP1 DUP5 AND SWAP5 PUSH2 0x100 SWAP1 SWAP5 DIV AND SWAP3 DUP10 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1DF SWAP10 SWAP9 SWAP8 SWAP7 SWAP6 SWAP5 SWAP4 SWAP3 SWAP2 SWAP1 PUSH2 0x2DB5 JUMP JUMPDEST PUSH2 0x1B9 PUSH2 0x286 CALLDATASIZE PUSH1 0x4 PUSH2 0x2D72 JUMP JUMPDEST PUSH2 0x734 JUMP JUMPDEST PUSH2 0x1D2 PUSH3 0x7A120 DUP2 JUMP JUMPDEST PUSH2 0x1B9 PUSH2 0x2A3 CALLDATASIZE PUSH1 0x4 PUSH2 0x2D72 JUMP JUMPDEST PUSH2 0x748 JUMP JUMPDEST PUSH1 0x33 SLOAD PUSH2 0x2BB SWAP1 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND DUP2 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1DF SWAP2 SWAP1 PUSH2 0x2E20 JUMP JUMPDEST PUSH2 0x2D1 PUSH1 0x35 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x40 MLOAD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH2 0x1DF JUMP JUMPDEST PUSH2 0x1B9 PUSH2 0x2ED CALLDATASIZE PUSH1 0x4 PUSH2 0x2D72 JUMP JUMPDEST PUSH2 0x8A8 JUMP JUMPDEST PUSH2 0x2D1 PUSH2 0x300 CALLDATASIZE PUSH1 0x4 PUSH2 0x2E34 JUMP JUMPDEST PUSH2 0x9AE JUMP JUMPDEST PUSH1 0x34 SLOAD PUSH1 0x1 PUSH1 0xA0 SHL SWAP1 DIV PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB AND JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1DF SWAP2 SWAP1 PUSH2 0x2E60 JUMP JUMPDEST PUSH1 0x34 SLOAD PUSH2 0x319 SWAP1 PUSH1 0x1 PUSH1 0xA0 SHL SWAP1 DIV PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB AND DUP2 JUMP JUMPDEST PUSH2 0x2D1 PUSH2 0x34E CALLDATASIZE PUSH1 0x4 PUSH2 0x2E74 JUMP JUMPDEST PUSH2 0x9E6 JUMP JUMPDEST PUSH1 0x34 SLOAD PUSH2 0x2BB SWAP1 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND DUP2 JUMP JUMPDEST PUSH2 0x1B9 PUSH2 0x9FF JUMP JUMPDEST PUSH2 0x1B9 PUSH2 0x37C CALLDATASIZE PUSH1 0x4 PUSH2 0x2E8F JUMP JUMPDEST PUSH2 0xA13 JUMP JUMPDEST PUSH2 0x2D1 PUSH2 0x38F CALLDATASIZE PUSH1 0x4 PUSH2 0x2EAC JUMP JUMPDEST PUSH2 0xA24 JUMP JUMPDEST PUSH2 0x2BB PUSH2 0xDC5 JUMP JUMPDEST PUSH1 0x36 SLOAD PUSH2 0x1D2 SWAP1 PUSH4 0xFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH2 0x1B9 PUSH2 0x3BA CALLDATASIZE PUSH1 0x4 PUSH2 0x2D72 JUMP JUMPDEST PUSH2 0xDE0 JUMP JUMPDEST PUSH2 0x1B9 PUSH2 0x3CD CALLDATASIZE PUSH1 0x4 PUSH2 0x2EF2 JUMP JUMPDEST PUSH2 0xEDF JUMP JUMPDEST PUSH2 0x1B9 PUSH2 0x3E0 CALLDATASIZE PUSH1 0x4 PUSH2 0x2E8F JUMP JUMPDEST PUSH2 0xEF0 JUMP JUMPDEST PUSH2 0x1B9 PUSH2 0x3F3 CALLDATASIZE PUSH1 0x4 PUSH2 0x2F1D JUMP JUMPDEST PUSH2 0xF01 JUMP JUMPDEST PUSH2 0x1B9 PUSH2 0x406 CALLDATASIZE PUSH1 0x4 PUSH2 0x2EF2 JUMP JUMPDEST PUSH2 0x1062 JUMP JUMPDEST PUSH1 0x36 SLOAD PUSH4 0xFFFFFFFF AND PUSH2 0x1D2 JUMP JUMPDEST PUSH2 0x42C PUSH2 0x427 CALLDATASIZE PUSH1 0x4 PUSH2 0x2D72 JUMP JUMPDEST PUSH2 0x1073 JUMP JUMPDEST PUSH1 0x40 MLOAD SWAP1 ISZERO ISZERO DUP2 MSTORE PUSH1 0x20 ADD PUSH2 0x1DF JUMP JUMPDEST PUSH2 0x2D1 PUSH2 0x44A CALLDATASIZE PUSH1 0x4 PUSH2 0x2EF2 JUMP JUMPDEST PUSH2 0x10A9 JUMP JUMPDEST PUSH2 0x2D1 PUSH2 0x45D CALLDATASIZE PUSH1 0x4 PUSH2 0x2FA4 JUMP JUMPDEST PUSH2 0x1141 JUMP JUMPDEST PUSH2 0x475 PUSH2 0x470 CALLDATASIZE PUSH1 0x4 PUSH2 0x2FE5 JUMP JUMPDEST PUSH2 0x11D4 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1DF SWAP3 SWAP2 SWAP1 PUSH2 0x3054 JUMP JUMPDEST PUSH2 0x2BB PUSH2 0x491 CALLDATASIZE PUSH1 0x4 PUSH2 0x30FA JUMP JUMPDEST PUSH2 0x13E2 JUMP JUMPDEST PUSH2 0x2D1 PUSH8 0xDE0B6B3A7640000 DUP2 JUMP JUMPDEST PUSH2 0x42C PUSH2 0x4B3 CALLDATASIZE PUSH1 0x4 PUSH2 0x317C JUMP JUMPDEST PUSH2 0x14CD JUMP JUMPDEST PUSH2 0x1B9 PUSH2 0x4C6 CALLDATASIZE PUSH1 0x4 PUSH2 0x31B2 JUMP JUMPDEST PUSH2 0x14F5 JUMP JUMPDEST PUSH2 0x1B9 PUSH2 0x4D9 CALLDATASIZE PUSH1 0x4 PUSH2 0x2EF2 JUMP JUMPDEST PUSH2 0x1506 JUMP JUMPDEST PUSH1 0x34 SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND CALLER EQ PUSH2 0x509 JUMPI PUSH1 0x40 MLOAD PUSH4 0xA8BAF3BB PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST DUP2 PUSH2 0x513 DUP2 PUSH2 0x1073 JUMP JUMPDEST DUP2 SWAP1 PUSH2 0x53E JUMPI PUSH1 0x40 MLOAD PUSH4 0x14A03BBD PUSH1 0xE2 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x535 SWAP2 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST POP PUSH1 0x4 PUSH1 0x0 DUP3 DUP2 MSTORE PUSH1 0x37 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 PUSH1 0x4 ADD SLOAD PUSH2 0x100 SWAP1 DIV PUSH1 0xFF AND PUSH1 0x5 DUP2 GT ISZERO PUSH2 0x56C JUMPI PUSH2 0x56C PUSH2 0x2D8B JUMP JUMPDEST PUSH1 0x0 DUP4 DUP2 MSTORE PUSH1 0x37 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 PUSH1 0x4 ADD SLOAD PUSH2 0x100 SWAP1 DIV PUSH1 0xFF AND SWAP2 EQ PUSH2 0x5A6 JUMPI PUSH1 0x40 MLOAD PUSH4 0x146E540F PUSH1 0xE2 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x535 SWAP2 SWAP1 PUSH2 0x31CF JUMP JUMPDEST POP PUSH1 0x0 DUP4 DUP2 MSTORE PUSH1 0x37 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 PUSH1 0x3 ADD SLOAD DUP4 SWAP1 ISZERO PUSH2 0x5DC JUMPI PUSH1 0x40 MLOAD PUSH4 0x64D0C32B PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x535 SWAP2 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 JUMP JUMPDEST POP PUSH1 0x0 DUP4 DUP2 MSTORE PUSH1 0x37 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 PUSH2 0x5F6 DUP5 DUP3 DUP6 PUSH2 0x1541 JUMP JUMPDEST POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x606 PUSH2 0x15F2 JUMP JUMPDEST DUP1 SLOAD SWAP1 SWAP2 POP PUSH1 0xFF PUSH1 0x1 PUSH1 0x40 SHL DUP3 DIV AND ISZERO SWAP1 PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB AND PUSH1 0x0 DUP2 ISZERO DUP1 ISZERO PUSH2 0x62D JUMPI POP DUP3 JUMPDEST SWAP1 POP PUSH1 0x0 DUP3 PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB AND PUSH1 0x1 EQ DUP1 ISZERO PUSH2 0x649 JUMPI POP ADDRESS EXTCODESIZE ISZERO JUMPDEST SWAP1 POP DUP2 ISZERO DUP1 ISZERO PUSH2 0x657 JUMPI POP DUP1 ISZERO JUMPDEST ISZERO PUSH2 0x675 JUMPI PUSH1 0x40 MLOAD PUSH4 0xF92EE8A9 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST DUP5 SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB NOT AND PUSH1 0x1 OR DUP6 SSTORE DUP4 ISZERO PUSH2 0x69E JUMPI DUP5 SLOAD PUSH1 0xFF PUSH1 0x40 SHL NOT AND PUSH1 0x1 PUSH1 0x40 SHL OR DUP6 SSTORE JUMPDEST PUSH2 0x6A7 DUP12 PUSH2 0x161B JUMP JUMPDEST PUSH2 0x6AF PUSH2 0x162C JUMP JUMPDEST PUSH2 0x6B8 DUP11 PUSH2 0x163C JUMP JUMPDEST PUSH2 0x6C1 DUP10 PUSH2 0x16AD JUMP JUMPDEST PUSH2 0x6CA DUP9 PUSH2 0x1736 JUMP JUMPDEST PUSH2 0x6D3 DUP8 PUSH2 0x1799 JUMP JUMPDEST PUSH2 0x6DC DUP7 PUSH2 0x180B JUMP JUMPDEST DUP4 ISZERO PUSH2 0x727 JUMPI DUP5 SLOAD PUSH1 0xFF PUSH1 0x40 SHL NOT AND DUP6 SSTORE PUSH1 0x40 MLOAD PUSH32 0xC7F505B2F371AE2175EE4913F4499E1F2633A7B5936321EED1CDAEB6115181D2 SWAP1 PUSH2 0x71E SWAP1 PUSH1 0x1 SWAP1 PUSH2 0x2E60 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG1 JUMPDEST POP POP POP POP POP POP POP POP POP POP POP JUMP JUMPDEST PUSH2 0x73C PUSH2 0x1892 JUMP JUMPDEST PUSH2 0x745 DUP2 PUSH2 0x1736 JUMP JUMPDEST POP JUMP JUMPDEST DUP1 PUSH2 0x752 DUP2 PUSH2 0x1073 JUMP JUMPDEST DUP2 SWAP1 PUSH2 0x774 JUMPI PUSH1 0x40 MLOAD PUSH4 0x14A03BBD PUSH1 0xE2 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x535 SWAP2 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 JUMP JUMPDEST POP PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x37 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 PUSH1 0x1 ADD SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND CALLER EQ PUSH2 0x7AF JUMPI PUSH1 0x40 MLOAD PUSH4 0x82C0055 PUSH1 0xE4 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST DUP2 PUSH2 0x7B9 DUP2 PUSH2 0x1073 JUMP JUMPDEST DUP2 SWAP1 PUSH2 0x7DB JUMPI PUSH1 0x40 MLOAD PUSH4 0x14A03BBD PUSH1 0xE2 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x535 SWAP2 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 JUMP JUMPDEST POP PUSH1 0x4 PUSH1 0x0 DUP3 DUP2 MSTORE PUSH1 0x37 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 PUSH1 0x4 ADD SLOAD PUSH2 0x100 SWAP1 DIV PUSH1 0xFF AND PUSH1 0x5 DUP2 GT ISZERO PUSH2 0x809 JUMPI PUSH2 0x809 PUSH2 0x2D8B JUMP JUMPDEST PUSH1 0x0 DUP4 DUP2 MSTORE PUSH1 0x37 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 PUSH1 0x4 ADD SLOAD PUSH2 0x100 SWAP1 DIV PUSH1 0xFF AND SWAP2 EQ PUSH2 0x843 JUMPI PUSH1 0x40 MLOAD PUSH4 0x146E540F PUSH1 0xE2 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x535 SWAP2 SWAP1 PUSH2 0x31CF JUMP JUMPDEST POP PUSH1 0x0 DUP4 DUP2 MSTORE PUSH1 0x37 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 PUSH1 0x6 DUP2 ADD SLOAD TIMESTAMP LT ISZERO PUSH2 0x877 JUMPI PUSH1 0x40 MLOAD PUSH4 0x1D7753D5 PUSH1 0xE1 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH2 0x881 DUP5 DUP3 PUSH2 0x18C4 JUMP JUMPDEST PUSH1 0x3 DUP2 ADD SLOAD ISZERO PUSH2 0x5F6 JUMPI PUSH1 0x3 DUP2 ADD SLOAD PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x37 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 PUSH2 0x5F6 SWAP2 SWAP1 PUSH2 0x18C4 JUMP JUMPDEST PUSH1 0x34 SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND CALLER EQ PUSH2 0x8D3 JUMPI PUSH1 0x40 MLOAD PUSH4 0xA8BAF3BB PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST DUP1 PUSH2 0x8DD DUP2 PUSH2 0x1073 JUMP JUMPDEST DUP2 SWAP1 PUSH2 0x8FF JUMPI PUSH1 0x40 MLOAD PUSH4 0x14A03BBD PUSH1 0xE2 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x535 SWAP2 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 JUMP JUMPDEST POP PUSH1 0x4 PUSH1 0x0 DUP3 DUP2 MSTORE PUSH1 0x37 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 PUSH1 0x4 ADD SLOAD PUSH2 0x100 SWAP1 DIV PUSH1 0xFF AND PUSH1 0x5 DUP2 GT ISZERO PUSH2 0x92D JUMPI PUSH2 0x92D PUSH2 0x2D8B JUMP JUMPDEST PUSH1 0x0 DUP4 DUP2 MSTORE PUSH1 0x37 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 PUSH1 0x4 ADD SLOAD PUSH2 0x100 SWAP1 DIV PUSH1 0xFF AND SWAP2 EQ PUSH2 0x967 JUMPI PUSH1 0x40 MLOAD PUSH4 0x146E540F PUSH1 0xE2 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x535 SWAP2 SWAP1 PUSH2 0x31CF JUMP JUMPDEST POP PUSH1 0x0 DUP3 DUP2 MSTORE PUSH1 0x37 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 PUSH1 0x3 DUP2 ADD SLOAD DUP4 SWAP1 ISZERO PUSH2 0x99E JUMPI PUSH1 0x40 MLOAD PUSH4 0x64D0C32B PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x535 SWAP2 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 JUMP JUMPDEST POP PUSH2 0x9A9 DUP4 DUP3 PUSH2 0x194B JUMP JUMPDEST POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x9CF CALLER PUSH1 0x35 SLOAD PUSH2 0x9BF PUSH2 0x19CA JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND SWAP2 SWAP1 PUSH2 0x19EE JUMP JUMPDEST PUSH2 0x9DD CALLER PUSH1 0x35 SLOAD DUP6 DUP6 PUSH2 0x1AA6 JUMP JUMPDEST SWAP1 POP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x9E0 PUSH2 0x9FA CALLDATASIZE DUP5 SWAP1 SUB DUP5 ADD DUP5 PUSH2 0x31DD JUMP JUMPDEST PUSH2 0x1E28 JUMP JUMPDEST PUSH2 0xA07 PUSH2 0x1892 JUMP JUMPDEST PUSH2 0xA11 PUSH1 0x0 PUSH2 0x1EC5 JUMP JUMPDEST JUMP JUMPDEST PUSH2 0xA1B PUSH2 0x1892 JUMP JUMPDEST PUSH2 0x745 DUP2 PUSH2 0x1799 JUMP JUMPDEST PUSH1 0x34 SLOAD PUSH1 0x0 SWAP1 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND CALLER EQ PUSH2 0xA52 JUMPI PUSH1 0x40 MLOAD PUSH4 0xA8BAF3BB PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x40 MLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0x60 SHL SUB NOT PUSH1 0x60 DUP8 SWAP1 SHL AND PUSH1 0x20 DUP3 ADD MSTORE PUSH6 0x6C6567616379 PUSH1 0xD0 SHL PUSH1 0x34 DUP3 ADD MSTORE PUSH1 0x0 SWAP1 PUSH1 0x3A ADD PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 DUP4 SUB SUB DUP2 MSTORE SWAP1 PUSH1 0x40 MSTORE DUP1 MLOAD SWAP1 PUSH1 0x20 ADD KECCAK256 SWAP1 POP PUSH1 0x0 PUSH2 0xAA0 PUSH2 0x1F21 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0xE022923 DUP9 PUSH1 0x40 MLOAD DUP3 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xACB SWAP2 SWAP1 PUSH2 0x2E20 JUMP JUMPDEST PUSH2 0x120 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP7 GAS STATICCALL ISZERO DUP1 ISZERO PUSH2 0xAE9 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0xB0D SWAP2 SWAP1 PUSH2 0x32D9 JUMP JUMPDEST MLOAD SWAP1 POP DUP7 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP3 AND PUSH2 0xB39 JUMPI PUSH1 0x40 MLOAD PUSH4 0x34789D8B PUSH1 0xE2 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x535 SWAP2 SWAP1 PUSH2 0x2E20 JUMP JUMPDEST POP PUSH1 0x40 DUP1 MLOAD PUSH2 0x120 DUP2 ADD DUP3 MSTORE PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP4 DUP2 AND DUP3 MSTORE DUP9 AND PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x0 SWAP2 DUP2 ADD DUP3 SWAP1 MSTORE PUSH1 0x60 DUP2 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH1 0x3 PUSH1 0x80 DUP3 ADD MSTORE PUSH1 0x1 PUSH1 0xA0 DUP3 ADD MSTORE TIMESTAMP PUSH1 0xC0 DUP3 ADD DUP2 SWAP1 MSTORE PUSH1 0x34 SLOAD PUSH1 0xE0 DUP4 ADD SWAP2 PUSH2 0xBA1 SWAP2 PUSH1 0x1 PUSH1 0xA0 SHL SWAP1 DIV PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB AND SWAP1 PUSH2 0x330C JUMP JUMPDEST DUP2 MSTORE PUSH1 0x0 PUSH1 0x20 SWAP2 DUP3 ADD DUP2 SWAP1 MSTORE DUP5 DUP2 MSTORE PUSH1 0x37 DUP3 MSTORE PUSH1 0x40 SWAP1 DUP2 SWAP1 KECCAK256 DUP4 MLOAD DUP2 SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB SWAP2 DUP3 AND PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB NOT SWAP2 DUP3 AND OR DUP4 SSTORE SWAP4 DUP6 ADD MLOAD PUSH1 0x1 DUP1 DUP5 ADD DUP1 SLOAD SWAP3 SWAP1 SWAP4 AND SWAP2 SWAP1 SWAP6 AND OR SWAP1 SSTORE SWAP1 DUP4 ADD MLOAD PUSH1 0x2 DUP3 ADD SSTORE PUSH1 0x60 DUP4 ADD MLOAD PUSH1 0x3 DUP1 DUP4 ADD SWAP2 SWAP1 SWAP2 SSTORE PUSH1 0x80 DUP5 ADD MLOAD PUSH1 0x4 DUP4 ADD DUP1 SLOAD SWAP4 SWAP5 SWAP2 SWAP4 SWAP1 SWAP3 PUSH1 0xFF NOT SWAP1 SWAP2 AND SWAP2 SWAP1 DUP5 SWAP1 DUP2 GT ISZERO PUSH2 0xC2F JUMPI PUSH2 0xC2F PUSH2 0x2D8B JUMP JUMPDEST MUL OR SWAP1 SSTORE POP PUSH1 0xA0 DUP3 ADD MLOAD PUSH1 0x4 DUP3 ADD DUP1 SLOAD PUSH2 0xFF00 NOT AND PUSH2 0x100 DUP4 PUSH1 0x5 DUP2 GT ISZERO PUSH2 0xC59 JUMPI PUSH2 0xC59 PUSH2 0x2D8B JUMP JUMPDEST MUL OR SWAP1 SSTORE POP PUSH1 0xC0 DUP3 ADD MLOAD PUSH1 0x5 DUP3 ADD SSTORE PUSH1 0xE0 DUP3 ADD MLOAD PUSH1 0x6 DUP3 ADD SSTORE PUSH2 0x100 SWAP1 SWAP2 ADD MLOAD PUSH1 0x7 SWAP1 SWAP2 ADD SSTORE PUSH1 0x0 PUSH2 0xC89 PUSH2 0x1F45 JUMP JUMPDEST SWAP1 POP DUP1 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0xCB8347FE DUP4 DUP9 DUP9 PUSH1 0x40 MLOAD PUSH1 0x20 ADD PUSH2 0xCAE SWAP3 SWAP2 SWAP1 PUSH2 0x3054 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 DUP4 SUB SUB DUP2 MSTORE SWAP1 PUSH1 0x40 MSTORE PUSH1 0x40 MLOAD DUP4 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xCDA SWAP3 SWAP2 SWAP1 PUSH2 0x3365 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0xCF4 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0xD08 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH2 0xD29 DUP8 DUP7 PUSH2 0xD19 PUSH2 0x19CA JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND SWAP2 SWAP1 PUSH2 0x1F81 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP11 DUP2 AND DUP3 MSTORE PUSH1 0x20 DUP3 ADD DUP10 SWAP1 MSTORE SWAP2 DUP2 ADD DUP8 SWAP1 MSTORE DUP2 DUP10 AND SWAP2 DUP5 AND SWAP1 DUP6 SWAP1 PUSH32 0x587A1FC7E80E653A2AB7F63F98C080F5818B8CEDCFD1374590C8C786290ED031 SWAP1 PUSH1 0x60 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG4 DUP7 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND DUP3 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND DUP5 PUSH1 0x0 DUP1 MLOAD PUSH1 0x20 PUSH2 0x359D DUP4 CODECOPY DUP2 MLOAD SWAP2 MSTORE DUP9 PUSH1 0x40 MLOAD PUSH2 0xDB1 SWAP2 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG4 POP SWAP1 SWAP7 SWAP6 POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0xDD0 PUSH2 0x1FBC JUMP JUMPDEST SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x34 SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND CALLER EQ PUSH2 0xE0B JUMPI PUSH1 0x40 MLOAD PUSH4 0xA8BAF3BB PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST DUP1 PUSH2 0xE15 DUP2 PUSH2 0x1073 JUMP JUMPDEST DUP2 SWAP1 PUSH2 0xE37 JUMPI PUSH1 0x40 MLOAD PUSH4 0x14A03BBD PUSH1 0xE2 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x535 SWAP2 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 JUMP JUMPDEST POP PUSH1 0x4 PUSH1 0x0 DUP3 DUP2 MSTORE PUSH1 0x37 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 PUSH1 0x4 ADD SLOAD PUSH2 0x100 SWAP1 DIV PUSH1 0xFF AND PUSH1 0x5 DUP2 GT ISZERO PUSH2 0xE65 JUMPI PUSH2 0xE65 PUSH2 0x2D8B JUMP JUMPDEST PUSH1 0x0 DUP4 DUP2 MSTORE PUSH1 0x37 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 PUSH1 0x4 ADD SLOAD PUSH2 0x100 SWAP1 DIV PUSH1 0xFF AND SWAP2 EQ PUSH2 0xE9F JUMPI PUSH1 0x40 MLOAD PUSH4 0x146E540F PUSH1 0xE2 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x535 SWAP2 SWAP1 PUSH2 0x31CF JUMP JUMPDEST POP PUSH1 0x0 DUP3 DUP2 MSTORE PUSH1 0x37 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 PUSH2 0xEB8 DUP4 DUP3 PUSH2 0x1FE0 JUMP JUMPDEST PUSH1 0x3 DUP2 ADD SLOAD ISZERO PUSH2 0x9A9 JUMPI PUSH1 0x3 DUP2 ADD SLOAD PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x37 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 PUSH2 0x9A9 SWAP2 SWAP1 PUSH2 0x1FE0 JUMP JUMPDEST PUSH2 0xEE7 PUSH2 0x1892 JUMP JUMPDEST PUSH2 0x745 DUP2 PUSH2 0x205F JUMP JUMPDEST PUSH2 0xEF8 PUSH2 0x1892 JUMP JUMPDEST PUSH2 0x745 DUP2 PUSH2 0x180B JUMP JUMPDEST PUSH1 0x34 SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND CALLER EQ PUSH2 0xF2C JUMPI PUSH1 0x40 MLOAD PUSH4 0xA8BAF3BB PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST DUP4 PUSH2 0xF36 DUP2 PUSH2 0x1073 JUMP JUMPDEST DUP2 SWAP1 PUSH2 0xF58 JUMPI PUSH1 0x40 MLOAD PUSH4 0x14A03BBD PUSH1 0xE2 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x535 SWAP2 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 JUMP JUMPDEST POP PUSH1 0x4 PUSH1 0x0 DUP3 DUP2 MSTORE PUSH1 0x37 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 PUSH1 0x4 ADD SLOAD PUSH2 0x100 SWAP1 DIV PUSH1 0xFF AND PUSH1 0x5 DUP2 GT ISZERO PUSH2 0xF86 JUMPI PUSH2 0xF86 PUSH2 0x2D8B JUMP JUMPDEST PUSH1 0x0 DUP4 DUP2 MSTORE PUSH1 0x37 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 PUSH1 0x4 ADD SLOAD PUSH2 0x100 SWAP1 DIV PUSH1 0xFF AND SWAP2 EQ PUSH2 0xFC0 JUMPI PUSH1 0x40 MLOAD PUSH4 0x146E540F PUSH1 0xE2 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x535 SWAP2 SWAP1 PUSH2 0x31CF JUMP JUMPDEST POP PUSH1 0x0 DUP6 DUP2 MSTORE PUSH1 0x37 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 PUSH1 0x3 ADD SLOAD ISZERO ISZERO DUP6 SWAP1 PUSH2 0xFFA JUMPI PUSH1 0x40 MLOAD PUSH1 0x1 PUSH3 0xD62C07 PUSH1 0xE0 SHL SUB NOT DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x535 SWAP2 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 JUMP JUMPDEST POP PUSH1 0x0 DUP6 DUP2 MSTORE PUSH1 0x37 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 PUSH2 0x1014 DUP7 DUP3 DUP8 PUSH2 0x1541 JUMP JUMPDEST DUP4 ISZERO PUSH2 0x103D JUMPI PUSH1 0x3 DUP2 ADD SLOAD PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x37 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 PUSH2 0x1038 SWAP2 SWAP1 DUP6 PUSH2 0x1541 JUMP JUMPDEST PUSH2 0x105A JUMP JUMPDEST PUSH1 0x3 DUP2 ADD SLOAD PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x37 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 PUSH2 0x105A SWAP2 SWAP1 PUSH2 0x1FE0 JUMP JUMPDEST POP POP POP POP POP POP JUMP JUMPDEST PUSH2 0x106A PUSH2 0x1892 JUMP JUMPDEST PUSH2 0x745 DUP2 PUSH2 0x163C JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP4 DUP2 MSTORE PUSH1 0x37 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 PUSH1 0x4 ADD SLOAD PUSH2 0x100 SWAP1 DIV PUSH1 0xFF AND PUSH1 0x5 DUP2 GT ISZERO PUSH2 0x10A1 JUMPI PUSH2 0x10A1 PUSH2 0x2D8B JUMP JUMPDEST EQ ISZERO SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0x10B4 PUSH2 0x1F21 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0x25D9897E DUP5 PUSH2 0x10CB PUSH2 0x1F45 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP4 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x10E8 SWAP3 SWAP2 SWAP1 PUSH2 0x3389 JUMP JUMPDEST PUSH2 0x140 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP7 GAS STATICCALL ISZERO DUP1 ISZERO PUSH2 0x1106 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x112A SWAP2 SWAP1 PUSH2 0x33B9 JUMP JUMPDEST SWAP1 POP PUSH2 0x113A DUP4 DUP3 PUSH1 0x0 ADD MLOAD PUSH2 0x20D0 JUMP JUMPDEST SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x1152 CALLER PUSH1 0x35 SLOAD PUSH2 0x9BF PUSH2 0x19CA JUMP JUMPDEST PUSH2 0x9DD CALLER PUSH1 0x35 SLOAD PUSH2 0x1198 DUP7 DUP7 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY PUSH1 0x0 SWAP3 ADD SWAP2 SWAP1 SWAP2 MSTORE POP PUSH2 0x2165 SWAP3 POP POP POP JUMP JUMPDEST DUP7 DUP7 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY PUSH1 0x0 SWAP3 ADD SWAP2 SWAP1 SWAP2 MSTORE POP PUSH2 0x22A5 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 CALLER SWAP1 POP PUSH1 0x0 PUSH2 0x121D DUP9 DUP9 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY PUSH1 0x0 SWAP3 ADD SWAP2 SWAP1 SWAP2 MSTORE POP PUSH2 0x2165 SWAP3 POP POP POP JUMP JUMPDEST SWAP1 POP PUSH1 0x0 PUSH2 0x1260 DUP8 DUP8 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY PUSH1 0x0 SWAP3 ADD SWAP2 SWAP1 SWAP2 MSTORE POP PUSH2 0x2165 SWAP3 POP POP POP JUMP JUMPDEST SWAP1 POP PUSH2 0x126C DUP3 DUP3 PUSH2 0x25A4 JUMP JUMPDEST DUP3 MLOAD PUSH1 0x20 DUP1 DUP6 ADD MLOAD PUSH1 0x40 DUP1 DUP8 ADD MLOAD DUP7 MLOAD SWAP4 DUP8 ADD MLOAD SWAP2 DUP8 ADD MLOAD SWAP5 SWAP6 SWAP3 SWAP5 SWAP1 SWAP4 SWAP3 PUSH2 0x12CB JUMPI PUSH1 0x40 MLOAD PUSH4 0x6ABA5297 PUSH1 0xE1 SHL DUP2 MSTORE PUSH1 0x4 DUP2 ADD SWAP7 SWAP1 SWAP7 MSTORE PUSH1 0x24 DUP7 ADD SWAP5 SWAP1 SWAP5 MSTORE PUSH1 0x44 DUP6 ADD SWAP3 SWAP1 SWAP3 MSTORE PUSH1 0x64 DUP5 ADD MSTORE PUSH1 0x84 DUP4 ADD MSTORE PUSH1 0xA4 DUP3 ADD MSTORE PUSH1 0xC4 ADD PUSH2 0x535 JUMP JUMPDEST POP POP POP POP POP POP PUSH2 0x12E0 CALLER PUSH1 0x35 SLOAD PUSH2 0x9BF PUSH2 0x19CA JUMP JUMPDEST PUSH1 0x0 PUSH2 0x1332 DUP5 PUSH1 0x2 PUSH1 0x35 SLOAD PUSH2 0x12F5 SWAP2 SWAP1 PUSH2 0x3466 JUMP JUMPDEST DUP6 DUP14 DUP14 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY PUSH1 0x0 SWAP3 ADD SWAP2 SWAP1 SWAP2 MSTORE POP PUSH2 0x22A5 SWAP3 POP POP POP JUMP JUMPDEST SWAP1 POP PUSH1 0x0 PUSH2 0x1386 DUP6 PUSH1 0x2 PUSH1 0x35 SLOAD PUSH2 0x1349 SWAP2 SWAP1 PUSH2 0x3466 JUMP JUMPDEST DUP6 DUP13 DUP13 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY PUSH1 0x0 SWAP3 ADD SWAP2 SWAP1 SWAP2 MSTORE POP PUSH2 0x22A5 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP4 DUP2 MSTORE PUSH1 0x37 PUSH1 0x20 MSTORE PUSH1 0x40 DUP1 DUP3 KECCAK256 PUSH1 0x3 SWAP1 DUP2 ADD DUP5 SWAP1 SSTORE DUP4 DUP4 MSTORE DUP2 DUP4 KECCAK256 ADD DUP6 SWAP1 SSTORE MLOAD SWAP2 SWAP3 POP DUP3 SWAP2 DUP5 SWAP2 PUSH32 0xFEC135A4CF8E5C6E13DEA23BE058BF03A8BF8F1F6FB0A021B0A5AEDDFBA81407 SWAP2 LOG3 SWAP1 SWAP11 SWAP1 SWAP10 POP SWAP8 POP POP POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0x13EE DUP4 PUSH2 0x25D5 JUMP JUMPDEST SWAP1 POP PUSH1 0x0 PUSH2 0x13FA PUSH2 0x1F45 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0xE022923 DUP4 PUSH1 0x40 MLOAD DUP3 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x1425 SWAP2 SWAP1 PUSH2 0x2E20 JUMP JUMPDEST PUSH2 0x120 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP7 GAS STATICCALL ISZERO DUP1 ISZERO PUSH2 0x1443 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x1467 SWAP2 SWAP1 PUSH2 0x32D9 JUMP JUMPDEST DUP1 MLOAD SWAP1 SWAP2 POP DUP3 SWAP1 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH2 0x1495 JUMPI PUSH1 0x40 MLOAD PUSH4 0x34789D8B PUSH1 0xE2 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x535 SWAP2 SWAP1 PUSH2 0x2E20 JUMP JUMPDEST POP PUSH1 0x40 DUP5 ADD MLOAD PUSH1 0x20 DUP3 ADD MLOAD SWAP1 DUP2 DUP2 EQ PUSH2 0x14C3 JUMPI PUSH1 0x40 MLOAD PUSH4 0xA24CFE5 PUSH1 0xE2 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x535 SWAP3 SWAP2 SWAP1 PUSH2 0x3054 JUMP JUMPDEST POP POP MLOAD SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x9DD PUSH2 0x14E1 CALLDATASIZE DUP6 SWAP1 SUB DUP6 ADD DUP6 PUSH2 0x30FA JUMP JUMPDEST PUSH2 0x14F0 CALLDATASIZE DUP6 SWAP1 SUB DUP6 ADD DUP6 PUSH2 0x30FA JUMP JUMPDEST PUSH2 0x25A4 JUMP JUMPDEST PUSH2 0x14FD PUSH2 0x1892 JUMP JUMPDEST PUSH2 0x745 DUP2 PUSH2 0x16AD JUMP JUMPDEST PUSH2 0x150E PUSH2 0x1892 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP2 AND PUSH2 0x1538 JUMPI PUSH1 0x0 PUSH1 0x40 MLOAD PUSH4 0x1E4FBDF7 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x535 SWAP2 SWAP1 PUSH2 0x2E20 JUMP JUMPDEST PUSH2 0x745 DUP2 PUSH2 0x1EC5 JUMP JUMPDEST DUP2 SLOAD PUSH1 0x7 DUP4 ADD SLOAD PUSH1 0x0 SWAP2 PUSH2 0x1562 SWAP2 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB SWAP1 SWAP2 AND SWAP1 DUP5 SWAP1 PUSH2 0x265E JUMP JUMPDEST PUSH1 0x4 DUP5 ADD DUP1 SLOAD PUSH2 0xFF00 NOT AND PUSH2 0x100 OR SWAP1 SSTORE PUSH1 0x1 DUP5 ADD SLOAD PUSH1 0x2 DUP6 ADD SLOAD SWAP2 SWAP3 POP PUSH2 0x15A2 SWAP2 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB SWAP1 SWAP2 AND SWAP1 PUSH2 0x159A SWAP1 DUP5 PUSH2 0x330C JUMP JUMPDEST PUSH2 0xD19 PUSH2 0x19CA JUMP JUMPDEST PUSH1 0x1 DUP4 ADD SLOAD DUP4 SLOAD PUSH1 0x2 DUP6 ADD SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB SWAP3 DUP4 AND SWAP3 SWAP1 SWAP2 AND SWAP1 DUP7 SWAP1 PUSH1 0x0 DUP1 MLOAD PUSH1 0x20 PUSH2 0x359D DUP4 CODECOPY DUP2 MLOAD SWAP2 MSTORE SWAP1 PUSH2 0x15DB SWAP1 DUP7 SWAP1 PUSH2 0x330C JUMP JUMPDEST PUSH1 0x40 MLOAD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG4 POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH32 0xF0C57E16840DF040F15088DC2F81FE391C3923BEC73E23A9662EFC9C229C6A00 PUSH2 0x9E0 JUMP JUMPDEST PUSH2 0x1623 PUSH2 0x280F JUMP JUMPDEST PUSH2 0x745 DUP2 PUSH2 0x2834 JUMP JUMPDEST PUSH2 0x1634 PUSH2 0x280F JUMP JUMPDEST PUSH2 0xA11 PUSH2 0x283C JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP2 AND PUSH2 0x1663 JUMPI PUSH1 0x40 MLOAD PUSH4 0x616BC441 PUSH1 0xE1 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x34 DUP1 SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB NOT AND PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP4 AND SWAP1 DUP2 OR SWAP1 SWAP2 SSTORE PUSH1 0x40 MLOAD PUSH32 0x51744122301B50E919F4E3D22ADF8C53ABC92195B8C667EDA98C6EF20375672E SWAP1 PUSH1 0x0 SWAP1 LOG2 POP JUMP JUMPDEST DUP1 PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB AND PUSH1 0x0 SUB PUSH2 0x16D7 JUMPI PUSH1 0x40 MLOAD PUSH4 0xC4411F11 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x34 DUP1 SLOAD PUSH1 0x1 PUSH1 0xA0 SHL PUSH1 0x1 PUSH1 0xE0 SHL SUB NOT AND PUSH1 0x1 PUSH1 0xA0 SHL PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP5 AND MUL OR SWAP1 SSTORE PUSH1 0x40 MLOAD PUSH32 0x310462A9BF49FFF4A57910EC647C77CBF8AAF2F13394554AC6CDF14FC68DB7E6 SWAP1 PUSH2 0x172B SWAP1 DUP4 SWAP1 PUSH2 0x2E60 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG1 POP JUMP JUMPDEST DUP1 PUSH8 0xDE0B6B3A7640000 DUP2 LT ISZERO PUSH2 0x1763 JUMPI PUSH1 0x40 MLOAD PUSH4 0x33F4E05 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x535 SWAP2 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 JUMP JUMPDEST POP PUSH1 0x35 DUP2 SWAP1 SSTORE PUSH1 0x40 MLOAD DUP2 DUP2 MSTORE PUSH32 0x97896B9DA0F97F36BF3011570BCFF930069299DE4B1E89C9CB44909841CAC2F8 SWAP1 PUSH1 0x20 ADD PUSH2 0x172B JUMP JUMPDEST DUP1 PUSH3 0x7A120 PUSH4 0xFFFFFFFF DUP3 AND GT ISZERO PUSH2 0x17C5 JUMPI PUSH1 0x40 MLOAD PUSH4 0x432E6643 PUSH1 0xE1 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x535 SWAP2 SWAP1 PUSH2 0x2CAC JUMP JUMPDEST POP PUSH1 0x36 DUP1 SLOAD PUSH4 0xFFFFFFFF NOT AND PUSH4 0xFFFFFFFF DUP4 AND OR SWAP1 SSTORE PUSH1 0x40 MLOAD PUSH32 0xC573DC0F869F6A1D0A74FC7712A63BAABCB5567131D2D98005E163924EDDCBAB SWAP1 PUSH2 0x172B SWAP1 DUP4 SWAP1 PUSH2 0x2CAC JUMP JUMPDEST DUP1 PUSH4 0xFFFFFFFF DUP2 AND PUSH3 0xF4240 LT ISZERO PUSH2 0x1837 JUMPI PUSH1 0x40 MLOAD PUSH4 0x4E9374FB PUSH1 0xE1 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x535 SWAP2 SWAP1 PUSH2 0x2CAC JUMP JUMPDEST POP PUSH1 0x36 DUP1 SLOAD PUSH4 0xFFFFFFFF PUSH1 0x20 SHL NOT AND PUSH1 0x1 PUSH1 0x20 SHL PUSH4 0xFFFFFFFF DUP5 DUP2 AND DUP3 MUL SWAP3 SWAP1 SWAP3 OR SWAP3 DUP4 SWAP1 SSTORE PUSH1 0x40 MLOAD PUSH32 0x7EFAF01BEC3CDA8D104163BB466D01D7E16F68848301C7EB0749CFA59D680502 SWAP4 PUSH2 0x172B SWAP4 SWAP3 SWAP1 DIV SWAP1 SWAP2 AND SWAP1 PUSH2 0x2CAC JUMP JUMPDEST CALLER PUSH2 0x189B PUSH2 0xDC5 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND EQ PUSH2 0xA11 JUMPI CALLER PUSH1 0x40 MLOAD PUSH4 0x118CDAA7 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x535 SWAP2 SWAP1 PUSH2 0x2E20 JUMP JUMPDEST PUSH1 0x4 DUP2 ADD DUP1 SLOAD PUSH2 0xFF00 NOT AND PUSH2 0x500 OR SWAP1 SSTORE PUSH1 0x1 DUP2 ADD SLOAD PUSH1 0x2 DUP3 ADD SLOAD PUSH2 0x18F5 SWAP2 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND SWAP1 PUSH2 0xD19 PUSH2 0x19CA JUMP JUMPDEST PUSH1 0x1 DUP2 ADD SLOAD DUP2 SLOAD PUSH1 0x2 DUP4 ADD SLOAD PUSH1 0x40 MLOAD SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB SWAP3 DUP4 AND SWAP3 SWAP1 SWAP2 AND SWAP1 DUP5 SWAP1 PUSH32 0x223103F8EB52E5F43A75655152ACD882A605D70DF57A5C0FEFD30F516B1756D2 SWAP1 PUSH1 0x20 ADD JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG4 POP POP JUMP JUMPDEST PUSH1 0x4 DUP2 ADD DUP1 SLOAD PUSH2 0xFF00 NOT AND PUSH2 0x200 OR SWAP1 SSTORE PUSH1 0x2 DUP2 ADD SLOAD PUSH2 0x197C SWAP1 PUSH2 0x196D PUSH2 0x19CA JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND SWAP1 PUSH2 0x290E JUMP JUMPDEST PUSH1 0x1 DUP2 ADD SLOAD DUP2 SLOAD PUSH1 0x2 DUP4 ADD SLOAD PUSH1 0x40 MLOAD SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB SWAP3 DUP4 AND SWAP3 SWAP1 SWAP2 AND SWAP1 DUP5 SWAP1 PUSH32 0x2226EBD23625A7938FB786DF2248BD171D2E6AD70CB2B654EA1BE830CA17224D SWAP1 PUSH1 0x20 ADD PUSH2 0x193F JUMP JUMPDEST PUSH32 0x0 SWAP1 JUMP JUMPDEST DUP1 ISZERO PUSH2 0x9A9 JUMPI PUSH1 0x40 MLOAD PUSH4 0x23B872DD PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP4 DUP2 AND PUSH1 0x4 DUP4 ADD MSTORE ADDRESS PUSH1 0x24 DUP4 ADD MSTORE PUSH1 0x44 DUP3 ADD DUP4 SWAP1 MSTORE DUP5 AND SWAP1 PUSH4 0x23B872DD SWAP1 PUSH1 0x64 ADD JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 GAS CALL ISZERO DUP1 ISZERO PUSH2 0x1A4A JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x1A6E SWAP2 SWAP1 PUSH2 0x3488 JUMP JUMPDEST PUSH2 0x9A9 JUMPI PUSH1 0x40 MLOAD PUSH3 0x461BCD PUSH1 0xE5 SHL DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x9 PUSH1 0x24 DUP3 ADD MSTORE PUSH9 0x10BA3930B739B332B9 PUSH1 0xB9 SHL PUSH1 0x44 DUP3 ADD MSTORE PUSH1 0x64 ADD PUSH2 0x535 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0x60 SHL SUB NOT PUSH1 0x60 DUP5 SWAP1 SHL AND PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x34 DUP2 ADD DUP3 SWAP1 MSTORE PUSH1 0x0 SWAP1 DUP2 SWAP1 PUSH1 0x54 ADD PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 DUP4 SUB SUB DUP2 MSTORE SWAP1 PUSH1 0x40 MSTORE DUP1 MLOAD SWAP1 PUSH1 0x20 ADD KECCAK256 SWAP1 POP PUSH2 0x1AED DUP2 PUSH2 0x1073 JUMP JUMPDEST ISZERO DUP2 SWAP1 PUSH2 0x1B10 JUMPI PUSH1 0x40 MLOAD PUSH4 0x124A23F1 PUSH1 0xE1 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x535 SWAP2 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 JUMP JUMPDEST POP PUSH1 0x0 PUSH2 0x1B1B PUSH2 0x1F45 JUMP JUMPDEST SWAP1 POP PUSH1 0x0 DUP2 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0xE022923 DUP8 PUSH1 0x40 MLOAD DUP3 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x1B4B SWAP2 SWAP1 PUSH2 0x2E20 JUMP JUMPDEST PUSH2 0x120 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP7 GAS STATICCALL ISZERO DUP1 ISZERO PUSH2 0x1B69 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x1B8D SWAP2 SWAP1 PUSH2 0x32D9 JUMP JUMPDEST DUP1 MLOAD SWAP1 SWAP2 POP DUP7 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP3 AND PUSH2 0x1BBB JUMPI PUSH1 0x40 MLOAD PUSH4 0x34789D8B PUSH1 0xE2 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x535 SWAP2 SWAP1 PUSH2 0x2E20 JUMP JUMPDEST POP PUSH1 0x0 PUSH2 0x1BC6 PUSH2 0x1F21 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0x25D9897E DUP4 DUP7 PUSH1 0x40 MLOAD DUP4 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x1BF3 SWAP3 SWAP2 SWAP1 PUSH2 0x3389 JUMP JUMPDEST PUSH2 0x140 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP7 GAS STATICCALL ISZERO DUP1 ISZERO PUSH2 0x1C11 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x1C35 SWAP2 SWAP1 PUSH2 0x33B9 JUMP JUMPDEST DUP1 MLOAD SWAP1 SWAP2 POP PUSH1 0x0 SUB PUSH2 0x1C5A JUMPI PUSH1 0x40 MLOAD PUSH4 0x307EFDB7 PUSH1 0xE1 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x1C6A DUP4 DUP4 PUSH1 0x0 ADD MLOAD PUSH2 0x20D0 JUMP JUMPDEST PUSH1 0x34 SLOAD SWAP1 SWAP2 POP PUSH1 0x0 SWAP1 PUSH2 0x1C8D SWAP1 PUSH1 0x1 PUSH1 0xA0 SHL SWAP1 DIV PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB AND TIMESTAMP PUSH2 0x330C JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH2 0x120 DUP2 ADD DUP3 MSTORE DUP8 MLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB SWAP1 DUP2 AND DUP3 MSTORE DUP16 AND PUSH1 0x20 DUP3 ADD MSTORE SWAP1 DUP2 ADD DUP14 SWAP1 MSTORE PUSH1 0x0 PUSH1 0x60 DUP3 ADD MSTORE SWAP1 SWAP2 POP PUSH1 0x80 DUP2 ADD PUSH1 0x1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x4 DUP2 MSTORE TIMESTAMP PUSH1 0x20 DUP1 DUP4 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH1 0x40 DUP1 DUP4 ADD DUP6 SWAP1 MSTORE PUSH1 0x60 SWAP3 DUP4 ADD DUP7 SWAP1 MSTORE PUSH1 0x0 DUP12 DUP2 MSTORE PUSH1 0x37 DUP4 MSTORE DUP2 SWAP1 KECCAK256 DUP5 MLOAD DUP2 SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB SWAP2 DUP3 AND PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB NOT SWAP2 DUP3 AND OR DUP4 SSTORE SWAP4 DUP7 ADD MLOAD PUSH1 0x1 DUP1 DUP5 ADD DUP1 SLOAD SWAP3 SWAP1 SWAP4 AND SWAP2 SWAP1 SWAP6 AND OR SWAP1 SSTORE SWAP1 DUP5 ADD MLOAD PUSH1 0x2 DUP3 ADD SSTORE SWAP2 DUP4 ADD MLOAD PUSH1 0x3 DUP1 DUP5 ADD SWAP2 SWAP1 SWAP2 SSTORE PUSH1 0x80 DUP5 ADD MLOAD PUSH1 0x4 DUP5 ADD DUP1 SLOAD SWAP2 SWAP4 SWAP1 SWAP3 PUSH1 0xFF NOT SWAP1 SWAP3 AND SWAP2 DUP5 SWAP1 DUP2 GT ISZERO PUSH2 0x1D64 JUMPI PUSH2 0x1D64 PUSH2 0x2D8B JUMP JUMPDEST MUL OR SWAP1 SSTORE POP PUSH1 0xA0 DUP3 ADD MLOAD PUSH1 0x4 DUP3 ADD DUP1 SLOAD PUSH2 0xFF00 NOT AND PUSH2 0x100 DUP4 PUSH1 0x5 DUP2 GT ISZERO PUSH2 0x1D8E JUMPI PUSH2 0x1D8E PUSH2 0x2D8B JUMP JUMPDEST MUL OR SWAP1 SSTORE POP PUSH1 0xC0 DUP3 ADD MLOAD PUSH1 0x5 DUP3 ADD SSTORE PUSH1 0xE0 DUP3 ADD MLOAD PUSH1 0x6 DUP3 ADD SSTORE PUSH2 0x100 SWAP1 SWAP2 ADD MLOAD PUSH1 0x7 SWAP1 SWAP2 ADD SSTORE DUP5 MLOAD PUSH1 0x40 DUP1 MLOAD DUP14 DUP2 MSTORE PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP14 DUP2 AND PUSH1 0x20 DUP4 ADD MSTORE SWAP2 DUP2 ADD DUP13 SWAP1 MSTORE PUSH1 0x60 DUP2 ADD DUP6 SWAP1 MSTORE PUSH1 0x80 DUP2 ADD DUP5 SWAP1 MSTORE DUP2 DUP16 AND SWAP3 SWAP1 SWAP2 AND SWAP1 DUP10 SWAP1 PUSH32 0x8A1ECCECCE948A912E2E195DE5960359755AEAC90AD88A3FDE55A77E1A73796B SWAP1 PUSH1 0xA0 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG4 POP SWAP5 SWAP11 SWAP10 POP POP POP POP POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 SLOAD DUP2 MLOAD PUSH1 0x20 DUP1 DUP5 ADD MLOAD PUSH1 0x40 SWAP5 DUP6 ADD MLOAD DUP6 MLOAD PUSH32 0x32DD026408194A0D7E54CC66A2AB6C856EFC55CFCD4DD258FDE5B1A55222BAA6 DUP2 DUP6 ADD MSTORE DUP1 DUP8 ADD SWAP5 SWAP1 SWAP5 MSTORE PUSH1 0x60 DUP5 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH1 0x80 DUP1 DUP5 ADD SWAP2 SWAP1 SWAP2 MSTORE DUP5 MLOAD DUP1 DUP5 SUB SWAP1 SWAP2 ADD DUP2 MSTORE PUSH1 0xA0 DUP4 ADD DUP6 MSTORE DUP1 MLOAD SWAP1 DUP3 ADD KECCAK256 PUSH2 0x1901 PUSH1 0xF0 SHL PUSH1 0xC0 DUP5 ADD MSTORE PUSH1 0xC2 DUP4 ADD SWAP4 SWAP1 SWAP4 MSTORE PUSH1 0xE2 DUP1 DUP4 ADD SWAP4 SWAP1 SWAP4 MSTORE DUP4 MLOAD DUP1 DUP4 SUB SWAP1 SWAP4 ADD DUP4 MSTORE PUSH2 0x102 SWAP1 SWAP2 ADD SWAP1 SWAP3 MSTORE DUP1 MLOAD SWAP2 ADD KECCAK256 SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x1ECF PUSH2 0x1FBC JUMP JUMPDEST DUP1 SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP5 DUP2 AND PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB NOT DUP4 AND DUP2 OR DUP5 SSTORE PUSH1 0x40 MLOAD SWAP4 SWAP5 POP SWAP2 AND SWAP2 DUP3 SWAP1 PUSH32 0x8BE0079C531659141344CD1FD0A4F28419497F9722A3DAAFE3B4186F6B6457E0 SWAP1 PUSH1 0x0 SWAP1 LOG3 POP POP POP JUMP JUMPDEST PUSH32 0x0 SWAP1 JUMP JUMPDEST PUSH1 0x33 SLOAD PUSH1 0x0 SWAP1 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH2 0x1F71 JUMPI PUSH1 0x40 MLOAD PUSH4 0xBD088B4F PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST POP PUSH1 0x33 SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND SWAP1 JUMP JUMPDEST DUP1 ISZERO PUSH2 0x9A9 JUMPI PUSH1 0x40 MLOAD PUSH4 0xA9059CBB PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP4 DUP2 AND PUSH1 0x4 DUP4 ADD MSTORE PUSH1 0x24 DUP3 ADD DUP4 SWAP1 MSTORE DUP5 AND SWAP1 PUSH4 0xA9059CBB SWAP1 PUSH1 0x44 ADD PUSH2 0x1A2B JUMP JUMPDEST PUSH32 0x9016D09D72D40FDAE2FD8CEAC6B6234C7706214FD39C1CD1E609A0528C199300 SWAP1 JUMP JUMPDEST PUSH1 0x4 DUP2 ADD DUP1 SLOAD PUSH2 0xFF00 NOT AND PUSH2 0x300 OR SWAP1 SSTORE PUSH1 0x1 DUP2 ADD SLOAD PUSH1 0x2 DUP3 ADD SLOAD PUSH2 0x2011 SWAP2 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND SWAP1 PUSH2 0xD19 PUSH2 0x19CA JUMP JUMPDEST PUSH1 0x1 DUP2 ADD SLOAD DUP2 SLOAD PUSH1 0x2 DUP4 ADD SLOAD PUSH1 0x40 MLOAD SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB SWAP3 DUP4 AND SWAP3 SWAP1 SWAP2 AND SWAP1 DUP5 SWAP1 PUSH32 0xF0912EFB86EA1D65A17D64D48393CDB1CA0EA5220DD2BBE438621199D30955B7 SWAP1 PUSH1 0x20 ADD PUSH2 0x193F JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP2 AND PUSH2 0x2086 JUMPI PUSH1 0x40 MLOAD PUSH4 0x616BC441 PUSH1 0xE1 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x33 DUP1 SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB NOT AND PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP4 AND SWAP1 DUP2 OR SWAP1 SWAP2 SSTORE PUSH1 0x40 MLOAD PUSH32 0x81DCB738DA3DABD5BB2ADBC7DD107FBBFCA936E9C8AECAB25F5B17A710A784C7 SWAP1 PUSH1 0x0 SWAP1 LOG2 POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0x20DB PUSH2 0x1F21 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0x561285E4 DUP6 PUSH2 0x20F2 PUSH2 0x1F45 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP4 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x210F SWAP3 SWAP2 SWAP1 PUSH2 0x3389 JUMP JUMPDEST PUSH1 0xA0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP7 GAS STATICCALL ISZERO DUP1 ISZERO PUSH2 0x212C JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x2150 SWAP2 SWAP1 PUSH2 0x34A5 JUMP JUMPDEST MLOAD SWAP1 POP PUSH2 0x215D DUP2 DUP5 PUSH2 0x330C JUMP JUMPDEST SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0xC0 DUP2 ADD DUP3 MSTORE PUSH1 0x0 DUP1 DUP3 MSTORE PUSH1 0x20 DUP3 ADD DUP2 SWAP1 MSTORE SWAP2 DUP2 ADD DUP3 SWAP1 MSTORE PUSH1 0x60 DUP2 ADD DUP3 SWAP1 MSTORE PUSH1 0x80 DUP2 ADD DUP3 SWAP1 MSTORE PUSH1 0xA0 DUP2 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH1 0x1 PUSH2 0x21A4 PUSH1 0x20 DUP1 PUSH2 0x330C JUMP JUMPDEST PUSH2 0x21AE SWAP2 SWAP1 PUSH2 0x330C JUMP JUMPDEST PUSH2 0x21B9 SWAP1 PUSH1 0x60 PUSH2 0x330C JUMP JUMPDEST DUP3 MLOAD SWAP1 DUP2 EQ SWAP1 PUSH1 0x1 PUSH2 0x21CC PUSH1 0x20 DUP1 PUSH2 0x330C JUMP JUMPDEST PUSH2 0x21D6 SWAP2 SWAP1 PUSH2 0x330C JUMP JUMPDEST PUSH2 0x21E1 SWAP1 PUSH1 0x60 PUSH2 0x330C JUMP JUMPDEST SWAP1 SWAP2 PUSH2 0x2202 JUMPI PUSH1 0x40 MLOAD PUSH4 0x3FDF3423 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x535 SWAP3 SWAP2 SWAP1 PUSH2 0x3054 JUMP JUMPDEST POP POP PUSH1 0x0 DUP1 PUSH1 0x0 DUP5 DUP1 PUSH1 0x20 ADD SWAP1 MLOAD DUP2 ADD SWAP1 PUSH2 0x221D SWAP2 SWAP1 PUSH2 0x3524 JUMP JUMPDEST SWAP3 POP SWAP3 POP SWAP3 POP PUSH1 0x0 PUSH2 0x2230 DUP7 PUSH1 0x60 PUSH2 0x296E JUMP JUMPDEST SWAP1 POP PUSH1 0x0 PUSH2 0x2249 DUP8 PUSH2 0x2244 PUSH1 0x20 PUSH1 0x60 PUSH2 0x330C JUMP JUMPDEST PUSH2 0x296E JUMP JUMPDEST SWAP1 POP PUSH1 0x0 PUSH2 0x226D DUP9 PUSH1 0x20 PUSH2 0x225E DUP2 PUSH1 0x60 PUSH2 0x330C JUMP JUMPDEST PUSH2 0x2268 SWAP2 SWAP1 PUSH2 0x330C JUMP JUMPDEST PUSH2 0x29B9 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0xC0 DUP2 ADD DUP3 MSTORE SWAP8 DUP9 MSTORE PUSH1 0x20 DUP9 ADD SWAP7 SWAP1 SWAP7 MSTORE SWAP5 DUP7 ADD SWAP4 SWAP1 SWAP4 MSTORE PUSH1 0x60 DUP6 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH1 0x80 DUP5 ADD MSTORE POP PUSH1 0xFF AND PUSH1 0xA0 DUP3 ADD MSTORE SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0x22B1 DUP5 PUSH2 0x13E2 JUMP JUMPDEST SWAP1 POP PUSH1 0x0 PUSH2 0x22BD PUSH2 0x1F21 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0x25D9897E DUP4 PUSH2 0x22D4 PUSH2 0x1F45 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP4 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x22F1 SWAP3 SWAP2 SWAP1 PUSH2 0x3389 JUMP JUMPDEST PUSH2 0x140 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP7 GAS STATICCALL ISZERO DUP1 ISZERO PUSH2 0x230F JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x2333 SWAP2 SWAP1 PUSH2 0x33B9 JUMP JUMPDEST DUP1 MLOAD SWAP1 SWAP2 POP PUSH1 0x0 SUB PUSH2 0x2358 JUMPI PUSH1 0x40 MLOAD PUSH4 0x307EFDB7 PUSH1 0xE1 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST DUP5 MLOAD PUSH1 0x20 DUP1 DUP8 ADD MLOAD PUSH1 0x40 DUP1 DUP10 ADD MLOAD DUP2 MLOAD SWAP4 DUP5 ADD SWAP5 SWAP1 SWAP5 MSTORE DUP3 ADD MSTORE PUSH1 0x60 DUP1 DUP3 ADD SWAP3 SWAP1 SWAP3 MSTORE PUSH1 0x1 PUSH1 0x1 PUSH1 0x60 SHL SUB NOT DUP5 DUP4 SHL DUP2 AND PUSH1 0x80 DUP4 ADD MSTORE SWAP2 DUP10 SWAP1 SHL SWAP1 SWAP2 AND PUSH1 0x94 DUP3 ADD MSTORE PUSH1 0x0 SWAP1 PUSH1 0xA8 ADD PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 DUP4 SUB SUB DUP2 MSTORE SWAP1 PUSH1 0x40 MSTORE DUP1 MLOAD SWAP1 PUSH1 0x20 ADD KECCAK256 SWAP1 POP PUSH2 0x23C1 DUP2 PUSH2 0x1073 JUMP JUMPDEST ISZERO DUP2 SWAP1 PUSH2 0x23E4 JUMPI PUSH1 0x40 MLOAD PUSH4 0x124A23F1 PUSH1 0xE1 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x535 SWAP2 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 JUMP JUMPDEST POP PUSH1 0x0 PUSH2 0x23F5 DUP5 DUP5 PUSH1 0x0 ADD MLOAD PUSH2 0x20D0 JUMP JUMPDEST PUSH1 0x34 SLOAD SWAP1 SWAP2 POP PUSH1 0x0 SWAP1 PUSH2 0x2418 SWAP1 PUSH1 0x1 PUSH1 0xA0 SHL SWAP1 DIV PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB AND TIMESTAMP PUSH2 0x330C JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH2 0x120 DUP2 ADD DUP3 MSTORE PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP1 DUP10 AND DUP3 MSTORE DUP14 AND PUSH1 0x20 DUP3 ADD MSTORE SWAP1 DUP2 ADD DUP12 SWAP1 MSTORE PUSH1 0x0 PUSH1 0x60 DUP3 ADD MSTORE SWAP1 SWAP2 POP PUSH1 0x80 DUP2 ADD PUSH1 0x2 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x4 DUP2 MSTORE TIMESTAMP PUSH1 0x20 DUP1 DUP4 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH1 0x40 DUP1 DUP4 ADD DUP6 SWAP1 MSTORE PUSH1 0x60 SWAP3 DUP4 ADD DUP7 SWAP1 MSTORE PUSH1 0x0 DUP8 DUP2 MSTORE PUSH1 0x37 DUP4 MSTORE DUP2 SWAP1 KECCAK256 DUP5 MLOAD DUP2 SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB SWAP2 DUP3 AND PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB NOT SWAP2 DUP3 AND OR DUP4 SSTORE SWAP4 DUP7 ADD MLOAD PUSH1 0x1 DUP1 DUP5 ADD DUP1 SLOAD SWAP3 SWAP1 SWAP4 AND SWAP2 SWAP1 SWAP6 AND OR SWAP1 SSTORE SWAP1 DUP5 ADD MLOAD PUSH1 0x2 DUP3 ADD SSTORE SWAP2 DUP4 ADD MLOAD PUSH1 0x3 DUP1 DUP5 ADD SWAP2 SWAP1 SWAP2 SSTORE PUSH1 0x80 DUP5 ADD MLOAD PUSH1 0x4 DUP5 ADD DUP1 SLOAD SWAP2 SWAP4 SWAP1 SWAP3 PUSH1 0xFF NOT SWAP1 SWAP3 AND SWAP2 DUP5 SWAP1 DUP2 GT ISZERO PUSH2 0x24ED JUMPI PUSH2 0x24ED PUSH2 0x2D8B JUMP JUMPDEST MUL OR SWAP1 SSTORE POP PUSH1 0xA0 DUP3 ADD MLOAD PUSH1 0x4 DUP3 ADD DUP1 SLOAD PUSH2 0xFF00 NOT AND PUSH2 0x100 DUP4 PUSH1 0x5 DUP2 GT ISZERO PUSH2 0x2517 JUMPI PUSH2 0x2517 PUSH2 0x2D8B JUMP JUMPDEST MUL OR SWAP1 SSTORE POP PUSH1 0xC0 DUP3 ADD MLOAD DUP2 PUSH1 0x5 ADD SSTORE PUSH1 0xE0 DUP3 ADD MLOAD DUP2 PUSH1 0x6 ADD SSTORE PUSH2 0x100 DUP3 ADD MLOAD DUP2 PUSH1 0x7 ADD SSTORE SWAP1 POP POP DUP10 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND DUP6 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND DUP5 PUSH32 0xFB70FAF7306B83C2CEC6D8C1627BAAD892CB79968A02CC0353174499ECFD8B35 DUP13 DUP13 PUSH1 0x40 ADD MLOAD DUP13 DUP8 DUP10 PUSH1 0x40 MLOAD PUSH2 0x258E SWAP6 SWAP5 SWAP4 SWAP3 SWAP2 SWAP1 PUSH2 0x3552 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG4 POP SWAP1 SWAP9 SWAP8 POP POP POP POP POP POP POP POP JUMP JUMPDEST DUP1 MLOAD DUP3 MLOAD PUSH1 0x0 SWAP2 EQ DUP1 ISZERO PUSH2 0x25BF JUMPI POP DUP2 PUSH1 0x40 ADD MLOAD DUP4 PUSH1 0x40 ADD MLOAD EQ JUMPDEST DUP1 ISZERO PUSH2 0x9DD JUMPI POP POP PUSH1 0x20 SWAP1 DUP2 ADD MLOAD SWAP2 ADD MLOAD EQ ISZERO SWAP1 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0x60 DUP2 ADD DUP3 MSTORE DUP3 MLOAD DUP2 MSTORE PUSH1 0x20 DUP1 DUP5 ADD MLOAD SWAP1 DUP3 ADD MSTORE DUP3 DUP3 ADD MLOAD SWAP2 DUP2 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH1 0x0 SWAP1 DUP2 PUSH2 0x2605 DUP3 PUSH2 0x1E28 JUMP JUMPDEST SWAP1 POP PUSH2 0x215D DUP2 DUP6 PUSH1 0x60 ADD MLOAD DUP7 PUSH1 0x80 ADD MLOAD DUP8 PUSH1 0xA0 ADD MLOAD PUSH1 0x40 MLOAD PUSH1 0x20 ADD PUSH2 0x264A SWAP4 SWAP3 SWAP2 SWAP1 SWAP3 DUP4 MSTORE PUSH1 0x20 DUP4 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH1 0xF8 SHL PUSH1 0x1 PUSH1 0x1 PUSH1 0xF8 SHL SUB NOT AND PUSH1 0x40 DUP3 ADD MSTORE PUSH1 0x41 ADD SWAP1 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 DUP4 SUB SUB DUP2 MSTORE SWAP1 PUSH1 0x40 MSTORE PUSH2 0x2A04 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0x2669 PUSH2 0x1F45 JUMP JUMPDEST SWAP1 POP PUSH1 0x0 PUSH2 0x2675 PUSH2 0x1F21 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0x25D9897E DUP8 DUP5 PUSH1 0x40 MLOAD DUP4 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x26A2 SWAP3 SWAP2 SWAP1 PUSH2 0x3389 JUMP JUMPDEST PUSH2 0x140 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP7 GAS STATICCALL ISZERO DUP1 ISZERO PUSH2 0x26C0 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x26E4 SWAP2 SWAP1 PUSH2 0x33B9 JUMP JUMPDEST PUSH1 0x36 SLOAD SWAP1 SWAP2 POP PUSH1 0x0 SWAP1 PUSH2 0x2709 SWAP1 DUP7 SWAP1 PUSH4 0xFFFFFFFF PUSH1 0x1 PUSH1 0x20 SHL SWAP1 SWAP2 DIV DUP2 AND SWAP1 PUSH2 0x2A2E AND JUMP JUMPDEST SWAP1 POP DUP6 ISZERO DUP1 ISZERO SWAP1 PUSH2 0x271A JUMPI POP DUP1 DUP7 GT ISZERO JUMPDEST DUP7 DUP3 SWAP1 SWAP2 PUSH2 0x273D JUMPI PUSH1 0x40 MLOAD PUSH4 0xCC6B7C41 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x535 SWAP3 SWAP2 SWAP1 PUSH2 0x3054 JUMP JUMPDEST POP POP PUSH1 0x0 PUSH2 0x274F DUP8 DUP5 PUSH1 0x0 ADD MLOAD PUSH2 0x2A8E JUMP JUMPDEST PUSH1 0x60 DUP5 ADD MLOAD PUSH1 0x36 SLOAD SWAP2 SWAP3 POP PUSH1 0x0 SWAP2 PUSH2 0x2770 SWAP2 PUSH4 0xFFFFFFFF SWAP1 DUP2 AND SWAP2 AND PUSH2 0x2A8E JUMP JUMPDEST SWAP1 POP PUSH1 0x0 PUSH2 0x277E DUP3 DUP5 PUSH2 0x2A2E JUMP JUMPDEST SWAP1 POP DUP6 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0xCB8347FE DUP12 DUP12 DUP5 PUSH1 0x40 MLOAD PUSH1 0x20 ADD PUSH2 0x27A3 SWAP3 SWAP2 SWAP1 PUSH2 0x3054 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 DUP4 SUB SUB DUP2 MSTORE SWAP1 PUSH1 0x40 MSTORE PUSH1 0x40 MLOAD DUP4 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x27CF SWAP3 SWAP2 SWAP1 PUSH2 0x3365 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x27E9 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x27FD JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP SWAP3 SWAP13 SWAP12 POP POP POP POP POP POP POP POP POP POP POP POP JUMP JUMPDEST PUSH2 0x2817 PUSH2 0x2AA5 JUMP JUMPDEST PUSH2 0xA11 JUMPI PUSH1 0x40 MLOAD PUSH4 0x1AFCD79F PUSH1 0xE3 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH2 0x150E PUSH2 0x280F JUMP JUMPDEST PUSH2 0x2844 PUSH2 0x280F JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH32 0xD87CD6EF79D4E2B95E15CE8ABF732DB51EC771F1CA2EDCCF22A46C729AC56472 PUSH1 0x20 DUP3 ADD MSTORE PUSH32 0x171A7FA058648750A8C5AAE430F30DB8D0100EFC3A5E1B2E8054B1C1CE28B6B4 SWAP2 DUP2 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH32 0x44852B2A670ADE5407E78FB2863C51DE9FCB96542A07186FE3AEDA6BB8A116D PUSH1 0x60 DUP3 ADD MSTORE CHAINID PUSH1 0x80 DUP3 ADD MSTORE ADDRESS PUSH1 0xA0 DUP3 ADD MSTORE PUSH32 0xA070FFB1CD7409649BF77822CCE74495468E06DBFAEF09556838BF188679B9C2 PUSH1 0xC0 DUP3 ADD MSTORE PUSH1 0xE0 ADD PUSH1 0x40 DUP1 MLOAD PUSH1 0x1F NOT DUP2 DUP5 SUB ADD DUP2 MSTORE SWAP2 SWAP1 MSTORE DUP1 MLOAD PUSH1 0x20 SWAP1 SWAP2 ADD KECCAK256 PUSH1 0x0 SSTORE JUMP JUMPDEST DUP1 ISZERO PUSH2 0x296A JUMPI PUSH1 0x40 MLOAD PUSH4 0x852CD8D PUSH1 0xE3 SHL DUP2 MSTORE PUSH1 0x4 DUP2 ADD DUP3 SWAP1 MSTORE PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP4 AND SWAP1 PUSH4 0x42966C68 SWAP1 PUSH1 0x24 ADD PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x2956 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x105A JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x297B PUSH1 0x20 DUP4 PUSH2 0x330C JUMP JUMPDEST DUP4 MLOAD SWAP1 DUP2 LT ISZERO SWAP1 PUSH2 0x298D PUSH1 0x20 DUP6 PUSH2 0x330C JUMP JUMPDEST SWAP1 SWAP2 PUSH2 0x29AE JUMPI PUSH1 0x40 MLOAD PUSH4 0x3FDF3423 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x535 SWAP3 SWAP2 SWAP1 PUSH2 0x3054 JUMP JUMPDEST POP POP POP ADD PUSH1 0x20 ADD MLOAD SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x29C6 PUSH1 0x1 DUP4 PUSH2 0x330C JUMP JUMPDEST DUP4 MLOAD SWAP1 DUP2 LT ISZERO SWAP1 PUSH2 0x29D8 PUSH1 0x1 DUP6 PUSH2 0x330C JUMP JUMPDEST SWAP1 SWAP2 PUSH2 0x29F9 JUMPI PUSH1 0x40 MLOAD PUSH4 0x3FDF3423 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x535 SWAP3 SWAP2 SWAP1 PUSH2 0x3054 JUMP JUMPDEST POP POP POP ADD PUSH1 0x1 ADD MLOAD SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH2 0x2A14 DUP7 DUP7 PUSH2 0x2ABF JUMP JUMPDEST SWAP3 POP SWAP3 POP SWAP3 POP PUSH2 0x2A24 DUP3 DUP3 PUSH2 0x2B0C JUMP JUMPDEST POP SWAP1 SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x2A3D DUP4 PUSH3 0xF4240 LT ISZERO SWAP1 JUMP JUMPDEST DUP1 PUSH2 0x2A50 JUMPI POP PUSH2 0x2A50 DUP3 PUSH3 0xF4240 LT ISZERO SWAP1 JUMP JUMPDEST DUP4 DUP4 SWAP1 SWAP2 PUSH2 0x2A73 JUMPI PUSH1 0x40 MLOAD PUSH4 0x768BF0EB PUSH1 0xE1 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x535 SWAP3 SWAP2 SWAP1 PUSH2 0x3054 JUMP JUMPDEST POP PUSH3 0xF4240 SWAP1 POP PUSH2 0x2A84 DUP4 DUP6 PUSH2 0x3585 JUMP JUMPDEST PUSH2 0x9DD SWAP2 SWAP1 PUSH2 0x3466 JUMP JUMPDEST PUSH1 0x0 DUP2 DUP4 GT ISZERO PUSH2 0x2A9E JUMPI DUP2 PUSH2 0x9DD JUMP JUMPDEST POP SWAP1 SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x2AAF PUSH2 0x15F2 JUMP JUMPDEST SLOAD PUSH1 0x1 PUSH1 0x40 SHL SWAP1 DIV PUSH1 0xFF AND SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP4 MLOAD PUSH1 0x41 SUB PUSH2 0x2AF9 JUMPI PUSH1 0x20 DUP5 ADD MLOAD PUSH1 0x40 DUP6 ADD MLOAD PUSH1 0x60 DUP7 ADD MLOAD PUSH1 0x0 BYTE PUSH2 0x2AEB DUP9 DUP3 DUP6 DUP6 PUSH2 0x2BC5 JUMP JUMPDEST SWAP6 POP SWAP6 POP SWAP6 POP POP POP POP PUSH2 0x2B05 JUMP JUMPDEST POP POP DUP2 MLOAD PUSH1 0x0 SWAP2 POP PUSH1 0x2 SWAP1 JUMPDEST SWAP3 POP SWAP3 POP SWAP3 JUMP JUMPDEST PUSH1 0x0 DUP3 PUSH1 0x3 DUP2 GT ISZERO PUSH2 0x2B20 JUMPI PUSH2 0x2B20 PUSH2 0x2D8B JUMP JUMPDEST SUB PUSH2 0x2B29 JUMPI POP POP JUMP JUMPDEST PUSH1 0x1 DUP3 PUSH1 0x3 DUP2 GT ISZERO PUSH2 0x2B3D JUMPI PUSH2 0x2B3D PUSH2 0x2D8B JUMP JUMPDEST SUB PUSH2 0x2B5B JUMPI PUSH1 0x40 MLOAD PUSH4 0xF645EEDF PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x2 DUP3 PUSH1 0x3 DUP2 GT ISZERO PUSH2 0x2B6F JUMPI PUSH2 0x2B6F PUSH2 0x2D8B JUMP JUMPDEST SUB PUSH2 0x2B90 JUMPI PUSH1 0x40 MLOAD PUSH4 0xFCE698F7 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 DUP2 ADD DUP3 SWAP1 MSTORE PUSH1 0x24 ADD PUSH2 0x535 JUMP JUMPDEST PUSH1 0x3 DUP3 PUSH1 0x3 DUP2 GT ISZERO PUSH2 0x2BA4 JUMPI PUSH2 0x2BA4 PUSH2 0x2D8B JUMP JUMPDEST SUB PUSH2 0x296A JUMPI PUSH1 0x40 MLOAD PUSH4 0x35E2F383 PUSH1 0xE2 SHL DUP2 MSTORE PUSH1 0x4 DUP2 ADD DUP3 SWAP1 MSTORE PUSH1 0x24 ADD PUSH2 0x535 JUMP JUMPDEST PUSH1 0x0 DUP1 DUP1 PUSH16 0xA2A8918CA85BAFE22016D0B997E4DF60 PUSH1 0x1 PUSH1 0xFF SHL SUB DUP5 GT ISZERO PUSH2 0x2BF6 JUMPI POP PUSH1 0x0 SWAP2 POP PUSH1 0x3 SWAP1 POP DUP3 PUSH2 0x2C80 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0x0 DUP1 DUP3 MSTORE PUSH1 0x20 DUP3 ADD DUP1 DUP5 MSTORE DUP11 SWAP1 MSTORE PUSH1 0xFF DUP10 AND SWAP3 DUP3 ADD SWAP3 SWAP1 SWAP3 MSTORE PUSH1 0x60 DUP2 ADD DUP8 SWAP1 MSTORE PUSH1 0x80 DUP2 ADD DUP7 SWAP1 MSTORE PUSH1 0x1 SWAP1 PUSH1 0xA0 ADD PUSH1 0x20 PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 SUB SWAP1 DUP1 DUP5 SUB SWAP1 DUP6 GAS STATICCALL ISZERO DUP1 ISZERO PUSH2 0x2C4A JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP PUSH1 0x40 MLOAD PUSH1 0x1F NOT ADD MLOAD SWAP2 POP POP PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP2 AND PUSH2 0x2C76 JUMPI POP PUSH1 0x0 SWAP3 POP PUSH1 0x1 SWAP2 POP DUP3 SWAP1 POP PUSH2 0x2C80 JUMP JUMPDEST SWAP3 POP PUSH1 0x0 SWAP2 POP DUP2 SWAP1 POP JUMPDEST SWAP5 POP SWAP5 POP SWAP5 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x2C9D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP POP DUP1 CALLDATALOAD SWAP3 PUSH1 0x20 SWAP1 SWAP2 ADD CALLDATALOAD SWAP2 POP JUMP JUMPDEST PUSH4 0xFFFFFFFF SWAP2 SWAP1 SWAP2 AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP2 AND DUP2 EQ PUSH2 0x745 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP2 AND DUP2 EQ PUSH2 0x745 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH4 0xFFFFFFFF DUP2 AND DUP2 EQ PUSH2 0x745 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0xC0 DUP8 DUP10 SUB SLT ISZERO PUSH2 0x2D12 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP7 CALLDATALOAD PUSH2 0x2D1D DUP2 PUSH2 0x2CBD JUMP JUMPDEST SWAP6 POP PUSH1 0x20 DUP8 ADD CALLDATALOAD PUSH2 0x2D2D DUP2 PUSH2 0x2CBD JUMP JUMPDEST SWAP5 POP PUSH1 0x40 DUP8 ADD CALLDATALOAD PUSH2 0x2D3D DUP2 PUSH2 0x2CD2 JUMP JUMPDEST SWAP4 POP PUSH1 0x60 DUP8 ADD CALLDATALOAD SWAP3 POP PUSH1 0x80 DUP8 ADD CALLDATALOAD PUSH2 0x2D54 DUP2 PUSH2 0x2CE7 JUMP JUMPDEST SWAP2 POP PUSH1 0xA0 DUP8 ADD CALLDATALOAD PUSH2 0x2D64 DUP2 PUSH2 0x2CE7 JUMP JUMPDEST DUP1 SWAP2 POP POP SWAP3 SWAP6 POP SWAP3 SWAP6 POP SWAP3 SWAP6 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x2D84 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP CALLDATALOAD SWAP2 SWAP1 POP JUMP JUMPDEST PUSH4 0x4E487B71 PUSH1 0xE0 SHL PUSH1 0x0 MSTORE PUSH1 0x21 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST PUSH1 0x6 DUP2 LT PUSH2 0x2DB1 JUMPI PUSH2 0x2DB1 PUSH2 0x2D8B JUMP JUMPDEST SWAP1 MSTORE JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP11 DUP2 AND DUP3 MSTORE DUP10 AND PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 DUP2 ADD DUP9 SWAP1 MSTORE PUSH1 0x60 DUP2 ADD DUP8 SWAP1 MSTORE PUSH2 0x120 DUP2 ADD PUSH1 0x4 DUP8 LT PUSH2 0x2DEC JUMPI PUSH2 0x2DEC PUSH2 0x2D8B JUMP JUMPDEST DUP7 PUSH1 0x80 DUP4 ADD MSTORE PUSH2 0x2DFF PUSH1 0xA0 DUP4 ADD DUP8 PUSH2 0x2DA1 JUMP JUMPDEST DUP5 PUSH1 0xC0 DUP4 ADD MSTORE DUP4 PUSH1 0xE0 DUP4 ADD MSTORE DUP3 PUSH2 0x100 DUP4 ADD MSTORE SWAP11 SWAP10 POP POP POP POP POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB SWAP2 SWAP1 SWAP2 AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x2E47 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 CALLDATALOAD PUSH2 0x2E52 DUP2 PUSH2 0x2CBD JUMP JUMPDEST SWAP5 PUSH1 0x20 SWAP4 SWAP1 SWAP4 ADD CALLDATALOAD SWAP4 POP POP POP JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB SWAP2 SWAP1 SWAP2 AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x60 DUP3 DUP5 SUB SLT DUP1 ISZERO PUSH2 0x2E87 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP SWAP1 SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x2EA1 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD PUSH2 0x113A DUP2 PUSH2 0x2CE7 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0x80 DUP6 DUP8 SUB SLT ISZERO PUSH2 0x2EC2 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP5 CALLDATALOAD PUSH2 0x2ECD DUP2 PUSH2 0x2CBD JUMP JUMPDEST SWAP4 POP PUSH1 0x20 DUP6 ADD CALLDATALOAD PUSH2 0x2EDD DUP2 PUSH2 0x2CBD JUMP JUMPDEST SWAP4 SWAP7 SWAP4 SWAP6 POP POP POP POP PUSH1 0x40 DUP3 ADD CALLDATALOAD SWAP2 PUSH1 0x60 ADD CALLDATALOAD SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x2F04 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD PUSH2 0x113A DUP2 PUSH2 0x2CBD JUMP JUMPDEST DUP1 ISZERO ISZERO DUP2 EQ PUSH2 0x745 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0x80 DUP6 DUP8 SUB SLT ISZERO PUSH2 0x2F33 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP5 CALLDATALOAD SWAP4 POP PUSH1 0x20 DUP6 ADD CALLDATALOAD SWAP3 POP PUSH1 0x40 DUP6 ADD CALLDATALOAD PUSH2 0x2F4C DUP2 PUSH2 0x2F0F JUMP JUMPDEST SWAP4 SWAP7 SWAP3 SWAP6 POP SWAP3 SWAP4 PUSH1 0x60 ADD CALLDATALOAD SWAP3 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 DUP4 PUSH1 0x1F DUP5 ADD SLT PUSH2 0x2F6E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP DUP2 CALLDATALOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP2 GT ISZERO PUSH2 0x2F85 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x20 DUP4 ADD SWAP2 POP DUP4 PUSH1 0x20 DUP3 DUP6 ADD ADD GT ISZERO PUSH2 0x2F9D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x20 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x2FB7 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 CALLDATALOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP2 GT ISZERO PUSH2 0x2FCD JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x2FD9 DUP6 DUP3 DUP7 ADD PUSH2 0x2F5C JUMP JUMPDEST SWAP1 SWAP7 SWAP1 SWAP6 POP SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0x40 DUP6 DUP8 SUB SLT ISZERO PUSH2 0x2FFB JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP5 CALLDATALOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP2 GT ISZERO PUSH2 0x3011 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x301D DUP8 DUP3 DUP9 ADD PUSH2 0x2F5C JUMP JUMPDEST SWAP1 SWAP6 POP SWAP4 POP POP PUSH1 0x20 DUP6 ADD CALLDATALOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP2 GT ISZERO PUSH2 0x303C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x3048 DUP8 DUP3 DUP9 ADD PUSH2 0x2F5C JUMP JUMPDEST SWAP6 SWAP9 SWAP5 SWAP8 POP SWAP6 POP POP POP POP JUMP JUMPDEST SWAP2 DUP3 MSTORE PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH1 0xC0 DUP2 ADD PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP2 GT DUP3 DUP3 LT OR ISZERO PUSH2 0x3092 JUMPI PUSH4 0x4E487B71 PUSH1 0xE0 SHL PUSH1 0x0 MSTORE PUSH1 0x41 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST PUSH1 0x40 MSTORE SWAP1 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x120 DUP2 ADD PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP2 GT DUP3 DUP3 LT OR ISZERO PUSH2 0x3092 JUMPI PUSH4 0x4E487B71 PUSH1 0xE0 SHL PUSH1 0x0 MSTORE PUSH1 0x41 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x140 DUP2 ADD PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP2 GT DUP3 DUP3 LT OR ISZERO PUSH2 0x3092 JUMPI PUSH4 0x4E487B71 PUSH1 0xE0 SHL PUSH1 0x0 MSTORE PUSH1 0x41 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST PUSH1 0x0 PUSH1 0xC0 DUP3 DUP5 SUB SLT DUP1 ISZERO PUSH2 0x310D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x0 PUSH2 0x3118 PUSH2 0x3062 JUMP JUMPDEST DUP4 CALLDATALOAD DUP2 MSTORE PUSH1 0x20 DUP1 DUP6 ADD CALLDATALOAD SWAP1 DUP3 ADD MSTORE PUSH1 0x40 DUP1 DUP6 ADD CALLDATALOAD SWAP1 DUP3 ADD MSTORE PUSH1 0x60 DUP1 DUP6 ADD CALLDATALOAD SWAP1 DUP3 ADD MSTORE PUSH1 0x80 DUP1 DUP6 ADD CALLDATALOAD SWAP1 DUP3 ADD MSTORE PUSH1 0xA0 DUP5 ADD CALLDATALOAD PUSH1 0xFF DUP2 AND DUP2 EQ PUSH2 0x3157 JUMPI DUP3 DUP4 REVERT JUMPDEST PUSH1 0xA0 DUP3 ADD MSTORE SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0xC0 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x3176 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0x180 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x3190 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x319A DUP5 DUP5 PUSH2 0x3164 JUMP JUMPDEST SWAP2 POP PUSH2 0x31A9 DUP5 PUSH1 0xC0 DUP6 ADD PUSH2 0x3164 JUMP JUMPDEST SWAP1 POP SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x31C4 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD PUSH2 0x113A DUP2 PUSH2 0x2CD2 JUMP JUMPDEST PUSH1 0x20 DUP2 ADD PUSH2 0x9E0 DUP3 DUP5 PUSH2 0x2DA1 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x60 DUP3 DUP5 SUB SLT DUP1 ISZERO PUSH2 0x31F0 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x40 MLOAD PUSH1 0x0 SWAP1 PUSH1 0x60 DUP2 ADD PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP2 GT DUP3 DUP3 LT OR ISZERO PUSH2 0x3222 JUMPI PUSH4 0x4E487B71 PUSH1 0xE0 SHL DUP4 MSTORE PUSH1 0x41 PUSH1 0x4 MSTORE PUSH1 0x24 DUP4 REVERT JUMPDEST PUSH1 0x40 SWAP1 DUP2 MSTORE DUP5 CALLDATALOAD DUP3 MSTORE PUSH1 0x20 DUP1 DUP7 ADD CALLDATALOAD SWAP1 DUP4 ADD MSTORE SWAP4 DUP5 ADD CALLDATALOAD SWAP4 DUP2 ADD SWAP4 SWAP1 SWAP4 MSTORE POP SWAP1 SWAP3 SWAP2 POP POP JUMP JUMPDEST DUP1 MLOAD PUSH2 0x3253 DUP2 PUSH2 0x2CBD JUMP JUMPDEST SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x120 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x326B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x3273 PUSH2 0x3098 JUMP JUMPDEST SWAP1 POP PUSH2 0x327E DUP3 PUSH2 0x3248 JUMP JUMPDEST DUP2 MSTORE PUSH1 0x20 DUP3 DUP2 ADD MLOAD SWAP1 DUP3 ADD MSTORE PUSH1 0x40 DUP1 DUP4 ADD MLOAD SWAP1 DUP3 ADD MSTORE PUSH1 0x60 DUP1 DUP4 ADD MLOAD SWAP1 DUP3 ADD MSTORE PUSH1 0x80 DUP1 DUP4 ADD MLOAD SWAP1 DUP3 ADD MSTORE PUSH1 0xA0 DUP1 DUP4 ADD MLOAD SWAP1 DUP3 ADD MSTORE PUSH1 0xC0 DUP1 DUP4 ADD MLOAD SWAP1 DUP3 ADD MSTORE PUSH1 0xE0 DUP1 DUP4 ADD MLOAD SWAP1 DUP3 ADD MSTORE PUSH2 0x100 SWAP2 DUP3 ADD MLOAD SWAP2 DUP2 ADD SWAP2 SWAP1 SWAP2 MSTORE SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x120 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x32EC JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x9DD DUP4 DUP4 PUSH2 0x3258 JUMP JUMPDEST PUSH4 0x4E487B71 PUSH1 0xE0 SHL PUSH1 0x0 MSTORE PUSH1 0x11 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST DUP1 DUP3 ADD DUP1 DUP3 GT ISZERO PUSH2 0x9E0 JUMPI PUSH2 0x9E0 PUSH2 0x32F6 JUMP JUMPDEST PUSH1 0x0 DUP2 MLOAD DUP1 DUP5 MSTORE PUSH1 0x0 JUMPDEST DUP2 DUP2 LT ISZERO PUSH2 0x3345 JUMPI PUSH1 0x20 DUP2 DUP6 ADD DUP2 ADD MLOAD DUP7 DUP4 ADD DUP3 ADD MSTORE ADD PUSH2 0x3329 JUMP JUMPDEST POP PUSH1 0x0 PUSH1 0x20 DUP3 DUP7 ADD ADD MSTORE PUSH1 0x20 PUSH1 0x1F NOT PUSH1 0x1F DUP4 ADD AND DUP6 ADD ADD SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP4 AND DUP2 MSTORE PUSH1 0x40 PUSH1 0x20 DUP3 ADD DUP2 SWAP1 MSTORE PUSH1 0x0 SWAP1 PUSH2 0x215D SWAP1 DUP4 ADD DUP5 PUSH2 0x331F JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB SWAP3 DUP4 AND DUP2 MSTORE SWAP2 AND PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST DUP1 MLOAD PUSH2 0x3253 DUP2 PUSH2 0x2CE7 JUMP JUMPDEST DUP1 MLOAD PUSH2 0x3253 DUP2 PUSH2 0x2CD2 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x140 DUP3 DUP5 SUB SLT DUP1 ISZERO PUSH2 0x33CD JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x0 PUSH2 0x33D8 PUSH2 0x30C9 JUMP JUMPDEST DUP4 MLOAD DUP2 MSTORE PUSH1 0x20 DUP1 DUP6 ADD MLOAD SWAP1 DUP3 ADD MSTORE PUSH1 0x40 DUP1 DUP6 ADD MLOAD SWAP1 DUP3 ADD MSTORE PUSH2 0x33FC PUSH1 0x60 DUP6 ADD PUSH2 0x33A3 JUMP JUMPDEST PUSH1 0x60 DUP3 ADD MSTORE PUSH2 0x340D PUSH1 0x80 DUP6 ADD PUSH2 0x33AE JUMP JUMPDEST PUSH1 0x80 DUP3 ADD MSTORE PUSH2 0x341E PUSH1 0xA0 DUP6 ADD PUSH2 0x33AE JUMP JUMPDEST PUSH1 0xA0 DUP3 ADD MSTORE PUSH2 0x342F PUSH1 0xC0 DUP6 ADD PUSH2 0x33A3 JUMP JUMPDEST PUSH1 0xC0 DUP3 ADD MSTORE PUSH2 0x3440 PUSH1 0xE0 DUP6 ADD PUSH2 0x33AE JUMP JUMPDEST PUSH1 0xE0 DUP3 ADD MSTORE PUSH2 0x100 DUP5 DUP2 ADD MLOAD SWAP1 DUP3 ADD MSTORE PUSH2 0x120 SWAP4 DUP5 ADD MLOAD SWAP4 DUP2 ADD SWAP4 SWAP1 SWAP4 MSTORE POP SWAP1 SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP3 PUSH2 0x3483 JUMPI PUSH4 0x4E487B71 PUSH1 0xE0 SHL PUSH1 0x0 MSTORE PUSH1 0x12 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST POP DIV SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x349A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 MLOAD PUSH2 0x113A DUP2 PUSH2 0x2F0F JUMP JUMPDEST PUSH1 0x0 PUSH1 0xA0 DUP3 DUP5 SUB SLT DUP1 ISZERO PUSH2 0x34B8 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x40 MLOAD PUSH1 0x0 SWAP1 PUSH1 0xA0 DUP2 ADD PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP2 GT DUP3 DUP3 LT OR ISZERO PUSH2 0x34EA JUMPI PUSH4 0x4E487B71 PUSH1 0xE0 SHL DUP4 MSTORE PUSH1 0x41 PUSH1 0x4 MSTORE PUSH1 0x24 DUP4 REVERT JUMPDEST PUSH1 0x40 SWAP1 DUP2 MSTORE DUP5 MLOAD DUP3 MSTORE PUSH1 0x20 DUP1 DUP7 ADD MLOAD SWAP1 DUP4 ADD MSTORE DUP5 DUP2 ADD MLOAD SWAP1 DUP3 ADD MSTORE PUSH1 0x60 DUP1 DUP6 ADD MLOAD SWAP1 DUP3 ADD MSTORE PUSH1 0x80 SWAP4 DUP5 ADD MLOAD SWAP4 DUP2 ADD SWAP4 SWAP1 SWAP4 MSTORE POP SWAP1 SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH1 0x60 DUP5 DUP7 SUB SLT ISZERO PUSH2 0x3539 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP POP DUP2 MLOAD PUSH1 0x20 DUP4 ADD MLOAD PUSH1 0x40 SWAP1 SWAP4 ADD MLOAD SWAP1 SWAP5 SWAP3 SWAP4 POP SWAP2 SWAP1 POP JUMP JUMPDEST DUP6 DUP2 MSTORE DUP5 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0xA0 PUSH1 0x40 DUP3 ADD MSTORE PUSH1 0x0 PUSH2 0x3571 PUSH1 0xA0 DUP4 ADD DUP7 PUSH2 0x331F JUMP JUMPDEST PUSH1 0x60 DUP4 ADD SWAP5 SWAP1 SWAP5 MSTORE POP PUSH1 0x80 ADD MSTORE SWAP4 SWAP3 POP POP POP JUMP JUMPDEST DUP1 DUP3 MUL DUP2 ISZERO DUP3 DUP3 DIV DUP5 EQ OR PUSH2 0x9E0 JUMPI PUSH2 0x9E0 PUSH2 0x32F6 JUMP INVALID PUSH14 0x800AAAF64B9A1F321DCD63DA0436 SWAP14 CALLER 0xD8 LOG0 0xD4 SWAP11 0xD0 0xFB 0xBA ADDMOD GAS 0xAB BLOBBASEFEE SWAP9 0xBF BALANCE 0xC4 LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0xD5 SIGNEXTEND RETURNDATASIZE 0xEC 0x1E TSTORE 0x2D SAR EQ SMOD CALLER 0xDC 0xA7 0xD5 AND CODECOPY STOP 0xC1 0xFC DUP9 0x29 SELFBALANCE 0xB3 KECCAK256 DUP9 PUSH5 0x910C6F452D 0xE PUSH5 0x736F6C6343 STOP ADDMOD SHL STOP CALLER ", + "sourceMap": "2323:25016:55:-:0;;;3976:98;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;4023:10;-1:-1:-1;;;;;4355:24:37;;4347:81;;;;-1:-1:-1;;;4347:81:37;;510:2:70;4347:81:37;;;492:21:70;549:2;529:18;;;522:30;-1:-1:-1;;;568:18:70;;;561:40;618:18;;4347:81:37;;;;;;;;;-1:-1:-1;;;;;4439:42:37;;;;4517:40;;;;;;;;;;;;-1:-1:-1;;;4517:40:37;;;;;;:26;:40::i;:::-;-1:-1:-1;;;;;4491:67:37;;;4600:37;;;;;;;;;;;;-1:-1:-1;;;4600:37:37;;;;;;:26;:37::i;:::-;-1:-1:-1;;;;;4568:70:37;;;4680:43;;;;;;;;;;;;-1:-1:-1;;;4680:43:37;;;;;;:26;:43::i;:::-;-1:-1:-1;;;;;4648:76:37;;;4774:44;;;;;;;;;;;;-1:-1:-1;;;4774:44:37;;;;;;:26;:44::i;:::-;-1:-1:-1;;;;;4734:85:37;;;4865:42;;;;;;;;;;;;-1:-1:-1;;;4865:42:37;;;;;;:26;:42::i;:::-;-1:-1:-1;;;;;4829:79:37;;;4958:44;;;;;;;;;;;;-1:-1:-1;;;4958:44:37;;;;;;:26;:44::i;:::-;-1:-1:-1;;;;;4918:85:37;;;5049:47;;;;;;;;;;;;-1:-1:-1;;;5049:47:37;;;;;;:26;:47::i;:::-;-1:-1:-1;;;;;5013:84:37;;;5144:45;;;;;;;;;;;;-1:-1:-1;;;5144:45:37;;;;;;:26;:45::i;:::-;-1:-1:-1;;;;;5107:83:37;;;5227:38;;;;;;;;;;;;-1:-1:-1;;;5227:38:37;;;;;;:26;:38::i;:::-;-1:-1:-1;;;;;5200:66:37;;;;;;;5480:16;;5363:13;;5329:11;;5399:14;;5436:21;;5519:19;;5561:21;;5605:19;;5647:17;;5282:430;;;;;;;;;;;;;;;;;;;5647:17;;-1:-1:-1;;;;;980:32:70;;;962:51;;1049:32;;;1044:2;1029:18;;1022:60;1118:32;;;1113:2;1098:18;;1091:60;1187:32;;;1182:2;1167:18;;1160:60;1257:32;;1251:3;1236:19;;1229:61;1327:32;;1000:3;1306:19;;1299:61;1397:32;;;1391:3;1376:19;;1369:61;949:3;934:19;;647:789;5282:430:37;;;;;;;;-1:-1:-1;4045:22:55::1;:20;:22::i;:::-;3976:98:::0;2323:25016;;8217:326:37;8303:7;8322:23;8348:16;;-1:-1:-1;;;;;8348:33:37;;8392:13;8382:24;;;;;;8348:59;;;;;;;;;;;;;1587:25:70;;1575:2;1560:18;;1441:177;8348:59:37;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;8322:85;-1:-1:-1;8489:13:37;-1:-1:-1;;;;;8425:29:37;;8417:87;;;;-1:-1:-1;;;8417:87:37;;;;;;;;:::i;:::-;-1:-1:-1;8521:15:37;8217:326;-1:-1:-1;;8217:326:37:o;7709:422:39:-;3147:66;7898:15;;;;;;;7894:76;;;7936:23;;-1:-1:-1;;;7936:23:39;;;;;;;;;;;7894:76;7983:14;;-1:-1:-1;;;;;7983:14:39;;;:34;7979:146;;8033:33;;-1:-1:-1;;;;;;8033:33:39;-1:-1:-1;;;;;8033:33:39;;;;;8085:29;;2297:50:70;;;8085:29:39;;2285:2:70;2270:18;8085:29:39;;;;;;;7979:146;7758:373;7709:422::o;14:290:70:-;84:6;137:2;125:9;116:7;112:23;108:32;105:52;;;153:1;150;143:12;105:52;179:16;;-1:-1:-1;;;;;224:31:70;;214:42;;204:70;;270:1;267;260:12;204:70;293:5;14:290;-1:-1:-1;;;14:290:70:o;1623:525::-;1770:2;1759:9;1752:21;1733:4;1802:6;1796:13;1845:6;1840:2;1829:9;1825:18;1818:34;1870:1;1880:140;1894:6;1891:1;1888:13;1880:140;;;2005:2;1989:14;;;1985:23;;1979:30;1974:2;1955:17;;;1951:26;1944:66;1909:10;1880:140;;;1884:3;2069:1;2064:2;2055:6;2044:9;2040:22;2036:31;2029:42;2139:2;2132;2128:7;2123:2;2115:6;2111:15;2107:29;2096:9;2092:45;2088:54;2080:62;;;1623:525;;;;:::o;2153:200::-;2323:25016:55;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;" + }, + "deployedBytecode": { + "functionDebugData": { + "@MAX_FISHERMAN_REWARD_CUT_11901": { + "entryPoint": null, + "id": 11901, + "parameterSlots": 0, + "returnSlots": 0 + }, + "@MIN_DISPUTE_DEPOSIT_11905": { + "entryPoint": null, + "id": 11905, + "parameterSlots": 0, + "returnSlots": 0 + }, + "@__AttestationManager_init_17454": { + "entryPoint": 5676, + "id": 17454, + "parameterSlots": 0, + "returnSlots": 0 + }, + "@__AttestationManager_init_unchained_17479": { + "entryPoint": 10300, + "id": 17479, + "parameterSlots": 0, + "returnSlots": 0 + }, + "@__Ownable_init_4983": { + "entryPoint": 5659, + "id": 4983, + "parameterSlots": 1, + "returnSlots": 0 + }, + "@__Ownable_init_unchained_5010": { + "entryPoint": 10292, + "id": 5010, + "parameterSlots": 1, + "returnSlots": 0 + }, + "@_acceptDispute_13118": { + "entryPoint": 5441, + "id": 13118, + "parameterSlots": 3, + "returnSlots": 0 + }, + "@_cancelDispute_13227": { + "entryPoint": 6340, + "id": 13227, + "parameterSlots": 2, + "returnSlots": 0 + }, + "@_checkInitializing_5299": { + "entryPoint": 10255, + "id": 5299, + "parameterSlots": 0, + "returnSlots": 0 + }, + "@_checkOwner_5051": { + "entryPoint": 6290, + "id": 5051, + "parameterSlots": 0, + "returnSlots": 0 + }, + "@_createIndexingDisputeWithAllocation_13065": { + "entryPoint": 6822, + "id": 13065, + "parameterSlots": 4, + "returnSlots": 1 + }, + "@_createQueryDisputeWithAttestation_12923": { + "entryPoint": 8869, + "id": 12923, + "parameterSlots": 4, + "returnSlots": 1 + }, + "@_drawDispute_13190": { + "entryPoint": 8160, + "id": 13190, + "parameterSlots": 2, + "returnSlots": 0 + }, + "@_encodeReceipt_17554": { + "entryPoint": 7720, + "id": 17554, + "parameterSlots": 1, + "returnSlots": 1 + }, + "@_getInitializableStorage_5390": { + "entryPoint": 5618, + "id": 5390, + "parameterSlots": 0, + "returnSlots": 1 + }, + "@_getOwnableStorage_4954": { + "entryPoint": 8124, + "id": 4954, + "parameterSlots": 0, + "returnSlots": 1 + }, + "@_getStakeSnapshot_13541": { + "entryPoint": 8400, + "id": 13541, + "parameterSlots": 2, + "returnSlots": 1 + }, + "@_getSubgraphService_13494": { + "entryPoint": 8005, + "id": 13494, + "parameterSlots": 0, + "returnSlots": 1 + }, + "@_graphStaking_4815": { + "entryPoint": 7969, + "id": 4815, + "parameterSlots": 0, + "returnSlots": 1 + }, + "@_graphToken_4805": { + "entryPoint": 6602, + "id": 4805, + "parameterSlots": 0, + "returnSlots": 1 + }, + "@_initializableStorageSlot_5376": { + "entryPoint": null, + "id": 5376, + "parameterSlots": 0, + "returnSlots": 1 + }, + "@_isDisputeInConflict_13512": { + "entryPoint": null, + "id": 13512, + "parameterSlots": 1, + "returnSlots": 1 + }, + "@_isInitializing_5367": { + "entryPoint": 10917, + "id": 5367, + "parameterSlots": 0, + "returnSlots": 1 + }, + "@_msgSender_5419": { + "entryPoint": null, + "id": 5419, + "parameterSlots": 0, + "returnSlots": 1 + }, + "@_recoverSigner_17524": { + "entryPoint": 9685, + "id": 17524, + "parameterSlots": 1, + "returnSlots": 1 + }, + "@_rejectDispute_13153": { + "entryPoint": 6475, + "id": 13153, + "parameterSlots": 2, + "returnSlots": 0 + }, + "@_setArbitrator_13346": { + "entryPoint": 5692, + "id": 13346, + "parameterSlots": 1, + "returnSlots": 0 + }, + "@_setDisputeDeposit_13393": { + "entryPoint": 5942, + "id": 13393, + "parameterSlots": 1, + "returnSlots": 0 + }, + "@_setDisputePeriod_13369": { + "entryPoint": 5805, + "id": 13369, + "parameterSlots": 1, + "returnSlots": 0 + }, + "@_setFishermanRewardCut_13417": { + "entryPoint": 6041, + "id": 13417, + "parameterSlots": 1, + "returnSlots": 0 + }, + "@_setMaxSlashingCut_13442": { + "entryPoint": 6155, + "id": 13442, + "parameterSlots": 1, + "returnSlots": 0 + }, + "@_setSubgraphService_13470": { + "entryPoint": 8287, + "id": 13470, + "parameterSlots": 1, + "returnSlots": 0 + }, + "@_slashIndexer_13320": { + "entryPoint": 9822, + "id": 13320, + "parameterSlots": 3, + "returnSlots": 1 + }, + "@_throwError_8230": { + "entryPoint": 11020, + "id": 8230, + "parameterSlots": 2, + "returnSlots": 0 + }, + "@_toBytes32_16289": { + "entryPoint": 10606, + "id": 16289, + "parameterSlots": 2, + "returnSlots": 1 + }, + "@_toUint8_16256": { + "entryPoint": 10681, + "id": 16256, + "parameterSlots": 2, + "returnSlots": 1 + }, + "@_transferOwnership_5122": { + "entryPoint": 7877, + "id": 5122, + "parameterSlots": 1, + "returnSlots": 0 + }, + "@acceptDisputeConflict_12431": { + "entryPoint": 3841, + "id": 12431, + "parameterSlots": 4, + "returnSlots": 0 + }, + "@acceptDispute_12365": { + "entryPoint": 1246, + "id": 12365, + "parameterSlots": 2, + "returnSlots": 0 + }, + "@arbitrator_13556": { + "entryPoint": null, + "id": 13556, + "parameterSlots": 0, + "returnSlots": 0 + }, + "@areConflictingAttestations_12726": { + "entryPoint": 5325, + "id": 12726, + "parameterSlots": 2, + "returnSlots": 1 + }, + "@areConflicting_16153": { + "entryPoint": 9636, + "id": 16153, + "parameterSlots": 2, + "returnSlots": 1 + }, + "@burnTokens_839": { + "entryPoint": 10510, + "id": 839, + "parameterSlots": 2, + "returnSlots": 0 + }, + "@cancelDispute_12555": { + "entryPoint": 1864, + "id": 12555, + "parameterSlots": 1, + "returnSlots": 0 + }, + "@createAndAcceptLegacyDispute_12325": { + "entryPoint": 2596, + "id": 12325, + "parameterSlots": 4, + "returnSlots": 1 + }, + "@createIndexingDispute_12068": { + "entryPoint": 2478, + "id": 12068, + "parameterSlots": 2, + "returnSlots": 1 + }, + "@createQueryDisputeConflict_12211": { + "entryPoint": 4564, + "id": 12211, + "parameterSlots": 4, + "returnSlots": 2 + }, + "@createQueryDispute_12097": { + "entryPoint": 4417, + "id": 12097, + "parameterSlots": 2, + "returnSlots": 1 + }, + "@disputeDeposit_13562": { + "entryPoint": null, + "id": 13562, + "parameterSlots": 0, + "returnSlots": 0 + }, + "@disputePeriod_13559": { + "entryPoint": null, + "id": 13559, + "parameterSlots": 0, + "returnSlots": 0 + }, + "@disputes_13574": { + "entryPoint": null, + "id": 13574, + "parameterSlots": 0, + "returnSlots": 0 + }, + "@drawDispute_12505": { + "entryPoint": 3552, + "id": 12505, + "parameterSlots": 1, + "returnSlots": 0 + }, + "@encodeReceipt_12654": { + "entryPoint": 2534, + "id": 12654, + "parameterSlots": 1, + "returnSlots": 1 + }, + "@fishermanRewardCut_13565": { + "entryPoint": null, + "id": 13565, + "parameterSlots": 0, + "returnSlots": 0 + }, + "@getAttestationIndexer_12783": { + "entryPoint": 5090, + "id": 12783, + "parameterSlots": 1, + "returnSlots": 1 + }, + "@getDisputePeriod_12674": { + "entryPoint": null, + "id": 12674, + "parameterSlots": 0, + "returnSlots": 1 + }, + "@getFishermanRewardCut_12664": { + "entryPoint": null, + "id": 12664, + "parameterSlots": 0, + "returnSlots": 1 + }, + "@getStakeSnapshot_12706": { + "entryPoint": 4265, + "id": 12706, + "parameterSlots": 1, + "returnSlots": 1 + }, + "@initialize_12040": { + "entryPoint": 1532, + "id": 12040, + "parameterSlots": 6, + "returnSlots": 0 + }, + "@isDisputeCreated_12801": { + "entryPoint": 4211, + "id": 12801, + "parameterSlots": 1, + "returnSlots": 1 + }, + "@isValidPPM_4538": { + "entryPoint": null, + "id": 4538, + "parameterSlots": 1, + "returnSlots": 1 + }, + "@maxSlashingCut_13568": { + "entryPoint": null, + "id": 13568, + "parameterSlots": 0, + "returnSlots": 0 + }, + "@min_4423": { + "entryPoint": 10894, + "id": 4423, + "parameterSlots": 2, + "returnSlots": 1 + }, + "@mulPPM_4496": { + "entryPoint": 10798, + "id": 4496, + "parameterSlots": 2, + "returnSlots": 1 + }, + "@owner_5034": { + "entryPoint": 3525, + "id": 5034, + "parameterSlots": 0, + "returnSlots": 1 + }, + "@parse_16223": { + "entryPoint": 8549, + "id": 16223, + "parameterSlots": 1, + "returnSlots": 1 + }, + "@pullTokens_792": { + "entryPoint": 6638, + "id": 792, + "parameterSlots": 3, + "returnSlots": 0 + }, + "@pushTokens_818": { + "entryPoint": 8065, + "id": 818, + "parameterSlots": 3, + "returnSlots": 0 + }, + "@recover_7987": { + "entryPoint": 10756, + "id": 7987, + "parameterSlots": 2, + "returnSlots": 1 + }, + "@rejectDispute_12466": { + "entryPoint": 2216, + "id": 12466, + "parameterSlots": 1, + "returnSlots": 0 + }, + "@renounceOwnership_5065": { + "entryPoint": 2559, + "id": 5065, + "parameterSlots": 0, + "returnSlots": 0 + }, + "@setArbitrator_12569": { + "entryPoint": 4194, + "id": 12569, + "parameterSlots": 1, + "returnSlots": 0 + }, + "@setDisputeDeposit_12597": { + "entryPoint": 1844, + "id": 12597, + "parameterSlots": 1, + "returnSlots": 0 + }, + "@setDisputePeriod_12583": { + "entryPoint": 5365, + "id": 12583, + "parameterSlots": 1, + "returnSlots": 0 + }, + "@setFishermanRewardCut_12611": { + "entryPoint": 2579, + "id": 12611, + "parameterSlots": 1, + "returnSlots": 0 + }, + "@setMaxSlashingCut_12625": { + "entryPoint": 3824, + "id": 12625, + "parameterSlots": 1, + "returnSlots": 0 + }, + "@setSubgraphService_12639": { + "entryPoint": 3807, + "id": 12639, + "parameterSlots": 1, + "returnSlots": 0 + }, + "@subgraphService_13553": { + "entryPoint": null, + "id": 13553, + "parameterSlots": 0, + "returnSlots": 0 + }, + "@transferOwnership_5093": { + "entryPoint": 5382, + "id": 5093, + "parameterSlots": 1, + "returnSlots": 0 + }, + "@tryRecover_7957": { + "entryPoint": 10943, + "id": 7957, + "parameterSlots": 2, + "returnSlots": 3 + }, + "@tryRecover_8145": { + "entryPoint": 11205, + "id": 8145, + "parameterSlots": 4, + "returnSlots": 3 + }, + "abi_decode_address_fromMemory": { + "entryPoint": 12872, + "id": null, + "parameterSlots": 1, + "returnSlots": 1 + }, + "abi_decode_bytes_calldata": { + "entryPoint": 12124, + "id": null, + "parameterSlots": 2, + "returnSlots": 2 + }, + "abi_decode_struct_Allocation_fromMemory": { + "entryPoint": 12888, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "abi_decode_struct_State_calldata": { + "entryPoint": 12644, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "abi_decode_tuple_t_address": { + "entryPoint": 12018, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "abi_decode_tuple_t_addresst_addresst_uint256t_uint256": { + "entryPoint": 11948, + "id": null, + "parameterSlots": 2, + "returnSlots": 4 + }, + "abi_decode_tuple_t_addresst_addresst_uint64t_uint256t_uint32t_uint32": { + "entryPoint": 11513, + "id": null, + "parameterSlots": 2, + "returnSlots": 6 + }, + "abi_decode_tuple_t_addresst_bytes32": { + "entryPoint": 11828, + "id": null, + "parameterSlots": 2, + "returnSlots": 2 + }, + "abi_decode_tuple_t_bool_fromMemory": { + "entryPoint": 13448, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "abi_decode_tuple_t_bytes32": { + "entryPoint": 11634, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "abi_decode_tuple_t_bytes32t_bytes32t_bytes32_fromMemory": { + "entryPoint": 13604, + "id": null, + "parameterSlots": 2, + "returnSlots": 3 + }, + "abi_decode_tuple_t_bytes32t_uint256": { + "entryPoint": 11402, + "id": null, + "parameterSlots": 2, + "returnSlots": 2 + }, + "abi_decode_tuple_t_bytes32t_uint256t_boolt_uint256": { + "entryPoint": 12061, + "id": null, + "parameterSlots": 2, + "returnSlots": 4 + }, + "abi_decode_tuple_t_bytes_calldata_ptr": { + "entryPoint": 12196, + "id": null, + "parameterSlots": 2, + "returnSlots": 2 + }, + "abi_decode_tuple_t_bytes_calldata_ptrt_bytes_calldata_ptr": { + "entryPoint": 12261, + "id": null, + "parameterSlots": 2, + "returnSlots": 4 + }, + "abi_decode_tuple_t_struct$_Allocation_$3073_memory_ptr_fromMemory": { + "entryPoint": 13017, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "abi_decode_tuple_t_struct$_DelegationPool_$3992_memory_ptr_fromMemory": { + "entryPoint": 13477, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "abi_decode_tuple_t_struct$_Provision_$3962_memory_ptr_fromMemory": { + "entryPoint": 13241, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "abi_decode_tuple_t_struct$_Receipt_$16044_calldata_ptr": { + "entryPoint": 11892, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "abi_decode_tuple_t_struct$_Receipt_$16044_memory_ptr": { + "entryPoint": 12765, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "abi_decode_tuple_t_struct$_State_$15663_memory_ptr_fromMemory": { + "entryPoint": null, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "abi_decode_tuple_t_struct$_State_$16058_calldata_ptrt_struct$_State_$16058_calldata_ptr": { + "entryPoint": 12668, + "id": null, + "parameterSlots": 2, + "returnSlots": 2 + }, + "abi_decode_tuple_t_struct$_State_$16058_memory_ptr": { + "entryPoint": 12538, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "abi_decode_tuple_t_uint256": { + "entryPoint": null, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "abi_decode_tuple_t_uint32": { + "entryPoint": 11919, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "abi_decode_tuple_t_uint64": { + "entryPoint": 12722, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "abi_decode_uint32_fromMemory": { + "entryPoint": 13219, + "id": null, + "parameterSlots": 1, + "returnSlots": 1 + }, + "abi_decode_uint64_fromMemory": { + "entryPoint": 13230, + "id": null, + "parameterSlots": 1, + "returnSlots": 1 + }, + "abi_encode_bytes": { + "entryPoint": 13087, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "abi_encode_enum_DisputeStatus": { + "entryPoint": 11681, + "id": null, + "parameterSlots": 2, + "returnSlots": 0 + }, + "abi_encode_tuple_packed_t_address_t_bytes32__to_t_address_t_bytes32__nonPadded_inplace_fromStack_reversed": { + "entryPoint": null, + "id": null, + "parameterSlots": 3, + "returnSlots": 1 + }, + "abi_encode_tuple_packed_t_address_t_stringliteral_b7ccb6878fbded310d2d05350bca9c84568ecb568d4b626c83e0508c3193ce89__to_t_address_t_string_memory_ptr__nonPadded_inplace_fromStack_reversed": { + "entryPoint": null, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "abi_encode_tuple_packed_t_bytes32_t_bytes32_t_bytes32_t_address_t_address__to_t_bytes32_t_bytes32_t_bytes32_t_address_t_address__nonPadded_inplace_fromStack_reversed": { + "entryPoint": null, + "id": null, + "parameterSlots": 6, + "returnSlots": 1 + }, + "abi_encode_tuple_packed_t_bytes32_t_bytes32_t_uint8__to_t_bytes32_t_bytes32_t_uint8__nonPadded_inplace_fromStack_reversed": { + "entryPoint": null, + "id": null, + "parameterSlots": 4, + "returnSlots": 1 + }, + "abi_encode_tuple_packed_t_stringliteral_301a50b291d33ce1e8e9064e3f6a6c51d902ec22892b50d58abf6357c6a45541_t_bytes32_t_bytes32__to_t_string_memory_ptr_t_bytes32_t_bytes32__nonPadded_inplace_fromStack_reversed": { + "entryPoint": null, + "id": null, + "parameterSlots": 3, + "returnSlots": 1 + }, + "abi_encode_tuple_t_address__to_t_address__fromStack_reversed": { + "entryPoint": null, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "abi_encode_tuple_t_address_t_address__to_t_address_t_address__fromStack_reversed": { + "entryPoint": 13193, + "id": null, + "parameterSlots": 3, + "returnSlots": 1 + }, + "abi_encode_tuple_t_address_t_address_t_uint256__to_t_address_t_address_t_uint256__fromStack_reversed": { + "entryPoint": null, + "id": null, + "parameterSlots": 4, + "returnSlots": 1 + }, + "abi_encode_tuple_t_address_t_address_t_uint256_t_bytes32_t_enum$_DisputeType_$14913_t_enum$_DisputeStatus_$14921_t_uint256_t_uint256_t_uint256__to_t_address_t_address_t_uint256_t_bytes32_t_uint8_t_uint8_t_uint256_t_uint256_t_uint256__fromStack_reversed": { + "entryPoint": 11701, + "id": null, + "parameterSlots": 10, + "returnSlots": 1 + }, + "abi_encode_tuple_t_address_t_bytes_memory_ptr__to_t_address_t_bytes_memory_ptr__fromStack_reversed": { + "entryPoint": 13157, + "id": null, + "parameterSlots": 3, + "returnSlots": 1 + }, + "abi_encode_tuple_t_address_t_uint256__to_t_address_t_uint256__fromStack_reversed": { + "entryPoint": null, + "id": null, + "parameterSlots": 3, + "returnSlots": 1 + }, + "abi_encode_tuple_t_address_t_uint256_t_uint256__to_t_address_t_uint256_t_uint256__fromStack_reversed": { + "entryPoint": null, + "id": null, + "parameterSlots": 4, + "returnSlots": 1 + }, + "abi_encode_tuple_t_bool__to_t_bool__fromStack_reversed": { + "entryPoint": null, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "abi_encode_tuple_t_bytes32__to_t_bytes32__fromStack_reversed": { + "entryPoint": null, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "abi_encode_tuple_t_bytes32_t_bytes32__to_t_bytes32_t_bytes32__fromStack_reversed": { + "entryPoint": 12372, + "id": null, + "parameterSlots": 3, + "returnSlots": 1 + }, + "abi_encode_tuple_t_bytes32_t_bytes32_t_bytes32_t_bytes32__to_t_bytes32_t_bytes32_t_bytes32_t_bytes32__fromStack_reversed": { + "entryPoint": null, + "id": null, + "parameterSlots": 5, + "returnSlots": 1 + }, + "abi_encode_tuple_t_bytes32_t_bytes32_t_bytes32_t_bytes32_t_bytes32_t_bytes32__to_t_bytes32_t_bytes32_t_bytes32_t_bytes32_t_bytes32_t_bytes32__fromStack_reversed": { + "entryPoint": null, + "id": null, + "parameterSlots": 7, + "returnSlots": 1 + }, + "abi_encode_tuple_t_bytes32_t_bytes32_t_bytes32_t_uint256_t_address_t_bytes32__to_t_bytes32_t_bytes32_t_bytes32_t_uint256_t_address_t_bytes32__fromStack_reversed": { + "entryPoint": null, + "id": null, + "parameterSlots": 7, + "returnSlots": 1 + }, + "abi_encode_tuple_t_bytes32_t_uint8_t_bytes32_t_bytes32__to_t_bytes32_t_uint8_t_bytes32_t_bytes32__fromStack_reversed": { + "entryPoint": null, + "id": null, + "parameterSlots": 5, + "returnSlots": 1 + }, + "abi_encode_tuple_t_contract$_ISubgraphService_$15634__to_t_address__fromStack_reversed": { + "entryPoint": 11808, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "abi_encode_tuple_t_enum$_DisputeStatus_$14921__to_t_uint8__fromStack_reversed": { + "entryPoint": 12751, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "abi_encode_tuple_t_rational_1_by_1__to_t_uint64__fromStack_reversed": { + "entryPoint": null, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "abi_encode_tuple_t_stringliteral_aaf3daf27360df170a52f29a0edeebb3d20b8e3dc84a13c5eaf056803b549f50__to_t_string_memory_ptr__fromStack_reversed": { + "entryPoint": null, + "id": null, + "parameterSlots": 1, + "returnSlots": 1 + }, + "abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed": { + "entryPoint": null, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "abi_encode_tuple_t_uint256_t_address_t_bytes32_t_uint256_t_uint256__to_t_uint256_t_address_t_bytes32_t_uint256_t_uint256__fromStack_reversed": { + "entryPoint": null, + "id": null, + "parameterSlots": 6, + "returnSlots": 1 + }, + "abi_encode_tuple_t_uint256_t_bytes32_t_bytes_memory_ptr_t_uint256_t_uint256__to_t_uint256_t_bytes32_t_bytes_memory_ptr_t_uint256_t_uint256__fromStack_reversed": { + "entryPoint": 13650, + "id": null, + "parameterSlots": 6, + "returnSlots": 1 + }, + "abi_encode_tuple_t_uint256_t_uint256__to_t_uint256_t_uint256__fromStack_reversed": { + "entryPoint": null, + "id": null, + "parameterSlots": 3, + "returnSlots": 1 + }, + "abi_encode_tuple_t_uint32__to_t_uint32__fromStack_reversed": { + "entryPoint": 11436, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "abi_encode_tuple_t_uint64__to_t_uint64__fromStack_reversed": { + "entryPoint": 11872, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "allocate_memory": { + "entryPoint": 12386, + "id": null, + "parameterSlots": 0, + "returnSlots": 1 + }, + "allocate_memory_2390": { + "entryPoint": 12440, + "id": null, + "parameterSlots": 0, + "returnSlots": 1 + }, + "allocate_memory_2392": { + "entryPoint": 12489, + "id": null, + "parameterSlots": 0, + "returnSlots": 1 + }, + "checked_add_t_uint256": { + "entryPoint": 13068, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "checked_div_t_uint256": { + "entryPoint": 13414, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "checked_mul_t_uint256": { + "entryPoint": 13701, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "panic_error_0x11": { + "entryPoint": 13046, + "id": null, + "parameterSlots": 0, + "returnSlots": 0 + }, + "panic_error_0x21": { + "entryPoint": 11659, + "id": null, + "parameterSlots": 0, + "returnSlots": 0 + }, + "validator_revert_address": { + "entryPoint": 11453, + "id": null, + "parameterSlots": 1, + "returnSlots": 0 + }, + "validator_revert_bool": { + "entryPoint": 12047, + "id": null, + "parameterSlots": 1, + "returnSlots": 0 + }, + "validator_revert_uint32": { + "entryPoint": 11495, + "id": null, + "parameterSlots": 1, + "returnSlots": 0 + }, + "validator_revert_uint64": { + "entryPoint": 11474, + "id": null, + "parameterSlots": 1, + "returnSlots": 0 + } + }, + "generatedSources": [ + { + "ast": { + "nativeSrc": "0:26391:70", + "nodeType": "YulBlock", + "src": "0:26391:70", + "statements": [ + { + "nativeSrc": "6:3:70", + "nodeType": "YulBlock", + "src": "6:3:70", + "statements": [] + }, + { + "body": { + "nativeSrc": "101:259:70", + "nodeType": "YulBlock", + "src": "101:259:70", + "statements": [ + { + "body": { + "nativeSrc": "147:16:70", + "nodeType": "YulBlock", + "src": "147:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "156:1:70", + "nodeType": "YulLiteral", + "src": "156:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "159:1:70", + "nodeType": "YulLiteral", + "src": "159:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "149:6:70", + "nodeType": "YulIdentifier", + "src": "149:6:70" + }, + "nativeSrc": "149:12:70", + "nodeType": "YulFunctionCall", + "src": "149:12:70" + }, + "nativeSrc": "149:12:70", + "nodeType": "YulExpressionStatement", + "src": "149:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "dataEnd", + "nativeSrc": "122:7:70", + "nodeType": "YulIdentifier", + "src": "122:7:70" + }, + { + "name": "headStart", + "nativeSrc": "131:9:70", + "nodeType": "YulIdentifier", + "src": "131:9:70" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "118:3:70", + "nodeType": "YulIdentifier", + "src": "118:3:70" + }, + "nativeSrc": "118:23:70", + "nodeType": "YulFunctionCall", + "src": "118:23:70" + }, + { + "kind": "number", + "nativeSrc": "143:2:70", + "nodeType": "YulLiteral", + "src": "143:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "slt", + "nativeSrc": "114:3:70", + "nodeType": "YulIdentifier", + "src": "114:3:70" + }, + "nativeSrc": "114:32:70", + "nodeType": "YulFunctionCall", + "src": "114:32:70" + }, + "nativeSrc": "111:52:70", + "nodeType": "YulIf", + "src": "111:52:70" + }, + { + "nativeSrc": "172:14:70", + "nodeType": "YulVariableDeclaration", + "src": "172:14:70", + "value": { + "kind": "number", + "nativeSrc": "185:1:70", + "nodeType": "YulLiteral", + "src": "185:1:70", + "type": "", + "value": "0" + }, + "variables": [ + { + "name": "value", + "nativeSrc": "176:5:70", + "nodeType": "YulTypedName", + "src": "176:5:70", + "type": "" + } + ] + }, + { + "nativeSrc": "195:32:70", + "nodeType": "YulAssignment", + "src": "195:32:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "217:9:70", + "nodeType": "YulIdentifier", + "src": "217:9:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "204:12:70", + "nodeType": "YulIdentifier", + "src": "204:12:70" + }, + "nativeSrc": "204:23:70", + "nodeType": "YulFunctionCall", + "src": "204:23:70" + }, + "variableNames": [ + { + "name": "value", + "nativeSrc": "195:5:70", + "nodeType": "YulIdentifier", + "src": "195:5:70" + } + ] + }, + { + "nativeSrc": "236:15:70", + "nodeType": "YulAssignment", + "src": "236:15:70", + "value": { + "name": "value", + "nativeSrc": "246:5:70", + "nodeType": "YulIdentifier", + "src": "246:5:70" + }, + "variableNames": [ + { + "name": "value0", + "nativeSrc": "236:6:70", + "nodeType": "YulIdentifier", + "src": "236:6:70" + } + ] + }, + { + "nativeSrc": "260:16:70", + "nodeType": "YulVariableDeclaration", + "src": "260:16:70", + "value": { + "kind": "number", + "nativeSrc": "275:1:70", + "nodeType": "YulLiteral", + "src": "275:1:70", + "type": "", + "value": "0" + }, + "variables": [ + { + "name": "value_1", + "nativeSrc": "264:7:70", + "nodeType": "YulTypedName", + "src": "264:7:70", + "type": "" + } + ] + }, + { + "nativeSrc": "285:43:70", + "nodeType": "YulAssignment", + "src": "285:43:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "313:9:70", + "nodeType": "YulIdentifier", + "src": "313:9:70" + }, + { + "kind": "number", + "nativeSrc": "324:2:70", + "nodeType": "YulLiteral", + "src": "324:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "309:3:70", + "nodeType": "YulIdentifier", + "src": "309:3:70" + }, + "nativeSrc": "309:18:70", + "nodeType": "YulFunctionCall", + "src": "309:18:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "296:12:70", + "nodeType": "YulIdentifier", + "src": "296:12:70" + }, + "nativeSrc": "296:32:70", + "nodeType": "YulFunctionCall", + "src": "296:32:70" + }, + "variableNames": [ + { + "name": "value_1", + "nativeSrc": "285:7:70", + "nodeType": "YulIdentifier", + "src": "285:7:70" + } + ] + }, + { + "nativeSrc": "337:17:70", + "nodeType": "YulAssignment", + "src": "337:17:70", + "value": { + "name": "value_1", + "nativeSrc": "347:7:70", + "nodeType": "YulIdentifier", + "src": "347:7:70" + }, + "variableNames": [ + { + "name": "value1", + "nativeSrc": "337:6:70", + "nodeType": "YulIdentifier", + "src": "337:6:70" + } + ] + } + ] + }, + "name": "abi_decode_tuple_t_bytes32t_uint256", + "nativeSrc": "14:346:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "59:9:70", + "nodeType": "YulTypedName", + "src": "59:9:70", + "type": "" + }, + { + "name": "dataEnd", + "nativeSrc": "70:7:70", + "nodeType": "YulTypedName", + "src": "70:7:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value0", + "nativeSrc": "82:6:70", + "nodeType": "YulTypedName", + "src": "82:6:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "90:6:70", + "nodeType": "YulTypedName", + "src": "90:6:70", + "type": "" + } + ], + "src": "14:346:70" + }, + { + "body": { + "nativeSrc": "464:93:70", + "nodeType": "YulBlock", + "src": "464:93:70", + "statements": [ + { + "nativeSrc": "474:26:70", + "nodeType": "YulAssignment", + "src": "474:26:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "486:9:70", + "nodeType": "YulIdentifier", + "src": "486:9:70" + }, + { + "kind": "number", + "nativeSrc": "497:2:70", + "nodeType": "YulLiteral", + "src": "497:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "482:3:70", + "nodeType": "YulIdentifier", + "src": "482:3:70" + }, + "nativeSrc": "482:18:70", + "nodeType": "YulFunctionCall", + "src": "482:18:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "474:4:70", + "nodeType": "YulIdentifier", + "src": "474:4:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "516:9:70", + "nodeType": "YulIdentifier", + "src": "516:9:70" + }, + { + "arguments": [ + { + "name": "value0", + "nativeSrc": "531:6:70", + "nodeType": "YulIdentifier", + "src": "531:6:70" + }, + { + "kind": "number", + "nativeSrc": "539:10:70", + "nodeType": "YulLiteral", + "src": "539:10:70", + "type": "", + "value": "0xffffffff" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "527:3:70", + "nodeType": "YulIdentifier", + "src": "527:3:70" + }, + "nativeSrc": "527:23:70", + "nodeType": "YulFunctionCall", + "src": "527:23:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "509:6:70", + "nodeType": "YulIdentifier", + "src": "509:6:70" + }, + "nativeSrc": "509:42:70", + "nodeType": "YulFunctionCall", + "src": "509:42:70" + }, + "nativeSrc": "509:42:70", + "nodeType": "YulExpressionStatement", + "src": "509:42:70" + } + ] + }, + "name": "abi_encode_tuple_t_uint32__to_t_uint32__fromStack_reversed", + "nativeSrc": "365:192:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "433:9:70", + "nodeType": "YulTypedName", + "src": "433:9:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "444:6:70", + "nodeType": "YulTypedName", + "src": "444:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "455:4:70", + "nodeType": "YulTypedName", + "src": "455:4:70", + "type": "" + } + ], + "src": "365:192:70" + }, + { + "body": { + "nativeSrc": "607:86:70", + "nodeType": "YulBlock", + "src": "607:86:70", + "statements": [ + { + "body": { + "nativeSrc": "671:16:70", + "nodeType": "YulBlock", + "src": "671:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "680:1:70", + "nodeType": "YulLiteral", + "src": "680:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "683:1:70", + "nodeType": "YulLiteral", + "src": "683:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "673:6:70", + "nodeType": "YulIdentifier", + "src": "673:6:70" + }, + "nativeSrc": "673:12:70", + "nodeType": "YulFunctionCall", + "src": "673:12:70" + }, + "nativeSrc": "673:12:70", + "nodeType": "YulExpressionStatement", + "src": "673:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "value", + "nativeSrc": "630:5:70", + "nodeType": "YulIdentifier", + "src": "630:5:70" + }, + { + "arguments": [ + { + "name": "value", + "nativeSrc": "641:5:70", + "nodeType": "YulIdentifier", + "src": "641:5:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "656:3:70", + "nodeType": "YulLiteral", + "src": "656:3:70", + "type": "", + "value": "160" + }, + { + "kind": "number", + "nativeSrc": "661:1:70", + "nodeType": "YulLiteral", + "src": "661:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "652:3:70", + "nodeType": "YulIdentifier", + "src": "652:3:70" + }, + "nativeSrc": "652:11:70", + "nodeType": "YulFunctionCall", + "src": "652:11:70" + }, + { + "kind": "number", + "nativeSrc": "665:1:70", + "nodeType": "YulLiteral", + "src": "665:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "648:3:70", + "nodeType": "YulIdentifier", + "src": "648:3:70" + }, + "nativeSrc": "648:19:70", + "nodeType": "YulFunctionCall", + "src": "648:19:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "637:3:70", + "nodeType": "YulIdentifier", + "src": "637:3:70" + }, + "nativeSrc": "637:31:70", + "nodeType": "YulFunctionCall", + "src": "637:31:70" + } + ], + "functionName": { + "name": "eq", + "nativeSrc": "627:2:70", + "nodeType": "YulIdentifier", + "src": "627:2:70" + }, + "nativeSrc": "627:42:70", + "nodeType": "YulFunctionCall", + "src": "627:42:70" + } + ], + "functionName": { + "name": "iszero", + "nativeSrc": "620:6:70", + "nodeType": "YulIdentifier", + "src": "620:6:70" + }, + "nativeSrc": "620:50:70", + "nodeType": "YulFunctionCall", + "src": "620:50:70" + }, + "nativeSrc": "617:70:70", + "nodeType": "YulIf", + "src": "617:70:70" + } + ] + }, + "name": "validator_revert_address", + "nativeSrc": "562:131:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "value", + "nativeSrc": "596:5:70", + "nodeType": "YulTypedName", + "src": "596:5:70", + "type": "" + } + ], + "src": "562:131:70" + }, + { + "body": { + "nativeSrc": "742:85:70", + "nodeType": "YulBlock", + "src": "742:85:70", + "statements": [ + { + "body": { + "nativeSrc": "805:16:70", + "nodeType": "YulBlock", + "src": "805:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "814:1:70", + "nodeType": "YulLiteral", + "src": "814:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "817:1:70", + "nodeType": "YulLiteral", + "src": "817:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "807:6:70", + "nodeType": "YulIdentifier", + "src": "807:6:70" + }, + "nativeSrc": "807:12:70", + "nodeType": "YulFunctionCall", + "src": "807:12:70" + }, + "nativeSrc": "807:12:70", + "nodeType": "YulExpressionStatement", + "src": "807:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "value", + "nativeSrc": "765:5:70", + "nodeType": "YulIdentifier", + "src": "765:5:70" + }, + { + "arguments": [ + { + "name": "value", + "nativeSrc": "776:5:70", + "nodeType": "YulIdentifier", + "src": "776:5:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "791:2:70", + "nodeType": "YulLiteral", + "src": "791:2:70", + "type": "", + "value": "64" + }, + { + "kind": "number", + "nativeSrc": "795:1:70", + "nodeType": "YulLiteral", + "src": "795:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "787:3:70", + "nodeType": "YulIdentifier", + "src": "787:3:70" + }, + "nativeSrc": "787:10:70", + "nodeType": "YulFunctionCall", + "src": "787:10:70" + }, + { + "kind": "number", + "nativeSrc": "799:1:70", + "nodeType": "YulLiteral", + "src": "799:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "783:3:70", + "nodeType": "YulIdentifier", + "src": "783:3:70" + }, + "nativeSrc": "783:18:70", + "nodeType": "YulFunctionCall", + "src": "783:18:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "772:3:70", + "nodeType": "YulIdentifier", + "src": "772:3:70" + }, + "nativeSrc": "772:30:70", + "nodeType": "YulFunctionCall", + "src": "772:30:70" + } + ], + "functionName": { + "name": "eq", + "nativeSrc": "762:2:70", + "nodeType": "YulIdentifier", + "src": "762:2:70" + }, + "nativeSrc": "762:41:70", + "nodeType": "YulFunctionCall", + "src": "762:41:70" + } + ], + "functionName": { + "name": "iszero", + "nativeSrc": "755:6:70", + "nodeType": "YulIdentifier", + "src": "755:6:70" + }, + "nativeSrc": "755:49:70", + "nodeType": "YulFunctionCall", + "src": "755:49:70" + }, + "nativeSrc": "752:69:70", + "nodeType": "YulIf", + "src": "752:69:70" + } + ] + }, + "name": "validator_revert_uint64", + "nativeSrc": "698:129:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "value", + "nativeSrc": "731:5:70", + "nodeType": "YulTypedName", + "src": "731:5:70", + "type": "" + } + ], + "src": "698:129:70" + }, + { + "body": { + "nativeSrc": "876:77:70", + "nodeType": "YulBlock", + "src": "876:77:70", + "statements": [ + { + "body": { + "nativeSrc": "931:16:70", + "nodeType": "YulBlock", + "src": "931:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "940:1:70", + "nodeType": "YulLiteral", + "src": "940:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "943:1:70", + "nodeType": "YulLiteral", + "src": "943:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "933:6:70", + "nodeType": "YulIdentifier", + "src": "933:6:70" + }, + "nativeSrc": "933:12:70", + "nodeType": "YulFunctionCall", + "src": "933:12:70" + }, + "nativeSrc": "933:12:70", + "nodeType": "YulExpressionStatement", + "src": "933:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "value", + "nativeSrc": "899:5:70", + "nodeType": "YulIdentifier", + "src": "899:5:70" + }, + { + "arguments": [ + { + "name": "value", + "nativeSrc": "910:5:70", + "nodeType": "YulIdentifier", + "src": "910:5:70" + }, + { + "kind": "number", + "nativeSrc": "917:10:70", + "nodeType": "YulLiteral", + "src": "917:10:70", + "type": "", + "value": "0xffffffff" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "906:3:70", + "nodeType": "YulIdentifier", + "src": "906:3:70" + }, + "nativeSrc": "906:22:70", + "nodeType": "YulFunctionCall", + "src": "906:22:70" + } + ], + "functionName": { + "name": "eq", + "nativeSrc": "896:2:70", + "nodeType": "YulIdentifier", + "src": "896:2:70" + }, + "nativeSrc": "896:33:70", + "nodeType": "YulFunctionCall", + "src": "896:33:70" + } + ], + "functionName": { + "name": "iszero", + "nativeSrc": "889:6:70", + "nodeType": "YulIdentifier", + "src": "889:6:70" + }, + "nativeSrc": "889:41:70", + "nodeType": "YulFunctionCall", + "src": "889:41:70" + }, + "nativeSrc": "886:61:70", + "nodeType": "YulIf", + "src": "886:61:70" + } + ] + }, + "name": "validator_revert_uint32", + "nativeSrc": "832:121:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "value", + "nativeSrc": "865:5:70", + "nodeType": "YulTypedName", + "src": "865:5:70", + "type": "" + } + ], + "src": "832:121:70" + }, + { + "body": { + "nativeSrc": "1110:776:70", + "nodeType": "YulBlock", + "src": "1110:776:70", + "statements": [ + { + "body": { + "nativeSrc": "1157:16:70", + "nodeType": "YulBlock", + "src": "1157:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "1166:1:70", + "nodeType": "YulLiteral", + "src": "1166:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "1169:1:70", + "nodeType": "YulLiteral", + "src": "1169:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "1159:6:70", + "nodeType": "YulIdentifier", + "src": "1159:6:70" + }, + "nativeSrc": "1159:12:70", + "nodeType": "YulFunctionCall", + "src": "1159:12:70" + }, + "nativeSrc": "1159:12:70", + "nodeType": "YulExpressionStatement", + "src": "1159:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "dataEnd", + "nativeSrc": "1131:7:70", + "nodeType": "YulIdentifier", + "src": "1131:7:70" + }, + { + "name": "headStart", + "nativeSrc": "1140:9:70", + "nodeType": "YulIdentifier", + "src": "1140:9:70" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "1127:3:70", + "nodeType": "YulIdentifier", + "src": "1127:3:70" + }, + "nativeSrc": "1127:23:70", + "nodeType": "YulFunctionCall", + "src": "1127:23:70" + }, + { + "kind": "number", + "nativeSrc": "1152:3:70", + "nodeType": "YulLiteral", + "src": "1152:3:70", + "type": "", + "value": "192" + } + ], + "functionName": { + "name": "slt", + "nativeSrc": "1123:3:70", + "nodeType": "YulIdentifier", + "src": "1123:3:70" + }, + "nativeSrc": "1123:33:70", + "nodeType": "YulFunctionCall", + "src": "1123:33:70" + }, + "nativeSrc": "1120:53:70", + "nodeType": "YulIf", + "src": "1120:53:70" + }, + { + "nativeSrc": "1182:36:70", + "nodeType": "YulVariableDeclaration", + "src": "1182:36:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "1208:9:70", + "nodeType": "YulIdentifier", + "src": "1208:9:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "1195:12:70", + "nodeType": "YulIdentifier", + "src": "1195:12:70" + }, + "nativeSrc": "1195:23:70", + "nodeType": "YulFunctionCall", + "src": "1195:23:70" + }, + "variables": [ + { + "name": "value", + "nativeSrc": "1186:5:70", + "nodeType": "YulTypedName", + "src": "1186:5:70", + "type": "" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "value", + "nativeSrc": "1252:5:70", + "nodeType": "YulIdentifier", + "src": "1252:5:70" + } + ], + "functionName": { + "name": "validator_revert_address", + "nativeSrc": "1227:24:70", + "nodeType": "YulIdentifier", + "src": "1227:24:70" + }, + "nativeSrc": "1227:31:70", + "nodeType": "YulFunctionCall", + "src": "1227:31:70" + }, + "nativeSrc": "1227:31:70", + "nodeType": "YulExpressionStatement", + "src": "1227:31:70" + }, + { + "nativeSrc": "1267:15:70", + "nodeType": "YulAssignment", + "src": "1267:15:70", + "value": { + "name": "value", + "nativeSrc": "1277:5:70", + "nodeType": "YulIdentifier", + "src": "1277:5:70" + }, + "variableNames": [ + { + "name": "value0", + "nativeSrc": "1267:6:70", + "nodeType": "YulIdentifier", + "src": "1267:6:70" + } + ] + }, + { + "nativeSrc": "1291:47:70", + "nodeType": "YulVariableDeclaration", + "src": "1291:47:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "1323:9:70", + "nodeType": "YulIdentifier", + "src": "1323:9:70" + }, + { + "kind": "number", + "nativeSrc": "1334:2:70", + "nodeType": "YulLiteral", + "src": "1334:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "1319:3:70", + "nodeType": "YulIdentifier", + "src": "1319:3:70" + }, + "nativeSrc": "1319:18:70", + "nodeType": "YulFunctionCall", + "src": "1319:18:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "1306:12:70", + "nodeType": "YulIdentifier", + "src": "1306:12:70" + }, + "nativeSrc": "1306:32:70", + "nodeType": "YulFunctionCall", + "src": "1306:32:70" + }, + "variables": [ + { + "name": "value_1", + "nativeSrc": "1295:7:70", + "nodeType": "YulTypedName", + "src": "1295:7:70", + "type": "" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "value_1", + "nativeSrc": "1372:7:70", + "nodeType": "YulIdentifier", + "src": "1372:7:70" + } + ], + "functionName": { + "name": "validator_revert_address", + "nativeSrc": "1347:24:70", + "nodeType": "YulIdentifier", + "src": "1347:24:70" + }, + "nativeSrc": "1347:33:70", + "nodeType": "YulFunctionCall", + "src": "1347:33:70" + }, + "nativeSrc": "1347:33:70", + "nodeType": "YulExpressionStatement", + "src": "1347:33:70" + }, + { + "nativeSrc": "1389:17:70", + "nodeType": "YulAssignment", + "src": "1389:17:70", + "value": { + "name": "value_1", + "nativeSrc": "1399:7:70", + "nodeType": "YulIdentifier", + "src": "1399:7:70" + }, + "variableNames": [ + { + "name": "value1", + "nativeSrc": "1389:6:70", + "nodeType": "YulIdentifier", + "src": "1389:6:70" + } + ] + }, + { + "nativeSrc": "1415:47:70", + "nodeType": "YulVariableDeclaration", + "src": "1415:47:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "1447:9:70", + "nodeType": "YulIdentifier", + "src": "1447:9:70" + }, + { + "kind": "number", + "nativeSrc": "1458:2:70", + "nodeType": "YulLiteral", + "src": "1458:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "1443:3:70", + "nodeType": "YulIdentifier", + "src": "1443:3:70" + }, + "nativeSrc": "1443:18:70", + "nodeType": "YulFunctionCall", + "src": "1443:18:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "1430:12:70", + "nodeType": "YulIdentifier", + "src": "1430:12:70" + }, + "nativeSrc": "1430:32:70", + "nodeType": "YulFunctionCall", + "src": "1430:32:70" + }, + "variables": [ + { + "name": "value_2", + "nativeSrc": "1419:7:70", + "nodeType": "YulTypedName", + "src": "1419:7:70", + "type": "" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "value_2", + "nativeSrc": "1495:7:70", + "nodeType": "YulIdentifier", + "src": "1495:7:70" + } + ], + "functionName": { + "name": "validator_revert_uint64", + "nativeSrc": "1471:23:70", + "nodeType": "YulIdentifier", + "src": "1471:23:70" + }, + "nativeSrc": "1471:32:70", + "nodeType": "YulFunctionCall", + "src": "1471:32:70" + }, + "nativeSrc": "1471:32:70", + "nodeType": "YulExpressionStatement", + "src": "1471:32:70" + }, + { + "nativeSrc": "1512:17:70", + "nodeType": "YulAssignment", + "src": "1512:17:70", + "value": { + "name": "value_2", + "nativeSrc": "1522:7:70", + "nodeType": "YulIdentifier", + "src": "1522:7:70" + }, + "variableNames": [ + { + "name": "value2", + "nativeSrc": "1512:6:70", + "nodeType": "YulIdentifier", + "src": "1512:6:70" + } + ] + }, + { + "nativeSrc": "1538:16:70", + "nodeType": "YulVariableDeclaration", + "src": "1538:16:70", + "value": { + "kind": "number", + "nativeSrc": "1553:1:70", + "nodeType": "YulLiteral", + "src": "1553:1:70", + "type": "", + "value": "0" + }, + "variables": [ + { + "name": "value_3", + "nativeSrc": "1542:7:70", + "nodeType": "YulTypedName", + "src": "1542:7:70", + "type": "" + } + ] + }, + { + "nativeSrc": "1563:43:70", + "nodeType": "YulAssignment", + "src": "1563:43:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "1591:9:70", + "nodeType": "YulIdentifier", + "src": "1591:9:70" + }, + { + "kind": "number", + "nativeSrc": "1602:2:70", + "nodeType": "YulLiteral", + "src": "1602:2:70", + "type": "", + "value": "96" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "1587:3:70", + "nodeType": "YulIdentifier", + "src": "1587:3:70" + }, + "nativeSrc": "1587:18:70", + "nodeType": "YulFunctionCall", + "src": "1587:18:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "1574:12:70", + "nodeType": "YulIdentifier", + "src": "1574:12:70" + }, + "nativeSrc": "1574:32:70", + "nodeType": "YulFunctionCall", + "src": "1574:32:70" + }, + "variableNames": [ + { + "name": "value_3", + "nativeSrc": "1563:7:70", + "nodeType": "YulIdentifier", + "src": "1563:7:70" + } + ] + }, + { + "nativeSrc": "1615:17:70", + "nodeType": "YulAssignment", + "src": "1615:17:70", + "value": { + "name": "value_3", + "nativeSrc": "1625:7:70", + "nodeType": "YulIdentifier", + "src": "1625:7:70" + }, + "variableNames": [ + { + "name": "value3", + "nativeSrc": "1615:6:70", + "nodeType": "YulIdentifier", + "src": "1615:6:70" + } + ] + }, + { + "nativeSrc": "1641:48:70", + "nodeType": "YulVariableDeclaration", + "src": "1641:48:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "1673:9:70", + "nodeType": "YulIdentifier", + "src": "1673:9:70" + }, + { + "kind": "number", + "nativeSrc": "1684:3:70", + "nodeType": "YulLiteral", + "src": "1684:3:70", + "type": "", + "value": "128" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "1669:3:70", + "nodeType": "YulIdentifier", + "src": "1669:3:70" + }, + "nativeSrc": "1669:19:70", + "nodeType": "YulFunctionCall", + "src": "1669:19:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "1656:12:70", + "nodeType": "YulIdentifier", + "src": "1656:12:70" + }, + "nativeSrc": "1656:33:70", + "nodeType": "YulFunctionCall", + "src": "1656:33:70" + }, + "variables": [ + { + "name": "value_4", + "nativeSrc": "1645:7:70", + "nodeType": "YulTypedName", + "src": "1645:7:70", + "type": "" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "value_4", + "nativeSrc": "1722:7:70", + "nodeType": "YulIdentifier", + "src": "1722:7:70" + } + ], + "functionName": { + "name": "validator_revert_uint32", + "nativeSrc": "1698:23:70", + "nodeType": "YulIdentifier", + "src": "1698:23:70" + }, + "nativeSrc": "1698:32:70", + "nodeType": "YulFunctionCall", + "src": "1698:32:70" + }, + "nativeSrc": "1698:32:70", + "nodeType": "YulExpressionStatement", + "src": "1698:32:70" + }, + { + "nativeSrc": "1739:17:70", + "nodeType": "YulAssignment", + "src": "1739:17:70", + "value": { + "name": "value_4", + "nativeSrc": "1749:7:70", + "nodeType": "YulIdentifier", + "src": "1749:7:70" + }, + "variableNames": [ + { + "name": "value4", + "nativeSrc": "1739:6:70", + "nodeType": "YulIdentifier", + "src": "1739:6:70" + } + ] + }, + { + "nativeSrc": "1765:48:70", + "nodeType": "YulVariableDeclaration", + "src": "1765:48:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "1797:9:70", + "nodeType": "YulIdentifier", + "src": "1797:9:70" + }, + { + "kind": "number", + "nativeSrc": "1808:3:70", + "nodeType": "YulLiteral", + "src": "1808:3:70", + "type": "", + "value": "160" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "1793:3:70", + "nodeType": "YulIdentifier", + "src": "1793:3:70" + }, + "nativeSrc": "1793:19:70", + "nodeType": "YulFunctionCall", + "src": "1793:19:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "1780:12:70", + "nodeType": "YulIdentifier", + "src": "1780:12:70" + }, + "nativeSrc": "1780:33:70", + "nodeType": "YulFunctionCall", + "src": "1780:33:70" + }, + "variables": [ + { + "name": "value_5", + "nativeSrc": "1769:7:70", + "nodeType": "YulTypedName", + "src": "1769:7:70", + "type": "" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "value_5", + "nativeSrc": "1846:7:70", + "nodeType": "YulIdentifier", + "src": "1846:7:70" + } + ], + "functionName": { + "name": "validator_revert_uint32", + "nativeSrc": "1822:23:70", + "nodeType": "YulIdentifier", + "src": "1822:23:70" + }, + "nativeSrc": "1822:32:70", + "nodeType": "YulFunctionCall", + "src": "1822:32:70" + }, + "nativeSrc": "1822:32:70", + "nodeType": "YulExpressionStatement", + "src": "1822:32:70" + }, + { + "nativeSrc": "1863:17:70", + "nodeType": "YulAssignment", + "src": "1863:17:70", + "value": { + "name": "value_5", + "nativeSrc": "1873:7:70", + "nodeType": "YulIdentifier", + "src": "1873:7:70" + }, + "variableNames": [ + { + "name": "value5", + "nativeSrc": "1863:6:70", + "nodeType": "YulIdentifier", + "src": "1863:6:70" + } + ] + } + ] + }, + "name": "abi_decode_tuple_t_addresst_addresst_uint64t_uint256t_uint32t_uint32", + "nativeSrc": "958:928:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "1036:9:70", + "nodeType": "YulTypedName", + "src": "1036:9:70", + "type": "" + }, + { + "name": "dataEnd", + "nativeSrc": "1047:7:70", + "nodeType": "YulTypedName", + "src": "1047:7:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value0", + "nativeSrc": "1059:6:70", + "nodeType": "YulTypedName", + "src": "1059:6:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "1067:6:70", + "nodeType": "YulTypedName", + "src": "1067:6:70", + "type": "" + }, + { + "name": "value2", + "nativeSrc": "1075:6:70", + "nodeType": "YulTypedName", + "src": "1075:6:70", + "type": "" + }, + { + "name": "value3", + "nativeSrc": "1083:6:70", + "nodeType": "YulTypedName", + "src": "1083:6:70", + "type": "" + }, + { + "name": "value4", + "nativeSrc": "1091:6:70", + "nodeType": "YulTypedName", + "src": "1091:6:70", + "type": "" + }, + { + "name": "value5", + "nativeSrc": "1099:6:70", + "nodeType": "YulTypedName", + "src": "1099:6:70", + "type": "" + } + ], + "src": "958:928:70" + }, + { + "body": { + "nativeSrc": "1961:156:70", + "nodeType": "YulBlock", + "src": "1961:156:70", + "statements": [ + { + "body": { + "nativeSrc": "2007:16:70", + "nodeType": "YulBlock", + "src": "2007:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "2016:1:70", + "nodeType": "YulLiteral", + "src": "2016:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "2019:1:70", + "nodeType": "YulLiteral", + "src": "2019:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "2009:6:70", + "nodeType": "YulIdentifier", + "src": "2009:6:70" + }, + "nativeSrc": "2009:12:70", + "nodeType": "YulFunctionCall", + "src": "2009:12:70" + }, + "nativeSrc": "2009:12:70", + "nodeType": "YulExpressionStatement", + "src": "2009:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "dataEnd", + "nativeSrc": "1982:7:70", + "nodeType": "YulIdentifier", + "src": "1982:7:70" + }, + { + "name": "headStart", + "nativeSrc": "1991:9:70", + "nodeType": "YulIdentifier", + "src": "1991:9:70" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "1978:3:70", + "nodeType": "YulIdentifier", + "src": "1978:3:70" + }, + "nativeSrc": "1978:23:70", + "nodeType": "YulFunctionCall", + "src": "1978:23:70" + }, + { + "kind": "number", + "nativeSrc": "2003:2:70", + "nodeType": "YulLiteral", + "src": "2003:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "slt", + "nativeSrc": "1974:3:70", + "nodeType": "YulIdentifier", + "src": "1974:3:70" + }, + "nativeSrc": "1974:32:70", + "nodeType": "YulFunctionCall", + "src": "1974:32:70" + }, + "nativeSrc": "1971:52:70", + "nodeType": "YulIf", + "src": "1971:52:70" + }, + { + "nativeSrc": "2032:14:70", + "nodeType": "YulVariableDeclaration", + "src": "2032:14:70", + "value": { + "kind": "number", + "nativeSrc": "2045:1:70", + "nodeType": "YulLiteral", + "src": "2045:1:70", + "type": "", + "value": "0" + }, + "variables": [ + { + "name": "value", + "nativeSrc": "2036:5:70", + "nodeType": "YulTypedName", + "src": "2036:5:70", + "type": "" + } + ] + }, + { + "nativeSrc": "2055:32:70", + "nodeType": "YulAssignment", + "src": "2055:32:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "2077:9:70", + "nodeType": "YulIdentifier", + "src": "2077:9:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "2064:12:70", + "nodeType": "YulIdentifier", + "src": "2064:12:70" + }, + "nativeSrc": "2064:23:70", + "nodeType": "YulFunctionCall", + "src": "2064:23:70" + }, + "variableNames": [ + { + "name": "value", + "nativeSrc": "2055:5:70", + "nodeType": "YulIdentifier", + "src": "2055:5:70" + } + ] + }, + { + "nativeSrc": "2096:15:70", + "nodeType": "YulAssignment", + "src": "2096:15:70", + "value": { + "name": "value", + "nativeSrc": "2106:5:70", + "nodeType": "YulIdentifier", + "src": "2106:5:70" + }, + "variableNames": [ + { + "name": "value0", + "nativeSrc": "2096:6:70", + "nodeType": "YulIdentifier", + "src": "2096:6:70" + } + ] + } + ] + }, + "name": "abi_decode_tuple_t_bytes32", + "nativeSrc": "1891:226:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "1927:9:70", + "nodeType": "YulTypedName", + "src": "1927:9:70", + "type": "" + }, + { + "name": "dataEnd", + "nativeSrc": "1938:7:70", + "nodeType": "YulTypedName", + "src": "1938:7:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value0", + "nativeSrc": "1950:6:70", + "nodeType": "YulTypedName", + "src": "1950:6:70", + "type": "" + } + ], + "src": "1891:226:70" + }, + { + "body": { + "nativeSrc": "2154:95:70", + "nodeType": "YulBlock", + "src": "2154:95:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "2171:1:70", + "nodeType": "YulLiteral", + "src": "2171:1:70", + "type": "", + "value": "0" + }, + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "2178:3:70", + "nodeType": "YulLiteral", + "src": "2178:3:70", + "type": "", + "value": "224" + }, + { + "kind": "number", + "nativeSrc": "2183:10:70", + "nodeType": "YulLiteral", + "src": "2183:10:70", + "type": "", + "value": "0x4e487b71" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "2174:3:70", + "nodeType": "YulIdentifier", + "src": "2174:3:70" + }, + "nativeSrc": "2174:20:70", + "nodeType": "YulFunctionCall", + "src": "2174:20:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "2164:6:70", + "nodeType": "YulIdentifier", + "src": "2164:6:70" + }, + "nativeSrc": "2164:31:70", + "nodeType": "YulFunctionCall", + "src": "2164:31:70" + }, + "nativeSrc": "2164:31:70", + "nodeType": "YulExpressionStatement", + "src": "2164:31:70" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "2211:1:70", + "nodeType": "YulLiteral", + "src": "2211:1:70", + "type": "", + "value": "4" + }, + { + "kind": "number", + "nativeSrc": "2214:4:70", + "nodeType": "YulLiteral", + "src": "2214:4:70", + "type": "", + "value": "0x21" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "2204:6:70", + "nodeType": "YulIdentifier", + "src": "2204:6:70" + }, + "nativeSrc": "2204:15:70", + "nodeType": "YulFunctionCall", + "src": "2204:15:70" + }, + "nativeSrc": "2204:15:70", + "nodeType": "YulExpressionStatement", + "src": "2204:15:70" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "2235:1:70", + "nodeType": "YulLiteral", + "src": "2235:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "2238:4:70", + "nodeType": "YulLiteral", + "src": "2238:4:70", + "type": "", + "value": "0x24" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "2228:6:70", + "nodeType": "YulIdentifier", + "src": "2228:6:70" + }, + "nativeSrc": "2228:15:70", + "nodeType": "YulFunctionCall", + "src": "2228:15:70" + }, + "nativeSrc": "2228:15:70", + "nodeType": "YulExpressionStatement", + "src": "2228:15:70" + } + ] + }, + "name": "panic_error_0x21", + "nativeSrc": "2122:127:70", + "nodeType": "YulFunctionDefinition", + "src": "2122:127:70" + }, + { + "body": { + "nativeSrc": "2309:89:70", + "nodeType": "YulBlock", + "src": "2309:89:70", + "statements": [ + { + "body": { + "nativeSrc": "2343:22:70", + "nodeType": "YulBlock", + "src": "2343:22:70", + "statements": [ + { + "expression": { + "arguments": [], + "functionName": { + "name": "panic_error_0x21", + "nativeSrc": "2345:16:70", + "nodeType": "YulIdentifier", + "src": "2345:16:70" + }, + "nativeSrc": "2345:18:70", + "nodeType": "YulFunctionCall", + "src": "2345:18:70" + }, + "nativeSrc": "2345:18:70", + "nodeType": "YulExpressionStatement", + "src": "2345:18:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "value", + "nativeSrc": "2332:5:70", + "nodeType": "YulIdentifier", + "src": "2332:5:70" + }, + { + "kind": "number", + "nativeSrc": "2339:1:70", + "nodeType": "YulLiteral", + "src": "2339:1:70", + "type": "", + "value": "6" + } + ], + "functionName": { + "name": "lt", + "nativeSrc": "2329:2:70", + "nodeType": "YulIdentifier", + "src": "2329:2:70" + }, + "nativeSrc": "2329:12:70", + "nodeType": "YulFunctionCall", + "src": "2329:12:70" + } + ], + "functionName": { + "name": "iszero", + "nativeSrc": "2322:6:70", + "nodeType": "YulIdentifier", + "src": "2322:6:70" + }, + "nativeSrc": "2322:20:70", + "nodeType": "YulFunctionCall", + "src": "2322:20:70" + }, + "nativeSrc": "2319:46:70", + "nodeType": "YulIf", + "src": "2319:46:70" + }, + { + "expression": { + "arguments": [ + { + "name": "pos", + "nativeSrc": "2381:3:70", + "nodeType": "YulIdentifier", + "src": "2381:3:70" + }, + { + "name": "value", + "nativeSrc": "2386:5:70", + "nodeType": "YulIdentifier", + "src": "2386:5:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "2374:6:70", + "nodeType": "YulIdentifier", + "src": "2374:6:70" + }, + "nativeSrc": "2374:18:70", + "nodeType": "YulFunctionCall", + "src": "2374:18:70" + }, + "nativeSrc": "2374:18:70", + "nodeType": "YulExpressionStatement", + "src": "2374:18:70" + } + ] + }, + "name": "abi_encode_enum_DisputeStatus", + "nativeSrc": "2254:144:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "value", + "nativeSrc": "2293:5:70", + "nodeType": "YulTypedName", + "src": "2293:5:70", + "type": "" + }, + { + "name": "pos", + "nativeSrc": "2300:3:70", + "nodeType": "YulTypedName", + "src": "2300:3:70", + "type": "" + } + ], + "src": "2254:144:70" + }, + { + "body": { + "nativeSrc": "2760:557:70", + "nodeType": "YulBlock", + "src": "2760:557:70", + "statements": [ + { + "nativeSrc": "2770:27:70", + "nodeType": "YulAssignment", + "src": "2770:27:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "2782:9:70", + "nodeType": "YulIdentifier", + "src": "2782:9:70" + }, + { + "kind": "number", + "nativeSrc": "2793:3:70", + "nodeType": "YulLiteral", + "src": "2793:3:70", + "type": "", + "value": "288" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "2778:3:70", + "nodeType": "YulIdentifier", + "src": "2778:3:70" + }, + "nativeSrc": "2778:19:70", + "nodeType": "YulFunctionCall", + "src": "2778:19:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "2770:4:70", + "nodeType": "YulIdentifier", + "src": "2770:4:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "2813:9:70", + "nodeType": "YulIdentifier", + "src": "2813:9:70" + }, + { + "arguments": [ + { + "name": "value0", + "nativeSrc": "2828:6:70", + "nodeType": "YulIdentifier", + "src": "2828:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "2844:3:70", + "nodeType": "YulLiteral", + "src": "2844:3:70", + "type": "", + "value": "160" + }, + { + "kind": "number", + "nativeSrc": "2849:1:70", + "nodeType": "YulLiteral", + "src": "2849:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "2840:3:70", + "nodeType": "YulIdentifier", + "src": "2840:3:70" + }, + "nativeSrc": "2840:11:70", + "nodeType": "YulFunctionCall", + "src": "2840:11:70" + }, + { + "kind": "number", + "nativeSrc": "2853:1:70", + "nodeType": "YulLiteral", + "src": "2853:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "2836:3:70", + "nodeType": "YulIdentifier", + "src": "2836:3:70" + }, + "nativeSrc": "2836:19:70", + "nodeType": "YulFunctionCall", + "src": "2836:19:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "2824:3:70", + "nodeType": "YulIdentifier", + "src": "2824:3:70" + }, + "nativeSrc": "2824:32:70", + "nodeType": "YulFunctionCall", + "src": "2824:32:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "2806:6:70", + "nodeType": "YulIdentifier", + "src": "2806:6:70" + }, + "nativeSrc": "2806:51:70", + "nodeType": "YulFunctionCall", + "src": "2806:51:70" + }, + "nativeSrc": "2806:51:70", + "nodeType": "YulExpressionStatement", + "src": "2806:51:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "2877:9:70", + "nodeType": "YulIdentifier", + "src": "2877:9:70" + }, + { + "kind": "number", + "nativeSrc": "2888:2:70", + "nodeType": "YulLiteral", + "src": "2888:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "2873:3:70", + "nodeType": "YulIdentifier", + "src": "2873:3:70" + }, + "nativeSrc": "2873:18:70", + "nodeType": "YulFunctionCall", + "src": "2873:18:70" + }, + { + "arguments": [ + { + "name": "value1", + "nativeSrc": "2897:6:70", + "nodeType": "YulIdentifier", + "src": "2897:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "2913:3:70", + "nodeType": "YulLiteral", + "src": "2913:3:70", + "type": "", + "value": "160" + }, + { + "kind": "number", + "nativeSrc": "2918:1:70", + "nodeType": "YulLiteral", + "src": "2918:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "2909:3:70", + "nodeType": "YulIdentifier", + "src": "2909:3:70" + }, + "nativeSrc": "2909:11:70", + "nodeType": "YulFunctionCall", + "src": "2909:11:70" + }, + { + "kind": "number", + "nativeSrc": "2922:1:70", + "nodeType": "YulLiteral", + "src": "2922:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "2905:3:70", + "nodeType": "YulIdentifier", + "src": "2905:3:70" + }, + "nativeSrc": "2905:19:70", + "nodeType": "YulFunctionCall", + "src": "2905:19:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "2893:3:70", + "nodeType": "YulIdentifier", + "src": "2893:3:70" + }, + "nativeSrc": "2893:32:70", + "nodeType": "YulFunctionCall", + "src": "2893:32:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "2866:6:70", + "nodeType": "YulIdentifier", + "src": "2866:6:70" + }, + "nativeSrc": "2866:60:70", + "nodeType": "YulFunctionCall", + "src": "2866:60:70" + }, + "nativeSrc": "2866:60:70", + "nodeType": "YulExpressionStatement", + "src": "2866:60:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "2946:9:70", + "nodeType": "YulIdentifier", + "src": "2946:9:70" + }, + { + "kind": "number", + "nativeSrc": "2957:2:70", + "nodeType": "YulLiteral", + "src": "2957:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "2942:3:70", + "nodeType": "YulIdentifier", + "src": "2942:3:70" + }, + "nativeSrc": "2942:18:70", + "nodeType": "YulFunctionCall", + "src": "2942:18:70" + }, + { + "name": "value2", + "nativeSrc": "2962:6:70", + "nodeType": "YulIdentifier", + "src": "2962:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "2935:6:70", + "nodeType": "YulIdentifier", + "src": "2935:6:70" + }, + "nativeSrc": "2935:34:70", + "nodeType": "YulFunctionCall", + "src": "2935:34:70" + }, + "nativeSrc": "2935:34:70", + "nodeType": "YulExpressionStatement", + "src": "2935:34:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "2989:9:70", + "nodeType": "YulIdentifier", + "src": "2989:9:70" + }, + { + "kind": "number", + "nativeSrc": "3000:2:70", + "nodeType": "YulLiteral", + "src": "3000:2:70", + "type": "", + "value": "96" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "2985:3:70", + "nodeType": "YulIdentifier", + "src": "2985:3:70" + }, + "nativeSrc": "2985:18:70", + "nodeType": "YulFunctionCall", + "src": "2985:18:70" + }, + { + "name": "value3", + "nativeSrc": "3005:6:70", + "nodeType": "YulIdentifier", + "src": "3005:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "2978:6:70", + "nodeType": "YulIdentifier", + "src": "2978:6:70" + }, + "nativeSrc": "2978:34:70", + "nodeType": "YulFunctionCall", + "src": "2978:34:70" + }, + "nativeSrc": "2978:34:70", + "nodeType": "YulExpressionStatement", + "src": "2978:34:70" + }, + { + "body": { + "nativeSrc": "3046:22:70", + "nodeType": "YulBlock", + "src": "3046:22:70", + "statements": [ + { + "expression": { + "arguments": [], + "functionName": { + "name": "panic_error_0x21", + "nativeSrc": "3048:16:70", + "nodeType": "YulIdentifier", + "src": "3048:16:70" + }, + "nativeSrc": "3048:18:70", + "nodeType": "YulFunctionCall", + "src": "3048:18:70" + }, + "nativeSrc": "3048:18:70", + "nodeType": "YulExpressionStatement", + "src": "3048:18:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "value4", + "nativeSrc": "3034:6:70", + "nodeType": "YulIdentifier", + "src": "3034:6:70" + }, + { + "kind": "number", + "nativeSrc": "3042:1:70", + "nodeType": "YulLiteral", + "src": "3042:1:70", + "type": "", + "value": "4" + } + ], + "functionName": { + "name": "lt", + "nativeSrc": "3031:2:70", + "nodeType": "YulIdentifier", + "src": "3031:2:70" + }, + "nativeSrc": "3031:13:70", + "nodeType": "YulFunctionCall", + "src": "3031:13:70" + } + ], + "functionName": { + "name": "iszero", + "nativeSrc": "3024:6:70", + "nodeType": "YulIdentifier", + "src": "3024:6:70" + }, + "nativeSrc": "3024:21:70", + "nodeType": "YulFunctionCall", + "src": "3024:21:70" + }, + "nativeSrc": "3021:47:70", + "nodeType": "YulIf", + "src": "3021:47:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "3088:9:70", + "nodeType": "YulIdentifier", + "src": "3088:9:70" + }, + { + "kind": "number", + "nativeSrc": "3099:3:70", + "nodeType": "YulLiteral", + "src": "3099:3:70", + "type": "", + "value": "128" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "3084:3:70", + "nodeType": "YulIdentifier", + "src": "3084:3:70" + }, + "nativeSrc": "3084:19:70", + "nodeType": "YulFunctionCall", + "src": "3084:19:70" + }, + { + "name": "value4", + "nativeSrc": "3105:6:70", + "nodeType": "YulIdentifier", + "src": "3105:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "3077:6:70", + "nodeType": "YulIdentifier", + "src": "3077:6:70" + }, + "nativeSrc": "3077:35:70", + "nodeType": "YulFunctionCall", + "src": "3077:35:70" + }, + "nativeSrc": "3077:35:70", + "nodeType": "YulExpressionStatement", + "src": "3077:35:70" + }, + { + "expression": { + "arguments": [ + { + "name": "value5", + "nativeSrc": "3151:6:70", + "nodeType": "YulIdentifier", + "src": "3151:6:70" + }, + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "3163:9:70", + "nodeType": "YulIdentifier", + "src": "3163:9:70" + }, + { + "kind": "number", + "nativeSrc": "3174:3:70", + "nodeType": "YulLiteral", + "src": "3174:3:70", + "type": "", + "value": "160" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "3159:3:70", + "nodeType": "YulIdentifier", + "src": "3159:3:70" + }, + "nativeSrc": "3159:19:70", + "nodeType": "YulFunctionCall", + "src": "3159:19:70" + } + ], + "functionName": { + "name": "abi_encode_enum_DisputeStatus", + "nativeSrc": "3121:29:70", + "nodeType": "YulIdentifier", + "src": "3121:29:70" + }, + "nativeSrc": "3121:58:70", + "nodeType": "YulFunctionCall", + "src": "3121:58:70" + }, + "nativeSrc": "3121:58:70", + "nodeType": "YulExpressionStatement", + "src": "3121:58:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "3199:9:70", + "nodeType": "YulIdentifier", + "src": "3199:9:70" + }, + { + "kind": "number", + "nativeSrc": "3210:3:70", + "nodeType": "YulLiteral", + "src": "3210:3:70", + "type": "", + "value": "192" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "3195:3:70", + "nodeType": "YulIdentifier", + "src": "3195:3:70" + }, + "nativeSrc": "3195:19:70", + "nodeType": "YulFunctionCall", + "src": "3195:19:70" + }, + { + "name": "value6", + "nativeSrc": "3216:6:70", + "nodeType": "YulIdentifier", + "src": "3216:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "3188:6:70", + "nodeType": "YulIdentifier", + "src": "3188:6:70" + }, + "nativeSrc": "3188:35:70", + "nodeType": "YulFunctionCall", + "src": "3188:35:70" + }, + "nativeSrc": "3188:35:70", + "nodeType": "YulExpressionStatement", + "src": "3188:35:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "3243:9:70", + "nodeType": "YulIdentifier", + "src": "3243:9:70" + }, + { + "kind": "number", + "nativeSrc": "3254:3:70", + "nodeType": "YulLiteral", + "src": "3254:3:70", + "type": "", + "value": "224" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "3239:3:70", + "nodeType": "YulIdentifier", + "src": "3239:3:70" + }, + "nativeSrc": "3239:19:70", + "nodeType": "YulFunctionCall", + "src": "3239:19:70" + }, + { + "name": "value7", + "nativeSrc": "3260:6:70", + "nodeType": "YulIdentifier", + "src": "3260:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "3232:6:70", + "nodeType": "YulIdentifier", + "src": "3232:6:70" + }, + "nativeSrc": "3232:35:70", + "nodeType": "YulFunctionCall", + "src": "3232:35:70" + }, + "nativeSrc": "3232:35:70", + "nodeType": "YulExpressionStatement", + "src": "3232:35:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "3287:9:70", + "nodeType": "YulIdentifier", + "src": "3287:9:70" + }, + { + "kind": "number", + "nativeSrc": "3298:3:70", + "nodeType": "YulLiteral", + "src": "3298:3:70", + "type": "", + "value": "256" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "3283:3:70", + "nodeType": "YulIdentifier", + "src": "3283:3:70" + }, + "nativeSrc": "3283:19:70", + "nodeType": "YulFunctionCall", + "src": "3283:19:70" + }, + { + "name": "value8", + "nativeSrc": "3304:6:70", + "nodeType": "YulIdentifier", + "src": "3304:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "3276:6:70", + "nodeType": "YulIdentifier", + "src": "3276:6:70" + }, + "nativeSrc": "3276:35:70", + "nodeType": "YulFunctionCall", + "src": "3276:35:70" + }, + "nativeSrc": "3276:35:70", + "nodeType": "YulExpressionStatement", + "src": "3276:35:70" + } + ] + }, + "name": "abi_encode_tuple_t_address_t_address_t_uint256_t_bytes32_t_enum$_DisputeType_$14913_t_enum$_DisputeStatus_$14921_t_uint256_t_uint256_t_uint256__to_t_address_t_address_t_uint256_t_bytes32_t_uint8_t_uint8_t_uint256_t_uint256_t_uint256__fromStack_reversed", + "nativeSrc": "2403:914:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "2665:9:70", + "nodeType": "YulTypedName", + "src": "2665:9:70", + "type": "" + }, + { + "name": "value8", + "nativeSrc": "2676:6:70", + "nodeType": "YulTypedName", + "src": "2676:6:70", + "type": "" + }, + { + "name": "value7", + "nativeSrc": "2684:6:70", + "nodeType": "YulTypedName", + "src": "2684:6:70", + "type": "" + }, + { + "name": "value6", + "nativeSrc": "2692:6:70", + "nodeType": "YulTypedName", + "src": "2692:6:70", + "type": "" + }, + { + "name": "value5", + "nativeSrc": "2700:6:70", + "nodeType": "YulTypedName", + "src": "2700:6:70", + "type": "" + }, + { + "name": "value4", + "nativeSrc": "2708:6:70", + "nodeType": "YulTypedName", + "src": "2708:6:70", + "type": "" + }, + { + "name": "value3", + "nativeSrc": "2716:6:70", + "nodeType": "YulTypedName", + "src": "2716:6:70", + "type": "" + }, + { + "name": "value2", + "nativeSrc": "2724:6:70", + "nodeType": "YulTypedName", + "src": "2724:6:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "2732:6:70", + "nodeType": "YulTypedName", + "src": "2732:6:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "2740:6:70", + "nodeType": "YulTypedName", + "src": "2740:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "2751:4:70", + "nodeType": "YulTypedName", + "src": "2751:4:70", + "type": "" + } + ], + "src": "2403:914:70" + }, + { + "body": { + "nativeSrc": "3392:156:70", + "nodeType": "YulBlock", + "src": "3392:156:70", + "statements": [ + { + "body": { + "nativeSrc": "3438:16:70", + "nodeType": "YulBlock", + "src": "3438:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "3447:1:70", + "nodeType": "YulLiteral", + "src": "3447:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "3450:1:70", + "nodeType": "YulLiteral", + "src": "3450:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "3440:6:70", + "nodeType": "YulIdentifier", + "src": "3440:6:70" + }, + "nativeSrc": "3440:12:70", + "nodeType": "YulFunctionCall", + "src": "3440:12:70" + }, + "nativeSrc": "3440:12:70", + "nodeType": "YulExpressionStatement", + "src": "3440:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "dataEnd", + "nativeSrc": "3413:7:70", + "nodeType": "YulIdentifier", + "src": "3413:7:70" + }, + { + "name": "headStart", + "nativeSrc": "3422:9:70", + "nodeType": "YulIdentifier", + "src": "3422:9:70" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "3409:3:70", + "nodeType": "YulIdentifier", + "src": "3409:3:70" + }, + "nativeSrc": "3409:23:70", + "nodeType": "YulFunctionCall", + "src": "3409:23:70" + }, + { + "kind": "number", + "nativeSrc": "3434:2:70", + "nodeType": "YulLiteral", + "src": "3434:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "slt", + "nativeSrc": "3405:3:70", + "nodeType": "YulIdentifier", + "src": "3405:3:70" + }, + "nativeSrc": "3405:32:70", + "nodeType": "YulFunctionCall", + "src": "3405:32:70" + }, + "nativeSrc": "3402:52:70", + "nodeType": "YulIf", + "src": "3402:52:70" + }, + { + "nativeSrc": "3463:14:70", + "nodeType": "YulVariableDeclaration", + "src": "3463:14:70", + "value": { + "kind": "number", + "nativeSrc": "3476:1:70", + "nodeType": "YulLiteral", + "src": "3476:1:70", + "type": "", + "value": "0" + }, + "variables": [ + { + "name": "value", + "nativeSrc": "3467:5:70", + "nodeType": "YulTypedName", + "src": "3467:5:70", + "type": "" + } + ] + }, + { + "nativeSrc": "3486:32:70", + "nodeType": "YulAssignment", + "src": "3486:32:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "3508:9:70", + "nodeType": "YulIdentifier", + "src": "3508:9:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "3495:12:70", + "nodeType": "YulIdentifier", + "src": "3495:12:70" + }, + "nativeSrc": "3495:23:70", + "nodeType": "YulFunctionCall", + "src": "3495:23:70" + }, + "variableNames": [ + { + "name": "value", + "nativeSrc": "3486:5:70", + "nodeType": "YulIdentifier", + "src": "3486:5:70" + } + ] + }, + { + "nativeSrc": "3527:15:70", + "nodeType": "YulAssignment", + "src": "3527:15:70", + "value": { + "name": "value", + "nativeSrc": "3537:5:70", + "nodeType": "YulIdentifier", + "src": "3537:5:70" + }, + "variableNames": [ + { + "name": "value0", + "nativeSrc": "3527:6:70", + "nodeType": "YulIdentifier", + "src": "3527:6:70" + } + ] + } + ] + }, + "name": "abi_decode_tuple_t_uint256", + "nativeSrc": "3322:226:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "3358:9:70", + "nodeType": "YulTypedName", + "src": "3358:9:70", + "type": "" + }, + { + "name": "dataEnd", + "nativeSrc": "3369:7:70", + "nodeType": "YulTypedName", + "src": "3369:7:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value0", + "nativeSrc": "3381:6:70", + "nodeType": "YulTypedName", + "src": "3381:6:70", + "type": "" + } + ], + "src": "3322:226:70" + }, + { + "body": { + "nativeSrc": "3680:102:70", + "nodeType": "YulBlock", + "src": "3680:102:70", + "statements": [ + { + "nativeSrc": "3690:26:70", + "nodeType": "YulAssignment", + "src": "3690:26:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "3702:9:70", + "nodeType": "YulIdentifier", + "src": "3702:9:70" + }, + { + "kind": "number", + "nativeSrc": "3713:2:70", + "nodeType": "YulLiteral", + "src": "3713:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "3698:3:70", + "nodeType": "YulIdentifier", + "src": "3698:3:70" + }, + "nativeSrc": "3698:18:70", + "nodeType": "YulFunctionCall", + "src": "3698:18:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "3690:4:70", + "nodeType": "YulIdentifier", + "src": "3690:4:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "3732:9:70", + "nodeType": "YulIdentifier", + "src": "3732:9:70" + }, + { + "arguments": [ + { + "name": "value0", + "nativeSrc": "3747:6:70", + "nodeType": "YulIdentifier", + "src": "3747:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "3763:3:70", + "nodeType": "YulLiteral", + "src": "3763:3:70", + "type": "", + "value": "160" + }, + { + "kind": "number", + "nativeSrc": "3768:1:70", + "nodeType": "YulLiteral", + "src": "3768:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "3759:3:70", + "nodeType": "YulIdentifier", + "src": "3759:3:70" + }, + "nativeSrc": "3759:11:70", + "nodeType": "YulFunctionCall", + "src": "3759:11:70" + }, + { + "kind": "number", + "nativeSrc": "3772:1:70", + "nodeType": "YulLiteral", + "src": "3772:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "3755:3:70", + "nodeType": "YulIdentifier", + "src": "3755:3:70" + }, + "nativeSrc": "3755:19:70", + "nodeType": "YulFunctionCall", + "src": "3755:19:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "3743:3:70", + "nodeType": "YulIdentifier", + "src": "3743:3:70" + }, + "nativeSrc": "3743:32:70", + "nodeType": "YulFunctionCall", + "src": "3743:32:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "3725:6:70", + "nodeType": "YulIdentifier", + "src": "3725:6:70" + }, + "nativeSrc": "3725:51:70", + "nodeType": "YulFunctionCall", + "src": "3725:51:70" + }, + "nativeSrc": "3725:51:70", + "nodeType": "YulExpressionStatement", + "src": "3725:51:70" + } + ] + }, + "name": "abi_encode_tuple_t_contract$_ISubgraphService_$15634__to_t_address__fromStack_reversed", + "nativeSrc": "3553:229:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "3649:9:70", + "nodeType": "YulTypedName", + "src": "3649:9:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "3660:6:70", + "nodeType": "YulTypedName", + "src": "3660:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "3671:4:70", + "nodeType": "YulTypedName", + "src": "3671:4:70", + "type": "" + } + ], + "src": "3553:229:70" + }, + { + "body": { + "nativeSrc": "3888:76:70", + "nodeType": "YulBlock", + "src": "3888:76:70", + "statements": [ + { + "nativeSrc": "3898:26:70", + "nodeType": "YulAssignment", + "src": "3898:26:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "3910:9:70", + "nodeType": "YulIdentifier", + "src": "3910:9:70" + }, + { + "kind": "number", + "nativeSrc": "3921:2:70", + "nodeType": "YulLiteral", + "src": "3921:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "3906:3:70", + "nodeType": "YulIdentifier", + "src": "3906:3:70" + }, + "nativeSrc": "3906:18:70", + "nodeType": "YulFunctionCall", + "src": "3906:18:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "3898:4:70", + "nodeType": "YulIdentifier", + "src": "3898:4:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "3940:9:70", + "nodeType": "YulIdentifier", + "src": "3940:9:70" + }, + { + "name": "value0", + "nativeSrc": "3951:6:70", + "nodeType": "YulIdentifier", + "src": "3951:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "3933:6:70", + "nodeType": "YulIdentifier", + "src": "3933:6:70" + }, + "nativeSrc": "3933:25:70", + "nodeType": "YulFunctionCall", + "src": "3933:25:70" + }, + "nativeSrc": "3933:25:70", + "nodeType": "YulExpressionStatement", + "src": "3933:25:70" + } + ] + }, + "name": "abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed", + "nativeSrc": "3787:177:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "3857:9:70", + "nodeType": "YulTypedName", + "src": "3857:9:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "3868:6:70", + "nodeType": "YulTypedName", + "src": "3868:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "3879:4:70", + "nodeType": "YulTypedName", + "src": "3879:4:70", + "type": "" + } + ], + "src": "3787:177:70" + }, + { + "body": { + "nativeSrc": "4056:280:70", + "nodeType": "YulBlock", + "src": "4056:280:70", + "statements": [ + { + "body": { + "nativeSrc": "4102:16:70", + "nodeType": "YulBlock", + "src": "4102:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "4111:1:70", + "nodeType": "YulLiteral", + "src": "4111:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "4114:1:70", + "nodeType": "YulLiteral", + "src": "4114:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "4104:6:70", + "nodeType": "YulIdentifier", + "src": "4104:6:70" + }, + "nativeSrc": "4104:12:70", + "nodeType": "YulFunctionCall", + "src": "4104:12:70" + }, + "nativeSrc": "4104:12:70", + "nodeType": "YulExpressionStatement", + "src": "4104:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "dataEnd", + "nativeSrc": "4077:7:70", + "nodeType": "YulIdentifier", + "src": "4077:7:70" + }, + { + "name": "headStart", + "nativeSrc": "4086:9:70", + "nodeType": "YulIdentifier", + "src": "4086:9:70" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "4073:3:70", + "nodeType": "YulIdentifier", + "src": "4073:3:70" + }, + "nativeSrc": "4073:23:70", + "nodeType": "YulFunctionCall", + "src": "4073:23:70" + }, + { + "kind": "number", + "nativeSrc": "4098:2:70", + "nodeType": "YulLiteral", + "src": "4098:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "slt", + "nativeSrc": "4069:3:70", + "nodeType": "YulIdentifier", + "src": "4069:3:70" + }, + "nativeSrc": "4069:32:70", + "nodeType": "YulFunctionCall", + "src": "4069:32:70" + }, + "nativeSrc": "4066:52:70", + "nodeType": "YulIf", + "src": "4066:52:70" + }, + { + "nativeSrc": "4127:36:70", + "nodeType": "YulVariableDeclaration", + "src": "4127:36:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "4153:9:70", + "nodeType": "YulIdentifier", + "src": "4153:9:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "4140:12:70", + "nodeType": "YulIdentifier", + "src": "4140:12:70" + }, + "nativeSrc": "4140:23:70", + "nodeType": "YulFunctionCall", + "src": "4140:23:70" + }, + "variables": [ + { + "name": "value", + "nativeSrc": "4131:5:70", + "nodeType": "YulTypedName", + "src": "4131:5:70", + "type": "" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "value", + "nativeSrc": "4197:5:70", + "nodeType": "YulIdentifier", + "src": "4197:5:70" + } + ], + "functionName": { + "name": "validator_revert_address", + "nativeSrc": "4172:24:70", + "nodeType": "YulIdentifier", + "src": "4172:24:70" + }, + "nativeSrc": "4172:31:70", + "nodeType": "YulFunctionCall", + "src": "4172:31:70" + }, + "nativeSrc": "4172:31:70", + "nodeType": "YulExpressionStatement", + "src": "4172:31:70" + }, + { + "nativeSrc": "4212:15:70", + "nodeType": "YulAssignment", + "src": "4212:15:70", + "value": { + "name": "value", + "nativeSrc": "4222:5:70", + "nodeType": "YulIdentifier", + "src": "4222:5:70" + }, + "variableNames": [ + { + "name": "value0", + "nativeSrc": "4212:6:70", + "nodeType": "YulIdentifier", + "src": "4212:6:70" + } + ] + }, + { + "nativeSrc": "4236:16:70", + "nodeType": "YulVariableDeclaration", + "src": "4236:16:70", + "value": { + "kind": "number", + "nativeSrc": "4251:1:70", + "nodeType": "YulLiteral", + "src": "4251:1:70", + "type": "", + "value": "0" + }, + "variables": [ + { + "name": "value_1", + "nativeSrc": "4240:7:70", + "nodeType": "YulTypedName", + "src": "4240:7:70", + "type": "" + } + ] + }, + { + "nativeSrc": "4261:43:70", + "nodeType": "YulAssignment", + "src": "4261:43:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "4289:9:70", + "nodeType": "YulIdentifier", + "src": "4289:9:70" + }, + { + "kind": "number", + "nativeSrc": "4300:2:70", + "nodeType": "YulLiteral", + "src": "4300:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "4285:3:70", + "nodeType": "YulIdentifier", + "src": "4285:3:70" + }, + "nativeSrc": "4285:18:70", + "nodeType": "YulFunctionCall", + "src": "4285:18:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "4272:12:70", + "nodeType": "YulIdentifier", + "src": "4272:12:70" + }, + "nativeSrc": "4272:32:70", + "nodeType": "YulFunctionCall", + "src": "4272:32:70" + }, + "variableNames": [ + { + "name": "value_1", + "nativeSrc": "4261:7:70", + "nodeType": "YulIdentifier", + "src": "4261:7:70" + } + ] + }, + { + "nativeSrc": "4313:17:70", + "nodeType": "YulAssignment", + "src": "4313:17:70", + "value": { + "name": "value_1", + "nativeSrc": "4323:7:70", + "nodeType": "YulIdentifier", + "src": "4323:7:70" + }, + "variableNames": [ + { + "name": "value1", + "nativeSrc": "4313:6:70", + "nodeType": "YulIdentifier", + "src": "4313:6:70" + } + ] + } + ] + }, + "name": "abi_decode_tuple_t_addresst_bytes32", + "nativeSrc": "3969:367:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "4014:9:70", + "nodeType": "YulTypedName", + "src": "4014:9:70", + "type": "" + }, + { + "name": "dataEnd", + "nativeSrc": "4025:7:70", + "nodeType": "YulTypedName", + "src": "4025:7:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value0", + "nativeSrc": "4037:6:70", + "nodeType": "YulTypedName", + "src": "4037:6:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "4045:6:70", + "nodeType": "YulTypedName", + "src": "4045:6:70", + "type": "" + } + ], + "src": "3969:367:70" + }, + { + "body": { + "nativeSrc": "4442:76:70", + "nodeType": "YulBlock", + "src": "4442:76:70", + "statements": [ + { + "nativeSrc": "4452:26:70", + "nodeType": "YulAssignment", + "src": "4452:26:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "4464:9:70", + "nodeType": "YulIdentifier", + "src": "4464:9:70" + }, + { + "kind": "number", + "nativeSrc": "4475:2:70", + "nodeType": "YulLiteral", + "src": "4475:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "4460:3:70", + "nodeType": "YulIdentifier", + "src": "4460:3:70" + }, + "nativeSrc": "4460:18:70", + "nodeType": "YulFunctionCall", + "src": "4460:18:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "4452:4:70", + "nodeType": "YulIdentifier", + "src": "4452:4:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "4494:9:70", + "nodeType": "YulIdentifier", + "src": "4494:9:70" + }, + { + "name": "value0", + "nativeSrc": "4505:6:70", + "nodeType": "YulIdentifier", + "src": "4505:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "4487:6:70", + "nodeType": "YulIdentifier", + "src": "4487:6:70" + }, + "nativeSrc": "4487:25:70", + "nodeType": "YulFunctionCall", + "src": "4487:25:70" + }, + "nativeSrc": "4487:25:70", + "nodeType": "YulExpressionStatement", + "src": "4487:25:70" + } + ] + }, + "name": "abi_encode_tuple_t_bytes32__to_t_bytes32__fromStack_reversed", + "nativeSrc": "4341:177:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "4411:9:70", + "nodeType": "YulTypedName", + "src": "4411:9:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "4422:6:70", + "nodeType": "YulTypedName", + "src": "4422:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "4433:4:70", + "nodeType": "YulTypedName", + "src": "4433:4:70", + "type": "" + } + ], + "src": "4341:177:70" + }, + { + "body": { + "nativeSrc": "4622:101:70", + "nodeType": "YulBlock", + "src": "4622:101:70", + "statements": [ + { + "nativeSrc": "4632:26:70", + "nodeType": "YulAssignment", + "src": "4632:26:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "4644:9:70", + "nodeType": "YulIdentifier", + "src": "4644:9:70" + }, + { + "kind": "number", + "nativeSrc": "4655:2:70", + "nodeType": "YulLiteral", + "src": "4655:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "4640:3:70", + "nodeType": "YulIdentifier", + "src": "4640:3:70" + }, + "nativeSrc": "4640:18:70", + "nodeType": "YulFunctionCall", + "src": "4640:18:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "4632:4:70", + "nodeType": "YulIdentifier", + "src": "4632:4:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "4674:9:70", + "nodeType": "YulIdentifier", + "src": "4674:9:70" + }, + { + "arguments": [ + { + "name": "value0", + "nativeSrc": "4689:6:70", + "nodeType": "YulIdentifier", + "src": "4689:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "4705:2:70", + "nodeType": "YulLiteral", + "src": "4705:2:70", + "type": "", + "value": "64" + }, + { + "kind": "number", + "nativeSrc": "4709:1:70", + "nodeType": "YulLiteral", + "src": "4709:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "4701:3:70", + "nodeType": "YulIdentifier", + "src": "4701:3:70" + }, + "nativeSrc": "4701:10:70", + "nodeType": "YulFunctionCall", + "src": "4701:10:70" + }, + { + "kind": "number", + "nativeSrc": "4713:1:70", + "nodeType": "YulLiteral", + "src": "4713:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "4697:3:70", + "nodeType": "YulIdentifier", + "src": "4697:3:70" + }, + "nativeSrc": "4697:18:70", + "nodeType": "YulFunctionCall", + "src": "4697:18:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "4685:3:70", + "nodeType": "YulIdentifier", + "src": "4685:3:70" + }, + "nativeSrc": "4685:31:70", + "nodeType": "YulFunctionCall", + "src": "4685:31:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "4667:6:70", + "nodeType": "YulIdentifier", + "src": "4667:6:70" + }, + "nativeSrc": "4667:50:70", + "nodeType": "YulFunctionCall", + "src": "4667:50:70" + }, + "nativeSrc": "4667:50:70", + "nodeType": "YulExpressionStatement", + "src": "4667:50:70" + } + ] + }, + "name": "abi_encode_tuple_t_uint64__to_t_uint64__fromStack_reversed", + "nativeSrc": "4523:200:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "4591:9:70", + "nodeType": "YulTypedName", + "src": "4591:9:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "4602:6:70", + "nodeType": "YulTypedName", + "src": "4602:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "4613:4:70", + "nodeType": "YulTypedName", + "src": "4613:4:70", + "type": "" + } + ], + "src": "4523:200:70" + }, + { + "body": { + "nativeSrc": "4826:133:70", + "nodeType": "YulBlock", + "src": "4826:133:70", + "statements": [ + { + "nativeSrc": "4836:42:70", + "nodeType": "YulVariableDeclaration", + "src": "4836:42:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "dataEnd", + "nativeSrc": "4854:7:70", + "nodeType": "YulIdentifier", + "src": "4854:7:70" + }, + { + "name": "headStart", + "nativeSrc": "4863:9:70", + "nodeType": "YulIdentifier", + "src": "4863:9:70" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "4850:3:70", + "nodeType": "YulIdentifier", + "src": "4850:3:70" + }, + "nativeSrc": "4850:23:70", + "nodeType": "YulFunctionCall", + "src": "4850:23:70" + }, + { + "kind": "number", + "nativeSrc": "4875:2:70", + "nodeType": "YulLiteral", + "src": "4875:2:70", + "type": "", + "value": "96" + } + ], + "functionName": { + "name": "slt", + "nativeSrc": "4846:3:70", + "nodeType": "YulIdentifier", + "src": "4846:3:70" + }, + "nativeSrc": "4846:32:70", + "nodeType": "YulFunctionCall", + "src": "4846:32:70" + }, + "variables": [ + { + "name": "_1", + "nativeSrc": "4840:2:70", + "nodeType": "YulTypedName", + "src": "4840:2:70", + "type": "" + } + ] + }, + { + "body": { + "nativeSrc": "4893:16:70", + "nodeType": "YulBlock", + "src": "4893:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "4902:1:70", + "nodeType": "YulLiteral", + "src": "4902:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "4905:1:70", + "nodeType": "YulLiteral", + "src": "4905:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "4895:6:70", + "nodeType": "YulIdentifier", + "src": "4895:6:70" + }, + "nativeSrc": "4895:12:70", + "nodeType": "YulFunctionCall", + "src": "4895:12:70" + }, + "nativeSrc": "4895:12:70", + "nodeType": "YulExpressionStatement", + "src": "4895:12:70" + } + ] + }, + "condition": { + "name": "_1", + "nativeSrc": "4890:2:70", + "nodeType": "YulIdentifier", + "src": "4890:2:70" + }, + "nativeSrc": "4887:22:70", + "nodeType": "YulIf", + "src": "4887:22:70" + }, + { + "nativeSrc": "4918:7:70", + "nodeType": "YulAssignment", + "src": "4918:7:70", + "value": { + "kind": "number", + "nativeSrc": "4924:1:70", + "nodeType": "YulLiteral", + "src": "4924:1:70", + "type": "", + "value": "0" + }, + "variableNames": [ + { + "name": "_1", + "nativeSrc": "4918:2:70", + "nodeType": "YulIdentifier", + "src": "4918:2:70" + } + ] + }, + { + "nativeSrc": "4934:19:70", + "nodeType": "YulAssignment", + "src": "4934:19:70", + "value": { + "name": "headStart", + "nativeSrc": "4944:9:70", + "nodeType": "YulIdentifier", + "src": "4944:9:70" + }, + "variableNames": [ + { + "name": "value0", + "nativeSrc": "4934:6:70", + "nodeType": "YulIdentifier", + "src": "4934:6:70" + } + ] + } + ] + }, + "name": "abi_decode_tuple_t_struct$_Receipt_$16044_calldata_ptr", + "nativeSrc": "4728:231:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "4792:9:70", + "nodeType": "YulTypedName", + "src": "4792:9:70", + "type": "" + }, + { + "name": "dataEnd", + "nativeSrc": "4803:7:70", + "nodeType": "YulTypedName", + "src": "4803:7:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value0", + "nativeSrc": "4815:6:70", + "nodeType": "YulTypedName", + "src": "4815:6:70", + "type": "" + } + ], + "src": "4728:231:70" + }, + { + "body": { + "nativeSrc": "5065:102:70", + "nodeType": "YulBlock", + "src": "5065:102:70", + "statements": [ + { + "nativeSrc": "5075:26:70", + "nodeType": "YulAssignment", + "src": "5075:26:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "5087:9:70", + "nodeType": "YulIdentifier", + "src": "5087:9:70" + }, + { + "kind": "number", + "nativeSrc": "5098:2:70", + "nodeType": "YulLiteral", + "src": "5098:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "5083:3:70", + "nodeType": "YulIdentifier", + "src": "5083:3:70" + }, + "nativeSrc": "5083:18:70", + "nodeType": "YulFunctionCall", + "src": "5083:18:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "5075:4:70", + "nodeType": "YulIdentifier", + "src": "5075:4:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "5117:9:70", + "nodeType": "YulIdentifier", + "src": "5117:9:70" + }, + { + "arguments": [ + { + "name": "value0", + "nativeSrc": "5132:6:70", + "nodeType": "YulIdentifier", + "src": "5132:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "5148:3:70", + "nodeType": "YulLiteral", + "src": "5148:3:70", + "type": "", + "value": "160" + }, + { + "kind": "number", + "nativeSrc": "5153:1:70", + "nodeType": "YulLiteral", + "src": "5153:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "5144:3:70", + "nodeType": "YulIdentifier", + "src": "5144:3:70" + }, + "nativeSrc": "5144:11:70", + "nodeType": "YulFunctionCall", + "src": "5144:11:70" + }, + { + "kind": "number", + "nativeSrc": "5157:1:70", + "nodeType": "YulLiteral", + "src": "5157:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "5140:3:70", + "nodeType": "YulIdentifier", + "src": "5140:3:70" + }, + "nativeSrc": "5140:19:70", + "nodeType": "YulFunctionCall", + "src": "5140:19:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "5128:3:70", + "nodeType": "YulIdentifier", + "src": "5128:3:70" + }, + "nativeSrc": "5128:32:70", + "nodeType": "YulFunctionCall", + "src": "5128:32:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "5110:6:70", + "nodeType": "YulIdentifier", + "src": "5110:6:70" + }, + "nativeSrc": "5110:51:70", + "nodeType": "YulFunctionCall", + "src": "5110:51:70" + }, + "nativeSrc": "5110:51:70", + "nodeType": "YulExpressionStatement", + "src": "5110:51:70" + } + ] + }, + "name": "abi_encode_tuple_t_address__to_t_address__fromStack_reversed", + "nativeSrc": "4964:203:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "5034:9:70", + "nodeType": "YulTypedName", + "src": "5034:9:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "5045:6:70", + "nodeType": "YulTypedName", + "src": "5045:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "5056:4:70", + "nodeType": "YulTypedName", + "src": "5056:4:70", + "type": "" + } + ], + "src": "4964:203:70" + }, + { + "body": { + "nativeSrc": "5241:176:70", + "nodeType": "YulBlock", + "src": "5241:176:70", + "statements": [ + { + "body": { + "nativeSrc": "5287:16:70", + "nodeType": "YulBlock", + "src": "5287:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "5296:1:70", + "nodeType": "YulLiteral", + "src": "5296:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "5299:1:70", + "nodeType": "YulLiteral", + "src": "5299:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "5289:6:70", + "nodeType": "YulIdentifier", + "src": "5289:6:70" + }, + "nativeSrc": "5289:12:70", + "nodeType": "YulFunctionCall", + "src": "5289:12:70" + }, + "nativeSrc": "5289:12:70", + "nodeType": "YulExpressionStatement", + "src": "5289:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "dataEnd", + "nativeSrc": "5262:7:70", + "nodeType": "YulIdentifier", + "src": "5262:7:70" + }, + { + "name": "headStart", + "nativeSrc": "5271:9:70", + "nodeType": "YulIdentifier", + "src": "5271:9:70" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "5258:3:70", + "nodeType": "YulIdentifier", + "src": "5258:3:70" + }, + "nativeSrc": "5258:23:70", + "nodeType": "YulFunctionCall", + "src": "5258:23:70" + }, + { + "kind": "number", + "nativeSrc": "5283:2:70", + "nodeType": "YulLiteral", + "src": "5283:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "slt", + "nativeSrc": "5254:3:70", + "nodeType": "YulIdentifier", + "src": "5254:3:70" + }, + "nativeSrc": "5254:32:70", + "nodeType": "YulFunctionCall", + "src": "5254:32:70" + }, + "nativeSrc": "5251:52:70", + "nodeType": "YulIf", + "src": "5251:52:70" + }, + { + "nativeSrc": "5312:36:70", + "nodeType": "YulVariableDeclaration", + "src": "5312:36:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "5338:9:70", + "nodeType": "YulIdentifier", + "src": "5338:9:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "5325:12:70", + "nodeType": "YulIdentifier", + "src": "5325:12:70" + }, + "nativeSrc": "5325:23:70", + "nodeType": "YulFunctionCall", + "src": "5325:23:70" + }, + "variables": [ + { + "name": "value", + "nativeSrc": "5316:5:70", + "nodeType": "YulTypedName", + "src": "5316:5:70", + "type": "" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "value", + "nativeSrc": "5381:5:70", + "nodeType": "YulIdentifier", + "src": "5381:5:70" + } + ], + "functionName": { + "name": "validator_revert_uint32", + "nativeSrc": "5357:23:70", + "nodeType": "YulIdentifier", + "src": "5357:23:70" + }, + "nativeSrc": "5357:30:70", + "nodeType": "YulFunctionCall", + "src": "5357:30:70" + }, + "nativeSrc": "5357:30:70", + "nodeType": "YulExpressionStatement", + "src": "5357:30:70" + }, + { + "nativeSrc": "5396:15:70", + "nodeType": "YulAssignment", + "src": "5396:15:70", + "value": { + "name": "value", + "nativeSrc": "5406:5:70", + "nodeType": "YulIdentifier", + "src": "5406:5:70" + }, + "variableNames": [ + { + "name": "value0", + "nativeSrc": "5396:6:70", + "nodeType": "YulIdentifier", + "src": "5396:6:70" + } + ] + } + ] + }, + "name": "abi_decode_tuple_t_uint32", + "nativeSrc": "5172:245:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "5207:9:70", + "nodeType": "YulTypedName", + "src": "5207:9:70", + "type": "" + }, + { + "name": "dataEnd", + "nativeSrc": "5218:7:70", + "nodeType": "YulTypedName", + "src": "5218:7:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value0", + "nativeSrc": "5230:6:70", + "nodeType": "YulTypedName", + "src": "5230:6:70", + "type": "" + } + ], + "src": "5172:245:70" + }, + { + "body": { + "nativeSrc": "5543:508:70", + "nodeType": "YulBlock", + "src": "5543:508:70", + "statements": [ + { + "body": { + "nativeSrc": "5590:16:70", + "nodeType": "YulBlock", + "src": "5590:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "5599:1:70", + "nodeType": "YulLiteral", + "src": "5599:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "5602:1:70", + "nodeType": "YulLiteral", + "src": "5602:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "5592:6:70", + "nodeType": "YulIdentifier", + "src": "5592:6:70" + }, + "nativeSrc": "5592:12:70", + "nodeType": "YulFunctionCall", + "src": "5592:12:70" + }, + "nativeSrc": "5592:12:70", + "nodeType": "YulExpressionStatement", + "src": "5592:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "dataEnd", + "nativeSrc": "5564:7:70", + "nodeType": "YulIdentifier", + "src": "5564:7:70" + }, + { + "name": "headStart", + "nativeSrc": "5573:9:70", + "nodeType": "YulIdentifier", + "src": "5573:9:70" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "5560:3:70", + "nodeType": "YulIdentifier", + "src": "5560:3:70" + }, + "nativeSrc": "5560:23:70", + "nodeType": "YulFunctionCall", + "src": "5560:23:70" + }, + { + "kind": "number", + "nativeSrc": "5585:3:70", + "nodeType": "YulLiteral", + "src": "5585:3:70", + "type": "", + "value": "128" + } + ], + "functionName": { + "name": "slt", + "nativeSrc": "5556:3:70", + "nodeType": "YulIdentifier", + "src": "5556:3:70" + }, + "nativeSrc": "5556:33:70", + "nodeType": "YulFunctionCall", + "src": "5556:33:70" + }, + "nativeSrc": "5553:53:70", + "nodeType": "YulIf", + "src": "5553:53:70" + }, + { + "nativeSrc": "5615:36:70", + "nodeType": "YulVariableDeclaration", + "src": "5615:36:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "5641:9:70", + "nodeType": "YulIdentifier", + "src": "5641:9:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "5628:12:70", + "nodeType": "YulIdentifier", + "src": "5628:12:70" + }, + "nativeSrc": "5628:23:70", + "nodeType": "YulFunctionCall", + "src": "5628:23:70" + }, + "variables": [ + { + "name": "value", + "nativeSrc": "5619:5:70", + "nodeType": "YulTypedName", + "src": "5619:5:70", + "type": "" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "value", + "nativeSrc": "5685:5:70", + "nodeType": "YulIdentifier", + "src": "5685:5:70" + } + ], + "functionName": { + "name": "validator_revert_address", + "nativeSrc": "5660:24:70", + "nodeType": "YulIdentifier", + "src": "5660:24:70" + }, + "nativeSrc": "5660:31:70", + "nodeType": "YulFunctionCall", + "src": "5660:31:70" + }, + "nativeSrc": "5660:31:70", + "nodeType": "YulExpressionStatement", + "src": "5660:31:70" + }, + { + "nativeSrc": "5700:15:70", + "nodeType": "YulAssignment", + "src": "5700:15:70", + "value": { + "name": "value", + "nativeSrc": "5710:5:70", + "nodeType": "YulIdentifier", + "src": "5710:5:70" + }, + "variableNames": [ + { + "name": "value0", + "nativeSrc": "5700:6:70", + "nodeType": "YulIdentifier", + "src": "5700:6:70" + } + ] + }, + { + "nativeSrc": "5724:47:70", + "nodeType": "YulVariableDeclaration", + "src": "5724:47:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "5756:9:70", + "nodeType": "YulIdentifier", + "src": "5756:9:70" + }, + { + "kind": "number", + "nativeSrc": "5767:2:70", + "nodeType": "YulLiteral", + "src": "5767:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "5752:3:70", + "nodeType": "YulIdentifier", + "src": "5752:3:70" + }, + "nativeSrc": "5752:18:70", + "nodeType": "YulFunctionCall", + "src": "5752:18:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "5739:12:70", + "nodeType": "YulIdentifier", + "src": "5739:12:70" + }, + "nativeSrc": "5739:32:70", + "nodeType": "YulFunctionCall", + "src": "5739:32:70" + }, + "variables": [ + { + "name": "value_1", + "nativeSrc": "5728:7:70", + "nodeType": "YulTypedName", + "src": "5728:7:70", + "type": "" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "value_1", + "nativeSrc": "5805:7:70", + "nodeType": "YulIdentifier", + "src": "5805:7:70" + } + ], + "functionName": { + "name": "validator_revert_address", + "nativeSrc": "5780:24:70", + "nodeType": "YulIdentifier", + "src": "5780:24:70" + }, + "nativeSrc": "5780:33:70", + "nodeType": "YulFunctionCall", + "src": "5780:33:70" + }, + "nativeSrc": "5780:33:70", + "nodeType": "YulExpressionStatement", + "src": "5780:33:70" + }, + { + "nativeSrc": "5822:17:70", + "nodeType": "YulAssignment", + "src": "5822:17:70", + "value": { + "name": "value_1", + "nativeSrc": "5832:7:70", + "nodeType": "YulIdentifier", + "src": "5832:7:70" + }, + "variableNames": [ + { + "name": "value1", + "nativeSrc": "5822:6:70", + "nodeType": "YulIdentifier", + "src": "5822:6:70" + } + ] + }, + { + "nativeSrc": "5848:16:70", + "nodeType": "YulVariableDeclaration", + "src": "5848:16:70", + "value": { + "kind": "number", + "nativeSrc": "5863:1:70", + "nodeType": "YulLiteral", + "src": "5863:1:70", + "type": "", + "value": "0" + }, + "variables": [ + { + "name": "value_2", + "nativeSrc": "5852:7:70", + "nodeType": "YulTypedName", + "src": "5852:7:70", + "type": "" + } + ] + }, + { + "nativeSrc": "5873:43:70", + "nodeType": "YulAssignment", + "src": "5873:43:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "5901:9:70", + "nodeType": "YulIdentifier", + "src": "5901:9:70" + }, + { + "kind": "number", + "nativeSrc": "5912:2:70", + "nodeType": "YulLiteral", + "src": "5912:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "5897:3:70", + "nodeType": "YulIdentifier", + "src": "5897:3:70" + }, + "nativeSrc": "5897:18:70", + "nodeType": "YulFunctionCall", + "src": "5897:18:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "5884:12:70", + "nodeType": "YulIdentifier", + "src": "5884:12:70" + }, + "nativeSrc": "5884:32:70", + "nodeType": "YulFunctionCall", + "src": "5884:32:70" + }, + "variableNames": [ + { + "name": "value_2", + "nativeSrc": "5873:7:70", + "nodeType": "YulIdentifier", + "src": "5873:7:70" + } + ] + }, + { + "nativeSrc": "5925:17:70", + "nodeType": "YulAssignment", + "src": "5925:17:70", + "value": { + "name": "value_2", + "nativeSrc": "5935:7:70", + "nodeType": "YulIdentifier", + "src": "5935:7:70" + }, + "variableNames": [ + { + "name": "value2", + "nativeSrc": "5925:6:70", + "nodeType": "YulIdentifier", + "src": "5925:6:70" + } + ] + }, + { + "nativeSrc": "5951:16:70", + "nodeType": "YulVariableDeclaration", + "src": "5951:16:70", + "value": { + "kind": "number", + "nativeSrc": "5966:1:70", + "nodeType": "YulLiteral", + "src": "5966:1:70", + "type": "", + "value": "0" + }, + "variables": [ + { + "name": "value_3", + "nativeSrc": "5955:7:70", + "nodeType": "YulTypedName", + "src": "5955:7:70", + "type": "" + } + ] + }, + { + "nativeSrc": "5976:43:70", + "nodeType": "YulAssignment", + "src": "5976:43:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "6004:9:70", + "nodeType": "YulIdentifier", + "src": "6004:9:70" + }, + { + "kind": "number", + "nativeSrc": "6015:2:70", + "nodeType": "YulLiteral", + "src": "6015:2:70", + "type": "", + "value": "96" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "6000:3:70", + "nodeType": "YulIdentifier", + "src": "6000:3:70" + }, + "nativeSrc": "6000:18:70", + "nodeType": "YulFunctionCall", + "src": "6000:18:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "5987:12:70", + "nodeType": "YulIdentifier", + "src": "5987:12:70" + }, + "nativeSrc": "5987:32:70", + "nodeType": "YulFunctionCall", + "src": "5987:32:70" + }, + "variableNames": [ + { + "name": "value_3", + "nativeSrc": "5976:7:70", + "nodeType": "YulIdentifier", + "src": "5976:7:70" + } + ] + }, + { + "nativeSrc": "6028:17:70", + "nodeType": "YulAssignment", + "src": "6028:17:70", + "value": { + "name": "value_3", + "nativeSrc": "6038:7:70", + "nodeType": "YulIdentifier", + "src": "6038:7:70" + }, + "variableNames": [ + { + "name": "value3", + "nativeSrc": "6028:6:70", + "nodeType": "YulIdentifier", + "src": "6028:6:70" + } + ] + } + ] + }, + "name": "abi_decode_tuple_t_addresst_addresst_uint256t_uint256", + "nativeSrc": "5422:629:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "5485:9:70", + "nodeType": "YulTypedName", + "src": "5485:9:70", + "type": "" + }, + { + "name": "dataEnd", + "nativeSrc": "5496:7:70", + "nodeType": "YulTypedName", + "src": "5496:7:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value0", + "nativeSrc": "5508:6:70", + "nodeType": "YulTypedName", + "src": "5508:6:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "5516:6:70", + "nodeType": "YulTypedName", + "src": "5516:6:70", + "type": "" + }, + { + "name": "value2", + "nativeSrc": "5524:6:70", + "nodeType": "YulTypedName", + "src": "5524:6:70", + "type": "" + }, + { + "name": "value3", + "nativeSrc": "5532:6:70", + "nodeType": "YulTypedName", + "src": "5532:6:70", + "type": "" + } + ], + "src": "5422:629:70" + }, + { + "body": { + "nativeSrc": "6126:177:70", + "nodeType": "YulBlock", + "src": "6126:177:70", + "statements": [ + { + "body": { + "nativeSrc": "6172:16:70", + "nodeType": "YulBlock", + "src": "6172:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "6181:1:70", + "nodeType": "YulLiteral", + "src": "6181:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "6184:1:70", + "nodeType": "YulLiteral", + "src": "6184:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "6174:6:70", + "nodeType": "YulIdentifier", + "src": "6174:6:70" + }, + "nativeSrc": "6174:12:70", + "nodeType": "YulFunctionCall", + "src": "6174:12:70" + }, + "nativeSrc": "6174:12:70", + "nodeType": "YulExpressionStatement", + "src": "6174:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "dataEnd", + "nativeSrc": "6147:7:70", + "nodeType": "YulIdentifier", + "src": "6147:7:70" + }, + { + "name": "headStart", + "nativeSrc": "6156:9:70", + "nodeType": "YulIdentifier", + "src": "6156:9:70" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "6143:3:70", + "nodeType": "YulIdentifier", + "src": "6143:3:70" + }, + "nativeSrc": "6143:23:70", + "nodeType": "YulFunctionCall", + "src": "6143:23:70" + }, + { + "kind": "number", + "nativeSrc": "6168:2:70", + "nodeType": "YulLiteral", + "src": "6168:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "slt", + "nativeSrc": "6139:3:70", + "nodeType": "YulIdentifier", + "src": "6139:3:70" + }, + "nativeSrc": "6139:32:70", + "nodeType": "YulFunctionCall", + "src": "6139:32:70" + }, + "nativeSrc": "6136:52:70", + "nodeType": "YulIf", + "src": "6136:52:70" + }, + { + "nativeSrc": "6197:36:70", + "nodeType": "YulVariableDeclaration", + "src": "6197:36:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "6223:9:70", + "nodeType": "YulIdentifier", + "src": "6223:9:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "6210:12:70", + "nodeType": "YulIdentifier", + "src": "6210:12:70" + }, + "nativeSrc": "6210:23:70", + "nodeType": "YulFunctionCall", + "src": "6210:23:70" + }, + "variables": [ + { + "name": "value", + "nativeSrc": "6201:5:70", + "nodeType": "YulTypedName", + "src": "6201:5:70", + "type": "" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "value", + "nativeSrc": "6267:5:70", + "nodeType": "YulIdentifier", + "src": "6267:5:70" + } + ], + "functionName": { + "name": "validator_revert_address", + "nativeSrc": "6242:24:70", + "nodeType": "YulIdentifier", + "src": "6242:24:70" + }, + "nativeSrc": "6242:31:70", + "nodeType": "YulFunctionCall", + "src": "6242:31:70" + }, + "nativeSrc": "6242:31:70", + "nodeType": "YulExpressionStatement", + "src": "6242:31:70" + }, + { + "nativeSrc": "6282:15:70", + "nodeType": "YulAssignment", + "src": "6282:15:70", + "value": { + "name": "value", + "nativeSrc": "6292:5:70", + "nodeType": "YulIdentifier", + "src": "6292:5:70" + }, + "variableNames": [ + { + "name": "value0", + "nativeSrc": "6282:6:70", + "nodeType": "YulIdentifier", + "src": "6282:6:70" + } + ] + } + ] + }, + "name": "abi_decode_tuple_t_address", + "nativeSrc": "6056:247:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "6092:9:70", + "nodeType": "YulTypedName", + "src": "6092:9:70", + "type": "" + }, + { + "name": "dataEnd", + "nativeSrc": "6103:7:70", + "nodeType": "YulTypedName", + "src": "6103:7:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value0", + "nativeSrc": "6115:6:70", + "nodeType": "YulTypedName", + "src": "6115:6:70", + "type": "" + } + ], + "src": "6056:247:70" + }, + { + "body": { + "nativeSrc": "6350:76:70", + "nodeType": "YulBlock", + "src": "6350:76:70", + "statements": [ + { + "body": { + "nativeSrc": "6404:16:70", + "nodeType": "YulBlock", + "src": "6404:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "6413:1:70", + "nodeType": "YulLiteral", + "src": "6413:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "6416:1:70", + "nodeType": "YulLiteral", + "src": "6416:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "6406:6:70", + "nodeType": "YulIdentifier", + "src": "6406:6:70" + }, + "nativeSrc": "6406:12:70", + "nodeType": "YulFunctionCall", + "src": "6406:12:70" + }, + "nativeSrc": "6406:12:70", + "nodeType": "YulExpressionStatement", + "src": "6406:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "value", + "nativeSrc": "6373:5:70", + "nodeType": "YulIdentifier", + "src": "6373:5:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "name": "value", + "nativeSrc": "6394:5:70", + "nodeType": "YulIdentifier", + "src": "6394:5:70" + } + ], + "functionName": { + "name": "iszero", + "nativeSrc": "6387:6:70", + "nodeType": "YulIdentifier", + "src": "6387:6:70" + }, + "nativeSrc": "6387:13:70", + "nodeType": "YulFunctionCall", + "src": "6387:13:70" + } + ], + "functionName": { + "name": "iszero", + "nativeSrc": "6380:6:70", + "nodeType": "YulIdentifier", + "src": "6380:6:70" + }, + "nativeSrc": "6380:21:70", + "nodeType": "YulFunctionCall", + "src": "6380:21:70" + } + ], + "functionName": { + "name": "eq", + "nativeSrc": "6370:2:70", + "nodeType": "YulIdentifier", + "src": "6370:2:70" + }, + "nativeSrc": "6370:32:70", + "nodeType": "YulFunctionCall", + "src": "6370:32:70" + } + ], + "functionName": { + "name": "iszero", + "nativeSrc": "6363:6:70", + "nodeType": "YulIdentifier", + "src": "6363:6:70" + }, + "nativeSrc": "6363:40:70", + "nodeType": "YulFunctionCall", + "src": "6363:40:70" + }, + "nativeSrc": "6360:60:70", + "nodeType": "YulIf", + "src": "6360:60:70" + } + ] + }, + "name": "validator_revert_bool", + "nativeSrc": "6308:118:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "value", + "nativeSrc": "6339:5:70", + "nodeType": "YulTypedName", + "src": "6339:5:70", + "type": "" + } + ], + "src": "6308:118:70" + }, + { + "body": { + "nativeSrc": "6549:484:70", + "nodeType": "YulBlock", + "src": "6549:484:70", + "statements": [ + { + "body": { + "nativeSrc": "6596:16:70", + "nodeType": "YulBlock", + "src": "6596:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "6605:1:70", + "nodeType": "YulLiteral", + "src": "6605:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "6608:1:70", + "nodeType": "YulLiteral", + "src": "6608:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "6598:6:70", + "nodeType": "YulIdentifier", + "src": "6598:6:70" + }, + "nativeSrc": "6598:12:70", + "nodeType": "YulFunctionCall", + "src": "6598:12:70" + }, + "nativeSrc": "6598:12:70", + "nodeType": "YulExpressionStatement", + "src": "6598:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "dataEnd", + "nativeSrc": "6570:7:70", + "nodeType": "YulIdentifier", + "src": "6570:7:70" + }, + { + "name": "headStart", + "nativeSrc": "6579:9:70", + "nodeType": "YulIdentifier", + "src": "6579:9:70" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "6566:3:70", + "nodeType": "YulIdentifier", + "src": "6566:3:70" + }, + "nativeSrc": "6566:23:70", + "nodeType": "YulFunctionCall", + "src": "6566:23:70" + }, + { + "kind": "number", + "nativeSrc": "6591:3:70", + "nodeType": "YulLiteral", + "src": "6591:3:70", + "type": "", + "value": "128" + } + ], + "functionName": { + "name": "slt", + "nativeSrc": "6562:3:70", + "nodeType": "YulIdentifier", + "src": "6562:3:70" + }, + "nativeSrc": "6562:33:70", + "nodeType": "YulFunctionCall", + "src": "6562:33:70" + }, + "nativeSrc": "6559:53:70", + "nodeType": "YulIf", + "src": "6559:53:70" + }, + { + "nativeSrc": "6621:14:70", + "nodeType": "YulVariableDeclaration", + "src": "6621:14:70", + "value": { + "kind": "number", + "nativeSrc": "6634:1:70", + "nodeType": "YulLiteral", + "src": "6634:1:70", + "type": "", + "value": "0" + }, + "variables": [ + { + "name": "value", + "nativeSrc": "6625:5:70", + "nodeType": "YulTypedName", + "src": "6625:5:70", + "type": "" + } + ] + }, + { + "nativeSrc": "6644:32:70", + "nodeType": "YulAssignment", + "src": "6644:32:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "6666:9:70", + "nodeType": "YulIdentifier", + "src": "6666:9:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "6653:12:70", + "nodeType": "YulIdentifier", + "src": "6653:12:70" + }, + "nativeSrc": "6653:23:70", + "nodeType": "YulFunctionCall", + "src": "6653:23:70" + }, + "variableNames": [ + { + "name": "value", + "nativeSrc": "6644:5:70", + "nodeType": "YulIdentifier", + "src": "6644:5:70" + } + ] + }, + { + "nativeSrc": "6685:15:70", + "nodeType": "YulAssignment", + "src": "6685:15:70", + "value": { + "name": "value", + "nativeSrc": "6695:5:70", + "nodeType": "YulIdentifier", + "src": "6695:5:70" + }, + "variableNames": [ + { + "name": "value0", + "nativeSrc": "6685:6:70", + "nodeType": "YulIdentifier", + "src": "6685:6:70" + } + ] + }, + { + "nativeSrc": "6709:16:70", + "nodeType": "YulVariableDeclaration", + "src": "6709:16:70", + "value": { + "kind": "number", + "nativeSrc": "6724:1:70", + "nodeType": "YulLiteral", + "src": "6724:1:70", + "type": "", + "value": "0" + }, + "variables": [ + { + "name": "value_1", + "nativeSrc": "6713:7:70", + "nodeType": "YulTypedName", + "src": "6713:7:70", + "type": "" + } + ] + }, + { + "nativeSrc": "6734:43:70", + "nodeType": "YulAssignment", + "src": "6734:43:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "6762:9:70", + "nodeType": "YulIdentifier", + "src": "6762:9:70" + }, + { + "kind": "number", + "nativeSrc": "6773:2:70", + "nodeType": "YulLiteral", + "src": "6773:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "6758:3:70", + "nodeType": "YulIdentifier", + "src": "6758:3:70" + }, + "nativeSrc": "6758:18:70", + "nodeType": "YulFunctionCall", + "src": "6758:18:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "6745:12:70", + "nodeType": "YulIdentifier", + "src": "6745:12:70" + }, + "nativeSrc": "6745:32:70", + "nodeType": "YulFunctionCall", + "src": "6745:32:70" + }, + "variableNames": [ + { + "name": "value_1", + "nativeSrc": "6734:7:70", + "nodeType": "YulIdentifier", + "src": "6734:7:70" + } + ] + }, + { + "nativeSrc": "6786:17:70", + "nodeType": "YulAssignment", + "src": "6786:17:70", + "value": { + "name": "value_1", + "nativeSrc": "6796:7:70", + "nodeType": "YulIdentifier", + "src": "6796:7:70" + }, + "variableNames": [ + { + "name": "value1", + "nativeSrc": "6786:6:70", + "nodeType": "YulIdentifier", + "src": "6786:6:70" + } + ] + }, + { + "nativeSrc": "6812:47:70", + "nodeType": "YulVariableDeclaration", + "src": "6812:47:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "6844:9:70", + "nodeType": "YulIdentifier", + "src": "6844:9:70" + }, + { + "kind": "number", + "nativeSrc": "6855:2:70", + "nodeType": "YulLiteral", + "src": "6855:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "6840:3:70", + "nodeType": "YulIdentifier", + "src": "6840:3:70" + }, + "nativeSrc": "6840:18:70", + "nodeType": "YulFunctionCall", + "src": "6840:18:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "6827:12:70", + "nodeType": "YulIdentifier", + "src": "6827:12:70" + }, + "nativeSrc": "6827:32:70", + "nodeType": "YulFunctionCall", + "src": "6827:32:70" + }, + "variables": [ + { + "name": "value_2", + "nativeSrc": "6816:7:70", + "nodeType": "YulTypedName", + "src": "6816:7:70", + "type": "" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "value_2", + "nativeSrc": "6890:7:70", + "nodeType": "YulIdentifier", + "src": "6890:7:70" + } + ], + "functionName": { + "name": "validator_revert_bool", + "nativeSrc": "6868:21:70", + "nodeType": "YulIdentifier", + "src": "6868:21:70" + }, + "nativeSrc": "6868:30:70", + "nodeType": "YulFunctionCall", + "src": "6868:30:70" + }, + "nativeSrc": "6868:30:70", + "nodeType": "YulExpressionStatement", + "src": "6868:30:70" + }, + { + "nativeSrc": "6907:17:70", + "nodeType": "YulAssignment", + "src": "6907:17:70", + "value": { + "name": "value_2", + "nativeSrc": "6917:7:70", + "nodeType": "YulIdentifier", + "src": "6917:7:70" + }, + "variableNames": [ + { + "name": "value2", + "nativeSrc": "6907:6:70", + "nodeType": "YulIdentifier", + "src": "6907:6:70" + } + ] + }, + { + "nativeSrc": "6933:16:70", + "nodeType": "YulVariableDeclaration", + "src": "6933:16:70", + "value": { + "kind": "number", + "nativeSrc": "6948:1:70", + "nodeType": "YulLiteral", + "src": "6948:1:70", + "type": "", + "value": "0" + }, + "variables": [ + { + "name": "value_3", + "nativeSrc": "6937:7:70", + "nodeType": "YulTypedName", + "src": "6937:7:70", + "type": "" + } + ] + }, + { + "nativeSrc": "6958:43:70", + "nodeType": "YulAssignment", + "src": "6958:43:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "6986:9:70", + "nodeType": "YulIdentifier", + "src": "6986:9:70" + }, + { + "kind": "number", + "nativeSrc": "6997:2:70", + "nodeType": "YulLiteral", + "src": "6997:2:70", + "type": "", + "value": "96" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "6982:3:70", + "nodeType": "YulIdentifier", + "src": "6982:3:70" + }, + "nativeSrc": "6982:18:70", + "nodeType": "YulFunctionCall", + "src": "6982:18:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "6969:12:70", + "nodeType": "YulIdentifier", + "src": "6969:12:70" + }, + "nativeSrc": "6969:32:70", + "nodeType": "YulFunctionCall", + "src": "6969:32:70" + }, + "variableNames": [ + { + "name": "value_3", + "nativeSrc": "6958:7:70", + "nodeType": "YulIdentifier", + "src": "6958:7:70" + } + ] + }, + { + "nativeSrc": "7010:17:70", + "nodeType": "YulAssignment", + "src": "7010:17:70", + "value": { + "name": "value_3", + "nativeSrc": "7020:7:70", + "nodeType": "YulIdentifier", + "src": "7020:7:70" + }, + "variableNames": [ + { + "name": "value3", + "nativeSrc": "7010:6:70", + "nodeType": "YulIdentifier", + "src": "7010:6:70" + } + ] + } + ] + }, + "name": "abi_decode_tuple_t_bytes32t_uint256t_boolt_uint256", + "nativeSrc": "6431:602:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "6491:9:70", + "nodeType": "YulTypedName", + "src": "6491:9:70", + "type": "" + }, + { + "name": "dataEnd", + "nativeSrc": "6502:7:70", + "nodeType": "YulTypedName", + "src": "6502:7:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value0", + "nativeSrc": "6514:6:70", + "nodeType": "YulTypedName", + "src": "6514:6:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "6522:6:70", + "nodeType": "YulTypedName", + "src": "6522:6:70", + "type": "" + }, + { + "name": "value2", + "nativeSrc": "6530:6:70", + "nodeType": "YulTypedName", + "src": "6530:6:70", + "type": "" + }, + { + "name": "value3", + "nativeSrc": "6538:6:70", + "nodeType": "YulTypedName", + "src": "6538:6:70", + "type": "" + } + ], + "src": "6431:602:70" + }, + { + "body": { + "nativeSrc": "7133:92:70", + "nodeType": "YulBlock", + "src": "7133:92:70", + "statements": [ + { + "nativeSrc": "7143:26:70", + "nodeType": "YulAssignment", + "src": "7143:26:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "7155:9:70", + "nodeType": "YulIdentifier", + "src": "7155:9:70" + }, + { + "kind": "number", + "nativeSrc": "7166:2:70", + "nodeType": "YulLiteral", + "src": "7166:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "7151:3:70", + "nodeType": "YulIdentifier", + "src": "7151:3:70" + }, + "nativeSrc": "7151:18:70", + "nodeType": "YulFunctionCall", + "src": "7151:18:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "7143:4:70", + "nodeType": "YulIdentifier", + "src": "7143:4:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "7185:9:70", + "nodeType": "YulIdentifier", + "src": "7185:9:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "name": "value0", + "nativeSrc": "7210:6:70", + "nodeType": "YulIdentifier", + "src": "7210:6:70" + } + ], + "functionName": { + "name": "iszero", + "nativeSrc": "7203:6:70", + "nodeType": "YulIdentifier", + "src": "7203:6:70" + }, + "nativeSrc": "7203:14:70", + "nodeType": "YulFunctionCall", + "src": "7203:14:70" + } + ], + "functionName": { + "name": "iszero", + "nativeSrc": "7196:6:70", + "nodeType": "YulIdentifier", + "src": "7196:6:70" + }, + "nativeSrc": "7196:22:70", + "nodeType": "YulFunctionCall", + "src": "7196:22:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "7178:6:70", + "nodeType": "YulIdentifier", + "src": "7178:6:70" + }, + "nativeSrc": "7178:41:70", + "nodeType": "YulFunctionCall", + "src": "7178:41:70" + }, + "nativeSrc": "7178:41:70", + "nodeType": "YulExpressionStatement", + "src": "7178:41:70" + } + ] + }, + "name": "abi_encode_tuple_t_bool__to_t_bool__fromStack_reversed", + "nativeSrc": "7038:187:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "7102:9:70", + "nodeType": "YulTypedName", + "src": "7102:9:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "7113:6:70", + "nodeType": "YulTypedName", + "src": "7113:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "7124:4:70", + "nodeType": "YulTypedName", + "src": "7124:4:70", + "type": "" + } + ], + "src": "7038:187:70" + }, + { + "body": { + "nativeSrc": "7302:275:70", + "nodeType": "YulBlock", + "src": "7302:275:70", + "statements": [ + { + "body": { + "nativeSrc": "7351:16:70", + "nodeType": "YulBlock", + "src": "7351:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "7360:1:70", + "nodeType": "YulLiteral", + "src": "7360:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "7363:1:70", + "nodeType": "YulLiteral", + "src": "7363:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "7353:6:70", + "nodeType": "YulIdentifier", + "src": "7353:6:70" + }, + "nativeSrc": "7353:12:70", + "nodeType": "YulFunctionCall", + "src": "7353:12:70" + }, + "nativeSrc": "7353:12:70", + "nodeType": "YulExpressionStatement", + "src": "7353:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "arguments": [ + { + "name": "offset", + "nativeSrc": "7330:6:70", + "nodeType": "YulIdentifier", + "src": "7330:6:70" + }, + { + "kind": "number", + "nativeSrc": "7338:4:70", + "nodeType": "YulLiteral", + "src": "7338:4:70", + "type": "", + "value": "0x1f" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "7326:3:70", + "nodeType": "YulIdentifier", + "src": "7326:3:70" + }, + "nativeSrc": "7326:17:70", + "nodeType": "YulFunctionCall", + "src": "7326:17:70" + }, + { + "name": "end", + "nativeSrc": "7345:3:70", + "nodeType": "YulIdentifier", + "src": "7345:3:70" + } + ], + "functionName": { + "name": "slt", + "nativeSrc": "7322:3:70", + "nodeType": "YulIdentifier", + "src": "7322:3:70" + }, + "nativeSrc": "7322:27:70", + "nodeType": "YulFunctionCall", + "src": "7322:27:70" + } + ], + "functionName": { + "name": "iszero", + "nativeSrc": "7315:6:70", + "nodeType": "YulIdentifier", + "src": "7315:6:70" + }, + "nativeSrc": "7315:35:70", + "nodeType": "YulFunctionCall", + "src": "7315:35:70" + }, + "nativeSrc": "7312:55:70", + "nodeType": "YulIf", + "src": "7312:55:70" + }, + { + "nativeSrc": "7376:30:70", + "nodeType": "YulAssignment", + "src": "7376:30:70", + "value": { + "arguments": [ + { + "name": "offset", + "nativeSrc": "7399:6:70", + "nodeType": "YulIdentifier", + "src": "7399:6:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "7386:12:70", + "nodeType": "YulIdentifier", + "src": "7386:12:70" + }, + "nativeSrc": "7386:20:70", + "nodeType": "YulFunctionCall", + "src": "7386:20:70" + }, + "variableNames": [ + { + "name": "length", + "nativeSrc": "7376:6:70", + "nodeType": "YulIdentifier", + "src": "7376:6:70" + } + ] + }, + { + "body": { + "nativeSrc": "7449:16:70", + "nodeType": "YulBlock", + "src": "7449:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "7458:1:70", + "nodeType": "YulLiteral", + "src": "7458:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "7461:1:70", + "nodeType": "YulLiteral", + "src": "7461:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "7451:6:70", + "nodeType": "YulIdentifier", + "src": "7451:6:70" + }, + "nativeSrc": "7451:12:70", + "nodeType": "YulFunctionCall", + "src": "7451:12:70" + }, + "nativeSrc": "7451:12:70", + "nodeType": "YulExpressionStatement", + "src": "7451:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "name": "length", + "nativeSrc": "7421:6:70", + "nodeType": "YulIdentifier", + "src": "7421:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "7437:2:70", + "nodeType": "YulLiteral", + "src": "7437:2:70", + "type": "", + "value": "64" + }, + { + "kind": "number", + "nativeSrc": "7441:1:70", + "nodeType": "YulLiteral", + "src": "7441:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "7433:3:70", + "nodeType": "YulIdentifier", + "src": "7433:3:70" + }, + "nativeSrc": "7433:10:70", + "nodeType": "YulFunctionCall", + "src": "7433:10:70" + }, + { + "kind": "number", + "nativeSrc": "7445:1:70", + "nodeType": "YulLiteral", + "src": "7445:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "7429:3:70", + "nodeType": "YulIdentifier", + "src": "7429:3:70" + }, + "nativeSrc": "7429:18:70", + "nodeType": "YulFunctionCall", + "src": "7429:18:70" + } + ], + "functionName": { + "name": "gt", + "nativeSrc": "7418:2:70", + "nodeType": "YulIdentifier", + "src": "7418:2:70" + }, + "nativeSrc": "7418:30:70", + "nodeType": "YulFunctionCall", + "src": "7418:30:70" + }, + "nativeSrc": "7415:50:70", + "nodeType": "YulIf", + "src": "7415:50:70" + }, + { + "nativeSrc": "7474:29:70", + "nodeType": "YulAssignment", + "src": "7474:29:70", + "value": { + "arguments": [ + { + "name": "offset", + "nativeSrc": "7490:6:70", + "nodeType": "YulIdentifier", + "src": "7490:6:70" + }, + { + "kind": "number", + "nativeSrc": "7498:4:70", + "nodeType": "YulLiteral", + "src": "7498:4:70", + "type": "", + "value": "0x20" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "7486:3:70", + "nodeType": "YulIdentifier", + "src": "7486:3:70" + }, + "nativeSrc": "7486:17:70", + "nodeType": "YulFunctionCall", + "src": "7486:17:70" + }, + "variableNames": [ + { + "name": "arrayPos", + "nativeSrc": "7474:8:70", + "nodeType": "YulIdentifier", + "src": "7474:8:70" + } + ] + }, + { + "body": { + "nativeSrc": "7555:16:70", + "nodeType": "YulBlock", + "src": "7555:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "7564:1:70", + "nodeType": "YulLiteral", + "src": "7564:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "7567:1:70", + "nodeType": "YulLiteral", + "src": "7567:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "7557:6:70", + "nodeType": "YulIdentifier", + "src": "7557:6:70" + }, + "nativeSrc": "7557:12:70", + "nodeType": "YulFunctionCall", + "src": "7557:12:70" + }, + "nativeSrc": "7557:12:70", + "nodeType": "YulExpressionStatement", + "src": "7557:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "arguments": [ + { + "name": "offset", + "nativeSrc": "7526:6:70", + "nodeType": "YulIdentifier", + "src": "7526:6:70" + }, + { + "name": "length", + "nativeSrc": "7534:6:70", + "nodeType": "YulIdentifier", + "src": "7534:6:70" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "7522:3:70", + "nodeType": "YulIdentifier", + "src": "7522:3:70" + }, + "nativeSrc": "7522:19:70", + "nodeType": "YulFunctionCall", + "src": "7522:19:70" + }, + { + "kind": "number", + "nativeSrc": "7543:4:70", + "nodeType": "YulLiteral", + "src": "7543:4:70", + "type": "", + "value": "0x20" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "7518:3:70", + "nodeType": "YulIdentifier", + "src": "7518:3:70" + }, + "nativeSrc": "7518:30:70", + "nodeType": "YulFunctionCall", + "src": "7518:30:70" + }, + { + "name": "end", + "nativeSrc": "7550:3:70", + "nodeType": "YulIdentifier", + "src": "7550:3:70" + } + ], + "functionName": { + "name": "gt", + "nativeSrc": "7515:2:70", + "nodeType": "YulIdentifier", + "src": "7515:2:70" + }, + "nativeSrc": "7515:39:70", + "nodeType": "YulFunctionCall", + "src": "7515:39:70" + }, + "nativeSrc": "7512:59:70", + "nodeType": "YulIf", + "src": "7512:59:70" + } + ] + }, + "name": "abi_decode_bytes_calldata", + "nativeSrc": "7230:347:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "offset", + "nativeSrc": "7265:6:70", + "nodeType": "YulTypedName", + "src": "7265:6:70", + "type": "" + }, + { + "name": "end", + "nativeSrc": "7273:3:70", + "nodeType": "YulTypedName", + "src": "7273:3:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "arrayPos", + "nativeSrc": "7281:8:70", + "nodeType": "YulTypedName", + "src": "7281:8:70", + "type": "" + }, + { + "name": "length", + "nativeSrc": "7291:6:70", + "nodeType": "YulTypedName", + "src": "7291:6:70", + "type": "" + } + ], + "src": "7230:347:70" + }, + { + "body": { + "nativeSrc": "7671:320:70", + "nodeType": "YulBlock", + "src": "7671:320:70", + "statements": [ + { + "body": { + "nativeSrc": "7717:16:70", + "nodeType": "YulBlock", + "src": "7717:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "7726:1:70", + "nodeType": "YulLiteral", + "src": "7726:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "7729:1:70", + "nodeType": "YulLiteral", + "src": "7729:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "7719:6:70", + "nodeType": "YulIdentifier", + "src": "7719:6:70" + }, + "nativeSrc": "7719:12:70", + "nodeType": "YulFunctionCall", + "src": "7719:12:70" + }, + "nativeSrc": "7719:12:70", + "nodeType": "YulExpressionStatement", + "src": "7719:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "dataEnd", + "nativeSrc": "7692:7:70", + "nodeType": "YulIdentifier", + "src": "7692:7:70" + }, + { + "name": "headStart", + "nativeSrc": "7701:9:70", + "nodeType": "YulIdentifier", + "src": "7701:9:70" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "7688:3:70", + "nodeType": "YulIdentifier", + "src": "7688:3:70" + }, + "nativeSrc": "7688:23:70", + "nodeType": "YulFunctionCall", + "src": "7688:23:70" + }, + { + "kind": "number", + "nativeSrc": "7713:2:70", + "nodeType": "YulLiteral", + "src": "7713:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "slt", + "nativeSrc": "7684:3:70", + "nodeType": "YulIdentifier", + "src": "7684:3:70" + }, + "nativeSrc": "7684:32:70", + "nodeType": "YulFunctionCall", + "src": "7684:32:70" + }, + "nativeSrc": "7681:52:70", + "nodeType": "YulIf", + "src": "7681:52:70" + }, + { + "nativeSrc": "7742:37:70", + "nodeType": "YulVariableDeclaration", + "src": "7742:37:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "7769:9:70", + "nodeType": "YulIdentifier", + "src": "7769:9:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "7756:12:70", + "nodeType": "YulIdentifier", + "src": "7756:12:70" + }, + "nativeSrc": "7756:23:70", + "nodeType": "YulFunctionCall", + "src": "7756:23:70" + }, + "variables": [ + { + "name": "offset", + "nativeSrc": "7746:6:70", + "nodeType": "YulTypedName", + "src": "7746:6:70", + "type": "" + } + ] + }, + { + "body": { + "nativeSrc": "7822:16:70", + "nodeType": "YulBlock", + "src": "7822:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "7831:1:70", + "nodeType": "YulLiteral", + "src": "7831:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "7834:1:70", + "nodeType": "YulLiteral", + "src": "7834:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "7824:6:70", + "nodeType": "YulIdentifier", + "src": "7824:6:70" + }, + "nativeSrc": "7824:12:70", + "nodeType": "YulFunctionCall", + "src": "7824:12:70" + }, + "nativeSrc": "7824:12:70", + "nodeType": "YulExpressionStatement", + "src": "7824:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "name": "offset", + "nativeSrc": "7794:6:70", + "nodeType": "YulIdentifier", + "src": "7794:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "7810:2:70", + "nodeType": "YulLiteral", + "src": "7810:2:70", + "type": "", + "value": "64" + }, + { + "kind": "number", + "nativeSrc": "7814:1:70", + "nodeType": "YulLiteral", + "src": "7814:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "7806:3:70", + "nodeType": "YulIdentifier", + "src": "7806:3:70" + }, + "nativeSrc": "7806:10:70", + "nodeType": "YulFunctionCall", + "src": "7806:10:70" + }, + { + "kind": "number", + "nativeSrc": "7818:1:70", + "nodeType": "YulLiteral", + "src": "7818:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "7802:3:70", + "nodeType": "YulIdentifier", + "src": "7802:3:70" + }, + "nativeSrc": "7802:18:70", + "nodeType": "YulFunctionCall", + "src": "7802:18:70" + } + ], + "functionName": { + "name": "gt", + "nativeSrc": "7791:2:70", + "nodeType": "YulIdentifier", + "src": "7791:2:70" + }, + "nativeSrc": "7791:30:70", + "nodeType": "YulFunctionCall", + "src": "7791:30:70" + }, + "nativeSrc": "7788:50:70", + "nodeType": "YulIf", + "src": "7788:50:70" + }, + { + "nativeSrc": "7847:84:70", + "nodeType": "YulVariableDeclaration", + "src": "7847:84:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "7903:9:70", + "nodeType": "YulIdentifier", + "src": "7903:9:70" + }, + { + "name": "offset", + "nativeSrc": "7914:6:70", + "nodeType": "YulIdentifier", + "src": "7914:6:70" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "7899:3:70", + "nodeType": "YulIdentifier", + "src": "7899:3:70" + }, + "nativeSrc": "7899:22:70", + "nodeType": "YulFunctionCall", + "src": "7899:22:70" + }, + { + "name": "dataEnd", + "nativeSrc": "7923:7:70", + "nodeType": "YulIdentifier", + "src": "7923:7:70" + } + ], + "functionName": { + "name": "abi_decode_bytes_calldata", + "nativeSrc": "7873:25:70", + "nodeType": "YulIdentifier", + "src": "7873:25:70" + }, + "nativeSrc": "7873:58:70", + "nodeType": "YulFunctionCall", + "src": "7873:58:70" + }, + "variables": [ + { + "name": "value0_1", + "nativeSrc": "7851:8:70", + "nodeType": "YulTypedName", + "src": "7851:8:70", + "type": "" + }, + { + "name": "value1_1", + "nativeSrc": "7861:8:70", + "nodeType": "YulTypedName", + "src": "7861:8:70", + "type": "" + } + ] + }, + { + "nativeSrc": "7940:18:70", + "nodeType": "YulAssignment", + "src": "7940:18:70", + "value": { + "name": "value0_1", + "nativeSrc": "7950:8:70", + "nodeType": "YulIdentifier", + "src": "7950:8:70" + }, + "variableNames": [ + { + "name": "value0", + "nativeSrc": "7940:6:70", + "nodeType": "YulIdentifier", + "src": "7940:6:70" + } + ] + }, + { + "nativeSrc": "7967:18:70", + "nodeType": "YulAssignment", + "src": "7967:18:70", + "value": { + "name": "value1_1", + "nativeSrc": "7977:8:70", + "nodeType": "YulIdentifier", + "src": "7977:8:70" + }, + "variableNames": [ + { + "name": "value1", + "nativeSrc": "7967:6:70", + "nodeType": "YulIdentifier", + "src": "7967:6:70" + } + ] + } + ] + }, + "name": "abi_decode_tuple_t_bytes_calldata_ptr", + "nativeSrc": "7582:409:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "7629:9:70", + "nodeType": "YulTypedName", + "src": "7629:9:70", + "type": "" + }, + { + "name": "dataEnd", + "nativeSrc": "7640:7:70", + "nodeType": "YulTypedName", + "src": "7640:7:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value0", + "nativeSrc": "7652:6:70", + "nodeType": "YulTypedName", + "src": "7652:6:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "7660:6:70", + "nodeType": "YulTypedName", + "src": "7660:6:70", + "type": "" + } + ], + "src": "7582:409:70" + }, + { + "body": { + "nativeSrc": "8121:587:70", + "nodeType": "YulBlock", + "src": "8121:587:70", + "statements": [ + { + "body": { + "nativeSrc": "8167:16:70", + "nodeType": "YulBlock", + "src": "8167:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "8176:1:70", + "nodeType": "YulLiteral", + "src": "8176:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "8179:1:70", + "nodeType": "YulLiteral", + "src": "8179:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "8169:6:70", + "nodeType": "YulIdentifier", + "src": "8169:6:70" + }, + "nativeSrc": "8169:12:70", + "nodeType": "YulFunctionCall", + "src": "8169:12:70" + }, + "nativeSrc": "8169:12:70", + "nodeType": "YulExpressionStatement", + "src": "8169:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "dataEnd", + "nativeSrc": "8142:7:70", + "nodeType": "YulIdentifier", + "src": "8142:7:70" + }, + { + "name": "headStart", + "nativeSrc": "8151:9:70", + "nodeType": "YulIdentifier", + "src": "8151:9:70" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "8138:3:70", + "nodeType": "YulIdentifier", + "src": "8138:3:70" + }, + "nativeSrc": "8138:23:70", + "nodeType": "YulFunctionCall", + "src": "8138:23:70" + }, + { + "kind": "number", + "nativeSrc": "8163:2:70", + "nodeType": "YulLiteral", + "src": "8163:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "slt", + "nativeSrc": "8134:3:70", + "nodeType": "YulIdentifier", + "src": "8134:3:70" + }, + "nativeSrc": "8134:32:70", + "nodeType": "YulFunctionCall", + "src": "8134:32:70" + }, + "nativeSrc": "8131:52:70", + "nodeType": "YulIf", + "src": "8131:52:70" + }, + { + "nativeSrc": "8192:37:70", + "nodeType": "YulVariableDeclaration", + "src": "8192:37:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "8219:9:70", + "nodeType": "YulIdentifier", + "src": "8219:9:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "8206:12:70", + "nodeType": "YulIdentifier", + "src": "8206:12:70" + }, + "nativeSrc": "8206:23:70", + "nodeType": "YulFunctionCall", + "src": "8206:23:70" + }, + "variables": [ + { + "name": "offset", + "nativeSrc": "8196:6:70", + "nodeType": "YulTypedName", + "src": "8196:6:70", + "type": "" + } + ] + }, + { + "body": { + "nativeSrc": "8272:16:70", + "nodeType": "YulBlock", + "src": "8272:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "8281:1:70", + "nodeType": "YulLiteral", + "src": "8281:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "8284:1:70", + "nodeType": "YulLiteral", + "src": "8284:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "8274:6:70", + "nodeType": "YulIdentifier", + "src": "8274:6:70" + }, + "nativeSrc": "8274:12:70", + "nodeType": "YulFunctionCall", + "src": "8274:12:70" + }, + "nativeSrc": "8274:12:70", + "nodeType": "YulExpressionStatement", + "src": "8274:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "name": "offset", + "nativeSrc": "8244:6:70", + "nodeType": "YulIdentifier", + "src": "8244:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "8260:2:70", + "nodeType": "YulLiteral", + "src": "8260:2:70", + "type": "", + "value": "64" + }, + { + "kind": "number", + "nativeSrc": "8264:1:70", + "nodeType": "YulLiteral", + "src": "8264:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "8256:3:70", + "nodeType": "YulIdentifier", + "src": "8256:3:70" + }, + "nativeSrc": "8256:10:70", + "nodeType": "YulFunctionCall", + "src": "8256:10:70" + }, + { + "kind": "number", + "nativeSrc": "8268:1:70", + "nodeType": "YulLiteral", + "src": "8268:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "8252:3:70", + "nodeType": "YulIdentifier", + "src": "8252:3:70" + }, + "nativeSrc": "8252:18:70", + "nodeType": "YulFunctionCall", + "src": "8252:18:70" + } + ], + "functionName": { + "name": "gt", + "nativeSrc": "8241:2:70", + "nodeType": "YulIdentifier", + "src": "8241:2:70" + }, + "nativeSrc": "8241:30:70", + "nodeType": "YulFunctionCall", + "src": "8241:30:70" + }, + "nativeSrc": "8238:50:70", + "nodeType": "YulIf", + "src": "8238:50:70" + }, + { + "nativeSrc": "8297:84:70", + "nodeType": "YulVariableDeclaration", + "src": "8297:84:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "8353:9:70", + "nodeType": "YulIdentifier", + "src": "8353:9:70" + }, + { + "name": "offset", + "nativeSrc": "8364:6:70", + "nodeType": "YulIdentifier", + "src": "8364:6:70" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "8349:3:70", + "nodeType": "YulIdentifier", + "src": "8349:3:70" + }, + "nativeSrc": "8349:22:70", + "nodeType": "YulFunctionCall", + "src": "8349:22:70" + }, + { + "name": "dataEnd", + "nativeSrc": "8373:7:70", + "nodeType": "YulIdentifier", + "src": "8373:7:70" + } + ], + "functionName": { + "name": "abi_decode_bytes_calldata", + "nativeSrc": "8323:25:70", + "nodeType": "YulIdentifier", + "src": "8323:25:70" + }, + "nativeSrc": "8323:58:70", + "nodeType": "YulFunctionCall", + "src": "8323:58:70" + }, + "variables": [ + { + "name": "value0_1", + "nativeSrc": "8301:8:70", + "nodeType": "YulTypedName", + "src": "8301:8:70", + "type": "" + }, + { + "name": "value1_1", + "nativeSrc": "8311:8:70", + "nodeType": "YulTypedName", + "src": "8311:8:70", + "type": "" + } + ] + }, + { + "nativeSrc": "8390:18:70", + "nodeType": "YulAssignment", + "src": "8390:18:70", + "value": { + "name": "value0_1", + "nativeSrc": "8400:8:70", + "nodeType": "YulIdentifier", + "src": "8400:8:70" + }, + "variableNames": [ + { + "name": "value0", + "nativeSrc": "8390:6:70", + "nodeType": "YulIdentifier", + "src": "8390:6:70" + } + ] + }, + { + "nativeSrc": "8417:18:70", + "nodeType": "YulAssignment", + "src": "8417:18:70", + "value": { + "name": "value1_1", + "nativeSrc": "8427:8:70", + "nodeType": "YulIdentifier", + "src": "8427:8:70" + }, + "variableNames": [ + { + "name": "value1", + "nativeSrc": "8417:6:70", + "nodeType": "YulIdentifier", + "src": "8417:6:70" + } + ] + }, + { + "nativeSrc": "8444:48:70", + "nodeType": "YulVariableDeclaration", + "src": "8444:48:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "8477:9:70", + "nodeType": "YulIdentifier", + "src": "8477:9:70" + }, + { + "kind": "number", + "nativeSrc": "8488:2:70", + "nodeType": "YulLiteral", + "src": "8488:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "8473:3:70", + "nodeType": "YulIdentifier", + "src": "8473:3:70" + }, + "nativeSrc": "8473:18:70", + "nodeType": "YulFunctionCall", + "src": "8473:18:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "8460:12:70", + "nodeType": "YulIdentifier", + "src": "8460:12:70" + }, + "nativeSrc": "8460:32:70", + "nodeType": "YulFunctionCall", + "src": "8460:32:70" + }, + "variables": [ + { + "name": "offset_1", + "nativeSrc": "8448:8:70", + "nodeType": "YulTypedName", + "src": "8448:8:70", + "type": "" + } + ] + }, + { + "body": { + "nativeSrc": "8537:16:70", + "nodeType": "YulBlock", + "src": "8537:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "8546:1:70", + "nodeType": "YulLiteral", + "src": "8546:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "8549:1:70", + "nodeType": "YulLiteral", + "src": "8549:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "8539:6:70", + "nodeType": "YulIdentifier", + "src": "8539:6:70" + }, + "nativeSrc": "8539:12:70", + "nodeType": "YulFunctionCall", + "src": "8539:12:70" + }, + "nativeSrc": "8539:12:70", + "nodeType": "YulExpressionStatement", + "src": "8539:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "name": "offset_1", + "nativeSrc": "8507:8:70", + "nodeType": "YulIdentifier", + "src": "8507:8:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "8525:2:70", + "nodeType": "YulLiteral", + "src": "8525:2:70", + "type": "", + "value": "64" + }, + { + "kind": "number", + "nativeSrc": "8529:1:70", + "nodeType": "YulLiteral", + "src": "8529:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "8521:3:70", + "nodeType": "YulIdentifier", + "src": "8521:3:70" + }, + "nativeSrc": "8521:10:70", + "nodeType": "YulFunctionCall", + "src": "8521:10:70" + }, + { + "kind": "number", + "nativeSrc": "8533:1:70", + "nodeType": "YulLiteral", + "src": "8533:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "8517:3:70", + "nodeType": "YulIdentifier", + "src": "8517:3:70" + }, + "nativeSrc": "8517:18:70", + "nodeType": "YulFunctionCall", + "src": "8517:18:70" + } + ], + "functionName": { + "name": "gt", + "nativeSrc": "8504:2:70", + "nodeType": "YulIdentifier", + "src": "8504:2:70" + }, + "nativeSrc": "8504:32:70", + "nodeType": "YulFunctionCall", + "src": "8504:32:70" + }, + "nativeSrc": "8501:52:70", + "nodeType": "YulIf", + "src": "8501:52:70" + }, + { + "nativeSrc": "8562:86:70", + "nodeType": "YulVariableDeclaration", + "src": "8562:86:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "8618:9:70", + "nodeType": "YulIdentifier", + "src": "8618:9:70" + }, + { + "name": "offset_1", + "nativeSrc": "8629:8:70", + "nodeType": "YulIdentifier", + "src": "8629:8:70" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "8614:3:70", + "nodeType": "YulIdentifier", + "src": "8614:3:70" + }, + "nativeSrc": "8614:24:70", + "nodeType": "YulFunctionCall", + "src": "8614:24:70" + }, + { + "name": "dataEnd", + "nativeSrc": "8640:7:70", + "nodeType": "YulIdentifier", + "src": "8640:7:70" + } + ], + "functionName": { + "name": "abi_decode_bytes_calldata", + "nativeSrc": "8588:25:70", + "nodeType": "YulIdentifier", + "src": "8588:25:70" + }, + "nativeSrc": "8588:60:70", + "nodeType": "YulFunctionCall", + "src": "8588:60:70" + }, + "variables": [ + { + "name": "value2_1", + "nativeSrc": "8566:8:70", + "nodeType": "YulTypedName", + "src": "8566:8:70", + "type": "" + }, + { + "name": "value3_1", + "nativeSrc": "8576:8:70", + "nodeType": "YulTypedName", + "src": "8576:8:70", + "type": "" + } + ] + }, + { + "nativeSrc": "8657:18:70", + "nodeType": "YulAssignment", + "src": "8657:18:70", + "value": { + "name": "value2_1", + "nativeSrc": "8667:8:70", + "nodeType": "YulIdentifier", + "src": "8667:8:70" + }, + "variableNames": [ + { + "name": "value2", + "nativeSrc": "8657:6:70", + "nodeType": "YulIdentifier", + "src": "8657:6:70" + } + ] + }, + { + "nativeSrc": "8684:18:70", + "nodeType": "YulAssignment", + "src": "8684:18:70", + "value": { + "name": "value3_1", + "nativeSrc": "8694:8:70", + "nodeType": "YulIdentifier", + "src": "8694:8:70" + }, + "variableNames": [ + { + "name": "value3", + "nativeSrc": "8684:6:70", + "nodeType": "YulIdentifier", + "src": "8684:6:70" + } + ] + } + ] + }, + "name": "abi_decode_tuple_t_bytes_calldata_ptrt_bytes_calldata_ptr", + "nativeSrc": "7996:712:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "8063:9:70", + "nodeType": "YulTypedName", + "src": "8063:9:70", + "type": "" + }, + { + "name": "dataEnd", + "nativeSrc": "8074:7:70", + "nodeType": "YulTypedName", + "src": "8074:7:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value0", + "nativeSrc": "8086:6:70", + "nodeType": "YulTypedName", + "src": "8086:6:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "8094:6:70", + "nodeType": "YulTypedName", + "src": "8094:6:70", + "type": "" + }, + { + "name": "value2", + "nativeSrc": "8102:6:70", + "nodeType": "YulTypedName", + "src": "8102:6:70", + "type": "" + }, + { + "name": "value3", + "nativeSrc": "8110:6:70", + "nodeType": "YulTypedName", + "src": "8110:6:70", + "type": "" + } + ], + "src": "7996:712:70" + }, + { + "body": { + "nativeSrc": "8842:119:70", + "nodeType": "YulBlock", + "src": "8842:119:70", + "statements": [ + { + "nativeSrc": "8852:26:70", + "nodeType": "YulAssignment", + "src": "8852:26:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "8864:9:70", + "nodeType": "YulIdentifier", + "src": "8864:9:70" + }, + { + "kind": "number", + "nativeSrc": "8875:2:70", + "nodeType": "YulLiteral", + "src": "8875:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "8860:3:70", + "nodeType": "YulIdentifier", + "src": "8860:3:70" + }, + "nativeSrc": "8860:18:70", + "nodeType": "YulFunctionCall", + "src": "8860:18:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "8852:4:70", + "nodeType": "YulIdentifier", + "src": "8852:4:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "8894:9:70", + "nodeType": "YulIdentifier", + "src": "8894:9:70" + }, + { + "name": "value0", + "nativeSrc": "8905:6:70", + "nodeType": "YulIdentifier", + "src": "8905:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "8887:6:70", + "nodeType": "YulIdentifier", + "src": "8887:6:70" + }, + "nativeSrc": "8887:25:70", + "nodeType": "YulFunctionCall", + "src": "8887:25:70" + }, + "nativeSrc": "8887:25:70", + "nodeType": "YulExpressionStatement", + "src": "8887:25:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "8932:9:70", + "nodeType": "YulIdentifier", + "src": "8932:9:70" + }, + { + "kind": "number", + "nativeSrc": "8943:2:70", + "nodeType": "YulLiteral", + "src": "8943:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "8928:3:70", + "nodeType": "YulIdentifier", + "src": "8928:3:70" + }, + "nativeSrc": "8928:18:70", + "nodeType": "YulFunctionCall", + "src": "8928:18:70" + }, + { + "name": "value1", + "nativeSrc": "8948:6:70", + "nodeType": "YulIdentifier", + "src": "8948:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "8921:6:70", + "nodeType": "YulIdentifier", + "src": "8921:6:70" + }, + "nativeSrc": "8921:34:70", + "nodeType": "YulFunctionCall", + "src": "8921:34:70" + }, + "nativeSrc": "8921:34:70", + "nodeType": "YulExpressionStatement", + "src": "8921:34:70" + } + ] + }, + "name": "abi_encode_tuple_t_bytes32_t_bytes32__to_t_bytes32_t_bytes32__fromStack_reversed", + "nativeSrc": "8713:248:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "8803:9:70", + "nodeType": "YulTypedName", + "src": "8803:9:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "8814:6:70", + "nodeType": "YulTypedName", + "src": "8814:6:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "8822:6:70", + "nodeType": "YulTypedName", + "src": "8822:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "8833:4:70", + "nodeType": "YulTypedName", + "src": "8833:4:70", + "type": "" + } + ], + "src": "8713:248:70" + }, + { + "body": { + "nativeSrc": "9007:303:70", + "nodeType": "YulBlock", + "src": "9007:303:70", + "statements": [ + { + "nativeSrc": "9017:19:70", + "nodeType": "YulAssignment", + "src": "9017:19:70", + "value": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "9033:2:70", + "nodeType": "YulLiteral", + "src": "9033:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "9027:5:70", + "nodeType": "YulIdentifier", + "src": "9027:5:70" + }, + "nativeSrc": "9027:9:70", + "nodeType": "YulFunctionCall", + "src": "9027:9:70" + }, + "variableNames": [ + { + "name": "memPtr", + "nativeSrc": "9017:6:70", + "nodeType": "YulIdentifier", + "src": "9017:6:70" + } + ] + }, + { + "nativeSrc": "9045:34:70", + "nodeType": "YulVariableDeclaration", + "src": "9045:34:70", + "value": { + "arguments": [ + { + "name": "memPtr", + "nativeSrc": "9067:6:70", + "nodeType": "YulIdentifier", + "src": "9067:6:70" + }, + { + "kind": "number", + "nativeSrc": "9075:3:70", + "nodeType": "YulLiteral", + "src": "9075:3:70", + "type": "", + "value": "192" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "9063:3:70", + "nodeType": "YulIdentifier", + "src": "9063:3:70" + }, + "nativeSrc": "9063:16:70", + "nodeType": "YulFunctionCall", + "src": "9063:16:70" + }, + "variables": [ + { + "name": "newFreePtr", + "nativeSrc": "9049:10:70", + "nodeType": "YulTypedName", + "src": "9049:10:70", + "type": "" + } + ] + }, + { + "body": { + "nativeSrc": "9162:111:70", + "nodeType": "YulBlock", + "src": "9162:111:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "9183:1:70", + "nodeType": "YulLiteral", + "src": "9183:1:70", + "type": "", + "value": "0" + }, + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "9190:3:70", + "nodeType": "YulLiteral", + "src": "9190:3:70", + "type": "", + "value": "224" + }, + { + "kind": "number", + "nativeSrc": "9195:10:70", + "nodeType": "YulLiteral", + "src": "9195:10:70", + "type": "", + "value": "0x4e487b71" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "9186:3:70", + "nodeType": "YulIdentifier", + "src": "9186:3:70" + }, + "nativeSrc": "9186:20:70", + "nodeType": "YulFunctionCall", + "src": "9186:20:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "9176:6:70", + "nodeType": "YulIdentifier", + "src": "9176:6:70" + }, + "nativeSrc": "9176:31:70", + "nodeType": "YulFunctionCall", + "src": "9176:31:70" + }, + "nativeSrc": "9176:31:70", + "nodeType": "YulExpressionStatement", + "src": "9176:31:70" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "9227:1:70", + "nodeType": "YulLiteral", + "src": "9227:1:70", + "type": "", + "value": "4" + }, + { + "kind": "number", + "nativeSrc": "9230:4:70", + "nodeType": "YulLiteral", + "src": "9230:4:70", + "type": "", + "value": "0x41" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "9220:6:70", + "nodeType": "YulIdentifier", + "src": "9220:6:70" + }, + "nativeSrc": "9220:15:70", + "nodeType": "YulFunctionCall", + "src": "9220:15:70" + }, + "nativeSrc": "9220:15:70", + "nodeType": "YulExpressionStatement", + "src": "9220:15:70" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "9255:1:70", + "nodeType": "YulLiteral", + "src": "9255:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "9258:4:70", + "nodeType": "YulLiteral", + "src": "9258:4:70", + "type": "", + "value": "0x24" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "9248:6:70", + "nodeType": "YulIdentifier", + "src": "9248:6:70" + }, + "nativeSrc": "9248:15:70", + "nodeType": "YulFunctionCall", + "src": "9248:15:70" + }, + "nativeSrc": "9248:15:70", + "nodeType": "YulExpressionStatement", + "src": "9248:15:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "newFreePtr", + "nativeSrc": "9097:10:70", + "nodeType": "YulIdentifier", + "src": "9097:10:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "9117:2:70", + "nodeType": "YulLiteral", + "src": "9117:2:70", + "type": "", + "value": "64" + }, + { + "kind": "number", + "nativeSrc": "9121:1:70", + "nodeType": "YulLiteral", + "src": "9121:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "9113:3:70", + "nodeType": "YulIdentifier", + "src": "9113:3:70" + }, + "nativeSrc": "9113:10:70", + "nodeType": "YulFunctionCall", + "src": "9113:10:70" + }, + { + "kind": "number", + "nativeSrc": "9125:1:70", + "nodeType": "YulLiteral", + "src": "9125:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "9109:3:70", + "nodeType": "YulIdentifier", + "src": "9109:3:70" + }, + "nativeSrc": "9109:18:70", + "nodeType": "YulFunctionCall", + "src": "9109:18:70" + } + ], + "functionName": { + "name": "gt", + "nativeSrc": "9094:2:70", + "nodeType": "YulIdentifier", + "src": "9094:2:70" + }, + "nativeSrc": "9094:34:70", + "nodeType": "YulFunctionCall", + "src": "9094:34:70" + }, + { + "arguments": [ + { + "name": "newFreePtr", + "nativeSrc": "9133:10:70", + "nodeType": "YulIdentifier", + "src": "9133:10:70" + }, + { + "name": "memPtr", + "nativeSrc": "9145:6:70", + "nodeType": "YulIdentifier", + "src": "9145:6:70" + } + ], + "functionName": { + "name": "lt", + "nativeSrc": "9130:2:70", + "nodeType": "YulIdentifier", + "src": "9130:2:70" + }, + "nativeSrc": "9130:22:70", + "nodeType": "YulFunctionCall", + "src": "9130:22:70" + } + ], + "functionName": { + "name": "or", + "nativeSrc": "9091:2:70", + "nodeType": "YulIdentifier", + "src": "9091:2:70" + }, + "nativeSrc": "9091:62:70", + "nodeType": "YulFunctionCall", + "src": "9091:62:70" + }, + "nativeSrc": "9088:185:70", + "nodeType": "YulIf", + "src": "9088:185:70" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "9289:2:70", + "nodeType": "YulLiteral", + "src": "9289:2:70", + "type": "", + "value": "64" + }, + { + "name": "newFreePtr", + "nativeSrc": "9293:10:70", + "nodeType": "YulIdentifier", + "src": "9293:10:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "9282:6:70", + "nodeType": "YulIdentifier", + "src": "9282:6:70" + }, + "nativeSrc": "9282:22:70", + "nodeType": "YulFunctionCall", + "src": "9282:22:70" + }, + "nativeSrc": "9282:22:70", + "nodeType": "YulExpressionStatement", + "src": "9282:22:70" + } + ] + }, + "name": "allocate_memory", + "nativeSrc": "8966:344:70", + "nodeType": "YulFunctionDefinition", + "returnVariables": [ + { + "name": "memPtr", + "nativeSrc": "8996:6:70", + "nodeType": "YulTypedName", + "src": "8996:6:70", + "type": "" + } + ], + "src": "8966:344:70" + }, + { + "body": { + "nativeSrc": "9361:306:70", + "nodeType": "YulBlock", + "src": "9361:306:70", + "statements": [ + { + "nativeSrc": "9371:19:70", + "nodeType": "YulAssignment", + "src": "9371:19:70", + "value": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "9387:2:70", + "nodeType": "YulLiteral", + "src": "9387:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "9381:5:70", + "nodeType": "YulIdentifier", + "src": "9381:5:70" + }, + "nativeSrc": "9381:9:70", + "nodeType": "YulFunctionCall", + "src": "9381:9:70" + }, + "variableNames": [ + { + "name": "memPtr", + "nativeSrc": "9371:6:70", + "nodeType": "YulIdentifier", + "src": "9371:6:70" + } + ] + }, + { + "nativeSrc": "9399:37:70", + "nodeType": "YulVariableDeclaration", + "src": "9399:37:70", + "value": { + "arguments": [ + { + "name": "memPtr", + "nativeSrc": "9421:6:70", + "nodeType": "YulIdentifier", + "src": "9421:6:70" + }, + { + "kind": "number", + "nativeSrc": "9429:6:70", + "nodeType": "YulLiteral", + "src": "9429:6:70", + "type": "", + "value": "0x0120" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "9417:3:70", + "nodeType": "YulIdentifier", + "src": "9417:3:70" + }, + "nativeSrc": "9417:19:70", + "nodeType": "YulFunctionCall", + "src": "9417:19:70" + }, + "variables": [ + { + "name": "newFreePtr", + "nativeSrc": "9403:10:70", + "nodeType": "YulTypedName", + "src": "9403:10:70", + "type": "" + } + ] + }, + { + "body": { + "nativeSrc": "9519:111:70", + "nodeType": "YulBlock", + "src": "9519:111:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "9540:1:70", + "nodeType": "YulLiteral", + "src": "9540:1:70", + "type": "", + "value": "0" + }, + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "9547:3:70", + "nodeType": "YulLiteral", + "src": "9547:3:70", + "type": "", + "value": "224" + }, + { + "kind": "number", + "nativeSrc": "9552:10:70", + "nodeType": "YulLiteral", + "src": "9552:10:70", + "type": "", + "value": "0x4e487b71" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "9543:3:70", + "nodeType": "YulIdentifier", + "src": "9543:3:70" + }, + "nativeSrc": "9543:20:70", + "nodeType": "YulFunctionCall", + "src": "9543:20:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "9533:6:70", + "nodeType": "YulIdentifier", + "src": "9533:6:70" + }, + "nativeSrc": "9533:31:70", + "nodeType": "YulFunctionCall", + "src": "9533:31:70" + }, + "nativeSrc": "9533:31:70", + "nodeType": "YulExpressionStatement", + "src": "9533:31:70" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "9584:1:70", + "nodeType": "YulLiteral", + "src": "9584:1:70", + "type": "", + "value": "4" + }, + { + "kind": "number", + "nativeSrc": "9587:4:70", + "nodeType": "YulLiteral", + "src": "9587:4:70", + "type": "", + "value": "0x41" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "9577:6:70", + "nodeType": "YulIdentifier", + "src": "9577:6:70" + }, + "nativeSrc": "9577:15:70", + "nodeType": "YulFunctionCall", + "src": "9577:15:70" + }, + "nativeSrc": "9577:15:70", + "nodeType": "YulExpressionStatement", + "src": "9577:15:70" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "9612:1:70", + "nodeType": "YulLiteral", + "src": "9612:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "9615:4:70", + "nodeType": "YulLiteral", + "src": "9615:4:70", + "type": "", + "value": "0x24" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "9605:6:70", + "nodeType": "YulIdentifier", + "src": "9605:6:70" + }, + "nativeSrc": "9605:15:70", + "nodeType": "YulFunctionCall", + "src": "9605:15:70" + }, + "nativeSrc": "9605:15:70", + "nodeType": "YulExpressionStatement", + "src": "9605:15:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "newFreePtr", + "nativeSrc": "9454:10:70", + "nodeType": "YulIdentifier", + "src": "9454:10:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "9474:2:70", + "nodeType": "YulLiteral", + "src": "9474:2:70", + "type": "", + "value": "64" + }, + { + "kind": "number", + "nativeSrc": "9478:1:70", + "nodeType": "YulLiteral", + "src": "9478:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "9470:3:70", + "nodeType": "YulIdentifier", + "src": "9470:3:70" + }, + "nativeSrc": "9470:10:70", + "nodeType": "YulFunctionCall", + "src": "9470:10:70" + }, + { + "kind": "number", + "nativeSrc": "9482:1:70", + "nodeType": "YulLiteral", + "src": "9482:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "9466:3:70", + "nodeType": "YulIdentifier", + "src": "9466:3:70" + }, + "nativeSrc": "9466:18:70", + "nodeType": "YulFunctionCall", + "src": "9466:18:70" + } + ], + "functionName": { + "name": "gt", + "nativeSrc": "9451:2:70", + "nodeType": "YulIdentifier", + "src": "9451:2:70" + }, + "nativeSrc": "9451:34:70", + "nodeType": "YulFunctionCall", + "src": "9451:34:70" + }, + { + "arguments": [ + { + "name": "newFreePtr", + "nativeSrc": "9490:10:70", + "nodeType": "YulIdentifier", + "src": "9490:10:70" + }, + { + "name": "memPtr", + "nativeSrc": "9502:6:70", + "nodeType": "YulIdentifier", + "src": "9502:6:70" + } + ], + "functionName": { + "name": "lt", + "nativeSrc": "9487:2:70", + "nodeType": "YulIdentifier", + "src": "9487:2:70" + }, + "nativeSrc": "9487:22:70", + "nodeType": "YulFunctionCall", + "src": "9487:22:70" + } + ], + "functionName": { + "name": "or", + "nativeSrc": "9448:2:70", + "nodeType": "YulIdentifier", + "src": "9448:2:70" + }, + "nativeSrc": "9448:62:70", + "nodeType": "YulFunctionCall", + "src": "9448:62:70" + }, + "nativeSrc": "9445:185:70", + "nodeType": "YulIf", + "src": "9445:185:70" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "9646:2:70", + "nodeType": "YulLiteral", + "src": "9646:2:70", + "type": "", + "value": "64" + }, + { + "name": "newFreePtr", + "nativeSrc": "9650:10:70", + "nodeType": "YulIdentifier", + "src": "9650:10:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "9639:6:70", + "nodeType": "YulIdentifier", + "src": "9639:6:70" + }, + "nativeSrc": "9639:22:70", + "nodeType": "YulFunctionCall", + "src": "9639:22:70" + }, + "nativeSrc": "9639:22:70", + "nodeType": "YulExpressionStatement", + "src": "9639:22:70" + } + ] + }, + "name": "allocate_memory_2390", + "nativeSrc": "9315:352:70", + "nodeType": "YulFunctionDefinition", + "returnVariables": [ + { + "name": "memPtr", + "nativeSrc": "9350:6:70", + "nodeType": "YulTypedName", + "src": "9350:6:70", + "type": "" + } + ], + "src": "9315:352:70" + }, + { + "body": { + "nativeSrc": "9718:303:70", + "nodeType": "YulBlock", + "src": "9718:303:70", + "statements": [ + { + "nativeSrc": "9728:19:70", + "nodeType": "YulAssignment", + "src": "9728:19:70", + "value": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "9744:2:70", + "nodeType": "YulLiteral", + "src": "9744:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "9738:5:70", + "nodeType": "YulIdentifier", + "src": "9738:5:70" + }, + "nativeSrc": "9738:9:70", + "nodeType": "YulFunctionCall", + "src": "9738:9:70" + }, + "variableNames": [ + { + "name": "memPtr", + "nativeSrc": "9728:6:70", + "nodeType": "YulIdentifier", + "src": "9728:6:70" + } + ] + }, + { + "nativeSrc": "9756:34:70", + "nodeType": "YulVariableDeclaration", + "src": "9756:34:70", + "value": { + "arguments": [ + { + "name": "memPtr", + "nativeSrc": "9778:6:70", + "nodeType": "YulIdentifier", + "src": "9778:6:70" + }, + { + "kind": "number", + "nativeSrc": "9786:3:70", + "nodeType": "YulLiteral", + "src": "9786:3:70", + "type": "", + "value": "320" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "9774:3:70", + "nodeType": "YulIdentifier", + "src": "9774:3:70" + }, + "nativeSrc": "9774:16:70", + "nodeType": "YulFunctionCall", + "src": "9774:16:70" + }, + "variables": [ + { + "name": "newFreePtr", + "nativeSrc": "9760:10:70", + "nodeType": "YulTypedName", + "src": "9760:10:70", + "type": "" + } + ] + }, + { + "body": { + "nativeSrc": "9873:111:70", + "nodeType": "YulBlock", + "src": "9873:111:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "9894:1:70", + "nodeType": "YulLiteral", + "src": "9894:1:70", + "type": "", + "value": "0" + }, + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "9901:3:70", + "nodeType": "YulLiteral", + "src": "9901:3:70", + "type": "", + "value": "224" + }, + { + "kind": "number", + "nativeSrc": "9906:10:70", + "nodeType": "YulLiteral", + "src": "9906:10:70", + "type": "", + "value": "0x4e487b71" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "9897:3:70", + "nodeType": "YulIdentifier", + "src": "9897:3:70" + }, + "nativeSrc": "9897:20:70", + "nodeType": "YulFunctionCall", + "src": "9897:20:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "9887:6:70", + "nodeType": "YulIdentifier", + "src": "9887:6:70" + }, + "nativeSrc": "9887:31:70", + "nodeType": "YulFunctionCall", + "src": "9887:31:70" + }, + "nativeSrc": "9887:31:70", + "nodeType": "YulExpressionStatement", + "src": "9887:31:70" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "9938:1:70", + "nodeType": "YulLiteral", + "src": "9938:1:70", + "type": "", + "value": "4" + }, + { + "kind": "number", + "nativeSrc": "9941:4:70", + "nodeType": "YulLiteral", + "src": "9941:4:70", + "type": "", + "value": "0x41" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "9931:6:70", + "nodeType": "YulIdentifier", + "src": "9931:6:70" + }, + "nativeSrc": "9931:15:70", + "nodeType": "YulFunctionCall", + "src": "9931:15:70" + }, + "nativeSrc": "9931:15:70", + "nodeType": "YulExpressionStatement", + "src": "9931:15:70" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "9966:1:70", + "nodeType": "YulLiteral", + "src": "9966:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "9969:4:70", + "nodeType": "YulLiteral", + "src": "9969:4:70", + "type": "", + "value": "0x24" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "9959:6:70", + "nodeType": "YulIdentifier", + "src": "9959:6:70" + }, + "nativeSrc": "9959:15:70", + "nodeType": "YulFunctionCall", + "src": "9959:15:70" + }, + "nativeSrc": "9959:15:70", + "nodeType": "YulExpressionStatement", + "src": "9959:15:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "newFreePtr", + "nativeSrc": "9808:10:70", + "nodeType": "YulIdentifier", + "src": "9808:10:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "9828:2:70", + "nodeType": "YulLiteral", + "src": "9828:2:70", + "type": "", + "value": "64" + }, + { + "kind": "number", + "nativeSrc": "9832:1:70", + "nodeType": "YulLiteral", + "src": "9832:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "9824:3:70", + "nodeType": "YulIdentifier", + "src": "9824:3:70" + }, + "nativeSrc": "9824:10:70", + "nodeType": "YulFunctionCall", + "src": "9824:10:70" + }, + { + "kind": "number", + "nativeSrc": "9836:1:70", + "nodeType": "YulLiteral", + "src": "9836:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "9820:3:70", + "nodeType": "YulIdentifier", + "src": "9820:3:70" + }, + "nativeSrc": "9820:18:70", + "nodeType": "YulFunctionCall", + "src": "9820:18:70" + } + ], + "functionName": { + "name": "gt", + "nativeSrc": "9805:2:70", + "nodeType": "YulIdentifier", + "src": "9805:2:70" + }, + "nativeSrc": "9805:34:70", + "nodeType": "YulFunctionCall", + "src": "9805:34:70" + }, + { + "arguments": [ + { + "name": "newFreePtr", + "nativeSrc": "9844:10:70", + "nodeType": "YulIdentifier", + "src": "9844:10:70" + }, + { + "name": "memPtr", + "nativeSrc": "9856:6:70", + "nodeType": "YulIdentifier", + "src": "9856:6:70" + } + ], + "functionName": { + "name": "lt", + "nativeSrc": "9841:2:70", + "nodeType": "YulIdentifier", + "src": "9841:2:70" + }, + "nativeSrc": "9841:22:70", + "nodeType": "YulFunctionCall", + "src": "9841:22:70" + } + ], + "functionName": { + "name": "or", + "nativeSrc": "9802:2:70", + "nodeType": "YulIdentifier", + "src": "9802:2:70" + }, + "nativeSrc": "9802:62:70", + "nodeType": "YulFunctionCall", + "src": "9802:62:70" + }, + "nativeSrc": "9799:185:70", + "nodeType": "YulIf", + "src": "9799:185:70" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "10000:2:70", + "nodeType": "YulLiteral", + "src": "10000:2:70", + "type": "", + "value": "64" + }, + { + "name": "newFreePtr", + "nativeSrc": "10004:10:70", + "nodeType": "YulIdentifier", + "src": "10004:10:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "9993:6:70", + "nodeType": "YulIdentifier", + "src": "9993:6:70" + }, + "nativeSrc": "9993:22:70", + "nodeType": "YulFunctionCall", + "src": "9993:22:70" + }, + "nativeSrc": "9993:22:70", + "nodeType": "YulExpressionStatement", + "src": "9993:22:70" + } + ] + }, + "name": "allocate_memory_2392", + "nativeSrc": "9672:349:70", + "nodeType": "YulFunctionDefinition", + "returnVariables": [ + { + "name": "memPtr", + "nativeSrc": "9707:6:70", + "nodeType": "YulTypedName", + "src": "9707:6:70", + "type": "" + } + ], + "src": "9672:349:70" + }, + { + "body": { + "nativeSrc": "10120:911:70", + "nodeType": "YulBlock", + "src": "10120:911:70", + "statements": [ + { + "nativeSrc": "10130:43:70", + "nodeType": "YulVariableDeclaration", + "src": "10130:43:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "dataEnd", + "nativeSrc": "10148:7:70", + "nodeType": "YulIdentifier", + "src": "10148:7:70" + }, + { + "name": "headStart", + "nativeSrc": "10157:9:70", + "nodeType": "YulIdentifier", + "src": "10157:9:70" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "10144:3:70", + "nodeType": "YulIdentifier", + "src": "10144:3:70" + }, + "nativeSrc": "10144:23:70", + "nodeType": "YulFunctionCall", + "src": "10144:23:70" + }, + { + "kind": "number", + "nativeSrc": "10169:3:70", + "nodeType": "YulLiteral", + "src": "10169:3:70", + "type": "", + "value": "192" + } + ], + "functionName": { + "name": "slt", + "nativeSrc": "10140:3:70", + "nodeType": "YulIdentifier", + "src": "10140:3:70" + }, + "nativeSrc": "10140:33:70", + "nodeType": "YulFunctionCall", + "src": "10140:33:70" + }, + "variables": [ + { + "name": "_1", + "nativeSrc": "10134:2:70", + "nodeType": "YulTypedName", + "src": "10134:2:70", + "type": "" + } + ] + }, + { + "body": { + "nativeSrc": "10188:16:70", + "nodeType": "YulBlock", + "src": "10188:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "10197:1:70", + "nodeType": "YulLiteral", + "src": "10197:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "10200:1:70", + "nodeType": "YulLiteral", + "src": "10200:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "10190:6:70", + "nodeType": "YulIdentifier", + "src": "10190:6:70" + }, + "nativeSrc": "10190:12:70", + "nodeType": "YulFunctionCall", + "src": "10190:12:70" + }, + "nativeSrc": "10190:12:70", + "nodeType": "YulExpressionStatement", + "src": "10190:12:70" + } + ] + }, + "condition": { + "name": "_1", + "nativeSrc": "10185:2:70", + "nodeType": "YulIdentifier", + "src": "10185:2:70" + }, + "nativeSrc": "10182:22:70", + "nodeType": "YulIf", + "src": "10182:22:70" + }, + { + "nativeSrc": "10213:7:70", + "nodeType": "YulAssignment", + "src": "10213:7:70", + "value": { + "kind": "number", + "nativeSrc": "10219:1:70", + "nodeType": "YulLiteral", + "src": "10219:1:70", + "type": "", + "value": "0" + }, + "variableNames": [ + { + "name": "_1", + "nativeSrc": "10213:2:70", + "nodeType": "YulIdentifier", + "src": "10213:2:70" + } + ] + }, + { + "nativeSrc": "10229:30:70", + "nodeType": "YulVariableDeclaration", + "src": "10229:30:70", + "value": { + "arguments": [], + "functionName": { + "name": "allocate_memory", + "nativeSrc": "10242:15:70", + "nodeType": "YulIdentifier", + "src": "10242:15:70" + }, + "nativeSrc": "10242:17:70", + "nodeType": "YulFunctionCall", + "src": "10242:17:70" + }, + "variables": [ + { + "name": "value", + "nativeSrc": "10233:5:70", + "nodeType": "YulTypedName", + "src": "10233:5:70", + "type": "" + } + ] + }, + { + "nativeSrc": "10268:17:70", + "nodeType": "YulVariableDeclaration", + "src": "10268:17:70", + "value": { + "name": "_1", + "nativeSrc": "10283:2:70", + "nodeType": "YulIdentifier", + "src": "10283:2:70" + }, + "variables": [ + { + "name": "value_1", + "nativeSrc": "10272:7:70", + "nodeType": "YulTypedName", + "src": "10272:7:70", + "type": "" + } + ] + }, + { + "nativeSrc": "10294:34:70", + "nodeType": "YulAssignment", + "src": "10294:34:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "10318:9:70", + "nodeType": "YulIdentifier", + "src": "10318:9:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "10305:12:70", + "nodeType": "YulIdentifier", + "src": "10305:12:70" + }, + "nativeSrc": "10305:23:70", + "nodeType": "YulFunctionCall", + "src": "10305:23:70" + }, + "variableNames": [ + { + "name": "value_1", + "nativeSrc": "10294:7:70", + "nodeType": "YulIdentifier", + "src": "10294:7:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "value", + "nativeSrc": "10344:5:70", + "nodeType": "YulIdentifier", + "src": "10344:5:70" + }, + { + "name": "value_1", + "nativeSrc": "10351:7:70", + "nodeType": "YulIdentifier", + "src": "10351:7:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "10337:6:70", + "nodeType": "YulIdentifier", + "src": "10337:6:70" + }, + "nativeSrc": "10337:22:70", + "nodeType": "YulFunctionCall", + "src": "10337:22:70" + }, + "nativeSrc": "10337:22:70", + "nodeType": "YulExpressionStatement", + "src": "10337:22:70" + }, + { + "nativeSrc": "10368:17:70", + "nodeType": "YulVariableDeclaration", + "src": "10368:17:70", + "value": { + "name": "_1", + "nativeSrc": "10383:2:70", + "nodeType": "YulIdentifier", + "src": "10383:2:70" + }, + "variables": [ + { + "name": "value_2", + "nativeSrc": "10372:7:70", + "nodeType": "YulTypedName", + "src": "10372:7:70", + "type": "" + } + ] + }, + { + "nativeSrc": "10394:43:70", + "nodeType": "YulAssignment", + "src": "10394:43:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "10422:9:70", + "nodeType": "YulIdentifier", + "src": "10422:9:70" + }, + { + "kind": "number", + "nativeSrc": "10433:2:70", + "nodeType": "YulLiteral", + "src": "10433:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "10418:3:70", + "nodeType": "YulIdentifier", + "src": "10418:3:70" + }, + "nativeSrc": "10418:18:70", + "nodeType": "YulFunctionCall", + "src": "10418:18:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "10405:12:70", + "nodeType": "YulIdentifier", + "src": "10405:12:70" + }, + "nativeSrc": "10405:32:70", + "nodeType": "YulFunctionCall", + "src": "10405:32:70" + }, + "variableNames": [ + { + "name": "value_2", + "nativeSrc": "10394:7:70", + "nodeType": "YulIdentifier", + "src": "10394:7:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "value", + "nativeSrc": "10457:5:70", + "nodeType": "YulIdentifier", + "src": "10457:5:70" + }, + { + "kind": "number", + "nativeSrc": "10464:2:70", + "nodeType": "YulLiteral", + "src": "10464:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "10453:3:70", + "nodeType": "YulIdentifier", + "src": "10453:3:70" + }, + "nativeSrc": "10453:14:70", + "nodeType": "YulFunctionCall", + "src": "10453:14:70" + }, + { + "name": "value_2", + "nativeSrc": "10469:7:70", + "nodeType": "YulIdentifier", + "src": "10469:7:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "10446:6:70", + "nodeType": "YulIdentifier", + "src": "10446:6:70" + }, + "nativeSrc": "10446:31:70", + "nodeType": "YulFunctionCall", + "src": "10446:31:70" + }, + "nativeSrc": "10446:31:70", + "nodeType": "YulExpressionStatement", + "src": "10446:31:70" + }, + { + "nativeSrc": "10486:17:70", + "nodeType": "YulVariableDeclaration", + "src": "10486:17:70", + "value": { + "name": "_1", + "nativeSrc": "10501:2:70", + "nodeType": "YulIdentifier", + "src": "10501:2:70" + }, + "variables": [ + { + "name": "value_3", + "nativeSrc": "10490:7:70", + "nodeType": "YulTypedName", + "src": "10490:7:70", + "type": "" + } + ] + }, + { + "nativeSrc": "10512:43:70", + "nodeType": "YulAssignment", + "src": "10512:43:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "10540:9:70", + "nodeType": "YulIdentifier", + "src": "10540:9:70" + }, + { + "kind": "number", + "nativeSrc": "10551:2:70", + "nodeType": "YulLiteral", + "src": "10551:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "10536:3:70", + "nodeType": "YulIdentifier", + "src": "10536:3:70" + }, + "nativeSrc": "10536:18:70", + "nodeType": "YulFunctionCall", + "src": "10536:18:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "10523:12:70", + "nodeType": "YulIdentifier", + "src": "10523:12:70" + }, + "nativeSrc": "10523:32:70", + "nodeType": "YulFunctionCall", + "src": "10523:32:70" + }, + "variableNames": [ + { + "name": "value_3", + "nativeSrc": "10512:7:70", + "nodeType": "YulIdentifier", + "src": "10512:7:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "value", + "nativeSrc": "10575:5:70", + "nodeType": "YulIdentifier", + "src": "10575:5:70" + }, + { + "kind": "number", + "nativeSrc": "10582:2:70", + "nodeType": "YulLiteral", + "src": "10582:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "10571:3:70", + "nodeType": "YulIdentifier", + "src": "10571:3:70" + }, + "nativeSrc": "10571:14:70", + "nodeType": "YulFunctionCall", + "src": "10571:14:70" + }, + { + "name": "value_3", + "nativeSrc": "10587:7:70", + "nodeType": "YulIdentifier", + "src": "10587:7:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "10564:6:70", + "nodeType": "YulIdentifier", + "src": "10564:6:70" + }, + "nativeSrc": "10564:31:70", + "nodeType": "YulFunctionCall", + "src": "10564:31:70" + }, + "nativeSrc": "10564:31:70", + "nodeType": "YulExpressionStatement", + "src": "10564:31:70" + }, + { + "nativeSrc": "10604:17:70", + "nodeType": "YulVariableDeclaration", + "src": "10604:17:70", + "value": { + "name": "_1", + "nativeSrc": "10619:2:70", + "nodeType": "YulIdentifier", + "src": "10619:2:70" + }, + "variables": [ + { + "name": "value_4", + "nativeSrc": "10608:7:70", + "nodeType": "YulTypedName", + "src": "10608:7:70", + "type": "" + } + ] + }, + { + "nativeSrc": "10630:43:70", + "nodeType": "YulAssignment", + "src": "10630:43:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "10658:9:70", + "nodeType": "YulIdentifier", + "src": "10658:9:70" + }, + { + "kind": "number", + "nativeSrc": "10669:2:70", + "nodeType": "YulLiteral", + "src": "10669:2:70", + "type": "", + "value": "96" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "10654:3:70", + "nodeType": "YulIdentifier", + "src": "10654:3:70" + }, + "nativeSrc": "10654:18:70", + "nodeType": "YulFunctionCall", + "src": "10654:18:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "10641:12:70", + "nodeType": "YulIdentifier", + "src": "10641:12:70" + }, + "nativeSrc": "10641:32:70", + "nodeType": "YulFunctionCall", + "src": "10641:32:70" + }, + "variableNames": [ + { + "name": "value_4", + "nativeSrc": "10630:7:70", + "nodeType": "YulIdentifier", + "src": "10630:7:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "value", + "nativeSrc": "10693:5:70", + "nodeType": "YulIdentifier", + "src": "10693:5:70" + }, + { + "kind": "number", + "nativeSrc": "10700:2:70", + "nodeType": "YulLiteral", + "src": "10700:2:70", + "type": "", + "value": "96" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "10689:3:70", + "nodeType": "YulIdentifier", + "src": "10689:3:70" + }, + "nativeSrc": "10689:14:70", + "nodeType": "YulFunctionCall", + "src": "10689:14:70" + }, + { + "name": "value_4", + "nativeSrc": "10705:7:70", + "nodeType": "YulIdentifier", + "src": "10705:7:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "10682:6:70", + "nodeType": "YulIdentifier", + "src": "10682:6:70" + }, + "nativeSrc": "10682:31:70", + "nodeType": "YulFunctionCall", + "src": "10682:31:70" + }, + "nativeSrc": "10682:31:70", + "nodeType": "YulExpressionStatement", + "src": "10682:31:70" + }, + { + "nativeSrc": "10722:17:70", + "nodeType": "YulVariableDeclaration", + "src": "10722:17:70", + "value": { + "name": "_1", + "nativeSrc": "10737:2:70", + "nodeType": "YulIdentifier", + "src": "10737:2:70" + }, + "variables": [ + { + "name": "value_5", + "nativeSrc": "10726:7:70", + "nodeType": "YulTypedName", + "src": "10726:7:70", + "type": "" + } + ] + }, + { + "nativeSrc": "10748:44:70", + "nodeType": "YulAssignment", + "src": "10748:44:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "10776:9:70", + "nodeType": "YulIdentifier", + "src": "10776:9:70" + }, + { + "kind": "number", + "nativeSrc": "10787:3:70", + "nodeType": "YulLiteral", + "src": "10787:3:70", + "type": "", + "value": "128" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "10772:3:70", + "nodeType": "YulIdentifier", + "src": "10772:3:70" + }, + "nativeSrc": "10772:19:70", + "nodeType": "YulFunctionCall", + "src": "10772:19:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "10759:12:70", + "nodeType": "YulIdentifier", + "src": "10759:12:70" + }, + "nativeSrc": "10759:33:70", + "nodeType": "YulFunctionCall", + "src": "10759:33:70" + }, + "variableNames": [ + { + "name": "value_5", + "nativeSrc": "10748:7:70", + "nodeType": "YulIdentifier", + "src": "10748:7:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "value", + "nativeSrc": "10812:5:70", + "nodeType": "YulIdentifier", + "src": "10812:5:70" + }, + { + "kind": "number", + "nativeSrc": "10819:3:70", + "nodeType": "YulLiteral", + "src": "10819:3:70", + "type": "", + "value": "128" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "10808:3:70", + "nodeType": "YulIdentifier", + "src": "10808:3:70" + }, + "nativeSrc": "10808:15:70", + "nodeType": "YulFunctionCall", + "src": "10808:15:70" + }, + { + "name": "value_5", + "nativeSrc": "10825:7:70", + "nodeType": "YulIdentifier", + "src": "10825:7:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "10801:6:70", + "nodeType": "YulIdentifier", + "src": "10801:6:70" + }, + "nativeSrc": "10801:32:70", + "nodeType": "YulFunctionCall", + "src": "10801:32:70" + }, + "nativeSrc": "10801:32:70", + "nodeType": "YulExpressionStatement", + "src": "10801:32:70" + }, + { + "nativeSrc": "10842:48:70", + "nodeType": "YulVariableDeclaration", + "src": "10842:48:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "10874:9:70", + "nodeType": "YulIdentifier", + "src": "10874:9:70" + }, + { + "kind": "number", + "nativeSrc": "10885:3:70", + "nodeType": "YulLiteral", + "src": "10885:3:70", + "type": "", + "value": "160" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "10870:3:70", + "nodeType": "YulIdentifier", + "src": "10870:3:70" + }, + "nativeSrc": "10870:19:70", + "nodeType": "YulFunctionCall", + "src": "10870:19:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "10857:12:70", + "nodeType": "YulIdentifier", + "src": "10857:12:70" + }, + "nativeSrc": "10857:33:70", + "nodeType": "YulFunctionCall", + "src": "10857:33:70" + }, + "variables": [ + { + "name": "value_6", + "nativeSrc": "10846:7:70", + "nodeType": "YulTypedName", + "src": "10846:7:70", + "type": "" + } + ] + }, + { + "body": { + "nativeSrc": "10942:18:70", + "nodeType": "YulBlock", + "src": "10942:18:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "name": "_1", + "nativeSrc": "10951:2:70", + "nodeType": "YulIdentifier", + "src": "10951:2:70" + }, + { + "name": "_1", + "nativeSrc": "10955:2:70", + "nodeType": "YulIdentifier", + "src": "10955:2:70" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "10944:6:70", + "nodeType": "YulIdentifier", + "src": "10944:6:70" + }, + "nativeSrc": "10944:14:70", + "nodeType": "YulFunctionCall", + "src": "10944:14:70" + }, + "nativeSrc": "10944:14:70", + "nodeType": "YulExpressionStatement", + "src": "10944:14:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "value_6", + "nativeSrc": "10912:7:70", + "nodeType": "YulIdentifier", + "src": "10912:7:70" + }, + { + "arguments": [ + { + "name": "value_6", + "nativeSrc": "10925:7:70", + "nodeType": "YulIdentifier", + "src": "10925:7:70" + }, + { + "kind": "number", + "nativeSrc": "10934:4:70", + "nodeType": "YulLiteral", + "src": "10934:4:70", + "type": "", + "value": "0xff" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "10921:3:70", + "nodeType": "YulIdentifier", + "src": "10921:3:70" + }, + "nativeSrc": "10921:18:70", + "nodeType": "YulFunctionCall", + "src": "10921:18:70" + } + ], + "functionName": { + "name": "eq", + "nativeSrc": "10909:2:70", + "nodeType": "YulIdentifier", + "src": "10909:2:70" + }, + "nativeSrc": "10909:31:70", + "nodeType": "YulFunctionCall", + "src": "10909:31:70" + } + ], + "functionName": { + "name": "iszero", + "nativeSrc": "10902:6:70", + "nodeType": "YulIdentifier", + "src": "10902:6:70" + }, + "nativeSrc": "10902:39:70", + "nodeType": "YulFunctionCall", + "src": "10902:39:70" + }, + "nativeSrc": "10899:61:70", + "nodeType": "YulIf", + "src": "10899:61:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "value", + "nativeSrc": "10980:5:70", + "nodeType": "YulIdentifier", + "src": "10980:5:70" + }, + { + "kind": "number", + "nativeSrc": "10987:3:70", + "nodeType": "YulLiteral", + "src": "10987:3:70", + "type": "", + "value": "160" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "10976:3:70", + "nodeType": "YulIdentifier", + "src": "10976:3:70" + }, + "nativeSrc": "10976:15:70", + "nodeType": "YulFunctionCall", + "src": "10976:15:70" + }, + { + "name": "value_6", + "nativeSrc": "10993:7:70", + "nodeType": "YulIdentifier", + "src": "10993:7:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "10969:6:70", + "nodeType": "YulIdentifier", + "src": "10969:6:70" + }, + "nativeSrc": "10969:32:70", + "nodeType": "YulFunctionCall", + "src": "10969:32:70" + }, + "nativeSrc": "10969:32:70", + "nodeType": "YulExpressionStatement", + "src": "10969:32:70" + }, + { + "nativeSrc": "11010:15:70", + "nodeType": "YulAssignment", + "src": "11010:15:70", + "value": { + "name": "value", + "nativeSrc": "11020:5:70", + "nodeType": "YulIdentifier", + "src": "11020:5:70" + }, + "variableNames": [ + { + "name": "value0", + "nativeSrc": "11010:6:70", + "nodeType": "YulIdentifier", + "src": "11010:6:70" + } + ] + } + ] + }, + "name": "abi_decode_tuple_t_struct$_State_$16058_memory_ptr", + "nativeSrc": "10026:1005:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "10086:9:70", + "nodeType": "YulTypedName", + "src": "10086:9:70", + "type": "" + }, + { + "name": "dataEnd", + "nativeSrc": "10097:7:70", + "nodeType": "YulTypedName", + "src": "10097:7:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value0", + "nativeSrc": "10109:6:70", + "nodeType": "YulTypedName", + "src": "10109:6:70", + "type": "" + } + ], + "src": "10026:1005:70" + }, + { + "body": { + "nativeSrc": "11104:86:70", + "nodeType": "YulBlock", + "src": "11104:86:70", + "statements": [ + { + "body": { + "nativeSrc": "11144:16:70", + "nodeType": "YulBlock", + "src": "11144:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "11153:1:70", + "nodeType": "YulLiteral", + "src": "11153:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "11156:1:70", + "nodeType": "YulLiteral", + "src": "11156:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "11146:6:70", + "nodeType": "YulIdentifier", + "src": "11146:6:70" + }, + "nativeSrc": "11146:12:70", + "nodeType": "YulFunctionCall", + "src": "11146:12:70" + }, + "nativeSrc": "11146:12:70", + "nodeType": "YulExpressionStatement", + "src": "11146:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "end", + "nativeSrc": "11125:3:70", + "nodeType": "YulIdentifier", + "src": "11125:3:70" + }, + { + "name": "offset", + "nativeSrc": "11130:6:70", + "nodeType": "YulIdentifier", + "src": "11130:6:70" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "11121:3:70", + "nodeType": "YulIdentifier", + "src": "11121:3:70" + }, + "nativeSrc": "11121:16:70", + "nodeType": "YulFunctionCall", + "src": "11121:16:70" + }, + { + "kind": "number", + "nativeSrc": "11139:3:70", + "nodeType": "YulLiteral", + "src": "11139:3:70", + "type": "", + "value": "192" + } + ], + "functionName": { + "name": "slt", + "nativeSrc": "11117:3:70", + "nodeType": "YulIdentifier", + "src": "11117:3:70" + }, + "nativeSrc": "11117:26:70", + "nodeType": "YulFunctionCall", + "src": "11117:26:70" + }, + "nativeSrc": "11114:46:70", + "nodeType": "YulIf", + "src": "11114:46:70" + }, + { + "nativeSrc": "11169:15:70", + "nodeType": "YulAssignment", + "src": "11169:15:70", + "value": { + "name": "offset", + "nativeSrc": "11178:6:70", + "nodeType": "YulIdentifier", + "src": "11178:6:70" + }, + "variableNames": [ + { + "name": "value", + "nativeSrc": "11169:5:70", + "nodeType": "YulIdentifier", + "src": "11169:5:70" + } + ] + } + ] + }, + "name": "abi_decode_struct_State_calldata", + "nativeSrc": "11036:154:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "offset", + "nativeSrc": "11078:6:70", + "nodeType": "YulTypedName", + "src": "11078:6:70", + "type": "" + }, + { + "name": "end", + "nativeSrc": "11086:3:70", + "nodeType": "YulTypedName", + "src": "11086:3:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value", + "nativeSrc": "11094:5:70", + "nodeType": "YulTypedName", + "src": "11094:5:70", + "type": "" + } + ], + "src": "11036:154:70" + }, + { + "body": { + "nativeSrc": "11334:221:70", + "nodeType": "YulBlock", + "src": "11334:221:70", + "statements": [ + { + "body": { + "nativeSrc": "11381:16:70", + "nodeType": "YulBlock", + "src": "11381:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "11390:1:70", + "nodeType": "YulLiteral", + "src": "11390:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "11393:1:70", + "nodeType": "YulLiteral", + "src": "11393:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "11383:6:70", + "nodeType": "YulIdentifier", + "src": "11383:6:70" + }, + "nativeSrc": "11383:12:70", + "nodeType": "YulFunctionCall", + "src": "11383:12:70" + }, + "nativeSrc": "11383:12:70", + "nodeType": "YulExpressionStatement", + "src": "11383:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "dataEnd", + "nativeSrc": "11355:7:70", + "nodeType": "YulIdentifier", + "src": "11355:7:70" + }, + { + "name": "headStart", + "nativeSrc": "11364:9:70", + "nodeType": "YulIdentifier", + "src": "11364:9:70" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "11351:3:70", + "nodeType": "YulIdentifier", + "src": "11351:3:70" + }, + "nativeSrc": "11351:23:70", + "nodeType": "YulFunctionCall", + "src": "11351:23:70" + }, + { + "kind": "number", + "nativeSrc": "11376:3:70", + "nodeType": "YulLiteral", + "src": "11376:3:70", + "type": "", + "value": "384" + } + ], + "functionName": { + "name": "slt", + "nativeSrc": "11347:3:70", + "nodeType": "YulIdentifier", + "src": "11347:3:70" + }, + "nativeSrc": "11347:33:70", + "nodeType": "YulFunctionCall", + "src": "11347:33:70" + }, + "nativeSrc": "11344:53:70", + "nodeType": "YulIf", + "src": "11344:53:70" + }, + { + "nativeSrc": "11406:62:70", + "nodeType": "YulAssignment", + "src": "11406:62:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "11449:9:70", + "nodeType": "YulIdentifier", + "src": "11449:9:70" + }, + { + "name": "dataEnd", + "nativeSrc": "11460:7:70", + "nodeType": "YulIdentifier", + "src": "11460:7:70" + } + ], + "functionName": { + "name": "abi_decode_struct_State_calldata", + "nativeSrc": "11416:32:70", + "nodeType": "YulIdentifier", + "src": "11416:32:70" + }, + "nativeSrc": "11416:52:70", + "nodeType": "YulFunctionCall", + "src": "11416:52:70" + }, + "variableNames": [ + { + "name": "value0", + "nativeSrc": "11406:6:70", + "nodeType": "YulIdentifier", + "src": "11406:6:70" + } + ] + }, + { + "nativeSrc": "11477:72:70", + "nodeType": "YulAssignment", + "src": "11477:72:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "11524:9:70", + "nodeType": "YulIdentifier", + "src": "11524:9:70" + }, + { + "kind": "number", + "nativeSrc": "11535:3:70", + "nodeType": "YulLiteral", + "src": "11535:3:70", + "type": "", + "value": "192" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "11520:3:70", + "nodeType": "YulIdentifier", + "src": "11520:3:70" + }, + "nativeSrc": "11520:19:70", + "nodeType": "YulFunctionCall", + "src": "11520:19:70" + }, + { + "name": "dataEnd", + "nativeSrc": "11541:7:70", + "nodeType": "YulIdentifier", + "src": "11541:7:70" + } + ], + "functionName": { + "name": "abi_decode_struct_State_calldata", + "nativeSrc": "11487:32:70", + "nodeType": "YulIdentifier", + "src": "11487:32:70" + }, + "nativeSrc": "11487:62:70", + "nodeType": "YulFunctionCall", + "src": "11487:62:70" + }, + "variableNames": [ + { + "name": "value1", + "nativeSrc": "11477:6:70", + "nodeType": "YulIdentifier", + "src": "11477:6:70" + } + ] + } + ] + }, + "name": "abi_decode_tuple_t_struct$_State_$16058_calldata_ptrt_struct$_State_$16058_calldata_ptr", + "nativeSrc": "11195:360:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "11292:9:70", + "nodeType": "YulTypedName", + "src": "11292:9:70", + "type": "" + }, + { + "name": "dataEnd", + "nativeSrc": "11303:7:70", + "nodeType": "YulTypedName", + "src": "11303:7:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value0", + "nativeSrc": "11315:6:70", + "nodeType": "YulTypedName", + "src": "11315:6:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "11323:6:70", + "nodeType": "YulTypedName", + "src": "11323:6:70", + "type": "" + } + ], + "src": "11195:360:70" + }, + { + "body": { + "nativeSrc": "11629:176:70", + "nodeType": "YulBlock", + "src": "11629:176:70", + "statements": [ + { + "body": { + "nativeSrc": "11675:16:70", + "nodeType": "YulBlock", + "src": "11675:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "11684:1:70", + "nodeType": "YulLiteral", + "src": "11684:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "11687:1:70", + "nodeType": "YulLiteral", + "src": "11687:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "11677:6:70", + "nodeType": "YulIdentifier", + "src": "11677:6:70" + }, + "nativeSrc": "11677:12:70", + "nodeType": "YulFunctionCall", + "src": "11677:12:70" + }, + "nativeSrc": "11677:12:70", + "nodeType": "YulExpressionStatement", + "src": "11677:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "dataEnd", + "nativeSrc": "11650:7:70", + "nodeType": "YulIdentifier", + "src": "11650:7:70" + }, + { + "name": "headStart", + "nativeSrc": "11659:9:70", + "nodeType": "YulIdentifier", + "src": "11659:9:70" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "11646:3:70", + "nodeType": "YulIdentifier", + "src": "11646:3:70" + }, + "nativeSrc": "11646:23:70", + "nodeType": "YulFunctionCall", + "src": "11646:23:70" + }, + { + "kind": "number", + "nativeSrc": "11671:2:70", + "nodeType": "YulLiteral", + "src": "11671:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "slt", + "nativeSrc": "11642:3:70", + "nodeType": "YulIdentifier", + "src": "11642:3:70" + }, + "nativeSrc": "11642:32:70", + "nodeType": "YulFunctionCall", + "src": "11642:32:70" + }, + "nativeSrc": "11639:52:70", + "nodeType": "YulIf", + "src": "11639:52:70" + }, + { + "nativeSrc": "11700:36:70", + "nodeType": "YulVariableDeclaration", + "src": "11700:36:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "11726:9:70", + "nodeType": "YulIdentifier", + "src": "11726:9:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "11713:12:70", + "nodeType": "YulIdentifier", + "src": "11713:12:70" + }, + "nativeSrc": "11713:23:70", + "nodeType": "YulFunctionCall", + "src": "11713:23:70" + }, + "variables": [ + { + "name": "value", + "nativeSrc": "11704:5:70", + "nodeType": "YulTypedName", + "src": "11704:5:70", + "type": "" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "value", + "nativeSrc": "11769:5:70", + "nodeType": "YulIdentifier", + "src": "11769:5:70" + } + ], + "functionName": { + "name": "validator_revert_uint64", + "nativeSrc": "11745:23:70", + "nodeType": "YulIdentifier", + "src": "11745:23:70" + }, + "nativeSrc": "11745:30:70", + "nodeType": "YulFunctionCall", + "src": "11745:30:70" + }, + "nativeSrc": "11745:30:70", + "nodeType": "YulExpressionStatement", + "src": "11745:30:70" + }, + { + "nativeSrc": "11784:15:70", + "nodeType": "YulAssignment", + "src": "11784:15:70", + "value": { + "name": "value", + "nativeSrc": "11794:5:70", + "nodeType": "YulIdentifier", + "src": "11794:5:70" + }, + "variableNames": [ + { + "name": "value0", + "nativeSrc": "11784:6:70", + "nodeType": "YulIdentifier", + "src": "11784:6:70" + } + ] + } + ] + }, + "name": "abi_decode_tuple_t_uint64", + "nativeSrc": "11560:245:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "11595:9:70", + "nodeType": "YulTypedName", + "src": "11595:9:70", + "type": "" + }, + { + "name": "dataEnd", + "nativeSrc": "11606:7:70", + "nodeType": "YulTypedName", + "src": "11606:7:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value0", + "nativeSrc": "11618:6:70", + "nodeType": "YulTypedName", + "src": "11618:6:70", + "type": "" + } + ], + "src": "11560:245:70" + }, + { + "body": { + "nativeSrc": "11928:99:70", + "nodeType": "YulBlock", + "src": "11928:99:70", + "statements": [ + { + "nativeSrc": "11938:26:70", + "nodeType": "YulAssignment", + "src": "11938:26:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "11950:9:70", + "nodeType": "YulIdentifier", + "src": "11950:9:70" + }, + { + "kind": "number", + "nativeSrc": "11961:2:70", + "nodeType": "YulLiteral", + "src": "11961:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "11946:3:70", + "nodeType": "YulIdentifier", + "src": "11946:3:70" + }, + "nativeSrc": "11946:18:70", + "nodeType": "YulFunctionCall", + "src": "11946:18:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "11938:4:70", + "nodeType": "YulIdentifier", + "src": "11938:4:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "value0", + "nativeSrc": "12003:6:70", + "nodeType": "YulIdentifier", + "src": "12003:6:70" + }, + { + "name": "headStart", + "nativeSrc": "12011:9:70", + "nodeType": "YulIdentifier", + "src": "12011:9:70" + } + ], + "functionName": { + "name": "abi_encode_enum_DisputeStatus", + "nativeSrc": "11973:29:70", + "nodeType": "YulIdentifier", + "src": "11973:29:70" + }, + "nativeSrc": "11973:48:70", + "nodeType": "YulFunctionCall", + "src": "11973:48:70" + }, + "nativeSrc": "11973:48:70", + "nodeType": "YulExpressionStatement", + "src": "11973:48:70" + } + ] + }, + "name": "abi_encode_tuple_t_enum$_DisputeStatus_$14921__to_t_uint8__fromStack_reversed", + "nativeSrc": "11810:217:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "11897:9:70", + "nodeType": "YulTypedName", + "src": "11897:9:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "11908:6:70", + "nodeType": "YulTypedName", + "src": "11908:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "11919:4:70", + "nodeType": "YulTypedName", + "src": "11919:4:70", + "type": "" + } + ], + "src": "11810:217:70" + }, + { + "body": { + "nativeSrc": "12140:101:70", + "nodeType": "YulBlock", + "src": "12140:101:70", + "statements": [ + { + "nativeSrc": "12150:26:70", + "nodeType": "YulAssignment", + "src": "12150:26:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "12162:9:70", + "nodeType": "YulIdentifier", + "src": "12162:9:70" + }, + { + "kind": "number", + "nativeSrc": "12173:2:70", + "nodeType": "YulLiteral", + "src": "12173:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "12158:3:70", + "nodeType": "YulIdentifier", + "src": "12158:3:70" + }, + "nativeSrc": "12158:18:70", + "nodeType": "YulFunctionCall", + "src": "12158:18:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "12150:4:70", + "nodeType": "YulIdentifier", + "src": "12150:4:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "12192:9:70", + "nodeType": "YulIdentifier", + "src": "12192:9:70" + }, + { + "arguments": [ + { + "name": "value0", + "nativeSrc": "12207:6:70", + "nodeType": "YulIdentifier", + "src": "12207:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "12223:2:70", + "nodeType": "YulLiteral", + "src": "12223:2:70", + "type": "", + "value": "64" + }, + { + "kind": "number", + "nativeSrc": "12227:1:70", + "nodeType": "YulLiteral", + "src": "12227:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "12219:3:70", + "nodeType": "YulIdentifier", + "src": "12219:3:70" + }, + "nativeSrc": "12219:10:70", + "nodeType": "YulFunctionCall", + "src": "12219:10:70" + }, + { + "kind": "number", + "nativeSrc": "12231:1:70", + "nodeType": "YulLiteral", + "src": "12231:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "12215:3:70", + "nodeType": "YulIdentifier", + "src": "12215:3:70" + }, + "nativeSrc": "12215:18:70", + "nodeType": "YulFunctionCall", + "src": "12215:18:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "12203:3:70", + "nodeType": "YulIdentifier", + "src": "12203:3:70" + }, + "nativeSrc": "12203:31:70", + "nodeType": "YulFunctionCall", + "src": "12203:31:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "12185:6:70", + "nodeType": "YulIdentifier", + "src": "12185:6:70" + }, + "nativeSrc": "12185:50:70", + "nodeType": "YulFunctionCall", + "src": "12185:50:70" + }, + "nativeSrc": "12185:50:70", + "nodeType": "YulExpressionStatement", + "src": "12185:50:70" + } + ] + }, + "name": "abi_encode_tuple_t_rational_1_by_1__to_t_uint64__fromStack_reversed", + "nativeSrc": "12032:209:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "12109:9:70", + "nodeType": "YulTypedName", + "src": "12109:9:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "12120:6:70", + "nodeType": "YulTypedName", + "src": "12120:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "12131:4:70", + "nodeType": "YulTypedName", + "src": "12131:4:70", + "type": "" + } + ], + "src": "12032:209:70" + }, + { + "body": { + "nativeSrc": "12342:785:70", + "nodeType": "YulBlock", + "src": "12342:785:70", + "statements": [ + { + "nativeSrc": "12352:42:70", + "nodeType": "YulVariableDeclaration", + "src": "12352:42:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "dataEnd", + "nativeSrc": "12370:7:70", + "nodeType": "YulIdentifier", + "src": "12370:7:70" + }, + { + "name": "headStart", + "nativeSrc": "12379:9:70", + "nodeType": "YulIdentifier", + "src": "12379:9:70" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "12366:3:70", + "nodeType": "YulIdentifier", + "src": "12366:3:70" + }, + "nativeSrc": "12366:23:70", + "nodeType": "YulFunctionCall", + "src": "12366:23:70" + }, + { + "kind": "number", + "nativeSrc": "12391:2:70", + "nodeType": "YulLiteral", + "src": "12391:2:70", + "type": "", + "value": "96" + } + ], + "functionName": { + "name": "slt", + "nativeSrc": "12362:3:70", + "nodeType": "YulIdentifier", + "src": "12362:3:70" + }, + "nativeSrc": "12362:32:70", + "nodeType": "YulFunctionCall", + "src": "12362:32:70" + }, + "variables": [ + { + "name": "_1", + "nativeSrc": "12356:2:70", + "nodeType": "YulTypedName", + "src": "12356:2:70", + "type": "" + } + ] + }, + { + "body": { + "nativeSrc": "12409:16:70", + "nodeType": "YulBlock", + "src": "12409:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "12418:1:70", + "nodeType": "YulLiteral", + "src": "12418:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "12421:1:70", + "nodeType": "YulLiteral", + "src": "12421:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "12411:6:70", + "nodeType": "YulIdentifier", + "src": "12411:6:70" + }, + "nativeSrc": "12411:12:70", + "nodeType": "YulFunctionCall", + "src": "12411:12:70" + }, + "nativeSrc": "12411:12:70", + "nodeType": "YulExpressionStatement", + "src": "12411:12:70" + } + ] + }, + "condition": { + "name": "_1", + "nativeSrc": "12406:2:70", + "nodeType": "YulIdentifier", + "src": "12406:2:70" + }, + "nativeSrc": "12403:22:70", + "nodeType": "YulIf", + "src": "12403:22:70" + }, + { + "nativeSrc": "12434:7:70", + "nodeType": "YulAssignment", + "src": "12434:7:70", + "value": { + "kind": "number", + "nativeSrc": "12440:1:70", + "nodeType": "YulLiteral", + "src": "12440:1:70", + "type": "", + "value": "0" + }, + "variableNames": [ + { + "name": "_1", + "nativeSrc": "12434:2:70", + "nodeType": "YulIdentifier", + "src": "12434:2:70" + } + ] + }, + { + "nativeSrc": "12450:16:70", + "nodeType": "YulVariableDeclaration", + "src": "12450:16:70", + "value": { + "name": "_1", + "nativeSrc": "12464:2:70", + "nodeType": "YulIdentifier", + "src": "12464:2:70" + }, + "variables": [ + { + "name": "memPtr", + "nativeSrc": "12454:6:70", + "nodeType": "YulTypedName", + "src": "12454:6:70", + "type": "" + } + ] + }, + { + "nativeSrc": "12475:19:70", + "nodeType": "YulAssignment", + "src": "12475:19:70", + "value": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "12491:2:70", + "nodeType": "YulLiteral", + "src": "12491:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "12485:5:70", + "nodeType": "YulIdentifier", + "src": "12485:5:70" + }, + "nativeSrc": "12485:9:70", + "nodeType": "YulFunctionCall", + "src": "12485:9:70" + }, + "variableNames": [ + { + "name": "memPtr", + "nativeSrc": "12475:6:70", + "nodeType": "YulIdentifier", + "src": "12475:6:70" + } + ] + }, + { + "nativeSrc": "12503:33:70", + "nodeType": "YulVariableDeclaration", + "src": "12503:33:70", + "value": { + "arguments": [ + { + "name": "memPtr", + "nativeSrc": "12525:6:70", + "nodeType": "YulIdentifier", + "src": "12525:6:70" + }, + { + "kind": "number", + "nativeSrc": "12533:2:70", + "nodeType": "YulLiteral", + "src": "12533:2:70", + "type": "", + "value": "96" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "12521:3:70", + "nodeType": "YulIdentifier", + "src": "12521:3:70" + }, + "nativeSrc": "12521:15:70", + "nodeType": "YulFunctionCall", + "src": "12521:15:70" + }, + "variables": [ + { + "name": "newFreePtr", + "nativeSrc": "12507:10:70", + "nodeType": "YulTypedName", + "src": "12507:10:70", + "type": "" + } + ] + }, + { + "body": { + "nativeSrc": "12619:113:70", + "nodeType": "YulBlock", + "src": "12619:113:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "name": "_1", + "nativeSrc": "12640:2:70", + "nodeType": "YulIdentifier", + "src": "12640:2:70" + }, + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "12648:3:70", + "nodeType": "YulLiteral", + "src": "12648:3:70", + "type": "", + "value": "224" + }, + { + "kind": "number", + "nativeSrc": "12653:10:70", + "nodeType": "YulLiteral", + "src": "12653:10:70", + "type": "", + "value": "0x4e487b71" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "12644:3:70", + "nodeType": "YulIdentifier", + "src": "12644:3:70" + }, + "nativeSrc": "12644:20:70", + "nodeType": "YulFunctionCall", + "src": "12644:20:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "12633:6:70", + "nodeType": "YulIdentifier", + "src": "12633:6:70" + }, + "nativeSrc": "12633:32:70", + "nodeType": "YulFunctionCall", + "src": "12633:32:70" + }, + "nativeSrc": "12633:32:70", + "nodeType": "YulExpressionStatement", + "src": "12633:32:70" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "12685:1:70", + "nodeType": "YulLiteral", + "src": "12685:1:70", + "type": "", + "value": "4" + }, + { + "kind": "number", + "nativeSrc": "12688:4:70", + "nodeType": "YulLiteral", + "src": "12688:4:70", + "type": "", + "value": "0x41" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "12678:6:70", + "nodeType": "YulIdentifier", + "src": "12678:6:70" + }, + "nativeSrc": "12678:15:70", + "nodeType": "YulFunctionCall", + "src": "12678:15:70" + }, + "nativeSrc": "12678:15:70", + "nodeType": "YulExpressionStatement", + "src": "12678:15:70" + }, + { + "expression": { + "arguments": [ + { + "name": "_1", + "nativeSrc": "12713:2:70", + "nodeType": "YulIdentifier", + "src": "12713:2:70" + }, + { + "kind": "number", + "nativeSrc": "12717:4:70", + "nodeType": "YulLiteral", + "src": "12717:4:70", + "type": "", + "value": "0x24" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "12706:6:70", + "nodeType": "YulIdentifier", + "src": "12706:6:70" + }, + "nativeSrc": "12706:16:70", + "nodeType": "YulFunctionCall", + "src": "12706:16:70" + }, + "nativeSrc": "12706:16:70", + "nodeType": "YulExpressionStatement", + "src": "12706:16:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "newFreePtr", + "nativeSrc": "12554:10:70", + "nodeType": "YulIdentifier", + "src": "12554:10:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "12574:2:70", + "nodeType": "YulLiteral", + "src": "12574:2:70", + "type": "", + "value": "64" + }, + { + "kind": "number", + "nativeSrc": "12578:1:70", + "nodeType": "YulLiteral", + "src": "12578:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "12570:3:70", + "nodeType": "YulIdentifier", + "src": "12570:3:70" + }, + "nativeSrc": "12570:10:70", + "nodeType": "YulFunctionCall", + "src": "12570:10:70" + }, + { + "kind": "number", + "nativeSrc": "12582:1:70", + "nodeType": "YulLiteral", + "src": "12582:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "12566:3:70", + "nodeType": "YulIdentifier", + "src": "12566:3:70" + }, + "nativeSrc": "12566:18:70", + "nodeType": "YulFunctionCall", + "src": "12566:18:70" + } + ], + "functionName": { + "name": "gt", + "nativeSrc": "12551:2:70", + "nodeType": "YulIdentifier", + "src": "12551:2:70" + }, + "nativeSrc": "12551:34:70", + "nodeType": "YulFunctionCall", + "src": "12551:34:70" + }, + { + "arguments": [ + { + "name": "newFreePtr", + "nativeSrc": "12590:10:70", + "nodeType": "YulIdentifier", + "src": "12590:10:70" + }, + { + "name": "memPtr", + "nativeSrc": "12602:6:70", + "nodeType": "YulIdentifier", + "src": "12602:6:70" + } + ], + "functionName": { + "name": "lt", + "nativeSrc": "12587:2:70", + "nodeType": "YulIdentifier", + "src": "12587:2:70" + }, + "nativeSrc": "12587:22:70", + "nodeType": "YulFunctionCall", + "src": "12587:22:70" + } + ], + "functionName": { + "name": "or", + "nativeSrc": "12548:2:70", + "nodeType": "YulIdentifier", + "src": "12548:2:70" + }, + "nativeSrc": "12548:62:70", + "nodeType": "YulFunctionCall", + "src": "12548:62:70" + }, + "nativeSrc": "12545:187:70", + "nodeType": "YulIf", + "src": "12545:187:70" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "12748:2:70", + "nodeType": "YulLiteral", + "src": "12748:2:70", + "type": "", + "value": "64" + }, + { + "name": "newFreePtr", + "nativeSrc": "12752:10:70", + "nodeType": "YulIdentifier", + "src": "12752:10:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "12741:6:70", + "nodeType": "YulIdentifier", + "src": "12741:6:70" + }, + "nativeSrc": "12741:22:70", + "nodeType": "YulFunctionCall", + "src": "12741:22:70" + }, + "nativeSrc": "12741:22:70", + "nodeType": "YulExpressionStatement", + "src": "12741:22:70" + }, + { + "nativeSrc": "12772:15:70", + "nodeType": "YulVariableDeclaration", + "src": "12772:15:70", + "value": { + "name": "_1", + "nativeSrc": "12785:2:70", + "nodeType": "YulIdentifier", + "src": "12785:2:70" + }, + "variables": [ + { + "name": "value", + "nativeSrc": "12776:5:70", + "nodeType": "YulTypedName", + "src": "12776:5:70", + "type": "" + } + ] + }, + { + "nativeSrc": "12796:32:70", + "nodeType": "YulAssignment", + "src": "12796:32:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "12818:9:70", + "nodeType": "YulIdentifier", + "src": "12818:9:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "12805:12:70", + "nodeType": "YulIdentifier", + "src": "12805:12:70" + }, + "nativeSrc": "12805:23:70", + "nodeType": "YulFunctionCall", + "src": "12805:23:70" + }, + "variableNames": [ + { + "name": "value", + "nativeSrc": "12796:5:70", + "nodeType": "YulIdentifier", + "src": "12796:5:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "memPtr", + "nativeSrc": "12844:6:70", + "nodeType": "YulIdentifier", + "src": "12844:6:70" + }, + { + "name": "value", + "nativeSrc": "12852:5:70", + "nodeType": "YulIdentifier", + "src": "12852:5:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "12837:6:70", + "nodeType": "YulIdentifier", + "src": "12837:6:70" + }, + "nativeSrc": "12837:21:70", + "nodeType": "YulFunctionCall", + "src": "12837:21:70" + }, + "nativeSrc": "12837:21:70", + "nodeType": "YulExpressionStatement", + "src": "12837:21:70" + }, + { + "nativeSrc": "12867:17:70", + "nodeType": "YulVariableDeclaration", + "src": "12867:17:70", + "value": { + "name": "_1", + "nativeSrc": "12882:2:70", + "nodeType": "YulIdentifier", + "src": "12882:2:70" + }, + "variables": [ + { + "name": "value_1", + "nativeSrc": "12871:7:70", + "nodeType": "YulTypedName", + "src": "12871:7:70", + "type": "" + } + ] + }, + { + "nativeSrc": "12893:43:70", + "nodeType": "YulAssignment", + "src": "12893:43:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "12921:9:70", + "nodeType": "YulIdentifier", + "src": "12921:9:70" + }, + { + "kind": "number", + "nativeSrc": "12932:2:70", + "nodeType": "YulLiteral", + "src": "12932:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "12917:3:70", + "nodeType": "YulIdentifier", + "src": "12917:3:70" + }, + "nativeSrc": "12917:18:70", + "nodeType": "YulFunctionCall", + "src": "12917:18:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "12904:12:70", + "nodeType": "YulIdentifier", + "src": "12904:12:70" + }, + "nativeSrc": "12904:32:70", + "nodeType": "YulFunctionCall", + "src": "12904:32:70" + }, + "variableNames": [ + { + "name": "value_1", + "nativeSrc": "12893:7:70", + "nodeType": "YulIdentifier", + "src": "12893:7:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "memPtr", + "nativeSrc": "12956:6:70", + "nodeType": "YulIdentifier", + "src": "12956:6:70" + }, + { + "kind": "number", + "nativeSrc": "12964:2:70", + "nodeType": "YulLiteral", + "src": "12964:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "12952:3:70", + "nodeType": "YulIdentifier", + "src": "12952:3:70" + }, + "nativeSrc": "12952:15:70", + "nodeType": "YulFunctionCall", + "src": "12952:15:70" + }, + { + "name": "value_1", + "nativeSrc": "12969:7:70", + "nodeType": "YulIdentifier", + "src": "12969:7:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "12945:6:70", + "nodeType": "YulIdentifier", + "src": "12945:6:70" + }, + "nativeSrc": "12945:32:70", + "nodeType": "YulFunctionCall", + "src": "12945:32:70" + }, + "nativeSrc": "12945:32:70", + "nodeType": "YulExpressionStatement", + "src": "12945:32:70" + }, + { + "nativeSrc": "12986:17:70", + "nodeType": "YulVariableDeclaration", + "src": "12986:17:70", + "value": { + "name": "_1", + "nativeSrc": "13001:2:70", + "nodeType": "YulIdentifier", + "src": "13001:2:70" + }, + "variables": [ + { + "name": "value_2", + "nativeSrc": "12990:7:70", + "nodeType": "YulTypedName", + "src": "12990:7:70", + "type": "" + } + ] + }, + { + "nativeSrc": "13012:43:70", + "nodeType": "YulAssignment", + "src": "13012:43:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "13040:9:70", + "nodeType": "YulIdentifier", + "src": "13040:9:70" + }, + { + "kind": "number", + "nativeSrc": "13051:2:70", + "nodeType": "YulLiteral", + "src": "13051:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "13036:3:70", + "nodeType": "YulIdentifier", + "src": "13036:3:70" + }, + "nativeSrc": "13036:18:70", + "nodeType": "YulFunctionCall", + "src": "13036:18:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "13023:12:70", + "nodeType": "YulIdentifier", + "src": "13023:12:70" + }, + "nativeSrc": "13023:32:70", + "nodeType": "YulFunctionCall", + "src": "13023:32:70" + }, + "variableNames": [ + { + "name": "value_2", + "nativeSrc": "13012:7:70", + "nodeType": "YulIdentifier", + "src": "13012:7:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "memPtr", + "nativeSrc": "13075:6:70", + "nodeType": "YulIdentifier", + "src": "13075:6:70" + }, + { + "kind": "number", + "nativeSrc": "13083:2:70", + "nodeType": "YulLiteral", + "src": "13083:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "13071:3:70", + "nodeType": "YulIdentifier", + "src": "13071:3:70" + }, + "nativeSrc": "13071:15:70", + "nodeType": "YulFunctionCall", + "src": "13071:15:70" + }, + { + "name": "value_2", + "nativeSrc": "13088:7:70", + "nodeType": "YulIdentifier", + "src": "13088:7:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "13064:6:70", + "nodeType": "YulIdentifier", + "src": "13064:6:70" + }, + "nativeSrc": "13064:32:70", + "nodeType": "YulFunctionCall", + "src": "13064:32:70" + }, + "nativeSrc": "13064:32:70", + "nodeType": "YulExpressionStatement", + "src": "13064:32:70" + }, + { + "nativeSrc": "13105:16:70", + "nodeType": "YulAssignment", + "src": "13105:16:70", + "value": { + "name": "memPtr", + "nativeSrc": "13115:6:70", + "nodeType": "YulIdentifier", + "src": "13115:6:70" + }, + "variableNames": [ + { + "name": "value0", + "nativeSrc": "13105:6:70", + "nodeType": "YulIdentifier", + "src": "13105:6:70" + } + ] + } + ] + }, + "name": "abi_decode_tuple_t_struct$_Receipt_$16044_memory_ptr", + "nativeSrc": "12246:881:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "12308:9:70", + "nodeType": "YulTypedName", + "src": "12308:9:70", + "type": "" + }, + { + "name": "dataEnd", + "nativeSrc": "12319:7:70", + "nodeType": "YulTypedName", + "src": "12319:7:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value0", + "nativeSrc": "12331:6:70", + "nodeType": "YulTypedName", + "src": "12331:6:70", + "type": "" + } + ], + "src": "12246:881:70" + }, + { + "body": { + "nativeSrc": "13352:141:70", + "nodeType": "YulBlock", + "src": "13352:141:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "name": "pos", + "nativeSrc": "13369:3:70", + "nodeType": "YulIdentifier", + "src": "13369:3:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "13382:2:70", + "nodeType": "YulLiteral", + "src": "13382:2:70", + "type": "", + "value": "96" + }, + { + "name": "value0", + "nativeSrc": "13386:6:70", + "nodeType": "YulIdentifier", + "src": "13386:6:70" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "13378:3:70", + "nodeType": "YulIdentifier", + "src": "13378:3:70" + }, + "nativeSrc": "13378:15:70", + "nodeType": "YulFunctionCall", + "src": "13378:15:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "13407:2:70", + "nodeType": "YulLiteral", + "src": "13407:2:70", + "type": "", + "value": "96" + }, + { + "kind": "number", + "nativeSrc": "13411:1:70", + "nodeType": "YulLiteral", + "src": "13411:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "13403:3:70", + "nodeType": "YulIdentifier", + "src": "13403:3:70" + }, + "nativeSrc": "13403:10:70", + "nodeType": "YulFunctionCall", + "src": "13403:10:70" + }, + { + "kind": "number", + "nativeSrc": "13415:1:70", + "nodeType": "YulLiteral", + "src": "13415:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "13399:3:70", + "nodeType": "YulIdentifier", + "src": "13399:3:70" + }, + "nativeSrc": "13399:18:70", + "nodeType": "YulFunctionCall", + "src": "13399:18:70" + } + ], + "functionName": { + "name": "not", + "nativeSrc": "13395:3:70", + "nodeType": "YulIdentifier", + "src": "13395:3:70" + }, + "nativeSrc": "13395:23:70", + "nodeType": "YulFunctionCall", + "src": "13395:23:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "13374:3:70", + "nodeType": "YulIdentifier", + "src": "13374:3:70" + }, + "nativeSrc": "13374:45:70", + "nodeType": "YulFunctionCall", + "src": "13374:45:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "13362:6:70", + "nodeType": "YulIdentifier", + "src": "13362:6:70" + }, + "nativeSrc": "13362:58:70", + "nodeType": "YulFunctionCall", + "src": "13362:58:70" + }, + "nativeSrc": "13362:58:70", + "nodeType": "YulExpressionStatement", + "src": "13362:58:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "pos", + "nativeSrc": "13440:3:70", + "nodeType": "YulIdentifier", + "src": "13440:3:70" + }, + { + "kind": "number", + "nativeSrc": "13445:2:70", + "nodeType": "YulLiteral", + "src": "13445:2:70", + "type": "", + "value": "20" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "13436:3:70", + "nodeType": "YulIdentifier", + "src": "13436:3:70" + }, + "nativeSrc": "13436:12:70", + "nodeType": "YulFunctionCall", + "src": "13436:12:70" + }, + { + "hexValue": "6c6567616379", + "kind": "string", + "nativeSrc": "13450:8:70", + "nodeType": "YulLiteral", + "src": "13450:8:70", + "type": "", + "value": "legacy" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "13429:6:70", + "nodeType": "YulIdentifier", + "src": "13429:6:70" + }, + "nativeSrc": "13429:30:70", + "nodeType": "YulFunctionCall", + "src": "13429:30:70" + }, + "nativeSrc": "13429:30:70", + "nodeType": "YulExpressionStatement", + "src": "13429:30:70" + }, + { + "nativeSrc": "13468:19:70", + "nodeType": "YulAssignment", + "src": "13468:19:70", + "value": { + "arguments": [ + { + "name": "pos", + "nativeSrc": "13479:3:70", + "nodeType": "YulIdentifier", + "src": "13479:3:70" + }, + { + "kind": "number", + "nativeSrc": "13484:2:70", + "nodeType": "YulLiteral", + "src": "13484:2:70", + "type": "", + "value": "26" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "13475:3:70", + "nodeType": "YulIdentifier", + "src": "13475:3:70" + }, + "nativeSrc": "13475:12:70", + "nodeType": "YulFunctionCall", + "src": "13475:12:70" + }, + "variableNames": [ + { + "name": "end", + "nativeSrc": "13468:3:70", + "nodeType": "YulIdentifier", + "src": "13468:3:70" + } + ] + } + ] + }, + "name": "abi_encode_tuple_packed_t_address_t_stringliteral_b7ccb6878fbded310d2d05350bca9c84568ecb568d4b626c83e0508c3193ce89__to_t_address_t_string_memory_ptr__nonPadded_inplace_fromStack_reversed", + "nativeSrc": "13132:361:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "pos", + "nativeSrc": "13328:3:70", + "nodeType": "YulTypedName", + "src": "13328:3:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "13333:6:70", + "nodeType": "YulTypedName", + "src": "13333:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "end", + "nativeSrc": "13344:3:70", + "nodeType": "YulTypedName", + "src": "13344:3:70", + "type": "" + } + ], + "src": "13132:361:70" + }, + { + "body": { + "nativeSrc": "13558:78:70", + "nodeType": "YulBlock", + "src": "13558:78:70", + "statements": [ + { + "nativeSrc": "13568:22:70", + "nodeType": "YulAssignment", + "src": "13568:22:70", + "value": { + "arguments": [ + { + "name": "offset", + "nativeSrc": "13583:6:70", + "nodeType": "YulIdentifier", + "src": "13583:6:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "13577:5:70", + "nodeType": "YulIdentifier", + "src": "13577:5:70" + }, + "nativeSrc": "13577:13:70", + "nodeType": "YulFunctionCall", + "src": "13577:13:70" + }, + "variableNames": [ + { + "name": "value", + "nativeSrc": "13568:5:70", + "nodeType": "YulIdentifier", + "src": "13568:5:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "value", + "nativeSrc": "13624:5:70", + "nodeType": "YulIdentifier", + "src": "13624:5:70" + } + ], + "functionName": { + "name": "validator_revert_address", + "nativeSrc": "13599:24:70", + "nodeType": "YulIdentifier", + "src": "13599:24:70" + }, + "nativeSrc": "13599:31:70", + "nodeType": "YulFunctionCall", + "src": "13599:31:70" + }, + "nativeSrc": "13599:31:70", + "nodeType": "YulExpressionStatement", + "src": "13599:31:70" + } + ] + }, + "name": "abi_decode_address_fromMemory", + "nativeSrc": "13498:138:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "offset", + "nativeSrc": "13537:6:70", + "nodeType": "YulTypedName", + "src": "13537:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value", + "nativeSrc": "13548:5:70", + "nodeType": "YulTypedName", + "src": "13548:5:70", + "type": "" + } + ], + "src": "13498:138:70" + }, + { + "body": { + "nativeSrc": "13719:1062:70", + "nodeType": "YulBlock", + "src": "13719:1062:70", + "statements": [ + { + "body": { + "nativeSrc": "13765:16:70", + "nodeType": "YulBlock", + "src": "13765:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "13774:1:70", + "nodeType": "YulLiteral", + "src": "13774:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "13777:1:70", + "nodeType": "YulLiteral", + "src": "13777:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "13767:6:70", + "nodeType": "YulIdentifier", + "src": "13767:6:70" + }, + "nativeSrc": "13767:12:70", + "nodeType": "YulFunctionCall", + "src": "13767:12:70" + }, + "nativeSrc": "13767:12:70", + "nodeType": "YulExpressionStatement", + "src": "13767:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "end", + "nativeSrc": "13740:3:70", + "nodeType": "YulIdentifier", + "src": "13740:3:70" + }, + { + "name": "headStart", + "nativeSrc": "13745:9:70", + "nodeType": "YulIdentifier", + "src": "13745:9:70" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "13736:3:70", + "nodeType": "YulIdentifier", + "src": "13736:3:70" + }, + "nativeSrc": "13736:19:70", + "nodeType": "YulFunctionCall", + "src": "13736:19:70" + }, + { + "kind": "number", + "nativeSrc": "13757:6:70", + "nodeType": "YulLiteral", + "src": "13757:6:70", + "type": "", + "value": "0x0120" + } + ], + "functionName": { + "name": "slt", + "nativeSrc": "13732:3:70", + "nodeType": "YulIdentifier", + "src": "13732:3:70" + }, + "nativeSrc": "13732:32:70", + "nodeType": "YulFunctionCall", + "src": "13732:32:70" + }, + "nativeSrc": "13729:52:70", + "nodeType": "YulIf", + "src": "13729:52:70" + }, + { + "nativeSrc": "13790:31:70", + "nodeType": "YulAssignment", + "src": "13790:31:70", + "value": { + "arguments": [], + "functionName": { + "name": "allocate_memory_2390", + "nativeSrc": "13799:20:70", + "nodeType": "YulIdentifier", + "src": "13799:20:70" + }, + "nativeSrc": "13799:22:70", + "nodeType": "YulFunctionCall", + "src": "13799:22:70" + }, + "variableNames": [ + { + "name": "value", + "nativeSrc": "13790:5:70", + "nodeType": "YulIdentifier", + "src": "13790:5:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "value", + "nativeSrc": "13837:5:70", + "nodeType": "YulIdentifier", + "src": "13837:5:70" + }, + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "13874:9:70", + "nodeType": "YulIdentifier", + "src": "13874:9:70" + } + ], + "functionName": { + "name": "abi_decode_address_fromMemory", + "nativeSrc": "13844:29:70", + "nodeType": "YulIdentifier", + "src": "13844:29:70" + }, + "nativeSrc": "13844:40:70", + "nodeType": "YulFunctionCall", + "src": "13844:40:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "13830:6:70", + "nodeType": "YulIdentifier", + "src": "13830:6:70" + }, + "nativeSrc": "13830:55:70", + "nodeType": "YulFunctionCall", + "src": "13830:55:70" + }, + "nativeSrc": "13830:55:70", + "nodeType": "YulExpressionStatement", + "src": "13830:55:70" + }, + { + "nativeSrc": "13894:16:70", + "nodeType": "YulVariableDeclaration", + "src": "13894:16:70", + "value": { + "kind": "number", + "nativeSrc": "13909:1:70", + "nodeType": "YulLiteral", + "src": "13909:1:70", + "type": "", + "value": "0" + }, + "variables": [ + { + "name": "value_1", + "nativeSrc": "13898:7:70", + "nodeType": "YulTypedName", + "src": "13898:7:70", + "type": "" + } + ] + }, + { + "nativeSrc": "13919:36:70", + "nodeType": "YulAssignment", + "src": "13919:36:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "13940:9:70", + "nodeType": "YulIdentifier", + "src": "13940:9:70" + }, + { + "kind": "number", + "nativeSrc": "13951:2:70", + "nodeType": "YulLiteral", + "src": "13951:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "13936:3:70", + "nodeType": "YulIdentifier", + "src": "13936:3:70" + }, + "nativeSrc": "13936:18:70", + "nodeType": "YulFunctionCall", + "src": "13936:18:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "13930:5:70", + "nodeType": "YulIdentifier", + "src": "13930:5:70" + }, + "nativeSrc": "13930:25:70", + "nodeType": "YulFunctionCall", + "src": "13930:25:70" + }, + "variableNames": [ + { + "name": "value_1", + "nativeSrc": "13919:7:70", + "nodeType": "YulIdentifier", + "src": "13919:7:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "value", + "nativeSrc": "13975:5:70", + "nodeType": "YulIdentifier", + "src": "13975:5:70" + }, + { + "kind": "number", + "nativeSrc": "13982:2:70", + "nodeType": "YulLiteral", + "src": "13982:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "13971:3:70", + "nodeType": "YulIdentifier", + "src": "13971:3:70" + }, + "nativeSrc": "13971:14:70", + "nodeType": "YulFunctionCall", + "src": "13971:14:70" + }, + { + "name": "value_1", + "nativeSrc": "13987:7:70", + "nodeType": "YulIdentifier", + "src": "13987:7:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "13964:6:70", + "nodeType": "YulIdentifier", + "src": "13964:6:70" + }, + "nativeSrc": "13964:31:70", + "nodeType": "YulFunctionCall", + "src": "13964:31:70" + }, + "nativeSrc": "13964:31:70", + "nodeType": "YulExpressionStatement", + "src": "13964:31:70" + }, + { + "nativeSrc": "14004:16:70", + "nodeType": "YulVariableDeclaration", + "src": "14004:16:70", + "value": { + "kind": "number", + "nativeSrc": "14019:1:70", + "nodeType": "YulLiteral", + "src": "14019:1:70", + "type": "", + "value": "0" + }, + "variables": [ + { + "name": "value_2", + "nativeSrc": "14008:7:70", + "nodeType": "YulTypedName", + "src": "14008:7:70", + "type": "" + } + ] + }, + { + "nativeSrc": "14029:36:70", + "nodeType": "YulAssignment", + "src": "14029:36:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "14050:9:70", + "nodeType": "YulIdentifier", + "src": "14050:9:70" + }, + { + "kind": "number", + "nativeSrc": "14061:2:70", + "nodeType": "YulLiteral", + "src": "14061:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "14046:3:70", + "nodeType": "YulIdentifier", + "src": "14046:3:70" + }, + "nativeSrc": "14046:18:70", + "nodeType": "YulFunctionCall", + "src": "14046:18:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "14040:5:70", + "nodeType": "YulIdentifier", + "src": "14040:5:70" + }, + "nativeSrc": "14040:25:70", + "nodeType": "YulFunctionCall", + "src": "14040:25:70" + }, + "variableNames": [ + { + "name": "value_2", + "nativeSrc": "14029:7:70", + "nodeType": "YulIdentifier", + "src": "14029:7:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "value", + "nativeSrc": "14085:5:70", + "nodeType": "YulIdentifier", + "src": "14085:5:70" + }, + { + "kind": "number", + "nativeSrc": "14092:2:70", + "nodeType": "YulLiteral", + "src": "14092:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "14081:3:70", + "nodeType": "YulIdentifier", + "src": "14081:3:70" + }, + "nativeSrc": "14081:14:70", + "nodeType": "YulFunctionCall", + "src": "14081:14:70" + }, + { + "name": "value_2", + "nativeSrc": "14097:7:70", + "nodeType": "YulIdentifier", + "src": "14097:7:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "14074:6:70", + "nodeType": "YulIdentifier", + "src": "14074:6:70" + }, + "nativeSrc": "14074:31:70", + "nodeType": "YulFunctionCall", + "src": "14074:31:70" + }, + "nativeSrc": "14074:31:70", + "nodeType": "YulExpressionStatement", + "src": "14074:31:70" + }, + { + "nativeSrc": "14114:16:70", + "nodeType": "YulVariableDeclaration", + "src": "14114:16:70", + "value": { + "kind": "number", + "nativeSrc": "14129:1:70", + "nodeType": "YulLiteral", + "src": "14129:1:70", + "type": "", + "value": "0" + }, + "variables": [ + { + "name": "value_3", + "nativeSrc": "14118:7:70", + "nodeType": "YulTypedName", + "src": "14118:7:70", + "type": "" + } + ] + }, + { + "nativeSrc": "14139:36:70", + "nodeType": "YulAssignment", + "src": "14139:36:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "14160:9:70", + "nodeType": "YulIdentifier", + "src": "14160:9:70" + }, + { + "kind": "number", + "nativeSrc": "14171:2:70", + "nodeType": "YulLiteral", + "src": "14171:2:70", + "type": "", + "value": "96" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "14156:3:70", + "nodeType": "YulIdentifier", + "src": "14156:3:70" + }, + "nativeSrc": "14156:18:70", + "nodeType": "YulFunctionCall", + "src": "14156:18:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "14150:5:70", + "nodeType": "YulIdentifier", + "src": "14150:5:70" + }, + "nativeSrc": "14150:25:70", + "nodeType": "YulFunctionCall", + "src": "14150:25:70" + }, + "variableNames": [ + { + "name": "value_3", + "nativeSrc": "14139:7:70", + "nodeType": "YulIdentifier", + "src": "14139:7:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "value", + "nativeSrc": "14195:5:70", + "nodeType": "YulIdentifier", + "src": "14195:5:70" + }, + { + "kind": "number", + "nativeSrc": "14202:2:70", + "nodeType": "YulLiteral", + "src": "14202:2:70", + "type": "", + "value": "96" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "14191:3:70", + "nodeType": "YulIdentifier", + "src": "14191:3:70" + }, + "nativeSrc": "14191:14:70", + "nodeType": "YulFunctionCall", + "src": "14191:14:70" + }, + { + "name": "value_3", + "nativeSrc": "14207:7:70", + "nodeType": "YulIdentifier", + "src": "14207:7:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "14184:6:70", + "nodeType": "YulIdentifier", + "src": "14184:6:70" + }, + "nativeSrc": "14184:31:70", + "nodeType": "YulFunctionCall", + "src": "14184:31:70" + }, + "nativeSrc": "14184:31:70", + "nodeType": "YulExpressionStatement", + "src": "14184:31:70" + }, + { + "nativeSrc": "14224:16:70", + "nodeType": "YulVariableDeclaration", + "src": "14224:16:70", + "value": { + "kind": "number", + "nativeSrc": "14239:1:70", + "nodeType": "YulLiteral", + "src": "14239:1:70", + "type": "", + "value": "0" + }, + "variables": [ + { + "name": "value_4", + "nativeSrc": "14228:7:70", + "nodeType": "YulTypedName", + "src": "14228:7:70", + "type": "" + } + ] + }, + { + "nativeSrc": "14249:37:70", + "nodeType": "YulAssignment", + "src": "14249:37:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "14270:9:70", + "nodeType": "YulIdentifier", + "src": "14270:9:70" + }, + { + "kind": "number", + "nativeSrc": "14281:3:70", + "nodeType": "YulLiteral", + "src": "14281:3:70", + "type": "", + "value": "128" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "14266:3:70", + "nodeType": "YulIdentifier", + "src": "14266:3:70" + }, + "nativeSrc": "14266:19:70", + "nodeType": "YulFunctionCall", + "src": "14266:19:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "14260:5:70", + "nodeType": "YulIdentifier", + "src": "14260:5:70" + }, + "nativeSrc": "14260:26:70", + "nodeType": "YulFunctionCall", + "src": "14260:26:70" + }, + "variableNames": [ + { + "name": "value_4", + "nativeSrc": "14249:7:70", + "nodeType": "YulIdentifier", + "src": "14249:7:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "value", + "nativeSrc": "14306:5:70", + "nodeType": "YulIdentifier", + "src": "14306:5:70" + }, + { + "kind": "number", + "nativeSrc": "14313:3:70", + "nodeType": "YulLiteral", + "src": "14313:3:70", + "type": "", + "value": "128" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "14302:3:70", + "nodeType": "YulIdentifier", + "src": "14302:3:70" + }, + "nativeSrc": "14302:15:70", + "nodeType": "YulFunctionCall", + "src": "14302:15:70" + }, + { + "name": "value_4", + "nativeSrc": "14319:7:70", + "nodeType": "YulIdentifier", + "src": "14319:7:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "14295:6:70", + "nodeType": "YulIdentifier", + "src": "14295:6:70" + }, + "nativeSrc": "14295:32:70", + "nodeType": "YulFunctionCall", + "src": "14295:32:70" + }, + "nativeSrc": "14295:32:70", + "nodeType": "YulExpressionStatement", + "src": "14295:32:70" + }, + { + "nativeSrc": "14336:16:70", + "nodeType": "YulVariableDeclaration", + "src": "14336:16:70", + "value": { + "kind": "number", + "nativeSrc": "14351:1:70", + "nodeType": "YulLiteral", + "src": "14351:1:70", + "type": "", + "value": "0" + }, + "variables": [ + { + "name": "value_5", + "nativeSrc": "14340:7:70", + "nodeType": "YulTypedName", + "src": "14340:7:70", + "type": "" + } + ] + }, + { + "nativeSrc": "14361:37:70", + "nodeType": "YulAssignment", + "src": "14361:37:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "14382:9:70", + "nodeType": "YulIdentifier", + "src": "14382:9:70" + }, + { + "kind": "number", + "nativeSrc": "14393:3:70", + "nodeType": "YulLiteral", + "src": "14393:3:70", + "type": "", + "value": "160" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "14378:3:70", + "nodeType": "YulIdentifier", + "src": "14378:3:70" + }, + "nativeSrc": "14378:19:70", + "nodeType": "YulFunctionCall", + "src": "14378:19:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "14372:5:70", + "nodeType": "YulIdentifier", + "src": "14372:5:70" + }, + "nativeSrc": "14372:26:70", + "nodeType": "YulFunctionCall", + "src": "14372:26:70" + }, + "variableNames": [ + { + "name": "value_5", + "nativeSrc": "14361:7:70", + "nodeType": "YulIdentifier", + "src": "14361:7:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "value", + "nativeSrc": "14418:5:70", + "nodeType": "YulIdentifier", + "src": "14418:5:70" + }, + { + "kind": "number", + "nativeSrc": "14425:3:70", + "nodeType": "YulLiteral", + "src": "14425:3:70", + "type": "", + "value": "160" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "14414:3:70", + "nodeType": "YulIdentifier", + "src": "14414:3:70" + }, + "nativeSrc": "14414:15:70", + "nodeType": "YulFunctionCall", + "src": "14414:15:70" + }, + { + "name": "value_5", + "nativeSrc": "14431:7:70", + "nodeType": "YulIdentifier", + "src": "14431:7:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "14407:6:70", + "nodeType": "YulIdentifier", + "src": "14407:6:70" + }, + "nativeSrc": "14407:32:70", + "nodeType": "YulFunctionCall", + "src": "14407:32:70" + }, + "nativeSrc": "14407:32:70", + "nodeType": "YulExpressionStatement", + "src": "14407:32:70" + }, + { + "nativeSrc": "14448:16:70", + "nodeType": "YulVariableDeclaration", + "src": "14448:16:70", + "value": { + "kind": "number", + "nativeSrc": "14463:1:70", + "nodeType": "YulLiteral", + "src": "14463:1:70", + "type": "", + "value": "0" + }, + "variables": [ + { + "name": "value_6", + "nativeSrc": "14452:7:70", + "nodeType": "YulTypedName", + "src": "14452:7:70", + "type": "" + } + ] + }, + { + "nativeSrc": "14473:37:70", + "nodeType": "YulAssignment", + "src": "14473:37:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "14494:9:70", + "nodeType": "YulIdentifier", + "src": "14494:9:70" + }, + { + "kind": "number", + "nativeSrc": "14505:3:70", + "nodeType": "YulLiteral", + "src": "14505:3:70", + "type": "", + "value": "192" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "14490:3:70", + "nodeType": "YulIdentifier", + "src": "14490:3:70" + }, + "nativeSrc": "14490:19:70", + "nodeType": "YulFunctionCall", + "src": "14490:19:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "14484:5:70", + "nodeType": "YulIdentifier", + "src": "14484:5:70" + }, + "nativeSrc": "14484:26:70", + "nodeType": "YulFunctionCall", + "src": "14484:26:70" + }, + "variableNames": [ + { + "name": "value_6", + "nativeSrc": "14473:7:70", + "nodeType": "YulIdentifier", + "src": "14473:7:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "value", + "nativeSrc": "14530:5:70", + "nodeType": "YulIdentifier", + "src": "14530:5:70" + }, + { + "kind": "number", + "nativeSrc": "14537:3:70", + "nodeType": "YulLiteral", + "src": "14537:3:70", + "type": "", + "value": "192" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "14526:3:70", + "nodeType": "YulIdentifier", + "src": "14526:3:70" + }, + "nativeSrc": "14526:15:70", + "nodeType": "YulFunctionCall", + "src": "14526:15:70" + }, + { + "name": "value_6", + "nativeSrc": "14543:7:70", + "nodeType": "YulIdentifier", + "src": "14543:7:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "14519:6:70", + "nodeType": "YulIdentifier", + "src": "14519:6:70" + }, + "nativeSrc": "14519:32:70", + "nodeType": "YulFunctionCall", + "src": "14519:32:70" + }, + "nativeSrc": "14519:32:70", + "nodeType": "YulExpressionStatement", + "src": "14519:32:70" + }, + { + "nativeSrc": "14560:16:70", + "nodeType": "YulVariableDeclaration", + "src": "14560:16:70", + "value": { + "kind": "number", + "nativeSrc": "14575:1:70", + "nodeType": "YulLiteral", + "src": "14575:1:70", + "type": "", + "value": "0" + }, + "variables": [ + { + "name": "value_7", + "nativeSrc": "14564:7:70", + "nodeType": "YulTypedName", + "src": "14564:7:70", + "type": "" + } + ] + }, + { + "nativeSrc": "14585:37:70", + "nodeType": "YulAssignment", + "src": "14585:37:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "14606:9:70", + "nodeType": "YulIdentifier", + "src": "14606:9:70" + }, + { + "kind": "number", + "nativeSrc": "14617:3:70", + "nodeType": "YulLiteral", + "src": "14617:3:70", + "type": "", + "value": "224" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "14602:3:70", + "nodeType": "YulIdentifier", + "src": "14602:3:70" + }, + "nativeSrc": "14602:19:70", + "nodeType": "YulFunctionCall", + "src": "14602:19:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "14596:5:70", + "nodeType": "YulIdentifier", + "src": "14596:5:70" + }, + "nativeSrc": "14596:26:70", + "nodeType": "YulFunctionCall", + "src": "14596:26:70" + }, + "variableNames": [ + { + "name": "value_7", + "nativeSrc": "14585:7:70", + "nodeType": "YulIdentifier", + "src": "14585:7:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "value", + "nativeSrc": "14642:5:70", + "nodeType": "YulIdentifier", + "src": "14642:5:70" + }, + { + "kind": "number", + "nativeSrc": "14649:3:70", + "nodeType": "YulLiteral", + "src": "14649:3:70", + "type": "", + "value": "224" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "14638:3:70", + "nodeType": "YulIdentifier", + "src": "14638:3:70" + }, + "nativeSrc": "14638:15:70", + "nodeType": "YulFunctionCall", + "src": "14638:15:70" + }, + { + "name": "value_7", + "nativeSrc": "14655:7:70", + "nodeType": "YulIdentifier", + "src": "14655:7:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "14631:6:70", + "nodeType": "YulIdentifier", + "src": "14631:6:70" + }, + "nativeSrc": "14631:32:70", + "nodeType": "YulFunctionCall", + "src": "14631:32:70" + }, + "nativeSrc": "14631:32:70", + "nodeType": "YulExpressionStatement", + "src": "14631:32:70" + }, + { + "nativeSrc": "14672:16:70", + "nodeType": "YulVariableDeclaration", + "src": "14672:16:70", + "value": { + "kind": "number", + "nativeSrc": "14687:1:70", + "nodeType": "YulLiteral", + "src": "14687:1:70", + "type": "", + "value": "0" + }, + "variables": [ + { + "name": "value_8", + "nativeSrc": "14676:7:70", + "nodeType": "YulTypedName", + "src": "14676:7:70", + "type": "" + } + ] + }, + { + "nativeSrc": "14697:37:70", + "nodeType": "YulAssignment", + "src": "14697:37:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "14718:9:70", + "nodeType": "YulIdentifier", + "src": "14718:9:70" + }, + { + "kind": "number", + "nativeSrc": "14729:3:70", + "nodeType": "YulLiteral", + "src": "14729:3:70", + "type": "", + "value": "256" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "14714:3:70", + "nodeType": "YulIdentifier", + "src": "14714:3:70" + }, + "nativeSrc": "14714:19:70", + "nodeType": "YulFunctionCall", + "src": "14714:19:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "14708:5:70", + "nodeType": "YulIdentifier", + "src": "14708:5:70" + }, + "nativeSrc": "14708:26:70", + "nodeType": "YulFunctionCall", + "src": "14708:26:70" + }, + "variableNames": [ + { + "name": "value_8", + "nativeSrc": "14697:7:70", + "nodeType": "YulIdentifier", + "src": "14697:7:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "value", + "nativeSrc": "14754:5:70", + "nodeType": "YulIdentifier", + "src": "14754:5:70" + }, + { + "kind": "number", + "nativeSrc": "14761:3:70", + "nodeType": "YulLiteral", + "src": "14761:3:70", + "type": "", + "value": "256" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "14750:3:70", + "nodeType": "YulIdentifier", + "src": "14750:3:70" + }, + "nativeSrc": "14750:15:70", + "nodeType": "YulFunctionCall", + "src": "14750:15:70" + }, + { + "name": "value_8", + "nativeSrc": "14767:7:70", + "nodeType": "YulIdentifier", + "src": "14767:7:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "14743:6:70", + "nodeType": "YulIdentifier", + "src": "14743:6:70" + }, + "nativeSrc": "14743:32:70", + "nodeType": "YulFunctionCall", + "src": "14743:32:70" + }, + "nativeSrc": "14743:32:70", + "nodeType": "YulExpressionStatement", + "src": "14743:32:70" + } + ] + }, + "name": "abi_decode_struct_Allocation_fromMemory", + "nativeSrc": "13641:1140:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "13690:9:70", + "nodeType": "YulTypedName", + "src": "13690:9:70", + "type": "" + }, + { + "name": "end", + "nativeSrc": "13701:3:70", + "nodeType": "YulTypedName", + "src": "13701:3:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value", + "nativeSrc": "13709:5:70", + "nodeType": "YulTypedName", + "src": "13709:5:70", + "type": "" + } + ], + "src": "13641:1140:70" + }, + { + "body": { + "nativeSrc": "14895:147:70", + "nodeType": "YulBlock", + "src": "14895:147:70", + "statements": [ + { + "body": { + "nativeSrc": "14942:16:70", + "nodeType": "YulBlock", + "src": "14942:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "14951:1:70", + "nodeType": "YulLiteral", + "src": "14951:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "14954:1:70", + "nodeType": "YulLiteral", + "src": "14954:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "14944:6:70", + "nodeType": "YulIdentifier", + "src": "14944:6:70" + }, + "nativeSrc": "14944:12:70", + "nodeType": "YulFunctionCall", + "src": "14944:12:70" + }, + "nativeSrc": "14944:12:70", + "nodeType": "YulExpressionStatement", + "src": "14944:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "dataEnd", + "nativeSrc": "14916:7:70", + "nodeType": "YulIdentifier", + "src": "14916:7:70" + }, + { + "name": "headStart", + "nativeSrc": "14925:9:70", + "nodeType": "YulIdentifier", + "src": "14925:9:70" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "14912:3:70", + "nodeType": "YulIdentifier", + "src": "14912:3:70" + }, + "nativeSrc": "14912:23:70", + "nodeType": "YulFunctionCall", + "src": "14912:23:70" + }, + { + "kind": "number", + "nativeSrc": "14937:3:70", + "nodeType": "YulLiteral", + "src": "14937:3:70", + "type": "", + "value": "288" + } + ], + "functionName": { + "name": "slt", + "nativeSrc": "14908:3:70", + "nodeType": "YulIdentifier", + "src": "14908:3:70" + }, + "nativeSrc": "14908:33:70", + "nodeType": "YulFunctionCall", + "src": "14908:33:70" + }, + "nativeSrc": "14905:53:70", + "nodeType": "YulIf", + "src": "14905:53:70" + }, + { + "nativeSrc": "14967:69:70", + "nodeType": "YulAssignment", + "src": "14967:69:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "15017:9:70", + "nodeType": "YulIdentifier", + "src": "15017:9:70" + }, + { + "name": "dataEnd", + "nativeSrc": "15028:7:70", + "nodeType": "YulIdentifier", + "src": "15028:7:70" + } + ], + "functionName": { + "name": "abi_decode_struct_Allocation_fromMemory", + "nativeSrc": "14977:39:70", + "nodeType": "YulIdentifier", + "src": "14977:39:70" + }, + "nativeSrc": "14977:59:70", + "nodeType": "YulFunctionCall", + "src": "14977:59:70" + }, + "variableNames": [ + { + "name": "value0", + "nativeSrc": "14967:6:70", + "nodeType": "YulIdentifier", + "src": "14967:6:70" + } + ] + } + ] + }, + "name": "abi_decode_tuple_t_struct$_Allocation_$3073_memory_ptr_fromMemory", + "nativeSrc": "14786:256:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "14861:9:70", + "nodeType": "YulTypedName", + "src": "14861:9:70", + "type": "" + }, + { + "name": "dataEnd", + "nativeSrc": "14872:7:70", + "nodeType": "YulTypedName", + "src": "14872:7:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value0", + "nativeSrc": "14884:6:70", + "nodeType": "YulTypedName", + "src": "14884:6:70", + "type": "" + } + ], + "src": "14786:256:70" + }, + { + "body": { + "nativeSrc": "15079:95:70", + "nodeType": "YulBlock", + "src": "15079:95:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "15096:1:70", + "nodeType": "YulLiteral", + "src": "15096:1:70", + "type": "", + "value": "0" + }, + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "15103:3:70", + "nodeType": "YulLiteral", + "src": "15103:3:70", + "type": "", + "value": "224" + }, + { + "kind": "number", + "nativeSrc": "15108:10:70", + "nodeType": "YulLiteral", + "src": "15108:10:70", + "type": "", + "value": "0x4e487b71" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "15099:3:70", + "nodeType": "YulIdentifier", + "src": "15099:3:70" + }, + "nativeSrc": "15099:20:70", + "nodeType": "YulFunctionCall", + "src": "15099:20:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "15089:6:70", + "nodeType": "YulIdentifier", + "src": "15089:6:70" + }, + "nativeSrc": "15089:31:70", + "nodeType": "YulFunctionCall", + "src": "15089:31:70" + }, + "nativeSrc": "15089:31:70", + "nodeType": "YulExpressionStatement", + "src": "15089:31:70" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "15136:1:70", + "nodeType": "YulLiteral", + "src": "15136:1:70", + "type": "", + "value": "4" + }, + { + "kind": "number", + "nativeSrc": "15139:4:70", + "nodeType": "YulLiteral", + "src": "15139:4:70", + "type": "", + "value": "0x11" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "15129:6:70", + "nodeType": "YulIdentifier", + "src": "15129:6:70" + }, + "nativeSrc": "15129:15:70", + "nodeType": "YulFunctionCall", + "src": "15129:15:70" + }, + "nativeSrc": "15129:15:70", + "nodeType": "YulExpressionStatement", + "src": "15129:15:70" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "15160:1:70", + "nodeType": "YulLiteral", + "src": "15160:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "15163:4:70", + "nodeType": "YulLiteral", + "src": "15163:4:70", + "type": "", + "value": "0x24" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "15153:6:70", + "nodeType": "YulIdentifier", + "src": "15153:6:70" + }, + "nativeSrc": "15153:15:70", + "nodeType": "YulFunctionCall", + "src": "15153:15:70" + }, + "nativeSrc": "15153:15:70", + "nodeType": "YulExpressionStatement", + "src": "15153:15:70" + } + ] + }, + "name": "panic_error_0x11", + "nativeSrc": "15047:127:70", + "nodeType": "YulFunctionDefinition", + "src": "15047:127:70" + }, + { + "body": { + "nativeSrc": "15227:77:70", + "nodeType": "YulBlock", + "src": "15227:77:70", + "statements": [ + { + "nativeSrc": "15237:16:70", + "nodeType": "YulAssignment", + "src": "15237:16:70", + "value": { + "arguments": [ + { + "name": "x", + "nativeSrc": "15248:1:70", + "nodeType": "YulIdentifier", + "src": "15248:1:70" + }, + { + "name": "y", + "nativeSrc": "15251:1:70", + "nodeType": "YulIdentifier", + "src": "15251:1:70" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "15244:3:70", + "nodeType": "YulIdentifier", + "src": "15244:3:70" + }, + "nativeSrc": "15244:9:70", + "nodeType": "YulFunctionCall", + "src": "15244:9:70" + }, + "variableNames": [ + { + "name": "sum", + "nativeSrc": "15237:3:70", + "nodeType": "YulIdentifier", + "src": "15237:3:70" + } + ] + }, + { + "body": { + "nativeSrc": "15276:22:70", + "nodeType": "YulBlock", + "src": "15276:22:70", + "statements": [ + { + "expression": { + "arguments": [], + "functionName": { + "name": "panic_error_0x11", + "nativeSrc": "15278:16:70", + "nodeType": "YulIdentifier", + "src": "15278:16:70" + }, + "nativeSrc": "15278:18:70", + "nodeType": "YulFunctionCall", + "src": "15278:18:70" + }, + "nativeSrc": "15278:18:70", + "nodeType": "YulExpressionStatement", + "src": "15278:18:70" + } + ] + }, + "condition": { + "arguments": [ + { + "name": "x", + "nativeSrc": "15268:1:70", + "nodeType": "YulIdentifier", + "src": "15268:1:70" + }, + { + "name": "sum", + "nativeSrc": "15271:3:70", + "nodeType": "YulIdentifier", + "src": "15271:3:70" + } + ], + "functionName": { + "name": "gt", + "nativeSrc": "15265:2:70", + "nodeType": "YulIdentifier", + "src": "15265:2:70" + }, + "nativeSrc": "15265:10:70", + "nodeType": "YulFunctionCall", + "src": "15265:10:70" + }, + "nativeSrc": "15262:36:70", + "nodeType": "YulIf", + "src": "15262:36:70" + } + ] + }, + "name": "checked_add_t_uint256", + "nativeSrc": "15179:125:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "x", + "nativeSrc": "15210:1:70", + "nodeType": "YulTypedName", + "src": "15210:1:70", + "type": "" + }, + { + "name": "y", + "nativeSrc": "15213:1:70", + "nodeType": "YulTypedName", + "src": "15213:1:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "sum", + "nativeSrc": "15219:3:70", + "nodeType": "YulTypedName", + "src": "15219:3:70", + "type": "" + } + ], + "src": "15179:125:70" + }, + { + "body": { + "nativeSrc": "15438:119:70", + "nodeType": "YulBlock", + "src": "15438:119:70", + "statements": [ + { + "nativeSrc": "15448:26:70", + "nodeType": "YulAssignment", + "src": "15448:26:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "15460:9:70", + "nodeType": "YulIdentifier", + "src": "15460:9:70" + }, + { + "kind": "number", + "nativeSrc": "15471:2:70", + "nodeType": "YulLiteral", + "src": "15471:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "15456:3:70", + "nodeType": "YulIdentifier", + "src": "15456:3:70" + }, + "nativeSrc": "15456:18:70", + "nodeType": "YulFunctionCall", + "src": "15456:18:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "15448:4:70", + "nodeType": "YulIdentifier", + "src": "15448:4:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "15490:9:70", + "nodeType": "YulIdentifier", + "src": "15490:9:70" + }, + { + "name": "value0", + "nativeSrc": "15501:6:70", + "nodeType": "YulIdentifier", + "src": "15501:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "15483:6:70", + "nodeType": "YulIdentifier", + "src": "15483:6:70" + }, + "nativeSrc": "15483:25:70", + "nodeType": "YulFunctionCall", + "src": "15483:25:70" + }, + "nativeSrc": "15483:25:70", + "nodeType": "YulExpressionStatement", + "src": "15483:25:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "15528:9:70", + "nodeType": "YulIdentifier", + "src": "15528:9:70" + }, + { + "kind": "number", + "nativeSrc": "15539:2:70", + "nodeType": "YulLiteral", + "src": "15539:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "15524:3:70", + "nodeType": "YulIdentifier", + "src": "15524:3:70" + }, + "nativeSrc": "15524:18:70", + "nodeType": "YulFunctionCall", + "src": "15524:18:70" + }, + { + "name": "value1", + "nativeSrc": "15544:6:70", + "nodeType": "YulIdentifier", + "src": "15544:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "15517:6:70", + "nodeType": "YulIdentifier", + "src": "15517:6:70" + }, + "nativeSrc": "15517:34:70", + "nodeType": "YulFunctionCall", + "src": "15517:34:70" + }, + "nativeSrc": "15517:34:70", + "nodeType": "YulExpressionStatement", + "src": "15517:34:70" + } + ] + }, + "name": "abi_encode_tuple_t_uint256_t_uint256__to_t_uint256_t_uint256__fromStack_reversed", + "nativeSrc": "15309:248:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "15399:9:70", + "nodeType": "YulTypedName", + "src": "15399:9:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "15410:6:70", + "nodeType": "YulTypedName", + "src": "15410:6:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "15418:6:70", + "nodeType": "YulTypedName", + "src": "15418:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "15429:4:70", + "nodeType": "YulTypedName", + "src": "15429:4:70", + "type": "" + } + ], + "src": "15309:248:70" + }, + { + "body": { + "nativeSrc": "15611:350:70", + "nodeType": "YulBlock", + "src": "15611:350:70", + "statements": [ + { + "nativeSrc": "15621:26:70", + "nodeType": "YulVariableDeclaration", + "src": "15621:26:70", + "value": { + "arguments": [ + { + "name": "value", + "nativeSrc": "15641:5:70", + "nodeType": "YulIdentifier", + "src": "15641:5:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "15635:5:70", + "nodeType": "YulIdentifier", + "src": "15635:5:70" + }, + "nativeSrc": "15635:12:70", + "nodeType": "YulFunctionCall", + "src": "15635:12:70" + }, + "variables": [ + { + "name": "length", + "nativeSrc": "15625:6:70", + "nodeType": "YulTypedName", + "src": "15625:6:70", + "type": "" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "pos", + "nativeSrc": "15663:3:70", + "nodeType": "YulIdentifier", + "src": "15663:3:70" + }, + { + "name": "length", + "nativeSrc": "15668:6:70", + "nodeType": "YulIdentifier", + "src": "15668:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "15656:6:70", + "nodeType": "YulIdentifier", + "src": "15656:6:70" + }, + "nativeSrc": "15656:19:70", + "nodeType": "YulFunctionCall", + "src": "15656:19:70" + }, + "nativeSrc": "15656:19:70", + "nodeType": "YulExpressionStatement", + "src": "15656:19:70" + }, + { + "nativeSrc": "15684:10:70", + "nodeType": "YulVariableDeclaration", + "src": "15684:10:70", + "value": { + "kind": "number", + "nativeSrc": "15693:1:70", + "nodeType": "YulLiteral", + "src": "15693:1:70", + "type": "", + "value": "0" + }, + "variables": [ + { + "name": "i", + "nativeSrc": "15688:1:70", + "nodeType": "YulTypedName", + "src": "15688:1:70", + "type": "" + } + ] + }, + { + "body": { + "nativeSrc": "15755:87:70", + "nodeType": "YulBlock", + "src": "15755:87:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "arguments": [ + { + "name": "pos", + "nativeSrc": "15784:3:70", + "nodeType": "YulIdentifier", + "src": "15784:3:70" + }, + { + "name": "i", + "nativeSrc": "15789:1:70", + "nodeType": "YulIdentifier", + "src": "15789:1:70" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "15780:3:70", + "nodeType": "YulIdentifier", + "src": "15780:3:70" + }, + "nativeSrc": "15780:11:70", + "nodeType": "YulFunctionCall", + "src": "15780:11:70" + }, + { + "kind": "number", + "nativeSrc": "15793:4:70", + "nodeType": "YulLiteral", + "src": "15793:4:70", + "type": "", + "value": "0x20" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "15776:3:70", + "nodeType": "YulIdentifier", + "src": "15776:3:70" + }, + "nativeSrc": "15776:22:70", + "nodeType": "YulFunctionCall", + "src": "15776:22:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "arguments": [ + { + "name": "value", + "nativeSrc": "15814:5:70", + "nodeType": "YulIdentifier", + "src": "15814:5:70" + }, + { + "name": "i", + "nativeSrc": "15821:1:70", + "nodeType": "YulIdentifier", + "src": "15821:1:70" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "15810:3:70", + "nodeType": "YulIdentifier", + "src": "15810:3:70" + }, + "nativeSrc": "15810:13:70", + "nodeType": "YulFunctionCall", + "src": "15810:13:70" + }, + { + "kind": "number", + "nativeSrc": "15825:4:70", + "nodeType": "YulLiteral", + "src": "15825:4:70", + "type": "", + "value": "0x20" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "15806:3:70", + "nodeType": "YulIdentifier", + "src": "15806:3:70" + }, + "nativeSrc": "15806:24:70", + "nodeType": "YulFunctionCall", + "src": "15806:24:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "15800:5:70", + "nodeType": "YulIdentifier", + "src": "15800:5:70" + }, + "nativeSrc": "15800:31:70", + "nodeType": "YulFunctionCall", + "src": "15800:31:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "15769:6:70", + "nodeType": "YulIdentifier", + "src": "15769:6:70" + }, + "nativeSrc": "15769:63:70", + "nodeType": "YulFunctionCall", + "src": "15769:63:70" + }, + "nativeSrc": "15769:63:70", + "nodeType": "YulExpressionStatement", + "src": "15769:63:70" + } + ] + }, + "condition": { + "arguments": [ + { + "name": "i", + "nativeSrc": "15714:1:70", + "nodeType": "YulIdentifier", + "src": "15714:1:70" + }, + { + "name": "length", + "nativeSrc": "15717:6:70", + "nodeType": "YulIdentifier", + "src": "15717:6:70" + } + ], + "functionName": { + "name": "lt", + "nativeSrc": "15711:2:70", + "nodeType": "YulIdentifier", + "src": "15711:2:70" + }, + "nativeSrc": "15711:13:70", + "nodeType": "YulFunctionCall", + "src": "15711:13:70" + }, + "nativeSrc": "15703:139:70", + "nodeType": "YulForLoop", + "post": { + "nativeSrc": "15725:21:70", + "nodeType": "YulBlock", + "src": "15725:21:70", + "statements": [ + { + "nativeSrc": "15727:17:70", + "nodeType": "YulAssignment", + "src": "15727:17:70", + "value": { + "arguments": [ + { + "name": "i", + "nativeSrc": "15736:1:70", + "nodeType": "YulIdentifier", + "src": "15736:1:70" + }, + { + "kind": "number", + "nativeSrc": "15739:4:70", + "nodeType": "YulLiteral", + "src": "15739:4:70", + "type": "", + "value": "0x20" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "15732:3:70", + "nodeType": "YulIdentifier", + "src": "15732:3:70" + }, + "nativeSrc": "15732:12:70", + "nodeType": "YulFunctionCall", + "src": "15732:12:70" + }, + "variableNames": [ + { + "name": "i", + "nativeSrc": "15727:1:70", + "nodeType": "YulIdentifier", + "src": "15727:1:70" + } + ] + } + ] + }, + "pre": { + "nativeSrc": "15707:3:70", + "nodeType": "YulBlock", + "src": "15707:3:70", + "statements": [] + }, + "src": "15703:139:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "arguments": [ + { + "name": "pos", + "nativeSrc": "15866:3:70", + "nodeType": "YulIdentifier", + "src": "15866:3:70" + }, + { + "name": "length", + "nativeSrc": "15871:6:70", + "nodeType": "YulIdentifier", + "src": "15871:6:70" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "15862:3:70", + "nodeType": "YulIdentifier", + "src": "15862:3:70" + }, + "nativeSrc": "15862:16:70", + "nodeType": "YulFunctionCall", + "src": "15862:16:70" + }, + { + "kind": "number", + "nativeSrc": "15880:4:70", + "nodeType": "YulLiteral", + "src": "15880:4:70", + "type": "", + "value": "0x20" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "15858:3:70", + "nodeType": "YulIdentifier", + "src": "15858:3:70" + }, + "nativeSrc": "15858:27:70", + "nodeType": "YulFunctionCall", + "src": "15858:27:70" + }, + { + "kind": "number", + "nativeSrc": "15887:1:70", + "nodeType": "YulLiteral", + "src": "15887:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "15851:6:70", + "nodeType": "YulIdentifier", + "src": "15851:6:70" + }, + "nativeSrc": "15851:38:70", + "nodeType": "YulFunctionCall", + "src": "15851:38:70" + }, + "nativeSrc": "15851:38:70", + "nodeType": "YulExpressionStatement", + "src": "15851:38:70" + }, + { + "nativeSrc": "15898:57:70", + "nodeType": "YulAssignment", + "src": "15898:57:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "pos", + "nativeSrc": "15913:3:70", + "nodeType": "YulIdentifier", + "src": "15913:3:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "name": "length", + "nativeSrc": "15926:6:70", + "nodeType": "YulIdentifier", + "src": "15926:6:70" + }, + { + "kind": "number", + "nativeSrc": "15934:2:70", + "nodeType": "YulLiteral", + "src": "15934:2:70", + "type": "", + "value": "31" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "15922:3:70", + "nodeType": "YulIdentifier", + "src": "15922:3:70" + }, + "nativeSrc": "15922:15:70", + "nodeType": "YulFunctionCall", + "src": "15922:15:70" + }, + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "15943:2:70", + "nodeType": "YulLiteral", + "src": "15943:2:70", + "type": "", + "value": "31" + } + ], + "functionName": { + "name": "not", + "nativeSrc": "15939:3:70", + "nodeType": "YulIdentifier", + "src": "15939:3:70" + }, + "nativeSrc": "15939:7:70", + "nodeType": "YulFunctionCall", + "src": "15939:7:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "15918:3:70", + "nodeType": "YulIdentifier", + "src": "15918:3:70" + }, + "nativeSrc": "15918:29:70", + "nodeType": "YulFunctionCall", + "src": "15918:29:70" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "15909:3:70", + "nodeType": "YulIdentifier", + "src": "15909:3:70" + }, + "nativeSrc": "15909:39:70", + "nodeType": "YulFunctionCall", + "src": "15909:39:70" + }, + { + "kind": "number", + "nativeSrc": "15950:4:70", + "nodeType": "YulLiteral", + "src": "15950:4:70", + "type": "", + "value": "0x20" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "15905:3:70", + "nodeType": "YulIdentifier", + "src": "15905:3:70" + }, + "nativeSrc": "15905:50:70", + "nodeType": "YulFunctionCall", + "src": "15905:50:70" + }, + "variableNames": [ + { + "name": "end", + "nativeSrc": "15898:3:70", + "nodeType": "YulIdentifier", + "src": "15898:3:70" + } + ] + } + ] + }, + "name": "abi_encode_bytes", + "nativeSrc": "15562:399:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "value", + "nativeSrc": "15588:5:70", + "nodeType": "YulTypedName", + "src": "15588:5:70", + "type": "" + }, + { + "name": "pos", + "nativeSrc": "15595:3:70", + "nodeType": "YulTypedName", + "src": "15595:3:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "end", + "nativeSrc": "15603:3:70", + "nodeType": "YulTypedName", + "src": "15603:3:70", + "type": "" + } + ], + "src": "15562:399:70" + }, + { + "body": { + "nativeSrc": "16113:167:70", + "nodeType": "YulBlock", + "src": "16113:167:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "16130:9:70", + "nodeType": "YulIdentifier", + "src": "16130:9:70" + }, + { + "arguments": [ + { + "name": "value0", + "nativeSrc": "16145:6:70", + "nodeType": "YulIdentifier", + "src": "16145:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "16161:3:70", + "nodeType": "YulLiteral", + "src": "16161:3:70", + "type": "", + "value": "160" + }, + { + "kind": "number", + "nativeSrc": "16166:1:70", + "nodeType": "YulLiteral", + "src": "16166:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "16157:3:70", + "nodeType": "YulIdentifier", + "src": "16157:3:70" + }, + "nativeSrc": "16157:11:70", + "nodeType": "YulFunctionCall", + "src": "16157:11:70" + }, + { + "kind": "number", + "nativeSrc": "16170:1:70", + "nodeType": "YulLiteral", + "src": "16170:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "16153:3:70", + "nodeType": "YulIdentifier", + "src": "16153:3:70" + }, + "nativeSrc": "16153:19:70", + "nodeType": "YulFunctionCall", + "src": "16153:19:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "16141:3:70", + "nodeType": "YulIdentifier", + "src": "16141:3:70" + }, + "nativeSrc": "16141:32:70", + "nodeType": "YulFunctionCall", + "src": "16141:32:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "16123:6:70", + "nodeType": "YulIdentifier", + "src": "16123:6:70" + }, + "nativeSrc": "16123:51:70", + "nodeType": "YulFunctionCall", + "src": "16123:51:70" + }, + "nativeSrc": "16123:51:70", + "nodeType": "YulExpressionStatement", + "src": "16123:51:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "16194:9:70", + "nodeType": "YulIdentifier", + "src": "16194:9:70" + }, + { + "kind": "number", + "nativeSrc": "16205:2:70", + "nodeType": "YulLiteral", + "src": "16205:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "16190:3:70", + "nodeType": "YulIdentifier", + "src": "16190:3:70" + }, + "nativeSrc": "16190:18:70", + "nodeType": "YulFunctionCall", + "src": "16190:18:70" + }, + { + "kind": "number", + "nativeSrc": "16210:2:70", + "nodeType": "YulLiteral", + "src": "16210:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "16183:6:70", + "nodeType": "YulIdentifier", + "src": "16183:6:70" + }, + "nativeSrc": "16183:30:70", + "nodeType": "YulFunctionCall", + "src": "16183:30:70" + }, + "nativeSrc": "16183:30:70", + "nodeType": "YulExpressionStatement", + "src": "16183:30:70" + }, + { + "nativeSrc": "16222:52:70", + "nodeType": "YulAssignment", + "src": "16222:52:70", + "value": { + "arguments": [ + { + "name": "value1", + "nativeSrc": "16247:6:70", + "nodeType": "YulIdentifier", + "src": "16247:6:70" + }, + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "16259:9:70", + "nodeType": "YulIdentifier", + "src": "16259:9:70" + }, + { + "kind": "number", + "nativeSrc": "16270:2:70", + "nodeType": "YulLiteral", + "src": "16270:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "16255:3:70", + "nodeType": "YulIdentifier", + "src": "16255:3:70" + }, + "nativeSrc": "16255:18:70", + "nodeType": "YulFunctionCall", + "src": "16255:18:70" + } + ], + "functionName": { + "name": "abi_encode_bytes", + "nativeSrc": "16230:16:70", + "nodeType": "YulIdentifier", + "src": "16230:16:70" + }, + "nativeSrc": "16230:44:70", + "nodeType": "YulFunctionCall", + "src": "16230:44:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "16222:4:70", + "nodeType": "YulIdentifier", + "src": "16222:4:70" + } + ] + } + ] + }, + "name": "abi_encode_tuple_t_address_t_bytes_memory_ptr__to_t_address_t_bytes_memory_ptr__fromStack_reversed", + "nativeSrc": "15966:314:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "16074:9:70", + "nodeType": "YulTypedName", + "src": "16074:9:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "16085:6:70", + "nodeType": "YulTypedName", + "src": "16085:6:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "16093:6:70", + "nodeType": "YulTypedName", + "src": "16093:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "16104:4:70", + "nodeType": "YulTypedName", + "src": "16104:4:70", + "type": "" + } + ], + "src": "15966:314:70" + }, + { + "body": { + "nativeSrc": "16442:188:70", + "nodeType": "YulBlock", + "src": "16442:188:70", + "statements": [ + { + "nativeSrc": "16452:26:70", + "nodeType": "YulAssignment", + "src": "16452:26:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "16464:9:70", + "nodeType": "YulIdentifier", + "src": "16464:9:70" + }, + { + "kind": "number", + "nativeSrc": "16475:2:70", + "nodeType": "YulLiteral", + "src": "16475:2:70", + "type": "", + "value": "96" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "16460:3:70", + "nodeType": "YulIdentifier", + "src": "16460:3:70" + }, + "nativeSrc": "16460:18:70", + "nodeType": "YulFunctionCall", + "src": "16460:18:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "16452:4:70", + "nodeType": "YulIdentifier", + "src": "16452:4:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "16494:9:70", + "nodeType": "YulIdentifier", + "src": "16494:9:70" + }, + { + "arguments": [ + { + "name": "value0", + "nativeSrc": "16509:6:70", + "nodeType": "YulIdentifier", + "src": "16509:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "16525:3:70", + "nodeType": "YulLiteral", + "src": "16525:3:70", + "type": "", + "value": "160" + }, + { + "kind": "number", + "nativeSrc": "16530:1:70", + "nodeType": "YulLiteral", + "src": "16530:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "16521:3:70", + "nodeType": "YulIdentifier", + "src": "16521:3:70" + }, + "nativeSrc": "16521:11:70", + "nodeType": "YulFunctionCall", + "src": "16521:11:70" + }, + { + "kind": "number", + "nativeSrc": "16534:1:70", + "nodeType": "YulLiteral", + "src": "16534:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "16517:3:70", + "nodeType": "YulIdentifier", + "src": "16517:3:70" + }, + "nativeSrc": "16517:19:70", + "nodeType": "YulFunctionCall", + "src": "16517:19:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "16505:3:70", + "nodeType": "YulIdentifier", + "src": "16505:3:70" + }, + "nativeSrc": "16505:32:70", + "nodeType": "YulFunctionCall", + "src": "16505:32:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "16487:6:70", + "nodeType": "YulIdentifier", + "src": "16487:6:70" + }, + "nativeSrc": "16487:51:70", + "nodeType": "YulFunctionCall", + "src": "16487:51:70" + }, + "nativeSrc": "16487:51:70", + "nodeType": "YulExpressionStatement", + "src": "16487:51:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "16558:9:70", + "nodeType": "YulIdentifier", + "src": "16558:9:70" + }, + { + "kind": "number", + "nativeSrc": "16569:2:70", + "nodeType": "YulLiteral", + "src": "16569:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "16554:3:70", + "nodeType": "YulIdentifier", + "src": "16554:3:70" + }, + "nativeSrc": "16554:18:70", + "nodeType": "YulFunctionCall", + "src": "16554:18:70" + }, + { + "name": "value1", + "nativeSrc": "16574:6:70", + "nodeType": "YulIdentifier", + "src": "16574:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "16547:6:70", + "nodeType": "YulIdentifier", + "src": "16547:6:70" + }, + "nativeSrc": "16547:34:70", + "nodeType": "YulFunctionCall", + "src": "16547:34:70" + }, + "nativeSrc": "16547:34:70", + "nodeType": "YulExpressionStatement", + "src": "16547:34:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "16601:9:70", + "nodeType": "YulIdentifier", + "src": "16601:9:70" + }, + { + "kind": "number", + "nativeSrc": "16612:2:70", + "nodeType": "YulLiteral", + "src": "16612:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "16597:3:70", + "nodeType": "YulIdentifier", + "src": "16597:3:70" + }, + "nativeSrc": "16597:18:70", + "nodeType": "YulFunctionCall", + "src": "16597:18:70" + }, + { + "name": "value2", + "nativeSrc": "16617:6:70", + "nodeType": "YulIdentifier", + "src": "16617:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "16590:6:70", + "nodeType": "YulIdentifier", + "src": "16590:6:70" + }, + "nativeSrc": "16590:34:70", + "nodeType": "YulFunctionCall", + "src": "16590:34:70" + }, + "nativeSrc": "16590:34:70", + "nodeType": "YulExpressionStatement", + "src": "16590:34:70" + } + ] + }, + "name": "abi_encode_tuple_t_address_t_uint256_t_uint256__to_t_address_t_uint256_t_uint256__fromStack_reversed", + "nativeSrc": "16285:345:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "16395:9:70", + "nodeType": "YulTypedName", + "src": "16395:9:70", + "type": "" + }, + { + "name": "value2", + "nativeSrc": "16406:6:70", + "nodeType": "YulTypedName", + "src": "16406:6:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "16414:6:70", + "nodeType": "YulTypedName", + "src": "16414:6:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "16422:6:70", + "nodeType": "YulTypedName", + "src": "16422:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "16433:4:70", + "nodeType": "YulTypedName", + "src": "16433:4:70", + "type": "" + } + ], + "src": "16285:345:70" + }, + { + "body": { + "nativeSrc": "16764:171:70", + "nodeType": "YulBlock", + "src": "16764:171:70", + "statements": [ + { + "nativeSrc": "16774:26:70", + "nodeType": "YulAssignment", + "src": "16774:26:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "16786:9:70", + "nodeType": "YulIdentifier", + "src": "16786:9:70" + }, + { + "kind": "number", + "nativeSrc": "16797:2:70", + "nodeType": "YulLiteral", + "src": "16797:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "16782:3:70", + "nodeType": "YulIdentifier", + "src": "16782:3:70" + }, + "nativeSrc": "16782:18:70", + "nodeType": "YulFunctionCall", + "src": "16782:18:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "16774:4:70", + "nodeType": "YulIdentifier", + "src": "16774:4:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "16816:9:70", + "nodeType": "YulIdentifier", + "src": "16816:9:70" + }, + { + "arguments": [ + { + "name": "value0", + "nativeSrc": "16831:6:70", + "nodeType": "YulIdentifier", + "src": "16831:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "16847:3:70", + "nodeType": "YulLiteral", + "src": "16847:3:70", + "type": "", + "value": "160" + }, + { + "kind": "number", + "nativeSrc": "16852:1:70", + "nodeType": "YulLiteral", + "src": "16852:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "16843:3:70", + "nodeType": "YulIdentifier", + "src": "16843:3:70" + }, + "nativeSrc": "16843:11:70", + "nodeType": "YulFunctionCall", + "src": "16843:11:70" + }, + { + "kind": "number", + "nativeSrc": "16856:1:70", + "nodeType": "YulLiteral", + "src": "16856:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "16839:3:70", + "nodeType": "YulIdentifier", + "src": "16839:3:70" + }, + "nativeSrc": "16839:19:70", + "nodeType": "YulFunctionCall", + "src": "16839:19:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "16827:3:70", + "nodeType": "YulIdentifier", + "src": "16827:3:70" + }, + "nativeSrc": "16827:32:70", + "nodeType": "YulFunctionCall", + "src": "16827:32:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "16809:6:70", + "nodeType": "YulIdentifier", + "src": "16809:6:70" + }, + "nativeSrc": "16809:51:70", + "nodeType": "YulFunctionCall", + "src": "16809:51:70" + }, + "nativeSrc": "16809:51:70", + "nodeType": "YulExpressionStatement", + "src": "16809:51:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "16880:9:70", + "nodeType": "YulIdentifier", + "src": "16880:9:70" + }, + { + "kind": "number", + "nativeSrc": "16891:2:70", + "nodeType": "YulLiteral", + "src": "16891:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "16876:3:70", + "nodeType": "YulIdentifier", + "src": "16876:3:70" + }, + "nativeSrc": "16876:18:70", + "nodeType": "YulFunctionCall", + "src": "16876:18:70" + }, + { + "arguments": [ + { + "name": "value1", + "nativeSrc": "16900:6:70", + "nodeType": "YulIdentifier", + "src": "16900:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "16916:3:70", + "nodeType": "YulLiteral", + "src": "16916:3:70", + "type": "", + "value": "160" + }, + { + "kind": "number", + "nativeSrc": "16921:1:70", + "nodeType": "YulLiteral", + "src": "16921:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "16912:3:70", + "nodeType": "YulIdentifier", + "src": "16912:3:70" + }, + "nativeSrc": "16912:11:70", + "nodeType": "YulFunctionCall", + "src": "16912:11:70" + }, + { + "kind": "number", + "nativeSrc": "16925:1:70", + "nodeType": "YulLiteral", + "src": "16925:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "16908:3:70", + "nodeType": "YulIdentifier", + "src": "16908:3:70" + }, + "nativeSrc": "16908:19:70", + "nodeType": "YulFunctionCall", + "src": "16908:19:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "16896:3:70", + "nodeType": "YulIdentifier", + "src": "16896:3:70" + }, + "nativeSrc": "16896:32:70", + "nodeType": "YulFunctionCall", + "src": "16896:32:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "16869:6:70", + "nodeType": "YulIdentifier", + "src": "16869:6:70" + }, + "nativeSrc": "16869:60:70", + "nodeType": "YulFunctionCall", + "src": "16869:60:70" + }, + "nativeSrc": "16869:60:70", + "nodeType": "YulExpressionStatement", + "src": "16869:60:70" + } + ] + }, + "name": "abi_encode_tuple_t_address_t_address__to_t_address_t_address__fromStack_reversed", + "nativeSrc": "16635:300:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "16725:9:70", + "nodeType": "YulTypedName", + "src": "16725:9:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "16736:6:70", + "nodeType": "YulTypedName", + "src": "16736:6:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "16744:6:70", + "nodeType": "YulTypedName", + "src": "16744:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "16755:4:70", + "nodeType": "YulTypedName", + "src": "16755:4:70", + "type": "" + } + ], + "src": "16635:300:70" + }, + { + "body": { + "nativeSrc": "16999:77:70", + "nodeType": "YulBlock", + "src": "16999:77:70", + "statements": [ + { + "nativeSrc": "17009:22:70", + "nodeType": "YulAssignment", + "src": "17009:22:70", + "value": { + "arguments": [ + { + "name": "offset", + "nativeSrc": "17024:6:70", + "nodeType": "YulIdentifier", + "src": "17024:6:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "17018:5:70", + "nodeType": "YulIdentifier", + "src": "17018:5:70" + }, + "nativeSrc": "17018:13:70", + "nodeType": "YulFunctionCall", + "src": "17018:13:70" + }, + "variableNames": [ + { + "name": "value", + "nativeSrc": "17009:5:70", + "nodeType": "YulIdentifier", + "src": "17009:5:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "value", + "nativeSrc": "17064:5:70", + "nodeType": "YulIdentifier", + "src": "17064:5:70" + } + ], + "functionName": { + "name": "validator_revert_uint32", + "nativeSrc": "17040:23:70", + "nodeType": "YulIdentifier", + "src": "17040:23:70" + }, + "nativeSrc": "17040:30:70", + "nodeType": "YulFunctionCall", + "src": "17040:30:70" + }, + "nativeSrc": "17040:30:70", + "nodeType": "YulExpressionStatement", + "src": "17040:30:70" + } + ] + }, + "name": "abi_decode_uint32_fromMemory", + "nativeSrc": "16940:136:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "offset", + "nativeSrc": "16978:6:70", + "nodeType": "YulTypedName", + "src": "16978:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value", + "nativeSrc": "16989:5:70", + "nodeType": "YulTypedName", + "src": "16989:5:70", + "type": "" + } + ], + "src": "16940:136:70" + }, + { + "body": { + "nativeSrc": "17140:77:70", + "nodeType": "YulBlock", + "src": "17140:77:70", + "statements": [ + { + "nativeSrc": "17150:22:70", + "nodeType": "YulAssignment", + "src": "17150:22:70", + "value": { + "arguments": [ + { + "name": "offset", + "nativeSrc": "17165:6:70", + "nodeType": "YulIdentifier", + "src": "17165:6:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "17159:5:70", + "nodeType": "YulIdentifier", + "src": "17159:5:70" + }, + "nativeSrc": "17159:13:70", + "nodeType": "YulFunctionCall", + "src": "17159:13:70" + }, + "variableNames": [ + { + "name": "value", + "nativeSrc": "17150:5:70", + "nodeType": "YulIdentifier", + "src": "17150:5:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "value", + "nativeSrc": "17205:5:70", + "nodeType": "YulIdentifier", + "src": "17205:5:70" + } + ], + "functionName": { + "name": "validator_revert_uint64", + "nativeSrc": "17181:23:70", + "nodeType": "YulIdentifier", + "src": "17181:23:70" + }, + "nativeSrc": "17181:30:70", + "nodeType": "YulFunctionCall", + "src": "17181:30:70" + }, + "nativeSrc": "17181:30:70", + "nodeType": "YulExpressionStatement", + "src": "17181:30:70" + } + ] + }, + "name": "abi_decode_uint64_fromMemory", + "nativeSrc": "17081:136:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "offset", + "nativeSrc": "17119:6:70", + "nodeType": "YulTypedName", + "src": "17119:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value", + "nativeSrc": "17130:5:70", + "nodeType": "YulTypedName", + "src": "17130:5:70", + "type": "" + } + ], + "src": "17081:136:70" + }, + { + "body": { + "nativeSrc": "17330:1128:70", + "nodeType": "YulBlock", + "src": "17330:1128:70", + "statements": [ + { + "nativeSrc": "17340:43:70", + "nodeType": "YulVariableDeclaration", + "src": "17340:43:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "dataEnd", + "nativeSrc": "17358:7:70", + "nodeType": "YulIdentifier", + "src": "17358:7:70" + }, + { + "name": "headStart", + "nativeSrc": "17367:9:70", + "nodeType": "YulIdentifier", + "src": "17367:9:70" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "17354:3:70", + "nodeType": "YulIdentifier", + "src": "17354:3:70" + }, + "nativeSrc": "17354:23:70", + "nodeType": "YulFunctionCall", + "src": "17354:23:70" + }, + { + "kind": "number", + "nativeSrc": "17379:3:70", + "nodeType": "YulLiteral", + "src": "17379:3:70", + "type": "", + "value": "320" + } + ], + "functionName": { + "name": "slt", + "nativeSrc": "17350:3:70", + "nodeType": "YulIdentifier", + "src": "17350:3:70" + }, + "nativeSrc": "17350:33:70", + "nodeType": "YulFunctionCall", + "src": "17350:33:70" + }, + "variables": [ + { + "name": "_1", + "nativeSrc": "17344:2:70", + "nodeType": "YulTypedName", + "src": "17344:2:70", + "type": "" + } + ] + }, + { + "body": { + "nativeSrc": "17398:16:70", + "nodeType": "YulBlock", + "src": "17398:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "17407:1:70", + "nodeType": "YulLiteral", + "src": "17407:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "17410:1:70", + "nodeType": "YulLiteral", + "src": "17410:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "17400:6:70", + "nodeType": "YulIdentifier", + "src": "17400:6:70" + }, + "nativeSrc": "17400:12:70", + "nodeType": "YulFunctionCall", + "src": "17400:12:70" + }, + "nativeSrc": "17400:12:70", + "nodeType": "YulExpressionStatement", + "src": "17400:12:70" + } + ] + }, + "condition": { + "name": "_1", + "nativeSrc": "17395:2:70", + "nodeType": "YulIdentifier", + "src": "17395:2:70" + }, + "nativeSrc": "17392:22:70", + "nodeType": "YulIf", + "src": "17392:22:70" + }, + { + "nativeSrc": "17423:7:70", + "nodeType": "YulAssignment", + "src": "17423:7:70", + "value": { + "kind": "number", + "nativeSrc": "17429:1:70", + "nodeType": "YulLiteral", + "src": "17429:1:70", + "type": "", + "value": "0" + }, + "variableNames": [ + { + "name": "_1", + "nativeSrc": "17423:2:70", + "nodeType": "YulIdentifier", + "src": "17423:2:70" + } + ] + }, + { + "nativeSrc": "17439:35:70", + "nodeType": "YulVariableDeclaration", + "src": "17439:35:70", + "value": { + "arguments": [], + "functionName": { + "name": "allocate_memory_2392", + "nativeSrc": "17452:20:70", + "nodeType": "YulIdentifier", + "src": "17452:20:70" + }, + "nativeSrc": "17452:22:70", + "nodeType": "YulFunctionCall", + "src": "17452:22:70" + }, + "variables": [ + { + "name": "value", + "nativeSrc": "17443:5:70", + "nodeType": "YulTypedName", + "src": "17443:5:70", + "type": "" + } + ] + }, + { + "nativeSrc": "17483:17:70", + "nodeType": "YulVariableDeclaration", + "src": "17483:17:70", + "value": { + "name": "_1", + "nativeSrc": "17498:2:70", + "nodeType": "YulIdentifier", + "src": "17498:2:70" + }, + "variables": [ + { + "name": "value_1", + "nativeSrc": "17487:7:70", + "nodeType": "YulTypedName", + "src": "17487:7:70", + "type": "" + } + ] + }, + { + "nativeSrc": "17509:27:70", + "nodeType": "YulAssignment", + "src": "17509:27:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "17526:9:70", + "nodeType": "YulIdentifier", + "src": "17526:9:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "17520:5:70", + "nodeType": "YulIdentifier", + "src": "17520:5:70" + }, + "nativeSrc": "17520:16:70", + "nodeType": "YulFunctionCall", + "src": "17520:16:70" + }, + "variableNames": [ + { + "name": "value_1", + "nativeSrc": "17509:7:70", + "nodeType": "YulIdentifier", + "src": "17509:7:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "value", + "nativeSrc": "17552:5:70", + "nodeType": "YulIdentifier", + "src": "17552:5:70" + }, + { + "name": "value_1", + "nativeSrc": "17559:7:70", + "nodeType": "YulIdentifier", + "src": "17559:7:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "17545:6:70", + "nodeType": "YulIdentifier", + "src": "17545:6:70" + }, + "nativeSrc": "17545:22:70", + "nodeType": "YulFunctionCall", + "src": "17545:22:70" + }, + "nativeSrc": "17545:22:70", + "nodeType": "YulExpressionStatement", + "src": "17545:22:70" + }, + { + "nativeSrc": "17576:17:70", + "nodeType": "YulVariableDeclaration", + "src": "17576:17:70", + "value": { + "name": "_1", + "nativeSrc": "17591:2:70", + "nodeType": "YulIdentifier", + "src": "17591:2:70" + }, + "variables": [ + { + "name": "value_2", + "nativeSrc": "17580:7:70", + "nodeType": "YulTypedName", + "src": "17580:7:70", + "type": "" + } + ] + }, + { + "nativeSrc": "17602:36:70", + "nodeType": "YulAssignment", + "src": "17602:36:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "17623:9:70", + "nodeType": "YulIdentifier", + "src": "17623:9:70" + }, + { + "kind": "number", + "nativeSrc": "17634:2:70", + "nodeType": "YulLiteral", + "src": "17634:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "17619:3:70", + "nodeType": "YulIdentifier", + "src": "17619:3:70" + }, + "nativeSrc": "17619:18:70", + "nodeType": "YulFunctionCall", + "src": "17619:18:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "17613:5:70", + "nodeType": "YulIdentifier", + "src": "17613:5:70" + }, + "nativeSrc": "17613:25:70", + "nodeType": "YulFunctionCall", + "src": "17613:25:70" + }, + "variableNames": [ + { + "name": "value_2", + "nativeSrc": "17602:7:70", + "nodeType": "YulIdentifier", + "src": "17602:7:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "value", + "nativeSrc": "17658:5:70", + "nodeType": "YulIdentifier", + "src": "17658:5:70" + }, + { + "kind": "number", + "nativeSrc": "17665:2:70", + "nodeType": "YulLiteral", + "src": "17665:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "17654:3:70", + "nodeType": "YulIdentifier", + "src": "17654:3:70" + }, + "nativeSrc": "17654:14:70", + "nodeType": "YulFunctionCall", + "src": "17654:14:70" + }, + { + "name": "value_2", + "nativeSrc": "17670:7:70", + "nodeType": "YulIdentifier", + "src": "17670:7:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "17647:6:70", + "nodeType": "YulIdentifier", + "src": "17647:6:70" + }, + "nativeSrc": "17647:31:70", + "nodeType": "YulFunctionCall", + "src": "17647:31:70" + }, + "nativeSrc": "17647:31:70", + "nodeType": "YulExpressionStatement", + "src": "17647:31:70" + }, + { + "nativeSrc": "17687:17:70", + "nodeType": "YulVariableDeclaration", + "src": "17687:17:70", + "value": { + "name": "_1", + "nativeSrc": "17702:2:70", + "nodeType": "YulIdentifier", + "src": "17702:2:70" + }, + "variables": [ + { + "name": "value_3", + "nativeSrc": "17691:7:70", + "nodeType": "YulTypedName", + "src": "17691:7:70", + "type": "" + } + ] + }, + { + "nativeSrc": "17713:36:70", + "nodeType": "YulAssignment", + "src": "17713:36:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "17734:9:70", + "nodeType": "YulIdentifier", + "src": "17734:9:70" + }, + { + "kind": "number", + "nativeSrc": "17745:2:70", + "nodeType": "YulLiteral", + "src": "17745:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "17730:3:70", + "nodeType": "YulIdentifier", + "src": "17730:3:70" + }, + "nativeSrc": "17730:18:70", + "nodeType": "YulFunctionCall", + "src": "17730:18:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "17724:5:70", + "nodeType": "YulIdentifier", + "src": "17724:5:70" + }, + "nativeSrc": "17724:25:70", + "nodeType": "YulFunctionCall", + "src": "17724:25:70" + }, + "variableNames": [ + { + "name": "value_3", + "nativeSrc": "17713:7:70", + "nodeType": "YulIdentifier", + "src": "17713:7:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "value", + "nativeSrc": "17769:5:70", + "nodeType": "YulIdentifier", + "src": "17769:5:70" + }, + { + "kind": "number", + "nativeSrc": "17776:2:70", + "nodeType": "YulLiteral", + "src": "17776:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "17765:3:70", + "nodeType": "YulIdentifier", + "src": "17765:3:70" + }, + "nativeSrc": "17765:14:70", + "nodeType": "YulFunctionCall", + "src": "17765:14:70" + }, + { + "name": "value_3", + "nativeSrc": "17781:7:70", + "nodeType": "YulIdentifier", + "src": "17781:7:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "17758:6:70", + "nodeType": "YulIdentifier", + "src": "17758:6:70" + }, + "nativeSrc": "17758:31:70", + "nodeType": "YulFunctionCall", + "src": "17758:31:70" + }, + "nativeSrc": "17758:31:70", + "nodeType": "YulExpressionStatement", + "src": "17758:31:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "value", + "nativeSrc": "17809:5:70", + "nodeType": "YulIdentifier", + "src": "17809:5:70" + }, + { + "kind": "number", + "nativeSrc": "17816:2:70", + "nodeType": "YulLiteral", + "src": "17816:2:70", + "type": "", + "value": "96" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "17805:3:70", + "nodeType": "YulIdentifier", + "src": "17805:3:70" + }, + "nativeSrc": "17805:14:70", + "nodeType": "YulFunctionCall", + "src": "17805:14:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "17854:9:70", + "nodeType": "YulIdentifier", + "src": "17854:9:70" + }, + { + "kind": "number", + "nativeSrc": "17865:2:70", + "nodeType": "YulLiteral", + "src": "17865:2:70", + "type": "", + "value": "96" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "17850:3:70", + "nodeType": "YulIdentifier", + "src": "17850:3:70" + }, + "nativeSrc": "17850:18:70", + "nodeType": "YulFunctionCall", + "src": "17850:18:70" + } + ], + "functionName": { + "name": "abi_decode_uint32_fromMemory", + "nativeSrc": "17821:28:70", + "nodeType": "YulIdentifier", + "src": "17821:28:70" + }, + "nativeSrc": "17821:48:70", + "nodeType": "YulFunctionCall", + "src": "17821:48:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "17798:6:70", + "nodeType": "YulIdentifier", + "src": "17798:6:70" + }, + "nativeSrc": "17798:72:70", + "nodeType": "YulFunctionCall", + "src": "17798:72:70" + }, + "nativeSrc": "17798:72:70", + "nodeType": "YulExpressionStatement", + "src": "17798:72:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "value", + "nativeSrc": "17890:5:70", + "nodeType": "YulIdentifier", + "src": "17890:5:70" + }, + { + "kind": "number", + "nativeSrc": "17897:3:70", + "nodeType": "YulLiteral", + "src": "17897:3:70", + "type": "", + "value": "128" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "17886:3:70", + "nodeType": "YulIdentifier", + "src": "17886:3:70" + }, + "nativeSrc": "17886:15:70", + "nodeType": "YulFunctionCall", + "src": "17886:15:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "17936:9:70", + "nodeType": "YulIdentifier", + "src": "17936:9:70" + }, + { + "kind": "number", + "nativeSrc": "17947:3:70", + "nodeType": "YulLiteral", + "src": "17947:3:70", + "type": "", + "value": "128" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "17932:3:70", + "nodeType": "YulIdentifier", + "src": "17932:3:70" + }, + "nativeSrc": "17932:19:70", + "nodeType": "YulFunctionCall", + "src": "17932:19:70" + } + ], + "functionName": { + "name": "abi_decode_uint64_fromMemory", + "nativeSrc": "17903:28:70", + "nodeType": "YulIdentifier", + "src": "17903:28:70" + }, + "nativeSrc": "17903:49:70", + "nodeType": "YulFunctionCall", + "src": "17903:49:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "17879:6:70", + "nodeType": "YulIdentifier", + "src": "17879:6:70" + }, + "nativeSrc": "17879:74:70", + "nodeType": "YulFunctionCall", + "src": "17879:74:70" + }, + "nativeSrc": "17879:74:70", + "nodeType": "YulExpressionStatement", + "src": "17879:74:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "value", + "nativeSrc": "17973:5:70", + "nodeType": "YulIdentifier", + "src": "17973:5:70" + }, + { + "kind": "number", + "nativeSrc": "17980:3:70", + "nodeType": "YulLiteral", + "src": "17980:3:70", + "type": "", + "value": "160" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "17969:3:70", + "nodeType": "YulIdentifier", + "src": "17969:3:70" + }, + "nativeSrc": "17969:15:70", + "nodeType": "YulFunctionCall", + "src": "17969:15:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "18019:9:70", + "nodeType": "YulIdentifier", + "src": "18019:9:70" + }, + { + "kind": "number", + "nativeSrc": "18030:3:70", + "nodeType": "YulLiteral", + "src": "18030:3:70", + "type": "", + "value": "160" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "18015:3:70", + "nodeType": "YulIdentifier", + "src": "18015:3:70" + }, + "nativeSrc": "18015:19:70", + "nodeType": "YulFunctionCall", + "src": "18015:19:70" + } + ], + "functionName": { + "name": "abi_decode_uint64_fromMemory", + "nativeSrc": "17986:28:70", + "nodeType": "YulIdentifier", + "src": "17986:28:70" + }, + "nativeSrc": "17986:49:70", + "nodeType": "YulFunctionCall", + "src": "17986:49:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "17962:6:70", + "nodeType": "YulIdentifier", + "src": "17962:6:70" + }, + "nativeSrc": "17962:74:70", + "nodeType": "YulFunctionCall", + "src": "17962:74:70" + }, + "nativeSrc": "17962:74:70", + "nodeType": "YulExpressionStatement", + "src": "17962:74:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "value", + "nativeSrc": "18056:5:70", + "nodeType": "YulIdentifier", + "src": "18056:5:70" + }, + { + "kind": "number", + "nativeSrc": "18063:3:70", + "nodeType": "YulLiteral", + "src": "18063:3:70", + "type": "", + "value": "192" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "18052:3:70", + "nodeType": "YulIdentifier", + "src": "18052:3:70" + }, + "nativeSrc": "18052:15:70", + "nodeType": "YulFunctionCall", + "src": "18052:15:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "18102:9:70", + "nodeType": "YulIdentifier", + "src": "18102:9:70" + }, + { + "kind": "number", + "nativeSrc": "18113:3:70", + "nodeType": "YulLiteral", + "src": "18113:3:70", + "type": "", + "value": "192" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "18098:3:70", + "nodeType": "YulIdentifier", + "src": "18098:3:70" + }, + "nativeSrc": "18098:19:70", + "nodeType": "YulFunctionCall", + "src": "18098:19:70" + } + ], + "functionName": { + "name": "abi_decode_uint32_fromMemory", + "nativeSrc": "18069:28:70", + "nodeType": "YulIdentifier", + "src": "18069:28:70" + }, + "nativeSrc": "18069:49:70", + "nodeType": "YulFunctionCall", + "src": "18069:49:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "18045:6:70", + "nodeType": "YulIdentifier", + "src": "18045:6:70" + }, + "nativeSrc": "18045:74:70", + "nodeType": "YulFunctionCall", + "src": "18045:74:70" + }, + "nativeSrc": "18045:74:70", + "nodeType": "YulExpressionStatement", + "src": "18045:74:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "value", + "nativeSrc": "18139:5:70", + "nodeType": "YulIdentifier", + "src": "18139:5:70" + }, + { + "kind": "number", + "nativeSrc": "18146:3:70", + "nodeType": "YulLiteral", + "src": "18146:3:70", + "type": "", + "value": "224" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "18135:3:70", + "nodeType": "YulIdentifier", + "src": "18135:3:70" + }, + "nativeSrc": "18135:15:70", + "nodeType": "YulFunctionCall", + "src": "18135:15:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "18185:9:70", + "nodeType": "YulIdentifier", + "src": "18185:9:70" + }, + { + "kind": "number", + "nativeSrc": "18196:3:70", + "nodeType": "YulLiteral", + "src": "18196:3:70", + "type": "", + "value": "224" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "18181:3:70", + "nodeType": "YulIdentifier", + "src": "18181:3:70" + }, + "nativeSrc": "18181:19:70", + "nodeType": "YulFunctionCall", + "src": "18181:19:70" + } + ], + "functionName": { + "name": "abi_decode_uint64_fromMemory", + "nativeSrc": "18152:28:70", + "nodeType": "YulIdentifier", + "src": "18152:28:70" + }, + "nativeSrc": "18152:49:70", + "nodeType": "YulFunctionCall", + "src": "18152:49:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "18128:6:70", + "nodeType": "YulIdentifier", + "src": "18128:6:70" + }, + "nativeSrc": "18128:74:70", + "nodeType": "YulFunctionCall", + "src": "18128:74:70" + }, + "nativeSrc": "18128:74:70", + "nodeType": "YulExpressionStatement", + "src": "18128:74:70" + }, + { + "nativeSrc": "18211:17:70", + "nodeType": "YulVariableDeclaration", + "src": "18211:17:70", + "value": { + "name": "_1", + "nativeSrc": "18226:2:70", + "nodeType": "YulIdentifier", + "src": "18226:2:70" + }, + "variables": [ + { + "name": "value_4", + "nativeSrc": "18215:7:70", + "nodeType": "YulTypedName", + "src": "18215:7:70", + "type": "" + } + ] + }, + { + "nativeSrc": "18237:37:70", + "nodeType": "YulAssignment", + "src": "18237:37:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "18258:9:70", + "nodeType": "YulIdentifier", + "src": "18258:9:70" + }, + { + "kind": "number", + "nativeSrc": "18269:3:70", + "nodeType": "YulLiteral", + "src": "18269:3:70", + "type": "", + "value": "256" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "18254:3:70", + "nodeType": "YulIdentifier", + "src": "18254:3:70" + }, + "nativeSrc": "18254:19:70", + "nodeType": "YulFunctionCall", + "src": "18254:19:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "18248:5:70", + "nodeType": "YulIdentifier", + "src": "18248:5:70" + }, + "nativeSrc": "18248:26:70", + "nodeType": "YulFunctionCall", + "src": "18248:26:70" + }, + "variableNames": [ + { + "name": "value_4", + "nativeSrc": "18237:7:70", + "nodeType": "YulIdentifier", + "src": "18237:7:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "value", + "nativeSrc": "18294:5:70", + "nodeType": "YulIdentifier", + "src": "18294:5:70" + }, + { + "kind": "number", + "nativeSrc": "18301:3:70", + "nodeType": "YulLiteral", + "src": "18301:3:70", + "type": "", + "value": "256" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "18290:3:70", + "nodeType": "YulIdentifier", + "src": "18290:3:70" + }, + "nativeSrc": "18290:15:70", + "nodeType": "YulFunctionCall", + "src": "18290:15:70" + }, + { + "name": "value_4", + "nativeSrc": "18307:7:70", + "nodeType": "YulIdentifier", + "src": "18307:7:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "18283:6:70", + "nodeType": "YulIdentifier", + "src": "18283:6:70" + }, + "nativeSrc": "18283:32:70", + "nodeType": "YulFunctionCall", + "src": "18283:32:70" + }, + "nativeSrc": "18283:32:70", + "nodeType": "YulExpressionStatement", + "src": "18283:32:70" + }, + { + "nativeSrc": "18324:17:70", + "nodeType": "YulVariableDeclaration", + "src": "18324:17:70", + "value": { + "name": "_1", + "nativeSrc": "18339:2:70", + "nodeType": "YulIdentifier", + "src": "18339:2:70" + }, + "variables": [ + { + "name": "value_5", + "nativeSrc": "18328:7:70", + "nodeType": "YulTypedName", + "src": "18328:7:70", + "type": "" + } + ] + }, + { + "nativeSrc": "18350:37:70", + "nodeType": "YulAssignment", + "src": "18350:37:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "18371:9:70", + "nodeType": "YulIdentifier", + "src": "18371:9:70" + }, + { + "kind": "number", + "nativeSrc": "18382:3:70", + "nodeType": "YulLiteral", + "src": "18382:3:70", + "type": "", + "value": "288" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "18367:3:70", + "nodeType": "YulIdentifier", + "src": "18367:3:70" + }, + "nativeSrc": "18367:19:70", + "nodeType": "YulFunctionCall", + "src": "18367:19:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "18361:5:70", + "nodeType": "YulIdentifier", + "src": "18361:5:70" + }, + "nativeSrc": "18361:26:70", + "nodeType": "YulFunctionCall", + "src": "18361:26:70" + }, + "variableNames": [ + { + "name": "value_5", + "nativeSrc": "18350:7:70", + "nodeType": "YulIdentifier", + "src": "18350:7:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "value", + "nativeSrc": "18407:5:70", + "nodeType": "YulIdentifier", + "src": "18407:5:70" + }, + { + "kind": "number", + "nativeSrc": "18414:3:70", + "nodeType": "YulLiteral", + "src": "18414:3:70", + "type": "", + "value": "288" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "18403:3:70", + "nodeType": "YulIdentifier", + "src": "18403:3:70" + }, + "nativeSrc": "18403:15:70", + "nodeType": "YulFunctionCall", + "src": "18403:15:70" + }, + { + "name": "value_5", + "nativeSrc": "18420:7:70", + "nodeType": "YulIdentifier", + "src": "18420:7:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "18396:6:70", + "nodeType": "YulIdentifier", + "src": "18396:6:70" + }, + "nativeSrc": "18396:32:70", + "nodeType": "YulFunctionCall", + "src": "18396:32:70" + }, + "nativeSrc": "18396:32:70", + "nodeType": "YulExpressionStatement", + "src": "18396:32:70" + }, + { + "nativeSrc": "18437:15:70", + "nodeType": "YulAssignment", + "src": "18437:15:70", + "value": { + "name": "value", + "nativeSrc": "18447:5:70", + "nodeType": "YulIdentifier", + "src": "18447:5:70" + }, + "variableNames": [ + { + "name": "value0", + "nativeSrc": "18437:6:70", + "nodeType": "YulIdentifier", + "src": "18437:6:70" + } + ] + } + ] + }, + "name": "abi_decode_tuple_t_struct$_Provision_$3962_memory_ptr_fromMemory", + "nativeSrc": "17222:1236:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "17296:9:70", + "nodeType": "YulTypedName", + "src": "17296:9:70", + "type": "" + }, + { + "name": "dataEnd", + "nativeSrc": "17307:7:70", + "nodeType": "YulTypedName", + "src": "17307:7:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value0", + "nativeSrc": "17319:6:70", + "nodeType": "YulTypedName", + "src": "17319:6:70", + "type": "" + } + ], + "src": "17222:1236:70" + }, + { + "body": { + "nativeSrc": "18704:294:70", + "nodeType": "YulBlock", + "src": "18704:294:70", + "statements": [ + { + "nativeSrc": "18714:27:70", + "nodeType": "YulAssignment", + "src": "18714:27:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "18726:9:70", + "nodeType": "YulIdentifier", + "src": "18726:9:70" + }, + { + "kind": "number", + "nativeSrc": "18737:3:70", + "nodeType": "YulLiteral", + "src": "18737:3:70", + "type": "", + "value": "192" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "18722:3:70", + "nodeType": "YulIdentifier", + "src": "18722:3:70" + }, + "nativeSrc": "18722:19:70", + "nodeType": "YulFunctionCall", + "src": "18722:19:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "18714:4:70", + "nodeType": "YulIdentifier", + "src": "18714:4:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "18757:9:70", + "nodeType": "YulIdentifier", + "src": "18757:9:70" + }, + { + "name": "value0", + "nativeSrc": "18768:6:70", + "nodeType": "YulIdentifier", + "src": "18768:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "18750:6:70", + "nodeType": "YulIdentifier", + "src": "18750:6:70" + }, + "nativeSrc": "18750:25:70", + "nodeType": "YulFunctionCall", + "src": "18750:25:70" + }, + "nativeSrc": "18750:25:70", + "nodeType": "YulExpressionStatement", + "src": "18750:25:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "18795:9:70", + "nodeType": "YulIdentifier", + "src": "18795:9:70" + }, + { + "kind": "number", + "nativeSrc": "18806:2:70", + "nodeType": "YulLiteral", + "src": "18806:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "18791:3:70", + "nodeType": "YulIdentifier", + "src": "18791:3:70" + }, + "nativeSrc": "18791:18:70", + "nodeType": "YulFunctionCall", + "src": "18791:18:70" + }, + { + "name": "value1", + "nativeSrc": "18811:6:70", + "nodeType": "YulIdentifier", + "src": "18811:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "18784:6:70", + "nodeType": "YulIdentifier", + "src": "18784:6:70" + }, + "nativeSrc": "18784:34:70", + "nodeType": "YulFunctionCall", + "src": "18784:34:70" + }, + "nativeSrc": "18784:34:70", + "nodeType": "YulExpressionStatement", + "src": "18784:34:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "18838:9:70", + "nodeType": "YulIdentifier", + "src": "18838:9:70" + }, + { + "kind": "number", + "nativeSrc": "18849:2:70", + "nodeType": "YulLiteral", + "src": "18849:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "18834:3:70", + "nodeType": "YulIdentifier", + "src": "18834:3:70" + }, + "nativeSrc": "18834:18:70", + "nodeType": "YulFunctionCall", + "src": "18834:18:70" + }, + { + "name": "value2", + "nativeSrc": "18854:6:70", + "nodeType": "YulIdentifier", + "src": "18854:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "18827:6:70", + "nodeType": "YulIdentifier", + "src": "18827:6:70" + }, + "nativeSrc": "18827:34:70", + "nodeType": "YulFunctionCall", + "src": "18827:34:70" + }, + "nativeSrc": "18827:34:70", + "nodeType": "YulExpressionStatement", + "src": "18827:34:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "18881:9:70", + "nodeType": "YulIdentifier", + "src": "18881:9:70" + }, + { + "kind": "number", + "nativeSrc": "18892:2:70", + "nodeType": "YulLiteral", + "src": "18892:2:70", + "type": "", + "value": "96" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "18877:3:70", + "nodeType": "YulIdentifier", + "src": "18877:3:70" + }, + "nativeSrc": "18877:18:70", + "nodeType": "YulFunctionCall", + "src": "18877:18:70" + }, + { + "name": "value3", + "nativeSrc": "18897:6:70", + "nodeType": "YulIdentifier", + "src": "18897:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "18870:6:70", + "nodeType": "YulIdentifier", + "src": "18870:6:70" + }, + "nativeSrc": "18870:34:70", + "nodeType": "YulFunctionCall", + "src": "18870:34:70" + }, + "nativeSrc": "18870:34:70", + "nodeType": "YulExpressionStatement", + "src": "18870:34:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "18924:9:70", + "nodeType": "YulIdentifier", + "src": "18924:9:70" + }, + { + "kind": "number", + "nativeSrc": "18935:3:70", + "nodeType": "YulLiteral", + "src": "18935:3:70", + "type": "", + "value": "128" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "18920:3:70", + "nodeType": "YulIdentifier", + "src": "18920:3:70" + }, + "nativeSrc": "18920:19:70", + "nodeType": "YulFunctionCall", + "src": "18920:19:70" + }, + { + "name": "value4", + "nativeSrc": "18941:6:70", + "nodeType": "YulIdentifier", + "src": "18941:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "18913:6:70", + "nodeType": "YulIdentifier", + "src": "18913:6:70" + }, + "nativeSrc": "18913:35:70", + "nodeType": "YulFunctionCall", + "src": "18913:35:70" + }, + "nativeSrc": "18913:35:70", + "nodeType": "YulExpressionStatement", + "src": "18913:35:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "18968:9:70", + "nodeType": "YulIdentifier", + "src": "18968:9:70" + }, + { + "kind": "number", + "nativeSrc": "18979:3:70", + "nodeType": "YulLiteral", + "src": "18979:3:70", + "type": "", + "value": "160" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "18964:3:70", + "nodeType": "YulIdentifier", + "src": "18964:3:70" + }, + "nativeSrc": "18964:19:70", + "nodeType": "YulFunctionCall", + "src": "18964:19:70" + }, + { + "name": "value5", + "nativeSrc": "18985:6:70", + "nodeType": "YulIdentifier", + "src": "18985:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "18957:6:70", + "nodeType": "YulIdentifier", + "src": "18957:6:70" + }, + "nativeSrc": "18957:35:70", + "nodeType": "YulFunctionCall", + "src": "18957:35:70" + }, + "nativeSrc": "18957:35:70", + "nodeType": "YulExpressionStatement", + "src": "18957:35:70" + } + ] + }, + "name": "abi_encode_tuple_t_bytes32_t_bytes32_t_bytes32_t_bytes32_t_bytes32_t_bytes32__to_t_bytes32_t_bytes32_t_bytes32_t_bytes32_t_bytes32_t_bytes32__fromStack_reversed", + "nativeSrc": "18463:535:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "18633:9:70", + "nodeType": "YulTypedName", + "src": "18633:9:70", + "type": "" + }, + { + "name": "value5", + "nativeSrc": "18644:6:70", + "nodeType": "YulTypedName", + "src": "18644:6:70", + "type": "" + }, + { + "name": "value4", + "nativeSrc": "18652:6:70", + "nodeType": "YulTypedName", + "src": "18652:6:70", + "type": "" + }, + { + "name": "value3", + "nativeSrc": "18660:6:70", + "nodeType": "YulTypedName", + "src": "18660:6:70", + "type": "" + }, + { + "name": "value2", + "nativeSrc": "18668:6:70", + "nodeType": "YulTypedName", + "src": "18668:6:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "18676:6:70", + "nodeType": "YulTypedName", + "src": "18676:6:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "18684:6:70", + "nodeType": "YulTypedName", + "src": "18684:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "18695:4:70", + "nodeType": "YulTypedName", + "src": "18695:4:70", + "type": "" + } + ], + "src": "18463:535:70" + }, + { + "body": { + "nativeSrc": "19049:171:70", + "nodeType": "YulBlock", + "src": "19049:171:70", + "statements": [ + { + "body": { + "nativeSrc": "19080:111:70", + "nodeType": "YulBlock", + "src": "19080:111:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "19101:1:70", + "nodeType": "YulLiteral", + "src": "19101:1:70", + "type": "", + "value": "0" + }, + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "19108:3:70", + "nodeType": "YulLiteral", + "src": "19108:3:70", + "type": "", + "value": "224" + }, + { + "kind": "number", + "nativeSrc": "19113:10:70", + "nodeType": "YulLiteral", + "src": "19113:10:70", + "type": "", + "value": "0x4e487b71" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "19104:3:70", + "nodeType": "YulIdentifier", + "src": "19104:3:70" + }, + "nativeSrc": "19104:20:70", + "nodeType": "YulFunctionCall", + "src": "19104:20:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "19094:6:70", + "nodeType": "YulIdentifier", + "src": "19094:6:70" + }, + "nativeSrc": "19094:31:70", + "nodeType": "YulFunctionCall", + "src": "19094:31:70" + }, + "nativeSrc": "19094:31:70", + "nodeType": "YulExpressionStatement", + "src": "19094:31:70" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "19145:1:70", + "nodeType": "YulLiteral", + "src": "19145:1:70", + "type": "", + "value": "4" + }, + { + "kind": "number", + "nativeSrc": "19148:4:70", + "nodeType": "YulLiteral", + "src": "19148:4:70", + "type": "", + "value": "0x12" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "19138:6:70", + "nodeType": "YulIdentifier", + "src": "19138:6:70" + }, + "nativeSrc": "19138:15:70", + "nodeType": "YulFunctionCall", + "src": "19138:15:70" + }, + "nativeSrc": "19138:15:70", + "nodeType": "YulExpressionStatement", + "src": "19138:15:70" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "19173:1:70", + "nodeType": "YulLiteral", + "src": "19173:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "19176:4:70", + "nodeType": "YulLiteral", + "src": "19176:4:70", + "type": "", + "value": "0x24" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "19166:6:70", + "nodeType": "YulIdentifier", + "src": "19166:6:70" + }, + "nativeSrc": "19166:15:70", + "nodeType": "YulFunctionCall", + "src": "19166:15:70" + }, + "nativeSrc": "19166:15:70", + "nodeType": "YulExpressionStatement", + "src": "19166:15:70" + } + ] + }, + "condition": { + "arguments": [ + { + "name": "y", + "nativeSrc": "19069:1:70", + "nodeType": "YulIdentifier", + "src": "19069:1:70" + } + ], + "functionName": { + "name": "iszero", + "nativeSrc": "19062:6:70", + "nodeType": "YulIdentifier", + "src": "19062:6:70" + }, + "nativeSrc": "19062:9:70", + "nodeType": "YulFunctionCall", + "src": "19062:9:70" + }, + "nativeSrc": "19059:132:70", + "nodeType": "YulIf", + "src": "19059:132:70" + }, + { + "nativeSrc": "19200:14:70", + "nodeType": "YulAssignment", + "src": "19200:14:70", + "value": { + "arguments": [ + { + "name": "x", + "nativeSrc": "19209:1:70", + "nodeType": "YulIdentifier", + "src": "19209:1:70" + }, + { + "name": "y", + "nativeSrc": "19212:1:70", + "nodeType": "YulIdentifier", + "src": "19212:1:70" + } + ], + "functionName": { + "name": "div", + "nativeSrc": "19205:3:70", + "nodeType": "YulIdentifier", + "src": "19205:3:70" + }, + "nativeSrc": "19205:9:70", + "nodeType": "YulFunctionCall", + "src": "19205:9:70" + }, + "variableNames": [ + { + "name": "r", + "nativeSrc": "19200:1:70", + "nodeType": "YulIdentifier", + "src": "19200:1:70" + } + ] + } + ] + }, + "name": "checked_div_t_uint256", + "nativeSrc": "19003:217:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "x", + "nativeSrc": "19034:1:70", + "nodeType": "YulTypedName", + "src": "19034:1:70", + "type": "" + }, + { + "name": "y", + "nativeSrc": "19037:1:70", + "nodeType": "YulTypedName", + "src": "19037:1:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "r", + "nativeSrc": "19043:1:70", + "nodeType": "YulTypedName", + "src": "19043:1:70", + "type": "" + } + ], + "src": "19003:217:70" + }, + { + "body": { + "nativeSrc": "19330:147:70", + "nodeType": "YulBlock", + "src": "19330:147:70", + "statements": [ + { + "body": { + "nativeSrc": "19377:16:70", + "nodeType": "YulBlock", + "src": "19377:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "19386:1:70", + "nodeType": "YulLiteral", + "src": "19386:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "19389:1:70", + "nodeType": "YulLiteral", + "src": "19389:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "19379:6:70", + "nodeType": "YulIdentifier", + "src": "19379:6:70" + }, + "nativeSrc": "19379:12:70", + "nodeType": "YulFunctionCall", + "src": "19379:12:70" + }, + "nativeSrc": "19379:12:70", + "nodeType": "YulExpressionStatement", + "src": "19379:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "dataEnd", + "nativeSrc": "19351:7:70", + "nodeType": "YulIdentifier", + "src": "19351:7:70" + }, + { + "name": "headStart", + "nativeSrc": "19360:9:70", + "nodeType": "YulIdentifier", + "src": "19360:9:70" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "19347:3:70", + "nodeType": "YulIdentifier", + "src": "19347:3:70" + }, + "nativeSrc": "19347:23:70", + "nodeType": "YulFunctionCall", + "src": "19347:23:70" + }, + { + "kind": "number", + "nativeSrc": "19372:3:70", + "nodeType": "YulLiteral", + "src": "19372:3:70", + "type": "", + "value": "288" + } + ], + "functionName": { + "name": "slt", + "nativeSrc": "19343:3:70", + "nodeType": "YulIdentifier", + "src": "19343:3:70" + }, + "nativeSrc": "19343:33:70", + "nodeType": "YulFunctionCall", + "src": "19343:33:70" + }, + "nativeSrc": "19340:53:70", + "nodeType": "YulIf", + "src": "19340:53:70" + }, + { + "nativeSrc": "19402:69:70", + "nodeType": "YulAssignment", + "src": "19402:69:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "19452:9:70", + "nodeType": "YulIdentifier", + "src": "19452:9:70" + }, + { + "name": "dataEnd", + "nativeSrc": "19463:7:70", + "nodeType": "YulIdentifier", + "src": "19463:7:70" + } + ], + "functionName": { + "name": "abi_decode_struct_Allocation_fromMemory", + "nativeSrc": "19412:39:70", + "nodeType": "YulIdentifier", + "src": "19412:39:70" + }, + "nativeSrc": "19412:59:70", + "nodeType": "YulFunctionCall", + "src": "19412:59:70" + }, + "variableNames": [ + { + "name": "value0", + "nativeSrc": "19402:6:70", + "nodeType": "YulIdentifier", + "src": "19402:6:70" + } + ] + } + ] + }, + "name": "abi_decode_tuple_t_struct$_State_$15663_memory_ptr_fromMemory", + "nativeSrc": "19225:252:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "19296:9:70", + "nodeType": "YulTypedName", + "src": "19296:9:70", + "type": "" + }, + { + "name": "dataEnd", + "nativeSrc": "19307:7:70", + "nodeType": "YulTypedName", + "src": "19307:7:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value0", + "nativeSrc": "19319:6:70", + "nodeType": "YulTypedName", + "src": "19319:6:70", + "type": "" + } + ], + "src": "19225:252:70" + }, + { + "body": { + "nativeSrc": "19639:214:70", + "nodeType": "YulBlock", + "src": "19639:214:70", + "statements": [ + { + "nativeSrc": "19649:26:70", + "nodeType": "YulAssignment", + "src": "19649:26:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "19661:9:70", + "nodeType": "YulIdentifier", + "src": "19661:9:70" + }, + { + "kind": "number", + "nativeSrc": "19672:2:70", + "nodeType": "YulLiteral", + "src": "19672:2:70", + "type": "", + "value": "96" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "19657:3:70", + "nodeType": "YulIdentifier", + "src": "19657:3:70" + }, + "nativeSrc": "19657:18:70", + "nodeType": "YulFunctionCall", + "src": "19657:18:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "19649:4:70", + "nodeType": "YulIdentifier", + "src": "19649:4:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "19691:9:70", + "nodeType": "YulIdentifier", + "src": "19691:9:70" + }, + { + "arguments": [ + { + "name": "value0", + "nativeSrc": "19706:6:70", + "nodeType": "YulIdentifier", + "src": "19706:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "19722:3:70", + "nodeType": "YulLiteral", + "src": "19722:3:70", + "type": "", + "value": "160" + }, + { + "kind": "number", + "nativeSrc": "19727:1:70", + "nodeType": "YulLiteral", + "src": "19727:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "19718:3:70", + "nodeType": "YulIdentifier", + "src": "19718:3:70" + }, + "nativeSrc": "19718:11:70", + "nodeType": "YulFunctionCall", + "src": "19718:11:70" + }, + { + "kind": "number", + "nativeSrc": "19731:1:70", + "nodeType": "YulLiteral", + "src": "19731:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "19714:3:70", + "nodeType": "YulIdentifier", + "src": "19714:3:70" + }, + "nativeSrc": "19714:19:70", + "nodeType": "YulFunctionCall", + "src": "19714:19:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "19702:3:70", + "nodeType": "YulIdentifier", + "src": "19702:3:70" + }, + "nativeSrc": "19702:32:70", + "nodeType": "YulFunctionCall", + "src": "19702:32:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "19684:6:70", + "nodeType": "YulIdentifier", + "src": "19684:6:70" + }, + "nativeSrc": "19684:51:70", + "nodeType": "YulFunctionCall", + "src": "19684:51:70" + }, + "nativeSrc": "19684:51:70", + "nodeType": "YulExpressionStatement", + "src": "19684:51:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "19755:9:70", + "nodeType": "YulIdentifier", + "src": "19755:9:70" + }, + { + "kind": "number", + "nativeSrc": "19766:2:70", + "nodeType": "YulLiteral", + "src": "19766:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "19751:3:70", + "nodeType": "YulIdentifier", + "src": "19751:3:70" + }, + "nativeSrc": "19751:18:70", + "nodeType": "YulFunctionCall", + "src": "19751:18:70" + }, + { + "arguments": [ + { + "name": "value1", + "nativeSrc": "19775:6:70", + "nodeType": "YulIdentifier", + "src": "19775:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "19791:3:70", + "nodeType": "YulLiteral", + "src": "19791:3:70", + "type": "", + "value": "160" + }, + { + "kind": "number", + "nativeSrc": "19796:1:70", + "nodeType": "YulLiteral", + "src": "19796:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "19787:3:70", + "nodeType": "YulIdentifier", + "src": "19787:3:70" + }, + "nativeSrc": "19787:11:70", + "nodeType": "YulFunctionCall", + "src": "19787:11:70" + }, + { + "kind": "number", + "nativeSrc": "19800:1:70", + "nodeType": "YulLiteral", + "src": "19800:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "19783:3:70", + "nodeType": "YulIdentifier", + "src": "19783:3:70" + }, + "nativeSrc": "19783:19:70", + "nodeType": "YulFunctionCall", + "src": "19783:19:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "19771:3:70", + "nodeType": "YulIdentifier", + "src": "19771:3:70" + }, + "nativeSrc": "19771:32:70", + "nodeType": "YulFunctionCall", + "src": "19771:32:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "19744:6:70", + "nodeType": "YulIdentifier", + "src": "19744:6:70" + }, + "nativeSrc": "19744:60:70", + "nodeType": "YulFunctionCall", + "src": "19744:60:70" + }, + "nativeSrc": "19744:60:70", + "nodeType": "YulExpressionStatement", + "src": "19744:60:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "19824:9:70", + "nodeType": "YulIdentifier", + "src": "19824:9:70" + }, + { + "kind": "number", + "nativeSrc": "19835:2:70", + "nodeType": "YulLiteral", + "src": "19835:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "19820:3:70", + "nodeType": "YulIdentifier", + "src": "19820:3:70" + }, + "nativeSrc": "19820:18:70", + "nodeType": "YulFunctionCall", + "src": "19820:18:70" + }, + { + "name": "value2", + "nativeSrc": "19840:6:70", + "nodeType": "YulIdentifier", + "src": "19840:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "19813:6:70", + "nodeType": "YulIdentifier", + "src": "19813:6:70" + }, + "nativeSrc": "19813:34:70", + "nodeType": "YulFunctionCall", + "src": "19813:34:70" + }, + "nativeSrc": "19813:34:70", + "nodeType": "YulExpressionStatement", + "src": "19813:34:70" + } + ] + }, + "name": "abi_encode_tuple_t_address_t_address_t_uint256__to_t_address_t_address_t_uint256__fromStack_reversed", + "nativeSrc": "19482:371:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "19592:9:70", + "nodeType": "YulTypedName", + "src": "19592:9:70", + "type": "" + }, + { + "name": "value2", + "nativeSrc": "19603:6:70", + "nodeType": "YulTypedName", + "src": "19603:6:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "19611:6:70", + "nodeType": "YulTypedName", + "src": "19611:6:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "19619:6:70", + "nodeType": "YulTypedName", + "src": "19619:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "19630:4:70", + "nodeType": "YulTypedName", + "src": "19630:4:70", + "type": "" + } + ], + "src": "19482:371:70" + }, + { + "body": { + "nativeSrc": "19936:167:70", + "nodeType": "YulBlock", + "src": "19936:167:70", + "statements": [ + { + "body": { + "nativeSrc": "19982:16:70", + "nodeType": "YulBlock", + "src": "19982:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "19991:1:70", + "nodeType": "YulLiteral", + "src": "19991:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "19994:1:70", + "nodeType": "YulLiteral", + "src": "19994:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "19984:6:70", + "nodeType": "YulIdentifier", + "src": "19984:6:70" + }, + "nativeSrc": "19984:12:70", + "nodeType": "YulFunctionCall", + "src": "19984:12:70" + }, + "nativeSrc": "19984:12:70", + "nodeType": "YulExpressionStatement", + "src": "19984:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "dataEnd", + "nativeSrc": "19957:7:70", + "nodeType": "YulIdentifier", + "src": "19957:7:70" + }, + { + "name": "headStart", + "nativeSrc": "19966:9:70", + "nodeType": "YulIdentifier", + "src": "19966:9:70" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "19953:3:70", + "nodeType": "YulIdentifier", + "src": "19953:3:70" + }, + "nativeSrc": "19953:23:70", + "nodeType": "YulFunctionCall", + "src": "19953:23:70" + }, + { + "kind": "number", + "nativeSrc": "19978:2:70", + "nodeType": "YulLiteral", + "src": "19978:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "slt", + "nativeSrc": "19949:3:70", + "nodeType": "YulIdentifier", + "src": "19949:3:70" + }, + "nativeSrc": "19949:32:70", + "nodeType": "YulFunctionCall", + "src": "19949:32:70" + }, + "nativeSrc": "19946:52:70", + "nodeType": "YulIf", + "src": "19946:52:70" + }, + { + "nativeSrc": "20007:29:70", + "nodeType": "YulVariableDeclaration", + "src": "20007:29:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "20026:9:70", + "nodeType": "YulIdentifier", + "src": "20026:9:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "20020:5:70", + "nodeType": "YulIdentifier", + "src": "20020:5:70" + }, + "nativeSrc": "20020:16:70", + "nodeType": "YulFunctionCall", + "src": "20020:16:70" + }, + "variables": [ + { + "name": "value", + "nativeSrc": "20011:5:70", + "nodeType": "YulTypedName", + "src": "20011:5:70", + "type": "" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "value", + "nativeSrc": "20067:5:70", + "nodeType": "YulIdentifier", + "src": "20067:5:70" + } + ], + "functionName": { + "name": "validator_revert_bool", + "nativeSrc": "20045:21:70", + "nodeType": "YulIdentifier", + "src": "20045:21:70" + }, + "nativeSrc": "20045:28:70", + "nodeType": "YulFunctionCall", + "src": "20045:28:70" + }, + "nativeSrc": "20045:28:70", + "nodeType": "YulExpressionStatement", + "src": "20045:28:70" + }, + { + "nativeSrc": "20082:15:70", + "nodeType": "YulAssignment", + "src": "20082:15:70", + "value": { + "name": "value", + "nativeSrc": "20092:5:70", + "nodeType": "YulIdentifier", + "src": "20092:5:70" + }, + "variableNames": [ + { + "name": "value0", + "nativeSrc": "20082:6:70", + "nodeType": "YulIdentifier", + "src": "20082:6:70" + } + ] + } + ] + }, + "name": "abi_decode_tuple_t_bool_fromMemory", + "nativeSrc": "19858:245:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "19902:9:70", + "nodeType": "YulTypedName", + "src": "19902:9:70", + "type": "" + }, + { + "name": "dataEnd", + "nativeSrc": "19913:7:70", + "nodeType": "YulTypedName", + "src": "19913:7:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value0", + "nativeSrc": "19925:6:70", + "nodeType": "YulTypedName", + "src": "19925:6:70", + "type": "" + } + ], + "src": "19858:245:70" + }, + { + "body": { + "nativeSrc": "20282:158:70", + "nodeType": "YulBlock", + "src": "20282:158:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "20299:9:70", + "nodeType": "YulIdentifier", + "src": "20299:9:70" + }, + { + "kind": "number", + "nativeSrc": "20310:2:70", + "nodeType": "YulLiteral", + "src": "20310:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "20292:6:70", + "nodeType": "YulIdentifier", + "src": "20292:6:70" + }, + "nativeSrc": "20292:21:70", + "nodeType": "YulFunctionCall", + "src": "20292:21:70" + }, + "nativeSrc": "20292:21:70", + "nodeType": "YulExpressionStatement", + "src": "20292:21:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "20333:9:70", + "nodeType": "YulIdentifier", + "src": "20333:9:70" + }, + { + "kind": "number", + "nativeSrc": "20344:2:70", + "nodeType": "YulLiteral", + "src": "20344:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "20329:3:70", + "nodeType": "YulIdentifier", + "src": "20329:3:70" + }, + "nativeSrc": "20329:18:70", + "nodeType": "YulFunctionCall", + "src": "20329:18:70" + }, + { + "kind": "number", + "nativeSrc": "20349:1:70", + "nodeType": "YulLiteral", + "src": "20349:1:70", + "type": "", + "value": "9" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "20322:6:70", + "nodeType": "YulIdentifier", + "src": "20322:6:70" + }, + "nativeSrc": "20322:29:70", + "nodeType": "YulFunctionCall", + "src": "20322:29:70" + }, + "nativeSrc": "20322:29:70", + "nodeType": "YulExpressionStatement", + "src": "20322:29:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "20371:9:70", + "nodeType": "YulIdentifier", + "src": "20371:9:70" + }, + { + "kind": "number", + "nativeSrc": "20382:2:70", + "nodeType": "YulLiteral", + "src": "20382:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "20367:3:70", + "nodeType": "YulIdentifier", + "src": "20367:3:70" + }, + "nativeSrc": "20367:18:70", + "nodeType": "YulFunctionCall", + "src": "20367:18:70" + }, + { + "hexValue": "217472616e73666572", + "kind": "string", + "nativeSrc": "20387:11:70", + "nodeType": "YulLiteral", + "src": "20387:11:70", + "type": "", + "value": "!transfer" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "20360:6:70", + "nodeType": "YulIdentifier", + "src": "20360:6:70" + }, + "nativeSrc": "20360:39:70", + "nodeType": "YulFunctionCall", + "src": "20360:39:70" + }, + "nativeSrc": "20360:39:70", + "nodeType": "YulExpressionStatement", + "src": "20360:39:70" + }, + { + "nativeSrc": "20408:26:70", + "nodeType": "YulAssignment", + "src": "20408:26:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "20420:9:70", + "nodeType": "YulIdentifier", + "src": "20420:9:70" + }, + { + "kind": "number", + "nativeSrc": "20431:2:70", + "nodeType": "YulLiteral", + "src": "20431:2:70", + "type": "", + "value": "96" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "20416:3:70", + "nodeType": "YulIdentifier", + "src": "20416:3:70" + }, + "nativeSrc": "20416:18:70", + "nodeType": "YulFunctionCall", + "src": "20416:18:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "20408:4:70", + "nodeType": "YulIdentifier", + "src": "20408:4:70" + } + ] + } + ] + }, + "name": "abi_encode_tuple_t_stringliteral_aaf3daf27360df170a52f29a0edeebb3d20b8e3dc84a13c5eaf056803b549f50__to_t_string_memory_ptr__fromStack_reversed", + "nativeSrc": "20108:332:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "20259:9:70", + "nodeType": "YulTypedName", + "src": "20259:9:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "20273:4:70", + "nodeType": "YulTypedName", + "src": "20273:4:70", + "type": "" + } + ], + "src": "20108:332:70" + }, + { + "body": { + "nativeSrc": "20592:139:70", + "nodeType": "YulBlock", + "src": "20592:139:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "name": "pos", + "nativeSrc": "20609:3:70", + "nodeType": "YulIdentifier", + "src": "20609:3:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "20622:2:70", + "nodeType": "YulLiteral", + "src": "20622:2:70", + "type": "", + "value": "96" + }, + { + "name": "value0", + "nativeSrc": "20626:6:70", + "nodeType": "YulIdentifier", + "src": "20626:6:70" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "20618:3:70", + "nodeType": "YulIdentifier", + "src": "20618:3:70" + }, + "nativeSrc": "20618:15:70", + "nodeType": "YulFunctionCall", + "src": "20618:15:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "20647:2:70", + "nodeType": "YulLiteral", + "src": "20647:2:70", + "type": "", + "value": "96" + }, + { + "kind": "number", + "nativeSrc": "20651:1:70", + "nodeType": "YulLiteral", + "src": "20651:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "20643:3:70", + "nodeType": "YulIdentifier", + "src": "20643:3:70" + }, + "nativeSrc": "20643:10:70", + "nodeType": "YulFunctionCall", + "src": "20643:10:70" + }, + { + "kind": "number", + "nativeSrc": "20655:1:70", + "nodeType": "YulLiteral", + "src": "20655:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "20639:3:70", + "nodeType": "YulIdentifier", + "src": "20639:3:70" + }, + "nativeSrc": "20639:18:70", + "nodeType": "YulFunctionCall", + "src": "20639:18:70" + } + ], + "functionName": { + "name": "not", + "nativeSrc": "20635:3:70", + "nodeType": "YulIdentifier", + "src": "20635:3:70" + }, + "nativeSrc": "20635:23:70", + "nodeType": "YulFunctionCall", + "src": "20635:23:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "20614:3:70", + "nodeType": "YulIdentifier", + "src": "20614:3:70" + }, + "nativeSrc": "20614:45:70", + "nodeType": "YulFunctionCall", + "src": "20614:45:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "20602:6:70", + "nodeType": "YulIdentifier", + "src": "20602:6:70" + }, + "nativeSrc": "20602:58:70", + "nodeType": "YulFunctionCall", + "src": "20602:58:70" + }, + "nativeSrc": "20602:58:70", + "nodeType": "YulExpressionStatement", + "src": "20602:58:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "pos", + "nativeSrc": "20680:3:70", + "nodeType": "YulIdentifier", + "src": "20680:3:70" + }, + { + "kind": "number", + "nativeSrc": "20685:2:70", + "nodeType": "YulLiteral", + "src": "20685:2:70", + "type": "", + "value": "20" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "20676:3:70", + "nodeType": "YulIdentifier", + "src": "20676:3:70" + }, + "nativeSrc": "20676:12:70", + "nodeType": "YulFunctionCall", + "src": "20676:12:70" + }, + { + "name": "value1", + "nativeSrc": "20690:6:70", + "nodeType": "YulIdentifier", + "src": "20690:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "20669:6:70", + "nodeType": "YulIdentifier", + "src": "20669:6:70" + }, + "nativeSrc": "20669:28:70", + "nodeType": "YulFunctionCall", + "src": "20669:28:70" + }, + "nativeSrc": "20669:28:70", + "nodeType": "YulExpressionStatement", + "src": "20669:28:70" + }, + { + "nativeSrc": "20706:19:70", + "nodeType": "YulAssignment", + "src": "20706:19:70", + "value": { + "arguments": [ + { + "name": "pos", + "nativeSrc": "20717:3:70", + "nodeType": "YulIdentifier", + "src": "20717:3:70" + }, + { + "kind": "number", + "nativeSrc": "20722:2:70", + "nodeType": "YulLiteral", + "src": "20722:2:70", + "type": "", + "value": "52" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "20713:3:70", + "nodeType": "YulIdentifier", + "src": "20713:3:70" + }, + "nativeSrc": "20713:12:70", + "nodeType": "YulFunctionCall", + "src": "20713:12:70" + }, + "variableNames": [ + { + "name": "end", + "nativeSrc": "20706:3:70", + "nodeType": "YulIdentifier", + "src": "20706:3:70" + } + ] + } + ] + }, + "name": "abi_encode_tuple_packed_t_address_t_bytes32__to_t_address_t_bytes32__nonPadded_inplace_fromStack_reversed", + "nativeSrc": "20445:286:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "pos", + "nativeSrc": "20560:3:70", + "nodeType": "YulTypedName", + "src": "20560:3:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "20565:6:70", + "nodeType": "YulTypedName", + "src": "20565:6:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "20573:6:70", + "nodeType": "YulTypedName", + "src": "20573:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "end", + "nativeSrc": "20584:3:70", + "nodeType": "YulTypedName", + "src": "20584:3:70", + "type": "" + } + ], + "src": "20445:286:70" + }, + { + "body": { + "nativeSrc": "20949:276:70", + "nodeType": "YulBlock", + "src": "20949:276:70", + "statements": [ + { + "nativeSrc": "20959:27:70", + "nodeType": "YulAssignment", + "src": "20959:27:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "20971:9:70", + "nodeType": "YulIdentifier", + "src": "20971:9:70" + }, + { + "kind": "number", + "nativeSrc": "20982:3:70", + "nodeType": "YulLiteral", + "src": "20982:3:70", + "type": "", + "value": "160" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "20967:3:70", + "nodeType": "YulIdentifier", + "src": "20967:3:70" + }, + "nativeSrc": "20967:19:70", + "nodeType": "YulFunctionCall", + "src": "20967:19:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "20959:4:70", + "nodeType": "YulIdentifier", + "src": "20959:4:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "21002:9:70", + "nodeType": "YulIdentifier", + "src": "21002:9:70" + }, + { + "name": "value0", + "nativeSrc": "21013:6:70", + "nodeType": "YulIdentifier", + "src": "21013:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "20995:6:70", + "nodeType": "YulIdentifier", + "src": "20995:6:70" + }, + "nativeSrc": "20995:25:70", + "nodeType": "YulFunctionCall", + "src": "20995:25:70" + }, + "nativeSrc": "20995:25:70", + "nodeType": "YulExpressionStatement", + "src": "20995:25:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "21040:9:70", + "nodeType": "YulIdentifier", + "src": "21040:9:70" + }, + { + "kind": "number", + "nativeSrc": "21051:2:70", + "nodeType": "YulLiteral", + "src": "21051:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "21036:3:70", + "nodeType": "YulIdentifier", + "src": "21036:3:70" + }, + "nativeSrc": "21036:18:70", + "nodeType": "YulFunctionCall", + "src": "21036:18:70" + }, + { + "arguments": [ + { + "name": "value1", + "nativeSrc": "21060:6:70", + "nodeType": "YulIdentifier", + "src": "21060:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "21076:3:70", + "nodeType": "YulLiteral", + "src": "21076:3:70", + "type": "", + "value": "160" + }, + { + "kind": "number", + "nativeSrc": "21081:1:70", + "nodeType": "YulLiteral", + "src": "21081:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "21072:3:70", + "nodeType": "YulIdentifier", + "src": "21072:3:70" + }, + "nativeSrc": "21072:11:70", + "nodeType": "YulFunctionCall", + "src": "21072:11:70" + }, + { + "kind": "number", + "nativeSrc": "21085:1:70", + "nodeType": "YulLiteral", + "src": "21085:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "21068:3:70", + "nodeType": "YulIdentifier", + "src": "21068:3:70" + }, + "nativeSrc": "21068:19:70", + "nodeType": "YulFunctionCall", + "src": "21068:19:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "21056:3:70", + "nodeType": "YulIdentifier", + "src": "21056:3:70" + }, + "nativeSrc": "21056:32:70", + "nodeType": "YulFunctionCall", + "src": "21056:32:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "21029:6:70", + "nodeType": "YulIdentifier", + "src": "21029:6:70" + }, + "nativeSrc": "21029:60:70", + "nodeType": "YulFunctionCall", + "src": "21029:60:70" + }, + "nativeSrc": "21029:60:70", + "nodeType": "YulExpressionStatement", + "src": "21029:60:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "21109:9:70", + "nodeType": "YulIdentifier", + "src": "21109:9:70" + }, + { + "kind": "number", + "nativeSrc": "21120:2:70", + "nodeType": "YulLiteral", + "src": "21120:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "21105:3:70", + "nodeType": "YulIdentifier", + "src": "21105:3:70" + }, + "nativeSrc": "21105:18:70", + "nodeType": "YulFunctionCall", + "src": "21105:18:70" + }, + { + "name": "value2", + "nativeSrc": "21125:6:70", + "nodeType": "YulIdentifier", + "src": "21125:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "21098:6:70", + "nodeType": "YulIdentifier", + "src": "21098:6:70" + }, + "nativeSrc": "21098:34:70", + "nodeType": "YulFunctionCall", + "src": "21098:34:70" + }, + "nativeSrc": "21098:34:70", + "nodeType": "YulExpressionStatement", + "src": "21098:34:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "21152:9:70", + "nodeType": "YulIdentifier", + "src": "21152:9:70" + }, + { + "kind": "number", + "nativeSrc": "21163:2:70", + "nodeType": "YulLiteral", + "src": "21163:2:70", + "type": "", + "value": "96" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "21148:3:70", + "nodeType": "YulIdentifier", + "src": "21148:3:70" + }, + "nativeSrc": "21148:18:70", + "nodeType": "YulFunctionCall", + "src": "21148:18:70" + }, + { + "name": "value3", + "nativeSrc": "21168:6:70", + "nodeType": "YulIdentifier", + "src": "21168:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "21141:6:70", + "nodeType": "YulIdentifier", + "src": "21141:6:70" + }, + "nativeSrc": "21141:34:70", + "nodeType": "YulFunctionCall", + "src": "21141:34:70" + }, + "nativeSrc": "21141:34:70", + "nodeType": "YulExpressionStatement", + "src": "21141:34:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "21195:9:70", + "nodeType": "YulIdentifier", + "src": "21195:9:70" + }, + { + "kind": "number", + "nativeSrc": "21206:3:70", + "nodeType": "YulLiteral", + "src": "21206:3:70", + "type": "", + "value": "128" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "21191:3:70", + "nodeType": "YulIdentifier", + "src": "21191:3:70" + }, + "nativeSrc": "21191:19:70", + "nodeType": "YulFunctionCall", + "src": "21191:19:70" + }, + { + "name": "value4", + "nativeSrc": "21212:6:70", + "nodeType": "YulIdentifier", + "src": "21212:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "21184:6:70", + "nodeType": "YulIdentifier", + "src": "21184:6:70" + }, + "nativeSrc": "21184:35:70", + "nodeType": "YulFunctionCall", + "src": "21184:35:70" + }, + "nativeSrc": "21184:35:70", + "nodeType": "YulExpressionStatement", + "src": "21184:35:70" + } + ] + }, + "name": "abi_encode_tuple_t_uint256_t_address_t_bytes32_t_uint256_t_uint256__to_t_uint256_t_address_t_bytes32_t_uint256_t_uint256__fromStack_reversed", + "nativeSrc": "20736:489:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "20886:9:70", + "nodeType": "YulTypedName", + "src": "20886:9:70", + "type": "" + }, + { + "name": "value4", + "nativeSrc": "20897:6:70", + "nodeType": "YulTypedName", + "src": "20897:6:70", + "type": "" + }, + { + "name": "value3", + "nativeSrc": "20905:6:70", + "nodeType": "YulTypedName", + "src": "20905:6:70", + "type": "" + }, + { + "name": "value2", + "nativeSrc": "20913:6:70", + "nodeType": "YulTypedName", + "src": "20913:6:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "20921:6:70", + "nodeType": "YulTypedName", + "src": "20921:6:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "20929:6:70", + "nodeType": "YulTypedName", + "src": "20929:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "20940:4:70", + "nodeType": "YulTypedName", + "src": "20940:4:70", + "type": "" + } + ], + "src": "20736:489:70" + }, + { + "body": { + "nativeSrc": "21415:206:70", + "nodeType": "YulBlock", + "src": "21415:206:70", + "statements": [ + { + "nativeSrc": "21425:27:70", + "nodeType": "YulAssignment", + "src": "21425:27:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "21437:9:70", + "nodeType": "YulIdentifier", + "src": "21437:9:70" + }, + { + "kind": "number", + "nativeSrc": "21448:3:70", + "nodeType": "YulLiteral", + "src": "21448:3:70", + "type": "", + "value": "128" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "21433:3:70", + "nodeType": "YulIdentifier", + "src": "21433:3:70" + }, + "nativeSrc": "21433:19:70", + "nodeType": "YulFunctionCall", + "src": "21433:19:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "21425:4:70", + "nodeType": "YulIdentifier", + "src": "21425:4:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "21468:9:70", + "nodeType": "YulIdentifier", + "src": "21468:9:70" + }, + { + "name": "value0", + "nativeSrc": "21479:6:70", + "nodeType": "YulIdentifier", + "src": "21479:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "21461:6:70", + "nodeType": "YulIdentifier", + "src": "21461:6:70" + }, + "nativeSrc": "21461:25:70", + "nodeType": "YulFunctionCall", + "src": "21461:25:70" + }, + "nativeSrc": "21461:25:70", + "nodeType": "YulExpressionStatement", + "src": "21461:25:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "21506:9:70", + "nodeType": "YulIdentifier", + "src": "21506:9:70" + }, + { + "kind": "number", + "nativeSrc": "21517:2:70", + "nodeType": "YulLiteral", + "src": "21517:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "21502:3:70", + "nodeType": "YulIdentifier", + "src": "21502:3:70" + }, + "nativeSrc": "21502:18:70", + "nodeType": "YulFunctionCall", + "src": "21502:18:70" + }, + { + "name": "value1", + "nativeSrc": "21522:6:70", + "nodeType": "YulIdentifier", + "src": "21522:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "21495:6:70", + "nodeType": "YulIdentifier", + "src": "21495:6:70" + }, + "nativeSrc": "21495:34:70", + "nodeType": "YulFunctionCall", + "src": "21495:34:70" + }, + "nativeSrc": "21495:34:70", + "nodeType": "YulExpressionStatement", + "src": "21495:34:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "21549:9:70", + "nodeType": "YulIdentifier", + "src": "21549:9:70" + }, + { + "kind": "number", + "nativeSrc": "21560:2:70", + "nodeType": "YulLiteral", + "src": "21560:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "21545:3:70", + "nodeType": "YulIdentifier", + "src": "21545:3:70" + }, + "nativeSrc": "21545:18:70", + "nodeType": "YulFunctionCall", + "src": "21545:18:70" + }, + { + "name": "value2", + "nativeSrc": "21565:6:70", + "nodeType": "YulIdentifier", + "src": "21565:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "21538:6:70", + "nodeType": "YulIdentifier", + "src": "21538:6:70" + }, + "nativeSrc": "21538:34:70", + "nodeType": "YulFunctionCall", + "src": "21538:34:70" + }, + "nativeSrc": "21538:34:70", + "nodeType": "YulExpressionStatement", + "src": "21538:34:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "21592:9:70", + "nodeType": "YulIdentifier", + "src": "21592:9:70" + }, + { + "kind": "number", + "nativeSrc": "21603:2:70", + "nodeType": "YulLiteral", + "src": "21603:2:70", + "type": "", + "value": "96" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "21588:3:70", + "nodeType": "YulIdentifier", + "src": "21588:3:70" + }, + "nativeSrc": "21588:18:70", + "nodeType": "YulFunctionCall", + "src": "21588:18:70" + }, + { + "name": "value3", + "nativeSrc": "21608:6:70", + "nodeType": "YulIdentifier", + "src": "21608:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "21581:6:70", + "nodeType": "YulIdentifier", + "src": "21581:6:70" + }, + "nativeSrc": "21581:34:70", + "nodeType": "YulFunctionCall", + "src": "21581:34:70" + }, + "nativeSrc": "21581:34:70", + "nodeType": "YulExpressionStatement", + "src": "21581:34:70" + } + ] + }, + "name": "abi_encode_tuple_t_bytes32_t_bytes32_t_bytes32_t_bytes32__to_t_bytes32_t_bytes32_t_bytes32_t_bytes32__fromStack_reversed", + "nativeSrc": "21230:391:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "21360:9:70", + "nodeType": "YulTypedName", + "src": "21360:9:70", + "type": "" + }, + { + "name": "value3", + "nativeSrc": "21371:6:70", + "nodeType": "YulTypedName", + "src": "21371:6:70", + "type": "" + }, + { + "name": "value2", + "nativeSrc": "21379:6:70", + "nodeType": "YulTypedName", + "src": "21379:6:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "21387:6:70", + "nodeType": "YulTypedName", + "src": "21387:6:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "21395:6:70", + "nodeType": "YulTypedName", + "src": "21395:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "21406:4:70", + "nodeType": "YulTypedName", + "src": "21406:4:70", + "type": "" + } + ], + "src": "21230:391:70" + }, + { + "body": { + "nativeSrc": "21874:144:70", + "nodeType": "YulBlock", + "src": "21874:144:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "name": "pos", + "nativeSrc": "21891:3:70", + "nodeType": "YulIdentifier", + "src": "21891:3:70" + }, + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "21900:3:70", + "nodeType": "YulLiteral", + "src": "21900:3:70", + "type": "", + "value": "240" + }, + { + "kind": "number", + "nativeSrc": "21905:4:70", + "nodeType": "YulLiteral", + "src": "21905:4:70", + "type": "", + "value": "6401" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "21896:3:70", + "nodeType": "YulIdentifier", + "src": "21896:3:70" + }, + "nativeSrc": "21896:14:70", + "nodeType": "YulFunctionCall", + "src": "21896:14:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "21884:6:70", + "nodeType": "YulIdentifier", + "src": "21884:6:70" + }, + "nativeSrc": "21884:27:70", + "nodeType": "YulFunctionCall", + "src": "21884:27:70" + }, + "nativeSrc": "21884:27:70", + "nodeType": "YulExpressionStatement", + "src": "21884:27:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "pos", + "nativeSrc": "21931:3:70", + "nodeType": "YulIdentifier", + "src": "21931:3:70" + }, + { + "kind": "number", + "nativeSrc": "21936:1:70", + "nodeType": "YulLiteral", + "src": "21936:1:70", + "type": "", + "value": "2" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "21927:3:70", + "nodeType": "YulIdentifier", + "src": "21927:3:70" + }, + "nativeSrc": "21927:11:70", + "nodeType": "YulFunctionCall", + "src": "21927:11:70" + }, + { + "name": "value0", + "nativeSrc": "21940:6:70", + "nodeType": "YulIdentifier", + "src": "21940:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "21920:6:70", + "nodeType": "YulIdentifier", + "src": "21920:6:70" + }, + "nativeSrc": "21920:27:70", + "nodeType": "YulFunctionCall", + "src": "21920:27:70" + }, + "nativeSrc": "21920:27:70", + "nodeType": "YulExpressionStatement", + "src": "21920:27:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "pos", + "nativeSrc": "21967:3:70", + "nodeType": "YulIdentifier", + "src": "21967:3:70" + }, + { + "kind": "number", + "nativeSrc": "21972:2:70", + "nodeType": "YulLiteral", + "src": "21972:2:70", + "type": "", + "value": "34" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "21963:3:70", + "nodeType": "YulIdentifier", + "src": "21963:3:70" + }, + "nativeSrc": "21963:12:70", + "nodeType": "YulFunctionCall", + "src": "21963:12:70" + }, + { + "name": "value1", + "nativeSrc": "21977:6:70", + "nodeType": "YulIdentifier", + "src": "21977:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "21956:6:70", + "nodeType": "YulIdentifier", + "src": "21956:6:70" + }, + "nativeSrc": "21956:28:70", + "nodeType": "YulFunctionCall", + "src": "21956:28:70" + }, + "nativeSrc": "21956:28:70", + "nodeType": "YulExpressionStatement", + "src": "21956:28:70" + }, + { + "nativeSrc": "21993:19:70", + "nodeType": "YulAssignment", + "src": "21993:19:70", + "value": { + "arguments": [ + { + "name": "pos", + "nativeSrc": "22004:3:70", + "nodeType": "YulIdentifier", + "src": "22004:3:70" + }, + { + "kind": "number", + "nativeSrc": "22009:2:70", + "nodeType": "YulLiteral", + "src": "22009:2:70", + "type": "", + "value": "66" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "22000:3:70", + "nodeType": "YulIdentifier", + "src": "22000:3:70" + }, + "nativeSrc": "22000:12:70", + "nodeType": "YulFunctionCall", + "src": "22000:12:70" + }, + "variableNames": [ + { + "name": "end", + "nativeSrc": "21993:3:70", + "nodeType": "YulIdentifier", + "src": "21993:3:70" + } + ] + } + ] + }, + "name": "abi_encode_tuple_packed_t_stringliteral_301a50b291d33ce1e8e9064e3f6a6c51d902ec22892b50d58abf6357c6a45541_t_bytes32_t_bytes32__to_t_string_memory_ptr_t_bytes32_t_bytes32__nonPadded_inplace_fromStack_reversed", + "nativeSrc": "21626:392:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "pos", + "nativeSrc": "21842:3:70", + "nodeType": "YulTypedName", + "src": "21842:3:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "21847:6:70", + "nodeType": "YulTypedName", + "src": "21847:6:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "21855:6:70", + "nodeType": "YulTypedName", + "src": "21855:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "end", + "nativeSrc": "21866:3:70", + "nodeType": "YulTypedName", + "src": "21866:3:70", + "type": "" + } + ], + "src": "21626:392:70" + }, + { + "body": { + "nativeSrc": "22152:145:70", + "nodeType": "YulBlock", + "src": "22152:145:70", + "statements": [ + { + "nativeSrc": "22162:26:70", + "nodeType": "YulAssignment", + "src": "22162:26:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "22174:9:70", + "nodeType": "YulIdentifier", + "src": "22174:9:70" + }, + { + "kind": "number", + "nativeSrc": "22185:2:70", + "nodeType": "YulLiteral", + "src": "22185:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "22170:3:70", + "nodeType": "YulIdentifier", + "src": "22170:3:70" + }, + "nativeSrc": "22170:18:70", + "nodeType": "YulFunctionCall", + "src": "22170:18:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "22162:4:70", + "nodeType": "YulIdentifier", + "src": "22162:4:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "22204:9:70", + "nodeType": "YulIdentifier", + "src": "22204:9:70" + }, + { + "arguments": [ + { + "name": "value0", + "nativeSrc": "22219:6:70", + "nodeType": "YulIdentifier", + "src": "22219:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "22235:3:70", + "nodeType": "YulLiteral", + "src": "22235:3:70", + "type": "", + "value": "160" + }, + { + "kind": "number", + "nativeSrc": "22240:1:70", + "nodeType": "YulLiteral", + "src": "22240:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "22231:3:70", + "nodeType": "YulIdentifier", + "src": "22231:3:70" + }, + "nativeSrc": "22231:11:70", + "nodeType": "YulFunctionCall", + "src": "22231:11:70" + }, + { + "kind": "number", + "nativeSrc": "22244:1:70", + "nodeType": "YulLiteral", + "src": "22244:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "22227:3:70", + "nodeType": "YulIdentifier", + "src": "22227:3:70" + }, + "nativeSrc": "22227:19:70", + "nodeType": "YulFunctionCall", + "src": "22227:19:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "22215:3:70", + "nodeType": "YulIdentifier", + "src": "22215:3:70" + }, + "nativeSrc": "22215:32:70", + "nodeType": "YulFunctionCall", + "src": "22215:32:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "22197:6:70", + "nodeType": "YulIdentifier", + "src": "22197:6:70" + }, + "nativeSrc": "22197:51:70", + "nodeType": "YulFunctionCall", + "src": "22197:51:70" + }, + "nativeSrc": "22197:51:70", + "nodeType": "YulExpressionStatement", + "src": "22197:51:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "22268:9:70", + "nodeType": "YulIdentifier", + "src": "22268:9:70" + }, + { + "kind": "number", + "nativeSrc": "22279:2:70", + "nodeType": "YulLiteral", + "src": "22279:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "22264:3:70", + "nodeType": "YulIdentifier", + "src": "22264:3:70" + }, + "nativeSrc": "22264:18:70", + "nodeType": "YulFunctionCall", + "src": "22264:18:70" + }, + { + "name": "value1", + "nativeSrc": "22284:6:70", + "nodeType": "YulIdentifier", + "src": "22284:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "22257:6:70", + "nodeType": "YulIdentifier", + "src": "22257:6:70" + }, + "nativeSrc": "22257:34:70", + "nodeType": "YulFunctionCall", + "src": "22257:34:70" + }, + "nativeSrc": "22257:34:70", + "nodeType": "YulExpressionStatement", + "src": "22257:34:70" + } + ] + }, + "name": "abi_encode_tuple_t_address_t_uint256__to_t_address_t_uint256__fromStack_reversed", + "nativeSrc": "22023:274:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "22113:9:70", + "nodeType": "YulTypedName", + "src": "22113:9:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "22124:6:70", + "nodeType": "YulTypedName", + "src": "22124:6:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "22132:6:70", + "nodeType": "YulTypedName", + "src": "22132:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "22143:4:70", + "nodeType": "YulTypedName", + "src": "22143:4:70", + "type": "" + } + ], + "src": "22023:274:70" + }, + { + "body": { + "nativeSrc": "22415:992:70", + "nodeType": "YulBlock", + "src": "22415:992:70", + "statements": [ + { + "nativeSrc": "22425:43:70", + "nodeType": "YulVariableDeclaration", + "src": "22425:43:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "dataEnd", + "nativeSrc": "22443:7:70", + "nodeType": "YulIdentifier", + "src": "22443:7:70" + }, + { + "name": "headStart", + "nativeSrc": "22452:9:70", + "nodeType": "YulIdentifier", + "src": "22452:9:70" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "22439:3:70", + "nodeType": "YulIdentifier", + "src": "22439:3:70" + }, + "nativeSrc": "22439:23:70", + "nodeType": "YulFunctionCall", + "src": "22439:23:70" + }, + { + "kind": "number", + "nativeSrc": "22464:3:70", + "nodeType": "YulLiteral", + "src": "22464:3:70", + "type": "", + "value": "160" + } + ], + "functionName": { + "name": "slt", + "nativeSrc": "22435:3:70", + "nodeType": "YulIdentifier", + "src": "22435:3:70" + }, + "nativeSrc": "22435:33:70", + "nodeType": "YulFunctionCall", + "src": "22435:33:70" + }, + "variables": [ + { + "name": "_1", + "nativeSrc": "22429:2:70", + "nodeType": "YulTypedName", + "src": "22429:2:70", + "type": "" + } + ] + }, + { + "body": { + "nativeSrc": "22483:16:70", + "nodeType": "YulBlock", + "src": "22483:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "22492:1:70", + "nodeType": "YulLiteral", + "src": "22492:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "22495:1:70", + "nodeType": "YulLiteral", + "src": "22495:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "22485:6:70", + "nodeType": "YulIdentifier", + "src": "22485:6:70" + }, + "nativeSrc": "22485:12:70", + "nodeType": "YulFunctionCall", + "src": "22485:12:70" + }, + "nativeSrc": "22485:12:70", + "nodeType": "YulExpressionStatement", + "src": "22485:12:70" + } + ] + }, + "condition": { + "name": "_1", + "nativeSrc": "22480:2:70", + "nodeType": "YulIdentifier", + "src": "22480:2:70" + }, + "nativeSrc": "22477:22:70", + "nodeType": "YulIf", + "src": "22477:22:70" + }, + { + "nativeSrc": "22508:7:70", + "nodeType": "YulAssignment", + "src": "22508:7:70", + "value": { + "kind": "number", + "nativeSrc": "22514:1:70", + "nodeType": "YulLiteral", + "src": "22514:1:70", + "type": "", + "value": "0" + }, + "variableNames": [ + { + "name": "_1", + "nativeSrc": "22508:2:70", + "nodeType": "YulIdentifier", + "src": "22508:2:70" + } + ] + }, + { + "nativeSrc": "22524:16:70", + "nodeType": "YulVariableDeclaration", + "src": "22524:16:70", + "value": { + "name": "_1", + "nativeSrc": "22538:2:70", + "nodeType": "YulIdentifier", + "src": "22538:2:70" + }, + "variables": [ + { + "name": "memPtr", + "nativeSrc": "22528:6:70", + "nodeType": "YulTypedName", + "src": "22528:6:70", + "type": "" + } + ] + }, + { + "nativeSrc": "22549:19:70", + "nodeType": "YulAssignment", + "src": "22549:19:70", + "value": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "22565:2:70", + "nodeType": "YulLiteral", + "src": "22565:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "22559:5:70", + "nodeType": "YulIdentifier", + "src": "22559:5:70" + }, + "nativeSrc": "22559:9:70", + "nodeType": "YulFunctionCall", + "src": "22559:9:70" + }, + "variableNames": [ + { + "name": "memPtr", + "nativeSrc": "22549:6:70", + "nodeType": "YulIdentifier", + "src": "22549:6:70" + } + ] + }, + { + "nativeSrc": "22577:34:70", + "nodeType": "YulVariableDeclaration", + "src": "22577:34:70", + "value": { + "arguments": [ + { + "name": "memPtr", + "nativeSrc": "22599:6:70", + "nodeType": "YulIdentifier", + "src": "22599:6:70" + }, + { + "kind": "number", + "nativeSrc": "22607:3:70", + "nodeType": "YulLiteral", + "src": "22607:3:70", + "type": "", + "value": "160" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "22595:3:70", + "nodeType": "YulIdentifier", + "src": "22595:3:70" + }, + "nativeSrc": "22595:16:70", + "nodeType": "YulFunctionCall", + "src": "22595:16:70" + }, + "variables": [ + { + "name": "newFreePtr", + "nativeSrc": "22581:10:70", + "nodeType": "YulTypedName", + "src": "22581:10:70", + "type": "" + } + ] + }, + { + "body": { + "nativeSrc": "22694:113:70", + "nodeType": "YulBlock", + "src": "22694:113:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "name": "_1", + "nativeSrc": "22715:2:70", + "nodeType": "YulIdentifier", + "src": "22715:2:70" + }, + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "22723:3:70", + "nodeType": "YulLiteral", + "src": "22723:3:70", + "type": "", + "value": "224" + }, + { + "kind": "number", + "nativeSrc": "22728:10:70", + "nodeType": "YulLiteral", + "src": "22728:10:70", + "type": "", + "value": "0x4e487b71" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "22719:3:70", + "nodeType": "YulIdentifier", + "src": "22719:3:70" + }, + "nativeSrc": "22719:20:70", + "nodeType": "YulFunctionCall", + "src": "22719:20:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "22708:6:70", + "nodeType": "YulIdentifier", + "src": "22708:6:70" + }, + "nativeSrc": "22708:32:70", + "nodeType": "YulFunctionCall", + "src": "22708:32:70" + }, + "nativeSrc": "22708:32:70", + "nodeType": "YulExpressionStatement", + "src": "22708:32:70" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "22760:1:70", + "nodeType": "YulLiteral", + "src": "22760:1:70", + "type": "", + "value": "4" + }, + { + "kind": "number", + "nativeSrc": "22763:4:70", + "nodeType": "YulLiteral", + "src": "22763:4:70", + "type": "", + "value": "0x41" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "22753:6:70", + "nodeType": "YulIdentifier", + "src": "22753:6:70" + }, + "nativeSrc": "22753:15:70", + "nodeType": "YulFunctionCall", + "src": "22753:15:70" + }, + "nativeSrc": "22753:15:70", + "nodeType": "YulExpressionStatement", + "src": "22753:15:70" + }, + { + "expression": { + "arguments": [ + { + "name": "_1", + "nativeSrc": "22788:2:70", + "nodeType": "YulIdentifier", + "src": "22788:2:70" + }, + { + "kind": "number", + "nativeSrc": "22792:4:70", + "nodeType": "YulLiteral", + "src": "22792:4:70", + "type": "", + "value": "0x24" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "22781:6:70", + "nodeType": "YulIdentifier", + "src": "22781:6:70" + }, + "nativeSrc": "22781:16:70", + "nodeType": "YulFunctionCall", + "src": "22781:16:70" + }, + "nativeSrc": "22781:16:70", + "nodeType": "YulExpressionStatement", + "src": "22781:16:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "newFreePtr", + "nativeSrc": "22629:10:70", + "nodeType": "YulIdentifier", + "src": "22629:10:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "22649:2:70", + "nodeType": "YulLiteral", + "src": "22649:2:70", + "type": "", + "value": "64" + }, + { + "kind": "number", + "nativeSrc": "22653:1:70", + "nodeType": "YulLiteral", + "src": "22653:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "22645:3:70", + "nodeType": "YulIdentifier", + "src": "22645:3:70" + }, + "nativeSrc": "22645:10:70", + "nodeType": "YulFunctionCall", + "src": "22645:10:70" + }, + { + "kind": "number", + "nativeSrc": "22657:1:70", + "nodeType": "YulLiteral", + "src": "22657:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "22641:3:70", + "nodeType": "YulIdentifier", + "src": "22641:3:70" + }, + "nativeSrc": "22641:18:70", + "nodeType": "YulFunctionCall", + "src": "22641:18:70" + } + ], + "functionName": { + "name": "gt", + "nativeSrc": "22626:2:70", + "nodeType": "YulIdentifier", + "src": "22626:2:70" + }, + "nativeSrc": "22626:34:70", + "nodeType": "YulFunctionCall", + "src": "22626:34:70" + }, + { + "arguments": [ + { + "name": "newFreePtr", + "nativeSrc": "22665:10:70", + "nodeType": "YulIdentifier", + "src": "22665:10:70" + }, + { + "name": "memPtr", + "nativeSrc": "22677:6:70", + "nodeType": "YulIdentifier", + "src": "22677:6:70" + } + ], + "functionName": { + "name": "lt", + "nativeSrc": "22662:2:70", + "nodeType": "YulIdentifier", + "src": "22662:2:70" + }, + "nativeSrc": "22662:22:70", + "nodeType": "YulFunctionCall", + "src": "22662:22:70" + } + ], + "functionName": { + "name": "or", + "nativeSrc": "22623:2:70", + "nodeType": "YulIdentifier", + "src": "22623:2:70" + }, + "nativeSrc": "22623:62:70", + "nodeType": "YulFunctionCall", + "src": "22623:62:70" + }, + "nativeSrc": "22620:187:70", + "nodeType": "YulIf", + "src": "22620:187:70" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "22823:2:70", + "nodeType": "YulLiteral", + "src": "22823:2:70", + "type": "", + "value": "64" + }, + { + "name": "newFreePtr", + "nativeSrc": "22827:10:70", + "nodeType": "YulIdentifier", + "src": "22827:10:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "22816:6:70", + "nodeType": "YulIdentifier", + "src": "22816:6:70" + }, + "nativeSrc": "22816:22:70", + "nodeType": "YulFunctionCall", + "src": "22816:22:70" + }, + "nativeSrc": "22816:22:70", + "nodeType": "YulExpressionStatement", + "src": "22816:22:70" + }, + { + "nativeSrc": "22847:15:70", + "nodeType": "YulVariableDeclaration", + "src": "22847:15:70", + "value": { + "name": "_1", + "nativeSrc": "22860:2:70", + "nodeType": "YulIdentifier", + "src": "22860:2:70" + }, + "variables": [ + { + "name": "value", + "nativeSrc": "22851:5:70", + "nodeType": "YulTypedName", + "src": "22851:5:70", + "type": "" + } + ] + }, + { + "nativeSrc": "22871:25:70", + "nodeType": "YulAssignment", + "src": "22871:25:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "22886:9:70", + "nodeType": "YulIdentifier", + "src": "22886:9:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "22880:5:70", + "nodeType": "YulIdentifier", + "src": "22880:5:70" + }, + "nativeSrc": "22880:16:70", + "nodeType": "YulFunctionCall", + "src": "22880:16:70" + }, + "variableNames": [ + { + "name": "value", + "nativeSrc": "22871:5:70", + "nodeType": "YulIdentifier", + "src": "22871:5:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "memPtr", + "nativeSrc": "22912:6:70", + "nodeType": "YulIdentifier", + "src": "22912:6:70" + }, + { + "name": "value", + "nativeSrc": "22920:5:70", + "nodeType": "YulIdentifier", + "src": "22920:5:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "22905:6:70", + "nodeType": "YulIdentifier", + "src": "22905:6:70" + }, + "nativeSrc": "22905:21:70", + "nodeType": "YulFunctionCall", + "src": "22905:21:70" + }, + "nativeSrc": "22905:21:70", + "nodeType": "YulExpressionStatement", + "src": "22905:21:70" + }, + { + "nativeSrc": "22935:17:70", + "nodeType": "YulVariableDeclaration", + "src": "22935:17:70", + "value": { + "name": "_1", + "nativeSrc": "22950:2:70", + "nodeType": "YulIdentifier", + "src": "22950:2:70" + }, + "variables": [ + { + "name": "value_1", + "nativeSrc": "22939:7:70", + "nodeType": "YulTypedName", + "src": "22939:7:70", + "type": "" + } + ] + }, + { + "nativeSrc": "22961:36:70", + "nodeType": "YulAssignment", + "src": "22961:36:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "22982:9:70", + "nodeType": "YulIdentifier", + "src": "22982:9:70" + }, + { + "kind": "number", + "nativeSrc": "22993:2:70", + "nodeType": "YulLiteral", + "src": "22993:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "22978:3:70", + "nodeType": "YulIdentifier", + "src": "22978:3:70" + }, + "nativeSrc": "22978:18:70", + "nodeType": "YulFunctionCall", + "src": "22978:18:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "22972:5:70", + "nodeType": "YulIdentifier", + "src": "22972:5:70" + }, + "nativeSrc": "22972:25:70", + "nodeType": "YulFunctionCall", + "src": "22972:25:70" + }, + "variableNames": [ + { + "name": "value_1", + "nativeSrc": "22961:7:70", + "nodeType": "YulIdentifier", + "src": "22961:7:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "memPtr", + "nativeSrc": "23017:6:70", + "nodeType": "YulIdentifier", + "src": "23017:6:70" + }, + { + "kind": "number", + "nativeSrc": "23025:2:70", + "nodeType": "YulLiteral", + "src": "23025:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "23013:3:70", + "nodeType": "YulIdentifier", + "src": "23013:3:70" + }, + "nativeSrc": "23013:15:70", + "nodeType": "YulFunctionCall", + "src": "23013:15:70" + }, + { + "name": "value_1", + "nativeSrc": "23030:7:70", + "nodeType": "YulIdentifier", + "src": "23030:7:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "23006:6:70", + "nodeType": "YulIdentifier", + "src": "23006:6:70" + }, + "nativeSrc": "23006:32:70", + "nodeType": "YulFunctionCall", + "src": "23006:32:70" + }, + "nativeSrc": "23006:32:70", + "nodeType": "YulExpressionStatement", + "src": "23006:32:70" + }, + { + "nativeSrc": "23047:17:70", + "nodeType": "YulVariableDeclaration", + "src": "23047:17:70", + "value": { + "name": "_1", + "nativeSrc": "23062:2:70", + "nodeType": "YulIdentifier", + "src": "23062:2:70" + }, + "variables": [ + { + "name": "value_2", + "nativeSrc": "23051:7:70", + "nodeType": "YulTypedName", + "src": "23051:7:70", + "type": "" + } + ] + }, + { + "nativeSrc": "23073:36:70", + "nodeType": "YulAssignment", + "src": "23073:36:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "23094:9:70", + "nodeType": "YulIdentifier", + "src": "23094:9:70" + }, + { + "kind": "number", + "nativeSrc": "23105:2:70", + "nodeType": "YulLiteral", + "src": "23105:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "23090:3:70", + "nodeType": "YulIdentifier", + "src": "23090:3:70" + }, + "nativeSrc": "23090:18:70", + "nodeType": "YulFunctionCall", + "src": "23090:18:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "23084:5:70", + "nodeType": "YulIdentifier", + "src": "23084:5:70" + }, + "nativeSrc": "23084:25:70", + "nodeType": "YulFunctionCall", + "src": "23084:25:70" + }, + "variableNames": [ + { + "name": "value_2", + "nativeSrc": "23073:7:70", + "nodeType": "YulIdentifier", + "src": "23073:7:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "memPtr", + "nativeSrc": "23129:6:70", + "nodeType": "YulIdentifier", + "src": "23129:6:70" + }, + { + "kind": "number", + "nativeSrc": "23137:2:70", + "nodeType": "YulLiteral", + "src": "23137:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "23125:3:70", + "nodeType": "YulIdentifier", + "src": "23125:3:70" + }, + "nativeSrc": "23125:15:70", + "nodeType": "YulFunctionCall", + "src": "23125:15:70" + }, + { + "name": "value_2", + "nativeSrc": "23142:7:70", + "nodeType": "YulIdentifier", + "src": "23142:7:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "23118:6:70", + "nodeType": "YulIdentifier", + "src": "23118:6:70" + }, + "nativeSrc": "23118:32:70", + "nodeType": "YulFunctionCall", + "src": "23118:32:70" + }, + "nativeSrc": "23118:32:70", + "nodeType": "YulExpressionStatement", + "src": "23118:32:70" + }, + { + "nativeSrc": "23159:17:70", + "nodeType": "YulVariableDeclaration", + "src": "23159:17:70", + "value": { + "name": "_1", + "nativeSrc": "23174:2:70", + "nodeType": "YulIdentifier", + "src": "23174:2:70" + }, + "variables": [ + { + "name": "value_3", + "nativeSrc": "23163:7:70", + "nodeType": "YulTypedName", + "src": "23163:7:70", + "type": "" + } + ] + }, + { + "nativeSrc": "23185:36:70", + "nodeType": "YulAssignment", + "src": "23185:36:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "23206:9:70", + "nodeType": "YulIdentifier", + "src": "23206:9:70" + }, + { + "kind": "number", + "nativeSrc": "23217:2:70", + "nodeType": "YulLiteral", + "src": "23217:2:70", + "type": "", + "value": "96" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "23202:3:70", + "nodeType": "YulIdentifier", + "src": "23202:3:70" + }, + "nativeSrc": "23202:18:70", + "nodeType": "YulFunctionCall", + "src": "23202:18:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "23196:5:70", + "nodeType": "YulIdentifier", + "src": "23196:5:70" + }, + "nativeSrc": "23196:25:70", + "nodeType": "YulFunctionCall", + "src": "23196:25:70" + }, + "variableNames": [ + { + "name": "value_3", + "nativeSrc": "23185:7:70", + "nodeType": "YulIdentifier", + "src": "23185:7:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "memPtr", + "nativeSrc": "23241:6:70", + "nodeType": "YulIdentifier", + "src": "23241:6:70" + }, + { + "kind": "number", + "nativeSrc": "23249:2:70", + "nodeType": "YulLiteral", + "src": "23249:2:70", + "type": "", + "value": "96" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "23237:3:70", + "nodeType": "YulIdentifier", + "src": "23237:3:70" + }, + "nativeSrc": "23237:15:70", + "nodeType": "YulFunctionCall", + "src": "23237:15:70" + }, + { + "name": "value_3", + "nativeSrc": "23254:7:70", + "nodeType": "YulIdentifier", + "src": "23254:7:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "23230:6:70", + "nodeType": "YulIdentifier", + "src": "23230:6:70" + }, + "nativeSrc": "23230:32:70", + "nodeType": "YulFunctionCall", + "src": "23230:32:70" + }, + "nativeSrc": "23230:32:70", + "nodeType": "YulExpressionStatement", + "src": "23230:32:70" + }, + { + "nativeSrc": "23271:17:70", + "nodeType": "YulVariableDeclaration", + "src": "23271:17:70", + "value": { + "name": "_1", + "nativeSrc": "23286:2:70", + "nodeType": "YulIdentifier", + "src": "23286:2:70" + }, + "variables": [ + { + "name": "value_4", + "nativeSrc": "23275:7:70", + "nodeType": "YulTypedName", + "src": "23275:7:70", + "type": "" + } + ] + }, + { + "nativeSrc": "23297:37:70", + "nodeType": "YulAssignment", + "src": "23297:37:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "23318:9:70", + "nodeType": "YulIdentifier", + "src": "23318:9:70" + }, + { + "kind": "number", + "nativeSrc": "23329:3:70", + "nodeType": "YulLiteral", + "src": "23329:3:70", + "type": "", + "value": "128" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "23314:3:70", + "nodeType": "YulIdentifier", + "src": "23314:3:70" + }, + "nativeSrc": "23314:19:70", + "nodeType": "YulFunctionCall", + "src": "23314:19:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "23308:5:70", + "nodeType": "YulIdentifier", + "src": "23308:5:70" + }, + "nativeSrc": "23308:26:70", + "nodeType": "YulFunctionCall", + "src": "23308:26:70" + }, + "variableNames": [ + { + "name": "value_4", + "nativeSrc": "23297:7:70", + "nodeType": "YulIdentifier", + "src": "23297:7:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "memPtr", + "nativeSrc": "23354:6:70", + "nodeType": "YulIdentifier", + "src": "23354:6:70" + }, + { + "kind": "number", + "nativeSrc": "23362:3:70", + "nodeType": "YulLiteral", + "src": "23362:3:70", + "type": "", + "value": "128" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "23350:3:70", + "nodeType": "YulIdentifier", + "src": "23350:3:70" + }, + "nativeSrc": "23350:16:70", + "nodeType": "YulFunctionCall", + "src": "23350:16:70" + }, + { + "name": "value_4", + "nativeSrc": "23368:7:70", + "nodeType": "YulIdentifier", + "src": "23368:7:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "23343:6:70", + "nodeType": "YulIdentifier", + "src": "23343:6:70" + }, + "nativeSrc": "23343:33:70", + "nodeType": "YulFunctionCall", + "src": "23343:33:70" + }, + "nativeSrc": "23343:33:70", + "nodeType": "YulExpressionStatement", + "src": "23343:33:70" + }, + { + "nativeSrc": "23385:16:70", + "nodeType": "YulAssignment", + "src": "23385:16:70", + "value": { + "name": "memPtr", + "nativeSrc": "23395:6:70", + "nodeType": "YulIdentifier", + "src": "23395:6:70" + }, + "variableNames": [ + { + "name": "value0", + "nativeSrc": "23385:6:70", + "nodeType": "YulIdentifier", + "src": "23385:6:70" + } + ] + } + ] + }, + "name": "abi_decode_tuple_t_struct$_DelegationPool_$3992_memory_ptr_fromMemory", + "nativeSrc": "22302:1105:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "22381:9:70", + "nodeType": "YulTypedName", + "src": "22381:9:70", + "type": "" + }, + { + "name": "dataEnd", + "nativeSrc": "22392:7:70", + "nodeType": "YulTypedName", + "src": "22392:7:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value0", + "nativeSrc": "22404:6:70", + "nodeType": "YulTypedName", + "src": "22404:6:70", + "type": "" + } + ], + "src": "22302:1105:70" + }, + { + "body": { + "nativeSrc": "23527:341:70", + "nodeType": "YulBlock", + "src": "23527:341:70", + "statements": [ + { + "body": { + "nativeSrc": "23573:16:70", + "nodeType": "YulBlock", + "src": "23573:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "23582:1:70", + "nodeType": "YulLiteral", + "src": "23582:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "23585:1:70", + "nodeType": "YulLiteral", + "src": "23585:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "23575:6:70", + "nodeType": "YulIdentifier", + "src": "23575:6:70" + }, + "nativeSrc": "23575:12:70", + "nodeType": "YulFunctionCall", + "src": "23575:12:70" + }, + "nativeSrc": "23575:12:70", + "nodeType": "YulExpressionStatement", + "src": "23575:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "dataEnd", + "nativeSrc": "23548:7:70", + "nodeType": "YulIdentifier", + "src": "23548:7:70" + }, + { + "name": "headStart", + "nativeSrc": "23557:9:70", + "nodeType": "YulIdentifier", + "src": "23557:9:70" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "23544:3:70", + "nodeType": "YulIdentifier", + "src": "23544:3:70" + }, + "nativeSrc": "23544:23:70", + "nodeType": "YulFunctionCall", + "src": "23544:23:70" + }, + { + "kind": "number", + "nativeSrc": "23569:2:70", + "nodeType": "YulLiteral", + "src": "23569:2:70", + "type": "", + "value": "96" + } + ], + "functionName": { + "name": "slt", + "nativeSrc": "23540:3:70", + "nodeType": "YulIdentifier", + "src": "23540:3:70" + }, + "nativeSrc": "23540:32:70", + "nodeType": "YulFunctionCall", + "src": "23540:32:70" + }, + "nativeSrc": "23537:52:70", + "nodeType": "YulIf", + "src": "23537:52:70" + }, + { + "nativeSrc": "23598:14:70", + "nodeType": "YulVariableDeclaration", + "src": "23598:14:70", + "value": { + "kind": "number", + "nativeSrc": "23611:1:70", + "nodeType": "YulLiteral", + "src": "23611:1:70", + "type": "", + "value": "0" + }, + "variables": [ + { + "name": "value", + "nativeSrc": "23602:5:70", + "nodeType": "YulTypedName", + "src": "23602:5:70", + "type": "" + } + ] + }, + { + "nativeSrc": "23621:25:70", + "nodeType": "YulAssignment", + "src": "23621:25:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "23636:9:70", + "nodeType": "YulIdentifier", + "src": "23636:9:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "23630:5:70", + "nodeType": "YulIdentifier", + "src": "23630:5:70" + }, + "nativeSrc": "23630:16:70", + "nodeType": "YulFunctionCall", + "src": "23630:16:70" + }, + "variableNames": [ + { + "name": "value", + "nativeSrc": "23621:5:70", + "nodeType": "YulIdentifier", + "src": "23621:5:70" + } + ] + }, + { + "nativeSrc": "23655:15:70", + "nodeType": "YulAssignment", + "src": "23655:15:70", + "value": { + "name": "value", + "nativeSrc": "23665:5:70", + "nodeType": "YulIdentifier", + "src": "23665:5:70" + }, + "variableNames": [ + { + "name": "value0", + "nativeSrc": "23655:6:70", + "nodeType": "YulIdentifier", + "src": "23655:6:70" + } + ] + }, + { + "nativeSrc": "23679:16:70", + "nodeType": "YulVariableDeclaration", + "src": "23679:16:70", + "value": { + "kind": "number", + "nativeSrc": "23694:1:70", + "nodeType": "YulLiteral", + "src": "23694:1:70", + "type": "", + "value": "0" + }, + "variables": [ + { + "name": "value_1", + "nativeSrc": "23683:7:70", + "nodeType": "YulTypedName", + "src": "23683:7:70", + "type": "" + } + ] + }, + { + "nativeSrc": "23704:36:70", + "nodeType": "YulAssignment", + "src": "23704:36:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "23725:9:70", + "nodeType": "YulIdentifier", + "src": "23725:9:70" + }, + { + "kind": "number", + "nativeSrc": "23736:2:70", + "nodeType": "YulLiteral", + "src": "23736:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "23721:3:70", + "nodeType": "YulIdentifier", + "src": "23721:3:70" + }, + "nativeSrc": "23721:18:70", + "nodeType": "YulFunctionCall", + "src": "23721:18:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "23715:5:70", + "nodeType": "YulIdentifier", + "src": "23715:5:70" + }, + "nativeSrc": "23715:25:70", + "nodeType": "YulFunctionCall", + "src": "23715:25:70" + }, + "variableNames": [ + { + "name": "value_1", + "nativeSrc": "23704:7:70", + "nodeType": "YulIdentifier", + "src": "23704:7:70" + } + ] + }, + { + "nativeSrc": "23749:17:70", + "nodeType": "YulAssignment", + "src": "23749:17:70", + "value": { + "name": "value_1", + "nativeSrc": "23759:7:70", + "nodeType": "YulIdentifier", + "src": "23759:7:70" + }, + "variableNames": [ + { + "name": "value1", + "nativeSrc": "23749:6:70", + "nodeType": "YulIdentifier", + "src": "23749:6:70" + } + ] + }, + { + "nativeSrc": "23775:16:70", + "nodeType": "YulVariableDeclaration", + "src": "23775:16:70", + "value": { + "kind": "number", + "nativeSrc": "23790:1:70", + "nodeType": "YulLiteral", + "src": "23790:1:70", + "type": "", + "value": "0" + }, + "variables": [ + { + "name": "value_2", + "nativeSrc": "23779:7:70", + "nodeType": "YulTypedName", + "src": "23779:7:70", + "type": "" + } + ] + }, + { + "nativeSrc": "23800:36:70", + "nodeType": "YulAssignment", + "src": "23800:36:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "23821:9:70", + "nodeType": "YulIdentifier", + "src": "23821:9:70" + }, + { + "kind": "number", + "nativeSrc": "23832:2:70", + "nodeType": "YulLiteral", + "src": "23832:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "23817:3:70", + "nodeType": "YulIdentifier", + "src": "23817:3:70" + }, + "nativeSrc": "23817:18:70", + "nodeType": "YulFunctionCall", + "src": "23817:18:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "23811:5:70", + "nodeType": "YulIdentifier", + "src": "23811:5:70" + }, + "nativeSrc": "23811:25:70", + "nodeType": "YulFunctionCall", + "src": "23811:25:70" + }, + "variableNames": [ + { + "name": "value_2", + "nativeSrc": "23800:7:70", + "nodeType": "YulIdentifier", + "src": "23800:7:70" + } + ] + }, + { + "nativeSrc": "23845:17:70", + "nodeType": "YulAssignment", + "src": "23845:17:70", + "value": { + "name": "value_2", + "nativeSrc": "23855:7:70", + "nodeType": "YulIdentifier", + "src": "23855:7:70" + }, + "variableNames": [ + { + "name": "value2", + "nativeSrc": "23845:6:70", + "nodeType": "YulIdentifier", + "src": "23845:6:70" + } + ] + } + ] + }, + "name": "abi_decode_tuple_t_bytes32t_bytes32t_bytes32_fromMemory", + "nativeSrc": "23412:456:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "23477:9:70", + "nodeType": "YulTypedName", + "src": "23477:9:70", + "type": "" + }, + { + "name": "dataEnd", + "nativeSrc": "23488:7:70", + "nodeType": "YulTypedName", + "src": "23488:7:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value0", + "nativeSrc": "23500:6:70", + "nodeType": "YulTypedName", + "src": "23500:6:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "23508:6:70", + "nodeType": "YulTypedName", + "src": "23508:6:70", + "type": "" + }, + { + "name": "value2", + "nativeSrc": "23516:6:70", + "nodeType": "YulTypedName", + "src": "23516:6:70", + "type": "" + } + ], + "src": "23412:456:70" + }, + { + "body": { + "nativeSrc": "24104:291:70", + "nodeType": "YulBlock", + "src": "24104:291:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "name": "pos", + "nativeSrc": "24121:3:70", + "nodeType": "YulIdentifier", + "src": "24121:3:70" + }, + { + "name": "value0", + "nativeSrc": "24126:6:70", + "nodeType": "YulIdentifier", + "src": "24126:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "24114:6:70", + "nodeType": "YulIdentifier", + "src": "24114:6:70" + }, + "nativeSrc": "24114:19:70", + "nodeType": "YulFunctionCall", + "src": "24114:19:70" + }, + "nativeSrc": "24114:19:70", + "nodeType": "YulExpressionStatement", + "src": "24114:19:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "pos", + "nativeSrc": "24153:3:70", + "nodeType": "YulIdentifier", + "src": "24153:3:70" + }, + { + "kind": "number", + "nativeSrc": "24158:2:70", + "nodeType": "YulLiteral", + "src": "24158:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "24149:3:70", + "nodeType": "YulIdentifier", + "src": "24149:3:70" + }, + "nativeSrc": "24149:12:70", + "nodeType": "YulFunctionCall", + "src": "24149:12:70" + }, + { + "name": "value1", + "nativeSrc": "24163:6:70", + "nodeType": "YulIdentifier", + "src": "24163:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "24142:6:70", + "nodeType": "YulIdentifier", + "src": "24142:6:70" + }, + "nativeSrc": "24142:28:70", + "nodeType": "YulFunctionCall", + "src": "24142:28:70" + }, + "nativeSrc": "24142:28:70", + "nodeType": "YulExpressionStatement", + "src": "24142:28:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "pos", + "nativeSrc": "24190:3:70", + "nodeType": "YulIdentifier", + "src": "24190:3:70" + }, + { + "kind": "number", + "nativeSrc": "24195:2:70", + "nodeType": "YulLiteral", + "src": "24195:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "24186:3:70", + "nodeType": "YulIdentifier", + "src": "24186:3:70" + }, + "nativeSrc": "24186:12:70", + "nodeType": "YulFunctionCall", + "src": "24186:12:70" + }, + { + "name": "value2", + "nativeSrc": "24200:6:70", + "nodeType": "YulIdentifier", + "src": "24200:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "24179:6:70", + "nodeType": "YulIdentifier", + "src": "24179:6:70" + }, + "nativeSrc": "24179:28:70", + "nodeType": "YulFunctionCall", + "src": "24179:28:70" + }, + "nativeSrc": "24179:28:70", + "nodeType": "YulExpressionStatement", + "src": "24179:28:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "pos", + "nativeSrc": "24227:3:70", + "nodeType": "YulIdentifier", + "src": "24227:3:70" + }, + { + "kind": "number", + "nativeSrc": "24232:2:70", + "nodeType": "YulLiteral", + "src": "24232:2:70", + "type": "", + "value": "96" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "24223:3:70", + "nodeType": "YulIdentifier", + "src": "24223:3:70" + }, + "nativeSrc": "24223:12:70", + "nodeType": "YulFunctionCall", + "src": "24223:12:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "24245:2:70", + "nodeType": "YulLiteral", + "src": "24245:2:70", + "type": "", + "value": "96" + }, + { + "name": "value3", + "nativeSrc": "24249:6:70", + "nodeType": "YulIdentifier", + "src": "24249:6:70" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "24241:3:70", + "nodeType": "YulIdentifier", + "src": "24241:3:70" + }, + "nativeSrc": "24241:15:70", + "nodeType": "YulFunctionCall", + "src": "24241:15:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "24270:2:70", + "nodeType": "YulLiteral", + "src": "24270:2:70", + "type": "", + "value": "96" + }, + { + "kind": "number", + "nativeSrc": "24274:1:70", + "nodeType": "YulLiteral", + "src": "24274:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "24266:3:70", + "nodeType": "YulIdentifier", + "src": "24266:3:70" + }, + "nativeSrc": "24266:10:70", + "nodeType": "YulFunctionCall", + "src": "24266:10:70" + }, + { + "kind": "number", + "nativeSrc": "24278:1:70", + "nodeType": "YulLiteral", + "src": "24278:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "24262:3:70", + "nodeType": "YulIdentifier", + "src": "24262:3:70" + }, + "nativeSrc": "24262:18:70", + "nodeType": "YulFunctionCall", + "src": "24262:18:70" + } + ], + "functionName": { + "name": "not", + "nativeSrc": "24258:3:70", + "nodeType": "YulIdentifier", + "src": "24258:3:70" + }, + "nativeSrc": "24258:23:70", + "nodeType": "YulFunctionCall", + "src": "24258:23:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "24237:3:70", + "nodeType": "YulIdentifier", + "src": "24237:3:70" + }, + "nativeSrc": "24237:45:70", + "nodeType": "YulFunctionCall", + "src": "24237:45:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "24216:6:70", + "nodeType": "YulIdentifier", + "src": "24216:6:70" + }, + "nativeSrc": "24216:67:70", + "nodeType": "YulFunctionCall", + "src": "24216:67:70" + }, + "nativeSrc": "24216:67:70", + "nodeType": "YulExpressionStatement", + "src": "24216:67:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "pos", + "nativeSrc": "24303:3:70", + "nodeType": "YulIdentifier", + "src": "24303:3:70" + }, + { + "kind": "number", + "nativeSrc": "24308:3:70", + "nodeType": "YulLiteral", + "src": "24308:3:70", + "type": "", + "value": "116" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "24299:3:70", + "nodeType": "YulIdentifier", + "src": "24299:3:70" + }, + "nativeSrc": "24299:13:70", + "nodeType": "YulFunctionCall", + "src": "24299:13:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "24322:2:70", + "nodeType": "YulLiteral", + "src": "24322:2:70", + "type": "", + "value": "96" + }, + { + "name": "value4", + "nativeSrc": "24326:6:70", + "nodeType": "YulIdentifier", + "src": "24326:6:70" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "24318:3:70", + "nodeType": "YulIdentifier", + "src": "24318:3:70" + }, + "nativeSrc": "24318:15:70", + "nodeType": "YulFunctionCall", + "src": "24318:15:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "24347:2:70", + "nodeType": "YulLiteral", + "src": "24347:2:70", + "type": "", + "value": "96" + }, + { + "kind": "number", + "nativeSrc": "24351:1:70", + "nodeType": "YulLiteral", + "src": "24351:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "24343:3:70", + "nodeType": "YulIdentifier", + "src": "24343:3:70" + }, + "nativeSrc": "24343:10:70", + "nodeType": "YulFunctionCall", + "src": "24343:10:70" + }, + { + "kind": "number", + "nativeSrc": "24355:1:70", + "nodeType": "YulLiteral", + "src": "24355:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "24339:3:70", + "nodeType": "YulIdentifier", + "src": "24339:3:70" + }, + "nativeSrc": "24339:18:70", + "nodeType": "YulFunctionCall", + "src": "24339:18:70" + } + ], + "functionName": { + "name": "not", + "nativeSrc": "24335:3:70", + "nodeType": "YulIdentifier", + "src": "24335:3:70" + }, + "nativeSrc": "24335:23:70", + "nodeType": "YulFunctionCall", + "src": "24335:23:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "24314:3:70", + "nodeType": "YulIdentifier", + "src": "24314:3:70" + }, + "nativeSrc": "24314:45:70", + "nodeType": "YulFunctionCall", + "src": "24314:45:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "24292:6:70", + "nodeType": "YulIdentifier", + "src": "24292:6:70" + }, + "nativeSrc": "24292:68:70", + "nodeType": "YulFunctionCall", + "src": "24292:68:70" + }, + "nativeSrc": "24292:68:70", + "nodeType": "YulExpressionStatement", + "src": "24292:68:70" + }, + { + "nativeSrc": "24369:20:70", + "nodeType": "YulAssignment", + "src": "24369:20:70", + "value": { + "arguments": [ + { + "name": "pos", + "nativeSrc": "24380:3:70", + "nodeType": "YulIdentifier", + "src": "24380:3:70" + }, + { + "kind": "number", + "nativeSrc": "24385:3:70", + "nodeType": "YulLiteral", + "src": "24385:3:70", + "type": "", + "value": "136" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "24376:3:70", + "nodeType": "YulIdentifier", + "src": "24376:3:70" + }, + "nativeSrc": "24376:13:70", + "nodeType": "YulFunctionCall", + "src": "24376:13:70" + }, + "variableNames": [ + { + "name": "end", + "nativeSrc": "24369:3:70", + "nodeType": "YulIdentifier", + "src": "24369:3:70" + } + ] + } + ] + }, + "name": "abi_encode_tuple_packed_t_bytes32_t_bytes32_t_bytes32_t_address_t_address__to_t_bytes32_t_bytes32_t_bytes32_t_address_t_address__nonPadded_inplace_fromStack_reversed", + "nativeSrc": "23873:522:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "pos", + "nativeSrc": "24048:3:70", + "nodeType": "YulTypedName", + "src": "24048:3:70", + "type": "" + }, + { + "name": "value4", + "nativeSrc": "24053:6:70", + "nodeType": "YulTypedName", + "src": "24053:6:70", + "type": "" + }, + { + "name": "value3", + "nativeSrc": "24061:6:70", + "nodeType": "YulTypedName", + "src": "24061:6:70", + "type": "" + }, + { + "name": "value2", + "nativeSrc": "24069:6:70", + "nodeType": "YulTypedName", + "src": "24069:6:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "24077:6:70", + "nodeType": "YulTypedName", + "src": "24077:6:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "24085:6:70", + "nodeType": "YulTypedName", + "src": "24085:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "end", + "nativeSrc": "24096:3:70", + "nodeType": "YulTypedName", + "src": "24096:3:70", + "type": "" + } + ], + "src": "23873:522:70" + }, + { + "body": { + "nativeSrc": "24631:273:70", + "nodeType": "YulBlock", + "src": "24631:273:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "24648:9:70", + "nodeType": "YulIdentifier", + "src": "24648:9:70" + }, + { + "name": "value0", + "nativeSrc": "24659:6:70", + "nodeType": "YulIdentifier", + "src": "24659:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "24641:6:70", + "nodeType": "YulIdentifier", + "src": "24641:6:70" + }, + "nativeSrc": "24641:25:70", + "nodeType": "YulFunctionCall", + "src": "24641:25:70" + }, + "nativeSrc": "24641:25:70", + "nodeType": "YulExpressionStatement", + "src": "24641:25:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "24686:9:70", + "nodeType": "YulIdentifier", + "src": "24686:9:70" + }, + { + "kind": "number", + "nativeSrc": "24697:2:70", + "nodeType": "YulLiteral", + "src": "24697:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "24682:3:70", + "nodeType": "YulIdentifier", + "src": "24682:3:70" + }, + "nativeSrc": "24682:18:70", + "nodeType": "YulFunctionCall", + "src": "24682:18:70" + }, + { + "name": "value1", + "nativeSrc": "24702:6:70", + "nodeType": "YulIdentifier", + "src": "24702:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "24675:6:70", + "nodeType": "YulIdentifier", + "src": "24675:6:70" + }, + "nativeSrc": "24675:34:70", + "nodeType": "YulFunctionCall", + "src": "24675:34:70" + }, + "nativeSrc": "24675:34:70", + "nodeType": "YulExpressionStatement", + "src": "24675:34:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "24729:9:70", + "nodeType": "YulIdentifier", + "src": "24729:9:70" + }, + { + "kind": "number", + "nativeSrc": "24740:2:70", + "nodeType": "YulLiteral", + "src": "24740:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "24725:3:70", + "nodeType": "YulIdentifier", + "src": "24725:3:70" + }, + "nativeSrc": "24725:18:70", + "nodeType": "YulFunctionCall", + "src": "24725:18:70" + }, + { + "kind": "number", + "nativeSrc": "24745:3:70", + "nodeType": "YulLiteral", + "src": "24745:3:70", + "type": "", + "value": "160" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "24718:6:70", + "nodeType": "YulIdentifier", + "src": "24718:6:70" + }, + "nativeSrc": "24718:31:70", + "nodeType": "YulFunctionCall", + "src": "24718:31:70" + }, + "nativeSrc": "24718:31:70", + "nodeType": "YulExpressionStatement", + "src": "24718:31:70" + }, + { + "nativeSrc": "24758:53:70", + "nodeType": "YulAssignment", + "src": "24758:53:70", + "value": { + "arguments": [ + { + "name": "value2", + "nativeSrc": "24783:6:70", + "nodeType": "YulIdentifier", + "src": "24783:6:70" + }, + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "24795:9:70", + "nodeType": "YulIdentifier", + "src": "24795:9:70" + }, + { + "kind": "number", + "nativeSrc": "24806:3:70", + "nodeType": "YulLiteral", + "src": "24806:3:70", + "type": "", + "value": "160" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "24791:3:70", + "nodeType": "YulIdentifier", + "src": "24791:3:70" + }, + "nativeSrc": "24791:19:70", + "nodeType": "YulFunctionCall", + "src": "24791:19:70" + } + ], + "functionName": { + "name": "abi_encode_bytes", + "nativeSrc": "24766:16:70", + "nodeType": "YulIdentifier", + "src": "24766:16:70" + }, + "nativeSrc": "24766:45:70", + "nodeType": "YulFunctionCall", + "src": "24766:45:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "24758:4:70", + "nodeType": "YulIdentifier", + "src": "24758:4:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "24831:9:70", + "nodeType": "YulIdentifier", + "src": "24831:9:70" + }, + { + "kind": "number", + "nativeSrc": "24842:2:70", + "nodeType": "YulLiteral", + "src": "24842:2:70", + "type": "", + "value": "96" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "24827:3:70", + "nodeType": "YulIdentifier", + "src": "24827:3:70" + }, + "nativeSrc": "24827:18:70", + "nodeType": "YulFunctionCall", + "src": "24827:18:70" + }, + { + "name": "value3", + "nativeSrc": "24847:6:70", + "nodeType": "YulIdentifier", + "src": "24847:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "24820:6:70", + "nodeType": "YulIdentifier", + "src": "24820:6:70" + }, + "nativeSrc": "24820:34:70", + "nodeType": "YulFunctionCall", + "src": "24820:34:70" + }, + "nativeSrc": "24820:34:70", + "nodeType": "YulExpressionStatement", + "src": "24820:34:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "24874:9:70", + "nodeType": "YulIdentifier", + "src": "24874:9:70" + }, + { + "kind": "number", + "nativeSrc": "24885:3:70", + "nodeType": "YulLiteral", + "src": "24885:3:70", + "type": "", + "value": "128" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "24870:3:70", + "nodeType": "YulIdentifier", + "src": "24870:3:70" + }, + "nativeSrc": "24870:19:70", + "nodeType": "YulFunctionCall", + "src": "24870:19:70" + }, + { + "name": "value4", + "nativeSrc": "24891:6:70", + "nodeType": "YulIdentifier", + "src": "24891:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "24863:6:70", + "nodeType": "YulIdentifier", + "src": "24863:6:70" + }, + "nativeSrc": "24863:35:70", + "nodeType": "YulFunctionCall", + "src": "24863:35:70" + }, + "nativeSrc": "24863:35:70", + "nodeType": "YulExpressionStatement", + "src": "24863:35:70" + } + ] + }, + "name": "abi_encode_tuple_t_uint256_t_bytes32_t_bytes_memory_ptr_t_uint256_t_uint256__to_t_uint256_t_bytes32_t_bytes_memory_ptr_t_uint256_t_uint256__fromStack_reversed", + "nativeSrc": "24400:504:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "24568:9:70", + "nodeType": "YulTypedName", + "src": "24568:9:70", + "type": "" + }, + { + "name": "value4", + "nativeSrc": "24579:6:70", + "nodeType": "YulTypedName", + "src": "24579:6:70", + "type": "" + }, + { + "name": "value3", + "nativeSrc": "24587:6:70", + "nodeType": "YulTypedName", + "src": "24587:6:70", + "type": "" + }, + { + "name": "value2", + "nativeSrc": "24595:6:70", + "nodeType": "YulTypedName", + "src": "24595:6:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "24603:6:70", + "nodeType": "YulTypedName", + "src": "24603:6:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "24611:6:70", + "nodeType": "YulTypedName", + "src": "24611:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "24622:4:70", + "nodeType": "YulTypedName", + "src": "24622:4:70", + "type": "" + } + ], + "src": "24400:504:70" + }, + { + "body": { + "nativeSrc": "25080:167:70", + "nodeType": "YulBlock", + "src": "25080:167:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "name": "pos", + "nativeSrc": "25097:3:70", + "nodeType": "YulIdentifier", + "src": "25097:3:70" + }, + { + "name": "value0", + "nativeSrc": "25102:6:70", + "nodeType": "YulIdentifier", + "src": "25102:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "25090:6:70", + "nodeType": "YulIdentifier", + "src": "25090:6:70" + }, + "nativeSrc": "25090:19:70", + "nodeType": "YulFunctionCall", + "src": "25090:19:70" + }, + "nativeSrc": "25090:19:70", + "nodeType": "YulExpressionStatement", + "src": "25090:19:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "pos", + "nativeSrc": "25129:3:70", + "nodeType": "YulIdentifier", + "src": "25129:3:70" + }, + { + "kind": "number", + "nativeSrc": "25134:2:70", + "nodeType": "YulLiteral", + "src": "25134:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "25125:3:70", + "nodeType": "YulIdentifier", + "src": "25125:3:70" + }, + "nativeSrc": "25125:12:70", + "nodeType": "YulFunctionCall", + "src": "25125:12:70" + }, + { + "name": "value1", + "nativeSrc": "25139:6:70", + "nodeType": "YulIdentifier", + "src": "25139:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "25118:6:70", + "nodeType": "YulIdentifier", + "src": "25118:6:70" + }, + "nativeSrc": "25118:28:70", + "nodeType": "YulFunctionCall", + "src": "25118:28:70" + }, + "nativeSrc": "25118:28:70", + "nodeType": "YulExpressionStatement", + "src": "25118:28:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "pos", + "nativeSrc": "25166:3:70", + "nodeType": "YulIdentifier", + "src": "25166:3:70" + }, + { + "kind": "number", + "nativeSrc": "25171:2:70", + "nodeType": "YulLiteral", + "src": "25171:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "25162:3:70", + "nodeType": "YulIdentifier", + "src": "25162:3:70" + }, + "nativeSrc": "25162:12:70", + "nodeType": "YulFunctionCall", + "src": "25162:12:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "25184:3:70", + "nodeType": "YulLiteral", + "src": "25184:3:70", + "type": "", + "value": "248" + }, + { + "name": "value2", + "nativeSrc": "25189:6:70", + "nodeType": "YulIdentifier", + "src": "25189:6:70" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "25180:3:70", + "nodeType": "YulIdentifier", + "src": "25180:3:70" + }, + "nativeSrc": "25180:16:70", + "nodeType": "YulFunctionCall", + "src": "25180:16:70" + }, + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "25202:3:70", + "nodeType": "YulLiteral", + "src": "25202:3:70", + "type": "", + "value": "248" + }, + { + "kind": "number", + "nativeSrc": "25207:3:70", + "nodeType": "YulLiteral", + "src": "25207:3:70", + "type": "", + "value": "255" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "25198:3:70", + "nodeType": "YulIdentifier", + "src": "25198:3:70" + }, + "nativeSrc": "25198:13:70", + "nodeType": "YulFunctionCall", + "src": "25198:13:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "25176:3:70", + "nodeType": "YulIdentifier", + "src": "25176:3:70" + }, + "nativeSrc": "25176:36:70", + "nodeType": "YulFunctionCall", + "src": "25176:36:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "25155:6:70", + "nodeType": "YulIdentifier", + "src": "25155:6:70" + }, + "nativeSrc": "25155:58:70", + "nodeType": "YulFunctionCall", + "src": "25155:58:70" + }, + "nativeSrc": "25155:58:70", + "nodeType": "YulExpressionStatement", + "src": "25155:58:70" + }, + { + "nativeSrc": "25222:19:70", + "nodeType": "YulAssignment", + "src": "25222:19:70", + "value": { + "arguments": [ + { + "name": "pos", + "nativeSrc": "25233:3:70", + "nodeType": "YulIdentifier", + "src": "25233:3:70" + }, + { + "kind": "number", + "nativeSrc": "25238:2:70", + "nodeType": "YulLiteral", + "src": "25238:2:70", + "type": "", + "value": "65" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "25229:3:70", + "nodeType": "YulIdentifier", + "src": "25229:3:70" + }, + "nativeSrc": "25229:12:70", + "nodeType": "YulFunctionCall", + "src": "25229:12:70" + }, + "variableNames": [ + { + "name": "end", + "nativeSrc": "25222:3:70", + "nodeType": "YulIdentifier", + "src": "25222:3:70" + } + ] + } + ] + }, + "name": "abi_encode_tuple_packed_t_bytes32_t_bytes32_t_uint8__to_t_bytes32_t_bytes32_t_uint8__nonPadded_inplace_fromStack_reversed", + "nativeSrc": "24909:338:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "pos", + "nativeSrc": "25040:3:70", + "nodeType": "YulTypedName", + "src": "25040:3:70", + "type": "" + }, + { + "name": "value2", + "nativeSrc": "25045:6:70", + "nodeType": "YulTypedName", + "src": "25045:6:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "25053:6:70", + "nodeType": "YulTypedName", + "src": "25053:6:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "25061:6:70", + "nodeType": "YulTypedName", + "src": "25061:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "end", + "nativeSrc": "25072:3:70", + "nodeType": "YulTypedName", + "src": "25072:3:70", + "type": "" + } + ], + "src": "24909:338:70" + }, + { + "body": { + "nativeSrc": "25493:320:70", + "nodeType": "YulBlock", + "src": "25493:320:70", + "statements": [ + { + "nativeSrc": "25503:27:70", + "nodeType": "YulAssignment", + "src": "25503:27:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "25515:9:70", + "nodeType": "YulIdentifier", + "src": "25515:9:70" + }, + { + "kind": "number", + "nativeSrc": "25526:3:70", + "nodeType": "YulLiteral", + "src": "25526:3:70", + "type": "", + "value": "192" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "25511:3:70", + "nodeType": "YulIdentifier", + "src": "25511:3:70" + }, + "nativeSrc": "25511:19:70", + "nodeType": "YulFunctionCall", + "src": "25511:19:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "25503:4:70", + "nodeType": "YulIdentifier", + "src": "25503:4:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "25546:9:70", + "nodeType": "YulIdentifier", + "src": "25546:9:70" + }, + { + "name": "value0", + "nativeSrc": "25557:6:70", + "nodeType": "YulIdentifier", + "src": "25557:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "25539:6:70", + "nodeType": "YulIdentifier", + "src": "25539:6:70" + }, + "nativeSrc": "25539:25:70", + "nodeType": "YulFunctionCall", + "src": "25539:25:70" + }, + "nativeSrc": "25539:25:70", + "nodeType": "YulExpressionStatement", + "src": "25539:25:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "25584:9:70", + "nodeType": "YulIdentifier", + "src": "25584:9:70" + }, + { + "kind": "number", + "nativeSrc": "25595:2:70", + "nodeType": "YulLiteral", + "src": "25595:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "25580:3:70", + "nodeType": "YulIdentifier", + "src": "25580:3:70" + }, + "nativeSrc": "25580:18:70", + "nodeType": "YulFunctionCall", + "src": "25580:18:70" + }, + { + "name": "value1", + "nativeSrc": "25600:6:70", + "nodeType": "YulIdentifier", + "src": "25600:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "25573:6:70", + "nodeType": "YulIdentifier", + "src": "25573:6:70" + }, + "nativeSrc": "25573:34:70", + "nodeType": "YulFunctionCall", + "src": "25573:34:70" + }, + "nativeSrc": "25573:34:70", + "nodeType": "YulExpressionStatement", + "src": "25573:34:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "25627:9:70", + "nodeType": "YulIdentifier", + "src": "25627:9:70" + }, + { + "kind": "number", + "nativeSrc": "25638:2:70", + "nodeType": "YulLiteral", + "src": "25638:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "25623:3:70", + "nodeType": "YulIdentifier", + "src": "25623:3:70" + }, + "nativeSrc": "25623:18:70", + "nodeType": "YulFunctionCall", + "src": "25623:18:70" + }, + { + "name": "value2", + "nativeSrc": "25643:6:70", + "nodeType": "YulIdentifier", + "src": "25643:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "25616:6:70", + "nodeType": "YulIdentifier", + "src": "25616:6:70" + }, + "nativeSrc": "25616:34:70", + "nodeType": "YulFunctionCall", + "src": "25616:34:70" + }, + "nativeSrc": "25616:34:70", + "nodeType": "YulExpressionStatement", + "src": "25616:34:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "25670:9:70", + "nodeType": "YulIdentifier", + "src": "25670:9:70" + }, + { + "kind": "number", + "nativeSrc": "25681:2:70", + "nodeType": "YulLiteral", + "src": "25681:2:70", + "type": "", + "value": "96" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "25666:3:70", + "nodeType": "YulIdentifier", + "src": "25666:3:70" + }, + "nativeSrc": "25666:18:70", + "nodeType": "YulFunctionCall", + "src": "25666:18:70" + }, + { + "name": "value3", + "nativeSrc": "25686:6:70", + "nodeType": "YulIdentifier", + "src": "25686:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "25659:6:70", + "nodeType": "YulIdentifier", + "src": "25659:6:70" + }, + "nativeSrc": "25659:34:70", + "nodeType": "YulFunctionCall", + "src": "25659:34:70" + }, + "nativeSrc": "25659:34:70", + "nodeType": "YulExpressionStatement", + "src": "25659:34:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "25713:9:70", + "nodeType": "YulIdentifier", + "src": "25713:9:70" + }, + { + "kind": "number", + "nativeSrc": "25724:3:70", + "nodeType": "YulLiteral", + "src": "25724:3:70", + "type": "", + "value": "128" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "25709:3:70", + "nodeType": "YulIdentifier", + "src": "25709:3:70" + }, + "nativeSrc": "25709:19:70", + "nodeType": "YulFunctionCall", + "src": "25709:19:70" + }, + { + "arguments": [ + { + "name": "value4", + "nativeSrc": "25734:6:70", + "nodeType": "YulIdentifier", + "src": "25734:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "25750:3:70", + "nodeType": "YulLiteral", + "src": "25750:3:70", + "type": "", + "value": "160" + }, + { + "kind": "number", + "nativeSrc": "25755:1:70", + "nodeType": "YulLiteral", + "src": "25755:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "25746:3:70", + "nodeType": "YulIdentifier", + "src": "25746:3:70" + }, + "nativeSrc": "25746:11:70", + "nodeType": "YulFunctionCall", + "src": "25746:11:70" + }, + { + "kind": "number", + "nativeSrc": "25759:1:70", + "nodeType": "YulLiteral", + "src": "25759:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "25742:3:70", + "nodeType": "YulIdentifier", + "src": "25742:3:70" + }, + "nativeSrc": "25742:19:70", + "nodeType": "YulFunctionCall", + "src": "25742:19:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "25730:3:70", + "nodeType": "YulIdentifier", + "src": "25730:3:70" + }, + "nativeSrc": "25730:32:70", + "nodeType": "YulFunctionCall", + "src": "25730:32:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "25702:6:70", + "nodeType": "YulIdentifier", + "src": "25702:6:70" + }, + "nativeSrc": "25702:61:70", + "nodeType": "YulFunctionCall", + "src": "25702:61:70" + }, + "nativeSrc": "25702:61:70", + "nodeType": "YulExpressionStatement", + "src": "25702:61:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "25783:9:70", + "nodeType": "YulIdentifier", + "src": "25783:9:70" + }, + { + "kind": "number", + "nativeSrc": "25794:3:70", + "nodeType": "YulLiteral", + "src": "25794:3:70", + "type": "", + "value": "160" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "25779:3:70", + "nodeType": "YulIdentifier", + "src": "25779:3:70" + }, + "nativeSrc": "25779:19:70", + "nodeType": "YulFunctionCall", + "src": "25779:19:70" + }, + { + "name": "value5", + "nativeSrc": "25800:6:70", + "nodeType": "YulIdentifier", + "src": "25800:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "25772:6:70", + "nodeType": "YulIdentifier", + "src": "25772:6:70" + }, + "nativeSrc": "25772:35:70", + "nodeType": "YulFunctionCall", + "src": "25772:35:70" + }, + "nativeSrc": "25772:35:70", + "nodeType": "YulExpressionStatement", + "src": "25772:35:70" + } + ] + }, + "name": "abi_encode_tuple_t_bytes32_t_bytes32_t_bytes32_t_uint256_t_address_t_bytes32__to_t_bytes32_t_bytes32_t_bytes32_t_uint256_t_address_t_bytes32__fromStack_reversed", + "nativeSrc": "25252:561:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "25422:9:70", + "nodeType": "YulTypedName", + "src": "25422:9:70", + "type": "" + }, + { + "name": "value5", + "nativeSrc": "25433:6:70", + "nodeType": "YulTypedName", + "src": "25433:6:70", + "type": "" + }, + { + "name": "value4", + "nativeSrc": "25441:6:70", + "nodeType": "YulTypedName", + "src": "25441:6:70", + "type": "" + }, + { + "name": "value3", + "nativeSrc": "25449:6:70", + "nodeType": "YulTypedName", + "src": "25449:6:70", + "type": "" + }, + { + "name": "value2", + "nativeSrc": "25457:6:70", + "nodeType": "YulTypedName", + "src": "25457:6:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "25465:6:70", + "nodeType": "YulTypedName", + "src": "25465:6:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "25473:6:70", + "nodeType": "YulTypedName", + "src": "25473:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "25484:4:70", + "nodeType": "YulTypedName", + "src": "25484:4:70", + "type": "" + } + ], + "src": "25252:561:70" + }, + { + "body": { + "nativeSrc": "25870:116:70", + "nodeType": "YulBlock", + "src": "25870:116:70", + "statements": [ + { + "nativeSrc": "25880:20:70", + "nodeType": "YulAssignment", + "src": "25880:20:70", + "value": { + "arguments": [ + { + "name": "x", + "nativeSrc": "25895:1:70", + "nodeType": "YulIdentifier", + "src": "25895:1:70" + }, + { + "name": "y", + "nativeSrc": "25898:1:70", + "nodeType": "YulIdentifier", + "src": "25898:1:70" + } + ], + "functionName": { + "name": "mul", + "nativeSrc": "25891:3:70", + "nodeType": "YulIdentifier", + "src": "25891:3:70" + }, + "nativeSrc": "25891:9:70", + "nodeType": "YulFunctionCall", + "src": "25891:9:70" + }, + "variableNames": [ + { + "name": "product", + "nativeSrc": "25880:7:70", + "nodeType": "YulIdentifier", + "src": "25880:7:70" + } + ] + }, + { + "body": { + "nativeSrc": "25958:22:70", + "nodeType": "YulBlock", + "src": "25958:22:70", + "statements": [ + { + "expression": { + "arguments": [], + "functionName": { + "name": "panic_error_0x11", + "nativeSrc": "25960:16:70", + "nodeType": "YulIdentifier", + "src": "25960:16:70" + }, + "nativeSrc": "25960:18:70", + "nodeType": "YulFunctionCall", + "src": "25960:18:70" + }, + "nativeSrc": "25960:18:70", + "nodeType": "YulExpressionStatement", + "src": "25960:18:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "arguments": [ + { + "name": "x", + "nativeSrc": "25929:1:70", + "nodeType": "YulIdentifier", + "src": "25929:1:70" + } + ], + "functionName": { + "name": "iszero", + "nativeSrc": "25922:6:70", + "nodeType": "YulIdentifier", + "src": "25922:6:70" + }, + "nativeSrc": "25922:9:70", + "nodeType": "YulFunctionCall", + "src": "25922:9:70" + }, + { + "arguments": [ + { + "name": "y", + "nativeSrc": "25936:1:70", + "nodeType": "YulIdentifier", + "src": "25936:1:70" + }, + { + "arguments": [ + { + "name": "product", + "nativeSrc": "25943:7:70", + "nodeType": "YulIdentifier", + "src": "25943:7:70" + }, + { + "name": "x", + "nativeSrc": "25952:1:70", + "nodeType": "YulIdentifier", + "src": "25952:1:70" + } + ], + "functionName": { + "name": "div", + "nativeSrc": "25939:3:70", + "nodeType": "YulIdentifier", + "src": "25939:3:70" + }, + "nativeSrc": "25939:15:70", + "nodeType": "YulFunctionCall", + "src": "25939:15:70" + } + ], + "functionName": { + "name": "eq", + "nativeSrc": "25933:2:70", + "nodeType": "YulIdentifier", + "src": "25933:2:70" + }, + "nativeSrc": "25933:22:70", + "nodeType": "YulFunctionCall", + "src": "25933:22:70" + } + ], + "functionName": { + "name": "or", + "nativeSrc": "25919:2:70", + "nodeType": "YulIdentifier", + "src": "25919:2:70" + }, + "nativeSrc": "25919:37:70", + "nodeType": "YulFunctionCall", + "src": "25919:37:70" + } + ], + "functionName": { + "name": "iszero", + "nativeSrc": "25912:6:70", + "nodeType": "YulIdentifier", + "src": "25912:6:70" + }, + "nativeSrc": "25912:45:70", + "nodeType": "YulFunctionCall", + "src": "25912:45:70" + }, + "nativeSrc": "25909:71:70", + "nodeType": "YulIf", + "src": "25909:71:70" + } + ] + }, + "name": "checked_mul_t_uint256", + "nativeSrc": "25818:168:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "x", + "nativeSrc": "25849:1:70", + "nodeType": "YulTypedName", + "src": "25849:1:70", + "type": "" + }, + { + "name": "y", + "nativeSrc": "25852:1:70", + "nodeType": "YulTypedName", + "src": "25852:1:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "product", + "nativeSrc": "25858:7:70", + "nodeType": "YulTypedName", + "src": "25858:7:70", + "type": "" + } + ], + "src": "25818:168:70" + }, + { + "body": { + "nativeSrc": "26172:217:70", + "nodeType": "YulBlock", + "src": "26172:217:70", + "statements": [ + { + "nativeSrc": "26182:27:70", + "nodeType": "YulAssignment", + "src": "26182:27:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "26194:9:70", + "nodeType": "YulIdentifier", + "src": "26194:9:70" + }, + { + "kind": "number", + "nativeSrc": "26205:3:70", + "nodeType": "YulLiteral", + "src": "26205:3:70", + "type": "", + "value": "128" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "26190:3:70", + "nodeType": "YulIdentifier", + "src": "26190:3:70" + }, + "nativeSrc": "26190:19:70", + "nodeType": "YulFunctionCall", + "src": "26190:19:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "26182:4:70", + "nodeType": "YulIdentifier", + "src": "26182:4:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "26225:9:70", + "nodeType": "YulIdentifier", + "src": "26225:9:70" + }, + { + "name": "value0", + "nativeSrc": "26236:6:70", + "nodeType": "YulIdentifier", + "src": "26236:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "26218:6:70", + "nodeType": "YulIdentifier", + "src": "26218:6:70" + }, + "nativeSrc": "26218:25:70", + "nodeType": "YulFunctionCall", + "src": "26218:25:70" + }, + "nativeSrc": "26218:25:70", + "nodeType": "YulExpressionStatement", + "src": "26218:25:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "26263:9:70", + "nodeType": "YulIdentifier", + "src": "26263:9:70" + }, + { + "kind": "number", + "nativeSrc": "26274:2:70", + "nodeType": "YulLiteral", + "src": "26274:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "26259:3:70", + "nodeType": "YulIdentifier", + "src": "26259:3:70" + }, + "nativeSrc": "26259:18:70", + "nodeType": "YulFunctionCall", + "src": "26259:18:70" + }, + { + "arguments": [ + { + "name": "value1", + "nativeSrc": "26283:6:70", + "nodeType": "YulIdentifier", + "src": "26283:6:70" + }, + { + "kind": "number", + "nativeSrc": "26291:4:70", + "nodeType": "YulLiteral", + "src": "26291:4:70", + "type": "", + "value": "0xff" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "26279:3:70", + "nodeType": "YulIdentifier", + "src": "26279:3:70" + }, + "nativeSrc": "26279:17:70", + "nodeType": "YulFunctionCall", + "src": "26279:17:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "26252:6:70", + "nodeType": "YulIdentifier", + "src": "26252:6:70" + }, + "nativeSrc": "26252:45:70", + "nodeType": "YulFunctionCall", + "src": "26252:45:70" + }, + "nativeSrc": "26252:45:70", + "nodeType": "YulExpressionStatement", + "src": "26252:45:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "26317:9:70", + "nodeType": "YulIdentifier", + "src": "26317:9:70" + }, + { + "kind": "number", + "nativeSrc": "26328:2:70", + "nodeType": "YulLiteral", + "src": "26328:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "26313:3:70", + "nodeType": "YulIdentifier", + "src": "26313:3:70" + }, + "nativeSrc": "26313:18:70", + "nodeType": "YulFunctionCall", + "src": "26313:18:70" + }, + { + "name": "value2", + "nativeSrc": "26333:6:70", + "nodeType": "YulIdentifier", + "src": "26333:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "26306:6:70", + "nodeType": "YulIdentifier", + "src": "26306:6:70" + }, + "nativeSrc": "26306:34:70", + "nodeType": "YulFunctionCall", + "src": "26306:34:70" + }, + "nativeSrc": "26306:34:70", + "nodeType": "YulExpressionStatement", + "src": "26306:34:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "26360:9:70", + "nodeType": "YulIdentifier", + "src": "26360:9:70" + }, + { + "kind": "number", + "nativeSrc": "26371:2:70", + "nodeType": "YulLiteral", + "src": "26371:2:70", + "type": "", + "value": "96" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "26356:3:70", + "nodeType": "YulIdentifier", + "src": "26356:3:70" + }, + "nativeSrc": "26356:18:70", + "nodeType": "YulFunctionCall", + "src": "26356:18:70" + }, + { + "name": "value3", + "nativeSrc": "26376:6:70", + "nodeType": "YulIdentifier", + "src": "26376:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "26349:6:70", + "nodeType": "YulIdentifier", + "src": "26349:6:70" + }, + "nativeSrc": "26349:34:70", + "nodeType": "YulFunctionCall", + "src": "26349:34:70" + }, + "nativeSrc": "26349:34:70", + "nodeType": "YulExpressionStatement", + "src": "26349:34:70" + } + ] + }, + "name": "abi_encode_tuple_t_bytes32_t_uint8_t_bytes32_t_bytes32__to_t_bytes32_t_uint8_t_bytes32_t_bytes32__fromStack_reversed", + "nativeSrc": "25991:398:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "26117:9:70", + "nodeType": "YulTypedName", + "src": "26117:9:70", + "type": "" + }, + { + "name": "value3", + "nativeSrc": "26128:6:70", + "nodeType": "YulTypedName", + "src": "26128:6:70", + "type": "" + }, + { + "name": "value2", + "nativeSrc": "26136:6:70", + "nodeType": "YulTypedName", + "src": "26136:6:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "26144:6:70", + "nodeType": "YulTypedName", + "src": "26144:6:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "26152:6:70", + "nodeType": "YulTypedName", + "src": "26152:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "26163:4:70", + "nodeType": "YulTypedName", + "src": "26163:4:70", + "type": "" + } + ], + "src": "25991:398:70" + } + ] + }, + "contents": "{\n { }\n function abi_decode_tuple_t_bytes32t_uint256(headStart, dataEnd) -> value0, value1\n {\n if slt(sub(dataEnd, headStart), 64) { revert(0, 0) }\n let value := 0\n value := calldataload(headStart)\n value0 := value\n let value_1 := 0\n value_1 := calldataload(add(headStart, 32))\n value1 := value_1\n }\n function abi_encode_tuple_t_uint32__to_t_uint32__fromStack_reversed(headStart, value0) -> tail\n {\n tail := add(headStart, 32)\n mstore(headStart, and(value0, 0xffffffff))\n }\n function validator_revert_address(value)\n {\n if iszero(eq(value, and(value, sub(shl(160, 1), 1)))) { revert(0, 0) }\n }\n function validator_revert_uint64(value)\n {\n if iszero(eq(value, and(value, sub(shl(64, 1), 1)))) { revert(0, 0) }\n }\n function validator_revert_uint32(value)\n {\n if iszero(eq(value, and(value, 0xffffffff))) { revert(0, 0) }\n }\n function abi_decode_tuple_t_addresst_addresst_uint64t_uint256t_uint32t_uint32(headStart, dataEnd) -> value0, value1, value2, value3, value4, value5\n {\n if slt(sub(dataEnd, headStart), 192) { revert(0, 0) }\n let value := calldataload(headStart)\n validator_revert_address(value)\n value0 := value\n let value_1 := calldataload(add(headStart, 32))\n validator_revert_address(value_1)\n value1 := value_1\n let value_2 := calldataload(add(headStart, 64))\n validator_revert_uint64(value_2)\n value2 := value_2\n let value_3 := 0\n value_3 := calldataload(add(headStart, 96))\n value3 := value_3\n let value_4 := calldataload(add(headStart, 128))\n validator_revert_uint32(value_4)\n value4 := value_4\n let value_5 := calldataload(add(headStart, 160))\n validator_revert_uint32(value_5)\n value5 := value_5\n }\n function abi_decode_tuple_t_bytes32(headStart, dataEnd) -> value0\n {\n if slt(sub(dataEnd, headStart), 32) { revert(0, 0) }\n let value := 0\n value := calldataload(headStart)\n value0 := value\n }\n function panic_error_0x21()\n {\n mstore(0, shl(224, 0x4e487b71))\n mstore(4, 0x21)\n revert(0, 0x24)\n }\n function abi_encode_enum_DisputeStatus(value, pos)\n {\n if iszero(lt(value, 6)) { panic_error_0x21() }\n mstore(pos, value)\n }\n function abi_encode_tuple_t_address_t_address_t_uint256_t_bytes32_t_enum$_DisputeType_$14913_t_enum$_DisputeStatus_$14921_t_uint256_t_uint256_t_uint256__to_t_address_t_address_t_uint256_t_bytes32_t_uint8_t_uint8_t_uint256_t_uint256_t_uint256__fromStack_reversed(headStart, value8, value7, value6, value5, value4, value3, value2, value1, value0) -> tail\n {\n tail := add(headStart, 288)\n mstore(headStart, and(value0, sub(shl(160, 1), 1)))\n mstore(add(headStart, 32), and(value1, sub(shl(160, 1), 1)))\n mstore(add(headStart, 64), value2)\n mstore(add(headStart, 96), value3)\n if iszero(lt(value4, 4)) { panic_error_0x21() }\n mstore(add(headStart, 128), value4)\n abi_encode_enum_DisputeStatus(value5, add(headStart, 160))\n mstore(add(headStart, 192), value6)\n mstore(add(headStart, 224), value7)\n mstore(add(headStart, 256), value8)\n }\n function abi_decode_tuple_t_uint256(headStart, dataEnd) -> value0\n {\n if slt(sub(dataEnd, headStart), 32) { revert(0, 0) }\n let value := 0\n value := calldataload(headStart)\n value0 := value\n }\n function abi_encode_tuple_t_contract$_ISubgraphService_$15634__to_t_address__fromStack_reversed(headStart, value0) -> tail\n {\n tail := add(headStart, 32)\n mstore(headStart, and(value0, sub(shl(160, 1), 1)))\n }\n function abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed(headStart, value0) -> tail\n {\n tail := add(headStart, 32)\n mstore(headStart, value0)\n }\n function abi_decode_tuple_t_addresst_bytes32(headStart, dataEnd) -> value0, value1\n {\n if slt(sub(dataEnd, headStart), 64) { revert(0, 0) }\n let value := calldataload(headStart)\n validator_revert_address(value)\n value0 := value\n let value_1 := 0\n value_1 := calldataload(add(headStart, 32))\n value1 := value_1\n }\n function abi_encode_tuple_t_bytes32__to_t_bytes32__fromStack_reversed(headStart, value0) -> tail\n {\n tail := add(headStart, 32)\n mstore(headStart, value0)\n }\n function abi_encode_tuple_t_uint64__to_t_uint64__fromStack_reversed(headStart, value0) -> tail\n {\n tail := add(headStart, 32)\n mstore(headStart, and(value0, sub(shl(64, 1), 1)))\n }\n function abi_decode_tuple_t_struct$_Receipt_$16044_calldata_ptr(headStart, dataEnd) -> value0\n {\n let _1 := slt(sub(dataEnd, headStart), 96)\n if _1 { revert(0, 0) }\n _1 := 0\n value0 := headStart\n }\n function abi_encode_tuple_t_address__to_t_address__fromStack_reversed(headStart, value0) -> tail\n {\n tail := add(headStart, 32)\n mstore(headStart, and(value0, sub(shl(160, 1), 1)))\n }\n function abi_decode_tuple_t_uint32(headStart, dataEnd) -> value0\n {\n if slt(sub(dataEnd, headStart), 32) { revert(0, 0) }\n let value := calldataload(headStart)\n validator_revert_uint32(value)\n value0 := value\n }\n function abi_decode_tuple_t_addresst_addresst_uint256t_uint256(headStart, dataEnd) -> value0, value1, value2, value3\n {\n if slt(sub(dataEnd, headStart), 128) { revert(0, 0) }\n let value := calldataload(headStart)\n validator_revert_address(value)\n value0 := value\n let value_1 := calldataload(add(headStart, 32))\n validator_revert_address(value_1)\n value1 := value_1\n let value_2 := 0\n value_2 := calldataload(add(headStart, 64))\n value2 := value_2\n let value_3 := 0\n value_3 := calldataload(add(headStart, 96))\n value3 := value_3\n }\n function abi_decode_tuple_t_address(headStart, dataEnd) -> value0\n {\n if slt(sub(dataEnd, headStart), 32) { revert(0, 0) }\n let value := calldataload(headStart)\n validator_revert_address(value)\n value0 := value\n }\n function validator_revert_bool(value)\n {\n if iszero(eq(value, iszero(iszero(value)))) { revert(0, 0) }\n }\n function abi_decode_tuple_t_bytes32t_uint256t_boolt_uint256(headStart, dataEnd) -> value0, value1, value2, value3\n {\n if slt(sub(dataEnd, headStart), 128) { revert(0, 0) }\n let value := 0\n value := calldataload(headStart)\n value0 := value\n let value_1 := 0\n value_1 := calldataload(add(headStart, 32))\n value1 := value_1\n let value_2 := calldataload(add(headStart, 64))\n validator_revert_bool(value_2)\n value2 := value_2\n let value_3 := 0\n value_3 := calldataload(add(headStart, 96))\n value3 := value_3\n }\n function abi_encode_tuple_t_bool__to_t_bool__fromStack_reversed(headStart, value0) -> tail\n {\n tail := add(headStart, 32)\n mstore(headStart, iszero(iszero(value0)))\n }\n function abi_decode_bytes_calldata(offset, end) -> arrayPos, length\n {\n if iszero(slt(add(offset, 0x1f), end)) { revert(0, 0) }\n length := calldataload(offset)\n if gt(length, sub(shl(64, 1), 1)) { revert(0, 0) }\n arrayPos := add(offset, 0x20)\n if gt(add(add(offset, length), 0x20), end) { revert(0, 0) }\n }\n function abi_decode_tuple_t_bytes_calldata_ptr(headStart, dataEnd) -> value0, value1\n {\n if slt(sub(dataEnd, headStart), 32) { revert(0, 0) }\n let offset := calldataload(headStart)\n if gt(offset, sub(shl(64, 1), 1)) { revert(0, 0) }\n let value0_1, value1_1 := abi_decode_bytes_calldata(add(headStart, offset), dataEnd)\n value0 := value0_1\n value1 := value1_1\n }\n function abi_decode_tuple_t_bytes_calldata_ptrt_bytes_calldata_ptr(headStart, dataEnd) -> value0, value1, value2, value3\n {\n if slt(sub(dataEnd, headStart), 64) { revert(0, 0) }\n let offset := calldataload(headStart)\n if gt(offset, sub(shl(64, 1), 1)) { revert(0, 0) }\n let value0_1, value1_1 := abi_decode_bytes_calldata(add(headStart, offset), dataEnd)\n value0 := value0_1\n value1 := value1_1\n let offset_1 := calldataload(add(headStart, 32))\n if gt(offset_1, sub(shl(64, 1), 1)) { revert(0, 0) }\n let value2_1, value3_1 := abi_decode_bytes_calldata(add(headStart, offset_1), dataEnd)\n value2 := value2_1\n value3 := value3_1\n }\n function abi_encode_tuple_t_bytes32_t_bytes32__to_t_bytes32_t_bytes32__fromStack_reversed(headStart, value1, value0) -> tail\n {\n tail := add(headStart, 64)\n mstore(headStart, value0)\n mstore(add(headStart, 32), value1)\n }\n function allocate_memory() -> memPtr\n {\n memPtr := mload(64)\n let newFreePtr := add(memPtr, 192)\n if or(gt(newFreePtr, sub(shl(64, 1), 1)), lt(newFreePtr, memPtr))\n {\n mstore(0, shl(224, 0x4e487b71))\n mstore(4, 0x41)\n revert(0, 0x24)\n }\n mstore(64, newFreePtr)\n }\n function allocate_memory_2390() -> memPtr\n {\n memPtr := mload(64)\n let newFreePtr := add(memPtr, 0x0120)\n if or(gt(newFreePtr, sub(shl(64, 1), 1)), lt(newFreePtr, memPtr))\n {\n mstore(0, shl(224, 0x4e487b71))\n mstore(4, 0x41)\n revert(0, 0x24)\n }\n mstore(64, newFreePtr)\n }\n function allocate_memory_2392() -> memPtr\n {\n memPtr := mload(64)\n let newFreePtr := add(memPtr, 320)\n if or(gt(newFreePtr, sub(shl(64, 1), 1)), lt(newFreePtr, memPtr))\n {\n mstore(0, shl(224, 0x4e487b71))\n mstore(4, 0x41)\n revert(0, 0x24)\n }\n mstore(64, newFreePtr)\n }\n function abi_decode_tuple_t_struct$_State_$16058_memory_ptr(headStart, dataEnd) -> value0\n {\n let _1 := slt(sub(dataEnd, headStart), 192)\n if _1 { revert(0, 0) }\n _1 := 0\n let value := allocate_memory()\n let value_1 := _1\n value_1 := calldataload(headStart)\n mstore(value, value_1)\n let value_2 := _1\n value_2 := calldataload(add(headStart, 32))\n mstore(add(value, 32), value_2)\n let value_3 := _1\n value_3 := calldataload(add(headStart, 64))\n mstore(add(value, 64), value_3)\n let value_4 := _1\n value_4 := calldataload(add(headStart, 96))\n mstore(add(value, 96), value_4)\n let value_5 := _1\n value_5 := calldataload(add(headStart, 128))\n mstore(add(value, 128), value_5)\n let value_6 := calldataload(add(headStart, 160))\n if iszero(eq(value_6, and(value_6, 0xff))) { revert(_1, _1) }\n mstore(add(value, 160), value_6)\n value0 := value\n }\n function abi_decode_struct_State_calldata(offset, end) -> value\n {\n if slt(sub(end, offset), 192) { revert(0, 0) }\n value := offset\n }\n function abi_decode_tuple_t_struct$_State_$16058_calldata_ptrt_struct$_State_$16058_calldata_ptr(headStart, dataEnd) -> value0, value1\n {\n if slt(sub(dataEnd, headStart), 384) { revert(0, 0) }\n value0 := abi_decode_struct_State_calldata(headStart, dataEnd)\n value1 := abi_decode_struct_State_calldata(add(headStart, 192), dataEnd)\n }\n function abi_decode_tuple_t_uint64(headStart, dataEnd) -> value0\n {\n if slt(sub(dataEnd, headStart), 32) { revert(0, 0) }\n let value := calldataload(headStart)\n validator_revert_uint64(value)\n value0 := value\n }\n function abi_encode_tuple_t_enum$_DisputeStatus_$14921__to_t_uint8__fromStack_reversed(headStart, value0) -> tail\n {\n tail := add(headStart, 32)\n abi_encode_enum_DisputeStatus(value0, headStart)\n }\n function abi_encode_tuple_t_rational_1_by_1__to_t_uint64__fromStack_reversed(headStart, value0) -> tail\n {\n tail := add(headStart, 32)\n mstore(headStart, and(value0, sub(shl(64, 1), 1)))\n }\n function abi_decode_tuple_t_struct$_Receipt_$16044_memory_ptr(headStart, dataEnd) -> value0\n {\n let _1 := slt(sub(dataEnd, headStart), 96)\n if _1 { revert(0, 0) }\n _1 := 0\n let memPtr := _1\n memPtr := mload(64)\n let newFreePtr := add(memPtr, 96)\n if or(gt(newFreePtr, sub(shl(64, 1), 1)), lt(newFreePtr, memPtr))\n {\n mstore(_1, shl(224, 0x4e487b71))\n mstore(4, 0x41)\n revert(_1, 0x24)\n }\n mstore(64, newFreePtr)\n let value := _1\n value := calldataload(headStart)\n mstore(memPtr, value)\n let value_1 := _1\n value_1 := calldataload(add(headStart, 32))\n mstore(add(memPtr, 32), value_1)\n let value_2 := _1\n value_2 := calldataload(add(headStart, 64))\n mstore(add(memPtr, 64), value_2)\n value0 := memPtr\n }\n function abi_encode_tuple_packed_t_address_t_stringliteral_b7ccb6878fbded310d2d05350bca9c84568ecb568d4b626c83e0508c3193ce89__to_t_address_t_string_memory_ptr__nonPadded_inplace_fromStack_reversed(pos, value0) -> end\n {\n mstore(pos, and(shl(96, value0), not(sub(shl(96, 1), 1))))\n mstore(add(pos, 20), \"legacy\")\n end := add(pos, 26)\n }\n function abi_decode_address_fromMemory(offset) -> value\n {\n value := mload(offset)\n validator_revert_address(value)\n }\n function abi_decode_struct_Allocation_fromMemory(headStart, end) -> value\n {\n if slt(sub(end, headStart), 0x0120) { revert(0, 0) }\n value := allocate_memory_2390()\n mstore(value, abi_decode_address_fromMemory(headStart))\n let value_1 := 0\n value_1 := mload(add(headStart, 32))\n mstore(add(value, 32), value_1)\n let value_2 := 0\n value_2 := mload(add(headStart, 64))\n mstore(add(value, 64), value_2)\n let value_3 := 0\n value_3 := mload(add(headStart, 96))\n mstore(add(value, 96), value_3)\n let value_4 := 0\n value_4 := mload(add(headStart, 128))\n mstore(add(value, 128), value_4)\n let value_5 := 0\n value_5 := mload(add(headStart, 160))\n mstore(add(value, 160), value_5)\n let value_6 := 0\n value_6 := mload(add(headStart, 192))\n mstore(add(value, 192), value_6)\n let value_7 := 0\n value_7 := mload(add(headStart, 224))\n mstore(add(value, 224), value_7)\n let value_8 := 0\n value_8 := mload(add(headStart, 256))\n mstore(add(value, 256), value_8)\n }\n function abi_decode_tuple_t_struct$_Allocation_$3073_memory_ptr_fromMemory(headStart, dataEnd) -> value0\n {\n if slt(sub(dataEnd, headStart), 288) { revert(0, 0) }\n value0 := abi_decode_struct_Allocation_fromMemory(headStart, dataEnd)\n }\n function panic_error_0x11()\n {\n mstore(0, shl(224, 0x4e487b71))\n mstore(4, 0x11)\n revert(0, 0x24)\n }\n function checked_add_t_uint256(x, y) -> sum\n {\n sum := add(x, y)\n if gt(x, sum) { panic_error_0x11() }\n }\n function abi_encode_tuple_t_uint256_t_uint256__to_t_uint256_t_uint256__fromStack_reversed(headStart, value1, value0) -> tail\n {\n tail := add(headStart, 64)\n mstore(headStart, value0)\n mstore(add(headStart, 32), value1)\n }\n function abi_encode_bytes(value, pos) -> end\n {\n let length := mload(value)\n mstore(pos, length)\n let i := 0\n for { } lt(i, length) { i := add(i, 0x20) }\n {\n mstore(add(add(pos, i), 0x20), mload(add(add(value, i), 0x20)))\n }\n mstore(add(add(pos, length), 0x20), 0)\n end := add(add(pos, and(add(length, 31), not(31))), 0x20)\n }\n function abi_encode_tuple_t_address_t_bytes_memory_ptr__to_t_address_t_bytes_memory_ptr__fromStack_reversed(headStart, value1, value0) -> tail\n {\n mstore(headStart, and(value0, sub(shl(160, 1), 1)))\n mstore(add(headStart, 32), 64)\n tail := abi_encode_bytes(value1, add(headStart, 64))\n }\n function abi_encode_tuple_t_address_t_uint256_t_uint256__to_t_address_t_uint256_t_uint256__fromStack_reversed(headStart, value2, value1, value0) -> tail\n {\n tail := add(headStart, 96)\n mstore(headStart, and(value0, sub(shl(160, 1), 1)))\n mstore(add(headStart, 32), value1)\n mstore(add(headStart, 64), value2)\n }\n function abi_encode_tuple_t_address_t_address__to_t_address_t_address__fromStack_reversed(headStart, value1, value0) -> tail\n {\n tail := add(headStart, 64)\n mstore(headStart, and(value0, sub(shl(160, 1), 1)))\n mstore(add(headStart, 32), and(value1, sub(shl(160, 1), 1)))\n }\n function abi_decode_uint32_fromMemory(offset) -> value\n {\n value := mload(offset)\n validator_revert_uint32(value)\n }\n function abi_decode_uint64_fromMemory(offset) -> value\n {\n value := mload(offset)\n validator_revert_uint64(value)\n }\n function abi_decode_tuple_t_struct$_Provision_$3962_memory_ptr_fromMemory(headStart, dataEnd) -> value0\n {\n let _1 := slt(sub(dataEnd, headStart), 320)\n if _1 { revert(0, 0) }\n _1 := 0\n let value := allocate_memory_2392()\n let value_1 := _1\n value_1 := mload(headStart)\n mstore(value, value_1)\n let value_2 := _1\n value_2 := mload(add(headStart, 32))\n mstore(add(value, 32), value_2)\n let value_3 := _1\n value_3 := mload(add(headStart, 64))\n mstore(add(value, 64), value_3)\n mstore(add(value, 96), abi_decode_uint32_fromMemory(add(headStart, 96)))\n mstore(add(value, 128), abi_decode_uint64_fromMemory(add(headStart, 128)))\n mstore(add(value, 160), abi_decode_uint64_fromMemory(add(headStart, 160)))\n mstore(add(value, 192), abi_decode_uint32_fromMemory(add(headStart, 192)))\n mstore(add(value, 224), abi_decode_uint64_fromMemory(add(headStart, 224)))\n let value_4 := _1\n value_4 := mload(add(headStart, 256))\n mstore(add(value, 256), value_4)\n let value_5 := _1\n value_5 := mload(add(headStart, 288))\n mstore(add(value, 288), value_5)\n value0 := value\n }\n function abi_encode_tuple_t_bytes32_t_bytes32_t_bytes32_t_bytes32_t_bytes32_t_bytes32__to_t_bytes32_t_bytes32_t_bytes32_t_bytes32_t_bytes32_t_bytes32__fromStack_reversed(headStart, value5, value4, value3, value2, value1, value0) -> tail\n {\n tail := add(headStart, 192)\n mstore(headStart, value0)\n mstore(add(headStart, 32), value1)\n mstore(add(headStart, 64), value2)\n mstore(add(headStart, 96), value3)\n mstore(add(headStart, 128), value4)\n mstore(add(headStart, 160), value5)\n }\n function checked_div_t_uint256(x, y) -> r\n {\n if iszero(y)\n {\n mstore(0, shl(224, 0x4e487b71))\n mstore(4, 0x12)\n revert(0, 0x24)\n }\n r := div(x, y)\n }\n function abi_decode_tuple_t_struct$_State_$15663_memory_ptr_fromMemory(headStart, dataEnd) -> value0\n {\n if slt(sub(dataEnd, headStart), 288) { revert(0, 0) }\n value0 := abi_decode_struct_Allocation_fromMemory(headStart, dataEnd)\n }\n function abi_encode_tuple_t_address_t_address_t_uint256__to_t_address_t_address_t_uint256__fromStack_reversed(headStart, value2, value1, value0) -> tail\n {\n tail := add(headStart, 96)\n mstore(headStart, and(value0, sub(shl(160, 1), 1)))\n mstore(add(headStart, 32), and(value1, sub(shl(160, 1), 1)))\n mstore(add(headStart, 64), value2)\n }\n function abi_decode_tuple_t_bool_fromMemory(headStart, dataEnd) -> value0\n {\n if slt(sub(dataEnd, headStart), 32) { revert(0, 0) }\n let value := mload(headStart)\n validator_revert_bool(value)\n value0 := value\n }\n function abi_encode_tuple_t_stringliteral_aaf3daf27360df170a52f29a0edeebb3d20b8e3dc84a13c5eaf056803b549f50__to_t_string_memory_ptr__fromStack_reversed(headStart) -> tail\n {\n mstore(headStart, 32)\n mstore(add(headStart, 32), 9)\n mstore(add(headStart, 64), \"!transfer\")\n tail := add(headStart, 96)\n }\n function abi_encode_tuple_packed_t_address_t_bytes32__to_t_address_t_bytes32__nonPadded_inplace_fromStack_reversed(pos, value1, value0) -> end\n {\n mstore(pos, and(shl(96, value0), not(sub(shl(96, 1), 1))))\n mstore(add(pos, 20), value1)\n end := add(pos, 52)\n }\n function abi_encode_tuple_t_uint256_t_address_t_bytes32_t_uint256_t_uint256__to_t_uint256_t_address_t_bytes32_t_uint256_t_uint256__fromStack_reversed(headStart, value4, value3, value2, value1, value0) -> tail\n {\n tail := add(headStart, 160)\n mstore(headStart, value0)\n mstore(add(headStart, 32), and(value1, sub(shl(160, 1), 1)))\n mstore(add(headStart, 64), value2)\n mstore(add(headStart, 96), value3)\n mstore(add(headStart, 128), value4)\n }\n function abi_encode_tuple_t_bytes32_t_bytes32_t_bytes32_t_bytes32__to_t_bytes32_t_bytes32_t_bytes32_t_bytes32__fromStack_reversed(headStart, value3, value2, value1, value0) -> tail\n {\n tail := add(headStart, 128)\n mstore(headStart, value0)\n mstore(add(headStart, 32), value1)\n mstore(add(headStart, 64), value2)\n mstore(add(headStart, 96), value3)\n }\n function abi_encode_tuple_packed_t_stringliteral_301a50b291d33ce1e8e9064e3f6a6c51d902ec22892b50d58abf6357c6a45541_t_bytes32_t_bytes32__to_t_string_memory_ptr_t_bytes32_t_bytes32__nonPadded_inplace_fromStack_reversed(pos, value1, value0) -> end\n {\n mstore(pos, shl(240, 6401))\n mstore(add(pos, 2), value0)\n mstore(add(pos, 34), value1)\n end := add(pos, 66)\n }\n function abi_encode_tuple_t_address_t_uint256__to_t_address_t_uint256__fromStack_reversed(headStart, value1, value0) -> tail\n {\n tail := add(headStart, 64)\n mstore(headStart, and(value0, sub(shl(160, 1), 1)))\n mstore(add(headStart, 32), value1)\n }\n function abi_decode_tuple_t_struct$_DelegationPool_$3992_memory_ptr_fromMemory(headStart, dataEnd) -> value0\n {\n let _1 := slt(sub(dataEnd, headStart), 160)\n if _1 { revert(0, 0) }\n _1 := 0\n let memPtr := _1\n memPtr := mload(64)\n let newFreePtr := add(memPtr, 160)\n if or(gt(newFreePtr, sub(shl(64, 1), 1)), lt(newFreePtr, memPtr))\n {\n mstore(_1, shl(224, 0x4e487b71))\n mstore(4, 0x41)\n revert(_1, 0x24)\n }\n mstore(64, newFreePtr)\n let value := _1\n value := mload(headStart)\n mstore(memPtr, value)\n let value_1 := _1\n value_1 := mload(add(headStart, 32))\n mstore(add(memPtr, 32), value_1)\n let value_2 := _1\n value_2 := mload(add(headStart, 64))\n mstore(add(memPtr, 64), value_2)\n let value_3 := _1\n value_3 := mload(add(headStart, 96))\n mstore(add(memPtr, 96), value_3)\n let value_4 := _1\n value_4 := mload(add(headStart, 128))\n mstore(add(memPtr, 128), value_4)\n value0 := memPtr\n }\n function abi_decode_tuple_t_bytes32t_bytes32t_bytes32_fromMemory(headStart, dataEnd) -> value0, value1, value2\n {\n if slt(sub(dataEnd, headStart), 96) { revert(0, 0) }\n let value := 0\n value := mload(headStart)\n value0 := value\n let value_1 := 0\n value_1 := mload(add(headStart, 32))\n value1 := value_1\n let value_2 := 0\n value_2 := mload(add(headStart, 64))\n value2 := value_2\n }\n function abi_encode_tuple_packed_t_bytes32_t_bytes32_t_bytes32_t_address_t_address__to_t_bytes32_t_bytes32_t_bytes32_t_address_t_address__nonPadded_inplace_fromStack_reversed(pos, value4, value3, value2, value1, value0) -> end\n {\n mstore(pos, value0)\n mstore(add(pos, 32), value1)\n mstore(add(pos, 64), value2)\n mstore(add(pos, 96), and(shl(96, value3), not(sub(shl(96, 1), 1))))\n mstore(add(pos, 116), and(shl(96, value4), not(sub(shl(96, 1), 1))))\n end := add(pos, 136)\n }\n function abi_encode_tuple_t_uint256_t_bytes32_t_bytes_memory_ptr_t_uint256_t_uint256__to_t_uint256_t_bytes32_t_bytes_memory_ptr_t_uint256_t_uint256__fromStack_reversed(headStart, value4, value3, value2, value1, value0) -> tail\n {\n mstore(headStart, value0)\n mstore(add(headStart, 32), value1)\n mstore(add(headStart, 64), 160)\n tail := abi_encode_bytes(value2, add(headStart, 160))\n mstore(add(headStart, 96), value3)\n mstore(add(headStart, 128), value4)\n }\n function abi_encode_tuple_packed_t_bytes32_t_bytes32_t_uint8__to_t_bytes32_t_bytes32_t_uint8__nonPadded_inplace_fromStack_reversed(pos, value2, value1, value0) -> end\n {\n mstore(pos, value0)\n mstore(add(pos, 32), value1)\n mstore(add(pos, 64), and(shl(248, value2), shl(248, 255)))\n end := add(pos, 65)\n }\n function abi_encode_tuple_t_bytes32_t_bytes32_t_bytes32_t_uint256_t_address_t_bytes32__to_t_bytes32_t_bytes32_t_bytes32_t_uint256_t_address_t_bytes32__fromStack_reversed(headStart, value5, value4, value3, value2, value1, value0) -> tail\n {\n tail := add(headStart, 192)\n mstore(headStart, value0)\n mstore(add(headStart, 32), value1)\n mstore(add(headStart, 64), value2)\n mstore(add(headStart, 96), value3)\n mstore(add(headStart, 128), and(value4, sub(shl(160, 1), 1)))\n mstore(add(headStart, 160), value5)\n }\n function checked_mul_t_uint256(x, y) -> product\n {\n product := mul(x, y)\n if iszero(or(iszero(x), eq(y, div(product, x)))) { panic_error_0x11() }\n }\n function abi_encode_tuple_t_bytes32_t_uint8_t_bytes32_t_bytes32__to_t_bytes32_t_uint8_t_bytes32_t_bytes32__fromStack_reversed(headStart, value3, value2, value1, value0) -> tail\n {\n tail := add(headStart, 128)\n mstore(headStart, value0)\n mstore(add(headStart, 32), and(value1, 0xff))\n mstore(add(headStart, 64), value2)\n mstore(add(headStart, 96), value3)\n }\n}", + "id": 70, + "language": "Yul", + "name": "#utility.yul" + } + ], + "immutableReferences": { + "4591": [ + { + "length": 32, + "start": 6604 + } + ], + "4595": [ + { + "length": 32, + "start": 7971 + } + ] + }, + "linkReferences": {}, + "object": "608060405234801561001057600080fd5b50600436106101a15760003560e01c8063050b17ad146101a65780630533e1ba146101bb5780630bc7344b146101e857806311be1997146101fb578063169729781461027857806317337b461461028b5780631792f1941461029557806326058249146102a857806329e03ff1146102c857806336167e03146102df5780634bc5839a146102f25780635aea0ec4146103055780635bf31d4d146103265780636369df6b146103405780636cc6cde114610353578063715018a61461036657806376c993ae1461036e5780638d4e9008146103815780638da5cb5b14610394578063902a49381461039c5780639334ea52146103ac57806393a90a1e146103bf5780639f81a7cf146103d2578063b0e2f7e9146103e5578063b0eefabe146103f8578063bb2a2b471461040b578063be41f38414610419578063c133b4291461043c578063c50a77b11461044f578063c894222e14610462578063c9747f5114610483578063cc2d55cd14610496578063d36fc9d4146104a5578063d76f62d1146104b8578063f2fde38b146104cb575b600080fd5b6101b96101b4366004612c8a565b6104de565b005b6036546101d290600160201b900463ffffffff1681565b6040516101df9190612cac565b60405180910390f35b6101b96101f6366004612cf9565b6105fc565b610263610209366004612d72565b603760205260009081526040902080546001820154600283015460038401546004850154600586015460068701546007909701546001600160a01b039687169796909516959394929360ff80841694610100909404169289565b6040516101df99989796959493929190612db5565b6101b9610286366004612d72565b610734565b6101d26207a12081565b6101b96102a3366004612d72565b610748565b6033546102bb906001600160a01b031681565b6040516101df9190612e20565b6102d160355481565b6040519081526020016101df565b6101b96102ed366004612d72565b6108a8565b6102d1610300366004612e34565b6109ae565b603454600160a01b90046001600160401b03165b6040516101df9190612e60565b60345461031990600160a01b90046001600160401b031681565b6102d161034e366004612e74565b6109e6565b6034546102bb906001600160a01b031681565b6101b96109ff565b6101b961037c366004612e8f565b610a13565b6102d161038f366004612eac565b610a24565b6102bb610dc5565b6036546101d29063ffffffff1681565b6101b96103ba366004612d72565b610de0565b6101b96103cd366004612ef2565b610edf565b6101b96103e0366004612e8f565b610ef0565b6101b96103f3366004612f1d565b610f01565b6101b9610406366004612ef2565b611062565b60365463ffffffff166101d2565b61042c610427366004612d72565b611073565b60405190151581526020016101df565b6102d161044a366004612ef2565b6110a9565b6102d161045d366004612fa4565b611141565b610475610470366004612fe5565b6111d4565b6040516101df929190613054565b6102bb6104913660046130fa565b6113e2565b6102d1670de0b6b3a764000081565b61042c6104b336600461317c565b6114cd565b6101b96104c63660046131b2565b6114f5565b6101b96104d9366004612ef2565b611506565b6034546001600160a01b031633146105095760405163a8baf3bb60e01b815260040160405180910390fd5b8161051381611073565b819061053e576040516314a03bbd60e21b815260040161053591815260200190565b60405180910390fd5b506004600082815260376020526040902060040154610100900460ff16600581111561056c5761056c612d8b565b600083815260376020526040902060040154610100900460ff1691146105a65760405163146e540f60e21b815260040161053591906131cf565b506000838152603760205260409020600301548390156105dc576040516364d0c32b60e01b815260040161053591815260200190565b5060008381526037602052604090206105f6848285611541565b50505050565b60006106066115f2565b805490915060ff600160401b82041615906001600160401b031660008115801561062d5750825b90506000826001600160401b031660011480156106495750303b155b905081158015610657575080155b156106755760405163f92ee8a960e01b815260040160405180910390fd5b84546001600160401b0319166001178555831561069e57845460ff60401b1916600160401b1785555b6106a78b61161b565b6106af61162c565b6106b88a61163c565b6106c1896116ad565b6106ca88611736565b6106d387611799565b6106dc8661180b565b831561072757845460ff60401b191685556040517fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29061071e90600190612e60565b60405180910390a15b5050505050505050505050565b61073c611892565b61074581611736565b50565b8061075281611073565b8190610774576040516314a03bbd60e21b815260040161053591815260200190565b506000818152603760205260409020600101546001600160a01b031633146107af5760405163082c005560e41b815260040160405180910390fd5b816107b981611073565b81906107db576040516314a03bbd60e21b815260040161053591815260200190565b506004600082815260376020526040902060040154610100900460ff16600581111561080957610809612d8b565b600083815260376020526040902060040154610100900460ff1691146108435760405163146e540f60e21b815260040161053591906131cf565b506000838152603760205260409020600681015442101561087757604051631d7753d560e11b815260040160405180910390fd5b61088184826118c4565b6003810154156105f657600381015460008181526037602052604090206105f691906118c4565b6034546001600160a01b031633146108d35760405163a8baf3bb60e01b815260040160405180910390fd5b806108dd81611073565b81906108ff576040516314a03bbd60e21b815260040161053591815260200190565b506004600082815260376020526040902060040154610100900460ff16600581111561092d5761092d612d8b565b600083815260376020526040902060040154610100900460ff1691146109675760405163146e540f60e21b815260040161053591906131cf565b506000828152603760205260409020600381015483901561099e576040516364d0c32b60e01b815260040161053591815260200190565b506109a9838261194b565b505050565b60006109cf336035546109bf6119ca565b6001600160a01b031691906119ee565b6109dd336035548585611aa6565b90505b92915050565b60006109e06109fa368490038401846131dd565b611e28565b610a07611892565b610a116000611ec5565b565b610a1b611892565b61074581611799565b6034546000906001600160a01b03163314610a525760405163a8baf3bb60e01b815260040160405180910390fd5b6040516001600160601b0319606087901b166020820152656c656761637960d01b6034820152600090603a016040516020818303038152906040528051906020012090506000610aa0611f21565b6001600160a01b0316630e022923886040518263ffffffff1660e01b8152600401610acb9190612e20565b61012060405180830381865afa158015610ae9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b0d91906132d9565b519050866001600160a01b038216610b39576040516334789d8b60e21b81526004016105359190612e20565b5060408051610120810182526001600160a01b038381168252881660208201526000918101829052606081019190915260036080820152600160a08201524260c0820181905260345460e0830191610ba191600160a01b90046001600160401b03169061330c565b81526000602091820181905284815260378252604090819020835181546001600160a01b039182166001600160a01b0319918216178355938501516001808401805492909316919095161790559083015160028201556060830151600380830191909155608084015160048301805493949193909260ff1990911691908490811115610c2f57610c2f612d8b565b021790555060a082015160048201805461ff001916610100836005811115610c5957610c59612d8b565b021790555060c0820151600582015560e08201516006820155610100909101516007909101556000610c89611f45565b9050806001600160a01b031663cb8347fe838888604051602001610cae929190613054565b6040516020818303038152906040526040518363ffffffff1660e01b8152600401610cda929190613365565b600060405180830381600087803b158015610cf457600080fd5b505af1158015610d08573d6000803e3d6000fd5b50505050610d298786610d196119ca565b6001600160a01b03169190611f81565b604080516001600160a01b038a81168252602082018990529181018790528189169184169085907f587a1fc7e80e653a2ab7f63f98c080f5818b8cedcfd1374590c8c786290ed0319060600160405180910390a4866001600160a01b0316826001600160a01b03168460008051602061359d83398151915288604051610db191815260200190565b60405180910390a450909695505050505050565b600080610dd0611fbc565b546001600160a01b031692915050565b6034546001600160a01b03163314610e0b5760405163a8baf3bb60e01b815260040160405180910390fd5b80610e1581611073565b8190610e37576040516314a03bbd60e21b815260040161053591815260200190565b506004600082815260376020526040902060040154610100900460ff166005811115610e6557610e65612d8b565b600083815260376020526040902060040154610100900460ff169114610e9f5760405163146e540f60e21b815260040161053591906131cf565b506000828152603760205260409020610eb88382611fe0565b6003810154156109a957600381015460008181526037602052604090206109a99190611fe0565b610ee7611892565b6107458161205f565b610ef8611892565b6107458161180b565b6034546001600160a01b03163314610f2c5760405163a8baf3bb60e01b815260040160405180910390fd5b83610f3681611073565b8190610f58576040516314a03bbd60e21b815260040161053591815260200190565b506004600082815260376020526040902060040154610100900460ff166005811115610f8657610f86612d8b565b600083815260376020526040902060040154610100900460ff169114610fc05760405163146e540f60e21b815260040161053591906131cf565b5060008581526037602052604090206003015415158590610ffa57604051600162d62c0760e01b0319815260040161053591815260200190565b506000858152603760205260409020611014868287611541565b831561103d5760038101546000818152603760205260409020611038919085611541565b61105a565b6003810154600081815260376020526040902061105a9190611fe0565b505050505050565b61106a611892565b6107458161163c565b600080600083815260376020526040902060040154610100900460ff1660058111156110a1576110a1612d8b565b141592915050565b6000806110b4611f21565b6001600160a01b03166325d9897e846110cb611f45565b6040518363ffffffff1660e01b81526004016110e8929190613389565b61014060405180830381865afa158015611106573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061112a91906133b9565b905061113a8382600001516120d0565b9392505050565b6000611152336035546109bf6119ca565b6109dd3360355461119886868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061216592505050565b86868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506122a592505050565b6000806000339050600061121d88888080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061216592505050565b9050600061126087878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061216592505050565b905061126c82826125a4565b825160208085015160408087015186519387015191870151949592949093926112cb57604051636aba529760e11b81526004810196909652602486019490945260448501929092526064840152608483015260a482015260c401610535565b5050505050506112e0336035546109bf6119ca565b60006113328460026035546112f59190613466565b858d8d8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506122a592505050565b905060006113868560026035546113499190613466565b858c8c8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506122a592505050565b60008381526037602052604080822060039081018490558383528183200185905551919250829184917ffec135a4cf8e5c6e13dea23be058bf03a8bf8f1f6fb0a021b0a5aeddfba8140791a3909a909950975050505050505050565b6000806113ee836125d5565b905060006113fa611f45565b6001600160a01b0316630e022923836040518263ffffffff1660e01b81526004016114259190612e20565b61012060405180830381865afa158015611443573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061146791906132d9565b805190915082906001600160a01b0316611495576040516334789d8b60e21b81526004016105359190612e20565b5060408401516020820151908181146114c357604051630a24cfe560e21b8152600401610535929190613054565b5050519392505050565b60006109dd6114e1368590038501856130fa565b6114f0368590038501856130fa565b6125a4565b6114fd611892565b610745816116ad565b61150e611892565b6001600160a01b038116611538576000604051631e4fbdf760e01b81526004016105359190612e20565b61074581611ec5565b81546007830154600091611562916001600160a01b0390911690849061265e565b60048401805461ff001916610100179055600184015460028501549192506115a2916001600160a01b039091169061159a908461330c565b610d196119ca565b6001830154835460028501546001600160a01b039283169290911690869060008051602061359d833981519152906115db90869061330c565b60405190815260200160405180910390a450505050565b6000807ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a006109e0565b61162361280f565b61074581612834565b61163461280f565b610a1161283c565b6001600160a01b0381166116635760405163616bc44160e11b815260040160405180910390fd5b603480546001600160a01b0319166001600160a01b0383169081179091556040517f51744122301b50e919f4e3d22adf8c53abc92195b8c667eda98c6ef20375672e90600090a250565b806001600160401b03166000036116d75760405163c4411f1160e01b815260040160405180910390fd5b60348054600160a01b600160e01b031916600160a01b6001600160401b038416021790556040517f310462a9bf49fff4a57910ec647c77cbf8aaf2f13394554ac6cdf14fc68db7e69061172b908390612e60565b60405180910390a150565b80670de0b6b3a76400008110156117635760405163033f4e0560e01b815260040161053591815260200190565b5060358190556040518181527f97896b9da0f97f36bf3011570bcff930069299de4b1e89c9cb44909841cac2f89060200161172b565b806207a12063ffffffff821611156117c55760405163432e664360e11b81526004016105359190612cac565b506036805463ffffffff191663ffffffff83161790556040517fc573dc0f869f6a1d0a74fc7712a63baabcb5567131d2d98005e163924eddcbab9061172b908390612cac565b8063ffffffff8116620f4240101561183757604051634e9374fb60e11b81526004016105359190612cac565b506036805463ffffffff60201b1916600160201b63ffffffff848116820292909217928390556040517f7efaf01bec3cda8d104163bb466d01d7e16f68848301c7eb0749cfa59d6805029361172b9392900490911690612cac565b3361189b610dc5565b6001600160a01b031614610a11573360405163118cdaa760e01b81526004016105359190612e20565b60048101805461ff001916610500179055600181015460028201546118f5916001600160a01b031690610d196119ca565b6001810154815460028301546040519081526001600160a01b03928316929091169084907f223103f8eb52e5f43a75655152acd882a605d70df57a5c0fefd30f516b1756d2906020015b60405180910390a45050565b60048101805461ff001916610200179055600281015461197c9061196d6119ca565b6001600160a01b03169061290e565b6001810154815460028301546040519081526001600160a01b03928316929091169084907f2226ebd23625a7938fb786df2248bd171d2e6ad70cb2b654ea1be830ca17224d9060200161193f565b7f000000000000000000000000000000000000000000000000000000000000000090565b80156109a9576040516323b872dd60e01b81526001600160a01b038381166004830152306024830152604482018390528416906323b872dd906064015b6020604051808303816000875af1158015611a4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a6e9190613488565b6109a95760405162461bcd60e51b815260206004820152600960248201526810ba3930b739b332b960b91b6044820152606401610535565b6040516001600160601b0319606084901b166020820152603481018290526000908190605401604051602081830303815290604052805190602001209050611aed81611073565b158190611b105760405163124a23f160e11b815260040161053591815260200190565b506000611b1b611f45565b90506000816001600160a01b0316630e022923876040518263ffffffff1660e01b8152600401611b4b9190612e20565b61012060405180830381865afa158015611b69573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b8d91906132d9565b8051909150866001600160a01b038216611bbb576040516334789d8b60e21b81526004016105359190612e20565b506000611bc6611f21565b6001600160a01b03166325d9897e83866040518363ffffffff1660e01b8152600401611bf3929190613389565b61014060405180830381865afa158015611c11573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c3591906133b9565b8051909150600003611c5a5760405163307efdb760e11b815260040160405180910390fd5b6000611c6a8383600001516120d0565b603454909150600090611c8d90600160a01b90046001600160401b03164261330c565b604080516101208101825287516001600160a01b0390811682528f1660208201529081018d905260006060820152909150608081016001815260200160048152426020808301919091526040808301859052606092830186905260008b815260378352819020845181546001600160a01b039182166001600160a01b0319918216178355938601516001808401805492909316919095161790559084015160028201559183015160038084019190915560808401516004840180549193909260ff19909216918490811115611d6457611d64612d8b565b021790555060a082015160048201805461ff001916610100836005811115611d8e57611d8e612d8b565b021790555060c0820151600582015560e08201516006820155610100909101516007909101558451604080518d81526001600160a01b038d811660208301529181018c90526060810185905260808101849052818f16929091169089907f8a1eccecce948a912e2e195de5960359755aeac90ad88a3fde55a77e1a73796b9060a00160405180910390a450949a9950505050505050505050565b600054815160208084015160409485015185517f32dd026408194a0d7e54cc66a2ab6c856efc55cfcd4dd258fde5b1a55222baa6818501528087019490945260608401919091526080808401919091528451808403909101815260a08301855280519082012061190160f01b60c084015260c283019390935260e28083019390935283518083039093018352610102909101909252805191012090565b6000611ecf611fbc565b80546001600160a01b038481166001600160a01b031983168117845560405193945091169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b6033546000906001600160a01b0316611f715760405163bd088b4f60e01b815260040160405180910390fd5b506033546001600160a01b031690565b80156109a95760405163a9059cbb60e01b81526001600160a01b0383811660048301526024820183905284169063a9059cbb90604401611a2b565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930090565b60048101805461ff00191661030017905560018101546002820154612011916001600160a01b031690610d196119ca565b6001810154815460028301546040519081526001600160a01b03928316929091169084907ff0912efb86ea1d65a17d64d48393cdb1ca0ea5220dd2bbe438621199d30955b79060200161193f565b6001600160a01b0381166120865760405163616bc44160e11b815260040160405180910390fd5b603380546001600160a01b0319166001600160a01b0383169081179091556040517f81dcb738da3dabd5bb2adbc7dd107fbbfca936e9c8aecab25f5b17a710a784c790600090a250565b6000806120db611f21565b6001600160a01b031663561285e4856120f2611f45565b6040518363ffffffff1660e01b815260040161210f929190613389565b60a060405180830381865afa15801561212c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061215091906134a5565b51905061215d818461330c565b949350505050565b6040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a081019190915260016121a460208061330c565b6121ae919061330c565b6121b990606061330c565b82519081149060016121cc60208061330c565b6121d6919061330c565b6121e190606061330c565b909161220257604051633fdf342360e01b8152600401610535929190613054565b505060008060008480602001905181019061221d9190613524565b925092509250600061223086606061296e565b90506000612249876122446020606061330c565b61296e565b9050600061226d88602061225e81606061330c565b612268919061330c565b6129b9565b6040805160c081018252978852602088019690965294860193909352606085019190915260808401525060ff1660a082015292915050565b6000806122b1846113e2565b905060006122bd611f21565b6001600160a01b03166325d9897e836122d4611f45565b6040518363ffffffff1660e01b81526004016122f1929190613389565b61014060405180830381865afa15801561230f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061233391906133b9565b80519091506000036123585760405163307efdb760e11b815260040160405180910390fd5b84516020808701516040808901518151938401949094528201526060808201929092526001600160601b031984831b811660808301529189901b909116609482015260009060a8016040516020818303038152906040528051906020012090506123c181611073565b1581906123e45760405163124a23f160e11b815260040161053591815260200190565b5060006123f58484600001516120d0565b60345490915060009061241890600160a01b90046001600160401b03164261330c565b60408051610120810182526001600160a01b0380891682528d1660208201529081018b9052600060608201529091506080810160028152602001600481524260208083019190915260408083018590526060928301869052600087815260378352819020845181546001600160a01b039182166001600160a01b0319918216178355938601516001808401805492909316919095161790559084015160028201559183015160038084019190915560808401516004840180549193909260ff199092169184908111156124ed576124ed612d8b565b021790555060a082015160048201805461ff00191661010083600581111561251757612517612d8b565b021790555060c0820151816005015560e082015181600601556101008201518160070155905050896001600160a01b0316856001600160a01b0316847ffb70faf7306b83c2cec6d8c1627baad892cb79968a02cc0353174499ecfd8b358c8c604001518c878960405161258e959493929190613552565b60405180910390a4509098975050505050505050565b805182516000911480156125bf575081604001518360400151145b80156109dd575050602090810151910151141590565b60408051606081018252825181526020808401519082015282820151918101919091526000908161260582611e28565b905061215d81856060015186608001518760a0015160405160200161264a93929190928352602083019190915260f81b6001600160f81b031916604082015260410190565b604051602081830303815290604052612a04565b600080612669611f45565b90506000612675611f21565b6001600160a01b03166325d9897e87846040518363ffffffff1660e01b81526004016126a2929190613389565b61014060405180830381865afa1580156126c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126e491906133b9565b60365490915060009061270990869063ffffffff600160201b909104811690612a2e16565b9050851580159061271a5750808611155b8682909161273d5760405163cc6b7c4160e01b8152600401610535929190613054565b5050600061274f878460000151612a8e565b60608401516036549192506000916127709163ffffffff9081169116612a8e565b9050600061277e8284612a2e565b9050856001600160a01b031663cb8347fe8b8b846040516020016127a3929190613054565b6040516020818303038152906040526040518363ffffffff1660e01b81526004016127cf929190613365565b600060405180830381600087803b1580156127e957600080fd5b505af11580156127fd573d6000803e3d6000fd5b50929c9b505050505050505050505050565b612817612aa5565b610a1157604051631afcd79f60e31b815260040160405180910390fd5b61150e61280f565b61284461280f565b604080517fd87cd6ef79d4e2b95e15ce8abf732db51ec771f1ca2edccf22a46c729ac5647260208201527f171a7fa058648750a8c5aae430f30db8d0100efc3a5e1b2e8054b1c1ce28b6b4918101919091527f044852b2a670ade5407e78fb2863c51de9fcb96542a07186fe3aeda6bb8a116d60608201524660808201523060a08201527fa070ffb1cd7409649bf77822cce74495468e06dbfaef09556838bf188679b9c260c082015260e00160408051601f198184030181529190528051602090910120600055565b801561296a57604051630852cd8d60e31b8152600481018290526001600160a01b038316906342966c6890602401600060405180830381600087803b15801561295657600080fd5b505af115801561105a573d6000803e3d6000fd5b5050565b600061297b60208361330c565b8351908110159061298d60208561330c565b90916129ae57604051633fdf342360e01b8152600401610535929190613054565b505050016020015190565b60006129c660018361330c565b835190811015906129d860018561330c565b90916129f957604051633fdf342360e01b8152600401610535929190613054565b505050016001015190565b600080600080612a148686612abf565b925092509250612a248282612b0c565b5090949350505050565b6000612a3d83620f4240101590565b80612a505750612a5082620f4240101590565b83839091612a735760405163768bf0eb60e11b8152600401610535929190613054565b50620f42409050612a848385613585565b6109dd9190613466565b600081831115612a9e57816109dd565b5090919050565b6000612aaf6115f2565b54600160401b900460ff16919050565b60008060008351604103612af95760208401516040850151606086015160001a612aeb88828585612bc5565b955095509550505050612b05565b50508151600091506002905b9250925092565b6000826003811115612b2057612b20612d8b565b03612b29575050565b6001826003811115612b3d57612b3d612d8b565b03612b5b5760405163f645eedf60e01b815260040160405180910390fd5b6002826003811115612b6f57612b6f612d8b565b03612b905760405163fce698f760e01b815260048101829052602401610535565b6003826003811115612ba457612ba4612d8b565b0361296a576040516335e2f38360e21b815260048101829052602401610535565b600080806fa2a8918ca85bafe22016d0b997e4df60600160ff1b03841115612bf65750600091506003905082612c80565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa158015612c4a573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116612c7657506000925060019150829050612c80565b9250600091508190505b9450945094915050565b60008060408385031215612c9d57600080fd5b50508035926020909101359150565b63ffffffff91909116815260200190565b6001600160a01b038116811461074557600080fd5b6001600160401b038116811461074557600080fd5b63ffffffff8116811461074557600080fd5b60008060008060008060c08789031215612d1257600080fd5b8635612d1d81612cbd565b95506020870135612d2d81612cbd565b94506040870135612d3d81612cd2565b9350606087013592506080870135612d5481612ce7565b915060a0870135612d6481612ce7565b809150509295509295509295565b600060208284031215612d8457600080fd5b5035919050565b634e487b7160e01b600052602160045260246000fd5b60068110612db157612db1612d8b565b9052565b6001600160a01b038a81168252891660208201526040810188905260608101879052610120810160048710612dec57612dec612d8b565b866080830152612dff60a0830187612da1565b8460c08301528360e0830152826101008301529a9950505050505050505050565b6001600160a01b0391909116815260200190565b60008060408385031215612e4757600080fd5b8235612e5281612cbd565b946020939093013593505050565b6001600160401b0391909116815260200190565b60006060828403128015612e8757600080fd5b509092915050565b600060208284031215612ea157600080fd5b813561113a81612ce7565b60008060008060808587031215612ec257600080fd5b8435612ecd81612cbd565b93506020850135612edd81612cbd565b93969395505050506040820135916060013590565b600060208284031215612f0457600080fd5b813561113a81612cbd565b801515811461074557600080fd5b60008060008060808587031215612f3357600080fd5b84359350602085013592506040850135612f4c81612f0f565b9396929550929360600135925050565b60008083601f840112612f6e57600080fd5b5081356001600160401b03811115612f8557600080fd5b602083019150836020828501011115612f9d57600080fd5b9250929050565b60008060208385031215612fb757600080fd5b82356001600160401b03811115612fcd57600080fd5b612fd985828601612f5c565b90969095509350505050565b60008060008060408587031215612ffb57600080fd5b84356001600160401b0381111561301157600080fd5b61301d87828801612f5c565b90955093505060208501356001600160401b0381111561303c57600080fd5b61304887828801612f5c565b95989497509550505050565b918252602082015260400190565b60405160c081016001600160401b038111828210171561309257634e487b7160e01b600052604160045260246000fd5b60405290565b60405161012081016001600160401b038111828210171561309257634e487b7160e01b600052604160045260246000fd5b60405161014081016001600160401b038111828210171561309257634e487b7160e01b600052604160045260246000fd5b600060c082840312801561310d57600080fd5b506000613118613062565b833581526020808501359082015260408085013590820152606080850135908201526080808501359082015260a084013560ff81168114613157578283fd5b60a0820152949350505050565b600060c0828403121561317657600080fd5b50919050565b600080610180838503121561319057600080fd5b61319a8484613164565b91506131a98460c08501613164565b90509250929050565b6000602082840312156131c457600080fd5b813561113a81612cd2565b602081016109e08284612da1565b600060608284031280156131f057600080fd5b50604051600090606081016001600160401b038111828210171561322257634e487b7160e01b83526041600452602483fd5b604090815284358252602080860135908301529384013593810193909352509092915050565b805161325381612cbd565b919050565b6000610120828403121561326b57600080fd5b613273613098565b905061327e82613248565b81526020828101519082015260408083015190820152606080830151908201526080808301519082015260a0808301519082015260c0808301519082015260e080830151908201526101009182015191810191909152919050565b600061012082840312156132ec57600080fd5b6109dd8383613258565b634e487b7160e01b600052601160045260246000fd5b808201808211156109e0576109e06132f6565b6000815180845260005b8181101561334557602081850181015186830182015201613329565b506000602082860101526020601f19601f83011685010191505092915050565b6001600160a01b038316815260406020820181905260009061215d9083018461331f565b6001600160a01b0392831681529116602082015260400190565b805161325381612ce7565b805161325381612cd2565b60006101408284031280156133cd57600080fd5b5060006133d86130c9565b8351815260208085015190820152604080850151908201526133fc606085016133a3565b606082015261340d608085016133ae565b608082015261341e60a085016133ae565b60a082015261342f60c085016133a3565b60c082015261344060e085016133ae565b60e082015261010084810151908201526101209384015193810193909352509092915050565b60008261348357634e487b7160e01b600052601260045260246000fd5b500490565b60006020828403121561349a57600080fd5b815161113a81612f0f565b600060a08284031280156134b857600080fd5b5060405160009060a081016001600160401b03811182821017156134ea57634e487b7160e01b83526041600452602483fd5b6040908152845182526020808601519083015284810151908201526060808501519082015260809384015193810193909352509092915050565b60008060006060848603121561353957600080fd5b5050815160208301516040909301519094929350919050565b85815284602082015260a06040820152600061357160a083018661331f565b606083019490945250608001529392505050565b80820281158282048414176109e0576109e06132f656fe6d800aaaf64b9a1f321dcd63da04369d33d8a0d49ad0fbba085aab4a98bf31c4a2646970667358221220d50b3dec1e5d2d1d140733dca7d5163900c1fc882947b3208864910c6f452d0e64736f6c634300081b0033", + "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x4 CALLDATASIZE LT PUSH2 0x1A1 JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0x50B17AD EQ PUSH2 0x1A6 JUMPI DUP1 PUSH4 0x533E1BA EQ PUSH2 0x1BB JUMPI DUP1 PUSH4 0xBC7344B EQ PUSH2 0x1E8 JUMPI DUP1 PUSH4 0x11BE1997 EQ PUSH2 0x1FB JUMPI DUP1 PUSH4 0x16972978 EQ PUSH2 0x278 JUMPI DUP1 PUSH4 0x17337B46 EQ PUSH2 0x28B JUMPI DUP1 PUSH4 0x1792F194 EQ PUSH2 0x295 JUMPI DUP1 PUSH4 0x26058249 EQ PUSH2 0x2A8 JUMPI DUP1 PUSH4 0x29E03FF1 EQ PUSH2 0x2C8 JUMPI DUP1 PUSH4 0x36167E03 EQ PUSH2 0x2DF JUMPI DUP1 PUSH4 0x4BC5839A EQ PUSH2 0x2F2 JUMPI DUP1 PUSH4 0x5AEA0EC4 EQ PUSH2 0x305 JUMPI DUP1 PUSH4 0x5BF31D4D EQ PUSH2 0x326 JUMPI DUP1 PUSH4 0x6369DF6B EQ PUSH2 0x340 JUMPI DUP1 PUSH4 0x6CC6CDE1 EQ PUSH2 0x353 JUMPI DUP1 PUSH4 0x715018A6 EQ PUSH2 0x366 JUMPI DUP1 PUSH4 0x76C993AE EQ PUSH2 0x36E JUMPI DUP1 PUSH4 0x8D4E9008 EQ PUSH2 0x381 JUMPI DUP1 PUSH4 0x8DA5CB5B EQ PUSH2 0x394 JUMPI DUP1 PUSH4 0x902A4938 EQ PUSH2 0x39C JUMPI DUP1 PUSH4 0x9334EA52 EQ PUSH2 0x3AC JUMPI DUP1 PUSH4 0x93A90A1E EQ PUSH2 0x3BF JUMPI DUP1 PUSH4 0x9F81A7CF EQ PUSH2 0x3D2 JUMPI DUP1 PUSH4 0xB0E2F7E9 EQ PUSH2 0x3E5 JUMPI DUP1 PUSH4 0xB0EEFABE EQ PUSH2 0x3F8 JUMPI DUP1 PUSH4 0xBB2A2B47 EQ PUSH2 0x40B JUMPI DUP1 PUSH4 0xBE41F384 EQ PUSH2 0x419 JUMPI DUP1 PUSH4 0xC133B429 EQ PUSH2 0x43C JUMPI DUP1 PUSH4 0xC50A77B1 EQ PUSH2 0x44F JUMPI DUP1 PUSH4 0xC894222E EQ PUSH2 0x462 JUMPI DUP1 PUSH4 0xC9747F51 EQ PUSH2 0x483 JUMPI DUP1 PUSH4 0xCC2D55CD EQ PUSH2 0x496 JUMPI DUP1 PUSH4 0xD36FC9D4 EQ PUSH2 0x4A5 JUMPI DUP1 PUSH4 0xD76F62D1 EQ PUSH2 0x4B8 JUMPI DUP1 PUSH4 0xF2FDE38B EQ PUSH2 0x4CB JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1B9 PUSH2 0x1B4 CALLDATASIZE PUSH1 0x4 PUSH2 0x2C8A JUMP JUMPDEST PUSH2 0x4DE JUMP JUMPDEST STOP JUMPDEST PUSH1 0x36 SLOAD PUSH2 0x1D2 SWAP1 PUSH1 0x1 PUSH1 0x20 SHL SWAP1 DIV PUSH4 0xFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1DF SWAP2 SWAP1 PUSH2 0x2CAC JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH2 0x1B9 PUSH2 0x1F6 CALLDATASIZE PUSH1 0x4 PUSH2 0x2CF9 JUMP JUMPDEST PUSH2 0x5FC JUMP JUMPDEST PUSH2 0x263 PUSH2 0x209 CALLDATASIZE PUSH1 0x4 PUSH2 0x2D72 JUMP JUMPDEST PUSH1 0x37 PUSH1 0x20 MSTORE PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP1 KECCAK256 DUP1 SLOAD PUSH1 0x1 DUP3 ADD SLOAD PUSH1 0x2 DUP4 ADD SLOAD PUSH1 0x3 DUP5 ADD SLOAD PUSH1 0x4 DUP6 ADD SLOAD PUSH1 0x5 DUP7 ADD SLOAD PUSH1 0x6 DUP8 ADD SLOAD PUSH1 0x7 SWAP1 SWAP8 ADD SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB SWAP7 DUP8 AND SWAP8 SWAP7 SWAP1 SWAP6 AND SWAP6 SWAP4 SWAP5 SWAP3 SWAP4 PUSH1 0xFF DUP1 DUP5 AND SWAP5 PUSH2 0x100 SWAP1 SWAP5 DIV AND SWAP3 DUP10 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1DF SWAP10 SWAP9 SWAP8 SWAP7 SWAP6 SWAP5 SWAP4 SWAP3 SWAP2 SWAP1 PUSH2 0x2DB5 JUMP JUMPDEST PUSH2 0x1B9 PUSH2 0x286 CALLDATASIZE PUSH1 0x4 PUSH2 0x2D72 JUMP JUMPDEST PUSH2 0x734 JUMP JUMPDEST PUSH2 0x1D2 PUSH3 0x7A120 DUP2 JUMP JUMPDEST PUSH2 0x1B9 PUSH2 0x2A3 CALLDATASIZE PUSH1 0x4 PUSH2 0x2D72 JUMP JUMPDEST PUSH2 0x748 JUMP JUMPDEST PUSH1 0x33 SLOAD PUSH2 0x2BB SWAP1 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND DUP2 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1DF SWAP2 SWAP1 PUSH2 0x2E20 JUMP JUMPDEST PUSH2 0x2D1 PUSH1 0x35 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x40 MLOAD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH2 0x1DF JUMP JUMPDEST PUSH2 0x1B9 PUSH2 0x2ED CALLDATASIZE PUSH1 0x4 PUSH2 0x2D72 JUMP JUMPDEST PUSH2 0x8A8 JUMP JUMPDEST PUSH2 0x2D1 PUSH2 0x300 CALLDATASIZE PUSH1 0x4 PUSH2 0x2E34 JUMP JUMPDEST PUSH2 0x9AE JUMP JUMPDEST PUSH1 0x34 SLOAD PUSH1 0x1 PUSH1 0xA0 SHL SWAP1 DIV PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB AND JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1DF SWAP2 SWAP1 PUSH2 0x2E60 JUMP JUMPDEST PUSH1 0x34 SLOAD PUSH2 0x319 SWAP1 PUSH1 0x1 PUSH1 0xA0 SHL SWAP1 DIV PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB AND DUP2 JUMP JUMPDEST PUSH2 0x2D1 PUSH2 0x34E CALLDATASIZE PUSH1 0x4 PUSH2 0x2E74 JUMP JUMPDEST PUSH2 0x9E6 JUMP JUMPDEST PUSH1 0x34 SLOAD PUSH2 0x2BB SWAP1 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND DUP2 JUMP JUMPDEST PUSH2 0x1B9 PUSH2 0x9FF JUMP JUMPDEST PUSH2 0x1B9 PUSH2 0x37C CALLDATASIZE PUSH1 0x4 PUSH2 0x2E8F JUMP JUMPDEST PUSH2 0xA13 JUMP JUMPDEST PUSH2 0x2D1 PUSH2 0x38F CALLDATASIZE PUSH1 0x4 PUSH2 0x2EAC JUMP JUMPDEST PUSH2 0xA24 JUMP JUMPDEST PUSH2 0x2BB PUSH2 0xDC5 JUMP JUMPDEST PUSH1 0x36 SLOAD PUSH2 0x1D2 SWAP1 PUSH4 0xFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH2 0x1B9 PUSH2 0x3BA CALLDATASIZE PUSH1 0x4 PUSH2 0x2D72 JUMP JUMPDEST PUSH2 0xDE0 JUMP JUMPDEST PUSH2 0x1B9 PUSH2 0x3CD CALLDATASIZE PUSH1 0x4 PUSH2 0x2EF2 JUMP JUMPDEST PUSH2 0xEDF JUMP JUMPDEST PUSH2 0x1B9 PUSH2 0x3E0 CALLDATASIZE PUSH1 0x4 PUSH2 0x2E8F JUMP JUMPDEST PUSH2 0xEF0 JUMP JUMPDEST PUSH2 0x1B9 PUSH2 0x3F3 CALLDATASIZE PUSH1 0x4 PUSH2 0x2F1D JUMP JUMPDEST PUSH2 0xF01 JUMP JUMPDEST PUSH2 0x1B9 PUSH2 0x406 CALLDATASIZE PUSH1 0x4 PUSH2 0x2EF2 JUMP JUMPDEST PUSH2 0x1062 JUMP JUMPDEST PUSH1 0x36 SLOAD PUSH4 0xFFFFFFFF AND PUSH2 0x1D2 JUMP JUMPDEST PUSH2 0x42C PUSH2 0x427 CALLDATASIZE PUSH1 0x4 PUSH2 0x2D72 JUMP JUMPDEST PUSH2 0x1073 JUMP JUMPDEST PUSH1 0x40 MLOAD SWAP1 ISZERO ISZERO DUP2 MSTORE PUSH1 0x20 ADD PUSH2 0x1DF JUMP JUMPDEST PUSH2 0x2D1 PUSH2 0x44A CALLDATASIZE PUSH1 0x4 PUSH2 0x2EF2 JUMP JUMPDEST PUSH2 0x10A9 JUMP JUMPDEST PUSH2 0x2D1 PUSH2 0x45D CALLDATASIZE PUSH1 0x4 PUSH2 0x2FA4 JUMP JUMPDEST PUSH2 0x1141 JUMP JUMPDEST PUSH2 0x475 PUSH2 0x470 CALLDATASIZE PUSH1 0x4 PUSH2 0x2FE5 JUMP JUMPDEST PUSH2 0x11D4 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1DF SWAP3 SWAP2 SWAP1 PUSH2 0x3054 JUMP JUMPDEST PUSH2 0x2BB PUSH2 0x491 CALLDATASIZE PUSH1 0x4 PUSH2 0x30FA JUMP JUMPDEST PUSH2 0x13E2 JUMP JUMPDEST PUSH2 0x2D1 PUSH8 0xDE0B6B3A7640000 DUP2 JUMP JUMPDEST PUSH2 0x42C PUSH2 0x4B3 CALLDATASIZE PUSH1 0x4 PUSH2 0x317C JUMP JUMPDEST PUSH2 0x14CD JUMP JUMPDEST PUSH2 0x1B9 PUSH2 0x4C6 CALLDATASIZE PUSH1 0x4 PUSH2 0x31B2 JUMP JUMPDEST PUSH2 0x14F5 JUMP JUMPDEST PUSH2 0x1B9 PUSH2 0x4D9 CALLDATASIZE PUSH1 0x4 PUSH2 0x2EF2 JUMP JUMPDEST PUSH2 0x1506 JUMP JUMPDEST PUSH1 0x34 SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND CALLER EQ PUSH2 0x509 JUMPI PUSH1 0x40 MLOAD PUSH4 0xA8BAF3BB PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST DUP2 PUSH2 0x513 DUP2 PUSH2 0x1073 JUMP JUMPDEST DUP2 SWAP1 PUSH2 0x53E JUMPI PUSH1 0x40 MLOAD PUSH4 0x14A03BBD PUSH1 0xE2 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x535 SWAP2 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST POP PUSH1 0x4 PUSH1 0x0 DUP3 DUP2 MSTORE PUSH1 0x37 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 PUSH1 0x4 ADD SLOAD PUSH2 0x100 SWAP1 DIV PUSH1 0xFF AND PUSH1 0x5 DUP2 GT ISZERO PUSH2 0x56C JUMPI PUSH2 0x56C PUSH2 0x2D8B JUMP JUMPDEST PUSH1 0x0 DUP4 DUP2 MSTORE PUSH1 0x37 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 PUSH1 0x4 ADD SLOAD PUSH2 0x100 SWAP1 DIV PUSH1 0xFF AND SWAP2 EQ PUSH2 0x5A6 JUMPI PUSH1 0x40 MLOAD PUSH4 0x146E540F PUSH1 0xE2 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x535 SWAP2 SWAP1 PUSH2 0x31CF JUMP JUMPDEST POP PUSH1 0x0 DUP4 DUP2 MSTORE PUSH1 0x37 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 PUSH1 0x3 ADD SLOAD DUP4 SWAP1 ISZERO PUSH2 0x5DC JUMPI PUSH1 0x40 MLOAD PUSH4 0x64D0C32B PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x535 SWAP2 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 JUMP JUMPDEST POP PUSH1 0x0 DUP4 DUP2 MSTORE PUSH1 0x37 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 PUSH2 0x5F6 DUP5 DUP3 DUP6 PUSH2 0x1541 JUMP JUMPDEST POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x606 PUSH2 0x15F2 JUMP JUMPDEST DUP1 SLOAD SWAP1 SWAP2 POP PUSH1 0xFF PUSH1 0x1 PUSH1 0x40 SHL DUP3 DIV AND ISZERO SWAP1 PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB AND PUSH1 0x0 DUP2 ISZERO DUP1 ISZERO PUSH2 0x62D JUMPI POP DUP3 JUMPDEST SWAP1 POP PUSH1 0x0 DUP3 PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB AND PUSH1 0x1 EQ DUP1 ISZERO PUSH2 0x649 JUMPI POP ADDRESS EXTCODESIZE ISZERO JUMPDEST SWAP1 POP DUP2 ISZERO DUP1 ISZERO PUSH2 0x657 JUMPI POP DUP1 ISZERO JUMPDEST ISZERO PUSH2 0x675 JUMPI PUSH1 0x40 MLOAD PUSH4 0xF92EE8A9 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST DUP5 SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB NOT AND PUSH1 0x1 OR DUP6 SSTORE DUP4 ISZERO PUSH2 0x69E JUMPI DUP5 SLOAD PUSH1 0xFF PUSH1 0x40 SHL NOT AND PUSH1 0x1 PUSH1 0x40 SHL OR DUP6 SSTORE JUMPDEST PUSH2 0x6A7 DUP12 PUSH2 0x161B JUMP JUMPDEST PUSH2 0x6AF PUSH2 0x162C JUMP JUMPDEST PUSH2 0x6B8 DUP11 PUSH2 0x163C JUMP JUMPDEST PUSH2 0x6C1 DUP10 PUSH2 0x16AD JUMP JUMPDEST PUSH2 0x6CA DUP9 PUSH2 0x1736 JUMP JUMPDEST PUSH2 0x6D3 DUP8 PUSH2 0x1799 JUMP JUMPDEST PUSH2 0x6DC DUP7 PUSH2 0x180B JUMP JUMPDEST DUP4 ISZERO PUSH2 0x727 JUMPI DUP5 SLOAD PUSH1 0xFF PUSH1 0x40 SHL NOT AND DUP6 SSTORE PUSH1 0x40 MLOAD PUSH32 0xC7F505B2F371AE2175EE4913F4499E1F2633A7B5936321EED1CDAEB6115181D2 SWAP1 PUSH2 0x71E SWAP1 PUSH1 0x1 SWAP1 PUSH2 0x2E60 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG1 JUMPDEST POP POP POP POP POP POP POP POP POP POP POP JUMP JUMPDEST PUSH2 0x73C PUSH2 0x1892 JUMP JUMPDEST PUSH2 0x745 DUP2 PUSH2 0x1736 JUMP JUMPDEST POP JUMP JUMPDEST DUP1 PUSH2 0x752 DUP2 PUSH2 0x1073 JUMP JUMPDEST DUP2 SWAP1 PUSH2 0x774 JUMPI PUSH1 0x40 MLOAD PUSH4 0x14A03BBD PUSH1 0xE2 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x535 SWAP2 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 JUMP JUMPDEST POP PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x37 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 PUSH1 0x1 ADD SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND CALLER EQ PUSH2 0x7AF JUMPI PUSH1 0x40 MLOAD PUSH4 0x82C0055 PUSH1 0xE4 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST DUP2 PUSH2 0x7B9 DUP2 PUSH2 0x1073 JUMP JUMPDEST DUP2 SWAP1 PUSH2 0x7DB JUMPI PUSH1 0x40 MLOAD PUSH4 0x14A03BBD PUSH1 0xE2 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x535 SWAP2 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 JUMP JUMPDEST POP PUSH1 0x4 PUSH1 0x0 DUP3 DUP2 MSTORE PUSH1 0x37 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 PUSH1 0x4 ADD SLOAD PUSH2 0x100 SWAP1 DIV PUSH1 0xFF AND PUSH1 0x5 DUP2 GT ISZERO PUSH2 0x809 JUMPI PUSH2 0x809 PUSH2 0x2D8B JUMP JUMPDEST PUSH1 0x0 DUP4 DUP2 MSTORE PUSH1 0x37 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 PUSH1 0x4 ADD SLOAD PUSH2 0x100 SWAP1 DIV PUSH1 0xFF AND SWAP2 EQ PUSH2 0x843 JUMPI PUSH1 0x40 MLOAD PUSH4 0x146E540F PUSH1 0xE2 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x535 SWAP2 SWAP1 PUSH2 0x31CF JUMP JUMPDEST POP PUSH1 0x0 DUP4 DUP2 MSTORE PUSH1 0x37 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 PUSH1 0x6 DUP2 ADD SLOAD TIMESTAMP LT ISZERO PUSH2 0x877 JUMPI PUSH1 0x40 MLOAD PUSH4 0x1D7753D5 PUSH1 0xE1 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH2 0x881 DUP5 DUP3 PUSH2 0x18C4 JUMP JUMPDEST PUSH1 0x3 DUP2 ADD SLOAD ISZERO PUSH2 0x5F6 JUMPI PUSH1 0x3 DUP2 ADD SLOAD PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x37 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 PUSH2 0x5F6 SWAP2 SWAP1 PUSH2 0x18C4 JUMP JUMPDEST PUSH1 0x34 SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND CALLER EQ PUSH2 0x8D3 JUMPI PUSH1 0x40 MLOAD PUSH4 0xA8BAF3BB PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST DUP1 PUSH2 0x8DD DUP2 PUSH2 0x1073 JUMP JUMPDEST DUP2 SWAP1 PUSH2 0x8FF JUMPI PUSH1 0x40 MLOAD PUSH4 0x14A03BBD PUSH1 0xE2 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x535 SWAP2 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 JUMP JUMPDEST POP PUSH1 0x4 PUSH1 0x0 DUP3 DUP2 MSTORE PUSH1 0x37 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 PUSH1 0x4 ADD SLOAD PUSH2 0x100 SWAP1 DIV PUSH1 0xFF AND PUSH1 0x5 DUP2 GT ISZERO PUSH2 0x92D JUMPI PUSH2 0x92D PUSH2 0x2D8B JUMP JUMPDEST PUSH1 0x0 DUP4 DUP2 MSTORE PUSH1 0x37 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 PUSH1 0x4 ADD SLOAD PUSH2 0x100 SWAP1 DIV PUSH1 0xFF AND SWAP2 EQ PUSH2 0x967 JUMPI PUSH1 0x40 MLOAD PUSH4 0x146E540F PUSH1 0xE2 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x535 SWAP2 SWAP1 PUSH2 0x31CF JUMP JUMPDEST POP PUSH1 0x0 DUP3 DUP2 MSTORE PUSH1 0x37 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 PUSH1 0x3 DUP2 ADD SLOAD DUP4 SWAP1 ISZERO PUSH2 0x99E JUMPI PUSH1 0x40 MLOAD PUSH4 0x64D0C32B PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x535 SWAP2 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 JUMP JUMPDEST POP PUSH2 0x9A9 DUP4 DUP3 PUSH2 0x194B JUMP JUMPDEST POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x9CF CALLER PUSH1 0x35 SLOAD PUSH2 0x9BF PUSH2 0x19CA JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND SWAP2 SWAP1 PUSH2 0x19EE JUMP JUMPDEST PUSH2 0x9DD CALLER PUSH1 0x35 SLOAD DUP6 DUP6 PUSH2 0x1AA6 JUMP JUMPDEST SWAP1 POP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x9E0 PUSH2 0x9FA CALLDATASIZE DUP5 SWAP1 SUB DUP5 ADD DUP5 PUSH2 0x31DD JUMP JUMPDEST PUSH2 0x1E28 JUMP JUMPDEST PUSH2 0xA07 PUSH2 0x1892 JUMP JUMPDEST PUSH2 0xA11 PUSH1 0x0 PUSH2 0x1EC5 JUMP JUMPDEST JUMP JUMPDEST PUSH2 0xA1B PUSH2 0x1892 JUMP JUMPDEST PUSH2 0x745 DUP2 PUSH2 0x1799 JUMP JUMPDEST PUSH1 0x34 SLOAD PUSH1 0x0 SWAP1 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND CALLER EQ PUSH2 0xA52 JUMPI PUSH1 0x40 MLOAD PUSH4 0xA8BAF3BB PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x40 MLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0x60 SHL SUB NOT PUSH1 0x60 DUP8 SWAP1 SHL AND PUSH1 0x20 DUP3 ADD MSTORE PUSH6 0x6C6567616379 PUSH1 0xD0 SHL PUSH1 0x34 DUP3 ADD MSTORE PUSH1 0x0 SWAP1 PUSH1 0x3A ADD PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 DUP4 SUB SUB DUP2 MSTORE SWAP1 PUSH1 0x40 MSTORE DUP1 MLOAD SWAP1 PUSH1 0x20 ADD KECCAK256 SWAP1 POP PUSH1 0x0 PUSH2 0xAA0 PUSH2 0x1F21 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0xE022923 DUP9 PUSH1 0x40 MLOAD DUP3 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xACB SWAP2 SWAP1 PUSH2 0x2E20 JUMP JUMPDEST PUSH2 0x120 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP7 GAS STATICCALL ISZERO DUP1 ISZERO PUSH2 0xAE9 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0xB0D SWAP2 SWAP1 PUSH2 0x32D9 JUMP JUMPDEST MLOAD SWAP1 POP DUP7 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP3 AND PUSH2 0xB39 JUMPI PUSH1 0x40 MLOAD PUSH4 0x34789D8B PUSH1 0xE2 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x535 SWAP2 SWAP1 PUSH2 0x2E20 JUMP JUMPDEST POP PUSH1 0x40 DUP1 MLOAD PUSH2 0x120 DUP2 ADD DUP3 MSTORE PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP4 DUP2 AND DUP3 MSTORE DUP9 AND PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x0 SWAP2 DUP2 ADD DUP3 SWAP1 MSTORE PUSH1 0x60 DUP2 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH1 0x3 PUSH1 0x80 DUP3 ADD MSTORE PUSH1 0x1 PUSH1 0xA0 DUP3 ADD MSTORE TIMESTAMP PUSH1 0xC0 DUP3 ADD DUP2 SWAP1 MSTORE PUSH1 0x34 SLOAD PUSH1 0xE0 DUP4 ADD SWAP2 PUSH2 0xBA1 SWAP2 PUSH1 0x1 PUSH1 0xA0 SHL SWAP1 DIV PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB AND SWAP1 PUSH2 0x330C JUMP JUMPDEST DUP2 MSTORE PUSH1 0x0 PUSH1 0x20 SWAP2 DUP3 ADD DUP2 SWAP1 MSTORE DUP5 DUP2 MSTORE PUSH1 0x37 DUP3 MSTORE PUSH1 0x40 SWAP1 DUP2 SWAP1 KECCAK256 DUP4 MLOAD DUP2 SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB SWAP2 DUP3 AND PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB NOT SWAP2 DUP3 AND OR DUP4 SSTORE SWAP4 DUP6 ADD MLOAD PUSH1 0x1 DUP1 DUP5 ADD DUP1 SLOAD SWAP3 SWAP1 SWAP4 AND SWAP2 SWAP1 SWAP6 AND OR SWAP1 SSTORE SWAP1 DUP4 ADD MLOAD PUSH1 0x2 DUP3 ADD SSTORE PUSH1 0x60 DUP4 ADD MLOAD PUSH1 0x3 DUP1 DUP4 ADD SWAP2 SWAP1 SWAP2 SSTORE PUSH1 0x80 DUP5 ADD MLOAD PUSH1 0x4 DUP4 ADD DUP1 SLOAD SWAP4 SWAP5 SWAP2 SWAP4 SWAP1 SWAP3 PUSH1 0xFF NOT SWAP1 SWAP2 AND SWAP2 SWAP1 DUP5 SWAP1 DUP2 GT ISZERO PUSH2 0xC2F JUMPI PUSH2 0xC2F PUSH2 0x2D8B JUMP JUMPDEST MUL OR SWAP1 SSTORE POP PUSH1 0xA0 DUP3 ADD MLOAD PUSH1 0x4 DUP3 ADD DUP1 SLOAD PUSH2 0xFF00 NOT AND PUSH2 0x100 DUP4 PUSH1 0x5 DUP2 GT ISZERO PUSH2 0xC59 JUMPI PUSH2 0xC59 PUSH2 0x2D8B JUMP JUMPDEST MUL OR SWAP1 SSTORE POP PUSH1 0xC0 DUP3 ADD MLOAD PUSH1 0x5 DUP3 ADD SSTORE PUSH1 0xE0 DUP3 ADD MLOAD PUSH1 0x6 DUP3 ADD SSTORE PUSH2 0x100 SWAP1 SWAP2 ADD MLOAD PUSH1 0x7 SWAP1 SWAP2 ADD SSTORE PUSH1 0x0 PUSH2 0xC89 PUSH2 0x1F45 JUMP JUMPDEST SWAP1 POP DUP1 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0xCB8347FE DUP4 DUP9 DUP9 PUSH1 0x40 MLOAD PUSH1 0x20 ADD PUSH2 0xCAE SWAP3 SWAP2 SWAP1 PUSH2 0x3054 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 DUP4 SUB SUB DUP2 MSTORE SWAP1 PUSH1 0x40 MSTORE PUSH1 0x40 MLOAD DUP4 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xCDA SWAP3 SWAP2 SWAP1 PUSH2 0x3365 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0xCF4 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0xD08 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH2 0xD29 DUP8 DUP7 PUSH2 0xD19 PUSH2 0x19CA JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND SWAP2 SWAP1 PUSH2 0x1F81 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP11 DUP2 AND DUP3 MSTORE PUSH1 0x20 DUP3 ADD DUP10 SWAP1 MSTORE SWAP2 DUP2 ADD DUP8 SWAP1 MSTORE DUP2 DUP10 AND SWAP2 DUP5 AND SWAP1 DUP6 SWAP1 PUSH32 0x587A1FC7E80E653A2AB7F63F98C080F5818B8CEDCFD1374590C8C786290ED031 SWAP1 PUSH1 0x60 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG4 DUP7 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND DUP3 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND DUP5 PUSH1 0x0 DUP1 MLOAD PUSH1 0x20 PUSH2 0x359D DUP4 CODECOPY DUP2 MLOAD SWAP2 MSTORE DUP9 PUSH1 0x40 MLOAD PUSH2 0xDB1 SWAP2 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG4 POP SWAP1 SWAP7 SWAP6 POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0xDD0 PUSH2 0x1FBC JUMP JUMPDEST SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x34 SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND CALLER EQ PUSH2 0xE0B JUMPI PUSH1 0x40 MLOAD PUSH4 0xA8BAF3BB PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST DUP1 PUSH2 0xE15 DUP2 PUSH2 0x1073 JUMP JUMPDEST DUP2 SWAP1 PUSH2 0xE37 JUMPI PUSH1 0x40 MLOAD PUSH4 0x14A03BBD PUSH1 0xE2 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x535 SWAP2 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 JUMP JUMPDEST POP PUSH1 0x4 PUSH1 0x0 DUP3 DUP2 MSTORE PUSH1 0x37 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 PUSH1 0x4 ADD SLOAD PUSH2 0x100 SWAP1 DIV PUSH1 0xFF AND PUSH1 0x5 DUP2 GT ISZERO PUSH2 0xE65 JUMPI PUSH2 0xE65 PUSH2 0x2D8B JUMP JUMPDEST PUSH1 0x0 DUP4 DUP2 MSTORE PUSH1 0x37 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 PUSH1 0x4 ADD SLOAD PUSH2 0x100 SWAP1 DIV PUSH1 0xFF AND SWAP2 EQ PUSH2 0xE9F JUMPI PUSH1 0x40 MLOAD PUSH4 0x146E540F PUSH1 0xE2 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x535 SWAP2 SWAP1 PUSH2 0x31CF JUMP JUMPDEST POP PUSH1 0x0 DUP3 DUP2 MSTORE PUSH1 0x37 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 PUSH2 0xEB8 DUP4 DUP3 PUSH2 0x1FE0 JUMP JUMPDEST PUSH1 0x3 DUP2 ADD SLOAD ISZERO PUSH2 0x9A9 JUMPI PUSH1 0x3 DUP2 ADD SLOAD PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x37 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 PUSH2 0x9A9 SWAP2 SWAP1 PUSH2 0x1FE0 JUMP JUMPDEST PUSH2 0xEE7 PUSH2 0x1892 JUMP JUMPDEST PUSH2 0x745 DUP2 PUSH2 0x205F JUMP JUMPDEST PUSH2 0xEF8 PUSH2 0x1892 JUMP JUMPDEST PUSH2 0x745 DUP2 PUSH2 0x180B JUMP JUMPDEST PUSH1 0x34 SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND CALLER EQ PUSH2 0xF2C JUMPI PUSH1 0x40 MLOAD PUSH4 0xA8BAF3BB PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST DUP4 PUSH2 0xF36 DUP2 PUSH2 0x1073 JUMP JUMPDEST DUP2 SWAP1 PUSH2 0xF58 JUMPI PUSH1 0x40 MLOAD PUSH4 0x14A03BBD PUSH1 0xE2 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x535 SWAP2 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 JUMP JUMPDEST POP PUSH1 0x4 PUSH1 0x0 DUP3 DUP2 MSTORE PUSH1 0x37 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 PUSH1 0x4 ADD SLOAD PUSH2 0x100 SWAP1 DIV PUSH1 0xFF AND PUSH1 0x5 DUP2 GT ISZERO PUSH2 0xF86 JUMPI PUSH2 0xF86 PUSH2 0x2D8B JUMP JUMPDEST PUSH1 0x0 DUP4 DUP2 MSTORE PUSH1 0x37 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 PUSH1 0x4 ADD SLOAD PUSH2 0x100 SWAP1 DIV PUSH1 0xFF AND SWAP2 EQ PUSH2 0xFC0 JUMPI PUSH1 0x40 MLOAD PUSH4 0x146E540F PUSH1 0xE2 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x535 SWAP2 SWAP1 PUSH2 0x31CF JUMP JUMPDEST POP PUSH1 0x0 DUP6 DUP2 MSTORE PUSH1 0x37 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 PUSH1 0x3 ADD SLOAD ISZERO ISZERO DUP6 SWAP1 PUSH2 0xFFA JUMPI PUSH1 0x40 MLOAD PUSH1 0x1 PUSH3 0xD62C07 PUSH1 0xE0 SHL SUB NOT DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x535 SWAP2 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 JUMP JUMPDEST POP PUSH1 0x0 DUP6 DUP2 MSTORE PUSH1 0x37 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 PUSH2 0x1014 DUP7 DUP3 DUP8 PUSH2 0x1541 JUMP JUMPDEST DUP4 ISZERO PUSH2 0x103D JUMPI PUSH1 0x3 DUP2 ADD SLOAD PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x37 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 PUSH2 0x1038 SWAP2 SWAP1 DUP6 PUSH2 0x1541 JUMP JUMPDEST PUSH2 0x105A JUMP JUMPDEST PUSH1 0x3 DUP2 ADD SLOAD PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x37 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 PUSH2 0x105A SWAP2 SWAP1 PUSH2 0x1FE0 JUMP JUMPDEST POP POP POP POP POP POP JUMP JUMPDEST PUSH2 0x106A PUSH2 0x1892 JUMP JUMPDEST PUSH2 0x745 DUP2 PUSH2 0x163C JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP4 DUP2 MSTORE PUSH1 0x37 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 PUSH1 0x4 ADD SLOAD PUSH2 0x100 SWAP1 DIV PUSH1 0xFF AND PUSH1 0x5 DUP2 GT ISZERO PUSH2 0x10A1 JUMPI PUSH2 0x10A1 PUSH2 0x2D8B JUMP JUMPDEST EQ ISZERO SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0x10B4 PUSH2 0x1F21 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0x25D9897E DUP5 PUSH2 0x10CB PUSH2 0x1F45 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP4 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x10E8 SWAP3 SWAP2 SWAP1 PUSH2 0x3389 JUMP JUMPDEST PUSH2 0x140 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP7 GAS STATICCALL ISZERO DUP1 ISZERO PUSH2 0x1106 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x112A SWAP2 SWAP1 PUSH2 0x33B9 JUMP JUMPDEST SWAP1 POP PUSH2 0x113A DUP4 DUP3 PUSH1 0x0 ADD MLOAD PUSH2 0x20D0 JUMP JUMPDEST SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x1152 CALLER PUSH1 0x35 SLOAD PUSH2 0x9BF PUSH2 0x19CA JUMP JUMPDEST PUSH2 0x9DD CALLER PUSH1 0x35 SLOAD PUSH2 0x1198 DUP7 DUP7 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY PUSH1 0x0 SWAP3 ADD SWAP2 SWAP1 SWAP2 MSTORE POP PUSH2 0x2165 SWAP3 POP POP POP JUMP JUMPDEST DUP7 DUP7 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY PUSH1 0x0 SWAP3 ADD SWAP2 SWAP1 SWAP2 MSTORE POP PUSH2 0x22A5 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 CALLER SWAP1 POP PUSH1 0x0 PUSH2 0x121D DUP9 DUP9 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY PUSH1 0x0 SWAP3 ADD SWAP2 SWAP1 SWAP2 MSTORE POP PUSH2 0x2165 SWAP3 POP POP POP JUMP JUMPDEST SWAP1 POP PUSH1 0x0 PUSH2 0x1260 DUP8 DUP8 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY PUSH1 0x0 SWAP3 ADD SWAP2 SWAP1 SWAP2 MSTORE POP PUSH2 0x2165 SWAP3 POP POP POP JUMP JUMPDEST SWAP1 POP PUSH2 0x126C DUP3 DUP3 PUSH2 0x25A4 JUMP JUMPDEST DUP3 MLOAD PUSH1 0x20 DUP1 DUP6 ADD MLOAD PUSH1 0x40 DUP1 DUP8 ADD MLOAD DUP7 MLOAD SWAP4 DUP8 ADD MLOAD SWAP2 DUP8 ADD MLOAD SWAP5 SWAP6 SWAP3 SWAP5 SWAP1 SWAP4 SWAP3 PUSH2 0x12CB JUMPI PUSH1 0x40 MLOAD PUSH4 0x6ABA5297 PUSH1 0xE1 SHL DUP2 MSTORE PUSH1 0x4 DUP2 ADD SWAP7 SWAP1 SWAP7 MSTORE PUSH1 0x24 DUP7 ADD SWAP5 SWAP1 SWAP5 MSTORE PUSH1 0x44 DUP6 ADD SWAP3 SWAP1 SWAP3 MSTORE PUSH1 0x64 DUP5 ADD MSTORE PUSH1 0x84 DUP4 ADD MSTORE PUSH1 0xA4 DUP3 ADD MSTORE PUSH1 0xC4 ADD PUSH2 0x535 JUMP JUMPDEST POP POP POP POP POP POP PUSH2 0x12E0 CALLER PUSH1 0x35 SLOAD PUSH2 0x9BF PUSH2 0x19CA JUMP JUMPDEST PUSH1 0x0 PUSH2 0x1332 DUP5 PUSH1 0x2 PUSH1 0x35 SLOAD PUSH2 0x12F5 SWAP2 SWAP1 PUSH2 0x3466 JUMP JUMPDEST DUP6 DUP14 DUP14 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY PUSH1 0x0 SWAP3 ADD SWAP2 SWAP1 SWAP2 MSTORE POP PUSH2 0x22A5 SWAP3 POP POP POP JUMP JUMPDEST SWAP1 POP PUSH1 0x0 PUSH2 0x1386 DUP6 PUSH1 0x2 PUSH1 0x35 SLOAD PUSH2 0x1349 SWAP2 SWAP1 PUSH2 0x3466 JUMP JUMPDEST DUP6 DUP13 DUP13 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY PUSH1 0x0 SWAP3 ADD SWAP2 SWAP1 SWAP2 MSTORE POP PUSH2 0x22A5 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP4 DUP2 MSTORE PUSH1 0x37 PUSH1 0x20 MSTORE PUSH1 0x40 DUP1 DUP3 KECCAK256 PUSH1 0x3 SWAP1 DUP2 ADD DUP5 SWAP1 SSTORE DUP4 DUP4 MSTORE DUP2 DUP4 KECCAK256 ADD DUP6 SWAP1 SSTORE MLOAD SWAP2 SWAP3 POP DUP3 SWAP2 DUP5 SWAP2 PUSH32 0xFEC135A4CF8E5C6E13DEA23BE058BF03A8BF8F1F6FB0A021B0A5AEDDFBA81407 SWAP2 LOG3 SWAP1 SWAP11 SWAP1 SWAP10 POP SWAP8 POP POP POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0x13EE DUP4 PUSH2 0x25D5 JUMP JUMPDEST SWAP1 POP PUSH1 0x0 PUSH2 0x13FA PUSH2 0x1F45 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0xE022923 DUP4 PUSH1 0x40 MLOAD DUP3 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x1425 SWAP2 SWAP1 PUSH2 0x2E20 JUMP JUMPDEST PUSH2 0x120 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP7 GAS STATICCALL ISZERO DUP1 ISZERO PUSH2 0x1443 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x1467 SWAP2 SWAP1 PUSH2 0x32D9 JUMP JUMPDEST DUP1 MLOAD SWAP1 SWAP2 POP DUP3 SWAP1 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH2 0x1495 JUMPI PUSH1 0x40 MLOAD PUSH4 0x34789D8B PUSH1 0xE2 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x535 SWAP2 SWAP1 PUSH2 0x2E20 JUMP JUMPDEST POP PUSH1 0x40 DUP5 ADD MLOAD PUSH1 0x20 DUP3 ADD MLOAD SWAP1 DUP2 DUP2 EQ PUSH2 0x14C3 JUMPI PUSH1 0x40 MLOAD PUSH4 0xA24CFE5 PUSH1 0xE2 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x535 SWAP3 SWAP2 SWAP1 PUSH2 0x3054 JUMP JUMPDEST POP POP MLOAD SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x9DD PUSH2 0x14E1 CALLDATASIZE DUP6 SWAP1 SUB DUP6 ADD DUP6 PUSH2 0x30FA JUMP JUMPDEST PUSH2 0x14F0 CALLDATASIZE DUP6 SWAP1 SUB DUP6 ADD DUP6 PUSH2 0x30FA JUMP JUMPDEST PUSH2 0x25A4 JUMP JUMPDEST PUSH2 0x14FD PUSH2 0x1892 JUMP JUMPDEST PUSH2 0x745 DUP2 PUSH2 0x16AD JUMP JUMPDEST PUSH2 0x150E PUSH2 0x1892 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP2 AND PUSH2 0x1538 JUMPI PUSH1 0x0 PUSH1 0x40 MLOAD PUSH4 0x1E4FBDF7 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x535 SWAP2 SWAP1 PUSH2 0x2E20 JUMP JUMPDEST PUSH2 0x745 DUP2 PUSH2 0x1EC5 JUMP JUMPDEST DUP2 SLOAD PUSH1 0x7 DUP4 ADD SLOAD PUSH1 0x0 SWAP2 PUSH2 0x1562 SWAP2 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB SWAP1 SWAP2 AND SWAP1 DUP5 SWAP1 PUSH2 0x265E JUMP JUMPDEST PUSH1 0x4 DUP5 ADD DUP1 SLOAD PUSH2 0xFF00 NOT AND PUSH2 0x100 OR SWAP1 SSTORE PUSH1 0x1 DUP5 ADD SLOAD PUSH1 0x2 DUP6 ADD SLOAD SWAP2 SWAP3 POP PUSH2 0x15A2 SWAP2 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB SWAP1 SWAP2 AND SWAP1 PUSH2 0x159A SWAP1 DUP5 PUSH2 0x330C JUMP JUMPDEST PUSH2 0xD19 PUSH2 0x19CA JUMP JUMPDEST PUSH1 0x1 DUP4 ADD SLOAD DUP4 SLOAD PUSH1 0x2 DUP6 ADD SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB SWAP3 DUP4 AND SWAP3 SWAP1 SWAP2 AND SWAP1 DUP7 SWAP1 PUSH1 0x0 DUP1 MLOAD PUSH1 0x20 PUSH2 0x359D DUP4 CODECOPY DUP2 MLOAD SWAP2 MSTORE SWAP1 PUSH2 0x15DB SWAP1 DUP7 SWAP1 PUSH2 0x330C JUMP JUMPDEST PUSH1 0x40 MLOAD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG4 POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH32 0xF0C57E16840DF040F15088DC2F81FE391C3923BEC73E23A9662EFC9C229C6A00 PUSH2 0x9E0 JUMP JUMPDEST PUSH2 0x1623 PUSH2 0x280F JUMP JUMPDEST PUSH2 0x745 DUP2 PUSH2 0x2834 JUMP JUMPDEST PUSH2 0x1634 PUSH2 0x280F JUMP JUMPDEST PUSH2 0xA11 PUSH2 0x283C JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP2 AND PUSH2 0x1663 JUMPI PUSH1 0x40 MLOAD PUSH4 0x616BC441 PUSH1 0xE1 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x34 DUP1 SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB NOT AND PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP4 AND SWAP1 DUP2 OR SWAP1 SWAP2 SSTORE PUSH1 0x40 MLOAD PUSH32 0x51744122301B50E919F4E3D22ADF8C53ABC92195B8C667EDA98C6EF20375672E SWAP1 PUSH1 0x0 SWAP1 LOG2 POP JUMP JUMPDEST DUP1 PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB AND PUSH1 0x0 SUB PUSH2 0x16D7 JUMPI PUSH1 0x40 MLOAD PUSH4 0xC4411F11 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x34 DUP1 SLOAD PUSH1 0x1 PUSH1 0xA0 SHL PUSH1 0x1 PUSH1 0xE0 SHL SUB NOT AND PUSH1 0x1 PUSH1 0xA0 SHL PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP5 AND MUL OR SWAP1 SSTORE PUSH1 0x40 MLOAD PUSH32 0x310462A9BF49FFF4A57910EC647C77CBF8AAF2F13394554AC6CDF14FC68DB7E6 SWAP1 PUSH2 0x172B SWAP1 DUP4 SWAP1 PUSH2 0x2E60 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG1 POP JUMP JUMPDEST DUP1 PUSH8 0xDE0B6B3A7640000 DUP2 LT ISZERO PUSH2 0x1763 JUMPI PUSH1 0x40 MLOAD PUSH4 0x33F4E05 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x535 SWAP2 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 JUMP JUMPDEST POP PUSH1 0x35 DUP2 SWAP1 SSTORE PUSH1 0x40 MLOAD DUP2 DUP2 MSTORE PUSH32 0x97896B9DA0F97F36BF3011570BCFF930069299DE4B1E89C9CB44909841CAC2F8 SWAP1 PUSH1 0x20 ADD PUSH2 0x172B JUMP JUMPDEST DUP1 PUSH3 0x7A120 PUSH4 0xFFFFFFFF DUP3 AND GT ISZERO PUSH2 0x17C5 JUMPI PUSH1 0x40 MLOAD PUSH4 0x432E6643 PUSH1 0xE1 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x535 SWAP2 SWAP1 PUSH2 0x2CAC JUMP JUMPDEST POP PUSH1 0x36 DUP1 SLOAD PUSH4 0xFFFFFFFF NOT AND PUSH4 0xFFFFFFFF DUP4 AND OR SWAP1 SSTORE PUSH1 0x40 MLOAD PUSH32 0xC573DC0F869F6A1D0A74FC7712A63BAABCB5567131D2D98005E163924EDDCBAB SWAP1 PUSH2 0x172B SWAP1 DUP4 SWAP1 PUSH2 0x2CAC JUMP JUMPDEST DUP1 PUSH4 0xFFFFFFFF DUP2 AND PUSH3 0xF4240 LT ISZERO PUSH2 0x1837 JUMPI PUSH1 0x40 MLOAD PUSH4 0x4E9374FB PUSH1 0xE1 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x535 SWAP2 SWAP1 PUSH2 0x2CAC JUMP JUMPDEST POP PUSH1 0x36 DUP1 SLOAD PUSH4 0xFFFFFFFF PUSH1 0x20 SHL NOT AND PUSH1 0x1 PUSH1 0x20 SHL PUSH4 0xFFFFFFFF DUP5 DUP2 AND DUP3 MUL SWAP3 SWAP1 SWAP3 OR SWAP3 DUP4 SWAP1 SSTORE PUSH1 0x40 MLOAD PUSH32 0x7EFAF01BEC3CDA8D104163BB466D01D7E16F68848301C7EB0749CFA59D680502 SWAP4 PUSH2 0x172B SWAP4 SWAP3 SWAP1 DIV SWAP1 SWAP2 AND SWAP1 PUSH2 0x2CAC JUMP JUMPDEST CALLER PUSH2 0x189B PUSH2 0xDC5 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND EQ PUSH2 0xA11 JUMPI CALLER PUSH1 0x40 MLOAD PUSH4 0x118CDAA7 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x535 SWAP2 SWAP1 PUSH2 0x2E20 JUMP JUMPDEST PUSH1 0x4 DUP2 ADD DUP1 SLOAD PUSH2 0xFF00 NOT AND PUSH2 0x500 OR SWAP1 SSTORE PUSH1 0x1 DUP2 ADD SLOAD PUSH1 0x2 DUP3 ADD SLOAD PUSH2 0x18F5 SWAP2 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND SWAP1 PUSH2 0xD19 PUSH2 0x19CA JUMP JUMPDEST PUSH1 0x1 DUP2 ADD SLOAD DUP2 SLOAD PUSH1 0x2 DUP4 ADD SLOAD PUSH1 0x40 MLOAD SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB SWAP3 DUP4 AND SWAP3 SWAP1 SWAP2 AND SWAP1 DUP5 SWAP1 PUSH32 0x223103F8EB52E5F43A75655152ACD882A605D70DF57A5C0FEFD30F516B1756D2 SWAP1 PUSH1 0x20 ADD JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG4 POP POP JUMP JUMPDEST PUSH1 0x4 DUP2 ADD DUP1 SLOAD PUSH2 0xFF00 NOT AND PUSH2 0x200 OR SWAP1 SSTORE PUSH1 0x2 DUP2 ADD SLOAD PUSH2 0x197C SWAP1 PUSH2 0x196D PUSH2 0x19CA JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND SWAP1 PUSH2 0x290E JUMP JUMPDEST PUSH1 0x1 DUP2 ADD SLOAD DUP2 SLOAD PUSH1 0x2 DUP4 ADD SLOAD PUSH1 0x40 MLOAD SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB SWAP3 DUP4 AND SWAP3 SWAP1 SWAP2 AND SWAP1 DUP5 SWAP1 PUSH32 0x2226EBD23625A7938FB786DF2248BD171D2E6AD70CB2B654EA1BE830CA17224D SWAP1 PUSH1 0x20 ADD PUSH2 0x193F JUMP JUMPDEST PUSH32 0x0 SWAP1 JUMP JUMPDEST DUP1 ISZERO PUSH2 0x9A9 JUMPI PUSH1 0x40 MLOAD PUSH4 0x23B872DD PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP4 DUP2 AND PUSH1 0x4 DUP4 ADD MSTORE ADDRESS PUSH1 0x24 DUP4 ADD MSTORE PUSH1 0x44 DUP3 ADD DUP4 SWAP1 MSTORE DUP5 AND SWAP1 PUSH4 0x23B872DD SWAP1 PUSH1 0x64 ADD JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 GAS CALL ISZERO DUP1 ISZERO PUSH2 0x1A4A JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x1A6E SWAP2 SWAP1 PUSH2 0x3488 JUMP JUMPDEST PUSH2 0x9A9 JUMPI PUSH1 0x40 MLOAD PUSH3 0x461BCD PUSH1 0xE5 SHL DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x9 PUSH1 0x24 DUP3 ADD MSTORE PUSH9 0x10BA3930B739B332B9 PUSH1 0xB9 SHL PUSH1 0x44 DUP3 ADD MSTORE PUSH1 0x64 ADD PUSH2 0x535 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0x60 SHL SUB NOT PUSH1 0x60 DUP5 SWAP1 SHL AND PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x34 DUP2 ADD DUP3 SWAP1 MSTORE PUSH1 0x0 SWAP1 DUP2 SWAP1 PUSH1 0x54 ADD PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 DUP4 SUB SUB DUP2 MSTORE SWAP1 PUSH1 0x40 MSTORE DUP1 MLOAD SWAP1 PUSH1 0x20 ADD KECCAK256 SWAP1 POP PUSH2 0x1AED DUP2 PUSH2 0x1073 JUMP JUMPDEST ISZERO DUP2 SWAP1 PUSH2 0x1B10 JUMPI PUSH1 0x40 MLOAD PUSH4 0x124A23F1 PUSH1 0xE1 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x535 SWAP2 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 JUMP JUMPDEST POP PUSH1 0x0 PUSH2 0x1B1B PUSH2 0x1F45 JUMP JUMPDEST SWAP1 POP PUSH1 0x0 DUP2 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0xE022923 DUP8 PUSH1 0x40 MLOAD DUP3 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x1B4B SWAP2 SWAP1 PUSH2 0x2E20 JUMP JUMPDEST PUSH2 0x120 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP7 GAS STATICCALL ISZERO DUP1 ISZERO PUSH2 0x1B69 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x1B8D SWAP2 SWAP1 PUSH2 0x32D9 JUMP JUMPDEST DUP1 MLOAD SWAP1 SWAP2 POP DUP7 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP3 AND PUSH2 0x1BBB JUMPI PUSH1 0x40 MLOAD PUSH4 0x34789D8B PUSH1 0xE2 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x535 SWAP2 SWAP1 PUSH2 0x2E20 JUMP JUMPDEST POP PUSH1 0x0 PUSH2 0x1BC6 PUSH2 0x1F21 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0x25D9897E DUP4 DUP7 PUSH1 0x40 MLOAD DUP4 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x1BF3 SWAP3 SWAP2 SWAP1 PUSH2 0x3389 JUMP JUMPDEST PUSH2 0x140 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP7 GAS STATICCALL ISZERO DUP1 ISZERO PUSH2 0x1C11 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x1C35 SWAP2 SWAP1 PUSH2 0x33B9 JUMP JUMPDEST DUP1 MLOAD SWAP1 SWAP2 POP PUSH1 0x0 SUB PUSH2 0x1C5A JUMPI PUSH1 0x40 MLOAD PUSH4 0x307EFDB7 PUSH1 0xE1 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x1C6A DUP4 DUP4 PUSH1 0x0 ADD MLOAD PUSH2 0x20D0 JUMP JUMPDEST PUSH1 0x34 SLOAD SWAP1 SWAP2 POP PUSH1 0x0 SWAP1 PUSH2 0x1C8D SWAP1 PUSH1 0x1 PUSH1 0xA0 SHL SWAP1 DIV PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB AND TIMESTAMP PUSH2 0x330C JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH2 0x120 DUP2 ADD DUP3 MSTORE DUP8 MLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB SWAP1 DUP2 AND DUP3 MSTORE DUP16 AND PUSH1 0x20 DUP3 ADD MSTORE SWAP1 DUP2 ADD DUP14 SWAP1 MSTORE PUSH1 0x0 PUSH1 0x60 DUP3 ADD MSTORE SWAP1 SWAP2 POP PUSH1 0x80 DUP2 ADD PUSH1 0x1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x4 DUP2 MSTORE TIMESTAMP PUSH1 0x20 DUP1 DUP4 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH1 0x40 DUP1 DUP4 ADD DUP6 SWAP1 MSTORE PUSH1 0x60 SWAP3 DUP4 ADD DUP7 SWAP1 MSTORE PUSH1 0x0 DUP12 DUP2 MSTORE PUSH1 0x37 DUP4 MSTORE DUP2 SWAP1 KECCAK256 DUP5 MLOAD DUP2 SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB SWAP2 DUP3 AND PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB NOT SWAP2 DUP3 AND OR DUP4 SSTORE SWAP4 DUP7 ADD MLOAD PUSH1 0x1 DUP1 DUP5 ADD DUP1 SLOAD SWAP3 SWAP1 SWAP4 AND SWAP2 SWAP1 SWAP6 AND OR SWAP1 SSTORE SWAP1 DUP5 ADD MLOAD PUSH1 0x2 DUP3 ADD SSTORE SWAP2 DUP4 ADD MLOAD PUSH1 0x3 DUP1 DUP5 ADD SWAP2 SWAP1 SWAP2 SSTORE PUSH1 0x80 DUP5 ADD MLOAD PUSH1 0x4 DUP5 ADD DUP1 SLOAD SWAP2 SWAP4 SWAP1 SWAP3 PUSH1 0xFF NOT SWAP1 SWAP3 AND SWAP2 DUP5 SWAP1 DUP2 GT ISZERO PUSH2 0x1D64 JUMPI PUSH2 0x1D64 PUSH2 0x2D8B JUMP JUMPDEST MUL OR SWAP1 SSTORE POP PUSH1 0xA0 DUP3 ADD MLOAD PUSH1 0x4 DUP3 ADD DUP1 SLOAD PUSH2 0xFF00 NOT AND PUSH2 0x100 DUP4 PUSH1 0x5 DUP2 GT ISZERO PUSH2 0x1D8E JUMPI PUSH2 0x1D8E PUSH2 0x2D8B JUMP JUMPDEST MUL OR SWAP1 SSTORE POP PUSH1 0xC0 DUP3 ADD MLOAD PUSH1 0x5 DUP3 ADD SSTORE PUSH1 0xE0 DUP3 ADD MLOAD PUSH1 0x6 DUP3 ADD SSTORE PUSH2 0x100 SWAP1 SWAP2 ADD MLOAD PUSH1 0x7 SWAP1 SWAP2 ADD SSTORE DUP5 MLOAD PUSH1 0x40 DUP1 MLOAD DUP14 DUP2 MSTORE PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP14 DUP2 AND PUSH1 0x20 DUP4 ADD MSTORE SWAP2 DUP2 ADD DUP13 SWAP1 MSTORE PUSH1 0x60 DUP2 ADD DUP6 SWAP1 MSTORE PUSH1 0x80 DUP2 ADD DUP5 SWAP1 MSTORE DUP2 DUP16 AND SWAP3 SWAP1 SWAP2 AND SWAP1 DUP10 SWAP1 PUSH32 0x8A1ECCECCE948A912E2E195DE5960359755AEAC90AD88A3FDE55A77E1A73796B SWAP1 PUSH1 0xA0 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG4 POP SWAP5 SWAP11 SWAP10 POP POP POP POP POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 SLOAD DUP2 MLOAD PUSH1 0x20 DUP1 DUP5 ADD MLOAD PUSH1 0x40 SWAP5 DUP6 ADD MLOAD DUP6 MLOAD PUSH32 0x32DD026408194A0D7E54CC66A2AB6C856EFC55CFCD4DD258FDE5B1A55222BAA6 DUP2 DUP6 ADD MSTORE DUP1 DUP8 ADD SWAP5 SWAP1 SWAP5 MSTORE PUSH1 0x60 DUP5 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH1 0x80 DUP1 DUP5 ADD SWAP2 SWAP1 SWAP2 MSTORE DUP5 MLOAD DUP1 DUP5 SUB SWAP1 SWAP2 ADD DUP2 MSTORE PUSH1 0xA0 DUP4 ADD DUP6 MSTORE DUP1 MLOAD SWAP1 DUP3 ADD KECCAK256 PUSH2 0x1901 PUSH1 0xF0 SHL PUSH1 0xC0 DUP5 ADD MSTORE PUSH1 0xC2 DUP4 ADD SWAP4 SWAP1 SWAP4 MSTORE PUSH1 0xE2 DUP1 DUP4 ADD SWAP4 SWAP1 SWAP4 MSTORE DUP4 MLOAD DUP1 DUP4 SUB SWAP1 SWAP4 ADD DUP4 MSTORE PUSH2 0x102 SWAP1 SWAP2 ADD SWAP1 SWAP3 MSTORE DUP1 MLOAD SWAP2 ADD KECCAK256 SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x1ECF PUSH2 0x1FBC JUMP JUMPDEST DUP1 SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP5 DUP2 AND PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB NOT DUP4 AND DUP2 OR DUP5 SSTORE PUSH1 0x40 MLOAD SWAP4 SWAP5 POP SWAP2 AND SWAP2 DUP3 SWAP1 PUSH32 0x8BE0079C531659141344CD1FD0A4F28419497F9722A3DAAFE3B4186F6B6457E0 SWAP1 PUSH1 0x0 SWAP1 LOG3 POP POP POP JUMP JUMPDEST PUSH32 0x0 SWAP1 JUMP JUMPDEST PUSH1 0x33 SLOAD PUSH1 0x0 SWAP1 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH2 0x1F71 JUMPI PUSH1 0x40 MLOAD PUSH4 0xBD088B4F PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST POP PUSH1 0x33 SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND SWAP1 JUMP JUMPDEST DUP1 ISZERO PUSH2 0x9A9 JUMPI PUSH1 0x40 MLOAD PUSH4 0xA9059CBB PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP4 DUP2 AND PUSH1 0x4 DUP4 ADD MSTORE PUSH1 0x24 DUP3 ADD DUP4 SWAP1 MSTORE DUP5 AND SWAP1 PUSH4 0xA9059CBB SWAP1 PUSH1 0x44 ADD PUSH2 0x1A2B JUMP JUMPDEST PUSH32 0x9016D09D72D40FDAE2FD8CEAC6B6234C7706214FD39C1CD1E609A0528C199300 SWAP1 JUMP JUMPDEST PUSH1 0x4 DUP2 ADD DUP1 SLOAD PUSH2 0xFF00 NOT AND PUSH2 0x300 OR SWAP1 SSTORE PUSH1 0x1 DUP2 ADD SLOAD PUSH1 0x2 DUP3 ADD SLOAD PUSH2 0x2011 SWAP2 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND SWAP1 PUSH2 0xD19 PUSH2 0x19CA JUMP JUMPDEST PUSH1 0x1 DUP2 ADD SLOAD DUP2 SLOAD PUSH1 0x2 DUP4 ADD SLOAD PUSH1 0x40 MLOAD SWAP1 DUP2 MSTORE PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB SWAP3 DUP4 AND SWAP3 SWAP1 SWAP2 AND SWAP1 DUP5 SWAP1 PUSH32 0xF0912EFB86EA1D65A17D64D48393CDB1CA0EA5220DD2BBE438621199D30955B7 SWAP1 PUSH1 0x20 ADD PUSH2 0x193F JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP2 AND PUSH2 0x2086 JUMPI PUSH1 0x40 MLOAD PUSH4 0x616BC441 PUSH1 0xE1 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x33 DUP1 SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB NOT AND PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP4 AND SWAP1 DUP2 OR SWAP1 SWAP2 SSTORE PUSH1 0x40 MLOAD PUSH32 0x81DCB738DA3DABD5BB2ADBC7DD107FBBFCA936E9C8AECAB25F5B17A710A784C7 SWAP1 PUSH1 0x0 SWAP1 LOG2 POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0x20DB PUSH2 0x1F21 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0x561285E4 DUP6 PUSH2 0x20F2 PUSH2 0x1F45 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP4 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x210F SWAP3 SWAP2 SWAP1 PUSH2 0x3389 JUMP JUMPDEST PUSH1 0xA0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP7 GAS STATICCALL ISZERO DUP1 ISZERO PUSH2 0x212C JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x2150 SWAP2 SWAP1 PUSH2 0x34A5 JUMP JUMPDEST MLOAD SWAP1 POP PUSH2 0x215D DUP2 DUP5 PUSH2 0x330C JUMP JUMPDEST SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0xC0 DUP2 ADD DUP3 MSTORE PUSH1 0x0 DUP1 DUP3 MSTORE PUSH1 0x20 DUP3 ADD DUP2 SWAP1 MSTORE SWAP2 DUP2 ADD DUP3 SWAP1 MSTORE PUSH1 0x60 DUP2 ADD DUP3 SWAP1 MSTORE PUSH1 0x80 DUP2 ADD DUP3 SWAP1 MSTORE PUSH1 0xA0 DUP2 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH1 0x1 PUSH2 0x21A4 PUSH1 0x20 DUP1 PUSH2 0x330C JUMP JUMPDEST PUSH2 0x21AE SWAP2 SWAP1 PUSH2 0x330C JUMP JUMPDEST PUSH2 0x21B9 SWAP1 PUSH1 0x60 PUSH2 0x330C JUMP JUMPDEST DUP3 MLOAD SWAP1 DUP2 EQ SWAP1 PUSH1 0x1 PUSH2 0x21CC PUSH1 0x20 DUP1 PUSH2 0x330C JUMP JUMPDEST PUSH2 0x21D6 SWAP2 SWAP1 PUSH2 0x330C JUMP JUMPDEST PUSH2 0x21E1 SWAP1 PUSH1 0x60 PUSH2 0x330C JUMP JUMPDEST SWAP1 SWAP2 PUSH2 0x2202 JUMPI PUSH1 0x40 MLOAD PUSH4 0x3FDF3423 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x535 SWAP3 SWAP2 SWAP1 PUSH2 0x3054 JUMP JUMPDEST POP POP PUSH1 0x0 DUP1 PUSH1 0x0 DUP5 DUP1 PUSH1 0x20 ADD SWAP1 MLOAD DUP2 ADD SWAP1 PUSH2 0x221D SWAP2 SWAP1 PUSH2 0x3524 JUMP JUMPDEST SWAP3 POP SWAP3 POP SWAP3 POP PUSH1 0x0 PUSH2 0x2230 DUP7 PUSH1 0x60 PUSH2 0x296E JUMP JUMPDEST SWAP1 POP PUSH1 0x0 PUSH2 0x2249 DUP8 PUSH2 0x2244 PUSH1 0x20 PUSH1 0x60 PUSH2 0x330C JUMP JUMPDEST PUSH2 0x296E JUMP JUMPDEST SWAP1 POP PUSH1 0x0 PUSH2 0x226D DUP9 PUSH1 0x20 PUSH2 0x225E DUP2 PUSH1 0x60 PUSH2 0x330C JUMP JUMPDEST PUSH2 0x2268 SWAP2 SWAP1 PUSH2 0x330C JUMP JUMPDEST PUSH2 0x29B9 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0xC0 DUP2 ADD DUP3 MSTORE SWAP8 DUP9 MSTORE PUSH1 0x20 DUP9 ADD SWAP7 SWAP1 SWAP7 MSTORE SWAP5 DUP7 ADD SWAP4 SWAP1 SWAP4 MSTORE PUSH1 0x60 DUP6 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH1 0x80 DUP5 ADD MSTORE POP PUSH1 0xFF AND PUSH1 0xA0 DUP3 ADD MSTORE SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0x22B1 DUP5 PUSH2 0x13E2 JUMP JUMPDEST SWAP1 POP PUSH1 0x0 PUSH2 0x22BD PUSH2 0x1F21 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0x25D9897E DUP4 PUSH2 0x22D4 PUSH2 0x1F45 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP4 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x22F1 SWAP3 SWAP2 SWAP1 PUSH2 0x3389 JUMP JUMPDEST PUSH2 0x140 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP7 GAS STATICCALL ISZERO DUP1 ISZERO PUSH2 0x230F JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x2333 SWAP2 SWAP1 PUSH2 0x33B9 JUMP JUMPDEST DUP1 MLOAD SWAP1 SWAP2 POP PUSH1 0x0 SUB PUSH2 0x2358 JUMPI PUSH1 0x40 MLOAD PUSH4 0x307EFDB7 PUSH1 0xE1 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST DUP5 MLOAD PUSH1 0x20 DUP1 DUP8 ADD MLOAD PUSH1 0x40 DUP1 DUP10 ADD MLOAD DUP2 MLOAD SWAP4 DUP5 ADD SWAP5 SWAP1 SWAP5 MSTORE DUP3 ADD MSTORE PUSH1 0x60 DUP1 DUP3 ADD SWAP3 SWAP1 SWAP3 MSTORE PUSH1 0x1 PUSH1 0x1 PUSH1 0x60 SHL SUB NOT DUP5 DUP4 SHL DUP2 AND PUSH1 0x80 DUP4 ADD MSTORE SWAP2 DUP10 SWAP1 SHL SWAP1 SWAP2 AND PUSH1 0x94 DUP3 ADD MSTORE PUSH1 0x0 SWAP1 PUSH1 0xA8 ADD PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 DUP4 SUB SUB DUP2 MSTORE SWAP1 PUSH1 0x40 MSTORE DUP1 MLOAD SWAP1 PUSH1 0x20 ADD KECCAK256 SWAP1 POP PUSH2 0x23C1 DUP2 PUSH2 0x1073 JUMP JUMPDEST ISZERO DUP2 SWAP1 PUSH2 0x23E4 JUMPI PUSH1 0x40 MLOAD PUSH4 0x124A23F1 PUSH1 0xE1 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x535 SWAP2 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 JUMP JUMPDEST POP PUSH1 0x0 PUSH2 0x23F5 DUP5 DUP5 PUSH1 0x0 ADD MLOAD PUSH2 0x20D0 JUMP JUMPDEST PUSH1 0x34 SLOAD SWAP1 SWAP2 POP PUSH1 0x0 SWAP1 PUSH2 0x2418 SWAP1 PUSH1 0x1 PUSH1 0xA0 SHL SWAP1 DIV PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB AND TIMESTAMP PUSH2 0x330C JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH2 0x120 DUP2 ADD DUP3 MSTORE PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP1 DUP10 AND DUP3 MSTORE DUP14 AND PUSH1 0x20 DUP3 ADD MSTORE SWAP1 DUP2 ADD DUP12 SWAP1 MSTORE PUSH1 0x0 PUSH1 0x60 DUP3 ADD MSTORE SWAP1 SWAP2 POP PUSH1 0x80 DUP2 ADD PUSH1 0x2 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x4 DUP2 MSTORE TIMESTAMP PUSH1 0x20 DUP1 DUP4 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH1 0x40 DUP1 DUP4 ADD DUP6 SWAP1 MSTORE PUSH1 0x60 SWAP3 DUP4 ADD DUP7 SWAP1 MSTORE PUSH1 0x0 DUP8 DUP2 MSTORE PUSH1 0x37 DUP4 MSTORE DUP2 SWAP1 KECCAK256 DUP5 MLOAD DUP2 SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB SWAP2 DUP3 AND PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB NOT SWAP2 DUP3 AND OR DUP4 SSTORE SWAP4 DUP7 ADD MLOAD PUSH1 0x1 DUP1 DUP5 ADD DUP1 SLOAD SWAP3 SWAP1 SWAP4 AND SWAP2 SWAP1 SWAP6 AND OR SWAP1 SSTORE SWAP1 DUP5 ADD MLOAD PUSH1 0x2 DUP3 ADD SSTORE SWAP2 DUP4 ADD MLOAD PUSH1 0x3 DUP1 DUP5 ADD SWAP2 SWAP1 SWAP2 SSTORE PUSH1 0x80 DUP5 ADD MLOAD PUSH1 0x4 DUP5 ADD DUP1 SLOAD SWAP2 SWAP4 SWAP1 SWAP3 PUSH1 0xFF NOT SWAP1 SWAP3 AND SWAP2 DUP5 SWAP1 DUP2 GT ISZERO PUSH2 0x24ED JUMPI PUSH2 0x24ED PUSH2 0x2D8B JUMP JUMPDEST MUL OR SWAP1 SSTORE POP PUSH1 0xA0 DUP3 ADD MLOAD PUSH1 0x4 DUP3 ADD DUP1 SLOAD PUSH2 0xFF00 NOT AND PUSH2 0x100 DUP4 PUSH1 0x5 DUP2 GT ISZERO PUSH2 0x2517 JUMPI PUSH2 0x2517 PUSH2 0x2D8B JUMP JUMPDEST MUL OR SWAP1 SSTORE POP PUSH1 0xC0 DUP3 ADD MLOAD DUP2 PUSH1 0x5 ADD SSTORE PUSH1 0xE0 DUP3 ADD MLOAD DUP2 PUSH1 0x6 ADD SSTORE PUSH2 0x100 DUP3 ADD MLOAD DUP2 PUSH1 0x7 ADD SSTORE SWAP1 POP POP DUP10 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND DUP6 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND DUP5 PUSH32 0xFB70FAF7306B83C2CEC6D8C1627BAAD892CB79968A02CC0353174499ECFD8B35 DUP13 DUP13 PUSH1 0x40 ADD MLOAD DUP13 DUP8 DUP10 PUSH1 0x40 MLOAD PUSH2 0x258E SWAP6 SWAP5 SWAP4 SWAP3 SWAP2 SWAP1 PUSH2 0x3552 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG4 POP SWAP1 SWAP9 SWAP8 POP POP POP POP POP POP POP POP JUMP JUMPDEST DUP1 MLOAD DUP3 MLOAD PUSH1 0x0 SWAP2 EQ DUP1 ISZERO PUSH2 0x25BF JUMPI POP DUP2 PUSH1 0x40 ADD MLOAD DUP4 PUSH1 0x40 ADD MLOAD EQ JUMPDEST DUP1 ISZERO PUSH2 0x9DD JUMPI POP POP PUSH1 0x20 SWAP1 DUP2 ADD MLOAD SWAP2 ADD MLOAD EQ ISZERO SWAP1 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0x60 DUP2 ADD DUP3 MSTORE DUP3 MLOAD DUP2 MSTORE PUSH1 0x20 DUP1 DUP5 ADD MLOAD SWAP1 DUP3 ADD MSTORE DUP3 DUP3 ADD MLOAD SWAP2 DUP2 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH1 0x0 SWAP1 DUP2 PUSH2 0x2605 DUP3 PUSH2 0x1E28 JUMP JUMPDEST SWAP1 POP PUSH2 0x215D DUP2 DUP6 PUSH1 0x60 ADD MLOAD DUP7 PUSH1 0x80 ADD MLOAD DUP8 PUSH1 0xA0 ADD MLOAD PUSH1 0x40 MLOAD PUSH1 0x20 ADD PUSH2 0x264A SWAP4 SWAP3 SWAP2 SWAP1 SWAP3 DUP4 MSTORE PUSH1 0x20 DUP4 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH1 0xF8 SHL PUSH1 0x1 PUSH1 0x1 PUSH1 0xF8 SHL SUB NOT AND PUSH1 0x40 DUP3 ADD MSTORE PUSH1 0x41 ADD SWAP1 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 DUP4 SUB SUB DUP2 MSTORE SWAP1 PUSH1 0x40 MSTORE PUSH2 0x2A04 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0x2669 PUSH2 0x1F45 JUMP JUMPDEST SWAP1 POP PUSH1 0x0 PUSH2 0x2675 PUSH2 0x1F21 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0x25D9897E DUP8 DUP5 PUSH1 0x40 MLOAD DUP4 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x26A2 SWAP3 SWAP2 SWAP1 PUSH2 0x3389 JUMP JUMPDEST PUSH2 0x140 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP7 GAS STATICCALL ISZERO DUP1 ISZERO PUSH2 0x26C0 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x26E4 SWAP2 SWAP1 PUSH2 0x33B9 JUMP JUMPDEST PUSH1 0x36 SLOAD SWAP1 SWAP2 POP PUSH1 0x0 SWAP1 PUSH2 0x2709 SWAP1 DUP7 SWAP1 PUSH4 0xFFFFFFFF PUSH1 0x1 PUSH1 0x20 SHL SWAP1 SWAP2 DIV DUP2 AND SWAP1 PUSH2 0x2A2E AND JUMP JUMPDEST SWAP1 POP DUP6 ISZERO DUP1 ISZERO SWAP1 PUSH2 0x271A JUMPI POP DUP1 DUP7 GT ISZERO JUMPDEST DUP7 DUP3 SWAP1 SWAP2 PUSH2 0x273D JUMPI PUSH1 0x40 MLOAD PUSH4 0xCC6B7C41 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x535 SWAP3 SWAP2 SWAP1 PUSH2 0x3054 JUMP JUMPDEST POP POP PUSH1 0x0 PUSH2 0x274F DUP8 DUP5 PUSH1 0x0 ADD MLOAD PUSH2 0x2A8E JUMP JUMPDEST PUSH1 0x60 DUP5 ADD MLOAD PUSH1 0x36 SLOAD SWAP2 SWAP3 POP PUSH1 0x0 SWAP2 PUSH2 0x2770 SWAP2 PUSH4 0xFFFFFFFF SWAP1 DUP2 AND SWAP2 AND PUSH2 0x2A8E JUMP JUMPDEST SWAP1 POP PUSH1 0x0 PUSH2 0x277E DUP3 DUP5 PUSH2 0x2A2E JUMP JUMPDEST SWAP1 POP DUP6 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0xCB8347FE DUP12 DUP12 DUP5 PUSH1 0x40 MLOAD PUSH1 0x20 ADD PUSH2 0x27A3 SWAP3 SWAP2 SWAP1 PUSH2 0x3054 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 DUP4 SUB SUB DUP2 MSTORE SWAP1 PUSH1 0x40 MSTORE PUSH1 0x40 MLOAD DUP4 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x27CF SWAP3 SWAP2 SWAP1 PUSH2 0x3365 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x27E9 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x27FD JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP SWAP3 SWAP13 SWAP12 POP POP POP POP POP POP POP POP POP POP POP POP JUMP JUMPDEST PUSH2 0x2817 PUSH2 0x2AA5 JUMP JUMPDEST PUSH2 0xA11 JUMPI PUSH1 0x40 MLOAD PUSH4 0x1AFCD79F PUSH1 0xE3 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH2 0x150E PUSH2 0x280F JUMP JUMPDEST PUSH2 0x2844 PUSH2 0x280F JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH32 0xD87CD6EF79D4E2B95E15CE8ABF732DB51EC771F1CA2EDCCF22A46C729AC56472 PUSH1 0x20 DUP3 ADD MSTORE PUSH32 0x171A7FA058648750A8C5AAE430F30DB8D0100EFC3A5E1B2E8054B1C1CE28B6B4 SWAP2 DUP2 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH32 0x44852B2A670ADE5407E78FB2863C51DE9FCB96542A07186FE3AEDA6BB8A116D PUSH1 0x60 DUP3 ADD MSTORE CHAINID PUSH1 0x80 DUP3 ADD MSTORE ADDRESS PUSH1 0xA0 DUP3 ADD MSTORE PUSH32 0xA070FFB1CD7409649BF77822CCE74495468E06DBFAEF09556838BF188679B9C2 PUSH1 0xC0 DUP3 ADD MSTORE PUSH1 0xE0 ADD PUSH1 0x40 DUP1 MLOAD PUSH1 0x1F NOT DUP2 DUP5 SUB ADD DUP2 MSTORE SWAP2 SWAP1 MSTORE DUP1 MLOAD PUSH1 0x20 SWAP1 SWAP2 ADD KECCAK256 PUSH1 0x0 SSTORE JUMP JUMPDEST DUP1 ISZERO PUSH2 0x296A JUMPI PUSH1 0x40 MLOAD PUSH4 0x852CD8D PUSH1 0xE3 SHL DUP2 MSTORE PUSH1 0x4 DUP2 ADD DUP3 SWAP1 MSTORE PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP4 AND SWAP1 PUSH4 0x42966C68 SWAP1 PUSH1 0x24 ADD PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x2956 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x105A JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x297B PUSH1 0x20 DUP4 PUSH2 0x330C JUMP JUMPDEST DUP4 MLOAD SWAP1 DUP2 LT ISZERO SWAP1 PUSH2 0x298D PUSH1 0x20 DUP6 PUSH2 0x330C JUMP JUMPDEST SWAP1 SWAP2 PUSH2 0x29AE JUMPI PUSH1 0x40 MLOAD PUSH4 0x3FDF3423 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x535 SWAP3 SWAP2 SWAP1 PUSH2 0x3054 JUMP JUMPDEST POP POP POP ADD PUSH1 0x20 ADD MLOAD SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x29C6 PUSH1 0x1 DUP4 PUSH2 0x330C JUMP JUMPDEST DUP4 MLOAD SWAP1 DUP2 LT ISZERO SWAP1 PUSH2 0x29D8 PUSH1 0x1 DUP6 PUSH2 0x330C JUMP JUMPDEST SWAP1 SWAP2 PUSH2 0x29F9 JUMPI PUSH1 0x40 MLOAD PUSH4 0x3FDF3423 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x535 SWAP3 SWAP2 SWAP1 PUSH2 0x3054 JUMP JUMPDEST POP POP POP ADD PUSH1 0x1 ADD MLOAD SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH2 0x2A14 DUP7 DUP7 PUSH2 0x2ABF JUMP JUMPDEST SWAP3 POP SWAP3 POP SWAP3 POP PUSH2 0x2A24 DUP3 DUP3 PUSH2 0x2B0C JUMP JUMPDEST POP SWAP1 SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x2A3D DUP4 PUSH3 0xF4240 LT ISZERO SWAP1 JUMP JUMPDEST DUP1 PUSH2 0x2A50 JUMPI POP PUSH2 0x2A50 DUP3 PUSH3 0xF4240 LT ISZERO SWAP1 JUMP JUMPDEST DUP4 DUP4 SWAP1 SWAP2 PUSH2 0x2A73 JUMPI PUSH1 0x40 MLOAD PUSH4 0x768BF0EB PUSH1 0xE1 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x535 SWAP3 SWAP2 SWAP1 PUSH2 0x3054 JUMP JUMPDEST POP PUSH3 0xF4240 SWAP1 POP PUSH2 0x2A84 DUP4 DUP6 PUSH2 0x3585 JUMP JUMPDEST PUSH2 0x9DD SWAP2 SWAP1 PUSH2 0x3466 JUMP JUMPDEST PUSH1 0x0 DUP2 DUP4 GT ISZERO PUSH2 0x2A9E JUMPI DUP2 PUSH2 0x9DD JUMP JUMPDEST POP SWAP1 SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x2AAF PUSH2 0x15F2 JUMP JUMPDEST SLOAD PUSH1 0x1 PUSH1 0x40 SHL SWAP1 DIV PUSH1 0xFF AND SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP4 MLOAD PUSH1 0x41 SUB PUSH2 0x2AF9 JUMPI PUSH1 0x20 DUP5 ADD MLOAD PUSH1 0x40 DUP6 ADD MLOAD PUSH1 0x60 DUP7 ADD MLOAD PUSH1 0x0 BYTE PUSH2 0x2AEB DUP9 DUP3 DUP6 DUP6 PUSH2 0x2BC5 JUMP JUMPDEST SWAP6 POP SWAP6 POP SWAP6 POP POP POP POP PUSH2 0x2B05 JUMP JUMPDEST POP POP DUP2 MLOAD PUSH1 0x0 SWAP2 POP PUSH1 0x2 SWAP1 JUMPDEST SWAP3 POP SWAP3 POP SWAP3 JUMP JUMPDEST PUSH1 0x0 DUP3 PUSH1 0x3 DUP2 GT ISZERO PUSH2 0x2B20 JUMPI PUSH2 0x2B20 PUSH2 0x2D8B JUMP JUMPDEST SUB PUSH2 0x2B29 JUMPI POP POP JUMP JUMPDEST PUSH1 0x1 DUP3 PUSH1 0x3 DUP2 GT ISZERO PUSH2 0x2B3D JUMPI PUSH2 0x2B3D PUSH2 0x2D8B JUMP JUMPDEST SUB PUSH2 0x2B5B JUMPI PUSH1 0x40 MLOAD PUSH4 0xF645EEDF PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x2 DUP3 PUSH1 0x3 DUP2 GT ISZERO PUSH2 0x2B6F JUMPI PUSH2 0x2B6F PUSH2 0x2D8B JUMP JUMPDEST SUB PUSH2 0x2B90 JUMPI PUSH1 0x40 MLOAD PUSH4 0xFCE698F7 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 DUP2 ADD DUP3 SWAP1 MSTORE PUSH1 0x24 ADD PUSH2 0x535 JUMP JUMPDEST PUSH1 0x3 DUP3 PUSH1 0x3 DUP2 GT ISZERO PUSH2 0x2BA4 JUMPI PUSH2 0x2BA4 PUSH2 0x2D8B JUMP JUMPDEST SUB PUSH2 0x296A JUMPI PUSH1 0x40 MLOAD PUSH4 0x35E2F383 PUSH1 0xE2 SHL DUP2 MSTORE PUSH1 0x4 DUP2 ADD DUP3 SWAP1 MSTORE PUSH1 0x24 ADD PUSH2 0x535 JUMP JUMPDEST PUSH1 0x0 DUP1 DUP1 PUSH16 0xA2A8918CA85BAFE22016D0B997E4DF60 PUSH1 0x1 PUSH1 0xFF SHL SUB DUP5 GT ISZERO PUSH2 0x2BF6 JUMPI POP PUSH1 0x0 SWAP2 POP PUSH1 0x3 SWAP1 POP DUP3 PUSH2 0x2C80 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0x0 DUP1 DUP3 MSTORE PUSH1 0x20 DUP3 ADD DUP1 DUP5 MSTORE DUP11 SWAP1 MSTORE PUSH1 0xFF DUP10 AND SWAP3 DUP3 ADD SWAP3 SWAP1 SWAP3 MSTORE PUSH1 0x60 DUP2 ADD DUP8 SWAP1 MSTORE PUSH1 0x80 DUP2 ADD DUP7 SWAP1 MSTORE PUSH1 0x1 SWAP1 PUSH1 0xA0 ADD PUSH1 0x20 PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 SUB SWAP1 DUP1 DUP5 SUB SWAP1 DUP6 GAS STATICCALL ISZERO DUP1 ISZERO PUSH2 0x2C4A JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP PUSH1 0x40 MLOAD PUSH1 0x1F NOT ADD MLOAD SWAP2 POP POP PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP2 AND PUSH2 0x2C76 JUMPI POP PUSH1 0x0 SWAP3 POP PUSH1 0x1 SWAP2 POP DUP3 SWAP1 POP PUSH2 0x2C80 JUMP JUMPDEST SWAP3 POP PUSH1 0x0 SWAP2 POP DUP2 SWAP1 POP JUMPDEST SWAP5 POP SWAP5 POP SWAP5 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x2C9D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP POP DUP1 CALLDATALOAD SWAP3 PUSH1 0x20 SWAP1 SWAP2 ADD CALLDATALOAD SWAP2 POP JUMP JUMPDEST PUSH4 0xFFFFFFFF SWAP2 SWAP1 SWAP2 AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP2 AND DUP2 EQ PUSH2 0x745 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP2 AND DUP2 EQ PUSH2 0x745 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH4 0xFFFFFFFF DUP2 AND DUP2 EQ PUSH2 0x745 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0xC0 DUP8 DUP10 SUB SLT ISZERO PUSH2 0x2D12 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP7 CALLDATALOAD PUSH2 0x2D1D DUP2 PUSH2 0x2CBD JUMP JUMPDEST SWAP6 POP PUSH1 0x20 DUP8 ADD CALLDATALOAD PUSH2 0x2D2D DUP2 PUSH2 0x2CBD JUMP JUMPDEST SWAP5 POP PUSH1 0x40 DUP8 ADD CALLDATALOAD PUSH2 0x2D3D DUP2 PUSH2 0x2CD2 JUMP JUMPDEST SWAP4 POP PUSH1 0x60 DUP8 ADD CALLDATALOAD SWAP3 POP PUSH1 0x80 DUP8 ADD CALLDATALOAD PUSH2 0x2D54 DUP2 PUSH2 0x2CE7 JUMP JUMPDEST SWAP2 POP PUSH1 0xA0 DUP8 ADD CALLDATALOAD PUSH2 0x2D64 DUP2 PUSH2 0x2CE7 JUMP JUMPDEST DUP1 SWAP2 POP POP SWAP3 SWAP6 POP SWAP3 SWAP6 POP SWAP3 SWAP6 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x2D84 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP CALLDATALOAD SWAP2 SWAP1 POP JUMP JUMPDEST PUSH4 0x4E487B71 PUSH1 0xE0 SHL PUSH1 0x0 MSTORE PUSH1 0x21 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST PUSH1 0x6 DUP2 LT PUSH2 0x2DB1 JUMPI PUSH2 0x2DB1 PUSH2 0x2D8B JUMP JUMPDEST SWAP1 MSTORE JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP11 DUP2 AND DUP3 MSTORE DUP10 AND PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 DUP2 ADD DUP9 SWAP1 MSTORE PUSH1 0x60 DUP2 ADD DUP8 SWAP1 MSTORE PUSH2 0x120 DUP2 ADD PUSH1 0x4 DUP8 LT PUSH2 0x2DEC JUMPI PUSH2 0x2DEC PUSH2 0x2D8B JUMP JUMPDEST DUP7 PUSH1 0x80 DUP4 ADD MSTORE PUSH2 0x2DFF PUSH1 0xA0 DUP4 ADD DUP8 PUSH2 0x2DA1 JUMP JUMPDEST DUP5 PUSH1 0xC0 DUP4 ADD MSTORE DUP4 PUSH1 0xE0 DUP4 ADD MSTORE DUP3 PUSH2 0x100 DUP4 ADD MSTORE SWAP11 SWAP10 POP POP POP POP POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB SWAP2 SWAP1 SWAP2 AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x2E47 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 CALLDATALOAD PUSH2 0x2E52 DUP2 PUSH2 0x2CBD JUMP JUMPDEST SWAP5 PUSH1 0x20 SWAP4 SWAP1 SWAP4 ADD CALLDATALOAD SWAP4 POP POP POP JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB SWAP2 SWAP1 SWAP2 AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x60 DUP3 DUP5 SUB SLT DUP1 ISZERO PUSH2 0x2E87 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP SWAP1 SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x2EA1 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD PUSH2 0x113A DUP2 PUSH2 0x2CE7 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0x80 DUP6 DUP8 SUB SLT ISZERO PUSH2 0x2EC2 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP5 CALLDATALOAD PUSH2 0x2ECD DUP2 PUSH2 0x2CBD JUMP JUMPDEST SWAP4 POP PUSH1 0x20 DUP6 ADD CALLDATALOAD PUSH2 0x2EDD DUP2 PUSH2 0x2CBD JUMP JUMPDEST SWAP4 SWAP7 SWAP4 SWAP6 POP POP POP POP PUSH1 0x40 DUP3 ADD CALLDATALOAD SWAP2 PUSH1 0x60 ADD CALLDATALOAD SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x2F04 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD PUSH2 0x113A DUP2 PUSH2 0x2CBD JUMP JUMPDEST DUP1 ISZERO ISZERO DUP2 EQ PUSH2 0x745 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0x80 DUP6 DUP8 SUB SLT ISZERO PUSH2 0x2F33 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP5 CALLDATALOAD SWAP4 POP PUSH1 0x20 DUP6 ADD CALLDATALOAD SWAP3 POP PUSH1 0x40 DUP6 ADD CALLDATALOAD PUSH2 0x2F4C DUP2 PUSH2 0x2F0F JUMP JUMPDEST SWAP4 SWAP7 SWAP3 SWAP6 POP SWAP3 SWAP4 PUSH1 0x60 ADD CALLDATALOAD SWAP3 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 DUP4 PUSH1 0x1F DUP5 ADD SLT PUSH2 0x2F6E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP DUP2 CALLDATALOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP2 GT ISZERO PUSH2 0x2F85 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x20 DUP4 ADD SWAP2 POP DUP4 PUSH1 0x20 DUP3 DUP6 ADD ADD GT ISZERO PUSH2 0x2F9D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x20 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x2FB7 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 CALLDATALOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP2 GT ISZERO PUSH2 0x2FCD JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x2FD9 DUP6 DUP3 DUP7 ADD PUSH2 0x2F5C JUMP JUMPDEST SWAP1 SWAP7 SWAP1 SWAP6 POP SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0x40 DUP6 DUP8 SUB SLT ISZERO PUSH2 0x2FFB JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP5 CALLDATALOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP2 GT ISZERO PUSH2 0x3011 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x301D DUP8 DUP3 DUP9 ADD PUSH2 0x2F5C JUMP JUMPDEST SWAP1 SWAP6 POP SWAP4 POP POP PUSH1 0x20 DUP6 ADD CALLDATALOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP2 GT ISZERO PUSH2 0x303C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x3048 DUP8 DUP3 DUP9 ADD PUSH2 0x2F5C JUMP JUMPDEST SWAP6 SWAP9 SWAP5 SWAP8 POP SWAP6 POP POP POP POP JUMP JUMPDEST SWAP2 DUP3 MSTORE PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH1 0xC0 DUP2 ADD PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP2 GT DUP3 DUP3 LT OR ISZERO PUSH2 0x3092 JUMPI PUSH4 0x4E487B71 PUSH1 0xE0 SHL PUSH1 0x0 MSTORE PUSH1 0x41 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST PUSH1 0x40 MSTORE SWAP1 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x120 DUP2 ADD PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP2 GT DUP3 DUP3 LT OR ISZERO PUSH2 0x3092 JUMPI PUSH4 0x4E487B71 PUSH1 0xE0 SHL PUSH1 0x0 MSTORE PUSH1 0x41 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x140 DUP2 ADD PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP2 GT DUP3 DUP3 LT OR ISZERO PUSH2 0x3092 JUMPI PUSH4 0x4E487B71 PUSH1 0xE0 SHL PUSH1 0x0 MSTORE PUSH1 0x41 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST PUSH1 0x0 PUSH1 0xC0 DUP3 DUP5 SUB SLT DUP1 ISZERO PUSH2 0x310D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x0 PUSH2 0x3118 PUSH2 0x3062 JUMP JUMPDEST DUP4 CALLDATALOAD DUP2 MSTORE PUSH1 0x20 DUP1 DUP6 ADD CALLDATALOAD SWAP1 DUP3 ADD MSTORE PUSH1 0x40 DUP1 DUP6 ADD CALLDATALOAD SWAP1 DUP3 ADD MSTORE PUSH1 0x60 DUP1 DUP6 ADD CALLDATALOAD SWAP1 DUP3 ADD MSTORE PUSH1 0x80 DUP1 DUP6 ADD CALLDATALOAD SWAP1 DUP3 ADD MSTORE PUSH1 0xA0 DUP5 ADD CALLDATALOAD PUSH1 0xFF DUP2 AND DUP2 EQ PUSH2 0x3157 JUMPI DUP3 DUP4 REVERT JUMPDEST PUSH1 0xA0 DUP3 ADD MSTORE SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0xC0 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x3176 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0x180 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x3190 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x319A DUP5 DUP5 PUSH2 0x3164 JUMP JUMPDEST SWAP2 POP PUSH2 0x31A9 DUP5 PUSH1 0xC0 DUP6 ADD PUSH2 0x3164 JUMP JUMPDEST SWAP1 POP SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x31C4 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD PUSH2 0x113A DUP2 PUSH2 0x2CD2 JUMP JUMPDEST PUSH1 0x20 DUP2 ADD PUSH2 0x9E0 DUP3 DUP5 PUSH2 0x2DA1 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x60 DUP3 DUP5 SUB SLT DUP1 ISZERO PUSH2 0x31F0 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x40 MLOAD PUSH1 0x0 SWAP1 PUSH1 0x60 DUP2 ADD PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP2 GT DUP3 DUP3 LT OR ISZERO PUSH2 0x3222 JUMPI PUSH4 0x4E487B71 PUSH1 0xE0 SHL DUP4 MSTORE PUSH1 0x41 PUSH1 0x4 MSTORE PUSH1 0x24 DUP4 REVERT JUMPDEST PUSH1 0x40 SWAP1 DUP2 MSTORE DUP5 CALLDATALOAD DUP3 MSTORE PUSH1 0x20 DUP1 DUP7 ADD CALLDATALOAD SWAP1 DUP4 ADD MSTORE SWAP4 DUP5 ADD CALLDATALOAD SWAP4 DUP2 ADD SWAP4 SWAP1 SWAP4 MSTORE POP SWAP1 SWAP3 SWAP2 POP POP JUMP JUMPDEST DUP1 MLOAD PUSH2 0x3253 DUP2 PUSH2 0x2CBD JUMP JUMPDEST SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x120 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x326B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x3273 PUSH2 0x3098 JUMP JUMPDEST SWAP1 POP PUSH2 0x327E DUP3 PUSH2 0x3248 JUMP JUMPDEST DUP2 MSTORE PUSH1 0x20 DUP3 DUP2 ADD MLOAD SWAP1 DUP3 ADD MSTORE PUSH1 0x40 DUP1 DUP4 ADD MLOAD SWAP1 DUP3 ADD MSTORE PUSH1 0x60 DUP1 DUP4 ADD MLOAD SWAP1 DUP3 ADD MSTORE PUSH1 0x80 DUP1 DUP4 ADD MLOAD SWAP1 DUP3 ADD MSTORE PUSH1 0xA0 DUP1 DUP4 ADD MLOAD SWAP1 DUP3 ADD MSTORE PUSH1 0xC0 DUP1 DUP4 ADD MLOAD SWAP1 DUP3 ADD MSTORE PUSH1 0xE0 DUP1 DUP4 ADD MLOAD SWAP1 DUP3 ADD MSTORE PUSH2 0x100 SWAP2 DUP3 ADD MLOAD SWAP2 DUP2 ADD SWAP2 SWAP1 SWAP2 MSTORE SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x120 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x32EC JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x9DD DUP4 DUP4 PUSH2 0x3258 JUMP JUMPDEST PUSH4 0x4E487B71 PUSH1 0xE0 SHL PUSH1 0x0 MSTORE PUSH1 0x11 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST DUP1 DUP3 ADD DUP1 DUP3 GT ISZERO PUSH2 0x9E0 JUMPI PUSH2 0x9E0 PUSH2 0x32F6 JUMP JUMPDEST PUSH1 0x0 DUP2 MLOAD DUP1 DUP5 MSTORE PUSH1 0x0 JUMPDEST DUP2 DUP2 LT ISZERO PUSH2 0x3345 JUMPI PUSH1 0x20 DUP2 DUP6 ADD DUP2 ADD MLOAD DUP7 DUP4 ADD DUP3 ADD MSTORE ADD PUSH2 0x3329 JUMP JUMPDEST POP PUSH1 0x0 PUSH1 0x20 DUP3 DUP7 ADD ADD MSTORE PUSH1 0x20 PUSH1 0x1F NOT PUSH1 0x1F DUP4 ADD AND DUP6 ADD ADD SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP4 AND DUP2 MSTORE PUSH1 0x40 PUSH1 0x20 DUP3 ADD DUP2 SWAP1 MSTORE PUSH1 0x0 SWAP1 PUSH2 0x215D SWAP1 DUP4 ADD DUP5 PUSH2 0x331F JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB SWAP3 DUP4 AND DUP2 MSTORE SWAP2 AND PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST DUP1 MLOAD PUSH2 0x3253 DUP2 PUSH2 0x2CE7 JUMP JUMPDEST DUP1 MLOAD PUSH2 0x3253 DUP2 PUSH2 0x2CD2 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x140 DUP3 DUP5 SUB SLT DUP1 ISZERO PUSH2 0x33CD JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x0 PUSH2 0x33D8 PUSH2 0x30C9 JUMP JUMPDEST DUP4 MLOAD DUP2 MSTORE PUSH1 0x20 DUP1 DUP6 ADD MLOAD SWAP1 DUP3 ADD MSTORE PUSH1 0x40 DUP1 DUP6 ADD MLOAD SWAP1 DUP3 ADD MSTORE PUSH2 0x33FC PUSH1 0x60 DUP6 ADD PUSH2 0x33A3 JUMP JUMPDEST PUSH1 0x60 DUP3 ADD MSTORE PUSH2 0x340D PUSH1 0x80 DUP6 ADD PUSH2 0x33AE JUMP JUMPDEST PUSH1 0x80 DUP3 ADD MSTORE PUSH2 0x341E PUSH1 0xA0 DUP6 ADD PUSH2 0x33AE JUMP JUMPDEST PUSH1 0xA0 DUP3 ADD MSTORE PUSH2 0x342F PUSH1 0xC0 DUP6 ADD PUSH2 0x33A3 JUMP JUMPDEST PUSH1 0xC0 DUP3 ADD MSTORE PUSH2 0x3440 PUSH1 0xE0 DUP6 ADD PUSH2 0x33AE JUMP JUMPDEST PUSH1 0xE0 DUP3 ADD MSTORE PUSH2 0x100 DUP5 DUP2 ADD MLOAD SWAP1 DUP3 ADD MSTORE PUSH2 0x120 SWAP4 DUP5 ADD MLOAD SWAP4 DUP2 ADD SWAP4 SWAP1 SWAP4 MSTORE POP SWAP1 SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP3 PUSH2 0x3483 JUMPI PUSH4 0x4E487B71 PUSH1 0xE0 SHL PUSH1 0x0 MSTORE PUSH1 0x12 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST POP DIV SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x349A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 MLOAD PUSH2 0x113A DUP2 PUSH2 0x2F0F JUMP JUMPDEST PUSH1 0x0 PUSH1 0xA0 DUP3 DUP5 SUB SLT DUP1 ISZERO PUSH2 0x34B8 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x40 MLOAD PUSH1 0x0 SWAP1 PUSH1 0xA0 DUP2 ADD PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP2 GT DUP3 DUP3 LT OR ISZERO PUSH2 0x34EA JUMPI PUSH4 0x4E487B71 PUSH1 0xE0 SHL DUP4 MSTORE PUSH1 0x41 PUSH1 0x4 MSTORE PUSH1 0x24 DUP4 REVERT JUMPDEST PUSH1 0x40 SWAP1 DUP2 MSTORE DUP5 MLOAD DUP3 MSTORE PUSH1 0x20 DUP1 DUP7 ADD MLOAD SWAP1 DUP4 ADD MSTORE DUP5 DUP2 ADD MLOAD SWAP1 DUP3 ADD MSTORE PUSH1 0x60 DUP1 DUP6 ADD MLOAD SWAP1 DUP3 ADD MSTORE PUSH1 0x80 SWAP4 DUP5 ADD MLOAD SWAP4 DUP2 ADD SWAP4 SWAP1 SWAP4 MSTORE POP SWAP1 SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH1 0x60 DUP5 DUP7 SUB SLT ISZERO PUSH2 0x3539 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP POP DUP2 MLOAD PUSH1 0x20 DUP4 ADD MLOAD PUSH1 0x40 SWAP1 SWAP4 ADD MLOAD SWAP1 SWAP5 SWAP3 SWAP4 POP SWAP2 SWAP1 POP JUMP JUMPDEST DUP6 DUP2 MSTORE DUP5 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0xA0 PUSH1 0x40 DUP3 ADD MSTORE PUSH1 0x0 PUSH2 0x3571 PUSH1 0xA0 DUP4 ADD DUP7 PUSH2 0x331F JUMP JUMPDEST PUSH1 0x60 DUP4 ADD SWAP5 SWAP1 SWAP5 MSTORE POP PUSH1 0x80 ADD MSTORE SWAP4 SWAP3 POP POP POP JUMP JUMPDEST DUP1 DUP3 MUL DUP2 ISZERO DUP3 DUP3 DIV DUP5 EQ OR PUSH2 0x9E0 JUMPI PUSH2 0x9E0 PUSH2 0x32F6 JUMP INVALID PUSH14 0x800AAAF64B9A1F321DCD63DA0436 SWAP14 CALLER 0xD8 LOG0 0xD4 SWAP11 0xD0 0xFB 0xBA ADDMOD GAS 0xAB BLOBBASEFEE SWAP9 0xBF BALANCE 0xC4 LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0xD5 SIGNEXTEND RETURNDATASIZE 0xEC 0x1E TSTORE 0x2D SAR EQ SMOD CALLER 0xDC 0xA7 0xD5 AND CODECOPY STOP 0xC1 0xFC DUP9 0x29 SELFBALANCE 0xB3 KECCAK256 DUP9 PUSH5 0x910C6F452D 0xE PUSH5 0x736F6C6343 STOP ADDMOD SHL STOP CALLER ", + "sourceMap": "2323:25016:55:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8745:372;;;;;;:::i;:::-;;:::i;:::-;;1153:28:56;;;;;-1:-1:-1;;;1153:28:56;;;;;;;;;;;;;:::i;:::-;;;;;;;;4116:539:55;;;;;;:::i;:::-;;:::i;1229:77:56:-;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;1229:77:56;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;11543:130:55:-;;;;;;:::i;:::-;;:::i;2648:56::-;;2698:6;2648:56;;10661:517;;;;;;:::i;:::-;;:::i;583:39:56:-;;;;;-1:-1:-1;;;;;583:39:56;;;;;;;;;;:::i;866:29::-;;;;;;;;;3933:25:70;;;3921:2;3906:18;866:29:56;3787:177:70;9922:304:55;;;;;;:::i;:::-;;:::i;4697:336::-;;;;;;:::i;:::-;;:::i;12603:105::-;12688:13;;-1:-1:-1;;;12688:13:55;;-1:-1:-1;;;;;12688:13:55;12603:105;;;;;;;:::i;779:27:56:-;;;;;-1:-1:-1;;;779:27:56;;-1:-1:-1;;;;;779:27:56;;;12255:149:55;;;;;;:::i;:::-;;:::i;705:25:56:-;;;;;-1:-1:-1;;;;;705:25:56;;;3155:101:38;;;:::i;11715:147:55:-;;;;;;:::i;:::-;;:::i;7343:1360::-;;;;;;:::i;:::-;;:::i;2441:144:38:-;;;:::i;1020:32:56:-;;;;;;;;;10268:351:55;;;;;;:::i;:::-;;:::i;12077:136::-;;;;;;:::i;:::-;;:::i;11904:131::-;;;;;;:::i;:::-;;:::i;9159:721::-;;;;;;:::i;:::-;;:::i;11220:114::-;;;;;;:::i;:::-;;:::i;12446:115::-;12536:18;;;;12446:115;;14115:153;;;;;;:::i;:::-;;:::i;:::-;;;7203:14:70;;7196:22;7178:41;;7166:2;7151:18;14115:153:55;7038:187:70;12750:310:55;;;;;;:::i;:::-;;:::i;5075:452::-;;;;;;:::i;:::-;;:::i;5569:1732::-;;;;;;:::i;:::-;;:::i;:::-;;;;;;;;:::i;13400:673::-;;;;;;:::i;:::-;;:::i;2768:50::-;;2814:4;2768:50;;13102:256;;;;;;:::i;:::-;;:::i;11376:125::-;;;;;;:::i;:::-;;:::i;3405:215:38:-;;;;;;:::i;:::-;;:::i;8745:372:55:-;2986:10;;-1:-1:-1;;;;;2986:10:55;2972;:24;2964:64;;;;-1:-1:-1;;;2964:64:55;;;;;;;;;;;;8882:9:::1;3231:27;3248:9;3231:16;:27::i;:::-;3289:9;3223:77;;;;;-1:-1:-1::0;;;3223:77:55::1;;;;;;3933:25:70::0;;3921:2;3906:18;;3787:177;3223:77:55::1;;;;;;;;;-1:-1:-1::0;3361:37:55::1;3331:19;::::0;;;:8:::1;:19;::::0;;;;:26:::1;;::::0;::::1;::::0;::::1;;;:67;::::0;::::1;;;;;;:::i;:::-;3444:19;::::0;;;:8:::1;:19;::::0;;;;:26:::1;;::::0;::::1;::::0;::::1;;;::::0;3331:67:::1;3310:171;;;;-1:-1:-1::0;;;3310:171:55::1;;;;;;;;:::i;:::-;-1:-1:-1::0;8933:19:55::2;::::0;;;:8:::2;:19;::::0;;;;26223:25;;;8933:19;;26223:39;8903:95:::2;;;;-1:-1:-1::0;;;8903:95:55::2;;;;;;3933:25:70::0;;3921:2;3906:18;;3787:177;8903:95:55::2;-1:-1:-1::0;9008:23:55::2;9034:19:::0;;;:8:::2;:19;::::0;;;;9063:47:::2;9043:9:::0;9034:19;9098:11;9063:14:::2;:47::i;:::-;8893:224;3038:1:::1;8745:372:::0;;:::o;4116:539::-;4158:30:39;4191:26;:24;:26::i;:::-;4302:15;;4158:59;;-1:-1:-1;4302:15:39;-1:-1:-1;;;4302:15:39;;;4301:16;;-1:-1:-1;;;;;4348:14:39;4279:19;4724:16;;:34;;;;;4744:14;4724:34;4704:54;;4768:17;4788:11;-1:-1:-1;;;;;4788:16:39;4803:1;4788:16;:50;;;;-1:-1:-1;4816:4:39;4808:25;:30;4788:50;4768:70;;4854:12;4853:13;:30;;;;;4871:12;4870:13;4853:30;4849:91;;;4906:23;;-1:-1:-1;;;4906:23:39;;;;;;;;;;;4849:91;4949:18;;-1:-1:-1;;;;;;4949:18:39;4966:1;4949:18;;;4977:67;;;;5011:22;;-1:-1:-1;;;;5011:22:39;-1:-1:-1;;;5011:22:39;;;4977:67;4366:21:55::1;4381:5;4366:14;:21::i;:::-;4397:27;:25;:27::i;:::-;4435;4450:11;4435:14;:27::i;:::-;4472:33;4490:14;4472:17;:33::i;:::-;4515:35;4534:15;4515:18;:35::i;:::-;4560:43;4583:19;4560:22;:43::i;:::-;4613:35;4632:15;4613:18;:35::i;:::-;5068:14:39::0;5064:101;;;5098:23;;-1:-1:-1;;;;5098:23:39;;;5140:14;;;;;;5098:23;;5140:14;:::i;:::-;;;;;;;;5064:101;4092:1079;;;;;4116:539:55;;;;;;:::o;11543:130::-;2334:13:38;:11;:13::i;:::-;11632:34:55::1;11651:14;11632:18;:34::i;:::-;11543:130:::0;:::o;10661:517::-;10735:9;3688:27;3705:9;3688:16;:27::i;:::-;3746:9;3680:77;;;;;-1:-1:-1;;;3680:77:55;;;;;;3933:25:70;;3921:2;3906:18;;3787:177;3680:77:55;-1:-1:-1;3789:19:55;;;;:8;:19;;;;;:29;;;-1:-1:-1;;;;;3789:29:55;3775:10;:43;3767:82;;;;-1:-1:-1;;;3767:82:55;;;;;;;;;;;;10765:9:::1;3231:27;3248:9;3231:16;:27::i;:::-;3289:9;3223:77;;;;;-1:-1:-1::0;;;3223:77:55::1;;;;;;3933:25:70::0;;3921:2;3906:18;;3787:177;3223:77:55::1;-1:-1:-1::0;3361:37:55::1;3331:19;::::0;;;:8:::1;:19;::::0;;;;:26:::1;;::::0;::::1;::::0;::::1;;;:67;::::0;::::1;;;;;;:::i;:::-;3444:19;::::0;;;:8:::1;:19;::::0;;;;:26:::1;;::::0;::::1;::::0;::::1;;;::::0;3331:67:::1;3310:171;;;;-1:-1:-1::0;;;3310:171:55::1;;;;;;;;:::i;:::-;-1:-1:-1::0;10786:23:55::2;10812:19:::0;;;:8:::2;:19;::::0;;;;10898:21:::2;::::0;::::2;::::0;10923:15:::2;-1:-1:-1::0;10898:40:55::2;10890:91;;;;-1:-1:-1::0;;;10890:91:55::2;;;;;;;;;;;;10991:34;11006:9;11017:7;10991:14;:34::i;:::-;26223:25:::0;;;;:39;11036:136:::2;;11100:24;::::0;::::2;::::0;11126:34:::2;::::0;;;:8:::2;:34;::::0;;;;11085:76:::2;::::0;11100:24;11085:14:::2;:76::i;9922:304::-:0;2986:10;;-1:-1:-1;;;;;2986:10:55;2972;:24;2964:64;;;;-1:-1:-1;;;2964:64:55;;;;;;;;;;;;10016:9:::1;3231:27;3248:9;3231:16;:27::i;:::-;3289:9;3223:77;;;;;-1:-1:-1::0;;;3223:77:55::1;;;;;;3933:25:70::0;;3921:2;3906:18;;3787:177;3223:77:55::1;-1:-1:-1::0;3361:37:55::1;3331:19;::::0;;;:8:::1;:19;::::0;;;;:26:::1;;::::0;::::1;::::0;::::1;;;:67;::::0;::::1;;;;;;:::i;:::-;3444:19;::::0;;;:8:::1;:19;::::0;;;;:26:::1;;::::0;::::1;::::0;::::1;;;::::0;3331:67:::1;3310:171;;;;-1:-1:-1::0;;;3310:171:55::1;;;;;;;;:::i;:::-;-1:-1:-1::0;10037:23:55::2;10063:19:::0;;;:8:::2;:19;::::0;;;;26223:25;;;;10063:19;;26223:39;10092:83:::2;;;;-1:-1:-1::0;;;10092:83:55::2;;;;;;3933:25:70::0;;3921:2;3906:18;;3787:177;10092:83:55::2;;10185:34;10200:9;10211:7;10185:14;:34::i;:::-;10027:199;3038:1:::1;9922:304:::0;:::o;4697:336::-;4790:7;4845:52;4870:10;4882:14;;4845:13;:11;:13::i;:::-;-1:-1:-1;;;;;4845:24:55;;:52;:24;:52::i;:::-;4943:83;4980:10;4992:14;;5008:12;5022:3;4943:36;:83::i;:::-;4936:90;;4697:336;;;;;:::o;12255:149::-;12348:7;12374:23;;;;;;;;12389:7;12374:23;:::i;:::-;:14;:23::i;3155:101:38:-;2334:13;:11;:13::i;:::-;3219:30:::1;3246:1;3219:18;:30::i;:::-;3155:101::o:0;11715:147:55:-;2334:13:38;:11;:13::i;:::-;11812:43:55::1;11835:19;11812:22;:43::i;7343:1360::-:0;2986:10;;7546:7;;-1:-1:-1;;;;;2986:10:55;2972;:24;2964:64;;;;-1:-1:-1;;;2964:64:55;;;;;;;;;;;;7625:40:::1;::::0;-1:-1:-1;;;;;;13407:2:70;13378:15;;;13374:45;7625:40:55::1;::::0;::::1;13362:58:70::0;-1:-1:-1;;;13436:12:70;;;13429:30;7595:17:55::1;::::0;13475:12:70;;7625:40:55::1;;;;;;;;;;;;7615:51;;;;;;7595:71;;7730:15;7748;:13;:15::i;:::-;-1:-1:-1::0;;;;;7748:29:55::1;;7778:12;7748:43;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;:51:::0;;-1:-1:-1;7870:12:55;-1:-1:-1;;;;;7817:21:55;::::1;7809:75;;;;-1:-1:-1::0;;;7809:75:55::1;;;;;;;;:::i;:::-;-1:-1:-1::0;7942:271:55::1;::::0;;::::1;::::0;::::1;::::0;;-1:-1:-1;;;;;7942:271:55;;::::1;::::0;;;::::1;;::::0;::::1;::::0;-1:-1:-1;7942:271:55;;;;;;;;;;;;;8037:25:::1;7942:271:::0;;;;8076:38:::1;7942:271:::0;;;;8128:15:::1;7942:271:::0;;;;;;8175:13:::1;::::0;7942:271;;;;8157:31:::1;::::0;-1:-1:-1;;;8175:13:55;::::1;-1:-1:-1::0;;;;;8175:13:55::1;::::0;8157:31:::1;:::i;:::-;7942:271:::0;;8202:1:::1;7942:271;::::0;;::::1;::::0;;;7920:19;;;:8:::1;:19:::0;;;;;;;:293;;;;-1:-1:-1;;;;;7920:293:55;;::::1;-1:-1:-1::0;;;;;;7920:293:55;;::::1;;::::0;;;;::::1;::::0;;;;::::1;::::0;;;;;::::1;::::0;;;::::1;;::::0;;;;::::1;::::0;::::1;::::0;::::1;::::0;::::1;::::0;::::1;::::0;::::1;::::0;;::::1;::::0;;;;::::1;::::0;::::1;::::0;::::1;::::0;::::1;::::0;;:19;;:293;;;;-1:-1:-1;;7920:293:55;;::::1;::::0;;;;;::::1;;;;;;:::i;:::-;;;::::0;;-1:-1:-1;7920:293:55::1;::::0;::::1;::::0;::::1;::::0;::::1;::::0;;-1:-1:-1;;7920:293:55::1;;::::0;::::1;::::0;::::1;;;;;;:::i;:::-;;;::::0;;-1:-1:-1;7920:293:55::1;::::0;::::1;::::0;::::1;::::0;::::1;::::0;::::1;::::0;::::1;::::0;::::1;::::0;::::1;::::0;::::1;::::0;;::::1;::::0;::::1;::::0;;::::1;::::0;-1:-1:-1;8289:21:55::1;:19;:21::i;:::-;8253:57;;8320:16;-1:-1:-1::0;;;;;8320:22:55::1;;8343:7;8363:11;8376:13;8352:38;;;;;;;;;:::i;:::-;;;;;;;;;;;;;8320:71;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;8434:50;8459:9;8470:13;8434;:11;:13::i;:::-;-1:-1:-1::0;;;;;8434:24:55::1;::::0;:50;:24:::1;:50::i;:::-;8500:93;::::0;;-1:-1:-1;;;;;16505:32:70;;;16487:51;;16569:2;16554:18;;16547:34;;;16597:18;;;16590:34;;;8500:93:55;;::::1;::::0;;::::1;::::0;8521:9;;8500:93:::1;::::0;16475:2:70;16460:18;8500:93:55::1;;;;;;;8644:9;-1:-1:-1::0;;;;;8608:61:55::1;8635:7;-1:-1:-1::0;;;;;8608:61:55::1;8624:9;-1:-1:-1::0;;;;;;;;;;;8655:13:55::1;8608:61;;;;3933:25:70::0;;3921:2;3906:18;;3787:177;8608:61:55::1;;;;;;;;-1:-1:-1::0;8687:9:55;;7343:1360;-1:-1:-1;;;;;;7343:1360:55:o;2441:144:38:-;2487:7;2506:24;2533:20;:18;:20::i;:::-;2570:8;-1:-1:-1;;;;;2570:8:38;;2441:144;-1:-1:-1;;2441:144:38:o;10268:351:55:-;2986:10;;-1:-1:-1;;;;;2986:10:55;2972;:24;2964:64;;;;-1:-1:-1;;;2964:64:55;;;;;;;;;;;;10360:9:::1;3231:27;3248:9;3231:16;:27::i;:::-;3289:9;3223:77;;;;;-1:-1:-1::0;;;3223:77:55::1;;;;;;3933:25:70::0;;3921:2;3906:18;;3787:177;3223:77:55::1;-1:-1:-1::0;3361:37:55::1;3331:19;::::0;;;:8:::1;:19;::::0;;;;:26:::1;;::::0;::::1;::::0;::::1;;;:67;::::0;::::1;;;;;;:::i;:::-;3444:19;::::0;;;:8:::1;:19;::::0;;;;:26:::1;;::::0;::::1;::::0;::::1;;;::::0;3331:67:::1;3310:171;;;;-1:-1:-1::0;;;3310:171:55::1;;;;;;;;:::i;:::-;-1:-1:-1::0;10381:23:55::2;10407:19:::0;;;:8:::2;:19;::::0;;;;10436:32:::2;10416:9:::0;10407:19;10436:12:::2;:32::i;:::-;26223:25:::0;;;;:39;10479:134:::2;;10541:24;::::0;::::2;::::0;10567:34:::2;::::0;;;:8:::2;:34;::::0;;;;10528:74:::2;::::0;10541:24;10528:12:::2;:74::i;12077:136::-:0;2334:13:38;:11;:13::i;:::-;12169:37:55::1;12189:16;12169:19;:37::i;11904:131::-:0;2334:13:38;:11;:13::i;:::-;11993:35:55::1;12012:15;11993:18;:35::i;9159:721::-:0;2986:10;;-1:-1:-1;;;;;2986:10:55;2972;:24;2964:64;;;;-1:-1:-1;;;2964:64:55;;;;;;;;;;;;9378:9:::1;3231:27;3248:9;3231:16;:27::i;:::-;3289:9;3223:77;;;;;-1:-1:-1::0;;;3223:77:55::1;;;;;;3933:25:70::0;;3921:2;3906:18;;3787:177;3223:77:55::1;-1:-1:-1::0;3361:37:55::1;3331:19;::::0;;;:8:::1;:19;::::0;;;;:26:::1;;::::0;::::1;::::0;::::1;;;:67;::::0;::::1;;;;;;:::i;:::-;3444:19;::::0;;;:8:::1;:19;::::0;;;;:26:::1;;::::0;::::1;::::0;::::1;;;::::0;3331:67:::1;3310:171;;;;-1:-1:-1::0;;;3310:171:55::1;;;;;;;;:::i;:::-;-1:-1:-1::0;9428:19:55::2;::::0;;;:8:::2;:19;::::0;;;;26223:25;;;:39;;9485:9:::2;9399:97;;;;;-1:-1:-1::0;;;;;;9399:97:55::2;;;;;;3933:25:70::0;;3921:2;3906:18;;3787:177;9399:97:55::2;-1:-1:-1::0;9506:23:55::2;9532:19:::0;;;:8:::2;:19;::::0;;;;9561:47:::2;9541:9:::0;9532:19;9596:11;9561:14:::2;:47::i;:::-;9623:23;9619:255;;;9677:24;::::0;::::2;::::0;9703:34:::2;::::0;;;:8:::2;:34;::::0;;;;9662:96:::2;::::0;9677:24;9739:18;9662:14:::2;:96::i;:::-;9619:255;;;9802:24;::::0;::::2;::::0;9828:34:::2;::::0;;;:8:::2;:34;::::0;;;;9789:74:::2;::::0;9802:24;9789:12:::2;:74::i;:::-;9389:491;3038:1:::1;9159:721:::0;;;;:::o;11220:114::-;2334:13:38;:11;:13::i;:::-;11301:26:55::1;11316:10;11301:14;:26::i;14115:153::-:0;14190:4;;14213:19;;;;:8;:19;;;;;:26;;;;;;;;:48;;;;;;;;:::i;:::-;;;;14115:153;-1:-1:-1;;14115:153:55:o;12750:310::-;12825:7;12844:42;12889:15;:13;:15::i;:::-;-1:-1:-1;;;;;12889:28:55;;12931:7;12960:21;:19;:21::i;:::-;12889:103;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;12844:148;;13009:44;13027:7;13036:9;:16;;;13009:17;:44::i;:::-;13002:51;12750:310;-1:-1:-1;;;12750:310:55:o;5075:452::-;5162:7;5217:52;5242:10;5254:14;;5217:13;:11;:13::i;:52::-;5327:193;5379:10;5407:14;;5439:34;5457:15;;5439:34;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;5439:17:55;;-1:-1:-1;;;5439:34:55:i;:::-;5491:15;;5327:193;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;5327:34:55;;-1:-1:-1;;;5327:193:55:i;5569:1732::-;5720:7;5729;5748:17;5768:10;5748:30;;5823:37;5863:35;5881:16;;5863:35;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;5863:17:55;;-1:-1:-1;;;5863:35:55:i;:::-;5823:75;;5908:37;5948:35;5966:16;;5948:35;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;5948:17:55;;-1:-1:-1;;;5948:35:55:i;:::-;5908:75;;6065:54;6092:12;6106;6065:26;:54::i;:::-;6191:23;;6232:24;;;;;6274:33;;;;;6325:23;;6366:24;;;;6408:33;;;;6191:23;;6232:24;;6274:33;;6325:23;6044:421;;;;-1:-1:-1;;;6044:421:55;;;;;18750:25:70;;;;18791:18;;;18784:34;;;;18834:18;;;18827:34;;;;18877:18;;;18870:34;18920:19;;;18913:35;18964:19;;;18957:35;18722:19;;6044:421:55;18463:535:70;6044:421:55;;;;;;;6512:52;6537:10;6549:14;;6512:13;:11;:13::i;:52::-;6666:12;6681:155;6729:9;6769:1;6752:14;;:18;;;;:::i;:::-;6784:12;6810:16;;6681:155;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;6681:34:55;;-1:-1:-1;;;6681:155:55:i;:::-;6666:170;;6846:12;6861:155;6909:9;6949:1;6932:14;;:18;;;;:::i;:::-;6964:12;6990:16;;6861:155;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;6861:34:55;;-1:-1:-1;;;6861:155:55:i;:::-;7079:14;;;;:8;:14;;;;;;:31;;;;:38;;;7127:14;;;;;;:31;:38;;;7239:25;6846:170;;-1:-1:-1;6846:170:55;;7088:4;;7239:25;;;7283:4;;;;-1:-1:-1;5569:1732:55;-1:-1:-1;;;;;;;;5569:1732:55:o;13400:673::-;13490:7;13581:20;13604:27;13619:11;13604:14;:27::i;:::-;13581:50;;13642:29;13674:21;:19;:21::i;:::-;-1:-1:-1;;;;;13674:35:55;;13710:12;13674:49;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;13741:13;;13642:81;;-1:-1:-1;13800:12:55;;-1:-1:-1;;;;;13741:27:55;13733:81;;;;-1:-1:-1;;;13733:81:55;;;;;;;;:::i;:::-;-1:-1:-1;13875:32:55;;;;13845:26;;;;;:62;;;13824:212;;;;-1:-1:-1;;;13824:212:55;;;;;;;;;:::i;:::-;-1:-1:-1;;14053:13:55;;13400:673;-1:-1:-1;;;13400:673:55:o;13102:256::-;13274:4;13297:54;;;;;;;;13324:12;13297:54;:::i;:::-;;;;;;;;13338:12;13297:54;:::i;:::-;:26;:54::i;11376:125::-;2334:13:38;:11;:13::i;:::-;11462:32:55::1;11480:13;11462:17;:32::i;3405:215:38:-:0;2334:13;:11;:13::i;:::-;-1:-1:-1;;;;;3489:22:38;::::1;3485:91;;3562:1;3534:31;;-1:-1:-1::0;;;3534:31:38::1;;;;;;;;:::i;3485:91::-;3585:28;3604:8;3585:18;:28::i;18915:486:55:-:0;19066:16;;19100:22;;;;19027;;19052:71;;-1:-1:-1;;;;;19066:16:55;;;;19084:14;;19052:13;:71::i;:::-;19133:15;;;:56;;-1:-1:-1;;19133:56:55;;;;;-1:-1:-1;19224:18:55;;;19261:16;;;;19027:96;;-1:-1:-1;19199:79:55;;-1:-1:-1;;;;;19224:18:55;;;;19244:33;;19027:96;19244:33;:::i;:::-;19199:13;:11;:13::i;:79::-;19340:18;;;;19322:16;;19360;;;;-1:-1:-1;;;;;19340:18:55;;;;19322:16;;;;19310:10;;-1:-1:-1;;;;;;;;;;;19294:100:55;19360:33;;19379:14;;19360:33;:::i;:::-;19294:100;;3933:25:70;;;3921:2;3906:18;19294:100:55;;;;;;;19017:384;18915:486;;;:::o;9071:205:39:-;9129:30;;3147:66;9186:27;8819:122;1847:127:38;6929:20:39;:18;:20::i;:::-;1929:38:38::1;1954:12;1929:24;:38::i;1739:117:67:-:0;6929:20:39;:18;:20::i;:::-;1812:37:67::1;:35;:37::i;22959:215:55:-:0;-1:-1:-1;;;;;23030:25:55;;23022:70;;;;-1:-1:-1;;;23022:70:55;;;;;;;;;;;;23102:10;:24;;-1:-1:-1;;;;;;23102:24:55;-1:-1:-1;;;;;23102:24:55;;;;;;;;23141:26;;;;-1:-1:-1;;23141:26:55;22959:215;:::o;23359:225::-;23435:14;-1:-1:-1;;;;;23435:19:55;23453:1;23435:19;23427:63;;;;-1:-1:-1;;;23427:63:55;;;;;;;;;;;;23500:13;:30;;-1:-1:-1;;;;;;;;23500:30:55;-1:-1:-1;;;;;;;;23500:30:55;;;;;;23545:32;;;;;;23500:30;;23545:32;:::i;:::-;;;;;;;;23359:225;:::o;23814:270::-;23893:15;2814:4;23893:38;;;23885:101;;;;-1:-1:-1;;;23885:101:55;;;;;;3933:25:70;;3921:2;3906:18;;3787:177;23885:101:55;-1:-1:-1;23996:14:55;:32;;;24043:34;;3933:25:70;;;24043:34:55;;3921:2:70;3906:18;24043:34:55;3787:177:70;24312:341:55;24411:19;2698:6;24411:47;;;;;24390:149;;;;-1:-1:-1;;;24390:149:55;;;;;;;;:::i;:::-;-1:-1:-1;24549:18:55;:40;;-1:-1:-1;;24549:40:55;;;;;;;24604:42;;;;;;24549:40;;24604:42;:::i;24805:265::-;24883:35;;;;452:9:35;-1:-1:-1;2073:16:35;24875:98:55;;;;-1:-1:-1;;;24875:98:55;;;;;;;;:::i;:::-;-1:-1:-1;24983:14:55;:32;;-1:-1:-1;;;;24983:32:55;-1:-1:-1;;;24983:32:55;;;;;;;;;;;;;;25030:33;;;;;;25048:14;;;;;;;25030:33;:::i;2658:162:38:-;966:10:40;2717:7:38;:5;:7::i;:::-;-1:-1:-1;;;;;2717:23:38;;2713:101;;966:10:40;2763:40:38;;-1:-1:-1;;;2763:40:38;;;;;;;;:::i;20423:324:55:-;20511:15;;;:57;;-1:-1:-1;;20511:57:55;;;;;-1:-1:-1;20603:18:55;;;20623:16;;;;20578:62;;-1:-1:-1;;;;;20603:18:55;;20578:13;:11;:13::i;:62::-;20703:18;;;;20685:16;;20723;;;;20656:84;;3933:25:70;;;-1:-1:-1;;;;;20703:18:55;;;;20685:16;;;;20673:10;;20656:84;;3921:2:70;3906:18;20656:84:55;;;;;;;;20423:324;;:::o;19537:302::-;19625:15;;;:56;;-1:-1:-1;;19625:56:55;;;;;19643:38;19716:16;;;19691:42;;:13;:11;:13::i;:::-;-1:-1:-1;;;;;19691:24:55;;;:42::i;:::-;19795:18;;;;19777:16;;19815;;;;19749:83;;3933:25:70;;;-1:-1:-1;;;;;19795:18:55;;;;19777:16;;;;19765:10;;19749:83;;3921:2:70;3906:18;19749:83:55;3787:177:70;5825:94:37;5901:11;;5825:94::o;598:221:11:-;698:11;;694:119;;733:55;;-1:-1:-1;;;733:55:11;;-1:-1:-1;;;;;19702:32:70;;;733:55:11;;;19684:51:70;773:4:11;19751:18:70;;;19744:60;19820:18;;;19813:34;;;733:24:11;;;;;19657:18:70;;733:55:11;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;725:77;;;;-1:-1:-1;;;725:77:11;;20310:2:70;725:77:11;;;20292:21:70;20349:1;20329:18;;;20322:29;-1:-1:-1;;;20367:18:70;;;20360:39;20416:18;;725:77:11;20108:332:70;16970:1750:55;17225:37;;-1:-1:-1;;;;;;20647:2:70;20618:15;;;20614:45;17225:37:55;;;20602:58:70;20676:12;;;20669:28;;;17146:7:55;;;;20713:12:70;;17225:37:55;;;;;;;;;;;;17215:48;;;;;;17195:68;;17341:27;17358:9;17341:16;:27::i;:::-;17340:28;17406:9;17332:85;;;;;-1:-1:-1;;;17332:85:55;;;;;;3933:25:70;;3921:2;3906:18;;3787:177;17332:85:55;;17461:33;17497:21;:19;:21::i;:::-;17461:57;;17528:29;17560:16;-1:-1:-1;;;;;17560:30:55;;17591:13;17560:45;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;17633:13;;17528:77;;-1:-1:-1;17717:13:55;-1:-1:-1;;;;;17664:21:55;;17656:76;;;;-1:-1:-1;;;17656:76:55;;;;;;;;:::i;:::-;;17785:42;17830:15;:13;:15::i;:::-;-1:-1:-1;;;;;17830:28:55;;17859:7;17876:16;17830:64;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;17912:16;;17785:109;;-1:-1:-1;17912:16:55;:21;17904:58;;;;-1:-1:-1;;;17904:58:55;;;;;;;;;;;;17998:21;18022:44;18040:7;18049:9;:16;;;18022:17;:44::i;:::-;18118:13;;17998:68;;-1:-1:-1;18076:21:55;;18100:31;;-1:-1:-1;;;18118:13:55;;-1:-1:-1;;;;;18118:13:55;18100:15;:31;:::i;:::-;18163:280;;;;;;;;18184:13;;-1:-1:-1;;;;;18163:280:55;;;;;;;;;;;;;;;;;-1:-1:-1;18163:280:55;;;;18076:55;;-1:-1:-1;18163:280:55;;;18272:27;18163:280;;;;18313:37;18163:280;;18364:15;18163:280;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;18141:19:55;;;:8;:19;;;;;:302;;;;-1:-1:-1;;;;;18141:302:55;;;-1:-1:-1;;;;;;18141:302:55;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;18141:302:55;;;;;;;;;;;;;:::i;:::-;;;;;-1:-1:-1;18141:302:55;;;;;;;;;-1:-1:-1;;18141:302:55;;;;;;;;;;;:::i;:::-;;;;;-1:-1:-1;18141:302:55;;;;;;;;;;;;;;;;;;;;;;;;;;18518:13;;18459:227;;;20995:25:70;;;-1:-1:-1;;;;;21056:32:70;;;21051:2;21036:18;;21029:60;21105:18;;;21098:34;;;21163:2;21148:18;;21141:34;;;21206:3;21191:19;;21184:35;;;18459:227:55;;;;;;;;18495:9;;18459:227;;20982:3:70;20967:19;18459:227:55;;;;;;;-1:-1:-1;18704:9:55;;16970:1750;-1:-1:-1;;;;;;;;;;16970:1750:55:o;3653:669:67:-;3737:7;3915:16;4075:19;;4124:20;;;;;4174:29;;;;;3988:241;;925:89;3988:241;;;21461:25:70;21502:18;;;21495:34;;;;21545:18;;;21538:34;;;;21588:18;;;;21581:34;;;;3988:241:67;;;;;;;;;;21433:19:70;;;3988:241:67;;3953:330;;;;;;-1:-1:-1;;;3802:499:67;;;21884:27:70;21927:11;;;21920:27;;;;21963:12;;;;21956:28;;;;3802:499:67;;;;;;;;;;22000:12:70;;;;3802:499:67;;;3775:540;;;;;;3653:669::o;3774:248:38:-;3847:24;3874:20;:18;:20::i;:::-;3923:8;;-1:-1:-1;;;;;3941:19:38;;;-1:-1:-1;;;;;;3941:19:38;;;;;;3975:40;;3847:47;;-1:-1:-1;3923:8:38;;;;;3975:40;;3904:16;;3975:40;3837:185;;3774:248;:::o;6033:102:37:-;6115:13;;6033:102::o;25727:206:55:-;25824:15;;25780:16;;-1:-1:-1;;;;;25824:15:55;25808:86;;;;-1:-1:-1;;;25808:86:55;;;;;;;;;;;;-1:-1:-1;25911:15:55;;-1:-1:-1;;;;;25911:15:55;;25727:206::o;1050:198:11:-;1148:11;;1144:98;;1183:34;;-1:-1:-1;;;1183:34:11;;-1:-1:-1;;;;;22215:32:70;;;1183:34:11;;;22197:51:70;22264:18;;;22257:34;;;1183:20:11;;;;;22170:18:70;;1183:34:11;22023:274:70;1192:159:38;1313:22;;1192:159::o;19973:314:55:-;20059:15;;;:53;;-1:-1:-1;;20059:53:55;;;;;-1:-1:-1;20147:18:55;;;20167:16;;;;20122:62;;-1:-1:-1;;;;;20147:18:55;;20122:13;:11;:13::i;:62::-;20243:18;;;;20225:16;;20263;;;;20200:80;;3933:25:70;;;-1:-1:-1;;;;;20243:18:55;;;;20225:16;;;;20213:10;;20200:80;;3921:2:70;3906:18;20200:80:55;3787:177:70;25279:268:55;-1:-1:-1;;;;;25360:30:55;;25352:75;;;;-1:-1:-1;;;25352:75:55;;;;;;;;;;;;25437:15;:52;;-1:-1:-1;;;;;;25437:52:55;-1:-1:-1;;;;;25437:52:55;;;;;;;;25504:36;;;;-1:-1:-1;;25504:36:55;25279:268;:::o;27065:272::-;27155:7;27174:23;27200:15;:13;:15::i;:::-;-1:-1:-1;;;;;27200:33:55;;27234:8;27252:21;:19;:21::i;:::-;27200:75;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;:82;;-1:-1:-1;27299:31:55;27200:82;27299:13;:31;:::i;:::-;27292:38;27065:272;-1:-1:-1;;;;27065:272:55:o;3718:820:62:-;-1:-1:-1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1695:1:62;2204:27;1587:2;;2204:27;:::i;:::-;:42;;;;:::i;:::-;2347:35;;1371:2;2347:35;:::i;:::-;3862:12;;:38;;;;1695:1;2204:27;1587:2;;2204:27;:::i;:::-;:42;;;;:::i;:::-;2347:35;;1371:2;2347:35;:::i;:::-;3841:150;;;;;;-1:-1:-1;;;3841:150:62;;;;;;;;;:::i;:::-;;;4029:18;4049:19;4070:28;4126:5;4102:80;;;;;;;;;;;;:::i;:::-;4028:154;;;;;;4307:9;4319:31;4330:5;1371:2;4319:10;:31::i;:::-;4307:43;-1:-1:-1;4360:9:62;4372:31;4383:5;1926:33;1479:2;1371;1926:33;:::i;:::-;4372:10;:31::i;:::-;4360:43;-1:-1:-1;4413:7:62;4423:29;4432:5;1587:2;2065:33;1587:2;1371;2065:33;:::i;:::-;:48;;;;:::i;:::-;4423:8;:29::i;:::-;4470:61;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;4470:61:62;;;;;;;3718:820;-1:-1:-1;;3718:820:62:o;14814:1838:55:-;15021:7;15095:15;15113:35;15135:12;15113:21;:35::i;:::-;15095:53;;15196:42;15241:15;:13;:15::i;:::-;-1:-1:-1;;;;;15241:28:55;;15283:7;15312:21;:19;:21::i;:::-;15241:103;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;15362:16;;15196:148;;-1:-1:-1;15362:16:55;:21;15354:58;;;;-1:-1:-1;;;15354:58:55;;;;;;;;;;;;15530:23;;15571:24;;;;;15613:33;;;;;15496:217;;;;;24114:19:70;;;;24149:12;;24142:28;24186:12;;;;24179:28;;;;-1:-1:-1;;;;;;24241:15:70;;;24237:45;;24223:12;;;24216:67;24318:15;;;;24314:45;;;24299:13;;;24292:68;15453:17:55;;24376:13:70;;15496:217:55;;;;;;;;;;;;15473:250;;;;;;15453:270;;15781:27;15798:9;15781:16;:27::i;:::-;15780:28;15846:9;15772:85;;;;;-1:-1:-1;;;15772:85:55;;;;;;3933:25:70;;3921:2;3906:18;;3787:177;15772:85:55;;15893:21;15917:44;15935:7;15944:9;:16;;;15917:17;:44::i;:::-;16013:13;;15893:68;;-1:-1:-1;15971:21:55;;15995:31;;-1:-1:-1;;;16013:13:55;;-1:-1:-1;;;;;16013:13:55;15995:15;:31;:::i;:::-;16058:294;;;;;;;;-1:-1:-1;;;;;16058:294:55;;;;;;;;;;;;;;;;;-1:-1:-1;16058:294:55;;;;15971:55;;-1:-1:-1;16058:294:55;;;16184:24;16058:294;;;;16222:37;16058:294;;16273:15;16058:294;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;16036:19:55;;;:8;:19;;;;;:316;;;;-1:-1:-1;;;;;16036:316:55;;;-1:-1:-1;;;;;;16036:316:55;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;16036:316:55;;;;;;;;;;;;;:::i;:::-;;;;;-1:-1:-1;16036:316:55;;;;;;;;;-1:-1:-1;;16036:316:55;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;16445:10;-1:-1:-1;;;;;16368:250:55;16424:7;-1:-1:-1;;;;;16368:250:55;16401:9;16368:250;16469:8;16491:12;:33;;;16538:16;16568:13;16595;16368:250;;;;;;;;;;:::i;:::-;;;;;;;;-1:-1:-1;16636:9:55;;14814:1838;-1:-1:-1;;;;;;;;14814:1838:55:o;3164:391:62:-;3365:24;;3337;;3313:4;;3337:52;:140;;;;;3443:13;:34;;;3405:13;:34;;;:72;3337:140;:210;;;;-1:-1:-1;;3522:25:62;;;;;3493;;;:54;;;3164:391::o;2512:700:67:-;2732:151;;;;;;;;2765:23;;2732:151;;;2802:24;;;;2732:151;;;;2840:33;;;;2732:151;;;;;;;2598:7;;;2915:23;2732:151;2915:14;:23::i;:::-;2893:45;;3113:92;3127:11;3157:12;:14;;;3173:12;:14;;;3189:12;:14;;;3140:64;;;;;;;;;25090:19:70;;;25134:2;25125:12;;25118:28;;;;25202:3;25180:16;-1:-1:-1;;;;;;25176:36:70;25171:2;25162:12;;25155:58;25238:2;25229:12;;24909:338;3140:64:67;;;;;;;;;;;;;3113:13;:92::i;21229:1539:55:-;21369:7;21388:33;21424:21;:19;:21::i;:::-;21388:57;;21500:42;21545:15;:13;:15::i;:::-;-1:-1:-1;;;;;21545:28:55;;21574:8;21592:16;21545:65;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;21723:14;;21500:110;;-1:-1:-1;21670:22:55;;21695:43;;:20;;21723:14;-1:-1:-1;;;21723:14:55;;;;;;21695:27;:43;:::i;:::-;21670:68;-1:-1:-1;21769:17:55;;;;;:51;;;21806:14;21790:12;:30;;21769:51;21867:12;21881:14;21748:158;;;;;;-1:-1:-1;;;21748:158:55;;;;;;;;;:::i;:::-;;;22406:27;22436:45;22450:12;22464:9;:16;;;22436:13;:45::i;:::-;22528:24;;;;22554:18;;22406:75;;-1:-1:-1;22491:20:55;;22514:59;;;;;;;22554:18;22514:13;:59::i;:::-;22491:82;-1:-1:-1;22583:21:55;22607:40;22491:82;22627:19;22607;:40::i;:::-;22583:64;;22658:16;-1:-1:-1;;;;;22658:22:55;;22681:8;22702:12;22716:13;22691:39;;;;;;;;;:::i;:::-;;;;;;;;;;;;;22658:73;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;22748:13:55;;21229:1539;-1:-1:-1;;;;;;;;;;;;21229:1539:55:o;7082:141:39:-;7149:17;:15;:17::i;:::-;7144:73;;7189:17;;-1:-1:-1;;;7189:17:39;;;;;;;;;;;1980:235:38;6929:20:39;:18;:20::i;1986:362:67:-;6929:20:39;:18;:20::i;:::-;2111:220:67::1;::::0;;1113:108:::1;2111:220;::::0;::::1;25539:25:70::0;1307:27:67::1;25580:18:70::0;;;25573:34;;;;1426:14:67::1;25623:18:70::0;;;25616:34;2244:13:67::1;25666:18:70::0;;;25659:34;2283:4:67::1;25709:19:70::0;;;25702:61;1521:66:67::1;25779:19:70::0;;;25772:35;25511:19;;2111:220:67::1;::::0;;-1:-1:-1;;2111:220:67;;::::1;::::0;;;;;;2088:253;;2111:220:::1;2088:253:::0;;::::1;::::0;2069:16:::1;:272:::0;1986:362::o;1404:154:11:-;1489:11;;1485:67;;1516:25;;-1:-1:-1;;;1516:25:11;;;;;3933::70;;;-1:-1:-1;;;;;1516:16:11;;;;;3906:18:70;;1516:25:11;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1485:67;1404:154;;:::o;5602:478:62:-;5681:7;5738:28;2583:2;5738:6;:28;:::i;:::-;5721:13;;:45;;;;;5825:28;2583:2;5825:6;:28;:::i;:::-;5700:164;;;;;;-1:-1:-1;;;5700:164:62;;;;;;;;;:::i;:::-;-1:-1:-1;;;6004:30:62;6020:4;6004:30;5998:37;;5602:478::o;4734:668::-;4811:5;4866:26;2480:1;4866:6;:26;:::i;:::-;4849:13;;:43;;;;;4951:26;2480:1;4951:6;:26;:::i;:::-;4828:160;;;;;;-1:-1:-1;;;4828:160:62;;;;;;;;;:::i;:::-;-1:-1:-1;;;5330:29:62;5346:3;5330:29;5324:36;;4734:668::o;3714:255:50:-;3792:7;3812:17;3831:18;3851:16;3871:27;3882:4;3888:9;3871:10;:27::i;:::-;3811:87;;;;;;3908:28;3920:5;3927:8;3908:11;:28::i;:::-;-1:-1:-1;3953:9:50;;3714:255;-1:-1:-1;;;;3714:255:50:o;1099:188:35:-;1160:7;1187:13;1198:1;452:9;-1:-1:-1;2073:16:35;;1992:104;1187:13;:30;;;;1204:13;1215:1;452:9;-1:-1:-1;2073:16:35;;1992:104;1204:13;1240:1;1243;1179:67;;;;;;-1:-1:-1;;;1179:67:35;;;;;;;;;:::i;:::-;-1:-1:-1;452:9:35;;-1:-1:-1;1264:5:35;1268:1;1264;:5;:::i;:::-;1263:17;;;;:::i;1325:105:34:-;1383:7;1414:1;1409;:6;;:14;;1422:1;1409:14;;;-1:-1:-1;1418:1:34;;1325:105;-1:-1:-1;1325:105:34:o;8485:120:39:-;8535:4;8558:26;:24;:26::i;:::-;:40;-1:-1:-1;;;8558:40:39;;;;;;-1:-1:-1;8485:120:39:o;2129:778:50:-;2232:17;2251:16;2269:14;2299:9;:16;2319:2;2299:22;2295:606;;2604:4;2589:20;;2583:27;2653:4;2638:20;;2632:27;2710:4;2695:20;;2689:27;2337:9;2681:36;2751:25;2762:4;2681:36;2583:27;2632;2751:10;:25::i;:::-;2744:32;;;;;;;;;;;2295:606;-1:-1:-1;;2872:16:50;;2823:1;;-1:-1:-1;2827:35:50;;2295:606;2129:778;;;;;:::o;7280:532::-;7375:20;7366:5;:29;;;;;;;;:::i;:::-;;7362:444;;7280:532;;:::o;7362:444::-;7471:29;7462:5;:38;;;;;;;;:::i;:::-;;7458:348;;7523:23;;-1:-1:-1;;;7523:23:50;;;;;;;;;;;7458:348;7576:35;7567:5;:44;;;;;;;;:::i;:::-;;7563:243;;7634:46;;-1:-1:-1;;;7634:46:50;;;;;3933:25:70;;;3906:18;;7634:46:50;3787:177:70;7563:243:50;7710:30;7701:5;:39;;;;;;;;:::i;:::-;;7697:109;;7763:32;;-1:-1:-1;;;7763:32:50;;;;;3933:25:70;;;3906:18;;7763:32:50;3787:177:70;5203:1551:50;5329:17;;;-1:-1:-1;;;;;6270:79:50;;6266:164;;;-1:-1:-1;6381:1:50;;-1:-1:-1;6385:30:50;;-1:-1:-1;6417:1:50;6365:54;;6266:164;6541:24;;;6524:14;6541:24;;;;;;;;;26218:25:70;;;26291:4;26279:17;;26259:18;;;26252:45;;;;26313:18;;;26306:34;;;26356:18;;;26349:34;;;6541:24:50;;26190:19:70;;6541:24:50;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;6541:24:50;;-1:-1:-1;;6541:24:50;;;-1:-1:-1;;;;;;;6579:20:50;;6575:113;;-1:-1:-1;6631:1:50;;-1:-1:-1;6635:29:50;;-1:-1:-1;6631:1:50;;-1:-1:-1;6615:62:50;;6575:113;6706:6;-1:-1:-1;6714:20:50;;-1:-1:-1;6714:20:50;;-1:-1:-1;5203:1551:50;;;;;;;;;:::o;14:346:70:-;82:6;90;143:2;131:9;122:7;118:23;114:32;111:52;;;159:1;156;149:12;111:52;-1:-1:-1;;204:23:70;;;324:2;309:18;;;296:32;;-1:-1:-1;14:346:70:o;365:192::-;539:10;527:23;;;;509:42;;497:2;482:18;;365:192::o;562:131::-;-1:-1:-1;;;;;637:31:70;;627:42;;617:70;;683:1;680;673:12;698:129;-1:-1:-1;;;;;772:30:70;;762:41;;752:69;;817:1;814;807:12;832:121;917:10;910:5;906:22;899:5;896:33;886:61;;943:1;940;933:12;958:928;1059:6;1067;1075;1083;1091;1099;1152:3;1140:9;1131:7;1127:23;1123:33;1120:53;;;1169:1;1166;1159:12;1120:53;1208:9;1195:23;1227:31;1252:5;1227:31;:::i;:::-;1277:5;-1:-1:-1;1334:2:70;1319:18;;1306:32;1347:33;1306:32;1347:33;:::i;:::-;1399:7;-1:-1:-1;1458:2:70;1443:18;;1430:32;1471;1430;1471;:::i;:::-;1522:7;-1:-1:-1;1602:2:70;1587:18;;1574:32;;-1:-1:-1;1684:3:70;1669:19;;1656:33;1698:32;1656:33;1698:32;:::i;:::-;1749:7;-1:-1:-1;1808:3:70;1793:19;;1780:33;1822:32;1780:33;1822:32;:::i;:::-;1873:7;1863:17;;;958:928;;;;;;;;:::o;1891:226::-;1950:6;2003:2;1991:9;1982:7;1978:23;1974:32;1971:52;;;2019:1;2016;2009:12;1971:52;-1:-1:-1;2064:23:70;;1891:226;-1:-1:-1;1891:226:70:o;2122:127::-;2183:10;2178:3;2174:20;2171:1;2164:31;2214:4;2211:1;2204:15;2238:4;2235:1;2228:15;2254:144;2339:1;2332:5;2329:12;2319:46;;2345:18;;:::i;:::-;2374;;2254:144::o;2403:914::-;-1:-1:-1;;;;;2824:32:70;;;2806:51;;2893:32;;2888:2;2873:18;;2866:60;2957:2;2942:18;;2935:34;;;3000:2;2985:18;;2978:34;;;2793:3;2778:19;;3042:1;3031:13;;3021:47;;3048:18;;:::i;:::-;3105:6;3099:3;3088:9;3084:19;3077:35;3121:58;3174:3;3163:9;3159:19;3151:6;3121:58;:::i;:::-;3216:6;3210:3;3199:9;3195:19;3188:35;3260:6;3254:3;3243:9;3239:19;3232:35;3304:6;3298:3;3287:9;3283:19;3276:35;2403:914;;;;;;;;;;;;:::o;3553:229::-;-1:-1:-1;;;;;3743:32:70;;;;3725:51;;3713:2;3698:18;;3553:229::o;3969:367::-;4037:6;4045;4098:2;4086:9;4077:7;4073:23;4069:32;4066:52;;;4114:1;4111;4104:12;4066:52;4153:9;4140:23;4172:31;4197:5;4172:31;:::i;:::-;4222:5;4300:2;4285:18;;;;4272:32;;-1:-1:-1;;;3969:367:70:o;4523:200::-;-1:-1:-1;;;;;4685:31:70;;;;4667:50;;4655:2;4640:18;;4523:200::o;4728:231::-;4815:6;4875:2;4863:9;4854:7;4850:23;4846:32;4890:2;4887:22;;;4905:1;4902;4895:12;4887:22;-1:-1:-1;4944:9:70;;4728:231;-1:-1:-1;;4728:231:70:o;5172:245::-;5230:6;5283:2;5271:9;5262:7;5258:23;5254:32;5251:52;;;5299:1;5296;5289:12;5251:52;5338:9;5325:23;5357:30;5381:5;5357:30;:::i;5422:629::-;5508:6;5516;5524;5532;5585:3;5573:9;5564:7;5560:23;5556:33;5553:53;;;5602:1;5599;5592:12;5553:53;5641:9;5628:23;5660:31;5685:5;5660:31;:::i;:::-;5710:5;-1:-1:-1;5767:2:70;5752:18;;5739:32;5780:33;5739:32;5780:33;:::i;:::-;5422:629;;5832:7;;-1:-1:-1;;;;5912:2:70;5897:18;;5884:32;;6015:2;6000:18;5987:32;;5422:629::o;6056:247::-;6115:6;6168:2;6156:9;6147:7;6143:23;6139:32;6136:52;;;6184:1;6181;6174:12;6136:52;6223:9;6210:23;6242:31;6267:5;6242:31;:::i;6308:118::-;6394:5;6387:13;6380:21;6373:5;6370:32;6360:60;;6416:1;6413;6406:12;6431:602;6514:6;6522;6530;6538;6591:3;6579:9;6570:7;6566:23;6562:33;6559:53;;;6608:1;6605;6598:12;6559:53;6653:23;;;-1:-1:-1;6773:2:70;6758:18;;6745:32;;-1:-1:-1;6855:2:70;6840:18;;6827:32;6868:30;6827:32;6868:30;:::i;:::-;6431:602;;;;-1:-1:-1;6917:7:70;;6997:2;6982:18;6969:32;;-1:-1:-1;;6431:602:70:o;7230:347::-;7281:8;7291:6;7345:3;7338:4;7330:6;7326:17;7322:27;7312:55;;7363:1;7360;7353:12;7312:55;-1:-1:-1;7386:20:70;;-1:-1:-1;;;;;7418:30:70;;7415:50;;;7461:1;7458;7451:12;7415:50;7498:4;7490:6;7486:17;7474:29;;7550:3;7543:4;7534:6;7526;7522:19;7518:30;7515:39;7512:59;;;7567:1;7564;7557:12;7512:59;7230:347;;;;;:::o;7582:409::-;7652:6;7660;7713:2;7701:9;7692:7;7688:23;7684:32;7681:52;;;7729:1;7726;7719:12;7681:52;7756:23;;-1:-1:-1;;;;;7791:30:70;;7788:50;;;7834:1;7831;7824:12;7788:50;7873:58;7923:7;7914:6;7903:9;7899:22;7873:58;:::i;:::-;7950:8;;7847:84;;-1:-1:-1;7582:409:70;-1:-1:-1;;;;7582:409:70:o;7996:712::-;8086:6;8094;8102;8110;8163:2;8151:9;8142:7;8138:23;8134:32;8131:52;;;8179:1;8176;8169:12;8131:52;8206:23;;-1:-1:-1;;;;;8241:30:70;;8238:50;;;8284:1;8281;8274:12;8238:50;8323:58;8373:7;8364:6;8353:9;8349:22;8323:58;:::i;:::-;8400:8;;-1:-1:-1;8297:84:70;-1:-1:-1;;8488:2:70;8473:18;;8460:32;-1:-1:-1;;;;;8504:32:70;;8501:52;;;8549:1;8546;8539:12;8501:52;8588:60;8640:7;8629:8;8618:9;8614:24;8588:60;:::i;:::-;7996:712;;;;-1:-1:-1;8667:8:70;-1:-1:-1;;;;7996:712:70:o;8713:248::-;8887:25;;;8943:2;8928:18;;8921:34;8875:2;8860:18;;8713:248::o;8966:344::-;9033:2;9027:9;9075:3;9063:16;;-1:-1:-1;;;;;9094:34:70;;9130:22;;;9091:62;9088:185;;;9195:10;9190:3;9186:20;9183:1;9176:31;9230:4;9227:1;9220:15;9258:4;9255:1;9248:15;9088:185;9289:2;9282:22;8966:344;:::o;9315:352::-;9387:2;9381:9;9429:6;9417:19;;-1:-1:-1;;;;;9451:34:70;;9487:22;;;9448:62;9445:185;;;9552:10;9547:3;9543:20;9540:1;9533:31;9587:4;9584:1;9577:15;9615:4;9612:1;9605:15;9672:349;9744:2;9738:9;9786:3;9774:16;;-1:-1:-1;;;;;9805:34:70;;9841:22;;;9802:62;9799:185;;;9906:10;9901:3;9897:20;9894:1;9887:31;9941:4;9938:1;9931:15;9969:4;9966:1;9959:15;10026:1005;10109:6;10169:3;10157:9;10148:7;10144:23;10140:33;10185:2;10182:22;;;10200:1;10197;10190:12;10182:22;-1:-1:-1;10219:1:70;10242:17;;:::i;:::-;10305:23;;10337:22;;10433:2;10418:18;;;10405:32;10453:14;;;10446:31;10551:2;10536:18;;;10523:32;10571:14;;;10564:31;10669:2;10654:18;;;10641:32;10689:14;;;10682:31;10787:3;10772:19;;;10759:33;10808:15;;;10801:32;10885:3;10870:19;;10857:33;10934:4;10921:18;;10909:31;;10899:61;;10955:2;10951;10944:14;10899:61;10987:3;10976:15;;10969:32;10980:5;10026:1005;-1:-1:-1;;;;10026:1005:70:o;11036:154::-;11094:5;11139:3;11130:6;11125:3;11121:16;11117:26;11114:46;;;11156:1;11153;11146:12;11114:46;-1:-1:-1;11178:6:70;11036:154;-1:-1:-1;11036:154:70:o;11195:360::-;11315:6;11323;11376:3;11364:9;11355:7;11351:23;11347:33;11344:53;;;11393:1;11390;11383:12;11344:53;11416:52;11460:7;11449:9;11416:52;:::i;:::-;11406:62;;11487;11541:7;11535:3;11524:9;11520:19;11487:62;:::i;:::-;11477:72;;11195:360;;;;;:::o;11560:245::-;11618:6;11671:2;11659:9;11650:7;11646:23;11642:32;11639:52;;;11687:1;11684;11677:12;11639:52;11726:9;11713:23;11745:30;11769:5;11745:30;:::i;11810:217::-;11961:2;11946:18;;11973:48;11950:9;12003:6;11973:48;:::i;12246:881::-;12331:6;12391:2;12379:9;12370:7;12366:23;12362:32;12406:2;12403:22;;;12421:1;12418;12411:12;12403:22;-1:-1:-1;12491:2:70;12485:9;12440:1;;12533:2;12521:15;;-1:-1:-1;;;;;12551:34:70;;12587:22;;;12548:62;12545:187;;;-1:-1:-1;;;12633:32:70;;12688:4;12685:1;12678:15;12717:4;12640:2;12706:16;12545:187;12748:2;12741:22;;;12805:23;;12837:21;;12932:2;12917:18;;;12904:32;12952:15;;;12945:32;13036:18;;;13023:32;13071:15;;;13064:32;;;;-1:-1:-1;12844:6:70;;12246:881;-1:-1:-1;;12246:881:70:o;13498:138::-;13577:13;;13599:31;13577:13;13599:31;:::i;:::-;13498:138;;;:::o;13641:1140::-;13709:5;13757:6;13745:9;13740:3;13736:19;13732:32;13729:52;;;13777:1;13774;13767:12;13729:52;13799:22;;:::i;:::-;13790:31;;13844:40;13874:9;13844:40;:::i;:::-;13830:55;;13951:2;13936:18;;;13930:25;13971:14;;;13964:31;14061:2;14046:18;;;14040:25;14081:14;;;14074:31;14171:2;14156:18;;;14150:25;14191:14;;;14184:31;14281:3;14266:19;;;14260:26;14302:15;;;14295:32;14393:3;14378:19;;;14372:26;14414:15;;;14407:32;14505:3;14490:19;;;14484:26;14526:15;;;14519:32;14617:3;14602:19;;;14596:26;14638:15;;;14631:32;14729:3;14714:19;;;14708:26;14750:15;;;14743:32;;;;13837:5;13641:1140;-1:-1:-1;13641:1140:70:o;14786:256::-;14884:6;14937:3;14925:9;14916:7;14912:23;14908:33;14905:53;;;14954:1;14951;14944:12;14905:53;14977:59;15028:7;15017:9;14977:59;:::i;15047:127::-;15108:10;15103:3;15099:20;15096:1;15089:31;15139:4;15136:1;15129:15;15163:4;15160:1;15153:15;15179:125;15244:9;;;15265:10;;;15262:36;;;15278:18;;:::i;15562:399::-;15603:3;15641:5;15635:12;15668:6;15663:3;15656:19;15693:1;15703:139;15717:6;15714:1;15711:13;15703:139;;;15825:4;15810:13;;;15806:24;;15800:31;15780:11;;;15776:22;;15769:63;15732:12;15703:139;;;15707:3;15887:1;15880:4;15871:6;15866:3;15862:16;15858:27;15851:38;15950:4;15943:2;15939:7;15934:2;15926:6;15922:15;15918:29;15913:3;15909:39;15905:50;15898:57;;;15562:399;;;;:::o;15966:314::-;-1:-1:-1;;;;;16141:32:70;;16123:51;;16210:2;16205;16190:18;;16183:30;;;-1:-1:-1;;16230:44:70;;16255:18;;16247:6;16230:44;:::i;16635:300::-;-1:-1:-1;;;;;16827:32:70;;;16809:51;;16896:32;;16891:2;16876:18;;16869:60;16797:2;16782:18;;16635:300::o;16940:136::-;17018:13;;17040:30;17018:13;17040:30;:::i;17081:136::-;17159:13;;17181:30;17159:13;17181:30;:::i;17222:1236::-;17319:6;17379:3;17367:9;17358:7;17354:23;17350:33;17395:2;17392:22;;;17410:1;17407;17400:12;17392:22;-1:-1:-1;17429:1:70;17452:22;;:::i;:::-;17520:16;;17545:22;;17634:2;17619:18;;;17613:25;17654:14;;;17647:31;17745:2;17730:18;;;17724:25;17765:14;;;17758:31;17821:48;17865:2;17850:18;;17821:48;:::i;:::-;17816:2;17809:5;17805:14;17798:72;17903:49;17947:3;17936:9;17932:19;17903:49;:::i;:::-;17897:3;17890:5;17886:15;17879:74;17986:49;18030:3;18019:9;18015:19;17986:49;:::i;:::-;17980:3;17973:5;17969:15;17962:74;18069:49;18113:3;18102:9;18098:19;18069:49;:::i;:::-;18063:3;18056:5;18052:15;18045:74;18152:49;18196:3;18185:9;18181:19;18152:49;:::i;:::-;18146:3;18135:15;;18128:74;18269:3;18254:19;;;18248:26;18290:15;;;18283:32;18382:3;18367:19;;;18361:26;18403:15;;;18396:32;;;;-1:-1:-1;18139:5:70;;17222:1236;-1:-1:-1;;17222:1236:70:o;19003:217::-;19043:1;19069;19059:132;;19113:10;19108:3;19104:20;19101:1;19094:31;19148:4;19145:1;19138:15;19176:4;19173:1;19166:15;19059:132;-1:-1:-1;19205:9:70;;19003:217::o;19858:245::-;19925:6;19978:2;19966:9;19957:7;19953:23;19949:32;19946:52;;;19994:1;19991;19984:12;19946:52;20026:9;20020:16;20045:28;20067:5;20045:28;:::i;22302:1105::-;22404:6;22464:3;22452:9;22443:7;22439:23;22435:33;22480:2;22477:22;;;22495:1;22492;22485:12;22477:22;-1:-1:-1;22565:2:70;22559:9;22514:1;;22607:3;22595:16;;-1:-1:-1;;;;;22626:34:70;;22662:22;;;22623:62;22620:187;;;-1:-1:-1;;;22708:32:70;;22763:4;22760:1;22753:15;22792:4;22715:2;22781:16;22620:187;22823:2;22816:22;;;22880:16;;22905:21;;22993:2;22978:18;;;22972:25;23013:15;;;23006:32;23090:18;;;23084:25;23125:15;;;23118:32;23217:2;23202:18;;;23196:25;23237:15;;;23230:32;23329:3;23314:19;;;23308:26;23350:16;;;23343:33;;;;-1:-1:-1;22912:6:70;;22302:1105;-1:-1:-1;;22302:1105:70:o;23412:456::-;23500:6;23508;23516;23569:2;23557:9;23548:7;23544:23;23540:32;23537:52;;;23585:1;23582;23575:12;23537:52;-1:-1:-1;;23630:16:70;;23736:2;23721:18;;23715:25;23832:2;23817:18;;;23811:25;23630:16;;23715:25;;-1:-1:-1;23811:25:70;23412:456;-1:-1:-1;23412:456:70:o;24400:504::-;24659:6;24648:9;24641:25;24702:6;24697:2;24686:9;24682:18;24675:34;24745:3;24740:2;24729:9;24725:18;24718:31;24622:4;24766:45;24806:3;24795:9;24791:19;24783:6;24766:45;:::i;:::-;24842:2;24827:18;;24820:34;;;;-1:-1:-1;24885:3:70;24870:19;24863:35;24758:53;24400:504;-1:-1:-1;;;24400:504:70:o;25818:168::-;25891:9;;;25922;;25939:15;;;25933:22;;25919:37;25909:71;;25960:18;;:::i" + }, + "methodIdentifiers": { + "MAX_FISHERMAN_REWARD_CUT()": "17337b46", + "MIN_DISPUTE_DEPOSIT()": "cc2d55cd", + "acceptDispute(bytes32,uint256)": "050b17ad", + "acceptDisputeConflict(bytes32,uint256,bool,uint256)": "b0e2f7e9", + "arbitrator()": "6cc6cde1", + "areConflictingAttestations((bytes32,bytes32,bytes32,bytes32,bytes32,uint8),(bytes32,bytes32,bytes32,bytes32,bytes32,uint8))": "d36fc9d4", + "cancelDispute(bytes32)": "1792f194", + "createAndAcceptLegacyDispute(address,address,uint256,uint256)": "8d4e9008", + "createIndexingDispute(address,bytes32)": "4bc5839a", + "createQueryDispute(bytes)": "c50a77b1", + "createQueryDisputeConflict(bytes,bytes)": "c894222e", + "disputeDeposit()": "29e03ff1", + "disputePeriod()": "5bf31d4d", + "disputes(bytes32)": "11be1997", + "drawDispute(bytes32)": "9334ea52", + "encodeReceipt((bytes32,bytes32,bytes32))": "6369df6b", + "fishermanRewardCut()": "902a4938", + "getAttestationIndexer((bytes32,bytes32,bytes32,bytes32,bytes32,uint8))": "c9747f51", + "getDisputePeriod()": "5aea0ec4", + "getFishermanRewardCut()": "bb2a2b47", + "getStakeSnapshot(address)": "c133b429", + "initialize(address,address,uint64,uint256,uint32,uint32)": "0bc7344b", + "isDisputeCreated(bytes32)": "be41f384", + "maxSlashingCut()": "0533e1ba", + "owner()": "8da5cb5b", + "rejectDispute(bytes32)": "36167e03", + "renounceOwnership()": "715018a6", + "setArbitrator(address)": "b0eefabe", + "setDisputeDeposit(uint256)": "16972978", + "setDisputePeriod(uint64)": "d76f62d1", + "setFishermanRewardCut(uint32)": "76c993ae", + "setMaxSlashingCut(uint32)": "9f81a7cf", + "setSubgraphService(address)": "93a90a1e", + "subgraphService()": "26058249", + "transferOwnership(address)": "f2fde38b" + } + }, + "metadata": "{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"controller\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"length\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expectedLength\",\"type\":\"uint256\"}],\"name\":\"AttestationInvalidBytesLength\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"disputeId\",\"type\":\"bytes32\"}],\"name\":\"DisputeManagerDisputeAlreadyCreated\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"disputeId\",\"type\":\"bytes32\"}],\"name\":\"DisputeManagerDisputeInConflict\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"disputeId\",\"type\":\"bytes32\"}],\"name\":\"DisputeManagerDisputeNotInConflict\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"enum IDisputeManager.DisputeStatus\",\"name\":\"status\",\"type\":\"uint8\"}],\"name\":\"DisputeManagerDisputeNotPending\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DisputeManagerDisputePeriodNotFinished\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DisputeManagerDisputePeriodZero\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"allocationId\",\"type\":\"address\"}],\"name\":\"DisputeManagerIndexerNotFound\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"disputeId\",\"type\":\"bytes32\"}],\"name\":\"DisputeManagerInvalidDispute\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"disputeDeposit\",\"type\":\"uint256\"}],\"name\":\"DisputeManagerInvalidDisputeDeposit\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"cut\",\"type\":\"uint32\"}],\"name\":\"DisputeManagerInvalidFishermanReward\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"maxSlashingCut\",\"type\":\"uint32\"}],\"name\":\"DisputeManagerInvalidMaxSlashingCut\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokensSlash\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxTokensSlash\",\"type\":\"uint256\"}],\"name\":\"DisputeManagerInvalidTokensSlash\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DisputeManagerInvalidZeroAddress\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"disputeId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"relatedDisputeId\",\"type\":\"bytes32\"}],\"name\":\"DisputeManagerMustAcceptRelatedDispute\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"requestCID1\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"responseCID1\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"subgraphDeploymentId1\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"requestCID2\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"responseCID2\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"subgraphDeploymentId2\",\"type\":\"bytes32\"}],\"name\":\"DisputeManagerNonConflictingAttestations\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"subgraphDeploymentId1\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"subgraphDeploymentId2\",\"type\":\"bytes32\"}],\"name\":\"DisputeManagerNonMatchingSubgraphDeployment\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DisputeManagerNotArbitrator\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DisputeManagerNotFisherman\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DisputeManagerSubgraphServiceNotSet\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DisputeManagerZeroTokens\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ECDSAInvalidSignature\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"length\",\"type\":\"uint256\"}],\"name\":\"ECDSAInvalidSignatureLength\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"ECDSAInvalidSignatureS\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"contractName\",\"type\":\"bytes\"}],\"name\":\"GraphDirectoryInvalidZeroAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidInitialization\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotInitializing\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"OwnableInvalidOwner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"OwnableUnauthorizedAccount\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"a\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"b\",\"type\":\"uint256\"}],\"name\":\"PPMMathInvalidMulPPM\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"arbitrator\",\"type\":\"address\"}],\"name\":\"ArbitratorSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"disputeId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"fisherman\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"DisputeAccepted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"disputeId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"fisherman\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"DisputeCancelled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"disputeDeposit\",\"type\":\"uint256\"}],\"name\":\"DisputeDepositSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"disputeId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"fisherman\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"DisputeDrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"disputeId1\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"disputeId2\",\"type\":\"bytes32\"}],\"name\":\"DisputeLinked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"disputePeriod\",\"type\":\"uint64\"}],\"name\":\"DisputePeriodSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"disputeId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"fisherman\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"DisputeRejected\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"fishermanRewardCut\",\"type\":\"uint32\"}],\"name\":\"FishermanRewardCutSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"graphToken\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"graphStaking\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"graphPayments\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"graphEscrow\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"graphController\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"graphEpochManager\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"graphRewardsManager\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"graphTokenGateway\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"graphProxyAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"graphCuration\",\"type\":\"address\"}],\"name\":\"GraphDirectoryInitialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"disputeId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"fisherman\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"allocationId\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"poi\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"stakeSnapshot\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"cancellableAt\",\"type\":\"uint256\"}],\"name\":\"IndexingDisputeCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"version\",\"type\":\"uint64\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"disputeId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"fisherman\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"allocationId\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokensSlash\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokensRewards\",\"type\":\"uint256\"}],\"name\":\"LegacyDisputeCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"maxSlashingCut\",\"type\":\"uint32\"}],\"name\":\"MaxSlashingCutSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"disputeId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"fisherman\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"subgraphDeploymentId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"attestation\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"stakeSnapshot\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"cancellableAt\",\"type\":\"uint256\"}],\"name\":\"QueryDisputeCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"subgraphService\",\"type\":\"address\"}],\"name\":\"SubgraphServiceSet\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"MAX_FISHERMAN_REWARD_CUT\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MIN_DISPUTE_DEPOSIT\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"disputeId\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"tokensSlash\",\"type\":\"uint256\"}],\"name\":\"acceptDispute\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"disputeId\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"tokensSlash\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"acceptDisputeInConflict\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"tokensSlashRelated\",\"type\":\"uint256\"}],\"name\":\"acceptDisputeConflict\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"arbitrator\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"requestCID\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"responseCID\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"subgraphDeploymentId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"}],\"internalType\":\"struct Attestation.State\",\"name\":\"attestation1\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"requestCID\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"responseCID\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"subgraphDeploymentId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"}],\"internalType\":\"struct Attestation.State\",\"name\":\"attestation2\",\"type\":\"tuple\"}],\"name\":\"areConflictingAttestations\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"disputeId\",\"type\":\"bytes32\"}],\"name\":\"cancelDispute\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"allocationId\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"fisherman\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokensSlash\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"tokensRewards\",\"type\":\"uint256\"}],\"name\":\"createAndAcceptLegacyDispute\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"allocationId\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"poi\",\"type\":\"bytes32\"}],\"name\":\"createIndexingDispute\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"attestationData\",\"type\":\"bytes\"}],\"name\":\"createQueryDispute\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"attestationData1\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"attestationData2\",\"type\":\"bytes\"}],\"name\":\"createQueryDisputeConflict\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"disputeDeposit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"disputePeriod\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"disputeId\",\"type\":\"bytes32\"}],\"name\":\"disputes\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"fisherman\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"deposit\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"relatedDisputeId\",\"type\":\"bytes32\"},{\"internalType\":\"enum IDisputeManager.DisputeType\",\"name\":\"disputeType\",\"type\":\"uint8\"},{\"internalType\":\"enum IDisputeManager.DisputeStatus\",\"name\":\"status\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"createdAt\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"cancellableAt\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"stakeSnapshot\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"disputeId\",\"type\":\"bytes32\"}],\"name\":\"drawDispute\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"requestCID\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"responseCID\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"subgraphDeploymentId\",\"type\":\"bytes32\"}],\"internalType\":\"struct Attestation.Receipt\",\"name\":\"receipt\",\"type\":\"tuple\"}],\"name\":\"encodeReceipt\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"fishermanRewardCut\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"requestCID\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"responseCID\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"subgraphDeploymentId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"}],\"internalType\":\"struct Attestation.State\",\"name\":\"attestation\",\"type\":\"tuple\"}],\"name\":\"getAttestationIndexer\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getDisputePeriod\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getFishermanRewardCut\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"}],\"name\":\"getStakeSnapshot\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"arbitrator_\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"disputePeriod_\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"disputeDeposit_\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"fishermanRewardCut_\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxSlashingCut_\",\"type\":\"uint32\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"disputeId\",\"type\":\"bytes32\"}],\"name\":\"isDisputeCreated\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"maxSlashingCut\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"disputeId\",\"type\":\"bytes32\"}],\"name\":\"rejectDispute\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"arbitrator\",\"type\":\"address\"}],\"name\":\"setArbitrator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"disputeDeposit\",\"type\":\"uint256\"}],\"name\":\"setDisputeDeposit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"disputePeriod\",\"type\":\"uint64\"}],\"name\":\"setDisputePeriod\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"fishermanRewardCut_\",\"type\":\"uint32\"}],\"name\":\"setFishermanRewardCut\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"maxSlashingCut_\",\"type\":\"uint32\"}],\"name\":\"setMaxSlashingCut\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"subgraphService_\",\"type\":\"address\"}],\"name\":\"setSubgraphService\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"subgraphService\",\"outputs\":[{\"internalType\":\"contract ISubgraphService\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"custom:security-contact\":\"Please email security+contracts@thegraph.com if you find any bugs. We may have an active bug bounty program.\",\"errors\":{\"AttestationInvalidBytesLength(uint256,uint256)\":[{\"params\":{\"expectedLength\":\"The expected length of the attestation data\",\"length\":\"The length of the attestation data\"}}],\"DisputeManagerDisputeAlreadyCreated(bytes32)\":[{\"params\":{\"disputeId\":\"The dispute id\"}}],\"DisputeManagerDisputeInConflict(bytes32)\":[{\"params\":{\"disputeId\":\"The dispute id\"}}],\"DisputeManagerDisputeNotInConflict(bytes32)\":[{\"params\":{\"disputeId\":\"The dispute id\"}}],\"DisputeManagerDisputeNotPending(uint8)\":[{\"params\":{\"status\":\"The status of the dispute\"}}],\"DisputeManagerIndexerNotFound(address)\":[{\"params\":{\"allocationId\":\"The allocation id\"}}],\"DisputeManagerInvalidDispute(bytes32)\":[{\"params\":{\"disputeId\":\"The dispute id\"}}],\"DisputeManagerInvalidDisputeDeposit(uint256)\":[{\"params\":{\"disputeDeposit\":\"The dispute deposit\"}}],\"DisputeManagerInvalidFishermanReward(uint32)\":[{\"params\":{\"cut\":\"The fisherman reward cut\"}}],\"DisputeManagerInvalidMaxSlashingCut(uint32)\":[{\"params\":{\"maxSlashingCut\":\"The max slashing cut\"}}],\"DisputeManagerInvalidTokensSlash(uint256,uint256)\":[{\"params\":{\"maxTokensSlash\":\"The max tokens slash\",\"tokensSlash\":\"The tokens slash\"}}],\"DisputeManagerMustAcceptRelatedDispute(bytes32,bytes32)\":[{\"params\":{\"disputeId\":\"The dispute id\",\"relatedDisputeId\":\"The related dispute id\"}}],\"DisputeManagerNonConflictingAttestations(bytes32,bytes32,bytes32,bytes32,bytes32,bytes32)\":[{\"params\":{\"requestCID1\":\"The request CID of the first attestation\",\"requestCID2\":\"The request CID of the second attestation\",\"responseCID1\":\"The response CID of the first attestation\",\"responseCID2\":\"The response CID of the second attestation\",\"subgraphDeploymentId1\":\"The subgraph deployment id of the first attestation\",\"subgraphDeploymentId2\":\"The subgraph deployment id of the second attestation\"}}],\"DisputeManagerNonMatchingSubgraphDeployment(bytes32,bytes32)\":[{\"params\":{\"subgraphDeploymentId1\":\"The subgraph deployment id of the first attestation\",\"subgraphDeploymentId2\":\"The subgraph deployment id of the second attestation\"}}],\"ECDSAInvalidSignature()\":[{\"details\":\"The signature derives the `address(0)`.\"}],\"ECDSAInvalidSignatureLength(uint256)\":[{\"details\":\"The signature has an invalid length.\"}],\"ECDSAInvalidSignatureS(bytes32)\":[{\"details\":\"The signature has an S value that is in the upper half order.\"}],\"GraphDirectoryInvalidZeroAddress(bytes)\":[{\"params\":{\"contractName\":\"The name of the contract that was not found, or the controller\"}}],\"InvalidInitialization()\":[{\"details\":\"The contract is already initialized.\"}],\"NotInitializing()\":[{\"details\":\"The contract is not initializing.\"}],\"OwnableInvalidOwner(address)\":[{\"details\":\"The owner is not a valid owner account. (eg. `address(0)`)\"}],\"OwnableUnauthorizedAccount(address)\":[{\"details\":\"The caller account is not authorized to perform an operation.\"}],\"PPMMathInvalidMulPPM(uint256,uint256)\":[{\"params\":{\"a\":\"The first value in the multiplication.\",\"b\":\"The second value in the multiplication.\"}}]},\"events\":{\"ArbitratorSet(address)\":{\"params\":{\"arbitrator\":\"The address of the arbitrator.\"}},\"DisputeAccepted(bytes32,address,address,uint256)\":{\"details\":\"Emitted when arbitrator accepts a `disputeId` to `indexer` created by `fisherman`. The event emits the amount `tokens` transferred to the fisherman, the deposit plus reward.\",\"params\":{\"disputeId\":\"The dispute id\",\"fisherman\":\"The fisherman address\",\"indexer\":\"The indexer address\",\"tokens\":\"The amount of tokens transferred to the fisherman, the deposit plus reward\"}},\"DisputeCancelled(bytes32,address,address,uint256)\":{\"details\":\"Emitted when a dispute is cancelled by the fisherman. The event emits the amount `tokens` returned to the fisherman.\",\"params\":{\"disputeId\":\"The dispute id\",\"fisherman\":\"The fisherman address\",\"indexer\":\"The indexer address\",\"tokens\":\"The amount of tokens returned to the fisherman - the deposit\"}},\"DisputeDepositSet(uint256)\":{\"params\":{\"disputeDeposit\":\"The dispute deposit required to create a dispute.\"}},\"DisputeDrawn(bytes32,address,address,uint256)\":{\"details\":\"Emitted when arbitrator draw a `disputeId` for `indexer` created by `fisherman`. The event emits the amount `tokens` used as deposit and returned to the fisherman.\",\"params\":{\"disputeId\":\"The dispute id\",\"fisherman\":\"The fisherman address\",\"indexer\":\"The indexer address\",\"tokens\":\"The amount of tokens returned to the fisherman - the deposit\"}},\"DisputeLinked(bytes32,bytes32)\":{\"details\":\"Emitted when two disputes are in conflict to link them. This event will be emitted after each DisputeCreated event is emitted for each of the individual disputes.\",\"params\":{\"disputeId1\":\"The first dispute id\",\"disputeId2\":\"The second dispute id\"}},\"DisputePeriodSet(uint64)\":{\"params\":{\"disputePeriod\":\"The dispute period in seconds.\"}},\"DisputeRejected(bytes32,address,address,uint256)\":{\"details\":\"Emitted when arbitrator rejects a `disputeId` for `indexer` created by `fisherman`. The event emits the amount `tokens` burned from the fisherman deposit.\",\"params\":{\"disputeId\":\"The dispute id\",\"fisherman\":\"The fisherman address\",\"indexer\":\"The indexer address\",\"tokens\":\"The amount of tokens burned from the fisherman deposit\"}},\"FishermanRewardCutSet(uint32)\":{\"params\":{\"fishermanRewardCut\":\"The fisherman reward cut.\"}},\"GraphDirectoryInitialized(address,address,address,address,address,address,address,address,address,address)\":{\"params\":{\"graphController\":\"The Graph Controller contract address\",\"graphCuration\":\"The Curation contract address\",\"graphEpochManager\":\"The Epoch Manager contract address\",\"graphEscrow\":\"The Payments Escrow contract address\",\"graphPayments\":\"The Graph Payments contract address\",\"graphProxyAdmin\":\"The Graph Proxy Admin contract address\",\"graphRewardsManager\":\"The Rewards Manager contract address\",\"graphStaking\":\"The Horizon Staking contract address\",\"graphToken\":\"The Graph Token contract address\",\"graphTokenGateway\":\"The Token Gateway contract address\"}},\"IndexingDisputeCreated(bytes32,address,address,uint256,address,bytes32,uint256,uint256)\":{\"details\":\"Emitted when an indexing dispute is created for `allocationId` and `indexer` by `fisherman`. The event emits the amount of `tokens` deposited by the fisherman.\",\"params\":{\"allocationId\":\"The allocation id\",\"cancellableAt\":\"The timestamp when the dispute can be cancelled\",\"disputeId\":\"The dispute id\",\"fisherman\":\"The fisherman address\",\"indexer\":\"The indexer address\",\"poi\":\"The POI\",\"stakeSnapshot\":\"The stake snapshot of the indexer at the time of the dispute\",\"tokens\":\"The amount of tokens deposited by the fisherman\"}},\"Initialized(uint64)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"},\"LegacyDisputeCreated(bytes32,address,address,address,uint256,uint256)\":{\"details\":\"Emitted when a legacy dispute is created for `allocationId` and `fisherman`. The event emits the amount of `tokensSlash` to slash and `tokensRewards` to reward the fisherman.\",\"params\":{\"allocationId\":\"The allocation id\",\"disputeId\":\"The dispute id\",\"fisherman\":\"The fisherman address to be credited with the rewards\",\"indexer\":\"The indexer address\",\"tokensRewards\":\"The amount of tokens to reward the fisherman\",\"tokensSlash\":\"The amount of tokens to slash\"}},\"MaxSlashingCutSet(uint32)\":{\"params\":{\"maxSlashingCut\":\"The maximum slashing cut that can be set.\"}},\"QueryDisputeCreated(bytes32,address,address,uint256,bytes32,bytes,uint256,uint256)\":{\"details\":\"Emitted when a query dispute is created for `subgraphDeploymentId` and `indexer` by `fisherman`. The event emits the amount of `tokens` deposited by the fisherman and `attestation` submitted.\",\"params\":{\"attestation\":\"The attestation\",\"cancellableAt\":\"The timestamp when the dispute can be cancelled\",\"disputeId\":\"The dispute id\",\"fisherman\":\"The fisherman address\",\"indexer\":\"The indexer address\",\"stakeSnapshot\":\"The stake snapshot of the indexer at the time of the dispute\",\"subgraphDeploymentId\":\"The subgraph deployment id\",\"tokens\":\"The amount of tokens deposited by the fisherman\"}},\"SubgraphServiceSet(address)\":{\"params\":{\"subgraphService\":\"The address of the subgraph service.\"}}},\"kind\":\"dev\",\"methods\":{\"acceptDispute(bytes32,uint256)\":{\"details\":\"Accept a dispute with Id `disputeId`\",\"params\":{\"disputeId\":\"Id of the dispute to be accepted\",\"tokensSlash\":\"Amount of tokens to slash from the indexer\"}},\"acceptDisputeConflict(bytes32,uint256,bool,uint256)\":{\"params\":{\"acceptDisputeInConflict\":\"Accept the conflicting dispute. Otherwise it will be drawn automatically\",\"disputeId\":\"Id of the dispute to be accepted\",\"tokensSlash\":\"Amount of tokens to slash from the indexer for the first dispute\",\"tokensSlashRelated\":\"Amount of tokens to slash from the indexer for the related dispute in case acceptDisputeInConflict is true, otherwise it will be ignored\"}},\"areConflictingAttestations((bytes32,bytes32,bytes32,bytes32,bytes32,uint8),(bytes32,bytes32,bytes32,bytes32,bytes32,uint8))\":{\"params\":{\"attestation1\":\"The first attestation\",\"attestation2\":\"The second attestation\"},\"returns\":{\"_0\":\"Whether the attestations are conflicting\"}},\"cancelDispute(bytes32)\":{\"details\":\"Cancel a dispute with Id `disputeId`\",\"params\":{\"disputeId\":\"Id of the dispute to be cancelled\"}},\"constructor\":{\"params\":{\"controller\":\"Address of the controller\"}},\"createAndAcceptLegacyDispute(address,address,uint256,uint256)\":{\"params\":{\"allocationId\":\"The allocation to dispute\",\"fisherman\":\"The fisherman address to be credited with the rewards\",\"tokensRewards\":\"The amount of tokens to reward the fisherman\",\"tokensSlash\":\"The amount of tokens to slash\"},\"returns\":{\"_0\":\"The dispute id\"}},\"createIndexingDispute(address,bytes32)\":{\"params\":{\"allocationId\":\"The allocation to dispute\",\"poi\":\"The Proof of Indexing (POI) being disputed\"},\"returns\":{\"_0\":\"The dispute id\"}},\"createQueryDispute(bytes)\":{\"params\":{\"attestationData\":\"Attestation bytes submitted by the fisherman\"},\"returns\":{\"_0\":\"The dispute id\"}},\"createQueryDisputeConflict(bytes,bytes)\":{\"params\":{\"attestationData1\":\"First attestation data submitted\",\"attestationData2\":\"Second attestation data submitted\"},\"returns\":{\"_0\":\"The first dispute id\",\"_1\":\"The second dispute id\"}},\"drawDispute(bytes32)\":{\"details\":\"Ignore a dispute with Id `disputeId`\",\"params\":{\"disputeId\":\"Id of the dispute to be disregarded\"}},\"encodeReceipt((bytes32,bytes32,bytes32))\":{\"details\":\"Return the message hash used to sign the receipt\",\"params\":{\"receipt\":\"Receipt returned by indexer and submitted by fisherman\"},\"returns\":{\"_0\":\"Message hash used to sign the receipt\"}},\"getAttestationIndexer((bytes32,bytes32,bytes32,bytes32,bytes32,uint8))\":{\"params\":{\"attestation\":\"Attestation\"},\"returns\":{\"_0\":\"indexer address\"}},\"getDisputePeriod()\":{\"returns\":{\"_0\":\"Dispute period in seconds\"}},\"getFishermanRewardCut()\":{\"returns\":{\"_0\":\"Fisherman reward cut in percentage (ppm)\"}},\"getStakeSnapshot(address)\":{\"params\":{\"indexer\":\"The indexer address\"},\"returns\":{\"_0\":\"The stake snapshot\"}},\"initialize(address,address,uint64,uint256,uint32,uint32)\":{\"params\":{\"arbitrator\":\"Arbitrator role\",\"disputeDeposit\":\"Deposit required to create a Dispute\",\"disputePeriod\":\"Dispute period in seconds\",\"fishermanRewardCut_\":\"Percent of slashed funds for fisherman (ppm)\",\"maxSlashingCut_\":\"Maximum percentage of indexer stake that can be slashed (ppm)\",\"owner\":\"The owner of the contract\"}},\"isDisputeCreated(bytes32)\":{\"details\":\"Return if dispute with Id `disputeId` exists\",\"params\":{\"disputeId\":\"True if dispute already exists\"},\"returns\":{\"_0\":\"True if dispute already exists\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"rejectDispute(bytes32)\":{\"details\":\"Reject a dispute with Id `disputeId`\",\"params\":{\"disputeId\":\"Id of the dispute to be rejected\"}},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.\"},\"setArbitrator(address)\":{\"details\":\"Update the arbitrator to `_arbitrator`\",\"params\":{\"arbitrator\":\"The address of the arbitration contract or party\"}},\"setDisputeDeposit(uint256)\":{\"details\":\"Update the dispute deposit to `_disputeDeposit` Graph Tokens\",\"params\":{\"disputeDeposit\":\"The dispute deposit in Graph Tokens\"}},\"setDisputePeriod(uint64)\":{\"details\":\"Update the dispute period to `_disputePeriod` in seconds\",\"params\":{\"disputePeriod\":\"Dispute period in seconds\"}},\"setFishermanRewardCut(uint32)\":{\"details\":\"Update the reward percentage to `_percentage`\",\"params\":{\"fishermanRewardCut_\":\"Reward as a percentage of indexer stake\"}},\"setMaxSlashingCut(uint32)\":{\"params\":{\"maxSlashingCut_\":\"Max percentage slashing for disputes\"}},\"setSubgraphService(address)\":{\"details\":\"Update the subgraph service to `_subgraphService`\",\"params\":{\"subgraphService\":\"The address of the subgraph service contract\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"title\":\"DisputeManager\",\"version\":1},\"userdoc\":{\"errors\":{\"AttestationInvalidBytesLength(uint256,uint256)\":[{\"notice\":\"The error thrown when the attestation data length is invalid\"}],\"DisputeManagerDisputeAlreadyCreated(bytes32)\":[{\"notice\":\"Thrown when the dispute is already created\"}],\"DisputeManagerDisputeInConflict(bytes32)\":[{\"notice\":\"Thrown when the dispute is in conflict\"}],\"DisputeManagerDisputeNotInConflict(bytes32)\":[{\"notice\":\"Thrown when the dispute is not in conflict\"}],\"DisputeManagerDisputeNotPending(uint8)\":[{\"notice\":\"Thrown when the dispute is not pending\"}],\"DisputeManagerDisputePeriodNotFinished()\":[{\"notice\":\"Thrown when the dispute period is not finished\"}],\"DisputeManagerDisputePeriodZero()\":[{\"notice\":\"Thrown when the dispute period is zero\"}],\"DisputeManagerIndexerNotFound(address)\":[{\"notice\":\"Thrown when the indexer is not found\"}],\"DisputeManagerInvalidDispute(bytes32)\":[{\"notice\":\"Thrown when the dispute id is invalid\"}],\"DisputeManagerInvalidDisputeDeposit(uint256)\":[{\"notice\":\"Thrown when the dispute deposit is invalid - less than the minimum dispute deposit\"}],\"DisputeManagerInvalidFishermanReward(uint32)\":[{\"notice\":\"Thrown when the fisherman reward cut is invalid\"}],\"DisputeManagerInvalidMaxSlashingCut(uint32)\":[{\"notice\":\"Thrown when the max slashing cut is invalid\"}],\"DisputeManagerInvalidTokensSlash(uint256,uint256)\":[{\"notice\":\"Thrown when the tokens slash is invalid\"}],\"DisputeManagerInvalidZeroAddress()\":[{\"notice\":\"Thrown when the address is the zero address\"}],\"DisputeManagerMustAcceptRelatedDispute(bytes32,bytes32)\":[{\"notice\":\"Thrown when the dispute must be accepted\"}],\"DisputeManagerNonConflictingAttestations(bytes32,bytes32,bytes32,bytes32,bytes32,bytes32)\":[{\"notice\":\"Thrown when the attestations are not conflicting\"}],\"DisputeManagerNonMatchingSubgraphDeployment(bytes32,bytes32)\":[{\"notice\":\"Thrown when the subgraph deployment is not matching\"}],\"DisputeManagerNotArbitrator()\":[{\"notice\":\"Thrown when the caller is not the arbitrator\"}],\"DisputeManagerNotFisherman()\":[{\"notice\":\"Thrown when the caller is not the fisherman\"}],\"DisputeManagerSubgraphServiceNotSet()\":[{\"notice\":\"Thrown when attempting to get the subgraph service before it is set\"}],\"DisputeManagerZeroTokens()\":[{\"notice\":\"Thrown when the indexer being disputed has no provisioned tokens\"}],\"GraphDirectoryInvalidZeroAddress(bytes)\":[{\"notice\":\"Thrown when either the controller is the zero address or a contract address is not found on the controller\"}],\"PPMMathInvalidMulPPM(uint256,uint256)\":[{\"notice\":\"Thrown when no value in a multiplication is in PPM.\"}]},\"events\":{\"ArbitratorSet(address)\":{\"notice\":\"Emitted when arbitrator is set.\"},\"DisputeDepositSet(uint256)\":{\"notice\":\"Emitted when dispute deposit is set.\"},\"DisputePeriodSet(uint64)\":{\"notice\":\"Emitted when dispute period is set.\"},\"FishermanRewardCutSet(uint32)\":{\"notice\":\"Emitted when fisherman reward cut is set.\"},\"GraphDirectoryInitialized(address,address,address,address,address,address,address,address,address,address)\":{\"notice\":\"Emitted when the GraphDirectory is initialized\"},\"MaxSlashingCutSet(uint32)\":{\"notice\":\"Emitted when max slashing cut is set.\"},\"SubgraphServiceSet(address)\":{\"notice\":\"Emitted when subgraph service is set.\"}},\"kind\":\"user\",\"methods\":{\"MAX_FISHERMAN_REWARD_CUT()\":{\"notice\":\"Maximum value for fisherman reward cut in PPM\"},\"MIN_DISPUTE_DEPOSIT()\":{\"notice\":\"Minimum value for dispute deposit\"},\"acceptDispute(bytes32,uint256)\":{\"notice\":\"The arbitrator accepts a dispute as being valid. This function will revert if the indexer is not slashable, whether because it does not have any stake available or the slashing percentage is configured to be zero. In those cases a dispute must be resolved using drawDispute or rejectDispute. This function will also revert if the dispute is in conflict, to accept a conflicting dispute use acceptDisputeConflict.\"},\"acceptDisputeConflict(bytes32,uint256,bool,uint256)\":{\"notice\":\"The arbitrator accepts a conflicting dispute as being valid. This function will revert if the indexer is not slashable, whether because it does not have any stake available or the slashing percentage is configured to be zero. In those cases a dispute must be resolved using drawDispute.\"},\"arbitrator()\":{\"notice\":\"The arbitrator is solely in control of arbitrating disputes\"},\"areConflictingAttestations((bytes32,bytes32,bytes32,bytes32,bytes32,uint8),(bytes32,bytes32,bytes32,bytes32,bytes32,uint8))\":{\"notice\":\"Checks if two attestations are conflicting\"},\"cancelDispute(bytes32)\":{\"notice\":\"Once the dispute period ends, if the dispute status remains Pending, the fisherman can cancel the dispute and get back their initial deposit. Note that cancelling a conflicting query dispute will also cancel the related dispute.\"},\"constructor\":{\"notice\":\"Contract constructor\"},\"createAndAcceptLegacyDispute(address,address,uint256,uint256)\":{\"notice\":\"Creates and auto-accepts a legacy dispute. This disputes can be created to settle outstanding slashing amounts with an indexer that has been \\\"legacy slashed\\\" during or shortly after the transition period. See {HorizonStakingExtension.legacySlash} for more details. Note that this type of dispute: - can only be created by the arbitrator - does not require a bond - is automatically accepted when created Additionally, note that this type of disputes allow the arbitrator to directly set the slash and rewards amounts, bypassing the usual mechanisms that impose restrictions on those. This is done to give arbitrators maximum flexibility to ensure outstanding slashing amounts are settled fairly. This function needs to be removed after the transition period. Requirements: - Indexer must have been legacy slashed during or shortly after the transition period - Indexer must have provisioned funds to the Subgraph Service\"},\"createIndexingDispute(address,bytes32)\":{\"notice\":\"Create an indexing dispute for the arbitrator to resolve. The disputes are created in reference to an allocationId and specifically a POI for that allocation. This function is called by a fisherman and it will pull `disputeDeposit` GRT tokens. Requirements: - fisherman must have previously approved this contract to pull `disputeDeposit` amount of tokens from their balance.\"},\"createQueryDispute(bytes)\":{\"notice\":\"Create a query dispute for the arbitrator to resolve. This function is called by a fisherman and it will pull `disputeDeposit` GRT tokens. * Requirements: - fisherman must have previously approved this contract to pull `disputeDeposit` amount of tokens from their balance.\"},\"createQueryDisputeConflict(bytes,bytes)\":{\"notice\":\"Create query disputes for two conflicting attestations. A conflicting attestation is a proof presented by two different indexers where for the same request on a subgraph the response is different. Two linked disputes will be created and if the arbitrator resolve one, the other one will be automatically resolved. Note that: - it's not possible to reject a conflicting query dispute as by definition at least one of the attestations is incorrect. - if both attestations are proven to be incorrect, the arbitrator can slash the indexer twice. Requirements: - fisherman must have previously approved this contract to pull `disputeDeposit` amount of tokens from their balance.\"},\"disputeDeposit()\":{\"notice\":\"Deposit required to create a Dispute\"},\"disputePeriod()\":{\"notice\":\"dispute period in seconds\"},\"disputes(bytes32)\":{\"notice\":\"List of disputes created\"},\"drawDispute(bytes32)\":{\"notice\":\"The arbitrator draws dispute. Note that drawing a conflicting query dispute should not be possible however it is allowed to give arbitrators greater flexibility when resolving disputes.\"},\"encodeReceipt((bytes32,bytes32,bytes32))\":{\"notice\":\"Get the message hash that a indexer used to sign the receipt. Encodes a receipt using a domain separator, as described on https://github.com/ethereum/EIPs/blob/master/EIPS/eip-712.md#specification.\"},\"fishermanRewardCut()\":{\"notice\":\"Percentage of indexer slashed funds to assign as a reward to fisherman in successful dispute. In PPM.\"},\"getAttestationIndexer((bytes32,bytes32,bytes32,bytes32,bytes32,uint8))\":{\"notice\":\"Returns the indexer that signed an attestation.\"},\"getDisputePeriod()\":{\"notice\":\"Get the dispute period.\"},\"getFishermanRewardCut()\":{\"notice\":\"Get the fisherman reward cut.\"},\"getStakeSnapshot(address)\":{\"notice\":\"Get the stake snapshot for an indexer.\"},\"initialize(address,address,uint64,uint256,uint32,uint32)\":{\"notice\":\"Initialize this contract.\"},\"isDisputeCreated(bytes32)\":{\"notice\":\"Return whether a dispute exists or not.\"},\"maxSlashingCut()\":{\"notice\":\"Maximum percentage of indexer stake that can be slashed on a dispute. In PPM.\"},\"rejectDispute(bytes32)\":{\"notice\":\"The arbitrator rejects a dispute as being invalid. Note that conflicting query disputes cannot be rejected.\"},\"setArbitrator(address)\":{\"notice\":\"Set the arbitrator address.\"},\"setDisputeDeposit(uint256)\":{\"notice\":\"Set the dispute deposit required to create a dispute.\"},\"setDisputePeriod(uint64)\":{\"notice\":\"Set the dispute period.\"},\"setFishermanRewardCut(uint32)\":{\"notice\":\"Set the percent reward that the fisherman gets when slashing occurs.\"},\"setMaxSlashingCut(uint32)\":{\"notice\":\"Set the maximum percentage that can be used for slashing indexers.\"},\"setSubgraphService(address)\":{\"notice\":\"Set the subgraph service address.\"},\"subgraphService()\":{\"notice\":\"The Subgraph Service contract address\"}},\"notice\":\"Provides a way to permissionlessly create disputes for incorrect behavior in the Subgraph Service. There are two types of disputes that can be created: Query disputes and Indexing disputes. Query Disputes: Graph nodes receive queries and return responses with signed receipts called attestations. An attestation can be disputed if the consumer thinks the query response was invalid. Indexers use the derived private key for an allocation to sign attestations. Indexing Disputes: Indexers periodically present a Proof of Indexing (POI) to prove they are indexing a subgraph. The Subgraph Service contract emits that proof which includes the POI. Any fisherman can dispute the validity of a POI by submitting a dispute to this contract along with a deposit. Arbitration: Disputes can only be accepted, rejected or drawn by the arbitrator role that can be delegated to a EOA or DAO.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/DisputeManager.sol\":\"DisputeManager\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10},\"remappings\":[]},\"sources\":{\"@graphprotocol/contracts/contracts/arbitrum/ITokenGateway.sol\":{\"keccak256\":\"0x3cbcc6e4629543a99acacc7ee4ffa6c063b9fb17d3597ccd2f9481008e3633bd\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://d6bb0bb830b67d579e57a261e5f5d9e90b32dc006b02badbecf1f6c82c0a5100\",\"dweb:/ipfs/Qmd38iNXZpinwbNRJPEAA8r9bmmtRwjTSK1SkmH47ge4kJ\"]},\"@graphprotocol/contracts/contracts/curation/ICuration.sol\":{\"keccak256\":\"0x17e4db429003cab08cd2859db94b95e0cee1f9478c1881903a4104def8fdc048\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://52ed58228a0e92aeb3493473a6e02f92d26a4e4eb0c46d38dd446e3bfcb6691e\",\"dweb:/ipfs/QmZzWxHAztdz2Q7cobqVEf4ExGpNuqWJFYgs2oHCgApjW6\"]},\"@graphprotocol/contracts/contracts/epochs/IEpochManager.sol\":{\"keccak256\":\"0x0f4b3a3569c023d2610d0d8b37b3ecb0b67f848d77aa063bb311756670017e85\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://df7c43568e554b301134aa2c58e4889ad0d3dcfec40e834b63621a43f39da154\",\"dweb:/ipfs/QmZeSV9AM6FKCkH9QYyF7i5nVggseEJXbvWbtrgUeXqQpo\"]},\"@graphprotocol/contracts/contracts/governance/IController.sol\":{\"keccak256\":\"0xe37df86cdea385d708ba00862cd9e04940e4f2aa50354fb3a9d2d4f505d5509a\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://0f6c9fd2b7a8c5a6b89ef12c7423144df04a5f251d5480be1b73c74a785ff12a\",\"dweb:/ipfs/QmYpiCQoxbDEYQ2FNA39Z4FGfoxfQ8jvH1Z3ccrqguQFMP\"]},\"@graphprotocol/contracts/contracts/rewards/IRewardsIssuer.sol\":{\"keccak256\":\"0xe049090c38a64d80b284ba2a7b440bcedba9804d96f2bb8da525e69ac452e03a\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://8b7d1186bd0698bed02d3504ac80c20e605087fba036d5ff392b39a9a3c818e5\",\"dweb:/ipfs/QmRgAfY1dD5rc7fLuuGVyu2mh9Z8qz1AVvuXAcRGnB3dSv\"]},\"@graphprotocol/contracts/contracts/rewards/IRewardsManager.sol\":{\"keccak256\":\"0xee4b213950c2e46481658b9b04f2d5dae0a96c4cce0ee346188b1f1272718d54\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://b26dd767bd6887666a18beef79c322d27a693a3a4f7a61dc6bded7f35796acf5\",\"dweb:/ipfs/QmXDeqmRSeAWUWQTknNLUPBDBnDr8ySYW4h6CBPRGMJoPp\"]},\"@graphprotocol/contracts/contracts/token/IGraphToken.sol\":{\"keccak256\":\"0x2ffad6798d641c8d1288730be725c43041c803caceaf6d9985122d000ad5761c\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://5f782a5670037fc9223dc20fd4f99c0277a9bec7d08f7800b0a0733e819a07cb\",\"dweb:/ipfs/QmP3K2QnmukScCh1nzgphYdg7AiAuTaT914jq4txLYNpra\"]},\"@graphprotocol/contracts/contracts/utils/TokenUtils.sol\":{\"keccak256\":\"0x7bd336193785ed6f09a3bd847f9208f64aa9b87ad67c40838d00fec41bb153d5\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://d96d83cdb9bbb567e4eafac8bdef3ff6bdaf426338baf76bae277c11afb33cee\",\"dweb:/ipfs/QmNjr4PiJ76Wc5mFqa9H88BjsEMrUfy1jiftNHYTgd6Mp5\"]},\"@graphprotocol/horizon/contracts/data-service/interfaces/IDataService.sol\":{\"keccak256\":\"0x2208814f64eeca9409eafc1a1fa425c67ff38cffdffc3af0bafbe1c1b338ed32\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://925b32efbd9fe85a98f8f1f51e865e0b7b65d933196cf6c098bd670da7138e0c\",\"dweb:/ipfs/Qmdrp7BGJ4fEKzDgZpVY1FULXKsHAdGXkx4nqRrWvMaumr\"]},\"@graphprotocol/horizon/contracts/data-service/interfaces/IDataServiceFees.sol\":{\"keccak256\":\"0x1b82ae2785502fe62d3ca6f55a3ed836b8b038a3b929cced92e1c6b4733f4074\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://5556b2ce53b604427a995fb50f7169acb3fe30f60ef19c7cb5c22bd5ec53177c\",\"dweb:/ipfs/QmXx7dmTeAYAMPbbrGrcsKT31dqEqbcFgXWaPS6LQrANru\"]},\"@graphprotocol/horizon/contracts/interfaces/IGraphPayments.sol\":{\"keccak256\":\"0xa22dcc47676073113e4ebe30045065662cee5531f9c5f75776c00e70a1929c81\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://8908f30b3c7536798b14dc62fb5ccffc05570d568dbd1bade7c79c1fd2a4b5fe\",\"dweb:/ipfs/QmexZgb5mhDmXVZnYX1Z37cwM7EG2prYyBEVjUSVdKshVr\"]},\"@graphprotocol/horizon/contracts/interfaces/IGraphProxyAdmin.sol\":{\"keccak256\":\"0x4410253d7de56d2cdff50ee141c52fd77fd23f3984440211c3cc90ad560f4f9d\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://da4425a908816c40ffc3c833504843c3732bcb47e745dc544f650e5bc2c23f25\",\"dweb:/ipfs/QmZYDS4cSKBqRXEU3qyjE6sxGModSeNgzQmdZmZCGHuaKt\"]},\"@graphprotocol/horizon/contracts/interfaces/IHorizonStaking.sol\":{\"keccak256\":\"0x4b146f30ee66c4224cb5a82bafc8299f8596d8fe302e793757520f67bba8a166\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://30666c737d72a850223c1966d3b5d02b84f3f808f3c8dae8d0748731646b60c5\",\"dweb:/ipfs/QmQschyZQtU8tTnQ9hNiG5nobuXBx6KeiKdfxvZ4zvQ7ty\"]},\"@graphprotocol/horizon/contracts/interfaces/IPaymentsEscrow.sol\":{\"keccak256\":\"0x99e2a676b539e7b6c223a551f8cb9770c07435a25c8b22f0044a8ce4949edadc\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://f702a3cea214d8328d89a0ef16495c709e30fe13eb86fc29940159c9cb8c7bd5\",\"dweb:/ipfs/QmS25Zgcw85kDZcicApLzRmDcoYNQafpFdMyBEWX8eLWSX\"]},\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingBase.sol\":{\"keccak256\":\"0x9bdab6cb595eabd7d321d7beae03ad3607995c14ef40f0c2f349fb72084766c5\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://6cac2ca3580bd770b98b07b11ebb007e8a922a90cde920e6ec472df7e66fb512\",\"dweb:/ipfs/QmRw1rjT8D8gNp2GRTuwDETwHNHMpHKoHZq4pYBAn9i65F\"]},\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingExtension.sol\":{\"keccak256\":\"0x7923f39746198b5672f0e4d65b7bf14903ae5f7775d74b210effb957eea36c71\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://c29531aff69c71e649fb347d7117ea8c42fc8de09860a1c389ed9b8f097a34e0\",\"dweb:/ipfs/QmS89fww584HiyE1BdPe8Xaqbf5v7FEvL38GTxeHEAsLFm\"]},\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingMain.sol\":{\"keccak256\":\"0xd04bb1f6a427e858e8a625b4b9835c69c8891a324d22beba20293ab2a77e5de7\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://05c9e425eee0b6c109a8dad2edcf9e1c845c64fccf321edf804921394ee048be\",\"dweb:/ipfs/QmbwLWNof534oG5ohzNAWrjdQ5kqJs7M5d5kCRd68XUogB\"]},\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingTypes.sol\":{\"keccak256\":\"0xaaeb9770f8aaae6b395e87bb1876a10fe7c14384d16d97dd33a671c3ea53aa7b\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://8f5c019fdb2df73bafe464fb6e9da792f7833a0c1858734bcd6a6b8d6ae924c7\",\"dweb:/ipfs/QmcubeYTHCYBqQsRncBFpPFtk7JzRz4nFh27LUW1m4hx2K\"]},\"@graphprotocol/horizon/contracts/libraries/LinkedList.sol\":{\"keccak256\":\"0x99058b4da0428b8d9c22d3d112acbaa59900f1fd0a434038b1a4fccfe3c678d6\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://568e03231c6081eacbcb6585a05c0b1bb976b640b611f7bf6155f9b58d887239\",\"dweb:/ipfs/QmdPZQWhkhjf5TUwz487Dwm4ycjX323iNdwb1sQnAiA1Qu\"]},\"@graphprotocol/horizon/contracts/libraries/MathUtils.sol\":{\"keccak256\":\"0x24cd80c0d25f634db1e8101c0a474a284758eb7a2203ae3abf507f578fa12e0a\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://69d03db4aaa31184b3ec9526bf236949683c5a35785c298cad0ac160904b695c\",\"dweb:/ipfs/Qmd2xSKW6ojrapgrRimrXCpc52GTrQ3BMAEYH17UvSfvLV\"]},\"@graphprotocol/horizon/contracts/libraries/PPMMath.sol\":{\"keccak256\":\"0xe7fcfd44d2919944b79a11a39da7d4539d49c4bcf510071a59f6b41c37ee8ef2\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://a21b1ff7ca81fa07f153b60aeca136bd1ee57d9d01a2c76635e4a5602e8959fc\",\"dweb:/ipfs/QmQ5C7mUjt4sv1NBt1FH5XVHN3aBsHnvDsdJKWywhLjso8\"]},\"@graphprotocol/horizon/contracts/utilities/GraphDirectory.sol\":{\"keccak256\":\"0x1d09be2f7454873ab80f86ed5d590b9e796fe5146977c4c4a5b1f7ead17eb522\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://e1c7539d26f069c2acabd404601e7811f8878f66976e8b5d4f5438195de793c2\",\"dweb:/ipfs/QmUAybvtDZ275kAnU6r81aQy1FCp7zLscSV87oe9nbwjyU\"]},\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\":{\"keccak256\":\"0xc163fcf9bb10138631a9ba5564df1fa25db9adff73bd9ee868a8ae1858fe093a\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://9706d43a0124053d9880f6e31a59f31bc0a6a3dc1acd66ce0a16e1111658c5f6\",\"dweb:/ipfs/QmUFmfowzkRwGtDu36cXV9SPTBHJ3n7dG9xQiK5B28jTf2\"]},\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"keccak256\":\"0xdb4d24ee2c087c391d587cd17adfe5b3f9d93b3110b1388c2ab6c7c0ad1dcd05\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://ab7b6d5b9e2b88176312967fe0f0e78f3d9a1422fa5e4b64e2440c35869b5d08\",\"dweb:/ipfs/QmXKYWWyzcLg1B2k7Sb1qkEXgLCYfXecR9wYW5obRzWP1Q\"]},\"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol\":{\"keccak256\":\"0xdbef5f0c787055227243a7318ef74c8a5a1108ca3a07f2b3a00ef67769e1e397\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://08e39f23d5b4692f9a40803e53a8156b72b4c1f9902a88cd65ba964db103dab9\",\"dweb:/ipfs/QmPKn6EYDgpga7KtpkA8wV2yJCYGMtc9K4LkJfhKX2RVSV\"]},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0xe06a3f08a987af6ad2e1c1e774405d4fe08f1694b67517438b467cecf0da0ef7\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://df6f0c459663c9858b6cba2cda1d14a7d05a985bed6d2de72bd8e78c25ee79db\",\"dweb:/ipfs/QmeTTxZ7qVk9rjEv2R4CpCwdf8UMCcRqDNMvzNxHc3Fnn9\"]},\"@openzeppelin/contracts/utils/Panic.sol\":{\"keccak256\":\"0xf7fe324703a64fc51702311dc51562d5cb1497734f074e4f483bfb6717572d7a\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://c6a5ff4f9fd8649b7ee20800b7fa387d3465bd77cf20c2d1068cd5c98e1ed57a\",\"dweb:/ipfs/QmVSaVJf9FXFhdYEYeCEfjMVHrxDh5qL4CGkxdMWpQCrqG\"]},\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\":{\"keccak256\":\"0x69f54c02b7d81d505910ec198c11ed4c6a728418a868b906b4a0cf29946fda84\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://8e25e4bdb7ae1f21d23bfee996e22736fc0ab44cfabedac82a757b1edc5623b9\",\"dweb:/ipfs/QmQdWQvB6JCP9ZMbzi8EvQ1PTETqkcTWrbcVurS7DKpa5n\"]},\"@openzeppelin/contracts/utils/math/Math.sol\":{\"keccak256\":\"0x1225214420c83ebcca88f2ae2b50f053aaa7df7bd684c3e878d334627f2edfc6\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://6c5fab4970634f9ab9a620983dc1c8a30153981a0b1a521666e269d0a11399d3\",\"dweb:/ipfs/QmVRnBC575MESGkEHndjujtR7qub2FzU9RWy9eKLp4hPZB\"]},\"@openzeppelin/contracts/utils/math/SafeCast.sol\":{\"keccak256\":\"0x195533c86d0ef72bcc06456a4f66a9b941f38eb403739b00f21fd7c1abd1ae54\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://b1d578337048cad08c1c03041cca5978eff5428aa130c781b271ad9e5566e1f8\",\"dweb:/ipfs/QmPFKL2r9CBsMwmUqqdcFPfHZB2qcs9g1HDrPxzWSxomvy\"]},\"contracts/DisputeManager.sol\":{\"keccak256\":\"0xb431a6ab58b65a49ba79923401267b79177b483fff9331ea82a81345a03d3629\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://8a20e0d7fabf30489df74320a69c03973ada601dc8fc277746f901b8165a0c3d\",\"dweb:/ipfs/QmaAmVkyzYCDg476AdBTXYRzmHJZ8bJ71LuudZFhnKxCUT\"]},\"contracts/DisputeManagerStorage.sol\":{\"keccak256\":\"0xa340be8ba8f0350d954a3b572f958eb9e1de64ebfeffd208ea3e252ebb4ebb1d\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://45658c8d8b475b52e4e97b1a9f06ab4e4205765f73fad4dda56f980d88d4f6b9\",\"dweb:/ipfs/QmQ5kS2FSxoBi2fRq7szKCNVetfwNe8DVTyDhHCnixWAdH\"]},\"contracts/interfaces/IDisputeManager.sol\":{\"keccak256\":\"0x9db8ffdf7fe30954824ed706a1a5e7c2d6323b745bddba16b7166a639344f9f7\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://e5d810bf6188c38a028dab511c5653fde7b7feca0a173f03974402a83cb234f9\",\"dweb:/ipfs/QmYGtytqHeDFK91FmSNL5iavD8sHUFcA47WBU9BuHG3i75\"]},\"contracts/interfaces/ISubgraphService.sol\":{\"keccak256\":\"0x7516f80b0a8b2e3edeedf06c9b917f2a24e557f8c00632e6150fbb41ef8da3ce\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://ad4f813111541f5ef9ea6236f42822a3a66364d24189e4568450b20e09972a5e\",\"dweb:/ipfs/QmVYQA9rT7T8YnQgAB6fokNYDJeDrgQqrjfJ8sGjySNFBo\"]},\"contracts/libraries/Allocation.sol\":{\"keccak256\":\"0xeabed16693ebd22165d4421bb62b91de64553f94d86d6fd03e3d25a62d651000\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://5beecbf35f8dc63fc9fcd5fe844ff29cb4874c1ac73a96ec7170729efd096b74\",\"dweb:/ipfs/QmPFQyxQYuwae8ARxuLxingd8fQ7GBw1cfTQuUvfo6CWhM\"]},\"contracts/libraries/Attestation.sol\":{\"keccak256\":\"0x0976f586d532d479823ac9e049371742a7a876f0faf3ed722b3b7f78a4586f33\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://34baba14bd7d3dcb1e1111ee09f3c809d6876732bbc889c1486cc329465e711e\",\"dweb:/ipfs/QmPRgYduW85aCjVk4ih35jB2FhoLjBvgmjZtMGeqXaLhTW\"]},\"contracts/libraries/LegacyAllocation.sol\":{\"keccak256\":\"0x32fd54a2823bf3fa4090bf94968b4d8a5988fee8f75d1b805591a744f5766c60\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://2571faaa157c207853cd52e730aaab019384d84618b6dce976b9d794a9634a54\",\"dweb:/ipfs/QmSinKJ1WguxvZte5C3eVfGBo8gsvzTbPQh7uVREWT49uL\"]},\"contracts/utilities/AttestationManager.sol\":{\"keccak256\":\"0x44218c9dd0d618b0e383cad19efd5846ec85d1a11270aa7c04b75e2fa7ddc3a4\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://ee8ca0b9b9746636ff1ad549081fbc176d959544bc7798d0bfb10e3ec61af8b7\",\"dweb:/ipfs/QmcE9RJqj32uoTsWLV2ffwuEPWnBh7Vn8ZpzorXBjgosGd\"]},\"contracts/utilities/AttestationManagerStorage.sol\":{\"keccak256\":\"0x3ae176c9166fac5bfb08e875ad132fe9d1559ce67df28b906683d4f168e1afdc\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://2b40d4be47cc74387e3c390e081bdadc84f84062e9708a7a84d73f02e0a3853a\",\"dweb:/ipfs/QmQL8DUzrtgQABb1CvcuSeuapXntXEh5aKi4ZjE3MssBgZ\"]}},\"version\":1}" + } + }, + "contracts/DisputeManagerStorage.sol": { + "DisputeManagerV1Storage": { + "abi": [ + { + "inputs": [], + "name": "arbitrator", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "disputeDeposit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "disputePeriod", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + } + ], + "name": "disputes", + "outputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "address", + "name": "fisherman", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deposit", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "relatedDisputeId", + "type": "bytes32" + }, + { + "internalType": "enum IDisputeManager.DisputeType", + "name": "disputeType", + "type": "uint8" + }, + { + "internalType": "enum IDisputeManager.DisputeStatus", + "name": "status", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "createdAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "cancellableAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "stakeSnapshot", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "fishermanRewardCut", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maxSlashingCut", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "subgraphService", + "outputs": [ + { + "internalType": "contract ISubgraphService", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "evm": { + "bytecode": { + "functionDebugData": {}, + "generatedSources": [], + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "deployedBytecode": { + "functionDebugData": {}, + "generatedSources": [], + "immutableReferences": {}, + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "methodIdentifiers": { + "arbitrator()": "6cc6cde1", + "disputeDeposit()": "29e03ff1", + "disputePeriod()": "5bf31d4d", + "disputes(bytes32)": "11be1997", + "fishermanRewardCut()": "902a4938", + "maxSlashingCut()": "0533e1ba", + "subgraphService()": "26058249" + } + }, + "metadata": "{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"name\":\"arbitrator\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"disputeDeposit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"disputePeriod\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"disputeId\",\"type\":\"bytes32\"}],\"name\":\"disputes\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"fisherman\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"deposit\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"relatedDisputeId\",\"type\":\"bytes32\"},{\"internalType\":\"enum IDisputeManager.DisputeType\",\"name\":\"disputeType\",\"type\":\"uint8\"},{\"internalType\":\"enum IDisputeManager.DisputeStatus\",\"name\":\"status\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"createdAt\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"cancellableAt\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"stakeSnapshot\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"fishermanRewardCut\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"maxSlashingCut\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"subgraphService\",\"outputs\":[{\"internalType\":\"contract ISubgraphService\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"custom:security-contact\":\"Please email security+contracts@thegraph.com if you find any bugs. We may have an active bug bounty program.\",\"kind\":\"dev\",\"methods\":{},\"title\":\"DisputeManagerStorage\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"arbitrator()\":{\"notice\":\"The arbitrator is solely in control of arbitrating disputes\"},\"disputeDeposit()\":{\"notice\":\"Deposit required to create a Dispute\"},\"disputePeriod()\":{\"notice\":\"dispute period in seconds\"},\"disputes(bytes32)\":{\"notice\":\"List of disputes created\"},\"fishermanRewardCut()\":{\"notice\":\"Percentage of indexer slashed funds to assign as a reward to fisherman in successful dispute. In PPM.\"},\"maxSlashingCut()\":{\"notice\":\"Maximum percentage of indexer stake that can be slashed on a dispute. In PPM.\"},\"subgraphService()\":{\"notice\":\"The Subgraph Service contract address\"}},\"notice\":\"This contract holds all the storage variables for the Dispute Manager contract.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/DisputeManagerStorage.sol\":\"DisputeManagerV1Storage\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10},\"remappings\":[]},\"sources\":{\"@graphprotocol/contracts/contracts/rewards/IRewardsIssuer.sol\":{\"keccak256\":\"0xe049090c38a64d80b284ba2a7b440bcedba9804d96f2bb8da525e69ac452e03a\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://8b7d1186bd0698bed02d3504ac80c20e605087fba036d5ff392b39a9a3c818e5\",\"dweb:/ipfs/QmRgAfY1dD5rc7fLuuGVyu2mh9Z8qz1AVvuXAcRGnB3dSv\"]},\"@graphprotocol/horizon/contracts/data-service/interfaces/IDataService.sol\":{\"keccak256\":\"0x2208814f64eeca9409eafc1a1fa425c67ff38cffdffc3af0bafbe1c1b338ed32\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://925b32efbd9fe85a98f8f1f51e865e0b7b65d933196cf6c098bd670da7138e0c\",\"dweb:/ipfs/Qmdrp7BGJ4fEKzDgZpVY1FULXKsHAdGXkx4nqRrWvMaumr\"]},\"@graphprotocol/horizon/contracts/data-service/interfaces/IDataServiceFees.sol\":{\"keccak256\":\"0x1b82ae2785502fe62d3ca6f55a3ed836b8b038a3b929cced92e1c6b4733f4074\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://5556b2ce53b604427a995fb50f7169acb3fe30f60ef19c7cb5c22bd5ec53177c\",\"dweb:/ipfs/QmXx7dmTeAYAMPbbrGrcsKT31dqEqbcFgXWaPS6LQrANru\"]},\"@graphprotocol/horizon/contracts/interfaces/IGraphPayments.sol\":{\"keccak256\":\"0xa22dcc47676073113e4ebe30045065662cee5531f9c5f75776c00e70a1929c81\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://8908f30b3c7536798b14dc62fb5ccffc05570d568dbd1bade7c79c1fd2a4b5fe\",\"dweb:/ipfs/QmexZgb5mhDmXVZnYX1Z37cwM7EG2prYyBEVjUSVdKshVr\"]},\"@graphprotocol/horizon/contracts/interfaces/IHorizonStaking.sol\":{\"keccak256\":\"0x4b146f30ee66c4224cb5a82bafc8299f8596d8fe302e793757520f67bba8a166\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://30666c737d72a850223c1966d3b5d02b84f3f808f3c8dae8d0748731646b60c5\",\"dweb:/ipfs/QmQschyZQtU8tTnQ9hNiG5nobuXBx6KeiKdfxvZ4zvQ7ty\"]},\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingBase.sol\":{\"keccak256\":\"0x9bdab6cb595eabd7d321d7beae03ad3607995c14ef40f0c2f349fb72084766c5\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://6cac2ca3580bd770b98b07b11ebb007e8a922a90cde920e6ec472df7e66fb512\",\"dweb:/ipfs/QmRw1rjT8D8gNp2GRTuwDETwHNHMpHKoHZq4pYBAn9i65F\"]},\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingExtension.sol\":{\"keccak256\":\"0x7923f39746198b5672f0e4d65b7bf14903ae5f7775d74b210effb957eea36c71\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://c29531aff69c71e649fb347d7117ea8c42fc8de09860a1c389ed9b8f097a34e0\",\"dweb:/ipfs/QmS89fww584HiyE1BdPe8Xaqbf5v7FEvL38GTxeHEAsLFm\"]},\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingMain.sol\":{\"keccak256\":\"0xd04bb1f6a427e858e8a625b4b9835c69c8891a324d22beba20293ab2a77e5de7\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://05c9e425eee0b6c109a8dad2edcf9e1c845c64fccf321edf804921394ee048be\",\"dweb:/ipfs/QmbwLWNof534oG5ohzNAWrjdQ5kqJs7M5d5kCRd68XUogB\"]},\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingTypes.sol\":{\"keccak256\":\"0xaaeb9770f8aaae6b395e87bb1876a10fe7c14384d16d97dd33a671c3ea53aa7b\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://8f5c019fdb2df73bafe464fb6e9da792f7833a0c1858734bcd6a6b8d6ae924c7\",\"dweb:/ipfs/QmcubeYTHCYBqQsRncBFpPFtk7JzRz4nFh27LUW1m4hx2K\"]},\"@graphprotocol/horizon/contracts/libraries/LinkedList.sol\":{\"keccak256\":\"0x99058b4da0428b8d9c22d3d112acbaa59900f1fd0a434038b1a4fccfe3c678d6\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://568e03231c6081eacbcb6585a05c0b1bb976b640b611f7bf6155f9b58d887239\",\"dweb:/ipfs/QmdPZQWhkhjf5TUwz487Dwm4ycjX323iNdwb1sQnAiA1Qu\"]},\"@openzeppelin/contracts/utils/Panic.sol\":{\"keccak256\":\"0xf7fe324703a64fc51702311dc51562d5cb1497734f074e4f483bfb6717572d7a\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://c6a5ff4f9fd8649b7ee20800b7fa387d3465bd77cf20c2d1068cd5c98e1ed57a\",\"dweb:/ipfs/QmVSaVJf9FXFhdYEYeCEfjMVHrxDh5qL4CGkxdMWpQCrqG\"]},\"@openzeppelin/contracts/utils/math/Math.sol\":{\"keccak256\":\"0x1225214420c83ebcca88f2ae2b50f053aaa7df7bd684c3e878d334627f2edfc6\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://6c5fab4970634f9ab9a620983dc1c8a30153981a0b1a521666e269d0a11399d3\",\"dweb:/ipfs/QmVRnBC575MESGkEHndjujtR7qub2FzU9RWy9eKLp4hPZB\"]},\"@openzeppelin/contracts/utils/math/SafeCast.sol\":{\"keccak256\":\"0x195533c86d0ef72bcc06456a4f66a9b941f38eb403739b00f21fd7c1abd1ae54\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://b1d578337048cad08c1c03041cca5978eff5428aa130c781b271ad9e5566e1f8\",\"dweb:/ipfs/QmPFKL2r9CBsMwmUqqdcFPfHZB2qcs9g1HDrPxzWSxomvy\"]},\"contracts/DisputeManagerStorage.sol\":{\"keccak256\":\"0xa340be8ba8f0350d954a3b572f958eb9e1de64ebfeffd208ea3e252ebb4ebb1d\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://45658c8d8b475b52e4e97b1a9f06ab4e4205765f73fad4dda56f980d88d4f6b9\",\"dweb:/ipfs/QmQ5kS2FSxoBi2fRq7szKCNVetfwNe8DVTyDhHCnixWAdH\"]},\"contracts/interfaces/IDisputeManager.sol\":{\"keccak256\":\"0x9db8ffdf7fe30954824ed706a1a5e7c2d6323b745bddba16b7166a639344f9f7\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://e5d810bf6188c38a028dab511c5653fde7b7feca0a173f03974402a83cb234f9\",\"dweb:/ipfs/QmYGtytqHeDFK91FmSNL5iavD8sHUFcA47WBU9BuHG3i75\"]},\"contracts/interfaces/ISubgraphService.sol\":{\"keccak256\":\"0x7516f80b0a8b2e3edeedf06c9b917f2a24e557f8c00632e6150fbb41ef8da3ce\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://ad4f813111541f5ef9ea6236f42822a3a66364d24189e4568450b20e09972a5e\",\"dweb:/ipfs/QmVYQA9rT7T8YnQgAB6fokNYDJeDrgQqrjfJ8sGjySNFBo\"]},\"contracts/libraries/Allocation.sol\":{\"keccak256\":\"0xeabed16693ebd22165d4421bb62b91de64553f94d86d6fd03e3d25a62d651000\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://5beecbf35f8dc63fc9fcd5fe844ff29cb4874c1ac73a96ec7170729efd096b74\",\"dweb:/ipfs/QmPFQyxQYuwae8ARxuLxingd8fQ7GBw1cfTQuUvfo6CWhM\"]},\"contracts/libraries/Attestation.sol\":{\"keccak256\":\"0x0976f586d532d479823ac9e049371742a7a876f0faf3ed722b3b7f78a4586f33\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://34baba14bd7d3dcb1e1111ee09f3c809d6876732bbc889c1486cc329465e711e\",\"dweb:/ipfs/QmPRgYduW85aCjVk4ih35jB2FhoLjBvgmjZtMGeqXaLhTW\"]},\"contracts/libraries/LegacyAllocation.sol\":{\"keccak256\":\"0x32fd54a2823bf3fa4090bf94968b4d8a5988fee8f75d1b805591a744f5766c60\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://2571faaa157c207853cd52e730aaab019384d84618b6dce976b9d794a9634a54\",\"dweb:/ipfs/QmSinKJ1WguxvZte5C3eVfGBo8gsvzTbPQh7uVREWT49uL\"]}},\"version\":1}" + } + }, + "contracts/SubgraphService.sol": { + "SubgraphService": { + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "graphController", + "type": "address" + }, + { + "internalType": "address", + "name": "disputeManager", + "type": "address" + }, + { + "internalType": "address", + "name": "graphTallyCollector", + "type": "address" + }, + { + "internalType": "address", + "name": "curation", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + } + ], + "name": "AddressEmptyCode", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "AllocationAlreadyExists", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "internalType": "uint256", + "name": "closedAt", + "type": "uint256" + } + ], + "name": "AllocationClosed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "AllocationDoesNotExist", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "AllocationManagerAllocationClosed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "AllocationManagerAllocationSameSize", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "signer", + "type": "address" + }, + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "AllocationManagerInvalidAllocationProof", + "type": "error" + }, + { + "inputs": [], + "name": "AllocationManagerInvalidZeroAllocationId", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "claimId", + "type": "bytes32" + } + ], + "name": "DataServiceFeesClaimNotFound", + "type": "error" + }, + { + "inputs": [], + "name": "DataServiceFeesZeroTokens", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "DataServicePausableNotPauseGuardian", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "DataServicePausablePauseGuardianNoChange", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "internalType": "address", + "name": "disputeManager", + "type": "address" + } + ], + "name": "DirectoryNotDisputeManager", + "type": "error" + }, + { + "inputs": [], + "name": "ECDSAInvalidSignature", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "length", + "type": "uint256" + } + ], + "name": "ECDSAInvalidSignatureLength", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "ECDSAInvalidSignatureS", + "type": "error" + }, + { + "inputs": [], + "name": "EnforcedPause", + "type": "error" + }, + { + "inputs": [], + "name": "ExpectedPause", + "type": "error" + }, + { + "inputs": [], + "name": "FailedCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "contractName", + "type": "bytes" + } + ], + "name": "GraphDirectoryInvalidZeroAddress", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidInitialization", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "LegacyAllocationAlreadyExists", + "type": "error" + }, + { + "inputs": [], + "name": "LinkedListEmptyList", + "type": "error" + }, + { + "inputs": [], + "name": "LinkedListInvalidIterations", + "type": "error" + }, + { + "inputs": [], + "name": "LinkedListInvalidZeroId", + "type": "error" + }, + { + "inputs": [], + "name": "LinkedListMaxElementsExceeded", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "OwnableInvalidOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "OwnableUnauthorizedAccount", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "a", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "b", + "type": "uint256" + } + ], + "name": "PPMMathInvalidMulPPM", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "name": "ProvisionManagerInvalidRange", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "message", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "name": "ProvisionManagerInvalidValue", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "ProvisionManagerNotAuthorized", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + } + ], + "name": "ProvisionManagerProvisionNotFound", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokensAvailable", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokensRequired", + "type": "uint256" + } + ], + "name": "ProvisionTrackerInsufficientTokens", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "SubgraphServiceAllocationIsAltruistic", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "SubgraphServiceAllocationNotAuthorized", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "SubgraphServiceCannotForceCloseAllocation", + "type": "error" + }, + { + "inputs": [], + "name": "SubgraphServiceEmptyGeohash", + "type": "error" + }, + { + "inputs": [], + "name": "SubgraphServiceEmptyUrl", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "balanceBefore", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "balanceAfter", + "type": "uint256" + } + ], + "name": "SubgraphServiceInconsistentCollection", + "type": "error" + }, + { + "inputs": [], + "name": "SubgraphServiceIndexerAlreadyRegistered", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "providedIndexer", + "type": "address" + }, + { + "internalType": "address", + "name": "expectedIndexer", + "type": "address" + } + ], + "name": "SubgraphServiceIndexerMismatch", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + } + ], + "name": "SubgraphServiceIndexerNotRegistered", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "collectionId", + "type": "bytes32" + } + ], + "name": "SubgraphServiceInvalidCollectionId", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "curationCut", + "type": "uint256" + } + ], + "name": "SubgraphServiceInvalidCurationCut", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "paymentType", + "type": "uint8" + } + ], + "name": "SubgraphServiceInvalidPaymentType", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "ravIndexer", + "type": "address" + }, + { + "internalType": "address", + "name": "allocationIndexer", + "type": "address" + } + ], + "name": "SubgraphServiceInvalidRAV", + "type": "error" + }, + { + "inputs": [], + "name": "SubgraphServiceInvalidZeroStakeToFeesRatio", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "forceClosed", + "type": "bool" + } + ], + "name": "AllocationClosed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "currentEpoch", + "type": "uint256" + } + ], + "name": "AllocationCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newTokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldTokens", + "type": "uint256" + } + ], + "name": "AllocationResized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "curationCut", + "type": "uint256" + } + ], + "name": "CurationCutSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "ratio", + "type": "uint32" + } + ], + "name": "DelegationRatioSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "EIP712DomainChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "graphToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "graphStaking", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphPayments", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphEscrow", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "graphController", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphEpochManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphRewardsManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphTokenGateway", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphProxyAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphCuration", + "type": "address" + } + ], + "name": "GraphDirectoryInitialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensRewards", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensIndexerRewards", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensDelegationRewards", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "poi", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "poiMetadata", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "currentEpoch", + "type": "uint256" + } + ], + "name": "IndexingRewardsCollected", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + } + ], + "name": "LegacyAllocationMigrated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "maxPOIStaleness", + "type": "uint256" + } + ], + "name": "MaxPOIStalenessSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "PauseGuardianSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Paused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "paymentsDestination", + "type": "address" + } + ], + "name": "PaymentsDestinationSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + } + ], + "name": "ProvisionPendingParametersAccepted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "name": "ProvisionTokensRangeSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensCollected", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensCurators", + "type": "uint256" + } + ], + "name": "QueryFeesCollected", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "feeType", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "ServicePaymentCollected", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "ServiceProviderRegistered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "ServiceProviderSlashed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "ServiceStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "ServiceStopped", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "claimId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "unlockTimestamp", + "type": "uint256" + } + ], + "name": "StakeClaimLocked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "claimId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "releasableAt", + "type": "uint256" + } + ], + "name": "StakeClaimReleased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "claimsCount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensReleased", + "type": "uint256" + } + ], + "name": "StakeClaimsReleased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "ratio", + "type": "uint256" + } + ], + "name": "StakeToFeesRatioSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "subgraphService", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "disputeManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphTallyCollector", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "curation", + "type": "address" + } + ], + "name": "SubgraphServiceDirectoryInitialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "min", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "max", + "type": "uint64" + } + ], + "name": "ThawingPeriodRangeSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Unpaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "min", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "max", + "type": "uint32" + } + ], + "name": "VerifierCutRangeSet", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "name": "acceptProvisionPendingParameters", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + } + ], + "name": "allocationProvisionTracker", + "outputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "claimId", + "type": "bytes32" + } + ], + "name": "claims", + "outputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "createdAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "releasableAt", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "nextClaim", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + } + ], + "name": "claimsLists", + "outputs": [ + { + "internalType": "bytes32", + "name": "head", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "tail", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "count", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "closeStaleAllocation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "paymentType", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "collect", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "curationFeesCut", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "eip712Domain", + "outputs": [ + { + "internalType": "bytes1", + "name": "fields", + "type": "bytes1" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "version", + "type": "string" + }, + { + "internalType": "uint256", + "name": "chainId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "verifyingContract", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "salt", + "type": "bytes32" + }, + { + "internalType": "uint256[]", + "name": "extensions", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "encodeAllocationProof", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + } + ], + "name": "feesProvisionTracker", + "outputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "getAllocation", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "createdAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "closedAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lastPOIPresentedAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "accRewardsPerAllocatedToken", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "accRewardsPending", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "createdAtEpoch", + "type": "uint256" + } + ], + "internalType": "struct Allocation.State", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "getAllocationData", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getCuration", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getDelegationRatio", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getDisputeManager", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getGraphTallyCollector", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "getLegacyAllocation", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + } + ], + "internalType": "struct LegacyAllocation.State", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getProvisionTokensRange", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + } + ], + "name": "getSubgraphAllocatedTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getThawingPeriodRange", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getVerifierCutRange", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + } + ], + "name": "indexers", + "outputs": [ + { + "internalType": "uint256", + "name": "registeredAt", + "type": "uint256" + }, + { + "internalType": "string", + "name": "url", + "type": "string" + }, + { + "internalType": "string", + "name": "geoHash", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "uint256", + "name": "minimumProvisionTokens", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "maximumDelegationRatio", + "type": "uint32" + }, + { + "internalType": "uint256", + "name": "stakeToFeesRatio_", + "type": "uint256" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + } + ], + "name": "isOverAllocated", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maxPOIStaleness", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "subgraphDeploymentID", + "type": "bytes32" + } + ], + "name": "migrateLegacyAllocation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "name": "multicall", + "outputs": [ + { + "internalType": "bytes[]", + "name": "results", + "type": "bytes[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "pauseGuardian", + "type": "address" + } + ], + "name": "pauseGuardians", + "outputs": [ + { + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "paused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + } + ], + "name": "paymentsDestination", + "outputs": [ + { + "internalType": "address", + "name": "destination", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "register", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "numClaimsToRelease", + "type": "uint256" + } + ], + "name": "releaseStake", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "resizeAllocation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "curationCut", + "type": "uint256" + } + ], + "name": "setCurationCut", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "delegationRatio", + "type": "uint32" + } + ], + "name": "setDelegationRatio", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "maxPOIStaleness_", + "type": "uint256" + } + ], + "name": "setMaxPOIStaleness", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "minimumProvisionTokens", + "type": "uint256" + } + ], + "name": "setMinimumProvisionTokens", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "pauseGuardian", + "type": "address" + }, + { + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "setPauseGuardian", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "paymentsDestination_", + "type": "address" + } + ], + "name": "setPaymentsDestination", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "stakeToFeesRatio_", + "type": "uint256" + } + ], + "name": "setStakeToFeesRatio", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "slash", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "stakeToFeesRatio", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "startService", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "stopService", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "unpause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "evm": { + "bytecode": { + "functionDebugData": { + "@_13702": { + "entryPoint": null, + "id": 13702, + "parameterSlots": 4, + "returnSlots": 0 + }, + "@_17679": { + "entryPoint": null, + "id": 17679, + "parameterSlots": 4, + "returnSlots": 0 + }, + "@_4795": { + "entryPoint": null, + "id": 4795, + "parameterSlots": 1, + "returnSlots": 0 + }, + "@_869": { + "entryPoint": null, + "id": 869, + "parameterSlots": 1, + "returnSlots": 0 + }, + "@_disableInitializers_5345": { + "entryPoint": 1139, + "id": 5345, + "parameterSlots": 0, + "returnSlots": 0 + }, + "@_getContractFromController_4927": { + "entryPoint": 965, + "id": 4927, + "parameterSlots": 1, + "returnSlots": 1 + }, + "@_getInitializableStorage_5390": { + "entryPoint": null, + "id": 5390, + "parameterSlots": 0, + "returnSlots": 1 + }, + "@_initializableStorageSlot_5376": { + "entryPoint": null, + "id": 5376, + "parameterSlots": 0, + "returnSlots": 1 + }, + "abi_decode_address_fromMemory": { + "entryPoint": 1317, + "id": null, + "parameterSlots": 1, + "returnSlots": 1 + }, + "abi_decode_tuple_t_address_fromMemory": { + "entryPoint": 1429, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "abi_decode_tuple_t_addresst_addresst_addresst_address_fromMemory": { + "entryPoint": 1345, + "id": null, + "parameterSlots": 2, + "returnSlots": 4 + }, + "abi_encode_tuple_t_address_t_address_t_address_t_address__to_t_address_t_address_t_address_t_address__fromStack_reversed": { + "entryPoint": null, + "id": null, + "parameterSlots": 5, + "returnSlots": 1 + }, + "abi_encode_tuple_t_address_t_address_t_address_t_address_t_address_t_address_t_address__to_t_address_t_address_t_address_t_address_t_address_t_address_t_address__fromStack_reversed": { + "entryPoint": null, + "id": null, + "parameterSlots": 8, + "returnSlots": 1 + }, + "abi_encode_tuple_t_bytes32__to_t_bytes32__fromStack_reversed": { + "entryPoint": null, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "abi_encode_tuple_t_bytes_memory_ptr__to_t_bytes_memory_ptr__fromStack_reversed": { + "entryPoint": 1463, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "abi_encode_tuple_t_stringliteral_7c20e2bbcd91c5aaa7898ba022ab8867ac32d84e959c236484db066900aa363a__to_t_bytes_memory_ptr__fromStack_reversed": { + "entryPoint": null, + "id": null, + "parameterSlots": 1, + "returnSlots": 1 + }, + "abi_encode_tuple_t_uint64__to_t_uint64__fromStack_reversed": { + "entryPoint": null, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + } + }, + "generatedSources": [ + { + "ast": { + "nativeSrc": "0:3424:70", + "nodeType": "YulBlock", + "src": "0:3424:70", + "statements": [ + { + "nativeSrc": "6:3:70", + "nodeType": "YulBlock", + "src": "6:3:70", + "statements": [] + }, + { + "body": { + "nativeSrc": "74:117:70", + "nodeType": "YulBlock", + "src": "74:117:70", + "statements": [ + { + "nativeSrc": "84:22:70", + "nodeType": "YulAssignment", + "src": "84:22:70", + "value": { + "arguments": [ + { + "name": "offset", + "nativeSrc": "99:6:70", + "nodeType": "YulIdentifier", + "src": "99:6:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "93:5:70", + "nodeType": "YulIdentifier", + "src": "93:5:70" + }, + "nativeSrc": "93:13:70", + "nodeType": "YulFunctionCall", + "src": "93:13:70" + }, + "variableNames": [ + { + "name": "value", + "nativeSrc": "84:5:70", + "nodeType": "YulIdentifier", + "src": "84:5:70" + } + ] + }, + { + "body": { + "nativeSrc": "169:16:70", + "nodeType": "YulBlock", + "src": "169:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "178:1:70", + "nodeType": "YulLiteral", + "src": "178:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "181:1:70", + "nodeType": "YulLiteral", + "src": "181:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "171:6:70", + "nodeType": "YulIdentifier", + "src": "171:6:70" + }, + "nativeSrc": "171:12:70", + "nodeType": "YulFunctionCall", + "src": "171:12:70" + }, + "nativeSrc": "171:12:70", + "nodeType": "YulExpressionStatement", + "src": "171:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "value", + "nativeSrc": "128:5:70", + "nodeType": "YulIdentifier", + "src": "128:5:70" + }, + { + "arguments": [ + { + "name": "value", + "nativeSrc": "139:5:70", + "nodeType": "YulIdentifier", + "src": "139:5:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "154:3:70", + "nodeType": "YulLiteral", + "src": "154:3:70", + "type": "", + "value": "160" + }, + { + "kind": "number", + "nativeSrc": "159:1:70", + "nodeType": "YulLiteral", + "src": "159:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "150:3:70", + "nodeType": "YulIdentifier", + "src": "150:3:70" + }, + "nativeSrc": "150:11:70", + "nodeType": "YulFunctionCall", + "src": "150:11:70" + }, + { + "kind": "number", + "nativeSrc": "163:1:70", + "nodeType": "YulLiteral", + "src": "163:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "146:3:70", + "nodeType": "YulIdentifier", + "src": "146:3:70" + }, + "nativeSrc": "146:19:70", + "nodeType": "YulFunctionCall", + "src": "146:19:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "135:3:70", + "nodeType": "YulIdentifier", + "src": "135:3:70" + }, + "nativeSrc": "135:31:70", + "nodeType": "YulFunctionCall", + "src": "135:31:70" + } + ], + "functionName": { + "name": "eq", + "nativeSrc": "125:2:70", + "nodeType": "YulIdentifier", + "src": "125:2:70" + }, + "nativeSrc": "125:42:70", + "nodeType": "YulFunctionCall", + "src": "125:42:70" + } + ], + "functionName": { + "name": "iszero", + "nativeSrc": "118:6:70", + "nodeType": "YulIdentifier", + "src": "118:6:70" + }, + "nativeSrc": "118:50:70", + "nodeType": "YulFunctionCall", + "src": "118:50:70" + }, + "nativeSrc": "115:70:70", + "nodeType": "YulIf", + "src": "115:70:70" + } + ] + }, + "name": "abi_decode_address_fromMemory", + "nativeSrc": "14:177:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "offset", + "nativeSrc": "53:6:70", + "nodeType": "YulTypedName", + "src": "53:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value", + "nativeSrc": "64:5:70", + "nodeType": "YulTypedName", + "src": "64:5:70", + "type": "" + } + ], + "src": "14:177:70" + }, + { + "body": { + "nativeSrc": "328:332:70", + "nodeType": "YulBlock", + "src": "328:332:70", + "statements": [ + { + "body": { + "nativeSrc": "375:16:70", + "nodeType": "YulBlock", + "src": "375:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "384:1:70", + "nodeType": "YulLiteral", + "src": "384:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "387:1:70", + "nodeType": "YulLiteral", + "src": "387:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "377:6:70", + "nodeType": "YulIdentifier", + "src": "377:6:70" + }, + "nativeSrc": "377:12:70", + "nodeType": "YulFunctionCall", + "src": "377:12:70" + }, + "nativeSrc": "377:12:70", + "nodeType": "YulExpressionStatement", + "src": "377:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "dataEnd", + "nativeSrc": "349:7:70", + "nodeType": "YulIdentifier", + "src": "349:7:70" + }, + { + "name": "headStart", + "nativeSrc": "358:9:70", + "nodeType": "YulIdentifier", + "src": "358:9:70" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "345:3:70", + "nodeType": "YulIdentifier", + "src": "345:3:70" + }, + "nativeSrc": "345:23:70", + "nodeType": "YulFunctionCall", + "src": "345:23:70" + }, + { + "kind": "number", + "nativeSrc": "370:3:70", + "nodeType": "YulLiteral", + "src": "370:3:70", + "type": "", + "value": "128" + } + ], + "functionName": { + "name": "slt", + "nativeSrc": "341:3:70", + "nodeType": "YulIdentifier", + "src": "341:3:70" + }, + "nativeSrc": "341:33:70", + "nodeType": "YulFunctionCall", + "src": "341:33:70" + }, + "nativeSrc": "338:53:70", + "nodeType": "YulIf", + "src": "338:53:70" + }, + { + "nativeSrc": "400:50:70", + "nodeType": "YulAssignment", + "src": "400:50:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "440:9:70", + "nodeType": "YulIdentifier", + "src": "440:9:70" + } + ], + "functionName": { + "name": "abi_decode_address_fromMemory", + "nativeSrc": "410:29:70", + "nodeType": "YulIdentifier", + "src": "410:29:70" + }, + "nativeSrc": "410:40:70", + "nodeType": "YulFunctionCall", + "src": "410:40:70" + }, + "variableNames": [ + { + "name": "value0", + "nativeSrc": "400:6:70", + "nodeType": "YulIdentifier", + "src": "400:6:70" + } + ] + }, + { + "nativeSrc": "459:59:70", + "nodeType": "YulAssignment", + "src": "459:59:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "503:9:70", + "nodeType": "YulIdentifier", + "src": "503:9:70" + }, + { + "kind": "number", + "nativeSrc": "514:2:70", + "nodeType": "YulLiteral", + "src": "514:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "499:3:70", + "nodeType": "YulIdentifier", + "src": "499:3:70" + }, + "nativeSrc": "499:18:70", + "nodeType": "YulFunctionCall", + "src": "499:18:70" + } + ], + "functionName": { + "name": "abi_decode_address_fromMemory", + "nativeSrc": "469:29:70", + "nodeType": "YulIdentifier", + "src": "469:29:70" + }, + "nativeSrc": "469:49:70", + "nodeType": "YulFunctionCall", + "src": "469:49:70" + }, + "variableNames": [ + { + "name": "value1", + "nativeSrc": "459:6:70", + "nodeType": "YulIdentifier", + "src": "459:6:70" + } + ] + }, + { + "nativeSrc": "527:59:70", + "nodeType": "YulAssignment", + "src": "527:59:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "571:9:70", + "nodeType": "YulIdentifier", + "src": "571:9:70" + }, + { + "kind": "number", + "nativeSrc": "582:2:70", + "nodeType": "YulLiteral", + "src": "582:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "567:3:70", + "nodeType": "YulIdentifier", + "src": "567:3:70" + }, + "nativeSrc": "567:18:70", + "nodeType": "YulFunctionCall", + "src": "567:18:70" + } + ], + "functionName": { + "name": "abi_decode_address_fromMemory", + "nativeSrc": "537:29:70", + "nodeType": "YulIdentifier", + "src": "537:29:70" + }, + "nativeSrc": "537:49:70", + "nodeType": "YulFunctionCall", + "src": "537:49:70" + }, + "variableNames": [ + { + "name": "value2", + "nativeSrc": "527:6:70", + "nodeType": "YulIdentifier", + "src": "527:6:70" + } + ] + }, + { + "nativeSrc": "595:59:70", + "nodeType": "YulAssignment", + "src": "595:59:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "639:9:70", + "nodeType": "YulIdentifier", + "src": "639:9:70" + }, + { + "kind": "number", + "nativeSrc": "650:2:70", + "nodeType": "YulLiteral", + "src": "650:2:70", + "type": "", + "value": "96" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "635:3:70", + "nodeType": "YulIdentifier", + "src": "635:3:70" + }, + "nativeSrc": "635:18:70", + "nodeType": "YulFunctionCall", + "src": "635:18:70" + } + ], + "functionName": { + "name": "abi_decode_address_fromMemory", + "nativeSrc": "605:29:70", + "nodeType": "YulIdentifier", + "src": "605:29:70" + }, + "nativeSrc": "605:49:70", + "nodeType": "YulFunctionCall", + "src": "605:49:70" + }, + "variableNames": [ + { + "name": "value3", + "nativeSrc": "595:6:70", + "nodeType": "YulIdentifier", + "src": "595:6:70" + } + ] + } + ] + }, + "name": "abi_decode_tuple_t_addresst_addresst_addresst_address_fromMemory", + "nativeSrc": "196:464:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "270:9:70", + "nodeType": "YulTypedName", + "src": "270:9:70", + "type": "" + }, + { + "name": "dataEnd", + "nativeSrc": "281:7:70", + "nodeType": "YulTypedName", + "src": "281:7:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value0", + "nativeSrc": "293:6:70", + "nodeType": "YulTypedName", + "src": "293:6:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "301:6:70", + "nodeType": "YulTypedName", + "src": "301:6:70", + "type": "" + }, + { + "name": "value2", + "nativeSrc": "309:6:70", + "nodeType": "YulTypedName", + "src": "309:6:70", + "type": "" + }, + { + "name": "value3", + "nativeSrc": "317:6:70", + "nodeType": "YulTypedName", + "src": "317:6:70", + "type": "" + } + ], + "src": "196:464:70" + }, + { + "body": { + "nativeSrc": "838:160:70", + "nodeType": "YulBlock", + "src": "838:160:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "855:9:70", + "nodeType": "YulIdentifier", + "src": "855:9:70" + }, + { + "kind": "number", + "nativeSrc": "866:2:70", + "nodeType": "YulLiteral", + "src": "866:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "848:6:70", + "nodeType": "YulIdentifier", + "src": "848:6:70" + }, + "nativeSrc": "848:21:70", + "nodeType": "YulFunctionCall", + "src": "848:21:70" + }, + "nativeSrc": "848:21:70", + "nodeType": "YulExpressionStatement", + "src": "848:21:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "889:9:70", + "nodeType": "YulIdentifier", + "src": "889:9:70" + }, + { + "kind": "number", + "nativeSrc": "900:2:70", + "nodeType": "YulLiteral", + "src": "900:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "885:3:70", + "nodeType": "YulIdentifier", + "src": "885:3:70" + }, + "nativeSrc": "885:18:70", + "nodeType": "YulFunctionCall", + "src": "885:18:70" + }, + { + "kind": "number", + "nativeSrc": "905:2:70", + "nodeType": "YulLiteral", + "src": "905:2:70", + "type": "", + "value": "10" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "878:6:70", + "nodeType": "YulIdentifier", + "src": "878:6:70" + }, + "nativeSrc": "878:30:70", + "nodeType": "YulFunctionCall", + "src": "878:30:70" + }, + "nativeSrc": "878:30:70", + "nodeType": "YulExpressionStatement", + "src": "878:30:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "928:9:70", + "nodeType": "YulIdentifier", + "src": "928:9:70" + }, + { + "kind": "number", + "nativeSrc": "939:2:70", + "nodeType": "YulLiteral", + "src": "939:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "924:3:70", + "nodeType": "YulIdentifier", + "src": "924:3:70" + }, + "nativeSrc": "924:18:70", + "nodeType": "YulFunctionCall", + "src": "924:18:70" + }, + { + "hexValue": "436f6e74726f6c6c6572", + "kind": "string", + "nativeSrc": "944:12:70", + "nodeType": "YulLiteral", + "src": "944:12:70", + "type": "", + "value": "Controller" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "917:6:70", + "nodeType": "YulIdentifier", + "src": "917:6:70" + }, + "nativeSrc": "917:40:70", + "nodeType": "YulFunctionCall", + "src": "917:40:70" + }, + "nativeSrc": "917:40:70", + "nodeType": "YulExpressionStatement", + "src": "917:40:70" + }, + { + "nativeSrc": "966:26:70", + "nodeType": "YulAssignment", + "src": "966:26:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "978:9:70", + "nodeType": "YulIdentifier", + "src": "978:9:70" + }, + { + "kind": "number", + "nativeSrc": "989:2:70", + "nodeType": "YulLiteral", + "src": "989:2:70", + "type": "", + "value": "96" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "974:3:70", + "nodeType": "YulIdentifier", + "src": "974:3:70" + }, + "nativeSrc": "974:18:70", + "nodeType": "YulFunctionCall", + "src": "974:18:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "966:4:70", + "nodeType": "YulIdentifier", + "src": "966:4:70" + } + ] + } + ] + }, + "name": "abi_encode_tuple_t_stringliteral_7c20e2bbcd91c5aaa7898ba022ab8867ac32d84e959c236484db066900aa363a__to_t_bytes_memory_ptr__fromStack_reversed", + "nativeSrc": "665:333:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "815:9:70", + "nodeType": "YulTypedName", + "src": "815:9:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "829:4:70", + "nodeType": "YulTypedName", + "src": "829:4:70", + "type": "" + } + ], + "src": "665:333:70" + }, + { + "body": { + "nativeSrc": "1272:520:70", + "nodeType": "YulBlock", + "src": "1272:520:70", + "statements": [ + { + "nativeSrc": "1282:27:70", + "nodeType": "YulAssignment", + "src": "1282:27:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "1294:9:70", + "nodeType": "YulIdentifier", + "src": "1294:9:70" + }, + { + "kind": "number", + "nativeSrc": "1305:3:70", + "nodeType": "YulLiteral", + "src": "1305:3:70", + "type": "", + "value": "224" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "1290:3:70", + "nodeType": "YulIdentifier", + "src": "1290:3:70" + }, + "nativeSrc": "1290:19:70", + "nodeType": "YulFunctionCall", + "src": "1290:19:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "1282:4:70", + "nodeType": "YulIdentifier", + "src": "1282:4:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "1325:9:70", + "nodeType": "YulIdentifier", + "src": "1325:9:70" + }, + { + "arguments": [ + { + "name": "value0", + "nativeSrc": "1340:6:70", + "nodeType": "YulIdentifier", + "src": "1340:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "1356:3:70", + "nodeType": "YulLiteral", + "src": "1356:3:70", + "type": "", + "value": "160" + }, + { + "kind": "number", + "nativeSrc": "1361:1:70", + "nodeType": "YulLiteral", + "src": "1361:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "1352:3:70", + "nodeType": "YulIdentifier", + "src": "1352:3:70" + }, + "nativeSrc": "1352:11:70", + "nodeType": "YulFunctionCall", + "src": "1352:11:70" + }, + { + "kind": "number", + "nativeSrc": "1365:1:70", + "nodeType": "YulLiteral", + "src": "1365:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "1348:3:70", + "nodeType": "YulIdentifier", + "src": "1348:3:70" + }, + "nativeSrc": "1348:19:70", + "nodeType": "YulFunctionCall", + "src": "1348:19:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "1336:3:70", + "nodeType": "YulIdentifier", + "src": "1336:3:70" + }, + "nativeSrc": "1336:32:70", + "nodeType": "YulFunctionCall", + "src": "1336:32:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "1318:6:70", + "nodeType": "YulIdentifier", + "src": "1318:6:70" + }, + "nativeSrc": "1318:51:70", + "nodeType": "YulFunctionCall", + "src": "1318:51:70" + }, + "nativeSrc": "1318:51:70", + "nodeType": "YulExpressionStatement", + "src": "1318:51:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "1389:9:70", + "nodeType": "YulIdentifier", + "src": "1389:9:70" + }, + { + "kind": "number", + "nativeSrc": "1400:2:70", + "nodeType": "YulLiteral", + "src": "1400:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "1385:3:70", + "nodeType": "YulIdentifier", + "src": "1385:3:70" + }, + "nativeSrc": "1385:18:70", + "nodeType": "YulFunctionCall", + "src": "1385:18:70" + }, + { + "arguments": [ + { + "name": "value1", + "nativeSrc": "1409:6:70", + "nodeType": "YulIdentifier", + "src": "1409:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "1425:3:70", + "nodeType": "YulLiteral", + "src": "1425:3:70", + "type": "", + "value": "160" + }, + { + "kind": "number", + "nativeSrc": "1430:1:70", + "nodeType": "YulLiteral", + "src": "1430:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "1421:3:70", + "nodeType": "YulIdentifier", + "src": "1421:3:70" + }, + "nativeSrc": "1421:11:70", + "nodeType": "YulFunctionCall", + "src": "1421:11:70" + }, + { + "kind": "number", + "nativeSrc": "1434:1:70", + "nodeType": "YulLiteral", + "src": "1434:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "1417:3:70", + "nodeType": "YulIdentifier", + "src": "1417:3:70" + }, + "nativeSrc": "1417:19:70", + "nodeType": "YulFunctionCall", + "src": "1417:19:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "1405:3:70", + "nodeType": "YulIdentifier", + "src": "1405:3:70" + }, + "nativeSrc": "1405:32:70", + "nodeType": "YulFunctionCall", + "src": "1405:32:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "1378:6:70", + "nodeType": "YulIdentifier", + "src": "1378:6:70" + }, + "nativeSrc": "1378:60:70", + "nodeType": "YulFunctionCall", + "src": "1378:60:70" + }, + "nativeSrc": "1378:60:70", + "nodeType": "YulExpressionStatement", + "src": "1378:60:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "1458:9:70", + "nodeType": "YulIdentifier", + "src": "1458:9:70" + }, + { + "kind": "number", + "nativeSrc": "1469:2:70", + "nodeType": "YulLiteral", + "src": "1469:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "1454:3:70", + "nodeType": "YulIdentifier", + "src": "1454:3:70" + }, + "nativeSrc": "1454:18:70", + "nodeType": "YulFunctionCall", + "src": "1454:18:70" + }, + { + "arguments": [ + { + "name": "value2", + "nativeSrc": "1478:6:70", + "nodeType": "YulIdentifier", + "src": "1478:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "1494:3:70", + "nodeType": "YulLiteral", + "src": "1494:3:70", + "type": "", + "value": "160" + }, + { + "kind": "number", + "nativeSrc": "1499:1:70", + "nodeType": "YulLiteral", + "src": "1499:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "1490:3:70", + "nodeType": "YulIdentifier", + "src": "1490:3:70" + }, + "nativeSrc": "1490:11:70", + "nodeType": "YulFunctionCall", + "src": "1490:11:70" + }, + { + "kind": "number", + "nativeSrc": "1503:1:70", + "nodeType": "YulLiteral", + "src": "1503:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "1486:3:70", + "nodeType": "YulIdentifier", + "src": "1486:3:70" + }, + "nativeSrc": "1486:19:70", + "nodeType": "YulFunctionCall", + "src": "1486:19:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "1474:3:70", + "nodeType": "YulIdentifier", + "src": "1474:3:70" + }, + "nativeSrc": "1474:32:70", + "nodeType": "YulFunctionCall", + "src": "1474:32:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "1447:6:70", + "nodeType": "YulIdentifier", + "src": "1447:6:70" + }, + "nativeSrc": "1447:60:70", + "nodeType": "YulFunctionCall", + "src": "1447:60:70" + }, + "nativeSrc": "1447:60:70", + "nodeType": "YulExpressionStatement", + "src": "1447:60:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "1527:9:70", + "nodeType": "YulIdentifier", + "src": "1527:9:70" + }, + { + "kind": "number", + "nativeSrc": "1538:2:70", + "nodeType": "YulLiteral", + "src": "1538:2:70", + "type": "", + "value": "96" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "1523:3:70", + "nodeType": "YulIdentifier", + "src": "1523:3:70" + }, + "nativeSrc": "1523:18:70", + "nodeType": "YulFunctionCall", + "src": "1523:18:70" + }, + { + "arguments": [ + { + "name": "value3", + "nativeSrc": "1547:6:70", + "nodeType": "YulIdentifier", + "src": "1547:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "1563:3:70", + "nodeType": "YulLiteral", + "src": "1563:3:70", + "type": "", + "value": "160" + }, + { + "kind": "number", + "nativeSrc": "1568:1:70", + "nodeType": "YulLiteral", + "src": "1568:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "1559:3:70", + "nodeType": "YulIdentifier", + "src": "1559:3:70" + }, + "nativeSrc": "1559:11:70", + "nodeType": "YulFunctionCall", + "src": "1559:11:70" + }, + { + "kind": "number", + "nativeSrc": "1572:1:70", + "nodeType": "YulLiteral", + "src": "1572:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "1555:3:70", + "nodeType": "YulIdentifier", + "src": "1555:3:70" + }, + "nativeSrc": "1555:19:70", + "nodeType": "YulFunctionCall", + "src": "1555:19:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "1543:3:70", + "nodeType": "YulIdentifier", + "src": "1543:3:70" + }, + "nativeSrc": "1543:32:70", + "nodeType": "YulFunctionCall", + "src": "1543:32:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "1516:6:70", + "nodeType": "YulIdentifier", + "src": "1516:6:70" + }, + "nativeSrc": "1516:60:70", + "nodeType": "YulFunctionCall", + "src": "1516:60:70" + }, + "nativeSrc": "1516:60:70", + "nodeType": "YulExpressionStatement", + "src": "1516:60:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "1596:9:70", + "nodeType": "YulIdentifier", + "src": "1596:9:70" + }, + { + "kind": "number", + "nativeSrc": "1607:3:70", + "nodeType": "YulLiteral", + "src": "1607:3:70", + "type": "", + "value": "128" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "1592:3:70", + "nodeType": "YulIdentifier", + "src": "1592:3:70" + }, + "nativeSrc": "1592:19:70", + "nodeType": "YulFunctionCall", + "src": "1592:19:70" + }, + { + "arguments": [ + { + "name": "value4", + "nativeSrc": "1617:6:70", + "nodeType": "YulIdentifier", + "src": "1617:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "1633:3:70", + "nodeType": "YulLiteral", + "src": "1633:3:70", + "type": "", + "value": "160" + }, + { + "kind": "number", + "nativeSrc": "1638:1:70", + "nodeType": "YulLiteral", + "src": "1638:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "1629:3:70", + "nodeType": "YulIdentifier", + "src": "1629:3:70" + }, + "nativeSrc": "1629:11:70", + "nodeType": "YulFunctionCall", + "src": "1629:11:70" + }, + { + "kind": "number", + "nativeSrc": "1642:1:70", + "nodeType": "YulLiteral", + "src": "1642:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "1625:3:70", + "nodeType": "YulIdentifier", + "src": "1625:3:70" + }, + "nativeSrc": "1625:19:70", + "nodeType": "YulFunctionCall", + "src": "1625:19:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "1613:3:70", + "nodeType": "YulIdentifier", + "src": "1613:3:70" + }, + "nativeSrc": "1613:32:70", + "nodeType": "YulFunctionCall", + "src": "1613:32:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "1585:6:70", + "nodeType": "YulIdentifier", + "src": "1585:6:70" + }, + "nativeSrc": "1585:61:70", + "nodeType": "YulFunctionCall", + "src": "1585:61:70" + }, + "nativeSrc": "1585:61:70", + "nodeType": "YulExpressionStatement", + "src": "1585:61:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "1666:9:70", + "nodeType": "YulIdentifier", + "src": "1666:9:70" + }, + { + "kind": "number", + "nativeSrc": "1677:3:70", + "nodeType": "YulLiteral", + "src": "1677:3:70", + "type": "", + "value": "160" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "1662:3:70", + "nodeType": "YulIdentifier", + "src": "1662:3:70" + }, + "nativeSrc": "1662:19:70", + "nodeType": "YulFunctionCall", + "src": "1662:19:70" + }, + { + "arguments": [ + { + "name": "value5", + "nativeSrc": "1687:6:70", + "nodeType": "YulIdentifier", + "src": "1687:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "1703:3:70", + "nodeType": "YulLiteral", + "src": "1703:3:70", + "type": "", + "value": "160" + }, + { + "kind": "number", + "nativeSrc": "1708:1:70", + "nodeType": "YulLiteral", + "src": "1708:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "1699:3:70", + "nodeType": "YulIdentifier", + "src": "1699:3:70" + }, + "nativeSrc": "1699:11:70", + "nodeType": "YulFunctionCall", + "src": "1699:11:70" + }, + { + "kind": "number", + "nativeSrc": "1712:1:70", + "nodeType": "YulLiteral", + "src": "1712:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "1695:3:70", + "nodeType": "YulIdentifier", + "src": "1695:3:70" + }, + "nativeSrc": "1695:19:70", + "nodeType": "YulFunctionCall", + "src": "1695:19:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "1683:3:70", + "nodeType": "YulIdentifier", + "src": "1683:3:70" + }, + "nativeSrc": "1683:32:70", + "nodeType": "YulFunctionCall", + "src": "1683:32:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "1655:6:70", + "nodeType": "YulIdentifier", + "src": "1655:6:70" + }, + "nativeSrc": "1655:61:70", + "nodeType": "YulFunctionCall", + "src": "1655:61:70" + }, + "nativeSrc": "1655:61:70", + "nodeType": "YulExpressionStatement", + "src": "1655:61:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "1736:9:70", + "nodeType": "YulIdentifier", + "src": "1736:9:70" + }, + { + "kind": "number", + "nativeSrc": "1747:3:70", + "nodeType": "YulLiteral", + "src": "1747:3:70", + "type": "", + "value": "192" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "1732:3:70", + "nodeType": "YulIdentifier", + "src": "1732:3:70" + }, + "nativeSrc": "1732:19:70", + "nodeType": "YulFunctionCall", + "src": "1732:19:70" + }, + { + "arguments": [ + { + "name": "value6", + "nativeSrc": "1757:6:70", + "nodeType": "YulIdentifier", + "src": "1757:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "1773:3:70", + "nodeType": "YulLiteral", + "src": "1773:3:70", + "type": "", + "value": "160" + }, + { + "kind": "number", + "nativeSrc": "1778:1:70", + "nodeType": "YulLiteral", + "src": "1778:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "1769:3:70", + "nodeType": "YulIdentifier", + "src": "1769:3:70" + }, + "nativeSrc": "1769:11:70", + "nodeType": "YulFunctionCall", + "src": "1769:11:70" + }, + { + "kind": "number", + "nativeSrc": "1782:1:70", + "nodeType": "YulLiteral", + "src": "1782:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "1765:3:70", + "nodeType": "YulIdentifier", + "src": "1765:3:70" + }, + "nativeSrc": "1765:19:70", + "nodeType": "YulFunctionCall", + "src": "1765:19:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "1753:3:70", + "nodeType": "YulIdentifier", + "src": "1753:3:70" + }, + "nativeSrc": "1753:32:70", + "nodeType": "YulFunctionCall", + "src": "1753:32:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "1725:6:70", + "nodeType": "YulIdentifier", + "src": "1725:6:70" + }, + "nativeSrc": "1725:61:70", + "nodeType": "YulFunctionCall", + "src": "1725:61:70" + }, + "nativeSrc": "1725:61:70", + "nodeType": "YulExpressionStatement", + "src": "1725:61:70" + } + ] + }, + "name": "abi_encode_tuple_t_address_t_address_t_address_t_address_t_address_t_address_t_address__to_t_address_t_address_t_address_t_address_t_address_t_address_t_address__fromStack_reversed", + "nativeSrc": "1003:789:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "1193:9:70", + "nodeType": "YulTypedName", + "src": "1193:9:70", + "type": "" + }, + { + "name": "value6", + "nativeSrc": "1204:6:70", + "nodeType": "YulTypedName", + "src": "1204:6:70", + "type": "" + }, + { + "name": "value5", + "nativeSrc": "1212:6:70", + "nodeType": "YulTypedName", + "src": "1212:6:70", + "type": "" + }, + { + "name": "value4", + "nativeSrc": "1220:6:70", + "nodeType": "YulTypedName", + "src": "1220:6:70", + "type": "" + }, + { + "name": "value3", + "nativeSrc": "1228:6:70", + "nodeType": "YulTypedName", + "src": "1228:6:70", + "type": "" + }, + { + "name": "value2", + "nativeSrc": "1236:6:70", + "nodeType": "YulTypedName", + "src": "1236:6:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "1244:6:70", + "nodeType": "YulTypedName", + "src": "1244:6:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "1252:6:70", + "nodeType": "YulTypedName", + "src": "1252:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "1263:4:70", + "nodeType": "YulTypedName", + "src": "1263:4:70", + "type": "" + } + ], + "src": "1003:789:70" + }, + { + "body": { + "nativeSrc": "1982:310:70", + "nodeType": "YulBlock", + "src": "1982:310:70", + "statements": [ + { + "nativeSrc": "1992:27:70", + "nodeType": "YulAssignment", + "src": "1992:27:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "2004:9:70", + "nodeType": "YulIdentifier", + "src": "2004:9:70" + }, + { + "kind": "number", + "nativeSrc": "2015:3:70", + "nodeType": "YulLiteral", + "src": "2015:3:70", + "type": "", + "value": "128" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "2000:3:70", + "nodeType": "YulIdentifier", + "src": "2000:3:70" + }, + "nativeSrc": "2000:19:70", + "nodeType": "YulFunctionCall", + "src": "2000:19:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "1992:4:70", + "nodeType": "YulIdentifier", + "src": "1992:4:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "2035:9:70", + "nodeType": "YulIdentifier", + "src": "2035:9:70" + }, + { + "arguments": [ + { + "name": "value0", + "nativeSrc": "2050:6:70", + "nodeType": "YulIdentifier", + "src": "2050:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "2066:3:70", + "nodeType": "YulLiteral", + "src": "2066:3:70", + "type": "", + "value": "160" + }, + { + "kind": "number", + "nativeSrc": "2071:1:70", + "nodeType": "YulLiteral", + "src": "2071:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "2062:3:70", + "nodeType": "YulIdentifier", + "src": "2062:3:70" + }, + "nativeSrc": "2062:11:70", + "nodeType": "YulFunctionCall", + "src": "2062:11:70" + }, + { + "kind": "number", + "nativeSrc": "2075:1:70", + "nodeType": "YulLiteral", + "src": "2075:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "2058:3:70", + "nodeType": "YulIdentifier", + "src": "2058:3:70" + }, + "nativeSrc": "2058:19:70", + "nodeType": "YulFunctionCall", + "src": "2058:19:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "2046:3:70", + "nodeType": "YulIdentifier", + "src": "2046:3:70" + }, + "nativeSrc": "2046:32:70", + "nodeType": "YulFunctionCall", + "src": "2046:32:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "2028:6:70", + "nodeType": "YulIdentifier", + "src": "2028:6:70" + }, + "nativeSrc": "2028:51:70", + "nodeType": "YulFunctionCall", + "src": "2028:51:70" + }, + "nativeSrc": "2028:51:70", + "nodeType": "YulExpressionStatement", + "src": "2028:51:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "2099:9:70", + "nodeType": "YulIdentifier", + "src": "2099:9:70" + }, + { + "kind": "number", + "nativeSrc": "2110:2:70", + "nodeType": "YulLiteral", + "src": "2110:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "2095:3:70", + "nodeType": "YulIdentifier", + "src": "2095:3:70" + }, + "nativeSrc": "2095:18:70", + "nodeType": "YulFunctionCall", + "src": "2095:18:70" + }, + { + "arguments": [ + { + "name": "value1", + "nativeSrc": "2119:6:70", + "nodeType": "YulIdentifier", + "src": "2119:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "2135:3:70", + "nodeType": "YulLiteral", + "src": "2135:3:70", + "type": "", + "value": "160" + }, + { + "kind": "number", + "nativeSrc": "2140:1:70", + "nodeType": "YulLiteral", + "src": "2140:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "2131:3:70", + "nodeType": "YulIdentifier", + "src": "2131:3:70" + }, + "nativeSrc": "2131:11:70", + "nodeType": "YulFunctionCall", + "src": "2131:11:70" + }, + { + "kind": "number", + "nativeSrc": "2144:1:70", + "nodeType": "YulLiteral", + "src": "2144:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "2127:3:70", + "nodeType": "YulIdentifier", + "src": "2127:3:70" + }, + "nativeSrc": "2127:19:70", + "nodeType": "YulFunctionCall", + "src": "2127:19:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "2115:3:70", + "nodeType": "YulIdentifier", + "src": "2115:3:70" + }, + "nativeSrc": "2115:32:70", + "nodeType": "YulFunctionCall", + "src": "2115:32:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "2088:6:70", + "nodeType": "YulIdentifier", + "src": "2088:6:70" + }, + "nativeSrc": "2088:60:70", + "nodeType": "YulFunctionCall", + "src": "2088:60:70" + }, + "nativeSrc": "2088:60:70", + "nodeType": "YulExpressionStatement", + "src": "2088:60:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "2168:9:70", + "nodeType": "YulIdentifier", + "src": "2168:9:70" + }, + { + "kind": "number", + "nativeSrc": "2179:2:70", + "nodeType": "YulLiteral", + "src": "2179:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "2164:3:70", + "nodeType": "YulIdentifier", + "src": "2164:3:70" + }, + "nativeSrc": "2164:18:70", + "nodeType": "YulFunctionCall", + "src": "2164:18:70" + }, + { + "arguments": [ + { + "name": "value2", + "nativeSrc": "2188:6:70", + "nodeType": "YulIdentifier", + "src": "2188:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "2204:3:70", + "nodeType": "YulLiteral", + "src": "2204:3:70", + "type": "", + "value": "160" + }, + { + "kind": "number", + "nativeSrc": "2209:1:70", + "nodeType": "YulLiteral", + "src": "2209:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "2200:3:70", + "nodeType": "YulIdentifier", + "src": "2200:3:70" + }, + "nativeSrc": "2200:11:70", + "nodeType": "YulFunctionCall", + "src": "2200:11:70" + }, + { + "kind": "number", + "nativeSrc": "2213:1:70", + "nodeType": "YulLiteral", + "src": "2213:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "2196:3:70", + "nodeType": "YulIdentifier", + "src": "2196:3:70" + }, + "nativeSrc": "2196:19:70", + "nodeType": "YulFunctionCall", + "src": "2196:19:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "2184:3:70", + "nodeType": "YulIdentifier", + "src": "2184:3:70" + }, + "nativeSrc": "2184:32:70", + "nodeType": "YulFunctionCall", + "src": "2184:32:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "2157:6:70", + "nodeType": "YulIdentifier", + "src": "2157:6:70" + }, + "nativeSrc": "2157:60:70", + "nodeType": "YulFunctionCall", + "src": "2157:60:70" + }, + "nativeSrc": "2157:60:70", + "nodeType": "YulExpressionStatement", + "src": "2157:60:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "2237:9:70", + "nodeType": "YulIdentifier", + "src": "2237:9:70" + }, + { + "kind": "number", + "nativeSrc": "2248:2:70", + "nodeType": "YulLiteral", + "src": "2248:2:70", + "type": "", + "value": "96" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "2233:3:70", + "nodeType": "YulIdentifier", + "src": "2233:3:70" + }, + "nativeSrc": "2233:18:70", + "nodeType": "YulFunctionCall", + "src": "2233:18:70" + }, + { + "arguments": [ + { + "name": "value3", + "nativeSrc": "2257:6:70", + "nodeType": "YulIdentifier", + "src": "2257:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "2273:3:70", + "nodeType": "YulLiteral", + "src": "2273:3:70", + "type": "", + "value": "160" + }, + { + "kind": "number", + "nativeSrc": "2278:1:70", + "nodeType": "YulLiteral", + "src": "2278:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "2269:3:70", + "nodeType": "YulIdentifier", + "src": "2269:3:70" + }, + "nativeSrc": "2269:11:70", + "nodeType": "YulFunctionCall", + "src": "2269:11:70" + }, + { + "kind": "number", + "nativeSrc": "2282:1:70", + "nodeType": "YulLiteral", + "src": "2282:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "2265:3:70", + "nodeType": "YulIdentifier", + "src": "2265:3:70" + }, + "nativeSrc": "2265:19:70", + "nodeType": "YulFunctionCall", + "src": "2265:19:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "2253:3:70", + "nodeType": "YulIdentifier", + "src": "2253:3:70" + }, + "nativeSrc": "2253:32:70", + "nodeType": "YulFunctionCall", + "src": "2253:32:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "2226:6:70", + "nodeType": "YulIdentifier", + "src": "2226:6:70" + }, + "nativeSrc": "2226:60:70", + "nodeType": "YulFunctionCall", + "src": "2226:60:70" + }, + "nativeSrc": "2226:60:70", + "nodeType": "YulExpressionStatement", + "src": "2226:60:70" + } + ] + }, + "name": "abi_encode_tuple_t_address_t_address_t_address_t_address__to_t_address_t_address_t_address_t_address__fromStack_reversed", + "nativeSrc": "1797:495:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "1927:9:70", + "nodeType": "YulTypedName", + "src": "1927:9:70", + "type": "" + }, + { + "name": "value3", + "nativeSrc": "1938:6:70", + "nodeType": "YulTypedName", + "src": "1938:6:70", + "type": "" + }, + { + "name": "value2", + "nativeSrc": "1946:6:70", + "nodeType": "YulTypedName", + "src": "1946:6:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "1954:6:70", + "nodeType": "YulTypedName", + "src": "1954:6:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "1962:6:70", + "nodeType": "YulTypedName", + "src": "1962:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "1973:4:70", + "nodeType": "YulTypedName", + "src": "1973:4:70", + "type": "" + } + ], + "src": "1797:495:70" + }, + { + "body": { + "nativeSrc": "2398:76:70", + "nodeType": "YulBlock", + "src": "2398:76:70", + "statements": [ + { + "nativeSrc": "2408:26:70", + "nodeType": "YulAssignment", + "src": "2408:26:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "2420:9:70", + "nodeType": "YulIdentifier", + "src": "2420:9:70" + }, + { + "kind": "number", + "nativeSrc": "2431:2:70", + "nodeType": "YulLiteral", + "src": "2431:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "2416:3:70", + "nodeType": "YulIdentifier", + "src": "2416:3:70" + }, + "nativeSrc": "2416:18:70", + "nodeType": "YulFunctionCall", + "src": "2416:18:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "2408:4:70", + "nodeType": "YulIdentifier", + "src": "2408:4:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "2450:9:70", + "nodeType": "YulIdentifier", + "src": "2450:9:70" + }, + { + "name": "value0", + "nativeSrc": "2461:6:70", + "nodeType": "YulIdentifier", + "src": "2461:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "2443:6:70", + "nodeType": "YulIdentifier", + "src": "2443:6:70" + }, + "nativeSrc": "2443:25:70", + "nodeType": "YulFunctionCall", + "src": "2443:25:70" + }, + "nativeSrc": "2443:25:70", + "nodeType": "YulExpressionStatement", + "src": "2443:25:70" + } + ] + }, + "name": "abi_encode_tuple_t_bytes32__to_t_bytes32__fromStack_reversed", + "nativeSrc": "2297:177:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "2367:9:70", + "nodeType": "YulTypedName", + "src": "2367:9:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "2378:6:70", + "nodeType": "YulTypedName", + "src": "2378:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "2389:4:70", + "nodeType": "YulTypedName", + "src": "2389:4:70", + "type": "" + } + ], + "src": "2297:177:70" + }, + { + "body": { + "nativeSrc": "2560:127:70", + "nodeType": "YulBlock", + "src": "2560:127:70", + "statements": [ + { + "body": { + "nativeSrc": "2606:16:70", + "nodeType": "YulBlock", + "src": "2606:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "2615:1:70", + "nodeType": "YulLiteral", + "src": "2615:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "2618:1:70", + "nodeType": "YulLiteral", + "src": "2618:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "2608:6:70", + "nodeType": "YulIdentifier", + "src": "2608:6:70" + }, + "nativeSrc": "2608:12:70", + "nodeType": "YulFunctionCall", + "src": "2608:12:70" + }, + "nativeSrc": "2608:12:70", + "nodeType": "YulExpressionStatement", + "src": "2608:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "dataEnd", + "nativeSrc": "2581:7:70", + "nodeType": "YulIdentifier", + "src": "2581:7:70" + }, + { + "name": "headStart", + "nativeSrc": "2590:9:70", + "nodeType": "YulIdentifier", + "src": "2590:9:70" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "2577:3:70", + "nodeType": "YulIdentifier", + "src": "2577:3:70" + }, + "nativeSrc": "2577:23:70", + "nodeType": "YulFunctionCall", + "src": "2577:23:70" + }, + { + "kind": "number", + "nativeSrc": "2602:2:70", + "nodeType": "YulLiteral", + "src": "2602:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "slt", + "nativeSrc": "2573:3:70", + "nodeType": "YulIdentifier", + "src": "2573:3:70" + }, + "nativeSrc": "2573:32:70", + "nodeType": "YulFunctionCall", + "src": "2573:32:70" + }, + "nativeSrc": "2570:52:70", + "nodeType": "YulIf", + "src": "2570:52:70" + }, + { + "nativeSrc": "2631:50:70", + "nodeType": "YulAssignment", + "src": "2631:50:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "2671:9:70", + "nodeType": "YulIdentifier", + "src": "2671:9:70" + } + ], + "functionName": { + "name": "abi_decode_address_fromMemory", + "nativeSrc": "2641:29:70", + "nodeType": "YulIdentifier", + "src": "2641:29:70" + }, + "nativeSrc": "2641:40:70", + "nodeType": "YulFunctionCall", + "src": "2641:40:70" + }, + "variableNames": [ + { + "name": "value0", + "nativeSrc": "2631:6:70", + "nodeType": "YulIdentifier", + "src": "2631:6:70" + } + ] + } + ] + }, + "name": "abi_decode_tuple_t_address_fromMemory", + "nativeSrc": "2479:208:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "2526:9:70", + "nodeType": "YulTypedName", + "src": "2526:9:70", + "type": "" + }, + { + "name": "dataEnd", + "nativeSrc": "2537:7:70", + "nodeType": "YulTypedName", + "src": "2537:7:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value0", + "nativeSrc": "2549:6:70", + "nodeType": "YulTypedName", + "src": "2549:6:70", + "type": "" + } + ], + "src": "2479:208:70" + }, + { + "body": { + "nativeSrc": "2811:406:70", + "nodeType": "YulBlock", + "src": "2811:406:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "2828:9:70", + "nodeType": "YulIdentifier", + "src": "2828:9:70" + }, + { + "kind": "number", + "nativeSrc": "2839:2:70", + "nodeType": "YulLiteral", + "src": "2839:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "2821:6:70", + "nodeType": "YulIdentifier", + "src": "2821:6:70" + }, + "nativeSrc": "2821:21:70", + "nodeType": "YulFunctionCall", + "src": "2821:21:70" + }, + "nativeSrc": "2821:21:70", + "nodeType": "YulExpressionStatement", + "src": "2821:21:70" + }, + { + "nativeSrc": "2851:27:70", + "nodeType": "YulVariableDeclaration", + "src": "2851:27:70", + "value": { + "arguments": [ + { + "name": "value0", + "nativeSrc": "2871:6:70", + "nodeType": "YulIdentifier", + "src": "2871:6:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "2865:5:70", + "nodeType": "YulIdentifier", + "src": "2865:5:70" + }, + "nativeSrc": "2865:13:70", + "nodeType": "YulFunctionCall", + "src": "2865:13:70" + }, + "variables": [ + { + "name": "length", + "nativeSrc": "2855:6:70", + "nodeType": "YulTypedName", + "src": "2855:6:70", + "type": "" + } + ] + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "2898:9:70", + "nodeType": "YulIdentifier", + "src": "2898:9:70" + }, + { + "kind": "number", + "nativeSrc": "2909:2:70", + "nodeType": "YulLiteral", + "src": "2909:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "2894:3:70", + "nodeType": "YulIdentifier", + "src": "2894:3:70" + }, + "nativeSrc": "2894:18:70", + "nodeType": "YulFunctionCall", + "src": "2894:18:70" + }, + { + "name": "length", + "nativeSrc": "2914:6:70", + "nodeType": "YulIdentifier", + "src": "2914:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "2887:6:70", + "nodeType": "YulIdentifier", + "src": "2887:6:70" + }, + "nativeSrc": "2887:34:70", + "nodeType": "YulFunctionCall", + "src": "2887:34:70" + }, + "nativeSrc": "2887:34:70", + "nodeType": "YulExpressionStatement", + "src": "2887:34:70" + }, + { + "nativeSrc": "2930:10:70", + "nodeType": "YulVariableDeclaration", + "src": "2930:10:70", + "value": { + "kind": "number", + "nativeSrc": "2939:1:70", + "nodeType": "YulLiteral", + "src": "2939:1:70", + "type": "", + "value": "0" + }, + "variables": [ + { + "name": "i", + "nativeSrc": "2934:1:70", + "nodeType": "YulTypedName", + "src": "2934:1:70", + "type": "" + } + ] + }, + { + "body": { + "nativeSrc": "2999:90:70", + "nodeType": "YulBlock", + "src": "2999:90:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "3028:9:70", + "nodeType": "YulIdentifier", + "src": "3028:9:70" + }, + { + "name": "i", + "nativeSrc": "3039:1:70", + "nodeType": "YulIdentifier", + "src": "3039:1:70" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "3024:3:70", + "nodeType": "YulIdentifier", + "src": "3024:3:70" + }, + "nativeSrc": "3024:17:70", + "nodeType": "YulFunctionCall", + "src": "3024:17:70" + }, + { + "kind": "number", + "nativeSrc": "3043:2:70", + "nodeType": "YulLiteral", + "src": "3043:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "3020:3:70", + "nodeType": "YulIdentifier", + "src": "3020:3:70" + }, + "nativeSrc": "3020:26:70", + "nodeType": "YulFunctionCall", + "src": "3020:26:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "arguments": [ + { + "name": "value0", + "nativeSrc": "3062:6:70", + "nodeType": "YulIdentifier", + "src": "3062:6:70" + }, + { + "name": "i", + "nativeSrc": "3070:1:70", + "nodeType": "YulIdentifier", + "src": "3070:1:70" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "3058:3:70", + "nodeType": "YulIdentifier", + "src": "3058:3:70" + }, + "nativeSrc": "3058:14:70", + "nodeType": "YulFunctionCall", + "src": "3058:14:70" + }, + { + "kind": "number", + "nativeSrc": "3074:2:70", + "nodeType": "YulLiteral", + "src": "3074:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "3054:3:70", + "nodeType": "YulIdentifier", + "src": "3054:3:70" + }, + "nativeSrc": "3054:23:70", + "nodeType": "YulFunctionCall", + "src": "3054:23:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "3048:5:70", + "nodeType": "YulIdentifier", + "src": "3048:5:70" + }, + "nativeSrc": "3048:30:70", + "nodeType": "YulFunctionCall", + "src": "3048:30:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "3013:6:70", + "nodeType": "YulIdentifier", + "src": "3013:6:70" + }, + "nativeSrc": "3013:66:70", + "nodeType": "YulFunctionCall", + "src": "3013:66:70" + }, + "nativeSrc": "3013:66:70", + "nodeType": "YulExpressionStatement", + "src": "3013:66:70" + } + ] + }, + "condition": { + "arguments": [ + { + "name": "i", + "nativeSrc": "2960:1:70", + "nodeType": "YulIdentifier", + "src": "2960:1:70" + }, + { + "name": "length", + "nativeSrc": "2963:6:70", + "nodeType": "YulIdentifier", + "src": "2963:6:70" + } + ], + "functionName": { + "name": "lt", + "nativeSrc": "2957:2:70", + "nodeType": "YulIdentifier", + "src": "2957:2:70" + }, + "nativeSrc": "2957:13:70", + "nodeType": "YulFunctionCall", + "src": "2957:13:70" + }, + "nativeSrc": "2949:140:70", + "nodeType": "YulForLoop", + "post": { + "nativeSrc": "2971:19:70", + "nodeType": "YulBlock", + "src": "2971:19:70", + "statements": [ + { + "nativeSrc": "2973:15:70", + "nodeType": "YulAssignment", + "src": "2973:15:70", + "value": { + "arguments": [ + { + "name": "i", + "nativeSrc": "2982:1:70", + "nodeType": "YulIdentifier", + "src": "2982:1:70" + }, + { + "kind": "number", + "nativeSrc": "2985:2:70", + "nodeType": "YulLiteral", + "src": "2985:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "2978:3:70", + "nodeType": "YulIdentifier", + "src": "2978:3:70" + }, + "nativeSrc": "2978:10:70", + "nodeType": "YulFunctionCall", + "src": "2978:10:70" + }, + "variableNames": [ + { + "name": "i", + "nativeSrc": "2973:1:70", + "nodeType": "YulIdentifier", + "src": "2973:1:70" + } + ] + } + ] + }, + "pre": { + "nativeSrc": "2953:3:70", + "nodeType": "YulBlock", + "src": "2953:3:70", + "statements": [] + }, + "src": "2949:140:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "3113:9:70", + "nodeType": "YulIdentifier", + "src": "3113:9:70" + }, + { + "name": "length", + "nativeSrc": "3124:6:70", + "nodeType": "YulIdentifier", + "src": "3124:6:70" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "3109:3:70", + "nodeType": "YulIdentifier", + "src": "3109:3:70" + }, + "nativeSrc": "3109:22:70", + "nodeType": "YulFunctionCall", + "src": "3109:22:70" + }, + { + "kind": "number", + "nativeSrc": "3133:2:70", + "nodeType": "YulLiteral", + "src": "3133:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "3105:3:70", + "nodeType": "YulIdentifier", + "src": "3105:3:70" + }, + "nativeSrc": "3105:31:70", + "nodeType": "YulFunctionCall", + "src": "3105:31:70" + }, + { + "kind": "number", + "nativeSrc": "3138:1:70", + "nodeType": "YulLiteral", + "src": "3138:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "3098:6:70", + "nodeType": "YulIdentifier", + "src": "3098:6:70" + }, + "nativeSrc": "3098:42:70", + "nodeType": "YulFunctionCall", + "src": "3098:42:70" + }, + "nativeSrc": "3098:42:70", + "nodeType": "YulExpressionStatement", + "src": "3098:42:70" + }, + { + "nativeSrc": "3149:62:70", + "nodeType": "YulAssignment", + "src": "3149:62:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "3165:9:70", + "nodeType": "YulIdentifier", + "src": "3165:9:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "name": "length", + "nativeSrc": "3184:6:70", + "nodeType": "YulIdentifier", + "src": "3184:6:70" + }, + { + "kind": "number", + "nativeSrc": "3192:2:70", + "nodeType": "YulLiteral", + "src": "3192:2:70", + "type": "", + "value": "31" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "3180:3:70", + "nodeType": "YulIdentifier", + "src": "3180:3:70" + }, + "nativeSrc": "3180:15:70", + "nodeType": "YulFunctionCall", + "src": "3180:15:70" + }, + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "3201:2:70", + "nodeType": "YulLiteral", + "src": "3201:2:70", + "type": "", + "value": "31" + } + ], + "functionName": { + "name": "not", + "nativeSrc": "3197:3:70", + "nodeType": "YulIdentifier", + "src": "3197:3:70" + }, + "nativeSrc": "3197:7:70", + "nodeType": "YulFunctionCall", + "src": "3197:7:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "3176:3:70", + "nodeType": "YulIdentifier", + "src": "3176:3:70" + }, + "nativeSrc": "3176:29:70", + "nodeType": "YulFunctionCall", + "src": "3176:29:70" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "3161:3:70", + "nodeType": "YulIdentifier", + "src": "3161:3:70" + }, + "nativeSrc": "3161:45:70", + "nodeType": "YulFunctionCall", + "src": "3161:45:70" + }, + { + "kind": "number", + "nativeSrc": "3208:2:70", + "nodeType": "YulLiteral", + "src": "3208:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "3157:3:70", + "nodeType": "YulIdentifier", + "src": "3157:3:70" + }, + "nativeSrc": "3157:54:70", + "nodeType": "YulFunctionCall", + "src": "3157:54:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "3149:4:70", + "nodeType": "YulIdentifier", + "src": "3149:4:70" + } + ] + } + ] + }, + "name": "abi_encode_tuple_t_bytes_memory_ptr__to_t_bytes_memory_ptr__fromStack_reversed", + "nativeSrc": "2692:525:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "2780:9:70", + "nodeType": "YulTypedName", + "src": "2780:9:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "2791:6:70", + "nodeType": "YulTypedName", + "src": "2791:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "2802:4:70", + "nodeType": "YulTypedName", + "src": "2802:4:70", + "type": "" + } + ], + "src": "2692:525:70" + }, + { + "body": { + "nativeSrc": "3321:101:70", + "nodeType": "YulBlock", + "src": "3321:101:70", + "statements": [ + { + "nativeSrc": "3331:26:70", + "nodeType": "YulAssignment", + "src": "3331:26:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "3343:9:70", + "nodeType": "YulIdentifier", + "src": "3343:9:70" + }, + { + "kind": "number", + "nativeSrc": "3354:2:70", + "nodeType": "YulLiteral", + "src": "3354:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "3339:3:70", + "nodeType": "YulIdentifier", + "src": "3339:3:70" + }, + "nativeSrc": "3339:18:70", + "nodeType": "YulFunctionCall", + "src": "3339:18:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "3331:4:70", + "nodeType": "YulIdentifier", + "src": "3331:4:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "3373:9:70", + "nodeType": "YulIdentifier", + "src": "3373:9:70" + }, + { + "arguments": [ + { + "name": "value0", + "nativeSrc": "3388:6:70", + "nodeType": "YulIdentifier", + "src": "3388:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "3404:2:70", + "nodeType": "YulLiteral", + "src": "3404:2:70", + "type": "", + "value": "64" + }, + { + "kind": "number", + "nativeSrc": "3408:1:70", + "nodeType": "YulLiteral", + "src": "3408:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "3400:3:70", + "nodeType": "YulIdentifier", + "src": "3400:3:70" + }, + "nativeSrc": "3400:10:70", + "nodeType": "YulFunctionCall", + "src": "3400:10:70" + }, + { + "kind": "number", + "nativeSrc": "3412:1:70", + "nodeType": "YulLiteral", + "src": "3412:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "3396:3:70", + "nodeType": "YulIdentifier", + "src": "3396:3:70" + }, + "nativeSrc": "3396:18:70", + "nodeType": "YulFunctionCall", + "src": "3396:18:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "3384:3:70", + "nodeType": "YulIdentifier", + "src": "3384:3:70" + }, + "nativeSrc": "3384:31:70", + "nodeType": "YulFunctionCall", + "src": "3384:31:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "3366:6:70", + "nodeType": "YulIdentifier", + "src": "3366:6:70" + }, + "nativeSrc": "3366:50:70", + "nodeType": "YulFunctionCall", + "src": "3366:50:70" + }, + "nativeSrc": "3366:50:70", + "nodeType": "YulExpressionStatement", + "src": "3366:50:70" + } + ] + }, + "name": "abi_encode_tuple_t_uint64__to_t_uint64__fromStack_reversed", + "nativeSrc": "3222:200:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "3290:9:70", + "nodeType": "YulTypedName", + "src": "3290:9:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "3301:6:70", + "nodeType": "YulTypedName", + "src": "3301:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "3312:4:70", + "nodeType": "YulTypedName", + "src": "3312:4:70", + "type": "" + } + ], + "src": "3222:200:70" + } + ] + }, + "contents": "{\n { }\n function abi_decode_address_fromMemory(offset) -> value\n {\n value := mload(offset)\n if iszero(eq(value, and(value, sub(shl(160, 1), 1)))) { revert(0, 0) }\n }\n function abi_decode_tuple_t_addresst_addresst_addresst_address_fromMemory(headStart, dataEnd) -> value0, value1, value2, value3\n {\n if slt(sub(dataEnd, headStart), 128) { revert(0, 0) }\n value0 := abi_decode_address_fromMemory(headStart)\n value1 := abi_decode_address_fromMemory(add(headStart, 32))\n value2 := abi_decode_address_fromMemory(add(headStart, 64))\n value3 := abi_decode_address_fromMemory(add(headStart, 96))\n }\n function abi_encode_tuple_t_stringliteral_7c20e2bbcd91c5aaa7898ba022ab8867ac32d84e959c236484db066900aa363a__to_t_bytes_memory_ptr__fromStack_reversed(headStart) -> tail\n {\n mstore(headStart, 32)\n mstore(add(headStart, 32), 10)\n mstore(add(headStart, 64), \"Controller\")\n tail := add(headStart, 96)\n }\n function abi_encode_tuple_t_address_t_address_t_address_t_address_t_address_t_address_t_address__to_t_address_t_address_t_address_t_address_t_address_t_address_t_address__fromStack_reversed(headStart, value6, value5, value4, value3, value2, value1, value0) -> tail\n {\n tail := add(headStart, 224)\n mstore(headStart, and(value0, sub(shl(160, 1), 1)))\n mstore(add(headStart, 32), and(value1, sub(shl(160, 1), 1)))\n mstore(add(headStart, 64), and(value2, sub(shl(160, 1), 1)))\n mstore(add(headStart, 96), and(value3, sub(shl(160, 1), 1)))\n mstore(add(headStart, 128), and(value4, sub(shl(160, 1), 1)))\n mstore(add(headStart, 160), and(value5, sub(shl(160, 1), 1)))\n mstore(add(headStart, 192), and(value6, sub(shl(160, 1), 1)))\n }\n function abi_encode_tuple_t_address_t_address_t_address_t_address__to_t_address_t_address_t_address_t_address__fromStack_reversed(headStart, value3, value2, value1, value0) -> tail\n {\n tail := add(headStart, 128)\n mstore(headStart, and(value0, sub(shl(160, 1), 1)))\n mstore(add(headStart, 32), and(value1, sub(shl(160, 1), 1)))\n mstore(add(headStart, 64), and(value2, sub(shl(160, 1), 1)))\n mstore(add(headStart, 96), and(value3, sub(shl(160, 1), 1)))\n }\n function abi_encode_tuple_t_bytes32__to_t_bytes32__fromStack_reversed(headStart, value0) -> tail\n {\n tail := add(headStart, 32)\n mstore(headStart, value0)\n }\n function abi_decode_tuple_t_address_fromMemory(headStart, dataEnd) -> value0\n {\n if slt(sub(dataEnd, headStart), 32) { revert(0, 0) }\n value0 := abi_decode_address_fromMemory(headStart)\n }\n function abi_encode_tuple_t_bytes_memory_ptr__to_t_bytes_memory_ptr__fromStack_reversed(headStart, value0) -> tail\n {\n mstore(headStart, 32)\n let length := mload(value0)\n mstore(add(headStart, 32), length)\n let i := 0\n for { } lt(i, length) { i := add(i, 32) }\n {\n mstore(add(add(headStart, i), 64), mload(add(add(value0, i), 32)))\n }\n mstore(add(add(headStart, length), 64), 0)\n tail := add(add(headStart, and(add(length, 31), not(31))), 64)\n }\n function abi_encode_tuple_t_uint64__to_t_uint64__fromStack_reversed(headStart, value0) -> tail\n {\n tail := add(headStart, 32)\n mstore(headStart, and(value0, sub(shl(64, 1), 1)))\n }\n}", + "id": 70, + "language": "Yul", + "name": "#utility.yul" + } + ], + "linkReferences": {}, + "object": "61024060405234801561001157600080fd5b5060405161667738038061667783398101604081905261003091610541565b3083838387806001600160a01b03811661007f5760405163218f5add60e11b815260206004820152600a60248201526921b7b73a3937b63632b960b11b60448201526064015b60405180910390fd5b6001600160a01b0381166101005260408051808201909152600a81526923b930b8342a37b5b2b760b11b60208201526100b7906103c5565b6001600160a01b03166080526040805180820190915260078152665374616b696e6760c81b60208201526100ea906103c5565b6001600160a01b031660a05260408051808201909152600d81526c47726170685061796d656e747360981b6020820152610123906103c5565b6001600160a01b031660c05260408051808201909152600e81526d5061796d656e7473457363726f7760901b602082015261015d906103c5565b6001600160a01b031660e05260408051808201909152600c81526b22b837b1b426b0b730b3b2b960a11b6020820152610195906103c5565b6001600160a01b03166101205260408051808201909152600e81526d2932bbb0b93239a6b0b730b3b2b960911b60208201526101d0906103c5565b6001600160a01b0316610140526040805180820190915260118152704772617068546f6b656e4761746577617960781b602082015261020e906103c5565b6001600160a01b03166101605260408051808201909152600f81526e23b930b834283937bc3ca0b236b4b760891b602082015261024a906103c5565b6001600160a01b03166101805260408051808201909152600881526721bab930ba34b7b760c11b602082015261027f906103c5565b6001600160a01b039081166101a08190526101005160a05160805160c05160e05161012051610140516101605161018051604051988b169a9788169996909716977fef5021414834d86e36470f5c1cecf6544fb2bb723f2ca51a4c86fcd8c5919a43976103299790916001600160a01b03978816815295871660208701529386166040860152918516606085015284166080840152831660a083015290911660c082015260e00190565b60405180910390a450506001600160a01b038481166101c08190528482166101e08190528483166102008190529284166102208190526040805193845260208401929092529082019290925260608101919091527f4175b2c37456dbac494e08de8666d31bb8f3f2aee36ea5d9e06894ff3e4ddda79060800160405180910390a1505050506103bc61047360201b60201c565b50505050610605565b600080610100516001600160a01b031663f7641a5e84805190602001206040518263ffffffff1660e01b815260040161040091815260200190565b602060405180830381865afa15801561041d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104419190610595565b9050826001600160a01b03821661046c5760405163218f5add60e11b815260040161007691906105b7565b5092915050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff16156104c35760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b03908116146105225780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b80516001600160a01b038116811461053c57600080fd5b919050565b6000806000806080858703121561055757600080fd5b61056085610525565b935061056e60208601610525565b925061057c60408601610525565b915061058a60608601610525565b905092959194509250565b6000602082840312156105a757600080fd5b6105b082610525565b9392505050565b602081526000825180602084015260005b818110156105e557602081860181015160408684010152016105c8565b506000604082850101526040601f19601f83011684010191505092915050565b60805160a05160c05160e05161010051610120516101405161016051610180516101a0516101c0516101e0516102005161022051615fd961069e6000396000612ee2015260006132de01526000818161163b0152612fe101526000505060005050600050506000505060006137080152600061457c01526000505060005050600050506000611b6b01526000613a640152615fd96000f3fe608060405234801561001057600080fd5b506004361061023b5760003560e01c806307e736d8146102405780630e02292314610280578063138dea081461030857806313c474c9146103205780631dd42f60146103755780631ebb7c301461038a57806324b8fbf6146103af57806335577962146103c25780633f4ba83a146103d557806345f54485146103dd578063482468b7146103f05780634f793cdc1461040657806355c85269146104285780635c975abb146104725780636234e2161461048a5780636ccec5b8146104aa5780636d9a3951146104bd578063715018a61461053857806371ce020a146105405780637aa31bce146105565780637dfe6d28146105695780637e89bac31461057c5780638180083b1461058f578063819ba366146105a257806381e777a7146105b8578063832bc923146105cb5780638456cb59146105de57806384b0196e146105e657806385e82baf146106015780638da5cb5b1461060a5780639384e07814610612578063ac9650d814610635578063b15d2a2c14610655578063ba38f67d14610668578063c0f474971461067b578063c84a5ef314610683578063cb8347fe14610696578063cbe5f3f2146106a9578063ce0fc0cc146106c9578063ce56c98b146106dc578063d07a7a84146106ef578063db9bee46146106f9578063dedf672614610701578063e2e1e8e914610714578063e6f5005414610734578063ebf6ddaf14610747578063ec9c218d1461074f578063eff0f59214610762578063f2fde38b14610797575b600080fd5b61026a61024e36600461502b565b610109602052600090815260409020546001600160a01b031681565b6040516102779190615048565b60405180910390f35b61029361028e36600461502b565b6107aa565b604051610277919060006101208201905060018060a01b0383511682526020830151602083015260408301516040830152606083015160608301526080830151608083015260a083015160a083015260c083015160c083015260e083015160e083015261010083015161010083015292915050565b6103126101085481565b604051908152602001610277565b61035561032e36600461502b565b609c6020526000908152604090208054600182015460028301546003909301549192909184565b604080519485526020850193909352918301526060820152608001610277565b61038861038336600461506e565b610837565b005b600254600160c01b900463ffffffff1660405163ffffffff9091168152602001610277565b6103886103bd3660046150cc565b610850565b6103886103d036600461512e565b610a7d565b610388610a93565b6103886103eb366004615167565b610acf565b6103f8610ad9565b604051610277929190615180565b61041961041436600461502b565b610aec565b604051610277939291906151e7565b61043b61043636600461502b565b610c20565b6040805196151587526001600160a01b039095166020870152938501929092526060840152608083015260a082015260c001610277565b61047a610cdc565b6040519015158152602001610277565b61031261049836600461502b565b60d16020526000908152604090205481565b6103886104b836600461502b565b610cf1565b6105146104cb36600461502b565b604080518082018252600080825260209182018190526001600160a01b03938416815260d082528290208251808401909352805490931682526001909201549181019190915290565b6040805182516001600160a01b031681526020928301519281019290925201610277565b610388610cfb565b610548610d0d565b60405161027792919061521c565b610388610564366004615167565b610d18565b610388610577366004615236565b610d29565b61038861058a366004615167565b610d41565b61038861059d3660046150cc565b610db6565b6105aa610f44565b604051610277929190615277565b6103886105c6366004615236565b610f54565b6103886105d9366004615167565b6110c4565b6103886110d8565b6105ee611112565b6040516102779796959493929190615285565b61031260d25481565b61026a6111bb565b61047a61062036600461502b565b60676020526000908152604090205460ff1681565b61064861064336600461531d565b6111d6565b6040516102779190615392565b6103126106633660046153f7565b6112be565b61047a61067636600461502b565b611492565b61026a6114b0565b61038861069136600461545f565b6114ba565b6103886106a43660046150cc565b611638565b6103126106b736600461502b565b609a6020526000908152604090205481565b6103886106d73660046150cc565b611777565b6103126106ea3660046154a7565b611860565b6103126101075481565b61026a611873565b61038861070f3660046150cc565b61187d565b610312610722366004615167565b600090815260d3602052604090205490565b610388610742366004615167565b611a0b565b61026a611a1c565b61038861075d36600461502b565b611a26565b610355610770366004615167565b609b6020526000908152604090208054600182015460028301546003909301549192909184565b6103886107a536600461502b565b611aa8565b6107b2614fae565b506001600160a01b03908116600090815260cf6020908152604091829020825161012081018452815490941684526001810154918401919091526002810154918301919091526003810154606083015260048101546080830152600581015460a0830152600681015460c0830152600781015460e08301526008015461010082015290565b61083f611ae3565b61084881611b15565b50565b905090565b82610859611b69565b6001600160a01b0316637c145cc78230336040518463ffffffff1660e01b8152600401610888939291906154d5565b602060405180830381865afa1580156108a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108c991906154f8565b813390916108f55760405163cc5d3c8b60e01b81526004016108ec929190615515565b60405180910390fd5b505083600061090382611b8d565b905061090e81611c90565b610919816000611cce565b610921611db8565b6000808061093187890189615646565b925092509250600083511161095957604051630783843960e51b815260040160405180910390fd5b600082511161097b57604051631e63bd9560e21b815260040160405180910390fd5b6001600160a01b03891660009081526101066020526040902054156109b357604051630d06866d60e21b815260040160405180910390fd5b6040805160608101825242815260208082018681528284018690526001600160a01b038d16600090815261010690925292902081518155915190919060018201906109fe9082615742565b5060408201516002820190610a139082615742565b5050506001600160a01b03811615610a2f57610a2f8982611dde565b886001600160a01b03167f159567bea25499a91f60e1fbb349ff2a1f8c1b2883198f25c1e12c99eddb44fa8989604051610a6a929190615800565b60405180910390a2505050505050505050565b610a85611ae3565b610a8f8282611e35565b5050565b3360008181526067602052604090205460ff16610ac4576040516372e3ef9760e01b81526004016108ec9190615048565b50610acd611eeb565b565b6108483382611f37565b600080610ae4611fdd565b915091509091565b6101066020526000908152604090208054600182018054919291610b0f906156c1565b80601f0160208091040260200160405190810160405280929190818152602001828054610b3b906156c1565b8015610b885780601f10610b5d57610100808354040283529160200191610b88565b820191906000526020600020905b815481529060010190602001808311610b6b57829003601f168201915b505050505090806002018054610b9d906156c1565b80601f0160208091040260200160405190810160405280929190818152602001828054610bc9906156c1565b8015610c165780601f10610beb57610100808354040283529160200191610c16565b820191906000526020600020905b815481529060010190602001808311610bf957829003601f168201915b5050505050905083565b6001600160a01b03808216600090815260cf60209081526040808320815161012081018352815490951685526001810154928501929092526002820154908401526003810154606084015260048101546080840152600581015460a0840152600681015460c0840152600781015460e0840152600801546101008301529081908190819081908190610cb181612054565b81516020830151604084015160c085015160e090950151939c929b5090995097509195509350915050565b600080610ce7612073565b5460ff1692915050565b6108483382611dde565b610d03611ae3565b610acd6000612097565b600080610ae46120f3565b610d20611ae3565b6108488161216a565b610d31611ae3565b610d3c83838361219f565b505050565b610d49611ae3565b610d5681620f4240101590565b8190610d7857604051631c9c717b60e01b81526004016108ec91815260200190565b506101088190556040518181527f6deef78ffe3df79ae5cd8e40b842c36ac6077e13746b9b68a9f327537b01e4e9906020015b60405180910390a150565b82610dbf611b69565b6001600160a01b0316637c145cc78230336040518463ffffffff1660e01b8152600401610dee939291906154d5565b602060405180830381865afa158015610e0b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e2f91906154f8565b81339091610e525760405163cc5d3c8b60e01b81526004016108ec929190615515565b50506001600160a01b0384166000908152610106602052604090205484908190610e905760405163ee27189960e01b81526004016108ec9190615048565b50610e99611db8565b6000610ea78486018661502b565b90506001600160a01b038616610ebe60cf836121f2565b51879183916001600160a01b031614610eec5760405163c0bbff1360e01b81526004016108ec929190615515565b5050610ef9816000612277565b856001600160a01b03167f73330c218a680717e9eee625c262df66eddfdf99ecb388d25f6b32d66b9a318a8686604051610f34929190615800565b60405180910390a2505050505050565b600080610ae46000546001549091565b82610f5d611b69565b6001600160a01b0316637c145cc78230336040518463ffffffff1660e01b8152600401610f8c939291906154d5565b602060405180830381865afa158015610fa9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fcd91906154f8565b81339091610ff05760405163cc5d3c8b60e01b81526004016108ec929190615515565b5050836000610ffe82611b8d565b905061100981611c90565b611014816000611cce565b6001600160a01b03861660009081526101066020526040902054869081906110505760405163ee27189960e01b81526004016108ec9190615048565b50611059611db8565b6001600160a01b03871661106e60cf886121f2565b51889188916001600160a01b03161461109c5760405163c0bbff1360e01b81526004016108ec929190615515565b50506110bb8686600260189054906101000a900463ffffffff166123d9565b50505050505050565b6110cc611ae3565b610848816000196126d7565b3360008181526067602052604090205460ff16611109576040516372e3ef9760e01b81526004016108ec9190615048565b50610acd612746565b600060608060008060006060600061112861278d565b805490915015801561113c57506001810154155b6111805760405162461bcd60e51b81526020600482015260156024820152741152540dcc4c8e88155b9a5b9a5d1a585b1a5e9959605a1b60448201526064016108ec565b6111886127b1565b611190612852565b60408051600080825260208201909252600f60f81b9c939b5091995046985030975095509350915050565b6000806111c661286f565b546001600160a01b031692915050565b604080516000815260208101909152606090826001600160401b038111156112005761120061552f565b60405190808252806020026020018201604052801561123357816020015b606081526020019060019003908161121e5790505b50915060005b838110156112b5576112903086868481811061125757611257615858565b9050602002810190611269919061586e565b8560405160200161127c939291906158b4565b604051602081830303815290604052612893565b8382815181106112a2576112a2615858565b6020908102919091010152600101611239565b50505b92915050565b6000846112c9611b69565b6001600160a01b0316637c145cc78230336040518463ffffffff1660e01b81526004016112f8939291906154d5565b602060405180830381865afa158015611315573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061133991906154f8565b8133909161135c5760405163cc5d3c8b60e01b81526004016108ec929190615515565b505085600061136a82611b8d565b905061137581611c90565b611380816000611cce565b6001600160a01b03881660009081526101066020526040902054889081906113bc5760405163ee27189960e01b81526004016108ec9190615048565b506113c5611db8565b6000808960028111156113da576113da6158db565b036113f1576113ea8a8989612909565b9050611430565b6002896002811115611405576114056158db565b03611415576113ea8a8989612e1d565b8860405163047031cf60e41b81526004016108ec9190615913565b886002811115611442576114426158db565b8a6001600160a01b03167f54fe682bfb66381a9382e13e4b95a3dd4f960eafbae063fdea3539d144ff3ff58360405161147d91815260200190565b60405180910390a39998505050505050505050565b60006112b882600260189054906101000a900463ffffffff16612ec1565b600061084b612ee0565b60006114c4612f04565b805490915060ff600160401b82041615906001600160401b03166000811580156114eb5750825b90506000826001600160401b031660011480156115075750303b155b905081158015611515575080155b156115335760405163f92ee8a960e01b815260040160405180910390fd5b84546001600160401b0319166001178555831561155c57845460ff60401b1916600160401b1785555b61156589612f2d565b61156d612f3e565b611575612f46565b61157d612f5e565b6115c96040518060400160405280600f81526020016e53756267726170685365727669636560881b815250604051806040016040528060038152602001620312e360ec1b815250612f6e565b6115d5886000196126d7565b6115de87611b15565b6115e786612f88565b831561162d57845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b505050505050505050565b337f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03811682146116855760405163cdc0567f60e01b81526004016108ec929190615515565b50600090508061169783850185615921565b915091506116a3611b69565b6001600160a01b031663e76fede68684846116bc612fdf565b60405160e086901b6001600160e01b03191681526001600160a01b039485166004820152602481019390935260448301919091529091166064820152608401600060405180830381600087803b15801561171557600080fd5b505af1158015611729573d6000803e3d6000fd5b50505050846001600160a01b03167f02f2e74a11116e05b39159372cceb6739257b08d72f7171d208ff27bb6466c588360405161176891815260200190565b60405180910390a25050505050565b82611780611b69565b6001600160a01b0316637c145cc78230336040518463ffffffff1660e01b81526004016117af939291906154d5565b602060405180830381865afa1580156117cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117f091906154f8565b813390916118135760405163cc5d3c8b60e01b81526004016108ec929190615515565b505061181d611db8565b61182684613003565b6040516001600160a01b038516907ff53cf6521a1b5fc0c04bffa70374a4dc2e3474f2b2ac1643c3bcc54e2db4a93990600090a250505050565b600061186c8383613076565b9392505050565b600061084b612fdf565b82611886611b69565b6001600160a01b0316637c145cc78230336040518463ffffffff1660e01b81526004016118b5939291906154d5565b602060405180830381865afa1580156118d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118f691906154f8565b813390916119195760405163cc5d3c8b60e01b81526004016108ec929190615515565b505083600061192782611b8d565b905061193281611c90565b61193d816000611cce565b6001600160a01b03861660009081526101066020526040902054869081906119795760405163ee27189960e01b81526004016108ec9190615048565b50611982611db8565b6000808080611993898b018b615943565b93509350935093506119bb8b83868685600260189054906101000a900463ffffffff166130e5565b8a6001600160a01b03167fd3803eb82ef5b4cdff8646734ebbaf5b37441e96314b27ffd3d0940f12a038e78b8b6040516119f6929190615800565b60405180910390a25050505050505050505050565b611a13611ae3565b61084881612f88565b600061084b6132dc565b611a2e611db8565b6000611a3b60cf836121f2565b9050611a5260d2548261330090919063ffffffff16565b8290611a7157604051623477b560e51b81526004016108ec9190615048565b50611a7b8161333d565b158290611a9c576040516317c7b35d60e31b81526004016108ec9190615048565b50610a8f826001612277565b611ab0611ae3565b6001600160a01b038116611ada576000604051631e4fbdf760e01b81526004016108ec9190615048565b61084881612097565b33611aec6111bb565b6001600160a01b031614610acd573360405163118cdaa760e01b81526004016108ec9190615048565b6002805463ffffffff60c01b1916600160c01b63ffffffff8416908102919091179091556040519081527f472aba493f9fd1d136ec54986f619f3aa5caff964f0e731a9909fb9a1270211f90602001610dab565b7f000000000000000000000000000000000000000000000000000000000000000090565b6040805161014081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101829052610120810182905290611be6611b69565b6001600160a01b03166325d9897e84306040518363ffffffff1660e01b8152600401611c13929190615515565b61014060405180830381865afa158015611c31573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c5591906159d0565b90508060a001516001600160401b0316600014158390611c8957604051637b3c09bf60e01b81526004016108ec9190615048565b5092915050565b6020810151815161084891611ca491615845565b60005460015460405180604001604052806006815260200165746f6b656e7360d01b81525061335c565b600080611cd96120f3565b91509150600083611cee578460800151611cf4565b8460e001515b9050611d42816001600160401b0316846001600160401b0316846001600160401b03166040518060400160405280600d81526020016c1d1a185dda5b99d4195c9a5bd9609a1b81525061335c565b600080611d4d611fdd565b91509150600086611d62578760600151611d68565b8760c001515b9050611dae8163ffffffff168463ffffffff168463ffffffff166040518060400160405280600e81526020016d1b585e15995c9a599a595c90dd5d60921b81525061335c565b5050505050505050565b611dc0610cdc565b15610acd5760405163d93c066560e01b815260040160405180910390fd5b6001600160a01b038281166000818152610109602052604080822080546001600160a01b0319169486169485179055517e3215dc05a2fc4e6a1e2c2776311d207c730ee51085aae221acc5cbe6fb55c19190a35050565b6001600160a01b0382166000908152606760205260409020548290829060ff161515811514611e8a57604051635e67e54b60e01b81526001600160a01b039092166004830152151560248201526044016108ec565b50506001600160a01b038216600081815260676020908152604091829020805460ff191685151590811790915591519182527fa95bac2f3df0d40e8278281c1d39d53c60e4f2bf3550ca5665738d0916e89789910160405180910390a25050565b611ef3613390565b6000611efd612073565b805460ff1916815590507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b604051610dab9190615048565b6001600160a01b0382166000818152609c60209081526040808320815192830184905282820194909452805180830382018152606090920190528190611f8b9084906133b5906133ca906134c590896134ea565b91509150846001600160a01b03167f13f3fa9f0e54af1af76d8b5d11c3973d7c2aed6312b61efff2f7b49d73ad67eb8383806020019051810190611fcf9190615a7d565b604051611768929190615277565b600080611fe8612fdf565b6001600160a01b031663bb2a2b476040518163ffffffff1660e01b8152600401602060405180830381865afa158015612025573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120499190615a96565b92620f424092509050565b60006120638260600151151590565b80156112b8575050608001511590565b7fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f0330090565b60006120a161286f565b80546001600160a01b038481166001600160a01b031983168117845560405193945091169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b6000806000612100612fdf565b6001600160a01b0316635aea0ec46040518163ffffffff1660e01b8152600401602060405180830381865afa15801561213d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121619190615ab3565b93849350915050565b60d28190556040518181527f21774046e2611ddb52c8c46e1ad97524eeb2e3fda7dcd9428867868b4c4d06ba90602001610dab565b6121ac60d08484846135a4565b80826001600160a01b0316846001600160a01b03167fd54c7abc930f6d506da2d08aa7aead4f2443e1db6d5f560384a2f652ff893e1960405160405180910390a4505050565b6121fa614fae565b6122048383613653565b604080516101208101825282546001600160a01b03168152600183015460208201526002830154918101919091526003820154606082015260048201546080820152600582015460a0820152600682015460c0820152600782015460e08201526008909101546101008201529392505050565b600061228460cf846121f2565b905061230f83612292613706565b6001600160a01b031663eeac3e0e84602001516040518263ffffffff1660e01b81526004016122c391815260200190565b6020604051808303816000875af11580156122e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123069190615a7d565b60cf919061372a565b61231a60cf846137dd565b8051604082015161232d9160d191613893565b806040015160d3600083602001518152602001908152602001600020546123549190615845565b60d3600083602001518152602001908152602001600020819055508060200151836001600160a01b031682600001516001600160a01b03167f08f2f865e0fb62d722a51e4d9873199bf6bf52e7d8ee5a2ee2896c9ef719f5458460400151866040516123cc9291909182521515602082015260400190565b60405180910390a4505050565b60006123e660cf856121f2565b90506123f181612054565b849061241157604051631eb5ff9560e01b81526004016108ec9190615048565b5080604001518314158484909161243d5760405163f32518cd60e01b81526004016108ec929190615ad0565b50506040810151808411156124735761246e612457611b69565b83516124638488615845565b60d192919087613911565b61248c565b815161248c906124838684615845565b60d19190613893565b6000612496613706565b6001600160a01b031663eeac3e0e84602001516040518263ffffffff1660e01b81526004016124c791815260200190565b6020604051808303816000875af11580156124e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061250a9190615a7d565b905060006125178461333d565b15612523576000612532565b60c08401516125329083615845565b6001600160a01b038816600090815260cf60205260409020600281018890556006018390559050612561613706565b6001600160a01b031663c8a5f81e84836040518363ffffffff1660e01b815260040161258e929190615277565b602060405180830381865afa1580156125ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125cf9190615a7d565b6001600160a01b038816600090815260cf6020526040812060070180549091906125fa908490615ae9565b909155505082861115612642576126118387615845565b60d360008660200151815260200190815260200160002060008282546126379190615ae9565b909155506126789050565b61264c8684615845565b60d360008660200151815260200190815260200160002060008282546126729190615845565b90915550505b8360200151876001600160a01b031685600001516001600160a01b03167f6db4a6f9be2d5e72eb2a2af2374ac487971bf342a261ba0bc1cf471bf2a2c31f89876040516126c6929190615277565b60405180910390a450505050505050565b8181808211156126fc5760405163ccccdafb60e01b81526004016108ec929190615277565b5050600082905560018190556040517f90699b8b4bf48918fea1129c85f9bc7b51285df7ecc982910813c7805f5688499061273a9084908490615277565b60405180910390a15050565b61274e611db8565b6000612758612073565b805460ff1916600117815590507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611f2a3390565b7fa16a46d94261c7517cc8ff89f61c0ce93598e3c849801011dee649a6a557d10090565b606060006127bd61278d565b90508060020180546127ce906156c1565b80601f01602080910402602001604051908101604052809291908181526020018280546127fa906156c1565b80156128475780601f1061281c57610100808354040283529160200191612847565b820191906000526020600020905b81548152906001019060200180831161282a57829003601f168201915b505050505091505090565b6060600061285e61278d565b90508060030180546127ce906156c1565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930090565b6060600080846001600160a01b0316846040516128b09190615afc565b600060405180830381855af49150503d80600081146128eb576040519150601f19603f3d011682016040523d82523d6000602084013e6128f0565b606091505b5091509150612900858383613a0f565b95945050505050565b6000808061291984860186615b3a565b8151604001519193509150866001600160a01b038281169082161461295357604051631a071d0760e01b81526004016108ec929190615515565b50508151516001600160a01b038111156129835760405163fa4ac7a760e01b81526004016108ec91815260200190565b50815151600061299460cf836121f2565b805190915088906001600160a01b03818116908316146129c957604051634508fbf760e11b81526004016108ec929190615515565b505060208101516129db896000611f37565b60008060006129e8613a62565b6001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401612a139190615048565b602060405180830381865afa158015612a30573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a549190615a7d565b9050612a5e6132dc565b6001600160a01b031663692209ce6000612afc8b612a7a612ee0565b6001600160a01b0316634c4ea0ed8a6040518263ffffffff1660e01b8152600401612aa791815260200190565b602060405180830381865afa158015612ac4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ae891906154f8565b612af3576000613a86565b61010854613a86565b8a6040518463ffffffff1660e01b8152600401612b1b93929190615c71565b6020604051808303816000875af1158015612b3a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b5e9190615a7d565b92506000612b6a613a62565b6001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401612b959190615048565b602060405180830381865afa158015612bb2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bd69190615a7d565b9050818181811015612bfd57604051639db8bc9560e01b81526004016108ec929190615277565b50612c0a90508282615845565b92505082159050612db457612ca98b6101075484612c289190615ca1565b612c30612fdf565b6001600160a01b0316635aea0ec46040518163ffffffff1660e01b8152600401602060405180830381865afa158015612c6d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c919190615ab3565b612ca4906001600160401b031642615ae9565b613ada565b8015612db457612cb7613706565b6001600160a01b0316631d1c2fec846040518263ffffffff1660e01b8152600401612ce491815260200190565b6020604051808303816000875af1158015612d03573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d279190615a7d565b50612d4c612d33612ee0565b82612d3c613a62565b6001600160a01b03169190613c4a565b612d54612ee0565b6001600160a01b0316638157328884836040518363ffffffff1660e01b8152600401612d81929190615277565b600060405180830381600087803b158015612d9b57600080fd5b505af1158015612daf573d6000803e3d6000fd5b505050505b86516020908101516040805186815292830185905282018390526001600160a01b038088169291811691908e16907f184c452047299395d4f7f147eb8e823458a450798539be54aeed978f13d87ba29060600160405180910390a4509998505050505050505050565b6000808080612e2e85870187615cb8565b919450925090506001600160a01b038716612e4a60cf856121f2565b51889185916001600160a01b031614612e785760405163c0bbff1360e01b81526004016108ec929190615515565b50506002546001600160a01b0388811660009081526101096020526040902054612eb692869286928692600160c01b900463ffffffff169116613cf9565b979650505050505050565b6000612ed8612ece611b69565b60d19085856142d6565b159392505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b6000807ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a006112b8565b612f35614370565b61084881614395565b610acd614370565b612f4e614370565b612f5661439d565b610acd612f3e565b612f66614370565b612f56612f3e565b612f76614370565b612f8082826143df565b610a8f612f3e565b80600003612fa95760405163bc71a04360e01b815260040160405180910390fd5b6101078190556040518181527f2aaaf20b08565eebc0c962cd7c568e54c3c0c2b85a1f942b82cd1bd730fdcd2390602001610dab565b7f000000000000000000000000000000000000000000000000000000000000000090565b61300e8160016143f1565b613016611b69565b6001600160a01b0316633a78b732826040518263ffffffff1660e01b81526004016130419190615048565b600060405180830381600087803b15801561305b57600080fd5b505af115801561306f573d6000803e3d6000fd5b5050505050565b600061186c7f4bdee85c4b4a268f4895d1096d553c3e57bb2433c380e7b7ec8cb56cc4f7467384846040516020016130ca939291909283526001600160a01b03918216602084015216604082015260600190565b60405160208183030381529060405280519060200120614408565b6001600160a01b03851661310c57604051634ffdf5ef60e11b815260040160405180910390fd5b613117868684614435565b61312b613122611b69565b60d09087614484565b600061313561457a565b6001600160a01b031663766718086040518163ffffffff1660e01b8152600401602060405180830381865afa158015613172573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131969190615a7d565b90506000613226888888886131a9613706565b6001600160a01b031663eeac3e0e8c6040518263ffffffff1660e01b81526004016131d691815260200190565b6020604051808303816000875af11580156131f5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132199190615a7d565b60cf94939291908861459e565b905061323e613233611b69565b60d1908a8887613911565b806040015160d3600083602001518152602001908152602001600020546132659190615ae9565b60d36000836020015181526020019081526020016000208190555085876001600160a01b0316896001600160a01b03167fe5e185fab2b992c4727ff702a867d78b15fb176dbaa20c9c312a1c351d3f7f838460400151866040516132ca929190615277565b60405180910390a45050505050505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b60008061331584606001518560a00151614706565b61331f9042615845565b905061332a84612054565b801561333557508281115b949350505050565b600061334c8260600151151590565b80156112b8575050604001511590565b613367848484614716565b8185858590919293611dae57604051630871e13d60e01b81526004016108ec9493929190615d10565b613398610cdc565b610acd57604051638dfc202b60e01b815260040160405180910390fd5b6000908152609b602052604090206003015490565b6000606060006133d98561472d565b90504281604001511115613401575050604080516020810190915260008152600191506134be565b600080858060200190518101906134189190615d3f565b8451919350915061342d90609a908390613893565b86816001600160a01b03167f4c06b68820628a39c787d2db1faa0eeacd7b9474847b198b1e871fe6e5b93f4485600001518660400151604051613471929190615277565b60405180910390a382516134859083615ae9565b6040805160208101929092526001600160a01b038316908201526060016040516020818303038152906040529550600086945094505050505b9250929050565b6000908152609b60205260408120818155600181018290556002810182905560030155565b60006060876003015483111561351357604051634a411b9d60e11b815260040160405180910390fd5b600083156135215783613527565b88600301545b89549094505b801580159061353c5750600085115b156135955760008061355283898c63ffffffff16565b915091508115613563575050613595565b9650866135718c8c8b6147bb565b92508661357d81615d65565b975050838061358b90615d7c565b945050505061352d565b50989397509295505050505050565b6001600160a01b0380831660009081526020868152604091829020825180840190935280549093168252600190920154918101919091526135e490614842565b15829061360557604051632d7d25f160e21b81526004016108ec9190615048565b506040805180820182526001600160a01b0394851681526020808201938452938516600090815295909352909320905181546001600160a01b03191692169190911781559051600190910155565b6001600160a01b03808216600090815260208481526040808320815161012081018352815490951685526001810154928501929092526002820154908401526003810154606084015260048101546080840152600581015460a0840152600681015460c0840152600781015460e0840152600881015461010084015290916136de9060600151151590565b83906136fe576040516342daadaf60e01b81526004016108ec9190615048565b509392505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b60006137368484613653565b604080516101208101825282546001600160a01b03168152600183015460208201526002830154918101919091526003820154606082015260048201546080820152600582015460a0820152600682015460c0820152600782015460e082015260088201546101008201529091506137ad90612054565b600482015484916137d3576040516361b66e0d60e01b81526004016108ec929190615ad0565b5050600601555050565b60006137e98383613653565b604080516101208101825282546001600160a01b03168152600183015460208201526002830154918101919091526003820154606082015260048201546080820152600582015460a0820152600682015460c0820152600782015460e0820152600882015461010082015290915061386090612054565b60048201548391613886576040516361b66e0d60e01b81526004016108ec929190615ad0565b5050426004909101555050565b806000036138a057505050565b6001600160a01b03821660009081526020849052604090205481808210156138dd57604051635f8ec70960e01b81526004016108ec929190615277565b50506001600160a01b03821660009081526020849052604081208054839290613907908490615845565b9091555050505050565b811561306f576001600160a01b03831660009081526020869052604081205461393b908490615ae9565b90506000856001600160a01b031663872d04898630866040518463ffffffff1660e01b815260040161396f93929190615d95565b602060405180830381865afa15801561398c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906139b09190615a7d565b90508082818111156139d757604051635f8ec70960e01b81526004016108ec929190615277565b50506001600160a01b03851660009081526020889052604081208054869290613a01908490615ae9565b909155505050505050505050565b606082613a2457613a1f82614851565b61186c565b8151158015613a3b57506001600160a01b0384163b155b15613a5b5783604051639996b31560e01b81526004016108ec9190615048565b508061186c565b7f000000000000000000000000000000000000000000000000000000000000000090565b81516040908101516001600160a01b039081166000908152610109602090815290839020549251606093613ac39387938793929091169101615dbe565b604051602081830303815290604052905092915050565b81600003613afb57604051638f4c63d960e01b815260040160405180910390fd5b613b27613b06611b69565b600254609a91908690869063ffffffff600160c01b90910481169061391116565b6001600160a01b0383166000908152609c6020908152604080832060028082015483516001600160601b031930606090811b8216838901528b901b166034820152604880820192909252845180820390920182526068810180865282519287019290922060e882018652898352426088830190815260a883018a815260c8909301898152828a52609b909852959097209151825593516001820155925190830155915160039182015581015490919015613bf55760018201546000908152609b602052604090206003018190555b613bff828261487a565b80856001600160a01b03167f5d9e2c5278e41138269f5f980cfbea016d8c59816754502abc4d2f87aaea987f8686604051613c3b929190615277565b60405180910390a35050505050565b8015610d3c5760405163a9059cbb60e01b81526001600160a01b0384169063a9059cbb90613c7e9085908590600401615ad0565b6020604051808303816000875af1158015613c9d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613cc191906154f8565b610d3c5760405162461bcd60e51b815260206004820152600960248201526810ba3930b739b332b960b91b60448201526064016108ec565b600080613d0760cf886121f2565b9050613d1281612054565b8790613d3257604051631eb5ff9560e01b81526004016108ec9190615048565b506000613d4a60d2548361330090919063ffffffff16565b158015613d5d5750613d5b8261333d565b155b8015613d6857508615155b8015613de05750816101000151613d7d61457a565b6001600160a01b031663766718086040518163ffffffff1660e01b8152600401602060405180830381865afa158015613dba573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613dde9190615a7d565b115b613deb576000613e61565b613df3613706565b6001600160a01b031663db750926896040518263ffffffff1660e01b8152600401613e1e9190615048565b6020604051808303816000875af1158015613e3d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613e619190615a7d565b9050613ea088613e6f613706565b6001600160a01b031663eeac3e0e85602001516040518263ffffffff1660e01b81526004016122c391815260200190565b613eab60cf8961490d565b613eb660cf896149c3565b60008082156141ef576000613ec9611b69565b8551604051637573ef4f60e01b81526001600160a01b039290921691637573ef4f91613efc913090600290600401615e87565b602060405180830381865afa158015613f19573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613f3d9190615a7d565b90506000613f49611b69565b8651604051631584a17960e21b81526001600160a01b03929092169163561285e491613f79913090600401615515565b60a060405180830381865afa158015613f96573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613fba9190615eac565b90506000816020015111613fcf576000613fd9565b613fd98583614a7a565b925082156140ce57613fe9613a62565b6001600160a01b031663095ea7b3613fff611b69565b856040518363ffffffff1660e01b815260040161401d929190615ad0565b6020604051808303816000875af115801561403c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061406091906154f8565b50614069611b69565b865160405163ca94b0e960e01b81526001600160a01b03929092169163ca94b0e99161409b9130908890600401615f1f565b600060405180830381600087803b1580156140b557600080fd5b505af11580156140c9573d6000803e3d6000fd5b505050505b6140d88386615845565b935083156141ec576001600160a01b0388166141df576140f6613a62565b6001600160a01b031663095ea7b361410c611b69565b866040518363ffffffff1660e01b815260040161412a929190615ad0565b6020604051808303816000875af1158015614149573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061416d91906154f8565b50614176611b69565b8651604051633a30904960e11b81526001600160a01b0392909216916374612092916141a89130908990600401615f1f565b600060405180830381600087803b1580156141c257600080fd5b505af11580156141d6573d6000803e3d6000fd5b505050506141ec565b6141ec8885612d3c613a62565b50505b602084015184516001600160a01b03808d1691167f443f56bd2098d273b8c8120398789a41da5925db4ba2f656813fc5299ac57b1f8686868f8f61423161457a565b6001600160a01b031663766718086040518163ffffffff1660e01b8152600401602060405180830381865afa15801561426e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906142929190615a7d565b6040516142a496959493929190615f43565b60405180910390a483516142b89088612ec1565b156142c8576142c88a6001612277565b509098975050505050505050565b600080846001600160a01b031663872d04898530866040518463ffffffff1660e01b815260040161430993929190615d95565b602060405180830381865afa158015614326573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061434a9190615a7d565b6001600160a01b0385166000908152602088905260409020541115915050949350505050565b614378614ada565b610acd57604051631afcd79f60e31b815260040160405180910390fd5b611ab0614370565b6143a5614370565b6143b260006000196126d7565b6143c06000620f4240614af4565b6143d260006001600160401b03614bc5565b610acd63ffffffff611b15565b6143e7614370565b610a8f8282614c52565b60006143fc83611b8d565b9050610d3c8183611cce565b60006112b8614415614c93565b8360405161190160f01b8152600281019290925260228201526042902090565b600061444a6144448585613076565b83614c9d565b905080836001600160a01b038083169082161461447c57604051638c5b935d60e01b81526004016108ec929190615515565b505050505050565b6001600160a01b0380821660009081526020858152604091829020825180840190935280549093168252600190920154918101919091526144c490614842565b1581906144e557604051632d7d25f160e21b81526004016108ec9190615048565b506040516378eb06b360e11b81526001600160a01b0383169063f1d60d6690614512908490600401615048565b602060405180830381865afa15801561452f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061455391906154f8565b15819061457457604051632d7d25f160e21b81526004016108ec9190615048565b50505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b6145a6614fae565b6001600160a01b03808716600090815260208a8152604091829020825161012081018452815490941684526001810154918401919091526002810154918301919091526003810154606083015260048101546080830152600581015460a0830152600681015460c0830152600781015460e0830152600801546101008201526146329060600151151590565b15869061465357604051630bc4def560e01b81526004016108ec9190615048565b505060408051610120810182526001600160a01b0397881681526020808201968752818301958652426060830190815260006080840181815260a0850182815260c0860198895260e0860183815261010087019889529b8d1683529c90935293909320825181546001600160a01b0319169a169990991789559551600189015593516002880155516003870155925160048601559451600585015593516006840155905160078301555160089091015590565b600082821882841102821861186c565b600082841015801561333557505090911115919050565b61475b6040518060800160405280600081526020016000815260200160008152602001600080191681525090565b6000828152609b602090815260409182902082516080810184528154815260018201549281018390526002820154938101939093526003015460608301528390611c895760405163107349a960e21b81526004016108ec91815260200190565b6000808460030154116147e15760405163ddaf8f2160e01b815260040160405180910390fd5b60006147f485600001548563ffffffff16565b905061480785600001548463ffffffff16565b600185600301600082825461481c9190615845565b9091555050808555600385015460000361483857600060018601555b5050915492915050565b516001600160a01b0316151590565b8051156148615780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b6127108260030154106148a0576040516303a8c56b60e61b815260040160405180910390fd5b806148be57604051638f4a893d60e01b815260040160405180910390fd5b60018083018290556002830180546000906148da908490615ae9565b909155505060038201546000036148ef578082555b60018260030160008282546149049190615ae9565b90915550505050565b60006149198383613653565b604080516101208101825282546001600160a01b03168152600183015460208201526002830154918101919091526003820154606082015260048201546080820152600582015460a0820152600682015460c0820152600782015460e0820152600882015461010082015290915061499090612054565b600482015483916149b6576040516361b66e0d60e01b81526004016108ec929190615ad0565b5050426005909101555050565b60006149cf8383613653565b604080516101208101825282546001600160a01b03168152600183015460208201526002830154918101919091526003820154606082015260048201546080820152600582015460a0820152600682015460c0820152600782015460e08201526008820154610100820152909150614a4690612054565b60048201548391614a6c576040516361b66e0d60e01b81526004016108ec929190615ad0565b505060006007909101555050565b6000614a8983620f4240101590565b80614a9c5750614a9c82620f4240101590565b83839091614abf5760405163768bf0eb60e11b81526004016108ec929190615277565b50620f42409050614ad08385615ca1565b61186c9190615f81565b6000614ae4612f04565b54600160401b900460ff16919050565b818163ffffffff8082169083161115614b225760405163ccccdafb60e01b81526004016108ec929190615180565b508290508163ffffffff8116620f42401015614b535760405163ccccdafb60e01b81526004016108ec929190615180565b50506002805463ffffffff838116600160a01b0263ffffffff60a01b19918616600160801b0291909116600160801b600160c01b0319909216919091171790556040517f2fe5a7039987697813605cc0b9d6db7aab575408e3fc59e8a457bef8d7bc0a369061273a9084908490615180565b81816001600160401b038082169083161115614bf65760405163ccccdafb60e01b81526004016108ec92919061521c565b5050600280546001600160401b03838116600160401b026001600160801b0319909216908516171790556040517f2867e04c500e438761486b78021d4f9eb97c77ff45d10c1183f5583ba4cbf7d19061273a908490849061521c565b614c5a614370565b6000614c6461278d565b905060028101614c748482615742565b5060038101614c838382615742565b5060008082556001909101555050565b600061084b614cc7565b600080600080614cad8686614d3b565b925092509250614cbd8282614d88565b5090949350505050565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f614cf2614e41565b614cfa614ea8565b60408051602081019490945283019190915260608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b60008060008351604103614d755760208401516040850151606086015160001a614d6788828585614ee9565b955095509550505050614d81565b50508151600091506002905b9250925092565b6000826003811115614d9c57614d9c6158db565b03614da5575050565b6001826003811115614db957614db96158db565b03614dd75760405163f645eedf60e01b815260040160405180910390fd5b6002826003811115614deb57614deb6158db565b03614e0c5760405163fce698f760e01b8152600481018290526024016108ec565b6003826003811115614e2057614e206158db565b03610a8f576040516335e2f38360e21b8152600481018290526024016108ec565b600080614e4c61278d565b90506000614e586127b1565b805190915015614e7057805160209091012092915050565b81548015614e7f579392505050565b7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470935050505090565b600080614eb361278d565b90506000614ebf612852565b805190915015614ed757805160209091012092915050565b60018201548015614e7f579392505050565b600080806fa2a8918ca85bafe22016d0b997e4df60600160ff1b03841115614f1a5750600091506003905082614fa4565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa158015614f6e573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116614f9a57506000925060019150829050614fa4565b9250600091508190505b9450945094915050565b60405180610120016040528060006001600160a01b0316815260200160008019168152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b6001600160a01b038116811461084857600080fd5b803561502681615006565b919050565b60006020828403121561503d57600080fd5b813561186c81615006565b6001600160a01b0391909116815260200190565b63ffffffff8116811461084857600080fd5b60006020828403121561508057600080fd5b813561186c8161505c565b60008083601f84011261509d57600080fd5b5081356001600160401b038111156150b457600080fd5b6020830191508360208285010111156134be57600080fd5b6000806000604084860312156150e157600080fd5b83356150ec81615006565b925060208401356001600160401b0381111561510757600080fd5b6151138682870161508b565b9497909650939450505050565b801515811461084857600080fd5b6000806040838503121561514157600080fd5b823561514c81615006565b9150602083013561515c81615120565b809150509250929050565b60006020828403121561517957600080fd5b5035919050565b63ffffffff92831681529116602082015260400190565b60005b838110156151b257818101518382015260200161519a565b50506000910152565b600081518084526151d3816020860160208601615197565b601f01601f19169290920160200192915050565b83815260606020820152600061520060608301856151bb565b828103604084015261521281856151bb565b9695505050505050565b6001600160401b0392831681529116602082015260400190565b60008060006060848603121561524b57600080fd5b833561525681615006565b9250602084013561526681615006565b929592945050506040919091013590565b918252602082015260400190565b60ff60f81b8816815260e0602082015260006152a460e08301896151bb565b82810360408401526152b681896151bb565b606084018890526001600160a01b038716608085015260a0840186905283810360c08501528451808252602080870193509091019060005b8181101561530c5783518352602093840193909201916001016152ee565b50909b9a5050505050505050505050565b6000806020838503121561533057600080fd5b82356001600160401b0381111561534657600080fd5b8301601f8101851361535757600080fd5b80356001600160401b0381111561536d57600080fd5b8560208260051b840101111561538257600080fd5b6020919091019590945092505050565b6000602082016020835280845180835260408501915060408160051b86010192506020860160005b828110156153eb57603f198786030184526153d68583516151bb565b945060209384019391909101906001016153ba565b50929695505050505050565b6000806000806060858703121561540d57600080fd5b843561541881615006565b935060208501356003811061542c57600080fd5b925060408501356001600160401b0381111561544757600080fd5b6154538782880161508b565b95989497509550505050565b6000806000806080858703121561547557600080fd5b843561548081615006565b93506020850135925060408501356154978161505c565b9396929550929360600135925050565b600080604083850312156154ba57600080fd5b82356154c581615006565b9150602083013561515c81615006565b6001600160a01b0393841681529183166020830152909116604082015260600190565b60006020828403121561550a57600080fd5b815161186c81615120565b6001600160a01b0392831681529116602082015260400190565b634e487b7160e01b600052604160045260246000fd5b60405161014081016001600160401b03811182821017156155685761556861552f565b60405290565b604080519081016001600160401b03811182821017156155685761556861552f565b60405160e081016001600160401b03811182821017156155685761556861552f565b600082601f8301126155c357600080fd5b8135602083016000806001600160401b038411156155e3576155e361552f565b50604051601f19601f85018116603f011681018181106001600160401b03821117156156115761561161552f565b60405283815290508082840187101561562957600080fd5b838360208301376000602085830101528094505050505092915050565b60008060006060848603121561565b57600080fd5b83356001600160401b0381111561567157600080fd5b61567d868287016155b2565b93505060208401356001600160401b0381111561569957600080fd5b6156a5868287016155b2565b92505060408401356156b681615006565b809150509250925092565b600181811c908216806156d557607f821691505b6020821081036156f557634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115610d3c57806000526020600020601f840160051c810160208510156157225750805b601f840160051c820191505b8181101561306f576000815560010161572e565b81516001600160401b0381111561575b5761575b61552f565b61576f8161576984546156c1565b846156fb565b6020601f8211600181146157a3576000831561578b5750848201515b600019600385901b1c1916600184901b17845561306f565b600084815260208120601f198516915b828110156157d357878501518255602094850194600190920191016157b3565b50848210156157f15786840151600019600387901b60f8161c191681555b50505050600190811b01905550565b60208152816020820152818360408301376000818301604090810191909152601f909201601f19160101919050565b634e487b7160e01b600052601160045260246000fd5b818103818111156112b8576112b861582f565b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261588557600080fd5b8301803591506001600160401b0382111561589f57600080fd5b6020019150368190038213156134be57600080fd5b8284823760008382016000815283516158d1818360208801615197565b0195945050505050565b634e487b7160e01b600052602160045260246000fd5b6003811061590f57634e487b7160e01b600052602160045260246000fd5b9052565b602081016112b882846158f1565b6000806040838503121561593457600080fd5b50508035926020909101359150565b6000806000806080858703121561595957600080fd5b8435935060208501359250604085013561597281615006565b915060608501356001600160401b0381111561598d57600080fd5b615999878288016155b2565b91505092959194509250565b80516150268161505c565b6001600160401b038116811461084857600080fd5b8051615026816159b0565b60006101408284031280156159e457600080fd5b5060006159ef615545565b835181526020808501519082015260408085015190820152615a13606085016159a5565b6060820152615a24608085016159c5565b6080820152615a3560a085016159c5565b60a0820152615a4660c085016159a5565b60c0820152615a5760e085016159c5565b60e082015261010084810151908201526101209384015193810193909352509092915050565b600060208284031215615a8f57600080fd5b5051919050565b600060208284031215615aa857600080fd5b815161186c8161505c565b600060208284031215615ac557600080fd5b815161186c816159b0565b6001600160a01b03929092168252602082015260400190565b808201808211156112b8576112b861582f565b60008251615b0e818460208701615197565b9190910192915050565b8035615026816159b0565b80356001600160801b038116811461502657600080fd5b60008060408385031215615b4d57600080fd5b82356001600160401b03811115615b6357600080fd5b830160408186031215615b7557600080fd5b615b7d61556e565b81356001600160401b03811115615b9357600080fd5b820160e08188031215615ba557600080fd5b615bad615590565b81358152615bbd6020830161501b565b6020820152615bce6040830161501b565b6040820152615bdf6060830161501b565b6060820152615bf060808301615b18565b6080820152615c0160a08301615b23565b60a082015260c08201356001600160401b03811115615c1f57600080fd5b615c2b898285016155b2565b60c08301525082525060208201356001600160401b03811115615c4d57600080fd5b615c59878285016155b2565b60208381019190915291979590910135955050505050565b615c7b81856158f1565b606060208201526000615c9160608301856151bb565b9050826040830152949350505050565b80820281158282048414176112b8576112b861582f565b600080600060608486031215615ccd57600080fd5b8335615cd881615006565b92506020840135915060408401356001600160401b03811115615cfa57600080fd5b615d06868287016155b2565b9150509250925092565b608081526000615d2360808301876151bb565b6020830195909552506040810192909252606090910152919050565b60008060408385031215615d5257600080fd5b8251602084015190925061515c81615006565b600081615d7457615d7461582f565b506000190190565b600060018201615d8e57615d8e61582f565b5060010190565b6001600160a01b03938416815291909216602082015263ffffffff909116604082015260600190565b606080825284516040838301819052815160a085015260208201516001600160a01b0390811660c086015290820151811660e08501529181015190911661010083015260808101516001600160401b038116610120840152600091905060a08101516001600160801b0381166101408501525060c0015160e0610160840152615e4b6101808401826151bb565b90506020860151605f19848303016080850152615e6882826151bb565b9250505083602083015261333560408301846001600160a01b03169052565b6001600160a01b038481168252831660208201526060810161333560408301846158f1565b600060a0828403128015615ebf57600080fd5b5060405160009060a081016001600160401b0381118282101715615ee557615ee561552f565b6040908152845182526020808601519083015284810151908201526060808501519082015260809384015193810193909352509092915050565b6001600160a01b039384168152919092166020820152604081019190915260600190565b86815285602082015284604082015283606082015260c060808201526000615f6e60c08301856151bb565b90508260a0830152979650505050505050565b600082615f9e57634e487b7160e01b600052601260045260246000fd5b50049056fea2646970667358221220b85de947a2adf153b4d5d66360454c8d0624bca998d3fc8f12bd17e31d74127864736f6c634300081b0033", + "opcodes": "PUSH2 0x240 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x11 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x40 MLOAD PUSH2 0x6677 CODESIZE SUB DUP1 PUSH2 0x6677 DUP4 CODECOPY DUP2 ADD PUSH1 0x40 DUP2 SWAP1 MSTORE PUSH2 0x30 SWAP2 PUSH2 0x541 JUMP JUMPDEST ADDRESS DUP4 DUP4 DUP4 DUP8 DUP1 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP2 AND PUSH2 0x7F JUMPI PUSH1 0x40 MLOAD PUSH4 0x218F5ADD PUSH1 0xE1 SHL DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0xA PUSH1 0x24 DUP3 ADD MSTORE PUSH10 0x21B7B73A3937B63632B9 PUSH1 0xB1 SHL PUSH1 0x44 DUP3 ADD MSTORE PUSH1 0x64 ADD JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP2 AND PUSH2 0x100 MSTORE PUSH1 0x40 DUP1 MLOAD DUP1 DUP3 ADD SWAP1 SWAP2 MSTORE PUSH1 0xA DUP2 MSTORE PUSH10 0x23B930B8342A37B5B2B7 PUSH1 0xB1 SHL PUSH1 0x20 DUP3 ADD MSTORE PUSH2 0xB7 SWAP1 PUSH2 0x3C5 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH1 0x80 MSTORE PUSH1 0x40 DUP1 MLOAD DUP1 DUP3 ADD SWAP1 SWAP2 MSTORE PUSH1 0x7 DUP2 MSTORE PUSH7 0x5374616B696E67 PUSH1 0xC8 SHL PUSH1 0x20 DUP3 ADD MSTORE PUSH2 0xEA SWAP1 PUSH2 0x3C5 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH1 0xA0 MSTORE PUSH1 0x40 DUP1 MLOAD DUP1 DUP3 ADD SWAP1 SWAP2 MSTORE PUSH1 0xD DUP2 MSTORE PUSH13 0x47726170685061796D656E7473 PUSH1 0x98 SHL PUSH1 0x20 DUP3 ADD MSTORE PUSH2 0x123 SWAP1 PUSH2 0x3C5 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH1 0xC0 MSTORE PUSH1 0x40 DUP1 MLOAD DUP1 DUP3 ADD SWAP1 SWAP2 MSTORE PUSH1 0xE DUP2 MSTORE PUSH14 0x5061796D656E7473457363726F77 PUSH1 0x90 SHL PUSH1 0x20 DUP3 ADD MSTORE PUSH2 0x15D SWAP1 PUSH2 0x3C5 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH1 0xE0 MSTORE PUSH1 0x40 DUP1 MLOAD DUP1 DUP3 ADD SWAP1 SWAP2 MSTORE PUSH1 0xC DUP2 MSTORE PUSH12 0x22B837B1B426B0B730B3B2B9 PUSH1 0xA1 SHL PUSH1 0x20 DUP3 ADD MSTORE PUSH2 0x195 SWAP1 PUSH2 0x3C5 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH2 0x120 MSTORE PUSH1 0x40 DUP1 MLOAD DUP1 DUP3 ADD SWAP1 SWAP2 MSTORE PUSH1 0xE DUP2 MSTORE PUSH14 0x2932BBB0B93239A6B0B730B3B2B9 PUSH1 0x91 SHL PUSH1 0x20 DUP3 ADD MSTORE PUSH2 0x1D0 SWAP1 PUSH2 0x3C5 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH2 0x140 MSTORE PUSH1 0x40 DUP1 MLOAD DUP1 DUP3 ADD SWAP1 SWAP2 MSTORE PUSH1 0x11 DUP2 MSTORE PUSH17 0x4772617068546F6B656E47617465776179 PUSH1 0x78 SHL PUSH1 0x20 DUP3 ADD MSTORE PUSH2 0x20E SWAP1 PUSH2 0x3C5 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH2 0x160 MSTORE PUSH1 0x40 DUP1 MLOAD DUP1 DUP3 ADD SWAP1 SWAP2 MSTORE PUSH1 0xF DUP2 MSTORE PUSH15 0x23B930B834283937BC3CA0B236B4B7 PUSH1 0x89 SHL PUSH1 0x20 DUP3 ADD MSTORE PUSH2 0x24A SWAP1 PUSH2 0x3C5 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH2 0x180 MSTORE PUSH1 0x40 DUP1 MLOAD DUP1 DUP3 ADD SWAP1 SWAP2 MSTORE PUSH1 0x8 DUP2 MSTORE PUSH8 0x21BAB930BA34B7B7 PUSH1 0xC1 SHL PUSH1 0x20 DUP3 ADD MSTORE PUSH2 0x27F SWAP1 PUSH2 0x3C5 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB SWAP1 DUP2 AND PUSH2 0x1A0 DUP2 SWAP1 MSTORE PUSH2 0x100 MLOAD PUSH1 0xA0 MLOAD PUSH1 0x80 MLOAD PUSH1 0xC0 MLOAD PUSH1 0xE0 MLOAD PUSH2 0x120 MLOAD PUSH2 0x140 MLOAD PUSH2 0x160 MLOAD PUSH2 0x180 MLOAD PUSH1 0x40 MLOAD SWAP9 DUP12 AND SWAP11 SWAP8 DUP9 AND SWAP10 SWAP7 SWAP1 SWAP8 AND SWAP8 PUSH32 0xEF5021414834D86E36470F5C1CECF6544FB2BB723F2CA51A4C86FCD8C5919A43 SWAP8 PUSH2 0x329 SWAP8 SWAP1 SWAP2 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB SWAP8 DUP9 AND DUP2 MSTORE SWAP6 DUP8 AND PUSH1 0x20 DUP8 ADD MSTORE SWAP4 DUP7 AND PUSH1 0x40 DUP7 ADD MSTORE SWAP2 DUP6 AND PUSH1 0x60 DUP6 ADD MSTORE DUP5 AND PUSH1 0x80 DUP5 ADD MSTORE DUP4 AND PUSH1 0xA0 DUP4 ADD MSTORE SWAP1 SWAP2 AND PUSH1 0xC0 DUP3 ADD MSTORE PUSH1 0xE0 ADD SWAP1 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG4 POP POP PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP5 DUP2 AND PUSH2 0x1C0 DUP2 SWAP1 MSTORE DUP5 DUP3 AND PUSH2 0x1E0 DUP2 SWAP1 MSTORE DUP5 DUP4 AND PUSH2 0x200 DUP2 SWAP1 MSTORE SWAP3 DUP5 AND PUSH2 0x220 DUP2 SWAP1 MSTORE PUSH1 0x40 DUP1 MLOAD SWAP4 DUP5 MSTORE PUSH1 0x20 DUP5 ADD SWAP3 SWAP1 SWAP3 MSTORE SWAP1 DUP3 ADD SWAP3 SWAP1 SWAP3 MSTORE PUSH1 0x60 DUP2 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH32 0x4175B2C37456DBAC494E08DE8666D31BB8F3F2AEE36EA5D9E06894FF3E4DDDA7 SWAP1 PUSH1 0x80 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG1 POP POP POP POP PUSH2 0x3BC PUSH2 0x473 PUSH1 0x20 SHL PUSH1 0x20 SHR JUMP JUMPDEST POP POP POP POP PUSH2 0x605 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0x100 MLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0xF7641A5E DUP5 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD KECCAK256 PUSH1 0x40 MLOAD DUP3 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x400 SWAP2 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP7 GAS STATICCALL ISZERO DUP1 ISZERO PUSH2 0x41D JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x441 SWAP2 SWAP1 PUSH2 0x595 JUMP JUMPDEST SWAP1 POP DUP3 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP3 AND PUSH2 0x46C JUMPI PUSH1 0x40 MLOAD PUSH4 0x218F5ADD PUSH1 0xE1 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x76 SWAP2 SWAP1 PUSH2 0x5B7 JUMP JUMPDEST POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH32 0xF0C57E16840DF040F15088DC2F81FE391C3923BEC73E23A9662EFC9C229C6A00 DUP1 SLOAD PUSH9 0x10000000000000000 SWAP1 DIV PUSH1 0xFF AND ISZERO PUSH2 0x4C3 JUMPI PUSH1 0x40 MLOAD PUSH4 0xF92EE8A9 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST DUP1 SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB SWAP1 DUP2 AND EQ PUSH2 0x522 JUMPI DUP1 SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB NOT AND PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB SWAP1 DUP2 OR DUP3 SSTORE PUSH1 0x40 MLOAD SWAP1 DUP2 MSTORE PUSH32 0xC7F505B2F371AE2175EE4913F4499E1F2633A7B5936321EED1CDAEB6115181D2 SWAP1 PUSH1 0x20 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG1 JUMPDEST POP JUMP JUMPDEST DUP1 MLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP2 AND DUP2 EQ PUSH2 0x53C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0x80 DUP6 DUP8 SUB SLT ISZERO PUSH2 0x557 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x560 DUP6 PUSH2 0x525 JUMP JUMPDEST SWAP4 POP PUSH2 0x56E PUSH1 0x20 DUP7 ADD PUSH2 0x525 JUMP JUMPDEST SWAP3 POP PUSH2 0x57C PUSH1 0x40 DUP7 ADD PUSH2 0x525 JUMP JUMPDEST SWAP2 POP PUSH2 0x58A PUSH1 0x60 DUP7 ADD PUSH2 0x525 JUMP JUMPDEST SWAP1 POP SWAP3 SWAP6 SWAP2 SWAP5 POP SWAP3 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x5A7 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x5B0 DUP3 PUSH2 0x525 JUMP JUMPDEST SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x20 DUP2 MSTORE PUSH1 0x0 DUP3 MLOAD DUP1 PUSH1 0x20 DUP5 ADD MSTORE PUSH1 0x0 JUMPDEST DUP2 DUP2 LT ISZERO PUSH2 0x5E5 JUMPI PUSH1 0x20 DUP2 DUP7 ADD DUP2 ADD MLOAD PUSH1 0x40 DUP7 DUP5 ADD ADD MSTORE ADD PUSH2 0x5C8 JUMP JUMPDEST POP PUSH1 0x0 PUSH1 0x40 DUP3 DUP6 ADD ADD MSTORE PUSH1 0x40 PUSH1 0x1F NOT PUSH1 0x1F DUP4 ADD AND DUP5 ADD ADD SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x80 MLOAD PUSH1 0xA0 MLOAD PUSH1 0xC0 MLOAD PUSH1 0xE0 MLOAD PUSH2 0x100 MLOAD PUSH2 0x120 MLOAD PUSH2 0x140 MLOAD PUSH2 0x160 MLOAD PUSH2 0x180 MLOAD PUSH2 0x1A0 MLOAD PUSH2 0x1C0 MLOAD PUSH2 0x1E0 MLOAD PUSH2 0x200 MLOAD PUSH2 0x220 MLOAD PUSH2 0x5FD9 PUSH2 0x69E PUSH1 0x0 CODECOPY PUSH1 0x0 PUSH2 0x2EE2 ADD MSTORE PUSH1 0x0 PUSH2 0x32DE ADD MSTORE PUSH1 0x0 DUP2 DUP2 PUSH2 0x163B ADD MSTORE PUSH2 0x2FE1 ADD MSTORE PUSH1 0x0 POP POP PUSH1 0x0 POP POP PUSH1 0x0 POP POP PUSH1 0x0 POP POP PUSH1 0x0 PUSH2 0x3708 ADD MSTORE PUSH1 0x0 PUSH2 0x457C ADD MSTORE PUSH1 0x0 POP POP PUSH1 0x0 POP POP PUSH1 0x0 POP POP PUSH1 0x0 PUSH2 0x1B6B ADD MSTORE PUSH1 0x0 PUSH2 0x3A64 ADD MSTORE PUSH2 0x5FD9 PUSH1 0x0 RETURN INVALID PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x4 CALLDATASIZE LT PUSH2 0x23B JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0x7E736D8 EQ PUSH2 0x240 JUMPI DUP1 PUSH4 0xE022923 EQ PUSH2 0x280 JUMPI DUP1 PUSH4 0x138DEA08 EQ PUSH2 0x308 JUMPI DUP1 PUSH4 0x13C474C9 EQ PUSH2 0x320 JUMPI DUP1 PUSH4 0x1DD42F60 EQ PUSH2 0x375 JUMPI DUP1 PUSH4 0x1EBB7C30 EQ PUSH2 0x38A JUMPI DUP1 PUSH4 0x24B8FBF6 EQ PUSH2 0x3AF JUMPI DUP1 PUSH4 0x35577962 EQ PUSH2 0x3C2 JUMPI DUP1 PUSH4 0x3F4BA83A EQ PUSH2 0x3D5 JUMPI DUP1 PUSH4 0x45F54485 EQ PUSH2 0x3DD JUMPI DUP1 PUSH4 0x482468B7 EQ PUSH2 0x3F0 JUMPI DUP1 PUSH4 0x4F793CDC EQ PUSH2 0x406 JUMPI DUP1 PUSH4 0x55C85269 EQ PUSH2 0x428 JUMPI DUP1 PUSH4 0x5C975ABB EQ PUSH2 0x472 JUMPI DUP1 PUSH4 0x6234E216 EQ PUSH2 0x48A JUMPI DUP1 PUSH4 0x6CCEC5B8 EQ PUSH2 0x4AA JUMPI DUP1 PUSH4 0x6D9A3951 EQ PUSH2 0x4BD JUMPI DUP1 PUSH4 0x715018A6 EQ PUSH2 0x538 JUMPI DUP1 PUSH4 0x71CE020A EQ PUSH2 0x540 JUMPI DUP1 PUSH4 0x7AA31BCE EQ PUSH2 0x556 JUMPI DUP1 PUSH4 0x7DFE6D28 EQ PUSH2 0x569 JUMPI DUP1 PUSH4 0x7E89BAC3 EQ PUSH2 0x57C JUMPI DUP1 PUSH4 0x8180083B EQ PUSH2 0x58F JUMPI DUP1 PUSH4 0x819BA366 EQ PUSH2 0x5A2 JUMPI DUP1 PUSH4 0x81E777A7 EQ PUSH2 0x5B8 JUMPI DUP1 PUSH4 0x832BC923 EQ PUSH2 0x5CB JUMPI DUP1 PUSH4 0x8456CB59 EQ PUSH2 0x5DE JUMPI DUP1 PUSH4 0x84B0196E EQ PUSH2 0x5E6 JUMPI DUP1 PUSH4 0x85E82BAF EQ PUSH2 0x601 JUMPI DUP1 PUSH4 0x8DA5CB5B EQ PUSH2 0x60A JUMPI DUP1 PUSH4 0x9384E078 EQ PUSH2 0x612 JUMPI DUP1 PUSH4 0xAC9650D8 EQ PUSH2 0x635 JUMPI DUP1 PUSH4 0xB15D2A2C EQ PUSH2 0x655 JUMPI DUP1 PUSH4 0xBA38F67D EQ PUSH2 0x668 JUMPI DUP1 PUSH4 0xC0F47497 EQ PUSH2 0x67B JUMPI DUP1 PUSH4 0xC84A5EF3 EQ PUSH2 0x683 JUMPI DUP1 PUSH4 0xCB8347FE EQ PUSH2 0x696 JUMPI DUP1 PUSH4 0xCBE5F3F2 EQ PUSH2 0x6A9 JUMPI DUP1 PUSH4 0xCE0FC0CC EQ PUSH2 0x6C9 JUMPI DUP1 PUSH4 0xCE56C98B EQ PUSH2 0x6DC JUMPI DUP1 PUSH4 0xD07A7A84 EQ PUSH2 0x6EF JUMPI DUP1 PUSH4 0xDB9BEE46 EQ PUSH2 0x6F9 JUMPI DUP1 PUSH4 0xDEDF6726 EQ PUSH2 0x701 JUMPI DUP1 PUSH4 0xE2E1E8E9 EQ PUSH2 0x714 JUMPI DUP1 PUSH4 0xE6F50054 EQ PUSH2 0x734 JUMPI DUP1 PUSH4 0xEBF6DDAF EQ PUSH2 0x747 JUMPI DUP1 PUSH4 0xEC9C218D EQ PUSH2 0x74F JUMPI DUP1 PUSH4 0xEFF0F592 EQ PUSH2 0x762 JUMPI DUP1 PUSH4 0xF2FDE38B EQ PUSH2 0x797 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x26A PUSH2 0x24E CALLDATASIZE PUSH1 0x4 PUSH2 0x502B JUMP JUMPDEST PUSH2 0x109 PUSH1 0x20 MSTORE PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND DUP2 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x277 SWAP2 SWAP1 PUSH2 0x5048 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH2 0x293 PUSH2 0x28E CALLDATASIZE PUSH1 0x4 PUSH2 0x502B JUMP JUMPDEST PUSH2 0x7AA JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x277 SWAP2 SWAP1 PUSH1 0x0 PUSH2 0x120 DUP3 ADD SWAP1 POP PUSH1 0x1 DUP1 PUSH1 0xA0 SHL SUB DUP4 MLOAD AND DUP3 MSTORE PUSH1 0x20 DUP4 ADD MLOAD PUSH1 0x20 DUP4 ADD MSTORE PUSH1 0x40 DUP4 ADD MLOAD PUSH1 0x40 DUP4 ADD MSTORE PUSH1 0x60 DUP4 ADD MLOAD PUSH1 0x60 DUP4 ADD MSTORE PUSH1 0x80 DUP4 ADD MLOAD PUSH1 0x80 DUP4 ADD MSTORE PUSH1 0xA0 DUP4 ADD MLOAD PUSH1 0xA0 DUP4 ADD MSTORE PUSH1 0xC0 DUP4 ADD MLOAD PUSH1 0xC0 DUP4 ADD MSTORE PUSH1 0xE0 DUP4 ADD MLOAD PUSH1 0xE0 DUP4 ADD MSTORE PUSH2 0x100 DUP4 ADD MLOAD PUSH2 0x100 DUP4 ADD MSTORE SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH2 0x312 PUSH2 0x108 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x40 MLOAD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH2 0x277 JUMP JUMPDEST PUSH2 0x355 PUSH2 0x32E CALLDATASIZE PUSH1 0x4 PUSH2 0x502B JUMP JUMPDEST PUSH1 0x9C PUSH1 0x20 MSTORE PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP1 KECCAK256 DUP1 SLOAD PUSH1 0x1 DUP3 ADD SLOAD PUSH1 0x2 DUP4 ADD SLOAD PUSH1 0x3 SWAP1 SWAP4 ADD SLOAD SWAP2 SWAP3 SWAP1 SWAP2 DUP5 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP5 DUP6 MSTORE PUSH1 0x20 DUP6 ADD SWAP4 SWAP1 SWAP4 MSTORE SWAP2 DUP4 ADD MSTORE PUSH1 0x60 DUP3 ADD MSTORE PUSH1 0x80 ADD PUSH2 0x277 JUMP JUMPDEST PUSH2 0x388 PUSH2 0x383 CALLDATASIZE PUSH1 0x4 PUSH2 0x506E JUMP JUMPDEST PUSH2 0x837 JUMP JUMPDEST STOP JUMPDEST PUSH1 0x2 SLOAD PUSH1 0x1 PUSH1 0xC0 SHL SWAP1 DIV PUSH4 0xFFFFFFFF AND PUSH1 0x40 MLOAD PUSH4 0xFFFFFFFF SWAP1 SWAP2 AND DUP2 MSTORE PUSH1 0x20 ADD PUSH2 0x277 JUMP JUMPDEST PUSH2 0x388 PUSH2 0x3BD CALLDATASIZE PUSH1 0x4 PUSH2 0x50CC JUMP JUMPDEST PUSH2 0x850 JUMP JUMPDEST PUSH2 0x388 PUSH2 0x3D0 CALLDATASIZE PUSH1 0x4 PUSH2 0x512E JUMP JUMPDEST PUSH2 0xA7D JUMP JUMPDEST PUSH2 0x388 PUSH2 0xA93 JUMP JUMPDEST PUSH2 0x388 PUSH2 0x3EB CALLDATASIZE PUSH1 0x4 PUSH2 0x5167 JUMP JUMPDEST PUSH2 0xACF JUMP JUMPDEST PUSH2 0x3F8 PUSH2 0xAD9 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x277 SWAP3 SWAP2 SWAP1 PUSH2 0x5180 JUMP JUMPDEST PUSH2 0x419 PUSH2 0x414 CALLDATASIZE PUSH1 0x4 PUSH2 0x502B JUMP JUMPDEST PUSH2 0xAEC JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x277 SWAP4 SWAP3 SWAP2 SWAP1 PUSH2 0x51E7 JUMP JUMPDEST PUSH2 0x43B PUSH2 0x436 CALLDATASIZE PUSH1 0x4 PUSH2 0x502B JUMP JUMPDEST PUSH2 0xC20 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP7 ISZERO ISZERO DUP8 MSTORE PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB SWAP1 SWAP6 AND PUSH1 0x20 DUP8 ADD MSTORE SWAP4 DUP6 ADD SWAP3 SWAP1 SWAP3 MSTORE PUSH1 0x60 DUP5 ADD MSTORE PUSH1 0x80 DUP4 ADD MSTORE PUSH1 0xA0 DUP3 ADD MSTORE PUSH1 0xC0 ADD PUSH2 0x277 JUMP JUMPDEST PUSH2 0x47A PUSH2 0xCDC JUMP JUMPDEST PUSH1 0x40 MLOAD SWAP1 ISZERO ISZERO DUP2 MSTORE PUSH1 0x20 ADD PUSH2 0x277 JUMP JUMPDEST PUSH2 0x312 PUSH2 0x498 CALLDATASIZE PUSH1 0x4 PUSH2 0x502B JUMP JUMPDEST PUSH1 0xD1 PUSH1 0x20 MSTORE PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP2 JUMP JUMPDEST PUSH2 0x388 PUSH2 0x4B8 CALLDATASIZE PUSH1 0x4 PUSH2 0x502B JUMP JUMPDEST PUSH2 0xCF1 JUMP JUMPDEST PUSH2 0x514 PUSH2 0x4CB CALLDATASIZE PUSH1 0x4 PUSH2 0x502B JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD DUP1 DUP3 ADD DUP3 MSTORE PUSH1 0x0 DUP1 DUP3 MSTORE PUSH1 0x20 SWAP2 DUP3 ADD DUP2 SWAP1 MSTORE PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB SWAP4 DUP5 AND DUP2 MSTORE PUSH1 0xD0 DUP3 MSTORE DUP3 SWAP1 KECCAK256 DUP3 MLOAD DUP1 DUP5 ADD SWAP1 SWAP4 MSTORE DUP1 SLOAD SWAP1 SWAP4 AND DUP3 MSTORE PUSH1 0x1 SWAP1 SWAP3 ADD SLOAD SWAP2 DUP2 ADD SWAP2 SWAP1 SWAP2 MSTORE SWAP1 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD DUP3 MLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND DUP2 MSTORE PUSH1 0x20 SWAP3 DUP4 ADD MLOAD SWAP3 DUP2 ADD SWAP3 SWAP1 SWAP3 MSTORE ADD PUSH2 0x277 JUMP JUMPDEST PUSH2 0x388 PUSH2 0xCFB JUMP JUMPDEST PUSH2 0x548 PUSH2 0xD0D JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x277 SWAP3 SWAP2 SWAP1 PUSH2 0x521C JUMP JUMPDEST PUSH2 0x388 PUSH2 0x564 CALLDATASIZE PUSH1 0x4 PUSH2 0x5167 JUMP JUMPDEST PUSH2 0xD18 JUMP JUMPDEST PUSH2 0x388 PUSH2 0x577 CALLDATASIZE PUSH1 0x4 PUSH2 0x5236 JUMP JUMPDEST PUSH2 0xD29 JUMP JUMPDEST PUSH2 0x388 PUSH2 0x58A CALLDATASIZE PUSH1 0x4 PUSH2 0x5167 JUMP JUMPDEST PUSH2 0xD41 JUMP JUMPDEST PUSH2 0x388 PUSH2 0x59D CALLDATASIZE PUSH1 0x4 PUSH2 0x50CC JUMP JUMPDEST PUSH2 0xDB6 JUMP JUMPDEST PUSH2 0x5AA PUSH2 0xF44 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x277 SWAP3 SWAP2 SWAP1 PUSH2 0x5277 JUMP JUMPDEST PUSH2 0x388 PUSH2 0x5C6 CALLDATASIZE PUSH1 0x4 PUSH2 0x5236 JUMP JUMPDEST PUSH2 0xF54 JUMP JUMPDEST PUSH2 0x388 PUSH2 0x5D9 CALLDATASIZE PUSH1 0x4 PUSH2 0x5167 JUMP JUMPDEST PUSH2 0x10C4 JUMP JUMPDEST PUSH2 0x388 PUSH2 0x10D8 JUMP JUMPDEST PUSH2 0x5EE PUSH2 0x1112 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x277 SWAP8 SWAP7 SWAP6 SWAP5 SWAP4 SWAP3 SWAP2 SWAP1 PUSH2 0x5285 JUMP JUMPDEST PUSH2 0x312 PUSH1 0xD2 SLOAD DUP2 JUMP JUMPDEST PUSH2 0x26A PUSH2 0x11BB JUMP JUMPDEST PUSH2 0x47A PUSH2 0x620 CALLDATASIZE PUSH1 0x4 PUSH2 0x502B JUMP JUMPDEST PUSH1 0x67 PUSH1 0x20 MSTORE PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND DUP2 JUMP JUMPDEST PUSH2 0x648 PUSH2 0x643 CALLDATASIZE PUSH1 0x4 PUSH2 0x531D JUMP JUMPDEST PUSH2 0x11D6 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x277 SWAP2 SWAP1 PUSH2 0x5392 JUMP JUMPDEST PUSH2 0x312 PUSH2 0x663 CALLDATASIZE PUSH1 0x4 PUSH2 0x53F7 JUMP JUMPDEST PUSH2 0x12BE JUMP JUMPDEST PUSH2 0x47A PUSH2 0x676 CALLDATASIZE PUSH1 0x4 PUSH2 0x502B JUMP JUMPDEST PUSH2 0x1492 JUMP JUMPDEST PUSH2 0x26A PUSH2 0x14B0 JUMP JUMPDEST PUSH2 0x388 PUSH2 0x691 CALLDATASIZE PUSH1 0x4 PUSH2 0x545F JUMP JUMPDEST PUSH2 0x14BA JUMP JUMPDEST PUSH2 0x388 PUSH2 0x6A4 CALLDATASIZE PUSH1 0x4 PUSH2 0x50CC JUMP JUMPDEST PUSH2 0x1638 JUMP JUMPDEST PUSH2 0x312 PUSH2 0x6B7 CALLDATASIZE PUSH1 0x4 PUSH2 0x502B JUMP JUMPDEST PUSH1 0x9A PUSH1 0x20 MSTORE PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP2 JUMP JUMPDEST PUSH2 0x388 PUSH2 0x6D7 CALLDATASIZE PUSH1 0x4 PUSH2 0x50CC JUMP JUMPDEST PUSH2 0x1777 JUMP JUMPDEST PUSH2 0x312 PUSH2 0x6EA CALLDATASIZE PUSH1 0x4 PUSH2 0x54A7 JUMP JUMPDEST PUSH2 0x1860 JUMP JUMPDEST PUSH2 0x312 PUSH2 0x107 SLOAD DUP2 JUMP JUMPDEST PUSH2 0x26A PUSH2 0x1873 JUMP JUMPDEST PUSH2 0x388 PUSH2 0x70F CALLDATASIZE PUSH1 0x4 PUSH2 0x50CC JUMP JUMPDEST PUSH2 0x187D JUMP JUMPDEST PUSH2 0x312 PUSH2 0x722 CALLDATASIZE PUSH1 0x4 PUSH2 0x5167 JUMP JUMPDEST PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0xD3 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD SWAP1 JUMP JUMPDEST PUSH2 0x388 PUSH2 0x742 CALLDATASIZE PUSH1 0x4 PUSH2 0x5167 JUMP JUMPDEST PUSH2 0x1A0B JUMP JUMPDEST PUSH2 0x26A PUSH2 0x1A1C JUMP JUMPDEST PUSH2 0x388 PUSH2 0x75D CALLDATASIZE PUSH1 0x4 PUSH2 0x502B JUMP JUMPDEST PUSH2 0x1A26 JUMP JUMPDEST PUSH2 0x355 PUSH2 0x770 CALLDATASIZE PUSH1 0x4 PUSH2 0x5167 JUMP JUMPDEST PUSH1 0x9B PUSH1 0x20 MSTORE PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP1 KECCAK256 DUP1 SLOAD PUSH1 0x1 DUP3 ADD SLOAD PUSH1 0x2 DUP4 ADD SLOAD PUSH1 0x3 SWAP1 SWAP4 ADD SLOAD SWAP2 SWAP3 SWAP1 SWAP2 DUP5 JUMP JUMPDEST PUSH2 0x388 PUSH2 0x7A5 CALLDATASIZE PUSH1 0x4 PUSH2 0x502B JUMP JUMPDEST PUSH2 0x1AA8 JUMP JUMPDEST PUSH2 0x7B2 PUSH2 0x4FAE JUMP JUMPDEST POP PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB SWAP1 DUP2 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0xCF PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP2 DUP3 SWAP1 KECCAK256 DUP3 MLOAD PUSH2 0x120 DUP2 ADD DUP5 MSTORE DUP2 SLOAD SWAP1 SWAP5 AND DUP5 MSTORE PUSH1 0x1 DUP2 ADD SLOAD SWAP2 DUP5 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH1 0x2 DUP2 ADD SLOAD SWAP2 DUP4 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH1 0x3 DUP2 ADD SLOAD PUSH1 0x60 DUP4 ADD MSTORE PUSH1 0x4 DUP2 ADD SLOAD PUSH1 0x80 DUP4 ADD MSTORE PUSH1 0x5 DUP2 ADD SLOAD PUSH1 0xA0 DUP4 ADD MSTORE PUSH1 0x6 DUP2 ADD SLOAD PUSH1 0xC0 DUP4 ADD MSTORE PUSH1 0x7 DUP2 ADD SLOAD PUSH1 0xE0 DUP4 ADD MSTORE PUSH1 0x8 ADD SLOAD PUSH2 0x100 DUP3 ADD MSTORE SWAP1 JUMP JUMPDEST PUSH2 0x83F PUSH2 0x1AE3 JUMP JUMPDEST PUSH2 0x848 DUP2 PUSH2 0x1B15 JUMP JUMPDEST POP JUMP JUMPDEST SWAP1 POP SWAP1 JUMP JUMPDEST DUP3 PUSH2 0x859 PUSH2 0x1B69 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0x7C145CC7 DUP3 ADDRESS CALLER PUSH1 0x40 MLOAD DUP5 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x888 SWAP4 SWAP3 SWAP2 SWAP1 PUSH2 0x54D5 JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP7 GAS STATICCALL ISZERO DUP1 ISZERO PUSH2 0x8A5 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x8C9 SWAP2 SWAP1 PUSH2 0x54F8 JUMP JUMPDEST DUP2 CALLER SWAP1 SWAP2 PUSH2 0x8F5 JUMPI PUSH1 0x40 MLOAD PUSH4 0xCC5D3C8B PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP3 SWAP2 SWAP1 PUSH2 0x5515 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST POP POP DUP4 PUSH1 0x0 PUSH2 0x903 DUP3 PUSH2 0x1B8D JUMP JUMPDEST SWAP1 POP PUSH2 0x90E DUP2 PUSH2 0x1C90 JUMP JUMPDEST PUSH2 0x919 DUP2 PUSH1 0x0 PUSH2 0x1CCE JUMP JUMPDEST PUSH2 0x921 PUSH2 0x1DB8 JUMP JUMPDEST PUSH1 0x0 DUP1 DUP1 PUSH2 0x931 DUP8 DUP10 ADD DUP10 PUSH2 0x5646 JUMP JUMPDEST SWAP3 POP SWAP3 POP SWAP3 POP PUSH1 0x0 DUP4 MLOAD GT PUSH2 0x959 JUMPI PUSH1 0x40 MLOAD PUSH4 0x7838439 PUSH1 0xE5 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x0 DUP3 MLOAD GT PUSH2 0x97B JUMPI PUSH1 0x40 MLOAD PUSH4 0x1E63BD95 PUSH1 0xE2 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP10 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH2 0x106 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD ISZERO PUSH2 0x9B3 JUMPI PUSH1 0x40 MLOAD PUSH4 0xD06866D PUSH1 0xE2 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0x60 DUP2 ADD DUP3 MSTORE TIMESTAMP DUP2 MSTORE PUSH1 0x20 DUP1 DUP3 ADD DUP7 DUP2 MSTORE DUP3 DUP5 ADD DUP7 SWAP1 MSTORE PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP14 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH2 0x106 SWAP1 SWAP3 MSTORE SWAP3 SWAP1 KECCAK256 DUP2 MLOAD DUP2 SSTORE SWAP2 MLOAD SWAP1 SWAP2 SWAP1 PUSH1 0x1 DUP3 ADD SWAP1 PUSH2 0x9FE SWAP1 DUP3 PUSH2 0x5742 JUMP JUMPDEST POP PUSH1 0x40 DUP3 ADD MLOAD PUSH1 0x2 DUP3 ADD SWAP1 PUSH2 0xA13 SWAP1 DUP3 PUSH2 0x5742 JUMP JUMPDEST POP POP POP PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP2 AND ISZERO PUSH2 0xA2F JUMPI PUSH2 0xA2F DUP10 DUP3 PUSH2 0x1DDE JUMP JUMPDEST DUP9 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH32 0x159567BEA25499A91F60E1FBB349FF2A1F8C1B2883198F25C1E12C99EDDB44FA DUP10 DUP10 PUSH1 0x40 MLOAD PUSH2 0xA6A SWAP3 SWAP2 SWAP1 PUSH2 0x5800 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 POP POP POP POP POP POP POP POP POP JUMP JUMPDEST PUSH2 0xA85 PUSH2 0x1AE3 JUMP JUMPDEST PUSH2 0xA8F DUP3 DUP3 PUSH2 0x1E35 JUMP JUMPDEST POP POP JUMP JUMPDEST CALLER PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x67 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND PUSH2 0xAC4 JUMPI PUSH1 0x40 MLOAD PUSH4 0x72E3EF97 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP2 SWAP1 PUSH2 0x5048 JUMP JUMPDEST POP PUSH2 0xACD PUSH2 0x1EEB JUMP JUMPDEST JUMP JUMPDEST PUSH2 0x848 CALLER DUP3 PUSH2 0x1F37 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0xAE4 PUSH2 0x1FDD JUMP JUMPDEST SWAP2 POP SWAP2 POP SWAP1 SWAP2 JUMP JUMPDEST PUSH2 0x106 PUSH1 0x20 MSTORE PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP1 KECCAK256 DUP1 SLOAD PUSH1 0x1 DUP3 ADD DUP1 SLOAD SWAP2 SWAP3 SWAP2 PUSH2 0xB0F SWAP1 PUSH2 0x56C1 JUMP JUMPDEST DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD PUSH2 0xB3B SWAP1 PUSH2 0x56C1 JUMP JUMPDEST DUP1 ISZERO PUSH2 0xB88 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0xB5D JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0xB88 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0xB6B JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP SWAP1 DUP1 PUSH1 0x2 ADD DUP1 SLOAD PUSH2 0xB9D SWAP1 PUSH2 0x56C1 JUMP JUMPDEST DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD PUSH2 0xBC9 SWAP1 PUSH2 0x56C1 JUMP JUMPDEST DUP1 ISZERO PUSH2 0xC16 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0xBEB JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0xC16 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0xBF9 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP SWAP1 POP DUP4 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP1 DUP3 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0xCF PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 DUP2 MLOAD PUSH2 0x120 DUP2 ADD DUP4 MSTORE DUP2 SLOAD SWAP1 SWAP6 AND DUP6 MSTORE PUSH1 0x1 DUP2 ADD SLOAD SWAP3 DUP6 ADD SWAP3 SWAP1 SWAP3 MSTORE PUSH1 0x2 DUP3 ADD SLOAD SWAP1 DUP5 ADD MSTORE PUSH1 0x3 DUP2 ADD SLOAD PUSH1 0x60 DUP5 ADD MSTORE PUSH1 0x4 DUP2 ADD SLOAD PUSH1 0x80 DUP5 ADD MSTORE PUSH1 0x5 DUP2 ADD SLOAD PUSH1 0xA0 DUP5 ADD MSTORE PUSH1 0x6 DUP2 ADD SLOAD PUSH1 0xC0 DUP5 ADD MSTORE PUSH1 0x7 DUP2 ADD SLOAD PUSH1 0xE0 DUP5 ADD MSTORE PUSH1 0x8 ADD SLOAD PUSH2 0x100 DUP4 ADD MSTORE SWAP1 DUP2 SWAP1 DUP2 SWAP1 DUP2 SWAP1 DUP2 SWAP1 DUP2 SWAP1 PUSH2 0xCB1 DUP2 PUSH2 0x2054 JUMP JUMPDEST DUP2 MLOAD PUSH1 0x20 DUP4 ADD MLOAD PUSH1 0x40 DUP5 ADD MLOAD PUSH1 0xC0 DUP6 ADD MLOAD PUSH1 0xE0 SWAP1 SWAP6 ADD MLOAD SWAP4 SWAP13 SWAP3 SWAP12 POP SWAP1 SWAP10 POP SWAP8 POP SWAP2 SWAP6 POP SWAP4 POP SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0xCE7 PUSH2 0x2073 JUMP JUMPDEST SLOAD PUSH1 0xFF AND SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH2 0x848 CALLER DUP3 PUSH2 0x1DDE JUMP JUMPDEST PUSH2 0xD03 PUSH2 0x1AE3 JUMP JUMPDEST PUSH2 0xACD PUSH1 0x0 PUSH2 0x2097 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0xAE4 PUSH2 0x20F3 JUMP JUMPDEST PUSH2 0xD20 PUSH2 0x1AE3 JUMP JUMPDEST PUSH2 0x848 DUP2 PUSH2 0x216A JUMP JUMPDEST PUSH2 0xD31 PUSH2 0x1AE3 JUMP JUMPDEST PUSH2 0xD3C DUP4 DUP4 DUP4 PUSH2 0x219F JUMP JUMPDEST POP POP POP JUMP JUMPDEST PUSH2 0xD49 PUSH2 0x1AE3 JUMP JUMPDEST PUSH2 0xD56 DUP2 PUSH3 0xF4240 LT ISZERO SWAP1 JUMP JUMPDEST DUP2 SWAP1 PUSH2 0xD78 JUMPI PUSH1 0x40 MLOAD PUSH4 0x1C9C717B PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP2 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 JUMP JUMPDEST POP PUSH2 0x108 DUP2 SWAP1 SSTORE PUSH1 0x40 MLOAD DUP2 DUP2 MSTORE PUSH32 0x6DEEF78FFE3DF79AE5CD8E40B842C36AC6077E13746B9B68A9F327537B01E4E9 SWAP1 PUSH1 0x20 ADD JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG1 POP JUMP JUMPDEST DUP3 PUSH2 0xDBF PUSH2 0x1B69 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0x7C145CC7 DUP3 ADDRESS CALLER PUSH1 0x40 MLOAD DUP5 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xDEE SWAP4 SWAP3 SWAP2 SWAP1 PUSH2 0x54D5 JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP7 GAS STATICCALL ISZERO DUP1 ISZERO PUSH2 0xE0B JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0xE2F SWAP2 SWAP1 PUSH2 0x54F8 JUMP JUMPDEST DUP2 CALLER SWAP1 SWAP2 PUSH2 0xE52 JUMPI PUSH1 0x40 MLOAD PUSH4 0xCC5D3C8B PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP3 SWAP2 SWAP1 PUSH2 0x5515 JUMP JUMPDEST POP POP PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP5 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH2 0x106 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP5 SWAP1 DUP2 SWAP1 PUSH2 0xE90 JUMPI PUSH1 0x40 MLOAD PUSH4 0xEE271899 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP2 SWAP1 PUSH2 0x5048 JUMP JUMPDEST POP PUSH2 0xE99 PUSH2 0x1DB8 JUMP JUMPDEST PUSH1 0x0 PUSH2 0xEA7 DUP5 DUP7 ADD DUP7 PUSH2 0x502B JUMP JUMPDEST SWAP1 POP PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP7 AND PUSH2 0xEBE PUSH1 0xCF DUP4 PUSH2 0x21F2 JUMP JUMPDEST MLOAD DUP8 SWAP2 DUP4 SWAP2 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND EQ PUSH2 0xEEC JUMPI PUSH1 0x40 MLOAD PUSH4 0xC0BBFF13 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP3 SWAP2 SWAP1 PUSH2 0x5515 JUMP JUMPDEST POP POP PUSH2 0xEF9 DUP2 PUSH1 0x0 PUSH2 0x2277 JUMP JUMPDEST DUP6 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH32 0x73330C218A680717E9EEE625C262DF66EDDFDF99ECB388D25F6B32D66B9A318A DUP7 DUP7 PUSH1 0x40 MLOAD PUSH2 0xF34 SWAP3 SWAP2 SWAP1 PUSH2 0x5800 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0xAE4 PUSH1 0x0 SLOAD PUSH1 0x1 SLOAD SWAP1 SWAP2 JUMP JUMPDEST DUP3 PUSH2 0xF5D PUSH2 0x1B69 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0x7C145CC7 DUP3 ADDRESS CALLER PUSH1 0x40 MLOAD DUP5 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xF8C SWAP4 SWAP3 SWAP2 SWAP1 PUSH2 0x54D5 JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP7 GAS STATICCALL ISZERO DUP1 ISZERO PUSH2 0xFA9 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0xFCD SWAP2 SWAP1 PUSH2 0x54F8 JUMP JUMPDEST DUP2 CALLER SWAP1 SWAP2 PUSH2 0xFF0 JUMPI PUSH1 0x40 MLOAD PUSH4 0xCC5D3C8B PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP3 SWAP2 SWAP1 PUSH2 0x5515 JUMP JUMPDEST POP POP DUP4 PUSH1 0x0 PUSH2 0xFFE DUP3 PUSH2 0x1B8D JUMP JUMPDEST SWAP1 POP PUSH2 0x1009 DUP2 PUSH2 0x1C90 JUMP JUMPDEST PUSH2 0x1014 DUP2 PUSH1 0x0 PUSH2 0x1CCE JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP7 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH2 0x106 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP7 SWAP1 DUP2 SWAP1 PUSH2 0x1050 JUMPI PUSH1 0x40 MLOAD PUSH4 0xEE271899 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP2 SWAP1 PUSH2 0x5048 JUMP JUMPDEST POP PUSH2 0x1059 PUSH2 0x1DB8 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP8 AND PUSH2 0x106E PUSH1 0xCF DUP9 PUSH2 0x21F2 JUMP JUMPDEST MLOAD DUP9 SWAP2 DUP9 SWAP2 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND EQ PUSH2 0x109C JUMPI PUSH1 0x40 MLOAD PUSH4 0xC0BBFF13 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP3 SWAP2 SWAP1 PUSH2 0x5515 JUMP JUMPDEST POP POP PUSH2 0x10BB DUP7 DUP7 PUSH1 0x2 PUSH1 0x18 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH4 0xFFFFFFFF AND PUSH2 0x23D9 JUMP JUMPDEST POP POP POP POP POP POP POP JUMP JUMPDEST PUSH2 0x10CC PUSH2 0x1AE3 JUMP JUMPDEST PUSH2 0x848 DUP2 PUSH1 0x0 NOT PUSH2 0x26D7 JUMP JUMPDEST CALLER PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x67 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND PUSH2 0x1109 JUMPI PUSH1 0x40 MLOAD PUSH4 0x72E3EF97 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP2 SWAP1 PUSH2 0x5048 JUMP JUMPDEST POP PUSH2 0xACD PUSH2 0x2746 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x60 DUP1 PUSH1 0x0 DUP1 PUSH1 0x0 PUSH1 0x60 PUSH1 0x0 PUSH2 0x1128 PUSH2 0x278D JUMP JUMPDEST DUP1 SLOAD SWAP1 SWAP2 POP ISZERO DUP1 ISZERO PUSH2 0x113C JUMPI POP PUSH1 0x1 DUP2 ADD SLOAD ISZERO JUMPDEST PUSH2 0x1180 JUMPI PUSH1 0x40 MLOAD PUSH3 0x461BCD PUSH1 0xE5 SHL DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x15 PUSH1 0x24 DUP3 ADD MSTORE PUSH21 0x1152540DCC4C8E88155B9A5B9A5D1A585B1A5E9959 PUSH1 0x5A SHL PUSH1 0x44 DUP3 ADD MSTORE PUSH1 0x64 ADD PUSH2 0x8EC JUMP JUMPDEST PUSH2 0x1188 PUSH2 0x27B1 JUMP JUMPDEST PUSH2 0x1190 PUSH2 0x2852 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0x0 DUP1 DUP3 MSTORE PUSH1 0x20 DUP3 ADD SWAP1 SWAP3 MSTORE PUSH1 0xF PUSH1 0xF8 SHL SWAP13 SWAP4 SWAP12 POP SWAP2 SWAP10 POP CHAINID SWAP9 POP ADDRESS SWAP8 POP SWAP6 POP SWAP4 POP SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0x11C6 PUSH2 0x286F JUMP JUMPDEST SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 DUP2 ADD SWAP1 SWAP2 MSTORE PUSH1 0x60 SWAP1 DUP3 PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP2 GT ISZERO PUSH2 0x1200 JUMPI PUSH2 0x1200 PUSH2 0x552F JUMP JUMPDEST PUSH1 0x40 MLOAD SWAP1 DUP1 DUP3 MSTORE DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD DUP3 ADD PUSH1 0x40 MSTORE DUP1 ISZERO PUSH2 0x1233 JUMPI DUP2 PUSH1 0x20 ADD JUMPDEST PUSH1 0x60 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 PUSH1 0x1 SWAP1 SUB SWAP1 DUP2 PUSH2 0x121E JUMPI SWAP1 POP JUMPDEST POP SWAP2 POP PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x12B5 JUMPI PUSH2 0x1290 ADDRESS DUP7 DUP7 DUP5 DUP2 DUP2 LT PUSH2 0x1257 JUMPI PUSH2 0x1257 PUSH2 0x5858 JUMP JUMPDEST SWAP1 POP PUSH1 0x20 MUL DUP2 ADD SWAP1 PUSH2 0x1269 SWAP2 SWAP1 PUSH2 0x586E JUMP JUMPDEST DUP6 PUSH1 0x40 MLOAD PUSH1 0x20 ADD PUSH2 0x127C SWAP4 SWAP3 SWAP2 SWAP1 PUSH2 0x58B4 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 DUP4 SUB SUB DUP2 MSTORE SWAP1 PUSH1 0x40 MSTORE PUSH2 0x2893 JUMP JUMPDEST DUP4 DUP3 DUP2 MLOAD DUP2 LT PUSH2 0x12A2 JUMPI PUSH2 0x12A2 PUSH2 0x5858 JUMP JUMPDEST PUSH1 0x20 SWAP1 DUP2 MUL SWAP2 SWAP1 SWAP2 ADD ADD MSTORE PUSH1 0x1 ADD PUSH2 0x1239 JUMP JUMPDEST POP POP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP5 PUSH2 0x12C9 PUSH2 0x1B69 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0x7C145CC7 DUP3 ADDRESS CALLER PUSH1 0x40 MLOAD DUP5 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x12F8 SWAP4 SWAP3 SWAP2 SWAP1 PUSH2 0x54D5 JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP7 GAS STATICCALL ISZERO DUP1 ISZERO PUSH2 0x1315 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x1339 SWAP2 SWAP1 PUSH2 0x54F8 JUMP JUMPDEST DUP2 CALLER SWAP1 SWAP2 PUSH2 0x135C JUMPI PUSH1 0x40 MLOAD PUSH4 0xCC5D3C8B PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP3 SWAP2 SWAP1 PUSH2 0x5515 JUMP JUMPDEST POP POP DUP6 PUSH1 0x0 PUSH2 0x136A DUP3 PUSH2 0x1B8D JUMP JUMPDEST SWAP1 POP PUSH2 0x1375 DUP2 PUSH2 0x1C90 JUMP JUMPDEST PUSH2 0x1380 DUP2 PUSH1 0x0 PUSH2 0x1CCE JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP9 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH2 0x106 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP9 SWAP1 DUP2 SWAP1 PUSH2 0x13BC JUMPI PUSH1 0x40 MLOAD PUSH4 0xEE271899 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP2 SWAP1 PUSH2 0x5048 JUMP JUMPDEST POP PUSH2 0x13C5 PUSH2 0x1DB8 JUMP JUMPDEST PUSH1 0x0 DUP1 DUP10 PUSH1 0x2 DUP2 GT ISZERO PUSH2 0x13DA JUMPI PUSH2 0x13DA PUSH2 0x58DB JUMP JUMPDEST SUB PUSH2 0x13F1 JUMPI PUSH2 0x13EA DUP11 DUP10 DUP10 PUSH2 0x2909 JUMP JUMPDEST SWAP1 POP PUSH2 0x1430 JUMP JUMPDEST PUSH1 0x2 DUP10 PUSH1 0x2 DUP2 GT ISZERO PUSH2 0x1405 JUMPI PUSH2 0x1405 PUSH2 0x58DB JUMP JUMPDEST SUB PUSH2 0x1415 JUMPI PUSH2 0x13EA DUP11 DUP10 DUP10 PUSH2 0x2E1D JUMP JUMPDEST DUP9 PUSH1 0x40 MLOAD PUSH4 0x47031CF PUSH1 0xE4 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP2 SWAP1 PUSH2 0x5913 JUMP JUMPDEST DUP9 PUSH1 0x2 DUP2 GT ISZERO PUSH2 0x1442 JUMPI PUSH2 0x1442 PUSH2 0x58DB JUMP JUMPDEST DUP11 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH32 0x54FE682BFB66381A9382E13E4B95A3DD4F960EAFBAE063FDEA3539D144FF3FF5 DUP4 PUSH1 0x40 MLOAD PUSH2 0x147D SWAP2 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 SWAP10 SWAP9 POP POP POP POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x12B8 DUP3 PUSH1 0x2 PUSH1 0x18 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH4 0xFFFFFFFF AND PUSH2 0x2EC1 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x84B PUSH2 0x2EE0 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x14C4 PUSH2 0x2F04 JUMP JUMPDEST DUP1 SLOAD SWAP1 SWAP2 POP PUSH1 0xFF PUSH1 0x1 PUSH1 0x40 SHL DUP3 DIV AND ISZERO SWAP1 PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB AND PUSH1 0x0 DUP2 ISZERO DUP1 ISZERO PUSH2 0x14EB JUMPI POP DUP3 JUMPDEST SWAP1 POP PUSH1 0x0 DUP3 PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB AND PUSH1 0x1 EQ DUP1 ISZERO PUSH2 0x1507 JUMPI POP ADDRESS EXTCODESIZE ISZERO JUMPDEST SWAP1 POP DUP2 ISZERO DUP1 ISZERO PUSH2 0x1515 JUMPI POP DUP1 ISZERO JUMPDEST ISZERO PUSH2 0x1533 JUMPI PUSH1 0x40 MLOAD PUSH4 0xF92EE8A9 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST DUP5 SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB NOT AND PUSH1 0x1 OR DUP6 SSTORE DUP4 ISZERO PUSH2 0x155C JUMPI DUP5 SLOAD PUSH1 0xFF PUSH1 0x40 SHL NOT AND PUSH1 0x1 PUSH1 0x40 SHL OR DUP6 SSTORE JUMPDEST PUSH2 0x1565 DUP10 PUSH2 0x2F2D JUMP JUMPDEST PUSH2 0x156D PUSH2 0x2F3E JUMP JUMPDEST PUSH2 0x1575 PUSH2 0x2F46 JUMP JUMPDEST PUSH2 0x157D PUSH2 0x2F5E JUMP JUMPDEST PUSH2 0x15C9 PUSH1 0x40 MLOAD DUP1 PUSH1 0x40 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0xF DUP2 MSTORE PUSH1 0x20 ADD PUSH15 0x537562677261706853657276696365 PUSH1 0x88 SHL DUP2 MSTORE POP PUSH1 0x40 MLOAD DUP1 PUSH1 0x40 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x3 DUP2 MSTORE PUSH1 0x20 ADD PUSH3 0x312E3 PUSH1 0xEC SHL DUP2 MSTORE POP PUSH2 0x2F6E JUMP JUMPDEST PUSH2 0x15D5 DUP9 PUSH1 0x0 NOT PUSH2 0x26D7 JUMP JUMPDEST PUSH2 0x15DE DUP8 PUSH2 0x1B15 JUMP JUMPDEST PUSH2 0x15E7 DUP7 PUSH2 0x2F88 JUMP JUMPDEST DUP4 ISZERO PUSH2 0x162D JUMPI DUP5 SLOAD PUSH1 0xFF PUSH1 0x40 SHL NOT AND DUP6 SSTORE PUSH1 0x40 MLOAD PUSH1 0x1 DUP2 MSTORE PUSH32 0xC7F505B2F371AE2175EE4913F4499E1F2633A7B5936321EED1CDAEB6115181D2 SWAP1 PUSH1 0x20 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG1 JUMPDEST POP POP POP POP POP POP POP POP POP JUMP JUMPDEST CALLER PUSH32 0x0 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP2 AND DUP3 EQ PUSH2 0x1685 JUMPI PUSH1 0x40 MLOAD PUSH4 0xCDC0567F PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP3 SWAP2 SWAP1 PUSH2 0x5515 JUMP JUMPDEST POP PUSH1 0x0 SWAP1 POP DUP1 PUSH2 0x1697 DUP4 DUP6 ADD DUP6 PUSH2 0x5921 JUMP JUMPDEST SWAP2 POP SWAP2 POP PUSH2 0x16A3 PUSH2 0x1B69 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0xE76FEDE6 DUP7 DUP5 DUP5 PUSH2 0x16BC PUSH2 0x2FDF JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH1 0xE0 DUP7 SWAP1 SHL PUSH1 0x1 PUSH1 0x1 PUSH1 0xE0 SHL SUB NOT AND DUP2 MSTORE PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB SWAP5 DUP6 AND PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x24 DUP2 ADD SWAP4 SWAP1 SWAP4 MSTORE PUSH1 0x44 DUP4 ADD SWAP2 SWAP1 SWAP2 MSTORE SWAP1 SWAP2 AND PUSH1 0x64 DUP3 ADD MSTORE PUSH1 0x84 ADD PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x1715 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x1729 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP DUP5 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH32 0x2F2E74A11116E05B39159372CCEB6739257B08D72F7171D208FF27BB6466C58 DUP4 PUSH1 0x40 MLOAD PUSH2 0x1768 SWAP2 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 POP POP POP POP POP JUMP JUMPDEST DUP3 PUSH2 0x1780 PUSH2 0x1B69 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0x7C145CC7 DUP3 ADDRESS CALLER PUSH1 0x40 MLOAD DUP5 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x17AF SWAP4 SWAP3 SWAP2 SWAP1 PUSH2 0x54D5 JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP7 GAS STATICCALL ISZERO DUP1 ISZERO PUSH2 0x17CC JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x17F0 SWAP2 SWAP1 PUSH2 0x54F8 JUMP JUMPDEST DUP2 CALLER SWAP1 SWAP2 PUSH2 0x1813 JUMPI PUSH1 0x40 MLOAD PUSH4 0xCC5D3C8B PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP3 SWAP2 SWAP1 PUSH2 0x5515 JUMP JUMPDEST POP POP PUSH2 0x181D PUSH2 0x1DB8 JUMP JUMPDEST PUSH2 0x1826 DUP5 PUSH2 0x3003 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP6 AND SWAP1 PUSH32 0xF53CF6521A1B5FC0C04BFFA70374A4DC2E3474F2B2AC1643C3BCC54E2DB4A939 SWAP1 PUSH1 0x0 SWAP1 LOG2 POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x186C DUP4 DUP4 PUSH2 0x3076 JUMP JUMPDEST SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x84B PUSH2 0x2FDF JUMP JUMPDEST DUP3 PUSH2 0x1886 PUSH2 0x1B69 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0x7C145CC7 DUP3 ADDRESS CALLER PUSH1 0x40 MLOAD DUP5 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x18B5 SWAP4 SWAP3 SWAP2 SWAP1 PUSH2 0x54D5 JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP7 GAS STATICCALL ISZERO DUP1 ISZERO PUSH2 0x18D2 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x18F6 SWAP2 SWAP1 PUSH2 0x54F8 JUMP JUMPDEST DUP2 CALLER SWAP1 SWAP2 PUSH2 0x1919 JUMPI PUSH1 0x40 MLOAD PUSH4 0xCC5D3C8B PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP3 SWAP2 SWAP1 PUSH2 0x5515 JUMP JUMPDEST POP POP DUP4 PUSH1 0x0 PUSH2 0x1927 DUP3 PUSH2 0x1B8D JUMP JUMPDEST SWAP1 POP PUSH2 0x1932 DUP2 PUSH2 0x1C90 JUMP JUMPDEST PUSH2 0x193D DUP2 PUSH1 0x0 PUSH2 0x1CCE JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP7 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH2 0x106 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP7 SWAP1 DUP2 SWAP1 PUSH2 0x1979 JUMPI PUSH1 0x40 MLOAD PUSH4 0xEE271899 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP2 SWAP1 PUSH2 0x5048 JUMP JUMPDEST POP PUSH2 0x1982 PUSH2 0x1DB8 JUMP JUMPDEST PUSH1 0x0 DUP1 DUP1 DUP1 PUSH2 0x1993 DUP10 DUP12 ADD DUP12 PUSH2 0x5943 JUMP JUMPDEST SWAP4 POP SWAP4 POP SWAP4 POP SWAP4 POP PUSH2 0x19BB DUP12 DUP4 DUP7 DUP7 DUP6 PUSH1 0x2 PUSH1 0x18 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH4 0xFFFFFFFF AND PUSH2 0x30E5 JUMP JUMPDEST DUP11 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH32 0xD3803EB82EF5B4CDFF8646734EBBAF5B37441E96314B27FFD3D0940F12A038E7 DUP12 DUP12 PUSH1 0x40 MLOAD PUSH2 0x19F6 SWAP3 SWAP2 SWAP1 PUSH2 0x5800 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 POP POP POP POP POP POP POP POP POP POP POP JUMP JUMPDEST PUSH2 0x1A13 PUSH2 0x1AE3 JUMP JUMPDEST PUSH2 0x848 DUP2 PUSH2 0x2F88 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x84B PUSH2 0x32DC JUMP JUMPDEST PUSH2 0x1A2E PUSH2 0x1DB8 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x1A3B PUSH1 0xCF DUP4 PUSH2 0x21F2 JUMP JUMPDEST SWAP1 POP PUSH2 0x1A52 PUSH1 0xD2 SLOAD DUP3 PUSH2 0x3300 SWAP1 SWAP2 SWAP1 PUSH4 0xFFFFFFFF AND JUMP JUMPDEST DUP3 SWAP1 PUSH2 0x1A71 JUMPI PUSH1 0x40 MLOAD PUSH3 0x3477B5 PUSH1 0xE5 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP2 SWAP1 PUSH2 0x5048 JUMP JUMPDEST POP PUSH2 0x1A7B DUP2 PUSH2 0x333D JUMP JUMPDEST ISZERO DUP3 SWAP1 PUSH2 0x1A9C JUMPI PUSH1 0x40 MLOAD PUSH4 0x17C7B35D PUSH1 0xE3 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP2 SWAP1 PUSH2 0x5048 JUMP JUMPDEST POP PUSH2 0xA8F DUP3 PUSH1 0x1 PUSH2 0x2277 JUMP JUMPDEST PUSH2 0x1AB0 PUSH2 0x1AE3 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP2 AND PUSH2 0x1ADA JUMPI PUSH1 0x0 PUSH1 0x40 MLOAD PUSH4 0x1E4FBDF7 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP2 SWAP1 PUSH2 0x5048 JUMP JUMPDEST PUSH2 0x848 DUP2 PUSH2 0x2097 JUMP JUMPDEST CALLER PUSH2 0x1AEC PUSH2 0x11BB JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND EQ PUSH2 0xACD JUMPI CALLER PUSH1 0x40 MLOAD PUSH4 0x118CDAA7 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP2 SWAP1 PUSH2 0x5048 JUMP JUMPDEST PUSH1 0x2 DUP1 SLOAD PUSH4 0xFFFFFFFF PUSH1 0xC0 SHL NOT AND PUSH1 0x1 PUSH1 0xC0 SHL PUSH4 0xFFFFFFFF DUP5 AND SWAP1 DUP2 MUL SWAP2 SWAP1 SWAP2 OR SWAP1 SWAP2 SSTORE PUSH1 0x40 MLOAD SWAP1 DUP2 MSTORE PUSH32 0x472ABA493F9FD1D136EC54986F619F3AA5CAFF964F0E731A9909FB9A1270211F SWAP1 PUSH1 0x20 ADD PUSH2 0xDAB JUMP JUMPDEST PUSH32 0x0 SWAP1 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH2 0x140 DUP2 ADD DUP3 MSTORE PUSH1 0x0 DUP1 DUP3 MSTORE PUSH1 0x20 DUP3 ADD DUP2 SWAP1 MSTORE SWAP2 DUP2 ADD DUP3 SWAP1 MSTORE PUSH1 0x60 DUP2 ADD DUP3 SWAP1 MSTORE PUSH1 0x80 DUP2 ADD DUP3 SWAP1 MSTORE PUSH1 0xA0 DUP2 ADD DUP3 SWAP1 MSTORE PUSH1 0xC0 DUP2 ADD DUP3 SWAP1 MSTORE PUSH1 0xE0 DUP2 ADD DUP3 SWAP1 MSTORE PUSH2 0x100 DUP2 ADD DUP3 SWAP1 MSTORE PUSH2 0x120 DUP2 ADD DUP3 SWAP1 MSTORE SWAP1 PUSH2 0x1BE6 PUSH2 0x1B69 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0x25D9897E DUP5 ADDRESS PUSH1 0x40 MLOAD DUP4 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x1C13 SWAP3 SWAP2 SWAP1 PUSH2 0x5515 JUMP JUMPDEST PUSH2 0x140 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP7 GAS STATICCALL ISZERO DUP1 ISZERO PUSH2 0x1C31 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x1C55 SWAP2 SWAP1 PUSH2 0x59D0 JUMP JUMPDEST SWAP1 POP DUP1 PUSH1 0xA0 ADD MLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB AND PUSH1 0x0 EQ ISZERO DUP4 SWAP1 PUSH2 0x1C89 JUMPI PUSH1 0x40 MLOAD PUSH4 0x7B3C09BF PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP2 SWAP1 PUSH2 0x5048 JUMP JUMPDEST POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x20 DUP2 ADD MLOAD DUP2 MLOAD PUSH2 0x848 SWAP2 PUSH2 0x1CA4 SWAP2 PUSH2 0x5845 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0x1 SLOAD PUSH1 0x40 MLOAD DUP1 PUSH1 0x40 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x6 DUP2 MSTORE PUSH1 0x20 ADD PUSH6 0x746F6B656E73 PUSH1 0xD0 SHL DUP2 MSTORE POP PUSH2 0x335C JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0x1CD9 PUSH2 0x20F3 JUMP JUMPDEST SWAP2 POP SWAP2 POP PUSH1 0x0 DUP4 PUSH2 0x1CEE JUMPI DUP5 PUSH1 0x80 ADD MLOAD PUSH2 0x1CF4 JUMP JUMPDEST DUP5 PUSH1 0xE0 ADD MLOAD JUMPDEST SWAP1 POP PUSH2 0x1D42 DUP2 PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB AND DUP5 PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB AND DUP5 PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB AND PUSH1 0x40 MLOAD DUP1 PUSH1 0x40 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0xD DUP2 MSTORE PUSH1 0x20 ADD PUSH13 0x1D1A185DDA5B99D4195C9A5BD9 PUSH1 0x9A SHL DUP2 MSTORE POP PUSH2 0x335C JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0x1D4D PUSH2 0x1FDD JUMP JUMPDEST SWAP2 POP SWAP2 POP PUSH1 0x0 DUP7 PUSH2 0x1D62 JUMPI DUP8 PUSH1 0x60 ADD MLOAD PUSH2 0x1D68 JUMP JUMPDEST DUP8 PUSH1 0xC0 ADD MLOAD JUMPDEST SWAP1 POP PUSH2 0x1DAE DUP2 PUSH4 0xFFFFFFFF AND DUP5 PUSH4 0xFFFFFFFF AND DUP5 PUSH4 0xFFFFFFFF AND PUSH1 0x40 MLOAD DUP1 PUSH1 0x40 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0xE DUP2 MSTORE PUSH1 0x20 ADD PUSH14 0x1B585E15995C9A599A595C90DD5D PUSH1 0x92 SHL DUP2 MSTORE POP PUSH2 0x335C JUMP JUMPDEST POP POP POP POP POP POP POP POP JUMP JUMPDEST PUSH2 0x1DC0 PUSH2 0xCDC JUMP JUMPDEST ISZERO PUSH2 0xACD JUMPI PUSH1 0x40 MLOAD PUSH4 0xD93C0665 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP3 DUP2 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH2 0x109 PUSH1 0x20 MSTORE PUSH1 0x40 DUP1 DUP3 KECCAK256 DUP1 SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB NOT AND SWAP5 DUP7 AND SWAP5 DUP6 OR SWAP1 SSTORE MLOAD PUSH31 0x3215DC05A2FC4E6A1E2C2776311D207C730EE51085AAE221ACC5CBE6FB55C1 SWAP2 SWAP1 LOG3 POP POP JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP3 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x67 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP3 SWAP1 DUP3 SWAP1 PUSH1 0xFF AND ISZERO ISZERO DUP2 ISZERO EQ PUSH2 0x1E8A JUMPI PUSH1 0x40 MLOAD PUSH4 0x5E67E54B PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB SWAP1 SWAP3 AND PUSH1 0x4 DUP4 ADD MSTORE ISZERO ISZERO PUSH1 0x24 DUP3 ADD MSTORE PUSH1 0x44 ADD PUSH2 0x8EC JUMP JUMPDEST POP POP PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP3 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x67 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP2 DUP3 SWAP1 KECCAK256 DUP1 SLOAD PUSH1 0xFF NOT AND DUP6 ISZERO ISZERO SWAP1 DUP2 OR SWAP1 SWAP2 SSTORE SWAP2 MLOAD SWAP2 DUP3 MSTORE PUSH32 0xA95BAC2F3DF0D40E8278281C1D39D53C60E4F2BF3550CA5665738D0916E89789 SWAP2 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 POP POP JUMP JUMPDEST PUSH2 0x1EF3 PUSH2 0x3390 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x1EFD PUSH2 0x2073 JUMP JUMPDEST DUP1 SLOAD PUSH1 0xFF NOT AND DUP2 SSTORE SWAP1 POP PUSH32 0x5DB9EE0A495BF2E6FF9C91A7834C1BA4FDD244A5E8AA4E537BD38AEAE4B073AA CALLER JUMPDEST PUSH1 0x40 MLOAD PUSH2 0xDAB SWAP2 SWAP1 PUSH2 0x5048 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP3 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x9C PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 DUP2 MLOAD SWAP3 DUP4 ADD DUP5 SWAP1 MSTORE DUP3 DUP3 ADD SWAP5 SWAP1 SWAP5 MSTORE DUP1 MLOAD DUP1 DUP4 SUB DUP3 ADD DUP2 MSTORE PUSH1 0x60 SWAP1 SWAP3 ADD SWAP1 MSTORE DUP2 SWAP1 PUSH2 0x1F8B SWAP1 DUP5 SWAP1 PUSH2 0x33B5 SWAP1 PUSH2 0x33CA SWAP1 PUSH2 0x34C5 SWAP1 DUP10 PUSH2 0x34EA JUMP JUMPDEST SWAP2 POP SWAP2 POP DUP5 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH32 0x13F3FA9F0E54AF1AF76D8B5D11C3973D7C2AED6312B61EFFF2F7B49D73AD67EB DUP4 DUP4 DUP1 PUSH1 0x20 ADD SWAP1 MLOAD DUP2 ADD SWAP1 PUSH2 0x1FCF SWAP2 SWAP1 PUSH2 0x5A7D JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1768 SWAP3 SWAP2 SWAP1 PUSH2 0x5277 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0x1FE8 PUSH2 0x2FDF JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0xBB2A2B47 PUSH1 0x40 MLOAD DUP2 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP7 GAS STATICCALL ISZERO DUP1 ISZERO PUSH2 0x2025 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x2049 SWAP2 SWAP1 PUSH2 0x5A96 JUMP JUMPDEST SWAP3 PUSH3 0xF4240 SWAP3 POP SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x2063 DUP3 PUSH1 0x60 ADD MLOAD ISZERO ISZERO SWAP1 JUMP JUMPDEST DUP1 ISZERO PUSH2 0x12B8 JUMPI POP POP PUSH1 0x80 ADD MLOAD ISZERO SWAP1 JUMP JUMPDEST PUSH32 0xCD5ED15C6E187E77E9AEE88184C21F4F2182AB5827CB3B7E07FBEDCD63F03300 SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x20A1 PUSH2 0x286F JUMP JUMPDEST DUP1 SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP5 DUP2 AND PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB NOT DUP4 AND DUP2 OR DUP5 SSTORE PUSH1 0x40 MLOAD SWAP4 SWAP5 POP SWAP2 AND SWAP2 DUP3 SWAP1 PUSH32 0x8BE0079C531659141344CD1FD0A4F28419497F9722A3DAAFE3B4186F6B6457E0 SWAP1 PUSH1 0x0 SWAP1 LOG3 POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH2 0x2100 PUSH2 0x2FDF JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0x5AEA0EC4 PUSH1 0x40 MLOAD DUP2 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP7 GAS STATICCALL ISZERO DUP1 ISZERO PUSH2 0x213D JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x2161 SWAP2 SWAP1 PUSH2 0x5AB3 JUMP JUMPDEST SWAP4 DUP5 SWAP4 POP SWAP2 POP POP JUMP JUMPDEST PUSH1 0xD2 DUP2 SWAP1 SSTORE PUSH1 0x40 MLOAD DUP2 DUP2 MSTORE PUSH32 0x21774046E2611DDB52C8C46E1AD97524EEB2E3FDA7DCD9428867868B4C4D06BA SWAP1 PUSH1 0x20 ADD PUSH2 0xDAB JUMP JUMPDEST PUSH2 0x21AC PUSH1 0xD0 DUP5 DUP5 DUP5 PUSH2 0x35A4 JUMP JUMPDEST DUP1 DUP3 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND DUP5 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH32 0xD54C7ABC930F6D506DA2D08AA7AEAD4F2443E1DB6D5F560384A2F652FF893E19 PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG4 POP POP POP JUMP JUMPDEST PUSH2 0x21FA PUSH2 0x4FAE JUMP JUMPDEST PUSH2 0x2204 DUP4 DUP4 PUSH2 0x3653 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH2 0x120 DUP2 ADD DUP3 MSTORE DUP3 SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND DUP2 MSTORE PUSH1 0x1 DUP4 ADD SLOAD PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x2 DUP4 ADD SLOAD SWAP2 DUP2 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH1 0x3 DUP3 ADD SLOAD PUSH1 0x60 DUP3 ADD MSTORE PUSH1 0x4 DUP3 ADD SLOAD PUSH1 0x80 DUP3 ADD MSTORE PUSH1 0x5 DUP3 ADD SLOAD PUSH1 0xA0 DUP3 ADD MSTORE PUSH1 0x6 DUP3 ADD SLOAD PUSH1 0xC0 DUP3 ADD MSTORE PUSH1 0x7 DUP3 ADD SLOAD PUSH1 0xE0 DUP3 ADD MSTORE PUSH1 0x8 SWAP1 SWAP2 ADD SLOAD PUSH2 0x100 DUP3 ADD MSTORE SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x2284 PUSH1 0xCF DUP5 PUSH2 0x21F2 JUMP JUMPDEST SWAP1 POP PUSH2 0x230F DUP4 PUSH2 0x2292 PUSH2 0x3706 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0xEEAC3E0E DUP5 PUSH1 0x20 ADD MLOAD PUSH1 0x40 MLOAD DUP3 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x22C3 SWAP2 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 GAS CALL ISZERO DUP1 ISZERO PUSH2 0x22E2 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x2306 SWAP2 SWAP1 PUSH2 0x5A7D JUMP JUMPDEST PUSH1 0xCF SWAP2 SWAP1 PUSH2 0x372A JUMP JUMPDEST PUSH2 0x231A PUSH1 0xCF DUP5 PUSH2 0x37DD JUMP JUMPDEST DUP1 MLOAD PUSH1 0x40 DUP3 ADD MLOAD PUSH2 0x232D SWAP2 PUSH1 0xD1 SWAP2 PUSH2 0x3893 JUMP JUMPDEST DUP1 PUSH1 0x40 ADD MLOAD PUSH1 0xD3 PUSH1 0x0 DUP4 PUSH1 0x20 ADD MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD PUSH2 0x2354 SWAP2 SWAP1 PUSH2 0x5845 JUMP JUMPDEST PUSH1 0xD3 PUSH1 0x0 DUP4 PUSH1 0x20 ADD MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 DUP2 SWAP1 SSTORE POP DUP1 PUSH1 0x20 ADD MLOAD DUP4 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND DUP3 PUSH1 0x0 ADD MLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH32 0x8F2F865E0FB62D722A51E4D9873199BF6BF52E7D8EE5A2EE2896C9EF719F545 DUP5 PUSH1 0x40 ADD MLOAD DUP7 PUSH1 0x40 MLOAD PUSH2 0x23CC SWAP3 SWAP2 SWAP1 SWAP2 DUP3 MSTORE ISZERO ISZERO PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG4 POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x23E6 PUSH1 0xCF DUP6 PUSH2 0x21F2 JUMP JUMPDEST SWAP1 POP PUSH2 0x23F1 DUP2 PUSH2 0x2054 JUMP JUMPDEST DUP5 SWAP1 PUSH2 0x2411 JUMPI PUSH1 0x40 MLOAD PUSH4 0x1EB5FF95 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP2 SWAP1 PUSH2 0x5048 JUMP JUMPDEST POP DUP1 PUSH1 0x40 ADD MLOAD DUP4 EQ ISZERO DUP5 DUP5 SWAP1 SWAP2 PUSH2 0x243D JUMPI PUSH1 0x40 MLOAD PUSH4 0xF32518CD PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP3 SWAP2 SWAP1 PUSH2 0x5AD0 JUMP JUMPDEST POP POP PUSH1 0x40 DUP2 ADD MLOAD DUP1 DUP5 GT ISZERO PUSH2 0x2473 JUMPI PUSH2 0x246E PUSH2 0x2457 PUSH2 0x1B69 JUMP JUMPDEST DUP4 MLOAD PUSH2 0x2463 DUP5 DUP9 PUSH2 0x5845 JUMP JUMPDEST PUSH1 0xD1 SWAP3 SWAP2 SWAP1 DUP8 PUSH2 0x3911 JUMP JUMPDEST PUSH2 0x248C JUMP JUMPDEST DUP2 MLOAD PUSH2 0x248C SWAP1 PUSH2 0x2483 DUP7 DUP5 PUSH2 0x5845 JUMP JUMPDEST PUSH1 0xD1 SWAP2 SWAP1 PUSH2 0x3893 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x2496 PUSH2 0x3706 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0xEEAC3E0E DUP5 PUSH1 0x20 ADD MLOAD PUSH1 0x40 MLOAD DUP3 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x24C7 SWAP2 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 GAS CALL ISZERO DUP1 ISZERO PUSH2 0x24E6 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x250A SWAP2 SWAP1 PUSH2 0x5A7D JUMP JUMPDEST SWAP1 POP PUSH1 0x0 PUSH2 0x2517 DUP5 PUSH2 0x333D JUMP JUMPDEST ISZERO PUSH2 0x2523 JUMPI PUSH1 0x0 PUSH2 0x2532 JUMP JUMPDEST PUSH1 0xC0 DUP5 ADD MLOAD PUSH2 0x2532 SWAP1 DUP4 PUSH2 0x5845 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP9 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0xCF PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 PUSH1 0x2 DUP2 ADD DUP9 SWAP1 SSTORE PUSH1 0x6 ADD DUP4 SWAP1 SSTORE SWAP1 POP PUSH2 0x2561 PUSH2 0x3706 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0xC8A5F81E DUP5 DUP4 PUSH1 0x40 MLOAD DUP4 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x258E SWAP3 SWAP2 SWAP1 PUSH2 0x5277 JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP7 GAS STATICCALL ISZERO DUP1 ISZERO PUSH2 0x25AB JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x25CF SWAP2 SWAP1 PUSH2 0x5A7D JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP9 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0xCF PUSH1 0x20 MSTORE PUSH1 0x40 DUP2 KECCAK256 PUSH1 0x7 ADD DUP1 SLOAD SWAP1 SWAP2 SWAP1 PUSH2 0x25FA SWAP1 DUP5 SWAP1 PUSH2 0x5AE9 JUMP JUMPDEST SWAP1 SWAP2 SSTORE POP POP DUP3 DUP7 GT ISZERO PUSH2 0x2642 JUMPI PUSH2 0x2611 DUP4 DUP8 PUSH2 0x5845 JUMP JUMPDEST PUSH1 0xD3 PUSH1 0x0 DUP7 PUSH1 0x20 ADD MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD PUSH2 0x2637 SWAP2 SWAP1 PUSH2 0x5AE9 JUMP JUMPDEST SWAP1 SWAP2 SSTORE POP PUSH2 0x2678 SWAP1 POP JUMP JUMPDEST PUSH2 0x264C DUP7 DUP5 PUSH2 0x5845 JUMP JUMPDEST PUSH1 0xD3 PUSH1 0x0 DUP7 PUSH1 0x20 ADD MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD PUSH2 0x2672 SWAP2 SWAP1 PUSH2 0x5845 JUMP JUMPDEST SWAP1 SWAP2 SSTORE POP POP JUMPDEST DUP4 PUSH1 0x20 ADD MLOAD DUP8 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND DUP6 PUSH1 0x0 ADD MLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH32 0x6DB4A6F9BE2D5E72EB2A2AF2374AC487971BF342A261BA0BC1CF471BF2A2C31F DUP10 DUP8 PUSH1 0x40 MLOAD PUSH2 0x26C6 SWAP3 SWAP2 SWAP1 PUSH2 0x5277 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG4 POP POP POP POP POP POP POP JUMP JUMPDEST DUP2 DUP2 DUP1 DUP3 GT ISZERO PUSH2 0x26FC JUMPI PUSH1 0x40 MLOAD PUSH4 0xCCCCDAFB PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP3 SWAP2 SWAP1 PUSH2 0x5277 JUMP JUMPDEST POP POP PUSH1 0x0 DUP3 SWAP1 SSTORE PUSH1 0x1 DUP2 SWAP1 SSTORE PUSH1 0x40 MLOAD PUSH32 0x90699B8B4BF48918FEA1129C85F9BC7B51285DF7ECC982910813C7805F568849 SWAP1 PUSH2 0x273A SWAP1 DUP5 SWAP1 DUP5 SWAP1 PUSH2 0x5277 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG1 POP POP JUMP JUMPDEST PUSH2 0x274E PUSH2 0x1DB8 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x2758 PUSH2 0x2073 JUMP JUMPDEST DUP1 SLOAD PUSH1 0xFF NOT AND PUSH1 0x1 OR DUP2 SSTORE SWAP1 POP PUSH32 0x62E78CEA01BEE320CD4E420270B5EA74000D11B0C9F74754EBDBFC544B05A258 PUSH2 0x1F2A CALLER SWAP1 JUMP JUMPDEST PUSH32 0xA16A46D94261C7517CC8FF89F61C0CE93598E3C849801011DEE649A6A557D100 SWAP1 JUMP JUMPDEST PUSH1 0x60 PUSH1 0x0 PUSH2 0x27BD PUSH2 0x278D JUMP JUMPDEST SWAP1 POP DUP1 PUSH1 0x2 ADD DUP1 SLOAD PUSH2 0x27CE SWAP1 PUSH2 0x56C1 JUMP JUMPDEST DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD PUSH2 0x27FA SWAP1 PUSH2 0x56C1 JUMP JUMPDEST DUP1 ISZERO PUSH2 0x2847 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x281C JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x2847 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x282A JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP SWAP2 POP POP SWAP1 JUMP JUMPDEST PUSH1 0x60 PUSH1 0x0 PUSH2 0x285E PUSH2 0x278D JUMP JUMPDEST SWAP1 POP DUP1 PUSH1 0x3 ADD DUP1 SLOAD PUSH2 0x27CE SWAP1 PUSH2 0x56C1 JUMP JUMPDEST PUSH32 0x9016D09D72D40FDAE2FD8CEAC6B6234C7706214FD39C1CD1E609A0528C199300 SWAP1 JUMP JUMPDEST PUSH1 0x60 PUSH1 0x0 DUP1 DUP5 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND DUP5 PUSH1 0x40 MLOAD PUSH2 0x28B0 SWAP2 SWAP1 PUSH2 0x5AFC JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP6 GAS DELEGATECALL SWAP2 POP POP RETURNDATASIZE DUP1 PUSH1 0x0 DUP2 EQ PUSH2 0x28EB JUMPI PUSH1 0x40 MLOAD SWAP2 POP PUSH1 0x1F NOT PUSH1 0x3F RETURNDATASIZE ADD AND DUP3 ADD PUSH1 0x40 MSTORE RETURNDATASIZE DUP3 MSTORE RETURNDATASIZE PUSH1 0x0 PUSH1 0x20 DUP5 ADD RETURNDATACOPY PUSH2 0x28F0 JUMP JUMPDEST PUSH1 0x60 SWAP2 POP JUMPDEST POP SWAP2 POP SWAP2 POP PUSH2 0x2900 DUP6 DUP4 DUP4 PUSH2 0x3A0F JUMP JUMPDEST SWAP6 SWAP5 POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 DUP1 PUSH2 0x2919 DUP5 DUP7 ADD DUP7 PUSH2 0x5B3A JUMP JUMPDEST DUP2 MLOAD PUSH1 0x40 ADD MLOAD SWAP2 SWAP4 POP SWAP2 POP DUP7 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP3 DUP2 AND SWAP1 DUP3 AND EQ PUSH2 0x2953 JUMPI PUSH1 0x40 MLOAD PUSH4 0x1A071D07 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP3 SWAP2 SWAP1 PUSH2 0x5515 JUMP JUMPDEST POP POP DUP2 MLOAD MLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP2 GT ISZERO PUSH2 0x2983 JUMPI PUSH1 0x40 MLOAD PUSH4 0xFA4AC7A7 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP2 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 JUMP JUMPDEST POP DUP2 MLOAD MLOAD PUSH1 0x0 PUSH2 0x2994 PUSH1 0xCF DUP4 PUSH2 0x21F2 JUMP JUMPDEST DUP1 MLOAD SWAP1 SWAP2 POP DUP9 SWAP1 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP2 DUP2 AND SWAP1 DUP4 AND EQ PUSH2 0x29C9 JUMPI PUSH1 0x40 MLOAD PUSH4 0x4508FBF7 PUSH1 0xE1 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP3 SWAP2 SWAP1 PUSH2 0x5515 JUMP JUMPDEST POP POP PUSH1 0x20 DUP2 ADD MLOAD PUSH2 0x29DB DUP10 PUSH1 0x0 PUSH2 0x1F37 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH2 0x29E8 PUSH2 0x3A62 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0x70A08231 ADDRESS PUSH1 0x40 MLOAD DUP3 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x2A13 SWAP2 SWAP1 PUSH2 0x5048 JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP7 GAS STATICCALL ISZERO DUP1 ISZERO PUSH2 0x2A30 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x2A54 SWAP2 SWAP1 PUSH2 0x5A7D JUMP JUMPDEST SWAP1 POP PUSH2 0x2A5E PUSH2 0x32DC JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0x692209CE PUSH1 0x0 PUSH2 0x2AFC DUP12 PUSH2 0x2A7A PUSH2 0x2EE0 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0x4C4EA0ED DUP11 PUSH1 0x40 MLOAD DUP3 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x2AA7 SWAP2 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP7 GAS STATICCALL ISZERO DUP1 ISZERO PUSH2 0x2AC4 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x2AE8 SWAP2 SWAP1 PUSH2 0x54F8 JUMP JUMPDEST PUSH2 0x2AF3 JUMPI PUSH1 0x0 PUSH2 0x3A86 JUMP JUMPDEST PUSH2 0x108 SLOAD PUSH2 0x3A86 JUMP JUMPDEST DUP11 PUSH1 0x40 MLOAD DUP5 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x2B1B SWAP4 SWAP3 SWAP2 SWAP1 PUSH2 0x5C71 JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 GAS CALL ISZERO DUP1 ISZERO PUSH2 0x2B3A JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x2B5E SWAP2 SWAP1 PUSH2 0x5A7D JUMP JUMPDEST SWAP3 POP PUSH1 0x0 PUSH2 0x2B6A PUSH2 0x3A62 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0x70A08231 ADDRESS PUSH1 0x40 MLOAD DUP3 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x2B95 SWAP2 SWAP1 PUSH2 0x5048 JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP7 GAS STATICCALL ISZERO DUP1 ISZERO PUSH2 0x2BB2 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x2BD6 SWAP2 SWAP1 PUSH2 0x5A7D JUMP JUMPDEST SWAP1 POP DUP2 DUP2 DUP2 DUP2 LT ISZERO PUSH2 0x2BFD JUMPI PUSH1 0x40 MLOAD PUSH4 0x9DB8BC95 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP3 SWAP2 SWAP1 PUSH2 0x5277 JUMP JUMPDEST POP PUSH2 0x2C0A SWAP1 POP DUP3 DUP3 PUSH2 0x5845 JUMP JUMPDEST SWAP3 POP POP DUP3 ISZERO SWAP1 POP PUSH2 0x2DB4 JUMPI PUSH2 0x2CA9 DUP12 PUSH2 0x107 SLOAD DUP5 PUSH2 0x2C28 SWAP2 SWAP1 PUSH2 0x5CA1 JUMP JUMPDEST PUSH2 0x2C30 PUSH2 0x2FDF JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0x5AEA0EC4 PUSH1 0x40 MLOAD DUP2 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP7 GAS STATICCALL ISZERO DUP1 ISZERO PUSH2 0x2C6D JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x2C91 SWAP2 SWAP1 PUSH2 0x5AB3 JUMP JUMPDEST PUSH2 0x2CA4 SWAP1 PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB AND TIMESTAMP PUSH2 0x5AE9 JUMP JUMPDEST PUSH2 0x3ADA JUMP JUMPDEST DUP1 ISZERO PUSH2 0x2DB4 JUMPI PUSH2 0x2CB7 PUSH2 0x3706 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0x1D1C2FEC DUP5 PUSH1 0x40 MLOAD DUP3 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x2CE4 SWAP2 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 GAS CALL ISZERO DUP1 ISZERO PUSH2 0x2D03 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x2D27 SWAP2 SWAP1 PUSH2 0x5A7D JUMP JUMPDEST POP PUSH2 0x2D4C PUSH2 0x2D33 PUSH2 0x2EE0 JUMP JUMPDEST DUP3 PUSH2 0x2D3C PUSH2 0x3A62 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND SWAP2 SWAP1 PUSH2 0x3C4A JUMP JUMPDEST PUSH2 0x2D54 PUSH2 0x2EE0 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0x81573288 DUP5 DUP4 PUSH1 0x40 MLOAD DUP4 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x2D81 SWAP3 SWAP2 SWAP1 PUSH2 0x5277 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x2D9B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x2DAF JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP JUMPDEST DUP7 MLOAD PUSH1 0x20 SWAP1 DUP2 ADD MLOAD PUSH1 0x40 DUP1 MLOAD DUP7 DUP2 MSTORE SWAP3 DUP4 ADD DUP6 SWAP1 MSTORE DUP3 ADD DUP4 SWAP1 MSTORE PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP1 DUP9 AND SWAP3 SWAP2 DUP2 AND SWAP2 SWAP1 DUP15 AND SWAP1 PUSH32 0x184C452047299395D4F7F147EB8E823458A450798539BE54AEED978F13D87BA2 SWAP1 PUSH1 0x60 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG4 POP SWAP10 SWAP9 POP POP POP POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 DUP1 DUP1 PUSH2 0x2E2E DUP6 DUP8 ADD DUP8 PUSH2 0x5CB8 JUMP JUMPDEST SWAP2 SWAP5 POP SWAP3 POP SWAP1 POP PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP8 AND PUSH2 0x2E4A PUSH1 0xCF DUP6 PUSH2 0x21F2 JUMP JUMPDEST MLOAD DUP9 SWAP2 DUP6 SWAP2 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND EQ PUSH2 0x2E78 JUMPI PUSH1 0x40 MLOAD PUSH4 0xC0BBFF13 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP3 SWAP2 SWAP1 PUSH2 0x5515 JUMP JUMPDEST POP POP PUSH1 0x2 SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP9 DUP2 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH2 0x109 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH2 0x2EB6 SWAP3 DUP7 SWAP3 DUP7 SWAP3 DUP7 SWAP3 PUSH1 0x1 PUSH1 0xC0 SHL SWAP1 DIV PUSH4 0xFFFFFFFF AND SWAP2 AND PUSH2 0x3CF9 JUMP JUMPDEST SWAP8 SWAP7 POP POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x2ED8 PUSH2 0x2ECE PUSH2 0x1B69 JUMP JUMPDEST PUSH1 0xD1 SWAP1 DUP6 DUP6 PUSH2 0x42D6 JUMP JUMPDEST ISZERO SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH32 0x0 SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH32 0xF0C57E16840DF040F15088DC2F81FE391C3923BEC73E23A9662EFC9C229C6A00 PUSH2 0x12B8 JUMP JUMPDEST PUSH2 0x2F35 PUSH2 0x4370 JUMP JUMPDEST PUSH2 0x848 DUP2 PUSH2 0x4395 JUMP JUMPDEST PUSH2 0xACD PUSH2 0x4370 JUMP JUMPDEST PUSH2 0x2F4E PUSH2 0x4370 JUMP JUMPDEST PUSH2 0x2F56 PUSH2 0x439D JUMP JUMPDEST PUSH2 0xACD PUSH2 0x2F3E JUMP JUMPDEST PUSH2 0x2F66 PUSH2 0x4370 JUMP JUMPDEST PUSH2 0x2F56 PUSH2 0x2F3E JUMP JUMPDEST PUSH2 0x2F76 PUSH2 0x4370 JUMP JUMPDEST PUSH2 0x2F80 DUP3 DUP3 PUSH2 0x43DF JUMP JUMPDEST PUSH2 0xA8F PUSH2 0x2F3E JUMP JUMPDEST DUP1 PUSH1 0x0 SUB PUSH2 0x2FA9 JUMPI PUSH1 0x40 MLOAD PUSH4 0xBC71A043 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH2 0x107 DUP2 SWAP1 SSTORE PUSH1 0x40 MLOAD DUP2 DUP2 MSTORE PUSH32 0x2AAAF20B08565EEBC0C962CD7C568E54C3C0C2B85A1F942B82CD1BD730FDCD23 SWAP1 PUSH1 0x20 ADD PUSH2 0xDAB JUMP JUMPDEST PUSH32 0x0 SWAP1 JUMP JUMPDEST PUSH2 0x300E DUP2 PUSH1 0x1 PUSH2 0x43F1 JUMP JUMPDEST PUSH2 0x3016 PUSH2 0x1B69 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0x3A78B732 DUP3 PUSH1 0x40 MLOAD DUP3 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x3041 SWAP2 SWAP1 PUSH2 0x5048 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x305B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x306F JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x186C PUSH32 0x4BDEE85C4B4A268F4895D1096D553C3E57BB2433C380E7B7EC8CB56CC4F74673 DUP5 DUP5 PUSH1 0x40 MLOAD PUSH1 0x20 ADD PUSH2 0x30CA SWAP4 SWAP3 SWAP2 SWAP1 SWAP3 DUP4 MSTORE PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB SWAP2 DUP3 AND PUSH1 0x20 DUP5 ADD MSTORE AND PUSH1 0x40 DUP3 ADD MSTORE PUSH1 0x60 ADD SWAP1 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 DUP4 SUB SUB DUP2 MSTORE SWAP1 PUSH1 0x40 MSTORE DUP1 MLOAD SWAP1 PUSH1 0x20 ADD KECCAK256 PUSH2 0x4408 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP6 AND PUSH2 0x310C JUMPI PUSH1 0x40 MLOAD PUSH4 0x4FFDF5EF PUSH1 0xE1 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH2 0x3117 DUP7 DUP7 DUP5 PUSH2 0x4435 JUMP JUMPDEST PUSH2 0x312B PUSH2 0x3122 PUSH2 0x1B69 JUMP JUMPDEST PUSH1 0xD0 SWAP1 DUP8 PUSH2 0x4484 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x3135 PUSH2 0x457A JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0x76671808 PUSH1 0x40 MLOAD DUP2 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP7 GAS STATICCALL ISZERO DUP1 ISZERO PUSH2 0x3172 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x3196 SWAP2 SWAP1 PUSH2 0x5A7D JUMP JUMPDEST SWAP1 POP PUSH1 0x0 PUSH2 0x3226 DUP9 DUP9 DUP9 DUP9 PUSH2 0x31A9 PUSH2 0x3706 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0xEEAC3E0E DUP13 PUSH1 0x40 MLOAD DUP3 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x31D6 SWAP2 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 GAS CALL ISZERO DUP1 ISZERO PUSH2 0x31F5 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x3219 SWAP2 SWAP1 PUSH2 0x5A7D JUMP JUMPDEST PUSH1 0xCF SWAP5 SWAP4 SWAP3 SWAP2 SWAP1 DUP9 PUSH2 0x459E JUMP JUMPDEST SWAP1 POP PUSH2 0x323E PUSH2 0x3233 PUSH2 0x1B69 JUMP JUMPDEST PUSH1 0xD1 SWAP1 DUP11 DUP9 DUP8 PUSH2 0x3911 JUMP JUMPDEST DUP1 PUSH1 0x40 ADD MLOAD PUSH1 0xD3 PUSH1 0x0 DUP4 PUSH1 0x20 ADD MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD PUSH2 0x3265 SWAP2 SWAP1 PUSH2 0x5AE9 JUMP JUMPDEST PUSH1 0xD3 PUSH1 0x0 DUP4 PUSH1 0x20 ADD MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 DUP2 SWAP1 SSTORE POP DUP6 DUP8 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND DUP10 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH32 0xE5E185FAB2B992C4727FF702A867D78B15FB176DBAA20C9C312A1C351D3F7F83 DUP5 PUSH1 0x40 ADD MLOAD DUP7 PUSH1 0x40 MLOAD PUSH2 0x32CA SWAP3 SWAP2 SWAP1 PUSH2 0x5277 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG4 POP POP POP POP POP POP POP POP JUMP JUMPDEST PUSH32 0x0 SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0x3315 DUP5 PUSH1 0x60 ADD MLOAD DUP6 PUSH1 0xA0 ADD MLOAD PUSH2 0x4706 JUMP JUMPDEST PUSH2 0x331F SWAP1 TIMESTAMP PUSH2 0x5845 JUMP JUMPDEST SWAP1 POP PUSH2 0x332A DUP5 PUSH2 0x2054 JUMP JUMPDEST DUP1 ISZERO PUSH2 0x3335 JUMPI POP DUP3 DUP2 GT JUMPDEST SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x334C DUP3 PUSH1 0x60 ADD MLOAD ISZERO ISZERO SWAP1 JUMP JUMPDEST DUP1 ISZERO PUSH2 0x12B8 JUMPI POP POP PUSH1 0x40 ADD MLOAD ISZERO SWAP1 JUMP JUMPDEST PUSH2 0x3367 DUP5 DUP5 DUP5 PUSH2 0x4716 JUMP JUMPDEST DUP2 DUP6 DUP6 DUP6 SWAP1 SWAP2 SWAP3 SWAP4 PUSH2 0x1DAE JUMPI PUSH1 0x40 MLOAD PUSH4 0x871E13D PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP5 SWAP4 SWAP3 SWAP2 SWAP1 PUSH2 0x5D10 JUMP JUMPDEST PUSH2 0x3398 PUSH2 0xCDC JUMP JUMPDEST PUSH2 0xACD JUMPI PUSH1 0x40 MLOAD PUSH4 0x8DFC202B PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x9B PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 PUSH1 0x3 ADD SLOAD SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x60 PUSH1 0x0 PUSH2 0x33D9 DUP6 PUSH2 0x472D JUMP JUMPDEST SWAP1 POP TIMESTAMP DUP2 PUSH1 0x40 ADD MLOAD GT ISZERO PUSH2 0x3401 JUMPI POP POP PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 DUP2 ADD SWAP1 SWAP2 MSTORE PUSH1 0x0 DUP2 MSTORE PUSH1 0x1 SWAP2 POP PUSH2 0x34BE JUMP JUMPDEST PUSH1 0x0 DUP1 DUP6 DUP1 PUSH1 0x20 ADD SWAP1 MLOAD DUP2 ADD SWAP1 PUSH2 0x3418 SWAP2 SWAP1 PUSH2 0x5D3F JUMP JUMPDEST DUP5 MLOAD SWAP2 SWAP4 POP SWAP2 POP PUSH2 0x342D SWAP1 PUSH1 0x9A SWAP1 DUP4 SWAP1 PUSH2 0x3893 JUMP JUMPDEST DUP7 DUP2 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH32 0x4C06B68820628A39C787D2DB1FAA0EEACD7B9474847B198B1E871FE6E5B93F44 DUP6 PUSH1 0x0 ADD MLOAD DUP7 PUSH1 0x40 ADD MLOAD PUSH1 0x40 MLOAD PUSH2 0x3471 SWAP3 SWAP2 SWAP1 PUSH2 0x5277 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 DUP3 MLOAD PUSH2 0x3485 SWAP1 DUP4 PUSH2 0x5AE9 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 DUP2 ADD SWAP3 SWAP1 SWAP3 MSTORE PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP4 AND SWAP1 DUP3 ADD MSTORE PUSH1 0x60 ADD PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 DUP4 SUB SUB DUP2 MSTORE SWAP1 PUSH1 0x40 MSTORE SWAP6 POP PUSH1 0x0 DUP7 SWAP5 POP SWAP5 POP POP POP POP JUMPDEST SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x9B PUSH1 0x20 MSTORE PUSH1 0x40 DUP2 KECCAK256 DUP2 DUP2 SSTORE PUSH1 0x1 DUP2 ADD DUP3 SWAP1 SSTORE PUSH1 0x2 DUP2 ADD DUP3 SWAP1 SSTORE PUSH1 0x3 ADD SSTORE JUMP JUMPDEST PUSH1 0x0 PUSH1 0x60 DUP8 PUSH1 0x3 ADD SLOAD DUP4 GT ISZERO PUSH2 0x3513 JUMPI PUSH1 0x40 MLOAD PUSH4 0x4A411B9D PUSH1 0xE1 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x0 DUP4 ISZERO PUSH2 0x3521 JUMPI DUP4 PUSH2 0x3527 JUMP JUMPDEST DUP9 PUSH1 0x3 ADD SLOAD JUMPDEST DUP10 SLOAD SWAP1 SWAP5 POP JUMPDEST DUP1 ISZERO DUP1 ISZERO SWAP1 PUSH2 0x353C JUMPI POP PUSH1 0x0 DUP6 GT JUMPDEST ISZERO PUSH2 0x3595 JUMPI PUSH1 0x0 DUP1 PUSH2 0x3552 DUP4 DUP10 DUP13 PUSH4 0xFFFFFFFF AND JUMP JUMPDEST SWAP2 POP SWAP2 POP DUP2 ISZERO PUSH2 0x3563 JUMPI POP POP PUSH2 0x3595 JUMP JUMPDEST SWAP7 POP DUP7 PUSH2 0x3571 DUP13 DUP13 DUP12 PUSH2 0x47BB JUMP JUMPDEST SWAP3 POP DUP7 PUSH2 0x357D DUP2 PUSH2 0x5D65 JUMP JUMPDEST SWAP8 POP POP DUP4 DUP1 PUSH2 0x358B SWAP1 PUSH2 0x5D7C JUMP JUMPDEST SWAP5 POP POP POP POP PUSH2 0x352D JUMP JUMPDEST POP SWAP9 SWAP4 SWAP8 POP SWAP3 SWAP6 POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP1 DUP4 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x20 DUP7 DUP2 MSTORE PUSH1 0x40 SWAP2 DUP3 SWAP1 KECCAK256 DUP3 MLOAD DUP1 DUP5 ADD SWAP1 SWAP4 MSTORE DUP1 SLOAD SWAP1 SWAP4 AND DUP3 MSTORE PUSH1 0x1 SWAP1 SWAP3 ADD SLOAD SWAP2 DUP2 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH2 0x35E4 SWAP1 PUSH2 0x4842 JUMP JUMPDEST ISZERO DUP3 SWAP1 PUSH2 0x3605 JUMPI PUSH1 0x40 MLOAD PUSH4 0x2D7D25F1 PUSH1 0xE2 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP2 SWAP1 PUSH2 0x5048 JUMP JUMPDEST POP PUSH1 0x40 DUP1 MLOAD DUP1 DUP3 ADD DUP3 MSTORE PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB SWAP5 DUP6 AND DUP2 MSTORE PUSH1 0x20 DUP1 DUP3 ADD SWAP4 DUP5 MSTORE SWAP4 DUP6 AND PUSH1 0x0 SWAP1 DUP2 MSTORE SWAP6 SWAP1 SWAP4 MSTORE SWAP1 SWAP4 KECCAK256 SWAP1 MLOAD DUP2 SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB NOT AND SWAP3 AND SWAP2 SWAP1 SWAP2 OR DUP2 SSTORE SWAP1 MLOAD PUSH1 0x1 SWAP1 SWAP2 ADD SSTORE JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP1 DUP3 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x20 DUP5 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 DUP2 MLOAD PUSH2 0x120 DUP2 ADD DUP4 MSTORE DUP2 SLOAD SWAP1 SWAP6 AND DUP6 MSTORE PUSH1 0x1 DUP2 ADD SLOAD SWAP3 DUP6 ADD SWAP3 SWAP1 SWAP3 MSTORE PUSH1 0x2 DUP3 ADD SLOAD SWAP1 DUP5 ADD MSTORE PUSH1 0x3 DUP2 ADD SLOAD PUSH1 0x60 DUP5 ADD MSTORE PUSH1 0x4 DUP2 ADD SLOAD PUSH1 0x80 DUP5 ADD MSTORE PUSH1 0x5 DUP2 ADD SLOAD PUSH1 0xA0 DUP5 ADD MSTORE PUSH1 0x6 DUP2 ADD SLOAD PUSH1 0xC0 DUP5 ADD MSTORE PUSH1 0x7 DUP2 ADD SLOAD PUSH1 0xE0 DUP5 ADD MSTORE PUSH1 0x8 DUP2 ADD SLOAD PUSH2 0x100 DUP5 ADD MSTORE SWAP1 SWAP2 PUSH2 0x36DE SWAP1 PUSH1 0x60 ADD MLOAD ISZERO ISZERO SWAP1 JUMP JUMPDEST DUP4 SWAP1 PUSH2 0x36FE JUMPI PUSH1 0x40 MLOAD PUSH4 0x42DAADAF PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP2 SWAP1 PUSH2 0x5048 JUMP JUMPDEST POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH32 0x0 SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x3736 DUP5 DUP5 PUSH2 0x3653 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH2 0x120 DUP2 ADD DUP3 MSTORE DUP3 SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND DUP2 MSTORE PUSH1 0x1 DUP4 ADD SLOAD PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x2 DUP4 ADD SLOAD SWAP2 DUP2 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH1 0x3 DUP3 ADD SLOAD PUSH1 0x60 DUP3 ADD MSTORE PUSH1 0x4 DUP3 ADD SLOAD PUSH1 0x80 DUP3 ADD MSTORE PUSH1 0x5 DUP3 ADD SLOAD PUSH1 0xA0 DUP3 ADD MSTORE PUSH1 0x6 DUP3 ADD SLOAD PUSH1 0xC0 DUP3 ADD MSTORE PUSH1 0x7 DUP3 ADD SLOAD PUSH1 0xE0 DUP3 ADD MSTORE PUSH1 0x8 DUP3 ADD SLOAD PUSH2 0x100 DUP3 ADD MSTORE SWAP1 SWAP2 POP PUSH2 0x37AD SWAP1 PUSH2 0x2054 JUMP JUMPDEST PUSH1 0x4 DUP3 ADD SLOAD DUP5 SWAP2 PUSH2 0x37D3 JUMPI PUSH1 0x40 MLOAD PUSH4 0x61B66E0D PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP3 SWAP2 SWAP1 PUSH2 0x5AD0 JUMP JUMPDEST POP POP PUSH1 0x6 ADD SSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x37E9 DUP4 DUP4 PUSH2 0x3653 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH2 0x120 DUP2 ADD DUP3 MSTORE DUP3 SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND DUP2 MSTORE PUSH1 0x1 DUP4 ADD SLOAD PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x2 DUP4 ADD SLOAD SWAP2 DUP2 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH1 0x3 DUP3 ADD SLOAD PUSH1 0x60 DUP3 ADD MSTORE PUSH1 0x4 DUP3 ADD SLOAD PUSH1 0x80 DUP3 ADD MSTORE PUSH1 0x5 DUP3 ADD SLOAD PUSH1 0xA0 DUP3 ADD MSTORE PUSH1 0x6 DUP3 ADD SLOAD PUSH1 0xC0 DUP3 ADD MSTORE PUSH1 0x7 DUP3 ADD SLOAD PUSH1 0xE0 DUP3 ADD MSTORE PUSH1 0x8 DUP3 ADD SLOAD PUSH2 0x100 DUP3 ADD MSTORE SWAP1 SWAP2 POP PUSH2 0x3860 SWAP1 PUSH2 0x2054 JUMP JUMPDEST PUSH1 0x4 DUP3 ADD SLOAD DUP4 SWAP2 PUSH2 0x3886 JUMPI PUSH1 0x40 MLOAD PUSH4 0x61B66E0D PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP3 SWAP2 SWAP1 PUSH2 0x5AD0 JUMP JUMPDEST POP POP TIMESTAMP PUSH1 0x4 SWAP1 SWAP2 ADD SSTORE POP POP JUMP JUMPDEST DUP1 PUSH1 0x0 SUB PUSH2 0x38A0 JUMPI POP POP POP JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP3 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x20 DUP5 SWAP1 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP2 DUP1 DUP3 LT ISZERO PUSH2 0x38DD JUMPI PUSH1 0x40 MLOAD PUSH4 0x5F8EC709 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP3 SWAP2 SWAP1 PUSH2 0x5277 JUMP JUMPDEST POP POP PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP3 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x20 DUP5 SWAP1 MSTORE PUSH1 0x40 DUP2 KECCAK256 DUP1 SLOAD DUP4 SWAP3 SWAP1 PUSH2 0x3907 SWAP1 DUP5 SWAP1 PUSH2 0x5845 JUMP JUMPDEST SWAP1 SWAP2 SSTORE POP POP POP POP POP JUMP JUMPDEST DUP2 ISZERO PUSH2 0x306F JUMPI PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP4 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x20 DUP7 SWAP1 MSTORE PUSH1 0x40 DUP2 KECCAK256 SLOAD PUSH2 0x393B SWAP1 DUP5 SWAP1 PUSH2 0x5AE9 JUMP JUMPDEST SWAP1 POP PUSH1 0x0 DUP6 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0x872D0489 DUP7 ADDRESS DUP7 PUSH1 0x40 MLOAD DUP5 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x396F SWAP4 SWAP3 SWAP2 SWAP1 PUSH2 0x5D95 JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP7 GAS STATICCALL ISZERO DUP1 ISZERO PUSH2 0x398C JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x39B0 SWAP2 SWAP1 PUSH2 0x5A7D JUMP JUMPDEST SWAP1 POP DUP1 DUP3 DUP2 DUP2 GT ISZERO PUSH2 0x39D7 JUMPI PUSH1 0x40 MLOAD PUSH4 0x5F8EC709 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP3 SWAP2 SWAP1 PUSH2 0x5277 JUMP JUMPDEST POP POP PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP6 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x20 DUP9 SWAP1 MSTORE PUSH1 0x40 DUP2 KECCAK256 DUP1 SLOAD DUP7 SWAP3 SWAP1 PUSH2 0x3A01 SWAP1 DUP5 SWAP1 PUSH2 0x5AE9 JUMP JUMPDEST SWAP1 SWAP2 SSTORE POP POP POP POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x60 DUP3 PUSH2 0x3A24 JUMPI PUSH2 0x3A1F DUP3 PUSH2 0x4851 JUMP JUMPDEST PUSH2 0x186C JUMP JUMPDEST DUP2 MLOAD ISZERO DUP1 ISZERO PUSH2 0x3A3B JUMPI POP PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP5 AND EXTCODESIZE ISZERO JUMPDEST ISZERO PUSH2 0x3A5B JUMPI DUP4 PUSH1 0x40 MLOAD PUSH4 0x9996B315 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP2 SWAP1 PUSH2 0x5048 JUMP JUMPDEST POP DUP1 PUSH2 0x186C JUMP JUMPDEST PUSH32 0x0 SWAP1 JUMP JUMPDEST DUP2 MLOAD PUSH1 0x40 SWAP1 DUP2 ADD MLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB SWAP1 DUP2 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH2 0x109 PUSH1 0x20 SWAP1 DUP2 MSTORE SWAP1 DUP4 SWAP1 KECCAK256 SLOAD SWAP3 MLOAD PUSH1 0x60 SWAP4 PUSH2 0x3AC3 SWAP4 DUP8 SWAP4 DUP8 SWAP4 SWAP3 SWAP1 SWAP2 AND SWAP2 ADD PUSH2 0x5DBE JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 DUP4 SUB SUB DUP2 MSTORE SWAP1 PUSH1 0x40 MSTORE SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST DUP2 PUSH1 0x0 SUB PUSH2 0x3AFB JUMPI PUSH1 0x40 MLOAD PUSH4 0x8F4C63D9 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH2 0x3B27 PUSH2 0x3B06 PUSH2 0x1B69 JUMP JUMPDEST PUSH1 0x2 SLOAD PUSH1 0x9A SWAP2 SWAP1 DUP7 SWAP1 DUP7 SWAP1 PUSH4 0xFFFFFFFF PUSH1 0x1 PUSH1 0xC0 SHL SWAP1 SWAP2 DIV DUP2 AND SWAP1 PUSH2 0x3911 AND JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP4 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x9C PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 PUSH1 0x2 DUP1 DUP3 ADD SLOAD DUP4 MLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0x60 SHL SUB NOT ADDRESS PUSH1 0x60 SWAP1 DUP2 SHL DUP3 AND DUP4 DUP10 ADD MSTORE DUP12 SWAP1 SHL AND PUSH1 0x34 DUP3 ADD MSTORE PUSH1 0x48 DUP1 DUP3 ADD SWAP3 SWAP1 SWAP3 MSTORE DUP5 MLOAD DUP1 DUP3 SUB SWAP1 SWAP3 ADD DUP3 MSTORE PUSH1 0x68 DUP2 ADD DUP1 DUP7 MSTORE DUP3 MLOAD SWAP3 DUP8 ADD SWAP3 SWAP1 SWAP3 KECCAK256 PUSH1 0xE8 DUP3 ADD DUP7 MSTORE DUP10 DUP4 MSTORE TIMESTAMP PUSH1 0x88 DUP4 ADD SWAP1 DUP2 MSTORE PUSH1 0xA8 DUP4 ADD DUP11 DUP2 MSTORE PUSH1 0xC8 SWAP1 SWAP4 ADD DUP10 DUP2 MSTORE DUP3 DUP11 MSTORE PUSH1 0x9B SWAP1 SWAP9 MSTORE SWAP6 SWAP1 SWAP8 KECCAK256 SWAP2 MLOAD DUP3 SSTORE SWAP4 MLOAD PUSH1 0x1 DUP3 ADD SSTORE SWAP3 MLOAD SWAP1 DUP4 ADD SSTORE SWAP2 MLOAD PUSH1 0x3 SWAP2 DUP3 ADD SSTORE DUP2 ADD SLOAD SWAP1 SWAP2 SWAP1 ISZERO PUSH2 0x3BF5 JUMPI PUSH1 0x1 DUP3 ADD SLOAD PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x9B PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 PUSH1 0x3 ADD DUP2 SWAP1 SSTORE JUMPDEST PUSH2 0x3BFF DUP3 DUP3 PUSH2 0x487A JUMP JUMPDEST DUP1 DUP6 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH32 0x5D9E2C5278E41138269F5F980CFBEA016D8C59816754502ABC4D2F87AAEA987F DUP7 DUP7 PUSH1 0x40 MLOAD PUSH2 0x3C3B SWAP3 SWAP2 SWAP1 PUSH2 0x5277 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 POP POP POP POP POP JUMP JUMPDEST DUP1 ISZERO PUSH2 0xD3C JUMPI PUSH1 0x40 MLOAD PUSH4 0xA9059CBB PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP5 AND SWAP1 PUSH4 0xA9059CBB SWAP1 PUSH2 0x3C7E SWAP1 DUP6 SWAP1 DUP6 SWAP1 PUSH1 0x4 ADD PUSH2 0x5AD0 JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 GAS CALL ISZERO DUP1 ISZERO PUSH2 0x3C9D JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x3CC1 SWAP2 SWAP1 PUSH2 0x54F8 JUMP JUMPDEST PUSH2 0xD3C JUMPI PUSH1 0x40 MLOAD PUSH3 0x461BCD PUSH1 0xE5 SHL DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x9 PUSH1 0x24 DUP3 ADD MSTORE PUSH9 0x10BA3930B739B332B9 PUSH1 0xB9 SHL PUSH1 0x44 DUP3 ADD MSTORE PUSH1 0x64 ADD PUSH2 0x8EC JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0x3D07 PUSH1 0xCF DUP9 PUSH2 0x21F2 JUMP JUMPDEST SWAP1 POP PUSH2 0x3D12 DUP2 PUSH2 0x2054 JUMP JUMPDEST DUP8 SWAP1 PUSH2 0x3D32 JUMPI PUSH1 0x40 MLOAD PUSH4 0x1EB5FF95 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP2 SWAP1 PUSH2 0x5048 JUMP JUMPDEST POP PUSH1 0x0 PUSH2 0x3D4A PUSH1 0xD2 SLOAD DUP4 PUSH2 0x3300 SWAP1 SWAP2 SWAP1 PUSH4 0xFFFFFFFF AND JUMP JUMPDEST ISZERO DUP1 ISZERO PUSH2 0x3D5D JUMPI POP PUSH2 0x3D5B DUP3 PUSH2 0x333D JUMP JUMPDEST ISZERO JUMPDEST DUP1 ISZERO PUSH2 0x3D68 JUMPI POP DUP7 ISZERO ISZERO JUMPDEST DUP1 ISZERO PUSH2 0x3DE0 JUMPI POP DUP2 PUSH2 0x100 ADD MLOAD PUSH2 0x3D7D PUSH2 0x457A JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0x76671808 PUSH1 0x40 MLOAD DUP2 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP7 GAS STATICCALL ISZERO DUP1 ISZERO PUSH2 0x3DBA JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x3DDE SWAP2 SWAP1 PUSH2 0x5A7D JUMP JUMPDEST GT JUMPDEST PUSH2 0x3DEB JUMPI PUSH1 0x0 PUSH2 0x3E61 JUMP JUMPDEST PUSH2 0x3DF3 PUSH2 0x3706 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0xDB750926 DUP10 PUSH1 0x40 MLOAD DUP3 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x3E1E SWAP2 SWAP1 PUSH2 0x5048 JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 GAS CALL ISZERO DUP1 ISZERO PUSH2 0x3E3D JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x3E61 SWAP2 SWAP1 PUSH2 0x5A7D JUMP JUMPDEST SWAP1 POP PUSH2 0x3EA0 DUP9 PUSH2 0x3E6F PUSH2 0x3706 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0xEEAC3E0E DUP6 PUSH1 0x20 ADD MLOAD PUSH1 0x40 MLOAD DUP3 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x22C3 SWAP2 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 JUMP JUMPDEST PUSH2 0x3EAB PUSH1 0xCF DUP10 PUSH2 0x490D JUMP JUMPDEST PUSH2 0x3EB6 PUSH1 0xCF DUP10 PUSH2 0x49C3 JUMP JUMPDEST PUSH1 0x0 DUP1 DUP3 ISZERO PUSH2 0x41EF JUMPI PUSH1 0x0 PUSH2 0x3EC9 PUSH2 0x1B69 JUMP JUMPDEST DUP6 MLOAD PUSH1 0x40 MLOAD PUSH4 0x7573EF4F PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB SWAP3 SWAP1 SWAP3 AND SWAP2 PUSH4 0x7573EF4F SWAP2 PUSH2 0x3EFC SWAP2 ADDRESS SWAP1 PUSH1 0x2 SWAP1 PUSH1 0x4 ADD PUSH2 0x5E87 JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP7 GAS STATICCALL ISZERO DUP1 ISZERO PUSH2 0x3F19 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x3F3D SWAP2 SWAP1 PUSH2 0x5A7D JUMP JUMPDEST SWAP1 POP PUSH1 0x0 PUSH2 0x3F49 PUSH2 0x1B69 JUMP JUMPDEST DUP7 MLOAD PUSH1 0x40 MLOAD PUSH4 0x1584A179 PUSH1 0xE2 SHL DUP2 MSTORE PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB SWAP3 SWAP1 SWAP3 AND SWAP2 PUSH4 0x561285E4 SWAP2 PUSH2 0x3F79 SWAP2 ADDRESS SWAP1 PUSH1 0x4 ADD PUSH2 0x5515 JUMP JUMPDEST PUSH1 0xA0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP7 GAS STATICCALL ISZERO DUP1 ISZERO PUSH2 0x3F96 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x3FBA SWAP2 SWAP1 PUSH2 0x5EAC JUMP JUMPDEST SWAP1 POP PUSH1 0x0 DUP2 PUSH1 0x20 ADD MLOAD GT PUSH2 0x3FCF JUMPI PUSH1 0x0 PUSH2 0x3FD9 JUMP JUMPDEST PUSH2 0x3FD9 DUP6 DUP4 PUSH2 0x4A7A JUMP JUMPDEST SWAP3 POP DUP3 ISZERO PUSH2 0x40CE JUMPI PUSH2 0x3FE9 PUSH2 0x3A62 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0x95EA7B3 PUSH2 0x3FFF PUSH2 0x1B69 JUMP JUMPDEST DUP6 PUSH1 0x40 MLOAD DUP4 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x401D SWAP3 SWAP2 SWAP1 PUSH2 0x5AD0 JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 GAS CALL ISZERO DUP1 ISZERO PUSH2 0x403C JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x4060 SWAP2 SWAP1 PUSH2 0x54F8 JUMP JUMPDEST POP PUSH2 0x4069 PUSH2 0x1B69 JUMP JUMPDEST DUP7 MLOAD PUSH1 0x40 MLOAD PUSH4 0xCA94B0E9 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB SWAP3 SWAP1 SWAP3 AND SWAP2 PUSH4 0xCA94B0E9 SWAP2 PUSH2 0x409B SWAP2 ADDRESS SWAP1 DUP9 SWAP1 PUSH1 0x4 ADD PUSH2 0x5F1F JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x40B5 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x40C9 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP JUMPDEST PUSH2 0x40D8 DUP4 DUP7 PUSH2 0x5845 JUMP JUMPDEST SWAP4 POP DUP4 ISZERO PUSH2 0x41EC JUMPI PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP9 AND PUSH2 0x41DF JUMPI PUSH2 0x40F6 PUSH2 0x3A62 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0x95EA7B3 PUSH2 0x410C PUSH2 0x1B69 JUMP JUMPDEST DUP7 PUSH1 0x40 MLOAD DUP4 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x412A SWAP3 SWAP2 SWAP1 PUSH2 0x5AD0 JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 GAS CALL ISZERO DUP1 ISZERO PUSH2 0x4149 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x416D SWAP2 SWAP1 PUSH2 0x54F8 JUMP JUMPDEST POP PUSH2 0x4176 PUSH2 0x1B69 JUMP JUMPDEST DUP7 MLOAD PUSH1 0x40 MLOAD PUSH4 0x3A309049 PUSH1 0xE1 SHL DUP2 MSTORE PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB SWAP3 SWAP1 SWAP3 AND SWAP2 PUSH4 0x74612092 SWAP2 PUSH2 0x41A8 SWAP2 ADDRESS SWAP1 DUP10 SWAP1 PUSH1 0x4 ADD PUSH2 0x5F1F JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x41C2 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x41D6 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH2 0x41EC JUMP JUMPDEST PUSH2 0x41EC DUP9 DUP6 PUSH2 0x2D3C PUSH2 0x3A62 JUMP JUMPDEST POP POP JUMPDEST PUSH1 0x20 DUP5 ADD MLOAD DUP5 MLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP1 DUP14 AND SWAP2 AND PUSH32 0x443F56BD2098D273B8C8120398789A41DA5925DB4BA2F656813FC5299AC57B1F DUP7 DUP7 DUP7 DUP16 DUP16 PUSH2 0x4231 PUSH2 0x457A JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0x76671808 PUSH1 0x40 MLOAD DUP2 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP7 GAS STATICCALL ISZERO DUP1 ISZERO PUSH2 0x426E JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x4292 SWAP2 SWAP1 PUSH2 0x5A7D JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x42A4 SWAP7 SWAP6 SWAP5 SWAP4 SWAP3 SWAP2 SWAP1 PUSH2 0x5F43 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG4 DUP4 MLOAD PUSH2 0x42B8 SWAP1 DUP9 PUSH2 0x2EC1 JUMP JUMPDEST ISZERO PUSH2 0x42C8 JUMPI PUSH2 0x42C8 DUP11 PUSH1 0x1 PUSH2 0x2277 JUMP JUMPDEST POP SWAP1 SWAP9 SWAP8 POP POP POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 DUP5 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0x872D0489 DUP6 ADDRESS DUP7 PUSH1 0x40 MLOAD DUP5 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x4309 SWAP4 SWAP3 SWAP2 SWAP1 PUSH2 0x5D95 JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP7 GAS STATICCALL ISZERO DUP1 ISZERO PUSH2 0x4326 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x434A SWAP2 SWAP1 PUSH2 0x5A7D JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP6 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x20 DUP9 SWAP1 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD GT ISZERO SWAP2 POP POP SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH2 0x4378 PUSH2 0x4ADA JUMP JUMPDEST PUSH2 0xACD JUMPI PUSH1 0x40 MLOAD PUSH4 0x1AFCD79F PUSH1 0xE3 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH2 0x1AB0 PUSH2 0x4370 JUMP JUMPDEST PUSH2 0x43A5 PUSH2 0x4370 JUMP JUMPDEST PUSH2 0x43B2 PUSH1 0x0 PUSH1 0x0 NOT PUSH2 0x26D7 JUMP JUMPDEST PUSH2 0x43C0 PUSH1 0x0 PUSH3 0xF4240 PUSH2 0x4AF4 JUMP JUMPDEST PUSH2 0x43D2 PUSH1 0x0 PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB PUSH2 0x4BC5 JUMP JUMPDEST PUSH2 0xACD PUSH4 0xFFFFFFFF PUSH2 0x1B15 JUMP JUMPDEST PUSH2 0x43E7 PUSH2 0x4370 JUMP JUMPDEST PUSH2 0xA8F DUP3 DUP3 PUSH2 0x4C52 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x43FC DUP4 PUSH2 0x1B8D JUMP JUMPDEST SWAP1 POP PUSH2 0xD3C DUP2 DUP4 PUSH2 0x1CCE JUMP JUMPDEST PUSH1 0x0 PUSH2 0x12B8 PUSH2 0x4415 PUSH2 0x4C93 JUMP JUMPDEST DUP4 PUSH1 0x40 MLOAD PUSH2 0x1901 PUSH1 0xF0 SHL DUP2 MSTORE PUSH1 0x2 DUP2 ADD SWAP3 SWAP1 SWAP3 MSTORE PUSH1 0x22 DUP3 ADD MSTORE PUSH1 0x42 SWAP1 KECCAK256 SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x444A PUSH2 0x4444 DUP6 DUP6 PUSH2 0x3076 JUMP JUMPDEST DUP4 PUSH2 0x4C9D JUMP JUMPDEST SWAP1 POP DUP1 DUP4 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP1 DUP4 AND SWAP1 DUP3 AND EQ PUSH2 0x447C JUMPI PUSH1 0x40 MLOAD PUSH4 0x8C5B935D PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP3 SWAP2 SWAP1 PUSH2 0x5515 JUMP JUMPDEST POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP1 DUP3 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x20 DUP6 DUP2 MSTORE PUSH1 0x40 SWAP2 DUP3 SWAP1 KECCAK256 DUP3 MLOAD DUP1 DUP5 ADD SWAP1 SWAP4 MSTORE DUP1 SLOAD SWAP1 SWAP4 AND DUP3 MSTORE PUSH1 0x1 SWAP1 SWAP3 ADD SLOAD SWAP2 DUP2 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH2 0x44C4 SWAP1 PUSH2 0x4842 JUMP JUMPDEST ISZERO DUP2 SWAP1 PUSH2 0x44E5 JUMPI PUSH1 0x40 MLOAD PUSH4 0x2D7D25F1 PUSH1 0xE2 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP2 SWAP1 PUSH2 0x5048 JUMP JUMPDEST POP PUSH1 0x40 MLOAD PUSH4 0x78EB06B3 PUSH1 0xE1 SHL DUP2 MSTORE PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP4 AND SWAP1 PUSH4 0xF1D60D66 SWAP1 PUSH2 0x4512 SWAP1 DUP5 SWAP1 PUSH1 0x4 ADD PUSH2 0x5048 JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP7 GAS STATICCALL ISZERO DUP1 ISZERO PUSH2 0x452F JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x4553 SWAP2 SWAP1 PUSH2 0x54F8 JUMP JUMPDEST ISZERO DUP2 SWAP1 PUSH2 0x4574 JUMPI PUSH1 0x40 MLOAD PUSH4 0x2D7D25F1 PUSH1 0xE2 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP2 SWAP1 PUSH2 0x5048 JUMP JUMPDEST POP POP POP POP JUMP JUMPDEST PUSH32 0x0 SWAP1 JUMP JUMPDEST PUSH2 0x45A6 PUSH2 0x4FAE JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP1 DUP8 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x20 DUP11 DUP2 MSTORE PUSH1 0x40 SWAP2 DUP3 SWAP1 KECCAK256 DUP3 MLOAD PUSH2 0x120 DUP2 ADD DUP5 MSTORE DUP2 SLOAD SWAP1 SWAP5 AND DUP5 MSTORE PUSH1 0x1 DUP2 ADD SLOAD SWAP2 DUP5 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH1 0x2 DUP2 ADD SLOAD SWAP2 DUP4 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH1 0x3 DUP2 ADD SLOAD PUSH1 0x60 DUP4 ADD MSTORE PUSH1 0x4 DUP2 ADD SLOAD PUSH1 0x80 DUP4 ADD MSTORE PUSH1 0x5 DUP2 ADD SLOAD PUSH1 0xA0 DUP4 ADD MSTORE PUSH1 0x6 DUP2 ADD SLOAD PUSH1 0xC0 DUP4 ADD MSTORE PUSH1 0x7 DUP2 ADD SLOAD PUSH1 0xE0 DUP4 ADD MSTORE PUSH1 0x8 ADD SLOAD PUSH2 0x100 DUP3 ADD MSTORE PUSH2 0x4632 SWAP1 PUSH1 0x60 ADD MLOAD ISZERO ISZERO SWAP1 JUMP JUMPDEST ISZERO DUP7 SWAP1 PUSH2 0x4653 JUMPI PUSH1 0x40 MLOAD PUSH4 0xBC4DEF5 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP2 SWAP1 PUSH2 0x5048 JUMP JUMPDEST POP POP PUSH1 0x40 DUP1 MLOAD PUSH2 0x120 DUP2 ADD DUP3 MSTORE PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB SWAP8 DUP9 AND DUP2 MSTORE PUSH1 0x20 DUP1 DUP3 ADD SWAP7 DUP8 MSTORE DUP2 DUP4 ADD SWAP6 DUP7 MSTORE TIMESTAMP PUSH1 0x60 DUP4 ADD SWAP1 DUP2 MSTORE PUSH1 0x0 PUSH1 0x80 DUP5 ADD DUP2 DUP2 MSTORE PUSH1 0xA0 DUP6 ADD DUP3 DUP2 MSTORE PUSH1 0xC0 DUP7 ADD SWAP9 DUP10 MSTORE PUSH1 0xE0 DUP7 ADD DUP4 DUP2 MSTORE PUSH2 0x100 DUP8 ADD SWAP9 DUP10 MSTORE SWAP12 DUP14 AND DUP4 MSTORE SWAP13 SWAP1 SWAP4 MSTORE SWAP4 SWAP1 SWAP4 KECCAK256 DUP3 MLOAD DUP2 SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB NOT AND SWAP11 AND SWAP10 SWAP1 SWAP10 OR DUP10 SSTORE SWAP6 MLOAD PUSH1 0x1 DUP10 ADD SSTORE SWAP4 MLOAD PUSH1 0x2 DUP9 ADD SSTORE MLOAD PUSH1 0x3 DUP8 ADD SSTORE SWAP3 MLOAD PUSH1 0x4 DUP7 ADD SSTORE SWAP5 MLOAD PUSH1 0x5 DUP6 ADD SSTORE SWAP4 MLOAD PUSH1 0x6 DUP5 ADD SSTORE SWAP1 MLOAD PUSH1 0x7 DUP4 ADD SSTORE MLOAD PUSH1 0x8 SWAP1 SWAP2 ADD SSTORE SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 XOR DUP3 DUP5 GT MUL DUP3 XOR PUSH2 0x186C JUMP JUMPDEST PUSH1 0x0 DUP3 DUP5 LT ISZERO DUP1 ISZERO PUSH2 0x3335 JUMPI POP POP SWAP1 SWAP2 GT ISZERO SWAP2 SWAP1 POP JUMP JUMPDEST PUSH2 0x475B PUSH1 0x40 MLOAD DUP1 PUSH1 0x80 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP1 NOT AND DUP2 MSTORE POP SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP3 DUP2 MSTORE PUSH1 0x9B PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP2 DUP3 SWAP1 KECCAK256 DUP3 MLOAD PUSH1 0x80 DUP2 ADD DUP5 MSTORE DUP2 SLOAD DUP2 MSTORE PUSH1 0x1 DUP3 ADD SLOAD SWAP3 DUP2 ADD DUP4 SWAP1 MSTORE PUSH1 0x2 DUP3 ADD SLOAD SWAP4 DUP2 ADD SWAP4 SWAP1 SWAP4 MSTORE PUSH1 0x3 ADD SLOAD PUSH1 0x60 DUP4 ADD MSTORE DUP4 SWAP1 PUSH2 0x1C89 JUMPI PUSH1 0x40 MLOAD PUSH4 0x107349A9 PUSH1 0xE2 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP2 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP1 DUP5 PUSH1 0x3 ADD SLOAD GT PUSH2 0x47E1 JUMPI PUSH1 0x40 MLOAD PUSH4 0xDDAF8F21 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x47F4 DUP6 PUSH1 0x0 ADD SLOAD DUP6 PUSH4 0xFFFFFFFF AND JUMP JUMPDEST SWAP1 POP PUSH2 0x4807 DUP6 PUSH1 0x0 ADD SLOAD DUP5 PUSH4 0xFFFFFFFF AND JUMP JUMPDEST PUSH1 0x1 DUP6 PUSH1 0x3 ADD PUSH1 0x0 DUP3 DUP3 SLOAD PUSH2 0x481C SWAP2 SWAP1 PUSH2 0x5845 JUMP JUMPDEST SWAP1 SWAP2 SSTORE POP POP DUP1 DUP6 SSTORE PUSH1 0x3 DUP6 ADD SLOAD PUSH1 0x0 SUB PUSH2 0x4838 JUMPI PUSH1 0x0 PUSH1 0x1 DUP7 ADD SSTORE JUMPDEST POP POP SWAP2 SLOAD SWAP3 SWAP2 POP POP JUMP JUMPDEST MLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND ISZERO ISZERO SWAP1 JUMP JUMPDEST DUP1 MLOAD ISZERO PUSH2 0x4861 JUMPI DUP1 MLOAD DUP1 DUP3 PUSH1 0x20 ADD REVERT JUMPDEST PUSH1 0x40 MLOAD PUSH4 0xD6BDA275 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH2 0x2710 DUP3 PUSH1 0x3 ADD SLOAD LT PUSH2 0x48A0 JUMPI PUSH1 0x40 MLOAD PUSH4 0x3A8C56B PUSH1 0xE6 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST DUP1 PUSH2 0x48BE JUMPI PUSH1 0x40 MLOAD PUSH4 0x8F4A893D PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x1 DUP1 DUP4 ADD DUP3 SWAP1 SSTORE PUSH1 0x2 DUP4 ADD DUP1 SLOAD PUSH1 0x0 SWAP1 PUSH2 0x48DA SWAP1 DUP5 SWAP1 PUSH2 0x5AE9 JUMP JUMPDEST SWAP1 SWAP2 SSTORE POP POP PUSH1 0x3 DUP3 ADD SLOAD PUSH1 0x0 SUB PUSH2 0x48EF JUMPI DUP1 DUP3 SSTORE JUMPDEST PUSH1 0x1 DUP3 PUSH1 0x3 ADD PUSH1 0x0 DUP3 DUP3 SLOAD PUSH2 0x4904 SWAP2 SWAP1 PUSH2 0x5AE9 JUMP JUMPDEST SWAP1 SWAP2 SSTORE POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x4919 DUP4 DUP4 PUSH2 0x3653 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH2 0x120 DUP2 ADD DUP3 MSTORE DUP3 SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND DUP2 MSTORE PUSH1 0x1 DUP4 ADD SLOAD PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x2 DUP4 ADD SLOAD SWAP2 DUP2 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH1 0x3 DUP3 ADD SLOAD PUSH1 0x60 DUP3 ADD MSTORE PUSH1 0x4 DUP3 ADD SLOAD PUSH1 0x80 DUP3 ADD MSTORE PUSH1 0x5 DUP3 ADD SLOAD PUSH1 0xA0 DUP3 ADD MSTORE PUSH1 0x6 DUP3 ADD SLOAD PUSH1 0xC0 DUP3 ADD MSTORE PUSH1 0x7 DUP3 ADD SLOAD PUSH1 0xE0 DUP3 ADD MSTORE PUSH1 0x8 DUP3 ADD SLOAD PUSH2 0x100 DUP3 ADD MSTORE SWAP1 SWAP2 POP PUSH2 0x4990 SWAP1 PUSH2 0x2054 JUMP JUMPDEST PUSH1 0x4 DUP3 ADD SLOAD DUP4 SWAP2 PUSH2 0x49B6 JUMPI PUSH1 0x40 MLOAD PUSH4 0x61B66E0D PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP3 SWAP2 SWAP1 PUSH2 0x5AD0 JUMP JUMPDEST POP POP TIMESTAMP PUSH1 0x5 SWAP1 SWAP2 ADD SSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x49CF DUP4 DUP4 PUSH2 0x3653 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH2 0x120 DUP2 ADD DUP3 MSTORE DUP3 SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND DUP2 MSTORE PUSH1 0x1 DUP4 ADD SLOAD PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x2 DUP4 ADD SLOAD SWAP2 DUP2 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH1 0x3 DUP3 ADD SLOAD PUSH1 0x60 DUP3 ADD MSTORE PUSH1 0x4 DUP3 ADD SLOAD PUSH1 0x80 DUP3 ADD MSTORE PUSH1 0x5 DUP3 ADD SLOAD PUSH1 0xA0 DUP3 ADD MSTORE PUSH1 0x6 DUP3 ADD SLOAD PUSH1 0xC0 DUP3 ADD MSTORE PUSH1 0x7 DUP3 ADD SLOAD PUSH1 0xE0 DUP3 ADD MSTORE PUSH1 0x8 DUP3 ADD SLOAD PUSH2 0x100 DUP3 ADD MSTORE SWAP1 SWAP2 POP PUSH2 0x4A46 SWAP1 PUSH2 0x2054 JUMP JUMPDEST PUSH1 0x4 DUP3 ADD SLOAD DUP4 SWAP2 PUSH2 0x4A6C JUMPI PUSH1 0x40 MLOAD PUSH4 0x61B66E0D PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP3 SWAP2 SWAP1 PUSH2 0x5AD0 JUMP JUMPDEST POP POP PUSH1 0x0 PUSH1 0x7 SWAP1 SWAP2 ADD SSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x4A89 DUP4 PUSH3 0xF4240 LT ISZERO SWAP1 JUMP JUMPDEST DUP1 PUSH2 0x4A9C JUMPI POP PUSH2 0x4A9C DUP3 PUSH3 0xF4240 LT ISZERO SWAP1 JUMP JUMPDEST DUP4 DUP4 SWAP1 SWAP2 PUSH2 0x4ABF JUMPI PUSH1 0x40 MLOAD PUSH4 0x768BF0EB PUSH1 0xE1 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP3 SWAP2 SWAP1 PUSH2 0x5277 JUMP JUMPDEST POP PUSH3 0xF4240 SWAP1 POP PUSH2 0x4AD0 DUP4 DUP6 PUSH2 0x5CA1 JUMP JUMPDEST PUSH2 0x186C SWAP2 SWAP1 PUSH2 0x5F81 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x4AE4 PUSH2 0x2F04 JUMP JUMPDEST SLOAD PUSH1 0x1 PUSH1 0x40 SHL SWAP1 DIV PUSH1 0xFF AND SWAP2 SWAP1 POP JUMP JUMPDEST DUP2 DUP2 PUSH4 0xFFFFFFFF DUP1 DUP3 AND SWAP1 DUP4 AND GT ISZERO PUSH2 0x4B22 JUMPI PUSH1 0x40 MLOAD PUSH4 0xCCCCDAFB PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP3 SWAP2 SWAP1 PUSH2 0x5180 JUMP JUMPDEST POP DUP3 SWAP1 POP DUP2 PUSH4 0xFFFFFFFF DUP2 AND PUSH3 0xF4240 LT ISZERO PUSH2 0x4B53 JUMPI PUSH1 0x40 MLOAD PUSH4 0xCCCCDAFB PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP3 SWAP2 SWAP1 PUSH2 0x5180 JUMP JUMPDEST POP POP PUSH1 0x2 DUP1 SLOAD PUSH4 0xFFFFFFFF DUP4 DUP2 AND PUSH1 0x1 PUSH1 0xA0 SHL MUL PUSH4 0xFFFFFFFF PUSH1 0xA0 SHL NOT SWAP2 DUP7 AND PUSH1 0x1 PUSH1 0x80 SHL MUL SWAP2 SWAP1 SWAP2 AND PUSH1 0x1 PUSH1 0x80 SHL PUSH1 0x1 PUSH1 0xC0 SHL SUB NOT SWAP1 SWAP3 AND SWAP2 SWAP1 SWAP2 OR OR SWAP1 SSTORE PUSH1 0x40 MLOAD PUSH32 0x2FE5A7039987697813605CC0B9D6DB7AAB575408E3FC59E8A457BEF8D7BC0A36 SWAP1 PUSH2 0x273A SWAP1 DUP5 SWAP1 DUP5 SWAP1 PUSH2 0x5180 JUMP JUMPDEST DUP2 DUP2 PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP1 DUP3 AND SWAP1 DUP4 AND GT ISZERO PUSH2 0x4BF6 JUMPI PUSH1 0x40 MLOAD PUSH4 0xCCCCDAFB PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP3 SWAP2 SWAP1 PUSH2 0x521C JUMP JUMPDEST POP POP PUSH1 0x2 DUP1 SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP4 DUP2 AND PUSH1 0x1 PUSH1 0x40 SHL MUL PUSH1 0x1 PUSH1 0x1 PUSH1 0x80 SHL SUB NOT SWAP1 SWAP3 AND SWAP1 DUP6 AND OR OR SWAP1 SSTORE PUSH1 0x40 MLOAD PUSH32 0x2867E04C500E438761486B78021D4F9EB97C77FF45D10C1183F5583BA4CBF7D1 SWAP1 PUSH2 0x273A SWAP1 DUP5 SWAP1 DUP5 SWAP1 PUSH2 0x521C JUMP JUMPDEST PUSH2 0x4C5A PUSH2 0x4370 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x4C64 PUSH2 0x278D JUMP JUMPDEST SWAP1 POP PUSH1 0x2 DUP2 ADD PUSH2 0x4C74 DUP5 DUP3 PUSH2 0x5742 JUMP JUMPDEST POP PUSH1 0x3 DUP2 ADD PUSH2 0x4C83 DUP4 DUP3 PUSH2 0x5742 JUMP JUMPDEST POP PUSH1 0x0 DUP1 DUP3 SSTORE PUSH1 0x1 SWAP1 SWAP2 ADD SSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x84B PUSH2 0x4CC7 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH2 0x4CAD DUP7 DUP7 PUSH2 0x4D3B JUMP JUMPDEST SWAP3 POP SWAP3 POP SWAP3 POP PUSH2 0x4CBD DUP3 DUP3 PUSH2 0x4D88 JUMP JUMPDEST POP SWAP1 SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH32 0x8B73C3C69BB8FE3D512ECC4CF759CC79239F7B179B0FFACAA9A75D522B39400F PUSH2 0x4CF2 PUSH2 0x4E41 JUMP JUMPDEST PUSH2 0x4CFA PUSH2 0x4EA8 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 DUP2 ADD SWAP5 SWAP1 SWAP5 MSTORE DUP4 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH1 0x60 DUP3 ADD MSTORE CHAINID PUSH1 0x80 DUP3 ADD MSTORE ADDRESS PUSH1 0xA0 DUP3 ADD MSTORE PUSH1 0xC0 ADD PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 DUP4 SUB SUB DUP2 MSTORE SWAP1 PUSH1 0x40 MSTORE DUP1 MLOAD SWAP1 PUSH1 0x20 ADD KECCAK256 SWAP1 POP SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP4 MLOAD PUSH1 0x41 SUB PUSH2 0x4D75 JUMPI PUSH1 0x20 DUP5 ADD MLOAD PUSH1 0x40 DUP6 ADD MLOAD PUSH1 0x60 DUP7 ADD MLOAD PUSH1 0x0 BYTE PUSH2 0x4D67 DUP9 DUP3 DUP6 DUP6 PUSH2 0x4EE9 JUMP JUMPDEST SWAP6 POP SWAP6 POP SWAP6 POP POP POP POP PUSH2 0x4D81 JUMP JUMPDEST POP POP DUP2 MLOAD PUSH1 0x0 SWAP2 POP PUSH1 0x2 SWAP1 JUMPDEST SWAP3 POP SWAP3 POP SWAP3 JUMP JUMPDEST PUSH1 0x0 DUP3 PUSH1 0x3 DUP2 GT ISZERO PUSH2 0x4D9C JUMPI PUSH2 0x4D9C PUSH2 0x58DB JUMP JUMPDEST SUB PUSH2 0x4DA5 JUMPI POP POP JUMP JUMPDEST PUSH1 0x1 DUP3 PUSH1 0x3 DUP2 GT ISZERO PUSH2 0x4DB9 JUMPI PUSH2 0x4DB9 PUSH2 0x58DB JUMP JUMPDEST SUB PUSH2 0x4DD7 JUMPI PUSH1 0x40 MLOAD PUSH4 0xF645EEDF PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x2 DUP3 PUSH1 0x3 DUP2 GT ISZERO PUSH2 0x4DEB JUMPI PUSH2 0x4DEB PUSH2 0x58DB JUMP JUMPDEST SUB PUSH2 0x4E0C JUMPI PUSH1 0x40 MLOAD PUSH4 0xFCE698F7 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 DUP2 ADD DUP3 SWAP1 MSTORE PUSH1 0x24 ADD PUSH2 0x8EC JUMP JUMPDEST PUSH1 0x3 DUP3 PUSH1 0x3 DUP2 GT ISZERO PUSH2 0x4E20 JUMPI PUSH2 0x4E20 PUSH2 0x58DB JUMP JUMPDEST SUB PUSH2 0xA8F JUMPI PUSH1 0x40 MLOAD PUSH4 0x35E2F383 PUSH1 0xE2 SHL DUP2 MSTORE PUSH1 0x4 DUP2 ADD DUP3 SWAP1 MSTORE PUSH1 0x24 ADD PUSH2 0x8EC JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0x4E4C PUSH2 0x278D JUMP JUMPDEST SWAP1 POP PUSH1 0x0 PUSH2 0x4E58 PUSH2 0x27B1 JUMP JUMPDEST DUP1 MLOAD SWAP1 SWAP2 POP ISZERO PUSH2 0x4E70 JUMPI DUP1 MLOAD PUSH1 0x20 SWAP1 SWAP2 ADD KECCAK256 SWAP3 SWAP2 POP POP JUMP JUMPDEST DUP2 SLOAD DUP1 ISZERO PUSH2 0x4E7F JUMPI SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH32 0xC5D2460186F7233C927E7DB2DCC703C0E500B653CA82273B7BFAD8045D85A470 SWAP4 POP POP POP POP SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0x4EB3 PUSH2 0x278D JUMP JUMPDEST SWAP1 POP PUSH1 0x0 PUSH2 0x4EBF PUSH2 0x2852 JUMP JUMPDEST DUP1 MLOAD SWAP1 SWAP2 POP ISZERO PUSH2 0x4ED7 JUMPI DUP1 MLOAD PUSH1 0x20 SWAP1 SWAP2 ADD KECCAK256 SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x1 DUP3 ADD SLOAD DUP1 ISZERO PUSH2 0x4E7F JUMPI SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 DUP1 PUSH16 0xA2A8918CA85BAFE22016D0B997E4DF60 PUSH1 0x1 PUSH1 0xFF SHL SUB DUP5 GT ISZERO PUSH2 0x4F1A JUMPI POP PUSH1 0x0 SWAP2 POP PUSH1 0x3 SWAP1 POP DUP3 PUSH2 0x4FA4 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0x0 DUP1 DUP3 MSTORE PUSH1 0x20 DUP3 ADD DUP1 DUP5 MSTORE DUP11 SWAP1 MSTORE PUSH1 0xFF DUP10 AND SWAP3 DUP3 ADD SWAP3 SWAP1 SWAP3 MSTORE PUSH1 0x60 DUP2 ADD DUP8 SWAP1 MSTORE PUSH1 0x80 DUP2 ADD DUP7 SWAP1 MSTORE PUSH1 0x1 SWAP1 PUSH1 0xA0 ADD PUSH1 0x20 PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 SUB SWAP1 DUP1 DUP5 SUB SWAP1 DUP6 GAS STATICCALL ISZERO DUP1 ISZERO PUSH2 0x4F6E JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP PUSH1 0x40 MLOAD PUSH1 0x1F NOT ADD MLOAD SWAP2 POP POP PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP2 AND PUSH2 0x4F9A JUMPI POP PUSH1 0x0 SWAP3 POP PUSH1 0x1 SWAP2 POP DUP3 SWAP1 POP PUSH2 0x4FA4 JUMP JUMPDEST SWAP3 POP PUSH1 0x0 SWAP2 POP DUP2 SWAP1 POP JUMPDEST SWAP5 POP SWAP5 POP SWAP5 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 PUSH2 0x120 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x0 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP1 NOT AND DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE POP SWAP1 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP2 AND DUP2 EQ PUSH2 0x848 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP1 CALLDATALOAD PUSH2 0x5026 DUP2 PUSH2 0x5006 JUMP JUMPDEST SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x503D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD PUSH2 0x186C DUP2 PUSH2 0x5006 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB SWAP2 SWAP1 SWAP2 AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 JUMP JUMPDEST PUSH4 0xFFFFFFFF DUP2 AND DUP2 EQ PUSH2 0x848 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x5080 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD PUSH2 0x186C DUP2 PUSH2 0x505C JUMP JUMPDEST PUSH1 0x0 DUP1 DUP4 PUSH1 0x1F DUP5 ADD SLT PUSH2 0x509D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP DUP2 CALLDATALOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP2 GT ISZERO PUSH2 0x50B4 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x20 DUP4 ADD SWAP2 POP DUP4 PUSH1 0x20 DUP3 DUP6 ADD ADD GT ISZERO PUSH2 0x34BE JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH1 0x40 DUP5 DUP7 SUB SLT ISZERO PUSH2 0x50E1 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP4 CALLDATALOAD PUSH2 0x50EC DUP2 PUSH2 0x5006 JUMP JUMPDEST SWAP3 POP PUSH1 0x20 DUP5 ADD CALLDATALOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP2 GT ISZERO PUSH2 0x5107 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x5113 DUP7 DUP3 DUP8 ADD PUSH2 0x508B JUMP JUMPDEST SWAP5 SWAP8 SWAP1 SWAP7 POP SWAP4 SWAP5 POP POP POP POP JUMP JUMPDEST DUP1 ISZERO ISZERO DUP2 EQ PUSH2 0x848 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x5141 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 CALLDATALOAD PUSH2 0x514C DUP2 PUSH2 0x5006 JUMP JUMPDEST SWAP2 POP PUSH1 0x20 DUP4 ADD CALLDATALOAD PUSH2 0x515C DUP2 PUSH2 0x5120 JUMP JUMPDEST DUP1 SWAP2 POP POP SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x5179 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP CALLDATALOAD SWAP2 SWAP1 POP JUMP JUMPDEST PUSH4 0xFFFFFFFF SWAP3 DUP4 AND DUP2 MSTORE SWAP2 AND PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x51B2 JUMPI DUP2 DUP2 ADD MLOAD DUP4 DUP3 ADD MSTORE PUSH1 0x20 ADD PUSH2 0x519A JUMP JUMPDEST POP POP PUSH1 0x0 SWAP2 ADD MSTORE JUMP JUMPDEST PUSH1 0x0 DUP2 MLOAD DUP1 DUP5 MSTORE PUSH2 0x51D3 DUP2 PUSH1 0x20 DUP7 ADD PUSH1 0x20 DUP7 ADD PUSH2 0x5197 JUMP JUMPDEST PUSH1 0x1F ADD PUSH1 0x1F NOT AND SWAP3 SWAP1 SWAP3 ADD PUSH1 0x20 ADD SWAP3 SWAP2 POP POP JUMP JUMPDEST DUP4 DUP2 MSTORE PUSH1 0x60 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x0 PUSH2 0x5200 PUSH1 0x60 DUP4 ADD DUP6 PUSH2 0x51BB JUMP JUMPDEST DUP3 DUP2 SUB PUSH1 0x40 DUP5 ADD MSTORE PUSH2 0x5212 DUP2 DUP6 PUSH2 0x51BB JUMP JUMPDEST SWAP7 SWAP6 POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB SWAP3 DUP4 AND DUP2 MSTORE SWAP2 AND PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH1 0x60 DUP5 DUP7 SUB SLT ISZERO PUSH2 0x524B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP4 CALLDATALOAD PUSH2 0x5256 DUP2 PUSH2 0x5006 JUMP JUMPDEST SWAP3 POP PUSH1 0x20 DUP5 ADD CALLDATALOAD PUSH2 0x5266 DUP2 PUSH2 0x5006 JUMP JUMPDEST SWAP3 SWAP6 SWAP3 SWAP5 POP POP POP PUSH1 0x40 SWAP2 SWAP1 SWAP2 ADD CALLDATALOAD SWAP1 JUMP JUMPDEST SWAP2 DUP3 MSTORE PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0xFF PUSH1 0xF8 SHL DUP9 AND DUP2 MSTORE PUSH1 0xE0 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x0 PUSH2 0x52A4 PUSH1 0xE0 DUP4 ADD DUP10 PUSH2 0x51BB JUMP JUMPDEST DUP3 DUP2 SUB PUSH1 0x40 DUP5 ADD MSTORE PUSH2 0x52B6 DUP2 DUP10 PUSH2 0x51BB JUMP JUMPDEST PUSH1 0x60 DUP5 ADD DUP9 SWAP1 MSTORE PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP8 AND PUSH1 0x80 DUP6 ADD MSTORE PUSH1 0xA0 DUP5 ADD DUP7 SWAP1 MSTORE DUP4 DUP2 SUB PUSH1 0xC0 DUP6 ADD MSTORE DUP5 MLOAD DUP1 DUP3 MSTORE PUSH1 0x20 DUP1 DUP8 ADD SWAP4 POP SWAP1 SWAP2 ADD SWAP1 PUSH1 0x0 JUMPDEST DUP2 DUP2 LT ISZERO PUSH2 0x530C JUMPI DUP4 MLOAD DUP4 MSTORE PUSH1 0x20 SWAP4 DUP5 ADD SWAP4 SWAP1 SWAP3 ADD SWAP2 PUSH1 0x1 ADD PUSH2 0x52EE JUMP JUMPDEST POP SWAP1 SWAP12 SWAP11 POP POP POP POP POP POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x20 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x5330 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 CALLDATALOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP2 GT ISZERO PUSH2 0x5346 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP4 ADD PUSH1 0x1F DUP2 ADD DUP6 SGT PUSH2 0x5357 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP1 CALLDATALOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP2 GT ISZERO PUSH2 0x536D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP6 PUSH1 0x20 DUP3 PUSH1 0x5 SHL DUP5 ADD ADD GT ISZERO PUSH2 0x5382 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x20 SWAP2 SWAP1 SWAP2 ADD SWAP6 SWAP1 SWAP5 POP SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD PUSH1 0x20 DUP4 MSTORE DUP1 DUP5 MLOAD DUP1 DUP4 MSTORE PUSH1 0x40 DUP6 ADD SWAP2 POP PUSH1 0x40 DUP2 PUSH1 0x5 SHL DUP7 ADD ADD SWAP3 POP PUSH1 0x20 DUP7 ADD PUSH1 0x0 JUMPDEST DUP3 DUP2 LT ISZERO PUSH2 0x53EB JUMPI PUSH1 0x3F NOT DUP8 DUP7 SUB ADD DUP5 MSTORE PUSH2 0x53D6 DUP6 DUP4 MLOAD PUSH2 0x51BB JUMP JUMPDEST SWAP5 POP PUSH1 0x20 SWAP4 DUP5 ADD SWAP4 SWAP2 SWAP1 SWAP2 ADD SWAP1 PUSH1 0x1 ADD PUSH2 0x53BA JUMP JUMPDEST POP SWAP3 SWAP7 SWAP6 POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0x60 DUP6 DUP8 SUB SLT ISZERO PUSH2 0x540D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP5 CALLDATALOAD PUSH2 0x5418 DUP2 PUSH2 0x5006 JUMP JUMPDEST SWAP4 POP PUSH1 0x20 DUP6 ADD CALLDATALOAD PUSH1 0x3 DUP2 LT PUSH2 0x542C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST SWAP3 POP PUSH1 0x40 DUP6 ADD CALLDATALOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP2 GT ISZERO PUSH2 0x5447 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x5453 DUP8 DUP3 DUP9 ADD PUSH2 0x508B JUMP JUMPDEST SWAP6 SWAP9 SWAP5 SWAP8 POP SWAP6 POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0x80 DUP6 DUP8 SUB SLT ISZERO PUSH2 0x5475 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP5 CALLDATALOAD PUSH2 0x5480 DUP2 PUSH2 0x5006 JUMP JUMPDEST SWAP4 POP PUSH1 0x20 DUP6 ADD CALLDATALOAD SWAP3 POP PUSH1 0x40 DUP6 ADD CALLDATALOAD PUSH2 0x5497 DUP2 PUSH2 0x505C JUMP JUMPDEST SWAP4 SWAP7 SWAP3 SWAP6 POP SWAP3 SWAP4 PUSH1 0x60 ADD CALLDATALOAD SWAP3 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x54BA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 CALLDATALOAD PUSH2 0x54C5 DUP2 PUSH2 0x5006 JUMP JUMPDEST SWAP2 POP PUSH1 0x20 DUP4 ADD CALLDATALOAD PUSH2 0x515C DUP2 PUSH2 0x5006 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB SWAP4 DUP5 AND DUP2 MSTORE SWAP2 DUP4 AND PUSH1 0x20 DUP4 ADD MSTORE SWAP1 SWAP2 AND PUSH1 0x40 DUP3 ADD MSTORE PUSH1 0x60 ADD SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x550A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 MLOAD PUSH2 0x186C DUP2 PUSH2 0x5120 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB SWAP3 DUP4 AND DUP2 MSTORE SWAP2 AND PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH4 0x4E487B71 PUSH1 0xE0 SHL PUSH1 0x0 MSTORE PUSH1 0x41 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x140 DUP2 ADD PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP2 GT DUP3 DUP3 LT OR ISZERO PUSH2 0x5568 JUMPI PUSH2 0x5568 PUSH2 0x552F JUMP JUMPDEST PUSH1 0x40 MSTORE SWAP1 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP1 DUP2 ADD PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP2 GT DUP3 DUP3 LT OR ISZERO PUSH2 0x5568 JUMPI PUSH2 0x5568 PUSH2 0x552F JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH1 0xE0 DUP2 ADD PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP2 GT DUP3 DUP3 LT OR ISZERO PUSH2 0x5568 JUMPI PUSH2 0x5568 PUSH2 0x552F JUMP JUMPDEST PUSH1 0x0 DUP3 PUSH1 0x1F DUP4 ADD SLT PUSH2 0x55C3 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD PUSH1 0x20 DUP4 ADD PUSH1 0x0 DUP1 PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP5 GT ISZERO PUSH2 0x55E3 JUMPI PUSH2 0x55E3 PUSH2 0x552F JUMP JUMPDEST POP PUSH1 0x40 MLOAD PUSH1 0x1F NOT PUSH1 0x1F DUP6 ADD DUP2 AND PUSH1 0x3F ADD AND DUP2 ADD DUP2 DUP2 LT PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP3 GT OR ISZERO PUSH2 0x5611 JUMPI PUSH2 0x5611 PUSH2 0x552F JUMP JUMPDEST PUSH1 0x40 MSTORE DUP4 DUP2 MSTORE SWAP1 POP DUP1 DUP3 DUP5 ADD DUP8 LT ISZERO PUSH2 0x5629 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP4 DUP4 PUSH1 0x20 DUP4 ADD CALLDATACOPY PUSH1 0x0 PUSH1 0x20 DUP6 DUP4 ADD ADD MSTORE DUP1 SWAP5 POP POP POP POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH1 0x60 DUP5 DUP7 SUB SLT ISZERO PUSH2 0x565B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP4 CALLDATALOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP2 GT ISZERO PUSH2 0x5671 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x567D DUP7 DUP3 DUP8 ADD PUSH2 0x55B2 JUMP JUMPDEST SWAP4 POP POP PUSH1 0x20 DUP5 ADD CALLDATALOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP2 GT ISZERO PUSH2 0x5699 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x56A5 DUP7 DUP3 DUP8 ADD PUSH2 0x55B2 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x40 DUP5 ADD CALLDATALOAD PUSH2 0x56B6 DUP2 PUSH2 0x5006 JUMP JUMPDEST DUP1 SWAP2 POP POP SWAP3 POP SWAP3 POP SWAP3 JUMP JUMPDEST PUSH1 0x1 DUP2 DUP2 SHR SWAP1 DUP3 AND DUP1 PUSH2 0x56D5 JUMPI PUSH1 0x7F DUP3 AND SWAP2 POP JUMPDEST PUSH1 0x20 DUP3 LT DUP2 SUB PUSH2 0x56F5 JUMPI PUSH4 0x4E487B71 PUSH1 0xE0 SHL PUSH1 0x0 MSTORE PUSH1 0x22 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x1F DUP3 GT ISZERO PUSH2 0xD3C JUMPI DUP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 PUSH1 0x1F DUP5 ADD PUSH1 0x5 SHR DUP2 ADD PUSH1 0x20 DUP6 LT ISZERO PUSH2 0x5722 JUMPI POP DUP1 JUMPDEST PUSH1 0x1F DUP5 ADD PUSH1 0x5 SHR DUP3 ADD SWAP2 POP JUMPDEST DUP2 DUP2 LT ISZERO PUSH2 0x306F JUMPI PUSH1 0x0 DUP2 SSTORE PUSH1 0x1 ADD PUSH2 0x572E JUMP JUMPDEST DUP2 MLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP2 GT ISZERO PUSH2 0x575B JUMPI PUSH2 0x575B PUSH2 0x552F JUMP JUMPDEST PUSH2 0x576F DUP2 PUSH2 0x5769 DUP5 SLOAD PUSH2 0x56C1 JUMP JUMPDEST DUP5 PUSH2 0x56FB JUMP JUMPDEST PUSH1 0x20 PUSH1 0x1F DUP3 GT PUSH1 0x1 DUP2 EQ PUSH2 0x57A3 JUMPI PUSH1 0x0 DUP4 ISZERO PUSH2 0x578B JUMPI POP DUP5 DUP3 ADD MLOAD JUMPDEST PUSH1 0x0 NOT PUSH1 0x3 DUP6 SWAP1 SHL SHR NOT AND PUSH1 0x1 DUP5 SWAP1 SHL OR DUP5 SSTORE PUSH2 0x306F JUMP JUMPDEST PUSH1 0x0 DUP5 DUP2 MSTORE PUSH1 0x20 DUP2 KECCAK256 PUSH1 0x1F NOT DUP6 AND SWAP2 JUMPDEST DUP3 DUP2 LT ISZERO PUSH2 0x57D3 JUMPI DUP8 DUP6 ADD MLOAD DUP3 SSTORE PUSH1 0x20 SWAP5 DUP6 ADD SWAP5 PUSH1 0x1 SWAP1 SWAP3 ADD SWAP2 ADD PUSH2 0x57B3 JUMP JUMPDEST POP DUP5 DUP3 LT ISZERO PUSH2 0x57F1 JUMPI DUP7 DUP5 ADD MLOAD PUSH1 0x0 NOT PUSH1 0x3 DUP8 SWAP1 SHL PUSH1 0xF8 AND SHR NOT AND DUP2 SSTORE JUMPDEST POP POP POP POP PUSH1 0x1 SWAP1 DUP2 SHL ADD SWAP1 SSTORE POP JUMP JUMPDEST PUSH1 0x20 DUP2 MSTORE DUP2 PUSH1 0x20 DUP3 ADD MSTORE DUP2 DUP4 PUSH1 0x40 DUP4 ADD CALLDATACOPY PUSH1 0x0 DUP2 DUP4 ADD PUSH1 0x40 SWAP1 DUP2 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH1 0x1F SWAP1 SWAP3 ADD PUSH1 0x1F NOT AND ADD ADD SWAP2 SWAP1 POP JUMP JUMPDEST PUSH4 0x4E487B71 PUSH1 0xE0 SHL PUSH1 0x0 MSTORE PUSH1 0x11 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST DUP2 DUP2 SUB DUP2 DUP2 GT ISZERO PUSH2 0x12B8 JUMPI PUSH2 0x12B8 PUSH2 0x582F JUMP JUMPDEST PUSH4 0x4E487B71 PUSH1 0xE0 SHL PUSH1 0x0 MSTORE PUSH1 0x32 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST PUSH1 0x0 DUP1 DUP4 CALLDATALOAD PUSH1 0x1E NOT DUP5 CALLDATASIZE SUB ADD DUP2 SLT PUSH2 0x5885 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP4 ADD DUP1 CALLDATALOAD SWAP2 POP PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP3 GT ISZERO PUSH2 0x589F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x20 ADD SWAP2 POP CALLDATASIZE DUP2 SWAP1 SUB DUP3 SGT ISZERO PUSH2 0x34BE JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 DUP5 DUP3 CALLDATACOPY PUSH1 0x0 DUP4 DUP3 ADD PUSH1 0x0 DUP2 MSTORE DUP4 MLOAD PUSH2 0x58D1 DUP2 DUP4 PUSH1 0x20 DUP9 ADD PUSH2 0x5197 JUMP JUMPDEST ADD SWAP6 SWAP5 POP POP POP POP POP JUMP JUMPDEST PUSH4 0x4E487B71 PUSH1 0xE0 SHL PUSH1 0x0 MSTORE PUSH1 0x21 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST PUSH1 0x3 DUP2 LT PUSH2 0x590F JUMPI PUSH4 0x4E487B71 PUSH1 0xE0 SHL PUSH1 0x0 MSTORE PUSH1 0x21 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST SWAP1 MSTORE JUMP JUMPDEST PUSH1 0x20 DUP2 ADD PUSH2 0x12B8 DUP3 DUP5 PUSH2 0x58F1 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x5934 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP POP DUP1 CALLDATALOAD SWAP3 PUSH1 0x20 SWAP1 SWAP2 ADD CALLDATALOAD SWAP2 POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0x80 DUP6 DUP8 SUB SLT ISZERO PUSH2 0x5959 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP5 CALLDATALOAD SWAP4 POP PUSH1 0x20 DUP6 ADD CALLDATALOAD SWAP3 POP PUSH1 0x40 DUP6 ADD CALLDATALOAD PUSH2 0x5972 DUP2 PUSH2 0x5006 JUMP JUMPDEST SWAP2 POP PUSH1 0x60 DUP6 ADD CALLDATALOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP2 GT ISZERO PUSH2 0x598D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x5999 DUP8 DUP3 DUP9 ADD PUSH2 0x55B2 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP6 SWAP2 SWAP5 POP SWAP3 POP JUMP JUMPDEST DUP1 MLOAD PUSH2 0x5026 DUP2 PUSH2 0x505C JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP2 AND DUP2 EQ PUSH2 0x848 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP1 MLOAD PUSH2 0x5026 DUP2 PUSH2 0x59B0 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x140 DUP3 DUP5 SUB SLT DUP1 ISZERO PUSH2 0x59E4 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x0 PUSH2 0x59EF PUSH2 0x5545 JUMP JUMPDEST DUP4 MLOAD DUP2 MSTORE PUSH1 0x20 DUP1 DUP6 ADD MLOAD SWAP1 DUP3 ADD MSTORE PUSH1 0x40 DUP1 DUP6 ADD MLOAD SWAP1 DUP3 ADD MSTORE PUSH2 0x5A13 PUSH1 0x60 DUP6 ADD PUSH2 0x59A5 JUMP JUMPDEST PUSH1 0x60 DUP3 ADD MSTORE PUSH2 0x5A24 PUSH1 0x80 DUP6 ADD PUSH2 0x59C5 JUMP JUMPDEST PUSH1 0x80 DUP3 ADD MSTORE PUSH2 0x5A35 PUSH1 0xA0 DUP6 ADD PUSH2 0x59C5 JUMP JUMPDEST PUSH1 0xA0 DUP3 ADD MSTORE PUSH2 0x5A46 PUSH1 0xC0 DUP6 ADD PUSH2 0x59A5 JUMP JUMPDEST PUSH1 0xC0 DUP3 ADD MSTORE PUSH2 0x5A57 PUSH1 0xE0 DUP6 ADD PUSH2 0x59C5 JUMP JUMPDEST PUSH1 0xE0 DUP3 ADD MSTORE PUSH2 0x100 DUP5 DUP2 ADD MLOAD SWAP1 DUP3 ADD MSTORE PUSH2 0x120 SWAP4 DUP5 ADD MLOAD SWAP4 DUP2 ADD SWAP4 SWAP1 SWAP4 MSTORE POP SWAP1 SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x5A8F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP MLOAD SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x5AA8 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 MLOAD PUSH2 0x186C DUP2 PUSH2 0x505C JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x5AC5 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 MLOAD PUSH2 0x186C DUP2 PUSH2 0x59B0 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB SWAP3 SWAP1 SWAP3 AND DUP3 MSTORE PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST DUP1 DUP3 ADD DUP1 DUP3 GT ISZERO PUSH2 0x12B8 JUMPI PUSH2 0x12B8 PUSH2 0x582F JUMP JUMPDEST PUSH1 0x0 DUP3 MLOAD PUSH2 0x5B0E DUP2 DUP5 PUSH1 0x20 DUP8 ADD PUSH2 0x5197 JUMP JUMPDEST SWAP2 SWAP1 SWAP2 ADD SWAP3 SWAP2 POP POP JUMP JUMPDEST DUP1 CALLDATALOAD PUSH2 0x5026 DUP2 PUSH2 0x59B0 JUMP JUMPDEST DUP1 CALLDATALOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0x80 SHL SUB DUP2 AND DUP2 EQ PUSH2 0x5026 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x5B4D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 CALLDATALOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP2 GT ISZERO PUSH2 0x5B63 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP4 ADD PUSH1 0x40 DUP2 DUP7 SUB SLT ISZERO PUSH2 0x5B75 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x5B7D PUSH2 0x556E JUMP JUMPDEST DUP2 CALLDATALOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP2 GT ISZERO PUSH2 0x5B93 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 ADD PUSH1 0xE0 DUP2 DUP9 SUB SLT ISZERO PUSH2 0x5BA5 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x5BAD PUSH2 0x5590 JUMP JUMPDEST DUP2 CALLDATALOAD DUP2 MSTORE PUSH2 0x5BBD PUSH1 0x20 DUP4 ADD PUSH2 0x501B JUMP JUMPDEST PUSH1 0x20 DUP3 ADD MSTORE PUSH2 0x5BCE PUSH1 0x40 DUP4 ADD PUSH2 0x501B JUMP JUMPDEST PUSH1 0x40 DUP3 ADD MSTORE PUSH2 0x5BDF PUSH1 0x60 DUP4 ADD PUSH2 0x501B JUMP JUMPDEST PUSH1 0x60 DUP3 ADD MSTORE PUSH2 0x5BF0 PUSH1 0x80 DUP4 ADD PUSH2 0x5B18 JUMP JUMPDEST PUSH1 0x80 DUP3 ADD MSTORE PUSH2 0x5C01 PUSH1 0xA0 DUP4 ADD PUSH2 0x5B23 JUMP JUMPDEST PUSH1 0xA0 DUP3 ADD MSTORE PUSH1 0xC0 DUP3 ADD CALLDATALOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP2 GT ISZERO PUSH2 0x5C1F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x5C2B DUP10 DUP3 DUP6 ADD PUSH2 0x55B2 JUMP JUMPDEST PUSH1 0xC0 DUP4 ADD MSTORE POP DUP3 MSTORE POP PUSH1 0x20 DUP3 ADD CALLDATALOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP2 GT ISZERO PUSH2 0x5C4D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x5C59 DUP8 DUP3 DUP6 ADD PUSH2 0x55B2 JUMP JUMPDEST PUSH1 0x20 DUP4 DUP2 ADD SWAP2 SWAP1 SWAP2 MSTORE SWAP2 SWAP8 SWAP6 SWAP1 SWAP2 ADD CALLDATALOAD SWAP6 POP POP POP POP POP JUMP JUMPDEST PUSH2 0x5C7B DUP2 DUP6 PUSH2 0x58F1 JUMP JUMPDEST PUSH1 0x60 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x0 PUSH2 0x5C91 PUSH1 0x60 DUP4 ADD DUP6 PUSH2 0x51BB JUMP JUMPDEST SWAP1 POP DUP3 PUSH1 0x40 DUP4 ADD MSTORE SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST DUP1 DUP3 MUL DUP2 ISZERO DUP3 DUP3 DIV DUP5 EQ OR PUSH2 0x12B8 JUMPI PUSH2 0x12B8 PUSH2 0x582F JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH1 0x60 DUP5 DUP7 SUB SLT ISZERO PUSH2 0x5CCD JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP4 CALLDATALOAD PUSH2 0x5CD8 DUP2 PUSH2 0x5006 JUMP JUMPDEST SWAP3 POP PUSH1 0x20 DUP5 ADD CALLDATALOAD SWAP2 POP PUSH1 0x40 DUP5 ADD CALLDATALOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP2 GT ISZERO PUSH2 0x5CFA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x5D06 DUP7 DUP3 DUP8 ADD PUSH2 0x55B2 JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 POP SWAP3 JUMP JUMPDEST PUSH1 0x80 DUP2 MSTORE PUSH1 0x0 PUSH2 0x5D23 PUSH1 0x80 DUP4 ADD DUP8 PUSH2 0x51BB JUMP JUMPDEST PUSH1 0x20 DUP4 ADD SWAP6 SWAP1 SWAP6 MSTORE POP PUSH1 0x40 DUP2 ADD SWAP3 SWAP1 SWAP3 MSTORE PUSH1 0x60 SWAP1 SWAP2 ADD MSTORE SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x5D52 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 MLOAD PUSH1 0x20 DUP5 ADD MLOAD SWAP1 SWAP3 POP PUSH2 0x515C DUP2 PUSH2 0x5006 JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH2 0x5D74 JUMPI PUSH2 0x5D74 PUSH2 0x582F JUMP JUMPDEST POP PUSH1 0x0 NOT ADD SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1 DUP3 ADD PUSH2 0x5D8E JUMPI PUSH2 0x5D8E PUSH2 0x582F JUMP JUMPDEST POP PUSH1 0x1 ADD SWAP1 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB SWAP4 DUP5 AND DUP2 MSTORE SWAP2 SWAP1 SWAP3 AND PUSH1 0x20 DUP3 ADD MSTORE PUSH4 0xFFFFFFFF SWAP1 SWAP2 AND PUSH1 0x40 DUP3 ADD MSTORE PUSH1 0x60 ADD SWAP1 JUMP JUMPDEST PUSH1 0x60 DUP1 DUP3 MSTORE DUP5 MLOAD PUSH1 0x40 DUP4 DUP4 ADD DUP2 SWAP1 MSTORE DUP2 MLOAD PUSH1 0xA0 DUP6 ADD MSTORE PUSH1 0x20 DUP3 ADD MLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB SWAP1 DUP2 AND PUSH1 0xC0 DUP7 ADD MSTORE SWAP1 DUP3 ADD MLOAD DUP2 AND PUSH1 0xE0 DUP6 ADD MSTORE SWAP2 DUP2 ADD MLOAD SWAP1 SWAP2 AND PUSH2 0x100 DUP4 ADD MSTORE PUSH1 0x80 DUP2 ADD MLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP2 AND PUSH2 0x120 DUP5 ADD MSTORE PUSH1 0x0 SWAP2 SWAP1 POP PUSH1 0xA0 DUP2 ADD MLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0x80 SHL SUB DUP2 AND PUSH2 0x140 DUP6 ADD MSTORE POP PUSH1 0xC0 ADD MLOAD PUSH1 0xE0 PUSH2 0x160 DUP5 ADD MSTORE PUSH2 0x5E4B PUSH2 0x180 DUP5 ADD DUP3 PUSH2 0x51BB JUMP JUMPDEST SWAP1 POP PUSH1 0x20 DUP7 ADD MLOAD PUSH1 0x5F NOT DUP5 DUP4 SUB ADD PUSH1 0x80 DUP6 ADD MSTORE PUSH2 0x5E68 DUP3 DUP3 PUSH2 0x51BB JUMP JUMPDEST SWAP3 POP POP POP DUP4 PUSH1 0x20 DUP4 ADD MSTORE PUSH2 0x3335 PUSH1 0x40 DUP4 ADD DUP5 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND SWAP1 MSTORE JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP5 DUP2 AND DUP3 MSTORE DUP4 AND PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x60 DUP2 ADD PUSH2 0x3335 PUSH1 0x40 DUP4 ADD DUP5 PUSH2 0x58F1 JUMP JUMPDEST PUSH1 0x0 PUSH1 0xA0 DUP3 DUP5 SUB SLT DUP1 ISZERO PUSH2 0x5EBF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x40 MLOAD PUSH1 0x0 SWAP1 PUSH1 0xA0 DUP2 ADD PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP2 GT DUP3 DUP3 LT OR ISZERO PUSH2 0x5EE5 JUMPI PUSH2 0x5EE5 PUSH2 0x552F JUMP JUMPDEST PUSH1 0x40 SWAP1 DUP2 MSTORE DUP5 MLOAD DUP3 MSTORE PUSH1 0x20 DUP1 DUP7 ADD MLOAD SWAP1 DUP4 ADD MSTORE DUP5 DUP2 ADD MLOAD SWAP1 DUP3 ADD MSTORE PUSH1 0x60 DUP1 DUP6 ADD MLOAD SWAP1 DUP3 ADD MSTORE PUSH1 0x80 SWAP4 DUP5 ADD MLOAD SWAP4 DUP2 ADD SWAP4 SWAP1 SWAP4 MSTORE POP SWAP1 SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB SWAP4 DUP5 AND DUP2 MSTORE SWAP2 SWAP1 SWAP3 AND PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 DUP2 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH1 0x60 ADD SWAP1 JUMP JUMPDEST DUP7 DUP2 MSTORE DUP6 PUSH1 0x20 DUP3 ADD MSTORE DUP5 PUSH1 0x40 DUP3 ADD MSTORE DUP4 PUSH1 0x60 DUP3 ADD MSTORE PUSH1 0xC0 PUSH1 0x80 DUP3 ADD MSTORE PUSH1 0x0 PUSH2 0x5F6E PUSH1 0xC0 DUP4 ADD DUP6 PUSH2 0x51BB JUMP JUMPDEST SWAP1 POP DUP3 PUSH1 0xA0 DUP4 ADD MSTORE SWAP8 SWAP7 POP POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP3 PUSH2 0x5F9E JUMPI PUSH4 0x4E487B71 PUSH1 0xE0 SHL PUSH1 0x0 MSTORE PUSH1 0x12 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST POP DIV SWAP1 JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0xB8 TSTORE 0xE9 SELFBALANCE LOG2 0xAD CALL MSTORE8 0xB4 0xD5 0xD6 PUSH4 0x60454C8D MOD 0x24 0xBC 0xA9 SWAP9 0xD3 0xFC DUP16 SLT 0xBD OR 0xE3 SAR PUSH21 0x127864736F6C634300081B00330000000000000000 ", + "sourceMap": "1972:23938:57:-:0;;;3174:286;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;3367:4;3374:14;3390:19;3411:8;3332:15;;-1:-1:-1;;;;;4355:24:37;;4347:81;;;;-1:-1:-1;;;4347:81:37;;866:2:70;4347:81:37;;;848:21:70;905:2;885:18;;;878:30;-1:-1:-1;;;924:18:70;;;917:40;974:18;;4347:81:37;;;;;;;;;-1:-1:-1;;;;;4439:42:37;;;;4517:40;;;;;;;;;;;;-1:-1:-1;;;4517:40:37;;;;;;:26;:40::i;:::-;-1:-1:-1;;;;;4491:67:37;;;4600:37;;;;;;;;;;;;-1:-1:-1;;;4600:37:37;;;;;;:26;:37::i;:::-;-1:-1:-1;;;;;4568:70:37;;;4680:43;;;;;;;;;;;;-1:-1:-1;;;4680:43:37;;;;;;:26;:43::i;:::-;-1:-1:-1;;;;;4648:76:37;;;4774:44;;;;;;;;;;;;-1:-1:-1;;;4774:44:37;;;;;;:26;:44::i;:::-;-1:-1:-1;;;;;4734:85:37;;;4865:42;;;;;;;;;;;;-1:-1:-1;;;4865:42:37;;;;;;:26;:42::i;:::-;-1:-1:-1;;;;;4829:79:37;;;4958:44;;;;;;;;;;;;-1:-1:-1;;;4958:44:37;;;;;;:26;:44::i;:::-;-1:-1:-1;;;;;4918:85:37;;;5049:47;;;;;;;;;;;;-1:-1:-1;;;5049:47:37;;;;;;:26;:47::i;:::-;-1:-1:-1;;;;;5013:84:37;;;5144:45;;;;;;;;;;;;-1:-1:-1;;;5144:45:37;;;;;;:26;:45::i;:::-;-1:-1:-1;;;;;5107:83:37;;;5227:38;;;;;;;;;;;;-1:-1:-1;;;5227:38:37;;;;;;:26;:38::i;:::-;-1:-1:-1;;;;;5200:66:37;;;;;;;5480:16;;5363:13;;5329:11;;5399:14;;5436:21;;5519:19;;5561:21;;5605:19;;5647:17;;5282:430;;;;;;;;;;;;;;;;;;;5647:17;;-1:-1:-1;;;;;1336:32:70;;;1318:51;;1405:32;;;1400:2;1385:18;;1378:60;1474:32;;;1469:2;1454:18;;1447:60;1543:32;;;1538:2;1523:18;;1516:60;1613:32;;1607:3;1592:19;;1585:61;1683:32;;1356:3;1662:19;;1655:61;1753:32;;;1747:3;1732:19;;1725:61;1305:3;1290:19;;1003:789;5282:430:37;;;;;;;;-1:-1:-1;;;;;;;2913:52:69;;;;;;;2975:49;;;;;;;3034:65;;;;;;;3109:30;;;;;;;3155:99;;;2028:51:70;;;2110:2;2095:18;;2088:60;;;;2164:18;;;2157:60;;;;2248:2;2233:18;;2226:60;;;;3155:99:69;;2015:3:70;2000:19;3155:99:69;;;;;;;2795:466;;;;3431:22:57::2;:20;;;:22;;:::i;:::-;3174:286:::0;;;;1972:23938;;8217:326:37;8303:7;8322:23;8348:16;;-1:-1:-1;;;;;8348:33:37;;8392:13;8382:24;;;;;;8348:59;;;;;;;;;;;;;2443:25:70;;2431:2;2416:18;;2297:177;8348:59:37;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;8322:85;-1:-1:-1;8489:13:37;-1:-1:-1;;;;;8425:29:37;;8417:87;;;;-1:-1:-1;;;8417:87:37;;;;;;;;:::i;:::-;-1:-1:-1;8521:15:37;8217:326;-1:-1:-1;;8217:326:37:o;7709:422:39:-;3147:66;7898:15;;;;;;;7894:76;;;7936:23;;-1:-1:-1;;;7936:23:39;;;;;;;;;;;7894:76;7983:14;;-1:-1:-1;;;;;7983:14:39;;;:34;7979:146;;8033:33;;-1:-1:-1;;;;;;8033:33:39;-1:-1:-1;;;;;8033:33:39;;;;;8085:29;;3366:50:70;;;8085:29:39;;3354:2:70;3339:18;8085:29:39;;;;;;;7979:146;7758:373;7709:422::o;14:177:70:-;93:13;;-1:-1:-1;;;;;135:31:70;;125:42;;115:70;;181:1;178;171:12;115:70;14:177;;;:::o;196:464::-;293:6;301;309;317;370:3;358:9;349:7;345:23;341:33;338:53;;;387:1;384;377:12;338:53;410:40;440:9;410:40;:::i;:::-;400:50;;469:49;514:2;503:9;499:18;469:49;:::i;:::-;459:59;;537:49;582:2;571:9;567:18;537:49;:::i;:::-;527:59;;605:49;650:2;639:9;635:18;605:49;:::i;:::-;595:59;;196:464;;;;;;;:::o;2479:208::-;2549:6;2602:2;2590:9;2581:7;2577:23;2573:32;2570:52;;;2618:1;2615;2608:12;2570:52;2641:40;2671:9;2641:40;:::i;:::-;2631:50;2479:208;-1:-1:-1;;;2479:208:70:o;2692:525::-;2839:2;2828:9;2821:21;2802:4;2871:6;2865:13;2914:6;2909:2;2898:9;2894:18;2887:34;2939:1;2949:140;2963:6;2960:1;2957:13;2949:140;;;3074:2;3058:14;;;3054:23;;3048:30;3043:2;3024:17;;;3020:26;3013:66;2978:10;2949:140;;;2953:3;3138:1;3133:2;3124:6;3113:9;3109:22;3105:31;3098:42;3208:2;3201;3197:7;3192:2;3184:6;3180:15;3176:29;3165:9;3161:45;3157:54;3149:62;;;2692:525;;;;:::o;3222:200::-;1972:23938:57;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;" + }, + "deployedBytecode": { + "functionDebugData": { + "@_EIP712NameHash_5991": { + "entryPoint": 20033, + "id": 5991, + "parameterSlots": 0, + "returnSlots": 1 + }, + "@_EIP712Name_5923": { + "entryPoint": 10161, + "id": 5923, + "parameterSlots": 0, + "returnSlots": 1 + }, + "@_EIP712VersionHash_6043": { + "entryPoint": 20136, + "id": 6043, + "parameterSlots": 0, + "returnSlots": 1 + }, + "@_EIP712Version_5939": { + "entryPoint": 10322, + "id": 5939, + "parameterSlots": 0, + "returnSlots": 1 + }, + "@__AllocationManager_init_16649": { + "entryPoint": 12142, + "id": 16649, + "parameterSlots": 2, + "returnSlots": 0 + }, + "@__AllocationManager_init_unchained_16656": { + "entryPoint": null, + "id": 16656, + "parameterSlots": 0, + "returnSlots": 0 + }, + "@__DataServicePausable_init_1384": { + "entryPoint": 12126, + "id": 1384, + "parameterSlots": 0, + "returnSlots": 0 + }, + "@__DataServicePausable_init_unchained_1391": { + "entryPoint": null, + "id": 1391, + "parameterSlots": 0, + "returnSlots": 0 + }, + "@__DataService_init_928": { + "entryPoint": 12102, + "id": 928, + "parameterSlots": 0, + "returnSlots": 0 + }, + "@__DataService_init_unchained_935": { + "entryPoint": null, + "id": 935, + "parameterSlots": 0, + "returnSlots": 0 + }, + "@__EIP712_init_5757": { + "entryPoint": 17375, + "id": 5757, + "parameterSlots": 2, + "returnSlots": 0 + }, + "@__EIP712_init_unchained_5797": { + "entryPoint": 19538, + "id": 5797, + "parameterSlots": 2, + "returnSlots": 0 + }, + "@__Multicall_init_5456": { + "entryPoint": 12094, + "id": 5456, + "parameterSlots": 0, + "returnSlots": 0 + }, + "@__Ownable_init_4983": { + "entryPoint": 12077, + "id": 4983, + "parameterSlots": 1, + "returnSlots": 0 + }, + "@__Ownable_init_unchained_5010": { + "entryPoint": 17301, + "id": 5010, + "parameterSlots": 1, + "returnSlots": 0 + }, + "@__Pausable_init_unchained_5610": { + "entryPoint": null, + "id": 5610, + "parameterSlots": 0, + "returnSlots": 0 + }, + "@__ProvisionManager_init_unchained_2024": { + "entryPoint": 17309, + "id": 2024, + "parameterSlots": 0, + "returnSlots": 0 + }, + "@_acceptProvisionParameters_2042": { + "entryPoint": 12291, + "id": 2042, + "parameterSlots": 1, + "returnSlots": 0 + }, + "@_allocate_16781": { + "entryPoint": 12517, + "id": 16781, + "parameterSlots": 6, + "returnSlots": 0 + }, + "@_buildDomainSeparator_5830": { + "entryPoint": 19655, + "id": 5830, + "parameterSlots": 0, + "returnSlots": 1 + }, + "@_buildStakeClaimId_1277": { + "entryPoint": null, + "id": 1277, + "parameterSlots": 2, + "returnSlots": 1 + }, + "@_checkInitializing_5299": { + "entryPoint": 17264, + "id": 5299, + "parameterSlots": 0, + "returnSlots": 0 + }, + "@_checkOwner_5051": { + "entryPoint": 6883, + "id": 5051, + "parameterSlots": 0, + "returnSlots": 0 + }, + "@_checkProvisionParameters_2226": { + "entryPoint": 17393, + "id": 2226, + "parameterSlots": 2, + "returnSlots": 0 + }, + "@_checkProvisionParameters_2282": { + "entryPoint": 7374, + "id": 2282, + "parameterSlots": 2, + "returnSlots": 0 + }, + "@_checkProvisionTokens_2203": { + "entryPoint": 7312, + "id": 2203, + "parameterSlots": 1, + "returnSlots": 0 + }, + "@_checkValueInRange_2394": { + "entryPoint": 13148, + "id": 2394, + "parameterSlots": 4, + "returnSlots": 0 + }, + "@_closeAllocation_17273": { + "entryPoint": 8823, + "id": 17273, + "parameterSlots": 2, + "returnSlots": 0 + }, + "@_collectIndexingRewards_14812": { + "entryPoint": 11805, + "id": 14812, + "parameterSlots": 3, + "returnSlots": 1 + }, + "@_collectQueryFees_14759": { + "entryPoint": 10505, + "id": 14759, + "parameterSlots": 3, + "returnSlots": 1 + }, + "@_contextSuffixLength_5436": { + "entryPoint": null, + "id": 5436, + "parameterSlots": 0, + "returnSlots": 1 + }, + "@_curation_17719": { + "entryPoint": 12000, + "id": 17719, + "parameterSlots": 0, + "returnSlots": 1 + }, + "@_deleteStakeClaim_1211": { + "entryPoint": 13509, + "id": 1211, + "parameterSlots": 1, + "returnSlots": 0 + }, + "@_disputeManager_17699": { + "entryPoint": 12255, + "id": 17699, + "parameterSlots": 0, + "returnSlots": 1 + }, + "@_domainSeparatorV4_5807": { + "entryPoint": 19603, + "id": 5807, + "parameterSlots": 0, + "returnSlots": 1 + }, + "@_encodeAllocationProof_17310": { + "entryPoint": 12406, + "id": 17310, + "parameterSlots": 2, + "returnSlots": 1 + }, + "@_encodeGraphTallyData_14878": { + "entryPoint": 14982, + "id": 14878, + "parameterSlots": 2, + "returnSlots": 1 + }, + "@_getDelegationRatio_2291": { + "entryPoint": null, + "id": 2291, + "parameterSlots": 0, + "returnSlots": 1 + }, + "@_getEIP712Storage_5741": { + "entryPoint": 10125, + "id": 5741, + "parameterSlots": 0, + "returnSlots": 1 + }, + "@_getInitializableStorage_5390": { + "entryPoint": 12036, + "id": 5390, + "parameterSlots": 0, + "returnSlots": 1 + }, + "@_getNextStakeClaim_1254": { + "entryPoint": 13237, + "id": 1254, + "parameterSlots": 1, + "returnSlots": 1 + }, + "@_getOwnableStorage_4954": { + "entryPoint": 10351, + "id": 4954, + "parameterSlots": 0, + "returnSlots": 1 + }, + "@_getPausableStorage_5566": { + "entryPoint": 8307, + "id": 5566, + "parameterSlots": 0, + "returnSlots": 1 + }, + "@_getProvisionTokensRange_2304": { + "entryPoint": null, + "id": 2304, + "parameterSlots": 0, + "returnSlots": 2 + }, + "@_getProvision_2367": { + "entryPoint": 7053, + "id": 2367, + "parameterSlots": 1, + "returnSlots": 1 + }, + "@_getStakeClaim_1240": { + "entryPoint": 18221, + "id": 1240, + "parameterSlots": 1, + "returnSlots": 1 + }, + "@_getThawingPeriodRange_14505": { + "entryPoint": 8435, + "id": 14505, + "parameterSlots": 0, + "returnSlots": 2 + }, + "@_getVerifierCutRange_14522": { + "entryPoint": 8157, + "id": 14522, + "parameterSlots": 0, + "returnSlots": 2 + }, + "@_get_16032": { + "entryPoint": 13907, + "id": 16032, + "parameterSlots": 2, + "returnSlots": 1 + }, + "@_graphEpochManager_4855": { + "entryPoint": 17786, + "id": 4855, + "parameterSlots": 0, + "returnSlots": 1 + }, + "@_graphRewardsManager_4865": { + "entryPoint": 14086, + "id": 4865, + "parameterSlots": 0, + "returnSlots": 1 + }, + "@_graphStaking_4815": { + "entryPoint": 7017, + "id": 4815, + "parameterSlots": 0, + "returnSlots": 1 + }, + "@_graphTallyCollector_17709": { + "entryPoint": 13020, + "id": 17709, + "parameterSlots": 0, + "returnSlots": 1 + }, + "@_graphToken_4805": { + "entryPoint": 14946, + "id": 4805, + "parameterSlots": 0, + "returnSlots": 1 + }, + "@_hashTypedDataV4_5846": { + "entryPoint": 17416, + "id": 5846, + "parameterSlots": 1, + "returnSlots": 1 + }, + "@_initializableStorageSlot_5376": { + "entryPoint": null, + "id": 5376, + "parameterSlots": 0, + "returnSlots": 1 + }, + "@_isInitializing_5367": { + "entryPoint": 19162, + "id": 5367, + "parameterSlots": 0, + "returnSlots": 1 + }, + "@_isOverAllocated_17330": { + "entryPoint": 11969, + "id": 17330, + "parameterSlots": 2, + "returnSlots": 1 + }, + "@_lockStake_1074": { + "entryPoint": 15066, + "id": 1074, + "parameterSlots": 3, + "returnSlots": 0 + }, + "@_migrateLegacyAllocation_16681": { + "entryPoint": 8607, + "id": 16681, + "parameterSlots": 3, + "returnSlots": 0 + }, + "@_msgSender_5419": { + "entryPoint": null, + "id": 5419, + "parameterSlots": 0, + "returnSlots": 1 + }, + "@_pause_5675": { + "entryPoint": 10054, + "id": 5675, + "parameterSlots": 0, + "returnSlots": 0 + }, + "@_presentPOI_17044": { + "entryPoint": 15609, + "id": 17044, + "parameterSlots": 5, + "returnSlots": 1 + }, + "@_processStakeClaim_1199": { + "entryPoint": 13258, + "id": 1199, + "parameterSlots": 2, + "returnSlots": 2 + }, + "@_releaseStake_1121": { + "entryPoint": 7991, + "id": 1121, + "parameterSlots": 2, + "returnSlots": 0 + }, + "@_requireNotPaused_5638": { + "entryPoint": 7608, + "id": 5638, + "parameterSlots": 0, + "returnSlots": 0 + }, + "@_requirePaused_5651": { + "entryPoint": 13200, + "id": 5651, + "parameterSlots": 0, + "returnSlots": 0 + }, + "@_resizeAllocation_17203": { + "entryPoint": 9177, + "id": 17203, + "parameterSlots": 3, + "returnSlots": 0 + }, + "@_revert_6406": { + "entryPoint": 18513, + "id": 6406, + "parameterSlots": 1, + "returnSlots": 0 + }, + "@_setDelegationRatio_2057": { + "entryPoint": 6933, + "id": 2057, + "parameterSlots": 1, + "returnSlots": 0 + }, + "@_setMaxPOIStaleness_17288": { + "entryPoint": 8554, + "id": 17288, + "parameterSlots": 1, + "returnSlots": 0 + }, + "@_setPauseGuardian_1424": { + "entryPoint": 7733, + "id": 1424, + "parameterSlots": 2, + "returnSlots": 0 + }, + "@_setPaymentsDestination_14832": { + "entryPoint": 7646, + "id": 14832, + "parameterSlots": 2, + "returnSlots": 0 + }, + "@_setProvisionTokensRange_2089": { + "entryPoint": 9943, + "id": 2089, + "parameterSlots": 2, + "returnSlots": 0 + }, + "@_setStakeToFeesRatio_14855": { + "entryPoint": 12168, + "id": 14855, + "parameterSlots": 1, + "returnSlots": 0 + }, + "@_setThawingPeriodRange_2164": { + "entryPoint": 19397, + "id": 2164, + "parameterSlots": 2, + "returnSlots": 0 + }, + "@_setVerifierCutRange_2132": { + "entryPoint": 19188, + "id": 2132, + "parameterSlots": 2, + "returnSlots": 0 + }, + "@_throwError_8230": { + "entryPoint": 19848, + "id": 8230, + "parameterSlots": 2, + "returnSlots": 0 + }, + "@_transferOwnership_5122": { + "entryPoint": 8343, + "id": 5122, + "parameterSlots": 1, + "returnSlots": 0 + }, + "@_unpause_5699": { + "entryPoint": 7915, + "id": 5699, + "parameterSlots": 0, + "returnSlots": 0 + }, + "@_verifyAllocationProof_17362": { + "entryPoint": 17461, + "id": 17362, + "parameterSlots": 3, + "returnSlots": 0 + }, + "@acceptProvisionPendingParameters_13875": { + "entryPoint": 6007, + "id": 13875, + "parameterSlots": 3, + "returnSlots": 0 + }, + "@addTail_4172": { + "entryPoint": 18554, + "id": 4172, + "parameterSlots": 2, + "returnSlots": 0 + }, + "@allocationProvisionTracker_17387": { + "entryPoint": null, + "id": 17387, + "parameterSlots": 0, + "returnSlots": 0 + }, + "@check_1800": { + "entryPoint": 17110, + "id": 1800, + "parameterSlots": 4, + "returnSlots": 1 + }, + "@claimsLists_1302": { + "entryPoint": null, + "id": 1302, + "parameterSlots": 0, + "returnSlots": 0 + }, + "@claims_1296": { + "entryPoint": null, + "id": 1296, + "parameterSlots": 0, + "returnSlots": 0 + }, + "@clearPendingRewards_15855": { + "entryPoint": 18883, + "id": 15855, + "parameterSlots": 2, + "returnSlots": 0 + }, + "@closeStaleAllocation_14144": { + "entryPoint": 6694, + "id": 14144, + "parameterSlots": 1, + "returnSlots": 0 + }, + "@close_15893": { + "entryPoint": 14301, + "id": 15893, + "parameterSlots": 2, + "returnSlots": 0 + }, + "@collect_14055": { + "entryPoint": 4798, + "id": 14055, + "parameterSlots": 4, + "returnSlots": 1 + }, + "@create_15741": { + "entryPoint": 17822, + "id": 15741, + "parameterSlots": 7, + "returnSlots": 1 + }, + "@curationFeesCut_14896": { + "entryPoint": null, + "id": 14896, + "parameterSlots": 0, + "returnSlots": 0 + }, + "@eip712Domain_5907": { + "entryPoint": 4370, + "id": 5907, + "parameterSlots": 0, + "returnSlots": 7 + }, + "@encodeAllocationProof_14469": { + "entryPoint": 6240, + "id": 14469, + "parameterSlots": 2, + "returnSlots": 1 + }, + "@exists_15961": { + "entryPoint": null, + "id": 15961, + "parameterSlots": 1, + "returnSlots": 1 + }, + "@exists_16428": { + "entryPoint": 18498, + "id": 16428, + "parameterSlots": 1, + "returnSlots": 1 + }, + "@feesProvisionTracker_1290": { + "entryPoint": null, + "id": 1290, + "parameterSlots": 0, + "returnSlots": 0 + }, + "@functionDelegateCall_6324": { + "entryPoint": 10387, + "id": 6324, + "parameterSlots": 2, + "returnSlots": 1 + }, + "@getAllocationData_14381": { + "entryPoint": 3104, + "id": 14381, + "parameterSlots": 1, + "returnSlots": 6 + }, + "@getAllocation_14337": { + "entryPoint": 1962, + "id": 14337, + "parameterSlots": 1, + "returnSlots": 1 + }, + "@getCuration_14452": { + "entryPoint": 5296, + "id": 14452, + "parameterSlots": 0, + "returnSlots": 1 + }, + "@getDelegationRatio_915": { + "entryPoint": null, + "id": 915, + "parameterSlots": 0, + "returnSlots": 1 + }, + "@getDisputeManager_14424": { + "entryPoint": 6259, + "id": 14424, + "parameterSlots": 0, + "returnSlots": 1 + }, + "@getGraphTallyCollector_14438": { + "entryPoint": 6684, + "id": 14438, + "parameterSlots": 0, + "returnSlots": 1 + }, + "@getLegacyAllocation_14410": { + "entryPoint": null, + "id": 14410, + "parameterSlots": 1, + "returnSlots": 1 + }, + "@getProvisionTokensRange_905": { + "entryPoint": 3908, + "id": 905, + "parameterSlots": 0, + "returnSlots": 2 + }, + "@getSubgraphAllocatedTokens_14395": { + "entryPoint": null, + "id": 14395, + "parameterSlots": 1, + "returnSlots": 1 + }, + "@getThawingPeriodRange_881": { + "entryPoint": 3341, + "id": 881, + "parameterSlots": 0, + "returnSlots": 2 + }, + "@getVerifierCutRange_893": { + "entryPoint": 2777, + "id": 893, + "parameterSlots": 0, + "returnSlots": 2 + }, + "@get_15913": { + "entryPoint": 8690, + "id": 15913, + "parameterSlots": 2, + "returnSlots": 1 + }, + "@indexers_14890": { + "entryPoint": 2796, + "id": 14890, + "parameterSlots": 0, + "returnSlots": 0 + }, + "@initialize_13752": { + "entryPoint": 5306, + "id": 13752, + "parameterSlots": 4, + "returnSlots": 0 + }, + "@isAltruistic_15999": { + "entryPoint": 13117, + "id": 15999, + "parameterSlots": 1, + "returnSlots": 1 + }, + "@isInRange_4563": { + "entryPoint": 18198, + "id": 4563, + "parameterSlots": 3, + "returnSlots": 1 + }, + "@isOpen_15980": { + "entryPoint": 8276, + "id": 15980, + "parameterSlots": 1, + "returnSlots": 1 + }, + "@isOverAllocated_14484": { + "entryPoint": 5266, + "id": 14484, + "parameterSlots": 1, + "returnSlots": 1 + }, + "@isStale_15946": { + "entryPoint": 13056, + "id": 15946, + "parameterSlots": 2, + "returnSlots": 1 + }, + "@isValidPPM_4538": { + "entryPoint": null, + "id": 4538, + "parameterSlots": 1, + "returnSlots": 1 + }, + "@lock_1726": { + "entryPoint": 14609, + "id": 1726, + "parameterSlots": 5, + "returnSlots": 0 + }, + "@maxPOIStaleness_17390": { + "entryPoint": null, + "id": 17390, + "parameterSlots": 0, + "returnSlots": 0 + }, + "@max_8625": { + "entryPoint": 18182, + "id": 8625, + "parameterSlots": 2, + "returnSlots": 1 + }, + "@migrateLegacyAllocation_14206": { + "entryPoint": 3369, + "id": 14206, + "parameterSlots": 3, + "returnSlots": 0 + }, + "@migrate_16352": { + "entryPoint": 13732, + "id": 16352, + "parameterSlots": 4, + "returnSlots": 0 + }, + "@mulPPM_4496": { + "entryPoint": 19066, + "id": 4496, + "parameterSlots": 2, + "returnSlots": 1 + }, + "@multicall_5539": { + "entryPoint": 4566, + "id": 5539, + "parameterSlots": 2, + "returnSlots": 1 + }, + "@owner_5034": { + "entryPoint": 4539, + "id": 5034, + "parameterSlots": 0, + "returnSlots": 1 + }, + "@pauseGuardians_1328": { + "entryPoint": null, + "id": 1328, + "parameterSlots": 0, + "returnSlots": 0 + }, + "@pause_1360": { + "entryPoint": 4312, + "id": 1360, + "parameterSlots": 0, + "returnSlots": 0 + }, + "@paused_5626": { + "entryPoint": 3292, + "id": 5626, + "parameterSlots": 0, + "returnSlots": 1 + }, + "@paymentsDestination_14901": { + "entryPoint": null, + "id": 14901, + "parameterSlots": 0, + "returnSlots": 0 + }, + "@presentPOI_15779": { + "entryPoint": 18701, + "id": 15779, + "parameterSlots": 2, + "returnSlots": 0 + }, + "@pushTokens_818": { + "entryPoint": 15434, + "id": 818, + "parameterSlots": 3, + "returnSlots": 0 + }, + "@recover_7987": { + "entryPoint": 19613, + "id": 7987, + "parameterSlots": 2, + "returnSlots": 1 + }, + "@register_13852": { + "entryPoint": 2128, + "id": 13852, + "parameterSlots": 3, + "returnSlots": 0 + }, + "@releaseStake_987": { + "entryPoint": 2767, + "id": 987, + "parameterSlots": 1, + "returnSlots": 0 + }, + "@release_1764": { + "entryPoint": 14483, + "id": 1764, + "parameterSlots": 3, + "returnSlots": 0 + }, + "@removeHead_4246": { + "entryPoint": 18363, + "id": 4246, + "parameterSlots": 3, + "returnSlots": 1 + }, + "@renounceOwnership_5065": { + "entryPoint": 3323, + "id": 5065, + "parameterSlots": 0, + "returnSlots": 0 + }, + "@resizeAllocation_14186": { + "entryPoint": 3924, + "id": 14186, + "parameterSlots": 3, + "returnSlots": 0 + }, + "@revertIfExists_16410": { + "entryPoint": 17540, + "id": 16410, + "parameterSlots": 3, + "returnSlots": 0 + }, + "@setCurationCut_14322": { + "entryPoint": 3393, + "id": 14322, + "parameterSlots": 1, + "returnSlots": 0 + }, + "@setDelegationRatio_14266": { + "entryPoint": 2103, + "id": 14266, + "parameterSlots": 1, + "returnSlots": 0 + }, + "@setMaxPOIStaleness_14294": { + "entryPoint": 3352, + "id": 14294, + "parameterSlots": 1, + "returnSlots": 0 + }, + "@setMinimumProvisionTokens_14252": { + "entryPoint": 4292, + "id": 14252, + "parameterSlots": 1, + "returnSlots": 0 + }, + "@setPauseGuardian_14223": { + "entryPoint": 2685, + "id": 14223, + "parameterSlots": 2, + "returnSlots": 0 + }, + "@setPaymentsDestination_14237": { + "entryPoint": 3313, + "id": 14237, + "parameterSlots": 1, + "returnSlots": 0 + }, + "@setStakeToFeesRatio_14280": { + "entryPoint": 6667, + "id": 14280, + "parameterSlots": 1, + "returnSlots": 0 + }, + "@slash_14099": { + "entryPoint": 5688, + "id": 14099, + "parameterSlots": 3, + "returnSlots": 0 + }, + "@snapshotRewards_15818": { + "entryPoint": 14122, + "id": 15818, + "parameterSlots": 3, + "returnSlots": 0 + }, + "@stakeToFeesRatio_14893": { + "entryPoint": null, + "id": 14893, + "parameterSlots": 0, + "returnSlots": 0 + }, + "@startService_13932": { + "entryPoint": 6269, + "id": 13932, + "parameterSlots": 3, + "returnSlots": 0 + }, + "@stopService_13984": { + "entryPoint": 3510, + "id": 13984, + "parameterSlots": 3, + "returnSlots": 0 + }, + "@ternary_8606": { + "entryPoint": null, + "id": 8606, + "parameterSlots": 3, + "returnSlots": 1 + }, + "@toTypedDataHash_8316": { + "entryPoint": null, + "id": 8316, + "parameterSlots": 2, + "returnSlots": 1 + }, + "@toUint_11702": { + "entryPoint": null, + "id": 11702, + "parameterSlots": 1, + "returnSlots": 1 + }, + "@transferOwnership_5093": { + "entryPoint": 6824, + "id": 5093, + "parameterSlots": 1, + "returnSlots": 0 + }, + "@traverse_4363": { + "entryPoint": 13546, + "id": 4363, + "parameterSlots": 6, + "returnSlots": 2 + }, + "@tryRecover_7957": { + "entryPoint": 19771, + "id": 7957, + "parameterSlots": 2, + "returnSlots": 3 + }, + "@tryRecover_8145": { + "entryPoint": 20201, + "id": 8145, + "parameterSlots": 4, + "returnSlots": 3 + }, + "@unpause_1371": { + "entryPoint": 2707, + "id": 1371, + "parameterSlots": 0, + "returnSlots": 0 + }, + "@verifyCallResultFromTarget_6364": { + "entryPoint": 14863, + "id": 6364, + "parameterSlots": 3, + "returnSlots": 1 + }, + "abi_decode_address": { + "entryPoint": 20507, + "id": null, + "parameterSlots": 1, + "returnSlots": 1 + }, + "abi_decode_bytes_calldata": { + "entryPoint": 20619, + "id": null, + "parameterSlots": 2, + "returnSlots": 2 + }, + "abi_decode_string": { + "entryPoint": 21938, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "abi_decode_tuple_t_address": { + "entryPoint": 20523, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "abi_decode_tuple_t_address_payable": { + "entryPoint": null, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "abi_decode_tuple_t_address_payablet_bytes32t_bytes_memory_ptr": { + "entryPoint": 23736, + "id": null, + "parameterSlots": 2, + "returnSlots": 3 + }, + "abi_decode_tuple_t_addresst_address": { + "entryPoint": 21671, + "id": null, + "parameterSlots": 2, + "returnSlots": 2 + }, + "abi_decode_tuple_t_addresst_addresst_bytes32": { + "entryPoint": 21046, + "id": null, + "parameterSlots": 2, + "returnSlots": 3 + }, + "abi_decode_tuple_t_addresst_addresst_uint256": { + "entryPoint": null, + "id": null, + "parameterSlots": 2, + "returnSlots": 3 + }, + "abi_decode_tuple_t_addresst_bool": { + "entryPoint": 20782, + "id": null, + "parameterSlots": 2, + "returnSlots": 2 + }, + "abi_decode_tuple_t_addresst_bytes_calldata_ptr": { + "entryPoint": 20684, + "id": null, + "parameterSlots": 2, + "returnSlots": 3 + }, + "abi_decode_tuple_t_addresst_enum$_PaymentTypes_$2433t_bytes_calldata_ptr": { + "entryPoint": 21495, + "id": null, + "parameterSlots": 2, + "returnSlots": 4 + }, + "abi_decode_tuple_t_addresst_uint256t_uint32t_uint256": { + "entryPoint": 21599, + "id": null, + "parameterSlots": 2, + "returnSlots": 4 + }, + "abi_decode_tuple_t_array$_t_bytes_calldata_ptr_$dyn_calldata_ptr": { + "entryPoint": 21277, + "id": null, + "parameterSlots": 2, + "returnSlots": 2 + }, + "abi_decode_tuple_t_bool_fromMemory": { + "entryPoint": 21752, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "abi_decode_tuple_t_bytes32": { + "entryPoint": null, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "abi_decode_tuple_t_bytes32t_uint256t_address_payablet_bytes_memory_ptr": { + "entryPoint": 22851, + "id": null, + "parameterSlots": 2, + "returnSlots": 4 + }, + "abi_decode_tuple_t_string_memory_ptrt_string_memory_ptrt_address_payable": { + "entryPoint": 22086, + "id": null, + "parameterSlots": 2, + "returnSlots": 3 + }, + "abi_decode_tuple_t_struct$_DelegationPool_$3992_memory_ptr_fromMemory": { + "entryPoint": 24236, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "abi_decode_tuple_t_struct$_Provision_$3962_memory_ptr_fromMemory": { + "entryPoint": 22992, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "abi_decode_tuple_t_struct$_SignedRAV_$2525_memory_ptrt_uint256": { + "entryPoint": 23354, + "id": null, + "parameterSlots": 2, + "returnSlots": 2 + }, + "abi_decode_tuple_t_uint256": { + "entryPoint": 20839, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "abi_decode_tuple_t_uint256_fromMemory": { + "entryPoint": 23165, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "abi_decode_tuple_t_uint256t_address_payable_fromMemory": { + "entryPoint": 23871, + "id": null, + "parameterSlots": 2, + "returnSlots": 2 + }, + "abi_decode_tuple_t_uint256t_uint256": { + "entryPoint": 22817, + "id": null, + "parameterSlots": 2, + "returnSlots": 2 + }, + "abi_decode_tuple_t_uint32": { + "entryPoint": 20590, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "abi_decode_tuple_t_uint32_fromMemory": { + "entryPoint": 23190, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "abi_decode_tuple_t_uint64_fromMemory": { + "entryPoint": 23219, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "abi_decode_uint128": { + "entryPoint": 23331, + "id": null, + "parameterSlots": 1, + "returnSlots": 1 + }, + "abi_decode_uint32_fromMemory": { + "entryPoint": 22949, + "id": null, + "parameterSlots": 1, + "returnSlots": 1 + }, + "abi_decode_uint64": { + "entryPoint": 23320, + "id": null, + "parameterSlots": 1, + "returnSlots": 1 + }, + "abi_decode_uint64_fromMemory": { + "entryPoint": 22981, + "id": null, + "parameterSlots": 1, + "returnSlots": 1 + }, + "abi_encode_address": { + "entryPoint": null, + "id": null, + "parameterSlots": 2, + "returnSlots": 0 + }, + "abi_encode_enum_PaymentTypes": { + "entryPoint": 22769, + "id": null, + "parameterSlots": 2, + "returnSlots": 0 + }, + "abi_encode_string": { + "entryPoint": 20923, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "abi_encode_tuple_packed_t_address_t_address_t_uint256__to_t_address_t_address_t_uint256__nonPadded_inplace_fromStack_reversed": { + "entryPoint": null, + "id": null, + "parameterSlots": 4, + "returnSlots": 1 + }, + "abi_encode_tuple_packed_t_bytes_calldata_ptr_t_bytes_memory_ptr__to_t_bytes_memory_ptr_t_bytes_memory_ptr__nonPadded_inplace_fromStack_reversed": { + "entryPoint": 22708, + "id": null, + "parameterSlots": 4, + "returnSlots": 1 + }, + "abi_encode_tuple_packed_t_bytes_memory_ptr__to_t_bytes_memory_ptr__nonPadded_inplace_fromStack_reversed": { + "entryPoint": 23292, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "abi_encode_tuple_t_address__to_t_address__fromStack_reversed": { + "entryPoint": 20552, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "abi_encode_tuple_t_address_t_address__to_t_address_t_address__fromStack_reversed": { + "entryPoint": 21781, + "id": null, + "parameterSlots": 3, + "returnSlots": 1 + }, + "abi_encode_tuple_t_address_t_address_t_address__to_t_address_t_address_t_address__fromStack_reversed": { + "entryPoint": 21717, + "id": null, + "parameterSlots": 4, + "returnSlots": 1 + }, + "abi_encode_tuple_t_address_t_address_t_enum$_PaymentTypes_$2433__to_t_address_t_address_t_uint8__fromStack_reversed": { + "entryPoint": 24199, + "id": null, + "parameterSlots": 4, + "returnSlots": 1 + }, + "abi_encode_tuple_t_address_t_address_t_uint256__to_t_address_t_address_t_uint256__fromStack_reversed": { + "entryPoint": 24351, + "id": null, + "parameterSlots": 4, + "returnSlots": 1 + }, + "abi_encode_tuple_t_address_t_address_t_uint32__to_t_address_t_address_t_uint32__fromStack_reversed": { + "entryPoint": 23957, + "id": null, + "parameterSlots": 4, + "returnSlots": 1 + }, + "abi_encode_tuple_t_address_t_bool__to_t_address_t_bool__fromStack_reversed": { + "entryPoint": null, + "id": null, + "parameterSlots": 3, + "returnSlots": 1 + }, + "abi_encode_tuple_t_address_t_uint256__to_t_address_t_uint256__fromStack_reversed": { + "entryPoint": 23248, + "id": null, + "parameterSlots": 3, + "returnSlots": 1 + }, + "abi_encode_tuple_t_address_t_uint256_t_uint256_t_address__to_t_address_t_uint256_t_uint256_t_address__fromStack_reversed": { + "entryPoint": null, + "id": null, + "parameterSlots": 5, + "returnSlots": 1 + }, + "abi_encode_tuple_t_array$_t_bytes_memory_ptr_$dyn_memory_ptr__to_t_array$_t_bytes_memory_ptr_$dyn_memory_ptr__fromStack_reversed": { + "entryPoint": 21394, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "abi_encode_tuple_t_bool__to_t_bool__fromStack_reversed": { + "entryPoint": null, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "abi_encode_tuple_t_bool_t_address_t_bytes32_t_uint256_t_uint256_t_uint256__to_t_bool_t_address_t_bytes32_t_uint256_t_uint256_t_uint256__fromStack_reversed": { + "entryPoint": null, + "id": null, + "parameterSlots": 7, + "returnSlots": 1 + }, + "abi_encode_tuple_t_bytes1_t_string_memory_ptr_t_string_memory_ptr_t_uint256_t_address_t_bytes32_t_array$_t_uint256_$dyn_memory_ptr__to_t_bytes1_t_string_memory_ptr_t_string_memory_ptr_t_uint256_t_address_t_bytes32_t_array$_t_uint256_$dyn_memory_ptr__fromStack_reversed": { + "entryPoint": 21125, + "id": null, + "parameterSlots": 8, + "returnSlots": 1 + }, + "abi_encode_tuple_t_bytes32__to_t_bytes32__fromStack_reversed": { + "entryPoint": null, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "abi_encode_tuple_t_bytes32_t_address_t_address__to_t_bytes32_t_address_t_address__fromStack_reversed": { + "entryPoint": null, + "id": null, + "parameterSlots": 4, + "returnSlots": 1 + }, + "abi_encode_tuple_t_bytes32_t_bytes32_t_bytes32_t_uint256_t_address__to_t_bytes32_t_bytes32_t_bytes32_t_uint256_t_address__fromStack_reversed": { + "entryPoint": null, + "id": null, + "parameterSlots": 6, + "returnSlots": 1 + }, + "abi_encode_tuple_t_bytes32_t_bytes32_t_uint256_t_uint256__to_t_bytes32_t_bytes32_t_uint256_t_uint256__fromStack_reversed": { + "entryPoint": null, + "id": null, + "parameterSlots": 5, + "returnSlots": 1 + }, + "abi_encode_tuple_t_bytes32_t_uint256__to_t_bytes32_t_uint256__fromStack_reversed": { + "entryPoint": null, + "id": null, + "parameterSlots": 3, + "returnSlots": 1 + }, + "abi_encode_tuple_t_bytes32_t_uint256_t_uint256__to_t_bytes32_t_uint256_t_uint256__fromStack_reversed": { + "entryPoint": null, + "id": null, + "parameterSlots": 4, + "returnSlots": 1 + }, + "abi_encode_tuple_t_bytes32_t_uint8_t_bytes32_t_bytes32__to_t_bytes32_t_uint8_t_bytes32_t_bytes32__fromStack_reversed": { + "entryPoint": null, + "id": null, + "parameterSlots": 5, + "returnSlots": 1 + }, + "abi_encode_tuple_t_bytes_calldata_ptr__to_t_bytes_memory_ptr__fromStack_reversed": { + "entryPoint": 22528, + "id": null, + "parameterSlots": 3, + "returnSlots": 1 + }, + "abi_encode_tuple_t_bytes_memory_ptr_t_uint256_t_uint256_t_uint256__to_t_bytes_memory_ptr_t_uint256_t_uint256_t_uint256__fromStack_reversed": { + "entryPoint": 23824, + "id": null, + "parameterSlots": 5, + "returnSlots": 1 + }, + "abi_encode_tuple_t_enum$_PaymentTypes_$2433__to_t_uint8__fromStack_reversed": { + "entryPoint": 22803, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "abi_encode_tuple_t_enum$_PaymentTypes_$2433_t_bytes_memory_ptr_t_uint256__to_t_uint8_t_bytes_memory_ptr_t_uint256__fromStack_reversed": { + "entryPoint": 23665, + "id": null, + "parameterSlots": 4, + "returnSlots": 1 + }, + "abi_encode_tuple_t_rational_0_by_1_t_address__to_t_uint8_t_address__fromStack_reversed": { + "entryPoint": null, + "id": null, + "parameterSlots": 3, + "returnSlots": 1 + }, + "abi_encode_tuple_t_rational_1_by_1__to_t_uint64__fromStack_reversed": { + "entryPoint": null, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "abi_encode_tuple_t_stringliteral_2e5045ff73280aa8e8acd8c82710f23812497f87f7f576e2220a2ddd0d45eade__to_t_string_memory_ptr__fromStack_reversed": { + "entryPoint": null, + "id": null, + "parameterSlots": 1, + "returnSlots": 1 + }, + "abi_encode_tuple_t_stringliteral_aaf3daf27360df170a52f29a0edeebb3d20b8e3dc84a13c5eaf056803b549f50__to_t_string_memory_ptr__fromStack_reversed": { + "entryPoint": null, + "id": null, + "parameterSlots": 1, + "returnSlots": 1 + }, + "abi_encode_tuple_t_struct$_SignedRAV_$2525_memory_ptr_t_uint256_t_address__to_t_struct$_SignedRAV_$2525_memory_ptr_t_uint256_t_address__fromStack_reversed": { + "entryPoint": 23998, + "id": null, + "parameterSlots": 4, + "returnSlots": 1 + }, + "abi_encode_tuple_t_struct$_State_$15663_memory_ptr__to_t_struct$_State_$15663_memory_ptr__fromStack_reversed": { + "entryPoint": null, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "abi_encode_tuple_t_struct$_State_$16305_memory_ptr__to_t_struct$_State_$16305_memory_ptr__fromStack_reversed": { + "entryPoint": null, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed": { + "entryPoint": null, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "abi_encode_tuple_t_uint256_t_address__to_t_uint256_t_address__fromStack_reversed": { + "entryPoint": null, + "id": null, + "parameterSlots": 3, + "returnSlots": 1 + }, + "abi_encode_tuple_t_uint256_t_bool__to_t_uint256_t_bool__fromStack_reversed": { + "entryPoint": null, + "id": null, + "parameterSlots": 3, + "returnSlots": 1 + }, + "abi_encode_tuple_t_uint256_t_string_memory_ptr_t_string_memory_ptr__to_t_uint256_t_string_memory_ptr_t_string_memory_ptr__fromStack_reversed": { + "entryPoint": 20967, + "id": null, + "parameterSlots": 4, + "returnSlots": 1 + }, + "abi_encode_tuple_t_uint256_t_uint256__to_t_uint256_t_uint256__fromStack_reversed": { + "entryPoint": 21111, + "id": null, + "parameterSlots": 3, + "returnSlots": 1 + }, + "abi_encode_tuple_t_uint256_t_uint256_t_uint256_t_bytes32__to_t_uint256_t_uint256_t_uint256_t_bytes32__fromStack_reversed": { + "entryPoint": null, + "id": null, + "parameterSlots": 5, + "returnSlots": 1 + }, + "abi_encode_tuple_t_uint256_t_uint256_t_uint256_t_bytes32_t_bytes_memory_ptr_t_uint256__to_t_uint256_t_uint256_t_uint256_t_bytes32_t_bytes_memory_ptr_t_uint256__fromStack_reversed": { + "entryPoint": 24387, + "id": null, + "parameterSlots": 7, + "returnSlots": 1 + }, + "abi_encode_tuple_t_uint32__to_t_uint32__fromStack_reversed": { + "entryPoint": null, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "abi_encode_tuple_t_uint32_t_uint32__to_t_uint256_t_uint256__fromStack_reversed": { + "entryPoint": null, + "id": null, + "parameterSlots": 3, + "returnSlots": 1 + }, + "abi_encode_tuple_t_uint32_t_uint32__to_t_uint32_t_uint32__fromStack_reversed": { + "entryPoint": 20864, + "id": null, + "parameterSlots": 3, + "returnSlots": 1 + }, + "abi_encode_tuple_t_uint64_t_uint64__to_t_uint256_t_uint256__fromStack_reversed": { + "entryPoint": null, + "id": null, + "parameterSlots": 3, + "returnSlots": 1 + }, + "abi_encode_tuple_t_uint64_t_uint64__to_t_uint64_t_uint64__fromStack_reversed": { + "entryPoint": 21020, + "id": null, + "parameterSlots": 3, + "returnSlots": 1 + }, + "abi_encode_uint128": { + "entryPoint": null, + "id": null, + "parameterSlots": 2, + "returnSlots": 0 + }, + "abi_encode_uint64": { + "entryPoint": null, + "id": null, + "parameterSlots": 2, + "returnSlots": 0 + }, + "access_calldata_tail_t_bytes_calldata_ptr": { + "entryPoint": 22638, + "id": null, + "parameterSlots": 2, + "returnSlots": 2 + }, + "allocate_memory": { + "entryPoint": 21904, + "id": null, + "parameterSlots": 0, + "returnSlots": 1 + }, + "allocate_memory_4297": { + "entryPoint": 21829, + "id": null, + "parameterSlots": 0, + "returnSlots": 1 + }, + "allocate_memory_4301": { + "entryPoint": 21870, + "id": null, + "parameterSlots": 0, + "returnSlots": 1 + }, + "array_dataslot_string_storage": { + "entryPoint": null, + "id": null, + "parameterSlots": 1, + "returnSlots": 1 + }, + "calldata_array_index_range_access_t_bytes_calldata_ptr": { + "entryPoint": null, + "id": null, + "parameterSlots": 4, + "returnSlots": 2 + }, + "checked_add_t_uint256": { + "entryPoint": 23273, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "checked_div_t_uint256": { + "entryPoint": 24449, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "checked_mul_t_uint256": { + "entryPoint": 23713, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "checked_sub_t_uint256": { + "entryPoint": 22597, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "clean_up_bytearray_end_slots_string_storage": { + "entryPoint": 22267, + "id": null, + "parameterSlots": 3, + "returnSlots": 0 + }, + "copy_byte_array_to_storage_from_t_string_memory_ptr_to_t_string_storage": { + "entryPoint": 22338, + "id": null, + "parameterSlots": 2, + "returnSlots": 0 + }, + "copy_memory_to_memory_with_cleanup": { + "entryPoint": 20887, + "id": null, + "parameterSlots": 3, + "returnSlots": 0 + }, + "decrement_t_uint256": { + "entryPoint": 23909, + "id": null, + "parameterSlots": 1, + "returnSlots": 1 + }, + "extract_byte_array_length": { + "entryPoint": 22209, + "id": null, + "parameterSlots": 1, + "returnSlots": 1 + }, + "extract_used_part_and_set_length_of_short_byte_array": { + "entryPoint": null, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "increment_t_uint256": { + "entryPoint": 23932, + "id": null, + "parameterSlots": 1, + "returnSlots": 1 + }, + "panic_error_0x11": { + "entryPoint": 22575, + "id": null, + "parameterSlots": 0, + "returnSlots": 0 + }, + "panic_error_0x21": { + "entryPoint": 22747, + "id": null, + "parameterSlots": 0, + "returnSlots": 0 + }, + "panic_error_0x32": { + "entryPoint": 22616, + "id": null, + "parameterSlots": 0, + "returnSlots": 0 + }, + "panic_error_0x41": { + "entryPoint": 21807, + "id": null, + "parameterSlots": 0, + "returnSlots": 0 + }, + "validator_revert_address": { + "entryPoint": 20486, + "id": null, + "parameterSlots": 1, + "returnSlots": 0 + }, + "validator_revert_bool": { + "entryPoint": 20768, + "id": null, + "parameterSlots": 1, + "returnSlots": 0 + }, + "validator_revert_uint32": { + "entryPoint": 20572, + "id": null, + "parameterSlots": 1, + "returnSlots": 0 + }, + "validator_revert_uint64": { + "entryPoint": 22960, + "id": null, + "parameterSlots": 1, + "returnSlots": 0 + } + }, + "generatedSources": [ + { + "ast": { + "nativeSrc": "0:40736:70", + "nodeType": "YulBlock", + "src": "0:40736:70", + "statements": [ + { + "nativeSrc": "6:3:70", + "nodeType": "YulBlock", + "src": "6:3:70", + "statements": [] + }, + { + "body": { + "nativeSrc": "59:86:70", + "nodeType": "YulBlock", + "src": "59:86:70", + "statements": [ + { + "body": { + "nativeSrc": "123:16:70", + "nodeType": "YulBlock", + "src": "123:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "132:1:70", + "nodeType": "YulLiteral", + "src": "132:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "135:1:70", + "nodeType": "YulLiteral", + "src": "135:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "125:6:70", + "nodeType": "YulIdentifier", + "src": "125:6:70" + }, + "nativeSrc": "125:12:70", + "nodeType": "YulFunctionCall", + "src": "125:12:70" + }, + "nativeSrc": "125:12:70", + "nodeType": "YulExpressionStatement", + "src": "125:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "value", + "nativeSrc": "82:5:70", + "nodeType": "YulIdentifier", + "src": "82:5:70" + }, + { + "arguments": [ + { + "name": "value", + "nativeSrc": "93:5:70", + "nodeType": "YulIdentifier", + "src": "93:5:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "108:3:70", + "nodeType": "YulLiteral", + "src": "108:3:70", + "type": "", + "value": "160" + }, + { + "kind": "number", + "nativeSrc": "113:1:70", + "nodeType": "YulLiteral", + "src": "113:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "104:3:70", + "nodeType": "YulIdentifier", + "src": "104:3:70" + }, + "nativeSrc": "104:11:70", + "nodeType": "YulFunctionCall", + "src": "104:11:70" + }, + { + "kind": "number", + "nativeSrc": "117:1:70", + "nodeType": "YulLiteral", + "src": "117:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "100:3:70", + "nodeType": "YulIdentifier", + "src": "100:3:70" + }, + "nativeSrc": "100:19:70", + "nodeType": "YulFunctionCall", + "src": "100:19:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "89:3:70", + "nodeType": "YulIdentifier", + "src": "89:3:70" + }, + "nativeSrc": "89:31:70", + "nodeType": "YulFunctionCall", + "src": "89:31:70" + } + ], + "functionName": { + "name": "eq", + "nativeSrc": "79:2:70", + "nodeType": "YulIdentifier", + "src": "79:2:70" + }, + "nativeSrc": "79:42:70", + "nodeType": "YulFunctionCall", + "src": "79:42:70" + } + ], + "functionName": { + "name": "iszero", + "nativeSrc": "72:6:70", + "nodeType": "YulIdentifier", + "src": "72:6:70" + }, + "nativeSrc": "72:50:70", + "nodeType": "YulFunctionCall", + "src": "72:50:70" + }, + "nativeSrc": "69:70:70", + "nodeType": "YulIf", + "src": "69:70:70" + } + ] + }, + "name": "validator_revert_address", + "nativeSrc": "14:131:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "value", + "nativeSrc": "48:5:70", + "nodeType": "YulTypedName", + "src": "48:5:70", + "type": "" + } + ], + "src": "14:131:70" + }, + { + "body": { + "nativeSrc": "199:85:70", + "nodeType": "YulBlock", + "src": "199:85:70", + "statements": [ + { + "nativeSrc": "209:29:70", + "nodeType": "YulAssignment", + "src": "209:29:70", + "value": { + "arguments": [ + { + "name": "offset", + "nativeSrc": "231:6:70", + "nodeType": "YulIdentifier", + "src": "231:6:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "218:12:70", + "nodeType": "YulIdentifier", + "src": "218:12:70" + }, + "nativeSrc": "218:20:70", + "nodeType": "YulFunctionCall", + "src": "218:20:70" + }, + "variableNames": [ + { + "name": "value", + "nativeSrc": "209:5:70", + "nodeType": "YulIdentifier", + "src": "209:5:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "value", + "nativeSrc": "272:5:70", + "nodeType": "YulIdentifier", + "src": "272:5:70" + } + ], + "functionName": { + "name": "validator_revert_address", + "nativeSrc": "247:24:70", + "nodeType": "YulIdentifier", + "src": "247:24:70" + }, + "nativeSrc": "247:31:70", + "nodeType": "YulFunctionCall", + "src": "247:31:70" + }, + "nativeSrc": "247:31:70", + "nodeType": "YulExpressionStatement", + "src": "247:31:70" + } + ] + }, + "name": "abi_decode_address", + "nativeSrc": "150:134:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "offset", + "nativeSrc": "178:6:70", + "nodeType": "YulTypedName", + "src": "178:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value", + "nativeSrc": "189:5:70", + "nodeType": "YulTypedName", + "src": "189:5:70", + "type": "" + } + ], + "src": "150:134:70" + }, + { + "body": { + "nativeSrc": "359:177:70", + "nodeType": "YulBlock", + "src": "359:177:70", + "statements": [ + { + "body": { + "nativeSrc": "405:16:70", + "nodeType": "YulBlock", + "src": "405:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "414:1:70", + "nodeType": "YulLiteral", + "src": "414:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "417:1:70", + "nodeType": "YulLiteral", + "src": "417:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "407:6:70", + "nodeType": "YulIdentifier", + "src": "407:6:70" + }, + "nativeSrc": "407:12:70", + "nodeType": "YulFunctionCall", + "src": "407:12:70" + }, + "nativeSrc": "407:12:70", + "nodeType": "YulExpressionStatement", + "src": "407:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "dataEnd", + "nativeSrc": "380:7:70", + "nodeType": "YulIdentifier", + "src": "380:7:70" + }, + { + "name": "headStart", + "nativeSrc": "389:9:70", + "nodeType": "YulIdentifier", + "src": "389:9:70" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "376:3:70", + "nodeType": "YulIdentifier", + "src": "376:3:70" + }, + "nativeSrc": "376:23:70", + "nodeType": "YulFunctionCall", + "src": "376:23:70" + }, + { + "kind": "number", + "nativeSrc": "401:2:70", + "nodeType": "YulLiteral", + "src": "401:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "slt", + "nativeSrc": "372:3:70", + "nodeType": "YulIdentifier", + "src": "372:3:70" + }, + "nativeSrc": "372:32:70", + "nodeType": "YulFunctionCall", + "src": "372:32:70" + }, + "nativeSrc": "369:52:70", + "nodeType": "YulIf", + "src": "369:52:70" + }, + { + "nativeSrc": "430:36:70", + "nodeType": "YulVariableDeclaration", + "src": "430:36:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "456:9:70", + "nodeType": "YulIdentifier", + "src": "456:9:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "443:12:70", + "nodeType": "YulIdentifier", + "src": "443:12:70" + }, + "nativeSrc": "443:23:70", + "nodeType": "YulFunctionCall", + "src": "443:23:70" + }, + "variables": [ + { + "name": "value", + "nativeSrc": "434:5:70", + "nodeType": "YulTypedName", + "src": "434:5:70", + "type": "" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "value", + "nativeSrc": "500:5:70", + "nodeType": "YulIdentifier", + "src": "500:5:70" + } + ], + "functionName": { + "name": "validator_revert_address", + "nativeSrc": "475:24:70", + "nodeType": "YulIdentifier", + "src": "475:24:70" + }, + "nativeSrc": "475:31:70", + "nodeType": "YulFunctionCall", + "src": "475:31:70" + }, + "nativeSrc": "475:31:70", + "nodeType": "YulExpressionStatement", + "src": "475:31:70" + }, + { + "nativeSrc": "515:15:70", + "nodeType": "YulAssignment", + "src": "515:15:70", + "value": { + "name": "value", + "nativeSrc": "525:5:70", + "nodeType": "YulIdentifier", + "src": "525:5:70" + }, + "variableNames": [ + { + "name": "value0", + "nativeSrc": "515:6:70", + "nodeType": "YulIdentifier", + "src": "515:6:70" + } + ] + } + ] + }, + "name": "abi_decode_tuple_t_address", + "nativeSrc": "289:247:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "325:9:70", + "nodeType": "YulTypedName", + "src": "325:9:70", + "type": "" + }, + { + "name": "dataEnd", + "nativeSrc": "336:7:70", + "nodeType": "YulTypedName", + "src": "336:7:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value0", + "nativeSrc": "348:6:70", + "nodeType": "YulTypedName", + "src": "348:6:70", + "type": "" + } + ], + "src": "289:247:70" + }, + { + "body": { + "nativeSrc": "585:60:70", + "nodeType": "YulBlock", + "src": "585:60:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "name": "pos", + "nativeSrc": "602:3:70", + "nodeType": "YulIdentifier", + "src": "602:3:70" + }, + { + "arguments": [ + { + "name": "value", + "nativeSrc": "611:5:70", + "nodeType": "YulIdentifier", + "src": "611:5:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "626:3:70", + "nodeType": "YulLiteral", + "src": "626:3:70", + "type": "", + "value": "160" + }, + { + "kind": "number", + "nativeSrc": "631:1:70", + "nodeType": "YulLiteral", + "src": "631:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "622:3:70", + "nodeType": "YulIdentifier", + "src": "622:3:70" + }, + "nativeSrc": "622:11:70", + "nodeType": "YulFunctionCall", + "src": "622:11:70" + }, + { + "kind": "number", + "nativeSrc": "635:1:70", + "nodeType": "YulLiteral", + "src": "635:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "618:3:70", + "nodeType": "YulIdentifier", + "src": "618:3:70" + }, + "nativeSrc": "618:19:70", + "nodeType": "YulFunctionCall", + "src": "618:19:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "607:3:70", + "nodeType": "YulIdentifier", + "src": "607:3:70" + }, + "nativeSrc": "607:31:70", + "nodeType": "YulFunctionCall", + "src": "607:31:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "595:6:70", + "nodeType": "YulIdentifier", + "src": "595:6:70" + }, + "nativeSrc": "595:44:70", + "nodeType": "YulFunctionCall", + "src": "595:44:70" + }, + "nativeSrc": "595:44:70", + "nodeType": "YulExpressionStatement", + "src": "595:44:70" + } + ] + }, + "name": "abi_encode_address", + "nativeSrc": "541:104:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "value", + "nativeSrc": "569:5:70", + "nodeType": "YulTypedName", + "src": "569:5:70", + "type": "" + }, + { + "name": "pos", + "nativeSrc": "576:3:70", + "nodeType": "YulTypedName", + "src": "576:3:70", + "type": "" + } + ], + "src": "541:104:70" + }, + { + "body": { + "nativeSrc": "751:102:70", + "nodeType": "YulBlock", + "src": "751:102:70", + "statements": [ + { + "nativeSrc": "761:26:70", + "nodeType": "YulAssignment", + "src": "761:26:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "773:9:70", + "nodeType": "YulIdentifier", + "src": "773:9:70" + }, + { + "kind": "number", + "nativeSrc": "784:2:70", + "nodeType": "YulLiteral", + "src": "784:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "769:3:70", + "nodeType": "YulIdentifier", + "src": "769:3:70" + }, + "nativeSrc": "769:18:70", + "nodeType": "YulFunctionCall", + "src": "769:18:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "761:4:70", + "nodeType": "YulIdentifier", + "src": "761:4:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "803:9:70", + "nodeType": "YulIdentifier", + "src": "803:9:70" + }, + { + "arguments": [ + { + "name": "value0", + "nativeSrc": "818:6:70", + "nodeType": "YulIdentifier", + "src": "818:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "834:3:70", + "nodeType": "YulLiteral", + "src": "834:3:70", + "type": "", + "value": "160" + }, + { + "kind": "number", + "nativeSrc": "839:1:70", + "nodeType": "YulLiteral", + "src": "839:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "830:3:70", + "nodeType": "YulIdentifier", + "src": "830:3:70" + }, + "nativeSrc": "830:11:70", + "nodeType": "YulFunctionCall", + "src": "830:11:70" + }, + { + "kind": "number", + "nativeSrc": "843:1:70", + "nodeType": "YulLiteral", + "src": "843:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "826:3:70", + "nodeType": "YulIdentifier", + "src": "826:3:70" + }, + "nativeSrc": "826:19:70", + "nodeType": "YulFunctionCall", + "src": "826:19:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "814:3:70", + "nodeType": "YulIdentifier", + "src": "814:3:70" + }, + "nativeSrc": "814:32:70", + "nodeType": "YulFunctionCall", + "src": "814:32:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "796:6:70", + "nodeType": "YulIdentifier", + "src": "796:6:70" + }, + "nativeSrc": "796:51:70", + "nodeType": "YulFunctionCall", + "src": "796:51:70" + }, + "nativeSrc": "796:51:70", + "nodeType": "YulExpressionStatement", + "src": "796:51:70" + } + ] + }, + "name": "abi_encode_tuple_t_address__to_t_address__fromStack_reversed", + "nativeSrc": "650:203:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "720:9:70", + "nodeType": "YulTypedName", + "src": "720:9:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "731:6:70", + "nodeType": "YulTypedName", + "src": "731:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "742:4:70", + "nodeType": "YulTypedName", + "src": "742:4:70", + "type": "" + } + ], + "src": "650:203:70" + }, + { + "body": { + "nativeSrc": "1007:618:70", + "nodeType": "YulBlock", + "src": "1007:618:70", + "statements": [ + { + "nativeSrc": "1017:27:70", + "nodeType": "YulAssignment", + "src": "1017:27:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "1029:9:70", + "nodeType": "YulIdentifier", + "src": "1029:9:70" + }, + { + "kind": "number", + "nativeSrc": "1040:3:70", + "nodeType": "YulLiteral", + "src": "1040:3:70", + "type": "", + "value": "288" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "1025:3:70", + "nodeType": "YulIdentifier", + "src": "1025:3:70" + }, + "nativeSrc": "1025:19:70", + "nodeType": "YulFunctionCall", + "src": "1025:19:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "1017:4:70", + "nodeType": "YulIdentifier", + "src": "1017:4:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "1060:9:70", + "nodeType": "YulIdentifier", + "src": "1060:9:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "name": "value0", + "nativeSrc": "1081:6:70", + "nodeType": "YulIdentifier", + "src": "1081:6:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "1075:5:70", + "nodeType": "YulIdentifier", + "src": "1075:5:70" + }, + "nativeSrc": "1075:13:70", + "nodeType": "YulFunctionCall", + "src": "1075:13:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "1098:3:70", + "nodeType": "YulLiteral", + "src": "1098:3:70", + "type": "", + "value": "160" + }, + { + "kind": "number", + "nativeSrc": "1103:1:70", + "nodeType": "YulLiteral", + "src": "1103:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "1094:3:70", + "nodeType": "YulIdentifier", + "src": "1094:3:70" + }, + "nativeSrc": "1094:11:70", + "nodeType": "YulFunctionCall", + "src": "1094:11:70" + }, + { + "kind": "number", + "nativeSrc": "1107:1:70", + "nodeType": "YulLiteral", + "src": "1107:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "1090:3:70", + "nodeType": "YulIdentifier", + "src": "1090:3:70" + }, + "nativeSrc": "1090:19:70", + "nodeType": "YulFunctionCall", + "src": "1090:19:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "1071:3:70", + "nodeType": "YulIdentifier", + "src": "1071:3:70" + }, + "nativeSrc": "1071:39:70", + "nodeType": "YulFunctionCall", + "src": "1071:39:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "1053:6:70", + "nodeType": "YulIdentifier", + "src": "1053:6:70" + }, + "nativeSrc": "1053:58:70", + "nodeType": "YulFunctionCall", + "src": "1053:58:70" + }, + "nativeSrc": "1053:58:70", + "nodeType": "YulExpressionStatement", + "src": "1053:58:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "1131:9:70", + "nodeType": "YulIdentifier", + "src": "1131:9:70" + }, + { + "kind": "number", + "nativeSrc": "1142:4:70", + "nodeType": "YulLiteral", + "src": "1142:4:70", + "type": "", + "value": "0x20" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "1127:3:70", + "nodeType": "YulIdentifier", + "src": "1127:3:70" + }, + "nativeSrc": "1127:20:70", + "nodeType": "YulFunctionCall", + "src": "1127:20:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "name": "value0", + "nativeSrc": "1159:6:70", + "nodeType": "YulIdentifier", + "src": "1159:6:70" + }, + { + "kind": "number", + "nativeSrc": "1167:4:70", + "nodeType": "YulLiteral", + "src": "1167:4:70", + "type": "", + "value": "0x20" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "1155:3:70", + "nodeType": "YulIdentifier", + "src": "1155:3:70" + }, + "nativeSrc": "1155:17:70", + "nodeType": "YulFunctionCall", + "src": "1155:17:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "1149:5:70", + "nodeType": "YulIdentifier", + "src": "1149:5:70" + }, + "nativeSrc": "1149:24:70", + "nodeType": "YulFunctionCall", + "src": "1149:24:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "1120:6:70", + "nodeType": "YulIdentifier", + "src": "1120:6:70" + }, + "nativeSrc": "1120:54:70", + "nodeType": "YulFunctionCall", + "src": "1120:54:70" + }, + "nativeSrc": "1120:54:70", + "nodeType": "YulExpressionStatement", + "src": "1120:54:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "1194:9:70", + "nodeType": "YulIdentifier", + "src": "1194:9:70" + }, + { + "kind": "number", + "nativeSrc": "1205:4:70", + "nodeType": "YulLiteral", + "src": "1205:4:70", + "type": "", + "value": "0x40" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "1190:3:70", + "nodeType": "YulIdentifier", + "src": "1190:3:70" + }, + "nativeSrc": "1190:20:70", + "nodeType": "YulFunctionCall", + "src": "1190:20:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "name": "value0", + "nativeSrc": "1222:6:70", + "nodeType": "YulIdentifier", + "src": "1222:6:70" + }, + { + "kind": "number", + "nativeSrc": "1230:4:70", + "nodeType": "YulLiteral", + "src": "1230:4:70", + "type": "", + "value": "0x40" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "1218:3:70", + "nodeType": "YulIdentifier", + "src": "1218:3:70" + }, + "nativeSrc": "1218:17:70", + "nodeType": "YulFunctionCall", + "src": "1218:17:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "1212:5:70", + "nodeType": "YulIdentifier", + "src": "1212:5:70" + }, + "nativeSrc": "1212:24:70", + "nodeType": "YulFunctionCall", + "src": "1212:24:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "1183:6:70", + "nodeType": "YulIdentifier", + "src": "1183:6:70" + }, + "nativeSrc": "1183:54:70", + "nodeType": "YulFunctionCall", + "src": "1183:54:70" + }, + "nativeSrc": "1183:54:70", + "nodeType": "YulExpressionStatement", + "src": "1183:54:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "1257:9:70", + "nodeType": "YulIdentifier", + "src": "1257:9:70" + }, + { + "kind": "number", + "nativeSrc": "1268:4:70", + "nodeType": "YulLiteral", + "src": "1268:4:70", + "type": "", + "value": "0x60" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "1253:3:70", + "nodeType": "YulIdentifier", + "src": "1253:3:70" + }, + "nativeSrc": "1253:20:70", + "nodeType": "YulFunctionCall", + "src": "1253:20:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "name": "value0", + "nativeSrc": "1285:6:70", + "nodeType": "YulIdentifier", + "src": "1285:6:70" + }, + { + "kind": "number", + "nativeSrc": "1293:4:70", + "nodeType": "YulLiteral", + "src": "1293:4:70", + "type": "", + "value": "0x60" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "1281:3:70", + "nodeType": "YulIdentifier", + "src": "1281:3:70" + }, + "nativeSrc": "1281:17:70", + "nodeType": "YulFunctionCall", + "src": "1281:17:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "1275:5:70", + "nodeType": "YulIdentifier", + "src": "1275:5:70" + }, + "nativeSrc": "1275:24:70", + "nodeType": "YulFunctionCall", + "src": "1275:24:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "1246:6:70", + "nodeType": "YulIdentifier", + "src": "1246:6:70" + }, + "nativeSrc": "1246:54:70", + "nodeType": "YulFunctionCall", + "src": "1246:54:70" + }, + "nativeSrc": "1246:54:70", + "nodeType": "YulExpressionStatement", + "src": "1246:54:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "1320:9:70", + "nodeType": "YulIdentifier", + "src": "1320:9:70" + }, + { + "kind": "number", + "nativeSrc": "1331:4:70", + "nodeType": "YulLiteral", + "src": "1331:4:70", + "type": "", + "value": "0x80" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "1316:3:70", + "nodeType": "YulIdentifier", + "src": "1316:3:70" + }, + "nativeSrc": "1316:20:70", + "nodeType": "YulFunctionCall", + "src": "1316:20:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "name": "value0", + "nativeSrc": "1348:6:70", + "nodeType": "YulIdentifier", + "src": "1348:6:70" + }, + { + "kind": "number", + "nativeSrc": "1356:4:70", + "nodeType": "YulLiteral", + "src": "1356:4:70", + "type": "", + "value": "0x80" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "1344:3:70", + "nodeType": "YulIdentifier", + "src": "1344:3:70" + }, + "nativeSrc": "1344:17:70", + "nodeType": "YulFunctionCall", + "src": "1344:17:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "1338:5:70", + "nodeType": "YulIdentifier", + "src": "1338:5:70" + }, + "nativeSrc": "1338:24:70", + "nodeType": "YulFunctionCall", + "src": "1338:24:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "1309:6:70", + "nodeType": "YulIdentifier", + "src": "1309:6:70" + }, + "nativeSrc": "1309:54:70", + "nodeType": "YulFunctionCall", + "src": "1309:54:70" + }, + "nativeSrc": "1309:54:70", + "nodeType": "YulExpressionStatement", + "src": "1309:54:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "1383:9:70", + "nodeType": "YulIdentifier", + "src": "1383:9:70" + }, + { + "kind": "number", + "nativeSrc": "1394:4:70", + "nodeType": "YulLiteral", + "src": "1394:4:70", + "type": "", + "value": "0xa0" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "1379:3:70", + "nodeType": "YulIdentifier", + "src": "1379:3:70" + }, + "nativeSrc": "1379:20:70", + "nodeType": "YulFunctionCall", + "src": "1379:20:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "name": "value0", + "nativeSrc": "1411:6:70", + "nodeType": "YulIdentifier", + "src": "1411:6:70" + }, + { + "kind": "number", + "nativeSrc": "1419:4:70", + "nodeType": "YulLiteral", + "src": "1419:4:70", + "type": "", + "value": "0xa0" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "1407:3:70", + "nodeType": "YulIdentifier", + "src": "1407:3:70" + }, + "nativeSrc": "1407:17:70", + "nodeType": "YulFunctionCall", + "src": "1407:17:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "1401:5:70", + "nodeType": "YulIdentifier", + "src": "1401:5:70" + }, + "nativeSrc": "1401:24:70", + "nodeType": "YulFunctionCall", + "src": "1401:24:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "1372:6:70", + "nodeType": "YulIdentifier", + "src": "1372:6:70" + }, + "nativeSrc": "1372:54:70", + "nodeType": "YulFunctionCall", + "src": "1372:54:70" + }, + "nativeSrc": "1372:54:70", + "nodeType": "YulExpressionStatement", + "src": "1372:54:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "1446:9:70", + "nodeType": "YulIdentifier", + "src": "1446:9:70" + }, + { + "kind": "number", + "nativeSrc": "1457:4:70", + "nodeType": "YulLiteral", + "src": "1457:4:70", + "type": "", + "value": "0xc0" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "1442:3:70", + "nodeType": "YulIdentifier", + "src": "1442:3:70" + }, + "nativeSrc": "1442:20:70", + "nodeType": "YulFunctionCall", + "src": "1442:20:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "name": "value0", + "nativeSrc": "1474:6:70", + "nodeType": "YulIdentifier", + "src": "1474:6:70" + }, + { + "kind": "number", + "nativeSrc": "1482:4:70", + "nodeType": "YulLiteral", + "src": "1482:4:70", + "type": "", + "value": "0xc0" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "1470:3:70", + "nodeType": "YulIdentifier", + "src": "1470:3:70" + }, + "nativeSrc": "1470:17:70", + "nodeType": "YulFunctionCall", + "src": "1470:17:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "1464:5:70", + "nodeType": "YulIdentifier", + "src": "1464:5:70" + }, + "nativeSrc": "1464:24:70", + "nodeType": "YulFunctionCall", + "src": "1464:24:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "1435:6:70", + "nodeType": "YulIdentifier", + "src": "1435:6:70" + }, + "nativeSrc": "1435:54:70", + "nodeType": "YulFunctionCall", + "src": "1435:54:70" + }, + "nativeSrc": "1435:54:70", + "nodeType": "YulExpressionStatement", + "src": "1435:54:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "1509:9:70", + "nodeType": "YulIdentifier", + "src": "1509:9:70" + }, + { + "kind": "number", + "nativeSrc": "1520:4:70", + "nodeType": "YulLiteral", + "src": "1520:4:70", + "type": "", + "value": "0xe0" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "1505:3:70", + "nodeType": "YulIdentifier", + "src": "1505:3:70" + }, + "nativeSrc": "1505:20:70", + "nodeType": "YulFunctionCall", + "src": "1505:20:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "name": "value0", + "nativeSrc": "1537:6:70", + "nodeType": "YulIdentifier", + "src": "1537:6:70" + }, + { + "kind": "number", + "nativeSrc": "1545:4:70", + "nodeType": "YulLiteral", + "src": "1545:4:70", + "type": "", + "value": "0xe0" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "1533:3:70", + "nodeType": "YulIdentifier", + "src": "1533:3:70" + }, + "nativeSrc": "1533:17:70", + "nodeType": "YulFunctionCall", + "src": "1533:17:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "1527:5:70", + "nodeType": "YulIdentifier", + "src": "1527:5:70" + }, + "nativeSrc": "1527:24:70", + "nodeType": "YulFunctionCall", + "src": "1527:24:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "1498:6:70", + "nodeType": "YulIdentifier", + "src": "1498:6:70" + }, + "nativeSrc": "1498:54:70", + "nodeType": "YulFunctionCall", + "src": "1498:54:70" + }, + "nativeSrc": "1498:54:70", + "nodeType": "YulExpressionStatement", + "src": "1498:54:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "1572:9:70", + "nodeType": "YulIdentifier", + "src": "1572:9:70" + }, + { + "kind": "number", + "nativeSrc": "1583:6:70", + "nodeType": "YulLiteral", + "src": "1583:6:70", + "type": "", + "value": "0x0100" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "1568:3:70", + "nodeType": "YulIdentifier", + "src": "1568:3:70" + }, + "nativeSrc": "1568:22:70", + "nodeType": "YulFunctionCall", + "src": "1568:22:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "name": "value0", + "nativeSrc": "1602:6:70", + "nodeType": "YulIdentifier", + "src": "1602:6:70" + }, + { + "kind": "number", + "nativeSrc": "1610:6:70", + "nodeType": "YulLiteral", + "src": "1610:6:70", + "type": "", + "value": "0x0100" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "1598:3:70", + "nodeType": "YulIdentifier", + "src": "1598:3:70" + }, + "nativeSrc": "1598:19:70", + "nodeType": "YulFunctionCall", + "src": "1598:19:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "1592:5:70", + "nodeType": "YulIdentifier", + "src": "1592:5:70" + }, + "nativeSrc": "1592:26:70", + "nodeType": "YulFunctionCall", + "src": "1592:26:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "1561:6:70", + "nodeType": "YulIdentifier", + "src": "1561:6:70" + }, + "nativeSrc": "1561:58:70", + "nodeType": "YulFunctionCall", + "src": "1561:58:70" + }, + "nativeSrc": "1561:58:70", + "nodeType": "YulExpressionStatement", + "src": "1561:58:70" + } + ] + }, + "name": "abi_encode_tuple_t_struct$_State_$15663_memory_ptr__to_t_struct$_State_$15663_memory_ptr__fromStack_reversed", + "nativeSrc": "858:767:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "976:9:70", + "nodeType": "YulTypedName", + "src": "976:9:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "987:6:70", + "nodeType": "YulTypedName", + "src": "987:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "998:4:70", + "nodeType": "YulTypedName", + "src": "998:4:70", + "type": "" + } + ], + "src": "858:767:70" + }, + { + "body": { + "nativeSrc": "1731:76:70", + "nodeType": "YulBlock", + "src": "1731:76:70", + "statements": [ + { + "nativeSrc": "1741:26:70", + "nodeType": "YulAssignment", + "src": "1741:26:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "1753:9:70", + "nodeType": "YulIdentifier", + "src": "1753:9:70" + }, + { + "kind": "number", + "nativeSrc": "1764:2:70", + "nodeType": "YulLiteral", + "src": "1764:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "1749:3:70", + "nodeType": "YulIdentifier", + "src": "1749:3:70" + }, + "nativeSrc": "1749:18:70", + "nodeType": "YulFunctionCall", + "src": "1749:18:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "1741:4:70", + "nodeType": "YulIdentifier", + "src": "1741:4:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "1783:9:70", + "nodeType": "YulIdentifier", + "src": "1783:9:70" + }, + { + "name": "value0", + "nativeSrc": "1794:6:70", + "nodeType": "YulIdentifier", + "src": "1794:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "1776:6:70", + "nodeType": "YulIdentifier", + "src": "1776:6:70" + }, + "nativeSrc": "1776:25:70", + "nodeType": "YulFunctionCall", + "src": "1776:25:70" + }, + "nativeSrc": "1776:25:70", + "nodeType": "YulExpressionStatement", + "src": "1776:25:70" + } + ] + }, + "name": "abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed", + "nativeSrc": "1630:177:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "1700:9:70", + "nodeType": "YulTypedName", + "src": "1700:9:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "1711:6:70", + "nodeType": "YulTypedName", + "src": "1711:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "1722:4:70", + "nodeType": "YulTypedName", + "src": "1722:4:70", + "type": "" + } + ], + "src": "1630:177:70" + }, + { + "body": { + "nativeSrc": "1997:206:70", + "nodeType": "YulBlock", + "src": "1997:206:70", + "statements": [ + { + "nativeSrc": "2007:27:70", + "nodeType": "YulAssignment", + "src": "2007:27:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "2019:9:70", + "nodeType": "YulIdentifier", + "src": "2019:9:70" + }, + { + "kind": "number", + "nativeSrc": "2030:3:70", + "nodeType": "YulLiteral", + "src": "2030:3:70", + "type": "", + "value": "128" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "2015:3:70", + "nodeType": "YulIdentifier", + "src": "2015:3:70" + }, + "nativeSrc": "2015:19:70", + "nodeType": "YulFunctionCall", + "src": "2015:19:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "2007:4:70", + "nodeType": "YulIdentifier", + "src": "2007:4:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "2050:9:70", + "nodeType": "YulIdentifier", + "src": "2050:9:70" + }, + { + "name": "value0", + "nativeSrc": "2061:6:70", + "nodeType": "YulIdentifier", + "src": "2061:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "2043:6:70", + "nodeType": "YulIdentifier", + "src": "2043:6:70" + }, + "nativeSrc": "2043:25:70", + "nodeType": "YulFunctionCall", + "src": "2043:25:70" + }, + "nativeSrc": "2043:25:70", + "nodeType": "YulExpressionStatement", + "src": "2043:25:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "2088:9:70", + "nodeType": "YulIdentifier", + "src": "2088:9:70" + }, + { + "kind": "number", + "nativeSrc": "2099:2:70", + "nodeType": "YulLiteral", + "src": "2099:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "2084:3:70", + "nodeType": "YulIdentifier", + "src": "2084:3:70" + }, + "nativeSrc": "2084:18:70", + "nodeType": "YulFunctionCall", + "src": "2084:18:70" + }, + { + "name": "value1", + "nativeSrc": "2104:6:70", + "nodeType": "YulIdentifier", + "src": "2104:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "2077:6:70", + "nodeType": "YulIdentifier", + "src": "2077:6:70" + }, + "nativeSrc": "2077:34:70", + "nodeType": "YulFunctionCall", + "src": "2077:34:70" + }, + "nativeSrc": "2077:34:70", + "nodeType": "YulExpressionStatement", + "src": "2077:34:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "2131:9:70", + "nodeType": "YulIdentifier", + "src": "2131:9:70" + }, + { + "kind": "number", + "nativeSrc": "2142:2:70", + "nodeType": "YulLiteral", + "src": "2142:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "2127:3:70", + "nodeType": "YulIdentifier", + "src": "2127:3:70" + }, + "nativeSrc": "2127:18:70", + "nodeType": "YulFunctionCall", + "src": "2127:18:70" + }, + { + "name": "value2", + "nativeSrc": "2147:6:70", + "nodeType": "YulIdentifier", + "src": "2147:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "2120:6:70", + "nodeType": "YulIdentifier", + "src": "2120:6:70" + }, + "nativeSrc": "2120:34:70", + "nodeType": "YulFunctionCall", + "src": "2120:34:70" + }, + "nativeSrc": "2120:34:70", + "nodeType": "YulExpressionStatement", + "src": "2120:34:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "2174:9:70", + "nodeType": "YulIdentifier", + "src": "2174:9:70" + }, + { + "kind": "number", + "nativeSrc": "2185:2:70", + "nodeType": "YulLiteral", + "src": "2185:2:70", + "type": "", + "value": "96" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "2170:3:70", + "nodeType": "YulIdentifier", + "src": "2170:3:70" + }, + "nativeSrc": "2170:18:70", + "nodeType": "YulFunctionCall", + "src": "2170:18:70" + }, + { + "name": "value3", + "nativeSrc": "2190:6:70", + "nodeType": "YulIdentifier", + "src": "2190:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "2163:6:70", + "nodeType": "YulIdentifier", + "src": "2163:6:70" + }, + "nativeSrc": "2163:34:70", + "nodeType": "YulFunctionCall", + "src": "2163:34:70" + }, + "nativeSrc": "2163:34:70", + "nodeType": "YulExpressionStatement", + "src": "2163:34:70" + } + ] + }, + "name": "abi_encode_tuple_t_bytes32_t_bytes32_t_uint256_t_uint256__to_t_bytes32_t_bytes32_t_uint256_t_uint256__fromStack_reversed", + "nativeSrc": "1812:391:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "1942:9:70", + "nodeType": "YulTypedName", + "src": "1942:9:70", + "type": "" + }, + { + "name": "value3", + "nativeSrc": "1953:6:70", + "nodeType": "YulTypedName", + "src": "1953:6:70", + "type": "" + }, + { + "name": "value2", + "nativeSrc": "1961:6:70", + "nodeType": "YulTypedName", + "src": "1961:6:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "1969:6:70", + "nodeType": "YulTypedName", + "src": "1969:6:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "1977:6:70", + "nodeType": "YulTypedName", + "src": "1977:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "1988:4:70", + "nodeType": "YulTypedName", + "src": "1988:4:70", + "type": "" + } + ], + "src": "1812:391:70" + }, + { + "body": { + "nativeSrc": "2252:77:70", + "nodeType": "YulBlock", + "src": "2252:77:70", + "statements": [ + { + "body": { + "nativeSrc": "2307:16:70", + "nodeType": "YulBlock", + "src": "2307:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "2316:1:70", + "nodeType": "YulLiteral", + "src": "2316:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "2319:1:70", + "nodeType": "YulLiteral", + "src": "2319:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "2309:6:70", + "nodeType": "YulIdentifier", + "src": "2309:6:70" + }, + "nativeSrc": "2309:12:70", + "nodeType": "YulFunctionCall", + "src": "2309:12:70" + }, + "nativeSrc": "2309:12:70", + "nodeType": "YulExpressionStatement", + "src": "2309:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "value", + "nativeSrc": "2275:5:70", + "nodeType": "YulIdentifier", + "src": "2275:5:70" + }, + { + "arguments": [ + { + "name": "value", + "nativeSrc": "2286:5:70", + "nodeType": "YulIdentifier", + "src": "2286:5:70" + }, + { + "kind": "number", + "nativeSrc": "2293:10:70", + "nodeType": "YulLiteral", + "src": "2293:10:70", + "type": "", + "value": "0xffffffff" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "2282:3:70", + "nodeType": "YulIdentifier", + "src": "2282:3:70" + }, + "nativeSrc": "2282:22:70", + "nodeType": "YulFunctionCall", + "src": "2282:22:70" + } + ], + "functionName": { + "name": "eq", + "nativeSrc": "2272:2:70", + "nodeType": "YulIdentifier", + "src": "2272:2:70" + }, + "nativeSrc": "2272:33:70", + "nodeType": "YulFunctionCall", + "src": "2272:33:70" + } + ], + "functionName": { + "name": "iszero", + "nativeSrc": "2265:6:70", + "nodeType": "YulIdentifier", + "src": "2265:6:70" + }, + "nativeSrc": "2265:41:70", + "nodeType": "YulFunctionCall", + "src": "2265:41:70" + }, + "nativeSrc": "2262:61:70", + "nodeType": "YulIf", + "src": "2262:61:70" + } + ] + }, + "name": "validator_revert_uint32", + "nativeSrc": "2208:121:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "value", + "nativeSrc": "2241:5:70", + "nodeType": "YulTypedName", + "src": "2241:5:70", + "type": "" + } + ], + "src": "2208:121:70" + }, + { + "body": { + "nativeSrc": "2403:176:70", + "nodeType": "YulBlock", + "src": "2403:176:70", + "statements": [ + { + "body": { + "nativeSrc": "2449:16:70", + "nodeType": "YulBlock", + "src": "2449:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "2458:1:70", + "nodeType": "YulLiteral", + "src": "2458:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "2461:1:70", + "nodeType": "YulLiteral", + "src": "2461:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "2451:6:70", + "nodeType": "YulIdentifier", + "src": "2451:6:70" + }, + "nativeSrc": "2451:12:70", + "nodeType": "YulFunctionCall", + "src": "2451:12:70" + }, + "nativeSrc": "2451:12:70", + "nodeType": "YulExpressionStatement", + "src": "2451:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "dataEnd", + "nativeSrc": "2424:7:70", + "nodeType": "YulIdentifier", + "src": "2424:7:70" + }, + { + "name": "headStart", + "nativeSrc": "2433:9:70", + "nodeType": "YulIdentifier", + "src": "2433:9:70" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "2420:3:70", + "nodeType": "YulIdentifier", + "src": "2420:3:70" + }, + "nativeSrc": "2420:23:70", + "nodeType": "YulFunctionCall", + "src": "2420:23:70" + }, + { + "kind": "number", + "nativeSrc": "2445:2:70", + "nodeType": "YulLiteral", + "src": "2445:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "slt", + "nativeSrc": "2416:3:70", + "nodeType": "YulIdentifier", + "src": "2416:3:70" + }, + "nativeSrc": "2416:32:70", + "nodeType": "YulFunctionCall", + "src": "2416:32:70" + }, + "nativeSrc": "2413:52:70", + "nodeType": "YulIf", + "src": "2413:52:70" + }, + { + "nativeSrc": "2474:36:70", + "nodeType": "YulVariableDeclaration", + "src": "2474:36:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "2500:9:70", + "nodeType": "YulIdentifier", + "src": "2500:9:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "2487:12:70", + "nodeType": "YulIdentifier", + "src": "2487:12:70" + }, + "nativeSrc": "2487:23:70", + "nodeType": "YulFunctionCall", + "src": "2487:23:70" + }, + "variables": [ + { + "name": "value", + "nativeSrc": "2478:5:70", + "nodeType": "YulTypedName", + "src": "2478:5:70", + "type": "" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "value", + "nativeSrc": "2543:5:70", + "nodeType": "YulIdentifier", + "src": "2543:5:70" + } + ], + "functionName": { + "name": "validator_revert_uint32", + "nativeSrc": "2519:23:70", + "nodeType": "YulIdentifier", + "src": "2519:23:70" + }, + "nativeSrc": "2519:30:70", + "nodeType": "YulFunctionCall", + "src": "2519:30:70" + }, + "nativeSrc": "2519:30:70", + "nodeType": "YulExpressionStatement", + "src": "2519:30:70" + }, + { + "nativeSrc": "2558:15:70", + "nodeType": "YulAssignment", + "src": "2558:15:70", + "value": { + "name": "value", + "nativeSrc": "2568:5:70", + "nodeType": "YulIdentifier", + "src": "2568:5:70" + }, + "variableNames": [ + { + "name": "value0", + "nativeSrc": "2558:6:70", + "nodeType": "YulIdentifier", + "src": "2558:6:70" + } + ] + } + ] + }, + "name": "abi_decode_tuple_t_uint32", + "nativeSrc": "2334:245:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "2369:9:70", + "nodeType": "YulTypedName", + "src": "2369:9:70", + "type": "" + }, + { + "name": "dataEnd", + "nativeSrc": "2380:7:70", + "nodeType": "YulTypedName", + "src": "2380:7:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value0", + "nativeSrc": "2392:6:70", + "nodeType": "YulTypedName", + "src": "2392:6:70", + "type": "" + } + ], + "src": "2334:245:70" + }, + { + "body": { + "nativeSrc": "2683:93:70", + "nodeType": "YulBlock", + "src": "2683:93:70", + "statements": [ + { + "nativeSrc": "2693:26:70", + "nodeType": "YulAssignment", + "src": "2693:26:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "2705:9:70", + "nodeType": "YulIdentifier", + "src": "2705:9:70" + }, + { + "kind": "number", + "nativeSrc": "2716:2:70", + "nodeType": "YulLiteral", + "src": "2716:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "2701:3:70", + "nodeType": "YulIdentifier", + "src": "2701:3:70" + }, + "nativeSrc": "2701:18:70", + "nodeType": "YulFunctionCall", + "src": "2701:18:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "2693:4:70", + "nodeType": "YulIdentifier", + "src": "2693:4:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "2735:9:70", + "nodeType": "YulIdentifier", + "src": "2735:9:70" + }, + { + "arguments": [ + { + "name": "value0", + "nativeSrc": "2750:6:70", + "nodeType": "YulIdentifier", + "src": "2750:6:70" + }, + { + "kind": "number", + "nativeSrc": "2758:10:70", + "nodeType": "YulLiteral", + "src": "2758:10:70", + "type": "", + "value": "0xffffffff" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "2746:3:70", + "nodeType": "YulIdentifier", + "src": "2746:3:70" + }, + "nativeSrc": "2746:23:70", + "nodeType": "YulFunctionCall", + "src": "2746:23:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "2728:6:70", + "nodeType": "YulIdentifier", + "src": "2728:6:70" + }, + "nativeSrc": "2728:42:70", + "nodeType": "YulFunctionCall", + "src": "2728:42:70" + }, + "nativeSrc": "2728:42:70", + "nodeType": "YulExpressionStatement", + "src": "2728:42:70" + } + ] + }, + "name": "abi_encode_tuple_t_uint32__to_t_uint32__fromStack_reversed", + "nativeSrc": "2584:192:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "2652:9:70", + "nodeType": "YulTypedName", + "src": "2652:9:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "2663:6:70", + "nodeType": "YulTypedName", + "src": "2663:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "2674:4:70", + "nodeType": "YulTypedName", + "src": "2674:4:70", + "type": "" + } + ], + "src": "2584:192:70" + }, + { + "body": { + "nativeSrc": "2853:275:70", + "nodeType": "YulBlock", + "src": "2853:275:70", + "statements": [ + { + "body": { + "nativeSrc": "2902:16:70", + "nodeType": "YulBlock", + "src": "2902:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "2911:1:70", + "nodeType": "YulLiteral", + "src": "2911:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "2914:1:70", + "nodeType": "YulLiteral", + "src": "2914:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "2904:6:70", + "nodeType": "YulIdentifier", + "src": "2904:6:70" + }, + "nativeSrc": "2904:12:70", + "nodeType": "YulFunctionCall", + "src": "2904:12:70" + }, + "nativeSrc": "2904:12:70", + "nodeType": "YulExpressionStatement", + "src": "2904:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "arguments": [ + { + "name": "offset", + "nativeSrc": "2881:6:70", + "nodeType": "YulIdentifier", + "src": "2881:6:70" + }, + { + "kind": "number", + "nativeSrc": "2889:4:70", + "nodeType": "YulLiteral", + "src": "2889:4:70", + "type": "", + "value": "0x1f" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "2877:3:70", + "nodeType": "YulIdentifier", + "src": "2877:3:70" + }, + "nativeSrc": "2877:17:70", + "nodeType": "YulFunctionCall", + "src": "2877:17:70" + }, + { + "name": "end", + "nativeSrc": "2896:3:70", + "nodeType": "YulIdentifier", + "src": "2896:3:70" + } + ], + "functionName": { + "name": "slt", + "nativeSrc": "2873:3:70", + "nodeType": "YulIdentifier", + "src": "2873:3:70" + }, + "nativeSrc": "2873:27:70", + "nodeType": "YulFunctionCall", + "src": "2873:27:70" + } + ], + "functionName": { + "name": "iszero", + "nativeSrc": "2866:6:70", + "nodeType": "YulIdentifier", + "src": "2866:6:70" + }, + "nativeSrc": "2866:35:70", + "nodeType": "YulFunctionCall", + "src": "2866:35:70" + }, + "nativeSrc": "2863:55:70", + "nodeType": "YulIf", + "src": "2863:55:70" + }, + { + "nativeSrc": "2927:30:70", + "nodeType": "YulAssignment", + "src": "2927:30:70", + "value": { + "arguments": [ + { + "name": "offset", + "nativeSrc": "2950:6:70", + "nodeType": "YulIdentifier", + "src": "2950:6:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "2937:12:70", + "nodeType": "YulIdentifier", + "src": "2937:12:70" + }, + "nativeSrc": "2937:20:70", + "nodeType": "YulFunctionCall", + "src": "2937:20:70" + }, + "variableNames": [ + { + "name": "length", + "nativeSrc": "2927:6:70", + "nodeType": "YulIdentifier", + "src": "2927:6:70" + } + ] + }, + { + "body": { + "nativeSrc": "3000:16:70", + "nodeType": "YulBlock", + "src": "3000:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "3009:1:70", + "nodeType": "YulLiteral", + "src": "3009:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "3012:1:70", + "nodeType": "YulLiteral", + "src": "3012:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "3002:6:70", + "nodeType": "YulIdentifier", + "src": "3002:6:70" + }, + "nativeSrc": "3002:12:70", + "nodeType": "YulFunctionCall", + "src": "3002:12:70" + }, + "nativeSrc": "3002:12:70", + "nodeType": "YulExpressionStatement", + "src": "3002:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "name": "length", + "nativeSrc": "2972:6:70", + "nodeType": "YulIdentifier", + "src": "2972:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "2988:2:70", + "nodeType": "YulLiteral", + "src": "2988:2:70", + "type": "", + "value": "64" + }, + { + "kind": "number", + "nativeSrc": "2992:1:70", + "nodeType": "YulLiteral", + "src": "2992:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "2984:3:70", + "nodeType": "YulIdentifier", + "src": "2984:3:70" + }, + "nativeSrc": "2984:10:70", + "nodeType": "YulFunctionCall", + "src": "2984:10:70" + }, + { + "kind": "number", + "nativeSrc": "2996:1:70", + "nodeType": "YulLiteral", + "src": "2996:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "2980:3:70", + "nodeType": "YulIdentifier", + "src": "2980:3:70" + }, + "nativeSrc": "2980:18:70", + "nodeType": "YulFunctionCall", + "src": "2980:18:70" + } + ], + "functionName": { + "name": "gt", + "nativeSrc": "2969:2:70", + "nodeType": "YulIdentifier", + "src": "2969:2:70" + }, + "nativeSrc": "2969:30:70", + "nodeType": "YulFunctionCall", + "src": "2969:30:70" + }, + "nativeSrc": "2966:50:70", + "nodeType": "YulIf", + "src": "2966:50:70" + }, + { + "nativeSrc": "3025:29:70", + "nodeType": "YulAssignment", + "src": "3025:29:70", + "value": { + "arguments": [ + { + "name": "offset", + "nativeSrc": "3041:6:70", + "nodeType": "YulIdentifier", + "src": "3041:6:70" + }, + { + "kind": "number", + "nativeSrc": "3049:4:70", + "nodeType": "YulLiteral", + "src": "3049:4:70", + "type": "", + "value": "0x20" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "3037:3:70", + "nodeType": "YulIdentifier", + "src": "3037:3:70" + }, + "nativeSrc": "3037:17:70", + "nodeType": "YulFunctionCall", + "src": "3037:17:70" + }, + "variableNames": [ + { + "name": "arrayPos", + "nativeSrc": "3025:8:70", + "nodeType": "YulIdentifier", + "src": "3025:8:70" + } + ] + }, + { + "body": { + "nativeSrc": "3106:16:70", + "nodeType": "YulBlock", + "src": "3106:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "3115:1:70", + "nodeType": "YulLiteral", + "src": "3115:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "3118:1:70", + "nodeType": "YulLiteral", + "src": "3118:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "3108:6:70", + "nodeType": "YulIdentifier", + "src": "3108:6:70" + }, + "nativeSrc": "3108:12:70", + "nodeType": "YulFunctionCall", + "src": "3108:12:70" + }, + "nativeSrc": "3108:12:70", + "nodeType": "YulExpressionStatement", + "src": "3108:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "arguments": [ + { + "name": "offset", + "nativeSrc": "3077:6:70", + "nodeType": "YulIdentifier", + "src": "3077:6:70" + }, + { + "name": "length", + "nativeSrc": "3085:6:70", + "nodeType": "YulIdentifier", + "src": "3085:6:70" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "3073:3:70", + "nodeType": "YulIdentifier", + "src": "3073:3:70" + }, + "nativeSrc": "3073:19:70", + "nodeType": "YulFunctionCall", + "src": "3073:19:70" + }, + { + "kind": "number", + "nativeSrc": "3094:4:70", + "nodeType": "YulLiteral", + "src": "3094:4:70", + "type": "", + "value": "0x20" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "3069:3:70", + "nodeType": "YulIdentifier", + "src": "3069:3:70" + }, + "nativeSrc": "3069:30:70", + "nodeType": "YulFunctionCall", + "src": "3069:30:70" + }, + { + "name": "end", + "nativeSrc": "3101:3:70", + "nodeType": "YulIdentifier", + "src": "3101:3:70" + } + ], + "functionName": { + "name": "gt", + "nativeSrc": "3066:2:70", + "nodeType": "YulIdentifier", + "src": "3066:2:70" + }, + "nativeSrc": "3066:39:70", + "nodeType": "YulFunctionCall", + "src": "3066:39:70" + }, + "nativeSrc": "3063:59:70", + "nodeType": "YulIf", + "src": "3063:59:70" + } + ] + }, + "name": "abi_decode_bytes_calldata", + "nativeSrc": "2781:347:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "offset", + "nativeSrc": "2816:6:70", + "nodeType": "YulTypedName", + "src": "2816:6:70", + "type": "" + }, + { + "name": "end", + "nativeSrc": "2824:3:70", + "nodeType": "YulTypedName", + "src": "2824:3:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "arrayPos", + "nativeSrc": "2832:8:70", + "nodeType": "YulTypedName", + "src": "2832:8:70", + "type": "" + }, + { + "name": "length", + "nativeSrc": "2842:6:70", + "nodeType": "YulTypedName", + "src": "2842:6:70", + "type": "" + } + ], + "src": "2781:347:70" + }, + { + "body": { + "nativeSrc": "3239:438:70", + "nodeType": "YulBlock", + "src": "3239:438:70", + "statements": [ + { + "body": { + "nativeSrc": "3285:16:70", + "nodeType": "YulBlock", + "src": "3285:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "3294:1:70", + "nodeType": "YulLiteral", + "src": "3294:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "3297:1:70", + "nodeType": "YulLiteral", + "src": "3297:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "3287:6:70", + "nodeType": "YulIdentifier", + "src": "3287:6:70" + }, + "nativeSrc": "3287:12:70", + "nodeType": "YulFunctionCall", + "src": "3287:12:70" + }, + "nativeSrc": "3287:12:70", + "nodeType": "YulExpressionStatement", + "src": "3287:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "dataEnd", + "nativeSrc": "3260:7:70", + "nodeType": "YulIdentifier", + "src": "3260:7:70" + }, + { + "name": "headStart", + "nativeSrc": "3269:9:70", + "nodeType": "YulIdentifier", + "src": "3269:9:70" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "3256:3:70", + "nodeType": "YulIdentifier", + "src": "3256:3:70" + }, + "nativeSrc": "3256:23:70", + "nodeType": "YulFunctionCall", + "src": "3256:23:70" + }, + { + "kind": "number", + "nativeSrc": "3281:2:70", + "nodeType": "YulLiteral", + "src": "3281:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "slt", + "nativeSrc": "3252:3:70", + "nodeType": "YulIdentifier", + "src": "3252:3:70" + }, + "nativeSrc": "3252:32:70", + "nodeType": "YulFunctionCall", + "src": "3252:32:70" + }, + "nativeSrc": "3249:52:70", + "nodeType": "YulIf", + "src": "3249:52:70" + }, + { + "nativeSrc": "3310:36:70", + "nodeType": "YulVariableDeclaration", + "src": "3310:36:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "3336:9:70", + "nodeType": "YulIdentifier", + "src": "3336:9:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "3323:12:70", + "nodeType": "YulIdentifier", + "src": "3323:12:70" + }, + "nativeSrc": "3323:23:70", + "nodeType": "YulFunctionCall", + "src": "3323:23:70" + }, + "variables": [ + { + "name": "value", + "nativeSrc": "3314:5:70", + "nodeType": "YulTypedName", + "src": "3314:5:70", + "type": "" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "value", + "nativeSrc": "3380:5:70", + "nodeType": "YulIdentifier", + "src": "3380:5:70" + } + ], + "functionName": { + "name": "validator_revert_address", + "nativeSrc": "3355:24:70", + "nodeType": "YulIdentifier", + "src": "3355:24:70" + }, + "nativeSrc": "3355:31:70", + "nodeType": "YulFunctionCall", + "src": "3355:31:70" + }, + "nativeSrc": "3355:31:70", + "nodeType": "YulExpressionStatement", + "src": "3355:31:70" + }, + { + "nativeSrc": "3395:15:70", + "nodeType": "YulAssignment", + "src": "3395:15:70", + "value": { + "name": "value", + "nativeSrc": "3405:5:70", + "nodeType": "YulIdentifier", + "src": "3405:5:70" + }, + "variableNames": [ + { + "name": "value0", + "nativeSrc": "3395:6:70", + "nodeType": "YulIdentifier", + "src": "3395:6:70" + } + ] + }, + { + "nativeSrc": "3419:46:70", + "nodeType": "YulVariableDeclaration", + "src": "3419:46:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "3450:9:70", + "nodeType": "YulIdentifier", + "src": "3450:9:70" + }, + { + "kind": "number", + "nativeSrc": "3461:2:70", + "nodeType": "YulLiteral", + "src": "3461:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "3446:3:70", + "nodeType": "YulIdentifier", + "src": "3446:3:70" + }, + "nativeSrc": "3446:18:70", + "nodeType": "YulFunctionCall", + "src": "3446:18:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "3433:12:70", + "nodeType": "YulIdentifier", + "src": "3433:12:70" + }, + "nativeSrc": "3433:32:70", + "nodeType": "YulFunctionCall", + "src": "3433:32:70" + }, + "variables": [ + { + "name": "offset", + "nativeSrc": "3423:6:70", + "nodeType": "YulTypedName", + "src": "3423:6:70", + "type": "" + } + ] + }, + { + "body": { + "nativeSrc": "3508:16:70", + "nodeType": "YulBlock", + "src": "3508:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "3517:1:70", + "nodeType": "YulLiteral", + "src": "3517:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "3520:1:70", + "nodeType": "YulLiteral", + "src": "3520:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "3510:6:70", + "nodeType": "YulIdentifier", + "src": "3510:6:70" + }, + "nativeSrc": "3510:12:70", + "nodeType": "YulFunctionCall", + "src": "3510:12:70" + }, + "nativeSrc": "3510:12:70", + "nodeType": "YulExpressionStatement", + "src": "3510:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "name": "offset", + "nativeSrc": "3480:6:70", + "nodeType": "YulIdentifier", + "src": "3480:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "3496:2:70", + "nodeType": "YulLiteral", + "src": "3496:2:70", + "type": "", + "value": "64" + }, + { + "kind": "number", + "nativeSrc": "3500:1:70", + "nodeType": "YulLiteral", + "src": "3500:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "3492:3:70", + "nodeType": "YulIdentifier", + "src": "3492:3:70" + }, + "nativeSrc": "3492:10:70", + "nodeType": "YulFunctionCall", + "src": "3492:10:70" + }, + { + "kind": "number", + "nativeSrc": "3504:1:70", + "nodeType": "YulLiteral", + "src": "3504:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "3488:3:70", + "nodeType": "YulIdentifier", + "src": "3488:3:70" + }, + "nativeSrc": "3488:18:70", + "nodeType": "YulFunctionCall", + "src": "3488:18:70" + } + ], + "functionName": { + "name": "gt", + "nativeSrc": "3477:2:70", + "nodeType": "YulIdentifier", + "src": "3477:2:70" + }, + "nativeSrc": "3477:30:70", + "nodeType": "YulFunctionCall", + "src": "3477:30:70" + }, + "nativeSrc": "3474:50:70", + "nodeType": "YulIf", + "src": "3474:50:70" + }, + { + "nativeSrc": "3533:84:70", + "nodeType": "YulVariableDeclaration", + "src": "3533:84:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "3589:9:70", + "nodeType": "YulIdentifier", + "src": "3589:9:70" + }, + { + "name": "offset", + "nativeSrc": "3600:6:70", + "nodeType": "YulIdentifier", + "src": "3600:6:70" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "3585:3:70", + "nodeType": "YulIdentifier", + "src": "3585:3:70" + }, + "nativeSrc": "3585:22:70", + "nodeType": "YulFunctionCall", + "src": "3585:22:70" + }, + { + "name": "dataEnd", + "nativeSrc": "3609:7:70", + "nodeType": "YulIdentifier", + "src": "3609:7:70" + } + ], + "functionName": { + "name": "abi_decode_bytes_calldata", + "nativeSrc": "3559:25:70", + "nodeType": "YulIdentifier", + "src": "3559:25:70" + }, + "nativeSrc": "3559:58:70", + "nodeType": "YulFunctionCall", + "src": "3559:58:70" + }, + "variables": [ + { + "name": "value1_1", + "nativeSrc": "3537:8:70", + "nodeType": "YulTypedName", + "src": "3537:8:70", + "type": "" + }, + { + "name": "value2_1", + "nativeSrc": "3547:8:70", + "nodeType": "YulTypedName", + "src": "3547:8:70", + "type": "" + } + ] + }, + { + "nativeSrc": "3626:18:70", + "nodeType": "YulAssignment", + "src": "3626:18:70", + "value": { + "name": "value1_1", + "nativeSrc": "3636:8:70", + "nodeType": "YulIdentifier", + "src": "3636:8:70" + }, + "variableNames": [ + { + "name": "value1", + "nativeSrc": "3626:6:70", + "nodeType": "YulIdentifier", + "src": "3626:6:70" + } + ] + }, + { + "nativeSrc": "3653:18:70", + "nodeType": "YulAssignment", + "src": "3653:18:70", + "value": { + "name": "value2_1", + "nativeSrc": "3663:8:70", + "nodeType": "YulIdentifier", + "src": "3663:8:70" + }, + "variableNames": [ + { + "name": "value2", + "nativeSrc": "3653:6:70", + "nodeType": "YulIdentifier", + "src": "3653:6:70" + } + ] + } + ] + }, + "name": "abi_decode_tuple_t_addresst_bytes_calldata_ptr", + "nativeSrc": "3133:544:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "3189:9:70", + "nodeType": "YulTypedName", + "src": "3189:9:70", + "type": "" + }, + { + "name": "dataEnd", + "nativeSrc": "3200:7:70", + "nodeType": "YulTypedName", + "src": "3200:7:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value0", + "nativeSrc": "3212:6:70", + "nodeType": "YulTypedName", + "src": "3212:6:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "3220:6:70", + "nodeType": "YulTypedName", + "src": "3220:6:70", + "type": "" + }, + { + "name": "value2", + "nativeSrc": "3228:6:70", + "nodeType": "YulTypedName", + "src": "3228:6:70", + "type": "" + } + ], + "src": "3133:544:70" + }, + { + "body": { + "nativeSrc": "3724:76:70", + "nodeType": "YulBlock", + "src": "3724:76:70", + "statements": [ + { + "body": { + "nativeSrc": "3778:16:70", + "nodeType": "YulBlock", + "src": "3778:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "3787:1:70", + "nodeType": "YulLiteral", + "src": "3787:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "3790:1:70", + "nodeType": "YulLiteral", + "src": "3790:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "3780:6:70", + "nodeType": "YulIdentifier", + "src": "3780:6:70" + }, + "nativeSrc": "3780:12:70", + "nodeType": "YulFunctionCall", + "src": "3780:12:70" + }, + "nativeSrc": "3780:12:70", + "nodeType": "YulExpressionStatement", + "src": "3780:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "value", + "nativeSrc": "3747:5:70", + "nodeType": "YulIdentifier", + "src": "3747:5:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "name": "value", + "nativeSrc": "3768:5:70", + "nodeType": "YulIdentifier", + "src": "3768:5:70" + } + ], + "functionName": { + "name": "iszero", + "nativeSrc": "3761:6:70", + "nodeType": "YulIdentifier", + "src": "3761:6:70" + }, + "nativeSrc": "3761:13:70", + "nodeType": "YulFunctionCall", + "src": "3761:13:70" + } + ], + "functionName": { + "name": "iszero", + "nativeSrc": "3754:6:70", + "nodeType": "YulIdentifier", + "src": "3754:6:70" + }, + "nativeSrc": "3754:21:70", + "nodeType": "YulFunctionCall", + "src": "3754:21:70" + } + ], + "functionName": { + "name": "eq", + "nativeSrc": "3744:2:70", + "nodeType": "YulIdentifier", + "src": "3744:2:70" + }, + "nativeSrc": "3744:32:70", + "nodeType": "YulFunctionCall", + "src": "3744:32:70" + } + ], + "functionName": { + "name": "iszero", + "nativeSrc": "3737:6:70", + "nodeType": "YulIdentifier", + "src": "3737:6:70" + }, + "nativeSrc": "3737:40:70", + "nodeType": "YulFunctionCall", + "src": "3737:40:70" + }, + "nativeSrc": "3734:60:70", + "nodeType": "YulIf", + "src": "3734:60:70" + } + ] + }, + "name": "validator_revert_bool", + "nativeSrc": "3682:118:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "value", + "nativeSrc": "3713:5:70", + "nodeType": "YulTypedName", + "src": "3713:5:70", + "type": "" + } + ], + "src": "3682:118:70" + }, + { + "body": { + "nativeSrc": "3889:298:70", + "nodeType": "YulBlock", + "src": "3889:298:70", + "statements": [ + { + "body": { + "nativeSrc": "3935:16:70", + "nodeType": "YulBlock", + "src": "3935:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "3944:1:70", + "nodeType": "YulLiteral", + "src": "3944:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "3947:1:70", + "nodeType": "YulLiteral", + "src": "3947:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "3937:6:70", + "nodeType": "YulIdentifier", + "src": "3937:6:70" + }, + "nativeSrc": "3937:12:70", + "nodeType": "YulFunctionCall", + "src": "3937:12:70" + }, + "nativeSrc": "3937:12:70", + "nodeType": "YulExpressionStatement", + "src": "3937:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "dataEnd", + "nativeSrc": "3910:7:70", + "nodeType": "YulIdentifier", + "src": "3910:7:70" + }, + { + "name": "headStart", + "nativeSrc": "3919:9:70", + "nodeType": "YulIdentifier", + "src": "3919:9:70" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "3906:3:70", + "nodeType": "YulIdentifier", + "src": "3906:3:70" + }, + "nativeSrc": "3906:23:70", + "nodeType": "YulFunctionCall", + "src": "3906:23:70" + }, + { + "kind": "number", + "nativeSrc": "3931:2:70", + "nodeType": "YulLiteral", + "src": "3931:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "slt", + "nativeSrc": "3902:3:70", + "nodeType": "YulIdentifier", + "src": "3902:3:70" + }, + "nativeSrc": "3902:32:70", + "nodeType": "YulFunctionCall", + "src": "3902:32:70" + }, + "nativeSrc": "3899:52:70", + "nodeType": "YulIf", + "src": "3899:52:70" + }, + { + "nativeSrc": "3960:36:70", + "nodeType": "YulVariableDeclaration", + "src": "3960:36:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "3986:9:70", + "nodeType": "YulIdentifier", + "src": "3986:9:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "3973:12:70", + "nodeType": "YulIdentifier", + "src": "3973:12:70" + }, + "nativeSrc": "3973:23:70", + "nodeType": "YulFunctionCall", + "src": "3973:23:70" + }, + "variables": [ + { + "name": "value", + "nativeSrc": "3964:5:70", + "nodeType": "YulTypedName", + "src": "3964:5:70", + "type": "" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "value", + "nativeSrc": "4030:5:70", + "nodeType": "YulIdentifier", + "src": "4030:5:70" + } + ], + "functionName": { + "name": "validator_revert_address", + "nativeSrc": "4005:24:70", + "nodeType": "YulIdentifier", + "src": "4005:24:70" + }, + "nativeSrc": "4005:31:70", + "nodeType": "YulFunctionCall", + "src": "4005:31:70" + }, + "nativeSrc": "4005:31:70", + "nodeType": "YulExpressionStatement", + "src": "4005:31:70" + }, + { + "nativeSrc": "4045:15:70", + "nodeType": "YulAssignment", + "src": "4045:15:70", + "value": { + "name": "value", + "nativeSrc": "4055:5:70", + "nodeType": "YulIdentifier", + "src": "4055:5:70" + }, + "variableNames": [ + { + "name": "value0", + "nativeSrc": "4045:6:70", + "nodeType": "YulIdentifier", + "src": "4045:6:70" + } + ] + }, + { + "nativeSrc": "4069:47:70", + "nodeType": "YulVariableDeclaration", + "src": "4069:47:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "4101:9:70", + "nodeType": "YulIdentifier", + "src": "4101:9:70" + }, + { + "kind": "number", + "nativeSrc": "4112:2:70", + "nodeType": "YulLiteral", + "src": "4112:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "4097:3:70", + "nodeType": "YulIdentifier", + "src": "4097:3:70" + }, + "nativeSrc": "4097:18:70", + "nodeType": "YulFunctionCall", + "src": "4097:18:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "4084:12:70", + "nodeType": "YulIdentifier", + "src": "4084:12:70" + }, + "nativeSrc": "4084:32:70", + "nodeType": "YulFunctionCall", + "src": "4084:32:70" + }, + "variables": [ + { + "name": "value_1", + "nativeSrc": "4073:7:70", + "nodeType": "YulTypedName", + "src": "4073:7:70", + "type": "" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "value_1", + "nativeSrc": "4147:7:70", + "nodeType": "YulIdentifier", + "src": "4147:7:70" + } + ], + "functionName": { + "name": "validator_revert_bool", + "nativeSrc": "4125:21:70", + "nodeType": "YulIdentifier", + "src": "4125:21:70" + }, + "nativeSrc": "4125:30:70", + "nodeType": "YulFunctionCall", + "src": "4125:30:70" + }, + "nativeSrc": "4125:30:70", + "nodeType": "YulExpressionStatement", + "src": "4125:30:70" + }, + { + "nativeSrc": "4164:17:70", + "nodeType": "YulAssignment", + "src": "4164:17:70", + "value": { + "name": "value_1", + "nativeSrc": "4174:7:70", + "nodeType": "YulIdentifier", + "src": "4174:7:70" + }, + "variableNames": [ + { + "name": "value1", + "nativeSrc": "4164:6:70", + "nodeType": "YulIdentifier", + "src": "4164:6:70" + } + ] + } + ] + }, + "name": "abi_decode_tuple_t_addresst_bool", + "nativeSrc": "3805:382:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "3847:9:70", + "nodeType": "YulTypedName", + "src": "3847:9:70", + "type": "" + }, + { + "name": "dataEnd", + "nativeSrc": "3858:7:70", + "nodeType": "YulTypedName", + "src": "3858:7:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value0", + "nativeSrc": "3870:6:70", + "nodeType": "YulTypedName", + "src": "3870:6:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "3878:6:70", + "nodeType": "YulTypedName", + "src": "3878:6:70", + "type": "" + } + ], + "src": "3805:382:70" + }, + { + "body": { + "nativeSrc": "4262:156:70", + "nodeType": "YulBlock", + "src": "4262:156:70", + "statements": [ + { + "body": { + "nativeSrc": "4308:16:70", + "nodeType": "YulBlock", + "src": "4308:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "4317:1:70", + "nodeType": "YulLiteral", + "src": "4317:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "4320:1:70", + "nodeType": "YulLiteral", + "src": "4320:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "4310:6:70", + "nodeType": "YulIdentifier", + "src": "4310:6:70" + }, + "nativeSrc": "4310:12:70", + "nodeType": "YulFunctionCall", + "src": "4310:12:70" + }, + "nativeSrc": "4310:12:70", + "nodeType": "YulExpressionStatement", + "src": "4310:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "dataEnd", + "nativeSrc": "4283:7:70", + "nodeType": "YulIdentifier", + "src": "4283:7:70" + }, + { + "name": "headStart", + "nativeSrc": "4292:9:70", + "nodeType": "YulIdentifier", + "src": "4292:9:70" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "4279:3:70", + "nodeType": "YulIdentifier", + "src": "4279:3:70" + }, + "nativeSrc": "4279:23:70", + "nodeType": "YulFunctionCall", + "src": "4279:23:70" + }, + { + "kind": "number", + "nativeSrc": "4304:2:70", + "nodeType": "YulLiteral", + "src": "4304:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "slt", + "nativeSrc": "4275:3:70", + "nodeType": "YulIdentifier", + "src": "4275:3:70" + }, + "nativeSrc": "4275:32:70", + "nodeType": "YulFunctionCall", + "src": "4275:32:70" + }, + "nativeSrc": "4272:52:70", + "nodeType": "YulIf", + "src": "4272:52:70" + }, + { + "nativeSrc": "4333:14:70", + "nodeType": "YulVariableDeclaration", + "src": "4333:14:70", + "value": { + "kind": "number", + "nativeSrc": "4346:1:70", + "nodeType": "YulLiteral", + "src": "4346:1:70", + "type": "", + "value": "0" + }, + "variables": [ + { + "name": "value", + "nativeSrc": "4337:5:70", + "nodeType": "YulTypedName", + "src": "4337:5:70", + "type": "" + } + ] + }, + { + "nativeSrc": "4356:32:70", + "nodeType": "YulAssignment", + "src": "4356:32:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "4378:9:70", + "nodeType": "YulIdentifier", + "src": "4378:9:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "4365:12:70", + "nodeType": "YulIdentifier", + "src": "4365:12:70" + }, + "nativeSrc": "4365:23:70", + "nodeType": "YulFunctionCall", + "src": "4365:23:70" + }, + "variableNames": [ + { + "name": "value", + "nativeSrc": "4356:5:70", + "nodeType": "YulIdentifier", + "src": "4356:5:70" + } + ] + }, + { + "nativeSrc": "4397:15:70", + "nodeType": "YulAssignment", + "src": "4397:15:70", + "value": { + "name": "value", + "nativeSrc": "4407:5:70", + "nodeType": "YulIdentifier", + "src": "4407:5:70" + }, + "variableNames": [ + { + "name": "value0", + "nativeSrc": "4397:6:70", + "nodeType": "YulIdentifier", + "src": "4397:6:70" + } + ] + } + ] + }, + "name": "abi_decode_tuple_t_uint256", + "nativeSrc": "4192:226:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "4228:9:70", + "nodeType": "YulTypedName", + "src": "4228:9:70", + "type": "" + }, + { + "name": "dataEnd", + "nativeSrc": "4239:7:70", + "nodeType": "YulTypedName", + "src": "4239:7:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value0", + "nativeSrc": "4251:6:70", + "nodeType": "YulTypedName", + "src": "4251:6:70", + "type": "" + } + ], + "src": "4192:226:70" + }, + { + "body": { + "nativeSrc": "4548:153:70", + "nodeType": "YulBlock", + "src": "4548:153:70", + "statements": [ + { + "nativeSrc": "4558:26:70", + "nodeType": "YulAssignment", + "src": "4558:26:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "4570:9:70", + "nodeType": "YulIdentifier", + "src": "4570:9:70" + }, + { + "kind": "number", + "nativeSrc": "4581:2:70", + "nodeType": "YulLiteral", + "src": "4581:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "4566:3:70", + "nodeType": "YulIdentifier", + "src": "4566:3:70" + }, + "nativeSrc": "4566:18:70", + "nodeType": "YulFunctionCall", + "src": "4566:18:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "4558:4:70", + "nodeType": "YulIdentifier", + "src": "4558:4:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "4600:9:70", + "nodeType": "YulIdentifier", + "src": "4600:9:70" + }, + { + "arguments": [ + { + "name": "value0", + "nativeSrc": "4615:6:70", + "nodeType": "YulIdentifier", + "src": "4615:6:70" + }, + { + "kind": "number", + "nativeSrc": "4623:10:70", + "nodeType": "YulLiteral", + "src": "4623:10:70", + "type": "", + "value": "0xffffffff" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "4611:3:70", + "nodeType": "YulIdentifier", + "src": "4611:3:70" + }, + "nativeSrc": "4611:23:70", + "nodeType": "YulFunctionCall", + "src": "4611:23:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "4593:6:70", + "nodeType": "YulIdentifier", + "src": "4593:6:70" + }, + "nativeSrc": "4593:42:70", + "nodeType": "YulFunctionCall", + "src": "4593:42:70" + }, + "nativeSrc": "4593:42:70", + "nodeType": "YulExpressionStatement", + "src": "4593:42:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "4655:9:70", + "nodeType": "YulIdentifier", + "src": "4655:9:70" + }, + { + "kind": "number", + "nativeSrc": "4666:2:70", + "nodeType": "YulLiteral", + "src": "4666:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "4651:3:70", + "nodeType": "YulIdentifier", + "src": "4651:3:70" + }, + "nativeSrc": "4651:18:70", + "nodeType": "YulFunctionCall", + "src": "4651:18:70" + }, + { + "arguments": [ + { + "name": "value1", + "nativeSrc": "4675:6:70", + "nodeType": "YulIdentifier", + "src": "4675:6:70" + }, + { + "kind": "number", + "nativeSrc": "4683:10:70", + "nodeType": "YulLiteral", + "src": "4683:10:70", + "type": "", + "value": "0xffffffff" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "4671:3:70", + "nodeType": "YulIdentifier", + "src": "4671:3:70" + }, + "nativeSrc": "4671:23:70", + "nodeType": "YulFunctionCall", + "src": "4671:23:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "4644:6:70", + "nodeType": "YulIdentifier", + "src": "4644:6:70" + }, + "nativeSrc": "4644:51:70", + "nodeType": "YulFunctionCall", + "src": "4644:51:70" + }, + "nativeSrc": "4644:51:70", + "nodeType": "YulExpressionStatement", + "src": "4644:51:70" + } + ] + }, + "name": "abi_encode_tuple_t_uint32_t_uint32__to_t_uint32_t_uint32__fromStack_reversed", + "nativeSrc": "4423:278:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "4509:9:70", + "nodeType": "YulTypedName", + "src": "4509:9:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "4520:6:70", + "nodeType": "YulTypedName", + "src": "4520:6:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "4528:6:70", + "nodeType": "YulTypedName", + "src": "4528:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "4539:4:70", + "nodeType": "YulTypedName", + "src": "4539:4:70", + "type": "" + } + ], + "src": "4423:278:70" + }, + { + "body": { + "nativeSrc": "4772:184:70", + "nodeType": "YulBlock", + "src": "4772:184:70", + "statements": [ + { + "nativeSrc": "4782:10:70", + "nodeType": "YulVariableDeclaration", + "src": "4782:10:70", + "value": { + "kind": "number", + "nativeSrc": "4791:1:70", + "nodeType": "YulLiteral", + "src": "4791:1:70", + "type": "", + "value": "0" + }, + "variables": [ + { + "name": "i", + "nativeSrc": "4786:1:70", + "nodeType": "YulTypedName", + "src": "4786:1:70", + "type": "" + } + ] + }, + { + "body": { + "nativeSrc": "4851:63:70", + "nodeType": "YulBlock", + "src": "4851:63:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "dst", + "nativeSrc": "4876:3:70", + "nodeType": "YulIdentifier", + "src": "4876:3:70" + }, + { + "name": "i", + "nativeSrc": "4881:1:70", + "nodeType": "YulIdentifier", + "src": "4881:1:70" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "4872:3:70", + "nodeType": "YulIdentifier", + "src": "4872:3:70" + }, + "nativeSrc": "4872:11:70", + "nodeType": "YulFunctionCall", + "src": "4872:11:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "name": "src", + "nativeSrc": "4895:3:70", + "nodeType": "YulIdentifier", + "src": "4895:3:70" + }, + { + "name": "i", + "nativeSrc": "4900:1:70", + "nodeType": "YulIdentifier", + "src": "4900:1:70" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "4891:3:70", + "nodeType": "YulIdentifier", + "src": "4891:3:70" + }, + "nativeSrc": "4891:11:70", + "nodeType": "YulFunctionCall", + "src": "4891:11:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "4885:5:70", + "nodeType": "YulIdentifier", + "src": "4885:5:70" + }, + "nativeSrc": "4885:18:70", + "nodeType": "YulFunctionCall", + "src": "4885:18:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "4865:6:70", + "nodeType": "YulIdentifier", + "src": "4865:6:70" + }, + "nativeSrc": "4865:39:70", + "nodeType": "YulFunctionCall", + "src": "4865:39:70" + }, + "nativeSrc": "4865:39:70", + "nodeType": "YulExpressionStatement", + "src": "4865:39:70" + } + ] + }, + "condition": { + "arguments": [ + { + "name": "i", + "nativeSrc": "4812:1:70", + "nodeType": "YulIdentifier", + "src": "4812:1:70" + }, + { + "name": "length", + "nativeSrc": "4815:6:70", + "nodeType": "YulIdentifier", + "src": "4815:6:70" + } + ], + "functionName": { + "name": "lt", + "nativeSrc": "4809:2:70", + "nodeType": "YulIdentifier", + "src": "4809:2:70" + }, + "nativeSrc": "4809:13:70", + "nodeType": "YulFunctionCall", + "src": "4809:13:70" + }, + "nativeSrc": "4801:113:70", + "nodeType": "YulForLoop", + "post": { + "nativeSrc": "4823:19:70", + "nodeType": "YulBlock", + "src": "4823:19:70", + "statements": [ + { + "nativeSrc": "4825:15:70", + "nodeType": "YulAssignment", + "src": "4825:15:70", + "value": { + "arguments": [ + { + "name": "i", + "nativeSrc": "4834:1:70", + "nodeType": "YulIdentifier", + "src": "4834:1:70" + }, + { + "kind": "number", + "nativeSrc": "4837:2:70", + "nodeType": "YulLiteral", + "src": "4837:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "4830:3:70", + "nodeType": "YulIdentifier", + "src": "4830:3:70" + }, + "nativeSrc": "4830:10:70", + "nodeType": "YulFunctionCall", + "src": "4830:10:70" + }, + "variableNames": [ + { + "name": "i", + "nativeSrc": "4825:1:70", + "nodeType": "YulIdentifier", + "src": "4825:1:70" + } + ] + } + ] + }, + "pre": { + "nativeSrc": "4805:3:70", + "nodeType": "YulBlock", + "src": "4805:3:70", + "statements": [] + }, + "src": "4801:113:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "dst", + "nativeSrc": "4934:3:70", + "nodeType": "YulIdentifier", + "src": "4934:3:70" + }, + { + "name": "length", + "nativeSrc": "4939:6:70", + "nodeType": "YulIdentifier", + "src": "4939:6:70" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "4930:3:70", + "nodeType": "YulIdentifier", + "src": "4930:3:70" + }, + "nativeSrc": "4930:16:70", + "nodeType": "YulFunctionCall", + "src": "4930:16:70" + }, + { + "kind": "number", + "nativeSrc": "4948:1:70", + "nodeType": "YulLiteral", + "src": "4948:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "4923:6:70", + "nodeType": "YulIdentifier", + "src": "4923:6:70" + }, + "nativeSrc": "4923:27:70", + "nodeType": "YulFunctionCall", + "src": "4923:27:70" + }, + "nativeSrc": "4923:27:70", + "nodeType": "YulExpressionStatement", + "src": "4923:27:70" + } + ] + }, + "name": "copy_memory_to_memory_with_cleanup", + "nativeSrc": "4706:250:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "src", + "nativeSrc": "4750:3:70", + "nodeType": "YulTypedName", + "src": "4750:3:70", + "type": "" + }, + { + "name": "dst", + "nativeSrc": "4755:3:70", + "nodeType": "YulTypedName", + "src": "4755:3:70", + "type": "" + }, + { + "name": "length", + "nativeSrc": "4760:6:70", + "nodeType": "YulTypedName", + "src": "4760:6:70", + "type": "" + } + ], + "src": "4706:250:70" + }, + { + "body": { + "nativeSrc": "5011:221:70", + "nodeType": "YulBlock", + "src": "5011:221:70", + "statements": [ + { + "nativeSrc": "5021:26:70", + "nodeType": "YulVariableDeclaration", + "src": "5021:26:70", + "value": { + "arguments": [ + { + "name": "value", + "nativeSrc": "5041:5:70", + "nodeType": "YulIdentifier", + "src": "5041:5:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "5035:5:70", + "nodeType": "YulIdentifier", + "src": "5035:5:70" + }, + "nativeSrc": "5035:12:70", + "nodeType": "YulFunctionCall", + "src": "5035:12:70" + }, + "variables": [ + { + "name": "length", + "nativeSrc": "5025:6:70", + "nodeType": "YulTypedName", + "src": "5025:6:70", + "type": "" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "pos", + "nativeSrc": "5063:3:70", + "nodeType": "YulIdentifier", + "src": "5063:3:70" + }, + { + "name": "length", + "nativeSrc": "5068:6:70", + "nodeType": "YulIdentifier", + "src": "5068:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "5056:6:70", + "nodeType": "YulIdentifier", + "src": "5056:6:70" + }, + "nativeSrc": "5056:19:70", + "nodeType": "YulFunctionCall", + "src": "5056:19:70" + }, + "nativeSrc": "5056:19:70", + "nodeType": "YulExpressionStatement", + "src": "5056:19:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "value", + "nativeSrc": "5123:5:70", + "nodeType": "YulIdentifier", + "src": "5123:5:70" + }, + { + "kind": "number", + "nativeSrc": "5130:4:70", + "nodeType": "YulLiteral", + "src": "5130:4:70", + "type": "", + "value": "0x20" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "5119:3:70", + "nodeType": "YulIdentifier", + "src": "5119:3:70" + }, + "nativeSrc": "5119:16:70", + "nodeType": "YulFunctionCall", + "src": "5119:16:70" + }, + { + "arguments": [ + { + "name": "pos", + "nativeSrc": "5141:3:70", + "nodeType": "YulIdentifier", + "src": "5141:3:70" + }, + { + "kind": "number", + "nativeSrc": "5146:4:70", + "nodeType": "YulLiteral", + "src": "5146:4:70", + "type": "", + "value": "0x20" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "5137:3:70", + "nodeType": "YulIdentifier", + "src": "5137:3:70" + }, + "nativeSrc": "5137:14:70", + "nodeType": "YulFunctionCall", + "src": "5137:14:70" + }, + { + "name": "length", + "nativeSrc": "5153:6:70", + "nodeType": "YulIdentifier", + "src": "5153:6:70" + } + ], + "functionName": { + "name": "copy_memory_to_memory_with_cleanup", + "nativeSrc": "5084:34:70", + "nodeType": "YulIdentifier", + "src": "5084:34:70" + }, + "nativeSrc": "5084:76:70", + "nodeType": "YulFunctionCall", + "src": "5084:76:70" + }, + "nativeSrc": "5084:76:70", + "nodeType": "YulExpressionStatement", + "src": "5084:76:70" + }, + { + "nativeSrc": "5169:57:70", + "nodeType": "YulAssignment", + "src": "5169:57:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "pos", + "nativeSrc": "5184:3:70", + "nodeType": "YulIdentifier", + "src": "5184:3:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "name": "length", + "nativeSrc": "5197:6:70", + "nodeType": "YulIdentifier", + "src": "5197:6:70" + }, + { + "kind": "number", + "nativeSrc": "5205:2:70", + "nodeType": "YulLiteral", + "src": "5205:2:70", + "type": "", + "value": "31" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "5193:3:70", + "nodeType": "YulIdentifier", + "src": "5193:3:70" + }, + "nativeSrc": "5193:15:70", + "nodeType": "YulFunctionCall", + "src": "5193:15:70" + }, + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "5214:2:70", + "nodeType": "YulLiteral", + "src": "5214:2:70", + "type": "", + "value": "31" + } + ], + "functionName": { + "name": "not", + "nativeSrc": "5210:3:70", + "nodeType": "YulIdentifier", + "src": "5210:3:70" + }, + "nativeSrc": "5210:7:70", + "nodeType": "YulFunctionCall", + "src": "5210:7:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "5189:3:70", + "nodeType": "YulIdentifier", + "src": "5189:3:70" + }, + "nativeSrc": "5189:29:70", + "nodeType": "YulFunctionCall", + "src": "5189:29:70" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "5180:3:70", + "nodeType": "YulIdentifier", + "src": "5180:3:70" + }, + "nativeSrc": "5180:39:70", + "nodeType": "YulFunctionCall", + "src": "5180:39:70" + }, + { + "kind": "number", + "nativeSrc": "5221:4:70", + "nodeType": "YulLiteral", + "src": "5221:4:70", + "type": "", + "value": "0x20" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "5176:3:70", + "nodeType": "YulIdentifier", + "src": "5176:3:70" + }, + "nativeSrc": "5176:50:70", + "nodeType": "YulFunctionCall", + "src": "5176:50:70" + }, + "variableNames": [ + { + "name": "end", + "nativeSrc": "5169:3:70", + "nodeType": "YulIdentifier", + "src": "5169:3:70" + } + ] + } + ] + }, + "name": "abi_encode_string", + "nativeSrc": "4961:271:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "value", + "nativeSrc": "4988:5:70", + "nodeType": "YulTypedName", + "src": "4988:5:70", + "type": "" + }, + { + "name": "pos", + "nativeSrc": "4995:3:70", + "nodeType": "YulTypedName", + "src": "4995:3:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "end", + "nativeSrc": "5003:3:70", + "nodeType": "YulTypedName", + "src": "5003:3:70", + "type": "" + } + ], + "src": "4961:271:70" + }, + { + "body": { + "nativeSrc": "5434:257:70", + "nodeType": "YulBlock", + "src": "5434:257:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "5451:9:70", + "nodeType": "YulIdentifier", + "src": "5451:9:70" + }, + { + "name": "value0", + "nativeSrc": "5462:6:70", + "nodeType": "YulIdentifier", + "src": "5462:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "5444:6:70", + "nodeType": "YulIdentifier", + "src": "5444:6:70" + }, + "nativeSrc": "5444:25:70", + "nodeType": "YulFunctionCall", + "src": "5444:25:70" + }, + "nativeSrc": "5444:25:70", + "nodeType": "YulExpressionStatement", + "src": "5444:25:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "5489:9:70", + "nodeType": "YulIdentifier", + "src": "5489:9:70" + }, + { + "kind": "number", + "nativeSrc": "5500:2:70", + "nodeType": "YulLiteral", + "src": "5500:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "5485:3:70", + "nodeType": "YulIdentifier", + "src": "5485:3:70" + }, + "nativeSrc": "5485:18:70", + "nodeType": "YulFunctionCall", + "src": "5485:18:70" + }, + { + "kind": "number", + "nativeSrc": "5505:2:70", + "nodeType": "YulLiteral", + "src": "5505:2:70", + "type": "", + "value": "96" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "5478:6:70", + "nodeType": "YulIdentifier", + "src": "5478:6:70" + }, + "nativeSrc": "5478:30:70", + "nodeType": "YulFunctionCall", + "src": "5478:30:70" + }, + "nativeSrc": "5478:30:70", + "nodeType": "YulExpressionStatement", + "src": "5478:30:70" + }, + { + "nativeSrc": "5517:59:70", + "nodeType": "YulVariableDeclaration", + "src": "5517:59:70", + "value": { + "arguments": [ + { + "name": "value1", + "nativeSrc": "5549:6:70", + "nodeType": "YulIdentifier", + "src": "5549:6:70" + }, + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "5561:9:70", + "nodeType": "YulIdentifier", + "src": "5561:9:70" + }, + { + "kind": "number", + "nativeSrc": "5572:2:70", + "nodeType": "YulLiteral", + "src": "5572:2:70", + "type": "", + "value": "96" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "5557:3:70", + "nodeType": "YulIdentifier", + "src": "5557:3:70" + }, + "nativeSrc": "5557:18:70", + "nodeType": "YulFunctionCall", + "src": "5557:18:70" + } + ], + "functionName": { + "name": "abi_encode_string", + "nativeSrc": "5531:17:70", + "nodeType": "YulIdentifier", + "src": "5531:17:70" + }, + "nativeSrc": "5531:45:70", + "nodeType": "YulFunctionCall", + "src": "5531:45:70" + }, + "variables": [ + { + "name": "tail_1", + "nativeSrc": "5521:6:70", + "nodeType": "YulTypedName", + "src": "5521:6:70", + "type": "" + } + ] + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "5596:9:70", + "nodeType": "YulIdentifier", + "src": "5596:9:70" + }, + { + "kind": "number", + "nativeSrc": "5607:2:70", + "nodeType": "YulLiteral", + "src": "5607:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "5592:3:70", + "nodeType": "YulIdentifier", + "src": "5592:3:70" + }, + "nativeSrc": "5592:18:70", + "nodeType": "YulFunctionCall", + "src": "5592:18:70" + }, + { + "arguments": [ + { + "name": "tail_1", + "nativeSrc": "5616:6:70", + "nodeType": "YulIdentifier", + "src": "5616:6:70" + }, + { + "name": "headStart", + "nativeSrc": "5624:9:70", + "nodeType": "YulIdentifier", + "src": "5624:9:70" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "5612:3:70", + "nodeType": "YulIdentifier", + "src": "5612:3:70" + }, + "nativeSrc": "5612:22:70", + "nodeType": "YulFunctionCall", + "src": "5612:22:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "5585:6:70", + "nodeType": "YulIdentifier", + "src": "5585:6:70" + }, + "nativeSrc": "5585:50:70", + "nodeType": "YulFunctionCall", + "src": "5585:50:70" + }, + "nativeSrc": "5585:50:70", + "nodeType": "YulExpressionStatement", + "src": "5585:50:70" + }, + { + "nativeSrc": "5644:41:70", + "nodeType": "YulAssignment", + "src": "5644:41:70", + "value": { + "arguments": [ + { + "name": "value2", + "nativeSrc": "5670:6:70", + "nodeType": "YulIdentifier", + "src": "5670:6:70" + }, + { + "name": "tail_1", + "nativeSrc": "5678:6:70", + "nodeType": "YulIdentifier", + "src": "5678:6:70" + } + ], + "functionName": { + "name": "abi_encode_string", + "nativeSrc": "5652:17:70", + "nodeType": "YulIdentifier", + "src": "5652:17:70" + }, + "nativeSrc": "5652:33:70", + "nodeType": "YulFunctionCall", + "src": "5652:33:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "5644:4:70", + "nodeType": "YulIdentifier", + "src": "5644:4:70" + } + ] + } + ] + }, + "name": "abi_encode_tuple_t_uint256_t_string_memory_ptr_t_string_memory_ptr__to_t_uint256_t_string_memory_ptr_t_string_memory_ptr__fromStack_reversed", + "nativeSrc": "5237:454:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "5387:9:70", + "nodeType": "YulTypedName", + "src": "5387:9:70", + "type": "" + }, + { + "name": "value2", + "nativeSrc": "5398:6:70", + "nodeType": "YulTypedName", + "src": "5398:6:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "5406:6:70", + "nodeType": "YulTypedName", + "src": "5406:6:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "5414:6:70", + "nodeType": "YulTypedName", + "src": "5414:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "5425:4:70", + "nodeType": "YulTypedName", + "src": "5425:4:70", + "type": "" + } + ], + "src": "5237:454:70" + }, + { + "body": { + "nativeSrc": "5931:336:70", + "nodeType": "YulBlock", + "src": "5931:336:70", + "statements": [ + { + "nativeSrc": "5941:27:70", + "nodeType": "YulAssignment", + "src": "5941:27:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "5953:9:70", + "nodeType": "YulIdentifier", + "src": "5953:9:70" + }, + { + "kind": "number", + "nativeSrc": "5964:3:70", + "nodeType": "YulLiteral", + "src": "5964:3:70", + "type": "", + "value": "192" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "5949:3:70", + "nodeType": "YulIdentifier", + "src": "5949:3:70" + }, + "nativeSrc": "5949:19:70", + "nodeType": "YulFunctionCall", + "src": "5949:19:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "5941:4:70", + "nodeType": "YulIdentifier", + "src": "5941:4:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "5984:9:70", + "nodeType": "YulIdentifier", + "src": "5984:9:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "name": "value0", + "nativeSrc": "6009:6:70", + "nodeType": "YulIdentifier", + "src": "6009:6:70" + } + ], + "functionName": { + "name": "iszero", + "nativeSrc": "6002:6:70", + "nodeType": "YulIdentifier", + "src": "6002:6:70" + }, + "nativeSrc": "6002:14:70", + "nodeType": "YulFunctionCall", + "src": "6002:14:70" + } + ], + "functionName": { + "name": "iszero", + "nativeSrc": "5995:6:70", + "nodeType": "YulIdentifier", + "src": "5995:6:70" + }, + "nativeSrc": "5995:22:70", + "nodeType": "YulFunctionCall", + "src": "5995:22:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "5977:6:70", + "nodeType": "YulIdentifier", + "src": "5977:6:70" + }, + "nativeSrc": "5977:41:70", + "nodeType": "YulFunctionCall", + "src": "5977:41:70" + }, + "nativeSrc": "5977:41:70", + "nodeType": "YulExpressionStatement", + "src": "5977:41:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "6038:9:70", + "nodeType": "YulIdentifier", + "src": "6038:9:70" + }, + { + "kind": "number", + "nativeSrc": "6049:2:70", + "nodeType": "YulLiteral", + "src": "6049:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "6034:3:70", + "nodeType": "YulIdentifier", + "src": "6034:3:70" + }, + "nativeSrc": "6034:18:70", + "nodeType": "YulFunctionCall", + "src": "6034:18:70" + }, + { + "arguments": [ + { + "name": "value1", + "nativeSrc": "6058:6:70", + "nodeType": "YulIdentifier", + "src": "6058:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "6074:3:70", + "nodeType": "YulLiteral", + "src": "6074:3:70", + "type": "", + "value": "160" + }, + { + "kind": "number", + "nativeSrc": "6079:1:70", + "nodeType": "YulLiteral", + "src": "6079:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "6070:3:70", + "nodeType": "YulIdentifier", + "src": "6070:3:70" + }, + "nativeSrc": "6070:11:70", + "nodeType": "YulFunctionCall", + "src": "6070:11:70" + }, + { + "kind": "number", + "nativeSrc": "6083:1:70", + "nodeType": "YulLiteral", + "src": "6083:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "6066:3:70", + "nodeType": "YulIdentifier", + "src": "6066:3:70" + }, + "nativeSrc": "6066:19:70", + "nodeType": "YulFunctionCall", + "src": "6066:19:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "6054:3:70", + "nodeType": "YulIdentifier", + "src": "6054:3:70" + }, + "nativeSrc": "6054:32:70", + "nodeType": "YulFunctionCall", + "src": "6054:32:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "6027:6:70", + "nodeType": "YulIdentifier", + "src": "6027:6:70" + }, + "nativeSrc": "6027:60:70", + "nodeType": "YulFunctionCall", + "src": "6027:60:70" + }, + "nativeSrc": "6027:60:70", + "nodeType": "YulExpressionStatement", + "src": "6027:60:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "6107:9:70", + "nodeType": "YulIdentifier", + "src": "6107:9:70" + }, + { + "kind": "number", + "nativeSrc": "6118:2:70", + "nodeType": "YulLiteral", + "src": "6118:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "6103:3:70", + "nodeType": "YulIdentifier", + "src": "6103:3:70" + }, + "nativeSrc": "6103:18:70", + "nodeType": "YulFunctionCall", + "src": "6103:18:70" + }, + { + "name": "value2", + "nativeSrc": "6123:6:70", + "nodeType": "YulIdentifier", + "src": "6123:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "6096:6:70", + "nodeType": "YulIdentifier", + "src": "6096:6:70" + }, + "nativeSrc": "6096:34:70", + "nodeType": "YulFunctionCall", + "src": "6096:34:70" + }, + "nativeSrc": "6096:34:70", + "nodeType": "YulExpressionStatement", + "src": "6096:34:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "6150:9:70", + "nodeType": "YulIdentifier", + "src": "6150:9:70" + }, + { + "kind": "number", + "nativeSrc": "6161:2:70", + "nodeType": "YulLiteral", + "src": "6161:2:70", + "type": "", + "value": "96" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "6146:3:70", + "nodeType": "YulIdentifier", + "src": "6146:3:70" + }, + "nativeSrc": "6146:18:70", + "nodeType": "YulFunctionCall", + "src": "6146:18:70" + }, + { + "name": "value3", + "nativeSrc": "6166:6:70", + "nodeType": "YulIdentifier", + "src": "6166:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "6139:6:70", + "nodeType": "YulIdentifier", + "src": "6139:6:70" + }, + "nativeSrc": "6139:34:70", + "nodeType": "YulFunctionCall", + "src": "6139:34:70" + }, + "nativeSrc": "6139:34:70", + "nodeType": "YulExpressionStatement", + "src": "6139:34:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "6193:9:70", + "nodeType": "YulIdentifier", + "src": "6193:9:70" + }, + { + "kind": "number", + "nativeSrc": "6204:3:70", + "nodeType": "YulLiteral", + "src": "6204:3:70", + "type": "", + "value": "128" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "6189:3:70", + "nodeType": "YulIdentifier", + "src": "6189:3:70" + }, + "nativeSrc": "6189:19:70", + "nodeType": "YulFunctionCall", + "src": "6189:19:70" + }, + { + "name": "value4", + "nativeSrc": "6210:6:70", + "nodeType": "YulIdentifier", + "src": "6210:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "6182:6:70", + "nodeType": "YulIdentifier", + "src": "6182:6:70" + }, + "nativeSrc": "6182:35:70", + "nodeType": "YulFunctionCall", + "src": "6182:35:70" + }, + "nativeSrc": "6182:35:70", + "nodeType": "YulExpressionStatement", + "src": "6182:35:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "6237:9:70", + "nodeType": "YulIdentifier", + "src": "6237:9:70" + }, + { + "kind": "number", + "nativeSrc": "6248:3:70", + "nodeType": "YulLiteral", + "src": "6248:3:70", + "type": "", + "value": "160" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "6233:3:70", + "nodeType": "YulIdentifier", + "src": "6233:3:70" + }, + "nativeSrc": "6233:19:70", + "nodeType": "YulFunctionCall", + "src": "6233:19:70" + }, + { + "name": "value5", + "nativeSrc": "6254:6:70", + "nodeType": "YulIdentifier", + "src": "6254:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "6226:6:70", + "nodeType": "YulIdentifier", + "src": "6226:6:70" + }, + "nativeSrc": "6226:35:70", + "nodeType": "YulFunctionCall", + "src": "6226:35:70" + }, + "nativeSrc": "6226:35:70", + "nodeType": "YulExpressionStatement", + "src": "6226:35:70" + } + ] + }, + "name": "abi_encode_tuple_t_bool_t_address_t_bytes32_t_uint256_t_uint256_t_uint256__to_t_bool_t_address_t_bytes32_t_uint256_t_uint256_t_uint256__fromStack_reversed", + "nativeSrc": "5696:571:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "5860:9:70", + "nodeType": "YulTypedName", + "src": "5860:9:70", + "type": "" + }, + { + "name": "value5", + "nativeSrc": "5871:6:70", + "nodeType": "YulTypedName", + "src": "5871:6:70", + "type": "" + }, + { + "name": "value4", + "nativeSrc": "5879:6:70", + "nodeType": "YulTypedName", + "src": "5879:6:70", + "type": "" + }, + { + "name": "value3", + "nativeSrc": "5887:6:70", + "nodeType": "YulTypedName", + "src": "5887:6:70", + "type": "" + }, + { + "name": "value2", + "nativeSrc": "5895:6:70", + "nodeType": "YulTypedName", + "src": "5895:6:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "5903:6:70", + "nodeType": "YulTypedName", + "src": "5903:6:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "5911:6:70", + "nodeType": "YulTypedName", + "src": "5911:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "5922:4:70", + "nodeType": "YulTypedName", + "src": "5922:4:70", + "type": "" + } + ], + "src": "5696:571:70" + }, + { + "body": { + "nativeSrc": "6367:92:70", + "nodeType": "YulBlock", + "src": "6367:92:70", + "statements": [ + { + "nativeSrc": "6377:26:70", + "nodeType": "YulAssignment", + "src": "6377:26:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "6389:9:70", + "nodeType": "YulIdentifier", + "src": "6389:9:70" + }, + { + "kind": "number", + "nativeSrc": "6400:2:70", + "nodeType": "YulLiteral", + "src": "6400:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "6385:3:70", + "nodeType": "YulIdentifier", + "src": "6385:3:70" + }, + "nativeSrc": "6385:18:70", + "nodeType": "YulFunctionCall", + "src": "6385:18:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "6377:4:70", + "nodeType": "YulIdentifier", + "src": "6377:4:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "6419:9:70", + "nodeType": "YulIdentifier", + "src": "6419:9:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "name": "value0", + "nativeSrc": "6444:6:70", + "nodeType": "YulIdentifier", + "src": "6444:6:70" + } + ], + "functionName": { + "name": "iszero", + "nativeSrc": "6437:6:70", + "nodeType": "YulIdentifier", + "src": "6437:6:70" + }, + "nativeSrc": "6437:14:70", + "nodeType": "YulFunctionCall", + "src": "6437:14:70" + } + ], + "functionName": { + "name": "iszero", + "nativeSrc": "6430:6:70", + "nodeType": "YulIdentifier", + "src": "6430:6:70" + }, + "nativeSrc": "6430:22:70", + "nodeType": "YulFunctionCall", + "src": "6430:22:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "6412:6:70", + "nodeType": "YulIdentifier", + "src": "6412:6:70" + }, + "nativeSrc": "6412:41:70", + "nodeType": "YulFunctionCall", + "src": "6412:41:70" + }, + "nativeSrc": "6412:41:70", + "nodeType": "YulExpressionStatement", + "src": "6412:41:70" + } + ] + }, + "name": "abi_encode_tuple_t_bool__to_t_bool__fromStack_reversed", + "nativeSrc": "6272:187:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "6336:9:70", + "nodeType": "YulTypedName", + "src": "6336:9:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "6347:6:70", + "nodeType": "YulTypedName", + "src": "6347:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "6358:4:70", + "nodeType": "YulTypedName", + "src": "6358:4:70", + "type": "" + } + ], + "src": "6272:187:70" + }, + { + "body": { + "nativeSrc": "6613:172:70", + "nodeType": "YulBlock", + "src": "6613:172:70", + "statements": [ + { + "nativeSrc": "6623:26:70", + "nodeType": "YulAssignment", + "src": "6623:26:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "6635:9:70", + "nodeType": "YulIdentifier", + "src": "6635:9:70" + }, + { + "kind": "number", + "nativeSrc": "6646:2:70", + "nodeType": "YulLiteral", + "src": "6646:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "6631:3:70", + "nodeType": "YulIdentifier", + "src": "6631:3:70" + }, + "nativeSrc": "6631:18:70", + "nodeType": "YulFunctionCall", + "src": "6631:18:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "6623:4:70", + "nodeType": "YulIdentifier", + "src": "6623:4:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "6665:9:70", + "nodeType": "YulIdentifier", + "src": "6665:9:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "name": "value0", + "nativeSrc": "6686:6:70", + "nodeType": "YulIdentifier", + "src": "6686:6:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "6680:5:70", + "nodeType": "YulIdentifier", + "src": "6680:5:70" + }, + "nativeSrc": "6680:13:70", + "nodeType": "YulFunctionCall", + "src": "6680:13:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "6703:3:70", + "nodeType": "YulLiteral", + "src": "6703:3:70", + "type": "", + "value": "160" + }, + { + "kind": "number", + "nativeSrc": "6708:1:70", + "nodeType": "YulLiteral", + "src": "6708:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "6699:3:70", + "nodeType": "YulIdentifier", + "src": "6699:3:70" + }, + "nativeSrc": "6699:11:70", + "nodeType": "YulFunctionCall", + "src": "6699:11:70" + }, + { + "kind": "number", + "nativeSrc": "6712:1:70", + "nodeType": "YulLiteral", + "src": "6712:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "6695:3:70", + "nodeType": "YulIdentifier", + "src": "6695:3:70" + }, + "nativeSrc": "6695:19:70", + "nodeType": "YulFunctionCall", + "src": "6695:19:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "6676:3:70", + "nodeType": "YulIdentifier", + "src": "6676:3:70" + }, + "nativeSrc": "6676:39:70", + "nodeType": "YulFunctionCall", + "src": "6676:39:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "6658:6:70", + "nodeType": "YulIdentifier", + "src": "6658:6:70" + }, + "nativeSrc": "6658:58:70", + "nodeType": "YulFunctionCall", + "src": "6658:58:70" + }, + "nativeSrc": "6658:58:70", + "nodeType": "YulExpressionStatement", + "src": "6658:58:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "6736:9:70", + "nodeType": "YulIdentifier", + "src": "6736:9:70" + }, + { + "kind": "number", + "nativeSrc": "6747:4:70", + "nodeType": "YulLiteral", + "src": "6747:4:70", + "type": "", + "value": "0x20" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "6732:3:70", + "nodeType": "YulIdentifier", + "src": "6732:3:70" + }, + "nativeSrc": "6732:20:70", + "nodeType": "YulFunctionCall", + "src": "6732:20:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "name": "value0", + "nativeSrc": "6764:6:70", + "nodeType": "YulIdentifier", + "src": "6764:6:70" + }, + { + "kind": "number", + "nativeSrc": "6772:4:70", + "nodeType": "YulLiteral", + "src": "6772:4:70", + "type": "", + "value": "0x20" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "6760:3:70", + "nodeType": "YulIdentifier", + "src": "6760:3:70" + }, + "nativeSrc": "6760:17:70", + "nodeType": "YulFunctionCall", + "src": "6760:17:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "6754:5:70", + "nodeType": "YulIdentifier", + "src": "6754:5:70" + }, + "nativeSrc": "6754:24:70", + "nodeType": "YulFunctionCall", + "src": "6754:24:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "6725:6:70", + "nodeType": "YulIdentifier", + "src": "6725:6:70" + }, + "nativeSrc": "6725:54:70", + "nodeType": "YulFunctionCall", + "src": "6725:54:70" + }, + "nativeSrc": "6725:54:70", + "nodeType": "YulExpressionStatement", + "src": "6725:54:70" + } + ] + }, + "name": "abi_encode_tuple_t_struct$_State_$16305_memory_ptr__to_t_struct$_State_$16305_memory_ptr__fromStack_reversed", + "nativeSrc": "6464:321:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "6582:9:70", + "nodeType": "YulTypedName", + "src": "6582:9:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "6593:6:70", + "nodeType": "YulTypedName", + "src": "6593:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "6604:4:70", + "nodeType": "YulTypedName", + "src": "6604:4:70", + "type": "" + } + ], + "src": "6464:321:70" + }, + { + "body": { + "nativeSrc": "6833:59:70", + "nodeType": "YulBlock", + "src": "6833:59:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "name": "pos", + "nativeSrc": "6850:3:70", + "nodeType": "YulIdentifier", + "src": "6850:3:70" + }, + { + "arguments": [ + { + "name": "value", + "nativeSrc": "6859:5:70", + "nodeType": "YulIdentifier", + "src": "6859:5:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "6874:2:70", + "nodeType": "YulLiteral", + "src": "6874:2:70", + "type": "", + "value": "64" + }, + { + "kind": "number", + "nativeSrc": "6878:1:70", + "nodeType": "YulLiteral", + "src": "6878:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "6870:3:70", + "nodeType": "YulIdentifier", + "src": "6870:3:70" + }, + "nativeSrc": "6870:10:70", + "nodeType": "YulFunctionCall", + "src": "6870:10:70" + }, + { + "kind": "number", + "nativeSrc": "6882:1:70", + "nodeType": "YulLiteral", + "src": "6882:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "6866:3:70", + "nodeType": "YulIdentifier", + "src": "6866:3:70" + }, + "nativeSrc": "6866:18:70", + "nodeType": "YulFunctionCall", + "src": "6866:18:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "6855:3:70", + "nodeType": "YulIdentifier", + "src": "6855:3:70" + }, + "nativeSrc": "6855:30:70", + "nodeType": "YulFunctionCall", + "src": "6855:30:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "6843:6:70", + "nodeType": "YulIdentifier", + "src": "6843:6:70" + }, + "nativeSrc": "6843:43:70", + "nodeType": "YulFunctionCall", + "src": "6843:43:70" + }, + "nativeSrc": "6843:43:70", + "nodeType": "YulExpressionStatement", + "src": "6843:43:70" + } + ] + }, + "name": "abi_encode_uint64", + "nativeSrc": "6790:102:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "value", + "nativeSrc": "6817:5:70", + "nodeType": "YulTypedName", + "src": "6817:5:70", + "type": "" + }, + { + "name": "pos", + "nativeSrc": "6824:3:70", + "nodeType": "YulTypedName", + "src": "6824:3:70", + "type": "" + } + ], + "src": "6790:102:70" + }, + { + "body": { + "nativeSrc": "7022:169:70", + "nodeType": "YulBlock", + "src": "7022:169:70", + "statements": [ + { + "nativeSrc": "7032:26:70", + "nodeType": "YulAssignment", + "src": "7032:26:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "7044:9:70", + "nodeType": "YulIdentifier", + "src": "7044:9:70" + }, + { + "kind": "number", + "nativeSrc": "7055:2:70", + "nodeType": "YulLiteral", + "src": "7055:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "7040:3:70", + "nodeType": "YulIdentifier", + "src": "7040:3:70" + }, + "nativeSrc": "7040:18:70", + "nodeType": "YulFunctionCall", + "src": "7040:18:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "7032:4:70", + "nodeType": "YulIdentifier", + "src": "7032:4:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "7074:9:70", + "nodeType": "YulIdentifier", + "src": "7074:9:70" + }, + { + "arguments": [ + { + "name": "value0", + "nativeSrc": "7089:6:70", + "nodeType": "YulIdentifier", + "src": "7089:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "7105:2:70", + "nodeType": "YulLiteral", + "src": "7105:2:70", + "type": "", + "value": "64" + }, + { + "kind": "number", + "nativeSrc": "7109:1:70", + "nodeType": "YulLiteral", + "src": "7109:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "7101:3:70", + "nodeType": "YulIdentifier", + "src": "7101:3:70" + }, + "nativeSrc": "7101:10:70", + "nodeType": "YulFunctionCall", + "src": "7101:10:70" + }, + { + "kind": "number", + "nativeSrc": "7113:1:70", + "nodeType": "YulLiteral", + "src": "7113:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "7097:3:70", + "nodeType": "YulIdentifier", + "src": "7097:3:70" + }, + "nativeSrc": "7097:18:70", + "nodeType": "YulFunctionCall", + "src": "7097:18:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "7085:3:70", + "nodeType": "YulIdentifier", + "src": "7085:3:70" + }, + "nativeSrc": "7085:31:70", + "nodeType": "YulFunctionCall", + "src": "7085:31:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "7067:6:70", + "nodeType": "YulIdentifier", + "src": "7067:6:70" + }, + "nativeSrc": "7067:50:70", + "nodeType": "YulFunctionCall", + "src": "7067:50:70" + }, + "nativeSrc": "7067:50:70", + "nodeType": "YulExpressionStatement", + "src": "7067:50:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "7137:9:70", + "nodeType": "YulIdentifier", + "src": "7137:9:70" + }, + { + "kind": "number", + "nativeSrc": "7148:2:70", + "nodeType": "YulLiteral", + "src": "7148:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "7133:3:70", + "nodeType": "YulIdentifier", + "src": "7133:3:70" + }, + "nativeSrc": "7133:18:70", + "nodeType": "YulFunctionCall", + "src": "7133:18:70" + }, + { + "arguments": [ + { + "name": "value1", + "nativeSrc": "7157:6:70", + "nodeType": "YulIdentifier", + "src": "7157:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "7173:2:70", + "nodeType": "YulLiteral", + "src": "7173:2:70", + "type": "", + "value": "64" + }, + { + "kind": "number", + "nativeSrc": "7177:1:70", + "nodeType": "YulLiteral", + "src": "7177:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "7169:3:70", + "nodeType": "YulIdentifier", + "src": "7169:3:70" + }, + "nativeSrc": "7169:10:70", + "nodeType": "YulFunctionCall", + "src": "7169:10:70" + }, + { + "kind": "number", + "nativeSrc": "7181:1:70", + "nodeType": "YulLiteral", + "src": "7181:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "7165:3:70", + "nodeType": "YulIdentifier", + "src": "7165:3:70" + }, + "nativeSrc": "7165:18:70", + "nodeType": "YulFunctionCall", + "src": "7165:18:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "7153:3:70", + "nodeType": "YulIdentifier", + "src": "7153:3:70" + }, + "nativeSrc": "7153:31:70", + "nodeType": "YulFunctionCall", + "src": "7153:31:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "7126:6:70", + "nodeType": "YulIdentifier", + "src": "7126:6:70" + }, + "nativeSrc": "7126:59:70", + "nodeType": "YulFunctionCall", + "src": "7126:59:70" + }, + "nativeSrc": "7126:59:70", + "nodeType": "YulExpressionStatement", + "src": "7126:59:70" + } + ] + }, + "name": "abi_encode_tuple_t_uint64_t_uint64__to_t_uint64_t_uint64__fromStack_reversed", + "nativeSrc": "6897:294:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "6983:9:70", + "nodeType": "YulTypedName", + "src": "6983:9:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "6994:6:70", + "nodeType": "YulTypedName", + "src": "6994:6:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "7002:6:70", + "nodeType": "YulTypedName", + "src": "7002:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "7013:4:70", + "nodeType": "YulTypedName", + "src": "7013:4:70", + "type": "" + } + ], + "src": "6897:294:70" + }, + { + "body": { + "nativeSrc": "7300:404:70", + "nodeType": "YulBlock", + "src": "7300:404:70", + "statements": [ + { + "body": { + "nativeSrc": "7346:16:70", + "nodeType": "YulBlock", + "src": "7346:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "7355:1:70", + "nodeType": "YulLiteral", + "src": "7355:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "7358:1:70", + "nodeType": "YulLiteral", + "src": "7358:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "7348:6:70", + "nodeType": "YulIdentifier", + "src": "7348:6:70" + }, + "nativeSrc": "7348:12:70", + "nodeType": "YulFunctionCall", + "src": "7348:12:70" + }, + "nativeSrc": "7348:12:70", + "nodeType": "YulExpressionStatement", + "src": "7348:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "dataEnd", + "nativeSrc": "7321:7:70", + "nodeType": "YulIdentifier", + "src": "7321:7:70" + }, + { + "name": "headStart", + "nativeSrc": "7330:9:70", + "nodeType": "YulIdentifier", + "src": "7330:9:70" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "7317:3:70", + "nodeType": "YulIdentifier", + "src": "7317:3:70" + }, + "nativeSrc": "7317:23:70", + "nodeType": "YulFunctionCall", + "src": "7317:23:70" + }, + { + "kind": "number", + "nativeSrc": "7342:2:70", + "nodeType": "YulLiteral", + "src": "7342:2:70", + "type": "", + "value": "96" + } + ], + "functionName": { + "name": "slt", + "nativeSrc": "7313:3:70", + "nodeType": "YulIdentifier", + "src": "7313:3:70" + }, + "nativeSrc": "7313:32:70", + "nodeType": "YulFunctionCall", + "src": "7313:32:70" + }, + "nativeSrc": "7310:52:70", + "nodeType": "YulIf", + "src": "7310:52:70" + }, + { + "nativeSrc": "7371:36:70", + "nodeType": "YulVariableDeclaration", + "src": "7371:36:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "7397:9:70", + "nodeType": "YulIdentifier", + "src": "7397:9:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "7384:12:70", + "nodeType": "YulIdentifier", + "src": "7384:12:70" + }, + "nativeSrc": "7384:23:70", + "nodeType": "YulFunctionCall", + "src": "7384:23:70" + }, + "variables": [ + { + "name": "value", + "nativeSrc": "7375:5:70", + "nodeType": "YulTypedName", + "src": "7375:5:70", + "type": "" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "value", + "nativeSrc": "7441:5:70", + "nodeType": "YulIdentifier", + "src": "7441:5:70" + } + ], + "functionName": { + "name": "validator_revert_address", + "nativeSrc": "7416:24:70", + "nodeType": "YulIdentifier", + "src": "7416:24:70" + }, + "nativeSrc": "7416:31:70", + "nodeType": "YulFunctionCall", + "src": "7416:31:70" + }, + "nativeSrc": "7416:31:70", + "nodeType": "YulExpressionStatement", + "src": "7416:31:70" + }, + { + "nativeSrc": "7456:15:70", + "nodeType": "YulAssignment", + "src": "7456:15:70", + "value": { + "name": "value", + "nativeSrc": "7466:5:70", + "nodeType": "YulIdentifier", + "src": "7466:5:70" + }, + "variableNames": [ + { + "name": "value0", + "nativeSrc": "7456:6:70", + "nodeType": "YulIdentifier", + "src": "7456:6:70" + } + ] + }, + { + "nativeSrc": "7480:47:70", + "nodeType": "YulVariableDeclaration", + "src": "7480:47:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "7512:9:70", + "nodeType": "YulIdentifier", + "src": "7512:9:70" + }, + { + "kind": "number", + "nativeSrc": "7523:2:70", + "nodeType": "YulLiteral", + "src": "7523:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "7508:3:70", + "nodeType": "YulIdentifier", + "src": "7508:3:70" + }, + "nativeSrc": "7508:18:70", + "nodeType": "YulFunctionCall", + "src": "7508:18:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "7495:12:70", + "nodeType": "YulIdentifier", + "src": "7495:12:70" + }, + "nativeSrc": "7495:32:70", + "nodeType": "YulFunctionCall", + "src": "7495:32:70" + }, + "variables": [ + { + "name": "value_1", + "nativeSrc": "7484:7:70", + "nodeType": "YulTypedName", + "src": "7484:7:70", + "type": "" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "value_1", + "nativeSrc": "7561:7:70", + "nodeType": "YulIdentifier", + "src": "7561:7:70" + } + ], + "functionName": { + "name": "validator_revert_address", + "nativeSrc": "7536:24:70", + "nodeType": "YulIdentifier", + "src": "7536:24:70" + }, + "nativeSrc": "7536:33:70", + "nodeType": "YulFunctionCall", + "src": "7536:33:70" + }, + "nativeSrc": "7536:33:70", + "nodeType": "YulExpressionStatement", + "src": "7536:33:70" + }, + { + "nativeSrc": "7578:17:70", + "nodeType": "YulAssignment", + "src": "7578:17:70", + "value": { + "name": "value_1", + "nativeSrc": "7588:7:70", + "nodeType": "YulIdentifier", + "src": "7588:7:70" + }, + "variableNames": [ + { + "name": "value1", + "nativeSrc": "7578:6:70", + "nodeType": "YulIdentifier", + "src": "7578:6:70" + } + ] + }, + { + "nativeSrc": "7604:16:70", + "nodeType": "YulVariableDeclaration", + "src": "7604:16:70", + "value": { + "kind": "number", + "nativeSrc": "7619:1:70", + "nodeType": "YulLiteral", + "src": "7619:1:70", + "type": "", + "value": "0" + }, + "variables": [ + { + "name": "value_2", + "nativeSrc": "7608:7:70", + "nodeType": "YulTypedName", + "src": "7608:7:70", + "type": "" + } + ] + }, + { + "nativeSrc": "7629:43:70", + "nodeType": "YulAssignment", + "src": "7629:43:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "7657:9:70", + "nodeType": "YulIdentifier", + "src": "7657:9:70" + }, + { + "kind": "number", + "nativeSrc": "7668:2:70", + "nodeType": "YulLiteral", + "src": "7668:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "7653:3:70", + "nodeType": "YulIdentifier", + "src": "7653:3:70" + }, + "nativeSrc": "7653:18:70", + "nodeType": "YulFunctionCall", + "src": "7653:18:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "7640:12:70", + "nodeType": "YulIdentifier", + "src": "7640:12:70" + }, + "nativeSrc": "7640:32:70", + "nodeType": "YulFunctionCall", + "src": "7640:32:70" + }, + "variableNames": [ + { + "name": "value_2", + "nativeSrc": "7629:7:70", + "nodeType": "YulIdentifier", + "src": "7629:7:70" + } + ] + }, + { + "nativeSrc": "7681:17:70", + "nodeType": "YulAssignment", + "src": "7681:17:70", + "value": { + "name": "value_2", + "nativeSrc": "7691:7:70", + "nodeType": "YulIdentifier", + "src": "7691:7:70" + }, + "variableNames": [ + { + "name": "value2", + "nativeSrc": "7681:6:70", + "nodeType": "YulIdentifier", + "src": "7681:6:70" + } + ] + } + ] + }, + "name": "abi_decode_tuple_t_addresst_addresst_bytes32", + "nativeSrc": "7196:508:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "7250:9:70", + "nodeType": "YulTypedName", + "src": "7250:9:70", + "type": "" + }, + { + "name": "dataEnd", + "nativeSrc": "7261:7:70", + "nodeType": "YulTypedName", + "src": "7261:7:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value0", + "nativeSrc": "7273:6:70", + "nodeType": "YulTypedName", + "src": "7273:6:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "7281:6:70", + "nodeType": "YulTypedName", + "src": "7281:6:70", + "type": "" + }, + { + "name": "value2", + "nativeSrc": "7289:6:70", + "nodeType": "YulTypedName", + "src": "7289:6:70", + "type": "" + } + ], + "src": "7196:508:70" + }, + { + "body": { + "nativeSrc": "7838:119:70", + "nodeType": "YulBlock", + "src": "7838:119:70", + "statements": [ + { + "nativeSrc": "7848:26:70", + "nodeType": "YulAssignment", + "src": "7848:26:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "7860:9:70", + "nodeType": "YulIdentifier", + "src": "7860:9:70" + }, + { + "kind": "number", + "nativeSrc": "7871:2:70", + "nodeType": "YulLiteral", + "src": "7871:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "7856:3:70", + "nodeType": "YulIdentifier", + "src": "7856:3:70" + }, + "nativeSrc": "7856:18:70", + "nodeType": "YulFunctionCall", + "src": "7856:18:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "7848:4:70", + "nodeType": "YulIdentifier", + "src": "7848:4:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "7890:9:70", + "nodeType": "YulIdentifier", + "src": "7890:9:70" + }, + { + "name": "value0", + "nativeSrc": "7901:6:70", + "nodeType": "YulIdentifier", + "src": "7901:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "7883:6:70", + "nodeType": "YulIdentifier", + "src": "7883:6:70" + }, + "nativeSrc": "7883:25:70", + "nodeType": "YulFunctionCall", + "src": "7883:25:70" + }, + "nativeSrc": "7883:25:70", + "nodeType": "YulExpressionStatement", + "src": "7883:25:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "7928:9:70", + "nodeType": "YulIdentifier", + "src": "7928:9:70" + }, + { + "kind": "number", + "nativeSrc": "7939:2:70", + "nodeType": "YulLiteral", + "src": "7939:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "7924:3:70", + "nodeType": "YulIdentifier", + "src": "7924:3:70" + }, + "nativeSrc": "7924:18:70", + "nodeType": "YulFunctionCall", + "src": "7924:18:70" + }, + { + "name": "value1", + "nativeSrc": "7944:6:70", + "nodeType": "YulIdentifier", + "src": "7944:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "7917:6:70", + "nodeType": "YulIdentifier", + "src": "7917:6:70" + }, + "nativeSrc": "7917:34:70", + "nodeType": "YulFunctionCall", + "src": "7917:34:70" + }, + "nativeSrc": "7917:34:70", + "nodeType": "YulExpressionStatement", + "src": "7917:34:70" + } + ] + }, + "name": "abi_encode_tuple_t_uint256_t_uint256__to_t_uint256_t_uint256__fromStack_reversed", + "nativeSrc": "7709:248:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "7799:9:70", + "nodeType": "YulTypedName", + "src": "7799:9:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "7810:6:70", + "nodeType": "YulTypedName", + "src": "7810:6:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "7818:6:70", + "nodeType": "YulTypedName", + "src": "7818:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "7829:4:70", + "nodeType": "YulTypedName", + "src": "7829:4:70", + "type": "" + } + ], + "src": "7709:248:70" + }, + { + "body": { + "nativeSrc": "8066:404:70", + "nodeType": "YulBlock", + "src": "8066:404:70", + "statements": [ + { + "body": { + "nativeSrc": "8112:16:70", + "nodeType": "YulBlock", + "src": "8112:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "8121:1:70", + "nodeType": "YulLiteral", + "src": "8121:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "8124:1:70", + "nodeType": "YulLiteral", + "src": "8124:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "8114:6:70", + "nodeType": "YulIdentifier", + "src": "8114:6:70" + }, + "nativeSrc": "8114:12:70", + "nodeType": "YulFunctionCall", + "src": "8114:12:70" + }, + "nativeSrc": "8114:12:70", + "nodeType": "YulExpressionStatement", + "src": "8114:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "dataEnd", + "nativeSrc": "8087:7:70", + "nodeType": "YulIdentifier", + "src": "8087:7:70" + }, + { + "name": "headStart", + "nativeSrc": "8096:9:70", + "nodeType": "YulIdentifier", + "src": "8096:9:70" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "8083:3:70", + "nodeType": "YulIdentifier", + "src": "8083:3:70" + }, + "nativeSrc": "8083:23:70", + "nodeType": "YulFunctionCall", + "src": "8083:23:70" + }, + { + "kind": "number", + "nativeSrc": "8108:2:70", + "nodeType": "YulLiteral", + "src": "8108:2:70", + "type": "", + "value": "96" + } + ], + "functionName": { + "name": "slt", + "nativeSrc": "8079:3:70", + "nodeType": "YulIdentifier", + "src": "8079:3:70" + }, + "nativeSrc": "8079:32:70", + "nodeType": "YulFunctionCall", + "src": "8079:32:70" + }, + "nativeSrc": "8076:52:70", + "nodeType": "YulIf", + "src": "8076:52:70" + }, + { + "nativeSrc": "8137:36:70", + "nodeType": "YulVariableDeclaration", + "src": "8137:36:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "8163:9:70", + "nodeType": "YulIdentifier", + "src": "8163:9:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "8150:12:70", + "nodeType": "YulIdentifier", + "src": "8150:12:70" + }, + "nativeSrc": "8150:23:70", + "nodeType": "YulFunctionCall", + "src": "8150:23:70" + }, + "variables": [ + { + "name": "value", + "nativeSrc": "8141:5:70", + "nodeType": "YulTypedName", + "src": "8141:5:70", + "type": "" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "value", + "nativeSrc": "8207:5:70", + "nodeType": "YulIdentifier", + "src": "8207:5:70" + } + ], + "functionName": { + "name": "validator_revert_address", + "nativeSrc": "8182:24:70", + "nodeType": "YulIdentifier", + "src": "8182:24:70" + }, + "nativeSrc": "8182:31:70", + "nodeType": "YulFunctionCall", + "src": "8182:31:70" + }, + "nativeSrc": "8182:31:70", + "nodeType": "YulExpressionStatement", + "src": "8182:31:70" + }, + { + "nativeSrc": "8222:15:70", + "nodeType": "YulAssignment", + "src": "8222:15:70", + "value": { + "name": "value", + "nativeSrc": "8232:5:70", + "nodeType": "YulIdentifier", + "src": "8232:5:70" + }, + "variableNames": [ + { + "name": "value0", + "nativeSrc": "8222:6:70", + "nodeType": "YulIdentifier", + "src": "8222:6:70" + } + ] + }, + { + "nativeSrc": "8246:47:70", + "nodeType": "YulVariableDeclaration", + "src": "8246:47:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "8278:9:70", + "nodeType": "YulIdentifier", + "src": "8278:9:70" + }, + { + "kind": "number", + "nativeSrc": "8289:2:70", + "nodeType": "YulLiteral", + "src": "8289:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "8274:3:70", + "nodeType": "YulIdentifier", + "src": "8274:3:70" + }, + "nativeSrc": "8274:18:70", + "nodeType": "YulFunctionCall", + "src": "8274:18:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "8261:12:70", + "nodeType": "YulIdentifier", + "src": "8261:12:70" + }, + "nativeSrc": "8261:32:70", + "nodeType": "YulFunctionCall", + "src": "8261:32:70" + }, + "variables": [ + { + "name": "value_1", + "nativeSrc": "8250:7:70", + "nodeType": "YulTypedName", + "src": "8250:7:70", + "type": "" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "value_1", + "nativeSrc": "8327:7:70", + "nodeType": "YulIdentifier", + "src": "8327:7:70" + } + ], + "functionName": { + "name": "validator_revert_address", + "nativeSrc": "8302:24:70", + "nodeType": "YulIdentifier", + "src": "8302:24:70" + }, + "nativeSrc": "8302:33:70", + "nodeType": "YulFunctionCall", + "src": "8302:33:70" + }, + "nativeSrc": "8302:33:70", + "nodeType": "YulExpressionStatement", + "src": "8302:33:70" + }, + { + "nativeSrc": "8344:17:70", + "nodeType": "YulAssignment", + "src": "8344:17:70", + "value": { + "name": "value_1", + "nativeSrc": "8354:7:70", + "nodeType": "YulIdentifier", + "src": "8354:7:70" + }, + "variableNames": [ + { + "name": "value1", + "nativeSrc": "8344:6:70", + "nodeType": "YulIdentifier", + "src": "8344:6:70" + } + ] + }, + { + "nativeSrc": "8370:16:70", + "nodeType": "YulVariableDeclaration", + "src": "8370:16:70", + "value": { + "kind": "number", + "nativeSrc": "8385:1:70", + "nodeType": "YulLiteral", + "src": "8385:1:70", + "type": "", + "value": "0" + }, + "variables": [ + { + "name": "value_2", + "nativeSrc": "8374:7:70", + "nodeType": "YulTypedName", + "src": "8374:7:70", + "type": "" + } + ] + }, + { + "nativeSrc": "8395:43:70", + "nodeType": "YulAssignment", + "src": "8395:43:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "8423:9:70", + "nodeType": "YulIdentifier", + "src": "8423:9:70" + }, + { + "kind": "number", + "nativeSrc": "8434:2:70", + "nodeType": "YulLiteral", + "src": "8434:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "8419:3:70", + "nodeType": "YulIdentifier", + "src": "8419:3:70" + }, + "nativeSrc": "8419:18:70", + "nodeType": "YulFunctionCall", + "src": "8419:18:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "8406:12:70", + "nodeType": "YulIdentifier", + "src": "8406:12:70" + }, + "nativeSrc": "8406:32:70", + "nodeType": "YulFunctionCall", + "src": "8406:32:70" + }, + "variableNames": [ + { + "name": "value_2", + "nativeSrc": "8395:7:70", + "nodeType": "YulIdentifier", + "src": "8395:7:70" + } + ] + }, + { + "nativeSrc": "8447:17:70", + "nodeType": "YulAssignment", + "src": "8447:17:70", + "value": { + "name": "value_2", + "nativeSrc": "8457:7:70", + "nodeType": "YulIdentifier", + "src": "8457:7:70" + }, + "variableNames": [ + { + "name": "value2", + "nativeSrc": "8447:6:70", + "nodeType": "YulIdentifier", + "src": "8447:6:70" + } + ] + } + ] + }, + "name": "abi_decode_tuple_t_addresst_addresst_uint256", + "nativeSrc": "7962:508:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "8016:9:70", + "nodeType": "YulTypedName", + "src": "8016:9:70", + "type": "" + }, + { + "name": "dataEnd", + "nativeSrc": "8027:7:70", + "nodeType": "YulTypedName", + "src": "8027:7:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value0", + "nativeSrc": "8039:6:70", + "nodeType": "YulTypedName", + "src": "8039:6:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "8047:6:70", + "nodeType": "YulTypedName", + "src": "8047:6:70", + "type": "" + }, + { + "name": "value2", + "nativeSrc": "8055:6:70", + "nodeType": "YulTypedName", + "src": "8055:6:70", + "type": "" + } + ], + "src": "7962:508:70" + }, + { + "body": { + "nativeSrc": "8832:881:70", + "nodeType": "YulBlock", + "src": "8832:881:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "8849:9:70", + "nodeType": "YulIdentifier", + "src": "8849:9:70" + }, + { + "arguments": [ + { + "name": "value0", + "nativeSrc": "8864:6:70", + "nodeType": "YulIdentifier", + "src": "8864:6:70" + }, + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "8876:3:70", + "nodeType": "YulLiteral", + "src": "8876:3:70", + "type": "", + "value": "248" + }, + { + "kind": "number", + "nativeSrc": "8881:3:70", + "nodeType": "YulLiteral", + "src": "8881:3:70", + "type": "", + "value": "255" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "8872:3:70", + "nodeType": "YulIdentifier", + "src": "8872:3:70" + }, + "nativeSrc": "8872:13:70", + "nodeType": "YulFunctionCall", + "src": "8872:13:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "8860:3:70", + "nodeType": "YulIdentifier", + "src": "8860:3:70" + }, + "nativeSrc": "8860:26:70", + "nodeType": "YulFunctionCall", + "src": "8860:26:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "8842:6:70", + "nodeType": "YulIdentifier", + "src": "8842:6:70" + }, + "nativeSrc": "8842:45:70", + "nodeType": "YulFunctionCall", + "src": "8842:45:70" + }, + "nativeSrc": "8842:45:70", + "nodeType": "YulExpressionStatement", + "src": "8842:45:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "8907:9:70", + "nodeType": "YulIdentifier", + "src": "8907:9:70" + }, + { + "kind": "number", + "nativeSrc": "8918:2:70", + "nodeType": "YulLiteral", + "src": "8918:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "8903:3:70", + "nodeType": "YulIdentifier", + "src": "8903:3:70" + }, + "nativeSrc": "8903:18:70", + "nodeType": "YulFunctionCall", + "src": "8903:18:70" + }, + { + "kind": "number", + "nativeSrc": "8923:3:70", + "nodeType": "YulLiteral", + "src": "8923:3:70", + "type": "", + "value": "224" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "8896:6:70", + "nodeType": "YulIdentifier", + "src": "8896:6:70" + }, + "nativeSrc": "8896:31:70", + "nodeType": "YulFunctionCall", + "src": "8896:31:70" + }, + "nativeSrc": "8896:31:70", + "nodeType": "YulExpressionStatement", + "src": "8896:31:70" + }, + { + "nativeSrc": "8936:60:70", + "nodeType": "YulVariableDeclaration", + "src": "8936:60:70", + "value": { + "arguments": [ + { + "name": "value1", + "nativeSrc": "8968:6:70", + "nodeType": "YulIdentifier", + "src": "8968:6:70" + }, + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "8980:9:70", + "nodeType": "YulIdentifier", + "src": "8980:9:70" + }, + { + "kind": "number", + "nativeSrc": "8991:3:70", + "nodeType": "YulLiteral", + "src": "8991:3:70", + "type": "", + "value": "224" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "8976:3:70", + "nodeType": "YulIdentifier", + "src": "8976:3:70" + }, + "nativeSrc": "8976:19:70", + "nodeType": "YulFunctionCall", + "src": "8976:19:70" + } + ], + "functionName": { + "name": "abi_encode_string", + "nativeSrc": "8950:17:70", + "nodeType": "YulIdentifier", + "src": "8950:17:70" + }, + "nativeSrc": "8950:46:70", + "nodeType": "YulFunctionCall", + "src": "8950:46:70" + }, + "variables": [ + { + "name": "tail_1", + "nativeSrc": "8940:6:70", + "nodeType": "YulTypedName", + "src": "8940:6:70", + "type": "" + } + ] + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "9016:9:70", + "nodeType": "YulIdentifier", + "src": "9016:9:70" + }, + { + "kind": "number", + "nativeSrc": "9027:2:70", + "nodeType": "YulLiteral", + "src": "9027:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "9012:3:70", + "nodeType": "YulIdentifier", + "src": "9012:3:70" + }, + "nativeSrc": "9012:18:70", + "nodeType": "YulFunctionCall", + "src": "9012:18:70" + }, + { + "arguments": [ + { + "name": "tail_1", + "nativeSrc": "9036:6:70", + "nodeType": "YulIdentifier", + "src": "9036:6:70" + }, + { + "name": "headStart", + "nativeSrc": "9044:9:70", + "nodeType": "YulIdentifier", + "src": "9044:9:70" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "9032:3:70", + "nodeType": "YulIdentifier", + "src": "9032:3:70" + }, + "nativeSrc": "9032:22:70", + "nodeType": "YulFunctionCall", + "src": "9032:22:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "9005:6:70", + "nodeType": "YulIdentifier", + "src": "9005:6:70" + }, + "nativeSrc": "9005:50:70", + "nodeType": "YulFunctionCall", + "src": "9005:50:70" + }, + "nativeSrc": "9005:50:70", + "nodeType": "YulExpressionStatement", + "src": "9005:50:70" + }, + { + "nativeSrc": "9064:47:70", + "nodeType": "YulVariableDeclaration", + "src": "9064:47:70", + "value": { + "arguments": [ + { + "name": "value2", + "nativeSrc": "9096:6:70", + "nodeType": "YulIdentifier", + "src": "9096:6:70" + }, + { + "name": "tail_1", + "nativeSrc": "9104:6:70", + "nodeType": "YulIdentifier", + "src": "9104:6:70" + } + ], + "functionName": { + "name": "abi_encode_string", + "nativeSrc": "9078:17:70", + "nodeType": "YulIdentifier", + "src": "9078:17:70" + }, + "nativeSrc": "9078:33:70", + "nodeType": "YulFunctionCall", + "src": "9078:33:70" + }, + "variables": [ + { + "name": "tail_2", + "nativeSrc": "9068:6:70", + "nodeType": "YulTypedName", + "src": "9068:6:70", + "type": "" + } + ] + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "9131:9:70", + "nodeType": "YulIdentifier", + "src": "9131:9:70" + }, + { + "kind": "number", + "nativeSrc": "9142:2:70", + "nodeType": "YulLiteral", + "src": "9142:2:70", + "type": "", + "value": "96" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "9127:3:70", + "nodeType": "YulIdentifier", + "src": "9127:3:70" + }, + "nativeSrc": "9127:18:70", + "nodeType": "YulFunctionCall", + "src": "9127:18:70" + }, + { + "name": "value3", + "nativeSrc": "9147:6:70", + "nodeType": "YulIdentifier", + "src": "9147:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "9120:6:70", + "nodeType": "YulIdentifier", + "src": "9120:6:70" + }, + "nativeSrc": "9120:34:70", + "nodeType": "YulFunctionCall", + "src": "9120:34:70" + }, + "nativeSrc": "9120:34:70", + "nodeType": "YulExpressionStatement", + "src": "9120:34:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "9174:9:70", + "nodeType": "YulIdentifier", + "src": "9174:9:70" + }, + { + "kind": "number", + "nativeSrc": "9185:3:70", + "nodeType": "YulLiteral", + "src": "9185:3:70", + "type": "", + "value": "128" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "9170:3:70", + "nodeType": "YulIdentifier", + "src": "9170:3:70" + }, + "nativeSrc": "9170:19:70", + "nodeType": "YulFunctionCall", + "src": "9170:19:70" + }, + { + "arguments": [ + { + "name": "value4", + "nativeSrc": "9195:6:70", + "nodeType": "YulIdentifier", + "src": "9195:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "9211:3:70", + "nodeType": "YulLiteral", + "src": "9211:3:70", + "type": "", + "value": "160" + }, + { + "kind": "number", + "nativeSrc": "9216:1:70", + "nodeType": "YulLiteral", + "src": "9216:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "9207:3:70", + "nodeType": "YulIdentifier", + "src": "9207:3:70" + }, + "nativeSrc": "9207:11:70", + "nodeType": "YulFunctionCall", + "src": "9207:11:70" + }, + { + "kind": "number", + "nativeSrc": "9220:1:70", + "nodeType": "YulLiteral", + "src": "9220:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "9203:3:70", + "nodeType": "YulIdentifier", + "src": "9203:3:70" + }, + "nativeSrc": "9203:19:70", + "nodeType": "YulFunctionCall", + "src": "9203:19:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "9191:3:70", + "nodeType": "YulIdentifier", + "src": "9191:3:70" + }, + "nativeSrc": "9191:32:70", + "nodeType": "YulFunctionCall", + "src": "9191:32:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "9163:6:70", + "nodeType": "YulIdentifier", + "src": "9163:6:70" + }, + "nativeSrc": "9163:61:70", + "nodeType": "YulFunctionCall", + "src": "9163:61:70" + }, + "nativeSrc": "9163:61:70", + "nodeType": "YulExpressionStatement", + "src": "9163:61:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "9244:9:70", + "nodeType": "YulIdentifier", + "src": "9244:9:70" + }, + { + "kind": "number", + "nativeSrc": "9255:3:70", + "nodeType": "YulLiteral", + "src": "9255:3:70", + "type": "", + "value": "160" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "9240:3:70", + "nodeType": "YulIdentifier", + "src": "9240:3:70" + }, + "nativeSrc": "9240:19:70", + "nodeType": "YulFunctionCall", + "src": "9240:19:70" + }, + { + "name": "value5", + "nativeSrc": "9261:6:70", + "nodeType": "YulIdentifier", + "src": "9261:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "9233:6:70", + "nodeType": "YulIdentifier", + "src": "9233:6:70" + }, + "nativeSrc": "9233:35:70", + "nodeType": "YulFunctionCall", + "src": "9233:35:70" + }, + "nativeSrc": "9233:35:70", + "nodeType": "YulExpressionStatement", + "src": "9233:35:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "9288:9:70", + "nodeType": "YulIdentifier", + "src": "9288:9:70" + }, + { + "kind": "number", + "nativeSrc": "9299:3:70", + "nodeType": "YulLiteral", + "src": "9299:3:70", + "type": "", + "value": "192" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "9284:3:70", + "nodeType": "YulIdentifier", + "src": "9284:3:70" + }, + "nativeSrc": "9284:19:70", + "nodeType": "YulFunctionCall", + "src": "9284:19:70" + }, + { + "arguments": [ + { + "name": "tail_2", + "nativeSrc": "9309:6:70", + "nodeType": "YulIdentifier", + "src": "9309:6:70" + }, + { + "name": "headStart", + "nativeSrc": "9317:9:70", + "nodeType": "YulIdentifier", + "src": "9317:9:70" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "9305:3:70", + "nodeType": "YulIdentifier", + "src": "9305:3:70" + }, + "nativeSrc": "9305:22:70", + "nodeType": "YulFunctionCall", + "src": "9305:22:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "9277:6:70", + "nodeType": "YulIdentifier", + "src": "9277:6:70" + }, + "nativeSrc": "9277:51:70", + "nodeType": "YulFunctionCall", + "src": "9277:51:70" + }, + "nativeSrc": "9277:51:70", + "nodeType": "YulExpressionStatement", + "src": "9277:51:70" + }, + { + "nativeSrc": "9337:17:70", + "nodeType": "YulVariableDeclaration", + "src": "9337:17:70", + "value": { + "name": "tail_2", + "nativeSrc": "9348:6:70", + "nodeType": "YulIdentifier", + "src": "9348:6:70" + }, + "variables": [ + { + "name": "pos", + "nativeSrc": "9341:3:70", + "nodeType": "YulTypedName", + "src": "9341:3:70", + "type": "" + } + ] + }, + { + "nativeSrc": "9363:27:70", + "nodeType": "YulVariableDeclaration", + "src": "9363:27:70", + "value": { + "arguments": [ + { + "name": "value6", + "nativeSrc": "9383:6:70", + "nodeType": "YulIdentifier", + "src": "9383:6:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "9377:5:70", + "nodeType": "YulIdentifier", + "src": "9377:5:70" + }, + "nativeSrc": "9377:13:70", + "nodeType": "YulFunctionCall", + "src": "9377:13:70" + }, + "variables": [ + { + "name": "length", + "nativeSrc": "9367:6:70", + "nodeType": "YulTypedName", + "src": "9367:6:70", + "type": "" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "tail_2", + "nativeSrc": "9406:6:70", + "nodeType": "YulIdentifier", + "src": "9406:6:70" + }, + { + "name": "length", + "nativeSrc": "9414:6:70", + "nodeType": "YulIdentifier", + "src": "9414:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "9399:6:70", + "nodeType": "YulIdentifier", + "src": "9399:6:70" + }, + "nativeSrc": "9399:22:70", + "nodeType": "YulFunctionCall", + "src": "9399:22:70" + }, + "nativeSrc": "9399:22:70", + "nodeType": "YulExpressionStatement", + "src": "9399:22:70" + }, + { + "nativeSrc": "9430:22:70", + "nodeType": "YulAssignment", + "src": "9430:22:70", + "value": { + "arguments": [ + { + "name": "tail_2", + "nativeSrc": "9441:6:70", + "nodeType": "YulIdentifier", + "src": "9441:6:70" + }, + { + "kind": "number", + "nativeSrc": "9449:2:70", + "nodeType": "YulLiteral", + "src": "9449:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "9437:3:70", + "nodeType": "YulIdentifier", + "src": "9437:3:70" + }, + "nativeSrc": "9437:15:70", + "nodeType": "YulFunctionCall", + "src": "9437:15:70" + }, + "variableNames": [ + { + "name": "pos", + "nativeSrc": "9430:3:70", + "nodeType": "YulIdentifier", + "src": "9430:3:70" + } + ] + }, + { + "nativeSrc": "9461:29:70", + "nodeType": "YulVariableDeclaration", + "src": "9461:29:70", + "value": { + "arguments": [ + { + "name": "value6", + "nativeSrc": "9479:6:70", + "nodeType": "YulIdentifier", + "src": "9479:6:70" + }, + { + "kind": "number", + "nativeSrc": "9487:2:70", + "nodeType": "YulLiteral", + "src": "9487:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "9475:3:70", + "nodeType": "YulIdentifier", + "src": "9475:3:70" + }, + "nativeSrc": "9475:15:70", + "nodeType": "YulFunctionCall", + "src": "9475:15:70" + }, + "variables": [ + { + "name": "srcPtr", + "nativeSrc": "9465:6:70", + "nodeType": "YulTypedName", + "src": "9465:6:70", + "type": "" + } + ] + }, + { + "nativeSrc": "9499:10:70", + "nodeType": "YulVariableDeclaration", + "src": "9499:10:70", + "value": { + "kind": "number", + "nativeSrc": "9508:1:70", + "nodeType": "YulLiteral", + "src": "9508:1:70", + "type": "", + "value": "0" + }, + "variables": [ + { + "name": "i", + "nativeSrc": "9503:1:70", + "nodeType": "YulTypedName", + "src": "9503:1:70", + "type": "" + } + ] + }, + { + "body": { + "nativeSrc": "9567:120:70", + "nodeType": "YulBlock", + "src": "9567:120:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "name": "pos", + "nativeSrc": "9588:3:70", + "nodeType": "YulIdentifier", + "src": "9588:3:70" + }, + { + "arguments": [ + { + "name": "srcPtr", + "nativeSrc": "9599:6:70", + "nodeType": "YulIdentifier", + "src": "9599:6:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "9593:5:70", + "nodeType": "YulIdentifier", + "src": "9593:5:70" + }, + "nativeSrc": "9593:13:70", + "nodeType": "YulFunctionCall", + "src": "9593:13:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "9581:6:70", + "nodeType": "YulIdentifier", + "src": "9581:6:70" + }, + "nativeSrc": "9581:26:70", + "nodeType": "YulFunctionCall", + "src": "9581:26:70" + }, + "nativeSrc": "9581:26:70", + "nodeType": "YulExpressionStatement", + "src": "9581:26:70" + }, + { + "nativeSrc": "9620:19:70", + "nodeType": "YulAssignment", + "src": "9620:19:70", + "value": { + "arguments": [ + { + "name": "pos", + "nativeSrc": "9631:3:70", + "nodeType": "YulIdentifier", + "src": "9631:3:70" + }, + { + "kind": "number", + "nativeSrc": "9636:2:70", + "nodeType": "YulLiteral", + "src": "9636:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "9627:3:70", + "nodeType": "YulIdentifier", + "src": "9627:3:70" + }, + "nativeSrc": "9627:12:70", + "nodeType": "YulFunctionCall", + "src": "9627:12:70" + }, + "variableNames": [ + { + "name": "pos", + "nativeSrc": "9620:3:70", + "nodeType": "YulIdentifier", + "src": "9620:3:70" + } + ] + }, + { + "nativeSrc": "9652:25:70", + "nodeType": "YulAssignment", + "src": "9652:25:70", + "value": { + "arguments": [ + { + "name": "srcPtr", + "nativeSrc": "9666:6:70", + "nodeType": "YulIdentifier", + "src": "9666:6:70" + }, + { + "kind": "number", + "nativeSrc": "9674:2:70", + "nodeType": "YulLiteral", + "src": "9674:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "9662:3:70", + "nodeType": "YulIdentifier", + "src": "9662:3:70" + }, + "nativeSrc": "9662:15:70", + "nodeType": "YulFunctionCall", + "src": "9662:15:70" + }, + "variableNames": [ + { + "name": "srcPtr", + "nativeSrc": "9652:6:70", + "nodeType": "YulIdentifier", + "src": "9652:6:70" + } + ] + } + ] + }, + "condition": { + "arguments": [ + { + "name": "i", + "nativeSrc": "9529:1:70", + "nodeType": "YulIdentifier", + "src": "9529:1:70" + }, + { + "name": "length", + "nativeSrc": "9532:6:70", + "nodeType": "YulIdentifier", + "src": "9532:6:70" + } + ], + "functionName": { + "name": "lt", + "nativeSrc": "9526:2:70", + "nodeType": "YulIdentifier", + "src": "9526:2:70" + }, + "nativeSrc": "9526:13:70", + "nodeType": "YulFunctionCall", + "src": "9526:13:70" + }, + "nativeSrc": "9518:169:70", + "nodeType": "YulForLoop", + "post": { + "nativeSrc": "9540:18:70", + "nodeType": "YulBlock", + "src": "9540:18:70", + "statements": [ + { + "nativeSrc": "9542:14:70", + "nodeType": "YulAssignment", + "src": "9542:14:70", + "value": { + "arguments": [ + { + "name": "i", + "nativeSrc": "9551:1:70", + "nodeType": "YulIdentifier", + "src": "9551:1:70" + }, + { + "kind": "number", + "nativeSrc": "9554:1:70", + "nodeType": "YulLiteral", + "src": "9554:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "9547:3:70", + "nodeType": "YulIdentifier", + "src": "9547:3:70" + }, + "nativeSrc": "9547:9:70", + "nodeType": "YulFunctionCall", + "src": "9547:9:70" + }, + "variableNames": [ + { + "name": "i", + "nativeSrc": "9542:1:70", + "nodeType": "YulIdentifier", + "src": "9542:1:70" + } + ] + } + ] + }, + "pre": { + "nativeSrc": "9522:3:70", + "nodeType": "YulBlock", + "src": "9522:3:70", + "statements": [] + }, + "src": "9518:169:70" + }, + { + "nativeSrc": "9696:11:70", + "nodeType": "YulAssignment", + "src": "9696:11:70", + "value": { + "name": "pos", + "nativeSrc": "9704:3:70", + "nodeType": "YulIdentifier", + "src": "9704:3:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "9696:4:70", + "nodeType": "YulIdentifier", + "src": "9696:4:70" + } + ] + } + ] + }, + "name": "abi_encode_tuple_t_bytes1_t_string_memory_ptr_t_string_memory_ptr_t_uint256_t_address_t_bytes32_t_array$_t_uint256_$dyn_memory_ptr__to_t_bytes1_t_string_memory_ptr_t_string_memory_ptr_t_uint256_t_address_t_bytes32_t_array$_t_uint256_$dyn_memory_ptr__fromStack_reversed", + "nativeSrc": "8475:1238:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "8753:9:70", + "nodeType": "YulTypedName", + "src": "8753:9:70", + "type": "" + }, + { + "name": "value6", + "nativeSrc": "8764:6:70", + "nodeType": "YulTypedName", + "src": "8764:6:70", + "type": "" + }, + { + "name": "value5", + "nativeSrc": "8772:6:70", + "nodeType": "YulTypedName", + "src": "8772:6:70", + "type": "" + }, + { + "name": "value4", + "nativeSrc": "8780:6:70", + "nodeType": "YulTypedName", + "src": "8780:6:70", + "type": "" + }, + { + "name": "value3", + "nativeSrc": "8788:6:70", + "nodeType": "YulTypedName", + "src": "8788:6:70", + "type": "" + }, + { + "name": "value2", + "nativeSrc": "8796:6:70", + "nodeType": "YulTypedName", + "src": "8796:6:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "8804:6:70", + "nodeType": "YulTypedName", + "src": "8804:6:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "8812:6:70", + "nodeType": "YulTypedName", + "src": "8812:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "8823:4:70", + "nodeType": "YulTypedName", + "src": "8823:4:70", + "type": "" + } + ], + "src": "8475:1238:70" + }, + { + "body": { + "nativeSrc": "9834:505:70", + "nodeType": "YulBlock", + "src": "9834:505:70", + "statements": [ + { + "body": { + "nativeSrc": "9880:16:70", + "nodeType": "YulBlock", + "src": "9880:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "9889:1:70", + "nodeType": "YulLiteral", + "src": "9889:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "9892:1:70", + "nodeType": "YulLiteral", + "src": "9892:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "9882:6:70", + "nodeType": "YulIdentifier", + "src": "9882:6:70" + }, + "nativeSrc": "9882:12:70", + "nodeType": "YulFunctionCall", + "src": "9882:12:70" + }, + "nativeSrc": "9882:12:70", + "nodeType": "YulExpressionStatement", + "src": "9882:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "dataEnd", + "nativeSrc": "9855:7:70", + "nodeType": "YulIdentifier", + "src": "9855:7:70" + }, + { + "name": "headStart", + "nativeSrc": "9864:9:70", + "nodeType": "YulIdentifier", + "src": "9864:9:70" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "9851:3:70", + "nodeType": "YulIdentifier", + "src": "9851:3:70" + }, + "nativeSrc": "9851:23:70", + "nodeType": "YulFunctionCall", + "src": "9851:23:70" + }, + { + "kind": "number", + "nativeSrc": "9876:2:70", + "nodeType": "YulLiteral", + "src": "9876:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "slt", + "nativeSrc": "9847:3:70", + "nodeType": "YulIdentifier", + "src": "9847:3:70" + }, + "nativeSrc": "9847:32:70", + "nodeType": "YulFunctionCall", + "src": "9847:32:70" + }, + "nativeSrc": "9844:52:70", + "nodeType": "YulIf", + "src": "9844:52:70" + }, + { + "nativeSrc": "9905:37:70", + "nodeType": "YulVariableDeclaration", + "src": "9905:37:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "9932:9:70", + "nodeType": "YulIdentifier", + "src": "9932:9:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "9919:12:70", + "nodeType": "YulIdentifier", + "src": "9919:12:70" + }, + "nativeSrc": "9919:23:70", + "nodeType": "YulFunctionCall", + "src": "9919:23:70" + }, + "variables": [ + { + "name": "offset", + "nativeSrc": "9909:6:70", + "nodeType": "YulTypedName", + "src": "9909:6:70", + "type": "" + } + ] + }, + { + "body": { + "nativeSrc": "9985:16:70", + "nodeType": "YulBlock", + "src": "9985:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "9994:1:70", + "nodeType": "YulLiteral", + "src": "9994:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "9997:1:70", + "nodeType": "YulLiteral", + "src": "9997:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "9987:6:70", + "nodeType": "YulIdentifier", + "src": "9987:6:70" + }, + "nativeSrc": "9987:12:70", + "nodeType": "YulFunctionCall", + "src": "9987:12:70" + }, + "nativeSrc": "9987:12:70", + "nodeType": "YulExpressionStatement", + "src": "9987:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "name": "offset", + "nativeSrc": "9957:6:70", + "nodeType": "YulIdentifier", + "src": "9957:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "9973:2:70", + "nodeType": "YulLiteral", + "src": "9973:2:70", + "type": "", + "value": "64" + }, + { + "kind": "number", + "nativeSrc": "9977:1:70", + "nodeType": "YulLiteral", + "src": "9977:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "9969:3:70", + "nodeType": "YulIdentifier", + "src": "9969:3:70" + }, + "nativeSrc": "9969:10:70", + "nodeType": "YulFunctionCall", + "src": "9969:10:70" + }, + { + "kind": "number", + "nativeSrc": "9981:1:70", + "nodeType": "YulLiteral", + "src": "9981:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "9965:3:70", + "nodeType": "YulIdentifier", + "src": "9965:3:70" + }, + "nativeSrc": "9965:18:70", + "nodeType": "YulFunctionCall", + "src": "9965:18:70" + } + ], + "functionName": { + "name": "gt", + "nativeSrc": "9954:2:70", + "nodeType": "YulIdentifier", + "src": "9954:2:70" + }, + "nativeSrc": "9954:30:70", + "nodeType": "YulFunctionCall", + "src": "9954:30:70" + }, + "nativeSrc": "9951:50:70", + "nodeType": "YulIf", + "src": "9951:50:70" + }, + { + "nativeSrc": "10010:32:70", + "nodeType": "YulVariableDeclaration", + "src": "10010:32:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "10024:9:70", + "nodeType": "YulIdentifier", + "src": "10024:9:70" + }, + { + "name": "offset", + "nativeSrc": "10035:6:70", + "nodeType": "YulIdentifier", + "src": "10035:6:70" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "10020:3:70", + "nodeType": "YulIdentifier", + "src": "10020:3:70" + }, + "nativeSrc": "10020:22:70", + "nodeType": "YulFunctionCall", + "src": "10020:22:70" + }, + "variables": [ + { + "name": "_1", + "nativeSrc": "10014:2:70", + "nodeType": "YulTypedName", + "src": "10014:2:70", + "type": "" + } + ] + }, + { + "body": { + "nativeSrc": "10090:16:70", + "nodeType": "YulBlock", + "src": "10090:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "10099:1:70", + "nodeType": "YulLiteral", + "src": "10099:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "10102:1:70", + "nodeType": "YulLiteral", + "src": "10102:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "10092:6:70", + "nodeType": "YulIdentifier", + "src": "10092:6:70" + }, + "nativeSrc": "10092:12:70", + "nodeType": "YulFunctionCall", + "src": "10092:12:70" + }, + "nativeSrc": "10092:12:70", + "nodeType": "YulExpressionStatement", + "src": "10092:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "arguments": [ + { + "name": "_1", + "nativeSrc": "10069:2:70", + "nodeType": "YulIdentifier", + "src": "10069:2:70" + }, + { + "kind": "number", + "nativeSrc": "10073:4:70", + "nodeType": "YulLiteral", + "src": "10073:4:70", + "type": "", + "value": "0x1f" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "10065:3:70", + "nodeType": "YulIdentifier", + "src": "10065:3:70" + }, + "nativeSrc": "10065:13:70", + "nodeType": "YulFunctionCall", + "src": "10065:13:70" + }, + { + "name": "dataEnd", + "nativeSrc": "10080:7:70", + "nodeType": "YulIdentifier", + "src": "10080:7:70" + } + ], + "functionName": { + "name": "slt", + "nativeSrc": "10061:3:70", + "nodeType": "YulIdentifier", + "src": "10061:3:70" + }, + "nativeSrc": "10061:27:70", + "nodeType": "YulFunctionCall", + "src": "10061:27:70" + } + ], + "functionName": { + "name": "iszero", + "nativeSrc": "10054:6:70", + "nodeType": "YulIdentifier", + "src": "10054:6:70" + }, + "nativeSrc": "10054:35:70", + "nodeType": "YulFunctionCall", + "src": "10054:35:70" + }, + "nativeSrc": "10051:55:70", + "nodeType": "YulIf", + "src": "10051:55:70" + }, + { + "nativeSrc": "10115:30:70", + "nodeType": "YulVariableDeclaration", + "src": "10115:30:70", + "value": { + "arguments": [ + { + "name": "_1", + "nativeSrc": "10142:2:70", + "nodeType": "YulIdentifier", + "src": "10142:2:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "10129:12:70", + "nodeType": "YulIdentifier", + "src": "10129:12:70" + }, + "nativeSrc": "10129:16:70", + "nodeType": "YulFunctionCall", + "src": "10129:16:70" + }, + "variables": [ + { + "name": "length", + "nativeSrc": "10119:6:70", + "nodeType": "YulTypedName", + "src": "10119:6:70", + "type": "" + } + ] + }, + { + "body": { + "nativeSrc": "10188:16:70", + "nodeType": "YulBlock", + "src": "10188:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "10197:1:70", + "nodeType": "YulLiteral", + "src": "10197:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "10200:1:70", + "nodeType": "YulLiteral", + "src": "10200:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "10190:6:70", + "nodeType": "YulIdentifier", + "src": "10190:6:70" + }, + "nativeSrc": "10190:12:70", + "nodeType": "YulFunctionCall", + "src": "10190:12:70" + }, + "nativeSrc": "10190:12:70", + "nodeType": "YulExpressionStatement", + "src": "10190:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "name": "length", + "nativeSrc": "10160:6:70", + "nodeType": "YulIdentifier", + "src": "10160:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "10176:2:70", + "nodeType": "YulLiteral", + "src": "10176:2:70", + "type": "", + "value": "64" + }, + { + "kind": "number", + "nativeSrc": "10180:1:70", + "nodeType": "YulLiteral", + "src": "10180:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "10172:3:70", + "nodeType": "YulIdentifier", + "src": "10172:3:70" + }, + "nativeSrc": "10172:10:70", + "nodeType": "YulFunctionCall", + "src": "10172:10:70" + }, + { + "kind": "number", + "nativeSrc": "10184:1:70", + "nodeType": "YulLiteral", + "src": "10184:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "10168:3:70", + "nodeType": "YulIdentifier", + "src": "10168:3:70" + }, + "nativeSrc": "10168:18:70", + "nodeType": "YulFunctionCall", + "src": "10168:18:70" + } + ], + "functionName": { + "name": "gt", + "nativeSrc": "10157:2:70", + "nodeType": "YulIdentifier", + "src": "10157:2:70" + }, + "nativeSrc": "10157:30:70", + "nodeType": "YulFunctionCall", + "src": "10157:30:70" + }, + "nativeSrc": "10154:50:70", + "nodeType": "YulIf", + "src": "10154:50:70" + }, + { + "body": { + "nativeSrc": "10262:16:70", + "nodeType": "YulBlock", + "src": "10262:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "10271:1:70", + "nodeType": "YulLiteral", + "src": "10271:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "10274:1:70", + "nodeType": "YulLiteral", + "src": "10274:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "10264:6:70", + "nodeType": "YulIdentifier", + "src": "10264:6:70" + }, + "nativeSrc": "10264:12:70", + "nodeType": "YulFunctionCall", + "src": "10264:12:70" + }, + "nativeSrc": "10264:12:70", + "nodeType": "YulExpressionStatement", + "src": "10264:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "arguments": [ + { + "name": "_1", + "nativeSrc": "10227:2:70", + "nodeType": "YulIdentifier", + "src": "10227:2:70" + }, + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "10235:1:70", + "nodeType": "YulLiteral", + "src": "10235:1:70", + "type": "", + "value": "5" + }, + { + "name": "length", + "nativeSrc": "10238:6:70", + "nodeType": "YulIdentifier", + "src": "10238:6:70" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "10231:3:70", + "nodeType": "YulIdentifier", + "src": "10231:3:70" + }, + "nativeSrc": "10231:14:70", + "nodeType": "YulFunctionCall", + "src": "10231:14:70" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "10223:3:70", + "nodeType": "YulIdentifier", + "src": "10223:3:70" + }, + "nativeSrc": "10223:23:70", + "nodeType": "YulFunctionCall", + "src": "10223:23:70" + }, + { + "kind": "number", + "nativeSrc": "10248:2:70", + "nodeType": "YulLiteral", + "src": "10248:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "10219:3:70", + "nodeType": "YulIdentifier", + "src": "10219:3:70" + }, + "nativeSrc": "10219:32:70", + "nodeType": "YulFunctionCall", + "src": "10219:32:70" + }, + { + "name": "dataEnd", + "nativeSrc": "10253:7:70", + "nodeType": "YulIdentifier", + "src": "10253:7:70" + } + ], + "functionName": { + "name": "gt", + "nativeSrc": "10216:2:70", + "nodeType": "YulIdentifier", + "src": "10216:2:70" + }, + "nativeSrc": "10216:45:70", + "nodeType": "YulFunctionCall", + "src": "10216:45:70" + }, + "nativeSrc": "10213:65:70", + "nodeType": "YulIf", + "src": "10213:65:70" + }, + { + "nativeSrc": "10287:21:70", + "nodeType": "YulAssignment", + "src": "10287:21:70", + "value": { + "arguments": [ + { + "name": "_1", + "nativeSrc": "10301:2:70", + "nodeType": "YulIdentifier", + "src": "10301:2:70" + }, + { + "kind": "number", + "nativeSrc": "10305:2:70", + "nodeType": "YulLiteral", + "src": "10305:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "10297:3:70", + "nodeType": "YulIdentifier", + "src": "10297:3:70" + }, + "nativeSrc": "10297:11:70", + "nodeType": "YulFunctionCall", + "src": "10297:11:70" + }, + "variableNames": [ + { + "name": "value0", + "nativeSrc": "10287:6:70", + "nodeType": "YulIdentifier", + "src": "10287:6:70" + } + ] + }, + { + "nativeSrc": "10317:16:70", + "nodeType": "YulAssignment", + "src": "10317:16:70", + "value": { + "name": "length", + "nativeSrc": "10327:6:70", + "nodeType": "YulIdentifier", + "src": "10327:6:70" + }, + "variableNames": [ + { + "name": "value1", + "nativeSrc": "10317:6:70", + "nodeType": "YulIdentifier", + "src": "10317:6:70" + } + ] + } + ] + }, + "name": "abi_decode_tuple_t_array$_t_bytes_calldata_ptr_$dyn_calldata_ptr", + "nativeSrc": "9718:621:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "9792:9:70", + "nodeType": "YulTypedName", + "src": "9792:9:70", + "type": "" + }, + { + "name": "dataEnd", + "nativeSrc": "9803:7:70", + "nodeType": "YulTypedName", + "src": "9803:7:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value0", + "nativeSrc": "9815:6:70", + "nodeType": "YulTypedName", + "src": "9815:6:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "9823:6:70", + "nodeType": "YulTypedName", + "src": "9823:6:70", + "type": "" + } + ], + "src": "9718:621:70" + }, + { + "body": { + "nativeSrc": "10513:611:70", + "nodeType": "YulBlock", + "src": "10513:611:70", + "statements": [ + { + "nativeSrc": "10523:32:70", + "nodeType": "YulVariableDeclaration", + "src": "10523:32:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "10541:9:70", + "nodeType": "YulIdentifier", + "src": "10541:9:70" + }, + { + "kind": "number", + "nativeSrc": "10552:2:70", + "nodeType": "YulLiteral", + "src": "10552:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "10537:3:70", + "nodeType": "YulIdentifier", + "src": "10537:3:70" + }, + "nativeSrc": "10537:18:70", + "nodeType": "YulFunctionCall", + "src": "10537:18:70" + }, + "variables": [ + { + "name": "tail_1", + "nativeSrc": "10527:6:70", + "nodeType": "YulTypedName", + "src": "10527:6:70", + "type": "" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "10571:9:70", + "nodeType": "YulIdentifier", + "src": "10571:9:70" + }, + { + "kind": "number", + "nativeSrc": "10582:2:70", + "nodeType": "YulLiteral", + "src": "10582:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "10564:6:70", + "nodeType": "YulIdentifier", + "src": "10564:6:70" + }, + "nativeSrc": "10564:21:70", + "nodeType": "YulFunctionCall", + "src": "10564:21:70" + }, + "nativeSrc": "10564:21:70", + "nodeType": "YulExpressionStatement", + "src": "10564:21:70" + }, + { + "nativeSrc": "10594:17:70", + "nodeType": "YulVariableDeclaration", + "src": "10594:17:70", + "value": { + "name": "tail_1", + "nativeSrc": "10605:6:70", + "nodeType": "YulIdentifier", + "src": "10605:6:70" + }, + "variables": [ + { + "name": "pos", + "nativeSrc": "10598:3:70", + "nodeType": "YulTypedName", + "src": "10598:3:70", + "type": "" + } + ] + }, + { + "nativeSrc": "10620:27:70", + "nodeType": "YulVariableDeclaration", + "src": "10620:27:70", + "value": { + "arguments": [ + { + "name": "value0", + "nativeSrc": "10640:6:70", + "nodeType": "YulIdentifier", + "src": "10640:6:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "10634:5:70", + "nodeType": "YulIdentifier", + "src": "10634:5:70" + }, + "nativeSrc": "10634:13:70", + "nodeType": "YulFunctionCall", + "src": "10634:13:70" + }, + "variables": [ + { + "name": "length", + "nativeSrc": "10624:6:70", + "nodeType": "YulTypedName", + "src": "10624:6:70", + "type": "" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "tail_1", + "nativeSrc": "10663:6:70", + "nodeType": "YulIdentifier", + "src": "10663:6:70" + }, + { + "name": "length", + "nativeSrc": "10671:6:70", + "nodeType": "YulIdentifier", + "src": "10671:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "10656:6:70", + "nodeType": "YulIdentifier", + "src": "10656:6:70" + }, + "nativeSrc": "10656:22:70", + "nodeType": "YulFunctionCall", + "src": "10656:22:70" + }, + "nativeSrc": "10656:22:70", + "nodeType": "YulExpressionStatement", + "src": "10656:22:70" + }, + { + "nativeSrc": "10687:25:70", + "nodeType": "YulAssignment", + "src": "10687:25:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "10698:9:70", + "nodeType": "YulIdentifier", + "src": "10698:9:70" + }, + { + "kind": "number", + "nativeSrc": "10709:2:70", + "nodeType": "YulLiteral", + "src": "10709:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "10694:3:70", + "nodeType": "YulIdentifier", + "src": "10694:3:70" + }, + "nativeSrc": "10694:18:70", + "nodeType": "YulFunctionCall", + "src": "10694:18:70" + }, + "variableNames": [ + { + "name": "pos", + "nativeSrc": "10687:3:70", + "nodeType": "YulIdentifier", + "src": "10687:3:70" + } + ] + }, + { + "nativeSrc": "10721:53:70", + "nodeType": "YulVariableDeclaration", + "src": "10721:53:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "10743:9:70", + "nodeType": "YulIdentifier", + "src": "10743:9:70" + }, + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "10758:1:70", + "nodeType": "YulLiteral", + "src": "10758:1:70", + "type": "", + "value": "5" + }, + { + "name": "length", + "nativeSrc": "10761:6:70", + "nodeType": "YulIdentifier", + "src": "10761:6:70" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "10754:3:70", + "nodeType": "YulIdentifier", + "src": "10754:3:70" + }, + "nativeSrc": "10754:14:70", + "nodeType": "YulFunctionCall", + "src": "10754:14:70" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "10739:3:70", + "nodeType": "YulIdentifier", + "src": "10739:3:70" + }, + "nativeSrc": "10739:30:70", + "nodeType": "YulFunctionCall", + "src": "10739:30:70" + }, + { + "kind": "number", + "nativeSrc": "10771:2:70", + "nodeType": "YulLiteral", + "src": "10771:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "10735:3:70", + "nodeType": "YulIdentifier", + "src": "10735:3:70" + }, + "nativeSrc": "10735:39:70", + "nodeType": "YulFunctionCall", + "src": "10735:39:70" + }, + "variables": [ + { + "name": "tail_2", + "nativeSrc": "10725:6:70", + "nodeType": "YulTypedName", + "src": "10725:6:70", + "type": "" + } + ] + }, + { + "nativeSrc": "10783:29:70", + "nodeType": "YulVariableDeclaration", + "src": "10783:29:70", + "value": { + "arguments": [ + { + "name": "value0", + "nativeSrc": "10801:6:70", + "nodeType": "YulIdentifier", + "src": "10801:6:70" + }, + { + "kind": "number", + "nativeSrc": "10809:2:70", + "nodeType": "YulLiteral", + "src": "10809:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "10797:3:70", + "nodeType": "YulIdentifier", + "src": "10797:3:70" + }, + "nativeSrc": "10797:15:70", + "nodeType": "YulFunctionCall", + "src": "10797:15:70" + }, + "variables": [ + { + "name": "srcPtr", + "nativeSrc": "10787:6:70", + "nodeType": "YulTypedName", + "src": "10787:6:70", + "type": "" + } + ] + }, + { + "nativeSrc": "10821:10:70", + "nodeType": "YulVariableDeclaration", + "src": "10821:10:70", + "value": { + "kind": "number", + "nativeSrc": "10830:1:70", + "nodeType": "YulLiteral", + "src": "10830:1:70", + "type": "", + "value": "0" + }, + "variables": [ + { + "name": "i", + "nativeSrc": "10825:1:70", + "nodeType": "YulTypedName", + "src": "10825:1:70", + "type": "" + } + ] + }, + { + "body": { + "nativeSrc": "10889:206:70", + "nodeType": "YulBlock", + "src": "10889:206:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "name": "pos", + "nativeSrc": "10910:3:70", + "nodeType": "YulIdentifier", + "src": "10910:3:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "name": "tail_2", + "nativeSrc": "10923:6:70", + "nodeType": "YulIdentifier", + "src": "10923:6:70" + }, + { + "name": "headStart", + "nativeSrc": "10931:9:70", + "nodeType": "YulIdentifier", + "src": "10931:9:70" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "10919:3:70", + "nodeType": "YulIdentifier", + "src": "10919:3:70" + }, + "nativeSrc": "10919:22:70", + "nodeType": "YulFunctionCall", + "src": "10919:22:70" + }, + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "10947:2:70", + "nodeType": "YulLiteral", + "src": "10947:2:70", + "type": "", + "value": "63" + } + ], + "functionName": { + "name": "not", + "nativeSrc": "10943:3:70", + "nodeType": "YulIdentifier", + "src": "10943:3:70" + }, + "nativeSrc": "10943:7:70", + "nodeType": "YulFunctionCall", + "src": "10943:7:70" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "10915:3:70", + "nodeType": "YulIdentifier", + "src": "10915:3:70" + }, + "nativeSrc": "10915:36:70", + "nodeType": "YulFunctionCall", + "src": "10915:36:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "10903:6:70", + "nodeType": "YulIdentifier", + "src": "10903:6:70" + }, + "nativeSrc": "10903:49:70", + "nodeType": "YulFunctionCall", + "src": "10903:49:70" + }, + "nativeSrc": "10903:49:70", + "nodeType": "YulExpressionStatement", + "src": "10903:49:70" + }, + { + "nativeSrc": "10965:50:70", + "nodeType": "YulAssignment", + "src": "10965:50:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "srcPtr", + "nativeSrc": "10999:6:70", + "nodeType": "YulIdentifier", + "src": "10999:6:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "10993:5:70", + "nodeType": "YulIdentifier", + "src": "10993:5:70" + }, + "nativeSrc": "10993:13:70", + "nodeType": "YulFunctionCall", + "src": "10993:13:70" + }, + { + "name": "tail_2", + "nativeSrc": "11008:6:70", + "nodeType": "YulIdentifier", + "src": "11008:6:70" + } + ], + "functionName": { + "name": "abi_encode_string", + "nativeSrc": "10975:17:70", + "nodeType": "YulIdentifier", + "src": "10975:17:70" + }, + "nativeSrc": "10975:40:70", + "nodeType": "YulFunctionCall", + "src": "10975:40:70" + }, + "variableNames": [ + { + "name": "tail_2", + "nativeSrc": "10965:6:70", + "nodeType": "YulIdentifier", + "src": "10965:6:70" + } + ] + }, + { + "nativeSrc": "11028:25:70", + "nodeType": "YulAssignment", + "src": "11028:25:70", + "value": { + "arguments": [ + { + "name": "srcPtr", + "nativeSrc": "11042:6:70", + "nodeType": "YulIdentifier", + "src": "11042:6:70" + }, + { + "kind": "number", + "nativeSrc": "11050:2:70", + "nodeType": "YulLiteral", + "src": "11050:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "11038:3:70", + "nodeType": "YulIdentifier", + "src": "11038:3:70" + }, + "nativeSrc": "11038:15:70", + "nodeType": "YulFunctionCall", + "src": "11038:15:70" + }, + "variableNames": [ + { + "name": "srcPtr", + "nativeSrc": "11028:6:70", + "nodeType": "YulIdentifier", + "src": "11028:6:70" + } + ] + }, + { + "nativeSrc": "11066:19:70", + "nodeType": "YulAssignment", + "src": "11066:19:70", + "value": { + "arguments": [ + { + "name": "pos", + "nativeSrc": "11077:3:70", + "nodeType": "YulIdentifier", + "src": "11077:3:70" + }, + { + "kind": "number", + "nativeSrc": "11082:2:70", + "nodeType": "YulLiteral", + "src": "11082:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "11073:3:70", + "nodeType": "YulIdentifier", + "src": "11073:3:70" + }, + "nativeSrc": "11073:12:70", + "nodeType": "YulFunctionCall", + "src": "11073:12:70" + }, + "variableNames": [ + { + "name": "pos", + "nativeSrc": "11066:3:70", + "nodeType": "YulIdentifier", + "src": "11066:3:70" + } + ] + } + ] + }, + "condition": { + "arguments": [ + { + "name": "i", + "nativeSrc": "10851:1:70", + "nodeType": "YulIdentifier", + "src": "10851:1:70" + }, + { + "name": "length", + "nativeSrc": "10854:6:70", + "nodeType": "YulIdentifier", + "src": "10854:6:70" + } + ], + "functionName": { + "name": "lt", + "nativeSrc": "10848:2:70", + "nodeType": "YulIdentifier", + "src": "10848:2:70" + }, + "nativeSrc": "10848:13:70", + "nodeType": "YulFunctionCall", + "src": "10848:13:70" + }, + "nativeSrc": "10840:255:70", + "nodeType": "YulForLoop", + "post": { + "nativeSrc": "10862:18:70", + "nodeType": "YulBlock", + "src": "10862:18:70", + "statements": [ + { + "nativeSrc": "10864:14:70", + "nodeType": "YulAssignment", + "src": "10864:14:70", + "value": { + "arguments": [ + { + "name": "i", + "nativeSrc": "10873:1:70", + "nodeType": "YulIdentifier", + "src": "10873:1:70" + }, + { + "kind": "number", + "nativeSrc": "10876:1:70", + "nodeType": "YulLiteral", + "src": "10876:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "10869:3:70", + "nodeType": "YulIdentifier", + "src": "10869:3:70" + }, + "nativeSrc": "10869:9:70", + "nodeType": "YulFunctionCall", + "src": "10869:9:70" + }, + "variableNames": [ + { + "name": "i", + "nativeSrc": "10864:1:70", + "nodeType": "YulIdentifier", + "src": "10864:1:70" + } + ] + } + ] + }, + "pre": { + "nativeSrc": "10844:3:70", + "nodeType": "YulBlock", + "src": "10844:3:70", + "statements": [] + }, + "src": "10840:255:70" + }, + { + "nativeSrc": "11104:14:70", + "nodeType": "YulAssignment", + "src": "11104:14:70", + "value": { + "name": "tail_2", + "nativeSrc": "11112:6:70", + "nodeType": "YulIdentifier", + "src": "11112:6:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "11104:4:70", + "nodeType": "YulIdentifier", + "src": "11104:4:70" + } + ] + } + ] + }, + "name": "abi_encode_tuple_t_array$_t_bytes_memory_ptr_$dyn_memory_ptr__to_t_array$_t_bytes_memory_ptr_$dyn_memory_ptr__fromStack_reversed", + "nativeSrc": "10344:780:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "10482:9:70", + "nodeType": "YulTypedName", + "src": "10482:9:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "10493:6:70", + "nodeType": "YulTypedName", + "src": "10493:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "10504:4:70", + "nodeType": "YulTypedName", + "src": "10504:4:70", + "type": "" + } + ], + "src": "10344:780:70" + }, + { + "body": { + "nativeSrc": "11269:571:70", + "nodeType": "YulBlock", + "src": "11269:571:70", + "statements": [ + { + "body": { + "nativeSrc": "11315:16:70", + "nodeType": "YulBlock", + "src": "11315:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "11324:1:70", + "nodeType": "YulLiteral", + "src": "11324:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "11327:1:70", + "nodeType": "YulLiteral", + "src": "11327:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "11317:6:70", + "nodeType": "YulIdentifier", + "src": "11317:6:70" + }, + "nativeSrc": "11317:12:70", + "nodeType": "YulFunctionCall", + "src": "11317:12:70" + }, + "nativeSrc": "11317:12:70", + "nodeType": "YulExpressionStatement", + "src": "11317:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "dataEnd", + "nativeSrc": "11290:7:70", + "nodeType": "YulIdentifier", + "src": "11290:7:70" + }, + { + "name": "headStart", + "nativeSrc": "11299:9:70", + "nodeType": "YulIdentifier", + "src": "11299:9:70" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "11286:3:70", + "nodeType": "YulIdentifier", + "src": "11286:3:70" + }, + "nativeSrc": "11286:23:70", + "nodeType": "YulFunctionCall", + "src": "11286:23:70" + }, + { + "kind": "number", + "nativeSrc": "11311:2:70", + "nodeType": "YulLiteral", + "src": "11311:2:70", + "type": "", + "value": "96" + } + ], + "functionName": { + "name": "slt", + "nativeSrc": "11282:3:70", + "nodeType": "YulIdentifier", + "src": "11282:3:70" + }, + "nativeSrc": "11282:32:70", + "nodeType": "YulFunctionCall", + "src": "11282:32:70" + }, + "nativeSrc": "11279:52:70", + "nodeType": "YulIf", + "src": "11279:52:70" + }, + { + "nativeSrc": "11340:36:70", + "nodeType": "YulVariableDeclaration", + "src": "11340:36:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "11366:9:70", + "nodeType": "YulIdentifier", + "src": "11366:9:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "11353:12:70", + "nodeType": "YulIdentifier", + "src": "11353:12:70" + }, + "nativeSrc": "11353:23:70", + "nodeType": "YulFunctionCall", + "src": "11353:23:70" + }, + "variables": [ + { + "name": "value", + "nativeSrc": "11344:5:70", + "nodeType": "YulTypedName", + "src": "11344:5:70", + "type": "" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "value", + "nativeSrc": "11410:5:70", + "nodeType": "YulIdentifier", + "src": "11410:5:70" + } + ], + "functionName": { + "name": "validator_revert_address", + "nativeSrc": "11385:24:70", + "nodeType": "YulIdentifier", + "src": "11385:24:70" + }, + "nativeSrc": "11385:31:70", + "nodeType": "YulFunctionCall", + "src": "11385:31:70" + }, + "nativeSrc": "11385:31:70", + "nodeType": "YulExpressionStatement", + "src": "11385:31:70" + }, + { + "nativeSrc": "11425:15:70", + "nodeType": "YulAssignment", + "src": "11425:15:70", + "value": { + "name": "value", + "nativeSrc": "11435:5:70", + "nodeType": "YulIdentifier", + "src": "11435:5:70" + }, + "variableNames": [ + { + "name": "value0", + "nativeSrc": "11425:6:70", + "nodeType": "YulIdentifier", + "src": "11425:6:70" + } + ] + }, + { + "nativeSrc": "11449:47:70", + "nodeType": "YulVariableDeclaration", + "src": "11449:47:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "11481:9:70", + "nodeType": "YulIdentifier", + "src": "11481:9:70" + }, + { + "kind": "number", + "nativeSrc": "11492:2:70", + "nodeType": "YulLiteral", + "src": "11492:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "11477:3:70", + "nodeType": "YulIdentifier", + "src": "11477:3:70" + }, + "nativeSrc": "11477:18:70", + "nodeType": "YulFunctionCall", + "src": "11477:18:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "11464:12:70", + "nodeType": "YulIdentifier", + "src": "11464:12:70" + }, + "nativeSrc": "11464:32:70", + "nodeType": "YulFunctionCall", + "src": "11464:32:70" + }, + "variables": [ + { + "name": "value_1", + "nativeSrc": "11453:7:70", + "nodeType": "YulTypedName", + "src": "11453:7:70", + "type": "" + } + ] + }, + { + "body": { + "nativeSrc": "11531:16:70", + "nodeType": "YulBlock", + "src": "11531:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "11540:1:70", + "nodeType": "YulLiteral", + "src": "11540:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "11543:1:70", + "nodeType": "YulLiteral", + "src": "11543:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "11533:6:70", + "nodeType": "YulIdentifier", + "src": "11533:6:70" + }, + "nativeSrc": "11533:12:70", + "nodeType": "YulFunctionCall", + "src": "11533:12:70" + }, + "nativeSrc": "11533:12:70", + "nodeType": "YulExpressionStatement", + "src": "11533:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "value_1", + "nativeSrc": "11518:7:70", + "nodeType": "YulIdentifier", + "src": "11518:7:70" + }, + { + "kind": "number", + "nativeSrc": "11527:1:70", + "nodeType": "YulLiteral", + "src": "11527:1:70", + "type": "", + "value": "3" + } + ], + "functionName": { + "name": "lt", + "nativeSrc": "11515:2:70", + "nodeType": "YulIdentifier", + "src": "11515:2:70" + }, + "nativeSrc": "11515:14:70", + "nodeType": "YulFunctionCall", + "src": "11515:14:70" + } + ], + "functionName": { + "name": "iszero", + "nativeSrc": "11508:6:70", + "nodeType": "YulIdentifier", + "src": "11508:6:70" + }, + "nativeSrc": "11508:22:70", + "nodeType": "YulFunctionCall", + "src": "11508:22:70" + }, + "nativeSrc": "11505:42:70", + "nodeType": "YulIf", + "src": "11505:42:70" + }, + { + "nativeSrc": "11556:17:70", + "nodeType": "YulAssignment", + "src": "11556:17:70", + "value": { + "name": "value_1", + "nativeSrc": "11566:7:70", + "nodeType": "YulIdentifier", + "src": "11566:7:70" + }, + "variableNames": [ + { + "name": "value1", + "nativeSrc": "11556:6:70", + "nodeType": "YulIdentifier", + "src": "11556:6:70" + } + ] + }, + { + "nativeSrc": "11582:46:70", + "nodeType": "YulVariableDeclaration", + "src": "11582:46:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "11613:9:70", + "nodeType": "YulIdentifier", + "src": "11613:9:70" + }, + { + "kind": "number", + "nativeSrc": "11624:2:70", + "nodeType": "YulLiteral", + "src": "11624:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "11609:3:70", + "nodeType": "YulIdentifier", + "src": "11609:3:70" + }, + "nativeSrc": "11609:18:70", + "nodeType": "YulFunctionCall", + "src": "11609:18:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "11596:12:70", + "nodeType": "YulIdentifier", + "src": "11596:12:70" + }, + "nativeSrc": "11596:32:70", + "nodeType": "YulFunctionCall", + "src": "11596:32:70" + }, + "variables": [ + { + "name": "offset", + "nativeSrc": "11586:6:70", + "nodeType": "YulTypedName", + "src": "11586:6:70", + "type": "" + } + ] + }, + { + "body": { + "nativeSrc": "11671:16:70", + "nodeType": "YulBlock", + "src": "11671:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "11680:1:70", + "nodeType": "YulLiteral", + "src": "11680:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "11683:1:70", + "nodeType": "YulLiteral", + "src": "11683:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "11673:6:70", + "nodeType": "YulIdentifier", + "src": "11673:6:70" + }, + "nativeSrc": "11673:12:70", + "nodeType": "YulFunctionCall", + "src": "11673:12:70" + }, + "nativeSrc": "11673:12:70", + "nodeType": "YulExpressionStatement", + "src": "11673:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "name": "offset", + "nativeSrc": "11643:6:70", + "nodeType": "YulIdentifier", + "src": "11643:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "11659:2:70", + "nodeType": "YulLiteral", + "src": "11659:2:70", + "type": "", + "value": "64" + }, + { + "kind": "number", + "nativeSrc": "11663:1:70", + "nodeType": "YulLiteral", + "src": "11663:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "11655:3:70", + "nodeType": "YulIdentifier", + "src": "11655:3:70" + }, + "nativeSrc": "11655:10:70", + "nodeType": "YulFunctionCall", + "src": "11655:10:70" + }, + { + "kind": "number", + "nativeSrc": "11667:1:70", + "nodeType": "YulLiteral", + "src": "11667:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "11651:3:70", + "nodeType": "YulIdentifier", + "src": "11651:3:70" + }, + "nativeSrc": "11651:18:70", + "nodeType": "YulFunctionCall", + "src": "11651:18:70" + } + ], + "functionName": { + "name": "gt", + "nativeSrc": "11640:2:70", + "nodeType": "YulIdentifier", + "src": "11640:2:70" + }, + "nativeSrc": "11640:30:70", + "nodeType": "YulFunctionCall", + "src": "11640:30:70" + }, + "nativeSrc": "11637:50:70", + "nodeType": "YulIf", + "src": "11637:50:70" + }, + { + "nativeSrc": "11696:84:70", + "nodeType": "YulVariableDeclaration", + "src": "11696:84:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "11752:9:70", + "nodeType": "YulIdentifier", + "src": "11752:9:70" + }, + { + "name": "offset", + "nativeSrc": "11763:6:70", + "nodeType": "YulIdentifier", + "src": "11763:6:70" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "11748:3:70", + "nodeType": "YulIdentifier", + "src": "11748:3:70" + }, + "nativeSrc": "11748:22:70", + "nodeType": "YulFunctionCall", + "src": "11748:22:70" + }, + { + "name": "dataEnd", + "nativeSrc": "11772:7:70", + "nodeType": "YulIdentifier", + "src": "11772:7:70" + } + ], + "functionName": { + "name": "abi_decode_bytes_calldata", + "nativeSrc": "11722:25:70", + "nodeType": "YulIdentifier", + "src": "11722:25:70" + }, + "nativeSrc": "11722:58:70", + "nodeType": "YulFunctionCall", + "src": "11722:58:70" + }, + "variables": [ + { + "name": "value2_1", + "nativeSrc": "11700:8:70", + "nodeType": "YulTypedName", + "src": "11700:8:70", + "type": "" + }, + { + "name": "value3_1", + "nativeSrc": "11710:8:70", + "nodeType": "YulTypedName", + "src": "11710:8:70", + "type": "" + } + ] + }, + { + "nativeSrc": "11789:18:70", + "nodeType": "YulAssignment", + "src": "11789:18:70", + "value": { + "name": "value2_1", + "nativeSrc": "11799:8:70", + "nodeType": "YulIdentifier", + "src": "11799:8:70" + }, + "variableNames": [ + { + "name": "value2", + "nativeSrc": "11789:6:70", + "nodeType": "YulIdentifier", + "src": "11789:6:70" + } + ] + }, + { + "nativeSrc": "11816:18:70", + "nodeType": "YulAssignment", + "src": "11816:18:70", + "value": { + "name": "value3_1", + "nativeSrc": "11826:8:70", + "nodeType": "YulIdentifier", + "src": "11826:8:70" + }, + "variableNames": [ + { + "name": "value3", + "nativeSrc": "11816:6:70", + "nodeType": "YulIdentifier", + "src": "11816:6:70" + } + ] + } + ] + }, + "name": "abi_decode_tuple_t_addresst_enum$_PaymentTypes_$2433t_bytes_calldata_ptr", + "nativeSrc": "11129:711:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "11211:9:70", + "nodeType": "YulTypedName", + "src": "11211:9:70", + "type": "" + }, + { + "name": "dataEnd", + "nativeSrc": "11222:7:70", + "nodeType": "YulTypedName", + "src": "11222:7:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value0", + "nativeSrc": "11234:6:70", + "nodeType": "YulTypedName", + "src": "11234:6:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "11242:6:70", + "nodeType": "YulTypedName", + "src": "11242:6:70", + "type": "" + }, + { + "name": "value2", + "nativeSrc": "11250:6:70", + "nodeType": "YulTypedName", + "src": "11250:6:70", + "type": "" + }, + { + "name": "value3", + "nativeSrc": "11258:6:70", + "nodeType": "YulTypedName", + "src": "11258:6:70", + "type": "" + } + ], + "src": "11129:711:70" + }, + { + "body": { + "nativeSrc": "11965:507:70", + "nodeType": "YulBlock", + "src": "11965:507:70", + "statements": [ + { + "body": { + "nativeSrc": "12012:16:70", + "nodeType": "YulBlock", + "src": "12012:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "12021:1:70", + "nodeType": "YulLiteral", + "src": "12021:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "12024:1:70", + "nodeType": "YulLiteral", + "src": "12024:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "12014:6:70", + "nodeType": "YulIdentifier", + "src": "12014:6:70" + }, + "nativeSrc": "12014:12:70", + "nodeType": "YulFunctionCall", + "src": "12014:12:70" + }, + "nativeSrc": "12014:12:70", + "nodeType": "YulExpressionStatement", + "src": "12014:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "dataEnd", + "nativeSrc": "11986:7:70", + "nodeType": "YulIdentifier", + "src": "11986:7:70" + }, + { + "name": "headStart", + "nativeSrc": "11995:9:70", + "nodeType": "YulIdentifier", + "src": "11995:9:70" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "11982:3:70", + "nodeType": "YulIdentifier", + "src": "11982:3:70" + }, + "nativeSrc": "11982:23:70", + "nodeType": "YulFunctionCall", + "src": "11982:23:70" + }, + { + "kind": "number", + "nativeSrc": "12007:3:70", + "nodeType": "YulLiteral", + "src": "12007:3:70", + "type": "", + "value": "128" + } + ], + "functionName": { + "name": "slt", + "nativeSrc": "11978:3:70", + "nodeType": "YulIdentifier", + "src": "11978:3:70" + }, + "nativeSrc": "11978:33:70", + "nodeType": "YulFunctionCall", + "src": "11978:33:70" + }, + "nativeSrc": "11975:53:70", + "nodeType": "YulIf", + "src": "11975:53:70" + }, + { + "nativeSrc": "12037:36:70", + "nodeType": "YulVariableDeclaration", + "src": "12037:36:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "12063:9:70", + "nodeType": "YulIdentifier", + "src": "12063:9:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "12050:12:70", + "nodeType": "YulIdentifier", + "src": "12050:12:70" + }, + "nativeSrc": "12050:23:70", + "nodeType": "YulFunctionCall", + "src": "12050:23:70" + }, + "variables": [ + { + "name": "value", + "nativeSrc": "12041:5:70", + "nodeType": "YulTypedName", + "src": "12041:5:70", + "type": "" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "value", + "nativeSrc": "12107:5:70", + "nodeType": "YulIdentifier", + "src": "12107:5:70" + } + ], + "functionName": { + "name": "validator_revert_address", + "nativeSrc": "12082:24:70", + "nodeType": "YulIdentifier", + "src": "12082:24:70" + }, + "nativeSrc": "12082:31:70", + "nodeType": "YulFunctionCall", + "src": "12082:31:70" + }, + "nativeSrc": "12082:31:70", + "nodeType": "YulExpressionStatement", + "src": "12082:31:70" + }, + { + "nativeSrc": "12122:15:70", + "nodeType": "YulAssignment", + "src": "12122:15:70", + "value": { + "name": "value", + "nativeSrc": "12132:5:70", + "nodeType": "YulIdentifier", + "src": "12132:5:70" + }, + "variableNames": [ + { + "name": "value0", + "nativeSrc": "12122:6:70", + "nodeType": "YulIdentifier", + "src": "12122:6:70" + } + ] + }, + { + "nativeSrc": "12146:16:70", + "nodeType": "YulVariableDeclaration", + "src": "12146:16:70", + "value": { + "kind": "number", + "nativeSrc": "12161:1:70", + "nodeType": "YulLiteral", + "src": "12161:1:70", + "type": "", + "value": "0" + }, + "variables": [ + { + "name": "value_1", + "nativeSrc": "12150:7:70", + "nodeType": "YulTypedName", + "src": "12150:7:70", + "type": "" + } + ] + }, + { + "nativeSrc": "12171:43:70", + "nodeType": "YulAssignment", + "src": "12171:43:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "12199:9:70", + "nodeType": "YulIdentifier", + "src": "12199:9:70" + }, + { + "kind": "number", + "nativeSrc": "12210:2:70", + "nodeType": "YulLiteral", + "src": "12210:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "12195:3:70", + "nodeType": "YulIdentifier", + "src": "12195:3:70" + }, + "nativeSrc": "12195:18:70", + "nodeType": "YulFunctionCall", + "src": "12195:18:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "12182:12:70", + "nodeType": "YulIdentifier", + "src": "12182:12:70" + }, + "nativeSrc": "12182:32:70", + "nodeType": "YulFunctionCall", + "src": "12182:32:70" + }, + "variableNames": [ + { + "name": "value_1", + "nativeSrc": "12171:7:70", + "nodeType": "YulIdentifier", + "src": "12171:7:70" + } + ] + }, + { + "nativeSrc": "12223:17:70", + "nodeType": "YulAssignment", + "src": "12223:17:70", + "value": { + "name": "value_1", + "nativeSrc": "12233:7:70", + "nodeType": "YulIdentifier", + "src": "12233:7:70" + }, + "variableNames": [ + { + "name": "value1", + "nativeSrc": "12223:6:70", + "nodeType": "YulIdentifier", + "src": "12223:6:70" + } + ] + }, + { + "nativeSrc": "12249:47:70", + "nodeType": "YulVariableDeclaration", + "src": "12249:47:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "12281:9:70", + "nodeType": "YulIdentifier", + "src": "12281:9:70" + }, + { + "kind": "number", + "nativeSrc": "12292:2:70", + "nodeType": "YulLiteral", + "src": "12292:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "12277:3:70", + "nodeType": "YulIdentifier", + "src": "12277:3:70" + }, + "nativeSrc": "12277:18:70", + "nodeType": "YulFunctionCall", + "src": "12277:18:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "12264:12:70", + "nodeType": "YulIdentifier", + "src": "12264:12:70" + }, + "nativeSrc": "12264:32:70", + "nodeType": "YulFunctionCall", + "src": "12264:32:70" + }, + "variables": [ + { + "name": "value_2", + "nativeSrc": "12253:7:70", + "nodeType": "YulTypedName", + "src": "12253:7:70", + "type": "" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "value_2", + "nativeSrc": "12329:7:70", + "nodeType": "YulIdentifier", + "src": "12329:7:70" + } + ], + "functionName": { + "name": "validator_revert_uint32", + "nativeSrc": "12305:23:70", + "nodeType": "YulIdentifier", + "src": "12305:23:70" + }, + "nativeSrc": "12305:32:70", + "nodeType": "YulFunctionCall", + "src": "12305:32:70" + }, + "nativeSrc": "12305:32:70", + "nodeType": "YulExpressionStatement", + "src": "12305:32:70" + }, + { + "nativeSrc": "12346:17:70", + "nodeType": "YulAssignment", + "src": "12346:17:70", + "value": { + "name": "value_2", + "nativeSrc": "12356:7:70", + "nodeType": "YulIdentifier", + "src": "12356:7:70" + }, + "variableNames": [ + { + "name": "value2", + "nativeSrc": "12346:6:70", + "nodeType": "YulIdentifier", + "src": "12346:6:70" + } + ] + }, + { + "nativeSrc": "12372:16:70", + "nodeType": "YulVariableDeclaration", + "src": "12372:16:70", + "value": { + "kind": "number", + "nativeSrc": "12387:1:70", + "nodeType": "YulLiteral", + "src": "12387:1:70", + "type": "", + "value": "0" + }, + "variables": [ + { + "name": "value_3", + "nativeSrc": "12376:7:70", + "nodeType": "YulTypedName", + "src": "12376:7:70", + "type": "" + } + ] + }, + { + "nativeSrc": "12397:43:70", + "nodeType": "YulAssignment", + "src": "12397:43:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "12425:9:70", + "nodeType": "YulIdentifier", + "src": "12425:9:70" + }, + { + "kind": "number", + "nativeSrc": "12436:2:70", + "nodeType": "YulLiteral", + "src": "12436:2:70", + "type": "", + "value": "96" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "12421:3:70", + "nodeType": "YulIdentifier", + "src": "12421:3:70" + }, + "nativeSrc": "12421:18:70", + "nodeType": "YulFunctionCall", + "src": "12421:18:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "12408:12:70", + "nodeType": "YulIdentifier", + "src": "12408:12:70" + }, + "nativeSrc": "12408:32:70", + "nodeType": "YulFunctionCall", + "src": "12408:32:70" + }, + "variableNames": [ + { + "name": "value_3", + "nativeSrc": "12397:7:70", + "nodeType": "YulIdentifier", + "src": "12397:7:70" + } + ] + }, + { + "nativeSrc": "12449:17:70", + "nodeType": "YulAssignment", + "src": "12449:17:70", + "value": { + "name": "value_3", + "nativeSrc": "12459:7:70", + "nodeType": "YulIdentifier", + "src": "12459:7:70" + }, + "variableNames": [ + { + "name": "value3", + "nativeSrc": "12449:6:70", + "nodeType": "YulIdentifier", + "src": "12449:6:70" + } + ] + } + ] + }, + "name": "abi_decode_tuple_t_addresst_uint256t_uint32t_uint256", + "nativeSrc": "11845:627:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "11907:9:70", + "nodeType": "YulTypedName", + "src": "11907:9:70", + "type": "" + }, + { + "name": "dataEnd", + "nativeSrc": "11918:7:70", + "nodeType": "YulTypedName", + "src": "11918:7:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value0", + "nativeSrc": "11930:6:70", + "nodeType": "YulTypedName", + "src": "11930:6:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "11938:6:70", + "nodeType": "YulTypedName", + "src": "11938:6:70", + "type": "" + }, + { + "name": "value2", + "nativeSrc": "11946:6:70", + "nodeType": "YulTypedName", + "src": "11946:6:70", + "type": "" + }, + { + "name": "value3", + "nativeSrc": "11954:6:70", + "nodeType": "YulTypedName", + "src": "11954:6:70", + "type": "" + } + ], + "src": "11845:627:70" + }, + { + "body": { + "nativeSrc": "12564:301:70", + "nodeType": "YulBlock", + "src": "12564:301:70", + "statements": [ + { + "body": { + "nativeSrc": "12610:16:70", + "nodeType": "YulBlock", + "src": "12610:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "12619:1:70", + "nodeType": "YulLiteral", + "src": "12619:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "12622:1:70", + "nodeType": "YulLiteral", + "src": "12622:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "12612:6:70", + "nodeType": "YulIdentifier", + "src": "12612:6:70" + }, + "nativeSrc": "12612:12:70", + "nodeType": "YulFunctionCall", + "src": "12612:12:70" + }, + "nativeSrc": "12612:12:70", + "nodeType": "YulExpressionStatement", + "src": "12612:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "dataEnd", + "nativeSrc": "12585:7:70", + "nodeType": "YulIdentifier", + "src": "12585:7:70" + }, + { + "name": "headStart", + "nativeSrc": "12594:9:70", + "nodeType": "YulIdentifier", + "src": "12594:9:70" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "12581:3:70", + "nodeType": "YulIdentifier", + "src": "12581:3:70" + }, + "nativeSrc": "12581:23:70", + "nodeType": "YulFunctionCall", + "src": "12581:23:70" + }, + { + "kind": "number", + "nativeSrc": "12606:2:70", + "nodeType": "YulLiteral", + "src": "12606:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "slt", + "nativeSrc": "12577:3:70", + "nodeType": "YulIdentifier", + "src": "12577:3:70" + }, + "nativeSrc": "12577:32:70", + "nodeType": "YulFunctionCall", + "src": "12577:32:70" + }, + "nativeSrc": "12574:52:70", + "nodeType": "YulIf", + "src": "12574:52:70" + }, + { + "nativeSrc": "12635:36:70", + "nodeType": "YulVariableDeclaration", + "src": "12635:36:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "12661:9:70", + "nodeType": "YulIdentifier", + "src": "12661:9:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "12648:12:70", + "nodeType": "YulIdentifier", + "src": "12648:12:70" + }, + "nativeSrc": "12648:23:70", + "nodeType": "YulFunctionCall", + "src": "12648:23:70" + }, + "variables": [ + { + "name": "value", + "nativeSrc": "12639:5:70", + "nodeType": "YulTypedName", + "src": "12639:5:70", + "type": "" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "value", + "nativeSrc": "12705:5:70", + "nodeType": "YulIdentifier", + "src": "12705:5:70" + } + ], + "functionName": { + "name": "validator_revert_address", + "nativeSrc": "12680:24:70", + "nodeType": "YulIdentifier", + "src": "12680:24:70" + }, + "nativeSrc": "12680:31:70", + "nodeType": "YulFunctionCall", + "src": "12680:31:70" + }, + "nativeSrc": "12680:31:70", + "nodeType": "YulExpressionStatement", + "src": "12680:31:70" + }, + { + "nativeSrc": "12720:15:70", + "nodeType": "YulAssignment", + "src": "12720:15:70", + "value": { + "name": "value", + "nativeSrc": "12730:5:70", + "nodeType": "YulIdentifier", + "src": "12730:5:70" + }, + "variableNames": [ + { + "name": "value0", + "nativeSrc": "12720:6:70", + "nodeType": "YulIdentifier", + "src": "12720:6:70" + } + ] + }, + { + "nativeSrc": "12744:47:70", + "nodeType": "YulVariableDeclaration", + "src": "12744:47:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "12776:9:70", + "nodeType": "YulIdentifier", + "src": "12776:9:70" + }, + { + "kind": "number", + "nativeSrc": "12787:2:70", + "nodeType": "YulLiteral", + "src": "12787:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "12772:3:70", + "nodeType": "YulIdentifier", + "src": "12772:3:70" + }, + "nativeSrc": "12772:18:70", + "nodeType": "YulFunctionCall", + "src": "12772:18:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "12759:12:70", + "nodeType": "YulIdentifier", + "src": "12759:12:70" + }, + "nativeSrc": "12759:32:70", + "nodeType": "YulFunctionCall", + "src": "12759:32:70" + }, + "variables": [ + { + "name": "value_1", + "nativeSrc": "12748:7:70", + "nodeType": "YulTypedName", + "src": "12748:7:70", + "type": "" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "value_1", + "nativeSrc": "12825:7:70", + "nodeType": "YulIdentifier", + "src": "12825:7:70" + } + ], + "functionName": { + "name": "validator_revert_address", + "nativeSrc": "12800:24:70", + "nodeType": "YulIdentifier", + "src": "12800:24:70" + }, + "nativeSrc": "12800:33:70", + "nodeType": "YulFunctionCall", + "src": "12800:33:70" + }, + "nativeSrc": "12800:33:70", + "nodeType": "YulExpressionStatement", + "src": "12800:33:70" + }, + { + "nativeSrc": "12842:17:70", + "nodeType": "YulAssignment", + "src": "12842:17:70", + "value": { + "name": "value_1", + "nativeSrc": "12852:7:70", + "nodeType": "YulIdentifier", + "src": "12852:7:70" + }, + "variableNames": [ + { + "name": "value1", + "nativeSrc": "12842:6:70", + "nodeType": "YulIdentifier", + "src": "12842:6:70" + } + ] + } + ] + }, + "name": "abi_decode_tuple_t_addresst_address", + "nativeSrc": "12477:388:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "12522:9:70", + "nodeType": "YulTypedName", + "src": "12522:9:70", + "type": "" + }, + { + "name": "dataEnd", + "nativeSrc": "12533:7:70", + "nodeType": "YulTypedName", + "src": "12533:7:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value0", + "nativeSrc": "12545:6:70", + "nodeType": "YulTypedName", + "src": "12545:6:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "12553:6:70", + "nodeType": "YulTypedName", + "src": "12553:6:70", + "type": "" + } + ], + "src": "12477:388:70" + }, + { + "body": { + "nativeSrc": "12971:76:70", + "nodeType": "YulBlock", + "src": "12971:76:70", + "statements": [ + { + "nativeSrc": "12981:26:70", + "nodeType": "YulAssignment", + "src": "12981:26:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "12993:9:70", + "nodeType": "YulIdentifier", + "src": "12993:9:70" + }, + { + "kind": "number", + "nativeSrc": "13004:2:70", + "nodeType": "YulLiteral", + "src": "13004:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "12989:3:70", + "nodeType": "YulIdentifier", + "src": "12989:3:70" + }, + "nativeSrc": "12989:18:70", + "nodeType": "YulFunctionCall", + "src": "12989:18:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "12981:4:70", + "nodeType": "YulIdentifier", + "src": "12981:4:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "13023:9:70", + "nodeType": "YulIdentifier", + "src": "13023:9:70" + }, + { + "name": "value0", + "nativeSrc": "13034:6:70", + "nodeType": "YulIdentifier", + "src": "13034:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "13016:6:70", + "nodeType": "YulIdentifier", + "src": "13016:6:70" + }, + "nativeSrc": "13016:25:70", + "nodeType": "YulFunctionCall", + "src": "13016:25:70" + }, + "nativeSrc": "13016:25:70", + "nodeType": "YulExpressionStatement", + "src": "13016:25:70" + } + ] + }, + "name": "abi_encode_tuple_t_bytes32__to_t_bytes32__fromStack_reversed", + "nativeSrc": "12870:177:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "12940:9:70", + "nodeType": "YulTypedName", + "src": "12940:9:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "12951:6:70", + "nodeType": "YulTypedName", + "src": "12951:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "12962:4:70", + "nodeType": "YulTypedName", + "src": "12962:4:70", + "type": "" + } + ], + "src": "12870:177:70" + }, + { + "body": { + "nativeSrc": "13122:156:70", + "nodeType": "YulBlock", + "src": "13122:156:70", + "statements": [ + { + "body": { + "nativeSrc": "13168:16:70", + "nodeType": "YulBlock", + "src": "13168:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "13177:1:70", + "nodeType": "YulLiteral", + "src": "13177:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "13180:1:70", + "nodeType": "YulLiteral", + "src": "13180:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "13170:6:70", + "nodeType": "YulIdentifier", + "src": "13170:6:70" + }, + "nativeSrc": "13170:12:70", + "nodeType": "YulFunctionCall", + "src": "13170:12:70" + }, + "nativeSrc": "13170:12:70", + "nodeType": "YulExpressionStatement", + "src": "13170:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "dataEnd", + "nativeSrc": "13143:7:70", + "nodeType": "YulIdentifier", + "src": "13143:7:70" + }, + { + "name": "headStart", + "nativeSrc": "13152:9:70", + "nodeType": "YulIdentifier", + "src": "13152:9:70" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "13139:3:70", + "nodeType": "YulIdentifier", + "src": "13139:3:70" + }, + "nativeSrc": "13139:23:70", + "nodeType": "YulFunctionCall", + "src": "13139:23:70" + }, + { + "kind": "number", + "nativeSrc": "13164:2:70", + "nodeType": "YulLiteral", + "src": "13164:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "slt", + "nativeSrc": "13135:3:70", + "nodeType": "YulIdentifier", + "src": "13135:3:70" + }, + "nativeSrc": "13135:32:70", + "nodeType": "YulFunctionCall", + "src": "13135:32:70" + }, + "nativeSrc": "13132:52:70", + "nodeType": "YulIf", + "src": "13132:52:70" + }, + { + "nativeSrc": "13193:14:70", + "nodeType": "YulVariableDeclaration", + "src": "13193:14:70", + "value": { + "kind": "number", + "nativeSrc": "13206:1:70", + "nodeType": "YulLiteral", + "src": "13206:1:70", + "type": "", + "value": "0" + }, + "variables": [ + { + "name": "value", + "nativeSrc": "13197:5:70", + "nodeType": "YulTypedName", + "src": "13197:5:70", + "type": "" + } + ] + }, + { + "nativeSrc": "13216:32:70", + "nodeType": "YulAssignment", + "src": "13216:32:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "13238:9:70", + "nodeType": "YulIdentifier", + "src": "13238:9:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "13225:12:70", + "nodeType": "YulIdentifier", + "src": "13225:12:70" + }, + "nativeSrc": "13225:23:70", + "nodeType": "YulFunctionCall", + "src": "13225:23:70" + }, + "variableNames": [ + { + "name": "value", + "nativeSrc": "13216:5:70", + "nodeType": "YulIdentifier", + "src": "13216:5:70" + } + ] + }, + { + "nativeSrc": "13257:15:70", + "nodeType": "YulAssignment", + "src": "13257:15:70", + "value": { + "name": "value", + "nativeSrc": "13267:5:70", + "nodeType": "YulIdentifier", + "src": "13267:5:70" + }, + "variableNames": [ + { + "name": "value0", + "nativeSrc": "13257:6:70", + "nodeType": "YulIdentifier", + "src": "13257:6:70" + } + ] + } + ] + }, + "name": "abi_decode_tuple_t_bytes32", + "nativeSrc": "13052:226:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "13088:9:70", + "nodeType": "YulTypedName", + "src": "13088:9:70", + "type": "" + }, + { + "name": "dataEnd", + "nativeSrc": "13099:7:70", + "nodeType": "YulTypedName", + "src": "13099:7:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value0", + "nativeSrc": "13111:6:70", + "nodeType": "YulTypedName", + "src": "13111:6:70", + "type": "" + } + ], + "src": "13052:226:70" + }, + { + "body": { + "nativeSrc": "13468:206:70", + "nodeType": "YulBlock", + "src": "13468:206:70", + "statements": [ + { + "nativeSrc": "13478:27:70", + "nodeType": "YulAssignment", + "src": "13478:27:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "13490:9:70", + "nodeType": "YulIdentifier", + "src": "13490:9:70" + }, + { + "kind": "number", + "nativeSrc": "13501:3:70", + "nodeType": "YulLiteral", + "src": "13501:3:70", + "type": "", + "value": "128" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "13486:3:70", + "nodeType": "YulIdentifier", + "src": "13486:3:70" + }, + "nativeSrc": "13486:19:70", + "nodeType": "YulFunctionCall", + "src": "13486:19:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "13478:4:70", + "nodeType": "YulIdentifier", + "src": "13478:4:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "13521:9:70", + "nodeType": "YulIdentifier", + "src": "13521:9:70" + }, + { + "name": "value0", + "nativeSrc": "13532:6:70", + "nodeType": "YulIdentifier", + "src": "13532:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "13514:6:70", + "nodeType": "YulIdentifier", + "src": "13514:6:70" + }, + "nativeSrc": "13514:25:70", + "nodeType": "YulFunctionCall", + "src": "13514:25:70" + }, + "nativeSrc": "13514:25:70", + "nodeType": "YulExpressionStatement", + "src": "13514:25:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "13559:9:70", + "nodeType": "YulIdentifier", + "src": "13559:9:70" + }, + { + "kind": "number", + "nativeSrc": "13570:2:70", + "nodeType": "YulLiteral", + "src": "13570:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "13555:3:70", + "nodeType": "YulIdentifier", + "src": "13555:3:70" + }, + "nativeSrc": "13555:18:70", + "nodeType": "YulFunctionCall", + "src": "13555:18:70" + }, + { + "name": "value1", + "nativeSrc": "13575:6:70", + "nodeType": "YulIdentifier", + "src": "13575:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "13548:6:70", + "nodeType": "YulIdentifier", + "src": "13548:6:70" + }, + "nativeSrc": "13548:34:70", + "nodeType": "YulFunctionCall", + "src": "13548:34:70" + }, + "nativeSrc": "13548:34:70", + "nodeType": "YulExpressionStatement", + "src": "13548:34:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "13602:9:70", + "nodeType": "YulIdentifier", + "src": "13602:9:70" + }, + { + "kind": "number", + "nativeSrc": "13613:2:70", + "nodeType": "YulLiteral", + "src": "13613:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "13598:3:70", + "nodeType": "YulIdentifier", + "src": "13598:3:70" + }, + "nativeSrc": "13598:18:70", + "nodeType": "YulFunctionCall", + "src": "13598:18:70" + }, + { + "name": "value2", + "nativeSrc": "13618:6:70", + "nodeType": "YulIdentifier", + "src": "13618:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "13591:6:70", + "nodeType": "YulIdentifier", + "src": "13591:6:70" + }, + "nativeSrc": "13591:34:70", + "nodeType": "YulFunctionCall", + "src": "13591:34:70" + }, + "nativeSrc": "13591:34:70", + "nodeType": "YulExpressionStatement", + "src": "13591:34:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "13645:9:70", + "nodeType": "YulIdentifier", + "src": "13645:9:70" + }, + { + "kind": "number", + "nativeSrc": "13656:2:70", + "nodeType": "YulLiteral", + "src": "13656:2:70", + "type": "", + "value": "96" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "13641:3:70", + "nodeType": "YulIdentifier", + "src": "13641:3:70" + }, + "nativeSrc": "13641:18:70", + "nodeType": "YulFunctionCall", + "src": "13641:18:70" + }, + { + "name": "value3", + "nativeSrc": "13661:6:70", + "nodeType": "YulIdentifier", + "src": "13661:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "13634:6:70", + "nodeType": "YulIdentifier", + "src": "13634:6:70" + }, + "nativeSrc": "13634:34:70", + "nodeType": "YulFunctionCall", + "src": "13634:34:70" + }, + "nativeSrc": "13634:34:70", + "nodeType": "YulExpressionStatement", + "src": "13634:34:70" + } + ] + }, + "name": "abi_encode_tuple_t_uint256_t_uint256_t_uint256_t_bytes32__to_t_uint256_t_uint256_t_uint256_t_bytes32__fromStack_reversed", + "nativeSrc": "13283:391:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "13413:9:70", + "nodeType": "YulTypedName", + "src": "13413:9:70", + "type": "" + }, + { + "name": "value3", + "nativeSrc": "13424:6:70", + "nodeType": "YulTypedName", + "src": "13424:6:70", + "type": "" + }, + { + "name": "value2", + "nativeSrc": "13432:6:70", + "nodeType": "YulTypedName", + "src": "13432:6:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "13440:6:70", + "nodeType": "YulTypedName", + "src": "13440:6:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "13448:6:70", + "nodeType": "YulTypedName", + "src": "13448:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "13459:4:70", + "nodeType": "YulTypedName", + "src": "13459:4:70", + "type": "" + } + ], + "src": "13283:391:70" + }, + { + "body": { + "nativeSrc": "13836:240:70", + "nodeType": "YulBlock", + "src": "13836:240:70", + "statements": [ + { + "nativeSrc": "13846:26:70", + "nodeType": "YulAssignment", + "src": "13846:26:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "13858:9:70", + "nodeType": "YulIdentifier", + "src": "13858:9:70" + }, + { + "kind": "number", + "nativeSrc": "13869:2:70", + "nodeType": "YulLiteral", + "src": "13869:2:70", + "type": "", + "value": "96" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "13854:3:70", + "nodeType": "YulIdentifier", + "src": "13854:3:70" + }, + "nativeSrc": "13854:18:70", + "nodeType": "YulFunctionCall", + "src": "13854:18:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "13846:4:70", + "nodeType": "YulIdentifier", + "src": "13846:4:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "13888:9:70", + "nodeType": "YulIdentifier", + "src": "13888:9:70" + }, + { + "arguments": [ + { + "name": "value0", + "nativeSrc": "13903:6:70", + "nodeType": "YulIdentifier", + "src": "13903:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "13919:3:70", + "nodeType": "YulLiteral", + "src": "13919:3:70", + "type": "", + "value": "160" + }, + { + "kind": "number", + "nativeSrc": "13924:1:70", + "nodeType": "YulLiteral", + "src": "13924:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "13915:3:70", + "nodeType": "YulIdentifier", + "src": "13915:3:70" + }, + "nativeSrc": "13915:11:70", + "nodeType": "YulFunctionCall", + "src": "13915:11:70" + }, + { + "kind": "number", + "nativeSrc": "13928:1:70", + "nodeType": "YulLiteral", + "src": "13928:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "13911:3:70", + "nodeType": "YulIdentifier", + "src": "13911:3:70" + }, + "nativeSrc": "13911:19:70", + "nodeType": "YulFunctionCall", + "src": "13911:19:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "13899:3:70", + "nodeType": "YulIdentifier", + "src": "13899:3:70" + }, + "nativeSrc": "13899:32:70", + "nodeType": "YulFunctionCall", + "src": "13899:32:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "13881:6:70", + "nodeType": "YulIdentifier", + "src": "13881:6:70" + }, + "nativeSrc": "13881:51:70", + "nodeType": "YulFunctionCall", + "src": "13881:51:70" + }, + "nativeSrc": "13881:51:70", + "nodeType": "YulExpressionStatement", + "src": "13881:51:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "13952:9:70", + "nodeType": "YulIdentifier", + "src": "13952:9:70" + }, + { + "kind": "number", + "nativeSrc": "13963:2:70", + "nodeType": "YulLiteral", + "src": "13963:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "13948:3:70", + "nodeType": "YulIdentifier", + "src": "13948:3:70" + }, + "nativeSrc": "13948:18:70", + "nodeType": "YulFunctionCall", + "src": "13948:18:70" + }, + { + "arguments": [ + { + "name": "value1", + "nativeSrc": "13972:6:70", + "nodeType": "YulIdentifier", + "src": "13972:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "13988:3:70", + "nodeType": "YulLiteral", + "src": "13988:3:70", + "type": "", + "value": "160" + }, + { + "kind": "number", + "nativeSrc": "13993:1:70", + "nodeType": "YulLiteral", + "src": "13993:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "13984:3:70", + "nodeType": "YulIdentifier", + "src": "13984:3:70" + }, + "nativeSrc": "13984:11:70", + "nodeType": "YulFunctionCall", + "src": "13984:11:70" + }, + { + "kind": "number", + "nativeSrc": "13997:1:70", + "nodeType": "YulLiteral", + "src": "13997:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "13980:3:70", + "nodeType": "YulIdentifier", + "src": "13980:3:70" + }, + "nativeSrc": "13980:19:70", + "nodeType": "YulFunctionCall", + "src": "13980:19:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "13968:3:70", + "nodeType": "YulIdentifier", + "src": "13968:3:70" + }, + "nativeSrc": "13968:32:70", + "nodeType": "YulFunctionCall", + "src": "13968:32:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "13941:6:70", + "nodeType": "YulIdentifier", + "src": "13941:6:70" + }, + "nativeSrc": "13941:60:70", + "nodeType": "YulFunctionCall", + "src": "13941:60:70" + }, + "nativeSrc": "13941:60:70", + "nodeType": "YulExpressionStatement", + "src": "13941:60:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "14021:9:70", + "nodeType": "YulIdentifier", + "src": "14021:9:70" + }, + { + "kind": "number", + "nativeSrc": "14032:2:70", + "nodeType": "YulLiteral", + "src": "14032:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "14017:3:70", + "nodeType": "YulIdentifier", + "src": "14017:3:70" + }, + "nativeSrc": "14017:18:70", + "nodeType": "YulFunctionCall", + "src": "14017:18:70" + }, + { + "arguments": [ + { + "name": "value2", + "nativeSrc": "14041:6:70", + "nodeType": "YulIdentifier", + "src": "14041:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "14057:3:70", + "nodeType": "YulLiteral", + "src": "14057:3:70", + "type": "", + "value": "160" + }, + { + "kind": "number", + "nativeSrc": "14062:1:70", + "nodeType": "YulLiteral", + "src": "14062:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "14053:3:70", + "nodeType": "YulIdentifier", + "src": "14053:3:70" + }, + "nativeSrc": "14053:11:70", + "nodeType": "YulFunctionCall", + "src": "14053:11:70" + }, + { + "kind": "number", + "nativeSrc": "14066:1:70", + "nodeType": "YulLiteral", + "src": "14066:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "14049:3:70", + "nodeType": "YulIdentifier", + "src": "14049:3:70" + }, + "nativeSrc": "14049:19:70", + "nodeType": "YulFunctionCall", + "src": "14049:19:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "14037:3:70", + "nodeType": "YulIdentifier", + "src": "14037:3:70" + }, + "nativeSrc": "14037:32:70", + "nodeType": "YulFunctionCall", + "src": "14037:32:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "14010:6:70", + "nodeType": "YulIdentifier", + "src": "14010:6:70" + }, + "nativeSrc": "14010:60:70", + "nodeType": "YulFunctionCall", + "src": "14010:60:70" + }, + "nativeSrc": "14010:60:70", + "nodeType": "YulExpressionStatement", + "src": "14010:60:70" + } + ] + }, + "name": "abi_encode_tuple_t_address_t_address_t_address__to_t_address_t_address_t_address__fromStack_reversed", + "nativeSrc": "13679:397:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "13789:9:70", + "nodeType": "YulTypedName", + "src": "13789:9:70", + "type": "" + }, + { + "name": "value2", + "nativeSrc": "13800:6:70", + "nodeType": "YulTypedName", + "src": "13800:6:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "13808:6:70", + "nodeType": "YulTypedName", + "src": "13808:6:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "13816:6:70", + "nodeType": "YulTypedName", + "src": "13816:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "13827:4:70", + "nodeType": "YulTypedName", + "src": "13827:4:70", + "type": "" + } + ], + "src": "13679:397:70" + }, + { + "body": { + "nativeSrc": "14159:167:70", + "nodeType": "YulBlock", + "src": "14159:167:70", + "statements": [ + { + "body": { + "nativeSrc": "14205:16:70", + "nodeType": "YulBlock", + "src": "14205:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "14214:1:70", + "nodeType": "YulLiteral", + "src": "14214:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "14217:1:70", + "nodeType": "YulLiteral", + "src": "14217:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "14207:6:70", + "nodeType": "YulIdentifier", + "src": "14207:6:70" + }, + "nativeSrc": "14207:12:70", + "nodeType": "YulFunctionCall", + "src": "14207:12:70" + }, + "nativeSrc": "14207:12:70", + "nodeType": "YulExpressionStatement", + "src": "14207:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "dataEnd", + "nativeSrc": "14180:7:70", + "nodeType": "YulIdentifier", + "src": "14180:7:70" + }, + { + "name": "headStart", + "nativeSrc": "14189:9:70", + "nodeType": "YulIdentifier", + "src": "14189:9:70" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "14176:3:70", + "nodeType": "YulIdentifier", + "src": "14176:3:70" + }, + "nativeSrc": "14176:23:70", + "nodeType": "YulFunctionCall", + "src": "14176:23:70" + }, + { + "kind": "number", + "nativeSrc": "14201:2:70", + "nodeType": "YulLiteral", + "src": "14201:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "slt", + "nativeSrc": "14172:3:70", + "nodeType": "YulIdentifier", + "src": "14172:3:70" + }, + "nativeSrc": "14172:32:70", + "nodeType": "YulFunctionCall", + "src": "14172:32:70" + }, + "nativeSrc": "14169:52:70", + "nodeType": "YulIf", + "src": "14169:52:70" + }, + { + "nativeSrc": "14230:29:70", + "nodeType": "YulVariableDeclaration", + "src": "14230:29:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "14249:9:70", + "nodeType": "YulIdentifier", + "src": "14249:9:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "14243:5:70", + "nodeType": "YulIdentifier", + "src": "14243:5:70" + }, + "nativeSrc": "14243:16:70", + "nodeType": "YulFunctionCall", + "src": "14243:16:70" + }, + "variables": [ + { + "name": "value", + "nativeSrc": "14234:5:70", + "nodeType": "YulTypedName", + "src": "14234:5:70", + "type": "" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "value", + "nativeSrc": "14290:5:70", + "nodeType": "YulIdentifier", + "src": "14290:5:70" + } + ], + "functionName": { + "name": "validator_revert_bool", + "nativeSrc": "14268:21:70", + "nodeType": "YulIdentifier", + "src": "14268:21:70" + }, + "nativeSrc": "14268:28:70", + "nodeType": "YulFunctionCall", + "src": "14268:28:70" + }, + "nativeSrc": "14268:28:70", + "nodeType": "YulExpressionStatement", + "src": "14268:28:70" + }, + { + "nativeSrc": "14305:15:70", + "nodeType": "YulAssignment", + "src": "14305:15:70", + "value": { + "name": "value", + "nativeSrc": "14315:5:70", + "nodeType": "YulIdentifier", + "src": "14315:5:70" + }, + "variableNames": [ + { + "name": "value0", + "nativeSrc": "14305:6:70", + "nodeType": "YulIdentifier", + "src": "14305:6:70" + } + ] + } + ] + }, + "name": "abi_decode_tuple_t_bool_fromMemory", + "nativeSrc": "14081:245:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "14125:9:70", + "nodeType": "YulTypedName", + "src": "14125:9:70", + "type": "" + }, + { + "name": "dataEnd", + "nativeSrc": "14136:7:70", + "nodeType": "YulTypedName", + "src": "14136:7:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value0", + "nativeSrc": "14148:6:70", + "nodeType": "YulTypedName", + "src": "14148:6:70", + "type": "" + } + ], + "src": "14081:245:70" + }, + { + "body": { + "nativeSrc": "14460:171:70", + "nodeType": "YulBlock", + "src": "14460:171:70", + "statements": [ + { + "nativeSrc": "14470:26:70", + "nodeType": "YulAssignment", + "src": "14470:26:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "14482:9:70", + "nodeType": "YulIdentifier", + "src": "14482:9:70" + }, + { + "kind": "number", + "nativeSrc": "14493:2:70", + "nodeType": "YulLiteral", + "src": "14493:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "14478:3:70", + "nodeType": "YulIdentifier", + "src": "14478:3:70" + }, + "nativeSrc": "14478:18:70", + "nodeType": "YulFunctionCall", + "src": "14478:18:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "14470:4:70", + "nodeType": "YulIdentifier", + "src": "14470:4:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "14512:9:70", + "nodeType": "YulIdentifier", + "src": "14512:9:70" + }, + { + "arguments": [ + { + "name": "value0", + "nativeSrc": "14527:6:70", + "nodeType": "YulIdentifier", + "src": "14527:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "14543:3:70", + "nodeType": "YulLiteral", + "src": "14543:3:70", + "type": "", + "value": "160" + }, + { + "kind": "number", + "nativeSrc": "14548:1:70", + "nodeType": "YulLiteral", + "src": "14548:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "14539:3:70", + "nodeType": "YulIdentifier", + "src": "14539:3:70" + }, + "nativeSrc": "14539:11:70", + "nodeType": "YulFunctionCall", + "src": "14539:11:70" + }, + { + "kind": "number", + "nativeSrc": "14552:1:70", + "nodeType": "YulLiteral", + "src": "14552:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "14535:3:70", + "nodeType": "YulIdentifier", + "src": "14535:3:70" + }, + "nativeSrc": "14535:19:70", + "nodeType": "YulFunctionCall", + "src": "14535:19:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "14523:3:70", + "nodeType": "YulIdentifier", + "src": "14523:3:70" + }, + "nativeSrc": "14523:32:70", + "nodeType": "YulFunctionCall", + "src": "14523:32:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "14505:6:70", + "nodeType": "YulIdentifier", + "src": "14505:6:70" + }, + "nativeSrc": "14505:51:70", + "nodeType": "YulFunctionCall", + "src": "14505:51:70" + }, + "nativeSrc": "14505:51:70", + "nodeType": "YulExpressionStatement", + "src": "14505:51:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "14576:9:70", + "nodeType": "YulIdentifier", + "src": "14576:9:70" + }, + { + "kind": "number", + "nativeSrc": "14587:2:70", + "nodeType": "YulLiteral", + "src": "14587:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "14572:3:70", + "nodeType": "YulIdentifier", + "src": "14572:3:70" + }, + "nativeSrc": "14572:18:70", + "nodeType": "YulFunctionCall", + "src": "14572:18:70" + }, + { + "arguments": [ + { + "name": "value1", + "nativeSrc": "14596:6:70", + "nodeType": "YulIdentifier", + "src": "14596:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "14612:3:70", + "nodeType": "YulLiteral", + "src": "14612:3:70", + "type": "", + "value": "160" + }, + { + "kind": "number", + "nativeSrc": "14617:1:70", + "nodeType": "YulLiteral", + "src": "14617:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "14608:3:70", + "nodeType": "YulIdentifier", + "src": "14608:3:70" + }, + "nativeSrc": "14608:11:70", + "nodeType": "YulFunctionCall", + "src": "14608:11:70" + }, + { + "kind": "number", + "nativeSrc": "14621:1:70", + "nodeType": "YulLiteral", + "src": "14621:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "14604:3:70", + "nodeType": "YulIdentifier", + "src": "14604:3:70" + }, + "nativeSrc": "14604:19:70", + "nodeType": "YulFunctionCall", + "src": "14604:19:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "14592:3:70", + "nodeType": "YulIdentifier", + "src": "14592:3:70" + }, + "nativeSrc": "14592:32:70", + "nodeType": "YulFunctionCall", + "src": "14592:32:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "14565:6:70", + "nodeType": "YulIdentifier", + "src": "14565:6:70" + }, + "nativeSrc": "14565:60:70", + "nodeType": "YulFunctionCall", + "src": "14565:60:70" + }, + "nativeSrc": "14565:60:70", + "nodeType": "YulExpressionStatement", + "src": "14565:60:70" + } + ] + }, + "name": "abi_encode_tuple_t_address_t_address__to_t_address_t_address__fromStack_reversed", + "nativeSrc": "14331:300:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "14421:9:70", + "nodeType": "YulTypedName", + "src": "14421:9:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "14432:6:70", + "nodeType": "YulTypedName", + "src": "14432:6:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "14440:6:70", + "nodeType": "YulTypedName", + "src": "14440:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "14451:4:70", + "nodeType": "YulTypedName", + "src": "14451:4:70", + "type": "" + } + ], + "src": "14331:300:70" + }, + { + "body": { + "nativeSrc": "14668:95:70", + "nodeType": "YulBlock", + "src": "14668:95:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "14685:1:70", + "nodeType": "YulLiteral", + "src": "14685:1:70", + "type": "", + "value": "0" + }, + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "14692:3:70", + "nodeType": "YulLiteral", + "src": "14692:3:70", + "type": "", + "value": "224" + }, + { + "kind": "number", + "nativeSrc": "14697:10:70", + "nodeType": "YulLiteral", + "src": "14697:10:70", + "type": "", + "value": "0x4e487b71" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "14688:3:70", + "nodeType": "YulIdentifier", + "src": "14688:3:70" + }, + "nativeSrc": "14688:20:70", + "nodeType": "YulFunctionCall", + "src": "14688:20:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "14678:6:70", + "nodeType": "YulIdentifier", + "src": "14678:6:70" + }, + "nativeSrc": "14678:31:70", + "nodeType": "YulFunctionCall", + "src": "14678:31:70" + }, + "nativeSrc": "14678:31:70", + "nodeType": "YulExpressionStatement", + "src": "14678:31:70" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "14725:1:70", + "nodeType": "YulLiteral", + "src": "14725:1:70", + "type": "", + "value": "4" + }, + { + "kind": "number", + "nativeSrc": "14728:4:70", + "nodeType": "YulLiteral", + "src": "14728:4:70", + "type": "", + "value": "0x41" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "14718:6:70", + "nodeType": "YulIdentifier", + "src": "14718:6:70" + }, + "nativeSrc": "14718:15:70", + "nodeType": "YulFunctionCall", + "src": "14718:15:70" + }, + "nativeSrc": "14718:15:70", + "nodeType": "YulExpressionStatement", + "src": "14718:15:70" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "14749:1:70", + "nodeType": "YulLiteral", + "src": "14749:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "14752:4:70", + "nodeType": "YulLiteral", + "src": "14752:4:70", + "type": "", + "value": "0x24" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "14742:6:70", + "nodeType": "YulIdentifier", + "src": "14742:6:70" + }, + "nativeSrc": "14742:15:70", + "nodeType": "YulFunctionCall", + "src": "14742:15:70" + }, + "nativeSrc": "14742:15:70", + "nodeType": "YulExpressionStatement", + "src": "14742:15:70" + } + ] + }, + "name": "panic_error_0x41", + "nativeSrc": "14636:127:70", + "nodeType": "YulFunctionDefinition", + "src": "14636:127:70" + }, + { + "body": { + "nativeSrc": "14814:206:70", + "nodeType": "YulBlock", + "src": "14814:206:70", + "statements": [ + { + "nativeSrc": "14824:19:70", + "nodeType": "YulAssignment", + "src": "14824:19:70", + "value": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "14840:2:70", + "nodeType": "YulLiteral", + "src": "14840:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "14834:5:70", + "nodeType": "YulIdentifier", + "src": "14834:5:70" + }, + "nativeSrc": "14834:9:70", + "nodeType": "YulFunctionCall", + "src": "14834:9:70" + }, + "variableNames": [ + { + "name": "memPtr", + "nativeSrc": "14824:6:70", + "nodeType": "YulIdentifier", + "src": "14824:6:70" + } + ] + }, + { + "nativeSrc": "14852:34:70", + "nodeType": "YulVariableDeclaration", + "src": "14852:34:70", + "value": { + "arguments": [ + { + "name": "memPtr", + "nativeSrc": "14874:6:70", + "nodeType": "YulIdentifier", + "src": "14874:6:70" + }, + { + "kind": "number", + "nativeSrc": "14882:3:70", + "nodeType": "YulLiteral", + "src": "14882:3:70", + "type": "", + "value": "320" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "14870:3:70", + "nodeType": "YulIdentifier", + "src": "14870:3:70" + }, + "nativeSrc": "14870:16:70", + "nodeType": "YulFunctionCall", + "src": "14870:16:70" + }, + "variables": [ + { + "name": "newFreePtr", + "nativeSrc": "14856:10:70", + "nodeType": "YulTypedName", + "src": "14856:10:70", + "type": "" + } + ] + }, + { + "body": { + "nativeSrc": "14961:22:70", + "nodeType": "YulBlock", + "src": "14961:22:70", + "statements": [ + { + "expression": { + "arguments": [], + "functionName": { + "name": "panic_error_0x41", + "nativeSrc": "14963:16:70", + "nodeType": "YulIdentifier", + "src": "14963:16:70" + }, + "nativeSrc": "14963:18:70", + "nodeType": "YulFunctionCall", + "src": "14963:18:70" + }, + "nativeSrc": "14963:18:70", + "nodeType": "YulExpressionStatement", + "src": "14963:18:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "newFreePtr", + "nativeSrc": "14904:10:70", + "nodeType": "YulIdentifier", + "src": "14904:10:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "14924:2:70", + "nodeType": "YulLiteral", + "src": "14924:2:70", + "type": "", + "value": "64" + }, + { + "kind": "number", + "nativeSrc": "14928:1:70", + "nodeType": "YulLiteral", + "src": "14928:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "14920:3:70", + "nodeType": "YulIdentifier", + "src": "14920:3:70" + }, + "nativeSrc": "14920:10:70", + "nodeType": "YulFunctionCall", + "src": "14920:10:70" + }, + { + "kind": "number", + "nativeSrc": "14932:1:70", + "nodeType": "YulLiteral", + "src": "14932:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "14916:3:70", + "nodeType": "YulIdentifier", + "src": "14916:3:70" + }, + "nativeSrc": "14916:18:70", + "nodeType": "YulFunctionCall", + "src": "14916:18:70" + } + ], + "functionName": { + "name": "gt", + "nativeSrc": "14901:2:70", + "nodeType": "YulIdentifier", + "src": "14901:2:70" + }, + "nativeSrc": "14901:34:70", + "nodeType": "YulFunctionCall", + "src": "14901:34:70" + }, + { + "arguments": [ + { + "name": "newFreePtr", + "nativeSrc": "14940:10:70", + "nodeType": "YulIdentifier", + "src": "14940:10:70" + }, + { + "name": "memPtr", + "nativeSrc": "14952:6:70", + "nodeType": "YulIdentifier", + "src": "14952:6:70" + } + ], + "functionName": { + "name": "lt", + "nativeSrc": "14937:2:70", + "nodeType": "YulIdentifier", + "src": "14937:2:70" + }, + "nativeSrc": "14937:22:70", + "nodeType": "YulFunctionCall", + "src": "14937:22:70" + } + ], + "functionName": { + "name": "or", + "nativeSrc": "14898:2:70", + "nodeType": "YulIdentifier", + "src": "14898:2:70" + }, + "nativeSrc": "14898:62:70", + "nodeType": "YulFunctionCall", + "src": "14898:62:70" + }, + "nativeSrc": "14895:88:70", + "nodeType": "YulIf", + "src": "14895:88:70" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "14999:2:70", + "nodeType": "YulLiteral", + "src": "14999:2:70", + "type": "", + "value": "64" + }, + { + "name": "newFreePtr", + "nativeSrc": "15003:10:70", + "nodeType": "YulIdentifier", + "src": "15003:10:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "14992:6:70", + "nodeType": "YulIdentifier", + "src": "14992:6:70" + }, + "nativeSrc": "14992:22:70", + "nodeType": "YulFunctionCall", + "src": "14992:22:70" + }, + "nativeSrc": "14992:22:70", + "nodeType": "YulExpressionStatement", + "src": "14992:22:70" + } + ] + }, + "name": "allocate_memory_4297", + "nativeSrc": "14768:252:70", + "nodeType": "YulFunctionDefinition", + "returnVariables": [ + { + "name": "memPtr", + "nativeSrc": "14803:6:70", + "nodeType": "YulTypedName", + "src": "14803:6:70", + "type": "" + } + ], + "src": "14768:252:70" + }, + { + "body": { + "nativeSrc": "15071:205:70", + "nodeType": "YulBlock", + "src": "15071:205:70", + "statements": [ + { + "nativeSrc": "15081:19:70", + "nodeType": "YulAssignment", + "src": "15081:19:70", + "value": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "15097:2:70", + "nodeType": "YulLiteral", + "src": "15097:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "15091:5:70", + "nodeType": "YulIdentifier", + "src": "15091:5:70" + }, + "nativeSrc": "15091:9:70", + "nodeType": "YulFunctionCall", + "src": "15091:9:70" + }, + "variableNames": [ + { + "name": "memPtr", + "nativeSrc": "15081:6:70", + "nodeType": "YulIdentifier", + "src": "15081:6:70" + } + ] + }, + { + "nativeSrc": "15109:33:70", + "nodeType": "YulVariableDeclaration", + "src": "15109:33:70", + "value": { + "arguments": [ + { + "name": "memPtr", + "nativeSrc": "15131:6:70", + "nodeType": "YulIdentifier", + "src": "15131:6:70" + }, + { + "kind": "number", + "nativeSrc": "15139:2:70", + "nodeType": "YulLiteral", + "src": "15139:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "15127:3:70", + "nodeType": "YulIdentifier", + "src": "15127:3:70" + }, + "nativeSrc": "15127:15:70", + "nodeType": "YulFunctionCall", + "src": "15127:15:70" + }, + "variables": [ + { + "name": "newFreePtr", + "nativeSrc": "15113:10:70", + "nodeType": "YulTypedName", + "src": "15113:10:70", + "type": "" + } + ] + }, + { + "body": { + "nativeSrc": "15217:22:70", + "nodeType": "YulBlock", + "src": "15217:22:70", + "statements": [ + { + "expression": { + "arguments": [], + "functionName": { + "name": "panic_error_0x41", + "nativeSrc": "15219:16:70", + "nodeType": "YulIdentifier", + "src": "15219:16:70" + }, + "nativeSrc": "15219:18:70", + "nodeType": "YulFunctionCall", + "src": "15219:18:70" + }, + "nativeSrc": "15219:18:70", + "nodeType": "YulExpressionStatement", + "src": "15219:18:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "newFreePtr", + "nativeSrc": "15160:10:70", + "nodeType": "YulIdentifier", + "src": "15160:10:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "15180:2:70", + "nodeType": "YulLiteral", + "src": "15180:2:70", + "type": "", + "value": "64" + }, + { + "kind": "number", + "nativeSrc": "15184:1:70", + "nodeType": "YulLiteral", + "src": "15184:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "15176:3:70", + "nodeType": "YulIdentifier", + "src": "15176:3:70" + }, + "nativeSrc": "15176:10:70", + "nodeType": "YulFunctionCall", + "src": "15176:10:70" + }, + { + "kind": "number", + "nativeSrc": "15188:1:70", + "nodeType": "YulLiteral", + "src": "15188:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "15172:3:70", + "nodeType": "YulIdentifier", + "src": "15172:3:70" + }, + "nativeSrc": "15172:18:70", + "nodeType": "YulFunctionCall", + "src": "15172:18:70" + } + ], + "functionName": { + "name": "gt", + "nativeSrc": "15157:2:70", + "nodeType": "YulIdentifier", + "src": "15157:2:70" + }, + "nativeSrc": "15157:34:70", + "nodeType": "YulFunctionCall", + "src": "15157:34:70" + }, + { + "arguments": [ + { + "name": "newFreePtr", + "nativeSrc": "15196:10:70", + "nodeType": "YulIdentifier", + "src": "15196:10:70" + }, + { + "name": "memPtr", + "nativeSrc": "15208:6:70", + "nodeType": "YulIdentifier", + "src": "15208:6:70" + } + ], + "functionName": { + "name": "lt", + "nativeSrc": "15193:2:70", + "nodeType": "YulIdentifier", + "src": "15193:2:70" + }, + "nativeSrc": "15193:22:70", + "nodeType": "YulFunctionCall", + "src": "15193:22:70" + } + ], + "functionName": { + "name": "or", + "nativeSrc": "15154:2:70", + "nodeType": "YulIdentifier", + "src": "15154:2:70" + }, + "nativeSrc": "15154:62:70", + "nodeType": "YulFunctionCall", + "src": "15154:62:70" + }, + "nativeSrc": "15151:88:70", + "nodeType": "YulIf", + "src": "15151:88:70" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "15255:2:70", + "nodeType": "YulLiteral", + "src": "15255:2:70", + "type": "", + "value": "64" + }, + { + "name": "newFreePtr", + "nativeSrc": "15259:10:70", + "nodeType": "YulIdentifier", + "src": "15259:10:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "15248:6:70", + "nodeType": "YulIdentifier", + "src": "15248:6:70" + }, + "nativeSrc": "15248:22:70", + "nodeType": "YulFunctionCall", + "src": "15248:22:70" + }, + "nativeSrc": "15248:22:70", + "nodeType": "YulExpressionStatement", + "src": "15248:22:70" + } + ] + }, + "name": "allocate_memory_4301", + "nativeSrc": "15025:251:70", + "nodeType": "YulFunctionDefinition", + "returnVariables": [ + { + "name": "memPtr", + "nativeSrc": "15060:6:70", + "nodeType": "YulTypedName", + "src": "15060:6:70", + "type": "" + } + ], + "src": "15025:251:70" + }, + { + "body": { + "nativeSrc": "15322:207:70", + "nodeType": "YulBlock", + "src": "15322:207:70", + "statements": [ + { + "nativeSrc": "15332:19:70", + "nodeType": "YulAssignment", + "src": "15332:19:70", + "value": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "15348:2:70", + "nodeType": "YulLiteral", + "src": "15348:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "15342:5:70", + "nodeType": "YulIdentifier", + "src": "15342:5:70" + }, + "nativeSrc": "15342:9:70", + "nodeType": "YulFunctionCall", + "src": "15342:9:70" + }, + "variableNames": [ + { + "name": "memPtr", + "nativeSrc": "15332:6:70", + "nodeType": "YulIdentifier", + "src": "15332:6:70" + } + ] + }, + { + "nativeSrc": "15360:35:70", + "nodeType": "YulVariableDeclaration", + "src": "15360:35:70", + "value": { + "arguments": [ + { + "name": "memPtr", + "nativeSrc": "15382:6:70", + "nodeType": "YulIdentifier", + "src": "15382:6:70" + }, + { + "kind": "number", + "nativeSrc": "15390:4:70", + "nodeType": "YulLiteral", + "src": "15390:4:70", + "type": "", + "value": "0xe0" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "15378:3:70", + "nodeType": "YulIdentifier", + "src": "15378:3:70" + }, + "nativeSrc": "15378:17:70", + "nodeType": "YulFunctionCall", + "src": "15378:17:70" + }, + "variables": [ + { + "name": "newFreePtr", + "nativeSrc": "15364:10:70", + "nodeType": "YulTypedName", + "src": "15364:10:70", + "type": "" + } + ] + }, + { + "body": { + "nativeSrc": "15470:22:70", + "nodeType": "YulBlock", + "src": "15470:22:70", + "statements": [ + { + "expression": { + "arguments": [], + "functionName": { + "name": "panic_error_0x41", + "nativeSrc": "15472:16:70", + "nodeType": "YulIdentifier", + "src": "15472:16:70" + }, + "nativeSrc": "15472:18:70", + "nodeType": "YulFunctionCall", + "src": "15472:18:70" + }, + "nativeSrc": "15472:18:70", + "nodeType": "YulExpressionStatement", + "src": "15472:18:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "newFreePtr", + "nativeSrc": "15413:10:70", + "nodeType": "YulIdentifier", + "src": "15413:10:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "15433:2:70", + "nodeType": "YulLiteral", + "src": "15433:2:70", + "type": "", + "value": "64" + }, + { + "kind": "number", + "nativeSrc": "15437:1:70", + "nodeType": "YulLiteral", + "src": "15437:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "15429:3:70", + "nodeType": "YulIdentifier", + "src": "15429:3:70" + }, + "nativeSrc": "15429:10:70", + "nodeType": "YulFunctionCall", + "src": "15429:10:70" + }, + { + "kind": "number", + "nativeSrc": "15441:1:70", + "nodeType": "YulLiteral", + "src": "15441:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "15425:3:70", + "nodeType": "YulIdentifier", + "src": "15425:3:70" + }, + "nativeSrc": "15425:18:70", + "nodeType": "YulFunctionCall", + "src": "15425:18:70" + } + ], + "functionName": { + "name": "gt", + "nativeSrc": "15410:2:70", + "nodeType": "YulIdentifier", + "src": "15410:2:70" + }, + "nativeSrc": "15410:34:70", + "nodeType": "YulFunctionCall", + "src": "15410:34:70" + }, + { + "arguments": [ + { + "name": "newFreePtr", + "nativeSrc": "15449:10:70", + "nodeType": "YulIdentifier", + "src": "15449:10:70" + }, + { + "name": "memPtr", + "nativeSrc": "15461:6:70", + "nodeType": "YulIdentifier", + "src": "15461:6:70" + } + ], + "functionName": { + "name": "lt", + "nativeSrc": "15446:2:70", + "nodeType": "YulIdentifier", + "src": "15446:2:70" + }, + "nativeSrc": "15446:22:70", + "nodeType": "YulFunctionCall", + "src": "15446:22:70" + } + ], + "functionName": { + "name": "or", + "nativeSrc": "15407:2:70", + "nodeType": "YulIdentifier", + "src": "15407:2:70" + }, + "nativeSrc": "15407:62:70", + "nodeType": "YulFunctionCall", + "src": "15407:62:70" + }, + "nativeSrc": "15404:88:70", + "nodeType": "YulIf", + "src": "15404:88:70" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "15508:2:70", + "nodeType": "YulLiteral", + "src": "15508:2:70", + "type": "", + "value": "64" + }, + { + "name": "newFreePtr", + "nativeSrc": "15512:10:70", + "nodeType": "YulIdentifier", + "src": "15512:10:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "15501:6:70", + "nodeType": "YulIdentifier", + "src": "15501:6:70" + }, + "nativeSrc": "15501:22:70", + "nodeType": "YulFunctionCall", + "src": "15501:22:70" + }, + "nativeSrc": "15501:22:70", + "nodeType": "YulExpressionStatement", + "src": "15501:22:70" + } + ] + }, + "name": "allocate_memory", + "nativeSrc": "15281:248:70", + "nodeType": "YulFunctionDefinition", + "returnVariables": [ + { + "name": "memPtr", + "nativeSrc": "15311:6:70", + "nodeType": "YulTypedName", + "src": "15311:6:70", + "type": "" + } + ], + "src": "15281:248:70" + }, + { + "body": { + "nativeSrc": "15587:836:70", + "nodeType": "YulBlock", + "src": "15587:836:70", + "statements": [ + { + "body": { + "nativeSrc": "15636:16:70", + "nodeType": "YulBlock", + "src": "15636:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "15645:1:70", + "nodeType": "YulLiteral", + "src": "15645:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "15648:1:70", + "nodeType": "YulLiteral", + "src": "15648:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "15638:6:70", + "nodeType": "YulIdentifier", + "src": "15638:6:70" + }, + "nativeSrc": "15638:12:70", + "nodeType": "YulFunctionCall", + "src": "15638:12:70" + }, + "nativeSrc": "15638:12:70", + "nodeType": "YulExpressionStatement", + "src": "15638:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "arguments": [ + { + "name": "offset", + "nativeSrc": "15615:6:70", + "nodeType": "YulIdentifier", + "src": "15615:6:70" + }, + { + "kind": "number", + "nativeSrc": "15623:4:70", + "nodeType": "YulLiteral", + "src": "15623:4:70", + "type": "", + "value": "0x1f" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "15611:3:70", + "nodeType": "YulIdentifier", + "src": "15611:3:70" + }, + "nativeSrc": "15611:17:70", + "nodeType": "YulFunctionCall", + "src": "15611:17:70" + }, + { + "name": "end", + "nativeSrc": "15630:3:70", + "nodeType": "YulIdentifier", + "src": "15630:3:70" + } + ], + "functionName": { + "name": "slt", + "nativeSrc": "15607:3:70", + "nodeType": "YulIdentifier", + "src": "15607:3:70" + }, + "nativeSrc": "15607:27:70", + "nodeType": "YulFunctionCall", + "src": "15607:27:70" + } + ], + "functionName": { + "name": "iszero", + "nativeSrc": "15600:6:70", + "nodeType": "YulIdentifier", + "src": "15600:6:70" + }, + "nativeSrc": "15600:35:70", + "nodeType": "YulFunctionCall", + "src": "15600:35:70" + }, + "nativeSrc": "15597:55:70", + "nodeType": "YulIf", + "src": "15597:55:70" + }, + { + "nativeSrc": "15661:34:70", + "nodeType": "YulVariableDeclaration", + "src": "15661:34:70", + "value": { + "arguments": [ + { + "name": "offset", + "nativeSrc": "15688:6:70", + "nodeType": "YulIdentifier", + "src": "15688:6:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "15675:12:70", + "nodeType": "YulIdentifier", + "src": "15675:12:70" + }, + "nativeSrc": "15675:20:70", + "nodeType": "YulFunctionCall", + "src": "15675:20:70" + }, + "variables": [ + { + "name": "length", + "nativeSrc": "15665:6:70", + "nodeType": "YulTypedName", + "src": "15665:6:70", + "type": "" + } + ] + }, + { + "nativeSrc": "15704:28:70", + "nodeType": "YulVariableDeclaration", + "src": "15704:28:70", + "value": { + "arguments": [ + { + "name": "offset", + "nativeSrc": "15719:6:70", + "nodeType": "YulIdentifier", + "src": "15719:6:70" + }, + { + "kind": "number", + "nativeSrc": "15727:4:70", + "nodeType": "YulLiteral", + "src": "15727:4:70", + "type": "", + "value": "0x20" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "15715:3:70", + "nodeType": "YulIdentifier", + "src": "15715:3:70" + }, + "nativeSrc": "15715:17:70", + "nodeType": "YulFunctionCall", + "src": "15715:17:70" + }, + "variables": [ + { + "name": "src", + "nativeSrc": "15708:3:70", + "nodeType": "YulTypedName", + "src": "15708:3:70", + "type": "" + } + ] + }, + { + "nativeSrc": "15741:16:70", + "nodeType": "YulVariableDeclaration", + "src": "15741:16:70", + "value": { + "kind": "number", + "nativeSrc": "15756:1:70", + "nodeType": "YulLiteral", + "src": "15756:1:70", + "type": "", + "value": "0" + }, + "variables": [ + { + "name": "array_1", + "nativeSrc": "15745:7:70", + "nodeType": "YulTypedName", + "src": "15745:7:70", + "type": "" + } + ] + }, + { + "nativeSrc": "15766:13:70", + "nodeType": "YulVariableDeclaration", + "src": "15766:13:70", + "value": { + "kind": "number", + "nativeSrc": "15778:1:70", + "nodeType": "YulLiteral", + "src": "15778:1:70", + "type": "", + "value": "0" + }, + "variables": [ + { + "name": "size", + "nativeSrc": "15770:4:70", + "nodeType": "YulTypedName", + "src": "15770:4:70", + "type": "" + } + ] + }, + { + "body": { + "nativeSrc": "15822:22:70", + "nodeType": "YulBlock", + "src": "15822:22:70", + "statements": [ + { + "expression": { + "arguments": [], + "functionName": { + "name": "panic_error_0x41", + "nativeSrc": "15824:16:70", + "nodeType": "YulIdentifier", + "src": "15824:16:70" + }, + "nativeSrc": "15824:18:70", + "nodeType": "YulFunctionCall", + "src": "15824:18:70" + }, + "nativeSrc": "15824:18:70", + "nodeType": "YulExpressionStatement", + "src": "15824:18:70" + } + ] + }, + "condition": { + "arguments": [ + { + "name": "length", + "nativeSrc": "15794:6:70", + "nodeType": "YulIdentifier", + "src": "15794:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "15810:2:70", + "nodeType": "YulLiteral", + "src": "15810:2:70", + "type": "", + "value": "64" + }, + { + "kind": "number", + "nativeSrc": "15814:1:70", + "nodeType": "YulLiteral", + "src": "15814:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "15806:3:70", + "nodeType": "YulIdentifier", + "src": "15806:3:70" + }, + "nativeSrc": "15806:10:70", + "nodeType": "YulFunctionCall", + "src": "15806:10:70" + }, + { + "kind": "number", + "nativeSrc": "15818:1:70", + "nodeType": "YulLiteral", + "src": "15818:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "15802:3:70", + "nodeType": "YulIdentifier", + "src": "15802:3:70" + }, + "nativeSrc": "15802:18:70", + "nodeType": "YulFunctionCall", + "src": "15802:18:70" + } + ], + "functionName": { + "name": "gt", + "nativeSrc": "15791:2:70", + "nodeType": "YulIdentifier", + "src": "15791:2:70" + }, + "nativeSrc": "15791:30:70", + "nodeType": "YulFunctionCall", + "src": "15791:30:70" + }, + "nativeSrc": "15788:56:70", + "nodeType": "YulIf", + "src": "15788:56:70" + }, + { + "nativeSrc": "15853:43:70", + "nodeType": "YulVariableDeclaration", + "src": "15853:43:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "length", + "nativeSrc": "15875:6:70", + "nodeType": "YulIdentifier", + "src": "15875:6:70" + }, + { + "kind": "number", + "nativeSrc": "15883:2:70", + "nodeType": "YulLiteral", + "src": "15883:2:70", + "type": "", + "value": "31" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "15871:3:70", + "nodeType": "YulIdentifier", + "src": "15871:3:70" + }, + "nativeSrc": "15871:15:70", + "nodeType": "YulFunctionCall", + "src": "15871:15:70" + }, + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "15892:2:70", + "nodeType": "YulLiteral", + "src": "15892:2:70", + "type": "", + "value": "31" + } + ], + "functionName": { + "name": "not", + "nativeSrc": "15888:3:70", + "nodeType": "YulIdentifier", + "src": "15888:3:70" + }, + "nativeSrc": "15888:7:70", + "nodeType": "YulFunctionCall", + "src": "15888:7:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "15867:3:70", + "nodeType": "YulIdentifier", + "src": "15867:3:70" + }, + "nativeSrc": "15867:29:70", + "nodeType": "YulFunctionCall", + "src": "15867:29:70" + }, + "variables": [ + { + "name": "result", + "nativeSrc": "15857:6:70", + "nodeType": "YulTypedName", + "src": "15857:6:70", + "type": "" + } + ] + }, + { + "nativeSrc": "15905:25:70", + "nodeType": "YulAssignment", + "src": "15905:25:70", + "value": { + "arguments": [ + { + "name": "result", + "nativeSrc": "15917:6:70", + "nodeType": "YulIdentifier", + "src": "15917:6:70" + }, + { + "kind": "number", + "nativeSrc": "15925:4:70", + "nodeType": "YulLiteral", + "src": "15925:4:70", + "type": "", + "value": "0x20" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "15913:3:70", + "nodeType": "YulIdentifier", + "src": "15913:3:70" + }, + "nativeSrc": "15913:17:70", + "nodeType": "YulFunctionCall", + "src": "15913:17:70" + }, + "variableNames": [ + { + "name": "size", + "nativeSrc": "15905:4:70", + "nodeType": "YulIdentifier", + "src": "15905:4:70" + } + ] + }, + { + "nativeSrc": "15939:15:70", + "nodeType": "YulVariableDeclaration", + "src": "15939:15:70", + "value": { + "kind": "number", + "nativeSrc": "15953:1:70", + "nodeType": "YulLiteral", + "src": "15953:1:70", + "type": "", + "value": "0" + }, + "variables": [ + { + "name": "memPtr", + "nativeSrc": "15943:6:70", + "nodeType": "YulTypedName", + "src": "15943:6:70", + "type": "" + } + ] + }, + { + "nativeSrc": "15963:19:70", + "nodeType": "YulAssignment", + "src": "15963:19:70", + "value": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "15979:2:70", + "nodeType": "YulLiteral", + "src": "15979:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "15973:5:70", + "nodeType": "YulIdentifier", + "src": "15973:5:70" + }, + "nativeSrc": "15973:9:70", + "nodeType": "YulFunctionCall", + "src": "15973:9:70" + }, + "variableNames": [ + { + "name": "memPtr", + "nativeSrc": "15963:6:70", + "nodeType": "YulIdentifier", + "src": "15963:6:70" + } + ] + }, + { + "nativeSrc": "15991:60:70", + "nodeType": "YulVariableDeclaration", + "src": "15991:60:70", + "value": { + "arguments": [ + { + "name": "memPtr", + "nativeSrc": "16013:6:70", + "nodeType": "YulIdentifier", + "src": "16013:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "name": "result", + "nativeSrc": "16029:6:70", + "nodeType": "YulIdentifier", + "src": "16029:6:70" + }, + { + "kind": "number", + "nativeSrc": "16037:2:70", + "nodeType": "YulLiteral", + "src": "16037:2:70", + "type": "", + "value": "63" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "16025:3:70", + "nodeType": "YulIdentifier", + "src": "16025:3:70" + }, + "nativeSrc": "16025:15:70", + "nodeType": "YulFunctionCall", + "src": "16025:15:70" + }, + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "16046:2:70", + "nodeType": "YulLiteral", + "src": "16046:2:70", + "type": "", + "value": "31" + } + ], + "functionName": { + "name": "not", + "nativeSrc": "16042:3:70", + "nodeType": "YulIdentifier", + "src": "16042:3:70" + }, + "nativeSrc": "16042:7:70", + "nodeType": "YulFunctionCall", + "src": "16042:7:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "16021:3:70", + "nodeType": "YulIdentifier", + "src": "16021:3:70" + }, + "nativeSrc": "16021:29:70", + "nodeType": "YulFunctionCall", + "src": "16021:29:70" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "16009:3:70", + "nodeType": "YulIdentifier", + "src": "16009:3:70" + }, + "nativeSrc": "16009:42:70", + "nodeType": "YulFunctionCall", + "src": "16009:42:70" + }, + "variables": [ + { + "name": "newFreePtr", + "nativeSrc": "15995:10:70", + "nodeType": "YulTypedName", + "src": "15995:10:70", + "type": "" + } + ] + }, + { + "body": { + "nativeSrc": "16126:22:70", + "nodeType": "YulBlock", + "src": "16126:22:70", + "statements": [ + { + "expression": { + "arguments": [], + "functionName": { + "name": "panic_error_0x41", + "nativeSrc": "16128:16:70", + "nodeType": "YulIdentifier", + "src": "16128:16:70" + }, + "nativeSrc": "16128:18:70", + "nodeType": "YulFunctionCall", + "src": "16128:18:70" + }, + "nativeSrc": "16128:18:70", + "nodeType": "YulExpressionStatement", + "src": "16128:18:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "newFreePtr", + "nativeSrc": "16069:10:70", + "nodeType": "YulIdentifier", + "src": "16069:10:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "16089:2:70", + "nodeType": "YulLiteral", + "src": "16089:2:70", + "type": "", + "value": "64" + }, + { + "kind": "number", + "nativeSrc": "16093:1:70", + "nodeType": "YulLiteral", + "src": "16093:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "16085:3:70", + "nodeType": "YulIdentifier", + "src": "16085:3:70" + }, + "nativeSrc": "16085:10:70", + "nodeType": "YulFunctionCall", + "src": "16085:10:70" + }, + { + "kind": "number", + "nativeSrc": "16097:1:70", + "nodeType": "YulLiteral", + "src": "16097:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "16081:3:70", + "nodeType": "YulIdentifier", + "src": "16081:3:70" + }, + "nativeSrc": "16081:18:70", + "nodeType": "YulFunctionCall", + "src": "16081:18:70" + } + ], + "functionName": { + "name": "gt", + "nativeSrc": "16066:2:70", + "nodeType": "YulIdentifier", + "src": "16066:2:70" + }, + "nativeSrc": "16066:34:70", + "nodeType": "YulFunctionCall", + "src": "16066:34:70" + }, + { + "arguments": [ + { + "name": "newFreePtr", + "nativeSrc": "16105:10:70", + "nodeType": "YulIdentifier", + "src": "16105:10:70" + }, + { + "name": "memPtr", + "nativeSrc": "16117:6:70", + "nodeType": "YulIdentifier", + "src": "16117:6:70" + } + ], + "functionName": { + "name": "lt", + "nativeSrc": "16102:2:70", + "nodeType": "YulIdentifier", + "src": "16102:2:70" + }, + "nativeSrc": "16102:22:70", + "nodeType": "YulFunctionCall", + "src": "16102:22:70" + } + ], + "functionName": { + "name": "or", + "nativeSrc": "16063:2:70", + "nodeType": "YulIdentifier", + "src": "16063:2:70" + }, + "nativeSrc": "16063:62:70", + "nodeType": "YulFunctionCall", + "src": "16063:62:70" + }, + "nativeSrc": "16060:88:70", + "nodeType": "YulIf", + "src": "16060:88:70" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "16164:2:70", + "nodeType": "YulLiteral", + "src": "16164:2:70", + "type": "", + "value": "64" + }, + { + "name": "newFreePtr", + "nativeSrc": "16168:10:70", + "nodeType": "YulIdentifier", + "src": "16168:10:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "16157:6:70", + "nodeType": "YulIdentifier", + "src": "16157:6:70" + }, + "nativeSrc": "16157:22:70", + "nodeType": "YulFunctionCall", + "src": "16157:22:70" + }, + "nativeSrc": "16157:22:70", + "nodeType": "YulExpressionStatement", + "src": "16157:22:70" + }, + { + "nativeSrc": "16188:17:70", + "nodeType": "YulAssignment", + "src": "16188:17:70", + "value": { + "name": "memPtr", + "nativeSrc": "16199:6:70", + "nodeType": "YulIdentifier", + "src": "16199:6:70" + }, + "variableNames": [ + { + "name": "array_1", + "nativeSrc": "16188:7:70", + "nodeType": "YulIdentifier", + "src": "16188:7:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "memPtr", + "nativeSrc": "16221:6:70", + "nodeType": "YulIdentifier", + "src": "16221:6:70" + }, + { + "name": "length", + "nativeSrc": "16229:6:70", + "nodeType": "YulIdentifier", + "src": "16229:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "16214:6:70", + "nodeType": "YulIdentifier", + "src": "16214:6:70" + }, + "nativeSrc": "16214:22:70", + "nodeType": "YulFunctionCall", + "src": "16214:22:70" + }, + "nativeSrc": "16214:22:70", + "nodeType": "YulExpressionStatement", + "src": "16214:22:70" + }, + { + "body": { + "nativeSrc": "16274:16:70", + "nodeType": "YulBlock", + "src": "16274:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "16283:1:70", + "nodeType": "YulLiteral", + "src": "16283:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "16286:1:70", + "nodeType": "YulLiteral", + "src": "16286:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "16276:6:70", + "nodeType": "YulIdentifier", + "src": "16276:6:70" + }, + "nativeSrc": "16276:12:70", + "nodeType": "YulFunctionCall", + "src": "16276:12:70" + }, + "nativeSrc": "16276:12:70", + "nodeType": "YulExpressionStatement", + "src": "16276:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "src", + "nativeSrc": "16255:3:70", + "nodeType": "YulIdentifier", + "src": "16255:3:70" + }, + { + "name": "length", + "nativeSrc": "16260:6:70", + "nodeType": "YulIdentifier", + "src": "16260:6:70" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "16251:3:70", + "nodeType": "YulIdentifier", + "src": "16251:3:70" + }, + "nativeSrc": "16251:16:70", + "nodeType": "YulFunctionCall", + "src": "16251:16:70" + }, + { + "name": "end", + "nativeSrc": "16269:3:70", + "nodeType": "YulIdentifier", + "src": "16269:3:70" + } + ], + "functionName": { + "name": "gt", + "nativeSrc": "16248:2:70", + "nodeType": "YulIdentifier", + "src": "16248:2:70" + }, + "nativeSrc": "16248:25:70", + "nodeType": "YulFunctionCall", + "src": "16248:25:70" + }, + "nativeSrc": "16245:45:70", + "nodeType": "YulIf", + "src": "16245:45:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "memPtr", + "nativeSrc": "16316:6:70", + "nodeType": "YulIdentifier", + "src": "16316:6:70" + }, + { + "kind": "number", + "nativeSrc": "16324:4:70", + "nodeType": "YulLiteral", + "src": "16324:4:70", + "type": "", + "value": "0x20" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "16312:3:70", + "nodeType": "YulIdentifier", + "src": "16312:3:70" + }, + "nativeSrc": "16312:17:70", + "nodeType": "YulFunctionCall", + "src": "16312:17:70" + }, + { + "name": "src", + "nativeSrc": "16331:3:70", + "nodeType": "YulIdentifier", + "src": "16331:3:70" + }, + { + "name": "length", + "nativeSrc": "16336:6:70", + "nodeType": "YulIdentifier", + "src": "16336:6:70" + } + ], + "functionName": { + "name": "calldatacopy", + "nativeSrc": "16299:12:70", + "nodeType": "YulIdentifier", + "src": "16299:12:70" + }, + "nativeSrc": "16299:44:70", + "nodeType": "YulFunctionCall", + "src": "16299:44:70" + }, + "nativeSrc": "16299:44:70", + "nodeType": "YulExpressionStatement", + "src": "16299:44:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "arguments": [ + { + "name": "memPtr", + "nativeSrc": "16367:6:70", + "nodeType": "YulIdentifier", + "src": "16367:6:70" + }, + { + "name": "length", + "nativeSrc": "16375:6:70", + "nodeType": "YulIdentifier", + "src": "16375:6:70" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "16363:3:70", + "nodeType": "YulIdentifier", + "src": "16363:3:70" + }, + "nativeSrc": "16363:19:70", + "nodeType": "YulFunctionCall", + "src": "16363:19:70" + }, + { + "kind": "number", + "nativeSrc": "16384:4:70", + "nodeType": "YulLiteral", + "src": "16384:4:70", + "type": "", + "value": "0x20" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "16359:3:70", + "nodeType": "YulIdentifier", + "src": "16359:3:70" + }, + "nativeSrc": "16359:30:70", + "nodeType": "YulFunctionCall", + "src": "16359:30:70" + }, + { + "kind": "number", + "nativeSrc": "16391:1:70", + "nodeType": "YulLiteral", + "src": "16391:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "16352:6:70", + "nodeType": "YulIdentifier", + "src": "16352:6:70" + }, + "nativeSrc": "16352:41:70", + "nodeType": "YulFunctionCall", + "src": "16352:41:70" + }, + "nativeSrc": "16352:41:70", + "nodeType": "YulExpressionStatement", + "src": "16352:41:70" + }, + { + "nativeSrc": "16402:15:70", + "nodeType": "YulAssignment", + "src": "16402:15:70", + "value": { + "name": "memPtr", + "nativeSrc": "16411:6:70", + "nodeType": "YulIdentifier", + "src": "16411:6:70" + }, + "variableNames": [ + { + "name": "array", + "nativeSrc": "16402:5:70", + "nodeType": "YulIdentifier", + "src": "16402:5:70" + } + ] + } + ] + }, + "name": "abi_decode_string", + "nativeSrc": "15534:889:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "offset", + "nativeSrc": "15561:6:70", + "nodeType": "YulTypedName", + "src": "15561:6:70", + "type": "" + }, + { + "name": "end", + "nativeSrc": "15569:3:70", + "nodeType": "YulTypedName", + "src": "15569:3:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "array", + "nativeSrc": "15577:5:70", + "nodeType": "YulTypedName", + "src": "15577:5:70", + "type": "" + } + ], + "src": "15534:889:70" + }, + { + "body": { + "nativeSrc": "16560:549:70", + "nodeType": "YulBlock", + "src": "16560:549:70", + "statements": [ + { + "body": { + "nativeSrc": "16606:16:70", + "nodeType": "YulBlock", + "src": "16606:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "16615:1:70", + "nodeType": "YulLiteral", + "src": "16615:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "16618:1:70", + "nodeType": "YulLiteral", + "src": "16618:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "16608:6:70", + "nodeType": "YulIdentifier", + "src": "16608:6:70" + }, + "nativeSrc": "16608:12:70", + "nodeType": "YulFunctionCall", + "src": "16608:12:70" + }, + "nativeSrc": "16608:12:70", + "nodeType": "YulExpressionStatement", + "src": "16608:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "dataEnd", + "nativeSrc": "16581:7:70", + "nodeType": "YulIdentifier", + "src": "16581:7:70" + }, + { + "name": "headStart", + "nativeSrc": "16590:9:70", + "nodeType": "YulIdentifier", + "src": "16590:9:70" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "16577:3:70", + "nodeType": "YulIdentifier", + "src": "16577:3:70" + }, + "nativeSrc": "16577:23:70", + "nodeType": "YulFunctionCall", + "src": "16577:23:70" + }, + { + "kind": "number", + "nativeSrc": "16602:2:70", + "nodeType": "YulLiteral", + "src": "16602:2:70", + "type": "", + "value": "96" + } + ], + "functionName": { + "name": "slt", + "nativeSrc": "16573:3:70", + "nodeType": "YulIdentifier", + "src": "16573:3:70" + }, + "nativeSrc": "16573:32:70", + "nodeType": "YulFunctionCall", + "src": "16573:32:70" + }, + "nativeSrc": "16570:52:70", + "nodeType": "YulIf", + "src": "16570:52:70" + }, + { + "nativeSrc": "16631:37:70", + "nodeType": "YulVariableDeclaration", + "src": "16631:37:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "16658:9:70", + "nodeType": "YulIdentifier", + "src": "16658:9:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "16645:12:70", + "nodeType": "YulIdentifier", + "src": "16645:12:70" + }, + "nativeSrc": "16645:23:70", + "nodeType": "YulFunctionCall", + "src": "16645:23:70" + }, + "variables": [ + { + "name": "offset", + "nativeSrc": "16635:6:70", + "nodeType": "YulTypedName", + "src": "16635:6:70", + "type": "" + } + ] + }, + { + "body": { + "nativeSrc": "16711:16:70", + "nodeType": "YulBlock", + "src": "16711:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "16720:1:70", + "nodeType": "YulLiteral", + "src": "16720:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "16723:1:70", + "nodeType": "YulLiteral", + "src": "16723:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "16713:6:70", + "nodeType": "YulIdentifier", + "src": "16713:6:70" + }, + "nativeSrc": "16713:12:70", + "nodeType": "YulFunctionCall", + "src": "16713:12:70" + }, + "nativeSrc": "16713:12:70", + "nodeType": "YulExpressionStatement", + "src": "16713:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "name": "offset", + "nativeSrc": "16683:6:70", + "nodeType": "YulIdentifier", + "src": "16683:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "16699:2:70", + "nodeType": "YulLiteral", + "src": "16699:2:70", + "type": "", + "value": "64" + }, + { + "kind": "number", + "nativeSrc": "16703:1:70", + "nodeType": "YulLiteral", + "src": "16703:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "16695:3:70", + "nodeType": "YulIdentifier", + "src": "16695:3:70" + }, + "nativeSrc": "16695:10:70", + "nodeType": "YulFunctionCall", + "src": "16695:10:70" + }, + { + "kind": "number", + "nativeSrc": "16707:1:70", + "nodeType": "YulLiteral", + "src": "16707:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "16691:3:70", + "nodeType": "YulIdentifier", + "src": "16691:3:70" + }, + "nativeSrc": "16691:18:70", + "nodeType": "YulFunctionCall", + "src": "16691:18:70" + } + ], + "functionName": { + "name": "gt", + "nativeSrc": "16680:2:70", + "nodeType": "YulIdentifier", + "src": "16680:2:70" + }, + "nativeSrc": "16680:30:70", + "nodeType": "YulFunctionCall", + "src": "16680:30:70" + }, + "nativeSrc": "16677:50:70", + "nodeType": "YulIf", + "src": "16677:50:70" + }, + { + "nativeSrc": "16736:60:70", + "nodeType": "YulAssignment", + "src": "16736:60:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "16768:9:70", + "nodeType": "YulIdentifier", + "src": "16768:9:70" + }, + { + "name": "offset", + "nativeSrc": "16779:6:70", + "nodeType": "YulIdentifier", + "src": "16779:6:70" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "16764:3:70", + "nodeType": "YulIdentifier", + "src": "16764:3:70" + }, + "nativeSrc": "16764:22:70", + "nodeType": "YulFunctionCall", + "src": "16764:22:70" + }, + { + "name": "dataEnd", + "nativeSrc": "16788:7:70", + "nodeType": "YulIdentifier", + "src": "16788:7:70" + } + ], + "functionName": { + "name": "abi_decode_string", + "nativeSrc": "16746:17:70", + "nodeType": "YulIdentifier", + "src": "16746:17:70" + }, + "nativeSrc": "16746:50:70", + "nodeType": "YulFunctionCall", + "src": "16746:50:70" + }, + "variableNames": [ + { + "name": "value0", + "nativeSrc": "16736:6:70", + "nodeType": "YulIdentifier", + "src": "16736:6:70" + } + ] + }, + { + "nativeSrc": "16805:48:70", + "nodeType": "YulVariableDeclaration", + "src": "16805:48:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "16838:9:70", + "nodeType": "YulIdentifier", + "src": "16838:9:70" + }, + { + "kind": "number", + "nativeSrc": "16849:2:70", + "nodeType": "YulLiteral", + "src": "16849:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "16834:3:70", + "nodeType": "YulIdentifier", + "src": "16834:3:70" + }, + "nativeSrc": "16834:18:70", + "nodeType": "YulFunctionCall", + "src": "16834:18:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "16821:12:70", + "nodeType": "YulIdentifier", + "src": "16821:12:70" + }, + "nativeSrc": "16821:32:70", + "nodeType": "YulFunctionCall", + "src": "16821:32:70" + }, + "variables": [ + { + "name": "offset_1", + "nativeSrc": "16809:8:70", + "nodeType": "YulTypedName", + "src": "16809:8:70", + "type": "" + } + ] + }, + { + "body": { + "nativeSrc": "16898:16:70", + "nodeType": "YulBlock", + "src": "16898:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "16907:1:70", + "nodeType": "YulLiteral", + "src": "16907:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "16910:1:70", + "nodeType": "YulLiteral", + "src": "16910:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "16900:6:70", + "nodeType": "YulIdentifier", + "src": "16900:6:70" + }, + "nativeSrc": "16900:12:70", + "nodeType": "YulFunctionCall", + "src": "16900:12:70" + }, + "nativeSrc": "16900:12:70", + "nodeType": "YulExpressionStatement", + "src": "16900:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "name": "offset_1", + "nativeSrc": "16868:8:70", + "nodeType": "YulIdentifier", + "src": "16868:8:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "16886:2:70", + "nodeType": "YulLiteral", + "src": "16886:2:70", + "type": "", + "value": "64" + }, + { + "kind": "number", + "nativeSrc": "16890:1:70", + "nodeType": "YulLiteral", + "src": "16890:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "16882:3:70", + "nodeType": "YulIdentifier", + "src": "16882:3:70" + }, + "nativeSrc": "16882:10:70", + "nodeType": "YulFunctionCall", + "src": "16882:10:70" + }, + { + "kind": "number", + "nativeSrc": "16894:1:70", + "nodeType": "YulLiteral", + "src": "16894:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "16878:3:70", + "nodeType": "YulIdentifier", + "src": "16878:3:70" + }, + "nativeSrc": "16878:18:70", + "nodeType": "YulFunctionCall", + "src": "16878:18:70" + } + ], + "functionName": { + "name": "gt", + "nativeSrc": "16865:2:70", + "nodeType": "YulIdentifier", + "src": "16865:2:70" + }, + "nativeSrc": "16865:32:70", + "nodeType": "YulFunctionCall", + "src": "16865:32:70" + }, + "nativeSrc": "16862:52:70", + "nodeType": "YulIf", + "src": "16862:52:70" + }, + { + "nativeSrc": "16923:62:70", + "nodeType": "YulAssignment", + "src": "16923:62:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "16955:9:70", + "nodeType": "YulIdentifier", + "src": "16955:9:70" + }, + { + "name": "offset_1", + "nativeSrc": "16966:8:70", + "nodeType": "YulIdentifier", + "src": "16966:8:70" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "16951:3:70", + "nodeType": "YulIdentifier", + "src": "16951:3:70" + }, + "nativeSrc": "16951:24:70", + "nodeType": "YulFunctionCall", + "src": "16951:24:70" + }, + { + "name": "dataEnd", + "nativeSrc": "16977:7:70", + "nodeType": "YulIdentifier", + "src": "16977:7:70" + } + ], + "functionName": { + "name": "abi_decode_string", + "nativeSrc": "16933:17:70", + "nodeType": "YulIdentifier", + "src": "16933:17:70" + }, + "nativeSrc": "16933:52:70", + "nodeType": "YulFunctionCall", + "src": "16933:52:70" + }, + "variableNames": [ + { + "name": "value1", + "nativeSrc": "16923:6:70", + "nodeType": "YulIdentifier", + "src": "16923:6:70" + } + ] + }, + { + "nativeSrc": "16994:45:70", + "nodeType": "YulVariableDeclaration", + "src": "16994:45:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "17024:9:70", + "nodeType": "YulIdentifier", + "src": "17024:9:70" + }, + { + "kind": "number", + "nativeSrc": "17035:2:70", + "nodeType": "YulLiteral", + "src": "17035:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "17020:3:70", + "nodeType": "YulIdentifier", + "src": "17020:3:70" + }, + "nativeSrc": "17020:18:70", + "nodeType": "YulFunctionCall", + "src": "17020:18:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "17007:12:70", + "nodeType": "YulIdentifier", + "src": "17007:12:70" + }, + "nativeSrc": "17007:32:70", + "nodeType": "YulFunctionCall", + "src": "17007:32:70" + }, + "variables": [ + { + "name": "value", + "nativeSrc": "16998:5:70", + "nodeType": "YulTypedName", + "src": "16998:5:70", + "type": "" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "value", + "nativeSrc": "17073:5:70", + "nodeType": "YulIdentifier", + "src": "17073:5:70" + } + ], + "functionName": { + "name": "validator_revert_address", + "nativeSrc": "17048:24:70", + "nodeType": "YulIdentifier", + "src": "17048:24:70" + }, + "nativeSrc": "17048:31:70", + "nodeType": "YulFunctionCall", + "src": "17048:31:70" + }, + "nativeSrc": "17048:31:70", + "nodeType": "YulExpressionStatement", + "src": "17048:31:70" + }, + { + "nativeSrc": "17088:15:70", + "nodeType": "YulAssignment", + "src": "17088:15:70", + "value": { + "name": "value", + "nativeSrc": "17098:5:70", + "nodeType": "YulIdentifier", + "src": "17098:5:70" + }, + "variableNames": [ + { + "name": "value2", + "nativeSrc": "17088:6:70", + "nodeType": "YulIdentifier", + "src": "17088:6:70" + } + ] + } + ] + }, + "name": "abi_decode_tuple_t_string_memory_ptrt_string_memory_ptrt_address_payable", + "nativeSrc": "16428:681:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "16510:9:70", + "nodeType": "YulTypedName", + "src": "16510:9:70", + "type": "" + }, + { + "name": "dataEnd", + "nativeSrc": "16521:7:70", + "nodeType": "YulTypedName", + "src": "16521:7:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value0", + "nativeSrc": "16533:6:70", + "nodeType": "YulTypedName", + "src": "16533:6:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "16541:6:70", + "nodeType": "YulTypedName", + "src": "16541:6:70", + "type": "" + }, + { + "name": "value2", + "nativeSrc": "16549:6:70", + "nodeType": "YulTypedName", + "src": "16549:6:70", + "type": "" + } + ], + "src": "16428:681:70" + }, + { + "body": { + "nativeSrc": "17169:325:70", + "nodeType": "YulBlock", + "src": "17169:325:70", + "statements": [ + { + "nativeSrc": "17179:22:70", + "nodeType": "YulAssignment", + "src": "17179:22:70", + "value": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "17193:1:70", + "nodeType": "YulLiteral", + "src": "17193:1:70", + "type": "", + "value": "1" + }, + { + "name": "data", + "nativeSrc": "17196:4:70", + "nodeType": "YulIdentifier", + "src": "17196:4:70" + } + ], + "functionName": { + "name": "shr", + "nativeSrc": "17189:3:70", + "nodeType": "YulIdentifier", + "src": "17189:3:70" + }, + "nativeSrc": "17189:12:70", + "nodeType": "YulFunctionCall", + "src": "17189:12:70" + }, + "variableNames": [ + { + "name": "length", + "nativeSrc": "17179:6:70", + "nodeType": "YulIdentifier", + "src": "17179:6:70" + } + ] + }, + { + "nativeSrc": "17210:38:70", + "nodeType": "YulVariableDeclaration", + "src": "17210:38:70", + "value": { + "arguments": [ + { + "name": "data", + "nativeSrc": "17240:4:70", + "nodeType": "YulIdentifier", + "src": "17240:4:70" + }, + { + "kind": "number", + "nativeSrc": "17246:1:70", + "nodeType": "YulLiteral", + "src": "17246:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "17236:3:70", + "nodeType": "YulIdentifier", + "src": "17236:3:70" + }, + "nativeSrc": "17236:12:70", + "nodeType": "YulFunctionCall", + "src": "17236:12:70" + }, + "variables": [ + { + "name": "outOfPlaceEncoding", + "nativeSrc": "17214:18:70", + "nodeType": "YulTypedName", + "src": "17214:18:70", + "type": "" + } + ] + }, + { + "body": { + "nativeSrc": "17287:31:70", + "nodeType": "YulBlock", + "src": "17287:31:70", + "statements": [ + { + "nativeSrc": "17289:27:70", + "nodeType": "YulAssignment", + "src": "17289:27:70", + "value": { + "arguments": [ + { + "name": "length", + "nativeSrc": "17303:6:70", + "nodeType": "YulIdentifier", + "src": "17303:6:70" + }, + { + "kind": "number", + "nativeSrc": "17311:4:70", + "nodeType": "YulLiteral", + "src": "17311:4:70", + "type": "", + "value": "0x7f" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "17299:3:70", + "nodeType": "YulIdentifier", + "src": "17299:3:70" + }, + "nativeSrc": "17299:17:70", + "nodeType": "YulFunctionCall", + "src": "17299:17:70" + }, + "variableNames": [ + { + "name": "length", + "nativeSrc": "17289:6:70", + "nodeType": "YulIdentifier", + "src": "17289:6:70" + } + ] + } + ] + }, + "condition": { + "arguments": [ + { + "name": "outOfPlaceEncoding", + "nativeSrc": "17267:18:70", + "nodeType": "YulIdentifier", + "src": "17267:18:70" + } + ], + "functionName": { + "name": "iszero", + "nativeSrc": "17260:6:70", + "nodeType": "YulIdentifier", + "src": "17260:6:70" + }, + "nativeSrc": "17260:26:70", + "nodeType": "YulFunctionCall", + "src": "17260:26:70" + }, + "nativeSrc": "17257:61:70", + "nodeType": "YulIf", + "src": "17257:61:70" + }, + { + "body": { + "nativeSrc": "17377:111:70", + "nodeType": "YulBlock", + "src": "17377:111:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "17398:1:70", + "nodeType": "YulLiteral", + "src": "17398:1:70", + "type": "", + "value": "0" + }, + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "17405:3:70", + "nodeType": "YulLiteral", + "src": "17405:3:70", + "type": "", + "value": "224" + }, + { + "kind": "number", + "nativeSrc": "17410:10:70", + "nodeType": "YulLiteral", + "src": "17410:10:70", + "type": "", + "value": "0x4e487b71" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "17401:3:70", + "nodeType": "YulIdentifier", + "src": "17401:3:70" + }, + "nativeSrc": "17401:20:70", + "nodeType": "YulFunctionCall", + "src": "17401:20:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "17391:6:70", + "nodeType": "YulIdentifier", + "src": "17391:6:70" + }, + "nativeSrc": "17391:31:70", + "nodeType": "YulFunctionCall", + "src": "17391:31:70" + }, + "nativeSrc": "17391:31:70", + "nodeType": "YulExpressionStatement", + "src": "17391:31:70" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "17442:1:70", + "nodeType": "YulLiteral", + "src": "17442:1:70", + "type": "", + "value": "4" + }, + { + "kind": "number", + "nativeSrc": "17445:4:70", + "nodeType": "YulLiteral", + "src": "17445:4:70", + "type": "", + "value": "0x22" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "17435:6:70", + "nodeType": "YulIdentifier", + "src": "17435:6:70" + }, + "nativeSrc": "17435:15:70", + "nodeType": "YulFunctionCall", + "src": "17435:15:70" + }, + "nativeSrc": "17435:15:70", + "nodeType": "YulExpressionStatement", + "src": "17435:15:70" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "17470:1:70", + "nodeType": "YulLiteral", + "src": "17470:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "17473:4:70", + "nodeType": "YulLiteral", + "src": "17473:4:70", + "type": "", + "value": "0x24" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "17463:6:70", + "nodeType": "YulIdentifier", + "src": "17463:6:70" + }, + "nativeSrc": "17463:15:70", + "nodeType": "YulFunctionCall", + "src": "17463:15:70" + }, + "nativeSrc": "17463:15:70", + "nodeType": "YulExpressionStatement", + "src": "17463:15:70" + } + ] + }, + "condition": { + "arguments": [ + { + "name": "outOfPlaceEncoding", + "nativeSrc": "17333:18:70", + "nodeType": "YulIdentifier", + "src": "17333:18:70" + }, + { + "arguments": [ + { + "name": "length", + "nativeSrc": "17356:6:70", + "nodeType": "YulIdentifier", + "src": "17356:6:70" + }, + { + "kind": "number", + "nativeSrc": "17364:2:70", + "nodeType": "YulLiteral", + "src": "17364:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "lt", + "nativeSrc": "17353:2:70", + "nodeType": "YulIdentifier", + "src": "17353:2:70" + }, + "nativeSrc": "17353:14:70", + "nodeType": "YulFunctionCall", + "src": "17353:14:70" + } + ], + "functionName": { + "name": "eq", + "nativeSrc": "17330:2:70", + "nodeType": "YulIdentifier", + "src": "17330:2:70" + }, + "nativeSrc": "17330:38:70", + "nodeType": "YulFunctionCall", + "src": "17330:38:70" + }, + "nativeSrc": "17327:161:70", + "nodeType": "YulIf", + "src": "17327:161:70" + } + ] + }, + "name": "extract_byte_array_length", + "nativeSrc": "17114:380:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "data", + "nativeSrc": "17149:4:70", + "nodeType": "YulTypedName", + "src": "17149:4:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "length", + "nativeSrc": "17158:6:70", + "nodeType": "YulTypedName", + "src": "17158:6:70", + "type": "" + } + ], + "src": "17114:380:70" + }, + { + "body": { + "nativeSrc": "17555:65:70", + "nodeType": "YulBlock", + "src": "17555:65:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "17572:1:70", + "nodeType": "YulLiteral", + "src": "17572:1:70", + "type": "", + "value": "0" + }, + { + "name": "ptr", + "nativeSrc": "17575:3:70", + "nodeType": "YulIdentifier", + "src": "17575:3:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "17565:6:70", + "nodeType": "YulIdentifier", + "src": "17565:6:70" + }, + "nativeSrc": "17565:14:70", + "nodeType": "YulFunctionCall", + "src": "17565:14:70" + }, + "nativeSrc": "17565:14:70", + "nodeType": "YulExpressionStatement", + "src": "17565:14:70" + }, + { + "nativeSrc": "17588:26:70", + "nodeType": "YulAssignment", + "src": "17588:26:70", + "value": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "17606:1:70", + "nodeType": "YulLiteral", + "src": "17606:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "17609:4:70", + "nodeType": "YulLiteral", + "src": "17609:4:70", + "type": "", + "value": "0x20" + } + ], + "functionName": { + "name": "keccak256", + "nativeSrc": "17596:9:70", + "nodeType": "YulIdentifier", + "src": "17596:9:70" + }, + "nativeSrc": "17596:18:70", + "nodeType": "YulFunctionCall", + "src": "17596:18:70" + }, + "variableNames": [ + { + "name": "data", + "nativeSrc": "17588:4:70", + "nodeType": "YulIdentifier", + "src": "17588:4:70" + } + ] + } + ] + }, + "name": "array_dataslot_string_storage", + "nativeSrc": "17499:121:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "ptr", + "nativeSrc": "17538:3:70", + "nodeType": "YulTypedName", + "src": "17538:3:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "data", + "nativeSrc": "17546:4:70", + "nodeType": "YulTypedName", + "src": "17546:4:70", + "type": "" + } + ], + "src": "17499:121:70" + }, + { + "body": { + "nativeSrc": "17706:437:70", + "nodeType": "YulBlock", + "src": "17706:437:70", + "statements": [ + { + "body": { + "nativeSrc": "17739:398:70", + "nodeType": "YulBlock", + "src": "17739:398:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "17760:1:70", + "nodeType": "YulLiteral", + "src": "17760:1:70", + "type": "", + "value": "0" + }, + { + "name": "array", + "nativeSrc": "17763:5:70", + "nodeType": "YulIdentifier", + "src": "17763:5:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "17753:6:70", + "nodeType": "YulIdentifier", + "src": "17753:6:70" + }, + "nativeSrc": "17753:16:70", + "nodeType": "YulFunctionCall", + "src": "17753:16:70" + }, + "nativeSrc": "17753:16:70", + "nodeType": "YulExpressionStatement", + "src": "17753:16:70" + }, + { + "nativeSrc": "17782:30:70", + "nodeType": "YulVariableDeclaration", + "src": "17782:30:70", + "value": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "17804:1:70", + "nodeType": "YulLiteral", + "src": "17804:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "17807:4:70", + "nodeType": "YulLiteral", + "src": "17807:4:70", + "type": "", + "value": "0x20" + } + ], + "functionName": { + "name": "keccak256", + "nativeSrc": "17794:9:70", + "nodeType": "YulIdentifier", + "src": "17794:9:70" + }, + "nativeSrc": "17794:18:70", + "nodeType": "YulFunctionCall", + "src": "17794:18:70" + }, + "variables": [ + { + "name": "data", + "nativeSrc": "17786:4:70", + "nodeType": "YulTypedName", + "src": "17786:4:70", + "type": "" + } + ] + }, + { + "nativeSrc": "17825:57:70", + "nodeType": "YulVariableDeclaration", + "src": "17825:57:70", + "value": { + "arguments": [ + { + "name": "data", + "nativeSrc": "17848:4:70", + "nodeType": "YulIdentifier", + "src": "17848:4:70" + }, + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "17858:1:70", + "nodeType": "YulLiteral", + "src": "17858:1:70", + "type": "", + "value": "5" + }, + { + "arguments": [ + { + "name": "startIndex", + "nativeSrc": "17865:10:70", + "nodeType": "YulIdentifier", + "src": "17865:10:70" + }, + { + "kind": "number", + "nativeSrc": "17877:2:70", + "nodeType": "YulLiteral", + "src": "17877:2:70", + "type": "", + "value": "31" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "17861:3:70", + "nodeType": "YulIdentifier", + "src": "17861:3:70" + }, + "nativeSrc": "17861:19:70", + "nodeType": "YulFunctionCall", + "src": "17861:19:70" + } + ], + "functionName": { + "name": "shr", + "nativeSrc": "17854:3:70", + "nodeType": "YulIdentifier", + "src": "17854:3:70" + }, + "nativeSrc": "17854:27:70", + "nodeType": "YulFunctionCall", + "src": "17854:27:70" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "17844:3:70", + "nodeType": "YulIdentifier", + "src": "17844:3:70" + }, + "nativeSrc": "17844:38:70", + "nodeType": "YulFunctionCall", + "src": "17844:38:70" + }, + "variables": [ + { + "name": "deleteStart", + "nativeSrc": "17829:11:70", + "nodeType": "YulTypedName", + "src": "17829:11:70", + "type": "" + } + ] + }, + { + "body": { + "nativeSrc": "17919:23:70", + "nodeType": "YulBlock", + "src": "17919:23:70", + "statements": [ + { + "nativeSrc": "17921:19:70", + "nodeType": "YulAssignment", + "src": "17921:19:70", + "value": { + "name": "data", + "nativeSrc": "17936:4:70", + "nodeType": "YulIdentifier", + "src": "17936:4:70" + }, + "variableNames": [ + { + "name": "deleteStart", + "nativeSrc": "17921:11:70", + "nodeType": "YulIdentifier", + "src": "17921:11:70" + } + ] + } + ] + }, + "condition": { + "arguments": [ + { + "name": "startIndex", + "nativeSrc": "17901:10:70", + "nodeType": "YulIdentifier", + "src": "17901:10:70" + }, + { + "kind": "number", + "nativeSrc": "17913:4:70", + "nodeType": "YulLiteral", + "src": "17913:4:70", + "type": "", + "value": "0x20" + } + ], + "functionName": { + "name": "lt", + "nativeSrc": "17898:2:70", + "nodeType": "YulIdentifier", + "src": "17898:2:70" + }, + "nativeSrc": "17898:20:70", + "nodeType": "YulFunctionCall", + "src": "17898:20:70" + }, + "nativeSrc": "17895:47:70", + "nodeType": "YulIf", + "src": "17895:47:70" + }, + { + "nativeSrc": "17955:41:70", + "nodeType": "YulVariableDeclaration", + "src": "17955:41:70", + "value": { + "arguments": [ + { + "name": "data", + "nativeSrc": "17969:4:70", + "nodeType": "YulIdentifier", + "src": "17969:4:70" + }, + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "17979:1:70", + "nodeType": "YulLiteral", + "src": "17979:1:70", + "type": "", + "value": "5" + }, + { + "arguments": [ + { + "name": "len", + "nativeSrc": "17986:3:70", + "nodeType": "YulIdentifier", + "src": "17986:3:70" + }, + { + "kind": "number", + "nativeSrc": "17991:2:70", + "nodeType": "YulLiteral", + "src": "17991:2:70", + "type": "", + "value": "31" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "17982:3:70", + "nodeType": "YulIdentifier", + "src": "17982:3:70" + }, + "nativeSrc": "17982:12:70", + "nodeType": "YulFunctionCall", + "src": "17982:12:70" + } + ], + "functionName": { + "name": "shr", + "nativeSrc": "17975:3:70", + "nodeType": "YulIdentifier", + "src": "17975:3:70" + }, + "nativeSrc": "17975:20:70", + "nodeType": "YulFunctionCall", + "src": "17975:20:70" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "17965:3:70", + "nodeType": "YulIdentifier", + "src": "17965:3:70" + }, + "nativeSrc": "17965:31:70", + "nodeType": "YulFunctionCall", + "src": "17965:31:70" + }, + "variables": [ + { + "name": "_1", + "nativeSrc": "17959:2:70", + "nodeType": "YulTypedName", + "src": "17959:2:70", + "type": "" + } + ] + }, + { + "nativeSrc": "18009:24:70", + "nodeType": "YulVariableDeclaration", + "src": "18009:24:70", + "value": { + "name": "deleteStart", + "nativeSrc": "18022:11:70", + "nodeType": "YulIdentifier", + "src": "18022:11:70" + }, + "variables": [ + { + "name": "start", + "nativeSrc": "18013:5:70", + "nodeType": "YulTypedName", + "src": "18013:5:70", + "type": "" + } + ] + }, + { + "body": { + "nativeSrc": "18107:20:70", + "nodeType": "YulBlock", + "src": "18107:20:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "name": "start", + "nativeSrc": "18116:5:70", + "nodeType": "YulIdentifier", + "src": "18116:5:70" + }, + { + "kind": "number", + "nativeSrc": "18123:1:70", + "nodeType": "YulLiteral", + "src": "18123:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "sstore", + "nativeSrc": "18109:6:70", + "nodeType": "YulIdentifier", + "src": "18109:6:70" + }, + "nativeSrc": "18109:16:70", + "nodeType": "YulFunctionCall", + "src": "18109:16:70" + }, + "nativeSrc": "18109:16:70", + "nodeType": "YulExpressionStatement", + "src": "18109:16:70" + } + ] + }, + "condition": { + "arguments": [ + { + "name": "start", + "nativeSrc": "18057:5:70", + "nodeType": "YulIdentifier", + "src": "18057:5:70" + }, + { + "name": "_1", + "nativeSrc": "18064:2:70", + "nodeType": "YulIdentifier", + "src": "18064:2:70" + } + ], + "functionName": { + "name": "lt", + "nativeSrc": "18054:2:70", + "nodeType": "YulIdentifier", + "src": "18054:2:70" + }, + "nativeSrc": "18054:13:70", + "nodeType": "YulFunctionCall", + "src": "18054:13:70" + }, + "nativeSrc": "18046:81:70", + "nodeType": "YulForLoop", + "post": { + "nativeSrc": "18068:26:70", + "nodeType": "YulBlock", + "src": "18068:26:70", + "statements": [ + { + "nativeSrc": "18070:22:70", + "nodeType": "YulAssignment", + "src": "18070:22:70", + "value": { + "arguments": [ + { + "name": "start", + "nativeSrc": "18083:5:70", + "nodeType": "YulIdentifier", + "src": "18083:5:70" + }, + { + "kind": "number", + "nativeSrc": "18090:1:70", + "nodeType": "YulLiteral", + "src": "18090:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "18079:3:70", + "nodeType": "YulIdentifier", + "src": "18079:3:70" + }, + "nativeSrc": "18079:13:70", + "nodeType": "YulFunctionCall", + "src": "18079:13:70" + }, + "variableNames": [ + { + "name": "start", + "nativeSrc": "18070:5:70", + "nodeType": "YulIdentifier", + "src": "18070:5:70" + } + ] + } + ] + }, + "pre": { + "nativeSrc": "18050:3:70", + "nodeType": "YulBlock", + "src": "18050:3:70", + "statements": [] + }, + "src": "18046:81:70" + } + ] + }, + "condition": { + "arguments": [ + { + "name": "len", + "nativeSrc": "17722:3:70", + "nodeType": "YulIdentifier", + "src": "17722:3:70" + }, + { + "kind": "number", + "nativeSrc": "17727:2:70", + "nodeType": "YulLiteral", + "src": "17727:2:70", + "type": "", + "value": "31" + } + ], + "functionName": { + "name": "gt", + "nativeSrc": "17719:2:70", + "nodeType": "YulIdentifier", + "src": "17719:2:70" + }, + "nativeSrc": "17719:11:70", + "nodeType": "YulFunctionCall", + "src": "17719:11:70" + }, + "nativeSrc": "17716:421:70", + "nodeType": "YulIf", + "src": "17716:421:70" + } + ] + }, + "name": "clean_up_bytearray_end_slots_string_storage", + "nativeSrc": "17625:518:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "array", + "nativeSrc": "17678:5:70", + "nodeType": "YulTypedName", + "src": "17678:5:70", + "type": "" + }, + { + "name": "len", + "nativeSrc": "17685:3:70", + "nodeType": "YulTypedName", + "src": "17685:3:70", + "type": "" + }, + { + "name": "startIndex", + "nativeSrc": "17690:10:70", + "nodeType": "YulTypedName", + "src": "17690:10:70", + "type": "" + } + ], + "src": "17625:518:70" + }, + { + "body": { + "nativeSrc": "18233:81:70", + "nodeType": "YulBlock", + "src": "18233:81:70", + "statements": [ + { + "nativeSrc": "18243:65:70", + "nodeType": "YulAssignment", + "src": "18243:65:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "data", + "nativeSrc": "18258:4:70", + "nodeType": "YulIdentifier", + "src": "18258:4:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "18276:1:70", + "nodeType": "YulLiteral", + "src": "18276:1:70", + "type": "", + "value": "3" + }, + { + "name": "len", + "nativeSrc": "18279:3:70", + "nodeType": "YulIdentifier", + "src": "18279:3:70" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "18272:3:70", + "nodeType": "YulIdentifier", + "src": "18272:3:70" + }, + "nativeSrc": "18272:11:70", + "nodeType": "YulFunctionCall", + "src": "18272:11:70" + }, + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "18289:1:70", + "nodeType": "YulLiteral", + "src": "18289:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "not", + "nativeSrc": "18285:3:70", + "nodeType": "YulIdentifier", + "src": "18285:3:70" + }, + "nativeSrc": "18285:6:70", + "nodeType": "YulFunctionCall", + "src": "18285:6:70" + } + ], + "functionName": { + "name": "shr", + "nativeSrc": "18268:3:70", + "nodeType": "YulIdentifier", + "src": "18268:3:70" + }, + "nativeSrc": "18268:24:70", + "nodeType": "YulFunctionCall", + "src": "18268:24:70" + } + ], + "functionName": { + "name": "not", + "nativeSrc": "18264:3:70", + "nodeType": "YulIdentifier", + "src": "18264:3:70" + }, + "nativeSrc": "18264:29:70", + "nodeType": "YulFunctionCall", + "src": "18264:29:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "18254:3:70", + "nodeType": "YulIdentifier", + "src": "18254:3:70" + }, + "nativeSrc": "18254:40:70", + "nodeType": "YulFunctionCall", + "src": "18254:40:70" + }, + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "18300:1:70", + "nodeType": "YulLiteral", + "src": "18300:1:70", + "type": "", + "value": "1" + }, + { + "name": "len", + "nativeSrc": "18303:3:70", + "nodeType": "YulIdentifier", + "src": "18303:3:70" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "18296:3:70", + "nodeType": "YulIdentifier", + "src": "18296:3:70" + }, + "nativeSrc": "18296:11:70", + "nodeType": "YulFunctionCall", + "src": "18296:11:70" + } + ], + "functionName": { + "name": "or", + "nativeSrc": "18251:2:70", + "nodeType": "YulIdentifier", + "src": "18251:2:70" + }, + "nativeSrc": "18251:57:70", + "nodeType": "YulFunctionCall", + "src": "18251:57:70" + }, + "variableNames": [ + { + "name": "used", + "nativeSrc": "18243:4:70", + "nodeType": "YulIdentifier", + "src": "18243:4:70" + } + ] + } + ] + }, + "name": "extract_used_part_and_set_length_of_short_byte_array", + "nativeSrc": "18148:166:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "data", + "nativeSrc": "18210:4:70", + "nodeType": "YulTypedName", + "src": "18210:4:70", + "type": "" + }, + { + "name": "len", + "nativeSrc": "18216:3:70", + "nodeType": "YulTypedName", + "src": "18216:3:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "used", + "nativeSrc": "18224:4:70", + "nodeType": "YulTypedName", + "src": "18224:4:70", + "type": "" + } + ], + "src": "18148:166:70" + }, + { + "body": { + "nativeSrc": "18415:1203:70", + "nodeType": "YulBlock", + "src": "18415:1203:70", + "statements": [ + { + "nativeSrc": "18425:24:70", + "nodeType": "YulVariableDeclaration", + "src": "18425:24:70", + "value": { + "arguments": [ + { + "name": "src", + "nativeSrc": "18445:3:70", + "nodeType": "YulIdentifier", + "src": "18445:3:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "18439:5:70", + "nodeType": "YulIdentifier", + "src": "18439:5:70" + }, + "nativeSrc": "18439:10:70", + "nodeType": "YulFunctionCall", + "src": "18439:10:70" + }, + "variables": [ + { + "name": "newLen", + "nativeSrc": "18429:6:70", + "nodeType": "YulTypedName", + "src": "18429:6:70", + "type": "" + } + ] + }, + { + "body": { + "nativeSrc": "18492:22:70", + "nodeType": "YulBlock", + "src": "18492:22:70", + "statements": [ + { + "expression": { + "arguments": [], + "functionName": { + "name": "panic_error_0x41", + "nativeSrc": "18494:16:70", + "nodeType": "YulIdentifier", + "src": "18494:16:70" + }, + "nativeSrc": "18494:18:70", + "nodeType": "YulFunctionCall", + "src": "18494:18:70" + }, + "nativeSrc": "18494:18:70", + "nodeType": "YulExpressionStatement", + "src": "18494:18:70" + } + ] + }, + "condition": { + "arguments": [ + { + "name": "newLen", + "nativeSrc": "18464:6:70", + "nodeType": "YulIdentifier", + "src": "18464:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "18480:2:70", + "nodeType": "YulLiteral", + "src": "18480:2:70", + "type": "", + "value": "64" + }, + { + "kind": "number", + "nativeSrc": "18484:1:70", + "nodeType": "YulLiteral", + "src": "18484:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "18476:3:70", + "nodeType": "YulIdentifier", + "src": "18476:3:70" + }, + "nativeSrc": "18476:10:70", + "nodeType": "YulFunctionCall", + "src": "18476:10:70" + }, + { + "kind": "number", + "nativeSrc": "18488:1:70", + "nodeType": "YulLiteral", + "src": "18488:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "18472:3:70", + "nodeType": "YulIdentifier", + "src": "18472:3:70" + }, + "nativeSrc": "18472:18:70", + "nodeType": "YulFunctionCall", + "src": "18472:18:70" + } + ], + "functionName": { + "name": "gt", + "nativeSrc": "18461:2:70", + "nodeType": "YulIdentifier", + "src": "18461:2:70" + }, + "nativeSrc": "18461:30:70", + "nodeType": "YulFunctionCall", + "src": "18461:30:70" + }, + "nativeSrc": "18458:56:70", + "nodeType": "YulIf", + "src": "18458:56:70" + }, + { + "expression": { + "arguments": [ + { + "name": "slot", + "nativeSrc": "18567:4:70", + "nodeType": "YulIdentifier", + "src": "18567:4:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "name": "slot", + "nativeSrc": "18605:4:70", + "nodeType": "YulIdentifier", + "src": "18605:4:70" + } + ], + "functionName": { + "name": "sload", + "nativeSrc": "18599:5:70", + "nodeType": "YulIdentifier", + "src": "18599:5:70" + }, + "nativeSrc": "18599:11:70", + "nodeType": "YulFunctionCall", + "src": "18599:11:70" + } + ], + "functionName": { + "name": "extract_byte_array_length", + "nativeSrc": "18573:25:70", + "nodeType": "YulIdentifier", + "src": "18573:25:70" + }, + "nativeSrc": "18573:38:70", + "nodeType": "YulFunctionCall", + "src": "18573:38:70" + }, + { + "name": "newLen", + "nativeSrc": "18613:6:70", + "nodeType": "YulIdentifier", + "src": "18613:6:70" + } + ], + "functionName": { + "name": "clean_up_bytearray_end_slots_string_storage", + "nativeSrc": "18523:43:70", + "nodeType": "YulIdentifier", + "src": "18523:43:70" + }, + "nativeSrc": "18523:97:70", + "nodeType": "YulFunctionCall", + "src": "18523:97:70" + }, + "nativeSrc": "18523:97:70", + "nodeType": "YulExpressionStatement", + "src": "18523:97:70" + }, + { + "nativeSrc": "18629:18:70", + "nodeType": "YulVariableDeclaration", + "src": "18629:18:70", + "value": { + "kind": "number", + "nativeSrc": "18646:1:70", + "nodeType": "YulLiteral", + "src": "18646:1:70", + "type": "", + "value": "0" + }, + "variables": [ + { + "name": "srcOffset", + "nativeSrc": "18633:9:70", + "nodeType": "YulTypedName", + "src": "18633:9:70", + "type": "" + } + ] + }, + { + "nativeSrc": "18656:17:70", + "nodeType": "YulAssignment", + "src": "18656:17:70", + "value": { + "kind": "number", + "nativeSrc": "18669:4:70", + "nodeType": "YulLiteral", + "src": "18669:4:70", + "type": "", + "value": "0x20" + }, + "variableNames": [ + { + "name": "srcOffset", + "nativeSrc": "18656:9:70", + "nodeType": "YulIdentifier", + "src": "18656:9:70" + } + ] + }, + { + "cases": [ + { + "body": { + "nativeSrc": "18719:642:70", + "nodeType": "YulBlock", + "src": "18719:642:70", + "statements": [ + { + "nativeSrc": "18733:35:70", + "nodeType": "YulVariableDeclaration", + "src": "18733:35:70", + "value": { + "arguments": [ + { + "name": "newLen", + "nativeSrc": "18752:6:70", + "nodeType": "YulIdentifier", + "src": "18752:6:70" + }, + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "18764:2:70", + "nodeType": "YulLiteral", + "src": "18764:2:70", + "type": "", + "value": "31" + } + ], + "functionName": { + "name": "not", + "nativeSrc": "18760:3:70", + "nodeType": "YulIdentifier", + "src": "18760:3:70" + }, + "nativeSrc": "18760:7:70", + "nodeType": "YulFunctionCall", + "src": "18760:7:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "18748:3:70", + "nodeType": "YulIdentifier", + "src": "18748:3:70" + }, + "nativeSrc": "18748:20:70", + "nodeType": "YulFunctionCall", + "src": "18748:20:70" + }, + "variables": [ + { + "name": "loopEnd", + "nativeSrc": "18737:7:70", + "nodeType": "YulTypedName", + "src": "18737:7:70", + "type": "" + } + ] + }, + { + "nativeSrc": "18781:49:70", + "nodeType": "YulVariableDeclaration", + "src": "18781:49:70", + "value": { + "arguments": [ + { + "name": "slot", + "nativeSrc": "18825:4:70", + "nodeType": "YulIdentifier", + "src": "18825:4:70" + } + ], + "functionName": { + "name": "array_dataslot_string_storage", + "nativeSrc": "18795:29:70", + "nodeType": "YulIdentifier", + "src": "18795:29:70" + }, + "nativeSrc": "18795:35:70", + "nodeType": "YulFunctionCall", + "src": "18795:35:70" + }, + "variables": [ + { + "name": "dstPtr", + "nativeSrc": "18785:6:70", + "nodeType": "YulTypedName", + "src": "18785:6:70", + "type": "" + } + ] + }, + { + "nativeSrc": "18843:10:70", + "nodeType": "YulVariableDeclaration", + "src": "18843:10:70", + "value": { + "kind": "number", + "nativeSrc": "18852:1:70", + "nodeType": "YulLiteral", + "src": "18852:1:70", + "type": "", + "value": "0" + }, + "variables": [ + { + "name": "i", + "nativeSrc": "18847:1:70", + "nodeType": "YulTypedName", + "src": "18847:1:70", + "type": "" + } + ] + }, + { + "body": { + "nativeSrc": "18923:165:70", + "nodeType": "YulBlock", + "src": "18923:165:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "name": "dstPtr", + "nativeSrc": "18948:6:70", + "nodeType": "YulIdentifier", + "src": "18948:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "name": "src", + "nativeSrc": "18966:3:70", + "nodeType": "YulIdentifier", + "src": "18966:3:70" + }, + { + "name": "srcOffset", + "nativeSrc": "18971:9:70", + "nodeType": "YulIdentifier", + "src": "18971:9:70" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "18962:3:70", + "nodeType": "YulIdentifier", + "src": "18962:3:70" + }, + "nativeSrc": "18962:19:70", + "nodeType": "YulFunctionCall", + "src": "18962:19:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "18956:5:70", + "nodeType": "YulIdentifier", + "src": "18956:5:70" + }, + "nativeSrc": "18956:26:70", + "nodeType": "YulFunctionCall", + "src": "18956:26:70" + } + ], + "functionName": { + "name": "sstore", + "nativeSrc": "18941:6:70", + "nodeType": "YulIdentifier", + "src": "18941:6:70" + }, + "nativeSrc": "18941:42:70", + "nodeType": "YulFunctionCall", + "src": "18941:42:70" + }, + "nativeSrc": "18941:42:70", + "nodeType": "YulExpressionStatement", + "src": "18941:42:70" + }, + { + "nativeSrc": "19000:24:70", + "nodeType": "YulAssignment", + "src": "19000:24:70", + "value": { + "arguments": [ + { + "name": "dstPtr", + "nativeSrc": "19014:6:70", + "nodeType": "YulIdentifier", + "src": "19014:6:70" + }, + { + "kind": "number", + "nativeSrc": "19022:1:70", + "nodeType": "YulLiteral", + "src": "19022:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "19010:3:70", + "nodeType": "YulIdentifier", + "src": "19010:3:70" + }, + "nativeSrc": "19010:14:70", + "nodeType": "YulFunctionCall", + "src": "19010:14:70" + }, + "variableNames": [ + { + "name": "dstPtr", + "nativeSrc": "19000:6:70", + "nodeType": "YulIdentifier", + "src": "19000:6:70" + } + ] + }, + { + "nativeSrc": "19041:33:70", + "nodeType": "YulAssignment", + "src": "19041:33:70", + "value": { + "arguments": [ + { + "name": "srcOffset", + "nativeSrc": "19058:9:70", + "nodeType": "YulIdentifier", + "src": "19058:9:70" + }, + { + "kind": "number", + "nativeSrc": "19069:4:70", + "nodeType": "YulLiteral", + "src": "19069:4:70", + "type": "", + "value": "0x20" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "19054:3:70", + "nodeType": "YulIdentifier", + "src": "19054:3:70" + }, + "nativeSrc": "19054:20:70", + "nodeType": "YulFunctionCall", + "src": "19054:20:70" + }, + "variableNames": [ + { + "name": "srcOffset", + "nativeSrc": "19041:9:70", + "nodeType": "YulIdentifier", + "src": "19041:9:70" + } + ] + } + ] + }, + "condition": { + "arguments": [ + { + "name": "i", + "nativeSrc": "18877:1:70", + "nodeType": "YulIdentifier", + "src": "18877:1:70" + }, + { + "name": "loopEnd", + "nativeSrc": "18880:7:70", + "nodeType": "YulIdentifier", + "src": "18880:7:70" + } + ], + "functionName": { + "name": "lt", + "nativeSrc": "18874:2:70", + "nodeType": "YulIdentifier", + "src": "18874:2:70" + }, + "nativeSrc": "18874:14:70", + "nodeType": "YulFunctionCall", + "src": "18874:14:70" + }, + "nativeSrc": "18866:222:70", + "nodeType": "YulForLoop", + "post": { + "nativeSrc": "18889:21:70", + "nodeType": "YulBlock", + "src": "18889:21:70", + "statements": [ + { + "nativeSrc": "18891:17:70", + "nodeType": "YulAssignment", + "src": "18891:17:70", + "value": { + "arguments": [ + { + "name": "i", + "nativeSrc": "18900:1:70", + "nodeType": "YulIdentifier", + "src": "18900:1:70" + }, + { + "kind": "number", + "nativeSrc": "18903:4:70", + "nodeType": "YulLiteral", + "src": "18903:4:70", + "type": "", + "value": "0x20" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "18896:3:70", + "nodeType": "YulIdentifier", + "src": "18896:3:70" + }, + "nativeSrc": "18896:12:70", + "nodeType": "YulFunctionCall", + "src": "18896:12:70" + }, + "variableNames": [ + { + "name": "i", + "nativeSrc": "18891:1:70", + "nodeType": "YulIdentifier", + "src": "18891:1:70" + } + ] + } + ] + }, + "pre": { + "nativeSrc": "18870:3:70", + "nodeType": "YulBlock", + "src": "18870:3:70", + "statements": [] + }, + "src": "18866:222:70" + }, + { + "body": { + "nativeSrc": "19136:166:70", + "nodeType": "YulBlock", + "src": "19136:166:70", + "statements": [ + { + "nativeSrc": "19154:43:70", + "nodeType": "YulVariableDeclaration", + "src": "19154:43:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "src", + "nativeSrc": "19181:3:70", + "nodeType": "YulIdentifier", + "src": "19181:3:70" + }, + { + "name": "srcOffset", + "nativeSrc": "19186:9:70", + "nodeType": "YulIdentifier", + "src": "19186:9:70" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "19177:3:70", + "nodeType": "YulIdentifier", + "src": "19177:3:70" + }, + "nativeSrc": "19177:19:70", + "nodeType": "YulFunctionCall", + "src": "19177:19:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "19171:5:70", + "nodeType": "YulIdentifier", + "src": "19171:5:70" + }, + "nativeSrc": "19171:26:70", + "nodeType": "YulFunctionCall", + "src": "19171:26:70" + }, + "variables": [ + { + "name": "lastValue", + "nativeSrc": "19158:9:70", + "nodeType": "YulTypedName", + "src": "19158:9:70", + "type": "" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "dstPtr", + "nativeSrc": "19221:6:70", + "nodeType": "YulIdentifier", + "src": "19221:6:70" + }, + { + "arguments": [ + { + "name": "lastValue", + "nativeSrc": "19233:9:70", + "nodeType": "YulIdentifier", + "src": "19233:9:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "19260:1:70", + "nodeType": "YulLiteral", + "src": "19260:1:70", + "type": "", + "value": "3" + }, + { + "name": "newLen", + "nativeSrc": "19263:6:70", + "nodeType": "YulIdentifier", + "src": "19263:6:70" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "19256:3:70", + "nodeType": "YulIdentifier", + "src": "19256:3:70" + }, + "nativeSrc": "19256:14:70", + "nodeType": "YulFunctionCall", + "src": "19256:14:70" + }, + { + "kind": "number", + "nativeSrc": "19272:3:70", + "nodeType": "YulLiteral", + "src": "19272:3:70", + "type": "", + "value": "248" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "19252:3:70", + "nodeType": "YulIdentifier", + "src": "19252:3:70" + }, + "nativeSrc": "19252:24:70", + "nodeType": "YulFunctionCall", + "src": "19252:24:70" + }, + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "19282:1:70", + "nodeType": "YulLiteral", + "src": "19282:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "not", + "nativeSrc": "19278:3:70", + "nodeType": "YulIdentifier", + "src": "19278:3:70" + }, + "nativeSrc": "19278:6:70", + "nodeType": "YulFunctionCall", + "src": "19278:6:70" + } + ], + "functionName": { + "name": "shr", + "nativeSrc": "19248:3:70", + "nodeType": "YulIdentifier", + "src": "19248:3:70" + }, + "nativeSrc": "19248:37:70", + "nodeType": "YulFunctionCall", + "src": "19248:37:70" + } + ], + "functionName": { + "name": "not", + "nativeSrc": "19244:3:70", + "nodeType": "YulIdentifier", + "src": "19244:3:70" + }, + "nativeSrc": "19244:42:70", + "nodeType": "YulFunctionCall", + "src": "19244:42:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "19229:3:70", + "nodeType": "YulIdentifier", + "src": "19229:3:70" + }, + "nativeSrc": "19229:58:70", + "nodeType": "YulFunctionCall", + "src": "19229:58:70" + } + ], + "functionName": { + "name": "sstore", + "nativeSrc": "19214:6:70", + "nodeType": "YulIdentifier", + "src": "19214:6:70" + }, + "nativeSrc": "19214:74:70", + "nodeType": "YulFunctionCall", + "src": "19214:74:70" + }, + "nativeSrc": "19214:74:70", + "nodeType": "YulExpressionStatement", + "src": "19214:74:70" + } + ] + }, + "condition": { + "arguments": [ + { + "name": "loopEnd", + "nativeSrc": "19107:7:70", + "nodeType": "YulIdentifier", + "src": "19107:7:70" + }, + { + "name": "newLen", + "nativeSrc": "19116:6:70", + "nodeType": "YulIdentifier", + "src": "19116:6:70" + } + ], + "functionName": { + "name": "lt", + "nativeSrc": "19104:2:70", + "nodeType": "YulIdentifier", + "src": "19104:2:70" + }, + "nativeSrc": "19104:19:70", + "nodeType": "YulFunctionCall", + "src": "19104:19:70" + }, + "nativeSrc": "19101:201:70", + "nodeType": "YulIf", + "src": "19101:201:70" + }, + { + "expression": { + "arguments": [ + { + "name": "slot", + "nativeSrc": "19322:4:70", + "nodeType": "YulIdentifier", + "src": "19322:4:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "19336:1:70", + "nodeType": "YulLiteral", + "src": "19336:1:70", + "type": "", + "value": "1" + }, + { + "name": "newLen", + "nativeSrc": "19339:6:70", + "nodeType": "YulIdentifier", + "src": "19339:6:70" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "19332:3:70", + "nodeType": "YulIdentifier", + "src": "19332:3:70" + }, + "nativeSrc": "19332:14:70", + "nodeType": "YulFunctionCall", + "src": "19332:14:70" + }, + { + "kind": "number", + "nativeSrc": "19348:1:70", + "nodeType": "YulLiteral", + "src": "19348:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "19328:3:70", + "nodeType": "YulIdentifier", + "src": "19328:3:70" + }, + "nativeSrc": "19328:22:70", + "nodeType": "YulFunctionCall", + "src": "19328:22:70" + } + ], + "functionName": { + "name": "sstore", + "nativeSrc": "19315:6:70", + "nodeType": "YulIdentifier", + "src": "19315:6:70" + }, + "nativeSrc": "19315:36:70", + "nodeType": "YulFunctionCall", + "src": "19315:36:70" + }, + "nativeSrc": "19315:36:70", + "nodeType": "YulExpressionStatement", + "src": "19315:36:70" + } + ] + }, + "nativeSrc": "18712:649:70", + "nodeType": "YulCase", + "src": "18712:649:70", + "value": { + "kind": "number", + "nativeSrc": "18717:1:70", + "nodeType": "YulLiteral", + "src": "18717:1:70", + "type": "", + "value": "1" + } + }, + { + "body": { + "nativeSrc": "19378:234:70", + "nodeType": "YulBlock", + "src": "19378:234:70", + "statements": [ + { + "nativeSrc": "19392:14:70", + "nodeType": "YulVariableDeclaration", + "src": "19392:14:70", + "value": { + "kind": "number", + "nativeSrc": "19405:1:70", + "nodeType": "YulLiteral", + "src": "19405:1:70", + "type": "", + "value": "0" + }, + "variables": [ + { + "name": "value", + "nativeSrc": "19396:5:70", + "nodeType": "YulTypedName", + "src": "19396:5:70", + "type": "" + } + ] + }, + { + "body": { + "nativeSrc": "19441:67:70", + "nodeType": "YulBlock", + "src": "19441:67:70", + "statements": [ + { + "nativeSrc": "19459:35:70", + "nodeType": "YulAssignment", + "src": "19459:35:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "src", + "nativeSrc": "19478:3:70", + "nodeType": "YulIdentifier", + "src": "19478:3:70" + }, + { + "name": "srcOffset", + "nativeSrc": "19483:9:70", + "nodeType": "YulIdentifier", + "src": "19483:9:70" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "19474:3:70", + "nodeType": "YulIdentifier", + "src": "19474:3:70" + }, + "nativeSrc": "19474:19:70", + "nodeType": "YulFunctionCall", + "src": "19474:19:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "19468:5:70", + "nodeType": "YulIdentifier", + "src": "19468:5:70" + }, + "nativeSrc": "19468:26:70", + "nodeType": "YulFunctionCall", + "src": "19468:26:70" + }, + "variableNames": [ + { + "name": "value", + "nativeSrc": "19459:5:70", + "nodeType": "YulIdentifier", + "src": "19459:5:70" + } + ] + } + ] + }, + "condition": { + "name": "newLen", + "nativeSrc": "19422:6:70", + "nodeType": "YulIdentifier", + "src": "19422:6:70" + }, + "nativeSrc": "19419:89:70", + "nodeType": "YulIf", + "src": "19419:89:70" + }, + { + "expression": { + "arguments": [ + { + "name": "slot", + "nativeSrc": "19528:4:70", + "nodeType": "YulIdentifier", + "src": "19528:4:70" + }, + { + "arguments": [ + { + "name": "value", + "nativeSrc": "19587:5:70", + "nodeType": "YulIdentifier", + "src": "19587:5:70" + }, + { + "name": "newLen", + "nativeSrc": "19594:6:70", + "nodeType": "YulIdentifier", + "src": "19594:6:70" + } + ], + "functionName": { + "name": "extract_used_part_and_set_length_of_short_byte_array", + "nativeSrc": "19534:52:70", + "nodeType": "YulIdentifier", + "src": "19534:52:70" + }, + "nativeSrc": "19534:67:70", + "nodeType": "YulFunctionCall", + "src": "19534:67:70" + } + ], + "functionName": { + "name": "sstore", + "nativeSrc": "19521:6:70", + "nodeType": "YulIdentifier", + "src": "19521:6:70" + }, + "nativeSrc": "19521:81:70", + "nodeType": "YulFunctionCall", + "src": "19521:81:70" + }, + "nativeSrc": "19521:81:70", + "nodeType": "YulExpressionStatement", + "src": "19521:81:70" + } + ] + }, + "nativeSrc": "19370:242:70", + "nodeType": "YulCase", + "src": "19370:242:70", + "value": "default" + } + ], + "expression": { + "arguments": [ + { + "name": "newLen", + "nativeSrc": "18692:6:70", + "nodeType": "YulIdentifier", + "src": "18692:6:70" + }, + { + "kind": "number", + "nativeSrc": "18700:2:70", + "nodeType": "YulLiteral", + "src": "18700:2:70", + "type": "", + "value": "31" + } + ], + "functionName": { + "name": "gt", + "nativeSrc": "18689:2:70", + "nodeType": "YulIdentifier", + "src": "18689:2:70" + }, + "nativeSrc": "18689:14:70", + "nodeType": "YulFunctionCall", + "src": "18689:14:70" + }, + "nativeSrc": "18682:930:70", + "nodeType": "YulSwitch", + "src": "18682:930:70" + } + ] + }, + "name": "copy_byte_array_to_storage_from_t_string_memory_ptr_to_t_string_storage", + "nativeSrc": "18319:1299:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "slot", + "nativeSrc": "18400:4:70", + "nodeType": "YulTypedName", + "src": "18400:4:70", + "type": "" + }, + { + "name": "src", + "nativeSrc": "18406:3:70", + "nodeType": "YulTypedName", + "src": "18406:3:70", + "type": "" + } + ], + "src": "18319:1299:70" + }, + { + "body": { + "nativeSrc": "19752:259:70", + "nodeType": "YulBlock", + "src": "19752:259:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "19769:9:70", + "nodeType": "YulIdentifier", + "src": "19769:9:70" + }, + { + "kind": "number", + "nativeSrc": "19780:2:70", + "nodeType": "YulLiteral", + "src": "19780:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "19762:6:70", + "nodeType": "YulIdentifier", + "src": "19762:6:70" + }, + "nativeSrc": "19762:21:70", + "nodeType": "YulFunctionCall", + "src": "19762:21:70" + }, + "nativeSrc": "19762:21:70", + "nodeType": "YulExpressionStatement", + "src": "19762:21:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "19803:9:70", + "nodeType": "YulIdentifier", + "src": "19803:9:70" + }, + { + "kind": "number", + "nativeSrc": "19814:2:70", + "nodeType": "YulLiteral", + "src": "19814:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "19799:3:70", + "nodeType": "YulIdentifier", + "src": "19799:3:70" + }, + "nativeSrc": "19799:18:70", + "nodeType": "YulFunctionCall", + "src": "19799:18:70" + }, + { + "name": "value1", + "nativeSrc": "19819:6:70", + "nodeType": "YulIdentifier", + "src": "19819:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "19792:6:70", + "nodeType": "YulIdentifier", + "src": "19792:6:70" + }, + "nativeSrc": "19792:34:70", + "nodeType": "YulFunctionCall", + "src": "19792:34:70" + }, + "nativeSrc": "19792:34:70", + "nodeType": "YulExpressionStatement", + "src": "19792:34:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "19852:9:70", + "nodeType": "YulIdentifier", + "src": "19852:9:70" + }, + { + "kind": "number", + "nativeSrc": "19863:2:70", + "nodeType": "YulLiteral", + "src": "19863:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "19848:3:70", + "nodeType": "YulIdentifier", + "src": "19848:3:70" + }, + "nativeSrc": "19848:18:70", + "nodeType": "YulFunctionCall", + "src": "19848:18:70" + }, + { + "name": "value0", + "nativeSrc": "19868:6:70", + "nodeType": "YulIdentifier", + "src": "19868:6:70" + }, + { + "name": "value1", + "nativeSrc": "19876:6:70", + "nodeType": "YulIdentifier", + "src": "19876:6:70" + } + ], + "functionName": { + "name": "calldatacopy", + "nativeSrc": "19835:12:70", + "nodeType": "YulIdentifier", + "src": "19835:12:70" + }, + "nativeSrc": "19835:48:70", + "nodeType": "YulFunctionCall", + "src": "19835:48:70" + }, + "nativeSrc": "19835:48:70", + "nodeType": "YulExpressionStatement", + "src": "19835:48:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "19907:9:70", + "nodeType": "YulIdentifier", + "src": "19907:9:70" + }, + { + "name": "value1", + "nativeSrc": "19918:6:70", + "nodeType": "YulIdentifier", + "src": "19918:6:70" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "19903:3:70", + "nodeType": "YulIdentifier", + "src": "19903:3:70" + }, + "nativeSrc": "19903:22:70", + "nodeType": "YulFunctionCall", + "src": "19903:22:70" + }, + { + "kind": "number", + "nativeSrc": "19927:2:70", + "nodeType": "YulLiteral", + "src": "19927:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "19899:3:70", + "nodeType": "YulIdentifier", + "src": "19899:3:70" + }, + "nativeSrc": "19899:31:70", + "nodeType": "YulFunctionCall", + "src": "19899:31:70" + }, + { + "kind": "number", + "nativeSrc": "19932:1:70", + "nodeType": "YulLiteral", + "src": "19932:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "19892:6:70", + "nodeType": "YulIdentifier", + "src": "19892:6:70" + }, + "nativeSrc": "19892:42:70", + "nodeType": "YulFunctionCall", + "src": "19892:42:70" + }, + "nativeSrc": "19892:42:70", + "nodeType": "YulExpressionStatement", + "src": "19892:42:70" + }, + { + "nativeSrc": "19943:62:70", + "nodeType": "YulAssignment", + "src": "19943:62:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "19959:9:70", + "nodeType": "YulIdentifier", + "src": "19959:9:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "name": "value1", + "nativeSrc": "19978:6:70", + "nodeType": "YulIdentifier", + "src": "19978:6:70" + }, + { + "kind": "number", + "nativeSrc": "19986:2:70", + "nodeType": "YulLiteral", + "src": "19986:2:70", + "type": "", + "value": "31" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "19974:3:70", + "nodeType": "YulIdentifier", + "src": "19974:3:70" + }, + "nativeSrc": "19974:15:70", + "nodeType": "YulFunctionCall", + "src": "19974:15:70" + }, + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "19995:2:70", + "nodeType": "YulLiteral", + "src": "19995:2:70", + "type": "", + "value": "31" + } + ], + "functionName": { + "name": "not", + "nativeSrc": "19991:3:70", + "nodeType": "YulIdentifier", + "src": "19991:3:70" + }, + "nativeSrc": "19991:7:70", + "nodeType": "YulFunctionCall", + "src": "19991:7:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "19970:3:70", + "nodeType": "YulIdentifier", + "src": "19970:3:70" + }, + "nativeSrc": "19970:29:70", + "nodeType": "YulFunctionCall", + "src": "19970:29:70" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "19955:3:70", + "nodeType": "YulIdentifier", + "src": "19955:3:70" + }, + "nativeSrc": "19955:45:70", + "nodeType": "YulFunctionCall", + "src": "19955:45:70" + }, + { + "kind": "number", + "nativeSrc": "20002:2:70", + "nodeType": "YulLiteral", + "src": "20002:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "19951:3:70", + "nodeType": "YulIdentifier", + "src": "19951:3:70" + }, + "nativeSrc": "19951:54:70", + "nodeType": "YulFunctionCall", + "src": "19951:54:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "19943:4:70", + "nodeType": "YulIdentifier", + "src": "19943:4:70" + } + ] + } + ] + }, + "name": "abi_encode_tuple_t_bytes_calldata_ptr__to_t_bytes_memory_ptr__fromStack_reversed", + "nativeSrc": "19623:388:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "19713:9:70", + "nodeType": "YulTypedName", + "src": "19713:9:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "19724:6:70", + "nodeType": "YulTypedName", + "src": "19724:6:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "19732:6:70", + "nodeType": "YulTypedName", + "src": "19732:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "19743:4:70", + "nodeType": "YulTypedName", + "src": "19743:4:70", + "type": "" + } + ], + "src": "19623:388:70" + }, + { + "body": { + "nativeSrc": "20094:177:70", + "nodeType": "YulBlock", + "src": "20094:177:70", + "statements": [ + { + "body": { + "nativeSrc": "20140:16:70", + "nodeType": "YulBlock", + "src": "20140:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "20149:1:70", + "nodeType": "YulLiteral", + "src": "20149:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "20152:1:70", + "nodeType": "YulLiteral", + "src": "20152:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "20142:6:70", + "nodeType": "YulIdentifier", + "src": "20142:6:70" + }, + "nativeSrc": "20142:12:70", + "nodeType": "YulFunctionCall", + "src": "20142:12:70" + }, + "nativeSrc": "20142:12:70", + "nodeType": "YulExpressionStatement", + "src": "20142:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "dataEnd", + "nativeSrc": "20115:7:70", + "nodeType": "YulIdentifier", + "src": "20115:7:70" + }, + { + "name": "headStart", + "nativeSrc": "20124:9:70", + "nodeType": "YulIdentifier", + "src": "20124:9:70" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "20111:3:70", + "nodeType": "YulIdentifier", + "src": "20111:3:70" + }, + "nativeSrc": "20111:23:70", + "nodeType": "YulFunctionCall", + "src": "20111:23:70" + }, + { + "kind": "number", + "nativeSrc": "20136:2:70", + "nodeType": "YulLiteral", + "src": "20136:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "slt", + "nativeSrc": "20107:3:70", + "nodeType": "YulIdentifier", + "src": "20107:3:70" + }, + "nativeSrc": "20107:32:70", + "nodeType": "YulFunctionCall", + "src": "20107:32:70" + }, + "nativeSrc": "20104:52:70", + "nodeType": "YulIf", + "src": "20104:52:70" + }, + { + "nativeSrc": "20165:36:70", + "nodeType": "YulVariableDeclaration", + "src": "20165:36:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "20191:9:70", + "nodeType": "YulIdentifier", + "src": "20191:9:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "20178:12:70", + "nodeType": "YulIdentifier", + "src": "20178:12:70" + }, + "nativeSrc": "20178:23:70", + "nodeType": "YulFunctionCall", + "src": "20178:23:70" + }, + "variables": [ + { + "name": "value", + "nativeSrc": "20169:5:70", + "nodeType": "YulTypedName", + "src": "20169:5:70", + "type": "" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "value", + "nativeSrc": "20235:5:70", + "nodeType": "YulIdentifier", + "src": "20235:5:70" + } + ], + "functionName": { + "name": "validator_revert_address", + "nativeSrc": "20210:24:70", + "nodeType": "YulIdentifier", + "src": "20210:24:70" + }, + "nativeSrc": "20210:31:70", + "nodeType": "YulFunctionCall", + "src": "20210:31:70" + }, + "nativeSrc": "20210:31:70", + "nodeType": "YulExpressionStatement", + "src": "20210:31:70" + }, + { + "nativeSrc": "20250:15:70", + "nodeType": "YulAssignment", + "src": "20250:15:70", + "value": { + "name": "value", + "nativeSrc": "20260:5:70", + "nodeType": "YulIdentifier", + "src": "20260:5:70" + }, + "variableNames": [ + { + "name": "value0", + "nativeSrc": "20250:6:70", + "nodeType": "YulIdentifier", + "src": "20250:6:70" + } + ] + } + ] + }, + "name": "abi_decode_tuple_t_address_payable", + "nativeSrc": "20016:255:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "20060:9:70", + "nodeType": "YulTypedName", + "src": "20060:9:70", + "type": "" + }, + { + "name": "dataEnd", + "nativeSrc": "20071:7:70", + "nodeType": "YulTypedName", + "src": "20071:7:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value0", + "nativeSrc": "20083:6:70", + "nodeType": "YulTypedName", + "src": "20083:6:70", + "type": "" + } + ], + "src": "20016:255:70" + }, + { + "body": { + "nativeSrc": "20450:171:70", + "nodeType": "YulBlock", + "src": "20450:171:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "20467:9:70", + "nodeType": "YulIdentifier", + "src": "20467:9:70" + }, + { + "kind": "number", + "nativeSrc": "20478:2:70", + "nodeType": "YulLiteral", + "src": "20478:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "20460:6:70", + "nodeType": "YulIdentifier", + "src": "20460:6:70" + }, + "nativeSrc": "20460:21:70", + "nodeType": "YulFunctionCall", + "src": "20460:21:70" + }, + "nativeSrc": "20460:21:70", + "nodeType": "YulExpressionStatement", + "src": "20460:21:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "20501:9:70", + "nodeType": "YulIdentifier", + "src": "20501:9:70" + }, + { + "kind": "number", + "nativeSrc": "20512:2:70", + "nodeType": "YulLiteral", + "src": "20512:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "20497:3:70", + "nodeType": "YulIdentifier", + "src": "20497:3:70" + }, + "nativeSrc": "20497:18:70", + "nodeType": "YulFunctionCall", + "src": "20497:18:70" + }, + { + "kind": "number", + "nativeSrc": "20517:2:70", + "nodeType": "YulLiteral", + "src": "20517:2:70", + "type": "", + "value": "21" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "20490:6:70", + "nodeType": "YulIdentifier", + "src": "20490:6:70" + }, + "nativeSrc": "20490:30:70", + "nodeType": "YulFunctionCall", + "src": "20490:30:70" + }, + "nativeSrc": "20490:30:70", + "nodeType": "YulExpressionStatement", + "src": "20490:30:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "20540:9:70", + "nodeType": "YulIdentifier", + "src": "20540:9:70" + }, + { + "kind": "number", + "nativeSrc": "20551:2:70", + "nodeType": "YulLiteral", + "src": "20551:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "20536:3:70", + "nodeType": "YulIdentifier", + "src": "20536:3:70" + }, + "nativeSrc": "20536:18:70", + "nodeType": "YulFunctionCall", + "src": "20536:18:70" + }, + { + "hexValue": "4549503731323a20556e696e697469616c697a6564", + "kind": "string", + "nativeSrc": "20556:23:70", + "nodeType": "YulLiteral", + "src": "20556:23:70", + "type": "", + "value": "EIP712: Uninitialized" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "20529:6:70", + "nodeType": "YulIdentifier", + "src": "20529:6:70" + }, + "nativeSrc": "20529:51:70", + "nodeType": "YulFunctionCall", + "src": "20529:51:70" + }, + "nativeSrc": "20529:51:70", + "nodeType": "YulExpressionStatement", + "src": "20529:51:70" + }, + { + "nativeSrc": "20589:26:70", + "nodeType": "YulAssignment", + "src": "20589:26:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "20601:9:70", + "nodeType": "YulIdentifier", + "src": "20601:9:70" + }, + { + "kind": "number", + "nativeSrc": "20612:2:70", + "nodeType": "YulLiteral", + "src": "20612:2:70", + "type": "", + "value": "96" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "20597:3:70", + "nodeType": "YulIdentifier", + "src": "20597:3:70" + }, + "nativeSrc": "20597:18:70", + "nodeType": "YulFunctionCall", + "src": "20597:18:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "20589:4:70", + "nodeType": "YulIdentifier", + "src": "20589:4:70" + } + ] + } + ] + }, + "name": "abi_encode_tuple_t_stringliteral_2e5045ff73280aa8e8acd8c82710f23812497f87f7f576e2220a2ddd0d45eade__to_t_string_memory_ptr__fromStack_reversed", + "nativeSrc": "20276:345:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "20427:9:70", + "nodeType": "YulTypedName", + "src": "20427:9:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "20441:4:70", + "nodeType": "YulTypedName", + "src": "20441:4:70", + "type": "" + } + ], + "src": "20276:345:70" + }, + { + "body": { + "nativeSrc": "20658:95:70", + "nodeType": "YulBlock", + "src": "20658:95:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "20675:1:70", + "nodeType": "YulLiteral", + "src": "20675:1:70", + "type": "", + "value": "0" + }, + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "20682:3:70", + "nodeType": "YulLiteral", + "src": "20682:3:70", + "type": "", + "value": "224" + }, + { + "kind": "number", + "nativeSrc": "20687:10:70", + "nodeType": "YulLiteral", + "src": "20687:10:70", + "type": "", + "value": "0x4e487b71" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "20678:3:70", + "nodeType": "YulIdentifier", + "src": "20678:3:70" + }, + "nativeSrc": "20678:20:70", + "nodeType": "YulFunctionCall", + "src": "20678:20:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "20668:6:70", + "nodeType": "YulIdentifier", + "src": "20668:6:70" + }, + "nativeSrc": "20668:31:70", + "nodeType": "YulFunctionCall", + "src": "20668:31:70" + }, + "nativeSrc": "20668:31:70", + "nodeType": "YulExpressionStatement", + "src": "20668:31:70" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "20715:1:70", + "nodeType": "YulLiteral", + "src": "20715:1:70", + "type": "", + "value": "4" + }, + { + "kind": "number", + "nativeSrc": "20718:4:70", + "nodeType": "YulLiteral", + "src": "20718:4:70", + "type": "", + "value": "0x11" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "20708:6:70", + "nodeType": "YulIdentifier", + "src": "20708:6:70" + }, + "nativeSrc": "20708:15:70", + "nodeType": "YulFunctionCall", + "src": "20708:15:70" + }, + "nativeSrc": "20708:15:70", + "nodeType": "YulExpressionStatement", + "src": "20708:15:70" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "20739:1:70", + "nodeType": "YulLiteral", + "src": "20739:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "20742:4:70", + "nodeType": "YulLiteral", + "src": "20742:4:70", + "type": "", + "value": "0x24" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "20732:6:70", + "nodeType": "YulIdentifier", + "src": "20732:6:70" + }, + "nativeSrc": "20732:15:70", + "nodeType": "YulFunctionCall", + "src": "20732:15:70" + }, + "nativeSrc": "20732:15:70", + "nodeType": "YulExpressionStatement", + "src": "20732:15:70" + } + ] + }, + "name": "panic_error_0x11", + "nativeSrc": "20626:127:70", + "nodeType": "YulFunctionDefinition", + "src": "20626:127:70" + }, + { + "body": { + "nativeSrc": "20807:79:70", + "nodeType": "YulBlock", + "src": "20807:79:70", + "statements": [ + { + "nativeSrc": "20817:17:70", + "nodeType": "YulAssignment", + "src": "20817:17:70", + "value": { + "arguments": [ + { + "name": "x", + "nativeSrc": "20829:1:70", + "nodeType": "YulIdentifier", + "src": "20829:1:70" + }, + { + "name": "y", + "nativeSrc": "20832:1:70", + "nodeType": "YulIdentifier", + "src": "20832:1:70" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "20825:3:70", + "nodeType": "YulIdentifier", + "src": "20825:3:70" + }, + "nativeSrc": "20825:9:70", + "nodeType": "YulFunctionCall", + "src": "20825:9:70" + }, + "variableNames": [ + { + "name": "diff", + "nativeSrc": "20817:4:70", + "nodeType": "YulIdentifier", + "src": "20817:4:70" + } + ] + }, + { + "body": { + "nativeSrc": "20858:22:70", + "nodeType": "YulBlock", + "src": "20858:22:70", + "statements": [ + { + "expression": { + "arguments": [], + "functionName": { + "name": "panic_error_0x11", + "nativeSrc": "20860:16:70", + "nodeType": "YulIdentifier", + "src": "20860:16:70" + }, + "nativeSrc": "20860:18:70", + "nodeType": "YulFunctionCall", + "src": "20860:18:70" + }, + "nativeSrc": "20860:18:70", + "nodeType": "YulExpressionStatement", + "src": "20860:18:70" + } + ] + }, + "condition": { + "arguments": [ + { + "name": "diff", + "nativeSrc": "20849:4:70", + "nodeType": "YulIdentifier", + "src": "20849:4:70" + }, + { + "name": "x", + "nativeSrc": "20855:1:70", + "nodeType": "YulIdentifier", + "src": "20855:1:70" + } + ], + "functionName": { + "name": "gt", + "nativeSrc": "20846:2:70", + "nodeType": "YulIdentifier", + "src": "20846:2:70" + }, + "nativeSrc": "20846:11:70", + "nodeType": "YulFunctionCall", + "src": "20846:11:70" + }, + "nativeSrc": "20843:37:70", + "nodeType": "YulIf", + "src": "20843:37:70" + } + ] + }, + "name": "checked_sub_t_uint256", + "nativeSrc": "20758:128:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "x", + "nativeSrc": "20789:1:70", + "nodeType": "YulTypedName", + "src": "20789:1:70", + "type": "" + }, + { + "name": "y", + "nativeSrc": "20792:1:70", + "nodeType": "YulTypedName", + "src": "20792:1:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "diff", + "nativeSrc": "20798:4:70", + "nodeType": "YulTypedName", + "src": "20798:4:70", + "type": "" + } + ], + "src": "20758:128:70" + }, + { + "body": { + "nativeSrc": "21021:201:70", + "nodeType": "YulBlock", + "src": "21021:201:70", + "statements": [ + { + "body": { + "nativeSrc": "21059:16:70", + "nodeType": "YulBlock", + "src": "21059:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "21068:1:70", + "nodeType": "YulLiteral", + "src": "21068:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "21071:1:70", + "nodeType": "YulLiteral", + "src": "21071:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "21061:6:70", + "nodeType": "YulIdentifier", + "src": "21061:6:70" + }, + "nativeSrc": "21061:12:70", + "nodeType": "YulFunctionCall", + "src": "21061:12:70" + }, + "nativeSrc": "21061:12:70", + "nodeType": "YulExpressionStatement", + "src": "21061:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "name": "startIndex", + "nativeSrc": "21037:10:70", + "nodeType": "YulIdentifier", + "src": "21037:10:70" + }, + { + "name": "endIndex", + "nativeSrc": "21049:8:70", + "nodeType": "YulIdentifier", + "src": "21049:8:70" + } + ], + "functionName": { + "name": "gt", + "nativeSrc": "21034:2:70", + "nodeType": "YulIdentifier", + "src": "21034:2:70" + }, + "nativeSrc": "21034:24:70", + "nodeType": "YulFunctionCall", + "src": "21034:24:70" + }, + "nativeSrc": "21031:44:70", + "nodeType": "YulIf", + "src": "21031:44:70" + }, + { + "body": { + "nativeSrc": "21108:16:70", + "nodeType": "YulBlock", + "src": "21108:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "21117:1:70", + "nodeType": "YulLiteral", + "src": "21117:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "21120:1:70", + "nodeType": "YulLiteral", + "src": "21120:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "21110:6:70", + "nodeType": "YulIdentifier", + "src": "21110:6:70" + }, + "nativeSrc": "21110:12:70", + "nodeType": "YulFunctionCall", + "src": "21110:12:70" + }, + "nativeSrc": "21110:12:70", + "nodeType": "YulExpressionStatement", + "src": "21110:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "name": "endIndex", + "nativeSrc": "21090:8:70", + "nodeType": "YulIdentifier", + "src": "21090:8:70" + }, + { + "name": "length", + "nativeSrc": "21100:6:70", + "nodeType": "YulIdentifier", + "src": "21100:6:70" + } + ], + "functionName": { + "name": "gt", + "nativeSrc": "21087:2:70", + "nodeType": "YulIdentifier", + "src": "21087:2:70" + }, + "nativeSrc": "21087:20:70", + "nodeType": "YulFunctionCall", + "src": "21087:20:70" + }, + "nativeSrc": "21084:40:70", + "nodeType": "YulIf", + "src": "21084:40:70" + }, + { + "nativeSrc": "21133:36:70", + "nodeType": "YulAssignment", + "src": "21133:36:70", + "value": { + "arguments": [ + { + "name": "offset", + "nativeSrc": "21150:6:70", + "nodeType": "YulIdentifier", + "src": "21150:6:70" + }, + { + "name": "startIndex", + "nativeSrc": "21158:10:70", + "nodeType": "YulIdentifier", + "src": "21158:10:70" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "21146:3:70", + "nodeType": "YulIdentifier", + "src": "21146:3:70" + }, + "nativeSrc": "21146:23:70", + "nodeType": "YulFunctionCall", + "src": "21146:23:70" + }, + "variableNames": [ + { + "name": "offsetOut", + "nativeSrc": "21133:9:70", + "nodeType": "YulIdentifier", + "src": "21133:9:70" + } + ] + }, + { + "nativeSrc": "21178:38:70", + "nodeType": "YulAssignment", + "src": "21178:38:70", + "value": { + "arguments": [ + { + "name": "endIndex", + "nativeSrc": "21195:8:70", + "nodeType": "YulIdentifier", + "src": "21195:8:70" + }, + { + "name": "startIndex", + "nativeSrc": "21205:10:70", + "nodeType": "YulIdentifier", + "src": "21205:10:70" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "21191:3:70", + "nodeType": "YulIdentifier", + "src": "21191:3:70" + }, + "nativeSrc": "21191:25:70", + "nodeType": "YulFunctionCall", + "src": "21191:25:70" + }, + "variableNames": [ + { + "name": "lengthOut", + "nativeSrc": "21178:9:70", + "nodeType": "YulIdentifier", + "src": "21178:9:70" + } + ] + } + ] + }, + "name": "calldata_array_index_range_access_t_bytes_calldata_ptr", + "nativeSrc": "20891:331:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "offset", + "nativeSrc": "20955:6:70", + "nodeType": "YulTypedName", + "src": "20955:6:70", + "type": "" + }, + { + "name": "length", + "nativeSrc": "20963:6:70", + "nodeType": "YulTypedName", + "src": "20963:6:70", + "type": "" + }, + { + "name": "startIndex", + "nativeSrc": "20971:10:70", + "nodeType": "YulTypedName", + "src": "20971:10:70", + "type": "" + }, + { + "name": "endIndex", + "nativeSrc": "20983:8:70", + "nodeType": "YulTypedName", + "src": "20983:8:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "offsetOut", + "nativeSrc": "20996:9:70", + "nodeType": "YulTypedName", + "src": "20996:9:70", + "type": "" + }, + { + "name": "lengthOut", + "nativeSrc": "21007:9:70", + "nodeType": "YulTypedName", + "src": "21007:9:70", + "type": "" + } + ], + "src": "20891:331:70" + }, + { + "body": { + "nativeSrc": "21259:95:70", + "nodeType": "YulBlock", + "src": "21259:95:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "21276:1:70", + "nodeType": "YulLiteral", + "src": "21276:1:70", + "type": "", + "value": "0" + }, + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "21283:3:70", + "nodeType": "YulLiteral", + "src": "21283:3:70", + "type": "", + "value": "224" + }, + { + "kind": "number", + "nativeSrc": "21288:10:70", + "nodeType": "YulLiteral", + "src": "21288:10:70", + "type": "", + "value": "0x4e487b71" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "21279:3:70", + "nodeType": "YulIdentifier", + "src": "21279:3:70" + }, + "nativeSrc": "21279:20:70", + "nodeType": "YulFunctionCall", + "src": "21279:20:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "21269:6:70", + "nodeType": "YulIdentifier", + "src": "21269:6:70" + }, + "nativeSrc": "21269:31:70", + "nodeType": "YulFunctionCall", + "src": "21269:31:70" + }, + "nativeSrc": "21269:31:70", + "nodeType": "YulExpressionStatement", + "src": "21269:31:70" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "21316:1:70", + "nodeType": "YulLiteral", + "src": "21316:1:70", + "type": "", + "value": "4" + }, + { + "kind": "number", + "nativeSrc": "21319:4:70", + "nodeType": "YulLiteral", + "src": "21319:4:70", + "type": "", + "value": "0x32" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "21309:6:70", + "nodeType": "YulIdentifier", + "src": "21309:6:70" + }, + "nativeSrc": "21309:15:70", + "nodeType": "YulFunctionCall", + "src": "21309:15:70" + }, + "nativeSrc": "21309:15:70", + "nodeType": "YulExpressionStatement", + "src": "21309:15:70" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "21340:1:70", + "nodeType": "YulLiteral", + "src": "21340:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "21343:4:70", + "nodeType": "YulLiteral", + "src": "21343:4:70", + "type": "", + "value": "0x24" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "21333:6:70", + "nodeType": "YulIdentifier", + "src": "21333:6:70" + }, + "nativeSrc": "21333:15:70", + "nodeType": "YulFunctionCall", + "src": "21333:15:70" + }, + "nativeSrc": "21333:15:70", + "nodeType": "YulExpressionStatement", + "src": "21333:15:70" + } + ] + }, + "name": "panic_error_0x32", + "nativeSrc": "21227:127:70", + "nodeType": "YulFunctionDefinition", + "src": "21227:127:70" + }, + { + "body": { + "nativeSrc": "21453:427:70", + "nodeType": "YulBlock", + "src": "21453:427:70", + "statements": [ + { + "nativeSrc": "21463:51:70", + "nodeType": "YulVariableDeclaration", + "src": "21463:51:70", + "value": { + "arguments": [ + { + "name": "ptr_to_tail", + "nativeSrc": "21502:11:70", + "nodeType": "YulIdentifier", + "src": "21502:11:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "21489:12:70", + "nodeType": "YulIdentifier", + "src": "21489:12:70" + }, + "nativeSrc": "21489:25:70", + "nodeType": "YulFunctionCall", + "src": "21489:25:70" + }, + "variables": [ + { + "name": "rel_offset_of_tail", + "nativeSrc": "21467:18:70", + "nodeType": "YulTypedName", + "src": "21467:18:70", + "type": "" + } + ] + }, + { + "body": { + "nativeSrc": "21603:16:70", + "nodeType": "YulBlock", + "src": "21603:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "21612:1:70", + "nodeType": "YulLiteral", + "src": "21612:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "21615:1:70", + "nodeType": "YulLiteral", + "src": "21615:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "21605:6:70", + "nodeType": "YulIdentifier", + "src": "21605:6:70" + }, + "nativeSrc": "21605:12:70", + "nodeType": "YulFunctionCall", + "src": "21605:12:70" + }, + "nativeSrc": "21605:12:70", + "nodeType": "YulExpressionStatement", + "src": "21605:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "rel_offset_of_tail", + "nativeSrc": "21537:18:70", + "nodeType": "YulIdentifier", + "src": "21537:18:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "arguments": [], + "functionName": { + "name": "calldatasize", + "nativeSrc": "21565:12:70", + "nodeType": "YulIdentifier", + "src": "21565:12:70" + }, + "nativeSrc": "21565:14:70", + "nodeType": "YulFunctionCall", + "src": "21565:14:70" + }, + { + "name": "base_ref", + "nativeSrc": "21581:8:70", + "nodeType": "YulIdentifier", + "src": "21581:8:70" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "21561:3:70", + "nodeType": "YulIdentifier", + "src": "21561:3:70" + }, + "nativeSrc": "21561:29:70", + "nodeType": "YulFunctionCall", + "src": "21561:29:70" + }, + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "21596:2:70", + "nodeType": "YulLiteral", + "src": "21596:2:70", + "type": "", + "value": "30" + } + ], + "functionName": { + "name": "not", + "nativeSrc": "21592:3:70", + "nodeType": "YulIdentifier", + "src": "21592:3:70" + }, + "nativeSrc": "21592:7:70", + "nodeType": "YulFunctionCall", + "src": "21592:7:70" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "21557:3:70", + "nodeType": "YulIdentifier", + "src": "21557:3:70" + }, + "nativeSrc": "21557:43:70", + "nodeType": "YulFunctionCall", + "src": "21557:43:70" + } + ], + "functionName": { + "name": "slt", + "nativeSrc": "21533:3:70", + "nodeType": "YulIdentifier", + "src": "21533:3:70" + }, + "nativeSrc": "21533:68:70", + "nodeType": "YulFunctionCall", + "src": "21533:68:70" + } + ], + "functionName": { + "name": "iszero", + "nativeSrc": "21526:6:70", + "nodeType": "YulIdentifier", + "src": "21526:6:70" + }, + "nativeSrc": "21526:76:70", + "nodeType": "YulFunctionCall", + "src": "21526:76:70" + }, + "nativeSrc": "21523:96:70", + "nodeType": "YulIf", + "src": "21523:96:70" + }, + { + "nativeSrc": "21628:47:70", + "nodeType": "YulVariableDeclaration", + "src": "21628:47:70", + "value": { + "arguments": [ + { + "name": "base_ref", + "nativeSrc": "21646:8:70", + "nodeType": "YulIdentifier", + "src": "21646:8:70" + }, + { + "name": "rel_offset_of_tail", + "nativeSrc": "21656:18:70", + "nodeType": "YulIdentifier", + "src": "21656:18:70" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "21642:3:70", + "nodeType": "YulIdentifier", + "src": "21642:3:70" + }, + "nativeSrc": "21642:33:70", + "nodeType": "YulFunctionCall", + "src": "21642:33:70" + }, + "variables": [ + { + "name": "addr_1", + "nativeSrc": "21632:6:70", + "nodeType": "YulTypedName", + "src": "21632:6:70", + "type": "" + } + ] + }, + { + "nativeSrc": "21684:30:70", + "nodeType": "YulAssignment", + "src": "21684:30:70", + "value": { + "arguments": [ + { + "name": "addr_1", + "nativeSrc": "21707:6:70", + "nodeType": "YulIdentifier", + "src": "21707:6:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "21694:12:70", + "nodeType": "YulIdentifier", + "src": "21694:12:70" + }, + "nativeSrc": "21694:20:70", + "nodeType": "YulFunctionCall", + "src": "21694:20:70" + }, + "variableNames": [ + { + "name": "length", + "nativeSrc": "21684:6:70", + "nodeType": "YulIdentifier", + "src": "21684:6:70" + } + ] + }, + { + "body": { + "nativeSrc": "21757:16:70", + "nodeType": "YulBlock", + "src": "21757:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "21766:1:70", + "nodeType": "YulLiteral", + "src": "21766:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "21769:1:70", + "nodeType": "YulLiteral", + "src": "21769:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "21759:6:70", + "nodeType": "YulIdentifier", + "src": "21759:6:70" + }, + "nativeSrc": "21759:12:70", + "nodeType": "YulFunctionCall", + "src": "21759:12:70" + }, + "nativeSrc": "21759:12:70", + "nodeType": "YulExpressionStatement", + "src": "21759:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "name": "length", + "nativeSrc": "21729:6:70", + "nodeType": "YulIdentifier", + "src": "21729:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "21745:2:70", + "nodeType": "YulLiteral", + "src": "21745:2:70", + "type": "", + "value": "64" + }, + { + "kind": "number", + "nativeSrc": "21749:1:70", + "nodeType": "YulLiteral", + "src": "21749:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "21741:3:70", + "nodeType": "YulIdentifier", + "src": "21741:3:70" + }, + "nativeSrc": "21741:10:70", + "nodeType": "YulFunctionCall", + "src": "21741:10:70" + }, + { + "kind": "number", + "nativeSrc": "21753:1:70", + "nodeType": "YulLiteral", + "src": "21753:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "21737:3:70", + "nodeType": "YulIdentifier", + "src": "21737:3:70" + }, + "nativeSrc": "21737:18:70", + "nodeType": "YulFunctionCall", + "src": "21737:18:70" + } + ], + "functionName": { + "name": "gt", + "nativeSrc": "21726:2:70", + "nodeType": "YulIdentifier", + "src": "21726:2:70" + }, + "nativeSrc": "21726:30:70", + "nodeType": "YulFunctionCall", + "src": "21726:30:70" + }, + "nativeSrc": "21723:50:70", + "nodeType": "YulIf", + "src": "21723:50:70" + }, + { + "nativeSrc": "21782:25:70", + "nodeType": "YulAssignment", + "src": "21782:25:70", + "value": { + "arguments": [ + { + "name": "addr_1", + "nativeSrc": "21794:6:70", + "nodeType": "YulIdentifier", + "src": "21794:6:70" + }, + { + "kind": "number", + "nativeSrc": "21802:4:70", + "nodeType": "YulLiteral", + "src": "21802:4:70", + "type": "", + "value": "0x20" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "21790:3:70", + "nodeType": "YulIdentifier", + "src": "21790:3:70" + }, + "nativeSrc": "21790:17:70", + "nodeType": "YulFunctionCall", + "src": "21790:17:70" + }, + "variableNames": [ + { + "name": "addr", + "nativeSrc": "21782:4:70", + "nodeType": "YulIdentifier", + "src": "21782:4:70" + } + ] + }, + { + "body": { + "nativeSrc": "21858:16:70", + "nodeType": "YulBlock", + "src": "21858:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "21867:1:70", + "nodeType": "YulLiteral", + "src": "21867:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "21870:1:70", + "nodeType": "YulLiteral", + "src": "21870:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "21860:6:70", + "nodeType": "YulIdentifier", + "src": "21860:6:70" + }, + "nativeSrc": "21860:12:70", + "nodeType": "YulFunctionCall", + "src": "21860:12:70" + }, + "nativeSrc": "21860:12:70", + "nodeType": "YulExpressionStatement", + "src": "21860:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "name": "addr", + "nativeSrc": "21823:4:70", + "nodeType": "YulIdentifier", + "src": "21823:4:70" + }, + { + "arguments": [ + { + "arguments": [], + "functionName": { + "name": "calldatasize", + "nativeSrc": "21833:12:70", + "nodeType": "YulIdentifier", + "src": "21833:12:70" + }, + "nativeSrc": "21833:14:70", + "nodeType": "YulFunctionCall", + "src": "21833:14:70" + }, + { + "name": "length", + "nativeSrc": "21849:6:70", + "nodeType": "YulIdentifier", + "src": "21849:6:70" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "21829:3:70", + "nodeType": "YulIdentifier", + "src": "21829:3:70" + }, + "nativeSrc": "21829:27:70", + "nodeType": "YulFunctionCall", + "src": "21829:27:70" + } + ], + "functionName": { + "name": "sgt", + "nativeSrc": "21819:3:70", + "nodeType": "YulIdentifier", + "src": "21819:3:70" + }, + "nativeSrc": "21819:38:70", + "nodeType": "YulFunctionCall", + "src": "21819:38:70" + }, + "nativeSrc": "21816:58:70", + "nodeType": "YulIf", + "src": "21816:58:70" + } + ] + }, + "name": "access_calldata_tail_t_bytes_calldata_ptr", + "nativeSrc": "21359:521:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "base_ref", + "nativeSrc": "21410:8:70", + "nodeType": "YulTypedName", + "src": "21410:8:70", + "type": "" + }, + { + "name": "ptr_to_tail", + "nativeSrc": "21420:11:70", + "nodeType": "YulTypedName", + "src": "21420:11:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "addr", + "nativeSrc": "21436:4:70", + "nodeType": "YulTypedName", + "src": "21436:4:70", + "type": "" + }, + { + "name": "length", + "nativeSrc": "21442:6:70", + "nodeType": "YulTypedName", + "src": "21442:6:70", + "type": "" + } + ], + "src": "21359:521:70" + }, + { + "body": { + "nativeSrc": "22078:247:70", + "nodeType": "YulBlock", + "src": "22078:247:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "name": "pos", + "nativeSrc": "22101:3:70", + "nodeType": "YulIdentifier", + "src": "22101:3:70" + }, + { + "name": "value0", + "nativeSrc": "22106:6:70", + "nodeType": "YulIdentifier", + "src": "22106:6:70" + }, + { + "name": "value1", + "nativeSrc": "22114:6:70", + "nodeType": "YulIdentifier", + "src": "22114:6:70" + } + ], + "functionName": { + "name": "calldatacopy", + "nativeSrc": "22088:12:70", + "nodeType": "YulIdentifier", + "src": "22088:12:70" + }, + "nativeSrc": "22088:33:70", + "nodeType": "YulFunctionCall", + "src": "22088:33:70" + }, + "nativeSrc": "22088:33:70", + "nodeType": "YulExpressionStatement", + "src": "22088:33:70" + }, + { + "nativeSrc": "22130:26:70", + "nodeType": "YulVariableDeclaration", + "src": "22130:26:70", + "value": { + "arguments": [ + { + "name": "pos", + "nativeSrc": "22144:3:70", + "nodeType": "YulIdentifier", + "src": "22144:3:70" + }, + { + "name": "value1", + "nativeSrc": "22149:6:70", + "nodeType": "YulIdentifier", + "src": "22149:6:70" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "22140:3:70", + "nodeType": "YulIdentifier", + "src": "22140:3:70" + }, + "nativeSrc": "22140:16:70", + "nodeType": "YulFunctionCall", + "src": "22140:16:70" + }, + "variables": [ + { + "name": "_1", + "nativeSrc": "22134:2:70", + "nodeType": "YulTypedName", + "src": "22134:2:70", + "type": "" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "_1", + "nativeSrc": "22172:2:70", + "nodeType": "YulIdentifier", + "src": "22172:2:70" + }, + { + "kind": "number", + "nativeSrc": "22176:1:70", + "nodeType": "YulLiteral", + "src": "22176:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "22165:6:70", + "nodeType": "YulIdentifier", + "src": "22165:6:70" + }, + "nativeSrc": "22165:13:70", + "nodeType": "YulFunctionCall", + "src": "22165:13:70" + }, + "nativeSrc": "22165:13:70", + "nodeType": "YulExpressionStatement", + "src": "22165:13:70" + }, + { + "nativeSrc": "22187:27:70", + "nodeType": "YulVariableDeclaration", + "src": "22187:27:70", + "value": { + "arguments": [ + { + "name": "value2", + "nativeSrc": "22207:6:70", + "nodeType": "YulIdentifier", + "src": "22207:6:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "22201:5:70", + "nodeType": "YulIdentifier", + "src": "22201:5:70" + }, + "nativeSrc": "22201:13:70", + "nodeType": "YulFunctionCall", + "src": "22201:13:70" + }, + "variables": [ + { + "name": "length", + "nativeSrc": "22191:6:70", + "nodeType": "YulTypedName", + "src": "22191:6:70", + "type": "" + } + ] + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "value2", + "nativeSrc": "22262:6:70", + "nodeType": "YulIdentifier", + "src": "22262:6:70" + }, + { + "kind": "number", + "nativeSrc": "22270:4:70", + "nodeType": "YulLiteral", + "src": "22270:4:70", + "type": "", + "value": "0x20" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "22258:3:70", + "nodeType": "YulIdentifier", + "src": "22258:3:70" + }, + "nativeSrc": "22258:17:70", + "nodeType": "YulFunctionCall", + "src": "22258:17:70" + }, + { + "name": "_1", + "nativeSrc": "22277:2:70", + "nodeType": "YulIdentifier", + "src": "22277:2:70" + }, + { + "name": "length", + "nativeSrc": "22281:6:70", + "nodeType": "YulIdentifier", + "src": "22281:6:70" + } + ], + "functionName": { + "name": "copy_memory_to_memory_with_cleanup", + "nativeSrc": "22223:34:70", + "nodeType": "YulIdentifier", + "src": "22223:34:70" + }, + "nativeSrc": "22223:65:70", + "nodeType": "YulFunctionCall", + "src": "22223:65:70" + }, + "nativeSrc": "22223:65:70", + "nodeType": "YulExpressionStatement", + "src": "22223:65:70" + }, + { + "nativeSrc": "22297:22:70", + "nodeType": "YulAssignment", + "src": "22297:22:70", + "value": { + "arguments": [ + { + "name": "_1", + "nativeSrc": "22308:2:70", + "nodeType": "YulIdentifier", + "src": "22308:2:70" + }, + { + "name": "length", + "nativeSrc": "22312:6:70", + "nodeType": "YulIdentifier", + "src": "22312:6:70" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "22304:3:70", + "nodeType": "YulIdentifier", + "src": "22304:3:70" + }, + "nativeSrc": "22304:15:70", + "nodeType": "YulFunctionCall", + "src": "22304:15:70" + }, + "variableNames": [ + { + "name": "end", + "nativeSrc": "22297:3:70", + "nodeType": "YulIdentifier", + "src": "22297:3:70" + } + ] + } + ] + }, + "name": "abi_encode_tuple_packed_t_bytes_calldata_ptr_t_bytes_memory_ptr__to_t_bytes_memory_ptr_t_bytes_memory_ptr__nonPadded_inplace_fromStack_reversed", + "nativeSrc": "21885:440:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "pos", + "nativeSrc": "22038:3:70", + "nodeType": "YulTypedName", + "src": "22038:3:70", + "type": "" + }, + { + "name": "value2", + "nativeSrc": "22043:6:70", + "nodeType": "YulTypedName", + "src": "22043:6:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "22051:6:70", + "nodeType": "YulTypedName", + "src": "22051:6:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "22059:6:70", + "nodeType": "YulTypedName", + "src": "22059:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "end", + "nativeSrc": "22070:3:70", + "nodeType": "YulTypedName", + "src": "22070:3:70", + "type": "" + } + ], + "src": "21885:440:70" + }, + { + "body": { + "nativeSrc": "22362:95:70", + "nodeType": "YulBlock", + "src": "22362:95:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "22379:1:70", + "nodeType": "YulLiteral", + "src": "22379:1:70", + "type": "", + "value": "0" + }, + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "22386:3:70", + "nodeType": "YulLiteral", + "src": "22386:3:70", + "type": "", + "value": "224" + }, + { + "kind": "number", + "nativeSrc": "22391:10:70", + "nodeType": "YulLiteral", + "src": "22391:10:70", + "type": "", + "value": "0x4e487b71" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "22382:3:70", + "nodeType": "YulIdentifier", + "src": "22382:3:70" + }, + "nativeSrc": "22382:20:70", + "nodeType": "YulFunctionCall", + "src": "22382:20:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "22372:6:70", + "nodeType": "YulIdentifier", + "src": "22372:6:70" + }, + "nativeSrc": "22372:31:70", + "nodeType": "YulFunctionCall", + "src": "22372:31:70" + }, + "nativeSrc": "22372:31:70", + "nodeType": "YulExpressionStatement", + "src": "22372:31:70" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "22419:1:70", + "nodeType": "YulLiteral", + "src": "22419:1:70", + "type": "", + "value": "4" + }, + { + "kind": "number", + "nativeSrc": "22422:4:70", + "nodeType": "YulLiteral", + "src": "22422:4:70", + "type": "", + "value": "0x21" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "22412:6:70", + "nodeType": "YulIdentifier", + "src": "22412:6:70" + }, + "nativeSrc": "22412:15:70", + "nodeType": "YulFunctionCall", + "src": "22412:15:70" + }, + "nativeSrc": "22412:15:70", + "nodeType": "YulExpressionStatement", + "src": "22412:15:70" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "22443:1:70", + "nodeType": "YulLiteral", + "src": "22443:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "22446:4:70", + "nodeType": "YulLiteral", + "src": "22446:4:70", + "type": "", + "value": "0x24" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "22436:6:70", + "nodeType": "YulIdentifier", + "src": "22436:6:70" + }, + "nativeSrc": "22436:15:70", + "nodeType": "YulFunctionCall", + "src": "22436:15:70" + }, + "nativeSrc": "22436:15:70", + "nodeType": "YulExpressionStatement", + "src": "22436:15:70" + } + ] + }, + "name": "panic_error_0x21", + "nativeSrc": "22330:127:70", + "nodeType": "YulFunctionDefinition", + "src": "22330:127:70" + }, + { + "body": { + "nativeSrc": "22516:186:70", + "nodeType": "YulBlock", + "src": "22516:186:70", + "statements": [ + { + "body": { + "nativeSrc": "22558:111:70", + "nodeType": "YulBlock", + "src": "22558:111:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "22579:1:70", + "nodeType": "YulLiteral", + "src": "22579:1:70", + "type": "", + "value": "0" + }, + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "22586:3:70", + "nodeType": "YulLiteral", + "src": "22586:3:70", + "type": "", + "value": "224" + }, + { + "kind": "number", + "nativeSrc": "22591:10:70", + "nodeType": "YulLiteral", + "src": "22591:10:70", + "type": "", + "value": "0x4e487b71" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "22582:3:70", + "nodeType": "YulIdentifier", + "src": "22582:3:70" + }, + "nativeSrc": "22582:20:70", + "nodeType": "YulFunctionCall", + "src": "22582:20:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "22572:6:70", + "nodeType": "YulIdentifier", + "src": "22572:6:70" + }, + "nativeSrc": "22572:31:70", + "nodeType": "YulFunctionCall", + "src": "22572:31:70" + }, + "nativeSrc": "22572:31:70", + "nodeType": "YulExpressionStatement", + "src": "22572:31:70" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "22623:1:70", + "nodeType": "YulLiteral", + "src": "22623:1:70", + "type": "", + "value": "4" + }, + { + "kind": "number", + "nativeSrc": "22626:4:70", + "nodeType": "YulLiteral", + "src": "22626:4:70", + "type": "", + "value": "0x21" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "22616:6:70", + "nodeType": "YulIdentifier", + "src": "22616:6:70" + }, + "nativeSrc": "22616:15:70", + "nodeType": "YulFunctionCall", + "src": "22616:15:70" + }, + "nativeSrc": "22616:15:70", + "nodeType": "YulExpressionStatement", + "src": "22616:15:70" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "22651:1:70", + "nodeType": "YulLiteral", + "src": "22651:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "22654:4:70", + "nodeType": "YulLiteral", + "src": "22654:4:70", + "type": "", + "value": "0x24" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "22644:6:70", + "nodeType": "YulIdentifier", + "src": "22644:6:70" + }, + "nativeSrc": "22644:15:70", + "nodeType": "YulFunctionCall", + "src": "22644:15:70" + }, + "nativeSrc": "22644:15:70", + "nodeType": "YulExpressionStatement", + "src": "22644:15:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "value", + "nativeSrc": "22539:5:70", + "nodeType": "YulIdentifier", + "src": "22539:5:70" + }, + { + "kind": "number", + "nativeSrc": "22546:1:70", + "nodeType": "YulLiteral", + "src": "22546:1:70", + "type": "", + "value": "3" + } + ], + "functionName": { + "name": "lt", + "nativeSrc": "22536:2:70", + "nodeType": "YulIdentifier", + "src": "22536:2:70" + }, + "nativeSrc": "22536:12:70", + "nodeType": "YulFunctionCall", + "src": "22536:12:70" + } + ], + "functionName": { + "name": "iszero", + "nativeSrc": "22529:6:70", + "nodeType": "YulIdentifier", + "src": "22529:6:70" + }, + "nativeSrc": "22529:20:70", + "nodeType": "YulFunctionCall", + "src": "22529:20:70" + }, + "nativeSrc": "22526:143:70", + "nodeType": "YulIf", + "src": "22526:143:70" + }, + { + "expression": { + "arguments": [ + { + "name": "pos", + "nativeSrc": "22685:3:70", + "nodeType": "YulIdentifier", + "src": "22685:3:70" + }, + { + "name": "value", + "nativeSrc": "22690:5:70", + "nodeType": "YulIdentifier", + "src": "22690:5:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "22678:6:70", + "nodeType": "YulIdentifier", + "src": "22678:6:70" + }, + "nativeSrc": "22678:18:70", + "nodeType": "YulFunctionCall", + "src": "22678:18:70" + }, + "nativeSrc": "22678:18:70", + "nodeType": "YulExpressionStatement", + "src": "22678:18:70" + } + ] + }, + "name": "abi_encode_enum_PaymentTypes", + "nativeSrc": "22462:240:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "value", + "nativeSrc": "22500:5:70", + "nodeType": "YulTypedName", + "src": "22500:5:70", + "type": "" + }, + { + "name": "pos", + "nativeSrc": "22507:3:70", + "nodeType": "YulTypedName", + "src": "22507:3:70", + "type": "" + } + ], + "src": "22462:240:70" + }, + { + "body": { + "nativeSrc": "22823:98:70", + "nodeType": "YulBlock", + "src": "22823:98:70", + "statements": [ + { + "nativeSrc": "22833:26:70", + "nodeType": "YulAssignment", + "src": "22833:26:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "22845:9:70", + "nodeType": "YulIdentifier", + "src": "22845:9:70" + }, + { + "kind": "number", + "nativeSrc": "22856:2:70", + "nodeType": "YulLiteral", + "src": "22856:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "22841:3:70", + "nodeType": "YulIdentifier", + "src": "22841:3:70" + }, + "nativeSrc": "22841:18:70", + "nodeType": "YulFunctionCall", + "src": "22841:18:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "22833:4:70", + "nodeType": "YulIdentifier", + "src": "22833:4:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "value0", + "nativeSrc": "22897:6:70", + "nodeType": "YulIdentifier", + "src": "22897:6:70" + }, + { + "name": "headStart", + "nativeSrc": "22905:9:70", + "nodeType": "YulIdentifier", + "src": "22905:9:70" + } + ], + "functionName": { + "name": "abi_encode_enum_PaymentTypes", + "nativeSrc": "22868:28:70", + "nodeType": "YulIdentifier", + "src": "22868:28:70" + }, + "nativeSrc": "22868:47:70", + "nodeType": "YulFunctionCall", + "src": "22868:47:70" + }, + "nativeSrc": "22868:47:70", + "nodeType": "YulExpressionStatement", + "src": "22868:47:70" + } + ] + }, + "name": "abi_encode_tuple_t_enum$_PaymentTypes_$2433__to_t_uint8__fromStack_reversed", + "nativeSrc": "22707:214:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "22792:9:70", + "nodeType": "YulTypedName", + "src": "22792:9:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "22803:6:70", + "nodeType": "YulTypedName", + "src": "22803:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "22814:4:70", + "nodeType": "YulTypedName", + "src": "22814:4:70", + "type": "" + } + ], + "src": "22707:214:70" + }, + { + "body": { + "nativeSrc": "23034:101:70", + "nodeType": "YulBlock", + "src": "23034:101:70", + "statements": [ + { + "nativeSrc": "23044:26:70", + "nodeType": "YulAssignment", + "src": "23044:26:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "23056:9:70", + "nodeType": "YulIdentifier", + "src": "23056:9:70" + }, + { + "kind": "number", + "nativeSrc": "23067:2:70", + "nodeType": "YulLiteral", + "src": "23067:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "23052:3:70", + "nodeType": "YulIdentifier", + "src": "23052:3:70" + }, + "nativeSrc": "23052:18:70", + "nodeType": "YulFunctionCall", + "src": "23052:18:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "23044:4:70", + "nodeType": "YulIdentifier", + "src": "23044:4:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "23086:9:70", + "nodeType": "YulIdentifier", + "src": "23086:9:70" + }, + { + "arguments": [ + { + "name": "value0", + "nativeSrc": "23101:6:70", + "nodeType": "YulIdentifier", + "src": "23101:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "23117:2:70", + "nodeType": "YulLiteral", + "src": "23117:2:70", + "type": "", + "value": "64" + }, + { + "kind": "number", + "nativeSrc": "23121:1:70", + "nodeType": "YulLiteral", + "src": "23121:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "23113:3:70", + "nodeType": "YulIdentifier", + "src": "23113:3:70" + }, + "nativeSrc": "23113:10:70", + "nodeType": "YulFunctionCall", + "src": "23113:10:70" + }, + { + "kind": "number", + "nativeSrc": "23125:1:70", + "nodeType": "YulLiteral", + "src": "23125:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "23109:3:70", + "nodeType": "YulIdentifier", + "src": "23109:3:70" + }, + "nativeSrc": "23109:18:70", + "nodeType": "YulFunctionCall", + "src": "23109:18:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "23097:3:70", + "nodeType": "YulIdentifier", + "src": "23097:3:70" + }, + "nativeSrc": "23097:31:70", + "nodeType": "YulFunctionCall", + "src": "23097:31:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "23079:6:70", + "nodeType": "YulIdentifier", + "src": "23079:6:70" + }, + "nativeSrc": "23079:50:70", + "nodeType": "YulFunctionCall", + "src": "23079:50:70" + }, + "nativeSrc": "23079:50:70", + "nodeType": "YulExpressionStatement", + "src": "23079:50:70" + } + ] + }, + "name": "abi_encode_tuple_t_rational_1_by_1__to_t_uint64__fromStack_reversed", + "nativeSrc": "22926:209:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "23003:9:70", + "nodeType": "YulTypedName", + "src": "23003:9:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "23014:6:70", + "nodeType": "YulTypedName", + "src": "23014:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "23025:4:70", + "nodeType": "YulTypedName", + "src": "23025:4:70", + "type": "" + } + ], + "src": "22926:209:70" + }, + { + "body": { + "nativeSrc": "23227:259:70", + "nodeType": "YulBlock", + "src": "23227:259:70", + "statements": [ + { + "body": { + "nativeSrc": "23273:16:70", + "nodeType": "YulBlock", + "src": "23273:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "23282:1:70", + "nodeType": "YulLiteral", + "src": "23282:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "23285:1:70", + "nodeType": "YulLiteral", + "src": "23285:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "23275:6:70", + "nodeType": "YulIdentifier", + "src": "23275:6:70" + }, + "nativeSrc": "23275:12:70", + "nodeType": "YulFunctionCall", + "src": "23275:12:70" + }, + "nativeSrc": "23275:12:70", + "nodeType": "YulExpressionStatement", + "src": "23275:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "dataEnd", + "nativeSrc": "23248:7:70", + "nodeType": "YulIdentifier", + "src": "23248:7:70" + }, + { + "name": "headStart", + "nativeSrc": "23257:9:70", + "nodeType": "YulIdentifier", + "src": "23257:9:70" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "23244:3:70", + "nodeType": "YulIdentifier", + "src": "23244:3:70" + }, + "nativeSrc": "23244:23:70", + "nodeType": "YulFunctionCall", + "src": "23244:23:70" + }, + { + "kind": "number", + "nativeSrc": "23269:2:70", + "nodeType": "YulLiteral", + "src": "23269:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "slt", + "nativeSrc": "23240:3:70", + "nodeType": "YulIdentifier", + "src": "23240:3:70" + }, + "nativeSrc": "23240:32:70", + "nodeType": "YulFunctionCall", + "src": "23240:32:70" + }, + "nativeSrc": "23237:52:70", + "nodeType": "YulIf", + "src": "23237:52:70" + }, + { + "nativeSrc": "23298:14:70", + "nodeType": "YulVariableDeclaration", + "src": "23298:14:70", + "value": { + "kind": "number", + "nativeSrc": "23311:1:70", + "nodeType": "YulLiteral", + "src": "23311:1:70", + "type": "", + "value": "0" + }, + "variables": [ + { + "name": "value", + "nativeSrc": "23302:5:70", + "nodeType": "YulTypedName", + "src": "23302:5:70", + "type": "" + } + ] + }, + { + "nativeSrc": "23321:32:70", + "nodeType": "YulAssignment", + "src": "23321:32:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "23343:9:70", + "nodeType": "YulIdentifier", + "src": "23343:9:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "23330:12:70", + "nodeType": "YulIdentifier", + "src": "23330:12:70" + }, + "nativeSrc": "23330:23:70", + "nodeType": "YulFunctionCall", + "src": "23330:23:70" + }, + "variableNames": [ + { + "name": "value", + "nativeSrc": "23321:5:70", + "nodeType": "YulIdentifier", + "src": "23321:5:70" + } + ] + }, + { + "nativeSrc": "23362:15:70", + "nodeType": "YulAssignment", + "src": "23362:15:70", + "value": { + "name": "value", + "nativeSrc": "23372:5:70", + "nodeType": "YulIdentifier", + "src": "23372:5:70" + }, + "variableNames": [ + { + "name": "value0", + "nativeSrc": "23362:6:70", + "nodeType": "YulIdentifier", + "src": "23362:6:70" + } + ] + }, + { + "nativeSrc": "23386:16:70", + "nodeType": "YulVariableDeclaration", + "src": "23386:16:70", + "value": { + "kind": "number", + "nativeSrc": "23401:1:70", + "nodeType": "YulLiteral", + "src": "23401:1:70", + "type": "", + "value": "0" + }, + "variables": [ + { + "name": "value_1", + "nativeSrc": "23390:7:70", + "nodeType": "YulTypedName", + "src": "23390:7:70", + "type": "" + } + ] + }, + { + "nativeSrc": "23411:43:70", + "nodeType": "YulAssignment", + "src": "23411:43:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "23439:9:70", + "nodeType": "YulIdentifier", + "src": "23439:9:70" + }, + { + "kind": "number", + "nativeSrc": "23450:2:70", + "nodeType": "YulLiteral", + "src": "23450:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "23435:3:70", + "nodeType": "YulIdentifier", + "src": "23435:3:70" + }, + "nativeSrc": "23435:18:70", + "nodeType": "YulFunctionCall", + "src": "23435:18:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "23422:12:70", + "nodeType": "YulIdentifier", + "src": "23422:12:70" + }, + "nativeSrc": "23422:32:70", + "nodeType": "YulFunctionCall", + "src": "23422:32:70" + }, + "variableNames": [ + { + "name": "value_1", + "nativeSrc": "23411:7:70", + "nodeType": "YulIdentifier", + "src": "23411:7:70" + } + ] + }, + { + "nativeSrc": "23463:17:70", + "nodeType": "YulAssignment", + "src": "23463:17:70", + "value": { + "name": "value_1", + "nativeSrc": "23473:7:70", + "nodeType": "YulIdentifier", + "src": "23473:7:70" + }, + "variableNames": [ + { + "name": "value1", + "nativeSrc": "23463:6:70", + "nodeType": "YulIdentifier", + "src": "23463:6:70" + } + ] + } + ] + }, + "name": "abi_decode_tuple_t_uint256t_uint256", + "nativeSrc": "23140:346:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "23185:9:70", + "nodeType": "YulTypedName", + "src": "23185:9:70", + "type": "" + }, + { + "name": "dataEnd", + "nativeSrc": "23196:7:70", + "nodeType": "YulTypedName", + "src": "23196:7:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value0", + "nativeSrc": "23208:6:70", + "nodeType": "YulTypedName", + "src": "23208:6:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "23216:6:70", + "nodeType": "YulTypedName", + "src": "23216:6:70", + "type": "" + } + ], + "src": "23140:346:70" + }, + { + "body": { + "nativeSrc": "23676:258:70", + "nodeType": "YulBlock", + "src": "23676:258:70", + "statements": [ + { + "nativeSrc": "23686:27:70", + "nodeType": "YulAssignment", + "src": "23686:27:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "23698:9:70", + "nodeType": "YulIdentifier", + "src": "23698:9:70" + }, + { + "kind": "number", + "nativeSrc": "23709:3:70", + "nodeType": "YulLiteral", + "src": "23709:3:70", + "type": "", + "value": "128" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "23694:3:70", + "nodeType": "YulIdentifier", + "src": "23694:3:70" + }, + "nativeSrc": "23694:19:70", + "nodeType": "YulFunctionCall", + "src": "23694:19:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "23686:4:70", + "nodeType": "YulIdentifier", + "src": "23686:4:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "23729:9:70", + "nodeType": "YulIdentifier", + "src": "23729:9:70" + }, + { + "arguments": [ + { + "name": "value0", + "nativeSrc": "23744:6:70", + "nodeType": "YulIdentifier", + "src": "23744:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "23760:3:70", + "nodeType": "YulLiteral", + "src": "23760:3:70", + "type": "", + "value": "160" + }, + { + "kind": "number", + "nativeSrc": "23765:1:70", + "nodeType": "YulLiteral", + "src": "23765:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "23756:3:70", + "nodeType": "YulIdentifier", + "src": "23756:3:70" + }, + "nativeSrc": "23756:11:70", + "nodeType": "YulFunctionCall", + "src": "23756:11:70" + }, + { + "kind": "number", + "nativeSrc": "23769:1:70", + "nodeType": "YulLiteral", + "src": "23769:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "23752:3:70", + "nodeType": "YulIdentifier", + "src": "23752:3:70" + }, + "nativeSrc": "23752:19:70", + "nodeType": "YulFunctionCall", + "src": "23752:19:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "23740:3:70", + "nodeType": "YulIdentifier", + "src": "23740:3:70" + }, + "nativeSrc": "23740:32:70", + "nodeType": "YulFunctionCall", + "src": "23740:32:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "23722:6:70", + "nodeType": "YulIdentifier", + "src": "23722:6:70" + }, + "nativeSrc": "23722:51:70", + "nodeType": "YulFunctionCall", + "src": "23722:51:70" + }, + "nativeSrc": "23722:51:70", + "nodeType": "YulExpressionStatement", + "src": "23722:51:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "23793:9:70", + "nodeType": "YulIdentifier", + "src": "23793:9:70" + }, + { + "kind": "number", + "nativeSrc": "23804:2:70", + "nodeType": "YulLiteral", + "src": "23804:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "23789:3:70", + "nodeType": "YulIdentifier", + "src": "23789:3:70" + }, + "nativeSrc": "23789:18:70", + "nodeType": "YulFunctionCall", + "src": "23789:18:70" + }, + { + "name": "value1", + "nativeSrc": "23809:6:70", + "nodeType": "YulIdentifier", + "src": "23809:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "23782:6:70", + "nodeType": "YulIdentifier", + "src": "23782:6:70" + }, + "nativeSrc": "23782:34:70", + "nodeType": "YulFunctionCall", + "src": "23782:34:70" + }, + "nativeSrc": "23782:34:70", + "nodeType": "YulExpressionStatement", + "src": "23782:34:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "23836:9:70", + "nodeType": "YulIdentifier", + "src": "23836:9:70" + }, + { + "kind": "number", + "nativeSrc": "23847:2:70", + "nodeType": "YulLiteral", + "src": "23847:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "23832:3:70", + "nodeType": "YulIdentifier", + "src": "23832:3:70" + }, + "nativeSrc": "23832:18:70", + "nodeType": "YulFunctionCall", + "src": "23832:18:70" + }, + { + "name": "value2", + "nativeSrc": "23852:6:70", + "nodeType": "YulIdentifier", + "src": "23852:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "23825:6:70", + "nodeType": "YulIdentifier", + "src": "23825:6:70" + }, + "nativeSrc": "23825:34:70", + "nodeType": "YulFunctionCall", + "src": "23825:34:70" + }, + "nativeSrc": "23825:34:70", + "nodeType": "YulExpressionStatement", + "src": "23825:34:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "23879:9:70", + "nodeType": "YulIdentifier", + "src": "23879:9:70" + }, + { + "kind": "number", + "nativeSrc": "23890:2:70", + "nodeType": "YulLiteral", + "src": "23890:2:70", + "type": "", + "value": "96" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "23875:3:70", + "nodeType": "YulIdentifier", + "src": "23875:3:70" + }, + "nativeSrc": "23875:18:70", + "nodeType": "YulFunctionCall", + "src": "23875:18:70" + }, + { + "arguments": [ + { + "name": "value3", + "nativeSrc": "23899:6:70", + "nodeType": "YulIdentifier", + "src": "23899:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "23915:3:70", + "nodeType": "YulLiteral", + "src": "23915:3:70", + "type": "", + "value": "160" + }, + { + "kind": "number", + "nativeSrc": "23920:1:70", + "nodeType": "YulLiteral", + "src": "23920:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "23911:3:70", + "nodeType": "YulIdentifier", + "src": "23911:3:70" + }, + "nativeSrc": "23911:11:70", + "nodeType": "YulFunctionCall", + "src": "23911:11:70" + }, + { + "kind": "number", + "nativeSrc": "23924:1:70", + "nodeType": "YulLiteral", + "src": "23924:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "23907:3:70", + "nodeType": "YulIdentifier", + "src": "23907:3:70" + }, + "nativeSrc": "23907:19:70", + "nodeType": "YulFunctionCall", + "src": "23907:19:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "23895:3:70", + "nodeType": "YulIdentifier", + "src": "23895:3:70" + }, + "nativeSrc": "23895:32:70", + "nodeType": "YulFunctionCall", + "src": "23895:32:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "23868:6:70", + "nodeType": "YulIdentifier", + "src": "23868:6:70" + }, + "nativeSrc": "23868:60:70", + "nodeType": "YulFunctionCall", + "src": "23868:60:70" + }, + "nativeSrc": "23868:60:70", + "nodeType": "YulExpressionStatement", + "src": "23868:60:70" + } + ] + }, + "name": "abi_encode_tuple_t_address_t_uint256_t_uint256_t_address__to_t_address_t_uint256_t_uint256_t_address__fromStack_reversed", + "nativeSrc": "23491:443:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "23621:9:70", + "nodeType": "YulTypedName", + "src": "23621:9:70", + "type": "" + }, + { + "name": "value3", + "nativeSrc": "23632:6:70", + "nodeType": "YulTypedName", + "src": "23632:6:70", + "type": "" + }, + { + "name": "value2", + "nativeSrc": "23640:6:70", + "nodeType": "YulTypedName", + "src": "23640:6:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "23648:6:70", + "nodeType": "YulTypedName", + "src": "23648:6:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "23656:6:70", + "nodeType": "YulTypedName", + "src": "23656:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "23667:4:70", + "nodeType": "YulTypedName", + "src": "23667:4:70", + "type": "" + } + ], + "src": "23491:443:70" + }, + { + "body": { + "nativeSrc": "24077:567:70", + "nodeType": "YulBlock", + "src": "24077:567:70", + "statements": [ + { + "body": { + "nativeSrc": "24124:16:70", + "nodeType": "YulBlock", + "src": "24124:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "24133:1:70", + "nodeType": "YulLiteral", + "src": "24133:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "24136:1:70", + "nodeType": "YulLiteral", + "src": "24136:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "24126:6:70", + "nodeType": "YulIdentifier", + "src": "24126:6:70" + }, + "nativeSrc": "24126:12:70", + "nodeType": "YulFunctionCall", + "src": "24126:12:70" + }, + "nativeSrc": "24126:12:70", + "nodeType": "YulExpressionStatement", + "src": "24126:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "dataEnd", + "nativeSrc": "24098:7:70", + "nodeType": "YulIdentifier", + "src": "24098:7:70" + }, + { + "name": "headStart", + "nativeSrc": "24107:9:70", + "nodeType": "YulIdentifier", + "src": "24107:9:70" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "24094:3:70", + "nodeType": "YulIdentifier", + "src": "24094:3:70" + }, + "nativeSrc": "24094:23:70", + "nodeType": "YulFunctionCall", + "src": "24094:23:70" + }, + { + "kind": "number", + "nativeSrc": "24119:3:70", + "nodeType": "YulLiteral", + "src": "24119:3:70", + "type": "", + "value": "128" + } + ], + "functionName": { + "name": "slt", + "nativeSrc": "24090:3:70", + "nodeType": "YulIdentifier", + "src": "24090:3:70" + }, + "nativeSrc": "24090:33:70", + "nodeType": "YulFunctionCall", + "src": "24090:33:70" + }, + "nativeSrc": "24087:53:70", + "nodeType": "YulIf", + "src": "24087:53:70" + }, + { + "nativeSrc": "24149:14:70", + "nodeType": "YulVariableDeclaration", + "src": "24149:14:70", + "value": { + "kind": "number", + "nativeSrc": "24162:1:70", + "nodeType": "YulLiteral", + "src": "24162:1:70", + "type": "", + "value": "0" + }, + "variables": [ + { + "name": "value", + "nativeSrc": "24153:5:70", + "nodeType": "YulTypedName", + "src": "24153:5:70", + "type": "" + } + ] + }, + { + "nativeSrc": "24172:32:70", + "nodeType": "YulAssignment", + "src": "24172:32:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "24194:9:70", + "nodeType": "YulIdentifier", + "src": "24194:9:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "24181:12:70", + "nodeType": "YulIdentifier", + "src": "24181:12:70" + }, + "nativeSrc": "24181:23:70", + "nodeType": "YulFunctionCall", + "src": "24181:23:70" + }, + "variableNames": [ + { + "name": "value", + "nativeSrc": "24172:5:70", + "nodeType": "YulIdentifier", + "src": "24172:5:70" + } + ] + }, + { + "nativeSrc": "24213:15:70", + "nodeType": "YulAssignment", + "src": "24213:15:70", + "value": { + "name": "value", + "nativeSrc": "24223:5:70", + "nodeType": "YulIdentifier", + "src": "24223:5:70" + }, + "variableNames": [ + { + "name": "value0", + "nativeSrc": "24213:6:70", + "nodeType": "YulIdentifier", + "src": "24213:6:70" + } + ] + }, + { + "nativeSrc": "24237:16:70", + "nodeType": "YulVariableDeclaration", + "src": "24237:16:70", + "value": { + "kind": "number", + "nativeSrc": "24252:1:70", + "nodeType": "YulLiteral", + "src": "24252:1:70", + "type": "", + "value": "0" + }, + "variables": [ + { + "name": "value_1", + "nativeSrc": "24241:7:70", + "nodeType": "YulTypedName", + "src": "24241:7:70", + "type": "" + } + ] + }, + { + "nativeSrc": "24262:43:70", + "nodeType": "YulAssignment", + "src": "24262:43:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "24290:9:70", + "nodeType": "YulIdentifier", + "src": "24290:9:70" + }, + { + "kind": "number", + "nativeSrc": "24301:2:70", + "nodeType": "YulLiteral", + "src": "24301:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "24286:3:70", + "nodeType": "YulIdentifier", + "src": "24286:3:70" + }, + "nativeSrc": "24286:18:70", + "nodeType": "YulFunctionCall", + "src": "24286:18:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "24273:12:70", + "nodeType": "YulIdentifier", + "src": "24273:12:70" + }, + "nativeSrc": "24273:32:70", + "nodeType": "YulFunctionCall", + "src": "24273:32:70" + }, + "variableNames": [ + { + "name": "value_1", + "nativeSrc": "24262:7:70", + "nodeType": "YulIdentifier", + "src": "24262:7:70" + } + ] + }, + { + "nativeSrc": "24314:17:70", + "nodeType": "YulAssignment", + "src": "24314:17:70", + "value": { + "name": "value_1", + "nativeSrc": "24324:7:70", + "nodeType": "YulIdentifier", + "src": "24324:7:70" + }, + "variableNames": [ + { + "name": "value1", + "nativeSrc": "24314:6:70", + "nodeType": "YulIdentifier", + "src": "24314:6:70" + } + ] + }, + { + "nativeSrc": "24340:47:70", + "nodeType": "YulVariableDeclaration", + "src": "24340:47:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "24372:9:70", + "nodeType": "YulIdentifier", + "src": "24372:9:70" + }, + { + "kind": "number", + "nativeSrc": "24383:2:70", + "nodeType": "YulLiteral", + "src": "24383:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "24368:3:70", + "nodeType": "YulIdentifier", + "src": "24368:3:70" + }, + "nativeSrc": "24368:18:70", + "nodeType": "YulFunctionCall", + "src": "24368:18:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "24355:12:70", + "nodeType": "YulIdentifier", + "src": "24355:12:70" + }, + "nativeSrc": "24355:32:70", + "nodeType": "YulFunctionCall", + "src": "24355:32:70" + }, + "variables": [ + { + "name": "value_2", + "nativeSrc": "24344:7:70", + "nodeType": "YulTypedName", + "src": "24344:7:70", + "type": "" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "value_2", + "nativeSrc": "24421:7:70", + "nodeType": "YulIdentifier", + "src": "24421:7:70" + } + ], + "functionName": { + "name": "validator_revert_address", + "nativeSrc": "24396:24:70", + "nodeType": "YulIdentifier", + "src": "24396:24:70" + }, + "nativeSrc": "24396:33:70", + "nodeType": "YulFunctionCall", + "src": "24396:33:70" + }, + "nativeSrc": "24396:33:70", + "nodeType": "YulExpressionStatement", + "src": "24396:33:70" + }, + { + "nativeSrc": "24438:17:70", + "nodeType": "YulAssignment", + "src": "24438:17:70", + "value": { + "name": "value_2", + "nativeSrc": "24448:7:70", + "nodeType": "YulIdentifier", + "src": "24448:7:70" + }, + "variableNames": [ + { + "name": "value2", + "nativeSrc": "24438:6:70", + "nodeType": "YulIdentifier", + "src": "24438:6:70" + } + ] + }, + { + "nativeSrc": "24464:46:70", + "nodeType": "YulVariableDeclaration", + "src": "24464:46:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "24495:9:70", + "nodeType": "YulIdentifier", + "src": "24495:9:70" + }, + { + "kind": "number", + "nativeSrc": "24506:2:70", + "nodeType": "YulLiteral", + "src": "24506:2:70", + "type": "", + "value": "96" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "24491:3:70", + "nodeType": "YulIdentifier", + "src": "24491:3:70" + }, + "nativeSrc": "24491:18:70", + "nodeType": "YulFunctionCall", + "src": "24491:18:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "24478:12:70", + "nodeType": "YulIdentifier", + "src": "24478:12:70" + }, + "nativeSrc": "24478:32:70", + "nodeType": "YulFunctionCall", + "src": "24478:32:70" + }, + "variables": [ + { + "name": "offset", + "nativeSrc": "24468:6:70", + "nodeType": "YulTypedName", + "src": "24468:6:70", + "type": "" + } + ] + }, + { + "body": { + "nativeSrc": "24553:16:70", + "nodeType": "YulBlock", + "src": "24553:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "24562:1:70", + "nodeType": "YulLiteral", + "src": "24562:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "24565:1:70", + "nodeType": "YulLiteral", + "src": "24565:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "24555:6:70", + "nodeType": "YulIdentifier", + "src": "24555:6:70" + }, + "nativeSrc": "24555:12:70", + "nodeType": "YulFunctionCall", + "src": "24555:12:70" + }, + "nativeSrc": "24555:12:70", + "nodeType": "YulExpressionStatement", + "src": "24555:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "name": "offset", + "nativeSrc": "24525:6:70", + "nodeType": "YulIdentifier", + "src": "24525:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "24541:2:70", + "nodeType": "YulLiteral", + "src": "24541:2:70", + "type": "", + "value": "64" + }, + { + "kind": "number", + "nativeSrc": "24545:1:70", + "nodeType": "YulLiteral", + "src": "24545:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "24537:3:70", + "nodeType": "YulIdentifier", + "src": "24537:3:70" + }, + "nativeSrc": "24537:10:70", + "nodeType": "YulFunctionCall", + "src": "24537:10:70" + }, + { + "kind": "number", + "nativeSrc": "24549:1:70", + "nodeType": "YulLiteral", + "src": "24549:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "24533:3:70", + "nodeType": "YulIdentifier", + "src": "24533:3:70" + }, + "nativeSrc": "24533:18:70", + "nodeType": "YulFunctionCall", + "src": "24533:18:70" + } + ], + "functionName": { + "name": "gt", + "nativeSrc": "24522:2:70", + "nodeType": "YulIdentifier", + "src": "24522:2:70" + }, + "nativeSrc": "24522:30:70", + "nodeType": "YulFunctionCall", + "src": "24522:30:70" + }, + "nativeSrc": "24519:50:70", + "nodeType": "YulIf", + "src": "24519:50:70" + }, + { + "nativeSrc": "24578:60:70", + "nodeType": "YulAssignment", + "src": "24578:60:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "24610:9:70", + "nodeType": "YulIdentifier", + "src": "24610:9:70" + }, + { + "name": "offset", + "nativeSrc": "24621:6:70", + "nodeType": "YulIdentifier", + "src": "24621:6:70" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "24606:3:70", + "nodeType": "YulIdentifier", + "src": "24606:3:70" + }, + "nativeSrc": "24606:22:70", + "nodeType": "YulFunctionCall", + "src": "24606:22:70" + }, + { + "name": "dataEnd", + "nativeSrc": "24630:7:70", + "nodeType": "YulIdentifier", + "src": "24630:7:70" + } + ], + "functionName": { + "name": "abi_decode_string", + "nativeSrc": "24588:17:70", + "nodeType": "YulIdentifier", + "src": "24588:17:70" + }, + "nativeSrc": "24588:50:70", + "nodeType": "YulFunctionCall", + "src": "24588:50:70" + }, + "variableNames": [ + { + "name": "value3", + "nativeSrc": "24578:6:70", + "nodeType": "YulIdentifier", + "src": "24578:6:70" + } + ] + } + ] + }, + "name": "abi_decode_tuple_t_bytes32t_uint256t_address_payablet_bytes_memory_ptr", + "nativeSrc": "23939:705:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "24019:9:70", + "nodeType": "YulTypedName", + "src": "24019:9:70", + "type": "" + }, + { + "name": "dataEnd", + "nativeSrc": "24030:7:70", + "nodeType": "YulTypedName", + "src": "24030:7:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value0", + "nativeSrc": "24042:6:70", + "nodeType": "YulTypedName", + "src": "24042:6:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "24050:6:70", + "nodeType": "YulTypedName", + "src": "24050:6:70", + "type": "" + }, + { + "name": "value2", + "nativeSrc": "24058:6:70", + "nodeType": "YulTypedName", + "src": "24058:6:70", + "type": "" + }, + { + "name": "value3", + "nativeSrc": "24066:6:70", + "nodeType": "YulTypedName", + "src": "24066:6:70", + "type": "" + } + ], + "src": "23939:705:70" + }, + { + "body": { + "nativeSrc": "24708:77:70", + "nodeType": "YulBlock", + "src": "24708:77:70", + "statements": [ + { + "nativeSrc": "24718:22:70", + "nodeType": "YulAssignment", + "src": "24718:22:70", + "value": { + "arguments": [ + { + "name": "offset", + "nativeSrc": "24733:6:70", + "nodeType": "YulIdentifier", + "src": "24733:6:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "24727:5:70", + "nodeType": "YulIdentifier", + "src": "24727:5:70" + }, + "nativeSrc": "24727:13:70", + "nodeType": "YulFunctionCall", + "src": "24727:13:70" + }, + "variableNames": [ + { + "name": "value", + "nativeSrc": "24718:5:70", + "nodeType": "YulIdentifier", + "src": "24718:5:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "value", + "nativeSrc": "24773:5:70", + "nodeType": "YulIdentifier", + "src": "24773:5:70" + } + ], + "functionName": { + "name": "validator_revert_uint32", + "nativeSrc": "24749:23:70", + "nodeType": "YulIdentifier", + "src": "24749:23:70" + }, + "nativeSrc": "24749:30:70", + "nodeType": "YulFunctionCall", + "src": "24749:30:70" + }, + "nativeSrc": "24749:30:70", + "nodeType": "YulExpressionStatement", + "src": "24749:30:70" + } + ] + }, + "name": "abi_decode_uint32_fromMemory", + "nativeSrc": "24649:136:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "offset", + "nativeSrc": "24687:6:70", + "nodeType": "YulTypedName", + "src": "24687:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value", + "nativeSrc": "24698:5:70", + "nodeType": "YulTypedName", + "src": "24698:5:70", + "type": "" + } + ], + "src": "24649:136:70" + }, + { + "body": { + "nativeSrc": "24834:85:70", + "nodeType": "YulBlock", + "src": "24834:85:70", + "statements": [ + { + "body": { + "nativeSrc": "24897:16:70", + "nodeType": "YulBlock", + "src": "24897:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "24906:1:70", + "nodeType": "YulLiteral", + "src": "24906:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "24909:1:70", + "nodeType": "YulLiteral", + "src": "24909:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "24899:6:70", + "nodeType": "YulIdentifier", + "src": "24899:6:70" + }, + "nativeSrc": "24899:12:70", + "nodeType": "YulFunctionCall", + "src": "24899:12:70" + }, + "nativeSrc": "24899:12:70", + "nodeType": "YulExpressionStatement", + "src": "24899:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "value", + "nativeSrc": "24857:5:70", + "nodeType": "YulIdentifier", + "src": "24857:5:70" + }, + { + "arguments": [ + { + "name": "value", + "nativeSrc": "24868:5:70", + "nodeType": "YulIdentifier", + "src": "24868:5:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "24883:2:70", + "nodeType": "YulLiteral", + "src": "24883:2:70", + "type": "", + "value": "64" + }, + { + "kind": "number", + "nativeSrc": "24887:1:70", + "nodeType": "YulLiteral", + "src": "24887:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "24879:3:70", + "nodeType": "YulIdentifier", + "src": "24879:3:70" + }, + "nativeSrc": "24879:10:70", + "nodeType": "YulFunctionCall", + "src": "24879:10:70" + }, + { + "kind": "number", + "nativeSrc": "24891:1:70", + "nodeType": "YulLiteral", + "src": "24891:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "24875:3:70", + "nodeType": "YulIdentifier", + "src": "24875:3:70" + }, + "nativeSrc": "24875:18:70", + "nodeType": "YulFunctionCall", + "src": "24875:18:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "24864:3:70", + "nodeType": "YulIdentifier", + "src": "24864:3:70" + }, + "nativeSrc": "24864:30:70", + "nodeType": "YulFunctionCall", + "src": "24864:30:70" + } + ], + "functionName": { + "name": "eq", + "nativeSrc": "24854:2:70", + "nodeType": "YulIdentifier", + "src": "24854:2:70" + }, + "nativeSrc": "24854:41:70", + "nodeType": "YulFunctionCall", + "src": "24854:41:70" + } + ], + "functionName": { + "name": "iszero", + "nativeSrc": "24847:6:70", + "nodeType": "YulIdentifier", + "src": "24847:6:70" + }, + "nativeSrc": "24847:49:70", + "nodeType": "YulFunctionCall", + "src": "24847:49:70" + }, + "nativeSrc": "24844:69:70", + "nodeType": "YulIf", + "src": "24844:69:70" + } + ] + }, + "name": "validator_revert_uint64", + "nativeSrc": "24790:129:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "value", + "nativeSrc": "24823:5:70", + "nodeType": "YulTypedName", + "src": "24823:5:70", + "type": "" + } + ], + "src": "24790:129:70" + }, + { + "body": { + "nativeSrc": "24983:77:70", + "nodeType": "YulBlock", + "src": "24983:77:70", + "statements": [ + { + "nativeSrc": "24993:22:70", + "nodeType": "YulAssignment", + "src": "24993:22:70", + "value": { + "arguments": [ + { + "name": "offset", + "nativeSrc": "25008:6:70", + "nodeType": "YulIdentifier", + "src": "25008:6:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "25002:5:70", + "nodeType": "YulIdentifier", + "src": "25002:5:70" + }, + "nativeSrc": "25002:13:70", + "nodeType": "YulFunctionCall", + "src": "25002:13:70" + }, + "variableNames": [ + { + "name": "value", + "nativeSrc": "24993:5:70", + "nodeType": "YulIdentifier", + "src": "24993:5:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "value", + "nativeSrc": "25048:5:70", + "nodeType": "YulIdentifier", + "src": "25048:5:70" + } + ], + "functionName": { + "name": "validator_revert_uint64", + "nativeSrc": "25024:23:70", + "nodeType": "YulIdentifier", + "src": "25024:23:70" + }, + "nativeSrc": "25024:30:70", + "nodeType": "YulFunctionCall", + "src": "25024:30:70" + }, + "nativeSrc": "25024:30:70", + "nodeType": "YulExpressionStatement", + "src": "25024:30:70" + } + ] + }, + "name": "abi_decode_uint64_fromMemory", + "nativeSrc": "24924:136:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "offset", + "nativeSrc": "24962:6:70", + "nodeType": "YulTypedName", + "src": "24962:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value", + "nativeSrc": "24973:5:70", + "nodeType": "YulTypedName", + "src": "24973:5:70", + "type": "" + } + ], + "src": "24924:136:70" + }, + { + "body": { + "nativeSrc": "25173:1128:70", + "nodeType": "YulBlock", + "src": "25173:1128:70", + "statements": [ + { + "nativeSrc": "25183:43:70", + "nodeType": "YulVariableDeclaration", + "src": "25183:43:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "dataEnd", + "nativeSrc": "25201:7:70", + "nodeType": "YulIdentifier", + "src": "25201:7:70" + }, + { + "name": "headStart", + "nativeSrc": "25210:9:70", + "nodeType": "YulIdentifier", + "src": "25210:9:70" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "25197:3:70", + "nodeType": "YulIdentifier", + "src": "25197:3:70" + }, + "nativeSrc": "25197:23:70", + "nodeType": "YulFunctionCall", + "src": "25197:23:70" + }, + { + "kind": "number", + "nativeSrc": "25222:3:70", + "nodeType": "YulLiteral", + "src": "25222:3:70", + "type": "", + "value": "320" + } + ], + "functionName": { + "name": "slt", + "nativeSrc": "25193:3:70", + "nodeType": "YulIdentifier", + "src": "25193:3:70" + }, + "nativeSrc": "25193:33:70", + "nodeType": "YulFunctionCall", + "src": "25193:33:70" + }, + "variables": [ + { + "name": "_1", + "nativeSrc": "25187:2:70", + "nodeType": "YulTypedName", + "src": "25187:2:70", + "type": "" + } + ] + }, + { + "body": { + "nativeSrc": "25241:16:70", + "nodeType": "YulBlock", + "src": "25241:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "25250:1:70", + "nodeType": "YulLiteral", + "src": "25250:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "25253:1:70", + "nodeType": "YulLiteral", + "src": "25253:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "25243:6:70", + "nodeType": "YulIdentifier", + "src": "25243:6:70" + }, + "nativeSrc": "25243:12:70", + "nodeType": "YulFunctionCall", + "src": "25243:12:70" + }, + "nativeSrc": "25243:12:70", + "nodeType": "YulExpressionStatement", + "src": "25243:12:70" + } + ] + }, + "condition": { + "name": "_1", + "nativeSrc": "25238:2:70", + "nodeType": "YulIdentifier", + "src": "25238:2:70" + }, + "nativeSrc": "25235:22:70", + "nodeType": "YulIf", + "src": "25235:22:70" + }, + { + "nativeSrc": "25266:7:70", + "nodeType": "YulAssignment", + "src": "25266:7:70", + "value": { + "kind": "number", + "nativeSrc": "25272:1:70", + "nodeType": "YulLiteral", + "src": "25272:1:70", + "type": "", + "value": "0" + }, + "variableNames": [ + { + "name": "_1", + "nativeSrc": "25266:2:70", + "nodeType": "YulIdentifier", + "src": "25266:2:70" + } + ] + }, + { + "nativeSrc": "25282:35:70", + "nodeType": "YulVariableDeclaration", + "src": "25282:35:70", + "value": { + "arguments": [], + "functionName": { + "name": "allocate_memory_4297", + "nativeSrc": "25295:20:70", + "nodeType": "YulIdentifier", + "src": "25295:20:70" + }, + "nativeSrc": "25295:22:70", + "nodeType": "YulFunctionCall", + "src": "25295:22:70" + }, + "variables": [ + { + "name": "value", + "nativeSrc": "25286:5:70", + "nodeType": "YulTypedName", + "src": "25286:5:70", + "type": "" + } + ] + }, + { + "nativeSrc": "25326:17:70", + "nodeType": "YulVariableDeclaration", + "src": "25326:17:70", + "value": { + "name": "_1", + "nativeSrc": "25341:2:70", + "nodeType": "YulIdentifier", + "src": "25341:2:70" + }, + "variables": [ + { + "name": "value_1", + "nativeSrc": "25330:7:70", + "nodeType": "YulTypedName", + "src": "25330:7:70", + "type": "" + } + ] + }, + { + "nativeSrc": "25352:27:70", + "nodeType": "YulAssignment", + "src": "25352:27:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "25369:9:70", + "nodeType": "YulIdentifier", + "src": "25369:9:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "25363:5:70", + "nodeType": "YulIdentifier", + "src": "25363:5:70" + }, + "nativeSrc": "25363:16:70", + "nodeType": "YulFunctionCall", + "src": "25363:16:70" + }, + "variableNames": [ + { + "name": "value_1", + "nativeSrc": "25352:7:70", + "nodeType": "YulIdentifier", + "src": "25352:7:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "value", + "nativeSrc": "25395:5:70", + "nodeType": "YulIdentifier", + "src": "25395:5:70" + }, + { + "name": "value_1", + "nativeSrc": "25402:7:70", + "nodeType": "YulIdentifier", + "src": "25402:7:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "25388:6:70", + "nodeType": "YulIdentifier", + "src": "25388:6:70" + }, + "nativeSrc": "25388:22:70", + "nodeType": "YulFunctionCall", + "src": "25388:22:70" + }, + "nativeSrc": "25388:22:70", + "nodeType": "YulExpressionStatement", + "src": "25388:22:70" + }, + { + "nativeSrc": "25419:17:70", + "nodeType": "YulVariableDeclaration", + "src": "25419:17:70", + "value": { + "name": "_1", + "nativeSrc": "25434:2:70", + "nodeType": "YulIdentifier", + "src": "25434:2:70" + }, + "variables": [ + { + "name": "value_2", + "nativeSrc": "25423:7:70", + "nodeType": "YulTypedName", + "src": "25423:7:70", + "type": "" + } + ] + }, + { + "nativeSrc": "25445:36:70", + "nodeType": "YulAssignment", + "src": "25445:36:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "25466:9:70", + "nodeType": "YulIdentifier", + "src": "25466:9:70" + }, + { + "kind": "number", + "nativeSrc": "25477:2:70", + "nodeType": "YulLiteral", + "src": "25477:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "25462:3:70", + "nodeType": "YulIdentifier", + "src": "25462:3:70" + }, + "nativeSrc": "25462:18:70", + "nodeType": "YulFunctionCall", + "src": "25462:18:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "25456:5:70", + "nodeType": "YulIdentifier", + "src": "25456:5:70" + }, + "nativeSrc": "25456:25:70", + "nodeType": "YulFunctionCall", + "src": "25456:25:70" + }, + "variableNames": [ + { + "name": "value_2", + "nativeSrc": "25445:7:70", + "nodeType": "YulIdentifier", + "src": "25445:7:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "value", + "nativeSrc": "25501:5:70", + "nodeType": "YulIdentifier", + "src": "25501:5:70" + }, + { + "kind": "number", + "nativeSrc": "25508:2:70", + "nodeType": "YulLiteral", + "src": "25508:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "25497:3:70", + "nodeType": "YulIdentifier", + "src": "25497:3:70" + }, + "nativeSrc": "25497:14:70", + "nodeType": "YulFunctionCall", + "src": "25497:14:70" + }, + { + "name": "value_2", + "nativeSrc": "25513:7:70", + "nodeType": "YulIdentifier", + "src": "25513:7:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "25490:6:70", + "nodeType": "YulIdentifier", + "src": "25490:6:70" + }, + "nativeSrc": "25490:31:70", + "nodeType": "YulFunctionCall", + "src": "25490:31:70" + }, + "nativeSrc": "25490:31:70", + "nodeType": "YulExpressionStatement", + "src": "25490:31:70" + }, + { + "nativeSrc": "25530:17:70", + "nodeType": "YulVariableDeclaration", + "src": "25530:17:70", + "value": { + "name": "_1", + "nativeSrc": "25545:2:70", + "nodeType": "YulIdentifier", + "src": "25545:2:70" + }, + "variables": [ + { + "name": "value_3", + "nativeSrc": "25534:7:70", + "nodeType": "YulTypedName", + "src": "25534:7:70", + "type": "" + } + ] + }, + { + "nativeSrc": "25556:36:70", + "nodeType": "YulAssignment", + "src": "25556:36:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "25577:9:70", + "nodeType": "YulIdentifier", + "src": "25577:9:70" + }, + { + "kind": "number", + "nativeSrc": "25588:2:70", + "nodeType": "YulLiteral", + "src": "25588:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "25573:3:70", + "nodeType": "YulIdentifier", + "src": "25573:3:70" + }, + "nativeSrc": "25573:18:70", + "nodeType": "YulFunctionCall", + "src": "25573:18:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "25567:5:70", + "nodeType": "YulIdentifier", + "src": "25567:5:70" + }, + "nativeSrc": "25567:25:70", + "nodeType": "YulFunctionCall", + "src": "25567:25:70" + }, + "variableNames": [ + { + "name": "value_3", + "nativeSrc": "25556:7:70", + "nodeType": "YulIdentifier", + "src": "25556:7:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "value", + "nativeSrc": "25612:5:70", + "nodeType": "YulIdentifier", + "src": "25612:5:70" + }, + { + "kind": "number", + "nativeSrc": "25619:2:70", + "nodeType": "YulLiteral", + "src": "25619:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "25608:3:70", + "nodeType": "YulIdentifier", + "src": "25608:3:70" + }, + "nativeSrc": "25608:14:70", + "nodeType": "YulFunctionCall", + "src": "25608:14:70" + }, + { + "name": "value_3", + "nativeSrc": "25624:7:70", + "nodeType": "YulIdentifier", + "src": "25624:7:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "25601:6:70", + "nodeType": "YulIdentifier", + "src": "25601:6:70" + }, + "nativeSrc": "25601:31:70", + "nodeType": "YulFunctionCall", + "src": "25601:31:70" + }, + "nativeSrc": "25601:31:70", + "nodeType": "YulExpressionStatement", + "src": "25601:31:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "value", + "nativeSrc": "25652:5:70", + "nodeType": "YulIdentifier", + "src": "25652:5:70" + }, + { + "kind": "number", + "nativeSrc": "25659:2:70", + "nodeType": "YulLiteral", + "src": "25659:2:70", + "type": "", + "value": "96" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "25648:3:70", + "nodeType": "YulIdentifier", + "src": "25648:3:70" + }, + "nativeSrc": "25648:14:70", + "nodeType": "YulFunctionCall", + "src": "25648:14:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "25697:9:70", + "nodeType": "YulIdentifier", + "src": "25697:9:70" + }, + { + "kind": "number", + "nativeSrc": "25708:2:70", + "nodeType": "YulLiteral", + "src": "25708:2:70", + "type": "", + "value": "96" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "25693:3:70", + "nodeType": "YulIdentifier", + "src": "25693:3:70" + }, + "nativeSrc": "25693:18:70", + "nodeType": "YulFunctionCall", + "src": "25693:18:70" + } + ], + "functionName": { + "name": "abi_decode_uint32_fromMemory", + "nativeSrc": "25664:28:70", + "nodeType": "YulIdentifier", + "src": "25664:28:70" + }, + "nativeSrc": "25664:48:70", + "nodeType": "YulFunctionCall", + "src": "25664:48:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "25641:6:70", + "nodeType": "YulIdentifier", + "src": "25641:6:70" + }, + "nativeSrc": "25641:72:70", + "nodeType": "YulFunctionCall", + "src": "25641:72:70" + }, + "nativeSrc": "25641:72:70", + "nodeType": "YulExpressionStatement", + "src": "25641:72:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "value", + "nativeSrc": "25733:5:70", + "nodeType": "YulIdentifier", + "src": "25733:5:70" + }, + { + "kind": "number", + "nativeSrc": "25740:3:70", + "nodeType": "YulLiteral", + "src": "25740:3:70", + "type": "", + "value": "128" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "25729:3:70", + "nodeType": "YulIdentifier", + "src": "25729:3:70" + }, + "nativeSrc": "25729:15:70", + "nodeType": "YulFunctionCall", + "src": "25729:15:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "25779:9:70", + "nodeType": "YulIdentifier", + "src": "25779:9:70" + }, + { + "kind": "number", + "nativeSrc": "25790:3:70", + "nodeType": "YulLiteral", + "src": "25790:3:70", + "type": "", + "value": "128" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "25775:3:70", + "nodeType": "YulIdentifier", + "src": "25775:3:70" + }, + "nativeSrc": "25775:19:70", + "nodeType": "YulFunctionCall", + "src": "25775:19:70" + } + ], + "functionName": { + "name": "abi_decode_uint64_fromMemory", + "nativeSrc": "25746:28:70", + "nodeType": "YulIdentifier", + "src": "25746:28:70" + }, + "nativeSrc": "25746:49:70", + "nodeType": "YulFunctionCall", + "src": "25746:49:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "25722:6:70", + "nodeType": "YulIdentifier", + "src": "25722:6:70" + }, + "nativeSrc": "25722:74:70", + "nodeType": "YulFunctionCall", + "src": "25722:74:70" + }, + "nativeSrc": "25722:74:70", + "nodeType": "YulExpressionStatement", + "src": "25722:74:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "value", + "nativeSrc": "25816:5:70", + "nodeType": "YulIdentifier", + "src": "25816:5:70" + }, + { + "kind": "number", + "nativeSrc": "25823:3:70", + "nodeType": "YulLiteral", + "src": "25823:3:70", + "type": "", + "value": "160" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "25812:3:70", + "nodeType": "YulIdentifier", + "src": "25812:3:70" + }, + "nativeSrc": "25812:15:70", + "nodeType": "YulFunctionCall", + "src": "25812:15:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "25862:9:70", + "nodeType": "YulIdentifier", + "src": "25862:9:70" + }, + { + "kind": "number", + "nativeSrc": "25873:3:70", + "nodeType": "YulLiteral", + "src": "25873:3:70", + "type": "", + "value": "160" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "25858:3:70", + "nodeType": "YulIdentifier", + "src": "25858:3:70" + }, + "nativeSrc": "25858:19:70", + "nodeType": "YulFunctionCall", + "src": "25858:19:70" + } + ], + "functionName": { + "name": "abi_decode_uint64_fromMemory", + "nativeSrc": "25829:28:70", + "nodeType": "YulIdentifier", + "src": "25829:28:70" + }, + "nativeSrc": "25829:49:70", + "nodeType": "YulFunctionCall", + "src": "25829:49:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "25805:6:70", + "nodeType": "YulIdentifier", + "src": "25805:6:70" + }, + "nativeSrc": "25805:74:70", + "nodeType": "YulFunctionCall", + "src": "25805:74:70" + }, + "nativeSrc": "25805:74:70", + "nodeType": "YulExpressionStatement", + "src": "25805:74:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "value", + "nativeSrc": "25899:5:70", + "nodeType": "YulIdentifier", + "src": "25899:5:70" + }, + { + "kind": "number", + "nativeSrc": "25906:3:70", + "nodeType": "YulLiteral", + "src": "25906:3:70", + "type": "", + "value": "192" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "25895:3:70", + "nodeType": "YulIdentifier", + "src": "25895:3:70" + }, + "nativeSrc": "25895:15:70", + "nodeType": "YulFunctionCall", + "src": "25895:15:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "25945:9:70", + "nodeType": "YulIdentifier", + "src": "25945:9:70" + }, + { + "kind": "number", + "nativeSrc": "25956:3:70", + "nodeType": "YulLiteral", + "src": "25956:3:70", + "type": "", + "value": "192" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "25941:3:70", + "nodeType": "YulIdentifier", + "src": "25941:3:70" + }, + "nativeSrc": "25941:19:70", + "nodeType": "YulFunctionCall", + "src": "25941:19:70" + } + ], + "functionName": { + "name": "abi_decode_uint32_fromMemory", + "nativeSrc": "25912:28:70", + "nodeType": "YulIdentifier", + "src": "25912:28:70" + }, + "nativeSrc": "25912:49:70", + "nodeType": "YulFunctionCall", + "src": "25912:49:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "25888:6:70", + "nodeType": "YulIdentifier", + "src": "25888:6:70" + }, + "nativeSrc": "25888:74:70", + "nodeType": "YulFunctionCall", + "src": "25888:74:70" + }, + "nativeSrc": "25888:74:70", + "nodeType": "YulExpressionStatement", + "src": "25888:74:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "value", + "nativeSrc": "25982:5:70", + "nodeType": "YulIdentifier", + "src": "25982:5:70" + }, + { + "kind": "number", + "nativeSrc": "25989:3:70", + "nodeType": "YulLiteral", + "src": "25989:3:70", + "type": "", + "value": "224" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "25978:3:70", + "nodeType": "YulIdentifier", + "src": "25978:3:70" + }, + "nativeSrc": "25978:15:70", + "nodeType": "YulFunctionCall", + "src": "25978:15:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "26028:9:70", + "nodeType": "YulIdentifier", + "src": "26028:9:70" + }, + { + "kind": "number", + "nativeSrc": "26039:3:70", + "nodeType": "YulLiteral", + "src": "26039:3:70", + "type": "", + "value": "224" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "26024:3:70", + "nodeType": "YulIdentifier", + "src": "26024:3:70" + }, + "nativeSrc": "26024:19:70", + "nodeType": "YulFunctionCall", + "src": "26024:19:70" + } + ], + "functionName": { + "name": "abi_decode_uint64_fromMemory", + "nativeSrc": "25995:28:70", + "nodeType": "YulIdentifier", + "src": "25995:28:70" + }, + "nativeSrc": "25995:49:70", + "nodeType": "YulFunctionCall", + "src": "25995:49:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "25971:6:70", + "nodeType": "YulIdentifier", + "src": "25971:6:70" + }, + "nativeSrc": "25971:74:70", + "nodeType": "YulFunctionCall", + "src": "25971:74:70" + }, + "nativeSrc": "25971:74:70", + "nodeType": "YulExpressionStatement", + "src": "25971:74:70" + }, + { + "nativeSrc": "26054:17:70", + "nodeType": "YulVariableDeclaration", + "src": "26054:17:70", + "value": { + "name": "_1", + "nativeSrc": "26069:2:70", + "nodeType": "YulIdentifier", + "src": "26069:2:70" + }, + "variables": [ + { + "name": "value_4", + "nativeSrc": "26058:7:70", + "nodeType": "YulTypedName", + "src": "26058:7:70", + "type": "" + } + ] + }, + { + "nativeSrc": "26080:37:70", + "nodeType": "YulAssignment", + "src": "26080:37:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "26101:9:70", + "nodeType": "YulIdentifier", + "src": "26101:9:70" + }, + { + "kind": "number", + "nativeSrc": "26112:3:70", + "nodeType": "YulLiteral", + "src": "26112:3:70", + "type": "", + "value": "256" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "26097:3:70", + "nodeType": "YulIdentifier", + "src": "26097:3:70" + }, + "nativeSrc": "26097:19:70", + "nodeType": "YulFunctionCall", + "src": "26097:19:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "26091:5:70", + "nodeType": "YulIdentifier", + "src": "26091:5:70" + }, + "nativeSrc": "26091:26:70", + "nodeType": "YulFunctionCall", + "src": "26091:26:70" + }, + "variableNames": [ + { + "name": "value_4", + "nativeSrc": "26080:7:70", + "nodeType": "YulIdentifier", + "src": "26080:7:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "value", + "nativeSrc": "26137:5:70", + "nodeType": "YulIdentifier", + "src": "26137:5:70" + }, + { + "kind": "number", + "nativeSrc": "26144:3:70", + "nodeType": "YulLiteral", + "src": "26144:3:70", + "type": "", + "value": "256" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "26133:3:70", + "nodeType": "YulIdentifier", + "src": "26133:3:70" + }, + "nativeSrc": "26133:15:70", + "nodeType": "YulFunctionCall", + "src": "26133:15:70" + }, + { + "name": "value_4", + "nativeSrc": "26150:7:70", + "nodeType": "YulIdentifier", + "src": "26150:7:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "26126:6:70", + "nodeType": "YulIdentifier", + "src": "26126:6:70" + }, + "nativeSrc": "26126:32:70", + "nodeType": "YulFunctionCall", + "src": "26126:32:70" + }, + "nativeSrc": "26126:32:70", + "nodeType": "YulExpressionStatement", + "src": "26126:32:70" + }, + { + "nativeSrc": "26167:17:70", + "nodeType": "YulVariableDeclaration", + "src": "26167:17:70", + "value": { + "name": "_1", + "nativeSrc": "26182:2:70", + "nodeType": "YulIdentifier", + "src": "26182:2:70" + }, + "variables": [ + { + "name": "value_5", + "nativeSrc": "26171:7:70", + "nodeType": "YulTypedName", + "src": "26171:7:70", + "type": "" + } + ] + }, + { + "nativeSrc": "26193:37:70", + "nodeType": "YulAssignment", + "src": "26193:37:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "26214:9:70", + "nodeType": "YulIdentifier", + "src": "26214:9:70" + }, + { + "kind": "number", + "nativeSrc": "26225:3:70", + "nodeType": "YulLiteral", + "src": "26225:3:70", + "type": "", + "value": "288" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "26210:3:70", + "nodeType": "YulIdentifier", + "src": "26210:3:70" + }, + "nativeSrc": "26210:19:70", + "nodeType": "YulFunctionCall", + "src": "26210:19:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "26204:5:70", + "nodeType": "YulIdentifier", + "src": "26204:5:70" + }, + "nativeSrc": "26204:26:70", + "nodeType": "YulFunctionCall", + "src": "26204:26:70" + }, + "variableNames": [ + { + "name": "value_5", + "nativeSrc": "26193:7:70", + "nodeType": "YulIdentifier", + "src": "26193:7:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "value", + "nativeSrc": "26250:5:70", + "nodeType": "YulIdentifier", + "src": "26250:5:70" + }, + { + "kind": "number", + "nativeSrc": "26257:3:70", + "nodeType": "YulLiteral", + "src": "26257:3:70", + "type": "", + "value": "288" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "26246:3:70", + "nodeType": "YulIdentifier", + "src": "26246:3:70" + }, + "nativeSrc": "26246:15:70", + "nodeType": "YulFunctionCall", + "src": "26246:15:70" + }, + { + "name": "value_5", + "nativeSrc": "26263:7:70", + "nodeType": "YulIdentifier", + "src": "26263:7:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "26239:6:70", + "nodeType": "YulIdentifier", + "src": "26239:6:70" + }, + "nativeSrc": "26239:32:70", + "nodeType": "YulFunctionCall", + "src": "26239:32:70" + }, + "nativeSrc": "26239:32:70", + "nodeType": "YulExpressionStatement", + "src": "26239:32:70" + }, + { + "nativeSrc": "26280:15:70", + "nodeType": "YulAssignment", + "src": "26280:15:70", + "value": { + "name": "value", + "nativeSrc": "26290:5:70", + "nodeType": "YulIdentifier", + "src": "26290:5:70" + }, + "variableNames": [ + { + "name": "value0", + "nativeSrc": "26280:6:70", + "nodeType": "YulIdentifier", + "src": "26280:6:70" + } + ] + } + ] + }, + "name": "abi_decode_tuple_t_struct$_Provision_$3962_memory_ptr_fromMemory", + "nativeSrc": "25065:1236:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "25139:9:70", + "nodeType": "YulTypedName", + "src": "25139:9:70", + "type": "" + }, + { + "name": "dataEnd", + "nativeSrc": "25150:7:70", + "nodeType": "YulTypedName", + "src": "25150:7:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value0", + "nativeSrc": "25162:6:70", + "nodeType": "YulTypedName", + "src": "25162:6:70", + "type": "" + } + ], + "src": "25065:1236:70" + }, + { + "body": { + "nativeSrc": "26429:161:70", + "nodeType": "YulBlock", + "src": "26429:161:70", + "statements": [ + { + "nativeSrc": "26439:26:70", + "nodeType": "YulAssignment", + "src": "26439:26:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "26451:9:70", + "nodeType": "YulIdentifier", + "src": "26451:9:70" + }, + { + "kind": "number", + "nativeSrc": "26462:2:70", + "nodeType": "YulLiteral", + "src": "26462:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "26447:3:70", + "nodeType": "YulIdentifier", + "src": "26447:3:70" + }, + "nativeSrc": "26447:18:70", + "nodeType": "YulFunctionCall", + "src": "26447:18:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "26439:4:70", + "nodeType": "YulIdentifier", + "src": "26439:4:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "26481:9:70", + "nodeType": "YulIdentifier", + "src": "26481:9:70" + }, + { + "arguments": [ + { + "name": "value0", + "nativeSrc": "26496:6:70", + "nodeType": "YulIdentifier", + "src": "26496:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "26512:3:70", + "nodeType": "YulLiteral", + "src": "26512:3:70", + "type": "", + "value": "160" + }, + { + "kind": "number", + "nativeSrc": "26517:1:70", + "nodeType": "YulLiteral", + "src": "26517:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "26508:3:70", + "nodeType": "YulIdentifier", + "src": "26508:3:70" + }, + "nativeSrc": "26508:11:70", + "nodeType": "YulFunctionCall", + "src": "26508:11:70" + }, + { + "kind": "number", + "nativeSrc": "26521:1:70", + "nodeType": "YulLiteral", + "src": "26521:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "26504:3:70", + "nodeType": "YulIdentifier", + "src": "26504:3:70" + }, + "nativeSrc": "26504:19:70", + "nodeType": "YulFunctionCall", + "src": "26504:19:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "26492:3:70", + "nodeType": "YulIdentifier", + "src": "26492:3:70" + }, + "nativeSrc": "26492:32:70", + "nodeType": "YulFunctionCall", + "src": "26492:32:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "26474:6:70", + "nodeType": "YulIdentifier", + "src": "26474:6:70" + }, + "nativeSrc": "26474:51:70", + "nodeType": "YulFunctionCall", + "src": "26474:51:70" + }, + "nativeSrc": "26474:51:70", + "nodeType": "YulExpressionStatement", + "src": "26474:51:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "26545:9:70", + "nodeType": "YulIdentifier", + "src": "26545:9:70" + }, + { + "kind": "number", + "nativeSrc": "26556:2:70", + "nodeType": "YulLiteral", + "src": "26556:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "26541:3:70", + "nodeType": "YulIdentifier", + "src": "26541:3:70" + }, + "nativeSrc": "26541:18:70", + "nodeType": "YulFunctionCall", + "src": "26541:18:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "name": "value1", + "nativeSrc": "26575:6:70", + "nodeType": "YulIdentifier", + "src": "26575:6:70" + } + ], + "functionName": { + "name": "iszero", + "nativeSrc": "26568:6:70", + "nodeType": "YulIdentifier", + "src": "26568:6:70" + }, + "nativeSrc": "26568:14:70", + "nodeType": "YulFunctionCall", + "src": "26568:14:70" + } + ], + "functionName": { + "name": "iszero", + "nativeSrc": "26561:6:70", + "nodeType": "YulIdentifier", + "src": "26561:6:70" + }, + "nativeSrc": "26561:22:70", + "nodeType": "YulFunctionCall", + "src": "26561:22:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "26534:6:70", + "nodeType": "YulIdentifier", + "src": "26534:6:70" + }, + "nativeSrc": "26534:50:70", + "nodeType": "YulFunctionCall", + "src": "26534:50:70" + }, + "nativeSrc": "26534:50:70", + "nodeType": "YulExpressionStatement", + "src": "26534:50:70" + } + ] + }, + "name": "abi_encode_tuple_t_address_t_bool__to_t_address_t_bool__fromStack_reversed", + "nativeSrc": "26306:284:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "26390:9:70", + "nodeType": "YulTypedName", + "src": "26390:9:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "26401:6:70", + "nodeType": "YulTypedName", + "src": "26401:6:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "26409:6:70", + "nodeType": "YulTypedName", + "src": "26409:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "26420:4:70", + "nodeType": "YulTypedName", + "src": "26420:4:70", + "type": "" + } + ], + "src": "26306:284:70" + }, + { + "body": { + "nativeSrc": "26730:156:70", + "nodeType": "YulBlock", + "src": "26730:156:70", + "statements": [ + { + "nativeSrc": "26740:26:70", + "nodeType": "YulAssignment", + "src": "26740:26:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "26752:9:70", + "nodeType": "YulIdentifier", + "src": "26752:9:70" + }, + { + "kind": "number", + "nativeSrc": "26763:2:70", + "nodeType": "YulLiteral", + "src": "26763:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "26748:3:70", + "nodeType": "YulIdentifier", + "src": "26748:3:70" + }, + "nativeSrc": "26748:18:70", + "nodeType": "YulFunctionCall", + "src": "26748:18:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "26740:4:70", + "nodeType": "YulIdentifier", + "src": "26740:4:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "26782:9:70", + "nodeType": "YulIdentifier", + "src": "26782:9:70" + }, + { + "arguments": [ + { + "name": "value0", + "nativeSrc": "26797:6:70", + "nodeType": "YulIdentifier", + "src": "26797:6:70" + }, + { + "kind": "number", + "nativeSrc": "26805:4:70", + "nodeType": "YulLiteral", + "src": "26805:4:70", + "type": "", + "value": "0xff" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "26793:3:70", + "nodeType": "YulIdentifier", + "src": "26793:3:70" + }, + "nativeSrc": "26793:17:70", + "nodeType": "YulFunctionCall", + "src": "26793:17:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "26775:6:70", + "nodeType": "YulIdentifier", + "src": "26775:6:70" + }, + "nativeSrc": "26775:36:70", + "nodeType": "YulFunctionCall", + "src": "26775:36:70" + }, + "nativeSrc": "26775:36:70", + "nodeType": "YulExpressionStatement", + "src": "26775:36:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "26831:9:70", + "nodeType": "YulIdentifier", + "src": "26831:9:70" + }, + { + "kind": "number", + "nativeSrc": "26842:2:70", + "nodeType": "YulLiteral", + "src": "26842:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "26827:3:70", + "nodeType": "YulIdentifier", + "src": "26827:3:70" + }, + "nativeSrc": "26827:18:70", + "nodeType": "YulFunctionCall", + "src": "26827:18:70" + }, + { + "arguments": [ + { + "name": "value1", + "nativeSrc": "26851:6:70", + "nodeType": "YulIdentifier", + "src": "26851:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "26867:3:70", + "nodeType": "YulLiteral", + "src": "26867:3:70", + "type": "", + "value": "160" + }, + { + "kind": "number", + "nativeSrc": "26872:1:70", + "nodeType": "YulLiteral", + "src": "26872:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "26863:3:70", + "nodeType": "YulIdentifier", + "src": "26863:3:70" + }, + "nativeSrc": "26863:11:70", + "nodeType": "YulFunctionCall", + "src": "26863:11:70" + }, + { + "kind": "number", + "nativeSrc": "26876:1:70", + "nodeType": "YulLiteral", + "src": "26876:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "26859:3:70", + "nodeType": "YulIdentifier", + "src": "26859:3:70" + }, + "nativeSrc": "26859:19:70", + "nodeType": "YulFunctionCall", + "src": "26859:19:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "26847:3:70", + "nodeType": "YulIdentifier", + "src": "26847:3:70" + }, + "nativeSrc": "26847:32:70", + "nodeType": "YulFunctionCall", + "src": "26847:32:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "26820:6:70", + "nodeType": "YulIdentifier", + "src": "26820:6:70" + }, + "nativeSrc": "26820:60:70", + "nodeType": "YulFunctionCall", + "src": "26820:60:70" + }, + "nativeSrc": "26820:60:70", + "nodeType": "YulExpressionStatement", + "src": "26820:60:70" + } + ] + }, + "name": "abi_encode_tuple_t_rational_0_by_1_t_address__to_t_uint8_t_address__fromStack_reversed", + "nativeSrc": "26595:291:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "26691:9:70", + "nodeType": "YulTypedName", + "src": "26691:9:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "26702:6:70", + "nodeType": "YulTypedName", + "src": "26702:6:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "26710:6:70", + "nodeType": "YulTypedName", + "src": "26710:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "26721:4:70", + "nodeType": "YulTypedName", + "src": "26721:4:70", + "type": "" + } + ], + "src": "26595:291:70" + }, + { + "body": { + "nativeSrc": "26972:149:70", + "nodeType": "YulBlock", + "src": "26972:149:70", + "statements": [ + { + "body": { + "nativeSrc": "27018:16:70", + "nodeType": "YulBlock", + "src": "27018:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "27027:1:70", + "nodeType": "YulLiteral", + "src": "27027:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "27030:1:70", + "nodeType": "YulLiteral", + "src": "27030:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "27020:6:70", + "nodeType": "YulIdentifier", + "src": "27020:6:70" + }, + "nativeSrc": "27020:12:70", + "nodeType": "YulFunctionCall", + "src": "27020:12:70" + }, + "nativeSrc": "27020:12:70", + "nodeType": "YulExpressionStatement", + "src": "27020:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "dataEnd", + "nativeSrc": "26993:7:70", + "nodeType": "YulIdentifier", + "src": "26993:7:70" + }, + { + "name": "headStart", + "nativeSrc": "27002:9:70", + "nodeType": "YulIdentifier", + "src": "27002:9:70" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "26989:3:70", + "nodeType": "YulIdentifier", + "src": "26989:3:70" + }, + "nativeSrc": "26989:23:70", + "nodeType": "YulFunctionCall", + "src": "26989:23:70" + }, + { + "kind": "number", + "nativeSrc": "27014:2:70", + "nodeType": "YulLiteral", + "src": "27014:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "slt", + "nativeSrc": "26985:3:70", + "nodeType": "YulIdentifier", + "src": "26985:3:70" + }, + "nativeSrc": "26985:32:70", + "nodeType": "YulFunctionCall", + "src": "26985:32:70" + }, + "nativeSrc": "26982:52:70", + "nodeType": "YulIf", + "src": "26982:52:70" + }, + { + "nativeSrc": "27043:14:70", + "nodeType": "YulVariableDeclaration", + "src": "27043:14:70", + "value": { + "kind": "number", + "nativeSrc": "27056:1:70", + "nodeType": "YulLiteral", + "src": "27056:1:70", + "type": "", + "value": "0" + }, + "variables": [ + { + "name": "value", + "nativeSrc": "27047:5:70", + "nodeType": "YulTypedName", + "src": "27047:5:70", + "type": "" + } + ] + }, + { + "nativeSrc": "27066:25:70", + "nodeType": "YulAssignment", + "src": "27066:25:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "27081:9:70", + "nodeType": "YulIdentifier", + "src": "27081:9:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "27075:5:70", + "nodeType": "YulIdentifier", + "src": "27075:5:70" + }, + "nativeSrc": "27075:16:70", + "nodeType": "YulFunctionCall", + "src": "27075:16:70" + }, + "variableNames": [ + { + "name": "value", + "nativeSrc": "27066:5:70", + "nodeType": "YulIdentifier", + "src": "27066:5:70" + } + ] + }, + { + "nativeSrc": "27100:15:70", + "nodeType": "YulAssignment", + "src": "27100:15:70", + "value": { + "name": "value", + "nativeSrc": "27110:5:70", + "nodeType": "YulIdentifier", + "src": "27110:5:70" + }, + "variableNames": [ + { + "name": "value0", + "nativeSrc": "27100:6:70", + "nodeType": "YulIdentifier", + "src": "27100:6:70" + } + ] + } + ] + }, + "name": "abi_decode_tuple_t_uint256_fromMemory", + "nativeSrc": "26891:230:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "26938:9:70", + "nodeType": "YulTypedName", + "src": "26938:9:70", + "type": "" + }, + { + "name": "dataEnd", + "nativeSrc": "26949:7:70", + "nodeType": "YulTypedName", + "src": "26949:7:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value0", + "nativeSrc": "26961:6:70", + "nodeType": "YulTypedName", + "src": "26961:6:70", + "type": "" + } + ], + "src": "26891:230:70" + }, + { + "body": { + "nativeSrc": "27206:169:70", + "nodeType": "YulBlock", + "src": "27206:169:70", + "statements": [ + { + "body": { + "nativeSrc": "27252:16:70", + "nodeType": "YulBlock", + "src": "27252:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "27261:1:70", + "nodeType": "YulLiteral", + "src": "27261:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "27264:1:70", + "nodeType": "YulLiteral", + "src": "27264:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "27254:6:70", + "nodeType": "YulIdentifier", + "src": "27254:6:70" + }, + "nativeSrc": "27254:12:70", + "nodeType": "YulFunctionCall", + "src": "27254:12:70" + }, + "nativeSrc": "27254:12:70", + "nodeType": "YulExpressionStatement", + "src": "27254:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "dataEnd", + "nativeSrc": "27227:7:70", + "nodeType": "YulIdentifier", + "src": "27227:7:70" + }, + { + "name": "headStart", + "nativeSrc": "27236:9:70", + "nodeType": "YulIdentifier", + "src": "27236:9:70" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "27223:3:70", + "nodeType": "YulIdentifier", + "src": "27223:3:70" + }, + "nativeSrc": "27223:23:70", + "nodeType": "YulFunctionCall", + "src": "27223:23:70" + }, + { + "kind": "number", + "nativeSrc": "27248:2:70", + "nodeType": "YulLiteral", + "src": "27248:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "slt", + "nativeSrc": "27219:3:70", + "nodeType": "YulIdentifier", + "src": "27219:3:70" + }, + "nativeSrc": "27219:32:70", + "nodeType": "YulFunctionCall", + "src": "27219:32:70" + }, + "nativeSrc": "27216:52:70", + "nodeType": "YulIf", + "src": "27216:52:70" + }, + { + "nativeSrc": "27277:29:70", + "nodeType": "YulVariableDeclaration", + "src": "27277:29:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "27296:9:70", + "nodeType": "YulIdentifier", + "src": "27296:9:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "27290:5:70", + "nodeType": "YulIdentifier", + "src": "27290:5:70" + }, + "nativeSrc": "27290:16:70", + "nodeType": "YulFunctionCall", + "src": "27290:16:70" + }, + "variables": [ + { + "name": "value", + "nativeSrc": "27281:5:70", + "nodeType": "YulTypedName", + "src": "27281:5:70", + "type": "" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "value", + "nativeSrc": "27339:5:70", + "nodeType": "YulIdentifier", + "src": "27339:5:70" + } + ], + "functionName": { + "name": "validator_revert_uint32", + "nativeSrc": "27315:23:70", + "nodeType": "YulIdentifier", + "src": "27315:23:70" + }, + "nativeSrc": "27315:30:70", + "nodeType": "YulFunctionCall", + "src": "27315:30:70" + }, + "nativeSrc": "27315:30:70", + "nodeType": "YulExpressionStatement", + "src": "27315:30:70" + }, + { + "nativeSrc": "27354:15:70", + "nodeType": "YulAssignment", + "src": "27354:15:70", + "value": { + "name": "value", + "nativeSrc": "27364:5:70", + "nodeType": "YulIdentifier", + "src": "27364:5:70" + }, + "variableNames": [ + { + "name": "value0", + "nativeSrc": "27354:6:70", + "nodeType": "YulIdentifier", + "src": "27354:6:70" + } + ] + } + ] + }, + "name": "abi_decode_tuple_t_uint32_fromMemory", + "nativeSrc": "27126:249:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "27172:9:70", + "nodeType": "YulTypedName", + "src": "27172:9:70", + "type": "" + }, + { + "name": "dataEnd", + "nativeSrc": "27183:7:70", + "nodeType": "YulTypedName", + "src": "27183:7:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value0", + "nativeSrc": "27195:6:70", + "nodeType": "YulTypedName", + "src": "27195:6:70", + "type": "" + } + ], + "src": "27126:249:70" + }, + { + "body": { + "nativeSrc": "27460:169:70", + "nodeType": "YulBlock", + "src": "27460:169:70", + "statements": [ + { + "body": { + "nativeSrc": "27506:16:70", + "nodeType": "YulBlock", + "src": "27506:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "27515:1:70", + "nodeType": "YulLiteral", + "src": "27515:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "27518:1:70", + "nodeType": "YulLiteral", + "src": "27518:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "27508:6:70", + "nodeType": "YulIdentifier", + "src": "27508:6:70" + }, + "nativeSrc": "27508:12:70", + "nodeType": "YulFunctionCall", + "src": "27508:12:70" + }, + "nativeSrc": "27508:12:70", + "nodeType": "YulExpressionStatement", + "src": "27508:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "dataEnd", + "nativeSrc": "27481:7:70", + "nodeType": "YulIdentifier", + "src": "27481:7:70" + }, + { + "name": "headStart", + "nativeSrc": "27490:9:70", + "nodeType": "YulIdentifier", + "src": "27490:9:70" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "27477:3:70", + "nodeType": "YulIdentifier", + "src": "27477:3:70" + }, + "nativeSrc": "27477:23:70", + "nodeType": "YulFunctionCall", + "src": "27477:23:70" + }, + { + "kind": "number", + "nativeSrc": "27502:2:70", + "nodeType": "YulLiteral", + "src": "27502:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "slt", + "nativeSrc": "27473:3:70", + "nodeType": "YulIdentifier", + "src": "27473:3:70" + }, + "nativeSrc": "27473:32:70", + "nodeType": "YulFunctionCall", + "src": "27473:32:70" + }, + "nativeSrc": "27470:52:70", + "nodeType": "YulIf", + "src": "27470:52:70" + }, + { + "nativeSrc": "27531:29:70", + "nodeType": "YulVariableDeclaration", + "src": "27531:29:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "27550:9:70", + "nodeType": "YulIdentifier", + "src": "27550:9:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "27544:5:70", + "nodeType": "YulIdentifier", + "src": "27544:5:70" + }, + "nativeSrc": "27544:16:70", + "nodeType": "YulFunctionCall", + "src": "27544:16:70" + }, + "variables": [ + { + "name": "value", + "nativeSrc": "27535:5:70", + "nodeType": "YulTypedName", + "src": "27535:5:70", + "type": "" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "value", + "nativeSrc": "27593:5:70", + "nodeType": "YulIdentifier", + "src": "27593:5:70" + } + ], + "functionName": { + "name": "validator_revert_uint64", + "nativeSrc": "27569:23:70", + "nodeType": "YulIdentifier", + "src": "27569:23:70" + }, + "nativeSrc": "27569:30:70", + "nodeType": "YulFunctionCall", + "src": "27569:30:70" + }, + "nativeSrc": "27569:30:70", + "nodeType": "YulExpressionStatement", + "src": "27569:30:70" + }, + { + "nativeSrc": "27608:15:70", + "nodeType": "YulAssignment", + "src": "27608:15:70", + "value": { + "name": "value", + "nativeSrc": "27618:5:70", + "nodeType": "YulIdentifier", + "src": "27618:5:70" + }, + "variableNames": [ + { + "name": "value0", + "nativeSrc": "27608:6:70", + "nodeType": "YulIdentifier", + "src": "27608:6:70" + } + ] + } + ] + }, + "name": "abi_decode_tuple_t_uint64_fromMemory", + "nativeSrc": "27380:249:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "27426:9:70", + "nodeType": "YulTypedName", + "src": "27426:9:70", + "type": "" + }, + { + "name": "dataEnd", + "nativeSrc": "27437:7:70", + "nodeType": "YulTypedName", + "src": "27437:7:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value0", + "nativeSrc": "27449:6:70", + "nodeType": "YulTypedName", + "src": "27449:6:70", + "type": "" + } + ], + "src": "27380:249:70" + }, + { + "body": { + "nativeSrc": "27757:135:70", + "nodeType": "YulBlock", + "src": "27757:135:70", + "statements": [ + { + "nativeSrc": "27767:26:70", + "nodeType": "YulAssignment", + "src": "27767:26:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "27779:9:70", + "nodeType": "YulIdentifier", + "src": "27779:9:70" + }, + { + "kind": "number", + "nativeSrc": "27790:2:70", + "nodeType": "YulLiteral", + "src": "27790:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "27775:3:70", + "nodeType": "YulIdentifier", + "src": "27775:3:70" + }, + "nativeSrc": "27775:18:70", + "nodeType": "YulFunctionCall", + "src": "27775:18:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "27767:4:70", + "nodeType": "YulIdentifier", + "src": "27767:4:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "27809:9:70", + "nodeType": "YulIdentifier", + "src": "27809:9:70" + }, + { + "name": "value0", + "nativeSrc": "27820:6:70", + "nodeType": "YulIdentifier", + "src": "27820:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "27802:6:70", + "nodeType": "YulIdentifier", + "src": "27802:6:70" + }, + "nativeSrc": "27802:25:70", + "nodeType": "YulFunctionCall", + "src": "27802:25:70" + }, + "nativeSrc": "27802:25:70", + "nodeType": "YulExpressionStatement", + "src": "27802:25:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "27847:9:70", + "nodeType": "YulIdentifier", + "src": "27847:9:70" + }, + { + "kind": "number", + "nativeSrc": "27858:2:70", + "nodeType": "YulLiteral", + "src": "27858:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "27843:3:70", + "nodeType": "YulIdentifier", + "src": "27843:3:70" + }, + "nativeSrc": "27843:18:70", + "nodeType": "YulFunctionCall", + "src": "27843:18:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "name": "value1", + "nativeSrc": "27877:6:70", + "nodeType": "YulIdentifier", + "src": "27877:6:70" + } + ], + "functionName": { + "name": "iszero", + "nativeSrc": "27870:6:70", + "nodeType": "YulIdentifier", + "src": "27870:6:70" + }, + "nativeSrc": "27870:14:70", + "nodeType": "YulFunctionCall", + "src": "27870:14:70" + } + ], + "functionName": { + "name": "iszero", + "nativeSrc": "27863:6:70", + "nodeType": "YulIdentifier", + "src": "27863:6:70" + }, + "nativeSrc": "27863:22:70", + "nodeType": "YulFunctionCall", + "src": "27863:22:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "27836:6:70", + "nodeType": "YulIdentifier", + "src": "27836:6:70" + }, + "nativeSrc": "27836:50:70", + "nodeType": "YulFunctionCall", + "src": "27836:50:70" + }, + "nativeSrc": "27836:50:70", + "nodeType": "YulExpressionStatement", + "src": "27836:50:70" + } + ] + }, + "name": "abi_encode_tuple_t_uint256_t_bool__to_t_uint256_t_bool__fromStack_reversed", + "nativeSrc": "27634:258:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "27718:9:70", + "nodeType": "YulTypedName", + "src": "27718:9:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "27729:6:70", + "nodeType": "YulTypedName", + "src": "27729:6:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "27737:6:70", + "nodeType": "YulTypedName", + "src": "27737:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "27748:4:70", + "nodeType": "YulTypedName", + "src": "27748:4:70", + "type": "" + } + ], + "src": "27634:258:70" + }, + { + "body": { + "nativeSrc": "28026:145:70", + "nodeType": "YulBlock", + "src": "28026:145:70", + "statements": [ + { + "nativeSrc": "28036:26:70", + "nodeType": "YulAssignment", + "src": "28036:26:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "28048:9:70", + "nodeType": "YulIdentifier", + "src": "28048:9:70" + }, + { + "kind": "number", + "nativeSrc": "28059:2:70", + "nodeType": "YulLiteral", + "src": "28059:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "28044:3:70", + "nodeType": "YulIdentifier", + "src": "28044:3:70" + }, + "nativeSrc": "28044:18:70", + "nodeType": "YulFunctionCall", + "src": "28044:18:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "28036:4:70", + "nodeType": "YulIdentifier", + "src": "28036:4:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "28078:9:70", + "nodeType": "YulIdentifier", + "src": "28078:9:70" + }, + { + "arguments": [ + { + "name": "value0", + "nativeSrc": "28093:6:70", + "nodeType": "YulIdentifier", + "src": "28093:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "28109:3:70", + "nodeType": "YulLiteral", + "src": "28109:3:70", + "type": "", + "value": "160" + }, + { + "kind": "number", + "nativeSrc": "28114:1:70", + "nodeType": "YulLiteral", + "src": "28114:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "28105:3:70", + "nodeType": "YulIdentifier", + "src": "28105:3:70" + }, + "nativeSrc": "28105:11:70", + "nodeType": "YulFunctionCall", + "src": "28105:11:70" + }, + { + "kind": "number", + "nativeSrc": "28118:1:70", + "nodeType": "YulLiteral", + "src": "28118:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "28101:3:70", + "nodeType": "YulIdentifier", + "src": "28101:3:70" + }, + "nativeSrc": "28101:19:70", + "nodeType": "YulFunctionCall", + "src": "28101:19:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "28089:3:70", + "nodeType": "YulIdentifier", + "src": "28089:3:70" + }, + "nativeSrc": "28089:32:70", + "nodeType": "YulFunctionCall", + "src": "28089:32:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "28071:6:70", + "nodeType": "YulIdentifier", + "src": "28071:6:70" + }, + "nativeSrc": "28071:51:70", + "nodeType": "YulFunctionCall", + "src": "28071:51:70" + }, + "nativeSrc": "28071:51:70", + "nodeType": "YulExpressionStatement", + "src": "28071:51:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "28142:9:70", + "nodeType": "YulIdentifier", + "src": "28142:9:70" + }, + { + "kind": "number", + "nativeSrc": "28153:2:70", + "nodeType": "YulLiteral", + "src": "28153:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "28138:3:70", + "nodeType": "YulIdentifier", + "src": "28138:3:70" + }, + "nativeSrc": "28138:18:70", + "nodeType": "YulFunctionCall", + "src": "28138:18:70" + }, + { + "name": "value1", + "nativeSrc": "28158:6:70", + "nodeType": "YulIdentifier", + "src": "28158:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "28131:6:70", + "nodeType": "YulIdentifier", + "src": "28131:6:70" + }, + "nativeSrc": "28131:34:70", + "nodeType": "YulFunctionCall", + "src": "28131:34:70" + }, + "nativeSrc": "28131:34:70", + "nodeType": "YulExpressionStatement", + "src": "28131:34:70" + } + ] + }, + "name": "abi_encode_tuple_t_address_t_uint256__to_t_address_t_uint256__fromStack_reversed", + "nativeSrc": "27897:274:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "27987:9:70", + "nodeType": "YulTypedName", + "src": "27987:9:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "27998:6:70", + "nodeType": "YulTypedName", + "src": "27998:6:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "28006:6:70", + "nodeType": "YulTypedName", + "src": "28006:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "28017:4:70", + "nodeType": "YulTypedName", + "src": "28017:4:70", + "type": "" + } + ], + "src": "27897:274:70" + }, + { + "body": { + "nativeSrc": "28224:77:70", + "nodeType": "YulBlock", + "src": "28224:77:70", + "statements": [ + { + "nativeSrc": "28234:16:70", + "nodeType": "YulAssignment", + "src": "28234:16:70", + "value": { + "arguments": [ + { + "name": "x", + "nativeSrc": "28245:1:70", + "nodeType": "YulIdentifier", + "src": "28245:1:70" + }, + { + "name": "y", + "nativeSrc": "28248:1:70", + "nodeType": "YulIdentifier", + "src": "28248:1:70" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "28241:3:70", + "nodeType": "YulIdentifier", + "src": "28241:3:70" + }, + "nativeSrc": "28241:9:70", + "nodeType": "YulFunctionCall", + "src": "28241:9:70" + }, + "variableNames": [ + { + "name": "sum", + "nativeSrc": "28234:3:70", + "nodeType": "YulIdentifier", + "src": "28234:3:70" + } + ] + }, + { + "body": { + "nativeSrc": "28273:22:70", + "nodeType": "YulBlock", + "src": "28273:22:70", + "statements": [ + { + "expression": { + "arguments": [], + "functionName": { + "name": "panic_error_0x11", + "nativeSrc": "28275:16:70", + "nodeType": "YulIdentifier", + "src": "28275:16:70" + }, + "nativeSrc": "28275:18:70", + "nodeType": "YulFunctionCall", + "src": "28275:18:70" + }, + "nativeSrc": "28275:18:70", + "nodeType": "YulExpressionStatement", + "src": "28275:18:70" + } + ] + }, + "condition": { + "arguments": [ + { + "name": "x", + "nativeSrc": "28265:1:70", + "nodeType": "YulIdentifier", + "src": "28265:1:70" + }, + { + "name": "sum", + "nativeSrc": "28268:3:70", + "nodeType": "YulIdentifier", + "src": "28268:3:70" + } + ], + "functionName": { + "name": "gt", + "nativeSrc": "28262:2:70", + "nodeType": "YulIdentifier", + "src": "28262:2:70" + }, + "nativeSrc": "28262:10:70", + "nodeType": "YulFunctionCall", + "src": "28262:10:70" + }, + "nativeSrc": "28259:36:70", + "nodeType": "YulIf", + "src": "28259:36:70" + } + ] + }, + "name": "checked_add_t_uint256", + "nativeSrc": "28176:125:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "x", + "nativeSrc": "28207:1:70", + "nodeType": "YulTypedName", + "src": "28207:1:70", + "type": "" + }, + { + "name": "y", + "nativeSrc": "28210:1:70", + "nodeType": "YulTypedName", + "src": "28210:1:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "sum", + "nativeSrc": "28216:3:70", + "nodeType": "YulTypedName", + "src": "28216:3:70", + "type": "" + } + ], + "src": "28176:125:70" + }, + { + "body": { + "nativeSrc": "28443:150:70", + "nodeType": "YulBlock", + "src": "28443:150:70", + "statements": [ + { + "nativeSrc": "28453:27:70", + "nodeType": "YulVariableDeclaration", + "src": "28453:27:70", + "value": { + "arguments": [ + { + "name": "value0", + "nativeSrc": "28473:6:70", + "nodeType": "YulIdentifier", + "src": "28473:6:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "28467:5:70", + "nodeType": "YulIdentifier", + "src": "28467:5:70" + }, + "nativeSrc": "28467:13:70", + "nodeType": "YulFunctionCall", + "src": "28467:13:70" + }, + "variables": [ + { + "name": "length", + "nativeSrc": "28457:6:70", + "nodeType": "YulTypedName", + "src": "28457:6:70", + "type": "" + } + ] + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "value0", + "nativeSrc": "28528:6:70", + "nodeType": "YulIdentifier", + "src": "28528:6:70" + }, + { + "kind": "number", + "nativeSrc": "28536:4:70", + "nodeType": "YulLiteral", + "src": "28536:4:70", + "type": "", + "value": "0x20" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "28524:3:70", + "nodeType": "YulIdentifier", + "src": "28524:3:70" + }, + "nativeSrc": "28524:17:70", + "nodeType": "YulFunctionCall", + "src": "28524:17:70" + }, + { + "name": "pos", + "nativeSrc": "28543:3:70", + "nodeType": "YulIdentifier", + "src": "28543:3:70" + }, + { + "name": "length", + "nativeSrc": "28548:6:70", + "nodeType": "YulIdentifier", + "src": "28548:6:70" + } + ], + "functionName": { + "name": "copy_memory_to_memory_with_cleanup", + "nativeSrc": "28489:34:70", + "nodeType": "YulIdentifier", + "src": "28489:34:70" + }, + "nativeSrc": "28489:66:70", + "nodeType": "YulFunctionCall", + "src": "28489:66:70" + }, + "nativeSrc": "28489:66:70", + "nodeType": "YulExpressionStatement", + "src": "28489:66:70" + }, + { + "nativeSrc": "28564:23:70", + "nodeType": "YulAssignment", + "src": "28564:23:70", + "value": { + "arguments": [ + { + "name": "pos", + "nativeSrc": "28575:3:70", + "nodeType": "YulIdentifier", + "src": "28575:3:70" + }, + { + "name": "length", + "nativeSrc": "28580:6:70", + "nodeType": "YulIdentifier", + "src": "28580:6:70" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "28571:3:70", + "nodeType": "YulIdentifier", + "src": "28571:3:70" + }, + "nativeSrc": "28571:16:70", + "nodeType": "YulFunctionCall", + "src": "28571:16:70" + }, + "variableNames": [ + { + "name": "end", + "nativeSrc": "28564:3:70", + "nodeType": "YulIdentifier", + "src": "28564:3:70" + } + ] + } + ] + }, + "name": "abi_encode_tuple_packed_t_bytes_memory_ptr__to_t_bytes_memory_ptr__nonPadded_inplace_fromStack_reversed", + "nativeSrc": "28306:287:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "pos", + "nativeSrc": "28419:3:70", + "nodeType": "YulTypedName", + "src": "28419:3:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "28424:6:70", + "nodeType": "YulTypedName", + "src": "28424:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "end", + "nativeSrc": "28435:3:70", + "nodeType": "YulTypedName", + "src": "28435:3:70", + "type": "" + } + ], + "src": "28306:287:70" + }, + { + "body": { + "nativeSrc": "28646:84:70", + "nodeType": "YulBlock", + "src": "28646:84:70", + "statements": [ + { + "nativeSrc": "28656:29:70", + "nodeType": "YulAssignment", + "src": "28656:29:70", + "value": { + "arguments": [ + { + "name": "offset", + "nativeSrc": "28678:6:70", + "nodeType": "YulIdentifier", + "src": "28678:6:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "28665:12:70", + "nodeType": "YulIdentifier", + "src": "28665:12:70" + }, + "nativeSrc": "28665:20:70", + "nodeType": "YulFunctionCall", + "src": "28665:20:70" + }, + "variableNames": [ + { + "name": "value", + "nativeSrc": "28656:5:70", + "nodeType": "YulIdentifier", + "src": "28656:5:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "value", + "nativeSrc": "28718:5:70", + "nodeType": "YulIdentifier", + "src": "28718:5:70" + } + ], + "functionName": { + "name": "validator_revert_uint64", + "nativeSrc": "28694:23:70", + "nodeType": "YulIdentifier", + "src": "28694:23:70" + }, + "nativeSrc": "28694:30:70", + "nodeType": "YulFunctionCall", + "src": "28694:30:70" + }, + "nativeSrc": "28694:30:70", + "nodeType": "YulExpressionStatement", + "src": "28694:30:70" + } + ] + }, + "name": "abi_decode_uint64", + "nativeSrc": "28598:132:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "offset", + "nativeSrc": "28625:6:70", + "nodeType": "YulTypedName", + "src": "28625:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value", + "nativeSrc": "28636:5:70", + "nodeType": "YulTypedName", + "src": "28636:5:70", + "type": "" + } + ], + "src": "28598:132:70" + }, + { + "body": { + "nativeSrc": "28784:124:70", + "nodeType": "YulBlock", + "src": "28784:124:70", + "statements": [ + { + "nativeSrc": "28794:29:70", + "nodeType": "YulAssignment", + "src": "28794:29:70", + "value": { + "arguments": [ + { + "name": "offset", + "nativeSrc": "28816:6:70", + "nodeType": "YulIdentifier", + "src": "28816:6:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "28803:12:70", + "nodeType": "YulIdentifier", + "src": "28803:12:70" + }, + "nativeSrc": "28803:20:70", + "nodeType": "YulFunctionCall", + "src": "28803:20:70" + }, + "variableNames": [ + { + "name": "value", + "nativeSrc": "28794:5:70", + "nodeType": "YulIdentifier", + "src": "28794:5:70" + } + ] + }, + { + "body": { + "nativeSrc": "28886:16:70", + "nodeType": "YulBlock", + "src": "28886:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "28895:1:70", + "nodeType": "YulLiteral", + "src": "28895:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "28898:1:70", + "nodeType": "YulLiteral", + "src": "28898:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "28888:6:70", + "nodeType": "YulIdentifier", + "src": "28888:6:70" + }, + "nativeSrc": "28888:12:70", + "nodeType": "YulFunctionCall", + "src": "28888:12:70" + }, + "nativeSrc": "28888:12:70", + "nodeType": "YulExpressionStatement", + "src": "28888:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "value", + "nativeSrc": "28845:5:70", + "nodeType": "YulIdentifier", + "src": "28845:5:70" + }, + { + "arguments": [ + { + "name": "value", + "nativeSrc": "28856:5:70", + "nodeType": "YulIdentifier", + "src": "28856:5:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "28871:3:70", + "nodeType": "YulLiteral", + "src": "28871:3:70", + "type": "", + "value": "128" + }, + { + "kind": "number", + "nativeSrc": "28876:1:70", + "nodeType": "YulLiteral", + "src": "28876:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "28867:3:70", + "nodeType": "YulIdentifier", + "src": "28867:3:70" + }, + "nativeSrc": "28867:11:70", + "nodeType": "YulFunctionCall", + "src": "28867:11:70" + }, + { + "kind": "number", + "nativeSrc": "28880:1:70", + "nodeType": "YulLiteral", + "src": "28880:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "28863:3:70", + "nodeType": "YulIdentifier", + "src": "28863:3:70" + }, + "nativeSrc": "28863:19:70", + "nodeType": "YulFunctionCall", + "src": "28863:19:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "28852:3:70", + "nodeType": "YulIdentifier", + "src": "28852:3:70" + }, + "nativeSrc": "28852:31:70", + "nodeType": "YulFunctionCall", + "src": "28852:31:70" + } + ], + "functionName": { + "name": "eq", + "nativeSrc": "28842:2:70", + "nodeType": "YulIdentifier", + "src": "28842:2:70" + }, + "nativeSrc": "28842:42:70", + "nodeType": "YulFunctionCall", + "src": "28842:42:70" + } + ], + "functionName": { + "name": "iszero", + "nativeSrc": "28835:6:70", + "nodeType": "YulIdentifier", + "src": "28835:6:70" + }, + "nativeSrc": "28835:50:70", + "nodeType": "YulFunctionCall", + "src": "28835:50:70" + }, + "nativeSrc": "28832:70:70", + "nodeType": "YulIf", + "src": "28832:70:70" + } + ] + }, + "name": "abi_decode_uint128", + "nativeSrc": "28735:173:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "offset", + "nativeSrc": "28763:6:70", + "nodeType": "YulTypedName", + "src": "28763:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value", + "nativeSrc": "28774:5:70", + "nodeType": "YulTypedName", + "src": "28774:5:70", + "type": "" + } + ], + "src": "28735:173:70" + }, + { + "body": { + "nativeSrc": "29027:1514:70", + "nodeType": "YulBlock", + "src": "29027:1514:70", + "statements": [ + { + "body": { + "nativeSrc": "29073:16:70", + "nodeType": "YulBlock", + "src": "29073:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "29082:1:70", + "nodeType": "YulLiteral", + "src": "29082:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "29085:1:70", + "nodeType": "YulLiteral", + "src": "29085:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "29075:6:70", + "nodeType": "YulIdentifier", + "src": "29075:6:70" + }, + "nativeSrc": "29075:12:70", + "nodeType": "YulFunctionCall", + "src": "29075:12:70" + }, + "nativeSrc": "29075:12:70", + "nodeType": "YulExpressionStatement", + "src": "29075:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "dataEnd", + "nativeSrc": "29048:7:70", + "nodeType": "YulIdentifier", + "src": "29048:7:70" + }, + { + "name": "headStart", + "nativeSrc": "29057:9:70", + "nodeType": "YulIdentifier", + "src": "29057:9:70" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "29044:3:70", + "nodeType": "YulIdentifier", + "src": "29044:3:70" + }, + "nativeSrc": "29044:23:70", + "nodeType": "YulFunctionCall", + "src": "29044:23:70" + }, + { + "kind": "number", + "nativeSrc": "29069:2:70", + "nodeType": "YulLiteral", + "src": "29069:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "slt", + "nativeSrc": "29040:3:70", + "nodeType": "YulIdentifier", + "src": "29040:3:70" + }, + "nativeSrc": "29040:32:70", + "nodeType": "YulFunctionCall", + "src": "29040:32:70" + }, + "nativeSrc": "29037:52:70", + "nodeType": "YulIf", + "src": "29037:52:70" + }, + { + "nativeSrc": "29098:37:70", + "nodeType": "YulVariableDeclaration", + "src": "29098:37:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "29125:9:70", + "nodeType": "YulIdentifier", + "src": "29125:9:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "29112:12:70", + "nodeType": "YulIdentifier", + "src": "29112:12:70" + }, + "nativeSrc": "29112:23:70", + "nodeType": "YulFunctionCall", + "src": "29112:23:70" + }, + "variables": [ + { + "name": "offset", + "nativeSrc": "29102:6:70", + "nodeType": "YulTypedName", + "src": "29102:6:70", + "type": "" + } + ] + }, + { + "body": { + "nativeSrc": "29178:16:70", + "nodeType": "YulBlock", + "src": "29178:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "29187:1:70", + "nodeType": "YulLiteral", + "src": "29187:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "29190:1:70", + "nodeType": "YulLiteral", + "src": "29190:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "29180:6:70", + "nodeType": "YulIdentifier", + "src": "29180:6:70" + }, + "nativeSrc": "29180:12:70", + "nodeType": "YulFunctionCall", + "src": "29180:12:70" + }, + "nativeSrc": "29180:12:70", + "nodeType": "YulExpressionStatement", + "src": "29180:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "name": "offset", + "nativeSrc": "29150:6:70", + "nodeType": "YulIdentifier", + "src": "29150:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "29166:2:70", + "nodeType": "YulLiteral", + "src": "29166:2:70", + "type": "", + "value": "64" + }, + { + "kind": "number", + "nativeSrc": "29170:1:70", + "nodeType": "YulLiteral", + "src": "29170:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "29162:3:70", + "nodeType": "YulIdentifier", + "src": "29162:3:70" + }, + "nativeSrc": "29162:10:70", + "nodeType": "YulFunctionCall", + "src": "29162:10:70" + }, + { + "kind": "number", + "nativeSrc": "29174:1:70", + "nodeType": "YulLiteral", + "src": "29174:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "29158:3:70", + "nodeType": "YulIdentifier", + "src": "29158:3:70" + }, + "nativeSrc": "29158:18:70", + "nodeType": "YulFunctionCall", + "src": "29158:18:70" + } + ], + "functionName": { + "name": "gt", + "nativeSrc": "29147:2:70", + "nodeType": "YulIdentifier", + "src": "29147:2:70" + }, + "nativeSrc": "29147:30:70", + "nodeType": "YulFunctionCall", + "src": "29147:30:70" + }, + "nativeSrc": "29144:50:70", + "nodeType": "YulIf", + "src": "29144:50:70" + }, + { + "nativeSrc": "29203:32:70", + "nodeType": "YulVariableDeclaration", + "src": "29203:32:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "29217:9:70", + "nodeType": "YulIdentifier", + "src": "29217:9:70" + }, + { + "name": "offset", + "nativeSrc": "29228:6:70", + "nodeType": "YulIdentifier", + "src": "29228:6:70" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "29213:3:70", + "nodeType": "YulIdentifier", + "src": "29213:3:70" + }, + "nativeSrc": "29213:22:70", + "nodeType": "YulFunctionCall", + "src": "29213:22:70" + }, + "variables": [ + { + "name": "_1", + "nativeSrc": "29207:2:70", + "nodeType": "YulTypedName", + "src": "29207:2:70", + "type": "" + } + ] + }, + { + "body": { + "nativeSrc": "29273:16:70", + "nodeType": "YulBlock", + "src": "29273:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "29282:1:70", + "nodeType": "YulLiteral", + "src": "29282:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "29285:1:70", + "nodeType": "YulLiteral", + "src": "29285:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "29275:6:70", + "nodeType": "YulIdentifier", + "src": "29275:6:70" + }, + "nativeSrc": "29275:12:70", + "nodeType": "YulFunctionCall", + "src": "29275:12:70" + }, + "nativeSrc": "29275:12:70", + "nodeType": "YulExpressionStatement", + "src": "29275:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "dataEnd", + "nativeSrc": "29255:7:70", + "nodeType": "YulIdentifier", + "src": "29255:7:70" + }, + { + "name": "_1", + "nativeSrc": "29264:2:70", + "nodeType": "YulIdentifier", + "src": "29264:2:70" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "29251:3:70", + "nodeType": "YulIdentifier", + "src": "29251:3:70" + }, + "nativeSrc": "29251:16:70", + "nodeType": "YulFunctionCall", + "src": "29251:16:70" + }, + { + "kind": "number", + "nativeSrc": "29269:2:70", + "nodeType": "YulLiteral", + "src": "29269:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "slt", + "nativeSrc": "29247:3:70", + "nodeType": "YulIdentifier", + "src": "29247:3:70" + }, + "nativeSrc": "29247:25:70", + "nodeType": "YulFunctionCall", + "src": "29247:25:70" + }, + "nativeSrc": "29244:45:70", + "nodeType": "YulIf", + "src": "29244:45:70" + }, + { + "nativeSrc": "29298:35:70", + "nodeType": "YulVariableDeclaration", + "src": "29298:35:70", + "value": { + "arguments": [], + "functionName": { + "name": "allocate_memory_4301", + "nativeSrc": "29311:20:70", + "nodeType": "YulIdentifier", + "src": "29311:20:70" + }, + "nativeSrc": "29311:22:70", + "nodeType": "YulFunctionCall", + "src": "29311:22:70" + }, + "variables": [ + { + "name": "value", + "nativeSrc": "29302:5:70", + "nodeType": "YulTypedName", + "src": "29302:5:70", + "type": "" + } + ] + }, + { + "nativeSrc": "29342:32:70", + "nodeType": "YulVariableDeclaration", + "src": "29342:32:70", + "value": { + "arguments": [ + { + "name": "_1", + "nativeSrc": "29371:2:70", + "nodeType": "YulIdentifier", + "src": "29371:2:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "29358:12:70", + "nodeType": "YulIdentifier", + "src": "29358:12:70" + }, + "nativeSrc": "29358:16:70", + "nodeType": "YulFunctionCall", + "src": "29358:16:70" + }, + "variables": [ + { + "name": "offset_1", + "nativeSrc": "29346:8:70", + "nodeType": "YulTypedName", + "src": "29346:8:70", + "type": "" + } + ] + }, + { + "body": { + "nativeSrc": "29419:16:70", + "nodeType": "YulBlock", + "src": "29419:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "29428:1:70", + "nodeType": "YulLiteral", + "src": "29428:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "29431:1:70", + "nodeType": "YulLiteral", + "src": "29431:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "29421:6:70", + "nodeType": "YulIdentifier", + "src": "29421:6:70" + }, + "nativeSrc": "29421:12:70", + "nodeType": "YulFunctionCall", + "src": "29421:12:70" + }, + "nativeSrc": "29421:12:70", + "nodeType": "YulExpressionStatement", + "src": "29421:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "name": "offset_1", + "nativeSrc": "29389:8:70", + "nodeType": "YulIdentifier", + "src": "29389:8:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "29407:2:70", + "nodeType": "YulLiteral", + "src": "29407:2:70", + "type": "", + "value": "64" + }, + { + "kind": "number", + "nativeSrc": "29411:1:70", + "nodeType": "YulLiteral", + "src": "29411:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "29403:3:70", + "nodeType": "YulIdentifier", + "src": "29403:3:70" + }, + "nativeSrc": "29403:10:70", + "nodeType": "YulFunctionCall", + "src": "29403:10:70" + }, + { + "kind": "number", + "nativeSrc": "29415:1:70", + "nodeType": "YulLiteral", + "src": "29415:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "29399:3:70", + "nodeType": "YulIdentifier", + "src": "29399:3:70" + }, + "nativeSrc": "29399:18:70", + "nodeType": "YulFunctionCall", + "src": "29399:18:70" + } + ], + "functionName": { + "name": "gt", + "nativeSrc": "29386:2:70", + "nodeType": "YulIdentifier", + "src": "29386:2:70" + }, + "nativeSrc": "29386:32:70", + "nodeType": "YulFunctionCall", + "src": "29386:32:70" + }, + "nativeSrc": "29383:52:70", + "nodeType": "YulIf", + "src": "29383:52:70" + }, + { + "nativeSrc": "29444:27:70", + "nodeType": "YulVariableDeclaration", + "src": "29444:27:70", + "value": { + "arguments": [ + { + "name": "_1", + "nativeSrc": "29458:2:70", + "nodeType": "YulIdentifier", + "src": "29458:2:70" + }, + { + "name": "offset_1", + "nativeSrc": "29462:8:70", + "nodeType": "YulIdentifier", + "src": "29462:8:70" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "29454:3:70", + "nodeType": "YulIdentifier", + "src": "29454:3:70" + }, + "nativeSrc": "29454:17:70", + "nodeType": "YulFunctionCall", + "src": "29454:17:70" + }, + "variables": [ + { + "name": "_2", + "nativeSrc": "29448:2:70", + "nodeType": "YulTypedName", + "src": "29448:2:70", + "type": "" + } + ] + }, + { + "body": { + "nativeSrc": "29511:16:70", + "nodeType": "YulBlock", + "src": "29511:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "29520:1:70", + "nodeType": "YulLiteral", + "src": "29520:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "29523:1:70", + "nodeType": "YulLiteral", + "src": "29523:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "29513:6:70", + "nodeType": "YulIdentifier", + "src": "29513:6:70" + }, + "nativeSrc": "29513:12:70", + "nodeType": "YulFunctionCall", + "src": "29513:12:70" + }, + "nativeSrc": "29513:12:70", + "nodeType": "YulExpressionStatement", + "src": "29513:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "dataEnd", + "nativeSrc": "29491:7:70", + "nodeType": "YulIdentifier", + "src": "29491:7:70" + }, + { + "name": "_2", + "nativeSrc": "29500:2:70", + "nodeType": "YulIdentifier", + "src": "29500:2:70" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "29487:3:70", + "nodeType": "YulIdentifier", + "src": "29487:3:70" + }, + "nativeSrc": "29487:16:70", + "nodeType": "YulFunctionCall", + "src": "29487:16:70" + }, + { + "kind": "number", + "nativeSrc": "29505:4:70", + "nodeType": "YulLiteral", + "src": "29505:4:70", + "type": "", + "value": "0xe0" + } + ], + "functionName": { + "name": "slt", + "nativeSrc": "29483:3:70", + "nodeType": "YulIdentifier", + "src": "29483:3:70" + }, + "nativeSrc": "29483:27:70", + "nodeType": "YulFunctionCall", + "src": "29483:27:70" + }, + "nativeSrc": "29480:47:70", + "nodeType": "YulIf", + "src": "29480:47:70" + }, + { + "nativeSrc": "29536:32:70", + "nodeType": "YulVariableDeclaration", + "src": "29536:32:70", + "value": { + "arguments": [], + "functionName": { + "name": "allocate_memory", + "nativeSrc": "29551:15:70", + "nodeType": "YulIdentifier", + "src": "29551:15:70" + }, + "nativeSrc": "29551:17:70", + "nodeType": "YulFunctionCall", + "src": "29551:17:70" + }, + "variables": [ + { + "name": "value_1", + "nativeSrc": "29540:7:70", + "nodeType": "YulTypedName", + "src": "29540:7:70", + "type": "" + } + ] + }, + { + "nativeSrc": "29577:16:70", + "nodeType": "YulVariableDeclaration", + "src": "29577:16:70", + "value": { + "kind": "number", + "nativeSrc": "29592:1:70", + "nodeType": "YulLiteral", + "src": "29592:1:70", + "type": "", + "value": "0" + }, + "variables": [ + { + "name": "value_2", + "nativeSrc": "29581:7:70", + "nodeType": "YulTypedName", + "src": "29581:7:70", + "type": "" + } + ] + }, + { + "nativeSrc": "29602:27:70", + "nodeType": "YulAssignment", + "src": "29602:27:70", + "value": { + "arguments": [ + { + "name": "_2", + "nativeSrc": "29626:2:70", + "nodeType": "YulIdentifier", + "src": "29626:2:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "29613:12:70", + "nodeType": "YulIdentifier", + "src": "29613:12:70" + }, + "nativeSrc": "29613:16:70", + "nodeType": "YulFunctionCall", + "src": "29613:16:70" + }, + "variableNames": [ + { + "name": "value_2", + "nativeSrc": "29602:7:70", + "nodeType": "YulIdentifier", + "src": "29602:7:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "value_1", + "nativeSrc": "29645:7:70", + "nodeType": "YulIdentifier", + "src": "29645:7:70" + }, + { + "name": "value_2", + "nativeSrc": "29654:7:70", + "nodeType": "YulIdentifier", + "src": "29654:7:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "29638:6:70", + "nodeType": "YulIdentifier", + "src": "29638:6:70" + }, + "nativeSrc": "29638:24:70", + "nodeType": "YulFunctionCall", + "src": "29638:24:70" + }, + "nativeSrc": "29638:24:70", + "nodeType": "YulExpressionStatement", + "src": "29638:24:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "value_1", + "nativeSrc": "29682:7:70", + "nodeType": "YulIdentifier", + "src": "29682:7:70" + }, + { + "kind": "number", + "nativeSrc": "29691:2:70", + "nodeType": "YulLiteral", + "src": "29691:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "29678:3:70", + "nodeType": "YulIdentifier", + "src": "29678:3:70" + }, + "nativeSrc": "29678:16:70", + "nodeType": "YulFunctionCall", + "src": "29678:16:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "name": "_2", + "nativeSrc": "29719:2:70", + "nodeType": "YulIdentifier", + "src": "29719:2:70" + }, + { + "kind": "number", + "nativeSrc": "29723:2:70", + "nodeType": "YulLiteral", + "src": "29723:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "29715:3:70", + "nodeType": "YulIdentifier", + "src": "29715:3:70" + }, + "nativeSrc": "29715:11:70", + "nodeType": "YulFunctionCall", + "src": "29715:11:70" + } + ], + "functionName": { + "name": "abi_decode_address", + "nativeSrc": "29696:18:70", + "nodeType": "YulIdentifier", + "src": "29696:18:70" + }, + "nativeSrc": "29696:31:70", + "nodeType": "YulFunctionCall", + "src": "29696:31:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "29671:6:70", + "nodeType": "YulIdentifier", + "src": "29671:6:70" + }, + "nativeSrc": "29671:57:70", + "nodeType": "YulFunctionCall", + "src": "29671:57:70" + }, + "nativeSrc": "29671:57:70", + "nodeType": "YulExpressionStatement", + "src": "29671:57:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "value_1", + "nativeSrc": "29748:7:70", + "nodeType": "YulIdentifier", + "src": "29748:7:70" + }, + { + "kind": "number", + "nativeSrc": "29757:2:70", + "nodeType": "YulLiteral", + "src": "29757:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "29744:3:70", + "nodeType": "YulIdentifier", + "src": "29744:3:70" + }, + "nativeSrc": "29744:16:70", + "nodeType": "YulFunctionCall", + "src": "29744:16:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "name": "_2", + "nativeSrc": "29785:2:70", + "nodeType": "YulIdentifier", + "src": "29785:2:70" + }, + { + "kind": "number", + "nativeSrc": "29789:2:70", + "nodeType": "YulLiteral", + "src": "29789:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "29781:3:70", + "nodeType": "YulIdentifier", + "src": "29781:3:70" + }, + "nativeSrc": "29781:11:70", + "nodeType": "YulFunctionCall", + "src": "29781:11:70" + } + ], + "functionName": { + "name": "abi_decode_address", + "nativeSrc": "29762:18:70", + "nodeType": "YulIdentifier", + "src": "29762:18:70" + }, + "nativeSrc": "29762:31:70", + "nodeType": "YulFunctionCall", + "src": "29762:31:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "29737:6:70", + "nodeType": "YulIdentifier", + "src": "29737:6:70" + }, + "nativeSrc": "29737:57:70", + "nodeType": "YulFunctionCall", + "src": "29737:57:70" + }, + "nativeSrc": "29737:57:70", + "nodeType": "YulExpressionStatement", + "src": "29737:57:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "value_1", + "nativeSrc": "29814:7:70", + "nodeType": "YulIdentifier", + "src": "29814:7:70" + }, + { + "kind": "number", + "nativeSrc": "29823:2:70", + "nodeType": "YulLiteral", + "src": "29823:2:70", + "type": "", + "value": "96" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "29810:3:70", + "nodeType": "YulIdentifier", + "src": "29810:3:70" + }, + "nativeSrc": "29810:16:70", + "nodeType": "YulFunctionCall", + "src": "29810:16:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "name": "_2", + "nativeSrc": "29851:2:70", + "nodeType": "YulIdentifier", + "src": "29851:2:70" + }, + { + "kind": "number", + "nativeSrc": "29855:2:70", + "nodeType": "YulLiteral", + "src": "29855:2:70", + "type": "", + "value": "96" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "29847:3:70", + "nodeType": "YulIdentifier", + "src": "29847:3:70" + }, + "nativeSrc": "29847:11:70", + "nodeType": "YulFunctionCall", + "src": "29847:11:70" + } + ], + "functionName": { + "name": "abi_decode_address", + "nativeSrc": "29828:18:70", + "nodeType": "YulIdentifier", + "src": "29828:18:70" + }, + "nativeSrc": "29828:31:70", + "nodeType": "YulFunctionCall", + "src": "29828:31:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "29803:6:70", + "nodeType": "YulIdentifier", + "src": "29803:6:70" + }, + "nativeSrc": "29803:57:70", + "nodeType": "YulFunctionCall", + "src": "29803:57:70" + }, + "nativeSrc": "29803:57:70", + "nodeType": "YulExpressionStatement", + "src": "29803:57:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "value_1", + "nativeSrc": "29880:7:70", + "nodeType": "YulIdentifier", + "src": "29880:7:70" + }, + { + "kind": "number", + "nativeSrc": "29889:3:70", + "nodeType": "YulLiteral", + "src": "29889:3:70", + "type": "", + "value": "128" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "29876:3:70", + "nodeType": "YulIdentifier", + "src": "29876:3:70" + }, + "nativeSrc": "29876:17:70", + "nodeType": "YulFunctionCall", + "src": "29876:17:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "name": "_2", + "nativeSrc": "29917:2:70", + "nodeType": "YulIdentifier", + "src": "29917:2:70" + }, + { + "kind": "number", + "nativeSrc": "29921:3:70", + "nodeType": "YulLiteral", + "src": "29921:3:70", + "type": "", + "value": "128" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "29913:3:70", + "nodeType": "YulIdentifier", + "src": "29913:3:70" + }, + "nativeSrc": "29913:12:70", + "nodeType": "YulFunctionCall", + "src": "29913:12:70" + } + ], + "functionName": { + "name": "abi_decode_uint64", + "nativeSrc": "29895:17:70", + "nodeType": "YulIdentifier", + "src": "29895:17:70" + }, + "nativeSrc": "29895:31:70", + "nodeType": "YulFunctionCall", + "src": "29895:31:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "29869:6:70", + "nodeType": "YulIdentifier", + "src": "29869:6:70" + }, + "nativeSrc": "29869:58:70", + "nodeType": "YulFunctionCall", + "src": "29869:58:70" + }, + "nativeSrc": "29869:58:70", + "nodeType": "YulExpressionStatement", + "src": "29869:58:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "value_1", + "nativeSrc": "29947:7:70", + "nodeType": "YulIdentifier", + "src": "29947:7:70" + }, + { + "kind": "number", + "nativeSrc": "29956:3:70", + "nodeType": "YulLiteral", + "src": "29956:3:70", + "type": "", + "value": "160" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "29943:3:70", + "nodeType": "YulIdentifier", + "src": "29943:3:70" + }, + "nativeSrc": "29943:17:70", + "nodeType": "YulFunctionCall", + "src": "29943:17:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "name": "_2", + "nativeSrc": "29985:2:70", + "nodeType": "YulIdentifier", + "src": "29985:2:70" + }, + { + "kind": "number", + "nativeSrc": "29989:3:70", + "nodeType": "YulLiteral", + "src": "29989:3:70", + "type": "", + "value": "160" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "29981:3:70", + "nodeType": "YulIdentifier", + "src": "29981:3:70" + }, + "nativeSrc": "29981:12:70", + "nodeType": "YulFunctionCall", + "src": "29981:12:70" + } + ], + "functionName": { + "name": "abi_decode_uint128", + "nativeSrc": "29962:18:70", + "nodeType": "YulIdentifier", + "src": "29962:18:70" + }, + "nativeSrc": "29962:32:70", + "nodeType": "YulFunctionCall", + "src": "29962:32:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "29936:6:70", + "nodeType": "YulIdentifier", + "src": "29936:6:70" + }, + "nativeSrc": "29936:59:70", + "nodeType": "YulFunctionCall", + "src": "29936:59:70" + }, + "nativeSrc": "29936:59:70", + "nodeType": "YulExpressionStatement", + "src": "29936:59:70" + }, + { + "nativeSrc": "30004:42:70", + "nodeType": "YulVariableDeclaration", + "src": "30004:42:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "_2", + "nativeSrc": "30037:2:70", + "nodeType": "YulIdentifier", + "src": "30037:2:70" + }, + { + "kind": "number", + "nativeSrc": "30041:3:70", + "nodeType": "YulLiteral", + "src": "30041:3:70", + "type": "", + "value": "192" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "30033:3:70", + "nodeType": "YulIdentifier", + "src": "30033:3:70" + }, + "nativeSrc": "30033:12:70", + "nodeType": "YulFunctionCall", + "src": "30033:12:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "30020:12:70", + "nodeType": "YulIdentifier", + "src": "30020:12:70" + }, + "nativeSrc": "30020:26:70", + "nodeType": "YulFunctionCall", + "src": "30020:26:70" + }, + "variables": [ + { + "name": "offset_2", + "nativeSrc": "30008:8:70", + "nodeType": "YulTypedName", + "src": "30008:8:70", + "type": "" + } + ] + }, + { + "body": { + "nativeSrc": "30091:16:70", + "nodeType": "YulBlock", + "src": "30091:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "30100:1:70", + "nodeType": "YulLiteral", + "src": "30100:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "30103:1:70", + "nodeType": "YulLiteral", + "src": "30103:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "30093:6:70", + "nodeType": "YulIdentifier", + "src": "30093:6:70" + }, + "nativeSrc": "30093:12:70", + "nodeType": "YulFunctionCall", + "src": "30093:12:70" + }, + "nativeSrc": "30093:12:70", + "nodeType": "YulExpressionStatement", + "src": "30093:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "name": "offset_2", + "nativeSrc": "30061:8:70", + "nodeType": "YulIdentifier", + "src": "30061:8:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "30079:2:70", + "nodeType": "YulLiteral", + "src": "30079:2:70", + "type": "", + "value": "64" + }, + { + "kind": "number", + "nativeSrc": "30083:1:70", + "nodeType": "YulLiteral", + "src": "30083:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "30075:3:70", + "nodeType": "YulIdentifier", + "src": "30075:3:70" + }, + "nativeSrc": "30075:10:70", + "nodeType": "YulFunctionCall", + "src": "30075:10:70" + }, + { + "kind": "number", + "nativeSrc": "30087:1:70", + "nodeType": "YulLiteral", + "src": "30087:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "30071:3:70", + "nodeType": "YulIdentifier", + "src": "30071:3:70" + }, + "nativeSrc": "30071:18:70", + "nodeType": "YulFunctionCall", + "src": "30071:18:70" + } + ], + "functionName": { + "name": "gt", + "nativeSrc": "30058:2:70", + "nodeType": "YulIdentifier", + "src": "30058:2:70" + }, + "nativeSrc": "30058:32:70", + "nodeType": "YulFunctionCall", + "src": "30058:32:70" + }, + "nativeSrc": "30055:52:70", + "nodeType": "YulIf", + "src": "30055:52:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "value_1", + "nativeSrc": "30127:7:70", + "nodeType": "YulIdentifier", + "src": "30127:7:70" + }, + { + "kind": "number", + "nativeSrc": "30136:3:70", + "nodeType": "YulLiteral", + "src": "30136:3:70", + "type": "", + "value": "192" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "30123:3:70", + "nodeType": "YulIdentifier", + "src": "30123:3:70" + }, + "nativeSrc": "30123:17:70", + "nodeType": "YulFunctionCall", + "src": "30123:17:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "name": "_2", + "nativeSrc": "30164:2:70", + "nodeType": "YulIdentifier", + "src": "30164:2:70" + }, + { + "name": "offset_2", + "nativeSrc": "30168:8:70", + "nodeType": "YulIdentifier", + "src": "30168:8:70" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "30160:3:70", + "nodeType": "YulIdentifier", + "src": "30160:3:70" + }, + "nativeSrc": "30160:17:70", + "nodeType": "YulFunctionCall", + "src": "30160:17:70" + }, + { + "name": "dataEnd", + "nativeSrc": "30179:7:70", + "nodeType": "YulIdentifier", + "src": "30179:7:70" + } + ], + "functionName": { + "name": "abi_decode_string", + "nativeSrc": "30142:17:70", + "nodeType": "YulIdentifier", + "src": "30142:17:70" + }, + "nativeSrc": "30142:45:70", + "nodeType": "YulFunctionCall", + "src": "30142:45:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "30116:6:70", + "nodeType": "YulIdentifier", + "src": "30116:6:70" + }, + "nativeSrc": "30116:72:70", + "nodeType": "YulFunctionCall", + "src": "30116:72:70" + }, + "nativeSrc": "30116:72:70", + "nodeType": "YulExpressionStatement", + "src": "30116:72:70" + }, + { + "expression": { + "arguments": [ + { + "name": "value", + "nativeSrc": "30204:5:70", + "nodeType": "YulIdentifier", + "src": "30204:5:70" + }, + { + "name": "value_1", + "nativeSrc": "30211:7:70", + "nodeType": "YulIdentifier", + "src": "30211:7:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "30197:6:70", + "nodeType": "YulIdentifier", + "src": "30197:6:70" + }, + "nativeSrc": "30197:22:70", + "nodeType": "YulFunctionCall", + "src": "30197:22:70" + }, + "nativeSrc": "30197:22:70", + "nodeType": "YulExpressionStatement", + "src": "30197:22:70" + }, + { + "nativeSrc": "30228:41:70", + "nodeType": "YulVariableDeclaration", + "src": "30228:41:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "_1", + "nativeSrc": "30261:2:70", + "nodeType": "YulIdentifier", + "src": "30261:2:70" + }, + { + "kind": "number", + "nativeSrc": "30265:2:70", + "nodeType": "YulLiteral", + "src": "30265:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "30257:3:70", + "nodeType": "YulIdentifier", + "src": "30257:3:70" + }, + "nativeSrc": "30257:11:70", + "nodeType": "YulFunctionCall", + "src": "30257:11:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "30244:12:70", + "nodeType": "YulIdentifier", + "src": "30244:12:70" + }, + "nativeSrc": "30244:25:70", + "nodeType": "YulFunctionCall", + "src": "30244:25:70" + }, + "variables": [ + { + "name": "offset_3", + "nativeSrc": "30232:8:70", + "nodeType": "YulTypedName", + "src": "30232:8:70", + "type": "" + } + ] + }, + { + "body": { + "nativeSrc": "30314:16:70", + "nodeType": "YulBlock", + "src": "30314:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "30323:1:70", + "nodeType": "YulLiteral", + "src": "30323:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "30326:1:70", + "nodeType": "YulLiteral", + "src": "30326:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "30316:6:70", + "nodeType": "YulIdentifier", + "src": "30316:6:70" + }, + "nativeSrc": "30316:12:70", + "nodeType": "YulFunctionCall", + "src": "30316:12:70" + }, + "nativeSrc": "30316:12:70", + "nodeType": "YulExpressionStatement", + "src": "30316:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "name": "offset_3", + "nativeSrc": "30284:8:70", + "nodeType": "YulIdentifier", + "src": "30284:8:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "30302:2:70", + "nodeType": "YulLiteral", + "src": "30302:2:70", + "type": "", + "value": "64" + }, + { + "kind": "number", + "nativeSrc": "30306:1:70", + "nodeType": "YulLiteral", + "src": "30306:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "30298:3:70", + "nodeType": "YulIdentifier", + "src": "30298:3:70" + }, + "nativeSrc": "30298:10:70", + "nodeType": "YulFunctionCall", + "src": "30298:10:70" + }, + { + "kind": "number", + "nativeSrc": "30310:1:70", + "nodeType": "YulLiteral", + "src": "30310:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "30294:3:70", + "nodeType": "YulIdentifier", + "src": "30294:3:70" + }, + "nativeSrc": "30294:18:70", + "nodeType": "YulFunctionCall", + "src": "30294:18:70" + } + ], + "functionName": { + "name": "gt", + "nativeSrc": "30281:2:70", + "nodeType": "YulIdentifier", + "src": "30281:2:70" + }, + "nativeSrc": "30281:32:70", + "nodeType": "YulFunctionCall", + "src": "30281:32:70" + }, + "nativeSrc": "30278:52:70", + "nodeType": "YulIf", + "src": "30278:52:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "value", + "nativeSrc": "30350:5:70", + "nodeType": "YulIdentifier", + "src": "30350:5:70" + }, + { + "kind": "number", + "nativeSrc": "30357:2:70", + "nodeType": "YulLiteral", + "src": "30357:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "30346:3:70", + "nodeType": "YulIdentifier", + "src": "30346:3:70" + }, + "nativeSrc": "30346:14:70", + "nodeType": "YulFunctionCall", + "src": "30346:14:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "name": "_1", + "nativeSrc": "30384:2:70", + "nodeType": "YulIdentifier", + "src": "30384:2:70" + }, + { + "name": "offset_3", + "nativeSrc": "30388:8:70", + "nodeType": "YulIdentifier", + "src": "30388:8:70" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "30380:3:70", + "nodeType": "YulIdentifier", + "src": "30380:3:70" + }, + "nativeSrc": "30380:17:70", + "nodeType": "YulFunctionCall", + "src": "30380:17:70" + }, + { + "name": "dataEnd", + "nativeSrc": "30399:7:70", + "nodeType": "YulIdentifier", + "src": "30399:7:70" + } + ], + "functionName": { + "name": "abi_decode_string", + "nativeSrc": "30362:17:70", + "nodeType": "YulIdentifier", + "src": "30362:17:70" + }, + "nativeSrc": "30362:45:70", + "nodeType": "YulFunctionCall", + "src": "30362:45:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "30339:6:70", + "nodeType": "YulIdentifier", + "src": "30339:6:70" + }, + "nativeSrc": "30339:69:70", + "nodeType": "YulFunctionCall", + "src": "30339:69:70" + }, + "nativeSrc": "30339:69:70", + "nodeType": "YulExpressionStatement", + "src": "30339:69:70" + }, + { + "nativeSrc": "30417:15:70", + "nodeType": "YulAssignment", + "src": "30417:15:70", + "value": { + "name": "value", + "nativeSrc": "30427:5:70", + "nodeType": "YulIdentifier", + "src": "30427:5:70" + }, + "variableNames": [ + { + "name": "value0", + "nativeSrc": "30417:6:70", + "nodeType": "YulIdentifier", + "src": "30417:6:70" + } + ] + }, + { + "nativeSrc": "30441:16:70", + "nodeType": "YulVariableDeclaration", + "src": "30441:16:70", + "value": { + "kind": "number", + "nativeSrc": "30456:1:70", + "nodeType": "YulLiteral", + "src": "30456:1:70", + "type": "", + "value": "0" + }, + "variables": [ + { + "name": "value_3", + "nativeSrc": "30445:7:70", + "nodeType": "YulTypedName", + "src": "30445:7:70", + "type": "" + } + ] + }, + { + "nativeSrc": "30466:43:70", + "nodeType": "YulAssignment", + "src": "30466:43:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "30494:9:70", + "nodeType": "YulIdentifier", + "src": "30494:9:70" + }, + { + "kind": "number", + "nativeSrc": "30505:2:70", + "nodeType": "YulLiteral", + "src": "30505:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "30490:3:70", + "nodeType": "YulIdentifier", + "src": "30490:3:70" + }, + "nativeSrc": "30490:18:70", + "nodeType": "YulFunctionCall", + "src": "30490:18:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "30477:12:70", + "nodeType": "YulIdentifier", + "src": "30477:12:70" + }, + "nativeSrc": "30477:32:70", + "nodeType": "YulFunctionCall", + "src": "30477:32:70" + }, + "variableNames": [ + { + "name": "value_3", + "nativeSrc": "30466:7:70", + "nodeType": "YulIdentifier", + "src": "30466:7:70" + } + ] + }, + { + "nativeSrc": "30518:17:70", + "nodeType": "YulAssignment", + "src": "30518:17:70", + "value": { + "name": "value_3", + "nativeSrc": "30528:7:70", + "nodeType": "YulIdentifier", + "src": "30528:7:70" + }, + "variableNames": [ + { + "name": "value1", + "nativeSrc": "30518:6:70", + "nodeType": "YulIdentifier", + "src": "30518:6:70" + } + ] + } + ] + }, + "name": "abi_decode_tuple_t_struct$_SignedRAV_$2525_memory_ptrt_uint256", + "nativeSrc": "28913:1628:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "28985:9:70", + "nodeType": "YulTypedName", + "src": "28985:9:70", + "type": "" + }, + { + "name": "dataEnd", + "nativeSrc": "28996:7:70", + "nodeType": "YulTypedName", + "src": "28996:7:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value0", + "nativeSrc": "29008:6:70", + "nodeType": "YulTypedName", + "src": "29008:6:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "29016:6:70", + "nodeType": "YulTypedName", + "src": "29016:6:70", + "type": "" + } + ], + "src": "28913:1628:70" + }, + { + "body": { + "nativeSrc": "30736:207:70", + "nodeType": "YulBlock", + "src": "30736:207:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "name": "value0", + "nativeSrc": "30775:6:70", + "nodeType": "YulIdentifier", + "src": "30775:6:70" + }, + { + "name": "headStart", + "nativeSrc": "30783:9:70", + "nodeType": "YulIdentifier", + "src": "30783:9:70" + } + ], + "functionName": { + "name": "abi_encode_enum_PaymentTypes", + "nativeSrc": "30746:28:70", + "nodeType": "YulIdentifier", + "src": "30746:28:70" + }, + "nativeSrc": "30746:47:70", + "nodeType": "YulFunctionCall", + "src": "30746:47:70" + }, + "nativeSrc": "30746:47:70", + "nodeType": "YulExpressionStatement", + "src": "30746:47:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "30813:9:70", + "nodeType": "YulIdentifier", + "src": "30813:9:70" + }, + { + "kind": "number", + "nativeSrc": "30824:2:70", + "nodeType": "YulLiteral", + "src": "30824:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "30809:3:70", + "nodeType": "YulIdentifier", + "src": "30809:3:70" + }, + "nativeSrc": "30809:18:70", + "nodeType": "YulFunctionCall", + "src": "30809:18:70" + }, + { + "kind": "number", + "nativeSrc": "30829:2:70", + "nodeType": "YulLiteral", + "src": "30829:2:70", + "type": "", + "value": "96" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "30802:6:70", + "nodeType": "YulIdentifier", + "src": "30802:6:70" + }, + "nativeSrc": "30802:30:70", + "nodeType": "YulFunctionCall", + "src": "30802:30:70" + }, + "nativeSrc": "30802:30:70", + "nodeType": "YulExpressionStatement", + "src": "30802:30:70" + }, + { + "nativeSrc": "30841:53:70", + "nodeType": "YulAssignment", + "src": "30841:53:70", + "value": { + "arguments": [ + { + "name": "value1", + "nativeSrc": "30867:6:70", + "nodeType": "YulIdentifier", + "src": "30867:6:70" + }, + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "30879:9:70", + "nodeType": "YulIdentifier", + "src": "30879:9:70" + }, + { + "kind": "number", + "nativeSrc": "30890:2:70", + "nodeType": "YulLiteral", + "src": "30890:2:70", + "type": "", + "value": "96" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "30875:3:70", + "nodeType": "YulIdentifier", + "src": "30875:3:70" + }, + "nativeSrc": "30875:18:70", + "nodeType": "YulFunctionCall", + "src": "30875:18:70" + } + ], + "functionName": { + "name": "abi_encode_string", + "nativeSrc": "30849:17:70", + "nodeType": "YulIdentifier", + "src": "30849:17:70" + }, + "nativeSrc": "30849:45:70", + "nodeType": "YulFunctionCall", + "src": "30849:45:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "30841:4:70", + "nodeType": "YulIdentifier", + "src": "30841:4:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "30914:9:70", + "nodeType": "YulIdentifier", + "src": "30914:9:70" + }, + { + "kind": "number", + "nativeSrc": "30925:2:70", + "nodeType": "YulLiteral", + "src": "30925:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "30910:3:70", + "nodeType": "YulIdentifier", + "src": "30910:3:70" + }, + "nativeSrc": "30910:18:70", + "nodeType": "YulFunctionCall", + "src": "30910:18:70" + }, + { + "name": "value2", + "nativeSrc": "30930:6:70", + "nodeType": "YulIdentifier", + "src": "30930:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "30903:6:70", + "nodeType": "YulIdentifier", + "src": "30903:6:70" + }, + "nativeSrc": "30903:34:70", + "nodeType": "YulFunctionCall", + "src": "30903:34:70" + }, + "nativeSrc": "30903:34:70", + "nodeType": "YulExpressionStatement", + "src": "30903:34:70" + } + ] + }, + "name": "abi_encode_tuple_t_enum$_PaymentTypes_$2433_t_bytes_memory_ptr_t_uint256__to_t_uint8_t_bytes_memory_ptr_t_uint256__fromStack_reversed", + "nativeSrc": "30546:397:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "30689:9:70", + "nodeType": "YulTypedName", + "src": "30689:9:70", + "type": "" + }, + { + "name": "value2", + "nativeSrc": "30700:6:70", + "nodeType": "YulTypedName", + "src": "30700:6:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "30708:6:70", + "nodeType": "YulTypedName", + "src": "30708:6:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "30716:6:70", + "nodeType": "YulTypedName", + "src": "30716:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "30727:4:70", + "nodeType": "YulTypedName", + "src": "30727:4:70", + "type": "" + } + ], + "src": "30546:397:70" + }, + { + "body": { + "nativeSrc": "31000:116:70", + "nodeType": "YulBlock", + "src": "31000:116:70", + "statements": [ + { + "nativeSrc": "31010:20:70", + "nodeType": "YulAssignment", + "src": "31010:20:70", + "value": { + "arguments": [ + { + "name": "x", + "nativeSrc": "31025:1:70", + "nodeType": "YulIdentifier", + "src": "31025:1:70" + }, + { + "name": "y", + "nativeSrc": "31028:1:70", + "nodeType": "YulIdentifier", + "src": "31028:1:70" + } + ], + "functionName": { + "name": "mul", + "nativeSrc": "31021:3:70", + "nodeType": "YulIdentifier", + "src": "31021:3:70" + }, + "nativeSrc": "31021:9:70", + "nodeType": "YulFunctionCall", + "src": "31021:9:70" + }, + "variableNames": [ + { + "name": "product", + "nativeSrc": "31010:7:70", + "nodeType": "YulIdentifier", + "src": "31010:7:70" + } + ] + }, + { + "body": { + "nativeSrc": "31088:22:70", + "nodeType": "YulBlock", + "src": "31088:22:70", + "statements": [ + { + "expression": { + "arguments": [], + "functionName": { + "name": "panic_error_0x11", + "nativeSrc": "31090:16:70", + "nodeType": "YulIdentifier", + "src": "31090:16:70" + }, + "nativeSrc": "31090:18:70", + "nodeType": "YulFunctionCall", + "src": "31090:18:70" + }, + "nativeSrc": "31090:18:70", + "nodeType": "YulExpressionStatement", + "src": "31090:18:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "arguments": [ + { + "name": "x", + "nativeSrc": "31059:1:70", + "nodeType": "YulIdentifier", + "src": "31059:1:70" + } + ], + "functionName": { + "name": "iszero", + "nativeSrc": "31052:6:70", + "nodeType": "YulIdentifier", + "src": "31052:6:70" + }, + "nativeSrc": "31052:9:70", + "nodeType": "YulFunctionCall", + "src": "31052:9:70" + }, + { + "arguments": [ + { + "name": "y", + "nativeSrc": "31066:1:70", + "nodeType": "YulIdentifier", + "src": "31066:1:70" + }, + { + "arguments": [ + { + "name": "product", + "nativeSrc": "31073:7:70", + "nodeType": "YulIdentifier", + "src": "31073:7:70" + }, + { + "name": "x", + "nativeSrc": "31082:1:70", + "nodeType": "YulIdentifier", + "src": "31082:1:70" + } + ], + "functionName": { + "name": "div", + "nativeSrc": "31069:3:70", + "nodeType": "YulIdentifier", + "src": "31069:3:70" + }, + "nativeSrc": "31069:15:70", + "nodeType": "YulFunctionCall", + "src": "31069:15:70" + } + ], + "functionName": { + "name": "eq", + "nativeSrc": "31063:2:70", + "nodeType": "YulIdentifier", + "src": "31063:2:70" + }, + "nativeSrc": "31063:22:70", + "nodeType": "YulFunctionCall", + "src": "31063:22:70" + } + ], + "functionName": { + "name": "or", + "nativeSrc": "31049:2:70", + "nodeType": "YulIdentifier", + "src": "31049:2:70" + }, + "nativeSrc": "31049:37:70", + "nodeType": "YulFunctionCall", + "src": "31049:37:70" + } + ], + "functionName": { + "name": "iszero", + "nativeSrc": "31042:6:70", + "nodeType": "YulIdentifier", + "src": "31042:6:70" + }, + "nativeSrc": "31042:45:70", + "nodeType": "YulFunctionCall", + "src": "31042:45:70" + }, + "nativeSrc": "31039:71:70", + "nodeType": "YulIf", + "src": "31039:71:70" + } + ] + }, + "name": "checked_mul_t_uint256", + "nativeSrc": "30948:168:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "x", + "nativeSrc": "30979:1:70", + "nodeType": "YulTypedName", + "src": "30979:1:70", + "type": "" + }, + { + "name": "y", + "nativeSrc": "30982:1:70", + "nodeType": "YulTypedName", + "src": "30982:1:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "product", + "nativeSrc": "30988:7:70", + "nodeType": "YulTypedName", + "src": "30988:7:70", + "type": "" + } + ], + "src": "30948:168:70" + }, + { + "body": { + "nativeSrc": "31250:119:70", + "nodeType": "YulBlock", + "src": "31250:119:70", + "statements": [ + { + "nativeSrc": "31260:26:70", + "nodeType": "YulAssignment", + "src": "31260:26:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "31272:9:70", + "nodeType": "YulIdentifier", + "src": "31272:9:70" + }, + { + "kind": "number", + "nativeSrc": "31283:2:70", + "nodeType": "YulLiteral", + "src": "31283:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "31268:3:70", + "nodeType": "YulIdentifier", + "src": "31268:3:70" + }, + "nativeSrc": "31268:18:70", + "nodeType": "YulFunctionCall", + "src": "31268:18:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "31260:4:70", + "nodeType": "YulIdentifier", + "src": "31260:4:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "31302:9:70", + "nodeType": "YulIdentifier", + "src": "31302:9:70" + }, + { + "name": "value0", + "nativeSrc": "31313:6:70", + "nodeType": "YulIdentifier", + "src": "31313:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "31295:6:70", + "nodeType": "YulIdentifier", + "src": "31295:6:70" + }, + "nativeSrc": "31295:25:70", + "nodeType": "YulFunctionCall", + "src": "31295:25:70" + }, + "nativeSrc": "31295:25:70", + "nodeType": "YulExpressionStatement", + "src": "31295:25:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "31340:9:70", + "nodeType": "YulIdentifier", + "src": "31340:9:70" + }, + { + "kind": "number", + "nativeSrc": "31351:2:70", + "nodeType": "YulLiteral", + "src": "31351:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "31336:3:70", + "nodeType": "YulIdentifier", + "src": "31336:3:70" + }, + "nativeSrc": "31336:18:70", + "nodeType": "YulFunctionCall", + "src": "31336:18:70" + }, + { + "name": "value1", + "nativeSrc": "31356:6:70", + "nodeType": "YulIdentifier", + "src": "31356:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "31329:6:70", + "nodeType": "YulIdentifier", + "src": "31329:6:70" + }, + "nativeSrc": "31329:34:70", + "nodeType": "YulFunctionCall", + "src": "31329:34:70" + }, + "nativeSrc": "31329:34:70", + "nodeType": "YulExpressionStatement", + "src": "31329:34:70" + } + ] + }, + "name": "abi_encode_tuple_t_bytes32_t_uint256__to_t_bytes32_t_uint256__fromStack_reversed", + "nativeSrc": "31121:248:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "31211:9:70", + "nodeType": "YulTypedName", + "src": "31211:9:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "31222:6:70", + "nodeType": "YulTypedName", + "src": "31222:6:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "31230:6:70", + "nodeType": "YulTypedName", + "src": "31230:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "31241:4:70", + "nodeType": "YulTypedName", + "src": "31241:4:70", + "type": "" + } + ], + "src": "31121:248:70" + }, + { + "body": { + "nativeSrc": "31531:162:70", + "nodeType": "YulBlock", + "src": "31531:162:70", + "statements": [ + { + "nativeSrc": "31541:26:70", + "nodeType": "YulAssignment", + "src": "31541:26:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "31553:9:70", + "nodeType": "YulIdentifier", + "src": "31553:9:70" + }, + { + "kind": "number", + "nativeSrc": "31564:2:70", + "nodeType": "YulLiteral", + "src": "31564:2:70", + "type": "", + "value": "96" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "31549:3:70", + "nodeType": "YulIdentifier", + "src": "31549:3:70" + }, + "nativeSrc": "31549:18:70", + "nodeType": "YulFunctionCall", + "src": "31549:18:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "31541:4:70", + "nodeType": "YulIdentifier", + "src": "31541:4:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "31583:9:70", + "nodeType": "YulIdentifier", + "src": "31583:9:70" + }, + { + "name": "value0", + "nativeSrc": "31594:6:70", + "nodeType": "YulIdentifier", + "src": "31594:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "31576:6:70", + "nodeType": "YulIdentifier", + "src": "31576:6:70" + }, + "nativeSrc": "31576:25:70", + "nodeType": "YulFunctionCall", + "src": "31576:25:70" + }, + "nativeSrc": "31576:25:70", + "nodeType": "YulExpressionStatement", + "src": "31576:25:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "31621:9:70", + "nodeType": "YulIdentifier", + "src": "31621:9:70" + }, + { + "kind": "number", + "nativeSrc": "31632:2:70", + "nodeType": "YulLiteral", + "src": "31632:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "31617:3:70", + "nodeType": "YulIdentifier", + "src": "31617:3:70" + }, + "nativeSrc": "31617:18:70", + "nodeType": "YulFunctionCall", + "src": "31617:18:70" + }, + { + "name": "value1", + "nativeSrc": "31637:6:70", + "nodeType": "YulIdentifier", + "src": "31637:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "31610:6:70", + "nodeType": "YulIdentifier", + "src": "31610:6:70" + }, + "nativeSrc": "31610:34:70", + "nodeType": "YulFunctionCall", + "src": "31610:34:70" + }, + "nativeSrc": "31610:34:70", + "nodeType": "YulExpressionStatement", + "src": "31610:34:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "31664:9:70", + "nodeType": "YulIdentifier", + "src": "31664:9:70" + }, + { + "kind": "number", + "nativeSrc": "31675:2:70", + "nodeType": "YulLiteral", + "src": "31675:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "31660:3:70", + "nodeType": "YulIdentifier", + "src": "31660:3:70" + }, + "nativeSrc": "31660:18:70", + "nodeType": "YulFunctionCall", + "src": "31660:18:70" + }, + { + "name": "value2", + "nativeSrc": "31680:6:70", + "nodeType": "YulIdentifier", + "src": "31680:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "31653:6:70", + "nodeType": "YulIdentifier", + "src": "31653:6:70" + }, + "nativeSrc": "31653:34:70", + "nodeType": "YulFunctionCall", + "src": "31653:34:70" + }, + "nativeSrc": "31653:34:70", + "nodeType": "YulExpressionStatement", + "src": "31653:34:70" + } + ] + }, + "name": "abi_encode_tuple_t_bytes32_t_uint256_t_uint256__to_t_bytes32_t_uint256_t_uint256__fromStack_reversed", + "nativeSrc": "31374:319:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "31484:9:70", + "nodeType": "YulTypedName", + "src": "31484:9:70", + "type": "" + }, + { + "name": "value2", + "nativeSrc": "31495:6:70", + "nodeType": "YulTypedName", + "src": "31495:6:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "31503:6:70", + "nodeType": "YulTypedName", + "src": "31503:6:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "31511:6:70", + "nodeType": "YulTypedName", + "src": "31511:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "31522:4:70", + "nodeType": "YulTypedName", + "src": "31522:4:70", + "type": "" + } + ], + "src": "31374:319:70" + }, + { + "body": { + "nativeSrc": "31819:463:70", + "nodeType": "YulBlock", + "src": "31819:463:70", + "statements": [ + { + "body": { + "nativeSrc": "31865:16:70", + "nodeType": "YulBlock", + "src": "31865:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "31874:1:70", + "nodeType": "YulLiteral", + "src": "31874:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "31877:1:70", + "nodeType": "YulLiteral", + "src": "31877:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "31867:6:70", + "nodeType": "YulIdentifier", + "src": "31867:6:70" + }, + "nativeSrc": "31867:12:70", + "nodeType": "YulFunctionCall", + "src": "31867:12:70" + }, + "nativeSrc": "31867:12:70", + "nodeType": "YulExpressionStatement", + "src": "31867:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "dataEnd", + "nativeSrc": "31840:7:70", + "nodeType": "YulIdentifier", + "src": "31840:7:70" + }, + { + "name": "headStart", + "nativeSrc": "31849:9:70", + "nodeType": "YulIdentifier", + "src": "31849:9:70" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "31836:3:70", + "nodeType": "YulIdentifier", + "src": "31836:3:70" + }, + "nativeSrc": "31836:23:70", + "nodeType": "YulFunctionCall", + "src": "31836:23:70" + }, + { + "kind": "number", + "nativeSrc": "31861:2:70", + "nodeType": "YulLiteral", + "src": "31861:2:70", + "type": "", + "value": "96" + } + ], + "functionName": { + "name": "slt", + "nativeSrc": "31832:3:70", + "nodeType": "YulIdentifier", + "src": "31832:3:70" + }, + "nativeSrc": "31832:32:70", + "nodeType": "YulFunctionCall", + "src": "31832:32:70" + }, + "nativeSrc": "31829:52:70", + "nodeType": "YulIf", + "src": "31829:52:70" + }, + { + "nativeSrc": "31890:36:70", + "nodeType": "YulVariableDeclaration", + "src": "31890:36:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "31916:9:70", + "nodeType": "YulIdentifier", + "src": "31916:9:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "31903:12:70", + "nodeType": "YulIdentifier", + "src": "31903:12:70" + }, + "nativeSrc": "31903:23:70", + "nodeType": "YulFunctionCall", + "src": "31903:23:70" + }, + "variables": [ + { + "name": "value", + "nativeSrc": "31894:5:70", + "nodeType": "YulTypedName", + "src": "31894:5:70", + "type": "" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "value", + "nativeSrc": "31960:5:70", + "nodeType": "YulIdentifier", + "src": "31960:5:70" + } + ], + "functionName": { + "name": "validator_revert_address", + "nativeSrc": "31935:24:70", + "nodeType": "YulIdentifier", + "src": "31935:24:70" + }, + "nativeSrc": "31935:31:70", + "nodeType": "YulFunctionCall", + "src": "31935:31:70" + }, + "nativeSrc": "31935:31:70", + "nodeType": "YulExpressionStatement", + "src": "31935:31:70" + }, + { + "nativeSrc": "31975:15:70", + "nodeType": "YulAssignment", + "src": "31975:15:70", + "value": { + "name": "value", + "nativeSrc": "31985:5:70", + "nodeType": "YulIdentifier", + "src": "31985:5:70" + }, + "variableNames": [ + { + "name": "value0", + "nativeSrc": "31975:6:70", + "nodeType": "YulIdentifier", + "src": "31975:6:70" + } + ] + }, + { + "nativeSrc": "31999:16:70", + "nodeType": "YulVariableDeclaration", + "src": "31999:16:70", + "value": { + "kind": "number", + "nativeSrc": "32014:1:70", + "nodeType": "YulLiteral", + "src": "32014:1:70", + "type": "", + "value": "0" + }, + "variables": [ + { + "name": "value_1", + "nativeSrc": "32003:7:70", + "nodeType": "YulTypedName", + "src": "32003:7:70", + "type": "" + } + ] + }, + { + "nativeSrc": "32024:43:70", + "nodeType": "YulAssignment", + "src": "32024:43:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "32052:9:70", + "nodeType": "YulIdentifier", + "src": "32052:9:70" + }, + { + "kind": "number", + "nativeSrc": "32063:2:70", + "nodeType": "YulLiteral", + "src": "32063:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "32048:3:70", + "nodeType": "YulIdentifier", + "src": "32048:3:70" + }, + "nativeSrc": "32048:18:70", + "nodeType": "YulFunctionCall", + "src": "32048:18:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "32035:12:70", + "nodeType": "YulIdentifier", + "src": "32035:12:70" + }, + "nativeSrc": "32035:32:70", + "nodeType": "YulFunctionCall", + "src": "32035:32:70" + }, + "variableNames": [ + { + "name": "value_1", + "nativeSrc": "32024:7:70", + "nodeType": "YulIdentifier", + "src": "32024:7:70" + } + ] + }, + { + "nativeSrc": "32076:17:70", + "nodeType": "YulAssignment", + "src": "32076:17:70", + "value": { + "name": "value_1", + "nativeSrc": "32086:7:70", + "nodeType": "YulIdentifier", + "src": "32086:7:70" + }, + "variableNames": [ + { + "name": "value1", + "nativeSrc": "32076:6:70", + "nodeType": "YulIdentifier", + "src": "32076:6:70" + } + ] + }, + { + "nativeSrc": "32102:46:70", + "nodeType": "YulVariableDeclaration", + "src": "32102:46:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "32133:9:70", + "nodeType": "YulIdentifier", + "src": "32133:9:70" + }, + { + "kind": "number", + "nativeSrc": "32144:2:70", + "nodeType": "YulLiteral", + "src": "32144:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "32129:3:70", + "nodeType": "YulIdentifier", + "src": "32129:3:70" + }, + "nativeSrc": "32129:18:70", + "nodeType": "YulFunctionCall", + "src": "32129:18:70" + } + ], + "functionName": { + "name": "calldataload", + "nativeSrc": "32116:12:70", + "nodeType": "YulIdentifier", + "src": "32116:12:70" + }, + "nativeSrc": "32116:32:70", + "nodeType": "YulFunctionCall", + "src": "32116:32:70" + }, + "variables": [ + { + "name": "offset", + "nativeSrc": "32106:6:70", + "nodeType": "YulTypedName", + "src": "32106:6:70", + "type": "" + } + ] + }, + { + "body": { + "nativeSrc": "32191:16:70", + "nodeType": "YulBlock", + "src": "32191:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "32200:1:70", + "nodeType": "YulLiteral", + "src": "32200:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "32203:1:70", + "nodeType": "YulLiteral", + "src": "32203:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "32193:6:70", + "nodeType": "YulIdentifier", + "src": "32193:6:70" + }, + "nativeSrc": "32193:12:70", + "nodeType": "YulFunctionCall", + "src": "32193:12:70" + }, + "nativeSrc": "32193:12:70", + "nodeType": "YulExpressionStatement", + "src": "32193:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "name": "offset", + "nativeSrc": "32163:6:70", + "nodeType": "YulIdentifier", + "src": "32163:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "32179:2:70", + "nodeType": "YulLiteral", + "src": "32179:2:70", + "type": "", + "value": "64" + }, + { + "kind": "number", + "nativeSrc": "32183:1:70", + "nodeType": "YulLiteral", + "src": "32183:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "32175:3:70", + "nodeType": "YulIdentifier", + "src": "32175:3:70" + }, + "nativeSrc": "32175:10:70", + "nodeType": "YulFunctionCall", + "src": "32175:10:70" + }, + { + "kind": "number", + "nativeSrc": "32187:1:70", + "nodeType": "YulLiteral", + "src": "32187:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "32171:3:70", + "nodeType": "YulIdentifier", + "src": "32171:3:70" + }, + "nativeSrc": "32171:18:70", + "nodeType": "YulFunctionCall", + "src": "32171:18:70" + } + ], + "functionName": { + "name": "gt", + "nativeSrc": "32160:2:70", + "nodeType": "YulIdentifier", + "src": "32160:2:70" + }, + "nativeSrc": "32160:30:70", + "nodeType": "YulFunctionCall", + "src": "32160:30:70" + }, + "nativeSrc": "32157:50:70", + "nodeType": "YulIf", + "src": "32157:50:70" + }, + { + "nativeSrc": "32216:60:70", + "nodeType": "YulAssignment", + "src": "32216:60:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "32248:9:70", + "nodeType": "YulIdentifier", + "src": "32248:9:70" + }, + { + "name": "offset", + "nativeSrc": "32259:6:70", + "nodeType": "YulIdentifier", + "src": "32259:6:70" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "32244:3:70", + "nodeType": "YulIdentifier", + "src": "32244:3:70" + }, + "nativeSrc": "32244:22:70", + "nodeType": "YulFunctionCall", + "src": "32244:22:70" + }, + { + "name": "dataEnd", + "nativeSrc": "32268:7:70", + "nodeType": "YulIdentifier", + "src": "32268:7:70" + } + ], + "functionName": { + "name": "abi_decode_string", + "nativeSrc": "32226:17:70", + "nodeType": "YulIdentifier", + "src": "32226:17:70" + }, + "nativeSrc": "32226:50:70", + "nodeType": "YulFunctionCall", + "src": "32226:50:70" + }, + "variableNames": [ + { + "name": "value2", + "nativeSrc": "32216:6:70", + "nodeType": "YulIdentifier", + "src": "32216:6:70" + } + ] + } + ] + }, + "name": "abi_decode_tuple_t_address_payablet_bytes32t_bytes_memory_ptr", + "nativeSrc": "31698:584:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "31769:9:70", + "nodeType": "YulTypedName", + "src": "31769:9:70", + "type": "" + }, + { + "name": "dataEnd", + "nativeSrc": "31780:7:70", + "nodeType": "YulTypedName", + "src": "31780:7:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value0", + "nativeSrc": "31792:6:70", + "nodeType": "YulTypedName", + "src": "31792:6:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "31800:6:70", + "nodeType": "YulTypedName", + "src": "31800:6:70", + "type": "" + }, + { + "name": "value2", + "nativeSrc": "31808:6:70", + "nodeType": "YulTypedName", + "src": "31808:6:70", + "type": "" + } + ], + "src": "31698:584:70" + }, + { + "body": { + "nativeSrc": "32444:214:70", + "nodeType": "YulBlock", + "src": "32444:214:70", + "statements": [ + { + "nativeSrc": "32454:26:70", + "nodeType": "YulAssignment", + "src": "32454:26:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "32466:9:70", + "nodeType": "YulIdentifier", + "src": "32466:9:70" + }, + { + "kind": "number", + "nativeSrc": "32477:2:70", + "nodeType": "YulLiteral", + "src": "32477:2:70", + "type": "", + "value": "96" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "32462:3:70", + "nodeType": "YulIdentifier", + "src": "32462:3:70" + }, + "nativeSrc": "32462:18:70", + "nodeType": "YulFunctionCall", + "src": "32462:18:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "32454:4:70", + "nodeType": "YulIdentifier", + "src": "32454:4:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "32496:9:70", + "nodeType": "YulIdentifier", + "src": "32496:9:70" + }, + { + "name": "value0", + "nativeSrc": "32507:6:70", + "nodeType": "YulIdentifier", + "src": "32507:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "32489:6:70", + "nodeType": "YulIdentifier", + "src": "32489:6:70" + }, + "nativeSrc": "32489:25:70", + "nodeType": "YulFunctionCall", + "src": "32489:25:70" + }, + "nativeSrc": "32489:25:70", + "nodeType": "YulExpressionStatement", + "src": "32489:25:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "32534:9:70", + "nodeType": "YulIdentifier", + "src": "32534:9:70" + }, + { + "kind": "number", + "nativeSrc": "32545:2:70", + "nodeType": "YulLiteral", + "src": "32545:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "32530:3:70", + "nodeType": "YulIdentifier", + "src": "32530:3:70" + }, + "nativeSrc": "32530:18:70", + "nodeType": "YulFunctionCall", + "src": "32530:18:70" + }, + { + "arguments": [ + { + "name": "value1", + "nativeSrc": "32554:6:70", + "nodeType": "YulIdentifier", + "src": "32554:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "32570:3:70", + "nodeType": "YulLiteral", + "src": "32570:3:70", + "type": "", + "value": "160" + }, + { + "kind": "number", + "nativeSrc": "32575:1:70", + "nodeType": "YulLiteral", + "src": "32575:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "32566:3:70", + "nodeType": "YulIdentifier", + "src": "32566:3:70" + }, + "nativeSrc": "32566:11:70", + "nodeType": "YulFunctionCall", + "src": "32566:11:70" + }, + { + "kind": "number", + "nativeSrc": "32579:1:70", + "nodeType": "YulLiteral", + "src": "32579:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "32562:3:70", + "nodeType": "YulIdentifier", + "src": "32562:3:70" + }, + "nativeSrc": "32562:19:70", + "nodeType": "YulFunctionCall", + "src": "32562:19:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "32550:3:70", + "nodeType": "YulIdentifier", + "src": "32550:3:70" + }, + "nativeSrc": "32550:32:70", + "nodeType": "YulFunctionCall", + "src": "32550:32:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "32523:6:70", + "nodeType": "YulIdentifier", + "src": "32523:6:70" + }, + "nativeSrc": "32523:60:70", + "nodeType": "YulFunctionCall", + "src": "32523:60:70" + }, + "nativeSrc": "32523:60:70", + "nodeType": "YulExpressionStatement", + "src": "32523:60:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "32603:9:70", + "nodeType": "YulIdentifier", + "src": "32603:9:70" + }, + { + "kind": "number", + "nativeSrc": "32614:2:70", + "nodeType": "YulLiteral", + "src": "32614:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "32599:3:70", + "nodeType": "YulIdentifier", + "src": "32599:3:70" + }, + "nativeSrc": "32599:18:70", + "nodeType": "YulFunctionCall", + "src": "32599:18:70" + }, + { + "arguments": [ + { + "name": "value2", + "nativeSrc": "32623:6:70", + "nodeType": "YulIdentifier", + "src": "32623:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "32639:3:70", + "nodeType": "YulLiteral", + "src": "32639:3:70", + "type": "", + "value": "160" + }, + { + "kind": "number", + "nativeSrc": "32644:1:70", + "nodeType": "YulLiteral", + "src": "32644:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "32635:3:70", + "nodeType": "YulIdentifier", + "src": "32635:3:70" + }, + "nativeSrc": "32635:11:70", + "nodeType": "YulFunctionCall", + "src": "32635:11:70" + }, + { + "kind": "number", + "nativeSrc": "32648:1:70", + "nodeType": "YulLiteral", + "src": "32648:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "32631:3:70", + "nodeType": "YulIdentifier", + "src": "32631:3:70" + }, + "nativeSrc": "32631:19:70", + "nodeType": "YulFunctionCall", + "src": "32631:19:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "32619:3:70", + "nodeType": "YulIdentifier", + "src": "32619:3:70" + }, + "nativeSrc": "32619:32:70", + "nodeType": "YulFunctionCall", + "src": "32619:32:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "32592:6:70", + "nodeType": "YulIdentifier", + "src": "32592:6:70" + }, + "nativeSrc": "32592:60:70", + "nodeType": "YulFunctionCall", + "src": "32592:60:70" + }, + "nativeSrc": "32592:60:70", + "nodeType": "YulExpressionStatement", + "src": "32592:60:70" + } + ] + }, + "name": "abi_encode_tuple_t_bytes32_t_address_t_address__to_t_bytes32_t_address_t_address__fromStack_reversed", + "nativeSrc": "32287:371:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "32397:9:70", + "nodeType": "YulTypedName", + "src": "32397:9:70", + "type": "" + }, + { + "name": "value2", + "nativeSrc": "32408:6:70", + "nodeType": "YulTypedName", + "src": "32408:6:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "32416:6:70", + "nodeType": "YulTypedName", + "src": "32416:6:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "32424:6:70", + "nodeType": "YulTypedName", + "src": "32424:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "32435:4:70", + "nodeType": "YulTypedName", + "src": "32435:4:70", + "type": "" + } + ], + "src": "32287:371:70" + }, + { + "body": { + "nativeSrc": "32866:230:70", + "nodeType": "YulBlock", + "src": "32866:230:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "32883:9:70", + "nodeType": "YulIdentifier", + "src": "32883:9:70" + }, + { + "kind": "number", + "nativeSrc": "32894:3:70", + "nodeType": "YulLiteral", + "src": "32894:3:70", + "type": "", + "value": "128" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "32876:6:70", + "nodeType": "YulIdentifier", + "src": "32876:6:70" + }, + "nativeSrc": "32876:22:70", + "nodeType": "YulFunctionCall", + "src": "32876:22:70" + }, + "nativeSrc": "32876:22:70", + "nodeType": "YulExpressionStatement", + "src": "32876:22:70" + }, + { + "nativeSrc": "32907:54:70", + "nodeType": "YulAssignment", + "src": "32907:54:70", + "value": { + "arguments": [ + { + "name": "value0", + "nativeSrc": "32933:6:70", + "nodeType": "YulIdentifier", + "src": "32933:6:70" + }, + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "32945:9:70", + "nodeType": "YulIdentifier", + "src": "32945:9:70" + }, + { + "kind": "number", + "nativeSrc": "32956:3:70", + "nodeType": "YulLiteral", + "src": "32956:3:70", + "type": "", + "value": "128" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "32941:3:70", + "nodeType": "YulIdentifier", + "src": "32941:3:70" + }, + "nativeSrc": "32941:19:70", + "nodeType": "YulFunctionCall", + "src": "32941:19:70" + } + ], + "functionName": { + "name": "abi_encode_string", + "nativeSrc": "32915:17:70", + "nodeType": "YulIdentifier", + "src": "32915:17:70" + }, + "nativeSrc": "32915:46:70", + "nodeType": "YulFunctionCall", + "src": "32915:46:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "32907:4:70", + "nodeType": "YulIdentifier", + "src": "32907:4:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "32981:9:70", + "nodeType": "YulIdentifier", + "src": "32981:9:70" + }, + { + "kind": "number", + "nativeSrc": "32992:2:70", + "nodeType": "YulLiteral", + "src": "32992:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "32977:3:70", + "nodeType": "YulIdentifier", + "src": "32977:3:70" + }, + "nativeSrc": "32977:18:70", + "nodeType": "YulFunctionCall", + "src": "32977:18:70" + }, + { + "name": "value1", + "nativeSrc": "32997:6:70", + "nodeType": "YulIdentifier", + "src": "32997:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "32970:6:70", + "nodeType": "YulIdentifier", + "src": "32970:6:70" + }, + "nativeSrc": "32970:34:70", + "nodeType": "YulFunctionCall", + "src": "32970:34:70" + }, + "nativeSrc": "32970:34:70", + "nodeType": "YulExpressionStatement", + "src": "32970:34:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "33024:9:70", + "nodeType": "YulIdentifier", + "src": "33024:9:70" + }, + { + "kind": "number", + "nativeSrc": "33035:2:70", + "nodeType": "YulLiteral", + "src": "33035:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "33020:3:70", + "nodeType": "YulIdentifier", + "src": "33020:3:70" + }, + "nativeSrc": "33020:18:70", + "nodeType": "YulFunctionCall", + "src": "33020:18:70" + }, + { + "name": "value2", + "nativeSrc": "33040:6:70", + "nodeType": "YulIdentifier", + "src": "33040:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "33013:6:70", + "nodeType": "YulIdentifier", + "src": "33013:6:70" + }, + "nativeSrc": "33013:34:70", + "nodeType": "YulFunctionCall", + "src": "33013:34:70" + }, + "nativeSrc": "33013:34:70", + "nodeType": "YulExpressionStatement", + "src": "33013:34:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "33067:9:70", + "nodeType": "YulIdentifier", + "src": "33067:9:70" + }, + { + "kind": "number", + "nativeSrc": "33078:2:70", + "nodeType": "YulLiteral", + "src": "33078:2:70", + "type": "", + "value": "96" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "33063:3:70", + "nodeType": "YulIdentifier", + "src": "33063:3:70" + }, + "nativeSrc": "33063:18:70", + "nodeType": "YulFunctionCall", + "src": "33063:18:70" + }, + { + "name": "value3", + "nativeSrc": "33083:6:70", + "nodeType": "YulIdentifier", + "src": "33083:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "33056:6:70", + "nodeType": "YulIdentifier", + "src": "33056:6:70" + }, + "nativeSrc": "33056:34:70", + "nodeType": "YulFunctionCall", + "src": "33056:34:70" + }, + "nativeSrc": "33056:34:70", + "nodeType": "YulExpressionStatement", + "src": "33056:34:70" + } + ] + }, + "name": "abi_encode_tuple_t_bytes_memory_ptr_t_uint256_t_uint256_t_uint256__to_t_bytes_memory_ptr_t_uint256_t_uint256_t_uint256__fromStack_reversed", + "nativeSrc": "32663:433:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "32811:9:70", + "nodeType": "YulTypedName", + "src": "32811:9:70", + "type": "" + }, + { + "name": "value3", + "nativeSrc": "32822:6:70", + "nodeType": "YulTypedName", + "src": "32822:6:70", + "type": "" + }, + { + "name": "value2", + "nativeSrc": "32830:6:70", + "nodeType": "YulTypedName", + "src": "32830:6:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "32838:6:70", + "nodeType": "YulTypedName", + "src": "32838:6:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "32846:6:70", + "nodeType": "YulTypedName", + "src": "32846:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "32857:4:70", + "nodeType": "YulTypedName", + "src": "32857:4:70", + "type": "" + } + ], + "src": "32663:433:70" + }, + { + "body": { + "nativeSrc": "33207:266:70", + "nodeType": "YulBlock", + "src": "33207:266:70", + "statements": [ + { + "body": { + "nativeSrc": "33253:16:70", + "nodeType": "YulBlock", + "src": "33253:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "33262:1:70", + "nodeType": "YulLiteral", + "src": "33262:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "33265:1:70", + "nodeType": "YulLiteral", + "src": "33265:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "33255:6:70", + "nodeType": "YulIdentifier", + "src": "33255:6:70" + }, + "nativeSrc": "33255:12:70", + "nodeType": "YulFunctionCall", + "src": "33255:12:70" + }, + "nativeSrc": "33255:12:70", + "nodeType": "YulExpressionStatement", + "src": "33255:12:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "dataEnd", + "nativeSrc": "33228:7:70", + "nodeType": "YulIdentifier", + "src": "33228:7:70" + }, + { + "name": "headStart", + "nativeSrc": "33237:9:70", + "nodeType": "YulIdentifier", + "src": "33237:9:70" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "33224:3:70", + "nodeType": "YulIdentifier", + "src": "33224:3:70" + }, + "nativeSrc": "33224:23:70", + "nodeType": "YulFunctionCall", + "src": "33224:23:70" + }, + { + "kind": "number", + "nativeSrc": "33249:2:70", + "nodeType": "YulLiteral", + "src": "33249:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "slt", + "nativeSrc": "33220:3:70", + "nodeType": "YulIdentifier", + "src": "33220:3:70" + }, + "nativeSrc": "33220:32:70", + "nodeType": "YulFunctionCall", + "src": "33220:32:70" + }, + "nativeSrc": "33217:52:70", + "nodeType": "YulIf", + "src": "33217:52:70" + }, + { + "nativeSrc": "33278:14:70", + "nodeType": "YulVariableDeclaration", + "src": "33278:14:70", + "value": { + "kind": "number", + "nativeSrc": "33291:1:70", + "nodeType": "YulLiteral", + "src": "33291:1:70", + "type": "", + "value": "0" + }, + "variables": [ + { + "name": "value", + "nativeSrc": "33282:5:70", + "nodeType": "YulTypedName", + "src": "33282:5:70", + "type": "" + } + ] + }, + { + "nativeSrc": "33301:25:70", + "nodeType": "YulAssignment", + "src": "33301:25:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "33316:9:70", + "nodeType": "YulIdentifier", + "src": "33316:9:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "33310:5:70", + "nodeType": "YulIdentifier", + "src": "33310:5:70" + }, + "nativeSrc": "33310:16:70", + "nodeType": "YulFunctionCall", + "src": "33310:16:70" + }, + "variableNames": [ + { + "name": "value", + "nativeSrc": "33301:5:70", + "nodeType": "YulIdentifier", + "src": "33301:5:70" + } + ] + }, + { + "nativeSrc": "33335:15:70", + "nodeType": "YulAssignment", + "src": "33335:15:70", + "value": { + "name": "value", + "nativeSrc": "33345:5:70", + "nodeType": "YulIdentifier", + "src": "33345:5:70" + }, + "variableNames": [ + { + "name": "value0", + "nativeSrc": "33335:6:70", + "nodeType": "YulIdentifier", + "src": "33335:6:70" + } + ] + }, + { + "nativeSrc": "33359:40:70", + "nodeType": "YulVariableDeclaration", + "src": "33359:40:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "33384:9:70", + "nodeType": "YulIdentifier", + "src": "33384:9:70" + }, + { + "kind": "number", + "nativeSrc": "33395:2:70", + "nodeType": "YulLiteral", + "src": "33395:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "33380:3:70", + "nodeType": "YulIdentifier", + "src": "33380:3:70" + }, + "nativeSrc": "33380:18:70", + "nodeType": "YulFunctionCall", + "src": "33380:18:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "33374:5:70", + "nodeType": "YulIdentifier", + "src": "33374:5:70" + }, + "nativeSrc": "33374:25:70", + "nodeType": "YulFunctionCall", + "src": "33374:25:70" + }, + "variables": [ + { + "name": "value_1", + "nativeSrc": "33363:7:70", + "nodeType": "YulTypedName", + "src": "33363:7:70", + "type": "" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "value_1", + "nativeSrc": "33433:7:70", + "nodeType": "YulIdentifier", + "src": "33433:7:70" + } + ], + "functionName": { + "name": "validator_revert_address", + "nativeSrc": "33408:24:70", + "nodeType": "YulIdentifier", + "src": "33408:24:70" + }, + "nativeSrc": "33408:33:70", + "nodeType": "YulFunctionCall", + "src": "33408:33:70" + }, + "nativeSrc": "33408:33:70", + "nodeType": "YulExpressionStatement", + "src": "33408:33:70" + }, + { + "nativeSrc": "33450:17:70", + "nodeType": "YulAssignment", + "src": "33450:17:70", + "value": { + "name": "value_1", + "nativeSrc": "33460:7:70", + "nodeType": "YulIdentifier", + "src": "33460:7:70" + }, + "variableNames": [ + { + "name": "value1", + "nativeSrc": "33450:6:70", + "nodeType": "YulIdentifier", + "src": "33450:6:70" + } + ] + } + ] + }, + "name": "abi_decode_tuple_t_uint256t_address_payable_fromMemory", + "nativeSrc": "33101:372:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "33165:9:70", + "nodeType": "YulTypedName", + "src": "33165:9:70", + "type": "" + }, + { + "name": "dataEnd", + "nativeSrc": "33176:7:70", + "nodeType": "YulTypedName", + "src": "33176:7:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value0", + "nativeSrc": "33188:6:70", + "nodeType": "YulTypedName", + "src": "33188:6:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "33196:6:70", + "nodeType": "YulTypedName", + "src": "33196:6:70", + "type": "" + } + ], + "src": "33101:372:70" + }, + { + "body": { + "nativeSrc": "33607:145:70", + "nodeType": "YulBlock", + "src": "33607:145:70", + "statements": [ + { + "nativeSrc": "33617:26:70", + "nodeType": "YulAssignment", + "src": "33617:26:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "33629:9:70", + "nodeType": "YulIdentifier", + "src": "33629:9:70" + }, + { + "kind": "number", + "nativeSrc": "33640:2:70", + "nodeType": "YulLiteral", + "src": "33640:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "33625:3:70", + "nodeType": "YulIdentifier", + "src": "33625:3:70" + }, + "nativeSrc": "33625:18:70", + "nodeType": "YulFunctionCall", + "src": "33625:18:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "33617:4:70", + "nodeType": "YulIdentifier", + "src": "33617:4:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "33659:9:70", + "nodeType": "YulIdentifier", + "src": "33659:9:70" + }, + { + "name": "value0", + "nativeSrc": "33670:6:70", + "nodeType": "YulIdentifier", + "src": "33670:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "33652:6:70", + "nodeType": "YulIdentifier", + "src": "33652:6:70" + }, + "nativeSrc": "33652:25:70", + "nodeType": "YulFunctionCall", + "src": "33652:25:70" + }, + "nativeSrc": "33652:25:70", + "nodeType": "YulExpressionStatement", + "src": "33652:25:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "33697:9:70", + "nodeType": "YulIdentifier", + "src": "33697:9:70" + }, + { + "kind": "number", + "nativeSrc": "33708:2:70", + "nodeType": "YulLiteral", + "src": "33708:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "33693:3:70", + "nodeType": "YulIdentifier", + "src": "33693:3:70" + }, + "nativeSrc": "33693:18:70", + "nodeType": "YulFunctionCall", + "src": "33693:18:70" + }, + { + "arguments": [ + { + "name": "value1", + "nativeSrc": "33717:6:70", + "nodeType": "YulIdentifier", + "src": "33717:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "33733:3:70", + "nodeType": "YulLiteral", + "src": "33733:3:70", + "type": "", + "value": "160" + }, + { + "kind": "number", + "nativeSrc": "33738:1:70", + "nodeType": "YulLiteral", + "src": "33738:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "33729:3:70", + "nodeType": "YulIdentifier", + "src": "33729:3:70" + }, + "nativeSrc": "33729:11:70", + "nodeType": "YulFunctionCall", + "src": "33729:11:70" + }, + { + "kind": "number", + "nativeSrc": "33742:1:70", + "nodeType": "YulLiteral", + "src": "33742:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "33725:3:70", + "nodeType": "YulIdentifier", + "src": "33725:3:70" + }, + "nativeSrc": "33725:19:70", + "nodeType": "YulFunctionCall", + "src": "33725:19:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "33713:3:70", + "nodeType": "YulIdentifier", + "src": "33713:3:70" + }, + "nativeSrc": "33713:32:70", + "nodeType": "YulFunctionCall", + "src": "33713:32:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "33686:6:70", + "nodeType": "YulIdentifier", + "src": "33686:6:70" + }, + "nativeSrc": "33686:60:70", + "nodeType": "YulFunctionCall", + "src": "33686:60:70" + }, + "nativeSrc": "33686:60:70", + "nodeType": "YulExpressionStatement", + "src": "33686:60:70" + } + ] + }, + "name": "abi_encode_tuple_t_uint256_t_address__to_t_uint256_t_address__fromStack_reversed", + "nativeSrc": "33478:274:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "33568:9:70", + "nodeType": "YulTypedName", + "src": "33568:9:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "33579:6:70", + "nodeType": "YulTypedName", + "src": "33579:6:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "33587:6:70", + "nodeType": "YulTypedName", + "src": "33587:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "33598:4:70", + "nodeType": "YulTypedName", + "src": "33598:4:70", + "type": "" + } + ], + "src": "33478:274:70" + }, + { + "body": { + "nativeSrc": "33804:89:70", + "nodeType": "YulBlock", + "src": "33804:89:70", + "statements": [ + { + "body": { + "nativeSrc": "33831:22:70", + "nodeType": "YulBlock", + "src": "33831:22:70", + "statements": [ + { + "expression": { + "arguments": [], + "functionName": { + "name": "panic_error_0x11", + "nativeSrc": "33833:16:70", + "nodeType": "YulIdentifier", + "src": "33833:16:70" + }, + "nativeSrc": "33833:18:70", + "nodeType": "YulFunctionCall", + "src": "33833:18:70" + }, + "nativeSrc": "33833:18:70", + "nodeType": "YulExpressionStatement", + "src": "33833:18:70" + } + ] + }, + "condition": { + "arguments": [ + { + "name": "value", + "nativeSrc": "33824:5:70", + "nodeType": "YulIdentifier", + "src": "33824:5:70" + } + ], + "functionName": { + "name": "iszero", + "nativeSrc": "33817:6:70", + "nodeType": "YulIdentifier", + "src": "33817:6:70" + }, + "nativeSrc": "33817:13:70", + "nodeType": "YulFunctionCall", + "src": "33817:13:70" + }, + "nativeSrc": "33814:39:70", + "nodeType": "YulIf", + "src": "33814:39:70" + }, + { + "nativeSrc": "33862:25:70", + "nodeType": "YulAssignment", + "src": "33862:25:70", + "value": { + "arguments": [ + { + "name": "value", + "nativeSrc": "33873:5:70", + "nodeType": "YulIdentifier", + "src": "33873:5:70" + }, + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "33884:1:70", + "nodeType": "YulLiteral", + "src": "33884:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "not", + "nativeSrc": "33880:3:70", + "nodeType": "YulIdentifier", + "src": "33880:3:70" + }, + "nativeSrc": "33880:6:70", + "nodeType": "YulFunctionCall", + "src": "33880:6:70" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "33869:3:70", + "nodeType": "YulIdentifier", + "src": "33869:3:70" + }, + "nativeSrc": "33869:18:70", + "nodeType": "YulFunctionCall", + "src": "33869:18:70" + }, + "variableNames": [ + { + "name": "ret", + "nativeSrc": "33862:3:70", + "nodeType": "YulIdentifier", + "src": "33862:3:70" + } + ] + } + ] + }, + "name": "decrement_t_uint256", + "nativeSrc": "33757:136:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "value", + "nativeSrc": "33786:5:70", + "nodeType": "YulTypedName", + "src": "33786:5:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "ret", + "nativeSrc": "33796:3:70", + "nodeType": "YulTypedName", + "src": "33796:3:70", + "type": "" + } + ], + "src": "33757:136:70" + }, + { + "body": { + "nativeSrc": "33945:88:70", + "nodeType": "YulBlock", + "src": "33945:88:70", + "statements": [ + { + "body": { + "nativeSrc": "33976:22:70", + "nodeType": "YulBlock", + "src": "33976:22:70", + "statements": [ + { + "expression": { + "arguments": [], + "functionName": { + "name": "panic_error_0x11", + "nativeSrc": "33978:16:70", + "nodeType": "YulIdentifier", + "src": "33978:16:70" + }, + "nativeSrc": "33978:18:70", + "nodeType": "YulFunctionCall", + "src": "33978:18:70" + }, + "nativeSrc": "33978:18:70", + "nodeType": "YulExpressionStatement", + "src": "33978:18:70" + } + ] + }, + "condition": { + "arguments": [ + { + "name": "value", + "nativeSrc": "33961:5:70", + "nodeType": "YulIdentifier", + "src": "33961:5:70" + }, + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "33972:1:70", + "nodeType": "YulLiteral", + "src": "33972:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "not", + "nativeSrc": "33968:3:70", + "nodeType": "YulIdentifier", + "src": "33968:3:70" + }, + "nativeSrc": "33968:6:70", + "nodeType": "YulFunctionCall", + "src": "33968:6:70" + } + ], + "functionName": { + "name": "eq", + "nativeSrc": "33958:2:70", + "nodeType": "YulIdentifier", + "src": "33958:2:70" + }, + "nativeSrc": "33958:17:70", + "nodeType": "YulFunctionCall", + "src": "33958:17:70" + }, + "nativeSrc": "33955:43:70", + "nodeType": "YulIf", + "src": "33955:43:70" + }, + { + "nativeSrc": "34007:20:70", + "nodeType": "YulAssignment", + "src": "34007:20:70", + "value": { + "arguments": [ + { + "name": "value", + "nativeSrc": "34018:5:70", + "nodeType": "YulIdentifier", + "src": "34018:5:70" + }, + { + "kind": "number", + "nativeSrc": "34025:1:70", + "nodeType": "YulLiteral", + "src": "34025:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "34014:3:70", + "nodeType": "YulIdentifier", + "src": "34014:3:70" + }, + "nativeSrc": "34014:13:70", + "nodeType": "YulFunctionCall", + "src": "34014:13:70" + }, + "variableNames": [ + { + "name": "ret", + "nativeSrc": "34007:3:70", + "nodeType": "YulIdentifier", + "src": "34007:3:70" + } + ] + } + ] + }, + "name": "increment_t_uint256", + "nativeSrc": "33898:135:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "value", + "nativeSrc": "33927:5:70", + "nodeType": "YulTypedName", + "src": "33927:5:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "ret", + "nativeSrc": "33937:3:70", + "nodeType": "YulTypedName", + "src": "33937:3:70", + "type": "" + } + ], + "src": "33898:135:70" + }, + { + "body": { + "nativeSrc": "34193:231:70", + "nodeType": "YulBlock", + "src": "34193:231:70", + "statements": [ + { + "nativeSrc": "34203:26:70", + "nodeType": "YulAssignment", + "src": "34203:26:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "34215:9:70", + "nodeType": "YulIdentifier", + "src": "34215:9:70" + }, + { + "kind": "number", + "nativeSrc": "34226:2:70", + "nodeType": "YulLiteral", + "src": "34226:2:70", + "type": "", + "value": "96" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "34211:3:70", + "nodeType": "YulIdentifier", + "src": "34211:3:70" + }, + "nativeSrc": "34211:18:70", + "nodeType": "YulFunctionCall", + "src": "34211:18:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "34203:4:70", + "nodeType": "YulIdentifier", + "src": "34203:4:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "34245:9:70", + "nodeType": "YulIdentifier", + "src": "34245:9:70" + }, + { + "arguments": [ + { + "name": "value0", + "nativeSrc": "34260:6:70", + "nodeType": "YulIdentifier", + "src": "34260:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "34276:3:70", + "nodeType": "YulLiteral", + "src": "34276:3:70", + "type": "", + "value": "160" + }, + { + "kind": "number", + "nativeSrc": "34281:1:70", + "nodeType": "YulLiteral", + "src": "34281:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "34272:3:70", + "nodeType": "YulIdentifier", + "src": "34272:3:70" + }, + "nativeSrc": "34272:11:70", + "nodeType": "YulFunctionCall", + "src": "34272:11:70" + }, + { + "kind": "number", + "nativeSrc": "34285:1:70", + "nodeType": "YulLiteral", + "src": "34285:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "34268:3:70", + "nodeType": "YulIdentifier", + "src": "34268:3:70" + }, + "nativeSrc": "34268:19:70", + "nodeType": "YulFunctionCall", + "src": "34268:19:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "34256:3:70", + "nodeType": "YulIdentifier", + "src": "34256:3:70" + }, + "nativeSrc": "34256:32:70", + "nodeType": "YulFunctionCall", + "src": "34256:32:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "34238:6:70", + "nodeType": "YulIdentifier", + "src": "34238:6:70" + }, + "nativeSrc": "34238:51:70", + "nodeType": "YulFunctionCall", + "src": "34238:51:70" + }, + "nativeSrc": "34238:51:70", + "nodeType": "YulExpressionStatement", + "src": "34238:51:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "34309:9:70", + "nodeType": "YulIdentifier", + "src": "34309:9:70" + }, + { + "kind": "number", + "nativeSrc": "34320:2:70", + "nodeType": "YulLiteral", + "src": "34320:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "34305:3:70", + "nodeType": "YulIdentifier", + "src": "34305:3:70" + }, + "nativeSrc": "34305:18:70", + "nodeType": "YulFunctionCall", + "src": "34305:18:70" + }, + { + "arguments": [ + { + "name": "value1", + "nativeSrc": "34329:6:70", + "nodeType": "YulIdentifier", + "src": "34329:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "34345:3:70", + "nodeType": "YulLiteral", + "src": "34345:3:70", + "type": "", + "value": "160" + }, + { + "kind": "number", + "nativeSrc": "34350:1:70", + "nodeType": "YulLiteral", + "src": "34350:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "34341:3:70", + "nodeType": "YulIdentifier", + "src": "34341:3:70" + }, + "nativeSrc": "34341:11:70", + "nodeType": "YulFunctionCall", + "src": "34341:11:70" + }, + { + "kind": "number", + "nativeSrc": "34354:1:70", + "nodeType": "YulLiteral", + "src": "34354:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "34337:3:70", + "nodeType": "YulIdentifier", + "src": "34337:3:70" + }, + "nativeSrc": "34337:19:70", + "nodeType": "YulFunctionCall", + "src": "34337:19:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "34325:3:70", + "nodeType": "YulIdentifier", + "src": "34325:3:70" + }, + "nativeSrc": "34325:32:70", + "nodeType": "YulFunctionCall", + "src": "34325:32:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "34298:6:70", + "nodeType": "YulIdentifier", + "src": "34298:6:70" + }, + "nativeSrc": "34298:60:70", + "nodeType": "YulFunctionCall", + "src": "34298:60:70" + }, + "nativeSrc": "34298:60:70", + "nodeType": "YulExpressionStatement", + "src": "34298:60:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "34378:9:70", + "nodeType": "YulIdentifier", + "src": "34378:9:70" + }, + { + "kind": "number", + "nativeSrc": "34389:2:70", + "nodeType": "YulLiteral", + "src": "34389:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "34374:3:70", + "nodeType": "YulIdentifier", + "src": "34374:3:70" + }, + "nativeSrc": "34374:18:70", + "nodeType": "YulFunctionCall", + "src": "34374:18:70" + }, + { + "arguments": [ + { + "name": "value2", + "nativeSrc": "34398:6:70", + "nodeType": "YulIdentifier", + "src": "34398:6:70" + }, + { + "kind": "number", + "nativeSrc": "34406:10:70", + "nodeType": "YulLiteral", + "src": "34406:10:70", + "type": "", + "value": "0xffffffff" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "34394:3:70", + "nodeType": "YulIdentifier", + "src": "34394:3:70" + }, + "nativeSrc": "34394:23:70", + "nodeType": "YulFunctionCall", + "src": "34394:23:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "34367:6:70", + "nodeType": "YulIdentifier", + "src": "34367:6:70" + }, + "nativeSrc": "34367:51:70", + "nodeType": "YulFunctionCall", + "src": "34367:51:70" + }, + "nativeSrc": "34367:51:70", + "nodeType": "YulExpressionStatement", + "src": "34367:51:70" + } + ] + }, + "name": "abi_encode_tuple_t_address_t_address_t_uint32__to_t_address_t_address_t_uint32__fromStack_reversed", + "nativeSrc": "34038:386:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "34146:9:70", + "nodeType": "YulTypedName", + "src": "34146:9:70", + "type": "" + }, + { + "name": "value2", + "nativeSrc": "34157:6:70", + "nodeType": "YulTypedName", + "src": "34157:6:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "34165:6:70", + "nodeType": "YulTypedName", + "src": "34165:6:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "34173:6:70", + "nodeType": "YulTypedName", + "src": "34173:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "34184:4:70", + "nodeType": "YulTypedName", + "src": "34184:4:70", + "type": "" + } + ], + "src": "34038:386:70" + }, + { + "body": { + "nativeSrc": "34473:60:70", + "nodeType": "YulBlock", + "src": "34473:60:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "name": "pos", + "nativeSrc": "34490:3:70", + "nodeType": "YulIdentifier", + "src": "34490:3:70" + }, + { + "arguments": [ + { + "name": "value", + "nativeSrc": "34499:5:70", + "nodeType": "YulIdentifier", + "src": "34499:5:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "34514:3:70", + "nodeType": "YulLiteral", + "src": "34514:3:70", + "type": "", + "value": "128" + }, + { + "kind": "number", + "nativeSrc": "34519:1:70", + "nodeType": "YulLiteral", + "src": "34519:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "34510:3:70", + "nodeType": "YulIdentifier", + "src": "34510:3:70" + }, + "nativeSrc": "34510:11:70", + "nodeType": "YulFunctionCall", + "src": "34510:11:70" + }, + { + "kind": "number", + "nativeSrc": "34523:1:70", + "nodeType": "YulLiteral", + "src": "34523:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "34506:3:70", + "nodeType": "YulIdentifier", + "src": "34506:3:70" + }, + "nativeSrc": "34506:19:70", + "nodeType": "YulFunctionCall", + "src": "34506:19:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "34495:3:70", + "nodeType": "YulIdentifier", + "src": "34495:3:70" + }, + "nativeSrc": "34495:31:70", + "nodeType": "YulFunctionCall", + "src": "34495:31:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "34483:6:70", + "nodeType": "YulIdentifier", + "src": "34483:6:70" + }, + "nativeSrc": "34483:44:70", + "nodeType": "YulFunctionCall", + "src": "34483:44:70" + }, + "nativeSrc": "34483:44:70", + "nodeType": "YulExpressionStatement", + "src": "34483:44:70" + } + ] + }, + "name": "abi_encode_uint128", + "nativeSrc": "34429:104:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "value", + "nativeSrc": "34457:5:70", + "nodeType": "YulTypedName", + "src": "34457:5:70", + "type": "" + }, + { + "name": "pos", + "nativeSrc": "34464:3:70", + "nodeType": "YulTypedName", + "src": "34464:3:70", + "type": "" + } + ], + "src": "34429:104:70" + }, + { + "body": { + "nativeSrc": "34749:1166:70", + "nodeType": "YulBlock", + "src": "34749:1166:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "34766:9:70", + "nodeType": "YulIdentifier", + "src": "34766:9:70" + }, + { + "kind": "number", + "nativeSrc": "34777:2:70", + "nodeType": "YulLiteral", + "src": "34777:2:70", + "type": "", + "value": "96" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "34759:6:70", + "nodeType": "YulIdentifier", + "src": "34759:6:70" + }, + "nativeSrc": "34759:21:70", + "nodeType": "YulFunctionCall", + "src": "34759:21:70" + }, + "nativeSrc": "34759:21:70", + "nodeType": "YulExpressionStatement", + "src": "34759:21:70" + }, + { + "nativeSrc": "34789:33:70", + "nodeType": "YulVariableDeclaration", + "src": "34789:33:70", + "value": { + "arguments": [ + { + "name": "value0", + "nativeSrc": "34815:6:70", + "nodeType": "YulIdentifier", + "src": "34815:6:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "34809:5:70", + "nodeType": "YulIdentifier", + "src": "34809:5:70" + }, + "nativeSrc": "34809:13:70", + "nodeType": "YulFunctionCall", + "src": "34809:13:70" + }, + "variables": [ + { + "name": "memberValue0", + "nativeSrc": "34793:12:70", + "nodeType": "YulTypedName", + "src": "34793:12:70", + "type": "" + } + ] + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "34842:9:70", + "nodeType": "YulIdentifier", + "src": "34842:9:70" + }, + { + "kind": "number", + "nativeSrc": "34853:2:70", + "nodeType": "YulLiteral", + "src": "34853:2:70", + "type": "", + "value": "96" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "34838:3:70", + "nodeType": "YulIdentifier", + "src": "34838:3:70" + }, + "nativeSrc": "34838:18:70", + "nodeType": "YulFunctionCall", + "src": "34838:18:70" + }, + { + "kind": "number", + "nativeSrc": "34858:4:70", + "nodeType": "YulLiteral", + "src": "34858:4:70", + "type": "", + "value": "0x40" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "34831:6:70", + "nodeType": "YulIdentifier", + "src": "34831:6:70" + }, + "nativeSrc": "34831:32:70", + "nodeType": "YulFunctionCall", + "src": "34831:32:70" + }, + "nativeSrc": "34831:32:70", + "nodeType": "YulExpressionStatement", + "src": "34831:32:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "34883:9:70", + "nodeType": "YulIdentifier", + "src": "34883:9:70" + }, + { + "kind": "number", + "nativeSrc": "34894:3:70", + "nodeType": "YulLiteral", + "src": "34894:3:70", + "type": "", + "value": "160" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "34879:3:70", + "nodeType": "YulIdentifier", + "src": "34879:3:70" + }, + "nativeSrc": "34879:19:70", + "nodeType": "YulFunctionCall", + "src": "34879:19:70" + }, + { + "arguments": [ + { + "name": "memberValue0", + "nativeSrc": "34906:12:70", + "nodeType": "YulIdentifier", + "src": "34906:12:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "34900:5:70", + "nodeType": "YulIdentifier", + "src": "34900:5:70" + }, + "nativeSrc": "34900:19:70", + "nodeType": "YulFunctionCall", + "src": "34900:19:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "34872:6:70", + "nodeType": "YulIdentifier", + "src": "34872:6:70" + }, + "nativeSrc": "34872:48:70", + "nodeType": "YulFunctionCall", + "src": "34872:48:70" + }, + "nativeSrc": "34872:48:70", + "nodeType": "YulExpressionStatement", + "src": "34872:48:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "34940:9:70", + "nodeType": "YulIdentifier", + "src": "34940:9:70" + }, + { + "kind": "number", + "nativeSrc": "34951:3:70", + "nodeType": "YulLiteral", + "src": "34951:3:70", + "type": "", + "value": "192" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "34936:3:70", + "nodeType": "YulIdentifier", + "src": "34936:3:70" + }, + "nativeSrc": "34936:19:70", + "nodeType": "YulFunctionCall", + "src": "34936:19:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "arguments": [ + { + "name": "memberValue0", + "nativeSrc": "34971:12:70", + "nodeType": "YulIdentifier", + "src": "34971:12:70" + }, + { + "kind": "number", + "nativeSrc": "34985:4:70", + "nodeType": "YulLiteral", + "src": "34985:4:70", + "type": "", + "value": "0x20" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "34967:3:70", + "nodeType": "YulIdentifier", + "src": "34967:3:70" + }, + "nativeSrc": "34967:23:70", + "nodeType": "YulFunctionCall", + "src": "34967:23:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "34961:5:70", + "nodeType": "YulIdentifier", + "src": "34961:5:70" + }, + "nativeSrc": "34961:30:70", + "nodeType": "YulFunctionCall", + "src": "34961:30:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "35001:3:70", + "nodeType": "YulLiteral", + "src": "35001:3:70", + "type": "", + "value": "160" + }, + { + "kind": "number", + "nativeSrc": "35006:1:70", + "nodeType": "YulLiteral", + "src": "35006:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "34997:3:70", + "nodeType": "YulIdentifier", + "src": "34997:3:70" + }, + "nativeSrc": "34997:11:70", + "nodeType": "YulFunctionCall", + "src": "34997:11:70" + }, + { + "kind": "number", + "nativeSrc": "35010:1:70", + "nodeType": "YulLiteral", + "src": "35010:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "34993:3:70", + "nodeType": "YulIdentifier", + "src": "34993:3:70" + }, + "nativeSrc": "34993:19:70", + "nodeType": "YulFunctionCall", + "src": "34993:19:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "34957:3:70", + "nodeType": "YulIdentifier", + "src": "34957:3:70" + }, + "nativeSrc": "34957:56:70", + "nodeType": "YulFunctionCall", + "src": "34957:56:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "34929:6:70", + "nodeType": "YulIdentifier", + "src": "34929:6:70" + }, + "nativeSrc": "34929:85:70", + "nodeType": "YulFunctionCall", + "src": "34929:85:70" + }, + "nativeSrc": "34929:85:70", + "nodeType": "YulExpressionStatement", + "src": "34929:85:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "35034:9:70", + "nodeType": "YulIdentifier", + "src": "35034:9:70" + }, + { + "kind": "number", + "nativeSrc": "35045:4:70", + "nodeType": "YulLiteral", + "src": "35045:4:70", + "type": "", + "value": "0xe0" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "35030:3:70", + "nodeType": "YulIdentifier", + "src": "35030:3:70" + }, + "nativeSrc": "35030:20:70", + "nodeType": "YulFunctionCall", + "src": "35030:20:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "arguments": [ + { + "name": "memberValue0", + "nativeSrc": "35066:12:70", + "nodeType": "YulIdentifier", + "src": "35066:12:70" + }, + { + "kind": "number", + "nativeSrc": "35080:4:70", + "nodeType": "YulLiteral", + "src": "35080:4:70", + "type": "", + "value": "0x40" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "35062:3:70", + "nodeType": "YulIdentifier", + "src": "35062:3:70" + }, + "nativeSrc": "35062:23:70", + "nodeType": "YulFunctionCall", + "src": "35062:23:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "35056:5:70", + "nodeType": "YulIdentifier", + "src": "35056:5:70" + }, + "nativeSrc": "35056:30:70", + "nodeType": "YulFunctionCall", + "src": "35056:30:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "35096:3:70", + "nodeType": "YulLiteral", + "src": "35096:3:70", + "type": "", + "value": "160" + }, + { + "kind": "number", + "nativeSrc": "35101:1:70", + "nodeType": "YulLiteral", + "src": "35101:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "35092:3:70", + "nodeType": "YulIdentifier", + "src": "35092:3:70" + }, + "nativeSrc": "35092:11:70", + "nodeType": "YulFunctionCall", + "src": "35092:11:70" + }, + { + "kind": "number", + "nativeSrc": "35105:1:70", + "nodeType": "YulLiteral", + "src": "35105:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "35088:3:70", + "nodeType": "YulIdentifier", + "src": "35088:3:70" + }, + "nativeSrc": "35088:19:70", + "nodeType": "YulFunctionCall", + "src": "35088:19:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "35052:3:70", + "nodeType": "YulIdentifier", + "src": "35052:3:70" + }, + "nativeSrc": "35052:56:70", + "nodeType": "YulFunctionCall", + "src": "35052:56:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "35023:6:70", + "nodeType": "YulIdentifier", + "src": "35023:6:70" + }, + "nativeSrc": "35023:86:70", + "nodeType": "YulFunctionCall", + "src": "35023:86:70" + }, + "nativeSrc": "35023:86:70", + "nodeType": "YulExpressionStatement", + "src": "35023:86:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "35129:9:70", + "nodeType": "YulIdentifier", + "src": "35129:9:70" + }, + { + "kind": "number", + "nativeSrc": "35140:3:70", + "nodeType": "YulLiteral", + "src": "35140:3:70", + "type": "", + "value": "256" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "35125:3:70", + "nodeType": "YulIdentifier", + "src": "35125:3:70" + }, + "nativeSrc": "35125:19:70", + "nodeType": "YulFunctionCall", + "src": "35125:19:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "arguments": [ + { + "name": "memberValue0", + "nativeSrc": "35160:12:70", + "nodeType": "YulIdentifier", + "src": "35160:12:70" + }, + { + "kind": "number", + "nativeSrc": "35174:2:70", + "nodeType": "YulLiteral", + "src": "35174:2:70", + "type": "", + "value": "96" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "35156:3:70", + "nodeType": "YulIdentifier", + "src": "35156:3:70" + }, + "nativeSrc": "35156:21:70", + "nodeType": "YulFunctionCall", + "src": "35156:21:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "35150:5:70", + "nodeType": "YulIdentifier", + "src": "35150:5:70" + }, + "nativeSrc": "35150:28:70", + "nodeType": "YulFunctionCall", + "src": "35150:28:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "35188:3:70", + "nodeType": "YulLiteral", + "src": "35188:3:70", + "type": "", + "value": "160" + }, + { + "kind": "number", + "nativeSrc": "35193:1:70", + "nodeType": "YulLiteral", + "src": "35193:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "35184:3:70", + "nodeType": "YulIdentifier", + "src": "35184:3:70" + }, + "nativeSrc": "35184:11:70", + "nodeType": "YulFunctionCall", + "src": "35184:11:70" + }, + { + "kind": "number", + "nativeSrc": "35197:1:70", + "nodeType": "YulLiteral", + "src": "35197:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "35180:3:70", + "nodeType": "YulIdentifier", + "src": "35180:3:70" + }, + "nativeSrc": "35180:19:70", + "nodeType": "YulFunctionCall", + "src": "35180:19:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "35146:3:70", + "nodeType": "YulIdentifier", + "src": "35146:3:70" + }, + "nativeSrc": "35146:54:70", + "nodeType": "YulFunctionCall", + "src": "35146:54:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "35118:6:70", + "nodeType": "YulIdentifier", + "src": "35118:6:70" + }, + "nativeSrc": "35118:83:70", + "nodeType": "YulFunctionCall", + "src": "35118:83:70" + }, + "nativeSrc": "35118:83:70", + "nodeType": "YulExpressionStatement", + "src": "35118:83:70" + }, + { + "nativeSrc": "35210:52:70", + "nodeType": "YulVariableDeclaration", + "src": "35210:52:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "memberValue0", + "nativeSrc": "35242:12:70", + "nodeType": "YulIdentifier", + "src": "35242:12:70" + }, + { + "kind": "number", + "nativeSrc": "35256:4:70", + "nodeType": "YulLiteral", + "src": "35256:4:70", + "type": "", + "value": "0x80" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "35238:3:70", + "nodeType": "YulIdentifier", + "src": "35238:3:70" + }, + "nativeSrc": "35238:23:70", + "nodeType": "YulFunctionCall", + "src": "35238:23:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "35232:5:70", + "nodeType": "YulIdentifier", + "src": "35232:5:70" + }, + "nativeSrc": "35232:30:70", + "nodeType": "YulFunctionCall", + "src": "35232:30:70" + }, + "variables": [ + { + "name": "memberValue0_1", + "nativeSrc": "35214:14:70", + "nodeType": "YulTypedName", + "src": "35214:14:70", + "type": "" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "memberValue0_1", + "nativeSrc": "35289:14:70", + "nodeType": "YulIdentifier", + "src": "35289:14:70" + }, + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "35309:9:70", + "nodeType": "YulIdentifier", + "src": "35309:9:70" + }, + { + "kind": "number", + "nativeSrc": "35320:3:70", + "nodeType": "YulLiteral", + "src": "35320:3:70", + "type": "", + "value": "288" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "35305:3:70", + "nodeType": "YulIdentifier", + "src": "35305:3:70" + }, + "nativeSrc": "35305:19:70", + "nodeType": "YulFunctionCall", + "src": "35305:19:70" + } + ], + "functionName": { + "name": "abi_encode_uint64", + "nativeSrc": "35271:17:70", + "nodeType": "YulIdentifier", + "src": "35271:17:70" + }, + "nativeSrc": "35271:54:70", + "nodeType": "YulFunctionCall", + "src": "35271:54:70" + }, + "nativeSrc": "35271:54:70", + "nodeType": "YulExpressionStatement", + "src": "35271:54:70" + }, + { + "nativeSrc": "35334:51:70", + "nodeType": "YulVariableDeclaration", + "src": "35334:51:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "memberValue0", + "nativeSrc": "35366:12:70", + "nodeType": "YulIdentifier", + "src": "35366:12:70" + }, + { + "kind": "number", + "nativeSrc": "35380:3:70", + "nodeType": "YulLiteral", + "src": "35380:3:70", + "type": "", + "value": "160" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "35362:3:70", + "nodeType": "YulIdentifier", + "src": "35362:3:70" + }, + "nativeSrc": "35362:22:70", + "nodeType": "YulFunctionCall", + "src": "35362:22:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "35356:5:70", + "nodeType": "YulIdentifier", + "src": "35356:5:70" + }, + "nativeSrc": "35356:29:70", + "nodeType": "YulFunctionCall", + "src": "35356:29:70" + }, + "variables": [ + { + "name": "memberValue0_2", + "nativeSrc": "35338:14:70", + "nodeType": "YulTypedName", + "src": "35338:14:70", + "type": "" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "memberValue0_2", + "nativeSrc": "35413:14:70", + "nodeType": "YulIdentifier", + "src": "35413:14:70" + }, + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "35433:9:70", + "nodeType": "YulIdentifier", + "src": "35433:9:70" + }, + { + "kind": "number", + "nativeSrc": "35444:3:70", + "nodeType": "YulLiteral", + "src": "35444:3:70", + "type": "", + "value": "320" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "35429:3:70", + "nodeType": "YulIdentifier", + "src": "35429:3:70" + }, + "nativeSrc": "35429:19:70", + "nodeType": "YulFunctionCall", + "src": "35429:19:70" + } + ], + "functionName": { + "name": "abi_encode_uint128", + "nativeSrc": "35394:18:70", + "nodeType": "YulIdentifier", + "src": "35394:18:70" + }, + "nativeSrc": "35394:55:70", + "nodeType": "YulFunctionCall", + "src": "35394:55:70" + }, + "nativeSrc": "35394:55:70", + "nodeType": "YulExpressionStatement", + "src": "35394:55:70" + }, + { + "nativeSrc": "35458:51:70", + "nodeType": "YulVariableDeclaration", + "src": "35458:51:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "memberValue0", + "nativeSrc": "35490:12:70", + "nodeType": "YulIdentifier", + "src": "35490:12:70" + }, + { + "kind": "number", + "nativeSrc": "35504:3:70", + "nodeType": "YulLiteral", + "src": "35504:3:70", + "type": "", + "value": "192" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "35486:3:70", + "nodeType": "YulIdentifier", + "src": "35486:3:70" + }, + "nativeSrc": "35486:22:70", + "nodeType": "YulFunctionCall", + "src": "35486:22:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "35480:5:70", + "nodeType": "YulIdentifier", + "src": "35480:5:70" + }, + "nativeSrc": "35480:29:70", + "nodeType": "YulFunctionCall", + "src": "35480:29:70" + }, + "variables": [ + { + "name": "memberValue0_3", + "nativeSrc": "35462:14:70", + "nodeType": "YulTypedName", + "src": "35462:14:70", + "type": "" + } + ] + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "35529:9:70", + "nodeType": "YulIdentifier", + "src": "35529:9:70" + }, + { + "kind": "number", + "nativeSrc": "35540:3:70", + "nodeType": "YulLiteral", + "src": "35540:3:70", + "type": "", + "value": "352" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "35525:3:70", + "nodeType": "YulIdentifier", + "src": "35525:3:70" + }, + "nativeSrc": "35525:19:70", + "nodeType": "YulFunctionCall", + "src": "35525:19:70" + }, + { + "kind": "number", + "nativeSrc": "35546:4:70", + "nodeType": "YulLiteral", + "src": "35546:4:70", + "type": "", + "value": "0xe0" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "35518:6:70", + "nodeType": "YulIdentifier", + "src": "35518:6:70" + }, + "nativeSrc": "35518:33:70", + "nodeType": "YulFunctionCall", + "src": "35518:33:70" + }, + "nativeSrc": "35518:33:70", + "nodeType": "YulExpressionStatement", + "src": "35518:33:70" + }, + { + "nativeSrc": "35560:65:70", + "nodeType": "YulVariableDeclaration", + "src": "35560:65:70", + "value": { + "arguments": [ + { + "name": "memberValue0_3", + "nativeSrc": "35589:14:70", + "nodeType": "YulIdentifier", + "src": "35589:14:70" + }, + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "35609:9:70", + "nodeType": "YulIdentifier", + "src": "35609:9:70" + }, + { + "kind": "number", + "nativeSrc": "35620:3:70", + "nodeType": "YulLiteral", + "src": "35620:3:70", + "type": "", + "value": "384" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "35605:3:70", + "nodeType": "YulIdentifier", + "src": "35605:3:70" + }, + "nativeSrc": "35605:19:70", + "nodeType": "YulFunctionCall", + "src": "35605:19:70" + } + ], + "functionName": { + "name": "abi_encode_string", + "nativeSrc": "35571:17:70", + "nodeType": "YulIdentifier", + "src": "35571:17:70" + }, + "nativeSrc": "35571:54:70", + "nodeType": "YulFunctionCall", + "src": "35571:54:70" + }, + "variables": [ + { + "name": "end", + "nativeSrc": "35564:3:70", + "nodeType": "YulTypedName", + "src": "35564:3:70", + "type": "" + } + ] + }, + { + "nativeSrc": "35634:46:70", + "nodeType": "YulVariableDeclaration", + "src": "35634:46:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "value0", + "nativeSrc": "35666:6:70", + "nodeType": "YulIdentifier", + "src": "35666:6:70" + }, + { + "kind": "number", + "nativeSrc": "35674:4:70", + "nodeType": "YulLiteral", + "src": "35674:4:70", + "type": "", + "value": "0x20" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "35662:3:70", + "nodeType": "YulIdentifier", + "src": "35662:3:70" + }, + "nativeSrc": "35662:17:70", + "nodeType": "YulFunctionCall", + "src": "35662:17:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "35656:5:70", + "nodeType": "YulIdentifier", + "src": "35656:5:70" + }, + "nativeSrc": "35656:24:70", + "nodeType": "YulFunctionCall", + "src": "35656:24:70" + }, + "variables": [ + { + "name": "memberValue0_4", + "nativeSrc": "35638:14:70", + "nodeType": "YulTypedName", + "src": "35638:14:70", + "type": "" + } + ] + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "35700:9:70", + "nodeType": "YulIdentifier", + "src": "35700:9:70" + }, + { + "kind": "number", + "nativeSrc": "35711:4:70", + "nodeType": "YulLiteral", + "src": "35711:4:70", + "type": "", + "value": "0x80" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "35696:3:70", + "nodeType": "YulIdentifier", + "src": "35696:3:70" + }, + "nativeSrc": "35696:20:70", + "nodeType": "YulFunctionCall", + "src": "35696:20:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "name": "end", + "nativeSrc": "35726:3:70", + "nodeType": "YulIdentifier", + "src": "35726:3:70" + }, + { + "name": "headStart", + "nativeSrc": "35731:9:70", + "nodeType": "YulIdentifier", + "src": "35731:9:70" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "35722:3:70", + "nodeType": "YulIdentifier", + "src": "35722:3:70" + }, + "nativeSrc": "35722:19:70", + "nodeType": "YulFunctionCall", + "src": "35722:19:70" + }, + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "35747:2:70", + "nodeType": "YulLiteral", + "src": "35747:2:70", + "type": "", + "value": "95" + } + ], + "functionName": { + "name": "not", + "nativeSrc": "35743:3:70", + "nodeType": "YulIdentifier", + "src": "35743:3:70" + }, + "nativeSrc": "35743:7:70", + "nodeType": "YulFunctionCall", + "src": "35743:7:70" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "35718:3:70", + "nodeType": "YulIdentifier", + "src": "35718:3:70" + }, + "nativeSrc": "35718:33:70", + "nodeType": "YulFunctionCall", + "src": "35718:33:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "35689:6:70", + "nodeType": "YulIdentifier", + "src": "35689:6:70" + }, + "nativeSrc": "35689:63:70", + "nodeType": "YulFunctionCall", + "src": "35689:63:70" + }, + "nativeSrc": "35689:63:70", + "nodeType": "YulExpressionStatement", + "src": "35689:63:70" + }, + { + "nativeSrc": "35761:46:70", + "nodeType": "YulAssignment", + "src": "35761:46:70", + "value": { + "arguments": [ + { + "name": "memberValue0_4", + "nativeSrc": "35787:14:70", + "nodeType": "YulIdentifier", + "src": "35787:14:70" + }, + { + "name": "end", + "nativeSrc": "35803:3:70", + "nodeType": "YulIdentifier", + "src": "35803:3:70" + } + ], + "functionName": { + "name": "abi_encode_string", + "nativeSrc": "35769:17:70", + "nodeType": "YulIdentifier", + "src": "35769:17:70" + }, + "nativeSrc": "35769:38:70", + "nodeType": "YulFunctionCall", + "src": "35769:38:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "35761:4:70", + "nodeType": "YulIdentifier", + "src": "35761:4:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "35827:9:70", + "nodeType": "YulIdentifier", + "src": "35827:9:70" + }, + { + "kind": "number", + "nativeSrc": "35838:4:70", + "nodeType": "YulLiteral", + "src": "35838:4:70", + "type": "", + "value": "0x20" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "35823:3:70", + "nodeType": "YulIdentifier", + "src": "35823:3:70" + }, + "nativeSrc": "35823:20:70", + "nodeType": "YulFunctionCall", + "src": "35823:20:70" + }, + { + "name": "value1", + "nativeSrc": "35845:6:70", + "nodeType": "YulIdentifier", + "src": "35845:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "35816:6:70", + "nodeType": "YulIdentifier", + "src": "35816:6:70" + }, + "nativeSrc": "35816:36:70", + "nodeType": "YulFunctionCall", + "src": "35816:36:70" + }, + "nativeSrc": "35816:36:70", + "nodeType": "YulExpressionStatement", + "src": "35816:36:70" + }, + { + "expression": { + "arguments": [ + { + "name": "value2", + "nativeSrc": "35880:6:70", + "nodeType": "YulIdentifier", + "src": "35880:6:70" + }, + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "35892:9:70", + "nodeType": "YulIdentifier", + "src": "35892:9:70" + }, + { + "kind": "number", + "nativeSrc": "35903:4:70", + "nodeType": "YulLiteral", + "src": "35903:4:70", + "type": "", + "value": "0x40" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "35888:3:70", + "nodeType": "YulIdentifier", + "src": "35888:3:70" + }, + "nativeSrc": "35888:20:70", + "nodeType": "YulFunctionCall", + "src": "35888:20:70" + } + ], + "functionName": { + "name": "abi_encode_address", + "nativeSrc": "35861:18:70", + "nodeType": "YulIdentifier", + "src": "35861:18:70" + }, + "nativeSrc": "35861:48:70", + "nodeType": "YulFunctionCall", + "src": "35861:48:70" + }, + "nativeSrc": "35861:48:70", + "nodeType": "YulExpressionStatement", + "src": "35861:48:70" + } + ] + }, + "name": "abi_encode_tuple_t_struct$_SignedRAV_$2525_memory_ptr_t_uint256_t_address__to_t_struct$_SignedRAV_$2525_memory_ptr_t_uint256_t_address__fromStack_reversed", + "nativeSrc": "34538:1377:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "34702:9:70", + "nodeType": "YulTypedName", + "src": "34702:9:70", + "type": "" + }, + { + "name": "value2", + "nativeSrc": "34713:6:70", + "nodeType": "YulTypedName", + "src": "34713:6:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "34721:6:70", + "nodeType": "YulTypedName", + "src": "34721:6:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "34729:6:70", + "nodeType": "YulTypedName", + "src": "34729:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "34740:4:70", + "nodeType": "YulTypedName", + "src": "34740:4:70", + "type": "" + } + ], + "src": "34538:1377:70" + }, + { + "body": { + "nativeSrc": "36094:158:70", + "nodeType": "YulBlock", + "src": "36094:158:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "36111:9:70", + "nodeType": "YulIdentifier", + "src": "36111:9:70" + }, + { + "kind": "number", + "nativeSrc": "36122:2:70", + "nodeType": "YulLiteral", + "src": "36122:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "36104:6:70", + "nodeType": "YulIdentifier", + "src": "36104:6:70" + }, + "nativeSrc": "36104:21:70", + "nodeType": "YulFunctionCall", + "src": "36104:21:70" + }, + "nativeSrc": "36104:21:70", + "nodeType": "YulExpressionStatement", + "src": "36104:21:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "36145:9:70", + "nodeType": "YulIdentifier", + "src": "36145:9:70" + }, + { + "kind": "number", + "nativeSrc": "36156:2:70", + "nodeType": "YulLiteral", + "src": "36156:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "36141:3:70", + "nodeType": "YulIdentifier", + "src": "36141:3:70" + }, + "nativeSrc": "36141:18:70", + "nodeType": "YulFunctionCall", + "src": "36141:18:70" + }, + { + "kind": "number", + "nativeSrc": "36161:1:70", + "nodeType": "YulLiteral", + "src": "36161:1:70", + "type": "", + "value": "9" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "36134:6:70", + "nodeType": "YulIdentifier", + "src": "36134:6:70" + }, + "nativeSrc": "36134:29:70", + "nodeType": "YulFunctionCall", + "src": "36134:29:70" + }, + "nativeSrc": "36134:29:70", + "nodeType": "YulExpressionStatement", + "src": "36134:29:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "36183:9:70", + "nodeType": "YulIdentifier", + "src": "36183:9:70" + }, + { + "kind": "number", + "nativeSrc": "36194:2:70", + "nodeType": "YulLiteral", + "src": "36194:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "36179:3:70", + "nodeType": "YulIdentifier", + "src": "36179:3:70" + }, + "nativeSrc": "36179:18:70", + "nodeType": "YulFunctionCall", + "src": "36179:18:70" + }, + { + "hexValue": "217472616e73666572", + "kind": "string", + "nativeSrc": "36199:11:70", + "nodeType": "YulLiteral", + "src": "36199:11:70", + "type": "", + "value": "!transfer" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "36172:6:70", + "nodeType": "YulIdentifier", + "src": "36172:6:70" + }, + "nativeSrc": "36172:39:70", + "nodeType": "YulFunctionCall", + "src": "36172:39:70" + }, + "nativeSrc": "36172:39:70", + "nodeType": "YulExpressionStatement", + "src": "36172:39:70" + }, + { + "nativeSrc": "36220:26:70", + "nodeType": "YulAssignment", + "src": "36220:26:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "36232:9:70", + "nodeType": "YulIdentifier", + "src": "36232:9:70" + }, + { + "kind": "number", + "nativeSrc": "36243:2:70", + "nodeType": "YulLiteral", + "src": "36243:2:70", + "type": "", + "value": "96" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "36228:3:70", + "nodeType": "YulIdentifier", + "src": "36228:3:70" + }, + "nativeSrc": "36228:18:70", + "nodeType": "YulFunctionCall", + "src": "36228:18:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "36220:4:70", + "nodeType": "YulIdentifier", + "src": "36220:4:70" + } + ] + } + ] + }, + "name": "abi_encode_tuple_t_stringliteral_aaf3daf27360df170a52f29a0edeebb3d20b8e3dc84a13c5eaf056803b549f50__to_t_string_memory_ptr__fromStack_reversed", + "nativeSrc": "35920:332:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "36071:9:70", + "nodeType": "YulTypedName", + "src": "36071:9:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "36085:4:70", + "nodeType": "YulTypedName", + "src": "36085:4:70", + "type": "" + } + ], + "src": "35920:332:70" + }, + { + "body": { + "nativeSrc": "36429:236:70", + "nodeType": "YulBlock", + "src": "36429:236:70", + "statements": [ + { + "nativeSrc": "36439:26:70", + "nodeType": "YulAssignment", + "src": "36439:26:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "36451:9:70", + "nodeType": "YulIdentifier", + "src": "36451:9:70" + }, + { + "kind": "number", + "nativeSrc": "36462:2:70", + "nodeType": "YulLiteral", + "src": "36462:2:70", + "type": "", + "value": "96" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "36447:3:70", + "nodeType": "YulIdentifier", + "src": "36447:3:70" + }, + "nativeSrc": "36447:18:70", + "nodeType": "YulFunctionCall", + "src": "36447:18:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "36439:4:70", + "nodeType": "YulIdentifier", + "src": "36439:4:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "36481:9:70", + "nodeType": "YulIdentifier", + "src": "36481:9:70" + }, + { + "arguments": [ + { + "name": "value0", + "nativeSrc": "36496:6:70", + "nodeType": "YulIdentifier", + "src": "36496:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "36512:3:70", + "nodeType": "YulLiteral", + "src": "36512:3:70", + "type": "", + "value": "160" + }, + { + "kind": "number", + "nativeSrc": "36517:1:70", + "nodeType": "YulLiteral", + "src": "36517:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "36508:3:70", + "nodeType": "YulIdentifier", + "src": "36508:3:70" + }, + "nativeSrc": "36508:11:70", + "nodeType": "YulFunctionCall", + "src": "36508:11:70" + }, + { + "kind": "number", + "nativeSrc": "36521:1:70", + "nodeType": "YulLiteral", + "src": "36521:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "36504:3:70", + "nodeType": "YulIdentifier", + "src": "36504:3:70" + }, + "nativeSrc": "36504:19:70", + "nodeType": "YulFunctionCall", + "src": "36504:19:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "36492:3:70", + "nodeType": "YulIdentifier", + "src": "36492:3:70" + }, + "nativeSrc": "36492:32:70", + "nodeType": "YulFunctionCall", + "src": "36492:32:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "36474:6:70", + "nodeType": "YulIdentifier", + "src": "36474:6:70" + }, + "nativeSrc": "36474:51:70", + "nodeType": "YulFunctionCall", + "src": "36474:51:70" + }, + "nativeSrc": "36474:51:70", + "nodeType": "YulExpressionStatement", + "src": "36474:51:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "36545:9:70", + "nodeType": "YulIdentifier", + "src": "36545:9:70" + }, + { + "kind": "number", + "nativeSrc": "36556:2:70", + "nodeType": "YulLiteral", + "src": "36556:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "36541:3:70", + "nodeType": "YulIdentifier", + "src": "36541:3:70" + }, + "nativeSrc": "36541:18:70", + "nodeType": "YulFunctionCall", + "src": "36541:18:70" + }, + { + "arguments": [ + { + "name": "value1", + "nativeSrc": "36565:6:70", + "nodeType": "YulIdentifier", + "src": "36565:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "36581:3:70", + "nodeType": "YulLiteral", + "src": "36581:3:70", + "type": "", + "value": "160" + }, + { + "kind": "number", + "nativeSrc": "36586:1:70", + "nodeType": "YulLiteral", + "src": "36586:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "36577:3:70", + "nodeType": "YulIdentifier", + "src": "36577:3:70" + }, + "nativeSrc": "36577:11:70", + "nodeType": "YulFunctionCall", + "src": "36577:11:70" + }, + { + "kind": "number", + "nativeSrc": "36590:1:70", + "nodeType": "YulLiteral", + "src": "36590:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "36573:3:70", + "nodeType": "YulIdentifier", + "src": "36573:3:70" + }, + "nativeSrc": "36573:19:70", + "nodeType": "YulFunctionCall", + "src": "36573:19:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "36561:3:70", + "nodeType": "YulIdentifier", + "src": "36561:3:70" + }, + "nativeSrc": "36561:32:70", + "nodeType": "YulFunctionCall", + "src": "36561:32:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "36534:6:70", + "nodeType": "YulIdentifier", + "src": "36534:6:70" + }, + "nativeSrc": "36534:60:70", + "nodeType": "YulFunctionCall", + "src": "36534:60:70" + }, + "nativeSrc": "36534:60:70", + "nodeType": "YulExpressionStatement", + "src": "36534:60:70" + }, + { + "expression": { + "arguments": [ + { + "name": "value2", + "nativeSrc": "36632:6:70", + "nodeType": "YulIdentifier", + "src": "36632:6:70" + }, + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "36644:9:70", + "nodeType": "YulIdentifier", + "src": "36644:9:70" + }, + { + "kind": "number", + "nativeSrc": "36655:2:70", + "nodeType": "YulLiteral", + "src": "36655:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "36640:3:70", + "nodeType": "YulIdentifier", + "src": "36640:3:70" + }, + "nativeSrc": "36640:18:70", + "nodeType": "YulFunctionCall", + "src": "36640:18:70" + } + ], + "functionName": { + "name": "abi_encode_enum_PaymentTypes", + "nativeSrc": "36603:28:70", + "nodeType": "YulIdentifier", + "src": "36603:28:70" + }, + "nativeSrc": "36603:56:70", + "nodeType": "YulFunctionCall", + "src": "36603:56:70" + }, + "nativeSrc": "36603:56:70", + "nodeType": "YulExpressionStatement", + "src": "36603:56:70" + } + ] + }, + "name": "abi_encode_tuple_t_address_t_address_t_enum$_PaymentTypes_$2433__to_t_address_t_address_t_uint8__fromStack_reversed", + "nativeSrc": "36257:408:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "36382:9:70", + "nodeType": "YulTypedName", + "src": "36382:9:70", + "type": "" + }, + { + "name": "value2", + "nativeSrc": "36393:6:70", + "nodeType": "YulTypedName", + "src": "36393:6:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "36401:6:70", + "nodeType": "YulTypedName", + "src": "36401:6:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "36409:6:70", + "nodeType": "YulTypedName", + "src": "36409:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "36420:4:70", + "nodeType": "YulTypedName", + "src": "36420:4:70", + "type": "" + } + ], + "src": "36257:408:70" + }, + { + "body": { + "nativeSrc": "36783:893:70", + "nodeType": "YulBlock", + "src": "36783:893:70", + "statements": [ + { + "nativeSrc": "36793:43:70", + "nodeType": "YulVariableDeclaration", + "src": "36793:43:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "dataEnd", + "nativeSrc": "36811:7:70", + "nodeType": "YulIdentifier", + "src": "36811:7:70" + }, + { + "name": "headStart", + "nativeSrc": "36820:9:70", + "nodeType": "YulIdentifier", + "src": "36820:9:70" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "36807:3:70", + "nodeType": "YulIdentifier", + "src": "36807:3:70" + }, + "nativeSrc": "36807:23:70", + "nodeType": "YulFunctionCall", + "src": "36807:23:70" + }, + { + "kind": "number", + "nativeSrc": "36832:3:70", + "nodeType": "YulLiteral", + "src": "36832:3:70", + "type": "", + "value": "160" + } + ], + "functionName": { + "name": "slt", + "nativeSrc": "36803:3:70", + "nodeType": "YulIdentifier", + "src": "36803:3:70" + }, + "nativeSrc": "36803:33:70", + "nodeType": "YulFunctionCall", + "src": "36803:33:70" + }, + "variables": [ + { + "name": "_1", + "nativeSrc": "36797:2:70", + "nodeType": "YulTypedName", + "src": "36797:2:70", + "type": "" + } + ] + }, + { + "body": { + "nativeSrc": "36851:16:70", + "nodeType": "YulBlock", + "src": "36851:16:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "36860:1:70", + "nodeType": "YulLiteral", + "src": "36860:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "36863:1:70", + "nodeType": "YulLiteral", + "src": "36863:1:70", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "36853:6:70", + "nodeType": "YulIdentifier", + "src": "36853:6:70" + }, + "nativeSrc": "36853:12:70", + "nodeType": "YulFunctionCall", + "src": "36853:12:70" + }, + "nativeSrc": "36853:12:70", + "nodeType": "YulExpressionStatement", + "src": "36853:12:70" + } + ] + }, + "condition": { + "name": "_1", + "nativeSrc": "36848:2:70", + "nodeType": "YulIdentifier", + "src": "36848:2:70" + }, + "nativeSrc": "36845:22:70", + "nodeType": "YulIf", + "src": "36845:22:70" + }, + { + "nativeSrc": "36876:7:70", + "nodeType": "YulAssignment", + "src": "36876:7:70", + "value": { + "kind": "number", + "nativeSrc": "36882:1:70", + "nodeType": "YulLiteral", + "src": "36882:1:70", + "type": "", + "value": "0" + }, + "variableNames": [ + { + "name": "_1", + "nativeSrc": "36876:2:70", + "nodeType": "YulIdentifier", + "src": "36876:2:70" + } + ] + }, + { + "nativeSrc": "36892:16:70", + "nodeType": "YulVariableDeclaration", + "src": "36892:16:70", + "value": { + "name": "_1", + "nativeSrc": "36906:2:70", + "nodeType": "YulIdentifier", + "src": "36906:2:70" + }, + "variables": [ + { + "name": "memPtr", + "nativeSrc": "36896:6:70", + "nodeType": "YulTypedName", + "src": "36896:6:70", + "type": "" + } + ] + }, + { + "nativeSrc": "36917:19:70", + "nodeType": "YulAssignment", + "src": "36917:19:70", + "value": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "36933:2:70", + "nodeType": "YulLiteral", + "src": "36933:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "36927:5:70", + "nodeType": "YulIdentifier", + "src": "36927:5:70" + }, + "nativeSrc": "36927:9:70", + "nodeType": "YulFunctionCall", + "src": "36927:9:70" + }, + "variableNames": [ + { + "name": "memPtr", + "nativeSrc": "36917:6:70", + "nodeType": "YulIdentifier", + "src": "36917:6:70" + } + ] + }, + { + "nativeSrc": "36945:34:70", + "nodeType": "YulVariableDeclaration", + "src": "36945:34:70", + "value": { + "arguments": [ + { + "name": "memPtr", + "nativeSrc": "36967:6:70", + "nodeType": "YulIdentifier", + "src": "36967:6:70" + }, + { + "kind": "number", + "nativeSrc": "36975:3:70", + "nodeType": "YulLiteral", + "src": "36975:3:70", + "type": "", + "value": "160" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "36963:3:70", + "nodeType": "YulIdentifier", + "src": "36963:3:70" + }, + "nativeSrc": "36963:16:70", + "nodeType": "YulFunctionCall", + "src": "36963:16:70" + }, + "variables": [ + { + "name": "newFreePtr", + "nativeSrc": "36949:10:70", + "nodeType": "YulTypedName", + "src": "36949:10:70", + "type": "" + } + ] + }, + { + "body": { + "nativeSrc": "37054:22:70", + "nodeType": "YulBlock", + "src": "37054:22:70", + "statements": [ + { + "expression": { + "arguments": [], + "functionName": { + "name": "panic_error_0x41", + "nativeSrc": "37056:16:70", + "nodeType": "YulIdentifier", + "src": "37056:16:70" + }, + "nativeSrc": "37056:18:70", + "nodeType": "YulFunctionCall", + "src": "37056:18:70" + }, + "nativeSrc": "37056:18:70", + "nodeType": "YulExpressionStatement", + "src": "37056:18:70" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "newFreePtr", + "nativeSrc": "36997:10:70", + "nodeType": "YulIdentifier", + "src": "36997:10:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "37017:2:70", + "nodeType": "YulLiteral", + "src": "37017:2:70", + "type": "", + "value": "64" + }, + { + "kind": "number", + "nativeSrc": "37021:1:70", + "nodeType": "YulLiteral", + "src": "37021:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "37013:3:70", + "nodeType": "YulIdentifier", + "src": "37013:3:70" + }, + "nativeSrc": "37013:10:70", + "nodeType": "YulFunctionCall", + "src": "37013:10:70" + }, + { + "kind": "number", + "nativeSrc": "37025:1:70", + "nodeType": "YulLiteral", + "src": "37025:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "37009:3:70", + "nodeType": "YulIdentifier", + "src": "37009:3:70" + }, + "nativeSrc": "37009:18:70", + "nodeType": "YulFunctionCall", + "src": "37009:18:70" + } + ], + "functionName": { + "name": "gt", + "nativeSrc": "36994:2:70", + "nodeType": "YulIdentifier", + "src": "36994:2:70" + }, + "nativeSrc": "36994:34:70", + "nodeType": "YulFunctionCall", + "src": "36994:34:70" + }, + { + "arguments": [ + { + "name": "newFreePtr", + "nativeSrc": "37033:10:70", + "nodeType": "YulIdentifier", + "src": "37033:10:70" + }, + { + "name": "memPtr", + "nativeSrc": "37045:6:70", + "nodeType": "YulIdentifier", + "src": "37045:6:70" + } + ], + "functionName": { + "name": "lt", + "nativeSrc": "37030:2:70", + "nodeType": "YulIdentifier", + "src": "37030:2:70" + }, + "nativeSrc": "37030:22:70", + "nodeType": "YulFunctionCall", + "src": "37030:22:70" + } + ], + "functionName": { + "name": "or", + "nativeSrc": "36991:2:70", + "nodeType": "YulIdentifier", + "src": "36991:2:70" + }, + "nativeSrc": "36991:62:70", + "nodeType": "YulFunctionCall", + "src": "36991:62:70" + }, + "nativeSrc": "36988:88:70", + "nodeType": "YulIf", + "src": "36988:88:70" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "37092:2:70", + "nodeType": "YulLiteral", + "src": "37092:2:70", + "type": "", + "value": "64" + }, + { + "name": "newFreePtr", + "nativeSrc": "37096:10:70", + "nodeType": "YulIdentifier", + "src": "37096:10:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "37085:6:70", + "nodeType": "YulIdentifier", + "src": "37085:6:70" + }, + "nativeSrc": "37085:22:70", + "nodeType": "YulFunctionCall", + "src": "37085:22:70" + }, + "nativeSrc": "37085:22:70", + "nodeType": "YulExpressionStatement", + "src": "37085:22:70" + }, + { + "nativeSrc": "37116:15:70", + "nodeType": "YulVariableDeclaration", + "src": "37116:15:70", + "value": { + "name": "_1", + "nativeSrc": "37129:2:70", + "nodeType": "YulIdentifier", + "src": "37129:2:70" + }, + "variables": [ + { + "name": "value", + "nativeSrc": "37120:5:70", + "nodeType": "YulTypedName", + "src": "37120:5:70", + "type": "" + } + ] + }, + { + "nativeSrc": "37140:25:70", + "nodeType": "YulAssignment", + "src": "37140:25:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "37155:9:70", + "nodeType": "YulIdentifier", + "src": "37155:9:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "37149:5:70", + "nodeType": "YulIdentifier", + "src": "37149:5:70" + }, + "nativeSrc": "37149:16:70", + "nodeType": "YulFunctionCall", + "src": "37149:16:70" + }, + "variableNames": [ + { + "name": "value", + "nativeSrc": "37140:5:70", + "nodeType": "YulIdentifier", + "src": "37140:5:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "memPtr", + "nativeSrc": "37181:6:70", + "nodeType": "YulIdentifier", + "src": "37181:6:70" + }, + { + "name": "value", + "nativeSrc": "37189:5:70", + "nodeType": "YulIdentifier", + "src": "37189:5:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "37174:6:70", + "nodeType": "YulIdentifier", + "src": "37174:6:70" + }, + "nativeSrc": "37174:21:70", + "nodeType": "YulFunctionCall", + "src": "37174:21:70" + }, + "nativeSrc": "37174:21:70", + "nodeType": "YulExpressionStatement", + "src": "37174:21:70" + }, + { + "nativeSrc": "37204:17:70", + "nodeType": "YulVariableDeclaration", + "src": "37204:17:70", + "value": { + "name": "_1", + "nativeSrc": "37219:2:70", + "nodeType": "YulIdentifier", + "src": "37219:2:70" + }, + "variables": [ + { + "name": "value_1", + "nativeSrc": "37208:7:70", + "nodeType": "YulTypedName", + "src": "37208:7:70", + "type": "" + } + ] + }, + { + "nativeSrc": "37230:36:70", + "nodeType": "YulAssignment", + "src": "37230:36:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "37251:9:70", + "nodeType": "YulIdentifier", + "src": "37251:9:70" + }, + { + "kind": "number", + "nativeSrc": "37262:2:70", + "nodeType": "YulLiteral", + "src": "37262:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "37247:3:70", + "nodeType": "YulIdentifier", + "src": "37247:3:70" + }, + "nativeSrc": "37247:18:70", + "nodeType": "YulFunctionCall", + "src": "37247:18:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "37241:5:70", + "nodeType": "YulIdentifier", + "src": "37241:5:70" + }, + "nativeSrc": "37241:25:70", + "nodeType": "YulFunctionCall", + "src": "37241:25:70" + }, + "variableNames": [ + { + "name": "value_1", + "nativeSrc": "37230:7:70", + "nodeType": "YulIdentifier", + "src": "37230:7:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "memPtr", + "nativeSrc": "37286:6:70", + "nodeType": "YulIdentifier", + "src": "37286:6:70" + }, + { + "kind": "number", + "nativeSrc": "37294:2:70", + "nodeType": "YulLiteral", + "src": "37294:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "37282:3:70", + "nodeType": "YulIdentifier", + "src": "37282:3:70" + }, + "nativeSrc": "37282:15:70", + "nodeType": "YulFunctionCall", + "src": "37282:15:70" + }, + { + "name": "value_1", + "nativeSrc": "37299:7:70", + "nodeType": "YulIdentifier", + "src": "37299:7:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "37275:6:70", + "nodeType": "YulIdentifier", + "src": "37275:6:70" + }, + "nativeSrc": "37275:32:70", + "nodeType": "YulFunctionCall", + "src": "37275:32:70" + }, + "nativeSrc": "37275:32:70", + "nodeType": "YulExpressionStatement", + "src": "37275:32:70" + }, + { + "nativeSrc": "37316:17:70", + "nodeType": "YulVariableDeclaration", + "src": "37316:17:70", + "value": { + "name": "_1", + "nativeSrc": "37331:2:70", + "nodeType": "YulIdentifier", + "src": "37331:2:70" + }, + "variables": [ + { + "name": "value_2", + "nativeSrc": "37320:7:70", + "nodeType": "YulTypedName", + "src": "37320:7:70", + "type": "" + } + ] + }, + { + "nativeSrc": "37342:36:70", + "nodeType": "YulAssignment", + "src": "37342:36:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "37363:9:70", + "nodeType": "YulIdentifier", + "src": "37363:9:70" + }, + { + "kind": "number", + "nativeSrc": "37374:2:70", + "nodeType": "YulLiteral", + "src": "37374:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "37359:3:70", + "nodeType": "YulIdentifier", + "src": "37359:3:70" + }, + "nativeSrc": "37359:18:70", + "nodeType": "YulFunctionCall", + "src": "37359:18:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "37353:5:70", + "nodeType": "YulIdentifier", + "src": "37353:5:70" + }, + "nativeSrc": "37353:25:70", + "nodeType": "YulFunctionCall", + "src": "37353:25:70" + }, + "variableNames": [ + { + "name": "value_2", + "nativeSrc": "37342:7:70", + "nodeType": "YulIdentifier", + "src": "37342:7:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "memPtr", + "nativeSrc": "37398:6:70", + "nodeType": "YulIdentifier", + "src": "37398:6:70" + }, + { + "kind": "number", + "nativeSrc": "37406:2:70", + "nodeType": "YulLiteral", + "src": "37406:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "37394:3:70", + "nodeType": "YulIdentifier", + "src": "37394:3:70" + }, + "nativeSrc": "37394:15:70", + "nodeType": "YulFunctionCall", + "src": "37394:15:70" + }, + { + "name": "value_2", + "nativeSrc": "37411:7:70", + "nodeType": "YulIdentifier", + "src": "37411:7:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "37387:6:70", + "nodeType": "YulIdentifier", + "src": "37387:6:70" + }, + "nativeSrc": "37387:32:70", + "nodeType": "YulFunctionCall", + "src": "37387:32:70" + }, + "nativeSrc": "37387:32:70", + "nodeType": "YulExpressionStatement", + "src": "37387:32:70" + }, + { + "nativeSrc": "37428:17:70", + "nodeType": "YulVariableDeclaration", + "src": "37428:17:70", + "value": { + "name": "_1", + "nativeSrc": "37443:2:70", + "nodeType": "YulIdentifier", + "src": "37443:2:70" + }, + "variables": [ + { + "name": "value_3", + "nativeSrc": "37432:7:70", + "nodeType": "YulTypedName", + "src": "37432:7:70", + "type": "" + } + ] + }, + { + "nativeSrc": "37454:36:70", + "nodeType": "YulAssignment", + "src": "37454:36:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "37475:9:70", + "nodeType": "YulIdentifier", + "src": "37475:9:70" + }, + { + "kind": "number", + "nativeSrc": "37486:2:70", + "nodeType": "YulLiteral", + "src": "37486:2:70", + "type": "", + "value": "96" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "37471:3:70", + "nodeType": "YulIdentifier", + "src": "37471:3:70" + }, + "nativeSrc": "37471:18:70", + "nodeType": "YulFunctionCall", + "src": "37471:18:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "37465:5:70", + "nodeType": "YulIdentifier", + "src": "37465:5:70" + }, + "nativeSrc": "37465:25:70", + "nodeType": "YulFunctionCall", + "src": "37465:25:70" + }, + "variableNames": [ + { + "name": "value_3", + "nativeSrc": "37454:7:70", + "nodeType": "YulIdentifier", + "src": "37454:7:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "memPtr", + "nativeSrc": "37510:6:70", + "nodeType": "YulIdentifier", + "src": "37510:6:70" + }, + { + "kind": "number", + "nativeSrc": "37518:2:70", + "nodeType": "YulLiteral", + "src": "37518:2:70", + "type": "", + "value": "96" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "37506:3:70", + "nodeType": "YulIdentifier", + "src": "37506:3:70" + }, + "nativeSrc": "37506:15:70", + "nodeType": "YulFunctionCall", + "src": "37506:15:70" + }, + { + "name": "value_3", + "nativeSrc": "37523:7:70", + "nodeType": "YulIdentifier", + "src": "37523:7:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "37499:6:70", + "nodeType": "YulIdentifier", + "src": "37499:6:70" + }, + "nativeSrc": "37499:32:70", + "nodeType": "YulFunctionCall", + "src": "37499:32:70" + }, + "nativeSrc": "37499:32:70", + "nodeType": "YulExpressionStatement", + "src": "37499:32:70" + }, + { + "nativeSrc": "37540:17:70", + "nodeType": "YulVariableDeclaration", + "src": "37540:17:70", + "value": { + "name": "_1", + "nativeSrc": "37555:2:70", + "nodeType": "YulIdentifier", + "src": "37555:2:70" + }, + "variables": [ + { + "name": "value_4", + "nativeSrc": "37544:7:70", + "nodeType": "YulTypedName", + "src": "37544:7:70", + "type": "" + } + ] + }, + { + "nativeSrc": "37566:37:70", + "nodeType": "YulAssignment", + "src": "37566:37:70", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "37587:9:70", + "nodeType": "YulIdentifier", + "src": "37587:9:70" + }, + { + "kind": "number", + "nativeSrc": "37598:3:70", + "nodeType": "YulLiteral", + "src": "37598:3:70", + "type": "", + "value": "128" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "37583:3:70", + "nodeType": "YulIdentifier", + "src": "37583:3:70" + }, + "nativeSrc": "37583:19:70", + "nodeType": "YulFunctionCall", + "src": "37583:19:70" + } + ], + "functionName": { + "name": "mload", + "nativeSrc": "37577:5:70", + "nodeType": "YulIdentifier", + "src": "37577:5:70" + }, + "nativeSrc": "37577:26:70", + "nodeType": "YulFunctionCall", + "src": "37577:26:70" + }, + "variableNames": [ + { + "name": "value_4", + "nativeSrc": "37566:7:70", + "nodeType": "YulIdentifier", + "src": "37566:7:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "memPtr", + "nativeSrc": "37623:6:70", + "nodeType": "YulIdentifier", + "src": "37623:6:70" + }, + { + "kind": "number", + "nativeSrc": "37631:3:70", + "nodeType": "YulLiteral", + "src": "37631:3:70", + "type": "", + "value": "128" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "37619:3:70", + "nodeType": "YulIdentifier", + "src": "37619:3:70" + }, + "nativeSrc": "37619:16:70", + "nodeType": "YulFunctionCall", + "src": "37619:16:70" + }, + { + "name": "value_4", + "nativeSrc": "37637:7:70", + "nodeType": "YulIdentifier", + "src": "37637:7:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "37612:6:70", + "nodeType": "YulIdentifier", + "src": "37612:6:70" + }, + "nativeSrc": "37612:33:70", + "nodeType": "YulFunctionCall", + "src": "37612:33:70" + }, + "nativeSrc": "37612:33:70", + "nodeType": "YulExpressionStatement", + "src": "37612:33:70" + }, + { + "nativeSrc": "37654:16:70", + "nodeType": "YulAssignment", + "src": "37654:16:70", + "value": { + "name": "memPtr", + "nativeSrc": "37664:6:70", + "nodeType": "YulIdentifier", + "src": "37664:6:70" + }, + "variableNames": [ + { + "name": "value0", + "nativeSrc": "37654:6:70", + "nodeType": "YulIdentifier", + "src": "37654:6:70" + } + ] + } + ] + }, + "name": "abi_decode_tuple_t_struct$_DelegationPool_$3992_memory_ptr_fromMemory", + "nativeSrc": "36670:1006:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "36749:9:70", + "nodeType": "YulTypedName", + "src": "36749:9:70", + "type": "" + }, + { + "name": "dataEnd", + "nativeSrc": "36760:7:70", + "nodeType": "YulTypedName", + "src": "36760:7:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value0", + "nativeSrc": "36772:6:70", + "nodeType": "YulTypedName", + "src": "36772:6:70", + "type": "" + } + ], + "src": "36670:1006:70" + }, + { + "body": { + "nativeSrc": "37838:214:70", + "nodeType": "YulBlock", + "src": "37838:214:70", + "statements": [ + { + "nativeSrc": "37848:26:70", + "nodeType": "YulAssignment", + "src": "37848:26:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "37860:9:70", + "nodeType": "YulIdentifier", + "src": "37860:9:70" + }, + { + "kind": "number", + "nativeSrc": "37871:2:70", + "nodeType": "YulLiteral", + "src": "37871:2:70", + "type": "", + "value": "96" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "37856:3:70", + "nodeType": "YulIdentifier", + "src": "37856:3:70" + }, + "nativeSrc": "37856:18:70", + "nodeType": "YulFunctionCall", + "src": "37856:18:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "37848:4:70", + "nodeType": "YulIdentifier", + "src": "37848:4:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "37890:9:70", + "nodeType": "YulIdentifier", + "src": "37890:9:70" + }, + { + "arguments": [ + { + "name": "value0", + "nativeSrc": "37905:6:70", + "nodeType": "YulIdentifier", + "src": "37905:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "37921:3:70", + "nodeType": "YulLiteral", + "src": "37921:3:70", + "type": "", + "value": "160" + }, + { + "kind": "number", + "nativeSrc": "37926:1:70", + "nodeType": "YulLiteral", + "src": "37926:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "37917:3:70", + "nodeType": "YulIdentifier", + "src": "37917:3:70" + }, + "nativeSrc": "37917:11:70", + "nodeType": "YulFunctionCall", + "src": "37917:11:70" + }, + { + "kind": "number", + "nativeSrc": "37930:1:70", + "nodeType": "YulLiteral", + "src": "37930:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "37913:3:70", + "nodeType": "YulIdentifier", + "src": "37913:3:70" + }, + "nativeSrc": "37913:19:70", + "nodeType": "YulFunctionCall", + "src": "37913:19:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "37901:3:70", + "nodeType": "YulIdentifier", + "src": "37901:3:70" + }, + "nativeSrc": "37901:32:70", + "nodeType": "YulFunctionCall", + "src": "37901:32:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "37883:6:70", + "nodeType": "YulIdentifier", + "src": "37883:6:70" + }, + "nativeSrc": "37883:51:70", + "nodeType": "YulFunctionCall", + "src": "37883:51:70" + }, + "nativeSrc": "37883:51:70", + "nodeType": "YulExpressionStatement", + "src": "37883:51:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "37954:9:70", + "nodeType": "YulIdentifier", + "src": "37954:9:70" + }, + { + "kind": "number", + "nativeSrc": "37965:2:70", + "nodeType": "YulLiteral", + "src": "37965:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "37950:3:70", + "nodeType": "YulIdentifier", + "src": "37950:3:70" + }, + "nativeSrc": "37950:18:70", + "nodeType": "YulFunctionCall", + "src": "37950:18:70" + }, + { + "arguments": [ + { + "name": "value1", + "nativeSrc": "37974:6:70", + "nodeType": "YulIdentifier", + "src": "37974:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "37990:3:70", + "nodeType": "YulLiteral", + "src": "37990:3:70", + "type": "", + "value": "160" + }, + { + "kind": "number", + "nativeSrc": "37995:1:70", + "nodeType": "YulLiteral", + "src": "37995:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "37986:3:70", + "nodeType": "YulIdentifier", + "src": "37986:3:70" + }, + "nativeSrc": "37986:11:70", + "nodeType": "YulFunctionCall", + "src": "37986:11:70" + }, + { + "kind": "number", + "nativeSrc": "37999:1:70", + "nodeType": "YulLiteral", + "src": "37999:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "37982:3:70", + "nodeType": "YulIdentifier", + "src": "37982:3:70" + }, + "nativeSrc": "37982:19:70", + "nodeType": "YulFunctionCall", + "src": "37982:19:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "37970:3:70", + "nodeType": "YulIdentifier", + "src": "37970:3:70" + }, + "nativeSrc": "37970:32:70", + "nodeType": "YulFunctionCall", + "src": "37970:32:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "37943:6:70", + "nodeType": "YulIdentifier", + "src": "37943:6:70" + }, + "nativeSrc": "37943:60:70", + "nodeType": "YulFunctionCall", + "src": "37943:60:70" + }, + "nativeSrc": "37943:60:70", + "nodeType": "YulExpressionStatement", + "src": "37943:60:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "38023:9:70", + "nodeType": "YulIdentifier", + "src": "38023:9:70" + }, + { + "kind": "number", + "nativeSrc": "38034:2:70", + "nodeType": "YulLiteral", + "src": "38034:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "38019:3:70", + "nodeType": "YulIdentifier", + "src": "38019:3:70" + }, + "nativeSrc": "38019:18:70", + "nodeType": "YulFunctionCall", + "src": "38019:18:70" + }, + { + "name": "value2", + "nativeSrc": "38039:6:70", + "nodeType": "YulIdentifier", + "src": "38039:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "38012:6:70", + "nodeType": "YulIdentifier", + "src": "38012:6:70" + }, + "nativeSrc": "38012:34:70", + "nodeType": "YulFunctionCall", + "src": "38012:34:70" + }, + "nativeSrc": "38012:34:70", + "nodeType": "YulExpressionStatement", + "src": "38012:34:70" + } + ] + }, + "name": "abi_encode_tuple_t_address_t_address_t_uint256__to_t_address_t_address_t_uint256__fromStack_reversed", + "nativeSrc": "37681:371:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "37791:9:70", + "nodeType": "YulTypedName", + "src": "37791:9:70", + "type": "" + }, + { + "name": "value2", + "nativeSrc": "37802:6:70", + "nodeType": "YulTypedName", + "src": "37802:6:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "37810:6:70", + "nodeType": "YulTypedName", + "src": "37810:6:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "37818:6:70", + "nodeType": "YulTypedName", + "src": "37818:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "37829:4:70", + "nodeType": "YulTypedName", + "src": "37829:4:70", + "type": "" + } + ], + "src": "37681:371:70" + }, + { + "body": { + "nativeSrc": "38316:318:70", + "nodeType": "YulBlock", + "src": "38316:318:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "38333:9:70", + "nodeType": "YulIdentifier", + "src": "38333:9:70" + }, + { + "name": "value0", + "nativeSrc": "38344:6:70", + "nodeType": "YulIdentifier", + "src": "38344:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "38326:6:70", + "nodeType": "YulIdentifier", + "src": "38326:6:70" + }, + "nativeSrc": "38326:25:70", + "nodeType": "YulFunctionCall", + "src": "38326:25:70" + }, + "nativeSrc": "38326:25:70", + "nodeType": "YulExpressionStatement", + "src": "38326:25:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "38371:9:70", + "nodeType": "YulIdentifier", + "src": "38371:9:70" + }, + { + "kind": "number", + "nativeSrc": "38382:2:70", + "nodeType": "YulLiteral", + "src": "38382:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "38367:3:70", + "nodeType": "YulIdentifier", + "src": "38367:3:70" + }, + "nativeSrc": "38367:18:70", + "nodeType": "YulFunctionCall", + "src": "38367:18:70" + }, + { + "name": "value1", + "nativeSrc": "38387:6:70", + "nodeType": "YulIdentifier", + "src": "38387:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "38360:6:70", + "nodeType": "YulIdentifier", + "src": "38360:6:70" + }, + "nativeSrc": "38360:34:70", + "nodeType": "YulFunctionCall", + "src": "38360:34:70" + }, + "nativeSrc": "38360:34:70", + "nodeType": "YulExpressionStatement", + "src": "38360:34:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "38414:9:70", + "nodeType": "YulIdentifier", + "src": "38414:9:70" + }, + { + "kind": "number", + "nativeSrc": "38425:2:70", + "nodeType": "YulLiteral", + "src": "38425:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "38410:3:70", + "nodeType": "YulIdentifier", + "src": "38410:3:70" + }, + "nativeSrc": "38410:18:70", + "nodeType": "YulFunctionCall", + "src": "38410:18:70" + }, + { + "name": "value2", + "nativeSrc": "38430:6:70", + "nodeType": "YulIdentifier", + "src": "38430:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "38403:6:70", + "nodeType": "YulIdentifier", + "src": "38403:6:70" + }, + "nativeSrc": "38403:34:70", + "nodeType": "YulFunctionCall", + "src": "38403:34:70" + }, + "nativeSrc": "38403:34:70", + "nodeType": "YulExpressionStatement", + "src": "38403:34:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "38457:9:70", + "nodeType": "YulIdentifier", + "src": "38457:9:70" + }, + { + "kind": "number", + "nativeSrc": "38468:2:70", + "nodeType": "YulLiteral", + "src": "38468:2:70", + "type": "", + "value": "96" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "38453:3:70", + "nodeType": "YulIdentifier", + "src": "38453:3:70" + }, + "nativeSrc": "38453:18:70", + "nodeType": "YulFunctionCall", + "src": "38453:18:70" + }, + { + "name": "value3", + "nativeSrc": "38473:6:70", + "nodeType": "YulIdentifier", + "src": "38473:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "38446:6:70", + "nodeType": "YulIdentifier", + "src": "38446:6:70" + }, + "nativeSrc": "38446:34:70", + "nodeType": "YulFunctionCall", + "src": "38446:34:70" + }, + "nativeSrc": "38446:34:70", + "nodeType": "YulExpressionStatement", + "src": "38446:34:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "38500:9:70", + "nodeType": "YulIdentifier", + "src": "38500:9:70" + }, + { + "kind": "number", + "nativeSrc": "38511:3:70", + "nodeType": "YulLiteral", + "src": "38511:3:70", + "type": "", + "value": "128" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "38496:3:70", + "nodeType": "YulIdentifier", + "src": "38496:3:70" + }, + "nativeSrc": "38496:19:70", + "nodeType": "YulFunctionCall", + "src": "38496:19:70" + }, + { + "kind": "number", + "nativeSrc": "38517:3:70", + "nodeType": "YulLiteral", + "src": "38517:3:70", + "type": "", + "value": "192" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "38489:6:70", + "nodeType": "YulIdentifier", + "src": "38489:6:70" + }, + "nativeSrc": "38489:32:70", + "nodeType": "YulFunctionCall", + "src": "38489:32:70" + }, + "nativeSrc": "38489:32:70", + "nodeType": "YulExpressionStatement", + "src": "38489:32:70" + }, + { + "nativeSrc": "38530:54:70", + "nodeType": "YulAssignment", + "src": "38530:54:70", + "value": { + "arguments": [ + { + "name": "value4", + "nativeSrc": "38556:6:70", + "nodeType": "YulIdentifier", + "src": "38556:6:70" + }, + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "38568:9:70", + "nodeType": "YulIdentifier", + "src": "38568:9:70" + }, + { + "kind": "number", + "nativeSrc": "38579:3:70", + "nodeType": "YulLiteral", + "src": "38579:3:70", + "type": "", + "value": "192" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "38564:3:70", + "nodeType": "YulIdentifier", + "src": "38564:3:70" + }, + "nativeSrc": "38564:19:70", + "nodeType": "YulFunctionCall", + "src": "38564:19:70" + } + ], + "functionName": { + "name": "abi_encode_string", + "nativeSrc": "38538:17:70", + "nodeType": "YulIdentifier", + "src": "38538:17:70" + }, + "nativeSrc": "38538:46:70", + "nodeType": "YulFunctionCall", + "src": "38538:46:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "38530:4:70", + "nodeType": "YulIdentifier", + "src": "38530:4:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "38604:9:70", + "nodeType": "YulIdentifier", + "src": "38604:9:70" + }, + { + "kind": "number", + "nativeSrc": "38615:3:70", + "nodeType": "YulLiteral", + "src": "38615:3:70", + "type": "", + "value": "160" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "38600:3:70", + "nodeType": "YulIdentifier", + "src": "38600:3:70" + }, + "nativeSrc": "38600:19:70", + "nodeType": "YulFunctionCall", + "src": "38600:19:70" + }, + { + "name": "value5", + "nativeSrc": "38621:6:70", + "nodeType": "YulIdentifier", + "src": "38621:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "38593:6:70", + "nodeType": "YulIdentifier", + "src": "38593:6:70" + }, + "nativeSrc": "38593:35:70", + "nodeType": "YulFunctionCall", + "src": "38593:35:70" + }, + "nativeSrc": "38593:35:70", + "nodeType": "YulExpressionStatement", + "src": "38593:35:70" + } + ] + }, + "name": "abi_encode_tuple_t_uint256_t_uint256_t_uint256_t_bytes32_t_bytes_memory_ptr_t_uint256__to_t_uint256_t_uint256_t_uint256_t_bytes32_t_bytes_memory_ptr_t_uint256__fromStack_reversed", + "nativeSrc": "38057:577:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "38245:9:70", + "nodeType": "YulTypedName", + "src": "38245:9:70", + "type": "" + }, + { + "name": "value5", + "nativeSrc": "38256:6:70", + "nodeType": "YulTypedName", + "src": "38256:6:70", + "type": "" + }, + { + "name": "value4", + "nativeSrc": "38264:6:70", + "nodeType": "YulTypedName", + "src": "38264:6:70", + "type": "" + }, + { + "name": "value3", + "nativeSrc": "38272:6:70", + "nodeType": "YulTypedName", + "src": "38272:6:70", + "type": "" + }, + { + "name": "value2", + "nativeSrc": "38280:6:70", + "nodeType": "YulTypedName", + "src": "38280:6:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "38288:6:70", + "nodeType": "YulTypedName", + "src": "38288:6:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "38296:6:70", + "nodeType": "YulTypedName", + "src": "38296:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "38307:4:70", + "nodeType": "YulTypedName", + "src": "38307:4:70", + "type": "" + } + ], + "src": "38057:577:70" + }, + { + "body": { + "nativeSrc": "38814:215:70", + "nodeType": "YulBlock", + "src": "38814:215:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "name": "pos", + "nativeSrc": "38831:3:70", + "nodeType": "YulIdentifier", + "src": "38831:3:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "38844:2:70", + "nodeType": "YulLiteral", + "src": "38844:2:70", + "type": "", + "value": "96" + }, + { + "name": "value0", + "nativeSrc": "38848:6:70", + "nodeType": "YulIdentifier", + "src": "38848:6:70" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "38840:3:70", + "nodeType": "YulIdentifier", + "src": "38840:3:70" + }, + "nativeSrc": "38840:15:70", + "nodeType": "YulFunctionCall", + "src": "38840:15:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "38869:2:70", + "nodeType": "YulLiteral", + "src": "38869:2:70", + "type": "", + "value": "96" + }, + { + "kind": "number", + "nativeSrc": "38873:1:70", + "nodeType": "YulLiteral", + "src": "38873:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "38865:3:70", + "nodeType": "YulIdentifier", + "src": "38865:3:70" + }, + "nativeSrc": "38865:10:70", + "nodeType": "YulFunctionCall", + "src": "38865:10:70" + }, + { + "kind": "number", + "nativeSrc": "38877:1:70", + "nodeType": "YulLiteral", + "src": "38877:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "38861:3:70", + "nodeType": "YulIdentifier", + "src": "38861:3:70" + }, + "nativeSrc": "38861:18:70", + "nodeType": "YulFunctionCall", + "src": "38861:18:70" + } + ], + "functionName": { + "name": "not", + "nativeSrc": "38857:3:70", + "nodeType": "YulIdentifier", + "src": "38857:3:70" + }, + "nativeSrc": "38857:23:70", + "nodeType": "YulFunctionCall", + "src": "38857:23:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "38836:3:70", + "nodeType": "YulIdentifier", + "src": "38836:3:70" + }, + "nativeSrc": "38836:45:70", + "nodeType": "YulFunctionCall", + "src": "38836:45:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "38824:6:70", + "nodeType": "YulIdentifier", + "src": "38824:6:70" + }, + "nativeSrc": "38824:58:70", + "nodeType": "YulFunctionCall", + "src": "38824:58:70" + }, + "nativeSrc": "38824:58:70", + "nodeType": "YulExpressionStatement", + "src": "38824:58:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "pos", + "nativeSrc": "38902:3:70", + "nodeType": "YulIdentifier", + "src": "38902:3:70" + }, + { + "kind": "number", + "nativeSrc": "38907:2:70", + "nodeType": "YulLiteral", + "src": "38907:2:70", + "type": "", + "value": "20" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "38898:3:70", + "nodeType": "YulIdentifier", + "src": "38898:3:70" + }, + "nativeSrc": "38898:12:70", + "nodeType": "YulFunctionCall", + "src": "38898:12:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "38920:2:70", + "nodeType": "YulLiteral", + "src": "38920:2:70", + "type": "", + "value": "96" + }, + { + "name": "value1", + "nativeSrc": "38924:6:70", + "nodeType": "YulIdentifier", + "src": "38924:6:70" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "38916:3:70", + "nodeType": "YulIdentifier", + "src": "38916:3:70" + }, + "nativeSrc": "38916:15:70", + "nodeType": "YulFunctionCall", + "src": "38916:15:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "38945:2:70", + "nodeType": "YulLiteral", + "src": "38945:2:70", + "type": "", + "value": "96" + }, + { + "kind": "number", + "nativeSrc": "38949:1:70", + "nodeType": "YulLiteral", + "src": "38949:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "38941:3:70", + "nodeType": "YulIdentifier", + "src": "38941:3:70" + }, + "nativeSrc": "38941:10:70", + "nodeType": "YulFunctionCall", + "src": "38941:10:70" + }, + { + "kind": "number", + "nativeSrc": "38953:1:70", + "nodeType": "YulLiteral", + "src": "38953:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "38937:3:70", + "nodeType": "YulIdentifier", + "src": "38937:3:70" + }, + "nativeSrc": "38937:18:70", + "nodeType": "YulFunctionCall", + "src": "38937:18:70" + } + ], + "functionName": { + "name": "not", + "nativeSrc": "38933:3:70", + "nodeType": "YulIdentifier", + "src": "38933:3:70" + }, + "nativeSrc": "38933:23:70", + "nodeType": "YulFunctionCall", + "src": "38933:23:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "38912:3:70", + "nodeType": "YulIdentifier", + "src": "38912:3:70" + }, + "nativeSrc": "38912:45:70", + "nodeType": "YulFunctionCall", + "src": "38912:45:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "38891:6:70", + "nodeType": "YulIdentifier", + "src": "38891:6:70" + }, + "nativeSrc": "38891:67:70", + "nodeType": "YulFunctionCall", + "src": "38891:67:70" + }, + "nativeSrc": "38891:67:70", + "nodeType": "YulExpressionStatement", + "src": "38891:67:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "pos", + "nativeSrc": "38978:3:70", + "nodeType": "YulIdentifier", + "src": "38978:3:70" + }, + { + "kind": "number", + "nativeSrc": "38983:2:70", + "nodeType": "YulLiteral", + "src": "38983:2:70", + "type": "", + "value": "40" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "38974:3:70", + "nodeType": "YulIdentifier", + "src": "38974:3:70" + }, + "nativeSrc": "38974:12:70", + "nodeType": "YulFunctionCall", + "src": "38974:12:70" + }, + { + "name": "value2", + "nativeSrc": "38988:6:70", + "nodeType": "YulIdentifier", + "src": "38988:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "38967:6:70", + "nodeType": "YulIdentifier", + "src": "38967:6:70" + }, + "nativeSrc": "38967:28:70", + "nodeType": "YulFunctionCall", + "src": "38967:28:70" + }, + "nativeSrc": "38967:28:70", + "nodeType": "YulExpressionStatement", + "src": "38967:28:70" + }, + { + "nativeSrc": "39004:19:70", + "nodeType": "YulAssignment", + "src": "39004:19:70", + "value": { + "arguments": [ + { + "name": "pos", + "nativeSrc": "39015:3:70", + "nodeType": "YulIdentifier", + "src": "39015:3:70" + }, + { + "kind": "number", + "nativeSrc": "39020:2:70", + "nodeType": "YulLiteral", + "src": "39020:2:70", + "type": "", + "value": "72" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "39011:3:70", + "nodeType": "YulIdentifier", + "src": "39011:3:70" + }, + "nativeSrc": "39011:12:70", + "nodeType": "YulFunctionCall", + "src": "39011:12:70" + }, + "variableNames": [ + { + "name": "end", + "nativeSrc": "39004:3:70", + "nodeType": "YulIdentifier", + "src": "39004:3:70" + } + ] + } + ] + }, + "name": "abi_encode_tuple_packed_t_address_t_address_t_uint256__to_t_address_t_address_t_uint256__nonPadded_inplace_fromStack_reversed", + "nativeSrc": "38639:390:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "pos", + "nativeSrc": "38774:3:70", + "nodeType": "YulTypedName", + "src": "38774:3:70", + "type": "" + }, + { + "name": "value2", + "nativeSrc": "38779:6:70", + "nodeType": "YulTypedName", + "src": "38779:6:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "38787:6:70", + "nodeType": "YulTypedName", + "src": "38787:6:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "38795:6:70", + "nodeType": "YulTypedName", + "src": "38795:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "end", + "nativeSrc": "38806:3:70", + "nodeType": "YulTypedName", + "src": "38806:3:70", + "type": "" + } + ], + "src": "38639:390:70" + }, + { + "body": { + "nativeSrc": "39080:171:70", + "nodeType": "YulBlock", + "src": "39080:171:70", + "statements": [ + { + "body": { + "nativeSrc": "39111:111:70", + "nodeType": "YulBlock", + "src": "39111:111:70", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "39132:1:70", + "nodeType": "YulLiteral", + "src": "39132:1:70", + "type": "", + "value": "0" + }, + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "39139:3:70", + "nodeType": "YulLiteral", + "src": "39139:3:70", + "type": "", + "value": "224" + }, + { + "kind": "number", + "nativeSrc": "39144:10:70", + "nodeType": "YulLiteral", + "src": "39144:10:70", + "type": "", + "value": "0x4e487b71" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "39135:3:70", + "nodeType": "YulIdentifier", + "src": "39135:3:70" + }, + "nativeSrc": "39135:20:70", + "nodeType": "YulFunctionCall", + "src": "39135:20:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "39125:6:70", + "nodeType": "YulIdentifier", + "src": "39125:6:70" + }, + "nativeSrc": "39125:31:70", + "nodeType": "YulFunctionCall", + "src": "39125:31:70" + }, + "nativeSrc": "39125:31:70", + "nodeType": "YulExpressionStatement", + "src": "39125:31:70" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "39176:1:70", + "nodeType": "YulLiteral", + "src": "39176:1:70", + "type": "", + "value": "4" + }, + { + "kind": "number", + "nativeSrc": "39179:4:70", + "nodeType": "YulLiteral", + "src": "39179:4:70", + "type": "", + "value": "0x12" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "39169:6:70", + "nodeType": "YulIdentifier", + "src": "39169:6:70" + }, + "nativeSrc": "39169:15:70", + "nodeType": "YulFunctionCall", + "src": "39169:15:70" + }, + "nativeSrc": "39169:15:70", + "nodeType": "YulExpressionStatement", + "src": "39169:15:70" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nativeSrc": "39204:1:70", + "nodeType": "YulLiteral", + "src": "39204:1:70", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nativeSrc": "39207:4:70", + "nodeType": "YulLiteral", + "src": "39207:4:70", + "type": "", + "value": "0x24" + } + ], + "functionName": { + "name": "revert", + "nativeSrc": "39197:6:70", + "nodeType": "YulIdentifier", + "src": "39197:6:70" + }, + "nativeSrc": "39197:15:70", + "nodeType": "YulFunctionCall", + "src": "39197:15:70" + }, + "nativeSrc": "39197:15:70", + "nodeType": "YulExpressionStatement", + "src": "39197:15:70" + } + ] + }, + "condition": { + "arguments": [ + { + "name": "y", + "nativeSrc": "39100:1:70", + "nodeType": "YulIdentifier", + "src": "39100:1:70" + } + ], + "functionName": { + "name": "iszero", + "nativeSrc": "39093:6:70", + "nodeType": "YulIdentifier", + "src": "39093:6:70" + }, + "nativeSrc": "39093:9:70", + "nodeType": "YulFunctionCall", + "src": "39093:9:70" + }, + "nativeSrc": "39090:132:70", + "nodeType": "YulIf", + "src": "39090:132:70" + }, + { + "nativeSrc": "39231:14:70", + "nodeType": "YulAssignment", + "src": "39231:14:70", + "value": { + "arguments": [ + { + "name": "x", + "nativeSrc": "39240:1:70", + "nodeType": "YulIdentifier", + "src": "39240:1:70" + }, + { + "name": "y", + "nativeSrc": "39243:1:70", + "nodeType": "YulIdentifier", + "src": "39243:1:70" + } + ], + "functionName": { + "name": "div", + "nativeSrc": "39236:3:70", + "nodeType": "YulIdentifier", + "src": "39236:3:70" + }, + "nativeSrc": "39236:9:70", + "nodeType": "YulFunctionCall", + "src": "39236:9:70" + }, + "variableNames": [ + { + "name": "r", + "nativeSrc": "39231:1:70", + "nodeType": "YulIdentifier", + "src": "39231:1:70" + } + ] + } + ] + }, + "name": "checked_div_t_uint256", + "nativeSrc": "39034:217:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "x", + "nativeSrc": "39065:1:70", + "nodeType": "YulTypedName", + "src": "39065:1:70", + "type": "" + }, + { + "name": "y", + "nativeSrc": "39068:1:70", + "nodeType": "YulTypedName", + "src": "39068:1:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "r", + "nativeSrc": "39074:1:70", + "nodeType": "YulTypedName", + "src": "39074:1:70", + "type": "" + } + ], + "src": "39034:217:70" + }, + { + "body": { + "nativeSrc": "39383:153:70", + "nodeType": "YulBlock", + "src": "39383:153:70", + "statements": [ + { + "nativeSrc": "39393:26:70", + "nodeType": "YulAssignment", + "src": "39393:26:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "39405:9:70", + "nodeType": "YulIdentifier", + "src": "39405:9:70" + }, + { + "kind": "number", + "nativeSrc": "39416:2:70", + "nodeType": "YulLiteral", + "src": "39416:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "39401:3:70", + "nodeType": "YulIdentifier", + "src": "39401:3:70" + }, + "nativeSrc": "39401:18:70", + "nodeType": "YulFunctionCall", + "src": "39401:18:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "39393:4:70", + "nodeType": "YulIdentifier", + "src": "39393:4:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "39435:9:70", + "nodeType": "YulIdentifier", + "src": "39435:9:70" + }, + { + "arguments": [ + { + "name": "value0", + "nativeSrc": "39450:6:70", + "nodeType": "YulIdentifier", + "src": "39450:6:70" + }, + { + "kind": "number", + "nativeSrc": "39458:10:70", + "nodeType": "YulLiteral", + "src": "39458:10:70", + "type": "", + "value": "0xffffffff" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "39446:3:70", + "nodeType": "YulIdentifier", + "src": "39446:3:70" + }, + "nativeSrc": "39446:23:70", + "nodeType": "YulFunctionCall", + "src": "39446:23:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "39428:6:70", + "nodeType": "YulIdentifier", + "src": "39428:6:70" + }, + "nativeSrc": "39428:42:70", + "nodeType": "YulFunctionCall", + "src": "39428:42:70" + }, + "nativeSrc": "39428:42:70", + "nodeType": "YulExpressionStatement", + "src": "39428:42:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "39490:9:70", + "nodeType": "YulIdentifier", + "src": "39490:9:70" + }, + { + "kind": "number", + "nativeSrc": "39501:2:70", + "nodeType": "YulLiteral", + "src": "39501:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "39486:3:70", + "nodeType": "YulIdentifier", + "src": "39486:3:70" + }, + "nativeSrc": "39486:18:70", + "nodeType": "YulFunctionCall", + "src": "39486:18:70" + }, + { + "arguments": [ + { + "name": "value1", + "nativeSrc": "39510:6:70", + "nodeType": "YulIdentifier", + "src": "39510:6:70" + }, + { + "kind": "number", + "nativeSrc": "39518:10:70", + "nodeType": "YulLiteral", + "src": "39518:10:70", + "type": "", + "value": "0xffffffff" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "39506:3:70", + "nodeType": "YulIdentifier", + "src": "39506:3:70" + }, + "nativeSrc": "39506:23:70", + "nodeType": "YulFunctionCall", + "src": "39506:23:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "39479:6:70", + "nodeType": "YulIdentifier", + "src": "39479:6:70" + }, + "nativeSrc": "39479:51:70", + "nodeType": "YulFunctionCall", + "src": "39479:51:70" + }, + "nativeSrc": "39479:51:70", + "nodeType": "YulExpressionStatement", + "src": "39479:51:70" + } + ] + }, + "name": "abi_encode_tuple_t_uint32_t_uint32__to_t_uint256_t_uint256__fromStack_reversed", + "nativeSrc": "39256:280:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "39344:9:70", + "nodeType": "YulTypedName", + "src": "39344:9:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "39355:6:70", + "nodeType": "YulTypedName", + "src": "39355:6:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "39363:6:70", + "nodeType": "YulTypedName", + "src": "39363:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "39374:4:70", + "nodeType": "YulTypedName", + "src": "39374:4:70", + "type": "" + } + ], + "src": "39256:280:70" + }, + { + "body": { + "nativeSrc": "39668:169:70", + "nodeType": "YulBlock", + "src": "39668:169:70", + "statements": [ + { + "nativeSrc": "39678:26:70", + "nodeType": "YulAssignment", + "src": "39678:26:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "39690:9:70", + "nodeType": "YulIdentifier", + "src": "39690:9:70" + }, + { + "kind": "number", + "nativeSrc": "39701:2:70", + "nodeType": "YulLiteral", + "src": "39701:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "39686:3:70", + "nodeType": "YulIdentifier", + "src": "39686:3:70" + }, + "nativeSrc": "39686:18:70", + "nodeType": "YulFunctionCall", + "src": "39686:18:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "39678:4:70", + "nodeType": "YulIdentifier", + "src": "39678:4:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "39720:9:70", + "nodeType": "YulIdentifier", + "src": "39720:9:70" + }, + { + "arguments": [ + { + "name": "value0", + "nativeSrc": "39735:6:70", + "nodeType": "YulIdentifier", + "src": "39735:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "39751:2:70", + "nodeType": "YulLiteral", + "src": "39751:2:70", + "type": "", + "value": "64" + }, + { + "kind": "number", + "nativeSrc": "39755:1:70", + "nodeType": "YulLiteral", + "src": "39755:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "39747:3:70", + "nodeType": "YulIdentifier", + "src": "39747:3:70" + }, + "nativeSrc": "39747:10:70", + "nodeType": "YulFunctionCall", + "src": "39747:10:70" + }, + { + "kind": "number", + "nativeSrc": "39759:1:70", + "nodeType": "YulLiteral", + "src": "39759:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "39743:3:70", + "nodeType": "YulIdentifier", + "src": "39743:3:70" + }, + "nativeSrc": "39743:18:70", + "nodeType": "YulFunctionCall", + "src": "39743:18:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "39731:3:70", + "nodeType": "YulIdentifier", + "src": "39731:3:70" + }, + "nativeSrc": "39731:31:70", + "nodeType": "YulFunctionCall", + "src": "39731:31:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "39713:6:70", + "nodeType": "YulIdentifier", + "src": "39713:6:70" + }, + "nativeSrc": "39713:50:70", + "nodeType": "YulFunctionCall", + "src": "39713:50:70" + }, + "nativeSrc": "39713:50:70", + "nodeType": "YulExpressionStatement", + "src": "39713:50:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "39783:9:70", + "nodeType": "YulIdentifier", + "src": "39783:9:70" + }, + { + "kind": "number", + "nativeSrc": "39794:2:70", + "nodeType": "YulLiteral", + "src": "39794:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "39779:3:70", + "nodeType": "YulIdentifier", + "src": "39779:3:70" + }, + "nativeSrc": "39779:18:70", + "nodeType": "YulFunctionCall", + "src": "39779:18:70" + }, + { + "arguments": [ + { + "name": "value1", + "nativeSrc": "39803:6:70", + "nodeType": "YulIdentifier", + "src": "39803:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "39819:2:70", + "nodeType": "YulLiteral", + "src": "39819:2:70", + "type": "", + "value": "64" + }, + { + "kind": "number", + "nativeSrc": "39823:1:70", + "nodeType": "YulLiteral", + "src": "39823:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "39815:3:70", + "nodeType": "YulIdentifier", + "src": "39815:3:70" + }, + "nativeSrc": "39815:10:70", + "nodeType": "YulFunctionCall", + "src": "39815:10:70" + }, + { + "kind": "number", + "nativeSrc": "39827:1:70", + "nodeType": "YulLiteral", + "src": "39827:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "39811:3:70", + "nodeType": "YulIdentifier", + "src": "39811:3:70" + }, + "nativeSrc": "39811:18:70", + "nodeType": "YulFunctionCall", + "src": "39811:18:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "39799:3:70", + "nodeType": "YulIdentifier", + "src": "39799:3:70" + }, + "nativeSrc": "39799:31:70", + "nodeType": "YulFunctionCall", + "src": "39799:31:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "39772:6:70", + "nodeType": "YulIdentifier", + "src": "39772:6:70" + }, + "nativeSrc": "39772:59:70", + "nodeType": "YulFunctionCall", + "src": "39772:59:70" + }, + "nativeSrc": "39772:59:70", + "nodeType": "YulExpressionStatement", + "src": "39772:59:70" + } + ] + }, + "name": "abi_encode_tuple_t_uint64_t_uint64__to_t_uint256_t_uint256__fromStack_reversed", + "nativeSrc": "39541:296:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "39629:9:70", + "nodeType": "YulTypedName", + "src": "39629:9:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "39640:6:70", + "nodeType": "YulTypedName", + "src": "39640:6:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "39648:6:70", + "nodeType": "YulTypedName", + "src": "39648:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "39659:4:70", + "nodeType": "YulTypedName", + "src": "39659:4:70", + "type": "" + } + ], + "src": "39541:296:70" + }, + { + "body": { + "nativeSrc": "40055:276:70", + "nodeType": "YulBlock", + "src": "40055:276:70", + "statements": [ + { + "nativeSrc": "40065:27:70", + "nodeType": "YulAssignment", + "src": "40065:27:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "40077:9:70", + "nodeType": "YulIdentifier", + "src": "40077:9:70" + }, + { + "kind": "number", + "nativeSrc": "40088:3:70", + "nodeType": "YulLiteral", + "src": "40088:3:70", + "type": "", + "value": "160" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "40073:3:70", + "nodeType": "YulIdentifier", + "src": "40073:3:70" + }, + "nativeSrc": "40073:19:70", + "nodeType": "YulFunctionCall", + "src": "40073:19:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "40065:4:70", + "nodeType": "YulIdentifier", + "src": "40065:4:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "40108:9:70", + "nodeType": "YulIdentifier", + "src": "40108:9:70" + }, + { + "name": "value0", + "nativeSrc": "40119:6:70", + "nodeType": "YulIdentifier", + "src": "40119:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "40101:6:70", + "nodeType": "YulIdentifier", + "src": "40101:6:70" + }, + "nativeSrc": "40101:25:70", + "nodeType": "YulFunctionCall", + "src": "40101:25:70" + }, + "nativeSrc": "40101:25:70", + "nodeType": "YulExpressionStatement", + "src": "40101:25:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "40146:9:70", + "nodeType": "YulIdentifier", + "src": "40146:9:70" + }, + { + "kind": "number", + "nativeSrc": "40157:2:70", + "nodeType": "YulLiteral", + "src": "40157:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "40142:3:70", + "nodeType": "YulIdentifier", + "src": "40142:3:70" + }, + "nativeSrc": "40142:18:70", + "nodeType": "YulFunctionCall", + "src": "40142:18:70" + }, + { + "name": "value1", + "nativeSrc": "40162:6:70", + "nodeType": "YulIdentifier", + "src": "40162:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "40135:6:70", + "nodeType": "YulIdentifier", + "src": "40135:6:70" + }, + "nativeSrc": "40135:34:70", + "nodeType": "YulFunctionCall", + "src": "40135:34:70" + }, + "nativeSrc": "40135:34:70", + "nodeType": "YulExpressionStatement", + "src": "40135:34:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "40189:9:70", + "nodeType": "YulIdentifier", + "src": "40189:9:70" + }, + { + "kind": "number", + "nativeSrc": "40200:2:70", + "nodeType": "YulLiteral", + "src": "40200:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "40185:3:70", + "nodeType": "YulIdentifier", + "src": "40185:3:70" + }, + "nativeSrc": "40185:18:70", + "nodeType": "YulFunctionCall", + "src": "40185:18:70" + }, + { + "name": "value2", + "nativeSrc": "40205:6:70", + "nodeType": "YulIdentifier", + "src": "40205:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "40178:6:70", + "nodeType": "YulIdentifier", + "src": "40178:6:70" + }, + "nativeSrc": "40178:34:70", + "nodeType": "YulFunctionCall", + "src": "40178:34:70" + }, + "nativeSrc": "40178:34:70", + "nodeType": "YulExpressionStatement", + "src": "40178:34:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "40232:9:70", + "nodeType": "YulIdentifier", + "src": "40232:9:70" + }, + { + "kind": "number", + "nativeSrc": "40243:2:70", + "nodeType": "YulLiteral", + "src": "40243:2:70", + "type": "", + "value": "96" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "40228:3:70", + "nodeType": "YulIdentifier", + "src": "40228:3:70" + }, + "nativeSrc": "40228:18:70", + "nodeType": "YulFunctionCall", + "src": "40228:18:70" + }, + { + "name": "value3", + "nativeSrc": "40248:6:70", + "nodeType": "YulIdentifier", + "src": "40248:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "40221:6:70", + "nodeType": "YulIdentifier", + "src": "40221:6:70" + }, + "nativeSrc": "40221:34:70", + "nodeType": "YulFunctionCall", + "src": "40221:34:70" + }, + "nativeSrc": "40221:34:70", + "nodeType": "YulExpressionStatement", + "src": "40221:34:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "40275:9:70", + "nodeType": "YulIdentifier", + "src": "40275:9:70" + }, + { + "kind": "number", + "nativeSrc": "40286:3:70", + "nodeType": "YulLiteral", + "src": "40286:3:70", + "type": "", + "value": "128" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "40271:3:70", + "nodeType": "YulIdentifier", + "src": "40271:3:70" + }, + "nativeSrc": "40271:19:70", + "nodeType": "YulFunctionCall", + "src": "40271:19:70" + }, + { + "arguments": [ + { + "name": "value4", + "nativeSrc": "40296:6:70", + "nodeType": "YulIdentifier", + "src": "40296:6:70" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nativeSrc": "40312:3:70", + "nodeType": "YulLiteral", + "src": "40312:3:70", + "type": "", + "value": "160" + }, + { + "kind": "number", + "nativeSrc": "40317:1:70", + "nodeType": "YulLiteral", + "src": "40317:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nativeSrc": "40308:3:70", + "nodeType": "YulIdentifier", + "src": "40308:3:70" + }, + "nativeSrc": "40308:11:70", + "nodeType": "YulFunctionCall", + "src": "40308:11:70" + }, + { + "kind": "number", + "nativeSrc": "40321:1:70", + "nodeType": "YulLiteral", + "src": "40321:1:70", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nativeSrc": "40304:3:70", + "nodeType": "YulIdentifier", + "src": "40304:3:70" + }, + "nativeSrc": "40304:19:70", + "nodeType": "YulFunctionCall", + "src": "40304:19:70" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "40292:3:70", + "nodeType": "YulIdentifier", + "src": "40292:3:70" + }, + "nativeSrc": "40292:32:70", + "nodeType": "YulFunctionCall", + "src": "40292:32:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "40264:6:70", + "nodeType": "YulIdentifier", + "src": "40264:6:70" + }, + "nativeSrc": "40264:61:70", + "nodeType": "YulFunctionCall", + "src": "40264:61:70" + }, + "nativeSrc": "40264:61:70", + "nodeType": "YulExpressionStatement", + "src": "40264:61:70" + } + ] + }, + "name": "abi_encode_tuple_t_bytes32_t_bytes32_t_bytes32_t_uint256_t_address__to_t_bytes32_t_bytes32_t_bytes32_t_uint256_t_address__fromStack_reversed", + "nativeSrc": "39842:489:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "39992:9:70", + "nodeType": "YulTypedName", + "src": "39992:9:70", + "type": "" + }, + { + "name": "value4", + "nativeSrc": "40003:6:70", + "nodeType": "YulTypedName", + "src": "40003:6:70", + "type": "" + }, + { + "name": "value3", + "nativeSrc": "40011:6:70", + "nodeType": "YulTypedName", + "src": "40011:6:70", + "type": "" + }, + { + "name": "value2", + "nativeSrc": "40019:6:70", + "nodeType": "YulTypedName", + "src": "40019:6:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "40027:6:70", + "nodeType": "YulTypedName", + "src": "40027:6:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "40035:6:70", + "nodeType": "YulTypedName", + "src": "40035:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "40046:4:70", + "nodeType": "YulTypedName", + "src": "40046:4:70", + "type": "" + } + ], + "src": "39842:489:70" + }, + { + "body": { + "nativeSrc": "40517:217:70", + "nodeType": "YulBlock", + "src": "40517:217:70", + "statements": [ + { + "nativeSrc": "40527:27:70", + "nodeType": "YulAssignment", + "src": "40527:27:70", + "value": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "40539:9:70", + "nodeType": "YulIdentifier", + "src": "40539:9:70" + }, + { + "kind": "number", + "nativeSrc": "40550:3:70", + "nodeType": "YulLiteral", + "src": "40550:3:70", + "type": "", + "value": "128" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "40535:3:70", + "nodeType": "YulIdentifier", + "src": "40535:3:70" + }, + "nativeSrc": "40535:19:70", + "nodeType": "YulFunctionCall", + "src": "40535:19:70" + }, + "variableNames": [ + { + "name": "tail", + "nativeSrc": "40527:4:70", + "nodeType": "YulIdentifier", + "src": "40527:4:70" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "40570:9:70", + "nodeType": "YulIdentifier", + "src": "40570:9:70" + }, + { + "name": "value0", + "nativeSrc": "40581:6:70", + "nodeType": "YulIdentifier", + "src": "40581:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "40563:6:70", + "nodeType": "YulIdentifier", + "src": "40563:6:70" + }, + "nativeSrc": "40563:25:70", + "nodeType": "YulFunctionCall", + "src": "40563:25:70" + }, + "nativeSrc": "40563:25:70", + "nodeType": "YulExpressionStatement", + "src": "40563:25:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "40608:9:70", + "nodeType": "YulIdentifier", + "src": "40608:9:70" + }, + { + "kind": "number", + "nativeSrc": "40619:2:70", + "nodeType": "YulLiteral", + "src": "40619:2:70", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "40604:3:70", + "nodeType": "YulIdentifier", + "src": "40604:3:70" + }, + "nativeSrc": "40604:18:70", + "nodeType": "YulFunctionCall", + "src": "40604:18:70" + }, + { + "arguments": [ + { + "name": "value1", + "nativeSrc": "40628:6:70", + "nodeType": "YulIdentifier", + "src": "40628:6:70" + }, + { + "kind": "number", + "nativeSrc": "40636:4:70", + "nodeType": "YulLiteral", + "src": "40636:4:70", + "type": "", + "value": "0xff" + } + ], + "functionName": { + "name": "and", + "nativeSrc": "40624:3:70", + "nodeType": "YulIdentifier", + "src": "40624:3:70" + }, + "nativeSrc": "40624:17:70", + "nodeType": "YulFunctionCall", + "src": "40624:17:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "40597:6:70", + "nodeType": "YulIdentifier", + "src": "40597:6:70" + }, + "nativeSrc": "40597:45:70", + "nodeType": "YulFunctionCall", + "src": "40597:45:70" + }, + "nativeSrc": "40597:45:70", + "nodeType": "YulExpressionStatement", + "src": "40597:45:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "40662:9:70", + "nodeType": "YulIdentifier", + "src": "40662:9:70" + }, + { + "kind": "number", + "nativeSrc": "40673:2:70", + "nodeType": "YulLiteral", + "src": "40673:2:70", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "40658:3:70", + "nodeType": "YulIdentifier", + "src": "40658:3:70" + }, + "nativeSrc": "40658:18:70", + "nodeType": "YulFunctionCall", + "src": "40658:18:70" + }, + { + "name": "value2", + "nativeSrc": "40678:6:70", + "nodeType": "YulIdentifier", + "src": "40678:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "40651:6:70", + "nodeType": "YulIdentifier", + "src": "40651:6:70" + }, + "nativeSrc": "40651:34:70", + "nodeType": "YulFunctionCall", + "src": "40651:34:70" + }, + "nativeSrc": "40651:34:70", + "nodeType": "YulExpressionStatement", + "src": "40651:34:70" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nativeSrc": "40705:9:70", + "nodeType": "YulIdentifier", + "src": "40705:9:70" + }, + { + "kind": "number", + "nativeSrc": "40716:2:70", + "nodeType": "YulLiteral", + "src": "40716:2:70", + "type": "", + "value": "96" + } + ], + "functionName": { + "name": "add", + "nativeSrc": "40701:3:70", + "nodeType": "YulIdentifier", + "src": "40701:3:70" + }, + "nativeSrc": "40701:18:70", + "nodeType": "YulFunctionCall", + "src": "40701:18:70" + }, + { + "name": "value3", + "nativeSrc": "40721:6:70", + "nodeType": "YulIdentifier", + "src": "40721:6:70" + } + ], + "functionName": { + "name": "mstore", + "nativeSrc": "40694:6:70", + "nodeType": "YulIdentifier", + "src": "40694:6:70" + }, + "nativeSrc": "40694:34:70", + "nodeType": "YulFunctionCall", + "src": "40694:34:70" + }, + "nativeSrc": "40694:34:70", + "nodeType": "YulExpressionStatement", + "src": "40694:34:70" + } + ] + }, + "name": "abi_encode_tuple_t_bytes32_t_uint8_t_bytes32_t_bytes32__to_t_bytes32_t_uint8_t_bytes32_t_bytes32__fromStack_reversed", + "nativeSrc": "40336:398:70", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nativeSrc": "40462:9:70", + "nodeType": "YulTypedName", + "src": "40462:9:70", + "type": "" + }, + { + "name": "value3", + "nativeSrc": "40473:6:70", + "nodeType": "YulTypedName", + "src": "40473:6:70", + "type": "" + }, + { + "name": "value2", + "nativeSrc": "40481:6:70", + "nodeType": "YulTypedName", + "src": "40481:6:70", + "type": "" + }, + { + "name": "value1", + "nativeSrc": "40489:6:70", + "nodeType": "YulTypedName", + "src": "40489:6:70", + "type": "" + }, + { + "name": "value0", + "nativeSrc": "40497:6:70", + "nodeType": "YulTypedName", + "src": "40497:6:70", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nativeSrc": "40508:4:70", + "nodeType": "YulTypedName", + "src": "40508:4:70", + "type": "" + } + ], + "src": "40336:398:70" + } + ] + }, + "contents": "{\n { }\n function validator_revert_address(value)\n {\n if iszero(eq(value, and(value, sub(shl(160, 1), 1)))) { revert(0, 0) }\n }\n function abi_decode_address(offset) -> value\n {\n value := calldataload(offset)\n validator_revert_address(value)\n }\n function abi_decode_tuple_t_address(headStart, dataEnd) -> value0\n {\n if slt(sub(dataEnd, headStart), 32) { revert(0, 0) }\n let value := calldataload(headStart)\n validator_revert_address(value)\n value0 := value\n }\n function abi_encode_address(value, pos)\n {\n mstore(pos, and(value, sub(shl(160, 1), 1)))\n }\n function abi_encode_tuple_t_address__to_t_address__fromStack_reversed(headStart, value0) -> tail\n {\n tail := add(headStart, 32)\n mstore(headStart, and(value0, sub(shl(160, 1), 1)))\n }\n function abi_encode_tuple_t_struct$_State_$15663_memory_ptr__to_t_struct$_State_$15663_memory_ptr__fromStack_reversed(headStart, value0) -> tail\n {\n tail := add(headStart, 288)\n mstore(headStart, and(mload(value0), sub(shl(160, 1), 1)))\n mstore(add(headStart, 0x20), mload(add(value0, 0x20)))\n mstore(add(headStart, 0x40), mload(add(value0, 0x40)))\n mstore(add(headStart, 0x60), mload(add(value0, 0x60)))\n mstore(add(headStart, 0x80), mload(add(value0, 0x80)))\n mstore(add(headStart, 0xa0), mload(add(value0, 0xa0)))\n mstore(add(headStart, 0xc0), mload(add(value0, 0xc0)))\n mstore(add(headStart, 0xe0), mload(add(value0, 0xe0)))\n mstore(add(headStart, 0x0100), mload(add(value0, 0x0100)))\n }\n function abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed(headStart, value0) -> tail\n {\n tail := add(headStart, 32)\n mstore(headStart, value0)\n }\n function abi_encode_tuple_t_bytes32_t_bytes32_t_uint256_t_uint256__to_t_bytes32_t_bytes32_t_uint256_t_uint256__fromStack_reversed(headStart, value3, value2, value1, value0) -> tail\n {\n tail := add(headStart, 128)\n mstore(headStart, value0)\n mstore(add(headStart, 32), value1)\n mstore(add(headStart, 64), value2)\n mstore(add(headStart, 96), value3)\n }\n function validator_revert_uint32(value)\n {\n if iszero(eq(value, and(value, 0xffffffff))) { revert(0, 0) }\n }\n function abi_decode_tuple_t_uint32(headStart, dataEnd) -> value0\n {\n if slt(sub(dataEnd, headStart), 32) { revert(0, 0) }\n let value := calldataload(headStart)\n validator_revert_uint32(value)\n value0 := value\n }\n function abi_encode_tuple_t_uint32__to_t_uint32__fromStack_reversed(headStart, value0) -> tail\n {\n tail := add(headStart, 32)\n mstore(headStart, and(value0, 0xffffffff))\n }\n function abi_decode_bytes_calldata(offset, end) -> arrayPos, length\n {\n if iszero(slt(add(offset, 0x1f), end)) { revert(0, 0) }\n length := calldataload(offset)\n if gt(length, sub(shl(64, 1), 1)) { revert(0, 0) }\n arrayPos := add(offset, 0x20)\n if gt(add(add(offset, length), 0x20), end) { revert(0, 0) }\n }\n function abi_decode_tuple_t_addresst_bytes_calldata_ptr(headStart, dataEnd) -> value0, value1, value2\n {\n if slt(sub(dataEnd, headStart), 64) { revert(0, 0) }\n let value := calldataload(headStart)\n validator_revert_address(value)\n value0 := value\n let offset := calldataload(add(headStart, 32))\n if gt(offset, sub(shl(64, 1), 1)) { revert(0, 0) }\n let value1_1, value2_1 := abi_decode_bytes_calldata(add(headStart, offset), dataEnd)\n value1 := value1_1\n value2 := value2_1\n }\n function validator_revert_bool(value)\n {\n if iszero(eq(value, iszero(iszero(value)))) { revert(0, 0) }\n }\n function abi_decode_tuple_t_addresst_bool(headStart, dataEnd) -> value0, value1\n {\n if slt(sub(dataEnd, headStart), 64) { revert(0, 0) }\n let value := calldataload(headStart)\n validator_revert_address(value)\n value0 := value\n let value_1 := calldataload(add(headStart, 32))\n validator_revert_bool(value_1)\n value1 := value_1\n }\n function abi_decode_tuple_t_uint256(headStart, dataEnd) -> value0\n {\n if slt(sub(dataEnd, headStart), 32) { revert(0, 0) }\n let value := 0\n value := calldataload(headStart)\n value0 := value\n }\n function abi_encode_tuple_t_uint32_t_uint32__to_t_uint32_t_uint32__fromStack_reversed(headStart, value1, value0) -> tail\n {\n tail := add(headStart, 64)\n mstore(headStart, and(value0, 0xffffffff))\n mstore(add(headStart, 32), and(value1, 0xffffffff))\n }\n function copy_memory_to_memory_with_cleanup(src, dst, length)\n {\n let i := 0\n for { } lt(i, length) { i := add(i, 32) }\n {\n mstore(add(dst, i), mload(add(src, i)))\n }\n mstore(add(dst, length), 0)\n }\n function abi_encode_string(value, pos) -> end\n {\n let length := mload(value)\n mstore(pos, length)\n copy_memory_to_memory_with_cleanup(add(value, 0x20), add(pos, 0x20), length)\n end := add(add(pos, and(add(length, 31), not(31))), 0x20)\n }\n function abi_encode_tuple_t_uint256_t_string_memory_ptr_t_string_memory_ptr__to_t_uint256_t_string_memory_ptr_t_string_memory_ptr__fromStack_reversed(headStart, value2, value1, value0) -> tail\n {\n mstore(headStart, value0)\n mstore(add(headStart, 32), 96)\n let tail_1 := abi_encode_string(value1, add(headStart, 96))\n mstore(add(headStart, 64), sub(tail_1, headStart))\n tail := abi_encode_string(value2, tail_1)\n }\n function abi_encode_tuple_t_bool_t_address_t_bytes32_t_uint256_t_uint256_t_uint256__to_t_bool_t_address_t_bytes32_t_uint256_t_uint256_t_uint256__fromStack_reversed(headStart, value5, value4, value3, value2, value1, value0) -> tail\n {\n tail := add(headStart, 192)\n mstore(headStart, iszero(iszero(value0)))\n mstore(add(headStart, 32), and(value1, sub(shl(160, 1), 1)))\n mstore(add(headStart, 64), value2)\n mstore(add(headStart, 96), value3)\n mstore(add(headStart, 128), value4)\n mstore(add(headStart, 160), value5)\n }\n function abi_encode_tuple_t_bool__to_t_bool__fromStack_reversed(headStart, value0) -> tail\n {\n tail := add(headStart, 32)\n mstore(headStart, iszero(iszero(value0)))\n }\n function abi_encode_tuple_t_struct$_State_$16305_memory_ptr__to_t_struct$_State_$16305_memory_ptr__fromStack_reversed(headStart, value0) -> tail\n {\n tail := add(headStart, 64)\n mstore(headStart, and(mload(value0), sub(shl(160, 1), 1)))\n mstore(add(headStart, 0x20), mload(add(value0, 0x20)))\n }\n function abi_encode_uint64(value, pos)\n {\n mstore(pos, and(value, sub(shl(64, 1), 1)))\n }\n function abi_encode_tuple_t_uint64_t_uint64__to_t_uint64_t_uint64__fromStack_reversed(headStart, value1, value0) -> tail\n {\n tail := add(headStart, 64)\n mstore(headStart, and(value0, sub(shl(64, 1), 1)))\n mstore(add(headStart, 32), and(value1, sub(shl(64, 1), 1)))\n }\n function abi_decode_tuple_t_addresst_addresst_bytes32(headStart, dataEnd) -> value0, value1, value2\n {\n if slt(sub(dataEnd, headStart), 96) { revert(0, 0) }\n let value := calldataload(headStart)\n validator_revert_address(value)\n value0 := value\n let value_1 := calldataload(add(headStart, 32))\n validator_revert_address(value_1)\n value1 := value_1\n let value_2 := 0\n value_2 := calldataload(add(headStart, 64))\n value2 := value_2\n }\n function abi_encode_tuple_t_uint256_t_uint256__to_t_uint256_t_uint256__fromStack_reversed(headStart, value1, value0) -> tail\n {\n tail := add(headStart, 64)\n mstore(headStart, value0)\n mstore(add(headStart, 32), value1)\n }\n function abi_decode_tuple_t_addresst_addresst_uint256(headStart, dataEnd) -> value0, value1, value2\n {\n if slt(sub(dataEnd, headStart), 96) { revert(0, 0) }\n let value := calldataload(headStart)\n validator_revert_address(value)\n value0 := value\n let value_1 := calldataload(add(headStart, 32))\n validator_revert_address(value_1)\n value1 := value_1\n let value_2 := 0\n value_2 := calldataload(add(headStart, 64))\n value2 := value_2\n }\n function abi_encode_tuple_t_bytes1_t_string_memory_ptr_t_string_memory_ptr_t_uint256_t_address_t_bytes32_t_array$_t_uint256_$dyn_memory_ptr__to_t_bytes1_t_string_memory_ptr_t_string_memory_ptr_t_uint256_t_address_t_bytes32_t_array$_t_uint256_$dyn_memory_ptr__fromStack_reversed(headStart, value6, value5, value4, value3, value2, value1, value0) -> tail\n {\n mstore(headStart, and(value0, shl(248, 255)))\n mstore(add(headStart, 32), 224)\n let tail_1 := abi_encode_string(value1, add(headStart, 224))\n mstore(add(headStart, 64), sub(tail_1, headStart))\n let tail_2 := abi_encode_string(value2, tail_1)\n mstore(add(headStart, 96), value3)\n mstore(add(headStart, 128), and(value4, sub(shl(160, 1), 1)))\n mstore(add(headStart, 160), value5)\n mstore(add(headStart, 192), sub(tail_2, headStart))\n let pos := tail_2\n let length := mload(value6)\n mstore(tail_2, length)\n pos := add(tail_2, 32)\n let srcPtr := add(value6, 32)\n let i := 0\n for { } lt(i, length) { i := add(i, 1) }\n {\n mstore(pos, mload(srcPtr))\n pos := add(pos, 32)\n srcPtr := add(srcPtr, 32)\n }\n tail := pos\n }\n function abi_decode_tuple_t_array$_t_bytes_calldata_ptr_$dyn_calldata_ptr(headStart, dataEnd) -> value0, value1\n {\n if slt(sub(dataEnd, headStart), 32) { revert(0, 0) }\n let offset := calldataload(headStart)\n if gt(offset, sub(shl(64, 1), 1)) { revert(0, 0) }\n let _1 := add(headStart, offset)\n if iszero(slt(add(_1, 0x1f), dataEnd)) { revert(0, 0) }\n let length := calldataload(_1)\n if gt(length, sub(shl(64, 1), 1)) { revert(0, 0) }\n if gt(add(add(_1, shl(5, length)), 32), dataEnd) { revert(0, 0) }\n value0 := add(_1, 32)\n value1 := length\n }\n function abi_encode_tuple_t_array$_t_bytes_memory_ptr_$dyn_memory_ptr__to_t_array$_t_bytes_memory_ptr_$dyn_memory_ptr__fromStack_reversed(headStart, value0) -> tail\n {\n let tail_1 := add(headStart, 32)\n mstore(headStart, 32)\n let pos := tail_1\n let length := mload(value0)\n mstore(tail_1, length)\n pos := add(headStart, 64)\n let tail_2 := add(add(headStart, shl(5, length)), 64)\n let srcPtr := add(value0, 32)\n let i := 0\n for { } lt(i, length) { i := add(i, 1) }\n {\n mstore(pos, add(sub(tail_2, headStart), not(63)))\n tail_2 := abi_encode_string(mload(srcPtr), tail_2)\n srcPtr := add(srcPtr, 32)\n pos := add(pos, 32)\n }\n tail := tail_2\n }\n function abi_decode_tuple_t_addresst_enum$_PaymentTypes_$2433t_bytes_calldata_ptr(headStart, dataEnd) -> value0, value1, value2, value3\n {\n if slt(sub(dataEnd, headStart), 96) { revert(0, 0) }\n let value := calldataload(headStart)\n validator_revert_address(value)\n value0 := value\n let value_1 := calldataload(add(headStart, 32))\n if iszero(lt(value_1, 3)) { revert(0, 0) }\n value1 := value_1\n let offset := calldataload(add(headStart, 64))\n if gt(offset, sub(shl(64, 1), 1)) { revert(0, 0) }\n let value2_1, value3_1 := abi_decode_bytes_calldata(add(headStart, offset), dataEnd)\n value2 := value2_1\n value3 := value3_1\n }\n function abi_decode_tuple_t_addresst_uint256t_uint32t_uint256(headStart, dataEnd) -> value0, value1, value2, value3\n {\n if slt(sub(dataEnd, headStart), 128) { revert(0, 0) }\n let value := calldataload(headStart)\n validator_revert_address(value)\n value0 := value\n let value_1 := 0\n value_1 := calldataload(add(headStart, 32))\n value1 := value_1\n let value_2 := calldataload(add(headStart, 64))\n validator_revert_uint32(value_2)\n value2 := value_2\n let value_3 := 0\n value_3 := calldataload(add(headStart, 96))\n value3 := value_3\n }\n function abi_decode_tuple_t_addresst_address(headStart, dataEnd) -> value0, value1\n {\n if slt(sub(dataEnd, headStart), 64) { revert(0, 0) }\n let value := calldataload(headStart)\n validator_revert_address(value)\n value0 := value\n let value_1 := calldataload(add(headStart, 32))\n validator_revert_address(value_1)\n value1 := value_1\n }\n function abi_encode_tuple_t_bytes32__to_t_bytes32__fromStack_reversed(headStart, value0) -> tail\n {\n tail := add(headStart, 32)\n mstore(headStart, value0)\n }\n function abi_decode_tuple_t_bytes32(headStart, dataEnd) -> value0\n {\n if slt(sub(dataEnd, headStart), 32) { revert(0, 0) }\n let value := 0\n value := calldataload(headStart)\n value0 := value\n }\n function abi_encode_tuple_t_uint256_t_uint256_t_uint256_t_bytes32__to_t_uint256_t_uint256_t_uint256_t_bytes32__fromStack_reversed(headStart, value3, value2, value1, value0) -> tail\n {\n tail := add(headStart, 128)\n mstore(headStart, value0)\n mstore(add(headStart, 32), value1)\n mstore(add(headStart, 64), value2)\n mstore(add(headStart, 96), value3)\n }\n function abi_encode_tuple_t_address_t_address_t_address__to_t_address_t_address_t_address__fromStack_reversed(headStart, value2, value1, value0) -> tail\n {\n tail := add(headStart, 96)\n mstore(headStart, and(value0, sub(shl(160, 1), 1)))\n mstore(add(headStart, 32), and(value1, sub(shl(160, 1), 1)))\n mstore(add(headStart, 64), and(value2, sub(shl(160, 1), 1)))\n }\n function abi_decode_tuple_t_bool_fromMemory(headStart, dataEnd) -> value0\n {\n if slt(sub(dataEnd, headStart), 32) { revert(0, 0) }\n let value := mload(headStart)\n validator_revert_bool(value)\n value0 := value\n }\n function abi_encode_tuple_t_address_t_address__to_t_address_t_address__fromStack_reversed(headStart, value1, value0) -> tail\n {\n tail := add(headStart, 64)\n mstore(headStart, and(value0, sub(shl(160, 1), 1)))\n mstore(add(headStart, 32), and(value1, sub(shl(160, 1), 1)))\n }\n function panic_error_0x41()\n {\n mstore(0, shl(224, 0x4e487b71))\n mstore(4, 0x41)\n revert(0, 0x24)\n }\n function allocate_memory_4297() -> memPtr\n {\n memPtr := mload(64)\n let newFreePtr := add(memPtr, 320)\n if or(gt(newFreePtr, sub(shl(64, 1), 1)), lt(newFreePtr, memPtr)) { panic_error_0x41() }\n mstore(64, newFreePtr)\n }\n function allocate_memory_4301() -> memPtr\n {\n memPtr := mload(64)\n let newFreePtr := add(memPtr, 64)\n if or(gt(newFreePtr, sub(shl(64, 1), 1)), lt(newFreePtr, memPtr)) { panic_error_0x41() }\n mstore(64, newFreePtr)\n }\n function allocate_memory() -> memPtr\n {\n memPtr := mload(64)\n let newFreePtr := add(memPtr, 0xe0)\n if or(gt(newFreePtr, sub(shl(64, 1), 1)), lt(newFreePtr, memPtr)) { panic_error_0x41() }\n mstore(64, newFreePtr)\n }\n function abi_decode_string(offset, end) -> array\n {\n if iszero(slt(add(offset, 0x1f), end)) { revert(0, 0) }\n let length := calldataload(offset)\n let src := add(offset, 0x20)\n let array_1 := 0\n let size := 0\n if gt(length, sub(shl(64, 1), 1)) { panic_error_0x41() }\n let result := and(add(length, 31), not(31))\n size := add(result, 0x20)\n let memPtr := 0\n memPtr := mload(64)\n let newFreePtr := add(memPtr, and(add(result, 63), not(31)))\n if or(gt(newFreePtr, sub(shl(64, 1), 1)), lt(newFreePtr, memPtr)) { panic_error_0x41() }\n mstore(64, newFreePtr)\n array_1 := memPtr\n mstore(memPtr, length)\n if gt(add(src, length), end) { revert(0, 0) }\n calldatacopy(add(memPtr, 0x20), src, length)\n mstore(add(add(memPtr, length), 0x20), 0)\n array := memPtr\n }\n function abi_decode_tuple_t_string_memory_ptrt_string_memory_ptrt_address_payable(headStart, dataEnd) -> value0, value1, value2\n {\n if slt(sub(dataEnd, headStart), 96) { revert(0, 0) }\n let offset := calldataload(headStart)\n if gt(offset, sub(shl(64, 1), 1)) { revert(0, 0) }\n value0 := abi_decode_string(add(headStart, offset), dataEnd)\n let offset_1 := calldataload(add(headStart, 32))\n if gt(offset_1, sub(shl(64, 1), 1)) { revert(0, 0) }\n value1 := abi_decode_string(add(headStart, offset_1), dataEnd)\n let value := calldataload(add(headStart, 64))\n validator_revert_address(value)\n value2 := value\n }\n function extract_byte_array_length(data) -> length\n {\n length := shr(1, data)\n let outOfPlaceEncoding := and(data, 1)\n if iszero(outOfPlaceEncoding) { length := and(length, 0x7f) }\n if eq(outOfPlaceEncoding, lt(length, 32))\n {\n mstore(0, shl(224, 0x4e487b71))\n mstore(4, 0x22)\n revert(0, 0x24)\n }\n }\n function array_dataslot_string_storage(ptr) -> data\n {\n mstore(0, ptr)\n data := keccak256(0, 0x20)\n }\n function clean_up_bytearray_end_slots_string_storage(array, len, startIndex)\n {\n if gt(len, 31)\n {\n mstore(0, array)\n let data := keccak256(0, 0x20)\n let deleteStart := add(data, shr(5, add(startIndex, 31)))\n if lt(startIndex, 0x20) { deleteStart := data }\n let _1 := add(data, shr(5, add(len, 31)))\n let start := deleteStart\n for { } lt(start, _1) { start := add(start, 1) }\n { sstore(start, 0) }\n }\n }\n function extract_used_part_and_set_length_of_short_byte_array(data, len) -> used\n {\n used := or(and(data, not(shr(shl(3, len), not(0)))), shl(1, len))\n }\n function copy_byte_array_to_storage_from_t_string_memory_ptr_to_t_string_storage(slot, src)\n {\n let newLen := mload(src)\n if gt(newLen, sub(shl(64, 1), 1)) { panic_error_0x41() }\n clean_up_bytearray_end_slots_string_storage(slot, extract_byte_array_length(sload(slot)), newLen)\n let srcOffset := 0\n srcOffset := 0x20\n switch gt(newLen, 31)\n case 1 {\n let loopEnd := and(newLen, not(31))\n let dstPtr := array_dataslot_string_storage(slot)\n let i := 0\n for { } lt(i, loopEnd) { i := add(i, 0x20) }\n {\n sstore(dstPtr, mload(add(src, srcOffset)))\n dstPtr := add(dstPtr, 1)\n srcOffset := add(srcOffset, 0x20)\n }\n if lt(loopEnd, newLen)\n {\n let lastValue := mload(add(src, srcOffset))\n sstore(dstPtr, and(lastValue, not(shr(and(shl(3, newLen), 248), not(0)))))\n }\n sstore(slot, add(shl(1, newLen), 1))\n }\n default {\n let value := 0\n if newLen\n {\n value := mload(add(src, srcOffset))\n }\n sstore(slot, extract_used_part_and_set_length_of_short_byte_array(value, newLen))\n }\n }\n function abi_encode_tuple_t_bytes_calldata_ptr__to_t_bytes_memory_ptr__fromStack_reversed(headStart, value1, value0) -> tail\n {\n mstore(headStart, 32)\n mstore(add(headStart, 32), value1)\n calldatacopy(add(headStart, 64), value0, value1)\n mstore(add(add(headStart, value1), 64), 0)\n tail := add(add(headStart, and(add(value1, 31), not(31))), 64)\n }\n function abi_decode_tuple_t_address_payable(headStart, dataEnd) -> value0\n {\n if slt(sub(dataEnd, headStart), 32) { revert(0, 0) }\n let value := calldataload(headStart)\n validator_revert_address(value)\n value0 := value\n }\n function abi_encode_tuple_t_stringliteral_2e5045ff73280aa8e8acd8c82710f23812497f87f7f576e2220a2ddd0d45eade__to_t_string_memory_ptr__fromStack_reversed(headStart) -> tail\n {\n mstore(headStart, 32)\n mstore(add(headStart, 32), 21)\n mstore(add(headStart, 64), \"EIP712: Uninitialized\")\n tail := add(headStart, 96)\n }\n function panic_error_0x11()\n {\n mstore(0, shl(224, 0x4e487b71))\n mstore(4, 0x11)\n revert(0, 0x24)\n }\n function checked_sub_t_uint256(x, y) -> diff\n {\n diff := sub(x, y)\n if gt(diff, x) { panic_error_0x11() }\n }\n function calldata_array_index_range_access_t_bytes_calldata_ptr(offset, length, startIndex, endIndex) -> offsetOut, lengthOut\n {\n if gt(startIndex, endIndex) { revert(0, 0) }\n if gt(endIndex, length) { revert(0, 0) }\n offsetOut := add(offset, startIndex)\n lengthOut := sub(endIndex, startIndex)\n }\n function panic_error_0x32()\n {\n mstore(0, shl(224, 0x4e487b71))\n mstore(4, 0x32)\n revert(0, 0x24)\n }\n function access_calldata_tail_t_bytes_calldata_ptr(base_ref, ptr_to_tail) -> addr, length\n {\n let rel_offset_of_tail := calldataload(ptr_to_tail)\n if iszero(slt(rel_offset_of_tail, add(sub(calldatasize(), base_ref), not(30)))) { revert(0, 0) }\n let addr_1 := add(base_ref, rel_offset_of_tail)\n length := calldataload(addr_1)\n if gt(length, sub(shl(64, 1), 1)) { revert(0, 0) }\n addr := add(addr_1, 0x20)\n if sgt(addr, sub(calldatasize(), length)) { revert(0, 0) }\n }\n function abi_encode_tuple_packed_t_bytes_calldata_ptr_t_bytes_memory_ptr__to_t_bytes_memory_ptr_t_bytes_memory_ptr__nonPadded_inplace_fromStack_reversed(pos, value2, value1, value0) -> end\n {\n calldatacopy(pos, value0, value1)\n let _1 := add(pos, value1)\n mstore(_1, 0)\n let length := mload(value2)\n copy_memory_to_memory_with_cleanup(add(value2, 0x20), _1, length)\n end := add(_1, length)\n }\n function panic_error_0x21()\n {\n mstore(0, shl(224, 0x4e487b71))\n mstore(4, 0x21)\n revert(0, 0x24)\n }\n function abi_encode_enum_PaymentTypes(value, pos)\n {\n if iszero(lt(value, 3))\n {\n mstore(0, shl(224, 0x4e487b71))\n mstore(4, 0x21)\n revert(0, 0x24)\n }\n mstore(pos, value)\n }\n function abi_encode_tuple_t_enum$_PaymentTypes_$2433__to_t_uint8__fromStack_reversed(headStart, value0) -> tail\n {\n tail := add(headStart, 32)\n abi_encode_enum_PaymentTypes(value0, headStart)\n }\n function abi_encode_tuple_t_rational_1_by_1__to_t_uint64__fromStack_reversed(headStart, value0) -> tail\n {\n tail := add(headStart, 32)\n mstore(headStart, and(value0, sub(shl(64, 1), 1)))\n }\n function abi_decode_tuple_t_uint256t_uint256(headStart, dataEnd) -> value0, value1\n {\n if slt(sub(dataEnd, headStart), 64) { revert(0, 0) }\n let value := 0\n value := calldataload(headStart)\n value0 := value\n let value_1 := 0\n value_1 := calldataload(add(headStart, 32))\n value1 := value_1\n }\n function abi_encode_tuple_t_address_t_uint256_t_uint256_t_address__to_t_address_t_uint256_t_uint256_t_address__fromStack_reversed(headStart, value3, value2, value1, value0) -> tail\n {\n tail := add(headStart, 128)\n mstore(headStart, and(value0, sub(shl(160, 1), 1)))\n mstore(add(headStart, 32), value1)\n mstore(add(headStart, 64), value2)\n mstore(add(headStart, 96), and(value3, sub(shl(160, 1), 1)))\n }\n function abi_decode_tuple_t_bytes32t_uint256t_address_payablet_bytes_memory_ptr(headStart, dataEnd) -> value0, value1, value2, value3\n {\n if slt(sub(dataEnd, headStart), 128) { revert(0, 0) }\n let value := 0\n value := calldataload(headStart)\n value0 := value\n let value_1 := 0\n value_1 := calldataload(add(headStart, 32))\n value1 := value_1\n let value_2 := calldataload(add(headStart, 64))\n validator_revert_address(value_2)\n value2 := value_2\n let offset := calldataload(add(headStart, 96))\n if gt(offset, sub(shl(64, 1), 1)) { revert(0, 0) }\n value3 := abi_decode_string(add(headStart, offset), dataEnd)\n }\n function abi_decode_uint32_fromMemory(offset) -> value\n {\n value := mload(offset)\n validator_revert_uint32(value)\n }\n function validator_revert_uint64(value)\n {\n if iszero(eq(value, and(value, sub(shl(64, 1), 1)))) { revert(0, 0) }\n }\n function abi_decode_uint64_fromMemory(offset) -> value\n {\n value := mload(offset)\n validator_revert_uint64(value)\n }\n function abi_decode_tuple_t_struct$_Provision_$3962_memory_ptr_fromMemory(headStart, dataEnd) -> value0\n {\n let _1 := slt(sub(dataEnd, headStart), 320)\n if _1 { revert(0, 0) }\n _1 := 0\n let value := allocate_memory_4297()\n let value_1 := _1\n value_1 := mload(headStart)\n mstore(value, value_1)\n let value_2 := _1\n value_2 := mload(add(headStart, 32))\n mstore(add(value, 32), value_2)\n let value_3 := _1\n value_3 := mload(add(headStart, 64))\n mstore(add(value, 64), value_3)\n mstore(add(value, 96), abi_decode_uint32_fromMemory(add(headStart, 96)))\n mstore(add(value, 128), abi_decode_uint64_fromMemory(add(headStart, 128)))\n mstore(add(value, 160), abi_decode_uint64_fromMemory(add(headStart, 160)))\n mstore(add(value, 192), abi_decode_uint32_fromMemory(add(headStart, 192)))\n mstore(add(value, 224), abi_decode_uint64_fromMemory(add(headStart, 224)))\n let value_4 := _1\n value_4 := mload(add(headStart, 256))\n mstore(add(value, 256), value_4)\n let value_5 := _1\n value_5 := mload(add(headStart, 288))\n mstore(add(value, 288), value_5)\n value0 := value\n }\n function abi_encode_tuple_t_address_t_bool__to_t_address_t_bool__fromStack_reversed(headStart, value1, value0) -> tail\n {\n tail := add(headStart, 64)\n mstore(headStart, and(value0, sub(shl(160, 1), 1)))\n mstore(add(headStart, 32), iszero(iszero(value1)))\n }\n function abi_encode_tuple_t_rational_0_by_1_t_address__to_t_uint8_t_address__fromStack_reversed(headStart, value1, value0) -> tail\n {\n tail := add(headStart, 64)\n mstore(headStart, and(value0, 0xff))\n mstore(add(headStart, 32), and(value1, sub(shl(160, 1), 1)))\n }\n function abi_decode_tuple_t_uint256_fromMemory(headStart, dataEnd) -> value0\n {\n if slt(sub(dataEnd, headStart), 32) { revert(0, 0) }\n let value := 0\n value := mload(headStart)\n value0 := value\n }\n function abi_decode_tuple_t_uint32_fromMemory(headStart, dataEnd) -> value0\n {\n if slt(sub(dataEnd, headStart), 32) { revert(0, 0) }\n let value := mload(headStart)\n validator_revert_uint32(value)\n value0 := value\n }\n function abi_decode_tuple_t_uint64_fromMemory(headStart, dataEnd) -> value0\n {\n if slt(sub(dataEnd, headStart), 32) { revert(0, 0) }\n let value := mload(headStart)\n validator_revert_uint64(value)\n value0 := value\n }\n function abi_encode_tuple_t_uint256_t_bool__to_t_uint256_t_bool__fromStack_reversed(headStart, value1, value0) -> tail\n {\n tail := add(headStart, 64)\n mstore(headStart, value0)\n mstore(add(headStart, 32), iszero(iszero(value1)))\n }\n function abi_encode_tuple_t_address_t_uint256__to_t_address_t_uint256__fromStack_reversed(headStart, value1, value0) -> tail\n {\n tail := add(headStart, 64)\n mstore(headStart, and(value0, sub(shl(160, 1), 1)))\n mstore(add(headStart, 32), value1)\n }\n function checked_add_t_uint256(x, y) -> sum\n {\n sum := add(x, y)\n if gt(x, sum) { panic_error_0x11() }\n }\n function abi_encode_tuple_packed_t_bytes_memory_ptr__to_t_bytes_memory_ptr__nonPadded_inplace_fromStack_reversed(pos, value0) -> end\n {\n let length := mload(value0)\n copy_memory_to_memory_with_cleanup(add(value0, 0x20), pos, length)\n end := add(pos, length)\n }\n function abi_decode_uint64(offset) -> value\n {\n value := calldataload(offset)\n validator_revert_uint64(value)\n }\n function abi_decode_uint128(offset) -> value\n {\n value := calldataload(offset)\n if iszero(eq(value, and(value, sub(shl(128, 1), 1)))) { revert(0, 0) }\n }\n function abi_decode_tuple_t_struct$_SignedRAV_$2525_memory_ptrt_uint256(headStart, dataEnd) -> value0, value1\n {\n if slt(sub(dataEnd, headStart), 64) { revert(0, 0) }\n let offset := calldataload(headStart)\n if gt(offset, sub(shl(64, 1), 1)) { revert(0, 0) }\n let _1 := add(headStart, offset)\n if slt(sub(dataEnd, _1), 64) { revert(0, 0) }\n let value := allocate_memory_4301()\n let offset_1 := calldataload(_1)\n if gt(offset_1, sub(shl(64, 1), 1)) { revert(0, 0) }\n let _2 := add(_1, offset_1)\n if slt(sub(dataEnd, _2), 0xe0) { revert(0, 0) }\n let value_1 := allocate_memory()\n let value_2 := 0\n value_2 := calldataload(_2)\n mstore(value_1, value_2)\n mstore(add(value_1, 32), abi_decode_address(add(_2, 32)))\n mstore(add(value_1, 64), abi_decode_address(add(_2, 64)))\n mstore(add(value_1, 96), abi_decode_address(add(_2, 96)))\n mstore(add(value_1, 128), abi_decode_uint64(add(_2, 128)))\n mstore(add(value_1, 160), abi_decode_uint128(add(_2, 160)))\n let offset_2 := calldataload(add(_2, 192))\n if gt(offset_2, sub(shl(64, 1), 1)) { revert(0, 0) }\n mstore(add(value_1, 192), abi_decode_string(add(_2, offset_2), dataEnd))\n mstore(value, value_1)\n let offset_3 := calldataload(add(_1, 32))\n if gt(offset_3, sub(shl(64, 1), 1)) { revert(0, 0) }\n mstore(add(value, 32), abi_decode_string(add(_1, offset_3), dataEnd))\n value0 := value\n let value_3 := 0\n value_3 := calldataload(add(headStart, 32))\n value1 := value_3\n }\n function abi_encode_tuple_t_enum$_PaymentTypes_$2433_t_bytes_memory_ptr_t_uint256__to_t_uint8_t_bytes_memory_ptr_t_uint256__fromStack_reversed(headStart, value2, value1, value0) -> tail\n {\n abi_encode_enum_PaymentTypes(value0, headStart)\n mstore(add(headStart, 32), 96)\n tail := abi_encode_string(value1, add(headStart, 96))\n mstore(add(headStart, 64), value2)\n }\n function checked_mul_t_uint256(x, y) -> product\n {\n product := mul(x, y)\n if iszero(or(iszero(x), eq(y, div(product, x)))) { panic_error_0x11() }\n }\n function abi_encode_tuple_t_bytes32_t_uint256__to_t_bytes32_t_uint256__fromStack_reversed(headStart, value1, value0) -> tail\n {\n tail := add(headStart, 64)\n mstore(headStart, value0)\n mstore(add(headStart, 32), value1)\n }\n function abi_encode_tuple_t_bytes32_t_uint256_t_uint256__to_t_bytes32_t_uint256_t_uint256__fromStack_reversed(headStart, value2, value1, value0) -> tail\n {\n tail := add(headStart, 96)\n mstore(headStart, value0)\n mstore(add(headStart, 32), value1)\n mstore(add(headStart, 64), value2)\n }\n function abi_decode_tuple_t_address_payablet_bytes32t_bytes_memory_ptr(headStart, dataEnd) -> value0, value1, value2\n {\n if slt(sub(dataEnd, headStart), 96) { revert(0, 0) }\n let value := calldataload(headStart)\n validator_revert_address(value)\n value0 := value\n let value_1 := 0\n value_1 := calldataload(add(headStart, 32))\n value1 := value_1\n let offset := calldataload(add(headStart, 64))\n if gt(offset, sub(shl(64, 1), 1)) { revert(0, 0) }\n value2 := abi_decode_string(add(headStart, offset), dataEnd)\n }\n function abi_encode_tuple_t_bytes32_t_address_t_address__to_t_bytes32_t_address_t_address__fromStack_reversed(headStart, value2, value1, value0) -> tail\n {\n tail := add(headStart, 96)\n mstore(headStart, value0)\n mstore(add(headStart, 32), and(value1, sub(shl(160, 1), 1)))\n mstore(add(headStart, 64), and(value2, sub(shl(160, 1), 1)))\n }\n function abi_encode_tuple_t_bytes_memory_ptr_t_uint256_t_uint256_t_uint256__to_t_bytes_memory_ptr_t_uint256_t_uint256_t_uint256__fromStack_reversed(headStart, value3, value2, value1, value0) -> tail\n {\n mstore(headStart, 128)\n tail := abi_encode_string(value0, add(headStart, 128))\n mstore(add(headStart, 32), value1)\n mstore(add(headStart, 64), value2)\n mstore(add(headStart, 96), value3)\n }\n function abi_decode_tuple_t_uint256t_address_payable_fromMemory(headStart, dataEnd) -> value0, value1\n {\n if slt(sub(dataEnd, headStart), 64) { revert(0, 0) }\n let value := 0\n value := mload(headStart)\n value0 := value\n let value_1 := mload(add(headStart, 32))\n validator_revert_address(value_1)\n value1 := value_1\n }\n function abi_encode_tuple_t_uint256_t_address__to_t_uint256_t_address__fromStack_reversed(headStart, value1, value0) -> tail\n {\n tail := add(headStart, 64)\n mstore(headStart, value0)\n mstore(add(headStart, 32), and(value1, sub(shl(160, 1), 1)))\n }\n function decrement_t_uint256(value) -> ret\n {\n if iszero(value) { panic_error_0x11() }\n ret := add(value, not(0))\n }\n function increment_t_uint256(value) -> ret\n {\n if eq(value, not(0)) { panic_error_0x11() }\n ret := add(value, 1)\n }\n function abi_encode_tuple_t_address_t_address_t_uint32__to_t_address_t_address_t_uint32__fromStack_reversed(headStart, value2, value1, value0) -> tail\n {\n tail := add(headStart, 96)\n mstore(headStart, and(value0, sub(shl(160, 1), 1)))\n mstore(add(headStart, 32), and(value1, sub(shl(160, 1), 1)))\n mstore(add(headStart, 64), and(value2, 0xffffffff))\n }\n function abi_encode_uint128(value, pos)\n {\n mstore(pos, and(value, sub(shl(128, 1), 1)))\n }\n function abi_encode_tuple_t_struct$_SignedRAV_$2525_memory_ptr_t_uint256_t_address__to_t_struct$_SignedRAV_$2525_memory_ptr_t_uint256_t_address__fromStack_reversed(headStart, value2, value1, value0) -> tail\n {\n mstore(headStart, 96)\n let memberValue0 := mload(value0)\n mstore(add(headStart, 96), 0x40)\n mstore(add(headStart, 160), mload(memberValue0))\n mstore(add(headStart, 192), and(mload(add(memberValue0, 0x20)), sub(shl(160, 1), 1)))\n mstore(add(headStart, 0xe0), and(mload(add(memberValue0, 0x40)), sub(shl(160, 1), 1)))\n mstore(add(headStart, 256), and(mload(add(memberValue0, 96)), sub(shl(160, 1), 1)))\n let memberValue0_1 := mload(add(memberValue0, 0x80))\n abi_encode_uint64(memberValue0_1, add(headStart, 288))\n let memberValue0_2 := mload(add(memberValue0, 160))\n abi_encode_uint128(memberValue0_2, add(headStart, 320))\n let memberValue0_3 := mload(add(memberValue0, 192))\n mstore(add(headStart, 352), 0xe0)\n let end := abi_encode_string(memberValue0_3, add(headStart, 384))\n let memberValue0_4 := mload(add(value0, 0x20))\n mstore(add(headStart, 0x80), add(sub(end, headStart), not(95)))\n tail := abi_encode_string(memberValue0_4, end)\n mstore(add(headStart, 0x20), value1)\n abi_encode_address(value2, add(headStart, 0x40))\n }\n function abi_encode_tuple_t_stringliteral_aaf3daf27360df170a52f29a0edeebb3d20b8e3dc84a13c5eaf056803b549f50__to_t_string_memory_ptr__fromStack_reversed(headStart) -> tail\n {\n mstore(headStart, 32)\n mstore(add(headStart, 32), 9)\n mstore(add(headStart, 64), \"!transfer\")\n tail := add(headStart, 96)\n }\n function abi_encode_tuple_t_address_t_address_t_enum$_PaymentTypes_$2433__to_t_address_t_address_t_uint8__fromStack_reversed(headStart, value2, value1, value0) -> tail\n {\n tail := add(headStart, 96)\n mstore(headStart, and(value0, sub(shl(160, 1), 1)))\n mstore(add(headStart, 32), and(value1, sub(shl(160, 1), 1)))\n abi_encode_enum_PaymentTypes(value2, add(headStart, 64))\n }\n function abi_decode_tuple_t_struct$_DelegationPool_$3992_memory_ptr_fromMemory(headStart, dataEnd) -> value0\n {\n let _1 := slt(sub(dataEnd, headStart), 160)\n if _1 { revert(0, 0) }\n _1 := 0\n let memPtr := _1\n memPtr := mload(64)\n let newFreePtr := add(memPtr, 160)\n if or(gt(newFreePtr, sub(shl(64, 1), 1)), lt(newFreePtr, memPtr)) { panic_error_0x41() }\n mstore(64, newFreePtr)\n let value := _1\n value := mload(headStart)\n mstore(memPtr, value)\n let value_1 := _1\n value_1 := mload(add(headStart, 32))\n mstore(add(memPtr, 32), value_1)\n let value_2 := _1\n value_2 := mload(add(headStart, 64))\n mstore(add(memPtr, 64), value_2)\n let value_3 := _1\n value_3 := mload(add(headStart, 96))\n mstore(add(memPtr, 96), value_3)\n let value_4 := _1\n value_4 := mload(add(headStart, 128))\n mstore(add(memPtr, 128), value_4)\n value0 := memPtr\n }\n function abi_encode_tuple_t_address_t_address_t_uint256__to_t_address_t_address_t_uint256__fromStack_reversed(headStart, value2, value1, value0) -> tail\n {\n tail := add(headStart, 96)\n mstore(headStart, and(value0, sub(shl(160, 1), 1)))\n mstore(add(headStart, 32), and(value1, sub(shl(160, 1), 1)))\n mstore(add(headStart, 64), value2)\n }\n function abi_encode_tuple_t_uint256_t_uint256_t_uint256_t_bytes32_t_bytes_memory_ptr_t_uint256__to_t_uint256_t_uint256_t_uint256_t_bytes32_t_bytes_memory_ptr_t_uint256__fromStack_reversed(headStart, value5, value4, value3, value2, value1, value0) -> tail\n {\n mstore(headStart, value0)\n mstore(add(headStart, 32), value1)\n mstore(add(headStart, 64), value2)\n mstore(add(headStart, 96), value3)\n mstore(add(headStart, 128), 192)\n tail := abi_encode_string(value4, add(headStart, 192))\n mstore(add(headStart, 160), value5)\n }\n function abi_encode_tuple_packed_t_address_t_address_t_uint256__to_t_address_t_address_t_uint256__nonPadded_inplace_fromStack_reversed(pos, value2, value1, value0) -> end\n {\n mstore(pos, and(shl(96, value0), not(sub(shl(96, 1), 1))))\n mstore(add(pos, 20), and(shl(96, value1), not(sub(shl(96, 1), 1))))\n mstore(add(pos, 40), value2)\n end := add(pos, 72)\n }\n function checked_div_t_uint256(x, y) -> r\n {\n if iszero(y)\n {\n mstore(0, shl(224, 0x4e487b71))\n mstore(4, 0x12)\n revert(0, 0x24)\n }\n r := div(x, y)\n }\n function abi_encode_tuple_t_uint32_t_uint32__to_t_uint256_t_uint256__fromStack_reversed(headStart, value1, value0) -> tail\n {\n tail := add(headStart, 64)\n mstore(headStart, and(value0, 0xffffffff))\n mstore(add(headStart, 32), and(value1, 0xffffffff))\n }\n function abi_encode_tuple_t_uint64_t_uint64__to_t_uint256_t_uint256__fromStack_reversed(headStart, value1, value0) -> tail\n {\n tail := add(headStart, 64)\n mstore(headStart, and(value0, sub(shl(64, 1), 1)))\n mstore(add(headStart, 32), and(value1, sub(shl(64, 1), 1)))\n }\n function abi_encode_tuple_t_bytes32_t_bytes32_t_bytes32_t_uint256_t_address__to_t_bytes32_t_bytes32_t_bytes32_t_uint256_t_address__fromStack_reversed(headStart, value4, value3, value2, value1, value0) -> tail\n {\n tail := add(headStart, 160)\n mstore(headStart, value0)\n mstore(add(headStart, 32), value1)\n mstore(add(headStart, 64), value2)\n mstore(add(headStart, 96), value3)\n mstore(add(headStart, 128), and(value4, sub(shl(160, 1), 1)))\n }\n function abi_encode_tuple_t_bytes32_t_uint8_t_bytes32_t_bytes32__to_t_bytes32_t_uint8_t_bytes32_t_bytes32__fromStack_reversed(headStart, value3, value2, value1, value0) -> tail\n {\n tail := add(headStart, 128)\n mstore(headStart, value0)\n mstore(add(headStart, 32), and(value1, 0xff))\n mstore(add(headStart, 64), value2)\n mstore(add(headStart, 96), value3)\n }\n}", + "id": 70, + "language": "Yul", + "name": "#utility.yul" + } + ], + "immutableReferences": { + "4591": [ + { + "length": 32, + "start": 14948 + } + ], + "4595": [ + { + "length": 32, + "start": 7019 + } + ], + "4611": [ + { + "length": 32, + "start": 17788 + } + ], + "4615": [ + { + "length": 32, + "start": 14088 + } + ], + "17586": [ + { + "length": 32, + "start": 5691 + }, + { + "length": 32, + "start": 12257 + } + ], + "17590": [ + { + "length": 32, + "start": 13022 + } + ], + "17594": [ + { + "length": 32, + "start": 12002 + } + ] + }, + "linkReferences": {}, + "object": "608060405234801561001057600080fd5b506004361061023b5760003560e01c806307e736d8146102405780630e02292314610280578063138dea081461030857806313c474c9146103205780631dd42f60146103755780631ebb7c301461038a57806324b8fbf6146103af57806335577962146103c25780633f4ba83a146103d557806345f54485146103dd578063482468b7146103f05780634f793cdc1461040657806355c85269146104285780635c975abb146104725780636234e2161461048a5780636ccec5b8146104aa5780636d9a3951146104bd578063715018a61461053857806371ce020a146105405780637aa31bce146105565780637dfe6d28146105695780637e89bac31461057c5780638180083b1461058f578063819ba366146105a257806381e777a7146105b8578063832bc923146105cb5780638456cb59146105de57806384b0196e146105e657806385e82baf146106015780638da5cb5b1461060a5780639384e07814610612578063ac9650d814610635578063b15d2a2c14610655578063ba38f67d14610668578063c0f474971461067b578063c84a5ef314610683578063cb8347fe14610696578063cbe5f3f2146106a9578063ce0fc0cc146106c9578063ce56c98b146106dc578063d07a7a84146106ef578063db9bee46146106f9578063dedf672614610701578063e2e1e8e914610714578063e6f5005414610734578063ebf6ddaf14610747578063ec9c218d1461074f578063eff0f59214610762578063f2fde38b14610797575b600080fd5b61026a61024e36600461502b565b610109602052600090815260409020546001600160a01b031681565b6040516102779190615048565b60405180910390f35b61029361028e36600461502b565b6107aa565b604051610277919060006101208201905060018060a01b0383511682526020830151602083015260408301516040830152606083015160608301526080830151608083015260a083015160a083015260c083015160c083015260e083015160e083015261010083015161010083015292915050565b6103126101085481565b604051908152602001610277565b61035561032e36600461502b565b609c6020526000908152604090208054600182015460028301546003909301549192909184565b604080519485526020850193909352918301526060820152608001610277565b61038861038336600461506e565b610837565b005b600254600160c01b900463ffffffff1660405163ffffffff9091168152602001610277565b6103886103bd3660046150cc565b610850565b6103886103d036600461512e565b610a7d565b610388610a93565b6103886103eb366004615167565b610acf565b6103f8610ad9565b604051610277929190615180565b61041961041436600461502b565b610aec565b604051610277939291906151e7565b61043b61043636600461502b565b610c20565b6040805196151587526001600160a01b039095166020870152938501929092526060840152608083015260a082015260c001610277565b61047a610cdc565b6040519015158152602001610277565b61031261049836600461502b565b60d16020526000908152604090205481565b6103886104b836600461502b565b610cf1565b6105146104cb36600461502b565b604080518082018252600080825260209182018190526001600160a01b03938416815260d082528290208251808401909352805490931682526001909201549181019190915290565b6040805182516001600160a01b031681526020928301519281019290925201610277565b610388610cfb565b610548610d0d565b60405161027792919061521c565b610388610564366004615167565b610d18565b610388610577366004615236565b610d29565b61038861058a366004615167565b610d41565b61038861059d3660046150cc565b610db6565b6105aa610f44565b604051610277929190615277565b6103886105c6366004615236565b610f54565b6103886105d9366004615167565b6110c4565b6103886110d8565b6105ee611112565b6040516102779796959493929190615285565b61031260d25481565b61026a6111bb565b61047a61062036600461502b565b60676020526000908152604090205460ff1681565b61064861064336600461531d565b6111d6565b6040516102779190615392565b6103126106633660046153f7565b6112be565b61047a61067636600461502b565b611492565b61026a6114b0565b61038861069136600461545f565b6114ba565b6103886106a43660046150cc565b611638565b6103126106b736600461502b565b609a6020526000908152604090205481565b6103886106d73660046150cc565b611777565b6103126106ea3660046154a7565b611860565b6103126101075481565b61026a611873565b61038861070f3660046150cc565b61187d565b610312610722366004615167565b600090815260d3602052604090205490565b610388610742366004615167565b611a0b565b61026a611a1c565b61038861075d36600461502b565b611a26565b610355610770366004615167565b609b6020526000908152604090208054600182015460028301546003909301549192909184565b6103886107a536600461502b565b611aa8565b6107b2614fae565b506001600160a01b03908116600090815260cf6020908152604091829020825161012081018452815490941684526001810154918401919091526002810154918301919091526003810154606083015260048101546080830152600581015460a0830152600681015460c0830152600781015460e08301526008015461010082015290565b61083f611ae3565b61084881611b15565b50565b905090565b82610859611b69565b6001600160a01b0316637c145cc78230336040518463ffffffff1660e01b8152600401610888939291906154d5565b602060405180830381865afa1580156108a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108c991906154f8565b813390916108f55760405163cc5d3c8b60e01b81526004016108ec929190615515565b60405180910390fd5b505083600061090382611b8d565b905061090e81611c90565b610919816000611cce565b610921611db8565b6000808061093187890189615646565b925092509250600083511161095957604051630783843960e51b815260040160405180910390fd5b600082511161097b57604051631e63bd9560e21b815260040160405180910390fd5b6001600160a01b03891660009081526101066020526040902054156109b357604051630d06866d60e21b815260040160405180910390fd5b6040805160608101825242815260208082018681528284018690526001600160a01b038d16600090815261010690925292902081518155915190919060018201906109fe9082615742565b5060408201516002820190610a139082615742565b5050506001600160a01b03811615610a2f57610a2f8982611dde565b886001600160a01b03167f159567bea25499a91f60e1fbb349ff2a1f8c1b2883198f25c1e12c99eddb44fa8989604051610a6a929190615800565b60405180910390a2505050505050505050565b610a85611ae3565b610a8f8282611e35565b5050565b3360008181526067602052604090205460ff16610ac4576040516372e3ef9760e01b81526004016108ec9190615048565b50610acd611eeb565b565b6108483382611f37565b600080610ae4611fdd565b915091509091565b6101066020526000908152604090208054600182018054919291610b0f906156c1565b80601f0160208091040260200160405190810160405280929190818152602001828054610b3b906156c1565b8015610b885780601f10610b5d57610100808354040283529160200191610b88565b820191906000526020600020905b815481529060010190602001808311610b6b57829003601f168201915b505050505090806002018054610b9d906156c1565b80601f0160208091040260200160405190810160405280929190818152602001828054610bc9906156c1565b8015610c165780601f10610beb57610100808354040283529160200191610c16565b820191906000526020600020905b815481529060010190602001808311610bf957829003601f168201915b5050505050905083565b6001600160a01b03808216600090815260cf60209081526040808320815161012081018352815490951685526001810154928501929092526002820154908401526003810154606084015260048101546080840152600581015460a0840152600681015460c0840152600781015460e0840152600801546101008301529081908190819081908190610cb181612054565b81516020830151604084015160c085015160e090950151939c929b5090995097509195509350915050565b600080610ce7612073565b5460ff1692915050565b6108483382611dde565b610d03611ae3565b610acd6000612097565b600080610ae46120f3565b610d20611ae3565b6108488161216a565b610d31611ae3565b610d3c83838361219f565b505050565b610d49611ae3565b610d5681620f4240101590565b8190610d7857604051631c9c717b60e01b81526004016108ec91815260200190565b506101088190556040518181527f6deef78ffe3df79ae5cd8e40b842c36ac6077e13746b9b68a9f327537b01e4e9906020015b60405180910390a150565b82610dbf611b69565b6001600160a01b0316637c145cc78230336040518463ffffffff1660e01b8152600401610dee939291906154d5565b602060405180830381865afa158015610e0b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e2f91906154f8565b81339091610e525760405163cc5d3c8b60e01b81526004016108ec929190615515565b50506001600160a01b0384166000908152610106602052604090205484908190610e905760405163ee27189960e01b81526004016108ec9190615048565b50610e99611db8565b6000610ea78486018661502b565b90506001600160a01b038616610ebe60cf836121f2565b51879183916001600160a01b031614610eec5760405163c0bbff1360e01b81526004016108ec929190615515565b5050610ef9816000612277565b856001600160a01b03167f73330c218a680717e9eee625c262df66eddfdf99ecb388d25f6b32d66b9a318a8686604051610f34929190615800565b60405180910390a2505050505050565b600080610ae46000546001549091565b82610f5d611b69565b6001600160a01b0316637c145cc78230336040518463ffffffff1660e01b8152600401610f8c939291906154d5565b602060405180830381865afa158015610fa9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fcd91906154f8565b81339091610ff05760405163cc5d3c8b60e01b81526004016108ec929190615515565b5050836000610ffe82611b8d565b905061100981611c90565b611014816000611cce565b6001600160a01b03861660009081526101066020526040902054869081906110505760405163ee27189960e01b81526004016108ec9190615048565b50611059611db8565b6001600160a01b03871661106e60cf886121f2565b51889188916001600160a01b03161461109c5760405163c0bbff1360e01b81526004016108ec929190615515565b50506110bb8686600260189054906101000a900463ffffffff166123d9565b50505050505050565b6110cc611ae3565b610848816000196126d7565b3360008181526067602052604090205460ff16611109576040516372e3ef9760e01b81526004016108ec9190615048565b50610acd612746565b600060608060008060006060600061112861278d565b805490915015801561113c57506001810154155b6111805760405162461bcd60e51b81526020600482015260156024820152741152540dcc4c8e88155b9a5b9a5d1a585b1a5e9959605a1b60448201526064016108ec565b6111886127b1565b611190612852565b60408051600080825260208201909252600f60f81b9c939b5091995046985030975095509350915050565b6000806111c661286f565b546001600160a01b031692915050565b604080516000815260208101909152606090826001600160401b038111156112005761120061552f565b60405190808252806020026020018201604052801561123357816020015b606081526020019060019003908161121e5790505b50915060005b838110156112b5576112903086868481811061125757611257615858565b9050602002810190611269919061586e565b8560405160200161127c939291906158b4565b604051602081830303815290604052612893565b8382815181106112a2576112a2615858565b6020908102919091010152600101611239565b50505b92915050565b6000846112c9611b69565b6001600160a01b0316637c145cc78230336040518463ffffffff1660e01b81526004016112f8939291906154d5565b602060405180830381865afa158015611315573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061133991906154f8565b8133909161135c5760405163cc5d3c8b60e01b81526004016108ec929190615515565b505085600061136a82611b8d565b905061137581611c90565b611380816000611cce565b6001600160a01b03881660009081526101066020526040902054889081906113bc5760405163ee27189960e01b81526004016108ec9190615048565b506113c5611db8565b6000808960028111156113da576113da6158db565b036113f1576113ea8a8989612909565b9050611430565b6002896002811115611405576114056158db565b03611415576113ea8a8989612e1d565b8860405163047031cf60e41b81526004016108ec9190615913565b886002811115611442576114426158db565b8a6001600160a01b03167f54fe682bfb66381a9382e13e4b95a3dd4f960eafbae063fdea3539d144ff3ff58360405161147d91815260200190565b60405180910390a39998505050505050505050565b60006112b882600260189054906101000a900463ffffffff16612ec1565b600061084b612ee0565b60006114c4612f04565b805490915060ff600160401b82041615906001600160401b03166000811580156114eb5750825b90506000826001600160401b031660011480156115075750303b155b905081158015611515575080155b156115335760405163f92ee8a960e01b815260040160405180910390fd5b84546001600160401b0319166001178555831561155c57845460ff60401b1916600160401b1785555b61156589612f2d565b61156d612f3e565b611575612f46565b61157d612f5e565b6115c96040518060400160405280600f81526020016e53756267726170685365727669636560881b815250604051806040016040528060038152602001620312e360ec1b815250612f6e565b6115d5886000196126d7565b6115de87611b15565b6115e786612f88565b831561162d57845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b505050505050505050565b337f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03811682146116855760405163cdc0567f60e01b81526004016108ec929190615515565b50600090508061169783850185615921565b915091506116a3611b69565b6001600160a01b031663e76fede68684846116bc612fdf565b60405160e086901b6001600160e01b03191681526001600160a01b039485166004820152602481019390935260448301919091529091166064820152608401600060405180830381600087803b15801561171557600080fd5b505af1158015611729573d6000803e3d6000fd5b50505050846001600160a01b03167f02f2e74a11116e05b39159372cceb6739257b08d72f7171d208ff27bb6466c588360405161176891815260200190565b60405180910390a25050505050565b82611780611b69565b6001600160a01b0316637c145cc78230336040518463ffffffff1660e01b81526004016117af939291906154d5565b602060405180830381865afa1580156117cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117f091906154f8565b813390916118135760405163cc5d3c8b60e01b81526004016108ec929190615515565b505061181d611db8565b61182684613003565b6040516001600160a01b038516907ff53cf6521a1b5fc0c04bffa70374a4dc2e3474f2b2ac1643c3bcc54e2db4a93990600090a250505050565b600061186c8383613076565b9392505050565b600061084b612fdf565b82611886611b69565b6001600160a01b0316637c145cc78230336040518463ffffffff1660e01b81526004016118b5939291906154d5565b602060405180830381865afa1580156118d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118f691906154f8565b813390916119195760405163cc5d3c8b60e01b81526004016108ec929190615515565b505083600061192782611b8d565b905061193281611c90565b61193d816000611cce565b6001600160a01b03861660009081526101066020526040902054869081906119795760405163ee27189960e01b81526004016108ec9190615048565b50611982611db8565b6000808080611993898b018b615943565b93509350935093506119bb8b83868685600260189054906101000a900463ffffffff166130e5565b8a6001600160a01b03167fd3803eb82ef5b4cdff8646734ebbaf5b37441e96314b27ffd3d0940f12a038e78b8b6040516119f6929190615800565b60405180910390a25050505050505050505050565b611a13611ae3565b61084881612f88565b600061084b6132dc565b611a2e611db8565b6000611a3b60cf836121f2565b9050611a5260d2548261330090919063ffffffff16565b8290611a7157604051623477b560e51b81526004016108ec9190615048565b50611a7b8161333d565b158290611a9c576040516317c7b35d60e31b81526004016108ec9190615048565b50610a8f826001612277565b611ab0611ae3565b6001600160a01b038116611ada576000604051631e4fbdf760e01b81526004016108ec9190615048565b61084881612097565b33611aec6111bb565b6001600160a01b031614610acd573360405163118cdaa760e01b81526004016108ec9190615048565b6002805463ffffffff60c01b1916600160c01b63ffffffff8416908102919091179091556040519081527f472aba493f9fd1d136ec54986f619f3aa5caff964f0e731a9909fb9a1270211f90602001610dab565b7f000000000000000000000000000000000000000000000000000000000000000090565b6040805161014081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101829052610120810182905290611be6611b69565b6001600160a01b03166325d9897e84306040518363ffffffff1660e01b8152600401611c13929190615515565b61014060405180830381865afa158015611c31573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c5591906159d0565b90508060a001516001600160401b0316600014158390611c8957604051637b3c09bf60e01b81526004016108ec9190615048565b5092915050565b6020810151815161084891611ca491615845565b60005460015460405180604001604052806006815260200165746f6b656e7360d01b81525061335c565b600080611cd96120f3565b91509150600083611cee578460800151611cf4565b8460e001515b9050611d42816001600160401b0316846001600160401b0316846001600160401b03166040518060400160405280600d81526020016c1d1a185dda5b99d4195c9a5bd9609a1b81525061335c565b600080611d4d611fdd565b91509150600086611d62578760600151611d68565b8760c001515b9050611dae8163ffffffff168463ffffffff168463ffffffff166040518060400160405280600e81526020016d1b585e15995c9a599a595c90dd5d60921b81525061335c565b5050505050505050565b611dc0610cdc565b15610acd5760405163d93c066560e01b815260040160405180910390fd5b6001600160a01b038281166000818152610109602052604080822080546001600160a01b0319169486169485179055517e3215dc05a2fc4e6a1e2c2776311d207c730ee51085aae221acc5cbe6fb55c19190a35050565b6001600160a01b0382166000908152606760205260409020548290829060ff161515811514611e8a57604051635e67e54b60e01b81526001600160a01b039092166004830152151560248201526044016108ec565b50506001600160a01b038216600081815260676020908152604091829020805460ff191685151590811790915591519182527fa95bac2f3df0d40e8278281c1d39d53c60e4f2bf3550ca5665738d0916e89789910160405180910390a25050565b611ef3613390565b6000611efd612073565b805460ff1916815590507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b604051610dab9190615048565b6001600160a01b0382166000818152609c60209081526040808320815192830184905282820194909452805180830382018152606090920190528190611f8b9084906133b5906133ca906134c590896134ea565b91509150846001600160a01b03167f13f3fa9f0e54af1af76d8b5d11c3973d7c2aed6312b61efff2f7b49d73ad67eb8383806020019051810190611fcf9190615a7d565b604051611768929190615277565b600080611fe8612fdf565b6001600160a01b031663bb2a2b476040518163ffffffff1660e01b8152600401602060405180830381865afa158015612025573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120499190615a96565b92620f424092509050565b60006120638260600151151590565b80156112b8575050608001511590565b7fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f0330090565b60006120a161286f565b80546001600160a01b038481166001600160a01b031983168117845560405193945091169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b6000806000612100612fdf565b6001600160a01b0316635aea0ec46040518163ffffffff1660e01b8152600401602060405180830381865afa15801561213d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121619190615ab3565b93849350915050565b60d28190556040518181527f21774046e2611ddb52c8c46e1ad97524eeb2e3fda7dcd9428867868b4c4d06ba90602001610dab565b6121ac60d08484846135a4565b80826001600160a01b0316846001600160a01b03167fd54c7abc930f6d506da2d08aa7aead4f2443e1db6d5f560384a2f652ff893e1960405160405180910390a4505050565b6121fa614fae565b6122048383613653565b604080516101208101825282546001600160a01b03168152600183015460208201526002830154918101919091526003820154606082015260048201546080820152600582015460a0820152600682015460c0820152600782015460e08201526008909101546101008201529392505050565b600061228460cf846121f2565b905061230f83612292613706565b6001600160a01b031663eeac3e0e84602001516040518263ffffffff1660e01b81526004016122c391815260200190565b6020604051808303816000875af11580156122e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123069190615a7d565b60cf919061372a565b61231a60cf846137dd565b8051604082015161232d9160d191613893565b806040015160d3600083602001518152602001908152602001600020546123549190615845565b60d3600083602001518152602001908152602001600020819055508060200151836001600160a01b031682600001516001600160a01b03167f08f2f865e0fb62d722a51e4d9873199bf6bf52e7d8ee5a2ee2896c9ef719f5458460400151866040516123cc9291909182521515602082015260400190565b60405180910390a4505050565b60006123e660cf856121f2565b90506123f181612054565b849061241157604051631eb5ff9560e01b81526004016108ec9190615048565b5080604001518314158484909161243d5760405163f32518cd60e01b81526004016108ec929190615ad0565b50506040810151808411156124735761246e612457611b69565b83516124638488615845565b60d192919087613911565b61248c565b815161248c906124838684615845565b60d19190613893565b6000612496613706565b6001600160a01b031663eeac3e0e84602001516040518263ffffffff1660e01b81526004016124c791815260200190565b6020604051808303816000875af11580156124e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061250a9190615a7d565b905060006125178461333d565b15612523576000612532565b60c08401516125329083615845565b6001600160a01b038816600090815260cf60205260409020600281018890556006018390559050612561613706565b6001600160a01b031663c8a5f81e84836040518363ffffffff1660e01b815260040161258e929190615277565b602060405180830381865afa1580156125ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125cf9190615a7d565b6001600160a01b038816600090815260cf6020526040812060070180549091906125fa908490615ae9565b909155505082861115612642576126118387615845565b60d360008660200151815260200190815260200160002060008282546126379190615ae9565b909155506126789050565b61264c8684615845565b60d360008660200151815260200190815260200160002060008282546126729190615845565b90915550505b8360200151876001600160a01b031685600001516001600160a01b03167f6db4a6f9be2d5e72eb2a2af2374ac487971bf342a261ba0bc1cf471bf2a2c31f89876040516126c6929190615277565b60405180910390a450505050505050565b8181808211156126fc5760405163ccccdafb60e01b81526004016108ec929190615277565b5050600082905560018190556040517f90699b8b4bf48918fea1129c85f9bc7b51285df7ecc982910813c7805f5688499061273a9084908490615277565b60405180910390a15050565b61274e611db8565b6000612758612073565b805460ff1916600117815590507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611f2a3390565b7fa16a46d94261c7517cc8ff89f61c0ce93598e3c849801011dee649a6a557d10090565b606060006127bd61278d565b90508060020180546127ce906156c1565b80601f01602080910402602001604051908101604052809291908181526020018280546127fa906156c1565b80156128475780601f1061281c57610100808354040283529160200191612847565b820191906000526020600020905b81548152906001019060200180831161282a57829003601f168201915b505050505091505090565b6060600061285e61278d565b90508060030180546127ce906156c1565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930090565b6060600080846001600160a01b0316846040516128b09190615afc565b600060405180830381855af49150503d80600081146128eb576040519150601f19603f3d011682016040523d82523d6000602084013e6128f0565b606091505b5091509150612900858383613a0f565b95945050505050565b6000808061291984860186615b3a565b8151604001519193509150866001600160a01b038281169082161461295357604051631a071d0760e01b81526004016108ec929190615515565b50508151516001600160a01b038111156129835760405163fa4ac7a760e01b81526004016108ec91815260200190565b50815151600061299460cf836121f2565b805190915088906001600160a01b03818116908316146129c957604051634508fbf760e11b81526004016108ec929190615515565b505060208101516129db896000611f37565b60008060006129e8613a62565b6001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401612a139190615048565b602060405180830381865afa158015612a30573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a549190615a7d565b9050612a5e6132dc565b6001600160a01b031663692209ce6000612afc8b612a7a612ee0565b6001600160a01b0316634c4ea0ed8a6040518263ffffffff1660e01b8152600401612aa791815260200190565b602060405180830381865afa158015612ac4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ae891906154f8565b612af3576000613a86565b61010854613a86565b8a6040518463ffffffff1660e01b8152600401612b1b93929190615c71565b6020604051808303816000875af1158015612b3a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b5e9190615a7d565b92506000612b6a613a62565b6001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401612b959190615048565b602060405180830381865afa158015612bb2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bd69190615a7d565b9050818181811015612bfd57604051639db8bc9560e01b81526004016108ec929190615277565b50612c0a90508282615845565b92505082159050612db457612ca98b6101075484612c289190615ca1565b612c30612fdf565b6001600160a01b0316635aea0ec46040518163ffffffff1660e01b8152600401602060405180830381865afa158015612c6d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c919190615ab3565b612ca4906001600160401b031642615ae9565b613ada565b8015612db457612cb7613706565b6001600160a01b0316631d1c2fec846040518263ffffffff1660e01b8152600401612ce491815260200190565b6020604051808303816000875af1158015612d03573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d279190615a7d565b50612d4c612d33612ee0565b82612d3c613a62565b6001600160a01b03169190613c4a565b612d54612ee0565b6001600160a01b0316638157328884836040518363ffffffff1660e01b8152600401612d81929190615277565b600060405180830381600087803b158015612d9b57600080fd5b505af1158015612daf573d6000803e3d6000fd5b505050505b86516020908101516040805186815292830185905282018390526001600160a01b038088169291811691908e16907f184c452047299395d4f7f147eb8e823458a450798539be54aeed978f13d87ba29060600160405180910390a4509998505050505050505050565b6000808080612e2e85870187615cb8565b919450925090506001600160a01b038716612e4a60cf856121f2565b51889185916001600160a01b031614612e785760405163c0bbff1360e01b81526004016108ec929190615515565b50506002546001600160a01b0388811660009081526101096020526040902054612eb692869286928692600160c01b900463ffffffff169116613cf9565b979650505050505050565b6000612ed8612ece611b69565b60d19085856142d6565b159392505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b6000807ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a006112b8565b612f35614370565b61084881614395565b610acd614370565b612f4e614370565b612f5661439d565b610acd612f3e565b612f66614370565b612f56612f3e565b612f76614370565b612f8082826143df565b610a8f612f3e565b80600003612fa95760405163bc71a04360e01b815260040160405180910390fd5b6101078190556040518181527f2aaaf20b08565eebc0c962cd7c568e54c3c0c2b85a1f942b82cd1bd730fdcd2390602001610dab565b7f000000000000000000000000000000000000000000000000000000000000000090565b61300e8160016143f1565b613016611b69565b6001600160a01b0316633a78b732826040518263ffffffff1660e01b81526004016130419190615048565b600060405180830381600087803b15801561305b57600080fd5b505af115801561306f573d6000803e3d6000fd5b5050505050565b600061186c7f4bdee85c4b4a268f4895d1096d553c3e57bb2433c380e7b7ec8cb56cc4f7467384846040516020016130ca939291909283526001600160a01b03918216602084015216604082015260600190565b60405160208183030381529060405280519060200120614408565b6001600160a01b03851661310c57604051634ffdf5ef60e11b815260040160405180910390fd5b613117868684614435565b61312b613122611b69565b60d09087614484565b600061313561457a565b6001600160a01b031663766718086040518163ffffffff1660e01b8152600401602060405180830381865afa158015613172573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131969190615a7d565b90506000613226888888886131a9613706565b6001600160a01b031663eeac3e0e8c6040518263ffffffff1660e01b81526004016131d691815260200190565b6020604051808303816000875af11580156131f5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132199190615a7d565b60cf94939291908861459e565b905061323e613233611b69565b60d1908a8887613911565b806040015160d3600083602001518152602001908152602001600020546132659190615ae9565b60d36000836020015181526020019081526020016000208190555085876001600160a01b0316896001600160a01b03167fe5e185fab2b992c4727ff702a867d78b15fb176dbaa20c9c312a1c351d3f7f838460400151866040516132ca929190615277565b60405180910390a45050505050505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b60008061331584606001518560a00151614706565b61331f9042615845565b905061332a84612054565b801561333557508281115b949350505050565b600061334c8260600151151590565b80156112b8575050604001511590565b613367848484614716565b8185858590919293611dae57604051630871e13d60e01b81526004016108ec9493929190615d10565b613398610cdc565b610acd57604051638dfc202b60e01b815260040160405180910390fd5b6000908152609b602052604090206003015490565b6000606060006133d98561472d565b90504281604001511115613401575050604080516020810190915260008152600191506134be565b600080858060200190518101906134189190615d3f565b8451919350915061342d90609a908390613893565b86816001600160a01b03167f4c06b68820628a39c787d2db1faa0eeacd7b9474847b198b1e871fe6e5b93f4485600001518660400151604051613471929190615277565b60405180910390a382516134859083615ae9565b6040805160208101929092526001600160a01b038316908201526060016040516020818303038152906040529550600086945094505050505b9250929050565b6000908152609b60205260408120818155600181018290556002810182905560030155565b60006060876003015483111561351357604051634a411b9d60e11b815260040160405180910390fd5b600083156135215783613527565b88600301545b89549094505b801580159061353c5750600085115b156135955760008061355283898c63ffffffff16565b915091508115613563575050613595565b9650866135718c8c8b6147bb565b92508661357d81615d65565b975050838061358b90615d7c565b945050505061352d565b50989397509295505050505050565b6001600160a01b0380831660009081526020868152604091829020825180840190935280549093168252600190920154918101919091526135e490614842565b15829061360557604051632d7d25f160e21b81526004016108ec9190615048565b506040805180820182526001600160a01b0394851681526020808201938452938516600090815295909352909320905181546001600160a01b03191692169190911781559051600190910155565b6001600160a01b03808216600090815260208481526040808320815161012081018352815490951685526001810154928501929092526002820154908401526003810154606084015260048101546080840152600581015460a0840152600681015460c0840152600781015460e0840152600881015461010084015290916136de9060600151151590565b83906136fe576040516342daadaf60e01b81526004016108ec9190615048565b509392505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b60006137368484613653565b604080516101208101825282546001600160a01b03168152600183015460208201526002830154918101919091526003820154606082015260048201546080820152600582015460a0820152600682015460c0820152600782015460e082015260088201546101008201529091506137ad90612054565b600482015484916137d3576040516361b66e0d60e01b81526004016108ec929190615ad0565b5050600601555050565b60006137e98383613653565b604080516101208101825282546001600160a01b03168152600183015460208201526002830154918101919091526003820154606082015260048201546080820152600582015460a0820152600682015460c0820152600782015460e0820152600882015461010082015290915061386090612054565b60048201548391613886576040516361b66e0d60e01b81526004016108ec929190615ad0565b5050426004909101555050565b806000036138a057505050565b6001600160a01b03821660009081526020849052604090205481808210156138dd57604051635f8ec70960e01b81526004016108ec929190615277565b50506001600160a01b03821660009081526020849052604081208054839290613907908490615845565b9091555050505050565b811561306f576001600160a01b03831660009081526020869052604081205461393b908490615ae9565b90506000856001600160a01b031663872d04898630866040518463ffffffff1660e01b815260040161396f93929190615d95565b602060405180830381865afa15801561398c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906139b09190615a7d565b90508082818111156139d757604051635f8ec70960e01b81526004016108ec929190615277565b50506001600160a01b03851660009081526020889052604081208054869290613a01908490615ae9565b909155505050505050505050565b606082613a2457613a1f82614851565b61186c565b8151158015613a3b57506001600160a01b0384163b155b15613a5b5783604051639996b31560e01b81526004016108ec9190615048565b508061186c565b7f000000000000000000000000000000000000000000000000000000000000000090565b81516040908101516001600160a01b039081166000908152610109602090815290839020549251606093613ac39387938793929091169101615dbe565b604051602081830303815290604052905092915050565b81600003613afb57604051638f4c63d960e01b815260040160405180910390fd5b613b27613b06611b69565b600254609a91908690869063ffffffff600160c01b90910481169061391116565b6001600160a01b0383166000908152609c6020908152604080832060028082015483516001600160601b031930606090811b8216838901528b901b166034820152604880820192909252845180820390920182526068810180865282519287019290922060e882018652898352426088830190815260a883018a815260c8909301898152828a52609b909852959097209151825593516001820155925190830155915160039182015581015490919015613bf55760018201546000908152609b602052604090206003018190555b613bff828261487a565b80856001600160a01b03167f5d9e2c5278e41138269f5f980cfbea016d8c59816754502abc4d2f87aaea987f8686604051613c3b929190615277565b60405180910390a35050505050565b8015610d3c5760405163a9059cbb60e01b81526001600160a01b0384169063a9059cbb90613c7e9085908590600401615ad0565b6020604051808303816000875af1158015613c9d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613cc191906154f8565b610d3c5760405162461bcd60e51b815260206004820152600960248201526810ba3930b739b332b960b91b60448201526064016108ec565b600080613d0760cf886121f2565b9050613d1281612054565b8790613d3257604051631eb5ff9560e01b81526004016108ec9190615048565b506000613d4a60d2548361330090919063ffffffff16565b158015613d5d5750613d5b8261333d565b155b8015613d6857508615155b8015613de05750816101000151613d7d61457a565b6001600160a01b031663766718086040518163ffffffff1660e01b8152600401602060405180830381865afa158015613dba573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613dde9190615a7d565b115b613deb576000613e61565b613df3613706565b6001600160a01b031663db750926896040518263ffffffff1660e01b8152600401613e1e9190615048565b6020604051808303816000875af1158015613e3d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613e619190615a7d565b9050613ea088613e6f613706565b6001600160a01b031663eeac3e0e85602001516040518263ffffffff1660e01b81526004016122c391815260200190565b613eab60cf8961490d565b613eb660cf896149c3565b60008082156141ef576000613ec9611b69565b8551604051637573ef4f60e01b81526001600160a01b039290921691637573ef4f91613efc913090600290600401615e87565b602060405180830381865afa158015613f19573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613f3d9190615a7d565b90506000613f49611b69565b8651604051631584a17960e21b81526001600160a01b03929092169163561285e491613f79913090600401615515565b60a060405180830381865afa158015613f96573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613fba9190615eac565b90506000816020015111613fcf576000613fd9565b613fd98583614a7a565b925082156140ce57613fe9613a62565b6001600160a01b031663095ea7b3613fff611b69565b856040518363ffffffff1660e01b815260040161401d929190615ad0565b6020604051808303816000875af115801561403c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061406091906154f8565b50614069611b69565b865160405163ca94b0e960e01b81526001600160a01b03929092169163ca94b0e99161409b9130908890600401615f1f565b600060405180830381600087803b1580156140b557600080fd5b505af11580156140c9573d6000803e3d6000fd5b505050505b6140d88386615845565b935083156141ec576001600160a01b0388166141df576140f6613a62565b6001600160a01b031663095ea7b361410c611b69565b866040518363ffffffff1660e01b815260040161412a929190615ad0565b6020604051808303816000875af1158015614149573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061416d91906154f8565b50614176611b69565b8651604051633a30904960e11b81526001600160a01b0392909216916374612092916141a89130908990600401615f1f565b600060405180830381600087803b1580156141c257600080fd5b505af11580156141d6573d6000803e3d6000fd5b505050506141ec565b6141ec8885612d3c613a62565b50505b602084015184516001600160a01b03808d1691167f443f56bd2098d273b8c8120398789a41da5925db4ba2f656813fc5299ac57b1f8686868f8f61423161457a565b6001600160a01b031663766718086040518163ffffffff1660e01b8152600401602060405180830381865afa15801561426e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906142929190615a7d565b6040516142a496959493929190615f43565b60405180910390a483516142b89088612ec1565b156142c8576142c88a6001612277565b509098975050505050505050565b600080846001600160a01b031663872d04898530866040518463ffffffff1660e01b815260040161430993929190615d95565b602060405180830381865afa158015614326573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061434a9190615a7d565b6001600160a01b0385166000908152602088905260409020541115915050949350505050565b614378614ada565b610acd57604051631afcd79f60e31b815260040160405180910390fd5b611ab0614370565b6143a5614370565b6143b260006000196126d7565b6143c06000620f4240614af4565b6143d260006001600160401b03614bc5565b610acd63ffffffff611b15565b6143e7614370565b610a8f8282614c52565b60006143fc83611b8d565b9050610d3c8183611cce565b60006112b8614415614c93565b8360405161190160f01b8152600281019290925260228201526042902090565b600061444a6144448585613076565b83614c9d565b905080836001600160a01b038083169082161461447c57604051638c5b935d60e01b81526004016108ec929190615515565b505050505050565b6001600160a01b0380821660009081526020858152604091829020825180840190935280549093168252600190920154918101919091526144c490614842565b1581906144e557604051632d7d25f160e21b81526004016108ec9190615048565b506040516378eb06b360e11b81526001600160a01b0383169063f1d60d6690614512908490600401615048565b602060405180830381865afa15801561452f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061455391906154f8565b15819061457457604051632d7d25f160e21b81526004016108ec9190615048565b50505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b6145a6614fae565b6001600160a01b03808716600090815260208a8152604091829020825161012081018452815490941684526001810154918401919091526002810154918301919091526003810154606083015260048101546080830152600581015460a0830152600681015460c0830152600781015460e0830152600801546101008201526146329060600151151590565b15869061465357604051630bc4def560e01b81526004016108ec9190615048565b505060408051610120810182526001600160a01b0397881681526020808201968752818301958652426060830190815260006080840181815260a0850182815260c0860198895260e0860183815261010087019889529b8d1683529c90935293909320825181546001600160a01b0319169a169990991789559551600189015593516002880155516003870155925160048601559451600585015593516006840155905160078301555160089091015590565b600082821882841102821861186c565b600082841015801561333557505090911115919050565b61475b6040518060800160405280600081526020016000815260200160008152602001600080191681525090565b6000828152609b602090815260409182902082516080810184528154815260018201549281018390526002820154938101939093526003015460608301528390611c895760405163107349a960e21b81526004016108ec91815260200190565b6000808460030154116147e15760405163ddaf8f2160e01b815260040160405180910390fd5b60006147f485600001548563ffffffff16565b905061480785600001548463ffffffff16565b600185600301600082825461481c9190615845565b9091555050808555600385015460000361483857600060018601555b5050915492915050565b516001600160a01b0316151590565b8051156148615780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b6127108260030154106148a0576040516303a8c56b60e61b815260040160405180910390fd5b806148be57604051638f4a893d60e01b815260040160405180910390fd5b60018083018290556002830180546000906148da908490615ae9565b909155505060038201546000036148ef578082555b60018260030160008282546149049190615ae9565b90915550505050565b60006149198383613653565b604080516101208101825282546001600160a01b03168152600183015460208201526002830154918101919091526003820154606082015260048201546080820152600582015460a0820152600682015460c0820152600782015460e0820152600882015461010082015290915061499090612054565b600482015483916149b6576040516361b66e0d60e01b81526004016108ec929190615ad0565b5050426005909101555050565b60006149cf8383613653565b604080516101208101825282546001600160a01b03168152600183015460208201526002830154918101919091526003820154606082015260048201546080820152600582015460a0820152600682015460c0820152600782015460e08201526008820154610100820152909150614a4690612054565b60048201548391614a6c576040516361b66e0d60e01b81526004016108ec929190615ad0565b505060006007909101555050565b6000614a8983620f4240101590565b80614a9c5750614a9c82620f4240101590565b83839091614abf5760405163768bf0eb60e11b81526004016108ec929190615277565b50620f42409050614ad08385615ca1565b61186c9190615f81565b6000614ae4612f04565b54600160401b900460ff16919050565b818163ffffffff8082169083161115614b225760405163ccccdafb60e01b81526004016108ec929190615180565b508290508163ffffffff8116620f42401015614b535760405163ccccdafb60e01b81526004016108ec929190615180565b50506002805463ffffffff838116600160a01b0263ffffffff60a01b19918616600160801b0291909116600160801b600160c01b0319909216919091171790556040517f2fe5a7039987697813605cc0b9d6db7aab575408e3fc59e8a457bef8d7bc0a369061273a9084908490615180565b81816001600160401b038082169083161115614bf65760405163ccccdafb60e01b81526004016108ec92919061521c565b5050600280546001600160401b03838116600160401b026001600160801b0319909216908516171790556040517f2867e04c500e438761486b78021d4f9eb97c77ff45d10c1183f5583ba4cbf7d19061273a908490849061521c565b614c5a614370565b6000614c6461278d565b905060028101614c748482615742565b5060038101614c838382615742565b5060008082556001909101555050565b600061084b614cc7565b600080600080614cad8686614d3b565b925092509250614cbd8282614d88565b5090949350505050565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f614cf2614e41565b614cfa614ea8565b60408051602081019490945283019190915260608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b60008060008351604103614d755760208401516040850151606086015160001a614d6788828585614ee9565b955095509550505050614d81565b50508151600091506002905b9250925092565b6000826003811115614d9c57614d9c6158db565b03614da5575050565b6001826003811115614db957614db96158db565b03614dd75760405163f645eedf60e01b815260040160405180910390fd5b6002826003811115614deb57614deb6158db565b03614e0c5760405163fce698f760e01b8152600481018290526024016108ec565b6003826003811115614e2057614e206158db565b03610a8f576040516335e2f38360e21b8152600481018290526024016108ec565b600080614e4c61278d565b90506000614e586127b1565b805190915015614e7057805160209091012092915050565b81548015614e7f579392505050565b7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470935050505090565b600080614eb361278d565b90506000614ebf612852565b805190915015614ed757805160209091012092915050565b60018201548015614e7f579392505050565b600080806fa2a8918ca85bafe22016d0b997e4df60600160ff1b03841115614f1a5750600091506003905082614fa4565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa158015614f6e573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116614f9a57506000925060019150829050614fa4565b9250600091508190505b9450945094915050565b60405180610120016040528060006001600160a01b0316815260200160008019168152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b6001600160a01b038116811461084857600080fd5b803561502681615006565b919050565b60006020828403121561503d57600080fd5b813561186c81615006565b6001600160a01b0391909116815260200190565b63ffffffff8116811461084857600080fd5b60006020828403121561508057600080fd5b813561186c8161505c565b60008083601f84011261509d57600080fd5b5081356001600160401b038111156150b457600080fd5b6020830191508360208285010111156134be57600080fd5b6000806000604084860312156150e157600080fd5b83356150ec81615006565b925060208401356001600160401b0381111561510757600080fd5b6151138682870161508b565b9497909650939450505050565b801515811461084857600080fd5b6000806040838503121561514157600080fd5b823561514c81615006565b9150602083013561515c81615120565b809150509250929050565b60006020828403121561517957600080fd5b5035919050565b63ffffffff92831681529116602082015260400190565b60005b838110156151b257818101518382015260200161519a565b50506000910152565b600081518084526151d3816020860160208601615197565b601f01601f19169290920160200192915050565b83815260606020820152600061520060608301856151bb565b828103604084015261521281856151bb565b9695505050505050565b6001600160401b0392831681529116602082015260400190565b60008060006060848603121561524b57600080fd5b833561525681615006565b9250602084013561526681615006565b929592945050506040919091013590565b918252602082015260400190565b60ff60f81b8816815260e0602082015260006152a460e08301896151bb565b82810360408401526152b681896151bb565b606084018890526001600160a01b038716608085015260a0840186905283810360c08501528451808252602080870193509091019060005b8181101561530c5783518352602093840193909201916001016152ee565b50909b9a5050505050505050505050565b6000806020838503121561533057600080fd5b82356001600160401b0381111561534657600080fd5b8301601f8101851361535757600080fd5b80356001600160401b0381111561536d57600080fd5b8560208260051b840101111561538257600080fd5b6020919091019590945092505050565b6000602082016020835280845180835260408501915060408160051b86010192506020860160005b828110156153eb57603f198786030184526153d68583516151bb565b945060209384019391909101906001016153ba565b50929695505050505050565b6000806000806060858703121561540d57600080fd5b843561541881615006565b935060208501356003811061542c57600080fd5b925060408501356001600160401b0381111561544757600080fd5b6154538782880161508b565b95989497509550505050565b6000806000806080858703121561547557600080fd5b843561548081615006565b93506020850135925060408501356154978161505c565b9396929550929360600135925050565b600080604083850312156154ba57600080fd5b82356154c581615006565b9150602083013561515c81615006565b6001600160a01b0393841681529183166020830152909116604082015260600190565b60006020828403121561550a57600080fd5b815161186c81615120565b6001600160a01b0392831681529116602082015260400190565b634e487b7160e01b600052604160045260246000fd5b60405161014081016001600160401b03811182821017156155685761556861552f565b60405290565b604080519081016001600160401b03811182821017156155685761556861552f565b60405160e081016001600160401b03811182821017156155685761556861552f565b600082601f8301126155c357600080fd5b8135602083016000806001600160401b038411156155e3576155e361552f565b50604051601f19601f85018116603f011681018181106001600160401b03821117156156115761561161552f565b60405283815290508082840187101561562957600080fd5b838360208301376000602085830101528094505050505092915050565b60008060006060848603121561565b57600080fd5b83356001600160401b0381111561567157600080fd5b61567d868287016155b2565b93505060208401356001600160401b0381111561569957600080fd5b6156a5868287016155b2565b92505060408401356156b681615006565b809150509250925092565b600181811c908216806156d557607f821691505b6020821081036156f557634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115610d3c57806000526020600020601f840160051c810160208510156157225750805b601f840160051c820191505b8181101561306f576000815560010161572e565b81516001600160401b0381111561575b5761575b61552f565b61576f8161576984546156c1565b846156fb565b6020601f8211600181146157a3576000831561578b5750848201515b600019600385901b1c1916600184901b17845561306f565b600084815260208120601f198516915b828110156157d357878501518255602094850194600190920191016157b3565b50848210156157f15786840151600019600387901b60f8161c191681555b50505050600190811b01905550565b60208152816020820152818360408301376000818301604090810191909152601f909201601f19160101919050565b634e487b7160e01b600052601160045260246000fd5b818103818111156112b8576112b861582f565b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261588557600080fd5b8301803591506001600160401b0382111561589f57600080fd5b6020019150368190038213156134be57600080fd5b8284823760008382016000815283516158d1818360208801615197565b0195945050505050565b634e487b7160e01b600052602160045260246000fd5b6003811061590f57634e487b7160e01b600052602160045260246000fd5b9052565b602081016112b882846158f1565b6000806040838503121561593457600080fd5b50508035926020909101359150565b6000806000806080858703121561595957600080fd5b8435935060208501359250604085013561597281615006565b915060608501356001600160401b0381111561598d57600080fd5b615999878288016155b2565b91505092959194509250565b80516150268161505c565b6001600160401b038116811461084857600080fd5b8051615026816159b0565b60006101408284031280156159e457600080fd5b5060006159ef615545565b835181526020808501519082015260408085015190820152615a13606085016159a5565b6060820152615a24608085016159c5565b6080820152615a3560a085016159c5565b60a0820152615a4660c085016159a5565b60c0820152615a5760e085016159c5565b60e082015261010084810151908201526101209384015193810193909352509092915050565b600060208284031215615a8f57600080fd5b5051919050565b600060208284031215615aa857600080fd5b815161186c8161505c565b600060208284031215615ac557600080fd5b815161186c816159b0565b6001600160a01b03929092168252602082015260400190565b808201808211156112b8576112b861582f565b60008251615b0e818460208701615197565b9190910192915050565b8035615026816159b0565b80356001600160801b038116811461502657600080fd5b60008060408385031215615b4d57600080fd5b82356001600160401b03811115615b6357600080fd5b830160408186031215615b7557600080fd5b615b7d61556e565b81356001600160401b03811115615b9357600080fd5b820160e08188031215615ba557600080fd5b615bad615590565b81358152615bbd6020830161501b565b6020820152615bce6040830161501b565b6040820152615bdf6060830161501b565b6060820152615bf060808301615b18565b6080820152615c0160a08301615b23565b60a082015260c08201356001600160401b03811115615c1f57600080fd5b615c2b898285016155b2565b60c08301525082525060208201356001600160401b03811115615c4d57600080fd5b615c59878285016155b2565b60208381019190915291979590910135955050505050565b615c7b81856158f1565b606060208201526000615c9160608301856151bb565b9050826040830152949350505050565b80820281158282048414176112b8576112b861582f565b600080600060608486031215615ccd57600080fd5b8335615cd881615006565b92506020840135915060408401356001600160401b03811115615cfa57600080fd5b615d06868287016155b2565b9150509250925092565b608081526000615d2360808301876151bb565b6020830195909552506040810192909252606090910152919050565b60008060408385031215615d5257600080fd5b8251602084015190925061515c81615006565b600081615d7457615d7461582f565b506000190190565b600060018201615d8e57615d8e61582f565b5060010190565b6001600160a01b03938416815291909216602082015263ffffffff909116604082015260600190565b606080825284516040838301819052815160a085015260208201516001600160a01b0390811660c086015290820151811660e08501529181015190911661010083015260808101516001600160401b038116610120840152600091905060a08101516001600160801b0381166101408501525060c0015160e0610160840152615e4b6101808401826151bb565b90506020860151605f19848303016080850152615e6882826151bb565b9250505083602083015261333560408301846001600160a01b03169052565b6001600160a01b038481168252831660208201526060810161333560408301846158f1565b600060a0828403128015615ebf57600080fd5b5060405160009060a081016001600160401b0381118282101715615ee557615ee561552f565b6040908152845182526020808601519083015284810151908201526060808501519082015260809384015193810193909352509092915050565b6001600160a01b039384168152919092166020820152604081019190915260600190565b86815285602082015284604082015283606082015260c060808201526000615f6e60c08301856151bb565b90508260a0830152979650505050505050565b600082615f9e57634e487b7160e01b600052601260045260246000fd5b50049056fea2646970667358221220b85de947a2adf153b4d5d66360454c8d0624bca998d3fc8f12bd17e31d74127864736f6c634300081b0033", + "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x4 CALLDATASIZE LT PUSH2 0x23B JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0x7E736D8 EQ PUSH2 0x240 JUMPI DUP1 PUSH4 0xE022923 EQ PUSH2 0x280 JUMPI DUP1 PUSH4 0x138DEA08 EQ PUSH2 0x308 JUMPI DUP1 PUSH4 0x13C474C9 EQ PUSH2 0x320 JUMPI DUP1 PUSH4 0x1DD42F60 EQ PUSH2 0x375 JUMPI DUP1 PUSH4 0x1EBB7C30 EQ PUSH2 0x38A JUMPI DUP1 PUSH4 0x24B8FBF6 EQ PUSH2 0x3AF JUMPI DUP1 PUSH4 0x35577962 EQ PUSH2 0x3C2 JUMPI DUP1 PUSH4 0x3F4BA83A EQ PUSH2 0x3D5 JUMPI DUP1 PUSH4 0x45F54485 EQ PUSH2 0x3DD JUMPI DUP1 PUSH4 0x482468B7 EQ PUSH2 0x3F0 JUMPI DUP1 PUSH4 0x4F793CDC EQ PUSH2 0x406 JUMPI DUP1 PUSH4 0x55C85269 EQ PUSH2 0x428 JUMPI DUP1 PUSH4 0x5C975ABB EQ PUSH2 0x472 JUMPI DUP1 PUSH4 0x6234E216 EQ PUSH2 0x48A JUMPI DUP1 PUSH4 0x6CCEC5B8 EQ PUSH2 0x4AA JUMPI DUP1 PUSH4 0x6D9A3951 EQ PUSH2 0x4BD JUMPI DUP1 PUSH4 0x715018A6 EQ PUSH2 0x538 JUMPI DUP1 PUSH4 0x71CE020A EQ PUSH2 0x540 JUMPI DUP1 PUSH4 0x7AA31BCE EQ PUSH2 0x556 JUMPI DUP1 PUSH4 0x7DFE6D28 EQ PUSH2 0x569 JUMPI DUP1 PUSH4 0x7E89BAC3 EQ PUSH2 0x57C JUMPI DUP1 PUSH4 0x8180083B EQ PUSH2 0x58F JUMPI DUP1 PUSH4 0x819BA366 EQ PUSH2 0x5A2 JUMPI DUP1 PUSH4 0x81E777A7 EQ PUSH2 0x5B8 JUMPI DUP1 PUSH4 0x832BC923 EQ PUSH2 0x5CB JUMPI DUP1 PUSH4 0x8456CB59 EQ PUSH2 0x5DE JUMPI DUP1 PUSH4 0x84B0196E EQ PUSH2 0x5E6 JUMPI DUP1 PUSH4 0x85E82BAF EQ PUSH2 0x601 JUMPI DUP1 PUSH4 0x8DA5CB5B EQ PUSH2 0x60A JUMPI DUP1 PUSH4 0x9384E078 EQ PUSH2 0x612 JUMPI DUP1 PUSH4 0xAC9650D8 EQ PUSH2 0x635 JUMPI DUP1 PUSH4 0xB15D2A2C EQ PUSH2 0x655 JUMPI DUP1 PUSH4 0xBA38F67D EQ PUSH2 0x668 JUMPI DUP1 PUSH4 0xC0F47497 EQ PUSH2 0x67B JUMPI DUP1 PUSH4 0xC84A5EF3 EQ PUSH2 0x683 JUMPI DUP1 PUSH4 0xCB8347FE EQ PUSH2 0x696 JUMPI DUP1 PUSH4 0xCBE5F3F2 EQ PUSH2 0x6A9 JUMPI DUP1 PUSH4 0xCE0FC0CC EQ PUSH2 0x6C9 JUMPI DUP1 PUSH4 0xCE56C98B EQ PUSH2 0x6DC JUMPI DUP1 PUSH4 0xD07A7A84 EQ PUSH2 0x6EF JUMPI DUP1 PUSH4 0xDB9BEE46 EQ PUSH2 0x6F9 JUMPI DUP1 PUSH4 0xDEDF6726 EQ PUSH2 0x701 JUMPI DUP1 PUSH4 0xE2E1E8E9 EQ PUSH2 0x714 JUMPI DUP1 PUSH4 0xE6F50054 EQ PUSH2 0x734 JUMPI DUP1 PUSH4 0xEBF6DDAF EQ PUSH2 0x747 JUMPI DUP1 PUSH4 0xEC9C218D EQ PUSH2 0x74F JUMPI DUP1 PUSH4 0xEFF0F592 EQ PUSH2 0x762 JUMPI DUP1 PUSH4 0xF2FDE38B EQ PUSH2 0x797 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x26A PUSH2 0x24E CALLDATASIZE PUSH1 0x4 PUSH2 0x502B JUMP JUMPDEST PUSH2 0x109 PUSH1 0x20 MSTORE PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND DUP2 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x277 SWAP2 SWAP1 PUSH2 0x5048 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH2 0x293 PUSH2 0x28E CALLDATASIZE PUSH1 0x4 PUSH2 0x502B JUMP JUMPDEST PUSH2 0x7AA JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x277 SWAP2 SWAP1 PUSH1 0x0 PUSH2 0x120 DUP3 ADD SWAP1 POP PUSH1 0x1 DUP1 PUSH1 0xA0 SHL SUB DUP4 MLOAD AND DUP3 MSTORE PUSH1 0x20 DUP4 ADD MLOAD PUSH1 0x20 DUP4 ADD MSTORE PUSH1 0x40 DUP4 ADD MLOAD PUSH1 0x40 DUP4 ADD MSTORE PUSH1 0x60 DUP4 ADD MLOAD PUSH1 0x60 DUP4 ADD MSTORE PUSH1 0x80 DUP4 ADD MLOAD PUSH1 0x80 DUP4 ADD MSTORE PUSH1 0xA0 DUP4 ADD MLOAD PUSH1 0xA0 DUP4 ADD MSTORE PUSH1 0xC0 DUP4 ADD MLOAD PUSH1 0xC0 DUP4 ADD MSTORE PUSH1 0xE0 DUP4 ADD MLOAD PUSH1 0xE0 DUP4 ADD MSTORE PUSH2 0x100 DUP4 ADD MLOAD PUSH2 0x100 DUP4 ADD MSTORE SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH2 0x312 PUSH2 0x108 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x40 MLOAD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH2 0x277 JUMP JUMPDEST PUSH2 0x355 PUSH2 0x32E CALLDATASIZE PUSH1 0x4 PUSH2 0x502B JUMP JUMPDEST PUSH1 0x9C PUSH1 0x20 MSTORE PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP1 KECCAK256 DUP1 SLOAD PUSH1 0x1 DUP3 ADD SLOAD PUSH1 0x2 DUP4 ADD SLOAD PUSH1 0x3 SWAP1 SWAP4 ADD SLOAD SWAP2 SWAP3 SWAP1 SWAP2 DUP5 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP5 DUP6 MSTORE PUSH1 0x20 DUP6 ADD SWAP4 SWAP1 SWAP4 MSTORE SWAP2 DUP4 ADD MSTORE PUSH1 0x60 DUP3 ADD MSTORE PUSH1 0x80 ADD PUSH2 0x277 JUMP JUMPDEST PUSH2 0x388 PUSH2 0x383 CALLDATASIZE PUSH1 0x4 PUSH2 0x506E JUMP JUMPDEST PUSH2 0x837 JUMP JUMPDEST STOP JUMPDEST PUSH1 0x2 SLOAD PUSH1 0x1 PUSH1 0xC0 SHL SWAP1 DIV PUSH4 0xFFFFFFFF AND PUSH1 0x40 MLOAD PUSH4 0xFFFFFFFF SWAP1 SWAP2 AND DUP2 MSTORE PUSH1 0x20 ADD PUSH2 0x277 JUMP JUMPDEST PUSH2 0x388 PUSH2 0x3BD CALLDATASIZE PUSH1 0x4 PUSH2 0x50CC JUMP JUMPDEST PUSH2 0x850 JUMP JUMPDEST PUSH2 0x388 PUSH2 0x3D0 CALLDATASIZE PUSH1 0x4 PUSH2 0x512E JUMP JUMPDEST PUSH2 0xA7D JUMP JUMPDEST PUSH2 0x388 PUSH2 0xA93 JUMP JUMPDEST PUSH2 0x388 PUSH2 0x3EB CALLDATASIZE PUSH1 0x4 PUSH2 0x5167 JUMP JUMPDEST PUSH2 0xACF JUMP JUMPDEST PUSH2 0x3F8 PUSH2 0xAD9 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x277 SWAP3 SWAP2 SWAP1 PUSH2 0x5180 JUMP JUMPDEST PUSH2 0x419 PUSH2 0x414 CALLDATASIZE PUSH1 0x4 PUSH2 0x502B JUMP JUMPDEST PUSH2 0xAEC JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x277 SWAP4 SWAP3 SWAP2 SWAP1 PUSH2 0x51E7 JUMP JUMPDEST PUSH2 0x43B PUSH2 0x436 CALLDATASIZE PUSH1 0x4 PUSH2 0x502B JUMP JUMPDEST PUSH2 0xC20 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP7 ISZERO ISZERO DUP8 MSTORE PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB SWAP1 SWAP6 AND PUSH1 0x20 DUP8 ADD MSTORE SWAP4 DUP6 ADD SWAP3 SWAP1 SWAP3 MSTORE PUSH1 0x60 DUP5 ADD MSTORE PUSH1 0x80 DUP4 ADD MSTORE PUSH1 0xA0 DUP3 ADD MSTORE PUSH1 0xC0 ADD PUSH2 0x277 JUMP JUMPDEST PUSH2 0x47A PUSH2 0xCDC JUMP JUMPDEST PUSH1 0x40 MLOAD SWAP1 ISZERO ISZERO DUP2 MSTORE PUSH1 0x20 ADD PUSH2 0x277 JUMP JUMPDEST PUSH2 0x312 PUSH2 0x498 CALLDATASIZE PUSH1 0x4 PUSH2 0x502B JUMP JUMPDEST PUSH1 0xD1 PUSH1 0x20 MSTORE PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP2 JUMP JUMPDEST PUSH2 0x388 PUSH2 0x4B8 CALLDATASIZE PUSH1 0x4 PUSH2 0x502B JUMP JUMPDEST PUSH2 0xCF1 JUMP JUMPDEST PUSH2 0x514 PUSH2 0x4CB CALLDATASIZE PUSH1 0x4 PUSH2 0x502B JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD DUP1 DUP3 ADD DUP3 MSTORE PUSH1 0x0 DUP1 DUP3 MSTORE PUSH1 0x20 SWAP2 DUP3 ADD DUP2 SWAP1 MSTORE PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB SWAP4 DUP5 AND DUP2 MSTORE PUSH1 0xD0 DUP3 MSTORE DUP3 SWAP1 KECCAK256 DUP3 MLOAD DUP1 DUP5 ADD SWAP1 SWAP4 MSTORE DUP1 SLOAD SWAP1 SWAP4 AND DUP3 MSTORE PUSH1 0x1 SWAP1 SWAP3 ADD SLOAD SWAP2 DUP2 ADD SWAP2 SWAP1 SWAP2 MSTORE SWAP1 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD DUP3 MLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND DUP2 MSTORE PUSH1 0x20 SWAP3 DUP4 ADD MLOAD SWAP3 DUP2 ADD SWAP3 SWAP1 SWAP3 MSTORE ADD PUSH2 0x277 JUMP JUMPDEST PUSH2 0x388 PUSH2 0xCFB JUMP JUMPDEST PUSH2 0x548 PUSH2 0xD0D JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x277 SWAP3 SWAP2 SWAP1 PUSH2 0x521C JUMP JUMPDEST PUSH2 0x388 PUSH2 0x564 CALLDATASIZE PUSH1 0x4 PUSH2 0x5167 JUMP JUMPDEST PUSH2 0xD18 JUMP JUMPDEST PUSH2 0x388 PUSH2 0x577 CALLDATASIZE PUSH1 0x4 PUSH2 0x5236 JUMP JUMPDEST PUSH2 0xD29 JUMP JUMPDEST PUSH2 0x388 PUSH2 0x58A CALLDATASIZE PUSH1 0x4 PUSH2 0x5167 JUMP JUMPDEST PUSH2 0xD41 JUMP JUMPDEST PUSH2 0x388 PUSH2 0x59D CALLDATASIZE PUSH1 0x4 PUSH2 0x50CC JUMP JUMPDEST PUSH2 0xDB6 JUMP JUMPDEST PUSH2 0x5AA PUSH2 0xF44 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x277 SWAP3 SWAP2 SWAP1 PUSH2 0x5277 JUMP JUMPDEST PUSH2 0x388 PUSH2 0x5C6 CALLDATASIZE PUSH1 0x4 PUSH2 0x5236 JUMP JUMPDEST PUSH2 0xF54 JUMP JUMPDEST PUSH2 0x388 PUSH2 0x5D9 CALLDATASIZE PUSH1 0x4 PUSH2 0x5167 JUMP JUMPDEST PUSH2 0x10C4 JUMP JUMPDEST PUSH2 0x388 PUSH2 0x10D8 JUMP JUMPDEST PUSH2 0x5EE PUSH2 0x1112 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x277 SWAP8 SWAP7 SWAP6 SWAP5 SWAP4 SWAP3 SWAP2 SWAP1 PUSH2 0x5285 JUMP JUMPDEST PUSH2 0x312 PUSH1 0xD2 SLOAD DUP2 JUMP JUMPDEST PUSH2 0x26A PUSH2 0x11BB JUMP JUMPDEST PUSH2 0x47A PUSH2 0x620 CALLDATASIZE PUSH1 0x4 PUSH2 0x502B JUMP JUMPDEST PUSH1 0x67 PUSH1 0x20 MSTORE PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND DUP2 JUMP JUMPDEST PUSH2 0x648 PUSH2 0x643 CALLDATASIZE PUSH1 0x4 PUSH2 0x531D JUMP JUMPDEST PUSH2 0x11D6 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x277 SWAP2 SWAP1 PUSH2 0x5392 JUMP JUMPDEST PUSH2 0x312 PUSH2 0x663 CALLDATASIZE PUSH1 0x4 PUSH2 0x53F7 JUMP JUMPDEST PUSH2 0x12BE JUMP JUMPDEST PUSH2 0x47A PUSH2 0x676 CALLDATASIZE PUSH1 0x4 PUSH2 0x502B JUMP JUMPDEST PUSH2 0x1492 JUMP JUMPDEST PUSH2 0x26A PUSH2 0x14B0 JUMP JUMPDEST PUSH2 0x388 PUSH2 0x691 CALLDATASIZE PUSH1 0x4 PUSH2 0x545F JUMP JUMPDEST PUSH2 0x14BA JUMP JUMPDEST PUSH2 0x388 PUSH2 0x6A4 CALLDATASIZE PUSH1 0x4 PUSH2 0x50CC JUMP JUMPDEST PUSH2 0x1638 JUMP JUMPDEST PUSH2 0x312 PUSH2 0x6B7 CALLDATASIZE PUSH1 0x4 PUSH2 0x502B JUMP JUMPDEST PUSH1 0x9A PUSH1 0x20 MSTORE PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP2 JUMP JUMPDEST PUSH2 0x388 PUSH2 0x6D7 CALLDATASIZE PUSH1 0x4 PUSH2 0x50CC JUMP JUMPDEST PUSH2 0x1777 JUMP JUMPDEST PUSH2 0x312 PUSH2 0x6EA CALLDATASIZE PUSH1 0x4 PUSH2 0x54A7 JUMP JUMPDEST PUSH2 0x1860 JUMP JUMPDEST PUSH2 0x312 PUSH2 0x107 SLOAD DUP2 JUMP JUMPDEST PUSH2 0x26A PUSH2 0x1873 JUMP JUMPDEST PUSH2 0x388 PUSH2 0x70F CALLDATASIZE PUSH1 0x4 PUSH2 0x50CC JUMP JUMPDEST PUSH2 0x187D JUMP JUMPDEST PUSH2 0x312 PUSH2 0x722 CALLDATASIZE PUSH1 0x4 PUSH2 0x5167 JUMP JUMPDEST PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0xD3 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD SWAP1 JUMP JUMPDEST PUSH2 0x388 PUSH2 0x742 CALLDATASIZE PUSH1 0x4 PUSH2 0x5167 JUMP JUMPDEST PUSH2 0x1A0B JUMP JUMPDEST PUSH2 0x26A PUSH2 0x1A1C JUMP JUMPDEST PUSH2 0x388 PUSH2 0x75D CALLDATASIZE PUSH1 0x4 PUSH2 0x502B JUMP JUMPDEST PUSH2 0x1A26 JUMP JUMPDEST PUSH2 0x355 PUSH2 0x770 CALLDATASIZE PUSH1 0x4 PUSH2 0x5167 JUMP JUMPDEST PUSH1 0x9B PUSH1 0x20 MSTORE PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP1 KECCAK256 DUP1 SLOAD PUSH1 0x1 DUP3 ADD SLOAD PUSH1 0x2 DUP4 ADD SLOAD PUSH1 0x3 SWAP1 SWAP4 ADD SLOAD SWAP2 SWAP3 SWAP1 SWAP2 DUP5 JUMP JUMPDEST PUSH2 0x388 PUSH2 0x7A5 CALLDATASIZE PUSH1 0x4 PUSH2 0x502B JUMP JUMPDEST PUSH2 0x1AA8 JUMP JUMPDEST PUSH2 0x7B2 PUSH2 0x4FAE JUMP JUMPDEST POP PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB SWAP1 DUP2 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0xCF PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP2 DUP3 SWAP1 KECCAK256 DUP3 MLOAD PUSH2 0x120 DUP2 ADD DUP5 MSTORE DUP2 SLOAD SWAP1 SWAP5 AND DUP5 MSTORE PUSH1 0x1 DUP2 ADD SLOAD SWAP2 DUP5 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH1 0x2 DUP2 ADD SLOAD SWAP2 DUP4 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH1 0x3 DUP2 ADD SLOAD PUSH1 0x60 DUP4 ADD MSTORE PUSH1 0x4 DUP2 ADD SLOAD PUSH1 0x80 DUP4 ADD MSTORE PUSH1 0x5 DUP2 ADD SLOAD PUSH1 0xA0 DUP4 ADD MSTORE PUSH1 0x6 DUP2 ADD SLOAD PUSH1 0xC0 DUP4 ADD MSTORE PUSH1 0x7 DUP2 ADD SLOAD PUSH1 0xE0 DUP4 ADD MSTORE PUSH1 0x8 ADD SLOAD PUSH2 0x100 DUP3 ADD MSTORE SWAP1 JUMP JUMPDEST PUSH2 0x83F PUSH2 0x1AE3 JUMP JUMPDEST PUSH2 0x848 DUP2 PUSH2 0x1B15 JUMP JUMPDEST POP JUMP JUMPDEST SWAP1 POP SWAP1 JUMP JUMPDEST DUP3 PUSH2 0x859 PUSH2 0x1B69 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0x7C145CC7 DUP3 ADDRESS CALLER PUSH1 0x40 MLOAD DUP5 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x888 SWAP4 SWAP3 SWAP2 SWAP1 PUSH2 0x54D5 JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP7 GAS STATICCALL ISZERO DUP1 ISZERO PUSH2 0x8A5 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x8C9 SWAP2 SWAP1 PUSH2 0x54F8 JUMP JUMPDEST DUP2 CALLER SWAP1 SWAP2 PUSH2 0x8F5 JUMPI PUSH1 0x40 MLOAD PUSH4 0xCC5D3C8B PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP3 SWAP2 SWAP1 PUSH2 0x5515 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST POP POP DUP4 PUSH1 0x0 PUSH2 0x903 DUP3 PUSH2 0x1B8D JUMP JUMPDEST SWAP1 POP PUSH2 0x90E DUP2 PUSH2 0x1C90 JUMP JUMPDEST PUSH2 0x919 DUP2 PUSH1 0x0 PUSH2 0x1CCE JUMP JUMPDEST PUSH2 0x921 PUSH2 0x1DB8 JUMP JUMPDEST PUSH1 0x0 DUP1 DUP1 PUSH2 0x931 DUP8 DUP10 ADD DUP10 PUSH2 0x5646 JUMP JUMPDEST SWAP3 POP SWAP3 POP SWAP3 POP PUSH1 0x0 DUP4 MLOAD GT PUSH2 0x959 JUMPI PUSH1 0x40 MLOAD PUSH4 0x7838439 PUSH1 0xE5 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x0 DUP3 MLOAD GT PUSH2 0x97B JUMPI PUSH1 0x40 MLOAD PUSH4 0x1E63BD95 PUSH1 0xE2 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP10 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH2 0x106 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD ISZERO PUSH2 0x9B3 JUMPI PUSH1 0x40 MLOAD PUSH4 0xD06866D PUSH1 0xE2 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0x60 DUP2 ADD DUP3 MSTORE TIMESTAMP DUP2 MSTORE PUSH1 0x20 DUP1 DUP3 ADD DUP7 DUP2 MSTORE DUP3 DUP5 ADD DUP7 SWAP1 MSTORE PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP14 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH2 0x106 SWAP1 SWAP3 MSTORE SWAP3 SWAP1 KECCAK256 DUP2 MLOAD DUP2 SSTORE SWAP2 MLOAD SWAP1 SWAP2 SWAP1 PUSH1 0x1 DUP3 ADD SWAP1 PUSH2 0x9FE SWAP1 DUP3 PUSH2 0x5742 JUMP JUMPDEST POP PUSH1 0x40 DUP3 ADD MLOAD PUSH1 0x2 DUP3 ADD SWAP1 PUSH2 0xA13 SWAP1 DUP3 PUSH2 0x5742 JUMP JUMPDEST POP POP POP PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP2 AND ISZERO PUSH2 0xA2F JUMPI PUSH2 0xA2F DUP10 DUP3 PUSH2 0x1DDE JUMP JUMPDEST DUP9 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH32 0x159567BEA25499A91F60E1FBB349FF2A1F8C1B2883198F25C1E12C99EDDB44FA DUP10 DUP10 PUSH1 0x40 MLOAD PUSH2 0xA6A SWAP3 SWAP2 SWAP1 PUSH2 0x5800 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 POP POP POP POP POP POP POP POP POP JUMP JUMPDEST PUSH2 0xA85 PUSH2 0x1AE3 JUMP JUMPDEST PUSH2 0xA8F DUP3 DUP3 PUSH2 0x1E35 JUMP JUMPDEST POP POP JUMP JUMPDEST CALLER PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x67 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND PUSH2 0xAC4 JUMPI PUSH1 0x40 MLOAD PUSH4 0x72E3EF97 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP2 SWAP1 PUSH2 0x5048 JUMP JUMPDEST POP PUSH2 0xACD PUSH2 0x1EEB JUMP JUMPDEST JUMP JUMPDEST PUSH2 0x848 CALLER DUP3 PUSH2 0x1F37 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0xAE4 PUSH2 0x1FDD JUMP JUMPDEST SWAP2 POP SWAP2 POP SWAP1 SWAP2 JUMP JUMPDEST PUSH2 0x106 PUSH1 0x20 MSTORE PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP1 KECCAK256 DUP1 SLOAD PUSH1 0x1 DUP3 ADD DUP1 SLOAD SWAP2 SWAP3 SWAP2 PUSH2 0xB0F SWAP1 PUSH2 0x56C1 JUMP JUMPDEST DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD PUSH2 0xB3B SWAP1 PUSH2 0x56C1 JUMP JUMPDEST DUP1 ISZERO PUSH2 0xB88 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0xB5D JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0xB88 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0xB6B JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP SWAP1 DUP1 PUSH1 0x2 ADD DUP1 SLOAD PUSH2 0xB9D SWAP1 PUSH2 0x56C1 JUMP JUMPDEST DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD PUSH2 0xBC9 SWAP1 PUSH2 0x56C1 JUMP JUMPDEST DUP1 ISZERO PUSH2 0xC16 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0xBEB JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0xC16 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0xBF9 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP SWAP1 POP DUP4 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP1 DUP3 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0xCF PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 DUP2 MLOAD PUSH2 0x120 DUP2 ADD DUP4 MSTORE DUP2 SLOAD SWAP1 SWAP6 AND DUP6 MSTORE PUSH1 0x1 DUP2 ADD SLOAD SWAP3 DUP6 ADD SWAP3 SWAP1 SWAP3 MSTORE PUSH1 0x2 DUP3 ADD SLOAD SWAP1 DUP5 ADD MSTORE PUSH1 0x3 DUP2 ADD SLOAD PUSH1 0x60 DUP5 ADD MSTORE PUSH1 0x4 DUP2 ADD SLOAD PUSH1 0x80 DUP5 ADD MSTORE PUSH1 0x5 DUP2 ADD SLOAD PUSH1 0xA0 DUP5 ADD MSTORE PUSH1 0x6 DUP2 ADD SLOAD PUSH1 0xC0 DUP5 ADD MSTORE PUSH1 0x7 DUP2 ADD SLOAD PUSH1 0xE0 DUP5 ADD MSTORE PUSH1 0x8 ADD SLOAD PUSH2 0x100 DUP4 ADD MSTORE SWAP1 DUP2 SWAP1 DUP2 SWAP1 DUP2 SWAP1 DUP2 SWAP1 DUP2 SWAP1 PUSH2 0xCB1 DUP2 PUSH2 0x2054 JUMP JUMPDEST DUP2 MLOAD PUSH1 0x20 DUP4 ADD MLOAD PUSH1 0x40 DUP5 ADD MLOAD PUSH1 0xC0 DUP6 ADD MLOAD PUSH1 0xE0 SWAP1 SWAP6 ADD MLOAD SWAP4 SWAP13 SWAP3 SWAP12 POP SWAP1 SWAP10 POP SWAP8 POP SWAP2 SWAP6 POP SWAP4 POP SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0xCE7 PUSH2 0x2073 JUMP JUMPDEST SLOAD PUSH1 0xFF AND SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH2 0x848 CALLER DUP3 PUSH2 0x1DDE JUMP JUMPDEST PUSH2 0xD03 PUSH2 0x1AE3 JUMP JUMPDEST PUSH2 0xACD PUSH1 0x0 PUSH2 0x2097 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0xAE4 PUSH2 0x20F3 JUMP JUMPDEST PUSH2 0xD20 PUSH2 0x1AE3 JUMP JUMPDEST PUSH2 0x848 DUP2 PUSH2 0x216A JUMP JUMPDEST PUSH2 0xD31 PUSH2 0x1AE3 JUMP JUMPDEST PUSH2 0xD3C DUP4 DUP4 DUP4 PUSH2 0x219F JUMP JUMPDEST POP POP POP JUMP JUMPDEST PUSH2 0xD49 PUSH2 0x1AE3 JUMP JUMPDEST PUSH2 0xD56 DUP2 PUSH3 0xF4240 LT ISZERO SWAP1 JUMP JUMPDEST DUP2 SWAP1 PUSH2 0xD78 JUMPI PUSH1 0x40 MLOAD PUSH4 0x1C9C717B PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP2 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 JUMP JUMPDEST POP PUSH2 0x108 DUP2 SWAP1 SSTORE PUSH1 0x40 MLOAD DUP2 DUP2 MSTORE PUSH32 0x6DEEF78FFE3DF79AE5CD8E40B842C36AC6077E13746B9B68A9F327537B01E4E9 SWAP1 PUSH1 0x20 ADD JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG1 POP JUMP JUMPDEST DUP3 PUSH2 0xDBF PUSH2 0x1B69 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0x7C145CC7 DUP3 ADDRESS CALLER PUSH1 0x40 MLOAD DUP5 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xDEE SWAP4 SWAP3 SWAP2 SWAP1 PUSH2 0x54D5 JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP7 GAS STATICCALL ISZERO DUP1 ISZERO PUSH2 0xE0B JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0xE2F SWAP2 SWAP1 PUSH2 0x54F8 JUMP JUMPDEST DUP2 CALLER SWAP1 SWAP2 PUSH2 0xE52 JUMPI PUSH1 0x40 MLOAD PUSH4 0xCC5D3C8B PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP3 SWAP2 SWAP1 PUSH2 0x5515 JUMP JUMPDEST POP POP PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP5 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH2 0x106 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP5 SWAP1 DUP2 SWAP1 PUSH2 0xE90 JUMPI PUSH1 0x40 MLOAD PUSH4 0xEE271899 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP2 SWAP1 PUSH2 0x5048 JUMP JUMPDEST POP PUSH2 0xE99 PUSH2 0x1DB8 JUMP JUMPDEST PUSH1 0x0 PUSH2 0xEA7 DUP5 DUP7 ADD DUP7 PUSH2 0x502B JUMP JUMPDEST SWAP1 POP PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP7 AND PUSH2 0xEBE PUSH1 0xCF DUP4 PUSH2 0x21F2 JUMP JUMPDEST MLOAD DUP8 SWAP2 DUP4 SWAP2 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND EQ PUSH2 0xEEC JUMPI PUSH1 0x40 MLOAD PUSH4 0xC0BBFF13 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP3 SWAP2 SWAP1 PUSH2 0x5515 JUMP JUMPDEST POP POP PUSH2 0xEF9 DUP2 PUSH1 0x0 PUSH2 0x2277 JUMP JUMPDEST DUP6 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH32 0x73330C218A680717E9EEE625C262DF66EDDFDF99ECB388D25F6B32D66B9A318A DUP7 DUP7 PUSH1 0x40 MLOAD PUSH2 0xF34 SWAP3 SWAP2 SWAP1 PUSH2 0x5800 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0xAE4 PUSH1 0x0 SLOAD PUSH1 0x1 SLOAD SWAP1 SWAP2 JUMP JUMPDEST DUP3 PUSH2 0xF5D PUSH2 0x1B69 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0x7C145CC7 DUP3 ADDRESS CALLER PUSH1 0x40 MLOAD DUP5 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xF8C SWAP4 SWAP3 SWAP2 SWAP1 PUSH2 0x54D5 JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP7 GAS STATICCALL ISZERO DUP1 ISZERO PUSH2 0xFA9 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0xFCD SWAP2 SWAP1 PUSH2 0x54F8 JUMP JUMPDEST DUP2 CALLER SWAP1 SWAP2 PUSH2 0xFF0 JUMPI PUSH1 0x40 MLOAD PUSH4 0xCC5D3C8B PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP3 SWAP2 SWAP1 PUSH2 0x5515 JUMP JUMPDEST POP POP DUP4 PUSH1 0x0 PUSH2 0xFFE DUP3 PUSH2 0x1B8D JUMP JUMPDEST SWAP1 POP PUSH2 0x1009 DUP2 PUSH2 0x1C90 JUMP JUMPDEST PUSH2 0x1014 DUP2 PUSH1 0x0 PUSH2 0x1CCE JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP7 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH2 0x106 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP7 SWAP1 DUP2 SWAP1 PUSH2 0x1050 JUMPI PUSH1 0x40 MLOAD PUSH4 0xEE271899 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP2 SWAP1 PUSH2 0x5048 JUMP JUMPDEST POP PUSH2 0x1059 PUSH2 0x1DB8 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP8 AND PUSH2 0x106E PUSH1 0xCF DUP9 PUSH2 0x21F2 JUMP JUMPDEST MLOAD DUP9 SWAP2 DUP9 SWAP2 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND EQ PUSH2 0x109C JUMPI PUSH1 0x40 MLOAD PUSH4 0xC0BBFF13 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP3 SWAP2 SWAP1 PUSH2 0x5515 JUMP JUMPDEST POP POP PUSH2 0x10BB DUP7 DUP7 PUSH1 0x2 PUSH1 0x18 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH4 0xFFFFFFFF AND PUSH2 0x23D9 JUMP JUMPDEST POP POP POP POP POP POP POP JUMP JUMPDEST PUSH2 0x10CC PUSH2 0x1AE3 JUMP JUMPDEST PUSH2 0x848 DUP2 PUSH1 0x0 NOT PUSH2 0x26D7 JUMP JUMPDEST CALLER PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x67 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH1 0xFF AND PUSH2 0x1109 JUMPI PUSH1 0x40 MLOAD PUSH4 0x72E3EF97 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP2 SWAP1 PUSH2 0x5048 JUMP JUMPDEST POP PUSH2 0xACD PUSH2 0x2746 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x60 DUP1 PUSH1 0x0 DUP1 PUSH1 0x0 PUSH1 0x60 PUSH1 0x0 PUSH2 0x1128 PUSH2 0x278D JUMP JUMPDEST DUP1 SLOAD SWAP1 SWAP2 POP ISZERO DUP1 ISZERO PUSH2 0x113C JUMPI POP PUSH1 0x1 DUP2 ADD SLOAD ISZERO JUMPDEST PUSH2 0x1180 JUMPI PUSH1 0x40 MLOAD PUSH3 0x461BCD PUSH1 0xE5 SHL DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x15 PUSH1 0x24 DUP3 ADD MSTORE PUSH21 0x1152540DCC4C8E88155B9A5B9A5D1A585B1A5E9959 PUSH1 0x5A SHL PUSH1 0x44 DUP3 ADD MSTORE PUSH1 0x64 ADD PUSH2 0x8EC JUMP JUMPDEST PUSH2 0x1188 PUSH2 0x27B1 JUMP JUMPDEST PUSH2 0x1190 PUSH2 0x2852 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0x0 DUP1 DUP3 MSTORE PUSH1 0x20 DUP3 ADD SWAP1 SWAP3 MSTORE PUSH1 0xF PUSH1 0xF8 SHL SWAP13 SWAP4 SWAP12 POP SWAP2 SWAP10 POP CHAINID SWAP9 POP ADDRESS SWAP8 POP SWAP6 POP SWAP4 POP SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0x11C6 PUSH2 0x286F JUMP JUMPDEST SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 DUP2 ADD SWAP1 SWAP2 MSTORE PUSH1 0x60 SWAP1 DUP3 PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP2 GT ISZERO PUSH2 0x1200 JUMPI PUSH2 0x1200 PUSH2 0x552F JUMP JUMPDEST PUSH1 0x40 MLOAD SWAP1 DUP1 DUP3 MSTORE DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD DUP3 ADD PUSH1 0x40 MSTORE DUP1 ISZERO PUSH2 0x1233 JUMPI DUP2 PUSH1 0x20 ADD JUMPDEST PUSH1 0x60 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 PUSH1 0x1 SWAP1 SUB SWAP1 DUP2 PUSH2 0x121E JUMPI SWAP1 POP JUMPDEST POP SWAP2 POP PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x12B5 JUMPI PUSH2 0x1290 ADDRESS DUP7 DUP7 DUP5 DUP2 DUP2 LT PUSH2 0x1257 JUMPI PUSH2 0x1257 PUSH2 0x5858 JUMP JUMPDEST SWAP1 POP PUSH1 0x20 MUL DUP2 ADD SWAP1 PUSH2 0x1269 SWAP2 SWAP1 PUSH2 0x586E JUMP JUMPDEST DUP6 PUSH1 0x40 MLOAD PUSH1 0x20 ADD PUSH2 0x127C SWAP4 SWAP3 SWAP2 SWAP1 PUSH2 0x58B4 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 DUP4 SUB SUB DUP2 MSTORE SWAP1 PUSH1 0x40 MSTORE PUSH2 0x2893 JUMP JUMPDEST DUP4 DUP3 DUP2 MLOAD DUP2 LT PUSH2 0x12A2 JUMPI PUSH2 0x12A2 PUSH2 0x5858 JUMP JUMPDEST PUSH1 0x20 SWAP1 DUP2 MUL SWAP2 SWAP1 SWAP2 ADD ADD MSTORE PUSH1 0x1 ADD PUSH2 0x1239 JUMP JUMPDEST POP POP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP5 PUSH2 0x12C9 PUSH2 0x1B69 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0x7C145CC7 DUP3 ADDRESS CALLER PUSH1 0x40 MLOAD DUP5 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x12F8 SWAP4 SWAP3 SWAP2 SWAP1 PUSH2 0x54D5 JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP7 GAS STATICCALL ISZERO DUP1 ISZERO PUSH2 0x1315 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x1339 SWAP2 SWAP1 PUSH2 0x54F8 JUMP JUMPDEST DUP2 CALLER SWAP1 SWAP2 PUSH2 0x135C JUMPI PUSH1 0x40 MLOAD PUSH4 0xCC5D3C8B PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP3 SWAP2 SWAP1 PUSH2 0x5515 JUMP JUMPDEST POP POP DUP6 PUSH1 0x0 PUSH2 0x136A DUP3 PUSH2 0x1B8D JUMP JUMPDEST SWAP1 POP PUSH2 0x1375 DUP2 PUSH2 0x1C90 JUMP JUMPDEST PUSH2 0x1380 DUP2 PUSH1 0x0 PUSH2 0x1CCE JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP9 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH2 0x106 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP9 SWAP1 DUP2 SWAP1 PUSH2 0x13BC JUMPI PUSH1 0x40 MLOAD PUSH4 0xEE271899 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP2 SWAP1 PUSH2 0x5048 JUMP JUMPDEST POP PUSH2 0x13C5 PUSH2 0x1DB8 JUMP JUMPDEST PUSH1 0x0 DUP1 DUP10 PUSH1 0x2 DUP2 GT ISZERO PUSH2 0x13DA JUMPI PUSH2 0x13DA PUSH2 0x58DB JUMP JUMPDEST SUB PUSH2 0x13F1 JUMPI PUSH2 0x13EA DUP11 DUP10 DUP10 PUSH2 0x2909 JUMP JUMPDEST SWAP1 POP PUSH2 0x1430 JUMP JUMPDEST PUSH1 0x2 DUP10 PUSH1 0x2 DUP2 GT ISZERO PUSH2 0x1405 JUMPI PUSH2 0x1405 PUSH2 0x58DB JUMP JUMPDEST SUB PUSH2 0x1415 JUMPI PUSH2 0x13EA DUP11 DUP10 DUP10 PUSH2 0x2E1D JUMP JUMPDEST DUP9 PUSH1 0x40 MLOAD PUSH4 0x47031CF PUSH1 0xE4 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP2 SWAP1 PUSH2 0x5913 JUMP JUMPDEST DUP9 PUSH1 0x2 DUP2 GT ISZERO PUSH2 0x1442 JUMPI PUSH2 0x1442 PUSH2 0x58DB JUMP JUMPDEST DUP11 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH32 0x54FE682BFB66381A9382E13E4B95A3DD4F960EAFBAE063FDEA3539D144FF3FF5 DUP4 PUSH1 0x40 MLOAD PUSH2 0x147D SWAP2 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 SWAP10 SWAP9 POP POP POP POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x12B8 DUP3 PUSH1 0x2 PUSH1 0x18 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH4 0xFFFFFFFF AND PUSH2 0x2EC1 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x84B PUSH2 0x2EE0 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x14C4 PUSH2 0x2F04 JUMP JUMPDEST DUP1 SLOAD SWAP1 SWAP2 POP PUSH1 0xFF PUSH1 0x1 PUSH1 0x40 SHL DUP3 DIV AND ISZERO SWAP1 PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB AND PUSH1 0x0 DUP2 ISZERO DUP1 ISZERO PUSH2 0x14EB JUMPI POP DUP3 JUMPDEST SWAP1 POP PUSH1 0x0 DUP3 PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB AND PUSH1 0x1 EQ DUP1 ISZERO PUSH2 0x1507 JUMPI POP ADDRESS EXTCODESIZE ISZERO JUMPDEST SWAP1 POP DUP2 ISZERO DUP1 ISZERO PUSH2 0x1515 JUMPI POP DUP1 ISZERO JUMPDEST ISZERO PUSH2 0x1533 JUMPI PUSH1 0x40 MLOAD PUSH4 0xF92EE8A9 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST DUP5 SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB NOT AND PUSH1 0x1 OR DUP6 SSTORE DUP4 ISZERO PUSH2 0x155C JUMPI DUP5 SLOAD PUSH1 0xFF PUSH1 0x40 SHL NOT AND PUSH1 0x1 PUSH1 0x40 SHL OR DUP6 SSTORE JUMPDEST PUSH2 0x1565 DUP10 PUSH2 0x2F2D JUMP JUMPDEST PUSH2 0x156D PUSH2 0x2F3E JUMP JUMPDEST PUSH2 0x1575 PUSH2 0x2F46 JUMP JUMPDEST PUSH2 0x157D PUSH2 0x2F5E JUMP JUMPDEST PUSH2 0x15C9 PUSH1 0x40 MLOAD DUP1 PUSH1 0x40 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0xF DUP2 MSTORE PUSH1 0x20 ADD PUSH15 0x537562677261706853657276696365 PUSH1 0x88 SHL DUP2 MSTORE POP PUSH1 0x40 MLOAD DUP1 PUSH1 0x40 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x3 DUP2 MSTORE PUSH1 0x20 ADD PUSH3 0x312E3 PUSH1 0xEC SHL DUP2 MSTORE POP PUSH2 0x2F6E JUMP JUMPDEST PUSH2 0x15D5 DUP9 PUSH1 0x0 NOT PUSH2 0x26D7 JUMP JUMPDEST PUSH2 0x15DE DUP8 PUSH2 0x1B15 JUMP JUMPDEST PUSH2 0x15E7 DUP7 PUSH2 0x2F88 JUMP JUMPDEST DUP4 ISZERO PUSH2 0x162D JUMPI DUP5 SLOAD PUSH1 0xFF PUSH1 0x40 SHL NOT AND DUP6 SSTORE PUSH1 0x40 MLOAD PUSH1 0x1 DUP2 MSTORE PUSH32 0xC7F505B2F371AE2175EE4913F4499E1F2633A7B5936321EED1CDAEB6115181D2 SWAP1 PUSH1 0x20 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG1 JUMPDEST POP POP POP POP POP POP POP POP POP JUMP JUMPDEST CALLER PUSH32 0x0 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP2 AND DUP3 EQ PUSH2 0x1685 JUMPI PUSH1 0x40 MLOAD PUSH4 0xCDC0567F PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP3 SWAP2 SWAP1 PUSH2 0x5515 JUMP JUMPDEST POP PUSH1 0x0 SWAP1 POP DUP1 PUSH2 0x1697 DUP4 DUP6 ADD DUP6 PUSH2 0x5921 JUMP JUMPDEST SWAP2 POP SWAP2 POP PUSH2 0x16A3 PUSH2 0x1B69 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0xE76FEDE6 DUP7 DUP5 DUP5 PUSH2 0x16BC PUSH2 0x2FDF JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH1 0xE0 DUP7 SWAP1 SHL PUSH1 0x1 PUSH1 0x1 PUSH1 0xE0 SHL SUB NOT AND DUP2 MSTORE PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB SWAP5 DUP6 AND PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x24 DUP2 ADD SWAP4 SWAP1 SWAP4 MSTORE PUSH1 0x44 DUP4 ADD SWAP2 SWAP1 SWAP2 MSTORE SWAP1 SWAP2 AND PUSH1 0x64 DUP3 ADD MSTORE PUSH1 0x84 ADD PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x1715 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x1729 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP DUP5 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH32 0x2F2E74A11116E05B39159372CCEB6739257B08D72F7171D208FF27BB6466C58 DUP4 PUSH1 0x40 MLOAD PUSH2 0x1768 SWAP2 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 POP POP POP POP POP JUMP JUMPDEST DUP3 PUSH2 0x1780 PUSH2 0x1B69 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0x7C145CC7 DUP3 ADDRESS CALLER PUSH1 0x40 MLOAD DUP5 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x17AF SWAP4 SWAP3 SWAP2 SWAP1 PUSH2 0x54D5 JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP7 GAS STATICCALL ISZERO DUP1 ISZERO PUSH2 0x17CC JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x17F0 SWAP2 SWAP1 PUSH2 0x54F8 JUMP JUMPDEST DUP2 CALLER SWAP1 SWAP2 PUSH2 0x1813 JUMPI PUSH1 0x40 MLOAD PUSH4 0xCC5D3C8B PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP3 SWAP2 SWAP1 PUSH2 0x5515 JUMP JUMPDEST POP POP PUSH2 0x181D PUSH2 0x1DB8 JUMP JUMPDEST PUSH2 0x1826 DUP5 PUSH2 0x3003 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP6 AND SWAP1 PUSH32 0xF53CF6521A1B5FC0C04BFFA70374A4DC2E3474F2B2AC1643C3BCC54E2DB4A939 SWAP1 PUSH1 0x0 SWAP1 LOG2 POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x186C DUP4 DUP4 PUSH2 0x3076 JUMP JUMPDEST SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x84B PUSH2 0x2FDF JUMP JUMPDEST DUP3 PUSH2 0x1886 PUSH2 0x1B69 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0x7C145CC7 DUP3 ADDRESS CALLER PUSH1 0x40 MLOAD DUP5 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x18B5 SWAP4 SWAP3 SWAP2 SWAP1 PUSH2 0x54D5 JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP7 GAS STATICCALL ISZERO DUP1 ISZERO PUSH2 0x18D2 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x18F6 SWAP2 SWAP1 PUSH2 0x54F8 JUMP JUMPDEST DUP2 CALLER SWAP1 SWAP2 PUSH2 0x1919 JUMPI PUSH1 0x40 MLOAD PUSH4 0xCC5D3C8B PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP3 SWAP2 SWAP1 PUSH2 0x5515 JUMP JUMPDEST POP POP DUP4 PUSH1 0x0 PUSH2 0x1927 DUP3 PUSH2 0x1B8D JUMP JUMPDEST SWAP1 POP PUSH2 0x1932 DUP2 PUSH2 0x1C90 JUMP JUMPDEST PUSH2 0x193D DUP2 PUSH1 0x0 PUSH2 0x1CCE JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP7 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH2 0x106 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP7 SWAP1 DUP2 SWAP1 PUSH2 0x1979 JUMPI PUSH1 0x40 MLOAD PUSH4 0xEE271899 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP2 SWAP1 PUSH2 0x5048 JUMP JUMPDEST POP PUSH2 0x1982 PUSH2 0x1DB8 JUMP JUMPDEST PUSH1 0x0 DUP1 DUP1 DUP1 PUSH2 0x1993 DUP10 DUP12 ADD DUP12 PUSH2 0x5943 JUMP JUMPDEST SWAP4 POP SWAP4 POP SWAP4 POP SWAP4 POP PUSH2 0x19BB DUP12 DUP4 DUP7 DUP7 DUP6 PUSH1 0x2 PUSH1 0x18 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH4 0xFFFFFFFF AND PUSH2 0x30E5 JUMP JUMPDEST DUP11 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH32 0xD3803EB82EF5B4CDFF8646734EBBAF5B37441E96314B27FFD3D0940F12A038E7 DUP12 DUP12 PUSH1 0x40 MLOAD PUSH2 0x19F6 SWAP3 SWAP2 SWAP1 PUSH2 0x5800 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 POP POP POP POP POP POP POP POP POP POP POP JUMP JUMPDEST PUSH2 0x1A13 PUSH2 0x1AE3 JUMP JUMPDEST PUSH2 0x848 DUP2 PUSH2 0x2F88 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x84B PUSH2 0x32DC JUMP JUMPDEST PUSH2 0x1A2E PUSH2 0x1DB8 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x1A3B PUSH1 0xCF DUP4 PUSH2 0x21F2 JUMP JUMPDEST SWAP1 POP PUSH2 0x1A52 PUSH1 0xD2 SLOAD DUP3 PUSH2 0x3300 SWAP1 SWAP2 SWAP1 PUSH4 0xFFFFFFFF AND JUMP JUMPDEST DUP3 SWAP1 PUSH2 0x1A71 JUMPI PUSH1 0x40 MLOAD PUSH3 0x3477B5 PUSH1 0xE5 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP2 SWAP1 PUSH2 0x5048 JUMP JUMPDEST POP PUSH2 0x1A7B DUP2 PUSH2 0x333D JUMP JUMPDEST ISZERO DUP3 SWAP1 PUSH2 0x1A9C JUMPI PUSH1 0x40 MLOAD PUSH4 0x17C7B35D PUSH1 0xE3 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP2 SWAP1 PUSH2 0x5048 JUMP JUMPDEST POP PUSH2 0xA8F DUP3 PUSH1 0x1 PUSH2 0x2277 JUMP JUMPDEST PUSH2 0x1AB0 PUSH2 0x1AE3 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP2 AND PUSH2 0x1ADA JUMPI PUSH1 0x0 PUSH1 0x40 MLOAD PUSH4 0x1E4FBDF7 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP2 SWAP1 PUSH2 0x5048 JUMP JUMPDEST PUSH2 0x848 DUP2 PUSH2 0x2097 JUMP JUMPDEST CALLER PUSH2 0x1AEC PUSH2 0x11BB JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND EQ PUSH2 0xACD JUMPI CALLER PUSH1 0x40 MLOAD PUSH4 0x118CDAA7 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP2 SWAP1 PUSH2 0x5048 JUMP JUMPDEST PUSH1 0x2 DUP1 SLOAD PUSH4 0xFFFFFFFF PUSH1 0xC0 SHL NOT AND PUSH1 0x1 PUSH1 0xC0 SHL PUSH4 0xFFFFFFFF DUP5 AND SWAP1 DUP2 MUL SWAP2 SWAP1 SWAP2 OR SWAP1 SWAP2 SSTORE PUSH1 0x40 MLOAD SWAP1 DUP2 MSTORE PUSH32 0x472ABA493F9FD1D136EC54986F619F3AA5CAFF964F0E731A9909FB9A1270211F SWAP1 PUSH1 0x20 ADD PUSH2 0xDAB JUMP JUMPDEST PUSH32 0x0 SWAP1 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH2 0x140 DUP2 ADD DUP3 MSTORE PUSH1 0x0 DUP1 DUP3 MSTORE PUSH1 0x20 DUP3 ADD DUP2 SWAP1 MSTORE SWAP2 DUP2 ADD DUP3 SWAP1 MSTORE PUSH1 0x60 DUP2 ADD DUP3 SWAP1 MSTORE PUSH1 0x80 DUP2 ADD DUP3 SWAP1 MSTORE PUSH1 0xA0 DUP2 ADD DUP3 SWAP1 MSTORE PUSH1 0xC0 DUP2 ADD DUP3 SWAP1 MSTORE PUSH1 0xE0 DUP2 ADD DUP3 SWAP1 MSTORE PUSH2 0x100 DUP2 ADD DUP3 SWAP1 MSTORE PUSH2 0x120 DUP2 ADD DUP3 SWAP1 MSTORE SWAP1 PUSH2 0x1BE6 PUSH2 0x1B69 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0x25D9897E DUP5 ADDRESS PUSH1 0x40 MLOAD DUP4 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x1C13 SWAP3 SWAP2 SWAP1 PUSH2 0x5515 JUMP JUMPDEST PUSH2 0x140 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP7 GAS STATICCALL ISZERO DUP1 ISZERO PUSH2 0x1C31 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x1C55 SWAP2 SWAP1 PUSH2 0x59D0 JUMP JUMPDEST SWAP1 POP DUP1 PUSH1 0xA0 ADD MLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB AND PUSH1 0x0 EQ ISZERO DUP4 SWAP1 PUSH2 0x1C89 JUMPI PUSH1 0x40 MLOAD PUSH4 0x7B3C09BF PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP2 SWAP1 PUSH2 0x5048 JUMP JUMPDEST POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x20 DUP2 ADD MLOAD DUP2 MLOAD PUSH2 0x848 SWAP2 PUSH2 0x1CA4 SWAP2 PUSH2 0x5845 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0x1 SLOAD PUSH1 0x40 MLOAD DUP1 PUSH1 0x40 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x6 DUP2 MSTORE PUSH1 0x20 ADD PUSH6 0x746F6B656E73 PUSH1 0xD0 SHL DUP2 MSTORE POP PUSH2 0x335C JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0x1CD9 PUSH2 0x20F3 JUMP JUMPDEST SWAP2 POP SWAP2 POP PUSH1 0x0 DUP4 PUSH2 0x1CEE JUMPI DUP5 PUSH1 0x80 ADD MLOAD PUSH2 0x1CF4 JUMP JUMPDEST DUP5 PUSH1 0xE0 ADD MLOAD JUMPDEST SWAP1 POP PUSH2 0x1D42 DUP2 PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB AND DUP5 PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB AND DUP5 PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB AND PUSH1 0x40 MLOAD DUP1 PUSH1 0x40 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0xD DUP2 MSTORE PUSH1 0x20 ADD PUSH13 0x1D1A185DDA5B99D4195C9A5BD9 PUSH1 0x9A SHL DUP2 MSTORE POP PUSH2 0x335C JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0x1D4D PUSH2 0x1FDD JUMP JUMPDEST SWAP2 POP SWAP2 POP PUSH1 0x0 DUP7 PUSH2 0x1D62 JUMPI DUP8 PUSH1 0x60 ADD MLOAD PUSH2 0x1D68 JUMP JUMPDEST DUP8 PUSH1 0xC0 ADD MLOAD JUMPDEST SWAP1 POP PUSH2 0x1DAE DUP2 PUSH4 0xFFFFFFFF AND DUP5 PUSH4 0xFFFFFFFF AND DUP5 PUSH4 0xFFFFFFFF AND PUSH1 0x40 MLOAD DUP1 PUSH1 0x40 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0xE DUP2 MSTORE PUSH1 0x20 ADD PUSH14 0x1B585E15995C9A599A595C90DD5D PUSH1 0x92 SHL DUP2 MSTORE POP PUSH2 0x335C JUMP JUMPDEST POP POP POP POP POP POP POP POP JUMP JUMPDEST PUSH2 0x1DC0 PUSH2 0xCDC JUMP JUMPDEST ISZERO PUSH2 0xACD JUMPI PUSH1 0x40 MLOAD PUSH4 0xD93C0665 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP3 DUP2 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH2 0x109 PUSH1 0x20 MSTORE PUSH1 0x40 DUP1 DUP3 KECCAK256 DUP1 SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB NOT AND SWAP5 DUP7 AND SWAP5 DUP6 OR SWAP1 SSTORE MLOAD PUSH31 0x3215DC05A2FC4E6A1E2C2776311D207C730EE51085AAE221ACC5CBE6FB55C1 SWAP2 SWAP1 LOG3 POP POP JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP3 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x67 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP3 SWAP1 DUP3 SWAP1 PUSH1 0xFF AND ISZERO ISZERO DUP2 ISZERO EQ PUSH2 0x1E8A JUMPI PUSH1 0x40 MLOAD PUSH4 0x5E67E54B PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB SWAP1 SWAP3 AND PUSH1 0x4 DUP4 ADD MSTORE ISZERO ISZERO PUSH1 0x24 DUP3 ADD MSTORE PUSH1 0x44 ADD PUSH2 0x8EC JUMP JUMPDEST POP POP PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP3 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x67 PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP2 DUP3 SWAP1 KECCAK256 DUP1 SLOAD PUSH1 0xFF NOT AND DUP6 ISZERO ISZERO SWAP1 DUP2 OR SWAP1 SWAP2 SSTORE SWAP2 MLOAD SWAP2 DUP3 MSTORE PUSH32 0xA95BAC2F3DF0D40E8278281C1D39D53C60E4F2BF3550CA5665738D0916E89789 SWAP2 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 POP POP JUMP JUMPDEST PUSH2 0x1EF3 PUSH2 0x3390 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x1EFD PUSH2 0x2073 JUMP JUMPDEST DUP1 SLOAD PUSH1 0xFF NOT AND DUP2 SSTORE SWAP1 POP PUSH32 0x5DB9EE0A495BF2E6FF9C91A7834C1BA4FDD244A5E8AA4E537BD38AEAE4B073AA CALLER JUMPDEST PUSH1 0x40 MLOAD PUSH2 0xDAB SWAP2 SWAP1 PUSH2 0x5048 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP3 AND PUSH1 0x0 DUP2 DUP2 MSTORE PUSH1 0x9C PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 DUP2 MLOAD SWAP3 DUP4 ADD DUP5 SWAP1 MSTORE DUP3 DUP3 ADD SWAP5 SWAP1 SWAP5 MSTORE DUP1 MLOAD DUP1 DUP4 SUB DUP3 ADD DUP2 MSTORE PUSH1 0x60 SWAP1 SWAP3 ADD SWAP1 MSTORE DUP2 SWAP1 PUSH2 0x1F8B SWAP1 DUP5 SWAP1 PUSH2 0x33B5 SWAP1 PUSH2 0x33CA SWAP1 PUSH2 0x34C5 SWAP1 DUP10 PUSH2 0x34EA JUMP JUMPDEST SWAP2 POP SWAP2 POP DUP5 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH32 0x13F3FA9F0E54AF1AF76D8B5D11C3973D7C2AED6312B61EFFF2F7B49D73AD67EB DUP4 DUP4 DUP1 PUSH1 0x20 ADD SWAP1 MLOAD DUP2 ADD SWAP1 PUSH2 0x1FCF SWAP2 SWAP1 PUSH2 0x5A7D JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1768 SWAP3 SWAP2 SWAP1 PUSH2 0x5277 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0x1FE8 PUSH2 0x2FDF JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0xBB2A2B47 PUSH1 0x40 MLOAD DUP2 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP7 GAS STATICCALL ISZERO DUP1 ISZERO PUSH2 0x2025 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x2049 SWAP2 SWAP1 PUSH2 0x5A96 JUMP JUMPDEST SWAP3 PUSH3 0xF4240 SWAP3 POP SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x2063 DUP3 PUSH1 0x60 ADD MLOAD ISZERO ISZERO SWAP1 JUMP JUMPDEST DUP1 ISZERO PUSH2 0x12B8 JUMPI POP POP PUSH1 0x80 ADD MLOAD ISZERO SWAP1 JUMP JUMPDEST PUSH32 0xCD5ED15C6E187E77E9AEE88184C21F4F2182AB5827CB3B7E07FBEDCD63F03300 SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x20A1 PUSH2 0x286F JUMP JUMPDEST DUP1 SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP5 DUP2 AND PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB NOT DUP4 AND DUP2 OR DUP5 SSTORE PUSH1 0x40 MLOAD SWAP4 SWAP5 POP SWAP2 AND SWAP2 DUP3 SWAP1 PUSH32 0x8BE0079C531659141344CD1FD0A4F28419497F9722A3DAAFE3B4186F6B6457E0 SWAP1 PUSH1 0x0 SWAP1 LOG3 POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH2 0x2100 PUSH2 0x2FDF JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0x5AEA0EC4 PUSH1 0x40 MLOAD DUP2 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP7 GAS STATICCALL ISZERO DUP1 ISZERO PUSH2 0x213D JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x2161 SWAP2 SWAP1 PUSH2 0x5AB3 JUMP JUMPDEST SWAP4 DUP5 SWAP4 POP SWAP2 POP POP JUMP JUMPDEST PUSH1 0xD2 DUP2 SWAP1 SSTORE PUSH1 0x40 MLOAD DUP2 DUP2 MSTORE PUSH32 0x21774046E2611DDB52C8C46E1AD97524EEB2E3FDA7DCD9428867868B4C4D06BA SWAP1 PUSH1 0x20 ADD PUSH2 0xDAB JUMP JUMPDEST PUSH2 0x21AC PUSH1 0xD0 DUP5 DUP5 DUP5 PUSH2 0x35A4 JUMP JUMPDEST DUP1 DUP3 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND DUP5 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH32 0xD54C7ABC930F6D506DA2D08AA7AEAD4F2443E1DB6D5F560384A2F652FF893E19 PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG4 POP POP POP JUMP JUMPDEST PUSH2 0x21FA PUSH2 0x4FAE JUMP JUMPDEST PUSH2 0x2204 DUP4 DUP4 PUSH2 0x3653 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH2 0x120 DUP2 ADD DUP3 MSTORE DUP3 SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND DUP2 MSTORE PUSH1 0x1 DUP4 ADD SLOAD PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x2 DUP4 ADD SLOAD SWAP2 DUP2 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH1 0x3 DUP3 ADD SLOAD PUSH1 0x60 DUP3 ADD MSTORE PUSH1 0x4 DUP3 ADD SLOAD PUSH1 0x80 DUP3 ADD MSTORE PUSH1 0x5 DUP3 ADD SLOAD PUSH1 0xA0 DUP3 ADD MSTORE PUSH1 0x6 DUP3 ADD SLOAD PUSH1 0xC0 DUP3 ADD MSTORE PUSH1 0x7 DUP3 ADD SLOAD PUSH1 0xE0 DUP3 ADD MSTORE PUSH1 0x8 SWAP1 SWAP2 ADD SLOAD PUSH2 0x100 DUP3 ADD MSTORE SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x2284 PUSH1 0xCF DUP5 PUSH2 0x21F2 JUMP JUMPDEST SWAP1 POP PUSH2 0x230F DUP4 PUSH2 0x2292 PUSH2 0x3706 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0xEEAC3E0E DUP5 PUSH1 0x20 ADD MLOAD PUSH1 0x40 MLOAD DUP3 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x22C3 SWAP2 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 GAS CALL ISZERO DUP1 ISZERO PUSH2 0x22E2 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x2306 SWAP2 SWAP1 PUSH2 0x5A7D JUMP JUMPDEST PUSH1 0xCF SWAP2 SWAP1 PUSH2 0x372A JUMP JUMPDEST PUSH2 0x231A PUSH1 0xCF DUP5 PUSH2 0x37DD JUMP JUMPDEST DUP1 MLOAD PUSH1 0x40 DUP3 ADD MLOAD PUSH2 0x232D SWAP2 PUSH1 0xD1 SWAP2 PUSH2 0x3893 JUMP JUMPDEST DUP1 PUSH1 0x40 ADD MLOAD PUSH1 0xD3 PUSH1 0x0 DUP4 PUSH1 0x20 ADD MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD PUSH2 0x2354 SWAP2 SWAP1 PUSH2 0x5845 JUMP JUMPDEST PUSH1 0xD3 PUSH1 0x0 DUP4 PUSH1 0x20 ADD MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 DUP2 SWAP1 SSTORE POP DUP1 PUSH1 0x20 ADD MLOAD DUP4 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND DUP3 PUSH1 0x0 ADD MLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH32 0x8F2F865E0FB62D722A51E4D9873199BF6BF52E7D8EE5A2EE2896C9EF719F545 DUP5 PUSH1 0x40 ADD MLOAD DUP7 PUSH1 0x40 MLOAD PUSH2 0x23CC SWAP3 SWAP2 SWAP1 SWAP2 DUP3 MSTORE ISZERO ISZERO PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG4 POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x23E6 PUSH1 0xCF DUP6 PUSH2 0x21F2 JUMP JUMPDEST SWAP1 POP PUSH2 0x23F1 DUP2 PUSH2 0x2054 JUMP JUMPDEST DUP5 SWAP1 PUSH2 0x2411 JUMPI PUSH1 0x40 MLOAD PUSH4 0x1EB5FF95 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP2 SWAP1 PUSH2 0x5048 JUMP JUMPDEST POP DUP1 PUSH1 0x40 ADD MLOAD DUP4 EQ ISZERO DUP5 DUP5 SWAP1 SWAP2 PUSH2 0x243D JUMPI PUSH1 0x40 MLOAD PUSH4 0xF32518CD PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP3 SWAP2 SWAP1 PUSH2 0x5AD0 JUMP JUMPDEST POP POP PUSH1 0x40 DUP2 ADD MLOAD DUP1 DUP5 GT ISZERO PUSH2 0x2473 JUMPI PUSH2 0x246E PUSH2 0x2457 PUSH2 0x1B69 JUMP JUMPDEST DUP4 MLOAD PUSH2 0x2463 DUP5 DUP9 PUSH2 0x5845 JUMP JUMPDEST PUSH1 0xD1 SWAP3 SWAP2 SWAP1 DUP8 PUSH2 0x3911 JUMP JUMPDEST PUSH2 0x248C JUMP JUMPDEST DUP2 MLOAD PUSH2 0x248C SWAP1 PUSH2 0x2483 DUP7 DUP5 PUSH2 0x5845 JUMP JUMPDEST PUSH1 0xD1 SWAP2 SWAP1 PUSH2 0x3893 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x2496 PUSH2 0x3706 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0xEEAC3E0E DUP5 PUSH1 0x20 ADD MLOAD PUSH1 0x40 MLOAD DUP3 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x24C7 SWAP2 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 GAS CALL ISZERO DUP1 ISZERO PUSH2 0x24E6 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x250A SWAP2 SWAP1 PUSH2 0x5A7D JUMP JUMPDEST SWAP1 POP PUSH1 0x0 PUSH2 0x2517 DUP5 PUSH2 0x333D JUMP JUMPDEST ISZERO PUSH2 0x2523 JUMPI PUSH1 0x0 PUSH2 0x2532 JUMP JUMPDEST PUSH1 0xC0 DUP5 ADD MLOAD PUSH2 0x2532 SWAP1 DUP4 PUSH2 0x5845 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP9 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0xCF PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 PUSH1 0x2 DUP2 ADD DUP9 SWAP1 SSTORE PUSH1 0x6 ADD DUP4 SWAP1 SSTORE SWAP1 POP PUSH2 0x2561 PUSH2 0x3706 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0xC8A5F81E DUP5 DUP4 PUSH1 0x40 MLOAD DUP4 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x258E SWAP3 SWAP2 SWAP1 PUSH2 0x5277 JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP7 GAS STATICCALL ISZERO DUP1 ISZERO PUSH2 0x25AB JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x25CF SWAP2 SWAP1 PUSH2 0x5A7D JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP9 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0xCF PUSH1 0x20 MSTORE PUSH1 0x40 DUP2 KECCAK256 PUSH1 0x7 ADD DUP1 SLOAD SWAP1 SWAP2 SWAP1 PUSH2 0x25FA SWAP1 DUP5 SWAP1 PUSH2 0x5AE9 JUMP JUMPDEST SWAP1 SWAP2 SSTORE POP POP DUP3 DUP7 GT ISZERO PUSH2 0x2642 JUMPI PUSH2 0x2611 DUP4 DUP8 PUSH2 0x5845 JUMP JUMPDEST PUSH1 0xD3 PUSH1 0x0 DUP7 PUSH1 0x20 ADD MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD PUSH2 0x2637 SWAP2 SWAP1 PUSH2 0x5AE9 JUMP JUMPDEST SWAP1 SWAP2 SSTORE POP PUSH2 0x2678 SWAP1 POP JUMP JUMPDEST PUSH2 0x264C DUP7 DUP5 PUSH2 0x5845 JUMP JUMPDEST PUSH1 0xD3 PUSH1 0x0 DUP7 PUSH1 0x20 ADD MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD PUSH2 0x2672 SWAP2 SWAP1 PUSH2 0x5845 JUMP JUMPDEST SWAP1 SWAP2 SSTORE POP POP JUMPDEST DUP4 PUSH1 0x20 ADD MLOAD DUP8 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND DUP6 PUSH1 0x0 ADD MLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH32 0x6DB4A6F9BE2D5E72EB2A2AF2374AC487971BF342A261BA0BC1CF471BF2A2C31F DUP10 DUP8 PUSH1 0x40 MLOAD PUSH2 0x26C6 SWAP3 SWAP2 SWAP1 PUSH2 0x5277 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG4 POP POP POP POP POP POP POP JUMP JUMPDEST DUP2 DUP2 DUP1 DUP3 GT ISZERO PUSH2 0x26FC JUMPI PUSH1 0x40 MLOAD PUSH4 0xCCCCDAFB PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP3 SWAP2 SWAP1 PUSH2 0x5277 JUMP JUMPDEST POP POP PUSH1 0x0 DUP3 SWAP1 SSTORE PUSH1 0x1 DUP2 SWAP1 SSTORE PUSH1 0x40 MLOAD PUSH32 0x90699B8B4BF48918FEA1129C85F9BC7B51285DF7ECC982910813C7805F568849 SWAP1 PUSH2 0x273A SWAP1 DUP5 SWAP1 DUP5 SWAP1 PUSH2 0x5277 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG1 POP POP JUMP JUMPDEST PUSH2 0x274E PUSH2 0x1DB8 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x2758 PUSH2 0x2073 JUMP JUMPDEST DUP1 SLOAD PUSH1 0xFF NOT AND PUSH1 0x1 OR DUP2 SSTORE SWAP1 POP PUSH32 0x62E78CEA01BEE320CD4E420270B5EA74000D11B0C9F74754EBDBFC544B05A258 PUSH2 0x1F2A CALLER SWAP1 JUMP JUMPDEST PUSH32 0xA16A46D94261C7517CC8FF89F61C0CE93598E3C849801011DEE649A6A557D100 SWAP1 JUMP JUMPDEST PUSH1 0x60 PUSH1 0x0 PUSH2 0x27BD PUSH2 0x278D JUMP JUMPDEST SWAP1 POP DUP1 PUSH1 0x2 ADD DUP1 SLOAD PUSH2 0x27CE SWAP1 PUSH2 0x56C1 JUMP JUMPDEST DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD PUSH2 0x27FA SWAP1 PUSH2 0x56C1 JUMP JUMPDEST DUP1 ISZERO PUSH2 0x2847 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x281C JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x2847 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x282A JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP SWAP2 POP POP SWAP1 JUMP JUMPDEST PUSH1 0x60 PUSH1 0x0 PUSH2 0x285E PUSH2 0x278D JUMP JUMPDEST SWAP1 POP DUP1 PUSH1 0x3 ADD DUP1 SLOAD PUSH2 0x27CE SWAP1 PUSH2 0x56C1 JUMP JUMPDEST PUSH32 0x9016D09D72D40FDAE2FD8CEAC6B6234C7706214FD39C1CD1E609A0528C199300 SWAP1 JUMP JUMPDEST PUSH1 0x60 PUSH1 0x0 DUP1 DUP5 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND DUP5 PUSH1 0x40 MLOAD PUSH2 0x28B0 SWAP2 SWAP1 PUSH2 0x5AFC JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP6 GAS DELEGATECALL SWAP2 POP POP RETURNDATASIZE DUP1 PUSH1 0x0 DUP2 EQ PUSH2 0x28EB JUMPI PUSH1 0x40 MLOAD SWAP2 POP PUSH1 0x1F NOT PUSH1 0x3F RETURNDATASIZE ADD AND DUP3 ADD PUSH1 0x40 MSTORE RETURNDATASIZE DUP3 MSTORE RETURNDATASIZE PUSH1 0x0 PUSH1 0x20 DUP5 ADD RETURNDATACOPY PUSH2 0x28F0 JUMP JUMPDEST PUSH1 0x60 SWAP2 POP JUMPDEST POP SWAP2 POP SWAP2 POP PUSH2 0x2900 DUP6 DUP4 DUP4 PUSH2 0x3A0F JUMP JUMPDEST SWAP6 SWAP5 POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 DUP1 PUSH2 0x2919 DUP5 DUP7 ADD DUP7 PUSH2 0x5B3A JUMP JUMPDEST DUP2 MLOAD PUSH1 0x40 ADD MLOAD SWAP2 SWAP4 POP SWAP2 POP DUP7 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP3 DUP2 AND SWAP1 DUP3 AND EQ PUSH2 0x2953 JUMPI PUSH1 0x40 MLOAD PUSH4 0x1A071D07 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP3 SWAP2 SWAP1 PUSH2 0x5515 JUMP JUMPDEST POP POP DUP2 MLOAD MLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP2 GT ISZERO PUSH2 0x2983 JUMPI PUSH1 0x40 MLOAD PUSH4 0xFA4AC7A7 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP2 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 JUMP JUMPDEST POP DUP2 MLOAD MLOAD PUSH1 0x0 PUSH2 0x2994 PUSH1 0xCF DUP4 PUSH2 0x21F2 JUMP JUMPDEST DUP1 MLOAD SWAP1 SWAP2 POP DUP9 SWAP1 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP2 DUP2 AND SWAP1 DUP4 AND EQ PUSH2 0x29C9 JUMPI PUSH1 0x40 MLOAD PUSH4 0x4508FBF7 PUSH1 0xE1 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP3 SWAP2 SWAP1 PUSH2 0x5515 JUMP JUMPDEST POP POP PUSH1 0x20 DUP2 ADD MLOAD PUSH2 0x29DB DUP10 PUSH1 0x0 PUSH2 0x1F37 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH2 0x29E8 PUSH2 0x3A62 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0x70A08231 ADDRESS PUSH1 0x40 MLOAD DUP3 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x2A13 SWAP2 SWAP1 PUSH2 0x5048 JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP7 GAS STATICCALL ISZERO DUP1 ISZERO PUSH2 0x2A30 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x2A54 SWAP2 SWAP1 PUSH2 0x5A7D JUMP JUMPDEST SWAP1 POP PUSH2 0x2A5E PUSH2 0x32DC JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0x692209CE PUSH1 0x0 PUSH2 0x2AFC DUP12 PUSH2 0x2A7A PUSH2 0x2EE0 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0x4C4EA0ED DUP11 PUSH1 0x40 MLOAD DUP3 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x2AA7 SWAP2 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP7 GAS STATICCALL ISZERO DUP1 ISZERO PUSH2 0x2AC4 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x2AE8 SWAP2 SWAP1 PUSH2 0x54F8 JUMP JUMPDEST PUSH2 0x2AF3 JUMPI PUSH1 0x0 PUSH2 0x3A86 JUMP JUMPDEST PUSH2 0x108 SLOAD PUSH2 0x3A86 JUMP JUMPDEST DUP11 PUSH1 0x40 MLOAD DUP5 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x2B1B SWAP4 SWAP3 SWAP2 SWAP1 PUSH2 0x5C71 JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 GAS CALL ISZERO DUP1 ISZERO PUSH2 0x2B3A JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x2B5E SWAP2 SWAP1 PUSH2 0x5A7D JUMP JUMPDEST SWAP3 POP PUSH1 0x0 PUSH2 0x2B6A PUSH2 0x3A62 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0x70A08231 ADDRESS PUSH1 0x40 MLOAD DUP3 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x2B95 SWAP2 SWAP1 PUSH2 0x5048 JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP7 GAS STATICCALL ISZERO DUP1 ISZERO PUSH2 0x2BB2 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x2BD6 SWAP2 SWAP1 PUSH2 0x5A7D JUMP JUMPDEST SWAP1 POP DUP2 DUP2 DUP2 DUP2 LT ISZERO PUSH2 0x2BFD JUMPI PUSH1 0x40 MLOAD PUSH4 0x9DB8BC95 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP3 SWAP2 SWAP1 PUSH2 0x5277 JUMP JUMPDEST POP PUSH2 0x2C0A SWAP1 POP DUP3 DUP3 PUSH2 0x5845 JUMP JUMPDEST SWAP3 POP POP DUP3 ISZERO SWAP1 POP PUSH2 0x2DB4 JUMPI PUSH2 0x2CA9 DUP12 PUSH2 0x107 SLOAD DUP5 PUSH2 0x2C28 SWAP2 SWAP1 PUSH2 0x5CA1 JUMP JUMPDEST PUSH2 0x2C30 PUSH2 0x2FDF JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0x5AEA0EC4 PUSH1 0x40 MLOAD DUP2 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP7 GAS STATICCALL ISZERO DUP1 ISZERO PUSH2 0x2C6D JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x2C91 SWAP2 SWAP1 PUSH2 0x5AB3 JUMP JUMPDEST PUSH2 0x2CA4 SWAP1 PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB AND TIMESTAMP PUSH2 0x5AE9 JUMP JUMPDEST PUSH2 0x3ADA JUMP JUMPDEST DUP1 ISZERO PUSH2 0x2DB4 JUMPI PUSH2 0x2CB7 PUSH2 0x3706 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0x1D1C2FEC DUP5 PUSH1 0x40 MLOAD DUP3 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x2CE4 SWAP2 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 GAS CALL ISZERO DUP1 ISZERO PUSH2 0x2D03 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x2D27 SWAP2 SWAP1 PUSH2 0x5A7D JUMP JUMPDEST POP PUSH2 0x2D4C PUSH2 0x2D33 PUSH2 0x2EE0 JUMP JUMPDEST DUP3 PUSH2 0x2D3C PUSH2 0x3A62 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND SWAP2 SWAP1 PUSH2 0x3C4A JUMP JUMPDEST PUSH2 0x2D54 PUSH2 0x2EE0 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0x81573288 DUP5 DUP4 PUSH1 0x40 MLOAD DUP4 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x2D81 SWAP3 SWAP2 SWAP1 PUSH2 0x5277 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x2D9B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x2DAF JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP JUMPDEST DUP7 MLOAD PUSH1 0x20 SWAP1 DUP2 ADD MLOAD PUSH1 0x40 DUP1 MLOAD DUP7 DUP2 MSTORE SWAP3 DUP4 ADD DUP6 SWAP1 MSTORE DUP3 ADD DUP4 SWAP1 MSTORE PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP1 DUP9 AND SWAP3 SWAP2 DUP2 AND SWAP2 SWAP1 DUP15 AND SWAP1 PUSH32 0x184C452047299395D4F7F147EB8E823458A450798539BE54AEED978F13D87BA2 SWAP1 PUSH1 0x60 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG4 POP SWAP10 SWAP9 POP POP POP POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 DUP1 DUP1 PUSH2 0x2E2E DUP6 DUP8 ADD DUP8 PUSH2 0x5CB8 JUMP JUMPDEST SWAP2 SWAP5 POP SWAP3 POP SWAP1 POP PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP8 AND PUSH2 0x2E4A PUSH1 0xCF DUP6 PUSH2 0x21F2 JUMP JUMPDEST MLOAD DUP9 SWAP2 DUP6 SWAP2 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND EQ PUSH2 0x2E78 JUMPI PUSH1 0x40 MLOAD PUSH4 0xC0BBFF13 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP3 SWAP2 SWAP1 PUSH2 0x5515 JUMP JUMPDEST POP POP PUSH1 0x2 SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP9 DUP2 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH2 0x109 PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD PUSH2 0x2EB6 SWAP3 DUP7 SWAP3 DUP7 SWAP3 DUP7 SWAP3 PUSH1 0x1 PUSH1 0xC0 SHL SWAP1 DIV PUSH4 0xFFFFFFFF AND SWAP2 AND PUSH2 0x3CF9 JUMP JUMPDEST SWAP8 SWAP7 POP POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x2ED8 PUSH2 0x2ECE PUSH2 0x1B69 JUMP JUMPDEST PUSH1 0xD1 SWAP1 DUP6 DUP6 PUSH2 0x42D6 JUMP JUMPDEST ISZERO SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH32 0x0 SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH32 0xF0C57E16840DF040F15088DC2F81FE391C3923BEC73E23A9662EFC9C229C6A00 PUSH2 0x12B8 JUMP JUMPDEST PUSH2 0x2F35 PUSH2 0x4370 JUMP JUMPDEST PUSH2 0x848 DUP2 PUSH2 0x4395 JUMP JUMPDEST PUSH2 0xACD PUSH2 0x4370 JUMP JUMPDEST PUSH2 0x2F4E PUSH2 0x4370 JUMP JUMPDEST PUSH2 0x2F56 PUSH2 0x439D JUMP JUMPDEST PUSH2 0xACD PUSH2 0x2F3E JUMP JUMPDEST PUSH2 0x2F66 PUSH2 0x4370 JUMP JUMPDEST PUSH2 0x2F56 PUSH2 0x2F3E JUMP JUMPDEST PUSH2 0x2F76 PUSH2 0x4370 JUMP JUMPDEST PUSH2 0x2F80 DUP3 DUP3 PUSH2 0x43DF JUMP JUMPDEST PUSH2 0xA8F PUSH2 0x2F3E JUMP JUMPDEST DUP1 PUSH1 0x0 SUB PUSH2 0x2FA9 JUMPI PUSH1 0x40 MLOAD PUSH4 0xBC71A043 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH2 0x107 DUP2 SWAP1 SSTORE PUSH1 0x40 MLOAD DUP2 DUP2 MSTORE PUSH32 0x2AAAF20B08565EEBC0C962CD7C568E54C3C0C2B85A1F942B82CD1BD730FDCD23 SWAP1 PUSH1 0x20 ADD PUSH2 0xDAB JUMP JUMPDEST PUSH32 0x0 SWAP1 JUMP JUMPDEST PUSH2 0x300E DUP2 PUSH1 0x1 PUSH2 0x43F1 JUMP JUMPDEST PUSH2 0x3016 PUSH2 0x1B69 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0x3A78B732 DUP3 PUSH1 0x40 MLOAD DUP3 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x3041 SWAP2 SWAP1 PUSH2 0x5048 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x305B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x306F JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x186C PUSH32 0x4BDEE85C4B4A268F4895D1096D553C3E57BB2433C380E7B7EC8CB56CC4F74673 DUP5 DUP5 PUSH1 0x40 MLOAD PUSH1 0x20 ADD PUSH2 0x30CA SWAP4 SWAP3 SWAP2 SWAP1 SWAP3 DUP4 MSTORE PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB SWAP2 DUP3 AND PUSH1 0x20 DUP5 ADD MSTORE AND PUSH1 0x40 DUP3 ADD MSTORE PUSH1 0x60 ADD SWAP1 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 DUP4 SUB SUB DUP2 MSTORE SWAP1 PUSH1 0x40 MSTORE DUP1 MLOAD SWAP1 PUSH1 0x20 ADD KECCAK256 PUSH2 0x4408 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP6 AND PUSH2 0x310C JUMPI PUSH1 0x40 MLOAD PUSH4 0x4FFDF5EF PUSH1 0xE1 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH2 0x3117 DUP7 DUP7 DUP5 PUSH2 0x4435 JUMP JUMPDEST PUSH2 0x312B PUSH2 0x3122 PUSH2 0x1B69 JUMP JUMPDEST PUSH1 0xD0 SWAP1 DUP8 PUSH2 0x4484 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x3135 PUSH2 0x457A JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0x76671808 PUSH1 0x40 MLOAD DUP2 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP7 GAS STATICCALL ISZERO DUP1 ISZERO PUSH2 0x3172 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x3196 SWAP2 SWAP1 PUSH2 0x5A7D JUMP JUMPDEST SWAP1 POP PUSH1 0x0 PUSH2 0x3226 DUP9 DUP9 DUP9 DUP9 PUSH2 0x31A9 PUSH2 0x3706 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0xEEAC3E0E DUP13 PUSH1 0x40 MLOAD DUP3 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x31D6 SWAP2 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 GAS CALL ISZERO DUP1 ISZERO PUSH2 0x31F5 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x3219 SWAP2 SWAP1 PUSH2 0x5A7D JUMP JUMPDEST PUSH1 0xCF SWAP5 SWAP4 SWAP3 SWAP2 SWAP1 DUP9 PUSH2 0x459E JUMP JUMPDEST SWAP1 POP PUSH2 0x323E PUSH2 0x3233 PUSH2 0x1B69 JUMP JUMPDEST PUSH1 0xD1 SWAP1 DUP11 DUP9 DUP8 PUSH2 0x3911 JUMP JUMPDEST DUP1 PUSH1 0x40 ADD MLOAD PUSH1 0xD3 PUSH1 0x0 DUP4 PUSH1 0x20 ADD MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD PUSH2 0x3265 SWAP2 SWAP1 PUSH2 0x5AE9 JUMP JUMPDEST PUSH1 0xD3 PUSH1 0x0 DUP4 PUSH1 0x20 ADD MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 DUP2 SWAP1 SSTORE POP DUP6 DUP8 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND DUP10 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH32 0xE5E185FAB2B992C4727FF702A867D78B15FB176DBAA20C9C312A1C351D3F7F83 DUP5 PUSH1 0x40 ADD MLOAD DUP7 PUSH1 0x40 MLOAD PUSH2 0x32CA SWAP3 SWAP2 SWAP1 PUSH2 0x5277 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG4 POP POP POP POP POP POP POP POP JUMP JUMPDEST PUSH32 0x0 SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0x3315 DUP5 PUSH1 0x60 ADD MLOAD DUP6 PUSH1 0xA0 ADD MLOAD PUSH2 0x4706 JUMP JUMPDEST PUSH2 0x331F SWAP1 TIMESTAMP PUSH2 0x5845 JUMP JUMPDEST SWAP1 POP PUSH2 0x332A DUP5 PUSH2 0x2054 JUMP JUMPDEST DUP1 ISZERO PUSH2 0x3335 JUMPI POP DUP3 DUP2 GT JUMPDEST SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x334C DUP3 PUSH1 0x60 ADD MLOAD ISZERO ISZERO SWAP1 JUMP JUMPDEST DUP1 ISZERO PUSH2 0x12B8 JUMPI POP POP PUSH1 0x40 ADD MLOAD ISZERO SWAP1 JUMP JUMPDEST PUSH2 0x3367 DUP5 DUP5 DUP5 PUSH2 0x4716 JUMP JUMPDEST DUP2 DUP6 DUP6 DUP6 SWAP1 SWAP2 SWAP3 SWAP4 PUSH2 0x1DAE JUMPI PUSH1 0x40 MLOAD PUSH4 0x871E13D PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP5 SWAP4 SWAP3 SWAP2 SWAP1 PUSH2 0x5D10 JUMP JUMPDEST PUSH2 0x3398 PUSH2 0xCDC JUMP JUMPDEST PUSH2 0xACD JUMPI PUSH1 0x40 MLOAD PUSH4 0x8DFC202B PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x9B PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 PUSH1 0x3 ADD SLOAD SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x60 PUSH1 0x0 PUSH2 0x33D9 DUP6 PUSH2 0x472D JUMP JUMPDEST SWAP1 POP TIMESTAMP DUP2 PUSH1 0x40 ADD MLOAD GT ISZERO PUSH2 0x3401 JUMPI POP POP PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 DUP2 ADD SWAP1 SWAP2 MSTORE PUSH1 0x0 DUP2 MSTORE PUSH1 0x1 SWAP2 POP PUSH2 0x34BE JUMP JUMPDEST PUSH1 0x0 DUP1 DUP6 DUP1 PUSH1 0x20 ADD SWAP1 MLOAD DUP2 ADD SWAP1 PUSH2 0x3418 SWAP2 SWAP1 PUSH2 0x5D3F JUMP JUMPDEST DUP5 MLOAD SWAP2 SWAP4 POP SWAP2 POP PUSH2 0x342D SWAP1 PUSH1 0x9A SWAP1 DUP4 SWAP1 PUSH2 0x3893 JUMP JUMPDEST DUP7 DUP2 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH32 0x4C06B68820628A39C787D2DB1FAA0EEACD7B9474847B198B1E871FE6E5B93F44 DUP6 PUSH1 0x0 ADD MLOAD DUP7 PUSH1 0x40 ADD MLOAD PUSH1 0x40 MLOAD PUSH2 0x3471 SWAP3 SWAP2 SWAP1 PUSH2 0x5277 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 DUP3 MLOAD PUSH2 0x3485 SWAP1 DUP4 PUSH2 0x5AE9 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 DUP2 ADD SWAP3 SWAP1 SWAP3 MSTORE PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP4 AND SWAP1 DUP3 ADD MSTORE PUSH1 0x60 ADD PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 DUP4 SUB SUB DUP2 MSTORE SWAP1 PUSH1 0x40 MSTORE SWAP6 POP PUSH1 0x0 DUP7 SWAP5 POP SWAP5 POP POP POP POP JUMPDEST SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x9B PUSH1 0x20 MSTORE PUSH1 0x40 DUP2 KECCAK256 DUP2 DUP2 SSTORE PUSH1 0x1 DUP2 ADD DUP3 SWAP1 SSTORE PUSH1 0x2 DUP2 ADD DUP3 SWAP1 SSTORE PUSH1 0x3 ADD SSTORE JUMP JUMPDEST PUSH1 0x0 PUSH1 0x60 DUP8 PUSH1 0x3 ADD SLOAD DUP4 GT ISZERO PUSH2 0x3513 JUMPI PUSH1 0x40 MLOAD PUSH4 0x4A411B9D PUSH1 0xE1 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x0 DUP4 ISZERO PUSH2 0x3521 JUMPI DUP4 PUSH2 0x3527 JUMP JUMPDEST DUP9 PUSH1 0x3 ADD SLOAD JUMPDEST DUP10 SLOAD SWAP1 SWAP5 POP JUMPDEST DUP1 ISZERO DUP1 ISZERO SWAP1 PUSH2 0x353C JUMPI POP PUSH1 0x0 DUP6 GT JUMPDEST ISZERO PUSH2 0x3595 JUMPI PUSH1 0x0 DUP1 PUSH2 0x3552 DUP4 DUP10 DUP13 PUSH4 0xFFFFFFFF AND JUMP JUMPDEST SWAP2 POP SWAP2 POP DUP2 ISZERO PUSH2 0x3563 JUMPI POP POP PUSH2 0x3595 JUMP JUMPDEST SWAP7 POP DUP7 PUSH2 0x3571 DUP13 DUP13 DUP12 PUSH2 0x47BB JUMP JUMPDEST SWAP3 POP DUP7 PUSH2 0x357D DUP2 PUSH2 0x5D65 JUMP JUMPDEST SWAP8 POP POP DUP4 DUP1 PUSH2 0x358B SWAP1 PUSH2 0x5D7C JUMP JUMPDEST SWAP5 POP POP POP POP PUSH2 0x352D JUMP JUMPDEST POP SWAP9 SWAP4 SWAP8 POP SWAP3 SWAP6 POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP1 DUP4 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x20 DUP7 DUP2 MSTORE PUSH1 0x40 SWAP2 DUP3 SWAP1 KECCAK256 DUP3 MLOAD DUP1 DUP5 ADD SWAP1 SWAP4 MSTORE DUP1 SLOAD SWAP1 SWAP4 AND DUP3 MSTORE PUSH1 0x1 SWAP1 SWAP3 ADD SLOAD SWAP2 DUP2 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH2 0x35E4 SWAP1 PUSH2 0x4842 JUMP JUMPDEST ISZERO DUP3 SWAP1 PUSH2 0x3605 JUMPI PUSH1 0x40 MLOAD PUSH4 0x2D7D25F1 PUSH1 0xE2 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP2 SWAP1 PUSH2 0x5048 JUMP JUMPDEST POP PUSH1 0x40 DUP1 MLOAD DUP1 DUP3 ADD DUP3 MSTORE PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB SWAP5 DUP6 AND DUP2 MSTORE PUSH1 0x20 DUP1 DUP3 ADD SWAP4 DUP5 MSTORE SWAP4 DUP6 AND PUSH1 0x0 SWAP1 DUP2 MSTORE SWAP6 SWAP1 SWAP4 MSTORE SWAP1 SWAP4 KECCAK256 SWAP1 MLOAD DUP2 SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB NOT AND SWAP3 AND SWAP2 SWAP1 SWAP2 OR DUP2 SSTORE SWAP1 MLOAD PUSH1 0x1 SWAP1 SWAP2 ADD SSTORE JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP1 DUP3 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x20 DUP5 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 DUP2 MLOAD PUSH2 0x120 DUP2 ADD DUP4 MSTORE DUP2 SLOAD SWAP1 SWAP6 AND DUP6 MSTORE PUSH1 0x1 DUP2 ADD SLOAD SWAP3 DUP6 ADD SWAP3 SWAP1 SWAP3 MSTORE PUSH1 0x2 DUP3 ADD SLOAD SWAP1 DUP5 ADD MSTORE PUSH1 0x3 DUP2 ADD SLOAD PUSH1 0x60 DUP5 ADD MSTORE PUSH1 0x4 DUP2 ADD SLOAD PUSH1 0x80 DUP5 ADD MSTORE PUSH1 0x5 DUP2 ADD SLOAD PUSH1 0xA0 DUP5 ADD MSTORE PUSH1 0x6 DUP2 ADD SLOAD PUSH1 0xC0 DUP5 ADD MSTORE PUSH1 0x7 DUP2 ADD SLOAD PUSH1 0xE0 DUP5 ADD MSTORE PUSH1 0x8 DUP2 ADD SLOAD PUSH2 0x100 DUP5 ADD MSTORE SWAP1 SWAP2 PUSH2 0x36DE SWAP1 PUSH1 0x60 ADD MLOAD ISZERO ISZERO SWAP1 JUMP JUMPDEST DUP4 SWAP1 PUSH2 0x36FE JUMPI PUSH1 0x40 MLOAD PUSH4 0x42DAADAF PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP2 SWAP1 PUSH2 0x5048 JUMP JUMPDEST POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH32 0x0 SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x3736 DUP5 DUP5 PUSH2 0x3653 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH2 0x120 DUP2 ADD DUP3 MSTORE DUP3 SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND DUP2 MSTORE PUSH1 0x1 DUP4 ADD SLOAD PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x2 DUP4 ADD SLOAD SWAP2 DUP2 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH1 0x3 DUP3 ADD SLOAD PUSH1 0x60 DUP3 ADD MSTORE PUSH1 0x4 DUP3 ADD SLOAD PUSH1 0x80 DUP3 ADD MSTORE PUSH1 0x5 DUP3 ADD SLOAD PUSH1 0xA0 DUP3 ADD MSTORE PUSH1 0x6 DUP3 ADD SLOAD PUSH1 0xC0 DUP3 ADD MSTORE PUSH1 0x7 DUP3 ADD SLOAD PUSH1 0xE0 DUP3 ADD MSTORE PUSH1 0x8 DUP3 ADD SLOAD PUSH2 0x100 DUP3 ADD MSTORE SWAP1 SWAP2 POP PUSH2 0x37AD SWAP1 PUSH2 0x2054 JUMP JUMPDEST PUSH1 0x4 DUP3 ADD SLOAD DUP5 SWAP2 PUSH2 0x37D3 JUMPI PUSH1 0x40 MLOAD PUSH4 0x61B66E0D PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP3 SWAP2 SWAP1 PUSH2 0x5AD0 JUMP JUMPDEST POP POP PUSH1 0x6 ADD SSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x37E9 DUP4 DUP4 PUSH2 0x3653 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH2 0x120 DUP2 ADD DUP3 MSTORE DUP3 SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND DUP2 MSTORE PUSH1 0x1 DUP4 ADD SLOAD PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x2 DUP4 ADD SLOAD SWAP2 DUP2 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH1 0x3 DUP3 ADD SLOAD PUSH1 0x60 DUP3 ADD MSTORE PUSH1 0x4 DUP3 ADD SLOAD PUSH1 0x80 DUP3 ADD MSTORE PUSH1 0x5 DUP3 ADD SLOAD PUSH1 0xA0 DUP3 ADD MSTORE PUSH1 0x6 DUP3 ADD SLOAD PUSH1 0xC0 DUP3 ADD MSTORE PUSH1 0x7 DUP3 ADD SLOAD PUSH1 0xE0 DUP3 ADD MSTORE PUSH1 0x8 DUP3 ADD SLOAD PUSH2 0x100 DUP3 ADD MSTORE SWAP1 SWAP2 POP PUSH2 0x3860 SWAP1 PUSH2 0x2054 JUMP JUMPDEST PUSH1 0x4 DUP3 ADD SLOAD DUP4 SWAP2 PUSH2 0x3886 JUMPI PUSH1 0x40 MLOAD PUSH4 0x61B66E0D PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP3 SWAP2 SWAP1 PUSH2 0x5AD0 JUMP JUMPDEST POP POP TIMESTAMP PUSH1 0x4 SWAP1 SWAP2 ADD SSTORE POP POP JUMP JUMPDEST DUP1 PUSH1 0x0 SUB PUSH2 0x38A0 JUMPI POP POP POP JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP3 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x20 DUP5 SWAP1 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD DUP2 DUP1 DUP3 LT ISZERO PUSH2 0x38DD JUMPI PUSH1 0x40 MLOAD PUSH4 0x5F8EC709 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP3 SWAP2 SWAP1 PUSH2 0x5277 JUMP JUMPDEST POP POP PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP3 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x20 DUP5 SWAP1 MSTORE PUSH1 0x40 DUP2 KECCAK256 DUP1 SLOAD DUP4 SWAP3 SWAP1 PUSH2 0x3907 SWAP1 DUP5 SWAP1 PUSH2 0x5845 JUMP JUMPDEST SWAP1 SWAP2 SSTORE POP POP POP POP POP JUMP JUMPDEST DUP2 ISZERO PUSH2 0x306F JUMPI PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP4 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x20 DUP7 SWAP1 MSTORE PUSH1 0x40 DUP2 KECCAK256 SLOAD PUSH2 0x393B SWAP1 DUP5 SWAP1 PUSH2 0x5AE9 JUMP JUMPDEST SWAP1 POP PUSH1 0x0 DUP6 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0x872D0489 DUP7 ADDRESS DUP7 PUSH1 0x40 MLOAD DUP5 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x396F SWAP4 SWAP3 SWAP2 SWAP1 PUSH2 0x5D95 JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP7 GAS STATICCALL ISZERO DUP1 ISZERO PUSH2 0x398C JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x39B0 SWAP2 SWAP1 PUSH2 0x5A7D JUMP JUMPDEST SWAP1 POP DUP1 DUP3 DUP2 DUP2 GT ISZERO PUSH2 0x39D7 JUMPI PUSH1 0x40 MLOAD PUSH4 0x5F8EC709 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP3 SWAP2 SWAP1 PUSH2 0x5277 JUMP JUMPDEST POP POP PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP6 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x20 DUP9 SWAP1 MSTORE PUSH1 0x40 DUP2 KECCAK256 DUP1 SLOAD DUP7 SWAP3 SWAP1 PUSH2 0x3A01 SWAP1 DUP5 SWAP1 PUSH2 0x5AE9 JUMP JUMPDEST SWAP1 SWAP2 SSTORE POP POP POP POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x60 DUP3 PUSH2 0x3A24 JUMPI PUSH2 0x3A1F DUP3 PUSH2 0x4851 JUMP JUMPDEST PUSH2 0x186C JUMP JUMPDEST DUP2 MLOAD ISZERO DUP1 ISZERO PUSH2 0x3A3B JUMPI POP PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP5 AND EXTCODESIZE ISZERO JUMPDEST ISZERO PUSH2 0x3A5B JUMPI DUP4 PUSH1 0x40 MLOAD PUSH4 0x9996B315 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP2 SWAP1 PUSH2 0x5048 JUMP JUMPDEST POP DUP1 PUSH2 0x186C JUMP JUMPDEST PUSH32 0x0 SWAP1 JUMP JUMPDEST DUP2 MLOAD PUSH1 0x40 SWAP1 DUP2 ADD MLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB SWAP1 DUP2 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH2 0x109 PUSH1 0x20 SWAP1 DUP2 MSTORE SWAP1 DUP4 SWAP1 KECCAK256 SLOAD SWAP3 MLOAD PUSH1 0x60 SWAP4 PUSH2 0x3AC3 SWAP4 DUP8 SWAP4 DUP8 SWAP4 SWAP3 SWAP1 SWAP2 AND SWAP2 ADD PUSH2 0x5DBE JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 DUP4 SUB SUB DUP2 MSTORE SWAP1 PUSH1 0x40 MSTORE SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST DUP2 PUSH1 0x0 SUB PUSH2 0x3AFB JUMPI PUSH1 0x40 MLOAD PUSH4 0x8F4C63D9 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH2 0x3B27 PUSH2 0x3B06 PUSH2 0x1B69 JUMP JUMPDEST PUSH1 0x2 SLOAD PUSH1 0x9A SWAP2 SWAP1 DUP7 SWAP1 DUP7 SWAP1 PUSH4 0xFFFFFFFF PUSH1 0x1 PUSH1 0xC0 SHL SWAP1 SWAP2 DIV DUP2 AND SWAP1 PUSH2 0x3911 AND JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP4 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x9C PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 DUP1 DUP4 KECCAK256 PUSH1 0x2 DUP1 DUP3 ADD SLOAD DUP4 MLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0x60 SHL SUB NOT ADDRESS PUSH1 0x60 SWAP1 DUP2 SHL DUP3 AND DUP4 DUP10 ADD MSTORE DUP12 SWAP1 SHL AND PUSH1 0x34 DUP3 ADD MSTORE PUSH1 0x48 DUP1 DUP3 ADD SWAP3 SWAP1 SWAP3 MSTORE DUP5 MLOAD DUP1 DUP3 SUB SWAP1 SWAP3 ADD DUP3 MSTORE PUSH1 0x68 DUP2 ADD DUP1 DUP7 MSTORE DUP3 MLOAD SWAP3 DUP8 ADD SWAP3 SWAP1 SWAP3 KECCAK256 PUSH1 0xE8 DUP3 ADD DUP7 MSTORE DUP10 DUP4 MSTORE TIMESTAMP PUSH1 0x88 DUP4 ADD SWAP1 DUP2 MSTORE PUSH1 0xA8 DUP4 ADD DUP11 DUP2 MSTORE PUSH1 0xC8 SWAP1 SWAP4 ADD DUP10 DUP2 MSTORE DUP3 DUP11 MSTORE PUSH1 0x9B SWAP1 SWAP9 MSTORE SWAP6 SWAP1 SWAP8 KECCAK256 SWAP2 MLOAD DUP3 SSTORE SWAP4 MLOAD PUSH1 0x1 DUP3 ADD SSTORE SWAP3 MLOAD SWAP1 DUP4 ADD SSTORE SWAP2 MLOAD PUSH1 0x3 SWAP2 DUP3 ADD SSTORE DUP2 ADD SLOAD SWAP1 SWAP2 SWAP1 ISZERO PUSH2 0x3BF5 JUMPI PUSH1 0x1 DUP3 ADD SLOAD PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x9B PUSH1 0x20 MSTORE PUSH1 0x40 SWAP1 KECCAK256 PUSH1 0x3 ADD DUP2 SWAP1 SSTORE JUMPDEST PUSH2 0x3BFF DUP3 DUP3 PUSH2 0x487A JUMP JUMPDEST DUP1 DUP6 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH32 0x5D9E2C5278E41138269F5F980CFBEA016D8C59816754502ABC4D2F87AAEA987F DUP7 DUP7 PUSH1 0x40 MLOAD PUSH2 0x3C3B SWAP3 SWAP2 SWAP1 PUSH2 0x5277 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 POP POP POP POP POP JUMP JUMPDEST DUP1 ISZERO PUSH2 0xD3C JUMPI PUSH1 0x40 MLOAD PUSH4 0xA9059CBB PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP5 AND SWAP1 PUSH4 0xA9059CBB SWAP1 PUSH2 0x3C7E SWAP1 DUP6 SWAP1 DUP6 SWAP1 PUSH1 0x4 ADD PUSH2 0x5AD0 JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 GAS CALL ISZERO DUP1 ISZERO PUSH2 0x3C9D JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x3CC1 SWAP2 SWAP1 PUSH2 0x54F8 JUMP JUMPDEST PUSH2 0xD3C JUMPI PUSH1 0x40 MLOAD PUSH3 0x461BCD PUSH1 0xE5 SHL DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x9 PUSH1 0x24 DUP3 ADD MSTORE PUSH9 0x10BA3930B739B332B9 PUSH1 0xB9 SHL PUSH1 0x44 DUP3 ADD MSTORE PUSH1 0x64 ADD PUSH2 0x8EC JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0x3D07 PUSH1 0xCF DUP9 PUSH2 0x21F2 JUMP JUMPDEST SWAP1 POP PUSH2 0x3D12 DUP2 PUSH2 0x2054 JUMP JUMPDEST DUP8 SWAP1 PUSH2 0x3D32 JUMPI PUSH1 0x40 MLOAD PUSH4 0x1EB5FF95 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP2 SWAP1 PUSH2 0x5048 JUMP JUMPDEST POP PUSH1 0x0 PUSH2 0x3D4A PUSH1 0xD2 SLOAD DUP4 PUSH2 0x3300 SWAP1 SWAP2 SWAP1 PUSH4 0xFFFFFFFF AND JUMP JUMPDEST ISZERO DUP1 ISZERO PUSH2 0x3D5D JUMPI POP PUSH2 0x3D5B DUP3 PUSH2 0x333D JUMP JUMPDEST ISZERO JUMPDEST DUP1 ISZERO PUSH2 0x3D68 JUMPI POP DUP7 ISZERO ISZERO JUMPDEST DUP1 ISZERO PUSH2 0x3DE0 JUMPI POP DUP2 PUSH2 0x100 ADD MLOAD PUSH2 0x3D7D PUSH2 0x457A JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0x76671808 PUSH1 0x40 MLOAD DUP2 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP7 GAS STATICCALL ISZERO DUP1 ISZERO PUSH2 0x3DBA JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x3DDE SWAP2 SWAP1 PUSH2 0x5A7D JUMP JUMPDEST GT JUMPDEST PUSH2 0x3DEB JUMPI PUSH1 0x0 PUSH2 0x3E61 JUMP JUMPDEST PUSH2 0x3DF3 PUSH2 0x3706 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0xDB750926 DUP10 PUSH1 0x40 MLOAD DUP3 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x3E1E SWAP2 SWAP1 PUSH2 0x5048 JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 GAS CALL ISZERO DUP1 ISZERO PUSH2 0x3E3D JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x3E61 SWAP2 SWAP1 PUSH2 0x5A7D JUMP JUMPDEST SWAP1 POP PUSH2 0x3EA0 DUP9 PUSH2 0x3E6F PUSH2 0x3706 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0xEEAC3E0E DUP6 PUSH1 0x20 ADD MLOAD PUSH1 0x40 MLOAD DUP3 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x22C3 SWAP2 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 JUMP JUMPDEST PUSH2 0x3EAB PUSH1 0xCF DUP10 PUSH2 0x490D JUMP JUMPDEST PUSH2 0x3EB6 PUSH1 0xCF DUP10 PUSH2 0x49C3 JUMP JUMPDEST PUSH1 0x0 DUP1 DUP3 ISZERO PUSH2 0x41EF JUMPI PUSH1 0x0 PUSH2 0x3EC9 PUSH2 0x1B69 JUMP JUMPDEST DUP6 MLOAD PUSH1 0x40 MLOAD PUSH4 0x7573EF4F PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB SWAP3 SWAP1 SWAP3 AND SWAP2 PUSH4 0x7573EF4F SWAP2 PUSH2 0x3EFC SWAP2 ADDRESS SWAP1 PUSH1 0x2 SWAP1 PUSH1 0x4 ADD PUSH2 0x5E87 JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP7 GAS STATICCALL ISZERO DUP1 ISZERO PUSH2 0x3F19 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x3F3D SWAP2 SWAP1 PUSH2 0x5A7D JUMP JUMPDEST SWAP1 POP PUSH1 0x0 PUSH2 0x3F49 PUSH2 0x1B69 JUMP JUMPDEST DUP7 MLOAD PUSH1 0x40 MLOAD PUSH4 0x1584A179 PUSH1 0xE2 SHL DUP2 MSTORE PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB SWAP3 SWAP1 SWAP3 AND SWAP2 PUSH4 0x561285E4 SWAP2 PUSH2 0x3F79 SWAP2 ADDRESS SWAP1 PUSH1 0x4 ADD PUSH2 0x5515 JUMP JUMPDEST PUSH1 0xA0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP7 GAS STATICCALL ISZERO DUP1 ISZERO PUSH2 0x3F96 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x3FBA SWAP2 SWAP1 PUSH2 0x5EAC JUMP JUMPDEST SWAP1 POP PUSH1 0x0 DUP2 PUSH1 0x20 ADD MLOAD GT PUSH2 0x3FCF JUMPI PUSH1 0x0 PUSH2 0x3FD9 JUMP JUMPDEST PUSH2 0x3FD9 DUP6 DUP4 PUSH2 0x4A7A JUMP JUMPDEST SWAP3 POP DUP3 ISZERO PUSH2 0x40CE JUMPI PUSH2 0x3FE9 PUSH2 0x3A62 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0x95EA7B3 PUSH2 0x3FFF PUSH2 0x1B69 JUMP JUMPDEST DUP6 PUSH1 0x40 MLOAD DUP4 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x401D SWAP3 SWAP2 SWAP1 PUSH2 0x5AD0 JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 GAS CALL ISZERO DUP1 ISZERO PUSH2 0x403C JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x4060 SWAP2 SWAP1 PUSH2 0x54F8 JUMP JUMPDEST POP PUSH2 0x4069 PUSH2 0x1B69 JUMP JUMPDEST DUP7 MLOAD PUSH1 0x40 MLOAD PUSH4 0xCA94B0E9 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB SWAP3 SWAP1 SWAP3 AND SWAP2 PUSH4 0xCA94B0E9 SWAP2 PUSH2 0x409B SWAP2 ADDRESS SWAP1 DUP9 SWAP1 PUSH1 0x4 ADD PUSH2 0x5F1F JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x40B5 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x40C9 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP JUMPDEST PUSH2 0x40D8 DUP4 DUP7 PUSH2 0x5845 JUMP JUMPDEST SWAP4 POP DUP4 ISZERO PUSH2 0x41EC JUMPI PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP9 AND PUSH2 0x41DF JUMPI PUSH2 0x40F6 PUSH2 0x3A62 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0x95EA7B3 PUSH2 0x410C PUSH2 0x1B69 JUMP JUMPDEST DUP7 PUSH1 0x40 MLOAD DUP4 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x412A SWAP3 SWAP2 SWAP1 PUSH2 0x5AD0 JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 GAS CALL ISZERO DUP1 ISZERO PUSH2 0x4149 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x416D SWAP2 SWAP1 PUSH2 0x54F8 JUMP JUMPDEST POP PUSH2 0x4176 PUSH2 0x1B69 JUMP JUMPDEST DUP7 MLOAD PUSH1 0x40 MLOAD PUSH4 0x3A309049 PUSH1 0xE1 SHL DUP2 MSTORE PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB SWAP3 SWAP1 SWAP3 AND SWAP2 PUSH4 0x74612092 SWAP2 PUSH2 0x41A8 SWAP2 ADDRESS SWAP1 DUP10 SWAP1 PUSH1 0x4 ADD PUSH2 0x5F1F JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x41C2 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x41D6 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH2 0x41EC JUMP JUMPDEST PUSH2 0x41EC DUP9 DUP6 PUSH2 0x2D3C PUSH2 0x3A62 JUMP JUMPDEST POP POP JUMPDEST PUSH1 0x20 DUP5 ADD MLOAD DUP5 MLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP1 DUP14 AND SWAP2 AND PUSH32 0x443F56BD2098D273B8C8120398789A41DA5925DB4BA2F656813FC5299AC57B1F DUP7 DUP7 DUP7 DUP16 DUP16 PUSH2 0x4231 PUSH2 0x457A JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0x76671808 PUSH1 0x40 MLOAD DUP2 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP7 GAS STATICCALL ISZERO DUP1 ISZERO PUSH2 0x426E JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x4292 SWAP2 SWAP1 PUSH2 0x5A7D JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x42A4 SWAP7 SWAP6 SWAP5 SWAP4 SWAP3 SWAP2 SWAP1 PUSH2 0x5F43 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG4 DUP4 MLOAD PUSH2 0x42B8 SWAP1 DUP9 PUSH2 0x2EC1 JUMP JUMPDEST ISZERO PUSH2 0x42C8 JUMPI PUSH2 0x42C8 DUP11 PUSH1 0x1 PUSH2 0x2277 JUMP JUMPDEST POP SWAP1 SWAP9 SWAP8 POP POP POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 DUP5 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND PUSH4 0x872D0489 DUP6 ADDRESS DUP7 PUSH1 0x40 MLOAD DUP5 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x4309 SWAP4 SWAP3 SWAP2 SWAP1 PUSH2 0x5D95 JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP7 GAS STATICCALL ISZERO DUP1 ISZERO PUSH2 0x4326 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x434A SWAP2 SWAP1 PUSH2 0x5A7D JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP6 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x20 DUP9 SWAP1 MSTORE PUSH1 0x40 SWAP1 KECCAK256 SLOAD GT ISZERO SWAP2 POP POP SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH2 0x4378 PUSH2 0x4ADA JUMP JUMPDEST PUSH2 0xACD JUMPI PUSH1 0x40 MLOAD PUSH4 0x1AFCD79F PUSH1 0xE3 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH2 0x1AB0 PUSH2 0x4370 JUMP JUMPDEST PUSH2 0x43A5 PUSH2 0x4370 JUMP JUMPDEST PUSH2 0x43B2 PUSH1 0x0 PUSH1 0x0 NOT PUSH2 0x26D7 JUMP JUMPDEST PUSH2 0x43C0 PUSH1 0x0 PUSH3 0xF4240 PUSH2 0x4AF4 JUMP JUMPDEST PUSH2 0x43D2 PUSH1 0x0 PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB PUSH2 0x4BC5 JUMP JUMPDEST PUSH2 0xACD PUSH4 0xFFFFFFFF PUSH2 0x1B15 JUMP JUMPDEST PUSH2 0x43E7 PUSH2 0x4370 JUMP JUMPDEST PUSH2 0xA8F DUP3 DUP3 PUSH2 0x4C52 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x43FC DUP4 PUSH2 0x1B8D JUMP JUMPDEST SWAP1 POP PUSH2 0xD3C DUP2 DUP4 PUSH2 0x1CCE JUMP JUMPDEST PUSH1 0x0 PUSH2 0x12B8 PUSH2 0x4415 PUSH2 0x4C93 JUMP JUMPDEST DUP4 PUSH1 0x40 MLOAD PUSH2 0x1901 PUSH1 0xF0 SHL DUP2 MSTORE PUSH1 0x2 DUP2 ADD SWAP3 SWAP1 SWAP3 MSTORE PUSH1 0x22 DUP3 ADD MSTORE PUSH1 0x42 SWAP1 KECCAK256 SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x444A PUSH2 0x4444 DUP6 DUP6 PUSH2 0x3076 JUMP JUMPDEST DUP4 PUSH2 0x4C9D JUMP JUMPDEST SWAP1 POP DUP1 DUP4 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP1 DUP4 AND SWAP1 DUP3 AND EQ PUSH2 0x447C JUMPI PUSH1 0x40 MLOAD PUSH4 0x8C5B935D PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP3 SWAP2 SWAP1 PUSH2 0x5515 JUMP JUMPDEST POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP1 DUP3 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x20 DUP6 DUP2 MSTORE PUSH1 0x40 SWAP2 DUP3 SWAP1 KECCAK256 DUP3 MLOAD DUP1 DUP5 ADD SWAP1 SWAP4 MSTORE DUP1 SLOAD SWAP1 SWAP4 AND DUP3 MSTORE PUSH1 0x1 SWAP1 SWAP3 ADD SLOAD SWAP2 DUP2 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH2 0x44C4 SWAP1 PUSH2 0x4842 JUMP JUMPDEST ISZERO DUP2 SWAP1 PUSH2 0x44E5 JUMPI PUSH1 0x40 MLOAD PUSH4 0x2D7D25F1 PUSH1 0xE2 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP2 SWAP1 PUSH2 0x5048 JUMP JUMPDEST POP PUSH1 0x40 MLOAD PUSH4 0x78EB06B3 PUSH1 0xE1 SHL DUP2 MSTORE PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP4 AND SWAP1 PUSH4 0xF1D60D66 SWAP1 PUSH2 0x4512 SWAP1 DUP5 SWAP1 PUSH1 0x4 ADD PUSH2 0x5048 JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP7 GAS STATICCALL ISZERO DUP1 ISZERO PUSH2 0x452F JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x4553 SWAP2 SWAP1 PUSH2 0x54F8 JUMP JUMPDEST ISZERO DUP2 SWAP1 PUSH2 0x4574 JUMPI PUSH1 0x40 MLOAD PUSH4 0x2D7D25F1 PUSH1 0xE2 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP2 SWAP1 PUSH2 0x5048 JUMP JUMPDEST POP POP POP POP JUMP JUMPDEST PUSH32 0x0 SWAP1 JUMP JUMPDEST PUSH2 0x45A6 PUSH2 0x4FAE JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP1 DUP8 AND PUSH1 0x0 SWAP1 DUP2 MSTORE PUSH1 0x20 DUP11 DUP2 MSTORE PUSH1 0x40 SWAP2 DUP3 SWAP1 KECCAK256 DUP3 MLOAD PUSH2 0x120 DUP2 ADD DUP5 MSTORE DUP2 SLOAD SWAP1 SWAP5 AND DUP5 MSTORE PUSH1 0x1 DUP2 ADD SLOAD SWAP2 DUP5 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH1 0x2 DUP2 ADD SLOAD SWAP2 DUP4 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH1 0x3 DUP2 ADD SLOAD PUSH1 0x60 DUP4 ADD MSTORE PUSH1 0x4 DUP2 ADD SLOAD PUSH1 0x80 DUP4 ADD MSTORE PUSH1 0x5 DUP2 ADD SLOAD PUSH1 0xA0 DUP4 ADD MSTORE PUSH1 0x6 DUP2 ADD SLOAD PUSH1 0xC0 DUP4 ADD MSTORE PUSH1 0x7 DUP2 ADD SLOAD PUSH1 0xE0 DUP4 ADD MSTORE PUSH1 0x8 ADD SLOAD PUSH2 0x100 DUP3 ADD MSTORE PUSH2 0x4632 SWAP1 PUSH1 0x60 ADD MLOAD ISZERO ISZERO SWAP1 JUMP JUMPDEST ISZERO DUP7 SWAP1 PUSH2 0x4653 JUMPI PUSH1 0x40 MLOAD PUSH4 0xBC4DEF5 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP2 SWAP1 PUSH2 0x5048 JUMP JUMPDEST POP POP PUSH1 0x40 DUP1 MLOAD PUSH2 0x120 DUP2 ADD DUP3 MSTORE PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB SWAP8 DUP9 AND DUP2 MSTORE PUSH1 0x20 DUP1 DUP3 ADD SWAP7 DUP8 MSTORE DUP2 DUP4 ADD SWAP6 DUP7 MSTORE TIMESTAMP PUSH1 0x60 DUP4 ADD SWAP1 DUP2 MSTORE PUSH1 0x0 PUSH1 0x80 DUP5 ADD DUP2 DUP2 MSTORE PUSH1 0xA0 DUP6 ADD DUP3 DUP2 MSTORE PUSH1 0xC0 DUP7 ADD SWAP9 DUP10 MSTORE PUSH1 0xE0 DUP7 ADD DUP4 DUP2 MSTORE PUSH2 0x100 DUP8 ADD SWAP9 DUP10 MSTORE SWAP12 DUP14 AND DUP4 MSTORE SWAP13 SWAP1 SWAP4 MSTORE SWAP4 SWAP1 SWAP4 KECCAK256 DUP3 MLOAD DUP2 SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB NOT AND SWAP11 AND SWAP10 SWAP1 SWAP10 OR DUP10 SSTORE SWAP6 MLOAD PUSH1 0x1 DUP10 ADD SSTORE SWAP4 MLOAD PUSH1 0x2 DUP9 ADD SSTORE MLOAD PUSH1 0x3 DUP8 ADD SSTORE SWAP3 MLOAD PUSH1 0x4 DUP7 ADD SSTORE SWAP5 MLOAD PUSH1 0x5 DUP6 ADD SSTORE SWAP4 MLOAD PUSH1 0x6 DUP5 ADD SSTORE SWAP1 MLOAD PUSH1 0x7 DUP4 ADD SSTORE MLOAD PUSH1 0x8 SWAP1 SWAP2 ADD SSTORE SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 XOR DUP3 DUP5 GT MUL DUP3 XOR PUSH2 0x186C JUMP JUMPDEST PUSH1 0x0 DUP3 DUP5 LT ISZERO DUP1 ISZERO PUSH2 0x3335 JUMPI POP POP SWAP1 SWAP2 GT ISZERO SWAP2 SWAP1 POP JUMP JUMPDEST PUSH2 0x475B PUSH1 0x40 MLOAD DUP1 PUSH1 0x80 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP1 NOT AND DUP2 MSTORE POP SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP3 DUP2 MSTORE PUSH1 0x9B PUSH1 0x20 SWAP1 DUP2 MSTORE PUSH1 0x40 SWAP2 DUP3 SWAP1 KECCAK256 DUP3 MLOAD PUSH1 0x80 DUP2 ADD DUP5 MSTORE DUP2 SLOAD DUP2 MSTORE PUSH1 0x1 DUP3 ADD SLOAD SWAP3 DUP2 ADD DUP4 SWAP1 MSTORE PUSH1 0x2 DUP3 ADD SLOAD SWAP4 DUP2 ADD SWAP4 SWAP1 SWAP4 MSTORE PUSH1 0x3 ADD SLOAD PUSH1 0x60 DUP4 ADD MSTORE DUP4 SWAP1 PUSH2 0x1C89 JUMPI PUSH1 0x40 MLOAD PUSH4 0x107349A9 PUSH1 0xE2 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP2 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP1 DUP5 PUSH1 0x3 ADD SLOAD GT PUSH2 0x47E1 JUMPI PUSH1 0x40 MLOAD PUSH4 0xDDAF8F21 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x47F4 DUP6 PUSH1 0x0 ADD SLOAD DUP6 PUSH4 0xFFFFFFFF AND JUMP JUMPDEST SWAP1 POP PUSH2 0x4807 DUP6 PUSH1 0x0 ADD SLOAD DUP5 PUSH4 0xFFFFFFFF AND JUMP JUMPDEST PUSH1 0x1 DUP6 PUSH1 0x3 ADD PUSH1 0x0 DUP3 DUP3 SLOAD PUSH2 0x481C SWAP2 SWAP1 PUSH2 0x5845 JUMP JUMPDEST SWAP1 SWAP2 SSTORE POP POP DUP1 DUP6 SSTORE PUSH1 0x3 DUP6 ADD SLOAD PUSH1 0x0 SUB PUSH2 0x4838 JUMPI PUSH1 0x0 PUSH1 0x1 DUP7 ADD SSTORE JUMPDEST POP POP SWAP2 SLOAD SWAP3 SWAP2 POP POP JUMP JUMPDEST MLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND ISZERO ISZERO SWAP1 JUMP JUMPDEST DUP1 MLOAD ISZERO PUSH2 0x4861 JUMPI DUP1 MLOAD DUP1 DUP3 PUSH1 0x20 ADD REVERT JUMPDEST PUSH1 0x40 MLOAD PUSH4 0xD6BDA275 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH2 0x2710 DUP3 PUSH1 0x3 ADD SLOAD LT PUSH2 0x48A0 JUMPI PUSH1 0x40 MLOAD PUSH4 0x3A8C56B PUSH1 0xE6 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST DUP1 PUSH2 0x48BE JUMPI PUSH1 0x40 MLOAD PUSH4 0x8F4A893D PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x1 DUP1 DUP4 ADD DUP3 SWAP1 SSTORE PUSH1 0x2 DUP4 ADD DUP1 SLOAD PUSH1 0x0 SWAP1 PUSH2 0x48DA SWAP1 DUP5 SWAP1 PUSH2 0x5AE9 JUMP JUMPDEST SWAP1 SWAP2 SSTORE POP POP PUSH1 0x3 DUP3 ADD SLOAD PUSH1 0x0 SUB PUSH2 0x48EF JUMPI DUP1 DUP3 SSTORE JUMPDEST PUSH1 0x1 DUP3 PUSH1 0x3 ADD PUSH1 0x0 DUP3 DUP3 SLOAD PUSH2 0x4904 SWAP2 SWAP1 PUSH2 0x5AE9 JUMP JUMPDEST SWAP1 SWAP2 SSTORE POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x4919 DUP4 DUP4 PUSH2 0x3653 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH2 0x120 DUP2 ADD DUP3 MSTORE DUP3 SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND DUP2 MSTORE PUSH1 0x1 DUP4 ADD SLOAD PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x2 DUP4 ADD SLOAD SWAP2 DUP2 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH1 0x3 DUP3 ADD SLOAD PUSH1 0x60 DUP3 ADD MSTORE PUSH1 0x4 DUP3 ADD SLOAD PUSH1 0x80 DUP3 ADD MSTORE PUSH1 0x5 DUP3 ADD SLOAD PUSH1 0xA0 DUP3 ADD MSTORE PUSH1 0x6 DUP3 ADD SLOAD PUSH1 0xC0 DUP3 ADD MSTORE PUSH1 0x7 DUP3 ADD SLOAD PUSH1 0xE0 DUP3 ADD MSTORE PUSH1 0x8 DUP3 ADD SLOAD PUSH2 0x100 DUP3 ADD MSTORE SWAP1 SWAP2 POP PUSH2 0x4990 SWAP1 PUSH2 0x2054 JUMP JUMPDEST PUSH1 0x4 DUP3 ADD SLOAD DUP4 SWAP2 PUSH2 0x49B6 JUMPI PUSH1 0x40 MLOAD PUSH4 0x61B66E0D PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP3 SWAP2 SWAP1 PUSH2 0x5AD0 JUMP JUMPDEST POP POP TIMESTAMP PUSH1 0x5 SWAP1 SWAP2 ADD SSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x49CF DUP4 DUP4 PUSH2 0x3653 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH2 0x120 DUP2 ADD DUP3 MSTORE DUP3 SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND DUP2 MSTORE PUSH1 0x1 DUP4 ADD SLOAD PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x2 DUP4 ADD SLOAD SWAP2 DUP2 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH1 0x3 DUP3 ADD SLOAD PUSH1 0x60 DUP3 ADD MSTORE PUSH1 0x4 DUP3 ADD SLOAD PUSH1 0x80 DUP3 ADD MSTORE PUSH1 0x5 DUP3 ADD SLOAD PUSH1 0xA0 DUP3 ADD MSTORE PUSH1 0x6 DUP3 ADD SLOAD PUSH1 0xC0 DUP3 ADD MSTORE PUSH1 0x7 DUP3 ADD SLOAD PUSH1 0xE0 DUP3 ADD MSTORE PUSH1 0x8 DUP3 ADD SLOAD PUSH2 0x100 DUP3 ADD MSTORE SWAP1 SWAP2 POP PUSH2 0x4A46 SWAP1 PUSH2 0x2054 JUMP JUMPDEST PUSH1 0x4 DUP3 ADD SLOAD DUP4 SWAP2 PUSH2 0x4A6C JUMPI PUSH1 0x40 MLOAD PUSH4 0x61B66E0D PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP3 SWAP2 SWAP1 PUSH2 0x5AD0 JUMP JUMPDEST POP POP PUSH1 0x0 PUSH1 0x7 SWAP1 SWAP2 ADD SSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x4A89 DUP4 PUSH3 0xF4240 LT ISZERO SWAP1 JUMP JUMPDEST DUP1 PUSH2 0x4A9C JUMPI POP PUSH2 0x4A9C DUP3 PUSH3 0xF4240 LT ISZERO SWAP1 JUMP JUMPDEST DUP4 DUP4 SWAP1 SWAP2 PUSH2 0x4ABF JUMPI PUSH1 0x40 MLOAD PUSH4 0x768BF0EB PUSH1 0xE1 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP3 SWAP2 SWAP1 PUSH2 0x5277 JUMP JUMPDEST POP PUSH3 0xF4240 SWAP1 POP PUSH2 0x4AD0 DUP4 DUP6 PUSH2 0x5CA1 JUMP JUMPDEST PUSH2 0x186C SWAP2 SWAP1 PUSH2 0x5F81 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x4AE4 PUSH2 0x2F04 JUMP JUMPDEST SLOAD PUSH1 0x1 PUSH1 0x40 SHL SWAP1 DIV PUSH1 0xFF AND SWAP2 SWAP1 POP JUMP JUMPDEST DUP2 DUP2 PUSH4 0xFFFFFFFF DUP1 DUP3 AND SWAP1 DUP4 AND GT ISZERO PUSH2 0x4B22 JUMPI PUSH1 0x40 MLOAD PUSH4 0xCCCCDAFB PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP3 SWAP2 SWAP1 PUSH2 0x5180 JUMP JUMPDEST POP DUP3 SWAP1 POP DUP2 PUSH4 0xFFFFFFFF DUP2 AND PUSH3 0xF4240 LT ISZERO PUSH2 0x4B53 JUMPI PUSH1 0x40 MLOAD PUSH4 0xCCCCDAFB PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP3 SWAP2 SWAP1 PUSH2 0x5180 JUMP JUMPDEST POP POP PUSH1 0x2 DUP1 SLOAD PUSH4 0xFFFFFFFF DUP4 DUP2 AND PUSH1 0x1 PUSH1 0xA0 SHL MUL PUSH4 0xFFFFFFFF PUSH1 0xA0 SHL NOT SWAP2 DUP7 AND PUSH1 0x1 PUSH1 0x80 SHL MUL SWAP2 SWAP1 SWAP2 AND PUSH1 0x1 PUSH1 0x80 SHL PUSH1 0x1 PUSH1 0xC0 SHL SUB NOT SWAP1 SWAP3 AND SWAP2 SWAP1 SWAP2 OR OR SWAP1 SSTORE PUSH1 0x40 MLOAD PUSH32 0x2FE5A7039987697813605CC0B9D6DB7AAB575408E3FC59E8A457BEF8D7BC0A36 SWAP1 PUSH2 0x273A SWAP1 DUP5 SWAP1 DUP5 SWAP1 PUSH2 0x5180 JUMP JUMPDEST DUP2 DUP2 PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP1 DUP3 AND SWAP1 DUP4 AND GT ISZERO PUSH2 0x4BF6 JUMPI PUSH1 0x40 MLOAD PUSH4 0xCCCCDAFB PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8EC SWAP3 SWAP2 SWAP1 PUSH2 0x521C JUMP JUMPDEST POP POP PUSH1 0x2 DUP1 SLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP4 DUP2 AND PUSH1 0x1 PUSH1 0x40 SHL MUL PUSH1 0x1 PUSH1 0x1 PUSH1 0x80 SHL SUB NOT SWAP1 SWAP3 AND SWAP1 DUP6 AND OR OR SWAP1 SSTORE PUSH1 0x40 MLOAD PUSH32 0x2867E04C500E438761486B78021D4F9EB97C77FF45D10C1183F5583BA4CBF7D1 SWAP1 PUSH2 0x273A SWAP1 DUP5 SWAP1 DUP5 SWAP1 PUSH2 0x521C JUMP JUMPDEST PUSH2 0x4C5A PUSH2 0x4370 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x4C64 PUSH2 0x278D JUMP JUMPDEST SWAP1 POP PUSH1 0x2 DUP2 ADD PUSH2 0x4C74 DUP5 DUP3 PUSH2 0x5742 JUMP JUMPDEST POP PUSH1 0x3 DUP2 ADD PUSH2 0x4C83 DUP4 DUP3 PUSH2 0x5742 JUMP JUMPDEST POP PUSH1 0x0 DUP1 DUP3 SSTORE PUSH1 0x1 SWAP1 SWAP2 ADD SSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x84B PUSH2 0x4CC7 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH2 0x4CAD DUP7 DUP7 PUSH2 0x4D3B JUMP JUMPDEST SWAP3 POP SWAP3 POP SWAP3 POP PUSH2 0x4CBD DUP3 DUP3 PUSH2 0x4D88 JUMP JUMPDEST POP SWAP1 SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH32 0x8B73C3C69BB8FE3D512ECC4CF759CC79239F7B179B0FFACAA9A75D522B39400F PUSH2 0x4CF2 PUSH2 0x4E41 JUMP JUMPDEST PUSH2 0x4CFA PUSH2 0x4EA8 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 DUP2 ADD SWAP5 SWAP1 SWAP5 MSTORE DUP4 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH1 0x60 DUP3 ADD MSTORE CHAINID PUSH1 0x80 DUP3 ADD MSTORE ADDRESS PUSH1 0xA0 DUP3 ADD MSTORE PUSH1 0xC0 ADD PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 DUP4 SUB SUB DUP2 MSTORE SWAP1 PUSH1 0x40 MSTORE DUP1 MLOAD SWAP1 PUSH1 0x20 ADD KECCAK256 SWAP1 POP SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP4 MLOAD PUSH1 0x41 SUB PUSH2 0x4D75 JUMPI PUSH1 0x20 DUP5 ADD MLOAD PUSH1 0x40 DUP6 ADD MLOAD PUSH1 0x60 DUP7 ADD MLOAD PUSH1 0x0 BYTE PUSH2 0x4D67 DUP9 DUP3 DUP6 DUP6 PUSH2 0x4EE9 JUMP JUMPDEST SWAP6 POP SWAP6 POP SWAP6 POP POP POP POP PUSH2 0x4D81 JUMP JUMPDEST POP POP DUP2 MLOAD PUSH1 0x0 SWAP2 POP PUSH1 0x2 SWAP1 JUMPDEST SWAP3 POP SWAP3 POP SWAP3 JUMP JUMPDEST PUSH1 0x0 DUP3 PUSH1 0x3 DUP2 GT ISZERO PUSH2 0x4D9C JUMPI PUSH2 0x4D9C PUSH2 0x58DB JUMP JUMPDEST SUB PUSH2 0x4DA5 JUMPI POP POP JUMP JUMPDEST PUSH1 0x1 DUP3 PUSH1 0x3 DUP2 GT ISZERO PUSH2 0x4DB9 JUMPI PUSH2 0x4DB9 PUSH2 0x58DB JUMP JUMPDEST SUB PUSH2 0x4DD7 JUMPI PUSH1 0x40 MLOAD PUSH4 0xF645EEDF PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x2 DUP3 PUSH1 0x3 DUP2 GT ISZERO PUSH2 0x4DEB JUMPI PUSH2 0x4DEB PUSH2 0x58DB JUMP JUMPDEST SUB PUSH2 0x4E0C JUMPI PUSH1 0x40 MLOAD PUSH4 0xFCE698F7 PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 DUP2 ADD DUP3 SWAP1 MSTORE PUSH1 0x24 ADD PUSH2 0x8EC JUMP JUMPDEST PUSH1 0x3 DUP3 PUSH1 0x3 DUP2 GT ISZERO PUSH2 0x4E20 JUMPI PUSH2 0x4E20 PUSH2 0x58DB JUMP JUMPDEST SUB PUSH2 0xA8F JUMPI PUSH1 0x40 MLOAD PUSH4 0x35E2F383 PUSH1 0xE2 SHL DUP2 MSTORE PUSH1 0x4 DUP2 ADD DUP3 SWAP1 MSTORE PUSH1 0x24 ADD PUSH2 0x8EC JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0x4E4C PUSH2 0x278D JUMP JUMPDEST SWAP1 POP PUSH1 0x0 PUSH2 0x4E58 PUSH2 0x27B1 JUMP JUMPDEST DUP1 MLOAD SWAP1 SWAP2 POP ISZERO PUSH2 0x4E70 JUMPI DUP1 MLOAD PUSH1 0x20 SWAP1 SWAP2 ADD KECCAK256 SWAP3 SWAP2 POP POP JUMP JUMPDEST DUP2 SLOAD DUP1 ISZERO PUSH2 0x4E7F JUMPI SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH32 0xC5D2460186F7233C927E7DB2DCC703C0E500B653CA82273B7BFAD8045D85A470 SWAP4 POP POP POP POP SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0x4EB3 PUSH2 0x278D JUMP JUMPDEST SWAP1 POP PUSH1 0x0 PUSH2 0x4EBF PUSH2 0x2852 JUMP JUMPDEST DUP1 MLOAD SWAP1 SWAP2 POP ISZERO PUSH2 0x4ED7 JUMPI DUP1 MLOAD PUSH1 0x20 SWAP1 SWAP2 ADD KECCAK256 SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x1 DUP3 ADD SLOAD DUP1 ISZERO PUSH2 0x4E7F JUMPI SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 DUP1 PUSH16 0xA2A8918CA85BAFE22016D0B997E4DF60 PUSH1 0x1 PUSH1 0xFF SHL SUB DUP5 GT ISZERO PUSH2 0x4F1A JUMPI POP PUSH1 0x0 SWAP2 POP PUSH1 0x3 SWAP1 POP DUP3 PUSH2 0x4FA4 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0x0 DUP1 DUP3 MSTORE PUSH1 0x20 DUP3 ADD DUP1 DUP5 MSTORE DUP11 SWAP1 MSTORE PUSH1 0xFF DUP10 AND SWAP3 DUP3 ADD SWAP3 SWAP1 SWAP3 MSTORE PUSH1 0x60 DUP2 ADD DUP8 SWAP1 MSTORE PUSH1 0x80 DUP2 ADD DUP7 SWAP1 MSTORE PUSH1 0x1 SWAP1 PUSH1 0xA0 ADD PUSH1 0x20 PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 SUB SWAP1 DUP1 DUP5 SUB SWAP1 DUP6 GAS STATICCALL ISZERO DUP1 ISZERO PUSH2 0x4F6E JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP PUSH1 0x40 MLOAD PUSH1 0x1F NOT ADD MLOAD SWAP2 POP POP PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP2 AND PUSH2 0x4F9A JUMPI POP PUSH1 0x0 SWAP3 POP PUSH1 0x1 SWAP2 POP DUP3 SWAP1 POP PUSH2 0x4FA4 JUMP JUMPDEST SWAP3 POP PUSH1 0x0 SWAP2 POP DUP2 SWAP1 POP JUMPDEST SWAP5 POP SWAP5 POP SWAP5 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 PUSH2 0x120 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x0 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP1 NOT AND DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP2 MSTORE POP SWAP1 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP2 AND DUP2 EQ PUSH2 0x848 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP1 CALLDATALOAD PUSH2 0x5026 DUP2 PUSH2 0x5006 JUMP JUMPDEST SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x503D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD PUSH2 0x186C DUP2 PUSH2 0x5006 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB SWAP2 SWAP1 SWAP2 AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 JUMP JUMPDEST PUSH4 0xFFFFFFFF DUP2 AND DUP2 EQ PUSH2 0x848 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x5080 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD PUSH2 0x186C DUP2 PUSH2 0x505C JUMP JUMPDEST PUSH1 0x0 DUP1 DUP4 PUSH1 0x1F DUP5 ADD SLT PUSH2 0x509D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP DUP2 CALLDATALOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP2 GT ISZERO PUSH2 0x50B4 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x20 DUP4 ADD SWAP2 POP DUP4 PUSH1 0x20 DUP3 DUP6 ADD ADD GT ISZERO PUSH2 0x34BE JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH1 0x40 DUP5 DUP7 SUB SLT ISZERO PUSH2 0x50E1 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP4 CALLDATALOAD PUSH2 0x50EC DUP2 PUSH2 0x5006 JUMP JUMPDEST SWAP3 POP PUSH1 0x20 DUP5 ADD CALLDATALOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP2 GT ISZERO PUSH2 0x5107 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x5113 DUP7 DUP3 DUP8 ADD PUSH2 0x508B JUMP JUMPDEST SWAP5 SWAP8 SWAP1 SWAP7 POP SWAP4 SWAP5 POP POP POP POP JUMP JUMPDEST DUP1 ISZERO ISZERO DUP2 EQ PUSH2 0x848 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x5141 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 CALLDATALOAD PUSH2 0x514C DUP2 PUSH2 0x5006 JUMP JUMPDEST SWAP2 POP PUSH1 0x20 DUP4 ADD CALLDATALOAD PUSH2 0x515C DUP2 PUSH2 0x5120 JUMP JUMPDEST DUP1 SWAP2 POP POP SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x5179 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP CALLDATALOAD SWAP2 SWAP1 POP JUMP JUMPDEST PUSH4 0xFFFFFFFF SWAP3 DUP4 AND DUP2 MSTORE SWAP2 AND PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x51B2 JUMPI DUP2 DUP2 ADD MLOAD DUP4 DUP3 ADD MSTORE PUSH1 0x20 ADD PUSH2 0x519A JUMP JUMPDEST POP POP PUSH1 0x0 SWAP2 ADD MSTORE JUMP JUMPDEST PUSH1 0x0 DUP2 MLOAD DUP1 DUP5 MSTORE PUSH2 0x51D3 DUP2 PUSH1 0x20 DUP7 ADD PUSH1 0x20 DUP7 ADD PUSH2 0x5197 JUMP JUMPDEST PUSH1 0x1F ADD PUSH1 0x1F NOT AND SWAP3 SWAP1 SWAP3 ADD PUSH1 0x20 ADD SWAP3 SWAP2 POP POP JUMP JUMPDEST DUP4 DUP2 MSTORE PUSH1 0x60 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x0 PUSH2 0x5200 PUSH1 0x60 DUP4 ADD DUP6 PUSH2 0x51BB JUMP JUMPDEST DUP3 DUP2 SUB PUSH1 0x40 DUP5 ADD MSTORE PUSH2 0x5212 DUP2 DUP6 PUSH2 0x51BB JUMP JUMPDEST SWAP7 SWAP6 POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB SWAP3 DUP4 AND DUP2 MSTORE SWAP2 AND PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH1 0x60 DUP5 DUP7 SUB SLT ISZERO PUSH2 0x524B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP4 CALLDATALOAD PUSH2 0x5256 DUP2 PUSH2 0x5006 JUMP JUMPDEST SWAP3 POP PUSH1 0x20 DUP5 ADD CALLDATALOAD PUSH2 0x5266 DUP2 PUSH2 0x5006 JUMP JUMPDEST SWAP3 SWAP6 SWAP3 SWAP5 POP POP POP PUSH1 0x40 SWAP2 SWAP1 SWAP2 ADD CALLDATALOAD SWAP1 JUMP JUMPDEST SWAP2 DUP3 MSTORE PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH1 0xFF PUSH1 0xF8 SHL DUP9 AND DUP2 MSTORE PUSH1 0xE0 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x0 PUSH2 0x52A4 PUSH1 0xE0 DUP4 ADD DUP10 PUSH2 0x51BB JUMP JUMPDEST DUP3 DUP2 SUB PUSH1 0x40 DUP5 ADD MSTORE PUSH2 0x52B6 DUP2 DUP10 PUSH2 0x51BB JUMP JUMPDEST PUSH1 0x60 DUP5 ADD DUP9 SWAP1 MSTORE PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP8 AND PUSH1 0x80 DUP6 ADD MSTORE PUSH1 0xA0 DUP5 ADD DUP7 SWAP1 MSTORE DUP4 DUP2 SUB PUSH1 0xC0 DUP6 ADD MSTORE DUP5 MLOAD DUP1 DUP3 MSTORE PUSH1 0x20 DUP1 DUP8 ADD SWAP4 POP SWAP1 SWAP2 ADD SWAP1 PUSH1 0x0 JUMPDEST DUP2 DUP2 LT ISZERO PUSH2 0x530C JUMPI DUP4 MLOAD DUP4 MSTORE PUSH1 0x20 SWAP4 DUP5 ADD SWAP4 SWAP1 SWAP3 ADD SWAP2 PUSH1 0x1 ADD PUSH2 0x52EE JUMP JUMPDEST POP SWAP1 SWAP12 SWAP11 POP POP POP POP POP POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x20 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x5330 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 CALLDATALOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP2 GT ISZERO PUSH2 0x5346 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP4 ADD PUSH1 0x1F DUP2 ADD DUP6 SGT PUSH2 0x5357 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP1 CALLDATALOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP2 GT ISZERO PUSH2 0x536D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP6 PUSH1 0x20 DUP3 PUSH1 0x5 SHL DUP5 ADD ADD GT ISZERO PUSH2 0x5382 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x20 SWAP2 SWAP1 SWAP2 ADD SWAP6 SWAP1 SWAP5 POP SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD PUSH1 0x20 DUP4 MSTORE DUP1 DUP5 MLOAD DUP1 DUP4 MSTORE PUSH1 0x40 DUP6 ADD SWAP2 POP PUSH1 0x40 DUP2 PUSH1 0x5 SHL DUP7 ADD ADD SWAP3 POP PUSH1 0x20 DUP7 ADD PUSH1 0x0 JUMPDEST DUP3 DUP2 LT ISZERO PUSH2 0x53EB JUMPI PUSH1 0x3F NOT DUP8 DUP7 SUB ADD DUP5 MSTORE PUSH2 0x53D6 DUP6 DUP4 MLOAD PUSH2 0x51BB JUMP JUMPDEST SWAP5 POP PUSH1 0x20 SWAP4 DUP5 ADD SWAP4 SWAP2 SWAP1 SWAP2 ADD SWAP1 PUSH1 0x1 ADD PUSH2 0x53BA JUMP JUMPDEST POP SWAP3 SWAP7 SWAP6 POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0x60 DUP6 DUP8 SUB SLT ISZERO PUSH2 0x540D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP5 CALLDATALOAD PUSH2 0x5418 DUP2 PUSH2 0x5006 JUMP JUMPDEST SWAP4 POP PUSH1 0x20 DUP6 ADD CALLDATALOAD PUSH1 0x3 DUP2 LT PUSH2 0x542C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST SWAP3 POP PUSH1 0x40 DUP6 ADD CALLDATALOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP2 GT ISZERO PUSH2 0x5447 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x5453 DUP8 DUP3 DUP9 ADD PUSH2 0x508B JUMP JUMPDEST SWAP6 SWAP9 SWAP5 SWAP8 POP SWAP6 POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0x80 DUP6 DUP8 SUB SLT ISZERO PUSH2 0x5475 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP5 CALLDATALOAD PUSH2 0x5480 DUP2 PUSH2 0x5006 JUMP JUMPDEST SWAP4 POP PUSH1 0x20 DUP6 ADD CALLDATALOAD SWAP3 POP PUSH1 0x40 DUP6 ADD CALLDATALOAD PUSH2 0x5497 DUP2 PUSH2 0x505C JUMP JUMPDEST SWAP4 SWAP7 SWAP3 SWAP6 POP SWAP3 SWAP4 PUSH1 0x60 ADD CALLDATALOAD SWAP3 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x54BA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 CALLDATALOAD PUSH2 0x54C5 DUP2 PUSH2 0x5006 JUMP JUMPDEST SWAP2 POP PUSH1 0x20 DUP4 ADD CALLDATALOAD PUSH2 0x515C DUP2 PUSH2 0x5006 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB SWAP4 DUP5 AND DUP2 MSTORE SWAP2 DUP4 AND PUSH1 0x20 DUP4 ADD MSTORE SWAP1 SWAP2 AND PUSH1 0x40 DUP3 ADD MSTORE PUSH1 0x60 ADD SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x550A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 MLOAD PUSH2 0x186C DUP2 PUSH2 0x5120 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB SWAP3 DUP4 AND DUP2 MSTORE SWAP2 AND PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST PUSH4 0x4E487B71 PUSH1 0xE0 SHL PUSH1 0x0 MSTORE PUSH1 0x41 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x140 DUP2 ADD PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP2 GT DUP3 DUP3 LT OR ISZERO PUSH2 0x5568 JUMPI PUSH2 0x5568 PUSH2 0x552F JUMP JUMPDEST PUSH1 0x40 MSTORE SWAP1 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP1 DUP2 ADD PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP2 GT DUP3 DUP3 LT OR ISZERO PUSH2 0x5568 JUMPI PUSH2 0x5568 PUSH2 0x552F JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH1 0xE0 DUP2 ADD PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP2 GT DUP3 DUP3 LT OR ISZERO PUSH2 0x5568 JUMPI PUSH2 0x5568 PUSH2 0x552F JUMP JUMPDEST PUSH1 0x0 DUP3 PUSH1 0x1F DUP4 ADD SLT PUSH2 0x55C3 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD PUSH1 0x20 DUP4 ADD PUSH1 0x0 DUP1 PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP5 GT ISZERO PUSH2 0x55E3 JUMPI PUSH2 0x55E3 PUSH2 0x552F JUMP JUMPDEST POP PUSH1 0x40 MLOAD PUSH1 0x1F NOT PUSH1 0x1F DUP6 ADD DUP2 AND PUSH1 0x3F ADD AND DUP2 ADD DUP2 DUP2 LT PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP3 GT OR ISZERO PUSH2 0x5611 JUMPI PUSH2 0x5611 PUSH2 0x552F JUMP JUMPDEST PUSH1 0x40 MSTORE DUP4 DUP2 MSTORE SWAP1 POP DUP1 DUP3 DUP5 ADD DUP8 LT ISZERO PUSH2 0x5629 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP4 DUP4 PUSH1 0x20 DUP4 ADD CALLDATACOPY PUSH1 0x0 PUSH1 0x20 DUP6 DUP4 ADD ADD MSTORE DUP1 SWAP5 POP POP POP POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH1 0x60 DUP5 DUP7 SUB SLT ISZERO PUSH2 0x565B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP4 CALLDATALOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP2 GT ISZERO PUSH2 0x5671 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x567D DUP7 DUP3 DUP8 ADD PUSH2 0x55B2 JUMP JUMPDEST SWAP4 POP POP PUSH1 0x20 DUP5 ADD CALLDATALOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP2 GT ISZERO PUSH2 0x5699 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x56A5 DUP7 DUP3 DUP8 ADD PUSH2 0x55B2 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x40 DUP5 ADD CALLDATALOAD PUSH2 0x56B6 DUP2 PUSH2 0x5006 JUMP JUMPDEST DUP1 SWAP2 POP POP SWAP3 POP SWAP3 POP SWAP3 JUMP JUMPDEST PUSH1 0x1 DUP2 DUP2 SHR SWAP1 DUP3 AND DUP1 PUSH2 0x56D5 JUMPI PUSH1 0x7F DUP3 AND SWAP2 POP JUMPDEST PUSH1 0x20 DUP3 LT DUP2 SUB PUSH2 0x56F5 JUMPI PUSH4 0x4E487B71 PUSH1 0xE0 SHL PUSH1 0x0 MSTORE PUSH1 0x22 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x1F DUP3 GT ISZERO PUSH2 0xD3C JUMPI DUP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 PUSH1 0x1F DUP5 ADD PUSH1 0x5 SHR DUP2 ADD PUSH1 0x20 DUP6 LT ISZERO PUSH2 0x5722 JUMPI POP DUP1 JUMPDEST PUSH1 0x1F DUP5 ADD PUSH1 0x5 SHR DUP3 ADD SWAP2 POP JUMPDEST DUP2 DUP2 LT ISZERO PUSH2 0x306F JUMPI PUSH1 0x0 DUP2 SSTORE PUSH1 0x1 ADD PUSH2 0x572E JUMP JUMPDEST DUP2 MLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP2 GT ISZERO PUSH2 0x575B JUMPI PUSH2 0x575B PUSH2 0x552F JUMP JUMPDEST PUSH2 0x576F DUP2 PUSH2 0x5769 DUP5 SLOAD PUSH2 0x56C1 JUMP JUMPDEST DUP5 PUSH2 0x56FB JUMP JUMPDEST PUSH1 0x20 PUSH1 0x1F DUP3 GT PUSH1 0x1 DUP2 EQ PUSH2 0x57A3 JUMPI PUSH1 0x0 DUP4 ISZERO PUSH2 0x578B JUMPI POP DUP5 DUP3 ADD MLOAD JUMPDEST PUSH1 0x0 NOT PUSH1 0x3 DUP6 SWAP1 SHL SHR NOT AND PUSH1 0x1 DUP5 SWAP1 SHL OR DUP5 SSTORE PUSH2 0x306F JUMP JUMPDEST PUSH1 0x0 DUP5 DUP2 MSTORE PUSH1 0x20 DUP2 KECCAK256 PUSH1 0x1F NOT DUP6 AND SWAP2 JUMPDEST DUP3 DUP2 LT ISZERO PUSH2 0x57D3 JUMPI DUP8 DUP6 ADD MLOAD DUP3 SSTORE PUSH1 0x20 SWAP5 DUP6 ADD SWAP5 PUSH1 0x1 SWAP1 SWAP3 ADD SWAP2 ADD PUSH2 0x57B3 JUMP JUMPDEST POP DUP5 DUP3 LT ISZERO PUSH2 0x57F1 JUMPI DUP7 DUP5 ADD MLOAD PUSH1 0x0 NOT PUSH1 0x3 DUP8 SWAP1 SHL PUSH1 0xF8 AND SHR NOT AND DUP2 SSTORE JUMPDEST POP POP POP POP PUSH1 0x1 SWAP1 DUP2 SHL ADD SWAP1 SSTORE POP JUMP JUMPDEST PUSH1 0x20 DUP2 MSTORE DUP2 PUSH1 0x20 DUP3 ADD MSTORE DUP2 DUP4 PUSH1 0x40 DUP4 ADD CALLDATACOPY PUSH1 0x0 DUP2 DUP4 ADD PUSH1 0x40 SWAP1 DUP2 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH1 0x1F SWAP1 SWAP3 ADD PUSH1 0x1F NOT AND ADD ADD SWAP2 SWAP1 POP JUMP JUMPDEST PUSH4 0x4E487B71 PUSH1 0xE0 SHL PUSH1 0x0 MSTORE PUSH1 0x11 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST DUP2 DUP2 SUB DUP2 DUP2 GT ISZERO PUSH2 0x12B8 JUMPI PUSH2 0x12B8 PUSH2 0x582F JUMP JUMPDEST PUSH4 0x4E487B71 PUSH1 0xE0 SHL PUSH1 0x0 MSTORE PUSH1 0x32 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST PUSH1 0x0 DUP1 DUP4 CALLDATALOAD PUSH1 0x1E NOT DUP5 CALLDATASIZE SUB ADD DUP2 SLT PUSH2 0x5885 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP4 ADD DUP1 CALLDATALOAD SWAP2 POP PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP3 GT ISZERO PUSH2 0x589F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x20 ADD SWAP2 POP CALLDATASIZE DUP2 SWAP1 SUB DUP3 SGT ISZERO PUSH2 0x34BE JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 DUP5 DUP3 CALLDATACOPY PUSH1 0x0 DUP4 DUP3 ADD PUSH1 0x0 DUP2 MSTORE DUP4 MLOAD PUSH2 0x58D1 DUP2 DUP4 PUSH1 0x20 DUP9 ADD PUSH2 0x5197 JUMP JUMPDEST ADD SWAP6 SWAP5 POP POP POP POP POP JUMP JUMPDEST PUSH4 0x4E487B71 PUSH1 0xE0 SHL PUSH1 0x0 MSTORE PUSH1 0x21 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST PUSH1 0x3 DUP2 LT PUSH2 0x590F JUMPI PUSH4 0x4E487B71 PUSH1 0xE0 SHL PUSH1 0x0 MSTORE PUSH1 0x21 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST SWAP1 MSTORE JUMP JUMPDEST PUSH1 0x20 DUP2 ADD PUSH2 0x12B8 DUP3 DUP5 PUSH2 0x58F1 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x5934 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP POP DUP1 CALLDATALOAD SWAP3 PUSH1 0x20 SWAP1 SWAP2 ADD CALLDATALOAD SWAP2 POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0x80 DUP6 DUP8 SUB SLT ISZERO PUSH2 0x5959 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP5 CALLDATALOAD SWAP4 POP PUSH1 0x20 DUP6 ADD CALLDATALOAD SWAP3 POP PUSH1 0x40 DUP6 ADD CALLDATALOAD PUSH2 0x5972 DUP2 PUSH2 0x5006 JUMP JUMPDEST SWAP2 POP PUSH1 0x60 DUP6 ADD CALLDATALOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP2 GT ISZERO PUSH2 0x598D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x5999 DUP8 DUP3 DUP9 ADD PUSH2 0x55B2 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP6 SWAP2 SWAP5 POP SWAP3 POP JUMP JUMPDEST DUP1 MLOAD PUSH2 0x5026 DUP2 PUSH2 0x505C JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP2 AND DUP2 EQ PUSH2 0x848 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP1 MLOAD PUSH2 0x5026 DUP2 PUSH2 0x59B0 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x140 DUP3 DUP5 SUB SLT DUP1 ISZERO PUSH2 0x59E4 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x0 PUSH2 0x59EF PUSH2 0x5545 JUMP JUMPDEST DUP4 MLOAD DUP2 MSTORE PUSH1 0x20 DUP1 DUP6 ADD MLOAD SWAP1 DUP3 ADD MSTORE PUSH1 0x40 DUP1 DUP6 ADD MLOAD SWAP1 DUP3 ADD MSTORE PUSH2 0x5A13 PUSH1 0x60 DUP6 ADD PUSH2 0x59A5 JUMP JUMPDEST PUSH1 0x60 DUP3 ADD MSTORE PUSH2 0x5A24 PUSH1 0x80 DUP6 ADD PUSH2 0x59C5 JUMP JUMPDEST PUSH1 0x80 DUP3 ADD MSTORE PUSH2 0x5A35 PUSH1 0xA0 DUP6 ADD PUSH2 0x59C5 JUMP JUMPDEST PUSH1 0xA0 DUP3 ADD MSTORE PUSH2 0x5A46 PUSH1 0xC0 DUP6 ADD PUSH2 0x59A5 JUMP JUMPDEST PUSH1 0xC0 DUP3 ADD MSTORE PUSH2 0x5A57 PUSH1 0xE0 DUP6 ADD PUSH2 0x59C5 JUMP JUMPDEST PUSH1 0xE0 DUP3 ADD MSTORE PUSH2 0x100 DUP5 DUP2 ADD MLOAD SWAP1 DUP3 ADD MSTORE PUSH2 0x120 SWAP4 DUP5 ADD MLOAD SWAP4 DUP2 ADD SWAP4 SWAP1 SWAP4 MSTORE POP SWAP1 SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x5A8F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP MLOAD SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x5AA8 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 MLOAD PUSH2 0x186C DUP2 PUSH2 0x505C JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x5AC5 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 MLOAD PUSH2 0x186C DUP2 PUSH2 0x59B0 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB SWAP3 SWAP1 SWAP3 AND DUP3 MSTORE PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 ADD SWAP1 JUMP JUMPDEST DUP1 DUP3 ADD DUP1 DUP3 GT ISZERO PUSH2 0x12B8 JUMPI PUSH2 0x12B8 PUSH2 0x582F JUMP JUMPDEST PUSH1 0x0 DUP3 MLOAD PUSH2 0x5B0E DUP2 DUP5 PUSH1 0x20 DUP8 ADD PUSH2 0x5197 JUMP JUMPDEST SWAP2 SWAP1 SWAP2 ADD SWAP3 SWAP2 POP POP JUMP JUMPDEST DUP1 CALLDATALOAD PUSH2 0x5026 DUP2 PUSH2 0x59B0 JUMP JUMPDEST DUP1 CALLDATALOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0x80 SHL SUB DUP2 AND DUP2 EQ PUSH2 0x5026 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x5B4D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 CALLDATALOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP2 GT ISZERO PUSH2 0x5B63 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP4 ADD PUSH1 0x40 DUP2 DUP7 SUB SLT ISZERO PUSH2 0x5B75 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x5B7D PUSH2 0x556E JUMP JUMPDEST DUP2 CALLDATALOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP2 GT ISZERO PUSH2 0x5B93 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 ADD PUSH1 0xE0 DUP2 DUP9 SUB SLT ISZERO PUSH2 0x5BA5 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x5BAD PUSH2 0x5590 JUMP JUMPDEST DUP2 CALLDATALOAD DUP2 MSTORE PUSH2 0x5BBD PUSH1 0x20 DUP4 ADD PUSH2 0x501B JUMP JUMPDEST PUSH1 0x20 DUP3 ADD MSTORE PUSH2 0x5BCE PUSH1 0x40 DUP4 ADD PUSH2 0x501B JUMP JUMPDEST PUSH1 0x40 DUP3 ADD MSTORE PUSH2 0x5BDF PUSH1 0x60 DUP4 ADD PUSH2 0x501B JUMP JUMPDEST PUSH1 0x60 DUP3 ADD MSTORE PUSH2 0x5BF0 PUSH1 0x80 DUP4 ADD PUSH2 0x5B18 JUMP JUMPDEST PUSH1 0x80 DUP3 ADD MSTORE PUSH2 0x5C01 PUSH1 0xA0 DUP4 ADD PUSH2 0x5B23 JUMP JUMPDEST PUSH1 0xA0 DUP3 ADD MSTORE PUSH1 0xC0 DUP3 ADD CALLDATALOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP2 GT ISZERO PUSH2 0x5C1F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x5C2B DUP10 DUP3 DUP6 ADD PUSH2 0x55B2 JUMP JUMPDEST PUSH1 0xC0 DUP4 ADD MSTORE POP DUP3 MSTORE POP PUSH1 0x20 DUP3 ADD CALLDATALOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP2 GT ISZERO PUSH2 0x5C4D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x5C59 DUP8 DUP3 DUP6 ADD PUSH2 0x55B2 JUMP JUMPDEST PUSH1 0x20 DUP4 DUP2 ADD SWAP2 SWAP1 SWAP2 MSTORE SWAP2 SWAP8 SWAP6 SWAP1 SWAP2 ADD CALLDATALOAD SWAP6 POP POP POP POP POP JUMP JUMPDEST PUSH2 0x5C7B DUP2 DUP6 PUSH2 0x58F1 JUMP JUMPDEST PUSH1 0x60 PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x0 PUSH2 0x5C91 PUSH1 0x60 DUP4 ADD DUP6 PUSH2 0x51BB JUMP JUMPDEST SWAP1 POP DUP3 PUSH1 0x40 DUP4 ADD MSTORE SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST DUP1 DUP3 MUL DUP2 ISZERO DUP3 DUP3 DIV DUP5 EQ OR PUSH2 0x12B8 JUMPI PUSH2 0x12B8 PUSH2 0x582F JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH1 0x60 DUP5 DUP7 SUB SLT ISZERO PUSH2 0x5CCD JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP4 CALLDATALOAD PUSH2 0x5CD8 DUP2 PUSH2 0x5006 JUMP JUMPDEST SWAP3 POP PUSH1 0x20 DUP5 ADD CALLDATALOAD SWAP2 POP PUSH1 0x40 DUP5 ADD CALLDATALOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP2 GT ISZERO PUSH2 0x5CFA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x5D06 DUP7 DUP3 DUP8 ADD PUSH2 0x55B2 JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 POP SWAP3 JUMP JUMPDEST PUSH1 0x80 DUP2 MSTORE PUSH1 0x0 PUSH2 0x5D23 PUSH1 0x80 DUP4 ADD DUP8 PUSH2 0x51BB JUMP JUMPDEST PUSH1 0x20 DUP4 ADD SWAP6 SWAP1 SWAP6 MSTORE POP PUSH1 0x40 DUP2 ADD SWAP3 SWAP1 SWAP3 MSTORE PUSH1 0x60 SWAP1 SWAP2 ADD MSTORE SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x5D52 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 MLOAD PUSH1 0x20 DUP5 ADD MLOAD SWAP1 SWAP3 POP PUSH2 0x515C DUP2 PUSH2 0x5006 JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH2 0x5D74 JUMPI PUSH2 0x5D74 PUSH2 0x582F JUMP JUMPDEST POP PUSH1 0x0 NOT ADD SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1 DUP3 ADD PUSH2 0x5D8E JUMPI PUSH2 0x5D8E PUSH2 0x582F JUMP JUMPDEST POP PUSH1 0x1 ADD SWAP1 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB SWAP4 DUP5 AND DUP2 MSTORE SWAP2 SWAP1 SWAP3 AND PUSH1 0x20 DUP3 ADD MSTORE PUSH4 0xFFFFFFFF SWAP1 SWAP2 AND PUSH1 0x40 DUP3 ADD MSTORE PUSH1 0x60 ADD SWAP1 JUMP JUMPDEST PUSH1 0x60 DUP1 DUP3 MSTORE DUP5 MLOAD PUSH1 0x40 DUP4 DUP4 ADD DUP2 SWAP1 MSTORE DUP2 MLOAD PUSH1 0xA0 DUP6 ADD MSTORE PUSH1 0x20 DUP3 ADD MLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB SWAP1 DUP2 AND PUSH1 0xC0 DUP7 ADD MSTORE SWAP1 DUP3 ADD MLOAD DUP2 AND PUSH1 0xE0 DUP6 ADD MSTORE SWAP2 DUP2 ADD MLOAD SWAP1 SWAP2 AND PUSH2 0x100 DUP4 ADD MSTORE PUSH1 0x80 DUP2 ADD MLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP2 AND PUSH2 0x120 DUP5 ADD MSTORE PUSH1 0x0 SWAP2 SWAP1 POP PUSH1 0xA0 DUP2 ADD MLOAD PUSH1 0x1 PUSH1 0x1 PUSH1 0x80 SHL SUB DUP2 AND PUSH2 0x140 DUP6 ADD MSTORE POP PUSH1 0xC0 ADD MLOAD PUSH1 0xE0 PUSH2 0x160 DUP5 ADD MSTORE PUSH2 0x5E4B PUSH2 0x180 DUP5 ADD DUP3 PUSH2 0x51BB JUMP JUMPDEST SWAP1 POP PUSH1 0x20 DUP7 ADD MLOAD PUSH1 0x5F NOT DUP5 DUP4 SUB ADD PUSH1 0x80 DUP6 ADD MSTORE PUSH2 0x5E68 DUP3 DUP3 PUSH2 0x51BB JUMP JUMPDEST SWAP3 POP POP POP DUP4 PUSH1 0x20 DUP4 ADD MSTORE PUSH2 0x3335 PUSH1 0x40 DUP4 ADD DUP5 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND SWAP1 MSTORE JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB DUP5 DUP2 AND DUP3 MSTORE DUP4 AND PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x60 DUP2 ADD PUSH2 0x3335 PUSH1 0x40 DUP4 ADD DUP5 PUSH2 0x58F1 JUMP JUMPDEST PUSH1 0x0 PUSH1 0xA0 DUP3 DUP5 SUB SLT DUP1 ISZERO PUSH2 0x5EBF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x40 MLOAD PUSH1 0x0 SWAP1 PUSH1 0xA0 DUP2 ADD PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB DUP2 GT DUP3 DUP3 LT OR ISZERO PUSH2 0x5EE5 JUMPI PUSH2 0x5EE5 PUSH2 0x552F JUMP JUMPDEST PUSH1 0x40 SWAP1 DUP2 MSTORE DUP5 MLOAD DUP3 MSTORE PUSH1 0x20 DUP1 DUP7 ADD MLOAD SWAP1 DUP4 ADD MSTORE DUP5 DUP2 ADD MLOAD SWAP1 DUP3 ADD MSTORE PUSH1 0x60 DUP1 DUP6 ADD MLOAD SWAP1 DUP3 ADD MSTORE PUSH1 0x80 SWAP4 DUP5 ADD MLOAD SWAP4 DUP2 ADD SWAP4 SWAP1 SWAP4 MSTORE POP SWAP1 SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB SWAP4 DUP5 AND DUP2 MSTORE SWAP2 SWAP1 SWAP3 AND PUSH1 0x20 DUP3 ADD MSTORE PUSH1 0x40 DUP2 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH1 0x60 ADD SWAP1 JUMP JUMPDEST DUP7 DUP2 MSTORE DUP6 PUSH1 0x20 DUP3 ADD MSTORE DUP5 PUSH1 0x40 DUP3 ADD MSTORE DUP4 PUSH1 0x60 DUP3 ADD MSTORE PUSH1 0xC0 PUSH1 0x80 DUP3 ADD MSTORE PUSH1 0x0 PUSH2 0x5F6E PUSH1 0xC0 DUP4 ADD DUP6 PUSH2 0x51BB JUMP JUMPDEST SWAP1 POP DUP3 PUSH1 0xA0 DUP4 ADD MSTORE SWAP8 SWAP7 POP POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP3 PUSH2 0x5F9E JUMPI PUSH4 0x4E487B71 PUSH1 0xE0 SHL PUSH1 0x0 MSTORE PUSH1 0x12 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST POP DIV SWAP1 JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0xB8 TSTORE 0xE9 SELFBALANCE LOG2 0xAD CALL MSTORE8 0xB4 0xD5 0xD6 PUSH4 0x60454C8D MOD 0x24 0xBC 0xA9 SWAP9 0xD3 0xFC DUP16 SLT 0xBD OR 0xE3 SAR PUSH21 0x127864736F6C634300081B00330000000000000000 ", + "sourceMap": "1972:23938:57:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;877:74:58;;;;;;:::i;:::-;;;;;;;;;;;;-1:-1:-1;;;;;877:74:58;;;;;;;;;;:::i;:::-;;;;;;;;15734:152:57;;;;;;:::i;:::-;;:::i;:::-;;;;;;998:4:70;1040:3;1029:9;1025:19;1017:27;;1107:1;1103;1098:3;1094:11;1090:19;1081:6;1075:13;1071:39;1060:9;1053:58;1167:4;1159:6;1155:17;1149:24;1142:4;1131:9;1127:20;1120:54;1230:4;1222:6;1218:17;1212:24;1205:4;1194:9;1190:20;1183:54;1293:4;1285:6;1281:17;1275:24;1268:4;1257:9;1253:20;1246:54;1356:4;1348:6;1344:17;1338:24;1331:4;1320:9;1316:20;1309:54;1419:4;1411:6;1407:17;1401:24;1394:4;1383:9;1379:20;1372:54;1482:4;1474:6;1470:17;1464:24;1457:4;1446:9;1442:20;1435:54;1545:4;1537:6;1533:17;1527:24;1520:4;1509:9;1505:20;1498:54;1610:6;1602;1598:19;1592:26;1583:6;1572:9;1568:22;1561:58;858:767;;;;;792:30:58;;;;;;;;;1776:25:70;;;1764:2;1749:18;792:30:58;1630:177:70;874:75:15;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2043:25:70;;;2099:2;2084:18;;2077:34;;;;2127:18;;;2120:34;2185:2;2170:18;;2163:34;2030:3;2015:19;874:75:15;1812:391:70;14894:133:57;;;;;;:::i;:::-;;:::i;:::-;;2718:106:12;11107:16:21;;-1:-1:-1;;;11107:16:21;;;;2718:106:12;;2758:10:70;2746:23;;;2728:42;;2716:2;2701:18;2718:106:12;2584:192:70;4805:900:57;;;;;;:::i;:::-;;:::i;14272:149::-;;;;;;:::i;:::-;;:::i;1504:82:16:-;;;:::i;1176:138:14:-;;;;;;:::i;:::-;;:::i;2398:116:12:-;;;:::i;:::-;;;;;;;;:::i;528:76:58:-;;;;;;:::i;:::-;;:::i;:::-;;;;;;;;;:::i;15927:446:57:-;;;;;;:::i;:::-;;:::i;:::-;;;;6002:14:70;;5995:22;5977:41;;-1:-1:-1;;;;;6054:32:70;;;6049:2;6034:18;;6027:60;6103:18;;;6096:34;;;;6161:2;6146:18;;6139:34;6204:3;6189:19;;6182:35;6074:3;6233:19;;6226:35;5964:3;5949:19;15927:446:57;5696:571:70;2496:145:42;;;:::i;:::-;;;6437:14:70;;6430:22;6412:41;;6400:2;6385:18;2496:145:42;6272:187:70;846:76:66;;;;;;:::i;:::-;;;;;;;;;;;;;;14464:154:57;;;;;;:::i;:::-;;:::i;16634:170::-;;;;;;:::i;:::-;-1:-1:-1;;;;;;;;;;;;;;;;;;;;;;;;16765:32:57;;;;;:18;:32;;;;;16758:39;;;;;;;;;;;;;;;;;;;;;;;;;;;;16634:170;;;;;6680:13:70;;-1:-1:-1;;;;;6676:39:70;6658:58;;6772:4;6760:17;;;6754:24;6732:20;;;6725:54;;;;6631:18;16634:170:57;6464:321:70;3155:101:38;;;:::i;2239:120:12:-;;;:::i;:::-;;;;;;;;:::i;15253:136:57:-;;;;;;:::i;:::-;;:::i;13983:246::-;;;;;;:::i;:::-;;:::i;15432:259::-;;;;;;:::i;:::-;;:::i;9484:503::-;;;;;;:::i;:::-;;:::i;2553:126:12:-;;;:::i;:::-;;;;;;;;:::i;13428:512:57:-;;;;;;:::i;:::-;;:::i;14661:190::-;;;;;;:::i;:::-;;:::i;1379:78:16:-;;;:::i;5172:903:43:-;;;:::i;:::-;;;;;;;;;;;;;:::i;1045:30:66:-;;;;;;2441:144:38;;;:::i;949:68:16:-;;;;;;:::i;:::-;;;;;;;;;;;;;;;;1518:484:41;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;11495:867:57:-;;;;;;:::i;:::-;;:::i;17557:147::-;;;;;;:::i;:::-;;:::i;17183:108::-;;;:::i;3503:558::-;;;;;;:::i;:::-;;:::i;12603:316::-;;;;;;:::i;:::-;;:::i;558:78:15:-;;;;;;:::i;:::-;;;;;;;;;;;;;;6325:275:57;;;;;;:::i;:::-;;:::i;17334:180::-;;;;;;:::i;:::-;;:::i;683:31:58:-;;;;;;16847:120:57;;;:::i;7797:616::-;;;;;;:::i;:::-;;:::i;16414:177::-;;;;;;:::i;:::-;16512:7;16538:46;;;:24;:46;;;;;;;16414:177;15070:140;;;;;;:::i;:::-;;:::i;17010:130::-;;;:::i;12962:423::-;;;;;;:::i;:::-;;:::i;727:75:15:-;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3405:215:38;;;;;;:::i;:::-;;:::i;15734:152:57:-;15811:23;;:::i;:::-;-1:-1:-1;;;;;;15853:26:57;;;;;;;:12;:26;;;;;;;;;15846:33;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;15734:152::o;14894:133::-;2334:13:38;:11;:13::i;:::-;14984:36:57::1;15004:15;14984:19;:36::i;:::-;14894:133:::0;:::o;2796:21:12:-;2789:28;;2718:106;:::o;4805:900:57:-;4928:7;4707:15:21;:13;:15::i;:::-;-1:-1:-1;;;;;4707:28:21;;4736:15;4761:4;4768:10;4707:72;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;4823:15;4840:10;4686:175;;;;;;-1:-1:-1;;;4686:175:21;;;;;;;;;:::i;:::-;;;;;;;;;;;4956:7:57::1;5161:42:21;5206:30;5220:15;5206:13;:30::i;:::-;5161:75;;5246:32;5268:9;5246:21;:32::i;:::-;5288:43;5314:9;5325:5;5288:25;:43::i;:::-;1979:19:42::2;:17;:19::i;:::-;4990:17:57::3;::::0;;5064:77:::3;::::0;;::::3;5088:4:::0;5064:77:::3;:::i;:::-;4989:152;;;;;;5180:1;5166:3;5160:17;:21;5152:57;;;;-1:-1:-1::0;;;5152:57:57::3;;;;;;;;;;;;5251:1;5233:7;5227:21;:25;5219:65;;;;-1:-1:-1::0;;;5219:65:57::3;;;;;;;;;;;;-1:-1:-1::0;;;;;5302:17:57;::::3;;::::0;;;:8:::3;:17;::::0;;;;:30;:35;5294:87:::3;;;;-1:-1:-1::0;;;5294:87:57::3;;;;;;;;;;;;5444:70;::::0;;::::3;::::0;::::3;::::0;;5468:15:::3;5444:70:::0;;::::3;::::0;;::::3;::::0;;;;;;;;;-1:-1:-1;;;;;5424:17:57;::::3;-1:-1:-1::0;5424:17:57;;;:8:::3;:17:::0;;;;;;:90;;;;;;5444:70;;5424:17;:90:::3;::::0;::::3;::::0;::::3;::::0;;::::3;:::i;:::-;-1:-1:-1::0;5424:90:57::3;::::0;::::3;::::0;::::3;::::0;::::3;::::0;::::3;::::0;;::::3;:::i;:::-;-1:-1:-1::0;;;;;;;;5528:34:57;::::3;::::0;5524:119:::3;;5578:54;5602:7;5611:20;5578:23;:54::i;:::-;5684:7;-1:-1:-1::0;;;;;5658:40:57::3;;5693:4;;5658:40;;;;;;;:::i;:::-;;;;;;;;4979:726;;;5151:198:21::1;4871:1;4805:900:57::0;;;;:::o;14272:149::-;2334:13:38;:11;:13::i;:::-;14373:41:57::1;14391:13;14406:7;14373:17;:41::i;:::-;14272:149:::0;;:::o;1504:82:16:-;1253:10;1238:26;;;;:14;:26;;;;;;;;1230:84;;;;-1:-1:-1;;;1230:84:16;;;;;;;;:::i;:::-;;1569:10:::1;:8;:10::i;:::-;1504:82::o:0;1176:138:14:-;1262:45;1276:10;1288:18;1262:13;:45::i;2398:116:12:-;2452:6;2460;2485:22;:20;:22::i;:::-;2478:29;;;;2398:116;;:::o;528:76:58:-;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;15927:446:57:-;-1:-1:-1;;;;;16114:26:57;;;16022:4;16114:26;;;:12;:26;;;;;;;;16083:57;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;16022:4;;;;;;;;;;;16171:13;16083:57;16171:11;:13::i;:::-;16198:12;;16224:25;;;;16263:11;;;;16288:32;;;;16334:22;;;;;16150:216;;16198:12;;-1:-1:-1;16224:25:57;;-1:-1:-1;16263:11:57;-1:-1:-1;16288:32:57;;-1:-1:-1;16334:22:57;-1:-1:-1;15927:446:57;-1:-1:-1;;15927:446:57:o;2496:145:42:-;2543:4;2559:25;2587:21;:19;:21::i;:::-;2625:9;;;;2496:145;-1:-1:-1;;2496:145:42:o;14464:154:57:-;14554:57;14578:10;14590:20;14554:23;:57::i;3155:101:38:-;2334:13;:11;:13::i;:::-;3219:30:::1;3246:1;3219:18;:30::i;2239:120:12:-:0;2295:6;2303;2328:24;:22;:24::i;15253:136:57:-;2334:13:38;:11;:13::i;:::-;15345:37:57::1;15365:16;15345:19;:37::i;13983:246::-:0;2334:13:38;:11;:13::i;:::-;14153:69:57::1;14178:7;14187:12;14201:20;14153:24;:69::i;:::-;13983:246:::0;;;:::o;15432:259::-;2334:13:38;:11;:13::i;:::-;15523:31:57::1;15542:11;452:9:35::0;-1:-1:-1;2073:16:35;;1992:104;15523:31:57::1;15590:11;15515:88;;;;;-1:-1:-1::0;;;15515:88:57::1;;;;;;1776:25:70::0;;1764:2;1749:18;;1630:177;15515:88:57::1;-1:-1:-1::0;15613:15:57::1;:29:::0;;;15657:27:::1;::::0;1776:25:70;;;15657:27:57::1;::::0;1764:2:70;1749:18;15657:27:57::1;;;;;;;;15432:259:::0;:::o;9484:503::-;9610:7;4707:15:21;:13;:15::i;:::-;-1:-1:-1;;;;;4707:28:21;;4736:15;4761:4;4768:10;4707:72;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;4823:15;4840:10;4686:175;;;;;;-1:-1:-1;;;4686:175:21;;;;;;;;;:::i;:::-;-1:-1:-1;;;;;;;2617:17:57;::::1;;::::0;;;:8:::1;:17;::::0;;;;:30;9641:7;;;;2609:90:::1;;;;-1:-1:-1::0;;;2609:90:57::1;;;;;;;;:::i;:::-;;1979:19:42::2;:17;:19::i;:::-;9674:20:57::3;9697:27;::::0;;::::3;9708:4:::0;9697:27:::3;:::i;:::-;9674:50:::0;-1:-1:-1;;;;;;9755:49:57;::::3;:30;:12;9674:50:::0;9755:16:::3;:30::i;:::-;:38:::0;9857:7;;9866:12;;-1:-1:-1;;;;;9755:49:57::3;;9734:155;;;;-1:-1:-1::0;;;9734:155:57::3;;;;;;;;;:::i;:::-;;;9899:37;9916:12;9930:5;9899:16;:37::i;:::-;9966:7;-1:-1:-1::0;;;;;9951:29:57::3;;9975:4;;9951:29;;;;;;;:::i;:::-;;;;;;;;9664:323;4871:1:21::1;9484:503:57::0;;;;:::o;2553:126:12:-;2611:7;2620;2646:26;11409:7:21;11445:23;11470;;11445;;11342:159;13428:512:57;13591:7;4707:15:21;:13;:15::i;:::-;-1:-1:-1;;;;;4707:28:21;;4736:15;4761:4;4768:10;4707:72;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;4823:15;4840:10;4686:175;;;;;;-1:-1:-1;;;4686:175:21;;;;;;;;;:::i;:::-;;;13627:7:57::1;5161:42:21;5206:30;5220:15;5206:13;:30::i;:::-;5161:75;;5246:32;5268:9;5246:21;:32::i;:::-;5288:43;5314:9;5325:5;5288:25;:43::i;:::-;-1:-1:-1::0;;;;;2617:17:57;::::2;;::::0;;;:8:::2;:17;::::0;;;;:30;13666:7;;;;2609:90:::2;;;;-1:-1:-1::0;;;2609:90:57::2;;;;;;;;:::i;:::-;;1979:19:42::3;:17;:19::i;:::-;-1:-1:-1::0;;;;;13732:49:57;::::4;:30;:12;13749::::0;13732:16:::4;:30::i;:::-;:38:::0;13834:7;;13843:12;;-1:-1:-1;;;;;13732:49:57::4;;13711:155;;;;-1:-1:-1::0;;;13711:155:57::4;;;;;;;;;:::i;:::-;;;13876:57;13894:12;13908:6;13916:16;;;;;;;;;;;13876:17;:57::i;:::-;5341:1:21::2;5151:198:::1;4871:1;13428:512:57::0;;;;:::o;14661:190::-;2334:13:38;:11;:13::i;:::-;14766:78:57::1;14791:22;-1:-1:-1::0;;14766:24:57::1;:78::i;1379::16:-:0;1253:10;1238:26;;;;:14;:26;;;;;;;;1230:84;;;;-1:-1:-1;;;1230:84:16;;;;;;;;:::i;:::-;;1442:8:::1;:6;:8::i;5172:903:43:-:0;5270:13;5297:18;5329:21;5364:15;5393:25;5432:12;5458:27;5510:23;5536:19;:17;:19::i;:::-;5776:13;;5510:45;;-1:-1:-1;5776:18:43;:43;;;;-1:-1:-1;5798:16:43;;;;:21;5776:43;5768:77;;;;-1:-1:-1;;;5768:77:43;;20478:2:70;5768:77:43;;;20460:21:70;20517:2;20497:18;;;20490:30;-1:-1:-1;;;20536:18:70;;;20529:51;20597:18;;5768:77:43;20276:345:70;5768:77:43;5907:13;:11;:13::i;:::-;5934:16;:14;:16::i;:::-;6042;;;6026:1;6042:16;;;;;;;;;-1:-1:-1;;;5856:212:43;;;-1:-1:-1;5856:212:43;;-1:-1:-1;5964:13:43;;-1:-1:-1;5999:4:43;;-1:-1:-1;6026:1:43;-1:-1:-1;6042:16:43;-1:-1:-1;5856:212:43;-1:-1:-1;;5172:903:43:o;2441:144:38:-;2487:7;2506:24;2533:20;:18;:20::i;:::-;2570:8;-1:-1:-1;;;;;2570:8:38;;2441:144;-1:-1:-1;;2441:144:38:o;1518:484:41:-;1684:12;;;1620:20;1684:12;;;;;;;;1586:22;;1795:4;-1:-1:-1;;;;;1783:24:41;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1773:34;;1822:9;1817:155;1837:15;;;1817:155;;;1886:75;1923:4;1943;;1948:1;1943:7;;;;;;;:::i;:::-;;;;;;;;;;;;:::i;:::-;1952;1930:30;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;1886:28;:75::i;:::-;1873:7;1881:1;1873:10;;;;;;;;:::i;:::-;;;;;;;;;;:88;1854:3;;1817:155;;;;1981:14;1518:484;;;;;:::o;11495:867:57:-;11813:7;11690;4707:15:21;:13;:15::i;:::-;-1:-1:-1;;;;;4707:28:21;;4736:15;4761:4;4768:10;4707:72;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;4823:15;4840:10;4686:175;;;;;;-1:-1:-1;;;4686:175:21;;;;;;;;;:::i;:::-;;;11726:7:57::1;5161:42:21;5206:30;5220:15;5206:13;:30::i;:::-;5161:75;;5246:32;5268:9;5246:21;:32::i;:::-;5288:43;5314:9;5325:5;5288:25;:43::i;:::-;-1:-1:-1::0;;;;;2617:17:57;::::2;;::::0;;;:8:::2;:17;::::0;;;;:30;11765:7;;;;2609:90:::2;;;;-1:-1:-1::0;;;2609:90:57::2;;;;;;;;:::i;:::-;;1979:19:42::3;:17;:19::i;:::-;11836:24:57::4;::::0;11879:11:::4;:51;;;;;;;;:::i;:::-;::::0;11875:369:::4;;11965:32;11983:7;11992:4;;11965:17;:32::i;:::-;11946:51;;11875:369;;;12033:43;12018:11;:58;;;;;;;;:::i;:::-;::::0;12014:230:::4;;12111:38;12135:7;12144:4;;12111:23;:38::i;12014:230::-;12221:11;12187:46;;-1:-1:-1::0;;;12187:46:57::4;;;;;;;;:::i;12014:230::-;12292:11;12259:63;;;;;;;;:::i;:::-;12283:7;-1:-1:-1::0;;;;;12259:63:57::4;;12305:16;12259:63;;;;1776:25:70::0;;1764:2;1749:18;;1630:177;12259:63:57::4;;;;;;;;12339:16:::0;11495:867;-1:-1:-1;;;;;;;;;11495:867:57:o;17557:147::-;17631:4;17654:43;17671:7;17680:16;;;;;;;;;;;17654;:43::i;17183:108::-;17238:7;17272:11;:9;:11::i;3503:558::-;4158:30:39;4191:26;:24;:26::i;:::-;4302:15;;4158:59;;-1:-1:-1;4302:15:39;-1:-1:-1;;;4302:15:39;;;4301:16;;-1:-1:-1;;;;;4348:14:39;4279:19;4724:16;;:34;;;;;4744:14;4724:34;4704:54;;4768:17;4788:11;-1:-1:-1;;;;;4788:16:39;4803:1;4788:16;:50;;;;-1:-1:-1;4816:4:39;4808:25;:30;4788:50;4768:70;;4854:12;4853:13;:30;;;;;4871:12;4870:13;4853:30;4849:91;;;4906:23;;-1:-1:-1;;;4906:23:39;;;;;;;;;;;4849:91;4949:18;;-1:-1:-1;;;;;;4949:18:39;4966:1;4949:18;;;4977:67;;;;5011:22;;-1:-1:-1;;;;5011:22:39;-1:-1:-1;;;5011:22:39;;;4977:67;3697:21:57::1;3712:5;3697:14;:21::i;:::-;3728:18;:16;:18::i;:::-;3756:20;:18;:20::i;:::-;3786:28;:26;:28::i;:::-;3824:50;;;;;;;;;;;;;;-1:-1:-1::0;;;3824:50:57::1;;::::0;::::1;;;;;;;;;;;;;-1:-1:-1::0;;;3824:50:57::1;;::::0;:24:::1;:50::i;:::-;3885:67;3910:22;-1:-1:-1::0;;3885:24:57::1;:67::i;:::-;3962:43;3982:22;3962:19;:43::i;:::-;4015:39;4036:17;4015:20;:39::i;:::-;5068:14:39::0;5064:101;;;5098:23;;-1:-1:-1;;;;5098:23:39;;;5140:14;;-1:-1:-1;23079:50:70;;5140:14:39;;23067:2:70;23052:18;5140:14:39;;;;;;;5064:101;4092:1079;;;;;3503:558:57;;;;:::o;12603:316::-;2311:10:69;2333:15;-1:-1:-1;;;;;2311:38:69;;;;2290:147;;;;-1:-1:-1;;;2290:147:69;;;;;;;;;:::i;:::-;-1:-1:-1;12704:14:57::1;::::0;-1:-1:-1;12704:14:57;12738:36:::1;::::0;;::::1;12749:4:::0;12738:36:::1;:::i;:::-;12703:71;;;;12784:15;:13;:15::i;:::-;-1:-1:-1::0;;;;;12784:21:57::1;;12806:7;12815:6;12823;12839:17;:15;:17::i;:::-;12784:74;::::0;::::1;::::0;;;-1:-1:-1;;;;;;12784:74:57;;;-1:-1:-1;;;;;23740:32:70;;;12784:74:57::1;::::0;::::1;23722:51:70::0;23789:18;;;23782:34;;;;23832:18;;;23825:34;;;;23895:32;;;23875:18;;;23868:60;23694:19;;12784:74:57::1;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;12896:7;-1:-1:-1::0;;;;;12873:39:57::1;;12905:6;12873:39;;;;1776:25:70::0;;1764:2;1749:18;;1630:177;12873:39:57::1;;;;;;;;12693:226;;12603:316:::0;;;:::o;6325:275::-;6467:7;4707:15:21;:13;:15::i;:::-;-1:-1:-1;;;;;4707:28:21;;4736:15;4761:4;4768:10;4707:72;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;4823:15;4840:10;4686:175;;;;;;-1:-1:-1;;;4686:175:21;;;;;;;;;:::i;:::-;;;1979:19:42::1;:17;:19::i;:::-;6500:35:57::2;6527:7;6500:26;:35::i;:::-;6550:43;::::0;-1:-1:-1;;;;;6550:43:57;::::2;::::0;::::2;::::0;;;::::2;6325:275:::0;;;;:::o;17334:180::-;17436:7;17462:45;17485:7;17494:12;17462:22;:45::i;:::-;17455:52;17334:180;-1:-1:-1;;;17334:180:57:o;16847:120::-;16908:7;16942:17;:15;:17::i;7797:616::-;7948:7;4707:15:21;:13;:15::i;:::-;-1:-1:-1;;;;;4707:28:21;;4736:15;4761:4;4768:10;4707:72;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;4823:15;4840:10;4686:175;;;;;;-1:-1:-1;;;4686:175:21;;;;;;;;;:::i;:::-;;;7984:7:57::1;5161:42:21;5206:30;5220:15;5206:13;:30::i;:::-;5161:75;;5246:32;5268:9;5246:21;:32::i;:::-;5288:43;5314:9;5325:5;5288:25;:43::i;:::-;-1:-1:-1::0;;;;;2617:17:57;::::2;;::::0;;;:8:::2;:17;::::0;;;;:30;8023:7;;;;2609:90:::2;;;;-1:-1:-1::0;;;2609:90:57::2;;;;;;;;:::i;:::-;;1979:19:42::3;:17;:19::i;:::-;8069:28:57::4;::::0;;;8169:86:::4;::::0;;::::4;8193:4:::0;8169:86:::4;:::i;:::-;8068:187;;;;;;;;8265:97;8275:7;8284:12;8298:20;8320:6;8328:15;8345:16;;;;;;;;;;;8265:9;:97::i;:::-;8392:7;-1:-1:-1::0;;;;;8377:29:57::4;;8401:4;;8377:29;;;;;;;:::i;:::-;;;;;;;;8058:355;;;;5341:1:21::2;5151:198:::1;4871:1;7797:616:57::0;;;;:::o;15070:140::-;2334:13:38;:11;:13::i;:::-;15164:39:57::1;15185:17;15164:20;:39::i;17010:130::-:0;17076:7;17110:22;:20;:22::i;12962:423::-;1979:19:42;:17;:19::i;:::-;13056:34:57::1;13093:30;:12;13110::::0;13093:16:::1;:30::i;:::-;13056:67;;13141:35;13160:15;;13141:10;:18;;:35;;;;:::i;:::-;13220:12;13133:101;;;;;-1:-1:-1::0;;;13133:101:57::1;;;;;;;;:::i;:::-;;13253:25;:10;:23;:25::i;:::-;13252:26;13318:12;13244:88;;;;;-1:-1:-1::0;;;13244:88:57::1;;;;;;;;:::i;:::-;;13342:36;13359:12;13373:4;13342:16;:36::i;3405:215:38:-:0;2334:13;:11;:13::i;:::-;-1:-1:-1;;;;;3489:22:38;::::1;3485:91;;3562:1;3534:31;;-1:-1:-1::0;;;3534:31:38::1;;;;;;;;:::i;3485:91::-;3585:28;3604:8;3585:18;:28::i;2658:162::-:0;966:10:40;2717:7:38;:5;:7::i;:::-;-1:-1:-1;;;;;2717:23:38;;2713:101;;966:10:40;2763:40:38;;-1:-1:-1;;;2763:40:38;;;;;;;;:::i;6712:136:21:-;6775:16;:25;;-1:-1:-1;;;;6775:25:21;-1:-1:-1;;;6775:25:21;;;;;;;;;;;;;6815:26;;2728:42:70;;;6815:26:21;;2716:2:70;2701:18;6815:26:21;2584:192:70;6033:102:37;6115:13;;6033:102::o;12461:351:21:-;-1:-1:-1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;12622:15:21;:13;:15::i;:::-;-1:-1:-1;;;;;12622:28:21;;12651:16;12677:4;12622:61;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;12577:106;;12701:9;:19;;;-1:-1:-1;;;;;12701:24:21;12724:1;12701:24;;12761:16;12693:86;;;;;-1:-1:-1;;;12693:86:21;;;;;;;;:::i;:::-;-1:-1:-1;12796:9:21;12461:351;-1:-1:-1;;12461:351:21:o;9052:297::-;9212:24;;;;9192:17;;9160:182;;9192:44;;;:::i;:::-;9250:23;;9287;;9160:182;;;;;;;;;;;;;-1:-1:-1;;;9160:182:21;;;:18;:182::i;10151:755::-;10306:23;10331;10358:24;:22;:24::i;:::-;10305:77;;;;10392:27;10422:13;:74;;10472:10;:24;;;10422:74;;;10438:10;:31;;;10422:74;10392:104;;10506:93;10525:20;-1:-1:-1;;;;;10506:93:21;10547:16;-1:-1:-1;;;;;10506:93:21;10565:16;-1:-1:-1;;;;;10506:93:21;;;;;;;;;;;;;;-1:-1:-1;;;10506:93:21;;;:18;:93::i;:::-;10611:21;10634;10659:22;:20;:22::i;:::-;10610:71;;;;10691:28;10722:13;:76;;10773:10;:25;;;10722:76;;;10738:10;:32;;;10722:76;10691:107;;10808:91;10827:21;10808:91;;10850:14;10808:91;;10866:14;10808:91;;;;;;;;;;;;;;;-1:-1:-1;;;10808:91:21;;;:18;:91::i;:::-;10295:611;;;;;;10151:755;;:::o;2709:128:42:-;2774:8;:6;:8::i;:::-;2770:61;;;2805:15;;-1:-1:-1;;;2805:15:42;;;;;;;;;;;24755:228:57;-1:-1:-1;;;;;24855:29:57;;;;;;;:19;:29;;;;;;:52;;-1:-1:-1;;;;;;24855:52:57;;;;;;;;;24922:54;;;24855:29;24922:54;24755:228;;:::o;2294:354:16:-;-1:-1:-1;;;;;2400:30:16;;;;;;:14;:30;;;;;;2415:14;;2435:8;;2400:30;;:43;;2434:9;;2400:43;2379:154;;;;-1:-1:-1;;;2379:154:16;;-1:-1:-1;;;;;26492:32:70;;;2379:154:16;;;26474:51:70;26568:14;26561:22;26541:18;;;26534:50;26447:18;;2379:154:16;26306:284:70;2379:154:16;-1:-1:-1;;;;;;;2543:30:16;;;;;;:14;:30;;;;;;;;;:41;;-1:-1:-1;;2543:41:16;;;;;;;;;;2599:42;;6412:41:70;;;2599:42:16;;6385:18:70;2599:42:16;;;;;;;2294:354;;:::o;3478:178:42:-;2226:16;:14;:16::i;:::-;3536:25:::1;3564:21;:19;:21::i;:::-;3595:17:::0;;-1:-1:-1;;3595:17:42::1;::::0;;;-1:-1:-1;3627:22:42::1;966:10:40::0;3636:12:42::1;3627:22;;;;;;:::i;3459:526:14:-:0;-1:-1:-1;;;;;3593:29:14;;3556:34;3593:29;;;:11;:29;;;;;;;;3806:31;;;;;26775:36:70;;;26827:18;;;26820:60;;;;3806:31:14;;;;;;;;;26748:18:70;;;;3806:31:14;;3556:34;;3678:202;;3593:29;;3711:18;;3743;;3775:17;;3851:19;3678;:202::i;:::-;3632:248;;;;3916:16;-1:-1:-1;;;;;3896:82:14;;3934:14;3961:4;3950:27;;;;;;;;;;;;:::i;:::-;3896:82;;;;;;;:::i;18638:173:57:-;18702:6;18710;18736:17;:15;:17::i;:::-;-1:-1:-1;;;;;18736:39:57;;:41;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;18728:76;452:9:35;;-1:-1:-1;18638:173:57;-1:-1:-1;18638:173:57:o;7267:123:61:-;7325:4;7348:13;:4;7092:14;;;:19;;;7011:107;7348:13;:35;;;;-1:-1:-1;;7365:13:61;;;:18;;7267:123::o;1147:162:42:-;1270:23;;1147:162::o;3774:248:38:-;3847:24;3874:20;:18;:20::i;:::-;3923:8;;-1:-1:-1;;;;;3941:19:38;;;-1:-1:-1;;;;;;3941:19:38;;;;;;3975:40;;3847:47;;-1:-1:-1;3923:8:38;;;;;3975:40;;3904:16;;3975:40;3837:185;;3774:248;:::o;18172:205:57:-;18238:6;18246;18264:20;18287:17;:15;:17::i;:::-;-1:-1:-1;;;;;18287:34:57;;:36;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;18264:59;;;-1:-1:-1;18172:205:57;-1:-1:-1;;18172:205:57:o;19915:166:65:-;19989:15;:34;;;20038:36;;1776:25:70;;;20038:36:65;;1764:2:70;1749:18;20038:36:65;1630:177:70;7528:293:65;7653:74;:18;7680:8;7690:13;7705:21;7653:26;:74::i;:::-;7792:21;7777:13;-1:-1:-1;;;;;7742:72:65;7767:8;-1:-1:-1;;;;;7742:72:65;;;;;;;;;;;7528:293;;;:::o;6206:160:61:-;6304:12;;:::i;:::-;6335:24;6340:4;6346:12;6335:4;:24::i;:::-;6328:31;;;;;;;;;;-1:-1:-1;;;;;6328:31:61;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6206:160;-1:-1:-1;;;6206:160:61:o;18661:997:65:-;18748:34;18785:31;:12;18802:13;18785:16;:31::i;:::-;18748:68;;18919:161;18961:13;18988:22;:20;:22::i;:::-;-1:-1:-1;;;;;18988:49:65;;19038:10;:31;;;18988:82;;;;;;;;;;;;;1776:25:70;;1764:2;1749:18;;1630:177;18988:82:65;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;18919:12;;:161;:28;:161::i;:::-;19091:33;:12;19110:13;19091:18;:33::i;:::-;19169:18;;19189:17;;;;19134:73;;:26;;:34;:73::i;:::-;19431:10;:17;;;19359:24;:57;19384:10;:31;;;19359:57;;;;;;;;;;;;:89;;;;:::i;:::-;19287:24;:57;19312:10;:31;;;19287:57;;;;;;;;;;;:161;;;;19553:10;:31;;;19526:13;-1:-1:-1;;;;;19464:187:65;19494:10;:18;;;-1:-1:-1;;;;;19464:187:65;;19598:10;:17;;;19629:12;19464:187;;;;;;27802:25:70;;;27870:14;27863:22;27858:2;27843:18;;27836:50;27790:2;27775:18;;27634:258;19464:187:65;;;;;;;;18738:920;18661:997;;:::o;16041:1968::-;16152:34;16189:31;:12;16206:13;16189:16;:31::i;:::-;16152:68;;16238:19;:10;:17;:19::i;:::-;16293:13;16230:78;;;;;-1:-1:-1;;;16230:78:65;;;;;;;;:::i;:::-;;16337:10;:17;;;16326:7;:28;;16392:13;16407:7;16318:98;;;;;;-1:-1:-1;;;16318:98:65;;;;;;;;;:::i;:::-;-1:-1:-1;;16483:17:65;;;;16514:19;;;16510:263;;;16549:107;16581:15;:13;:15::i;:::-;16598:18;;16618:19;16628:9;16618:7;:19;:::i;:::-;16549:26;;:107;;16639:16;16549:31;:107::i;:::-;16510:263;;;16722:18;;16687:75;;16742:19;16754:7;16742:9;:19;:::i;:::-;16687:26;;:75;:34;:75::i;:::-;16878:35;16916:22;:20;:22::i;:::-;-1:-1:-1;;;;;16916:49:65;;16979:10;:31;;;16916:104;;;;;;;;;;;;;1776:25:70;;1764:2;1749:18;;1630:177;16916:104:65;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;16878:142;;17030:42;17076:25;:10;:23;:25::i;:::-;17075:26;:125;;17199:1;17075:125;;;17146:38;;;;17116:68;;:27;:68;:::i;:::-;-1:-1:-1;;;;;17244:27:65;;;;;;:12;:27;;;;;:34;;;:44;;;17298:55;;:85;;;17030:170;-1:-1:-1;17442:22:65;:20;:22::i;:::-;-1:-1:-1;;;;;17442:34:65;;17490:9;17513:34;17442:115;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1;;;;;17393:27:65;;;;;;:12;:27;;;;;:45;;:164;;:45;;:27;:164;;;;;:::i;:::-;;;;-1:-1:-1;;17641:19:65;;;17637:245;;;17738:19;17748:9;17738:7;:19;:::i;:::-;17676:24;:57;17701:10;:31;;;17676:57;;;;;;;;;;;;:82;;;;;;;:::i;:::-;;;;-1:-1:-1;17637:245:65;;-1:-1:-1;17637:245:65;;17851:19;17863:7;17851:9;:19;:::i;:::-;17789:24;:57;17814:10;:31;;;17789:57;;;;;;;;;;;;:82;;;;;;;:::i;:::-;;;;-1:-1:-1;;17637:245:65;17950:10;:31;;;17935:13;-1:-1:-1;;;;;17897:105:65;17915:10;:18;;;-1:-1:-1;;;;;17897:105:65;;17983:7;17992:9;17897:105;;;;;;;:::i;:::-;;;;;;;;16142:1867;;;;16041:1968;;;:::o;7068:281:21:-;7157:4;7165;7157:12;;;;7149:63;;;;-1:-1:-1;;;7149:63:21;;;;;;;;;:::i;:::-;-1:-1:-1;;7222:23:21;:30;;;7262:23;:30;;;7307:35;;;;;;7248:4;;7288;;7307:35;:::i;:::-;;;;;;;;7068:281;;:::o;3170:176:42:-;1979:19;:17;:19::i;:::-;3229:25:::1;3257:21;:19;:21::i;:::-;3288:16:::0;;-1:-1:-1;;3288:16:42::1;3300:4;3288:16;::::0;;3229:49;-1:-1:-1;3319:20:42::1;3326:12;966:10:40::0;;887:96;2720:156:43;2839:21;;2720:156::o;6299:155::-;6353:13;6378:23;6404:19;:17;:19::i;:::-;6378:45;;6440:1;:7;;6433:14;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6299:155;:::o;6681:161::-;6738:13;6763:23;6789:19;:17;:19::i;:::-;6763:45;;6825:1;:10;;6818:17;;;;;:::i;1192:159:38:-;1313:22;;1192:159::o;3916:253:46:-;3999:12;4024;4038:23;4065:6;-1:-1:-1;;;;;4065:19:46;4085:4;4065:25;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4023:67;;;;4107:55;4134:6;4142:7;4151:10;4107:26;:55::i;:::-;4100:62;3916:253;-1:-1:-1;;;;;3916:253:46:o;20474:3066:57:-;20556:7;;;20652:93;;;;20676:4;20652:93;:::i;:::-;20776:13;;:29;;;20575:170;;-1:-1:-1;20575:170:57;-1:-1:-1;20809:7:57;-1:-1:-1;;;;;20776:40:57;;;;;;;20755:155;;;;-1:-1:-1;;;20755:155:57;;;;;;;;;:::i;:::-;-1:-1:-1;;21122:13:57;;:26;-1:-1:-1;;;;;21114:56:57;;;21093:163;;;;-1:-1:-1;;;21093:163:57;;;;;;1776:25:70;;1764:2;1749:18;;1630:177;21093:163:57;-1:-1:-1;21313:13:57;;:26;21266:20;21389:30;:12;21313:26;21389:16;:30::i;:::-;21523:18;;21352:67;;-1:-1:-1;21545:7:57;;-1:-1:-1;;;;;21523:29:57;;;;;;;21515:94;;;;-1:-1:-1;;;21515:94:57;;;;;;;;;:::i;:::-;-1:-1:-1;;21650:31:57;;;;21732:25;21746:7;21619:28;21732:13;:25::i;:::-;21863:23;21896:22;21942:21;21966:13;:11;:13::i;:::-;-1:-1:-1;;;;;21966:23:57;;21998:4;21966:38;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;21942:62;;22037:22;:20;:22::i;:::-;-1:-1:-1;;;;;22037:30:57;;22085:36;22139:99;22161:9;22172:11;:9;:11::i;:::-;-1:-1:-1;;;;;22172:21:57;;22194:20;22172:43;;;;;;;;;;;;;1776:25:70;;1764:2;1749:18;;1630:177;22172:43:57;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;:65;;22236:1;22139:21;:99::i;22172:65::-;22218:15;;22139:21;:99::i;:::-;22256:15;22037:248;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;22019:266;;22300:20;22323:13;:11;:13::i;:::-;-1:-1:-1;;;;;22323:23:57;;22355:4;22323:38;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;22300:61;-1:-1:-1;22399:13:57;22300:61;22383:29;;;;22375:106;;;;-1:-1:-1;;;22375:106:57;;;;;;;;;:::i;:::-;-1:-1:-1;22512:28:57;;-1:-1:-1;22527:13:57;22512:12;:28;:::i;:::-;22495:45;-1:-1:-1;;22565:19:57;;;-1:-1:-1;22561:726:57;;22656:173;22684:7;22727:16;;22709:15;:34;;;;:::i;:::-;22779:17;:15;:17::i;:::-;-1:-1:-1;;;;;22779:34:57;;:36;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;22761:54;;-1:-1:-1;;;;;22761:54:57;:15;:54;:::i;:::-;22656:10;:173::i;:::-;22848:18;;22844:433;;22977:22;:20;:22::i;:::-;-1:-1:-1;;;;;22977:45:57;;23023:20;22977:67;;;;;;;;;;;;;1776:25:70;;1764:2;1749:18;;1630:177;22977:67:57;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;23125:62;23158:11;:9;:11::i;:::-;23172:14;23125:13;:11;:13::i;:::-;-1:-1:-1;;;;;23125:24:57;;:62;:24;:62::i;:::-;23205:11;:9;:11::i;:::-;-1:-1:-1;;;;;23205:19:57;;23225:20;23247:14;23205:57;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;22844:433;23355:13;;:19;;;;;23302:199;;;31576:25:70;;;31617:18;;;31610:34;;;31660:18;;31653:34;;;-1:-1:-1;;;;;23302:199:57;;;;;;;;;;;;;;31564:2:70;31549:18;23302:199:57;;;;;;;-1:-1:-1;23518:15:57;20474:3066;-1:-1:-1;;;;;;;;;20474:3066:57:o;23977:498::-;24065:7;;;;24150:43;;;;24161:4;24150:43;:::i;:::-;24084:109;;-1:-1:-1;24084:109:57;-1:-1:-1;24084:109:57;-1:-1:-1;;;;;;24224:49:57;;:30;:12;24084:109;24224:16;:30::i;:::-;:38;24326:7;;24335:12;;-1:-1:-1;;;;;24224:49:57;;24203:155;;;;-1:-1:-1;;;24203:155:57;;;;;;;;;:::i;:::-;-1:-1:-1;;24421:16:57;;-1:-1:-1;;;;;24439:28:57;;;;;;;:19;:28;;;;;;24375:93;;24387:12;;24401:4;;24407:12;;-1:-1:-1;;;24421:16:57;;;;;24439:28;24375:11;:93::i;:::-;24368:100;23977:498;-1:-1:-1;;;;;;;23977:498:57:o;20829:200:65:-;20921:4;20945:77;20978:15;:13;:15::i;:::-;20945:26;;20995:8;21005:16;20945:32;:77::i;:::-;20944:78;;20829:200;-1:-1:-1;;;20829:200:65:o;4102:87:69:-;4174:8;;4102:87::o;9071:205:39:-;9129:30;;3147:66;9186:27;8819:122;1847:127:38;6929:20:39;:18;:20::i;:::-;1929:38:38::1;1954:12;1929:24;:38::i;1218:61:41:-:0;6929:20:39;:18;:20::i;2912:148:12:-;6929:20:39;:18;:20::i;:::-;2978:35:12::1;:33;:35::i;:::-;3023:30;:28;:30::i;1669:156:16:-:0;6929:20:39;:18;:20::i;:::-;1743:27:16::1;:25;:27::i;6685:198:65:-:0;6929:20:39;:18;:20::i;:::-;6800:30:65::1;6814:5;6821:8;6800:13;:30::i;:::-;6840:36;:34;:36::i;25105:258:57:-:0;25188:17;25209:1;25188:22;25180:77;;;;-1:-1:-1;;;25180:77:57;;;;;;;;;;;;25267:16;:36;;;25318:38;;1776:25:70;;;25318:38:57;;1764:2:70;1749:18;25318:38:57;1630:177:70;3624:106:69;3708:15;;3624:106::o;6369:206:21:-;6450:49;6476:16;6494:4;6450:25;:49::i;:::-;6509:15;:13;:15::i;:::-;-1:-1:-1;;;;;6509:41:21;;6551:16;6509:59;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6369:206;:::o;20313:230:65:-;20409:7;20435:101;2088:68;20510:8;20520:13;20462:72;;;;;;;;;32489:25:70;;;-1:-1:-1;;;;;32550:32:70;;;32545:2;32530:18;;32523:60;32619:32;32614:2;32599:18;;32592:60;32477:2;32462:18;;32287:371;20462:72:65;;;;;;;;;;;;;20452:83;;;;;;20435:16;:101::i;8531:1573::-;-1:-1:-1;;;;;8776:27:65;;8768:80;;;;-1:-1:-1;;;8768:80:65;;;;;;;;;;;;8859:65;8882:8;8892:13;8907:16;8859:22;:65::i;:::-;9077;9111:15;:13;:15::i;:::-;9077:18;;9128:13;9077:33;:65::i;:::-;9153:20;9176;:18;:20::i;:::-;-1:-1:-1;;;;;9176:33:65;;:35;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;9153:58;;9221:34;9258:246;9291:8;9313:13;9340:21;9375:7;9396:22;:20;:22::i;:::-;-1:-1:-1;;;;;9396:49:65;;9446:21;9396:72;;;;;;;;;;;;;1776:25:70;;1764:2;1749:18;;1630:177;9396:72:65;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;9258:12;;:246;;;;9482:12;9258:19;:246::i;:::-;9221:283;;9657:85;9689:15;:13;:15::i;:::-;9657:26;;9706:8;9716:7;9725:16;9657:31;:85::i;:::-;9966:10;:17;;;9894:24;:57;9919:10;:31;;;9894:57;;;;;;;;;;;;:89;;;;:::i;:::-;9822:24;:57;9847:10;:31;;;9822:57;;;;;;;;;;;:161;;;;10042:21;10027:13;-1:-1:-1;;;;;9999:98:65;10017:8;-1:-1:-1;;;;;9999:98:65;;10065:10;:17;;;10084:12;9999:98;;;;;;;:::i;:::-;;;;;;;;8758:1346;;8531:1573;;;;;;:::o;3868:122:69:-;3962:21;;3868:122::o;6597:267:61:-;6680:4;6696:24;6741:49;6750:4;:14;;;6766:4;:23;;;6741:8;:49::i;:::-;6723:67;;:15;:67;:::i;:::-;6696:94;;6807:13;:4;:11;:13::i;:::-;:50;;;;;6843:14;6824:16;:33;6807:50;6800:57;6597:267;-1:-1:-1;;;;6597:267:61:o;7551:127::-;7615:4;7638:13;:4;7092:14;;;:19;;;7011:107;7638:13;:33;;;;-1:-1:-1;;7655:11:61;;;:16;;7551:127::o;13114:234:21:-;13246:28;:6;13263:4;13269;13246:16;:28::i;:::-;13305:14;13321:6;13329:4;13335;13238:103;;;;;;;;-1:-1:-1;;;13238:103:21;;;;;;;;;;;:::i;2909:126:42:-;2972:8;:6;:8::i;:::-;2967:62;;3003:15;;-1:-1:-1;;;3003:15:42;;;;;;;;;;;6153:127:14;6221:7;6247:16;;;:6;:16;;;;;:26;;;;6153:127::o;4461:726::-;4543:4;4549:12;4573:23;4599:24;4614:8;4599:14;:24::i;:::-;4573:50;;4681:15;4660:5;:18;;;:36;4656:103;;;-1:-1:-1;;1301:9:33;;;;;;;;;-1:-1:-1;1301:9:33;;4720:4:14;;-1:-1:-1;4712:36:14;;4656:103;4788:21;4811:23;4849:4;4838:36;;;;;;;;;;;;:::i;:::-;4950:12;;4787:87;;-1:-1:-1;4787:87:14;-1:-1:-1;4904:59:14;;:20;;4787:87;;4904:28;:59::i;:::-;5014:8;4997:15;-1:-1:-1;;;;;4978:79:14;;5024:5;:12;;;5038:5;:18;;;4978:79;;;;;;;:::i;:::-;;;;;;;;5120:12;;5104:28;;:13;:28;:::i;:::-;5093:57;;;;;;33652:25:70;;;;-1:-1:-1;;;;;33713:32:70;;33693:18;;;33686:60;33625:18;;5093:57:14;;;;;;;;;;;;5086:64;;5168:5;5175:4;5160:20;;;;;;;4461:726;;;;;;:::o;5397:93::-;5467:16;;;;:6;:16;;;;;5460:23;;;;;;;;;;;;;;;;;;5397:93::o;4803:945:33:-;5119:7;5128:12;5174:4;:10;;;5160;:24;;5152:64;;;;-1:-1:-1;;;5152:64:33;;;;;;;;;;;;5227:17;5272:15;;5271:43;;5304:10;5271:43;;;5291:4;:10;;;5271:43;5342:9;;5258:56;;-1:-1:-1;5362:335:33;5369:20;;;;;:38;;;5406:1;5393:10;:14;5369:38;5362:335;;;5424:16;5442:17;5463:35;5475:6;5483:14;5463:11;:35;;:::i;:::-;5423:75;;;;5517:11;5513:22;;;5530:5;;;;5513:22;5567:4;-1:-1:-1;5567:4:33;5594:40;:4;5610:11;5623:10;5594:15;:40::i;:::-;5585:49;-1:-1:-1;5649:12:33;;;;:::i;:::-;;;;5675:11;;;;;:::i;:::-;;;;5409:288;;5362:335;;;-1:-1:-1;5715:9:33;5726:14;;-1:-1:-1;4803:945:33;;-1:-1:-1;;;;;;4803:945:33:o;1904:375:63:-;-1:-1:-1;;;;;2096:18:63;;;;;;;;;;;;;;;;:25;;;;;;;;;;;;;;;;;;;;;;;;;;;:27;;:25;:27::i;:::-;2095:28;2155:12;2087:82;;;;;-1:-1:-1;;;2087:82:63;;;;;;;;:::i;:::-;-1:-1:-1;2201:71:63;;;;;;;;-1:-1:-1;;;;;2201:71:63;;;;;;;;;;;;2180:18;;;-1:-1:-1;2180:18:63;;;;;;;;;;:92;;;;-1:-1:-1;;;;;;2180:92:63;;;;;;;;;;;-1:-1:-1;2180:92:63;;;;1904:375::o;7930:278:61:-;-1:-1:-1;;;;;8080:18:61;;;8028:13;8080:18;;;;;;;;;;;8116:17;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8028:13;;8116:19;;7092:14;;;:19;;;7011:107;8116:19;8160:12;8108:66;;;;;-1:-1:-1;;;8108:66:61;;;;;;;;:::i;:::-;-1:-1:-1;8191:10:61;7930:278;-1:-1:-1;;;7930:278:61:o;7144:117:37:-;7233:21;;7144:117::o;4561:400:61:-;4734:24;4761;4766:4;4772:12;4761:4;:24::i;:::-;4803:17;;;;;;;;;;-1:-1:-1;;;;;4803:17:61;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4734:51;;-1:-1:-1;4803:19:61;;:17;:19::i;:::-;4855;;;;4841:12;;4795:81;;;;-1:-1:-1;;;4795:81:61;;;;;;;;;:::i;:::-;-1:-1:-1;;4886:38:61;;:68;-1:-1:-1;;4561:400:61:o;5737:292::-;5833:24;5860;5865:4;5871:12;5860:4;:24::i;:::-;5902:17;;;;;;;;;;-1:-1:-1;;;;;5902:17:61;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5833:51;;-1:-1:-1;5902:19:61;;:17;:19::i;:::-;5954;;;;5940:12;;5894:81;;;;-1:-1:-1;;;5894:81:61;;;;;;;;;:::i;:::-;-1:-1:-1;;6007:15:61;5985:19;;;;:37;-1:-1:-1;;5737:292:61:o;2591:307:20:-;2714:6;2724:1;2714:11;2710:24;;2591:307;;;:::o;2710:24::-;-1:-1:-1;;;;;2751:21:20;;;;;;;;;;;;;;2776:6;2751:31;;;;2743:107;;;;-1:-1:-1;;;2743:107:20;;;;;;;;;:::i;:::-;-1:-1:-1;;;;;;;2860:21:20;;;;;;;;;;;;;:31;;2885:6;;2860:21;:31;;2885:6;;2860:31;:::i;:::-;;;;-1:-1:-1;;;;;2591:307:20:o;1637:590::-;1853:24;;1870:7;1853:24;-1:-1:-1;;;;;1912:21:20;;1887:22;1912:21;;;;;;;;;;;:30;;1936:6;;1912:30;:::i;:::-;1887:55;;1952:23;1978:12;-1:-1:-1;;;;;1978:31:20;;2010:15;2035:4;2042:15;1978:80;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;1952:106;-1:-1:-1;1952:106:20;2076:14;:33;;;;2068:111;;;;-1:-1:-1;;;2068:111:20;;;;;;;;;:::i;:::-;-1:-1:-1;;;;;;;2189:21:20;;;;;;;;;;;;;:31;;2214:6;;2189:21;:31;;2214:6;;2189:31;:::i;:::-;;;;-1:-1:-1;;;;1637:590:20;;;;;:::o;4437:582:46:-;4581:12;4610:7;4605:408;;4633:19;4641:10;4633:7;:19::i;:::-;4605:408;;;4857:17;;:22;:49;;;;-1:-1:-1;;;;;;4883:18:46;;;:23;4857:49;4853:119;;;4950:6;4933:24;;-1:-1:-1;;;4933:24:46;;;;;;;;:::i;4853:119::-;-1:-1:-1;4992:10:46;4985:17;;5825:94:37;5901:11;;5825:94::o;25639:269:57:-;25870:13;;:29;;;;;-1:-1:-1;;;;;25850:50:57;;;;;;;:19;:50;;;;;;;;;25815:86;;25784:12;;25815:86;;25826:9;;25837:11;;25850:50;;;;;25815:86;;:::i;:::-;;;;;;;;;;;;;25808:93;;25639:269;;;;:::o;1865:860:14:-;1981:7;1992:1;1981:12;1973:50;;;;-1:-1:-1;;;1973:50:14;;;;;;;;;;;;2033:87;2059:15;:13;:15::i;:::-;2103:16;;2033:20;;:87;2076:16;;2094:7;;2103:16;-1:-1:-1;;;2103:16:14;;;;;;2033:25;:87;:::i;:::-;-1:-1:-1;;;;;2168:29:14;;2131:34;2168:29;;;:11;:29;;;;;;;;2300:16;;;;;6618:57;;-1:-1:-1;;;;;;6643:4:14;38869:2:70;38840:15;;;38836:45;;6618:57:14;;;38824:58:70;38916:15;;;38912:45;38898:12;;;38891:67;38974:12;;;;38967:28;;;;6618:57:14;;;;;;;;;;39011:12:70;;;6618:57:14;;;6608:68;;;;;;;;;2345:170;;;;;;;;2410:15;2345:170;;;;;;;;;;;;;;;;;;;2327:15;;;:6;:15;;;;;;;:188;;;;;;;;;;;;;;;;;;;;;;;2529:16;;;2168:29;;6608:68;2529:21;2525:70;;2559:15;;;;2552:23;;;;:6;:23;;;;;:33;;:43;;;2525:70;2605:27;:10;2624:7;2605:18;:27::i;:::-;2683:7;2665:16;-1:-1:-1;;;;;2648:70:14;;2692:7;2701:16;2648:70;;;;;;;:::i;:::-;;;;;;;;1963:762;;1865:860;;;:::o;1050:198:11:-;1148:11;;1144:98;;1183:34;;-1:-1:-1;;;1183:34:11;;-1:-1:-1;;;;;1183:20:11;;;;;:34;;1204:3;;1209:7;;1183:34;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;1175:56;;;;-1:-1:-1;;;1175:56:11;;36122:2:70;1175:56:11;;;36104:21:70;36161:1;36141:18;;;36134:29;-1:-1:-1;;;36179:18:70;;;36172:39;36228:18;;1175:56:11;35920:332:70;11846:3420:65;12050:7;;12106:31;:12;12123:13;12106:16;:31::i;:::-;12069:68;;12155:19;:10;:17;:19::i;:::-;12210:13;12147:78;;;;;-1:-1:-1;;;12147:78:65;;;;;;;;:::i;:::-;;12295:21;12321:35;12340:15;;12321:10;:18;;:35;;;;:::i;:::-;12320:36;:78;;;;;12373:25;:10;:23;:25::i;:::-;12372:26;12320:78;:112;;;;-1:-1:-1;12414:18:65;;;12320:112;12319:181;;;;;12475:10;:25;;;12437:20;:18;:20::i;:::-;-1:-1:-1;;;;;12437:33:65;;:35;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;:63;12319:181;:261;;12579:1;12319:261;;;12515:22;:20;:22::i;:::-;-1:-1:-1;;;;;12515:34:65;;12550:13;12515:49;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;12295:285;;12700:161;12742:13;12769:22;:20;:22::i;:::-;-1:-1:-1;;;;;12769:49:65;;12819:10;:31;;;12769:82;;;;;;;;;;;;;1776:25:70;;1764:2;1749:18;;1630:177;12700:161:65;12871:38;:12;12895:13;12871:23;:38::i;:::-;12982:47;:12;13015:13;12982:32;:47::i;:::-;13040:28;;13131:18;;13127:1531;;13213:20;13236:15;:13;:15::i;:::-;13289:18;;13236:177;;-1:-1:-1;;;13236:177:65;;-1:-1:-1;;;;;13236:35:65;;;;;;;:177;;13333:4;;13356:43;;13236:177;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;13213:200;;13427:57;13487:15;:13;:15::i;:::-;13538:18;;13487:114;;-1:-1:-1;;;13487:114:65;;-1:-1:-1;;;;;13487:33:65;;;;;;;:114;;13582:4;;13487:114;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;13427:174;;13768:1;13744:14;:21;;;:25;:66;;13809:1;13744:66;;;13772:34;:13;13793:12;13772:20;:34::i;:::-;13718:92;-1:-1:-1;13828:27:65;;13824:251;;13875:13;:11;:13::i;:::-;-1:-1:-1;;;;;13875:21:65;;13905:15;:13;:15::i;:::-;13923:23;13875:72;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;13965:15;:13;:15::i;:::-;14001:18;;13965:95;;-1:-1:-1;;;13965:95:65;;-1:-1:-1;;;;;13965:35:65;;;;;;;:95;;14029:4;;14036:23;;13965:95;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;13824:251;14157:39;14173:23;14157:13;:39;:::i;:::-;14134:62;-1:-1:-1;14214:24:65;;14210:438;;-1:-1:-1;;;;;14262:34:65;;14258:376;;14320:13;:11;:13::i;:::-;-1:-1:-1;;;;;14320:21:65;;14350:15;:13;:15::i;:::-;14368:20;14320:69;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;14411:15;:13;:15::i;:::-;14444:18;;14411:89;;-1:-1:-1;;;14411:89:65;;-1:-1:-1;;;;;14411:32:65;;;;;;;:89;;14472:4;;14479:20;;14411:89;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;14258:376;;;14547:68;14572:20;14594;14547:13;:11;:13::i;:68::-;13151:1507;;13127:1531;14770:31;;;;14711:18;;-1:-1:-1;;;;;14673:329:65;;;;;;14815:13;14842:20;14876:23;14913:4;14931:12;14957:20;:18;:20::i;:::-;-1:-1:-1;;;;;14957:33:65;;:35;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;14673:329;;;;;;;;;;;:::i;:::-;;;;;;;;15128:18;;15111:54;;15148:16;15111;:54::i;:::-;15107:122;;;15181:37;15198:13;15213:4;15181:16;:37::i;:::-;-1:-1:-1;15246:13:65;;11846:3420;-1:-1:-1;;;;;;;;11846:3420:65:o;3357:383:20:-;3554:4;3570:23;3596:12;-1:-1:-1;;;;;3596:31:20;;3628:15;3653:4;3660:15;3596:80;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1;;;;;3693:21:20;;;;;;;;;;;;;;:40;;;-1:-1:-1;;3357:383:20;;;;;;:::o;7082:141:39:-;7149:17;:15;:17::i;:::-;7144:73;;7189:17;;-1:-1:-1;;;7189:17:39;;;;;;;;;;;1980:235:38;6929:20:39;:18;:20::i;5676:397:21:-;6929:20:39;:18;:20::i;:::-;5757:84:21::1;2047:17;-1:-1:-1::0;;5757:24:21::1;:84::i;:::-;5851:72;1523:16;452:9:35;5851:20:21;:72::i;:::-;5933:78;1784:16;-1:-1:-1::0;;;;;5933:22:21::1;:78::i;:::-;6021:45;2304:16;6021:19;:45::i;3446:147:43:-:0;6929:20:39;:18;:20::i;:::-;3548:38:43::1;3572:4;3578:7;3548:23;:38::i;9617:257:21:-:0;9730:42;9775:31;9789:16;9775:13;:31::i;:::-;9730:76;;9816:51;9842:9;9853:13;9816:25;:51::i;4946:176:43:-;5023:7;5049:66;5082:20;:18;:20::i;:::-;5104:10;4049:4:51;4043:11;-1:-1:-1;;;4067:23:51;;4119:4;4110:14;;4103:39;;;;4171:4;4162:14;;4155:34;4227:4;4212:20;;;3874:374;21414:317:65;21531:14;21548:70;21562:47;21585:8;21595:13;21562:22;:47::i;:::-;21611:6;21548:13;:70::i;:::-;21531:87;-1:-1:-1;21531:87:65;21646:13;-1:-1:-1;;;;;21636:23:65;;;;;;;21628:96;;;;-1:-1:-1;;;21628:96:65;;;;;;;;;:::i;:::-;;;21521:210;21414:317;;;:::o;3104:363:63:-;-1:-1:-1;;;;;3283:18:63;;;;;;;;;;;;;;;;:25;;;;;;;;;;;;;;;;;;;;;;;;;;;:27;;:25;:27::i;:::-;3282:28;3342:12;3274:82;;;;;-1:-1:-1;;;3274:82:63;;;;;;;;:::i;:::-;-1:-1:-1;3375:39:63;;-1:-1:-1;;;3375:39:63;;-1:-1:-1;;;;;3375:25:63;;;;;:39;;3401:12;;3375:39;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;3374:40;3446:12;3366:94;;;;;-1:-1:-1;;;3366:94:63;;;;;;;;:::i;:::-;;3104:363;;;:::o;6911:111:37:-;6996:19;;6911:111::o;2747:875:61:-;3029:12;;:::i;:::-;-1:-1:-1;;;;;3062:18:61;;;;;;;;;;;;;;;;:25;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:27;;7092:14;;;:19;;;7011:107;3062:27;3061:28;3115:12;3053:76;;;;;-1:-1:-1;;;3053:76:61;;;;;;;;:::i;:::-;-1:-1:-1;;3166:379:61;;;;;;;;-1:-1:-1;;;;;3166:379:61;;;;;;;;;;;;;;;;;;3311:15;3166:379;;;;;;-1:-1:-1;3166:379:61;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3556:18;;;;;;;;;;;;;:31;;;;-1:-1:-1;;;;;;3556:31:61;;;;;;;;;;;-1:-1:-1;3556:31:61;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3166:379;2747:875::o;5435:111:52:-;5493:7;5312:5;;;5527;;;5311:36;5306:42;;5519:20;5071:294;624:141:36;707:4;739:3;730:5;:12;;:28;;;;-1:-1:-1;;746:12:36;;;;;723:35;-1:-1:-1;624:141:36:o;5649:243:14:-;5713:17;-1:-1:-1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5713:17:14;5742:23;5768:16;;;:6;:16;;;;;;;;;5742:42;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5775:8;;5794:69;;;;-1:-1:-1;;;5794:69:14;;;;;;1776:25:70;;1764:2;1749:18;;1630:177;3288:459:33;3459:7;3499:1;3486:4;:10;;;:14;3478:46;;;;-1:-1:-1;;;3478:46:33;;;;;;;;;;;;3534:16;3553:22;3565:4;:9;;;3553:11;:22;;:::i;:::-;3534:41;;3585:21;3596:4;:9;;;3585:10;:21;;:::i;:::-;3630:1;3616:4;:10;;;:15;;;;;;;:::i;:::-;;;;-1:-1:-1;;3641:20:33;;;3675:10;;;;3641:9;3675:15;3671:43;;3712:1;3692:9;;;:22;3671:43;-1:-1:-1;;3731:9:33;;;3288:459;-1:-1:-1;;3288:459:33:o;3626:114:63:-;3707:12;-1:-1:-1;;;;;3707:26:63;;;;3626:114::o;5559:487:46:-;5690:17;;:21;5686:354;;5887:10;5881:17;5943:15;5930:10;5926:2;5922:19;5915:44;5686:354;6010:19;;-1:-1:-1;;;6010:19:46;;;;;;;;;;;2446:319:33;1415:6;2521:4;:10;;;:22;2513:64;;;;-1:-1:-1;;;2513:64:33;;;;;;;;;;;;2595:2;2587:52;;;;-1:-1:-1;;;2587:52:33;;;;;;;;;;;;2649:9;;;;:14;;;2673:10;;;:15;;:10;;:15;;2649:9;;2673:15;:::i;:::-;;;;-1:-1:-1;;2702:10:33;;;;2716:1;2702:15;2698:35;;2719:14;;;2698:35;2757:1;2743:4;:10;;;:15;;;;;;;:::i;:::-;;;;-1:-1:-1;;;;2446:319:33:o;3903:307:61:-;4004:24;4031;4036:4;4042:12;4031:4;:24::i;:::-;4073:17;;;;;;;;;;-1:-1:-1;;;;;4073:17:61;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4004:51;;-1:-1:-1;4073:19:61;;:17;:19::i;:::-;4125;;;;4111:12;;4065:81;;;;-1:-1:-1;;;4065:81:61;;;;;;;;;:::i;:::-;-1:-1:-1;;4188:15:61;4156:29;;;;:47;-1:-1:-1;;3903:307:61:o;5224:301::-;5334:24;5361;5366:4;5372:12;5361:4;:24::i;:::-;5403:17;;;;;;;;;;-1:-1:-1;;;;;5403:17:61;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5334:51;;-1:-1:-1;5403:19:61;;:17;:19::i;:::-;5455;;;;5441:12;;5395:81;;;;-1:-1:-1;;;5395:81:61;;;;;;;;;:::i;:::-;-1:-1:-1;;5517:1:61;5486:28;;;;:32;-1:-1:-1;;5224:301:61:o;1099:188:35:-;1160:7;1187:13;1198:1;452:9;-1:-1:-1;2073:16:35;;1992:104;1187:13;:30;;;;1204:13;1215:1;452:9;-1:-1:-1;2073:16:35;;1992:104;1204:13;1240:1;1243;1179:67;;;;;;-1:-1:-1;;;1179:67:35;;;;;;;;;:::i;:::-;-1:-1:-1;452:9:35;;-1:-1:-1;1264:5:35;1268:1;1264;:5;:::i;:::-;1263:17;;;;:::i;8485:120:39:-;8535:4;8558:26;:24;:26::i;:::-;:40;-1:-1:-1;;;8558:40:39;;;;;;-1:-1:-1;8485:120:39:o;7565:348:21:-;7648:4;7656;7648:12;;;;;;;;;7640:63;;;;-1:-1:-1;;;7640:63:21;;;;;;;;;:::i;:::-;-1:-1:-1;7776:4:21;;-1:-1:-1;7721:24:21;;;;452:9:35;-1:-1:-1;2073:16:35;7713:75:21;;;;-1:-1:-1;;;7713:75:21;;;;;;;;;:::i;:::-;-1:-1:-1;;7798:19:21;:26;;;7834;;;-1:-1:-1;;;7834:26:21;-1:-1:-1;;;;7798:26:21;;;-1:-1:-1;;;7798:26:21;7834;;;;-1:-1:-1;;;;;;;;7834:26:21;;;;;;;;;;7875:31;;;;;;7820:4;;7856;;7875:31;:::i;8127:271::-;8212:4;8220;-1:-1:-1;;;;;8212:12:21;;;;;;;;8204:63;;;;-1:-1:-1;;;8204:63:21;;;;;;;;;:::i;:::-;-1:-1:-1;;8277:21:21;:28;;-1:-1:-1;;;;;8315:28:21;;;-1:-1:-1;;;8315:28:21;-1:-1:-1;;;;;;8315:28:21;;;8277;;;8315;;;;8358:33;;;;;;8301:4;;8339;;8358:33;:::i;3599:330:43:-;6929:20:39;:18;:20::i;:::-;3711:23:43::1;3737:19;:17;:19::i;:::-;3711:45:::0;-1:-1:-1;3766:7:43::1;::::0;::::1;:14;3776:4:::0;3766:7;:14:::1;:::i;:::-;-1:-1:-1::0;3790:10:43::1;::::0;::::1;:20;3803:7:::0;3790:10;:20:::1;:::i;:::-;-1:-1:-1::0;3891:1:43::1;3875:17:::0;;;3902:16:::1;::::0;;::::1;:20:::0;-1:-1:-1;;3599:330:43:o;4015:109::-;4068:7;4094:23;:21;:23::i;3714:255:50:-;3792:7;3812:17;3831:18;3851:16;3871:27;3882:4;3888:9;3871:10;:27::i;:::-;3811:87;;;;;;3908:28;3920:5;3927:8;3908:11;:28::i;:::-;-1:-1:-1;3953:9:50;;3714:255;-1:-1:-1;;;;3714:255:50:o;4130:191:43:-;4185:7;2073:95;4243:17;:15;:17::i;:::-;4262:20;:18;:20::i;:::-;4221:92;;;;;;40101:25:70;;;;40142:18;;40135:34;;;;40185:18;;;40178:34;4284:13:43;40228:18:70;;;40221:34;4307:4:43;40271:19:70;;;40264:61;40073:19;;4221:92:43;;;;;;;;;;;;4211:103;;;;;;4204:110;;4130:191;:::o;2129:778:50:-;2232:17;2251:16;2269:14;2299:9;:16;2319:2;2299:22;2295:606;;2604:4;2589:20;;2583:27;2653:4;2638:20;;2632:27;2710:4;2695:20;;2689:27;2337:9;2681:36;2751:25;2762:4;2681:36;2583:27;2632;2751:10;:25::i;:::-;2744:32;;;;;;;;;;;2295:606;-1:-1:-1;;2872:16:50;;2823:1;;-1:-1:-1;2827:35:50;;2295:606;2129:778;;;;;:::o;7280:532::-;7375:20;7366:5;:29;;;;;;;;:::i;:::-;;7362:444;;7280:532;;:::o;7362:444::-;7471:29;7462:5;:38;;;;;;;;:::i;:::-;;7458:348;;7523:23;;-1:-1:-1;;;7523:23:50;;;;;;;;;;;7458:348;7576:35;7567:5;:44;;;;;;;;:::i;:::-;;7563:243;;7634:46;;-1:-1:-1;;;7634:46:50;;;;;1776:25:70;;;1749:18;;7634:46:50;1630:177:70;7563:243:50;7710:30;7701:5;:39;;;;;;;;:::i;:::-;;7697:109;;7763:32;;-1:-1:-1;;;7763:32:50;;;;;1776:25:70;;;1749:18;;7763:32:50;1630:177:70;7057:687:43;7107:7;7126:23;7152:19;:17;:19::i;:::-;7126:45;;7181:18;7202:13;:11;:13::i;:::-;7229:18;;7181:34;;-1:-1:-1;7229:22:43;7225:513;;7274:22;;;;;;;;7057:687;-1:-1:-1;;7057:687:43:o;7225:513::-;7571:13;;7602:15;;7598:130;;7644:10;7057:687;-1:-1:-1;;;7057:687:43:o;7598:130::-;7700:13;7693:20;;;;;7057:687;:::o;7965:723::-;8018:7;8037:23;8063:19;:17;:19::i;:::-;8037:45;;8092:21;8116:16;:14;:16::i;:::-;8146:21;;8092:40;;-1:-1:-1;8146:25:43;8142:540;;8194:25;;;;;;;;7965:723;-1:-1:-1;;7965:723:43:o;8142:540::-;8506:16;;;;8540:18;;8536:136;;8585:13;7965:723;-1:-1:-1;;;7965:723:43:o;5203:1551:50:-;5329:17;;;-1:-1:-1;;;;;6270:79:50;;6266:164;;;-1:-1:-1;6381:1:50;;-1:-1:-1;6385:30:50;;-1:-1:-1;6417:1:50;6365:54;;6266:164;6541:24;;;6524:14;6541:24;;;;;;;;;40563:25:70;;;40636:4;40624:17;;40604:18;;;40597:45;;;;40658:18;;;40651:34;;;40701:18;;;40694:34;;;6541:24:50;;40535:19:70;;6541:24:50;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;6541:24:50;;-1:-1:-1;;6541:24:50;;;-1:-1:-1;;;;;;;6579:20:50;;6575:113;;-1:-1:-1;6631:1:50;;-1:-1:-1;6635:29:50;;-1:-1:-1;6631:1:50;;-1:-1:-1;6615:62:50;;6575:113;6706:6;-1:-1:-1;6714:20:50;;-1:-1:-1;6714:20:50;;-1:-1:-1;5203:1551:50;;;;;;;;;:::o;-1:-1:-1:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;14:131:70:-;-1:-1:-1;;;;;89:31:70;;79:42;;69:70;;135:1;132;125:12;150:134;218:20;;247:31;218:20;247:31;:::i;:::-;150:134;;;:::o;289:247::-;348:6;401:2;389:9;380:7;376:23;372:32;369:52;;;417:1;414;407:12;369:52;456:9;443:23;475:31;500:5;475:31;:::i;650:203::-;-1:-1:-1;;;;;814:32:70;;;;796:51;;784:2;769:18;;650:203::o;2208:121::-;2293:10;2286:5;2282:22;2275:5;2272:33;2262:61;;2319:1;2316;2309:12;2334:245;2392:6;2445:2;2433:9;2424:7;2420:23;2416:32;2413:52;;;2461:1;2458;2451:12;2413:52;2500:9;2487:23;2519:30;2543:5;2519:30;:::i;2781:347::-;2832:8;2842:6;2896:3;2889:4;2881:6;2877:17;2873:27;2863:55;;2914:1;2911;2904:12;2863:55;-1:-1:-1;2937:20:70;;-1:-1:-1;;;;;2969:30:70;;2966:50;;;3012:1;3009;3002:12;2966:50;3049:4;3041:6;3037:17;3025:29;;3101:3;3094:4;3085:6;3077;3073:19;3069:30;3066:39;3063:59;;;3118:1;3115;3108:12;3133:544;3212:6;3220;3228;3281:2;3269:9;3260:7;3256:23;3252:32;3249:52;;;3297:1;3294;3287:12;3249:52;3336:9;3323:23;3355:31;3380:5;3355:31;:::i;:::-;3405:5;-1:-1:-1;3461:2:70;3446:18;;3433:32;-1:-1:-1;;;;;3477:30:70;;3474:50;;;3520:1;3517;3510:12;3474:50;3559:58;3609:7;3600:6;3589:9;3585:22;3559:58;:::i;:::-;3133:544;;3636:8;;-1:-1:-1;3533:84:70;;-1:-1:-1;;;;3133:544:70:o;3682:118::-;3768:5;3761:13;3754:21;3747:5;3744:32;3734:60;;3790:1;3787;3780:12;3805:382;3870:6;3878;3931:2;3919:9;3910:7;3906:23;3902:32;3899:52;;;3947:1;3944;3937:12;3899:52;3986:9;3973:23;4005:31;4030:5;4005:31;:::i;:::-;4055:5;-1:-1:-1;4112:2:70;4097:18;;4084:32;4125:30;4084:32;4125:30;:::i;:::-;4174:7;4164:17;;;3805:382;;;;;:::o;4192:226::-;4251:6;4304:2;4292:9;4283:7;4279:23;4275:32;4272:52;;;4320:1;4317;4310:12;4272:52;-1:-1:-1;4365:23:70;;4192:226;-1:-1:-1;4192:226:70:o;4423:278::-;4623:10;4611:23;;;4593:42;;4671:23;;4666:2;4651:18;;4644:51;4581:2;4566:18;;4423:278::o;4706:250::-;4791:1;4801:113;4815:6;4812:1;4809:13;4801:113;;;4891:11;;;4885:18;4872:11;;;4865:39;4837:2;4830:10;4801:113;;;-1:-1:-1;;4948:1:70;4930:16;;4923:27;4706:250::o;4961:271::-;5003:3;5041:5;5035:12;5068:6;5063:3;5056:19;5084:76;5153:6;5146:4;5141:3;5137:14;5130:4;5123:5;5119:16;5084:76;:::i;:::-;5214:2;5193:15;-1:-1:-1;;5189:29:70;5180:39;;;;5221:4;5176:50;;4961:271;-1:-1:-1;;4961:271:70:o;5237:454::-;5462:6;5451:9;5444:25;5505:2;5500;5489:9;5485:18;5478:30;5425:4;5531:45;5572:2;5561:9;5557:18;5549:6;5531:45;:::i;:::-;5624:9;5616:6;5612:22;5607:2;5596:9;5592:18;5585:50;5652:33;5678:6;5670;5652:33;:::i;:::-;5644:41;5237:454;-1:-1:-1;;;;;;5237:454:70:o;6897:294::-;-1:-1:-1;;;;;7085:31:70;;;7067:50;;7153:31;;7148:2;7133:18;;7126:59;7055:2;7040:18;;6897:294::o;7196:508::-;7273:6;7281;7289;7342:2;7330:9;7321:7;7317:23;7313:32;7310:52;;;7358:1;7355;7348:12;7310:52;7397:9;7384:23;7416:31;7441:5;7416:31;:::i;:::-;7466:5;-1:-1:-1;7523:2:70;7508:18;;7495:32;7536:33;7495:32;7536:33;:::i;:::-;7196:508;;7588:7;;-1:-1:-1;;;7668:2:70;7653:18;;;;7640:32;;7196:508::o;7709:248::-;7883:25;;;7939:2;7924:18;;7917:34;7871:2;7856:18;;7709:248::o;8475:1238::-;8881:3;8876;8872:13;8864:6;8860:26;8849:9;8842:45;8923:3;8918:2;8907:9;8903:18;8896:31;8823:4;8950:46;8991:3;8980:9;8976:19;8968:6;8950:46;:::i;:::-;9044:9;9036:6;9032:22;9027:2;9016:9;9012:18;9005:50;9078:33;9104:6;9096;9078:33;:::i;:::-;9142:2;9127:18;;9120:34;;;-1:-1:-1;;;;;9191:32:70;;9185:3;9170:19;;9163:61;9211:3;9240:19;;9233:35;;;9305:22;;;9299:3;9284:19;;9277:51;9377:13;;9399:22;;;9449:2;9475:15;;;;-1:-1:-1;9437:15:70;;;;-1:-1:-1;9518:169:70;9532:6;9529:1;9526:13;9518:169;;;9593:13;;9581:26;;9636:2;9662:15;;;;9627:12;;;;9554:1;9547:9;9518:169;;;-1:-1:-1;9704:3:70;;8475:1238;-1:-1:-1;;;;;;;;;;;8475:1238:70:o;9718:621::-;9815:6;9823;9876:2;9864:9;9855:7;9851:23;9847:32;9844:52;;;9892:1;9889;9882:12;9844:52;9919:23;;-1:-1:-1;;;;;9954:30:70;;9951:50;;;9997:1;9994;9987:12;9951:50;10020:22;;10073:4;10065:13;;10061:27;-1:-1:-1;10051:55:70;;10102:1;10099;10092:12;10051:55;10129:16;;-1:-1:-1;;;;;10157:30:70;;10154:50;;;10200:1;10197;10190:12;10154:50;10253:7;10248:2;10238:6;10235:1;10231:14;10227:2;10223:23;10219:32;10216:45;10213:65;;;10274:1;10271;10264:12;10213:65;10305:2;10297:11;;;;;10327:6;;-1:-1:-1;9718:621:70;-1:-1:-1;;;9718:621:70:o;10344:780::-;10504:4;10552:2;10541:9;10537:18;10582:2;10571:9;10564:21;10605:6;10640;10634:13;10671:6;10663;10656:22;10709:2;10698:9;10694:18;10687:25;;10771:2;10761:6;10758:1;10754:14;10743:9;10739:30;10735:39;10721:53;;10809:2;10801:6;10797:15;10830:1;10840:255;10854:6;10851:1;10848:13;10840:255;;;10947:2;10943:7;10931:9;10923:6;10919:22;10915:36;10910:3;10903:49;10975:40;11008:6;10999;10993:13;10975:40;:::i;:::-;10965:50;-1:-1:-1;11050:2:70;11073:12;;;;11038:15;;;;;10876:1;10869:9;10840:255;;;-1:-1:-1;11112:6:70;;10344:780;-1:-1:-1;;;;;;10344:780:70:o;11129:711::-;11234:6;11242;11250;11258;11311:2;11299:9;11290:7;11286:23;11282:32;11279:52;;;11327:1;11324;11317:12;11279:52;11366:9;11353:23;11385:31;11410:5;11385:31;:::i;:::-;11435:5;-1:-1:-1;11492:2:70;11477:18;;11464:32;11527:1;11515:14;;11505:42;;11543:1;11540;11533:12;11505:42;11566:7;-1:-1:-1;11624:2:70;11609:18;;11596:32;-1:-1:-1;;;;;11640:30:70;;11637:50;;;11683:1;11680;11673:12;11637:50;11722:58;11772:7;11763:6;11752:9;11748:22;11722:58;:::i;:::-;11129:711;;;;-1:-1:-1;11799:8:70;-1:-1:-1;;;;11129:711:70:o;11845:627::-;11930:6;11938;11946;11954;12007:3;11995:9;11986:7;11982:23;11978:33;11975:53;;;12024:1;12021;12014:12;11975:53;12063:9;12050:23;12082:31;12107:5;12082:31;:::i;:::-;12132:5;-1:-1:-1;12210:2:70;12195:18;;12182:32;;-1:-1:-1;12292:2:70;12277:18;;12264:32;12305;12264;12305;:::i;:::-;11845:627;;;;-1:-1:-1;12356:7:70;;12436:2;12421:18;12408:32;;-1:-1:-1;;11845:627:70:o;12477:388::-;12545:6;12553;12606:2;12594:9;12585:7;12581:23;12577:32;12574:52;;;12622:1;12619;12612:12;12574:52;12661:9;12648:23;12680:31;12705:5;12680:31;:::i;:::-;12730:5;-1:-1:-1;12787:2:70;12772:18;;12759:32;12800:33;12759:32;12800:33;:::i;13679:397::-;-1:-1:-1;;;;;13899:32:70;;;13881:51;;13968:32;;;13963:2;13948:18;;13941:60;14037:32;;;14032:2;14017:18;;14010:60;13869:2;13854:18;;13679:397::o;14081:245::-;14148:6;14201:2;14189:9;14180:7;14176:23;14172:32;14169:52;;;14217:1;14214;14207:12;14169:52;14249:9;14243:16;14268:28;14290:5;14268:28;:::i;14331:300::-;-1:-1:-1;;;;;14523:32:70;;;14505:51;;14592:32;;14587:2;14572:18;;14565:60;14493:2;14478:18;;14331:300::o;14636:127::-;14697:10;14692:3;14688:20;14685:1;14678:31;14728:4;14725:1;14718:15;14752:4;14749:1;14742:15;14768:252;14840:2;14834:9;14882:3;14870:16;;-1:-1:-1;;;;;14901:34:70;;14937:22;;;14898:62;14895:88;;;14963:18;;:::i;:::-;14999:2;14992:22;14768:252;:::o;15025:251::-;15097:2;15091:9;;;15127:15;;-1:-1:-1;;;;;15157:34:70;;15193:22;;;15154:62;15151:88;;;15219:18;;:::i;15281:248::-;15348:2;15342:9;15390:4;15378:17;;-1:-1:-1;;;;;15410:34:70;;15446:22;;;15407:62;15404:88;;;15472:18;;:::i;15534:889::-;15577:5;15630:3;15623:4;15615:6;15611:17;15607:27;15597:55;;15648:1;15645;15638:12;15597:55;15675:20;;15727:4;15715:17;;15756:1;;-1:-1:-1;;;;;15791:30:70;;15788:56;;;15824:18;;:::i;:::-;-1:-1:-1;15979:2:70;15973:9;-1:-1:-1;;15892:2:70;15871:15;;15867:29;;16037:2;16025:15;16021:29;16009:42;;16102:22;;;-1:-1:-1;;;;;16066:34:70;;16063:62;16060:88;;;16128:18;;:::i;:::-;16164:2;16157:22;16214;;;16199:6;-1:-1:-1;16199:6:70;16251:16;;;16248:25;-1:-1:-1;16245:45:70;;;16286:1;16283;16276:12;16245:45;16336:6;16331:3;16324:4;16316:6;16312:17;16299:44;16391:1;16384:4;16375:6;16367;16363:19;16359:30;16352:41;16411:6;16402:15;;;;;;15534:889;;;;:::o;16428:681::-;16533:6;16541;16549;16602:2;16590:9;16581:7;16577:23;16573:32;16570:52;;;16618:1;16615;16608:12;16570:52;16645:23;;-1:-1:-1;;;;;16680:30:70;;16677:50;;;16723:1;16720;16713:12;16677:50;16746;16788:7;16779:6;16768:9;16764:22;16746:50;:::i;:::-;16736:60;-1:-1:-1;;16849:2:70;16834:18;;16821:32;-1:-1:-1;;;;;16865:32:70;;16862:52;;;16910:1;16907;16900:12;16862:52;16933;16977:7;16966:8;16955:9;16951:24;16933:52;:::i;:::-;16923:62;;;17035:2;17024:9;17020:18;17007:32;17048:31;17073:5;17048:31;:::i;:::-;17098:5;17088:15;;;16428:681;;;;;:::o;17114:380::-;17193:1;17189:12;;;;17236;;;17257:61;;17311:4;17303:6;17299:17;17289:27;;17257:61;17364:2;17356:6;17353:14;17333:18;17330:38;17327:161;;17410:10;17405:3;17401:20;17398:1;17391:31;17445:4;17442:1;17435:15;17473:4;17470:1;17463:15;17327:161;;17114:380;;;:::o;17625:518::-;17727:2;17722:3;17719:11;17716:421;;;17763:5;17760:1;17753:16;17807:4;17804:1;17794:18;17877:2;17865:10;17861:19;17858:1;17854:27;17848:4;17844:38;17913:4;17901:10;17898:20;17895:47;;;-1:-1:-1;17936:4:70;17895:47;17991:2;17986:3;17982:12;17979:1;17975:20;17969:4;17965:31;17955:41;;18046:81;18064:2;18057:5;18054:13;18046:81;;;18123:1;18109:16;;18090:1;18079:13;18046:81;;18319:1299;18439:10;;-1:-1:-1;;;;;18461:30:70;;18458:56;;;18494:18;;:::i;:::-;18523:97;18613:6;18573:38;18605:4;18599:11;18573:38;:::i;:::-;18567:4;18523:97;:::i;:::-;18669:4;18700:2;18689:14;;18717:1;18712:649;;;;19405:1;19422:6;19419:89;;;-1:-1:-1;19474:19:70;;;19468:26;19419:89;-1:-1:-1;;18276:1:70;18272:11;;;18268:24;18264:29;18254:40;18300:1;18296:11;;;18251:57;19521:81;;18682:930;;18712:649;17572:1;17565:14;;;17609:4;17596:18;;-1:-1:-1;;18748:20:70;;;18866:222;18880:7;18877:1;18874:14;18866:222;;;18962:19;;;18956:26;18941:42;;19069:4;19054:20;;;;19022:1;19010:14;;;;18896:12;18866:222;;;18870:3;19116:6;19107:7;19104:19;19101:201;;;19177:19;;;19171:26;-1:-1:-1;;19260:1:70;19256:14;;;19272:3;19252:24;19248:37;19244:42;19229:58;19214:74;;19101:201;-1:-1:-1;;;;19348:1:70;19332:14;;;19328:22;19315:36;;-1:-1:-1;18319:1299:70:o;19623:388::-;19780:2;19769:9;19762:21;19819:6;19814:2;19803:9;19799:18;19792:34;19876:6;19868;19863:2;19852:9;19848:18;19835:48;19932:1;19903:22;;;19927:2;19899:31;;;19892:42;;;;19995:2;19974:15;;;-1:-1:-1;;19970:29:70;19955:45;19951:54;;19623:388;-1:-1:-1;19623:388:70:o;20626:127::-;20687:10;20682:3;20678:20;20675:1;20668:31;20718:4;20715:1;20708:15;20742:4;20739:1;20732:15;20758:128;20825:9;;;20846:11;;;20843:37;;;20860:18;;:::i;21227:127::-;21288:10;21283:3;21279:20;21276:1;21269:31;21319:4;21316:1;21309:15;21343:4;21340:1;21333:15;21359:521;21436:4;21442:6;21502:11;21489:25;21596:2;21592:7;21581:8;21565:14;21561:29;21557:43;21537:18;21533:68;21523:96;;21615:1;21612;21605:12;21523:96;21642:33;;21694:20;;;-1:-1:-1;;;;;;21726:30:70;;21723:50;;;21769:1;21766;21759:12;21723:50;21802:4;21790:17;;-1:-1:-1;21833:14:70;21829:27;;;21819:38;;21816:58;;;21870:1;21867;21860:12;21885:440;22114:6;22106;22101:3;22088:33;22070:3;22149:6;22144:3;22140:16;22176:1;22172:2;22165:13;22207:6;22201:13;22223:65;22281:6;22277:2;22270:4;22262:6;22258:17;22223:65;:::i;:::-;22304:15;;21885:440;-1:-1:-1;;;;;21885:440:70:o;22330:127::-;22391:10;22386:3;22382:20;22379:1;22372:31;22422:4;22419:1;22412:15;22446:4;22443:1;22436:15;22462:240;22546:1;22539:5;22536:12;22526:143;;22591:10;22586:3;22582:20;22579:1;22572:31;22626:4;22623:1;22616:15;22654:4;22651:1;22644:15;22526:143;22678:18;;22462:240::o;22707:214::-;22856:2;22841:18;;22868:47;22845:9;22897:6;22868:47;:::i;23140:346::-;23208:6;23216;23269:2;23257:9;23248:7;23244:23;23240:32;23237:52;;;23285:1;23282;23275:12;23237:52;-1:-1:-1;;23330:23:70;;;23450:2;23435:18;;;23422:32;;-1:-1:-1;23140:346:70:o;23939:705::-;24042:6;24050;24058;24066;24119:3;24107:9;24098:7;24094:23;24090:33;24087:53;;;24136:1;24133;24126:12;24087:53;24181:23;;;-1:-1:-1;24301:2:70;24286:18;;24273:32;;-1:-1:-1;24383:2:70;24368:18;;24355:32;24396:33;24355:32;24396:33;:::i;:::-;24448:7;-1:-1:-1;24506:2:70;24491:18;;24478:32;-1:-1:-1;;;;;24522:30:70;;24519:50;;;24565:1;24562;24555:12;24519:50;24588;24630:7;24621:6;24610:9;24606:22;24588:50;:::i;:::-;24578:60;;;23939:705;;;;;;;:::o;24649:136::-;24727:13;;24749:30;24727:13;24749:30;:::i;24790:129::-;-1:-1:-1;;;;;24864:30:70;;24854:41;;24844:69;;24909:1;24906;24899:12;24924:136;25002:13;;25024:30;25002:13;25024:30;:::i;25065:1236::-;25162:6;25222:3;25210:9;25201:7;25197:23;25193:33;25238:2;25235:22;;;25253:1;25250;25243:12;25235:22;-1:-1:-1;25272:1:70;25295:22;;:::i;:::-;25363:16;;25388:22;;25477:2;25462:18;;;25456:25;25497:14;;;25490:31;25588:2;25573:18;;;25567:25;25608:14;;;25601:31;25664:48;25708:2;25693:18;;25664:48;:::i;:::-;25659:2;25652:5;25648:14;25641:72;25746:49;25790:3;25779:9;25775:19;25746:49;:::i;:::-;25740:3;25733:5;25729:15;25722:74;25829:49;25873:3;25862:9;25858:19;25829:49;:::i;:::-;25823:3;25816:5;25812:15;25805:74;25912:49;25956:3;25945:9;25941:19;25912:49;:::i;:::-;25906:3;25899:5;25895:15;25888:74;25995:49;26039:3;26028:9;26024:19;25995:49;:::i;:::-;25989:3;25978:15;;25971:74;26112:3;26097:19;;;26091:26;26133:15;;;26126:32;26225:3;26210:19;;;26204:26;26246:15;;;26239:32;;;;-1:-1:-1;25982:5:70;;25065:1236;-1:-1:-1;;25065:1236:70:o;26891:230::-;26961:6;27014:2;27002:9;26993:7;26989:23;26985:32;26982:52;;;27030:1;27027;27020:12;26982:52;-1:-1:-1;27075:16:70;;26891:230;-1:-1:-1;26891:230:70:o;27126:249::-;27195:6;27248:2;27236:9;27227:7;27223:23;27219:32;27216:52;;;27264:1;27261;27254:12;27216:52;27296:9;27290:16;27315:30;27339:5;27315:30;:::i;27380:249::-;27449:6;27502:2;27490:9;27481:7;27477:23;27473:32;27470:52;;;27518:1;27515;27508:12;27470:52;27550:9;27544:16;27569:30;27593:5;27569:30;:::i;27897:274::-;-1:-1:-1;;;;;28089:32:70;;;;28071:51;;28153:2;28138:18;;28131:34;28059:2;28044:18;;27897:274::o;28176:125::-;28241:9;;;28262:10;;;28259:36;;;28275:18;;:::i;28306:287::-;28435:3;28473:6;28467:13;28489:66;28548:6;28543:3;28536:4;28528:6;28524:17;28489:66;:::i;:::-;28571:16;;;;;28306:287;-1:-1:-1;;28306:287:70:o;28598:132::-;28665:20;;28694:30;28665:20;28694:30;:::i;28735:173::-;28803:20;;-1:-1:-1;;;;;28852:31:70;;28842:42;;28832:70;;28898:1;28895;28888:12;28913:1628;29008:6;29016;29069:2;29057:9;29048:7;29044:23;29040:32;29037:52;;;29085:1;29082;29075:12;29037:52;29112:23;;-1:-1:-1;;;;;29147:30:70;;29144:50;;;29190:1;29187;29180:12;29144:50;29213:22;;29269:2;29251:16;;;29247:25;29244:45;;;29285:1;29282;29275:12;29244:45;29311:22;;:::i;:::-;29358:16;;-1:-1:-1;;;;;29386:32:70;;29383:52;;;29431:1;29428;29421:12;29383:52;29454:17;;29505:4;29487:16;;;29483:27;29480:47;;;29523:1;29520;29513:12;29480:47;29551:17;;:::i;:::-;29613:16;;29638:24;;29696:31;29723:2;29715:11;;29696:31;:::i;:::-;29691:2;29682:7;29678:16;29671:57;29762:31;29789:2;29785;29781:11;29762:31;:::i;:::-;29757:2;29748:7;29744:16;29737:57;29828:31;29855:2;29851;29847:11;29828:31;:::i;:::-;29823:2;29814:7;29810:16;29803:57;29895:31;29921:3;29917:2;29913:12;29895:31;:::i;:::-;29889:3;29880:7;29876:17;29869:58;29962:32;29989:3;29985:2;29981:12;29962:32;:::i;:::-;29956:3;29943:17;;29936:59;30041:3;30033:12;;30020:26;-1:-1:-1;;;;;30058:32:70;;30055:52;;;30103:1;30100;30093:12;30055:52;30142:45;30179:7;30168:8;30164:2;30160:17;30142:45;:::i;:::-;30136:3;30123:17;;30116:72;-1:-1:-1;30197:22:70;;-1:-1:-1;30265:2:70;30257:11;;30244:25;-1:-1:-1;;;;;30281:32:70;;30278:52;;;30326:1;30323;30316:12;30278:52;30362:45;30399:7;30388:8;30384:2;30380:17;30362:45;:::i;:::-;30357:2;30346:14;;;30339:69;;;;30350:5;;30490:18;;;;30477:32;;-1:-1:-1;;;;;28913:1628:70:o;30546:397::-;30746:47;30783:9;30775:6;30746:47;:::i;:::-;30829:2;30824;30813:9;30809:18;30802:30;30727:4;30849:45;30890:2;30879:9;30875:18;30867:6;30849:45;:::i;:::-;30841:53;;30930:6;30925:2;30914:9;30910:18;30903:34;30546:397;;;;;;:::o;30948:168::-;31021:9;;;31052;;31069:15;;;31063:22;;31049:37;31039:71;;31090:18;;:::i;31698:584::-;31792:6;31800;31808;31861:2;31849:9;31840:7;31836:23;31832:32;31829:52;;;31877:1;31874;31867:12;31829:52;31916:9;31903:23;31935:31;31960:5;31935:31;:::i;:::-;31985:5;-1:-1:-1;32063:2:70;32048:18;;32035:32;;-1:-1:-1;32144:2:70;32129:18;;32116:32;-1:-1:-1;;;;;32160:30:70;;32157:50;;;32203:1;32200;32193:12;32157:50;32226;32268:7;32259:6;32248:9;32244:22;32226:50;:::i;:::-;32216:60;;;31698:584;;;;;:::o;32663:433::-;32894:3;32883:9;32876:22;32857:4;32915:46;32956:3;32945:9;32941:19;32933:6;32915:46;:::i;:::-;32992:2;32977:18;;32970:34;;;;-1:-1:-1;33035:2:70;33020:18;;33013:34;;;;33078:2;33063:18;;;33056:34;32907:54;32663:433;-1:-1:-1;32663:433:70:o;33101:372::-;33188:6;33196;33249:2;33237:9;33228:7;33224:23;33220:32;33217:52;;;33265:1;33262;33255:12;33217:52;33310:16;;33395:2;33380:18;;33374:25;33310:16;;-1:-1:-1;33408:33:70;33374:25;33408:33;:::i;33757:136::-;33796:3;33824:5;33814:39;;33833:18;;:::i;:::-;-1:-1:-1;;;33869:18:70;;33757:136::o;33898:135::-;33937:3;33958:17;;;33955:43;;33978:18;;:::i;:::-;-1:-1:-1;34025:1:70;34014:13;;33898:135::o;34038:386::-;-1:-1:-1;;;;;34256:32:70;;;34238:51;;34325:32;;;;34320:2;34305:18;;34298:60;34406:10;34394:23;;;34389:2;34374:18;;34367:51;34226:2;34211:18;;34038:386::o;34538:1377::-;34777:2;34759:21;;;34809:13;;34858:4;34838:18;;;34831:32;;;34900:19;;34894:3;34879:19;;34872:48;34985:4;34967:23;;34961:30;-1:-1:-1;;;;;34957:56:70;;;34951:3;34936:19;;34929:85;35062:23;;;35056:30;35052:56;;35045:4;35030:20;;35023:86;35156:21;;;35150:28;35146:54;;;35140:3;35125:19;;35118:83;35256:4;35238:23;;35232:30;-1:-1:-1;;;;;6855:30:70;;35320:3;35305:19;;6843:43;-1:-1:-1;;34809:13:70;-1:-1:-1;35380:3:70;35362:22;;35356:29;-1:-1:-1;;;;;34495:31:70;;35444:3;35429:19;;34483:44;-1:-1:-1;35504:3:70;35486:22;35480:29;35546:4;35540:3;35525:19;;35518:33;35571:54;35620:3;35605:19;;35480:29;35571:54;:::i;:::-;35560:65;;35674:4;35666:6;35662:17;35656:24;35747:2;35743:7;35731:9;35726:3;35722:19;35718:33;35711:4;35700:9;35696:20;35689:63;35769:38;35803:3;35787:14;35769:38;:::i;:::-;35761:46;;;;35845:6;35838:4;35827:9;35823:20;35816:36;35861:48;35903:4;35892:9;35888:20;35880:6;-1:-1:-1;;;;;607:31:70;595:44;;541:104;36257:408;-1:-1:-1;;;;;36492:32:70;;;36474:51;;36561:32;;36556:2;36541:18;;36534:60;36462:2;36447:18;;36603:56;36655:2;36640:18;;36632:6;36603:56;:::i;36670:1006::-;36772:6;36832:3;36820:9;36811:7;36807:23;36803:33;36848:2;36845:22;;;36863:1;36860;36853:12;36845:22;-1:-1:-1;36933:2:70;36927:9;36882:1;;36975:3;36963:16;;-1:-1:-1;;;;;36994:34:70;;37030:22;;;36991:62;36988:88;;;37056:18;;:::i;:::-;37092:2;37085:22;;;37149:16;;37174:21;;37262:2;37247:18;;;37241:25;37282:15;;;37275:32;37359:18;;;37353:25;37394:15;;;37387:32;37486:2;37471:18;;;37465:25;37506:15;;;37499:32;37598:3;37583:19;;;37577:26;37619:16;;;37612:33;;;;-1:-1:-1;37181:6:70;;36670:1006;-1:-1:-1;;36670:1006:70:o;37681:371::-;-1:-1:-1;;;;;37901:32:70;;;37883:51;;37970:32;;;;37965:2;37950:18;;37943:60;38034:2;38019:18;;38012:34;;;;37871:2;37856:18;;37681:371::o;38057:577::-;38344:6;38333:9;38326:25;38387:6;38382:2;38371:9;38367:18;38360:34;38430:6;38425:2;38414:9;38410:18;38403:34;38473:6;38468:2;38457:9;38453:18;38446:34;38517:3;38511;38500:9;38496:19;38489:32;38307:4;38538:46;38579:3;38568:9;38564:19;38556:6;38538:46;:::i;:::-;38530:54;;38621:6;38615:3;38604:9;38600:19;38593:35;38057:577;;;;;;;;;:::o;39034:217::-;39074:1;39100;39090:132;;39144:10;39139:3;39135:20;39132:1;39125:31;39179:4;39176:1;39169:15;39207:4;39204:1;39197:15;39090:132;-1:-1:-1;39236:9:70;;39034:217::o" + }, + "methodIdentifiers": { + "acceptProvisionPendingParameters(address,bytes)": "ce0fc0cc", + "allocationProvisionTracker(address)": "6234e216", + "claims(bytes32)": "eff0f592", + "claimsLists(address)": "13c474c9", + "closeStaleAllocation(address)": "ec9c218d", + "collect(address,uint8,bytes)": "b15d2a2c", + "curationFeesCut()": "138dea08", + "eip712Domain()": "84b0196e", + "encodeAllocationProof(address,address)": "ce56c98b", + "feesProvisionTracker(address)": "cbe5f3f2", + "getAllocation(address)": "0e022923", + "getAllocationData(address)": "55c85269", + "getCuration()": "c0f47497", + "getDelegationRatio()": "1ebb7c30", + "getDisputeManager()": "db9bee46", + "getGraphTallyCollector()": "ebf6ddaf", + "getLegacyAllocation(address)": "6d9a3951", + "getProvisionTokensRange()": "819ba366", + "getSubgraphAllocatedTokens(bytes32)": "e2e1e8e9", + "getThawingPeriodRange()": "71ce020a", + "getVerifierCutRange()": "482468b7", + "indexers(address)": "4f793cdc", + "initialize(address,uint256,uint32,uint256)": "c84a5ef3", + "isOverAllocated(address)": "ba38f67d", + "maxPOIStaleness()": "85e82baf", + "migrateLegacyAllocation(address,address,bytes32)": "7dfe6d28", + "multicall(bytes[])": "ac9650d8", + "owner()": "8da5cb5b", + "pause()": "8456cb59", + "pauseGuardians(address)": "9384e078", + "paused()": "5c975abb", + "paymentsDestination(address)": "07e736d8", + "register(address,bytes)": "24b8fbf6", + "releaseStake(uint256)": "45f54485", + "renounceOwnership()": "715018a6", + "resizeAllocation(address,address,uint256)": "81e777a7", + "setCurationCut(uint256)": "7e89bac3", + "setDelegationRatio(uint32)": "1dd42f60", + "setMaxPOIStaleness(uint256)": "7aa31bce", + "setMinimumProvisionTokens(uint256)": "832bc923", + "setPauseGuardian(address,bool)": "35577962", + "setPaymentsDestination(address)": "6ccec5b8", + "setStakeToFeesRatio(uint256)": "e6f50054", + "slash(address,bytes)": "cb8347fe", + "stakeToFeesRatio()": "d07a7a84", + "startService(address,bytes)": "dedf6726", + "stopService(address,bytes)": "8180083b", + "transferOwnership(address)": "f2fde38b", + "unpause()": "3f4ba83a" + } + }, + "metadata": "{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"graphController\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"disputeManager\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"graphTallyCollector\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"curation\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"}],\"name\":\"AddressEmptyCode\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"allocationId\",\"type\":\"address\"}],\"name\":\"AllocationAlreadyExists\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"allocationId\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"closedAt\",\"type\":\"uint256\"}],\"name\":\"AllocationClosed\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"allocationId\",\"type\":\"address\"}],\"name\":\"AllocationDoesNotExist\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"allocationId\",\"type\":\"address\"}],\"name\":\"AllocationManagerAllocationClosed\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"allocationId\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"AllocationManagerAllocationSameSize\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"allocationId\",\"type\":\"address\"}],\"name\":\"AllocationManagerInvalidAllocationProof\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AllocationManagerInvalidZeroAllocationId\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"claimId\",\"type\":\"bytes32\"}],\"name\":\"DataServiceFeesClaimNotFound\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DataServiceFeesZeroTokens\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"DataServicePausableNotPauseGuardian\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"}],\"name\":\"DataServicePausablePauseGuardianNoChange\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"disputeManager\",\"type\":\"address\"}],\"name\":\"DirectoryNotDisputeManager\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ECDSAInvalidSignature\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"length\",\"type\":\"uint256\"}],\"name\":\"ECDSAInvalidSignatureLength\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"ECDSAInvalidSignatureS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"EnforcedPause\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ExpectedPause\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"contractName\",\"type\":\"bytes\"}],\"name\":\"GraphDirectoryInvalidZeroAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidInitialization\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"allocationId\",\"type\":\"address\"}],\"name\":\"LegacyAllocationAlreadyExists\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LinkedListEmptyList\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LinkedListInvalidIterations\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LinkedListInvalidZeroId\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LinkedListMaxElementsExceeded\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotInitializing\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"OwnableInvalidOwner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"OwnableUnauthorizedAccount\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"a\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"b\",\"type\":\"uint256\"}],\"name\":\"PPMMathInvalidMulPPM\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"max\",\"type\":\"uint256\"}],\"name\":\"ProvisionManagerInvalidRange\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"max\",\"type\":\"uint256\"}],\"name\":\"ProvisionManagerInvalidValue\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"ProvisionManagerNotAuthorized\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"}],\"name\":\"ProvisionManagerProvisionNotFound\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokensAvailable\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"tokensRequired\",\"type\":\"uint256\"}],\"name\":\"ProvisionTrackerInsufficientTokens\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"allocationId\",\"type\":\"address\"}],\"name\":\"SubgraphServiceAllocationIsAltruistic\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"allocationId\",\"type\":\"address\"}],\"name\":\"SubgraphServiceAllocationNotAuthorized\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"allocationId\",\"type\":\"address\"}],\"name\":\"SubgraphServiceCannotForceCloseAllocation\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SubgraphServiceEmptyGeohash\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SubgraphServiceEmptyUrl\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"balanceBefore\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"balanceAfter\",\"type\":\"uint256\"}],\"name\":\"SubgraphServiceInconsistentCollection\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SubgraphServiceIndexerAlreadyRegistered\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"providedIndexer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"expectedIndexer\",\"type\":\"address\"}],\"name\":\"SubgraphServiceIndexerMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"}],\"name\":\"SubgraphServiceIndexerNotRegistered\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"collectionId\",\"type\":\"bytes32\"}],\"name\":\"SubgraphServiceInvalidCollectionId\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"curationCut\",\"type\":\"uint256\"}],\"name\":\"SubgraphServiceInvalidCurationCut\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"enum IGraphPayments.PaymentTypes\",\"name\":\"paymentType\",\"type\":\"uint8\"}],\"name\":\"SubgraphServiceInvalidPaymentType\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"ravIndexer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"allocationIndexer\",\"type\":\"address\"}],\"name\":\"SubgraphServiceInvalidRAV\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SubgraphServiceInvalidZeroStakeToFeesRatio\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"allocationId\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"subgraphDeploymentId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"forceClosed\",\"type\":\"bool\"}],\"name\":\"AllocationClosed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"allocationId\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"subgraphDeploymentId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"currentEpoch\",\"type\":\"uint256\"}],\"name\":\"AllocationCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"allocationId\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"subgraphDeploymentId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newTokens\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldTokens\",\"type\":\"uint256\"}],\"name\":\"AllocationResized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"curationCut\",\"type\":\"uint256\"}],\"name\":\"CurationCutSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"ratio\",\"type\":\"uint32\"}],\"name\":\"DelegationRatioSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"EIP712DomainChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"graphToken\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"graphStaking\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"graphPayments\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"graphEscrow\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"graphController\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"graphEpochManager\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"graphRewardsManager\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"graphTokenGateway\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"graphProxyAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"graphCuration\",\"type\":\"address\"}],\"name\":\"GraphDirectoryInitialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"allocationId\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"subgraphDeploymentId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokensRewards\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokensIndexerRewards\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokensDelegationRewards\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"poi\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"poiMetadata\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"currentEpoch\",\"type\":\"uint256\"}],\"name\":\"IndexingRewardsCollected\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"version\",\"type\":\"uint64\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"allocationId\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"subgraphDeploymentId\",\"type\":\"bytes32\"}],\"name\":\"LegacyAllocationMigrated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"maxPOIStaleness\",\"type\":\"uint256\"}],\"name\":\"MaxPOIStalenessSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"}],\"name\":\"PauseGuardianSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Paused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"paymentsDestination\",\"type\":\"address\"}],\"name\":\"PaymentsDestinationSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"}],\"name\":\"ProvisionPendingParametersAccepted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"min\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"max\",\"type\":\"uint256\"}],\"name\":\"ProvisionTokensRangeSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"payer\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"allocationId\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"subgraphDeploymentId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokensCollected\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokensCurators\",\"type\":\"uint256\"}],\"name\":\"QueryFeesCollected\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"enum IGraphPayments.PaymentTypes\",\"name\":\"feeType\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"ServicePaymentCollected\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"ServiceProviderRegistered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"ServiceProviderSlashed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"ServiceStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"ServiceStopped\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"claimId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"unlockTimestamp\",\"type\":\"uint256\"}],\"name\":\"StakeClaimLocked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"claimId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"releasableAt\",\"type\":\"uint256\"}],\"name\":\"StakeClaimReleased\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"claimsCount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokensReleased\",\"type\":\"uint256\"}],\"name\":\"StakeClaimsReleased\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"ratio\",\"type\":\"uint256\"}],\"name\":\"StakeToFeesRatioSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"subgraphService\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"disputeManager\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"graphTallyCollector\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"curation\",\"type\":\"address\"}],\"name\":\"SubgraphServiceDirectoryInitialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"min\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"max\",\"type\":\"uint64\"}],\"name\":\"ThawingPeriodRangeSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Unpaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"min\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"max\",\"type\":\"uint32\"}],\"name\":\"VerifierCutRangeSet\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"acceptProvisionPendingParameters\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"}],\"name\":\"allocationProvisionTracker\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"claimId\",\"type\":\"bytes32\"}],\"name\":\"claims\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"createdAt\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"releasableAt\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"nextClaim\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"}],\"name\":\"claimsLists\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"head\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"tail\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"count\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"allocationId\",\"type\":\"address\"}],\"name\":\"closeStaleAllocation\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"},{\"internalType\":\"enum IGraphPayments.PaymentTypes\",\"name\":\"paymentType\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"collect\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"curationFeesCut\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"eip712Domain\",\"outputs\":[{\"internalType\":\"bytes1\",\"name\":\"fields\",\"type\":\"bytes1\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"version\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"verifyingContract\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"salt\",\"type\":\"bytes32\"},{\"internalType\":\"uint256[]\",\"name\":\"extensions\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"allocationId\",\"type\":\"address\"}],\"name\":\"encodeAllocationProof\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"}],\"name\":\"feesProvisionTracker\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"allocationId\",\"type\":\"address\"}],\"name\":\"getAllocation\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"subgraphDeploymentId\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"createdAt\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"closedAt\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"lastPOIPresentedAt\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"accRewardsPerAllocatedToken\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"accRewardsPending\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"createdAtEpoch\",\"type\":\"uint256\"}],\"internalType\":\"struct Allocation.State\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"allocationId\",\"type\":\"address\"}],\"name\":\"getAllocationData\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCuration\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getDelegationRatio\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getDisputeManager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getGraphTallyCollector\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"allocationId\",\"type\":\"address\"}],\"name\":\"getLegacyAllocation\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"subgraphDeploymentId\",\"type\":\"bytes32\"}],\"internalType\":\"struct LegacyAllocation.State\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getProvisionTokensRange\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"subgraphDeploymentId\",\"type\":\"bytes32\"}],\"name\":\"getSubgraphAllocatedTokens\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getThawingPeriodRange\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getVerifierCutRange\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"}],\"name\":\"indexers\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"registeredAt\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"url\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"geoHash\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"minimumProvisionTokens\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"maximumDelegationRatio\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"stakeToFeesRatio_\",\"type\":\"uint256\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"}],\"name\":\"isOverAllocated\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"maxPOIStaleness\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"allocationId\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"subgraphDeploymentID\",\"type\":\"bytes32\"}],\"name\":\"migrateLegacyAllocation\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes[]\",\"name\":\"data\",\"type\":\"bytes[]\"}],\"name\":\"multicall\",\"outputs\":[{\"internalType\":\"bytes[]\",\"name\":\"results\",\"type\":\"bytes[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"pauseGuardian\",\"type\":\"address\"}],\"name\":\"pauseGuardians\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"paused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"}],\"name\":\"paymentsDestination\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"register\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"numClaimsToRelease\",\"type\":\"uint256\"}],\"name\":\"releaseStake\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"allocationId\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"resizeAllocation\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"curationCut\",\"type\":\"uint256\"}],\"name\":\"setCurationCut\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"delegationRatio\",\"type\":\"uint32\"}],\"name\":\"setDelegationRatio\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"maxPOIStaleness_\",\"type\":\"uint256\"}],\"name\":\"setMaxPOIStaleness\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"minimumProvisionTokens\",\"type\":\"uint256\"}],\"name\":\"setMinimumProvisionTokens\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"pauseGuardian\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"}],\"name\":\"setPauseGuardian\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"paymentsDestination_\",\"type\":\"address\"}],\"name\":\"setPaymentsDestination\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"stakeToFeesRatio_\",\"type\":\"uint256\"}],\"name\":\"setStakeToFeesRatio\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"slash\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"stakeToFeesRatio\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"startService\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"stopService\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unpause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"custom:security-contact\":\"Please email security+contracts@thegraph.com if you find any bugs. We may have an active bug bounty program.\",\"errors\":{\"AddressEmptyCode(address)\":[{\"details\":\"There's no code at `target` (it is not a contract).\"}],\"AllocationAlreadyExists(address)\":[{\"params\":{\"allocationId\":\"The allocation id\"}}],\"AllocationClosed(address,uint256)\":[{\"params\":{\"allocationId\":\"The allocation id\",\"closedAt\":\"The timestamp when the allocation was closed\"}}],\"AllocationDoesNotExist(address)\":[{\"params\":{\"allocationId\":\"The allocation id\"}}],\"AllocationManagerAllocationClosed(address)\":[{\"params\":{\"allocationId\":\"The id of the allocation\"}}],\"AllocationManagerAllocationSameSize(address,uint256)\":[{\"params\":{\"allocationId\":\"The id of the allocation\",\"tokens\":\"The amount of tokens\"}}],\"AllocationManagerInvalidAllocationProof(address,address)\":[{\"params\":{\"allocationId\":\"The id of the allocation\",\"signer\":\"The address that signed the proof\"}}],\"DataServiceFeesClaimNotFound(bytes32)\":[{\"params\":{\"claimId\":\"The id of the stake claim\"}}],\"DataServicePausableNotPauseGuardian(address)\":[{\"params\":{\"account\":\"The address of the pause guardian\"}}],\"DataServicePausablePauseGuardianNoChange(address,bool)\":[{\"params\":{\"account\":\"The address of the pause guardian\",\"allowed\":\"The allowed status of the pause guardian\"}}],\"DirectoryNotDisputeManager(address,address)\":[{\"params\":{\"caller\":\"The caller address\",\"disputeManager\":\"The Dispute Manager address\"}}],\"ECDSAInvalidSignature()\":[{\"details\":\"The signature derives the `address(0)`.\"}],\"ECDSAInvalidSignatureLength(uint256)\":[{\"details\":\"The signature has an invalid length.\"}],\"ECDSAInvalidSignatureS(bytes32)\":[{\"details\":\"The signature has an S value that is in the upper half order.\"}],\"EnforcedPause()\":[{\"details\":\"The operation failed because the contract is paused.\"}],\"ExpectedPause()\":[{\"details\":\"The operation failed because the contract is not paused.\"}],\"FailedCall()\":[{\"details\":\"A call to an address target failed. The target may have reverted.\"}],\"GraphDirectoryInvalidZeroAddress(bytes)\":[{\"params\":{\"contractName\":\"The name of the contract that was not found, or the controller\"}}],\"InvalidInitialization()\":[{\"details\":\"The contract is already initialized.\"}],\"LegacyAllocationAlreadyExists(address)\":[{\"params\":{\"allocationId\":\"The allocation id\"}}],\"NotInitializing()\":[{\"details\":\"The contract is not initializing.\"}],\"OwnableInvalidOwner(address)\":[{\"details\":\"The owner is not a valid owner account. (eg. `address(0)`)\"}],\"OwnableUnauthorizedAccount(address)\":[{\"details\":\"The caller account is not authorized to perform an operation.\"}],\"PPMMathInvalidMulPPM(uint256,uint256)\":[{\"params\":{\"a\":\"The first value in the multiplication.\",\"b\":\"The second value in the multiplication.\"}}],\"ProvisionManagerInvalidRange(uint256,uint256)\":[{\"params\":{\"max\":\"The maximum value.\",\"min\":\"The minimum value.\"}}],\"ProvisionManagerInvalidValue(bytes,uint256,uint256,uint256)\":[{\"params\":{\"max\":\"The maximum allowed value.\",\"message\":\"The error message.\",\"min\":\"The minimum allowed value.\",\"value\":\"The value that is out of range.\"}}],\"ProvisionManagerNotAuthorized(address,address)\":[{\"params\":{\"caller\":\"The address of the caller.\",\"serviceProvider\":\"The address of the serviceProvider.\"}}],\"ProvisionManagerProvisionNotFound(address)\":[{\"params\":{\"serviceProvider\":\"The address of the service provider.\"}}],\"ProvisionTrackerInsufficientTokens(uint256,uint256)\":[{\"params\":{\"tokensAvailable\":\"The amount of tokens available\",\"tokensRequired\":\"The amount of tokens required\"}}],\"SubgraphServiceAllocationIsAltruistic(address)\":[{\"params\":{\"allocationId\":\"The id of the allocation\"}}],\"SubgraphServiceAllocationNotAuthorized(address,address)\":[{\"params\":{\"allocationId\":\"The id of the allocation.\",\"indexer\":\"The address of the expected indexer.\"}}],\"SubgraphServiceCannotForceCloseAllocation(address)\":[{\"params\":{\"allocationId\":\"The id of the allocation\"}}],\"SubgraphServiceInconsistentCollection(uint256,uint256)\":[{\"params\":{\"balanceAfter\":\"The contract GRT balance after the collection\",\"balanceBefore\":\"The contract GRT balance before the collection\"}}],\"SubgraphServiceIndexerMismatch(address,address)\":[{\"params\":{\"expectedIndexer\":\"The address of the expected indexer.\",\"providedIndexer\":\"The address of the provided indexer.\"}}],\"SubgraphServiceIndexerNotRegistered(address)\":[{\"params\":{\"indexer\":\"The address of the indexer that is not registered\"}}],\"SubgraphServiceInvalidCollectionId(bytes32)\":[{\"params\":{\"collectionId\":\"The collectionId\"}}],\"SubgraphServiceInvalidCurationCut(uint256)\":[{\"params\":{\"curationCut\":\"The curation cut value\"}}],\"SubgraphServiceInvalidPaymentType(uint8)\":[{\"params\":{\"paymentType\":\"The payment type that is not supported\"}}],\"SubgraphServiceInvalidRAV(address,address)\":[{\"params\":{\"allocationIndexer\":\"The address of the allocation indexer\",\"ravIndexer\":\"The address of the RAV indexer\"}}]},\"events\":{\"AllocationClosed(address,address,bytes32,uint256,bool)\":{\"details\":\"Emitted when an indexer closes an allocation\",\"params\":{\"allocationId\":\"The id of the allocation\",\"forceClosed\":\"Whether the allocation was force closed\",\"indexer\":\"The address of the indexer\",\"subgraphDeploymentId\":\"The id of the subgraph deployment\",\"tokens\":\"The amount of tokens allocated\"}},\"AllocationCreated(address,address,bytes32,uint256,uint256)\":{\"params\":{\"allocationId\":\"The id of the allocation\",\"currentEpoch\":\"The current epoch\",\"indexer\":\"The address of the indexer\",\"subgraphDeploymentId\":\"The id of the subgraph deployment\",\"tokens\":\"The amount of tokens allocated\"}},\"AllocationResized(address,address,bytes32,uint256,uint256)\":{\"params\":{\"allocationId\":\"The id of the allocation\",\"indexer\":\"The address of the indexer\",\"newTokens\":\"The new amount of tokens allocated\",\"oldTokens\":\"The old amount of tokens allocated\",\"subgraphDeploymentId\":\"The id of the subgraph deployment\"}},\"CurationCutSet(uint256)\":{\"params\":{\"curationCut\":\"The curation cut\"}},\"DelegationRatioSet(uint32)\":{\"params\":{\"ratio\":\"The delegation ratio\"}},\"EIP712DomainChanged()\":{\"details\":\"MAY be emitted to signal that the domain could have changed.\"},\"GraphDirectoryInitialized(address,address,address,address,address,address,address,address,address,address)\":{\"params\":{\"graphController\":\"The Graph Controller contract address\",\"graphCuration\":\"The Curation contract address\",\"graphEpochManager\":\"The Epoch Manager contract address\",\"graphEscrow\":\"The Payments Escrow contract address\",\"graphPayments\":\"The Graph Payments contract address\",\"graphProxyAdmin\":\"The Graph Proxy Admin contract address\",\"graphRewardsManager\":\"The Rewards Manager contract address\",\"graphStaking\":\"The Horizon Staking contract address\",\"graphToken\":\"The Graph Token contract address\",\"graphTokenGateway\":\"The Token Gateway contract address\"}},\"IndexingRewardsCollected(address,address,bytes32,uint256,uint256,uint256,bytes32,bytes,uint256)\":{\"params\":{\"allocationId\":\"The id of the allocation\",\"currentEpoch\":\"The current epoch\",\"indexer\":\"The address of the indexer\",\"poi\":\"The POI presented\",\"poiMetadata\":\"The metadata associated with the POI\",\"subgraphDeploymentId\":\"The id of the subgraph deployment\",\"tokensDelegationRewards\":\"The amount of tokens collected for delegators\",\"tokensIndexerRewards\":\"The amount of tokens collected for the indexer\",\"tokensRewards\":\"The amount of tokens collected\"}},\"Initialized(uint64)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"},\"LegacyAllocationMigrated(address,address,bytes32)\":{\"params\":{\"allocationId\":\"The id of the allocation\",\"indexer\":\"The address of the indexer\",\"subgraphDeploymentId\":\"The id of the subgraph deployment\"}},\"MaxPOIStalenessSet(uint256)\":{\"params\":{\"maxPOIStaleness\":\"The max POI staleness in seconds\"}},\"PauseGuardianSet(address,bool)\":{\"params\":{\"account\":\"The address of the pause guardian\",\"allowed\":\"The allowed status of the pause guardian\"}},\"Paused(address)\":{\"details\":\"Emitted when the pause is triggered by `account`.\"},\"PaymentsDestinationSet(address,address)\":{\"params\":{\"indexer\":\"The address of the indexer\",\"paymentsDestination\":\"The address where payments should be sent\"}},\"ProvisionPendingParametersAccepted(address)\":{\"params\":{\"serviceProvider\":\"The address of the service provider.\"}},\"ProvisionTokensRangeSet(uint256,uint256)\":{\"params\":{\"max\":\"The maximum allowed value for the provision tokens.\",\"min\":\"The minimum allowed value for the provision tokens.\"}},\"QueryFeesCollected(address,address,address,bytes32,uint256,uint256)\":{\"params\":{\"allocationId\":\"The id of the allocation\",\"payer\":\"The address paying for the query fees\",\"serviceProvider\":\"The address of the service provider\",\"subgraphDeploymentId\":\"The id of the subgraph deployment\",\"tokensCollected\":\"The amount of tokens collected\",\"tokensCurators\":\"The amount of tokens curators receive\"}},\"ServicePaymentCollected(address,uint8,uint256)\":{\"params\":{\"feeType\":\"The type of fee to collect as defined in {GraphPayments}.\",\"serviceProvider\":\"The address of the service provider.\",\"tokens\":\"The amount of tokens collected.\"}},\"ServiceProviderRegistered(address,bytes)\":{\"params\":{\"data\":\"Custom data, usage defined by the data service.\",\"serviceProvider\":\"The address of the service provider.\"}},\"ServiceProviderSlashed(address,uint256)\":{\"params\":{\"serviceProvider\":\"The address of the service provider.\",\"tokens\":\"The amount of tokens slashed.\"}},\"ServiceStarted(address,bytes)\":{\"params\":{\"data\":\"Custom data, usage defined by the data service.\",\"serviceProvider\":\"The address of the service provider.\"}},\"ServiceStopped(address,bytes)\":{\"params\":{\"data\":\"Custom data, usage defined by the data service.\",\"serviceProvider\":\"The address of the service provider.\"}},\"StakeClaimLocked(address,bytes32,uint256,uint256)\":{\"params\":{\"claimId\":\"The id of the stake claim\",\"serviceProvider\":\"The address of the service provider\",\"tokens\":\"The amount of tokens to lock in the claim\",\"unlockTimestamp\":\"The timestamp when the tokens can be released\"}},\"StakeClaimReleased(address,bytes32,uint256,uint256)\":{\"params\":{\"claimId\":\"The id of the stake claim\",\"releasableAt\":\"The timestamp when the tokens were released\",\"serviceProvider\":\"The address of the service provider\",\"tokens\":\"The amount of tokens released\"}},\"StakeClaimsReleased(address,uint256,uint256)\":{\"params\":{\"claimsCount\":\"The number of stake claims being released\",\"serviceProvider\":\"The address of the service provider\",\"tokensReleased\":\"The total amount of tokens being released\"}},\"StakeToFeesRatioSet(uint256)\":{\"params\":{\"ratio\":\"The stake to fees ratio\"}},\"SubgraphServiceDirectoryInitialized(address,address,address,address)\":{\"params\":{\"curation\":\"The Curation contract address\",\"disputeManager\":\"The Dispute Manager contract address\",\"graphTallyCollector\":\"The Graph Tally Collector contract address\",\"subgraphService\":\"The Subgraph Service contract address\"}},\"ThawingPeriodRangeSet(uint64,uint64)\":{\"params\":{\"max\":\"The maximum allowed value for the thawing period.\",\"min\":\"The minimum allowed value for the thawing period.\"}},\"Unpaused(address)\":{\"details\":\"Emitted when the pause is lifted by `account`.\"},\"VerifierCutRangeSet(uint32,uint32)\":{\"params\":{\"max\":\"The maximum allowed value for the max verifier cut.\",\"min\":\"The minimum allowed value for the max verifier cut.\"}}},\"kind\":\"dev\",\"methods\":{\"acceptProvisionPendingParameters(address,bytes)\":{\"details\":\"Provides a way for the data service to validate and accept provision parameter changes. Call {_acceptProvision}. Emits a {ProvisionPendingParametersAccepted} event.\",\"params\":{\"data\":\"Custom data, usage defined by the data service.\",\"serviceProvider\":\"The address of the service provider.\"}},\"closeStaleAllocation(address)\":{\"details\":\"This function can be permissionlessly called when the allocation is stale. This ensures that rewards for other allocations are not diluted by an inactive allocation. Requirements: - Allocation must exist and be open - Allocation must be stale - Allocation cannot be altruistic Emits a {AllocationClosed} event.\",\"params\":{\"allocationId\":\"The id of the allocation\"}},\"collect(address,uint8,bytes)\":{\"details\":\"The implementation of this function is expected to interact with {GraphPayments} to collect payment from the service payer, which is done via {IGraphPayments-collect}. Emits a {ServicePaymentCollected} event. NOTE: Data services that are vetted by the Graph Council might qualify for a portion of protocol issuance to cover for these payments. In this case, the funds are taken by interacting with the rewards manager contract instead of the {GraphPayments} contract.\",\"params\":{\"data\":\"Custom data, usage defined by the data service.\",\"feeType\":\"The type of fee to collect as defined in {GraphPayments}.\",\"serviceProvider\":\"The address of the service provider.\"},\"returns\":{\"_0\":\"The amount of tokens collected.\"}},\"constructor\":{\"details\":\"DataService and Directory constructors set a bunch of immutable variables\",\"params\":{\"curation\":\"The address of the Curation contract\",\"disputeManager\":\"The address of the DisputeManager contract\",\"graphController\":\"The address of the Graph Controller contract\",\"graphTallyCollector\":\"The address of the GraphTallyCollector contract\"}},\"eip712Domain()\":{\"details\":\"returns the fields and values that describe the domain separator used by this contract for EIP-712 signature.\"},\"encodeAllocationProof(address,address)\":{\"params\":{\"allocationId\":\"The id of the allocation\",\"indexer\":\"The address of the indexer\"},\"returns\":{\"_0\":\"The encoded allocation proof\"}},\"getAllocation(address)\":{\"params\":{\"allocationId\":\"The id of the allocation\"},\"returns\":{\"_0\":\"The allocation details\"}},\"getAllocationData(address)\":{\"details\":\"Get allocation data to calculate rewards issuance \",\"params\":{\"allocationId\":\"The allocation Id\"},\"returns\":{\"_0\":\"Whether the allocation is active or not\",\"_1\":\"The indexer address\",\"_2\":\"Subgraph deployment id for the allocation\",\"_3\":\"Amount of allocated tokens\",\"_4\":\"Rewards snapshot\",\"_5\":\"Snapshot of accumulated rewards from previous allocation resizing, pending to be claimed\"}},\"getCuration()\":{\"returns\":{\"_0\":\"The address of the curation contract\"}},\"getDelegationRatio()\":{\"returns\":{\"_0\":\"The delegation ratio\"}},\"getDisputeManager()\":{\"returns\":{\"_0\":\"The address of the dispute manager\"}},\"getGraphTallyCollector()\":{\"returns\":{\"_0\":\"The address of the graph tally collector\"}},\"getLegacyAllocation(address)\":{\"params\":{\"allocationId\":\"The id of the allocation\"},\"returns\":{\"_0\":\"The legacy allocation details\"}},\"getProvisionTokensRange()\":{\"returns\":{\"_0\":\"Minimum provision tokens allowed\",\"_1\":\"Maximum provision tokens allowed\"}},\"getSubgraphAllocatedTokens(bytes32)\":{\"params\":{\"_subgraphDeploymentId\":\"Deployment Id for the subgraph\"},\"returns\":{\"_0\":\"Total tokens allocated to subgraph\"}},\"getThawingPeriodRange()\":{\"returns\":{\"_0\":\"Minimum thawing period allowed\",\"_1\":\"Maximum thawing period allowed\"}},\"getVerifierCutRange()\":{\"returns\":{\"_0\":\"Minimum verifier cut allowed\",\"_1\":\"Maximum verifier cut allowed\"}},\"initialize(address,uint256,uint32,uint256)\":{\"details\":\"The thawingPeriod and verifierCut ranges are not set here because they are variables on the DisputeManager. We use the {ProvisionManager} overrideable getters to get the ranges.\",\"params\":{\"maximumDelegationRatio\":\"The maximum delegation ratio allowed for an allocation\",\"minimumProvisionTokens\":\"The minimum amount of provisioned tokens required to create an allocation\",\"owner\":\"The owner of the contract\",\"stakeToFeesRatio\":\"The ratio of stake to fees to lock when collecting query fees\"}},\"isOverAllocated(address)\":{\"params\":{\"allocationId\":\"The id of the allocation\"},\"returns\":{\"_0\":\"True if the indexer is over-allocated, false otherwise\"}},\"migrateLegacyAllocation(address,address,bytes32)\":{\"params\":{\"allocationId\":\"The id of the allocation\",\"indexer\":\"The address of the indexer\",\"subgraphDeploymentId\":\"The id of the subgraph deployment\"}},\"multicall(bytes[])\":{\"custom:oz-upgrades-unsafe-allow-reachable\":\"delegatecall\",\"details\":\"Receives and executes a batch of function calls on this contract.\"},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"pause()\":{\"details\":\"Note that only functions using the modifiers `whenNotPaused` and `whenPaused` will be affected by the pause. Requirements: - The contract must not be already paused\"},\"paused()\":{\"details\":\"Returns true if the contract is paused, and false otherwise.\"},\"register(address,bytes)\":{\"details\":\"Before registering, the service provider must have created a provision in the Graph Horizon staking contract with parameters that are compatible with the data service. Verifies provision parameters and rejects registration in the event they are not valid. Emits a {ServiceProviderRegistered} event. NOTE: Failing to accept the provision will result in the service provider operating on an unverified provision. Depending on of the data service this can be a security risk as the protocol won't be able to guarantee economic security for the consumer.\",\"params\":{\"data\":\"Custom data, usage defined by the data service.\",\"serviceProvider\":\"The address of the service provider.\"}},\"releaseStake(uint256)\":{\"details\":\"This function is only meant to be called if the service provider has enough stake claims that releasing them all at once would exceed the block gas limit.This function can be overriden and/or disabled.Emits a {StakeClaimsReleased} event, and a {StakeClaimReleased} event for each claim released.\",\"params\":{\"numClaimsToRelease\":\"Amount of stake claims to process. If 0, all stake claims are processed.\"}},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.\"},\"resizeAllocation(address,address,uint256)\":{\"details\":\"Requirements: - The indexer must be registered - The provision must be valid according to the subgraph service rules - `tokens` must be different from the current allocation size - The indexer must have enough available tokens to allocate if they are upsizing the allocation Emits a {AllocationResized} event. See {AllocationManager-_resizeAllocation} for more details.\",\"params\":{\"allocationId\":\"The id of the allocation\",\"indexer\":\"The address of the indexer\",\"tokens\":\"The new amount of tokens in the allocation\"}},\"setCurationCut(uint256)\":{\"details\":\"Emits a {CuratorCutSet} event\",\"params\":{\"curationCut\":\"The curation cut for the payment type\"}},\"setDelegationRatio(uint32)\":{\"params\":{\"delegationRatio\":\"The delegation ratio\"}},\"setMaxPOIStaleness(uint256)\":{\"params\":{\"maxPOIStaleness\":\"The max POI staleness in seconds\"}},\"setMinimumProvisionTokens(uint256)\":{\"params\":{\"minimumProvisionTokens\":\"The minimum amount of provisioned tokens required to create an allocation\"}},\"setPauseGuardian(address,bool)\":{\"params\":{\"allowed\":\"True if the pause guardian is allowed to pause the contract, false otherwise\",\"pauseGuardian\":\"The address of the pause guardian\"}},\"setPaymentsDestination(address)\":{\"details\":\"Emits a {PaymentsDestinationSet} event\",\"params\":{\"paymentsDestination\":\"The address where payments should be sent\"}},\"setStakeToFeesRatio(uint256)\":{\"params\":{\"stakeToFeesRatio\":\"The stake to fees ratio\"}},\"slash(address,bytes)\":{\"details\":\"To slash the service provider's provision the function should call {Staking-slash}. Emits a {ServiceProviderSlashed} event.\",\"params\":{\"data\":\"Custom data, usage defined by the data service.\",\"serviceProvider\":\"The address of the service provider.\"}},\"startService(address,bytes)\":{\"details\":\"Emits a {ServiceStarted} event.\",\"params\":{\"data\":\"Custom data, usage defined by the data service.\",\"serviceProvider\":\"The address of the service provider.\"}},\"stopService(address,bytes)\":{\"details\":\"Emits a {ServiceStopped} event.\",\"params\":{\"data\":\"Custom data, usage defined by the data service.\",\"serviceProvider\":\"The address of the service provider.\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"unpause()\":{\"details\":\"Note that only functions using the modifiers `whenNotPaused` and `whenPaused` will be affected by the pause. Requirements: - The contract must be paused\"}},\"title\":\"SubgraphService contract\",\"version\":1},\"userdoc\":{\"errors\":{\"AllocationAlreadyExists(address)\":[{\"notice\":\"Thrown when attempting to create an allocation with an existing id\"}],\"AllocationClosed(address,uint256)\":[{\"notice\":\"Thrown when trying to perform an operation on a closed allocation\"}],\"AllocationDoesNotExist(address)\":[{\"notice\":\"Thrown when trying to perform an operation on a non-existent allocation\"}],\"AllocationManagerAllocationClosed(address)\":[{\"notice\":\"Thrown when attempting to collect indexing rewards on a closed allocationl\"}],\"AllocationManagerAllocationSameSize(address,uint256)\":[{\"notice\":\"Thrown when attempting to resize an allocation with the same size\"}],\"AllocationManagerInvalidAllocationProof(address,address)\":[{\"notice\":\"Thrown when an allocation proof is invalid Both `signer` and `allocationId` should match for a valid proof.\"}],\"AllocationManagerInvalidZeroAllocationId()\":[{\"notice\":\"Thrown when attempting to create an allocation with a zero allocation id\"}],\"DataServiceFeesClaimNotFound(bytes32)\":[{\"notice\":\"Thrown when attempting to get a stake claim that does not exist.\"}],\"DataServiceFeesZeroTokens()\":[{\"notice\":\"Emitted when trying to lock zero tokens in a stake claim\"}],\"DataServicePausableNotPauseGuardian(address)\":[{\"notice\":\"Emitted when a the caller is not a pause guardian\"}],\"DataServicePausablePauseGuardianNoChange(address,bool)\":[{\"notice\":\"Emitted when a pause guardian is set to the same allowed status\"}],\"DirectoryNotDisputeManager(address,address)\":[{\"notice\":\"Thrown when the caller is not the Dispute Manager\"}],\"GraphDirectoryInvalidZeroAddress(bytes)\":[{\"notice\":\"Thrown when either the controller is the zero address or a contract address is not found on the controller\"}],\"LegacyAllocationAlreadyExists(address)\":[{\"notice\":\"Thrown when attempting to migrate an allocation with an existing id\"}],\"LinkedListEmptyList()\":[{\"notice\":\"Thrown when trying to remove an item from an empty list\"}],\"LinkedListInvalidIterations()\":[{\"notice\":\"Thrown when trying to traverse a list with more iterations than elements\"}],\"LinkedListInvalidZeroId()\":[{\"notice\":\"Thrown when trying to add an item with id equal to bytes32(0)\"}],\"LinkedListMaxElementsExceeded()\":[{\"notice\":\"Thrown when trying to add an item to a list that has reached the maximum number of elements\"}],\"PPMMathInvalidMulPPM(uint256,uint256)\":[{\"notice\":\"Thrown when no value in a multiplication is in PPM.\"}],\"ProvisionManagerInvalidRange(uint256,uint256)\":[{\"notice\":\"Thrown when attempting to set a range where min is greater than max.\"}],\"ProvisionManagerInvalidValue(bytes,uint256,uint256,uint256)\":[{\"notice\":\"Thrown when a provision parameter is out of range.\"}],\"ProvisionManagerNotAuthorized(address,address)\":[{\"notice\":\"Thrown when the caller is not authorized to manage the provision of a service provider.\"}],\"ProvisionManagerProvisionNotFound(address)\":[{\"notice\":\"Thrown when a provision is not found.\"}],\"ProvisionTrackerInsufficientTokens(uint256,uint256)\":[{\"notice\":\"Thrown when trying to lock more tokens than available\"}],\"SubgraphServiceAllocationIsAltruistic(address)\":[{\"notice\":\"Thrown when trying to force close an altruistic allocation\"}],\"SubgraphServiceAllocationNotAuthorized(address,address)\":[{\"notice\":\"Thrown when the indexer in the allocation state does not match the expected indexer.\"}],\"SubgraphServiceCannotForceCloseAllocation(address)\":[{\"notice\":\"Thrown when trying to force close an allocation that is not stale and the indexer is not over-allocated\"}],\"SubgraphServiceEmptyGeohash()\":[{\"notice\":\"Thrown when an indexer tries to register with an empty geohash\"}],\"SubgraphServiceEmptyUrl()\":[{\"notice\":\"Thrown when an indexer tries to register with an empty URL\"}],\"SubgraphServiceInconsistentCollection(uint256,uint256)\":[{\"notice\":\"Thrown when the contract GRT balance is inconsistent after collecting from Graph Payments\"}],\"SubgraphServiceIndexerAlreadyRegistered()\":[{\"notice\":\"Thrown when an indexer tries to register but they are already registered\"}],\"SubgraphServiceIndexerMismatch(address,address)\":[{\"notice\":\"@notice Thrown when the service provider in the RAV does not match the expected indexer.\"}],\"SubgraphServiceIndexerNotRegistered(address)\":[{\"notice\":\"Thrown when an indexer tries to perform an operation but they are not registered\"}],\"SubgraphServiceInvalidCollectionId(bytes32)\":[{\"notice\":\"Thrown when collectionId is not a valid address\"}],\"SubgraphServiceInvalidCurationCut(uint256)\":[{\"notice\":\"Thrown when trying to set a curation cut that is not a valid PPM value\"}],\"SubgraphServiceInvalidPaymentType(uint8)\":[{\"notice\":\"Thrown when an indexer tries to collect fees for an unsupported payment type\"}],\"SubgraphServiceInvalidRAV(address,address)\":[{\"notice\":\"Thrown when collecting a RAV where the RAV indexer is not the same as the allocation indexer\"}],\"SubgraphServiceInvalidZeroStakeToFeesRatio()\":[{\"notice\":\"Thrown when trying to set stake to fees ratio to zero\"}]},\"events\":{\"AllocationCreated(address,address,bytes32,uint256,uint256)\":{\"notice\":\"Emitted when an indexer creates an allocation\"},\"AllocationResized(address,address,bytes32,uint256,uint256)\":{\"notice\":\"Emitted when an indexer resizes an allocation\"},\"CurationCutSet(uint256)\":{\"notice\":\"Emitted when curator cuts are set\"},\"DelegationRatioSet(uint32)\":{\"notice\":\"Emitted when the delegation ratio is set.\"},\"GraphDirectoryInitialized(address,address,address,address,address,address,address,address,address,address)\":{\"notice\":\"Emitted when the GraphDirectory is initialized\"},\"IndexingRewardsCollected(address,address,bytes32,uint256,uint256,uint256,bytes32,bytes,uint256)\":{\"notice\":\"Emitted when an indexer collects indexing rewards for an allocation\"},\"LegacyAllocationMigrated(address,address,bytes32)\":{\"notice\":\"Emitted when a legacy allocation is migrated into the subgraph service\"},\"MaxPOIStalenessSet(uint256)\":{\"notice\":\"Emitted when the maximum POI staleness is updated\"},\"PauseGuardianSet(address,bool)\":{\"notice\":\"Emitted when a pause guardian is set.\"},\"PaymentsDestinationSet(address,address)\":{\"notice\":\"Emitted when an indexer sets a new payments destination\"},\"ProvisionPendingParametersAccepted(address)\":{\"notice\":\"Emitted when a service provider accepts a provision in {Graph Horizon staking contract}.\"},\"ProvisionTokensRangeSet(uint256,uint256)\":{\"notice\":\"Emitted when the provision tokens range is set.\"},\"QueryFeesCollected(address,address,address,bytes32,uint256,uint256)\":{\"notice\":\"Emitted when a subgraph service collects query fees from Graph Payments\"},\"ServicePaymentCollected(address,uint8,uint256)\":{\"notice\":\"Emitted when a service provider collects payment.\"},\"ServiceProviderRegistered(address,bytes)\":{\"notice\":\"Emitted when a service provider is registered with the data service.\"},\"ServiceProviderSlashed(address,uint256)\":{\"notice\":\"Emitted when a service provider is slashed.\"},\"ServiceStarted(address,bytes)\":{\"notice\":\"Emitted when a service provider starts providing the service.\"},\"ServiceStopped(address,bytes)\":{\"notice\":\"Emitted when a service provider stops providing the service.\"},\"StakeClaimLocked(address,bytes32,uint256,uint256)\":{\"notice\":\"Emitted when a stake claim is created and stake is locked.\"},\"StakeClaimReleased(address,bytes32,uint256,uint256)\":{\"notice\":\"Emitted when a stake claim is released and stake is unlocked.\"},\"StakeClaimsReleased(address,uint256,uint256)\":{\"notice\":\"Emitted when a series of stake claims are released.\"},\"StakeToFeesRatioSet(uint256)\":{\"notice\":\"Emitted when the stake to fees ratio is set.\"},\"SubgraphServiceDirectoryInitialized(address,address,address,address)\":{\"notice\":\"Emitted when the Directory is initialized\"},\"ThawingPeriodRangeSet(uint64,uint64)\":{\"notice\":\"Emitted when the thawing period range is set.\"},\"VerifierCutRangeSet(uint32,uint32)\":{\"notice\":\"Emitted when the verifier cut range is set.\"}},\"kind\":\"user\",\"methods\":{\"acceptProvisionPendingParameters(address,bytes)\":{\"notice\":\"Accepts pending parameters in the provision of a service provider in the {Graph Horizon staking contract}.\"},\"allocationProvisionTracker(address)\":{\"notice\":\"Tracks allocated tokens per indexer\"},\"claims(bytes32)\":{\"notice\":\"List of all locked stake claims to be released to service providers\"},\"claimsLists(address)\":{\"notice\":\"Service providers registered in the data service\"},\"closeStaleAllocation(address)\":{\"notice\":\"Force close a stale allocation\"},\"collect(address,uint8,bytes)\":{\"notice\":\"Collects payment earnt by the service provider.\"},\"constructor\":{\"notice\":\"Constructor for the SubgraphService contract\"},\"curationFeesCut()\":{\"notice\":\"The cut curators take from query fee payments. In PPM.\"},\"encodeAllocationProof(address,address)\":{\"notice\":\"Encodes the allocation proof for EIP712 signing\"},\"feesProvisionTracker(address)\":{\"notice\":\"The amount of tokens locked in stake claims for each service provider\"},\"getAllocation(address)\":{\"notice\":\"Gets the details of an allocation For legacy allocations use {getLegacyAllocation}\"},\"getCuration()\":{\"notice\":\"Gets the address of the curation contract\"},\"getDelegationRatio()\":{\"notice\":\"External getter for the delegation ratio\"},\"getDisputeManager()\":{\"notice\":\"Gets the address of the dispute manager\"},\"getGraphTallyCollector()\":{\"notice\":\"Gets the address of the graph tally collector\"},\"getLegacyAllocation(address)\":{\"notice\":\"Gets the details of a legacy allocation For non-legacy allocations use {getAllocation}\"},\"getProvisionTokensRange()\":{\"notice\":\"External getter for the provision tokens range\"},\"getSubgraphAllocatedTokens(bytes32)\":{\"notice\":\"Return the total amount of tokens allocated to subgraph.\"},\"getThawingPeriodRange()\":{\"notice\":\"External getter for the thawing period range\"},\"getVerifierCutRange()\":{\"notice\":\"External getter for the verifier cut range\"},\"indexers(address)\":{\"notice\":\"Service providers registered in the data service\"},\"initialize(address,uint256,uint32,uint256)\":{\"notice\":\"Initialize the contract\"},\"isOverAllocated(address)\":{\"notice\":\"Checks if an indexer is over-allocated\"},\"maxPOIStaleness()\":{\"notice\":\"Maximum amount of time, in seconds, allowed between presenting POIs to qualify for indexing rewards\"},\"migrateLegacyAllocation(address,address,bytes32)\":{\"notice\":\"Imports a legacy allocation id into the subgraph service This is a governor only action that is required to prevent indexers from re-using allocation ids from the legacy staking contract.\"},\"pause()\":{\"notice\":\"Pauses the data service.\"},\"pauseGuardians(address)\":{\"notice\":\"List of pause guardians and their allowed status\"},\"paymentsDestination(address)\":{\"notice\":\"Destination of indexer payments\"},\"register(address,bytes)\":{\"notice\":\"Registers a service provider with the data service. The service provider can now start providing the service.\"},\"releaseStake(uint256)\":{\"notice\":\"Releases expired stake claims for the caller.\"},\"resizeAllocation(address,address,uint256)\":{\"notice\":\"Change the amount of tokens in an allocation\"},\"setCurationCut(uint256)\":{\"notice\":\"Sets the curators payment cut for query fees\"},\"setDelegationRatio(uint32)\":{\"notice\":\"Sets the delegation ratio\"},\"setMaxPOIStaleness(uint256)\":{\"notice\":\"Sets the max POI staleness See {AllocationManagerV1Storage-maxPOIStaleness} for more details.\"},\"setMinimumProvisionTokens(uint256)\":{\"notice\":\"Sets the minimum amount of provisioned tokens required to create an allocation\"},\"setPauseGuardian(address,bool)\":{\"notice\":\"Sets a pause guardian\"},\"setPaymentsDestination(address)\":{\"notice\":\"Sets the payments destination for an indexer to receive payments\"},\"setStakeToFeesRatio(uint256)\":{\"notice\":\"Sets the stake to fees ratio\"},\"slash(address,bytes)\":{\"notice\":\"Slash a service provider for misbehaviour.\"},\"stakeToFeesRatio()\":{\"notice\":\"Multiplier for how many tokens back collected query fees\"},\"startService(address,bytes)\":{\"notice\":\"Service provider starts providing the service.\"},\"stopService(address,bytes)\":{\"notice\":\"Service provider stops providing the service.\"},\"unpause()\":{\"notice\":\"Unpauses the data service.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/SubgraphService.sol\":\"SubgraphService\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10},\"remappings\":[]},\"sources\":{\"@graphprotocol/contracts/contracts/arbitrum/ITokenGateway.sol\":{\"keccak256\":\"0x3cbcc6e4629543a99acacc7ee4ffa6c063b9fb17d3597ccd2f9481008e3633bd\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://d6bb0bb830b67d579e57a261e5f5d9e90b32dc006b02badbecf1f6c82c0a5100\",\"dweb:/ipfs/Qmd38iNXZpinwbNRJPEAA8r9bmmtRwjTSK1SkmH47ge4kJ\"]},\"@graphprotocol/contracts/contracts/curation/ICuration.sol\":{\"keccak256\":\"0x17e4db429003cab08cd2859db94b95e0cee1f9478c1881903a4104def8fdc048\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://52ed58228a0e92aeb3493473a6e02f92d26a4e4eb0c46d38dd446e3bfcb6691e\",\"dweb:/ipfs/QmZzWxHAztdz2Q7cobqVEf4ExGpNuqWJFYgs2oHCgApjW6\"]},\"@graphprotocol/contracts/contracts/epochs/IEpochManager.sol\":{\"keccak256\":\"0x0f4b3a3569c023d2610d0d8b37b3ecb0b67f848d77aa063bb311756670017e85\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://df7c43568e554b301134aa2c58e4889ad0d3dcfec40e834b63621a43f39da154\",\"dweb:/ipfs/QmZeSV9AM6FKCkH9QYyF7i5nVggseEJXbvWbtrgUeXqQpo\"]},\"@graphprotocol/contracts/contracts/governance/IController.sol\":{\"keccak256\":\"0xe37df86cdea385d708ba00862cd9e04940e4f2aa50354fb3a9d2d4f505d5509a\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://0f6c9fd2b7a8c5a6b89ef12c7423144df04a5f251d5480be1b73c74a785ff12a\",\"dweb:/ipfs/QmYpiCQoxbDEYQ2FNA39Z4FGfoxfQ8jvH1Z3ccrqguQFMP\"]},\"@graphprotocol/contracts/contracts/rewards/IRewardsIssuer.sol\":{\"keccak256\":\"0xe049090c38a64d80b284ba2a7b440bcedba9804d96f2bb8da525e69ac452e03a\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://8b7d1186bd0698bed02d3504ac80c20e605087fba036d5ff392b39a9a3c818e5\",\"dweb:/ipfs/QmRgAfY1dD5rc7fLuuGVyu2mh9Z8qz1AVvuXAcRGnB3dSv\"]},\"@graphprotocol/contracts/contracts/rewards/IRewardsManager.sol\":{\"keccak256\":\"0xee4b213950c2e46481658b9b04f2d5dae0a96c4cce0ee346188b1f1272718d54\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://b26dd767bd6887666a18beef79c322d27a693a3a4f7a61dc6bded7f35796acf5\",\"dweb:/ipfs/QmXDeqmRSeAWUWQTknNLUPBDBnDr8ySYW4h6CBPRGMJoPp\"]},\"@graphprotocol/contracts/contracts/token/IGraphToken.sol\":{\"keccak256\":\"0x2ffad6798d641c8d1288730be725c43041c803caceaf6d9985122d000ad5761c\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://5f782a5670037fc9223dc20fd4f99c0277a9bec7d08f7800b0a0733e819a07cb\",\"dweb:/ipfs/QmP3K2QnmukScCh1nzgphYdg7AiAuTaT914jq4txLYNpra\"]},\"@graphprotocol/contracts/contracts/utils/TokenUtils.sol\":{\"keccak256\":\"0x7bd336193785ed6f09a3bd847f9208f64aa9b87ad67c40838d00fec41bb153d5\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://d96d83cdb9bbb567e4eafac8bdef3ff6bdaf426338baf76bae277c11afb33cee\",\"dweb:/ipfs/QmNjr4PiJ76Wc5mFqa9H88BjsEMrUfy1jiftNHYTgd6Mp5\"]},\"@graphprotocol/horizon/contracts/data-service/DataService.sol\":{\"keccak256\":\"0xa57fda8ea4c94a2cda061a6c8f29ae215241b0af03a43df3bc622051d8b2493c\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://7fc433ef0eb71c264224e9058de7e9aea3b2dbfab68dbdf0df8a13de82e90ef6\",\"dweb:/ipfs/QmVrp6kv8Ef1AP38C4soa1cnnRqqmKFnHer2VrXms52Asy\"]},\"@graphprotocol/horizon/contracts/data-service/DataServiceStorage.sol\":{\"keccak256\":\"0x615aac9d5c9cd04216fa9ee21c770f3877a2971a1c023052143c95c08b87610f\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://bd4eb031e9ab86e3a17df29fcb297621e88850c3c5db123925d24b77c802b037\",\"dweb:/ipfs/QmSCNfQqMzui9gaN3Rf8nTNJBPWSFNqFgexbK2k6GBN381\"]},\"@graphprotocol/horizon/contracts/data-service/extensions/DataServiceFees.sol\":{\"keccak256\":\"0xa9e95b7ca9af3987697c06b252fdb12e1d01e5c62c123c17f39f03d96d38876f\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://d86b520570fb3dd76b60fc64eabe6a7104b41a96a9c92e9031c91a799287d749\",\"dweb:/ipfs/QmZGaiEZVfycnQu4EkPWGM7Jg3jo4jdEuLeuZxAMPMg5s6\"]},\"@graphprotocol/horizon/contracts/data-service/extensions/DataServiceFeesStorage.sol\":{\"keccak256\":\"0x9068f639ea7aad02d842eb0054cadc3a5f05044d8d0176dc4c9ff60693775bc0\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://9e22fd5157ea02064104b02952c327ab58b0a5c70c7356d94017f3e03da298d4\",\"dweb:/ipfs/QmdTZAFaZWSpVUvWTnUgednbRNLMbFvUMKZ5FHkjhRk4Qf\"]},\"@graphprotocol/horizon/contracts/data-service/extensions/DataServicePausableUpgradeable.sol\":{\"keccak256\":\"0x57790344249a2d9fac827173389665a678619103d3baba0df0f9ec72f514cba7\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://964b818fdefcaf55cfd1c8f7066c44032e8dc82f1569f35d875e86c147b94e23\",\"dweb:/ipfs/QmcsjNPCFbYPdLiTjmykgVSLXbZxA2pJ1N7JXaWtxJzZet\"]},\"@graphprotocol/horizon/contracts/data-service/interfaces/IDataService.sol\":{\"keccak256\":\"0x2208814f64eeca9409eafc1a1fa425c67ff38cffdffc3af0bafbe1c1b338ed32\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://925b32efbd9fe85a98f8f1f51e865e0b7b65d933196cf6c098bd670da7138e0c\",\"dweb:/ipfs/Qmdrp7BGJ4fEKzDgZpVY1FULXKsHAdGXkx4nqRrWvMaumr\"]},\"@graphprotocol/horizon/contracts/data-service/interfaces/IDataServiceFees.sol\":{\"keccak256\":\"0x1b82ae2785502fe62d3ca6f55a3ed836b8b038a3b929cced92e1c6b4733f4074\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://5556b2ce53b604427a995fb50f7169acb3fe30f60ef19c7cb5c22bd5ec53177c\",\"dweb:/ipfs/QmXx7dmTeAYAMPbbrGrcsKT31dqEqbcFgXWaPS6LQrANru\"]},\"@graphprotocol/horizon/contracts/data-service/interfaces/IDataServicePausable.sol\":{\"keccak256\":\"0x6e65df59821dce2e4c9c221e1381eac69534464b8c69c83c2f18bff188e120f5\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://bd7f1d4d7b1d9de204580678f24fbe453235bbc1fbb15f65f022619a419b11a8\",\"dweb:/ipfs/QmP7JnK6Buor5bvRFcb427ACJKTwX6mnJb31TJzKL4EnSD\"]},\"@graphprotocol/horizon/contracts/data-service/libraries/ProvisionTracker.sol\":{\"keccak256\":\"0xc0f433a20f91fb2c2c588d5accfd311535314d71f7adc4e2b84fa4193ed1a739\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://a920d9446c3e76783921d2f2d980a058f41700de1d59470c9b3892a49ebcaf48\",\"dweb:/ipfs/QmcwmqNkxS1BpJQ7kgf4V9F98w2MKcVvg2N7P3i8KtDSF4\"]},\"@graphprotocol/horizon/contracts/data-service/utilities/ProvisionManager.sol\":{\"keccak256\":\"0x63e7f1df10586beb7f8683065719fbff045437508539a9358c25a13fcf989f91\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://b32f9a7be91ae6d9c9a6edbe2404efbcf9fa99c1d503f4a688054be468494a8e\",\"dweb:/ipfs/QmQ5AQXsBPxtJSW24LqRZAaYYaz1518FpUCHfDEdsMfF8F\"]},\"@graphprotocol/horizon/contracts/data-service/utilities/ProvisionManagerStorage.sol\":{\"keccak256\":\"0xe44f72a63c472a6de42e08a2d732044fe1ac9245c4203d4e1eb941b1a2fa2159\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://412708a4f94b5757e46676c5702e47d37fdbdacbe53f70e2ee93d37c5938e028\",\"dweb:/ipfs/Qmdw4uagDdKeCzyS319BKyPzfnWCvM3KCtNYosFBd3xGco\"]},\"@graphprotocol/horizon/contracts/interfaces/IGraphPayments.sol\":{\"keccak256\":\"0xa22dcc47676073113e4ebe30045065662cee5531f9c5f75776c00e70a1929c81\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://8908f30b3c7536798b14dc62fb5ccffc05570d568dbd1bade7c79c1fd2a4b5fe\",\"dweb:/ipfs/QmexZgb5mhDmXVZnYX1Z37cwM7EG2prYyBEVjUSVdKshVr\"]},\"@graphprotocol/horizon/contracts/interfaces/IGraphProxyAdmin.sol\":{\"keccak256\":\"0x4410253d7de56d2cdff50ee141c52fd77fd23f3984440211c3cc90ad560f4f9d\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://da4425a908816c40ffc3c833504843c3732bcb47e745dc544f650e5bc2c23f25\",\"dweb:/ipfs/QmZYDS4cSKBqRXEU3qyjE6sxGModSeNgzQmdZmZCGHuaKt\"]},\"@graphprotocol/horizon/contracts/interfaces/IGraphTallyCollector.sol\":{\"keccak256\":\"0x762c26300d098fb1bdc5e6b52e0ffd0b497634e9bcfc9a9cd409df65d8d54590\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://f5c68742e96c1483449c882b082631a9bfafebb27152b87427e1234d34e604f3\",\"dweb:/ipfs/QmYqtSeQpCbKEaKKDXwmeK5DrYFiwSHYVzM3dzanh7MQ3D\"]},\"@graphprotocol/horizon/contracts/interfaces/IHorizonStaking.sol\":{\"keccak256\":\"0x4b146f30ee66c4224cb5a82bafc8299f8596d8fe302e793757520f67bba8a166\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://30666c737d72a850223c1966d3b5d02b84f3f808f3c8dae8d0748731646b60c5\",\"dweb:/ipfs/QmQschyZQtU8tTnQ9hNiG5nobuXBx6KeiKdfxvZ4zvQ7ty\"]},\"@graphprotocol/horizon/contracts/interfaces/IPaymentsCollector.sol\":{\"keccak256\":\"0x0871e02129e1fabdb39024f9ac3368b4c747e6b374fdf4fc200d3c225ed82860\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://a5fdf2dbedc15f739e6010a3ce3478ea7ad23bd643a8af3f39ccf631c06ebd52\",\"dweb:/ipfs/QmNusbPTqzzUwGomXBzsWHwbZMJ2HuTkxvgviLJZ6hr9i4\"]},\"@graphprotocol/horizon/contracts/interfaces/IPaymentsEscrow.sol\":{\"keccak256\":\"0x99e2a676b539e7b6c223a551f8cb9770c07435a25c8b22f0044a8ce4949edadc\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://f702a3cea214d8328d89a0ef16495c709e30fe13eb86fc29940159c9cb8c7bd5\",\"dweb:/ipfs/QmS25Zgcw85kDZcicApLzRmDcoYNQafpFdMyBEWX8eLWSX\"]},\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingBase.sol\":{\"keccak256\":\"0x9bdab6cb595eabd7d321d7beae03ad3607995c14ef40f0c2f349fb72084766c5\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://6cac2ca3580bd770b98b07b11ebb007e8a922a90cde920e6ec472df7e66fb512\",\"dweb:/ipfs/QmRw1rjT8D8gNp2GRTuwDETwHNHMpHKoHZq4pYBAn9i65F\"]},\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingExtension.sol\":{\"keccak256\":\"0x7923f39746198b5672f0e4d65b7bf14903ae5f7775d74b210effb957eea36c71\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://c29531aff69c71e649fb347d7117ea8c42fc8de09860a1c389ed9b8f097a34e0\",\"dweb:/ipfs/QmS89fww584HiyE1BdPe8Xaqbf5v7FEvL38GTxeHEAsLFm\"]},\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingMain.sol\":{\"keccak256\":\"0xd04bb1f6a427e858e8a625b4b9835c69c8891a324d22beba20293ab2a77e5de7\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://05c9e425eee0b6c109a8dad2edcf9e1c845c64fccf321edf804921394ee048be\",\"dweb:/ipfs/QmbwLWNof534oG5ohzNAWrjdQ5kqJs7M5d5kCRd68XUogB\"]},\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingTypes.sol\":{\"keccak256\":\"0xaaeb9770f8aaae6b395e87bb1876a10fe7c14384d16d97dd33a671c3ea53aa7b\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://8f5c019fdb2df73bafe464fb6e9da792f7833a0c1858734bcd6a6b8d6ae924c7\",\"dweb:/ipfs/QmcubeYTHCYBqQsRncBFpPFtk7JzRz4nFh27LUW1m4hx2K\"]},\"@graphprotocol/horizon/contracts/libraries/LinkedList.sol\":{\"keccak256\":\"0x99058b4da0428b8d9c22d3d112acbaa59900f1fd0a434038b1a4fccfe3c678d6\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://568e03231c6081eacbcb6585a05c0b1bb976b640b611f7bf6155f9b58d887239\",\"dweb:/ipfs/QmdPZQWhkhjf5TUwz487Dwm4ycjX323iNdwb1sQnAiA1Qu\"]},\"@graphprotocol/horizon/contracts/libraries/PPMMath.sol\":{\"keccak256\":\"0xe7fcfd44d2919944b79a11a39da7d4539d49c4bcf510071a59f6b41c37ee8ef2\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://a21b1ff7ca81fa07f153b60aeca136bd1ee57d9d01a2c76635e4a5602e8959fc\",\"dweb:/ipfs/QmQ5C7mUjt4sv1NBt1FH5XVHN3aBsHnvDsdJKWywhLjso8\"]},\"@graphprotocol/horizon/contracts/libraries/UintRange.sol\":{\"keccak256\":\"0x70d69069b2c122becd29ec4ea9a79f2e26cf7cbe7b1918ffced691ee00cdbd82\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://6bddc7d257c3df1fd4940dd3c554e5a1efbc1b23d50f7878415389b75380628c\",\"dweb:/ipfs/QmTQBCsL4pHoXMixVvDwGMdmJnGfEeeDZfHdJkcpKamu58\"]},\"@graphprotocol/horizon/contracts/utilities/GraphDirectory.sol\":{\"keccak256\":\"0x1d09be2f7454873ab80f86ed5d590b9e796fe5146977c4c4a5b1f7ead17eb522\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://e1c7539d26f069c2acabd404601e7811f8878f66976e8b5d4f5438195de793c2\",\"dweb:/ipfs/QmUAybvtDZ275kAnU6r81aQy1FCp7zLscSV87oe9nbwjyU\"]},\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\":{\"keccak256\":\"0xc163fcf9bb10138631a9ba5564df1fa25db9adff73bd9ee868a8ae1858fe093a\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://9706d43a0124053d9880f6e31a59f31bc0a6a3dc1acd66ce0a16e1111658c5f6\",\"dweb:/ipfs/QmUFmfowzkRwGtDu36cXV9SPTBHJ3n7dG9xQiK5B28jTf2\"]},\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"keccak256\":\"0xdb4d24ee2c087c391d587cd17adfe5b3f9d93b3110b1388c2ab6c7c0ad1dcd05\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://ab7b6d5b9e2b88176312967fe0f0e78f3d9a1422fa5e4b64e2440c35869b5d08\",\"dweb:/ipfs/QmXKYWWyzcLg1B2k7Sb1qkEXgLCYfXecR9wYW5obRzWP1Q\"]},\"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol\":{\"keccak256\":\"0xdbef5f0c787055227243a7318ef74c8a5a1108ca3a07f2b3a00ef67769e1e397\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://08e39f23d5b4692f9a40803e53a8156b72b4c1f9902a88cd65ba964db103dab9\",\"dweb:/ipfs/QmPKn6EYDgpga7KtpkA8wV2yJCYGMtc9K4LkJfhKX2RVSV\"]},\"@openzeppelin/contracts-upgradeable/utils/MulticallUpgradeable.sol\":{\"keccak256\":\"0xe5775eb1fb17165cd191e8f8b2232dbea8765e7e610eaa3d6e52feead793ec5a\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://352614aea75c3d913cbcabb528be3d6c3335c3c77da41d59486a3193069dd095\",\"dweb:/ipfs/QmR3Nabxfme6tHrAMJCyK4MWZtpund2c4R7aFKmea3sGZM\"]},\"@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol\":{\"keccak256\":\"0xa6bf6b7efe0e6625a9dcd30c5ddf52c4c24fe8372f37c7de9dbf5034746768d5\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://8c353ee3705bbf6fadb84c0fb10ef1b736e8ca3ca1867814349d1487ed207beb\",\"dweb:/ipfs/QmcugaPssrzGGE8q4YZKm2ZhnD3kCijjcgdWWg76nWt3FY\"]},\"@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol\":{\"keccak256\":\"0xd45a5b1d0e451376b08e1bc7e332426c24382053300acf0ac667be1b8abb6cc2\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://824eb0b8c71db8b95b707218d8540c2046a2fefc642e74b343ae90e5c72e2b52\",\"dweb:/ipfs/QmdQTZTomqxRrySDNdv1FEyh3ZWibxwC9FRdcV3DCuASpx\"]},\"@openzeppelin/contracts/interfaces/IERC5267.sol\":{\"keccak256\":\"0x92aa1df62dc3d33f1656d63bede0923e0df0b706ad4137c8b10b0a8fe549fd92\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://c5c0f29195ad64cbe556da8e257dac8f05f78c53f90323c0d2accf8e6922d33a\",\"dweb:/ipfs/QmQ61TED8uaCZwcbh8KkgRSsCav7x7HbcGHwHts3U4DmUP\"]},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0xe06a3f08a987af6ad2e1c1e774405d4fe08f1694b67517438b467cecf0da0ef7\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://df6f0c459663c9858b6cba2cda1d14a7d05a985bed6d2de72bd8e78c25ee79db\",\"dweb:/ipfs/QmeTTxZ7qVk9rjEv2R4CpCwdf8UMCcRqDNMvzNxHc3Fnn9\"]},\"@openzeppelin/contracts/utils/Address.sol\":{\"keccak256\":\"0xaaa1d17c1129b127a4a401db2fbd72960e2671474be3d08cae71ccdc42f7624c\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://cb2f27cd3952aa667e198fba0d9b7bcec52fbb12c16f013c25fe6fb52b29cc0e\",\"dweb:/ipfs/QmeuohBFoeyDPZA9JNCTEDz3VBfBD4EABWuWXVhHAuEpKR\"]},\"@openzeppelin/contracts/utils/Errors.sol\":{\"keccak256\":\"0x6afa713bfd42cf0f7656efa91201007ac465e42049d7de1d50753a373648c123\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://ba1d02f4847670a1b83dec9f7d37f0b0418d6043447b69f3a29a5f9efc547fcf\",\"dweb:/ipfs/QmQ7iH2keLNUKgq2xSWcRmuBE5eZ3F5whYAkAGzCNNoEWB\"]},\"@openzeppelin/contracts/utils/Panic.sol\":{\"keccak256\":\"0xf7fe324703a64fc51702311dc51562d5cb1497734f074e4f483bfb6717572d7a\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://c6a5ff4f9fd8649b7ee20800b7fa387d3465bd77cf20c2d1068cd5c98e1ed57a\",\"dweb:/ipfs/QmVSaVJf9FXFhdYEYeCEfjMVHrxDh5qL4CGkxdMWpQCrqG\"]},\"@openzeppelin/contracts/utils/Strings.sol\":{\"keccak256\":\"0x81c274a60a7ae232ae3dc9ff3a4011b4849a853c13b0832cd3351bb1bb2f0dae\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://9da0c20dc74358a2a76330818f3bac9d1e2ce3371aec847b9cbf5d147fbae4f6\",\"dweb:/ipfs/QmeczhmnFv1hbXKGLwbYXY6Rrytc9a5A2YaRi5QMMgjPnb\"]},\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\":{\"keccak256\":\"0x69f54c02b7d81d505910ec198c11ed4c6a728418a868b906b4a0cf29946fda84\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://8e25e4bdb7ae1f21d23bfee996e22736fc0ab44cfabedac82a757b1edc5623b9\",\"dweb:/ipfs/QmQdWQvB6JCP9ZMbzi8EvQ1PTETqkcTWrbcVurS7DKpa5n\"]},\"@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol\":{\"keccak256\":\"0x26670fef37d4adf55570ba78815eec5f31cb017e708f61886add4fc4da665631\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://b16d45febff462bafd8a5669f904796a835baf607df58a8461916d3bf4f08c59\",\"dweb:/ipfs/QmU2eJFpjmT4vxeJWJyLeQb8Xht1kdB8Y6MKLDPFA9WPux\"]},\"@openzeppelin/contracts/utils/math/Math.sol\":{\"keccak256\":\"0x1225214420c83ebcca88f2ae2b50f053aaa7df7bd684c3e878d334627f2edfc6\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://6c5fab4970634f9ab9a620983dc1c8a30153981a0b1a521666e269d0a11399d3\",\"dweb:/ipfs/QmVRnBC575MESGkEHndjujtR7qub2FzU9RWy9eKLp4hPZB\"]},\"@openzeppelin/contracts/utils/math/SafeCast.sol\":{\"keccak256\":\"0x195533c86d0ef72bcc06456a4f66a9b941f38eb403739b00f21fd7c1abd1ae54\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://b1d578337048cad08c1c03041cca5978eff5428aa130c781b271ad9e5566e1f8\",\"dweb:/ipfs/QmPFKL2r9CBsMwmUqqdcFPfHZB2qcs9g1HDrPxzWSxomvy\"]},\"@openzeppelin/contracts/utils/math/SignedMath.sol\":{\"keccak256\":\"0xb1970fac7b64e6c09611e6691791e848d5e3fe410fa5899e7df2e0afd77a99e3\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://db5fbb3dddd8b7047465b62575d96231ba8a2774d37fb4737fbf23340fabbb03\",\"dweb:/ipfs/QmVUSvooZKEdEdap619tcJjTLcAuH6QBdZqAzWwnAXZAWJ\"]},\"contracts/SubgraphService.sol\":{\"keccak256\":\"0x8b0db301d539c6186ba5024c6658386c3b7ce81022f4a5b6a34dfd04021b3e2d\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://e892e736172dbfe02d3413b70c979d103d133f416b5a9ffa5c6e1a409639c0ec\",\"dweb:/ipfs/QmUfEU6JV5b1fncAzSqv76VhBTTY46pwoF4NhtGeteAgDf\"]},\"contracts/SubgraphServiceStorage.sol\":{\"keccak256\":\"0xe7b9b6fb8f101f99dff6cb27d55089a60e158629e8b67366a009b2a22d0565e8\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://a686dcf3fdce62bff8f41e7e018b54ecc5b3451f4b761b63c0c0f2165a5416c8\",\"dweb:/ipfs/QmNjngfvNkxtP2NeF8ZwAmFWnw4Wz9pwvwFu9DvtF1c6Sw\"]},\"contracts/interfaces/IDisputeManager.sol\":{\"keccak256\":\"0x9db8ffdf7fe30954824ed706a1a5e7c2d6323b745bddba16b7166a639344f9f7\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://e5d810bf6188c38a028dab511c5653fde7b7feca0a173f03974402a83cb234f9\",\"dweb:/ipfs/QmYGtytqHeDFK91FmSNL5iavD8sHUFcA47WBU9BuHG3i75\"]},\"contracts/interfaces/ISubgraphService.sol\":{\"keccak256\":\"0x7516f80b0a8b2e3edeedf06c9b917f2a24e557f8c00632e6150fbb41ef8da3ce\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://ad4f813111541f5ef9ea6236f42822a3a66364d24189e4568450b20e09972a5e\",\"dweb:/ipfs/QmVYQA9rT7T8YnQgAB6fokNYDJeDrgQqrjfJ8sGjySNFBo\"]},\"contracts/libraries/Allocation.sol\":{\"keccak256\":\"0xeabed16693ebd22165d4421bb62b91de64553f94d86d6fd03e3d25a62d651000\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://5beecbf35f8dc63fc9fcd5fe844ff29cb4874c1ac73a96ec7170729efd096b74\",\"dweb:/ipfs/QmPFQyxQYuwae8ARxuLxingd8fQ7GBw1cfTQuUvfo6CWhM\"]},\"contracts/libraries/Attestation.sol\":{\"keccak256\":\"0x0976f586d532d479823ac9e049371742a7a876f0faf3ed722b3b7f78a4586f33\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://34baba14bd7d3dcb1e1111ee09f3c809d6876732bbc889c1486cc329465e711e\",\"dweb:/ipfs/QmPRgYduW85aCjVk4ih35jB2FhoLjBvgmjZtMGeqXaLhTW\"]},\"contracts/libraries/LegacyAllocation.sol\":{\"keccak256\":\"0x32fd54a2823bf3fa4090bf94968b4d8a5988fee8f75d1b805591a744f5766c60\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://2571faaa157c207853cd52e730aaab019384d84618b6dce976b9d794a9634a54\",\"dweb:/ipfs/QmSinKJ1WguxvZte5C3eVfGBo8gsvzTbPQh7uVREWT49uL\"]},\"contracts/utilities/AllocationManager.sol\":{\"keccak256\":\"0xe48e4486cb11da8e2f24afe998ae1f8ab7e2eed0edeff2ff8eb47e120ed32c91\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://0f7336a767d5b959f8cbeb9453834d887c28c9e9e4217d3bacf7faf01aaff33f\",\"dweb:/ipfs/QmQ6twAz4MfREzPbDttCMJqCuo2YNr8ks6R8ZzrJBR3daV\"]},\"contracts/utilities/AllocationManagerStorage.sol\":{\"keccak256\":\"0x45317fa3daef1ebca670b1d3ba19579d7a46b8b19daff7e534a89a122b0fe178\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://ecca9d9581e489225014f8879df4bdd69945f2f686fddeff41e31377670f6866\",\"dweb:/ipfs/QmURUHNSv8i9dtkmdaAJxXqDXfg6hbJXLwUqhHronA8Fwr\"]},\"contracts/utilities/Directory.sol\":{\"keccak256\":\"0x8f8b8d8dd7cd1acee659a21c81782fd9955f364c5b37669c11c135c66371bd3a\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://c50bdf51e6d19d6413920c200b5ddbf07eaa3860b35822633cecf636fd96d29d\",\"dweb:/ipfs/QmTQfCXiKzqpZVJDd3NeLtQvwBTVDXfznVJjEASh4aso4k\"]}},\"version\":1}" + } + }, + "contracts/SubgraphServiceStorage.sol": { + "SubgraphServiceV1Storage": { + "abi": [ + { + "inputs": [], + "name": "curationFeesCut", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + } + ], + "name": "indexers", + "outputs": [ + { + "internalType": "uint256", + "name": "registeredAt", + "type": "uint256" + }, + { + "internalType": "string", + "name": "url", + "type": "string" + }, + { + "internalType": "string", + "name": "geoHash", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + } + ], + "name": "paymentsDestination", + "outputs": [ + { + "internalType": "address", + "name": "destination", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "stakeToFeesRatio", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "evm": { + "bytecode": { + "functionDebugData": {}, + "generatedSources": [], + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "deployedBytecode": { + "functionDebugData": {}, + "generatedSources": [], + "immutableReferences": {}, + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "methodIdentifiers": { + "curationFeesCut()": "138dea08", + "indexers(address)": "4f793cdc", + "paymentsDestination(address)": "07e736d8", + "stakeToFeesRatio()": "d07a7a84" + } + }, + "metadata": "{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"name\":\"curationFeesCut\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"}],\"name\":\"indexers\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"registeredAt\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"url\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"geoHash\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"}],\"name\":\"paymentsDestination\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"stakeToFeesRatio\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"custom:security-contact\":\"Please email security+contracts@thegraph.com if you find any bugs. We may have an active bug bounty program.\",\"kind\":\"dev\",\"methods\":{},\"title\":\"SubgraphServiceStorage\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"curationFeesCut()\":{\"notice\":\"The cut curators take from query fee payments. In PPM.\"},\"indexers(address)\":{\"notice\":\"Service providers registered in the data service\"},\"paymentsDestination(address)\":{\"notice\":\"Destination of indexer payments\"},\"stakeToFeesRatio()\":{\"notice\":\"Multiplier for how many tokens back collected query fees\"}},\"notice\":\"This contract holds all the storage variables for the Subgraph Service contract.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/SubgraphServiceStorage.sol\":\"SubgraphServiceV1Storage\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10},\"remappings\":[]},\"sources\":{\"@graphprotocol/contracts/contracts/rewards/IRewardsIssuer.sol\":{\"keccak256\":\"0xe049090c38a64d80b284ba2a7b440bcedba9804d96f2bb8da525e69ac452e03a\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://8b7d1186bd0698bed02d3504ac80c20e605087fba036d5ff392b39a9a3c818e5\",\"dweb:/ipfs/QmRgAfY1dD5rc7fLuuGVyu2mh9Z8qz1AVvuXAcRGnB3dSv\"]},\"@graphprotocol/horizon/contracts/data-service/interfaces/IDataService.sol\":{\"keccak256\":\"0x2208814f64eeca9409eafc1a1fa425c67ff38cffdffc3af0bafbe1c1b338ed32\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://925b32efbd9fe85a98f8f1f51e865e0b7b65d933196cf6c098bd670da7138e0c\",\"dweb:/ipfs/Qmdrp7BGJ4fEKzDgZpVY1FULXKsHAdGXkx4nqRrWvMaumr\"]},\"@graphprotocol/horizon/contracts/data-service/interfaces/IDataServiceFees.sol\":{\"keccak256\":\"0x1b82ae2785502fe62d3ca6f55a3ed836b8b038a3b929cced92e1c6b4733f4074\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://5556b2ce53b604427a995fb50f7169acb3fe30f60ef19c7cb5c22bd5ec53177c\",\"dweb:/ipfs/QmXx7dmTeAYAMPbbrGrcsKT31dqEqbcFgXWaPS6LQrANru\"]},\"@graphprotocol/horizon/contracts/interfaces/IGraphPayments.sol\":{\"keccak256\":\"0xa22dcc47676073113e4ebe30045065662cee5531f9c5f75776c00e70a1929c81\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://8908f30b3c7536798b14dc62fb5ccffc05570d568dbd1bade7c79c1fd2a4b5fe\",\"dweb:/ipfs/QmexZgb5mhDmXVZnYX1Z37cwM7EG2prYyBEVjUSVdKshVr\"]},\"@graphprotocol/horizon/contracts/interfaces/IHorizonStaking.sol\":{\"keccak256\":\"0x4b146f30ee66c4224cb5a82bafc8299f8596d8fe302e793757520f67bba8a166\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://30666c737d72a850223c1966d3b5d02b84f3f808f3c8dae8d0748731646b60c5\",\"dweb:/ipfs/QmQschyZQtU8tTnQ9hNiG5nobuXBx6KeiKdfxvZ4zvQ7ty\"]},\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingBase.sol\":{\"keccak256\":\"0x9bdab6cb595eabd7d321d7beae03ad3607995c14ef40f0c2f349fb72084766c5\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://6cac2ca3580bd770b98b07b11ebb007e8a922a90cde920e6ec472df7e66fb512\",\"dweb:/ipfs/QmRw1rjT8D8gNp2GRTuwDETwHNHMpHKoHZq4pYBAn9i65F\"]},\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingExtension.sol\":{\"keccak256\":\"0x7923f39746198b5672f0e4d65b7bf14903ae5f7775d74b210effb957eea36c71\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://c29531aff69c71e649fb347d7117ea8c42fc8de09860a1c389ed9b8f097a34e0\",\"dweb:/ipfs/QmS89fww584HiyE1BdPe8Xaqbf5v7FEvL38GTxeHEAsLFm\"]},\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingMain.sol\":{\"keccak256\":\"0xd04bb1f6a427e858e8a625b4b9835c69c8891a324d22beba20293ab2a77e5de7\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://05c9e425eee0b6c109a8dad2edcf9e1c845c64fccf321edf804921394ee048be\",\"dweb:/ipfs/QmbwLWNof534oG5ohzNAWrjdQ5kqJs7M5d5kCRd68XUogB\"]},\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingTypes.sol\":{\"keccak256\":\"0xaaeb9770f8aaae6b395e87bb1876a10fe7c14384d16d97dd33a671c3ea53aa7b\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://8f5c019fdb2df73bafe464fb6e9da792f7833a0c1858734bcd6a6b8d6ae924c7\",\"dweb:/ipfs/QmcubeYTHCYBqQsRncBFpPFtk7JzRz4nFh27LUW1m4hx2K\"]},\"@graphprotocol/horizon/contracts/libraries/LinkedList.sol\":{\"keccak256\":\"0x99058b4da0428b8d9c22d3d112acbaa59900f1fd0a434038b1a4fccfe3c678d6\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://568e03231c6081eacbcb6585a05c0b1bb976b640b611f7bf6155f9b58d887239\",\"dweb:/ipfs/QmdPZQWhkhjf5TUwz487Dwm4ycjX323iNdwb1sQnAiA1Qu\"]},\"@openzeppelin/contracts/utils/Panic.sol\":{\"keccak256\":\"0xf7fe324703a64fc51702311dc51562d5cb1497734f074e4f483bfb6717572d7a\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://c6a5ff4f9fd8649b7ee20800b7fa387d3465bd77cf20c2d1068cd5c98e1ed57a\",\"dweb:/ipfs/QmVSaVJf9FXFhdYEYeCEfjMVHrxDh5qL4CGkxdMWpQCrqG\"]},\"@openzeppelin/contracts/utils/math/Math.sol\":{\"keccak256\":\"0x1225214420c83ebcca88f2ae2b50f053aaa7df7bd684c3e878d334627f2edfc6\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://6c5fab4970634f9ab9a620983dc1c8a30153981a0b1a521666e269d0a11399d3\",\"dweb:/ipfs/QmVRnBC575MESGkEHndjujtR7qub2FzU9RWy9eKLp4hPZB\"]},\"@openzeppelin/contracts/utils/math/SafeCast.sol\":{\"keccak256\":\"0x195533c86d0ef72bcc06456a4f66a9b941f38eb403739b00f21fd7c1abd1ae54\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://b1d578337048cad08c1c03041cca5978eff5428aa130c781b271ad9e5566e1f8\",\"dweb:/ipfs/QmPFKL2r9CBsMwmUqqdcFPfHZB2qcs9g1HDrPxzWSxomvy\"]},\"contracts/SubgraphServiceStorage.sol\":{\"keccak256\":\"0xe7b9b6fb8f101f99dff6cb27d55089a60e158629e8b67366a009b2a22d0565e8\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://a686dcf3fdce62bff8f41e7e018b54ecc5b3451f4b761b63c0c0f2165a5416c8\",\"dweb:/ipfs/QmNjngfvNkxtP2NeF8ZwAmFWnw4Wz9pwvwFu9DvtF1c6Sw\"]},\"contracts/interfaces/ISubgraphService.sol\":{\"keccak256\":\"0x7516f80b0a8b2e3edeedf06c9b917f2a24e557f8c00632e6150fbb41ef8da3ce\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://ad4f813111541f5ef9ea6236f42822a3a66364d24189e4568450b20e09972a5e\",\"dweb:/ipfs/QmVYQA9rT7T8YnQgAB6fokNYDJeDrgQqrjfJ8sGjySNFBo\"]},\"contracts/libraries/Allocation.sol\":{\"keccak256\":\"0xeabed16693ebd22165d4421bb62b91de64553f94d86d6fd03e3d25a62d651000\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://5beecbf35f8dc63fc9fcd5fe844ff29cb4874c1ac73a96ec7170729efd096b74\",\"dweb:/ipfs/QmPFQyxQYuwae8ARxuLxingd8fQ7GBw1cfTQuUvfo6CWhM\"]},\"contracts/libraries/LegacyAllocation.sol\":{\"keccak256\":\"0x32fd54a2823bf3fa4090bf94968b4d8a5988fee8f75d1b805591a744f5766c60\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://2571faaa157c207853cd52e730aaab019384d84618b6dce976b9d794a9634a54\",\"dweb:/ipfs/QmSinKJ1WguxvZte5C3eVfGBo8gsvzTbPQh7uVREWT49uL\"]}},\"version\":1}" + } + }, + "contracts/interfaces/IDisputeManager.sol": { + "IDisputeManager": { + "abi": [ + { + "inputs": [ + { + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + } + ], + "name": "DisputeManagerDisputeAlreadyCreated", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + } + ], + "name": "DisputeManagerDisputeInConflict", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + } + ], + "name": "DisputeManagerDisputeNotInConflict", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "enum IDisputeManager.DisputeStatus", + "name": "status", + "type": "uint8" + } + ], + "name": "DisputeManagerDisputeNotPending", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeManagerDisputePeriodNotFinished", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeManagerDisputePeriodZero", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "DisputeManagerIndexerNotFound", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + } + ], + "name": "DisputeManagerInvalidDispute", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "disputeDeposit", + "type": "uint256" + } + ], + "name": "DisputeManagerInvalidDisputeDeposit", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "cut", + "type": "uint32" + } + ], + "name": "DisputeManagerInvalidFishermanReward", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "maxSlashingCut", + "type": "uint32" + } + ], + "name": "DisputeManagerInvalidMaxSlashingCut", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokensSlash", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxTokensSlash", + "type": "uint256" + } + ], + "name": "DisputeManagerInvalidTokensSlash", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeManagerInvalidZeroAddress", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "relatedDisputeId", + "type": "bytes32" + } + ], + "name": "DisputeManagerMustAcceptRelatedDispute", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "requestCID1", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "responseCID1", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "subgraphDeploymentId1", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "requestCID2", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "responseCID2", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "subgraphDeploymentId2", + "type": "bytes32" + } + ], + "name": "DisputeManagerNonConflictingAttestations", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "subgraphDeploymentId1", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "subgraphDeploymentId2", + "type": "bytes32" + } + ], + "name": "DisputeManagerNonMatchingSubgraphDeployment", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeManagerNotArbitrator", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeManagerNotFisherman", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeManagerSubgraphServiceNotSet", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeManagerZeroTokens", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "arbitrator", + "type": "address" + } + ], + "name": "ArbitratorSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "fisherman", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "DisputeAccepted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "fisherman", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "DisputeCancelled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "disputeDeposit", + "type": "uint256" + } + ], + "name": "DisputeDepositSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "fisherman", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "DisputeDrawn", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "disputeId1", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "disputeId2", + "type": "bytes32" + } + ], + "name": "DisputeLinked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "disputePeriod", + "type": "uint64" + } + ], + "name": "DisputePeriodSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "fisherman", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "DisputeRejected", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "fishermanRewardCut", + "type": "uint32" + } + ], + "name": "FishermanRewardCutSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "fisherman", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "poi", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "stakeSnapshot", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "cancellableAt", + "type": "uint256" + } + ], + "name": "IndexingDisputeCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "fisherman", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensSlash", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensRewards", + "type": "uint256" + } + ], + "name": "LegacyDisputeCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "maxSlashingCut", + "type": "uint32" + } + ], + "name": "MaxSlashingCutSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "fisherman", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "attestation", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "stakeSnapshot", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "cancellableAt", + "type": "uint256" + } + ], + "name": "QueryDisputeCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "subgraphService", + "type": "address" + } + ], + "name": "SubgraphServiceSet", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "tokensSlash", + "type": "uint256" + } + ], + "name": "acceptDispute", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "tokensSlash", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "acceptDisputeInConflict", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "tokensSlashRelated", + "type": "uint256" + } + ], + "name": "acceptDisputeConflict", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "requestCID", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "responseCID", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + } + ], + "internalType": "struct Attestation.State", + "name": "attestation1", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "bytes32", + "name": "requestCID", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "responseCID", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + } + ], + "internalType": "struct Attestation.State", + "name": "attestation2", + "type": "tuple" + } + ], + "name": "areConflictingAttestations", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + } + ], + "name": "cancelDispute", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "internalType": "address", + "name": "fisherman", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokensSlash", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokensRewards", + "type": "uint256" + } + ], + "name": "createAndAcceptLegacyDispute", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "poi", + "type": "bytes32" + } + ], + "name": "createIndexingDispute", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "attestationData", + "type": "bytes" + } + ], + "name": "createQueryDispute", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "attestationData1", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "attestationData2", + "type": "bytes" + } + ], + "name": "createQueryDisputeConflict", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + } + ], + "name": "drawDispute", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "requestCID", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "responseCID", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + } + ], + "internalType": "struct Attestation.Receipt", + "name": "receipt", + "type": "tuple" + } + ], + "name": "encodeReceipt", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "requestCID", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "responseCID", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + } + ], + "internalType": "struct Attestation.State", + "name": "attestation", + "type": "tuple" + } + ], + "name": "getAttestationIndexer", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getDisputePeriod", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getFishermanRewardCut", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + } + ], + "name": "getStakeSnapshot", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "arbitrator", + "type": "address" + }, + { + "internalType": "uint64", + "name": "disputePeriod", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "disputeDeposit", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "fishermanRewardCut_", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "maxSlashingCut_", + "type": "uint32" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + } + ], + "name": "isDisputeCreated", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "disputeId", + "type": "bytes32" + } + ], + "name": "rejectDispute", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "arbitrator", + "type": "address" + } + ], + "name": "setArbitrator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "disputeDeposit", + "type": "uint256" + } + ], + "name": "setDisputeDeposit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "disputePeriod", + "type": "uint64" + } + ], + "name": "setDisputePeriod", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "fishermanRewardCut_", + "type": "uint32" + } + ], + "name": "setFishermanRewardCut", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "maxSlashingCut_", + "type": "uint32" + } + ], + "name": "setMaxSlashingCut", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "subgraphService", + "type": "address" + } + ], + "name": "setSubgraphService", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "evm": { + "bytecode": { + "functionDebugData": {}, + "generatedSources": [], + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "deployedBytecode": { + "functionDebugData": {}, + "generatedSources": [], + "immutableReferences": {}, + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "methodIdentifiers": { + "acceptDispute(bytes32,uint256)": "050b17ad", + "acceptDisputeConflict(bytes32,uint256,bool,uint256)": "b0e2f7e9", + "areConflictingAttestations((bytes32,bytes32,bytes32,bytes32,bytes32,uint8),(bytes32,bytes32,bytes32,bytes32,bytes32,uint8))": "d36fc9d4", + "cancelDispute(bytes32)": "1792f194", + "createAndAcceptLegacyDispute(address,address,uint256,uint256)": "8d4e9008", + "createIndexingDispute(address,bytes32)": "4bc5839a", + "createQueryDispute(bytes)": "c50a77b1", + "createQueryDisputeConflict(bytes,bytes)": "c894222e", + "drawDispute(bytes32)": "9334ea52", + "encodeReceipt((bytes32,bytes32,bytes32))": "6369df6b", + "getAttestationIndexer((bytes32,bytes32,bytes32,bytes32,bytes32,uint8))": "c9747f51", + "getDisputePeriod()": "5aea0ec4", + "getFishermanRewardCut()": "bb2a2b47", + "getStakeSnapshot(address)": "c133b429", + "initialize(address,address,uint64,uint256,uint32,uint32)": "0bc7344b", + "isDisputeCreated(bytes32)": "be41f384", + "rejectDispute(bytes32)": "36167e03", + "setArbitrator(address)": "b0eefabe", + "setDisputeDeposit(uint256)": "16972978", + "setDisputePeriod(uint64)": "d76f62d1", + "setFishermanRewardCut(uint32)": "76c993ae", + "setMaxSlashingCut(uint32)": "9f81a7cf", + "setSubgraphService(address)": "93a90a1e" + } + }, + "metadata": "{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"disputeId\",\"type\":\"bytes32\"}],\"name\":\"DisputeManagerDisputeAlreadyCreated\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"disputeId\",\"type\":\"bytes32\"}],\"name\":\"DisputeManagerDisputeInConflict\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"disputeId\",\"type\":\"bytes32\"}],\"name\":\"DisputeManagerDisputeNotInConflict\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"enum IDisputeManager.DisputeStatus\",\"name\":\"status\",\"type\":\"uint8\"}],\"name\":\"DisputeManagerDisputeNotPending\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DisputeManagerDisputePeriodNotFinished\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DisputeManagerDisputePeriodZero\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"allocationId\",\"type\":\"address\"}],\"name\":\"DisputeManagerIndexerNotFound\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"disputeId\",\"type\":\"bytes32\"}],\"name\":\"DisputeManagerInvalidDispute\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"disputeDeposit\",\"type\":\"uint256\"}],\"name\":\"DisputeManagerInvalidDisputeDeposit\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"cut\",\"type\":\"uint32\"}],\"name\":\"DisputeManagerInvalidFishermanReward\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"maxSlashingCut\",\"type\":\"uint32\"}],\"name\":\"DisputeManagerInvalidMaxSlashingCut\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokensSlash\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxTokensSlash\",\"type\":\"uint256\"}],\"name\":\"DisputeManagerInvalidTokensSlash\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DisputeManagerInvalidZeroAddress\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"disputeId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"relatedDisputeId\",\"type\":\"bytes32\"}],\"name\":\"DisputeManagerMustAcceptRelatedDispute\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"requestCID1\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"responseCID1\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"subgraphDeploymentId1\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"requestCID2\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"responseCID2\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"subgraphDeploymentId2\",\"type\":\"bytes32\"}],\"name\":\"DisputeManagerNonConflictingAttestations\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"subgraphDeploymentId1\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"subgraphDeploymentId2\",\"type\":\"bytes32\"}],\"name\":\"DisputeManagerNonMatchingSubgraphDeployment\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DisputeManagerNotArbitrator\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DisputeManagerNotFisherman\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DisputeManagerSubgraphServiceNotSet\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DisputeManagerZeroTokens\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"arbitrator\",\"type\":\"address\"}],\"name\":\"ArbitratorSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"disputeId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"fisherman\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"DisputeAccepted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"disputeId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"fisherman\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"DisputeCancelled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"disputeDeposit\",\"type\":\"uint256\"}],\"name\":\"DisputeDepositSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"disputeId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"fisherman\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"DisputeDrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"disputeId1\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"disputeId2\",\"type\":\"bytes32\"}],\"name\":\"DisputeLinked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"disputePeriod\",\"type\":\"uint64\"}],\"name\":\"DisputePeriodSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"disputeId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"fisherman\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"DisputeRejected\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"fishermanRewardCut\",\"type\":\"uint32\"}],\"name\":\"FishermanRewardCutSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"disputeId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"fisherman\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"allocationId\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"poi\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"stakeSnapshot\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"cancellableAt\",\"type\":\"uint256\"}],\"name\":\"IndexingDisputeCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"disputeId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"fisherman\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"allocationId\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokensSlash\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokensRewards\",\"type\":\"uint256\"}],\"name\":\"LegacyDisputeCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"maxSlashingCut\",\"type\":\"uint32\"}],\"name\":\"MaxSlashingCutSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"disputeId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"fisherman\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"subgraphDeploymentId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"attestation\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"stakeSnapshot\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"cancellableAt\",\"type\":\"uint256\"}],\"name\":\"QueryDisputeCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"subgraphService\",\"type\":\"address\"}],\"name\":\"SubgraphServiceSet\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"disputeId\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"tokensSlash\",\"type\":\"uint256\"}],\"name\":\"acceptDispute\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"disputeId\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"tokensSlash\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"acceptDisputeInConflict\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"tokensSlashRelated\",\"type\":\"uint256\"}],\"name\":\"acceptDisputeConflict\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"requestCID\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"responseCID\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"subgraphDeploymentId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"}],\"internalType\":\"struct Attestation.State\",\"name\":\"attestation1\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"requestCID\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"responseCID\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"subgraphDeploymentId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"}],\"internalType\":\"struct Attestation.State\",\"name\":\"attestation2\",\"type\":\"tuple\"}],\"name\":\"areConflictingAttestations\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"disputeId\",\"type\":\"bytes32\"}],\"name\":\"cancelDispute\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"allocationId\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"fisherman\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokensSlash\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"tokensRewards\",\"type\":\"uint256\"}],\"name\":\"createAndAcceptLegacyDispute\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"allocationId\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"poi\",\"type\":\"bytes32\"}],\"name\":\"createIndexingDispute\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"attestationData\",\"type\":\"bytes\"}],\"name\":\"createQueryDispute\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"attestationData1\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"attestationData2\",\"type\":\"bytes\"}],\"name\":\"createQueryDisputeConflict\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"disputeId\",\"type\":\"bytes32\"}],\"name\":\"drawDispute\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"requestCID\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"responseCID\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"subgraphDeploymentId\",\"type\":\"bytes32\"}],\"internalType\":\"struct Attestation.Receipt\",\"name\":\"receipt\",\"type\":\"tuple\"}],\"name\":\"encodeReceipt\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"requestCID\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"responseCID\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"subgraphDeploymentId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"}],\"internalType\":\"struct Attestation.State\",\"name\":\"attestation\",\"type\":\"tuple\"}],\"name\":\"getAttestationIndexer\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getDisputePeriod\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getFishermanRewardCut\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"}],\"name\":\"getStakeSnapshot\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"arbitrator\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"disputePeriod\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"disputeDeposit\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"fishermanRewardCut_\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxSlashingCut_\",\"type\":\"uint32\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"disputeId\",\"type\":\"bytes32\"}],\"name\":\"isDisputeCreated\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"disputeId\",\"type\":\"bytes32\"}],\"name\":\"rejectDispute\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"arbitrator\",\"type\":\"address\"}],\"name\":\"setArbitrator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"disputeDeposit\",\"type\":\"uint256\"}],\"name\":\"setDisputeDeposit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"disputePeriod\",\"type\":\"uint64\"}],\"name\":\"setDisputePeriod\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"fishermanRewardCut_\",\"type\":\"uint32\"}],\"name\":\"setFishermanRewardCut\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"maxSlashingCut_\",\"type\":\"uint32\"}],\"name\":\"setMaxSlashingCut\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"subgraphService\",\"type\":\"address\"}],\"name\":\"setSubgraphService\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"custom:security-contact\":\"Please email security+contracts@thegraph.com if you find any bugs. We may have an active bug bounty program.\",\"errors\":{\"DisputeManagerDisputeAlreadyCreated(bytes32)\":[{\"params\":{\"disputeId\":\"The dispute id\"}}],\"DisputeManagerDisputeInConflict(bytes32)\":[{\"params\":{\"disputeId\":\"The dispute id\"}}],\"DisputeManagerDisputeNotInConflict(bytes32)\":[{\"params\":{\"disputeId\":\"The dispute id\"}}],\"DisputeManagerDisputeNotPending(uint8)\":[{\"params\":{\"status\":\"The status of the dispute\"}}],\"DisputeManagerIndexerNotFound(address)\":[{\"params\":{\"allocationId\":\"The allocation id\"}}],\"DisputeManagerInvalidDispute(bytes32)\":[{\"params\":{\"disputeId\":\"The dispute id\"}}],\"DisputeManagerInvalidDisputeDeposit(uint256)\":[{\"params\":{\"disputeDeposit\":\"The dispute deposit\"}}],\"DisputeManagerInvalidFishermanReward(uint32)\":[{\"params\":{\"cut\":\"The fisherman reward cut\"}}],\"DisputeManagerInvalidMaxSlashingCut(uint32)\":[{\"params\":{\"maxSlashingCut\":\"The max slashing cut\"}}],\"DisputeManagerInvalidTokensSlash(uint256,uint256)\":[{\"params\":{\"maxTokensSlash\":\"The max tokens slash\",\"tokensSlash\":\"The tokens slash\"}}],\"DisputeManagerMustAcceptRelatedDispute(bytes32,bytes32)\":[{\"params\":{\"disputeId\":\"The dispute id\",\"relatedDisputeId\":\"The related dispute id\"}}],\"DisputeManagerNonConflictingAttestations(bytes32,bytes32,bytes32,bytes32,bytes32,bytes32)\":[{\"params\":{\"requestCID1\":\"The request CID of the first attestation\",\"requestCID2\":\"The request CID of the second attestation\",\"responseCID1\":\"The response CID of the first attestation\",\"responseCID2\":\"The response CID of the second attestation\",\"subgraphDeploymentId1\":\"The subgraph deployment id of the first attestation\",\"subgraphDeploymentId2\":\"The subgraph deployment id of the second attestation\"}}],\"DisputeManagerNonMatchingSubgraphDeployment(bytes32,bytes32)\":[{\"params\":{\"subgraphDeploymentId1\":\"The subgraph deployment id of the first attestation\",\"subgraphDeploymentId2\":\"The subgraph deployment id of the second attestation\"}}]},\"events\":{\"ArbitratorSet(address)\":{\"params\":{\"arbitrator\":\"The address of the arbitrator.\"}},\"DisputeAccepted(bytes32,address,address,uint256)\":{\"details\":\"Emitted when arbitrator accepts a `disputeId` to `indexer` created by `fisherman`. The event emits the amount `tokens` transferred to the fisherman, the deposit plus reward.\",\"params\":{\"disputeId\":\"The dispute id\",\"fisherman\":\"The fisherman address\",\"indexer\":\"The indexer address\",\"tokens\":\"The amount of tokens transferred to the fisherman, the deposit plus reward\"}},\"DisputeCancelled(bytes32,address,address,uint256)\":{\"details\":\"Emitted when a dispute is cancelled by the fisherman. The event emits the amount `tokens` returned to the fisherman.\",\"params\":{\"disputeId\":\"The dispute id\",\"fisherman\":\"The fisherman address\",\"indexer\":\"The indexer address\",\"tokens\":\"The amount of tokens returned to the fisherman - the deposit\"}},\"DisputeDepositSet(uint256)\":{\"params\":{\"disputeDeposit\":\"The dispute deposit required to create a dispute.\"}},\"DisputeDrawn(bytes32,address,address,uint256)\":{\"details\":\"Emitted when arbitrator draw a `disputeId` for `indexer` created by `fisherman`. The event emits the amount `tokens` used as deposit and returned to the fisherman.\",\"params\":{\"disputeId\":\"The dispute id\",\"fisherman\":\"The fisherman address\",\"indexer\":\"The indexer address\",\"tokens\":\"The amount of tokens returned to the fisherman - the deposit\"}},\"DisputeLinked(bytes32,bytes32)\":{\"details\":\"Emitted when two disputes are in conflict to link them. This event will be emitted after each DisputeCreated event is emitted for each of the individual disputes.\",\"params\":{\"disputeId1\":\"The first dispute id\",\"disputeId2\":\"The second dispute id\"}},\"DisputePeriodSet(uint64)\":{\"params\":{\"disputePeriod\":\"The dispute period in seconds.\"}},\"DisputeRejected(bytes32,address,address,uint256)\":{\"details\":\"Emitted when arbitrator rejects a `disputeId` for `indexer` created by `fisherman`. The event emits the amount `tokens` burned from the fisherman deposit.\",\"params\":{\"disputeId\":\"The dispute id\",\"fisherman\":\"The fisherman address\",\"indexer\":\"The indexer address\",\"tokens\":\"The amount of tokens burned from the fisherman deposit\"}},\"FishermanRewardCutSet(uint32)\":{\"params\":{\"fishermanRewardCut\":\"The fisherman reward cut.\"}},\"IndexingDisputeCreated(bytes32,address,address,uint256,address,bytes32,uint256,uint256)\":{\"details\":\"Emitted when an indexing dispute is created for `allocationId` and `indexer` by `fisherman`. The event emits the amount of `tokens` deposited by the fisherman.\",\"params\":{\"allocationId\":\"The allocation id\",\"cancellableAt\":\"The timestamp when the dispute can be cancelled\",\"disputeId\":\"The dispute id\",\"fisherman\":\"The fisherman address\",\"indexer\":\"The indexer address\",\"poi\":\"The POI\",\"stakeSnapshot\":\"The stake snapshot of the indexer at the time of the dispute\",\"tokens\":\"The amount of tokens deposited by the fisherman\"}},\"LegacyDisputeCreated(bytes32,address,address,address,uint256,uint256)\":{\"details\":\"Emitted when a legacy dispute is created for `allocationId` and `fisherman`. The event emits the amount of `tokensSlash` to slash and `tokensRewards` to reward the fisherman.\",\"params\":{\"allocationId\":\"The allocation id\",\"disputeId\":\"The dispute id\",\"fisherman\":\"The fisherman address to be credited with the rewards\",\"indexer\":\"The indexer address\",\"tokensRewards\":\"The amount of tokens to reward the fisherman\",\"tokensSlash\":\"The amount of tokens to slash\"}},\"MaxSlashingCutSet(uint32)\":{\"params\":{\"maxSlashingCut\":\"The maximum slashing cut that can be set.\"}},\"QueryDisputeCreated(bytes32,address,address,uint256,bytes32,bytes,uint256,uint256)\":{\"details\":\"Emitted when a query dispute is created for `subgraphDeploymentId` and `indexer` by `fisherman`. The event emits the amount of `tokens` deposited by the fisherman and `attestation` submitted.\",\"params\":{\"attestation\":\"The attestation\",\"cancellableAt\":\"The timestamp when the dispute can be cancelled\",\"disputeId\":\"The dispute id\",\"fisherman\":\"The fisherman address\",\"indexer\":\"The indexer address\",\"stakeSnapshot\":\"The stake snapshot of the indexer at the time of the dispute\",\"subgraphDeploymentId\":\"The subgraph deployment id\",\"tokens\":\"The amount of tokens deposited by the fisherman\"}},\"SubgraphServiceSet(address)\":{\"params\":{\"subgraphService\":\"The address of the subgraph service.\"}}},\"kind\":\"dev\",\"methods\":{\"acceptDispute(bytes32,uint256)\":{\"details\":\"Accept a dispute with Id `disputeId`\",\"params\":{\"disputeId\":\"Id of the dispute to be accepted\",\"tokensSlash\":\"Amount of tokens to slash from the indexer\"}},\"acceptDisputeConflict(bytes32,uint256,bool,uint256)\":{\"params\":{\"acceptDisputeInConflict\":\"Accept the conflicting dispute. Otherwise it will be drawn automatically\",\"disputeId\":\"Id of the dispute to be accepted\",\"tokensSlash\":\"Amount of tokens to slash from the indexer for the first dispute\",\"tokensSlashRelated\":\"Amount of tokens to slash from the indexer for the related dispute in case acceptDisputeInConflict is true, otherwise it will be ignored\"}},\"areConflictingAttestations((bytes32,bytes32,bytes32,bytes32,bytes32,uint8),(bytes32,bytes32,bytes32,bytes32,bytes32,uint8))\":{\"params\":{\"attestation1\":\"The first attestation\",\"attestation2\":\"The second attestation\"},\"returns\":{\"_0\":\"Whether the attestations are conflicting\"}},\"cancelDispute(bytes32)\":{\"details\":\"Cancel a dispute with Id `disputeId`\",\"params\":{\"disputeId\":\"Id of the dispute to be cancelled\"}},\"createAndAcceptLegacyDispute(address,address,uint256,uint256)\":{\"params\":{\"allocationId\":\"The allocation to dispute\",\"fisherman\":\"The fisherman address to be credited with the rewards\",\"tokensRewards\":\"The amount of tokens to reward the fisherman\",\"tokensSlash\":\"The amount of tokens to slash\"},\"returns\":{\"_0\":\"The dispute id\"}},\"createIndexingDispute(address,bytes32)\":{\"params\":{\"allocationId\":\"The allocation to dispute\",\"poi\":\"The Proof of Indexing (POI) being disputed\"},\"returns\":{\"_0\":\"The dispute id\"}},\"createQueryDispute(bytes)\":{\"params\":{\"attestationData\":\"Attestation bytes submitted by the fisherman\"},\"returns\":{\"_0\":\"The dispute id\"}},\"createQueryDisputeConflict(bytes,bytes)\":{\"params\":{\"attestationData1\":\"First attestation data submitted\",\"attestationData2\":\"Second attestation data submitted\"},\"returns\":{\"_0\":\"The first dispute id\",\"_1\":\"The second dispute id\"}},\"drawDispute(bytes32)\":{\"details\":\"Ignore a dispute with Id `disputeId`\",\"params\":{\"disputeId\":\"Id of the dispute to be disregarded\"}},\"encodeReceipt((bytes32,bytes32,bytes32))\":{\"details\":\"Return the message hash used to sign the receipt\",\"params\":{\"receipt\":\"Receipt returned by indexer and submitted by fisherman\"},\"returns\":{\"_0\":\"Message hash used to sign the receipt\"}},\"getAttestationIndexer((bytes32,bytes32,bytes32,bytes32,bytes32,uint8))\":{\"params\":{\"attestation\":\"Attestation\"},\"returns\":{\"_0\":\"indexer address\"}},\"getDisputePeriod()\":{\"returns\":{\"_0\":\"Dispute period in seconds\"}},\"getFishermanRewardCut()\":{\"returns\":{\"_0\":\"Fisherman reward cut in percentage (ppm)\"}},\"getStakeSnapshot(address)\":{\"params\":{\"indexer\":\"The indexer address\"},\"returns\":{\"_0\":\"The stake snapshot\"}},\"initialize(address,address,uint64,uint256,uint32,uint32)\":{\"params\":{\"arbitrator\":\"Arbitrator role\",\"disputeDeposit\":\"Deposit required to create a Dispute\",\"disputePeriod\":\"Dispute period in seconds\",\"fishermanRewardCut_\":\"Percent of slashed funds for fisherman (ppm)\",\"maxSlashingCut_\":\"Maximum percentage of indexer stake that can be slashed (ppm)\",\"owner\":\"The owner of the contract\"}},\"isDisputeCreated(bytes32)\":{\"details\":\"Return if dispute with Id `disputeId` exists\",\"params\":{\"disputeId\":\"True if dispute already exists\"},\"returns\":{\"_0\":\"True if dispute already exists\"}},\"rejectDispute(bytes32)\":{\"details\":\"Reject a dispute with Id `disputeId`\",\"params\":{\"disputeId\":\"Id of the dispute to be rejected\"}},\"setArbitrator(address)\":{\"details\":\"Update the arbitrator to `_arbitrator`\",\"params\":{\"arbitrator\":\"The address of the arbitration contract or party\"}},\"setDisputeDeposit(uint256)\":{\"details\":\"Update the dispute deposit to `_disputeDeposit` Graph Tokens\",\"params\":{\"disputeDeposit\":\"The dispute deposit in Graph Tokens\"}},\"setDisputePeriod(uint64)\":{\"details\":\"Update the dispute period to `_disputePeriod` in seconds\",\"params\":{\"disputePeriod\":\"Dispute period in seconds\"}},\"setFishermanRewardCut(uint32)\":{\"details\":\"Update the reward percentage to `_percentage`\",\"params\":{\"fishermanRewardCut_\":\"Reward as a percentage of indexer stake\"}},\"setMaxSlashingCut(uint32)\":{\"params\":{\"maxSlashingCut_\":\"Max percentage slashing for disputes\"}},\"setSubgraphService(address)\":{\"details\":\"Update the subgraph service to `_subgraphService`\",\"params\":{\"subgraphService\":\"The address of the subgraph service contract\"}}},\"title\":\"IDisputeManager\",\"version\":1},\"userdoc\":{\"errors\":{\"DisputeManagerDisputeAlreadyCreated(bytes32)\":[{\"notice\":\"Thrown when the dispute is already created\"}],\"DisputeManagerDisputeInConflict(bytes32)\":[{\"notice\":\"Thrown when the dispute is in conflict\"}],\"DisputeManagerDisputeNotInConflict(bytes32)\":[{\"notice\":\"Thrown when the dispute is not in conflict\"}],\"DisputeManagerDisputeNotPending(uint8)\":[{\"notice\":\"Thrown when the dispute is not pending\"}],\"DisputeManagerDisputePeriodNotFinished()\":[{\"notice\":\"Thrown when the dispute period is not finished\"}],\"DisputeManagerDisputePeriodZero()\":[{\"notice\":\"Thrown when the dispute period is zero\"}],\"DisputeManagerIndexerNotFound(address)\":[{\"notice\":\"Thrown when the indexer is not found\"}],\"DisputeManagerInvalidDispute(bytes32)\":[{\"notice\":\"Thrown when the dispute id is invalid\"}],\"DisputeManagerInvalidDisputeDeposit(uint256)\":[{\"notice\":\"Thrown when the dispute deposit is invalid - less than the minimum dispute deposit\"}],\"DisputeManagerInvalidFishermanReward(uint32)\":[{\"notice\":\"Thrown when the fisherman reward cut is invalid\"}],\"DisputeManagerInvalidMaxSlashingCut(uint32)\":[{\"notice\":\"Thrown when the max slashing cut is invalid\"}],\"DisputeManagerInvalidTokensSlash(uint256,uint256)\":[{\"notice\":\"Thrown when the tokens slash is invalid\"}],\"DisputeManagerInvalidZeroAddress()\":[{\"notice\":\"Thrown when the address is the zero address\"}],\"DisputeManagerMustAcceptRelatedDispute(bytes32,bytes32)\":[{\"notice\":\"Thrown when the dispute must be accepted\"}],\"DisputeManagerNonConflictingAttestations(bytes32,bytes32,bytes32,bytes32,bytes32,bytes32)\":[{\"notice\":\"Thrown when the attestations are not conflicting\"}],\"DisputeManagerNonMatchingSubgraphDeployment(bytes32,bytes32)\":[{\"notice\":\"Thrown when the subgraph deployment is not matching\"}],\"DisputeManagerNotArbitrator()\":[{\"notice\":\"Thrown when the caller is not the arbitrator\"}],\"DisputeManagerNotFisherman()\":[{\"notice\":\"Thrown when the caller is not the fisherman\"}],\"DisputeManagerSubgraphServiceNotSet()\":[{\"notice\":\"Thrown when attempting to get the subgraph service before it is set\"}],\"DisputeManagerZeroTokens()\":[{\"notice\":\"Thrown when the indexer being disputed has no provisioned tokens\"}]},\"events\":{\"ArbitratorSet(address)\":{\"notice\":\"Emitted when arbitrator is set.\"},\"DisputeDepositSet(uint256)\":{\"notice\":\"Emitted when dispute deposit is set.\"},\"DisputePeriodSet(uint64)\":{\"notice\":\"Emitted when dispute period is set.\"},\"FishermanRewardCutSet(uint32)\":{\"notice\":\"Emitted when fisherman reward cut is set.\"},\"MaxSlashingCutSet(uint32)\":{\"notice\":\"Emitted when max slashing cut is set.\"},\"SubgraphServiceSet(address)\":{\"notice\":\"Emitted when subgraph service is set.\"}},\"kind\":\"user\",\"methods\":{\"acceptDispute(bytes32,uint256)\":{\"notice\":\"The arbitrator accepts a dispute as being valid. This function will revert if the indexer is not slashable, whether because it does not have any stake available or the slashing percentage is configured to be zero. In those cases a dispute must be resolved using drawDispute or rejectDispute. This function will also revert if the dispute is in conflict, to accept a conflicting dispute use acceptDisputeConflict.\"},\"acceptDisputeConflict(bytes32,uint256,bool,uint256)\":{\"notice\":\"The arbitrator accepts a conflicting dispute as being valid. This function will revert if the indexer is not slashable, whether because it does not have any stake available or the slashing percentage is configured to be zero. In those cases a dispute must be resolved using drawDispute.\"},\"areConflictingAttestations((bytes32,bytes32,bytes32,bytes32,bytes32,uint8),(bytes32,bytes32,bytes32,bytes32,bytes32,uint8))\":{\"notice\":\"Checks if two attestations are conflicting\"},\"cancelDispute(bytes32)\":{\"notice\":\"Once the dispute period ends, if the dispute status remains Pending, the fisherman can cancel the dispute and get back their initial deposit. Note that cancelling a conflicting query dispute will also cancel the related dispute.\"},\"createAndAcceptLegacyDispute(address,address,uint256,uint256)\":{\"notice\":\"Creates and auto-accepts a legacy dispute. This disputes can be created to settle outstanding slashing amounts with an indexer that has been \\\"legacy slashed\\\" during or shortly after the transition period. See {HorizonStakingExtension.legacySlash} for more details. Note that this type of dispute: - can only be created by the arbitrator - does not require a bond - is automatically accepted when created Additionally, note that this type of disputes allow the arbitrator to directly set the slash and rewards amounts, bypassing the usual mechanisms that impose restrictions on those. This is done to give arbitrators maximum flexibility to ensure outstanding slashing amounts are settled fairly. This function needs to be removed after the transition period. Requirements: - Indexer must have been legacy slashed during or shortly after the transition period - Indexer must have provisioned funds to the Subgraph Service\"},\"createIndexingDispute(address,bytes32)\":{\"notice\":\"Create an indexing dispute for the arbitrator to resolve. The disputes are created in reference to an allocationId and specifically a POI for that allocation. This function is called by a fisherman and it will pull `disputeDeposit` GRT tokens. Requirements: - fisherman must have previously approved this contract to pull `disputeDeposit` amount of tokens from their balance.\"},\"createQueryDispute(bytes)\":{\"notice\":\"Create a query dispute for the arbitrator to resolve. This function is called by a fisherman and it will pull `disputeDeposit` GRT tokens. * Requirements: - fisherman must have previously approved this contract to pull `disputeDeposit` amount of tokens from their balance.\"},\"createQueryDisputeConflict(bytes,bytes)\":{\"notice\":\"Create query disputes for two conflicting attestations. A conflicting attestation is a proof presented by two different indexers where for the same request on a subgraph the response is different. Two linked disputes will be created and if the arbitrator resolve one, the other one will be automatically resolved. Note that: - it's not possible to reject a conflicting query dispute as by definition at least one of the attestations is incorrect. - if both attestations are proven to be incorrect, the arbitrator can slash the indexer twice. Requirements: - fisherman must have previously approved this contract to pull `disputeDeposit` amount of tokens from their balance.\"},\"drawDispute(bytes32)\":{\"notice\":\"The arbitrator draws dispute. Note that drawing a conflicting query dispute should not be possible however it is allowed to give arbitrators greater flexibility when resolving disputes.\"},\"encodeReceipt((bytes32,bytes32,bytes32))\":{\"notice\":\"Get the message hash that a indexer used to sign the receipt. Encodes a receipt using a domain separator, as described on https://github.com/ethereum/EIPs/blob/master/EIPS/eip-712.md#specification.\"},\"getAttestationIndexer((bytes32,bytes32,bytes32,bytes32,bytes32,uint8))\":{\"notice\":\"Returns the indexer that signed an attestation.\"},\"getDisputePeriod()\":{\"notice\":\"Get the dispute period.\"},\"getFishermanRewardCut()\":{\"notice\":\"Get the fisherman reward cut.\"},\"getStakeSnapshot(address)\":{\"notice\":\"Get the stake snapshot for an indexer.\"},\"initialize(address,address,uint64,uint256,uint32,uint32)\":{\"notice\":\"Initialize this contract.\"},\"isDisputeCreated(bytes32)\":{\"notice\":\"Return whether a dispute exists or not.\"},\"rejectDispute(bytes32)\":{\"notice\":\"The arbitrator rejects a dispute as being invalid. Note that conflicting query disputes cannot be rejected.\"},\"setArbitrator(address)\":{\"notice\":\"Set the arbitrator address.\"},\"setDisputeDeposit(uint256)\":{\"notice\":\"Set the dispute deposit required to create a dispute.\"},\"setDisputePeriod(uint64)\":{\"notice\":\"Set the dispute period.\"},\"setFishermanRewardCut(uint32)\":{\"notice\":\"Set the percent reward that the fisherman gets when slashing occurs.\"},\"setMaxSlashingCut(uint32)\":{\"notice\":\"Set the maximum percentage that can be used for slashing indexers.\"},\"setSubgraphService(address)\":{\"notice\":\"Set the subgraph service address.\"}},\"notice\":\"Interface for the {Dispute Manager} contract.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/interfaces/IDisputeManager.sol\":\"IDisputeManager\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10},\"remappings\":[]},\"sources\":{\"contracts/interfaces/IDisputeManager.sol\":{\"keccak256\":\"0x9db8ffdf7fe30954824ed706a1a5e7c2d6323b745bddba16b7166a639344f9f7\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://e5d810bf6188c38a028dab511c5653fde7b7feca0a173f03974402a83cb234f9\",\"dweb:/ipfs/QmYGtytqHeDFK91FmSNL5iavD8sHUFcA47WBU9BuHG3i75\"]},\"contracts/libraries/Attestation.sol\":{\"keccak256\":\"0x0976f586d532d479823ac9e049371742a7a876f0faf3ed722b3b7f78a4586f33\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://34baba14bd7d3dcb1e1111ee09f3c809d6876732bbc889c1486cc329465e711e\",\"dweb:/ipfs/QmPRgYduW85aCjVk4ih35jB2FhoLjBvgmjZtMGeqXaLhTW\"]}},\"version\":1}" + } + }, + "contracts/interfaces/ISubgraphService.sol": { + "ISubgraphService": { + "abi": [ + { + "inputs": [ + { + "internalType": "bytes32", + "name": "claimId", + "type": "bytes32" + } + ], + "name": "DataServiceFeesClaimNotFound", + "type": "error" + }, + { + "inputs": [], + "name": "DataServiceFeesZeroTokens", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "SubgraphServiceAllocationIsAltruistic", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "SubgraphServiceAllocationNotAuthorized", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "SubgraphServiceCannotForceCloseAllocation", + "type": "error" + }, + { + "inputs": [], + "name": "SubgraphServiceEmptyGeohash", + "type": "error" + }, + { + "inputs": [], + "name": "SubgraphServiceEmptyUrl", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "balanceBefore", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "balanceAfter", + "type": "uint256" + } + ], + "name": "SubgraphServiceInconsistentCollection", + "type": "error" + }, + { + "inputs": [], + "name": "SubgraphServiceIndexerAlreadyRegistered", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "providedIndexer", + "type": "address" + }, + { + "internalType": "address", + "name": "expectedIndexer", + "type": "address" + } + ], + "name": "SubgraphServiceIndexerMismatch", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + } + ], + "name": "SubgraphServiceIndexerNotRegistered", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "collectionId", + "type": "bytes32" + } + ], + "name": "SubgraphServiceInvalidCollectionId", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "curationCut", + "type": "uint256" + } + ], + "name": "SubgraphServiceInvalidCurationCut", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "paymentType", + "type": "uint8" + } + ], + "name": "SubgraphServiceInvalidPaymentType", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "ravIndexer", + "type": "address" + }, + { + "internalType": "address", + "name": "allocationIndexer", + "type": "address" + } + ], + "name": "SubgraphServiceInvalidRAV", + "type": "error" + }, + { + "inputs": [], + "name": "SubgraphServiceInvalidZeroStakeToFeesRatio", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "curationCut", + "type": "uint256" + } + ], + "name": "CurationCutSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "paymentsDestination", + "type": "address" + } + ], + "name": "PaymentsDestinationSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + } + ], + "name": "ProvisionPendingParametersAccepted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensCollected", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensCurators", + "type": "uint256" + } + ], + "name": "QueryFeesCollected", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "feeType", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "ServicePaymentCollected", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "ServiceProviderRegistered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "ServiceProviderSlashed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "ServiceStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "ServiceStopped", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "claimId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "unlockTimestamp", + "type": "uint256" + } + ], + "name": "StakeClaimLocked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "claimId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "releasableAt", + "type": "uint256" + } + ], + "name": "StakeClaimReleased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "claimsCount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensReleased", + "type": "uint256" + } + ], + "name": "StakeClaimsReleased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "ratio", + "type": "uint256" + } + ], + "name": "StakeToFeesRatioSet", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "acceptProvisionPendingParameters", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "closeStaleAllocation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "feeType", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "collect", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "encodeAllocationProof", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "getAllocation", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "createdAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "closedAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lastPOIPresentedAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "accRewardsPerAllocatedToken", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "accRewardsPending", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "createdAtEpoch", + "type": "uint256" + } + ], + "internalType": "struct Allocation.State", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getCuration", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getDelegationRatio", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getDisputeManager", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getGraphTallyCollector", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "getLegacyAllocation", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + } + ], + "internalType": "struct LegacyAllocation.State", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getProvisionTokensRange", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getThawingPeriodRange", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getVerifierCutRange", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "uint256", + "name": "minimumProvisionTokens", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "maximumDelegationRatio", + "type": "uint32" + }, + { + "internalType": "uint256", + "name": "stakeToFeesRatio", + "type": "uint256" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "isOverAllocated", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + } + ], + "name": "migrateLegacyAllocation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "register", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "numClaimsToRelease", + "type": "uint256" + } + ], + "name": "releaseStake", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "resizeAllocation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "curationCut", + "type": "uint256" + } + ], + "name": "setCurationCut", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "delegationRatio", + "type": "uint32" + } + ], + "name": "setDelegationRatio", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "maxPOIStaleness", + "type": "uint256" + } + ], + "name": "setMaxPOIStaleness", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "minimumProvisionTokens", + "type": "uint256" + } + ], + "name": "setMinimumProvisionTokens", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "pauseGuardian", + "type": "address" + }, + { + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "setPauseGuardian", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "paymentsDestination", + "type": "address" + } + ], + "name": "setPaymentsDestination", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "stakeToFeesRatio", + "type": "uint256" + } + ], + "name": "setStakeToFeesRatio", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "slash", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "startService", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "stopService", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "evm": { + "bytecode": { + "functionDebugData": {}, + "generatedSources": [], + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "deployedBytecode": { + "functionDebugData": {}, + "generatedSources": [], + "immutableReferences": {}, + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "methodIdentifiers": { + "acceptProvisionPendingParameters(address,bytes)": "ce0fc0cc", + "closeStaleAllocation(address)": "ec9c218d", + "collect(address,uint8,bytes)": "b15d2a2c", + "encodeAllocationProof(address,address)": "ce56c98b", + "getAllocation(address)": "0e022923", + "getCuration()": "c0f47497", + "getDelegationRatio()": "1ebb7c30", + "getDisputeManager()": "db9bee46", + "getGraphTallyCollector()": "ebf6ddaf", + "getLegacyAllocation(address)": "6d9a3951", + "getProvisionTokensRange()": "819ba366", + "getThawingPeriodRange()": "71ce020a", + "getVerifierCutRange()": "482468b7", + "initialize(address,uint256,uint32,uint256)": "c84a5ef3", + "isOverAllocated(address)": "ba38f67d", + "migrateLegacyAllocation(address,address,bytes32)": "7dfe6d28", + "register(address,bytes)": "24b8fbf6", + "releaseStake(uint256)": "45f54485", + "resizeAllocation(address,address,uint256)": "81e777a7", + "setCurationCut(uint256)": "7e89bac3", + "setDelegationRatio(uint32)": "1dd42f60", + "setMaxPOIStaleness(uint256)": "7aa31bce", + "setMinimumProvisionTokens(uint256)": "832bc923", + "setPauseGuardian(address,bool)": "35577962", + "setPaymentsDestination(address)": "6ccec5b8", + "setStakeToFeesRatio(uint256)": "e6f50054", + "slash(address,bytes)": "cb8347fe", + "startService(address,bytes)": "dedf6726", + "stopService(address,bytes)": "8180083b" + } + }, + "metadata": "{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"claimId\",\"type\":\"bytes32\"}],\"name\":\"DataServiceFeesClaimNotFound\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DataServiceFeesZeroTokens\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"allocationId\",\"type\":\"address\"}],\"name\":\"SubgraphServiceAllocationIsAltruistic\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"allocationId\",\"type\":\"address\"}],\"name\":\"SubgraphServiceAllocationNotAuthorized\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"allocationId\",\"type\":\"address\"}],\"name\":\"SubgraphServiceCannotForceCloseAllocation\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SubgraphServiceEmptyGeohash\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SubgraphServiceEmptyUrl\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"balanceBefore\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"balanceAfter\",\"type\":\"uint256\"}],\"name\":\"SubgraphServiceInconsistentCollection\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SubgraphServiceIndexerAlreadyRegistered\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"providedIndexer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"expectedIndexer\",\"type\":\"address\"}],\"name\":\"SubgraphServiceIndexerMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"}],\"name\":\"SubgraphServiceIndexerNotRegistered\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"collectionId\",\"type\":\"bytes32\"}],\"name\":\"SubgraphServiceInvalidCollectionId\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"curationCut\",\"type\":\"uint256\"}],\"name\":\"SubgraphServiceInvalidCurationCut\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"enum IGraphPayments.PaymentTypes\",\"name\":\"paymentType\",\"type\":\"uint8\"}],\"name\":\"SubgraphServiceInvalidPaymentType\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"ravIndexer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"allocationIndexer\",\"type\":\"address\"}],\"name\":\"SubgraphServiceInvalidRAV\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SubgraphServiceInvalidZeroStakeToFeesRatio\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"curationCut\",\"type\":\"uint256\"}],\"name\":\"CurationCutSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"paymentsDestination\",\"type\":\"address\"}],\"name\":\"PaymentsDestinationSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"}],\"name\":\"ProvisionPendingParametersAccepted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"payer\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"allocationId\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"subgraphDeploymentId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokensCollected\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokensCurators\",\"type\":\"uint256\"}],\"name\":\"QueryFeesCollected\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"enum IGraphPayments.PaymentTypes\",\"name\":\"feeType\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"ServicePaymentCollected\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"ServiceProviderRegistered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"ServiceProviderSlashed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"ServiceStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"ServiceStopped\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"claimId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"unlockTimestamp\",\"type\":\"uint256\"}],\"name\":\"StakeClaimLocked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"claimId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"releasableAt\",\"type\":\"uint256\"}],\"name\":\"StakeClaimReleased\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"claimsCount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokensReleased\",\"type\":\"uint256\"}],\"name\":\"StakeClaimsReleased\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"ratio\",\"type\":\"uint256\"}],\"name\":\"StakeToFeesRatioSet\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"acceptProvisionPendingParameters\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"allocationId\",\"type\":\"address\"}],\"name\":\"closeStaleAllocation\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"enum IGraphPayments.PaymentTypes\",\"name\":\"feeType\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"collect\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"allocationId\",\"type\":\"address\"}],\"name\":\"encodeAllocationProof\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"allocationId\",\"type\":\"address\"}],\"name\":\"getAllocation\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"subgraphDeploymentId\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"createdAt\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"closedAt\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"lastPOIPresentedAt\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"accRewardsPerAllocatedToken\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"accRewardsPending\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"createdAtEpoch\",\"type\":\"uint256\"}],\"internalType\":\"struct Allocation.State\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCuration\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getDelegationRatio\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getDisputeManager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getGraphTallyCollector\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"allocationId\",\"type\":\"address\"}],\"name\":\"getLegacyAllocation\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"subgraphDeploymentId\",\"type\":\"bytes32\"}],\"internalType\":\"struct LegacyAllocation.State\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getProvisionTokensRange\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getThawingPeriodRange\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getVerifierCutRange\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"minimumProvisionTokens\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"maximumDelegationRatio\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"stakeToFeesRatio\",\"type\":\"uint256\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"allocationId\",\"type\":\"address\"}],\"name\":\"isOverAllocated\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"allocationId\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"subgraphDeploymentId\",\"type\":\"bytes32\"}],\"name\":\"migrateLegacyAllocation\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"register\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"numClaimsToRelease\",\"type\":\"uint256\"}],\"name\":\"releaseStake\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"allocationId\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"resizeAllocation\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"curationCut\",\"type\":\"uint256\"}],\"name\":\"setCurationCut\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"delegationRatio\",\"type\":\"uint32\"}],\"name\":\"setDelegationRatio\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"maxPOIStaleness\",\"type\":\"uint256\"}],\"name\":\"setMaxPOIStaleness\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"minimumProvisionTokens\",\"type\":\"uint256\"}],\"name\":\"setMinimumProvisionTokens\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"pauseGuardian\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"}],\"name\":\"setPauseGuardian\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"paymentsDestination\",\"type\":\"address\"}],\"name\":\"setPaymentsDestination\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"stakeToFeesRatio\",\"type\":\"uint256\"}],\"name\":\"setStakeToFeesRatio\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"slash\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"startService\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"serviceProvider\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"stopService\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"custom:security-contact\":\"Please email security+contracts@thegraph.com if you find any bugs. We may have an active bug bounty program.\",\"details\":\"This interface extends {IDataServiceFees} and {IDataService}.\",\"errors\":{\"DataServiceFeesClaimNotFound(bytes32)\":[{\"params\":{\"claimId\":\"The id of the stake claim\"}}],\"SubgraphServiceAllocationIsAltruistic(address)\":[{\"params\":{\"allocationId\":\"The id of the allocation\"}}],\"SubgraphServiceAllocationNotAuthorized(address,address)\":[{\"params\":{\"allocationId\":\"The id of the allocation.\",\"indexer\":\"The address of the expected indexer.\"}}],\"SubgraphServiceCannotForceCloseAllocation(address)\":[{\"params\":{\"allocationId\":\"The id of the allocation\"}}],\"SubgraphServiceInconsistentCollection(uint256,uint256)\":[{\"params\":{\"balanceAfter\":\"The contract GRT balance after the collection\",\"balanceBefore\":\"The contract GRT balance before the collection\"}}],\"SubgraphServiceIndexerMismatch(address,address)\":[{\"params\":{\"expectedIndexer\":\"The address of the expected indexer.\",\"providedIndexer\":\"The address of the provided indexer.\"}}],\"SubgraphServiceIndexerNotRegistered(address)\":[{\"params\":{\"indexer\":\"The address of the indexer that is not registered\"}}],\"SubgraphServiceInvalidCollectionId(bytes32)\":[{\"params\":{\"collectionId\":\"The collectionId\"}}],\"SubgraphServiceInvalidCurationCut(uint256)\":[{\"params\":{\"curationCut\":\"The curation cut value\"}}],\"SubgraphServiceInvalidPaymentType(uint8)\":[{\"params\":{\"paymentType\":\"The payment type that is not supported\"}}],\"SubgraphServiceInvalidRAV(address,address)\":[{\"params\":{\"allocationIndexer\":\"The address of the allocation indexer\",\"ravIndexer\":\"The address of the RAV indexer\"}}]},\"events\":{\"CurationCutSet(uint256)\":{\"params\":{\"curationCut\":\"The curation cut\"}},\"PaymentsDestinationSet(address,address)\":{\"params\":{\"indexer\":\"The address of the indexer\",\"paymentsDestination\":\"The address where payments should be sent\"}},\"ProvisionPendingParametersAccepted(address)\":{\"params\":{\"serviceProvider\":\"The address of the service provider.\"}},\"QueryFeesCollected(address,address,address,bytes32,uint256,uint256)\":{\"params\":{\"allocationId\":\"The id of the allocation\",\"payer\":\"The address paying for the query fees\",\"serviceProvider\":\"The address of the service provider\",\"subgraphDeploymentId\":\"The id of the subgraph deployment\",\"tokensCollected\":\"The amount of tokens collected\",\"tokensCurators\":\"The amount of tokens curators receive\"}},\"ServicePaymentCollected(address,uint8,uint256)\":{\"params\":{\"feeType\":\"The type of fee to collect as defined in {GraphPayments}.\",\"serviceProvider\":\"The address of the service provider.\",\"tokens\":\"The amount of tokens collected.\"}},\"ServiceProviderRegistered(address,bytes)\":{\"params\":{\"data\":\"Custom data, usage defined by the data service.\",\"serviceProvider\":\"The address of the service provider.\"}},\"ServiceProviderSlashed(address,uint256)\":{\"params\":{\"serviceProvider\":\"The address of the service provider.\",\"tokens\":\"The amount of tokens slashed.\"}},\"ServiceStarted(address,bytes)\":{\"params\":{\"data\":\"Custom data, usage defined by the data service.\",\"serviceProvider\":\"The address of the service provider.\"}},\"ServiceStopped(address,bytes)\":{\"params\":{\"data\":\"Custom data, usage defined by the data service.\",\"serviceProvider\":\"The address of the service provider.\"}},\"StakeClaimLocked(address,bytes32,uint256,uint256)\":{\"params\":{\"claimId\":\"The id of the stake claim\",\"serviceProvider\":\"The address of the service provider\",\"tokens\":\"The amount of tokens to lock in the claim\",\"unlockTimestamp\":\"The timestamp when the tokens can be released\"}},\"StakeClaimReleased(address,bytes32,uint256,uint256)\":{\"params\":{\"claimId\":\"The id of the stake claim\",\"releasableAt\":\"The timestamp when the tokens were released\",\"serviceProvider\":\"The address of the service provider\",\"tokens\":\"The amount of tokens released\"}},\"StakeClaimsReleased(address,uint256,uint256)\":{\"params\":{\"claimsCount\":\"The number of stake claims being released\",\"serviceProvider\":\"The address of the service provider\",\"tokensReleased\":\"The total amount of tokens being released\"}},\"StakeToFeesRatioSet(uint256)\":{\"params\":{\"ratio\":\"The stake to fees ratio\"}}},\"kind\":\"dev\",\"methods\":{\"acceptProvisionPendingParameters(address,bytes)\":{\"details\":\"Provides a way for the data service to validate and accept provision parameter changes. Call {_acceptProvision}. Emits a {ProvisionPendingParametersAccepted} event.\",\"params\":{\"data\":\"Custom data, usage defined by the data service.\",\"serviceProvider\":\"The address of the service provider.\"}},\"closeStaleAllocation(address)\":{\"details\":\"This function can be permissionlessly called when the allocation is stale. This ensures that rewards for other allocations are not diluted by an inactive allocation. Requirements: - Allocation must exist and be open - Allocation must be stale - Allocation cannot be altruistic Emits a {AllocationClosed} event.\",\"params\":{\"allocationId\":\"The id of the allocation\"}},\"collect(address,uint8,bytes)\":{\"details\":\"The implementation of this function is expected to interact with {GraphPayments} to collect payment from the service payer, which is done via {IGraphPayments-collect}. Emits a {ServicePaymentCollected} event. NOTE: Data services that are vetted by the Graph Council might qualify for a portion of protocol issuance to cover for these payments. In this case, the funds are taken by interacting with the rewards manager contract instead of the {GraphPayments} contract.\",\"params\":{\"data\":\"Custom data, usage defined by the data service.\",\"feeType\":\"The type of fee to collect as defined in {GraphPayments}.\",\"serviceProvider\":\"The address of the service provider.\"},\"returns\":{\"_0\":\"The amount of tokens collected.\"}},\"encodeAllocationProof(address,address)\":{\"params\":{\"allocationId\":\"The id of the allocation\",\"indexer\":\"The address of the indexer\"},\"returns\":{\"_0\":\"The encoded allocation proof\"}},\"getAllocation(address)\":{\"params\":{\"allocationId\":\"The id of the allocation\"},\"returns\":{\"_0\":\"The allocation details\"}},\"getCuration()\":{\"returns\":{\"_0\":\"The address of the curation contract\"}},\"getDelegationRatio()\":{\"returns\":{\"_0\":\"The delegation ratio\"}},\"getDisputeManager()\":{\"returns\":{\"_0\":\"The address of the dispute manager\"}},\"getGraphTallyCollector()\":{\"returns\":{\"_0\":\"The address of the graph tally collector\"}},\"getLegacyAllocation(address)\":{\"params\":{\"allocationId\":\"The id of the allocation\"},\"returns\":{\"_0\":\"The legacy allocation details\"}},\"getProvisionTokensRange()\":{\"returns\":{\"_0\":\"Minimum provision tokens allowed\",\"_1\":\"Maximum provision tokens allowed\"}},\"getThawingPeriodRange()\":{\"returns\":{\"_0\":\"Minimum thawing period allowed\",\"_1\":\"Maximum thawing period allowed\"}},\"getVerifierCutRange()\":{\"returns\":{\"_0\":\"Minimum verifier cut allowed\",\"_1\":\"Maximum verifier cut allowed\"}},\"initialize(address,uint256,uint32,uint256)\":{\"details\":\"The thawingPeriod and verifierCut ranges are not set here because they are variables on the DisputeManager. We use the {ProvisionManager} overrideable getters to get the ranges.\",\"params\":{\"maximumDelegationRatio\":\"The maximum delegation ratio allowed for an allocation\",\"minimumProvisionTokens\":\"The minimum amount of provisioned tokens required to create an allocation\",\"owner\":\"The owner of the contract\",\"stakeToFeesRatio\":\"The ratio of stake to fees to lock when collecting query fees\"}},\"isOverAllocated(address)\":{\"params\":{\"allocationId\":\"The id of the allocation\"},\"returns\":{\"_0\":\"True if the indexer is over-allocated, false otherwise\"}},\"migrateLegacyAllocation(address,address,bytes32)\":{\"params\":{\"allocationId\":\"The id of the allocation\",\"indexer\":\"The address of the indexer\",\"subgraphDeploymentId\":\"The id of the subgraph deployment\"}},\"register(address,bytes)\":{\"details\":\"Before registering, the service provider must have created a provision in the Graph Horizon staking contract with parameters that are compatible with the data service. Verifies provision parameters and rejects registration in the event they are not valid. Emits a {ServiceProviderRegistered} event. NOTE: Failing to accept the provision will result in the service provider operating on an unverified provision. Depending on of the data service this can be a security risk as the protocol won't be able to guarantee economic security for the consumer.\",\"params\":{\"data\":\"Custom data, usage defined by the data service.\",\"serviceProvider\":\"The address of the service provider.\"}},\"releaseStake(uint256)\":{\"details\":\"This function is only meant to be called if the service provider has enough stake claims that releasing them all at once would exceed the block gas limit.This function can be overriden and/or disabled.Emits a {StakeClaimsReleased} event, and a {StakeClaimReleased} event for each claim released.\",\"params\":{\"numClaimsToRelease\":\"Amount of stake claims to process. If 0, all stake claims are processed.\"}},\"resizeAllocation(address,address,uint256)\":{\"details\":\"Requirements: - The indexer must be registered - The provision must be valid according to the subgraph service rules - `tokens` must be different from the current allocation size - The indexer must have enough available tokens to allocate if they are upsizing the allocation Emits a {AllocationResized} event. See {AllocationManager-_resizeAllocation} for more details.\",\"params\":{\"allocationId\":\"The id of the allocation\",\"indexer\":\"The address of the indexer\",\"tokens\":\"The new amount of tokens in the allocation\"}},\"setCurationCut(uint256)\":{\"details\":\"Emits a {CuratorCutSet} event\",\"params\":{\"curationCut\":\"The curation cut for the payment type\"}},\"setDelegationRatio(uint32)\":{\"params\":{\"delegationRatio\":\"The delegation ratio\"}},\"setMaxPOIStaleness(uint256)\":{\"params\":{\"maxPOIStaleness\":\"The max POI staleness in seconds\"}},\"setMinimumProvisionTokens(uint256)\":{\"params\":{\"minimumProvisionTokens\":\"The minimum amount of provisioned tokens required to create an allocation\"}},\"setPauseGuardian(address,bool)\":{\"params\":{\"allowed\":\"True if the pause guardian is allowed to pause the contract, false otherwise\",\"pauseGuardian\":\"The address of the pause guardian\"}},\"setPaymentsDestination(address)\":{\"details\":\"Emits a {PaymentsDestinationSet} event\",\"params\":{\"paymentsDestination\":\"The address where payments should be sent\"}},\"setStakeToFeesRatio(uint256)\":{\"params\":{\"stakeToFeesRatio\":\"The stake to fees ratio\"}},\"slash(address,bytes)\":{\"details\":\"To slash the service provider's provision the function should call {Staking-slash}. Emits a {ServiceProviderSlashed} event.\",\"params\":{\"data\":\"Custom data, usage defined by the data service.\",\"serviceProvider\":\"The address of the service provider.\"}},\"startService(address,bytes)\":{\"details\":\"Emits a {ServiceStarted} event.\",\"params\":{\"data\":\"Custom data, usage defined by the data service.\",\"serviceProvider\":\"The address of the service provider.\"}},\"stopService(address,bytes)\":{\"details\":\"Emits a {ServiceStopped} event.\",\"params\":{\"data\":\"Custom data, usage defined by the data service.\",\"serviceProvider\":\"The address of the service provider.\"}}},\"title\":\"Interface for the {SubgraphService} contract\",\"version\":1},\"userdoc\":{\"errors\":{\"DataServiceFeesClaimNotFound(bytes32)\":[{\"notice\":\"Thrown when attempting to get a stake claim that does not exist.\"}],\"DataServiceFeesZeroTokens()\":[{\"notice\":\"Emitted when trying to lock zero tokens in a stake claim\"}],\"SubgraphServiceAllocationIsAltruistic(address)\":[{\"notice\":\"Thrown when trying to force close an altruistic allocation\"}],\"SubgraphServiceAllocationNotAuthorized(address,address)\":[{\"notice\":\"Thrown when the indexer in the allocation state does not match the expected indexer.\"}],\"SubgraphServiceCannotForceCloseAllocation(address)\":[{\"notice\":\"Thrown when trying to force close an allocation that is not stale and the indexer is not over-allocated\"}],\"SubgraphServiceEmptyGeohash()\":[{\"notice\":\"Thrown when an indexer tries to register with an empty geohash\"}],\"SubgraphServiceEmptyUrl()\":[{\"notice\":\"Thrown when an indexer tries to register with an empty URL\"}],\"SubgraphServiceInconsistentCollection(uint256,uint256)\":[{\"notice\":\"Thrown when the contract GRT balance is inconsistent after collecting from Graph Payments\"}],\"SubgraphServiceIndexerAlreadyRegistered()\":[{\"notice\":\"Thrown when an indexer tries to register but they are already registered\"}],\"SubgraphServiceIndexerMismatch(address,address)\":[{\"notice\":\"@notice Thrown when the service provider in the RAV does not match the expected indexer.\"}],\"SubgraphServiceIndexerNotRegistered(address)\":[{\"notice\":\"Thrown when an indexer tries to perform an operation but they are not registered\"}],\"SubgraphServiceInvalidCollectionId(bytes32)\":[{\"notice\":\"Thrown when collectionId is not a valid address\"}],\"SubgraphServiceInvalidCurationCut(uint256)\":[{\"notice\":\"Thrown when trying to set a curation cut that is not a valid PPM value\"}],\"SubgraphServiceInvalidPaymentType(uint8)\":[{\"notice\":\"Thrown when an indexer tries to collect fees for an unsupported payment type\"}],\"SubgraphServiceInvalidRAV(address,address)\":[{\"notice\":\"Thrown when collecting a RAV where the RAV indexer is not the same as the allocation indexer\"}],\"SubgraphServiceInvalidZeroStakeToFeesRatio()\":[{\"notice\":\"Thrown when trying to set stake to fees ratio to zero\"}]},\"events\":{\"CurationCutSet(uint256)\":{\"notice\":\"Emitted when curator cuts are set\"},\"PaymentsDestinationSet(address,address)\":{\"notice\":\"Emitted when an indexer sets a new payments destination\"},\"ProvisionPendingParametersAccepted(address)\":{\"notice\":\"Emitted when a service provider accepts a provision in {Graph Horizon staking contract}.\"},\"QueryFeesCollected(address,address,address,bytes32,uint256,uint256)\":{\"notice\":\"Emitted when a subgraph service collects query fees from Graph Payments\"},\"ServicePaymentCollected(address,uint8,uint256)\":{\"notice\":\"Emitted when a service provider collects payment.\"},\"ServiceProviderRegistered(address,bytes)\":{\"notice\":\"Emitted when a service provider is registered with the data service.\"},\"ServiceProviderSlashed(address,uint256)\":{\"notice\":\"Emitted when a service provider is slashed.\"},\"ServiceStarted(address,bytes)\":{\"notice\":\"Emitted when a service provider starts providing the service.\"},\"ServiceStopped(address,bytes)\":{\"notice\":\"Emitted when a service provider stops providing the service.\"},\"StakeClaimLocked(address,bytes32,uint256,uint256)\":{\"notice\":\"Emitted when a stake claim is created and stake is locked.\"},\"StakeClaimReleased(address,bytes32,uint256,uint256)\":{\"notice\":\"Emitted when a stake claim is released and stake is unlocked.\"},\"StakeClaimsReleased(address,uint256,uint256)\":{\"notice\":\"Emitted when a series of stake claims are released.\"},\"StakeToFeesRatioSet(uint256)\":{\"notice\":\"Emitted when the stake to fees ratio is set.\"}},\"kind\":\"user\",\"methods\":{\"acceptProvisionPendingParameters(address,bytes)\":{\"notice\":\"Accepts pending parameters in the provision of a service provider in the {Graph Horizon staking contract}.\"},\"closeStaleAllocation(address)\":{\"notice\":\"Force close a stale allocation\"},\"collect(address,uint8,bytes)\":{\"notice\":\"Collects payment earnt by the service provider.\"},\"encodeAllocationProof(address,address)\":{\"notice\":\"Encodes the allocation proof for EIP712 signing\"},\"getAllocation(address)\":{\"notice\":\"Gets the details of an allocation For legacy allocations use {getLegacyAllocation}\"},\"getCuration()\":{\"notice\":\"Gets the address of the curation contract\"},\"getDelegationRatio()\":{\"notice\":\"External getter for the delegation ratio\"},\"getDisputeManager()\":{\"notice\":\"Gets the address of the dispute manager\"},\"getGraphTallyCollector()\":{\"notice\":\"Gets the address of the graph tally collector\"},\"getLegacyAllocation(address)\":{\"notice\":\"Gets the details of a legacy allocation For non-legacy allocations use {getAllocation}\"},\"getProvisionTokensRange()\":{\"notice\":\"External getter for the provision tokens range\"},\"getThawingPeriodRange()\":{\"notice\":\"External getter for the thawing period range\"},\"getVerifierCutRange()\":{\"notice\":\"External getter for the verifier cut range\"},\"initialize(address,uint256,uint32,uint256)\":{\"notice\":\"Initialize the contract\"},\"isOverAllocated(address)\":{\"notice\":\"Checks if an indexer is over-allocated\"},\"migrateLegacyAllocation(address,address,bytes32)\":{\"notice\":\"Imports a legacy allocation id into the subgraph service This is a governor only action that is required to prevent indexers from re-using allocation ids from the legacy staking contract.\"},\"register(address,bytes)\":{\"notice\":\"Registers a service provider with the data service. The service provider can now start providing the service.\"},\"releaseStake(uint256)\":{\"notice\":\"Releases expired stake claims for the caller.\"},\"resizeAllocation(address,address,uint256)\":{\"notice\":\"Change the amount of tokens in an allocation\"},\"setCurationCut(uint256)\":{\"notice\":\"Sets the curators payment cut for query fees\"},\"setDelegationRatio(uint32)\":{\"notice\":\"Sets the delegation ratio\"},\"setMaxPOIStaleness(uint256)\":{\"notice\":\"Sets the max POI staleness See {AllocationManagerV1Storage-maxPOIStaleness} for more details.\"},\"setMinimumProvisionTokens(uint256)\":{\"notice\":\"Sets the minimum amount of provisioned tokens required to create an allocation\"},\"setPauseGuardian(address,bool)\":{\"notice\":\"Sets a pause guardian\"},\"setPaymentsDestination(address)\":{\"notice\":\"Sets the payments destination for an indexer to receive payments\"},\"setStakeToFeesRatio(uint256)\":{\"notice\":\"Sets the stake to fees ratio\"},\"slash(address,bytes)\":{\"notice\":\"Slash a service provider for misbehaviour.\"},\"startService(address,bytes)\":{\"notice\":\"Service provider starts providing the service.\"},\"stopService(address,bytes)\":{\"notice\":\"Service provider stops providing the service.\"}},\"notice\":\"The Subgraph Service is a data service built on top of Graph Horizon that supports the use case of subgraph indexing and querying. The {SubgraphService} contract implements the flows described in the Data Service framework to allow indexers to register as subgraph service providers, create allocations to signal their commitment to index a subgraph, and collect fees for indexing and querying services.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/interfaces/ISubgraphService.sol\":\"ISubgraphService\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10},\"remappings\":[]},\"sources\":{\"@graphprotocol/contracts/contracts/rewards/IRewardsIssuer.sol\":{\"keccak256\":\"0xe049090c38a64d80b284ba2a7b440bcedba9804d96f2bb8da525e69ac452e03a\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://8b7d1186bd0698bed02d3504ac80c20e605087fba036d5ff392b39a9a3c818e5\",\"dweb:/ipfs/QmRgAfY1dD5rc7fLuuGVyu2mh9Z8qz1AVvuXAcRGnB3dSv\"]},\"@graphprotocol/horizon/contracts/data-service/interfaces/IDataService.sol\":{\"keccak256\":\"0x2208814f64eeca9409eafc1a1fa425c67ff38cffdffc3af0bafbe1c1b338ed32\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://925b32efbd9fe85a98f8f1f51e865e0b7b65d933196cf6c098bd670da7138e0c\",\"dweb:/ipfs/Qmdrp7BGJ4fEKzDgZpVY1FULXKsHAdGXkx4nqRrWvMaumr\"]},\"@graphprotocol/horizon/contracts/data-service/interfaces/IDataServiceFees.sol\":{\"keccak256\":\"0x1b82ae2785502fe62d3ca6f55a3ed836b8b038a3b929cced92e1c6b4733f4074\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://5556b2ce53b604427a995fb50f7169acb3fe30f60ef19c7cb5c22bd5ec53177c\",\"dweb:/ipfs/QmXx7dmTeAYAMPbbrGrcsKT31dqEqbcFgXWaPS6LQrANru\"]},\"@graphprotocol/horizon/contracts/interfaces/IGraphPayments.sol\":{\"keccak256\":\"0xa22dcc47676073113e4ebe30045065662cee5531f9c5f75776c00e70a1929c81\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://8908f30b3c7536798b14dc62fb5ccffc05570d568dbd1bade7c79c1fd2a4b5fe\",\"dweb:/ipfs/QmexZgb5mhDmXVZnYX1Z37cwM7EG2prYyBEVjUSVdKshVr\"]},\"@graphprotocol/horizon/contracts/interfaces/IHorizonStaking.sol\":{\"keccak256\":\"0x4b146f30ee66c4224cb5a82bafc8299f8596d8fe302e793757520f67bba8a166\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://30666c737d72a850223c1966d3b5d02b84f3f808f3c8dae8d0748731646b60c5\",\"dweb:/ipfs/QmQschyZQtU8tTnQ9hNiG5nobuXBx6KeiKdfxvZ4zvQ7ty\"]},\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingBase.sol\":{\"keccak256\":\"0x9bdab6cb595eabd7d321d7beae03ad3607995c14ef40f0c2f349fb72084766c5\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://6cac2ca3580bd770b98b07b11ebb007e8a922a90cde920e6ec472df7e66fb512\",\"dweb:/ipfs/QmRw1rjT8D8gNp2GRTuwDETwHNHMpHKoHZq4pYBAn9i65F\"]},\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingExtension.sol\":{\"keccak256\":\"0x7923f39746198b5672f0e4d65b7bf14903ae5f7775d74b210effb957eea36c71\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://c29531aff69c71e649fb347d7117ea8c42fc8de09860a1c389ed9b8f097a34e0\",\"dweb:/ipfs/QmS89fww584HiyE1BdPe8Xaqbf5v7FEvL38GTxeHEAsLFm\"]},\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingMain.sol\":{\"keccak256\":\"0xd04bb1f6a427e858e8a625b4b9835c69c8891a324d22beba20293ab2a77e5de7\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://05c9e425eee0b6c109a8dad2edcf9e1c845c64fccf321edf804921394ee048be\",\"dweb:/ipfs/QmbwLWNof534oG5ohzNAWrjdQ5kqJs7M5d5kCRd68XUogB\"]},\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingTypes.sol\":{\"keccak256\":\"0xaaeb9770f8aaae6b395e87bb1876a10fe7c14384d16d97dd33a671c3ea53aa7b\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://8f5c019fdb2df73bafe464fb6e9da792f7833a0c1858734bcd6a6b8d6ae924c7\",\"dweb:/ipfs/QmcubeYTHCYBqQsRncBFpPFtk7JzRz4nFh27LUW1m4hx2K\"]},\"@graphprotocol/horizon/contracts/libraries/LinkedList.sol\":{\"keccak256\":\"0x99058b4da0428b8d9c22d3d112acbaa59900f1fd0a434038b1a4fccfe3c678d6\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://568e03231c6081eacbcb6585a05c0b1bb976b640b611f7bf6155f9b58d887239\",\"dweb:/ipfs/QmdPZQWhkhjf5TUwz487Dwm4ycjX323iNdwb1sQnAiA1Qu\"]},\"@openzeppelin/contracts/utils/Panic.sol\":{\"keccak256\":\"0xf7fe324703a64fc51702311dc51562d5cb1497734f074e4f483bfb6717572d7a\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://c6a5ff4f9fd8649b7ee20800b7fa387d3465bd77cf20c2d1068cd5c98e1ed57a\",\"dweb:/ipfs/QmVSaVJf9FXFhdYEYeCEfjMVHrxDh5qL4CGkxdMWpQCrqG\"]},\"@openzeppelin/contracts/utils/math/Math.sol\":{\"keccak256\":\"0x1225214420c83ebcca88f2ae2b50f053aaa7df7bd684c3e878d334627f2edfc6\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://6c5fab4970634f9ab9a620983dc1c8a30153981a0b1a521666e269d0a11399d3\",\"dweb:/ipfs/QmVRnBC575MESGkEHndjujtR7qub2FzU9RWy9eKLp4hPZB\"]},\"@openzeppelin/contracts/utils/math/SafeCast.sol\":{\"keccak256\":\"0x195533c86d0ef72bcc06456a4f66a9b941f38eb403739b00f21fd7c1abd1ae54\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://b1d578337048cad08c1c03041cca5978eff5428aa130c781b271ad9e5566e1f8\",\"dweb:/ipfs/QmPFKL2r9CBsMwmUqqdcFPfHZB2qcs9g1HDrPxzWSxomvy\"]},\"contracts/interfaces/ISubgraphService.sol\":{\"keccak256\":\"0x7516f80b0a8b2e3edeedf06c9b917f2a24e557f8c00632e6150fbb41ef8da3ce\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://ad4f813111541f5ef9ea6236f42822a3a66364d24189e4568450b20e09972a5e\",\"dweb:/ipfs/QmVYQA9rT7T8YnQgAB6fokNYDJeDrgQqrjfJ8sGjySNFBo\"]},\"contracts/libraries/Allocation.sol\":{\"keccak256\":\"0xeabed16693ebd22165d4421bb62b91de64553f94d86d6fd03e3d25a62d651000\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://5beecbf35f8dc63fc9fcd5fe844ff29cb4874c1ac73a96ec7170729efd096b74\",\"dweb:/ipfs/QmPFQyxQYuwae8ARxuLxingd8fQ7GBw1cfTQuUvfo6CWhM\"]},\"contracts/libraries/LegacyAllocation.sol\":{\"keccak256\":\"0x32fd54a2823bf3fa4090bf94968b4d8a5988fee8f75d1b805591a744f5766c60\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://2571faaa157c207853cd52e730aaab019384d84618b6dce976b9d794a9634a54\",\"dweb:/ipfs/QmSinKJ1WguxvZte5C3eVfGBo8gsvzTbPQh7uVREWT49uL\"]}},\"version\":1}" + } + }, + "contracts/libraries/Allocation.sol": { + "Allocation": { + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "AllocationAlreadyExists", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "internalType": "uint256", + "name": "closedAt", + "type": "uint256" + } + ], + "name": "AllocationClosed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "AllocationDoesNotExist", + "type": "error" + } + ], + "evm": { + "bytecode": { + "functionDebugData": {}, + "generatedSources": [], + "linkReferences": {}, + "object": "60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220bf7be374d96e4dfebf669b5e5761d8c0ce765860edf79096b2e17cccafbc1df664736f6c634300081b0033", + "opcodes": "PUSH1 0x56 PUSH1 0x37 PUSH1 0xB DUP3 DUP3 DUP3 CODECOPY DUP1 MLOAD PUSH1 0x0 BYTE PUSH1 0x73 EQ PUSH1 0x2A JUMPI PUSH4 0x4E487B71 PUSH1 0xE0 SHL PUSH1 0x0 MSTORE PUSH1 0x0 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST ADDRESS PUSH1 0x0 MSTORE PUSH1 0x73 DUP2 MSTORE8 DUP3 DUP2 RETURN INVALID PUSH20 0x0 ADDRESS EQ PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0xBF PUSH28 0xE374D96E4DFEBF669B5E5761D8C0CE765860EDF79096B2E17CCCAFBC SAR 0xF6 PUSH5 0x736F6C6343 STOP ADDMOD SHL STOP CALLER ", + "sourceMap": "360:7850:61:-:0;;;;;;;;;;;;;;;-1:-1:-1;;;360:7850:61;;;;;;;;;;;;;;;;;" + }, + "deployedBytecode": { + "functionDebugData": {}, + "generatedSources": [], + "immutableReferences": {}, + "linkReferences": {}, + "object": "73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220bf7be374d96e4dfebf669b5e5761d8c0ce765860edf79096b2e17cccafbc1df664736f6c634300081b0033", + "opcodes": "PUSH20 0x0 ADDRESS EQ PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0xBF PUSH28 0xE374D96E4DFEBF669B5E5761D8C0CE765860EDF79096B2E17CCCAFBC SAR 0xF6 PUSH5 0x736F6C6343 STOP ADDMOD SHL STOP CALLER ", + "sourceMap": "360:7850:61:-:0;;;;;;;;" + }, + "methodIdentifiers": {} + }, + "metadata": "{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"allocationId\",\"type\":\"address\"}],\"name\":\"AllocationAlreadyExists\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"allocationId\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"closedAt\",\"type\":\"uint256\"}],\"name\":\"AllocationClosed\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"allocationId\",\"type\":\"address\"}],\"name\":\"AllocationDoesNotExist\",\"type\":\"error\"}],\"devdoc\":{\"custom:security-contact\":\"Please email security+contracts@thegraph.com if you find any bugs. We may have an active bug bounty program.\",\"errors\":{\"AllocationAlreadyExists(address)\":[{\"params\":{\"allocationId\":\"The allocation id\"}}],\"AllocationClosed(address,uint256)\":[{\"params\":{\"allocationId\":\"The allocation id\",\"closedAt\":\"The timestamp when the allocation was closed\"}}],\"AllocationDoesNotExist(address)\":[{\"params\":{\"allocationId\":\"The allocation id\"}}]},\"kind\":\"dev\",\"methods\":{},\"title\":\"Allocation library\",\"version\":1},\"userdoc\":{\"errors\":{\"AllocationAlreadyExists(address)\":[{\"notice\":\"Thrown when attempting to create an allocation with an existing id\"}],\"AllocationClosed(address,uint256)\":[{\"notice\":\"Thrown when trying to perform an operation on a closed allocation\"}],\"AllocationDoesNotExist(address)\":[{\"notice\":\"Thrown when trying to perform an operation on a non-existent allocation\"}]},\"kind\":\"user\",\"methods\":{},\"notice\":\"A library to handle Allocations.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/libraries/Allocation.sol\":\"Allocation\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/utils/Panic.sol\":{\"keccak256\":\"0xf7fe324703a64fc51702311dc51562d5cb1497734f074e4f483bfb6717572d7a\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://c6a5ff4f9fd8649b7ee20800b7fa387d3465bd77cf20c2d1068cd5c98e1ed57a\",\"dweb:/ipfs/QmVSaVJf9FXFhdYEYeCEfjMVHrxDh5qL4CGkxdMWpQCrqG\"]},\"@openzeppelin/contracts/utils/math/Math.sol\":{\"keccak256\":\"0x1225214420c83ebcca88f2ae2b50f053aaa7df7bd684c3e878d334627f2edfc6\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://6c5fab4970634f9ab9a620983dc1c8a30153981a0b1a521666e269d0a11399d3\",\"dweb:/ipfs/QmVRnBC575MESGkEHndjujtR7qub2FzU9RWy9eKLp4hPZB\"]},\"@openzeppelin/contracts/utils/math/SafeCast.sol\":{\"keccak256\":\"0x195533c86d0ef72bcc06456a4f66a9b941f38eb403739b00f21fd7c1abd1ae54\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://b1d578337048cad08c1c03041cca5978eff5428aa130c781b271ad9e5566e1f8\",\"dweb:/ipfs/QmPFKL2r9CBsMwmUqqdcFPfHZB2qcs9g1HDrPxzWSxomvy\"]},\"contracts/libraries/Allocation.sol\":{\"keccak256\":\"0xeabed16693ebd22165d4421bb62b91de64553f94d86d6fd03e3d25a62d651000\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://5beecbf35f8dc63fc9fcd5fe844ff29cb4874c1ac73a96ec7170729efd096b74\",\"dweb:/ipfs/QmPFQyxQYuwae8ARxuLxingd8fQ7GBw1cfTQuUvfo6CWhM\"]}},\"version\":1}" + } + }, + "contracts/libraries/Attestation.sol": { + "Attestation": { + "abi": [ + { + "inputs": [ + { + "internalType": "uint256", + "name": "length", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "expectedLength", + "type": "uint256" + } + ], + "name": "AttestationInvalidBytesLength", + "type": "error" + } + ], + "evm": { + "bytecode": { + "functionDebugData": {}, + "generatedSources": [], + "linkReferences": {}, + "object": "60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220e1f75b59a03e53b2d3d0f698d9538dc889ffa06993a219fcb5e82cbe0789c59d64736f6c634300081b0033", + "opcodes": "PUSH1 0x56 PUSH1 0x37 PUSH1 0xB DUP3 DUP3 DUP3 CODECOPY DUP1 MLOAD PUSH1 0x0 BYTE PUSH1 0x73 EQ PUSH1 0x2A JUMPI PUSH4 0x4E487B71 PUSH1 0xE0 SHL PUSH1 0x0 MSTORE PUSH1 0x0 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST ADDRESS PUSH1 0x0 MSTORE PUSH1 0x73 DUP2 MSTORE8 DUP3 DUP2 RETURN INVALID PUSH20 0x0 ADDRESS EQ PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0xE1 0xF7 JUMPDEST MSIZE LOG0 RETURNDATACOPY MSTORE8 0xB2 0xD3 0xD0 0xF6 SWAP9 0xD9 MSTORE8 DUP14 0xC8 DUP10 SELFDESTRUCT LOG0 PUSH10 0x93A219FCB5E82CBE0789 0xC5 SWAP14 PUSH5 0x736F6C6343 STOP ADDMOD SHL STOP CALLER ", + "sourceMap": "292:5790:62:-:0;;;;;;;;;;;;;;;-1:-1:-1;;;292:5790:62;;;;;;;;;;;;;;;;;" + }, + "deployedBytecode": { + "functionDebugData": {}, + "generatedSources": [], + "immutableReferences": {}, + "linkReferences": {}, + "object": "73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220e1f75b59a03e53b2d3d0f698d9538dc889ffa06993a219fcb5e82cbe0789c59d64736f6c634300081b0033", + "opcodes": "PUSH20 0x0 ADDRESS EQ PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0xE1 0xF7 JUMPDEST MSIZE LOG0 RETURNDATACOPY MSTORE8 0xB2 0xD3 0xD0 0xF6 SWAP9 0xD9 MSTORE8 DUP14 0xC8 DUP10 SELFDESTRUCT LOG0 PUSH10 0x93A219FCB5E82CBE0789 0xC5 SWAP14 PUSH5 0x736F6C6343 STOP ADDMOD SHL STOP CALLER ", + "sourceMap": "292:5790:62:-:0;;;;;;;;" + }, + "methodIdentifiers": {} + }, + "metadata": "{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"length\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expectedLength\",\"type\":\"uint256\"}],\"name\":\"AttestationInvalidBytesLength\",\"type\":\"error\"}],\"devdoc\":{\"custom:security-contact\":\"Please email security+contracts@thegraph.com if you find any bugs. We may have an active bug bounty program.\",\"errors\":{\"AttestationInvalidBytesLength(uint256,uint256)\":[{\"params\":{\"expectedLength\":\"The expected length of the attestation data\",\"length\":\"The length of the attestation data\"}}]},\"kind\":\"dev\",\"methods\":{},\"title\":\"Attestation library\",\"version\":1},\"userdoc\":{\"errors\":{\"AttestationInvalidBytesLength(uint256,uint256)\":[{\"notice\":\"The error thrown when the attestation data length is invalid\"}]},\"kind\":\"user\",\"methods\":{},\"notice\":\"A library to handle Attestation.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/libraries/Attestation.sol\":\"Attestation\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10},\"remappings\":[]},\"sources\":{\"contracts/libraries/Attestation.sol\":{\"keccak256\":\"0x0976f586d532d479823ac9e049371742a7a876f0faf3ed722b3b7f78a4586f33\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://34baba14bd7d3dcb1e1111ee09f3c809d6876732bbc889c1486cc329465e711e\",\"dweb:/ipfs/QmPRgYduW85aCjVk4ih35jB2FhoLjBvgmjZtMGeqXaLhTW\"]}},\"version\":1}" + } + }, + "contracts/libraries/LegacyAllocation.sol": { + "LegacyAllocation": { + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "LegacyAllocationAlreadyExists", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "LegacyAllocationDoesNotExist", + "type": "error" + } + ], + "evm": { + "bytecode": { + "functionDebugData": {}, + "generatedSources": [], + "linkReferences": {}, + "object": "60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea264697066735822122071104b32b9956ccf0efa57d5b6b7c7963e628cf468ea4f5532c7e2755bca113864736f6c634300081b0033", + "opcodes": "PUSH1 0x56 PUSH1 0x37 PUSH1 0xB DUP3 DUP3 DUP3 CODECOPY DUP1 MLOAD PUSH1 0x0 BYTE PUSH1 0x73 EQ PUSH1 0x2A JUMPI PUSH4 0x4E487B71 PUSH1 0xE0 SHL PUSH1 0x0 MSTORE PUSH1 0x0 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST ADDRESS PUSH1 0x0 MSTORE PUSH1 0x73 DUP2 MSTORE8 DUP3 DUP2 RETURN INVALID PUSH20 0x0 ADDRESS EQ PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 PUSH18 0x104B32B9956CCF0EFA57D5B6B7C7963E628C DELEGATECALL PUSH9 0xEA4F5532C7E2755BCA GT CODESIZE PUSH5 0x736F6C6343 STOP ADDMOD SHL STOP CALLER ", + "sourceMap": "404:3827:63:-:0;;;;;;;;;;;;;;;-1:-1:-1;;;404:3827:63;;;;;;;;;;;;;;;;;" + }, + "deployedBytecode": { + "functionDebugData": {}, + "generatedSources": [], + "immutableReferences": {}, + "linkReferences": {}, + "object": "73000000000000000000000000000000000000000030146080604052600080fdfea264697066735822122071104b32b9956ccf0efa57d5b6b7c7963e628cf468ea4f5532c7e2755bca113864736f6c634300081b0033", + "opcodes": "PUSH20 0x0 ADDRESS EQ PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 PUSH18 0x104B32B9956CCF0EFA57D5B6B7C7963E628C DELEGATECALL PUSH9 0xEA4F5532C7E2755BCA GT CODESIZE PUSH5 0x736F6C6343 STOP ADDMOD SHL STOP CALLER ", + "sourceMap": "404:3827:63:-:0;;;;;;;;" + }, + "methodIdentifiers": {} + }, + "metadata": "{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"allocationId\",\"type\":\"address\"}],\"name\":\"LegacyAllocationAlreadyExists\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"allocationId\",\"type\":\"address\"}],\"name\":\"LegacyAllocationDoesNotExist\",\"type\":\"error\"}],\"devdoc\":{\"custom:security-contact\":\"Please email security+contracts@thegraph.com if you find any bugs. We may have an active bug bounty program.\",\"errors\":{\"LegacyAllocationAlreadyExists(address)\":[{\"params\":{\"allocationId\":\"The allocation id\"}}],\"LegacyAllocationDoesNotExist(address)\":[{\"params\":{\"allocationId\":\"The allocation id\"}}]},\"kind\":\"dev\",\"methods\":{},\"title\":\"LegacyAllocation library\",\"version\":1},\"userdoc\":{\"errors\":{\"LegacyAllocationAlreadyExists(address)\":[{\"notice\":\"Thrown when attempting to migrate an allocation with an existing id\"}],\"LegacyAllocationDoesNotExist(address)\":[{\"notice\":\"Thrown when trying to get a non-existent allocation\"}]},\"kind\":\"user\",\"methods\":{},\"notice\":\"A library to handle legacy Allocations.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/libraries/LegacyAllocation.sol\":\"LegacyAllocation\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10},\"remappings\":[]},\"sources\":{\"@graphprotocol/contracts/contracts/rewards/IRewardsIssuer.sol\":{\"keccak256\":\"0xe049090c38a64d80b284ba2a7b440bcedba9804d96f2bb8da525e69ac452e03a\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://8b7d1186bd0698bed02d3504ac80c20e605087fba036d5ff392b39a9a3c818e5\",\"dweb:/ipfs/QmRgAfY1dD5rc7fLuuGVyu2mh9Z8qz1AVvuXAcRGnB3dSv\"]},\"@graphprotocol/horizon/contracts/interfaces/IGraphPayments.sol\":{\"keccak256\":\"0xa22dcc47676073113e4ebe30045065662cee5531f9c5f75776c00e70a1929c81\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://8908f30b3c7536798b14dc62fb5ccffc05570d568dbd1bade7c79c1fd2a4b5fe\",\"dweb:/ipfs/QmexZgb5mhDmXVZnYX1Z37cwM7EG2prYyBEVjUSVdKshVr\"]},\"@graphprotocol/horizon/contracts/interfaces/IHorizonStaking.sol\":{\"keccak256\":\"0x4b146f30ee66c4224cb5a82bafc8299f8596d8fe302e793757520f67bba8a166\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://30666c737d72a850223c1966d3b5d02b84f3f808f3c8dae8d0748731646b60c5\",\"dweb:/ipfs/QmQschyZQtU8tTnQ9hNiG5nobuXBx6KeiKdfxvZ4zvQ7ty\"]},\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingBase.sol\":{\"keccak256\":\"0x9bdab6cb595eabd7d321d7beae03ad3607995c14ef40f0c2f349fb72084766c5\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://6cac2ca3580bd770b98b07b11ebb007e8a922a90cde920e6ec472df7e66fb512\",\"dweb:/ipfs/QmRw1rjT8D8gNp2GRTuwDETwHNHMpHKoHZq4pYBAn9i65F\"]},\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingExtension.sol\":{\"keccak256\":\"0x7923f39746198b5672f0e4d65b7bf14903ae5f7775d74b210effb957eea36c71\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://c29531aff69c71e649fb347d7117ea8c42fc8de09860a1c389ed9b8f097a34e0\",\"dweb:/ipfs/QmS89fww584HiyE1BdPe8Xaqbf5v7FEvL38GTxeHEAsLFm\"]},\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingMain.sol\":{\"keccak256\":\"0xd04bb1f6a427e858e8a625b4b9835c69c8891a324d22beba20293ab2a77e5de7\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://05c9e425eee0b6c109a8dad2edcf9e1c845c64fccf321edf804921394ee048be\",\"dweb:/ipfs/QmbwLWNof534oG5ohzNAWrjdQ5kqJs7M5d5kCRd68XUogB\"]},\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingTypes.sol\":{\"keccak256\":\"0xaaeb9770f8aaae6b395e87bb1876a10fe7c14384d16d97dd33a671c3ea53aa7b\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://8f5c019fdb2df73bafe464fb6e9da792f7833a0c1858734bcd6a6b8d6ae924c7\",\"dweb:/ipfs/QmcubeYTHCYBqQsRncBFpPFtk7JzRz4nFh27LUW1m4hx2K\"]},\"@graphprotocol/horizon/contracts/libraries/LinkedList.sol\":{\"keccak256\":\"0x99058b4da0428b8d9c22d3d112acbaa59900f1fd0a434038b1a4fccfe3c678d6\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://568e03231c6081eacbcb6585a05c0b1bb976b640b611f7bf6155f9b58d887239\",\"dweb:/ipfs/QmdPZQWhkhjf5TUwz487Dwm4ycjX323iNdwb1sQnAiA1Qu\"]},\"contracts/libraries/LegacyAllocation.sol\":{\"keccak256\":\"0x32fd54a2823bf3fa4090bf94968b4d8a5988fee8f75d1b805591a744f5766c60\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://2571faaa157c207853cd52e730aaab019384d84618b6dce976b9d794a9634a54\",\"dweb:/ipfs/QmSinKJ1WguxvZte5C3eVfGBo8gsvzTbPQh7uVREWT49uL\"]}},\"version\":1}" + } + }, + "contracts/utilities/AllocationManager.sol": { + "AllocationManager": { + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "AllocationManagerAllocationClosed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "AllocationManagerAllocationSameSize", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "signer", + "type": "address" + }, + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "AllocationManagerInvalidAllocationProof", + "type": "error" + }, + { + "inputs": [], + "name": "AllocationManagerInvalidZeroAllocationId", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "contractName", + "type": "bytes" + } + ], + "name": "GraphDirectoryInvalidZeroAddress", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidInitialization", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "forceClosed", + "type": "bool" + } + ], + "name": "AllocationClosed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "currentEpoch", + "type": "uint256" + } + ], + "name": "AllocationCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newTokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldTokens", + "type": "uint256" + } + ], + "name": "AllocationResized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "EIP712DomainChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "graphToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "graphStaking", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphPayments", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphEscrow", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "graphController", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphEpochManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphRewardsManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphTokenGateway", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphProxyAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphCuration", + "type": "address" + } + ], + "name": "GraphDirectoryInitialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensRewards", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensIndexerRewards", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensDelegationRewards", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "poi", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "poiMetadata", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "currentEpoch", + "type": "uint256" + } + ], + "name": "IndexingRewardsCollected", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + } + ], + "name": "LegacyAllocationMigrated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "maxPOIStaleness", + "type": "uint256" + } + ], + "name": "MaxPOIStalenessSet", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + } + ], + "name": "allocationProvisionTracker", + "outputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "eip712Domain", + "outputs": [ + { + "internalType": "bytes1", + "name": "fields", + "type": "bytes1" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "version", + "type": "string" + }, + { + "internalType": "uint256", + "name": "chainId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "verifyingContract", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "salt", + "type": "bytes32" + }, + { + "internalType": "uint256[]", + "name": "extensions", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maxPOIStaleness", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "evm": { + "bytecode": { + "functionDebugData": {}, + "generatedSources": [], + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "deployedBytecode": { + "functionDebugData": {}, + "generatedSources": [], + "immutableReferences": {}, + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "methodIdentifiers": { + "allocationProvisionTracker(address)": "6234e216", + "eip712Domain()": "84b0196e", + "maxPOIStaleness()": "85e82baf" + } + }, + "metadata": "{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"allocationId\",\"type\":\"address\"}],\"name\":\"AllocationManagerAllocationClosed\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"allocationId\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"AllocationManagerAllocationSameSize\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"allocationId\",\"type\":\"address\"}],\"name\":\"AllocationManagerInvalidAllocationProof\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AllocationManagerInvalidZeroAllocationId\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"contractName\",\"type\":\"bytes\"}],\"name\":\"GraphDirectoryInvalidZeroAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidInitialization\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotInitializing\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"allocationId\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"subgraphDeploymentId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"forceClosed\",\"type\":\"bool\"}],\"name\":\"AllocationClosed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"allocationId\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"subgraphDeploymentId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"currentEpoch\",\"type\":\"uint256\"}],\"name\":\"AllocationCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"allocationId\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"subgraphDeploymentId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newTokens\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldTokens\",\"type\":\"uint256\"}],\"name\":\"AllocationResized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"EIP712DomainChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"graphToken\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"graphStaking\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"graphPayments\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"graphEscrow\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"graphController\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"graphEpochManager\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"graphRewardsManager\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"graphTokenGateway\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"graphProxyAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"graphCuration\",\"type\":\"address\"}],\"name\":\"GraphDirectoryInitialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"allocationId\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"subgraphDeploymentId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokensRewards\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokensIndexerRewards\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokensDelegationRewards\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"poi\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"poiMetadata\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"currentEpoch\",\"type\":\"uint256\"}],\"name\":\"IndexingRewardsCollected\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"version\",\"type\":\"uint64\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"allocationId\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"subgraphDeploymentId\",\"type\":\"bytes32\"}],\"name\":\"LegacyAllocationMigrated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"maxPOIStaleness\",\"type\":\"uint256\"}],\"name\":\"MaxPOIStalenessSet\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"}],\"name\":\"allocationProvisionTracker\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"eip712Domain\",\"outputs\":[{\"internalType\":\"bytes1\",\"name\":\"fields\",\"type\":\"bytes1\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"version\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"verifyingContract\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"salt\",\"type\":\"bytes32\"},{\"internalType\":\"uint256[]\",\"name\":\"extensions\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"maxPOIStaleness\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"custom:security-contact\":\"Please email security+contracts@thegraph.com if you find any bugs. We may have an active bug bounty program.\",\"errors\":{\"AllocationManagerAllocationClosed(address)\":[{\"params\":{\"allocationId\":\"The id of the allocation\"}}],\"AllocationManagerAllocationSameSize(address,uint256)\":[{\"params\":{\"allocationId\":\"The id of the allocation\",\"tokens\":\"The amount of tokens\"}}],\"AllocationManagerInvalidAllocationProof(address,address)\":[{\"params\":{\"allocationId\":\"The id of the allocation\",\"signer\":\"The address that signed the proof\"}}],\"GraphDirectoryInvalidZeroAddress(bytes)\":[{\"params\":{\"contractName\":\"The name of the contract that was not found, or the controller\"}}],\"InvalidInitialization()\":[{\"details\":\"The contract is already initialized.\"}],\"NotInitializing()\":[{\"details\":\"The contract is not initializing.\"}]},\"events\":{\"AllocationClosed(address,address,bytes32,uint256,bool)\":{\"details\":\"Emitted when an indexer closes an allocation\",\"params\":{\"allocationId\":\"The id of the allocation\",\"forceClosed\":\"Whether the allocation was force closed\",\"indexer\":\"The address of the indexer\",\"subgraphDeploymentId\":\"The id of the subgraph deployment\",\"tokens\":\"The amount of tokens allocated\"}},\"AllocationCreated(address,address,bytes32,uint256,uint256)\":{\"params\":{\"allocationId\":\"The id of the allocation\",\"currentEpoch\":\"The current epoch\",\"indexer\":\"The address of the indexer\",\"subgraphDeploymentId\":\"The id of the subgraph deployment\",\"tokens\":\"The amount of tokens allocated\"}},\"AllocationResized(address,address,bytes32,uint256,uint256)\":{\"params\":{\"allocationId\":\"The id of the allocation\",\"indexer\":\"The address of the indexer\",\"newTokens\":\"The new amount of tokens allocated\",\"oldTokens\":\"The old amount of tokens allocated\",\"subgraphDeploymentId\":\"The id of the subgraph deployment\"}},\"EIP712DomainChanged()\":{\"details\":\"MAY be emitted to signal that the domain could have changed.\"},\"GraphDirectoryInitialized(address,address,address,address,address,address,address,address,address,address)\":{\"params\":{\"graphController\":\"The Graph Controller contract address\",\"graphCuration\":\"The Curation contract address\",\"graphEpochManager\":\"The Epoch Manager contract address\",\"graphEscrow\":\"The Payments Escrow contract address\",\"graphPayments\":\"The Graph Payments contract address\",\"graphProxyAdmin\":\"The Graph Proxy Admin contract address\",\"graphRewardsManager\":\"The Rewards Manager contract address\",\"graphStaking\":\"The Horizon Staking contract address\",\"graphToken\":\"The Graph Token contract address\",\"graphTokenGateway\":\"The Token Gateway contract address\"}},\"IndexingRewardsCollected(address,address,bytes32,uint256,uint256,uint256,bytes32,bytes,uint256)\":{\"params\":{\"allocationId\":\"The id of the allocation\",\"currentEpoch\":\"The current epoch\",\"indexer\":\"The address of the indexer\",\"poi\":\"The POI presented\",\"poiMetadata\":\"The metadata associated with the POI\",\"subgraphDeploymentId\":\"The id of the subgraph deployment\",\"tokensDelegationRewards\":\"The amount of tokens collected for delegators\",\"tokensIndexerRewards\":\"The amount of tokens collected for the indexer\",\"tokensRewards\":\"The amount of tokens collected\"}},\"Initialized(uint64)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"},\"LegacyAllocationMigrated(address,address,bytes32)\":{\"params\":{\"allocationId\":\"The id of the allocation\",\"indexer\":\"The address of the indexer\",\"subgraphDeploymentId\":\"The id of the subgraph deployment\"}},\"MaxPOIStalenessSet(uint256)\":{\"params\":{\"maxPOIStaleness\":\"The max POI staleness in seconds\"}}},\"kind\":\"dev\",\"methods\":{\"eip712Domain()\":{\"details\":\"returns the fields and values that describe the domain separator used by this contract for EIP-712 signature.\"}},\"stateVariables\":{\"EIP712_ALLOCATION_ID_PROOF_TYPEHASH\":{\"details\":\"EIP712 typehash for allocation id proof\"}},\"title\":\"AllocationManager contract\",\"version\":1},\"userdoc\":{\"errors\":{\"AllocationManagerAllocationClosed(address)\":[{\"notice\":\"Thrown when attempting to collect indexing rewards on a closed allocationl\"}],\"AllocationManagerAllocationSameSize(address,uint256)\":[{\"notice\":\"Thrown when attempting to resize an allocation with the same size\"}],\"AllocationManagerInvalidAllocationProof(address,address)\":[{\"notice\":\"Thrown when an allocation proof is invalid Both `signer` and `allocationId` should match for a valid proof.\"}],\"AllocationManagerInvalidZeroAllocationId()\":[{\"notice\":\"Thrown when attempting to create an allocation with a zero allocation id\"}],\"GraphDirectoryInvalidZeroAddress(bytes)\":[{\"notice\":\"Thrown when either the controller is the zero address or a contract address is not found on the controller\"}]},\"events\":{\"AllocationCreated(address,address,bytes32,uint256,uint256)\":{\"notice\":\"Emitted when an indexer creates an allocation\"},\"AllocationResized(address,address,bytes32,uint256,uint256)\":{\"notice\":\"Emitted when an indexer resizes an allocation\"},\"GraphDirectoryInitialized(address,address,address,address,address,address,address,address,address,address)\":{\"notice\":\"Emitted when the GraphDirectory is initialized\"},\"IndexingRewardsCollected(address,address,bytes32,uint256,uint256,uint256,bytes32,bytes,uint256)\":{\"notice\":\"Emitted when an indexer collects indexing rewards for an allocation\"},\"LegacyAllocationMigrated(address,address,bytes32)\":{\"notice\":\"Emitted when a legacy allocation is migrated into the subgraph service\"},\"MaxPOIStalenessSet(uint256)\":{\"notice\":\"Emitted when the maximum POI staleness is updated\"}},\"kind\":\"user\",\"methods\":{\"allocationProvisionTracker(address)\":{\"notice\":\"Tracks allocated tokens per indexer\"},\"maxPOIStaleness()\":{\"notice\":\"Maximum amount of time, in seconds, allowed between presenting POIs to qualify for indexing rewards\"}},\"notice\":\"A helper contract implementing allocation lifecycle management. Allows opening, resizing, and closing allocations, as well as collecting indexing rewards by presenting a Proof of Indexing (POI).\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/utilities/AllocationManager.sol\":\"AllocationManager\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10},\"remappings\":[]},\"sources\":{\"@graphprotocol/contracts/contracts/arbitrum/ITokenGateway.sol\":{\"keccak256\":\"0x3cbcc6e4629543a99acacc7ee4ffa6c063b9fb17d3597ccd2f9481008e3633bd\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://d6bb0bb830b67d579e57a261e5f5d9e90b32dc006b02badbecf1f6c82c0a5100\",\"dweb:/ipfs/Qmd38iNXZpinwbNRJPEAA8r9bmmtRwjTSK1SkmH47ge4kJ\"]},\"@graphprotocol/contracts/contracts/curation/ICuration.sol\":{\"keccak256\":\"0x17e4db429003cab08cd2859db94b95e0cee1f9478c1881903a4104def8fdc048\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://52ed58228a0e92aeb3493473a6e02f92d26a4e4eb0c46d38dd446e3bfcb6691e\",\"dweb:/ipfs/QmZzWxHAztdz2Q7cobqVEf4ExGpNuqWJFYgs2oHCgApjW6\"]},\"@graphprotocol/contracts/contracts/epochs/IEpochManager.sol\":{\"keccak256\":\"0x0f4b3a3569c023d2610d0d8b37b3ecb0b67f848d77aa063bb311756670017e85\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://df7c43568e554b301134aa2c58e4889ad0d3dcfec40e834b63621a43f39da154\",\"dweb:/ipfs/QmZeSV9AM6FKCkH9QYyF7i5nVggseEJXbvWbtrgUeXqQpo\"]},\"@graphprotocol/contracts/contracts/governance/IController.sol\":{\"keccak256\":\"0xe37df86cdea385d708ba00862cd9e04940e4f2aa50354fb3a9d2d4f505d5509a\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://0f6c9fd2b7a8c5a6b89ef12c7423144df04a5f251d5480be1b73c74a785ff12a\",\"dweb:/ipfs/QmYpiCQoxbDEYQ2FNA39Z4FGfoxfQ8jvH1Z3ccrqguQFMP\"]},\"@graphprotocol/contracts/contracts/rewards/IRewardsIssuer.sol\":{\"keccak256\":\"0xe049090c38a64d80b284ba2a7b440bcedba9804d96f2bb8da525e69ac452e03a\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://8b7d1186bd0698bed02d3504ac80c20e605087fba036d5ff392b39a9a3c818e5\",\"dweb:/ipfs/QmRgAfY1dD5rc7fLuuGVyu2mh9Z8qz1AVvuXAcRGnB3dSv\"]},\"@graphprotocol/contracts/contracts/rewards/IRewardsManager.sol\":{\"keccak256\":\"0xee4b213950c2e46481658b9b04f2d5dae0a96c4cce0ee346188b1f1272718d54\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://b26dd767bd6887666a18beef79c322d27a693a3a4f7a61dc6bded7f35796acf5\",\"dweb:/ipfs/QmXDeqmRSeAWUWQTknNLUPBDBnDr8ySYW4h6CBPRGMJoPp\"]},\"@graphprotocol/contracts/contracts/token/IGraphToken.sol\":{\"keccak256\":\"0x2ffad6798d641c8d1288730be725c43041c803caceaf6d9985122d000ad5761c\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://5f782a5670037fc9223dc20fd4f99c0277a9bec7d08f7800b0a0733e819a07cb\",\"dweb:/ipfs/QmP3K2QnmukScCh1nzgphYdg7AiAuTaT914jq4txLYNpra\"]},\"@graphprotocol/contracts/contracts/utils/TokenUtils.sol\":{\"keccak256\":\"0x7bd336193785ed6f09a3bd847f9208f64aa9b87ad67c40838d00fec41bb153d5\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://d96d83cdb9bbb567e4eafac8bdef3ff6bdaf426338baf76bae277c11afb33cee\",\"dweb:/ipfs/QmNjr4PiJ76Wc5mFqa9H88BjsEMrUfy1jiftNHYTgd6Mp5\"]},\"@graphprotocol/horizon/contracts/data-service/libraries/ProvisionTracker.sol\":{\"keccak256\":\"0xc0f433a20f91fb2c2c588d5accfd311535314d71f7adc4e2b84fa4193ed1a739\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://a920d9446c3e76783921d2f2d980a058f41700de1d59470c9b3892a49ebcaf48\",\"dweb:/ipfs/QmcwmqNkxS1BpJQ7kgf4V9F98w2MKcVvg2N7P3i8KtDSF4\"]},\"@graphprotocol/horizon/contracts/interfaces/IGraphPayments.sol\":{\"keccak256\":\"0xa22dcc47676073113e4ebe30045065662cee5531f9c5f75776c00e70a1929c81\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://8908f30b3c7536798b14dc62fb5ccffc05570d568dbd1bade7c79c1fd2a4b5fe\",\"dweb:/ipfs/QmexZgb5mhDmXVZnYX1Z37cwM7EG2prYyBEVjUSVdKshVr\"]},\"@graphprotocol/horizon/contracts/interfaces/IGraphProxyAdmin.sol\":{\"keccak256\":\"0x4410253d7de56d2cdff50ee141c52fd77fd23f3984440211c3cc90ad560f4f9d\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://da4425a908816c40ffc3c833504843c3732bcb47e745dc544f650e5bc2c23f25\",\"dweb:/ipfs/QmZYDS4cSKBqRXEU3qyjE6sxGModSeNgzQmdZmZCGHuaKt\"]},\"@graphprotocol/horizon/contracts/interfaces/IHorizonStaking.sol\":{\"keccak256\":\"0x4b146f30ee66c4224cb5a82bafc8299f8596d8fe302e793757520f67bba8a166\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://30666c737d72a850223c1966d3b5d02b84f3f808f3c8dae8d0748731646b60c5\",\"dweb:/ipfs/QmQschyZQtU8tTnQ9hNiG5nobuXBx6KeiKdfxvZ4zvQ7ty\"]},\"@graphprotocol/horizon/contracts/interfaces/IPaymentsEscrow.sol\":{\"keccak256\":\"0x99e2a676b539e7b6c223a551f8cb9770c07435a25c8b22f0044a8ce4949edadc\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://f702a3cea214d8328d89a0ef16495c709e30fe13eb86fc29940159c9cb8c7bd5\",\"dweb:/ipfs/QmS25Zgcw85kDZcicApLzRmDcoYNQafpFdMyBEWX8eLWSX\"]},\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingBase.sol\":{\"keccak256\":\"0x9bdab6cb595eabd7d321d7beae03ad3607995c14ef40f0c2f349fb72084766c5\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://6cac2ca3580bd770b98b07b11ebb007e8a922a90cde920e6ec472df7e66fb512\",\"dweb:/ipfs/QmRw1rjT8D8gNp2GRTuwDETwHNHMpHKoHZq4pYBAn9i65F\"]},\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingExtension.sol\":{\"keccak256\":\"0x7923f39746198b5672f0e4d65b7bf14903ae5f7775d74b210effb957eea36c71\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://c29531aff69c71e649fb347d7117ea8c42fc8de09860a1c389ed9b8f097a34e0\",\"dweb:/ipfs/QmS89fww584HiyE1BdPe8Xaqbf5v7FEvL38GTxeHEAsLFm\"]},\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingMain.sol\":{\"keccak256\":\"0xd04bb1f6a427e858e8a625b4b9835c69c8891a324d22beba20293ab2a77e5de7\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://05c9e425eee0b6c109a8dad2edcf9e1c845c64fccf321edf804921394ee048be\",\"dweb:/ipfs/QmbwLWNof534oG5ohzNAWrjdQ5kqJs7M5d5kCRd68XUogB\"]},\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingTypes.sol\":{\"keccak256\":\"0xaaeb9770f8aaae6b395e87bb1876a10fe7c14384d16d97dd33a671c3ea53aa7b\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://8f5c019fdb2df73bafe464fb6e9da792f7833a0c1858734bcd6a6b8d6ae924c7\",\"dweb:/ipfs/QmcubeYTHCYBqQsRncBFpPFtk7JzRz4nFh27LUW1m4hx2K\"]},\"@graphprotocol/horizon/contracts/libraries/LinkedList.sol\":{\"keccak256\":\"0x99058b4da0428b8d9c22d3d112acbaa59900f1fd0a434038b1a4fccfe3c678d6\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://568e03231c6081eacbcb6585a05c0b1bb976b640b611f7bf6155f9b58d887239\",\"dweb:/ipfs/QmdPZQWhkhjf5TUwz487Dwm4ycjX323iNdwb1sQnAiA1Qu\"]},\"@graphprotocol/horizon/contracts/libraries/PPMMath.sol\":{\"keccak256\":\"0xe7fcfd44d2919944b79a11a39da7d4539d49c4bcf510071a59f6b41c37ee8ef2\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://a21b1ff7ca81fa07f153b60aeca136bd1ee57d9d01a2c76635e4a5602e8959fc\",\"dweb:/ipfs/QmQ5C7mUjt4sv1NBt1FH5XVHN3aBsHnvDsdJKWywhLjso8\"]},\"@graphprotocol/horizon/contracts/utilities/GraphDirectory.sol\":{\"keccak256\":\"0x1d09be2f7454873ab80f86ed5d590b9e796fe5146977c4c4a5b1f7ead17eb522\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://e1c7539d26f069c2acabd404601e7811f8878f66976e8b5d4f5438195de793c2\",\"dweb:/ipfs/QmUAybvtDZ275kAnU6r81aQy1FCp7zLscSV87oe9nbwjyU\"]},\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"keccak256\":\"0xdb4d24ee2c087c391d587cd17adfe5b3f9d93b3110b1388c2ab6c7c0ad1dcd05\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://ab7b6d5b9e2b88176312967fe0f0e78f3d9a1422fa5e4b64e2440c35869b5d08\",\"dweb:/ipfs/QmXKYWWyzcLg1B2k7Sb1qkEXgLCYfXecR9wYW5obRzWP1Q\"]},\"@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol\":{\"keccak256\":\"0xd45a5b1d0e451376b08e1bc7e332426c24382053300acf0ac667be1b8abb6cc2\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://824eb0b8c71db8b95b707218d8540c2046a2fefc642e74b343ae90e5c72e2b52\",\"dweb:/ipfs/QmdQTZTomqxRrySDNdv1FEyh3ZWibxwC9FRdcV3DCuASpx\"]},\"@openzeppelin/contracts/interfaces/IERC5267.sol\":{\"keccak256\":\"0x92aa1df62dc3d33f1656d63bede0923e0df0b706ad4137c8b10b0a8fe549fd92\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://c5c0f29195ad64cbe556da8e257dac8f05f78c53f90323c0d2accf8e6922d33a\",\"dweb:/ipfs/QmQ61TED8uaCZwcbh8KkgRSsCav7x7HbcGHwHts3U4DmUP\"]},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0xe06a3f08a987af6ad2e1c1e774405d4fe08f1694b67517438b467cecf0da0ef7\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://df6f0c459663c9858b6cba2cda1d14a7d05a985bed6d2de72bd8e78c25ee79db\",\"dweb:/ipfs/QmeTTxZ7qVk9rjEv2R4CpCwdf8UMCcRqDNMvzNxHc3Fnn9\"]},\"@openzeppelin/contracts/utils/Panic.sol\":{\"keccak256\":\"0xf7fe324703a64fc51702311dc51562d5cb1497734f074e4f483bfb6717572d7a\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://c6a5ff4f9fd8649b7ee20800b7fa387d3465bd77cf20c2d1068cd5c98e1ed57a\",\"dweb:/ipfs/QmVSaVJf9FXFhdYEYeCEfjMVHrxDh5qL4CGkxdMWpQCrqG\"]},\"@openzeppelin/contracts/utils/Strings.sol\":{\"keccak256\":\"0x81c274a60a7ae232ae3dc9ff3a4011b4849a853c13b0832cd3351bb1bb2f0dae\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://9da0c20dc74358a2a76330818f3bac9d1e2ce3371aec847b9cbf5d147fbae4f6\",\"dweb:/ipfs/QmeczhmnFv1hbXKGLwbYXY6Rrytc9a5A2YaRi5QMMgjPnb\"]},\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\":{\"keccak256\":\"0x69f54c02b7d81d505910ec198c11ed4c6a728418a868b906b4a0cf29946fda84\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://8e25e4bdb7ae1f21d23bfee996e22736fc0ab44cfabedac82a757b1edc5623b9\",\"dweb:/ipfs/QmQdWQvB6JCP9ZMbzi8EvQ1PTETqkcTWrbcVurS7DKpa5n\"]},\"@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol\":{\"keccak256\":\"0x26670fef37d4adf55570ba78815eec5f31cb017e708f61886add4fc4da665631\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://b16d45febff462bafd8a5669f904796a835baf607df58a8461916d3bf4f08c59\",\"dweb:/ipfs/QmU2eJFpjmT4vxeJWJyLeQb8Xht1kdB8Y6MKLDPFA9WPux\"]},\"@openzeppelin/contracts/utils/math/Math.sol\":{\"keccak256\":\"0x1225214420c83ebcca88f2ae2b50f053aaa7df7bd684c3e878d334627f2edfc6\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://6c5fab4970634f9ab9a620983dc1c8a30153981a0b1a521666e269d0a11399d3\",\"dweb:/ipfs/QmVRnBC575MESGkEHndjujtR7qub2FzU9RWy9eKLp4hPZB\"]},\"@openzeppelin/contracts/utils/math/SafeCast.sol\":{\"keccak256\":\"0x195533c86d0ef72bcc06456a4f66a9b941f38eb403739b00f21fd7c1abd1ae54\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://b1d578337048cad08c1c03041cca5978eff5428aa130c781b271ad9e5566e1f8\",\"dweb:/ipfs/QmPFKL2r9CBsMwmUqqdcFPfHZB2qcs9g1HDrPxzWSxomvy\"]},\"@openzeppelin/contracts/utils/math/SignedMath.sol\":{\"keccak256\":\"0xb1970fac7b64e6c09611e6691791e848d5e3fe410fa5899e7df2e0afd77a99e3\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://db5fbb3dddd8b7047465b62575d96231ba8a2774d37fb4737fbf23340fabbb03\",\"dweb:/ipfs/QmVUSvooZKEdEdap619tcJjTLcAuH6QBdZqAzWwnAXZAWJ\"]},\"contracts/libraries/Allocation.sol\":{\"keccak256\":\"0xeabed16693ebd22165d4421bb62b91de64553f94d86d6fd03e3d25a62d651000\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://5beecbf35f8dc63fc9fcd5fe844ff29cb4874c1ac73a96ec7170729efd096b74\",\"dweb:/ipfs/QmPFQyxQYuwae8ARxuLxingd8fQ7GBw1cfTQuUvfo6CWhM\"]},\"contracts/libraries/LegacyAllocation.sol\":{\"keccak256\":\"0x32fd54a2823bf3fa4090bf94968b4d8a5988fee8f75d1b805591a744f5766c60\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://2571faaa157c207853cd52e730aaab019384d84618b6dce976b9d794a9634a54\",\"dweb:/ipfs/QmSinKJ1WguxvZte5C3eVfGBo8gsvzTbPQh7uVREWT49uL\"]},\"contracts/utilities/AllocationManager.sol\":{\"keccak256\":\"0xe48e4486cb11da8e2f24afe998ae1f8ab7e2eed0edeff2ff8eb47e120ed32c91\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://0f7336a767d5b959f8cbeb9453834d887c28c9e9e4217d3bacf7faf01aaff33f\",\"dweb:/ipfs/QmQ6twAz4MfREzPbDttCMJqCuo2YNr8ks6R8ZzrJBR3daV\"]},\"contracts/utilities/AllocationManagerStorage.sol\":{\"keccak256\":\"0x45317fa3daef1ebca670b1d3ba19579d7a46b8b19daff7e534a89a122b0fe178\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://ecca9d9581e489225014f8879df4bdd69945f2f686fddeff41e31377670f6866\",\"dweb:/ipfs/QmURUHNSv8i9dtkmdaAJxXqDXfg6hbJXLwUqhHronA8Fwr\"]}},\"version\":1}" + } + }, + "contracts/utilities/AllocationManagerStorage.sol": { + "AllocationManagerV1Storage": { + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + } + ], + "name": "allocationProvisionTracker", + "outputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maxPOIStaleness", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "evm": { + "bytecode": { + "functionDebugData": {}, + "generatedSources": [], + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "deployedBytecode": { + "functionDebugData": {}, + "generatedSources": [], + "immutableReferences": {}, + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "methodIdentifiers": { + "allocationProvisionTracker(address)": "6234e216", + "maxPOIStaleness()": "85e82baf" + } + }, + "metadata": "{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"indexer\",\"type\":\"address\"}],\"name\":\"allocationProvisionTracker\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"maxPOIStaleness\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"custom:security-contact\":\"Please email security+contracts@thegraph.com if you find any bugs. We may have an active bug bounty program.\",\"kind\":\"dev\",\"methods\":{},\"stateVariables\":{\"__gap\":{\"details\":\"Gap to allow adding variables in future upgrades\"},\"_subgraphAllocatedTokens\":{\"details\":\"Used to calculate indexing rewards\"}},\"title\":\"AllocationManagerStorage\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"allocationProvisionTracker(address)\":{\"notice\":\"Tracks allocated tokens per indexer\"},\"maxPOIStaleness()\":{\"notice\":\"Maximum amount of time, in seconds, allowed between presenting POIs to qualify for indexing rewards\"}},\"notice\":\"This contract holds all the storage variables for the Allocation Manager contract.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/utilities/AllocationManagerStorage.sol\":\"AllocationManagerV1Storage\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10},\"remappings\":[]},\"sources\":{\"@graphprotocol/contracts/contracts/rewards/IRewardsIssuer.sol\":{\"keccak256\":\"0xe049090c38a64d80b284ba2a7b440bcedba9804d96f2bb8da525e69ac452e03a\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://8b7d1186bd0698bed02d3504ac80c20e605087fba036d5ff392b39a9a3c818e5\",\"dweb:/ipfs/QmRgAfY1dD5rc7fLuuGVyu2mh9Z8qz1AVvuXAcRGnB3dSv\"]},\"@graphprotocol/horizon/contracts/interfaces/IGraphPayments.sol\":{\"keccak256\":\"0xa22dcc47676073113e4ebe30045065662cee5531f9c5f75776c00e70a1929c81\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://8908f30b3c7536798b14dc62fb5ccffc05570d568dbd1bade7c79c1fd2a4b5fe\",\"dweb:/ipfs/QmexZgb5mhDmXVZnYX1Z37cwM7EG2prYyBEVjUSVdKshVr\"]},\"@graphprotocol/horizon/contracts/interfaces/IHorizonStaking.sol\":{\"keccak256\":\"0x4b146f30ee66c4224cb5a82bafc8299f8596d8fe302e793757520f67bba8a166\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://30666c737d72a850223c1966d3b5d02b84f3f808f3c8dae8d0748731646b60c5\",\"dweb:/ipfs/QmQschyZQtU8tTnQ9hNiG5nobuXBx6KeiKdfxvZ4zvQ7ty\"]},\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingBase.sol\":{\"keccak256\":\"0x9bdab6cb595eabd7d321d7beae03ad3607995c14ef40f0c2f349fb72084766c5\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://6cac2ca3580bd770b98b07b11ebb007e8a922a90cde920e6ec472df7e66fb512\",\"dweb:/ipfs/QmRw1rjT8D8gNp2GRTuwDETwHNHMpHKoHZq4pYBAn9i65F\"]},\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingExtension.sol\":{\"keccak256\":\"0x7923f39746198b5672f0e4d65b7bf14903ae5f7775d74b210effb957eea36c71\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://c29531aff69c71e649fb347d7117ea8c42fc8de09860a1c389ed9b8f097a34e0\",\"dweb:/ipfs/QmS89fww584HiyE1BdPe8Xaqbf5v7FEvL38GTxeHEAsLFm\"]},\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingMain.sol\":{\"keccak256\":\"0xd04bb1f6a427e858e8a625b4b9835c69c8891a324d22beba20293ab2a77e5de7\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://05c9e425eee0b6c109a8dad2edcf9e1c845c64fccf321edf804921394ee048be\",\"dweb:/ipfs/QmbwLWNof534oG5ohzNAWrjdQ5kqJs7M5d5kCRd68XUogB\"]},\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingTypes.sol\":{\"keccak256\":\"0xaaeb9770f8aaae6b395e87bb1876a10fe7c14384d16d97dd33a671c3ea53aa7b\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://8f5c019fdb2df73bafe464fb6e9da792f7833a0c1858734bcd6a6b8d6ae924c7\",\"dweb:/ipfs/QmcubeYTHCYBqQsRncBFpPFtk7JzRz4nFh27LUW1m4hx2K\"]},\"@graphprotocol/horizon/contracts/libraries/LinkedList.sol\":{\"keccak256\":\"0x99058b4da0428b8d9c22d3d112acbaa59900f1fd0a434038b1a4fccfe3c678d6\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://568e03231c6081eacbcb6585a05c0b1bb976b640b611f7bf6155f9b58d887239\",\"dweb:/ipfs/QmdPZQWhkhjf5TUwz487Dwm4ycjX323iNdwb1sQnAiA1Qu\"]},\"@openzeppelin/contracts/utils/Panic.sol\":{\"keccak256\":\"0xf7fe324703a64fc51702311dc51562d5cb1497734f074e4f483bfb6717572d7a\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://c6a5ff4f9fd8649b7ee20800b7fa387d3465bd77cf20c2d1068cd5c98e1ed57a\",\"dweb:/ipfs/QmVSaVJf9FXFhdYEYeCEfjMVHrxDh5qL4CGkxdMWpQCrqG\"]},\"@openzeppelin/contracts/utils/math/Math.sol\":{\"keccak256\":\"0x1225214420c83ebcca88f2ae2b50f053aaa7df7bd684c3e878d334627f2edfc6\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://6c5fab4970634f9ab9a620983dc1c8a30153981a0b1a521666e269d0a11399d3\",\"dweb:/ipfs/QmVRnBC575MESGkEHndjujtR7qub2FzU9RWy9eKLp4hPZB\"]},\"@openzeppelin/contracts/utils/math/SafeCast.sol\":{\"keccak256\":\"0x195533c86d0ef72bcc06456a4f66a9b941f38eb403739b00f21fd7c1abd1ae54\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://b1d578337048cad08c1c03041cca5978eff5428aa130c781b271ad9e5566e1f8\",\"dweb:/ipfs/QmPFKL2r9CBsMwmUqqdcFPfHZB2qcs9g1HDrPxzWSxomvy\"]},\"contracts/libraries/Allocation.sol\":{\"keccak256\":\"0xeabed16693ebd22165d4421bb62b91de64553f94d86d6fd03e3d25a62d651000\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://5beecbf35f8dc63fc9fcd5fe844ff29cb4874c1ac73a96ec7170729efd096b74\",\"dweb:/ipfs/QmPFQyxQYuwae8ARxuLxingd8fQ7GBw1cfTQuUvfo6CWhM\"]},\"contracts/libraries/LegacyAllocation.sol\":{\"keccak256\":\"0x32fd54a2823bf3fa4090bf94968b4d8a5988fee8f75d1b805591a744f5766c60\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://2571faaa157c207853cd52e730aaab019384d84618b6dce976b9d794a9634a54\",\"dweb:/ipfs/QmSinKJ1WguxvZte5C3eVfGBo8gsvzTbPQh7uVREWT49uL\"]},\"contracts/utilities/AllocationManagerStorage.sol\":{\"keccak256\":\"0x45317fa3daef1ebca670b1d3ba19579d7a46b8b19daff7e534a89a122b0fe178\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://ecca9d9581e489225014f8879df4bdd69945f2f686fddeff41e31377670f6866\",\"dweb:/ipfs/QmURUHNSv8i9dtkmdaAJxXqDXfg6hbJXLwUqhHronA8Fwr\"]}},\"version\":1}" + } + }, + "contracts/utilities/AttestationManager.sol": { + "AttestationManager": { + "abi": [ + { + "inputs": [], + "name": "InvalidInitialization", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + } + ], + "evm": { + "bytecode": { + "functionDebugData": {}, + "generatedSources": [], + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "deployedBytecode": { + "functionDebugData": {}, + "generatedSources": [], + "immutableReferences": {}, + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "methodIdentifiers": {} + }, + "metadata": "{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"name\":\"InvalidInitialization\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotInitializing\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"version\",\"type\":\"uint64\"}],\"name\":\"Initialized\",\"type\":\"event\"}],\"devdoc\":{\"custom:security-contact\":\"Please email security+contracts@thegraph.com if you find any bugs. We may have an active bug bounty program.\",\"errors\":{\"InvalidInitialization()\":[{\"details\":\"The contract is already initialized.\"}],\"NotInitializing()\":[{\"details\":\"The contract is not initializing.\"}]},\"events\":{\"Initialized(uint64)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"}},\"kind\":\"dev\",\"methods\":{},\"title\":\"AttestationManager contract\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"notice\":\"A helper contract implementing attestation verification. Uses a custom implementation of EIP712 for backwards compatibility with attestations.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/utilities/AttestationManager.sol\":\"AttestationManager\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"keccak256\":\"0xdb4d24ee2c087c391d587cd17adfe5b3f9d93b3110b1388c2ab6c7c0ad1dcd05\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://ab7b6d5b9e2b88176312967fe0f0e78f3d9a1422fa5e4b64e2440c35869b5d08\",\"dweb:/ipfs/QmXKYWWyzcLg1B2k7Sb1qkEXgLCYfXecR9wYW5obRzWP1Q\"]},\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\":{\"keccak256\":\"0x69f54c02b7d81d505910ec198c11ed4c6a728418a868b906b4a0cf29946fda84\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://8e25e4bdb7ae1f21d23bfee996e22736fc0ab44cfabedac82a757b1edc5623b9\",\"dweb:/ipfs/QmQdWQvB6JCP9ZMbzi8EvQ1PTETqkcTWrbcVurS7DKpa5n\"]},\"contracts/libraries/Attestation.sol\":{\"keccak256\":\"0x0976f586d532d479823ac9e049371742a7a876f0faf3ed722b3b7f78a4586f33\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://34baba14bd7d3dcb1e1111ee09f3c809d6876732bbc889c1486cc329465e711e\",\"dweb:/ipfs/QmPRgYduW85aCjVk4ih35jB2FhoLjBvgmjZtMGeqXaLhTW\"]},\"contracts/utilities/AttestationManager.sol\":{\"keccak256\":\"0x44218c9dd0d618b0e383cad19efd5846ec85d1a11270aa7c04b75e2fa7ddc3a4\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://ee8ca0b9b9746636ff1ad549081fbc176d959544bc7798d0bfb10e3ec61af8b7\",\"dweb:/ipfs/QmcE9RJqj32uoTsWLV2ffwuEPWnBh7Vn8ZpzorXBjgosGd\"]},\"contracts/utilities/AttestationManagerStorage.sol\":{\"keccak256\":\"0x3ae176c9166fac5bfb08e875ad132fe9d1559ce67df28b906683d4f168e1afdc\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://2b40d4be47cc74387e3c390e081bdadc84f84062e9708a7a84d73f02e0a3853a\",\"dweb:/ipfs/QmQL8DUzrtgQABb1CvcuSeuapXntXEh5aKi4ZjE3MssBgZ\"]}},\"version\":1}" + } + }, + "contracts/utilities/AttestationManagerStorage.sol": { + "AttestationManagerV1Storage": { + "abi": [], + "evm": { + "bytecode": { + "functionDebugData": {}, + "generatedSources": [], + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "deployedBytecode": { + "functionDebugData": {}, + "generatedSources": [], + "immutableReferences": {}, + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "methodIdentifiers": {} + }, + "metadata": "{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"custom:security-contact\":\"Please email security+contracts@thegraph.com if you find any bugs. We may have an active bug bounty program.\",\"kind\":\"dev\",\"methods\":{},\"stateVariables\":{\"__gap\":{\"details\":\"Gap to allow adding variables in future upgrades\"},\"_domainSeparator\":{\"details\":\"EIP712 domain separator\"}},\"title\":\"AttestationManagerStorage\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"notice\":\"This contract holds all the storage variables for the Attestation Manager contract.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/utilities/AttestationManagerStorage.sol\":\"AttestationManagerV1Storage\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10},\"remappings\":[]},\"sources\":{\"contracts/utilities/AttestationManagerStorage.sol\":{\"keccak256\":\"0x3ae176c9166fac5bfb08e875ad132fe9d1559ce67df28b906683d4f168e1afdc\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://2b40d4be47cc74387e3c390e081bdadc84f84062e9708a7a84d73f02e0a3853a\",\"dweb:/ipfs/QmQL8DUzrtgQABb1CvcuSeuapXntXEh5aKi4ZjE3MssBgZ\"]}},\"version\":1}" + } + }, + "contracts/utilities/Directory.sol": { + "Directory": { + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "internalType": "address", + "name": "disputeManager", + "type": "address" + } + ], + "name": "DirectoryNotDisputeManager", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "subgraphService", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "disputeManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphTallyCollector", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "curation", + "type": "address" + } + ], + "name": "SubgraphServiceDirectoryInitialized", + "type": "event" + } + ], + "evm": { + "bytecode": { + "functionDebugData": {}, + "generatedSources": [], + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "deployedBytecode": { + "functionDebugData": {}, + "generatedSources": [], + "immutableReferences": {}, + "linkReferences": {}, + "object": "", + "opcodes": "", + "sourceMap": "" + }, + "methodIdentifiers": {} + }, + "metadata": "{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"disputeManager\",\"type\":\"address\"}],\"name\":\"DirectoryNotDisputeManager\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"subgraphService\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"disputeManager\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"graphTallyCollector\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"curation\",\"type\":\"address\"}],\"name\":\"SubgraphServiceDirectoryInitialized\",\"type\":\"event\"}],\"devdoc\":{\"custom:security-contact\":\"Please email security+contracts@thegraph.com if you find any bugs. We may have an active bug bounty program.\",\"errors\":{\"DirectoryNotDisputeManager(address,address)\":[{\"params\":{\"caller\":\"The caller address\",\"disputeManager\":\"The Dispute Manager address\"}}]},\"events\":{\"SubgraphServiceDirectoryInitialized(address,address,address,address)\":{\"params\":{\"curation\":\"The Curation contract address\",\"disputeManager\":\"The Dispute Manager contract address\",\"graphTallyCollector\":\"The Graph Tally Collector contract address\",\"subgraphService\":\"The Subgraph Service contract address\"}}},\"kind\":\"dev\",\"methods\":{\"constructor\":{\"params\":{\"curation\":\"The Curation contract address\",\"disputeManager\":\"The Dispute Manager contract address\",\"graphTallyCollector\":\"The Graph Tally Collector contract address\",\"subgraphService\":\"The Subgraph Service contract address\"}}},\"stateVariables\":{\"CURATION\":{\"details\":\"Required for curation fees distribution\"},\"GRAPH_TALLY_COLLECTOR\":{\"details\":\"Required to collect payments via Graph Horizon payments protocol\"}},\"title\":\"Directory contract\",\"version\":1},\"userdoc\":{\"errors\":{\"DirectoryNotDisputeManager(address,address)\":[{\"notice\":\"Thrown when the caller is not the Dispute Manager\"}]},\"events\":{\"SubgraphServiceDirectoryInitialized(address,address,address,address)\":{\"notice\":\"Emitted when the Directory is initialized\"}},\"kind\":\"user\",\"methods\":{\"constructor\":{\"notice\":\"Constructor for the Directory contract\"}},\"notice\":\"This contract is meant to be inherited by {SubgraphService} contract. It contains the addresses of the contracts that the contract interacts with. Uses immutable variables to minimize gas costs.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/utilities/Directory.sol\":\"Directory\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10},\"remappings\":[]},\"sources\":{\"@graphprotocol/contracts/contracts/curation/ICuration.sol\":{\"keccak256\":\"0x17e4db429003cab08cd2859db94b95e0cee1f9478c1881903a4104def8fdc048\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://52ed58228a0e92aeb3493473a6e02f92d26a4e4eb0c46d38dd446e3bfcb6691e\",\"dweb:/ipfs/QmZzWxHAztdz2Q7cobqVEf4ExGpNuqWJFYgs2oHCgApjW6\"]},\"@graphprotocol/contracts/contracts/rewards/IRewardsIssuer.sol\":{\"keccak256\":\"0xe049090c38a64d80b284ba2a7b440bcedba9804d96f2bb8da525e69ac452e03a\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://8b7d1186bd0698bed02d3504ac80c20e605087fba036d5ff392b39a9a3c818e5\",\"dweb:/ipfs/QmRgAfY1dD5rc7fLuuGVyu2mh9Z8qz1AVvuXAcRGnB3dSv\"]},\"@graphprotocol/horizon/contracts/data-service/interfaces/IDataService.sol\":{\"keccak256\":\"0x2208814f64eeca9409eafc1a1fa425c67ff38cffdffc3af0bafbe1c1b338ed32\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://925b32efbd9fe85a98f8f1f51e865e0b7b65d933196cf6c098bd670da7138e0c\",\"dweb:/ipfs/Qmdrp7BGJ4fEKzDgZpVY1FULXKsHAdGXkx4nqRrWvMaumr\"]},\"@graphprotocol/horizon/contracts/data-service/interfaces/IDataServiceFees.sol\":{\"keccak256\":\"0x1b82ae2785502fe62d3ca6f55a3ed836b8b038a3b929cced92e1c6b4733f4074\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://5556b2ce53b604427a995fb50f7169acb3fe30f60ef19c7cb5c22bd5ec53177c\",\"dweb:/ipfs/QmXx7dmTeAYAMPbbrGrcsKT31dqEqbcFgXWaPS6LQrANru\"]},\"@graphprotocol/horizon/contracts/interfaces/IGraphPayments.sol\":{\"keccak256\":\"0xa22dcc47676073113e4ebe30045065662cee5531f9c5f75776c00e70a1929c81\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://8908f30b3c7536798b14dc62fb5ccffc05570d568dbd1bade7c79c1fd2a4b5fe\",\"dweb:/ipfs/QmexZgb5mhDmXVZnYX1Z37cwM7EG2prYyBEVjUSVdKshVr\"]},\"@graphprotocol/horizon/contracts/interfaces/IGraphTallyCollector.sol\":{\"keccak256\":\"0x762c26300d098fb1bdc5e6b52e0ffd0b497634e9bcfc9a9cd409df65d8d54590\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://f5c68742e96c1483449c882b082631a9bfafebb27152b87427e1234d34e604f3\",\"dweb:/ipfs/QmYqtSeQpCbKEaKKDXwmeK5DrYFiwSHYVzM3dzanh7MQ3D\"]},\"@graphprotocol/horizon/contracts/interfaces/IHorizonStaking.sol\":{\"keccak256\":\"0x4b146f30ee66c4224cb5a82bafc8299f8596d8fe302e793757520f67bba8a166\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://30666c737d72a850223c1966d3b5d02b84f3f808f3c8dae8d0748731646b60c5\",\"dweb:/ipfs/QmQschyZQtU8tTnQ9hNiG5nobuXBx6KeiKdfxvZ4zvQ7ty\"]},\"@graphprotocol/horizon/contracts/interfaces/IPaymentsCollector.sol\":{\"keccak256\":\"0x0871e02129e1fabdb39024f9ac3368b4c747e6b374fdf4fc200d3c225ed82860\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://a5fdf2dbedc15f739e6010a3ce3478ea7ad23bd643a8af3f39ccf631c06ebd52\",\"dweb:/ipfs/QmNusbPTqzzUwGomXBzsWHwbZMJ2HuTkxvgviLJZ6hr9i4\"]},\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingBase.sol\":{\"keccak256\":\"0x9bdab6cb595eabd7d321d7beae03ad3607995c14ef40f0c2f349fb72084766c5\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://6cac2ca3580bd770b98b07b11ebb007e8a922a90cde920e6ec472df7e66fb512\",\"dweb:/ipfs/QmRw1rjT8D8gNp2GRTuwDETwHNHMpHKoHZq4pYBAn9i65F\"]},\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingExtension.sol\":{\"keccak256\":\"0x7923f39746198b5672f0e4d65b7bf14903ae5f7775d74b210effb957eea36c71\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://c29531aff69c71e649fb347d7117ea8c42fc8de09860a1c389ed9b8f097a34e0\",\"dweb:/ipfs/QmS89fww584HiyE1BdPe8Xaqbf5v7FEvL38GTxeHEAsLFm\"]},\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingMain.sol\":{\"keccak256\":\"0xd04bb1f6a427e858e8a625b4b9835c69c8891a324d22beba20293ab2a77e5de7\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://05c9e425eee0b6c109a8dad2edcf9e1c845c64fccf321edf804921394ee048be\",\"dweb:/ipfs/QmbwLWNof534oG5ohzNAWrjdQ5kqJs7M5d5kCRd68XUogB\"]},\"@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingTypes.sol\":{\"keccak256\":\"0xaaeb9770f8aaae6b395e87bb1876a10fe7c14384d16d97dd33a671c3ea53aa7b\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://8f5c019fdb2df73bafe464fb6e9da792f7833a0c1858734bcd6a6b8d6ae924c7\",\"dweb:/ipfs/QmcubeYTHCYBqQsRncBFpPFtk7JzRz4nFh27LUW1m4hx2K\"]},\"@graphprotocol/horizon/contracts/libraries/LinkedList.sol\":{\"keccak256\":\"0x99058b4da0428b8d9c22d3d112acbaa59900f1fd0a434038b1a4fccfe3c678d6\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://568e03231c6081eacbcb6585a05c0b1bb976b640b611f7bf6155f9b58d887239\",\"dweb:/ipfs/QmdPZQWhkhjf5TUwz487Dwm4ycjX323iNdwb1sQnAiA1Qu\"]},\"@openzeppelin/contracts/utils/Panic.sol\":{\"keccak256\":\"0xf7fe324703a64fc51702311dc51562d5cb1497734f074e4f483bfb6717572d7a\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://c6a5ff4f9fd8649b7ee20800b7fa387d3465bd77cf20c2d1068cd5c98e1ed57a\",\"dweb:/ipfs/QmVSaVJf9FXFhdYEYeCEfjMVHrxDh5qL4CGkxdMWpQCrqG\"]},\"@openzeppelin/contracts/utils/math/Math.sol\":{\"keccak256\":\"0x1225214420c83ebcca88f2ae2b50f053aaa7df7bd684c3e878d334627f2edfc6\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://6c5fab4970634f9ab9a620983dc1c8a30153981a0b1a521666e269d0a11399d3\",\"dweb:/ipfs/QmVRnBC575MESGkEHndjujtR7qub2FzU9RWy9eKLp4hPZB\"]},\"@openzeppelin/contracts/utils/math/SafeCast.sol\":{\"keccak256\":\"0x195533c86d0ef72bcc06456a4f66a9b941f38eb403739b00f21fd7c1abd1ae54\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://b1d578337048cad08c1c03041cca5978eff5428aa130c781b271ad9e5566e1f8\",\"dweb:/ipfs/QmPFKL2r9CBsMwmUqqdcFPfHZB2qcs9g1HDrPxzWSxomvy\"]},\"contracts/interfaces/IDisputeManager.sol\":{\"keccak256\":\"0x9db8ffdf7fe30954824ed706a1a5e7c2d6323b745bddba16b7166a639344f9f7\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://e5d810bf6188c38a028dab511c5653fde7b7feca0a173f03974402a83cb234f9\",\"dweb:/ipfs/QmYGtytqHeDFK91FmSNL5iavD8sHUFcA47WBU9BuHG3i75\"]},\"contracts/interfaces/ISubgraphService.sol\":{\"keccak256\":\"0x7516f80b0a8b2e3edeedf06c9b917f2a24e557f8c00632e6150fbb41ef8da3ce\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://ad4f813111541f5ef9ea6236f42822a3a66364d24189e4568450b20e09972a5e\",\"dweb:/ipfs/QmVYQA9rT7T8YnQgAB6fokNYDJeDrgQqrjfJ8sGjySNFBo\"]},\"contracts/libraries/Allocation.sol\":{\"keccak256\":\"0xeabed16693ebd22165d4421bb62b91de64553f94d86d6fd03e3d25a62d651000\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://5beecbf35f8dc63fc9fcd5fe844ff29cb4874c1ac73a96ec7170729efd096b74\",\"dweb:/ipfs/QmPFQyxQYuwae8ARxuLxingd8fQ7GBw1cfTQuUvfo6CWhM\"]},\"contracts/libraries/Attestation.sol\":{\"keccak256\":\"0x0976f586d532d479823ac9e049371742a7a876f0faf3ed722b3b7f78a4586f33\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://34baba14bd7d3dcb1e1111ee09f3c809d6876732bbc889c1486cc329465e711e\",\"dweb:/ipfs/QmPRgYduW85aCjVk4ih35jB2FhoLjBvgmjZtMGeqXaLhTW\"]},\"contracts/libraries/LegacyAllocation.sol\":{\"keccak256\":\"0x32fd54a2823bf3fa4090bf94968b4d8a5988fee8f75d1b805591a744f5766c60\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://2571faaa157c207853cd52e730aaab019384d84618b6dce976b9d794a9634a54\",\"dweb:/ipfs/QmSinKJ1WguxvZte5C3eVfGBo8gsvzTbPQh7uVREWT49uL\"]},\"contracts/utilities/Directory.sol\":{\"keccak256\":\"0x8f8b8d8dd7cd1acee659a21c81782fd9955f364c5b37669c11c135c66371bd3a\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://c50bdf51e6d19d6413920c200b5ddbf07eaa3860b35822633cecf636fd96d29d\",\"dweb:/ipfs/QmTQfCXiKzqpZVJDd3NeLtQvwBTVDXfznVJjEASh4aso4k\"]}},\"version\":1}" + } + } + } + } +} \ No newline at end of file diff --git a/packages/subgraph-service/ignition/deployments/chain-421614/deployed_addresses.json b/packages/subgraph-service/ignition/deployments/chain-421614/deployed_addresses.json new file mode 100644 index 000000000..e8c9f57aa --- /dev/null +++ b/packages/subgraph-service/ignition/deployments/chain-421614/deployed_addresses.json @@ -0,0 +1,56 @@ +{ + "SubgraphServiceProxies#OZProxyDummy_DisputeManager": "0x6b4F986A7a7E97E233Cb30172aAc5d1f68C1869a", + "SubgraphServiceProxies#OZProxyDummy_SubgraphService": "0x3E0C10883B120D3Cd2Ae5d78265204eDb68c434f", + "SubgraphServiceProxies#TransparentUpgradeableProxy_DisputeManager": "0x1A7Fb71014d4395903eC56662f32dD02344D361C", + "SubgraphServiceProxies#TransparentUpgradeableProxy_SubgraphService": "0x00fe8F95407AB61863d27c07F584A0930ee5F3b0", + "SubgraphServiceProxies#DisputeManager_ProxyWithABI": "0x1A7Fb71014d4395903eC56662f32dD02344D361C", + "SubgraphServiceProxies#SubgraphService_ProxyWithABI": "0x00fe8F95407AB61863d27c07F584A0930ee5F3b0", + "SubgraphServiceProxies#ProxyAdmin_DisputeManager": "0x9a8C3B6D649108bd11670de0B9b981ae3C167707", + "SubgraphServiceProxies#ProxyAdmin_SubgraphService": "0xD23a972f47B7D45E729AB9B8399D628c87b6C0d6", + "Controller#Controller": "0x0750EdA3185C758247E97819074bCD217a815FaE", + "EpochManager#EpochManager": "0x450906A976dc21450A7CcD1989D26E137E605B91", + "GraphProxyAdmin#GraphProxyAdmin": "0x1CEBe1C314Cc454baf4bd553409d957C833623c0", + "HorizonProxies#OZProxyDummy_GraphPayments": "0x8A44C49eD477e7130249d4B8d5248d08B469Bf0d", + "HorizonProxies#OZProxyDummy_PaymentsEscrow": "0xBaBe8F24fFB27fb01C5b66999Db6929E5d500C70", + "HorizonStaking#ExponentialRebates": "0xF2DB533658a1728f3ce04A49Df4b545f4A53b620", + "L2Curation#GraphCurationToken": "0xb85d6e91EeAdDc35927AF34e5E28428282e4bcF2", + "L2Curation#L2Curation": "0x9CCD9B656f8A558879974ef2505496eEd7Ef7210", + "L2GraphToken#L2GraphToken": "0x71927f8Ff0ce294882e2A161A54F62f3b0f3c726", + "L2GraphTokenGateway#L2GraphTokenGateway": "0x4dEA2d1Be05909B71F539FD32601F7bd736c28D4", + "RewardsManager#RewardsManager": "0x05Ca4d407ec53Ac17ce6Bb414f42663f415Dc5C3", + "HorizonProxies#TransparentUpgradeableProxy_GraphPayments": "0xAFd60629034fBdC3ef58518B817bBDB4EC861c93", + "HorizonProxies#TransparentUpgradeableProxy_PaymentsEscrow": "0x70d5AFAAaEF8f2F095E83D6E6151146c18A5Bb85", + "HorizonProxies#GraphPayments_ProxyWithABI": "0xAFd60629034fBdC3ef58518B817bBDB4EC861c93", + "HorizonProxies#PaymentsEscrow_ProxyWithABI": "0x70d5AFAAaEF8f2F095E83D6E6151146c18A5Bb85", + "EpochManager#GraphProxy": "0xAA1DeBfb7A7c0Ba85cef858B6E70cFad943Fd4A2", + "HorizonProxies#GraphProxy": "0xF5D432192dAF7e8B045349693577ccF0B5165A12", + "L2Curation#GraphProxy": "0xe135BFD9E51BbAfCeBb0141af85F0bc6DA1b3BA4", + "L2GraphToken#GraphProxy": "0xBBcb9a575176039C06F94d4d8337818318A26828", + "L2GraphTokenGateway#GraphProxy": "0x7284213d1cDa80C892a4388f38dA431F06343144", + "RewardsManager#GraphProxy": "0x1AB05a65fa6D5F6a90A23693D5d40A4D927a815f", + "EpochManager#EpochManager_ProxyWithABI": "0xAA1DeBfb7A7c0Ba85cef858B6E70cFad943Fd4A2", + "HorizonProxies#ProxyAdmin_GraphPayments": "0xAcA3dd622e863E425Cdb15E8734a5CB318448db7", + "HorizonProxies#ProxyAdmin_PaymentsEscrow": "0xbB643167f03EfF532c537e3d72E56b9992CaD985", + "L2Curation#L2Curation_ProxyWithABI": "0xe135BFD9E51BbAfCeBb0141af85F0bc6DA1b3BA4", + "L2GraphToken#L2GraphToken_ProxyWithABI": "0xBBcb9a575176039C06F94d4d8337818318A26828", + "L2GraphTokenGateway#L2GraphTokenGateway_ProxyWithABI": "0x7284213d1cDa80C892a4388f38dA431F06343144", + "RewardsManager#RewardsManager_ProxyWithABI": "0x1AB05a65fa6D5F6a90A23693D5d40A4D927a815f", + "GraphPayments#GraphPayments": "0x4756cdF556A78BD28399E833Bc5bBFc7a5bca866", + "GraphTallyCollector#GraphTallyCollector": "0xB63bC33D13F73eFD14d32D2b9FC0B6116B6611CE", + "HorizonStaking#HorizonStakingExtension": "0x37F125cF456CD8d24277033A3b583491E9003689", + "PaymentsEscrow#PaymentsEscrow": "0xeED33B904efF05BbdcC9008F5174088DF77dD183", + "HorizonStaking#HorizonStaking": "0xa9B5CD0E94eBDf5A6dBB16A01635D432AB707244", + "GraphPayments#GraphPayments_ProxyWithABI": "0xAFd60629034fBdC3ef58518B817bBDB4EC861c93", + "PaymentsEscrow#PaymentsEscrow_ProxyWithABI": "0x70d5AFAAaEF8f2F095E83D6E6151146c18A5Bb85", + "HorizonStaking#HorizonStaking_ProxyWithABI": "0xF5D432192dAF7e8B045349693577ccF0B5165A12", + "DisputeManager#DisputeManagerProxy": "0x1A7Fb71014d4395903eC56662f32dD02344D361C", + "DisputeManager#ProxyAdmin": "0x9a8C3B6D649108bd11670de0B9b981ae3C167707", + "L2Curation#L2CurationAddressBook": "0xe135BFD9E51BbAfCeBb0141af85F0bc6DA1b3BA4", + "L2Curation#L2CurationImplementationAddressBook": "0x9CCD9B656f8A558879974ef2505496eEd7Ef7210", + "SubgraphService#ProxyAdmin": "0xD23a972f47B7D45E729AB9B8399D628c87b6C0d6", + "SubgraphService#SubgraphServiceProxy": "0x00fe8F95407AB61863d27c07F584A0930ee5F3b0", + "DisputeManager#DisputeManager": "0x75f7Bd9D2F0bca7bA7189BB582f5eb95afa051e8", + "SubgraphService#SubgraphService": "0x30b34eAaF354cAdd64836Bc0846F4414254271ea", + "DisputeManager#DisputeManager_ProxyWithABI": "0x1A7Fb71014d4395903eC56662f32dD02344D361C", + "SubgraphService#SubgraphService_ProxyWithABI": "0x00fe8F95407AB61863d27c07F584A0930ee5F3b0" +} diff --git a/packages/subgraph-service/ignition/deployments/chain-421614/journal.jsonl b/packages/subgraph-service/ignition/deployments/chain-421614/journal.jsonl new file mode 100644 index 000000000..d6f3d98ea --- /dev/null +++ b/packages/subgraph-service/ignition/deployments/chain-421614/journal.jsonl @@ -0,0 +1,513 @@ + +{"chainId":421614,"type":"DEPLOYMENT_INITIALIZE"} +{"artifactId":"SubgraphServiceProxies#OZProxyDummy_DisputeManager","constructorArgs":[],"contractName":"Dummy","dependencies":[],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","futureId":"SubgraphServiceProxies#OZProxyDummy_DisputeManager","futureType":"CONTRACT_DEPLOYMENT","libraries":{},"strategy":"basic","strategyConfig":{},"type":"DEPLOYMENT_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"SubgraphServiceProxies#OZProxyDummy_DisputeManager","networkInteraction":{"data":"0x6080604052348015600f57600080fd5b50603f80601d6000396000f3fe6080604052600080fdfea264697066735822122081eeeeb2e55704976a5bd19451809712b1b76b2d5b7a994dc02b32128a829da764736f6c634300081b0033","id":1,"type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"SubgraphServiceProxies#OZProxyDummy_DisputeManager","networkInteractionId":1,"nonce":1582,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"SubgraphServiceProxies#OZProxyDummy_DisputeManager","networkInteractionId":1,"nonce":1582,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0x4a914684ac2dae92b72d40b48120d482cd26967c0e3c4a042e3d593e2adcccc8"},"type":"TRANSACTION_SEND"} +{"artifactId":"SubgraphServiceProxies#OZProxyDummy_SubgraphService","constructorArgs":[],"contractName":"Dummy","dependencies":[],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","futureId":"SubgraphServiceProxies#OZProxyDummy_SubgraphService","futureType":"CONTRACT_DEPLOYMENT","libraries":{},"strategy":"basic","strategyConfig":{},"type":"DEPLOYMENT_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"SubgraphServiceProxies#OZProxyDummy_SubgraphService","networkInteraction":{"data":"0x6080604052348015600f57600080fd5b50603f80601d6000396000f3fe6080604052600080fdfea264697066735822122081eeeeb2e55704976a5bd19451809712b1b76b2d5b7a994dc02b32128a829da764736f6c634300081b0033","id":1,"type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"SubgraphServiceProxies#OZProxyDummy_SubgraphService","networkInteractionId":1,"nonce":1583,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"SubgraphServiceProxies#OZProxyDummy_SubgraphService","networkInteractionId":1,"nonce":1583,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0xb1224fe72f112a7c484049e570aa9b924d289c4898da9ce21e25cdd51551175e"},"type":"TRANSACTION_SEND"} +{"futureId":"SubgraphServiceProxies#OZProxyDummy_DisputeManager","hash":"0x4a914684ac2dae92b72d40b48120d482cd26967c0e3c4a042e3d593e2adcccc8","networkInteractionId":1,"receipt":{"blockHash":"0x97f4dcd56e8c444a56a123f11486e8b48e361620c6628b80c83ea5d721e469c2","blockNumber":152512294,"contractAddress":"0x6b4F986A7a7E97E233Cb30172aAc5d1f68C1869a","logs":[],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"SubgraphServiceProxies#OZProxyDummy_DisputeManager","result":{"address":"0x6b4F986A7a7E97E233Cb30172aAc5d1f68C1869a","type":"SUCCESS"},"type":"DEPLOYMENT_EXECUTION_STATE_COMPLETE"} +{"futureId":"SubgraphServiceProxies#OZProxyDummy_SubgraphService","hash":"0xb1224fe72f112a7c484049e570aa9b924d289c4898da9ce21e25cdd51551175e","networkInteractionId":1,"receipt":{"blockHash":"0xc1bc099664d1d40c84e2535598a0a178d1f3f4e996d2b1c7b66c82d6eb5ea541","blockNumber":152512306,"contractAddress":"0x3E0C10883B120D3Cd2Ae5d78265204eDb68c434f","logs":[],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"SubgraphServiceProxies#OZProxyDummy_SubgraphService","result":{"address":"0x3E0C10883B120D3Cd2Ae5d78265204eDb68c434f","type":"SUCCESS"},"type":"DEPLOYMENT_EXECUTION_STATE_COMPLETE"} +{"artifactId":"SubgraphServiceProxies#TransparentUpgradeableProxy_DisputeManager","constructorArgs":["0x6b4F986A7a7E97E233Cb30172aAc5d1f68C1869a","0xade6b8eb69a49b56929c1d4f4b428d791861db6f","0x"],"contractName":"TransparentUpgradeableProxy","dependencies":["SubgraphServiceProxies#OZProxyDummy_DisputeManager"],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","futureId":"SubgraphServiceProxies#TransparentUpgradeableProxy_DisputeManager","futureType":"CONTRACT_DEPLOYMENT","libraries":{},"strategy":"basic","strategyConfig":{},"type":"DEPLOYMENT_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"SubgraphServiceProxies#TransparentUpgradeableProxy_DisputeManager","networkInteraction":{"data":"0x60a0604052604051610eae380380610eae8339810160408190526100229161039d565b828161002e828261008f565b50508160405161003d9061033a565b6001600160a01b039091168152602001604051809103906000f080158015610069573d6000803e3d6000fd5b506001600160a01b031660805261008761008260805190565b6100ee565b50505061048f565b6100988261015c565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a28051156100e2576100dd82826101db565b505050565b6100ea610252565b5050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61012e600080516020610e8e833981519152546001600160a01b031690565b604080516001600160a01b03928316815291841660208301520160405180910390a161015981610273565b50565b806001600160a01b03163b60000361019757604051634c9c8ce360e01b81526001600160a01b03821660048201526024015b60405180910390fd5b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5b80546001600160a01b0319166001600160a01b039290921691909117905550565b6060600080846001600160a01b0316846040516101f89190610473565b600060405180830381855af49150503d8060008114610233576040519150601f19603f3d011682016040523d82523d6000602084013e610238565b606091505b5090925090506102498583836102b2565b95945050505050565b34156102715760405163b398979f60e01b815260040160405180910390fd5b565b6001600160a01b03811661029d57604051633173bdd160e11b81526000600482015260240161018e565b80600080516020610e8e8339815191526101ba565b6060826102c7576102c282610311565b61030a565b81511580156102de57506001600160a01b0384163b155b1561030757604051639996b31560e01b81526001600160a01b038516600482015260240161018e565b50805b9392505050565b8051156103215780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b6105538061093b83390190565b80516001600160a01b038116811461035e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561039457818101518382015260200161037c565b50506000910152565b6000806000606084860312156103b257600080fd5b6103bb84610347565b92506103c960208501610347565b60408501519092506001600160401b038111156103e557600080fd5b8401601f810186136103f657600080fd5b80516001600160401b0381111561040f5761040f610363565b604051601f8201601f19908116603f011681016001600160401b038111828210171561043d5761043d610363565b60405281815282820160200188101561045557600080fd5b610466826020830160208601610379565b8093505050509250925092565b60008251610485818460208701610379565b9190910192915050565b6080516104926104a96000396000601001526104926000f3fe608060405261000c61000e565b005b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316330361007b576000356001600160e01b03191663278f794360e11b14610071576040516334ad5dbb60e21b815260040160405180910390fd5b610079610083565b565b6100796100b2565b6000806100933660048184610304565b8101906100a09190610344565b915091506100ae82826100c2565b5050565b6100796100bd61011d565b610155565b6100cb82610179565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a28051156101155761011082826101f0565b505050565b6100ae610266565b60006101507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b3660008037600080366000845af43d6000803e808015610174573d6000f35b3d6000fd5b806001600160a01b03163b6000036101af5780604051634c9c8ce360e01b81526004016101a69190610419565b60405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080846001600160a01b03168460405161020d919061042d565b600060405180830381855af49150503d8060008114610248576040519150601f19603f3d011682016040523d82523d6000602084013e61024d565b606091505b509150915061025d858383610285565b95945050505050565b34156100795760405163b398979f60e01b815260040160405180910390fd5b60608261029a57610295826102db565b6102d4565b81511580156102b157506001600160a01b0384163b155b156102d15783604051639996b31560e01b81526004016101a69190610419565b50805b9392505050565b8051156102eb5780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b6000808585111561031457600080fd5b8386111561032157600080fd5b5050820193919092039150565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561035757600080fd5b82356001600160a01b038116811461036e57600080fd5b915060208301356001600160401b0381111561038957600080fd5b8301601f8101851361039a57600080fd5b80356001600160401b038111156103b3576103b361032e565b604051601f8201601f19908116603f011681016001600160401b03811182821017156103e1576103e161032e565b6040528181528282016020018710156103f957600080fd5b816020840160208301376000602083830101528093505050509250929050565b6001600160a01b0391909116815260200190565b6000825160005b8181101561044e5760208186018101518583015201610434565b50600092019182525091905056fea2646970667358221220079092acd5c0b5783781c6719b8677b2804315edab5ec07af0a0f7a7a9b7803c64736f6c634300081b0033608060405234801561001057600080fd5b5060405161055338038061055383398101604081905261002f916100be565b806001600160a01b03811661005e57604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b6100678161006e565b50506100ee565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000602082840312156100d057600080fd5b81516001600160a01b03811681146100e757600080fd5b9392505050565b610456806100fd6000396000f3fe60806040526004361061004a5760003560e01c8063715018a61461004f5780638da5cb5b146100665780639623609d14610091578063ad3cb1cc146100a4578063f2fde38b146100e2575b600080fd5b34801561005b57600080fd5b50610064610102565b005b34801561007257600080fd5b5061007b610116565b604051610088919061025d565b60405180910390f35b61006461009f36600461029c565b610125565b3480156100b057600080fd5b506100d5604051806040016040528060058152602001640352e302e360dc1b81525081565b60405161008891906103bd565b3480156100ee57600080fd5b506100646100fd3660046103d7565b610194565b61010a6101db565b610114600061020d565b565b6000546001600160a01b031690565b61012d6101db565b60405163278f794360e11b81526001600160a01b03841690634f1ef28690349061015d90869086906004016103f4565b6000604051808303818588803b15801561017657600080fd5b505af115801561018a573d6000803e3d6000fd5b5050505050505050565b61019c6101db565b6001600160a01b0381166101cf576000604051631e4fbdf760e01b81526004016101c6919061025d565b60405180910390fd5b6101d88161020d565b50565b336101e4610116565b6001600160a01b031614610114573360405163118cdaa760e01b81526004016101c6919061025d565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b0391909116815260200190565b6001600160a01b03811681146101d857600080fd5b634e487b7160e01b600052604160045260246000fd5b6000806000606084860312156102b157600080fd5b83356102bc81610271565b925060208401356102cc81610271565b915060408401356001600160401b038111156102e757600080fd5b8401601f810186136102f857600080fd5b80356001600160401b0381111561031157610311610286565b604051601f8201601f19908116603f011681016001600160401b038111828210171561033f5761033f610286565b60405281815282820160200188101561035757600080fd5b816020840160208301376000602083830101528093505050509250925092565b6000815180845260005b8181101561039d57602081850181015186830182015201610381565b506000602082860101526020601f19601f83011685010191505092915050565b6020815260006103d06020830184610377565b9392505050565b6000602082840312156103e957600080fd5b81356103d081610271565b6001600160a01b038316815260406020820181905260009061041890830184610377565b94935050505056fea2646970667358221220e77af71a19651e50da550702ce9a5b1b89dda100ca5f41a9c778b943df55af8064736f6c634300081b0033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61030000000000000000000000006b4f986a7a7e97e233cb30172aac5d1f68c1869a000000000000000000000000ade6b8eb69a49b56929c1d4f4b428d791861db6f00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000","id":1,"type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"SubgraphServiceProxies#TransparentUpgradeableProxy_DisputeManager","networkInteractionId":1,"nonce":1584,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"SubgraphServiceProxies#TransparentUpgradeableProxy_DisputeManager","networkInteractionId":1,"nonce":1584,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0x28d358116c2778e03dca58dd69a8369e1308788ae7fd6822cb32108505814f0a"},"type":"TRANSACTION_SEND"} +{"artifactId":"SubgraphServiceProxies#TransparentUpgradeableProxy_SubgraphService","constructorArgs":["0x3E0C10883B120D3Cd2Ae5d78265204eDb68c434f","0xade6b8eb69a49b56929c1d4f4b428d791861db6f","0x"],"contractName":"TransparentUpgradeableProxy","dependencies":["SubgraphServiceProxies#OZProxyDummy_SubgraphService"],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","futureId":"SubgraphServiceProxies#TransparentUpgradeableProxy_SubgraphService","futureType":"CONTRACT_DEPLOYMENT","libraries":{},"strategy":"basic","strategyConfig":{},"type":"DEPLOYMENT_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"SubgraphServiceProxies#TransparentUpgradeableProxy_SubgraphService","networkInteraction":{"data":"0x60a0604052604051610eae380380610eae8339810160408190526100229161039d565b828161002e828261008f565b50508160405161003d9061033a565b6001600160a01b039091168152602001604051809103906000f080158015610069573d6000803e3d6000fd5b506001600160a01b031660805261008761008260805190565b6100ee565b50505061048f565b6100988261015c565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a28051156100e2576100dd82826101db565b505050565b6100ea610252565b5050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61012e600080516020610e8e833981519152546001600160a01b031690565b604080516001600160a01b03928316815291841660208301520160405180910390a161015981610273565b50565b806001600160a01b03163b60000361019757604051634c9c8ce360e01b81526001600160a01b03821660048201526024015b60405180910390fd5b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5b80546001600160a01b0319166001600160a01b039290921691909117905550565b6060600080846001600160a01b0316846040516101f89190610473565b600060405180830381855af49150503d8060008114610233576040519150601f19603f3d011682016040523d82523d6000602084013e610238565b606091505b5090925090506102498583836102b2565b95945050505050565b34156102715760405163b398979f60e01b815260040160405180910390fd5b565b6001600160a01b03811661029d57604051633173bdd160e11b81526000600482015260240161018e565b80600080516020610e8e8339815191526101ba565b6060826102c7576102c282610311565b61030a565b81511580156102de57506001600160a01b0384163b155b1561030757604051639996b31560e01b81526001600160a01b038516600482015260240161018e565b50805b9392505050565b8051156103215780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b6105538061093b83390190565b80516001600160a01b038116811461035e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561039457818101518382015260200161037c565b50506000910152565b6000806000606084860312156103b257600080fd5b6103bb84610347565b92506103c960208501610347565b60408501519092506001600160401b038111156103e557600080fd5b8401601f810186136103f657600080fd5b80516001600160401b0381111561040f5761040f610363565b604051601f8201601f19908116603f011681016001600160401b038111828210171561043d5761043d610363565b60405281815282820160200188101561045557600080fd5b610466826020830160208601610379565b8093505050509250925092565b60008251610485818460208701610379565b9190910192915050565b6080516104926104a96000396000601001526104926000f3fe608060405261000c61000e565b005b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316330361007b576000356001600160e01b03191663278f794360e11b14610071576040516334ad5dbb60e21b815260040160405180910390fd5b610079610083565b565b6100796100b2565b6000806100933660048184610304565b8101906100a09190610344565b915091506100ae82826100c2565b5050565b6100796100bd61011d565b610155565b6100cb82610179565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a28051156101155761011082826101f0565b505050565b6100ae610266565b60006101507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b3660008037600080366000845af43d6000803e808015610174573d6000f35b3d6000fd5b806001600160a01b03163b6000036101af5780604051634c9c8ce360e01b81526004016101a69190610419565b60405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080846001600160a01b03168460405161020d919061042d565b600060405180830381855af49150503d8060008114610248576040519150601f19603f3d011682016040523d82523d6000602084013e61024d565b606091505b509150915061025d858383610285565b95945050505050565b34156100795760405163b398979f60e01b815260040160405180910390fd5b60608261029a57610295826102db565b6102d4565b81511580156102b157506001600160a01b0384163b155b156102d15783604051639996b31560e01b81526004016101a69190610419565b50805b9392505050565b8051156102eb5780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b6000808585111561031457600080fd5b8386111561032157600080fd5b5050820193919092039150565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561035757600080fd5b82356001600160a01b038116811461036e57600080fd5b915060208301356001600160401b0381111561038957600080fd5b8301601f8101851361039a57600080fd5b80356001600160401b038111156103b3576103b361032e565b604051601f8201601f19908116603f011681016001600160401b03811182821017156103e1576103e161032e565b6040528181528282016020018710156103f957600080fd5b816020840160208301376000602083830101528093505050509250929050565b6001600160a01b0391909116815260200190565b6000825160005b8181101561044e5760208186018101518583015201610434565b50600092019182525091905056fea2646970667358221220079092acd5c0b5783781c6719b8677b2804315edab5ec07af0a0f7a7a9b7803c64736f6c634300081b0033608060405234801561001057600080fd5b5060405161055338038061055383398101604081905261002f916100be565b806001600160a01b03811661005e57604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b6100678161006e565b50506100ee565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000602082840312156100d057600080fd5b81516001600160a01b03811681146100e757600080fd5b9392505050565b610456806100fd6000396000f3fe60806040526004361061004a5760003560e01c8063715018a61461004f5780638da5cb5b146100665780639623609d14610091578063ad3cb1cc146100a4578063f2fde38b146100e2575b600080fd5b34801561005b57600080fd5b50610064610102565b005b34801561007257600080fd5b5061007b610116565b604051610088919061025d565b60405180910390f35b61006461009f36600461029c565b610125565b3480156100b057600080fd5b506100d5604051806040016040528060058152602001640352e302e360dc1b81525081565b60405161008891906103bd565b3480156100ee57600080fd5b506100646100fd3660046103d7565b610194565b61010a6101db565b610114600061020d565b565b6000546001600160a01b031690565b61012d6101db565b60405163278f794360e11b81526001600160a01b03841690634f1ef28690349061015d90869086906004016103f4565b6000604051808303818588803b15801561017657600080fd5b505af115801561018a573d6000803e3d6000fd5b5050505050505050565b61019c6101db565b6001600160a01b0381166101cf576000604051631e4fbdf760e01b81526004016101c6919061025d565b60405180910390fd5b6101d88161020d565b50565b336101e4610116565b6001600160a01b031614610114573360405163118cdaa760e01b81526004016101c6919061025d565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b0391909116815260200190565b6001600160a01b03811681146101d857600080fd5b634e487b7160e01b600052604160045260246000fd5b6000806000606084860312156102b157600080fd5b83356102bc81610271565b925060208401356102cc81610271565b915060408401356001600160401b038111156102e757600080fd5b8401601f810186136102f857600080fd5b80356001600160401b0381111561031157610311610286565b604051601f8201601f19908116603f011681016001600160401b038111828210171561033f5761033f610286565b60405281815282820160200188101561035757600080fd5b816020840160208301376000602083830101528093505050509250925092565b6000815180845260005b8181101561039d57602081850181015186830182015201610381565b506000602082860101526020601f19601f83011685010191505092915050565b6020815260006103d06020830184610377565b9392505050565b6000602082840312156103e957600080fd5b81356103d081610271565b6001600160a01b038316815260406020820181905260009061041890830184610377565b94935050505056fea2646970667358221220e77af71a19651e50da550702ce9a5b1b89dda100ca5f41a9c778b943df55af8064736f6c634300081b0033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61030000000000000000000000003e0c10883b120d3cd2ae5d78265204edb68c434f000000000000000000000000ade6b8eb69a49b56929c1d4f4b428d791861db6f00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000","id":1,"type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"SubgraphServiceProxies#TransparentUpgradeableProxy_SubgraphService","networkInteractionId":1,"nonce":1585,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"SubgraphServiceProxies#TransparentUpgradeableProxy_SubgraphService","networkInteractionId":1,"nonce":1585,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0xbcdc17c76bb47fa76b91a8be12fe55694918ddeb0c25d48dbf9e843c0e687939"},"type":"TRANSACTION_SEND"} +{"futureId":"SubgraphServiceProxies#TransparentUpgradeableProxy_DisputeManager","hash":"0x28d358116c2778e03dca58dd69a8369e1308788ae7fd6822cb32108505814f0a","networkInteractionId":1,"receipt":{"blockHash":"0xd334b83726dd4651794fd9580f0a42a0f11f59c4b452d24c01264a5ff4f407d2","blockNumber":152512329,"contractAddress":"0x1A7Fb71014d4395903eC56662f32dD02344D361C","logs":[{"address":"0x1A7Fb71014d4395903eC56662f32dD02344D361C","data":"0x","logIndex":0,"topics":["0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b","0x0000000000000000000000006b4f986a7a7e97e233cb30172aac5d1f68c1869a"]},{"address":"0x9a8C3B6D649108bd11670de0B9b981ae3C167707","data":"0x","logIndex":1,"topics":["0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0","0x0000000000000000000000000000000000000000000000000000000000000000","0x000000000000000000000000ade6b8eb69a49b56929c1d4f4b428d791861db6f"]},{"address":"0x1A7Fb71014d4395903eC56662f32dD02344D361C","data":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000009a8c3b6d649108bd11670de0b9b981ae3c167707","logIndex":2,"topics":["0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f"]}],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"SubgraphServiceProxies#TransparentUpgradeableProxy_DisputeManager","result":{"address":"0x1A7Fb71014d4395903eC56662f32dD02344D361C","type":"SUCCESS"},"type":"DEPLOYMENT_EXECUTION_STATE_COMPLETE"} +{"futureId":"SubgraphServiceProxies#TransparentUpgradeableProxy_SubgraphService","hash":"0xbcdc17c76bb47fa76b91a8be12fe55694918ddeb0c25d48dbf9e843c0e687939","networkInteractionId":1,"receipt":{"blockHash":"0x0ac8db5789fd95ef34d31a53ff9ed732628f3f25908473e804f58b56d09a22d8","blockNumber":152512341,"contractAddress":"0x00fe8F95407AB61863d27c07F584A0930ee5F3b0","logs":[{"address":"0x00fe8F95407AB61863d27c07F584A0930ee5F3b0","data":"0x","logIndex":0,"topics":["0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b","0x0000000000000000000000003e0c10883b120d3cd2ae5d78265204edb68c434f"]},{"address":"0xD23a972f47B7D45E729AB9B8399D628c87b6C0d6","data":"0x","logIndex":1,"topics":["0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0","0x0000000000000000000000000000000000000000000000000000000000000000","0x000000000000000000000000ade6b8eb69a49b56929c1d4f4b428d791861db6f"]},{"address":"0x00fe8F95407AB61863d27c07F584A0930ee5F3b0","data":"0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d23a972f47b7d45e729ab9b8399d628c87b6c0d6","logIndex":2,"topics":["0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f"]}],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"SubgraphServiceProxies#TransparentUpgradeableProxy_SubgraphService","result":{"address":"0x00fe8F95407AB61863d27c07F584A0930ee5F3b0","type":"SUCCESS"},"type":"DEPLOYMENT_EXECUTION_STATE_COMPLETE"} +{"artifactId":"SubgraphServiceProxies#DisputeManager_ProxyWithABI","contractAddress":"0x1A7Fb71014d4395903eC56662f32dD02344D361C","contractName":"DisputeManager_ProxyWithABI","dependencies":["SubgraphServiceProxies#TransparentUpgradeableProxy_DisputeManager"],"futureId":"SubgraphServiceProxies#DisputeManager_ProxyWithABI","futureType":"CONTRACT_AT","strategy":"basic","strategyConfig":{},"type":"CONTRACT_AT_EXECUTION_STATE_INITIALIZE"} +{"artifactId":"SubgraphServiceProxies#SubgraphService_ProxyWithABI","contractAddress":"0x00fe8F95407AB61863d27c07F584A0930ee5F3b0","contractName":"SubgraphService_ProxyWithABI","dependencies":["SubgraphServiceProxies#TransparentUpgradeableProxy_SubgraphService"],"futureId":"SubgraphServiceProxies#SubgraphService_ProxyWithABI","futureType":"CONTRACT_AT","strategy":"basic","strategyConfig":{},"type":"CONTRACT_AT_EXECUTION_STATE_INITIALIZE"} +{"artifactId":"SubgraphServiceProxies#TransparentUpgradeableProxy_DisputeManager","dependencies":["SubgraphServiceProxies#TransparentUpgradeableProxy_DisputeManager"],"emitterAddress":"0x1A7Fb71014d4395903eC56662f32dD02344D361C","eventIndex":0,"eventName":"AdminChanged","futureId":"SubgraphServiceProxies#TransparentUpgradeableProxy_DisputeManager_AdminChanged","nameOrIndex":"newAdmin","result":"0x9a8C3B6D649108bd11670de0B9b981ae3C167707","strategy":"basic","strategyConfig":{},"txToReadFrom":"0x28d358116c2778e03dca58dd69a8369e1308788ae7fd6822cb32108505814f0a","type":"READ_EVENT_ARGUMENT_EXECUTION_STATE_INITIALIZE"} +{"artifactId":"SubgraphServiceProxies#TransparentUpgradeableProxy_SubgraphService","dependencies":["SubgraphServiceProxies#TransparentUpgradeableProxy_SubgraphService"],"emitterAddress":"0x00fe8F95407AB61863d27c07F584A0930ee5F3b0","eventIndex":0,"eventName":"AdminChanged","futureId":"SubgraphServiceProxies#TransparentUpgradeableProxy_SubgraphService_AdminChanged","nameOrIndex":"newAdmin","result":"0xD23a972f47B7D45E729AB9B8399D628c87b6C0d6","strategy":"basic","strategyConfig":{},"txToReadFrom":"0xbcdc17c76bb47fa76b91a8be12fe55694918ddeb0c25d48dbf9e843c0e687939","type":"READ_EVENT_ARGUMENT_EXECUTION_STATE_INITIALIZE"} +{"artifactId":"SubgraphServiceProxies#ProxyAdmin_DisputeManager","contractAddress":"0x9a8C3B6D649108bd11670de0B9b981ae3C167707","contractName":"ProxyAdmin","dependencies":["SubgraphServiceProxies#TransparentUpgradeableProxy_DisputeManager_AdminChanged"],"futureId":"SubgraphServiceProxies#ProxyAdmin_DisputeManager","futureType":"CONTRACT_AT","strategy":"basic","strategyConfig":{},"type":"CONTRACT_AT_EXECUTION_STATE_INITIALIZE"} +{"artifactId":"SubgraphServiceProxies#ProxyAdmin_SubgraphService","contractAddress":"0xD23a972f47B7D45E729AB9B8399D628c87b6C0d6","contractName":"ProxyAdmin","dependencies":["SubgraphServiceProxies#TransparentUpgradeableProxy_SubgraphService_AdminChanged"],"futureId":"SubgraphServiceProxies#ProxyAdmin_SubgraphService","futureType":"CONTRACT_AT","strategy":"basic","strategyConfig":{},"type":"CONTRACT_AT_EXECUTION_STATE_INITIALIZE"} +{"artifactId":"Controller#Controller","constructorArgs":[],"contractName":"Controller","dependencies":[],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","futureId":"Controller#Controller","futureType":"CONTRACT_DEPLOYMENT","libraries":{},"strategy":"basic","strategyConfig":{},"type":"DEPLOYMENT_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"Controller#Controller","networkInteraction":{"data":"0x608060405234801561001057600080fd5b506100243361003360201b6109b21760201c565b61002e6001610055565b6100e7565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b600160159054906101000a900460ff1615158115151415610075576100e4565b6001805460ff60a81b1916600160a81b8315158102919091179182905560ff910416156100a157426003555b60015460408051600160a81b90920460ff1615158252517f8fb6c181ee25a520cf3dd6565006ef91229fcfe5a989566c2a3b8c115570cec5916020908290030190a15b50565b610ba0806100f66000396000f3fe608060405234801561001057600080fd5b506004361061010b5760003560e01c80635c975abb116100a2578063e0e9929211610071578063e0e9929214610215578063e3056a3414610241578063eb5dd94f14610249578063f2fde38b14610275578063f7641a5e1461029b5761010b565b80635c975abb146101e057806379ba5097146101e85780639181df9c146101f057806391b4ded91461020d5761010b565b80632e292fc7116100de5780632e292fc71461017757806348bde20c146101935780634fc07d75146101b957806356371bd8146101c15761010b565b80630c340a2414610110578063147ddef51461013457806316c38b3c1461014e57806324a3d6221461016f575b600080fd5b6101186102b8565b604080516001600160a01b039092168252519081900360200190f35b61013c6102c7565b60408051918252519081900360200190f35b61016d6004803603602081101561016457600080fd5b503515156102cd565b005b610118610337565b61017f610346565b604080519115158252519081900360200190f35b61016d600480360360208110156101a957600080fd5b50356001600160a01b0316610356565b610118610412565b61016d600480360360208110156101d757600080fd5b50351515610421565b61017f610488565b61016d610498565b61016d6004803603602081101561020657600080fd5b50356105a6565b61013c610651565b61016d6004803603604081101561022b57600080fd5b50803590602001356001600160a01b0316610657565b61011861076e565b61016d6004803603604081101561025f57600080fd5b50803590602001356001600160a01b031661077d565b61016d6004803603602081101561028b57600080fd5b50356001600160a01b0316610899565b610118600480360360208110156102b157600080fd5b5035610997565b6000546001600160a01b031681565b60025481565b6000546001600160a01b03163314806102f057506004546001600160a01b031633145b61032b5760405162461bcd60e51b8152600401808060200182810382526022815260200180610b496022913960400191505060405180910390fd5b610334816109d4565b50565b6004546001600160a01b031681565b600154600160a01b900460ff1690565b6000546001600160a01b031633146103ae576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b6001600160a01b038116610409576040805162461bcd60e51b815260206004820152601960248201527f5061757365477561726469616e206d7573742062652073657400000000000000604482015290519081900360640190fd5b61033481610a65565b6000546001600160a01b031690565b6000546001600160a01b031633148061044457506004546001600160a01b031633145b61047f5760405162461bcd60e51b8152600401808060200182810382526022815260200180610b496022913960400191505060405180910390fd5b61033481610ab7565b600154600160a81b900460ff1690565b6001546001600160a01b031680158015906104bb5750336001600160a01b038216145b61050c576040805162461bcd60e51b815260206004820152601f60248201527f43616c6c6572206d7573742062652070656e64696e6720676f7665726e6f7200604482015290519081900360640190fd5b600080546001600160a01b038381166001600160a01b031980841691909117808555600180549092169091556040519282169391169183917f0ac6deed30eef60090c749850e10f2fa469e3e25fec1d1bef2853003f6e6f18f91a36001546040516001600160a01b03918216918416907f76563ad561b7036ae716b9b25cb521b21463240f104c97e12f25877f2235f33d90600090a35050565b6000546001600160a01b031633146105fe576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b600081815260056020908152604080832080546001600160a01b031916905580519283525183927f937cf566d78d4769ff0211a7d87a6bea51e1fc026fd4d3d8cd589f0e99b983bd92908290030190a250565b60035481565b6000546001600160a01b031633146106af576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b6001600160a01b03811661070a576040805162461bcd60e51b815260206004820152601c60248201527f436f6e74726163742061646472657373206d7573742062652073657400000000604482015290519081900360640190fd5b60008281526005602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251908152915184927f937cf566d78d4769ff0211a7d87a6bea51e1fc026fd4d3d8cd589f0e99b983bd92908290030190a25050565b6001546001600160a01b031681565b6000546001600160a01b031633146107d5576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b6001600160a01b038116610829576040805162461bcd60e51b815260206004820152601660248201527510dbdb9d1c9bdb1b195c881b5d5cdd081899481cd95d60521b604482015290519081900360640190fd5b6000828152600560205260408082205481516392eefe9b60e01b81526001600160a01b038581166004830152925192909116926392eefe9b9260248084019382900301818387803b15801561087d57600080fd5b505af1158015610891573d6000803e3d6000fd5b505050505050565b6000546001600160a01b031633146108f1576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b6001600160a01b038116610943576040805162461bcd60e51b815260206004820152601460248201527311dbdd995c9b9bdc881b5d5cdd081899481cd95d60621b604482015290519081900360640190fd5b600180546001600160a01b038381166001600160a01b03198316179283905560405191811692169082907f76563ad561b7036ae716b9b25cb521b21463240f104c97e12f25877f2235f33d90600090a35050565b6000908152600560205260409020546001600160a01b031690565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b600160159054906101000a900460ff16151581151514156109f457610334565b6001805460ff60a81b1916600160a81b8315158102919091179182905560ff91041615610a2057426003555b60015460408051600160a81b90920460ff1615158252517f8fb6c181ee25a520cf3dd6565006ef91229fcfe5a989566c2a3b8c115570cec5916020908290030190a150565b600480546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f0613b6ee6a04f0d09f390e4d9318894b9f6ac7fd83897cd8d18896ba579c401e90600090a35050565b600160149054906101000a900460ff1615158115151415610ad757610334565b6001805460ff60a01b1916600160a01b8315158102919091179182905560ff91041615610b0357426002555b60015460408051600160a01b90920460ff1615158252517f511b770d1b1dc5cbd412a5017f55cbb2295b826385e5f46c1de2b6ebeb44ae02916020908290030190a15056fe4f6e6c7920476f7665726e6f72206f7220477561726469616e2063616e2063616c6ca26469706673582212207cecec10a8617577e80b5c52f6cd82da5e5974468c039848ed5e90b25c8267c764736f6c63430007060033","id":1,"type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"Controller#Controller","networkInteractionId":1,"nonce":1586,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"Controller#Controller","networkInteractionId":1,"nonce":1586,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0x38745c8ad22d3cd61a943a23dcc475e54d0c8b751122259723fd2c6966632add"},"type":"TRANSACTION_SEND"} +{"artifactId":"EpochManager#EpochManager","constructorArgs":[],"contractName":"EpochManager","dependencies":[],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","futureId":"EpochManager#EpochManager","futureType":"CONTRACT_DEPLOYMENT","libraries":{},"strategy":"basic","strategyConfig":{},"type":"DEPLOYMENT_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"EpochManager#EpochManager","networkInteraction":{"data":"0x6101606040527fe6876326c1291dfcbbd3864a6816d698cd591defc7aa2153d7f9c4c04016c89f6080527fc713c3df6d14cdf946460395d09af88993ee2b948b1a808161494e32c5f6706360a0527f966f1e8d8d8014e05f6ec4a57138da9be1f7c5a7f802928a18072f7c5318076160c0527f1df41cd916959d1163dc8f0671a666ea8a3e434c13e40faef527133b5d16703460e0527f45fc200c7e4544e457d3c5709bfe0d520442c30bbcbdaede89e8d4a4bbc19247610100527fd362cac9cb75c10d67bcc0b7eeb0b1ef48bb5420b556c092d4fd7f758816fcf0610120527f39605a6c26a173774ca666c67ef70cf491880e5d3d6d0ca66ec0a31034f15ea36101405234801561011057600080fd5b5060805160a05160c05160e05161010051610120516101405161103461016460003980610aac525080610a83525080610a5a525080610a31525080610a085250806109df5250806109b652506110346000f3fe608060405234801561001057600080fd5b506004361061012c5760003560e01c8063a2594d82116100ad578063cd6dc68711610071578063cd6dc687146102c4578063d0cfa46e146102f0578063d6866ea5146102f8578063f77c479114610300578063faa1a23c146103245761012c565b8063a2594d821461027e578063ab93122c146102a4578063b4146a0b146102ac578063c46e58eb146102b4578063cc65149b146102bc5761012c565b806376671808116100f457806376671808146101ab57806385df51fd146101b35780638ae63d6d146101d057806392eefe9b146101d85780639ce7abe5146101fe5761012c565b806319c3b82d146101315780631b28126d1461014b5780631ce05d381461016857806354eea7961461018457806357d775f8146101a3575b600080fd5b61013961032c565b60408051918252519081900360200190f35b6101396004803603602081101561016157600080fd5b5035610353565b61017061037f565b604080519115158252519081900360200190f35b6101a16004803603602081101561019a57600080fd5b5035610392565b005b61013961047f565b610139610485565b610139600480360360208110156101c957600080fd5b503561049b565b61013961053b565b6101a1600480360360208110156101ee57600080fd5b50356001600160a01b031661053f565b6101a16004803603604081101561021457600080fd5b6001600160a01b03823516919081019060408101602082013564010000000081111561023f57600080fd5b82018360208201111561025157600080fd5b8035906020019184600183028401116401000000008311171561027357600080fd5b509092509050610553565b6101a16004803603602081101561029457600080fd5b50356001600160a01b03166106a9565b6101396107c4565b6101396107e6565b6101a16107ec565b610139610888565b6101a1600480360360408110156102da57600080fd5b506001600160a01b03813516906020013561088e565b610139610999565b6101a16109b1565b610308610ad2565b604080516001600160a01b039092168252519081900360200190f35b610139610ae1565b600061034e600c54610348600f5461034261053b565b90610ae7565b90610b49565b905090565b60008061035e610485565b905080831061036e576000610378565b6103788184610ae7565b9392505050565b6000610389610485565b600d5414905090565b61039a610bb0565b600081116103ea576040805162461bcd60e51b8152602060048201526018602482015277045706f6368206c656e6774682063616e6e6f7420626520360441b604482015290519081900360640190fd5b600c5481141561042b5760405162461bcd60e51b8152600401808060200182810382526029815260200180610f666029913960400191505060405180910390fd5b610433610485565b600e5561043e6107c4565b600f55600c819055600e546040805183815290517f25ddd6f00038d5eac0051df83c6084f140a01586f092e2728d1ed781c9ce24419181900360200190a250565b600c5481565b600061034e61049261032c565b600e5490610c84565b6000806104a661053b565b90508083106104e65760405162461bcd60e51b8152600401808060200182810382526023815260200180610fdc6023913960400191505060405180910390fd5b6101008110806104fa575061010081038310155b6105355760405162461bcd60e51b815260040180806020018281038252602c815260200180610fb0602c913960400191505060405180910390fd5b50504090565b4390565b610547610cde565b61055081610d3d565b50565b82806001600160a01b031663f851a4406040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561058f57600080fd5b505af11580156105a3573d6000803e3d6000fd5b505050506040513d60208110156105b957600080fd5b50516001600160a01b03163314610617576040805162461bcd60e51b815260206004820152601e60248201527f43616c6c6572206d757374206265207468652070726f78792061646d696e0000604482015290519081900360640190fd5b60405163623faf6160e01b8152602060048201908152602482018490526001600160a01b0386169163623faf619186918691908190604401848480828437600081840152601f19601f8201169050808301925050509350505050600060405180830381600087803b15801561068b57600080fd5b505af115801561069f573d6000803e3d6000fd5b5050505050505050565b80806001600160a01b031663f851a4406040518163ffffffff1660e01b8152600401602060405180830381600087803b1580156106e557600080fd5b505af11580156106f9573d6000803e3d6000fd5b505050506040513d602081101561070f57600080fd5b50516001600160a01b0316331461076d576040805162461bcd60e51b815260206004820152601e60248201527f43616c6c6572206d757374206265207468652070726f78792061646d696e0000604482015290519081900360640190fd5b816001600160a01b03166359fc20bb6040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156107a857600080fd5b505af11580156107bc573d6000803e3d6000fd5b505050505050565b600061034e6107dd600c546107d761032c565b90610de5565b600f5490610c84565b600e5481565b6107f461037f565b15610846576040805162461bcd60e51b815260206004820152601960248201527f43757272656e742065706f636820616c72656164792072756e00000000000000604482015290519081900360640190fd5b61084e610485565b600d8190556040805133815290517f666a37ccc682d20f8c51c5f6fd835cbadbcaaf09921e076282446e42d7264e3e9181900360200190a2565b600f5481565b610896610e3e565b6001600160a01b0316336001600160a01b0316146108f1576040805162461bcd60e51b815260206004820152601360248201527227b7363c9034b6b83632b6b2b73a30ba34b7b760691b604482015290519081900360640190fd5b60008111610941576040805162461bcd60e51b8152602060048201526018602482015277045706f6368206c656e6774682063616e6e6f7420626520360441b604482015290519081900360640190fd5b61094a82610547565b6001600e5561095761053b565b600f55600c819055600e546040805183815290517f25ddd6f00038d5eac0051df83c6084f140a01586f092e2728d1ed781c9ce24419181900360200190a25050565b60006109a36107c4565b6109ab61053b565b03905090565b6109da7f0000000000000000000000000000000000000000000000000000000000000000610e63565b610a037f0000000000000000000000000000000000000000000000000000000000000000610e63565b610a2c7f0000000000000000000000000000000000000000000000000000000000000000610e63565b610a557f0000000000000000000000000000000000000000000000000000000000000000610e63565b610a7e7f0000000000000000000000000000000000000000000000000000000000000000610e63565b610aa77f0000000000000000000000000000000000000000000000000000000000000000610e63565b610ad07f0000000000000000000000000000000000000000000000000000000000000000610e63565b565b6000546001600160a01b031681565b600d5481565b600082821115610b3e576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b508082035b92915050565b6000808211610b9f576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b818381610ba857fe5b049392505050565b60008054906101000a90046001600160a01b03166001600160a01b0316634fc07d756040518163ffffffff1660e01b815260040160206040518083038186803b158015610bfc57600080fd5b505afa158015610c10573d6000803e3d6000fd5b505050506040513d6020811015610c2657600080fd5b50516001600160a01b03163314610ad0576040805162461bcd60e51b815260206004820152601860248201527f4f6e6c7920436f6e74726f6c6c657220676f7665726e6f720000000000000000604482015290519081900360640190fd5b600082820183811015610378576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000546001600160a01b03163314610ad0576040805162461bcd60e51b815260206004820152601960248201527f43616c6c6572206d75737420626520436f6e74726f6c6c657200000000000000604482015290519081900360640190fd5b6001600160a01b038116610d91576040805162461bcd60e51b815260206004820152601660248201527510dbdb9d1c9bdb1b195c881b5d5cdd081899481cd95d60521b604482015290519081900360640190fd5b600080546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f4ff638452bbf33c012645d18ae6f05515ff5f2d1dfb0cece8cbf018c60903f709181900360200190a150565b600082610df457506000610b43565b82820282848281610e0157fe5b04146103785760405162461bcd60e51b8152600401808060200182810382526021815260200180610f8f6021913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6000805460408051637bb20d2f60e11b81526004810185905290516001600160a01b039092169163f7641a5e91602480820192602092909190829003018186803b158015610eb057600080fd5b505afa158015610ec4573d6000803e3d6000fd5b505050506040513d6020811015610eda57600080fd5b50516000838152600160205260409020549091506001600160a01b03808316911614610f615760008281526001602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251908152915184927fd0e7a942b1fc38c411c4f53d153ba14fd24542a6a35ebacd9b6afca1a154e20692908290030190a25b505056fe45706f6368206c656e677468206d75737420626520646966666572656e7420746f2063757272656e74536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7743616e206f6e6c792072657472696576652068617368657320666f72206c6173742032353620626c6f636b7343616e206f6e6c79207265747269657665207061737420626c6f636b20686173686573a264697066735822122045232c339fada874ae01964572e7664b10cfd18abe5a79dda984153cc999839564736f6c63430007060033","id":1,"type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"EpochManager#EpochManager","networkInteractionId":1,"nonce":1587,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"EpochManager#EpochManager","networkInteractionId":1,"nonce":1587,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0x859e4f54c6a35fd4ab34cdc50a1bc74fc3e6c51fa1e23dd27c5faffb29768ed0"},"type":"TRANSACTION_SEND"} +{"artifactId":"GraphProxyAdmin#GraphProxyAdmin","constructorArgs":[],"contractName":"GraphProxyAdmin","dependencies":[],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","futureId":"GraphProxyAdmin#GraphProxyAdmin","futureType":"CONTRACT_DEPLOYMENT","libraries":{},"strategy":"basic","strategyConfig":{},"type":"DEPLOYMENT_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"GraphProxyAdmin#GraphProxyAdmin","networkInteraction":{"data":"0x608060405234801561001057600080fd5b506100243361002960201b610a0c1760201c565b61004b565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b610a648061005a6000396000f3fe608060405234801561001057600080fd5b50600436106100a95760003560e01c80637eff275e116100715780637eff275e146101b157806399a88ec4146101df578063e3056a341461020d578063eb451a0214610215578063f2fde38b14610243578063f3b7dead14610269576100a9565b806307ebde0e146100ae5780630c340a2414610139578063204e1c7a1461015d5780635bf410eb1461018357806379ba5097146101a9575b600080fd5b610137600480360360608110156100c457600080fd5b6001600160a01b0382358116926020810135909116918101906060810160408201356401000000008111156100f857600080fd5b82018360208201111561010a57600080fd5b8035906020019184600183028401116401000000008311171561012c57600080fd5b50909250905061028f565b005b610141610388565b604080516001600160a01b039092168252519081900360200190f35b6101416004803603602081101561017357600080fd5b50356001600160a01b0316610397565b6101416004803603602081101561019957600080fd5b50356001600160a01b031661046a565b610137610525565b610137600480360360408110156101c757600080fd5b506001600160a01b0381358116916020013516610633565b610137600480360360408110156101f557600080fd5b506001600160a01b03813581169160200135166106f6565b61014161079d565b6101376004803603604081101561022b57600080fd5b506001600160a01b03813581169160200135166107ac565b6101376004803603602081101561025957600080fd5b50356001600160a01b0316610853565b6101416004803603602081101561027f57600080fd5b50356001600160a01b0316610951565b6000546001600160a01b031633146102e7576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b836001600160a01b0316639ce7abe58484846040518463ffffffff1660e01b815260040180846001600160a01b03168152602001806020018281038252848482818152602001925080828437600081840152601f19601f820116905080830192505050945050505050600060405180830381600087803b15801561036a57600080fd5b505af115801561037e573d6000803e3d6000fd5b5050505050505050565b6000546001600160a01b031681565b6000806000836001600160a01b03166040518080635c60da1b60e01b8152506004019050600060405180830381855afa9150503d80600081146103f6576040519150601f19603f3d011682016040523d82523d6000602084013e6103fb565b606091505b50915091508161044b576040805162461bcd60e51b8152602060048201526016602482015275141c9bde1e481a5b5c1b0818d85b1b0819985a5b195960521b604482015290519081900360640190fd5b80806020019051602081101561046057600080fd5b5051949350505050565b6000806000836001600160a01b0316604051808063396f7b2360e01b8152506004019050600060405180830381855afa9150503d80600081146104c9576040519150601f19603f3d011682016040523d82523d6000602084013e6104ce565b606091505b50915091508161044b576040805162461bcd60e51b815260206004820152601d60248201527f50726f78792070656e64696e67496d706c2063616c6c206661696c6564000000604482015290519081900360640190fd5b6001546001600160a01b031680158015906105485750336001600160a01b038216145b610599576040805162461bcd60e51b815260206004820152601f60248201527f43616c6c6572206d7573742062652070656e64696e6720676f7665726e6f7200604482015290519081900360640190fd5b600080546001600160a01b038381166001600160a01b031980841691909117808555600180549092169091556040519282169391169183917f0ac6deed30eef60090c749850e10f2fa469e3e25fec1d1bef2853003f6e6f18f91a36001546040516001600160a01b03918216918416907f76563ad561b7036ae716b9b25cb521b21463240f104c97e12f25877f2235f33d90600090a35050565b6000546001600160a01b0316331461068b576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b816001600160a01b031663704b6c02826040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050600060405180830381600087803b1580156106da57600080fd5b505af11580156106ee573d6000803e3d6000fd5b505050505050565b6000546001600160a01b0316331461074e576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b816001600160a01b0316633659cfe6826040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050600060405180830381600087803b1580156106da57600080fd5b6001546001600160a01b031681565b6000546001600160a01b03163314610804576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b816001600160a01b031663a2594d82826040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050600060405180830381600087803b1580156106da57600080fd5b6000546001600160a01b031633146108ab576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b6001600160a01b0381166108fd576040805162461bcd60e51b815260206004820152601460248201527311dbdd995c9b9bdc881b5d5cdd081899481cd95d60621b604482015290519081900360640190fd5b600180546001600160a01b038381166001600160a01b03198316179283905560405191811692169082907f76563ad561b7036ae716b9b25cb521b21463240f104c97e12f25877f2235f33d90600090a35050565b6000806000836001600160a01b031660405180806303e1469160e61b8152506004019050600060405180830381855afa9150503d80600081146109b0576040519150601f19603f3d011682016040523d82523d6000602084013e6109b5565b606091505b50915091508161044b576040805162461bcd60e51b815260206004820152601760248201527f50726f78792061646d696e2063616c6c206661696c6564000000000000000000604482015290519081900360640190fd5b600080546001600160a01b0319166001600160a01b039290921691909117905556fea26469706673582212208b271ee4c7625d89f662c15e90f70e142245bf56f0595043fe9af742b09d958c64736f6c63430007060033","id":1,"type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"GraphProxyAdmin#GraphProxyAdmin","networkInteractionId":1,"nonce":1588,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"GraphProxyAdmin#GraphProxyAdmin","networkInteractionId":1,"nonce":1588,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0xd76e5fc20076c7d417d14c71770190aabda128d246a16dfcc29f77fb7f270365"},"type":"TRANSACTION_SEND"} +{"artifactId":"HorizonProxies#OZProxyDummy_GraphPayments","constructorArgs":[],"contractName":"Dummy","dependencies":[],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","futureId":"HorizonProxies#OZProxyDummy_GraphPayments","futureType":"CONTRACT_DEPLOYMENT","libraries":{},"strategy":"basic","strategyConfig":{},"type":"DEPLOYMENT_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"HorizonProxies#OZProxyDummy_GraphPayments","networkInteraction":{"data":"0x6080604052348015600f57600080fd5b50603f80601d6000396000f3fe6080604052600080fdfea264697066735822122081eeeeb2e55704976a5bd19451809712b1b76b2d5b7a994dc02b32128a829da764736f6c634300081b0033","id":1,"type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"HorizonProxies#OZProxyDummy_GraphPayments","networkInteractionId":1,"nonce":1589,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"HorizonProxies#OZProxyDummy_GraphPayments","networkInteractionId":1,"nonce":1589,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0x9983dbeee2627390f14712118876eae5f0cef7a85aa0486c834aa1c51be61e9d"},"type":"TRANSACTION_SEND"} +{"artifactId":"HorizonProxies#OZProxyDummy_PaymentsEscrow","constructorArgs":[],"contractName":"Dummy","dependencies":[],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","futureId":"HorizonProxies#OZProxyDummy_PaymentsEscrow","futureType":"CONTRACT_DEPLOYMENT","libraries":{},"strategy":"basic","strategyConfig":{},"type":"DEPLOYMENT_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"HorizonProxies#OZProxyDummy_PaymentsEscrow","networkInteraction":{"data":"0x6080604052348015600f57600080fd5b50603f80601d6000396000f3fe6080604052600080fdfea264697066735822122081eeeeb2e55704976a5bd19451809712b1b76b2d5b7a994dc02b32128a829da764736f6c634300081b0033","id":1,"type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"HorizonProxies#OZProxyDummy_PaymentsEscrow","networkInteractionId":1,"nonce":1590,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"HorizonProxies#OZProxyDummy_PaymentsEscrow","networkInteractionId":1,"nonce":1590,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0x8e31fc40c140b6f04f8bde3abd3c53acd237a7e5654c53970b92f35080dd91cf"},"type":"TRANSACTION_SEND"} +{"artifactId":"HorizonStaking#ExponentialRebates","constructorArgs":[],"contractName":"ExponentialRebates","dependencies":[],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","futureId":"HorizonStaking#ExponentialRebates","futureType":"LIBRARY_DEPLOYMENT","libraries":{},"strategy":"basic","strategyConfig":{},"type":"DEPLOYMENT_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"HorizonStaking#ExponentialRebates","networkInteraction":{"data":"0x610c2d610039600b82828239805160001a607314602c57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600436106100355760003560e01c806349484d811461003a575b600080fd5b61004d610048366004610a66565b61005f565b60405190815260200160405180910390f35b6000806100728660030b8660030b61011c565b9050806000036100855787915050610112565b87600003610097576000915050610112565b60006100a98560030b8560030b61011c565b905060006100b8828a8c61013c565b9050600f6100c582610153565b13156100d657899350505050610112565b60006100ff6001607f1b6100fa866100f56100f087610ae2565b610169565b610882565b61089d565b905061010b818c6108d4565b9450505050505b9695505050505050565b600061013561012f846001607f1b610920565b83610988565b9392505050565b600061014b61012f8585610920565b949350505050565b60006101636001607f1b83610b14565b92915050565b60006101796101ff607c1b610ae2565b82121561018857506000919050565b8160000361019b57506001607f1b919050565b60008213156101c55760405162461bcd60e51b81526004016101bc90610b42565b60405180910390fd5b6000806101d66001607c1b85610b69565b91508190506001607f1b6101ea8280610b7d565b6101f49190610b14565b9050610208816710e1b3be415a0000610b7d565b6102129084610bad565b92506001607f1b6102238383610b7d565b61022d9190610b14565b9050610241816705a0913f6b1e0000610b7d565b61024b9084610bad565b92506001607f1b61025c8383610b7d565b6102669190610b14565b905061027a81670168244fdac78000610b7d565b6102849084610bad565b92506001607f1b6102958383610b7d565b61029f9190610b14565b90506102b281664807432bc18000610b7d565b6102bc9084610bad565b92506001607f1b6102cd8383610b7d565b6102d79190610b14565b90506102ea81660c0135dca04000610b7d565b6102f49084610bad565b92506001607f1b6103058383610b7d565b61030f9190610b14565b9050610322816601b707b1cdc000610b7d565b61032c9084610bad565b92506001607f1b61033d8383610b7d565b6103479190610b14565b9050610359816536e0f639b800610b7d565b6103639084610bad565b92506001607f1b6103748383610b7d565b61037e9190610b14565b905061039081650618fee9f800610b7d565b61039a9084610bad565b92506001607f1b6103ab8383610b7d565b6103b59190610b14565b90506103c681649c197dcc00610b7d565b6103d09084610bad565b92506001607f1b6103e18383610b7d565b6103eb9190610b14565b90506103fc81640e30dce400610b7d565b6104069084610bad565b92506001607f1b6104178383610b7d565b6104219190610b14565b90506104328164012ebd1300610b7d565b61043c9084610bad565b92506001607f1b61044d8383610b7d565b6104579190610b14565b9050610467816317499f00610b7d565b6104719084610bad565b92506001607f1b6104828383610b7d565b61048c9190610b14565b905061049c816301a9d480610b7d565b6104a69084610bad565b92506001607f1b6104b78383610b7d565b6104c19190610b14565b90506104d081621c6380610b7d565b6104da9084610bad565b92506001607f1b6104eb8383610b7d565b6104f59190610b14565b9050610504816201c638610b7d565b61050e9084610bad565b92506001607f1b61051f8383610b7d565b6105299190610b14565b905061053781611ab8610b7d565b6105419084610bad565b92506001607f1b6105528383610b7d565b61055c9190610b14565b905061056a8161017c610b7d565b6105749084610bad565b92506001607f1b6105858383610b7d565b61058f9190610b14565b905061059c816014610b7d565b6105a69084610bad565b92506001607f1b6105b78383610b7d565b6105c19190610b14565b90506105ce816001610b7d565b6105d89084610bad565b92506001607f1b826105f26721c3677c82b4000086610b14565b6105fc9190610bad565b6106069190610bad565b925061061184610ae2565b9350600160841b841615610657577243cbaf42a000812488fc5c220ad7b97bf6e99e61064a6cf1aaddd7742e56d32fb9f9974485610b7d565b6106549190610b14565b92505b600160831b84161561069c577105d27a9f51c31b7c2f8038212a057477999161068f6e0afe10820813d65dfe6a33c07f738f85610b7d565b6106999190610b14565b92505b600160821b8416156106e157701b4c902e273a58678d6d3bfdb93db96d026106d46f02582ab704279e8efd15e0265855c47a85610b7d565b6106de9190610b14565b92505b600160811b841615610726577003b1cc971a9bb5b9867477440d6d1577506107196f1152aaa3bf81cb9fdb76eae12d02957185610b7d565b6107239190610b14565b92505b600160801b84161561076b5770015bf0a8b1457695355fb8ac404e7a79e361075e6f2f16ac6c59de6f8d5d6f63c1482a7c8685610b7d565b6107689190610b14565b92505b6001607f1b8416156107af576fd3094c70f034de4b96ff7d5b6f99fcd86107a26f4da2cbf1be5827f9eb3ad1aa9866ebb385610b7d565b6107ac9190610b14565b92505b6001607e1b8416156107f3576fa45af1e1f40c333b3de1db4dd55f29a76107e66f63afbe7ab2082ba1a0ae5e4eb1b479dc85610b7d565b6107f09190610b14565b92505b6001607d1b841615610837576f910b022db7ae67ce76b441c27035c6a161082a6f70f5a893b608861e1f58934f97aea57d85610b7d565b6108349190610b14565b92505b6001607c1b84161561087b576f88415abbe9a76bead8d00cf112e4d4a861086e6f783eafef1c0a8f3978c7f81824d62ebf85610b7d565b6108789190610b14565b92505b5050919050565b60006001607f1b6108938484610920565b6101359190610b14565b6000600160ff1b82036108c25760405162461bcd60e51b81526004016101bc90610b42565b610135836108cf84610ae2565b6109f2565b6000808212156108f65760405162461bcd60e51b81526004016101bc90610b42565b60006109028484610920565b905060008113610916576000915050610163565b607f1c9392505050565b600082158061092d575081155b1561093a57506000610163565b508181028183828161094e5761094e610afe565b0514158061096b57508282828161096757610967610afe565b0514155b156101635760405162461bcd60e51b81526004016101bc90610bd5565b6000816000036109aa5760405162461bcd60e51b81526004016101bc90610bd5565b600160ff1b831480156109be575081600019145b156109db5760405162461bcd60e51b81526004016101bc90610bd5565b8183816109ea576109ea610afe565b059392505050565b818101600083128015610a055750600082125b8015610a1057508281135b8061096b5750600083138015610a265750600082135b801561096b5750828112156101635760405162461bcd60e51b81526004016101bc90610bd5565b803563ffffffff81168114610a6157600080fd5b919050565b60008060008060008060c08789031215610a7f57600080fd5b8635955060208701359450610a9660408801610a4d565b9350610aa460608801610a4d565b9250610ab260808801610a4d565b9150610ac060a08801610a4d565b90509295509295509295565b634e487b7160e01b600052601160045260246000fd5b6000600160ff1b8201610af757610af7610acc565b5060000390565b634e487b7160e01b600052601260045260246000fd5b600082610b2357610b23610afe565b600160ff1b821460001984141615610b3d57610b3d610acc565b500590565b6020808252600d908201526c6f75742d6f662d626f756e647360981b604082015260600190565b600082610b7857610b78610afe565b500790565b80820260008212600160ff1b84141615610b9957610b99610acc565b818105831482151761016357610163610acc565b8082018281126000831280158216821582161715610bcd57610bcd610acc565b505092915050565b6020808252600890820152676f766572666c6f7760c01b60408201526060019056fea26469706673582212201ef3beb7da88d73c1ec2e008b9308e699e4621df52e1b4b35ff71522e3621d6464736f6c634300081b0033","id":1,"type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"HorizonStaking#ExponentialRebates","networkInteractionId":1,"nonce":1591,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"HorizonStaking#ExponentialRebates","networkInteractionId":1,"nonce":1591,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0xa1983cc6775d37b981f072909799a74c3ec9b62ab36904736b703f798399cd86"},"type":"TRANSACTION_SEND"} +{"artifactId":"L2Curation#GraphCurationToken","constructorArgs":[],"contractName":"GraphCurationToken","dependencies":[],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","futureId":"L2Curation#GraphCurationToken","futureType":"CONTRACT_DEPLOYMENT","libraries":{},"strategy":"basic","strategyConfig":{},"type":"DEPLOYMENT_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"L2Curation#GraphCurationToken","networkInteraction":{"data":"0x608060405234801561001057600080fd5b506114ec806100206000396000f3fe608060405234801561001057600080fd5b50600436106101165760003560e01c806379ba5097116100a2578063a9059cbb11610071578063a9059cbb14610352578063c4d66de81461037e578063dd62ed3e146103a4578063e3056a34146103d2578063f2fde38b146103da57610116565b806379ba5097146102ea57806379cc6790146102f257806395d89b411461031e578063a457c2d71461032657610116565b806323b872dd116100e957806323b872dd14610216578063313ce5671461024c578063395093511461026a57806340c10f191461029657806370a08231146102c457610116565b806306fdde031461011b578063095ea7b3146101985780630c340a24146101d857806318160ddd146101fc575b600080fd5b610123610400565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561015d578181015183820152602001610145565b50505050905090810190601f16801561018a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c4600480360360408110156101ae57600080fd5b506001600160a01b038135169060200135610496565b604080519115158252519081900360200190f35b6101e06104b3565b604080516001600160a01b039092168252519081900360200190f35b6102046104c2565b60408051918252519081900360200190f35b6101c46004803603606081101561022c57600080fd5b506001600160a01b038135811691602081013590911690604001356104c8565b61025461054f565b6040805160ff9092168252519081900360200190f35b6101c46004803603604081101561028057600080fd5b506001600160a01b038135169060200135610558565b6102c2600480360360408110156102ac57600080fd5b506001600160a01b0381351690602001356105a6565b005b610204600480360360208110156102da57600080fd5b50356001600160a01b031661060c565b6102c2610627565b6102c26004803603604081101561030857600080fd5b506001600160a01b038135169060200135610737565b610123610799565b6101c46004803603604081101561033c57600080fd5b506001600160a01b0381351690602001356107fa565b6101c46004803603604081101561036857600080fd5b506001600160a01b038135169060200135610862565b6102c26004803603602081101561039457600080fd5b50356001600160a01b0316610876565b610204600480360360408110156103ba57600080fd5b506001600160a01b0381358116916020013516610972565b6101e061099d565b6102c2600480360360208110156103f057600080fd5b50356001600160a01b03166109ac565b60368054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561048c5780601f106104615761010080835404028352916020019161048c565b820191906000526020600020905b81548152906001019060200180831161046f57829003601f168201915b5050505050905090565b60006104aa6104a3610aaa565b8484610aae565b50600192915050565b6065546001600160a01b031681565b60355490565b60006104d5848484610b9a565b610545846104e1610aaa565b61054085604051806060016040528060288152602001611400602891396001600160a01b038a1660009081526034602052604081209061051f610aaa565b6001600160a01b031681526020810191909152604001600020549190610cf7565b610aae565b5060019392505050565b60385460ff1690565b60006104aa610565610aaa565b846105408560346000610576610aaa565b6001600160a01b03908116825260208083019390935260409182016000908120918c168152925290205490610d8e565b6065546001600160a01b031633146105fe576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b6106088282610def565b5050565b6001600160a01b031660009081526033602052604090205490565b6066546001600160a01b0316801580159061064a5750336001600160a01b038216145b61069b576040805162461bcd60e51b815260206004820152601f60248201527f43616c6c6572206d7573742062652070656e64696e6720676f7665726e6f7200604482015290519081900360640190fd5b606580546001600160a01b038381166001600160a01b0319808416919091179384905560668054909116905560405191811692169082907f0ac6deed30eef60090c749850e10f2fa469e3e25fec1d1bef2853003f6e6f18f90600090a36066546040516001600160a01b03918216918416907f76563ad561b7036ae716b9b25cb521b21463240f104c97e12f25877f2235f33d90600090a35050565b6065546001600160a01b0316331461078f576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b6106088282610ee1565b60378054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561048c5780601f106104615761010080835404028352916020019161048c565b60006104aa610807610aaa565b84610540856040518060600160405280602581526020016114926025913960346000610831610aaa565b6001600160a01b03908116825260208083019390935260409182016000908120918d16815292529020549190610cf7565b60006104aa61086f610aaa565b8484610b9a565b600054610100900460ff168061088f575061088f610fdd565b8061089d575060005460ff16155b6108d85760405162461bcd60e51b815260040180806020018281038252602e8152602001806113d2602e913960400191505060405180910390fd5b600054610100900460ff16158015610903576000805460ff1961ff0019909116610100171660011790555b61090c82610fee565b61095d604051806040016040528060148152602001734772617068204375726174696f6e20536861726560601b8152506040518060400160405280600381526020016247435360e81b815250611010565b8015610608576000805461ff00191690555050565b6001600160a01b03918216600090815260346020908152604080832093909416825291909152205490565b6066546001600160a01b031681565b6065546001600160a01b03163314610a04576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b6001600160a01b038116610a56576040805162461bcd60e51b815260206004820152601460248201527311dbdd995c9b9bdc881b5d5cdd081899481cd95d60621b604482015290519081900360640190fd5b606680546001600160a01b038381166001600160a01b03198316179283905560405191811692169082907f76563ad561b7036ae716b9b25cb521b21463240f104c97e12f25877f2235f33d90600090a35050565b3390565b6001600160a01b038316610af35760405162461bcd60e51b815260040180806020018281038252602481526020018061146e6024913960400191505060405180910390fd5b6001600160a01b038216610b385760405162461bcd60e51b815260040180806020018281038252602281526020018061138a6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260346020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b038316610bdf5760405162461bcd60e51b81526004018080602001828103825260258152602001806114496025913960400191505060405180910390fd5b6001600160a01b038216610c245760405162461bcd60e51b81526004018080602001828103825260238152602001806113456023913960400191505060405180910390fd5b610c2f8383836110c1565b610c6c816040518060600160405280602681526020016113ac602691396001600160a01b0386166000908152603360205260409020549190610cf7565b6001600160a01b038085166000908152603360205260408082209390935590841681522054610c9b9082610d8e565b6001600160a01b0380841660008181526033602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b60008184841115610d865760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610d4b578181015183820152602001610d33565b50505050905090810190601f168015610d785780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600082820183811015610de8576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b6001600160a01b038216610e4a576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b610e56600083836110c1565b603554610e639082610d8e565b6035556001600160a01b038216600090815260336020526040902054610e899082610d8e565b6001600160a01b03831660008181526033602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6001600160a01b038216610f265760405162461bcd60e51b81526004018080602001828103825260218152602001806114286021913960400191505060405180910390fd5b610f32826000836110c1565b610f6f81604051806060016040528060228152602001611368602291396001600160a01b0385166000908152603360205260409020549190610cf7565b6001600160a01b038316600090815260336020526040902055603554610f9590826110c6565b6035556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b6000610fe830611123565b15905090565b606580546001600160a01b0319166001600160a01b0392909216919091179055565b600054610100900460ff16806110295750611029610fdd565b80611037575060005460ff16155b6110725760405162461bcd60e51b815260040180806020018281038252602e8152602001806113d2602e913960400191505060405180910390fd5b600054610100900460ff1615801561109d576000805460ff1961ff0019909116610100171660011790555b6110a5611129565b6110af83836111cb565b80156110c1576000805461ff00191690555b505050565b60008282111561111d576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b3b151590565b600054610100900460ff16806111425750611142610fdd565b80611150575060005460ff16155b61118b5760405162461bcd60e51b815260040180806020018281038252602e8152602001806113d2602e913960400191505060405180910390fd5b600054610100900460ff161580156111b6576000805460ff1961ff0019909116610100171660011790555b80156111c8576000805461ff00191690555b50565b600054610100900460ff16806111e457506111e4610fdd565b806111f2575060005460ff16155b61122d5760405162461bcd60e51b815260040180806020018281038252602e8152602001806113d2602e913960400191505060405180910390fd5b600054610100900460ff16158015611258576000805460ff1961ff0019909116610100171660011790555b825161126b9060369060208601906112a3565b50815161127f9060379060208501906112a3565b506038805460ff1916601217905580156110c1576000805461ff0019169055505050565b828054600181600116156101000203166002900490600052602060002090601f0160209004810192826112d9576000855561131f565b82601f106112f257805160ff191683800117855561131f565b8280016001018555821561131f579182015b8281111561131f578251825591602001919060010190611304565b5061132b92915061132f565b5090565b5b8082111561132b576000815560010161133056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e6365496e697469616c697a61626c653a20636f6e747261637420697320616c726561647920696e697469616c697a656445524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa26469706673582212200b687fddcd01dbad6e1d5fbd49cb041f69ed61684a12a4c26c6e37e0f5ad7c2a64736f6c63430007060033","id":1,"type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"L2Curation#GraphCurationToken","networkInteractionId":1,"nonce":1592,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"L2Curation#GraphCurationToken","networkInteractionId":1,"nonce":1592,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0x68f850e03de53f05ada2c9dda84d68477c01208665a4f6128a709f7234db967e"},"type":"TRANSACTION_SEND"} +{"artifactId":"L2Curation#L2Curation","constructorArgs":[],"contractName":"L2Curation","dependencies":[],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","futureId":"L2Curation#L2Curation","futureType":"CONTRACT_DEPLOYMENT","libraries":{},"strategy":"basic","strategyConfig":{},"type":"DEPLOYMENT_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"L2Curation#L2Curation","networkInteraction":{"data":"0x6101806040527fe6876326c1291dfcbbd3864a6816d698cd591defc7aa2153d7f9c4c04016c89f6080527fc713c3df6d14cdf946460395d09af88993ee2b948b1a808161494e32c5f6706360a0527f966f1e8d8d8014e05f6ec4a57138da9be1f7c5a7f802928a18072f7c5318076160c0527f1df41cd916959d1163dc8f0671a666ea8a3e434c13e40faef527133b5d16703460e0527f45fc200c7e4544e457d3c5709bfe0d520442c30bbcbdaede89e8d4a4bbc19247610100527fd362cac9cb75c10d67bcc0b7eeb0b1ef48bb5420b556c092d4fd7f758816fcf0610120527f39605a6c26a173774ca666c67ef70cf491880e5d3d6d0ca66ec0a31034f15ea361014052613d0960e61b6101605234801561011a57600080fd5b5060805160a05160c05160e0516101005161012051610140516101605160e01c6128cc61018f60003980610c2f52508061141b52806119025250806113f25250806113c9528061180c5250806113a05280611dbf5250806113775280611ff252508061134e52508061132552506128cc6000f3fe608060405234801561001057600080fd5b50600436106101da5760003560e01c806399439fee11610104578063cd0ad4a2116100a2578063eff1d50e11610071578063eff1d50e146103f2578063f049b900146103fa578063f115c4271461040d578063f77c479114610415576101da565b8063cd0ad4a2146103af578063cd18119e146103c2578063d6866ea5146103d5578063eba0c8a1146103dd576101da565b80639f94c667116100de5780639f94c6671461035f578063a2594d8214610372578063a25e62c714610385578063b5217bb41461038d576101da565b806399439fee146103265780639b4d9f33146103395780639ce7abe51461034c576101da565b80634c4ea0ed1161017c5780637a2a45b81161014b5780637a2a45b8146102da57806381573288146102ed57806392eefe9b1461030057806393a90a1e14610313576101da565b80634c4ea0ed1461027f5780634c8c7a441461029f5780636536fe32146102b457806369db11a1146102c7576101da565b806326058249116101b857806326058249146102235780633718896d14610238578063375a54ab1461024b57806346e855da1461026c576101da565b80630faaf87f146101df578063185360f91461020857806324bdeec714610210575b600080fd5b6101f26101ed366004612175565b61041d565b6040516101ff91906122ab565b60405180910390f35b6101f26104da565b6101f261021e366004612196565b6104e0565b61022b610662565b6040516101ff9190612273565b6101f2610246366004612175565b610677565b61025e610259366004612196565b6108b6565b6040516101ff9291906127b8565b6101f261027a36600461215d565b610af7565b61029261028d36600461215d565b610b0c565b6040516101ff91906122a0565b6102b26102ad3660046120e4565b610b20565b005b6102b26102c236600461215d565b610cb0565b6101f26102d5366004612175565b610cc4565b6101f26102e8366004612175565b610d78565b6102b26102fb366004612175565b610d8b565b6102b261030e3660046120c8565b610e5e565b6102b26103213660046120c8565b610e6f565b6101f261033436600461215d565b610ecb565b6102b26103473660046120c8565b610f72565b6102b261035a3660046121c1565b610f83565b6101f261036d366004612132565b6110d9565b6102b26103803660046120c8565b61118d565b61022b6112a8565b6103a061039b36600461215d565b6112be565b6040516101ff939291906127dc565b6102b26103bd366004612259565b6112ef565b6102b26103d0366004612259565b61130f565b6102b2611320565b6103e5611441565b6040516101ff9190612801565b61022b611454565b61025e610408366004612175565b611463565b6103e56114c0565b61022b6114cc565b6000828152600f6020908152604080832081516060810183528154815260019091015463ffffffff811693820193909352600160201b9092046001600160a01b0316908201528161046d85610ecb565b82519091506104975760405162461bcd60e51b815260040161048e906125e8565b60405180910390fd5b838110156104b75760405162461bcd60e51b815260040161048e906124f3565b81516104cf9082906104c990876114db565b90611534565b925050505b92915050565b600d5481565b60006104ea61159b565b33836105085760405162461bcd60e51b815260040161048e906122b4565b8361051382876110d9565b10156105315760405162461bcd60e51b815260040161048e906124af565b600061053d868661041d565b90508381101561055f5760405162461bcd60e51b815260040161048e906123ff565b61056886611709565b6000868152600f60205260409020805461058290836117a8565b8155600181015460405163079cc67960e41b8152600160201b9091046001600160a01b0316906379cc6790906105be9086908a90600401612287565b600060405180830381600087803b1580156105d857600080fd5b505af11580156105ec573d6000803e3d6000fd5b505050506105f987610ecb565b61060257600081555b61061461060d611805565b8484611835565b86836001600160a01b03167fe14cd5e80f6821ded0538e85a537487acf10bb5e97a12176df56a099e90bfb3484896040516106509291906127b8565b60405180910390a35095945050505050565b6010546201000090046001600160a01b031681565b600061068161159b565b6106896118fb565b6001600160a01b0316336001600160a01b0316146106b95760405162461bcd60e51b815260040161048e90612781565b816106d65760405162461bcd60e51b815260040161048e906126c0565b60006106e28484611926565b6000858152600f6020526040902090915033906106fe86610b0c565b6107ca576001810154600160201b90046001600160a01b03166107ca57600c5460009061073a90600160401b90046001600160a01b03166119d9565b60405163189acdbd60e31b81529091506001600160a01b0382169063c4d66de890610769903090600401612273565b600060405180830381600087803b15801561078357600080fd5b505af1158015610797573d6000803e3d6000fd5b5050506001830180546001600160a01b03909316600160201b02640100000000600160c01b031990931692909217909155505b6107d386611709565b60006107dd611805565b90506107ea818488611a76565b81546107f69087611ad5565b825560018201546040516340c10f1960e01b8152600160201b9091046001600160a01b0316906340c10f19906108329086908890600401612287565b600060405180830381600087803b15801561084c57600080fd5b505af1158015610860573d6000803e3d6000fd5b5050505086836001600160a01b03167fb7bf5f4e5b23ef992df9875ecea572620d18dab0c1a5486a9b695d20d9ec50cf888760006040516108a3939291906127c6565b60405180910390a3509195945050505050565b6000806108c161159b565b836108de5760405162461bcd60e51b815260040161048e906126c0565b6000806108eb8787611463565b915091508482101561090f5760405162461bcd60e51b815260040161048e906123ff565b6000878152600f60205260409020339061092889610b0c565b6109f4576001810154600160201b90046001600160a01b03166109f457600c5460009061096490600160401b90046001600160a01b03166119d9565b60405163189acdbd60e31b81529091506001600160a01b0382169063c4d66de890610993903090600401612273565b600060405180830381600087803b1580156109ad57600080fd5b505af11580156109c1573d6000803e3d6000fd5b5050506001830180546001600160a01b03909316600160201b02640100000000600160c01b031990931692909217909155505b6109fd89611709565b6000610a07611805565b9050610a1481848b611a76565b610a1e8185611b2f565b610a33610a2b8a866117a8565b835490611ad5565b825560018201546040516340c10f1960e01b8152600160201b9091046001600160a01b0316906340c10f1990610a6f9086908990600401612287565b600060405180830381600087803b158015610a8957600080fd5b505af1158015610a9d573d6000803e3d6000fd5b5050505089836001600160a01b03167fb7bf5f4e5b23ef992df9875ecea572620d18dab0c1a5486a9b695d20d9ec50cf8b8888604051610adf939291906127c6565b60405180910390a35092989197509095505050505050565b6000818152600f60205260409020545b919050565b6000908152600f6020526040902054151590565b610b28611b7b565b6001600160a01b0316336001600160a01b031614610b83576040805162461bcd60e51b815260206004820152601360248201527227b7363c9034b6b83632b6b2b73a30ba34b7b760691b604482015290519081900360640190fd5b601054610100900460ff1680610b9c5750610b9c611ba0565b80610baa575060105460ff16155b610be55760405162461bcd60e51b815260040180806020018281038252602e815260200180612848602e913960400191505060405180910390fd5b601054610100900460ff16158015610c10576010805460ff1961ff0019909116610100171660011790555b610c1985610e66565b600c805467ffffffff000000001916600160201b7f000000000000000000000000000000000000000000000000000000000000000063ffffffff160217905560405160008051602061282883398151915290610c74906123d2565b60405180910390a1610c8583611bb1565b610c8e82611c16565b610c9784611c54565b8015610ca9576010805461ff00191690555b5050505050565b610cb8611ce4565b610cc181611c16565b50565b600081610ce35760405162461bcd60e51b815260040161048e90612322565b6000610cef8484611926565b6000858152600f6020908152604080832081516060810183528154815260019091015463ffffffff811693820193909352600160201b9092046001600160a01b031690820152919250610d4b83610d4588610ecb565b90611ad5565b8251909150600090610d5d9087611ad5565b9050610d6d826104c983876114db565b979650505050505050565b6000610d848383611926565b9392505050565b6010546201000090046001600160a01b0316331480610dc25750610dad611db8565b6001600160a01b0316336001600160a01b0316145b610dde5760405162461bcd60e51b815260040161048e9061255c565b610de782610b0c565b610e035760405162461bcd60e51b815260040161048e9061245c565b6000828152600f602052604090208054610e1d9083611ad5565b815560405183907ff17fdee613a92b35db6b7598eb43750b24d4072eb304e6eca80121e40402e34b90610e519085906122ab565b60405180910390a2505050565b610e66611de3565b610cc181611e42565b610e77611ce4565b6010805462010000600160b01b031916620100006001600160a01b038416908102919091179091556040517f81dcb738da3dabd5bb2adbc7dd107fbbfca936e9c8aecab25f5b17a710a784c790600090a250565b6000818152600f6020526040812060010154600160201b90046001600160a01b03168015610f6957806001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015610f2c57600080fd5b505afa158015610f40573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f649190612241565b610d84565b60009392505050565b610f7a611ce4565b610cc181611c54565b82806001600160a01b031663f851a4406040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610fbf57600080fd5b505af1158015610fd3573d6000803e3d6000fd5b505050506040513d6020811015610fe957600080fd5b50516001600160a01b03163314611047576040805162461bcd60e51b815260206004820152601e60248201527f43616c6c6572206d757374206265207468652070726f78792061646d696e0000604482015290519081900360640190fd5b60405163623faf6160e01b8152602060048201908152602482018490526001600160a01b0386169163623faf619186918691908190604401848480828437600081840152601f19601f8201169050808301925050509350505050600060405180830381600087803b1580156110bb57600080fd5b505af11580156110cf573d6000803e3d6000fd5b5050505050505050565b6000818152600f6020526040812060010154600160201b90046001600160a01b03168015611182576040516370a0823160e01b81526001600160a01b038216906370a082319061112d908790600401612273565b60206040518083038186803b15801561114557600080fd5b505afa158015611159573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061117d9190612241565b611185565b60005b949350505050565b80806001600160a01b031663f851a4406040518163ffffffff1660e01b8152600401602060405180830381600087803b1580156111c957600080fd5b505af11580156111dd573d6000803e3d6000fd5b505050506040513d60208110156111f357600080fd5b50516001600160a01b03163314611251576040805162461bcd60e51b815260206004820152601e60248201527f43616c6c6572206d757374206265207468652070726f78792061646d696e0000604482015290519081900360640190fd5b816001600160a01b03166359fc20bb6040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561128c57600080fd5b505af11580156112a0573d6000803e3d6000fd5b505050505050565b600c54600160401b90046001600160a01b031681565b600f602052600090815260409020805460019091015463ffffffff811690600160201b90046001600160a01b031683565b6112f7611ce4565b60405162461bcd60e51b815260040161048e906123a3565b611317611ce4565b610cc181611bb1565b6113497f0000000000000000000000000000000000000000000000000000000000000000611eea565b6113727f0000000000000000000000000000000000000000000000000000000000000000611eea565b61139b7f0000000000000000000000000000000000000000000000000000000000000000611eea565b6113c47f0000000000000000000000000000000000000000000000000000000000000000611eea565b6113ed7f0000000000000000000000000000000000000000000000000000000000000000611eea565b6114167f0000000000000000000000000000000000000000000000000000000000000000611eea565b61143f7f0000000000000000000000000000000000000000000000000000000000000000611eea565b565b600c54600160201b900463ffffffff1681565b600e546001600160a01b031681565b600c546000908190819061149790620f4240906104c990879061149190849063ffffffff908116906117a816565b906114db565b905060006114a585836117a8565b905060006114b38784611926565b9791965090945050505050565b600c5463ffffffff1681565b6000546001600160a01b031681565b6000826114ea575060006104d4565b828202828482816114f757fe5b0414610d845760405162461bcd60e51b81526004018080602001828103825260218152602001806128766021913960400191505060405180910390fd5b600080821161158a576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b81838161159357fe5b049392505050565b60008054906101000a90046001600160a01b03166001600160a01b0316635c975abb6040518163ffffffff1660e01b815260040160206040518083038186803b1580156115e757600080fd5b505afa1580156115fb573d6000803e3d6000fd5b505050506040513d602081101561161157600080fd5b50511561164e576040805162461bcd60e51b815260206004820152600660248201526514185d5cd95960d21b604482015290519081900360640190fd5b60008054906101000a90046001600160a01b03166001600160a01b0316632e292fc76040518163ffffffff1660e01b815260040160206040518083038186803b15801561169a57600080fd5b505afa1580156116ae573d6000803e3d6000fd5b505050506040513d60208110156116c457600080fd5b50511561143f576040805162461bcd60e51b815260206004820152600e60248201526d14185c9d1a585b0b5c185d5cd95960921b604482015290519081900360640190fd5b6000611713611feb565b90506001600160a01b038116156117a4576040516307470bfb60e21b81526001600160a01b03821690631d1c2fec906117509085906004016122ab565b602060405180830381600087803b15801561176a57600080fd5b505af115801561177e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117a29190612241565b505b5050565b6000828211156117ff576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b60006118307f0000000000000000000000000000000000000000000000000000000000000000612012565b905090565b80156117a257826001600160a01b031663a9059cbb83836040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561189257600080fd5b505af11580156118a6573d6000803e3d6000fd5b505050506040513d60208110156118bc57600080fd5b50516117a2576040805162461bcd60e51b815260206004820152600960248201526810ba3930b739b332b960b91b604482015290519081900360640190fd5b60006118307f0000000000000000000000000000000000000000000000000000000000000000612012565b6000828152600f602090815260408083208151606081018352815480825260019092015463ffffffff811694820194909452600160201b9093046001600160a01b0316918301919091526119c657600d548310156119965760405162461bcd60e51b815260040161048e90612359565b600d546119be906119b6906104c96119ae87836117a8565b6001906114db565b600190611ad5565b9150506104d4565b8051611185906104c98561149188610ecb565b6000604051733d602d80600a3d3981f3363d3d373d3d3d363d7360601b81528260601b60148201526e5af43d82803e903d91602b57fd5bf360881b60288201526037816000f09150506001600160a01b038116610b07576040805162461bcd60e51b8152602060048201526016602482015275115490cc4c4d8dce8818dc99585d194819985a5b195960521b604482015290519081900360640190fd5b80156117a257604080516323b872dd60e01b81526001600160a01b038481166004830152306024830152604482018490529151918516916323b872dd916064808201926020929091908290030181600087803b15801561189257600080fd5b600082820183811015610d84576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b80156117a457816001600160a01b03166342966c68826040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561128c57600080fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6000611bab306120ae565b15905090565b620f424063ffffffff82161115611bda5760405162461bcd60e51b815260040161048e906126f7565b600c805463ffffffff191663ffffffff831617905560405160008051602061282883398151915290611c0b906125b9565b60405180910390a150565b80611c335760405162461bcd60e51b815260040161048e90612645565b600d81905560405160008051602061282883398151915290611c0b9061242c565b6001600160a01b038116611c7a5760405162461bcd60e51b815260040161048e906122eb565b611c83816120ae565b611c9f5760405162461bcd60e51b815260040161048e90612689565b600c805468010000000000000000600160e01b031916600160401b6001600160a01b0384160217905560405160008051602061282883398151915290611c0b90612754565b60008054906101000a90046001600160a01b03166001600160a01b0316634fc07d756040518163ffffffff1660e01b815260040160206040518083038186803b158015611d3057600080fd5b505afa158015611d44573d6000803e3d6000fd5b505050506040513d6020811015611d5a57600080fd5b50516001600160a01b0316331461143f576040805162461bcd60e51b815260206004820152601860248201527f4f6e6c7920436f6e74726f6c6c657220676f7665726e6f720000000000000000604482015290519081900360640190fd5b60006118307f0000000000000000000000000000000000000000000000000000000000000000612012565b6000546001600160a01b0316331461143f576040805162461bcd60e51b815260206004820152601960248201527f43616c6c6572206d75737420626520436f6e74726f6c6c657200000000000000604482015290519081900360640190fd5b6001600160a01b038116611e96576040805162461bcd60e51b815260206004820152601660248201527510dbdb9d1c9bdb1b195c881b5d5cdd081899481cd95d60521b604482015290519081900360640190fd5b600080546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f4ff638452bbf33c012645d18ae6f05515ff5f2d1dfb0cece8cbf018c60903f709181900360200190a150565b6000805460408051637bb20d2f60e11b81526004810185905290516001600160a01b039092169163f7641a5e91602480820192602092909190829003018186803b158015611f3757600080fd5b505afa158015611f4b573d6000803e3d6000fd5b505050506040513d6020811015611f6157600080fd5b50516000838152600160205260409020549091506001600160a01b038083169116146117a45760008281526001602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251908152915184927fd0e7a942b1fc38c411c4f53d153ba14fd24542a6a35ebacd9b6afca1a154e20692908290030190a25050565b60006118307f00000000000000000000000000000000000000000000000000000000000000005b6000818152600160205260408120546001600160a01b0316806104d45760005460408051637bb20d2f60e11b81526004810186905290516001600160a01b039092169163f7641a5e91602480820192602092909190829003018186803b15801561207b57600080fd5b505afa15801561208f573d6000803e3d6000fd5b505050506040513d60208110156120a557600080fd5b50519392505050565b3b151590565b803563ffffffff81168114610b0757600080fd5b6000602082840312156120d9578081fd5b8135610d8481612812565b600080600080608085870312156120f9578283fd5b843561210481612812565b9350602085013561211481612812565b9250612122604086016120b4565b9396929550929360600135925050565b60008060408385031215612144578182fd5b823561214f81612812565b946020939093013593505050565b60006020828403121561216e578081fd5b5035919050565b60008060408385031215612187578182fd5b50508035926020909101359150565b6000806000606084860312156121aa578283fd5b505081359360208301359350604090920135919050565b6000806000604084860312156121d5578283fd5b83356121e081612812565b9250602084013567ffffffffffffffff808211156121fc578384fd5b818601915086601f83011261220f578384fd5b81358181111561221d578485fd5b87602082850101111561222e578485fd5b6020830194508093505050509250925092565b600060208284031215612252578081fd5b5051919050565b60006020828403121561226a578081fd5b610d84826120b4565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b901515815260200190565b90815260200190565b60208082526017908201527f43616e6e6f74206275726e207a65726f207369676e616c000000000000000000604082015260600190565b6020808252601e908201527f546f6b656e206d6173746572206d757374206265206e6f6e2d656d7074790000604082015260600190565b6020808252601d908201527f43616e27742063616c63756c6174652077697468203020746f6b656e73000000604082015260600190565b6020808252602a908201527f4375726174696f6e206465706f7369742069732062656c6f77206d696e696d756040820152691b481c995c5d5a5c995960b21b606082015260800190565b6020808252601590820152742737ba1034b6b83632b6b2b73a32b21034b710261960591b604082015260600190565b60208082526013908201527264656661756c7452657365727665526174696f60681b604082015260600190565b60208082526013908201527229b634b83830b3b290383937ba32b1ba34b7b760691b604082015260600190565b6020808252601690820152751b5a5b9a5b5d5b50dd5c985d1a5bdb91195c1bdcda5d60521b604082015260600190565b60208082526033908201527f5375626772617068206465706c6f796d656e74206d757374206265206375726160408201527274656420746f20636f6c6c656374206665657360681b606082015260800190565b60208082526024908201527f43616e6e6f74206275726e206d6f7265207369676e616c207468616e20796f756040820152631037bbb760e11b606082015260800190565b60208082526043908201527f5369676e616c206d7573742062652061626f7665206f7220657175616c20746f60408201527f207369676e616c2069737375656420696e20746865206375726174696f6e20706060820152621bdbdb60ea1b608082015260a00190565b60208082526037908201527f43616c6c6572206d75737420626520746865207375626772617068207365727660408201527f696365206f72207374616b696e6720636f6e7472616374000000000000000000606082015260800190565b6020808252601590820152746375726174696f6e54617850657263656e7461676560581b604082015260600190565b6020808252603b908201527f5375626772617068206465706c6f796d656e74206d757374206265206375726160408201527f74656420746f20706572666f726d2063616c63756c6174696f6e730000000000606082015260800190565b60208082526024908201527f4d696e696d756d206375726174696f6e206465706f7369742063616e6e6f74206040820152630626520360e41b606082015260800190565b6020808252601f908201527f546f6b656e206d6173746572206d757374206265206120636f6e747261637400604082015260600190565b6020808252601a908201527f43616e6e6f74206465706f736974207a65726f20746f6b656e73000000000000604082015260600190565b60208082526039908201527f4375726174696f6e207461782070657263656e74616765206d7573742062652060408201527f62656c6f77206f7220657175616c20746f204d41585f50504d00000000000000606082015260800190565b60208082526013908201527231bab930ba34b7b72a37b5b2b726b0b9ba32b960691b604082015260600190565b6020808252601a908201527f4f6e6c792074686520474e532063616e2063616c6c2074686973000000000000604082015260600190565b918252602082015260400190565b9283526020830191909152604082015260600190565b92835263ffffffff9190911660208301526001600160a01b0316604082015260600190565b63ffffffff91909116815260200190565b6001600160a01b0381168114610cc157600080fdfe96d5a4b4edf1cefd0900c166d64447f8da1d01d1861a6a60894b5b82a2c15c3c496e697469616c697a61626c653a20636f6e747261637420697320616c726561647920696e697469616c697a6564536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a2646970667358221220182d4780700d3d385918c6f4a2bbe50d522f035098d04683e959156c3033203064736f6c63430007060033","id":1,"type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"L2Curation#L2Curation","networkInteractionId":1,"nonce":1593,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"L2Curation#L2Curation","networkInteractionId":1,"nonce":1593,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0xfd0caf2dcfb174f3acde1c794d754bb83104bf1b77c83a218a67b1cfcfdd4843"},"type":"TRANSACTION_SEND"} +{"artifactId":"L2GraphToken#L2GraphToken","constructorArgs":[],"contractName":"L2GraphToken","dependencies":[],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","futureId":"L2GraphToken#L2GraphToken","futureType":"CONTRACT_DEPLOYMENT","libraries":{},"strategy":"basic","strategyConfig":{},"type":"DEPLOYMENT_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"L2GraphToken#L2GraphToken","networkInteraction":{"data":"0x6101206040527fd87cd6ef79d4e2b95e15ce8abf732db51ec771f1ca2edccf22a46c729ac564726080527fefcec85968da792893fa503eb21730083fc6c50ed5461e56163b28335b2a5f9660a0527f044852b2a670ade5407e78fb2863c51de9fcb96542a07186fe3aeda6bb8a116d60c0527fe33842a7acd1d5a1d28f25a931703e5605152dc48d64dc4716efdae1f565959160e0527f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9610100523480156100c657600080fd5b5060805160a05160c05160e0516101005161261e61010660003980611547525080611eae525080611e5e525080611e3d525080611e1c525061261e6000f3fe608060405234801561001057600080fd5b50600436106101fb5760003560e01c80638c2a993e1161011a578063a9059cbb116100ad578063ca52d7d71161007c578063ca52d7d71461067a578063d505accf146106a0578063dd62ed3e146106f1578063e3056a341461071f578063f2fde38b14610727576101fb565b8063a9059cbb146105fa578063aa271e1a14610626578063c2eeeebd1461064c578063c4d66de814610654576101fb565b806398650275116100e957806398650275146105205780639ce7abe514610528578063a2594d82146105a8578063a457c2d7146105ce576101fb565b80638c2a993e146104a057806390646b4a146104cc57806395d89b41146104f2578063983b2d56146104fa576101fb565b8063395093511161019257806374f4f5471161016157806374f4f5471461041a57806379ba50971461044657806379cc67901461044e5780637ecebe001461047a576101fb565b8063395093511461037f57806340c10f19146103ab57806342966c68146103d757806370a08231146103f4576101fb565b806318160ddd116101ce57806318160ddd146102e957806323b872dd146103035780633092afd514610339578063313ce56714610361576101fb565b806306fdde0314610200578063095ea7b31461027d5780630c340a24146102bd578063116191b6146102e1575b600080fd5b61020861074d565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561024257818101518382015260200161022a565b50505050905090810190601f16801561026f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102a96004803603604081101561029357600080fd5b506001600160a01b0381351690602001356107e3565b604080519115158252519081900360200190f35b6102c5610800565b604080516001600160a01b039092168252519081900360200190f35b6102c561080f565b6102f161081e565b60408051918252519081900360200190f35b6102a96004803603606081101561031957600080fd5b506001600160a01b03813581169160208101359091169060400135610824565b61035f6004803603602081101561034f57600080fd5b50356001600160a01b03166108ab565b005b610369610958565b6040805160ff9092168252519081900360200190f35b6102a96004803603604081101561039557600080fd5b506001600160a01b038135169060200135610961565b61035f600480360360408110156103c157600080fd5b506001600160a01b0381351690602001356109af565b61035f600480360360208110156103ed57600080fd5b5035610a0e565b6102f16004803603602081101561040a57600080fd5b50356001600160a01b0316610a1f565b61035f6004803603604081101561043057600080fd5b506001600160a01b038135169060200135610a3a565b61035f610ad4565b61035f6004803603604081101561046457600080fd5b506001600160a01b038135169060200135610be2565b6102f16004803603602081101561049057600080fd5b50356001600160a01b0316610c3c565b61035f600480360360408110156104b657600080fd5b506001600160a01b038135169060200135610c4e565b61035f600480360360208110156104e257600080fd5b50356001600160a01b0316610ce8565b610208610de1565b61035f6004803603602081101561051057600080fd5b50356001600160a01b0316610e42565b61035f610eef565b61035f6004803603604081101561053e57600080fd5b6001600160a01b03823516919081019060408101602082013564010000000081111561056957600080fd5b82018360208201111561057b57600080fd5b8035906020019184600183028401116401000000008311171561059d57600080fd5b509092509050610f43565b61035f600480360360208110156105be57600080fd5b50356001600160a01b0316611099565b6102a9600480360360408110156105e457600080fd5b506001600160a01b0381351690602001356111b4565b6102a96004803603604081101561061057600080fd5b506001600160a01b03813516906020013561121c565b6102a96004803603602081101561063c57600080fd5b50356001600160a01b0316611230565b6102c561124e565b61035f6004803603602081101561066a57600080fd5b50356001600160a01b031661125d565b61035f6004803603602081101561069057600080fd5b50356001600160a01b03166113d3565b61035f600480360360e08110156106b657600080fd5b506001600160a01b03813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c001356114cf565b6102f16004803603604081101561070757600080fd5b506001600160a01b0381358116916020013516611680565b6102c56116ab565b61035f6004803603602081101561073d57600080fd5b50356001600160a01b03166116ba565b60378054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156107d95780601f106107ae576101008083540402835291602001916107d9565b820191906000526020600020905b8154815290600101906020018083116107bc57829003601f168201915b5050505050905090565b60006107f76107f06117b8565b84846117bc565b50600192915050565b6000546001600160a01b031681565b60ca546001600160a01b031681565b60365490565b60006108318484846118a8565b6108a18461083d6117b8565b61089c8560405180606001604052806028815260200161250e602891396001600160a01b038a1660009081526035602052604081209061087b6117b8565b6001600160a01b031681526020810191909152604001600020549190611a05565b6117bc565b5060019392505050565b6000546001600160a01b03163314610903576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b61090c81611230565b61094c576040805162461bcd60e51b815260206004820152600c60248201526b2727aa2fa0afa6a4a72a22a960a11b604482015290519081900360640190fd5b61095581611a9c565b50565b60395460ff1690565b60006107f761096e6117b8565b8461089c856035600061097f6117b8565b6001600160a01b03908116825260208083019390935260409182016000908120918c168152925290205490611ae5565b6109b833611230565b610a00576040805162461bcd60e51b815260206004820152601460248201527313db9b1e481b5a5b9d195c8818d85b8818d85b1b60621b604482015290519081900360640190fd5b610a0a8282611b46565b5050565b610955610a196117b8565b82611c38565b6001600160a01b031660009081526034602052604090205490565b60ca546001600160a01b03163314610a87576040805162461bcd60e51b815260206004820152600b60248201526a4e4f545f4741544557415960a81b604482015290519081900360640190fd5b610a918282610be2565b6040805182815290516001600160a01b038416917fe87aeeb22c5753db7f543198a4c3089d2233040ea9d1cab0eaa3b96d94d4fc6e919081900360200190a25050565b6001546001600160a01b03168015801590610af75750336001600160a01b038216145b610b48576040805162461bcd60e51b815260206004820152601f60248201527f43616c6c6572206d7573742062652070656e64696e6720676f7665726e6f7200604482015290519081900360640190fd5b600080546001600160a01b038381166001600160a01b031980841691909117808555600180549092169091556040519282169391169183917f0ac6deed30eef60090c749850e10f2fa469e3e25fec1d1bef2853003f6e6f18f91a36001546040516001600160a01b03918216918416907f76563ad561b7036ae716b9b25cb521b21463240f104c97e12f25877f2235f33d90600090a35050565b6000610c198260405180606001604052806024815260200161253660249139610c1286610c0d6117b8565b611680565b9190611a05565b9050610c2d83610c276117b8565b836117bc565b610c378383611c38565b505050565b609a6020526000908152604090205481565b60ca546001600160a01b03163314610c9b576040805162461bcd60e51b815260206004820152600b60248201526a4e4f545f4741544557415960a81b604482015290519081900360640190fd5b610ca58282611b46565b6040805182815290516001600160a01b038416917fae4b6e741e38054ad6705655cc56c91c184f6768f76b41e10803e2766d89e19f919081900360200190a25050565b6000546001600160a01b03163314610d40576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b6001600160a01b038116610d8d576040805162461bcd60e51b815260206004820152600f60248201526e494e56414c49445f4741544557415960881b604482015290519081900360640190fd5b60ca80546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f5317fa585931182194fed99f2ea5f2efd38af9cff9724273704c8501c521e34b9181900360200190a150565b60388054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156107d95780601f106107ae576101008083540402835291602001916107d9565b6000546001600160a01b03163314610e9a576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b6001600160a01b038116610ee6576040805162461bcd60e51b815260206004820152600e60248201526d24a72b20a624a22fa6a4a72a22a960911b604482015290519081900360640190fd5b61095581611d34565b610ef833611230565b610f38576040805162461bcd60e51b815260206004820152600c60248201526b2727aa2fa0afa6a4a72a22a960a11b604482015290519081900360640190fd5b610f4133611a9c565b565b82806001600160a01b031663f851a4406040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610f7f57600080fd5b505af1158015610f93573d6000803e3d6000fd5b505050506040513d6020811015610fa957600080fd5b50516001600160a01b03163314611007576040805162461bcd60e51b815260206004820152601e60248201527f43616c6c6572206d757374206265207468652070726f78792061646d696e0000604482015290519081900360640190fd5b60405163623faf6160e01b8152602060048201908152602482018490526001600160a01b0386169163623faf619186918691908190604401848480828437600081840152601f19601f8201169050808301925050509350505050600060405180830381600087803b15801561107b57600080fd5b505af115801561108f573d6000803e3d6000fd5b5050505050505050565b80806001600160a01b031663f851a4406040518163ffffffff1660e01b8152600401602060405180830381600087803b1580156110d557600080fd5b505af11580156110e9573d6000803e3d6000fd5b505050506040513d60208110156110ff57600080fd5b50516001600160a01b0316331461115d576040805162461bcd60e51b815260206004820152601e60248201527f43616c6c6572206d757374206265207468652070726f78792061646d696e0000604482015290519081900360640190fd5b816001600160a01b03166359fc20bb6040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561119857600080fd5b505af11580156111ac573d6000803e3d6000fd5b505050505050565b60006107f76111c16117b8565b8461089c856040518060600160405280602581526020016125c460259139603560006111eb6117b8565b6001600160a01b03908116825260208083019390935260409182016000908120918d16815292529020549190611a05565b60006107f76112296117b8565b84846118a8565b6001600160a01b031660009081526099602052604090205460ff1690565b60cb546001600160a01b031681565b611265611d80565b6001600160a01b0316336001600160a01b0316146112c0576040805162461bcd60e51b815260206004820152601360248201527227b7363c9034b6b83632b6b2b73a30ba34b7b760691b604482015290519081900360640190fd5b600154600160a81b900460ff16806112db57506112db611da5565b806112f05750600154600160a01b900460ff16155b61132b5760405162461bcd60e51b815260040180806020018281038252602e8152602001806124be602e913960400191505060405180910390fd5b600154600160a81b900460ff16158015611362576001805460ff60a01b1960ff60a81b19909116600160a81b1716600160a01b1790555b6001600160a01b0382166113b1576040805162461bcd60e51b815260206004820152601160248201527013dddb995c881b5d5cdd081899481cd95d607a1b604482015290519081900360640190fd5b6113bc826000611db6565b8015610a0a576001805460ff60a81b191690555050565b6000546001600160a01b0316331461142b576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b6001600160a01b03811661147b576040805162461bcd60e51b8152602060048201526012602482015271494e56414c49445f4c315f4144445245535360701b604482015290519081900360640190fd5b60cb80546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f603c0b2e4494ac82839a70be8b6c660d7d042ccfe71c3ce0e5157f59090e74459181900360200190a150565b8315806114dc5750834211155b611523576040805162461bcd60e51b815260206004820152601360248201527211d4950e88195e1c1a5c9959081c195c9b5a5d606a1b604482015290519081900360640190fd5b6098546001600160a01b038089166000818152609a602090815260408083205481517f00000000000000000000000000000000000000000000000000000000000000008185015280830195909552948c166060850152608084018b905260a084019490945260c08084018a90528451808503909101815260e08401855280519082012061190160f01b61010085015261010284019590955261012280840195909552835180840390950185526101429092019092528251920191909120906115ed82868686611ef3565b9050806001600160a01b0316896001600160a01b03161461164b576040805162461bcd60e51b815260206004820152601360248201527211d4950e881a5b9d985b1a59081c195c9b5a5d606a1b604482015290519081900360640190fd5b6001600160a01b0389166000908152609a60205260409020805460010190556116758989896117bc565b505050505050505050565b6001600160a01b03918216600090815260356020908152604080832093909416825291909152205490565b6001546001600160a01b031681565b6000546001600160a01b03163314611712576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b6001600160a01b038116611764576040805162461bcd60e51b815260206004820152601460248201527311dbdd995c9b9bdc881b5d5cdd081899481cd95d60621b604482015290519081900360640190fd5b600180546001600160a01b038381166001600160a01b03198316179283905560405191811692169082907f76563ad561b7036ae716b9b25cb521b21463240f104c97e12f25877f2235f33d90600090a35050565b3390565b6001600160a01b0383166118015760405162461bcd60e51b81526004018080602001828103825260248152602001806125a06024913960400191505060405180910390fd5b6001600160a01b0382166118465760405162461bcd60e51b81526004018080602001828103825260228152602001806124546022913960400191505060405180910390fd5b6001600160a01b03808416600081815260356020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b0383166118ed5760405162461bcd60e51b815260040180806020018281038252602581526020018061257b6025913960400191505060405180910390fd5b6001600160a01b0382166119325760405162461bcd60e51b815260040180806020018281038252602381526020018061240f6023913960400191505060405180910390fd5b61193d838383610c37565b61197a81604051806060016040528060268152602001612476602691396001600160a01b0386166000908152603460205260409020549190611a05565b6001600160a01b0380851660009081526034602052604080822093909355908416815220546119a99082611ae5565b6001600160a01b0380841660008181526034602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b60008184841115611a945760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611a59578181015183820152602001611a41565b50505050905090810190601f168015611a865780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6001600160a01b038116600081815260996020526040808220805460ff19169055517fe94479a9f7e1952cc78f2d6baab678adc1b772d936c6583def489e524cb666929190a250565b600082820183811015611b3f576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b6001600160a01b038216611ba1576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b611bad60008383610c37565b603654611bba9082611ae5565b6036556001600160a01b038216600090815260346020526040902054611be09082611ae5565b6001600160a01b03831660008181526034602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6001600160a01b038216611c7d5760405162461bcd60e51b815260040180806020018281038252602181526020018061255a6021913960400191505060405180910390fd5b611c8982600083610c37565b611cc681604051806060016040528060228152602001612432602291396001600160a01b0385166000908152603460205260409020549190611a05565b6001600160a01b038316600090815260346020526040902055603654611cec9082612071565b6036556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b6001600160a01b038116600081815260996020526040808220805460ff19166001179055517f6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f69190a250565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6000611db0306120ce565b15905090565b611dfe6040518060400160405280600b81526020016a23b930b834102a37b5b2b760a91b8152506040518060400160405280600381526020016211d49560ea1b8152506120d4565b611e07826121a0565b611e118282611b46565b611e1a82611d34565b7f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000611e856121c2565b6040805160208082019690965280820194909452606084019290925260808301523060a08301527f000000000000000000000000000000000000000000000000000000000000000060c0808401919091528151808403909101815260e0909201905280519101206098555050565b60007f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0821115611f545760405162461bcd60e51b815260040180806020018281038252602281526020018061249c6022913960400191505060405180910390fd5b8360ff16601b1480611f6957508360ff16601c145b611fa45760405162461bcd60e51b81526004018080602001828103825260228152602001806124ec6022913960400191505060405180910390fd5b600060018686868660405160008152602001604052604051808581526020018460ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa158015612000573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116612068576040805162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015290519081900360640190fd5b95945050505050565b6000828211156120c8576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b3b151590565b600154600160a81b900460ff16806120ef57506120ef611da5565b806121045750600154600160a01b900460ff16155b61213f5760405162461bcd60e51b815260040180806020018281038252602e8152602001806124be602e913960400191505060405180910390fd5b600154600160a81b900460ff16158015612176576001805460ff60a01b1960ff60a81b19909116600160a81b1716600160a01b1790555b61217e6121c6565b612188838361227e565b8015610c37576001805460ff60a81b19169055505050565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b4690565b600154600160a81b900460ff16806121e157506121e1611da5565b806121f65750600154600160a01b900460ff16155b6122315760405162461bcd60e51b815260040180806020018281038252602e8152602001806124be602e913960400191505060405180910390fd5b600154600160a81b900460ff16158015612268576001805460ff60a01b1960ff60a81b19909116600160a81b1716600160a01b1790555b8015610955576001805460ff60a81b1916905550565b600154600160a81b900460ff16806122995750612299611da5565b806122ae5750600154600160a01b900460ff16155b6122e95760405162461bcd60e51b815260040180806020018281038252602e8152602001806124be602e913960400191505060405180910390fd5b600154600160a81b900460ff16158015612320576001805460ff60a01b1960ff60a81b19909116600160a81b1716600160a01b1790555b825161233390603790602086019061236d565b50815161234790603890602085019061236d565b506039805460ff191660121790558015610c37576001805460ff60a81b19169055505050565b828054600181600116156101000203166002900490600052602060002090601f0160209004810192826123a357600085556123e9565b82601f106123bc57805160ff19168380011785556123e9565b828001600101855582156123e9579182015b828111156123e95782518255916020019190600101906123ce565b506123f59291506123f9565b5090565b5b808211156123f557600081556001016123fa56fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545434453413a20696e76616c6964207369676e6174757265202773272076616c7565496e697469616c697a61626c653a20636f6e747261637420697320616c726561647920696e697469616c697a656445434453413a20696e76616c6964207369676e6174757265202776272076616c756545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e20616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220ff9ed43c1b257716d58111b6358b62039b7d7359bc9f0f142332535a4370cafe64736f6c63430007060033","id":1,"type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"L2GraphToken#L2GraphToken","networkInteractionId":1,"nonce":1594,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"L2GraphToken#L2GraphToken","networkInteractionId":1,"nonce":1594,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0x6730a19b4ae0823f98e12f2af100906334a11b2fdd6b1494c9f7ad68d8f0053b"},"type":"TRANSACTION_SEND"} +{"artifactId":"L2GraphTokenGateway#L2GraphTokenGateway","constructorArgs":[],"contractName":"L2GraphTokenGateway","dependencies":[],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","futureId":"L2GraphTokenGateway#L2GraphTokenGateway","futureType":"CONTRACT_DEPLOYMENT","libraries":{},"strategy":"basic","strategyConfig":{},"type":"DEPLOYMENT_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"L2GraphTokenGateway#L2GraphTokenGateway","networkInteraction":{"data":"0x6101606040527fe6876326c1291dfcbbd3864a6816d698cd591defc7aa2153d7f9c4c04016c89f6080527fc713c3df6d14cdf946460395d09af88993ee2b948b1a808161494e32c5f6706360a0527f966f1e8d8d8014e05f6ec4a57138da9be1f7c5a7f802928a18072f7c5318076160c0527f1df41cd916959d1163dc8f0671a666ea8a3e434c13e40faef527133b5d16703460e0527f45fc200c7e4544e457d3c5709bfe0d520442c30bbcbdaede89e8d4a4bbc19247610100527fd362cac9cb75c10d67bcc0b7eeb0b1ef48bb5420b556c092d4fd7f758816fcf0610120527f39605a6c26a173774ca666c67ef70cf491880e5d3d6d0ca66ec0a31034f15ea36101405234801561011057600080fd5b5060805160a05160c05160e05161010051610120516101405161222b6101696000398061112f5250806111065250806110dd528061150a5250806110b452508061108b525080611062525080611039525061222b6000f3fe6080604052600436106101405760003560e01c806392eefe9b116100b6578063c4d66de81161006f578063c4d66de814610355578063d2ce7d6514610375578063d685c0b214610388578063d6866ea5146103a8578063f14a4bd5146103bd578063f77c4791146103d257610140565b806392eefe9b146102a05780639ce7abe5146102c0578063a0c76a96146102e0578063a2594d8214610300578063a7e28d4814610320578063c4c0087c1461034057610140565b806348bde20c1161010857806348bde20c146101e75780634adc698a146102075780635c975abb1461021c57806369bc8cd41461023e5780637b3a3c8b1461025e57806391b4ded91461028b57610140565b80630252fec114610145578063147ddef51461016757806316c38b3c1461019257806324a3d622146101b25780632e567b36146101d4575b600080fd5b34801561015157600080fd5b50610165610160366004611b43565b6103e7565b005b34801561017357600080fd5b5061017c610474565b60405161018991906121a9565b60405180910390f35b34801561019e57600080fd5b506101656101ad366004611da9565b61047a565b3480156101be57600080fd5b506101c7610572565b6040516101899190611e67565b6101656101e2366004611bb4565b610581565b3480156101f357600080fd5b50610165610202366004611b43565b6107b9565b34801561021357600080fd5b506101c7610825565b34801561022857600080fd5b50610231610834565b6040516101899190611f43565b34801561024a57600080fd5b50610165610259366004611b43565b610842565b34801561026a57600080fd5b5061027e610279366004611cb4565b6108bb565b6040516101899190611f4e565b34801561029757600080fd5b5061017c6108d7565b3480156102ac57600080fd5b506101656102bb366004611b43565b6108dd565b3480156102cc57600080fd5b506101656102db366004611dc9565b6108ee565b3480156102ec57600080fd5b5061027e6102fb366004611c37565b610a44565b34801561030c57600080fd5b5061016561031b366004611b43565b610ac4565b34801561032c57600080fd5b506101c761033b366004611b43565b610bdf565b34801561034c57600080fd5b506101c7610c0f565b34801561036157600080fd5b50610165610370366004611b43565b610c1e565b61027e610383366004611d25565b610d44565b34801561039457600080fd5b506101656103a3366004611b43565b610fbb565b3480156103b457600080fd5b50610165611034565b3480156103c957600080fd5b506101c7611155565b3480156103de57600080fd5b506101c7611164565b6103ef611173565b6001600160a01b03811661041e5760405162461bcd60e51b815260040161041590612034565b60405180910390fd5b607780546001600160a01b0319166001600160a01b0383161790556040517f43a303848c82a28f94def3043839eaebd654c19fdada874a74fb94d8bf7d343890610469908390611e67565b60405180910390a150565b60015481565b6004805460408051634fc07d7560e01b815290516001600160a01b0390921692634fc07d75928282019260209290829003018186803b1580156104bc57600080fd5b505afa1580156104d0573d6000803e3d6000fd5b505050506040513d60208110156104e657600080fd5b50516001600160a01b031633148061050857506003546001600160a01b031633145b610559576040805162461bcd60e51b815260206004820152601960248201527f4f6e6c7920476f7665726e6f72206f7220477561726469616e00000000000000604482015290519081900360640190fd5b806105665761056661123d565b61056f816112b5565b50565b6003546001600160a01b031681565b600260435414156105d9576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b60026043556105e6611340565b6076546105fb906001600160a01b0316611391565b6001600160a01b0316336001600160a01b03161461062b5760405162461bcd60e51b815260040161041590612172565b6075546001600160a01b038781169116146106585760405162461bcd60e51b81526004016104159061214b565b34156106765760405162461bcd60e51b815260040161041590611fdd565b60755461068b906001600160a01b0316610bdf565b6001600160a01b0316638c2a993e85856040518363ffffffff1660e01b81526004016106b8929190611ee2565b600060405180830381600087803b1580156106d257600080fd5b505af11580156106e6573d6000803e3d6000fd5b505082159150610757905057604051635260769b60e11b81526001600160a01b0385169063a4c0ed3690610724908890879087908790600401611efb565b600060405180830381600087803b15801561073e57600080fd5b505af1158015610752573d6000803e3d6000fd5b505050505b836001600160a01b0316856001600160a01b0316876001600160a01b03167fc7f2e9c55c40a50fbc217dfc70cd39a222940dfa62145aa0ca49eb9535d4fcb2866040516107a491906121a9565b60405180910390a45050600160435550505050565b6107c1611173565b6001600160a01b03811661081c576040805162461bcd60e51b815260206004820152601960248201527f5061757365477561726469616e206d7573742062652073657400000000000000604482015290519081900360640190fd5b61056f816113aa565b6077546001600160a01b031681565b600054610100900460ff1690565b61084a611173565b6001600160a01b0381166108705760405162461bcd60e51b81526004016104159061200c565b607580546001600160a01b0319166001600160a01b0383161790556040517f0b7cf729ac6c387cab57a28d257c6ecac863c24b086353121057083c7bfc79f990610469908390611e67565b60606108cd8686866000808888610d44565b9695505050505050565b60025481565b6108e56113fc565b61056f8161145b565b82806001600160a01b031663f851a4406040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561092a57600080fd5b505af115801561093e573d6000803e3d6000fd5b505050506040513d602081101561095457600080fd5b50516001600160a01b031633146109b2576040805162461bcd60e51b815260206004820152601e60248201527f43616c6c6572206d757374206265207468652070726f78792061646d696e0000604482015290519081900360640190fd5b60405163623faf6160e01b8152602060048201908152602482018490526001600160a01b0386169163623faf619186918691908190604401848480828437600081840152601f19601f8201169050808301925050509350505050600060405180830381600087803b158015610a2657600080fd5b505af1158015610a3a573d6000803e3d6000fd5b5050505050505050565b6060632e567b3660e01b86868686600087604051602001610a66929190611f61565b60408051601f1981840301815290829052610a879594939291602401611e7b565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152905095945050505050565b80806001600160a01b031663f851a4406040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610b0057600080fd5b505af1158015610b14573d6000803e3d6000fd5b505050506040513d6020811015610b2a57600080fd5b50516001600160a01b03163314610b88576040805162461bcd60e51b815260206004820152601e60248201527f43616c6c6572206d757374206265207468652070726f78792061646d696e0000604482015290519081900360640190fd5b816001600160a01b03166359fc20bb6040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610bc357600080fd5b505af1158015610bd7573d6000803e3d6000fd5b505050505050565b6075546000906001600160a01b03838116911614610bff57506000610c0a565b610c07611503565b90505b919050565b6076546001600160a01b031681565b610c26611533565b6001600160a01b0316336001600160a01b031614610c81576040805162461bcd60e51b815260206004820152601360248201527227b7363c9034b6b83632b6b2b73a30ba34b7b760691b604482015290519081900360640190fd5b604254610100900460ff1680610c9a5750610c9a611558565b80610ca8575060425460ff16155b610ce35760405162461bcd60e51b815260040180806020018281038252602e8152602001806121c8602e913960400191505060405180910390fd5b604254610100900460ff16158015610d0e576042805460ff1961ff0019909116610100171660011790555b610d17826108e5565b6000805461ff001916610100179055610d2e611569565b8015610d40576042805461ff00191690555b5050565b606060026043541415610d9e576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b6002604355610dab611340565b6075546001600160a01b03898116911614610dd85760405162461bcd60e51b81526004016104159061214b565b85610df55760405162461bcd60e51b815260040161041590611fb0565b3415610e135760405162461bcd60e51b815260040161041590611fdd565b6001600160a01b038716610e395760405162461bcd60e51b81526004016104159061205f565b610e41611a76565b610e4b8484611612565b602083018190526001600160a01b0390911682525115610e7d5760405162461bcd60e51b8152600401610415906120bc565b607554610e92906001600160a01b0316610bdf565b81516040516374f4f54760e01b81526001600160a01b0392909216916374f4f54791610ec2918b90600401611ee2565b600060405180830381600087803b158015610edc57600080fd5b505af1158015610ef0573d6000803e3d6000fd5b505050506000610f3060008360000151607660009054906101000a90046001600160a01b0316610f2b8e87600001518f8f8a60200151610a44565b61168f565b905080896001600160a01b031683600001516001600160a01b03167f3073a74ecb728d10be779fe19a74a1428e20468f5b4d167bf9c73d9067847d738d60008d604051610f7f93929190611ec1565b60405180910390a480604051602001610f9891906121a9565b604051602081830303815290604052925050506001604355979650505050505050565b610fc3611173565b6001600160a01b038116610fe95760405162461bcd60e51b81526004016104159061208c565b607680546001600160a01b0319166001600160a01b0383161790556040517f60d5265d09ed32300af9a69188333d24b405b6f4196f623f3e2b78321181a61590610469908390611e67565b61105d7f000000000000000000000000000000000000000000000000000000000000000061182f565b6110867f000000000000000000000000000000000000000000000000000000000000000061182f565b6110af7f000000000000000000000000000000000000000000000000000000000000000061182f565b6110d87f000000000000000000000000000000000000000000000000000000000000000061182f565b6111017f000000000000000000000000000000000000000000000000000000000000000061182f565b61112a7f000000000000000000000000000000000000000000000000000000000000000061182f565b6111537f000000000000000000000000000000000000000000000000000000000000000061182f565b565b6075546001600160a01b031681565b6004546001600160a01b031681565b6004805460408051634fc07d7560e01b815290516001600160a01b0390921692634fc07d75928282019260209290829003018186803b1580156111b557600080fd5b505afa1580156111c9573d6000803e3d6000fd5b505050506040513d60208110156111df57600080fd5b50516001600160a01b03163314611153576040805162461bcd60e51b815260206004820152601860248201527f4f6e6c7920436f6e74726f6c6c657220676f7665726e6f720000000000000000604482015290519081900360640190fd5b6077546001600160a01b03166112655760405162461bcd60e51b815260040161041590611f85565b6076546001600160a01b031661128d5760405162461bcd60e51b8152600401610415906120f3565b6075546001600160a01b03166111535760405162461bcd60e51b815260040161041590612123565b600060019054906101000a900460ff16151581151514156112d55761056f565b6000805461ff0019166101008315158102919091179182905560ff910416156112fd57426002555b6000546040805161010090920460ff1615158252517f8fb6c181ee25a520cf3dd6565006ef91229fcfe5a989566c2a3b8c115570cec5916020908290030190a150565b600054610100900460ff1615611153576040805162461bcd60e51b81526020600482015260116024820152705061757365642028636f6e74726163742960781b604482015290519081900360640190fd5b7311110000000000000000000000000000000011110190565b600380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f0613b6ee6a04f0d09f390e4d9318894b9f6ac7fd83897cd8d18896ba579c401e90600090a35050565b6004546001600160a01b03163314611153576040805162461bcd60e51b815260206004820152601960248201527f43616c6c6572206d75737420626520436f6e74726f6c6c657200000000000000604482015290519081900360640190fd5b6001600160a01b0381166114af576040805162461bcd60e51b815260206004820152601660248201527510dbdb9d1c9bdb1b195c881b5d5cdd081899481cd95d60521b604482015290519081900360640190fd5b600480546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f4ff638452bbf33c012645d18ae6f05515ff5f2d1dfb0cece8cbf018c60903f709181900360200190a150565b600061152e7f0000000000000000000000000000000000000000000000000000000000000000611930565b905090565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6000611563306119ca565b15905090565b604254610100900460ff16806115825750611582611558565b80611590575060425460ff16155b6115cb5760405162461bcd60e51b815260040180806020018281038252602e8152602001806121c8602e913960400191505060405180910390fd5b604254610100900460ff161580156115f6576042805460ff1961ff0019909116610100171660011790555b6115fe6119d0565b801561056f576042805461ff001916905550565b607754600090606090829082906001600160a01b03163314156116455761163b85870187611b66565b9092509050611682565b33915085858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509293505050505b90925090505b9250929050565b60008060646001600160a01b031663928c169a8786866040518463ffffffff1660e01b815260040180836001600160a01b0316815260200180602001828103825283818151815260200191508051906020019080838360005b838110156117005781810151838201526020016116e8565b50505050905090810190601f16801561172d5780820380516001836020036101000a031916815260200191505b5093505050506020604051808303818588803b15801561174c57600080fd5b505af1158015611760573d6000803e3d6000fd5b50505050506040513d602081101561177757600080fd5b5051604080516020808252865182820152865193945084936001600160a01b03808a1694908b16937f2b986d32a0536b7e19baa48ab949fec7b903b7fad7730820b20632d100cc3a68938a93919283929083019185019080838360005b838110156117ec5781810151838201526020016117d4565b50505050905090810190601f1680156118195780820380516001836020036101000a031916815260200191505b509250505060405180910390a495945050505050565b6004805460408051637bb20d2f60e11b8152928301849052516000926001600160a01b039092169163f7641a5e916024808301926020929190829003018186803b15801561187c57600080fd5b505afa158015611890573d6000803e3d6000fd5b505050506040513d60208110156118a657600080fd5b50516000838152600560205260409020549091506001600160a01b03808316911614610d405760008281526005602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251908152915184927fd0e7a942b1fc38c411c4f53d153ba14fd24542a6a35ebacd9b6afca1a154e20692908290030190a25050565b6000818152600560205260408120546001600160a01b031680610c07576004805460408051637bb20d2f60e11b8152928301869052516001600160a01b039091169163f7641a5e916024808301926020929190829003018186803b15801561199757600080fd5b505afa1580156119ab573d6000803e3d6000fd5b505050506040513d60208110156119c157600080fd5b50519392505050565b3b151590565b604254610100900460ff16806119e957506119e9611558565b806119f7575060425460ff16155b611a325760405162461bcd60e51b815260040180806020018281038252602e8152602001806121c8602e913960400191505060405180910390fd5b604254610100900460ff16158015611a5d576042805460ff1961ff0019909116610100171660011790555b6001604355801561056f576042805461ff001916905550565b60408051808201909152600081526060602082015290565b60008083601f840112611a9f578182fd5b50813567ffffffffffffffff811115611ab6578182fd5b60208301915083602082850101111561168857600080fd5b600082601f830112611ade578081fd5b813567ffffffffffffffff80821115611af357fe5b604051601f8301601f191681016020018281118282101715611b1157fe5b604052828152848301602001861015611b28578384fd5b82602086016020830137918201602001929092529392505050565b600060208284031215611b54578081fd5b8135611b5f816121b2565b9392505050565b60008060408385031215611b78578081fd5b8235611b83816121b2565b9150602083013567ffffffffffffffff811115611b9e578182fd5b611baa85828601611ace565b9150509250929050565b60008060008060008060a08789031215611bcc578182fd5b8635611bd7816121b2565b95506020870135611be7816121b2565b94506040870135611bf7816121b2565b935060608701359250608087013567ffffffffffffffff811115611c19578283fd5b611c2589828a01611a8e565b979a9699509497509295939492505050565b600080600080600060a08688031215611c4e578081fd5b8535611c59816121b2565b94506020860135611c69816121b2565b93506040860135611c79816121b2565b925060608601359150608086013567ffffffffffffffff811115611c9b578182fd5b611ca788828901611ace565b9150509295509295909350565b600080600080600060808688031215611ccb578081fd5b8535611cd6816121b2565b94506020860135611ce6816121b2565b935060408601359250606086013567ffffffffffffffff811115611d08578182fd5b611d1488828901611a8e565b969995985093965092949392505050565b600080600080600080600060c0888a031215611d3f578081fd5b8735611d4a816121b2565b96506020880135611d5a816121b2565b955060408801359450606088013593506080880135925060a088013567ffffffffffffffff811115611d8a578182fd5b611d968a828b01611a8e565b989b979a50959850939692959293505050565b600060208284031215611dba578081fd5b81358015158114611b5f578182fd5b600080600060408486031215611ddd578283fd5b8335611de8816121b2565b9250602084013567ffffffffffffffff811115611e03578283fd5b611e0f86828701611a8e565b9497909650939450505050565b60008151808452815b81811015611e4157602081850181015186830182015201611e25565b81811115611e525782602083870101525b50601f01601f19169290920160200192915050565b6001600160a01b0391909116815260200190565b6001600160a01b0386811682528581166020830152841660408201526060810183905260a060808201819052600090611eb690830184611e1c565b979650505050505050565b6001600160a01b039390931683526020830191909152604082015260600190565b6001600160a01b03929092168252602082015260400190565b6001600160a01b0385168152602081018490526060604082018190528101829052600082846080840137818301608090810191909152601f909201601f191601019392505050565b901515815260200190565b600060208252611b5f6020830184611e1c565b600060ff8416825260406020830152611f7d6040830184611e1c565b949350505050565b602080825260119082015270130c97d493d555115497d393d517d4d155607a1b604082015260600190565b6020808252601390820152721253959053125117d6915493d7d05353d55395606a1b604082015260600190565b602080825260159082015274494e56414c49445f4e4f4e5a45524f5f56414c554560581b604082015260600190565b6020808252600e908201526d1253959053125117d30c57d1d49560921b604082015260600190565b60208082526011908201527024a72b20a624a22fa6192fa927aaaa22a960791b604082015260600190565b60208082526013908201527224a72b20a624a22fa222a9aa24a720aa24a7a760691b604082015260600190565b6020808252601690820152751253959053125117d30c57d0d3d5539511549410549560521b604082015260600190565b6020808252601a908201527f43414c4c5f484f4f4b5f444154415f4e4f545f414c4c4f574544000000000000604082015260600190565b602080825260169082015275130c57d0d3d5539511549410549517d393d517d4d15560521b604082015260600190565b6020808252600e908201526d130c57d1d49517d393d517d4d15560921b604082015260600190565b6020808252600d908201526c1513d2d15397d393d517d1d495609a1b604082015260600190565b60208082526018908201527f4f4e4c595f434f554e544552504152545f474154455741590000000000000000604082015260600190565b90815260200190565b6001600160a01b038116811461056f57600080fdfe496e697469616c697a61626c653a20636f6e747261637420697320616c726561647920696e697469616c697a6564a264697066735822122065fad7a9fc021b14dda68574a33568d80fcb7311e53fb115c48b61e211858c8364736f6c63430007060033","id":1,"type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"L2GraphTokenGateway#L2GraphTokenGateway","networkInteractionId":1,"nonce":1595,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"L2GraphTokenGateway#L2GraphTokenGateway","networkInteractionId":1,"nonce":1595,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0xa89cbe9c8ef67afcf2f99d782b4ebd4644f8c98569332051804b66ec6587df1a"},"type":"TRANSACTION_SEND"} +{"artifactId":"RewardsManager#RewardsManager","constructorArgs":[],"contractName":"RewardsManager","dependencies":[],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","futureId":"RewardsManager#RewardsManager","futureType":"CONTRACT_DEPLOYMENT","libraries":{},"strategy":"basic","strategyConfig":{},"type":"DEPLOYMENT_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"RewardsManager#RewardsManager","networkInteraction":{"data":"0x6101606040527fe6876326c1291dfcbbd3864a6816d698cd591defc7aa2153d7f9c4c04016c89f6080527fc713c3df6d14cdf946460395d09af88993ee2b948b1a808161494e32c5f6706360a0527f966f1e8d8d8014e05f6ec4a57138da9be1f7c5a7f802928a18072f7c5318076160c0527f1df41cd916959d1163dc8f0671a666ea8a3e434c13e40faef527133b5d16703460e0527f45fc200c7e4544e457d3c5709bfe0d520442c30bbcbdaede89e8d4a4bbc19247610100527fd362cac9cb75c10d67bcc0b7eeb0b1ef48bb5420b556c092d4fd7f758816fcf0610120527f39605a6c26a173774ca666c67ef70cf491880e5d3d6d0ca66ec0a31034f15ea36101405234801561011057600080fd5b5060805160a05160c05160e051610100516101205161014051611ca761017360003980610e60525080610e37525080610e0e52806117d9525080610de5528061155c525080610dbc525080610d93525080610d6a52806113a05250611ca76000f3fe608060405234801561001057600080fd5b50600436106101da5760003560e01c806393a90a1e11610104578063c8a5f81e116100a2578063e284f84811610071578063e284f848146103ad578063e820e284146103b5578063eeac3e0e146103d5578063f77c4791146103e8576101da565b8063c8a5f81e14610377578063d6866ea51461038a578063db75092614610392578063e242cf1e146103a5576101da565b8063a8cc0ee2116100de578063a8cc0ee21461034c578063b951acd714610354578063c4d66de81461035c578063c7d1117d1461036f576101da565b806393a90a1e146103135780639ce7abe514610326578063a2594d8214610339576101da565b80634986594f1161017c578063702a280e1161014b578063702a280e146102c4578063779bcb9b146102e55780639006ce8b146102f857806392eefe9b14610300576101da565b80634986594f146102735780634bbfc1c5146102965780635c6cbd59146102a95780636c080f18146102bc576101da565b80631324a506116101b85780631324a5061461022557806316a84ab2146102385780631d1c2fec14610258578063260582491461026b576101da565b806305bb8c6b146101df5780630903c094146101fd5780631156bdc114610212575b600080fd5b6101e76103f0565b6040516101f49190611a57565b60405180910390f35b61021061020b366004611895565b6103ff565b005b610210610220366004611962565b61045b565b61021061023336600461197a565b61046f565b61024b610246366004611962565b6104b0565b6040516101f49190611a8f565b61024b610266366004611962565b6104c2565b6101e76104fb565b610286610281366004611962565b61050a565b6040516101f49493929190611c12565b6102106102a4366004611962565b610531565b61024b6102b7366004611962565b61062d565b61024b61071e565b6102d76102d2366004611962565b610724565b6040516101f4929190611c04565b61024b6102f33660046118cd565b610898565b61024b6109be565b61021061030e366004611895565b6109c4565b610210610321366004611895565b6109d5565b61021061033436600461199e565b610a2f565b610210610347366004611895565b610b85565b61024b610ca0565b61024b610cbc565b61021061036a366004611895565b610cc2565b61024b610d2e565b61024b610385366004611a36565b610d46565b610210610d65565b61024b6103a0366004611895565b610e86565b61024b6110bc565b61024b6110c2565b6103c86103c3366004611962565b6111d1565b6040516101f49190611a84565b61024b6103e3366004611962565b6111e5565b6101e7611217565b600f546001600160a01b031681565b610407611226565b600f80546001600160a01b0319166001600160a01b0383161790556040517f96d5a4b4edf1cefd0900c166d64447f8da1d01d1861a6a60894b5b82a2c15c3c9061045090611a98565b60405180910390a150565b610463611226565b61046c816112fa565b50565b600f546001600160a01b031633146104a25760405162461bcd60e51b815260040161049990611acf565b60405180910390fd5b6104ac8282611336565b5050565b60116020526000908152604090205481565b60006104cc610d2e565b5060008281526010602052604090206104e48361062d565b808255600d5460029092019190915590505b919050565b6015546001600160a01b031681565b60106020526000908152604090208054600182015460028301546003909301549192909184565b600f546001600160a01b03163314806105de575060008054906101000a90046001600160a01b03166001600160a01b0316634fc07d756040518163ffffffff1660e01b815260040160206040518083038186803b15801561059157600080fd5b505afa1580156105a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105c991906118b1565b6001600160a01b0316336001600160a01b0316145b6105fa5760405162461bcd60e51b815260040161049990611bdc565b60128190556040517f96d5a4b4edf1cefd0900c166d64447f8da1d01d1861a6a60894b5b82a2c15c3c9061045090611b1e565b600081815260106020526040812081610644611399565b6001600160a01b03166346e855da856040518263ffffffff1660e01b815260040161066f9190611a8f565b60206040518083038186803b15801561068757600080fd5b505afa15801561069b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106bf9190611a1e565b905060006012548210156106d4576000610706565b610706670de0b6b3a7640000610700846106fa87600201546106f4610ca0565b906113c4565b90611421565b9061147a565b835490915061071590826114e1565b95945050505050565b60145481565b600081815260106020526040812081908161073e8561062d565b9050600061075082846001015461153b565b90506000806040518060400160405280610768611555565b6001600160a01b03908116825260155416602090910152905060005b600281101561084757600082826002811061079b57fe5b60200201516001600160a01b03161461083f578181600281106107ba57fe5b60200201516001600160a01b031663e2e1e8e98a6040518263ffffffff1660e01b81526004016107ea9190611a8f565b60206040518083038186803b15801561080257600080fd5b505afa158015610816573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061083a9190611a1e565b830192505b600101610784565b508161085e57600084965096505050505050610893565b60006108768361070086670de0b6b3a7640000611421565b600387015490915061088890826114e1565b975093955050505050505b915091565b60006108a2611555565b6001600160a01b0316836001600160a01b031614806108ce57506015546001600160a01b038481169116145b6108ea5760405162461bcd60e51b815260040161049990611b77565b6000806000806000876001600160a01b03166355c85269886040518263ffffffff1660e01b815260040161091e9190611a57565b60c06040518083038186803b15801561093657600080fd5b505afa15801561094a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061096e9190611905565b95509550955095505094508461098c576000955050505050506109b8565b600061099785610724565b5090506109af6109a8858584611580565b83906114e1565b96505050505050505b92915050565b600e5481565b6109cc6115a5565b61046c81611604565b6109dd611226565b601580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f97befc0afcf2bace352f077aea9873c9552fc2e5ab26874f356006fdf9da4ede90600090a35050565b82806001600160a01b031663f851a4406040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610a6b57600080fd5b505af1158015610a7f573d6000803e3d6000fd5b505050506040513d6020811015610a9557600080fd5b50516001600160a01b03163314610af3576040805162461bcd60e51b815260206004820152601e60248201527f43616c6c6572206d757374206265207468652070726f78792061646d696e0000604482015290519081900360640190fd5b60405163623faf6160e01b8152602060048201908152602482018490526001600160a01b0386169163623faf619186918691908190604401848480828437600081840152601f19601f8201169050808301925050509350505050600060405180830381600087803b158015610b6757600080fd5b505af1158015610b7b573d6000803e3d6000fd5b5050505050505050565b80806001600160a01b031663f851a4406040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610bc157600080fd5b505af1158015610bd5573d6000803e3d6000fd5b505050506040513d6020811015610beb57600080fd5b50516001600160a01b03163314610c49576040805162461bcd60e51b815260206004820152601e60248201527f43616c6c6572206d757374206265207468652070726f78792061646d696e0000604482015290519081900360640190fd5b816001600160a01b03166359fc20bb6040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610c8457600080fd5b505af1158015610c98573d6000803e3d6000fd5b505050505050565b6000610cb6610cad6110c2565b600d54906114e1565b90505b90565b60125481565b610cca6116ac565b6001600160a01b0316336001600160a01b031614610d25576040805162461bcd60e51b815260206004820152601360248201527227b7363c9034b6b83632b6b2b73a30ba34b7b760691b604482015290519081900360640190fd5b61046c816109cc565b6000610d38610ca0565b600d81905543600e55905090565b6000610d5e670de0b6b3a76400006107008486611421565b9392505050565b610d8e7f00000000000000000000000000000000000000000000000000000000000000006116d1565b610db77f00000000000000000000000000000000000000000000000000000000000000006116d1565b610de07f00000000000000000000000000000000000000000000000000000000000000006116d1565b610e097f00000000000000000000000000000000000000000000000000000000000000006116d1565b610e327f00000000000000000000000000000000000000000000000000000000000000006116d1565b610e5b7f00000000000000000000000000000000000000000000000000000000000000006116d1565b610e847f00000000000000000000000000000000000000000000000000000000000000006116d1565b565b600033610e91611555565b6001600160a01b0316816001600160a01b03161480610ebd57506015546001600160a01b038281169116145b610ed95760405162461bcd60e51b815260040161049990611ba5565b600080600080600080866001600160a01b03166355c852698a6040518263ffffffff1660e01b8152600401610f0e9190611a57565b60c06040518083038186803b158015610f2657600080fd5b505afa158015610f3a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f5e9190611905565b9550955095509550955095506000610f75856111e5565b9050610f80856111d1565b15610fd657896001600160a01b0316866001600160a01b03167f9b1323a10f3955b1c9c054ffbda78edfdf49998aaf37f61d9f84776b59ac804360405160405180910390a36000985050505050505050506104f6565b6000871561106357610ff3610fec868685611580565b84906114e1565b90508015611063576110036117d2565b6001600160a01b03166340c10f198a836040518363ffffffff1660e01b8152600401611030929190611a6b565b600060405180830381600087803b15801561104a57600080fd5b505af115801561105e573d6000803e3d6000fd5b505050505b8a6001600160a01b0316876001600160a01b03167fa111914d7f2ea8beca61d12f1a1f38c5533de5f1823c3936422df4404ac2ec68836040516110a69190611a8f565b60405180910390a39a9950505050505050505050565b600d5481565b6000806110da600e54436113c490919063ffffffff16565b9050806110eb576000915050610cb9565b6014546110fc576000915050610cb9565b60006111066117d2565b90506000816001600160a01b03166370a08231611121611399565b6040518263ffffffff1660e01b815260040161113d9190611a57565b60206040518083038186803b15801561115557600080fd5b505afa158015611169573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061118d9190611a1e565b9050806111a05760009350505050610cb9565b6014546000906111b09085611421565b90506111c88261070083670de0b6b3a7640000611421565b94505050505090565b600090815260116020526040902054151590565b600081815260106020526040812081806111fe85610724565b6003850182905560019094019390935550909392505050565b6000546001600160a01b031681565b60008054906101000a90046001600160a01b03166001600160a01b0316634fc07d756040518163ffffffff1660e01b815260040160206040518083038186803b15801561127257600080fd5b505afa158015611286573d6000803e3d6000fd5b505050506040513d602081101561129c57600080fd5b50516001600160a01b03163314610e84576040805162461bcd60e51b815260206004820152601860248201527f4f6e6c7920436f6e74726f6c6c657220676f7665726e6f720000000000000000604482015290519081900360640190fd5b611302610d2e565b5060148190556040517f96d5a4b4edf1cefd0900c166d64447f8da1d01d1861a6a60894b5b82a2c15c3c9061045090611b4d565b600081611344576000611346565b435b600084815260116020526040908190208290555190915083907fe016102b339c3889f4967b491f3381f2c352c8fe3d4f880007807d45b124065a9061138c908490611a8f565b60405180910390a2505050565b6000610cb67f00000000000000000000000000000000000000000000000000000000000000006117f9565b60008282111561141b576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b600082611430575060006109b8565b8282028284828161143d57fe5b0414610d5e5760405162461bcd60e51b8152600401808060200182810382526021815260200180611c516021913960400191505060405180910390fd5b60008082116114d0576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b8183816114d957fe5b049392505050565b600082820183811015610d5e576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600081831161154b576000610d5e565b610d5e83836113c4565b6000610cb67f00000000000000000000000000000000000000000000000000000000000000006117f9565b60008061158d83856113c4565b9050610715670de0b6b3a76400006107008388611421565b6000546001600160a01b03163314610e84576040805162461bcd60e51b815260206004820152601960248201527f43616c6c6572206d75737420626520436f6e74726f6c6c657200000000000000604482015290519081900360640190fd5b6001600160a01b038116611658576040805162461bcd60e51b815260206004820152601660248201527510dbdb9d1c9bdb1b195c881b5d5cdd081899481cd95d60521b604482015290519081900360640190fd5b600080546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f4ff638452bbf33c012645d18ae6f05515ff5f2d1dfb0cece8cbf018c60903f709181900360200190a150565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6000805460408051637bb20d2f60e11b81526004810185905290516001600160a01b039092169163f7641a5e91602480820192602092909190829003018186803b15801561171e57600080fd5b505afa158015611732573d6000803e3d6000fd5b505050506040513d602081101561174857600080fd5b50516000838152600160205260409020549091506001600160a01b038083169116146104ac5760008281526001602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251908152915184927fd0e7a942b1fc38c411c4f53d153ba14fd24542a6a35ebacd9b6afca1a154e20692908290030190a25050565b6000610cb67f00000000000000000000000000000000000000000000000000000000000000005b6000818152600160205260408120546001600160a01b0316806109b85760005460408051637bb20d2f60e11b81526004810186905290516001600160a01b039092169163f7641a5e91602480820192602092909190829003018186803b15801561186257600080fd5b505afa158015611876573d6000803e3d6000fd5b505050506040513d602081101561188c57600080fd5b50519392505050565b6000602082840312156118a6578081fd5b8135610d5e81611c2d565b6000602082840312156118c2578081fd5b8151610d5e81611c2d565b600080604083850312156118df578081fd5b82356118ea81611c2d565b915060208301356118fa81611c2d565b809150509250929050565b60008060008060008060c0878903121561191d578182fd5b865161192881611c42565b602088015190965061193981611c2d565b6040880151606089015160808a015160a0909a0151989b929a5090989097909650945092505050565b600060208284031215611973578081fd5b5035919050565b6000806040838503121561198c578182fd5b8235915060208301356118fa81611c42565b6000806000604084860312156119b2578283fd5b83356119bd81611c2d565b9250602084013567ffffffffffffffff808211156119d9578384fd5b818601915086601f8301126119ec578384fd5b8135818111156119fa578485fd5b876020828501011115611a0b578485fd5b6020830194508093505050509250925092565b600060208284031215611a2f578081fd5b5051919050565b60008060408385031215611a48578182fd5b50508035926020909101359150565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b901515815260200190565b90815260200190565b6020808252601a908201527f7375626772617068417661696c6162696c6974794f7261636c65000000000000604082015260600190565b6020808252602f908201527f43616c6c6572206d75737420626520746865207375626772617068206176616960408201526e6c6162696c697479206f7261636c6560881b606082015260800190565b6020808252601590820152741b5a5b9a5b5d5b54dd5899dc985c1a14da59db985b605a1b604082015260600190565b60208082526010908201526f69737375616e6365506572426c6f636b60801b604082015260600190565b6020808252601490820152732737ba1030903932bbb0b932399034b9b9bab2b960611b604082015260600190565b6020808252601f908201527f43616c6c6572206d757374206265206120726577617264732069737375657200604082015260600190565b6020808252600e908201526d139bdd08185d5d1a1bdc9a5e995960921b604082015260600190565b918252602082015260400190565b93845260208401929092526040830152606082015260800190565b6001600160a01b038116811461046c57600080fd5b801515811461046c57600080fdfe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a2646970667358221220b536df78ac5675cc1b134b52c2a049a6938eb11d81ca397ce9b07214c71d8af264736f6c63430007060033","id":1,"type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"RewardsManager#RewardsManager","networkInteractionId":1,"nonce":1596,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"RewardsManager#RewardsManager","networkInteractionId":1,"nonce":1596,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0x95e8cf51aec76b9a1fd51587f573824526b89309d153e475e14f6d368af0bceb"},"type":"TRANSACTION_SEND"} +{"futureId":"Controller#Controller","hash":"0x38745c8ad22d3cd61a943a23dcc475e54d0c8b751122259723fd2c6966632add","networkInteractionId":1,"receipt":{"blockHash":"0x2ce959aa2db22ac6d786a560143b59b68bcd40830dff3ec57102141c52d985d4","blockNumber":152512382,"contractAddress":"0x0750EdA3185C758247E97819074bCD217a815FaE","logs":[{"address":"0x0750EdA3185C758247E97819074bCD217a815FaE","data":"0x0000000000000000000000000000000000000000000000000000000000000001","logIndex":3,"topics":["0x8fb6c181ee25a520cf3dd6565006ef91229fcfe5a989566c2a3b8c115570cec5"]}],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"Controller#Controller","result":{"address":"0x0750EdA3185C758247E97819074bCD217a815FaE","type":"SUCCESS"},"type":"DEPLOYMENT_EXECUTION_STATE_COMPLETE"} +{"futureId":"EpochManager#EpochManager","hash":"0x859e4f54c6a35fd4ab34cdc50a1bc74fc3e6c51fa1e23dd27c5faffb29768ed0","networkInteractionId":1,"receipt":{"blockHash":"0xb263d18d04d02399b1d354d3fafaa51ae3b83bc972f08bff4d88c2865996a4db","blockNumber":152512394,"contractAddress":"0x450906A976dc21450A7CcD1989D26E137E605B91","logs":[],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"EpochManager#EpochManager","result":{"address":"0x450906A976dc21450A7CcD1989D26E137E605B91","type":"SUCCESS"},"type":"DEPLOYMENT_EXECUTION_STATE_COMPLETE"} +{"futureId":"GraphProxyAdmin#GraphProxyAdmin","hash":"0xd76e5fc20076c7d417d14c71770190aabda128d246a16dfcc29f77fb7f270365","networkInteractionId":1,"receipt":{"blockHash":"0xd1de76490ec9034658085496fe8bd413fd4aa1c8f8a9feb622c1ceda0409a192","blockNumber":152512405,"contractAddress":"0x1CEBe1C314Cc454baf4bd553409d957C833623c0","logs":[],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"GraphProxyAdmin#GraphProxyAdmin","result":{"address":"0x1CEBe1C314Cc454baf4bd553409d957C833623c0","type":"SUCCESS"},"type":"DEPLOYMENT_EXECUTION_STATE_COMPLETE"} +{"futureId":"HorizonProxies#OZProxyDummy_GraphPayments","hash":"0x9983dbeee2627390f14712118876eae5f0cef7a85aa0486c834aa1c51be61e9d","networkInteractionId":1,"receipt":{"blockHash":"0xc3f67663761469c57b16b4c6dc05f26a2a9c4620b6087207910a34515a8a932a","blockNumber":152512417,"contractAddress":"0x8A44C49eD477e7130249d4B8d5248d08B469Bf0d","logs":[],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"HorizonProxies#OZProxyDummy_GraphPayments","result":{"address":"0x8A44C49eD477e7130249d4B8d5248d08B469Bf0d","type":"SUCCESS"},"type":"DEPLOYMENT_EXECUTION_STATE_COMPLETE"} +{"futureId":"HorizonProxies#OZProxyDummy_PaymentsEscrow","hash":"0x8e31fc40c140b6f04f8bde3abd3c53acd237a7e5654c53970b92f35080dd91cf","networkInteractionId":1,"receipt":{"blockHash":"0x5cf2307fc9c5f8e302aafd81e97edaa47d9d858f71b213430bc5bde655474f60","blockNumber":152512428,"contractAddress":"0xBaBe8F24fFB27fb01C5b66999Db6929E5d500C70","logs":[],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"HorizonProxies#OZProxyDummy_PaymentsEscrow","result":{"address":"0xBaBe8F24fFB27fb01C5b66999Db6929E5d500C70","type":"SUCCESS"},"type":"DEPLOYMENT_EXECUTION_STATE_COMPLETE"} +{"futureId":"HorizonStaking#ExponentialRebates","hash":"0xa1983cc6775d37b981f072909799a74c3ec9b62ab36904736b703f798399cd86","networkInteractionId":1,"receipt":{"blockHash":"0x3f3c03d9e439ae0202ab1cb7918cbc4d68385f97e9ff5f019ba18825278e9c3c","blockNumber":152512440,"contractAddress":"0xF2DB533658a1728f3ce04A49Df4b545f4A53b620","logs":[],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"HorizonStaking#ExponentialRebates","result":{"address":"0xF2DB533658a1728f3ce04A49Df4b545f4A53b620","type":"SUCCESS"},"type":"DEPLOYMENT_EXECUTION_STATE_COMPLETE"} +{"futureId":"L2Curation#GraphCurationToken","hash":"0x68f850e03de53f05ada2c9dda84d68477c01208665a4f6128a709f7234db967e","networkInteractionId":1,"receipt":{"blockHash":"0x0bfd0605c4599b2521cdbaf5660b350f795eca816825a5f2ab605c0d161fe824","blockNumber":152512453,"contractAddress":"0xb85d6e91EeAdDc35927AF34e5E28428282e4bcF2","logs":[],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"L2Curation#GraphCurationToken","result":{"address":"0xb85d6e91EeAdDc35927AF34e5E28428282e4bcF2","type":"SUCCESS"},"type":"DEPLOYMENT_EXECUTION_STATE_COMPLETE"} +{"futureId":"L2Curation#L2Curation","hash":"0xfd0caf2dcfb174f3acde1c794d754bb83104bf1b77c83a218a67b1cfcfdd4843","networkInteractionId":1,"receipt":{"blockHash":"0x3339a2f960f327759725e7d2f663d30aee90f640c36e89d38c4ef6517b384e54","blockNumber":152512467,"contractAddress":"0x9CCD9B656f8A558879974ef2505496eEd7Ef7210","logs":[],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"L2Curation#L2Curation","result":{"address":"0x9CCD9B656f8A558879974ef2505496eEd7Ef7210","type":"SUCCESS"},"type":"DEPLOYMENT_EXECUTION_STATE_COMPLETE"} +{"futureId":"L2GraphToken#L2GraphToken","hash":"0x6730a19b4ae0823f98e12f2af100906334a11b2fdd6b1494c9f7ad68d8f0053b","networkInteractionId":1,"receipt":{"blockHash":"0x861402612f36718cb21edc0147c54643011e157dcfa4f33638c79261081fa22a","blockNumber":152512480,"contractAddress":"0x71927f8Ff0ce294882e2A161A54F62f3b0f3c726","logs":[],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"L2GraphToken#L2GraphToken","result":{"address":"0x71927f8Ff0ce294882e2A161A54F62f3b0f3c726","type":"SUCCESS"},"type":"DEPLOYMENT_EXECUTION_STATE_COMPLETE"} +{"futureId":"L2GraphTokenGateway#L2GraphTokenGateway","hash":"0xa89cbe9c8ef67afcf2f99d782b4ebd4644f8c98569332051804b66ec6587df1a","networkInteractionId":1,"receipt":{"blockHash":"0xa872700710f71849da9bdf9a2355bfa124fc46203bcc3313b09c5b880a842829","blockNumber":152512493,"contractAddress":"0x4dEA2d1Be05909B71F539FD32601F7bd736c28D4","logs":[],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"L2GraphTokenGateway#L2GraphTokenGateway","result":{"address":"0x4dEA2d1Be05909B71F539FD32601F7bd736c28D4","type":"SUCCESS"},"type":"DEPLOYMENT_EXECUTION_STATE_COMPLETE"} +{"futureId":"RewardsManager#RewardsManager","hash":"0x95e8cf51aec76b9a1fd51587f573824526b89309d153e475e14f6d368af0bceb","networkInteractionId":1,"receipt":{"blockHash":"0x9ebc83aeb193601733890302b58cdcead45968a2f97216b6c7f07c5fc30b7970","blockNumber":152512506,"contractAddress":"0x05Ca4d407ec53Ac17ce6Bb414f42663f415Dc5C3","logs":[],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"RewardsManager#RewardsManager","result":{"address":"0x05Ca4d407ec53Ac17ce6Bb414f42663f415Dc5C3","type":"SUCCESS"},"type":"DEPLOYMENT_EXECUTION_STATE_COMPLETE"} +{"args":["0xE11BA2b4D45Eaed5996Cd0823791E0C93114882d"],"artifactId":"Controller#Controller","contractAddress":"0x0750EdA3185C758247E97819074bCD217a815FaE","dependencies":["Controller#Controller"],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","functionName":"setPauseGuardian","futureId":"Controller#Controller.setPauseGuardian","strategy":"basic","strategyConfig":{},"type":"CALL_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"Controller#Controller.setPauseGuardian","networkInteraction":{"data":"0x48bde20c000000000000000000000000e11ba2b4d45eaed5996cd0823791e0c93114882d","id":1,"to":"0x0750EdA3185C758247E97819074bCD217a815FaE","type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"Controller#Controller.setPauseGuardian","networkInteractionId":1,"nonce":1597,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"Controller#Controller.setPauseGuardian","networkInteractionId":1,"nonce":1597,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0xa0f981c56c58202d66ee938772201794bc9cead7302705b8b64fb2b3153ed92c"},"type":"TRANSACTION_SEND"} +{"args":[false],"artifactId":"Controller#Controller","contractAddress":"0x0750EdA3185C758247E97819074bCD217a815FaE","dependencies":["Controller#Controller"],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","functionName":"setPaused","futureId":"Controller#Controller.setPaused","strategy":"basic","strategyConfig":{},"type":"CALL_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"Controller#Controller.setPaused","networkInteraction":{"data":"0x16c38b3c0000000000000000000000000000000000000000000000000000000000000000","id":1,"to":"0x0750EdA3185C758247E97819074bCD217a815FaE","type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"Controller#Controller.setPaused","networkInteractionId":1,"nonce":1598,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"Controller#Controller.setPaused","networkInteractionId":1,"nonce":1598,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0x482d45da2008336e8f038ca3ec57367f318c169dd254bf5c54bc7134e417d718"},"type":"TRANSACTION_SEND"} +{"args":["0xad834c286a9b590f8264c8d9574fafcbbbe90b3b"],"artifactId":"Controller#Controller","contractAddress":"0x0750EdA3185C758247E97819074bCD217a815FaE","dependencies":["Controller#Controller"],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","functionName":"transferOwnership","futureId":"Controller#Controller.transferOwnership","strategy":"basic","strategyConfig":{},"type":"CALL_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"Controller#Controller.transferOwnership","networkInteraction":{"data":"0xf2fde38b000000000000000000000000ad834c286a9b590f8264c8d9574fafcbbbe90b3b","id":1,"to":"0x0750EdA3185C758247E97819074bCD217a815FaE","type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"Controller#Controller.transferOwnership","networkInteractionId":1,"nonce":1599,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"Controller#Controller.transferOwnership","networkInteractionId":1,"nonce":1599,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0xee3d1c7f7fc367161dcb08e7afa2f8f0f533e19cef58d76775a5bd41cfbc8d2f"},"type":"TRANSACTION_SEND"} +{"args":["0xad834c286a9b590f8264c8d9574fafcbbbe90b3b"],"artifactId":"GraphProxyAdmin#GraphProxyAdmin","contractAddress":"0x1CEBe1C314Cc454baf4bd553409d957C833623c0","dependencies":["GraphProxyAdmin#GraphProxyAdmin"],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","functionName":"transferOwnership","futureId":"GraphProxyAdmin#GraphProxyAdmin.transferOwnership","strategy":"basic","strategyConfig":{},"type":"CALL_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"GraphProxyAdmin#GraphProxyAdmin.transferOwnership","networkInteraction":{"data":"0xf2fde38b000000000000000000000000ad834c286a9b590f8264c8d9574fafcbbbe90b3b","id":1,"to":"0x1CEBe1C314Cc454baf4bd553409d957C833623c0","type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"GraphProxyAdmin#GraphProxyAdmin.transferOwnership","networkInteractionId":1,"nonce":1600,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"GraphProxyAdmin#GraphProxyAdmin.transferOwnership","networkInteractionId":1,"nonce":1600,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0xbb631fdffdc4dffde9350410329d3d575649ced974c5af87732384102f33a502"},"type":"TRANSACTION_SEND"} +{"artifactId":"HorizonProxies#TransparentUpgradeableProxy_GraphPayments","constructorArgs":["0x8A44C49eD477e7130249d4B8d5248d08B469Bf0d","0xade6b8eb69a49b56929c1d4f4b428d791861db6f","0x"],"contractName":"TransparentUpgradeableProxy","dependencies":["HorizonProxies#OZProxyDummy_GraphPayments"],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","futureId":"HorizonProxies#TransparentUpgradeableProxy_GraphPayments","futureType":"CONTRACT_DEPLOYMENT","libraries":{},"strategy":"basic","strategyConfig":{},"type":"DEPLOYMENT_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"HorizonProxies#TransparentUpgradeableProxy_GraphPayments","networkInteraction":{"data":"0x60a0604052604051610eae380380610eae8339810160408190526100229161039d565b828161002e828261008f565b50508160405161003d9061033a565b6001600160a01b039091168152602001604051809103906000f080158015610069573d6000803e3d6000fd5b506001600160a01b031660805261008761008260805190565b6100ee565b50505061048f565b6100988261015c565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a28051156100e2576100dd82826101db565b505050565b6100ea610252565b5050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61012e600080516020610e8e833981519152546001600160a01b031690565b604080516001600160a01b03928316815291841660208301520160405180910390a161015981610273565b50565b806001600160a01b03163b60000361019757604051634c9c8ce360e01b81526001600160a01b03821660048201526024015b60405180910390fd5b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5b80546001600160a01b0319166001600160a01b039290921691909117905550565b6060600080846001600160a01b0316846040516101f89190610473565b600060405180830381855af49150503d8060008114610233576040519150601f19603f3d011682016040523d82523d6000602084013e610238565b606091505b5090925090506102498583836102b2565b95945050505050565b34156102715760405163b398979f60e01b815260040160405180910390fd5b565b6001600160a01b03811661029d57604051633173bdd160e11b81526000600482015260240161018e565b80600080516020610e8e8339815191526101ba565b6060826102c7576102c282610311565b61030a565b81511580156102de57506001600160a01b0384163b155b1561030757604051639996b31560e01b81526001600160a01b038516600482015260240161018e565b50805b9392505050565b8051156103215780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b6105538061093b83390190565b80516001600160a01b038116811461035e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561039457818101518382015260200161037c565b50506000910152565b6000806000606084860312156103b257600080fd5b6103bb84610347565b92506103c960208501610347565b60408501519092506001600160401b038111156103e557600080fd5b8401601f810186136103f657600080fd5b80516001600160401b0381111561040f5761040f610363565b604051601f8201601f19908116603f011681016001600160401b038111828210171561043d5761043d610363565b60405281815282820160200188101561045557600080fd5b610466826020830160208601610379565b8093505050509250925092565b60008251610485818460208701610379565b9190910192915050565b6080516104926104a96000396000601001526104926000f3fe608060405261000c61000e565b005b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316330361007b576000356001600160e01b03191663278f794360e11b14610071576040516334ad5dbb60e21b815260040160405180910390fd5b610079610083565b565b6100796100b2565b6000806100933660048184610304565b8101906100a09190610344565b915091506100ae82826100c2565b5050565b6100796100bd61011d565b610155565b6100cb82610179565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a28051156101155761011082826101f0565b505050565b6100ae610266565b60006101507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b3660008037600080366000845af43d6000803e808015610174573d6000f35b3d6000fd5b806001600160a01b03163b6000036101af5780604051634c9c8ce360e01b81526004016101a69190610419565b60405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080846001600160a01b03168460405161020d919061042d565b600060405180830381855af49150503d8060008114610248576040519150601f19603f3d011682016040523d82523d6000602084013e61024d565b606091505b509150915061025d858383610285565b95945050505050565b34156100795760405163b398979f60e01b815260040160405180910390fd5b60608261029a57610295826102db565b6102d4565b81511580156102b157506001600160a01b0384163b155b156102d15783604051639996b31560e01b81526004016101a69190610419565b50805b9392505050565b8051156102eb5780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b6000808585111561031457600080fd5b8386111561032157600080fd5b5050820193919092039150565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561035757600080fd5b82356001600160a01b038116811461036e57600080fd5b915060208301356001600160401b0381111561038957600080fd5b8301601f8101851361039a57600080fd5b80356001600160401b038111156103b3576103b361032e565b604051601f8201601f19908116603f011681016001600160401b03811182821017156103e1576103e161032e565b6040528181528282016020018710156103f957600080fd5b816020840160208301376000602083830101528093505050509250929050565b6001600160a01b0391909116815260200190565b6000825160005b8181101561044e5760208186018101518583015201610434565b50600092019182525091905056fea2646970667358221220079092acd5c0b5783781c6719b8677b2804315edab5ec07af0a0f7a7a9b7803c64736f6c634300081b0033608060405234801561001057600080fd5b5060405161055338038061055383398101604081905261002f916100be565b806001600160a01b03811661005e57604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b6100678161006e565b50506100ee565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000602082840312156100d057600080fd5b81516001600160a01b03811681146100e757600080fd5b9392505050565b610456806100fd6000396000f3fe60806040526004361061004a5760003560e01c8063715018a61461004f5780638da5cb5b146100665780639623609d14610091578063ad3cb1cc146100a4578063f2fde38b146100e2575b600080fd5b34801561005b57600080fd5b50610064610102565b005b34801561007257600080fd5b5061007b610116565b604051610088919061025d565b60405180910390f35b61006461009f36600461029c565b610125565b3480156100b057600080fd5b506100d5604051806040016040528060058152602001640352e302e360dc1b81525081565b60405161008891906103bd565b3480156100ee57600080fd5b506100646100fd3660046103d7565b610194565b61010a6101db565b610114600061020d565b565b6000546001600160a01b031690565b61012d6101db565b60405163278f794360e11b81526001600160a01b03841690634f1ef28690349061015d90869086906004016103f4565b6000604051808303818588803b15801561017657600080fd5b505af115801561018a573d6000803e3d6000fd5b5050505050505050565b61019c6101db565b6001600160a01b0381166101cf576000604051631e4fbdf760e01b81526004016101c6919061025d565b60405180910390fd5b6101d88161020d565b50565b336101e4610116565b6001600160a01b031614610114573360405163118cdaa760e01b81526004016101c6919061025d565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b0391909116815260200190565b6001600160a01b03811681146101d857600080fd5b634e487b7160e01b600052604160045260246000fd5b6000806000606084860312156102b157600080fd5b83356102bc81610271565b925060208401356102cc81610271565b915060408401356001600160401b038111156102e757600080fd5b8401601f810186136102f857600080fd5b80356001600160401b0381111561031157610311610286565b604051601f8201601f19908116603f011681016001600160401b038111828210171561033f5761033f610286565b60405281815282820160200188101561035757600080fd5b816020840160208301376000602083830101528093505050509250925092565b6000815180845260005b8181101561039d57602081850181015186830182015201610381565b506000602082860101526020601f19601f83011685010191505092915050565b6020815260006103d06020830184610377565b9392505050565b6000602082840312156103e957600080fd5b81356103d081610271565b6001600160a01b038316815260406020820181905260009061041890830184610377565b94935050505056fea2646970667358221220e77af71a19651e50da550702ce9a5b1b89dda100ca5f41a9c778b943df55af8064736f6c634300081b0033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61030000000000000000000000008a44c49ed477e7130249d4b8d5248d08b469bf0d000000000000000000000000ade6b8eb69a49b56929c1d4f4b428d791861db6f00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000","id":1,"type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"HorizonProxies#TransparentUpgradeableProxy_GraphPayments","networkInteractionId":1,"nonce":1601,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"HorizonProxies#TransparentUpgradeableProxy_GraphPayments","networkInteractionId":1,"nonce":1601,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0x9ce59770403f06943081072734b4edb820bc9f669e6ed25fafb503f50581005a"},"type":"TRANSACTION_SEND"} +{"artifactId":"HorizonProxies#TransparentUpgradeableProxy_PaymentsEscrow","constructorArgs":["0xBaBe8F24fFB27fb01C5b66999Db6929E5d500C70","0xade6b8eb69a49b56929c1d4f4b428d791861db6f","0x"],"contractName":"TransparentUpgradeableProxy","dependencies":["HorizonProxies#OZProxyDummy_PaymentsEscrow"],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","futureId":"HorizonProxies#TransparentUpgradeableProxy_PaymentsEscrow","futureType":"CONTRACT_DEPLOYMENT","libraries":{},"strategy":"basic","strategyConfig":{},"type":"DEPLOYMENT_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"HorizonProxies#TransparentUpgradeableProxy_PaymentsEscrow","networkInteraction":{"data":"0x60a0604052604051610eae380380610eae8339810160408190526100229161039d565b828161002e828261008f565b50508160405161003d9061033a565b6001600160a01b039091168152602001604051809103906000f080158015610069573d6000803e3d6000fd5b506001600160a01b031660805261008761008260805190565b6100ee565b50505061048f565b6100988261015c565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a28051156100e2576100dd82826101db565b505050565b6100ea610252565b5050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61012e600080516020610e8e833981519152546001600160a01b031690565b604080516001600160a01b03928316815291841660208301520160405180910390a161015981610273565b50565b806001600160a01b03163b60000361019757604051634c9c8ce360e01b81526001600160a01b03821660048201526024015b60405180910390fd5b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5b80546001600160a01b0319166001600160a01b039290921691909117905550565b6060600080846001600160a01b0316846040516101f89190610473565b600060405180830381855af49150503d8060008114610233576040519150601f19603f3d011682016040523d82523d6000602084013e610238565b606091505b5090925090506102498583836102b2565b95945050505050565b34156102715760405163b398979f60e01b815260040160405180910390fd5b565b6001600160a01b03811661029d57604051633173bdd160e11b81526000600482015260240161018e565b80600080516020610e8e8339815191526101ba565b6060826102c7576102c282610311565b61030a565b81511580156102de57506001600160a01b0384163b155b1561030757604051639996b31560e01b81526001600160a01b038516600482015260240161018e565b50805b9392505050565b8051156103215780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b6105538061093b83390190565b80516001600160a01b038116811461035e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561039457818101518382015260200161037c565b50506000910152565b6000806000606084860312156103b257600080fd5b6103bb84610347565b92506103c960208501610347565b60408501519092506001600160401b038111156103e557600080fd5b8401601f810186136103f657600080fd5b80516001600160401b0381111561040f5761040f610363565b604051601f8201601f19908116603f011681016001600160401b038111828210171561043d5761043d610363565b60405281815282820160200188101561045557600080fd5b610466826020830160208601610379565b8093505050509250925092565b60008251610485818460208701610379565b9190910192915050565b6080516104926104a96000396000601001526104926000f3fe608060405261000c61000e565b005b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316330361007b576000356001600160e01b03191663278f794360e11b14610071576040516334ad5dbb60e21b815260040160405180910390fd5b610079610083565b565b6100796100b2565b6000806100933660048184610304565b8101906100a09190610344565b915091506100ae82826100c2565b5050565b6100796100bd61011d565b610155565b6100cb82610179565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a28051156101155761011082826101f0565b505050565b6100ae610266565b60006101507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b3660008037600080366000845af43d6000803e808015610174573d6000f35b3d6000fd5b806001600160a01b03163b6000036101af5780604051634c9c8ce360e01b81526004016101a69190610419565b60405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080846001600160a01b03168460405161020d919061042d565b600060405180830381855af49150503d8060008114610248576040519150601f19603f3d011682016040523d82523d6000602084013e61024d565b606091505b509150915061025d858383610285565b95945050505050565b34156100795760405163b398979f60e01b815260040160405180910390fd5b60608261029a57610295826102db565b6102d4565b81511580156102b157506001600160a01b0384163b155b156102d15783604051639996b31560e01b81526004016101a69190610419565b50805b9392505050565b8051156102eb5780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b6000808585111561031457600080fd5b8386111561032157600080fd5b5050820193919092039150565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561035757600080fd5b82356001600160a01b038116811461036e57600080fd5b915060208301356001600160401b0381111561038957600080fd5b8301601f8101851361039a57600080fd5b80356001600160401b038111156103b3576103b361032e565b604051601f8201601f19908116603f011681016001600160401b03811182821017156103e1576103e161032e565b6040528181528282016020018710156103f957600080fd5b816020840160208301376000602083830101528093505050509250929050565b6001600160a01b0391909116815260200190565b6000825160005b8181101561044e5760208186018101518583015201610434565b50600092019182525091905056fea2646970667358221220079092acd5c0b5783781c6719b8677b2804315edab5ec07af0a0f7a7a9b7803c64736f6c634300081b0033608060405234801561001057600080fd5b5060405161055338038061055383398101604081905261002f916100be565b806001600160a01b03811661005e57604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b6100678161006e565b50506100ee565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000602082840312156100d057600080fd5b81516001600160a01b03811681146100e757600080fd5b9392505050565b610456806100fd6000396000f3fe60806040526004361061004a5760003560e01c8063715018a61461004f5780638da5cb5b146100665780639623609d14610091578063ad3cb1cc146100a4578063f2fde38b146100e2575b600080fd5b34801561005b57600080fd5b50610064610102565b005b34801561007257600080fd5b5061007b610116565b604051610088919061025d565b60405180910390f35b61006461009f36600461029c565b610125565b3480156100b057600080fd5b506100d5604051806040016040528060058152602001640352e302e360dc1b81525081565b60405161008891906103bd565b3480156100ee57600080fd5b506100646100fd3660046103d7565b610194565b61010a6101db565b610114600061020d565b565b6000546001600160a01b031690565b61012d6101db565b60405163278f794360e11b81526001600160a01b03841690634f1ef28690349061015d90869086906004016103f4565b6000604051808303818588803b15801561017657600080fd5b505af115801561018a573d6000803e3d6000fd5b5050505050505050565b61019c6101db565b6001600160a01b0381166101cf576000604051631e4fbdf760e01b81526004016101c6919061025d565b60405180910390fd5b6101d88161020d565b50565b336101e4610116565b6001600160a01b031614610114573360405163118cdaa760e01b81526004016101c6919061025d565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b0391909116815260200190565b6001600160a01b03811681146101d857600080fd5b634e487b7160e01b600052604160045260246000fd5b6000806000606084860312156102b157600080fd5b83356102bc81610271565b925060208401356102cc81610271565b915060408401356001600160401b038111156102e757600080fd5b8401601f810186136102f857600080fd5b80356001600160401b0381111561031157610311610286565b604051601f8201601f19908116603f011681016001600160401b038111828210171561033f5761033f610286565b60405281815282820160200188101561035757600080fd5b816020840160208301376000602083830101528093505050509250925092565b6000815180845260005b8181101561039d57602081850181015186830182015201610381565b506000602082860101526020601f19601f83011685010191505092915050565b6020815260006103d06020830184610377565b9392505050565b6000602082840312156103e957600080fd5b81356103d081610271565b6001600160a01b038316815260406020820181905260009061041890830184610377565b94935050505056fea2646970667358221220e77af71a19651e50da550702ce9a5b1b89dda100ca5f41a9c778b943df55af8064736f6c634300081b0033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103000000000000000000000000babe8f24ffb27fb01c5b66999db6929e5d500c70000000000000000000000000ade6b8eb69a49b56929c1d4f4b428d791861db6f00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000","id":1,"type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"HorizonProxies#TransparentUpgradeableProxy_PaymentsEscrow","networkInteractionId":1,"nonce":1602,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"HorizonProxies#TransparentUpgradeableProxy_PaymentsEscrow","networkInteractionId":1,"nonce":1602,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0x65688faa5ebf1a43b5e2cee223942fb644975d2293a75645e354610e5e0b805c"},"type":"TRANSACTION_SEND"} +{"args":["0xade6b8eb69a49b56929c1d4f4b428d791861db6f"],"artifactId":"L2GraphToken#L2GraphToken","dependencies":["L2GraphToken#L2GraphToken"],"functionName":"initialize","futureId":"L2GraphToken#encodeFunctionCall(L2GraphToken#L2GraphToken.initialize)","result":"0xc4d66de8000000000000000000000000ade6b8eb69a49b56929c1d4f4b428d791861db6f","strategy":"basic","strategyConfig":{},"type":"ENCODE_FUNCTION_CALL_EXECUTION_STATE_INITIALIZE"} +{"futureId":"Controller#Controller.setPauseGuardian","hash":"0xa0f981c56c58202d66ee938772201794bc9cead7302705b8b64fb2b3153ed92c","networkInteractionId":1,"receipt":{"blockHash":"0x95fb26676c55f51542aec84c7b1618603c42688d87d9637762133469cbeb585b","blockNumber":152512550,"logs":[{"address":"0x0750EdA3185C758247E97819074bCD217a815FaE","data":"0x","logIndex":1,"topics":["0x0613b6ee6a04f0d09f390e4d9318894b9f6ac7fd83897cd8d18896ba579c401e","0x0000000000000000000000000000000000000000000000000000000000000000","0x000000000000000000000000e11ba2b4d45eaed5996cd0823791e0c93114882d"]}],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"Controller#Controller.setPauseGuardian","result":{"type":"SUCCESS"},"type":"CALL_EXECUTION_STATE_COMPLETE"} +{"futureId":"Controller#Controller.setPaused","hash":"0x482d45da2008336e8f038ca3ec57367f318c169dd254bf5c54bc7134e417d718","networkInteractionId":1,"receipt":{"blockHash":"0x1e1531745b8690e56f7a8bc344e3e48cdd216cb9c502415207195813cb0fec50","blockNumber":152512561,"logs":[{"address":"0x0750EdA3185C758247E97819074bCD217a815FaE","data":"0x0000000000000000000000000000000000000000000000000000000000000000","logIndex":0,"topics":["0x8fb6c181ee25a520cf3dd6565006ef91229fcfe5a989566c2a3b8c115570cec5"]}],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"Controller#Controller.setPaused","result":{"type":"SUCCESS"},"type":"CALL_EXECUTION_STATE_COMPLETE"} +{"futureId":"Controller#Controller.transferOwnership","hash":"0xee3d1c7f7fc367161dcb08e7afa2f8f0f533e19cef58d76775a5bd41cfbc8d2f","networkInteractionId":1,"receipt":{"blockHash":"0xc9cd96f208faaa08277ac3eae62bd854e78c6d1b7b69bbd6c7d5d03a22bfdade","blockNumber":152512573,"logs":[{"address":"0x0750EdA3185C758247E97819074bCD217a815FaE","data":"0x","logIndex":0,"topics":["0x76563ad561b7036ae716b9b25cb521b21463240f104c97e12f25877f2235f33d","0x0000000000000000000000000000000000000000000000000000000000000000","0x000000000000000000000000ad834c286a9b590f8264c8d9574fafcbbbe90b3b"]}],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"Controller#Controller.transferOwnership","result":{"type":"SUCCESS"},"type":"CALL_EXECUTION_STATE_COMPLETE"} +{"futureId":"GraphProxyAdmin#GraphProxyAdmin.transferOwnership","hash":"0xbb631fdffdc4dffde9350410329d3d575649ced974c5af87732384102f33a502","networkInteractionId":1,"receipt":{"blockHash":"0x640776de7ea3e4103d7aa10ef710bfeba8a4ceebbb856e903592710e3721a9ed","blockNumber":152512584,"logs":[{"address":"0x1CEBe1C314Cc454baf4bd553409d957C833623c0","data":"0x","logIndex":1,"topics":["0x76563ad561b7036ae716b9b25cb521b21463240f104c97e12f25877f2235f33d","0x0000000000000000000000000000000000000000000000000000000000000000","0x000000000000000000000000ad834c286a9b590f8264c8d9574fafcbbbe90b3b"]}],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"GraphProxyAdmin#GraphProxyAdmin.transferOwnership","result":{"type":"SUCCESS"},"type":"CALL_EXECUTION_STATE_COMPLETE"} +{"futureId":"HorizonProxies#TransparentUpgradeableProxy_GraphPayments","hash":"0x9ce59770403f06943081072734b4edb820bc9f669e6ed25fafb503f50581005a","networkInteractionId":1,"receipt":{"blockHash":"0xe9feee7816b51afc5bfad81886badefde61e329e936e94eaac21dc26c3986b89","blockNumber":152512596,"contractAddress":"0xAFd60629034fBdC3ef58518B817bBDB4EC861c93","logs":[{"address":"0xAFd60629034fBdC3ef58518B817bBDB4EC861c93","data":"0x","logIndex":0,"topics":["0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b","0x0000000000000000000000008a44c49ed477e7130249d4b8d5248d08b469bf0d"]},{"address":"0xAcA3dd622e863E425Cdb15E8734a5CB318448db7","data":"0x","logIndex":1,"topics":["0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0","0x0000000000000000000000000000000000000000000000000000000000000000","0x000000000000000000000000ade6b8eb69a49b56929c1d4f4b428d791861db6f"]},{"address":"0xAFd60629034fBdC3ef58518B817bBDB4EC861c93","data":"0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000aca3dd622e863e425cdb15e8734a5cb318448db7","logIndex":2,"topics":["0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f"]}],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"HorizonProxies#TransparentUpgradeableProxy_GraphPayments","result":{"address":"0xAFd60629034fBdC3ef58518B817bBDB4EC861c93","type":"SUCCESS"},"type":"DEPLOYMENT_EXECUTION_STATE_COMPLETE"} +{"futureId":"HorizonProxies#TransparentUpgradeableProxy_PaymentsEscrow","hash":"0x65688faa5ebf1a43b5e2cee223942fb644975d2293a75645e354610e5e0b805c","networkInteractionId":1,"receipt":{"blockHash":"0xdf79392f74fe07517e2289ad17067475bb723b52b58bc278290a29de32092954","blockNumber":152512603,"contractAddress":"0x70d5AFAAaEF8f2F095E83D6E6151146c18A5Bb85","logs":[{"address":"0x70d5AFAAaEF8f2F095E83D6E6151146c18A5Bb85","data":"0x","logIndex":0,"topics":["0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b","0x000000000000000000000000babe8f24ffb27fb01c5b66999db6929e5d500c70"]},{"address":"0xbB643167f03EfF532c537e3d72E56b9992CaD985","data":"0x","logIndex":1,"topics":["0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0","0x0000000000000000000000000000000000000000000000000000000000000000","0x000000000000000000000000ade6b8eb69a49b56929c1d4f4b428d791861db6f"]},{"address":"0x70d5AFAAaEF8f2F095E83D6E6151146c18A5Bb85","data":"0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000bb643167f03eff532c537e3d72e56b9992cad985","logIndex":2,"topics":["0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f"]}],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"HorizonProxies#TransparentUpgradeableProxy_PaymentsEscrow","result":{"address":"0x70d5AFAAaEF8f2F095E83D6E6151146c18A5Bb85","type":"SUCCESS"},"type":"DEPLOYMENT_EXECUTION_STATE_COMPLETE"} +{"artifactId":"EpochManager#GraphProxy","constructorArgs":["0x450906A976dc21450A7CcD1989D26E137E605B91","0x1CEBe1C314Cc454baf4bd553409d957C833623c0"],"contractName":"GraphProxy","dependencies":["EpochManager#EpochManager","GraphProxyAdmin#GraphProxyAdmin"],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","futureId":"EpochManager#GraphProxy","futureType":"CONTRACT_DEPLOYMENT","libraries":{},"strategy":"basic","strategyConfig":{},"type":"DEPLOYMENT_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"EpochManager#GraphProxy","networkInteraction":{"data":"0x608060405234801561001057600080fd5b50604051610a12380380610a128339818101604052604081101561003357600080fd5b50805160209091015161004581610055565b61004e826100b3565b5050610137565b600061005f610111565b6000805160206109d2833981519152838155604051919250906001600160a01b0380851691908416907f101b8081ff3b56bbf45deb824d86a3b0fd38b7e3dd42421105cf8abe9106db0b90600090a3505050565b60006100bd610124565b6000805160206109f2833981519152838155604051919250906001600160a01b0380851691908416907f980c0d30fe97457c47903527d88b7009a1643be6de24d2af664214919f0540a190600090a3505050565b6000805160206109d28339815191525490565b6000805160206109f28339815191525490565b61088c806101466000396000f3fe6080604052600436106100745760003560e01c80635c60da1b1161004e5780635c60da1b14610104578063623faf6114610119578063704b6c0214610196578063f851a440146101c957610083565b80633659cfe61461008b578063396f7b23146100be57806359fc20bb146100ef57610083565b36610083576100816101de565b005b6100816101de565b34801561009757600080fd5b50610081600480360360208110156100ae57600080fd5b50356001600160a01b031661029e565b3480156100ca57600080fd5b506100d36102d8565b604080516001600160a01b039092168252519081900360200190f35b3480156100fb57600080fd5b50610081610338565b34801561011057600080fd5b506100d3610393565b34801561012557600080fd5b506100816004803603602081101561013c57600080fd5b81019060208101813564010000000081111561015757600080fd5b82018360208201111561016957600080fd5b8035906020019184600183028401116401000000008311171561018b57600080fd5b5090925090506103e1565b3480156101a257600080fd5b50610081600480360360208110156101b957600080fd5b50356001600160a01b03166104f1565b3480156101d557600080fd5b506100d3610576565b6101e66105c0565b6001600160a01b0316336001600160a01b0316141561024c576040805162461bcd60e51b815260206004820152601f60248201527f43616e6e6f742066616c6c6261636b20746f2070726f78792074617267657400604482015290519081900360640190fd5b6040516001600160a01b037f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc541636600083376000803684845af490503d806000843e81801561029a578184f35b8184fd5b6102a66105c0565b6001600160a01b0316336001600160a01b031614156102cd576102c8816105e5565b6102d5565b6102d56101de565b50565b60006102e26105c0565b6001600160a01b0316336001600160a01b031614806103195750610304610655565b6001600160a01b0316336001600160a01b0316145b1561032d57610326610655565b9050610335565b6103356101de565b90565b6103406105c0565b6001600160a01b0316336001600160a01b031614806103775750610362610655565b6001600160a01b0316336001600160a01b0316145b156103895761038461067a565b610391565b6103916101de565b565b600061039d6105c0565b6001600160a01b0316336001600160a01b031614806103d457506103bf610655565b6001600160a01b0316336001600160a01b0316145b1561032d57610326610751565b6103e96105c0565b6001600160a01b0316336001600160a01b03161480610420575061040b610655565b6001600160a01b0316336001600160a01b0316145b156104e55761042d61067a565b6000610437610751565b6001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d8060008114610491576040519150601f19603f3d011682016040523d82523d6000602084013e610496565b606091505b50509050806104df576040805162461bcd60e51b815260206004820152601060248201526f125b5c1b0818d85b1b0819985a5b195960821b604482015290519081900360640190fd5b506104ed565b6104ed6101de565b5050565b6104f96105c0565b6001600160a01b0316336001600160a01b031614156102cd576001600160a01b03811661056d576040805162461bcd60e51b815260206004820152601e60248201527f41646d696e2063616e7420626520746865207a65726f20616464726573730000604482015290519081900360640190fd5b6102c881610776565b60006105806105c0565b6001600160a01b0316336001600160a01b031614806105b757506105a2610655565b6001600160a01b0316336001600160a01b0316145b1561032d576103265b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b60006105ef610655565b7f9e5eddc59e0b171f57125ab86bee043d9128098c3a6b9adb4f2e86333c2f6f8c838155604051919250906001600160a01b0380851691908416907f980c0d30fe97457c47903527d88b7009a1643be6de24d2af664214919f0540a190600090a3505050565b7f9e5eddc59e0b171f57125ab86bee043d9128098c3a6b9adb4f2e86333c2f6f8c5490565b6000610684610655565b90506001600160a01b0381166106e1576040805162461bcd60e51b815260206004820152601b60248201527f496d706c2063616e6e6f74206265207a65726f20616464726573730000000000604482015290519081900360640190fd5b336001600160a01b0382161461073e576040805162461bcd60e51b815260206004820152601b60248201527f4f6e6c792070656e64696e6720696d706c656d656e746174696f6e0000000000604482015290519081900360640190fd5b610747816107e6565b6102d560006105e5565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b60006107806105c0565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103838155604051919250906001600160a01b0380851691908416907f101b8081ff3b56bbf45deb824d86a3b0fd38b7e3dd42421105cf8abe9106db0b90600090a3505050565b60006107f0610751565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc838155604051919250906001600160a01b0380851691908416907faa3f731066a578e5f39b4215468d826cdd15373cbc0dfc9cb9bdc649718ef7da90600090a350505056fea264697066735822122041ce882775d17ef838c17f08249aa48a5f3ea1c65b581e69896452640b274de264736f6c63430007060033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61039e5eddc59e0b171f57125ab86bee043d9128098c3a6b9adb4f2e86333c2f6f8c000000000000000000000000450906a976dc21450a7ccd1989d26e137e605b910000000000000000000000001cebe1c314cc454baf4bd553409d957c833623c0","id":1,"type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"EpochManager#GraphProxy","networkInteractionId":1,"nonce":1603,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"EpochManager#GraphProxy","networkInteractionId":1,"nonce":1603,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0x70673b1942420700c6029089aa17d2010a7f6925a8faffa8a2c56a19af19129f"},"type":"TRANSACTION_SEND"} +{"args":["0x0750EdA3185C758247E97819074bCD217a815FaE",60],"artifactId":"EpochManager#EpochManager","dependencies":["EpochManager#EpochManager","Controller#Controller"],"functionName":"initialize","futureId":"EpochManager#encodeFunctionCall(EpochManager#EpochManager.initialize)","result":"0xcd6dc6870000000000000000000000000750eda3185c758247e97819074bcd217a815fae000000000000000000000000000000000000000000000000000000000000003c","strategy":"basic","strategyConfig":{},"type":"ENCODE_FUNCTION_CALL_EXECUTION_STATE_INITIALIZE"} +{"args":["0xed734418922426bf2cc8783754bd80fc4d441a4dbe994549aee8a2f03136fcdb","0x1CEBe1C314Cc454baf4bd553409d957C833623c0"],"artifactId":"Controller#Controller","contractAddress":"0x0750EdA3185C758247E97819074bCD217a815FaE","dependencies":["Controller#Controller","GraphProxyAdmin#GraphProxyAdmin"],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","functionName":"setContractProxy","futureId":"GraphHorizon_Periphery#setContractProxy_GraphProxyAdmin","strategy":"basic","strategyConfig":{},"type":"CALL_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"GraphHorizon_Periphery#setContractProxy_GraphProxyAdmin","networkInteraction":{"data":"0xe0e99292ed734418922426bf2cc8783754bd80fc4d441a4dbe994549aee8a2f03136fcdb0000000000000000000000001cebe1c314cc454baf4bd553409d957c833623c0","id":1,"to":"0x0750EdA3185C758247E97819074bCD217a815FaE","type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"GraphHorizon_Periphery#setContractProxy_GraphProxyAdmin","networkInteractionId":1,"nonce":1604,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"GraphHorizon_Periphery#setContractProxy_GraphProxyAdmin","networkInteractionId":1,"nonce":1604,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0x17fc13472b9e6884333a28ba14936405b039e0e172885c8c60504af946a4e50b"},"type":"TRANSACTION_SEND"} +{"artifactId":"HorizonProxies#GraphPayments_ProxyWithABI","contractAddress":"0xAFd60629034fBdC3ef58518B817bBDB4EC861c93","contractName":"GraphPayments_ProxyWithABI","dependencies":["HorizonProxies#TransparentUpgradeableProxy_GraphPayments"],"futureId":"HorizonProxies#GraphPayments_ProxyWithABI","futureType":"CONTRACT_AT","strategy":"basic","strategyConfig":{},"type":"CONTRACT_AT_EXECUTION_STATE_INITIALIZE"} +{"artifactId":"HorizonProxies#GraphProxy","constructorArgs":["0x0000000000000000000000000000000000000000","0x1CEBe1C314Cc454baf4bd553409d957C833623c0"],"contractName":"GraphProxy","dependencies":["GraphProxyAdmin#GraphProxyAdmin"],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","futureId":"HorizonProxies#GraphProxy","futureType":"CONTRACT_DEPLOYMENT","libraries":{},"strategy":"basic","strategyConfig":{},"type":"DEPLOYMENT_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"HorizonProxies#GraphProxy","networkInteraction":{"data":"0x608060405234801561001057600080fd5b50604051610a12380380610a128339818101604052604081101561003357600080fd5b50805160209091015161004581610055565b61004e826100b3565b5050610137565b600061005f610111565b6000805160206109d2833981519152838155604051919250906001600160a01b0380851691908416907f101b8081ff3b56bbf45deb824d86a3b0fd38b7e3dd42421105cf8abe9106db0b90600090a3505050565b60006100bd610124565b6000805160206109f2833981519152838155604051919250906001600160a01b0380851691908416907f980c0d30fe97457c47903527d88b7009a1643be6de24d2af664214919f0540a190600090a3505050565b6000805160206109d28339815191525490565b6000805160206109f28339815191525490565b61088c806101466000396000f3fe6080604052600436106100745760003560e01c80635c60da1b1161004e5780635c60da1b14610104578063623faf6114610119578063704b6c0214610196578063f851a440146101c957610083565b80633659cfe61461008b578063396f7b23146100be57806359fc20bb146100ef57610083565b36610083576100816101de565b005b6100816101de565b34801561009757600080fd5b50610081600480360360208110156100ae57600080fd5b50356001600160a01b031661029e565b3480156100ca57600080fd5b506100d36102d8565b604080516001600160a01b039092168252519081900360200190f35b3480156100fb57600080fd5b50610081610338565b34801561011057600080fd5b506100d3610393565b34801561012557600080fd5b506100816004803603602081101561013c57600080fd5b81019060208101813564010000000081111561015757600080fd5b82018360208201111561016957600080fd5b8035906020019184600183028401116401000000008311171561018b57600080fd5b5090925090506103e1565b3480156101a257600080fd5b50610081600480360360208110156101b957600080fd5b50356001600160a01b03166104f1565b3480156101d557600080fd5b506100d3610576565b6101e66105c0565b6001600160a01b0316336001600160a01b0316141561024c576040805162461bcd60e51b815260206004820152601f60248201527f43616e6e6f742066616c6c6261636b20746f2070726f78792074617267657400604482015290519081900360640190fd5b6040516001600160a01b037f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc541636600083376000803684845af490503d806000843e81801561029a578184f35b8184fd5b6102a66105c0565b6001600160a01b0316336001600160a01b031614156102cd576102c8816105e5565b6102d5565b6102d56101de565b50565b60006102e26105c0565b6001600160a01b0316336001600160a01b031614806103195750610304610655565b6001600160a01b0316336001600160a01b0316145b1561032d57610326610655565b9050610335565b6103356101de565b90565b6103406105c0565b6001600160a01b0316336001600160a01b031614806103775750610362610655565b6001600160a01b0316336001600160a01b0316145b156103895761038461067a565b610391565b6103916101de565b565b600061039d6105c0565b6001600160a01b0316336001600160a01b031614806103d457506103bf610655565b6001600160a01b0316336001600160a01b0316145b1561032d57610326610751565b6103e96105c0565b6001600160a01b0316336001600160a01b03161480610420575061040b610655565b6001600160a01b0316336001600160a01b0316145b156104e55761042d61067a565b6000610437610751565b6001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d8060008114610491576040519150601f19603f3d011682016040523d82523d6000602084013e610496565b606091505b50509050806104df576040805162461bcd60e51b815260206004820152601060248201526f125b5c1b0818d85b1b0819985a5b195960821b604482015290519081900360640190fd5b506104ed565b6104ed6101de565b5050565b6104f96105c0565b6001600160a01b0316336001600160a01b031614156102cd576001600160a01b03811661056d576040805162461bcd60e51b815260206004820152601e60248201527f41646d696e2063616e7420626520746865207a65726f20616464726573730000604482015290519081900360640190fd5b6102c881610776565b60006105806105c0565b6001600160a01b0316336001600160a01b031614806105b757506105a2610655565b6001600160a01b0316336001600160a01b0316145b1561032d576103265b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b60006105ef610655565b7f9e5eddc59e0b171f57125ab86bee043d9128098c3a6b9adb4f2e86333c2f6f8c838155604051919250906001600160a01b0380851691908416907f980c0d30fe97457c47903527d88b7009a1643be6de24d2af664214919f0540a190600090a3505050565b7f9e5eddc59e0b171f57125ab86bee043d9128098c3a6b9adb4f2e86333c2f6f8c5490565b6000610684610655565b90506001600160a01b0381166106e1576040805162461bcd60e51b815260206004820152601b60248201527f496d706c2063616e6e6f74206265207a65726f20616464726573730000000000604482015290519081900360640190fd5b336001600160a01b0382161461073e576040805162461bcd60e51b815260206004820152601b60248201527f4f6e6c792070656e64696e6720696d706c656d656e746174696f6e0000000000604482015290519081900360640190fd5b610747816107e6565b6102d560006105e5565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b60006107806105c0565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103838155604051919250906001600160a01b0380851691908416907f101b8081ff3b56bbf45deb824d86a3b0fd38b7e3dd42421105cf8abe9106db0b90600090a3505050565b60006107f0610751565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc838155604051919250906001600160a01b0380851691908416907faa3f731066a578e5f39b4215468d826cdd15373cbc0dfc9cb9bdc649718ef7da90600090a350505056fea264697066735822122041ce882775d17ef838c17f08249aa48a5f3ea1c65b581e69896452640b274de264736f6c63430007060033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61039e5eddc59e0b171f57125ab86bee043d9128098c3a6b9adb4f2e86333c2f6f8c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000001cebe1c314cc454baf4bd553409d957c833623c0","id":1,"type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"HorizonProxies#GraphProxy","networkInteractionId":1,"nonce":1605,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"HorizonProxies#GraphProxy","networkInteractionId":1,"nonce":1605,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0x12046ff040bcb03bb9d7764120995666dcfc62ebb1c93f9c25305fb90c4126c4"},"type":"TRANSACTION_SEND"} +{"artifactId":"HorizonProxies#PaymentsEscrow_ProxyWithABI","contractAddress":"0x70d5AFAAaEF8f2F095E83D6E6151146c18A5Bb85","contractName":"PaymentsEscrow_ProxyWithABI","dependencies":["HorizonProxies#TransparentUpgradeableProxy_PaymentsEscrow"],"futureId":"HorizonProxies#PaymentsEscrow_ProxyWithABI","futureType":"CONTRACT_AT","strategy":"basic","strategyConfig":{},"type":"CONTRACT_AT_EXECUTION_STATE_INITIALIZE"} +{"artifactId":"HorizonProxies#TransparentUpgradeableProxy_GraphPayments","dependencies":["HorizonProxies#TransparentUpgradeableProxy_GraphPayments"],"emitterAddress":"0xAFd60629034fBdC3ef58518B817bBDB4EC861c93","eventIndex":0,"eventName":"AdminChanged","futureId":"HorizonProxies#TransparentUpgradeableProxy_GraphPayments_AdminChanged","nameOrIndex":"newAdmin","result":"0xAcA3dd622e863E425Cdb15E8734a5CB318448db7","strategy":"basic","strategyConfig":{},"txToReadFrom":"0x9ce59770403f06943081072734b4edb820bc9f669e6ed25fafb503f50581005a","type":"READ_EVENT_ARGUMENT_EXECUTION_STATE_INITIALIZE"} +{"artifactId":"HorizonProxies#TransparentUpgradeableProxy_PaymentsEscrow","dependencies":["HorizonProxies#TransparentUpgradeableProxy_PaymentsEscrow"],"emitterAddress":"0x70d5AFAAaEF8f2F095E83D6E6151146c18A5Bb85","eventIndex":0,"eventName":"AdminChanged","futureId":"HorizonProxies#TransparentUpgradeableProxy_PaymentsEscrow_AdminChanged","nameOrIndex":"newAdmin","result":"0xbB643167f03EfF532c537e3d72E56b9992CaD985","strategy":"basic","strategyConfig":{},"txToReadFrom":"0x65688faa5ebf1a43b5e2cee223942fb644975d2293a75645e354610e5e0b805c","type":"READ_EVENT_ARGUMENT_EXECUTION_STATE_INITIALIZE"} +{"artifactId":"L2Curation#GraphProxy","constructorArgs":["0x9CCD9B656f8A558879974ef2505496eEd7Ef7210","0x1CEBe1C314Cc454baf4bd553409d957C833623c0"],"contractName":"GraphProxy","dependencies":["L2Curation#L2Curation","GraphProxyAdmin#GraphProxyAdmin"],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","futureId":"L2Curation#GraphProxy","futureType":"CONTRACT_DEPLOYMENT","libraries":{},"strategy":"basic","strategyConfig":{},"type":"DEPLOYMENT_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"L2Curation#GraphProxy","networkInteraction":{"data":"0x608060405234801561001057600080fd5b50604051610a12380380610a128339818101604052604081101561003357600080fd5b50805160209091015161004581610055565b61004e826100b3565b5050610137565b600061005f610111565b6000805160206109d2833981519152838155604051919250906001600160a01b0380851691908416907f101b8081ff3b56bbf45deb824d86a3b0fd38b7e3dd42421105cf8abe9106db0b90600090a3505050565b60006100bd610124565b6000805160206109f2833981519152838155604051919250906001600160a01b0380851691908416907f980c0d30fe97457c47903527d88b7009a1643be6de24d2af664214919f0540a190600090a3505050565b6000805160206109d28339815191525490565b6000805160206109f28339815191525490565b61088c806101466000396000f3fe6080604052600436106100745760003560e01c80635c60da1b1161004e5780635c60da1b14610104578063623faf6114610119578063704b6c0214610196578063f851a440146101c957610083565b80633659cfe61461008b578063396f7b23146100be57806359fc20bb146100ef57610083565b36610083576100816101de565b005b6100816101de565b34801561009757600080fd5b50610081600480360360208110156100ae57600080fd5b50356001600160a01b031661029e565b3480156100ca57600080fd5b506100d36102d8565b604080516001600160a01b039092168252519081900360200190f35b3480156100fb57600080fd5b50610081610338565b34801561011057600080fd5b506100d3610393565b34801561012557600080fd5b506100816004803603602081101561013c57600080fd5b81019060208101813564010000000081111561015757600080fd5b82018360208201111561016957600080fd5b8035906020019184600183028401116401000000008311171561018b57600080fd5b5090925090506103e1565b3480156101a257600080fd5b50610081600480360360208110156101b957600080fd5b50356001600160a01b03166104f1565b3480156101d557600080fd5b506100d3610576565b6101e66105c0565b6001600160a01b0316336001600160a01b0316141561024c576040805162461bcd60e51b815260206004820152601f60248201527f43616e6e6f742066616c6c6261636b20746f2070726f78792074617267657400604482015290519081900360640190fd5b6040516001600160a01b037f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc541636600083376000803684845af490503d806000843e81801561029a578184f35b8184fd5b6102a66105c0565b6001600160a01b0316336001600160a01b031614156102cd576102c8816105e5565b6102d5565b6102d56101de565b50565b60006102e26105c0565b6001600160a01b0316336001600160a01b031614806103195750610304610655565b6001600160a01b0316336001600160a01b0316145b1561032d57610326610655565b9050610335565b6103356101de565b90565b6103406105c0565b6001600160a01b0316336001600160a01b031614806103775750610362610655565b6001600160a01b0316336001600160a01b0316145b156103895761038461067a565b610391565b6103916101de565b565b600061039d6105c0565b6001600160a01b0316336001600160a01b031614806103d457506103bf610655565b6001600160a01b0316336001600160a01b0316145b1561032d57610326610751565b6103e96105c0565b6001600160a01b0316336001600160a01b03161480610420575061040b610655565b6001600160a01b0316336001600160a01b0316145b156104e55761042d61067a565b6000610437610751565b6001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d8060008114610491576040519150601f19603f3d011682016040523d82523d6000602084013e610496565b606091505b50509050806104df576040805162461bcd60e51b815260206004820152601060248201526f125b5c1b0818d85b1b0819985a5b195960821b604482015290519081900360640190fd5b506104ed565b6104ed6101de565b5050565b6104f96105c0565b6001600160a01b0316336001600160a01b031614156102cd576001600160a01b03811661056d576040805162461bcd60e51b815260206004820152601e60248201527f41646d696e2063616e7420626520746865207a65726f20616464726573730000604482015290519081900360640190fd5b6102c881610776565b60006105806105c0565b6001600160a01b0316336001600160a01b031614806105b757506105a2610655565b6001600160a01b0316336001600160a01b0316145b1561032d576103265b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b60006105ef610655565b7f9e5eddc59e0b171f57125ab86bee043d9128098c3a6b9adb4f2e86333c2f6f8c838155604051919250906001600160a01b0380851691908416907f980c0d30fe97457c47903527d88b7009a1643be6de24d2af664214919f0540a190600090a3505050565b7f9e5eddc59e0b171f57125ab86bee043d9128098c3a6b9adb4f2e86333c2f6f8c5490565b6000610684610655565b90506001600160a01b0381166106e1576040805162461bcd60e51b815260206004820152601b60248201527f496d706c2063616e6e6f74206265207a65726f20616464726573730000000000604482015290519081900360640190fd5b336001600160a01b0382161461073e576040805162461bcd60e51b815260206004820152601b60248201527f4f6e6c792070656e64696e6720696d706c656d656e746174696f6e0000000000604482015290519081900360640190fd5b610747816107e6565b6102d560006105e5565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b60006107806105c0565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103838155604051919250906001600160a01b0380851691908416907f101b8081ff3b56bbf45deb824d86a3b0fd38b7e3dd42421105cf8abe9106db0b90600090a3505050565b60006107f0610751565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc838155604051919250906001600160a01b0380851691908416907faa3f731066a578e5f39b4215468d826cdd15373cbc0dfc9cb9bdc649718ef7da90600090a350505056fea264697066735822122041ce882775d17ef838c17f08249aa48a5f3ea1c65b581e69896452640b274de264736f6c63430007060033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61039e5eddc59e0b171f57125ab86bee043d9128098c3a6b9adb4f2e86333c2f6f8c0000000000000000000000009ccd9b656f8a558879974ef2505496eed7ef72100000000000000000000000001cebe1c314cc454baf4bd553409d957c833623c0","id":1,"type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"L2Curation#GraphProxy","networkInteractionId":1,"nonce":1606,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"L2Curation#GraphProxy","networkInteractionId":1,"nonce":1606,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0x5c128bbee1cb7cf9f52ef8e56417dd4f49b4b92622f49c1e34a6a5b490d261f0"},"type":"TRANSACTION_SEND"} +{"args":["0x0750EdA3185C758247E97819074bCD217a815FaE","0xb85d6e91EeAdDc35927AF34e5E28428282e4bcF2",10000,1],"artifactId":"L2Curation#L2Curation","dependencies":["L2Curation#L2Curation","Controller#Controller","L2Curation#GraphCurationToken"],"functionName":"initialize","futureId":"L2Curation#encodeFunctionCall(L2Curation#L2Curation.initialize)","result":"0x4c8c7a440000000000000000000000000750eda3185c758247e97819074bcd217a815fae000000000000000000000000b85d6e91eeaddc35927af34e5e28428282e4bcf200000000000000000000000000000000000000000000000000000000000027100000000000000000000000000000000000000000000000000000000000000001","strategy":"basic","strategyConfig":{},"type":"ENCODE_FUNCTION_CALL_EXECUTION_STATE_INITIALIZE"} +{"artifactId":"L2GraphToken#GraphProxy","constructorArgs":["0x71927f8Ff0ce294882e2A161A54F62f3b0f3c726","0x1CEBe1C314Cc454baf4bd553409d957C833623c0"],"contractName":"GraphProxy","dependencies":["L2GraphToken#L2GraphToken","GraphProxyAdmin#GraphProxyAdmin"],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","futureId":"L2GraphToken#GraphProxy","futureType":"CONTRACT_DEPLOYMENT","libraries":{},"strategy":"basic","strategyConfig":{},"type":"DEPLOYMENT_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"L2GraphToken#GraphProxy","networkInteraction":{"data":"0x608060405234801561001057600080fd5b50604051610a12380380610a128339818101604052604081101561003357600080fd5b50805160209091015161004581610055565b61004e826100b3565b5050610137565b600061005f610111565b6000805160206109d2833981519152838155604051919250906001600160a01b0380851691908416907f101b8081ff3b56bbf45deb824d86a3b0fd38b7e3dd42421105cf8abe9106db0b90600090a3505050565b60006100bd610124565b6000805160206109f2833981519152838155604051919250906001600160a01b0380851691908416907f980c0d30fe97457c47903527d88b7009a1643be6de24d2af664214919f0540a190600090a3505050565b6000805160206109d28339815191525490565b6000805160206109f28339815191525490565b61088c806101466000396000f3fe6080604052600436106100745760003560e01c80635c60da1b1161004e5780635c60da1b14610104578063623faf6114610119578063704b6c0214610196578063f851a440146101c957610083565b80633659cfe61461008b578063396f7b23146100be57806359fc20bb146100ef57610083565b36610083576100816101de565b005b6100816101de565b34801561009757600080fd5b50610081600480360360208110156100ae57600080fd5b50356001600160a01b031661029e565b3480156100ca57600080fd5b506100d36102d8565b604080516001600160a01b039092168252519081900360200190f35b3480156100fb57600080fd5b50610081610338565b34801561011057600080fd5b506100d3610393565b34801561012557600080fd5b506100816004803603602081101561013c57600080fd5b81019060208101813564010000000081111561015757600080fd5b82018360208201111561016957600080fd5b8035906020019184600183028401116401000000008311171561018b57600080fd5b5090925090506103e1565b3480156101a257600080fd5b50610081600480360360208110156101b957600080fd5b50356001600160a01b03166104f1565b3480156101d557600080fd5b506100d3610576565b6101e66105c0565b6001600160a01b0316336001600160a01b0316141561024c576040805162461bcd60e51b815260206004820152601f60248201527f43616e6e6f742066616c6c6261636b20746f2070726f78792074617267657400604482015290519081900360640190fd5b6040516001600160a01b037f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc541636600083376000803684845af490503d806000843e81801561029a578184f35b8184fd5b6102a66105c0565b6001600160a01b0316336001600160a01b031614156102cd576102c8816105e5565b6102d5565b6102d56101de565b50565b60006102e26105c0565b6001600160a01b0316336001600160a01b031614806103195750610304610655565b6001600160a01b0316336001600160a01b0316145b1561032d57610326610655565b9050610335565b6103356101de565b90565b6103406105c0565b6001600160a01b0316336001600160a01b031614806103775750610362610655565b6001600160a01b0316336001600160a01b0316145b156103895761038461067a565b610391565b6103916101de565b565b600061039d6105c0565b6001600160a01b0316336001600160a01b031614806103d457506103bf610655565b6001600160a01b0316336001600160a01b0316145b1561032d57610326610751565b6103e96105c0565b6001600160a01b0316336001600160a01b03161480610420575061040b610655565b6001600160a01b0316336001600160a01b0316145b156104e55761042d61067a565b6000610437610751565b6001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d8060008114610491576040519150601f19603f3d011682016040523d82523d6000602084013e610496565b606091505b50509050806104df576040805162461bcd60e51b815260206004820152601060248201526f125b5c1b0818d85b1b0819985a5b195960821b604482015290519081900360640190fd5b506104ed565b6104ed6101de565b5050565b6104f96105c0565b6001600160a01b0316336001600160a01b031614156102cd576001600160a01b03811661056d576040805162461bcd60e51b815260206004820152601e60248201527f41646d696e2063616e7420626520746865207a65726f20616464726573730000604482015290519081900360640190fd5b6102c881610776565b60006105806105c0565b6001600160a01b0316336001600160a01b031614806105b757506105a2610655565b6001600160a01b0316336001600160a01b0316145b1561032d576103265b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b60006105ef610655565b7f9e5eddc59e0b171f57125ab86bee043d9128098c3a6b9adb4f2e86333c2f6f8c838155604051919250906001600160a01b0380851691908416907f980c0d30fe97457c47903527d88b7009a1643be6de24d2af664214919f0540a190600090a3505050565b7f9e5eddc59e0b171f57125ab86bee043d9128098c3a6b9adb4f2e86333c2f6f8c5490565b6000610684610655565b90506001600160a01b0381166106e1576040805162461bcd60e51b815260206004820152601b60248201527f496d706c2063616e6e6f74206265207a65726f20616464726573730000000000604482015290519081900360640190fd5b336001600160a01b0382161461073e576040805162461bcd60e51b815260206004820152601b60248201527f4f6e6c792070656e64696e6720696d706c656d656e746174696f6e0000000000604482015290519081900360640190fd5b610747816107e6565b6102d560006105e5565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b60006107806105c0565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103838155604051919250906001600160a01b0380851691908416907f101b8081ff3b56bbf45deb824d86a3b0fd38b7e3dd42421105cf8abe9106db0b90600090a3505050565b60006107f0610751565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc838155604051919250906001600160a01b0380851691908416907faa3f731066a578e5f39b4215468d826cdd15373cbc0dfc9cb9bdc649718ef7da90600090a350505056fea264697066735822122041ce882775d17ef838c17f08249aa48a5f3ea1c65b581e69896452640b274de264736f6c63430007060033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61039e5eddc59e0b171f57125ab86bee043d9128098c3a6b9adb4f2e86333c2f6f8c00000000000000000000000071927f8ff0ce294882e2a161a54f62f3b0f3c7260000000000000000000000001cebe1c314cc454baf4bd553409d957c833623c0","id":1,"type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"L2GraphToken#GraphProxy","networkInteractionId":1,"nonce":1607,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"L2GraphToken#GraphProxy","networkInteractionId":1,"nonce":1607,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0x0885250dc8c71655552807f0e94dd25995ab2aa5ee93f6a576c3cd27e72e11d1"},"type":"TRANSACTION_SEND"} +{"artifactId":"L2GraphTokenGateway#GraphProxy","constructorArgs":["0x4dEA2d1Be05909B71F539FD32601F7bd736c28D4","0x1CEBe1C314Cc454baf4bd553409d957C833623c0"],"contractName":"GraphProxy","dependencies":["L2GraphTokenGateway#L2GraphTokenGateway","GraphProxyAdmin#GraphProxyAdmin"],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","futureId":"L2GraphTokenGateway#GraphProxy","futureType":"CONTRACT_DEPLOYMENT","libraries":{},"strategy":"basic","strategyConfig":{},"type":"DEPLOYMENT_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"L2GraphTokenGateway#GraphProxy","networkInteraction":{"data":"0x608060405234801561001057600080fd5b50604051610a12380380610a128339818101604052604081101561003357600080fd5b50805160209091015161004581610055565b61004e826100b3565b5050610137565b600061005f610111565b6000805160206109d2833981519152838155604051919250906001600160a01b0380851691908416907f101b8081ff3b56bbf45deb824d86a3b0fd38b7e3dd42421105cf8abe9106db0b90600090a3505050565b60006100bd610124565b6000805160206109f2833981519152838155604051919250906001600160a01b0380851691908416907f980c0d30fe97457c47903527d88b7009a1643be6de24d2af664214919f0540a190600090a3505050565b6000805160206109d28339815191525490565b6000805160206109f28339815191525490565b61088c806101466000396000f3fe6080604052600436106100745760003560e01c80635c60da1b1161004e5780635c60da1b14610104578063623faf6114610119578063704b6c0214610196578063f851a440146101c957610083565b80633659cfe61461008b578063396f7b23146100be57806359fc20bb146100ef57610083565b36610083576100816101de565b005b6100816101de565b34801561009757600080fd5b50610081600480360360208110156100ae57600080fd5b50356001600160a01b031661029e565b3480156100ca57600080fd5b506100d36102d8565b604080516001600160a01b039092168252519081900360200190f35b3480156100fb57600080fd5b50610081610338565b34801561011057600080fd5b506100d3610393565b34801561012557600080fd5b506100816004803603602081101561013c57600080fd5b81019060208101813564010000000081111561015757600080fd5b82018360208201111561016957600080fd5b8035906020019184600183028401116401000000008311171561018b57600080fd5b5090925090506103e1565b3480156101a257600080fd5b50610081600480360360208110156101b957600080fd5b50356001600160a01b03166104f1565b3480156101d557600080fd5b506100d3610576565b6101e66105c0565b6001600160a01b0316336001600160a01b0316141561024c576040805162461bcd60e51b815260206004820152601f60248201527f43616e6e6f742066616c6c6261636b20746f2070726f78792074617267657400604482015290519081900360640190fd5b6040516001600160a01b037f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc541636600083376000803684845af490503d806000843e81801561029a578184f35b8184fd5b6102a66105c0565b6001600160a01b0316336001600160a01b031614156102cd576102c8816105e5565b6102d5565b6102d56101de565b50565b60006102e26105c0565b6001600160a01b0316336001600160a01b031614806103195750610304610655565b6001600160a01b0316336001600160a01b0316145b1561032d57610326610655565b9050610335565b6103356101de565b90565b6103406105c0565b6001600160a01b0316336001600160a01b031614806103775750610362610655565b6001600160a01b0316336001600160a01b0316145b156103895761038461067a565b610391565b6103916101de565b565b600061039d6105c0565b6001600160a01b0316336001600160a01b031614806103d457506103bf610655565b6001600160a01b0316336001600160a01b0316145b1561032d57610326610751565b6103e96105c0565b6001600160a01b0316336001600160a01b03161480610420575061040b610655565b6001600160a01b0316336001600160a01b0316145b156104e55761042d61067a565b6000610437610751565b6001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d8060008114610491576040519150601f19603f3d011682016040523d82523d6000602084013e610496565b606091505b50509050806104df576040805162461bcd60e51b815260206004820152601060248201526f125b5c1b0818d85b1b0819985a5b195960821b604482015290519081900360640190fd5b506104ed565b6104ed6101de565b5050565b6104f96105c0565b6001600160a01b0316336001600160a01b031614156102cd576001600160a01b03811661056d576040805162461bcd60e51b815260206004820152601e60248201527f41646d696e2063616e7420626520746865207a65726f20616464726573730000604482015290519081900360640190fd5b6102c881610776565b60006105806105c0565b6001600160a01b0316336001600160a01b031614806105b757506105a2610655565b6001600160a01b0316336001600160a01b0316145b1561032d576103265b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b60006105ef610655565b7f9e5eddc59e0b171f57125ab86bee043d9128098c3a6b9adb4f2e86333c2f6f8c838155604051919250906001600160a01b0380851691908416907f980c0d30fe97457c47903527d88b7009a1643be6de24d2af664214919f0540a190600090a3505050565b7f9e5eddc59e0b171f57125ab86bee043d9128098c3a6b9adb4f2e86333c2f6f8c5490565b6000610684610655565b90506001600160a01b0381166106e1576040805162461bcd60e51b815260206004820152601b60248201527f496d706c2063616e6e6f74206265207a65726f20616464726573730000000000604482015290519081900360640190fd5b336001600160a01b0382161461073e576040805162461bcd60e51b815260206004820152601b60248201527f4f6e6c792070656e64696e6720696d706c656d656e746174696f6e0000000000604482015290519081900360640190fd5b610747816107e6565b6102d560006105e5565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b60006107806105c0565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103838155604051919250906001600160a01b0380851691908416907f101b8081ff3b56bbf45deb824d86a3b0fd38b7e3dd42421105cf8abe9106db0b90600090a3505050565b60006107f0610751565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc838155604051919250906001600160a01b0380851691908416907faa3f731066a578e5f39b4215468d826cdd15373cbc0dfc9cb9bdc649718ef7da90600090a350505056fea264697066735822122041ce882775d17ef838c17f08249aa48a5f3ea1c65b581e69896452640b274de264736f6c63430007060033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61039e5eddc59e0b171f57125ab86bee043d9128098c3a6b9adb4f2e86333c2f6f8c0000000000000000000000004dea2d1be05909b71f539fd32601f7bd736c28d40000000000000000000000001cebe1c314cc454baf4bd553409d957c833623c0","id":1,"type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"L2GraphTokenGateway#GraphProxy","networkInteractionId":1,"nonce":1608,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"L2GraphTokenGateway#GraphProxy","networkInteractionId":1,"nonce":1608,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0xbb9f3c0e4f560b942e332a9bc29e76c1847232ba2854fd31834b94ffb797adc4"},"type":"TRANSACTION_SEND"} +{"args":["0x0750EdA3185C758247E97819074bCD217a815FaE"],"artifactId":"L2GraphTokenGateway#L2GraphTokenGateway","dependencies":["L2GraphTokenGateway#L2GraphTokenGateway","Controller#Controller"],"functionName":"initialize","futureId":"L2GraphTokenGateway#encodeFunctionCall(L2GraphTokenGateway#L2GraphTokenGateway.initialize)","result":"0xc4d66de80000000000000000000000000750eda3185c758247e97819074bcd217a815fae","strategy":"basic","strategyConfig":{},"type":"ENCODE_FUNCTION_CALL_EXECUTION_STATE_INITIALIZE"} +{"artifactId":"RewardsManager#GraphProxy","constructorArgs":["0x05Ca4d407ec53Ac17ce6Bb414f42663f415Dc5C3","0x1CEBe1C314Cc454baf4bd553409d957C833623c0"],"contractName":"GraphProxy","dependencies":["RewardsManager#RewardsManager","GraphProxyAdmin#GraphProxyAdmin"],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","futureId":"RewardsManager#GraphProxy","futureType":"CONTRACT_DEPLOYMENT","libraries":{},"strategy":"basic","strategyConfig":{},"type":"DEPLOYMENT_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"RewardsManager#GraphProxy","networkInteraction":{"data":"0x608060405234801561001057600080fd5b50604051610a12380380610a128339818101604052604081101561003357600080fd5b50805160209091015161004581610055565b61004e826100b3565b5050610137565b600061005f610111565b6000805160206109d2833981519152838155604051919250906001600160a01b0380851691908416907f101b8081ff3b56bbf45deb824d86a3b0fd38b7e3dd42421105cf8abe9106db0b90600090a3505050565b60006100bd610124565b6000805160206109f2833981519152838155604051919250906001600160a01b0380851691908416907f980c0d30fe97457c47903527d88b7009a1643be6de24d2af664214919f0540a190600090a3505050565b6000805160206109d28339815191525490565b6000805160206109f28339815191525490565b61088c806101466000396000f3fe6080604052600436106100745760003560e01c80635c60da1b1161004e5780635c60da1b14610104578063623faf6114610119578063704b6c0214610196578063f851a440146101c957610083565b80633659cfe61461008b578063396f7b23146100be57806359fc20bb146100ef57610083565b36610083576100816101de565b005b6100816101de565b34801561009757600080fd5b50610081600480360360208110156100ae57600080fd5b50356001600160a01b031661029e565b3480156100ca57600080fd5b506100d36102d8565b604080516001600160a01b039092168252519081900360200190f35b3480156100fb57600080fd5b50610081610338565b34801561011057600080fd5b506100d3610393565b34801561012557600080fd5b506100816004803603602081101561013c57600080fd5b81019060208101813564010000000081111561015757600080fd5b82018360208201111561016957600080fd5b8035906020019184600183028401116401000000008311171561018b57600080fd5b5090925090506103e1565b3480156101a257600080fd5b50610081600480360360208110156101b957600080fd5b50356001600160a01b03166104f1565b3480156101d557600080fd5b506100d3610576565b6101e66105c0565b6001600160a01b0316336001600160a01b0316141561024c576040805162461bcd60e51b815260206004820152601f60248201527f43616e6e6f742066616c6c6261636b20746f2070726f78792074617267657400604482015290519081900360640190fd5b6040516001600160a01b037f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc541636600083376000803684845af490503d806000843e81801561029a578184f35b8184fd5b6102a66105c0565b6001600160a01b0316336001600160a01b031614156102cd576102c8816105e5565b6102d5565b6102d56101de565b50565b60006102e26105c0565b6001600160a01b0316336001600160a01b031614806103195750610304610655565b6001600160a01b0316336001600160a01b0316145b1561032d57610326610655565b9050610335565b6103356101de565b90565b6103406105c0565b6001600160a01b0316336001600160a01b031614806103775750610362610655565b6001600160a01b0316336001600160a01b0316145b156103895761038461067a565b610391565b6103916101de565b565b600061039d6105c0565b6001600160a01b0316336001600160a01b031614806103d457506103bf610655565b6001600160a01b0316336001600160a01b0316145b1561032d57610326610751565b6103e96105c0565b6001600160a01b0316336001600160a01b03161480610420575061040b610655565b6001600160a01b0316336001600160a01b0316145b156104e55761042d61067a565b6000610437610751565b6001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d8060008114610491576040519150601f19603f3d011682016040523d82523d6000602084013e610496565b606091505b50509050806104df576040805162461bcd60e51b815260206004820152601060248201526f125b5c1b0818d85b1b0819985a5b195960821b604482015290519081900360640190fd5b506104ed565b6104ed6101de565b5050565b6104f96105c0565b6001600160a01b0316336001600160a01b031614156102cd576001600160a01b03811661056d576040805162461bcd60e51b815260206004820152601e60248201527f41646d696e2063616e7420626520746865207a65726f20616464726573730000604482015290519081900360640190fd5b6102c881610776565b60006105806105c0565b6001600160a01b0316336001600160a01b031614806105b757506105a2610655565b6001600160a01b0316336001600160a01b0316145b1561032d576103265b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b60006105ef610655565b7f9e5eddc59e0b171f57125ab86bee043d9128098c3a6b9adb4f2e86333c2f6f8c838155604051919250906001600160a01b0380851691908416907f980c0d30fe97457c47903527d88b7009a1643be6de24d2af664214919f0540a190600090a3505050565b7f9e5eddc59e0b171f57125ab86bee043d9128098c3a6b9adb4f2e86333c2f6f8c5490565b6000610684610655565b90506001600160a01b0381166106e1576040805162461bcd60e51b815260206004820152601b60248201527f496d706c2063616e6e6f74206265207a65726f20616464726573730000000000604482015290519081900360640190fd5b336001600160a01b0382161461073e576040805162461bcd60e51b815260206004820152601b60248201527f4f6e6c792070656e64696e6720696d706c656d656e746174696f6e0000000000604482015290519081900360640190fd5b610747816107e6565b6102d560006105e5565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b60006107806105c0565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103838155604051919250906001600160a01b0380851691908416907f101b8081ff3b56bbf45deb824d86a3b0fd38b7e3dd42421105cf8abe9106db0b90600090a3505050565b60006107f0610751565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc838155604051919250906001600160a01b0380851691908416907faa3f731066a578e5f39b4215468d826cdd15373cbc0dfc9cb9bdc649718ef7da90600090a350505056fea264697066735822122041ce882775d17ef838c17f08249aa48a5f3ea1c65b581e69896452640b274de264736f6c63430007060033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61039e5eddc59e0b171f57125ab86bee043d9128098c3a6b9adb4f2e86333c2f6f8c00000000000000000000000005ca4d407ec53ac17ce6bb414f42663f415dc5c30000000000000000000000001cebe1c314cc454baf4bd553409d957c833623c0","id":1,"type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"RewardsManager#GraphProxy","networkInteractionId":1,"nonce":1609,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"RewardsManager#GraphProxy","networkInteractionId":1,"nonce":1609,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0x13e7b34e0caacb89e827bb29d875e724cb0101bcba19917093c4482cf04301ea"},"type":"TRANSACTION_SEND"} +{"args":["0x0750EdA3185C758247E97819074bCD217a815FaE"],"artifactId":"RewardsManager#RewardsManager","dependencies":["RewardsManager#RewardsManager","Controller#Controller"],"functionName":"initialize","futureId":"RewardsManager#encodeFunctionCall(RewardsManager#RewardsManager.initialize)","result":"0xc4d66de80000000000000000000000000750eda3185c758247e97819074bcd217a815fae","strategy":"basic","strategyConfig":{},"type":"ENCODE_FUNCTION_CALL_EXECUTION_STATE_INITIALIZE"} +{"futureId":"EpochManager#GraphProxy","hash":"0x70673b1942420700c6029089aa17d2010a7f6925a8faffa8a2c56a19af19129f","networkInteractionId":1,"receipt":{"blockHash":"0x7e4a36277c0a5b61eef4d7f83af4db3f1728a644212b7f1549c893bd6fa54257","blockNumber":152512628,"contractAddress":"0xAA1DeBfb7A7c0Ba85cef858B6E70cFad943Fd4A2","logs":[{"address":"0xAA1DeBfb7A7c0Ba85cef858B6E70cFad943Fd4A2","data":"0x","logIndex":0,"topics":["0x101b8081ff3b56bbf45deb824d86a3b0fd38b7e3dd42421105cf8abe9106db0b","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000001cebe1c314cc454baf4bd553409d957c833623c0"]},{"address":"0xAA1DeBfb7A7c0Ba85cef858B6E70cFad943Fd4A2","data":"0x","logIndex":1,"topics":["0x980c0d30fe97457c47903527d88b7009a1643be6de24d2af664214919f0540a1","0x0000000000000000000000000000000000000000000000000000000000000000","0x000000000000000000000000450906a976dc21450a7ccd1989d26e137e605b91"]}],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"EpochManager#GraphProxy","result":{"address":"0xAA1DeBfb7A7c0Ba85cef858B6E70cFad943Fd4A2","type":"SUCCESS"},"type":"DEPLOYMENT_EXECUTION_STATE_COMPLETE"} +{"futureId":"GraphHorizon_Periphery#setContractProxy_GraphProxyAdmin","hash":"0x17fc13472b9e6884333a28ba14936405b039e0e172885c8c60504af946a4e50b","networkInteractionId":1,"receipt":{"blockHash":"0xee458f5c77fc2e6a1449b1d913975f5575e7406972bc7df06e535630329550b6","blockNumber":152512640,"logs":[{"address":"0x0750EdA3185C758247E97819074bCD217a815FaE","data":"0x0000000000000000000000001cebe1c314cc454baf4bd553409d957c833623c0","logIndex":0,"topics":["0x937cf566d78d4769ff0211a7d87a6bea51e1fc026fd4d3d8cd589f0e99b983bd","0xed734418922426bf2cc8783754bd80fc4d441a4dbe994549aee8a2f03136fcdb"]}],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"GraphHorizon_Periphery#setContractProxy_GraphProxyAdmin","result":{"type":"SUCCESS"},"type":"CALL_EXECUTION_STATE_COMPLETE"} +{"futureId":"HorizonProxies#GraphProxy","hash":"0x12046ff040bcb03bb9d7764120995666dcfc62ebb1c93f9c25305fb90c4126c4","networkInteractionId":1,"receipt":{"blockHash":"0x867e89efbefeab2af219ee8ede1266ab529ed953f62a7ac5571120ea6b93da48","blockNumber":152512652,"contractAddress":"0xF5D432192dAF7e8B045349693577ccF0B5165A12","logs":[{"address":"0xF5D432192dAF7e8B045349693577ccF0B5165A12","data":"0x","logIndex":0,"topics":["0x101b8081ff3b56bbf45deb824d86a3b0fd38b7e3dd42421105cf8abe9106db0b","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000001cebe1c314cc454baf4bd553409d957c833623c0"]},{"address":"0xF5D432192dAF7e8B045349693577ccF0B5165A12","data":"0x","logIndex":1,"topics":["0x980c0d30fe97457c47903527d88b7009a1643be6de24d2af664214919f0540a1","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000"]}],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"HorizonProxies#GraphProxy","result":{"address":"0xF5D432192dAF7e8B045349693577ccF0B5165A12","type":"SUCCESS"},"type":"DEPLOYMENT_EXECUTION_STATE_COMPLETE"} +{"futureId":"L2Curation#GraphProxy","hash":"0x5c128bbee1cb7cf9f52ef8e56417dd4f49b4b92622f49c1e34a6a5b490d261f0","networkInteractionId":1,"receipt":{"blockHash":"0x27ac46c5bc665253767219597e73a5972bc0c0edcdd34d5addbccd329911b452","blockNumber":152512664,"contractAddress":"0xe135BFD9E51BbAfCeBb0141af85F0bc6DA1b3BA4","logs":[{"address":"0xe135BFD9E51BbAfCeBb0141af85F0bc6DA1b3BA4","data":"0x","logIndex":0,"topics":["0x101b8081ff3b56bbf45deb824d86a3b0fd38b7e3dd42421105cf8abe9106db0b","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000001cebe1c314cc454baf4bd553409d957c833623c0"]},{"address":"0xe135BFD9E51BbAfCeBb0141af85F0bc6DA1b3BA4","data":"0x","logIndex":1,"topics":["0x980c0d30fe97457c47903527d88b7009a1643be6de24d2af664214919f0540a1","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000009ccd9b656f8a558879974ef2505496eed7ef7210"]}],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"L2Curation#GraphProxy","result":{"address":"0xe135BFD9E51BbAfCeBb0141af85F0bc6DA1b3BA4","type":"SUCCESS"},"type":"DEPLOYMENT_EXECUTION_STATE_COMPLETE"} +{"futureId":"L2GraphToken#GraphProxy","hash":"0x0885250dc8c71655552807f0e94dd25995ab2aa5ee93f6a576c3cd27e72e11d1","networkInteractionId":1,"receipt":{"blockHash":"0xef1e1f7d4ea7a92bbbe58f2ce36203a01b520234767dd6b151c34006ce310a5c","blockNumber":152512675,"contractAddress":"0xBBcb9a575176039C06F94d4d8337818318A26828","logs":[{"address":"0xBBcb9a575176039C06F94d4d8337818318A26828","data":"0x","logIndex":0,"topics":["0x101b8081ff3b56bbf45deb824d86a3b0fd38b7e3dd42421105cf8abe9106db0b","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000001cebe1c314cc454baf4bd553409d957c833623c0"]},{"address":"0xBBcb9a575176039C06F94d4d8337818318A26828","data":"0x","logIndex":1,"topics":["0x980c0d30fe97457c47903527d88b7009a1643be6de24d2af664214919f0540a1","0x0000000000000000000000000000000000000000000000000000000000000000","0x00000000000000000000000071927f8ff0ce294882e2a161a54f62f3b0f3c726"]}],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"L2GraphToken#GraphProxy","result":{"address":"0xBBcb9a575176039C06F94d4d8337818318A26828","type":"SUCCESS"},"type":"DEPLOYMENT_EXECUTION_STATE_COMPLETE"} +{"futureId":"L2GraphTokenGateway#GraphProxy","hash":"0xbb9f3c0e4f560b942e332a9bc29e76c1847232ba2854fd31834b94ffb797adc4","networkInteractionId":1,"receipt":{"blockHash":"0x8ee6c1f288acd3825dd522507d0117b79f388b6d14f2bcef0f743e46b6f98cfd","blockNumber":152512688,"contractAddress":"0x7284213d1cDa80C892a4388f38dA431F06343144","logs":[{"address":"0x7284213d1cDa80C892a4388f38dA431F06343144","data":"0x","logIndex":0,"topics":["0x101b8081ff3b56bbf45deb824d86a3b0fd38b7e3dd42421105cf8abe9106db0b","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000001cebe1c314cc454baf4bd553409d957c833623c0"]},{"address":"0x7284213d1cDa80C892a4388f38dA431F06343144","data":"0x","logIndex":1,"topics":["0x980c0d30fe97457c47903527d88b7009a1643be6de24d2af664214919f0540a1","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000004dea2d1be05909b71f539fd32601f7bd736c28d4"]}],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"L2GraphTokenGateway#GraphProxy","result":{"address":"0x7284213d1cDa80C892a4388f38dA431F06343144","type":"SUCCESS"},"type":"DEPLOYMENT_EXECUTION_STATE_COMPLETE"} +{"futureId":"RewardsManager#GraphProxy","hash":"0x13e7b34e0caacb89e827bb29d875e724cb0101bcba19917093c4482cf04301ea","networkInteractionId":1,"receipt":{"blockHash":"0xbfa99db971cab1d5e5a0d1bced6e796148e016697f2f0b6cdcb68362d5d40b19","blockNumber":152512700,"contractAddress":"0x1AB05a65fa6D5F6a90A23693D5d40A4D927a815f","logs":[{"address":"0x1AB05a65fa6D5F6a90A23693D5d40A4D927a815f","data":"0x","logIndex":0,"topics":["0x101b8081ff3b56bbf45deb824d86a3b0fd38b7e3dd42421105cf8abe9106db0b","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000001cebe1c314cc454baf4bd553409d957c833623c0"]},{"address":"0x1AB05a65fa6D5F6a90A23693D5d40A4D927a815f","data":"0x","logIndex":1,"topics":["0x980c0d30fe97457c47903527d88b7009a1643be6de24d2af664214919f0540a1","0x0000000000000000000000000000000000000000000000000000000000000000","0x00000000000000000000000005ca4d407ec53ac17ce6bb414f42663f415dc5c3"]}],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"RewardsManager#GraphProxy","result":{"address":"0x1AB05a65fa6D5F6a90A23693D5d40A4D927a815f","type":"SUCCESS"},"type":"DEPLOYMENT_EXECUTION_STATE_COMPLETE"} +{"artifactId":"EpochManager#EpochManager_ProxyWithABI","contractAddress":"0xAA1DeBfb7A7c0Ba85cef858B6E70cFad943Fd4A2","contractName":"EpochManager_ProxyWithABI","dependencies":["EpochManager#GraphProxy"],"futureId":"EpochManager#EpochManager_ProxyWithABI","futureType":"CONTRACT_AT","strategy":"basic","strategyConfig":{},"type":"CONTRACT_AT_EXECUTION_STATE_INITIALIZE"} +{"artifactId":"HorizonProxies#ProxyAdmin_GraphPayments","contractAddress":"0xAcA3dd622e863E425Cdb15E8734a5CB318448db7","contractName":"ProxyAdmin","dependencies":["HorizonProxies#TransparentUpgradeableProxy_GraphPayments_AdminChanged"],"futureId":"HorizonProxies#ProxyAdmin_GraphPayments","futureType":"CONTRACT_AT","strategy":"basic","strategyConfig":{},"type":"CONTRACT_AT_EXECUTION_STATE_INITIALIZE"} +{"artifactId":"HorizonProxies#ProxyAdmin_PaymentsEscrow","contractAddress":"0xbB643167f03EfF532c537e3d72E56b9992CaD985","contractName":"ProxyAdmin","dependencies":["HorizonProxies#TransparentUpgradeableProxy_PaymentsEscrow_AdminChanged"],"futureId":"HorizonProxies#ProxyAdmin_PaymentsEscrow","futureType":"CONTRACT_AT","strategy":"basic","strategyConfig":{},"type":"CONTRACT_AT_EXECUTION_STATE_INITIALIZE"} +{"args":["0x88cae14a9889b95b4cfd9472fc7dcbca2da791846a1e314bac9c1f8a234cbf9f","0xAFd60629034fBdC3ef58518B817bBDB4EC861c93"],"artifactId":"Controller#Controller","contractAddress":"0x0750EdA3185C758247E97819074bCD217a815FaE","dependencies":["Controller#Controller","HorizonProxies#GraphPayments_ProxyWithABI"],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","functionName":"setContractProxy","futureId":"HorizonProxies#setContractProxy_GraphPayments","strategy":"basic","strategyConfig":{},"type":"CALL_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"HorizonProxies#setContractProxy_GraphPayments","networkInteraction":{"data":"0xe0e9929288cae14a9889b95b4cfd9472fc7dcbca2da791846a1e314bac9c1f8a234cbf9f000000000000000000000000afd60629034fbdc3ef58518b817bbdb4ec861c93","id":1,"to":"0x0750EdA3185C758247E97819074bCD217a815FaE","type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"HorizonProxies#setContractProxy_GraphPayments","networkInteractionId":1,"nonce":1610,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"HorizonProxies#setContractProxy_GraphPayments","networkInteractionId":1,"nonce":1610,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0x25f48d2fe4d06a15878189becf6a23b2b102c984162b277dce40769d5d41d718"},"type":"TRANSACTION_SEND"} +{"args":["0x1df41cd916959d1163dc8f0671a666ea8a3e434c13e40faef527133b5d167034","0xF5D432192dAF7e8B045349693577ccF0B5165A12"],"artifactId":"Controller#Controller","contractAddress":"0x0750EdA3185C758247E97819074bCD217a815FaE","dependencies":["Controller#Controller","HorizonProxies#GraphProxy"],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","functionName":"setContractProxy","futureId":"HorizonProxies#setContractProxy_HorizonStaking","strategy":"basic","strategyConfig":{},"type":"CALL_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"HorizonProxies#setContractProxy_HorizonStaking","networkInteraction":{"data":"0xe0e992921df41cd916959d1163dc8f0671a666ea8a3e434c13e40faef527133b5d167034000000000000000000000000f5d432192daf7e8b045349693577ccf0b5165a12","id":1,"to":"0x0750EdA3185C758247E97819074bCD217a815FaE","type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"HorizonProxies#setContractProxy_HorizonStaking","networkInteractionId":1,"nonce":1611,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"HorizonProxies#setContractProxy_HorizonStaking","networkInteractionId":1,"nonce":1611,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0xf25b004bb1859edb4b8779387abf23d9e06c32d7431c18fcb56c334a38917ed5"},"type":"TRANSACTION_SEND"} +{"args":["0x628f67391f8b955553cabfadbf5f1b6a31d2a2d0fea175f5594af9d40b0bedc9","0x70d5AFAAaEF8f2F095E83D6E6151146c18A5Bb85"],"artifactId":"Controller#Controller","contractAddress":"0x0750EdA3185C758247E97819074bCD217a815FaE","dependencies":["Controller#Controller","HorizonProxies#PaymentsEscrow_ProxyWithABI"],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","functionName":"setContractProxy","futureId":"HorizonProxies#setContractProxy_PaymentsEscrow","strategy":"basic","strategyConfig":{},"type":"CALL_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"HorizonProxies#setContractProxy_PaymentsEscrow","networkInteraction":{"data":"0xe0e99292628f67391f8b955553cabfadbf5f1b6a31d2a2d0fea175f5594af9d40b0bedc900000000000000000000000070d5afaaaef8f2f095e83d6e6151146c18a5bb85","id":1,"to":"0x0750EdA3185C758247E97819074bCD217a815FaE","type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"HorizonProxies#setContractProxy_PaymentsEscrow","networkInteractionId":1,"nonce":1612,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"HorizonProxies#setContractProxy_PaymentsEscrow","networkInteractionId":1,"nonce":1612,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0xa097925819a0b2bc01f7bf4475ffb5f7eb80ff681aecbe64dd5500e4e9ef582f"},"type":"TRANSACTION_SEND"} +{"artifactId":"L2Curation#L2Curation_ProxyWithABI","contractAddress":"0xe135BFD9E51BbAfCeBb0141af85F0bc6DA1b3BA4","contractName":"L2Curation_ProxyWithABI","dependencies":["L2Curation#GraphProxy"],"futureId":"L2Curation#L2Curation_ProxyWithABI","futureType":"CONTRACT_AT","strategy":"basic","strategyConfig":{},"type":"CONTRACT_AT_EXECUTION_STATE_INITIALIZE"} +{"artifactId":"L2GraphToken#L2GraphToken_ProxyWithABI","contractAddress":"0xBBcb9a575176039C06F94d4d8337818318A26828","contractName":"L2GraphToken_ProxyWithABI","dependencies":["L2GraphToken#GraphProxy"],"futureId":"L2GraphToken#L2GraphToken_ProxyWithABI","futureType":"CONTRACT_AT","strategy":"basic","strategyConfig":{},"type":"CONTRACT_AT_EXECUTION_STATE_INITIALIZE"} +{"artifactId":"L2GraphTokenGateway#L2GraphTokenGateway_ProxyWithABI","contractAddress":"0x7284213d1cDa80C892a4388f38dA431F06343144","contractName":"L2GraphTokenGateway_ProxyWithABI","dependencies":["L2GraphTokenGateway#GraphProxy"],"futureId":"L2GraphTokenGateway#L2GraphTokenGateway_ProxyWithABI","futureType":"CONTRACT_AT","strategy":"basic","strategyConfig":{},"type":"CONTRACT_AT_EXECUTION_STATE_INITIALIZE"} +{"artifactId":"RewardsManager#RewardsManager_ProxyWithABI","contractAddress":"0x1AB05a65fa6D5F6a90A23693D5d40A4D927a815f","contractName":"RewardsManager_ProxyWithABI","dependencies":["RewardsManager#GraphProxy"],"futureId":"RewardsManager#RewardsManager_ProxyWithABI","futureType":"CONTRACT_AT","strategy":"basic","strategyConfig":{},"type":"CONTRACT_AT_EXECUTION_STATE_INITIALIZE"} +{"futureId":"HorizonProxies#setContractProxy_GraphPayments","hash":"0x25f48d2fe4d06a15878189becf6a23b2b102c984162b277dce40769d5d41d718","networkInteractionId":1,"receipt":{"blockHash":"0xfdbf86aca83fe33e3e03aaf51d80b09bdd6622da5d10749da766ee25625d6ea3","blockNumber":152512736,"logs":[{"address":"0x0750EdA3185C758247E97819074bCD217a815FaE","data":"0x000000000000000000000000afd60629034fbdc3ef58518b817bbdb4ec861c93","logIndex":0,"topics":["0x937cf566d78d4769ff0211a7d87a6bea51e1fc026fd4d3d8cd589f0e99b983bd","0x88cae14a9889b95b4cfd9472fc7dcbca2da791846a1e314bac9c1f8a234cbf9f"]}],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"HorizonProxies#setContractProxy_GraphPayments","result":{"type":"SUCCESS"},"type":"CALL_EXECUTION_STATE_COMPLETE"} +{"futureId":"HorizonProxies#setContractProxy_HorizonStaking","hash":"0xf25b004bb1859edb4b8779387abf23d9e06c32d7431c18fcb56c334a38917ed5","networkInteractionId":1,"receipt":{"blockHash":"0x5f5506fb47a81d0ee98092f5f27d08579f35f3af69b47e0952cc38a3df819ddb","blockNumber":152512748,"logs":[{"address":"0x0750EdA3185C758247E97819074bCD217a815FaE","data":"0x000000000000000000000000f5d432192daf7e8b045349693577ccf0b5165a12","logIndex":0,"topics":["0x937cf566d78d4769ff0211a7d87a6bea51e1fc026fd4d3d8cd589f0e99b983bd","0x1df41cd916959d1163dc8f0671a666ea8a3e434c13e40faef527133b5d167034"]}],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"HorizonProxies#setContractProxy_HorizonStaking","result":{"type":"SUCCESS"},"type":"CALL_EXECUTION_STATE_COMPLETE"} +{"futureId":"HorizonProxies#setContractProxy_PaymentsEscrow","hash":"0xa097925819a0b2bc01f7bf4475ffb5f7eb80ff681aecbe64dd5500e4e9ef582f","networkInteractionId":1,"receipt":{"blockHash":"0x99aef79c47f60d97ca4655d41bd026db401c743376a677f22fe9193da6e5b9f2","blockNumber":152512759,"logs":[{"address":"0x0750EdA3185C758247E97819074bCD217a815FaE","data":"0x00000000000000000000000070d5afaaaef8f2f095e83d6e6151146c18a5bb85","logIndex":0,"topics":["0x937cf566d78d4769ff0211a7d87a6bea51e1fc026fd4d3d8cd589f0e99b983bd","0x628f67391f8b955553cabfadbf5f1b6a31d2a2d0fea175f5594af9d40b0bedc9"]}],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"HorizonProxies#setContractProxy_PaymentsEscrow","result":{"type":"SUCCESS"},"type":"CALL_EXECUTION_STATE_COMPLETE"} +{"args":["0x450906A976dc21450A7CcD1989D26E137E605B91","0xAA1DeBfb7A7c0Ba85cef858B6E70cFad943Fd4A2","0xcd6dc6870000000000000000000000000750eda3185c758247e97819074bcd217a815fae000000000000000000000000000000000000000000000000000000000000003c"],"artifactId":"GraphProxyAdmin#GraphProxyAdmin","contractAddress":"0x1CEBe1C314Cc454baf4bd553409d957C833623c0","dependencies":["GraphProxyAdmin#GraphProxyAdmin","EpochManager#EpochManager","EpochManager#EpochManager_ProxyWithABI","EpochManager#encodeFunctionCall(EpochManager#EpochManager.initialize)"],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","functionName":"acceptProxyAndCall","futureId":"EpochManager#GraphProxyAdmin~GraphProxyAdmin.acceptProxyAndCall","strategy":"basic","strategyConfig":{},"type":"CALL_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"EpochManager#GraphProxyAdmin~GraphProxyAdmin.acceptProxyAndCall","networkInteraction":{"data":"0x07ebde0e000000000000000000000000450906a976dc21450a7ccd1989d26e137e605b91000000000000000000000000aa1debfb7a7c0ba85cef858b6e70cfad943fd4a200000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044cd6dc6870000000000000000000000000750eda3185c758247e97819074bcd217a815fae000000000000000000000000000000000000000000000000000000000000003c00000000000000000000000000000000000000000000000000000000","id":1,"to":"0x1CEBe1C314Cc454baf4bd553409d957C833623c0","type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"EpochManager#GraphProxyAdmin~GraphProxyAdmin.acceptProxyAndCall","networkInteractionId":1,"nonce":1613,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"EpochManager#GraphProxyAdmin~GraphProxyAdmin.acceptProxyAndCall","networkInteractionId":1,"nonce":1613,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0xdd58762ff54633fe86f5210e47a5cc15701159f3202a40a3ba834536b4b3b4b5"},"type":"TRANSACTION_SEND"} +{"args":["0x9CCD9B656f8A558879974ef2505496eEd7Ef7210","0xe135BFD9E51BbAfCeBb0141af85F0bc6DA1b3BA4","0x4c8c7a440000000000000000000000000750eda3185c758247e97819074bcd217a815fae000000000000000000000000b85d6e91eeaddc35927af34e5e28428282e4bcf200000000000000000000000000000000000000000000000000000000000027100000000000000000000000000000000000000000000000000000000000000001"],"artifactId":"GraphProxyAdmin#GraphProxyAdmin","contractAddress":"0x1CEBe1C314Cc454baf4bd553409d957C833623c0","dependencies":["GraphProxyAdmin#GraphProxyAdmin","L2Curation#L2Curation","L2Curation#L2Curation_ProxyWithABI","L2Curation#encodeFunctionCall(L2Curation#L2Curation.initialize)"],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","functionName":"acceptProxyAndCall","futureId":"L2Curation#GraphProxyAdmin~GraphProxyAdmin.acceptProxyAndCall","strategy":"basic","strategyConfig":{},"type":"CALL_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"L2Curation#GraphProxyAdmin~GraphProxyAdmin.acceptProxyAndCall","networkInteraction":{"data":"0x07ebde0e0000000000000000000000009ccd9b656f8a558879974ef2505496eed7ef7210000000000000000000000000e135bfd9e51bbafcebb0141af85f0bc6da1b3ba4000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000844c8c7a440000000000000000000000000750eda3185c758247e97819074bcd217a815fae000000000000000000000000b85d6e91eeaddc35927af34e5e28428282e4bcf20000000000000000000000000000000000000000000000000000000000002710000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000","id":1,"to":"0x1CEBe1C314Cc454baf4bd553409d957C833623c0","type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"L2Curation#GraphProxyAdmin~GraphProxyAdmin.acceptProxyAndCall","networkInteractionId":1,"nonce":1614,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"L2Curation#GraphProxyAdmin~GraphProxyAdmin.acceptProxyAndCall","networkInteractionId":1,"nonce":1614,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0x975d40cc8ca44f658c2821c7ff94d37d52e882de6b758dbb001c2fe1519fe52d"},"type":"TRANSACTION_SEND"} +{"args":["0x00fe8F95407AB61863d27c07F584A0930ee5F3b0"],"artifactId":"L2Curation#L2Curation_ProxyWithABI","contractAddress":"0xe135BFD9E51BbAfCeBb0141af85F0bc6DA1b3BA4","dependencies":["L2Curation#L2Curation_ProxyWithABI"],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","functionName":"setSubgraphService","futureId":"L2Curation#L2Curation_ProxyWithABI.setSubgraphService","strategy":"basic","strategyConfig":{},"type":"CALL_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"L2Curation#L2Curation_ProxyWithABI.setSubgraphService","networkInteraction":{"data":"0x93a90a1e00000000000000000000000000fe8f95407ab61863d27c07f584a0930ee5f3b0","id":1,"to":"0xe135BFD9E51BbAfCeBb0141af85F0bc6DA1b3BA4","type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"L2Curation#L2Curation_ProxyWithABI.setSubgraphService","networkInteractionId":1,"nonce":1615,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"L2Curation#L2Curation_ProxyWithABI.setSubgraphService","networkInteractionId":1,"nonce":1615,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0x548f87f1f68b83a44cf7c444d85cbc75d47e44f243571b030729c3adb38abd10"},"type":"TRANSACTION_SEND"} +{"args":["0x71927f8Ff0ce294882e2A161A54F62f3b0f3c726","0xBBcb9a575176039C06F94d4d8337818318A26828","0xc4d66de8000000000000000000000000ade6b8eb69a49b56929c1d4f4b428d791861db6f"],"artifactId":"GraphProxyAdmin#GraphProxyAdmin","contractAddress":"0x1CEBe1C314Cc454baf4bd553409d957C833623c0","dependencies":["GraphProxyAdmin#GraphProxyAdmin","L2GraphToken#L2GraphToken","L2GraphToken#L2GraphToken_ProxyWithABI","L2GraphToken#encodeFunctionCall(L2GraphToken#L2GraphToken.initialize)"],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","functionName":"acceptProxyAndCall","futureId":"L2GraphToken#GraphProxyAdmin~GraphProxyAdmin.acceptProxyAndCall","strategy":"basic","strategyConfig":{},"type":"CALL_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"L2GraphToken#GraphProxyAdmin~GraphProxyAdmin.acceptProxyAndCall","networkInteraction":{"data":"0x07ebde0e00000000000000000000000071927f8ff0ce294882e2a161a54f62f3b0f3c726000000000000000000000000bbcb9a575176039c06f94d4d8337818318a2682800000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000024c4d66de8000000000000000000000000ade6b8eb69a49b56929c1d4f4b428d791861db6f00000000000000000000000000000000000000000000000000000000","id":1,"to":"0x1CEBe1C314Cc454baf4bd553409d957C833623c0","type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"L2GraphToken#GraphProxyAdmin~GraphProxyAdmin.acceptProxyAndCall","networkInteractionId":1,"nonce":1616,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"L2GraphToken#GraphProxyAdmin~GraphProxyAdmin.acceptProxyAndCall","networkInteractionId":1,"nonce":1616,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0x902db41fc904c0f0f9eb9e36352f8ea85c4e2ddb65e7405338e64070c3493688"},"type":"TRANSACTION_SEND"} +{"args":["0xade6b8eb69a49b56929c1d4f4b428d791861db6f","10000000000000000000000000000"],"artifactId":"L2GraphToken#L2GraphToken_ProxyWithABI","contractAddress":"0xBBcb9a575176039C06F94d4d8337818318A26828","dependencies":["L2GraphToken#L2GraphToken_ProxyWithABI"],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","functionName":"mint","futureId":"L2GraphToken#L2GraphToken_ProxyWithABI.mint","strategy":"basic","strategyConfig":{},"type":"CALL_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"L2GraphToken#L2GraphToken_ProxyWithABI.mint","networkInteraction":{"data":"0x40c10f19000000000000000000000000ade6b8eb69a49b56929c1d4f4b428d791861db6f0000000000000000000000000000000000000000204fce5e3e25026110000000","id":1,"to":"0xBBcb9a575176039C06F94d4d8337818318A26828","type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"L2GraphToken#L2GraphToken_ProxyWithABI.mint","networkInteractionId":1,"nonce":1617,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"L2GraphToken#L2GraphToken_ProxyWithABI.mint","networkInteractionId":1,"nonce":1617,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0x3c633de8f787b1719a228c23fdb3b831d962d490976a4f0b723720b8803e289f"},"type":"TRANSACTION_SEND"} +{"args":[],"artifactId":"L2GraphToken#L2GraphToken_ProxyWithABI","contractAddress":"0xBBcb9a575176039C06F94d4d8337818318A26828","dependencies":["L2GraphToken#L2GraphToken_ProxyWithABI"],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","functionName":"renounceMinter","futureId":"L2GraphToken#L2GraphToken_ProxyWithABI.renounceMinter","strategy":"basic","strategyConfig":{},"type":"CALL_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"L2GraphToken#L2GraphToken_ProxyWithABI.renounceMinter","networkInteraction":{"data":"0x98650275","id":1,"to":"0xBBcb9a575176039C06F94d4d8337818318A26828","type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"L2GraphToken#L2GraphToken_ProxyWithABI.renounceMinter","networkInteractionId":1,"nonce":1618,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"L2GraphToken#L2GraphToken_ProxyWithABI.renounceMinter","networkInteractionId":1,"nonce":1618,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0xc18bd9f8b47eb70b0c33a9d94b52b1bfc1cc9da4d3d6a091cb338f7f316da0e3"},"type":"TRANSACTION_SEND"} +{"args":["0x4dEA2d1Be05909B71F539FD32601F7bd736c28D4","0x7284213d1cDa80C892a4388f38dA431F06343144","0xc4d66de80000000000000000000000000750eda3185c758247e97819074bcd217a815fae"],"artifactId":"GraphProxyAdmin#GraphProxyAdmin","contractAddress":"0x1CEBe1C314Cc454baf4bd553409d957C833623c0","dependencies":["GraphProxyAdmin#GraphProxyAdmin","L2GraphTokenGateway#L2GraphTokenGateway","L2GraphTokenGateway#L2GraphTokenGateway_ProxyWithABI","L2GraphTokenGateway#encodeFunctionCall(L2GraphTokenGateway#L2GraphTokenGateway.initialize)"],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","functionName":"acceptProxyAndCall","futureId":"L2GraphTokenGateway#GraphProxyAdmin~GraphProxyAdmin.acceptProxyAndCall","strategy":"basic","strategyConfig":{},"type":"CALL_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"L2GraphTokenGateway#GraphProxyAdmin~GraphProxyAdmin.acceptProxyAndCall","networkInteraction":{"data":"0x07ebde0e0000000000000000000000004dea2d1be05909b71f539fd32601f7bd736c28d40000000000000000000000007284213d1cda80c892a4388f38da431f0634314400000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000024c4d66de80000000000000000000000000750eda3185c758247e97819074bcd217a815fae00000000000000000000000000000000000000000000000000000000","id":1,"to":"0x1CEBe1C314Cc454baf4bd553409d957C833623c0","type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"L2GraphTokenGateway#GraphProxyAdmin~GraphProxyAdmin.acceptProxyAndCall","networkInteractionId":1,"nonce":1619,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"L2GraphTokenGateway#GraphProxyAdmin~GraphProxyAdmin.acceptProxyAndCall","networkInteractionId":1,"nonce":1619,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0x77b214ca044f9be44682eeddfcceabe534bc358d9e844ad66e1501558ec7721c"},"type":"TRANSACTION_SEND"} +{"args":["0xE11BA2b4D45Eaed5996Cd0823791E0C93114882d"],"artifactId":"L2GraphTokenGateway#L2GraphTokenGateway_ProxyWithABI","contractAddress":"0x7284213d1cDa80C892a4388f38dA431F06343144","dependencies":["L2GraphTokenGateway#L2GraphTokenGateway_ProxyWithABI"],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","functionName":"setPauseGuardian","futureId":"L2GraphTokenGateway#L2GraphTokenGateway_ProxyWithABI.setPauseGuardian","strategy":"basic","strategyConfig":{},"type":"CALL_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"L2GraphTokenGateway#L2GraphTokenGateway_ProxyWithABI.setPauseGuardian","networkInteraction":{"data":"0x48bde20c000000000000000000000000e11ba2b4d45eaed5996cd0823791e0c93114882d","id":1,"to":"0x7284213d1cDa80C892a4388f38dA431F06343144","type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"L2GraphTokenGateway#L2GraphTokenGateway_ProxyWithABI.setPauseGuardian","networkInteractionId":1,"nonce":1620,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"L2GraphTokenGateway#L2GraphTokenGateway_ProxyWithABI.setPauseGuardian","networkInteractionId":1,"nonce":1620,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0x279ae0ee68fd04dca18f4b103f48bac3298efb89f133da5ee5e3abd2a4d3146e"},"type":"TRANSACTION_SEND"} +{"args":["0x05Ca4d407ec53Ac17ce6Bb414f42663f415Dc5C3","0x1AB05a65fa6D5F6a90A23693D5d40A4D927a815f","0xc4d66de80000000000000000000000000750eda3185c758247e97819074bcd217a815fae"],"artifactId":"GraphProxyAdmin#GraphProxyAdmin","contractAddress":"0x1CEBe1C314Cc454baf4bd553409d957C833623c0","dependencies":["GraphProxyAdmin#GraphProxyAdmin","RewardsManager#RewardsManager","RewardsManager#RewardsManager_ProxyWithABI","RewardsManager#encodeFunctionCall(RewardsManager#RewardsManager.initialize)"],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","functionName":"acceptProxyAndCall","futureId":"RewardsManager#GraphProxyAdmin~GraphProxyAdmin.acceptProxyAndCall","strategy":"basic","strategyConfig":{},"type":"CALL_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"RewardsManager#GraphProxyAdmin~GraphProxyAdmin.acceptProxyAndCall","networkInteraction":{"data":"0x07ebde0e00000000000000000000000005ca4d407ec53ac17ce6bb414f42663f415dc5c30000000000000000000000001ab05a65fa6d5f6a90a23693d5d40a4d927a815f00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000024c4d66de80000000000000000000000000750eda3185c758247e97819074bcd217a815fae00000000000000000000000000000000000000000000000000000000","id":1,"to":"0x1CEBe1C314Cc454baf4bd553409d957C833623c0","type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"RewardsManager#GraphProxyAdmin~GraphProxyAdmin.acceptProxyAndCall","networkInteractionId":1,"nonce":1621,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"RewardsManager#GraphProxyAdmin~GraphProxyAdmin.acceptProxyAndCall","networkInteractionId":1,"nonce":1621,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0x379b4eeb90b8c19389f2500b96afc20cc69075879a9bbf7f072c6e3dbdc3cd3d"},"type":"TRANSACTION_SEND"} +{"args":["114155251141552511415"],"artifactId":"RewardsManager#RewardsManager_ProxyWithABI","contractAddress":"0x1AB05a65fa6D5F6a90A23693D5d40A4D927a815f","dependencies":["RewardsManager#RewardsManager_ProxyWithABI"],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","functionName":"setIssuancePerBlock","futureId":"RewardsManager#RewardsManager_ProxyWithABI.setIssuancePerBlock","strategy":"basic","strategyConfig":{},"type":"CALL_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"RewardsManager#RewardsManager_ProxyWithABI.setIssuancePerBlock","networkInteraction":{"data":"0x1156bdc10000000000000000000000000000000000000000000000063038ec17c1be19b7","id":1,"to":"0x1AB05a65fa6D5F6a90A23693D5d40A4D927a815f","type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"RewardsManager#RewardsManager_ProxyWithABI.setIssuancePerBlock","networkInteractionId":1,"nonce":1622,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"RewardsManager#RewardsManager_ProxyWithABI.setIssuancePerBlock","networkInteractionId":1,"nonce":1622,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0xa861fd40ed78bb34d955b6dbf0d94f765c62c7cd0337fb6a9c307f472df296e5"},"type":"TRANSACTION_SEND"} +{"args":["0xd03ea8624C8C5987235048901fB614fDcA89b117"],"artifactId":"RewardsManager#RewardsManager_ProxyWithABI","contractAddress":"0x1AB05a65fa6D5F6a90A23693D5d40A4D927a815f","dependencies":["RewardsManager#RewardsManager_ProxyWithABI"],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","functionName":"setSubgraphAvailabilityOracle","futureId":"RewardsManager#RewardsManager_ProxyWithABI.setSubgraphAvailabilityOracle","strategy":"basic","strategyConfig":{},"type":"CALL_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"RewardsManager#RewardsManager_ProxyWithABI.setSubgraphAvailabilityOracle","networkInteraction":{"data":"0x0903c094000000000000000000000000d03ea8624c8c5987235048901fb614fdca89b117","id":1,"to":"0x1AB05a65fa6D5F6a90A23693D5d40A4D927a815f","type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"RewardsManager#RewardsManager_ProxyWithABI.setSubgraphAvailabilityOracle","networkInteractionId":1,"nonce":1623,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"RewardsManager#RewardsManager_ProxyWithABI.setSubgraphAvailabilityOracle","networkInteractionId":1,"nonce":1623,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0x7d2ae808e2e2f733315f6663b7fd6871976151a929c590ceda72bf8729d58fa6"},"type":"TRANSACTION_SEND"} +{"args":["0x00fe8F95407AB61863d27c07F584A0930ee5F3b0"],"artifactId":"RewardsManager#RewardsManager_ProxyWithABI","contractAddress":"0x1AB05a65fa6D5F6a90A23693D5d40A4D927a815f","dependencies":["RewardsManager#RewardsManager_ProxyWithABI"],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","functionName":"setSubgraphService","futureId":"RewardsManager#RewardsManager_ProxyWithABI.setSubgraphService","strategy":"basic","strategyConfig":{},"type":"CALL_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"RewardsManager#RewardsManager_ProxyWithABI.setSubgraphService","networkInteraction":{"data":"0x93a90a1e00000000000000000000000000fe8f95407ab61863d27c07f584a0930ee5f3b0","id":1,"to":"0x1AB05a65fa6D5F6a90A23693D5d40A4D927a815f","type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"RewardsManager#RewardsManager_ProxyWithABI.setSubgraphService","networkInteractionId":1,"nonce":1624,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"RewardsManager#RewardsManager_ProxyWithABI.setSubgraphService","networkInteractionId":1,"nonce":1624,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0x73e4b291e4205e0f1919f33f38afcddbc46bda0729fc78948220a98d1fe40a3d"},"type":"TRANSACTION_SEND"} +{"futureId":"EpochManager#GraphProxyAdmin~GraphProxyAdmin.acceptProxyAndCall","hash":"0xdd58762ff54633fe86f5210e47a5cc15701159f3202a40a3ba834536b4b3b4b5","networkInteractionId":1,"receipt":{"blockHash":"0xd7d621b43c81dd507d75cdcd95ebd60780cd8d4f8207d16366ecbbd0042d23fc","blockNumber":152512784,"logs":[{"address":"0xAA1DeBfb7A7c0Ba85cef858B6E70cFad943Fd4A2","data":"0x","logIndex":0,"topics":["0xaa3f731066a578e5f39b4215468d826cdd15373cbc0dfc9cb9bdc649718ef7da","0x0000000000000000000000000000000000000000000000000000000000000000","0x000000000000000000000000450906a976dc21450a7ccd1989d26e137e605b91"]},{"address":"0xAA1DeBfb7A7c0Ba85cef858B6E70cFad943Fd4A2","data":"0x","logIndex":1,"topics":["0x980c0d30fe97457c47903527d88b7009a1643be6de24d2af664214919f0540a1","0x000000000000000000000000450906a976dc21450a7ccd1989d26e137e605b91","0x0000000000000000000000000000000000000000000000000000000000000000"]},{"address":"0xAA1DeBfb7A7c0Ba85cef858B6E70cFad943Fd4A2","data":"0x0000000000000000000000000750eda3185c758247e97819074bcd217a815fae","logIndex":2,"topics":["0x4ff638452bbf33c012645d18ae6f05515ff5f2d1dfb0cece8cbf018c60903f70"]},{"address":"0xAA1DeBfb7A7c0Ba85cef858B6E70cFad943Fd4A2","data":"0x000000000000000000000000000000000000000000000000000000000000003c","logIndex":3,"topics":["0x25ddd6f00038d5eac0051df83c6084f140a01586f092e2728d1ed781c9ce2441","0x0000000000000000000000000000000000000000000000000000000000000001"]}],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"EpochManager#GraphProxyAdmin~GraphProxyAdmin.acceptProxyAndCall","result":{"type":"SUCCESS"},"type":"CALL_EXECUTION_STATE_COMPLETE"} +{"futureId":"L2Curation#GraphProxyAdmin~GraphProxyAdmin.acceptProxyAndCall","hash":"0x975d40cc8ca44f658c2821c7ff94d37d52e882de6b758dbb001c2fe1519fe52d","networkInteractionId":1,"receipt":{"blockHash":"0xcda6eca2b9e900a75db4b68b985b093b505234acd100a6a8a4e48a2b51571c78","blockNumber":152512796,"logs":[{"address":"0xe135BFD9E51BbAfCeBb0141af85F0bc6DA1b3BA4","data":"0x","logIndex":0,"topics":["0xaa3f731066a578e5f39b4215468d826cdd15373cbc0dfc9cb9bdc649718ef7da","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000009ccd9b656f8a558879974ef2505496eed7ef7210"]},{"address":"0xe135BFD9E51BbAfCeBb0141af85F0bc6DA1b3BA4","data":"0x","logIndex":1,"topics":["0x980c0d30fe97457c47903527d88b7009a1643be6de24d2af664214919f0540a1","0x0000000000000000000000009ccd9b656f8a558879974ef2505496eed7ef7210","0x0000000000000000000000000000000000000000000000000000000000000000"]},{"address":"0xe135BFD9E51BbAfCeBb0141af85F0bc6DA1b3BA4","data":"0x0000000000000000000000000750eda3185c758247e97819074bcd217a815fae","logIndex":2,"topics":["0x4ff638452bbf33c012645d18ae6f05515ff5f2d1dfb0cece8cbf018c60903f70"]},{"address":"0xe135BFD9E51BbAfCeBb0141af85F0bc6DA1b3BA4","data":"0x0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000001364656661756c7452657365727665526174696f00000000000000000000000000","logIndex":3,"topics":["0x96d5a4b4edf1cefd0900c166d64447f8da1d01d1861a6a60894b5b82a2c15c3c"]},{"address":"0xe135BFD9E51BbAfCeBb0141af85F0bc6DA1b3BA4","data":"0x000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000156375726174696f6e54617850657263656e746167650000000000000000000000","logIndex":4,"topics":["0x96d5a4b4edf1cefd0900c166d64447f8da1d01d1861a6a60894b5b82a2c15c3c"]},{"address":"0xe135BFD9E51BbAfCeBb0141af85F0bc6DA1b3BA4","data":"0x000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000166d696e696d756d4375726174696f6e4465706f73697400000000000000000000","logIndex":5,"topics":["0x96d5a4b4edf1cefd0900c166d64447f8da1d01d1861a6a60894b5b82a2c15c3c"]},{"address":"0xe135BFD9E51BbAfCeBb0141af85F0bc6DA1b3BA4","data":"0x000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000136375726174696f6e546f6b656e4d617374657200000000000000000000000000","logIndex":6,"topics":["0x96d5a4b4edf1cefd0900c166d64447f8da1d01d1861a6a60894b5b82a2c15c3c"]}],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"L2Curation#GraphProxyAdmin~GraphProxyAdmin.acceptProxyAndCall","result":{"type":"SUCCESS"},"type":"CALL_EXECUTION_STATE_COMPLETE"} +{"futureId":"L2Curation#L2Curation_ProxyWithABI.setSubgraphService","hash":"0x548f87f1f68b83a44cf7c444d85cbc75d47e44f243571b030729c3adb38abd10","networkInteractionId":1,"receipt":{"blockHash":"0xe42326a81201499c7888c38cf1eb816e7c0be8ab7f7de1bc1d062145100f82fb","blockNumber":152512808,"logs":[{"address":"0xe135BFD9E51BbAfCeBb0141af85F0bc6DA1b3BA4","data":"0x","logIndex":0,"topics":["0x81dcb738da3dabd5bb2adbc7dd107fbbfca936e9c8aecab25f5b17a710a784c7","0x00000000000000000000000000fe8f95407ab61863d27c07f584a0930ee5f3b0"]}],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"L2Curation#L2Curation_ProxyWithABI.setSubgraphService","result":{"type":"SUCCESS"},"type":"CALL_EXECUTION_STATE_COMPLETE"} +{"futureId":"L2GraphToken#GraphProxyAdmin~GraphProxyAdmin.acceptProxyAndCall","hash":"0x902db41fc904c0f0f9eb9e36352f8ea85c4e2ddb65e7405338e64070c3493688","networkInteractionId":1,"receipt":{"blockHash":"0x1459912e63cef3db779d451b4818fc24fbd8727943bc9ae94950afc027345fc0","blockNumber":152512823,"logs":[{"address":"0xBBcb9a575176039C06F94d4d8337818318A26828","data":"0x","logIndex":0,"topics":["0xaa3f731066a578e5f39b4215468d826cdd15373cbc0dfc9cb9bdc649718ef7da","0x0000000000000000000000000000000000000000000000000000000000000000","0x00000000000000000000000071927f8ff0ce294882e2a161a54f62f3b0f3c726"]},{"address":"0xBBcb9a575176039C06F94d4d8337818318A26828","data":"0x","logIndex":1,"topics":["0x980c0d30fe97457c47903527d88b7009a1643be6de24d2af664214919f0540a1","0x00000000000000000000000071927f8ff0ce294882e2a161a54f62f3b0f3c726","0x0000000000000000000000000000000000000000000000000000000000000000"]},{"address":"0xBBcb9a575176039C06F94d4d8337818318A26828","data":"0x0000000000000000000000000000000000000000000000000000000000000000","logIndex":2,"topics":["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef","0x0000000000000000000000000000000000000000000000000000000000000000","0x000000000000000000000000ade6b8eb69a49b56929c1d4f4b428d791861db6f"]},{"address":"0xBBcb9a575176039C06F94d4d8337818318A26828","data":"0x","logIndex":3,"topics":["0x6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f6","0x000000000000000000000000ade6b8eb69a49b56929c1d4f4b428d791861db6f"]}],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"L2GraphToken#GraphProxyAdmin~GraphProxyAdmin.acceptProxyAndCall","result":{"type":"SUCCESS"},"type":"CALL_EXECUTION_STATE_COMPLETE"} +{"futureId":"L2GraphToken#L2GraphToken_ProxyWithABI.mint","hash":"0x3c633de8f787b1719a228c23fdb3b831d962d490976a4f0b723720b8803e289f","networkInteractionId":1,"receipt":{"blockHash":"0xf339d4e764a193b69123096f1f2e3205d278225f18e88b7499e9fe656006ea26","blockNumber":152512834,"logs":[{"address":"0xBBcb9a575176039C06F94d4d8337818318A26828","data":"0x0000000000000000000000000000000000000000204fce5e3e25026110000000","logIndex":0,"topics":["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef","0x0000000000000000000000000000000000000000000000000000000000000000","0x000000000000000000000000ade6b8eb69a49b56929c1d4f4b428d791861db6f"]}],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"L2GraphToken#L2GraphToken_ProxyWithABI.mint","result":{"type":"SUCCESS"},"type":"CALL_EXECUTION_STATE_COMPLETE"} +{"futureId":"L2GraphToken#L2GraphToken_ProxyWithABI.renounceMinter","hash":"0xc18bd9f8b47eb70b0c33a9d94b52b1bfc1cc9da4d3d6a091cb338f7f316da0e3","networkInteractionId":1,"receipt":{"blockHash":"0x6e64dd677d1d1abe493ef0bd67630772b160318df8649ce18dc5ca7f4ba869a9","blockNumber":152512845,"logs":[{"address":"0xBBcb9a575176039C06F94d4d8337818318A26828","data":"0x","logIndex":3,"topics":["0xe94479a9f7e1952cc78f2d6baab678adc1b772d936c6583def489e524cb66692","0x000000000000000000000000ade6b8eb69a49b56929c1d4f4b428d791861db6f"]}],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"L2GraphToken#L2GraphToken_ProxyWithABI.renounceMinter","result":{"type":"SUCCESS"},"type":"CALL_EXECUTION_STATE_COMPLETE"} +{"futureId":"L2GraphTokenGateway#GraphProxyAdmin~GraphProxyAdmin.acceptProxyAndCall","hash":"0x77b214ca044f9be44682eeddfcceabe534bc358d9e844ad66e1501558ec7721c","networkInteractionId":1,"receipt":{"blockHash":"0x7192dec2029a3e6681419f3058d3e49cb42646f81987986783f68109de5938ba","blockNumber":152512856,"logs":[{"address":"0x7284213d1cDa80C892a4388f38dA431F06343144","data":"0x","logIndex":0,"topics":["0xaa3f731066a578e5f39b4215468d826cdd15373cbc0dfc9cb9bdc649718ef7da","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000004dea2d1be05909b71f539fd32601f7bd736c28d4"]},{"address":"0x7284213d1cDa80C892a4388f38dA431F06343144","data":"0x","logIndex":1,"topics":["0x980c0d30fe97457c47903527d88b7009a1643be6de24d2af664214919f0540a1","0x0000000000000000000000004dea2d1be05909b71f539fd32601f7bd736c28d4","0x0000000000000000000000000000000000000000000000000000000000000000"]},{"address":"0x7284213d1cDa80C892a4388f38dA431F06343144","data":"0x0000000000000000000000000750eda3185c758247e97819074bcd217a815fae","logIndex":2,"topics":["0x4ff638452bbf33c012645d18ae6f05515ff5f2d1dfb0cece8cbf018c60903f70"]}],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"L2GraphTokenGateway#GraphProxyAdmin~GraphProxyAdmin.acceptProxyAndCall","result":{"type":"SUCCESS"},"type":"CALL_EXECUTION_STATE_COMPLETE"} +{"futureId":"L2GraphTokenGateway#L2GraphTokenGateway_ProxyWithABI.setPauseGuardian","hash":"0x279ae0ee68fd04dca18f4b103f48bac3298efb89f133da5ee5e3abd2a4d3146e","networkInteractionId":1,"receipt":{"blockHash":"0x9bc544feb180827e82dd9be55d05d9dd0dc3187be996089ee44d34572b8608b7","blockNumber":152512866,"logs":[{"address":"0x7284213d1cDa80C892a4388f38dA431F06343144","data":"0x","logIndex":2,"topics":["0x0613b6ee6a04f0d09f390e4d9318894b9f6ac7fd83897cd8d18896ba579c401e","0x0000000000000000000000000000000000000000000000000000000000000000","0x000000000000000000000000e11ba2b4d45eaed5996cd0823791e0c93114882d"]}],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"L2GraphTokenGateway#L2GraphTokenGateway_ProxyWithABI.setPauseGuardian","result":{"type":"SUCCESS"},"type":"CALL_EXECUTION_STATE_COMPLETE"} +{"futureId":"RewardsManager#GraphProxyAdmin~GraphProxyAdmin.acceptProxyAndCall","hash":"0x379b4eeb90b8c19389f2500b96afc20cc69075879a9bbf7f072c6e3dbdc3cd3d","networkInteractionId":1,"receipt":{"blockHash":"0x73297d07c33ef096410dc362cc7ba59e2d6130642c66ddd7bcc1b61751786785","blockNumber":152512878,"logs":[{"address":"0x1AB05a65fa6D5F6a90A23693D5d40A4D927a815f","data":"0x","logIndex":0,"topics":["0xaa3f731066a578e5f39b4215468d826cdd15373cbc0dfc9cb9bdc649718ef7da","0x0000000000000000000000000000000000000000000000000000000000000000","0x00000000000000000000000005ca4d407ec53ac17ce6bb414f42663f415dc5c3"]},{"address":"0x1AB05a65fa6D5F6a90A23693D5d40A4D927a815f","data":"0x","logIndex":1,"topics":["0x980c0d30fe97457c47903527d88b7009a1643be6de24d2af664214919f0540a1","0x00000000000000000000000005ca4d407ec53ac17ce6bb414f42663f415dc5c3","0x0000000000000000000000000000000000000000000000000000000000000000"]},{"address":"0x1AB05a65fa6D5F6a90A23693D5d40A4D927a815f","data":"0x0000000000000000000000000750eda3185c758247e97819074bcd217a815fae","logIndex":2,"topics":["0x4ff638452bbf33c012645d18ae6f05515ff5f2d1dfb0cece8cbf018c60903f70"]}],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"RewardsManager#GraphProxyAdmin~GraphProxyAdmin.acceptProxyAndCall","result":{"type":"SUCCESS"},"type":"CALL_EXECUTION_STATE_COMPLETE"} +{"futureId":"RewardsManager#RewardsManager_ProxyWithABI.setIssuancePerBlock","hash":"0xa861fd40ed78bb34d955b6dbf0d94f765c62c7cd0337fb6a9c307f472df296e5","networkInteractionId":1,"receipt":{"blockHash":"0xa7f6f97630c1cc670ed892e835646cb0087431cfd670bfad40515c98d8a903cc","blockNumber":152512890,"logs":[{"address":"0x1AB05a65fa6D5F6a90A23693D5d40A4D927a815f","data":"0x0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000001069737375616e6365506572426c6f636b00000000000000000000000000000000","logIndex":0,"topics":["0x96d5a4b4edf1cefd0900c166d64447f8da1d01d1861a6a60894b5b82a2c15c3c"]}],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"RewardsManager#RewardsManager_ProxyWithABI.setIssuancePerBlock","result":{"type":"SUCCESS"},"type":"CALL_EXECUTION_STATE_COMPLETE"} +{"futureId":"RewardsManager#RewardsManager_ProxyWithABI.setSubgraphAvailabilityOracle","hash":"0x7d2ae808e2e2f733315f6663b7fd6871976151a929c590ceda72bf8729d58fa6","networkInteractionId":1,"receipt":{"blockHash":"0xb7ac1df06a063c3ea5cfc4d110c1e1901744e1dad9c3c3ee8f239bd2b609916d","blockNumber":152512901,"logs":[{"address":"0x1AB05a65fa6D5F6a90A23693D5d40A4D927a815f","data":"0x0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000001a7375626772617068417661696c6162696c6974794f7261636c65000000000000","logIndex":0,"topics":["0x96d5a4b4edf1cefd0900c166d64447f8da1d01d1861a6a60894b5b82a2c15c3c"]}],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"RewardsManager#RewardsManager_ProxyWithABI.setSubgraphAvailabilityOracle","result":{"type":"SUCCESS"},"type":"CALL_EXECUTION_STATE_COMPLETE"} +{"futureId":"RewardsManager#RewardsManager_ProxyWithABI.setSubgraphService","hash":"0x73e4b291e4205e0f1919f33f38afcddbc46bda0729fc78948220a98d1fe40a3d","networkInteractionId":1,"receipt":{"blockHash":"0x04457f9baf9992df6be674a1708b6e739ab252003e8f71f661511d3842d82c65","blockNumber":152512912,"logs":[{"address":"0x1AB05a65fa6D5F6a90A23693D5d40A4D927a815f","data":"0x","logIndex":1,"topics":["0x97befc0afcf2bace352f077aea9873c9552fc2e5ab26874f356006fdf9da4ede","0x0000000000000000000000000000000000000000000000000000000000000000","0x00000000000000000000000000fe8f95407ab61863d27c07f584a0930ee5f3b0"]}],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"RewardsManager#RewardsManager_ProxyWithABI.setSubgraphService","result":{"type":"SUCCESS"},"type":"CALL_EXECUTION_STATE_COMPLETE"} +{"args":["0xc713c3df6d14cdf946460395d09af88993ee2b948b1a808161494e32c5f67063","0xAA1DeBfb7A7c0Ba85cef858B6E70cFad943Fd4A2"],"artifactId":"Controller#Controller","contractAddress":"0x0750EdA3185C758247E97819074bCD217a815FaE","dependencies":["Controller#Controller","EpochManager#EpochManager_ProxyWithABI"],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","functionName":"setContractProxy","futureId":"GraphHorizon_Periphery#setContractProxy_EpochManager","strategy":"basic","strategyConfig":{},"type":"CALL_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"GraphHorizon_Periphery#setContractProxy_EpochManager","networkInteraction":{"data":"0xe0e99292c713c3df6d14cdf946460395d09af88993ee2b948b1a808161494e32c5f67063000000000000000000000000aa1debfb7a7c0ba85cef858b6e70cfad943fd4a2","id":1,"to":"0x0750EdA3185C758247E97819074bCD217a815FaE","type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"GraphHorizon_Periphery#setContractProxy_EpochManager","networkInteractionId":1,"nonce":1625,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"GraphHorizon_Periphery#setContractProxy_EpochManager","networkInteractionId":1,"nonce":1625,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0xcceaf7a13959231dd82800493ff9e55448d5dcfc80a6910b157ec6ef3bd74252"},"type":"TRANSACTION_SEND"} +{"args":["0xd362cac9cb75c10d67bcc0b7eeb0b1ef48bb5420b556c092d4fd7f758816fcf0","0x7284213d1cDa80C892a4388f38dA431F06343144"],"artifactId":"Controller#Controller","contractAddress":"0x0750EdA3185C758247E97819074bCD217a815FaE","dependencies":["Controller#Controller","L2GraphTokenGateway#L2GraphTokenGateway_ProxyWithABI"],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","functionName":"setContractProxy","futureId":"GraphHorizon_Periphery#setContractProxy_GraphTokenGateway","strategy":"basic","strategyConfig":{},"type":"CALL_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"GraphHorizon_Periphery#setContractProxy_GraphTokenGateway","networkInteraction":{"data":"0xe0e99292d362cac9cb75c10d67bcc0b7eeb0b1ef48bb5420b556c092d4fd7f758816fcf00000000000000000000000007284213d1cda80c892a4388f38da431f06343144","id":1,"to":"0x0750EdA3185C758247E97819074bCD217a815FaE","type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"GraphHorizon_Periphery#setContractProxy_GraphTokenGateway","networkInteractionId":1,"nonce":1626,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"GraphHorizon_Periphery#setContractProxy_GraphTokenGateway","networkInteractionId":1,"nonce":1626,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0xe2278b46402583ab47879f8e6ce4792d1870875f1e7e1763bb6daa084686d5b6"},"type":"TRANSACTION_SEND"} +{"args":["0xe6876326c1291dfcbbd3864a6816d698cd591defc7aa2153d7f9c4c04016c89f","0xe135BFD9E51BbAfCeBb0141af85F0bc6DA1b3BA4"],"artifactId":"Controller#Controller","contractAddress":"0x0750EdA3185C758247E97819074bCD217a815FaE","dependencies":["Controller#Controller","L2Curation#L2Curation_ProxyWithABI"],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","functionName":"setContractProxy","futureId":"GraphHorizon_Periphery#setContractProxy_L2Curation","strategy":"basic","strategyConfig":{},"type":"CALL_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"GraphHorizon_Periphery#setContractProxy_L2Curation","networkInteraction":{"data":"0xe0e99292e6876326c1291dfcbbd3864a6816d698cd591defc7aa2153d7f9c4c04016c89f000000000000000000000000e135bfd9e51bbafcebb0141af85f0bc6da1b3ba4","id":1,"to":"0x0750EdA3185C758247E97819074bCD217a815FaE","type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"GraphHorizon_Periphery#setContractProxy_L2Curation","networkInteractionId":1,"nonce":1627,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"GraphHorizon_Periphery#setContractProxy_L2Curation","networkInteractionId":1,"nonce":1627,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0x7c2633e202405c8ead9767e864d0a3c1ad681f2f31bcb742baddc8fd07c63576"},"type":"TRANSACTION_SEND"} +{"args":["0x966f1e8d8d8014e05f6ec4a57138da9be1f7c5a7f802928a18072f7c53180761","0x1AB05a65fa6D5F6a90A23693D5d40A4D927a815f"],"artifactId":"Controller#Controller","contractAddress":"0x0750EdA3185C758247E97819074bCD217a815FaE","dependencies":["Controller#Controller","RewardsManager#RewardsManager_ProxyWithABI"],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","functionName":"setContractProxy","futureId":"GraphHorizon_Periphery#setContractProxy_RewardsManager","strategy":"basic","strategyConfig":{},"type":"CALL_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"GraphHorizon_Periphery#setContractProxy_RewardsManager","networkInteraction":{"data":"0xe0e99292966f1e8d8d8014e05f6ec4a57138da9be1f7c5a7f802928a18072f7c531807610000000000000000000000001ab05a65fa6d5f6a90a23693d5d40a4d927a815f","id":1,"to":"0x0750EdA3185C758247E97819074bCD217a815FaE","type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"GraphHorizon_Periphery#setContractProxy_RewardsManager","networkInteractionId":1,"nonce":1628,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"GraphHorizon_Periphery#setContractProxy_RewardsManager","networkInteractionId":1,"nonce":1628,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0x594c062c3709f602c12b0675783415c1fa1329a2f6a9465b0a3959f320556e4a"},"type":"TRANSACTION_SEND"} +{"args":["0x7284213d1cDa80C892a4388f38dA431F06343144"],"artifactId":"L2GraphToken#L2GraphToken_ProxyWithABI","contractAddress":"0xBBcb9a575176039C06F94d4d8337818318A26828","dependencies":["L2GraphToken#L2GraphToken_ProxyWithABI","L2GraphTokenGateway#L2GraphTokenGateway_ProxyWithABI"],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","functionName":"addMinter","futureId":"L2GraphToken#addMinterGateway","strategy":"basic","strategyConfig":{},"type":"CALL_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"L2GraphToken#addMinterGateway","networkInteraction":{"data":"0x983b2d560000000000000000000000007284213d1cda80c892a4388f38da431f06343144","id":1,"to":"0xBBcb9a575176039C06F94d4d8337818318A26828","type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"L2GraphToken#addMinterGateway","networkInteractionId":1,"nonce":1629,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"L2GraphToken#addMinterGateway","networkInteractionId":1,"nonce":1629,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0x3c3a015c769fc058b03e59e926cb8277bde3e20cecc17750e784cdcdfdaeee34"},"type":"TRANSACTION_SEND"} +{"args":["0x1AB05a65fa6D5F6a90A23693D5d40A4D927a815f"],"artifactId":"L2GraphToken#L2GraphToken_ProxyWithABI","contractAddress":"0xBBcb9a575176039C06F94d4d8337818318A26828","dependencies":["L2GraphToken#L2GraphToken_ProxyWithABI","RewardsManager#RewardsManager_ProxyWithABI"],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","functionName":"addMinter","futureId":"L2GraphToken#addMinterRewardsManager","strategy":"basic","strategyConfig":{},"type":"CALL_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"L2GraphToken#addMinterRewardsManager","networkInteraction":{"data":"0x983b2d560000000000000000000000001ab05a65fa6d5f6a90a23693d5d40a4d927a815f","id":1,"to":"0xBBcb9a575176039C06F94d4d8337818318A26828","type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"L2GraphToken#addMinterRewardsManager","networkInteractionId":1,"nonce":1630,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"L2GraphToken#addMinterRewardsManager","networkInteractionId":1,"nonce":1630,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0x411b24d17504062d4467f4ae9668f2dfd779d15e74c8db0c19ce7818ca3c0a57"},"type":"TRANSACTION_SEND"} +{"futureId":"GraphHorizon_Periphery#setContractProxy_EpochManager","hash":"0xcceaf7a13959231dd82800493ff9e55448d5dcfc80a6910b157ec6ef3bd74252","networkInteractionId":1,"receipt":{"blockHash":"0x90c2d165807a178540aad5ba743d420014779a3fa5e310db871fb1e7db759f13","blockNumber":152512959,"logs":[{"address":"0x0750EdA3185C758247E97819074bCD217a815FaE","data":"0x000000000000000000000000aa1debfb7a7c0ba85cef858b6e70cfad943fd4a2","logIndex":0,"topics":["0x937cf566d78d4769ff0211a7d87a6bea51e1fc026fd4d3d8cd589f0e99b983bd","0xc713c3df6d14cdf946460395d09af88993ee2b948b1a808161494e32c5f67063"]}],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"GraphHorizon_Periphery#setContractProxy_EpochManager","result":{"type":"SUCCESS"},"type":"CALL_EXECUTION_STATE_COMPLETE"} +{"futureId":"GraphHorizon_Periphery#setContractProxy_GraphTokenGateway","hash":"0xe2278b46402583ab47879f8e6ce4792d1870875f1e7e1763bb6daa084686d5b6","networkInteractionId":1,"receipt":{"blockHash":"0x7a5e50263d3b2f3ca0d031ecccb762e14ef7aca0c3e9967d8ec824c41594cff1","blockNumber":152512972,"logs":[{"address":"0x0750EdA3185C758247E97819074bCD217a815FaE","data":"0x0000000000000000000000007284213d1cda80c892a4388f38da431f06343144","logIndex":0,"topics":["0x937cf566d78d4769ff0211a7d87a6bea51e1fc026fd4d3d8cd589f0e99b983bd","0xd362cac9cb75c10d67bcc0b7eeb0b1ef48bb5420b556c092d4fd7f758816fcf0"]}],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"GraphHorizon_Periphery#setContractProxy_GraphTokenGateway","result":{"type":"SUCCESS"},"type":"CALL_EXECUTION_STATE_COMPLETE"} +{"futureId":"GraphHorizon_Periphery#setContractProxy_L2Curation","hash":"0x7c2633e202405c8ead9767e864d0a3c1ad681f2f31bcb742baddc8fd07c63576","networkInteractionId":1,"receipt":{"blockHash":"0x88eca31bf2f7abda8d7e2e4b697885d2758deee895f6ca80b4a77d6d91d15320","blockNumber":152512983,"logs":[{"address":"0x0750EdA3185C758247E97819074bCD217a815FaE","data":"0x000000000000000000000000e135bfd9e51bbafcebb0141af85f0bc6da1b3ba4","logIndex":0,"topics":["0x937cf566d78d4769ff0211a7d87a6bea51e1fc026fd4d3d8cd589f0e99b983bd","0xe6876326c1291dfcbbd3864a6816d698cd591defc7aa2153d7f9c4c04016c89f"]}],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"GraphHorizon_Periphery#setContractProxy_L2Curation","result":{"type":"SUCCESS"},"type":"CALL_EXECUTION_STATE_COMPLETE"} +{"futureId":"GraphHorizon_Periphery#setContractProxy_RewardsManager","hash":"0x594c062c3709f602c12b0675783415c1fa1329a2f6a9465b0a3959f320556e4a","networkInteractionId":1,"receipt":{"blockHash":"0x1791408fc0bfb9e8ee6fd5acd8fe50524348be504e606122e356610f25a7b95c","blockNumber":152512994,"logs":[{"address":"0x0750EdA3185C758247E97819074bCD217a815FaE","data":"0x0000000000000000000000001ab05a65fa6d5f6a90a23693d5d40a4d927a815f","logIndex":0,"topics":["0x937cf566d78d4769ff0211a7d87a6bea51e1fc026fd4d3d8cd589f0e99b983bd","0x966f1e8d8d8014e05f6ec4a57138da9be1f7c5a7f802928a18072f7c53180761"]}],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"GraphHorizon_Periphery#setContractProxy_RewardsManager","result":{"type":"SUCCESS"},"type":"CALL_EXECUTION_STATE_COMPLETE"} +{"futureId":"L2GraphToken#addMinterGateway","hash":"0x3c3a015c769fc058b03e59e926cb8277bde3e20cecc17750e784cdcdfdaeee34","networkInteractionId":1,"receipt":{"blockHash":"0x9703201f7fcc397f97e2be4c2f154319b2054c49221e9517c0c6dc1d243229d1","blockNumber":152513005,"logs":[{"address":"0xBBcb9a575176039C06F94d4d8337818318A26828","data":"0x","logIndex":0,"topics":["0x6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f6","0x0000000000000000000000007284213d1cda80c892a4388f38da431f06343144"]}],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"L2GraphToken#addMinterGateway","result":{"type":"SUCCESS"},"type":"CALL_EXECUTION_STATE_COMPLETE"} +{"futureId":"L2GraphToken#addMinterRewardsManager","hash":"0x411b24d17504062d4467f4ae9668f2dfd779d15e74c8db0c19ce7818ca3c0a57","networkInteractionId":1,"receipt":{"blockHash":"0x03819e257131ef6d3bfca369b9d2905c5663d063486ce54fde12afd28e943807","blockNumber":152513016,"logs":[{"address":"0xBBcb9a575176039C06F94d4d8337818318A26828","data":"0x","logIndex":4,"topics":["0x6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f6","0x0000000000000000000000001ab05a65fa6d5f6a90a23693d5d40a4d927a815f"]}],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"L2GraphToken#addMinterRewardsManager","result":{"type":"SUCCESS"},"type":"CALL_EXECUTION_STATE_COMPLETE"} +{"args":["0xad834c286a9b590f8264c8d9574fafcbbbe90b3b"],"artifactId":"L2GraphToken#L2GraphToken_ProxyWithABI","contractAddress":"0xBBcb9a575176039C06F94d4d8337818318A26828","dependencies":["L2GraphToken#L2GraphToken_ProxyWithABI","L2GraphToken#L2GraphToken_ProxyWithABI.mint","L2GraphToken#L2GraphToken_ProxyWithABI.renounceMinter","L2GraphToken#addMinterRewardsManager","L2GraphToken#addMinterGateway"],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","functionName":"transferOwnership","futureId":"L2GraphToken#L2GraphToken_ProxyWithABI.transferOwnership","strategy":"basic","strategyConfig":{},"type":"CALL_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"L2GraphToken#L2GraphToken_ProxyWithABI.transferOwnership","networkInteraction":{"data":"0xf2fde38b000000000000000000000000ad834c286a9b590f8264c8d9574fafcbbbe90b3b","id":1,"to":"0xBBcb9a575176039C06F94d4d8337818318A26828","type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"L2GraphToken#L2GraphToken_ProxyWithABI.transferOwnership","networkInteractionId":1,"nonce":1631,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"L2GraphToken#L2GraphToken_ProxyWithABI.transferOwnership","networkInteractionId":1,"nonce":1631,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0xd486ca6c48e7390de0c0ab47f4c0dbcc1913258b3e35707a1c92952a870f7d2c"},"type":"TRANSACTION_SEND"} +{"futureId":"L2GraphToken#L2GraphToken_ProxyWithABI.transferOwnership","hash":"0xd486ca6c48e7390de0c0ab47f4c0dbcc1913258b3e35707a1c92952a870f7d2c","networkInteractionId":1,"receipt":{"blockHash":"0xcd6257c94b366b8d66ed63ce066215e73946366388689eecb53b7f3d0339c2ac","blockNumber":152513049,"logs":[{"address":"0xBBcb9a575176039C06F94d4d8337818318A26828","data":"0x","logIndex":0,"topics":["0x76563ad561b7036ae716b9b25cb521b21463240f104c97e12f25877f2235f33d","0x0000000000000000000000000000000000000000000000000000000000000000","0x000000000000000000000000ad834c286a9b590f8264c8d9574fafcbbbe90b3b"]}],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"L2GraphToken#L2GraphToken_ProxyWithABI.transferOwnership","result":{"type":"SUCCESS"},"type":"CALL_EXECUTION_STATE_COMPLETE"} +{"args":[],"artifactId":"L2GraphToken#L2GraphToken_ProxyWithABI","contractAddress":"0xBBcb9a575176039C06F94d4d8337818318A26828","dependencies":["L2GraphToken#L2GraphToken_ProxyWithABI","L2GraphToken#L2GraphToken_ProxyWithABI.transferOwnership"],"from":"0xad834c286a9b590f8264c8d9574fafcbbbe90b3b","functionName":"acceptOwnership","futureId":"L2GraphToken#L2GraphToken_ProxyWithABI.acceptOwnership","strategy":"basic","strategyConfig":{},"type":"CALL_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"L2GraphToken#L2GraphToken_ProxyWithABI.acceptOwnership","networkInteraction":{"data":"0x79ba5097","id":1,"to":"0xBBcb9a575176039C06F94d4d8337818318A26828","type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"L2GraphToken#L2GraphToken_ProxyWithABI.acceptOwnership","networkInteractionId":1,"nonce":15,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"L2GraphToken#L2GraphToken_ProxyWithABI.acceptOwnership","networkInteractionId":1,"nonce":15,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0x36aef871e6580d62bc8004c43b97fb5ce6a38c42289c90804727369e1743aaaa"},"type":"TRANSACTION_SEND"} +{"futureId":"L2GraphToken#L2GraphToken_ProxyWithABI.acceptOwnership","hash":"0x36aef871e6580d62bc8004c43b97fb5ce6a38c42289c90804727369e1743aaaa","networkInteractionId":1,"receipt":{"blockHash":"0xbff0647b4e6cce2ce39a5970aa86cd36b72bb99997db208f80363ee13ba8b06c","blockNumber":152513069,"logs":[{"address":"0xBBcb9a575176039C06F94d4d8337818318A26828","data":"0x","logIndex":3,"topics":["0x0ac6deed30eef60090c749850e10f2fa469e3e25fec1d1bef2853003f6e6f18f","0x000000000000000000000000ade6b8eb69a49b56929c1d4f4b428d791861db6f","0x000000000000000000000000ad834c286a9b590f8264c8d9574fafcbbbe90b3b"]},{"address":"0xBBcb9a575176039C06F94d4d8337818318A26828","data":"0x","logIndex":4,"topics":["0x76563ad561b7036ae716b9b25cb521b21463240f104c97e12f25877f2235f33d","0x000000000000000000000000ad834c286a9b590f8264c8d9574fafcbbbe90b3b","0x0000000000000000000000000000000000000000000000000000000000000000"]}],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"L2GraphToken#L2GraphToken_ProxyWithABI.acceptOwnership","result":{"type":"SUCCESS"},"type":"CALL_EXECUTION_STATE_COMPLETE"} +{"args":["0x45fc200c7e4544e457d3c5709bfe0d520442c30bbcbdaede89e8d4a4bbc19247","0xBBcb9a575176039C06F94d4d8337818318A26828"],"artifactId":"Controller#Controller","contractAddress":"0x0750EdA3185C758247E97819074bCD217a815FaE","dependencies":["Controller#Controller","L2GraphToken#L2GraphToken_ProxyWithABI"],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","functionName":"setContractProxy","futureId":"GraphHorizon_Periphery#setContractProxy_GraphToken","strategy":"basic","strategyConfig":{},"type":"CALL_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"GraphHorizon_Periphery#setContractProxy_GraphToken","networkInteraction":{"data":"0xe0e9929245fc200c7e4544e457d3c5709bfe0d520442c30bbcbdaede89e8d4a4bbc19247000000000000000000000000bbcb9a575176039c06f94d4d8337818318a26828","id":1,"to":"0x0750EdA3185C758247E97819074bCD217a815FaE","type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"GraphHorizon_Periphery#setContractProxy_GraphToken","networkInteractionId":1,"nonce":1632,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"GraphHorizon_Periphery#setContractProxy_GraphToken","networkInteractionId":1,"nonce":1632,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0x44bbdc20ffb8be014f38b5ee30273e609e1a7ae991253bc16ccf7d43447a5363"},"type":"TRANSACTION_SEND"} +{"futureId":"GraphHorizon_Periphery#setContractProxy_GraphToken","hash":"0x44bbdc20ffb8be014f38b5ee30273e609e1a7ae991253bc16ccf7d43447a5363","networkInteractionId":1,"receipt":{"blockHash":"0x952e76d13857ba426cc7d9a9877a2a35900339743e55fe8f14dad9c3c9651ff3","blockNumber":152513090,"logs":[{"address":"0x0750EdA3185C758247E97819074bCD217a815FaE","data":"0x000000000000000000000000bbcb9a575176039c06f94d4d8337818318a26828","logIndex":0,"topics":["0x937cf566d78d4769ff0211a7d87a6bea51e1fc026fd4d3d8cd589f0e99b983bd","0x45fc200c7e4544e457d3c5709bfe0d520442c30bbcbdaede89e8d4a4bbc19247"]}],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"GraphHorizon_Periphery#setContractProxy_GraphToken","result":{"type":"SUCCESS"},"type":"CALL_EXECUTION_STATE_COMPLETE"} +{"artifactId":"GraphPayments#GraphPayments","constructorArgs":["0x0750EdA3185C758247E97819074bCD217a815FaE",10000],"contractName":"GraphPayments","dependencies":["Controller#Controller","GraphHorizon_Periphery","HorizonProxies"],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","futureId":"GraphPayments#GraphPayments","futureType":"CONTRACT_DEPLOYMENT","libraries":{},"strategy":"basic","strategyConfig":{},"type":"DEPLOYMENT_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"GraphPayments#GraphPayments","networkInteraction":{"data":"0x6101e060405234801561001157600080fd5b50604051611552380380611552833981016040819052610030916104ee565b816001600160a01b03811661007a5760405163218f5add60e11b815260206004820152600a60248201526921b7b73a3937b63632b960b11b60448201526064015b60405180910390fd5b6001600160a01b0381166101005260408051808201909152600a81526923b930b8342a37b5b2b760b11b60208201526100b290610372565b6001600160a01b03166080526040805180820190915260078152665374616b696e6760c81b60208201526100e590610372565b6001600160a01b031660a05260408051808201909152600d81526c47726170685061796d656e747360981b602082015261011e90610372565b6001600160a01b031660c05260408051808201909152600e81526d5061796d656e7473457363726f7760901b602082015261015890610372565b6001600160a01b031660e05260408051808201909152600c81526b22b837b1b426b0b730b3b2b960a11b602082015261019090610372565b6001600160a01b03166101205260408051808201909152600e81526d2932bbb0b93239a6b0b730b3b2b960911b60208201526101cb90610372565b6001600160a01b0316610140526040805180820190915260118152704772617068546f6b656e4761746577617960781b602082015261020990610372565b6001600160a01b03166101605260408051808201909152600f81526e23b930b834283937bc3ca0b236b4b760891b602082015261024590610372565b6001600160a01b03166101805260408051808201909152600881526721bab930ba34b7b760c11b602082015261027a90610372565b6001600160a01b039081166101a08190526101005160a05160805160c05160e05161012051610140516101605161018051604051988b169a9788169996909716977fef5021414834d86e36470f5c1cecf6544fb2bb723f2ca51a4c86fcd8c5919a43976103249790916001600160a01b03978816815295871660208701529386166040860152918516606085015284166080840152831660a083015290911660c082015260e00190565b60405180910390a45061033a81620f4240101590565b819061035c576040516339b762e560e21b815260040161007191815260200190565b506101c081905261036b610420565b505061058a565b600080610100516001600160a01b031663f7641a5e84805190602001206040518263ffffffff1660e01b81526004016103ad91815260200190565b602060405180830381865afa1580156103ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103ee919061051a565b9050826001600160a01b0382166104195760405163218f5add60e11b8152600401610071919061053c565b5092915050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff16156104705760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b03908116146104cf5780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b80516001600160a01b03811681146104e957600080fd5b919050565b6000806040838503121561050157600080fd5b61050a836104d2565b9150602083015190509250929050565b60006020828403121561052c57600080fd5b610535826104d2565b9392505050565b602081526000825180602084015260005b8181101561056a576020818601810151604086840101520161054d565b506000604082850101526040601f19601f83011684010191505092915050565b60805160a05160c05160e05161010051610120516101405161016051610180516101a0516101c051610f546105fe600039600081816056015261021f0152600050506000505060005050600050506000505060005050600050506000505060006108b20152600061077f0152610f546000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c80631d526e50146100515780638129fc1c1461008b57806381cd11a014610095578063ac9650d8146100a8575b600080fd5b6100787f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b6100936100c8565b005b6100936100a3366004610b2a565b6101c0565b6100bb6100b6366004610b96565b610662565b6040516100829190610c2f565b60006100d261074a565b805490915060ff600160401b82041615906001600160401b03166000811580156100f95750825b90506000826001600160401b031660011480156101155750303b155b905081158015610123575080155b156101415760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff19166001178555831561016b57845460ff60401b1916600160401b1785555b610173610773565b83156101b957845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b5050505050565b6101cd82620f4240101590565b82906101f8576040516339b762e560e21b81526004016101ef91815260200190565b60405180910390fd5b50610216338561020661077d565b6001600160a01b031691906107a1565b836000610243827f0000000000000000000000000000000000000000000000000000000000000000610857565b905061024f8183610cc5565b9150600061025d8386610857565b90506102698184610cc5565b92506000806102766108b0565b604051631584a17960e21b81526001600160a01b038c811660048301528a81166024830152919091169063561285e49060440160a060405180830381865afa1580156102c6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102ea9190610cee565b602081015190915015610388576103796103026108b0565b6001600160a01b0316637573ef4f8c8b8f6040518463ffffffff1660e01b815260040161033193929190610d83565b602060405180830381865afa15801561034e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103729190610dc7565b8690610857565b91506103858286610cc5565b94505b6103a38461039461077d565b6001600160a01b0316906108d4565b6103c088846103b061077d565b6001600160a01b03169190610939565b81156104b0576103ce61077d565b6001600160a01b031663095ea7b36103e46108b0565b846040518363ffffffff1660e01b8152600401610402929190610de0565b6020604051808303816000875af1158015610421573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104459190610df9565b5061044e6108b0565b6001600160a01b031663ca94b0e98b8a856040518463ffffffff1660e01b815260040161047d93929190610e1b565b600060405180830381600087803b15801561049757600080fd5b505af11580156104ab573d6000803e3d6000fd5b505050505b84156105bd576001600160a01b0386166105b0576104cc61077d565b6001600160a01b031663095ea7b36104e26108b0565b876040518363ffffffff1660e01b8152600401610500929190610de0565b6020604051808303816000875af115801561051f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105439190610df9565b5061054c6108b0565b6001600160a01b031663a2a317228b876040518363ffffffff1660e01b8152600401610579929190610de0565b600060405180830381600087803b15801561059357600080fd5b505af11580156105a7573d6000803e3d6000fd5b505050506105bd565b6105bd86866103b061077d565b6001600160a01b038816338c60028111156105da576105da610d6d565b7fb1ac8b16683562f4b1b5ecbe3321151b400058de5cdd25ac44d5bfacb106765f8d8d8989898d8f60405161064d97969594939291906001600160a01b039788168152602081019690965260408601949094526060850192909252608084015260a083015290911660c082015260e00190565b60405180910390a45050505050505050505050565b604080516000815260208101909152606090826001600160401b0381111561068c5761068c610cd8565b6040519080825280602002602001820160405280156106bf57816020015b60608152602001906001900390816106aa5790505b50915060005b838110156107415761071c308686848181106106e3576106e3610e3f565b90506020028101906106f59190610e55565b8560405160200161070893929190610ea2565b60405160208183030381529060405261096d565b83828151811061072e5761072e610e3f565b60209081029190910101526001016106c5565b50505b92915050565b6000807ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00610744565b61077b6109e3565b565b7f000000000000000000000000000000000000000000000000000000000000000090565b8015610852576040516323b872dd60e01b81526001600160a01b038416906323b872dd906107d790859030908690600401610e1b565b6020604051808303816000875af11580156107f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061081a9190610df9565b6108525760405162461bcd60e51b815260206004820152600960248201526810ba3930b739b332b960b91b60448201526064016101ef565b505050565b600061086682620f4240101590565b829061088857604051633dc311df60e01b81526004016101ef91815260200190565b5061089f8361089a84620f4240610cc5565b610a08565b6108a99084610cc5565b9392505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b801561093557604051630852cd8d60e31b8152600481018290526001600160a01b038316906342966c6890602401600060405180830381600087803b15801561091c57600080fd5b505af1158015610930573d6000803e3d6000fd5b505050505b5050565b80156108525760405163a9059cbb60e01b81526001600160a01b0384169063a9059cbb906107d79085908590600401610de0565b6060600080846001600160a01b03168460405161098a9190610ec9565b600060405180830381855af49150503d80600081146109c5576040519150601f19603f3d011682016040523d82523d6000602084013e6109ca565b606091505b50915091506109da858383610a6f565b95945050505050565b6109eb610acb565b61077b57604051631afcd79f60e31b815260040160405180910390fd5b6000610a1783620f4240101590565b80610a2a5750610a2a82620f4240101590565b83839091610a545760405163768bf0eb60e11b8152600481019290925260248201526044016101ef565b50620f42409050610a658385610ee5565b6108a99190610efc565b606082610a8457610a7f82610ae5565b6108a9565b8151158015610a9b57506001600160a01b0384163b155b15610ac457604051639996b31560e01b81526001600160a01b03851660048201526024016101ef565b5092915050565b6000610ad561074a565b54600160401b900460ff16919050565b805115610af55780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b80356001600160a01b0381168114610b2557600080fd5b919050565b60008060008060008060c08789031215610b4357600080fd5b863560038110610b5257600080fd5b9550610b6060208801610b0e565b945060408701359350610b7560608801610b0e565b925060808701359150610b8a60a08801610b0e565b90509295509295509295565b60008060208385031215610ba957600080fd5b82356001600160401b03811115610bbf57600080fd5b8301601f81018513610bd057600080fd5b80356001600160401b03811115610be657600080fd5b8560208260051b8401011115610bfb57600080fd5b6020919091019590945092505050565b60005b83811015610c26578181015183820152602001610c0e565b50506000910152565b6000602082016020835280845180835260408501915060408160051b86010192506020860160005b82811015610ca357603f1987860301845281518051808752610c80816020890160208501610c0b565b601f01601f19169590950160209081019550938401939190910190600101610c57565b50929695505050505050565b634e487b7160e01b600052601160045260246000fd5b8181038181111561074457610744610caf565b634e487b7160e01b600052604160045260246000fd5b600060a0828403128015610d0157600080fd5b6000905060405160a081018181106001600160401b0382111715610d3357634e487b7160e01b83526041600452602483fd5b6040908152845182526020808601519083015284810151908201526060808501519082015260809384015193810193909352509092915050565b634e487b7160e01b600052602160045260246000fd5b6001600160a01b038481168252831660208201526060810160038310610db957634e487b7160e01b600052602160045260246000fd5b826040830152949350505050565b600060208284031215610dd957600080fd5b5051919050565b6001600160a01b03929092168252602082015260400190565b600060208284031215610e0b57600080fd5b815180151581146108a957600080fd5b6001600160a01b039384168152919092166020820152604081019190915260600190565b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112610e6c57600080fd5b8301803591506001600160401b03821115610e8657600080fd5b602001915036819003821315610e9b57600080fd5b9250929050565b828482376000838201600081528351610ebf818360208801610c0b565b0195945050505050565b60008251610edb818460208701610c0b565b9190910192915050565b808202811582820484141761074457610744610caf565b600082610f1957634e487b7160e01b600052601260045260246000fd5b50049056fea2646970667358221220c7f05052208f6f4047e1223bab7d7f3c4001cbe9b001fbbc3b1069b01cc7eced64736f6c634300081b00330000000000000000000000000750eda3185c758247e97819074bcd217a815fae0000000000000000000000000000000000000000000000000000000000002710","id":1,"type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"GraphPayments#GraphPayments","networkInteractionId":1,"nonce":1633,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"GraphPayments#GraphPayments","networkInteractionId":1,"nonce":1633,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0xc54d915f9d9de3516d7f8da7284b32a11ea95d988a1d316f57ac8cad01fc99d1"},"type":"TRANSACTION_SEND"} +{"artifactId":"GraphTallyCollector#GraphTallyCollector","constructorArgs":["GraphTallyCollector","1","0x0750EdA3185C758247E97819074bCD217a815FaE",10000],"contractName":"GraphTallyCollector","dependencies":["Controller#Controller","GraphHorizon_Periphery","HorizonProxies"],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","futureId":"GraphTallyCollector#GraphTallyCollector","futureType":"CONTRACT_DEPLOYMENT","libraries":{},"strategy":"basic","strategyConfig":{},"type":"DEPLOYMENT_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"GraphTallyCollector#GraphTallyCollector","networkInteraction":{"data":"0x6102c060405234801561001157600080fd5b506040516122bf3803806122bf833981016040819052610030916105e0565b8082858561003f8260006103e2565b6101205261004e8160016103e2565b61014052815160208084019190912060e052815190820120610100524660a0526100db60e05161010051604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201529081019290925260608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b60805250503060c0526001600160a01b03811661012d5760405163218f5add60e11b815260206004820152600a60248201526921b7b73a3937b63632b960b11b60448201526064015b60405180910390fd5b6001600160a01b0381166101e05260408051808201909152600a81526923b930b8342a37b5b2b760b11b602082015261016590610415565b6001600160a01b0316610160526040805180820190915260078152665374616b696e6760c81b602082015261019990610415565b6001600160a01b03166101805260408051808201909152600d81526c47726170685061796d656e747360981b60208201526101d390610415565b6001600160a01b03166101a05260408051808201909152600e81526d5061796d656e7473457363726f7760901b602082015261020e90610415565b6001600160a01b03166101c05260408051808201909152600c81526b22b837b1b426b0b730b3b2b960a11b602082015261024790610415565b6001600160a01b03166102005260408051808201909152600e81526d2932bbb0b93239a6b0b730b3b2b960911b602082015261028290610415565b6001600160a01b0316610220526040805180820190915260118152704772617068546f6b656e4761746577617960781b60208201526102c090610415565b6001600160a01b03166102405260408051808201909152600f81526e23b930b834283937bc3ca0b236b4b760891b60208201526102fc90610415565b6001600160a01b03166102605260408051808201909152600881526721bab930ba34b7b760c11b602082015261033190610415565b6001600160a01b039081166102808190526101e05161018051610160516101a0516101c0516102005161022051610240516102605160408051968c168752948b166020870152928a1685850152908916606085015288166080840152871660a083015260c0820195909552935192851694918216939116917fef5021414834d86e36470f5c1cecf6544fb2bb723f2ca51a4c86fcd8c5919a439181900360e00190a4506102a0525061082d92505050565b60006020835110156103fe576103f7836104c3565b905061040f565b8161040984826106ea565b5060ff90505b92915050565b6000806101e0516001600160a01b031663f7641a5e84805190602001206040518263ffffffff1660e01b815260040161045091815260200190565b602060405180830381865afa15801561046d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061049191906107a8565b9050826001600160a01b0382166104bc5760405163218f5add60e11b815260040161012491906107f6565b5092915050565b600080829050601f815111156104ee578260405163305a27a960e01b815260040161012491906107f6565b80516104f982610809565b179392505050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561053257818101518382015260200161051a565b50506000910152565b600082601f83011261054c57600080fd5b81516001600160401b0381111561056557610565610501565b604051601f8201601f19908116603f011681016001600160401b038111828210171561059357610593610501565b6040528181528382016020018510156105ab57600080fd5b6105bc826020830160208701610517565b949350505050565b80516001600160a01b03811681146105db57600080fd5b919050565b600080600080608085870312156105f657600080fd5b84516001600160401b0381111561060c57600080fd5b6106188782880161053b565b602087015190955090506001600160401b0381111561063657600080fd5b6106428782880161053b565b935050610651604086016105c4565b6060959095015193969295505050565b600181811c9082168061067557607f821691505b60208210810361069557634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156106e557806000526020600020601f840160051c810160208510156106c25750805b601f840160051c820191505b818110156106e257600081556001016106ce565b50505b505050565b81516001600160401b0381111561070357610703610501565b610717816107118454610661565b8461069b565b6020601f82116001811461074b57600083156107335750848201515b600019600385901b1c1916600184901b1784556106e2565b600084815260208120601f198516915b8281101561077b578785015182556020948501946001909201910161075b565b50848210156107995786840151600019600387901b60f8161c191681555b50505050600190811b01905550565b6000602082840312156107ba57600080fd5b6107c3826105c4565b9392505050565b600081518084526107e2816020860160208601610517565b601f01601f19169290920160200192915050565b6020815260006107c360208301846107ca565b805160208083015191908110156106955760001960209190910360031b1b16919050565b60805160a05160c05160e05161010051610120516101405161016051610180516101a0516101c0516101e05161020051610220516102405161026051610280516102a0516119d06108ef60003960008181610247015261036501526000505060005050600050506000505060005050600050506000610a19015260005050600061083e0152600050506000610bb401526000610b8201526000610f2b01526000610f0301526000610e5e01526000610e8801526000610eb201526119d06000f3fe608060405234801561001057600080fd5b50600436106100ba5760003560e01c8063015cdd80146100bf5780631354f019146100d4578063181250ff146100e757806326969c4c1461013457806339aa7416146101475780633a13e1af1461015a57806363648817146101be57806365e4ad9e146101de578063692209ce146102015780637f07d2831461021457806384b0196e146102275780639b95288114610242578063bea5d2ab14610269578063fee9f01f14610295575b600080fd5b6100d26100cd3660046111d7565b6102a8565b005b6100d26100e23660046111d7565b610355565b6101216100f53660046111f4565b600360209081526000948552604080862082529385528385208152918452828420909152825290205481565b6040519081526020015b60405180910390f35b610121610142366004611247565b6103ea565b6100d26101553660046111d7565b610403565b6101976101683660046111d7565b60026020819052600091825260409091208054600182015491909201546001600160a01b039092169160ff1683565b604080516001600160a01b039094168452602084019290925215159082015260600161012b565b6101d16101cc366004611281565b6104cd565b60405161012b91906112bb565b6101f16101ec3660046112cf565b6104e0565b604051901515815260200161012b565b61012161020f36600461135f565b6104f3565b6101216102223660046113b8565b61050a565b61022f610521565b60405161012b9796959493929190611450565b6101217f000000000000000000000000000000000000000000000000000000000000000081565b6101216102773660046111d7565b6001600160a01b031660009081526002602052604090206001015490565b6100d26102a33660046114e8565b610567565b806102b33382610633565b6001600160a01b03821660009081526002602052604090206001015482906102f85760405163cd3cd55d60e01b81526004016102ef91906112bb565b60405180910390fd5b506001600160a01b038216600081815260026020908152604080832060010180549390555182815291929133917f3b4432b11b66b46d9a7b190aa989c0ae85a5395b543540220596dd94dd405ceb910160405180910390a3505050565b806103603382610633565b61038a7f000000000000000000000000000000000000000000000000000000000000000042611559565b6001600160a01b0383166000818152600260205260409081902060010183905551909133917fd939049941f6a15381248e4ac0010f15efdf0f3221923711244c200b5ff2cddf916103de9190815260200190565b60405180910390a35050565b60006103fd6103f88361170b565b610666565b92915050565b8061040e3382610633565b6001600160a01b038216600090815260026020526040902060010154828161044a5760405163cd3cd55d60e01b81526004016102ef91906112bb565b504281818111156104775760405163bd76307f60e01b8152600481019290925260248201526044016102ef565b50506001600160a01b0383166000818152600260208190526040808320909101805460ff191660011790555133917f2fc91dbd92d741cae16e0315578d7f6cf77043b771692c4bd993658ecfe8942291a3505050565b60006103fd6104db836117a8565b610738565b60006104ec8383610758565b9392505050565b6000610501858585856107bb565b95945050505050565b600061051984848460006107bb565b949350505050565b600060608060008060006060610535610b7b565b61053d610bad565b60408051600080825260208201909252600f60f81b9b939a50919850469750309650945092509050565b6001600160a01b0384811660009081526002602081905260409091208054910154911690859060ff1682156105cb57604051630c83a00f60e01b81526001600160a01b039384166004820152929091166024830152151560448201526064016102ef565b5050506105da82828587610bda565b6001600160a01b03841660008181526002602052604080822080546001600160a01b03191633908117909155905190917f6edcdd4150e63c6c36d965976c1c37375609c8b040c50d39e7156437b80e282891a350505050565b61063d8282610758565b8282909161066057604051631e58ab1f60e01b81526004016102ef9291906117b4565b50505050565b60006103fd7f2f8962be843489018f0fe44aa06adfead655e3c10d7347a020040f9524f392d3836000015184602001518560400151866060015187608001518860a001518960c001518051906020012060405160200161071d98979695949392919097885260208801969096526001600160a01b0394851660408801529284166060870152921660808501526001600160401b039190911660a08401526001600160801b031660c083015260e08201526101000190565b60405160208183030381529060405280519060200120610d17565b6000806107488360000151610666565b90506104ec818460200151610d44565b60006001600160a01b0383161580159061078e57506001600160a01b038281166000908152600260205260409020548116908416145b80156104ec5750506001600160a01b03166000908152600260208190526040909120015460ff1615919050565b60008080806107cc868801886117ce565b825160600151929550909350915033906001600160a01b038116821461080757604051632b65e49760e11b81526004016102ef9291906117b4565b505061081283610d6e565b8251805160608201516040928301519251630119cbed60e31b8152919290916000906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906308ce5f689061087590859087906004016117b4565b602060405180830381865afa158015610892573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108b69190611828565b875160600151909150816108de5760405163037a2d1f60e61b81526004016102ef91906112bb565b5050855160a001516001600160a01b0380841660009081526003602090815260408083208884528252808320868516845282528083208b5183015190941683529290529081205490916001600160801b031690818180821161095c57604051637007d4a160e01b8152600481019290925260248201526044016102ef565b50508a600003610977576109708183611841565b92506109bd565b6109818183611841565b8b11158b61098f8385611841565b90916109b75760405163c5602bb160e01b8152600481019290925260248201526044016102ef565b50508a92505b50508015610aac576001600160a01b0380841660009081526003602090815260408083208884528252808320868516845282528083208b5183015190941683529290529081208054839290610a13908490611559565b909155507f000000000000000000000000000000000000000000000000000000000000000090506001600160a01b0316631230fa3e8d8960000151602001518585888c8c6040518863ffffffff1660e01b8152600401610a79979695949392919061188c565b600060405180830381600087803b158015610a9357600080fd5b505af1158015610aa7573d6000803e3d6000fd5b505050505b826001600160a01b03168760000151602001516001600160a01b0316857f481a17595c709e8f745444fb9ffc8f0b5e98458de94463971947f548e12bbdb48f8686604051610afc939291906118d8565b60405180910390a48651602080820151608083015160a084015160c090940151928b01516040516001600160a01b03808a16969416948a947f3943fc3b19ec289c87b57de7a8bf1448d81ced03d1806144ecaca4ba9e97605694610b64948b94919391611900565b60405180910390a49b9a5050505050505050505050565b6060610ba87f00000000000000000000000000000000000000000000000000000000000000006000610da6565b905090565b6060610ba87f00000000000000000000000000000000000000000000000000000000000000006001610da6565b8142808211610c055760405163d7705a0160e01b8152600481019290925260248201526044016102ef565b505060408051466020808301919091526001600160601b031930606090811b8216848601527330baba3437b934bd32a9b4b3b732b9283937b7b360611b60548501526068840187905233901b1660888301528251808303607c018152609c90920190925280519101207b0ca2ba3432b932bab69029b4b3b732b21026b2b9b9b0b3b29d05199960211b6000908152601c829052603c81209050826001600160a01b0316610ce88288888080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610d4492505050565b6001600160a01b031614610d0f57604051631c07ed3360e31b815260040160405180910390fd5b505050505050565b60006103fd610d24610e51565b8360405161190160f01b8152600281019290925260228201526042902090565b600080600080610d548686610f7c565b925092509250610d648282610fc9565b5090949350505050565b805160200151610d8690610d8183610738565b610758565b610da35760405163aa415c3360e01b815260040160405180910390fd5b50565b606060ff8314610dc057610db983611086565b90506103fd565b818054610dcc90611960565b80601f0160208091040260200160405190810160405280929190818152602001828054610df890611960565b8015610e455780601f10610e1a57610100808354040283529160200191610e45565b820191906000526020600020905b815481529060010190602001808311610e2857829003601f168201915b505050505090506103fd565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148015610eaa57507f000000000000000000000000000000000000000000000000000000000000000046145b15610ed457507f000000000000000000000000000000000000000000000000000000000000000090565b610ba8604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f0000000000000000000000000000000000000000000000000000000000000000918101919091527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b60008060008351604103610fb65760208401516040850151606086015160001a610fa8888285856110c5565b955095509550505050610fc2565b50508151600091506002905b9250925092565b6000826003811115610fdd57610fdd611854565b03610fe6575050565b6001826003811115610ffa57610ffa611854565b036110185760405163f645eedf60e01b815260040160405180910390fd5b600282600381111561102c5761102c611854565b0361104d5760405163fce698f760e01b8152600481018290526024016102ef565b600382600381111561106157611061611854565b03611082576040516335e2f38360e21b8152600481018290526024016102ef565b5050565b606060006110938361118a565b604080516020808252818301909252919250600091906020820181803683375050509182525060208101929092525090565b600080806fa2a8918ca85bafe22016d0b997e4df60600160ff1b038411156110f65750600091506003905082611180565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa15801561114a573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661117657506000925060019150829050611180565b9250600091508190505b9450945094915050565b600060ff8216601f8111156103fd57604051632cd44ac360e21b815260040160405180910390fd5b6001600160a01b0381168114610da357600080fd5b80356111d2816111b2565b919050565b6000602082840312156111e957600080fd5b81356104ec816111b2565b6000806000806080858703121561120a57600080fd5b8435611215816111b2565b935060208501359250604085013561122c816111b2565b9150606085013561123c816111b2565b939692955090935050565b60006020828403121561125957600080fd5b81356001600160401b0381111561126f57600080fd5b820160e081850312156104ec57600080fd5b60006020828403121561129357600080fd5b81356001600160401b038111156112a957600080fd5b8201604081850312156104ec57600080fd5b6001600160a01b0391909116815260200190565b600080604083850312156112e257600080fd5b82356112ed816111b2565b915060208301356112fd816111b2565b809150509250929050565b8035600381106111d257600080fd5b60008083601f84011261132957600080fd5b5081356001600160401b0381111561134057600080fd5b60208301915083602082850101111561135857600080fd5b9250929050565b6000806000806060858703121561137557600080fd5b61137e85611308565b935060208501356001600160401b0381111561139957600080fd5b6113a587828801611317565b9598909750949560400135949350505050565b6000806000604084860312156113cd57600080fd5b6113d684611308565b925060208401356001600160401b038111156113f157600080fd5b6113fd86828701611317565b9497909650939450505050565b6000815180845260005b8181101561143057602081850181015186830182015201611414565b506000602082860101526020601f19601f83011685010191505092915050565b60ff60f81b8816815260e06020820152600061146f60e083018961140a565b8281036040840152611481818961140a565b606084018890526001600160a01b038716608085015260a0840186905283810360c08501528451808252602080870193509091019060005b818110156114d75783518352602093840193909201916001016114b9565b50909b9a5050505050505050505050565b600080600080606085870312156114fe57600080fd5b8435611509816111b2565b93506020850135925060408501356001600160401b0381111561152b57600080fd5b61153787828801611317565b95989497509550505050565b634e487b7160e01b600052601160045260246000fd5b808201808211156103fd576103fd611543565b634e487b7160e01b600052604160045260246000fd5b60405160e081016001600160401b03811182821017156115a4576115a461156c565b60405290565b80356001600160401b03811681146111d257600080fd5b80356001600160801b03811681146111d257600080fd5b600082601f8301126115e957600080fd5b81356001600160401b038111156116025761160261156c565b604051601f8201601f19908116603f011681016001600160401b03811182821017156116305761163061156c565b60405281815283820160200185101561164857600080fd5b816020850160208301376000918101602001919091529392505050565b600060e0828403121561167757600080fd5b61167f611582565b823581529050611691602083016111c7565b60208201526116a2604083016111c7565b60408201526116b3606083016111c7565b60608201526116c4608083016115aa565b60808201526116d560a083016115c1565b60a082015260c08201356001600160401b038111156116f357600080fd5b6116ff848285016115d8565b60c08301525092915050565b60006103fd3683611665565b60006040828403121561172957600080fd5b604080519081016001600160401b038111828210171561174b5761174b61156c565b60405290508082356001600160401b0381111561176757600080fd5b61177385828601611665565b82525060208301356001600160401b0381111561178f57600080fd5b61179b858286016115d8565b6020830152505092915050565b60006103fd3683611717565b6001600160a01b0392831681529116602082015260400190565b6000806000606084860312156117e357600080fd5b83356001600160401b038111156117f957600080fd5b61180586828701611717565b93505060208401359150604084013561181d816111b2565b809150509250925092565b60006020828403121561183a57600080fd5b5051919050565b818103818111156103fd576103fd611543565b634e487b7160e01b600052602160045260246000fd5b6003811061188857634e487b7160e01b600052602160045260246000fd5b9052565b60e0810161189a828a61186a565b6001600160a01b03978816602083015295871660408201526060810194909452918516608084015260a083015290921660c090920191909152919050565b606081016118e6828661186a565b6001600160a01b0393909316602082015260400152919050565b6001600160a01b03861681526001600160401b03851660208201526001600160801b038416604082015260a0606082018190526000906119429083018561140a565b8281036080840152611954818561140a565b98975050505050505050565b600181811c9082168061197457607f821691505b60208210810361199457634e487b7160e01b600052602260045260246000fd5b5091905056fea26469706673582212202168ccf8bac6984eef611a01a2e1c7b84ddb64fd4b819201ae6206ab6038e15764736f6c634300081b0033000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000750eda3185c758247e97819074bcd217a815fae00000000000000000000000000000000000000000000000000000000000027100000000000000000000000000000000000000000000000000000000000000013477261706854616c6c79436f6c6c6563746f720000000000000000000000000000000000000000000000000000000000000000000000000000000000000000013100000000000000000000000000000000000000000000000000000000000000","id":1,"type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"GraphTallyCollector#GraphTallyCollector","networkInteractionId":1,"nonce":1634,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"GraphTallyCollector#GraphTallyCollector","networkInteractionId":1,"nonce":1634,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0xa8d55ccd6bc05af4e50ce1c6cf5ecd5c5a4cfc076b22aca3e7eb2b4c2f5ea8aa"},"type":"TRANSACTION_SEND"} +{"artifactId":"HorizonStaking#HorizonStakingExtension","constructorArgs":["0x0750EdA3185C758247E97819074bCD217a815FaE","0x00fe8F95407AB61863d27c07F584A0930ee5F3b0"],"contractName":"HorizonStakingExtension","dependencies":["Controller#Controller","GraphHorizon_Periphery","HorizonProxies","HorizonStaking#ExponentialRebates"],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","futureId":"HorizonStaking#HorizonStakingExtension","futureType":"CONTRACT_DEPLOYMENT","libraries":{"ExponentialRebates":"0xF2DB533658a1728f3ce04A49Df4b545f4A53b620"},"strategy":"basic","strategyConfig":{},"type":"DEPLOYMENT_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"HorizonStaking#HorizonStakingExtension","networkInteraction":{"data":"0x6101e060405234801561001157600080fd5b506040516133a83803806133a883398101604081905261003091610411565b818181806001600160a01b03811661007d5760405163218f5add60e11b815260206004820152600a60248201526921b7b73a3937b63632b960b11b60448201526064015b60405180910390fd5b6001600160a01b0381166101005260408051808201909152600a81526923b930b8342a37b5b2b760b11b60208201526100b590610347565b6001600160a01b03166080526040805180820190915260078152665374616b696e6760c81b60208201526100e890610347565b6001600160a01b031660a05260408051808201909152600d81526c47726170685061796d656e747360981b602082015261012190610347565b6001600160a01b031660c05260408051808201909152600e81526d5061796d656e7473457363726f7760901b602082015261015b90610347565b6001600160a01b031660e05260408051808201909152600c81526b22b837b1b426b0b730b3b2b960a11b602082015261019390610347565b6001600160a01b03166101205260408051808201909152600e81526d2932bbb0b93239a6b0b730b3b2b960911b60208201526101ce90610347565b6001600160a01b0316610140526040805180820190915260118152704772617068546f6b656e4761746577617960781b602082015261020c90610347565b6001600160a01b03166101605260408051808201909152600f81526e23b930b834283937bc3ca0b236b4b760891b602082015261024890610347565b6001600160a01b03166101805260408051808201909152600881526721bab930ba34b7b760c11b602082015261027d90610347565b6001600160a01b039081166101a08190526101005160a05160805160c05160e05161012051610140516101605161018051604051988b169a9788169996909716977fef5021414834d86e36470f5c1cecf6544fb2bb723f2ca51a4c86fcd8c5919a43976103279790916001600160a01b03978816815295871660208701529386166040860152918516606085015284166080840152831660a083015290911660c082015260e00190565b60405180910390a450506001600160a01b03166101c052506104b4915050565b600080610100516001600160a01b031663f7641a5e84805190602001206040518263ffffffff1660e01b815260040161038291815260200190565b602060405180830381865afa15801561039f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103c39190610444565b9050826001600160a01b0382166103ee5760405163218f5add60e11b81526004016100749190610466565b5092915050565b80516001600160a01b038116811461040c57600080fd5b919050565b6000806040838503121561042457600080fd5b61042d836103f5565b915061043b602084016103f5565b90509250929050565b60006020828403121561045657600080fd5b61045f826103f5565b9392505050565b602081526000825180602084015260005b818110156104945760208186018101516040868401015201610477565b506000604082850101526040601f19601f83011684010191505092915050565b60805160a05160c05160e05161010051610120516101405161016051610180516101a0516101c051612e76610532600039600081816104ec0152611e5901526000611f6c0152600050506000505060006124d70152600061222e01526000611966015260005050600050506000505060006119a10152612e766000f3fe608060405234801561001057600080fd5b50600436106101805760003560e01c806308ce5f68146101855780630e022923146101ab5780631787e69f1461023357806325d9897e1461025c5780632f7cc5011461038457806339514ad2146103975780634488a382146103bc57806344c32a61146103d157806355c85269146103e4578063561285e41461042e5780637573ef4f146104835780637a76646014610233578063872d0489146104965780638cc01c86146104a95780638d3c100a146104d75780639363c522146104ea57806398c657dc146105185780639ce7abe514610538578063a2594d821461054b578063a784d4981461055e578063ac9650d814610571578063ae4fe67a14610591578063b6363cf2146105cd578063c0641994146105e0578063ccebcabb146105ee578063d48de84514610610578063e2e1e8e91461065f578063e56f8a1d1461067f578063e73e14bf146106c5578063f1d60d66146106f0578063fb744cc014610703578063fc54fb2714610716575b600080fd5b610198610193366004612721565b610721565b6040519081526020015b60405180910390f35b6101be6101b936600461275a565b610736565b6040516101a2919060006101208201905060018060a01b0383511682526020830151602083015260408301516040830152606083015160608301526080830151608083015260a083015160a083015260c083015160c083015260e083015160e083015261010083015161010083015292915050565b61019861024136600461275a565b6001600160a01b03166000908152600e602052604090205490565b61037761026a366004612721565b6040805161014081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101829052610120810191909152506001600160a01b039182166000908152601b6020908152604080832093909416825291825282902082516101408101845281548152600182015492810192909252600281015492820192909252600382015463ffffffff8082166060840152600160201b82046001600160401b039081166080850152600160601b8304811660a0850152600160a01b830490911660c0840152600160c01b9091041660e0820152600482015461010082015260059091015461012082015290565b6040516101a29190612777565b61019861039236600461284b565b610816565b601a546001600160401b03165b6040516001600160401b0390911681526020016101a2565b6103cf6103ca3660046128a5565b610918565b005b6103cf6103df3660046128e4565b610d04565b6103f76103f236600461275a565b610d99565b6040805196151587526001600160a01b039095166020870152938501929092526060840152608083015260a082015260c0016101a2565b61044161043c366004612721565b610e6f565b6040516101a29190600060a082019050825182526020830151602083015260408301516040830152606083015160608301526080830151608083015292915050565b610198610491366004612910565b610ec1565b6101986104a436600461295f565b610f25565b6104bc6104b736600461275a565b610f7a565b604080518251815260209283015192810192909252016101a2565b6103cf6104e53660046129a8565b610fb6565b7f00000000000000000000000000000000000000000000000000000000000000006040516101a291906129cd565b61052b61052636600461275a565b611405565b6040516101a291906129f7565b6103cf610546366004612a1f565b611410565b6103cf61055936600461275a565b61150b565b61019861056c36600461275a565b6115f7565b61058461057f366004612aa4565b611602565b6040516101a29190612b3d565b6105bd61059f36600461275a565b6001600160a01b031660009081526022602052604090205460ff1690565b60405190151581526020016101a2565b6105bd6105db366004612721565b6116e9565b600d5463ffffffff166103a4565b6106016105fc366004612bbd565b611718565b604051905181526020016101a2565b61062361061e366004612bfd565b61176a565b6040516101a29190815181526020808301516001600160401b031690820152604080830151908201526060918201519181019190915260800190565b61019861066d366004612c19565b60009081526010602052604090205490565b61069261068d36600461284b565b6117d7565b6040516101a291908151815260208083015190820152604080830151908201526060918201519181019190915260800190565b6105bd6106d336600461275a565b6001600160a01b03166000908152600e6020526040902054151590565b6105bd6106fe36600461275a565b61183f565b610198610711366004612721565b611864565b60205460ff166105bd565b600061072d8383611870565b90505b92915050565b61079160405180610120016040528060006001600160a01b0316815260200160008019168152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b506001600160a01b039081166000908152600f6020908152604091829020825161012081018452815490941684526001810154918401919091526002810154918301919091526003810154606083015260048101546080830152600581015460a0830152600681015460c0830152600781015460e08301526008015461010082015290565b600080610825868686866118a8565b9050806003015460000361083d576000915050610910565b6001600160a01b038086166000908152601b6020908152604080832093881683529290529081206001810154600282015484545b80156109075760006108838c83611914565b905084600501548160030154036108fc576001810154426001600160401b03909116116108f6576000838583600001546108bd9190612c48565b6108c79190612c5f565b90506108d38186612c81565b82549095506108e29085612c81565b93506108ee8188612c94565b9650506108fc565b50610907565b600201549050610871565b50929450505050505b949350505050565b3360009081526012602052604090205460ff166109675760405162461bcd60e51b815260206004820152600860248201526710b9b630b9b432b960c11b60448201526064015b60405180910390fd5b61096f611964565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156109ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109d09190612ca7565b156109ee57604051632b37d9d160e21b815260040160405180910390fd5b6001600160a01b0384166000908152600e6020526040902083610a3d5760405162461bcd60e51b815260206004820152600760248201526621746f6b656e7360c81b604482015260640161095e565b82841015610a7d5760405162461bcd60e51b815260206004820152600d60248201526c0e4caeec2e4c8e67ce6d8c2e6d609b1b604482015260640161095e565b8054610ab45760405162461bcd60e51b8152602060048201526006602482015265217374616b6560d01b604482015260640161095e565b8054841115610af35760405162461bcd60e51b815260206004820152600b60248201526a736c6173683e7374616b6560a81b604482015260640161095e565b6001600160a01b038216610b385760405162461bcd60e51b815260206004820152600c60248201526b2162656e656669636961727960a01b604482015260640161095e565b600081600201548260010154610b4e9190612c94565b9050600082600001548211610b6f578254610b6a908390612c81565b610b72565b60005b90508086118015610b87575060008360020154115b15610bd5576000610b988288612c81565b90506000610baa828660020154611988565b9050808560020154610bbc9190612c81565b60028601819055600003610bd257600060038601555b50505b60048301548354600091610be891612c81565b905080600003610c4157876001600160a01b03167ff2717be2f27d9d2d7d265e42dc556e40d2d9aeaba02f49c5286030f30c0571f360008088604051610c3093929190612cc9565b60405180910390a250505050610cfe565b80871115610c645786610c548288612c48565b610c5e9190612c5f565b95508096505b8354610c71908890612c81565b8455610c97610c808789612c81565b610c8861199f565b6001600160a01b0316906119c3565b610cb48587610ca461199f565b6001600160a01b03169190611a0b565b876001600160a01b03167ff2717be2f27d9d2d7d265e42dc556e40d2d9aeaba02f49c5286030f30c0571f3888888604051610cf193929190612cc9565b60405180910390a2505050505b50505050565b610d0c611964565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610d49573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6d9190612ca7565b15610d8b57604051632b37d9d160e21b815260040160405180910390fd5b610d958282611ac2565b5050565b6001600160a01b038082166000908152600f6020908152604080832081516101208101835281549095168552600180820154938601939093526002810154918501919091526003810154606085015260048101546080850152600581015460a0850152600681015460c0850152600781015460e0850152600801546101008401529091829182918291829182918290610e318a611dfc565b6002811115610e4257610e426129e1565b83516020850151604086015160e090960151939092149c909b509099509297509550600094509092505050565b610e776126c3565b610e7f6126c3565b6000610e8b8585611e55565b60028101548352600381015460208401526005810154604084015260068101546060840152600701546080830152509392505050565b6001600160a01b038084166000908152601c60209081526040808320938616835292905290812081836002811115610efb57610efb6129e1565b6002811115610f0c57610f0c6129e1565b81526020019081526020016000205490505b9392505050565b600080610f328585611870565b90506000610f408686611ed9565b90506000610f5463ffffffff861684612c48565b90506000610f628383611988565b9050610f6e8185612c94565b98975050505050505050565b610f826126f2565b610f8a6126f2565b6001600160a01b039092166000908152600e602090815260409091208054845260040154908301525090565b610fbe611964565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ffb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061101f9190612ca7565b1561103d57604051632b37d9d160e21b815260040160405180910390fd5b6001600160a01b03811661107c5760405162461bcd60e51b815260206004820152600660248201526521616c6c6f6360d01b604482015260640161095e565b600061108782611dfc565b9050600081600281111561109d5761109d6129e1565b036110d55760405162461bcd60e51b81526020600482015260086024820152670858dbdb1b1958dd60c21b604482015260640161095e565b826000036110e257505050565b6001600160a01b0382166000908152600f60205260408120600181015490918590808080611123338661111361199f565b6001600160a01b03169190611efc565b600d5461113e908690600160401b900463ffffffff16611f3d565b935061114a8486612c81565b600d5490955061116a9087908790600160201b900463ffffffff16611f58565b92506111768386612c81565b94508487600501546111889190612c94565b6005880155600287015460009015806111ae5750601954600160a01b900463ffffffff16155b6112795760058801546002890154600d546019546040516349484d8160e01b81526004810194909452602484019290925263ffffffff600160a01b80830482166044860152600160c01b928390048216606486015283048116608485015291041660a482015273F2DB533658a1728f3ce04A49Df4b545f4A53b620906349484d819060c401602060405180830381865af4158015611250573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112749190612ce8565b61127c565b60005b905061128c81896008015461212e565b92506112988387611988565b92506112a7610c808488612c81565b821561130f578288600801546112bd9190612c94565b600889015587546112d7906001600160a01b031684612148565b91506112e38284612c81565b88546001600160a01b0390811660008181526017602052604090205492955061130f92869216156121da565b5086546001600160a01b03808b16918891167ff5ded07502b6feba4c13b19a0c6646efd4b4119f439bcbd49076e4f0ed1eec4b3361134b61222c565b6001600160a01b031663766718086040518163ffffffff1660e01b8152600401602060405180830381865afa158015611388573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113ac9190612ce8565b604080516001600160a01b039093168352602083019190915281018f9052606081018990526080810188905260a081018a905260c0810187905260e081018690526101000160405180910390a450505050505050505050565b600061073082611dfc565b82806001600160a01b031663f851a4406040518163ffffffff1660e01b81526004016020604051808303816000875af1158015611451573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114759190612d01565b6001600160a01b0316336001600160a01b0316146114a55760405162461bcd60e51b815260040161095e90612d1e565b60405163623faf6160e01b81526001600160a01b0385169063623faf61906114d39086908690600401612d55565b600060405180830381600087803b1580156114ed57600080fd5b505af1158015611501573d6000803e3d6000fd5b5050505050505050565b80806001600160a01b031663f851a4406040518163ffffffff1660e01b81526004016020604051808303816000875af115801561154c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115709190612d01565b6001600160a01b0316336001600160a01b0316146115a05760405162461bcd60e51b815260040161095e90612d1e565b816001600160a01b03166359fc20bb6040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156115db57600080fd5b505af11580156115ef573d6000803e3d6000fd5b505050505050565b600061073082612250565b604080516000815260208101909152606090826001600160401b0381111561162c5761162c612d84565b60405190808252806020026020018201604052801561165f57816020015b606081526020019060019003908161164a5790505b50915060005b838110156116e1576116bc3086868481811061168357611683612d9a565b90506020028101906116959190612db0565b856040516020016116a893929190612dfd565b6040516020818303038152906040526122c1565b8382815181106116ce576116ce612d9a565b6020908102919091010152600101611665565b505092915050565b6001600160a01b0380821660009081526015602090815260408083209386168352929052205460ff1692915050565b60408051602081019091526000815260408051602081019091526000815260006117428686611e55565b6001600160a01b03851660009081526004909101602052604090205482525090509392505050565b6040805160808101825260008082526020820181905291810182905260608101919091526117988383611914565b604080516080810182528254815260018301546001600160401b0316602082015260028301549181019190915260039091015460608201529392505050565b604080516080810182526000808252602082018190529181018290526060810191909152611807858585856118a8565b604080516080810182528254815260018301546020820152600283015491810191909152600390910154606082015295945050505050565b60008061184b83611dfc565b600281111561185c5761185c6129e1565b141592915050565b600061072d8383611ed9565b6001600160a01b038281166000908152601b6020908152604080832093851683529290529081206001810154905461072d9190612c81565b6000601e60008660018111156118c0576118c06129e1565b60018111156118d1576118d16129e1565b8152602080820192909252604090810160009081206001600160a01b03978816825283528181209587168152948252808520939095168452919091525020919050565b6000601d600084600181111561192c5761192c6129e1565b600181111561193d5761193d6129e1565b81526020019081526020016000206000838152602001908152602001600020905092915050565b7f000000000000000000000000000000000000000000000000000000000000000090565b600081831115611998578161072d565b5090919050565b7f000000000000000000000000000000000000000000000000000000000000000090565b8015610d9557604051630852cd8d60e31b8152600481018290526001600160a01b038316906342966c6890602401600060405180830381600087803b1580156115db57600080fd5b8015611abd5760405163a9059cbb60e01b81526001600160a01b0383811660048301526024820183905284169063a9059cbb906044015b6020604051808303816000875af1158015611a61573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a859190612ca7565b611abd5760405162461bcd60e51b815260206004820152600960248201526810ba3930b739b332b960b91b604482015260640161095e565b505050565b6000611acd83611dfc565b90506001816002811115611ae357611ae36129e1565b14611b1a5760405162461bcd60e51b81526020600482015260076024820152662161637469766560c81b604482015260640161095e565b6001600160a01b038084166000908152600f6020908152604091829020825161012081018452815490941684526001810154918401919091526002810154918301919091526003810154606083015260048101546080830152600581015460a0830152600681015460c0830152600781015460e083015260080154610100820152611ba361222c565b6001600160a01b031663766718086040518163ffffffff1660e01b8152600401602060405180830381865afa158015611be0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c049190612ce8565b608082018190526060820151600091611c1c9161212e565b9050600082600001516001600160a01b0316336001600160a01b03161480611c4d5750611c4d3384600001516116e9565b600d54909150600160801b900463ffffffff1682111580611c7057506040830151155b15611caa5780611caa5760405162461bcd60e51b8152602060048201526005602482015264042c2eae8d60db1b604482015260640161095e565b604083015115611d6857808015611cc057508415155b15611cd857611cd3868460000151612337565b611ce5565b611ce5836020015161240b565b60408084015184516001600160a01b03166000908152600e6020529190912060010154611d129190612c81565b83516001600160a01b03166000908152600e602090815260408083206001019390935582860151818701518352601090915291902054611d529190612c81565b6020808501516000908152601090915260409020555b608080840180516001600160a01b03808a166000818152600f6020908152604091829020600401949094558389015189519551828b01518351918252958101959095523391850191909152606084018b9052861595840195909552939216907ff6725dd105a6fc88bb79a6e4627f128577186c567a17c94818d201c2a4ce14039060a00160405180910390a4505050505050565b6001600160a01b038082166000908152600f6020526040812080549192909116611e295750600092915050565b600381015415801590611e3e57506004810154155b15611e4c5750600192915050565b50600292915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031603611eae57506001600160a01b0382166000908152601460205260409020610730565b506001600160a01b038083166000908152602160209081526040808320938516835292905220610730565b600080611ee68484611e55565b9050806005015481600201546109109190612c81565b8015611abd576040516323b872dd60e01b81526001600160a01b038381166004830152306024830152604482018390528416906323b872dd90606401611a42565b600080611f4a8484612483565b905061072d81610c8861199f565b600082600003611f6a57506000610f1e565b7f000000000000000000000000000000000000000000000000000000000000000060008315801590611fa457506001600160a01b03821615155b90508080156120175750604051634c4ea0ed60e01b8152600481018790526001600160a01b03831690634c4ea0ed90602401602060405180830381865afa158015611ff3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120179190612ca7565b156121225760006120288686612483565b90508015612118576120386124d5565b6001600160a01b0316631d1c2fec886040518263ffffffff1660e01b815260040161206591815260200190565b6020604051808303816000875af1158015612084573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120a89190612ce8565b506120b68382610ca461199f565b60405163102ae65160e31b815260048101889052602481018290526001600160a01b03841690638157328890604401600060405180830381600087803b1580156120ff57600080fd5b505af1158015612113573d6000803e3d6000fd5b505050505b9250610f1e915050565b50600095945050505050565b600081831161213e57600061072d565b61072d8284612c81565b6001600160a01b038216600090815260146020526040812060028101548291901580159061218757508054600160401b900463ffffffff16620f424010155b156121d25780546000906121ad9063ffffffff600160401b90910481169087906124f916565b90506121b98186612c81565b92508282600201546121cb9190612c94565b6002830155505b509392505050565b826000036121e757505050565b80156121f757611abd8284612560565b6001600160a01b0380831660009081526017602052604090205416610cfe81156122215781612223565b835b85610ca461199f565b7f000000000000000000000000000000000000000000000000000000000000000090565b6001600160a01b0381166000908152600e6020526040812060028101546001820154600490920154839261228391612c94565b61228d9190612c94565b6001600160a01b0384166000908152600e60205260409020549091508181116122b7576000610910565b6109108282612c81565b6060600080846001600160a01b0316846040516122de9190612e24565b600060405180830381855af49150503d8060008114612319576040519150601f19603f3d011682016040523d82523d6000602084013e61231e565b606091505b509150915061232e8583836125df565b95945050505050565b60006123416124d5565b6001600160a01b031663db750926846040518263ffffffff1660e01b815260040161236c91906129cd565b6020604051808303816000875af115801561238b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123af9190612ce8565b9050806000036123be57505050565b60006123ca8383612632565b905060006123d88284612c81565b6001600160a01b03808616600090815260176020526040902054919250612404918391879116156121da565b5050505050565b6124136124d5565b6001600160a01b031663eeac3e0e826040518263ffffffff1660e01b815260040161244091815260200190565b6020604051808303816000875af115801561245f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d959190612ce8565b600061249282620f4240101590565b82906124b457604051633dc311df60e01b815260040161095e91815260200190565b506124cb836124c684620f4240612c81565b6124f9565b61072d9084612c81565b7f000000000000000000000000000000000000000000000000000000000000000090565b600061250883620f4240101590565b8061251b575061251b82620f4240101590565b838390916125455760405163768bf0eb60e11b81526004810192909252602482015260440161095e565b50620f424090506125568385612c48565b61072d9190612c5f565b6001600160a01b0382166000908152600e6020526040902054612584908290612c94565b6001600160a01b0383166000818152600e6020526040908190209290925590517f48c384dd8bdf1e06d8afecd810c4acfc3d553ac5d879dec5a69875dbbd90e14b906125d39084815260200190565b60405180910390a25050565b6060826125f4576125ef82612697565b610f1e565b815115801561260b57506001600160a01b0384163b155b1561262b5783604051639996b31560e01b815260040161095e91906129cd565b5080610f1e565b6001600160a01b038216600090815260146020526040812060028101548291901580159061267157508054600160201b900463ffffffff16620f424010155b156121d25780546000906121ad9063ffffffff600160201b90910481169087906124f916565b8051156126a75780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b50565b6040518060a0016040528060008152602001600081526020016000815260200160008152602001600081525090565b604051806040016040528060008152602001600081525090565b6001600160a01b03811681146126c057600080fd5b6000806040838503121561273457600080fd5b823561273f8161270c565b9150602083013561274f8161270c565b809150509250929050565b60006020828403121561276c57600080fd5b813561072d8161270c565b60006101408201905082518252602083015160208301526040830151604083015260608301516127af606084018263ffffffff169052565b5060808301516127ca60808401826001600160401b03169052565b5060a08301516127e560a08401826001600160401b03169052565b5060c08301516127fd60c084018263ffffffff169052565b5060e083015161281860e08401826001600160401b03169052565b5061010083015161010083015261012083015161012083015292915050565b80356002811061284657600080fd5b919050565b6000806000806080858703121561286157600080fd5b61286a85612837565b9350602085013561287a8161270c565b9250604085013561288a8161270c565b9150606085013561289a8161270c565b939692955090935050565b600080600080608085870312156128bb57600080fd5b84356128c68161270c565b93506020850135925060408501359150606085013561289a8161270c565b600080604083850312156128f757600080fd5b82356129028161270c565b946020939093013593505050565b60008060006060848603121561292557600080fd5b83356129308161270c565b925060208401356129408161270c565b915060408401356003811061295457600080fd5b809150509250925092565b60008060006060848603121561297457600080fd5b833561297f8161270c565b9250602084013561298f8161270c565b9150604084013563ffffffff8116811461295457600080fd5b600080604083850312156129bb57600080fd5b82359150602083013561274f8161270c565b6001600160a01b0391909116815260200190565b634e487b7160e01b600052602160045260246000fd5b6020810160038310612a1957634e487b7160e01b600052602160045260246000fd5b91905290565b600080600060408486031215612a3457600080fd5b8335612a3f8161270c565b925060208401356001600160401b03811115612a5a57600080fd5b8401601f81018613612a6b57600080fd5b80356001600160401b03811115612a8157600080fd5b866020828401011115612a9357600080fd5b939660209190910195509293505050565b60008060208385031215612ab757600080fd5b82356001600160401b03811115612acd57600080fd5b8301601f81018513612ade57600080fd5b80356001600160401b03811115612af457600080fd5b8560208260051b8401011115612b0957600080fd5b6020919091019590945092505050565b60005b83811015612b34578181015183820152602001612b1c565b50506000910152565b6000602082016020835280845180835260408501915060408160051b86010192506020860160005b82811015612bb157603f1987860301845281518051808752612b8e816020890160208501612b19565b601f01601f19169590950160209081019550938401939190910190600101612b65565b50929695505050505050565b600080600060608486031215612bd257600080fd5b8335612bdd8161270c565b92506020840135612bed8161270c565b915060408401356129548161270c565b60008060408385031215612c1057600080fd5b61290283612837565b600060208284031215612c2b57600080fd5b5035919050565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761073057610730612c32565b600082612c7c57634e487b7160e01b600052601260045260246000fd5b500490565b8181038181111561073057610730612c32565b8082018082111561073057610730612c32565b600060208284031215612cb957600080fd5b8151801515811461072d57600080fd5b92835260208301919091526001600160a01b0316604082015260600190565b600060208284031215612cfa57600080fd5b5051919050565b600060208284031215612d1357600080fd5b815161072d8161270c565b6020808252601e908201527f43616c6c6572206d757374206265207468652070726f78792061646d696e0000604082015260600190565b60208152816020820152818360408301376000818301604090810191909152601f909201601f19160101919050565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112612dc757600080fd5b8301803591506001600160401b03821115612de157600080fd5b602001915036819003821315612df657600080fd5b9250929050565b828482376000838201600081528351612e1a818360208801612b19565b0195945050505050565b60008251612e36818460208701612b19565b919091019291505056fea2646970667358221220eee2ca3f28b971ad70ed8bb53d0d0f8eb32b9f33a12776bc83fb4b7d1b75ddfd64736f6c634300081b00330000000000000000000000000750eda3185c758247e97819074bcd217a815fae00000000000000000000000000fe8f95407ab61863d27c07f584a0930ee5f3b0","id":1,"type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"HorizonStaking#HorizonStakingExtension","networkInteractionId":1,"nonce":1635,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"HorizonStaking#HorizonStakingExtension","networkInteractionId":1,"nonce":1635,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0x213c2c4d2cce26f8854a9809172af0563c5a8aed80010a9e6ad43ce731e3a9fd"},"type":"TRANSACTION_SEND"} +{"artifactId":"PaymentsEscrow#PaymentsEscrow","constructorArgs":["0x0750EdA3185C758247E97819074bCD217a815FaE",10000],"contractName":"PaymentsEscrow","dependencies":["Controller#Controller","GraphHorizon_Periphery","HorizonProxies"],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","futureId":"PaymentsEscrow#PaymentsEscrow","futureType":"CONTRACT_DEPLOYMENT","libraries":{},"strategy":"basic","strategyConfig":{},"type":"DEPLOYMENT_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"PaymentsEscrow#PaymentsEscrow","networkInteraction":{"data":"0x6101e060405234801561001157600080fd5b50604051611bb6380380611bb6833981016040819052610030916104ef565b816001600160a01b03811661007a5760405163218f5add60e11b815260206004820152600a60248201526921b7b73a3937b63632b960b11b60448201526064015b60405180910390fd5b6001600160a01b0381166101005260408051808201909152600a81526923b930b8342a37b5b2b760b11b60208201526100b290610373565b6001600160a01b03166080526040805180820190915260078152665374616b696e6760c81b60208201526100e590610373565b6001600160a01b031660a05260408051808201909152600d81526c47726170685061796d656e747360981b602082015261011e90610373565b6001600160a01b031660c05260408051808201909152600e81526d5061796d656e7473457363726f7760901b602082015261015890610373565b6001600160a01b031660e05260408051808201909152600c81526b22b837b1b426b0b730b3b2b960a11b602082015261019090610373565b6001600160a01b03166101205260408051808201909152600e81526d2932bbb0b93239a6b0b730b3b2b960911b60208201526101cb90610373565b6001600160a01b0316610140526040805180820190915260118152704772617068546f6b656e4761746577617960781b602082015261020990610373565b6001600160a01b03166101605260408051808201909152600f81526e23b930b834283937bc3ca0b236b4b760891b602082015261024590610373565b6001600160a01b03166101805260408051808201909152600881526721bab930ba34b7b760c11b602082015261027a90610373565b6001600160a01b039081166101a08190526101005160a05160805160c05160e05161012051610140516101605161018051604051988b169a9788169996909716977fef5021414834d86e36470f5c1cecf6544fb2bb723f2ca51a4c86fcd8c5919a43976103249790916001600160a01b03978816815295871660208701529386166040860152918516606085015284166080840152831660a083015290911660c082015260e00190565b60405180910390a450806276a7008082111561035c57604051635c0f65a160e01b815260048101929092526024820152604401610071565b50506101c081905261036c610421565b505061058b565b600080610100516001600160a01b031663f7641a5e84805190602001206040518263ffffffff1660e01b81526004016103ae91815260200190565b602060405180830381865afa1580156103cb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103ef919061051b565b9050826001600160a01b03821661041a5760405163218f5add60e11b8152600401610071919061053d565b5092915050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff16156104715760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b03908116146104d05780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b80516001600160a01b03811681146104ea57600080fd5b919050565b6000806040838503121561050257600080fd5b61050b836104d3565b9150602083015190509250929050565b60006020828403121561052d57600080fd5b610536826104d3565b9392505050565b602081526000825180602084015260005b8181101561056b576020818601810151604086840101520161054e565b506000604082850101526040601f19601f83011684010191505092915050565b60805160a05160c05160e05161010051610120516101405161016051610180516101a0516101c0516115b3610603600039600081816101350152610b4e015260005050600050506000505060005050600050506000610d910152600050506000610dd90152600050506000610db501526115b36000f3fe608060405234801561001057600080fd5b50600436106100a45760003560e01c80631230fa3e146100a957806372eb521e146100be5780637a8df28b146100d15780637b8ae6cf146101305780638129fc1c146101655780638340f5491461016d578063ac9650d814610180578063b1d07de4146101a0578063b2168b6b146101b3578063d6bd603c146101bd578063f93f1cd0146101d0578063f940e385146101e3575b600080fd5b6100bc6100b736600461111c565b6101f6565b005b6100bc6100cc36600461119a565b61058c565b6101106100df3660046111e5565b6000602081815293815260408082208552928152828120909352825290208054600182015460029092015490919083565b604080519384526020840192909252908201526060015b60405180910390f35b6101577f000000000000000000000000000000000000000000000000000000000000000081565b604051908152602001610127565b6100bc610625565b6100bc61017b366004611228565b61071d565b61019361018e366004611265565b6107b5565b60405161012791906112fe565b6100bc6101ae36600461137e565b61089d565b6101576276a70081565b6101576101cb3660046111e5565b6109e0565b6100bc6101de366004611228565b610a3e565b6100bc6101f136600461137e565b610bd1565b6101fe610d8f565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561023b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061025f91906113b1565b1561027d57604051639e68cf0b60e01b815260040160405180910390fd5b6001600160a01b038087166000908152602081815260408083203384528252808320938916835292905220805485808210156102da57604051633db4e69160e01b8152600481019290925260248201526044015b60405180910390fd5b5050848160000160008282546102f091906113e9565b9091555060009050610300610db3565b6001600160a01b03166370a08231306040518263ffffffff1660e01b815260040161032b91906113fc565b602060405180830381865afa158015610348573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061036c9190611410565b9050610376610db3565b6001600160a01b031663095ea7b361038c610dd7565b886040518363ffffffff1660e01b81526004016103aa929190611429565b6020604051808303816000875af11580156103c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103ed91906113b1565b506103f6610dd7565b6001600160a01b03166381cd11a08a89898989896040518763ffffffff1660e01b815260040161042b96959493929190611458565b600060405180830381600087803b15801561044557600080fd5b505af1158015610459573d6000803e3d6000fd5b505050506000610467610db3565b6001600160a01b03166370a08231306040518263ffffffff1660e01b815260040161049291906113fc565b602060405180830381865afa1580156104af573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104d39190611410565b90506104df81886114ae565b821482828990919261051557604051631f82726b60e21b81526004810193909352602483019190915260448201526064016102d1565b50339150506001600160a01b038a168b600281111561053657610536611442565b604080516001600160a01b038d81168252602082018d905289168183015290517f399b99b484be516eace7ececa486139581a25b0d2d12dac8bfa0948d07a8c9139181900360600190a450505050505050505050565b610594610d8f565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156105d1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105f591906113b1565b1561061357604051639e68cf0b60e01b815260040160405180910390fd5b61061f84848484610dfb565b50505050565b600061062f610eac565b805490915060ff600160401b82041615906001600160401b03166000811580156106565750825b90506000826001600160401b031660011480156106725750303b155b905081158015610680575080155b1561069e5760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff1916600117855583156106c857845460ff60401b1916600160401b1785555b6106d0610ed5565b831561071657845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b5050505050565b610725610d8f565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610762573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061078691906113b1565b156107a457604051639e68cf0b60e01b815260040160405180910390fd5b6107b033848484610dfb565b505050565b604080516000815260208101909152606090826001600160401b038111156107df576107df6114c1565b60405190808252806020026020018201604052801561081257816020015b60608152602001906001900390816107fd5790505b50915060005b838110156108945761086f30868684818110610836576108366114d7565b905060200281019061084891906114ed565b8560405160200161085b9392919061153a565b604051602081830303815290604052610edf565b838281518110610881576108816114d7565b6020908102919091010152600101610818565b50505b92915050565b6108a5610d8f565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108e2573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061090691906113b1565b1561092457604051639e68cf0b60e01b815260040160405180910390fd5b336000908152602081815260408083206001600160a01b03868116855290835281842090851684529091528120600181015490910361097657604051638cbd172f60e01b815260040160405180910390fd5b60018101805460028301805460009384905592905560408051828152602081018490529192916001600160a01b03868116929088169133917f6c4ed34e7347a8682024ee40d393e45f4075c46c593aaaed3cc3e49dd6933535910160405180910390a45050505050565b6001600160a01b038084166000908152602081815260408083208685168452825280832093851683529290529081206001810154815411610a22576000610a33565b60018101548154610a3391906113e9565b9150505b9392505050565b610a46610d8f565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a83573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aa791906113b1565b15610ac557604051639e68cf0b60e01b815260040160405180910390fd5b60008111610ae657604051633aff1f3760e21b815260040160405180910390fd5b336000908152602081815260408083206001600160a01b0387811685529083528184209086168452909152902080548280821015610b4057604051633db4e69160e01b8152600481019290925260248201526044016102d1565b505060018101829055610b737f0000000000000000000000000000000000000000000000000000000000000000426114ae565b600282018190556040516001600160a01b03808616929087169133917fba109e8a47e57c895aa1802554cd51025499c2b07c3c9b467c70413a4434ffbc91610bc391888252602082015260400190565b60405180910390a450505050565b610bd9610d8f565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c3a91906113b1565b15610c5857604051639e68cf0b60e01b815260040160405180910390fd5b336000908152602081815260408083206001600160a01b038681168552908352818420908516845290915281206002810154909103610caa57604051638cbd172f60e01b815260040160405180910390fd5b60028101544290818110610cda57604051633c50db7960e11b8152600481019290925260248201526044016102d1565b505060008160000154826001015411610cf7578160010154610cfa565b81545b905080826000016000828254610d1091906113e9565b90915550506000600183018190556002830155610d403382610d30610db3565b6001600160a01b03169190610f55565b826001600160a01b0316846001600160a01b0316336001600160a01b03167f3115d1449a7b732c986cba18244e897a450f61e1bb8d589cd2e69e6c8924f9f784604051610bc391815260200190565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b6001600160a01b038085166000908152602081815260408083208785168452825280832093861683529290529081208054839290610e3a9084906114ae565b90915550610e5d90503382610e4d610db3565b6001600160a01b03169190611004565b816001600160a01b0316836001600160a01b0316856001600160a01b03167f7cfff908a4b583f36430b25d75964c458d8ede8a99bd61be750e97ee1b2f3a9684604051610bc391815260200190565b6000807ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00610897565b610edd611045565b565b6060600080846001600160a01b031684604051610efc9190611561565b600060405180830381855af49150503d8060008114610f37576040519150601f19603f3d011682016040523d82523d6000602084013e610f3c565b606091505b5091509150610f4c85838361106a565b95945050505050565b80156107b05760405163a9059cbb60e01b81526001600160a01b0384169063a9059cbb90610f899085908590600401611429565b6020604051808303816000875af1158015610fa8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fcc91906113b1565b6107b05760405162461bcd60e51b815260206004820152600960248201526810ba3930b739b332b960b91b60448201526064016102d1565b80156107b0576040516323b872dd60e01b81526001600160a01b038381166004830152306024830152604482018390528416906323b872dd90606401610f89565b61104d6110bd565b610edd57604051631afcd79f60e31b815260040160405180910390fd5b60608261107f5761107a826110d7565b610a37565b815115801561109657506001600160a01b0384163b155b156110b65783604051639996b31560e01b81526004016102d191906113fc565b5080610a37565b60006110c7610eac565b54600160401b900460ff16919050565b8051156110e75780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b80356001600160a01b038116811461111757600080fd5b919050565b600080600080600080600060e0888a03121561113757600080fd5b87356003811061114657600080fd5b965061115460208901611100565b955061116260408901611100565b94506060880135935061117760808901611100565b925060a0880135915061118c60c08901611100565b905092959891949750929550565b600080600080608085870312156111b057600080fd5b6111b985611100565b93506111c760208601611100565b92506111d560408601611100565b9396929550929360600135925050565b6000806000606084860312156111fa57600080fd5b61120384611100565b925061121160208501611100565b915061121f60408501611100565b90509250925092565b60008060006060848603121561123d57600080fd5b61124684611100565b925061125460208501611100565b929592945050506040919091013590565b6000806020838503121561127857600080fd5b82356001600160401b0381111561128e57600080fd5b8301601f8101851361129f57600080fd5b80356001600160401b038111156112b557600080fd5b8560208260051b84010111156112ca57600080fd5b6020919091019590945092505050565b60005b838110156112f55781810151838201526020016112dd565b50506000910152565b6000602082016020835280845180835260408501915060408160051b86010192506020860160005b8281101561137257603f198786030184528151805180875261134f8160208901602085016112da565b601f01601f19169590950160209081019550938401939190910190600101611326565b50929695505050505050565b6000806040838503121561139157600080fd5b61139a83611100565b91506113a860208401611100565b90509250929050565b6000602082840312156113c357600080fd5b81518015158114610a3757600080fd5b634e487b7160e01b600052601160045260246000fd5b81810381811115610897576108976113d3565b6001600160a01b0391909116815260200190565b60006020828403121561142257600080fd5b5051919050565b6001600160a01b03929092168252602082015260400190565b634e487b7160e01b600052602160045260246000fd5b60c081016003881061147a57634e487b7160e01b600052602160045260246000fd5b9681526001600160a01b03958616602082015260408101949094529184166060840152608083015290911660a09091015290565b80820180821115610897576108976113d3565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261150457600080fd5b8301803591506001600160401b0382111561151e57600080fd5b60200191503681900382131561153357600080fd5b9250929050565b8284823760008382016000815283516115578183602088016112da565b0195945050505050565b600082516115738184602087016112da565b919091019291505056fea26469706673582212208ab10e801fa2cc0d10964181f12d884e2488e415d888ab908ab3d257d0bef82f64736f6c634300081b00330000000000000000000000000750eda3185c758247e97819074bcd217a815fae0000000000000000000000000000000000000000000000000000000000002710","id":1,"type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"PaymentsEscrow#PaymentsEscrow","networkInteractionId":1,"nonce":1636,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"PaymentsEscrow#PaymentsEscrow","networkInteractionId":1,"nonce":1636,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0x9f4dbfbc9f11f599b263432a593e0b3481c1d19c9770ad873646f382ab6211b5"},"type":"TRANSACTION_SEND"} +{"futureId":"GraphPayments#GraphPayments","hash":"0xc54d915f9d9de3516d7f8da7284b32a11ea95d988a1d316f57ac8cad01fc99d1","networkInteractionId":1,"receipt":{"blockHash":"0xc67d1dae236ca96b7fdbecb80999775084cf055942f92d0331c41acb16986bf4","blockNumber":152513111,"contractAddress":"0x4756cdF556A78BD28399E833Bc5bBFc7a5bca866","logs":[{"address":"0x4756cdF556A78BD28399E833Bc5bBFc7a5bca866","data":"0x000000000000000000000000afd60629034fbdc3ef58518b817bbdb4ec861c9300000000000000000000000070d5afaaaef8f2f095e83d6e6151146c18a5bb85000000000000000000000000aa1debfb7a7c0ba85cef858b6e70cfad943fd4a20000000000000000000000001ab05a65fa6d5f6a90a23693d5d40a4d927a815f0000000000000000000000007284213d1cda80c892a4388f38da431f063431440000000000000000000000001cebe1c314cc454baf4bd553409d957c833623c0000000000000000000000000e135bfd9e51bbafcebb0141af85f0bc6da1b3ba4","logIndex":0,"topics":["0xef5021414834d86e36470f5c1cecf6544fb2bb723f2ca51a4c86fcd8c5919a43","0x000000000000000000000000bbcb9a575176039c06f94d4d8337818318a26828","0x000000000000000000000000f5d432192daf7e8b045349693577ccf0b5165a12","0x0000000000000000000000000750eda3185c758247e97819074bcd217a815fae"]},{"address":"0x4756cdF556A78BD28399E833Bc5bBFc7a5bca866","data":"0x000000000000000000000000000000000000000000000000ffffffffffffffff","logIndex":1,"topics":["0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2"]}],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"GraphPayments#GraphPayments","result":{"address":"0x4756cdF556A78BD28399E833Bc5bBFc7a5bca866","type":"SUCCESS"},"type":"DEPLOYMENT_EXECUTION_STATE_COMPLETE"} +{"futureId":"GraphTallyCollector#GraphTallyCollector","hash":"0xa8d55ccd6bc05af4e50ce1c6cf5ecd5c5a4cfc076b22aca3e7eb2b4c2f5ea8aa","networkInteractionId":1,"receipt":{"blockHash":"0x4b9f570ba9ce50d91b932d1dce3ad0b963c991bdc294875911e8a4ebc22cf59a","blockNumber":152513124,"contractAddress":"0xB63bC33D13F73eFD14d32D2b9FC0B6116B6611CE","logs":[{"address":"0xB63bC33D13F73eFD14d32D2b9FC0B6116B6611CE","data":"0x000000000000000000000000afd60629034fbdc3ef58518b817bbdb4ec861c9300000000000000000000000070d5afaaaef8f2f095e83d6e6151146c18a5bb85000000000000000000000000aa1debfb7a7c0ba85cef858b6e70cfad943fd4a20000000000000000000000001ab05a65fa6d5f6a90a23693d5d40a4d927a815f0000000000000000000000007284213d1cda80c892a4388f38da431f063431440000000000000000000000001cebe1c314cc454baf4bd553409d957c833623c0000000000000000000000000e135bfd9e51bbafcebb0141af85f0bc6da1b3ba4","logIndex":0,"topics":["0xef5021414834d86e36470f5c1cecf6544fb2bb723f2ca51a4c86fcd8c5919a43","0x000000000000000000000000bbcb9a575176039c06f94d4d8337818318a26828","0x000000000000000000000000f5d432192daf7e8b045349693577ccf0b5165a12","0x0000000000000000000000000750eda3185c758247e97819074bcd217a815fae"]}],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"GraphTallyCollector#GraphTallyCollector","result":{"address":"0xB63bC33D13F73eFD14d32D2b9FC0B6116B6611CE","type":"SUCCESS"},"type":"DEPLOYMENT_EXECUTION_STATE_COMPLETE"} +{"futureId":"HorizonStaking#HorizonStakingExtension","hash":"0x213c2c4d2cce26f8854a9809172af0563c5a8aed80010a9e6ad43ce731e3a9fd","networkInteractionId":1,"receipt":{"blockHash":"0x073946eaafa3672c85dadb4fc254fb1b9a5e552fce5563417b2d2436fc590b7c","blockNumber":152513137,"contractAddress":"0x37F125cF456CD8d24277033A3b583491E9003689","logs":[{"address":"0x37F125cF456CD8d24277033A3b583491E9003689","data":"0x000000000000000000000000afd60629034fbdc3ef58518b817bbdb4ec861c9300000000000000000000000070d5afaaaef8f2f095e83d6e6151146c18a5bb85000000000000000000000000aa1debfb7a7c0ba85cef858b6e70cfad943fd4a20000000000000000000000001ab05a65fa6d5f6a90a23693d5d40a4d927a815f0000000000000000000000007284213d1cda80c892a4388f38da431f063431440000000000000000000000001cebe1c314cc454baf4bd553409d957c833623c0000000000000000000000000e135bfd9e51bbafcebb0141af85f0bc6da1b3ba4","logIndex":1,"topics":["0xef5021414834d86e36470f5c1cecf6544fb2bb723f2ca51a4c86fcd8c5919a43","0x000000000000000000000000bbcb9a575176039c06f94d4d8337818318a26828","0x000000000000000000000000f5d432192daf7e8b045349693577ccf0b5165a12","0x0000000000000000000000000750eda3185c758247e97819074bcd217a815fae"]}],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"HorizonStaking#HorizonStakingExtension","result":{"address":"0x37F125cF456CD8d24277033A3b583491E9003689","type":"SUCCESS"},"type":"DEPLOYMENT_EXECUTION_STATE_COMPLETE"} +{"futureId":"PaymentsEscrow#PaymentsEscrow","hash":"0x9f4dbfbc9f11f599b263432a593e0b3481c1d19c9770ad873646f382ab6211b5","networkInteractionId":1,"receipt":{"blockHash":"0xd8c258686edecc8506e66a437ed8ace4ccbeb6554a557bee328ac012180aa96b","blockNumber":152513149,"contractAddress":"0xeED33B904efF05BbdcC9008F5174088DF77dD183","logs":[{"address":"0xeED33B904efF05BbdcC9008F5174088DF77dD183","data":"0x000000000000000000000000afd60629034fbdc3ef58518b817bbdb4ec861c9300000000000000000000000070d5afaaaef8f2f095e83d6e6151146c18a5bb85000000000000000000000000aa1debfb7a7c0ba85cef858b6e70cfad943fd4a20000000000000000000000001ab05a65fa6d5f6a90a23693d5d40a4d927a815f0000000000000000000000007284213d1cda80c892a4388f38da431f063431440000000000000000000000001cebe1c314cc454baf4bd553409d957c833623c0000000000000000000000000e135bfd9e51bbafcebb0141af85f0bc6da1b3ba4","logIndex":0,"topics":["0xef5021414834d86e36470f5c1cecf6544fb2bb723f2ca51a4c86fcd8c5919a43","0x000000000000000000000000bbcb9a575176039c06f94d4d8337818318a26828","0x000000000000000000000000f5d432192daf7e8b045349693577ccf0b5165a12","0x0000000000000000000000000750eda3185c758247e97819074bcd217a815fae"]},{"address":"0xeED33B904efF05BbdcC9008F5174088DF77dD183","data":"0x000000000000000000000000000000000000000000000000ffffffffffffffff","logIndex":1,"topics":["0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2"]}],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"PaymentsEscrow#PaymentsEscrow","result":{"address":"0xeED33B904efF05BbdcC9008F5174088DF77dD183","type":"SUCCESS"},"type":"DEPLOYMENT_EXECUTION_STATE_COMPLETE"} +{"args":[],"artifactId":"GraphPayments#GraphPayments","dependencies":["GraphPayments#GraphPayments"],"functionName":"initialize","futureId":"GraphPayments#encodeFunctionCall(GraphPayments#GraphPayments.initialize)","result":"0x8129fc1c","strategy":"basic","strategyConfig":{},"type":"ENCODE_FUNCTION_CALL_EXECUTION_STATE_INITIALIZE"} +{"artifactId":"HorizonStaking#HorizonStaking","constructorArgs":["0x0750EdA3185C758247E97819074bCD217a815FaE","0x37F125cF456CD8d24277033A3b583491E9003689","0x00fe8F95407AB61863d27c07F584A0930ee5F3b0"],"contractName":"HorizonStaking","dependencies":["Controller#Controller","HorizonStaking#HorizonStakingExtension"],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","futureId":"HorizonStaking#HorizonStaking","futureType":"CONTRACT_DEPLOYMENT","libraries":{},"strategy":"basic","strategyConfig":{},"type":"DEPLOYMENT_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"HorizonStaking#HorizonStaking","networkInteraction":{"data":"0x61020060405234801561001157600080fd5b506040516162a33803806162a38339810160408190526100309161041b565b828181806001600160a01b03811661007d5760405163218f5add60e11b815260206004820152600a60248201526921b7b73a3937b63632b960b11b60448201526064015b60405180910390fd5b6001600160a01b0381166101005260408051808201909152600a81526923b930b8342a37b5b2b760b11b60208201526100b590610351565b6001600160a01b03166080526040805180820190915260078152665374616b696e6760c81b60208201526100e890610351565b6001600160a01b031660a05260408051808201909152600d81526c47726170685061796d656e747360981b602082015261012190610351565b6001600160a01b031660c05260408051808201909152600e81526d5061796d656e7473457363726f7760901b602082015261015b90610351565b6001600160a01b031660e05260408051808201909152600c81526b22b837b1b426b0b730b3b2b960a11b602082015261019390610351565b6001600160a01b03166101205260408051808201909152600e81526d2932bbb0b93239a6b0b730b3b2b960911b60208201526101ce90610351565b6001600160a01b0316610140526040805180820190915260118152704772617068546f6b656e4761746577617960781b602082015261020c90610351565b6001600160a01b03166101605260408051808201909152600f81526e23b930b834283937bc3ca0b236b4b760891b602082015261024890610351565b6001600160a01b03166101805260408051808201909152600881526721bab930ba34b7b760c11b602082015261027d90610351565b6001600160a01b039081166101a08190526101005160a05160805160c05160e05161012051610140516101605161018051604051988b169a9788169996909716977fef5021414834d86e36470f5c1cecf6544fb2bb723f2ca51a4c86fcd8c5919a43976103279790916001600160a01b03978816815295871660208701529386166040860152918516606085015284166080840152831660a083015290911660c082015260e00190565b60405180910390a450506001600160a01b039081166101c052929092166101e052506104ce915050565b600080610100516001600160a01b031663f7641a5e84805190602001206040518263ffffffff1660e01b815260040161038c91815260200190565b602060405180830381865afa1580156103a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103cd919061045e565b9050826001600160a01b0382166103f85760405163218f5add60e11b81526004016100749190610480565b5092915050565b80516001600160a01b038116811461041657600080fd5b919050565b60008060006060848603121561043057600080fd5b610439846103ff565b9250610447602085016103ff565b9150610455604085016103ff565b90509250925092565b60006020828403121561047057600080fd5b610479826103ff565b9392505050565b602081526000825180602084015260005b818110156104ae5760208186018101516040868401015201610491565b506000604082850101526040601f19601f83011684010191505092915050565b60805160a05160c05160e05161010051610120516101405161016051610180516101a0516101c0516101e051615d2861057b6000396000818161025b0152818161055e01526128a3015260008181610a450152818161140a015281816130de015281816131a001528181614130015261447401526000505060005050600050506000505060006114e901526000613097015260005050600050506000505060006135670152615d286000f3fe608060405234801561001057600080fd5b50600436106102565760003560e01c8063872d048911610142578063872d0489146106225780638cc01c86146106355780639ce7abe514610663578063a02b942614610676578063a2594d8214610689578063a2a317221461069c578063a694fc3a146106af578063a784d498146106c2578063ac9650d8146106d5578063ad4d35b5146106f5578063ae4fe67a14610708578063ba7fb0b414610734578063bc735d9014610747578063ca94b0e91461075a578063ccebcabb1461076d578063d48de8451461078f578063e473522a146107de578063e56f8a1d146107e6578063e76fede61461082c578063ef58bd671461083f578063f64b359814610847578063f93f1cd01461085a578063fb744cc01461086d578063fc54fb2714610880578063fecc9cc11461088b57610256565b8063010167e51461029f578063026e402b146102b257806308ce5f68146102c557806321195373146102eb578063259bc435146102fe57806325d9897e146103115780632e17de78146104395780632f7cc5011461044c57806339514ad21461045f5780633993d8491461047a5780633a78b7321461048d5780633ccfd60b146104a057806342c51693146104a85780634ca7ac22146104bb5780634d99dd16146104ce57806351a60b02146104e1578063561285e4146104f45780636230001a1461054957806366ee1b281461055c578063746120921461058a5780637573ef4f1461059d5780637a766460146105b05780637c145cc7146105d957806381e21b56146105fc57806382d66cb81461060f575b6040517f00000000000000000000000000000000000000000000000000000000000000009036600082376000803683855af43d806000843e818015610299578184f35b8184fd5b005b61029d6102ad3660046151dc565b61089e565b61029d6102c036600461523e565b61097a565b6102d86102d336600461526a565b610a70565b6040519081526020015b60405180910390f35b61029d6102f93660046152a3565b610a85565b61029d61030c3660046152e4565b610b55565b61042c61031f36600461526a565b6040805161014081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101829052610120810191909152506001600160a01b039182166000908152601b6020908152604080832093909416825291825282902082516101408101845281548152600182015492810192909252600281015492820192909252600382015463ffffffff8082166060840152600160201b82046001600160401b039081166080850152600160601b8304811660a0850152600160a01b830490911660c0840152600160c01b9091041660e0820152600482015461010082015260059091015461012082015290565b6040516102e291906152ff565b61029d6104473660046153bf565b610c43565b6102d861045a3660046153e5565b610cd6565b601a546040516001600160401b0390911681526020016102e2565b61029d6104883660046152a3565b610dd8565b61029d61049b366004615441565b610e74565b61029d611040565b61029d6104b636600461546d565b6110d2565b61029d6104c93660046154ca565b611283565b61029d6104dc36600461523e565b61137d565b6102d86104ef36600461526a565b61142f565b61050761050236600461526a565b611629565b6040516102e29190600060a082019050825182526020830151602083015260408301516040830152606083015160608301526080830151608083015292915050565b61029d6105573660046154f8565b61167b565b7f00000000000000000000000000000000000000000000000000000000000000006040516102e2919061553e565b61029d6105983660046152a3565b611742565b6102d86105ab366004615552565b61182e565b6102d86105be366004615441565b6001600160a01b03166000908152600e602052604090205490565b6105ec6105e7366004615599565b611892565b60405190151581526020016102e2565b61029d61060a3660046155e4565b61189f565b61029d61061d3660046151dc565b611b18565b6102d861063036600461563c565b611c1e565b610648610643366004615441565b611c73565b604080518251815260209283015192810192909252016102e2565b61029d61067136600461567a565b611caf565b6102d86106843660046152a3565b611daa565b61029d610697366004615441565b611e3e565b61029d6106aa36600461523e565b611f22565b61029d6106bd3660046153bf565b611fb3565b6102d86106d0366004615441565b612044565b6106e86106e33660046156ff565b61204f565b6040516102e29190615798565b61029d610703366004615818565b612136565b6105ec610716366004615441565b6001600160a01b031660009081526022602052604090205460ff1690565b61029d610742366004615858565b612204565b61029d610755366004615818565b612311565b61029d6107683660046152a3565b6123a3565b61078061077b366004615599565b6125dd565b604051905181526020016102e2565b6107a261079d366004615899565b61262f565b6040516102e29190815181526020808301516001600160401b031690820152604080830151908201526060918201519181019190915260800190565b61029d61269c565b6107f96107f43660046153e5565b61276e565b6040516102e291908151815260208083015190820152604080830151908201526060918201519181019190915260800190565b61029d61083a3660046158b7565b6127d6565b61029d612d38565b61029d6108553660046158f6565b612e0a565b6102d86108683660046152a3565b612eed565b6102d861087b36600461526a565b612fc1565b60205460ff166105ec565b61029d6108993660046152a3565b612fcd565b6108a6613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108e3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109079190615964565b1561092557604051632b37d9d160e21b815260040160405180910390fd5b84846109328282336130b9565b82823390919261096157604051630c76b97b60e41b815260040161095893929190615981565b60405180910390fd5b505050610971878688878761317d565b50505050505050565b610982613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156109bf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109e39190615964565b15610a0157604051632b37d9d160e21b815260040160405180910390fd5b80600003610a2257604051630a2a4e5b60e11b815260040160405180910390fd5b610a3f3382610a2f613565565b6001600160a01b03169190613589565b610a6c827f0000000000000000000000000000000000000000000000000000000000000000836000613641565b5050565b6000610a7c8383613846565b90505b92915050565b8282610a928282336130b9565b828233909192610ab857604051630c76b97b60e41b815260040161095893929190615981565b505050610ac3613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b00573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b249190615964565b15610b4257604051632b37d9d160e21b815260040160405180910390fd5b610b4d85858561387e565b505050505050565b610b5d613095565b6001600160a01b0316634fc07d756040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b9a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bbe91906159a4565b6001600160a01b0316336001600160a01b031614610bef57604051635d9044cd60e01b815260040160405180910390fd5b601a80546001600160401b0319166001600160401b0383169081179091556040519081527fe8526be46fa99b6313d439293c9be3491ffb067741bc8fce9d30c270cbb8459f9060200160405180910390a150565b610c4b613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c88573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cac9190615964565b15610cca57604051632b37d9d160e21b815260040160405180910390fd5b610cd3816139af565b50565b600080610ce586868686613b5c565b90508060030154600003610cfd576000915050610dd0565b6001600160a01b038086166000908152601b6020908152604080832093881683529290529081206001810154600282015484545b8015610dc7576000610d438c83613bc8565b90508460050154816003015403610dbc576001810154426001600160401b0390911611610db657600083858360000154610d7d91906159d7565b610d8791906159ee565b9050610d938186615a10565b8254909550610da29085615a10565b9350610dae8188615a23565b965050610dbc565b50610dc7565b600201549050610d31565b50929450505050505b949350505050565b610de0613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e1d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e419190615964565b15610e5f57604051632b37d9d160e21b815260040160405180910390fd5b610e6f8383600080600086613c18565b505050565b610e7c613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610eb9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610edd9190615964565b15610efb57604051632b37d9d160e21b815260040160405180910390fd5b6001600160a01b0381166000908152601b60209081526040808320338085529252909120600381015483908390600160601b90046001600160401b0316610f57576040516330acea0d60e11b8152600401610958929190615a36565b50506003810154600160a01b810463ffffffff9081169116141580610f9a57506003810154600160c01b81046001600160401b03908116600160201b9092041614155b15610e6f57600381018054600160201b6001600160401b03600160c01b63ffffffff19841663ffffffff600160a01b8604811691821792909204831684026001600160601b03199095161793909317938490556040516001600160a01b0380881695908916947fa4c005afae9298a5ca51e7710c334ac406fb3d914588ade970850f917cedb1c694611033949183169392041690615a50565b60405180910390a3505050565b611048613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611085573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110a99190615964565b156110c757604051632b37d9d160e21b815260040160405180910390fd5b6110d033613d9e565b565b6110da613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611117573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061113b9190615964565b1561115957604051632b37d9d160e21b815260040160405180910390fd5b83836111668282336130b9565b82823390919261118c57604051630c76b97b60e41b815260040161095893929190615981565b50505061119c83620f4240101590565b83906111be57604051631504950160e21b815260040161095891815260200190565b506001600160a01b038087166000908152601c60209081526040808320938916835292905290812084918660028111156111fa576111fa615a6f565b600281111561120b5761120b615a6f565b815260208101919091526040016000205583600281111561122e5761122e615a6f565b856001600160a01b0316876001600160a01b03167f3474eba30406cacbfbc5a596a7e471662bbcccf206f8d244dbb6f4cc578c52208660405161127391815260200190565b60405180910390a4505050505050565b61128b613095565b6001600160a01b0316634fc07d756040518163ffffffff1660e01b8152600401602060405180830381865afa1580156112c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112ec91906159a4565b6001600160a01b0316336001600160a01b03161461131d57604051635d9044cd60e01b815260040160405180910390fd5b6001600160a01b038216600081815260226020908152604091829020805460ff191685151590811790915591519182527f4542960abc7f2d26dab244fc440acf511e3dd0f5cefad571ca802283b4751bbb91015b60405180910390a25050565b611385613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156113c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113e69190615964565b1561140457604051632b37d9d160e21b815260040160405180910390fd5b610e6f827f000000000000000000000000000000000000000000000000000000000000000083613e79565b6000611439613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611476573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061149a9190615964565b156114b857604051632b37d9d160e21b815260040160405180910390fd5b6001600160a01b038316600090815260146020908152604080832033808552600482019093529083209192909190807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663766718086040518163ffffffff1660e01b8152600401602060405180830381865afa158015611545573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115699190615a85565b905060008360020154118015611583575082600201548110155b1561159057826001015491505b600082116115b05760405162cf4d4760e51b815260040160405180910390fd5b60006001840181905560028401556040518281526001600160a01b0386811691908a16907f1b2e7737e043c5cf1b587ceb4daeb7ae00148b9bda8f79f1093eead08f1419529060200160405180910390a361161e858361160e613565565b6001600160a01b031691906140f1565b509695505050505050565b61163161514b565b61163961514b565b6000611645858561412c565b60028101548352600381015460208401526005810154604084015260068101546060840152600701546080830152509392505050565b611683613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156116c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116e49190615964565b1561170257604051632b37d9d160e21b815260040160405180910390fd5b8160000361172357604051630a2a4e5b60e11b815260040160405180910390fd5b6117303383610a2f613565565b61173c84848484613641565b50505050565b61174a613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611787573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117ab9190615964565b156117c957604051632b37d9d160e21b815260040160405180910390fd5b82826117d68282336130b9565b806117e95750336001600160a01b038216145b82823390919261180f57604051630c76b97b60e41b815260040161095893929190615981565b50505061181c85846141b0565b6118278585856141e8565b5050505050565b6001600160a01b038084166000908152601c6020908152604080832093861683529290529081208183600281111561186857611868615a6f565b600281111561187957611879615a6f565b81526020019081526020016000205490505b9392505050565b6000610dd08484846130b9565b6118a7613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156118e4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119089190615964565b1561192657604051632b37d9d160e21b815260040160405180910390fd5b83836119338282336130b9565b82823390919261195957604051630c76b97b60e41b815260040161095893929190615981565b5050506001600160a01b038681166000908152601b60209081526040808320938916835292905220600381015487908790600160601b90046001600160401b03166119b9576040516330acea0d60e11b8152600401610958929190615a36565b50506003810154600160a01b810463ffffffff908116908716141590600160c01b90046001600160401b03908116908616141581806119f55750805b15611b0d578115611a56578663ffffffff8116620f42401015611a34576040516329bff5f560e01b815263ffffffff9091166004820152602401610958565b5060038301805463ffffffff60a01b1916600160a01b63ffffffff8a16021790555b8015611ab657601a5486906001600160401b03908116908216811015611a915760405163ee5602e160e01b8152600401610958929190615a9e565b50506003830180546001600160c01b0316600160c01b6001600160401b038916021790555b428360040181905550876001600160a01b0316896001600160a01b03167fe89cbb9d63ba60af555547b12dde6817283e88cbdd45feb2059f2ba71ea346ba8989604051611b04929190615a50565b60405180910390a35b505050505050505050565b611b20613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611b5d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b819190615964565b15611b9f57604051632b37d9d160e21b815260040160405180910390fd5b8484611bac8282336130b9565b828233909192611bd257604051630c76b97b60e41b815260040161095893929190615981565b5050506001600160a01b038616600090815260226020526040902054869060ff16611c1057604051622920f760e21b8152600401610958919061553e565b50610971878688878761317d565b600080611c2b8585613846565b90506000611c398686614328565b90506000611c4d63ffffffff8616846159d7565b90506000611c5b838361434b565b9050611c678185615a23565b98975050505050505050565b611c7b61517a565b611c8361517a565b6001600160a01b039092166000908152600e602090815260409091208054845260040154908301525090565b82806001600160a01b031663f851a4406040518163ffffffff1660e01b81526004016020604051808303816000875af1158015611cf0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d1491906159a4565b6001600160a01b0316336001600160a01b031614611d445760405162461bcd60e51b815260040161095890615ab8565b60405163623faf6160e01b81526001600160a01b0385169063623faf6190611d729086908690600401615aef565b600060405180830381600087803b158015611d8c57600080fd5b505af1158015611da0573d6000803e3d6000fd5b5050505050505050565b6000611db4613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611df1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e159190615964565b15611e3357604051632b37d9d160e21b815260040160405180910390fd5b610dd0848484613e79565b80806001600160a01b031663f851a4406040518163ffffffff1660e01b81526004016020604051808303816000875af1158015611e7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ea391906159a4565b6001600160a01b0316336001600160a01b031614611ed35760405162461bcd60e51b815260040161095890615ab8565b816001600160a01b03166359fc20bb6040518163ffffffff1660e01b8152600401600060405180830381600087803b158015611f0e57600080fd5b505af1158015610b4d573d6000803e3d6000fd5b611f2a613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611f67573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f8b9190615964565b15611fa957604051632b37d9d160e21b815260040160405180910390fd5b610a6c82826141b0565b611fbb613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611ff8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061201c9190615964565b1561203a57604051632b37d9d160e21b815260040160405180910390fd5b610cd333826141b0565b6000610a7f82614362565b604080516000815260208101909152606090826001600160401b0381111561207957612079615b1e565b6040519080825280602002602001820160405280156120ac57816020015b60608152602001906001900390816120975790505b50915060005b8381101561212e57612109308686848181106120d0576120d0615b34565b90506020028101906120e29190615b4a565b856040516020016120f593929190615b90565b6040516020818303038152906040526143d3565b83828151811061211b5761211b615b34565b60209081029190910101526001016120b2565b505092915050565b61213e613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561217b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061219f9190615964565b156121bd57604051632b37d9d160e21b815260040160405180910390fd5b6001600160a01b038316600090815260226020526040902054839060ff166121f857604051622920f760e21b8152600401610958919061553e565b50610e6f838383614449565b61220c613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612249573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061226d9190615964565b1561228b57604051632b37d9d160e21b815260040160405180910390fd5b83836122988282336130b9565b8282339091926122be57604051630c76b97b60e41b815260040161095893929190615981565b50505085846122ce8282336130b9565b8282339091926122f457604051630c76b97b60e41b815260040161095893929190615981565b505050600061230489898861387e565b9050611b0d8988836141e8565b612319613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612356573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061237a9190615964565b1561239857604051632b37d9d160e21b815260040160405180910390fd5b610e6f838383614449565b6123ab613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156123e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061240c9190615964565b1561242a57604051632b37d9d160e21b815260040160405180910390fd5b8060000361244b57604051630a2a4e5b60e11b815260040160405180910390fd5b6001600160a01b038084166000908152601b6020908152604080832093861683529281529082902082516101408101845281548152600182015492810192909252600281015492820192909252600382015463ffffffff80821660608401526001600160401b03600160201b830481166080850152600160601b8304811660a08501819052600160a01b840490921660c0850152600160c01b90920490911660e08301526004830154610100830152600590920154610120820152908490849061252a576040516330acea0d60e11b8152600401610958929190615a36565b50506000612538858561412c565b90506000816003015411858590916125655760405163b6a70b3b60e01b8152600401610958929190615a36565b50508281600201546125779190615a23565b60028201556125893384610a2f613565565b836001600160a01b0316856001600160a01b03167f673007a04e501145e79f59aea5e0413b6e88344fdaf10326254530d6a1511530856040516125ce91815260200190565b60405180910390a35050505050565b6040805160208101909152600081526040805160208101909152600081526000612607868661412c565b6001600160a01b03851660009081526004909101602052604090205482525090509392505050565b60408051608081018252600080825260208201819052918101829052606081019190915261265d8383613bc8565b604080516080810182528254815260018301546001600160401b0316602082015260028301549181019190915260039091015460608201529392505050565b6126a4613095565b6001600160a01b0316634fc07d756040518163ffffffff1660e01b8152600401602060405180830381865afa1580156126e1573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061270591906159a4565b6001600160a01b0316336001600160a01b03161461273657604051635d9044cd60e01b815260040160405180910390fd5b600d805463ffffffff191690556040517f93be484d290d119d9cf99cce69d173c732f9403333ad84f69c807b590203d10990600090a1565b60408051608081018252600080825260208201819052918101829052606081019190915261279e85858585613b5c565b604080516080810182528254815260018301546020820152600283015491810191909152600390910154606082015295945050505050565b6127de613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561281b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061283f9190615964565b1561285d57604051632b37d9d160e21b815260040160405180910390fd5b3360009081526012602052604090205460ff1615612966576040516001600160a01b038581166024830152604482018590526064820184905282811660848301526000917f00000000000000000000000000000000000000000000000000000000000000009091169060a40160408051601f198184030181529181526020820180516001600160e01b031663224451c160e11b179052516128fe9190615bb7565b600060405180830381855af49150503d8060008114612939576040519150601f19603f3d011682016040523d82523d6000602084013e61293e565b606091505b50509050806129605760405163ef370f5160e01b815260040160405180910390fd5b5061173c565b6001600160a01b0384166000908152601b6020908152604080832033808552925282209091612995878461412c565b90506000816002015483600001546129ad9190615a23565b9050806000036129d057604051630a8a55c960e31b815260040160405180910390fd5b60006129dc888361434b565b905060006129ee85600001548361434b565b90508015612be8576003850154600090612a1390839063ffffffff9081169061457916565b9050888181811015612a3a57604051632f514d5760e21b8152600401610958929190615bd3565b50508815612aa757612a4f888a61160e613565565b876001600160a01b0316876001600160a01b03168c6001600160a01b03167f95ff4196cd75fa49180ba673948ea43935f59e7c4ba101fa09b9fe0ec266d5828c604051612a9e91815260200190565b60405180910390a45b612acb612ab48a84615a10565b612abc613565565b6001600160a01b0316906145d9565b8554612ad78382615a10565b8760010154612ae691906159d7565b612af091906159ee565b60018701558554612b02908390615a10565b8655600286015415801590612b1957506001860154155b15612b3d5760006002870181905560058701805491612b3783615be1565b91905055505b6001600160a01b038b166000908152600e6020526040902060040154612b64908390615a10565b6001600160a01b038c166000908152600e60205260409020600481019190915554612b90908390615a10565b6001600160a01b038c81166000818152600e60209081526040918290209490945551858152918a169290917fe7b110f13cde981d5079ab7faa4249c5f331f5c292dbc6031969d2ce694188a3910160405180910390a3505b612bf28183615a10565b91508115612d2c5760205460ff1615612cde57612c1182612abc613565565b6002840154612c208382615a10565b8560050154612c2f91906159d7565b612c3991906159ee565b60058501556002840154612c4e908390615a10565b6002850155600684015415801590612c6857506005840154155b15612c8c5760006006850181905560078501805491612c8683615be1565b91905055505b856001600160a01b03168a6001600160a01b03167fc5d16dbb577cf07678b577232717c9a606197a014f61847e623d47fc6bf6b77184604051612cd191815260200190565b60405180910390a3612d2c565b856001600160a01b03168a6001600160a01b03167fdce44f0aeed2089c75db59f5a517b9a19a734bf0213412fa129f0d0434126b2484604051612d2391815260200190565b60405180910390a35b50505050505050505050565b612d40613095565b6001600160a01b0316634fc07d756040518163ffffffff1660e01b8152600401602060405180830381865afa158015612d7d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612da191906159a4565b6001600160a01b0316336001600160a01b031614612dd257604051635d9044cd60e01b815260040160405180910390fd5b6020805460ff191660011790556040517f2192802a8934dbf383338406b279ec7f3eccee31e58d6c0444d6dd6bfff24b3590600090a1565b612e12613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612e4f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e739190615964565b15612e9157604051632b37d9d160e21b815260040160405180910390fd5b6001600160a01b038416612eb8576040516322347d6760e21b815260040160405180910390fd5b6001600160a01b038316612edf5760405163a962605960e01b815260040160405180910390fd5b610b4d868686868686613c18565b6000612ef7613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612f34573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f589190615964565b15612f7657604051632b37d9d160e21b815260040160405180910390fd5b8383612f838282336130b9565b828233909192612fa957604051630c76b97b60e41b815260040161095893929190615981565b505050612fb7868686614621565b9695505050505050565b6000610a7c8383614328565b612fd5613095565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015613012573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130369190615964565b1561305457604051632b37d9d160e21b815260040160405180910390fd5b82826130618282336130b9565b82823390919261308757604051630c76b97b60e41b815260040161095893929190615981565b5050506118278585856141e8565b7f000000000000000000000000000000000000000000000000000000000000000090565b6000836001600160a01b0316826001600160a01b0316036130dc5750600161188b565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b03160361314457506001600160a01b0380841660009081526015602090815260408083209385168352929052205460ff1661188b565b506001600160a01b038084166000908152601f60209081526040808320868516845282528083209385168352929052205460ff1661188b565b6000841161319e57604051630a2a4e5b60e11b815260040160405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b031614806131e45750600d5463ffffffff16155b83906132045760405163353666ff60e01b8152600401610958919061553e565b508163ffffffff8116620f42401015613239576040516329bff5f560e01b815263ffffffff9091166004820152602401610958565b50601a5481906001600160401b0390811690821681101561326f5760405163ee5602e160e01b8152600401610958929190615a9e565b50506001600160a01b038581166000908152601b6020908152604080832093871683529290522060030154600160601b90046001600160401b0316156132c857604051632b542c0d60e11b815260040160405180910390fd5b60006132d386614362565b90508481808211156132fa5760405163ccaf28a960e01b8152600401610958929190615bd3565b505060405180610140016040528086815260200160008152602001600081526020018463ffffffff168152602001836001600160401b03168152602001426001600160401b031681526020018463ffffffff168152602001836001600160401b03168152602001600081526020016000815250601b6000886001600160a01b03166001600160a01b031681526020019081526020016000206000866001600160a01b03166001600160a01b0316815260200190815260200160002060008201518160000155602082015181600101556040820151816002015560608201518160030160006101000a81548163ffffffff021916908363ffffffff16021790555060808201518160030160046101000a8154816001600160401b0302191690836001600160401b0316021790555060a082015181600301600c6101000a8154816001600160401b0302191690836001600160401b0316021790555060c08201518160030160146101000a81548163ffffffff021916908363ffffffff16021790555060e08201518160030160186101000a8154816001600160401b0302191690836001600160401b03160217905550610100820151816004015561012082015181600501559050506000600e6000886001600160a01b03166001600160a01b0316815260200190815260200160002090508581600401546134fa9190615a23565b60048201556040805187815263ffffffff861660208201526001600160401b0385168183015290516001600160a01b0387811692908a16917f88b4c2d08cea0f01a24841ff5d14814ddb5b14ac44b05e0835fcc0dcd8c7bc259181900360600190a350505050505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b8015610e6f576040516323b872dd60e01b81526001600160a01b038381166004830152306024830152604482018390528416906323b872dd906064015b6020604051808303816000875af11580156135e5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906136099190615964565b610e6f5760405162461bcd60e51b815260206004820152600960248201526810ba3930b739b332b960b91b6044820152606401610958565b81670de0b6b3a76400008082101561366e5760405163b86d885760e01b8152600401610958929190615bd3565b50506001600160a01b038481166000908152601b602090815260408083209387168352929052206003015484908490600160601b90046001600160401b03166136cc576040516330acea0d60e11b8152600401610958929190615a36565b505060006136da858561412c565b336000908152600482016020526040902060028201549192509015158061370357506003820154155b8686909161372657604051631984edef60e31b8152600401610958929190615a36565b50506000826002015460001480613744575082600501548360020154145b905060008161377f57836005015484600201546137619190615a10565b600385015461377090886159d7565b61377a91906159ee565b613781565b855b905080158015906137925750848110155b818690916137b557604051635d88e8d160e01b8152600401610958929190615bd3565b50508584600201546137c79190615a23565b600285015560038401546137dc908290615a23565b600385015582546137ee908290615a23565b835560405133906001600160a01b0389811691908b16907f237818af8bb47710142edd8fc301fbc507064fb357cf122fb161ca447e3cb13e90613834908b908790615bd3565b60405180910390a45050505050505050565b6001600160a01b038281166000908152601b60209081526040808320938516835292905290812060018101549054610a7c9190615a10565b6001600160a01b038381166000818152601b60209081526040808320948716808452948252808320600281015460018201548351610100810185528681529485018790529284019690965260608301949094526080820181905260a0820185905260c08201869052600584015460e08301529193849290916138ff816147b3565b875492965094509250613913908590615a10565b855560028501839055600185018290556001600160a01b0389166000908152600e60205260408120600401805486929061394e908490615a10565b92505081905550876001600160a01b0316896001600160a01b03167f9008d731ddfbec70bc364780efd63057c6877bee8027c4708a104b365395885d8660405161399a91815260200190565b60405180910390a35091979650505050505050565b3360008290036139d257604051630a2a4e5b60e11b815260040160405180910390fd5b60006139dd82614362565b9050828180821115613a045760405163ccaf28a960e01b8152600401610958929190615bd3565b50506001600160a01b0382166000908152600e602052604081208054600d549192909163ffffffff1690819003613a9657613a3f8683615a10565b8355613a4e858761160e613565565b846001600160a01b03167f32eed9ebc5696170068a371fdbea4c076da1bc21b305e78ca0a5e65ee913be8387604051613a8991815260200190565b60405180910390a2610b4d565b600283015415801590613aad575082600301544310155b15613abb57613abb85613d9e565b600283015415613ae557613ae2613ad68460030154436148ad565b846002015483896148c7565b90505b858360020154613af59190615a23565b6002840155613b048143615a23565b6003840181905560028401546040516001600160a01b038816927f91642f23a1196e1424949fafa2a428c3b5d1f699763942ff08a6fbe9d4d7e98092613b4c92909190615bd3565b60405180910390a2505050505050565b6000601e6000866001811115613b7457613b74615a6f565b6001811115613b8557613b85615a6f565b8152602080820192909252604090810160009081206001600160a01b03978816825283528181209587168152948252808520939095168452919091525020919050565b6000601d6000846001811115613be057613be0615a6f565b6001811115613bf157613bf1615a6f565b81526020019081526020016000206000838152602001908152602001600020905092915050565b6000613c24878761412c565b905080600201546000141580613c3c57506003810154155b87879091613c5f57604051631984edef60e31b8152600401610958929190615a36565b5050600681015460058201546040805161010081018252600181526001600160a01b03808c1660208301528a16918101919091523360608201526080810182905260a0810183905260c08101859052600784015460e08201526000929190613cc6816147b3565b600288015492965094509250613cdd908590615a10565b600286015560068501839055600585018290558315613d91576001600160a01b03891615801590613d1657506001600160a01b03881615155b15613d2c57613d278989868a613641565b613d91565b613d39338561160e613565565b336001600160a01b03168a6001600160a01b03168c6001600160a01b03167f305f519d8909c676ffd870495d4563032eb0b506891a6dd9827490256cc9914e87604051613d8891815260200190565b60405180910390a45b5050505050505050505050565b6001600160a01b0381166000908152600e6020526040812060028101549091819003613ddd57604051630a2a4e5b60e11b815260040160405180910390fd5b600382015443811115613e0657604051631d222f1b60e31b815260040161095891815260200190565b5060006002830181905560038301558154613e22908290615a10565b8255613e31838261160e613565565b826001600160a01b03167f32eed9ebc5696170068a371fdbea4c076da1bc21b305e78ca0a5e65ee913be8382604051613e6c91815260200190565b60405180910390a2505050565b6000808211613e9b57604051637318ad9960e01b815260040160405180910390fd5b6000613ea7858561412c565b33600090815260048201602052604090208054919250908480821015613ee25760405163ab99793560e01b8152600401610958929190615bd3565b5050600282015486908690613f0c57604051631984edef60e31b8152600401610958929190615a36565b50506000826003015483600501548460020154613f299190615a10565b613f3390876159d7565b613f3d91906159ee565b905060008360050154600014613f705760058401546006850154613f6190846159d7565b613f6b91906159ee565b613f72565b815b6001600160a01b038981166000908152601b60209081526040808320938c1683529290529081206003015491925090613fbb90600160201b90046001600160401b031642615a23565b9050828560050154613fcd9190615a23565b60058601556006850154613fe2908390615a23565b60068601556003850154613ff7908890615a10565b60038601558354614009908890615a10565b8085551561407557600085600301548660050154876002015461402c9190615a10565b865461403891906159d7565b61404291906159ee565b905080670de0b6b3a7640000808210156140715760405163587ab9ab60e11b8152600401610958929190615bd3565b5050505b600061408b60018b8b3387878c6007015461491b565b9050336001600160a01b0316896001600160a01b03168b6001600160a01b03167f0525d6ad1aa78abc571b5c1984b5e1ea4f1412368c1cc348ca408dbb1085c9a1878c6040516140dc929190615bd3565b60405180910390a49998505050505050505050565b8015610e6f5760405163a9059cbb60e01b81526001600160a01b0383811660048301526024820183905284169063a9059cbb906044016135c6565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b03160361418557506001600160a01b0382166000908152601460205260409020610a7f565b506001600160a01b038083166000908152602160209081526040808320938516835292905220610a7f565b806000036141d157604051630a2a4e5b60e11b815260040160405180910390fd5b6141de3382610a2f613565565b610a6c8282614ac1565b8060000361420957604051630a2a4e5b60e11b815260040160405180910390fd5b6001600160a01b038381166000908152601b60209081526040808320938616835292905220600381015484908490600160601b90046001600160401b0316614266576040516330acea0d60e11b8152600401610958929190615a36565b5050600061427385614362565b905082818082111561429a5760405163ccaf28a960e01b8152600401610958929190615bd3565b505081546142a9908490615a23565b82556001600160a01b0385166000908152600e60205260409020600401546142d2908490615a23565b6001600160a01b038681166000818152600e602090815260409182902060040194909455518681529187169290917feaf6ea3a42ed2fd1b6d575f818cbda593af9524aa94bd30e65302ac4dc23474591016125ce565b600080614335848461412c565b905080600501548160020154610dd09190615a10565b60008183111561435b5781610a7c565b5090919050565b6001600160a01b0381166000908152600e6020526040812060028101546001820154600490920154839261439591615a23565b61439f9190615a23565b6001600160a01b0384166000908152600e60205260409020549091508181116143c9576000610dd0565b610dd08282615a10565b6060600080846001600160a01b0316846040516143f09190615bb7565b600060405180830381855af49150503d806000811461442b576040519150601f19603f3d011682016040523d82523d6000602084013e614430565b606091505b5091509150614440858383614b34565b95945050505050565b336001600160a01b0383160361447257604051630123065360e01b815260040160405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b0316036144df573360009081526015602090815260408083206001600160a01b03861684529091529020805460ff191682151517905561451b565b336000908152601f602090815260408083206001600160a01b03878116855290835281842090861684529091529020805460ff19168215151790555b816001600160a01b0316836001600160a01b0316336001600160a01b03167faa5a59b38e8f68292982382bf635c2f263ca37137bbc52956acd808fd7bf976f8460405161456c911515815260200190565b60405180910390a4505050565b600061458883620f4240101590565b8061459b575061459b82620f4240101590565b838390916145be5760405163768bf0eb60e11b8152600401610958929190615bd3565b50620f424090506145cf83856159d7565b610a7c91906159ee565b8015610a6c57604051630852cd8d60e31b8152600481018290526001600160a01b038316906342966c6890602401600060405180830381600087803b158015611f0e57600080fd5b60008160000361464457604051630a2a4e5b60e11b815260040160405180910390fd5b60006146508585613846565b90508083808210156146775760405163587ab9ab60e11b8152600401610958929190615bd3565b50506001600160a01b038086166000908152601b6020908152604080832093881683529290529081206001810154909190156146ec578160010154600183600101548785600201546146c991906159d7565b6146d39190615a23565b6146dd9190615a10565b6146e791906159ee565b6146ee565b845b600383015490915060009061471390600160201b90046001600160401b031642615a23565b90508183600201546147259190615a23565b6002840155600183015461473a908790615a23565b8360010181905550600061475860008a8a8c87878a6005015461491b565b9050876001600160a01b0316896001600160a01b03167f3b81913739097ced1e7fa748c6058d34e2c00b961fb501094543b397b198fdaa8960405161479f91815260200190565b60405180910390a398975050505050505050565b6000806000806147d58560000151866020015187604001518860600151613b5c565b905060008160030154116147fc576040516307e332c560e31b815260040160405180910390fd5b60006148088683614b87565b905085604001516001600160a01b031686602001516001600160a01b03168760000151600181111561483c5761483c615a6f565b6060808a01518551602080880151604080516001600160a01b039095168552918401929092528201527f86c2f162872d7c46d7ee0caad366da6dc430889b9d8f27e4bed3785548f9954b910160405180910390a4602081015160408201516060909201519097919650945092505050565b60008183116148bd576000610a7c565b610a7c8284615a10565b60006148d38285615a23565b60016148df8487615a23565b6148e99190615a10565b6148f384866159d7565b6148fd87896159d7565b6149079190615a23565b6149119190615a23565b61444091906159ee565b60008360000361493e57604051637318ad9960e01b815260040160405180910390fd5b600061494c89898989613b5c565b90506103e88160030154106149745760405163332b852b60e11b815260040160405180910390fd5b60028101546040516001600160601b031960608b811b821660208401528a811b8216603484015289901b166048820152605c810191909152600090607c0160405160208183030381529060405280519060200120905060006149d68b83613bc8565b8781556001810180546001600160401b0319166001600160401b03891617905560006002820155600380820187905584015490915015614a245781614a1f8c8560010154613bc8565b600201555b614a2e8383614c82565b886001600160a01b03168a6001600160a01b03168c6001811115614a5457614a54615a6f565b604080516001600160a01b038d168152602081018c90526001600160401b038b168183015260608101879052608081018a905290517f036538df4a591a5cc74b68cfc7f8c61e8173dbc81627e1d62600b61e820461789181900360a00190a4509998505050505050505050565b6001600160a01b0382166000908152600e6020526040902054614ae5908290615a23565b6001600160a01b0383166000818152600e6020526040908190209290925590517f48c384dd8bdf1e06d8afecd810c4acfc3d553ac5d879dec5a69875dbbd90e14b906113719084815260200190565b606082614b4957614b4482614d15565b61188b565b8151158015614b6057506001600160a01b0384163b155b15614b805783604051639996b31560e01b8152600401610958919061553e565b508061188b565b614bb26040518060800160405280600081526020016000815260200160008152602001600081525090565b615194614bc28460000151614d3e565b9050615194614bd48560000151614da3565b905060008560000151600087608001518860a001518960e00151604051602001614c02959493929190615bfa565b6040516020818303038152906040529050600080614c3785614dea86868c60c001518c614f5a9095949392919063ffffffff16565b91509150600080600083806020019051810190614c549190615c3d565b60408051608081018252998a5260208a019390935291880152606087015250939a9950505050505050505050565b612710826003015410614ca8576040516303a8c56b60e61b815260040160405180910390fd5b80614cc657604051638f4a893d60e01b815260040160405180910390fd5b6001808301829055600283018054600090614ce2908490615a23565b90915550506003820154600003614cf7578082555b6001826003016000828254614d0c9190615a23565b90915550505050565b805115614d255780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b6151946000826001811115614d5557614d55615a6f565b03614d635750615014919050565b6001826001811115614d7757614d77615a6f565b03614d855750615056919050565b604051636bd1fba760e11b815260040160405180910390fd5b919050565b6151946000826001811115614dba57614dba615a6f565b03614dc85750615062919050565b6001826001811115614ddc57614ddc615a6f565b03614d8557506150b9919050565b60006060600080600080600087806020019051810190614e0a9190615c7c565b945094509450945094506000614e20868b613bc8565b6001810154909150426001600160401b039091161115614e5b5760016040518060200160405280600081525097509750505050505050614f53565b600381015460009083148015614eae5782548590614e7a9088906159d7565b614e8491906159ee565b9150614e908287615a10565b8354909650614e9f9086615a10565b9450614eab8288615a23565b96505b8b886001811115614ec157614ec1615a6f565b845460018601546040805187815260208101939093526001600160401b03909116828201528415156060830152517f469e89d0a4e0e5deb2eb1ade5b3fa67fdfbeb4787c3a7c1e8e89aaf28562cab29181900360800190a38787878787604051602001614f32959493929190615bfa565b6040516020818303038152906040529a5060008b9950995050505050505050505b9250929050565b600060608760030154831115614f8357604051634a411b9d60e11b815260040160405180910390fd5b60008315614f915783614f97565b88600301545b89549094505b8015801590614fac5750600085115b1561500557600080614fc283898c63ffffffff16565b915091508115614fd3575050615005565b965086614fe18c8c8b6150c4565b925086614fed81615cc5565b9750508380614ffb90615be1565b9450505050614f9d565b50989397509295505050505050565b6000601d81805b600181111561502c5761502c615a6f565b81526020019081526020016000206000838152602001908152602001600020600201549050919050565b6000601d81600161501b565b601d6000805b600181111561507957615079615a6f565b8152602080820192909252604090810160009081209381529290915281208181556001810180546001600160401b03191690556002810182905560030155565b601d60006001615068565b6000808460030154116150ea5760405163ddaf8f2160e01b815260040160405180910390fd5b60006150fd85600001548563ffffffff16565b905061511085600001548463ffffffff16565b60018560030160008282546151259190615a10565b9091555050808555600385015460000361514157600060018601555b5050915492915050565b6040518060a0016040528060008152602001600081526020016000815260200160008152602001600081525090565b604051806040016040528060008152602001600081525090565b6110d0615cdc565b6001600160a01b0381168114610cd357600080fd5b803563ffffffff81168114614d9e57600080fd5b80356001600160401b0381168114614d9e57600080fd5b600080600080600060a086880312156151f457600080fd5b85356151ff8161519c565b9450602086013561520f8161519c565b935060408601359250615224606087016151b1565b9150615232608087016151c5565b90509295509295909350565b6000806040838503121561525157600080fd5b823561525c8161519c565b946020939093013593505050565b6000806040838503121561527d57600080fd5b82356152888161519c565b915060208301356152988161519c565b809150509250929050565b6000806000606084860312156152b857600080fd5b83356152c38161519c565b925060208401356152d38161519c565b929592945050506040919091013590565b6000602082840312156152f657600080fd5b610a7c826151c5565b6000610140820190508251825260208301516020830152604083015160408301526060830151615337606084018263ffffffff169052565b50608083015161535260808401826001600160401b03169052565b5060a083015161536d60a08401826001600160401b03169052565b5060c083015161538560c084018263ffffffff169052565b5060e08301516153a060e08401826001600160401b03169052565b5061010083015161010083015261012083015161012083015292915050565b6000602082840312156153d157600080fd5b5035919050565b60028110610cd357600080fd5b600080600080608085870312156153fb57600080fd5b8435615406816153d8565b935060208501356154168161519c565b925060408501356154268161519c565b915060608501356154368161519c565b939692955090935050565b60006020828403121561545357600080fd5b813561188b8161519c565b803560038110614d9e57600080fd5b6000806000806080858703121561548357600080fd5b843561548e8161519c565b9350602085013561549e8161519c565b92506154ac6040860161545e565b9396929550929360600135925050565b8015158114610cd357600080fd5b600080604083850312156154dd57600080fd5b82356154e88161519c565b91506020830135615298816154bc565b6000806000806080858703121561550e57600080fd5b84356155198161519c565b935060208501356155298161519c565b93969395505050506040820135916060013590565b6001600160a01b0391909116815260200190565b60008060006060848603121561556757600080fd5b83356155728161519c565b925060208401356155828161519c565b91506155906040850161545e565b90509250925092565b6000806000606084860312156155ae57600080fd5b83356155b98161519c565b925060208401356155c98161519c565b915060408401356155d98161519c565b809150509250925092565b600080600080608085870312156155fa57600080fd5b84356156058161519c565b935060208501356156158161519c565b9250615623604086016151b1565b9150615631606086016151c5565b905092959194509250565b60008060006060848603121561565157600080fd5b833561565c8161519c565b9250602084013561566c8161519c565b9150615590604085016151b1565b60008060006040848603121561568f57600080fd5b833561569a8161519c565b925060208401356001600160401b038111156156b557600080fd5b8401601f810186136156c657600080fd5b80356001600160401b038111156156dc57600080fd5b8660208284010111156156ee57600080fd5b939660209190910195509293505050565b6000806020838503121561571257600080fd5b82356001600160401b0381111561572857600080fd5b8301601f8101851361573957600080fd5b80356001600160401b0381111561574f57600080fd5b8560208260051b840101111561576457600080fd5b6020919091019590945092505050565b60005b8381101561578f578181015183820152602001615777565b50506000910152565b6000602082016020835280845180835260408501915060408160051b86010192506020860160005b8281101561580c57603f19878603018452815180518087526157e9816020890160208501615774565b601f01601f191695909501602090810195509384019391909101906001016157c0565b50929695505050505050565b60008060006060848603121561582d57600080fd5b83356158388161519c565b925060208401356158488161519c565b915060408401356155d9816154bc565b6000806000806080858703121561586e57600080fd5b84356158798161519c565b935060208501356158898161519c565b925060408501356154ac8161519c565b600080604083850312156158ac57600080fd5b823561525c816153d8565b600080600080608085870312156158cd57600080fd5b84356158d88161519c565b9350602085013592506040850135915060608501356154368161519c565b60008060008060008060c0878903121561590f57600080fd5b863561591a8161519c565b9550602087013561592a8161519c565b9450604087013561593a8161519c565b9350606087013561594a8161519c565b9598949750929560808101359460a0909101359350915050565b60006020828403121561597657600080fd5b815161188b816154bc565b6001600160a01b0393841681529183166020830152909116604082015260600190565b6000602082840312156159b657600080fd5b815161188b8161519c565b634e487b7160e01b600052601160045260246000fd5b8082028115828204841417610a7f57610a7f6159c1565b600082615a0b57634e487b7160e01b600052601260045260246000fd5b500490565b81810381811115610a7f57610a7f6159c1565b80820180821115610a7f57610a7f6159c1565b6001600160a01b0392831681529116602082015260400190565b63ffffffff9290921682526001600160401b0316602082015260400190565b634e487b7160e01b600052602160045260246000fd5b600060208284031215615a9757600080fd5b5051919050565b6001600160401b0392831681529116602082015260400190565b6020808252601e908201527f43616c6c6572206d757374206265207468652070726f78792061646d696e0000604082015260600190565b60208152816020820152818360408301376000818301604090810191909152601f909201601f19160101919050565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112615b6157600080fd5b8301803591506001600160401b03821115615b7b57600080fd5b602001915036819003821315614f5357600080fd5b828482376000838201600081528351615bad818360208801615774565b0195945050505050565b60008251615bc9818460208701615774565b9190910192915050565b918252602082015260400190565b600060018201615bf357615bf36159c1565b5060010190565b60a0810160028710615c1c57634e487b7160e01b600052602160045260246000fd5b95815260208101949094526040840192909252606083015260809091015290565b60008060008060808587031215615c5357600080fd5b8451615c5e816153d8565b60208601516040870151606090970151919890975090945092505050565b600080600080600060a08688031215615c9457600080fd5b8551615c9f816153d8565b602087015160408801516060890151608090990151929a91995097965090945092505050565b600081615cd457615cd46159c1565b506000190190565b634e487b7160e01b600052605160045260246000fdfea2646970667358221220f5046670ab269f9c179f41df4a02cd9c6b2ca3d5d507e2b9fcf15f800f351d8b64736f6c634300081b00330000000000000000000000000750eda3185c758247e97819074bcd217a815fae00000000000000000000000037f125cf456cd8d24277033a3b583491e900368900000000000000000000000000fe8f95407ab61863d27c07f584a0930ee5f3b0","id":1,"type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"HorizonStaking#HorizonStaking","networkInteractionId":1,"nonce":1637,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"HorizonStaking#HorizonStaking","networkInteractionId":1,"nonce":1637,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0x2a5ffad459b93c91f5c424cfbeffebaacb562267c9ab73071d75dc33af9f9438"},"type":"TRANSACTION_SEND"} +{"args":[],"artifactId":"PaymentsEscrow#PaymentsEscrow","dependencies":["PaymentsEscrow#PaymentsEscrow"],"functionName":"initialize","futureId":"PaymentsEscrow#encodeFunctionCall(PaymentsEscrow#PaymentsEscrow.initialize)","result":"0x8129fc1c","strategy":"basic","strategyConfig":{},"type":"ENCODE_FUNCTION_CALL_EXECUTION_STATE_INITIALIZE"} +{"futureId":"HorizonStaking#HorizonStaking","hash":"0x2a5ffad459b93c91f5c424cfbeffebaacb562267c9ab73071d75dc33af9f9438","networkInteractionId":1,"receipt":{"blockHash":"0x0adf90fe6c00cde565ac95a23687261ccdb8b317ba79cb614e03a4d9dace35ae","blockNumber":152513180,"contractAddress":"0xa9B5CD0E94eBDf5A6dBB16A01635D432AB707244","logs":[{"address":"0xa9B5CD0E94eBDf5A6dBB16A01635D432AB707244","data":"0x000000000000000000000000afd60629034fbdc3ef58518b817bbdb4ec861c9300000000000000000000000070d5afaaaef8f2f095e83d6e6151146c18a5bb85000000000000000000000000aa1debfb7a7c0ba85cef858b6e70cfad943fd4a20000000000000000000000001ab05a65fa6d5f6a90a23693d5d40a4d927a815f0000000000000000000000007284213d1cda80c892a4388f38da431f063431440000000000000000000000001cebe1c314cc454baf4bd553409d957c833623c0000000000000000000000000e135bfd9e51bbafcebb0141af85f0bc6da1b3ba4","logIndex":0,"topics":["0xef5021414834d86e36470f5c1cecf6544fb2bb723f2ca51a4c86fcd8c5919a43","0x000000000000000000000000bbcb9a575176039c06f94d4d8337818318a26828","0x000000000000000000000000f5d432192daf7e8b045349693577ccf0b5165a12","0x0000000000000000000000000750eda3185c758247e97819074bcd217a815fae"]}],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"HorizonStaking#HorizonStaking","result":{"address":"0xa9B5CD0E94eBDf5A6dBB16A01635D432AB707244","type":"SUCCESS"},"type":"DEPLOYMENT_EXECUTION_STATE_COMPLETE"} +{"args":["0xAFd60629034fBdC3ef58518B817bBDB4EC861c93","0x4756cdF556A78BD28399E833Bc5bBFc7a5bca866","0x8129fc1c"],"artifactId":"HorizonProxies#ProxyAdmin_GraphPayments","contractAddress":"0xAcA3dd622e863E425Cdb15E8734a5CB318448db7","dependencies":["HorizonProxies#ProxyAdmin_GraphPayments","HorizonProxies#GraphPayments_ProxyWithABI","GraphPayments#GraphPayments","GraphPayments#encodeFunctionCall(GraphPayments#GraphPayments.initialize)"],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","functionName":"upgradeAndCall","futureId":"GraphPayments#HorizonProxies~ProxyAdmin_GraphPayments.upgradeAndCall","strategy":"basic","strategyConfig":{},"type":"CALL_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"GraphPayments#HorizonProxies~ProxyAdmin_GraphPayments.upgradeAndCall","networkInteraction":{"data":"0x9623609d000000000000000000000000afd60629034fbdc3ef58518b817bbdb4ec861c930000000000000000000000004756cdf556a78bd28399e833bc5bbfc7a5bca866000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000048129fc1c00000000000000000000000000000000000000000000000000000000","id":1,"to":"0xAcA3dd622e863E425Cdb15E8734a5CB318448db7","type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"GraphPayments#HorizonProxies~ProxyAdmin_GraphPayments.upgradeAndCall","networkInteractionId":1,"nonce":1638,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"GraphPayments#HorizonProxies~ProxyAdmin_GraphPayments.upgradeAndCall","networkInteractionId":1,"nonce":1638,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0xb6458ef6f53df617eb6e698b0127d8a04e227ac5af0ea7b896af4ba5b6e5d5ae"},"type":"TRANSACTION_SEND"} +{"args":["0xF5D432192dAF7e8B045349693577ccF0B5165A12","0xa9B5CD0E94eBDf5A6dBB16A01635D432AB707244"],"artifactId":"GraphProxyAdmin#GraphProxyAdmin","contractAddress":"0x1CEBe1C314Cc454baf4bd553409d957C833623c0","dependencies":["GraphProxyAdmin#GraphProxyAdmin","HorizonProxies#GraphProxy","HorizonStaking#HorizonStaking"],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","functionName":"upgrade","futureId":"HorizonStaking#GraphProxyAdmin~GraphProxyAdmin.upgrade","strategy":"basic","strategyConfig":{},"type":"CALL_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"HorizonStaking#GraphProxyAdmin~GraphProxyAdmin.upgrade","networkInteraction":{"data":"0x99a88ec4000000000000000000000000f5d432192daf7e8b045349693577ccf0b5165a12000000000000000000000000a9b5cd0e94ebdf5a6dbb16a01635d432ab707244","id":1,"to":"0x1CEBe1C314Cc454baf4bd553409d957C833623c0","type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"HorizonStaking#GraphProxyAdmin~GraphProxyAdmin.upgrade","networkInteractionId":1,"nonce":1639,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"HorizonStaking#GraphProxyAdmin~GraphProxyAdmin.upgrade","networkInteractionId":1,"nonce":1639,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0x4030ee34b16e126a67328280bfdb6bdabbf829de8fbe790b282a6bd332429cbf"},"type":"TRANSACTION_SEND"} +{"args":["0x70d5AFAAaEF8f2F095E83D6E6151146c18A5Bb85","0xeED33B904efF05BbdcC9008F5174088DF77dD183","0x8129fc1c"],"artifactId":"HorizonProxies#ProxyAdmin_PaymentsEscrow","contractAddress":"0xbB643167f03EfF532c537e3d72E56b9992CaD985","dependencies":["HorizonProxies#ProxyAdmin_PaymentsEscrow","HorizonProxies#PaymentsEscrow_ProxyWithABI","PaymentsEscrow#PaymentsEscrow","PaymentsEscrow#encodeFunctionCall(PaymentsEscrow#PaymentsEscrow.initialize)"],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","functionName":"upgradeAndCall","futureId":"PaymentsEscrow#HorizonProxies~ProxyAdmin_PaymentsEscrow.upgradeAndCall","strategy":"basic","strategyConfig":{},"type":"CALL_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"PaymentsEscrow#HorizonProxies~ProxyAdmin_PaymentsEscrow.upgradeAndCall","networkInteraction":{"data":"0x9623609d00000000000000000000000070d5afaaaef8f2f095e83d6e6151146c18a5bb85000000000000000000000000eed33b904eff05bbdcc9008f5174088df77dd183000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000048129fc1c00000000000000000000000000000000000000000000000000000000","id":1,"to":"0xbB643167f03EfF532c537e3d72E56b9992CaD985","type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"PaymentsEscrow#HorizonProxies~ProxyAdmin_PaymentsEscrow.upgradeAndCall","networkInteractionId":1,"nonce":1640,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"PaymentsEscrow#HorizonProxies~ProxyAdmin_PaymentsEscrow.upgradeAndCall","networkInteractionId":1,"nonce":1640,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0x83d3b50e1f7def264180b768dfd5ae7f7dea0d6a6249ea87bc10064980a5f36b"},"type":"TRANSACTION_SEND"} +{"futureId":"GraphPayments#HorizonProxies~ProxyAdmin_GraphPayments.upgradeAndCall","hash":"0xb6458ef6f53df617eb6e698b0127d8a04e227ac5af0ea7b896af4ba5b6e5d5ae","networkInteractionId":1,"receipt":{"blockHash":"0x4a9bb6a8f5323f117a03aca0654a6b582f8b4788ca70aeecbf348d911646a319","blockNumber":152513202,"logs":[{"address":"0xAFd60629034fBdC3ef58518B817bBDB4EC861c93","data":"0x","logIndex":0,"topics":["0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b","0x0000000000000000000000004756cdf556a78bd28399e833bc5bbfc7a5bca866"]},{"address":"0xAFd60629034fBdC3ef58518B817bBDB4EC861c93","data":"0x0000000000000000000000000000000000000000000000000000000000000001","logIndex":1,"topics":["0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2"]}],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"GraphPayments#HorizonProxies~ProxyAdmin_GraphPayments.upgradeAndCall","result":{"type":"SUCCESS"},"type":"CALL_EXECUTION_STATE_COMPLETE"} +{"futureId":"HorizonStaking#GraphProxyAdmin~GraphProxyAdmin.upgrade","hash":"0x4030ee34b16e126a67328280bfdb6bdabbf829de8fbe790b282a6bd332429cbf","networkInteractionId":1,"receipt":{"blockHash":"0x7fa141baa0db73416d8107f6492e6270402318676c4d343e426e3f07a292ae88","blockNumber":152513213,"logs":[{"address":"0xF5D432192dAF7e8B045349693577ccF0B5165A12","data":"0x","logIndex":0,"topics":["0x980c0d30fe97457c47903527d88b7009a1643be6de24d2af664214919f0540a1","0x0000000000000000000000000000000000000000000000000000000000000000","0x000000000000000000000000a9b5cd0e94ebdf5a6dbb16a01635d432ab707244"]}],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"HorizonStaking#GraphProxyAdmin~GraphProxyAdmin.upgrade","result":{"type":"SUCCESS"},"type":"CALL_EXECUTION_STATE_COMPLETE"} +{"futureId":"PaymentsEscrow#HorizonProxies~ProxyAdmin_PaymentsEscrow.upgradeAndCall","hash":"0x83d3b50e1f7def264180b768dfd5ae7f7dea0d6a6249ea87bc10064980a5f36b","networkInteractionId":1,"receipt":{"blockHash":"0x476810258dad7fbed9ce5be1da825d24292de55e2a892f7f4f986d3b51084261","blockNumber":152513224,"logs":[{"address":"0x70d5AFAAaEF8f2F095E83D6E6151146c18A5Bb85","data":"0x","logIndex":2,"topics":["0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b","0x000000000000000000000000eed33b904eff05bbdcc9008f5174088df77dd183"]},{"address":"0x70d5AFAAaEF8f2F095E83D6E6151146c18A5Bb85","data":"0x0000000000000000000000000000000000000000000000000000000000000001","logIndex":3,"topics":["0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2"]}],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"PaymentsEscrow#HorizonProxies~ProxyAdmin_PaymentsEscrow.upgradeAndCall","result":{"type":"SUCCESS"},"type":"CALL_EXECUTION_STATE_COMPLETE"} +{"artifactId":"GraphPayments#GraphPayments_ProxyWithABI","contractAddress":"0xAFd60629034fBdC3ef58518B817bBDB4EC861c93","contractName":"GraphPayments_ProxyWithABI","dependencies":["GraphPayments#HorizonProxies~ProxyAdmin_GraphPayments.upgradeAndCall","HorizonProxies#GraphPayments_ProxyWithABI"],"futureId":"GraphPayments#GraphPayments_ProxyWithABI","futureType":"CONTRACT_AT","strategy":"basic","strategyConfig":{},"type":"CONTRACT_AT_EXECUTION_STATE_INITIALIZE"} +{"args":["0xa9B5CD0E94eBDf5A6dBB16A01635D432AB707244","0xF5D432192dAF7e8B045349693577ccF0B5165A12"],"artifactId":"GraphProxyAdmin#GraphProxyAdmin","contractAddress":"0x1CEBe1C314Cc454baf4bd553409d957C833623c0","dependencies":["GraphProxyAdmin#GraphProxyAdmin","HorizonStaking#HorizonStaking","HorizonProxies#GraphProxy","HorizonStaking#GraphProxyAdmin~GraphProxyAdmin.upgrade"],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","functionName":"acceptProxy","futureId":"HorizonStaking#GraphProxyAdmin~GraphProxyAdmin.acceptProxy","strategy":"basic","strategyConfig":{},"type":"CALL_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"HorizonStaking#GraphProxyAdmin~GraphProxyAdmin.acceptProxy","networkInteraction":{"data":"0xeb451a02000000000000000000000000a9b5cd0e94ebdf5a6dbb16a01635d432ab707244000000000000000000000000f5d432192daf7e8b045349693577ccf0b5165a12","id":1,"to":"0x1CEBe1C314Cc454baf4bd553409d957C833623c0","type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"HorizonStaking#GraphProxyAdmin~GraphProxyAdmin.acceptProxy","networkInteractionId":1,"nonce":1641,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"HorizonStaking#GraphProxyAdmin~GraphProxyAdmin.acceptProxy","networkInteractionId":1,"nonce":1641,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0x9072e5d7559c313a1003b7c64a954c6f15cd7f6a0e8582b92ee990ffd81fd2f2"},"type":"TRANSACTION_SEND"} +{"artifactId":"PaymentsEscrow#PaymentsEscrow_ProxyWithABI","contractAddress":"0x70d5AFAAaEF8f2F095E83D6E6151146c18A5Bb85","contractName":"PaymentsEscrow_ProxyWithABI","dependencies":["PaymentsEscrow#HorizonProxies~ProxyAdmin_PaymentsEscrow.upgradeAndCall","HorizonProxies#PaymentsEscrow_ProxyWithABI"],"futureId":"PaymentsEscrow#PaymentsEscrow_ProxyWithABI","futureType":"CONTRACT_AT","strategy":"basic","strategyConfig":{},"type":"CONTRACT_AT_EXECUTION_STATE_INITIALIZE"} +{"futureId":"HorizonStaking#GraphProxyAdmin~GraphProxyAdmin.acceptProxy","hash":"0x9072e5d7559c313a1003b7c64a954c6f15cd7f6a0e8582b92ee990ffd81fd2f2","networkInteractionId":1,"receipt":{"blockHash":"0x0ad4df5f1d21c5ec99d4ce36d43af6d41a5f46d135d31067c06d91fb0973d129","blockNumber":152513248,"logs":[{"address":"0xF5D432192dAF7e8B045349693577ccF0B5165A12","data":"0x","logIndex":0,"topics":["0xaa3f731066a578e5f39b4215468d826cdd15373cbc0dfc9cb9bdc649718ef7da","0x0000000000000000000000000000000000000000000000000000000000000000","0x000000000000000000000000a9b5cd0e94ebdf5a6dbb16a01635d432ab707244"]},{"address":"0xF5D432192dAF7e8B045349693577ccF0B5165A12","data":"0x","logIndex":1,"topics":["0x980c0d30fe97457c47903527d88b7009a1643be6de24d2af664214919f0540a1","0x000000000000000000000000a9b5cd0e94ebdf5a6dbb16a01635d432ab707244","0x0000000000000000000000000000000000000000000000000000000000000000"]}],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"HorizonStaking#GraphProxyAdmin~GraphProxyAdmin.acceptProxy","result":{"type":"SUCCESS"},"type":"CALL_EXECUTION_STATE_COMPLETE"} +{"args":["0xad834c286a9b590f8264c8d9574fafcbbbe90b3b"],"artifactId":"HorizonProxies#ProxyAdmin_GraphPayments","contractAddress":"0xAcA3dd622e863E425Cdb15E8734a5CB318448db7","dependencies":["HorizonProxies#ProxyAdmin_GraphPayments","GraphPayments#GraphPayments_ProxyWithABI"],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","functionName":"transferOwnership","futureId":"GraphPayments#HorizonProxies~ProxyAdmin_GraphPayments.transferOwnership","strategy":"basic","strategyConfig":{},"type":"CALL_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"GraphPayments#HorizonProxies~ProxyAdmin_GraphPayments.transferOwnership","networkInteraction":{"data":"0xf2fde38b000000000000000000000000ad834c286a9b590f8264c8d9574fafcbbbe90b3b","id":1,"to":"0xAcA3dd622e863E425Cdb15E8734a5CB318448db7","type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"GraphPayments#HorizonProxies~ProxyAdmin_GraphPayments.transferOwnership","networkInteractionId":1,"nonce":1642,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"GraphPayments#HorizonProxies~ProxyAdmin_GraphPayments.transferOwnership","networkInteractionId":1,"nonce":1642,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0x951c9730f5cc5288d4011f3475b4215c1c670d9bc488b76755abd0216ab0e587"},"type":"TRANSACTION_SEND"} +{"artifactId":"HorizonStaking#HorizonStaking_ProxyWithABI","contractAddress":"0xF5D432192dAF7e8B045349693577ccF0B5165A12","contractName":"HorizonStaking_ProxyWithABI","dependencies":["HorizonStaking#GraphProxyAdmin~GraphProxyAdmin.acceptProxy","HorizonProxies#GraphProxy"],"futureId":"HorizonStaking#HorizonStaking_ProxyWithABI","futureType":"CONTRACT_AT","strategy":"basic","strategyConfig":{},"type":"CONTRACT_AT_EXECUTION_STATE_INITIALIZE"} +{"args":["0xad834c286a9b590f8264c8d9574fafcbbbe90b3b"],"artifactId":"HorizonProxies#ProxyAdmin_PaymentsEscrow","contractAddress":"0xbB643167f03EfF532c537e3d72E56b9992CaD985","dependencies":["HorizonProxies#ProxyAdmin_PaymentsEscrow","PaymentsEscrow#PaymentsEscrow_ProxyWithABI"],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","functionName":"transferOwnership","futureId":"PaymentsEscrow#HorizonProxies~ProxyAdmin_PaymentsEscrow.transferOwnership","strategy":"basic","strategyConfig":{},"type":"CALL_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"PaymentsEscrow#HorizonProxies~ProxyAdmin_PaymentsEscrow.transferOwnership","networkInteraction":{"data":"0xf2fde38b000000000000000000000000ad834c286a9b590f8264c8d9574fafcbbbe90b3b","id":1,"to":"0xbB643167f03EfF532c537e3d72E56b9992CaD985","type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"PaymentsEscrow#HorizonProxies~ProxyAdmin_PaymentsEscrow.transferOwnership","networkInteractionId":1,"nonce":1643,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"PaymentsEscrow#HorizonProxies~ProxyAdmin_PaymentsEscrow.transferOwnership","networkInteractionId":1,"nonce":1643,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0x8e755afef744094c0a740a5442d8fea9faa6d19351abacf8996405e96301d15b"},"type":"TRANSACTION_SEND"} +{"futureId":"GraphPayments#HorizonProxies~ProxyAdmin_GraphPayments.transferOwnership","hash":"0x951c9730f5cc5288d4011f3475b4215c1c670d9bc488b76755abd0216ab0e587","networkInteractionId":1,"receipt":{"blockHash":"0x357ebed91b7e2ab80c74d45f806812e24329206b047389ff2bd62b8a82f8f68e","blockNumber":152513268,"logs":[{"address":"0xAcA3dd622e863E425Cdb15E8734a5CB318448db7","data":"0x","logIndex":1,"topics":["0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0","0x000000000000000000000000ade6b8eb69a49b56929c1d4f4b428d791861db6f","0x000000000000000000000000ad834c286a9b590f8264c8d9574fafcbbbe90b3b"]}],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"GraphPayments#HorizonProxies~ProxyAdmin_GraphPayments.transferOwnership","result":{"type":"SUCCESS"},"type":"CALL_EXECUTION_STATE_COMPLETE"} +{"futureId":"PaymentsEscrow#HorizonProxies~ProxyAdmin_PaymentsEscrow.transferOwnership","hash":"0x8e755afef744094c0a740a5442d8fea9faa6d19351abacf8996405e96301d15b","networkInteractionId":1,"receipt":{"blockHash":"0xfb6f319118f21b5991a4ec05bee9011339ec9a80eb27afccfb221dd2b01bfdff","blockNumber":152513279,"logs":[{"address":"0xbB643167f03EfF532c537e3d72E56b9992CaD985","data":"0x","logIndex":1,"topics":["0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0","0x000000000000000000000000ade6b8eb69a49b56929c1d4f4b428d791861db6f","0x000000000000000000000000ad834c286a9b590f8264c8d9574fafcbbbe90b3b"]}],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"PaymentsEscrow#HorizonProxies~ProxyAdmin_PaymentsEscrow.transferOwnership","result":{"type":"SUCCESS"},"type":"CALL_EXECUTION_STATE_COMPLETE"} +{"args":[2419200],"artifactId":"HorizonStaking#HorizonStaking_ProxyWithABI","contractAddress":"0xF5D432192dAF7e8B045349693577ccF0B5165A12","dependencies":["HorizonStaking#HorizonStaking_ProxyWithABI"],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","functionName":"setMaxThawingPeriod","futureId":"HorizonStaking#HorizonStaking_ProxyWithABI.setMaxThawingPeriod","strategy":"basic","strategyConfig":{},"type":"CALL_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"HorizonStaking#HorizonStaking_ProxyWithABI.setMaxThawingPeriod","networkInteraction":{"data":"0x259bc435000000000000000000000000000000000000000000000000000000000024ea00","id":1,"to":"0xF5D432192dAF7e8B045349693577ccF0B5165A12","type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"HorizonStaking#HorizonStaking_ProxyWithABI.setMaxThawingPeriod","networkInteractionId":1,"nonce":1644,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"HorizonStaking#HorizonStaking_ProxyWithABI.setMaxThawingPeriod","networkInteractionId":1,"nonce":1644,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0x96825e69f8876b2c724d53846534f6af23b2c24de6ef0f547ac8ea0c7b4b2870"},"type":"TRANSACTION_SEND"} +{"futureId":"HorizonStaking#HorizonStaking_ProxyWithABI.setMaxThawingPeriod","hash":"0x96825e69f8876b2c724d53846534f6af23b2c24de6ef0f547ac8ea0c7b4b2870","networkInteractionId":1,"receipt":{"blockHash":"0xc522a6fdc4095efab4a2657834ff66219b13846a6ef17f6de4d1becde597fa78","blockNumber":152513301,"logs":[{"address":"0xF5D432192dAF7e8B045349693577ccF0B5165A12","data":"0x000000000000000000000000000000000000000000000000000000000024ea00","logIndex":3,"topics":["0xe8526be46fa99b6313d439293c9be3491ffb067741bc8fce9d30c270cbb8459f"]}],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"HorizonStaking#HorizonStaking_ProxyWithABI.setMaxThawingPeriod","result":{"type":"SUCCESS"},"type":"CALL_EXECUTION_STATE_COMPLETE"} +{"args":[],"artifactId":"Controller#Controller","contractAddress":"0x0750EdA3185C758247E97819074bCD217a815FaE","dependencies":["Controller#Controller","GraphHorizon_Periphery","GraphHorizon_Core","HorizonStaking#HorizonStaking_ProxyWithABI"],"from":"0xad834c286a9b590f8264c8d9574fafcbbbe90b3b","functionName":"acceptOwnership","futureId":"GraphHorizon_Deploy#Controller~Controller.acceptOwnership","strategy":"basic","strategyConfig":{},"type":"CALL_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"GraphHorizon_Deploy#Controller~Controller.acceptOwnership","networkInteraction":{"data":"0x79ba5097","id":1,"to":"0x0750EdA3185C758247E97819074bCD217a815FaE","type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"GraphHorizon_Deploy#Controller~Controller.acceptOwnership","networkInteractionId":1,"nonce":16,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"GraphHorizon_Deploy#Controller~Controller.acceptOwnership","networkInteractionId":1,"nonce":16,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0x2b9a28aeba3c4895daab3167d685c6d91bc7d7cb568b0a66e8dcde28c63f56d5"},"type":"TRANSACTION_SEND"} +{"args":[],"artifactId":"GraphProxyAdmin#GraphProxyAdmin","contractAddress":"0x1CEBe1C314Cc454baf4bd553409d957C833623c0","dependencies":["GraphProxyAdmin#GraphProxyAdmin","GraphHorizon_Periphery","GraphHorizon_Core","HorizonStaking#HorizonStaking_ProxyWithABI"],"from":"0xad834c286a9b590f8264c8d9574fafcbbbe90b3b","functionName":"acceptOwnership","futureId":"GraphHorizon_Deploy#GraphProxyAdmin~GraphProxyAdmin.acceptOwnership","strategy":"basic","strategyConfig":{},"type":"CALL_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"GraphHorizon_Deploy#GraphProxyAdmin~GraphProxyAdmin.acceptOwnership","networkInteraction":{"data":"0x79ba5097","id":1,"to":"0x1CEBe1C314Cc454baf4bd553409d957C833623c0","type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"GraphHorizon_Deploy#GraphProxyAdmin~GraphProxyAdmin.acceptOwnership","networkInteractionId":1,"nonce":17,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"GraphHorizon_Deploy#GraphProxyAdmin~GraphProxyAdmin.acceptOwnership","networkInteractionId":1,"nonce":17,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0x61e583fc208cf5ba2a8bed0f7d880dc2b2bed92efacea3f982ba79dc400de8c3"},"type":"TRANSACTION_SEND"} +{"futureId":"GraphHorizon_Deploy#Controller~Controller.acceptOwnership","hash":"0x2b9a28aeba3c4895daab3167d685c6d91bc7d7cb568b0a66e8dcde28c63f56d5","networkInteractionId":1,"receipt":{"blockHash":"0x1d17c2ed5ddb1216939b2fe29f4ef2d220e064e579dfd6e788a8f8871e9414b4","blockNumber":152513320,"logs":[{"address":"0x0750EdA3185C758247E97819074bCD217a815FaE","data":"0x","logIndex":0,"topics":["0x0ac6deed30eef60090c749850e10f2fa469e3e25fec1d1bef2853003f6e6f18f","0x000000000000000000000000ade6b8eb69a49b56929c1d4f4b428d791861db6f","0x000000000000000000000000ad834c286a9b590f8264c8d9574fafcbbbe90b3b"]},{"address":"0x0750EdA3185C758247E97819074bCD217a815FaE","data":"0x","logIndex":1,"topics":["0x76563ad561b7036ae716b9b25cb521b21463240f104c97e12f25877f2235f33d","0x000000000000000000000000ad834c286a9b590f8264c8d9574fafcbbbe90b3b","0x0000000000000000000000000000000000000000000000000000000000000000"]}],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"GraphHorizon_Deploy#Controller~Controller.acceptOwnership","result":{"type":"SUCCESS"},"type":"CALL_EXECUTION_STATE_COMPLETE"} +{"futureId":"GraphHorizon_Deploy#GraphProxyAdmin~GraphProxyAdmin.acceptOwnership","hash":"0x61e583fc208cf5ba2a8bed0f7d880dc2b2bed92efacea3f982ba79dc400de8c3","networkInteractionId":1,"receipt":{"blockHash":"0x203b25b47f27eda7aade88bef7d27b9bb9ea2d92ead03d12bacb3d1677844599","blockNumber":152513331,"logs":[{"address":"0x1CEBe1C314Cc454baf4bd553409d957C833623c0","data":"0x","logIndex":0,"topics":["0x0ac6deed30eef60090c749850e10f2fa469e3e25fec1d1bef2853003f6e6f18f","0x000000000000000000000000ade6b8eb69a49b56929c1d4f4b428d791861db6f","0x000000000000000000000000ad834c286a9b590f8264c8d9574fafcbbbe90b3b"]},{"address":"0x1CEBe1C314Cc454baf4bd553409d957C833623c0","data":"0x","logIndex":1,"topics":["0x76563ad561b7036ae716b9b25cb521b21463240f104c97e12f25877f2235f33d","0x000000000000000000000000ad834c286a9b590f8264c8d9574fafcbbbe90b3b","0x0000000000000000000000000000000000000000000000000000000000000000"]}],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"GraphHorizon_Deploy#GraphProxyAdmin~GraphProxyAdmin.acceptOwnership","result":{"type":"SUCCESS"},"type":"CALL_EXECUTION_STATE_COMPLETE"} +{"artifactId":"DisputeManager#DisputeManager","constructorArgs":["0x0750EdA3185C758247E97819074bCD217a815FaE"],"contractName":"DisputeManager","dependencies":[],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","futureId":"DisputeManager#DisputeManager","futureType":"NAMED_ARTIFACT_CONTRACT_DEPLOYMENT","libraries":{},"strategy":"basic","strategyConfig":{},"type":"DEPLOYMENT_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"DisputeManager#DisputeManager","networkInteraction":{"data":"0x6101c060405234801561001157600080fd5b50604051613b6e380380613b6e8339810160408190526100309161049b565b806001600160a01b03811661007a5760405163218f5add60e11b815260206004820152600a60248201526921b7b73a3937b63632b960b11b60448201526064015b60405180910390fd5b6001600160a01b0381166101005260408051808201909152600a81526923b930b8342a37b5b2b760b11b60208201526100b29061033b565b6001600160a01b03166080526040805180820190915260078152665374616b696e6760c81b60208201526100e59061033b565b6001600160a01b031660a05260408051808201909152600d81526c47726170685061796d656e747360981b602082015261011e9061033b565b6001600160a01b031660c05260408051808201909152600e81526d5061796d656e7473457363726f7760901b60208201526101589061033b565b6001600160a01b031660e05260408051808201909152600c81526b22b837b1b426b0b730b3b2b960a11b60208201526101909061033b565b6001600160a01b03166101205260408051808201909152600e81526d2932bbb0b93239a6b0b730b3b2b960911b60208201526101cb9061033b565b6001600160a01b0316610140526040805180820190915260118152704772617068546f6b656e4761746577617960781b60208201526102099061033b565b6001600160a01b03166101605260408051808201909152600f81526e23b930b834283937bc3ca0b236b4b760891b60208201526102459061033b565b6001600160a01b03166101805260408051808201909152600881526721bab930ba34b7b760c11b602082015261027a9061033b565b6001600160a01b039081166101a08190526101005160a05160805160c05160e05161012051610140516101605161018051604051988b169a9788169996909716977fef5021414834d86e36470f5c1cecf6544fb2bb723f2ca51a4c86fcd8c5919a43976103249790916001600160a01b03978816815295871660208701529386166040860152918516606085015284166080840152831660a083015290911660c082015260e00190565b60405180910390a4506103356103e9565b50610519565b600080610100516001600160a01b031663f7641a5e84805190602001206040518263ffffffff1660e01b815260040161037691815260200190565b602060405180830381865afa158015610393573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103b7919061049b565b9050826001600160a01b0382166103e25760405163218f5add60e11b815260040161007191906104cb565b5092915050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff16156104395760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b03908116146104985780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b6000602082840312156104ad57600080fd5b81516001600160a01b03811681146104c457600080fd5b9392505050565b602081526000825180602084015260005b818110156104f957602081860181015160408684010152016104dc565b506000604082850101526040601f19601f83011684010191505092915050565b60805160a05160c05160e05161010051610120516101405161016051610180516101a0516135f261057c60003960005050600050506000505060005050600050506000505060005050600050506000611f23015260006119cc01526135f26000f3fe608060405234801561001057600080fd5b50600436106101a15760003560e01c8063050b17ad146101a65780630533e1ba146101bb5780630bc7344b146101e857806311be1997146101fb578063169729781461027857806317337b461461028b5780631792f1941461029557806326058249146102a857806329e03ff1146102c857806336167e03146102df5780634bc5839a146102f25780635aea0ec4146103055780635bf31d4d146103265780636369df6b146103405780636cc6cde114610353578063715018a61461036657806376c993ae1461036e5780638d4e9008146103815780638da5cb5b14610394578063902a49381461039c5780639334ea52146103ac57806393a90a1e146103bf5780639f81a7cf146103d2578063b0e2f7e9146103e5578063b0eefabe146103f8578063bb2a2b471461040b578063be41f38414610419578063c133b4291461043c578063c50a77b11461044f578063c894222e14610462578063c9747f5114610483578063cc2d55cd14610496578063d36fc9d4146104a5578063d76f62d1146104b8578063f2fde38b146104cb575b600080fd5b6101b96101b4366004612c8a565b6104de565b005b6036546101d290600160201b900463ffffffff1681565b6040516101df9190612cac565b60405180910390f35b6101b96101f6366004612cf9565b6105fc565b610263610209366004612d72565b603760205260009081526040902080546001820154600283015460038401546004850154600586015460068701546007909701546001600160a01b039687169796909516959394929360ff80841694610100909404169289565b6040516101df99989796959493929190612db5565b6101b9610286366004612d72565b610734565b6101d26207a12081565b6101b96102a3366004612d72565b610748565b6033546102bb906001600160a01b031681565b6040516101df9190612e20565b6102d160355481565b6040519081526020016101df565b6101b96102ed366004612d72565b6108a8565b6102d1610300366004612e34565b6109ae565b603454600160a01b90046001600160401b03165b6040516101df9190612e60565b60345461031990600160a01b90046001600160401b031681565b6102d161034e366004612e74565b6109e6565b6034546102bb906001600160a01b031681565b6101b96109ff565b6101b961037c366004612e8f565b610a13565b6102d161038f366004612eac565b610a24565b6102bb610dc5565b6036546101d29063ffffffff1681565b6101b96103ba366004612d72565b610de0565b6101b96103cd366004612ef2565b610edf565b6101b96103e0366004612e8f565b610ef0565b6101b96103f3366004612f1d565b610f01565b6101b9610406366004612ef2565b611062565b60365463ffffffff166101d2565b61042c610427366004612d72565b611073565b60405190151581526020016101df565b6102d161044a366004612ef2565b6110a9565b6102d161045d366004612fa4565b611141565b610475610470366004612fe5565b6111d4565b6040516101df929190613054565b6102bb6104913660046130fa565b6113e2565b6102d1670de0b6b3a764000081565b61042c6104b336600461317c565b6114cd565b6101b96104c63660046131b2565b6114f5565b6101b96104d9366004612ef2565b611506565b6034546001600160a01b031633146105095760405163a8baf3bb60e01b815260040160405180910390fd5b8161051381611073565b819061053e576040516314a03bbd60e21b815260040161053591815260200190565b60405180910390fd5b506004600082815260376020526040902060040154610100900460ff16600581111561056c5761056c612d8b565b600083815260376020526040902060040154610100900460ff1691146105a65760405163146e540f60e21b815260040161053591906131cf565b506000838152603760205260409020600301548390156105dc576040516364d0c32b60e01b815260040161053591815260200190565b5060008381526037602052604090206105f6848285611541565b50505050565b60006106066115f2565b805490915060ff600160401b82041615906001600160401b031660008115801561062d5750825b90506000826001600160401b031660011480156106495750303b155b905081158015610657575080155b156106755760405163f92ee8a960e01b815260040160405180910390fd5b84546001600160401b0319166001178555831561069e57845460ff60401b1916600160401b1785555b6106a78b61161b565b6106af61162c565b6106b88a61163c565b6106c1896116ad565b6106ca88611736565b6106d387611799565b6106dc8661180b565b831561072757845460ff60401b191685556040517fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29061071e90600190612e60565b60405180910390a15b5050505050505050505050565b61073c611892565b61074581611736565b50565b8061075281611073565b8190610774576040516314a03bbd60e21b815260040161053591815260200190565b506000818152603760205260409020600101546001600160a01b031633146107af5760405163082c005560e41b815260040160405180910390fd5b816107b981611073565b81906107db576040516314a03bbd60e21b815260040161053591815260200190565b506004600082815260376020526040902060040154610100900460ff16600581111561080957610809612d8b565b600083815260376020526040902060040154610100900460ff1691146108435760405163146e540f60e21b815260040161053591906131cf565b506000838152603760205260409020600681015442101561087757604051631d7753d560e11b815260040160405180910390fd5b61088184826118c4565b6003810154156105f657600381015460008181526037602052604090206105f691906118c4565b6034546001600160a01b031633146108d35760405163a8baf3bb60e01b815260040160405180910390fd5b806108dd81611073565b81906108ff576040516314a03bbd60e21b815260040161053591815260200190565b506004600082815260376020526040902060040154610100900460ff16600581111561092d5761092d612d8b565b600083815260376020526040902060040154610100900460ff1691146109675760405163146e540f60e21b815260040161053591906131cf565b506000828152603760205260409020600381015483901561099e576040516364d0c32b60e01b815260040161053591815260200190565b506109a9838261194b565b505050565b60006109cf336035546109bf6119ca565b6001600160a01b031691906119ee565b6109dd336035548585611aa6565b90505b92915050565b60006109e06109fa368490038401846131dd565b611e28565b610a07611892565b610a116000611ec5565b565b610a1b611892565b61074581611799565b6034546000906001600160a01b03163314610a525760405163a8baf3bb60e01b815260040160405180910390fd5b6040516001600160601b0319606087901b166020820152656c656761637960d01b6034820152600090603a016040516020818303038152906040528051906020012090506000610aa0611f21565b6001600160a01b0316630e022923886040518263ffffffff1660e01b8152600401610acb9190612e20565b61012060405180830381865afa158015610ae9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b0d91906132d9565b519050866001600160a01b038216610b39576040516334789d8b60e21b81526004016105359190612e20565b5060408051610120810182526001600160a01b038381168252881660208201526000918101829052606081019190915260036080820152600160a08201524260c0820181905260345460e0830191610ba191600160a01b90046001600160401b03169061330c565b81526000602091820181905284815260378252604090819020835181546001600160a01b039182166001600160a01b0319918216178355938501516001808401805492909316919095161790559083015160028201556060830151600380830191909155608084015160048301805493949193909260ff1990911691908490811115610c2f57610c2f612d8b565b021790555060a082015160048201805461ff001916610100836005811115610c5957610c59612d8b565b021790555060c0820151600582015560e08201516006820155610100909101516007909101556000610c89611f45565b9050806001600160a01b031663cb8347fe838888604051602001610cae929190613054565b6040516020818303038152906040526040518363ffffffff1660e01b8152600401610cda929190613365565b600060405180830381600087803b158015610cf457600080fd5b505af1158015610d08573d6000803e3d6000fd5b50505050610d298786610d196119ca565b6001600160a01b03169190611f81565b604080516001600160a01b038a81168252602082018990529181018790528189169184169085907f587a1fc7e80e653a2ab7f63f98c080f5818b8cedcfd1374590c8c786290ed0319060600160405180910390a4866001600160a01b0316826001600160a01b03168460008051602061359d83398151915288604051610db191815260200190565b60405180910390a450909695505050505050565b600080610dd0611fbc565b546001600160a01b031692915050565b6034546001600160a01b03163314610e0b5760405163a8baf3bb60e01b815260040160405180910390fd5b80610e1581611073565b8190610e37576040516314a03bbd60e21b815260040161053591815260200190565b506004600082815260376020526040902060040154610100900460ff166005811115610e6557610e65612d8b565b600083815260376020526040902060040154610100900460ff169114610e9f5760405163146e540f60e21b815260040161053591906131cf565b506000828152603760205260409020610eb88382611fe0565b6003810154156109a957600381015460008181526037602052604090206109a99190611fe0565b610ee7611892565b6107458161205f565b610ef8611892565b6107458161180b565b6034546001600160a01b03163314610f2c5760405163a8baf3bb60e01b815260040160405180910390fd5b83610f3681611073565b8190610f58576040516314a03bbd60e21b815260040161053591815260200190565b506004600082815260376020526040902060040154610100900460ff166005811115610f8657610f86612d8b565b600083815260376020526040902060040154610100900460ff169114610fc05760405163146e540f60e21b815260040161053591906131cf565b5060008581526037602052604090206003015415158590610ffa57604051600162d62c0760e01b0319815260040161053591815260200190565b506000858152603760205260409020611014868287611541565b831561103d5760038101546000818152603760205260409020611038919085611541565b61105a565b6003810154600081815260376020526040902061105a9190611fe0565b505050505050565b61106a611892565b6107458161163c565b600080600083815260376020526040902060040154610100900460ff1660058111156110a1576110a1612d8b565b141592915050565b6000806110b4611f21565b6001600160a01b03166325d9897e846110cb611f45565b6040518363ffffffff1660e01b81526004016110e8929190613389565b61014060405180830381865afa158015611106573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061112a91906133b9565b905061113a8382600001516120d0565b9392505050565b6000611152336035546109bf6119ca565b6109dd3360355461119886868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061216592505050565b86868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506122a592505050565b6000806000339050600061121d88888080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061216592505050565b9050600061126087878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061216592505050565b905061126c82826125a4565b825160208085015160408087015186519387015191870151949592949093926112cb57604051636aba529760e11b81526004810196909652602486019490945260448501929092526064840152608483015260a482015260c401610535565b5050505050506112e0336035546109bf6119ca565b60006113328460026035546112f59190613466565b858d8d8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506122a592505050565b905060006113868560026035546113499190613466565b858c8c8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506122a592505050565b60008381526037602052604080822060039081018490558383528183200185905551919250829184917ffec135a4cf8e5c6e13dea23be058bf03a8bf8f1f6fb0a021b0a5aeddfba8140791a3909a909950975050505050505050565b6000806113ee836125d5565b905060006113fa611f45565b6001600160a01b0316630e022923836040518263ffffffff1660e01b81526004016114259190612e20565b61012060405180830381865afa158015611443573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061146791906132d9565b805190915082906001600160a01b0316611495576040516334789d8b60e21b81526004016105359190612e20565b5060408401516020820151908181146114c357604051630a24cfe560e21b8152600401610535929190613054565b5050519392505050565b60006109dd6114e1368590038501856130fa565b6114f0368590038501856130fa565b6125a4565b6114fd611892565b610745816116ad565b61150e611892565b6001600160a01b038116611538576000604051631e4fbdf760e01b81526004016105359190612e20565b61074581611ec5565b81546007830154600091611562916001600160a01b0390911690849061265e565b60048401805461ff001916610100179055600184015460028501549192506115a2916001600160a01b039091169061159a908461330c565b610d196119ca565b6001830154835460028501546001600160a01b039283169290911690869060008051602061359d833981519152906115db90869061330c565b60405190815260200160405180910390a450505050565b6000807ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a006109e0565b61162361280f565b61074581612834565b61163461280f565b610a1161283c565b6001600160a01b0381166116635760405163616bc44160e11b815260040160405180910390fd5b603480546001600160a01b0319166001600160a01b0383169081179091556040517f51744122301b50e919f4e3d22adf8c53abc92195b8c667eda98c6ef20375672e90600090a250565b806001600160401b03166000036116d75760405163c4411f1160e01b815260040160405180910390fd5b60348054600160a01b600160e01b031916600160a01b6001600160401b038416021790556040517f310462a9bf49fff4a57910ec647c77cbf8aaf2f13394554ac6cdf14fc68db7e69061172b908390612e60565b60405180910390a150565b80670de0b6b3a76400008110156117635760405163033f4e0560e01b815260040161053591815260200190565b5060358190556040518181527f97896b9da0f97f36bf3011570bcff930069299de4b1e89c9cb44909841cac2f89060200161172b565b806207a12063ffffffff821611156117c55760405163432e664360e11b81526004016105359190612cac565b506036805463ffffffff191663ffffffff83161790556040517fc573dc0f869f6a1d0a74fc7712a63baabcb5567131d2d98005e163924eddcbab9061172b908390612cac565b8063ffffffff8116620f4240101561183757604051634e9374fb60e11b81526004016105359190612cac565b506036805463ffffffff60201b1916600160201b63ffffffff848116820292909217928390556040517f7efaf01bec3cda8d104163bb466d01d7e16f68848301c7eb0749cfa59d6805029361172b9392900490911690612cac565b3361189b610dc5565b6001600160a01b031614610a11573360405163118cdaa760e01b81526004016105359190612e20565b60048101805461ff001916610500179055600181015460028201546118f5916001600160a01b031690610d196119ca565b6001810154815460028301546040519081526001600160a01b03928316929091169084907f223103f8eb52e5f43a75655152acd882a605d70df57a5c0fefd30f516b1756d2906020015b60405180910390a45050565b60048101805461ff001916610200179055600281015461197c9061196d6119ca565b6001600160a01b03169061290e565b6001810154815460028301546040519081526001600160a01b03928316929091169084907f2226ebd23625a7938fb786df2248bd171d2e6ad70cb2b654ea1be830ca17224d9060200161193f565b7f000000000000000000000000000000000000000000000000000000000000000090565b80156109a9576040516323b872dd60e01b81526001600160a01b038381166004830152306024830152604482018390528416906323b872dd906064015b6020604051808303816000875af1158015611a4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a6e9190613488565b6109a95760405162461bcd60e51b815260206004820152600960248201526810ba3930b739b332b960b91b6044820152606401610535565b6040516001600160601b0319606084901b166020820152603481018290526000908190605401604051602081830303815290604052805190602001209050611aed81611073565b158190611b105760405163124a23f160e11b815260040161053591815260200190565b506000611b1b611f45565b90506000816001600160a01b0316630e022923876040518263ffffffff1660e01b8152600401611b4b9190612e20565b61012060405180830381865afa158015611b69573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b8d91906132d9565b8051909150866001600160a01b038216611bbb576040516334789d8b60e21b81526004016105359190612e20565b506000611bc6611f21565b6001600160a01b03166325d9897e83866040518363ffffffff1660e01b8152600401611bf3929190613389565b61014060405180830381865afa158015611c11573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c3591906133b9565b8051909150600003611c5a5760405163307efdb760e11b815260040160405180910390fd5b6000611c6a8383600001516120d0565b603454909150600090611c8d90600160a01b90046001600160401b03164261330c565b604080516101208101825287516001600160a01b0390811682528f1660208201529081018d905260006060820152909150608081016001815260200160048152426020808301919091526040808301859052606092830186905260008b815260378352819020845181546001600160a01b039182166001600160a01b0319918216178355938601516001808401805492909316919095161790559084015160028201559183015160038084019190915560808401516004840180549193909260ff19909216918490811115611d6457611d64612d8b565b021790555060a082015160048201805461ff001916610100836005811115611d8e57611d8e612d8b565b021790555060c0820151600582015560e08201516006820155610100909101516007909101558451604080518d81526001600160a01b038d811660208301529181018c90526060810185905260808101849052818f16929091169089907f8a1eccecce948a912e2e195de5960359755aeac90ad88a3fde55a77e1a73796b9060a00160405180910390a450949a9950505050505050505050565b600054815160208084015160409485015185517f32dd026408194a0d7e54cc66a2ab6c856efc55cfcd4dd258fde5b1a55222baa6818501528087019490945260608401919091526080808401919091528451808403909101815260a08301855280519082012061190160f01b60c084015260c283019390935260e28083019390935283518083039093018352610102909101909252805191012090565b6000611ecf611fbc565b80546001600160a01b038481166001600160a01b031983168117845560405193945091169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b6033546000906001600160a01b0316611f715760405163bd088b4f60e01b815260040160405180910390fd5b506033546001600160a01b031690565b80156109a95760405163a9059cbb60e01b81526001600160a01b0383811660048301526024820183905284169063a9059cbb90604401611a2b565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930090565b60048101805461ff00191661030017905560018101546002820154612011916001600160a01b031690610d196119ca565b6001810154815460028301546040519081526001600160a01b03928316929091169084907ff0912efb86ea1d65a17d64d48393cdb1ca0ea5220dd2bbe438621199d30955b79060200161193f565b6001600160a01b0381166120865760405163616bc44160e11b815260040160405180910390fd5b603380546001600160a01b0319166001600160a01b0383169081179091556040517f81dcb738da3dabd5bb2adbc7dd107fbbfca936e9c8aecab25f5b17a710a784c790600090a250565b6000806120db611f21565b6001600160a01b031663561285e4856120f2611f45565b6040518363ffffffff1660e01b815260040161210f929190613389565b60a060405180830381865afa15801561212c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061215091906134a5565b51905061215d818461330c565b949350505050565b6040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a081019190915260016121a460208061330c565b6121ae919061330c565b6121b990606061330c565b82519081149060016121cc60208061330c565b6121d6919061330c565b6121e190606061330c565b909161220257604051633fdf342360e01b8152600401610535929190613054565b505060008060008480602001905181019061221d9190613524565b925092509250600061223086606061296e565b90506000612249876122446020606061330c565b61296e565b9050600061226d88602061225e81606061330c565b612268919061330c565b6129b9565b6040805160c081018252978852602088019690965294860193909352606085019190915260808401525060ff1660a082015292915050565b6000806122b1846113e2565b905060006122bd611f21565b6001600160a01b03166325d9897e836122d4611f45565b6040518363ffffffff1660e01b81526004016122f1929190613389565b61014060405180830381865afa15801561230f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061233391906133b9565b80519091506000036123585760405163307efdb760e11b815260040160405180910390fd5b84516020808701516040808901518151938401949094528201526060808201929092526001600160601b031984831b811660808301529189901b909116609482015260009060a8016040516020818303038152906040528051906020012090506123c181611073565b1581906123e45760405163124a23f160e11b815260040161053591815260200190565b5060006123f58484600001516120d0565b60345490915060009061241890600160a01b90046001600160401b03164261330c565b60408051610120810182526001600160a01b0380891682528d1660208201529081018b9052600060608201529091506080810160028152602001600481524260208083019190915260408083018590526060928301869052600087815260378352819020845181546001600160a01b039182166001600160a01b0319918216178355938601516001808401805492909316919095161790559084015160028201559183015160038084019190915560808401516004840180549193909260ff199092169184908111156124ed576124ed612d8b565b021790555060a082015160048201805461ff00191661010083600581111561251757612517612d8b565b021790555060c0820151816005015560e082015181600601556101008201518160070155905050896001600160a01b0316856001600160a01b0316847ffb70faf7306b83c2cec6d8c1627baad892cb79968a02cc0353174499ecfd8b358c8c604001518c878960405161258e959493929190613552565b60405180910390a4509098975050505050505050565b805182516000911480156125bf575081604001518360400151145b80156109dd575050602090810151910151141590565b60408051606081018252825181526020808401519082015282820151918101919091526000908161260582611e28565b905061215d81856060015186608001518760a0015160405160200161264a93929190928352602083019190915260f81b6001600160f81b031916604082015260410190565b604051602081830303815290604052612a04565b600080612669611f45565b90506000612675611f21565b6001600160a01b03166325d9897e87846040518363ffffffff1660e01b81526004016126a2929190613389565b61014060405180830381865afa1580156126c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126e491906133b9565b60365490915060009061270990869063ffffffff600160201b909104811690612a2e16565b9050851580159061271a5750808611155b8682909161273d5760405163cc6b7c4160e01b8152600401610535929190613054565b5050600061274f878460000151612a8e565b60608401516036549192506000916127709163ffffffff9081169116612a8e565b9050600061277e8284612a2e565b9050856001600160a01b031663cb8347fe8b8b846040516020016127a3929190613054565b6040516020818303038152906040526040518363ffffffff1660e01b81526004016127cf929190613365565b600060405180830381600087803b1580156127e957600080fd5b505af11580156127fd573d6000803e3d6000fd5b50929c9b505050505050505050505050565b612817612aa5565b610a1157604051631afcd79f60e31b815260040160405180910390fd5b61150e61280f565b61284461280f565b604080517fd87cd6ef79d4e2b95e15ce8abf732db51ec771f1ca2edccf22a46c729ac5647260208201527f171a7fa058648750a8c5aae430f30db8d0100efc3a5e1b2e8054b1c1ce28b6b4918101919091527f044852b2a670ade5407e78fb2863c51de9fcb96542a07186fe3aeda6bb8a116d60608201524660808201523060a08201527fa070ffb1cd7409649bf77822cce74495468e06dbfaef09556838bf188679b9c260c082015260e00160408051601f198184030181529190528051602090910120600055565b801561296a57604051630852cd8d60e31b8152600481018290526001600160a01b038316906342966c6890602401600060405180830381600087803b15801561295657600080fd5b505af115801561105a573d6000803e3d6000fd5b5050565b600061297b60208361330c565b8351908110159061298d60208561330c565b90916129ae57604051633fdf342360e01b8152600401610535929190613054565b505050016020015190565b60006129c660018361330c565b835190811015906129d860018561330c565b90916129f957604051633fdf342360e01b8152600401610535929190613054565b505050016001015190565b600080600080612a148686612abf565b925092509250612a248282612b0c565b5090949350505050565b6000612a3d83620f4240101590565b80612a505750612a5082620f4240101590565b83839091612a735760405163768bf0eb60e11b8152600401610535929190613054565b50620f42409050612a848385613585565b6109dd9190613466565b600081831115612a9e57816109dd565b5090919050565b6000612aaf6115f2565b54600160401b900460ff16919050565b60008060008351604103612af95760208401516040850151606086015160001a612aeb88828585612bc5565b955095509550505050612b05565b50508151600091506002905b9250925092565b6000826003811115612b2057612b20612d8b565b03612b29575050565b6001826003811115612b3d57612b3d612d8b565b03612b5b5760405163f645eedf60e01b815260040160405180910390fd5b6002826003811115612b6f57612b6f612d8b565b03612b905760405163fce698f760e01b815260048101829052602401610535565b6003826003811115612ba457612ba4612d8b565b0361296a576040516335e2f38360e21b815260048101829052602401610535565b600080806fa2a8918ca85bafe22016d0b997e4df60600160ff1b03841115612bf65750600091506003905082612c80565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa158015612c4a573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116612c7657506000925060019150829050612c80565b9250600091508190505b9450945094915050565b60008060408385031215612c9d57600080fd5b50508035926020909101359150565b63ffffffff91909116815260200190565b6001600160a01b038116811461074557600080fd5b6001600160401b038116811461074557600080fd5b63ffffffff8116811461074557600080fd5b60008060008060008060c08789031215612d1257600080fd5b8635612d1d81612cbd565b95506020870135612d2d81612cbd565b94506040870135612d3d81612cd2565b9350606087013592506080870135612d5481612ce7565b915060a0870135612d6481612ce7565b809150509295509295509295565b600060208284031215612d8457600080fd5b5035919050565b634e487b7160e01b600052602160045260246000fd5b60068110612db157612db1612d8b565b9052565b6001600160a01b038a81168252891660208201526040810188905260608101879052610120810160048710612dec57612dec612d8b565b866080830152612dff60a0830187612da1565b8460c08301528360e0830152826101008301529a9950505050505050505050565b6001600160a01b0391909116815260200190565b60008060408385031215612e4757600080fd5b8235612e5281612cbd565b946020939093013593505050565b6001600160401b0391909116815260200190565b60006060828403128015612e8757600080fd5b509092915050565b600060208284031215612ea157600080fd5b813561113a81612ce7565b60008060008060808587031215612ec257600080fd5b8435612ecd81612cbd565b93506020850135612edd81612cbd565b93969395505050506040820135916060013590565b600060208284031215612f0457600080fd5b813561113a81612cbd565b801515811461074557600080fd5b60008060008060808587031215612f3357600080fd5b84359350602085013592506040850135612f4c81612f0f565b9396929550929360600135925050565b60008083601f840112612f6e57600080fd5b5081356001600160401b03811115612f8557600080fd5b602083019150836020828501011115612f9d57600080fd5b9250929050565b60008060208385031215612fb757600080fd5b82356001600160401b03811115612fcd57600080fd5b612fd985828601612f5c565b90969095509350505050565b60008060008060408587031215612ffb57600080fd5b84356001600160401b0381111561301157600080fd5b61301d87828801612f5c565b90955093505060208501356001600160401b0381111561303c57600080fd5b61304887828801612f5c565b95989497509550505050565b918252602082015260400190565b60405160c081016001600160401b038111828210171561309257634e487b7160e01b600052604160045260246000fd5b60405290565b60405161012081016001600160401b038111828210171561309257634e487b7160e01b600052604160045260246000fd5b60405161014081016001600160401b038111828210171561309257634e487b7160e01b600052604160045260246000fd5b600060c082840312801561310d57600080fd5b506000613118613062565b833581526020808501359082015260408085013590820152606080850135908201526080808501359082015260a084013560ff81168114613157578283fd5b60a0820152949350505050565b600060c0828403121561317657600080fd5b50919050565b600080610180838503121561319057600080fd5b61319a8484613164565b91506131a98460c08501613164565b90509250929050565b6000602082840312156131c457600080fd5b813561113a81612cd2565b602081016109e08284612da1565b600060608284031280156131f057600080fd5b50604051600090606081016001600160401b038111828210171561322257634e487b7160e01b83526041600452602483fd5b604090815284358252602080860135908301529384013593810193909352509092915050565b805161325381612cbd565b919050565b6000610120828403121561326b57600080fd5b613273613098565b905061327e82613248565b81526020828101519082015260408083015190820152606080830151908201526080808301519082015260a0808301519082015260c0808301519082015260e080830151908201526101009182015191810191909152919050565b600061012082840312156132ec57600080fd5b6109dd8383613258565b634e487b7160e01b600052601160045260246000fd5b808201808211156109e0576109e06132f6565b6000815180845260005b8181101561334557602081850181015186830182015201613329565b506000602082860101526020601f19601f83011685010191505092915050565b6001600160a01b038316815260406020820181905260009061215d9083018461331f565b6001600160a01b0392831681529116602082015260400190565b805161325381612ce7565b805161325381612cd2565b60006101408284031280156133cd57600080fd5b5060006133d86130c9565b8351815260208085015190820152604080850151908201526133fc606085016133a3565b606082015261340d608085016133ae565b608082015261341e60a085016133ae565b60a082015261342f60c085016133a3565b60c082015261344060e085016133ae565b60e082015261010084810151908201526101209384015193810193909352509092915050565b60008261348357634e487b7160e01b600052601260045260246000fd5b500490565b60006020828403121561349a57600080fd5b815161113a81612f0f565b600060a08284031280156134b857600080fd5b5060405160009060a081016001600160401b03811182821017156134ea57634e487b7160e01b83526041600452602483fd5b6040908152845182526020808601519083015284810151908201526060808501519082015260809384015193810193909352509092915050565b60008060006060848603121561353957600080fd5b5050815160208301516040909301519094929350919050565b85815284602082015260a06040820152600061357160a083018661331f565b606083019490945250608001529392505050565b80820281158282048414176109e0576109e06132f656fe6d800aaaf64b9a1f321dcd63da04369d33d8a0d49ad0fbba085aab4a98bf31c4a2646970667358221220d50b3dec1e5d2d1d140733dca7d5163900c1fc882947b3208864910c6f452d0e64736f6c634300081b00330000000000000000000000000750eda3185c758247e97819074bcd217a815fae","id":1,"type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"DisputeManager#DisputeManager","networkInteractionId":1,"nonce":1645,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"DisputeManager#DisputeManager","networkInteractionId":1,"nonce":1645,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0x525564dabe54e35e863db1333ed6de28d8c426663bf174e23acb630760bd8274"},"type":"TRANSACTION_SEND"} +{"artifactId":"DisputeManager#DisputeManagerProxy","contractAddress":"0x1A7Fb71014d4395903eC56662f32dD02344D361C","contractName":"DisputeManagerProxy","dependencies":[],"futureId":"DisputeManager#DisputeManagerProxy","futureType":"CONTRACT_AT","strategy":"basic","strategyConfig":{},"type":"CONTRACT_AT_EXECUTION_STATE_INITIALIZE"} +{"artifactId":"DisputeManager#ProxyAdmin","contractAddress":"0x9a8C3B6D649108bd11670de0B9b981ae3C167707","contractName":"ProxyAdmin","dependencies":[],"futureId":"DisputeManager#ProxyAdmin","futureType":"CONTRACT_AT","strategy":"basic","strategyConfig":{},"type":"CONTRACT_AT_EXECUTION_STATE_INITIALIZE"} +{"artifactId":"L2Curation#L2CurationAddressBook","contractAddress":"0xe135BFD9E51BbAfCeBb0141af85F0bc6DA1b3BA4","contractName":"L2CurationAddressBook","dependencies":[],"futureId":"L2Curation#L2CurationAddressBook","futureType":"CONTRACT_AT","strategy":"basic","strategyConfig":{},"type":"CONTRACT_AT_EXECUTION_STATE_INITIALIZE"} +{"artifactId":"L2Curation#L2CurationImplementationAddressBook","contractAddress":"0x9CCD9B656f8A558879974ef2505496eEd7Ef7210","contractName":"L2CurationImplementationAddressBook","dependencies":[],"futureId":"L2Curation#L2CurationImplementationAddressBook","futureType":"CONTRACT_AT","strategy":"basic","strategyConfig":{},"type":"CONTRACT_AT_EXECUTION_STATE_INITIALIZE"} +{"artifactId":"SubgraphService#ProxyAdmin","contractAddress":"0xD23a972f47B7D45E729AB9B8399D628c87b6C0d6","contractName":"ProxyAdmin","dependencies":[],"futureId":"SubgraphService#ProxyAdmin","futureType":"CONTRACT_AT","strategy":"basic","strategyConfig":{},"type":"CONTRACT_AT_EXECUTION_STATE_INITIALIZE"} +{"artifactId":"SubgraphService#SubgraphService","constructorArgs":["0x0750EdA3185C758247E97819074bCD217a815FaE","0x1A7Fb71014d4395903eC56662f32dD02344D361C","0xB63bC33D13F73eFD14d32D2b9FC0B6116B6611CE","0xe135BFD9E51BbAfCeBb0141af85F0bc6DA1b3BA4"],"contractName":"SubgraphService","dependencies":[],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","futureId":"SubgraphService#SubgraphService","futureType":"NAMED_ARTIFACT_CONTRACT_DEPLOYMENT","libraries":{},"strategy":"basic","strategyConfig":{},"type":"DEPLOYMENT_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"SubgraphService#SubgraphService","networkInteraction":{"data":"0x61024060405234801561001157600080fd5b5060405161667738038061667783398101604081905261003091610541565b3083838387806001600160a01b03811661007f5760405163218f5add60e11b815260206004820152600a60248201526921b7b73a3937b63632b960b11b60448201526064015b60405180910390fd5b6001600160a01b0381166101005260408051808201909152600a81526923b930b8342a37b5b2b760b11b60208201526100b7906103c5565b6001600160a01b03166080526040805180820190915260078152665374616b696e6760c81b60208201526100ea906103c5565b6001600160a01b031660a05260408051808201909152600d81526c47726170685061796d656e747360981b6020820152610123906103c5565b6001600160a01b031660c05260408051808201909152600e81526d5061796d656e7473457363726f7760901b602082015261015d906103c5565b6001600160a01b031660e05260408051808201909152600c81526b22b837b1b426b0b730b3b2b960a11b6020820152610195906103c5565b6001600160a01b03166101205260408051808201909152600e81526d2932bbb0b93239a6b0b730b3b2b960911b60208201526101d0906103c5565b6001600160a01b0316610140526040805180820190915260118152704772617068546f6b656e4761746577617960781b602082015261020e906103c5565b6001600160a01b03166101605260408051808201909152600f81526e23b930b834283937bc3ca0b236b4b760891b602082015261024a906103c5565b6001600160a01b03166101805260408051808201909152600881526721bab930ba34b7b760c11b602082015261027f906103c5565b6001600160a01b039081166101a08190526101005160a05160805160c05160e05161012051610140516101605161018051604051988b169a9788169996909716977fef5021414834d86e36470f5c1cecf6544fb2bb723f2ca51a4c86fcd8c5919a43976103299790916001600160a01b03978816815295871660208701529386166040860152918516606085015284166080840152831660a083015290911660c082015260e00190565b60405180910390a450506001600160a01b038481166101c08190528482166101e08190528483166102008190529284166102208190526040805193845260208401929092529082019290925260608101919091527f4175b2c37456dbac494e08de8666d31bb8f3f2aee36ea5d9e06894ff3e4ddda79060800160405180910390a1505050506103bc61047360201b60201c565b50505050610605565b600080610100516001600160a01b031663f7641a5e84805190602001206040518263ffffffff1660e01b815260040161040091815260200190565b602060405180830381865afa15801561041d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104419190610595565b9050826001600160a01b03821661046c5760405163218f5add60e11b815260040161007691906105b7565b5092915050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff16156104c35760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b03908116146105225780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b80516001600160a01b038116811461053c57600080fd5b919050565b6000806000806080858703121561055757600080fd5b61056085610525565b935061056e60208601610525565b925061057c60408601610525565b915061058a60608601610525565b905092959194509250565b6000602082840312156105a757600080fd5b6105b082610525565b9392505050565b602081526000825180602084015260005b818110156105e557602081860181015160408684010152016105c8565b506000604082850101526040601f19601f83011684010191505092915050565b60805160a05160c05160e05161010051610120516101405161016051610180516101a0516101c0516101e0516102005161022051615fd961069e6000396000612ee2015260006132de01526000818161163b0152612fe101526000505060005050600050506000505060006137080152600061457c01526000505060005050600050506000611b6b01526000613a640152615fd96000f3fe608060405234801561001057600080fd5b506004361061023b5760003560e01c806307e736d8146102405780630e02292314610280578063138dea081461030857806313c474c9146103205780631dd42f60146103755780631ebb7c301461038a57806324b8fbf6146103af57806335577962146103c25780633f4ba83a146103d557806345f54485146103dd578063482468b7146103f05780634f793cdc1461040657806355c85269146104285780635c975abb146104725780636234e2161461048a5780636ccec5b8146104aa5780636d9a3951146104bd578063715018a61461053857806371ce020a146105405780637aa31bce146105565780637dfe6d28146105695780637e89bac31461057c5780638180083b1461058f578063819ba366146105a257806381e777a7146105b8578063832bc923146105cb5780638456cb59146105de57806384b0196e146105e657806385e82baf146106015780638da5cb5b1461060a5780639384e07814610612578063ac9650d814610635578063b15d2a2c14610655578063ba38f67d14610668578063c0f474971461067b578063c84a5ef314610683578063cb8347fe14610696578063cbe5f3f2146106a9578063ce0fc0cc146106c9578063ce56c98b146106dc578063d07a7a84146106ef578063db9bee46146106f9578063dedf672614610701578063e2e1e8e914610714578063e6f5005414610734578063ebf6ddaf14610747578063ec9c218d1461074f578063eff0f59214610762578063f2fde38b14610797575b600080fd5b61026a61024e36600461502b565b610109602052600090815260409020546001600160a01b031681565b6040516102779190615048565b60405180910390f35b61029361028e36600461502b565b6107aa565b604051610277919060006101208201905060018060a01b0383511682526020830151602083015260408301516040830152606083015160608301526080830151608083015260a083015160a083015260c083015160c083015260e083015160e083015261010083015161010083015292915050565b6103126101085481565b604051908152602001610277565b61035561032e36600461502b565b609c6020526000908152604090208054600182015460028301546003909301549192909184565b604080519485526020850193909352918301526060820152608001610277565b61038861038336600461506e565b610837565b005b600254600160c01b900463ffffffff1660405163ffffffff9091168152602001610277565b6103886103bd3660046150cc565b610850565b6103886103d036600461512e565b610a7d565b610388610a93565b6103886103eb366004615167565b610acf565b6103f8610ad9565b604051610277929190615180565b61041961041436600461502b565b610aec565b604051610277939291906151e7565b61043b61043636600461502b565b610c20565b6040805196151587526001600160a01b039095166020870152938501929092526060840152608083015260a082015260c001610277565b61047a610cdc565b6040519015158152602001610277565b61031261049836600461502b565b60d16020526000908152604090205481565b6103886104b836600461502b565b610cf1565b6105146104cb36600461502b565b604080518082018252600080825260209182018190526001600160a01b03938416815260d082528290208251808401909352805490931682526001909201549181019190915290565b6040805182516001600160a01b031681526020928301519281019290925201610277565b610388610cfb565b610548610d0d565b60405161027792919061521c565b610388610564366004615167565b610d18565b610388610577366004615236565b610d29565b61038861058a366004615167565b610d41565b61038861059d3660046150cc565b610db6565b6105aa610f44565b604051610277929190615277565b6103886105c6366004615236565b610f54565b6103886105d9366004615167565b6110c4565b6103886110d8565b6105ee611112565b6040516102779796959493929190615285565b61031260d25481565b61026a6111bb565b61047a61062036600461502b565b60676020526000908152604090205460ff1681565b61064861064336600461531d565b6111d6565b6040516102779190615392565b6103126106633660046153f7565b6112be565b61047a61067636600461502b565b611492565b61026a6114b0565b61038861069136600461545f565b6114ba565b6103886106a43660046150cc565b611638565b6103126106b736600461502b565b609a6020526000908152604090205481565b6103886106d73660046150cc565b611777565b6103126106ea3660046154a7565b611860565b6103126101075481565b61026a611873565b61038861070f3660046150cc565b61187d565b610312610722366004615167565b600090815260d3602052604090205490565b610388610742366004615167565b611a0b565b61026a611a1c565b61038861075d36600461502b565b611a26565b610355610770366004615167565b609b6020526000908152604090208054600182015460028301546003909301549192909184565b6103886107a536600461502b565b611aa8565b6107b2614fae565b506001600160a01b03908116600090815260cf6020908152604091829020825161012081018452815490941684526001810154918401919091526002810154918301919091526003810154606083015260048101546080830152600581015460a0830152600681015460c0830152600781015460e08301526008015461010082015290565b61083f611ae3565b61084881611b15565b50565b905090565b82610859611b69565b6001600160a01b0316637c145cc78230336040518463ffffffff1660e01b8152600401610888939291906154d5565b602060405180830381865afa1580156108a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108c991906154f8565b813390916108f55760405163cc5d3c8b60e01b81526004016108ec929190615515565b60405180910390fd5b505083600061090382611b8d565b905061090e81611c90565b610919816000611cce565b610921611db8565b6000808061093187890189615646565b925092509250600083511161095957604051630783843960e51b815260040160405180910390fd5b600082511161097b57604051631e63bd9560e21b815260040160405180910390fd5b6001600160a01b03891660009081526101066020526040902054156109b357604051630d06866d60e21b815260040160405180910390fd5b6040805160608101825242815260208082018681528284018690526001600160a01b038d16600090815261010690925292902081518155915190919060018201906109fe9082615742565b5060408201516002820190610a139082615742565b5050506001600160a01b03811615610a2f57610a2f8982611dde565b886001600160a01b03167f159567bea25499a91f60e1fbb349ff2a1f8c1b2883198f25c1e12c99eddb44fa8989604051610a6a929190615800565b60405180910390a2505050505050505050565b610a85611ae3565b610a8f8282611e35565b5050565b3360008181526067602052604090205460ff16610ac4576040516372e3ef9760e01b81526004016108ec9190615048565b50610acd611eeb565b565b6108483382611f37565b600080610ae4611fdd565b915091509091565b6101066020526000908152604090208054600182018054919291610b0f906156c1565b80601f0160208091040260200160405190810160405280929190818152602001828054610b3b906156c1565b8015610b885780601f10610b5d57610100808354040283529160200191610b88565b820191906000526020600020905b815481529060010190602001808311610b6b57829003601f168201915b505050505090806002018054610b9d906156c1565b80601f0160208091040260200160405190810160405280929190818152602001828054610bc9906156c1565b8015610c165780601f10610beb57610100808354040283529160200191610c16565b820191906000526020600020905b815481529060010190602001808311610bf957829003601f168201915b5050505050905083565b6001600160a01b03808216600090815260cf60209081526040808320815161012081018352815490951685526001810154928501929092526002820154908401526003810154606084015260048101546080840152600581015460a0840152600681015460c0840152600781015460e0840152600801546101008301529081908190819081908190610cb181612054565b81516020830151604084015160c085015160e090950151939c929b5090995097509195509350915050565b600080610ce7612073565b5460ff1692915050565b6108483382611dde565b610d03611ae3565b610acd6000612097565b600080610ae46120f3565b610d20611ae3565b6108488161216a565b610d31611ae3565b610d3c83838361219f565b505050565b610d49611ae3565b610d5681620f4240101590565b8190610d7857604051631c9c717b60e01b81526004016108ec91815260200190565b506101088190556040518181527f6deef78ffe3df79ae5cd8e40b842c36ac6077e13746b9b68a9f327537b01e4e9906020015b60405180910390a150565b82610dbf611b69565b6001600160a01b0316637c145cc78230336040518463ffffffff1660e01b8152600401610dee939291906154d5565b602060405180830381865afa158015610e0b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e2f91906154f8565b81339091610e525760405163cc5d3c8b60e01b81526004016108ec929190615515565b50506001600160a01b0384166000908152610106602052604090205484908190610e905760405163ee27189960e01b81526004016108ec9190615048565b50610e99611db8565b6000610ea78486018661502b565b90506001600160a01b038616610ebe60cf836121f2565b51879183916001600160a01b031614610eec5760405163c0bbff1360e01b81526004016108ec929190615515565b5050610ef9816000612277565b856001600160a01b03167f73330c218a680717e9eee625c262df66eddfdf99ecb388d25f6b32d66b9a318a8686604051610f34929190615800565b60405180910390a2505050505050565b600080610ae46000546001549091565b82610f5d611b69565b6001600160a01b0316637c145cc78230336040518463ffffffff1660e01b8152600401610f8c939291906154d5565b602060405180830381865afa158015610fa9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fcd91906154f8565b81339091610ff05760405163cc5d3c8b60e01b81526004016108ec929190615515565b5050836000610ffe82611b8d565b905061100981611c90565b611014816000611cce565b6001600160a01b03861660009081526101066020526040902054869081906110505760405163ee27189960e01b81526004016108ec9190615048565b50611059611db8565b6001600160a01b03871661106e60cf886121f2565b51889188916001600160a01b03161461109c5760405163c0bbff1360e01b81526004016108ec929190615515565b50506110bb8686600260189054906101000a900463ffffffff166123d9565b50505050505050565b6110cc611ae3565b610848816000196126d7565b3360008181526067602052604090205460ff16611109576040516372e3ef9760e01b81526004016108ec9190615048565b50610acd612746565b600060608060008060006060600061112861278d565b805490915015801561113c57506001810154155b6111805760405162461bcd60e51b81526020600482015260156024820152741152540dcc4c8e88155b9a5b9a5d1a585b1a5e9959605a1b60448201526064016108ec565b6111886127b1565b611190612852565b60408051600080825260208201909252600f60f81b9c939b5091995046985030975095509350915050565b6000806111c661286f565b546001600160a01b031692915050565b604080516000815260208101909152606090826001600160401b038111156112005761120061552f565b60405190808252806020026020018201604052801561123357816020015b606081526020019060019003908161121e5790505b50915060005b838110156112b5576112903086868481811061125757611257615858565b9050602002810190611269919061586e565b8560405160200161127c939291906158b4565b604051602081830303815290604052612893565b8382815181106112a2576112a2615858565b6020908102919091010152600101611239565b50505b92915050565b6000846112c9611b69565b6001600160a01b0316637c145cc78230336040518463ffffffff1660e01b81526004016112f8939291906154d5565b602060405180830381865afa158015611315573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061133991906154f8565b8133909161135c5760405163cc5d3c8b60e01b81526004016108ec929190615515565b505085600061136a82611b8d565b905061137581611c90565b611380816000611cce565b6001600160a01b03881660009081526101066020526040902054889081906113bc5760405163ee27189960e01b81526004016108ec9190615048565b506113c5611db8565b6000808960028111156113da576113da6158db565b036113f1576113ea8a8989612909565b9050611430565b6002896002811115611405576114056158db565b03611415576113ea8a8989612e1d565b8860405163047031cf60e41b81526004016108ec9190615913565b886002811115611442576114426158db565b8a6001600160a01b03167f54fe682bfb66381a9382e13e4b95a3dd4f960eafbae063fdea3539d144ff3ff58360405161147d91815260200190565b60405180910390a39998505050505050505050565b60006112b882600260189054906101000a900463ffffffff16612ec1565b600061084b612ee0565b60006114c4612f04565b805490915060ff600160401b82041615906001600160401b03166000811580156114eb5750825b90506000826001600160401b031660011480156115075750303b155b905081158015611515575080155b156115335760405163f92ee8a960e01b815260040160405180910390fd5b84546001600160401b0319166001178555831561155c57845460ff60401b1916600160401b1785555b61156589612f2d565b61156d612f3e565b611575612f46565b61157d612f5e565b6115c96040518060400160405280600f81526020016e53756267726170685365727669636560881b815250604051806040016040528060038152602001620312e360ec1b815250612f6e565b6115d5886000196126d7565b6115de87611b15565b6115e786612f88565b831561162d57845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b505050505050505050565b337f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03811682146116855760405163cdc0567f60e01b81526004016108ec929190615515565b50600090508061169783850185615921565b915091506116a3611b69565b6001600160a01b031663e76fede68684846116bc612fdf565b60405160e086901b6001600160e01b03191681526001600160a01b039485166004820152602481019390935260448301919091529091166064820152608401600060405180830381600087803b15801561171557600080fd5b505af1158015611729573d6000803e3d6000fd5b50505050846001600160a01b03167f02f2e74a11116e05b39159372cceb6739257b08d72f7171d208ff27bb6466c588360405161176891815260200190565b60405180910390a25050505050565b82611780611b69565b6001600160a01b0316637c145cc78230336040518463ffffffff1660e01b81526004016117af939291906154d5565b602060405180830381865afa1580156117cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117f091906154f8565b813390916118135760405163cc5d3c8b60e01b81526004016108ec929190615515565b505061181d611db8565b61182684613003565b6040516001600160a01b038516907ff53cf6521a1b5fc0c04bffa70374a4dc2e3474f2b2ac1643c3bcc54e2db4a93990600090a250505050565b600061186c8383613076565b9392505050565b600061084b612fdf565b82611886611b69565b6001600160a01b0316637c145cc78230336040518463ffffffff1660e01b81526004016118b5939291906154d5565b602060405180830381865afa1580156118d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118f691906154f8565b813390916119195760405163cc5d3c8b60e01b81526004016108ec929190615515565b505083600061192782611b8d565b905061193281611c90565b61193d816000611cce565b6001600160a01b03861660009081526101066020526040902054869081906119795760405163ee27189960e01b81526004016108ec9190615048565b50611982611db8565b6000808080611993898b018b615943565b93509350935093506119bb8b83868685600260189054906101000a900463ffffffff166130e5565b8a6001600160a01b03167fd3803eb82ef5b4cdff8646734ebbaf5b37441e96314b27ffd3d0940f12a038e78b8b6040516119f6929190615800565b60405180910390a25050505050505050505050565b611a13611ae3565b61084881612f88565b600061084b6132dc565b611a2e611db8565b6000611a3b60cf836121f2565b9050611a5260d2548261330090919063ffffffff16565b8290611a7157604051623477b560e51b81526004016108ec9190615048565b50611a7b8161333d565b158290611a9c576040516317c7b35d60e31b81526004016108ec9190615048565b50610a8f826001612277565b611ab0611ae3565b6001600160a01b038116611ada576000604051631e4fbdf760e01b81526004016108ec9190615048565b61084881612097565b33611aec6111bb565b6001600160a01b031614610acd573360405163118cdaa760e01b81526004016108ec9190615048565b6002805463ffffffff60c01b1916600160c01b63ffffffff8416908102919091179091556040519081527f472aba493f9fd1d136ec54986f619f3aa5caff964f0e731a9909fb9a1270211f90602001610dab565b7f000000000000000000000000000000000000000000000000000000000000000090565b6040805161014081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101829052610120810182905290611be6611b69565b6001600160a01b03166325d9897e84306040518363ffffffff1660e01b8152600401611c13929190615515565b61014060405180830381865afa158015611c31573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c5591906159d0565b90508060a001516001600160401b0316600014158390611c8957604051637b3c09bf60e01b81526004016108ec9190615048565b5092915050565b6020810151815161084891611ca491615845565b60005460015460405180604001604052806006815260200165746f6b656e7360d01b81525061335c565b600080611cd96120f3565b91509150600083611cee578460800151611cf4565b8460e001515b9050611d42816001600160401b0316846001600160401b0316846001600160401b03166040518060400160405280600d81526020016c1d1a185dda5b99d4195c9a5bd9609a1b81525061335c565b600080611d4d611fdd565b91509150600086611d62578760600151611d68565b8760c001515b9050611dae8163ffffffff168463ffffffff168463ffffffff166040518060400160405280600e81526020016d1b585e15995c9a599a595c90dd5d60921b81525061335c565b5050505050505050565b611dc0610cdc565b15610acd5760405163d93c066560e01b815260040160405180910390fd5b6001600160a01b038281166000818152610109602052604080822080546001600160a01b0319169486169485179055517e3215dc05a2fc4e6a1e2c2776311d207c730ee51085aae221acc5cbe6fb55c19190a35050565b6001600160a01b0382166000908152606760205260409020548290829060ff161515811514611e8a57604051635e67e54b60e01b81526001600160a01b039092166004830152151560248201526044016108ec565b50506001600160a01b038216600081815260676020908152604091829020805460ff191685151590811790915591519182527fa95bac2f3df0d40e8278281c1d39d53c60e4f2bf3550ca5665738d0916e89789910160405180910390a25050565b611ef3613390565b6000611efd612073565b805460ff1916815590507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b604051610dab9190615048565b6001600160a01b0382166000818152609c60209081526040808320815192830184905282820194909452805180830382018152606090920190528190611f8b9084906133b5906133ca906134c590896134ea565b91509150846001600160a01b03167f13f3fa9f0e54af1af76d8b5d11c3973d7c2aed6312b61efff2f7b49d73ad67eb8383806020019051810190611fcf9190615a7d565b604051611768929190615277565b600080611fe8612fdf565b6001600160a01b031663bb2a2b476040518163ffffffff1660e01b8152600401602060405180830381865afa158015612025573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120499190615a96565b92620f424092509050565b60006120638260600151151590565b80156112b8575050608001511590565b7fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f0330090565b60006120a161286f565b80546001600160a01b038481166001600160a01b031983168117845560405193945091169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b6000806000612100612fdf565b6001600160a01b0316635aea0ec46040518163ffffffff1660e01b8152600401602060405180830381865afa15801561213d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121619190615ab3565b93849350915050565b60d28190556040518181527f21774046e2611ddb52c8c46e1ad97524eeb2e3fda7dcd9428867868b4c4d06ba90602001610dab565b6121ac60d08484846135a4565b80826001600160a01b0316846001600160a01b03167fd54c7abc930f6d506da2d08aa7aead4f2443e1db6d5f560384a2f652ff893e1960405160405180910390a4505050565b6121fa614fae565b6122048383613653565b604080516101208101825282546001600160a01b03168152600183015460208201526002830154918101919091526003820154606082015260048201546080820152600582015460a0820152600682015460c0820152600782015460e08201526008909101546101008201529392505050565b600061228460cf846121f2565b905061230f83612292613706565b6001600160a01b031663eeac3e0e84602001516040518263ffffffff1660e01b81526004016122c391815260200190565b6020604051808303816000875af11580156122e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123069190615a7d565b60cf919061372a565b61231a60cf846137dd565b8051604082015161232d9160d191613893565b806040015160d3600083602001518152602001908152602001600020546123549190615845565b60d3600083602001518152602001908152602001600020819055508060200151836001600160a01b031682600001516001600160a01b03167f08f2f865e0fb62d722a51e4d9873199bf6bf52e7d8ee5a2ee2896c9ef719f5458460400151866040516123cc9291909182521515602082015260400190565b60405180910390a4505050565b60006123e660cf856121f2565b90506123f181612054565b849061241157604051631eb5ff9560e01b81526004016108ec9190615048565b5080604001518314158484909161243d5760405163f32518cd60e01b81526004016108ec929190615ad0565b50506040810151808411156124735761246e612457611b69565b83516124638488615845565b60d192919087613911565b61248c565b815161248c906124838684615845565b60d19190613893565b6000612496613706565b6001600160a01b031663eeac3e0e84602001516040518263ffffffff1660e01b81526004016124c791815260200190565b6020604051808303816000875af11580156124e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061250a9190615a7d565b905060006125178461333d565b15612523576000612532565b60c08401516125329083615845565b6001600160a01b038816600090815260cf60205260409020600281018890556006018390559050612561613706565b6001600160a01b031663c8a5f81e84836040518363ffffffff1660e01b815260040161258e929190615277565b602060405180830381865afa1580156125ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125cf9190615a7d565b6001600160a01b038816600090815260cf6020526040812060070180549091906125fa908490615ae9565b909155505082861115612642576126118387615845565b60d360008660200151815260200190815260200160002060008282546126379190615ae9565b909155506126789050565b61264c8684615845565b60d360008660200151815260200190815260200160002060008282546126729190615845565b90915550505b8360200151876001600160a01b031685600001516001600160a01b03167f6db4a6f9be2d5e72eb2a2af2374ac487971bf342a261ba0bc1cf471bf2a2c31f89876040516126c6929190615277565b60405180910390a450505050505050565b8181808211156126fc5760405163ccccdafb60e01b81526004016108ec929190615277565b5050600082905560018190556040517f90699b8b4bf48918fea1129c85f9bc7b51285df7ecc982910813c7805f5688499061273a9084908490615277565b60405180910390a15050565b61274e611db8565b6000612758612073565b805460ff1916600117815590507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611f2a3390565b7fa16a46d94261c7517cc8ff89f61c0ce93598e3c849801011dee649a6a557d10090565b606060006127bd61278d565b90508060020180546127ce906156c1565b80601f01602080910402602001604051908101604052809291908181526020018280546127fa906156c1565b80156128475780601f1061281c57610100808354040283529160200191612847565b820191906000526020600020905b81548152906001019060200180831161282a57829003601f168201915b505050505091505090565b6060600061285e61278d565b90508060030180546127ce906156c1565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930090565b6060600080846001600160a01b0316846040516128b09190615afc565b600060405180830381855af49150503d80600081146128eb576040519150601f19603f3d011682016040523d82523d6000602084013e6128f0565b606091505b5091509150612900858383613a0f565b95945050505050565b6000808061291984860186615b3a565b8151604001519193509150866001600160a01b038281169082161461295357604051631a071d0760e01b81526004016108ec929190615515565b50508151516001600160a01b038111156129835760405163fa4ac7a760e01b81526004016108ec91815260200190565b50815151600061299460cf836121f2565b805190915088906001600160a01b03818116908316146129c957604051634508fbf760e11b81526004016108ec929190615515565b505060208101516129db896000611f37565b60008060006129e8613a62565b6001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401612a139190615048565b602060405180830381865afa158015612a30573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a549190615a7d565b9050612a5e6132dc565b6001600160a01b031663692209ce6000612afc8b612a7a612ee0565b6001600160a01b0316634c4ea0ed8a6040518263ffffffff1660e01b8152600401612aa791815260200190565b602060405180830381865afa158015612ac4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ae891906154f8565b612af3576000613a86565b61010854613a86565b8a6040518463ffffffff1660e01b8152600401612b1b93929190615c71565b6020604051808303816000875af1158015612b3a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b5e9190615a7d565b92506000612b6a613a62565b6001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401612b959190615048565b602060405180830381865afa158015612bb2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bd69190615a7d565b9050818181811015612bfd57604051639db8bc9560e01b81526004016108ec929190615277565b50612c0a90508282615845565b92505082159050612db457612ca98b6101075484612c289190615ca1565b612c30612fdf565b6001600160a01b0316635aea0ec46040518163ffffffff1660e01b8152600401602060405180830381865afa158015612c6d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c919190615ab3565b612ca4906001600160401b031642615ae9565b613ada565b8015612db457612cb7613706565b6001600160a01b0316631d1c2fec846040518263ffffffff1660e01b8152600401612ce491815260200190565b6020604051808303816000875af1158015612d03573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d279190615a7d565b50612d4c612d33612ee0565b82612d3c613a62565b6001600160a01b03169190613c4a565b612d54612ee0565b6001600160a01b0316638157328884836040518363ffffffff1660e01b8152600401612d81929190615277565b600060405180830381600087803b158015612d9b57600080fd5b505af1158015612daf573d6000803e3d6000fd5b505050505b86516020908101516040805186815292830185905282018390526001600160a01b038088169291811691908e16907f184c452047299395d4f7f147eb8e823458a450798539be54aeed978f13d87ba29060600160405180910390a4509998505050505050505050565b6000808080612e2e85870187615cb8565b919450925090506001600160a01b038716612e4a60cf856121f2565b51889185916001600160a01b031614612e785760405163c0bbff1360e01b81526004016108ec929190615515565b50506002546001600160a01b0388811660009081526101096020526040902054612eb692869286928692600160c01b900463ffffffff169116613cf9565b979650505050505050565b6000612ed8612ece611b69565b60d19085856142d6565b159392505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b6000807ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a006112b8565b612f35614370565b61084881614395565b610acd614370565b612f4e614370565b612f5661439d565b610acd612f3e565b612f66614370565b612f56612f3e565b612f76614370565b612f8082826143df565b610a8f612f3e565b80600003612fa95760405163bc71a04360e01b815260040160405180910390fd5b6101078190556040518181527f2aaaf20b08565eebc0c962cd7c568e54c3c0c2b85a1f942b82cd1bd730fdcd2390602001610dab565b7f000000000000000000000000000000000000000000000000000000000000000090565b61300e8160016143f1565b613016611b69565b6001600160a01b0316633a78b732826040518263ffffffff1660e01b81526004016130419190615048565b600060405180830381600087803b15801561305b57600080fd5b505af115801561306f573d6000803e3d6000fd5b5050505050565b600061186c7f4bdee85c4b4a268f4895d1096d553c3e57bb2433c380e7b7ec8cb56cc4f7467384846040516020016130ca939291909283526001600160a01b03918216602084015216604082015260600190565b60405160208183030381529060405280519060200120614408565b6001600160a01b03851661310c57604051634ffdf5ef60e11b815260040160405180910390fd5b613117868684614435565b61312b613122611b69565b60d09087614484565b600061313561457a565b6001600160a01b031663766718086040518163ffffffff1660e01b8152600401602060405180830381865afa158015613172573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131969190615a7d565b90506000613226888888886131a9613706565b6001600160a01b031663eeac3e0e8c6040518263ffffffff1660e01b81526004016131d691815260200190565b6020604051808303816000875af11580156131f5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132199190615a7d565b60cf94939291908861459e565b905061323e613233611b69565b60d1908a8887613911565b806040015160d3600083602001518152602001908152602001600020546132659190615ae9565b60d36000836020015181526020019081526020016000208190555085876001600160a01b0316896001600160a01b03167fe5e185fab2b992c4727ff702a867d78b15fb176dbaa20c9c312a1c351d3f7f838460400151866040516132ca929190615277565b60405180910390a45050505050505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b60008061331584606001518560a00151614706565b61331f9042615845565b905061332a84612054565b801561333557508281115b949350505050565b600061334c8260600151151590565b80156112b8575050604001511590565b613367848484614716565b8185858590919293611dae57604051630871e13d60e01b81526004016108ec9493929190615d10565b613398610cdc565b610acd57604051638dfc202b60e01b815260040160405180910390fd5b6000908152609b602052604090206003015490565b6000606060006133d98561472d565b90504281604001511115613401575050604080516020810190915260008152600191506134be565b600080858060200190518101906134189190615d3f565b8451919350915061342d90609a908390613893565b86816001600160a01b03167f4c06b68820628a39c787d2db1faa0eeacd7b9474847b198b1e871fe6e5b93f4485600001518660400151604051613471929190615277565b60405180910390a382516134859083615ae9565b6040805160208101929092526001600160a01b038316908201526060016040516020818303038152906040529550600086945094505050505b9250929050565b6000908152609b60205260408120818155600181018290556002810182905560030155565b60006060876003015483111561351357604051634a411b9d60e11b815260040160405180910390fd5b600083156135215783613527565b88600301545b89549094505b801580159061353c5750600085115b156135955760008061355283898c63ffffffff16565b915091508115613563575050613595565b9650866135718c8c8b6147bb565b92508661357d81615d65565b975050838061358b90615d7c565b945050505061352d565b50989397509295505050505050565b6001600160a01b0380831660009081526020868152604091829020825180840190935280549093168252600190920154918101919091526135e490614842565b15829061360557604051632d7d25f160e21b81526004016108ec9190615048565b506040805180820182526001600160a01b0394851681526020808201938452938516600090815295909352909320905181546001600160a01b03191692169190911781559051600190910155565b6001600160a01b03808216600090815260208481526040808320815161012081018352815490951685526001810154928501929092526002820154908401526003810154606084015260048101546080840152600581015460a0840152600681015460c0840152600781015460e0840152600881015461010084015290916136de9060600151151590565b83906136fe576040516342daadaf60e01b81526004016108ec9190615048565b509392505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b60006137368484613653565b604080516101208101825282546001600160a01b03168152600183015460208201526002830154918101919091526003820154606082015260048201546080820152600582015460a0820152600682015460c0820152600782015460e082015260088201546101008201529091506137ad90612054565b600482015484916137d3576040516361b66e0d60e01b81526004016108ec929190615ad0565b5050600601555050565b60006137e98383613653565b604080516101208101825282546001600160a01b03168152600183015460208201526002830154918101919091526003820154606082015260048201546080820152600582015460a0820152600682015460c0820152600782015460e0820152600882015461010082015290915061386090612054565b60048201548391613886576040516361b66e0d60e01b81526004016108ec929190615ad0565b5050426004909101555050565b806000036138a057505050565b6001600160a01b03821660009081526020849052604090205481808210156138dd57604051635f8ec70960e01b81526004016108ec929190615277565b50506001600160a01b03821660009081526020849052604081208054839290613907908490615845565b9091555050505050565b811561306f576001600160a01b03831660009081526020869052604081205461393b908490615ae9565b90506000856001600160a01b031663872d04898630866040518463ffffffff1660e01b815260040161396f93929190615d95565b602060405180830381865afa15801561398c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906139b09190615a7d565b90508082818111156139d757604051635f8ec70960e01b81526004016108ec929190615277565b50506001600160a01b03851660009081526020889052604081208054869290613a01908490615ae9565b909155505050505050505050565b606082613a2457613a1f82614851565b61186c565b8151158015613a3b57506001600160a01b0384163b155b15613a5b5783604051639996b31560e01b81526004016108ec9190615048565b508061186c565b7f000000000000000000000000000000000000000000000000000000000000000090565b81516040908101516001600160a01b039081166000908152610109602090815290839020549251606093613ac39387938793929091169101615dbe565b604051602081830303815290604052905092915050565b81600003613afb57604051638f4c63d960e01b815260040160405180910390fd5b613b27613b06611b69565b600254609a91908690869063ffffffff600160c01b90910481169061391116565b6001600160a01b0383166000908152609c6020908152604080832060028082015483516001600160601b031930606090811b8216838901528b901b166034820152604880820192909252845180820390920182526068810180865282519287019290922060e882018652898352426088830190815260a883018a815260c8909301898152828a52609b909852959097209151825593516001820155925190830155915160039182015581015490919015613bf55760018201546000908152609b602052604090206003018190555b613bff828261487a565b80856001600160a01b03167f5d9e2c5278e41138269f5f980cfbea016d8c59816754502abc4d2f87aaea987f8686604051613c3b929190615277565b60405180910390a35050505050565b8015610d3c5760405163a9059cbb60e01b81526001600160a01b0384169063a9059cbb90613c7e9085908590600401615ad0565b6020604051808303816000875af1158015613c9d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613cc191906154f8565b610d3c5760405162461bcd60e51b815260206004820152600960248201526810ba3930b739b332b960b91b60448201526064016108ec565b600080613d0760cf886121f2565b9050613d1281612054565b8790613d3257604051631eb5ff9560e01b81526004016108ec9190615048565b506000613d4a60d2548361330090919063ffffffff16565b158015613d5d5750613d5b8261333d565b155b8015613d6857508615155b8015613de05750816101000151613d7d61457a565b6001600160a01b031663766718086040518163ffffffff1660e01b8152600401602060405180830381865afa158015613dba573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613dde9190615a7d565b115b613deb576000613e61565b613df3613706565b6001600160a01b031663db750926896040518263ffffffff1660e01b8152600401613e1e9190615048565b6020604051808303816000875af1158015613e3d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613e619190615a7d565b9050613ea088613e6f613706565b6001600160a01b031663eeac3e0e85602001516040518263ffffffff1660e01b81526004016122c391815260200190565b613eab60cf8961490d565b613eb660cf896149c3565b60008082156141ef576000613ec9611b69565b8551604051637573ef4f60e01b81526001600160a01b039290921691637573ef4f91613efc913090600290600401615e87565b602060405180830381865afa158015613f19573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613f3d9190615a7d565b90506000613f49611b69565b8651604051631584a17960e21b81526001600160a01b03929092169163561285e491613f79913090600401615515565b60a060405180830381865afa158015613f96573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613fba9190615eac565b90506000816020015111613fcf576000613fd9565b613fd98583614a7a565b925082156140ce57613fe9613a62565b6001600160a01b031663095ea7b3613fff611b69565b856040518363ffffffff1660e01b815260040161401d929190615ad0565b6020604051808303816000875af115801561403c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061406091906154f8565b50614069611b69565b865160405163ca94b0e960e01b81526001600160a01b03929092169163ca94b0e99161409b9130908890600401615f1f565b600060405180830381600087803b1580156140b557600080fd5b505af11580156140c9573d6000803e3d6000fd5b505050505b6140d88386615845565b935083156141ec576001600160a01b0388166141df576140f6613a62565b6001600160a01b031663095ea7b361410c611b69565b866040518363ffffffff1660e01b815260040161412a929190615ad0565b6020604051808303816000875af1158015614149573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061416d91906154f8565b50614176611b69565b8651604051633a30904960e11b81526001600160a01b0392909216916374612092916141a89130908990600401615f1f565b600060405180830381600087803b1580156141c257600080fd5b505af11580156141d6573d6000803e3d6000fd5b505050506141ec565b6141ec8885612d3c613a62565b50505b602084015184516001600160a01b03808d1691167f443f56bd2098d273b8c8120398789a41da5925db4ba2f656813fc5299ac57b1f8686868f8f61423161457a565b6001600160a01b031663766718086040518163ffffffff1660e01b8152600401602060405180830381865afa15801561426e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906142929190615a7d565b6040516142a496959493929190615f43565b60405180910390a483516142b89088612ec1565b156142c8576142c88a6001612277565b509098975050505050505050565b600080846001600160a01b031663872d04898530866040518463ffffffff1660e01b815260040161430993929190615d95565b602060405180830381865afa158015614326573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061434a9190615a7d565b6001600160a01b0385166000908152602088905260409020541115915050949350505050565b614378614ada565b610acd57604051631afcd79f60e31b815260040160405180910390fd5b611ab0614370565b6143a5614370565b6143b260006000196126d7565b6143c06000620f4240614af4565b6143d260006001600160401b03614bc5565b610acd63ffffffff611b15565b6143e7614370565b610a8f8282614c52565b60006143fc83611b8d565b9050610d3c8183611cce565b60006112b8614415614c93565b8360405161190160f01b8152600281019290925260228201526042902090565b600061444a6144448585613076565b83614c9d565b905080836001600160a01b038083169082161461447c57604051638c5b935d60e01b81526004016108ec929190615515565b505050505050565b6001600160a01b0380821660009081526020858152604091829020825180840190935280549093168252600190920154918101919091526144c490614842565b1581906144e557604051632d7d25f160e21b81526004016108ec9190615048565b506040516378eb06b360e11b81526001600160a01b0383169063f1d60d6690614512908490600401615048565b602060405180830381865afa15801561452f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061455391906154f8565b15819061457457604051632d7d25f160e21b81526004016108ec9190615048565b50505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b6145a6614fae565b6001600160a01b03808716600090815260208a8152604091829020825161012081018452815490941684526001810154918401919091526002810154918301919091526003810154606083015260048101546080830152600581015460a0830152600681015460c0830152600781015460e0830152600801546101008201526146329060600151151590565b15869061465357604051630bc4def560e01b81526004016108ec9190615048565b505060408051610120810182526001600160a01b0397881681526020808201968752818301958652426060830190815260006080840181815260a0850182815260c0860198895260e0860183815261010087019889529b8d1683529c90935293909320825181546001600160a01b0319169a169990991789559551600189015593516002880155516003870155925160048601559451600585015593516006840155905160078301555160089091015590565b600082821882841102821861186c565b600082841015801561333557505090911115919050565b61475b6040518060800160405280600081526020016000815260200160008152602001600080191681525090565b6000828152609b602090815260409182902082516080810184528154815260018201549281018390526002820154938101939093526003015460608301528390611c895760405163107349a960e21b81526004016108ec91815260200190565b6000808460030154116147e15760405163ddaf8f2160e01b815260040160405180910390fd5b60006147f485600001548563ffffffff16565b905061480785600001548463ffffffff16565b600185600301600082825461481c9190615845565b9091555050808555600385015460000361483857600060018601555b5050915492915050565b516001600160a01b0316151590565b8051156148615780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b6127108260030154106148a0576040516303a8c56b60e61b815260040160405180910390fd5b806148be57604051638f4a893d60e01b815260040160405180910390fd5b60018083018290556002830180546000906148da908490615ae9565b909155505060038201546000036148ef578082555b60018260030160008282546149049190615ae9565b90915550505050565b60006149198383613653565b604080516101208101825282546001600160a01b03168152600183015460208201526002830154918101919091526003820154606082015260048201546080820152600582015460a0820152600682015460c0820152600782015460e0820152600882015461010082015290915061499090612054565b600482015483916149b6576040516361b66e0d60e01b81526004016108ec929190615ad0565b5050426005909101555050565b60006149cf8383613653565b604080516101208101825282546001600160a01b03168152600183015460208201526002830154918101919091526003820154606082015260048201546080820152600582015460a0820152600682015460c0820152600782015460e08201526008820154610100820152909150614a4690612054565b60048201548391614a6c576040516361b66e0d60e01b81526004016108ec929190615ad0565b505060006007909101555050565b6000614a8983620f4240101590565b80614a9c5750614a9c82620f4240101590565b83839091614abf5760405163768bf0eb60e11b81526004016108ec929190615277565b50620f42409050614ad08385615ca1565b61186c9190615f81565b6000614ae4612f04565b54600160401b900460ff16919050565b818163ffffffff8082169083161115614b225760405163ccccdafb60e01b81526004016108ec929190615180565b508290508163ffffffff8116620f42401015614b535760405163ccccdafb60e01b81526004016108ec929190615180565b50506002805463ffffffff838116600160a01b0263ffffffff60a01b19918616600160801b0291909116600160801b600160c01b0319909216919091171790556040517f2fe5a7039987697813605cc0b9d6db7aab575408e3fc59e8a457bef8d7bc0a369061273a9084908490615180565b81816001600160401b038082169083161115614bf65760405163ccccdafb60e01b81526004016108ec92919061521c565b5050600280546001600160401b03838116600160401b026001600160801b0319909216908516171790556040517f2867e04c500e438761486b78021d4f9eb97c77ff45d10c1183f5583ba4cbf7d19061273a908490849061521c565b614c5a614370565b6000614c6461278d565b905060028101614c748482615742565b5060038101614c838382615742565b5060008082556001909101555050565b600061084b614cc7565b600080600080614cad8686614d3b565b925092509250614cbd8282614d88565b5090949350505050565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f614cf2614e41565b614cfa614ea8565b60408051602081019490945283019190915260608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b60008060008351604103614d755760208401516040850151606086015160001a614d6788828585614ee9565b955095509550505050614d81565b50508151600091506002905b9250925092565b6000826003811115614d9c57614d9c6158db565b03614da5575050565b6001826003811115614db957614db96158db565b03614dd75760405163f645eedf60e01b815260040160405180910390fd5b6002826003811115614deb57614deb6158db565b03614e0c5760405163fce698f760e01b8152600481018290526024016108ec565b6003826003811115614e2057614e206158db565b03610a8f576040516335e2f38360e21b8152600481018290526024016108ec565b600080614e4c61278d565b90506000614e586127b1565b805190915015614e7057805160209091012092915050565b81548015614e7f579392505050565b7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470935050505090565b600080614eb361278d565b90506000614ebf612852565b805190915015614ed757805160209091012092915050565b60018201548015614e7f579392505050565b600080806fa2a8918ca85bafe22016d0b997e4df60600160ff1b03841115614f1a5750600091506003905082614fa4565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa158015614f6e573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116614f9a57506000925060019150829050614fa4565b9250600091508190505b9450945094915050565b60405180610120016040528060006001600160a01b0316815260200160008019168152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b6001600160a01b038116811461084857600080fd5b803561502681615006565b919050565b60006020828403121561503d57600080fd5b813561186c81615006565b6001600160a01b0391909116815260200190565b63ffffffff8116811461084857600080fd5b60006020828403121561508057600080fd5b813561186c8161505c565b60008083601f84011261509d57600080fd5b5081356001600160401b038111156150b457600080fd5b6020830191508360208285010111156134be57600080fd5b6000806000604084860312156150e157600080fd5b83356150ec81615006565b925060208401356001600160401b0381111561510757600080fd5b6151138682870161508b565b9497909650939450505050565b801515811461084857600080fd5b6000806040838503121561514157600080fd5b823561514c81615006565b9150602083013561515c81615120565b809150509250929050565b60006020828403121561517957600080fd5b5035919050565b63ffffffff92831681529116602082015260400190565b60005b838110156151b257818101518382015260200161519a565b50506000910152565b600081518084526151d3816020860160208601615197565b601f01601f19169290920160200192915050565b83815260606020820152600061520060608301856151bb565b828103604084015261521281856151bb565b9695505050505050565b6001600160401b0392831681529116602082015260400190565b60008060006060848603121561524b57600080fd5b833561525681615006565b9250602084013561526681615006565b929592945050506040919091013590565b918252602082015260400190565b60ff60f81b8816815260e0602082015260006152a460e08301896151bb565b82810360408401526152b681896151bb565b606084018890526001600160a01b038716608085015260a0840186905283810360c08501528451808252602080870193509091019060005b8181101561530c5783518352602093840193909201916001016152ee565b50909b9a5050505050505050505050565b6000806020838503121561533057600080fd5b82356001600160401b0381111561534657600080fd5b8301601f8101851361535757600080fd5b80356001600160401b0381111561536d57600080fd5b8560208260051b840101111561538257600080fd5b6020919091019590945092505050565b6000602082016020835280845180835260408501915060408160051b86010192506020860160005b828110156153eb57603f198786030184526153d68583516151bb565b945060209384019391909101906001016153ba565b50929695505050505050565b6000806000806060858703121561540d57600080fd5b843561541881615006565b935060208501356003811061542c57600080fd5b925060408501356001600160401b0381111561544757600080fd5b6154538782880161508b565b95989497509550505050565b6000806000806080858703121561547557600080fd5b843561548081615006565b93506020850135925060408501356154978161505c565b9396929550929360600135925050565b600080604083850312156154ba57600080fd5b82356154c581615006565b9150602083013561515c81615006565b6001600160a01b0393841681529183166020830152909116604082015260600190565b60006020828403121561550a57600080fd5b815161186c81615120565b6001600160a01b0392831681529116602082015260400190565b634e487b7160e01b600052604160045260246000fd5b60405161014081016001600160401b03811182821017156155685761556861552f565b60405290565b604080519081016001600160401b03811182821017156155685761556861552f565b60405160e081016001600160401b03811182821017156155685761556861552f565b600082601f8301126155c357600080fd5b8135602083016000806001600160401b038411156155e3576155e361552f565b50604051601f19601f85018116603f011681018181106001600160401b03821117156156115761561161552f565b60405283815290508082840187101561562957600080fd5b838360208301376000602085830101528094505050505092915050565b60008060006060848603121561565b57600080fd5b83356001600160401b0381111561567157600080fd5b61567d868287016155b2565b93505060208401356001600160401b0381111561569957600080fd5b6156a5868287016155b2565b92505060408401356156b681615006565b809150509250925092565b600181811c908216806156d557607f821691505b6020821081036156f557634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115610d3c57806000526020600020601f840160051c810160208510156157225750805b601f840160051c820191505b8181101561306f576000815560010161572e565b81516001600160401b0381111561575b5761575b61552f565b61576f8161576984546156c1565b846156fb565b6020601f8211600181146157a3576000831561578b5750848201515b600019600385901b1c1916600184901b17845561306f565b600084815260208120601f198516915b828110156157d357878501518255602094850194600190920191016157b3565b50848210156157f15786840151600019600387901b60f8161c191681555b50505050600190811b01905550565b60208152816020820152818360408301376000818301604090810191909152601f909201601f19160101919050565b634e487b7160e01b600052601160045260246000fd5b818103818111156112b8576112b861582f565b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261588557600080fd5b8301803591506001600160401b0382111561589f57600080fd5b6020019150368190038213156134be57600080fd5b8284823760008382016000815283516158d1818360208801615197565b0195945050505050565b634e487b7160e01b600052602160045260246000fd5b6003811061590f57634e487b7160e01b600052602160045260246000fd5b9052565b602081016112b882846158f1565b6000806040838503121561593457600080fd5b50508035926020909101359150565b6000806000806080858703121561595957600080fd5b8435935060208501359250604085013561597281615006565b915060608501356001600160401b0381111561598d57600080fd5b615999878288016155b2565b91505092959194509250565b80516150268161505c565b6001600160401b038116811461084857600080fd5b8051615026816159b0565b60006101408284031280156159e457600080fd5b5060006159ef615545565b835181526020808501519082015260408085015190820152615a13606085016159a5565b6060820152615a24608085016159c5565b6080820152615a3560a085016159c5565b60a0820152615a4660c085016159a5565b60c0820152615a5760e085016159c5565b60e082015261010084810151908201526101209384015193810193909352509092915050565b600060208284031215615a8f57600080fd5b5051919050565b600060208284031215615aa857600080fd5b815161186c8161505c565b600060208284031215615ac557600080fd5b815161186c816159b0565b6001600160a01b03929092168252602082015260400190565b808201808211156112b8576112b861582f565b60008251615b0e818460208701615197565b9190910192915050565b8035615026816159b0565b80356001600160801b038116811461502657600080fd5b60008060408385031215615b4d57600080fd5b82356001600160401b03811115615b6357600080fd5b830160408186031215615b7557600080fd5b615b7d61556e565b81356001600160401b03811115615b9357600080fd5b820160e08188031215615ba557600080fd5b615bad615590565b81358152615bbd6020830161501b565b6020820152615bce6040830161501b565b6040820152615bdf6060830161501b565b6060820152615bf060808301615b18565b6080820152615c0160a08301615b23565b60a082015260c08201356001600160401b03811115615c1f57600080fd5b615c2b898285016155b2565b60c08301525082525060208201356001600160401b03811115615c4d57600080fd5b615c59878285016155b2565b60208381019190915291979590910135955050505050565b615c7b81856158f1565b606060208201526000615c9160608301856151bb565b9050826040830152949350505050565b80820281158282048414176112b8576112b861582f565b600080600060608486031215615ccd57600080fd5b8335615cd881615006565b92506020840135915060408401356001600160401b03811115615cfa57600080fd5b615d06868287016155b2565b9150509250925092565b608081526000615d2360808301876151bb565b6020830195909552506040810192909252606090910152919050565b60008060408385031215615d5257600080fd5b8251602084015190925061515c81615006565b600081615d7457615d7461582f565b506000190190565b600060018201615d8e57615d8e61582f565b5060010190565b6001600160a01b03938416815291909216602082015263ffffffff909116604082015260600190565b606080825284516040838301819052815160a085015260208201516001600160a01b0390811660c086015290820151811660e08501529181015190911661010083015260808101516001600160401b038116610120840152600091905060a08101516001600160801b0381166101408501525060c0015160e0610160840152615e4b6101808401826151bb565b90506020860151605f19848303016080850152615e6882826151bb565b9250505083602083015261333560408301846001600160a01b03169052565b6001600160a01b038481168252831660208201526060810161333560408301846158f1565b600060a0828403128015615ebf57600080fd5b5060405160009060a081016001600160401b0381118282101715615ee557615ee561552f565b6040908152845182526020808601519083015284810151908201526060808501519082015260809384015193810193909352509092915050565b6001600160a01b039384168152919092166020820152604081019190915260600190565b86815285602082015284604082015283606082015260c060808201526000615f6e60c08301856151bb565b90508260a0830152979650505050505050565b600082615f9e57634e487b7160e01b600052601260045260246000fd5b50049056fea2646970667358221220b85de947a2adf153b4d5d66360454c8d0624bca998d3fc8f12bd17e31d74127864736f6c634300081b00330000000000000000000000000750eda3185c758247e97819074bcd217a815fae0000000000000000000000001a7fb71014d4395903ec56662f32dd02344d361c000000000000000000000000b63bc33d13f73efd14d32d2b9fc0b6116b6611ce000000000000000000000000e135bfd9e51bbafcebb0141af85f0bc6da1b3ba4","id":1,"type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"SubgraphService#SubgraphService","networkInteractionId":1,"nonce":1646,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"SubgraphService#SubgraphService","networkInteractionId":1,"nonce":1646,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0x298eb5bad638cb45f1e0d1996bee1ba329fee71b79411f1336941d0ebbf54775"},"type":"TRANSACTION_SEND"} +{"artifactId":"SubgraphService#SubgraphServiceProxy","contractAddress":"0x00fe8F95407AB61863d27c07F584A0930ee5F3b0","contractName":"SubgraphServiceProxy","dependencies":[],"futureId":"SubgraphService#SubgraphServiceProxy","futureType":"CONTRACT_AT","strategy":"basic","strategyConfig":{},"type":"CONTRACT_AT_EXECUTION_STATE_INITIALIZE"} +{"futureId":"DisputeManager#DisputeManager","hash":"0x525564dabe54e35e863db1333ed6de28d8c426663bf174e23acb630760bd8274","networkInteractionId":1,"receipt":{"blockHash":"0x7ebfb3c9f0e8d272a89e6eea3d0b7798c779044c95c38df9a00484aa8e503b3b","blockNumber":152513364,"contractAddress":"0x75f7Bd9D2F0bca7bA7189BB582f5eb95afa051e8","logs":[{"address":"0x75f7Bd9D2F0bca7bA7189BB582f5eb95afa051e8","data":"0x000000000000000000000000afd60629034fbdc3ef58518b817bbdb4ec861c9300000000000000000000000070d5afaaaef8f2f095e83d6e6151146c18a5bb85000000000000000000000000aa1debfb7a7c0ba85cef858b6e70cfad943fd4a20000000000000000000000001ab05a65fa6d5f6a90a23693d5d40a4d927a815f0000000000000000000000007284213d1cda80c892a4388f38da431f063431440000000000000000000000001cebe1c314cc454baf4bd553409d957c833623c0000000000000000000000000e135bfd9e51bbafcebb0141af85f0bc6da1b3ba4","logIndex":0,"topics":["0xef5021414834d86e36470f5c1cecf6544fb2bb723f2ca51a4c86fcd8c5919a43","0x000000000000000000000000bbcb9a575176039c06f94d4d8337818318a26828","0x000000000000000000000000f5d432192daf7e8b045349693577ccf0b5165a12","0x0000000000000000000000000750eda3185c758247e97819074bcd217a815fae"]},{"address":"0x75f7Bd9D2F0bca7bA7189BB582f5eb95afa051e8","data":"0x000000000000000000000000000000000000000000000000ffffffffffffffff","logIndex":1,"topics":["0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2"]}],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"DisputeManager#DisputeManager","result":{"address":"0x75f7Bd9D2F0bca7bA7189BB582f5eb95afa051e8","type":"SUCCESS"},"type":"DEPLOYMENT_EXECUTION_STATE_COMPLETE"} +{"futureId":"SubgraphService#SubgraphService","hash":"0x298eb5bad638cb45f1e0d1996bee1ba329fee71b79411f1336941d0ebbf54775","networkInteractionId":1,"receipt":{"blockHash":"0x3235e1189a927cc4c89b401cb09600fe66de79561b6ee1808b73637d41af4c0f","blockNumber":152513379,"contractAddress":"0x30b34eAaF354cAdd64836Bc0846F4414254271ea","logs":[{"address":"0x30b34eAaF354cAdd64836Bc0846F4414254271ea","data":"0x000000000000000000000000afd60629034fbdc3ef58518b817bbdb4ec861c9300000000000000000000000070d5afaaaef8f2f095e83d6e6151146c18a5bb85000000000000000000000000aa1debfb7a7c0ba85cef858b6e70cfad943fd4a20000000000000000000000001ab05a65fa6d5f6a90a23693d5d40a4d927a815f0000000000000000000000007284213d1cda80c892a4388f38da431f063431440000000000000000000000001cebe1c314cc454baf4bd553409d957c833623c0000000000000000000000000e135bfd9e51bbafcebb0141af85f0bc6da1b3ba4","logIndex":0,"topics":["0xef5021414834d86e36470f5c1cecf6544fb2bb723f2ca51a4c86fcd8c5919a43","0x000000000000000000000000bbcb9a575176039c06f94d4d8337818318a26828","0x000000000000000000000000f5d432192daf7e8b045349693577ccf0b5165a12","0x0000000000000000000000000750eda3185c758247e97819074bcd217a815fae"]},{"address":"0x30b34eAaF354cAdd64836Bc0846F4414254271ea","data":"0x00000000000000000000000030b34eaaf354cadd64836bc0846f4414254271ea0000000000000000000000001a7fb71014d4395903ec56662f32dd02344d361c000000000000000000000000b63bc33d13f73efd14d32d2b9fc0b6116b6611ce000000000000000000000000e135bfd9e51bbafcebb0141af85f0bc6da1b3ba4","logIndex":1,"topics":["0x4175b2c37456dbac494e08de8666d31bb8f3f2aee36ea5d9e06894ff3e4ddda7"]},{"address":"0x30b34eAaF354cAdd64836Bc0846F4414254271ea","data":"0x000000000000000000000000000000000000000000000000ffffffffffffffff","logIndex":2,"topics":["0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2"]}],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"SubgraphService#SubgraphService","result":{"address":"0x30b34eAaF354cAdd64836Bc0846F4414254271ea","type":"SUCCESS"},"type":"DEPLOYMENT_EXECUTION_STATE_COMPLETE"} +{"args":["0xade6b8eb69a49b56929c1d4f4b428d791861db6f","0x22d491Bde2303f2f43325b2108D26f1eAbA1e32b",2419200,"10000000000000000000000",500000,1000000],"artifactId":"DisputeManager#DisputeManager","dependencies":["DisputeManager#DisputeManager"],"functionName":"initialize","futureId":"DisputeManager#encodeFunctionCall(DisputeManager#DisputeManager.initialize)","result":"0x0bc7344b000000000000000000000000ade6b8eb69a49b56929c1d4f4b428d791861db6f00000000000000000000000022d491bde2303f2f43325b2108d26f1eaba1e32b000000000000000000000000000000000000000000000000000000000024ea0000000000000000000000000000000000000000000000021e19e0c9bab2400000000000000000000000000000000000000000000000000000000000000007a12000000000000000000000000000000000000000000000000000000000000f4240","strategy":"basic","strategyConfig":{},"type":"ENCODE_FUNCTION_CALL_EXECUTION_STATE_INITIALIZE"} +{"args":["0xade6b8eb69a49b56929c1d4f4b428d791861db6f","100000000000000000000000",16,2],"artifactId":"SubgraphService#SubgraphService","dependencies":["SubgraphService#SubgraphService"],"functionName":"initialize","futureId":"SubgraphService#encodeFunctionCall(SubgraphService#SubgraphService.initialize)","result":"0xc84a5ef3000000000000000000000000ade6b8eb69a49b56929c1d4f4b428d791861db6f00000000000000000000000000000000000000000000152d02c7e14af680000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000002","strategy":"basic","strategyConfig":{},"type":"ENCODE_FUNCTION_CALL_EXECUTION_STATE_INITIALIZE"} +{"args":["0x1A7Fb71014d4395903eC56662f32dD02344D361C","0x75f7Bd9D2F0bca7bA7189BB582f5eb95afa051e8","0x0bc7344b000000000000000000000000ade6b8eb69a49b56929c1d4f4b428d791861db6f00000000000000000000000022d491bde2303f2f43325b2108d26f1eaba1e32b000000000000000000000000000000000000000000000000000000000024ea0000000000000000000000000000000000000000000000021e19e0c9bab2400000000000000000000000000000000000000000000000000000000000000007a12000000000000000000000000000000000000000000000000000000000000f4240"],"artifactId":"DisputeManager#ProxyAdmin","contractAddress":"0x9a8C3B6D649108bd11670de0B9b981ae3C167707","dependencies":["DisputeManager#ProxyAdmin","DisputeManager#DisputeManagerProxy","DisputeManager#DisputeManager","DisputeManager#encodeFunctionCall(DisputeManager#DisputeManager.initialize)"],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","functionName":"upgradeAndCall","futureId":"DisputeManager#ProxyAdmin.upgradeAndCall","strategy":"basic","strategyConfig":{},"type":"CALL_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"DisputeManager#ProxyAdmin.upgradeAndCall","networkInteraction":{"data":"0x9623609d0000000000000000000000001a7fb71014d4395903ec56662f32dd02344d361c00000000000000000000000075f7bd9d2f0bca7ba7189bb582f5eb95afa051e8000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000c40bc7344b000000000000000000000000ade6b8eb69a49b56929c1d4f4b428d791861db6f00000000000000000000000022d491bde2303f2f43325b2108d26f1eaba1e32b000000000000000000000000000000000000000000000000000000000024ea0000000000000000000000000000000000000000000000021e19e0c9bab2400000000000000000000000000000000000000000000000000000000000000007a12000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000","id":1,"to":"0x9a8C3B6D649108bd11670de0B9b981ae3C167707","type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"DisputeManager#ProxyAdmin.upgradeAndCall","networkInteractionId":1,"nonce":1647,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"DisputeManager#ProxyAdmin.upgradeAndCall","networkInteractionId":1,"nonce":1647,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0xde8309972e5cf0f3f2029f80a9dbf2589f7ecde04d82fe6cff88a21a0336eb00"},"type":"TRANSACTION_SEND"} +{"args":["0x00fe8F95407AB61863d27c07F584A0930ee5F3b0","0x30b34eAaF354cAdd64836Bc0846F4414254271ea","0xc84a5ef3000000000000000000000000ade6b8eb69a49b56929c1d4f4b428d791861db6f00000000000000000000000000000000000000000000152d02c7e14af680000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000002"],"artifactId":"SubgraphService#ProxyAdmin","contractAddress":"0xD23a972f47B7D45E729AB9B8399D628c87b6C0d6","dependencies":["SubgraphService#ProxyAdmin","SubgraphService#SubgraphServiceProxy","SubgraphService#SubgraphService","SubgraphService#encodeFunctionCall(SubgraphService#SubgraphService.initialize)"],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","functionName":"upgradeAndCall","futureId":"SubgraphService#ProxyAdmin.upgradeAndCall","strategy":"basic","strategyConfig":{},"type":"CALL_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"SubgraphService#ProxyAdmin.upgradeAndCall","networkInteraction":{"data":"0x9623609d00000000000000000000000000fe8f95407ab61863d27c07f584a0930ee5f3b000000000000000000000000030b34eaaf354cadd64836bc0846f4414254271ea00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000084c84a5ef3000000000000000000000000ade6b8eb69a49b56929c1d4f4b428d791861db6f00000000000000000000000000000000000000000000152d02c7e14af68000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000","id":1,"to":"0xD23a972f47B7D45E729AB9B8399D628c87b6C0d6","type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"SubgraphService#ProxyAdmin.upgradeAndCall","networkInteractionId":1,"nonce":1648,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"SubgraphService#ProxyAdmin.upgradeAndCall","networkInteractionId":1,"nonce":1648,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0x16944acdc1b3b5131f85dd8d3bc2c993c963afeed19a28b92d32c4b12e1487c4"},"type":"TRANSACTION_SEND"} +{"futureId":"DisputeManager#ProxyAdmin.upgradeAndCall","hash":"0xde8309972e5cf0f3f2029f80a9dbf2589f7ecde04d82fe6cff88a21a0336eb00","networkInteractionId":1,"receipt":{"blockHash":"0x0006f844409e13aa0667c1302bba90a019db312f8d825174cdad2bb474830869","blockNumber":152513405,"logs":[{"address":"0x1A7Fb71014d4395903eC56662f32dD02344D361C","data":"0x","logIndex":0,"topics":["0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b","0x00000000000000000000000075f7bd9d2f0bca7ba7189bb582f5eb95afa051e8"]},{"address":"0x1A7Fb71014d4395903eC56662f32dD02344D361C","data":"0x","logIndex":1,"topics":["0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0","0x0000000000000000000000000000000000000000000000000000000000000000","0x000000000000000000000000ade6b8eb69a49b56929c1d4f4b428d791861db6f"]},{"address":"0x1A7Fb71014d4395903eC56662f32dD02344D361C","data":"0x","logIndex":2,"topics":["0x51744122301b50e919f4e3d22adf8c53abc92195b8c667eda98c6ef20375672e","0x00000000000000000000000022d491bde2303f2f43325b2108d26f1eaba1e32b"]},{"address":"0x1A7Fb71014d4395903eC56662f32dD02344D361C","data":"0x000000000000000000000000000000000000000000000000000000000024ea00","logIndex":3,"topics":["0x310462a9bf49fff4a57910ec647c77cbf8aaf2f13394554ac6cdf14fc68db7e6"]},{"address":"0x1A7Fb71014d4395903eC56662f32dD02344D361C","data":"0x00000000000000000000000000000000000000000000021e19e0c9bab2400000","logIndex":4,"topics":["0x97896b9da0f97f36bf3011570bcff930069299de4b1e89c9cb44909841cac2f8"]},{"address":"0x1A7Fb71014d4395903eC56662f32dD02344D361C","data":"0x000000000000000000000000000000000000000000000000000000000007a120","logIndex":5,"topics":["0xc573dc0f869f6a1d0a74fc7712a63baabcb5567131d2d98005e163924eddcbab"]},{"address":"0x1A7Fb71014d4395903eC56662f32dD02344D361C","data":"0x00000000000000000000000000000000000000000000000000000000000f4240","logIndex":6,"topics":["0x7efaf01bec3cda8d104163bb466d01d7e16f68848301c7eb0749cfa59d680502"]},{"address":"0x1A7Fb71014d4395903eC56662f32dD02344D361C","data":"0x0000000000000000000000000000000000000000000000000000000000000001","logIndex":7,"topics":["0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2"]}],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"DisputeManager#ProxyAdmin.upgradeAndCall","result":{"type":"SUCCESS"},"type":"CALL_EXECUTION_STATE_COMPLETE"} +{"futureId":"SubgraphService#ProxyAdmin.upgradeAndCall","hash":"0x16944acdc1b3b5131f85dd8d3bc2c993c963afeed19a28b92d32c4b12e1487c4","networkInteractionId":1,"receipt":{"blockHash":"0x03b5ceb0f513d3bb64054fe7b0511d0511294982ed470c31e79e14c491442a13","blockNumber":152513417,"logs":[{"address":"0x00fe8F95407AB61863d27c07F584A0930ee5F3b0","data":"0x","logIndex":0,"topics":["0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b","0x00000000000000000000000030b34eaaf354cadd64836bc0846f4414254271ea"]},{"address":"0x00fe8F95407AB61863d27c07F584A0930ee5F3b0","data":"0x","logIndex":1,"topics":["0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0","0x0000000000000000000000000000000000000000000000000000000000000000","0x000000000000000000000000ade6b8eb69a49b56929c1d4f4b428d791861db6f"]},{"address":"0x00fe8F95407AB61863d27c07F584A0930ee5F3b0","data":"0x0000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff","logIndex":2,"topics":["0x90699b8b4bf48918fea1129c85f9bc7b51285df7ecc982910813c7805f568849"]},{"address":"0x00fe8F95407AB61863d27c07F584A0930ee5F3b0","data":"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f4240","logIndex":3,"topics":["0x2fe5a7039987697813605cc0b9d6db7aab575408e3fc59e8a457bef8d7bc0a36"]},{"address":"0x00fe8F95407AB61863d27c07F584A0930ee5F3b0","data":"0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffff","logIndex":4,"topics":["0x2867e04c500e438761486b78021d4f9eb97c77ff45d10c1183f5583ba4cbf7d1"]},{"address":"0x00fe8F95407AB61863d27c07F584A0930ee5F3b0","data":"0x00000000000000000000000000000000000000000000000000000000ffffffff","logIndex":5,"topics":["0x472aba493f9fd1d136ec54986f619f3aa5caff964f0e731a9909fb9a1270211f"]},{"address":"0x00fe8F95407AB61863d27c07F584A0930ee5F3b0","data":"0x00000000000000000000000000000000000000000000152d02c7e14af6800000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff","logIndex":6,"topics":["0x90699b8b4bf48918fea1129c85f9bc7b51285df7ecc982910813c7805f568849"]},{"address":"0x00fe8F95407AB61863d27c07F584A0930ee5F3b0","data":"0x0000000000000000000000000000000000000000000000000000000000000010","logIndex":7,"topics":["0x472aba493f9fd1d136ec54986f619f3aa5caff964f0e731a9909fb9a1270211f"]},{"address":"0x00fe8F95407AB61863d27c07F584A0930ee5F3b0","data":"0x0000000000000000000000000000000000000000000000000000000000000002","logIndex":8,"topics":["0x2aaaf20b08565eebc0c962cd7c568e54c3c0c2b85a1f942b82cd1bd730fdcd23"]},{"address":"0x00fe8F95407AB61863d27c07F584A0930ee5F3b0","data":"0x0000000000000000000000000000000000000000000000000000000000000001","logIndex":9,"topics":["0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2"]}],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"SubgraphService#ProxyAdmin.upgradeAndCall","result":{"type":"SUCCESS"},"type":"CALL_EXECUTION_STATE_COMPLETE"} +{"artifactId":"DisputeManager#DisputeManager_ProxyWithABI","contractAddress":"0x1A7Fb71014d4395903eC56662f32dD02344D361C","contractName":"DisputeManager_ProxyWithABI","dependencies":["DisputeManager#ProxyAdmin.upgradeAndCall","DisputeManager#DisputeManagerProxy"],"futureId":"DisputeManager#DisputeManager_ProxyWithABI","futureType":"CONTRACT_AT","strategy":"basic","strategyConfig":{},"type":"CONTRACT_AT_EXECUTION_STATE_INITIALIZE"} +{"artifactId":"SubgraphService#SubgraphService_ProxyWithABI","contractAddress":"0x00fe8F95407AB61863d27c07F584A0930ee5F3b0","contractName":"SubgraphService_ProxyWithABI","dependencies":["SubgraphService#ProxyAdmin.upgradeAndCall","SubgraphService#SubgraphServiceProxy"],"futureId":"SubgraphService#SubgraphService_ProxyWithABI","futureType":"CONTRACT_AT","strategy":"basic","strategyConfig":{},"type":"CONTRACT_AT_EXECUTION_STATE_INITIALIZE"} +{"args":["0x00fe8F95407AB61863d27c07F584A0930ee5F3b0"],"artifactId":"DisputeManager#DisputeManager_ProxyWithABI","contractAddress":"0x1A7Fb71014d4395903eC56662f32dD02344D361C","dependencies":["DisputeManager#DisputeManager_ProxyWithABI"],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","functionName":"setSubgraphService","futureId":"DisputeManager#DisputeManager_ProxyWithABI.setSubgraphService","strategy":"basic","strategyConfig":{},"type":"CALL_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"DisputeManager#DisputeManager_ProxyWithABI.setSubgraphService","networkInteraction":{"data":"0x93a90a1e00000000000000000000000000fe8f95407ab61863d27c07f584a0930ee5f3b0","id":1,"to":"0x1A7Fb71014d4395903eC56662f32dD02344D361C","type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"DisputeManager#DisputeManager_ProxyWithABI.setSubgraphService","networkInteractionId":1,"nonce":1649,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"DisputeManager#DisputeManager_ProxyWithABI.setSubgraphService","networkInteractionId":1,"nonce":1649,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0x23f016c9557b5342ee3d8c04995ccb8c675626cddfb9d86db98041da41f61ddc"},"type":"TRANSACTION_SEND"} +{"args":[100000],"artifactId":"SubgraphService#SubgraphService_ProxyWithABI","contractAddress":"0x00fe8F95407AB61863d27c07F584A0930ee5F3b0","dependencies":["SubgraphService#SubgraphService_ProxyWithABI"],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","functionName":"setCurationCut","futureId":"SubgraphService#SubgraphService_ProxyWithABI.setCurationCut","strategy":"basic","strategyConfig":{},"type":"CALL_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"SubgraphService#SubgraphService_ProxyWithABI.setCurationCut","networkInteraction":{"data":"0x7e89bac300000000000000000000000000000000000000000000000000000000000186a0","id":1,"to":"0x00fe8F95407AB61863d27c07F584A0930ee5F3b0","type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"SubgraphService#SubgraphService_ProxyWithABI.setCurationCut","networkInteractionId":1,"nonce":1650,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"SubgraphService#SubgraphService_ProxyWithABI.setCurationCut","networkInteractionId":1,"nonce":1650,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0xf6f5bd22b0ed84883c23b65442dec22c7c47a967c398f229c3e1c58abdfa6298"},"type":"TRANSACTION_SEND"} +{"args":[2419200],"artifactId":"SubgraphService#SubgraphService_ProxyWithABI","contractAddress":"0x00fe8F95407AB61863d27c07F584A0930ee5F3b0","dependencies":["SubgraphService#SubgraphService_ProxyWithABI"],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","functionName":"setMaxPOIStaleness","futureId":"SubgraphService#SubgraphService_ProxyWithABI.setMaxPOIStaleness","strategy":"basic","strategyConfig":{},"type":"CALL_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"SubgraphService#SubgraphService_ProxyWithABI.setMaxPOIStaleness","networkInteraction":{"data":"0x7aa31bce000000000000000000000000000000000000000000000000000000000024ea00","id":1,"to":"0x00fe8F95407AB61863d27c07F584A0930ee5F3b0","type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"SubgraphService#SubgraphService_ProxyWithABI.setMaxPOIStaleness","networkInteractionId":1,"nonce":1651,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"SubgraphService#SubgraphService_ProxyWithABI.setMaxPOIStaleness","networkInteractionId":1,"nonce":1651,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0xf4e9b9504d6133ea66e66ad9a4fb821459e3b1679bd401484dd4b9432fe9cbb6"},"type":"TRANSACTION_SEND"} +{"args":["0xFFcf8FDEE72ac11b5c542428B35EEF5769C409f0",true],"artifactId":"SubgraphService#SubgraphService_ProxyWithABI","contractAddress":"0x00fe8F95407AB61863d27c07F584A0930ee5F3b0","dependencies":["SubgraphService#SubgraphService_ProxyWithABI"],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","functionName":"setPauseGuardian","futureId":"SubgraphService#setPauseGuardianGovernor","strategy":"basic","strategyConfig":{},"type":"CALL_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"SubgraphService#setPauseGuardianGovernor","networkInteraction":{"data":"0x35577962000000000000000000000000ffcf8fdee72ac11b5c542428b35eef5769c409f00000000000000000000000000000000000000000000000000000000000000001","id":1,"to":"0x00fe8F95407AB61863d27c07F584A0930ee5F3b0","type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"SubgraphService#setPauseGuardianGovernor","networkInteractionId":1,"nonce":1652,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"SubgraphService#setPauseGuardianGovernor","networkInteractionId":1,"nonce":1652,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0x0f0ef37e082d4587cd6ccae790d362e08bde486d687be254f884afe4af6e7e7f"},"type":"TRANSACTION_SEND"} +{"args":["0xE11BA2b4D45Eaed5996Cd0823791E0C93114882d",true],"artifactId":"SubgraphService#SubgraphService_ProxyWithABI","contractAddress":"0x00fe8F95407AB61863d27c07F584A0930ee5F3b0","dependencies":["SubgraphService#SubgraphService_ProxyWithABI"],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","functionName":"setPauseGuardian","futureId":"SubgraphService#setPauseGuardianPauseGuardian","strategy":"basic","strategyConfig":{},"type":"CALL_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"SubgraphService#setPauseGuardianPauseGuardian","networkInteraction":{"data":"0x35577962000000000000000000000000e11ba2b4d45eaed5996cd0823791e0c93114882d0000000000000000000000000000000000000000000000000000000000000001","id":1,"to":"0x00fe8F95407AB61863d27c07F584A0930ee5F3b0","type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"SubgraphService#setPauseGuardianPauseGuardian","networkInteractionId":1,"nonce":1653,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"SubgraphService#setPauseGuardianPauseGuardian","networkInteractionId":1,"nonce":1653,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0x528afc4134ccaed020a6877b6583332c1593522653f0267fb9743df4f006e267"},"type":"TRANSACTION_SEND"} +{"futureId":"DisputeManager#DisputeManager_ProxyWithABI.setSubgraphService","hash":"0x23f016c9557b5342ee3d8c04995ccb8c675626cddfb9d86db98041da41f61ddc","networkInteractionId":1,"receipt":{"blockHash":"0xe2815fe234b5a8edf0592c1e2ffc354c1d78fdaab2a5e027a1c16e479d376052","blockNumber":152513443,"logs":[{"address":"0x1A7Fb71014d4395903eC56662f32dD02344D361C","data":"0x","logIndex":0,"topics":["0x81dcb738da3dabd5bb2adbc7dd107fbbfca936e9c8aecab25f5b17a710a784c7","0x00000000000000000000000000fe8f95407ab61863d27c07f584a0930ee5f3b0"]}],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"DisputeManager#DisputeManager_ProxyWithABI.setSubgraphService","result":{"type":"SUCCESS"},"type":"CALL_EXECUTION_STATE_COMPLETE"} +{"futureId":"SubgraphService#SubgraphService_ProxyWithABI.setCurationCut","hash":"0xf6f5bd22b0ed84883c23b65442dec22c7c47a967c398f229c3e1c58abdfa6298","networkInteractionId":1,"receipt":{"blockHash":"0x05a793d76704c771a0fda53aa325471c30da29fb3f6c1a352c8095b6511e2b1b","blockNumber":152513454,"logs":[{"address":"0x00fe8F95407AB61863d27c07F584A0930ee5F3b0","data":"0x00000000000000000000000000000000000000000000000000000000000186a0","logIndex":1,"topics":["0x6deef78ffe3df79ae5cd8e40b842c36ac6077e13746b9b68a9f327537b01e4e9"]}],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"SubgraphService#SubgraphService_ProxyWithABI.setCurationCut","result":{"type":"SUCCESS"},"type":"CALL_EXECUTION_STATE_COMPLETE"} +{"futureId":"SubgraphService#SubgraphService_ProxyWithABI.setMaxPOIStaleness","hash":"0xf4e9b9504d6133ea66e66ad9a4fb821459e3b1679bd401484dd4b9432fe9cbb6","networkInteractionId":1,"receipt":{"blockHash":"0xafed8778e9f6dfd02e2fa094f16848280734bd88175a72eb87169c5db404c3f8","blockNumber":152513466,"logs":[{"address":"0x00fe8F95407AB61863d27c07F584A0930ee5F3b0","data":"0x000000000000000000000000000000000000000000000000000000000024ea00","logIndex":0,"topics":["0x21774046e2611ddb52c8c46e1ad97524eeb2e3fda7dcd9428867868b4c4d06ba"]}],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"SubgraphService#SubgraphService_ProxyWithABI.setMaxPOIStaleness","result":{"type":"SUCCESS"},"type":"CALL_EXECUTION_STATE_COMPLETE"} +{"futureId":"SubgraphService#setPauseGuardianGovernor","hash":"0x0f0ef37e082d4587cd6ccae790d362e08bde486d687be254f884afe4af6e7e7f","networkInteractionId":1,"receipt":{"blockHash":"0x101ab5d1a9eab4c84829deed736272565b2110b12ed8beaa8c2aba2d374d0adc","blockNumber":152513477,"logs":[{"address":"0x00fe8F95407AB61863d27c07F584A0930ee5F3b0","data":"0x0000000000000000000000000000000000000000000000000000000000000001","logIndex":0,"topics":["0xa95bac2f3df0d40e8278281c1d39d53c60e4f2bf3550ca5665738d0916e89789","0x000000000000000000000000ffcf8fdee72ac11b5c542428b35eef5769c409f0"]}],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"SubgraphService#setPauseGuardianGovernor","result":{"type":"SUCCESS"},"type":"CALL_EXECUTION_STATE_COMPLETE"} +{"futureId":"SubgraphService#setPauseGuardianPauseGuardian","hash":"0x528afc4134ccaed020a6877b6583332c1593522653f0267fb9743df4f006e267","networkInteractionId":1,"receipt":{"blockHash":"0x0dd8089ebc15c3eba190422b8f0f0119e3591e718c27e14bf6c35497ae967f92","blockNumber":152513488,"logs":[{"address":"0x00fe8F95407AB61863d27c07F584A0930ee5F3b0","data":"0x0000000000000000000000000000000000000000000000000000000000000001","logIndex":1,"topics":["0xa95bac2f3df0d40e8278281c1d39d53c60e4f2bf3550ca5665738d0916e89789","0x000000000000000000000000e11ba2b4d45eaed5996cd0823791e0c93114882d"]}],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"SubgraphService#setPauseGuardianPauseGuardian","result":{"type":"SUCCESS"},"type":"CALL_EXECUTION_STATE_COMPLETE"} +{"args":["0xFFcf8FDEE72ac11b5c542428B35EEF5769C409f0"],"artifactId":"DisputeManager#DisputeManager_ProxyWithABI","contractAddress":"0x1A7Fb71014d4395903eC56662f32dD02344D361C","dependencies":["DisputeManager#DisputeManager_ProxyWithABI","DisputeManager#DisputeManager_ProxyWithABI.setSubgraphService"],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","functionName":"transferOwnership","futureId":"DisputeManager#DisputeManager_ProxyWithABI.transferOwnership","strategy":"basic","strategyConfig":{},"type":"CALL_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"DisputeManager#DisputeManager_ProxyWithABI.transferOwnership","networkInteraction":{"data":"0xf2fde38b000000000000000000000000ffcf8fdee72ac11b5c542428b35eef5769c409f0","id":1,"to":"0x1A7Fb71014d4395903eC56662f32dD02344D361C","type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"DisputeManager#DisputeManager_ProxyWithABI.transferOwnership","networkInteractionId":1,"nonce":1654,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"DisputeManager#DisputeManager_ProxyWithABI.transferOwnership","networkInteractionId":1,"nonce":1654,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0x48a98358cc9a3f8f5ee4cb34d5f2a0454e3d8e19c2c77e339602fcc0c0bc107d"},"type":"TRANSACTION_SEND"} +{"args":["0xFFcf8FDEE72ac11b5c542428B35EEF5769C409f0"],"artifactId":"DisputeManager#ProxyAdmin","contractAddress":"0x9a8C3B6D649108bd11670de0B9b981ae3C167707","dependencies":["DisputeManager#ProxyAdmin","DisputeManager#DisputeManager_ProxyWithABI.setSubgraphService"],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","functionName":"transferOwnership","futureId":"DisputeManager#ProxyAdmin.transferOwnership","strategy":"basic","strategyConfig":{},"type":"CALL_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"DisputeManager#ProxyAdmin.transferOwnership","networkInteraction":{"data":"0xf2fde38b000000000000000000000000ffcf8fdee72ac11b5c542428b35eef5769c409f0","id":1,"to":"0x9a8C3B6D649108bd11670de0B9b981ae3C167707","type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"DisputeManager#ProxyAdmin.transferOwnership","networkInteractionId":1,"nonce":1655,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"DisputeManager#ProxyAdmin.transferOwnership","networkInteractionId":1,"nonce":1655,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0x280144792d0c058292da7c8aaef1d4a213d471bb21bef18b368cbd235feccfee"},"type":"TRANSACTION_SEND"} +{"args":["0xFFcf8FDEE72ac11b5c542428B35EEF5769C409f0"],"artifactId":"SubgraphService#ProxyAdmin","contractAddress":"0xD23a972f47B7D45E729AB9B8399D628c87b6C0d6","dependencies":["SubgraphService#ProxyAdmin","SubgraphService#setPauseGuardianGovernor","SubgraphService#setPauseGuardianPauseGuardian","SubgraphService#SubgraphService_ProxyWithABI.setMaxPOIStaleness","SubgraphService#SubgraphService_ProxyWithABI.setCurationCut"],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","functionName":"transferOwnership","futureId":"SubgraphService#ProxyAdmin.transferOwnership","strategy":"basic","strategyConfig":{},"type":"CALL_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"SubgraphService#ProxyAdmin.transferOwnership","networkInteraction":{"data":"0xf2fde38b000000000000000000000000ffcf8fdee72ac11b5c542428b35eef5769c409f0","id":1,"to":"0xD23a972f47B7D45E729AB9B8399D628c87b6C0d6","type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"SubgraphService#ProxyAdmin.transferOwnership","networkInteractionId":1,"nonce":1656,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"SubgraphService#ProxyAdmin.transferOwnership","networkInteractionId":1,"nonce":1656,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0x2ce174ad9c196019cfb47182c94f0a0a63d55e884ef68f05b461373ac475c541"},"type":"TRANSACTION_SEND"} +{"args":["0xFFcf8FDEE72ac11b5c542428B35EEF5769C409f0"],"artifactId":"SubgraphService#SubgraphService_ProxyWithABI","contractAddress":"0x00fe8F95407AB61863d27c07F584A0930ee5F3b0","dependencies":["SubgraphService#SubgraphService_ProxyWithABI","SubgraphService#setPauseGuardianGovernor","SubgraphService#setPauseGuardianPauseGuardian","SubgraphService#SubgraphService_ProxyWithABI.setMaxPOIStaleness","SubgraphService#SubgraphService_ProxyWithABI.setCurationCut"],"from":"0xade6b8eb69a49b56929c1d4f4b428d791861db6f","functionName":"transferOwnership","futureId":"SubgraphService#SubgraphService_ProxyWithABI.transferOwnership","strategy":"basic","strategyConfig":{},"type":"CALL_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"SubgraphService#SubgraphService_ProxyWithABI.transferOwnership","networkInteraction":{"data":"0xf2fde38b000000000000000000000000ffcf8fdee72ac11b5c542428b35eef5769c409f0","id":1,"to":"0x00fe8F95407AB61863d27c07F584A0930ee5F3b0","type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"SubgraphService#SubgraphService_ProxyWithABI.transferOwnership","networkInteractionId":1,"nonce":1657,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"SubgraphService#SubgraphService_ProxyWithABI.transferOwnership","networkInteractionId":1,"nonce":1657,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"200000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0x8d7f207538113cda6a635addfe0d8ea47042678d031fe04c3609e06775e2ae90"},"type":"TRANSACTION_SEND"} +{"futureId":"DisputeManager#DisputeManager_ProxyWithABI.transferOwnership","hash":"0x48a98358cc9a3f8f5ee4cb34d5f2a0454e3d8e19c2c77e339602fcc0c0bc107d","networkInteractionId":1,"receipt":{"blockHash":"0xb134015eb3b545982ab6cd614bcf9f469c672b4a4489ac9b1de357897d7b837c","blockNumber":152513519,"logs":[{"address":"0x1A7Fb71014d4395903eC56662f32dD02344D361C","data":"0x","logIndex":0,"topics":["0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0","0x000000000000000000000000ade6b8eb69a49b56929c1d4f4b428d791861db6f","0x000000000000000000000000ffcf8fdee72ac11b5c542428b35eef5769c409f0"]}],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"DisputeManager#DisputeManager_ProxyWithABI.transferOwnership","result":{"type":"SUCCESS"},"type":"CALL_EXECUTION_STATE_COMPLETE"} +{"futureId":"DisputeManager#ProxyAdmin.transferOwnership","hash":"0x280144792d0c058292da7c8aaef1d4a213d471bb21bef18b368cbd235feccfee","networkInteractionId":1,"receipt":{"blockHash":"0xa38649c33a3e9ad110bf356a6d9ad35cfba98fd2681307598704d66c620df06d","blockNumber":152513531,"logs":[{"address":"0x9a8C3B6D649108bd11670de0B9b981ae3C167707","data":"0x","logIndex":0,"topics":["0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0","0x000000000000000000000000ade6b8eb69a49b56929c1d4f4b428d791861db6f","0x000000000000000000000000ffcf8fdee72ac11b5c542428b35eef5769c409f0"]}],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"DisputeManager#ProxyAdmin.transferOwnership","result":{"type":"SUCCESS"},"type":"CALL_EXECUTION_STATE_COMPLETE"} +{"futureId":"SubgraphService#ProxyAdmin.transferOwnership","hash":"0x2ce174ad9c196019cfb47182c94f0a0a63d55e884ef68f05b461373ac475c541","networkInteractionId":1,"receipt":{"blockHash":"0x4aac37dcaea3464087ce44664fb3779a295719901ecbabb2738b0dd576d8f945","blockNumber":152513543,"logs":[{"address":"0xD23a972f47B7D45E729AB9B8399D628c87b6C0d6","data":"0x","logIndex":0,"topics":["0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0","0x000000000000000000000000ade6b8eb69a49b56929c1d4f4b428d791861db6f","0x000000000000000000000000ffcf8fdee72ac11b5c542428b35eef5769c409f0"]}],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"SubgraphService#ProxyAdmin.transferOwnership","result":{"type":"SUCCESS"},"type":"CALL_EXECUTION_STATE_COMPLETE"} +{"futureId":"SubgraphService#SubgraphService_ProxyWithABI.transferOwnership","hash":"0x8d7f207538113cda6a635addfe0d8ea47042678d031fe04c3609e06775e2ae90","networkInteractionId":1,"receipt":{"blockHash":"0x879392e67ffd685f6cf06fdee99d588aba00d97b6f13957d98c9ae4e951f617d","blockNumber":152513554,"logs":[{"address":"0x00fe8F95407AB61863d27c07F584A0930ee5F3b0","data":"0x","logIndex":1,"topics":["0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0","0x000000000000000000000000ade6b8eb69a49b56929c1d4f4b428d791861db6f","0x000000000000000000000000ffcf8fdee72ac11b5c542428b35eef5769c409f0"]}],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"SubgraphService#SubgraphService_ProxyWithABI.transferOwnership","result":{"type":"SUCCESS"},"type":"CALL_EXECUTION_STATE_COMPLETE"} \ No newline at end of file diff --git a/packages/subgraph-service/ignition/modules/Curation.ts b/packages/subgraph-service/ignition/modules/Curation.ts new file mode 100644 index 000000000..5b934c114 --- /dev/null +++ b/packages/subgraph-service/ignition/modules/Curation.ts @@ -0,0 +1,17 @@ +import { buildModule } from '@nomicfoundation/ignition-core' + +import CurationArtifact from '@graphprotocol/contracts/build/contracts/contracts/l2/curation/L2Curation.sol/L2Curation.json' + +// Note that this module is a no-op, we only run it to get curation addresses into the address book. +// Curation deployment should be managed by ignition scripts in subgraph-service package however +// due to tight coupling with Controller contract it's easier to do it on the horizon package. + +export default buildModule('L2Curation', (m) => { + const curationProxyAddress = m.getParameter('curationProxyAddress') + const curationImplementationAddress = m.getParameter('curationImplementationAddress') + + const L2Curation = m.contractAt('L2CurationAddressBook', CurationArtifact, curationProxyAddress) + const L2CurationImplementation = m.contractAt('L2CurationImplementationAddressBook', CurationArtifact, curationImplementationAddress) + + return { L2Curation, L2CurationImplementation } +}) diff --git a/packages/subgraph-service/ignition/modules/DisputeManager.ts b/packages/subgraph-service/ignition/modules/DisputeManager.ts new file mode 100644 index 000000000..158140930 --- /dev/null +++ b/packages/subgraph-service/ignition/modules/DisputeManager.ts @@ -0,0 +1,58 @@ +import { buildModule } from '@nomicfoundation/hardhat-ignition/modules' +import { deployImplementation } from '@graphprotocol/horizon/ignition/modules/proxy/implementation' +import { upgradeTransparentUpgradeableProxy } from '@graphprotocol/horizon/ignition/modules/proxy/TransparentUpgradeableProxy' + +import DisputeManagerArtifact from '../../build/contracts/contracts/DisputeManager.sol/DisputeManager.json' +import ProxyAdminArtifact from '@openzeppelin/contracts/build/contracts/ProxyAdmin.json' +import TransparentUpgradeableProxyArtifact from '@openzeppelin/contracts/build/contracts/TransparentUpgradeableProxy.json' + +export default buildModule('DisputeManager', (m) => { + const deployer = m.getAccount(0) + const governor = m.getParameter('governor') + const controllerAddress = m.getParameter('controllerAddress') + const subgraphServiceProxyAddress = m.getParameter('subgraphServiceProxyAddress') + const disputeManagerProxyAddress = m.getParameter('disputeManagerProxyAddress') + const disputeManagerProxyAdminAddress = m.getParameter('disputeManagerProxyAdminAddress') + const arbitrator = m.getParameter('arbitrator') + const disputePeriod = m.getParameter('disputePeriod') + const disputeDeposit = m.getParameter('disputeDeposit') + const fishermanRewardCut = m.getParameter('fishermanRewardCut') + const maxSlashingCut = m.getParameter('maxSlashingCut') + + const DisputeManagerProxyAdmin = m.contractAt('ProxyAdmin', ProxyAdminArtifact, disputeManagerProxyAdminAddress) + const DisputeManagerProxy = m.contractAt('DisputeManagerProxy', TransparentUpgradeableProxyArtifact, disputeManagerProxyAddress) + + // Deploy implementation + const DisputeManagerImplementation = deployImplementation(m, { + name: 'DisputeManager', + constructorArgs: [controllerAddress], + artifact: DisputeManagerArtifact, + }) + + // Upgrade implementation + const DisputeManager = upgradeTransparentUpgradeableProxy(m, + DisputeManagerProxyAdmin, + DisputeManagerProxy, + DisputeManagerImplementation, { + name: 'DisputeManager', + artifact: DisputeManagerArtifact, + initArgs: [ + deployer, + arbitrator, + disputePeriod, + disputeDeposit, + fishermanRewardCut, + maxSlashingCut, + ], + }) + + const callSetSubgraphService = m.call(DisputeManager, 'setSubgraphService', [subgraphServiceProxyAddress]) + + m.call(DisputeManager, 'transferOwnership', [governor], { after: [callSetSubgraphService] }) + m.call(DisputeManagerProxyAdmin, 'transferOwnership', [governor], { after: [callSetSubgraphService] }) + + return { + DisputeManager, + DisputeManagerImplementation, + } +}) diff --git a/packages/subgraph-service/ignition/modules/GNS.ts b/packages/subgraph-service/ignition/modules/GNS.ts new file mode 100644 index 000000000..5b3bd2be4 --- /dev/null +++ b/packages/subgraph-service/ignition/modules/GNS.ts @@ -0,0 +1,20 @@ +import { buildModule } from '@nomicfoundation/hardhat-ignition/modules' + +import L2GNSArtifact from '@graphprotocol/contracts/build/contracts/contracts/l2/discovery/L2GNS.sol/L2GNS.json' +import SubgraphNFTArtifact from '@graphprotocol/contracts/build/contracts/contracts/discovery/SubgraphNFT.sol/SubgraphNFT.json' + +// Note that this module is a no-op, we only run it to get gns addresses into the address book. +// GNS deployment should be managed by ignition scripts in subgraph-service package however +// due to tight coupling with Controller contract it's easier to do it on the horizon package. + +export default buildModule('L2GNS', (m) => { + const gnsProxyAddress = m.getParameter('gnsProxyAddress') + const gnsImplementationAddress = m.getParameter('gnsImplementationAddress') + const subgraphNFTAddress = m.getParameter('subgraphNFTAddress') + + const SubgraphNFT = m.contractAt('SubgraphNFTAddressBook', SubgraphNFTArtifact, subgraphNFTAddress) + const L2GNS = m.contractAt('L2GNSAddressBook', L2GNSArtifact, gnsProxyAddress) + const L2GNSImplementation = m.contractAt('L2GNSImplementationAddressBook', L2GNSArtifact, gnsImplementationAddress) + + return { L2GNS, L2GNSImplementation, SubgraphNFT } +}) diff --git a/packages/subgraph-service/ignition/modules/Proxies.ts b/packages/subgraph-service/ignition/modules/Proxies.ts new file mode 100644 index 000000000..7fe2c8960 --- /dev/null +++ b/packages/subgraph-service/ignition/modules/Proxies.ts @@ -0,0 +1,30 @@ +import { buildModule } from '@nomicfoundation/hardhat-ignition/modules' +import { deployTransparentUpgradeableProxy } from '@graphprotocol/horizon/ignition/modules/proxy/TransparentUpgradeableProxy' + +import DisputeManagerArtifact from '../../build/contracts/contracts/DisputeManager.sol/DisputeManager.json' +import SubgraphServiceArtifact from '../../build/contracts/contracts/SubgraphService.sol/SubgraphService.json' + +export default buildModule('SubgraphServiceProxies', (m) => { + // Deploy proxies contracts using OZ TransparentUpgradeableProxy + const { + Proxy: DisputeManagerProxy, + ProxyAdmin: DisputeManagerProxyAdmin, + } = deployTransparentUpgradeableProxy(m, { + name: 'DisputeManager', + artifact: DisputeManagerArtifact, + }) + const { + Proxy: SubgraphServiceProxy, + ProxyAdmin: SubgraphServiceProxyAdmin, + } = deployTransparentUpgradeableProxy(m, { + name: 'SubgraphService', + artifact: SubgraphServiceArtifact, + }) + + return { + SubgraphServiceProxy, + SubgraphServiceProxyAdmin, + DisputeManagerProxy, + DisputeManagerProxyAdmin, + } +}) diff --git a/packages/subgraph-service/ignition/modules/SubgraphService.ts b/packages/subgraph-service/ignition/modules/SubgraphService.ts new file mode 100644 index 000000000..ba035b742 --- /dev/null +++ b/packages/subgraph-service/ignition/modules/SubgraphService.ts @@ -0,0 +1,61 @@ +import { buildModule } from '@nomicfoundation/hardhat-ignition/modules' +import { deployImplementation } from '@graphprotocol/horizon/ignition/modules/proxy/implementation' +import { upgradeTransparentUpgradeableProxy } from '@graphprotocol/horizon/ignition/modules/proxy/TransparentUpgradeableProxy' + +import ProxyAdminArtifact from '@openzeppelin/contracts/build/contracts/ProxyAdmin.json' +import SubgraphServiceArtifact from '../../build/contracts/contracts/SubgraphService.sol/SubgraphService.json' +import TransparentUpgradeableProxyArtifact from '@openzeppelin/contracts/build/contracts/TransparentUpgradeableProxy.json' + +export default buildModule('SubgraphService', (m) => { + const deployer = m.getAccount(0) + const governor = m.getParameter('governor') + const pauseGuardian = m.getParameter('pauseGuardian') + const controllerAddress = m.getParameter('controllerAddress') + const subgraphServiceProxyAddress = m.getParameter('subgraphServiceProxyAddress') + const subgraphServiceProxyAdminAddress = m.getParameter('subgraphServiceProxyAdminAddress') + const disputeManagerProxyAddress = m.getParameter('disputeManagerProxyAddress') + const graphTallyCollectorAddress = m.getParameter('graphTallyCollectorAddress') + const curationProxyAddress = m.getParameter('curationProxyAddress') + const minimumProvisionTokens = m.getParameter('minimumProvisionTokens') + const maximumDelegationRatio = m.getParameter('maximumDelegationRatio') + const stakeToFeesRatio = m.getParameter('stakeToFeesRatio') + const maxPOIStaleness = m.getParameter('maxPOIStaleness') + const curationCut = m.getParameter('curationCut') + + const SubgraphServiceProxyAdmin = m.contractAt('ProxyAdmin', ProxyAdminArtifact, subgraphServiceProxyAdminAddress) + const SubgraphServiceProxy = m.contractAt('SubgraphServiceProxy', TransparentUpgradeableProxyArtifact, subgraphServiceProxyAddress) + + // Deploy implementation + const SubgraphServiceImplementation = deployImplementation(m, { + name: 'SubgraphService', + constructorArgs: [controllerAddress, disputeManagerProxyAddress, graphTallyCollectorAddress, curationProxyAddress], + }) + + // Upgrade implementation + const SubgraphService = upgradeTransparentUpgradeableProxy(m, + SubgraphServiceProxyAdmin, + SubgraphServiceProxy, + SubgraphServiceImplementation, { + name: 'SubgraphService', + artifact: SubgraphServiceArtifact, + initArgs: [ + deployer, + minimumProvisionTokens, + maximumDelegationRatio, + stakeToFeesRatio, + ], + }) + + const callSetPauseGuardianGovernor = m.call(SubgraphService, 'setPauseGuardian', [governor, true], { id: 'setPauseGuardianGovernor' }) + const callSetPauseGuardianPauseGuardian = m.call(SubgraphService, 'setPauseGuardian', [pauseGuardian, true], { id: 'setPauseGuardianPauseGuardian' }) + const callSetMaxPOIStaleness = m.call(SubgraphService, 'setMaxPOIStaleness', [maxPOIStaleness]) + const callSetCurationCut = m.call(SubgraphService, 'setCurationCut', [curationCut]) + + m.call(SubgraphService, 'transferOwnership', [governor], { after: [callSetPauseGuardianGovernor, callSetPauseGuardianPauseGuardian, callSetMaxPOIStaleness, callSetCurationCut] }) + m.call(SubgraphServiceProxyAdmin, 'transferOwnership', [governor], { after: [callSetPauseGuardianGovernor, callSetPauseGuardianPauseGuardian, callSetMaxPOIStaleness, callSetCurationCut] }) + + return { + SubgraphService, + SubgraphServiceImplementation, + } +}) diff --git a/packages/subgraph-service/ignition/modules/deploy/deploy-1.ts b/packages/subgraph-service/ignition/modules/deploy/deploy-1.ts new file mode 100644 index 000000000..027c4563f --- /dev/null +++ b/packages/subgraph-service/ignition/modules/deploy/deploy-1.ts @@ -0,0 +1,19 @@ +import { buildModule } from '@nomicfoundation/hardhat-ignition/modules' + +import ProxiesModule from '../Proxies' + +export default buildModule('SubgraphService_Deploy_1', (m) => { + const { + SubgraphServiceProxy, + SubgraphServiceProxyAdmin, + DisputeManagerProxy, + DisputeManagerProxyAdmin, + } = m.useModule(ProxiesModule) + + return { + Transparent_Proxy_SubgraphService: SubgraphServiceProxy, + Transparent_ProxyAdmin_SubgraphService: SubgraphServiceProxyAdmin, + Transparent_Proxy_DisputeManager: DisputeManagerProxy, + Transparent_ProxyAdmin_DisputeManager: DisputeManagerProxyAdmin, + } +}) diff --git a/packages/subgraph-service/ignition/modules/deploy/deploy-2.ts b/packages/subgraph-service/ignition/modules/deploy/deploy-2.ts new file mode 100644 index 000000000..2004d8a12 --- /dev/null +++ b/packages/subgraph-service/ignition/modules/deploy/deploy-2.ts @@ -0,0 +1,25 @@ +import { buildModule } from '@nomicfoundation/hardhat-ignition/modules' + +import CurationModule from '../Curation' +import DisputeManagerModule from '../DisputeManager' +import GNSModule from '../GNS' +import SubgraphServiceModule from '../SubgraphService' + +export default buildModule('SubgraphService_Deploy_2', (m) => { + const { DisputeManager, DisputeManagerImplementation } = m.useModule(DisputeManagerModule) + const { SubgraphService, SubgraphServiceImplementation } = m.useModule(SubgraphServiceModule) + const { L2Curation, L2CurationImplementation } = m.useModule(CurationModule) + const { L2GNS, L2GNSImplementation, SubgraphNFT } = m.useModule(GNSModule) + + return { + Transparent_Proxy_DisputeManager: DisputeManager, + Implementation_DisputeManager: DisputeManagerImplementation, + Transparent_Proxy_SubgraphService: SubgraphService, + Implementation_SubgraphService: SubgraphServiceImplementation, + Graph_Proxy_L2Curation: L2Curation, + Implementation_L2Curation: L2CurationImplementation, + Graph_Proxy_L2GNS: L2GNS, + Implementation_L2GNS: L2GNSImplementation, + SubgraphNFT, + } +}) diff --git a/packages/subgraph-service/ignition/modules/migrate/migrate-1.ts b/packages/subgraph-service/ignition/modules/migrate/migrate-1.ts new file mode 100644 index 000000000..66b4bf74c --- /dev/null +++ b/packages/subgraph-service/ignition/modules/migrate/migrate-1.ts @@ -0,0 +1,19 @@ +import { buildModule } from '@nomicfoundation/hardhat-ignition/modules' + +import ProxiesModule from '../Proxies' + +export default buildModule('SubgraphService_Migrate_1', (m) => { + const { + SubgraphServiceProxy, + SubgraphServiceProxyAdmin, + DisputeManagerProxy, + DisputeManagerProxyAdmin, + } = m.useModule(ProxiesModule) + + return { + Transparent_Proxy_SubgraphService: SubgraphServiceProxy, + Transparent_ProxyAdmin_SubgraphService: SubgraphServiceProxyAdmin, + Transparent_Proxy_DisputeManager: DisputeManagerProxy, + Transparent_ProxyAdmin_DisputeManager: DisputeManagerProxyAdmin, + } +}) diff --git a/packages/subgraph-service/ignition/modules/migrate/migrate-2.ts b/packages/subgraph-service/ignition/modules/migrate/migrate-2.ts new file mode 100644 index 000000000..df005ad64 --- /dev/null +++ b/packages/subgraph-service/ignition/modules/migrate/migrate-2.ts @@ -0,0 +1,25 @@ +import { buildModule } from '@nomicfoundation/hardhat-ignition/modules' + +import CurationModule from '../Curation' +import DisputeManagerModule from '../DisputeManager' +import GNSModule from '../GNS' +import SubgraphServiceModule from '../SubgraphService' + +export default buildModule('SubgraphService_Migrate_2', (m) => { + const { DisputeManager, DisputeManagerImplementation } = m.useModule(DisputeManagerModule) + const { SubgraphService, SubgraphServiceImplementation } = m.useModule(SubgraphServiceModule) + const { L2Curation, L2CurationImplementation } = m.useModule(CurationModule) + const { L2GNS, L2GNSImplementation, SubgraphNFT } = m.useModule(GNSModule) + + return { + Transparent_Proxy_DisputeManager: DisputeManager, + Implementation_DisputeManager: DisputeManagerImplementation, + Transparent_Proxy_SubgraphService: SubgraphService, + Implementation_SubgraphService: SubgraphServiceImplementation, + Graph_Proxy_L2Curation: L2Curation, + Implementation_L2Curation: L2CurationImplementation, + Graph_Proxy_L2GNS: L2GNS, + Implementation_L2GNS: L2GNSImplementation, + SubgraphNFT, + } +}) diff --git a/packages/subgraph-service/lib/forge-std b/packages/subgraph-service/lib/forge-std new file mode 160000 index 000000000..bb4ceea94 --- /dev/null +++ b/packages/subgraph-service/lib/forge-std @@ -0,0 +1 @@ +Subproject commit bb4ceea94d6f10eeb5b41dc2391c6c8bf8e734ef diff --git a/packages/subgraph-service/lib/openzeppelin-foundry-upgrades b/packages/subgraph-service/lib/openzeppelin-foundry-upgrades new file mode 160000 index 000000000..4cd15fc50 --- /dev/null +++ b/packages/subgraph-service/lib/openzeppelin-foundry-upgrades @@ -0,0 +1 @@ +Subproject commit 4cd15fc50b141c77d8cc9ff8efb44d00e841a299 diff --git a/packages/subgraph-service/natspec-smells.config.js b/packages/subgraph-service/natspec-smells.config.js new file mode 100644 index 000000000..43ed68ee6 --- /dev/null +++ b/packages/subgraph-service/natspec-smells.config.js @@ -0,0 +1,10 @@ +/** + * List of supported options: https://github.com/defi-wonderland/natspec-smells?tab=readme-ov-file#options + */ + +/** @type {import('@defi-wonderland/natspec-smells').Config} */ +module.exports = { + include: 'contracts/**/*.sol', + exclude: ['test/**/*.sol', 'contracts/mocks/**/*.sol'], + constructorNatspec: true, +} diff --git a/packages/subgraph-service/package.json b/packages/subgraph-service/package.json new file mode 100644 index 000000000..929bb2ef9 --- /dev/null +++ b/packages/subgraph-service/package.json @@ -0,0 +1,88 @@ +{ + "name": "@graphprotocol/subgraph-service", + "version": "0.3.5", + "publishConfig": { + "access": "public" + }, + "description": "", + "author": "The Graph core devs", + "license": "GPL-2.0-or-later", + "types": "typechain-types/index.ts", + "files": [ + "build/contracts/**/*", + "typechain-types/**/*", + "README.md", + "addresses.json" + ], + "scripts": { + "lint": "pnpm lint:ts && pnpm lint:sol", + "lint:ts": "eslint '**/*.{js,ts}' --fix --no-warn-ignored", + "lint:sol": "pnpm lint:sol:prettier && pnpm lint:sol:solhint", + "lint:sol:prettier": "prettier --write contracts/**/*.sol test/**/*.sol", + "lint:sol:solhint": "solhint --noPrompt --fix contracts/**/*.sol --config node_modules/solhint-graph-config/index.js", + "lint:sol:natspec": "natspec-smells --config natspec-smells.config.js", + "clean": "rm -rf build dist cache cache_forge typechain-types", + "build": "hardhat compile", + "test": "forge test", + "test:deployment": "SECURE_ACCOUNTS_DISABLE_PROVIDER=true hardhat test test/deployment/*.ts", + "test:integration": "./scripts/integration" + }, + "devDependencies": { + "@defi-wonderland/natspec-smells": "^1.1.6", + "@graphprotocol/contracts": "workspace:^7.1.2", + "@graphprotocol/horizon": "workspace:^0.3.3", + "@graphprotocol/toolshed": "workspace:^", + "@nomicfoundation/hardhat-chai-matchers": "^2.0.0", + "@nomicfoundation/hardhat-ethers": "3.0.8", + "@nomicfoundation/hardhat-foundry": "^1.1.1", + "@nomicfoundation/hardhat-ignition": "^0.15.9", + "@nomicfoundation/hardhat-ignition-ethers": "^0.15.9", + "@nomicfoundation/hardhat-network-helpers": "^1.0.0", + "@nomicfoundation/hardhat-toolbox": "^4.0.0", + "@nomicfoundation/hardhat-verify": "^2.0.10", + "@nomicfoundation/ignition-core": "^0.15.9", + "@openzeppelin/contracts": "^5.0.2", + "@openzeppelin/contracts-upgradeable": "^5.0.2", + "@typechain/ethers-v6": "^0.5.0", + "@typechain/hardhat": "^9.0.0", + "@types/chai": "^4.2.0", + "@types/mocha": ">=9.1.0", + "@types/node": ">=16.0.0", + "chai": "^4.2.0", + "eslint": "^8.56.0", + "eslint-graph-config": "workspace:^0.0.1", + "ethers": "6.13.7", + "glob": "^11.0.1", + "hardhat": "^2.22.18", + "hardhat-contract-sizer": "^2.10.0", + "hardhat-gas-reporter": "^1.0.8", + "hardhat-graph-protocol": "workspace:^0.1.21", + "hardhat-secure-accounts": "^1.0.5", + "json5": "^2.2.3", + "lint-staged": "^15.2.2", + "prettier": "^3.2.5", + "prettier-plugin-solidity": "^1.3.1", + "solhint": "^4.5.4", + "solhint-graph-config": "workspace:^0.0.1", + "solhint-plugin-graph": "workspace:^0.0.1", + "solidity-coverage": "^0.8.0", + "solidity-docgen": "^0.6.0-beta.36", + "ts-node": ">=8.0.0", + "typechain": "^8.3.0", + "typescript": "^5.3.3" + }, + "lint-staged": { + "contracts/**/*.sol": [ + "pnpm lint:sol" + ], + "**/*.ts": [ + "pnpm lint:ts" + ], + "**/*.js": [ + "pnpm lint:ts" + ], + "**/*.json": [ + "pnpm lint:ts" + ] + } +} diff --git a/packages/subgraph-service/prettier.config.js b/packages/subgraph-service/prettier.config.js new file mode 100644 index 000000000..5b8e866f2 --- /dev/null +++ b/packages/subgraph-service/prettier.config.js @@ -0,0 +1,2 @@ +const prettierGraphConfig = require('solhint-graph-config/prettier') +module.exports = prettierGraphConfig diff --git a/packages/subgraph-service/remappings.txt b/packages/subgraph-service/remappings.txt new file mode 100644 index 000000000..d5c1ff26c --- /dev/null +++ b/packages/subgraph-service/remappings.txt @@ -0,0 +1,9 @@ +@graphprotocol/contracts/=node_modules/@graphprotocol/contracts/ +@graphprotocol/horizon/=node_modules/@graphprotocol/horizon/ +forge-std/=lib/forge-std/src/ +ds-test/=lib/forge-std/lib/ds-test/src/ +eth-gas-reporter/=node_modules/eth-gas-reporter/ +hardhat/=node_modules/hardhat/ +@openzeppelin/contracts-upgradeable/=node_modules/@openzeppelin/contracts-upgradeable/ +@openzeppelin/contracts/=node_modules/@openzeppelin/contracts/ +openzeppelin-foundry-upgrades/=lib/openzeppelin-foundry-upgrades/src \ No newline at end of file diff --git a/packages/subgraph-service/scripts/integration b/packages/subgraph-service/scripts/integration new file mode 100755 index 000000000..d5d7f1c0d --- /dev/null +++ b/packages/subgraph-service/scripts/integration @@ -0,0 +1,140 @@ +#!/bin/bash + +set -eo pipefail + +NON_INTERACTIVE=${NON_INTERACTIVE:-false} + +# Set environment variables for this script +export SECURE_ACCOUNTS_DISABLE_PROVIDER=true +export FORK_FROM_CHAIN_ID=${FORK_FROM_CHAIN_ID:-421614} + +# Function to cleanup resources +cleanup() { + # Kill hardhat node only if we started it + if [ ! -z "$NODE_PID" ] && [ "$STARTED_NODE" = true ]; then + echo "Cleaning up Hardhat node (PID: $NODE_PID)..." + kill -TERM -- -$NODE_PID 2>/dev/null || true + fi +} + +# Set trap to call cleanup function on script exit (normal or error) +trap cleanup EXIT + +# Check if any deployment folders exist +SUBGRAPH_DEPLOYMENT_EXISTS=false +HORIZON_DEPLOYMENT_EXISTS=false + +if [ -d "ignition/deployments/subgraph-service-localhost" ]; then + SUBGRAPH_DEPLOYMENT_EXISTS=true +fi + +if [ -d "../horizon/ignition/deployments/horizon-localhost" ]; then + HORIZON_DEPLOYMENT_EXISTS=true +fi + +# If any deployment exists, ask once for confirmation +if [ "$SUBGRAPH_DEPLOYMENT_EXISTS" = true ] || [ "$HORIZON_DEPLOYMENT_EXISTS" = true ]; then + echo "The following deployment files already exist and must be removed for the tests to work properly:" + if [ "$SUBGRAPH_DEPLOYMENT_EXISTS" = true ]; then + echo "- Subgraph Service: ignition/deployments/subgraph-service-localhost" + fi + if [ "$HORIZON_DEPLOYMENT_EXISTS" = true ]; then + echo "- Horizon: ../horizon/ignition/deployments/horizon-localhost" + fi + + read -p "Remove these deployment files? (y/n) [y]: " confirm + confirm=${confirm:-y} + if [[ $confirm == [yY] || $confirm == [yY][eE][sS] ]]; then + if [ "$SUBGRAPH_DEPLOYMENT_EXISTS" = true ]; then + echo "Removing Subgraph Service deployment files..." + rm -rf ignition/deployments/subgraph-service-localhost + fi + if [ "$HORIZON_DEPLOYMENT_EXISTS" = true ]; then + echo "Removing Horizon deployment files..." + rm -rf ../horizon/ignition/deployments/horizon-localhost + fi + else + echo "Cannot continue with existing deployment files. Exiting." + exit 1 + fi +fi + +# Check required env variables +BLOCKCHAIN_RPC=${BLOCKCHAIN_RPC:-$(npx hardhat vars get ARBITRUM_SEPOLIA_RPC)} +if [ -z "$BLOCKCHAIN_RPC" ]; then + echo "BLOCKCHAIN_RPC environment variable is required" + exit 1 +fi + +echo "Starting integration tests..." + +# Check if hardhat node is already running on port 8545 +STARTED_NODE=false +if lsof -i:8545 > /dev/null 2>&1; then + echo "Hardhat node already running on port 8545, using existing node" + # Get the PID of the process using port 8545 + NODE_PID=$(lsof -t -i:8545) +else + # Start local hardhat node forked from Arbitrum Sepolia + echo "Starting local hardhat node..." + npx hardhat node --fork $BLOCKCHAIN_RPC > node.log 2>&1 & + NODE_PID=$! + STARTED_NODE=true + + # Wait for node to start + sleep 10 +fi + +# Setup subgraph service address book +jq '{"31337": ."'"$FORK_FROM_CHAIN_ID"'"}' addresses-integration-tests.json > addresses-localhost.json + +# Run Horizon pre-upgrade steps +cd ../horizon + +# Setup horizon address book +jq '{"31337": ."'"$FORK_FROM_CHAIN_ID"'"}' addresses-integration-tests.json > addresses-localhost.json + +# Setup pre horizon migration state needed for the e2e tests +npx hardhat test:seed --network localhost + +# Transfer ownership of protocol to hardhat signer 1 +npx hardhat test:transfer-ownership --network localhost + +# Run Horizon steps 1 deployment +npx hardhat deploy:migrate --network localhost --horizon-config integration --step 1 --patch-config + +# Run Subgraph Service steps 1 deployment +cd ../subgraph-service +npx hardhat deploy:migrate --network localhost --step 1 --subgraph-service-config integration --patch-config --hide-banner + +# Run Horizon deployment steps 2 and 3 +cd ../horizon +npx hardhat deploy:migrate --network localhost --horizon-config integration --step 2 --patch-config --account-index 1 --hide-banner +npx hardhat deploy:migrate --network localhost --horizon-config integration --step 3 --patch-config --hide-banner + +# Run Subgraph Service deployment step 2 +cd ../subgraph-service +npx hardhat deploy:migrate --network localhost --step 2 --subgraph-service-config integration --patch-config --hide-banner + +# Run Horizon deployment steps 4 +cd ../horizon +npx hardhat deploy:migrate --network localhost --horizon-config integration --step 4 --patch-config --account-index 1 --hide-banner + +# Run Subgraph Service seed steps +cd ../subgraph-service +npx hardhat test:seed --network localhost + +# Run integration tests - During transition period +npx hardhat test:integration --phase during-transition-period --network localhost + +# Clear thawing period +cd ../horizon +npx hardhat transition:clear-thawing --network localhost --governor-index 1 + +# Run integration tests - After transition period +cd ../subgraph-service +npx hardhat test:integration --phase after-transition-period --network localhost + +echo "" +echo "🎉 ✨ 🚀 ✅ E2E tests completed successfully! 🎉 ✨ 🚀 ✅" +echo "" diff --git a/packages/subgraph-service/scripts/ops/data.ts b/packages/subgraph-service/scripts/ops/data.ts new file mode 100644 index 000000000..82cee273b --- /dev/null +++ b/packages/subgraph-service/scripts/ops/data.ts @@ -0,0 +1,163 @@ +// 5 private keys for 14 indexers +export const allocationKeys = [ + // 0 + [ + '0xadc26f06df219d495e839e2bfbc3b7957cbd7ec2378402a71c348d5d14161508', + '0x3a4822389badea942368b5208e96f27e0f86d6218264b344b4aa4e9327126364', + '0xd2a01abc811463cc7a0024147bebde7060e65d51c7fa3192d9cde700a47c251f', + '0x3dfbdb0f34048b788940f120c0033aca8dcfd37e0dd5207a842dc61e1886e85a', + '0x920223c9235db8175356e159cc68d18ec02e262be45277e36b77454cd807bf86', + ], + // 1 + [ + '0xfc4de5954b21216f20bf330b531d337f26b596e9848ad6d42abeaeedc94f0b13', + '0xab337fe78fad371dbf49ff168f34482023b0c9ab82b3f43a828a4fde9750ec51', + '0x14415a4a8e175cfd6c0c4bf25e3f6ca2e31bd8dd6d1515572ecd2dcf38cb89c8', + '0xae323d19100fb157370d4e32ae0f2927a2ee08a9d17b00aec4a0d353b62cbc7d', + '0xce42812cc29b6c4d5b06b95434f62265a232fa0902b1d0adefb974a7b3e20d78', + ], + // 2 + [ + '0x10b4a9f0631aada6b4bf71c34778c0658bab59edf0aba8e4521f82b06039b8b6', + '0x927141f4ca7037c19f25b940f5acd4b3640057e28852ca211fcf18dda529859b', + '0x224356ab7c35241fafdbefbaf65e1595bcea90d494067add2af084836fb04a85', + '0xbf188a0f2bcefaa0018e6055914f740a4e9531530029a03d883c932cb5532dc0', + '0x21ab7915972caa6d80a9c1aa0087efa36fca354880452d85bd041aaab55f78ca', + ], + // 3 + [ + '0x518f5077f9496fc8f9ced68ee3ceb373c83499ced9555d23dd3db15662bbb9fc', + '0x198a89d12b724e588e02b5bc76e1fdf5f73f44ee1188b9025d086a958b856e96', + '0xd5187002b0e67ed351f0a0e60b22f7521657b2be37ceb9796f877549cd9ce222', + '0x2d9e9d37f31854cc383e49f9e63a79d3ee1f3cda0ee3e70022c1507f1f5daaf6', + '0xadbb875ed84fe3fce2b795e4a8b79c30af5e247f3dfdaae508bd5cc4521da2ae', + ], + // 4 + [ + '0x82125dc80334dceae262cc16f3424d5c216606a18ef4f14a81d6ed280b4024da', + '0xaa3128c72a194ff8ba61ce10fe6fe85125caf3a86c34087435b80305d00c6e1b', + '0x4300a2a2067c4c376eca3c34c70cbf909ca4bc370199f4cda58d95a0a00d9f5f', + '0x005520c586e3c4a69eac2e3ebf7647a3aa8a2e0a86bd1ac6efe3a6a71b96066e', + '0x566012e0fb640f9689959d682e8cf8f9a85184241178689a501b2eb6c8b15738', + ], + // 5 + [ + '0x89ebfce06c70a5d3508758f7fcd4a9036a4833d54fe2576b96b314330698d7cc', + '0x4173e8c46b0e986cbdba386648eae089ad023b575bfa14b7359a15bcbe4f5dca', + '0x216dc758c841eedf907fd63c189df9490a5dc5ef8ed78799157cd56c0cdacace', + '0x8017e5d08306448c6c83c6745d631c5db5902eb92ee5531773ed61b2484f7e13', + '0x8029f5e5334d6b0f543f6930c1c7c0b37b7294b372d5245b79ec93e22faebe72', + ], + // 6 + [ + '0x6c550086228105ce673eaccac85ed331d9406cad27d2f4dcdcd915991acaa2ec', + '0x79909074dfb609a91fe0e2be5be2ed7bbac4d25d429b462449d6b81d5bdd0aa3', + '0x8c817673ca090ada483fb7d5257b800802ec38dac5797e429b100281aba53a56', + '0x8df09c1559d1937569f93edb5027f1e0f37c7e0833bf11a78ee1dcb9b59811df', + '0x2a5b7747acd49567a763e82e6bd273b2485fa0bfc56ab0097fc78793695a922b', + ], + // 7 + [ + '0x01148072587e8db9a6600ab5493197454b8df92ba6a9c49634950b39cd27b0f8', + '0x4d81c121d9eccc9e10a9a52eec5486dea1ad06225fe763033038e88250cebe53', + '0xaea522baa4b245bae11efb99ef0d9a90ad9e44d3f9211c2936df4f08f4953d28', + '0x26b482f016849f6252607034acbd2d7bac2d8ec69e15f8e1f0cc0849f981463a', + '0x923dd9e6be0ea49ad4d9aa54516a4f7b82c7726f545f0310fc1d548d1b657353', + ], + // 8 + [ + '0x0feb254ae77a3dee38b2ae93ea7575f463c51f74bfc52fc9e4a26e39a6ecafd6', + '0xd851b1dcad9cde7dd528cf54c1157f0ce8276b4cfd979fbe66331065a382a5cf', + '0x014b03f8bd8233d2937d4081d6c17700f954f85fb84683b494e4ad81af742905', + '0x05d123da41d5138a692a5c848418bab90f010e578d05d6d547d6393db0e0b203', + '0x22c2978cc492babe94a4cffeff058a80b3538b2f383673055dbc321fe732782c', + ], + // 9 + [ + '0xa19dbff41dc89b35b1ab26211d4ea6c5d7ddbcfdd88c9dc984aca7e401213982', + '0x8ac0e5d925473ded2d7f518e038ce702c85f2cb4efa19c790d652549812e8095', + '0x5873d0babaf77992c162de724ad7ba43354112b023ddbc91081940859b04613d', + '0x750c6d01c25cbf124bcdebbda600d09a36d0353738b618bcbe1211f18841db1c', + '0xe823d63eef2a37596183505ee76683a1af57e8253920594a388b0b31ca2a4730', + ], + // 10 + [ + '0x21c015847aa2621d1d3ab6b92915e46995d51814c940d9242c99bc1c56aef025', + '0xa285c26d0d89c94360bf876174301f2acb226954b6c2e17081f02258590afd2c', + '0x6e08860ca769d6c45509b06c11c4734e51477c110213c6552290a1c56226927c', + '0x271df62461060c8fcd78bbe82bb592d695a486cce9c78f5f801b020a13d47951', + '0x2293da863dc9ab4d7a7160573f50bae66956c71ea3e16b9356dd0d4713932cdb', + ], + // 11 + [ + '0xe9817b310039c44dbb0b43e10e63aa999cf05017e0175f1a052a7ae506498bb3', + '0xeee418cba9ec638e7aa9f03ac6fbbb332741b1082f31e949940ab39f746c86f6', + '0x3e62bd3b87e9f45d5ed6924ccd21d67fe43fdd2c43f3c4c8c0ad598b8130302c', + '0x8dadfb35dba3fc01eb543c7016feeab4ec777485fef7efabef46637689d41648', + '0x7d1b521bce3d42dfd719d8202153fd5432efbcf5d4d33a0180811254ae8058a5', + ], + // 12 + [ + '0x3dd509ae6e664fee8ddd19094e80672ba55d7943112514f255f71f814389334e', + '0x88354bb0173d9db541c91668c722e189308411afdbed18843590c64eb4c65f4a', + '0xbe7f5ded918f2f85e937f9e658e7e78f5e3f6010a8ef552019a4cac02443499a', + '0xe2275db1ec82cfc4d96f711eb22894fe0fe4ed1223ead68fc2ae114cec9613ac', + '0xd7c830bc72657bd204636a1ed199928e70329959410b53e45d664539a95e6a17', + ], + // 13 + [ + '0x0ca66c3197efa4c0d61d0fda991c18c7039a562192d3e339d16142071b895356', + '0xc78a3bab4a94bf912b1db350e3baeaa4e82a8cc03833e3c6d5821b68af8729ca', + '0x304f55f25d20e54075fd11c38b0c79b6f35d8bbfdbf10954afd8c5bf3c34bed9', + '0xeb45fd351ba6cafd0c3aa600e73471967d9d9eaa30f0021141711ce682466559', + '0x7e71f34c1068d63bfc14c13e4ef9b5f3555e3a7efeae72948d584cf8f5acbf5c', + ], + // 14 + [ + '0x1f2e3d4c5b6a79808192a3b4c5d6e7f8091a2b3c4d5e6f708192a3b4c5d6e7f8', + '0x2e3d4c5b6a79808192a3b4c5d6e7f8091a2b3c4d5e6f708192a3b4c5d6e7f809', + '0x3d4c5b6a79808192a3b4c5d6e7f8091a2b3c4d5e6f708192a3b4c5d6e7f8091a', + '0x4c5b6a79808192a3b4c5d6e7f8091a2b3c4d5e6f708192a3b4c5d6e7f8091a2b', + '0x5b6a79808192a3b4c5d6e7f8091a2b3c4d5e6f708192a3b4c5d6e7f8091a2b3c', + ], + // 15 + [ + '0x6a79808192a3b4c5d6e7f8091a2b3c4d5e6f708192a3b4c5d6e7f8091a2b3c4d', + '0x79808192a3b4c5d6e7f8091a2b3c4d5e6f708192a3b4c5d6e7f8091a2b3c4d5e', + '0x808192a3b4c5d6e7f8091a2b3c4d5e6f708192a3b4c5d6e7f8091a2b3c4d5e6f', + '0x8192a3b4c5d6e7f8091a2b3c4d5e6f708192a3b4c5d6e7f8091a2b3c4d5e6f70', + '0x92a3b4c5d6e7f8091a2b3c4d5e6f708192a3b4c5d6e7f8091a2b3c4d5e6f7081', + ], + // 16 + [ + '0xa3b4c5d6e7f8091a2b3c4d5e6f708192a3b4c5d6e7f8091a2b3c4d5e6f708192', + '0xb4c5d6e7f8091a2b3c4d5e6f708192a3b4c5d6e7f8091a2b3c4d5e6f708192a3', + '0xc5d6e7f8091a2b3c4d5e6f708192a3b4c5d6e7f8091a2b3c4d5e6f708192a3b4', + '0xd6e7f8091a2b3c4d5e6f708192a3b4c5d6e7f8091a2b3c4d5e6f708192a3b4c5', + '0xe7f8091a2b3c4d5e6f708192a3b4c5d6e7f8091a2b3c4d5e6f708192a3b4c5d6', + ], + // 17 + [ + '0xf8091a2b3c4d5e6f708192a3b4c5d6e7f8091a2b3c4d5e6f708192a3b4c5d6e7', + '0x091a2b3c4d5e6f708192a3b4c5d6e7f8091a2b3c4d5e6f708192a3b4c5d6e7f8', + '0x1a2b3c4d5e6f708192a3b4c5d6e7f8091a2b3c4d5e6f708192a3b4c5d6e7f809', + '0x2b3c4d5e6f708192a3b4c5d6e7f8091a2b3c4d5e6f708192a3b4c5d6e7f8091a', + '0x3c4d5e6f708192a3b4c5d6e7f8091a2b3c4d5e6f708192a3b4c5d6e7f8091a2b', + ], + // 18 + [ + '0x4d5e6f708192a3b4c5d6e7f8091a2b3c4d5e6f708192a3b4c5d6e7f8091a2b3c', + '0x5e6f708192a3b4c5d6e7f8091a2b3c4d5e6f708192a3b4c5d6e7f8091a2b3c4d', + '0x6f708192a3b4c5d6e7f8091a2b3c4d5e6f708192a3b4c5d6e7f8091a2b3c4d5e', + '0x708192a3b4c5d6e7f8091a2b3c4d5e6f708192a3b4c5d6e7f8091a2b3c4d5e6f', + '0x8192a3b4c5d6e7f8091a2b3c4d5e6f708192a3b4c5d6e7f8091a2b3c4d5e6f70', + ], + // 19 + [ + '0x92a3b4c5d6e7f8091a2b3c4d5e6f708192a3b4c5d6e7f8091a2b3c4d5e6f7081', + '0xa3b4c5d6e7f8091a2b3c4d5e6f708192a3b4c5d6e7f8091a2b3c4d5e6f708192', + '0xb4c5d6e7f8091a2b3c4d5e6f708192a3b4c5d6e7f8091a2b3c4d5e6f708192a3', + '0xc5d6e7f8091a2b3c4d5e6f708192a3b4c5d6e7f8091a2b3c4d5e6f708192a3b4', + '0xd6e7f8091a2b3c4d5e6f708192a3b4c5d6e7f8091a2b3c4d5e6f708192a3b4c5', + ], +] diff --git a/packages/subgraph-service/scripts/ops/protocol-activity.ts b/packages/subgraph-service/scripts/ops/protocol-activity.ts new file mode 100644 index 000000000..200d47da1 --- /dev/null +++ b/packages/subgraph-service/scripts/ops/protocol-activity.ts @@ -0,0 +1,334 @@ +import { + encodeCollectQueryFeesData, + encodePOIMetadata, + generateAllocationProof, + generatePOI, + generateSignedRAV, + generateSignerProof, + ONE_HUNDRED_THOUSAND, + ONE_THOUSAND, + PaymentTypes, + TEN_MILLION, + ThawRequestType, +} from '@graphprotocol/toolshed' +import hre, { ethers } from 'hardhat' +import { allocationKeys } from './data' +import { randomBigInt } from '@graphprotocol/toolshed/utils' +import { Wallet } from 'ethers' + +import type { HardhatEthersSigner } from '@nomicfoundation/hardhat-ethers/signers' + +const GAS_LIMIT = process.env.GAS_LIMIT ? parseInt(process.env.GAS_LIMIT) : 1_000_000 +const LOCAL_NETWORK_INDEXER_PRIVATE_KEY = '0x2ee789a68207020b45607f5adb71933de0946baebbaaab74af7cbd69c8a90573' +const INDEXER_PRIVATE_KEY = process.env.INDEXER_PRIVATE_KEY ?? LOCAL_NETWORK_INDEXER_PRIVATE_KEY + +async function main() { + const graph = hre.graph() + const { HorizonStaking, GraphToken, PaymentsEscrow, GraphTallyCollector } = graph.horizon.contracts + const { SubgraphService, Curation, DisputeManager } = graph.subgraphService.contracts + + const { stake, stakeToProvision, delegate, addToDelegationPool } = graph.horizon.actions + + const indexer = new Wallet(INDEXER_PRIVATE_KEY, graph.provider) + const signers = [...(await graph.accounts.getTestAccounts()), indexer] + const deployer = await graph.accounts.getDeployer() + const gateway = await graph.accounts.getGateway() // note that this wont be the actual gateway address + + const PROVISION_THAWING_PERIOD = await DisputeManager.disputePeriod() + const PROVISION_MAX_VERIFIER_CUT = await DisputeManager.fishermanRewardCut() + const PROVISION_THAWING_PERIOD_B = PROVISION_THAWING_PERIOD - 1n + const PROVISION_MAX_VERIFIER_CUT_B = PROVISION_MAX_VERIFIER_CUT + 1000n + + const abi = new ethers.AbiCoder() + + console.log('🔄 Generating protocol activity...') + console.log('- Deployer: ', deployer.address) + const deployerEthBalance = await ethers.provider.getBalance(deployer.address) + const deployerGrtBalance = await GraphToken.balanceOf(deployer.address) + console.log(` + ETH Balance: ${ethers.formatEther(deployerEthBalance)} ETH`) + console.log(` + GRT Balance: ${ethers.formatEther(deployerGrtBalance)} GRT`) + console.log('- Signers: ', signers.length) + + // Fund signers - top up to 0.01 ETH + console.log('💸 Funding signers with ETH...') + for (const signer of [...signers, gateway]) { + const balance = await ethers.provider.getBalance(signer.address) + if (balance < ethers.parseEther('0.01')) { + await deployer.connect(graph.provider).sendTransaction({ to: signer.address, value: ethers.parseEther('0.01') }) + } + } + + // Fund signers - top up to 10M GRT + console.log('💰 Funding signers with GRT...') + for (const signer of [...signers, gateway]) { + const balance = await GraphToken.balanceOf(signer.address) + if (balance < TEN_MILLION) { + await GraphToken.connect(deployer).transfer(signer.address, TEN_MILLION - balance) + } + } + + // Stake - random amount between 0 and available balance + console.log('📈 Staking random amounts...') + for (const signer of signers) { + const balance = await GraphToken.balanceOf(signer.address) + const stakeAmount = randomBigInt(0n, balance) + await stake(signer as HardhatEthersSigner, [stakeAmount]) + } + + // Provision - if not exist, create with random amount between 100k and idle stake, otherwise add random amount + console.log('🔧 Provisioning or adding to provision...') + for (const signer of signers) { + const provision = await HorizonStaking.getProvision(signer.address, SubgraphService.target) + const provisionExists = provision.createdAt !== 0n + + if (provisionExists) { + const balance = await GraphToken.balanceOf(signer.address) + const addAmount = randomBigInt(0n, balance) + await stakeToProvision(signer as HardhatEthersSigner, [signer.address, SubgraphService.target, addAmount]) + } else { + const idleStake = await HorizonStaking.getIdleStake(signer.address) + const provisionAmount = randomBigInt(ONE_HUNDRED_THOUSAND, idleStake - ONE_HUNDRED_THOUSAND) + await HorizonStaking.connect(signer).provision(signer.address, SubgraphService.target, provisionAmount, PROVISION_MAX_VERIFIER_CUT, PROVISION_THAWING_PERIOD) + } + } + + // Unstake - random amount between 0 and idle stake, scaled down by 50% + console.log('📉 Unstaking random amounts...') + for (const signer of signers) { + const idleStake = await HorizonStaking.getIdleStake(signer.address) + const unstakeAmount = BigInt(Math.floor(Math.random() * Number(idleStake) * 0.5)) + await HorizonStaking.connect(signer).unstake(unstakeAmount) + } + + // Subgraph Service - register + console.log('📝 Subgraph Service - registering...') + for (const signer of signers) { + const indexer = await SubgraphService.indexers(signer.address) + const isRegistered = indexer.registeredAt !== 0n + if (!isRegistered) { + const paymentsDestination = Math.random() < 0.5 ? signer.address : ethers.ZeroAddress + const data = abi.encode(['string', 'string', 'address'], ['http://indexer.xyz', '69y7mznpp', paymentsDestination]) + await SubgraphService.connect(signer).register(signer.address, data) + } + } + + // Thaw - random amount between 0 and provision tokens free, scaled down by 50% + console.log('❄️ Thawing provision tokens...') + for (const signer of signers) { + const provision = await HorizonStaking.getProvision(signer.address, SubgraphService.target) + const thawAmount = randomBigInt(0n, (provision.tokens - provision.tokensThawing) / 2n) + await HorizonStaking.connect(signer).thaw(signer.address, SubgraphService.target, thawAmount) + } + + // Deprovision/Reprovision - any thawed tokens + console.log('🧊 Deprovisioning thawed tokens...') + for (const signer of signers) { + const thawedTokens = await HorizonStaking.getThawedTokens(ThawRequestType.Provision, signer.address, SubgraphService.target, signer.address) + if (thawedTokens > 0) { + const reprovision = Math.random() < 0.5 + if (reprovision) { + await HorizonStaking.connect(signer).provision(signer.address, ethers.ZeroAddress, 1n, PROVISION_MAX_VERIFIER_CUT, PROVISION_THAWING_PERIOD) + await HorizonStaking.connect(signer).reprovision(signer.address, SubgraphService.target, ethers.ZeroAddress, 0) + } else { + await HorizonStaking.connect(signer).deprovision(signer.address, SubgraphService.target, 0) + } + } + } + + // AddToProvision - random amount between 0 and idle stake, scaled down by 50% + console.log('➕ Adding to provision...') + for (const signer of signers) { + const idleStake = await HorizonStaking.getIdleStake(signer.address) + const addAmount = randomBigInt(0n, idleStake / 2n) + await HorizonStaking.connect(signer).addToProvision(signer.address, SubgraphService.target, addAmount) + } + + // Set provision parameters + console.log('🔨 Setting provision parameters...') + for (const signer of signers) { + await HorizonStaking.connect(signer).setProvisionParameters( + signer.address, + SubgraphService.target, + Math.random() < 0.5 ? PROVISION_MAX_VERIFIER_CUT_B : PROVISION_MAX_VERIFIER_CUT, + Math.random() < 0.5 ? PROVISION_THAWING_PERIOD_B : PROVISION_THAWING_PERIOD, + ) + } + + // Subgraph service - start service + console.log('🚀 Subgraph Service - starting service...') + for (const [i, signer] of signers.entries()) { + for (const privateKey of allocationKeys[i]) { + const wallet = new ethers.Wallet(privateKey) + const allocation = await SubgraphService.getAllocation(wallet.address) + if (allocation.createdAt === 0n) { + const freeAmount = await HorizonStaking.getProviderTokensAvailable(signer.address, SubgraphService.target) - await SubgraphService.allocationProvisionTracker(signer.address) + if (freeAmount > ONE_THOUSAND) { + const allocationAmount = randomBigInt(ONE_THOUSAND, freeAmount) + const subgraphDeploymentId = ethers.keccak256(`0x${i.toString(16).padStart(2, '0')}`) + const proof = await generateAllocationProof(signer.address, privateKey, SubgraphService.target as string, graph.chainId) + const data = abi.encode(['bytes32', 'uint256', 'address', 'bytes'], [subgraphDeploymentId, allocationAmount, wallet.address, proof]) + await SubgraphService.connect(signer).startService(signer.address, data, { gasLimit: GAS_LIMIT }) + // Curate + const curate = Math.random() < 0.5 + if (curate) { + await GraphToken.connect(signer).approve(Curation.target, 12345n) + // @ts-expect-error - TODO: Fix this? + await Curation.connect(signer).mint(subgraphDeploymentId, 12345n, 0) + } + } + } + } + } + + // Subgraph service - set payments destination + console.log('🏦 Subgraph Service - setting payments destination...') + for (const signer of signers) { + const paymentsDestination = Math.random() < 0.5 ? signer.address : ethers.ZeroAddress + await SubgraphService.connect(signer).setPaymentsDestination(paymentsDestination) + } + + // Delegation cuts + console.log('✂️ Delegation cuts...') + for (const signer of signers) { + const queryFeeCut = randomBigInt(0n, 50_000n) + const indexerFeeCut = randomBigInt(0n, 50_000n) + await HorizonStaking.connect(signer).setDelegationFeeCut(signer.address, SubgraphService.target, PaymentTypes.QueryFee, queryFeeCut) + await HorizonStaking.connect(signer).setDelegationFeeCut(signer.address, SubgraphService.target, PaymentTypes.IndexingRewards, indexerFeeCut) + } + + // Subgraph service - resize allocation + console.log('🔄 Subgraph Service - resizing allocation...') + for (const [i, signer] of signers.entries()) { + for (const privateKey of allocationKeys[i]) { + if (Math.random() > 0.5) { + const wallet = new ethers.Wallet(privateKey) + const allocation = await SubgraphService.getAllocation(wallet.address) + + if (allocation.createdAt !== 0n && allocation.closedAt === 0n) { + const resizeAmount = Math.random() > 0.5 ? allocation.tokens * 9n / 10n : allocation.tokens * 11n / 10n + const freeAmount = await HorizonStaking.getProviderTokensAvailable(signer.address, SubgraphService.target) - await SubgraphService.allocationProvisionTracker(signer.address) + if (resizeAmount - allocation.tokens < freeAmount) { + await SubgraphService.connect(signer).resizeAllocation(signer.address, wallet.address, resizeAmount, { gasLimit: GAS_LIMIT }) + } + } + } + } + } + + // delegate + console.log('👥 Delegating...') + for (const signer of signers) { + const balance = await GraphToken.balanceOf(signer.address) + const delegationAmount = balance / 100n + const serviceProvider = signers[Math.floor(Math.random() * signers.length)] + await delegate(signer as HardhatEthersSigner, [serviceProvider, SubgraphService.target, delegationAmount, 0n]) + } + + // Add to delegation pool + console.log('🔁 Adding to delegation pool...') + for (const signer of signers) { + const balance = await GraphToken.balanceOf(signer.address) + const delegationAmount = balance / 500n + + const delegationPool = await HorizonStaking.getDelegationPool(signer.address, SubgraphService.target) + if (delegationPool.shares > 0) { + await addToDelegationPool(signer as HardhatEthersSigner, [signer.address, SubgraphService.target, delegationAmount]) + } + } + + // Undelegate + console.log('🔄 Undelegate...') + for (const signer of signers) { + for (const serviceProvider of signers) { + const delegation = await HorizonStaking.getDelegation(serviceProvider, SubgraphService.target, signer.address) + if (delegation.shares > 0) { + await HorizonStaking.connect(signer)['undelegate(address,address,uint256)'](serviceProvider, SubgraphService.target, delegation.shares) + } + } + } + + // withdraw delegation + console.log('💸 Withdrawing delegation...') + for (const signer of signers) { + const tokensThawed = await HorizonStaking.getThawedTokens(ThawRequestType.Delegation, signer.address, SubgraphService.target, signer.address) + if (tokensThawed > 0) { + await HorizonStaking.connect(signer)['withdrawDelegated(address,address,uint256)'](signer.address, SubgraphService.target, 0) + } + } + + // collect indexing fees + console.log('📊 Collecting indexing fees...') + for (const [i, signer] of signers.entries()) { + for (const privateKey of allocationKeys[i]) { + const wallet = new ethers.Wallet(privateKey) + const allocation = await SubgraphService.getAllocation(wallet.address) + + const timeSinceCreated = Math.floor(Date.now() / 1000) - Number(allocation.createdAt) + if (timeSinceCreated > 120 && allocation.createdAt !== 0n && allocation.closedAt === 0n) { // 10 minutes + const poi = generatePOI('POI') + const publicPoi = generatePOI('publicPOI') + const poiMetadata = encodePOIMetadata(222, publicPoi, 1, 10, 0) // random data, doesnt matter + const data = abi.encode(['address', 'bytes32', 'bytes'], [wallet.address, poi, poiMetadata]) + await SubgraphService.connect(signer).collect(signer.address, PaymentTypes.IndexingRewards, data, { gasLimit: GAS_LIMIT }) + } + } + } + + // collect query fees + console.log('💰 Collecting query fees...') + const gatewaySigner = new ethers.Wallet('0x6a0d63ca1ff7f0a6d3357fa59c2fb585f5fcf99e2c73d433022504e2147b6cdd') // use a random private key + const signerAuth = await GraphTallyCollector.authorizations(gatewaySigner.address) + + if (signerAuth.authorizer === ethers.ZeroAddress) { + const gatewayProof = generateSignerProof(9962283664n, gateway.address, gatewaySigner.privateKey, GraphTallyCollector.target as string, graph.chainId) + await GraphTallyCollector.connect(gateway).authorizeSigner(gatewaySigner.address, 9962283664n, gatewayProof) + } + + for (const [i, signer] of signers.entries()) { + const escrowAccount = await PaymentsEscrow.escrowAccounts(gateway.address, GraphTallyCollector.target, signer.address) + if (escrowAccount.balance < ONE_HUNDRED_THOUSAND) { + await GraphToken.connect(gateway).approve(PaymentsEscrow.target, ONE_HUNDRED_THOUSAND - escrowAccount.balance) + await PaymentsEscrow.connect(gateway).deposit(GraphTallyCollector.target, signer.address, ONE_HUNDRED_THOUSAND - escrowAccount.balance) + } + + for (const privateKey of allocationKeys[i]) { + const wallet = new ethers.Wallet(privateKey) + const collectionId = abi.encode(['address'], [wallet.address]) + const tokensCollected = await GraphTallyCollector.tokensCollected(SubgraphService.target, collectionId, signer.address, gateway.address) + const { rav, signature } = await generateSignedRAV( + wallet.address, + gateway.address, + signer.address, + SubgraphService.target as string, + 0, + tokensCollected + ONE_THOUSAND, + ethers.toUtf8Bytes(''), + gatewaySigner.privateKey, + GraphTallyCollector.target as string, + graph.chainId, + ) + const data = encodeCollectQueryFeesData(rav, signature, 0n) + await SubgraphService.connect(signer).collect(signer.address, 0, data, { gasLimit: GAS_LIMIT }) + } + } + + // Subgraph service - stop service + console.log('🛑 Subgraph Service - stopping service...') + for (const [i, signer] of signers.entries()) { + for (const privateKey of allocationKeys[i]) { + const wallet = new ethers.Wallet(privateKey) + const allocation = await SubgraphService.getAllocation(wallet.address) + + if (allocation.createdAt !== 0n && allocation.closedAt === 0n) { + if (Math.random() < 0.35) { + await SubgraphService.connect(signer).stopService(signer.address, abi.encode(['address'], [wallet.address])) + } + } + } + } +} + +main().catch((error) => { + console.error(error) + process.exitCode = 1 +}) diff --git a/packages/subgraph-service/scripts/post-verify b/packages/subgraph-service/scripts/post-verify new file mode 100755 index 000000000..dfcae3bcc --- /dev/null +++ b/packages/subgraph-service/scripts/post-verify @@ -0,0 +1,3 @@ +#!/bin/bash + +git ls-files --others --exclude-standard ignition/deployments | xargs rm -f \ No newline at end of file diff --git a/packages/subgraph-service/scripts/pre-verify b/packages/subgraph-service/scripts/pre-verify new file mode 100755 index 000000000..fa596b4c2 --- /dev/null +++ b/packages/subgraph-service/scripts/pre-verify @@ -0,0 +1,70 @@ +#!/bin/bash + +# Move external artifacts +cp -r ../contracts/build/contracts/contracts/* build/contracts/contracts +cp -r ../contracts/build/contracts/build-info/* build/contracts/build-info + +cp -r ../horizon/build/contracts/contracts/* build/contracts/contracts +cp -r ../horizon/build/contracts/build-info/* build/contracts/build-info + +cp -r ../horizon/build/contracts/@openzeppelin/contracts/proxy/transparent/* build/contracts/contracts +cp -r ../horizon/build/contracts/build-info/* build/contracts/build-info + +# HardHat Ignition deployment ID +DEPLOYMENT_ID="${1:-chain-421614}" + +# .dbg.json files +DBG_DIR_SRC="./build/contracts/contracts" +DBG_DIR_DEST="./ignition/deployments/${DEPLOYMENT_ID}/artifacts" + +# build-info files +BUILD_INFO_DIR_SRC="./build/contracts/build-info" +BUILD_INFO_DIR_DEST="./ignition/deployments/${DEPLOYMENT_ID}/build-info" + +# Ensure the destination directories exist +mkdir -p "$DBG_DIR_DEST" +mkdir -p "$BUILD_INFO_DIR_DEST" + +# Copy .dbg.json files +echo "Searching for .dbg.json files in $DBG_DIR_SRC and copying them to $DBG_DIR_DEST..." +find "$DBG_DIR_SRC" -type f -name "*.dbg.json" | while read -r file; do + base_name=$(basename "$file" .dbg.json) + new_name="${base_name}#${base_name}.dbg.json" + + if [ ! -f "$DBG_DIR_DEST/$new_name" ]; then + cp "$file" "$DBG_DIR_DEST/$new_name" + fi + + jq '.buildInfo |= sub("../../../../"; "../") | .buildInfo |= sub("../../../"; "../") | .buildInfo |= sub("../../"; "../")' "$DBG_DIR_DEST/$new_name" > "${DBG_DIR_DEST}/${new_name}.tmp" && mv "${DBG_DIR_DEST}/${new_name}.tmp" "$DBG_DIR_DEST/$new_name" +done + +# Copy build-info files +echo "Searching for build-info files in $BUILD_INFO_DIR_SRC and copying them to $BUILD_INFO_DIR_DEST..." +find "$BUILD_INFO_DIR_SRC" -type f -name "*.json" | while read -r file; do + base_name=$(basename "$file" .json) + if [ ! -f "$BUILD_INFO_DIR_DEST/$base_name.json" ]; then + cp "$file" "$BUILD_INFO_DIR_DEST/$base_name.json" + fi +done + +echo "All files have been processed." + +# Patch proxy artifacts +cp "$DBG_DIR_DEST/GraphProxy#GraphProxy.dbg.json" "$DBG_DIR_DEST/HorizonProxies#GraphProxy_HorizonStaking.dbg.json" +cp "$DBG_DIR_DEST/GraphProxy#GraphProxy.dbg.json" "$DBG_DIR_DEST/L2Curation#GraphProxy.dbg.json" +cp "$DBG_DIR_DEST/GraphProxy#GraphProxy.dbg.json" "$DBG_DIR_DEST/L2GraphToken#GraphProxy.dbg.json" +cp "$DBG_DIR_DEST/GraphProxy#GraphProxy.dbg.json" "$DBG_DIR_DEST/L2GraphTokenGateway#GraphProxy.dbg.json" +cp "$DBG_DIR_DEST/GraphProxy#GraphProxy.dbg.json" "$DBG_DIR_DEST/RewardsManager#GraphProxy.dbg.json" +cp "$DBG_DIR_DEST/GraphProxy#GraphProxy.dbg.json" "$DBG_DIR_DEST/BridgeEscrow#GraphProxy.dbg.json" +cp "$DBG_DIR_DEST/GraphProxy#GraphProxy.dbg.json" "$DBG_DIR_DEST/EpochManager#GraphProxy.dbg.json" + +cp "$DBG_DIR_DEST/TransparentUpgradeableProxy#TransparentUpgradeableProxy.dbg.json" "$DBG_DIR_DEST/HorizonProxies#TransparentUpgradeableProxy_GraphPayments.dbg.json" +cp "$DBG_DIR_DEST/TransparentUpgradeableProxy#TransparentUpgradeableProxy.dbg.json" "$DBG_DIR_DEST/HorizonProxies#TransparentUpgradeableProxy_PaymentsEscrow.dbg.json" +cp "$DBG_DIR_DEST/TransparentUpgradeableProxy#TransparentUpgradeableProxy.dbg.json" "$DBG_DIR_DEST/SubgraphServiceProxies#TransparentUpgradeableProxy_DisputeManager.dbg.json" +cp "$DBG_DIR_DEST/TransparentUpgradeableProxy#TransparentUpgradeableProxy.dbg.json" "$DBG_DIR_DEST/SubgraphServiceProxies#TransparentUpgradeableProxy_SubgraphService.dbg.json" + +# Rename DisputeManager to LegacyDisputeManager - this avoids artifact name collisions +mkdir -p "build/contracts/contracts/disputes/LegacyDisputeManager.sol" +mv "build/contracts/contracts/disputes/DisputeManager.sol/DisputeManager.json" "build/contracts/contracts/disputes/LegacyDisputeManager.sol/LegacyDisputeManager.json" +mv "build/contracts/contracts/disputes/DisputeManager.sol/DisputeManager.dbg.json" "build/contracts/contracts/disputes/LegacyDisputeManager.sol/LegacyDisputeManager.dbg.json" +rm -rf "build/contracts/contracts/disputes/DisputeManager.sol" \ No newline at end of file diff --git a/packages/subgraph-service/tasks/deploy.ts b/packages/subgraph-service/tasks/deploy.ts new file mode 100644 index 000000000..b19ad998d --- /dev/null +++ b/packages/subgraph-service/tasks/deploy.ts @@ -0,0 +1,196 @@ +/* eslint-disable no-case-declarations */ +import { loadConfig, patchConfig, saveToAddressBook } from '@graphprotocol/toolshed/hardhat' +import { task, types } from 'hardhat/config' +import { printHorizonBanner } from '@graphprotocol/toolshed/utils' +import { ZERO_ADDRESS } from '@graphprotocol/toolshed' + +import type { AddressBook } from '@graphprotocol/toolshed/deployments' +import type { HardhatRuntimeEnvironment } from 'hardhat/types' + +import Deploy1Module from '../ignition/modules/deploy/deploy-1' +import Deploy2Module from '../ignition/modules/deploy/deploy-2' +import HorizonModule from '@graphprotocol/horizon/ignition/modules/deploy' + +// Horizon needs the SubgraphService proxy address before it can be deployed +// But SubgraphService and DisputeManager implementations need Horizon... +// So the deployment order is: +// - Deploy SubgraphService and DisputeManager proxies +// - Deploy Horizon +// - Deploy SubgraphService and DisputeManager implementations +task('deploy:protocol', 'Deploy a new version of the Graph Protocol Horizon contracts - with Subgraph Service') + .addOptionalParam('subgraphServiceConfig', 'Name of the Subgraph Service configuration file to use. Format is "protocol..json5", file must be in the "ignition/configs/" directory. Defaults to network name.', undefined, types.string) + .addOptionalParam('horizonConfig', 'Name of the Horizon configuration file to use. Format is "protocol..json5", file must be in the "ignition/configs/" directory in the horizon package. Defaults to network name.', undefined, types.string) + .setAction(async (args, hre: HardhatRuntimeEnvironment) => { + const graph = hre.graph() + + // Load configuration files for the deployment + console.log('\n========== ⚙️ Deployment configuration ==========') + const { config: HorizonConfig, file: horizonFile } = loadConfig('./node_modules/@graphprotocol/horizon/ignition/configs', 'protocol', args.horizonConfig ?? hre.network.name) + const { config: SubgraphServiceConfig, file: subgraphServiceFile } = loadConfig('./ignition/configs/', 'protocol', args.subgraphServiceConfig ?? hre.network.name) + console.log(`Loaded Horizon migration configuration from ${horizonFile}`) + console.log(`Loaded Subgraph Service migration configuration from ${subgraphServiceFile}`) + + // Display the deployer -- this also triggers the secure accounts prompt if being used + console.log('\n========== 🔑 Deployer account ==========') + const deployer = await graph.accounts.getDeployer(args.deployerIndex) + console.log('Using deployer account:', deployer.address) + const balance = await hre.ethers.provider.getBalance(deployer.address) + console.log('Deployer balance:', hre.ethers.formatEther(balance), 'ETH') + if (balance === 0n) { + console.error('Error: Deployer account has no ETH balance') + process.exit(1) + } + + // 1. Deploy SubgraphService and DisputeManager proxies + console.log(`\n========== 🚧 SubgraphService and DisputeManager proxies ==========`) + const proxiesDeployment = await hre.ignition.deploy(Deploy1Module, { + displayUi: true, + parameters: SubgraphServiceConfig, + }) + + // 2. Deploy Horizon + console.log(`\n========== 🚧 Deploy Horizon ==========`) + const horizonDeployment = await hre.ignition.deploy(HorizonModule, { + displayUi: true, + parameters: patchConfig(HorizonConfig, { + $global: { + // The naming convention in the horizon package is slightly different + subgraphServiceAddress: proxiesDeployment.Transparent_Proxy_SubgraphService.target as string, + }, + }), + }) + + // 3. Deploy SubgraphService and DisputeManager implementations + console.log(`\n========== 🚧 Deploy SubgraphService implementations and upgrade them ==========`) + const subgraphServiceDeployment = await hre.ignition.deploy(Deploy2Module, { + displayUi: true, + parameters: patchConfig(SubgraphServiceConfig, { + $global: { + controllerAddress: horizonDeployment.Controller.target as string, + curationProxyAddress: horizonDeployment.Graph_Proxy_L2Curation.target as string, + curationImplementationAddress: horizonDeployment.Implementation_L2Curation.target as string, + disputeManagerProxyAddress: proxiesDeployment.Transparent_Proxy_DisputeManager.target as string, + disputeManagerProxyAdminAddress: proxiesDeployment.Transparent_ProxyAdmin_DisputeManager.target as string, + subgraphServiceProxyAddress: proxiesDeployment.Transparent_Proxy_SubgraphService.target as string, + subgraphServiceProxyAdminAddress: proxiesDeployment.Transparent_ProxyAdmin_SubgraphService.target as string, + graphTallyCollectorAddress: horizonDeployment.GraphTallyCollector.target as string, + gnsProxyAddress: horizonDeployment.Graph_Proxy_L2GNS.target as string, + gnsImplementationAddress: horizonDeployment.Implementation_L2GNS.target as string, + subgraphNFTAddress: horizonDeployment.SubgraphNFT.target as string, + }, + }), + }) + + // Save the addresses to the address book + console.log('\n========== 📖 Updating address book ==========') + // @ts-expect-error - @graphprotocol/toolshed/hardhat exports ts files so types mismatch here + saveToAddressBook(horizonDeployment, graph.horizon.addressBook) + // @ts-expect-error - @graphprotocol/toolshed/hardhat exports ts files so types mismatch here + saveToAddressBook(proxiesDeployment, graph.subgraphService.addressBook) + // @ts-expect-error - @graphprotocol/toolshed/hardhat exports ts files so types mismatch here + saveToAddressBook(subgraphServiceDeployment, graph.subgraphService.addressBook) + console.log(`Address book at ${graph.horizon.addressBook.file} updated!`) + console.log(`Address book at ${graph.subgraphService.addressBook.file} updated!`) + console.log('Note that Horizon deployment addresses are updated in the Horizon address book') + + console.log('\n\n🎉 ✨ 🚀 ✅ Deployment complete! 🎉 ✨ 🚀 ✅') + }) + +task('deploy:migrate', 'Deploy the Subgraph Service on an existing Horizon deployment') + .addOptionalParam('step', 'Migration step to run (1, 2)', undefined, types.int) + .addOptionalParam('subgraphServiceConfig', 'Name of the Subgraph Service configuration file to use. Format is "migrate..json5", file must be in the "ignition/configs/" directory. Defaults to network name.', undefined, types.string) + .addOptionalParam('accountIndex', 'Derivation path index for the account to use', 0, types.int) + .addFlag('patchConfig', 'Patch configuration file using address book values - does not save changes') + .addFlag('hideBanner', 'Hide the banner display') + .setAction(async (args, hre: HardhatRuntimeEnvironment) => { + // Task parameters + const step: number = args.step ?? 0 + const patchConfig: boolean = args.patchConfig ?? false + + const graph = hre.graph() + + if (!args.hideBanner) { + printHorizonBanner() + } + + // Migration step to run + console.log('\n========== 🏗️ Migration steps ==========') + const validSteps = [1, 2] + if (!validSteps.includes(step)) { + console.error(`Error: Invalid migration step provided: ${step}`) + console.error(`Valid steps are: ${validSteps.join(', ')}`) + process.exit(1) + } + console.log(`Running migration step: ${step}`) + + // Load configuration for the migration + console.log('\n========== ⚙️ Deployment configuration ==========') + const { config: SubgraphServiceMigrateConfig, file } = loadConfig('./ignition/configs/', 'migrate', args.subgraphServiceConfig ?? hre.network.name) + console.log(`Loaded migration configuration from ${file}`) + + // Display the deployer -- this also triggers the secure accounts prompt if being used + console.log('\n========== 🔑 Deployer account ==========') + const deployer = await graph.accounts.getDeployer(args.accountIndex) + console.log('Using deployer account:', deployer.address) + const balance = await hre.ethers.provider.getBalance(deployer.address) + console.log('Deployer balance:', hre.ethers.formatEther(balance), 'ETH') + if (balance === 0n) { + console.error('Error: Deployer account has no ETH balance') + process.exit(1) + } + + // Run migration step + console.log(`\n========== 🚧 Running migration: step ${step} ==========`) + const MigrationModule = require(`../ignition/modules/migrate/migrate-${step}`).default + const deployment = await hre.ignition.deploy( + MigrationModule, + { + displayUi: true, + parameters: patchConfig ? _patchStepConfig(step, SubgraphServiceMigrateConfig, graph.subgraphService.addressBook, graph.horizon.addressBook) : SubgraphServiceMigrateConfig, + deploymentId: `subgraph-service-${hre.network.name}`, + }) + + // Update address book + console.log('\n========== 📖 Updating address book ==========') + // @ts-expect-error - @graphprotocol/toolshed/hardhat exports ts files so types mismatch here + saveToAddressBook(deployment, graph.subgraphService.addressBook) + console.log(`Address book at ${graph.subgraphService.addressBook.file} updated!`) + + console.log('\n\n🎉 ✨ 🚀 ✅ Migration complete! 🎉 ✨ 🚀 ✅') + }) + +// This function patches the Ignition configuration object using an address book to fill in the gaps +// The resulting configuration is not saved back to the configuration file + +function _patchStepConfig( + step: number, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + config: any, + addressBook: AddressBook, + horizonAddressBook: AddressBook, + // eslint-disable-next-line @typescript-eslint/no-explicit-any +): any { + let patchedConfig = config + + switch (step) { + case 2: + const SubgraphService = addressBook.getEntry('SubgraphService') + const DisputeManager = addressBook.getEntry('DisputeManager') + const GraphTallyCollector = horizonAddressBook.getEntry('GraphTallyCollector') + + patchedConfig = patchConfig(config, { + $global: { + disputeManagerProxyAddress: DisputeManager.address, + disputeManagerProxyAdminAddress: DisputeManager.proxyAdmin ?? ZERO_ADDRESS, + subgraphServiceProxyAddress: SubgraphService.address, + }, + SubgraphService: { + subgraphServiceProxyAdminAddress: SubgraphService.proxyAdmin ?? ZERO_ADDRESS, + graphTallyCollectorAddress: GraphTallyCollector.address, + }, + }) + break + } + + return patchedConfig +} diff --git a/packages/subgraph-service/tasks/test/fixtures/indexers.ts b/packages/subgraph-service/tasks/test/fixtures/indexers.ts new file mode 100644 index 000000000..250c052d4 --- /dev/null +++ b/packages/subgraph-service/tasks/test/fixtures/indexers.ts @@ -0,0 +1,111 @@ +import { indexers as horizonIndexers } from '../../../../horizon/tasks/test/fixtures/indexers' +import { parseEther } from 'ethers' + +// Allocation interface +export interface Allocation { + allocationID: string + subgraphDeploymentID: string + allocationPrivateKey: string + tokens: bigint +} + +// Indexer interface +export interface Indexer { + address: string + indexingRewardCut: number + queryFeeCut: number + url: string + geoHash: string + rewardsDestination?: string + provisionTokens: bigint + legacyAllocations: Allocation[] + allocations: Allocation[] +} + +// Subgraph deployment IDs +const SUBGRAPH_DEPLOYMENT_ID_ONE = '0x02cd85012c1f075fd58fad178fd23ab841d3b5ddcf5cd3377c30118da97cb2a4' +const SUBGRAPH_DEPLOYMENT_ID_TWO = '0x03ca89485a59894f1acfa34660c69024b6b90ce45171dece7662b0886bc375c7' +const SUBGRAPH_DEPLOYMENT_ID_THREE = '0x0472e8c46f728adb65a22187c6740532f82c2ebadaeabbbe59a2bb4a1bdde197' + +// Indexer one allocations +const INDEXER_ONE_FIRST_ALLOCATION_ID = '0x097DC23d51A7800f9B1EA37919A5b223C0224eC2' +const INDEXER_ONE_FIRST_ALLOCATION_PRIVATE_KEY = '0xec5739112bc20845cdd80b2612dfb0a75599ea6fbdd8916a1e7d5be98118c315' +const INDEXER_ONE_SECOND_ALLOCATION_ID = '0x897E7056FB86372CB676EBAE73a360c22b21D4aD' +const INDEXER_ONE_SECOND_ALLOCATION_PRIVATE_KEY = '0x298519bdc6a73f0d64c96e1f7c39aba3f825886a37e0349294ce7c407bd88370' +const INDEXER_ONE_THIRD_ALLOCATION_ID = '0x02C64e54100b3Cb324ac50d9b3823402e6aA5297' +const INDEXER_ONE_THIRD_ALLOCATION_PRIVATE_KEY = '0xb8ca0ab93098c2c478c5657da7a7bb89522bb1e3198f8b469de252dfee5469a3' + +// Indexer two allocations +const INDEXER_TWO_FIRST_ALLOCATION_ID = '0xB609bBf1D5Ae3C246dA1F9a5EA327DBa66BbcB05' +const INDEXER_TWO_FIRST_ALLOCATION_PRIVATE_KEY = '0x21dce628700b82e2d9045d756e4d0ba736f652a170655398a15fadae10b0e846' +const INDEXER_TWO_SECOND_ALLOCATION_ID = '0x1bF6afCF9542983432B2fab15717c2537A3d3F2A' +const INDEXER_TWO_SECOND_ALLOCATION_PRIVATE_KEY = '0x4bf454f7d52fff97701c1ea5d1e6184c81543780ca61b82cce155a5a3e35a134' + +// Allocations map +const allocations = new Map([ + [ + horizonIndexers[0].address, + [ + { + allocationID: INDEXER_ONE_FIRST_ALLOCATION_ID, + subgraphDeploymentID: SUBGRAPH_DEPLOYMENT_ID_ONE, + allocationPrivateKey: INDEXER_ONE_FIRST_ALLOCATION_PRIVATE_KEY, + tokens: parseEther('10000'), + }, + { + allocationID: INDEXER_ONE_SECOND_ALLOCATION_ID, + subgraphDeploymentID: SUBGRAPH_DEPLOYMENT_ID_TWO, + allocationPrivateKey: INDEXER_ONE_SECOND_ALLOCATION_PRIVATE_KEY, + tokens: parseEther('8000'), + }, + { + allocationID: INDEXER_ONE_THIRD_ALLOCATION_ID, + subgraphDeploymentID: SUBGRAPH_DEPLOYMENT_ID_THREE, + allocationPrivateKey: INDEXER_ONE_THIRD_ALLOCATION_PRIVATE_KEY, + tokens: parseEther('5000'), + }, + ], + ], + [ + horizonIndexers[2].address, + [ + { + allocationID: INDEXER_TWO_FIRST_ALLOCATION_ID, + subgraphDeploymentID: SUBGRAPH_DEPLOYMENT_ID_ONE, + allocationPrivateKey: INDEXER_TWO_FIRST_ALLOCATION_PRIVATE_KEY, + tokens: parseEther('10000'), + }, + { + allocationID: INDEXER_TWO_SECOND_ALLOCATION_ID, + subgraphDeploymentID: SUBGRAPH_DEPLOYMENT_ID_TWO, + allocationPrivateKey: INDEXER_TWO_SECOND_ALLOCATION_PRIVATE_KEY, + tokens: parseEther('8000'), + }, + ], + ], +]) + +// Indexers data +export const indexers: Indexer[] = horizonIndexers + .filter(indexer => !indexer.tokensToUnstake || indexer.tokensToUnstake <= parseEther('100000')) + .map((indexer) => { + // Move existing allocations to legacyAllocations + const legacyAllocations = indexer.allocations + + // Previsouly cuts were indexer's share, Horizon cuts are delegator's share. Invert values: + // 1_000_000 - oldValue converts from "indexer keeps X%" to "delegators get X%" + const maxPpm = 1_000_000 + const indexingRewardCut = maxPpm - indexer.indexingRewardCut + const queryFeeCut = maxPpm - indexer.queryFeeCut + + return { + ...indexer, + indexingRewardCut, + queryFeeCut, + url: 'url', + geoHash: 'geohash', + provisionTokens: parseEther('1000000'), + legacyAllocations, + allocations: allocations.get(indexer.address) || [], + } + }) diff --git a/packages/subgraph-service/tasks/test/integration.ts b/packages/subgraph-service/tasks/test/integration.ts new file mode 100644 index 000000000..0fc3a40ce --- /dev/null +++ b/packages/subgraph-service/tasks/test/integration.ts @@ -0,0 +1,33 @@ +import { glob } from 'glob' +import { task } from 'hardhat/config' +import { TASK_TEST } from 'hardhat/builtin-tasks/task-names' + +import { printBanner } from '@graphprotocol/toolshed/utils' + +task('test:integration', 'Runs all integration tests') + .addParam( + 'phase', + 'Test phase to run: "during-transition-period", "after-transition-period", "after-delegation-slashing-enabled"', + ) + .setAction(async (taskArgs, hre) => { + // Get test files for each phase + const duringTransitionPeriodFiles = await glob('test/integration/during-transition-period/**/*.{js,ts}') + const afterTransitionPeriodFiles = await glob('test/integration/after-transition-period/**/*.{js,ts}') + + // Display banner for the current test phase + printBanner(taskArgs.phase, 'INTEGRATION TESTS: ') + + // Run tests for the current phase + switch (taskArgs.phase) { + case 'during-transition-period': + await hre.run(TASK_TEST, { testFiles: duringTransitionPeriodFiles }) + break + case 'after-transition-period': + await hre.run(TASK_TEST, { testFiles: afterTransitionPeriodFiles }) + break + default: + throw new Error( + 'Invalid phase. Must be "during-transition-period", "after-transition-period", "after-delegation-slashing-enabled", or "all"', + ) + } + }) diff --git a/packages/subgraph-service/tasks/test/seed.ts b/packages/subgraph-service/tasks/test/seed.ts new file mode 100644 index 000000000..aa2cfb4d4 --- /dev/null +++ b/packages/subgraph-service/tasks/test/seed.ts @@ -0,0 +1,113 @@ +import { task } from 'hardhat/config' + +import { encodeRegistrationData, encodeStartServiceData, generateAllocationProof, generatePOI, PaymentTypes } from '@graphprotocol/toolshed' +import { HorizonStakingExtension } from '@graphprotocol/horizon' + +import { indexers } from './fixtures/indexers' + +task('test:seed', 'Seed the test environment, must be run after deployment') + .setAction(async (_, hre) => { + // Get contracts + const graph = hre.graph() + const horizonStaking = graph.horizon.contracts.HorizonStaking + const horizonStakingExtension = graph.horizon.contracts.HorizonStaking as HorizonStakingExtension + const subgraphService = graph.subgraphService.contracts.SubgraphService + const disputeManager = graph.subgraphService.contracts.DisputeManager + + // Get contract addresses + const subgraphServiceAddress = await subgraphService.getAddress() + + // Get chain id + const chainId = (await hre.ethers.provider.getNetwork()).chainId + + // Get configs + const disputePeriod = await disputeManager.getDisputePeriod() + const maxSlashingCut = await disputeManager.maxSlashingCut() + + console.log('\n--- STEP 1: Close all legacy allocations ---') + + for (const indexer of indexers) { + // Skip indexers with no allocations + if (indexer.legacyAllocations.length === 0) { + continue + } + + console.log(`Closing allocations for indexer: ${indexer.address}`) + + // Get indexer signer + const indexerSigner = await hre.ethers.getSigner(indexer.address) + + // Close all allocations with POI != 0 + for (const allocation of indexer.legacyAllocations) { + console.log(`Closing allocation: ${allocation.allocationID}`) + + // Close allocation + const poi = generatePOI() + await horizonStakingExtension.connect(indexerSigner).closeAllocation( + allocation.allocationID, + poi, + ) + + const allocationData = await horizonStaking.getAllocation(allocation.allocationID) + console.log(`Allocation closed at epoch: ${allocationData.closedAtEpoch}`) + } + } + + console.log('\n--- STEP 2: Create provisions, set delegation cuts and register indexers ---') + + for (const indexer of indexers) { + // Create provision + console.log(`Creating subgraph service provision for indexer: ${indexer.address}`) + const indexerSigner = await hre.ethers.getSigner(indexer.address) + await horizonStaking.connect(indexerSigner).provision(indexer.address, await subgraphService.getAddress(), indexer.provisionTokens, maxSlashingCut, disputePeriod) + console.log(`Provision created for indexer with ${indexer.provisionTokens} tokens`) + + // Set delegation fee cut + console.log(`Setting delegation fee cut for indexer: ${indexer.address}`) + await horizonStaking.connect(indexerSigner).setDelegationFeeCut(indexer.address, subgraphServiceAddress, PaymentTypes.IndexingRewards, indexer.indexingRewardCut) + await horizonStaking.connect(indexerSigner).setDelegationFeeCut(indexer.address, subgraphServiceAddress, PaymentTypes.QueryFee, indexer.queryFeeCut) + + // Register indexer + console.log(`Registering indexer: ${indexer.address}`) + const indexerRegistrationData = encodeRegistrationData(indexer.url, indexer.geoHash, indexer.rewardsDestination || hre.ethers.ZeroAddress) + await subgraphService.connect(indexerSigner).register(indexerSigner.address, indexerRegistrationData) + + const indexerData = await subgraphService.indexers(indexerSigner.address) + + console.log(`Indexer registered at: ${indexerData.registeredAt}`) + } + + console.log('\n--- STEP 3: Start allocations ---') + + for (const indexer of indexers) { + // Skip indexers with no allocations + if (indexer.allocations.length === 0) { + continue + } + + console.log(`Starting allocations for indexer: ${indexer.address}`) + + const indexerSigner = await hre.ethers.getSigner(indexer.address) + + for (const allocation of indexer.allocations) { + console.log(`Starting allocation: ${allocation.allocationID}`) + + // Build allocation proof + const signature = await generateAllocationProof(indexer.address, allocation.allocationPrivateKey, subgraphServiceAddress, Number(chainId)) + const subgraphDeploymentId = allocation.subgraphDeploymentID + const allocationTokens = allocation.tokens + const allocationId = allocation.allocationID + + // Attempt to create an allocation with the same ID + const data = encodeStartServiceData(subgraphDeploymentId, allocationTokens, allocationId, signature) + + // Start allocation + await subgraphService.connect(indexerSigner).startService( + indexerSigner.address, + data, + ) + + console.log(`Allocation started with tokens: ${allocationTokens}`) + } + } + }) diff --git a/packages/subgraph-service/test/deployment/DisputeManager.test.ts b/packages/subgraph-service/test/deployment/DisputeManager.test.ts new file mode 100644 index 000000000..0391f978d --- /dev/null +++ b/packages/subgraph-service/test/deployment/DisputeManager.test.ts @@ -0,0 +1,60 @@ +import hre from 'hardhat' + +import { expect } from 'chai' +import { loadConfig } from '@graphprotocol/toolshed/hardhat' +import { testIf } from '../../../horizon/test/deployment/lib/testIf' +import { transparentUpgradeableProxyTests } from '../../../horizon/test/deployment/lib/TransparentUpgradeableProxy.tests' + +const config = loadConfig( + './ignition/configs/', + 'migrate', + String(process.env.TEST_DEPLOYMENT_CONFIG ?? hre.network.name), +).config +const graph = hre.graph() + +const addressBookEntry = graph.subgraphService.addressBook.getEntry('DisputeManager') +const DisputeManager = graph.subgraphService.contracts.DisputeManager + +describe('DisputeManager', function () { + testIf(2)('should be owned by the governor', async function () { + const owner = await DisputeManager.owner() + expect(owner).to.equal(config.$global.governor) + }) + + testIf(2)('should set the right arbitrator', async function () { + const arbitrator = await DisputeManager.arbitrator() + expect(arbitrator).to.equal(config.$global.arbitrator) + }) + + testIf(2)('should set the right dispute period', async function () { + const disputePeriod = await DisputeManager.disputePeriod() + expect(disputePeriod).to.equal(config.DisputeManager.disputePeriod) + }) + + testIf(2)('should set the right dispute deposit', async function () { + const disputeDeposit = await DisputeManager.disputeDeposit() + expect(disputeDeposit).to.equal(config.DisputeManager.disputeDeposit) + }) + + testIf(2)('should set the right fisherman reward cut', async function () { + const fishermanRewardCut = await DisputeManager.fishermanRewardCut() + expect(fishermanRewardCut).to.equal(config.DisputeManager.fishermanRewardCut) + }) + + testIf(2)('should set the right max slashing cut', async function () { + const maxSlashingCut = await DisputeManager.maxSlashingCut() + expect(maxSlashingCut).to.equal(config.DisputeManager.maxSlashingCut) + }) + + testIf(2)('should set the right subgraph service address', async function () { + const subgraphService = await DisputeManager.subgraphService() + expect(subgraphService).to.equal(config.$global.subgraphServiceProxyAddress) + }) +}) + +transparentUpgradeableProxyTests( + 'DisputeManager', + addressBookEntry, + config.$global.governor as string, + Number(process.env.TEST_DEPLOYMENT_STEP ?? 1) >= 2, +) diff --git a/packages/subgraph-service/test/deployment/SubgraphService.test.ts b/packages/subgraph-service/test/deployment/SubgraphService.test.ts new file mode 100644 index 000000000..87f3e8a09 --- /dev/null +++ b/packages/subgraph-service/test/deployment/SubgraphService.test.ts @@ -0,0 +1,71 @@ +import hre from 'hardhat' + +import { expect } from 'chai' +import { loadConfig } from '@graphprotocol/toolshed/hardhat' +import { testIf } from '../../../horizon/test/deployment/lib/testIf' +import { transparentUpgradeableProxyTests } from '../../../horizon/test/deployment/lib/TransparentUpgradeableProxy.tests' + +const config = loadConfig('./ignition/configs/', 'migrate', hre.network.name).config +const graph = hre.graph() + +const addressBookEntry = graph.subgraphService.addressBook.getEntry('SubgraphService') +const SubgraphService = graph.subgraphService.contracts.SubgraphService + +describe('SubgraphService', function () { + testIf(2)('should be owned by the governor', async function () { + const owner = await SubgraphService.owner() + expect(owner).to.equal(config.$global.governor) + }) + + testIf(2)('should set the right minimum provision tokens', async function () { + const [minimumProvisionTokens] = await SubgraphService.getProvisionTokensRange() + expect(minimumProvisionTokens).to.equal(config.SubgraphService.minimumProvisionTokens) + }) + + testIf(2)('should set the right delegation ratio', async function () { + const delegationRatio = await SubgraphService.getDelegationRatio() + expect(delegationRatio).to.equal(config.SubgraphService.maximumDelegationRatio) + }) + + testIf(2)('should set the right stake to fees ratio', async function () { + const stakeToFeesRatio = await SubgraphService.stakeToFeesRatio() + expect(stakeToFeesRatio).to.equal(config.SubgraphService.stakeToFeesRatio) + }) + + testIf(2)('should set the right dispute manager address', async function () { + const disputeManagerAddress = await SubgraphService.getDisputeManager() + expect(disputeManagerAddress).to.equal(config.$global.disputeManagerProxyAddress) + }) + + testIf(2)('should set the right graph tally address', async function () { + const graphTallyAddress = await SubgraphService.getGraphTallyCollector() + expect(graphTallyAddress).to.equal(config.$global.graphTallyCollectorAddress) + }) + + testIf(2)('should set the right curation address', async function () { + const curationAddress = await SubgraphService.getCuration() + expect(curationAddress).to.equal(config.$global.curationProxyAddress) + }) + + testIf(2)('should set the right pause guardians', async function () { + expect(await SubgraphService.pauseGuardians(config.$global.pauseGuardian as string)).to.equal(true) + expect(await SubgraphService.pauseGuardians(config.$global.governor as string)).to.equal(true) + }) + + testIf(2)('should set the right maxPOIStaleness', async function () { + const maxPOIStaleness = await SubgraphService.maxPOIStaleness() + expect(maxPOIStaleness).to.equal(config.SubgraphService.maxPOIStaleness) + }) + + testIf(2)('should set the right curationCut', async function () { + const curationCut = await SubgraphService.curationFeesCut() + expect(curationCut).to.equal(config.SubgraphService.curationCut) + }) +}) + +transparentUpgradeableProxyTests( + 'SubgraphService', + addressBookEntry, + config.$global.governor as string, + Number(process.env.TEST_DEPLOYMENT_STEP ?? 1) >= 2, +) diff --git a/packages/subgraph-service/test/integration/after-transition-period/dispute-manager/governance.test.ts b/packages/subgraph-service/test/integration/after-transition-period/dispute-manager/governance.test.ts new file mode 100644 index 000000000..f3c045374 --- /dev/null +++ b/packages/subgraph-service/test/integration/after-transition-period/dispute-manager/governance.test.ts @@ -0,0 +1,122 @@ +import { ethers } from 'hardhat' +import { expect } from 'chai' +import hre from 'hardhat' + +import { DisputeManager } from '../../../../typechain-types' +import { HardhatEthersSigner } from '@nomicfoundation/hardhat-ethers/signers' + +describe('DisputeManager Governance', () => { + let disputeManager: DisputeManager + let snapshotId: string + + // Test addresses + let governor: HardhatEthersSigner + let nonOwner: HardhatEthersSigner + let newArbitrator: HardhatEthersSigner + let newSubgraphService: HardhatEthersSigner + + before(async () => { + const graph = hre.graph() + disputeManager = graph.subgraphService.contracts.DisputeManager + + // Get signers + governor = await graph.accounts.getGovernor() + ;[nonOwner, newArbitrator, newSubgraphService] = await graph.accounts.getTestAccounts() + }) + + beforeEach(async () => { + // Take a snapshot before each test + snapshotId = await ethers.provider.send('evm_snapshot', []) + }) + + afterEach(async () => { + // Revert to the snapshot after each test + await ethers.provider.send('evm_revert', [snapshotId]) + }) + + describe('Arbitrator', () => { + it('should set arbitrator', async () => { + await disputeManager.connect(governor).setArbitrator(newArbitrator.address) + expect(await disputeManager.arbitrator()).to.equal(newArbitrator.address) + }) + + it('should not allow non-owner to set arbitrator', async () => { + await expect( + disputeManager.connect(nonOwner).setArbitrator(newArbitrator.address), + ).to.be.revertedWithCustomError(disputeManager, 'OwnableUnauthorizedAccount') + }) + }) + + describe('Dispute Period', () => { + it('should set dispute period', async () => { + const newDisputePeriod = 7 * 24 * 60 * 60 // 7 days in seconds + await disputeManager.connect(governor).setDisputePeriod(newDisputePeriod) + expect(await disputeManager.disputePeriod()).to.equal(newDisputePeriod) + }) + + it('should not allow non-owner to set dispute period', async () => { + const newDisputePeriod = 7 * 24 * 60 * 60 + await expect( + disputeManager.connect(nonOwner).setDisputePeriod(newDisputePeriod), + ).to.be.revertedWithCustomError(disputeManager, 'OwnableUnauthorizedAccount') + }) + }) + + describe('Dispute Deposit', () => { + it('should set dispute deposit', async () => { + const newDisputeDeposit = ethers.parseEther('1000') + await disputeManager.connect(governor).setDisputeDeposit(newDisputeDeposit) + expect(await disputeManager.disputeDeposit()).to.equal(newDisputeDeposit) + }) + + it('should not allow non-owner to set dispute deposit', async () => { + const newDisputeDeposit = ethers.parseEther('1000') + await expect( + disputeManager.connect(nonOwner).setDisputeDeposit(newDisputeDeposit), + ).to.be.revertedWithCustomError(disputeManager, 'OwnableUnauthorizedAccount') + }) + }) + + describe('Fisherman Rewards Cut', () => { + it('should set fisherman rewards cut', async () => { + const newFishermanRewardsCut = 100000 // 10% in PPM + await disputeManager.connect(governor).setFishermanRewardCut(newFishermanRewardsCut) + expect(await disputeManager.fishermanRewardCut()).to.equal(newFishermanRewardsCut) + }) + + it('should not allow non-owner to set fisherman rewards cut', async () => { + const newFishermanRewardsCut = 100000 + await expect( + disputeManager.connect(nonOwner).setFishermanRewardCut(newFishermanRewardsCut), + ).to.be.revertedWithCustomError(disputeManager, 'OwnableUnauthorizedAccount') + }) + }) + + describe('Max Slashing Cut', () => { + it('should set max slashing cut', async () => { + const newMaxSlashingCut = 200000 // 20% in PPM + await disputeManager.connect(governor).setMaxSlashingCut(newMaxSlashingCut) + expect(await disputeManager.maxSlashingCut()).to.equal(newMaxSlashingCut) + }) + + it('should not allow non-owner to set max slashing cut', async () => { + const newMaxSlashingCut = 200000 + await expect( + disputeManager.connect(nonOwner).setMaxSlashingCut(newMaxSlashingCut), + ).to.be.revertedWithCustomError(disputeManager, 'OwnableUnauthorizedAccount') + }) + }) + + describe('Subgraph Service Address', () => { + it('should set subgraph service address', async () => { + await disputeManager.connect(governor).setSubgraphService(newSubgraphService.address) + expect(await disputeManager.subgraphService()).to.equal(newSubgraphService.address) + }) + + it('should not allow non-owner to set subgraph service address', async () => { + await expect( + disputeManager.connect(nonOwner).setSubgraphService(newSubgraphService.address), + ).to.be.revertedWithCustomError(disputeManager, 'OwnableUnauthorizedAccount') + }) + }) +}) diff --git a/packages/subgraph-service/test/integration/after-transition-period/dispute-manager/indexing-disputes.test.ts b/packages/subgraph-service/test/integration/after-transition-period/dispute-manager/indexing-disputes.test.ts new file mode 100644 index 000000000..92f805aee --- /dev/null +++ b/packages/subgraph-service/test/integration/after-transition-period/dispute-manager/indexing-disputes.test.ts @@ -0,0 +1,251 @@ +import { ethers } from 'hardhat' +import { EventLog } from 'ethers' +import { expect } from 'chai' +import hre from 'hardhat' + +import { DisputeManager, IGraphToken, SubgraphService } from '../../../../typechain-types' +import { generatePOI } from '@graphprotocol/toolshed' +import { HardhatEthersSigner } from '@nomicfoundation/hardhat-ethers/signers' +import { HorizonStaking } from '@graphprotocol/horizon' + +import { indexers } from '../../../../tasks/test/fixtures/indexers' + +describe('Indexing Disputes', () => { + let disputeManager: DisputeManager + let graphToken: IGraphToken + let staking: HorizonStaking + let subgraphService: SubgraphService + + let snapshotId: string + + // Test addresses + let fisherman: HardhatEthersSigner + let arbitrator: HardhatEthersSigner + let indexer: HardhatEthersSigner + + let allocationId: string + + // Dispute manager variables + let disputeDeposit: bigint + let fishermanRewardCut: bigint + let disputePeriod: bigint + + before(async () => { + // Get contracts + const graph = hre.graph() + disputeManager = graph.subgraphService.contracts.DisputeManager + graphToken = graph.horizon.contracts.GraphToken + staking = graph.horizon.contracts.HorizonStaking + subgraphService = graph.subgraphService.contracts.SubgraphService + + // Get signers + arbitrator = await graph.accounts.getArbitrator() + ;[fisherman] = await graph.accounts.getTestAccounts() + + // Get indexer + const indexerFixture = indexers[0] + indexer = await ethers.getSigner(indexerFixture.address) + + // Get allocation + const allocation = indexerFixture.allocations[0] + allocationId = allocation.allocationID + + // Dispute manager variables + disputeDeposit = await disputeManager.disputeDeposit() + fishermanRewardCut = await disputeManager.fishermanRewardCut() + disputePeriod = await disputeManager.disputePeriod() + }) + + beforeEach(async () => { + // Take a snapshot before each test + snapshotId = await ethers.provider.send('evm_snapshot', []) + }) + + afterEach(async () => { + // Revert to the snapshot after each test + await ethers.provider.send('evm_revert', [snapshotId]) + }) + + describe('Fisherman', () => { + it('should allow fisherman to create an indexing dispute', async () => { + // Create dispute + const poi = generatePOI() + + // Approve dispute manager for dispute deposit + await graphToken.connect(fisherman).approve(disputeManager.target, disputeDeposit) + + // Create dispute + const tx = await disputeManager.connect(fisherman).createIndexingDispute(allocationId, poi) + const receipt = await tx.wait() + + // Get dispute ID from event + const disputeCreatedEvent = receipt?.logs.find( + log => log instanceof EventLog && log.fragment?.name === 'IndexingDisputeCreated', + ) as EventLog + const disputeId = disputeCreatedEvent?.args[0] + + // Verify dispute was created + const dispute = await disputeManager.disputes(disputeId) + expect(dispute.indexer).to.equal(indexer.address, 'Indexer address mismatch') + expect(dispute.fisherman).to.equal(fisherman.address, 'Fisherman address mismatch') + expect(dispute.disputeType).to.equal(1, 'Dispute type should be indexing') + expect(dispute.status).to.equal(4, 'Dispute status should be pending') + }) + + it('should allow fisherman to cancel an indexing dispute', async () => { + // Create dispute + const poi = generatePOI() + + // Approve dispute manager for dispute deposit + await graphToken.connect(fisherman).approve(disputeManager.target, disputeDeposit) + + // Create dispute + const tx = await disputeManager.connect(fisherman).createIndexingDispute(allocationId, poi) + const receipt = await tx.wait() + + // Get dispute ID from event + const disputeCreatedEvent = receipt?.logs.find( + log => log instanceof EventLog && log.fragment?.name === 'IndexingDisputeCreated', + ) as EventLog + const disputeId = disputeCreatedEvent?.args[0] + + // Get fisherman's balance before canceling dispute + const fishermanBalanceBefore = await graphToken.balanceOf(fisherman.address) + + // Pass dispute period + await ethers.provider.send('evm_increaseTime', [Number(disputePeriod) + 1]) + await ethers.provider.send('evm_mine', []) + + // Cancel dispute + await disputeManager.connect(fisherman).cancelDispute(disputeId) + + // Verify dispute was canceled + const updatedDispute = await disputeManager.disputes(disputeId) + expect(updatedDispute.status).to.equal(5, 'Dispute status should be canceled') + + // Verify fisherman got the deposit back + const fishermanBalance = await graphToken.balanceOf(fisherman.address) + expect(fishermanBalance).to.equal(fishermanBalanceBefore + disputeDeposit, 'Fisherman should receive the deposit back') + }) + }) + + describe('Arbitrating Indexing Disputes', () => { + let disputeId: string + + beforeEach(async () => { + // Approve dispute manager for dispute deposit + await graphToken.connect(fisherman).approve(disputeManager.target, disputeDeposit) + + // Create dispute + const poi = generatePOI() + const tx = await disputeManager.connect(fisherman).createIndexingDispute(allocationId, poi) + const receipt = await tx.wait() + + // Get dispute ID from event + const disputeCreatedEvent = receipt?.logs.find( + log => log instanceof EventLog && log.fragment?.name === 'IndexingDisputeCreated', + ) as EventLog + disputeId = disputeCreatedEvent?.args[0] + }) + + it('should allow arbitrator to accept an indexing dispute', async () => { + // Get fisherman's balance before accepting dispute + const fishermanBalanceBefore = await graphToken.balanceOf(fisherman.address) + + // Get indexer's provision before accepting dispute + const provision = await staking.getProviderTokensAvailable(indexer.address, await subgraphService.getAddress()) + + // Get indexer stake snapshot + const dispute = await disputeManager.disputes(disputeId) + const tokensToSlash = dispute.stakeSnapshot / 10n + + // Accept dispute + await disputeManager.connect(arbitrator).acceptDispute(disputeId, tokensToSlash) + + // Verify dispute status + const updatedDispute = await disputeManager.disputes(disputeId) + expect(updatedDispute.status).to.equal(1, 'Dispute status should be accepted') + + // Verify indexer's stake was slashed + const updatedProvision = await staking.getProviderTokensAvailable(indexer.address, await subgraphService.getAddress()) + expect(updatedProvision).to.equal(provision - tokensToSlash, 'Indexer stake should be slashed') + + // Verify fisherman got the deposit plus the reward + const fishermanBalance = await graphToken.balanceOf(fisherman.address) + const fishermanReward = (tokensToSlash * fishermanRewardCut) / 1000000n + const fishermanTotal = fishermanBalanceBefore + fishermanReward + disputeDeposit + expect(fishermanBalance).to.equal(fishermanTotal, 'Fisherman balance should be increased by the reward and deposit') + }) + + it('should allow arbitrator to draw an indexing dispute', async () => { + // Get fisherman's balance before drawing dispute + const fishermanBalanceBefore = await graphToken.balanceOf(fisherman.address) + + // Get indexer's provision before drawing dispute + const provision = await staking.getProviderTokensAvailable(indexer.address, await subgraphService.getAddress()) + + // Draw dispute + await disputeManager.connect(arbitrator).drawDispute(disputeId) + + // Verify dispute status + const updatedDispute = await disputeManager.disputes(disputeId) + expect(updatedDispute.status).to.equal(3, 'Dispute status should be drawn') + + // Verify indexer's provision was not affected + const updatedProvision = await staking.getProviderTokensAvailable(indexer.address, await subgraphService.getAddress()) + expect(updatedProvision).to.equal(provision, 'Indexer stake should not be affected') + + // Verify fisherman got the deposit back + const fishermanBalance = await graphToken.balanceOf(fisherman.address) + expect(fishermanBalance).to.equal(fishermanBalanceBefore + disputeDeposit, 'Fisherman should receive the deposit back') + }) + + it('should allow arbitrator to reject an indexing dispute', async () => { + // Get fisherman's balance before rejecting dispute + const fishermanBalanceBefore = await graphToken.balanceOf(fisherman.address) + + // Get indexer's provision before rejecting dispute + const provision = await staking.getProviderTokensAvailable(indexer.address, await subgraphService.getAddress()) + + // Reject dispute + await disputeManager.connect(arbitrator).rejectDispute(disputeId) + + // Verify dispute status + const updatedDispute = await disputeManager.disputes(disputeId) + expect(updatedDispute.status).to.equal(2, 'Dispute status should be rejected') + + // Verify indexer's provision was not affected + const updatedProvision = await staking.getProviderTokensAvailable(indexer.address, await subgraphService.getAddress()) + expect(updatedProvision).to.equal(provision, 'Indexer stake should not be affected') + + // Verify fisherman did not receive the deposit + const fishermanBalance = await graphToken.balanceOf(fisherman.address) + expect(fishermanBalance).to.equal(fishermanBalanceBefore, 'Fisherman balance should not receive the deposit back') + }) + + it('should not allow non-arbitrator to accept an indexing dispute', async () => { + // Get indexer stake snapshot + const dispute = await disputeManager.disputes(disputeId) + const tokensToSlash = dispute.stakeSnapshot / 10n + + // Attempt to accept dispute as fisherman + await expect( + disputeManager.connect(fisherman).acceptDispute(disputeId, tokensToSlash), + ).to.be.revertedWithCustomError(disputeManager, 'DisputeManagerNotArbitrator') + }) + + it('should not allow non-arbitrator to draw an indexing dispute', async () => { + // Attempt to draw dispute as fisherman + await expect( + disputeManager.connect(fisherman).drawDispute(disputeId), + ).to.be.revertedWithCustomError(disputeManager, 'DisputeManagerNotArbitrator') + }) + + it('should not allow non-arbitrator to reject an indexing dispute', async () => { + // Attempt to reject dispute as fisherman + await expect( + disputeManager.connect(fisherman).rejectDispute(disputeId), + ).to.be.revertedWithCustomError(disputeManager, 'DisputeManagerNotArbitrator') + }) + }) +}) diff --git a/packages/subgraph-service/test/integration/after-transition-period/dispute-manager/query-conflict-disputes.test.ts b/packages/subgraph-service/test/integration/after-transition-period/dispute-manager/query-conflict-disputes.test.ts new file mode 100644 index 000000000..33ad38ceb --- /dev/null +++ b/packages/subgraph-service/test/integration/after-transition-period/dispute-manager/query-conflict-disputes.test.ts @@ -0,0 +1,369 @@ +import { ethers } from 'hardhat' +import { EventLog } from 'ethers' +import { expect } from 'chai' +import hre from 'hardhat' + +import { DisputeManager, IGraphToken, SubgraphService } from '../../../../typechain-types' +import { generateAttestationData } from '@graphprotocol/toolshed' +import { HardhatEthersSigner } from '@nomicfoundation/hardhat-ethers/signers' +import { HorizonStaking } from '@graphprotocol/horizon' + +import { indexers } from '../../../../tasks/test/fixtures/indexers' + +describe('Query Conflict Disputes', () => { + let disputeManager: DisputeManager + let graphToken: IGraphToken + let staking: HorizonStaking + let subgraphService: SubgraphService + + let snapshotId: string + let chainId: number + + // Test addresses + let fisherman: HardhatEthersSigner + let arbitrator: HardhatEthersSigner + let indexer: HardhatEthersSigner + let relatedIndexer: HardhatEthersSigner + + // Allocation variables + let allocationPrivateKey: string + let relatedAllocationPrivateKey: string + let subgraphDeploymentId: string + + // Dispute manager variables + let disputeDeposit: bigint + let fishermanRewardCut: bigint + let disputePeriod: bigint + let disputeManagerAddress: string + + before(async () => { + // Get contracts + const graph = hre.graph() + disputeManager = graph.subgraphService.contracts.DisputeManager + graphToken = graph.horizon.contracts.GraphToken + staking = graph.horizon.contracts.HorizonStaking + subgraphService = graph.subgraphService.contracts.SubgraphService + + // Get signers + arbitrator = await graph.accounts.getArbitrator() + ;[fisherman] = await graph.accounts.getTestAccounts() + + // Get indexers + const indexerFixture = indexers[0] + indexer = await ethers.getSigner(indexerFixture.address) + const relatedIndexerFixture = indexers[1] + relatedIndexer = await ethers.getSigner(relatedIndexerFixture.address) + + // Get allocation + const allocation = indexerFixture.allocations[0] + allocationPrivateKey = allocation.allocationPrivateKey + const relatedAllocation = relatedIndexerFixture.allocations[0] + relatedAllocationPrivateKey = relatedAllocation.allocationPrivateKey + subgraphDeploymentId = allocation.subgraphDeploymentID + + // Dispute manager variables + disputeDeposit = await disputeManager.disputeDeposit() + fishermanRewardCut = await disputeManager.fishermanRewardCut() + disputePeriod = await disputeManager.disputePeriod() + disputeManagerAddress = await disputeManager.getAddress() + + // Get chain ID + chainId = Number((await ethers.provider.getNetwork()).chainId) + }) + + beforeEach(async () => { + // Take a snapshot before each test + snapshotId = await ethers.provider.send('evm_snapshot', []) + }) + + afterEach(async () => { + // Revert to the snapshot after each test + await ethers.provider.send('evm_revert', [snapshotId]) + }) + + describe('Fisherman', () => { + it('should allow fisherman to create a query conflict dispute', async () => { + // Create dispute + const queryHash = ethers.keccak256(ethers.toUtf8Bytes('test-query')) + const responseHash1 = ethers.keccak256(ethers.toUtf8Bytes('test-response-1')) + const responseHash2 = ethers.keccak256(ethers.toUtf8Bytes('test-response-2')) + + // Create attestation data for both responses + const attestationData1 = await generateAttestationData( + queryHash, + responseHash1, + subgraphDeploymentId, + allocationPrivateKey, + disputeManagerAddress, + chainId, + ) + const attestationData2 = await generateAttestationData( + queryHash, + responseHash2, + subgraphDeploymentId, + relatedAllocationPrivateKey, + disputeManagerAddress, + chainId, + ) + + // Approve dispute manager for dispute deposit + await graphToken.connect(fisherman).approve(disputeManager.target, disputeDeposit) + + // Create dispute + const tx = await disputeManager.connect(fisherman).createQueryDisputeConflict(attestationData1, attestationData2) + const receipt = await tx.wait() + + // Get dispute ID from event + const disputeLinkedEvent = receipt?.logs.find( + log => log instanceof EventLog && log.fragment?.name === 'DisputeLinked', + ) as EventLog + const disputeId = disputeLinkedEvent?.args[0] + const relatedDisputeId = disputeLinkedEvent?.args[1] + + // Verify dispute was created + const dispute = await disputeManager.disputes(disputeId) + expect(dispute.indexer).to.equal(indexer.address, 'Indexer address mismatch') + expect(dispute.fisherman).to.equal(fisherman.address, 'Fisherman address mismatch') + expect(dispute.disputeType).to.equal(2, 'Dispute type should be query') + expect(dispute.status).to.equal(4, 'Dispute status should be pending') + + // Verify related dispute was created + const relatedDispute = await disputeManager.disputes(relatedDisputeId) + expect(relatedDispute.indexer).to.equal(relatedIndexer.address, 'Related indexer address mismatch') + expect(relatedDispute.fisherman).to.equal(fisherman.address, 'Related fisherman address mismatch') + expect(relatedDispute.disputeType).to.equal(2, 'Related dispute type should be query') + expect(relatedDispute.status).to.equal(4, 'Related dispute status should be pending') + }) + + it('should allow fisherman to cancel a query conflict dispute', async () => { + // Create dispute + const queryHash = ethers.keccak256(ethers.toUtf8Bytes('test-query')) + const responseHash1 = ethers.keccak256(ethers.toUtf8Bytes('test-response-1')) + const responseHash2 = ethers.keccak256(ethers.toUtf8Bytes('test-response-2')) + + // Create attestation data for both responses + const attestationData1 = await generateAttestationData( + queryHash, + responseHash1, + subgraphDeploymentId, + allocationPrivateKey, + disputeManagerAddress, + chainId, + ) + const attestationData2 = await generateAttestationData( + queryHash, + responseHash2, + subgraphDeploymentId, + relatedAllocationPrivateKey, + disputeManagerAddress, + chainId, + ) + + // Approve dispute manager for dispute deposit + await graphToken.connect(fisherman).approve(disputeManager.target, disputeDeposit) + + // Create dispute + const tx = await disputeManager.connect(fisherman).createQueryDisputeConflict(attestationData1, attestationData2) + const receipt = await tx.wait() + + // Get dispute ID from event + const disputeLinkedEvent = receipt?.logs.find( + log => log instanceof EventLog && log.fragment?.name === 'DisputeLinked', + ) as EventLog + const disputeId = disputeLinkedEvent?.args[0] + const relatedDisputeId = disputeLinkedEvent?.args[1] + + // Get fisherman's balance before canceling dispute + const fishermanBalanceBefore = await graphToken.balanceOf(fisherman.address) + + // Pass dispute period + await ethers.provider.send('evm_increaseTime', [Number(disputePeriod) + 1]) + await ethers.provider.send('evm_mine', []) + + // Cancel dispute + await disputeManager.connect(fisherman).cancelDispute(disputeId) + + // Verify dispute was canceled + const updatedDispute = await disputeManager.disputes(disputeId) + expect(updatedDispute.status).to.equal(5, 'Dispute status should be canceled') + + // Verify related dispute was canceled + const updatedRelatedDispute = await disputeManager.disputes(relatedDisputeId) + expect(updatedRelatedDispute.status).to.equal(5, 'Related dispute status should be canceled') + + // Verify fisherman got the deposit back + const fishermanBalance = await graphToken.balanceOf(fisherman.address) + expect(fishermanBalance).to.equal(fishermanBalanceBefore + disputeDeposit, 'Fisherman should receive the deposit back') + }) + }) + + describe('Arbitrating Query Conflict Disputes', () => { + let disputeId: string + let relatedDisputeId: string + + beforeEach(async () => { + // Create dispute + const queryHash = ethers.keccak256(ethers.toUtf8Bytes('test-query')) + const responseHash1 = ethers.keccak256(ethers.toUtf8Bytes('test-response-1')) + const responseHash2 = ethers.keccak256(ethers.toUtf8Bytes('test-response-2')) + + // Create attestation data for both responses + const attestationData1 = await generateAttestationData( + queryHash, + responseHash1, + subgraphDeploymentId, + allocationPrivateKey, + disputeManagerAddress, + chainId, + ) + const attestationData2 = await generateAttestationData( + queryHash, + responseHash2, + subgraphDeploymentId, + relatedAllocationPrivateKey, + disputeManagerAddress, + chainId, + ) + + // Approve dispute manager for dispute deposit + await graphToken.connect(fisherman).approve(disputeManager.target, disputeDeposit) + + // Create dispute + const tx = await disputeManager.connect(fisherman).createQueryDisputeConflict(attestationData1, attestationData2) + const receipt = await tx.wait() + + // Get dispute ID from event + const disputeLinkedEvent = receipt?.logs.find( + log => log instanceof EventLog && log.fragment?.name === 'DisputeLinked', + ) as EventLog + disputeId = disputeLinkedEvent?.args[0] + relatedDisputeId = disputeLinkedEvent?.args[1] + }) + + it('should allow arbitrator to accept one of the query conflict disputes', async () => { + // Get fisherman's balance before accepting dispute + const fishermanBalanceBefore = await graphToken.balanceOf(fisherman.address) + + // Get indexer's provision before accepting dispute + const provision = await staking.getProviderTokensAvailable(indexer.address, await subgraphService.getAddress()) + + // Get indexer stake snapshot + const dispute = await disputeManager.disputes(disputeId) + const tokensToSlash = dispute.stakeSnapshot / 10n + + // Accept dispute with first response + await disputeManager.connect(arbitrator).acceptDisputeConflict(disputeId, tokensToSlash, false, 0n) + + // Verify dispute status + const updatedDispute = await disputeManager.disputes(disputeId) + expect(updatedDispute.status).to.equal(1, 'Dispute status should be accepted') + + // Verify indexer's stake was slashed + const updatedProvision = await staking.getProviderTokensAvailable(indexer.address, await subgraphService.getAddress()) + expect(updatedProvision).to.equal(provision - tokensToSlash, 'Indexer stake should be slashed') + + // Verify fisherman got the deposit plus the reward + const fishermanBalance = await graphToken.balanceOf(fisherman.address) + const fishermanReward = (tokensToSlash * fishermanRewardCut) / 1000000n + const fishermanTotal = fishermanBalanceBefore + fishermanReward + disputeDeposit + expect(fishermanBalance).to.equal(fishermanTotal, 'Fisherman balance should be increased by the reward and deposit') + }) + + it('should allow arbitrator to accept both query conflict disputes', async () => { + // Get fisherman's balance before accepting dispute + const fishermanBalanceBefore = await graphToken.balanceOf(fisherman.address) + + // Get indexer's provision before accepting dispute + const provision = await staking.getProviderTokensAvailable(indexer.address, await subgraphService.getAddress()) + const provisionRelated = await staking.getProviderTokensAvailable(relatedIndexer.address, await subgraphService.getAddress()) + + // Get indexer stake snapshot + const dispute = await disputeManager.disputes(disputeId) + const relatedDispute = await disputeManager.disputes(relatedDisputeId) + const tokensToSlash = dispute.stakeSnapshot / 10n + const tokensToSlashRelated = relatedDispute.stakeSnapshot / 10n + + // Accept dispute with both responses + await disputeManager.connect(arbitrator).acceptDisputeConflict(disputeId, tokensToSlash, true, tokensToSlashRelated) + + // Verify dispute status + const updatedDispute = await disputeManager.disputes(disputeId) + expect(updatedDispute.status).to.equal(1, 'Dispute status should be accepted') + + // Verify related dispute status + const updatedRelatedDispute = await disputeManager.disputes(relatedDisputeId) + expect(updatedRelatedDispute.status).to.equal(1, 'Related dispute status should be accepted') + + // Verify indexer's stake was slashed + const updatedProvision = await staking.getProviderTokensAvailable(indexer.address, await subgraphService.getAddress()) + expect(updatedProvision).to.equal(provision - tokensToSlash, 'Indexer stake should be slashed') + + // Verify related indexer's stake was slashed + const updatedProvisionRelated = await staking.getProviderTokensAvailable(relatedIndexer.address, await subgraphService.getAddress()) + expect(updatedProvisionRelated).to.equal(provisionRelated - tokensToSlashRelated, 'Related indexer stake should be slashed') + + // Verify fisherman got the deposit plus the reward + const fishermanBalance = await graphToken.balanceOf(fisherman.address) + const fishermanReward = ((tokensToSlash + tokensToSlashRelated) * fishermanRewardCut) / 1000000n + const fishermanTotal = fishermanBalanceBefore + fishermanReward + disputeDeposit + expect(fishermanBalance).to.equal(fishermanTotal, 'Fisherman balance should be increased by the reward and deposit') + }) + + it('should allow arbitrator to draw query conflict dispute', async () => { + // Get fisherman's balance before drawing dispute + const fishermanBalanceBefore = await graphToken.balanceOf(fisherman.address) + + // Get indexer's provision before drawing disputes + const provision = await staking.getProviderTokensAvailable(indexer.address, await subgraphService.getAddress()) + const provisionRelated = await staking.getProviderTokensAvailable(relatedIndexer.address, await subgraphService.getAddress()) + + // Draw dispute + await disputeManager.connect(arbitrator).drawDispute(disputeId) + + // Verify dispute status + const updatedDispute = await disputeManager.disputes(disputeId) + expect(updatedDispute.status).to.equal(3, 'Dispute status should be drawn') + + // Verify related dispute status + const updatedRelatedDispute = await disputeManager.disputes(relatedDisputeId) + expect(updatedRelatedDispute.status).to.equal(3, 'Related dispute status should be drawn') + + // Verify indexer's provision was not affected + const updatedProvision = await staking.getProviderTokensAvailable(indexer.address, await subgraphService.getAddress()) + expect(updatedProvision).to.equal(provision, 'Indexer stake should not be affected') + + // Verify related indexer's provision was not affected + const updatedProvisionRelated = await staking.getProviderTokensAvailable(relatedIndexer.address, await subgraphService.getAddress()) + expect(updatedProvisionRelated).to.equal(provisionRelated, 'Related indexer stake should not be affected') + + // Verify fisherman got the deposit back + const fishermanBalance = await graphToken.balanceOf(fisherman.address) + expect(fishermanBalance).to.equal(fishermanBalanceBefore + disputeDeposit, 'Fisherman should receive the deposit back') + }) + + it('should not allow arbitrator to reject a query conflict dispute', async () => { + // Attempt to reject dispute + await expect( + disputeManager.connect(arbitrator).rejectDispute(disputeId), + ).to.be.revertedWithCustomError(disputeManager, 'DisputeManagerDisputeInConflict') + }) + + it('should not allow non-arbitrator to accept a query conflict dispute', async () => { + // Get indexer stake snapshot + const dispute = await disputeManager.disputes(disputeId) + const tokensToSlash = dispute.stakeSnapshot / 10n + + // Attempt to accept dispute as fisherman + await expect( + disputeManager.connect(fisherman).acceptDispute(disputeId, tokensToSlash), + ).to.be.revertedWithCustomError(disputeManager, 'DisputeManagerNotArbitrator') + }) + + it('should not allow non-arbitrator to draw a query conflict dispute', async () => { + // Attempt to draw dispute as fisherman + await expect( + disputeManager.connect(fisherman).drawDispute(disputeId), + ).to.be.revertedWithCustomError(disputeManager, 'DisputeManagerNotArbitrator') + }) + }) +}) diff --git a/packages/subgraph-service/test/integration/after-transition-period/dispute-manager/query-disputes.test.ts b/packages/subgraph-service/test/integration/after-transition-period/dispute-manager/query-disputes.test.ts new file mode 100644 index 000000000..03878f960 --- /dev/null +++ b/packages/subgraph-service/test/integration/after-transition-period/dispute-manager/query-disputes.test.ts @@ -0,0 +1,298 @@ +import { ethers } from 'hardhat' +import { EventLog } from 'ethers' +import { expect } from 'chai' +import hre from 'hardhat' + +import { DisputeManager, IGraphToken, SubgraphService } from '../../../../typechain-types' +import { generateAttestationData } from '@graphprotocol/toolshed' +import { HardhatEthersSigner } from '@nomicfoundation/hardhat-ethers/signers' +import { HorizonStaking } from '@graphprotocol/horizon' +import { setGRTBalance } from '@graphprotocol/toolshed/hardhat' + +import { indexers } from '../../../../tasks/test/fixtures/indexers' + +describe('Query Disputes', () => { + let disputeManager: DisputeManager + let graphToken: IGraphToken + let staking: HorizonStaking + let subgraphService: SubgraphService + + let snapshotId: string + let chainId: number + // Test addresses + let fisherman: HardhatEthersSigner + let arbitrator: HardhatEthersSigner + let indexer: HardhatEthersSigner + + // Allocation variables + let allocationPrivateKey: string + let subgraphDeploymentId: string + + // Dispute manager variables + let disputeDeposit: bigint + let fishermanRewardCut: bigint + let disputePeriod: bigint + let disputeManagerAddress: string + + before(async () => { + // Get contracts + const graph = hre.graph() + disputeManager = graph.subgraphService.contracts.DisputeManager + graphToken = graph.horizon.contracts.GraphToken + staking = graph.horizon.contracts.HorizonStaking + subgraphService = graph.subgraphService.contracts.SubgraphService + + // Get signers + arbitrator = await graph.accounts.getArbitrator() + ;[fisherman] = await graph.accounts.getTestAccounts() + + // Get indexer + const indexerFixture = indexers[0] + indexer = await ethers.getSigner(indexerFixture.address) + + // Get allocation + const allocation = indexerFixture.allocations[0] + allocationPrivateKey = allocation.allocationPrivateKey + subgraphDeploymentId = allocation.subgraphDeploymentID + + // Dispute manager variables + disputeDeposit = await disputeManager.disputeDeposit() + fishermanRewardCut = await disputeManager.fishermanRewardCut() + disputePeriod = await disputeManager.disputePeriod() + disputeManagerAddress = await disputeManager.getAddress() + + // Get chain ID + chainId = Number((await ethers.provider.getNetwork()).chainId) + + // Set GRT balance for fisherman + await setGRTBalance(graph.provider, graphToken.target, fisherman.address, ethers.parseEther('1000000')) + }) + + beforeEach(async () => { + // Take a snapshot before each test + snapshotId = await ethers.provider.send('evm_snapshot', []) + }) + + afterEach(async () => { + // Revert to the snapshot after each test + await ethers.provider.send('evm_revert', [snapshotId]) + }) + + describe('Fisherman', () => { + it('should allow fisherman to create a query dispute', async () => { + // Create dispute + const queryHash = ethers.keccak256(ethers.toUtf8Bytes('test-query')) + const responseHash = ethers.keccak256(ethers.toUtf8Bytes('test-response')) + + // Create attestation data + const attestationData = await generateAttestationData( + queryHash, + responseHash, + subgraphDeploymentId, + allocationPrivateKey, + disputeManagerAddress, + chainId, + ) + + // Approve dispute manager for dispute deposit + await graphToken.connect(fisherman).approve(disputeManager.target, disputeDeposit) + + // Create dispute + const tx = await disputeManager.connect(fisherman).createQueryDispute(attestationData) + const receipt = await tx.wait() + + // Get dispute ID from event + const disputeCreatedEvent = receipt?.logs.find( + log => log instanceof EventLog && log.fragment?.name === 'QueryDisputeCreated', + ) as EventLog + const disputeId = disputeCreatedEvent?.args[0] + + // Verify dispute was created + const dispute = await disputeManager.disputes(disputeId) + expect(dispute.indexer).to.equal(indexer.address, 'Indexer address mismatch') + expect(dispute.fisherman).to.equal(fisherman.address, 'Fisherman address mismatch') + expect(dispute.disputeType).to.equal(2, 'Dispute type should be query') + expect(dispute.status).to.equal(4, 'Dispute status should be pending') + }) + + it('should allow fisherman to cancel a query dispute after dispute period', async () => { + // Create dispute + const queryHash = ethers.keccak256(ethers.toUtf8Bytes('test-query')) + const responseHash = ethers.keccak256(ethers.toUtf8Bytes('test-response')) + + // Create attestation data + const attestationData = await generateAttestationData( + queryHash, + responseHash, + subgraphDeploymentId, + allocationPrivateKey, + disputeManagerAddress, + chainId, + ) + + // Approve dispute manager for dispute deposit + await graphToken.connect(fisherman).approve(disputeManager.target, disputeDeposit) + + // Create dispute + const tx = await disputeManager.connect(fisherman).createQueryDispute(attestationData) + const receipt = await tx.wait() + + // Get dispute ID from event + const disputeCreatedEvent = receipt?.logs.find( + log => log instanceof EventLog && log.fragment?.name === 'QueryDisputeCreated', + ) as EventLog + const disputeId = disputeCreatedEvent?.args[0] + + // Get fisherman's balance before canceling dispute + const fishermanBalanceBefore = await graphToken.balanceOf(fisherman.address) + + // Pass dispute period + await ethers.provider.send('evm_increaseTime', [Number(disputePeriod) + 1]) + await ethers.provider.send('evm_mine', []) + + // Cancel dispute + await disputeManager.connect(fisherman).cancelDispute(disputeId) + + // Verify dispute was canceled + const updatedDispute = await disputeManager.disputes(disputeId) + expect(updatedDispute.status).to.equal(5, 'Dispute status should be canceled') + + // Verify fisherman got the deposit back + const fishermanBalance = await graphToken.balanceOf(fisherman.address) + expect(fishermanBalance).to.equal(fishermanBalanceBefore + disputeDeposit, 'Fisherman should receive the deposit back') + }) + }) + + describe('Arbitrating Query Disputes', () => { + let disputeId: string + + beforeEach(async () => { + // Create dispute + const queryHash = ethers.keccak256(ethers.toUtf8Bytes('test-query')) + const responseHash = ethers.keccak256(ethers.toUtf8Bytes('test-response')) + + // Create attestation data + const attestationData = await generateAttestationData( + queryHash, + responseHash, + subgraphDeploymentId, + allocationPrivateKey, + disputeManagerAddress, + chainId, + ) + + // Approve dispute manager for dispute deposit + await graphToken.connect(fisherman).approve(disputeManager.target, disputeDeposit) + + // Create dispute + const tx = await disputeManager.connect(fisherman).createQueryDispute(attestationData) + const receipt = await tx.wait() + + // Get dispute ID from event + const disputeCreatedEvent = receipt?.logs.find( + log => log instanceof EventLog && log.fragment?.name === 'QueryDisputeCreated', + ) as EventLog + disputeId = disputeCreatedEvent?.args[0] + }) + + it('should allow arbitrator to accept a query dispute', async () => { + // Get fisherman's balance before accepting dispute + const fishermanBalanceBefore = await graphToken.balanceOf(fisherman.address) + + // Get indexer's provision before accepting dispute + const provision = await staking.getProviderTokensAvailable(indexer.address, await subgraphService.getAddress()) + + // Get indexer stake snapshot + const dispute = await disputeManager.disputes(disputeId) + const tokensToSlash = dispute.stakeSnapshot / 10n + + // Accept dispute + await disputeManager.connect(arbitrator).acceptDispute(disputeId, tokensToSlash) + + // Verify dispute status + const updatedDispute = await disputeManager.disputes(disputeId) + expect(updatedDispute.status).to.equal(1, 'Dispute status should be accepted') + + // Verify indexer's stake was slashed + const updatedProvision = await staking.getProviderTokensAvailable(indexer.address, await subgraphService.getAddress()) + expect(updatedProvision).to.equal(provision - tokensToSlash, 'Indexer stake should be slashed') + + // Verify fisherman got the deposit plus the reward + const fishermanBalance = await graphToken.balanceOf(fisherman.address) + const fishermanReward = (tokensToSlash * fishermanRewardCut) / 1000000n + const fishermanTotal = fishermanBalanceBefore + fishermanReward + disputeDeposit + expect(fishermanBalance).to.equal(fishermanTotal, 'Fisherman balance should be increased by the reward and deposit') + }) + + it('should allow arbitrator to draw a query dispute', async () => { + // Get fisherman's balance before drawing dispute + const fishermanBalanceBefore = await graphToken.balanceOf(fisherman.address) + + // Get indexer's provision before drawing dispute + const provision = await staking.getProviderTokensAvailable(indexer.address, await subgraphService.getAddress()) + + // Draw dispute + await disputeManager.connect(arbitrator).drawDispute(disputeId) + + // Verify dispute status + const updatedDispute = await disputeManager.disputes(disputeId) + expect(updatedDispute.status).to.equal(3, 'Dispute status should be drawn') + + // Verify indexer's provision was not affected + const updatedProvision = await staking.getProviderTokensAvailable(indexer.address, await subgraphService.getAddress()) + expect(updatedProvision).to.equal(provision, 'Indexer stake should not be affected') + + // Verify fisherman got the deposit back + const fishermanBalance = await graphToken.balanceOf(fisherman.address) + expect(fishermanBalance).to.equal(fishermanBalanceBefore + disputeDeposit, 'Fisherman should receive the deposit back') + }) + + it('should allow arbitrator to reject a query dispute', async () => { + // Get fisherman's balance before rejecting dispute + const fishermanBalanceBefore = await graphToken.balanceOf(fisherman.address) + + // Get indexer's provision before rejecting dispute + const provision = await staking.getProviderTokensAvailable(indexer.address, await subgraphService.getAddress()) + + // Reject dispute + await disputeManager.connect(arbitrator).rejectDispute(disputeId) + + // Verify dispute status + const updatedDispute = await disputeManager.disputes(disputeId) + expect(updatedDispute.status).to.equal(2, 'Dispute status should be rejected') + + // Verify indexer's provision was not affected + const updatedProvision = await staking.getProviderTokensAvailable(indexer.address, await subgraphService.getAddress()) + expect(updatedProvision).to.equal(provision, 'Indexer stake should not be affected') + + // Verify fisherman did not receive the deposit + const fishermanBalance = await graphToken.balanceOf(fisherman.address) + expect(fishermanBalance).to.equal(fishermanBalanceBefore, 'Fisherman balance should not receive the deposit back') + }) + + it('should not allow non-arbitrator to accept a query dispute', async () => { + // Get indexer stake snapshot + const dispute = await disputeManager.disputes(disputeId) + const tokensToSlash = dispute.stakeSnapshot / 10n + + // Attempt to accept dispute as fisherman + await expect( + disputeManager.connect(fisherman).acceptDispute(disputeId, tokensToSlash), + ).to.be.revertedWithCustomError(disputeManager, 'DisputeManagerNotArbitrator') + }) + + it('should not allow non-arbitrator to draw a query dispute', async () => { + // Attempt to draw dispute as fisherman + await expect( + disputeManager.connect(fisherman).drawDispute(disputeId), + ).to.be.revertedWithCustomError(disputeManager, 'DisputeManagerNotArbitrator') + }) + + it('should not allow non-arbitrator to reject a query dispute', async () => { + // Attempt to reject dispute as fisherman + await expect( + disputeManager.connect(fisherman).rejectDispute(disputeId), + ).to.be.revertedWithCustomError(disputeManager, 'DisputeManagerNotArbitrator') + }) + }) +}) diff --git a/packages/subgraph-service/test/integration/after-transition-period/pause.test.ts b/packages/subgraph-service/test/integration/after-transition-period/pause.test.ts new file mode 100644 index 000000000..467bbe4f9 --- /dev/null +++ b/packages/subgraph-service/test/integration/after-transition-period/pause.test.ts @@ -0,0 +1,43 @@ +import hre from 'hardhat' + +import { ethers } from 'hardhat' +import { expect } from 'chai' + +import type { HardhatEthersSigner } from '@nomicfoundation/hardhat-ethers/signers' + +describe('Pausing', () => { + let snapshotId: string + + // Test addresses + let pauseGuardian: HardhatEthersSigner + let governor: HardhatEthersSigner + const graph = hre.graph() + const subgraphService = graph.subgraphService.contracts.SubgraphService + + before(async () => { + pauseGuardian = await graph.accounts.getPauseGuardian() + governor = await graph.accounts.getGovernor() + }) + + beforeEach(async () => { + // Take a snapshot before each test + snapshotId = await ethers.provider.send('evm_snapshot', []) + }) + + afterEach(async () => { + // Revert to the snapshot after each test + await ethers.provider.send('evm_revert', [snapshotId]) + }) + + describe('SubgraphService', () => { + it('should be pausable by pause guardian', async () => { + await subgraphService.connect(pauseGuardian).pause() + expect(await subgraphService.paused()).to.equal(true) + }) + + it('should be pausable by governor', async () => { + await subgraphService.connect(governor).pause() + expect(await subgraphService.paused()).to.equal(true) + }) + }) +}) diff --git a/packages/subgraph-service/test/integration/after-transition-period/subgraph-service/governance.test.ts b/packages/subgraph-service/test/integration/after-transition-period/subgraph-service/governance.test.ts new file mode 100644 index 000000000..8e67dcd5f --- /dev/null +++ b/packages/subgraph-service/test/integration/after-transition-period/subgraph-service/governance.test.ts @@ -0,0 +1,168 @@ +import { ethers } from 'hardhat' +import { expect } from 'chai' +import hre from 'hardhat' + +import { HardhatEthersSigner } from '@nomicfoundation/hardhat-ethers/signers' +import { SubgraphService } from '../../../../typechain-types' + +describe('Subgraph Service Governance', () => { + let subgraphService: SubgraphService + let snapshotId: string + + // Test addresses + let governor: HardhatEthersSigner + let nonOwner: HardhatEthersSigner + let pauseGuardian: HardhatEthersSigner + + before(async () => { + const graph = hre.graph() + subgraphService = graph.subgraphService.contracts.SubgraphService + + // Get signers + governor = await graph.accounts.getGovernor() + ;[nonOwner, pauseGuardian] = await graph.accounts.getTestAccounts() + + // Set eth balance for non-owner and pause guardian + await ethers.provider.send('hardhat_setBalance', [nonOwner.address, '0x56BC75E2D63100000']) + await ethers.provider.send('hardhat_setBalance', [pauseGuardian.address, '0x56BC75E2D63100000']) + }) + + beforeEach(async () => { + // Take a snapshot before each test + snapshotId = await ethers.provider.send('evm_snapshot', []) + }) + + afterEach(async () => { + // Revert to the snapshot after each test + await ethers.provider.send('evm_revert', [snapshotId]) + }) + + describe('Minimum Provision Tokens', () => { + it('should set minimum provision tokens', async () => { + const newMinimumProvisionTokens = ethers.parseEther('1000') + await subgraphService.connect(governor).setMinimumProvisionTokens(newMinimumProvisionTokens) + + // Get the provision tokens range + const [minTokens, maxTokens] = await subgraphService.getProvisionTokensRange() + expect(minTokens).to.equal(newMinimumProvisionTokens, 'Minimum provision tokens should be set') + expect(maxTokens).to.equal(ethers.MaxUint256, 'Maximum provision tokens should be set') + }) + + it('should not allow non-owner to set minimum provision tokens', async () => { + const newMinimumProvisionTokens = ethers.parseEther('1000') + await expect( + subgraphService.connect(nonOwner).setMinimumProvisionTokens(newMinimumProvisionTokens), + 'Non-owner should not be able to set minimum provision tokens', + ).to.be.revertedWithCustomError(subgraphService, 'OwnableUnauthorizedAccount') + }) + }) + + describe('Pause Guardian', () => { + it('should set pause guardian and allow them to pause the service', async () => { + // Set pause guardian + await subgraphService.connect(governor).setPauseGuardian(pauseGuardian.address, true) + + // Pause guardian should be able to pause the service + await subgraphService.connect(pauseGuardian).pause() + expect(await subgraphService.paused(), 'Pause guardian should be able to pause the service').to.be.true + }) + + it('should remove pause guardian and prevent them from pausing the service', async () => { + // First set pause guardian + await subgraphService.connect(governor).setPauseGuardian(pauseGuardian.address, true) + + // Check that pause guardian can pause the service + await subgraphService.connect(pauseGuardian).pause() + expect(await subgraphService.paused(), 'Pause guardian should be able to pause the service').to.be.true + + // Then remove pause guardian + await subgraphService.connect(governor).setPauseGuardian(pauseGuardian.address, false) + + // Pause guardian should no longer be able to unpause the service + await expect( + subgraphService.connect(pauseGuardian).unpause(), + 'Pause guardian should no longer be able to unpause the service', + ).to.be.revertedWithCustomError(subgraphService, 'DataServicePausableNotPauseGuardian') + }) + + it('should not allow non-owner to set pause guardian', async () => { + await expect( + subgraphService.connect(nonOwner).setPauseGuardian(pauseGuardian.address, true), + 'Non-owner should not be able to set pause guardian', + ).to.be.revertedWithCustomError(subgraphService, 'OwnableUnauthorizedAccount') + }) + }) + + describe('Delegation Ratio', () => { + it('should set delegation ratio', async () => { + const newDelegationRatio = 5 + await subgraphService.connect(governor).setDelegationRatio(newDelegationRatio) + expect(await subgraphService.getDelegationRatio(), 'Delegation ratio should be set').to.equal(newDelegationRatio) + }) + + it('should not allow non-owner to set delegation ratio', async () => { + const newDelegationRatio = 5 + await expect( + subgraphService.connect(nonOwner).setDelegationRatio(newDelegationRatio), + 'Non-owner should not be able to set delegation ratio', + ).to.be.revertedWithCustomError(subgraphService, 'OwnableUnauthorizedAccount') + }) + }) + + describe('Stake to Fees Ratio', () => { + it('should set stake to fees ratio', async () => { + const newStakeToFeesRatio = ethers.parseEther('1') + await subgraphService.connect(governor).setStakeToFeesRatio(newStakeToFeesRatio) + + // Get the stake to fees ratio by calling a function that uses it + const stakeToFeesRatio = await subgraphService.stakeToFeesRatio() + expect(stakeToFeesRatio).to.equal(newStakeToFeesRatio, 'Stake to fees ratio should be set') + }) + + it('should not allow non-owner to set stake to fees ratio', async () => { + const newStakeToFeesRatio = ethers.parseEther('1') + await expect( + subgraphService.connect(nonOwner).setStakeToFeesRatio(newStakeToFeesRatio), + 'Non-owner should not be able to set stake to fees ratio', + ).to.be.revertedWithCustomError(subgraphService, 'OwnableUnauthorizedAccount') + }) + }) + + describe('Max POI Staleness', () => { + it('should set max POI staleness', async () => { + const newMaxPOIStaleness = 3600 // 1 hour in seconds + await subgraphService.connect(governor).setMaxPOIStaleness(newMaxPOIStaleness) + + // Get the max POI staleness + const maxPOIStaleness = await subgraphService.maxPOIStaleness() + expect(maxPOIStaleness).to.equal(newMaxPOIStaleness, 'Max POI staleness should be set') + }) + + it('should not allow non-owner to set max POI staleness', async () => { + const newMaxPOIStaleness = 3600 + await expect( + subgraphService.connect(nonOwner).setMaxPOIStaleness(newMaxPOIStaleness), + 'Non-owner should not be able to set max POI staleness', + ).to.be.revertedWithCustomError(subgraphService, 'OwnableUnauthorizedAccount') + }) + }) + + describe('Curation Cut', () => { + it('should set curation cut', async () => { + const newCurationCut = 100000 // 10% in PPM + await subgraphService.connect(governor).setCurationCut(newCurationCut) + + // Get the curation cut + const curationCut = await subgraphService.curationFeesCut() + expect(curationCut).to.equal(newCurationCut, 'Curation cut should be set') + }) + + it('should not allow non-owner to set curation cut', async () => { + const newCurationCut = 100000 + await expect( + subgraphService.connect(nonOwner).setCurationCut(newCurationCut), + 'Non-owner should not be able to set curation cut', + ).to.be.revertedWithCustomError(subgraphService, 'OwnableUnauthorizedAccount') + }) + }) +}) diff --git a/packages/subgraph-service/test/integration/after-transition-period/subgraph-service/indexer.test.ts b/packages/subgraph-service/test/integration/after-transition-period/subgraph-service/indexer.test.ts new file mode 100644 index 000000000..ef6865787 --- /dev/null +++ b/packages/subgraph-service/test/integration/after-transition-period/subgraph-service/indexer.test.ts @@ -0,0 +1,697 @@ +import { ethers } from 'hardhat' +import { expect } from 'chai' +import { HDNodeWallet } from 'ethers' +import hre from 'hardhat' + +import { encodeCollectIndexingRewardsData, encodeCollectQueryFeesData, encodePOIMetadata, encodeStartServiceData, generateAllocationProof, generatePOI, generateSignedRAV, generateSignerProof, PaymentTypes } from '@graphprotocol/toolshed' +import { GraphPayments, GraphTallyCollector, HorizonStaking } from '@graphprotocol/horizon' +import { IGraphToken, IPaymentsEscrow, SubgraphService } from '../../../../typechain-types' +import { HardhatEthersSigner } from '@nomicfoundation/hardhat-ethers/signers' +import { setGRTBalance } from '@graphprotocol/toolshed/hardhat' + +import { Indexer, indexers } from '../../../../tasks/test/fixtures/indexers' +import { delegators } from '@graphprotocol/horizon/tasks/test/fixtures/delegators' + +describe('Indexer', () => { + let escrow: IPaymentsEscrow + let graphPayments: GraphPayments + let graphTallyCollector: GraphTallyCollector + let graphToken: IGraphToken + let staking: HorizonStaking + let subgraphService: SubgraphService + + let snapshotId: string + let chainId: number + + // Test addresses + let indexer: HardhatEthersSigner + let graphTallyCollectorAddress: string + let subgraphServiceAddress: string + + const graph = hre.graph() + const { collect } = graph.subgraphService.actions + + before(async () => { + // Get contracts + escrow = graph.horizon.contracts.PaymentsEscrow + graphPayments = graph.horizon.contracts.GraphPayments + graphTallyCollector = graph.horizon.contracts.GraphTallyCollector + graphToken = graph.horizon.contracts.GraphToken + staking = graph.horizon.contracts.HorizonStaking + subgraphService = graph.subgraphService.contracts.SubgraphService + + // Get contract addresses + graphTallyCollectorAddress = await graphTallyCollector.getAddress() + subgraphServiceAddress = await subgraphService.getAddress() + + // Get chain ID + chainId = Number((await ethers.provider.getNetwork()).chainId) + }) + + beforeEach(async () => { + // Take a snapshot before each test + snapshotId = await ethers.provider.send('evm_snapshot', []) + }) + + afterEach(async () => { + // Revert to the snapshot after each test + await ethers.provider.send('evm_revert', [snapshotId]) + }) + + describe('Indexer Registration', () => { + let indexerUrl: string + let indexerGeoHash: string + + beforeEach(async () => { + const indexerFixture = indexers[0] + indexer = await ethers.getSigner(indexerFixture.address) + indexerUrl = indexerFixture.url + indexerGeoHash = indexerFixture.geoHash + }) + + it('should register indexer with valid parameters', async () => { + // Verify indexer metadata + const indexerInfo = await subgraphService.indexers(indexer.address) + expect(indexerInfo.url).to.equal(indexerUrl) + expect(indexerInfo.geoHash).to.equal(indexerGeoHash) + }) + }) + + describe('Allocation Management', () => { + let allocationId: string + let allocationPrivateKey: string + let allocationTokens: bigint + let subgraphDeploymentId: string + let indexerFixture: Indexer + + before(async () => { + // Get indexer data + indexerFixture = indexers[0] + indexer = await ethers.getSigner(indexerFixture.address) + }) + + describe('New allocation', () => { + let provisionTokens: bigint + + before(() => { + // Generate new allocation ID and private key + const wallet = ethers.Wallet.createRandom() + allocationId = wallet.address + allocationPrivateKey = wallet.privateKey + allocationTokens = ethers.parseEther('1000') + subgraphDeploymentId = indexerFixture.allocations[0].subgraphDeploymentID + + // Get provision tokens + provisionTokens = indexerFixture.provisionTokens + }) + + it('should start an allocation with valid parameters', async () => { + // Get locked tokens before allocation + const beforeLockedTokens = await subgraphService.allocationProvisionTracker(indexer.address) + + // Build allocation proof + const signature = await generateAllocationProof(indexer.address, allocationPrivateKey, subgraphServiceAddress, chainId) + + // Attempt to create an allocation with the same ID + const data = encodeStartServiceData(subgraphDeploymentId, allocationTokens, allocationId, signature) + + // Start allocation + await subgraphService.connect(indexer).startService( + indexer.address, + data, + ) + + // Verify allocation + const allocation = await subgraphService.getAllocation(allocationId) + expect(allocation.indexer).to.equal(indexer.address, 'Allocation indexer is not the expected indexer') + expect(allocation.tokens).to.equal(allocationTokens, 'Allocation tokens are not the expected tokens') + expect(allocation.subgraphDeploymentId).to.equal(subgraphDeploymentId, 'Allocation subgraph deployment ID is not the expected subgraph deployment ID') + + // Verify tokens are locked + const afterLockedTokens = await subgraphService.allocationProvisionTracker(indexer.address) + expect(afterLockedTokens).to.equal(beforeLockedTokens + allocationTokens) + }) + + it('should be able to start an allocation with zero tokens', async () => { + // Build allocation proof + const signature = await generateAllocationProof(indexer.address, allocationPrivateKey, subgraphServiceAddress, chainId) + + // Attempt to create an allocation with the same ID + const data = encodeStartServiceData(subgraphDeploymentId, 0n, allocationId, signature) + + // Start allocation with zero tokens + await subgraphService.connect(indexer).startService( + indexer.address, + data, + ) + + // Verify allocation + const allocation = await subgraphService.getAllocation(allocationId) + expect(allocation.indexer).to.equal(indexer.address, 'Allocation indexer is not the expected indexer') + expect(allocation.tokens).to.equal(0, 'Allocation tokens are not zero') + expect(allocation.subgraphDeploymentId).to.equal(subgraphDeploymentId, 'Allocation subgraph deployment ID is not the expected subgraph deployment ID') + }) + + it('should not start an allocation without enough tokens', async () => { + // Build allocation proof + const signature = await generateAllocationProof(indexer.address, allocationPrivateKey, subgraphServiceAddress, chainId) + + // Build allocation data + const allocationTokens = provisionTokens + ethers.parseEther('10000000') + const data = encodeStartServiceData(subgraphDeploymentId, allocationTokens, allocationId, signature) + + // Attempt to open allocation with excessive tokens + await expect( + subgraphService.connect(indexer).startService( + indexer.address, + data, + ), + ).to.be.revertedWithCustomError( + subgraphService, + 'ProvisionTrackerInsufficientTokens', + ) + }) + }) + + describe('Existing allocation', () => { + beforeEach(() => { + // Get allocation data + const allocation = indexerFixture.allocations[0] + allocationId = allocation.allocationID + allocationTokens = allocation.tokens + subgraphDeploymentId = allocation.subgraphDeploymentID + }) + + describe('Resize allocation', () => { + it('should resize an open allocation increasing tokens', async () => { + // Get locked tokens before resize + const beforeLockedTokens = await subgraphService.allocationProvisionTracker(indexer.address) + + // Resize allocation + const increaseTokens = ethers.parseEther('5000') + const newAllocationTokens = allocationTokens + increaseTokens + await subgraphService.connect(indexer).resizeAllocation( + indexer.address, + allocationId, + newAllocationTokens, + ) + + // Verify allocation + const allocation = await subgraphService.getAllocation(allocationId) + expect(allocation.tokens).to.equal(newAllocationTokens, 'Allocation tokens were not resized') + + // Verify tokens are locked + const afterLockedTokens = await subgraphService.allocationProvisionTracker(indexer.address) + expect(afterLockedTokens).to.equal(beforeLockedTokens + increaseTokens) + }) + + it('should resize an open allocation decreasing tokens', async () => { + // Get locked tokens before resize + const beforeLockedTokens = await subgraphService.allocationProvisionTracker(indexer.address) + + // Resize allocation + const decreaseTokens = ethers.parseEther('5000') + const newAllocationTokens = allocationTokens - decreaseTokens + await subgraphService.connect(indexer).resizeAllocation( + indexer.address, + allocationId, + newAllocationTokens, + ) + + // Verify allocation + const allocation = await subgraphService.getAllocation(allocationId) + expect(allocation.tokens).to.equal(newAllocationTokens) + + // Verify tokens are released + const afterLockedTokens = await subgraphService.allocationProvisionTracker(indexer.address) + expect(afterLockedTokens).to.equal(beforeLockedTokens - decreaseTokens) + }) + }) + + describe('Close allocation', () => { + it('should be able to close an allocation', async () => { + // Get before locked tokens + const beforeLockedTokens = await subgraphService.allocationProvisionTracker(indexer.address) + + // Close allocation + const data = ethers.AbiCoder.defaultAbiCoder().encode( + ['address'], + [allocationId], + ) + await subgraphService.connect(indexer).stopService(indexer.address, data) + + // Verify allocation is closed + const allocation = await subgraphService.getAllocation(allocationId) + expect(allocation.closedAt).to.not.equal(0) + + // Verify tokens are released + const afterLockedTokens = await subgraphService.allocationProvisionTracker(indexer.address) + expect(afterLockedTokens).to.equal(beforeLockedTokens - allocationTokens) + }) + }) + }) + }) + + describe('Indexing Rewards', () => { + let allocationId: string + let indexingRewardCut: number + + describe('With delegation pool tokens greater than zero', () => { + describe('Re-provisioning', () => { + let otherAllocationId: string + + beforeEach(async () => { + // Get indexer + const indexerFixture = indexers[0] + indexer = await ethers.getSigner(indexerFixture.address) + indexingRewardCut = indexerFixture.indexingRewardCut + + // Get allocations + allocationId = indexerFixture.allocations[0].allocationID + otherAllocationId = indexerFixture.allocations[1].allocationID + + // Check rewards destination is not set + const paymentsDestination = await subgraphService.paymentsDestination(indexer.address) + expect(paymentsDestination).to.equal(ethers.ZeroAddress, 'Payments destination should be zero address') + }) + + it('should collect indexing rewards with re-provisioning', async () => { + // Get before provision and delegation pool tokens + const beforeProvisionTokens = (await staking.getProvision(indexer.address, subgraphService.target)).tokens + const beforeDelegationPoolTokens = (await staking.getDelegationPool(indexer.address, subgraphService.target)).tokens + + // Mine multiple blocks to simulate time passing + for (let i = 0; i < 1000; i++) { + await ethers.provider.send('evm_mine', []) + } + + // Build data for collect indexing rewards + const poi = generatePOI() + const poiMetadata = encodePOIMetadata( + 0, + poi, + 0, + 0, + 0, + ) + const data = encodeCollectIndexingRewardsData(allocationId, poi, poiMetadata) + // Collect rewards + const rewards = await collect(indexer, [indexer.address, PaymentTypes.IndexingRewards, data]) + expect(rewards).to.not.equal(0n, 'Rewards should be greater than zero') + + // Verify rewards are added to delegation pool + const delegationRewards = (rewards * BigInt(indexingRewardCut)) / BigInt(1e6) + const afterDelegationPoolTokens = (await staking.getDelegationPool(indexer.address, subgraphService.target)).tokens + expect(afterDelegationPoolTokens).to.equal(beforeDelegationPoolTokens + delegationRewards, 'Rewards should be added to delegation pool') + + // Verify rewards are added to provision + const indexerRewards = rewards - delegationRewards + const afterProvisionTokens = (await staking.getProvision(indexer.address, subgraphService.target)).tokens + expect(afterProvisionTokens).to.equal(beforeProvisionTokens + indexerRewards, 'Rewards should be added to provision') + }) + + it('should collect rewards continuously for multiple allocations', async () => { + // Get before provision and delegation pool tokens + const beforeProvisionTokens = (await staking.getProvision(indexer.address, subgraphService.target)).tokens + const beforeDelegationPoolTokens = (await staking.getDelegationPool(indexer.address, subgraphService.target)).tokens + + // Build data for collect indexing rewards + const poi = generatePOI() + const poiMetadata = encodePOIMetadata( + 0, + poi, + 0, + 0, + 0, + ) + const allocationData = encodeCollectIndexingRewardsData(allocationId, poi, poiMetadata) + const otherAllocationData = encodeCollectIndexingRewardsData(otherAllocationId, poi, poiMetadata) + + // Mine multiple blocks to simulate time passing + for (let i = 0; i < 1000; i++) { + await ethers.provider.send('evm_mine', []) + } + + // Collect rewards for first allocation + let rewards = await collect(indexer, [indexer.address, PaymentTypes.IndexingRewards, allocationData]) + expect(rewards).to.not.equal(0n, 'Rewards should be greater than zero') + + // Collect rewards for second allocation + let otherRewards = await collect(indexer, [indexer.address, PaymentTypes.IndexingRewards, otherAllocationData]) + expect(otherRewards).to.not.equal(0n, 'Rewards should be greater than zero') + + // Verify rewards are added to delegation pool + const delegationRewards = (rewards * BigInt(indexingRewardCut)) / BigInt(1e6) + (otherRewards * BigInt(indexingRewardCut)) / BigInt(1e6) + const afterDelegationPoolTokens = (await staking.getDelegationPool(indexer.address, subgraphService.target)).tokens + expect(afterDelegationPoolTokens).to.equal(beforeDelegationPoolTokens + delegationRewards, 'Rewards should be continuously added to delegation pool') + + // Verify rewards collected + const indexerRewards = rewards + otherRewards - delegationRewards + const afterFirstCollectionProvisionTokens = (await staking.getProvision(indexer.address, subgraphService.target)).tokens + expect(afterFirstCollectionProvisionTokens).to.equal(beforeProvisionTokens + indexerRewards, 'Rewards should be continuously added to provision') + + // Mine multiple blocks to simulate time passing + for (let i = 0; i < 500; i++) { + await ethers.provider.send('evm_mine', []) + } + + // Collect rewards for first allocation + rewards = await collect(indexer, [indexer.address, PaymentTypes.IndexingRewards, allocationData]) + expect(rewards).to.not.equal(0n, 'Rewards should be greater than zero') + + // Collect rewards for second allocation + otherRewards = await collect(indexer, [indexer.address, PaymentTypes.IndexingRewards, otherAllocationData]) + expect(otherRewards).to.not.equal(0n, 'Rewards should be greater than zero') + + // Verify rewards are added to delegation pool + const secondCollectionDelegationRewards = (rewards * BigInt(indexingRewardCut)) / BigInt(1e6) + (otherRewards * BigInt(indexingRewardCut)) / BigInt(1e6) + const afterSecondCollectionDelegationPoolTokens = (await staking.getDelegationPool(indexer.address, subgraphService.target)).tokens + expect(afterSecondCollectionDelegationPoolTokens).to.equal(afterDelegationPoolTokens + secondCollectionDelegationRewards, 'Rewards should be continuously added to delegation pool') + + // Verify total rewards collected + const secondCollectionIndexerRewards = rewards + otherRewards - secondCollectionDelegationRewards + const afterSecondCollectionProvisionTokens = (await staking.getProvision(indexer.address, subgraphService.target)).tokens + expect(afterSecondCollectionProvisionTokens).to.equal(afterFirstCollectionProvisionTokens + secondCollectionIndexerRewards, 'Rewards should be collected continuously') + }) + + it('should not collect rewards after POI staleness', async () => { + // Get before provision tokens + const beforeProvisionTokens = (await staking.getProvision(indexer.address, subgraphService.target)).tokens + + // Wait for POI staleness + const maxPOIStaleness = await subgraphService.maxPOIStaleness() + await ethers.provider.send('evm_increaseTime', [Number(maxPOIStaleness) + 1]) + await ethers.provider.send('evm_mine', []) + + // Build data for collect indexing rewards + const poi = generatePOI() + const poiMetadata = encodePOIMetadata( + 0, + poi, + 0, + 0, + 0, + ) + const data = encodeCollectIndexingRewardsData(allocationId, poi, poiMetadata) + + // Attempt to collect rewards + await subgraphService.connect(indexer).collect( + indexer.address, + PaymentTypes.IndexingRewards, + data, + ) + + // Verify no rewards were collected + const afterProvisionTokens = (await staking.getProvision(indexer.address, subgraphService.target)).tokens + expect(afterProvisionTokens).to.equal(beforeProvisionTokens, 'Rewards should not be collected after POI staleness') + }) + + describe('Over allocated', () => { + let subgraphDeploymentId: string + let delegator: HardhatEthersSigner + let allocationPrivateKey: string + beforeEach(async () => { + // Get delegator + delegator = await ethers.getSigner(delegators[0].address) + + // Get locked tokens + const lockedTokens = await subgraphService.allocationProvisionTracker(indexer.address) + + // Get delegation ratio + const delegationRatio = await subgraphService.getDelegationRatio() + const availableTokens = await staking.getTokensAvailable(indexer.address, subgraphService.target, delegationRatio) + + // Create allocation with tokens available + const wallet = ethers.Wallet.createRandom() + allocationId = wallet.address + allocationPrivateKey = wallet.privateKey + subgraphDeploymentId = indexers[0].allocations[0].subgraphDeploymentID + const allocationTokens = availableTokens - lockedTokens + const signature = await generateAllocationProof(indexer.address, allocationPrivateKey, subgraphServiceAddress, chainId) + const data = encodeStartServiceData(subgraphDeploymentId, allocationTokens, allocationId, signature) + await subgraphService.connect(indexer).startService( + indexer.address, + data, + ) + + // Undelegate from indexer so they become over allocated + const delegation = await staking.getDelegation( + indexer.address, + subgraphService.target, + delegator.address, + ) + + // Undelegate tokens + await staking.connect(delegator)['undelegate(address,address,uint256)'](indexer.address, subgraphServiceAddress, delegation.shares) + }) + + it('should collect rewards while over allocated with fresh POI', async () => { + // Get before provision tokens + const beforeProvisionTokens = (await staking.getProvision(indexer.address, subgraphService.target)).tokens + + // Mine multiple blocks to simulate time passing + for (let i = 0; i < 1000; i++) { + await ethers.provider.send('evm_mine', []) + } + + // Build data for collect indexing rewards + const poi = generatePOI() + const poiMetadata = encodePOIMetadata( + 0, + poi, + 0, + 0, + 0, + ) + const data = encodeCollectIndexingRewardsData(allocationId, poi, poiMetadata) + + // Collect rewards + const rewards = await collect(indexer, [indexer.address, PaymentTypes.IndexingRewards, data]) + expect(rewards).to.not.equal(0n, 'Rewards should be greater than zero') + + // Verify rewards are added to provision + const afterProvisionTokens = (await staking.getProvision(indexer.address, subgraphService.target)).tokens + expect(afterProvisionTokens).to.equal(beforeProvisionTokens + rewards, 'Rewards should be collected') + + // Verify allocation was closed + const allocation = await subgraphService.getAllocation(allocationId) + expect(allocation.closedAt).to.not.equal(0) + }) + }) + }) + }) + + describe('With delegation pool tokens equal to zero', () => { + describe('With rewards destination', () => { + let paymentsDestination: string + + beforeEach(async () => { + // Get indexer + const indexerFixture = indexers[1] + indexer = await ethers.getSigner(indexerFixture.address) + indexingRewardCut = indexerFixture.indexingRewardCut + + // Get allocation + const allocation = indexerFixture.allocations[0] + allocationId = allocation.allocationID + + // Check rewards destination is set + paymentsDestination = await subgraphService.paymentsDestination(indexer.address) + expect(paymentsDestination).not.equal(ethers.ZeroAddress, 'Payments destination should be set') + }) + + it('should collect indexing rewards with rewards destination', async () => { + // Get before balance of rewards destination + const beforePaymentsDestinationBalance = await graphToken.balanceOf(paymentsDestination) + + // Mine multiple blocks to simulate time passing + for (let i = 0; i < 500; i++) { + await ethers.provider.send('evm_mine', []) + } + + // Build data for collect indexing rewards + const poi = generatePOI() + const poiMetadata = encodePOIMetadata( + 0, + poi, + 0, + 0, + 0, + ) + const data = encodeCollectIndexingRewardsData(allocationId, poi, poiMetadata) + + // Collect rewards + const rewards = await collect(indexer, [indexer.address, PaymentTypes.IndexingRewards, data]) + expect(rewards).to.not.equal(0n, 'Rewards should be greater than zero') + + // Verify rewards are transferred to payments destination + const afterPaymentsDestinationBalance = await graphToken.balanceOf(paymentsDestination) + expect(afterPaymentsDestinationBalance).to.equal(beforePaymentsDestinationBalance + rewards, 'Rewards should be transferred to payments destination') + }) + }) + }) + }) + + describe('Query Fees', () => { + let payer: HDNodeWallet + let signer: HDNodeWallet + let allocationId: string + let otherAllocationId: string + let collectTokens: bigint + let queryFeeCut: number + + before(async () => { + // Get payer + payer = ethers.Wallet.createRandom() + payer = payer.connect(ethers.provider) + + // Get signer + signer = ethers.Wallet.createRandom() + + // Mint GRT to payer and fund payer and signer with ETH + await setGRTBalance(graph.provider, graphToken.target, payer.address, ethers.parseEther('1000000')) + await ethers.provider.send('hardhat_setBalance', [payer.address, '0x56BC75E2D63100000']) + await ethers.provider.send('hardhat_setBalance', [signer.address, '0x56BC75E2D63100000']) + + // Authorize payer as signer + // Block timestamp plus 1 year + const proofDeadline = (await ethers.provider.getBlock('latest'))!.timestamp + 31536000 + const signerProof = generateSignerProof(BigInt(proofDeadline), payer.address, signer.privateKey, graphTallyCollectorAddress, chainId) + await graphTallyCollector.connect(payer).authorizeSigner(signer.address, proofDeadline, signerProof) + + // Get indexer + const indexerFixture = indexers[0] + indexer = await ethers.getSigner(indexerFixture.address) + queryFeeCut = indexerFixture.queryFeeCut + // Get allocation + allocationId = indexerFixture.allocations[0].allocationID + otherAllocationId = indexerFixture.allocations[1].allocationID + // Get collect tokens + collectTokens = ethers.parseUnits('1000') + }) + + beforeEach(async () => { + // Deposit tokens in escrow + await graphToken.connect(payer).approve(escrow.target, collectTokens) + await escrow.connect(payer).deposit(graphTallyCollector.target, indexer.address, collectTokens) + }) + + it('should collect query fees with SignedRAV', async () => { + const { rav, signature } = await generateSignedRAV( + allocationId, + payer.address, + indexer.address, + subgraphServiceAddress, + 0, + collectTokens, + ethers.toUtf8Bytes(''), + signer.privateKey, + graphTallyCollectorAddress, + chainId, + ) + const encodedSignedRAV = encodeCollectQueryFeesData(rav, signature, 0n) + + // Get balance and delegation pool tokens before collect + const beforeIndexerStake = await staking.getStake(indexer.address) + const beforeDelegationPoolTokens = (await staking.getDelegationPool(indexer.address, subgraphService.target)).tokens + + // Collect query fees + await collect(indexer, [indexer.address, PaymentTypes.QueryFee, encodedSignedRAV]) + + // Calculate expected rewards + const rewardsAfterTax = collectTokens - (collectTokens * BigInt(await graphPayments.PROTOCOL_PAYMENT_CUT())) / BigInt(1e6) + const rewardsAfterCuration = rewardsAfterTax - (rewardsAfterTax * BigInt(await subgraphService.curationFeesCut())) / BigInt(1e6) + + // Verify tokens where added to delegation pool + const delegatorTokens = (rewardsAfterCuration * BigInt(queryFeeCut)) / BigInt(1e6) + const afterDelegationPoolTokens = (await staking.getDelegationPool(indexer.address, subgraphService.target)).tokens + expect(afterDelegationPoolTokens).to.equal(beforeDelegationPoolTokens + delegatorTokens) + + // Verify indexer received tokens were automatically restaked + const indexerTokens = rewardsAfterCuration - delegatorTokens + const afterIndexerStake = await staking.getStake(indexer.address) + expect(afterIndexerStake).to.equal(beforeIndexerStake + indexerTokens) + }) + + it('should collect multiple SignedRAVs', async () => { + // Get balance and delegation pool tokens before collect + const beforeDelegationPoolTokens = (await staking.getDelegationPool(indexer.address, subgraphService.target)).tokens + const beforeIndexerStake = await staking.getStake(indexer.address) + // Get fees + const fees1 = collectTokens / 4n + const fees2 = collectTokens / 2n + + // Get encoded SignedRAVs + const { rav: rav1, signature: signature1 } = await generateSignedRAV( + allocationId, + payer.address, + indexer.address, + subgraphServiceAddress, + 0, + fees1, + ethers.toUtf8Bytes(''), + signer.privateKey, + graphTallyCollectorAddress, + chainId, + ) + const encodedSignedRAV1 = encodeCollectQueryFeesData(rav1, signature1, 0n) + + const { rav: rav2, signature: signature2 } = await generateSignedRAV( + otherAllocationId, + payer.address, + indexer.address, + subgraphServiceAddress, + 0, + fees2, + ethers.toUtf8Bytes(''), + signer.privateKey, + graphTallyCollectorAddress, + chainId, + ) + const encodedSignedRAV2 = encodeCollectQueryFeesData(rav2, signature2, 0n) + + // Collect first set of fees + const rewards1 = await collect(indexer, [indexer.address, PaymentTypes.QueryFee, encodedSignedRAV1]) + + // Collect second set of fees + const rewards2 = await collect(indexer, [indexer.address, PaymentTypes.QueryFee, encodedSignedRAV2]) + + // Verify total rewards collected + const totalRewards = rewards1 + rewards2 + const totalRewardsAfterTax = totalRewards - (totalRewards * BigInt(await graphPayments.PROTOCOL_PAYMENT_CUT())) / BigInt(1e6) + const totalRewardsAfterCuration = totalRewardsAfterTax - (totalRewardsAfterTax * BigInt(await subgraphService.curationFeesCut())) / BigInt(1e6) + + // Verify tokens where added to delegation pool + const delegatorTokens = (totalRewardsAfterCuration * BigInt(queryFeeCut)) / BigInt(1e6) + const afterDelegationPoolTokens = (await staking.getDelegationPool(indexer.address, subgraphService.target)).tokens + expect(afterDelegationPoolTokens).to.equal(beforeDelegationPoolTokens + delegatorTokens) + + // Verify indexer received tokens + const indexerTokens = totalRewardsAfterCuration - delegatorTokens + const afterIndexerStake = await staking.getStake(indexer.address) + expect(afterIndexerStake).to.equal(beforeIndexerStake + indexerTokens) + + // Collect new RAV for allocation 1 + const newFees1 = fees1 * 2n + const { rav: newRav1, signature: newSignature1 } = await generateSignedRAV( + allocationId, + payer.address, + indexer.address, + subgraphServiceAddress, + 0, + newFees1, + ethers.toUtf8Bytes(''), + signer.privateKey, + graphTallyCollectorAddress, + chainId, + ) + const encodedNewRAV1 = encodeCollectQueryFeesData(newRav1, newSignature1, 0n) + + // Collect new RAV for allocation 1 + const newRewards1 = await collect(indexer, [indexer.address, PaymentTypes.QueryFee, encodedNewRAV1]) + + // Verify only the difference was collected + expect(newRewards1).to.equal(newFees1 - fees1) + }) + }) +}) diff --git a/packages/subgraph-service/test/integration/after-transition-period/subgraph-service/operator.test.ts b/packages/subgraph-service/test/integration/after-transition-period/subgraph-service/operator.test.ts new file mode 100644 index 000000000..ff13ad3be --- /dev/null +++ b/packages/subgraph-service/test/integration/after-transition-period/subgraph-service/operator.test.ts @@ -0,0 +1,398 @@ +import { ethers } from 'hardhat' +import { expect } from 'chai' +import hre from 'hardhat' + +import { DisputeManager, IGraphToken, IPaymentsEscrow, SubgraphService } from '../../../../typechain-types' +import { encodeCollectIndexingRewardsData, encodeCollectQueryFeesData, encodePOIMetadata, encodeRegistrationData, encodeStartServiceData, generateAllocationProof, generatePOI, generateSignedRAV, generateSignerProof } from '@graphprotocol/toolshed' +import { GraphTallyCollector, HorizonStaking } from '@graphprotocol/horizon' +import { HardhatEthersSigner } from '@nomicfoundation/hardhat-ethers/signers' +import { PaymentTypes } from '@graphprotocol/toolshed' +import { setGRTBalance } from '@graphprotocol/toolshed/hardhat' + +import { indexers } from '../../../../tasks/test/fixtures/indexers' + +describe('Operator', () => { + let subgraphService: SubgraphService + let staking: HorizonStaking + let graphToken: IGraphToken + let escrow: IPaymentsEscrow + let disputeManager: DisputeManager + let graphTallyCollector: GraphTallyCollector + + let snapshotId: string + let chainId: number + + // Test addresses + let indexer: HardhatEthersSigner + let authorizedOperator: HardhatEthersSigner + let unauthorizedOperator: HardhatEthersSigner + let allocationId: string + let subgraphDeploymentId: string + let allocationTokens: bigint + let graphTallyCollectorAddress: string + let subgraphServiceAddress: string + const graph = hre.graph() + const { provision } = graph.horizon.actions + const { collect } = graph.subgraphService.actions + + before(async () => { + // Get contracts + subgraphService = graph.subgraphService.contracts.SubgraphService + staking = graph.horizon.contracts.HorizonStaking + graphToken = graph.horizon.contracts.GraphToken + escrow = graph.horizon.contracts.PaymentsEscrow + graphTallyCollector = graph.horizon.contracts.GraphTallyCollector + disputeManager = graph.subgraphService.contracts.DisputeManager + + // Get contract addresses + graphTallyCollectorAddress = await graphTallyCollector.getAddress() + subgraphServiceAddress = await subgraphService.getAddress() + + // Get chain ID + chainId = Number((await ethers.provider.getNetwork()).chainId) + }) + + beforeEach(async () => { + // Take a snapshot before each test + snapshotId = await ethers.provider.send('evm_snapshot', []) + }) + + afterEach(async () => { + // Revert to the snapshot after each test + await ethers.provider.send('evm_revert', [snapshotId]) + }) + + describe('New indexer', () => { + beforeEach(async () => { + // Get indexer + [indexer, authorizedOperator, unauthorizedOperator] = await graph.accounts.getTestAccounts() + + // Set balances for operators + await ethers.provider.send('hardhat_setBalance', [authorizedOperator.address, '0x56BC75E2D63100000']) + await ethers.provider.send('hardhat_setBalance', [unauthorizedOperator.address, '0x56BC75E2D63100000']) + + // Create provision + const disputePeriod = await disputeManager.getDisputePeriod() + const maxSlashingCut = await disputeManager.maxSlashingCut() + await setGRTBalance(graph.provider, graphToken.target, indexer.address, ethers.parseEther('100000')) + await provision(indexer, [indexer.address, subgraphServiceAddress, ethers.parseEther('100000'), maxSlashingCut, disputePeriod]) + }) + + describe('Authorized Operator', () => { + beforeEach(async () => { + // Authorize operator + await staking.connect(indexer).setOperator(subgraphServiceAddress, authorizedOperator.address, true) + }) + + it('should be able to register the indexer', async () => { + const indexerUrl = 'https://test-indexer.com' + const indexerGeoHash = 'test-geo-hash' + const indexerRegistrationData = encodeRegistrationData(indexerUrl, indexerGeoHash, ethers.ZeroAddress) + + await subgraphService.connect(authorizedOperator).register(indexer.address, indexerRegistrationData) + + // Verify indexer metadata + const indexerInfo = await subgraphService.indexers(indexer.address) + expect(indexerInfo.url).to.equal(indexerUrl) + expect(indexerInfo.geoHash).to.equal(indexerGeoHash) + }) + }) + + describe('Unauthorized Operator', () => { + it('should not be able to register the indexer', async () => { + const indexerUrl = 'https://test-indexer.com' + const indexerGeoHash = 'test-geo-hash' + const indexerRegistrationData = encodeRegistrationData(indexerUrl, indexerGeoHash, ethers.ZeroAddress) + + await expect( + subgraphService.connect(unauthorizedOperator).register(indexer.address, indexerRegistrationData), + ).to.be.revertedWithCustomError( + subgraphService, + 'ProvisionManagerNotAuthorized', + ) + }) + }) + }) + + describe('Existing indexer', () => { + beforeEach(async () => { + // Get indexer + const indexerFixture = indexers[0] + indexer = await ethers.getSigner(indexerFixture.address) + + ;[authorizedOperator, unauthorizedOperator] = await graph.accounts.getTestAccounts() + }) + + describe('New allocation', () => { + let allocationPrivateKey: string + + beforeEach(() => { + // Generate test allocation + const wallet = ethers.Wallet.createRandom() + allocationId = wallet.address + allocationPrivateKey = wallet.privateKey + subgraphDeploymentId = ethers.keccak256(ethers.toUtf8Bytes('test-subgraph-deployment')) + allocationTokens = ethers.parseEther('10000') + }) + + describe('Authorized Operator', () => { + beforeEach(async () => { + // Authorize operator + await staking.connect(indexer).setOperator(subgraphServiceAddress, authorizedOperator.address, true) + }) + + it('should be able to create an allocation', async () => { + // Build allocation proof + const signature = await generateAllocationProof(indexer.address, allocationPrivateKey, subgraphServiceAddress, chainId) + + // Build allocation data + const data = encodeStartServiceData(subgraphDeploymentId, allocationTokens, allocationId, signature) + // Start allocation + await subgraphService.connect(authorizedOperator).startService( + indexer.address, + data, + ) + + // Verify allocation + const allocation = await subgraphService.getAllocation(allocationId) + expect(allocation.indexer).to.equal(indexer.address) + expect(allocation.tokens).to.equal(allocationTokens) + expect(allocation.subgraphDeploymentId).to.equal(subgraphDeploymentId) + }) + }) + + describe('Unauthorized Operator', () => { + it('should not be able to create an allocation', async () => { + // Build allocation proof + const signature = await generateAllocationProof(indexer.address, allocationPrivateKey, subgraphServiceAddress, chainId) + + // Build allocation data + const data = encodeStartServiceData(subgraphDeploymentId, allocationTokens, allocationId, signature) + + await expect( + subgraphService.connect(unauthorizedOperator).startService( + indexer.address, + data, + ), + ).to.be.revertedWithCustomError( + subgraphService, + 'ProvisionManagerNotAuthorized', + ) + }) + }) + }) + + describe('Open allocation', () => { + beforeEach(() => { + // Get allocation data + const allocationFixture = indexers[0].allocations[0] + allocationId = allocationFixture.allocationID + subgraphDeploymentId = allocationFixture.subgraphDeploymentID + allocationTokens = allocationFixture.tokens + }) + + describe('Authorized Operator', () => { + beforeEach(async () => { + // Authorize operator + await staking.connect(indexer).setOperator(subgraphServiceAddress, authorizedOperator.address, true) + }) + + it('should be able to resize an allocation', async () => { + // Resize allocation + const newAllocationTokens = allocationTokens + ethers.parseEther('5000') + await subgraphService.connect(authorizedOperator).resizeAllocation( + indexer.address, + allocationId, + newAllocationTokens, + ) + + // Verify allocation + const allocation = await subgraphService.getAllocation(allocationId) + expect(allocation.tokens).to.equal(newAllocationTokens) + }) + + it('should be able to close an allocation', async () => { + // Close allocation + const data = ethers.AbiCoder.defaultAbiCoder().encode( + ['address'], + [allocationId], + ) + await subgraphService.connect(authorizedOperator).stopService( + indexer.address, + data, + ) + + // Verify allocation is closed + const allocation = await subgraphService.getAllocation(allocationId) + expect(allocation.closedAt).to.not.equal(0) + }) + + it('should be able to collect indexing rewards', async () => { + // Mine multiple blocks to simulate time passing + for (let i = 0; i < 1000; i++) { + await ethers.provider.send('evm_mine', []) + } + + // Build data for collect indexing rewards + const poi = generatePOI() + const publicPOI = generatePOI('public poi') + const poiMetadata = encodePOIMetadata( + 0, + publicPOI, + 0, + 0, + 0, + ) + const collectData = encodeCollectIndexingRewardsData(allocationId, poi, poiMetadata) + + // Collect rewards + const rewards = await collect(authorizedOperator, [indexer.address, PaymentTypes.IndexingRewards, collectData]) + expect(rewards).to.not.equal(0n) + }) + + it('should be able to collect query fees', async () => { + // Setup query fees collection + let payer = ethers.Wallet.createRandom() + payer = payer.connect(ethers.provider) + let signer = ethers.Wallet.createRandom() + signer = signer.connect(ethers.provider) + const collectTokens = ethers.parseUnits('1000') + + // Mint GRT to payer and fund payer and signer with ETH + await setGRTBalance(graph.provider, graphToken.target, payer.address, ethers.parseEther('1000000')) + await ethers.provider.send('hardhat_setBalance', [payer.address, '0x56BC75E2D63100000']) + await ethers.provider.send('hardhat_setBalance', [signer.address, '0x56BC75E2D63100000']) + + // Authorize payer as signer + const proofDeadline = (await ethers.provider.getBlock('latest'))!.timestamp + 31536000 + const signerProof = generateSignerProof(BigInt(proofDeadline), payer.address, signer.privateKey, graphTallyCollectorAddress, chainId) + await graphTallyCollector.connect(payer).authorizeSigner(signer.address, proofDeadline, signerProof) + + // Deposit tokens in escrow + await graphToken.connect(payer).approve(escrow.target, collectTokens) + await escrow.connect(payer).deposit(graphTallyCollector.target, indexer.address, collectTokens) + + // Get encoded SignedRAV + const { rav, signature } = await generateSignedRAV( + allocationId, + payer.address, + indexer.address, + subgraphServiceAddress, + 0, + collectTokens, + ethers.toUtf8Bytes(''), + signer.privateKey, + graphTallyCollectorAddress, + chainId, + ) + const encodedSignedRAV = encodeCollectQueryFeesData(rav, signature, 0n) + + // Collect query fees + const rewards = await collect(authorizedOperator, [indexer.address, PaymentTypes.QueryFee, encodedSignedRAV]) + expect(rewards).to.not.equal(0n) + }) + }) + + describe('Unauthorized Operator', () => { + it('should not be able to resize an allocation', async () => { + // Attempt to resize with unauthorized operator + const newAllocationTokens = allocationTokens + ethers.parseEther('5000') + await expect( + subgraphService.connect(unauthorizedOperator).resizeAllocation( + indexer.address, + allocationId, + newAllocationTokens, + ), + ).to.be.revertedWithCustomError( + subgraphService, + 'ProvisionManagerNotAuthorized', + ) + }) + + it('should not be able to close an allocation', async () => { + // Attempt to close with unauthorized operator + await expect( + subgraphService.connect(unauthorizedOperator).stopService( + indexer.address, + allocationId, + ), + ).to.be.revertedWithCustomError( + subgraphService, + 'ProvisionManagerNotAuthorized', + ) + }) + + it('should not be able to collect indexing rewards', async () => { + // Mine multiple blocks to simulate time passing + for (let i = 0; i < 1000; i++) { + await ethers.provider.send('evm_mine', []) + } + + // Build data for collect indexing rewards + const poi = generatePOI() + const poiMetadata = encodePOIMetadata( + 0, + generatePOI('public poi'), + 0, + 0, + 0, + ) + const collectData = encodeCollectIndexingRewardsData(allocationId, poi, poiMetadata) + + // Attempt to collect rewards with unauthorized operator + await expect( + collect(unauthorizedOperator, [indexer.address, PaymentTypes.IndexingRewards, collectData]), + ).to.be.revertedWithCustomError( + subgraphService, + 'ProvisionManagerNotAuthorized', + ) + }) + + it('should not be able to collect query fees', async () => { + // Setup query fees collection + let payer = ethers.Wallet.createRandom() + payer = payer.connect(ethers.provider) + let signer = ethers.Wallet.createRandom() + signer = signer.connect(ethers.provider) + const collectTokens = ethers.parseUnits('1000') + + // Mint GRT to payer and fund payer and signer with ETH + await setGRTBalance(graph.provider, graphToken.target, payer.address, ethers.parseEther('1000000')) + await ethers.provider.send('hardhat_setBalance', [payer.address, '0x56BC75E2D63100000']) + await ethers.provider.send('hardhat_setBalance', [signer.address, '0x56BC75E2D63100000']) + + // Authorize payer as signer + const proofDeadline = (await ethers.provider.getBlock('latest'))!.timestamp + 31536000 + const signerProof = generateSignerProof(BigInt(proofDeadline), payer.address, signer.privateKey, graphTallyCollectorAddress, chainId) + await graphTallyCollector.connect(payer).authorizeSigner(signer.address, proofDeadline, signerProof) + + // Deposit tokens in escrow + await graphToken.connect(payer).approve(escrow.target, collectTokens) + await escrow.connect(payer).deposit(escrow.target, indexer.address, collectTokens) + + // Get encoded SignedRAV + const { rav, signature } = await generateSignedRAV( + allocationId, + payer.address, + indexer.address, + subgraphServiceAddress, + 0, + collectTokens, + ethers.toUtf8Bytes(''), + signer.privateKey, + graphTallyCollectorAddress, + chainId, + ) + const encodedSignedRAV = encodeCollectQueryFeesData(rav, signature, 0n) + // Attempt to collect query fees with unauthorized operator + await expect( + collect(unauthorizedOperator, [indexer.address, PaymentTypes.QueryFee, encodedSignedRAV]), + ).to.be.revertedWithCustomError( + subgraphService, + 'ProvisionManagerNotAuthorized', + ) + }) + }) + }) + }) +}) diff --git a/packages/subgraph-service/test/integration/after-transition-period/subgraph-service/paused.test.ts b/packages/subgraph-service/test/integration/after-transition-period/subgraph-service/paused.test.ts new file mode 100644 index 000000000..a6ac1dbdd --- /dev/null +++ b/packages/subgraph-service/test/integration/after-transition-period/subgraph-service/paused.test.ts @@ -0,0 +1,247 @@ +import { ethers } from 'hardhat' +import { expect } from 'chai' +import hre from 'hardhat' + +import { DisputeManager, IGraphToken, SubgraphService } from '../../../../typechain-types' +import { encodeCollectIndexingRewardsData, encodePOIMetadata, encodeRegistrationData, encodeStartServiceData, generateAllocationProof, generatePOI, PaymentTypes } from '@graphprotocol/toolshed' +import { HardhatEthersSigner } from '@nomicfoundation/hardhat-ethers/signers' +import { setGRTBalance } from '@graphprotocol/toolshed/hardhat' + +import { indexers } from '../../../../tasks/test/fixtures/indexers' + +describe('Paused Protocol', () => { + let disputeManager: DisputeManager + let graphToken: IGraphToken + let subgraphService: SubgraphService + + let snapshotId: string + let chainId: number + + // Test addresses + let pauseGuardian: HardhatEthersSigner + let indexer: HardhatEthersSigner + let allocationId: string + let subgraphDeploymentId: string + let allocationTokens: bigint + let subgraphServiceAddress: string + + const graph = hre.graph() + const { provision } = graph.horizon.actions + const { collect } = graph.subgraphService.actions + + before(async () => { + // Get contracts + disputeManager = graph.subgraphService.contracts.DisputeManager + graphToken = graph.horizon.contracts.GraphToken + subgraphService = graph.subgraphService.contracts.SubgraphService + + // Get signers + pauseGuardian = await graph.accounts.getPauseGuardian() + + // Get chain id + chainId = Number((await hre.ethers.provider.getNetwork()).chainId) + + // Get subgraph service address + subgraphServiceAddress = await subgraphService.getAddress() + }) + + beforeEach(async () => { + // Take a snapshot before each test + snapshotId = await ethers.provider.send('evm_snapshot', []) + + // Get indexer + ;[indexer] = await graph.accounts.getTestAccounts() + }) + + afterEach(async () => { + // Revert to the snapshot after each test + await ethers.provider.send('evm_revert', [snapshotId]) + }) + + describe('Pause actions', () => { + it('should allow pause guardian to pause the protocol', async () => { + await subgraphService.connect(pauseGuardian).pause() + expect(await subgraphService.paused()).to.be.true + }) + + it('should allow pause guardian to unpause the protocol', async () => { + // First pause the protocol + await subgraphService.connect(pauseGuardian).pause() + expect(await subgraphService.paused()).to.be.true + + // Then unpause it + await subgraphService.connect(pauseGuardian).unpause() + expect(await subgraphService.paused()).to.be.false + }) + }) + + describe('Indexer Operations While Paused', () => { + beforeEach(async () => { + // Pause the protocol before each test + await subgraphService.connect(pauseGuardian).pause() + }) + + describe('Existing indexer', () => { + beforeEach(async () => { + // Get indexer + const indexerFixture = indexers[0] + indexer = await ethers.getSigner(indexerFixture.address) + }) + + describe('Opened allocation', () => { + beforeEach(() => { + // Get allocation + const allocation = indexers[0].allocations[0] + allocationId = allocation.allocationID + subgraphDeploymentId = allocation.subgraphDeploymentID + allocationTokens = allocation.tokens + }) + + it('should not allow indexer to stop an allocation while paused', async () => { + await expect( + subgraphService.connect(indexer).stopService( + indexer.address, + allocationId, + ), + ).to.be.revertedWithCustomError( + subgraphService, + 'EnforcedPause', + ) + }) + + it('should not allow indexer to collect indexing rewards while paused', async () => { + // Build data for collect indexing rewards + const poi = generatePOI() + const poiMetadata = encodePOIMetadata( + 0, + poi, + 0, + 0, + 0, + ) + const data = encodeCollectIndexingRewardsData(allocationId, poi, poiMetadata) + + await expect( + collect(indexer, [indexer.address, PaymentTypes.IndexingRewards, data]), + ).to.be.revertedWithCustomError( + subgraphService, + 'EnforcedPause', + ) + }) + + it('should not allow indexer to collect query fees while paused', async () => { + // Build data for collect query fees + const poi = generatePOI() + const poiMetadata = encodePOIMetadata( + 0, + poi, + 0, + 0, + 0, + ) + const data = encodeCollectIndexingRewardsData(allocationId, poi, poiMetadata) + + await expect( + collect(indexer, [indexer.address, PaymentTypes.QueryFee, data]), + ).to.be.revertedWithCustomError( + subgraphService, + 'EnforcedPause', + ) + }) + + it('should not allow indexer to resize an allocation while paused', async () => { + await expect( + subgraphService.connect(indexer).resizeAllocation( + indexer.address, + allocationId, + allocationTokens + ethers.parseEther('1000'), + ), + ).to.be.revertedWithCustomError( + subgraphService, + 'EnforcedPause', + ) + }) + }) + + describe('New allocation', () => { + let allocationPrivateKey: string + + beforeEach(() => { + // Get allocation + const wallet = ethers.Wallet.createRandom() + allocationId = wallet.address + allocationPrivateKey = wallet.privateKey + subgraphDeploymentId = indexers[0].allocations[0].subgraphDeploymentID + allocationTokens = 1000n + }) + + it('should not allow indexer to start an allocation while paused', async () => { + // Build allocation proof + const signature = await generateAllocationProof(indexer.address, allocationPrivateKey, subgraphServiceAddress, chainId) + + // Build allocation data + const data = encodeStartServiceData(subgraphDeploymentId, allocationTokens, allocationId, signature) + + await expect( + subgraphService.connect(indexer).startService( + indexer.address, + data, + ), + ).to.be.revertedWithCustomError( + subgraphService, + 'EnforcedPause', + ) + }) + }) + }) + + describe('New indexer', () => { + beforeEach(async () => { + // Get indexer + [indexer] = await graph.accounts.getTestAccounts() + + // Create provision + const disputePeriod = await disputeManager.getDisputePeriod() + const maxSlashingCut = await disputeManager.maxSlashingCut() + await setGRTBalance(graph.provider, graphToken.target, indexer.address, ethers.parseEther('100000')) + await provision(indexer, [indexer.address, await subgraphService.getAddress(), ethers.parseEther('100000'), maxSlashingCut, disputePeriod]) + }) + + it('should not allow indexer to register while paused', async () => { + const indexerUrl = 'https://test-indexer.com' + const indexerGeoHash = 'test-geo-hash' + const indexerRegistrationData = encodeRegistrationData(indexerUrl, indexerGeoHash, ethers.ZeroAddress) + + await expect( + subgraphService.connect(indexer).register(indexer.address, indexerRegistrationData), + ).to.be.revertedWithCustomError( + subgraphService, + 'EnforcedPause', + ) + }) + }) + + describe('Permissionless', () => { + let anyone: HardhatEthersSigner + + before(async () => { + // Get anyone address + [anyone] = await graph.accounts.getTestAccounts() + }) + + it('should not allow anyone to close a stale allocation while paused', async () => { + // Wait for POI staleness + const maxPOIStaleness = await subgraphService.maxPOIStaleness() + await ethers.provider.send('evm_increaseTime', [Number(maxPOIStaleness) + 1]) + await ethers.provider.send('evm_mine', []) + + await expect( + subgraphService.connect(anyone).closeStaleAllocation(allocationId), + ).to.be.revertedWithCustomError( + subgraphService, + 'EnforcedPause', + ) + }) + }) + }) +}) diff --git a/packages/subgraph-service/test/integration/after-transition-period/subgraph-service/permisionless.test.ts b/packages/subgraph-service/test/integration/after-transition-period/subgraph-service/permisionless.test.ts new file mode 100644 index 000000000..3c26155b7 --- /dev/null +++ b/packages/subgraph-service/test/integration/after-transition-period/subgraph-service/permisionless.test.ts @@ -0,0 +1,115 @@ +import { ethers } from 'hardhat' +import { expect } from 'chai' +import hre from 'hardhat' + +import { encodeStartServiceData, generateAllocationProof } from '@graphprotocol/toolshed' +import { HardhatEthersSigner } from '@nomicfoundation/hardhat-ethers/signers' +import { SubgraphService } from '../../../../typechain-types' + +import { indexers } from '../../../../tasks/test/fixtures/indexers' + +describe('Permissionless', () => { + let subgraphService: SubgraphService + let snapshotId: string + + // Test data + let indexer: HardhatEthersSigner + let anyone: HardhatEthersSigner + let allocationId: string + let subgraphDeploymentId: string + let allocationTokens: bigint + + const graph = hre.graph() + + before(async () => { + // Get contracts + subgraphService = graph.subgraphService.contracts.SubgraphService + + // Get anyone address + ;[anyone] = await graph.accounts.getTestAccounts() + }) + + beforeEach(async () => { + // Take a snapshot before each test + snapshotId = await ethers.provider.send('evm_snapshot', []) + }) + + afterEach(async () => { + // Revert to the snapshot after each test + await ethers.provider.send('evm_revert', [snapshotId]) + }) + + describe('Non-altruistic allocation', () => { + beforeEach(async () => { + // Get indexer + const indexerFixture = indexers[0] + indexer = await ethers.getSigner(indexerFixture.address) + + // Get allocation + const allocation = indexerFixture.allocations[0] + allocationId = allocation.allocationID + subgraphDeploymentId = allocation.subgraphDeploymentID + allocationTokens = allocation.tokens + }) + + it('should allow anyone to close an allocation after max POI staleness passes', async () => { + // Wait for POI staleness + const maxPOIStaleness = await subgraphService.maxPOIStaleness() + await ethers.provider.send('evm_increaseTime', [Number(maxPOIStaleness) + 1]) + await ethers.provider.send('evm_mine', []) + + // Get before state + const beforeLockedTokens = await subgraphService.allocationProvisionTracker(indexer.address) + + // Close allocation as anyone + await subgraphService.connect(anyone).closeStaleAllocation(allocationId) + + // Verify allocation is closed + const afterAllocation = await subgraphService.getAllocation(allocationId) + expect(afterAllocation.closedAt).to.not.equal(0, 'Allocation should be closed') + + // Verify tokens are released + const afterLockedTokens = await subgraphService.allocationProvisionTracker(indexer.address) + expect(afterLockedTokens).to.equal(beforeLockedTokens - allocationTokens, 'Tokens should be released') + }) + }) + + describe('Altruistic allocation', () => { + let allocationPrivateKey: string + + beforeEach(async () => { + // Get indexer + const indexerFixture = indexers[0] + indexer = await ethers.getSigner(indexerFixture.address) + + // Generate random allocation + const wallet = ethers.Wallet.createRandom() + allocationId = wallet.address + allocationPrivateKey = wallet.privateKey + subgraphDeploymentId = indexerFixture.allocations[0].subgraphDeploymentID + allocationTokens = 0n + + // Start allocation + const subgraphServiceAddress = await subgraphService.getAddress() + const chainId = Number((await hre.ethers.provider.getNetwork()).chainId) + const signature = await generateAllocationProof(indexer.address, allocationPrivateKey, subgraphServiceAddress, chainId) + const data = encodeStartServiceData(subgraphDeploymentId, allocationTokens, allocationId, signature) + await subgraphService.connect(indexer).startService(indexer.address, data) + }) + + it('should not allow closing an altruistic allocation permissionless', async () => { + // Wait for POI staleness + const maxPOIStaleness = await subgraphService.maxPOIStaleness() + await ethers.provider.send('evm_increaseTime', [Number(maxPOIStaleness) + 1]) + await ethers.provider.send('evm_mine', []) + + // Attempt to close allocation as anyone + await expect( + subgraphService.connect(anyone).closeStaleAllocation(allocationId), + ).to.be.revertedWithCustomError( + subgraphService, + 'SubgraphServiceAllocationIsAltruistic', + ).withArgs(allocationId) + }) + }) +}) diff --git a/packages/subgraph-service/test/integration/after-transition-period/upgrade.test.ts b/packages/subgraph-service/test/integration/after-transition-period/upgrade.test.ts new file mode 100644 index 000000000..47bb53515 --- /dev/null +++ b/packages/subgraph-service/test/integration/after-transition-period/upgrade.test.ts @@ -0,0 +1,83 @@ +import hre from 'hardhat' + +import { ethers } from 'hardhat' +import { expect } from 'chai' + +import type { HardhatEthersSigner } from '@nomicfoundation/hardhat-ethers/signers' +import { zeroPadValue } from 'ethers' + +const abi = [{ + inputs: [ + { + internalType: 'contract ITransparentUpgradeableProxy', + name: 'proxy', + type: 'address', + }, + { + internalType: 'address', + name: 'implementation', + type: 'address', + }, + { + internalType: 'bytes', + name: 'data', + type: 'bytes', + }, + ], + name: 'upgradeAndCall', + outputs: [], + stateMutability: 'payable', + type: 'function', +}] + +describe('Upgrading contracts', () => { + let snapshotId: string + + // Test addresses + let governor: HardhatEthersSigner + const graph = hre.graph() + + before(async () => { + governor = await graph.accounts.getGovernor() + }) + + beforeEach(async () => { + // Take a snapshot before each test + snapshotId = await ethers.provider.send('evm_snapshot', []) + }) + + afterEach(async () => { + // Revert to the snapshot after each test + await ethers.provider.send('evm_revert', [snapshotId]) + }) + + it('subgraph service should be upgradeable by the governor', async () => { + const entry = graph.subgraphService.addressBook.getEntry('SubgraphService') + const proxyAdmin = entry.proxyAdmin! + const proxy = entry.address + + // Upgrade the contract to a different implementation + // the implementation we use is the GraphTallyCollector, this is obviously absurd but we just need an address with code on it + const ProxyAdmin = new ethers.Contract(proxyAdmin, abi, governor) + await ProxyAdmin.upgradeAndCall(proxy, graph.horizon.contracts.GraphTallyCollector.target, '0x') + + // https:// github.com/OpenZeppelin/openzeppelin-contracts/blob/dbb6104ce834628e473d2173bbc9d47f81a9eec3/contracts/proxy/ERC1967/ERC1967Utils.sol#L37C53-L37C119 + const implementation = await hre.ethers.provider.getStorage(proxy, '0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc') + expect(zeroPadValue(implementation, 32)).to.equal(zeroPadValue(graph.horizon.contracts.GraphTallyCollector.target as string, 32)) + }) + + it('dispute manager should be upgradeable by the governor', async () => { + const entry = graph.subgraphService.addressBook.getEntry('DisputeManager') + const proxyAdmin = entry.proxyAdmin! + const proxy = entry.address + + // Upgrade the contract to a different implementation + // the implementation we use is the GraphTallyCollector, this is obviously absurd but we just need an address with code on it + const ProxyAdmin = new ethers.Contract(proxyAdmin, abi, governor) + await ProxyAdmin.upgradeAndCall(proxy, graph.horizon.contracts.GraphTallyCollector.target, '0x') + + // https:// github.com/OpenZeppelin/openzeppelin-contracts/blob/dbb6104ce834628e473d2173bbc9d47f81a9eec3/contracts/proxy/ERC1967/ERC1967Utils.sol#L37C53-L37C119 + const implementation = await hre.ethers.provider.getStorage(proxy, '0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc') + expect(zeroPadValue(implementation, 32)).to.equal(zeroPadValue(graph.horizon.contracts.GraphTallyCollector.target as string, 32)) + }) +}) diff --git a/packages/subgraph-service/test/integration/during-transition-period/dispute-manager.test.ts b/packages/subgraph-service/test/integration/during-transition-period/dispute-manager.test.ts new file mode 100644 index 000000000..618270960 --- /dev/null +++ b/packages/subgraph-service/test/integration/during-transition-period/dispute-manager.test.ts @@ -0,0 +1,153 @@ +import { ethers } from 'hardhat' +import { expect } from 'chai' +import hre from 'hardhat' + +import { DisputeManager, IGraphToken, SubgraphService } from '../../../typechain-types' +import { generateLegacyIndexingDisputeId, generateLegacyTypeDisputeId } from '@graphprotocol/toolshed' +import { HardhatEthersSigner } from '@nomicfoundation/hardhat-ethers/signers' +import { HorizonStaking } from '@graphprotocol/horizon' +import { LegacyDisputeManager } from '@graphprotocol/toolshed/deployments' +import { setGRTBalance } from '@graphprotocol/toolshed/hardhat' + +import { indexers } from '../../../tasks/test/fixtures/indexers' + +describe('Dispute Manager', () => { + let disputeManager: DisputeManager + let legacyDisputeManager: LegacyDisputeManager + let graphToken: IGraphToken + let staking: HorizonStaking + let subgraphService: SubgraphService + + let snapshotId: string + + // Test addresses + let governor: HardhatEthersSigner + let fisherman: HardhatEthersSigner + let arbitrator: HardhatEthersSigner + let indexer: HardhatEthersSigner + + let disputeDeposit: bigint + + // Allocation variables + let allocationId: string + + before(async () => { + // Get contracts + const graph = hre.graph() + disputeManager = graph.subgraphService.contracts.DisputeManager + legacyDisputeManager = graph.subgraphService.contracts.LegacyDisputeManager + graphToken = graph.horizon.contracts.GraphToken + staking = graph.horizon.contracts.HorizonStaking + subgraphService = graph.subgraphService.contracts.SubgraphService + + // Get signers + governor = await graph.accounts.getGovernor() + arbitrator = await graph.accounts.getArbitrator() + ;[fisherman] = await graph.accounts.getTestAccounts() + + // Get indexer + const indexerFixture = indexers[0] + indexer = await ethers.getSigner(indexerFixture.address) + + // Get allocation + const allocation = indexerFixture.legacyAllocations[0] + allocationId = allocation.allocationID + + // Get dispute deposit + disputeDeposit = ethers.parseEther('10000') + + // Set GRT balance for fisherman + await setGRTBalance(graph.provider, graphToken.target, fisherman.address, ethers.parseEther('1000000')) + + // Set arbitrator + await legacyDisputeManager.connect(governor).setArbitrator(arbitrator.address) + }) + + beforeEach(async () => { + // Take a snapshot before each test + snapshotId = await ethers.provider.send('evm_snapshot', []) + }) + + afterEach(async () => { + // Revert to the snapshot after each test + await ethers.provider.send('evm_revert', [snapshotId]) + }) + + describe('Legacy dispute type', () => { + describe('Arbitrator', () => { + it('should allow arbitrator to create and accept a legacy dispute on the new dispute manager after slashing on the legacy dispute manager', async () => { + // Create an indexing dispute on legacy dispute manager + await graphToken.connect(fisherman).approve(legacyDisputeManager.target, disputeDeposit) + await legacyDisputeManager.connect(fisherman).createIndexingDispute(allocationId, disputeDeposit) + const legacyDisputeId = generateLegacyIndexingDisputeId(allocationId) + + // Accept the dispute on the legacy dispute manager + await legacyDisputeManager.connect(arbitrator).acceptDispute(legacyDisputeId) + + // Get fisherman's balance before creating dispute + const fishermanBalanceBefore = await graphToken.balanceOf(fisherman.address) + + // Get indexer's provision before creating dispute + const provision = await staking.getProviderTokensAvailable(indexer.address, await subgraphService.getAddress()) + + // Create and accept legacy dispute using the same allocation ID + const tokensToSlash = ethers.parseEther('100000') + const tokensToReward = tokensToSlash / 2n + await disputeManager.connect(arbitrator).createAndAcceptLegacyDispute( + allocationId, + fisherman.address, + tokensToSlash, + tokensToReward, + ) + + // Get dispute ID from event + const disputeId = generateLegacyTypeDisputeId(allocationId) + + // Verify dispute was created and accepted + const dispute = await disputeManager.disputes(disputeId) + expect(dispute.indexer).to.equal(indexer.address, 'Indexer address mismatch') + expect(dispute.fisherman).to.equal(fisherman.address, 'Fisherman address mismatch') + expect(dispute.disputeType).to.equal(3, 'Dispute type should be legacy') + expect(dispute.status).to.equal(1, 'Dispute status should be accepted') + + // Verify indexer's stake was slashed + const updatedProvision = await staking.getProviderTokensAvailable(indexer.address, await subgraphService.getAddress()) + expect(updatedProvision).to.equal(provision - tokensToSlash, 'Indexer stake should be slashed') + + // Verify fisherman got the reward + const fishermanBalance = await graphToken.balanceOf(fisherman.address) + expect(fishermanBalance).to.equal(fishermanBalanceBefore + tokensToReward, 'Fisherman balance should be increased by the reward') + }) + + it('should not allow creating a legacy dispute for non-existent allocation', async () => { + const tokensToSlash = ethers.parseEther('1000') + const tokensToReward = tokensToSlash / 2n + + // Attempt to create legacy dispute with non-existent allocation + await expect( + disputeManager.connect(arbitrator).createAndAcceptLegacyDispute( + ethers.Wallet.createRandom().address, + fisherman.address, + tokensToSlash, + tokensToReward, + ), + ).to.be.revertedWithCustomError(disputeManager, 'DisputeManagerIndexerNotFound') + }) + }) + + it('should not allow non-arbitrator to create a legacy dispute', async () => { + const tokensToSlash = ethers.parseEther('1000') + const tokensToReward = tokensToSlash / 2n + + // Attempt to create legacy dispute as fisherman + await expect( + disputeManager.connect(fisherman).createAndAcceptLegacyDispute( + allocationId, + fisherman.address, + tokensToSlash, + tokensToReward, + ), + ).to.be.revertedWithCustomError(disputeManager, 'DisputeManagerNotArbitrator') + }) + }) +}) diff --git a/packages/subgraph-service/test/integration/during-transition-period/governance.test.ts b/packages/subgraph-service/test/integration/during-transition-period/governance.test.ts new file mode 100644 index 000000000..e70f9a779 --- /dev/null +++ b/packages/subgraph-service/test/integration/during-transition-period/governance.test.ts @@ -0,0 +1,93 @@ +import { ethers } from 'hardhat' +import { expect } from 'chai' +import hre from 'hardhat' + +import { HardhatEthersSigner } from '@nomicfoundation/hardhat-ethers/signers' +import { ISubgraphService } from '../../../typechain-types' + +describe('Governance', () => { + let subgraphService: ISubgraphService + let snapshotId: string + + // Test addresses + let governor: HardhatEthersSigner + let indexer: HardhatEthersSigner + let nonOwner: HardhatEthersSigner + let allocationId: string + let subgraphDeploymentId: string + + const graph = hre.graph() + + before(() => { + subgraphService = graph.subgraphService.contracts.SubgraphService + }) + + beforeEach(async () => { + // Take a snapshot before each test + snapshotId = await ethers.provider.send('evm_snapshot', []) + + // Get signers + governor = await graph.accounts.getGovernor() + ;[indexer, nonOwner] = await graph.accounts.getTestAccounts() + + // Generate test addresses + allocationId = ethers.Wallet.createRandom().address + subgraphDeploymentId = ethers.keccak256(ethers.toUtf8Bytes('test-subgraph-deployment')) + }) + + afterEach(async () => { + // Revert to the snapshot after each test + await ethers.provider.send('evm_revert', [snapshotId]) + }) + + describe('Legacy Allocation Migration', () => { + it('should migrate legacy allocation', async () => { + // Migrate legacy allocation + await subgraphService.connect(governor).migrateLegacyAllocation( + indexer.address, + allocationId, + subgraphDeploymentId, + ) + + // Verify the legacy allocation was migrated + const legacyAllocation = await subgraphService.getLegacyAllocation(allocationId) + expect(legacyAllocation.indexer).to.equal(indexer.address) + expect(legacyAllocation.subgraphDeploymentId).to.equal(subgraphDeploymentId) + }) + + it('should not allow non-owner to migrate legacy allocation', async () => { + // Attempt to migrate legacy allocation as non-owner + await expect( + subgraphService.connect(nonOwner).migrateLegacyAllocation( + indexer.address, + allocationId, + subgraphDeploymentId, + ), + ).to.be.revertedWithCustomError( + subgraphService, + 'OwnableUnauthorizedAccount', + ) + }) + + it('should not allow migrating a legacy allocation that was already migrated', async () => { + // First migration + await subgraphService.connect(governor).migrateLegacyAllocation( + indexer.address, + allocationId, + subgraphDeploymentId, + ) + + // Attempt to migrate the same allocation again + await expect( + subgraphService.connect(governor).migrateLegacyAllocation( + indexer.address, + allocationId, + subgraphDeploymentId, + ), + ).to.be.revertedWithCustomError( + subgraphService, + 'LegacyAllocationAlreadyExists', + ).withArgs(allocationId) + }) + }) +}) diff --git a/packages/subgraph-service/test/integration/during-transition-period/indexer.test.ts b/packages/subgraph-service/test/integration/during-transition-period/indexer.test.ts new file mode 100644 index 000000000..9b9da1be6 --- /dev/null +++ b/packages/subgraph-service/test/integration/during-transition-period/indexer.test.ts @@ -0,0 +1,106 @@ +import { ethers } from 'hardhat' +import { expect } from 'chai' +import hre from 'hardhat' + +import { encodeStartServiceData, generateAllocationProof } from '@graphprotocol/toolshed' +import { HardhatEthersSigner } from '@nomicfoundation/hardhat-ethers/signers' +import { ISubgraphService } from '../../../typechain-types' + +import { indexers } from '../../../tasks/test/fixtures/indexers' + +describe('Indexer', () => { + let subgraphService: ISubgraphService + let snapshotId: string + let chainId: number + + // Test addresses + let governor: HardhatEthersSigner + let indexer: HardhatEthersSigner + let allocationId: string + let subgraphDeploymentId: string + let allocationPrivateKey: string + let subgraphServiceAddress: string + + const graph = hre.graph() + + before(async () => { + // Get contracts + subgraphService = graph.subgraphService.contracts.SubgraphService + + // Get governor and non-owner + governor = await graph.accounts.getGovernor() + + // Get chain id + chainId = Number((await hre.ethers.provider.getNetwork()).chainId) + + // Get subgraph service address + subgraphServiceAddress = await subgraphService.getAddress() + }) + + beforeEach(async () => { + // Take a snapshot before each test + snapshotId = await ethers.provider.send('evm_snapshot', []) + }) + + afterEach(async () => { + // Revert to the snapshot after each test + await ethers.provider.send('evm_revert', [snapshotId]) + }) + + describe('Allocation', () => { + beforeEach(async () => { + // Get indexer + const indexerFixture = indexers[0] + indexer = await ethers.getSigner(indexerFixture.address) + + // Generate test addresses + const allocation = indexerFixture.legacyAllocations[0] + allocationId = allocation.allocationID + subgraphDeploymentId = allocation.subgraphDeploymentID + allocationPrivateKey = allocation.allocationPrivateKey + }) + + it('should not be able to create an allocation with an AllocationID that already exists in HorizonStaking contract', async () => { + // Build allocation proof + const signature = await generateAllocationProof(indexer.address, allocationPrivateKey, subgraphServiceAddress, chainId) + + // Attempt to create an allocation with the same ID + const data = encodeStartServiceData(subgraphDeploymentId, 1000n, allocationId, signature) + + await expect( + subgraphService.connect(indexer).startService( + indexer.address, + data, + ), + ).to.be.revertedWithCustomError( + subgraphService, + 'LegacyAllocationAlreadyExists', + ).withArgs(allocationId) + }) + + it('should not be able to create an allocation that was already migrated by the owner', async () => { + // Migrate legacy allocation + await subgraphService.connect(governor).migrateLegacyAllocation( + indexer.address, + allocationId, + subgraphDeploymentId, + ) + + // Build allocation proof + const signature = await generateAllocationProof(indexer.address, allocationPrivateKey, subgraphServiceAddress, chainId) + + // Attempt to create the same allocation + const data = encodeStartServiceData(subgraphDeploymentId, 1000n, allocationId, signature) + + await expect( + subgraphService.connect(indexer).startService( + indexer.address, + data, + ), + ).to.be.revertedWithCustomError( + subgraphService, + 'LegacyAllocationAlreadyExists', + ).withArgs(allocationId) + }) + }) +}) diff --git a/packages/subgraph-service/test/integration/during-transition-period/legacy-dispute-manager.test.ts b/packages/subgraph-service/test/integration/during-transition-period/legacy-dispute-manager.test.ts new file mode 100644 index 000000000..dee10a8e6 --- /dev/null +++ b/packages/subgraph-service/test/integration/during-transition-period/legacy-dispute-manager.test.ts @@ -0,0 +1,249 @@ +import { ethers } from 'hardhat' +import { expect } from 'chai' +import hre from 'hardhat' + +import { generateAttestationData, generateLegacyIndexingDisputeId, generateLegacyQueryDisputeId } from '@graphprotocol/toolshed' +import { HardhatEthersSigner } from '@nomicfoundation/hardhat-ethers/signers' +import { HorizonStaking } from '@graphprotocol/horizon' +import { IGraphToken } from '../../../typechain-types' +import type { LegacyDisputeManager } from '@graphprotocol/toolshed/deployments' +import { setGRTBalance } from '@graphprotocol/toolshed/hardhat' + +import { indexers } from '../../../tasks/test/fixtures/indexers' + +describe('Legacy Dispute Manager', () => { + let legacyDisputeManager: LegacyDisputeManager + let graphToken: IGraphToken + let staking: HorizonStaking + + let snapshotId: string + + let governor: HardhatEthersSigner + let arbitrator: HardhatEthersSigner + let indexer: HardhatEthersSigner + let fisherman: HardhatEthersSigner + + let disputeDeposit: bigint + + const graph = hre.graph() + + // We have to use Aribtrm Sepolia since we're testing an already deployed contract but running on a hardhat fork + const chainId = 421614 + + before(async () => { + governor = await graph.accounts.getGovernor() + ;[arbitrator, fisherman] = await graph.accounts.getTestAccounts() + + // Get contract instances with correct types + legacyDisputeManager = graph.subgraphService.contracts.LegacyDisputeManager + graphToken = graph.horizon.contracts.GraphToken + staking = graph.horizon.contracts.HorizonStaking + + // Set GRT balances + await setGRTBalance(graph.provider, graphToken.target, fisherman.address, ethers.parseEther('100000')) + }) + + beforeEach(async () => { + // Take a snapshot before each test + snapshotId = await ethers.provider.send('evm_snapshot', []) + + // Legacy dispute manager + disputeDeposit = ethers.parseEther('10000') + + // Set arbitrator + await legacyDisputeManager.connect(governor).setArbitrator(arbitrator.address) + }) + + afterEach(async () => { + // Revert to the snapshot after each test + await ethers.provider.send('evm_revert', [snapshotId]) + }) + + describe('Indexing Disputes', () => { + let allocationId: string + + beforeEach(async () => { + // Get Indexer + const indexerFixture = indexers[0] + indexer = await ethers.getSigner(indexerFixture.address) + + // Get allocation + allocationId = indexerFixture.legacyAllocations[0].allocationID + }) + + it('should allow creating and accepting indexing disputes', async () => { + // Create an indexing dispute + await graphToken.connect(fisherman).approve(legacyDisputeManager.target, disputeDeposit) + await legacyDisputeManager.connect(fisherman).createIndexingDispute(allocationId, disputeDeposit) + const disputeId = generateLegacyIndexingDisputeId(allocationId) + + // Verify dispute was created + const disputeExists = await legacyDisputeManager.isDisputeCreated(disputeId) + expect(disputeExists).to.be.true + + // Get state before slashing + const idxSlashingPercentage = 25000n + const indexerStakeBefore = (await staking.getServiceProvider(indexer.address)).tokensStaked + const slashedAmount = (indexerStakeBefore * idxSlashingPercentage) / 1_000_000n + const fishermanBalanceBefore = await graphToken.balanceOf(fisherman.address) + + // Accept the dispute + await legacyDisputeManager.connect(arbitrator).acceptDispute(disputeId) + + // Verify indexer was slashed for 2.5% of their stake + const indexerStake = (await staking.getServiceProvider(indexer.address)).tokensStaked + expect(indexerStake).to.equal(indexerStakeBefore - slashedAmount, 'Indexer stake was not slashed correctly') + + // Verify fisherman received their deposit and 50% of the slashed amount + const fishermanBalance = await graphToken.balanceOf(fisherman.address) + expect(fishermanBalance).to.equal(fishermanBalanceBefore + slashedAmount / 2n + disputeDeposit, 'Fisherman balance was not updated correctly') + }) + }) + + describe('Query Disputes', () => { + let allocationPrivateKey: string + let subgraphDeploymentId: string + + beforeEach(async () => { + // Get Indexer + const indexerFixture = indexers[0] + indexer = await ethers.getSigner(indexerFixture.address) + + // Get allocation + const allocation = indexerFixture.legacyAllocations[0] + allocationPrivateKey = allocation.allocationPrivateKey + subgraphDeploymentId = allocation.subgraphDeploymentID + }) + + it('should allow creating and accepting query disputes', async () => { + // Create attestation data + const queryHash = ethers.keccak256(ethers.toUtf8Bytes('test-query')) + const responseHash = ethers.keccak256(ethers.toUtf8Bytes('test-response')) + const attestationData = await generateAttestationData( + queryHash, + responseHash, + subgraphDeploymentId, + allocationPrivateKey, + await legacyDisputeManager.getAddress(), + chainId, + ) + + // Create a query dispute + await graphToken.connect(fisherman).approve(legacyDisputeManager.target, disputeDeposit) + await legacyDisputeManager.connect(fisherman).createQueryDispute(attestationData, disputeDeposit) + const disputeId = generateLegacyQueryDisputeId(queryHash, + responseHash, + subgraphDeploymentId, + indexer.address, + fisherman.address, + ) + + // Verify dispute was created + const disputeExists = await legacyDisputeManager.isDisputeCreated(disputeId) + expect(disputeExists).to.be.true + + // Get state before slashing + const qrySlashingPercentage = 25000n + const indexerStakeBefore = (await staking.getServiceProvider(indexer.address)).tokensStaked + const slashedAmount = (indexerStakeBefore * qrySlashingPercentage) / 1_000_000n + const fishermanBalanceBefore = await graphToken.balanceOf(fisherman.address) + + // Accept the dispute + await legacyDisputeManager.connect(arbitrator).acceptDispute(disputeId) + + // Verify indexer was slashed for 2.5% of their stake + const indexerStake = (await staking.getServiceProvider(indexer.address)).tokensStaked + expect(indexerStake).to.equal(indexerStakeBefore - slashedAmount, 'Indexer stake was not slashed correctly') + + // Verify fisherman received their deposit and 50% of the slashed amount + const fishermanBalance = await graphToken.balanceOf(fisherman.address) + expect(fishermanBalance).to.equal(fishermanBalanceBefore + slashedAmount / 2n + disputeDeposit, 'Fisherman balance was not updated correctly') + }) + }) + + describe('Query Dispute Conflict', () => { + let allocationPrivateKey: string + let subgraphDeploymentId: string + + beforeEach(async () => { + // Get Indexer + const indexerFixture = indexers[0] + indexer = await ethers.getSigner(indexerFixture.address) + + // Get allocation + const allocation = indexerFixture.legacyAllocations[0] + allocationPrivateKey = allocation.allocationPrivateKey + subgraphDeploymentId = allocation.subgraphDeploymentID + }) + + it('should allow creating conflicting query disputes', async () => { + // Create first attestation data + const queryHash = ethers.keccak256(ethers.toUtf8Bytes('test-query')) + const responseHash1 = ethers.keccak256(ethers.toUtf8Bytes('test-response-1')) + const attestationData1 = await generateAttestationData( + queryHash, + responseHash1, + subgraphDeploymentId, + allocationPrivateKey, + await legacyDisputeManager.getAddress(), + chainId, + ) + + // Create second attestation data with different query/response + const responseHash2 = ethers.keccak256(ethers.toUtf8Bytes('test-response-2')) + const attestationData2 = await generateAttestationData( + queryHash, + responseHash2, + subgraphDeploymentId, + allocationPrivateKey, + await legacyDisputeManager.getAddress(), + chainId, + ) + + // Create query dispute + await legacyDisputeManager.connect(fisherman).createQueryDisputeConflict(attestationData1, attestationData2) + + // Create dispute IDs + const disputeId1 = generateLegacyQueryDisputeId( + queryHash, + responseHash1, + subgraphDeploymentId, + indexer.address, + fisherman.address, + ) + const disputeId2 = generateLegacyQueryDisputeId( + queryHash, + responseHash2, + subgraphDeploymentId, + indexer.address, + fisherman.address, + ) + + // Verify both disputes were created + const disputeExists1 = await legacyDisputeManager.isDisputeCreated(disputeId1) + const disputeExists2 = await legacyDisputeManager.isDisputeCreated(disputeId2) + expect(disputeExists1).to.be.true + expect(disputeExists2).to.be.true + + // Get state before slashing + const qrySlashingPercentage = 25000n + const indexerStakeBefore = (await staking.getServiceProvider(indexer.address)).tokensStaked + const slashedAmount = (indexerStakeBefore * qrySlashingPercentage) / 1_000_000n + const fishermanBalanceBefore = await graphToken.balanceOf(fisherman.address) + + // Accept one dispute + await legacyDisputeManager.connect(arbitrator).acceptDispute(disputeId1) + + // Verify indexer was slashed for 2.5% of their stake + const indexerStake = (await staking.getServiceProvider(indexer.address)).tokensStaked + expect(indexerStake).to.equal(indexerStakeBefore - slashedAmount, 'Indexer stake was not slashed correctly') + + // Verify fisherman received 50% of the slashed amount + const fishermanBalance = await graphToken.balanceOf(fisherman.address) + expect(fishermanBalance).to.equal( + fishermanBalanceBefore + slashedAmount / 2n, + 'Fisherman balance was not updated correctly', + ) + }) + }) +}) diff --git a/packages/subgraph-service/test/unit/SubgraphBaseTest.t.sol b/packages/subgraph-service/test/unit/SubgraphBaseTest.t.sol new file mode 100644 index 000000000..0f59013be --- /dev/null +++ b/packages/subgraph-service/test/unit/SubgraphBaseTest.t.sol @@ -0,0 +1,221 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { Controller } from "@graphprotocol/contracts/contracts/governance/Controller.sol"; +import { GraphPayments } from "@graphprotocol/horizon/contracts/payments/GraphPayments.sol"; +import { GraphProxy } from "@graphprotocol/contracts/contracts/upgrades/GraphProxy.sol"; +import { GraphProxyAdmin } from "@graphprotocol/contracts/contracts/upgrades/GraphProxyAdmin.sol"; +import { HorizonStaking } from "@graphprotocol/horizon/contracts/staking/HorizonStaking.sol"; +import { HorizonStakingExtension } from "@graphprotocol/horizon/contracts/staking/HorizonStakingExtension.sol"; +import { IGraphPayments } from "@graphprotocol/horizon/contracts/interfaces/IGraphPayments.sol"; +import { IHorizonStaking } from "@graphprotocol/horizon/contracts/interfaces/IHorizonStaking.sol"; +import { IPaymentsEscrow } from "@graphprotocol/horizon/contracts/interfaces/IPaymentsEscrow.sol"; +import { IGraphTallyCollector } from "@graphprotocol/horizon/contracts/interfaces/IGraphTallyCollector.sol"; +import { GraphTallyCollector } from "@graphprotocol/horizon/contracts/payments/collectors/GraphTallyCollector.sol"; +import { PaymentsEscrow } from "@graphprotocol/horizon/contracts/payments/PaymentsEscrow.sol"; +import { UnsafeUpgrades } from "openzeppelin-foundry-upgrades/Upgrades.sol"; + +import { Constants } from "./utils/Constants.sol"; +import { DisputeManager } from "../../contracts/DisputeManager.sol"; +import { SubgraphService } from "../../contracts/SubgraphService.sol"; +import { Users } from "./utils/Users.sol"; +import { Utils } from "./utils/Utils.sol"; + +import { MockCuration } from "./mocks/MockCuration.sol"; +import { MockGRTToken } from "./mocks/MockGRTToken.sol"; +import { MockRewardsManager } from "./mocks/MockRewardsManager.sol"; +import { MockEpochManager } from "./mocks/MockEpochManager.sol"; + +abstract contract SubgraphBaseTest is Utils, Constants { + /* + * VARIABLES + */ + + /* Contracts */ + + GraphProxyAdmin proxyAdmin; + Controller controller; + SubgraphService subgraphService; + DisputeManager disputeManager; + IHorizonStaking staking; + GraphPayments graphPayments; + IPaymentsEscrow escrow; + GraphTallyCollector graphTallyCollector; + + HorizonStaking private stakingBase; + HorizonStakingExtension private stakingExtension; + + MockCuration curation; + MockGRTToken token; + MockRewardsManager rewardsManager; + MockEpochManager epochManager; + + /* Users */ + + Users internal users; + + /* + * SET UP + */ + + function setUp() public virtual { + token = new MockGRTToken(); + + // Setup Users + users = Users({ + governor: createUser("governor"), + deployer: createUser("deployer"), + indexer: createUser("indexer"), + operator: createUser("operator"), + gateway: createUser("gateway"), + verifier: createUser("verifier"), + delegator: createUser("delegator"), + arbitrator: createUser("arbitrator"), + fisherman: createUser("fisherman"), + rewardsDestination: createUser("rewardsDestination"), + pauseGuardian: createUser("pauseGuardian") + }); + + deployProtocolContracts(); + setupProtocol(); + unpauseProtocol(); + vm.stopPrank(); + } + + function deployProtocolContracts() private { + resetPrank(users.governor); + proxyAdmin = new GraphProxyAdmin(); + controller = new Controller(); + + resetPrank(users.deployer); + GraphProxy stakingProxy = new GraphProxy(address(0), address(proxyAdmin)); + rewardsManager = new MockRewardsManager(token, rewardsPerSignal, rewardsPerSubgraphAllocationUpdate); + curation = new MockCuration(); + epochManager = new MockEpochManager(); + + // GraphPayments predict address + bytes32 saltGraphPayments = keccak256("GraphPaymentsSalt"); + bytes32 paymentsHash = keccak256( + bytes.concat( + vm.getCode("GraphPayments.sol:GraphPayments"), + abi.encode(address(controller), protocolPaymentCut) + ) + ); + address predictedGraphPaymentsAddress = vm.computeCreate2Address( + saltGraphPayments, + paymentsHash, + users.deployer + ); + + // GraphEscrow predict address + bytes32 saltEscrow = keccak256("GraphEscrowSalt"); + bytes32 escrowHash = keccak256( + bytes.concat( + vm.getCode("PaymentsEscrow.sol:PaymentsEscrow"), + abi.encode(address(controller), withdrawEscrowThawingPeriod) + ) + ); + address predictedEscrowAddress = vm.computeCreate2Address(saltEscrow, escrowHash, users.deployer); + + resetPrank(users.governor); + controller.setContractProxy(keccak256("GraphToken"), address(token)); + controller.setContractProxy(keccak256("Staking"), address(stakingProxy)); + controller.setContractProxy(keccak256("RewardsManager"), address(rewardsManager)); + controller.setContractProxy(keccak256("GraphPayments"), predictedGraphPaymentsAddress); + controller.setContractProxy(keccak256("PaymentsEscrow"), predictedEscrowAddress); + controller.setContractProxy(keccak256("EpochManager"), address(epochManager)); + controller.setContractProxy(keccak256("GraphTokenGateway"), makeAddr("GraphTokenGateway")); + controller.setContractProxy(keccak256("GraphProxyAdmin"), makeAddr("GraphProxyAdmin")); + controller.setContractProxy(keccak256("Curation"), address(curation)); + + resetPrank(users.deployer); + address disputeManagerImplementation = address(new DisputeManager(address(controller))); + address disputeManagerProxy = UnsafeUpgrades.deployTransparentProxy( + disputeManagerImplementation, + users.governor, + abi.encodeCall( + DisputeManager.initialize, + ( + users.deployer, + users.arbitrator, + disputePeriod, + disputeDeposit, + fishermanRewardPercentage, + maxSlashingPercentage + ) + ) + ); + disputeManager = DisputeManager(disputeManagerProxy); + disputeManager.transferOwnership(users.governor); + + graphTallyCollector = new GraphTallyCollector( + "GraphTallyCollector", + "1", + address(controller), + revokeSignerThawingPeriod + ); + address subgraphServiceImplementation = address( + new SubgraphService( + address(controller), + address(disputeManager), + address(graphTallyCollector), + address(curation) + ) + ); + address subgraphServiceProxy = UnsafeUpgrades.deployTransparentProxy( + subgraphServiceImplementation, + users.governor, + abi.encodeCall( + SubgraphService.initialize, + (users.deployer, minimumProvisionTokens, delegationRatio, stakeToFeesRatio) + ) + ); + subgraphService = SubgraphService(subgraphServiceProxy); + + stakingExtension = new HorizonStakingExtension(address(controller), address(subgraphService)); + stakingBase = new HorizonStaking(address(controller), address(stakingExtension), address(subgraphService)); + + graphPayments = new GraphPayments{ salt: saltGraphPayments }(address(controller), protocolPaymentCut); + escrow = new PaymentsEscrow{ salt: saltEscrow }(address(controller), withdrawEscrowThawingPeriod); + + resetPrank(users.governor); + disputeManager.setSubgraphService(address(subgraphService)); + proxyAdmin.upgrade(stakingProxy, address(stakingBase)); + proxyAdmin.acceptProxy(stakingBase, stakingProxy); + staking = IHorizonStaking(address(stakingProxy)); + } + + function setupProtocol() private { + resetPrank(users.deployer); + subgraphService.transferOwnership(users.governor); + resetPrank(users.governor); + staking.setMaxThawingPeriod(MAX_WAIT_PERIOD); + epochManager.setEpochLength(EPOCH_LENGTH); + subgraphService.setMaxPOIStaleness(maxPOIStaleness); + subgraphService.setCurationCut(curationCut); + subgraphService.setPauseGuardian(users.pauseGuardian, true); + } + + function unpauseProtocol() private { + resetPrank(users.governor); + controller.setPaused(false); + } + + function createUser(string memory name) internal returns (address) { + address user = makeAddr(name); + vm.deal({ account: user, newBalance: 100 ether }); + deal({ token: address(token), to: user, give: 10_000_000_000 ether }); + vm.label({ account: user, newLabel: name }); + return user; + } + + function mint(address _address, uint256 amount) internal { + deal({ token: address(token), to: _address, give: amount }); + } + + function burn(address _from, uint256 amount) internal { + token.burnFrom(_from, amount); + } +} diff --git a/packages/subgraph-service/test/unit/disputeManager/DisputeManager.t.sol b/packages/subgraph-service/test/unit/disputeManager/DisputeManager.t.sol new file mode 100644 index 000000000..ebe35e4fa --- /dev/null +++ b/packages/subgraph-service/test/unit/disputeManager/DisputeManager.t.sol @@ -0,0 +1,826 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { MathUtils } from "@graphprotocol/horizon/contracts/libraries/MathUtils.sol"; +import { PPMMath } from "@graphprotocol/horizon/contracts/libraries/PPMMath.sol"; +import { IDisputeManager } from "../../../contracts/interfaces/IDisputeManager.sol"; +import { Attestation } from "../../../contracts/libraries/Attestation.sol"; +import { Allocation } from "../../../contracts/libraries/Allocation.sol"; + +import { SubgraphServiceSharedTest } from "../shared/SubgraphServiceShared.t.sol"; + +contract DisputeManagerTest is SubgraphServiceSharedTest { + using PPMMath for uint256; + + /* + * MODIFIERS + */ + + modifier useGovernor() { + vm.startPrank(users.governor); + _; + vm.stopPrank(); + } + + modifier useFisherman() { + vm.startPrank(users.fisherman); + _; + vm.stopPrank(); + } + + /* + * ACTIONS + */ + + function _setArbitrator(address _arbitrator) internal { + vm.expectEmit(address(disputeManager)); + emit IDisputeManager.ArbitratorSet(_arbitrator); + disputeManager.setArbitrator(_arbitrator); + assertEq(disputeManager.arbitrator(), _arbitrator, "Arbitrator should be set."); + } + + function _setFishermanRewardCut(uint32 _fishermanRewardCut) internal { + vm.expectEmit(address(disputeManager)); + emit IDisputeManager.FishermanRewardCutSet(_fishermanRewardCut); + disputeManager.setFishermanRewardCut(_fishermanRewardCut); + assertEq(disputeManager.fishermanRewardCut(), _fishermanRewardCut, "Fisherman reward cut should be set."); + } + + function _setMaxSlashingCut(uint32 _maxSlashingCut) internal { + vm.expectEmit(address(disputeManager)); + emit IDisputeManager.MaxSlashingCutSet(_maxSlashingCut); + disputeManager.setMaxSlashingCut(_maxSlashingCut); + assertEq(disputeManager.maxSlashingCut(), _maxSlashingCut, "Max slashing cut should be set."); + } + + function _setDisputeDeposit(uint256 _disputeDeposit) internal { + vm.expectEmit(address(disputeManager)); + emit IDisputeManager.DisputeDepositSet(_disputeDeposit); + disputeManager.setDisputeDeposit(_disputeDeposit); + assertEq(disputeManager.disputeDeposit(), _disputeDeposit, "Dispute deposit should be set."); + } + + function _setSubgraphService(address _subgraphService) internal { + vm.expectEmit(address(disputeManager)); + emit IDisputeManager.SubgraphServiceSet(_subgraphService); + disputeManager.setSubgraphService(_subgraphService); + assertEq(address(disputeManager.subgraphService()), _subgraphService, "Subgraph service should be set."); + } + + function _createIndexingDispute(address _allocationId, bytes32 _poi) internal returns (bytes32) { + (, address fisherman, ) = vm.readCallers(); + bytes32 expectedDisputeId = keccak256(abi.encodePacked(_allocationId, _poi)); + uint256 disputeDeposit = disputeManager.disputeDeposit(); + uint256 beforeFishermanBalance = token.balanceOf(fisherman); + Allocation.State memory alloc = subgraphService.getAllocation(_allocationId); + uint256 stakeSnapshot = disputeManager.getStakeSnapshot(alloc.indexer); + uint256 cancellableAt = block.timestamp + disputeManager.disputePeriod(); + + // Approve the dispute deposit + token.approve(address(disputeManager), disputeDeposit); + + vm.expectEmit(address(disputeManager)); + emit IDisputeManager.IndexingDisputeCreated( + expectedDisputeId, + alloc.indexer, + fisherman, + disputeDeposit, + _allocationId, + _poi, + stakeSnapshot, + cancellableAt + ); + + // Create the indexing dispute + bytes32 _disputeId = disputeManager.createIndexingDispute(_allocationId, _poi); + + // Check that the dispute was created and that it has the correct ID + assertTrue(disputeManager.isDisputeCreated(_disputeId), "Dispute should be created."); + assertEq(expectedDisputeId, _disputeId, "Dispute ID should match"); + + // Check dispute values + IDisputeManager.Dispute memory dispute = _getDispute(_disputeId); + assertEq(dispute.indexer, alloc.indexer, "Indexer should match"); + assertEq(dispute.fisherman, fisherman, "Fisherman should match"); + assertEq(dispute.deposit, disputeDeposit, "Deposit should match"); + assertEq(dispute.relatedDisputeId, bytes32(0), "Related dispute ID should be empty"); + assertEq( + uint8(dispute.disputeType), + uint8(IDisputeManager.DisputeType.IndexingDispute), + "Dispute type should be indexing" + ); + assertEq( + uint8(dispute.status), + uint8(IDisputeManager.DisputeStatus.Pending), + "Dispute status should be pending" + ); + assertEq(dispute.createdAt, block.timestamp, "Created at should match"); + assertEq(dispute.stakeSnapshot, stakeSnapshot, "Stake snapshot should match"); + + // Check that the fisherman was charged the dispute deposit + uint256 afterFishermanBalance = token.balanceOf(fisherman); + assertEq( + afterFishermanBalance, + beforeFishermanBalance - disputeDeposit, + "Fisherman should be charged the dispute deposit" + ); + + return _disputeId; + } + + function _createQueryDispute(bytes memory _attestationData) internal returns (bytes32) { + (, address fisherman, ) = vm.readCallers(); + Attestation.State memory attestation = Attestation.parse(_attestationData); + address indexer = disputeManager.getAttestationIndexer(attestation); + bytes32 expectedDisputeId = keccak256( + abi.encodePacked( + attestation.requestCID, + attestation.responseCID, + attestation.subgraphDeploymentId, + indexer, + fisherman + ) + ); + uint256 disputeDeposit = disputeManager.disputeDeposit(); + uint256 beforeFishermanBalance = token.balanceOf(fisherman); + uint256 stakeSnapshot = disputeManager.getStakeSnapshot(indexer); + uint256 cancellableAt = block.timestamp + disputeManager.disputePeriod(); + + // Approve the dispute deposit + token.approve(address(disputeManager), disputeDeposit); + + vm.expectEmit(address(disputeManager)); + emit IDisputeManager.QueryDisputeCreated( + expectedDisputeId, + indexer, + fisherman, + disputeDeposit, + attestation.subgraphDeploymentId, + _attestationData, + cancellableAt, + stakeSnapshot + ); + + bytes32 _disputeID = disputeManager.createQueryDispute(_attestationData); + + // Check that the dispute was created and that it has the correct ID + assertTrue(disputeManager.isDisputeCreated(_disputeID), "Dispute should be created."); + assertEq(expectedDisputeId, _disputeID, "Dispute ID should match"); + + // Check dispute values + IDisputeManager.Dispute memory dispute = _getDispute(_disputeID); + assertEq(dispute.indexer, indexer, "Indexer should match"); + assertEq(dispute.fisherman, fisherman, "Fisherman should match"); + assertEq(dispute.deposit, disputeDeposit, "Deposit should match"); + assertEq(dispute.relatedDisputeId, bytes32(0), "Related dispute ID should be empty"); + assertEq( + uint8(dispute.disputeType), + uint8(IDisputeManager.DisputeType.QueryDispute), + "Dispute type should be query" + ); + assertEq( + uint8(dispute.status), + uint8(IDisputeManager.DisputeStatus.Pending), + "Dispute status should be pending" + ); + assertEq(dispute.createdAt, block.timestamp, "Created at should match"); + assertEq(dispute.stakeSnapshot, stakeSnapshot, "Stake snapshot should match"); + + // Check that the fisherman was charged the dispute deposit + uint256 afterFishermanBalance = token.balanceOf(fisherman); + assertEq( + afterFishermanBalance, + beforeFishermanBalance - disputeDeposit, + "Fisherman should be charged the dispute deposit" + ); + + return _disputeID; + } + + struct Balances { + uint256 indexer; + uint256 fisherman; + uint256 arbitrator; + uint256 disputeManager; + uint256 staking; + } + + function _createAndAcceptLegacyDispute( + address _allocationId, + address _fisherman, + uint256 _tokensSlash, + uint256 _tokensRewards + ) internal returns (bytes32) { + (, address arbitrator, ) = vm.readCallers(); + address indexer = staking.getAllocation(_allocationId).indexer; + + Balances memory beforeBalances = Balances({ + indexer: token.balanceOf(indexer), + fisherman: token.balanceOf(_fisherman), + arbitrator: token.balanceOf(arbitrator), + disputeManager: token.balanceOf(address(disputeManager)), + staking: token.balanceOf(address(staking)) + }); + + vm.expectEmit(address(disputeManager)); + emit IDisputeManager.LegacyDisputeCreated( + keccak256(abi.encodePacked(_allocationId, "legacy")), + indexer, + _fisherman, + _allocationId, + _tokensSlash, + _tokensRewards + ); + vm.expectEmit(address(disputeManager)); + emit IDisputeManager.DisputeAccepted( + keccak256(abi.encodePacked(_allocationId, "legacy")), + indexer, + _fisherman, + _tokensRewards + ); + bytes32 _disputeId = disputeManager.createAndAcceptLegacyDispute( + _allocationId, + _fisherman, + _tokensSlash, + _tokensRewards + ); + + Balances memory afterBalances = Balances({ + indexer: token.balanceOf(indexer), + fisherman: token.balanceOf(_fisherman), + arbitrator: token.balanceOf(arbitrator), + disputeManager: token.balanceOf(address(disputeManager)), + staking: token.balanceOf(address(staking)) + }); + + assertEq(afterBalances.indexer, beforeBalances.indexer); + assertEq(afterBalances.fisherman, beforeBalances.fisherman + _tokensRewards); + assertEq(afterBalances.arbitrator, beforeBalances.arbitrator); + assertEq(afterBalances.disputeManager, beforeBalances.disputeManager); + assertEq(afterBalances.staking, beforeBalances.staking - _tokensSlash); + + IDisputeManager.Dispute memory dispute = _getDispute(_disputeId); + assertEq(dispute.indexer, indexer); + assertEq(dispute.fisherman, _fisherman); + assertEq(dispute.deposit, 0); + assertEq(dispute.relatedDisputeId, bytes32(0)); + assertEq(uint8(dispute.disputeType), uint8(IDisputeManager.DisputeType.LegacyDispute)); + assertEq(uint8(dispute.status), uint8(IDisputeManager.DisputeStatus.Accepted)); + assertEq(dispute.createdAt, block.timestamp); + assertEq(dispute.stakeSnapshot, 0); + + return _disputeId; + } + + struct BeforeValues_CreateQueryDisputeConflict { + Attestation.State attestation1; + Attestation.State attestation2; + address indexer1; + address indexer2; + uint256 stakeSnapshot1; + uint256 stakeSnapshot2; + } + + function _createQueryDisputeConflict( + bytes memory attestationData1, + bytes memory attestationData2 + ) internal returns (bytes32, bytes32) { + (, address fisherman, ) = vm.readCallers(); + + BeforeValues_CreateQueryDisputeConflict memory beforeValues; + beforeValues.attestation1 = Attestation.parse(attestationData1); + beforeValues.attestation2 = Attestation.parse(attestationData2); + beforeValues.indexer1 = disputeManager.getAttestationIndexer(beforeValues.attestation1); + beforeValues.indexer2 = disputeManager.getAttestationIndexer(beforeValues.attestation2); + beforeValues.stakeSnapshot1 = disputeManager.getStakeSnapshot(beforeValues.indexer1); + beforeValues.stakeSnapshot2 = disputeManager.getStakeSnapshot(beforeValues.indexer2); + + uint256 beforeFishermanBalance = token.balanceOf(fisherman); + + // Approve the dispute deposit + token.approve(address(disputeManager), disputeDeposit); + + bytes32 expectedDisputeId1 = keccak256( + abi.encodePacked( + beforeValues.attestation1.requestCID, + beforeValues.attestation1.responseCID, + beforeValues.attestation1.subgraphDeploymentId, + beforeValues.indexer1, + fisherman + ) + ); + bytes32 expectedDisputeId2 = keccak256( + abi.encodePacked( + beforeValues.attestation2.requestCID, + beforeValues.attestation2.responseCID, + beforeValues.attestation2.subgraphDeploymentId, + beforeValues.indexer2, + fisherman + ) + ); + + uint256 cancellableAt = block.timestamp + disputeManager.disputePeriod(); + + // createQueryDisputeConflict + vm.expectEmit(address(disputeManager)); + emit IDisputeManager.QueryDisputeCreated( + expectedDisputeId1, + beforeValues.indexer1, + fisherman, + disputeDeposit / 2, + beforeValues.attestation1.subgraphDeploymentId, + attestationData1, + cancellableAt, + beforeValues.stakeSnapshot1 + ); + vm.expectEmit(address(disputeManager)); + emit IDisputeManager.QueryDisputeCreated( + expectedDisputeId2, + beforeValues.indexer2, + fisherman, + disputeDeposit / 2, + beforeValues.attestation2.subgraphDeploymentId, + attestationData2, + cancellableAt, + beforeValues.stakeSnapshot2 + ); + + (bytes32 _disputeId1, bytes32 _disputeId2) = disputeManager.createQueryDisputeConflict( + attestationData1, + attestationData2 + ); + + // Check that the disputes were created and that they have the correct IDs + assertTrue(disputeManager.isDisputeCreated(_disputeId1), "Dispute 1 should be created."); + assertTrue(disputeManager.isDisputeCreated(_disputeId2), "Dispute 2 should be created."); + assertEq(expectedDisputeId1, _disputeId1, "Dispute 1 ID should match"); + assertEq(expectedDisputeId2, _disputeId2, "Dispute 2 ID should match"); + + // Check dispute values + IDisputeManager.Dispute memory dispute1 = _getDispute(_disputeId1); + assertEq(dispute1.indexer, beforeValues.indexer1, "Indexer 1 should match"); + assertEq(dispute1.fisherman, fisherman, "Fisherman 1 should match"); + assertEq(dispute1.deposit, disputeDeposit / 2, "Deposit 1 should match"); + assertEq(dispute1.relatedDisputeId, _disputeId2, "Related dispute ID 1 should be the id of the other dispute"); + assertEq( + uint8(dispute1.disputeType), + uint8(IDisputeManager.DisputeType.QueryDispute), + "Dispute type 1 should be query" + ); + assertEq( + uint8(dispute1.status), + uint8(IDisputeManager.DisputeStatus.Pending), + "Dispute status 1 should be pending" + ); + assertEq(dispute1.createdAt, block.timestamp, "Created at 1 should match"); + assertEq(dispute1.stakeSnapshot, beforeValues.stakeSnapshot1, "Stake snapshot 1 should match"); + + IDisputeManager.Dispute memory dispute2 = _getDispute(_disputeId2); + assertEq(dispute2.indexer, beforeValues.indexer2, "Indexer 2 should match"); + assertEq(dispute2.fisherman, fisherman, "Fisherman 2 should match"); + assertEq(dispute2.deposit, disputeDeposit / 2, "Deposit 2 should match"); + assertEq(dispute2.relatedDisputeId, _disputeId1, "Related dispute ID 2 should be the id of the other dispute"); + assertEq( + uint8(dispute2.disputeType), + uint8(IDisputeManager.DisputeType.QueryDispute), + "Dispute type 2 should be query" + ); + assertEq( + uint8(dispute2.status), + uint8(IDisputeManager.DisputeStatus.Pending), + "Dispute status 2 should be pending" + ); + assertEq(dispute2.createdAt, block.timestamp, "Created at 2 should match"); + assertEq(dispute2.stakeSnapshot, beforeValues.stakeSnapshot2, "Stake snapshot 2 should match"); + + // Check that the fisherman was charged the dispute deposit + uint256 afterFishermanBalance = token.balanceOf(fisherman); + assertEq( + afterFishermanBalance, + beforeFishermanBalance - disputeDeposit, + "Fisherman should be charged the dispute deposit" + ); + + return (_disputeId1, _disputeId2); + } + + function _acceptDispute(bytes32 _disputeId, uint256 _tokensSlash) internal { + IDisputeManager.Dispute memory dispute = _getDispute(_disputeId); + address fisherman = dispute.fisherman; + uint256 fishermanPreviousBalance = token.balanceOf(fisherman); + uint256 indexerTokensAvailable = staking.getProviderTokensAvailable(dispute.indexer, address(subgraphService)); + uint256 disputeDeposit = dispute.deposit; + uint256 fishermanReward; + { + uint32 provisionMaxVerifierCut = staking + .getProvision(dispute.indexer, address(subgraphService)) + .maxVerifierCut; + uint256 fishermanRewardPercentage = MathUtils.min( + disputeManager.fishermanRewardCut(), + provisionMaxVerifierCut + ); + fishermanReward = _tokensSlash.mulPPM(fishermanRewardPercentage); + } + + vm.expectEmit(address(disputeManager)); + emit IDisputeManager.DisputeAccepted( + _disputeId, + dispute.indexer, + dispute.fisherman, + dispute.deposit + fishermanReward + ); + + // Accept the dispute + disputeManager.acceptDispute(_disputeId, _tokensSlash); + + // Check fisherman's got their reward and their deposit (if any) back + uint256 fishermanExpectedBalance = fishermanPreviousBalance + fishermanReward + disputeDeposit; + assertEq( + token.balanceOf(fisherman), + fishermanExpectedBalance, + "Fisherman should get their reward and deposit back" + ); + + // Check indexer was slashed by the correct amount + uint256 expectedIndexerTokensAvailable; + if (_tokensSlash > indexerTokensAvailable) { + expectedIndexerTokensAvailable = 0; + } else { + expectedIndexerTokensAvailable = indexerTokensAvailable - _tokensSlash; + } + assertEq( + staking.getProviderTokensAvailable(dispute.indexer, address(subgraphService)), + expectedIndexerTokensAvailable, + "Indexer should be slashed by the correct amount" + ); + + // Check dispute status + dispute = _getDispute(_disputeId); + assertEq( + uint8(dispute.status), + uint8(IDisputeManager.DisputeStatus.Accepted), + "Dispute status should be accepted" + ); + } + + struct FishermanParams { + address fisherman; + uint256 previousBalance; + uint256 disputeDeposit; + uint256 relatedDisputeDeposit; + uint256 rewardPercentage; + uint256 rewardFirstDispute; + uint256 rewardRelatedDispute; + uint256 totalReward; + uint256 expectedBalance; + } + + function _acceptDisputeConflict( + bytes32 _disputeId, + uint256 _tokensSlash, + bool _acceptRelatedDispute, + uint256 _tokensRelatedSlash + ) internal { + IDisputeManager.Dispute memory dispute = _getDispute(_disputeId); + IDisputeManager.Dispute memory relatedDispute = _getDispute(dispute.relatedDisputeId); + uint256 indexerTokensAvailable = staking.getProviderTokensAvailable(dispute.indexer, address(subgraphService)); + uint256 relatedIndexerTokensAvailable = staking.getProviderTokensAvailable( + relatedDispute.indexer, + address(subgraphService) + ); + + FishermanParams memory params; + params.fisherman = dispute.fisherman; + params.previousBalance = token.balanceOf(params.fisherman); + params.disputeDeposit = dispute.deposit; + params.relatedDisputeDeposit = relatedDispute.deposit; + params.rewardPercentage = disputeManager.fishermanRewardCut(); + params.rewardFirstDispute = _tokensSlash.mulPPM(params.rewardPercentage); + params.rewardRelatedDispute = (_acceptRelatedDispute) ? _tokensRelatedSlash.mulPPM(params.rewardPercentage) : 0; + params.totalReward = params.rewardFirstDispute + params.rewardRelatedDispute; + + vm.expectEmit(address(disputeManager)); + emit IDisputeManager.DisputeAccepted( + _disputeId, + dispute.indexer, + params.fisherman, + params.disputeDeposit + params.rewardFirstDispute + ); + + if (_acceptRelatedDispute) { + emit IDisputeManager.DisputeAccepted( + dispute.relatedDisputeId, + relatedDispute.indexer, + relatedDispute.fisherman, + relatedDispute.deposit + params.rewardRelatedDispute + ); + } else { + emit IDisputeManager.DisputeDrawn( + dispute.relatedDisputeId, + relatedDispute.indexer, + relatedDispute.fisherman, + relatedDispute.deposit + ); + } + + // Accept the dispute + disputeManager.acceptDisputeConflict(_disputeId, _tokensSlash, _acceptRelatedDispute, _tokensRelatedSlash); + + // Check fisherman's got their reward and their deposit back + params.expectedBalance = + params.previousBalance + + params.totalReward + + params.disputeDeposit + + params.relatedDisputeDeposit; + assertEq( + token.balanceOf(params.fisherman), + params.expectedBalance, + "Fisherman should get their reward and deposit back" + ); + + // If both disputes are for the same indexer, check that the indexer was slashed by the correct amount + if (dispute.indexer == relatedDispute.indexer) { + uint256 tokensToSlash = (_acceptRelatedDispute) ? _tokensSlash + _tokensRelatedSlash : _tokensSlash; + uint256 expectedIndexerTokensAvailable; + if (tokensToSlash > indexerTokensAvailable) { + expectedIndexerTokensAvailable = 0; + } else { + expectedIndexerTokensAvailable = indexerTokensAvailable - tokensToSlash; + } + assertEq( + staking.getProviderTokensAvailable(dispute.indexer, address(subgraphService)), + expectedIndexerTokensAvailable, + "Indexer should be slashed by the correct amount" + ); + } else { + // Check indexer for first dispute was slashed by the correct amount + uint256 expectedIndexerTokensAvailable; + uint256 tokensToSlash = (_acceptRelatedDispute) ? _tokensSlash : _tokensSlash; + if (tokensToSlash > indexerTokensAvailable) { + expectedIndexerTokensAvailable = 0; + } else { + expectedIndexerTokensAvailable = indexerTokensAvailable - tokensToSlash; + } + assertEq( + staking.getProviderTokensAvailable(dispute.indexer, address(subgraphService)), + expectedIndexerTokensAvailable, + "Indexer should be slashed by the correct amount" + ); + + // Check indexer for related dispute was slashed by the correct amount if it was accepted + if (_acceptRelatedDispute) { + uint256 expectedRelatedIndexerTokensAvailable; + if (_tokensRelatedSlash > relatedIndexerTokensAvailable) { + expectedRelatedIndexerTokensAvailable = 0; + } else { + expectedRelatedIndexerTokensAvailable = relatedIndexerTokensAvailable - _tokensRelatedSlash; + } + assertEq( + staking.getProviderTokensAvailable(relatedDispute.indexer, address(subgraphService)), + expectedRelatedIndexerTokensAvailable, + "Indexer should be slashed by the correct amount" + ); + } + } + + // Check dispute status + dispute = _getDispute(_disputeId); + assertEq( + uint8(dispute.status), + uint8(IDisputeManager.DisputeStatus.Accepted), + "Dispute status should be accepted" + ); + + // If there's a related dispute, check it + relatedDispute = _getDispute(dispute.relatedDisputeId); + assertEq( + uint8(relatedDispute.status), + _acceptRelatedDispute + ? uint8(IDisputeManager.DisputeStatus.Accepted) + : uint8(IDisputeManager.DisputeStatus.Drawn), + "Related dispute status should be drawn" + ); + } + + function _drawDispute(bytes32 _disputeId) internal { + IDisputeManager.Dispute memory dispute = _getDispute(_disputeId); + bool isConflictingDispute = dispute.relatedDisputeId != bytes32(0); + IDisputeManager.Dispute memory relatedDispute; + if (isConflictingDispute) relatedDispute = _getDispute(dispute.relatedDisputeId); + address fisherman = dispute.fisherman; + uint256 fishermanPreviousBalance = token.balanceOf(fisherman); + uint256 indexerTokensAvailable = staking.getProviderTokensAvailable(dispute.indexer, address(subgraphService)); + + vm.expectEmit(address(disputeManager)); + emit IDisputeManager.DisputeDrawn(_disputeId, dispute.indexer, dispute.fisherman, dispute.deposit); + + if (isConflictingDispute) { + emit IDisputeManager.DisputeDrawn( + dispute.relatedDisputeId, + relatedDispute.indexer, + relatedDispute.fisherman, + relatedDispute.deposit + ); + } + // Draw the dispute + disputeManager.drawDispute(_disputeId); + + // Check that the fisherman got their deposit back + uint256 fishermanExpectedBalance = fishermanPreviousBalance + + dispute.deposit + + (isConflictingDispute ? relatedDispute.deposit : 0); + assertEq(token.balanceOf(fisherman), fishermanExpectedBalance, "Fisherman should receive their deposit back."); + + // Check that indexer was not slashed + assertEq( + staking.getProviderTokensAvailable(dispute.indexer, address(subgraphService)), + indexerTokensAvailable, + "Indexer should not be slashed" + ); + + // Check dispute status + dispute = _getDispute(_disputeId); + assertEq(uint8(dispute.status), uint8(IDisputeManager.DisputeStatus.Drawn), "Dispute status should be drawn"); + + // If there's a related dispute, check that it was drawn too + if (dispute.relatedDisputeId != bytes32(0)) { + relatedDispute = _getDispute(dispute.relatedDisputeId); + assertEq( + uint8(relatedDispute.status), + uint8(IDisputeManager.DisputeStatus.Drawn), + "Related dispute status should be drawn" + ); + } + } + + function _rejectDispute(bytes32 _disputeId) internal { + IDisputeManager.Dispute memory dispute = _getDispute(_disputeId); + address fisherman = dispute.fisherman; + uint256 fishermanPreviousBalance = token.balanceOf(fisherman); + uint256 indexerTokensAvailable = staking.getProviderTokensAvailable(dispute.indexer, address(subgraphService)); + + vm.expectEmit(address(disputeManager)); + emit IDisputeManager.DisputeRejected(_disputeId, dispute.indexer, dispute.fisherman, dispute.deposit); + + // Reject the dispute + disputeManager.rejectDispute(_disputeId); + + // Check that the fisherman didn't get their deposit back + assertEq(token.balanceOf(users.fisherman), fishermanPreviousBalance, "Fisherman should lose the deposit."); + + // Check that indexer was not slashed + assertEq( + staking.getProviderTokensAvailable(dispute.indexer, address(subgraphService)), + indexerTokensAvailable, + "Indexer should not be slashed" + ); + + // Check dispute status + dispute = _getDispute(_disputeId); + assertEq( + uint8(dispute.status), + uint8(IDisputeManager.DisputeStatus.Rejected), + "Dispute status should be rejected" + ); + // Checl related id is empty + assertEq(dispute.relatedDisputeId, bytes32(0), "Related dispute ID should be empty"); + } + + function _cancelDispute(bytes32 _disputeId) internal { + IDisputeManager.Dispute memory dispute = _getDispute(_disputeId); + bool isDisputeInConflict = dispute.relatedDisputeId != bytes32(0); + IDisputeManager.Dispute memory relatedDispute; + if (isDisputeInConflict) relatedDispute = _getDispute(dispute.relatedDisputeId); + address fisherman = dispute.fisherman; + uint256 fishermanPreviousBalance = token.balanceOf(fisherman); + uint256 indexerTokensAvailable = staking.getProviderTokensAvailable(dispute.indexer, address(subgraphService)); + + vm.expectEmit(address(disputeManager)); + emit IDisputeManager.DisputeCancelled(_disputeId, dispute.indexer, dispute.fisherman, dispute.deposit); + + if (isDisputeInConflict) { + emit IDisputeManager.DisputeCancelled( + dispute.relatedDisputeId, + relatedDispute.indexer, + relatedDispute.fisherman, + relatedDispute.deposit + ); + } + + // Cancel the dispute + disputeManager.cancelDispute(_disputeId); + + // Check that the fisherman got their deposit back + uint256 fishermanExpectedBalance = fishermanPreviousBalance + + dispute.deposit + + (isDisputeInConflict ? relatedDispute.deposit : 0); + assertEq( + token.balanceOf(users.fisherman), + fishermanExpectedBalance, + "Fisherman should receive their deposit back." + ); + + // Check that indexer was not slashed + assertEq( + staking.getProviderTokensAvailable(dispute.indexer, address(subgraphService)), + indexerTokensAvailable, + "Indexer should not be slashed" + ); + + // Check dispute status + dispute = _getDispute(_disputeId); + assertEq( + uint8(dispute.status), + uint8(IDisputeManager.DisputeStatus.Cancelled), + "Dispute status should be cancelled" + ); + + if (isDisputeInConflict) { + relatedDispute = _getDispute(dispute.relatedDisputeId); + assertEq( + uint8(relatedDispute.status), + uint8(IDisputeManager.DisputeStatus.Cancelled), + "Related dispute status should be cancelled" + ); + } + } + + /* + * HELPERS + */ + + function _createAttestationReceipt( + bytes32 requestCID, + bytes32 responseCID, + bytes32 subgraphDeploymentId + ) internal pure returns (Attestation.Receipt memory receipt) { + return + Attestation.Receipt({ + requestCID: requestCID, + responseCID: responseCID, + subgraphDeploymentId: subgraphDeploymentId + }); + } + + function _createConflictingAttestations( + bytes32 requestCID, + bytes32 subgraphDeploymentId, + bytes32 responseCID1, + bytes32 responseCID2, + uint256 signer1, + uint256 signer2 + ) internal view returns (bytes memory attestationData1, bytes memory attestationData2) { + Attestation.Receipt memory receipt1 = _createAttestationReceipt(requestCID, responseCID1, subgraphDeploymentId); + Attestation.Receipt memory receipt2 = _createAttestationReceipt(requestCID, responseCID2, subgraphDeploymentId); + + bytes memory _attestationData1 = _createAtestationData(receipt1, signer1); + bytes memory _attestationData2 = _createAtestationData(receipt2, signer2); + return (_attestationData1, _attestationData2); + } + + function _createAtestationData( + Attestation.Receipt memory receipt, + uint256 signer + ) internal view returns (bytes memory attestationData) { + bytes32 digest = disputeManager.encodeReceipt(receipt); + (uint8 v, bytes32 r, bytes32 s) = vm.sign(signer, digest); + + return abi.encodePacked(receipt.requestCID, receipt.responseCID, receipt.subgraphDeploymentId, r, s, v); + } + + /* + * PRIVATE FUNCTIONS + */ + + function _getDispute(bytes32 _disputeId) internal view returns (IDisputeManager.Dispute memory) { + ( + address indexer, + address fisherman, + uint256 deposit, + bytes32 relatedDisputeId, + IDisputeManager.DisputeType disputeType, + IDisputeManager.DisputeStatus status, + uint256 createdAt, + uint256 cancellableAt, + uint256 stakeSnapshot + ) = disputeManager.disputes(_disputeId); + return + IDisputeManager.Dispute({ + indexer: indexer, + fisherman: fisherman, + deposit: deposit, + relatedDisputeId: relatedDisputeId, + disputeType: disputeType, + status: status, + createdAt: createdAt, + cancellableAt: cancellableAt, + stakeSnapshot: stakeSnapshot + }); + } + + function _setStorage_SubgraphService(address _subgraphService) internal { + vm.store(address(disputeManager), bytes32(uint256(51)), bytes32(uint256(uint160(_subgraphService)))); + } +} diff --git a/packages/subgraph-service/test/unit/disputeManager/constructor/constructor.t.sol b/packages/subgraph-service/test/unit/disputeManager/constructor/constructor.t.sol new file mode 100644 index 000000000..d157b8fef --- /dev/null +++ b/packages/subgraph-service/test/unit/disputeManager/constructor/constructor.t.sol @@ -0,0 +1,176 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { PPMMath } from "@graphprotocol/horizon/contracts/libraries/PPMMath.sol"; +import { GraphDirectory } from "@graphprotocol/horizon/contracts/utilities/GraphDirectory.sol"; +import { UnsafeUpgrades } from "openzeppelin-foundry-upgrades/Upgrades.sol"; +import { DisputeManager } from "../../../../contracts/DisputeManager.sol"; +import { DisputeManagerTest } from "../DisputeManager.t.sol"; +import { IDisputeManager } from "../../../../contracts/interfaces/IDisputeManager.sol"; + +contract DisputeManagerConstructorTest is DisputeManagerTest { + using PPMMath for uint256; + + /* + * MODIFIERS + */ + + modifier useDeployer() { + vm.startPrank(users.deployer); + _; + vm.stopPrank(); + } + + /* + * HELPERS + */ + + function _initializeDisputeManager( + address implementation, + address arbitrator, + uint64 disputePeriod, + uint256 disputeDeposit, + uint32 fishermanRewardPercentage, + uint32 maxSlashingPercentage + ) private returns (address) { + return + UnsafeUpgrades.deployTransparentProxy( + implementation, + users.governor, + abi.encodeCall( + DisputeManager.initialize, + ( + users.deployer, + arbitrator, + disputePeriod, + disputeDeposit, + fishermanRewardPercentage, + maxSlashingPercentage + ) + ) + ); + } + + /* + * TESTS + */ + + function test_DisputeManager_Constructor( + uint32 fishermanRewardPercentage, + uint32 maxSlashingPercentage + ) public useDeployer { + vm.assume(fishermanRewardPercentage <= disputeManager.MAX_FISHERMAN_REWARD_CUT()); + vm.assume(maxSlashingPercentage <= PPMMath.MAX_PPM); + address disputeManagerImplementation = address(new DisputeManager(address(controller))); + address proxy = _initializeDisputeManager( + disputeManagerImplementation, + users.arbitrator, + disputePeriod, + disputeDeposit, + fishermanRewardPercentage, + maxSlashingPercentage + ); + + DisputeManager disputeManager = DisputeManager(proxy); + assertEq(disputeManager.arbitrator(), users.arbitrator); + assertEq(disputeManager.disputePeriod(), disputePeriod); + assertEq(disputeManager.disputeDeposit(), disputeDeposit); + assertEq(disputeManager.fishermanRewardCut(), fishermanRewardPercentage); + } + + function test_DisputeManager_Constructor_RevertIf_ControllerAddressIsZero() public useDeployer { + bytes memory expectedError = abi.encodeWithSelector( + GraphDirectory.GraphDirectoryInvalidZeroAddress.selector, + "Controller" + ); + vm.expectRevert(expectedError); + new DisputeManager(address(0)); + } + + function test_DisputeManager_Constructor_RevertIf_ArbitratorAddressIsZero() public useDeployer { + address disputeManagerImplementation = address(new DisputeManager(address(controller))); + bytes memory expectedError = abi.encodeWithSelector(IDisputeManager.DisputeManagerInvalidZeroAddress.selector); + vm.expectRevert(expectedError); + _initializeDisputeManager( + disputeManagerImplementation, + address(0), + disputePeriod, + disputeDeposit, + fishermanRewardPercentage, + maxSlashingPercentage + ); + } + + function test_DisputeManager_Constructor_RevertIf_InvalidDisputePeriod() public useDeployer { + address disputeManagerImplementation = address(new DisputeManager(address(controller))); + bytes memory expectedError = abi.encodeWithSelector(IDisputeManager.DisputeManagerDisputePeriodZero.selector); + vm.expectRevert(expectedError); + _initializeDisputeManager( + disputeManagerImplementation, + users.arbitrator, + 0, + disputeDeposit, + fishermanRewardPercentage, + maxSlashingPercentage + ); + } + + function test_DisputeManager_Constructor_RevertIf_InvalidDisputeDeposit() public useDeployer { + address disputeManagerImplementation = address(new DisputeManager(address(controller))); + bytes memory expectedError = abi.encodeWithSelector( + IDisputeManager.DisputeManagerInvalidDisputeDeposit.selector, + 0 + ); + vm.expectRevert(expectedError); + _initializeDisputeManager( + disputeManagerImplementation, + users.arbitrator, + disputePeriod, + 0, + fishermanRewardPercentage, + maxSlashingPercentage + ); + } + + function test_DisputeManager_Constructor_RevertIf_InvalidFishermanRewardPercentage( + uint32 _fishermanRewardPercentage + ) public useDeployer { + vm.assume(_fishermanRewardPercentage > disputeManager.MAX_FISHERMAN_REWARD_CUT()); + address disputeManagerImplementation = address(new DisputeManager(address(controller))); + bytes memory expectedError = abi.encodeWithSelector( + IDisputeManager.DisputeManagerInvalidFishermanReward.selector, + _fishermanRewardPercentage + ); + vm.expectRevert(expectedError); + _initializeDisputeManager( + disputeManagerImplementation, + users.arbitrator, + disputePeriod, + disputeDeposit, + _fishermanRewardPercentage, + maxSlashingPercentage + ); + } + + function test_DisputeManager_Constructor_RevertIf_InvalidMaxSlashingPercentage( + uint32 _maxSlashingPercentage + ) public useDeployer { + vm.assume(_maxSlashingPercentage > PPMMath.MAX_PPM); + address disputeManagerImplementation = address(new DisputeManager(address(controller))); + bytes memory expectedError = abi.encodeWithSelector( + IDisputeManager.DisputeManagerInvalidMaxSlashingCut.selector, + _maxSlashingPercentage + ); + vm.expectRevert(expectedError); + _initializeDisputeManager( + disputeManagerImplementation, + users.arbitrator, + disputePeriod, + disputeDeposit, + fishermanRewardPercentage, + _maxSlashingPercentage + ); + } +} diff --git a/packages/subgraph-service/test/unit/disputeManager/disputes/disputes.t.sol b/packages/subgraph-service/test/unit/disputeManager/disputes/disputes.t.sol new file mode 100644 index 000000000..71d40e055 --- /dev/null +++ b/packages/subgraph-service/test/unit/disputeManager/disputes/disputes.t.sol @@ -0,0 +1,58 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { PPMMath } from "@graphprotocol/horizon/contracts/libraries/PPMMath.sol"; +import { IDisputeManager } from "../../../../contracts/interfaces/IDisputeManager.sol"; +import { DisputeManagerTest } from "../DisputeManager.t.sol"; + +contract DisputeManagerDisputeTest is DisputeManagerTest { + using PPMMath for uint256; + + /* + * TESTS + */ + + function test_Dispute_Accept_RevertIf_DisputeDoesNotExist( + uint256 tokens, + uint256 tokensSlash + ) public useIndexer useAllocation(tokens) { + tokensSlash = bound(tokensSlash, 1, uint256(maxSlashingPercentage).mulPPM(tokens)); + + bytes32 disputeID = bytes32("0x0"); + + resetPrank(users.arbitrator); + vm.expectRevert(abi.encodeWithSelector(IDisputeManager.DisputeManagerInvalidDispute.selector, disputeID)); + disputeManager.acceptDispute(disputeID, tokensSlash); + } + + function test_Dispute_Accept_RevertIf_SlashZeroTokens(uint256 tokens) public useIndexer useAllocation(tokens) { + resetPrank(users.fisherman); + bytes32 disputeID = _createIndexingDispute(allocationID, bytes32("POI101")); + + // attempt to accept dispute with 0 tokens slashed + resetPrank(users.arbitrator); + uint256 maxTokensToSlash = uint256(maxSlashingPercentage).mulPPM(tokens); + vm.expectRevert( + abi.encodeWithSelector(IDisputeManager.DisputeManagerInvalidTokensSlash.selector, 0, maxTokensToSlash) + ); + disputeManager.acceptDispute(disputeID, 0); + } + + function test_Dispute_Reject_RevertIf_DisputeDoesNotExist(uint256 tokens) public useIndexer useAllocation(tokens) { + bytes32 disputeID = bytes32("0x0"); + + resetPrank(users.arbitrator); + vm.expectRevert(abi.encodeWithSelector(IDisputeManager.DisputeManagerInvalidDispute.selector, disputeID)); + disputeManager.rejectDispute(disputeID); + } + + function test_Dispute_Draw_RevertIf_DisputeDoesNotExist(uint256 tokens) public useIndexer useAllocation(tokens) { + bytes32 disputeID = bytes32("0x0"); + + resetPrank(users.arbitrator); + vm.expectRevert(abi.encodeWithSelector(IDisputeManager.DisputeManagerInvalidDispute.selector, disputeID)); + disputeManager.drawDispute(disputeID); + } +} diff --git a/packages/subgraph-service/test/unit/disputeManager/disputes/indexing/accept.t.sol b/packages/subgraph-service/test/unit/disputeManager/disputes/indexing/accept.t.sol new file mode 100644 index 000000000..e06f105b8 --- /dev/null +++ b/packages/subgraph-service/test/unit/disputeManager/disputes/indexing/accept.t.sol @@ -0,0 +1,91 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { PPMMath } from "@graphprotocol/horizon/contracts/libraries/PPMMath.sol"; +import { IDisputeManager } from "../../../../../contracts/interfaces/IDisputeManager.sol"; +import { DisputeManagerTest } from "../../DisputeManager.t.sol"; + +contract DisputeManagerIndexingAcceptDisputeTest is DisputeManagerTest { + using PPMMath for uint256; + + /* + * TESTS + */ + + function test_Indexing_Accept_Dispute(uint256 tokens, uint256 tokensSlash) public useIndexer useAllocation(tokens) { + tokensSlash = bound(tokensSlash, 1, uint256(maxSlashingPercentage).mulPPM(tokens)); + + resetPrank(users.fisherman); + bytes32 disputeID = _createIndexingDispute(allocationID, bytes32("POI1")); + + resetPrank(users.arbitrator); + _acceptDispute(disputeID, tokensSlash); + } + + function test_Indexing_Accept_Dispute_RevertWhen_SubgraphServiceNotSet( + uint256 tokens, + uint256 tokensSlash + ) public useIndexer useAllocation(tokens) { + tokensSlash = bound(tokensSlash, 1, uint256(maxSlashingPercentage).mulPPM(tokens)); + + resetPrank(users.fisherman); + bytes32 disputeID = _createIndexingDispute(allocationID, bytes32("POI1")); + + resetPrank(users.arbitrator); + // clear subgraph service address from storage + _setStorage_SubgraphService(address(0)); + + vm.expectRevert(abi.encodeWithSelector(IDisputeManager.DisputeManagerSubgraphServiceNotSet.selector)); + disputeManager.acceptDispute(disputeID, tokensSlash); + } + + function test_Indexing_Accept_Dispute_OptParam( + uint256 tokens, + uint256 tokensSlash + ) public useIndexer useAllocation(tokens) { + tokensSlash = bound(tokensSlash, 1, uint256(maxSlashingPercentage).mulPPM(tokens)); + + resetPrank(users.fisherman); + bytes32 disputeID = _createIndexingDispute(allocationID, bytes32("POI1")); + + resetPrank(users.arbitrator); + _acceptDispute(disputeID, tokensSlash); + } + + function test_Indexing_Accept_RevertIf_CallerIsNotArbitrator( + uint256 tokens, + uint256 tokensSlash + ) public useIndexer useAllocation(tokens) { + tokensSlash = bound(tokensSlash, 1, uint256(maxSlashingPercentage).mulPPM(tokens)); + + resetPrank(users.fisherman); + bytes32 disputeID = _createIndexingDispute(allocationID, bytes32("POI1")); + + // attempt to accept dispute as fisherman + resetPrank(users.fisherman); + vm.expectRevert(abi.encodeWithSelector(IDisputeManager.DisputeManagerNotArbitrator.selector)); + disputeManager.acceptDispute(disputeID, tokensSlash); + } + + function test_Indexing_Accept_RevertWhen_SlashingOverMaxSlashPercentage( + uint256 tokens, + uint256 tokensSlash + ) public useIndexer useAllocation(tokens) { + resetPrank(users.fisherman); + tokensSlash = bound(tokensSlash, uint256(maxSlashingPercentage).mulPPM(tokens) + 1, type(uint256).max); + bytes32 disputeID = _createIndexingDispute(allocationID, bytes32("POI101")); + + // max slashing percentage is 50% + resetPrank(users.arbitrator); + uint256 maxTokensToSlash = uint256(maxSlashingPercentage).mulPPM(tokens); + bytes memory expectedError = abi.encodeWithSelector( + IDisputeManager.DisputeManagerInvalidTokensSlash.selector, + tokensSlash, + maxTokensToSlash + ); + vm.expectRevert(expectedError); + disputeManager.acceptDispute(disputeID, tokensSlash); + } +} diff --git a/packages/subgraph-service/test/unit/disputeManager/disputes/indexing/cancel.t.sol b/packages/subgraph-service/test/unit/disputeManager/disputes/indexing/cancel.t.sol new file mode 100644 index 000000000..8b8e0f587 --- /dev/null +++ b/packages/subgraph-service/test/unit/disputeManager/disputes/indexing/cancel.t.sol @@ -0,0 +1,80 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { IDisputeManager } from "../../../../../contracts/interfaces/IDisputeManager.sol"; +import { DisputeManagerTest } from "../../DisputeManager.t.sol"; + +contract DisputeManagerIndexingCancelDisputeTest is DisputeManagerTest { + /* + * TESTS + */ + + function test_Indexing_Cancel_Dispute(uint256 tokens) public useIndexer useAllocation(tokens) { + resetPrank(users.fisherman); + bytes32 disputeID = _createIndexingDispute(allocationID, bytes32("POI1")); + + // skip to end of dispute period + uint256 disputePeriod = disputeManager.disputePeriod(); + skip(disputePeriod + 1); + + _cancelDispute(disputeID); + } + + function test_Indexing_Cancel_RevertIf_CallerIsNotFisherman( + uint256 tokens + ) public useIndexer useAllocation(tokens) { + resetPrank(users.fisherman); + bytes32 disputeID = _createIndexingDispute(allocationID, bytes32("POI1")); + + resetPrank(users.arbitrator); + vm.expectRevert(abi.encodeWithSelector(IDisputeManager.DisputeManagerNotFisherman.selector)); + disputeManager.cancelDispute(disputeID); + } + + function test_Indexing_Cancel_RevertIf_DisputePeriodNotOver( + uint256 tokens + ) public useIndexer useAllocation(tokens) { + resetPrank(users.fisherman); + bytes32 disputeID = _createIndexingDispute(allocationID, bytes32("POI1")); + + vm.expectRevert(abi.encodeWithSelector(IDisputeManager.DisputeManagerDisputePeriodNotFinished.selector)); + disputeManager.cancelDispute(disputeID); + } + + function test_Indexing_Cancel_After_DisputePeriodIncreased(uint256 tokens) public useIndexer useAllocation(tokens) { + resetPrank(users.fisherman); + bytes32 disputeID = _createIndexingDispute(allocationID, bytes32("POI1")); + + // change the dispute period to a higher value + uint256 oldDisputePeriod = disputeManager.disputePeriod(); + resetPrank(users.governor); + disputeManager.setDisputePeriod(uint64(oldDisputePeriod * 2)); + + // skip to end of old dispute period + skip(oldDisputePeriod + 1); + + // should be able to cancel + resetPrank(users.fisherman); + _cancelDispute(disputeID); + } + + function test_Indexing_Cancel_After_DisputePeriodDecreased(uint256 tokens) public useIndexer useAllocation(tokens) { + resetPrank(users.fisherman); + bytes32 disputeID = _createIndexingDispute(allocationID, bytes32("POI1")); + + // change the dispute period to a lower value + uint256 oldDisputePeriod = disputeManager.disputePeriod(); + resetPrank(users.governor); + disputeManager.setDisputePeriod(uint64(oldDisputePeriod / 2)); + + // skip to end of new dispute period + skip(oldDisputePeriod / 2 + 1); + + // should not be able to cancel + resetPrank(users.fisherman); + vm.expectRevert(abi.encodeWithSelector(IDisputeManager.DisputeManagerDisputePeriodNotFinished.selector)); + disputeManager.cancelDispute(disputeID); + } +} diff --git a/packages/subgraph-service/test/unit/disputeManager/disputes/indexing/create.t.sol b/packages/subgraph-service/test/unit/disputeManager/disputes/indexing/create.t.sol new file mode 100644 index 000000000..fdf803d5d --- /dev/null +++ b/packages/subgraph-service/test/unit/disputeManager/disputes/indexing/create.t.sol @@ -0,0 +1,148 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { IDisputeManager } from "../../../../../contracts/interfaces/IDisputeManager.sol"; +import { DisputeManagerTest } from "../../DisputeManager.t.sol"; + +contract DisputeManagerIndexingCreateDisputeTest is DisputeManagerTest { + /* + * TESTS + */ + + function test_Indexing_Create_Dispute(uint256 tokens) public useIndexer useAllocation(tokens) { + resetPrank(users.fisherman); + _createIndexingDispute(allocationID, bytes32("POI1")); + } + + function test_Indexing_Create_Dispute_WithDelegation(uint256 tokens, uint256 delegationTokens) public useIndexer { + vm.assume(tokens >= minimumProvisionTokens); + vm.assume(tokens < 100_000_000 ether); // set a low cap to test overdelegation + _createProvision(users.indexer, tokens, fishermanRewardPercentage, disputePeriod); + _register(users.indexer, abi.encode("url", "geoHash", address(0))); + bytes memory data = _createSubgraphAllocationData( + users.indexer, + subgraphDeployment, + allocationIDPrivateKey, + tokens + ); + _startService(users.indexer, data); + + uint256 delegationRatio = subgraphService.getDelegationRatio(); + delegationTokens = bound(delegationTokens, 1e18, tokens * delegationRatio * 2); // make sure we have overdelegation + + resetPrank(users.delegator); + token.approve(address(staking), delegationTokens); + staking.delegate(users.indexer, address(subgraphService), delegationTokens, 0); + + resetPrank(users.fisherman); + _createIndexingDispute(allocationID, bytes32("POI1")); + } + + function test_Indexing_Create_Dispute_RevertWhen_SubgraphServiceNotSet( + uint256 tokens + ) public useIndexer useAllocation(tokens) { + resetPrank(users.fisherman); + + // clear subgraph service address from storage + _setStorage_SubgraphService(address(0)); + + // // Approve the dispute deposit + token.approve(address(disputeManager), disputeDeposit); + + vm.expectRevert(abi.encodeWithSelector(IDisputeManager.DisputeManagerSubgraphServiceNotSet.selector)); + disputeManager.createIndexingDispute(allocationID, bytes32("POI2")); + } + + function test_Indexing_Create_MultipleDisputes() public { + uint256 tokens = 10000 ether; + uint8 numIndexers = 10; + uint256[] memory allocationIDPrivateKeys = new uint256[](numIndexers); + for (uint i = 0; i < numIndexers; i++) { + string memory indexerName = string(abi.encodePacked("Indexer ", i)); + address indexer = createUser(indexerName); + vm.assume(indexer != address(0)); + + resetPrank(indexer); + mint(indexer, tokens); + _createProvision(indexer, tokens, fishermanRewardPercentage, disputePeriod); + _register(indexer, abi.encode("url", "geoHash", address(0))); + uint256 allocationIDPrivateKey = uint256(keccak256(abi.encodePacked(i))); + bytes memory data = _createSubgraphAllocationData( + indexer, + subgraphDeployment, + allocationIDPrivateKey, + tokens + ); + _startService(indexer, data); + allocationIDPrivateKeys[i] = allocationIDPrivateKey; + } + + resetPrank(users.fisherman); + for (uint i = 0; i < allocationIDPrivateKeys.length; i++) { + _createIndexingDispute(vm.addr(allocationIDPrivateKeys[i]), bytes32("POI1")); + } + } + + function test_Indexing_Create_RevertWhen_DisputeAlreadyCreated( + uint256 tokens + ) public useIndexer useAllocation(tokens) { + resetPrank(users.fisherman); + bytes32 disputeID = _createIndexingDispute(allocationID, bytes32("POI1")); + + // Create another dispute with different fisherman + address otherFisherman = makeAddr("otherFisherman"); + resetPrank(otherFisherman); + mint(otherFisherman, disputeDeposit); + token.approve(address(disputeManager), disputeDeposit); + bytes memory expectedError = abi.encodeWithSelector( + IDisputeManager.DisputeManagerDisputeAlreadyCreated.selector, + disputeID + ); + vm.expectRevert(expectedError); + disputeManager.createIndexingDispute(allocationID, bytes32("POI1")); + vm.stopPrank(); + } + + function test_Indexing_Create_RevertIf_DepositUnderMinimum(uint256 tokensDeposit) public useFisherman { + tokensDeposit = bound(tokensDeposit, 0, disputeDeposit - 1); + token.approve(address(disputeManager), tokensDeposit); + bytes memory expectedError = abi.encodeWithSignature( + "ERC20InsufficientAllowance(address,uint256,uint256)", + address(disputeManager), + tokensDeposit, + disputeDeposit + ); + vm.expectRevert(expectedError); + disputeManager.createIndexingDispute(allocationID, bytes32("POI3")); + vm.stopPrank(); + } + + function test_Indexing_Create_RevertIf_AllocationDoesNotExist(uint256 tokens) public useFisherman { + tokens = bound(tokens, disputeDeposit, 10_000_000_000 ether); + token.approve(address(disputeManager), tokens); + bytes memory expectedError = abi.encodeWithSelector( + IDisputeManager.DisputeManagerIndexerNotFound.selector, + allocationID + ); + vm.expectRevert(expectedError); + disputeManager.createIndexingDispute(allocationID, bytes32("POI4")); + vm.stopPrank(); + } + + function test_Indexing_Create_RevertIf_IndexerIsBelowStake(uint256 tokens) public useIndexer useAllocation(tokens) { + // Close allocation + bytes memory data = abi.encode(allocationID); + _stopService(users.indexer, data); + // Thaw, deprovision and unstake + address subgraphDataServiceAddress = address(subgraphService); + _thawDeprovisionAndUnstake(users.indexer, subgraphDataServiceAddress, tokens); + + // Attempt to create dispute + resetPrank(users.fisherman); + token.approve(address(disputeManager), tokens); + vm.expectRevert(abi.encodeWithSelector(IDisputeManager.DisputeManagerZeroTokens.selector)); + disputeManager.createIndexingDispute(allocationID, bytes32("POI1")); + } +} diff --git a/packages/subgraph-service/test/unit/disputeManager/disputes/indexing/draw.t.sol b/packages/subgraph-service/test/unit/disputeManager/disputes/indexing/draw.t.sol new file mode 100644 index 000000000..62a384b52 --- /dev/null +++ b/packages/subgraph-service/test/unit/disputeManager/disputes/indexing/draw.t.sol @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { PPMMath } from "@graphprotocol/horizon/contracts/libraries/PPMMath.sol"; +import { IDisputeManager } from "../../../../../contracts/interfaces/IDisputeManager.sol"; +import { DisputeManagerTest } from "../../DisputeManager.t.sol"; + +contract DisputeManagerIndexingDrawDisputeTest is DisputeManagerTest { + /* + * TESTS + */ + + function test_Indexing_Draw_Dispute(uint256 tokens) public useIndexer useAllocation(tokens) { + resetPrank(users.fisherman); + bytes32 disputeID = _createIndexingDispute(allocationID, bytes32("POI32")); + + resetPrank(users.arbitrator); + _drawDispute(disputeID); + } + + function test_Indexing_Draw_RevertIf_CallerIsNotArbitrator(uint256 tokens) public useIndexer useAllocation(tokens) { + resetPrank(users.fisherman); + bytes32 disputeID = _createIndexingDispute(allocationID, bytes32("POI1")); + + // attempt to draw dispute as fisherman + vm.expectRevert(abi.encodeWithSelector(IDisputeManager.DisputeManagerNotArbitrator.selector)); + disputeManager.drawDispute(disputeID); + } +} diff --git a/packages/subgraph-service/test/unit/disputeManager/disputes/indexing/reject.t.sol b/packages/subgraph-service/test/unit/disputeManager/disputes/indexing/reject.t.sol new file mode 100644 index 000000000..a084bee14 --- /dev/null +++ b/packages/subgraph-service/test/unit/disputeManager/disputes/indexing/reject.t.sol @@ -0,0 +1,33 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { IDisputeManager } from "../../../../../contracts/interfaces/IDisputeManager.sol"; +import { DisputeManagerTest } from "../../DisputeManager.t.sol"; + +contract DisputeManagerIndexingRejectDisputeTest is DisputeManagerTest { + /* + * TESTS + */ + + function test_Indexing_Reject_Dispute(uint256 tokens) public useIndexer useAllocation(tokens) { + resetPrank(users.fisherman); + bytes32 disputeID = _createIndexingDispute(allocationID, bytes32("POI1")); + + resetPrank(users.arbitrator); + _rejectDispute(disputeID); + } + + function test_Indexing_Reject_RevertIf_CallerIsNotArbitrator( + uint256 tokens + ) public useIndexer useAllocation(tokens) { + resetPrank(users.fisherman); + bytes32 disputeID = _createIndexingDispute(allocationID, bytes32("POI1")); + + // attempt to accept dispute as fisherman + resetPrank(users.fisherman); + vm.expectRevert(abi.encodeWithSelector(IDisputeManager.DisputeManagerNotArbitrator.selector)); + disputeManager.rejectDispute(disputeID); + } +} diff --git a/packages/subgraph-service/test/unit/disputeManager/disputes/legacy.t.sol b/packages/subgraph-service/test/unit/disputeManager/disputes/legacy.t.sol new file mode 100644 index 000000000..417b8e7bd --- /dev/null +++ b/packages/subgraph-service/test/unit/disputeManager/disputes/legacy.t.sol @@ -0,0 +1,54 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { Attestation } from "../../../../contracts/libraries/Attestation.sol"; +import { PPMMath } from "@graphprotocol/horizon/contracts/libraries/PPMMath.sol"; +import { IDisputeManager } from "../../../../contracts/interfaces/IDisputeManager.sol"; +import { DisputeManagerTest } from "../DisputeManager.t.sol"; + +contract DisputeManagerLegacyDisputeTest is DisputeManagerTest { + using PPMMath for uint256; + + bytes32 private requestCID = keccak256(abi.encodePacked("Request CID")); + bytes32 private responseCID = keccak256(abi.encodePacked("Response CID")); + bytes32 private subgraphDeploymentId = keccak256(abi.encodePacked("Subgraph Deployment ID")); + + /* + * TESTS + */ + + function test_LegacyDispute( + uint256 tokensStaked, + uint256 tokensProvisioned, + uint256 tokensSlash, + uint256 tokensRewards + ) public { + vm.assume(tokensStaked <= MAX_TOKENS); + vm.assume(tokensStaked >= minimumProvisionTokens); + tokensProvisioned = bound(tokensProvisioned, minimumProvisionTokens, tokensStaked); + tokensSlash = bound(tokensSlash, 2, tokensProvisioned); + tokensRewards = bound(tokensRewards, 1, tokensSlash.mulPPM(fishermanRewardPercentage)); + + // setup indexer state + resetPrank(users.indexer); + _stake(tokensStaked); + _setStorage_allocation_hardcoded(users.indexer, allocationID, tokensStaked - tokensProvisioned); + _provision(users.indexer, tokensProvisioned, fishermanRewardPercentage, disputePeriod); + + resetPrank(users.arbitrator); + _createAndAcceptLegacyDispute(allocationID, users.fisherman, tokensSlash, tokensRewards); + } + + function test_LegacyDispute_RevertIf_NotArbitrator() public useIndexer { + vm.expectRevert(abi.encodeWithSelector(IDisputeManager.DisputeManagerNotArbitrator.selector)); + disputeManager.createAndAcceptLegacyDispute(allocationID, users.fisherman, 0, 0); + } + + function test_LegacyDispute_RevertIf_AllocationNotFound() public useIndexer { + resetPrank(users.arbitrator); + vm.expectRevert(abi.encodeWithSelector(IDisputeManager.DisputeManagerIndexerNotFound.selector, address(0))); + disputeManager.createAndAcceptLegacyDispute(address(0), users.fisherman, 0, 0); + } +} diff --git a/packages/subgraph-service/test/unit/disputeManager/disputes/query/accept.t.sol b/packages/subgraph-service/test/unit/disputeManager/disputes/query/accept.t.sol new file mode 100644 index 000000000..ed70b6bc9 --- /dev/null +++ b/packages/subgraph-service/test/unit/disputeManager/disputes/query/accept.t.sol @@ -0,0 +1,225 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { Attestation } from "../../../../../contracts/libraries/Attestation.sol"; +import { PPMMath } from "@graphprotocol/horizon/contracts/libraries/PPMMath.sol"; +import { IDisputeManager } from "../../../../../contracts/interfaces/IDisputeManager.sol"; +import { DisputeManagerTest } from "../../DisputeManager.t.sol"; + +contract DisputeManagerQueryAcceptDisputeTest is DisputeManagerTest { + using PPMMath for uint256; + + bytes32 private requestCID = keccak256(abi.encodePacked("Request CID")); + bytes32 private responseCID = keccak256(abi.encodePacked("Response CID")); + bytes32 private subgraphDeploymentId = keccak256(abi.encodePacked("Subgraph Deployment ID")); + + /* + * TESTS + */ + + function test_Query_Accept_Dispute(uint256 tokens, uint256 tokensSlash) public useIndexer useAllocation(tokens) { + tokensSlash = bound(tokensSlash, 1, uint256(maxSlashingPercentage).mulPPM(tokens)); + + resetPrank(users.fisherman); + Attestation.Receipt memory receipt = _createAttestationReceipt(requestCID, responseCID, subgraphDeploymentId); + bytes memory attestationData = _createAtestationData(receipt, allocationIDPrivateKey); + bytes32 disputeID = _createQueryDispute(attestationData); + + resetPrank(users.arbitrator); + _acceptDispute(disputeID, tokensSlash); + } + + function test_Query_Accept_Dispute_RevertWhen_SubgraphServiceNotSet( + uint256 tokens, + uint256 tokensSlash + ) public useIndexer useAllocation(tokens) { + tokensSlash = bound(tokensSlash, 1, uint256(maxSlashingPercentage).mulPPM(tokens)); + + resetPrank(users.fisherman); + Attestation.Receipt memory receipt = _createAttestationReceipt(requestCID, responseCID, subgraphDeploymentId); + bytes memory attestationData = _createAtestationData(receipt, allocationIDPrivateKey); + bytes32 disputeID = _createQueryDispute(attestationData); + + resetPrank(users.arbitrator); + // clear subgraph service address from storage + _setStorage_SubgraphService(address(0)); + vm.expectRevert(abi.encodeWithSelector(IDisputeManager.DisputeManagerSubgraphServiceNotSet.selector)); + disputeManager.acceptDispute(disputeID, tokensSlash); + } + + function test_Query_Accept_Dispute_OptParam( + uint256 tokens, + uint256 tokensSlash + ) public useIndexer useAllocation(tokens) { + tokensSlash = bound(tokensSlash, 1, uint256(maxSlashingPercentage).mulPPM(tokens)); + + resetPrank(users.fisherman); + Attestation.Receipt memory receipt = _createAttestationReceipt(requestCID, responseCID, subgraphDeploymentId); + bytes memory attestationData = _createAtestationData(receipt, allocationIDPrivateKey); + bytes32 disputeID = _createQueryDispute(attestationData); + + resetPrank(users.arbitrator); + _acceptDispute(disputeID, tokensSlash); + } + + function test_Query_Accept_RevertIf_CallerIsNotArbitrator( + uint256 tokens, + uint256 tokensSlash + ) public useIndexer useAllocation(tokens) { + tokensSlash = bound(tokensSlash, 1, uint256(maxSlashingPercentage).mulPPM(tokens)); + + resetPrank(users.fisherman); + Attestation.Receipt memory receipt = _createAttestationReceipt(requestCID, responseCID, subgraphDeploymentId); + bytes memory attestationData = _createAtestationData(receipt, allocationIDPrivateKey); + bytes32 disputeID = _createQueryDispute(attestationData); + + // attempt to accept dispute as fisherman + vm.expectRevert(abi.encodeWithSelector(IDisputeManager.DisputeManagerNotArbitrator.selector)); + disputeManager.acceptDispute(disputeID, tokensSlash); + } + + function test_Query_Accept_RevertWhen_SlashingOverMaxSlashPercentage( + uint256 tokens, + uint256 tokensSlash + ) public useIndexer useAllocation(tokens) { + tokensSlash = bound(tokensSlash, uint256(maxSlashingPercentage).mulPPM(tokens) + 1, type(uint256).max); + + resetPrank(users.fisherman); + Attestation.Receipt memory receipt = _createAttestationReceipt(requestCID, responseCID, subgraphDeploymentId); + bytes memory attestationData = _createAtestationData(receipt, allocationIDPrivateKey); + bytes32 disputeID = _createQueryDispute(attestationData); + + // max slashing percentage is 50% + resetPrank(users.arbitrator); + uint256 maxTokensToSlash = uint256(maxSlashingPercentage).mulPPM(tokens); + bytes memory expectedError = abi.encodeWithSelector( + IDisputeManager.DisputeManagerInvalidTokensSlash.selector, + tokensSlash, + maxTokensToSlash + ); + vm.expectRevert(expectedError); + disputeManager.acceptDispute(disputeID, tokensSlash); + } + + function test_Query_Accept_RevertWhen_UsingConflictAccept( + uint256 tokens, + uint256 tokensSlash + ) public useIndexer useAllocation(tokens) { + tokensSlash = bound(tokensSlash, 1, uint256(maxSlashingPercentage).mulPPM(tokens)); + + resetPrank(users.fisherman); + Attestation.Receipt memory receipt = _createAttestationReceipt(requestCID, responseCID, subgraphDeploymentId); + bytes memory attestationData = _createAtestationData(receipt, allocationIDPrivateKey); + bytes32 disputeID = _createQueryDispute(attestationData); + + resetPrank(users.arbitrator); + vm.expectRevert(abi.encodeWithSelector(IDisputeManager.DisputeManagerDisputeNotInConflict.selector, disputeID)); + disputeManager.acceptDisputeConflict(disputeID, tokensSlash, true, 0); + } + + function test_Query_Accept_RevertWhen_SlashingOverMaxSlashPercentage_WithDelegation( + uint256 tokens, + uint256 tokensDelegated, + uint256 tokensSlash + ) public useIndexer useAllocation(tokens) useDelegation(tokensDelegated) { + uint256 maxTokensToSlash = uint256(maxSlashingPercentage).mulPPM( + _calculateStakeSnapshot(tokens, tokensDelegated) + ); + tokensSlash = bound(tokensSlash, maxTokensToSlash + 1, type(uint256).max); + + resetPrank(users.fisherman); + Attestation.Receipt memory receipt = _createAttestationReceipt(requestCID, responseCID, subgraphDeploymentId); + bytes memory attestationData = _createAtestationData(receipt, allocationIDPrivateKey); + bytes32 disputeID = _createQueryDispute(attestationData); + + // max slashing percentage is 50% + resetPrank(users.arbitrator); + bytes memory expectedError = abi.encodeWithSelector( + IDisputeManager.DisputeManagerInvalidTokensSlash.selector, + tokensSlash, + maxTokensToSlash + ); + vm.expectRevert(expectedError); + disputeManager.acceptDispute(disputeID, tokensSlash); + } + + function test_Query_Accept_RevertWhen_SlashingOverMaxSlashPercentage_WithDelegation_DelegationSlashing( + uint256 tokens, + uint256 tokensDelegated, + uint256 tokensSlash + ) public useIndexer useAllocation(tokens) useDelegation(tokensDelegated) { + // enable delegation slashing + resetPrank(users.governor); + staking.setDelegationSlashingEnabled(); + + resetPrank(users.fisherman); + uint256 maxTokensToSlash = uint256(maxSlashingPercentage).mulPPM( + _calculateStakeSnapshot(tokens, tokensDelegated) + ); + tokensSlash = bound(tokensSlash, maxTokensToSlash + 1, type(uint256).max); + + // Create a new dispute with delegation slashing enabled + resetPrank(users.fisherman); + Attestation.Receipt memory receipt = _createAttestationReceipt(requestCID, responseCID, subgraphDeploymentId); + bytes memory attestationData = _createAtestationData(receipt, allocationIDPrivateKey); + bytes32 disputeID = _createQueryDispute(attestationData); + + // max slashing percentage is 50% + resetPrank(users.arbitrator); + bytes memory expectedError = abi.encodeWithSelector( + IDisputeManager.DisputeManagerInvalidTokensSlash.selector, + tokensSlash, + maxTokensToSlash + ); + vm.expectRevert(expectedError); + disputeManager.acceptDispute(disputeID, tokensSlash); + } + + function test_Query_Accept_Dispute_AfterFishermanRewardCutIncreased( + uint256 tokens, + uint256 tokensSlash + ) public useIndexer { + vm.assume(tokens >= minimumProvisionTokens); + vm.assume(tokens < 10_000_000_000 ether); + tokensSlash = bound(tokensSlash, 1, uint256(maxSlashingPercentage).mulPPM(tokens)); + + // Set fishermanRewardCut to 25% + resetPrank(users.governor); + uint32 oldFishermanRewardCut = 250_000; + disputeManager.setFishermanRewardCut(oldFishermanRewardCut); + + // Create provision with maxVerifierCut == fishermanRewardCut and allocate + resetPrank(users.indexer); + _createProvision(users.indexer, tokens, oldFishermanRewardCut, disputePeriod); + _register(users.indexer, abi.encode("url", "geoHash", address(0))); + bytes memory data = _createSubgraphAllocationData( + users.indexer, + subgraphDeployment, + allocationIDPrivateKey, + tokens + ); + _startService(users.indexer, data); + + // Create a dispute with prov.maxVerifierCut == fishermanRewardCut + uint256 beforeFishermanBalance = token.balanceOf(users.fisherman); + resetPrank(users.fisherman); + Attestation.Receipt memory receipt = _createAttestationReceipt(requestCID, responseCID, subgraphDeploymentId); + bytes memory attestationData = _createAtestationData(receipt, allocationIDPrivateKey); + bytes32 disputeID = _createQueryDispute(attestationData); + + // Now bump the fishermanRewardCut to 50% + resetPrank(users.governor); + disputeManager.setFishermanRewardCut(500_000); + + // Accept the dispute + resetPrank(users.arbitrator); + _acceptDispute(disputeID, tokensSlash); + + // Check that the fisherman received the correct amount of tokens + // which should use the old fishermanRewardCut + uint256 afterFishermanBalance = token.balanceOf(users.fisherman); + assertEq(afterFishermanBalance, beforeFishermanBalance + tokensSlash.mulPPM(oldFishermanRewardCut)); + } +} diff --git a/packages/subgraph-service/test/unit/disputeManager/disputes/query/cancel.t.sol b/packages/subgraph-service/test/unit/disputeManager/disputes/query/cancel.t.sol new file mode 100644 index 000000000..484b1ac4a --- /dev/null +++ b/packages/subgraph-service/test/unit/disputeManager/disputes/query/cancel.t.sol @@ -0,0 +1,91 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { Attestation } from "../../../../../contracts/libraries/Attestation.sol"; +import { IDisputeManager } from "../../../../../contracts/interfaces/IDisputeManager.sol"; +import { DisputeManagerTest } from "../../DisputeManager.t.sol"; + +contract DisputeManagerQueryCancelDisputeTest is DisputeManagerTest { + bytes32 private requestCID = keccak256(abi.encodePacked("Request CID")); + bytes32 private responseCID = keccak256(abi.encodePacked("Response CID")); + bytes32 private subgraphDeploymentId = keccak256(abi.encodePacked("Subgraph Deployment ID")); + + /* + * TESTS + */ + + function test_Query_Cancel_Dispute(uint256 tokens) public useIndexer useAllocation(tokens) { + resetPrank(users.fisherman); + Attestation.Receipt memory receipt = _createAttestationReceipt(requestCID, responseCID, subgraphDeploymentId); + bytes memory attestationData = _createAtestationData(receipt, allocationIDPrivateKey); + bytes32 disputeID = _createQueryDispute(attestationData); + + // skip to end of dispute period + uint256 disputePeriod = disputeManager.disputePeriod(); + skip(disputePeriod + 1); + + _cancelDispute(disputeID); + } + + function test_Query_Cancel_RevertIf_CallerIsNotFisherman(uint256 tokens) public useIndexer useAllocation(tokens) { + resetPrank(users.fisherman); + Attestation.Receipt memory receipt = _createAttestationReceipt(requestCID, responseCID, subgraphDeploymentId); + bytes memory attestationData = _createAtestationData(receipt, allocationIDPrivateKey); + bytes32 disputeID = _createQueryDispute(attestationData); + + resetPrank(users.arbitrator); + vm.expectRevert(abi.encodeWithSelector(IDisputeManager.DisputeManagerNotFisherman.selector)); + disputeManager.cancelDispute(disputeID); + } + + function test_Query_Cancel_RevertIf_DisputePeriodNotOver(uint256 tokens) public useIndexer useAllocation(tokens) { + resetPrank(users.fisherman); + Attestation.Receipt memory receipt = _createAttestationReceipt(requestCID, responseCID, subgraphDeploymentId); + bytes memory attestationData = _createAtestationData(receipt, allocationIDPrivateKey); + bytes32 disputeID = _createQueryDispute(attestationData); + + vm.expectRevert(abi.encodeWithSelector(IDisputeManager.DisputeManagerDisputePeriodNotFinished.selector)); + disputeManager.cancelDispute(disputeID); + } + + function test_Query_Cancel_After_DisputePeriodIncreased(uint256 tokens) public useIndexer useAllocation(tokens) { + resetPrank(users.fisherman); + Attestation.Receipt memory receipt = _createAttestationReceipt(requestCID, responseCID, subgraphDeploymentId); + bytes memory attestationData = _createAtestationData(receipt, allocationIDPrivateKey); + bytes32 disputeID = _createQueryDispute(attestationData); + + // change the dispute period to a higher value + uint256 oldDisputePeriod = disputeManager.disputePeriod(); + resetPrank(users.governor); + disputeManager.setDisputePeriod(uint64(oldDisputePeriod * 2)); + + // skip to end of old dispute period + skip(oldDisputePeriod + 1); + + // should be able to cancel + resetPrank(users.fisherman); + _cancelDispute(disputeID); + } + + function test_Query_Cancel_After_DisputePeriodDecreased(uint256 tokens) public useIndexer useAllocation(tokens) { + resetPrank(users.fisherman); + Attestation.Receipt memory receipt = _createAttestationReceipt(requestCID, responseCID, subgraphDeploymentId); + bytes memory attestationData = _createAtestationData(receipt, allocationIDPrivateKey); + bytes32 disputeID = _createQueryDispute(attestationData); + + // change the dispute period to a lower value + uint256 oldDisputePeriod = disputeManager.disputePeriod(); + resetPrank(users.governor); + disputeManager.setDisputePeriod(uint64(oldDisputePeriod / 2)); + + // skip to end of new dispute period + skip(oldDisputePeriod / 2 + 1); + + // should not be able to cancel + resetPrank(users.fisherman); + vm.expectRevert(abi.encodeWithSelector(IDisputeManager.DisputeManagerDisputePeriodNotFinished.selector)); + disputeManager.cancelDispute(disputeID); + } +} diff --git a/packages/subgraph-service/test/unit/disputeManager/disputes/query/create.t.sol b/packages/subgraph-service/test/unit/disputeManager/disputes/query/create.t.sol new file mode 100644 index 000000000..6abd890a2 --- /dev/null +++ b/packages/subgraph-service/test/unit/disputeManager/disputes/query/create.t.sol @@ -0,0 +1,158 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { IDisputeManager } from "../../../../../contracts/interfaces/IDisputeManager.sol"; +import { Attestation } from "../../../../../contracts/libraries/Attestation.sol"; +import { DisputeManagerTest } from "../../DisputeManager.t.sol"; + +contract DisputeManagerQueryCreateDisputeTest is DisputeManagerTest { + bytes32 private requestCID = keccak256(abi.encodePacked("Request CID")); + bytes32 private responseCID = keccak256(abi.encodePacked("Response CID")); + bytes32 private subgraphDeploymentId = keccak256(abi.encodePacked("Subgraph Deployment ID")); + + /* + * TESTS + */ + + function test_Query_Create_Dispute_Only(uint256 tokens) public useIndexer useAllocation(tokens) { + resetPrank(users.fisherman); + Attestation.Receipt memory receipt = _createAttestationReceipt(requestCID, responseCID, subgraphDeploymentId); + bytes memory attestationData = _createAtestationData(receipt, allocationIDPrivateKey); + _createQueryDispute(attestationData); + } + + function test_Query_Create_Dispute_RevertWhen_SubgraphServiceNotSet( + uint256 tokens + ) public useIndexer useAllocation(tokens) { + resetPrank(users.fisherman); + Attestation.Receipt memory receipt = _createAttestationReceipt(requestCID, responseCID, subgraphDeploymentId); + bytes memory attestationData = _createAtestationData(receipt, allocationIDPrivateKey); + + // clear subgraph service address from storage + _setStorage_SubgraphService(address(0)); + + // // Approve the dispute deposit + token.approve(address(disputeManager), disputeDeposit); + + vm.expectRevert(abi.encodeWithSelector(IDisputeManager.DisputeManagerSubgraphServiceNotSet.selector)); + disputeManager.createQueryDispute(attestationData); + } + + function test_Query_Create_MultipleDisputes_DifferentFisherman( + uint256 tokens + ) public useIndexer useAllocation(tokens) { + resetPrank(users.fisherman); + Attestation.Receipt memory receipt = _createAttestationReceipt(requestCID, responseCID, subgraphDeploymentId); + bytes memory attestationData = _createAtestationData(receipt, allocationIDPrivateKey); + _createQueryDispute(attestationData); + + // Create another dispute with different fisherman + address otherFisherman = makeAddr("otherFisherman"); + resetPrank(otherFisherman); + mint(otherFisherman, MAX_TOKENS); + Attestation.Receipt memory otherFishermanReceipt = _createAttestationReceipt( + requestCID, + responseCID, + subgraphDeploymentId + ); + bytes memory otherFishermanAttestationData = _createAtestationData( + otherFishermanReceipt, + allocationIDPrivateKey + ); + _createQueryDispute(otherFishermanAttestationData); + } + + function test_Query_Create_MultipleDisputes_DifferentIndexer( + uint256 tokens + ) public useIndexer useAllocation(tokens) { + // Create first dispute for indexer + resetPrank(users.fisherman); + Attestation.Receipt memory receipt = _createAttestationReceipt(requestCID, responseCID, subgraphDeploymentId); + bytes memory attestationData = _createAtestationData(receipt, allocationIDPrivateKey); + _createQueryDispute(attestationData); + + // Setup new indexer + address newIndexer = makeAddr("newIndexer"); + uint256 newAllocationIDKey = uint256(keccak256(abi.encodePacked("newAllocationID"))); + mint(newIndexer, tokens); + resetPrank(newIndexer); + _createProvision(newIndexer, tokens, fishermanRewardPercentage, disputePeriod); + _register(newIndexer, abi.encode("url", "geoHash", 0x0)); + bytes memory data = _createSubgraphAllocationData(newIndexer, subgraphDeployment, newAllocationIDKey, tokens); + _startService(newIndexer, data); + + // Create another dispute with same receipt but different indexer + resetPrank(users.fisherman); + bytes memory attestationData2 = _createAtestationData(receipt, newAllocationIDKey); + _createQueryDispute(attestationData2); + } + + function test_Query_Create_RevertIf_Duplicate(uint256 tokens) public useIndexer useAllocation(tokens) { + resetPrank(users.fisherman); + Attestation.Receipt memory receipt = _createAttestationReceipt(requestCID, responseCID, subgraphDeploymentId); + bytes memory attestationData = _createAtestationData(receipt, allocationIDPrivateKey); + bytes32 disputeID = _createQueryDispute(attestationData); + + Attestation.Receipt memory newReceipt = _createAttestationReceipt( + requestCID, + responseCID, + subgraphDeploymentId + ); + bytes memory newAttestationData = _createAtestationData(newReceipt, allocationIDPrivateKey); + token.approve(address(disputeManager), disputeDeposit); + vm.expectRevert( + abi.encodeWithSelector(IDisputeManager.DisputeManagerDisputeAlreadyCreated.selector, disputeID) + ); + disputeManager.createQueryDispute(newAttestationData); + } + + function test_Query_Create_RevertIf_DepositUnderMinimum(uint256 tokensDispute) public useFisherman { + tokensDispute = bound(tokensDispute, 0, disputeDeposit - 1); + Attestation.Receipt memory receipt = _createAttestationReceipt(requestCID, responseCID, subgraphDeploymentId); + bytes memory attestationData = _createAtestationData(receipt, allocationIDPrivateKey); + + token.approve(address(disputeManager), tokensDispute); + bytes memory expectedError = abi.encodeWithSignature( + "ERC20InsufficientAllowance(address,uint256,uint256)", + address(disputeManager), + tokensDispute, + disputeDeposit + ); + vm.expectRevert(expectedError); + disputeManager.createQueryDispute(attestationData); + } + + function test_Query_Create_RevertIf_AllocationDoesNotExist(uint256 tokens) public useFisherman { + tokens = bound(tokens, disputeDeposit, 10_000_000_000 ether); + Attestation.Receipt memory receipt = _createAttestationReceipt(requestCID, responseCID, subgraphDeploymentId); + bytes memory attestationData = _createAtestationData(receipt, allocationIDPrivateKey); + token.approve(address(disputeManager), tokens); + bytes memory expectedError = abi.encodeWithSelector( + IDisputeManager.DisputeManagerIndexerNotFound.selector, + allocationID + ); + vm.expectRevert(expectedError); + disputeManager.createQueryDispute(attestationData); + vm.stopPrank(); + } + + function test_Query_Create_RevertIf_IndexerIsBelowStake(uint256 tokens) public useIndexer useAllocation(tokens) { + // Close allocation + bytes memory data = abi.encode(allocationID); + _stopService(users.indexer, data); + + // Thaw, deprovision and unstake + address subgraphDataServiceAddress = address(subgraphService); + _thawDeprovisionAndUnstake(users.indexer, subgraphDataServiceAddress, tokens); + + // Atempt to create dispute + resetPrank(users.fisherman); + token.approve(address(disputeManager), tokens); + Attestation.Receipt memory receipt = _createAttestationReceipt(requestCID, responseCID, subgraphDeploymentId); + bytes memory attestationData = _createAtestationData(receipt, allocationIDPrivateKey); + vm.expectRevert(abi.encodeWithSelector(IDisputeManager.DisputeManagerZeroTokens.selector)); + disputeManager.createQueryDispute(attestationData); + } +} diff --git a/packages/subgraph-service/test/unit/disputeManager/disputes/query/draw.t.sol b/packages/subgraph-service/test/unit/disputeManager/disputes/query/draw.t.sol new file mode 100644 index 000000000..8f1c9c4d1 --- /dev/null +++ b/packages/subgraph-service/test/unit/disputeManager/disputes/query/draw.t.sol @@ -0,0 +1,40 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { Attestation } from "../../../../../contracts/libraries/Attestation.sol"; +import { PPMMath } from "@graphprotocol/horizon/contracts/libraries/PPMMath.sol"; +import { IDisputeManager } from "../../../../../contracts/interfaces/IDisputeManager.sol"; +import { DisputeManagerTest } from "../../DisputeManager.t.sol"; + +contract DisputeManagerQueryDrawDisputeTest is DisputeManagerTest { + bytes32 private requestCID = keccak256(abi.encodePacked("Request CID")); + bytes32 private responseCID = keccak256(abi.encodePacked("Response CID")); + bytes32 private subgraphDeploymentId = keccak256(abi.encodePacked("Subgraph Deployment ID")); + + /* + * TESTS + */ + + function test_Query_Draw_Dispute(uint256 tokens) public useIndexer useAllocation(tokens) { + resetPrank(users.fisherman); + Attestation.Receipt memory receipt = _createAttestationReceipt(requestCID, responseCID, subgraphDeploymentId); + bytes memory attestationData = _createAtestationData(receipt, allocationIDPrivateKey); + bytes32 disputeID = _createQueryDispute(attestationData); + + resetPrank(users.arbitrator); + _drawDispute(disputeID); + } + + function test_Query_Draw_RevertIf_CallerIsNotArbitrator(uint256 tokens) public useIndexer useAllocation(tokens) { + resetPrank(users.fisherman); + Attestation.Receipt memory receipt = _createAttestationReceipt(requestCID, responseCID, subgraphDeploymentId); + bytes memory attestationData = _createAtestationData(receipt, allocationIDPrivateKey); + bytes32 disputeID = _createQueryDispute(attestationData); + + // attempt to draw dispute as fisherman + vm.expectRevert(abi.encodeWithSelector(IDisputeManager.DisputeManagerNotArbitrator.selector)); + disputeManager.drawDispute(disputeID); + } +} diff --git a/packages/subgraph-service/test/unit/disputeManager/disputes/query/reject.t.sol b/packages/subgraph-service/test/unit/disputeManager/disputes/query/reject.t.sol new file mode 100644 index 000000000..0e03b05ec --- /dev/null +++ b/packages/subgraph-service/test/unit/disputeManager/disputes/query/reject.t.sol @@ -0,0 +1,39 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { Attestation } from "../../../../../contracts/libraries/Attestation.sol"; +import { IDisputeManager } from "../../../../../contracts/interfaces/IDisputeManager.sol"; +import { DisputeManagerTest } from "../../DisputeManager.t.sol"; + +contract DisputeManagerQueryRejectDisputeTest is DisputeManagerTest { + bytes32 private requestCID = keccak256(abi.encodePacked("Request CID")); + bytes32 private responseCID = keccak256(abi.encodePacked("Response CID")); + bytes32 private subgraphDeploymentId = keccak256(abi.encodePacked("Subgraph Deployment ID")); + + /* + * TESTS + */ + + function test_Query_Reject_Dispute(uint256 tokens) public useIndexer useAllocation(tokens) { + resetPrank(users.fisherman); + Attestation.Receipt memory receipt = _createAttestationReceipt(requestCID, responseCID, subgraphDeploymentId); + bytes memory attestationData = _createAtestationData(receipt, allocationIDPrivateKey); + bytes32 disputeID = _createQueryDispute(attestationData); + + resetPrank(users.arbitrator); + _rejectDispute(disputeID); + } + + function test_Query_Reject_RevertIf_CallerIsNotArbitrator(uint256 tokens) public useIndexer useAllocation(tokens) { + resetPrank(users.fisherman); + Attestation.Receipt memory receipt = _createAttestationReceipt(requestCID, responseCID, subgraphDeploymentId); + bytes memory attestationData = _createAtestationData(receipt, allocationIDPrivateKey); + bytes32 disputeID = _createQueryDispute(attestationData); + + // attempt to accept dispute as fisherman + vm.expectRevert(abi.encodeWithSelector(IDisputeManager.DisputeManagerNotArbitrator.selector)); + disputeManager.rejectDispute(disputeID); + } +} diff --git a/packages/subgraph-service/test/unit/disputeManager/disputes/queryConflict/accept.t.sol b/packages/subgraph-service/test/unit/disputeManager/disputes/queryConflict/accept.t.sol new file mode 100644 index 000000000..35850ebe3 --- /dev/null +++ b/packages/subgraph-service/test/unit/disputeManager/disputes/queryConflict/accept.t.sol @@ -0,0 +1,206 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { PPMMath } from "@graphprotocol/horizon/contracts/libraries/PPMMath.sol"; +import { IDisputeManager } from "../../../../../contracts/interfaces/IDisputeManager.sol"; +import { DisputeManagerTest } from "../../DisputeManager.t.sol"; + +contract DisputeManagerQueryConflictAcceptDisputeTest is DisputeManagerTest { + using PPMMath for uint256; + + bytes32 private requestCID = keccak256(abi.encodePacked("Request CID")); + bytes32 private responseCID1 = keccak256(abi.encodePacked("Response CID 1")); + bytes32 private responseCID2 = keccak256(abi.encodePacked("Response CID 2")); + + /* + * TESTS + */ + + function test_Query_Conflict_Accept_Dispute_Draw_Other( + uint256 tokens, + uint256 tokensSlash + ) public useIndexer useAllocation(tokens) { + tokensSlash = bound(tokensSlash, 1, uint256(maxSlashingPercentage).mulPPM(tokens)); + + (bytes memory attestationData1, bytes memory attestationData2) = _createConflictingAttestations( + requestCID, + subgraphDeployment, + responseCID1, + responseCID2, + allocationIDPrivateKey, + allocationIDPrivateKey + ); + + uint256 fishermanBalanceBefore = token.balanceOf(users.fisherman); + + resetPrank(users.fisherman); + (bytes32 disputeID1, ) = _createQueryDisputeConflict(attestationData1, attestationData2); + + resetPrank(users.arbitrator); + _acceptDisputeConflict(disputeID1, tokensSlash, false, 0); + + uint256 fishermanRewardPercentage = disputeManager.fishermanRewardCut(); + uint256 fishermanReward = tokensSlash.mulPPM(fishermanRewardPercentage); + uint256 fishermanBalanceAfter = token.balanceOf(users.fisherman); + + assertEq(fishermanBalanceAfter, fishermanBalanceBefore + fishermanReward); + } + + function test_Query_Conflict_Accept_Dispute_Accept_Other( + uint256 tokens, + uint256 tokensSlash, + uint256 tokensSlashRelatedDispute + ) public useIndexer useAllocation(tokens) { + tokensSlash = bound(tokensSlash, 1, uint256(maxSlashingPercentage).mulPPM(tokens)); + tokensSlashRelatedDispute = bound(tokensSlashRelatedDispute, 1, uint256(maxSlashingPercentage).mulPPM(tokens)); + + (bytes memory attestationData1, bytes memory attestationData2) = _createConflictingAttestations( + requestCID, + subgraphDeployment, + responseCID1, + responseCID2, + allocationIDPrivateKey, + allocationIDPrivateKey + ); + + uint256 fishermanBalanceBefore = token.balanceOf(users.fisherman); + + resetPrank(users.fisherman); + (bytes32 disputeID1, ) = _createQueryDisputeConflict(attestationData1, attestationData2); + + resetPrank(users.arbitrator); + _acceptDisputeConflict(disputeID1, tokensSlash, true, tokensSlashRelatedDispute); + + uint256 fishermanRewardPercentage = disputeManager.fishermanRewardCut(); + uint256 fishermanRewardFirstDispute = tokensSlash.mulPPM(fishermanRewardPercentage); + uint256 fishermanRewardRelatedDispute = tokensSlashRelatedDispute.mulPPM(fishermanRewardPercentage); + uint256 fishermanReward = fishermanRewardFirstDispute + fishermanRewardRelatedDispute; + uint256 fishermanBalanceAfter = token.balanceOf(users.fisherman); + + assertEq(fishermanBalanceAfter, fishermanBalanceBefore + fishermanReward); + } + + function test_Query_Conflict_Accept_RevertIf_CallerIsNotArbitrator( + uint256 tokens, + uint256 tokensSlash + ) public useIndexer useAllocation(tokens) { + tokensSlash = bound(tokensSlash, 1, uint256(maxSlashingPercentage).mulPPM(tokens)); + + (bytes memory attestationData1, bytes memory attestationData2) = _createConflictingAttestations( + requestCID, + subgraphDeployment, + responseCID1, + responseCID2, + allocationIDPrivateKey, + allocationIDPrivateKey + ); + + resetPrank(users.fisherman); + (bytes32 disputeID1, ) = _createQueryDisputeConflict(attestationData1, attestationData2); + + // attempt to accept dispute as fisherman + resetPrank(users.fisherman); + vm.expectRevert(abi.encodeWithSelector(IDisputeManager.DisputeManagerNotArbitrator.selector)); + disputeManager.acceptDisputeConflict(disputeID1, tokensSlash, false, 0); + } + + function test_Query_Conflict_Accept_RevertWhen_SlashingOverMaxSlashPercentage( + uint256 tokens, + uint256 tokensSlash + ) public useIndexer useAllocation(tokens) { + tokensSlash = bound(tokensSlash, uint256(maxSlashingPercentage).mulPPM(tokens) + 1, type(uint256).max); + + (bytes memory attestationData1, bytes memory attestationData2) = _createConflictingAttestations( + requestCID, + subgraphDeployment, + responseCID1, + responseCID2, + allocationIDPrivateKey, + allocationIDPrivateKey + ); + + resetPrank(users.fisherman); + (bytes32 disputeID1, ) = _createQueryDisputeConflict(attestationData1, attestationData2); + + // max slashing percentage is 50% + resetPrank(users.arbitrator); + uint256 maxTokensToSlash = uint256(maxSlashingPercentage).mulPPM(tokens); + bytes memory expectedError = abi.encodeWithSelector( + IDisputeManager.DisputeManagerInvalidTokensSlash.selector, + tokensSlash, + maxTokensToSlash + ); + vm.expectRevert(expectedError); + disputeManager.acceptDisputeConflict(disputeID1, tokensSlash, false, 0); + } + + function test_Query_Conflict_Accept_AcceptRelated_DifferentIndexer( + uint256 tokensFirstIndexer, + uint256 tokensSecondIndexer, + uint256 tokensSlash, + uint256 tokensSlashRelatedDispute + ) public useIndexer useAllocation(tokensFirstIndexer) { + tokensSecondIndexer = bound(tokensSecondIndexer, minimumProvisionTokens, 10_000_000_000 ether); + tokensSlash = bound(tokensSlash, 1, uint256(maxSlashingPercentage).mulPPM(tokensFirstIndexer)); + + // Setup different indexer for related dispute + address differentIndexer = makeAddr("DifferentIndexer"); + mint(differentIndexer, tokensSecondIndexer); + uint256 differentIndexerAllocationIDPrivateKey = uint256(keccak256(abi.encodePacked(differentIndexer))); + resetPrank(differentIndexer); + _createProvision(differentIndexer, tokensSecondIndexer, fishermanRewardPercentage, disputePeriod); + _register(differentIndexer, abi.encode("url", "geoHash", address(0))); + bytes memory data = _createSubgraphAllocationData( + differentIndexer, + subgraphDeployment, + differentIndexerAllocationIDPrivateKey, + tokensSecondIndexer + ); + _startService(differentIndexer, data); + tokensSlashRelatedDispute = bound( + tokensSlashRelatedDispute, + 1, + uint256(maxSlashingPercentage).mulPPM(tokensSecondIndexer) + ); + + (bytes memory attestationData1, bytes memory attestationData2) = _createConflictingAttestations( + requestCID, + subgraphDeployment, + responseCID1, + responseCID2, + allocationIDPrivateKey, + differentIndexerAllocationIDPrivateKey + ); + + resetPrank(users.fisherman); + (bytes32 disputeID1, ) = _createQueryDisputeConflict(attestationData1, attestationData2); + + resetPrank(users.arbitrator); + _acceptDisputeConflict(disputeID1, tokensSlash, true, tokensSlashRelatedDispute); + } + + function test_Query_Conflict_Accept_RevertWhen_UsingSingleAccept( + uint256 tokens, + uint256 tokensSlash + ) public useIndexer useAllocation(tokens) { + tokensSlash = bound(tokensSlash, 1, uint256(maxSlashingPercentage).mulPPM(tokens)); + + (bytes memory attestationData1, bytes memory attestationData2) = _createConflictingAttestations( + requestCID, + subgraphDeployment, + responseCID1, + responseCID2, + allocationIDPrivateKey, + allocationIDPrivateKey + ); + + resetPrank(users.fisherman); + (bytes32 disputeID1, ) = _createQueryDisputeConflict(attestationData1, attestationData2); + + resetPrank(users.arbitrator); + vm.expectRevert(abi.encodeWithSelector(IDisputeManager.DisputeManagerDisputeInConflict.selector, disputeID1)); + disputeManager.acceptDispute(disputeID1, tokensSlash); + } +} diff --git a/packages/subgraph-service/test/unit/disputeManager/disputes/queryConflict/cancel.t.sol b/packages/subgraph-service/test/unit/disputeManager/disputes/queryConflict/cancel.t.sol new file mode 100644 index 000000000..94b83b699 --- /dev/null +++ b/packages/subgraph-service/test/unit/disputeManager/disputes/queryConflict/cancel.t.sol @@ -0,0 +1,133 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { IDisputeManager } from "../../../../../contracts/interfaces/IDisputeManager.sol"; +import { DisputeManagerTest } from "../../DisputeManager.t.sol"; + +contract DisputeManagerQueryConflictCancelDisputeTest is DisputeManagerTest { + bytes32 private requestCID = keccak256(abi.encodePacked("Request CID")); + bytes32 private responseCID1 = keccak256(abi.encodePacked("Response CID 1")); + bytes32 private responseCID2 = keccak256(abi.encodePacked("Response CID 2")); + + /* + * TESTS + */ + + function test_Query_Conflict_Cancel_Dispute(uint256 tokens) public useIndexer useAllocation(tokens) { + (bytes memory attestationData1, bytes memory attestationData2) = _createConflictingAttestations( + requestCID, + subgraphDeployment, + responseCID1, + responseCID2, + allocationIDPrivateKey, + allocationIDPrivateKey + ); + + resetPrank(users.fisherman); + (bytes32 disputeID1, ) = _createQueryDisputeConflict(attestationData1, attestationData2); + + // skip to end of dispute period + uint256 disputePeriod = disputeManager.disputePeriod(); + skip(disputePeriod + 1); + + _cancelDispute(disputeID1); + } + + function test_Query_Conflict_Cancel_RevertIf_CallerIsNotFisherman( + uint256 tokens + ) public useIndexer useAllocation(tokens) { + (bytes memory attestationData1, bytes memory attestationData2) = _createConflictingAttestations( + requestCID, + subgraphDeployment, + responseCID1, + responseCID2, + allocationIDPrivateKey, + allocationIDPrivateKey + ); + + resetPrank(users.fisherman); + (bytes32 disputeID1, ) = _createQueryDisputeConflict(attestationData1, attestationData2); + + resetPrank(users.indexer); + vm.expectRevert(abi.encodeWithSelector(IDisputeManager.DisputeManagerNotFisherman.selector)); + disputeManager.cancelDispute(disputeID1); + } + + function test_Query_Conflict_Cancel_RevertIf_DisputePeriodNotOver( + uint256 tokens + ) public useIndexer useAllocation(tokens) { + (bytes memory attestationData1, bytes memory attestationData2) = _createConflictingAttestations( + requestCID, + subgraphDeployment, + responseCID1, + responseCID2, + allocationIDPrivateKey, + allocationIDPrivateKey + ); + + resetPrank(users.fisherman); + (bytes32 disputeID1, ) = _createQueryDisputeConflict(attestationData1, attestationData2); + + resetPrank(users.fisherman); + vm.expectRevert(abi.encodeWithSelector(IDisputeManager.DisputeManagerDisputePeriodNotFinished.selector)); + disputeManager.cancelDispute(disputeID1); + } + + function test_Query_Conflict_Cancel_After_DisputePeriodIncreased( + uint256 tokens + ) public useIndexer useAllocation(tokens) { + resetPrank(users.fisherman); + (bytes memory attestationData1, bytes memory attestationData2) = _createConflictingAttestations( + requestCID, + subgraphDeployment, + responseCID1, + responseCID2, + allocationIDPrivateKey, + allocationIDPrivateKey + ); + + resetPrank(users.fisherman); + (bytes32 disputeID1, ) = _createQueryDisputeConflict(attestationData1, attestationData2); + + // change the dispute period to a higher value + uint256 oldDisputePeriod = disputeManager.disputePeriod(); + resetPrank(users.governor); + disputeManager.setDisputePeriod(uint64(oldDisputePeriod * 2)); + + // skip to end of old dispute period + skip(oldDisputePeriod + 1); + + // should be able to cancel + resetPrank(users.fisherman); + _cancelDispute(disputeID1); + } + + function test_Query_Cancel_After_DisputePeriodDecreased(uint256 tokens) public useIndexer useAllocation(tokens) { + (bytes memory attestationData1, bytes memory attestationData2) = _createConflictingAttestations( + requestCID, + subgraphDeployment, + responseCID1, + responseCID2, + allocationIDPrivateKey, + allocationIDPrivateKey + ); + + resetPrank(users.fisherman); + (bytes32 disputeID1, ) = _createQueryDisputeConflict(attestationData1, attestationData2); + + // change the dispute period to a lower value + uint256 oldDisputePeriod = disputeManager.disputePeriod(); + resetPrank(users.governor); + disputeManager.setDisputePeriod(uint64(oldDisputePeriod / 2)); + + // skip to end of new dispute period + skip(oldDisputePeriod / 2 + 1); + + // should not be able to cancel + resetPrank(users.fisherman); + vm.expectRevert(abi.encodeWithSelector(IDisputeManager.DisputeManagerDisputePeriodNotFinished.selector)); + disputeManager.cancelDispute(disputeID1); + } +} diff --git a/packages/subgraph-service/test/unit/disputeManager/disputes/queryConflict/create.t.sol b/packages/subgraph-service/test/unit/disputeManager/disputes/queryConflict/create.t.sol new file mode 100644 index 000000000..684c10ec7 --- /dev/null +++ b/packages/subgraph-service/test/unit/disputeManager/disputes/queryConflict/create.t.sol @@ -0,0 +1,108 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { IDisputeManager } from "../../../../../contracts/interfaces/IDisputeManager.sol"; +import { Attestation } from "../../../../../contracts/libraries/Attestation.sol"; +import { DisputeManagerTest } from "../../DisputeManager.t.sol"; + +contract DisputeManagerQueryConflictCreateDisputeTest is DisputeManagerTest { + bytes32 private requestCID = keccak256(abi.encodePacked("Request CID")); + bytes32 private responseCID1 = keccak256(abi.encodePacked("Response CID 1")); + bytes32 private responseCID2 = keccak256(abi.encodePacked("Response CID 2")); + + /* + * TESTS + */ + + function test_Query_Conflict_Create_DisputeAttestation(uint256 tokens) public useIndexer useAllocation(tokens) { + resetPrank(users.fisherman); + (bytes memory attestationData1, bytes memory attestationData2) = _createConflictingAttestations( + requestCID, + subgraphDeployment, + responseCID1, + responseCID2, + allocationIDPrivateKey, + allocationIDPrivateKey + ); + + _createQueryDisputeConflict(attestationData1, attestationData2); + } + + function test_Query_Conflict_Create_DisputeAttestationDifferentIndexers( + uint256 tokens + ) public useIndexer useAllocation(tokens) { + // Setup new indexer + address newIndexer = makeAddr("newIndexer"); + uint256 newAllocationIDKey = uint256(keccak256(abi.encodePacked("newAllocationID"))); + mint(newIndexer, tokens); + resetPrank(newIndexer); + _createProvision(newIndexer, tokens, fishermanRewardPercentage, disputePeriod); + _register(newIndexer, abi.encode("url", "geoHash", 0x0)); + bytes memory data = _createSubgraphAllocationData(newIndexer, subgraphDeployment, newAllocationIDKey, tokens); + _startService(newIndexer, data); + + // Create query conflict dispute + resetPrank(users.fisherman); + (bytes memory attestationData1, bytes memory attestationData2) = _createConflictingAttestations( + requestCID, + subgraphDeployment, + responseCID1, + responseCID2, + allocationIDPrivateKey, + newAllocationIDKey + ); + + _createQueryDisputeConflict(attestationData1, attestationData2); + } + + function test_Query_Conflict_Create_RevertIf_AttestationsResponsesAreTheSame() public useFisherman { + (bytes memory attestationData1, bytes memory attestationData2) = _createConflictingAttestations( + requestCID, + subgraphDeployment, + responseCID1, + responseCID1, + allocationIDPrivateKey, + allocationIDPrivateKey + ); + + bytes memory expectedError = abi.encodeWithSelector( + IDisputeManager.DisputeManagerNonConflictingAttestations.selector, + requestCID, + responseCID1, + subgraphDeployment, + requestCID, + responseCID1, + subgraphDeployment + ); + vm.expectRevert(expectedError); + disputeManager.createQueryDisputeConflict(attestationData1, attestationData2); + } + + function test_Query_Conflict_Create_RevertIf_AttestationsHaveDifferentSubgraph() public useFisherman { + bytes32 subgraphDeploymentId2 = keccak256(abi.encodePacked("Subgraph Deployment ID 2")); + + Attestation.Receipt memory receipt1 = _createAttestationReceipt(requestCID, responseCID1, subgraphDeployment); + bytes memory attestationData1 = _createAtestationData(receipt1, allocationIDPrivateKey); + + Attestation.Receipt memory receipt2 = _createAttestationReceipt( + requestCID, + responseCID2, + subgraphDeploymentId2 + ); + bytes memory attestationData2 = _createAtestationData(receipt2, allocationIDPrivateKey); + + bytes memory expectedError = abi.encodeWithSelector( + IDisputeManager.DisputeManagerNonConflictingAttestations.selector, + requestCID, + responseCID1, + subgraphDeployment, + requestCID, + responseCID2, + subgraphDeploymentId2 + ); + vm.expectRevert(expectedError); + disputeManager.createQueryDisputeConflict(attestationData1, attestationData2); + } +} diff --git a/packages/subgraph-service/test/unit/disputeManager/disputes/queryConflict/draw.t.sol b/packages/subgraph-service/test/unit/disputeManager/disputes/queryConflict/draw.t.sol new file mode 100644 index 000000000..e7c7622c7 --- /dev/null +++ b/packages/subgraph-service/test/unit/disputeManager/disputes/queryConflict/draw.t.sol @@ -0,0 +1,56 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { PPMMath } from "@graphprotocol/horizon/contracts/libraries/PPMMath.sol"; +import { IDisputeManager } from "../../../../../contracts/interfaces/IDisputeManager.sol"; +import { DisputeManagerTest } from "../../DisputeManager.t.sol"; + +contract DisputeManagerQueryConflictDrawDisputeTest is DisputeManagerTest { + bytes32 private requestCID = keccak256(abi.encodePacked("Request CID")); + bytes32 private responseCID1 = keccak256(abi.encodePacked("Response CID 1")); + bytes32 private responseCID2 = keccak256(abi.encodePacked("Response CID 2")); + + /* + * TESTS + */ + + function test_Query_Conflict_Draw_Dispute(uint256 tokens) public useIndexer useAllocation(tokens) { + (bytes memory attestationData1, bytes memory attestationData2) = _createConflictingAttestations( + requestCID, + subgraphDeployment, + responseCID1, + responseCID2, + allocationIDPrivateKey, + allocationIDPrivateKey + ); + + resetPrank(users.fisherman); + (bytes32 disputeID1, ) = _createQueryDisputeConflict(attestationData1, attestationData2); + + resetPrank(users.arbitrator); + _drawDispute(disputeID1); + } + + function test_Query_Conflict_Draw_RevertIf_CallerIsNotArbitrator( + uint256 tokens + ) public useIndexer useAllocation(tokens) { + (bytes memory attestationData1, bytes memory attestationData2) = _createConflictingAttestations( + requestCID, + subgraphDeployment, + responseCID1, + responseCID2, + allocationIDPrivateKey, + allocationIDPrivateKey + ); + + resetPrank(users.fisherman); + (bytes32 disputeID1, ) = _createQueryDisputeConflict(attestationData1, attestationData2); + + // attempt to draw dispute as fisherman + resetPrank(users.fisherman); + vm.expectRevert(abi.encodeWithSelector(IDisputeManager.DisputeManagerNotArbitrator.selector)); + disputeManager.drawDispute(disputeID1); + } +} diff --git a/packages/subgraph-service/test/unit/disputeManager/disputes/queryConflict/reject.t.sol b/packages/subgraph-service/test/unit/disputeManager/disputes/queryConflict/reject.t.sol new file mode 100644 index 000000000..cdfed4ecf --- /dev/null +++ b/packages/subgraph-service/test/unit/disputeManager/disputes/queryConflict/reject.t.sol @@ -0,0 +1,35 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { IDisputeManager } from "../../../../../contracts/interfaces/IDisputeManager.sol"; +import { DisputeManagerTest } from "../../DisputeManager.t.sol"; + +contract DisputeManagerQueryConflictRejectDisputeTest is DisputeManagerTest { + /* + * TESTS + */ + + function test_Query_Conflict_Reject_Revert(uint256 tokens) public useIndexer useAllocation(tokens) { + bytes32 requestCID = keccak256(abi.encodePacked("Request CID")); + bytes32 responseCID1 = keccak256(abi.encodePacked("Response CID 1")); + bytes32 responseCID2 = keccak256(abi.encodePacked("Response CID 2")); + + (bytes memory attestationData1, bytes memory attestationData2) = _createConflictingAttestations( + requestCID, + subgraphDeployment, + responseCID1, + responseCID2, + allocationIDPrivateKey, + allocationIDPrivateKey + ); + + resetPrank(users.fisherman); + (bytes32 disputeID1, ) = _createQueryDisputeConflict(attestationData1, attestationData2); + + resetPrank(users.arbitrator); + vm.expectRevert(abi.encodeWithSelector(IDisputeManager.DisputeManagerDisputeInConflict.selector, disputeID1)); + disputeManager.rejectDispute(disputeID1); + } +} diff --git a/packages/subgraph-service/test/unit/disputeManager/governance/arbitrator.t.sol b/packages/subgraph-service/test/unit/disputeManager/governance/arbitrator.t.sol new file mode 100644 index 000000000..dac0f7c74 --- /dev/null +++ b/packages/subgraph-service/test/unit/disputeManager/governance/arbitrator.t.sol @@ -0,0 +1,33 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { IDisputeManager } from "../../../../contracts/interfaces/IDisputeManager.sol"; +import { DisputeManagerTest } from "../DisputeManager.t.sol"; +import { OwnableUpgradeable } from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; + +contract DisputeManagerGovernanceArbitratorTest is DisputeManagerTest { + /* + * TESTS + */ + + function test_Governance_SetArbitrator() public useGovernor { + address arbitrator = makeAddr("newArbitrator"); + _setArbitrator(arbitrator); + } + + function test_Governance_RevertWhen_ZeroAddress() public useGovernor { + address arbitrator = address(0); + vm.expectRevert(abi.encodeWithSelector(IDisputeManager.DisputeManagerInvalidZeroAddress.selector)); + disputeManager.setArbitrator(arbitrator); + } + + function test_Governance_RevertWhen_NotGovernor() public useFisherman { + address arbitrator = makeAddr("newArbitrator"); + vm.expectRevert( + abi.encodeWithSelector(OwnableUpgradeable.OwnableUnauthorizedAccount.selector, users.fisherman) + ); + disputeManager.setArbitrator(arbitrator); + } +} diff --git a/packages/subgraph-service/test/unit/disputeManager/governance/disputeDeposit.t.sol b/packages/subgraph-service/test/unit/disputeManager/governance/disputeDeposit.t.sol new file mode 100644 index 000000000..cdc4a6bc1 --- /dev/null +++ b/packages/subgraph-service/test/unit/disputeManager/governance/disputeDeposit.t.sol @@ -0,0 +1,35 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { IDisputeManager } from "../../../../contracts/interfaces/IDisputeManager.sol"; +import { DisputeManagerTest } from "../DisputeManager.t.sol"; +import { OwnableUpgradeable } from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; + +contract DisputeManagerGovernanceDisputeDepositTest is DisputeManagerTest { + /* + * TESTS + */ + + function test_Governance_SetDisputeDeposit(uint256 disputeDeposit) public useGovernor { + vm.assume(disputeDeposit >= MIN_DISPUTE_DEPOSIT); + _setDisputeDeposit(disputeDeposit); + } + + function test_Governance_RevertWhen_DepositTooLow(uint256 disputeDeposit) public useGovernor { + vm.assume(disputeDeposit < MIN_DISPUTE_DEPOSIT); + vm.expectRevert( + abi.encodeWithSelector(IDisputeManager.DisputeManagerInvalidDisputeDeposit.selector, disputeDeposit) + ); + disputeManager.setDisputeDeposit(disputeDeposit); + } + + function test_Governance_RevertWhen_NotGovernor() public useFisherman { + uint256 disputeDeposit = 100 ether; + vm.expectRevert( + abi.encodeWithSelector(OwnableUpgradeable.OwnableUnauthorizedAccount.selector, users.fisherman) + ); + disputeManager.setDisputeDeposit(disputeDeposit); + } +} diff --git a/packages/subgraph-service/test/unit/disputeManager/governance/fishermanRewardCut.t.sol b/packages/subgraph-service/test/unit/disputeManager/governance/fishermanRewardCut.t.sol new file mode 100644 index 000000000..a949f6732 --- /dev/null +++ b/packages/subgraph-service/test/unit/disputeManager/governance/fishermanRewardCut.t.sol @@ -0,0 +1,35 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { IDisputeManager } from "../../../../contracts/interfaces/IDisputeManager.sol"; +import { DisputeManagerTest } from "../DisputeManager.t.sol"; +import { OwnableUpgradeable } from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; + +contract DisputeManagerGovernanceFishermanRewardCutTest is DisputeManagerTest { + /* + * TESTS + */ + + function test_Governance_SetFishermanRewardCut(uint32 fishermanRewardCut) public useGovernor { + vm.assume(fishermanRewardCut <= disputeManager.MAX_FISHERMAN_REWARD_CUT()); + _setFishermanRewardCut(fishermanRewardCut); + } + + function test_Governance_RevertWhen_OverMaximumValue(uint32 fishermanRewardCut) public useGovernor { + vm.assume(fishermanRewardCut > disputeManager.MAX_FISHERMAN_REWARD_CUT()); + vm.expectRevert( + abi.encodeWithSelector(IDisputeManager.DisputeManagerInvalidFishermanReward.selector, fishermanRewardCut) + ); + disputeManager.setFishermanRewardCut(fishermanRewardCut); + } + + function test_Governance_RevertWhen_NotGovernor() public useFisherman { + uint32 fishermanRewardCut = 1000; + vm.expectRevert( + abi.encodeWithSelector(OwnableUpgradeable.OwnableUnauthorizedAccount.selector, users.fisherman) + ); + disputeManager.setFishermanRewardCut(fishermanRewardCut); + } +} diff --git a/packages/subgraph-service/test/unit/disputeManager/governance/maxSlashingCut.t.sol b/packages/subgraph-service/test/unit/disputeManager/governance/maxSlashingCut.t.sol new file mode 100644 index 000000000..5b3ce35c5 --- /dev/null +++ b/packages/subgraph-service/test/unit/disputeManager/governance/maxSlashingCut.t.sol @@ -0,0 +1,35 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { IDisputeManager } from "../../../../contracts/interfaces/IDisputeManager.sol"; +import { DisputeManagerTest } from "../DisputeManager.t.sol"; +import { OwnableUpgradeable } from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; + +contract DisputeManagerGovernanceMaxSlashingCutTest is DisputeManagerTest { + /* + * TESTS + */ + + function test_Governance_SetMaxSlashingCut(uint32 maxSlashingCut) public useGovernor { + vm.assume(maxSlashingCut <= MAX_PPM); + _setMaxSlashingCut(maxSlashingCut); + } + + function test_Governance_RevertWhen_NotPPM(uint32 maxSlashingCut) public useGovernor { + vm.assume(maxSlashingCut > MAX_PPM); + vm.expectRevert( + abi.encodeWithSelector(IDisputeManager.DisputeManagerInvalidMaxSlashingCut.selector, maxSlashingCut) + ); + disputeManager.setMaxSlashingCut(maxSlashingCut); + } + + function test_Governance_RevertWhen_NotGovernor() public useFisherman { + uint32 maxSlashingCut = 1000; + vm.expectRevert( + abi.encodeWithSelector(OwnableUpgradeable.OwnableUnauthorizedAccount.selector, users.fisherman) + ); + disputeManager.setMaxSlashingCut(maxSlashingCut); + } +} diff --git a/packages/subgraph-service/test/unit/disputeManager/governance/subgraphService.t.sol b/packages/subgraph-service/test/unit/disputeManager/governance/subgraphService.t.sol new file mode 100644 index 000000000..286f797ae --- /dev/null +++ b/packages/subgraph-service/test/unit/disputeManager/governance/subgraphService.t.sol @@ -0,0 +1,23 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { IDisputeManager } from "../../../../contracts/interfaces/IDisputeManager.sol"; +import { DisputeManagerTest } from "../DisputeManager.t.sol"; + +contract DisputeManagerGovernanceSubgraphService is DisputeManagerTest { + /* + * TESTS + */ + + function test_Governance_SetSubgraphService(address subgraphService) public useGovernor { + vm.assume(subgraphService != address(0)); + _setSubgraphService(subgraphService); + } + + function test_Governance_SetSubgraphService_RevertWhenZero() public useGovernor { + vm.expectRevert(abi.encodeWithSelector(IDisputeManager.DisputeManagerInvalidZeroAddress.selector)); + disputeManager.setSubgraphService(address(0)); + } +} diff --git a/packages/subgraph-service/test/unit/mocks/MockCuration.sol b/packages/subgraph-service/test/unit/mocks/MockCuration.sol new file mode 100644 index 000000000..0fb417c6d --- /dev/null +++ b/packages/subgraph-service/test/unit/mocks/MockCuration.sol @@ -0,0 +1,11 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity 0.8.27; + +contract MockCuration { + function isCurated(bytes32) public pure returns (bool) { + return true; + } + + function collect(bytes32, uint256) external {} +} diff --git a/packages/subgraph-service/test/unit/mocks/MockEpochManager.sol b/packages/subgraph-service/test/unit/mocks/MockEpochManager.sol new file mode 100644 index 000000000..060a92e21 --- /dev/null +++ b/packages/subgraph-service/test/unit/mocks/MockEpochManager.sol @@ -0,0 +1,63 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity 0.8.27; + +import { IEpochManager } from "@graphprotocol/contracts/contracts/epochs/IEpochManager.sol"; + +contract MockEpochManager is IEpochManager { + // -- Variables -- + + uint256 public epochLength; + uint256 public lastRunEpoch; + uint256 public lastLengthUpdateEpoch; + uint256 public lastLengthUpdateBlock; + + // -- Configuration -- + + function setEpochLength(uint256 _epochLength) public { + lastLengthUpdateEpoch = 1; + lastLengthUpdateBlock = blockNum(); + epochLength = _epochLength; + } + + // -- Epochs + + function runEpoch() public { + lastRunEpoch = currentEpoch(); + } + + // -- Getters -- + + function isCurrentEpochRun() public view returns (bool) { + return lastRunEpoch == currentEpoch(); + } + + function blockNum() public view returns (uint256) { + return block.number; + } + + function blockHash(uint256 _block) public view returns (bytes32) { + return blockhash(_block); + } + + function currentEpoch() public view returns (uint256) { + return lastLengthUpdateEpoch + epochsSinceUpdate(); + } + + function currentEpochBlock() public view returns (uint256) { + return lastLengthUpdateBlock + (epochsSinceUpdate() * epochLength); + } + + function currentEpochBlockSinceStart() public view returns (uint256) { + return blockNum() - currentEpochBlock(); + } + + function epochsSince(uint256 _epoch) public view returns (uint256) { + uint256 epoch = currentEpoch(); + return _epoch < epoch ? (epoch - _epoch) : 0; + } + + function epochsSinceUpdate() public view returns (uint256) { + return (blockNum() - lastLengthUpdateBlock) / epochLength; + } +} diff --git a/packages/subgraph-service/test/unit/mocks/MockGRTToken.sol b/packages/subgraph-service/test/unit/mocks/MockGRTToken.sol new file mode 100644 index 000000000..cce7f717c --- /dev/null +++ b/packages/subgraph-service/test/unit/mocks/MockGRTToken.sol @@ -0,0 +1,48 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; +import "@graphprotocol/contracts/contracts/token/IGraphToken.sol"; + +contract MockGRTToken is ERC20, IGraphToken { + constructor() ERC20("Graph Token", "GRT") {} + + function burn(uint256 amount) external { + _burn(msg.sender, amount); + } + + function burnFrom(address _from, uint256 amount) external { + _burn(_from, amount); + } + + function mint(address to, uint256 amount) public { + _mint(to, amount); + } + + // -- Mint Admin -- + + function addMinter(address _account) external {} + + function removeMinter(address _account) external {} + + function renounceMinter() external {} + + function isMinter(address _account) external view returns (bool) {} + + // -- Permit -- + + function permit( + address _owner, + address _spender, + uint256 _value, + uint256 _deadline, + uint8 _v, + bytes32 _r, + bytes32 _s + ) external {} + + // -- Allowance -- + + function increaseAllowance(address spender, uint256 addedValue) external returns (bool) {} + function decreaseAllowance(address spender, uint256 subtractedValue) external returns (bool) {} +} diff --git a/packages/subgraph-service/test/unit/mocks/MockRewardsManager.sol b/packages/subgraph-service/test/unit/mocks/MockRewardsManager.sol new file mode 100644 index 000000000..68175d535 --- /dev/null +++ b/packages/subgraph-service/test/unit/mocks/MockRewardsManager.sol @@ -0,0 +1,109 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { IRewardsManager } from "@graphprotocol/contracts/contracts/rewards/IRewardsManager.sol"; +import { PPMMath } from "@graphprotocol/horizon/contracts/libraries/PPMMath.sol"; + +import { MockGRTToken } from "./MockGRTToken.sol"; + +interface IRewardsIssuer { + function getAllocationData( + address allocationId + ) + external + view + returns ( + bool isActive, + address indexer, + bytes32 subgraphDeploymentId, + uint256 tokens, + uint256 accRewardsPerAllocatedToken + ); +} + +contract MockRewardsManager is IRewardsManager { + using PPMMath for uint256; + + MockGRTToken public token; + uint256 public rewardsPerSignal; + uint256 public rewardsPerSubgraphAllocationUpdate; + mapping(bytes32 => bool) public subgraphs; + + uint256 private constant FIXED_POINT_SCALING_FACTOR = 1e18; + + constructor(MockGRTToken _token, uint256 _rewardsPerSignal, uint256 _rewardsPerSubgraphAllocationUpdate) { + token = _token; + rewardsPerSignal = _rewardsPerSignal; + rewardsPerSubgraphAllocationUpdate = _rewardsPerSubgraphAllocationUpdate; + } + + // -- Config -- + + function setIssuancePerBlock(uint256) external {} + + function setMinimumSubgraphSignal(uint256) external {} + + function setSubgraphService(address) external {} + + // -- Denylist -- + + function setSubgraphAvailabilityOracle(address) external {} + + function setDenied(bytes32, bool) external {} + + function setDeniedMany(bytes32[] calldata, bool[] calldata) external {} + + function isDenied(bytes32) external view returns (bool) {} + + // -- Getters -- + + function getNewRewardsPerSignal() external view returns (uint256) {} + + function getAccRewardsPerSignal() external view returns (uint256) {} + + function getAccRewardsForSubgraph(bytes32) external view returns (uint256) {} + + function getAccRewardsPerAllocatedToken(bytes32) external view returns (uint256, uint256) {} + + function getRewards(address, address) external view returns (uint256) {} + + function calcRewards(uint256, uint256) external pure returns (uint256) {} + + // -- Updates -- + + function updateAccRewardsPerSignal() external returns (uint256) {} + + function takeRewards(address _allocationID) external returns (uint256) { + address rewardsIssuer = msg.sender; + (bool isActive, , , uint256 tokens, uint256 accRewardsPerAllocatedToken) = IRewardsIssuer(rewardsIssuer) + .getAllocationData(_allocationID); + + if (!isActive) { + return 0; + } + + uint256 accRewardsPerTokens = tokens.mulPPM(rewardsPerSignal); + uint256 rewards = accRewardsPerTokens - accRewardsPerAllocatedToken; + token.mint(rewardsIssuer, rewards); + return rewards; + } + + // -- Hooks -- + + function onSubgraphSignalUpdate(bytes32) external pure returns (uint256) {} + + function onSubgraphAllocationUpdate(bytes32 _subgraphDeploymentID) external returns (uint256) { + if (subgraphs[_subgraphDeploymentID]) { + return rewardsPerSubgraphAllocationUpdate; + } + + subgraphs[_subgraphDeploymentID] = true; + return 0; + } + + function subgraphService() external pure returns (address) { + return address(0x00); + } +} diff --git a/packages/subgraph-service/test/unit/shared/HorizonStakingShared.t.sol b/packages/subgraph-service/test/unit/shared/HorizonStakingShared.t.sol new file mode 100644 index 000000000..55990a2b7 --- /dev/null +++ b/packages/subgraph-service/test/unit/shared/HorizonStakingShared.t.sol @@ -0,0 +1,150 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { IGraphPayments } from "@graphprotocol/horizon/contracts/interfaces/IGraphPayments.sol"; +import { IHorizonStakingTypes } from "@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingTypes.sol"; +import { IHorizonStakingExtension } from "@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingExtension.sol"; + +import { SubgraphBaseTest } from "../SubgraphBaseTest.t.sol"; + +abstract contract HorizonStakingSharedTest is SubgraphBaseTest { + /* + * HELPERS + */ + + function _provision( + address _indexer, + uint256 _tokens, + uint32 _maxSlashingPercentage, + uint64 _disputePeriod + ) internal { + staking.provision(_indexer, address(subgraphService), _tokens, _maxSlashingPercentage, _disputePeriod); + } + + function _createProvision( + address _indexer, + uint256 _tokens, + uint32 _maxSlashingPercentage, + uint64 _disputePeriod + ) internal { + _stakeTo(_indexer, _tokens); + staking.provision(_indexer, address(subgraphService), _tokens, _maxSlashingPercentage, _disputePeriod); + } + + function _addToProvision(address _indexer, uint256 _tokens) internal { + _stakeTo(_indexer, _tokens); + staking.addToProvision(_indexer, address(subgraphService), _tokens); + } + + function _delegate(address _indexer, address _verifier, uint256 _tokens, uint256 _minSharesOut) internal { + staking.delegate(_indexer, _verifier, _tokens, _minSharesOut); + } + + function _undelegate(address _indexer, address _verifier, uint256 _shares) internal { + staking.undelegate(_indexer, _verifier, _shares); + } + + function _setDelegationFeeCut( + address _indexer, + address _verifier, + IGraphPayments.PaymentTypes _paymentType, + uint256 _cut + ) internal { + staking.setDelegationFeeCut(_indexer, _verifier, _paymentType, _cut); + } + + function _thawDeprovisionAndUnstake(address _indexer, address _verifier, uint256 _tokens) internal { + // Initiate thaw request + staking.thaw(_indexer, _verifier, _tokens); + + // Skip thawing period + IHorizonStakingTypes.Provision memory provision = staking.getProvision(_indexer, _verifier); + skip(provision.thawingPeriod + 1); + + // Deprovision and unstake + staking.deprovision(_indexer, _verifier, 0); + staking.unstake(_tokens); + } + + function _setProvisionParameters( + address _indexer, + address _verifier, + uint32 _maxVerifierCut, + uint64 _thawingPeriod + ) internal { + staking.setProvisionParameters(_indexer, _verifier, _maxVerifierCut, _thawingPeriod); + } + + function _setStorage_allocation_hardcoded(address indexer, address allocationId, uint256 tokens) internal { + IHorizonStakingExtension.Allocation memory allocation = IHorizonStakingExtension.Allocation({ + indexer: indexer, + subgraphDeploymentID: bytes32("0x12344321"), + tokens: tokens, + createdAtEpoch: 1234, + closedAtEpoch: 1235, + collectedFees: 1234, + __DEPRECATED_effectiveAllocation: 1222234, + accRewardsPerAllocatedToken: 1233334, + distributedRebates: 1244434 + }); + + // __DEPRECATED_allocations + uint256 allocationsSlot = 15; + bytes32 allocationBaseSlot = keccak256(abi.encode(allocationId, allocationsSlot)); + vm.store(address(staking), allocationBaseSlot, bytes32(uint256(uint160(allocation.indexer)))); + vm.store(address(staking), bytes32(uint256(allocationBaseSlot) + 1), allocation.subgraphDeploymentID); + vm.store(address(staking), bytes32(uint256(allocationBaseSlot) + 2), bytes32(tokens)); + vm.store(address(staking), bytes32(uint256(allocationBaseSlot) + 3), bytes32(allocation.createdAtEpoch)); + vm.store(address(staking), bytes32(uint256(allocationBaseSlot) + 4), bytes32(allocation.closedAtEpoch)); + vm.store(address(staking), bytes32(uint256(allocationBaseSlot) + 5), bytes32(allocation.collectedFees)); + vm.store( + address(staking), + bytes32(uint256(allocationBaseSlot) + 6), + bytes32(allocation.__DEPRECATED_effectiveAllocation) + ); + vm.store( + address(staking), + bytes32(uint256(allocationBaseSlot) + 7), + bytes32(allocation.accRewardsPerAllocatedToken) + ); + vm.store(address(staking), bytes32(uint256(allocationBaseSlot) + 8), bytes32(allocation.distributedRebates)); + + // _serviceProviders + uint256 serviceProviderSlot = 14; + bytes32 serviceProviderBaseSlot = keccak256(abi.encode(allocation.indexer, serviceProviderSlot)); + uint256 currentTokensStaked = uint256(vm.load(address(staking), serviceProviderBaseSlot)); + uint256 currentTokensProvisioned = uint256( + vm.load(address(staking), bytes32(uint256(serviceProviderBaseSlot) + 1)) + ); + vm.store( + address(staking), + bytes32(uint256(serviceProviderBaseSlot) + 0), + bytes32(currentTokensStaked + tokens) + ); + vm.store( + address(staking), + bytes32(uint256(serviceProviderBaseSlot) + 1), + bytes32(currentTokensProvisioned + tokens) + ); + + // __DEPRECATED_subgraphAllocations + uint256 subgraphsAllocationsSlot = 16; + bytes32 subgraphAllocationsBaseSlot = keccak256( + abi.encode(allocation.subgraphDeploymentID, subgraphsAllocationsSlot) + ); + uint256 currentAllocatedTokens = uint256(vm.load(address(staking), subgraphAllocationsBaseSlot)); + vm.store(address(staking), subgraphAllocationsBaseSlot, bytes32(currentAllocatedTokens + tokens)); + } + + function _stakeTo(address _indexer, uint256 _tokens) internal { + token.approve(address(staking), _tokens); + staking.stakeTo(_indexer, _tokens); + } + + function _stake(uint256 _tokens) internal { + token.approve(address(staking), _tokens); + staking.stake(_tokens); + } +} diff --git a/packages/subgraph-service/test/unit/shared/SubgraphServiceShared.t.sol b/packages/subgraph-service/test/unit/shared/SubgraphServiceShared.t.sol new file mode 100644 index 000000000..9c018d282 --- /dev/null +++ b/packages/subgraph-service/test/unit/shared/SubgraphServiceShared.t.sol @@ -0,0 +1,201 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { Allocation } from "../../../contracts/libraries/Allocation.sol"; +import { AllocationManager } from "../../../contracts/utilities/AllocationManager.sol"; +import { IDataService } from "@graphprotocol/horizon/contracts/data-service/interfaces/IDataService.sol"; +import { ISubgraphService } from "../../../contracts/interfaces/ISubgraphService.sol"; + +import { HorizonStakingSharedTest } from "./HorizonStakingShared.t.sol"; + +abstract contract SubgraphServiceSharedTest is HorizonStakingSharedTest { + using Allocation for Allocation.State; + + /* + * VARIABLES + */ + + uint256 allocationIDPrivateKey; + address allocationID; + bytes32 subgraphDeployment; + + /* + * MODIFIERS + */ + + modifier useIndexer() { + vm.startPrank(users.indexer); + _; + vm.stopPrank(); + } + + modifier useAllocation(uint256 tokens) { + vm.assume(tokens >= minimumProvisionTokens); + vm.assume(tokens < 10_000_000_000 ether); + _createProvision(users.indexer, tokens, fishermanRewardPercentage, disputePeriod); + _register(users.indexer, abi.encode("url", "geoHash", address(0))); + bytes memory data = _createSubgraphAllocationData( + users.indexer, + subgraphDeployment, + allocationIDPrivateKey, + tokens + ); + _startService(users.indexer, data); + _; + } + + modifier useDelegation(uint256 tokens) { + vm.assume(tokens > MIN_DELEGATION); + vm.assume(tokens < 10_000_000_000 ether); + (, address msgSender, ) = vm.readCallers(); + resetPrank(users.delegator); + token.approve(address(staking), tokens); + _delegate(users.indexer, address(subgraphService), tokens, 0); + resetPrank(msgSender); + _; + } + + /* + * SET UP + */ + + function setUp() public virtual override { + super.setUp(); + (allocationID, allocationIDPrivateKey) = makeAddrAndKey("allocationId"); + subgraphDeployment = keccak256(abi.encodePacked("Subgraph Deployment ID")); + } + + /* + * ACTIONS + */ + + function _register(address _indexer, bytes memory _data) internal { + (string memory url, string memory geohash, address rewardsDestination) = abi.decode( + _data, + (string, string, address) + ); + + vm.expectEmit(address(subgraphService)); + emit IDataService.ServiceProviderRegistered(_indexer, _data); + + // Register indexer + subgraphService.register(_indexer, _data); + + // Check registered indexer data + ISubgraphService.Indexer memory indexer = _getIndexer(_indexer); + assertEq(indexer.registeredAt, block.timestamp); + assertEq(indexer.url, url); + assertEq(indexer.geoHash, geohash); + + // Check rewards destination + assertEq(subgraphService.paymentsDestination(_indexer), rewardsDestination); + } + + function _startService(address _indexer, bytes memory _data) internal { + (bytes32 subgraphDeploymentId, uint256 tokens, address allocationId, ) = abi.decode( + _data, + (bytes32, uint256, address, bytes) + ); + uint256 previousSubgraphAllocatedTokens = subgraphService.getSubgraphAllocatedTokens(subgraphDeploymentId); + uint256 currentEpoch = epochManager.currentEpoch(); + + vm.expectEmit(address(subgraphService)); + emit IDataService.ServiceStarted(_indexer, _data); + emit AllocationManager.AllocationCreated(_indexer, allocationId, subgraphDeploymentId, tokens, currentEpoch); + + // TODO: improve this + uint256 accRewardsPerAllocatedToken = 0; + if (rewardsManager.subgraphs(subgraphDeploymentId)) { + accRewardsPerAllocatedToken = rewardsManager.rewardsPerSubgraphAllocationUpdate(); + } + + // Start service + subgraphService.startService(_indexer, _data); + + // Check allocation data + Allocation.State memory allocation = subgraphService.getAllocation(allocationId); + assertEq(allocation.tokens, tokens); + assertEq(allocation.indexer, _indexer); + assertEq(allocation.subgraphDeploymentId, subgraphDeploymentId); + assertEq(allocation.createdAt, block.timestamp); + assertEq(allocation.closedAt, 0); + assertEq(allocation.lastPOIPresentedAt, 0); + assertEq(allocation.accRewardsPerAllocatedToken, accRewardsPerAllocatedToken); + assertEq(allocation.accRewardsPending, 0); + assertEq(allocation.createdAtEpoch, currentEpoch); + + // Check subgraph deployment allocated tokens + uint256 subgraphAllocatedTokens = subgraphService.getSubgraphAllocatedTokens(subgraphDeploymentId); + assertEq(subgraphAllocatedTokens, previousSubgraphAllocatedTokens + tokens); + } + + function _stopService(address _indexer, bytes memory _data) internal { + address allocationId = abi.decode(_data, (address)); + + Allocation.State memory allocation = subgraphService.getAllocation(allocationId); + assertTrue(allocation.isOpen()); + uint256 previousSubgraphAllocatedTokens = subgraphService.getSubgraphAllocatedTokens( + allocation.subgraphDeploymentId + ); + + vm.expectEmit(address(subgraphService)); + emit AllocationManager.AllocationClosed( + _indexer, + allocationId, + allocation.subgraphDeploymentId, + allocation.tokens, + false + ); + emit IDataService.ServiceStopped(_indexer, _data); + + // stop allocation + subgraphService.stopService(_indexer, _data); + + // update allocation + allocation = subgraphService.getAllocation(allocationId); + + // check allocation + assertEq(allocation.closedAt, block.timestamp); + + // check subgraph deployment allocated tokens + uint256 subgraphAllocatedTokens = subgraphService.getSubgraphAllocatedTokens(subgraphDeployment); + assertEq(subgraphAllocatedTokens, previousSubgraphAllocatedTokens - allocation.tokens); + } + + /* + * HELPERS + */ + + function _createSubgraphAllocationData( + address _indexer, + bytes32 _subgraphDeployment, + uint256 _allocationIdPrivateKey, + uint256 _tokens + ) internal view returns (bytes memory) { + address allocationId = vm.addr(_allocationIdPrivateKey); + bytes32 digest = subgraphService.encodeAllocationProof(_indexer, allocationId); + (uint8 v, bytes32 r, bytes32 s) = vm.sign(_allocationIdPrivateKey, digest); + + return abi.encode(_subgraphDeployment, _tokens, allocationId, abi.encodePacked(r, s, v)); + } + + function _delegate(uint256 tokens) internal { + token.approve(address(staking), tokens); + staking.delegate(users.indexer, address(subgraphService), tokens, 0); + } + + function _calculateStakeSnapshot(uint256 _tokens, uint256 _tokensDelegated) internal pure returns (uint256) { + return _tokens + _tokensDelegated; + } + + /* + * PRIVATE FUNCTIONS + */ + + function _getIndexer(address _indexer) private view returns (ISubgraphService.Indexer memory) { + (uint256 registeredAt, string memory url, string memory geoHash) = subgraphService.indexers(_indexer); + return ISubgraphService.Indexer({ registeredAt: registeredAt, url: url, geoHash: geoHash }); + } +} diff --git a/packages/subgraph-service/test/unit/subgraphService/SubgraphService.t.sol b/packages/subgraph-service/test/unit/subgraphService/SubgraphService.t.sol new file mode 100644 index 000000000..3b1a74e18 --- /dev/null +++ b/packages/subgraph-service/test/unit/subgraphService/SubgraphService.t.sol @@ -0,0 +1,551 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { IDataService } from "@graphprotocol/horizon/contracts/data-service/interfaces/IDataService.sol"; +import { IGraphPayments } from "@graphprotocol/horizon/contracts/interfaces/IGraphPayments.sol"; +import { PPMMath } from "@graphprotocol/horizon/contracts/libraries/PPMMath.sol"; +import { IHorizonStakingTypes } from "@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingTypes.sol"; +import { IGraphTallyCollector } from "@graphprotocol/horizon/contracts/interfaces/IGraphTallyCollector.sol"; +import { ECDSA } from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; +import { LinkedList } from "@graphprotocol/horizon/contracts/libraries/LinkedList.sol"; +import { IDataServiceFees } from "@graphprotocol/horizon/contracts/data-service/interfaces/IDataServiceFees.sol"; +import { IHorizonStakingTypes } from "@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingTypes.sol"; + +import { Allocation } from "../../../contracts/libraries/Allocation.sol"; +import { AllocationManager } from "../../../contracts/utilities/AllocationManager.sol"; +import { ISubgraphService } from "../../../contracts/interfaces/ISubgraphService.sol"; +import { LegacyAllocation } from "../../../contracts/libraries/LegacyAllocation.sol"; +import { SubgraphServiceSharedTest } from "../shared/SubgraphServiceShared.t.sol"; + +contract SubgraphServiceTest is SubgraphServiceSharedTest { + using PPMMath for uint256; + using Allocation for Allocation.State; + using LinkedList for LinkedList.List; + + /* + * MODIFIERS + */ + + modifier useGovernor() { + vm.startPrank(users.governor); + _; + vm.stopPrank(); + } + + modifier useOperator() { + resetPrank(users.indexer); + staking.setOperator(address(subgraphService), users.operator, true); + resetPrank(users.operator); + _; + vm.stopPrank(); + } + + modifier useRewardsDestination() { + _setRewardsDestination(users.rewardsDestination); + _; + } + + /* + * SET UP + */ + + function setUp() public virtual override { + super.setUp(); + } + + /* + * ACTIONS + */ + + function _setRewardsDestination(address _rewardsDestination) internal { + (, address indexer, ) = vm.readCallers(); + + vm.expectEmit(address(subgraphService)); + emit ISubgraphService.PaymentsDestinationSet(indexer, _rewardsDestination); + + // Set rewards destination + subgraphService.setPaymentsDestination(_rewardsDestination); + + // Check rewards destination + assertEq(subgraphService.paymentsDestination(indexer), _rewardsDestination); + } + + function _acceptProvision(address _indexer, bytes memory _data) internal { + IHorizonStakingTypes.Provision memory provision = staking.getProvision(_indexer, address(subgraphService)); + uint32 maxVerifierCut = provision.maxVerifierCut; + uint64 thawingPeriod = provision.thawingPeriod; + uint32 maxVerifierCutPending = provision.maxVerifierCutPending; + uint64 thawingPeriodPending = provision.thawingPeriodPending; + + vm.expectEmit(address(subgraphService)); + emit IDataService.ProvisionPendingParametersAccepted(_indexer); + + // Accept provision + subgraphService.acceptProvisionPendingParameters(_indexer, _data); + + // Update provision after acceptance + provision = staking.getProvision(_indexer, address(subgraphService)); + + // Check that max verifier cut updated to pending value if needed + if (maxVerifierCut != maxVerifierCutPending) { + assertEq(provision.maxVerifierCut, maxVerifierCutPending); + } + + // Check that thawing period updated to pending value if needed + if (thawingPeriod != thawingPeriodPending) { + assertEq(provision.thawingPeriod, thawingPeriodPending); + } + } + + function _resizeAllocation(address _indexer, address _allocationId, uint256 _tokens) internal { + // before state + Allocation.State memory beforeAllocation = subgraphService.getAllocation(_allocationId); + bytes32 subgraphDeploymentId = beforeAllocation.subgraphDeploymentId; + uint256 beforeSubgraphAllocatedTokens = subgraphService.getSubgraphAllocatedTokens(subgraphDeploymentId); + uint256 beforeAllocatedTokens = subgraphService.allocationProvisionTracker(_indexer); + + uint256 allocatedTokensDelta; + if (_tokens > beforeAllocation.tokens) { + allocatedTokensDelta = _tokens - beforeAllocation.tokens; + } else { + allocatedTokensDelta = beforeAllocation.tokens - _tokens; + } + + vm.expectEmit(address(subgraphService)); + emit AllocationManager.AllocationResized( + _indexer, + _allocationId, + subgraphDeploymentId, + _tokens, + beforeSubgraphAllocatedTokens + ); + + // resize allocation + subgraphService.resizeAllocation(_indexer, _allocationId, _tokens); + + // after state + uint256 afterSubgraphAllocatedTokens = subgraphService.getSubgraphAllocatedTokens(subgraphDeploymentId); + uint256 afterAllocatedTokens = subgraphService.allocationProvisionTracker(_indexer); + Allocation.State memory afterAllocation = subgraphService.getAllocation(_allocationId); + uint256 accRewardsPerAllocatedTokenDelta = afterAllocation.accRewardsPerAllocatedToken - + beforeAllocation.accRewardsPerAllocatedToken; + uint256 afterAccRewardsPending = rewardsManager.calcRewards( + beforeAllocation.tokens, + accRewardsPerAllocatedTokenDelta + ); + + // check state + if (_tokens > beforeAllocation.tokens) { + assertEq(afterAllocatedTokens, beforeAllocatedTokens + allocatedTokensDelta); + } else { + assertEq(afterAllocatedTokens, beforeAllocatedTokens - allocatedTokensDelta); + } + assertEq(afterAllocation.tokens, _tokens); + assertEq(afterAllocation.accRewardsPerAllocatedToken, rewardsPerSubgraphAllocationUpdate); + assertEq(afterAllocation.accRewardsPending, afterAccRewardsPending); + assertEq(afterSubgraphAllocatedTokens, _tokens); + } + + function _closeStaleAllocation(address _allocationId) internal { + Allocation.State memory allocation = subgraphService.getAllocation(_allocationId); + assertTrue(allocation.isOpen()); + uint256 previousSubgraphAllocatedTokens = subgraphService.getSubgraphAllocatedTokens( + allocation.subgraphDeploymentId + ); + + vm.expectEmit(address(subgraphService)); + emit AllocationManager.AllocationClosed( + allocation.indexer, + _allocationId, + allocation.subgraphDeploymentId, + allocation.tokens, + true + ); + + // close stale allocation + subgraphService.closeStaleAllocation(_allocationId); + + // update allocation + allocation = subgraphService.getAllocation(_allocationId); + + // check allocation + assertEq(allocation.closedAt, block.timestamp); + + // check subgraph deployment allocated tokens + uint256 subgraphAllocatedTokens = subgraphService.getSubgraphAllocatedTokens(subgraphDeployment); + assertEq(subgraphAllocatedTokens, previousSubgraphAllocatedTokens - allocation.tokens); + } + + struct IndexingRewardsData { + bytes32 poi; + bytes poiMetadata; + uint256 tokensIndexerRewards; + uint256 tokensDelegationRewards; + } + + struct QueryFeeData { + uint256 curationCut; + uint256 protocolPaymentCut; + } + + struct CollectPaymentData { + uint256 rewardsDestinationBalance; + uint256 indexerProvisionBalance; + uint256 delegationPoolBalance; + uint256 indexerBalance; + uint256 curationBalance; + uint256 lockedTokens; + uint256 indexerStake; + } + + function _collect(address _indexer, IGraphPayments.PaymentTypes _paymentType, bytes memory _data) internal { + // Reset storage variables + uint256 paymentCollected = 0; + address allocationId; + IndexingRewardsData memory indexingRewardsData; + CollectPaymentData memory collectPaymentDataBefore = _collectPaymentDataBefore(_indexer); + + if (_paymentType == IGraphPayments.PaymentTypes.QueryFee) { + paymentCollected = _handleQueryFeeCollection(_indexer, _data); + } else if (_paymentType == IGraphPayments.PaymentTypes.IndexingRewards) { + (paymentCollected, allocationId, indexingRewardsData) = _handleIndexingRewardsCollection(_data); + } + + vm.expectEmit(address(subgraphService)); + emit IDataService.ServicePaymentCollected(_indexer, _paymentType, paymentCollected); + + // collect rewards + subgraphService.collect(_indexer, _paymentType, _data); + + CollectPaymentData memory collectPaymentDataAfter = _collectPaymentDataAfter(_indexer); + + if (_paymentType == IGraphPayments.PaymentTypes.QueryFee) { + _verifyQueryFeeCollection( + _indexer, + paymentCollected, + _data, + collectPaymentDataBefore, + collectPaymentDataAfter + ); + } else if (_paymentType == IGraphPayments.PaymentTypes.IndexingRewards) { + _verifyIndexingRewardsCollection( + _indexer, + allocationId, + indexingRewardsData, + collectPaymentDataBefore, + collectPaymentDataAfter + ); + } + } + + function _collectPaymentDataBefore(address _indexer) private view returns (CollectPaymentData memory) { + address paymentsDestination = subgraphService.paymentsDestination(_indexer); + CollectPaymentData memory collectPaymentDataBefore; + collectPaymentDataBefore.rewardsDestinationBalance = token.balanceOf(paymentsDestination); + collectPaymentDataBefore.indexerProvisionBalance = staking.getProviderTokensAvailable( + _indexer, + address(subgraphService) + ); + collectPaymentDataBefore.delegationPoolBalance = staking.getDelegatedTokensAvailable( + _indexer, + address(subgraphService) + ); + collectPaymentDataBefore.indexerBalance = token.balanceOf(_indexer); + collectPaymentDataBefore.curationBalance = token.balanceOf(address(curation)); + collectPaymentDataBefore.lockedTokens = subgraphService.feesProvisionTracker(_indexer); + collectPaymentDataBefore.indexerStake = staking.getStake(_indexer); + return collectPaymentDataBefore; + } + + function _collectPaymentDataAfter(address _indexer) private view returns (CollectPaymentData memory) { + CollectPaymentData memory collectPaymentDataAfter; + address paymentsDestination = subgraphService.paymentsDestination(_indexer); + collectPaymentDataAfter.rewardsDestinationBalance = token.balanceOf(paymentsDestination); + collectPaymentDataAfter.indexerProvisionBalance = staking.getProviderTokensAvailable( + _indexer, + address(subgraphService) + ); + collectPaymentDataAfter.delegationPoolBalance = staking.getDelegatedTokensAvailable( + _indexer, + address(subgraphService) + ); + collectPaymentDataAfter.indexerBalance = token.balanceOf(_indexer); + collectPaymentDataAfter.curationBalance = token.balanceOf(address(curation)); + collectPaymentDataAfter.lockedTokens = subgraphService.feesProvisionTracker(_indexer); + collectPaymentDataAfter.indexerStake = staking.getStake(_indexer); + return collectPaymentDataAfter; + } + + function _handleQueryFeeCollection( + address _indexer, + bytes memory _data + ) private returns (uint256 paymentCollected) { + (IGraphTallyCollector.SignedRAV memory signedRav, uint256 tokensToCollect) = abi.decode( + _data, + (IGraphTallyCollector.SignedRAV, uint256) + ); + address allocationId = address(uint160(uint256(signedRav.rav.collectionId))); + Allocation.State memory allocation = subgraphService.getAllocation(allocationId); + bytes32 subgraphDeploymentId = allocation.subgraphDeploymentId; + + address payer = graphTallyCollector.isAuthorized(signedRav.rav.payer, _recoverRAVSigner(signedRav)) + ? signedRav.rav.payer + : address(0); + + uint256 tokensCollected = graphTallyCollector.tokensCollected( + address(subgraphService), + signedRav.rav.collectionId, + _indexer, + payer + ); + paymentCollected = tokensToCollect == 0 ? signedRav.rav.valueAggregate - tokensCollected : tokensToCollect; + + QueryFeeData memory queryFeeData = _queryFeeData(allocation.subgraphDeploymentId); + uint256 tokensProtocol = paymentCollected.mulPPMRoundUp(queryFeeData.protocolPaymentCut); + uint256 tokensCurators = (paymentCollected - tokensProtocol).mulPPMRoundUp(queryFeeData.curationCut); + + vm.expectEmit(address(subgraphService)); + emit ISubgraphService.QueryFeesCollected( + _indexer, + payer, + allocationId, + subgraphDeploymentId, + paymentCollected, + tokensCurators + ); + + return paymentCollected; + } + + function _queryFeeData(bytes32 _subgraphDeploymentId) private view returns (QueryFeeData memory) { + QueryFeeData memory queryFeeData; + queryFeeData.protocolPaymentCut = graphPayments.PROTOCOL_PAYMENT_CUT(); + uint256 curationFeesCut = subgraphService.curationFeesCut(); + queryFeeData.curationCut = curation.isCurated(_subgraphDeploymentId) ? curationFeesCut : 0; + return queryFeeData; + } + + function _handleIndexingRewardsCollection( + bytes memory _data + ) private returns (uint256 paymentCollected, address allocationId, IndexingRewardsData memory indexingRewardsData) { + (allocationId, indexingRewardsData.poi, indexingRewardsData.poiMetadata) = abi.decode( + _data, + (address, bytes32, bytes) + ); + Allocation.State memory allocation = subgraphService.getAllocation(allocationId); + + // Calculate accumulated tokens, this depends on the rewards manager which we have mocked + uint256 accRewardsPerTokens = allocation.tokens.mulPPM(rewardsManager.rewardsPerSignal()); + // Calculate the payment collected by the indexer for this transaction + paymentCollected = accRewardsPerTokens - allocation.accRewardsPerAllocatedToken; + + uint256 currentEpoch = epochManager.currentEpoch(); + paymentCollected = currentEpoch > allocation.createdAtEpoch ? paymentCollected : 0; + + uint256 delegatorCut = staking.getDelegationFeeCut( + allocation.indexer, + address(subgraphService), + IGraphPayments.PaymentTypes.IndexingRewards + ); + IHorizonStakingTypes.DelegationPool memory delegationPool = staking.getDelegationPool( + allocation.indexer, + address(subgraphService) + ); + indexingRewardsData.tokensDelegationRewards = delegationPool.shares > 0 + ? paymentCollected.mulPPM(delegatorCut) + : 0; + indexingRewardsData.tokensIndexerRewards = paymentCollected - indexingRewardsData.tokensDelegationRewards; + + vm.expectEmit(address(subgraphService)); + emit AllocationManager.IndexingRewardsCollected( + allocation.indexer, + allocationId, + allocation.subgraphDeploymentId, + paymentCollected, + indexingRewardsData.tokensIndexerRewards, + indexingRewardsData.tokensDelegationRewards, + indexingRewardsData.poi, + indexingRewardsData.poiMetadata, + epochManager.currentEpoch() + ); + + return (paymentCollected, allocationId, indexingRewardsData); + } + + function _verifyQueryFeeCollection( + address _indexer, + uint256 _paymentCollected, + bytes memory _data, + CollectPaymentData memory collectPaymentDataBefore, + CollectPaymentData memory collectPaymentDataAfter + ) private view { + (IGraphTallyCollector.SignedRAV memory signedRav, uint256 tokensToCollect) = abi.decode( + _data, + (IGraphTallyCollector.SignedRAV, uint256) + ); + Allocation.State memory allocation = subgraphService.getAllocation( + address(uint160(uint256(signedRav.rav.collectionId))) + ); + QueryFeeData memory queryFeeData = _queryFeeData(allocation.subgraphDeploymentId); + uint256 tokensProtocol = _paymentCollected.mulPPMRoundUp(queryFeeData.protocolPaymentCut); + uint256 curationTokens = (_paymentCollected - tokensProtocol).mulPPMRoundUp(queryFeeData.curationCut); + uint256 expectedIndexerTokensPayment = _paymentCollected - tokensProtocol - curationTokens; + + assertEq( + collectPaymentDataAfter.indexerBalance - collectPaymentDataBefore.indexerBalance, + subgraphService.paymentsDestination(signedRav.rav.serviceProvider) == address(0) + ? 0 + : expectedIndexerTokensPayment + ); + + assertEq( + collectPaymentDataAfter.rewardsDestinationBalance - collectPaymentDataBefore.rewardsDestinationBalance, + subgraphService.paymentsDestination(signedRav.rav.serviceProvider) == address(0) + ? 0 + : expectedIndexerTokensPayment + ); + + assertEq( + collectPaymentDataAfter.indexerStake - collectPaymentDataBefore.indexerStake, + subgraphService.paymentsDestination(signedRav.rav.serviceProvider) == address(0) + ? expectedIndexerTokensPayment + : 0 + ); + assertEq(collectPaymentDataAfter.curationBalance, collectPaymentDataBefore.curationBalance + curationTokens); + + // Check locked tokens + uint256 tokensToLock = _paymentCollected * subgraphService.stakeToFeesRatio(); + assertEq(collectPaymentDataAfter.lockedTokens, collectPaymentDataBefore.lockedTokens + tokensToLock); + + // Check the stake claim + LinkedList.List memory claimsList = _getClaimList(_indexer); + bytes32 claimId = _buildStakeClaimId(_indexer, claimsList.nonce - 1); + IDataServiceFees.StakeClaim memory stakeClaim = _getStakeClaim(claimId); + uint64 disputePeriod = disputeManager.getDisputePeriod(); + assertEq(stakeClaim.tokens, tokensToLock); + assertEq(stakeClaim.createdAt, block.timestamp); + assertEq(stakeClaim.releasableAt, block.timestamp + disputePeriod); + assertEq(stakeClaim.nextClaim, bytes32(0)); + } + + function _verifyIndexingRewardsCollection( + address _indexer, + address allocationId, + IndexingRewardsData memory indexingRewardsData, + CollectPaymentData memory collectPaymentDataBefore, + CollectPaymentData memory collectPaymentDataAfter + ) private { + Allocation.State memory allocation = subgraphService.getAllocation(allocationId); + + // Check allocation state + assertEq(allocation.accRewardsPending, 0); + uint256 accRewardsPerAllocatedToken = rewardsManager.onSubgraphAllocationUpdate( + allocation.subgraphDeploymentId + ); + assertEq(allocation.accRewardsPerAllocatedToken, accRewardsPerAllocatedToken); + assertEq(allocation.lastPOIPresentedAt, block.timestamp); + + // Check indexer got paid the correct amount + address paymentsDestination = subgraphService.paymentsDestination(_indexer); + if (paymentsDestination == address(0)) { + // If rewards destination is address zero indexer should get paid to their provision balance + assertEq( + collectPaymentDataAfter.indexerProvisionBalance, + collectPaymentDataBefore.indexerProvisionBalance + indexingRewardsData.tokensIndexerRewards + ); + } else { + // If rewards destination is set indexer should get paid to the rewards destination address + assertEq( + collectPaymentDataAfter.rewardsDestinationBalance, + collectPaymentDataBefore.rewardsDestinationBalance + indexingRewardsData.tokensIndexerRewards + ); + } + + // Check delegation pool got paid the correct amount + assertEq( + collectPaymentDataAfter.delegationPoolBalance, + collectPaymentDataBefore.delegationPoolBalance + indexingRewardsData.tokensDelegationRewards + ); + + // If after collecting indexing rewards the indexer is over allocated the allcation should close + uint256 tokensAvailable = staking.getTokensAvailable( + _indexer, + address(subgraphService), + subgraphService.getDelegationRatio() + ); + if (allocation.tokens <= tokensAvailable) { + // Indexer isn't over allocated so allocation should still be open + assertTrue(allocation.isOpen()); + } else { + // Indexer is over allocated so allocation should be closed + assertFalse(allocation.isOpen()); + } + } + + function _migrateLegacyAllocation(address _indexer, address _allocationId, bytes32 _subgraphDeploymentID) internal { + vm.expectEmit(address(subgraphService)); + emit AllocationManager.LegacyAllocationMigrated(_indexer, _allocationId, _subgraphDeploymentID); + + subgraphService.migrateLegacyAllocation(_indexer, _allocationId, _subgraphDeploymentID); + + LegacyAllocation.State memory afterLegacyAllocation = subgraphService.getLegacyAllocation(_allocationId); + assertEq(afterLegacyAllocation.indexer, _indexer); + assertEq(afterLegacyAllocation.subgraphDeploymentId, _subgraphDeploymentID); + } + + /* + * HELPERS + */ + + function _createAndStartAllocation(address _indexer, uint256 _tokens) internal { + mint(_indexer, _tokens); + + resetPrank(_indexer); + token.approve(address(staking), _tokens); + staking.stakeTo(_indexer, _tokens); + staking.provision(_indexer, address(subgraphService), _tokens, fishermanRewardPercentage, disputePeriod); + _register(_indexer, abi.encode("url", "geoHash", address(0))); + + (address newIndexerAllocationId, uint256 newIndexerAllocationKey) = makeAddrAndKey("newIndexerAllocationId"); + bytes32 digest = subgraphService.encodeAllocationProof(_indexer, newIndexerAllocationId); + (uint8 v, bytes32 r, bytes32 s) = vm.sign(newIndexerAllocationKey, digest); + + bytes memory data = abi.encode(subgraphDeployment, _tokens, newIndexerAllocationId, abi.encodePacked(r, s, v)); + _startService(_indexer, data); + } + + /* + * PRIVATE FUNCTIONS + */ + + function _recoverRAVSigner(IGraphTallyCollector.SignedRAV memory _signedRAV) private view returns (address) { + bytes32 messageHash = graphTallyCollector.encodeRAV(_signedRAV.rav); + return ECDSA.recover(messageHash, _signedRAV.signature); + } + + function _getClaimList(address _indexer) private view returns (LinkedList.List memory) { + (bytes32 head, bytes32 tail, uint256 nonce, uint256 count) = subgraphService.claimsLists(_indexer); + return LinkedList.List(head, tail, nonce, count); + } + + function _buildStakeClaimId(address _indexer, uint256 _nonce) private view returns (bytes32) { + return keccak256(abi.encodePacked(address(subgraphService), _indexer, _nonce)); + } + + function _getStakeClaim(bytes32 _claimId) private view returns (IDataServiceFees.StakeClaim memory) { + (uint256 tokens, uint256 createdAt, uint256 releasableAt, bytes32 nextClaim) = subgraphService.claims(_claimId); + return IDataServiceFees.StakeClaim(tokens, createdAt, releasableAt, nextClaim); + } + + // This doesn't matter for testing because the metadata is not decoded onchain but it's expected to be of the form: + // - uint256 blockNumber - the block number (indexed chain) the poi’s where computed at + // - bytes32 publicPOI - the public POI matching the presenting poi + // - uint8 indexingStatus - status (failed, syncing, etc). Mapping maintained by indexer agent. + // - uint8 errorCode - Again up to indexer agent, but seems sensible to use 0 if no error, and error codes for anything else. + // - uint256 errorBlockNumber - Block number (indexed chain) where the indexing error happens. 0 if no error. + function _getHardcodedPOIMetadata() internal view returns (bytes memory) { + return abi.encode(block.number, bytes32("PUBLIC_POI1"), uint8(0), uint8(0), uint256(0)); + } +} diff --git a/packages/subgraph-service/test/unit/subgraphService/allocation/forceClose.t.sol b/packages/subgraph-service/test/unit/subgraphService/allocation/forceClose.t.sol new file mode 100644 index 000000000..9acfbc37f --- /dev/null +++ b/packages/subgraph-service/test/unit/subgraphService/allocation/forceClose.t.sol @@ -0,0 +1,104 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { PausableUpgradeable } from "@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol"; +import { IGraphPayments } from "@graphprotocol/horizon/contracts/interfaces/IGraphPayments.sol"; + +import { Allocation } from "../../../../contracts/libraries/Allocation.sol"; +import { ISubgraphService } from "../../../../contracts/interfaces/ISubgraphService.sol"; +import { SubgraphServiceTest } from "../SubgraphService.t.sol"; + +contract SubgraphServiceAllocationForceCloseTest is SubgraphServiceTest { + address private permissionlessBob = makeAddr("permissionlessBob"); + + /* + * TESTS + */ + + function test_SubgraphService_Allocation_ForceClose_Stale(uint256 tokens) public useIndexer useAllocation(tokens) { + // Skip forward + skip(maxPOIStaleness + 1); + + resetPrank(permissionlessBob); + _closeStaleAllocation(allocationID); + } + + function test_SubgraphService_Allocation_ForceClose_Stale_AfterCollecting( + uint256 tokens + ) public useIndexer useAllocation(tokens) { + // Simulate POIs being submitted + uint8 numberOfPOIs = 5; + uint256 timeBetweenPOIs = 5 days; + + for (uint8 i = 0; i < numberOfPOIs; i++) { + // Skip forward + skip(timeBetweenPOIs); + + bytes memory data = abi.encode(allocationID, bytes32("POI1"), _getHardcodedPOIMetadata()); + _collect(users.indexer, IGraphPayments.PaymentTypes.IndexingRewards, data); + } + + // Skip forward so that the allocation is stale + skip(maxPOIStaleness + 1); + + // Close the stale allocation + resetPrank(permissionlessBob); + _closeStaleAllocation(allocationID); + } + + function test_SubgraphService_Allocation_ForceClose_RevertIf_NotStale( + uint256 tokens + ) public useIndexer useAllocation(tokens) { + // Simulate POIs being submitted + uint8 numberOfPOIs = 20; + uint256 timeBetweenPOIs = (maxPOIStaleness - 1) / numberOfPOIs; + + for (uint8 i = 0; i < numberOfPOIs; i++) { + // Skip forward + skip(timeBetweenPOIs); + + resetPrank(users.indexer); + + bytes memory data = abi.encode(allocationID, bytes32("POI1"), _getHardcodedPOIMetadata()); + _collect(users.indexer, IGraphPayments.PaymentTypes.IndexingRewards, data); + + resetPrank(permissionlessBob); + vm.expectRevert( + abi.encodeWithSelector( + ISubgraphService.SubgraphServiceCannotForceCloseAllocation.selector, + allocationID + ) + ); + subgraphService.closeStaleAllocation(allocationID); + } + } + + function test_SubgraphService_Allocation_ForceClose_RevertIf_Altruistic(uint256 tokens) public useIndexer { + tokens = bound(tokens, minimumProvisionTokens, MAX_TOKENS); + + _createProvision(users.indexer, tokens, fishermanRewardPercentage, disputePeriod); + _register(users.indexer, abi.encode("url", "geoHash", address(0))); + + bytes memory data = _createSubgraphAllocationData(users.indexer, subgraphDeployment, allocationIDPrivateKey, 0); + _startService(users.indexer, data); + + skip(maxPOIStaleness + 1); + + resetPrank(permissionlessBob); + vm.expectRevert( + abi.encodeWithSelector(ISubgraphService.SubgraphServiceAllocationIsAltruistic.selector, allocationID) + ); + subgraphService.closeStaleAllocation(allocationID); + } + + function test_SubgraphService_Allocation_ForceClose_RevertIf_Paused() public useIndexer useAllocation(1000 ether) { + resetPrank(users.pauseGuardian); + subgraphService.pause(); + + resetPrank(permissionlessBob); + vm.expectRevert(abi.encodeWithSelector(PausableUpgradeable.EnforcedPause.selector)); + subgraphService.closeStaleAllocation(allocationID); + } +} diff --git a/packages/subgraph-service/test/unit/subgraphService/allocation/overDelegated.t.sol b/packages/subgraph-service/test/unit/subgraphService/allocation/overDelegated.t.sol new file mode 100644 index 000000000..0113b36f2 --- /dev/null +++ b/packages/subgraph-service/test/unit/subgraphService/allocation/overDelegated.t.sol @@ -0,0 +1,58 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { IGraphPayments } from "@graphprotocol/horizon/contracts/interfaces/IGraphPayments.sol"; +import { IHorizonStakingTypes } from "@graphprotocol/horizon/contracts/interfaces/internal/IHorizonStakingTypes.sol"; + +import { Allocation } from "../../../../contracts/libraries/Allocation.sol"; +import { ISubgraphService } from "../../../../contracts/interfaces/ISubgraphService.sol"; +import { SubgraphServiceTest } from "../SubgraphService.t.sol"; + +contract SubgraphServiceAllocationOverDelegatedTest is SubgraphServiceTest { + /* + * TESTS + */ + + function test_SubgraphService_Allocation_OverDelegated_NotOverAllocatedAfterUndelegation( + uint256 delegationTokens, + uint256 undelegationTokens + ) public useIndexer { + // Use minimum provision tokens + uint256 indexerTokens = minimumProvisionTokens; + uint256 allocationTokens = indexerTokens * delegationRatio; + // Bound delegation tokens to be over delegated + delegationTokens = bound(delegationTokens, allocationTokens, MAX_TOKENS); + // Assume undelegation tokens to still leave indexer over delegated + vm.assume(undelegationTokens > 1); + vm.assume(undelegationTokens < delegationTokens - allocationTokens); + + // Create provision + token.approve(address(staking), indexerTokens); + _createProvision(users.indexer, indexerTokens, fishermanRewardPercentage, disputePeriod); + _register(users.indexer, abi.encode("url", "geoHash", address(0))); + + // Delegate so that indexer is over allocated + resetPrank(users.delegator); + token.approve(address(staking), delegationTokens); + _delegate(users.indexer, address(subgraphService), delegationTokens, 0); + + // Create allocation + resetPrank(users.indexer); + bytes memory data = _createSubgraphAllocationData( + users.indexer, + subgraphDeployment, + allocationIDPrivateKey, + allocationTokens + ); + _startService(users.indexer, data); + + // Undelegate + resetPrank(users.delegator); + _undelegate(users.indexer, address(subgraphService), undelegationTokens); + + // Check that indexer is not over allocated + assertFalse(subgraphService.isOverAllocated(users.indexer)); + } +} diff --git a/packages/subgraph-service/test/unit/subgraphService/allocation/resize.t.sol b/packages/subgraph-service/test/unit/subgraphService/allocation/resize.t.sol new file mode 100644 index 000000000..c9984bdba --- /dev/null +++ b/packages/subgraph-service/test/unit/subgraphService/allocation/resize.t.sol @@ -0,0 +1,106 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { Allocation } from "../../../../contracts/libraries/Allocation.sol"; +import { AllocationManager } from "../../../../contracts/utilities/AllocationManager.sol"; +import { SubgraphServiceTest } from "../SubgraphService.t.sol"; +import { ISubgraphService } from "../../../../contracts/interfaces/ISubgraphService.sol"; +import { IGraphPayments } from "@graphprotocol/horizon/contracts/interfaces/IGraphPayments.sol"; + +contract SubgraphServiceAllocationResizeTest is SubgraphServiceTest { + /* + * TESTS + */ + + function test_SubgraphService_Allocation_Resize( + uint256 tokens, + uint256 resizeTokens + ) public useIndexer useAllocation(tokens) { + resizeTokens = bound(resizeTokens, 1, MAX_TOKENS); + vm.assume(resizeTokens != tokens); + + mint(users.indexer, resizeTokens); + _addToProvision(users.indexer, resizeTokens); + _resizeAllocation(users.indexer, allocationID, resizeTokens); + } + + function test_SubgraphService_Allocation_Resize_AfterCollectingIndexingRewards( + uint256 tokens, + uint256 resizeTokens + ) public useIndexer useAllocation(tokens) { + resizeTokens = bound(resizeTokens, 1, MAX_TOKENS); + vm.assume(resizeTokens != tokens); + + mint(users.indexer, resizeTokens); + + // skip time to ensure allocation gets rewards + vm.roll(block.number + EPOCH_LENGTH); + + IGraphPayments.PaymentTypes paymentType = IGraphPayments.PaymentTypes.IndexingRewards; + bytes memory data = abi.encode(allocationID, bytes32("POI1"), _getHardcodedPOIMetadata()); + _collect(users.indexer, paymentType, data); + _addToProvision(users.indexer, resizeTokens); + _resizeAllocation(users.indexer, allocationID, resizeTokens); + } + + function test_SubgraphService_Allocation_Resize_SecondTime( + uint256 tokens, + uint256 firstResizeTokens, + uint256 secondResizeTokens + ) public useIndexer useAllocation(tokens) { + firstResizeTokens = bound(firstResizeTokens, 1, MAX_TOKENS); + secondResizeTokens = bound(secondResizeTokens, 1, MAX_TOKENS); + vm.assume(firstResizeTokens != tokens); + vm.assume(secondResizeTokens != firstResizeTokens); + + mint(users.indexer, firstResizeTokens); + _addToProvision(users.indexer, firstResizeTokens); + _resizeAllocation(users.indexer, allocationID, firstResizeTokens); + + mint(users.indexer, secondResizeTokens); + _addToProvision(users.indexer, secondResizeTokens); + _resizeAllocation(users.indexer, allocationID, secondResizeTokens); + } + + function test_SubgraphService_Allocation_Resize_RevertWhen_NotAuthorized( + uint256 tokens, + uint256 resizeTokens + ) public useIndexer useAllocation(tokens) { + resizeTokens = bound(resizeTokens, tokens + 1, MAX_TOKENS); + + address newIndexer = makeAddr("newIndexer"); + _createAndStartAllocation(newIndexer, tokens); + vm.expectRevert( + abi.encodeWithSelector( + ISubgraphService.SubgraphServiceAllocationNotAuthorized.selector, + newIndexer, + allocationID + ) + ); + subgraphService.resizeAllocation(newIndexer, allocationID, resizeTokens); + } + + function test_SubgraphService_Allocation_Resize_RevertWhen_SameSize( + uint256 tokens + ) public useIndexer useAllocation(tokens) { + vm.expectRevert( + abi.encodeWithSelector(AllocationManager.AllocationManagerAllocationSameSize.selector, allocationID, tokens) + ); + subgraphService.resizeAllocation(users.indexer, allocationID, tokens); + } + + function test_SubgraphService_Allocation_Resize_RevertIf_AllocationIsClosed( + uint256 tokens, + uint256 resizeTokens + ) public useIndexer useAllocation(tokens) { + resizeTokens = bound(resizeTokens, tokens + 1, MAX_TOKENS); + bytes memory data = abi.encode(allocationID); + _stopService(users.indexer, data); + vm.expectRevert( + abi.encodeWithSelector(AllocationManager.AllocationManagerAllocationClosed.selector, allocationID) + ); + subgraphService.resizeAllocation(users.indexer, allocationID, resizeTokens); + } +} diff --git a/packages/subgraph-service/test/unit/subgraphService/allocation/start.t.sol b/packages/subgraph-service/test/unit/subgraphService/allocation/start.t.sol new file mode 100644 index 000000000..2f132e132 --- /dev/null +++ b/packages/subgraph-service/test/unit/subgraphService/allocation/start.t.sol @@ -0,0 +1,213 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { ECDSA } from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; +import { ProvisionManager } from "@graphprotocol/horizon/contracts/data-service/utilities/ProvisionManager.sol"; +import { ProvisionTracker } from "@graphprotocol/horizon/contracts/data-service/libraries/ProvisionTracker.sol"; + +import { Allocation } from "../../../../contracts/libraries/Allocation.sol"; +import { AllocationManager } from "../../../../contracts/utilities/AllocationManager.sol"; +import { ISubgraphService } from "../../../../contracts/interfaces/ISubgraphService.sol"; +import { LegacyAllocation } from "../../../../contracts/libraries/LegacyAllocation.sol"; +import { SubgraphServiceTest } from "../SubgraphService.t.sol"; + +contract SubgraphServiceAllocationStartTest is SubgraphServiceTest { + /* + * TESTS + */ + + function test_SubgraphService_Allocation_Start(uint256 tokens) public useIndexer { + tokens = bound(tokens, minimumProvisionTokens, MAX_TOKENS); + + _createProvision(users.indexer, tokens, fishermanRewardPercentage, disputePeriod); + _register(users.indexer, abi.encode("url", "geoHash", address(0))); + + bytes memory data = _generateData(tokens); + _startService(users.indexer, data); + } + + function test_SubgraphService_Allocation_Start_AllowsZeroTokens(uint256 tokens) public useIndexer { + tokens = bound(tokens, minimumProvisionTokens, MAX_TOKENS); + + _createProvision(users.indexer, tokens, fishermanRewardPercentage, disputePeriod); + _register(users.indexer, abi.encode("url", "geoHash", address(0))); + + bytes memory data = _generateData(0); + _startService(users.indexer, data); + } + + function test_SubgraphService_Allocation_Start_ByOperator(uint256 tokens) public useOperator { + tokens = bound(tokens, minimumProvisionTokens, MAX_TOKENS); + + _createProvision(users.indexer, tokens, fishermanRewardPercentage, disputePeriod); + _register(users.indexer, abi.encode("url", "geoHash", address(0))); + + bytes memory data = _generateData(tokens); + _startService(users.indexer, data); + } + + function test_SubgraphService_Allocation_Start_RevertWhen_NotAuthorized(uint256 tokens) public useIndexer { + tokens = bound(tokens, minimumProvisionTokens, MAX_TOKENS); + + _createProvision(users.indexer, tokens, fishermanRewardPercentage, disputePeriod); + _register(users.indexer, abi.encode("url", "geoHash", address(0))); + + resetPrank(users.operator); + bytes memory data = _generateData(tokens); + vm.expectRevert( + abi.encodeWithSelector( + ProvisionManager.ProvisionManagerNotAuthorized.selector, + users.indexer, + users.operator + ) + ); + subgraphService.startService(users.indexer, data); + } + + function test_SubgraphService_Allocation_Start_RevertWhen_NoValidProvision(uint256 tokens) public useIndexer { + tokens = bound(tokens, minimumProvisionTokens, MAX_TOKENS); + + bytes memory data = _generateData(tokens); + vm.expectRevert( + abi.encodeWithSelector(ProvisionManager.ProvisionManagerProvisionNotFound.selector, users.indexer) + ); + subgraphService.startService(users.indexer, data); + } + + function test_SubgraphService_Allocation_Start_RevertWhen_NotRegistered(uint256 tokens) public useIndexer { + tokens = bound(tokens, minimumProvisionTokens, MAX_TOKENS); + + _createProvision(users.indexer, tokens, fishermanRewardPercentage, disputePeriod); + + bytes memory data = _generateData(tokens); + vm.expectRevert( + abi.encodeWithSelector(ISubgraphService.SubgraphServiceIndexerNotRegistered.selector, users.indexer) + ); + subgraphService.startService(users.indexer, data); + } + + function test_SubgraphService_Allocation_Start_RevertWhen_ZeroAllocationId(uint256 tokens) public useIndexer { + tokens = bound(tokens, minimumProvisionTokens, MAX_TOKENS); + + _createProvision(users.indexer, tokens, fishermanRewardPercentage, disputePeriod); + _register(users.indexer, abi.encode("url", "geoHash", address(0))); + + bytes32 digest = subgraphService.encodeAllocationProof(users.indexer, address(0)); + (uint8 v, bytes32 r, bytes32 s) = vm.sign(allocationIDPrivateKey, digest); + bytes memory data = abi.encode(subgraphDeployment, tokens, address(0), abi.encodePacked(r, s, v)); + vm.expectRevert(abi.encodeWithSelector(AllocationManager.AllocationManagerInvalidZeroAllocationId.selector)); + subgraphService.startService(users.indexer, data); + } + + function test_SubgraphService_Allocation_Start_RevertWhen_InvalidSignature(uint256 tokens) public useIndexer { + tokens = bound(tokens, minimumProvisionTokens, MAX_TOKENS); + + _createProvision(users.indexer, tokens, fishermanRewardPercentage, disputePeriod); + _register(users.indexer, abi.encode("url", "geoHash", address(0))); + + (address signer, uint256 signerPrivateKey) = makeAddrAndKey("invalidSigner"); + bytes32 digest = subgraphService.encodeAllocationProof(users.indexer, allocationID); + (uint8 v, bytes32 r, bytes32 s) = vm.sign(signerPrivateKey, digest); + bytes memory data = abi.encode(subgraphDeployment, tokens, allocationID, abi.encodePacked(r, s, v)); + vm.expectRevert( + abi.encodeWithSelector( + AllocationManager.AllocationManagerInvalidAllocationProof.selector, + signer, + allocationID + ) + ); + subgraphService.startService(users.indexer, data); + } + + function test_SubgraphService_Allocation_Start_RevertWhen_InvalidData(uint256 tokens) public useIndexer { + tokens = bound(tokens, minimumProvisionTokens, MAX_TOKENS); + + _createProvision(users.indexer, tokens, fishermanRewardPercentage, disputePeriod); + _register(users.indexer, abi.encode("url", "geoHash", address(0))); + + bytes memory data = abi.encode(subgraphDeployment, tokens, allocationID, _generateRandomHexBytes(32)); + vm.expectRevert(abi.encodeWithSelector(ECDSA.ECDSAInvalidSignatureLength.selector, 32)); + subgraphService.startService(users.indexer, data); + } + + function test_SubgraphService_Allocation_Start_RevertWhen_AlreadyExists_SubgraphService( + uint256 tokens + ) public useIndexer { + tokens = bound(tokens, minimumProvisionTokens, MAX_TOKENS); + + _createProvision(users.indexer, tokens, fishermanRewardPercentage, disputePeriod); + _register(users.indexer, abi.encode("url", "geoHash", address(0))); + + bytes memory data = _generateData(tokens); + _startService(users.indexer, data); + + vm.expectRevert(abi.encodeWithSelector(Allocation.AllocationAlreadyExists.selector, allocationID)); + subgraphService.startService(users.indexer, data); + } + + function test_SubgraphService_Allocation_Start_RevertWhen_AlreadyExists_Migrated(uint256 tokens) public useIndexer { + tokens = bound(tokens, minimumProvisionTokens, MAX_TOKENS); + + _createProvision(users.indexer, tokens, fishermanRewardPercentage, disputePeriod); + _register(users.indexer, abi.encode("url", "geoHash", address(0))); + + resetPrank(users.governor); + _migrateLegacyAllocation(users.indexer, allocationID, subgraphDeployment); + + resetPrank(users.indexer); + bytes memory data = _generateData(tokens); + vm.expectRevert(abi.encodeWithSelector(LegacyAllocation.LegacyAllocationAlreadyExists.selector, allocationID)); + subgraphService.startService(users.indexer, data); + } + + function test_SubgraphService_Allocation_Start_RevertWhen_AlreadyExists_Staking(uint256 tokens) public useIndexer { + tokens = bound(tokens, minimumProvisionTokens, MAX_TOKENS); + + _createProvision(users.indexer, tokens, fishermanRewardPercentage, disputePeriod); + _register(users.indexer, abi.encode("url", "geoHash", address(0))); + + // create dummy allo in staking contract + _setStorage_allocation_hardcoded(users.indexer, allocationID, tokens); + + bytes memory data = _generateData(tokens); + vm.expectRevert(abi.encodeWithSelector(LegacyAllocation.LegacyAllocationAlreadyExists.selector, allocationID)); + subgraphService.startService(users.indexer, data); + } + + function test_SubgraphService_Allocation_Start_RevertWhen_NotEnoughTokens( + uint256 tokens, + uint256 lockTokens + ) public useIndexer { + tokens = bound(tokens, minimumProvisionTokens, MAX_TOKENS - 1); + lockTokens = bound(lockTokens, tokens + 1, MAX_TOKENS); + + _createProvision(users.indexer, tokens, fishermanRewardPercentage, disputePeriod); + _register(users.indexer, abi.encode("url", "geoHash", address(0))); + + bytes memory data = _generateData(lockTokens); + vm.expectRevert( + abi.encodeWithSelector(ProvisionTracker.ProvisionTrackerInsufficientTokens.selector, tokens, lockTokens) + ); + subgraphService.startService(users.indexer, data); + } + + /* + * PRIVATE FUNCTIONS + */ + + function _generateData(uint256 tokens) private view returns (bytes memory) { + return _createSubgraphAllocationData(users.indexer, subgraphDeployment, allocationIDPrivateKey, tokens); + } + + function _generateRandomHexBytes(uint256 length) private view returns (bytes memory) { + bytes memory randomBytes = new bytes(length); + for (uint256 i = 0; i < length; i++) { + randomBytes[i] = bytes1( + uint8(uint256(keccak256(abi.encodePacked(block.timestamp, block.prevrandao, i))) % 256) + ); + } + return randomBytes; + } +} diff --git a/packages/subgraph-service/test/unit/subgraphService/allocation/stop.t.sol b/packages/subgraph-service/test/unit/subgraphService/allocation/stop.t.sol new file mode 100644 index 000000000..2c4391cb2 --- /dev/null +++ b/packages/subgraph-service/test/unit/subgraphService/allocation/stop.t.sol @@ -0,0 +1,76 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { IDataService } from "@graphprotocol/horizon/contracts/data-service/interfaces/IDataService.sol"; +import { ProvisionManager } from "@graphprotocol/horizon/contracts/data-service/utilities/ProvisionManager.sol"; +import { ProvisionTracker } from "@graphprotocol/horizon/contracts/data-service/libraries/ProvisionTracker.sol"; + +import { Allocation } from "../../../../contracts/libraries/Allocation.sol"; +import { AllocationManager } from "../../../../contracts/utilities/AllocationManager.sol"; +import { ISubgraphService } from "../../../../contracts/interfaces/ISubgraphService.sol"; +import { LegacyAllocation } from "../../../../contracts/libraries/LegacyAllocation.sol"; +import { SubgraphServiceTest } from "../SubgraphService.t.sol"; + +contract SubgraphServiceAllocationStopTest is SubgraphServiceTest { + /* + * TESTS + */ + + function test_SubgraphService_Allocation_Stop(uint256 tokens) public useIndexer useAllocation(tokens) { + bytes memory data = abi.encode(allocationID); + _stopService(users.indexer, data); + } + + function test_SubgraphService_Allocation_Stop_RevertWhen_IndexerIsNotTheAllocationOwner( + uint256 tokens + ) public useIndexer useAllocation(tokens) { + // Setup new indexer + address newIndexer = makeAddr("newIndexer"); + _createAndStartAllocation(newIndexer, tokens); + + // Attempt to close other indexer's allocation + bytes memory data = abi.encode(allocationID); + vm.expectRevert( + abi.encodeWithSelector( + ISubgraphService.SubgraphServiceAllocationNotAuthorized.selector, + newIndexer, + allocationID + ) + ); + subgraphService.stopService(newIndexer, data); + } + + function test_SubgraphService_Allocation_Stop_RevertWhen_NotAuthorized( + uint256 tokens + ) public useIndexer useAllocation(tokens) { + resetPrank(users.operator); + bytes memory data = abi.encode(allocationID); + vm.expectRevert( + abi.encodeWithSelector( + ProvisionManager.ProvisionManagerNotAuthorized.selector, + users.indexer, + users.operator + ) + ); + subgraphService.stopService(users.indexer, data); + } + + function test_SubgraphService_Allocation_Stop_RevertWhen_NotRegistered() public useIndexer { + bytes memory data = abi.encode(allocationID); + vm.expectRevert( + abi.encodeWithSelector(ISubgraphService.SubgraphServiceIndexerNotRegistered.selector, users.indexer) + ); + subgraphService.stopService(users.indexer, data); + } + + function test_SubgraphService_Allocation_Stop_RevertWhen_NotOpen( + uint256 tokens + ) public useIndexer useAllocation(tokens) { + bytes memory data = abi.encode(allocationID); + _stopService(users.indexer, data); + vm.expectRevert(abi.encodeWithSelector(Allocation.AllocationClosed.selector, allocationID, block.timestamp)); + subgraphService.stopService(users.indexer, data); + } +} diff --git a/packages/subgraph-service/test/unit/subgraphService/collect/collect.t.sol b/packages/subgraph-service/test/unit/subgraphService/collect/collect.t.sol new file mode 100644 index 000000000..aff11d578 --- /dev/null +++ b/packages/subgraph-service/test/unit/subgraphService/collect/collect.t.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { IGraphPayments } from "@graphprotocol/horizon/contracts/interfaces/IGraphPayments.sol"; + +import { ISubgraphService } from "../../../../contracts/interfaces/ISubgraphService.sol"; +import { SubgraphServiceTest } from "../SubgraphService.t.sol"; + +contract SubgraphServiceCollectTest is SubgraphServiceTest { + /* + * TESTS + */ + + function test_SubgraphService_Collect_RevertWhen_InvalidPayment( + uint256 tokens + ) public useIndexer useAllocation(tokens) { + IGraphPayments.PaymentTypes invalidPaymentType = IGraphPayments.PaymentTypes.IndexingFee; + vm.expectRevert( + abi.encodeWithSelector(ISubgraphService.SubgraphServiceInvalidPaymentType.selector, invalidPaymentType) + ); + subgraphService.collect(users.indexer, invalidPaymentType, ""); + } +} diff --git a/packages/subgraph-service/test/unit/subgraphService/collect/indexing/indexing.t.sol b/packages/subgraph-service/test/unit/subgraphService/collect/indexing/indexing.t.sol new file mode 100644 index 000000000..6d2d18571 --- /dev/null +++ b/packages/subgraph-service/test/unit/subgraphService/collect/indexing/indexing.t.sol @@ -0,0 +1,174 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { IGraphPayments } from "@graphprotocol/horizon/contracts/interfaces/IGraphPayments.sol"; + +import { ISubgraphService } from "../../../../../contracts/interfaces/ISubgraphService.sol"; +import { SubgraphServiceTest } from "../../SubgraphService.t.sol"; +import { Allocation } from "../../../../../contracts/libraries/Allocation.sol"; +contract SubgraphServiceCollectIndexingTest is SubgraphServiceTest { + /* + * TESTS + */ + + function test_SubgraphService_Collect_Indexing(uint256 tokens) public useIndexer useAllocation(tokens) { + IGraphPayments.PaymentTypes paymentType = IGraphPayments.PaymentTypes.IndexingRewards; + bytes memory data = abi.encode(allocationID, bytes32("POI"), _getHardcodedPOIMetadata()); + + // skip time to ensure allocation gets rewards + vm.roll(block.number + EPOCH_LENGTH); + + _collect(users.indexer, paymentType, data); + } + + function test_SubgraphService_Collect_Indexing_WithDelegation( + uint256 tokens, + uint256 delegationTokens, + uint256 delegationFeeCut + ) public useIndexer useAllocation(tokens) useDelegation(delegationTokens) { + delegationFeeCut = bound(delegationFeeCut, 0, MAX_PPM); + _setDelegationFeeCut( + users.indexer, + address(subgraphService), + IGraphPayments.PaymentTypes.IndexingRewards, + delegationFeeCut + ); + + // skip time to ensure allocation gets rewards + vm.roll(block.number + EPOCH_LENGTH); + + IGraphPayments.PaymentTypes paymentType = IGraphPayments.PaymentTypes.IndexingRewards; + bytes memory data = abi.encode(allocationID, bytes32("POI"), _getHardcodedPOIMetadata()); + _collect(users.indexer, paymentType, data); + } + + function test_SubgraphService_Collect_Indexing_AfterUndelegate( + uint256 tokens, + uint256 delegationTokens, + uint256 delegationFeeCut + ) public useIndexer useAllocation(tokens) useDelegation(delegationTokens) { + delegationFeeCut = bound(delegationFeeCut, 0, MAX_PPM); + _setDelegationFeeCut( + users.indexer, + address(subgraphService), + IGraphPayments.PaymentTypes.IndexingRewards, + delegationFeeCut + ); + // Undelegate + resetPrank(users.delegator); + staking.undelegate(users.indexer, address(subgraphService), delegationTokens); + + // skip time to ensure allocation gets rewards + vm.roll(block.number + EPOCH_LENGTH); + + resetPrank(users.indexer); + IGraphPayments.PaymentTypes paymentType = IGraphPayments.PaymentTypes.IndexingRewards; + bytes memory data = abi.encode(allocationID, bytes32("POI"), _getHardcodedPOIMetadata()); + _collect(users.indexer, paymentType, data); + } + + function test_SubgraphService_Collect_Indexing_RewardsDestination( + uint256 tokens + ) public useIndexer useAllocation(tokens) useRewardsDestination { + // skip time to ensure allocation gets rewards + vm.roll(block.number + EPOCH_LENGTH); + + IGraphPayments.PaymentTypes paymentType = IGraphPayments.PaymentTypes.IndexingRewards; + bytes memory data = abi.encode(allocationID, bytes32("POI"), _getHardcodedPOIMetadata()); + _collect(users.indexer, paymentType, data); + } + + function test_subgraphService_Collect_Indexing_MultipleOverTime( + uint256 tokens + ) public useIndexer useAllocation(tokens) { + uint8 numberOfPOIs = 20; + uint256 timeBetweenPOIs = 5 days; + + for (uint8 i = 0; i < numberOfPOIs; i++) { + // Skip forward + skip(timeBetweenPOIs); + + resetPrank(users.indexer); + + bytes memory data = abi.encode(allocationID, bytes32("POI"), _getHardcodedPOIMetadata()); + _collect(users.indexer, IGraphPayments.PaymentTypes.IndexingRewards, data); + } + } + + function test_subgraphService_Collect_Indexing_MultipleOverTime_WithDelegation( + uint256 tokens, + uint256 delegationTokens, + uint256 delegationFeeCut + ) public useIndexer useAllocation(tokens) useDelegation(delegationTokens) { + delegationFeeCut = bound(delegationFeeCut, 0, MAX_PPM); + _setDelegationFeeCut( + users.indexer, + address(subgraphService), + IGraphPayments.PaymentTypes.IndexingRewards, + delegationFeeCut + ); + + uint8 numberOfPOIs = 20; + uint256 timeBetweenPOIs = 5 days; + for (uint8 i = 0; i < numberOfPOIs; i++) { + // Skip forward + skip(timeBetweenPOIs); + + resetPrank(users.indexer); + + bytes memory data = abi.encode(allocationID, bytes32("POI"), _getHardcodedPOIMetadata()); + _collect(users.indexer, IGraphPayments.PaymentTypes.IndexingRewards, data); + } + } + + function test_SubgraphService_Collect_Indexing_OverAllocated(uint256 tokens) public useIndexer { + tokens = bound(tokens, minimumProvisionTokens * 2, 10_000_000_000 ether); + + // setup allocation + _createProvision(users.indexer, tokens, fishermanRewardPercentage, disputePeriod); + _register(users.indexer, abi.encode("url", "geoHash", address(0))); + bytes memory data = _createSubgraphAllocationData( + users.indexer, + subgraphDeployment, + allocationIDPrivateKey, + tokens + ); + _startService(users.indexer, data); + + // thaw some tokens to become over allocated + staking.thaw(users.indexer, address(subgraphService), tokens / 2); + + // skip time to ensure allocation gets rewards + vm.roll(block.number + EPOCH_LENGTH); + + // this collection should close the allocation + IGraphPayments.PaymentTypes paymentType = IGraphPayments.PaymentTypes.IndexingRewards; + bytes memory collectData = abi.encode(allocationID, bytes32("POI"), _getHardcodedPOIMetadata()); + _collect(users.indexer, paymentType, collectData); + } + + function test_SubgraphService_Collect_Indexing_RevertWhen_IndexerIsNotAllocationOwner( + uint256 tokens + ) public useIndexer useAllocation(tokens) { + IGraphPayments.PaymentTypes paymentType = IGraphPayments.PaymentTypes.IndexingRewards; + // Setup new indexer + address newIndexer = makeAddr("newIndexer"); + _createAndStartAllocation(newIndexer, tokens); + bytes memory data = abi.encode(allocationID, bytes32("POI"), _getHardcodedPOIMetadata()); + + // skip time to ensure allocation gets rewards + vm.roll(block.number + EPOCH_LENGTH); + + // Attempt to collect from other indexer's allocation + vm.expectRevert( + abi.encodeWithSelector( + ISubgraphService.SubgraphServiceAllocationNotAuthorized.selector, + newIndexer, + allocationID + ) + ); + subgraphService.collect(newIndexer, paymentType, data); + } +} diff --git a/packages/subgraph-service/test/unit/subgraphService/collect/query/query.t.sol b/packages/subgraph-service/test/unit/subgraphService/collect/query/query.t.sol new file mode 100644 index 000000000..433e32375 --- /dev/null +++ b/packages/subgraph-service/test/unit/subgraphService/collect/query/query.t.sol @@ -0,0 +1,282 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { IGraphPayments } from "@graphprotocol/horizon/contracts/interfaces/IGraphPayments.sol"; +import { IGraphTallyCollector } from "@graphprotocol/horizon/contracts/interfaces/IGraphTallyCollector.sol"; +import { PPMMath } from "@graphprotocol/horizon/contracts/libraries/PPMMath.sol"; +import { ProvisionManager } from "@graphprotocol/horizon/contracts/data-service/utilities/ProvisionManager.sol"; +import { MessageHashUtils } from "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol"; + +import { ISubgraphService } from "../../../../../contracts/interfaces/ISubgraphService.sol"; +import { SubgraphServiceTest } from "../../SubgraphService.t.sol"; + +contract SubgraphServiceRegisterTest is SubgraphServiceTest { + using PPMMath for uint128; + using PPMMath for uint256; + + address signer; + uint256 signerPrivateKey; + + /* + * HELPERS + */ + + function _getSignerProof(uint256 _proofDeadline, uint256 _signer) private returns (bytes memory) { + (, address msgSender, ) = vm.readCallers(); + bytes32 messageHash = keccak256( + abi.encodePacked( + block.chainid, + address(graphTallyCollector), + "authorizeSignerProof", + _proofDeadline, + msgSender + ) + ); + bytes32 proofToDigest = MessageHashUtils.toEthSignedMessageHash(messageHash); + (uint8 v, bytes32 r, bytes32 s) = vm.sign(_signer, proofToDigest); + return abi.encodePacked(r, s, v); + } + + function _getQueryFeeEncodedData( + address indexer, + uint128 tokens, + uint256 tokensToCollect + ) private view returns (bytes memory) { + IGraphTallyCollector.ReceiptAggregateVoucher memory rav = _getRAV( + indexer, + bytes32(uint256(uint160(allocationID))), + tokens + ); + bytes32 messageHash = graphTallyCollector.encodeRAV(rav); + (uint8 v, bytes32 r, bytes32 s) = vm.sign(signerPrivateKey, messageHash); + bytes memory signature = abi.encodePacked(r, s, v); + IGraphTallyCollector.SignedRAV memory signedRAV = IGraphTallyCollector.SignedRAV(rav, signature); + return abi.encode(signedRAV, tokensToCollect); + } + + function _getRAV( + address indexer, + bytes32 collectionId, + uint128 tokens + ) private view returns (IGraphTallyCollector.ReceiptAggregateVoucher memory rav) { + return + IGraphTallyCollector.ReceiptAggregateVoucher({ + collectionId: collectionId, + payer: users.gateway, + serviceProvider: indexer, + dataService: address(subgraphService), + timestampNs: 0, + valueAggregate: tokens, + metadata: "" + }); + } + + function _deposit(uint256 tokens) private { + token.approve(address(escrow), tokens); + escrow.deposit(address(graphTallyCollector), users.indexer, tokens); + } + + function _authorizeSigner() private { + uint256 proofDeadline = block.timestamp + 1; + bytes memory proof = _getSignerProof(proofDeadline, signerPrivateKey); + graphTallyCollector.authorizeSigner(signer, proofDeadline, proof); + } + + /* + * SET UP + */ + + function setUp() public virtual override { + super.setUp(); + (signer, signerPrivateKey) = makeAddrAndKey("signer"); + vm.label({ account: signer, newLabel: "signer" }); + } + + /* + * TESTS + */ + + function testCollect_QueryFees( + uint256 tokensAllocated, + uint256 tokensPayment + ) public useIndexer useAllocation(tokensAllocated) { + vm.assume(tokensAllocated > minimumProvisionTokens * stakeToFeesRatio); + uint256 maxTokensPayment = tokensAllocated / stakeToFeesRatio > type(uint128).max + ? type(uint128).max + : tokensAllocated / stakeToFeesRatio; + tokensPayment = bound(tokensPayment, minimumProvisionTokens, maxTokensPayment); + + resetPrank(users.gateway); + _deposit(tokensPayment); + _authorizeSigner(); + + resetPrank(users.indexer); + bytes memory data = _getQueryFeeEncodedData(users.indexer, uint128(tokensPayment), 0); + _collect(users.indexer, IGraphPayments.PaymentTypes.QueryFee, data); + } + + function testCollect_QueryFees_WithRewardsDestination( + uint256 tokensAllocated, + uint256 tokensPayment + ) public useIndexer useAllocation(tokensAllocated) { + vm.assume(tokensAllocated > minimumProvisionTokens * stakeToFeesRatio); + uint256 maxTokensPayment = tokensAllocated / stakeToFeesRatio > type(uint128).max + ? type(uint128).max + : tokensAllocated / stakeToFeesRatio; + tokensPayment = bound(tokensPayment, minimumProvisionTokens, maxTokensPayment); + + resetPrank(users.gateway); + _deposit(tokensPayment); + _authorizeSigner(); + + resetPrank(users.indexer); + subgraphService.setPaymentsDestination(users.indexer); + bytes memory data = _getQueryFeeEncodedData(users.indexer, uint128(tokensPayment), 0); + _collect(users.indexer, IGraphPayments.PaymentTypes.QueryFee, data); + } + + function testCollect_MultipleQueryFees( + uint256 tokensAllocated, + uint8 numPayments + ) public useIndexer useAllocation(tokensAllocated) { + vm.assume(tokensAllocated > minimumProvisionTokens * stakeToFeesRatio); + numPayments = uint8(bound(numPayments, 2, 10)); + uint256 tokensPayment = tokensAllocated / stakeToFeesRatio / numPayments; + + resetPrank(users.gateway); + _deposit(tokensAllocated); + _authorizeSigner(); + + resetPrank(users.indexer); + uint256 accTokensPayment = 0; + for (uint i = 0; i < numPayments; i++) { + accTokensPayment = accTokensPayment + tokensPayment; + bytes memory data = _getQueryFeeEncodedData(users.indexer, uint128(accTokensPayment), 0); + _collect(users.indexer, IGraphPayments.PaymentTypes.QueryFee, data); + } + } + + function testCollect_RevertWhen_NotAuthorized(uint256 tokens) public useIndexer useAllocation(tokens) { + IGraphPayments.PaymentTypes paymentType = IGraphPayments.PaymentTypes.QueryFee; + bytes memory data = _getQueryFeeEncodedData(users.indexer, uint128(tokens), 0); + resetPrank(users.operator); + vm.expectRevert( + abi.encodeWithSelector( + ProvisionManager.ProvisionManagerNotAuthorized.selector, + users.indexer, + users.operator + ) + ); + subgraphService.collect(users.indexer, paymentType, data); + } + + function testCollect_QueryFees_RevertWhen_IndexerIsNotAllocationOwner( + uint256 tokens + ) public useIndexer useAllocation(tokens) { + IGraphPayments.PaymentTypes paymentType = IGraphPayments.PaymentTypes.QueryFee; + // Setup new indexer + address newIndexer = makeAddr("newIndexer"); + _createAndStartAllocation(newIndexer, tokens); + + // This data is for user.indexer allocationId + bytes memory data = _getQueryFeeEncodedData(newIndexer, uint128(tokens), 0); + + resetPrank(newIndexer); + vm.expectRevert( + abi.encodeWithSelector(ISubgraphService.SubgraphServiceInvalidRAV.selector, newIndexer, users.indexer) + ); + subgraphService.collect(newIndexer, paymentType, data); + } + + function testCollect_QueryFees_RevertWhen_CollectingOtherIndexersFees( + uint256 tokens + ) public useIndexer useAllocation(tokens) { + IGraphPayments.PaymentTypes paymentType = IGraphPayments.PaymentTypes.QueryFee; + // Setup new indexer + address newIndexer = makeAddr("newIndexer"); + _createAndStartAllocation(newIndexer, tokens); + bytes memory data = _getQueryFeeEncodedData(users.indexer, uint128(tokens), 0); + vm.expectRevert( + abi.encodeWithSelector(ISubgraphService.SubgraphServiceIndexerMismatch.selector, users.indexer, newIndexer) + ); + subgraphService.collect(newIndexer, paymentType, data); + } + + function testCollect_QueryFees_RevertWhen_CollectionIdTooLarge() public useIndexer useAllocation(1000 ether) { + bytes32 collectionId = keccak256(abi.encodePacked("Large collection id, longer than 160 bits")); + IGraphTallyCollector.ReceiptAggregateVoucher memory rav = _getRAV(users.indexer, collectionId, 1000 ether); + bytes32 messageHash = graphTallyCollector.encodeRAV(rav); + (uint8 v, bytes32 r, bytes32 s) = vm.sign(signerPrivateKey, messageHash); + bytes memory signature = abi.encodePacked(r, s, v); + IGraphTallyCollector.SignedRAV memory signedRAV = IGraphTallyCollector.SignedRAV(rav, signature); + bytes memory data = abi.encode(signedRAV); + vm.expectRevert( + abi.encodeWithSelector(ISubgraphService.SubgraphServiceInvalidCollectionId.selector, collectionId) + ); + subgraphService.collect(users.indexer, IGraphPayments.PaymentTypes.QueryFee, data); + } + + function testCollect_QueryFees_PartialCollect( + uint256 tokensAllocated, + uint256 tokensPayment + ) public useIndexer useAllocation(tokensAllocated) { + vm.assume(tokensAllocated > minimumProvisionTokens * stakeToFeesRatio); + uint256 maxTokensPayment = tokensAllocated / stakeToFeesRatio > type(uint128).max + ? type(uint128).max + : tokensAllocated / stakeToFeesRatio; + tokensPayment = bound(tokensPayment, minimumProvisionTokens, maxTokensPayment); + + resetPrank(users.gateway); + _deposit(tokensPayment); + _authorizeSigner(); + + uint256 beforeGatewayBalance = escrow.getBalance(users.gateway, address(graphTallyCollector), users.indexer); + uint256 beforeTokensCollected = graphTallyCollector.tokensCollected( + address(subgraphService), + bytes32(uint256(uint160(allocationID))), + users.indexer, + users.gateway + ); + + // Collect the RAV in two steps + resetPrank(users.indexer); + uint256 tokensToCollect = tokensPayment / 2; + bool oddTokensPayment = tokensPayment % 2 == 1; + bytes memory data = _getQueryFeeEncodedData(users.indexer, uint128(tokensPayment), tokensToCollect); + _collect(users.indexer, IGraphPayments.PaymentTypes.QueryFee, data); + + uint256 intermediateGatewayBalance = escrow.getBalance( + users.gateway, + address(graphTallyCollector), + users.indexer + ); + assertEq(intermediateGatewayBalance, beforeGatewayBalance - tokensToCollect); + uint256 intermediateTokensCollected = graphTallyCollector.tokensCollected( + address(subgraphService), + bytes32(uint256(uint160(allocationID))), + users.indexer, + users.gateway + ); + assertEq(intermediateTokensCollected, beforeTokensCollected + tokensToCollect); + + bytes memory data2 = _getQueryFeeEncodedData( + users.indexer, + uint128(tokensPayment), + oddTokensPayment ? tokensToCollect + 1 : tokensToCollect + ); + _collect(users.indexer, IGraphPayments.PaymentTypes.QueryFee, data2); + + // Check the indexer received the correct amount of tokens + uint256 afterGatewayBalance = escrow.getBalance(users.gateway, address(graphTallyCollector), users.indexer); + assertEq(afterGatewayBalance, beforeGatewayBalance - tokensPayment); + uint256 afterTokensCollected = graphTallyCollector.tokensCollected( + address(subgraphService), + bytes32(uint256(uint160(allocationID))), + users.indexer, + users.gateway + ); + assertEq(afterTokensCollected, intermediateTokensCollected + tokensToCollect + (oddTokensPayment ? 1 : 0)); + } +} diff --git a/packages/subgraph-service/test/unit/subgraphService/governance/legacy.t.sol b/packages/subgraph-service/test/unit/subgraphService/governance/legacy.t.sol new file mode 100644 index 000000000..d1b5dd124 --- /dev/null +++ b/packages/subgraph-service/test/unit/subgraphService/governance/legacy.t.sol @@ -0,0 +1,23 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { OwnableUpgradeable } from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; + +import { SubgraphServiceTest } from "../SubgraphService.t.sol"; + +contract SubgraphServiceLegacyAllocation is SubgraphServiceTest { + /* + * TESTS + */ + + function test_MigrateAllocation() public useGovernor { + _migrateLegacyAllocation(users.indexer, allocationID, subgraphDeployment); + } + + function test_MigrateAllocation_WhenNotGovernor() public useIndexer { + vm.expectRevert(abi.encodeWithSelector(OwnableUpgradeable.OwnableUnauthorizedAccount.selector, users.indexer)); + subgraphService.migrateLegacyAllocation(users.indexer, allocationID, subgraphDeployment); + } +} diff --git a/packages/subgraph-service/test/unit/subgraphService/governance/stakeToFeesRatio.t.sol b/packages/subgraph-service/test/unit/subgraphService/governance/stakeToFeesRatio.t.sol new file mode 100644 index 000000000..a6ce1ae1d --- /dev/null +++ b/packages/subgraph-service/test/unit/subgraphService/governance/stakeToFeesRatio.t.sol @@ -0,0 +1,42 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { ISubgraphService } from "../../../../contracts/interfaces/ISubgraphService.sol"; +import { SubgraphServiceTest } from "../SubgraphService.t.sol"; +import { OwnableUpgradeable } from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; + +contract DisputeManagerGovernanceArbitratorTest is SubgraphServiceTest { + /** + * ACTIONS + */ + + function _setStakeToFeesRatio(uint256 _stakeToFeesRatio) internal { + vm.expectEmit(address(subgraphService)); + emit ISubgraphService.StakeToFeesRatioSet(_stakeToFeesRatio); + subgraphService.setStakeToFeesRatio(_stakeToFeesRatio); + assertEq(subgraphService.stakeToFeesRatio(), _stakeToFeesRatio); + } + + /* + * TESTS + */ + + function test_Governance_SetStakeToFeesRatio(uint256 stakeToFeesRatio) public useGovernor { + vm.assume(stakeToFeesRatio > 0); + _setStakeToFeesRatio(stakeToFeesRatio); + } + + function test_Governance_RevertWhen_ZeroValue() public useGovernor { + uint256 stakeToFeesRatio = 0; + vm.expectRevert(abi.encodeWithSelector(ISubgraphService.SubgraphServiceInvalidZeroStakeToFeesRatio.selector)); + subgraphService.setStakeToFeesRatio(stakeToFeesRatio); + } + + function test_Governance_RevertWhen_NotGovernor() public useIndexer { + uint256 stakeToFeesRatio = 2; + vm.expectRevert(abi.encodeWithSelector(OwnableUpgradeable.OwnableUnauthorizedAccount.selector, users.indexer)); + subgraphService.setStakeToFeesRatio(stakeToFeesRatio); + } +} diff --git a/packages/subgraph-service/test/unit/subgraphService/provider/register.t.sol b/packages/subgraph-service/test/unit/subgraphService/provider/register.t.sol new file mode 100644 index 000000000..333f03f10 --- /dev/null +++ b/packages/subgraph-service/test/unit/subgraphService/provider/register.t.sol @@ -0,0 +1,84 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { ProvisionManager } from "@graphprotocol/horizon/contracts/data-service/utilities/ProvisionManager.sol"; +import { ISubgraphService } from "../../../../contracts/interfaces/ISubgraphService.sol"; +import { SubgraphServiceTest } from "../SubgraphService.t.sol"; + +contract SubgraphServiceProviderRegisterTest is SubgraphServiceTest { + /* + * TESTS + */ + + function test_SubgraphService_Provider_Register(uint256 tokens) public useIndexer { + tokens = bound(tokens, minimumProvisionTokens, MAX_TOKENS); + _createProvision(users.indexer, tokens, fishermanRewardPercentage, disputePeriod); + bytes memory data = abi.encode("url", "geoHash", users.rewardsDestination); + _register(users.indexer, data); + } + + function test_SubgraphService_Provider_Register_RevertIf_AlreadyRegistered( + uint256 tokens + ) public useIndexer useAllocation(tokens) { + vm.expectRevert(abi.encodeWithSelector(ISubgraphService.SubgraphServiceIndexerAlreadyRegistered.selector)); + bytes memory data = abi.encode("url", "geoHash", users.rewardsDestination); + subgraphService.register(users.indexer, data); + } + + function test_SubgraphService_Provider_Register_RevertWhen_InvalidProvision() public useIndexer { + vm.expectRevert( + abi.encodeWithSelector(ProvisionManager.ProvisionManagerProvisionNotFound.selector, users.indexer) + ); + bytes memory data = abi.encode("url", "geoHash", users.rewardsDestination); + subgraphService.register(users.indexer, data); + } + + function test_SubgraphService_Provider_Register_RevertWhen_NotAuthorized() public { + resetPrank(users.operator); + vm.expectRevert( + abi.encodeWithSelector( + ProvisionManager.ProvisionManagerNotAuthorized.selector, + users.indexer, + users.operator + ) + ); + bytes memory data = abi.encode("url", "geoHash", users.rewardsDestination); + subgraphService.register(users.indexer, data); + } + + function test_SubgraphService_Provider_Register_RevertWhen_InvalidProvisionValues( + uint256 tokens + ) public useIndexer { + tokens = bound(tokens, 1, minimumProvisionTokens - 1); + _createProvision(users.indexer, tokens, fishermanRewardPercentage, disputePeriod); + + vm.expectRevert( + abi.encodeWithSelector( + ProvisionManager.ProvisionManagerInvalidValue.selector, + "tokens", + tokens, + minimumProvisionTokens, + maximumProvisionTokens + ) + ); + subgraphService.register(users.indexer, abi.encode("url", "geoHash", address(0))); + } + + function test_SubgraphService_Provider_Register_RevertIf_EmptyUrl(uint256 tokens) public useIndexer { + tokens = bound(tokens, minimumProvisionTokens, MAX_TOKENS); + _createProvision(users.indexer, tokens, fishermanRewardPercentage, disputePeriod); + bytes memory data = abi.encode("", "geoHash", users.rewardsDestination); + vm.expectRevert(abi.encodeWithSelector(ISubgraphService.SubgraphServiceEmptyUrl.selector)); + subgraphService.register(users.indexer, data); + } + + function test_SubgraphService_Provider_Register_RevertIf_EmptyGeohash(uint256 tokens) public useIndexer { + tokens = bound(tokens, minimumProvisionTokens, MAX_TOKENS); + _createProvision(users.indexer, tokens, fishermanRewardPercentage, disputePeriod); + bytes memory data = abi.encode("url", "", users.rewardsDestination); + vm.expectRevert(abi.encodeWithSelector(ISubgraphService.SubgraphServiceEmptyGeohash.selector)); + subgraphService.register(users.indexer, data); + } +} diff --git a/packages/subgraph-service/test/unit/subgraphService/provider/rewardsDestination.t.sol b/packages/subgraph-service/test/unit/subgraphService/provider/rewardsDestination.t.sol new file mode 100644 index 000000000..ab8f2e55c --- /dev/null +++ b/packages/subgraph-service/test/unit/subgraphService/provider/rewardsDestination.t.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { IDataService } from "@graphprotocol/horizon/contracts/data-service/interfaces/IDataService.sol"; +import { ProvisionManager } from "@graphprotocol/horizon/contracts/data-service/utilities/ProvisionManager.sol"; +import { ISubgraphService } from "../../../../contracts/interfaces/ISubgraphService.sol"; +import { SubgraphServiceTest } from "../SubgraphService.t.sol"; + +contract SubgraphServiceProviderRewardsDestinationTest is SubgraphServiceTest { + /* + * TESTS + */ + + function test_SubgraphService_Provider_RewardsDestination_Set( + uint256 tokens + ) public useIndexer useAllocation(tokens) { + // Should be able to use new address + _setRewardsDestination(users.rewardsDestination); + + // Should be able to set back to address zero + _setRewardsDestination(address(0)); + } +} diff --git a/packages/subgraph-service/test/unit/subgraphService/provision/accept.t.sol b/packages/subgraph-service/test/unit/subgraphService/provision/accept.t.sol new file mode 100644 index 000000000..fb21c7ce0 --- /dev/null +++ b/packages/subgraph-service/test/unit/subgraphService/provision/accept.t.sol @@ -0,0 +1,132 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +import { IDataService } from "@graphprotocol/horizon/contracts/data-service/interfaces/IDataService.sol"; +import { ProvisionManager } from "@graphprotocol/horizon/contracts/data-service/utilities/ProvisionManager.sol"; +import { ISubgraphService } from "../../../../contracts/interfaces/ISubgraphService.sol"; +import { SubgraphServiceTest } from "../SubgraphService.t.sol"; + +contract SubgraphServiceProvisionAcceptTest is SubgraphServiceTest { + /* + * TESTS + */ + + function test_SubgraphService_Provision_Accept( + uint256 tokens, + uint32 newVerifierCut, + uint64 newDisputePeriod + ) public { + tokens = bound(tokens, minimumProvisionTokens, MAX_TOKENS); + vm.assume(newVerifierCut >= fishermanRewardPercentage); + vm.assume(newVerifierCut <= MAX_PPM); + newDisputePeriod = uint64(bound(newDisputePeriod, 1, MAX_WAIT_PERIOD)); + + // Set the dispute period to the new value + resetPrank(users.governor); + disputeManager.setDisputePeriod(newDisputePeriod); + + // Setup indexer + resetPrank(users.indexer); + _createProvision(users.indexer, tokens, fishermanRewardPercentage, newDisputePeriod); + _register(users.indexer, abi.encode("url", "geoHash", address(0))); + + // Update parameters with new values + _setProvisionParameters(users.indexer, address(subgraphService), newVerifierCut, newDisputePeriod); + + // Accept provision and check parameters + _acceptProvision(users.indexer, ""); + } + + function test_SubgraphService_Provision_Accept_When_NotRegistered( + uint256 tokens, + uint32 newVerifierCut, + uint64 newDisputePeriod + ) public { + tokens = bound(tokens, minimumProvisionTokens, MAX_TOKENS); + vm.assume(newVerifierCut >= fishermanRewardPercentage); + vm.assume(newVerifierCut <= MAX_PPM); + newDisputePeriod = uint64(bound(newDisputePeriod, 1, MAX_WAIT_PERIOD)); + + // Set the dispute period to the new value + resetPrank(users.governor); + disputeManager.setDisputePeriod(newDisputePeriod); + + // Setup indexer but dont register + resetPrank(users.indexer); + _createProvision(users.indexer, tokens, fishermanRewardPercentage, newDisputePeriod); + + // Update parameters with new values + _setProvisionParameters(users.indexer, address(subgraphService), newVerifierCut, newDisputePeriod); + + // Accept provision and check parameters + _acceptProvision(users.indexer, ""); + } + + function test_SubgraphService_Provision_Accept_RevertWhen_NotAuthorized() public { + resetPrank(users.operator); + vm.expectRevert( + abi.encodeWithSelector( + ProvisionManager.ProvisionManagerNotAuthorized.selector, + users.indexer, + users.operator + ) + ); + subgraphService.acceptProvisionPendingParameters(users.indexer, ""); + } + + function test_SubgraphService_Provision_Accept_RevertIf_InvalidVerifierCut( + uint256 tokens, + uint32 newVerifierCut + ) public useIndexer { + tokens = bound(tokens, minimumProvisionTokens, MAX_TOKENS); + vm.assume(newVerifierCut < fishermanRewardPercentage); + + // Setup indexer + _createProvision(users.indexer, tokens, fishermanRewardPercentage, disputePeriod); + _register(users.indexer, abi.encode("url", "geoHash", address(0))); + + // Update parameters with new values + _setProvisionParameters(users.indexer, address(subgraphService), newVerifierCut, disputePeriod); + + // Should revert since newVerifierCut is invalid + vm.expectRevert( + abi.encodeWithSelector( + ProvisionManager.ProvisionManagerInvalidValue.selector, + "maxVerifierCut", + newVerifierCut, + fishermanRewardPercentage, + MAX_PPM + ) + ); + subgraphService.acceptProvisionPendingParameters(users.indexer, ""); + } + + function test_SubgraphService_Provision_Accept_RevertIf_InvalidDisputePeriod( + uint256 tokens, + uint64 newDisputePeriod + ) public useIndexer { + tokens = bound(tokens, minimumProvisionTokens, MAX_TOKENS); + vm.assume(newDisputePeriod < disputePeriod); + + // Setup indexer + _createProvision(users.indexer, tokens, fishermanRewardPercentage, disputePeriod); + _register(users.indexer, abi.encode("url", "geoHash", address(0))); + + // Update parameters with new values + _setProvisionParameters(users.indexer, address(subgraphService), fishermanRewardPercentage, newDisputePeriod); + + // Should revert since newDisputePeriod is invalid + vm.expectRevert( + abi.encodeWithSelector( + ProvisionManager.ProvisionManagerInvalidValue.selector, + "thawingPeriod", + newDisputePeriod, + disputePeriod, + disputePeriod + ) + ); + subgraphService.acceptProvisionPendingParameters(users.indexer, ""); + } +} diff --git a/packages/subgraph-service/test/unit/utils/Constants.sol b/packages/subgraph-service/test/unit/utils/Constants.sol new file mode 100644 index 000000000..04d64437e --- /dev/null +++ b/packages/subgraph-service/test/unit/utils/Constants.sol @@ -0,0 +1,33 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +abstract contract Constants { + uint256 internal constant MAX_TOKENS = 10_000_000_000 ether; + uint256 internal constant MAX_PPM = 1_000_000; + uint256 internal constant EPOCH_LENGTH = 1; + // Dispute Manager + uint64 internal constant disputePeriod = 7 days; + uint256 internal constant MIN_DISPUTE_DEPOSIT = 1 ether; // 1 GRT + uint256 internal constant disputeDeposit = 100 ether; // 100 GRT + uint32 internal constant fishermanRewardPercentage = 500000; // 50% + uint32 internal constant maxSlashingPercentage = 100000; // 10% + // Subgraph Service + uint256 internal constant minimumProvisionTokens = 1000 ether; + uint256 internal constant maximumProvisionTokens = type(uint256).max; + uint32 internal constant delegationRatio = 16; + uint256 public constant stakeToFeesRatio = 2; + uint256 public constant maxPOIStaleness = 28 days; + uint256 public constant curationCut = 10000; + // Staking + uint64 internal constant MAX_WAIT_PERIOD = 28 days; + uint256 internal constant MIN_DELEGATION = 1 ether; + // GraphEscrow parameters + uint256 internal constant withdrawEscrowThawingPeriod = 60; + // GraphPayments parameters + uint256 internal constant protocolPaymentCut = 10000; + // RewardsMananger parameters + uint256 public constant rewardsPerSignal = 10000; + uint256 public constant rewardsPerSubgraphAllocationUpdate = 1000; + // GraphTallyCollector parameters + uint256 public constant revokeSignerThawingPeriod = 7 days; +} diff --git a/packages/subgraph-service/test/unit/utils/Users.sol b/packages/subgraph-service/test/unit/utils/Users.sol new file mode 100644 index 000000000..e0c142fe1 --- /dev/null +++ b/packages/subgraph-service/test/unit/utils/Users.sol @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +struct Users { + address governor; + address deployer; + address indexer; + address operator; + address gateway; + address verifier; + address delegator; + address arbitrator; + address fisherman; + address rewardsDestination; + address pauseGuardian; +} diff --git a/packages/subgraph-service/test/unit/utils/Utils.sol b/packages/subgraph-service/test/unit/utils/Utils.sol new file mode 100644 index 000000000..be42f269f --- /dev/null +++ b/packages/subgraph-service/test/unit/utils/Utils.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.27; + +import "forge-std/Test.sol"; + +abstract contract Utils is Test { + /// @dev Stops the active prank and sets a new one. + function resetPrank(address msgSender) internal { + vm.stopPrank(); + vm.startPrank(msgSender); + } +} diff --git a/packages/subgraph-service/tsconfig.json b/packages/subgraph-service/tsconfig.json new file mode 100644 index 000000000..5f32ebc8c --- /dev/null +++ b/packages/subgraph-service/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "target": "es2020", + "module": "node16", + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "strict": true, + "skipLibCheck": true, + "resolveJsonModule": true, + "outDir": "dist", + "moduleResolution": "node16" + }, + "include": [ + "hardhat.config.ts", + "types/**/*.ts", + "scripts/**/*.ts", + "tasks/**/*.ts", + "test/**/*.ts", + "ignition/**/*.ts", + "eslint.config.js", + "prettier.config.js", + "natspec-smells.config.js" + ] +} diff --git a/packages/subgraph-service/types/hardhat-graph-protocol.d.ts b/packages/subgraph-service/types/hardhat-graph-protocol.d.ts new file mode 100644 index 000000000..8b5985269 --- /dev/null +++ b/packages/subgraph-service/types/hardhat-graph-protocol.d.ts @@ -0,0 +1,45 @@ +// TypeScript does not resolve correctly the type extensions when they are symlinked from the same monorepo. +// So we need to re-type it... this file should be a copy of hardhat-graph-protocol/src/type-extensions.ts +import 'hardhat/types/config' +import 'hardhat/types/runtime' +import type { GraphDeployments, GraphRuntimeEnvironment, GraphRuntimeEnvironmentOptions } from 'hardhat-graph-protocol' + +declare module 'hardhat/types/runtime' { + interface HardhatRuntimeEnvironment { + graph: (opts?: GraphRuntimeEnvironmentOptions) => GraphRuntimeEnvironment + } +} + +declare module 'hardhat/types/config' { + interface HardhatConfig { + graph: GraphRuntimeEnvironmentOptions + } + + interface HardhatUserConfig { + graph: GraphRuntimeEnvironmentOptions + } + + interface HardhatNetworkConfig { + deployments?: GraphDeployments + } + + interface HardhatNetworkUserConfig { + deployments?: GraphDeployments + } + + interface HttpNetworkConfig { + deployments?: GraphDeployments + } + + interface HttpNetworkUserConfig { + deployments?: GraphDeployments + } + + interface ProjectPathsConfig { + graph?: string + } + + interface ProjectPathsUserConfig { + graph?: string + } +} diff --git a/packages/token-distribution/.env.sample b/packages/token-distribution/.env.sample new file mode 100644 index 000000000..feae0f5fe --- /dev/null +++ b/packages/token-distribution/.env.sample @@ -0,0 +1,4 @@ +MNEMONIC= +ETHERSCAN_API_KEY= +INFURA_KEY= +STUDIO_API_KEY= diff --git a/packages/token-distribution/.graphclientrc.yml b/packages/token-distribution/.graphclientrc.yml new file mode 100644 index 000000000..3ab12d3ca --- /dev/null +++ b/packages/token-distribution/.graphclientrc.yml @@ -0,0 +1,21 @@ +sources: + - name: graph-network + handler: + graphql: + endpoint: https://gateway.thegraph.com/api/${STUDIO_API_KEY}/subgraphs/id/9Co7EQe5PgW3ugCUJrJgRv4u9zdEuDJf8NvMWftNsBH8 + retry: 5 + + - name: token-distribution + handler: + graphql: + endpoint: https://gateway.thegraph.com/api/${STUDIO_API_KEY}/subgraphs/id/ChfAJn6jQEBjVqtdUiThfG6sWy2Sr5XQPNucE9DkgXSN + retry: 5 + transforms: + - autoPagination: + validateSchema: true + +documents: + - ops/queries/account.graphql + - ops/queries/curators.graphql + - ops/queries/network.graphql + - ops/queries/tokenLockWallets.graphql diff --git a/packages/token-distribution/.openzeppelin/goerli.json b/packages/token-distribution/.openzeppelin/goerli.json new file mode 100644 index 000000000..9429a5cae --- /dev/null +++ b/packages/token-distribution/.openzeppelin/goerli.json @@ -0,0 +1,135 @@ +{ + "manifestVersion": "3.2", + "admin": { + "address": "0x4e8EC4059854d0634d7Ba04eA41B453cD56Afa5d", + "txHash": "0x47c8a0973f2457fda3f1243238d3b590cb78e6e78f2cd1040d97e94ced6834c4" + }, + "proxies": [ + { + "address": "0xa725CF32c367778CFF2ba7089Ab4e941BDD88612", + "txHash": "0x7297670fbbf9f1c014aac93fa0219522c079bdd0ad4bb16c75a204ba97b1bc81", + "kind": "transparent" + } + ], + "impls": { + "483bf2556291169f0be3d109cdfe83a3493b0312de77748f3926fc7426444bb5": { + "address": "0xF546bF936241571C380272bbf169D66D4184390c", + "txHash": "0xa276937f5f5913524ba900fa100509bfb3428e98e74f9f76345337c408c2614b", + "layout": { + "solcVersion": "0.7.3", + "storage": [ + { + "label": "_owner", + "offset": 0, + "slot": "0", + "type": "t_address", + "contract": "Ownable", + "src": "contracts/Ownable.sol:19" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "Ownable", + "src": "contracts/Ownable.sol:22" + }, + { + "label": "_initialized", + "offset": 0, + "slot": "51", + "type": "t_bool", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol:25" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "51", + "type": "t_bool", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol:30" + }, + { + "label": "l2LockManager", + "offset": 0, + "slot": "52", + "type": "t_mapping(t_address,t_address)", + "contract": "L1GraphTokenLockTransferTool", + "src": "contracts/L1GraphTokenLockTransferTool.sol:50" + }, + { + "label": "l2WalletOwner", + "offset": 0, + "slot": "53", + "type": "t_mapping(t_address,t_address)", + "contract": "L1GraphTokenLockTransferTool", + "src": "contracts/L1GraphTokenLockTransferTool.sol:53" + }, + { + "label": "l2WalletAddress", + "offset": 0, + "slot": "54", + "type": "t_mapping(t_address,t_address)", + "contract": "L1GraphTokenLockTransferTool", + "src": "contracts/L1GraphTokenLockTransferTool.sol:56" + }, + { + "label": "tokenLockETHBalances", + "offset": 0, + "slot": "55", + "type": "t_mapping(t_address,t_uint256)", + "contract": "L1GraphTokenLockTransferTool", + "src": "contracts/L1GraphTokenLockTransferTool.sol:59" + }, + { + "label": "l2Beneficiary", + "offset": 0, + "slot": "56", + "type": "t_mapping(t_address,t_address)", + "contract": "L1GraphTokenLockTransferTool", + "src": "contracts/L1GraphTokenLockTransferTool.sol:62" + }, + { + "label": "l2WalletAddressSetManually", + "offset": 0, + "slot": "57", + "type": "t_mapping(t_address,t_bool)", + "contract": "L1GraphTokenLockTransferTool", + "src": "contracts/L1GraphTokenLockTransferTool.sol:66" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_mapping(t_address,t_address)": { + "label": "mapping(address => address)", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_bool)": { + "label": "mapping(address => bool)", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_uint256)": { + "label": "mapping(address => uint256)", + "numberOfBytes": "32" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + } + } + } + } + } +} diff --git a/packages/token-distribution/.openzeppelin/mainnet.json b/packages/token-distribution/.openzeppelin/mainnet.json new file mode 100644 index 000000000..31ad4e83e --- /dev/null +++ b/packages/token-distribution/.openzeppelin/mainnet.json @@ -0,0 +1,135 @@ +{ + "manifestVersion": "3.2", + "admin": { + "address": "0x79E321CB828A0D1435050a1ce8d7985C4C3dfFFA", + "txHash": "0x7ed23b9530cd24071011637e782f43e942b2e0206042a67f5efe3affddbbc9c8" + }, + "proxies": [ + { + "address": "0xCa82c7Ce3388b0B5d307574099aC57d7a00d509F", + "txHash": "0x8535f77828c04d09f10107dea149d9ad72b477a386fd482d109d456e487667e0", + "kind": "transparent" + } + ], + "impls": { + "81b972d1a45d53657aeda6174118a103da6ec0b7e74535dd83748f6618297656": { + "address": "0x6a2A9bAd7b9Fa6ecEE8f249a0850f47eE184a275", + "txHash": "0x5c0dea018da76739bc39d324588a3fdd87b35c86a28469eb1442f701af0a7a82", + "layout": { + "solcVersion": "0.7.3", + "storage": [ + { + "label": "_owner", + "offset": 0, + "slot": "0", + "type": "t_address", + "contract": "Ownable", + "src": "contracts/Ownable.sol:19" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "Ownable", + "src": "contracts/Ownable.sol:22" + }, + { + "label": "_initialized", + "offset": 0, + "slot": "51", + "type": "t_bool", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol:25" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "51", + "type": "t_bool", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol:30" + }, + { + "label": "l2LockManager", + "offset": 0, + "slot": "52", + "type": "t_mapping(t_address,t_address)", + "contract": "L1GraphTokenLockTransferTool", + "src": "contracts/L1GraphTokenLockTransferTool.sol:50" + }, + { + "label": "l2WalletOwner", + "offset": 0, + "slot": "53", + "type": "t_mapping(t_address,t_address)", + "contract": "L1GraphTokenLockTransferTool", + "src": "contracts/L1GraphTokenLockTransferTool.sol:53" + }, + { + "label": "l2WalletAddress", + "offset": 0, + "slot": "54", + "type": "t_mapping(t_address,t_address)", + "contract": "L1GraphTokenLockTransferTool", + "src": "contracts/L1GraphTokenLockTransferTool.sol:56" + }, + { + "label": "tokenLockETHBalances", + "offset": 0, + "slot": "55", + "type": "t_mapping(t_address,t_uint256)", + "contract": "L1GraphTokenLockTransferTool", + "src": "contracts/L1GraphTokenLockTransferTool.sol:59" + }, + { + "label": "l2Beneficiary", + "offset": 0, + "slot": "56", + "type": "t_mapping(t_address,t_address)", + "contract": "L1GraphTokenLockTransferTool", + "src": "contracts/L1GraphTokenLockTransferTool.sol:62" + }, + { + "label": "l2WalletAddressSetManually", + "offset": 0, + "slot": "57", + "type": "t_mapping(t_address,t_bool)", + "contract": "L1GraphTokenLockTransferTool", + "src": "contracts/L1GraphTokenLockTransferTool.sol:66" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_mapping(t_address,t_address)": { + "label": "mapping(address => address)", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_bool)": { + "label": "mapping(address => bool)", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_uint256)": { + "label": "mapping(address => uint256)", + "numberOfBytes": "32" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + } + } + } + } + } +} diff --git a/packages/token-distribution/.openzeppelin/unknown-11155111.json b/packages/token-distribution/.openzeppelin/unknown-11155111.json new file mode 100644 index 000000000..2257b3e49 --- /dev/null +++ b/packages/token-distribution/.openzeppelin/unknown-11155111.json @@ -0,0 +1,135 @@ +{ + "manifestVersion": "3.2", + "admin": { + "address": "0xBbfAaA4A754931757B925AC0DDCcf97EB08e2895", + "txHash": "0x39364dc94694446616735d46554b5b5a937a7ec904deffee7aec9e9213c6fc12" + }, + "proxies": [ + { + "address": "0x543F8BFFb65c46091B4eEF4b1c394dFa43C4b065", + "txHash": "0x73d09cc6f92b3c97de26d3049db72a41249e0772d45c24c3818bce3344de8070", + "kind": "transparent" + } + ], + "impls": { + "cd6b1adc749eb68d0f47e7a8ff7b7c183afb072ac1de568f0c8b991a4e6388d0": { + "address": "0xDB47924Ad61D5C64D7921E9D0cb049Fb404A2DFB", + "txHash": "0xcab1656794d9a5e19e396214c5a4a687dd7e1b48197237d6778001e5510bd70c", + "layout": { + "solcVersion": "0.7.3", + "storage": [ + { + "label": "_owner", + "offset": 0, + "slot": "0", + "type": "t_address", + "contract": "Ownable", + "src": "contracts/Ownable.sol:19" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "Ownable", + "src": "contracts/Ownable.sol:22" + }, + { + "label": "_initialized", + "offset": 0, + "slot": "51", + "type": "t_bool", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol:25" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "51", + "type": "t_bool", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol:30" + }, + { + "label": "l2LockManager", + "offset": 0, + "slot": "52", + "type": "t_mapping(t_address,t_address)", + "contract": "L1GraphTokenLockTransferTool", + "src": "contracts/L1GraphTokenLockTransferTool.sol:50" + }, + { + "label": "l2WalletOwner", + "offset": 0, + "slot": "53", + "type": "t_mapping(t_address,t_address)", + "contract": "L1GraphTokenLockTransferTool", + "src": "contracts/L1GraphTokenLockTransferTool.sol:53" + }, + { + "label": "l2WalletAddress", + "offset": 0, + "slot": "54", + "type": "t_mapping(t_address,t_address)", + "contract": "L1GraphTokenLockTransferTool", + "src": "contracts/L1GraphTokenLockTransferTool.sol:56" + }, + { + "label": "tokenLockETHBalances", + "offset": 0, + "slot": "55", + "type": "t_mapping(t_address,t_uint256)", + "contract": "L1GraphTokenLockTransferTool", + "src": "contracts/L1GraphTokenLockTransferTool.sol:59" + }, + { + "label": "l2Beneficiary", + "offset": 0, + "slot": "56", + "type": "t_mapping(t_address,t_address)", + "contract": "L1GraphTokenLockTransferTool", + "src": "contracts/L1GraphTokenLockTransferTool.sol:62" + }, + { + "label": "l2WalletAddressSetManually", + "offset": 0, + "slot": "57", + "type": "t_mapping(t_address,t_bool)", + "contract": "L1GraphTokenLockTransferTool", + "src": "contracts/L1GraphTokenLockTransferTool.sol:66" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_mapping(t_address,t_address)": { + "label": "mapping(address => address)", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_bool)": { + "label": "mapping(address => bool)", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_uint256)": { + "label": "mapping(address => uint256)", + "numberOfBytes": "32" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + } + } + } + } + } +} diff --git a/packages/token-distribution/.openzeppelin/unknown-42161.json b/packages/token-distribution/.openzeppelin/unknown-42161.json new file mode 100644 index 000000000..b7de2438b --- /dev/null +++ b/packages/token-distribution/.openzeppelin/unknown-42161.json @@ -0,0 +1,25 @@ +{ + "manifestVersion": "3.2", + "admin": { + "address": "0x69E5E6aae945d342d6FA17D112C137D18E52C4Af", + "txHash": "0x00dcd23252a58b8304af1019f0d34dfefee1199c4b809acbc382d13615aee939" + }, + "proxies": [ + { + "address": "0x23C9c8575E6bA0349a497b6D0E8F0b9239e68028", + "txHash": "0xecb5b61a0d6fbca8f01174fea87d34172d4321650ba0566b0a9c87c7eca8df73", + "kind": "transparent" + } + ], + "impls": { + "3dff628cbc1a793190dc5ae0bc979ad427a9a98001209a3664d22dafc301b9b1": { + "address": "0x440e07acE09d848a581077c6DC8D7fb60FD8af62", + "txHash": "0x19f4d4f2701765d612f8ec4d7703a3d84761c4d81f3822addea9ba7ed023e0b3", + "layout": { + "solcVersion": "0.7.3", + "storage": [], + "types": {} + } + } + } +} diff --git a/packages/token-distribution/.openzeppelin/unknown-421613.json b/packages/token-distribution/.openzeppelin/unknown-421613.json new file mode 100644 index 000000000..d76355128 --- /dev/null +++ b/packages/token-distribution/.openzeppelin/unknown-421613.json @@ -0,0 +1,25 @@ +{ + "manifestVersion": "3.2", + "admin": { + "address": "0x5de859Bfd66BC330950c7dbf77F7F8fE519a1834", + "txHash": "0xbc443c4f31a36a6ff2cb5a8f39d9debd530626f9f51a9acccf28db6cfb6e94e0" + }, + "proxies": [ + { + "address": "0xc1A9C2E76171e64Cd5669B3E89D9A25a6b0FAfB7", + "txHash": "0x4c0fdb3290d0e247de1d0863bc2a7b13ea9414a86e5bfe94f1e2eba7c5c47f70", + "kind": "transparent" + } + ], + "impls": { + "f6ef37a54af859f9b6df6f1932063a6236e85e4e6ef0d8873a358db6ba412cb5": { + "address": "0xDc95A3418B4869c09572141Db70344434C8Bd9a8", + "txHash": "0x4b3258ad891966098856994fb4b6fde4a156d275d3ad813daa4930b9fbcf7861", + "layout": { + "solcVersion": "0.7.3", + "storage": [], + "types": {} + } + } + } +} diff --git a/packages/token-distribution/.openzeppelin/unknown-421614.json b/packages/token-distribution/.openzeppelin/unknown-421614.json new file mode 100644 index 000000000..809238758 --- /dev/null +++ b/packages/token-distribution/.openzeppelin/unknown-421614.json @@ -0,0 +1,25 @@ +{ + "manifestVersion": "3.2", + "admin": { + "address": "0xaf06340Afd383c81C0F025806f93e613Bf6229b2", + "txHash": "0x9cae0d327af86d32826d828ce26eb50c3d7c1138a6591ceaebb2de5accef1fe5" + }, + "proxies": [ + { + "address": "0xe21cd62E1E0CD68476C47F518980226C0a05fB19", + "txHash": "0x4785cb6bfeae00d727ed1199ad2724772507d6631135c73797069382a58af7d3", + "kind": "transparent" + } + ], + "impls": { + "9473208ed72647e49559194b7e906bf5eeb9ed0daf880eefb020b9493100d856": { + "address": "0x435F557d1fa367CAF33B567589F22a911Be28957", + "txHash": "0x321a11019d5a3d8fbdf1ba435b4a7a9c1961f3a6178c8deb2aaaeaeae7515775", + "layout": { + "solcVersion": "0.7.3", + "storage": [], + "types": {} + } + } + } +} diff --git a/packages/token-distribution/.solcover.js b/packages/token-distribution/.solcover.js new file mode 100644 index 000000000..bef64bdf9 --- /dev/null +++ b/packages/token-distribution/.solcover.js @@ -0,0 +1,10 @@ +const skipFiles = [''] + +module.exports = { + providerOptions: { + mnemonic: 'myth like bonus scare over problem client lizard pioneer submit female collect', + network_id: 1337, + }, + skipFiles, + istanbulFolder: './reports/coverage', +} diff --git a/packages/token-distribution/CHANGELOG.md b/packages/token-distribution/CHANGELOG.md new file mode 100644 index 000000000..2809305b6 --- /dev/null +++ b/packages/token-distribution/CHANGELOG.md @@ -0,0 +1,7 @@ +# @graphprotocol/token-distribution + +## 1.2.1 + +### Patch Changes + +- Bump contracts dependency diff --git a/packages/token-distribution/DEPLOYMENT.md b/packages/token-distribution/DEPLOYMENT.md new file mode 100644 index 000000000..704333faf --- /dev/null +++ b/packages/token-distribution/DEPLOYMENT.md @@ -0,0 +1,151 @@ + + +## Deploy a TokenManager (L1) + +The following instructions are for testnet (goerli), use `--network mainnet` to deploy to Mainnet. + +### 1. Deploy a Token Manager contract + +During this process the master copy of the GraphTokenLockWallet will be deployed and used in the Manager. + +``` +npx hardhat deploy --tags manager --network goerli +``` + +### 2. Fund the manager with the amount we need to deploy contracts + +The task will convert the amount passed in GRT to wei before calling the contracts. + +``` +npx hardhat manager-deposit --amount --network goerli +``` + +### 3. Deploy a number of Token Lock contracts using the Manager + +The process to set up the CSV file is described in the [README](./README.md). + +``` +npx hardhat create-token-locks --deploy-file --result-file --owner-address --network goerli +``` + +### 4. Setup the Token Manager to allow default protocol functions + +``` +npx hardhat manager-setup-auth --target-address --network goerli +``` + +## Deploying the manager, wallet and transfer tools to L2 + +This assumes a manager and token lock have already been deployed in L1 (and potentially many managers and token locks). + +The following instructions are for testnet (goerli and Arbitrum goerli), use `--network mainnet` to deploy to Mainnet and `--network arbitrum-one` for Arbitrum One. + +### 1. Deploy the L2GraphTokenLockWallet master copy + +Keep in mind you might want to use a different mnemonic in `.env` for the L2 deployer. Note that each transfer tool in L1 will only support a single wallet implementation in L2, so if you deploy several L2 managers, make sure all of them use the same wallet master copy in L2. + +``` +npx hardhat deploy --tags l2-wallet --network arbitrum-goerli +``` + +### 2. Deploy the L1GraphTokenLockTransferTool + +You will be prompted for a few relevant addresses, including the Staking contract and the address of the L2GraphTokenLockWallet implementation that you just deployed. + +Note the transfer tool is upgradeable (uses an OZ transparent proxy). + +``` +npx hardhat deploy --tags l1-transfer-tool --network goerli +``` + +### 3. Deploy the L2GraphTokenLockManager for each L1 manager + +Note this will not ask you for the L1 manager address, it is set separately in the transfer tool contract. + +You can optionally fund the L2 manager if you'd like to also create L2-native vesting contracts with it. + +``` +npx hardhat deploy --tags l2-manager --network arbitrum-goerli +``` + +### 4. Deploy the L2GraphTokenLockTransferTool + +Note the transfer tool is upgradeable (uses an OZ transparent proxy). + +``` +npx hardhat deploy --tags l2-transfer-tool --network arbitrum-goerli +``` + +### 5. Set the L2 owners and manager addresses + +Each token lock has an owner, that may map to a different address in L2. So we need to set the owner address in the L1GraphTokenLockTransferTool. + +This is done using a hardhat console on L1, i.e. `npx hardhat console --network goerli`: + +```javascript +transferToolAddress = '' +l1Owner = '' +l2Owner = '' +deployer = (await hre.ethers.getSigners())[0] +transferTool = await hre.ethers.getContractAt('L1GraphTokenLockTransferTool', transferToolAddress) +await transferTool.connect(deployer).setL2WalletOwner(l1Owner, l2Owner) +// Repeat for each owner... +``` + +After doing this for each owner, you must also set the L2GraphTokenLockManager address that corresponds to each L1 manager: + +```javascript +transferToolAddress = '' +l1Manager = '' +l2Manager = '' +deployer = (await hre.ethers.getSigners())[0] +transferTool = await hre.ethers.getContractAt('L1GraphTokenLockTransferTool', transferToolAddress) +await transferTool.connect(deployer).setL2LockManager(l1Manager, l2Manager) +// Repeat for each manager... +``` + +### 6. Configure the new authorized functions in L1 + +The addition of the L1 transfer tool means adding a new authorized contract and functions in the L1 manager's allowlist. For each manager, we need to add a new token destination (the L1 transfer tool) and the corresponding functions. This assumes the deployer is also the manager owner, if that's not the case, use the correct signer: + +```javascript +transferToolAddress = '' +stakingAddress = ' +l1Manager = '' +deployer = (await hre.ethers.getSigners())[0] +tokenLockManager = await hre.ethers.getContractAt('GraphTokenLockManager', l1Manager) +await tokenLockManager.setAuthFunctionCall('depositToL2Locked(uint256,address,uint256,uint256,uint256)', transferToolAddress) +await tokenLockManager.setAuthFunctionCall('withdrawETH(address,uint256)', transferToolAddress) +await tokenLockManager.setAuthFunctionCall('setL2WalletAddressManually(address)', transferToolAddress) +await tokenLockManager.addTokenDestination(transferToolAddress) +await tokenLockManager.setAuthFunctionCall('transferLockedDelegationToL2(address,uint256,uint256,uint256)', stakingAddress) +await tokenLockManager.setAuthFunctionCall('transferLockedStakeToL2(uint256,uint256,uint256,uint256)', stakingAddress) +// Repeat for each manager... +``` + +Keep in mind that existing lock wallets that had already called `approveProtocol()` to interact with the protocol will need to call `revokeProtocol()` and then `approveProtocol()` to be able to use the transfer tool. + +### 7. Configure the authorized functions on L2 + +The L2 managers will also need to authorize the functions to interact with the protocol. This is similar to step 4 when setting up the manager in L1, but here we must specify the manager name used when deploying the L2 manager + +``` +npx hardhat manager-setup-auth --target-address --manager-name --network arbitrum-goerli +``` + +We then need to also add authorization to call the L2 transfer tool on a hardhat console: + +```javascript +transferToolAddress = '' +l2Manager = '' +deployer = (await hre.ethers.getSigners())[0] +tokenLockManager = await hre.ethers.getContractAt('L2GraphTokenLockManager', l2Manager) +await tokenLockManager.setAuthFunctionCall('withdrawToL1Locked(uint256)', transferToolAddress) +await tokenLockManager.addTokenDestination(transferToolAddress) +// Repeat for each manager... +``` + +### 8. Make sure the protocol is configured + +The contracts for The Graph must be configured such that the L1 transfer tool is added to the bridge callhook allowlist so that it can send data through the bridge. +Additionally, the L1Staking contract must be configured to use the L1 transfer tool when transferring stake and delegation for vesting contracts; this is done using the `setL1GraphTokenLockTransferTool` (called by the Governor, i.e. the Council). diff --git a/packages/token-distribution/LICENSE.md b/packages/token-distribution/LICENSE.md new file mode 100644 index 000000000..f417054d0 --- /dev/null +++ b/packages/token-distribution/LICENSE.md @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2020 The Graph Foundation. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/packages/token-distribution/README.md b/packages/token-distribution/README.md new file mode 100644 index 000000000..d52cb4ad4 --- /dev/null +++ b/packages/token-distribution/README.md @@ -0,0 +1,159 @@ +# Graph Protocol Token Lock + +This repository contains a number of contracts that will support the locking of tokens of participants under different schedules. +An important premise is that participants with locked tokens can perform a number of restricted actions in the protocol with their tokens. + +## Contracts + +### GraphTokenLock + +The contract lock manages a number of tokens deposited into the contract to ensure that they can only be released under certain time conditions. + +This contract implements a release schedule based on periods where tokens are released in steps after each period ends. It can be configured with one period in which case it works like a plain TimeLock. +It also supports revocation by the contract owner to be used for vesting schedules. + +The contract supports receiving extra funds over the managed tokens that can be withdrawn by the beneficiary at any time. + +A releaseStartTime parameter is included to override the default release schedule and perform the first release on the configured time. After that initial release it will continue with the default schedule. + +### GraphTokenLockWallet + +This contract is built on top of the base **GraphTokenLock** functionality. It allows the use of locked funds only when authorized function calls are issued to the contract. +It works by "forwarding" authorized function calls to predefined target contracts in the Graph Network. + +The idea is that supporters with locked tokens can participate in the protocol but disallow any release before the vesting/lock schedule. +The function calls allowed are queried to the **GraphTokenLockManager**, this way the same configuration can be shared for all the created lock wallet contracts. + +Locked tokens must only leave this contract under the locking rules and by the beneficiary calling release(). Tokens used in the protocol need to get back to this contract when unstaked or undelegated. + +Some users can profit by participating in the protocol through their locked tokens, if they withdraw them from the protocol back to the lock contract, they should be able to withdraw those surplus funds out of the contract. + +The following functions signatures will be authorized for use: + +``` +### Target + +- Staking contract address + + +### Function Signatures + +- setOperator(address,bool) + +- stake(uint256) +- unstake(uint256) +- withdraw() + +- setDelegationParameters(uint32,uint32,uint32) +- delegate(address,uint256) +- undelegate(address,uint256) +- withdrawDelegated(address,address) +``` + +### GraphTokenLockManager + +Contract that works as a factory of **GraphTokenLockWallet** contracts. It manages the function calls authorized to be called on any GraphTokenWallet and also holds addresses of our protocol contracts configured as targets. + +The Manager supports creating TokenLock contracts based on a mastercopy bytecode using a Minimal Proxy to save gas. It also does so with CREATE2 to have reproducible addresses, this way any future to be deployed contract address can be passed to beneficiaries before actual deployment. + +For convenience, the Manager will also fund the created contract with the amount of each contract's managed tokens. + +## L2 deployment and transfer tools + +As part of the process for The Graph to move to Arbitrum, some contracts were added to allow GraphTokenLockWallet beneficiaries to transfer their funds to a vesting wallet in L2 and transfer their stake and delegations to L2 as well, where they will be owned by the L2 vesting wallet. See [GIP-0046](https://forum.thegraph.com/t/gip-0046-l2-transfer-tools/4023) for more details about the architecture. + +### L2GraphTokenLockWallet + +The L2 version of the GraphTokenLockWallet is essentially the same, but adds a special function to initialize a wallet with information received from L1. Keep in mind that **vesting contracts in L2 that are created from an L1 contract cannot release funds in L2 until the end of the full vesting timeline**. Funds can be sent back to L1 using the L2GraphTokenLockTransferTool to be released there. + +### L2GraphTokenLockManager + +The L2 manager inherits from GraphTokenLockManager but includes an `onTokenTransfer` function for the GRT bridge to call when receiving locked GRT from L1. The first time that GRT is received for a new L1 wallet, the corresponding L2GraphTokenLockWallet contract is created and initialized. + +### L1GraphTokenLockTransferTool + +For L1 GraphTokenLockWallet beneficiaries to transfer to L2, they must use this transfer tool contract. The contract allows beneficiaries to deposit ETH to pay for the L2 gas and fees related to sending messages to L2. It then allows two different flows, depending on the state of the vesting contract: + +- For fully vested GraphTokenLockWallet contracts, the wallet can call the transfer tool specifying the address that the beneficiary wants to use in L2. This will be a normal wallet (can be an EOA or a multisig in L2), and this will be queried by the Staking contract when transferring stake or delegation. Please note that **this address can only be set once and cannot be changed**. +- For contracts that are still vesting, the wallet can call the transfer tool specifying an amount of GRT to transfer to L2. This GRT value will be sent from the vesting wallet's GRT balance, and must be nonzero. The caller can also specify a beneficiary that will own the L2 vesting wallet, which is only used if this hasn't already been set in a previous call. + +### L2GraphTokenLockTransferTool + +For beneficiaries of L1 vesting contracts to release funds that have been sent to L2, the GRT funds must be sent to L1 first. The L2GraphTokenLockTransferTool only has a `withdrawToL1Locked` function for this purpose, it will use the GRT bridge to send GRT to the L1 vesting contract that corresponds to the caller. + +## Operations + +For detailed instructions about deploying the manager or the transfer tools, check out [DEPLOYMENT.md](./DEPLOYMENT.md). + +### Deploying new vesting locks + +**1) Check configuration** + +Ensure the .env file contains the MNEMONIC you are going to use for the deployment. Please refer to the `.env.sample` file for reference. + +**2) Create the deployment file** + +The file must be have CSV format in placed in the `/ops` folder with the following header: +``` +beneficiary,managedAmount,startTime,endTime,periods,revocable,releaseStartTime,vestingCliffTime +... line 1 +... line 2 +... N +``` + +- **beneficiary** Address of the beneficiary of locked tokens. +- **managedAmount** Amount of tokens to be managed by the lock contract. +- **startTime** Start time of the release schedule. +- **endTime** End time of the release schedule. +- **periods** Number of periods between start time and end time. +- **revocable** Whether the contract is revocable. Should be 1 for `Enabled` or 2 for 1 `Disable`. Setting this to 0 for `NotSet` will cause the transaction to fail with error `Must set a revocability option`. +- **releaseStartTime** Override time for when the releases start. +- **vestingCliffTime** Time the cliff vests, 0 if no cliff + +You can define one line per contract. Keep the header in the file. + +In addition to that, create an empty file in the `/ops` folder to store the results of the deployed contracts. + +**2) Deposit funds in the Manager** + +You need to deposit enough funds in the Manager to be able to use for the deployments. When you run the `create-token-locks` command it will always check that the Manager has enough tokens to cover for the sum of vesting amount. + +``` +npx hardhat manager-deposit --amount --network +``` + +- **amount** is a string and it can have 18 decimals. For example 1000.12 + +- **network** depends on the `hardhat.config` but most of the times will be sepolia or mainnet. + +**3) Deploy the contracts** + +``` +npx hardhat create-token-locks --network sepolia \ + --deploy-file \ + --result-file \ + --owner-address \ + --dry-run (Flag) \ + --tx-builder (Flag) \ + --tx-builder-template (Optional) +``` + +- **network** depends on the hardhat.config but most of the times will be rinkeby or mainnet. + +- **deploy-file** file name under `/ops` that contains the contracts to deploy. + +- **result-file** file with the results of deployments. + +- **owner-address** address to use as owner of the vesting contracts. The owner can revoke the contract if revocable. + +- **dry-run** Get the deterministic contract addresses but do not deploy. + +- **tx-builder** Output transaction batch in JSON format, compatible with Gnosis Safe transaction builder. Does not deploy contracts. + +- **tx-builder-template** File to use as a template for the transaction builder. + +## Copyright + +Copyright © 2020 The Graph Foundation + +Licensed under the [MIT license](LICENSE.md). diff --git a/packages/token-distribution/abi/TokenLockWalletABIFull.json b/packages/token-distribution/abi/TokenLockWalletABIFull.json new file mode 100644 index 000000000..42f05c95a --- /dev/null +++ b/packages/token-distribution/abi/TokenLockWalletABIFull.json @@ -0,0 +1,773 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_oldManager", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "_newManager", + "type": "address" + } + ], + "name": "ManagerUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "TokenDestinationsApproved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "TokenDestinationsRevoked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensReleased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensRevoked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensWithdrawn", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "amountPerPeriod", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "approveProtocol", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "availableAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "beneficiary", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "currentBalance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "currentPeriod", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "currentTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "duration", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "endTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_manager", + "type": "address" + }, + { + "internalType": "address", + "name": "_owner", + "type": "address" + }, + { + "internalType": "address", + "name": "_beneficiary", + "type": "address" + }, + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_managedAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_startTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_endTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_periods", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_releaseStartTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_vestingCliffTime", + "type": "uint256" + }, + { + "internalType": "enum IGraphTokenLock.Revocability", + "name": "_revocable", + "type": "uint8" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "isInitialized", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isRevoked", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "managedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "manager", + "outputs": [ + { + "internalType": "contract IGraphTokenLockManager", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "passedPeriods", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "periodDuration", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "periods", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "releasableAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "release", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "releaseStartTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "releasedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "revocable", + "outputs": [ + { + "internalType": "enum IGraphTokenLock.Revocability", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "revoke", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "revokeProtocol", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newManager", + "type": "address" + } + ], + "name": "setManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "sinceStartTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "startTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "surplusAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "token", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalOutstandingAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "usedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "vestedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "vestingCliffTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "withdrawSurplus", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_tokens", + "type": "uint256" + } + ], + "name": "stake", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_tokens", + "type": "uint256" + } + ], + "name": "unstake", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_operator", + "type": "address" + }, + { + "internalType": "bool", + "name": "_allowed", + "type": "bool" + } + ], + "name": "setOperator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_destination", + "type": "address" + } + ], + "name": "setRewardsDestination", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "_indexingRewardCut", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "_queryFeeCut", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "_cooldownBlocks", + "type": "uint32" + } + ], + "name": "setDelegationParameters", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_indexer", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_tokens", + "type": "uint256" + } + ], + "name": "delegate", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_indexer", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_shares", + "type": "uint256" + } + ], + "name": "undelegate", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_indexer", + "type": "address" + }, + { + "internalType": "address", + "name": "_delegateToIndexer", + "type": "address" + } + ], + "name": "withdrawDelegated", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/packages/token-distribution/abi/TokenLockWalletABIRemix.json b/packages/token-distribution/abi/TokenLockWalletABIRemix.json new file mode 100644 index 000000000..dc62b9d41 --- /dev/null +++ b/packages/token-distribution/abi/TokenLockWalletABIRemix.json @@ -0,0 +1,618 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_oldManager", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "_newManager", + "type": "address" + } + ], + "name": "ManagerUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "TokenDestinationsApproved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "TokenDestinationsRevoked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensReleased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensRevoked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensWithdrawn", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "amountPerPeriod", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "approveProtocol", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "beneficiary", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "currentBalance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "currentPeriod", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "currentTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "duration", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "endTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isRevoked", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "managedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "passedPeriods", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "periodDuration", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "periods", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "releasableAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "release", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "releaseStartTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "releasedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "revocable", + "outputs": [ + { + "internalType": "enum IGraphTokenLock.Revocability", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "revokeProtocol", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "sinceStartTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "startTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "surplusAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "token", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalOutstandingAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "usedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "vestedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "vestingCliffTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "withdrawSurplus", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_tokens", + "type": "uint256" + } + ], + "name": "stake", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_tokens", + "type": "uint256" + } + ], + "name": "unstake", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_operator", + "type": "address" + }, + { + "internalType": "bool", + "name": "_allowed", + "type": "bool" + } + ], + "name": "setOperator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_destination", + "type": "address" + } + ], + "name": "setRewardsDestination", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "_indexingRewardCut", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "_queryFeeCut", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "_cooldownBlocks", + "type": "uint32" + } + ], + "name": "setDelegationParameters", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_indexer", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_tokens", + "type": "uint256" + } + ], + "name": "delegate", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_indexer", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_shares", + "type": "uint256" + } + ], + "name": "undelegate", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_indexer", + "type": "address" + }, + { + "internalType": "address", + "name": "_delegateToIndexer", + "type": "address" + } + ], + "name": "withdrawDelegated", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/packages/token-distribution/audits/2020-11-graph-token-distribution.pdf b/packages/token-distribution/audits/2020-11-graph-token-distribution.pdf new file mode 100644 index 000000000..cc11beb06 Binary files /dev/null and b/packages/token-distribution/audits/2020-11-graph-token-distribution.pdf differ diff --git a/packages/token-distribution/contracts/GraphTokenDistributor.sol b/packages/token-distribution/contracts/GraphTokenDistributor.sol new file mode 100644 index 000000000..a7cd88137 --- /dev/null +++ b/packages/token-distribution/contracts/GraphTokenDistributor.sol @@ -0,0 +1,161 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.7.3; + +import "@openzeppelin/contracts/access/Ownable.sol"; +import "@openzeppelin/contracts/math/SafeMath.sol"; +import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; +import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; + +/** + * @title GraphTokenDistributor + * @dev Contract that allows distribution of tokens to multiple beneficiaries. + * The contract accept deposits in the configured token by anyone. + * The owner can setup the desired distribution by setting the amount of tokens + * assigned to each beneficiary account. + * Beneficiaries claim for their allocated tokens. + * Only the owner can withdraw tokens from this contract without limitations. + * For the distribution to work this contract must be unlocked by the owner. + */ +contract GraphTokenDistributor is Ownable { + using SafeMath for uint256; + using SafeERC20 for IERC20; + + // -- State -- + + bool public locked; + mapping(address => uint256) public beneficiaries; + + IERC20 public token; + + // -- Events -- + + event BeneficiaryUpdated(address indexed beneficiary, uint256 amount); + event TokensDeposited(address indexed sender, uint256 amount); + event TokensWithdrawn(address indexed sender, uint256 amount); + event TokensClaimed(address indexed beneficiary, address to, uint256 amount); + event LockUpdated(bool locked); + + modifier whenNotLocked() { + require(locked == false, "Distributor: Claim is locked"); + _; + } + + /** + * Constructor. + * @param _token Token to use for deposits and withdrawals + */ + constructor(IERC20 _token) { + token = _token; + locked = true; + } + + /** + * Deposit tokens into the contract. + * Even if the ERC20 token can be transferred directly to the contract + * this function provide a safe interface to do the transfer and avoid mistakes + * @param _amount Amount to deposit + */ + function deposit(uint256 _amount) external { + token.safeTransferFrom(msg.sender, address(this), _amount); + emit TokensDeposited(msg.sender, _amount); + } + + // -- Admin functions -- + + /** + * Add token balance available for account. + * @param _account Address to assign tokens to + * @param _amount Amount of tokens to assign to beneficiary + */ + function addBeneficiaryTokens(address _account, uint256 _amount) external onlyOwner { + _setBeneficiaryTokens(_account, beneficiaries[_account].add(_amount)); + } + + /** + * Add token balance available for multiple accounts. + * @param _accounts Addresses to assign tokens to + * @param _amounts Amounts of tokens to assign to beneficiary + */ + function addBeneficiaryTokensMulti(address[] calldata _accounts, uint256[] calldata _amounts) external onlyOwner { + require(_accounts.length == _amounts.length, "Distributor: !length"); + for (uint256 i = 0; i < _accounts.length; i++) { + _setBeneficiaryTokens(_accounts[i], beneficiaries[_accounts[i]].add(_amounts[i])); + } + } + + /** + * Remove token balance available for account. + * @param _account Address to assign tokens to + * @param _amount Amount of tokens to assign to beneficiary + */ + function subBeneficiaryTokens(address _account, uint256 _amount) external onlyOwner { + _setBeneficiaryTokens(_account, beneficiaries[_account].sub(_amount)); + } + + /** + * Remove token balance available for multiple accounts. + * @param _accounts Addresses to assign tokens to + * @param _amounts Amounts of tokens to assign to beneficiary + */ + function subBeneficiaryTokensMulti(address[] calldata _accounts, uint256[] calldata _amounts) external onlyOwner { + require(_accounts.length == _amounts.length, "Distributor: !length"); + for (uint256 i = 0; i < _accounts.length; i++) { + _setBeneficiaryTokens(_accounts[i], beneficiaries[_accounts[i]].sub(_amounts[i])); + } + } + + /** + * Set amount of tokens available for beneficiary account. + * @param _account Address to assign tokens to + * @param _amount Amount of tokens to assign to beneficiary + */ + function _setBeneficiaryTokens(address _account, uint256 _amount) private { + require(_account != address(0), "Distributor: !account"); + + beneficiaries[_account] = _amount; + emit BeneficiaryUpdated(_account, _amount); + } + + /** + * Set locked withdrawals. + * @param _locked True to lock withdrawals + */ + function setLocked(bool _locked) external onlyOwner { + locked = _locked; + emit LockUpdated(_locked); + } + + /** + * Withdraw tokens from the contract. This function is included as + * a escape hatch in case of mistakes or to recover remaining funds. + * @param _amount Amount of tokens to withdraw + */ + function withdraw(uint256 _amount) external onlyOwner { + token.safeTransfer(msg.sender, _amount); + emit TokensWithdrawn(msg.sender, _amount); + } + + // -- Beneficiary functions -- + + /** + * Claim tokens and send to caller. + */ + function claim() external whenNotLocked { + claimTo(msg.sender); + } + + /** + * Claim tokens and send to address. + * @param _to Address where to send tokens + */ + function claimTo(address _to) public whenNotLocked { + uint256 claimableTokens = beneficiaries[msg.sender]; + require(claimableTokens > 0, "Distributor: Unavailable funds"); + + _setBeneficiaryTokens(msg.sender, 0); + + token.safeTransfer(_to, claimableTokens); + emit TokensClaimed(msg.sender, _to, claimableTokens); + } +} diff --git a/packages/token-distribution/contracts/GraphTokenLock.sol b/packages/token-distribution/contracts/GraphTokenLock.sol new file mode 100644 index 000000000..03cfbca43 --- /dev/null +++ b/packages/token-distribution/contracts/GraphTokenLock.sol @@ -0,0 +1,384 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.7.3; + +import "@openzeppelin/contracts/math/SafeMath.sol"; +import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; +import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; + +import { Ownable as OwnableInitializable } from "./Ownable.sol"; +import "./MathUtils.sol"; +import "./IGraphTokenLock.sol"; + +/** + * @title GraphTokenLock + * @notice Contract that manages an unlocking schedule of tokens. + * @dev The contract lock manage a number of tokens deposited into the contract to ensure that + * they can only be released under certain time conditions. + * + * This contract implements a release scheduled based on periods and tokens are released in steps + * after each period ends. It can be configured with one period in which case it is like a plain TimeLock. + * It also supports revocation to be used for vesting schedules. + * + * The contract supports receiving extra funds than the managed tokens ones that can be + * withdrawn by the beneficiary at any time. + * + * A releaseStartTime parameter is included to override the default release schedule and + * perform the first release on the configured time. After that it will continue with the + * default schedule. + */ +abstract contract GraphTokenLock is OwnableInitializable, IGraphTokenLock { + using SafeMath for uint256; + using SafeERC20 for IERC20; + + uint256 private constant MIN_PERIOD = 1; + + // -- State -- + + IERC20 public token; + address public beneficiary; + + // Configuration + + // Amount of tokens managed by the contract schedule + uint256 public managedAmount; + + uint256 public startTime; // Start datetime (in unixtimestamp) + uint256 public endTime; // Datetime after all funds are fully vested/unlocked (in unixtimestamp) + uint256 public periods; // Number of vesting/release periods + + // First release date for tokens (in unixtimestamp) + // If set, no tokens will be released before releaseStartTime ignoring + // the amount to release each period + uint256 public releaseStartTime; + // A cliff set a date to which a beneficiary needs to get to vest + // all preceding periods + uint256 public vestingCliffTime; + Revocability public revocable; // Whether to use vesting for locked funds + + // State + + bool public isRevoked; + bool public isInitialized; + bool public isAccepted; + uint256 public releasedAmount; + uint256 public revokedAmount; + + // -- Events -- + + event TokensReleased(address indexed beneficiary, uint256 amount); + event TokensWithdrawn(address indexed beneficiary, uint256 amount); + event TokensRevoked(address indexed beneficiary, uint256 amount); + event BeneficiaryChanged(address newBeneficiary); + event LockAccepted(); + event LockCanceled(); + + /** + * @dev Only allow calls from the beneficiary of the contract + */ + modifier onlyBeneficiary() { + require(msg.sender == beneficiary, "!auth"); + _; + } + + /** + * @notice Initializes the contract + * @param _owner Address of the contract owner + * @param _beneficiary Address of the beneficiary of locked tokens + * @param _managedAmount Amount of tokens to be managed by the lock contract + * @param _startTime Start time of the release schedule + * @param _endTime End time of the release schedule + * @param _periods Number of periods between start time and end time + * @param _releaseStartTime Override time for when the releases start + * @param _vestingCliffTime Override time for when the vesting start + * @param _revocable Whether the contract is revocable + */ + function _initialize( + address _owner, + address _beneficiary, + address _token, + uint256 _managedAmount, + uint256 _startTime, + uint256 _endTime, + uint256 _periods, + uint256 _releaseStartTime, + uint256 _vestingCliffTime, + Revocability _revocable + ) internal { + require(!isInitialized, "Already initialized"); + require(_owner != address(0), "Owner cannot be zero"); + require(_beneficiary != address(0), "Beneficiary cannot be zero"); + require(_token != address(0), "Token cannot be zero"); + require(_managedAmount > 0, "Managed tokens cannot be zero"); + require(_startTime != 0, "Start time must be set"); + require(_startTime < _endTime, "Start time > end time"); + require(_periods >= MIN_PERIOD, "Periods cannot be below minimum"); + require(_revocable != Revocability.NotSet, "Must set a revocability option"); + require(_releaseStartTime < _endTime, "Release start time must be before end time"); + require(_vestingCliffTime < _endTime, "Cliff time must be before end time"); + + isInitialized = true; + + OwnableInitializable._initialize(_owner); + beneficiary = _beneficiary; + token = IERC20(_token); + + managedAmount = _managedAmount; + + startTime = _startTime; + endTime = _endTime; + periods = _periods; + + // Optionals + releaseStartTime = _releaseStartTime; + vestingCliffTime = _vestingCliffTime; + revocable = _revocable; + } + + /** + * @notice Change the beneficiary of funds managed by the contract + * @dev Can only be called by the beneficiary + * @param _newBeneficiary Address of the new beneficiary address + */ + function changeBeneficiary(address _newBeneficiary) external onlyBeneficiary { + require(_newBeneficiary != address(0), "Empty beneficiary"); + beneficiary = _newBeneficiary; + emit BeneficiaryChanged(_newBeneficiary); + } + + /** + * @notice Beneficiary accepts the lock, the owner cannot retrieve back the tokens + * @dev Can only be called by the beneficiary + */ + function acceptLock() external onlyBeneficiary { + isAccepted = true; + emit LockAccepted(); + } + + /** + * @notice Owner cancel the lock and return the balance in the contract + * @dev Can only be called by the owner + */ + function cancelLock() external onlyOwner { + require(isAccepted == false, "Cannot cancel accepted contract"); + + token.safeTransfer(owner(), currentBalance()); + + emit LockCanceled(); + } + + // -- Balances -- + + /** + * @notice Returns the amount of tokens currently held by the contract + * @return Tokens held in the contract + */ + function currentBalance() public view override returns (uint256) { + return token.balanceOf(address(this)); + } + + // -- Time & Periods -- + + /** + * @notice Returns the current block timestamp + * @return Current block timestamp + */ + function currentTime() public view override returns (uint256) { + return block.timestamp; + } + + /** + * @notice Gets duration of contract from start to end in seconds + * @return Amount of seconds from contract startTime to endTime + */ + function duration() public view override returns (uint256) { + return endTime.sub(startTime); + } + + /** + * @notice Gets time elapsed since the start of the contract + * @dev Returns zero if called before conctract starTime + * @return Seconds elapsed from contract startTime + */ + function sinceStartTime() public view override returns (uint256) { + uint256 current = currentTime(); + if (current <= startTime) { + return 0; + } + return current.sub(startTime); + } + + /** + * @notice Returns amount available to be released after each period according to schedule + * @return Amount of tokens available after each period + */ + function amountPerPeriod() public view override returns (uint256) { + return managedAmount.div(periods); + } + + /** + * @notice Returns the duration of each period in seconds + * @return Duration of each period in seconds + */ + function periodDuration() public view override returns (uint256) { + return duration().div(periods); + } + + /** + * @notice Gets the current period based on the schedule + * @return A number that represents the current period + */ + function currentPeriod() public view override returns (uint256) { + return sinceStartTime().div(periodDuration()).add(MIN_PERIOD); + } + + /** + * @notice Gets the number of periods that passed since the first period + * @return A number of periods that passed since the schedule started + */ + function passedPeriods() public view override returns (uint256) { + return currentPeriod().sub(MIN_PERIOD); + } + + // -- Locking & Release Schedule -- + + /** + * @notice Gets the currently available token according to the schedule + * @dev Implements the step-by-step schedule based on periods for available tokens + * @return Amount of tokens available according to the schedule + */ + function availableAmount() public view override returns (uint256) { + uint256 current = currentTime(); + + // Before contract start no funds are available + if (current < startTime) { + return 0; + } + + // After contract ended all funds are available + if (current > endTime) { + return managedAmount; + } + + // Get available amount based on period + return passedPeriods().mul(amountPerPeriod()); + } + + /** + * @notice Gets the amount of currently vested tokens + * @dev Similar to available amount, but is fully vested when contract is non-revocable + * @return Amount of tokens already vested + */ + function vestedAmount() public view override returns (uint256) { + // If non-revocable it is fully vested + if (revocable == Revocability.Disabled) { + return managedAmount; + } + + // Vesting cliff is activated and it has not passed means nothing is vested yet + if (vestingCliffTime > 0 && currentTime() < vestingCliffTime) { + return 0; + } + + return availableAmount(); + } + + /** + * @notice Gets tokens currently available for release + * @dev Considers the schedule and takes into account already released tokens + * @return Amount of tokens ready to be released + */ + function releasableAmount() public view virtual override returns (uint256) { + // If a release start time is set no tokens are available for release before this date + // If not set it follows the default schedule and tokens are available on + // the first period passed + if (releaseStartTime > 0 && currentTime() < releaseStartTime) { + return 0; + } + + // Vesting cliff is activated and it has not passed means nothing is vested yet + // so funds cannot be released + if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) { + return 0; + } + + // A beneficiary can never have more releasable tokens than the contract balance + uint256 releasable = availableAmount().sub(releasedAmount); + return MathUtils.min(currentBalance(), releasable); + } + + /** + * @notice Gets the outstanding amount yet to be released based on the whole contract lifetime + * @dev Does not consider schedule but just global amounts tracked + * @return Amount of outstanding tokens for the lifetime of the contract + */ + function totalOutstandingAmount() public view override returns (uint256) { + return managedAmount.sub(releasedAmount).sub(revokedAmount); + } + + /** + * @notice Gets surplus amount in the contract based on outstanding amount to release + * @dev All funds over outstanding amount is considered surplus that can be withdrawn by beneficiary. + * Note this might not be the correct value for wallets transferred to L2 (i.e. an L2GraphTokenLockWallet), as the released amount will be + * skewed, so the beneficiary might have to bridge back to L1 to release the surplus. + * @return Amount of tokens considered as surplus + */ + function surplusAmount() public view override returns (uint256) { + uint256 balance = currentBalance(); + uint256 outstandingAmount = totalOutstandingAmount(); + if (balance > outstandingAmount) { + return balance.sub(outstandingAmount); + } + return 0; + } + + // -- Value Transfer -- + + /** + * @notice Releases tokens based on the configured schedule + * @dev All available releasable tokens are transferred to beneficiary + */ + function release() external override onlyBeneficiary { + uint256 amountToRelease = releasableAmount(); + require(amountToRelease > 0, "No available releasable amount"); + + releasedAmount = releasedAmount.add(amountToRelease); + + token.safeTransfer(beneficiary, amountToRelease); + + emit TokensReleased(beneficiary, amountToRelease); + } + + /** + * @notice Withdraws surplus, unmanaged tokens from the contract + * @dev Tokens in the contract over outstanding amount are considered as surplus + * @param _amount Amount of tokens to withdraw + */ + function withdrawSurplus(uint256 _amount) external override onlyBeneficiary { + require(_amount > 0, "Amount cannot be zero"); + require(surplusAmount() >= _amount, "Amount requested > surplus available"); + + token.safeTransfer(beneficiary, _amount); + + emit TokensWithdrawn(beneficiary, _amount); + } + + /** + * @notice Revokes a vesting schedule and return the unvested tokens to the owner + * @dev Vesting schedule is always calculated based on managed tokens + */ + function revoke() external override onlyOwner { + require(revocable == Revocability.Enabled, "Contract is non-revocable"); + require(isRevoked == false, "Already revoked"); + + uint256 unvestedAmount = managedAmount.sub(vestedAmount()); + require(unvestedAmount > 0, "No available unvested amount"); + + revokedAmount = unvestedAmount; + isRevoked = true; + + token.safeTransfer(owner(), unvestedAmount); + + emit TokensRevoked(beneficiary, unvestedAmount); + } +} diff --git a/packages/token-distribution/contracts/GraphTokenLockManager.sol b/packages/token-distribution/contracts/GraphTokenLockManager.sol new file mode 100644 index 000000000..2ec96887e --- /dev/null +++ b/packages/token-distribution/contracts/GraphTokenLockManager.sol @@ -0,0 +1,319 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.7.3; +pragma experimental ABIEncoderV2; + +import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; +import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; +import "@openzeppelin/contracts/utils/Address.sol"; +import "@openzeppelin/contracts/utils/EnumerableSet.sol"; +import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; + +import "./MinimalProxyFactory.sol"; +import "./IGraphTokenLockManager.sol"; +import { GraphTokenLockWallet } from "./GraphTokenLockWallet.sol"; + +/** + * @title GraphTokenLockManager + * @notice This contract manages a list of authorized function calls and targets that can be called + * by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts. + * + * This contract receives funds to make the process of creating TokenLockWallet contracts + * easier by distributing them the initial tokens to be managed. + * + * The owner can setup a list of token destinations that will be used by TokenLock contracts to + * approve the pulling of funds, this way in can be guaranteed that only protocol contracts + * will manipulate users funds. + */ +contract GraphTokenLockManager is Ownable, MinimalProxyFactory, IGraphTokenLockManager { + using SafeERC20 for IERC20; + using EnumerableSet for EnumerableSet.AddressSet; + + // -- State -- + + mapping(bytes4 => address) public authFnCalls; + EnumerableSet.AddressSet private _tokenDestinations; + + address public masterCopy; + IERC20 internal _token; + + // -- Events -- + + event MasterCopyUpdated(address indexed masterCopy); + event TokenLockCreated( + address indexed contractAddress, + bytes32 indexed initHash, + address indexed beneficiary, + address token, + uint256 managedAmount, + uint256 startTime, + uint256 endTime, + uint256 periods, + uint256 releaseStartTime, + uint256 vestingCliffTime, + IGraphTokenLock.Revocability revocable + ); + + event TokensDeposited(address indexed sender, uint256 amount); + event TokensWithdrawn(address indexed sender, uint256 amount); + + event FunctionCallAuth(address indexed caller, bytes4 indexed sigHash, address indexed target, string signature); + event TokenDestinationAllowed(address indexed dst, bool allowed); + + /** + * Constructor. + * @param _graphToken Token to use for deposits and withdrawals + * @param _masterCopy Address of the master copy to use to clone proxies + */ + constructor(IERC20 _graphToken, address _masterCopy) { + require(address(_graphToken) != address(0), "Token cannot be zero"); + _token = _graphToken; + setMasterCopy(_masterCopy); + } + + // -- Factory -- + + /** + * @notice Sets the masterCopy bytecode to use to create clones of TokenLock contracts + * @param _masterCopy Address of contract bytecode to factory clone + */ + function setMasterCopy(address _masterCopy) public override onlyOwner { + require(_masterCopy != address(0), "MasterCopy cannot be zero"); + masterCopy = _masterCopy; + emit MasterCopyUpdated(_masterCopy); + } + + /** + * @notice Creates and fund a new token lock wallet using a minimum proxy + * @param _owner Address of the contract owner + * @param _beneficiary Address of the beneficiary of locked tokens + * @param _managedAmount Amount of tokens to be managed by the lock contract + * @param _startTime Start time of the release schedule + * @param _endTime End time of the release schedule + * @param _periods Number of periods between start time and end time + * @param _releaseStartTime Override time for when the releases start + * @param _revocable Whether the contract is revocable + */ + function createTokenLockWallet( + address _owner, + address _beneficiary, + uint256 _managedAmount, + uint256 _startTime, + uint256 _endTime, + uint256 _periods, + uint256 _releaseStartTime, + uint256 _vestingCliffTime, + IGraphTokenLock.Revocability _revocable + ) external override onlyOwner { + require(_token.balanceOf(address(this)) >= _managedAmount, "Not enough tokens to create lock"); + + // Create contract using a minimal proxy and call initializer + bytes memory initializer = abi.encodeWithSelector( + GraphTokenLockWallet.initialize.selector, + address(this), + _owner, + _beneficiary, + address(_token), + _managedAmount, + _startTime, + _endTime, + _periods, + _releaseStartTime, + _vestingCliffTime, + _revocable + ); + address contractAddress = _deployProxy2(keccak256(initializer), masterCopy, initializer); + + // Send managed amount to the created contract + _token.safeTransfer(contractAddress, _managedAmount); + + emit TokenLockCreated( + contractAddress, + keccak256(initializer), + _beneficiary, + address(_token), + _managedAmount, + _startTime, + _endTime, + _periods, + _releaseStartTime, + _vestingCliffTime, + _revocable + ); + } + + // -- Funds Management -- + + /** + * @notice Gets the GRT token address + * @return Token used for transfers and approvals + */ + function token() external view override returns (IERC20) { + return _token; + } + + /** + * @notice Deposits tokens into the contract + * @dev Even if the ERC20 token can be transferred directly to the contract + * this function provide a safe interface to do the transfer and avoid mistakes + * @param _amount Amount to deposit + */ + function deposit(uint256 _amount) external override { + require(_amount > 0, "Amount cannot be zero"); + _token.safeTransferFrom(msg.sender, address(this), _amount); + emit TokensDeposited(msg.sender, _amount); + } + + /** + * @notice Withdraws tokens from the contract + * @dev Escape hatch in case of mistakes or to recover remaining funds + * @param _amount Amount of tokens to withdraw + */ + function withdraw(uint256 _amount) external override onlyOwner { + require(_amount > 0, "Amount cannot be zero"); + _token.safeTransfer(msg.sender, _amount); + emit TokensWithdrawn(msg.sender, _amount); + } + + // -- Token Destinations -- + + /** + * @notice Adds an address that can be allowed by a token lock to pull funds + * @param _dst Destination address + */ + function addTokenDestination(address _dst) external override onlyOwner { + require(_dst != address(0), "Destination cannot be zero"); + require(_tokenDestinations.add(_dst), "Destination already added"); + emit TokenDestinationAllowed(_dst, true); + } + + /** + * @notice Removes an address that can be allowed by a token lock to pull funds + * @param _dst Destination address + */ + function removeTokenDestination(address _dst) external override onlyOwner { + require(_tokenDestinations.remove(_dst), "Destination already removed"); + emit TokenDestinationAllowed(_dst, false); + } + + /** + * @notice Returns True if the address is authorized to be a destination of tokens + * @param _dst Destination address + * @return True if authorized + */ + function isTokenDestination(address _dst) external view override returns (bool) { + return _tokenDestinations.contains(_dst); + } + + /** + * @notice Returns an array of authorized destination addresses + * @return Array of addresses authorized to pull funds from a token lock + */ + function getTokenDestinations() external view override returns (address[] memory) { + address[] memory dstList = new address[](_tokenDestinations.length()); + for (uint256 i = 0; i < _tokenDestinations.length(); i++) { + dstList[i] = _tokenDestinations.at(i); + } + return dstList; + } + + // -- Function Call Authorization -- + + /** + * @notice Sets an authorized function call to target + * @dev Input expected is the function signature as 'transfer(address,uint256)' + * @param _signature Function signature + * @param _target Address of the destination contract to call + */ + function setAuthFunctionCall(string calldata _signature, address _target) external override onlyOwner { + _setAuthFunctionCall(_signature, _target); + } + + /** + * @notice Unsets an authorized function call to target + * @dev Input expected is the function signature as 'transfer(address,uint256)' + * @param _signature Function signature + */ + function unsetAuthFunctionCall(string calldata _signature) external override onlyOwner { + bytes4 sigHash = _toFunctionSigHash(_signature); + authFnCalls[sigHash] = address(0); + + emit FunctionCallAuth(msg.sender, sigHash, address(0), _signature); + } + + /** + * @notice Sets an authorized function call to target in bulk + * @dev Input expected is the function signature as 'transfer(address,uint256)' + * @param _signatures Function signatures + * @param _targets Address of the destination contract to call + */ + function setAuthFunctionCallMany( + string[] calldata _signatures, + address[] calldata _targets + ) external override onlyOwner { + require(_signatures.length == _targets.length, "Array length mismatch"); + + for (uint256 i = 0; i < _signatures.length; i++) { + _setAuthFunctionCall(_signatures[i], _targets[i]); + } + } + + /** + * @notice Sets an authorized function call to target + * @dev Input expected is the function signature as 'transfer(address,uint256)' + * @dev Function signatures of Graph Protocol contracts to be used are known ahead of time + * @param _signature Function signature + * @param _target Address of the destination contract to call + */ + function _setAuthFunctionCall(string calldata _signature, address _target) internal { + require(_target != address(this), "Target must be other contract"); + require(Address.isContract(_target), "Target must be a contract"); + + bytes4 sigHash = _toFunctionSigHash(_signature); + authFnCalls[sigHash] = _target; + + emit FunctionCallAuth(msg.sender, sigHash, _target, _signature); + } + + /** + * @notice Gets the target contract to call for a particular function signature + * @param _sigHash Function signature hash + * @return Address of the target contract where to send the call + */ + function getAuthFunctionCallTarget(bytes4 _sigHash) public view override returns (address) { + return authFnCalls[_sigHash]; + } + + /** + * @notice Returns true if the function call is authorized + * @param _sigHash Function signature hash + * @return True if authorized + */ + function isAuthFunctionCall(bytes4 _sigHash) external view override returns (bool) { + return getAuthFunctionCallTarget(_sigHash) != address(0); + } + + /** + * @dev Converts a function signature string to 4-bytes hash + * @param _signature Function signature string + * @return Function signature hash + */ + function _toFunctionSigHash(string calldata _signature) internal pure returns (bytes4) { + return _convertToBytes4(abi.encodeWithSignature(_signature)); + } + + /** + * @dev Converts function signature bytes to function signature hash (bytes4) + * @param _signature Function signature + * @return Function signature in bytes4 + */ + function _convertToBytes4(bytes memory _signature) internal pure returns (bytes4) { + require(_signature.length == 4, "Invalid method signature"); + bytes4 sigHash; + // solhint-disable-next-line no-inline-assembly + assembly { + sigHash := mload(add(_signature, 32)) + } + return sigHash; + } +} diff --git a/packages/token-distribution/contracts/GraphTokenLockSimple.sol b/packages/token-distribution/contracts/GraphTokenLockSimple.sol new file mode 100644 index 000000000..e5b00a3fa --- /dev/null +++ b/packages/token-distribution/contracts/GraphTokenLockSimple.sol @@ -0,0 +1,47 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.7.3; + +import "./GraphTokenLock.sol"; + +/** + * @title GraphTokenLockSimple + * @notice This contract is the concrete simple implementation built on top of the base + * GraphTokenLock functionality for use when we only need the token lock schedule + * features but no interaction with the network. + * + * This contract is designed to be deployed without the use of a TokenManager. + */ +contract GraphTokenLockSimple is GraphTokenLock { + // Constructor + constructor() { + OwnableInitializable._initialize(msg.sender); + } + + // Initializer + function initialize( + address _owner, + address _beneficiary, + address _token, + uint256 _managedAmount, + uint256 _startTime, + uint256 _endTime, + uint256 _periods, + uint256 _releaseStartTime, + uint256 _vestingCliffTime, + Revocability _revocable + ) external onlyOwner { + _initialize( + _owner, + _beneficiary, + _token, + _managedAmount, + _startTime, + _endTime, + _periods, + _releaseStartTime, + _vestingCliffTime, + _revocable + ); + } +} diff --git a/packages/token-distribution/contracts/GraphTokenLockWallet.sol b/packages/token-distribution/contracts/GraphTokenLockWallet.sol new file mode 100644 index 000000000..3ac24cb13 --- /dev/null +++ b/packages/token-distribution/contracts/GraphTokenLockWallet.sol @@ -0,0 +1,206 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.7.3; +pragma experimental ABIEncoderV2; + +import "@openzeppelin/contracts/utils/Address.sol"; +import "@openzeppelin/contracts/math/SafeMath.sol"; +import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; + +import "./GraphTokenLock.sol"; +import "./IGraphTokenLockManager.sol"; + +/** + * @title GraphTokenLockWallet + * @notice This contract is built on top of the base GraphTokenLock functionality. + * It allows wallet beneficiaries to use the deposited funds to perform specific function calls + * on specific contracts. + * + * The idea is that supporters with locked tokens can participate in the protocol + * but disallow any release before the vesting/lock schedule. + * The beneficiary can issue authorized function calls to this contract that will + * get forwarded to a target contract. A target contract is any of our protocol contracts. + * The function calls allowed are queried to the GraphTokenLockManager, this way + * the same configuration can be shared for all the created lock wallet contracts. + * + * NOTE: Contracts used as target must have its function signatures checked to avoid collisions + * with any of this contract functions. + * Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience + * the maximum amount of tokens is authorized. + * Function calls do not forward ETH value so DO NOT SEND ETH TO THIS CONTRACT. + */ +contract GraphTokenLockWallet is GraphTokenLock { + using SafeMath for uint256; + + // -- State -- + + IGraphTokenLockManager public manager; + uint256 public usedAmount; + + // -- Events -- + + event ManagerUpdated(address indexed _oldManager, address indexed _newManager); + event TokenDestinationsApproved(); + event TokenDestinationsRevoked(); + + // Initializer + function initialize( + address _manager, + address _owner, + address _beneficiary, + address _token, + uint256 _managedAmount, + uint256 _startTime, + uint256 _endTime, + uint256 _periods, + uint256 _releaseStartTime, + uint256 _vestingCliffTime, + Revocability _revocable + ) external { + _initialize( + _owner, + _beneficiary, + _token, + _managedAmount, + _startTime, + _endTime, + _periods, + _releaseStartTime, + _vestingCliffTime, + _revocable + ); + _setManager(_manager); + } + + // -- Admin -- + + /** + * @notice Sets a new manager for this contract + * @param _newManager Address of the new manager + */ + function setManager(address _newManager) external onlyOwner { + _setManager(_newManager); + } + + /** + * @dev Sets a new manager for this contract + * @param _newManager Address of the new manager + */ + function _setManager(address _newManager) internal { + require(_newManager != address(0), "Manager cannot be empty"); + require(Address.isContract(_newManager), "Manager must be a contract"); + + address oldManager = address(manager); + manager = IGraphTokenLockManager(_newManager); + + emit ManagerUpdated(oldManager, _newManager); + } + + // -- Beneficiary -- + + /** + * @notice Approves protocol access of the tokens managed by this contract + * @dev Approves all token destinations registered in the manager to pull tokens + */ + function approveProtocol() external onlyBeneficiary { + address[] memory dstList = manager.getTokenDestinations(); + for (uint256 i = 0; i < dstList.length; i++) { + // Note this is only safe because we are using the max uint256 value + token.approve(dstList[i], type(uint256).max); + } + emit TokenDestinationsApproved(); + } + + /** + * @notice Revokes protocol access of the tokens managed by this contract + * @dev Revokes approval to all token destinations in the manager to pull tokens + */ + function revokeProtocol() external onlyBeneficiary { + address[] memory dstList = manager.getTokenDestinations(); + for (uint256 i = 0; i < dstList.length; i++) { + // Note this is only safe cause we're using 0 as the amount + token.approve(dstList[i], 0); + } + emit TokenDestinationsRevoked(); + } + + /** + * @notice Gets tokens currently available for release + * @dev Considers the schedule, takes into account already released tokens and used amount + * @return Amount of tokens ready to be released + */ + function releasableAmount() public view override returns (uint256) { + if (revocable == Revocability.Disabled) { + return super.releasableAmount(); + } + + // -- Revocability enabled logic + // This needs to deal with additional considerations for when tokens are used in the protocol + + // If a release start time is set no tokens are available for release before this date + // If not set it follows the default schedule and tokens are available on + // the first period passed + if (releaseStartTime > 0 && currentTime() < releaseStartTime) { + return 0; + } + + // Vesting cliff is activated and it has not passed means nothing is vested yet + // so funds cannot be released + if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) { + return 0; + } + + // A beneficiary can never have more releasable tokens than the contract balance + // We consider the `usedAmount` in the protocol as part of the calculations + // the beneficiary should not release funds that are used. + uint256 releasable = availableAmount().sub(releasedAmount).sub(usedAmount); + return MathUtils.min(currentBalance(), releasable); + } + + /** + * @notice Forward authorized contract calls to protocol contracts + * @dev Fallback function can be called by the beneficiary only if function call is allowed + */ + // solhint-disable-next-line no-complex-fallback + fallback() external payable { + // Only beneficiary can forward calls + require(msg.sender == beneficiary, "Unauthorized caller"); + require(msg.value == 0, "ETH transfers not supported"); + + // Function call validation + address _target = manager.getAuthFunctionCallTarget(msg.sig); + require(_target != address(0), "Unauthorized function"); + + uint256 oldBalance = currentBalance(); + + // Call function with data + Address.functionCall(_target, msg.data); + + // Tracked used tokens in the protocol + // We do this check after balances were updated by the forwarded call + // Check is only enforced for revocable contracts to save some gas + if (revocable == Revocability.Enabled) { + // Track contract balance change + uint256 newBalance = currentBalance(); + if (newBalance < oldBalance) { + // Outflow + uint256 diff = oldBalance.sub(newBalance); + usedAmount = usedAmount.add(diff); + } else { + // Inflow: We can receive profits from the protocol, that could make usedAmount to + // underflow. We set it to zero in that case. + uint256 diff = newBalance.sub(oldBalance); + usedAmount = (diff >= usedAmount) ? 0 : usedAmount.sub(diff); + } + require(usedAmount <= vestedAmount(), "Cannot use more tokens than vested amount"); + } + } + + /** + * @notice Receive function that always reverts. + * @dev Only included to supress warnings, see https://github.com/ethereum/solidity/issues/10159 + */ + receive() external payable { + revert("Bad call"); + } +} diff --git a/packages/token-distribution/contracts/ICallhookReceiver.sol b/packages/token-distribution/contracts/ICallhookReceiver.sol new file mode 100644 index 000000000..f8f01d56f --- /dev/null +++ b/packages/token-distribution/contracts/ICallhookReceiver.sol @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +// Copied from graphprotocol/contracts, changed solidity version to 0.7.3 + +/** + * @title Interface for contracts that can receive callhooks through the Arbitrum GRT bridge + * @dev Any contract that can receive a callhook on L2, sent through the bridge from L1, must + * be allowlisted by the governor, but also implement this interface that contains + * the function that will actually be called by the L2GraphTokenGateway. + */ +pragma solidity ^0.7.3; + +interface ICallhookReceiver { + /** + * @notice Receive tokens with a callhook from the bridge + * @param _from Token sender in L1 + * @param _amount Amount of tokens that were transferred + * @param _data ABI-encoded callhook data + */ + function onTokenTransfer(address _from, uint256 _amount, bytes calldata _data) external; +} diff --git a/packages/token-distribution/contracts/IGraphTokenLock.sol b/packages/token-distribution/contracts/IGraphTokenLock.sol new file mode 100644 index 000000000..eac89f414 --- /dev/null +++ b/packages/token-distribution/contracts/IGraphTokenLock.sol @@ -0,0 +1,54 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.7.3; +pragma experimental ABIEncoderV2; + +import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; + +interface IGraphTokenLock { + enum Revocability { + NotSet, + Enabled, + Disabled + } + + // -- Balances -- + + function currentBalance() external view returns (uint256); + + // -- Time & Periods -- + + function currentTime() external view returns (uint256); + + function duration() external view returns (uint256); + + function sinceStartTime() external view returns (uint256); + + function amountPerPeriod() external view returns (uint256); + + function periodDuration() external view returns (uint256); + + function currentPeriod() external view returns (uint256); + + function passedPeriods() external view returns (uint256); + + // -- Locking & Release Schedule -- + + function availableAmount() external view returns (uint256); + + function vestedAmount() external view returns (uint256); + + function releasableAmount() external view returns (uint256); + + function totalOutstandingAmount() external view returns (uint256); + + function surplusAmount() external view returns (uint256); + + // -- Value Transfer -- + + function release() external; + + function withdrawSurplus(uint256 _amount) external; + + function revoke() external; +} diff --git a/packages/token-distribution/contracts/IGraphTokenLockManager.sol b/packages/token-distribution/contracts/IGraphTokenLockManager.sol new file mode 100644 index 000000000..c646e5e16 --- /dev/null +++ b/packages/token-distribution/contracts/IGraphTokenLockManager.sol @@ -0,0 +1,56 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.7.3; +pragma experimental ABIEncoderV2; + +import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; + +import "./IGraphTokenLock.sol"; + +interface IGraphTokenLockManager { + // -- Factory -- + + function setMasterCopy(address _masterCopy) external; + + function createTokenLockWallet( + address _owner, + address _beneficiary, + uint256 _managedAmount, + uint256 _startTime, + uint256 _endTime, + uint256 _periods, + uint256 _releaseStartTime, + uint256 _vestingCliffTime, + IGraphTokenLock.Revocability _revocable + ) external; + + // -- Funds Management -- + + function token() external returns (IERC20); + + function deposit(uint256 _amount) external; + + function withdraw(uint256 _amount) external; + + // -- Allowed Funds Destinations -- + + function addTokenDestination(address _dst) external; + + function removeTokenDestination(address _dst) external; + + function isTokenDestination(address _dst) external view returns (bool); + + function getTokenDestinations() external view returns (address[] memory); + + // -- Function Call Authorization -- + + function setAuthFunctionCall(string calldata _signature, address _target) external; + + function unsetAuthFunctionCall(string calldata _signature) external; + + function setAuthFunctionCallMany(string[] calldata _signatures, address[] calldata _targets) external; + + function getAuthFunctionCallTarget(bytes4 _sigHash) external view returns (address); + + function isAuthFunctionCall(bytes4 _sigHash) external view returns (bool); +} diff --git a/packages/token-distribution/contracts/L1GraphTokenLockTransferTool.sol b/packages/token-distribution/contracts/L1GraphTokenLockTransferTool.sol new file mode 100644 index 000000000..962cf54ee --- /dev/null +++ b/packages/token-distribution/contracts/L1GraphTokenLockTransferTool.sol @@ -0,0 +1,319 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.7.3; +pragma experimental ABIEncoderV2; + +import { AddressUpgradeable } from "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol"; +import { ITokenGateway } from "./arbitrum/ITokenGateway.sol"; +import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; +import { L2GraphTokenLockManager } from "./L2GraphTokenLockManager.sol"; +import { GraphTokenLockWallet } from "./GraphTokenLockWallet.sol"; +import { MinimalProxyFactory } from "./MinimalProxyFactory.sol"; +import { IGraphTokenLock } from "./IGraphTokenLock.sol"; +import { Ownable as OwnableInitializable } from "./Ownable.sol"; +import { SafeMathUpgradeable } from "@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol"; +import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol"; + +/** + * @title L1GraphTokenLockTransferTool contract + * @notice This contract is used to transfer GRT from GraphTokenLockWallets + * to a counterpart on L2. It is deployed on L1 and will send the GRT through + * the L1GraphTokenGateway with a callhook to the L2GraphTokenLockManager, including + * data to create a L2GraphTokenLockWallet on L2. + * + * Note that the L2GraphTokenLockWallet will not allow releasing any GRT until the end of + * the vesting timeline, but will allow sending the GRT back to the L1 wallet. + * + * Beneficiaries for a GraphTokenLockWallet can perform the depositToL2Locked call + * as many times as they want, and the GRT will be sent to the same L2GraphTokenLockWallet. + * + * Since all retryable tickets to send transactions to L2 require ETH for gas, this + * contract also allows users to deposit ETH to be used for gas on L2, both for + * the depositToL2Locked calls and for the transfer tools in the Staking contract for + * The Graph. + * + * See GIP-0046 for more details: https://forum.thegraph.com/t/4023 + */ +contract L1GraphTokenLockTransferTool is OwnableInitializable, Initializable, MinimalProxyFactory { + using SafeMathUpgradeable for uint256; + + /// Address of the L1 GRT token contract + IERC20 public immutable graphToken; + /// Address of the L2GraphTokenLockWallet implementation in L2, used to compute L2 wallet addresses + address public immutable l2Implementation; + /// Address of the L1GraphTokenGateway contract + ITokenGateway public immutable l1Gateway; + /// Address of the Staking contract, used to pull ETH for L2 ticket gas + address payable public immutable staking; + /// L2 lock manager for each L1 lock manager. + /// L1 GraphTokenLockManager => L2GraphTokenLockManager + mapping(address => address) public l2LockManager; + /// L2 wallet owner for each L1 wallet owner. + /// L1 wallet owner => L2 wallet owner + mapping(address => address) public l2WalletOwner; + /// L2 wallet address for each L1 wallet address. + /// L1 wallet => L2 wallet + mapping(address => address) public l2WalletAddress; + /// ETH balance from each token lock, used to pay for L2 gas: + /// L1 wallet address => ETH balance + mapping(address => uint256) public tokenLockETHBalances; + /// L2 beneficiary corresponding to each L1 wallet address. + /// L1 wallet => L2 beneficiary + mapping(address => address) public l2Beneficiary; + /// Indicates whether an L2 wallet address for a wallet + /// has been set manually, in which case it can't call depositToL2Locked. + /// L1 wallet => bool + mapping(address => bool) public l2WalletAddressSetManually; + + /// @dev Emitted when the L2 lock manager for an L1 lock manager is set + event L2LockManagerSet(address indexed l1LockManager, address indexed l2LockManager); + /// @dev Emitted when the L2 wallet owner for an L1 wallet owner is set + event L2WalletOwnerSet(address indexed l1WalletOwner, address indexed l2WalletOwner); + /// @dev Emitted when GRT is sent to L2 from a token lock + event LockedFundsSentToL2( + address indexed l1Wallet, + address indexed l2Wallet, + address indexed l1LockManager, + address l2LockManager, + uint256 amount + ); + /// @dev Emitted when an L2 wallet address is set for an L1 wallet + event L2WalletAddressSet(address indexed l1Wallet, address indexed l2Wallet); + /// @dev Emitted when ETH is deposited to a token lock's account + event ETHDeposited(address indexed tokenLock, uint256 amount); + /// @dev Emitted when ETH is withdrawn from a token lock's account + event ETHWithdrawn(address indexed tokenLock, address indexed destination, uint256 amount); + /// @dev Emitted when ETH is pulled from a token lock's account by Staking or this tool to pay for an L2 ticket + event ETHPulled(address indexed tokenLock, uint256 amount); + /// @dev Emitted when the L2 beneficiary for a partially vested L1 lock is set + event L2BeneficiarySet(address indexed l1Wallet, address indexed l2Beneficiary); + + /** + * @notice Construct a new L1GraphTokenLockTransferTool contract + * @dev The deployer of the contract will become its owner. + * Note this contract is meant to be deployed behind a transparent proxy, + * so this will run at the implementation's storage context; it will set + * immutable variables and make the implementation be owned by the deployer. + * @param _graphToken Address of the L1 GRT token contract + * @param _l2Implementation Address of the L2GraphTokenLockWallet implementation in L2 + * @param _l1Gateway Address of the L1GraphTokenGateway contract + * @param _staking Address of the Staking contract + */ + constructor( + IERC20 _graphToken, + address _l2Implementation, + ITokenGateway _l1Gateway, + address payable _staking + ) initializer { + OwnableInitializable._initialize(msg.sender); + graphToken = _graphToken; + l2Implementation = _l2Implementation; + l1Gateway = _l1Gateway; + staking = _staking; + } + + /** + * @notice Initialize the L1GraphTokenLockTransferTool contract + * @dev This function will run in the proxy's storage context, so it will + * set the owner of the proxy contract which can be different from the implementation owner. + * @param _owner Address of the owner of the L1GraphTokenLockTransferTool contract + */ + function initialize(address _owner) external initializer { + OwnableInitializable._initialize(_owner); + } + + /** + * @notice Set the L2 lock manager that corresponds to an L1 lock manager + * @param _l1LockManager Address of the L1 lock manager + * @param _l2LockManager Address of the L2 lock manager (in L2) + */ + function setL2LockManager(address _l1LockManager, address _l2LockManager) external onlyOwner { + l2LockManager[_l1LockManager] = _l2LockManager; + emit L2LockManagerSet(_l1LockManager, _l2LockManager); + } + + /** + * @notice Set the L2 wallet owner that corresponds to an L1 wallet owner + * @param _l1WalletOwner Address of the L1 wallet owner + * @param _l2WalletOwner Address of the L2 wallet owner (in L2) + */ + function setL2WalletOwner(address _l1WalletOwner, address _l2WalletOwner) external onlyOwner { + l2WalletOwner[_l1WalletOwner] = _l2WalletOwner; + emit L2WalletOwnerSet(_l1WalletOwner, _l2WalletOwner); + } + + /** + * @notice Deposit ETH on a token lock's account, to be used for L2 retryable ticket gas. + * This function can be called by anyone, but the ETH will be credited to the token lock. + * DO NOT try to call this through the token lock, as locks do not forward ETH value (and the + * function call should not be allowlisted). + * @param _tokenLock Address of the L1 GraphTokenLockWallet that will own the ETH + */ + function depositETH(address _tokenLock) external payable { + tokenLockETHBalances[_tokenLock] = tokenLockETHBalances[_tokenLock].add(msg.value); + emit ETHDeposited(_tokenLock, msg.value); + } + + /** + * @notice Withdraw ETH from a token lock's account. + * This function must be called from the token lock contract, but the destination + * _must_ be a different address, as any ETH sent to the token lock would otherwise be + * lost. + * @param _destination Address to send the ETH + * @param _amount Amount of ETH to send + */ + function withdrawETH(address _destination, uint256 _amount) external { + require(_amount > 0, "INVALID_AMOUNT"); + // We can't send eth to a token lock or it will be stuck + require(msg.sender != _destination, "INVALID_DESTINATION"); + require(tokenLockETHBalances[msg.sender] >= _amount, "INSUFFICIENT_BALANCE"); + tokenLockETHBalances[msg.sender] -= _amount; + // solhint-disable-next-line avoid-low-level-calls + (bool success, ) = payable(_destination).call{ value: _amount }(""); + require(success, "TRANSFER_FAILED"); + emit ETHWithdrawn(msg.sender, _destination, _amount); + } + + /** + * @notice Pull ETH from a token lock's account, to be used for L2 retryable ticket gas. + * This can only be called by the Staking contract. + * @param _tokenLock GraphTokenLockWallet that owns the ETH that will be debited + * @param _amount Amount of ETH to pull + */ + function pullETH(address _tokenLock, uint256 _amount) external { + require(msg.sender == staking, "ONLY_STAKING"); + require(tokenLockETHBalances[_tokenLock] >= _amount, "INSUFFICIENT_BALANCE"); + tokenLockETHBalances[_tokenLock] -= _amount; + // solhint-disable-next-line avoid-low-level-calls + (bool success, ) = staking.call{ value: _amount }(""); + require(success, "TRANSFER_FAILED"); + emit ETHPulled(_tokenLock, _amount); + } + + /** + * @notice Deposit GRT to L2, from a token lock in L1 to a token lock in L2. + * If the token lock in L2 does not exist, it will be created when the message is received + * by the L2GraphTokenLockManager. + * Before calling this (which must be done through the token lock wallet), make sure + * there is enough ETH in the token lock's account to cover the L2 retryable ticket gas. + * Note that L2 submission fee and gas refunds will be lost. + * You can add ETH to the token lock's account by calling depositETH(). + * Note that after calling this, you will NOT be able to use setL2WalletAddressManually() to + * set an L2 wallet address, as the L2 wallet address will be set automatically when the + * message is received by the L2GraphTokenLockManager. + * @dev The gas parameters for L2 can be estimated using the Arbitrum SDK. + * @param _amount Amount of GRT to deposit + * @param _l2Beneficiary Address of the beneficiary for the token lock in L2. Must be the same for subsequent calls of this function, and not an L1 contract. + * @param _maxGas Maximum gas to use for the L2 retryable ticket + * @param _gasPriceBid Gas price to use for the L2 retryable ticket + * @param _maxSubmissionCost Max submission cost for the L2 retryable ticket + */ + function depositToL2Locked( + uint256 _amount, + address _l2Beneficiary, + uint256 _maxGas, + uint256 _gasPriceBid, + uint256 _maxSubmissionCost + ) external { + // Check that msg.sender is a GraphTokenLockWallet + // That uses GRT and has a corresponding manager set in L2. + GraphTokenLockWallet wallet = GraphTokenLockWallet(msg.sender); + require(wallet.token() == graphToken, "INVALID_TOKEN"); + address l1Manager = address(wallet.manager()); + address l2Manager = l2LockManager[l1Manager]; + require(l2Manager != address(0), "INVALID_MANAGER"); + require(wallet.isInitialized(), "!INITIALIZED"); + require(wallet.revocable() != IGraphTokenLock.Revocability.Enabled, "REVOCABLE"); + require(_amount <= graphToken.balanceOf(msg.sender), "INSUFFICIENT_BALANCE"); + require(_amount != 0, "ZERO_AMOUNT"); + + if (l2Beneficiary[msg.sender] == address(0)) { + require(_l2Beneficiary != address(0), "INVALID_BENEFICIARY_ZERO"); + require(!AddressUpgradeable.isContract(_l2Beneficiary), "INVALID_BENEFICIARY_CONTRACT"); + l2Beneficiary[msg.sender] = _l2Beneficiary; + emit L2BeneficiarySet(msg.sender, _l2Beneficiary); + } else { + require(l2Beneficiary[msg.sender] == _l2Beneficiary, "INVALID_BENEFICIARY"); + } + + uint256 expectedEth = _maxSubmissionCost.add(_maxGas.mul(_gasPriceBid)); + require(tokenLockETHBalances[msg.sender] >= expectedEth, "INSUFFICIENT_ETH_BALANCE"); + tokenLockETHBalances[msg.sender] -= expectedEth; + + bytes memory encodedData; + { + address l2Owner = l2WalletOwner[wallet.owner()]; + require(l2Owner != address(0), "L2_OWNER_NOT_SET"); + // Extract all the storage variables from the GraphTokenLockWallet + L2GraphTokenLockManager.TransferredWalletData memory data = L2GraphTokenLockManager.TransferredWalletData({ + l1Address: msg.sender, + owner: l2Owner, + beneficiary: l2Beneficiary[msg.sender], + managedAmount: wallet.managedAmount(), + startTime: wallet.startTime(), + endTime: wallet.endTime() + }); + encodedData = abi.encode(data); + } + + if (l2WalletAddress[msg.sender] == address(0)) { + require(wallet.endTime() >= block.timestamp, "FULLY_VESTED_USE_MANUAL_ADDRESS"); + address newAddress = getDeploymentAddress(keccak256(encodedData), l2Implementation, l2Manager); + l2WalletAddress[msg.sender] = newAddress; + emit L2WalletAddressSet(msg.sender, newAddress); + } else { + require(!l2WalletAddressSetManually[msg.sender], "CANT_DEPOSIT_TO_MANUAL_ADDRESS"); + } + + graphToken.transferFrom(msg.sender, address(this), _amount); + + // Send the tokens with a message through the L1GraphTokenGateway to the L2GraphTokenLockManager + graphToken.approve(address(l1Gateway), _amount); + { + bytes memory transferData = abi.encode(_maxSubmissionCost, encodedData); + l1Gateway.outboundTransfer{ value: expectedEth }( + address(graphToken), + l2Manager, + _amount, + _maxGas, + _gasPriceBid, + transferData + ); + } + emit ETHPulled(msg.sender, expectedEth); + emit LockedFundsSentToL2(msg.sender, l2WalletAddress[msg.sender], l1Manager, l2Manager, _amount); + } + + /** + * @notice Manually set the L2 wallet address for a token lock in L1. + * This will only work for token locks that have not been initialized in L2 yet, and + * that are fully vested (endTime < current timestamp). + * This address can then be used to send stake or delegation to L2 on the Staking contract. + * After calling this, the vesting lock will NOT be allowed to use depositToL2Locked + * to send GRT to L2, the beneficiary must withdraw the tokens and bridge them manually. + * @param _l2Wallet Address of the L2 wallet + */ + function setL2WalletAddressManually(address _l2Wallet) external { + // Check that msg.sender is a GraphTokenLockWallet + // That uses GRT and has a corresponding manager set in L2. + GraphTokenLockWallet wallet = GraphTokenLockWallet(msg.sender); + require(wallet.token() == graphToken, "INVALID_TOKEN"); + address l1Manager = address(wallet.manager()); + address l2Manager = l2LockManager[l1Manager]; + require(l2Manager != address(0), "INVALID_MANAGER"); + require(wallet.isInitialized(), "!INITIALIZED"); + + // Check that the wallet is fully vested + require(wallet.endTime() < block.timestamp, "NOT_FULLY_VESTED"); + + // Check that the wallet has not set an L2 wallet yet + require(l2WalletAddress[msg.sender] == address(0), "L2_WALLET_ALREADY_SET"); + + // Check that the L2 address is not zero + require(_l2Wallet != address(0), "ZERO_ADDRESS"); + // Set the L2 wallet address + l2WalletAddress[msg.sender] = _l2Wallet; + l2WalletAddressSetManually[msg.sender] = true; + emit L2WalletAddressSet(msg.sender, _l2Wallet); + } +} diff --git a/packages/token-distribution/contracts/L2GraphTokenLockManager.sol b/packages/token-distribution/contracts/L2GraphTokenLockManager.sol new file mode 100644 index 000000000..ee1c30a59 --- /dev/null +++ b/packages/token-distribution/contracts/L2GraphTokenLockManager.sol @@ -0,0 +1,162 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.7.3; +pragma experimental ABIEncoderV2; + +import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; +import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; + +import { ICallhookReceiver } from "./ICallhookReceiver.sol"; +import { GraphTokenLockManager } from "./GraphTokenLockManager.sol"; +import { L2GraphTokenLockWallet } from "./L2GraphTokenLockWallet.sol"; + +/** + * @title L2GraphTokenLockManager + * @notice This contract manages a list of authorized function calls and targets that can be called + * by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts. + * + * This contract receives funds to make the process of creating TokenLockWallet contracts + * easier by distributing them the initial tokens to be managed. + * + * In particular, this L2 variant is designed to receive token lock wallets from L1, + * through the GRT bridge. These transferred wallets will not allow releasing funds in L2 until + * the end of the vesting timeline, but they can allow withdrawing funds back to L1 using + * the L2GraphTokenLockTransferTool contract. + * + * The owner can setup a list of token destinations that will be used by TokenLock contracts to + * approve the pulling of funds, this way in can be guaranteed that only protocol contracts + * will manipulate users funds. + */ +contract L2GraphTokenLockManager is GraphTokenLockManager, ICallhookReceiver { + using SafeERC20 for IERC20; + + /// @dev Struct to hold the data of a transferred wallet; this is + /// the data that must be encoded in L1 to send a wallet to L2. + struct TransferredWalletData { + address l1Address; + address owner; + address beneficiary; + uint256 managedAmount; + uint256 startTime; + uint256 endTime; + } + + /// Address of the L2GraphTokenGateway + address public immutable l2Gateway; + /// Address of the L1 transfer tool contract (in L1, no aliasing) + address public immutable l1TransferTool; + /// Mapping of each L1 wallet to its L2 wallet counterpart (populated when each wallet is received) + /// L1 address => L2 address + mapping(address => address) public l1WalletToL2Wallet; + /// Mapping of each L2 wallet to its L1 wallet counterpart (populated when each wallet is received) + /// L2 address => L1 address + mapping(address => address) public l2WalletToL1Wallet; + + /// @dev Event emitted when a wallet is received and created from L1 + event TokenLockCreatedFromL1( + address indexed contractAddress, + bytes32 initHash, + address indexed beneficiary, + uint256 managedAmount, + uint256 startTime, + uint256 endTime, + address indexed l1Address + ); + + /// @dev Emitted when locked tokens are received from L1 (whether the wallet + /// had already been received or not) + event LockedTokensReceivedFromL1(address indexed l1Address, address indexed l2Address, uint256 amount); + + /** + * @dev Checks that the sender is the L2GraphTokenGateway. + */ + modifier onlyL2Gateway() { + require(msg.sender == l2Gateway, "ONLY_GATEWAY"); + _; + } + + /** + * @notice Constructor for the L2GraphTokenLockManager contract. + * @param _graphToken Address of the L2 GRT token contract + * @param _masterCopy Address of the master copy of the L2GraphTokenLockWallet implementation + * @param _l2Gateway Address of the L2GraphTokenGateway contract + * @param _l1TransferTool Address of the L1 transfer tool contract (in L1, without aliasing) + */ + constructor( + IERC20 _graphToken, + address _masterCopy, + address _l2Gateway, + address _l1TransferTool + ) GraphTokenLockManager(_graphToken, _masterCopy) { + l2Gateway = _l2Gateway; + l1TransferTool = _l1TransferTool; + } + + /** + * @notice This function is called by the L2GraphTokenGateway when tokens are sent from L1. + * @dev This function will create a new wallet if it doesn't exist yet, or send the tokens to + * the existing wallet if it does. + * @param _from Address of the sender in L1, which must be the L1GraphTokenLockTransferTool + * @param _amount Amount of tokens received + * @param _data Encoded data of the transferred wallet, which must be an ABI-encoded TransferredWalletData struct + */ + function onTokenTransfer(address _from, uint256 _amount, bytes calldata _data) external override onlyL2Gateway { + require(_from == l1TransferTool, "ONLY_TRANSFER_TOOL"); + TransferredWalletData memory walletData = abi.decode(_data, (TransferredWalletData)); + + if (l1WalletToL2Wallet[walletData.l1Address] != address(0)) { + // If the wallet was already received, just send the tokens to the L2 address + _token.safeTransfer(l1WalletToL2Wallet[walletData.l1Address], _amount); + } else { + // Create contract using a minimal proxy and call initializer + (bytes32 initHash, address contractAddress) = _deployFromL1(keccak256(_data), walletData); + l1WalletToL2Wallet[walletData.l1Address] = contractAddress; + l2WalletToL1Wallet[contractAddress] = walletData.l1Address; + + // Send managed amount to the created contract + _token.safeTransfer(contractAddress, _amount); + + emit TokenLockCreatedFromL1( + contractAddress, + initHash, + walletData.beneficiary, + walletData.managedAmount, + walletData.startTime, + walletData.endTime, + walletData.l1Address + ); + } + emit LockedTokensReceivedFromL1(walletData.l1Address, l1WalletToL2Wallet[walletData.l1Address], _amount); + } + + /** + * @dev Deploy a token lock wallet with data received from L1 + * @param _salt Salt for the CREATE2 call, which must be the hash of the wallet data + * @param _walletData Data of the wallet to be created + * @return Hash of the initialization calldata + * @return Address of the created contract + */ + function _deployFromL1( + bytes32 _salt, + TransferredWalletData memory _walletData + ) internal returns (bytes32, address) { + bytes memory initializer = _encodeInitializer(_walletData); + address contractAddress = _deployProxy2(_salt, masterCopy, initializer); + return (keccak256(initializer), contractAddress); + } + + /** + * @dev Encode the initializer for the token lock wallet received from L1 + * @param _walletData Data of the wallet to be created + * @return Encoded initializer calldata, including the function signature + */ + function _encodeInitializer(TransferredWalletData memory _walletData) internal view returns (bytes memory) { + return + abi.encodeWithSelector( + L2GraphTokenLockWallet.initializeFromL1.selector, + address(this), + address(_token), + _walletData + ); + } +} diff --git a/packages/token-distribution/contracts/L2GraphTokenLockTransferTool.sol b/packages/token-distribution/contracts/L2GraphTokenLockTransferTool.sol new file mode 100644 index 000000000..01010a3a0 --- /dev/null +++ b/packages/token-distribution/contracts/L2GraphTokenLockTransferTool.sol @@ -0,0 +1,71 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.7.3; +pragma experimental ABIEncoderV2; + +import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; + +import { L2GraphTokenLockManager } from "./L2GraphTokenLockManager.sol"; +import { L2GraphTokenLockWallet } from "./L2GraphTokenLockWallet.sol"; +import { ITokenGateway } from "./arbitrum/ITokenGateway.sol"; + +/** + * @title L2GraphTokenLockTransferTool contract + * @notice This contract is used to transfer GRT from L2 token lock wallets + * back to their L1 counterparts. + */ +contract L2GraphTokenLockTransferTool { + /// Address of the L2 GRT token + IERC20 public immutable graphToken; + /// Address of the L2GraphTokenGateway + ITokenGateway public immutable l2Gateway; + /// Address of the L1 GRT token (in L1, no aliasing) + address public immutable l1GraphToken; + + /// @dev Emitted when GRT is sent to L1 from a token lock + event LockedFundsSentToL1( + address indexed l1Wallet, + address indexed l2Wallet, + address indexed l2LockManager, + uint256 amount + ); + + /** + * @notice Constructor for the L2GraphTokenLockTransferTool contract + * @dev Note the L2GraphTokenLockTransferTool can be deployed behind a proxy, + * and the constructor for the implementation will only set some immutable + * variables. + * @param _graphToken Address of the L2 GRT token + * @param _l2Gateway Address of the L2GraphTokenGateway + * @param _l1GraphToken Address of the L1 GRT token (in L1, no aliasing) + */ + constructor(IERC20 _graphToken, ITokenGateway _l2Gateway, address _l1GraphToken) { + graphToken = _graphToken; + l2Gateway = _l2Gateway; + l1GraphToken = _l1GraphToken; + } + + /** + * @notice Withdraw GRT from an L2 token lock wallet to its L1 counterpart. + * This function must be called from an L2GraphTokenLockWallet contract. + * The GRT will be sent to L1 and must be claimed using the Arbitrum Outbox on L1 + * after the standard Arbitrum withdrawal period (7 days). + * @param _amount Amount of GRT to withdraw + */ + function withdrawToL1Locked(uint256 _amount) external { + L2GraphTokenLockWallet wallet = L2GraphTokenLockWallet(msg.sender); + L2GraphTokenLockManager manager = L2GraphTokenLockManager(address(wallet.manager())); + require(address(manager) != address(0), "INVALID_SENDER"); + address l1Wallet = manager.l2WalletToL1Wallet(msg.sender); + require(l1Wallet != address(0), "NOT_L1_WALLET"); + require(_amount <= graphToken.balanceOf(msg.sender), "INSUFFICIENT_BALANCE"); + require(_amount != 0, "ZERO_AMOUNT"); + + graphToken.transferFrom(msg.sender, address(this), _amount); + graphToken.approve(address(l2Gateway), _amount); + + // Send the tokens through the L2GraphTokenGateway to the L1 wallet counterpart + l2Gateway.outboundTransfer(l1GraphToken, l1Wallet, _amount, 0, 0, ""); + emit LockedFundsSentToL1(l1Wallet, msg.sender, address(manager), _amount); + } +} diff --git a/packages/token-distribution/contracts/L2GraphTokenLockWallet.sol b/packages/token-distribution/contracts/L2GraphTokenLockWallet.sol new file mode 100644 index 000000000..905bee460 --- /dev/null +++ b/packages/token-distribution/contracts/L2GraphTokenLockWallet.sol @@ -0,0 +1,66 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.7.3; +pragma experimental ABIEncoderV2; + +import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; + +import { GraphTokenLockWallet } from "./GraphTokenLockWallet.sol"; +import { Ownable as OwnableInitializable } from "./Ownable.sol"; +import { L2GraphTokenLockManager } from "./L2GraphTokenLockManager.sol"; + +/** + * @title L2GraphTokenLockWallet + * @notice This contract is built on top of the base GraphTokenLock functionality. + * It allows wallet beneficiaries to use the deposited funds to perform specific function calls + * on specific contracts. + * + * The idea is that supporters with locked tokens can participate in the protocol + * but disallow any release before the vesting/lock schedule. + * The beneficiary can issue authorized function calls to this contract that will + * get forwarded to a target contract. A target contract is any of our protocol contracts. + * The function calls allowed are queried to the GraphTokenLockManager, this way + * the same configuration can be shared for all the created lock wallet contracts. + * + * This L2 variant includes a special initializer so that it can be created from + * a wallet's data received from L1. These transferred wallets will not allow releasing + * funds in L2 until the end of the vesting timeline, but they can allow withdrawing + * funds back to L1 using the L2GraphTokenLockTransferTool contract. + * + * Note that surplusAmount and releasedAmount in L2 will be skewed for wallets received from L1, + * so releasing surplus tokens might also only be possible by bridging tokens back to L1. + * + * NOTE: Contracts used as target must have its function signatures checked to avoid collisions + * with any of this contract functions. + * Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience + * the maximum amount of tokens is authorized. + * Function calls do not forward ETH value so DO NOT SEND ETH TO THIS CONTRACT. + */ +contract L2GraphTokenLockWallet is GraphTokenLockWallet { + // Initializer when created from a message from L1 + function initializeFromL1( + address _manager, + address _token, + L2GraphTokenLockManager.TransferredWalletData calldata _walletData + ) external { + require(!isInitialized, "Already initialized"); + isInitialized = true; + + OwnableInitializable._initialize(_walletData.owner); + beneficiary = _walletData.beneficiary; + token = IERC20(_token); + + managedAmount = _walletData.managedAmount; + + startTime = _walletData.startTime; + endTime = _walletData.endTime; + periods = 1; + isAccepted = true; + + // Optionals + releaseStartTime = _walletData.endTime; + revocable = Revocability.Disabled; + + _setManager(_manager); + } +} diff --git a/packages/token-distribution/contracts/MathUtils.sol b/packages/token-distribution/contracts/MathUtils.sol new file mode 100644 index 000000000..742c52c37 --- /dev/null +++ b/packages/token-distribution/contracts/MathUtils.sol @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.7.3; + +library MathUtils { + function min(uint256 a, uint256 b) internal pure returns (uint256) { + return a < b ? a : b; + } +} diff --git a/packages/token-distribution/contracts/MinimalProxyFactory.sol b/packages/token-distribution/contracts/MinimalProxyFactory.sol new file mode 100644 index 000000000..ca1f03ee1 --- /dev/null +++ b/packages/token-distribution/contracts/MinimalProxyFactory.sol @@ -0,0 +1,75 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.7.3; + +import { Address } from "@openzeppelin/contracts/utils/Address.sol"; +import { Create2 } from "@openzeppelin/contracts/utils/Create2.sol"; + +/** + * @title MinimalProxyFactory: a factory contract for creating minimal proxies + * @notice Adapted from https://github.com/OpenZeppelin/openzeppelin-sdk/blob/v2.5.0/packages/lib/contracts/upgradeability/ProxyFactory.sol + * Based on https://eips.ethereum.org/EIPS/eip-1167 + */ +contract MinimalProxyFactory { + /// @dev Emitted when a new proxy is created + event ProxyCreated(address indexed proxy); + + /** + * @notice Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation + * @dev Uses address(this) as deployer to compute the address. Only for backwards compatibility. + * @param _salt Bytes32 salt to use for CREATE2 + * @param _implementation Address of the proxy target implementation + * @return Address of the counterfactual MinimalProxy + */ + function getDeploymentAddress(bytes32 _salt, address _implementation) public view returns (address) { + return getDeploymentAddress(_salt, _implementation, address(this)); + } + + /** + * @notice Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation + * @param _salt Bytes32 salt to use for CREATE2 + * @param _implementation Address of the proxy target implementation + * @param _deployer Address of the deployer that creates the contract + * @return Address of the counterfactual MinimalProxy + */ + function getDeploymentAddress( + bytes32 _salt, + address _implementation, + address _deployer + ) public pure returns (address) { + return Create2.computeAddress(_salt, keccak256(_getContractCreationCode(_implementation)), _deployer); + } + + /** + * @dev Deploys a MinimalProxy with CREATE2 + * @param _salt Bytes32 salt to use for CREATE2 + * @param _implementation Address of the proxy target implementation + * @param _data Bytes with the initializer call + * @return Address of the deployed MinimalProxy + */ + function _deployProxy2(bytes32 _salt, address _implementation, bytes memory _data) internal returns (address) { + address proxyAddress = Create2.deploy(0, _salt, _getContractCreationCode(_implementation)); + + emit ProxyCreated(proxyAddress); + + // Call function with data + if (_data.length > 0) { + Address.functionCall(proxyAddress, _data); + } + + return proxyAddress; + } + + /** + * @dev Gets the MinimalProxy bytecode + * @param _implementation Address of the proxy target implementation + * @return MinimalProxy bytecode + */ + function _getContractCreationCode(address _implementation) internal pure returns (bytes memory) { + bytes10 creation = 0x3d602d80600a3d3981f3; + bytes10 prefix = 0x363d3d373d3d3d363d73; + bytes20 targetBytes = bytes20(_implementation); + bytes15 suffix = 0x5af43d82803e903d91602b57fd5bf3; + return abi.encodePacked(creation, prefix, targetBytes, suffix); + } +} diff --git a/packages/token-distribution/contracts/Ownable.sol b/packages/token-distribution/contracts/Ownable.sol new file mode 100644 index 000000000..73ec22821 --- /dev/null +++ b/packages/token-distribution/contracts/Ownable.sol @@ -0,0 +1,71 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.7.3; + +/** + * @dev Contract module which provides a basic access control mechanism, where + * there is an account (an owner) that can be granted exclusive access to + * specific functions. + * + * The owner account will be passed on initialization of the contract. This + * can later be changed with {transferOwnership}. + * + * This module is used through inheritance. It will make available the modifier + * `onlyOwner`, which can be applied to your functions to restrict their use to + * the owner. + */ +contract Ownable { + /// @dev Owner of the contract, can be retrieved with the public owner() function + address private _owner; + /// @dev Since upgradeable contracts might inherit this, we add a storage gap + /// to allow adding variables here without breaking the proxy storage layout + uint256[50] private __gap; + + /// @dev Emitted when ownership of the contract is transferred + event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); + + /** + * @dev Initializes the contract setting the deployer as the initial owner. + */ + function _initialize(address owner) internal { + _owner = owner; + emit OwnershipTransferred(address(0), owner); + } + + /** + * @dev Returns the address of the current owner. + */ + function owner() public view returns (address) { + return _owner; + } + + /** + * @dev Throws if called by any account other than the owner. + */ + modifier onlyOwner() { + require(_owner == msg.sender, "Ownable: caller is not the owner"); + _; + } + + /** + * @dev Leaves the contract without owner. It will not be possible to call + * `onlyOwner` functions anymore. Can only be called by the current owner. + * + * NOTE: Renouncing ownership will leave the contract without an owner, + * thereby removing any functionality that is only available to the owner. + */ + function renounceOwnership() external virtual onlyOwner { + emit OwnershipTransferred(_owner, address(0)); + _owner = address(0); + } + + /** + * @dev Transfers ownership of the contract to a new account (`newOwner`). + * Can only be called by the current owner. + */ + function transferOwnership(address newOwner) external virtual onlyOwner { + require(newOwner != address(0), "Ownable: new owner is the zero address"); + emit OwnershipTransferred(_owner, newOwner); + _owner = newOwner; + } +} diff --git a/packages/token-distribution/contracts/arbitrum/ITokenGateway.sol b/packages/token-distribution/contracts/arbitrum/ITokenGateway.sol new file mode 100644 index 000000000..bf2968309 --- /dev/null +++ b/packages/token-distribution/contracts/arbitrum/ITokenGateway.sol @@ -0,0 +1,75 @@ +// SPDX-License-Identifier: Apache-2.0 + +/* + * Copyright 2020, Offchain Labs, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Originally copied from: + * https://github.com/OffchainLabs/arbitrum/tree/e3a6307ad8a2dc2cad35728a2a9908cfd8dd8ef9/packages/arb-bridge-peripherals + * + * MODIFIED from Offchain Labs' implementation: + * - Changed solidity version to 0.7.6 (pablo@edgeandnode.com) + * + */ + +pragma solidity ^0.7.3; +pragma experimental ABIEncoderV2; + +interface ITokenGateway { + /// @notice event deprecated in favor of DepositInitiated and WithdrawalInitiated + // event OutboundTransferInitiated( + // address token, + // address indexed _from, + // address indexed _to, + // uint256 indexed _transferId, + // uint256 _amount, + // bytes _data + // ); + + /// @notice event deprecated in favor of DepositFinalized and WithdrawalFinalized + // event InboundTransferFinalized( + // address token, + // address indexed _from, + // address indexed _to, + // uint256 indexed _transferId, + // uint256 _amount, + // bytes _data + // ); + + function outboundTransfer( + address _token, + address _to, + uint256 _amount, + uint256 _maxGas, + uint256 _gasPriceBid, + bytes calldata _data + ) external payable returns (bytes memory); + + function finalizeInboundTransfer( + address _token, + address _from, + address _to, + uint256 _amount, + bytes calldata _data + ) external payable; + + /** + * @notice Calculate the address used when bridging an ERC20 token + * @dev the L1 and L2 address oracles may not always be in sync. + * For example, a custom token may have been registered but not deployed or the contract self destructed. + * @param l1ERC20 address of L1 token + * @return L2 address of a bridged ERC20 token + */ + function calculateL2TokenAddress(address l1ERC20) external view returns (address); +} diff --git a/packages/token-distribution/contracts/tests/BridgeMock.sol b/packages/token-distribution/contracts/tests/BridgeMock.sol new file mode 100644 index 000000000..643a20428 --- /dev/null +++ b/packages/token-distribution/contracts/tests/BridgeMock.sol @@ -0,0 +1,118 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.7.3; + +import "./arbitrum/IBridge.sol"; + +/** + * @title Arbitrum Bridge mock contract + * @dev This contract implements Arbitrum's IBridge interface for testing purposes + */ +contract BridgeMock is IBridge { + /// Address of the (mock) Arbitrum Inbox + address public inbox; + /// Address of the (mock) Arbitrum Outbox + address public outbox; + /// Index of the next message on the inbox messages array + uint256 public messageIndex; + /// Inbox messages array + bytes32[] public override inboxAccs; + + /** + * @notice Deliver a message to the inbox. The encoded message will be + * added to the inbox array, and messageIndex will be incremented. + * @param _kind Type of the message + * @param _sender Address that is sending the message + * @param _messageDataHash keccak256 hash of the message data + * @return The next index for the inbox array + */ + function deliverMessageToInbox( + uint8 _kind, + address _sender, + bytes32 _messageDataHash + ) external payable override returns (uint256) { + messageIndex = messageIndex + 1; + inboxAccs.push(keccak256(abi.encodePacked(inbox, _kind, _sender, _messageDataHash))); + emit MessageDelivered(messageIndex, inboxAccs[messageIndex - 1], msg.sender, _kind, _sender, _messageDataHash); + return messageIndex; + } + + /** + * @notice Executes an L1 function call incoing from L2. This can only be called + * by the Outbox. + * @param _destAddr Contract to call + * @param _amount ETH value to send + * @param _data Calldata for the function call + * @return True if the call was successful, false otherwise + * @return Return data from the call + */ + function executeCall( + address _destAddr, + uint256 _amount, + bytes calldata _data + ) external override returns (bool, bytes memory) { + require(outbox == msg.sender, "NOT_FROM_OUTBOX"); + bool success; + bytes memory returnData; + + // solhint-disable-next-line avoid-low-level-calls + (success, returnData) = _destAddr.call{ value: _amount }(_data); + emit BridgeCallTriggered(msg.sender, _destAddr, _amount, _data); + return (success, returnData); + } + + /** + * @notice Set the address of the inbox. Anyone can call this, because it's a mock. + * @param _inbox Address of the inbox + * @param _enabled Enable the inbox (ignored) + */ + function setInbox(address _inbox, bool _enabled) external override { + inbox = _inbox; + emit InboxToggle(inbox, _enabled); + } + + /** + * @notice Set the address of the outbox. Anyone can call this, because it's a mock. + * @param _outbox Address of the outbox + * @param _enabled Enable the outbox (ignored) + */ + function setOutbox(address _outbox, bool _enabled) external override { + outbox = _outbox; + emit OutboxToggle(outbox, _enabled); + } + + // View functions + + /** + * @notice Getter for the active outbox (in this case there's only one) + */ + function activeOutbox() external view override returns (address) { + return outbox; + } + + /** + * @notice Getter for whether an address is an allowed inbox (in this case there's only one) + * @param _inbox Address to check + * @return True if the address is the allowed inbox, false otherwise + */ + function allowedInboxes(address _inbox) external view override returns (bool) { + return _inbox == inbox; + } + + /** + * @notice Getter for whether an address is an allowed outbox (in this case there's only one) + * @param _outbox Address to check + * @return True if the address is the allowed outbox, false otherwise + */ + function allowedOutboxes(address _outbox) external view override returns (bool) { + return _outbox == outbox; + } + + /** + * @notice Getter for the count of messages in the inboxAccs + * @return Number of messages in inboxAccs + */ + function messageCount() external view override returns (uint256) { + return inboxAccs.length; + } +} diff --git a/packages/token-distribution/contracts/tests/GraphTokenMock.sol b/packages/token-distribution/contracts/tests/GraphTokenMock.sol new file mode 100644 index 000000000..bc52b9456 --- /dev/null +++ b/packages/token-distribution/contracts/tests/GraphTokenMock.sol @@ -0,0 +1,42 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.7.3; + +import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; +import "@openzeppelin/contracts/access/Ownable.sol"; + +/** + * @title Graph Token Mock contract. + * @dev Used for testing purposes, DO NOT USE IN PRODUCTION + */ +contract GraphTokenMock is Ownable, ERC20 { + /** + * @notice Contract Constructor. + * @param _initialSupply Initial supply + * @param _mintTo Address to whitch to mint the initial supply + */ + constructor(uint256 _initialSupply, address _mintTo) ERC20("Graph Token Mock", "GRT-Mock") { + // Deploy to mint address + _mint(_mintTo, _initialSupply); + } + + /** + * @notice Mint tokens to an address from the bridge. + * (The real one has an onlyGateway modifier) + * @param _to Address to mint tokens to + * @param _amount Amount of tokens to mint + */ + function bridgeMint(address _to, uint256 _amount) external { + _mint(_to, _amount); + } + + /** + * @notice Burn tokens from an address from the bridge. + * (The real one has an onlyGateway modifier) + * @param _from Address to burn tokens from + * @param _amount Amount of tokens to burn + */ + function bridgeBurn(address _from, uint256 _amount) external { + _burn(_from, _amount); + } +} diff --git a/packages/token-distribution/contracts/tests/InboxMock.sol b/packages/token-distribution/contracts/tests/InboxMock.sol new file mode 100644 index 000000000..7f0fdfb6b --- /dev/null +++ b/packages/token-distribution/contracts/tests/InboxMock.sol @@ -0,0 +1,193 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.7.3; + +import "./arbitrum/IInbox.sol"; +import "./arbitrum/AddressAliasHelper.sol"; + +/** + * @title Arbitrum Inbox mock contract + * @dev This contract implements (a subset of) Arbitrum's IInbox interface for testing purposes + */ +contract InboxMock is IInbox { + /// @dev Type indicator for a standard L2 message + uint8 internal constant L2_MSG = 3; + /// @dev Type indicator for a retryable ticket message + // solhint-disable-next-line const-name-snakecase + uint8 internal constant L1MessageType_submitRetryableTx = 9; + /// Address of the Bridge (mock) contract + IBridge public override bridge; + + /** + * @notice Send a message to L2 (by delivering it to the Bridge) + * @param _messageData Encoded data to send in the message + * @return Message number returned by the inbox + */ + function sendL2Message(bytes calldata _messageData) external override returns (uint256) { + uint256 msgNum = deliverToBridge(L2_MSG, msg.sender, keccak256(_messageData)); + emit InboxMessageDelivered(msgNum, _messageData); + return msgNum; + } + + /** + * @notice Set the address of the (mock) bridge + * @param _bridge Address of the bridge + */ + function setBridge(address _bridge) external { + bridge = IBridge(_bridge); + } + + /** + * @notice Unimplemented in this mock + */ + function sendUnsignedTransaction( + uint256, + uint256, + uint256, + address, + uint256, + bytes calldata + ) external pure override returns (uint256) { + revert("Unimplemented"); + } + + /** + * @notice Unimplemented in this mock + */ + function sendContractTransaction( + uint256, + uint256, + address, + uint256, + bytes calldata + ) external pure override returns (uint256) { + revert("Unimplemented"); + } + + /** + * @notice Unimplemented in this mock + */ + function sendL1FundedUnsignedTransaction( + uint256, + uint256, + uint256, + address, + bytes calldata + ) external payable override returns (uint256) { + revert("Unimplemented"); + } + + /** + * @notice Unimplemented in this mock + */ + function sendL1FundedContractTransaction( + uint256, + uint256, + address, + bytes calldata + ) external payable override returns (uint256) { + revert("Unimplemented"); + } + + /** + * @notice Creates a retryable ticket for an L2 transaction + * @param _destAddr Address of the contract to call in L2 + * @param _arbTxCallValue Callvalue to use in the L2 transaction + * @param _maxSubmissionCost Max cost of submitting the ticket, in Wei + * @param _submissionRefundAddress L2 address to refund for any remaining value from the submission cost + * @param _valueRefundAddress L2 address to refund if the ticket times out or gets cancelled + * @param _maxGas Max gas for the L2 transcation + * @param _gasPriceBid Gas price bid on L2 + * @param _data Encoded calldata for the L2 transaction (including function selector) + * @return Message number returned by the bridge + */ + function createRetryableTicket( + address _destAddr, + uint256 _arbTxCallValue, + uint256 _maxSubmissionCost, + address _submissionRefundAddress, + address _valueRefundAddress, + uint256 _maxGas, + uint256 _gasPriceBid, + bytes calldata _data + ) external payable override returns (uint256) { + _submissionRefundAddress = AddressAliasHelper.applyL1ToL2Alias(_submissionRefundAddress); + _valueRefundAddress = AddressAliasHelper.applyL1ToL2Alias(_valueRefundAddress); + return + _deliverMessage( + L1MessageType_submitRetryableTx, + msg.sender, + abi.encodePacked( + uint256(uint160(bytes20(_destAddr))), + _arbTxCallValue, + msg.value, + _maxSubmissionCost, + uint256(uint160(bytes20(_submissionRefundAddress))), + uint256(uint160(bytes20(_valueRefundAddress))), + _maxGas, + _gasPriceBid, + _data.length, + _data + ) + ); + } + + /** + * @notice Unimplemented in this mock + */ + function depositEth(uint256) external payable override returns (uint256) { + revert("Unimplemented"); + } + + /** + * @notice Unimplemented in this mock + */ + function pauseCreateRetryables() external pure override { + revert("Unimplemented"); + } + + /** + * @notice Unimplemented in this mock + */ + function unpauseCreateRetryables() external pure override { + revert("Unimplemented"); + } + + /** + * @notice Unimplemented in this mock + */ + function startRewriteAddress() external pure override { + revert("Unimplemented"); + } + + /** + * @notice Unimplemented in this mock + */ + function stopRewriteAddress() external pure override { + revert("Unimplemented"); + } + + /** + * @dev Deliver a message to the bridge + * @param _kind Type of the message + * @param _sender Address that is sending the message + * @param _messageData Encoded message data + * @return Message number returned by the bridge + */ + function _deliverMessage(uint8 _kind, address _sender, bytes memory _messageData) internal returns (uint256) { + uint256 msgNum = deliverToBridge(_kind, _sender, keccak256(_messageData)); + emit InboxMessageDelivered(msgNum, _messageData); + return msgNum; + } + + /** + * @dev Deliver a message to the bridge + * @param _kind Type of the message + * @param _sender Address that is sending the message + * @param _messageDataHash keccak256 hash of the encoded message data + * @return Message number returned by the bridge + */ + function deliverToBridge(uint8 _kind, address _sender, bytes32 _messageDataHash) internal returns (uint256) { + return bridge.deliverMessageToInbox{ value: msg.value }(_kind, _sender, _messageDataHash); + } +} diff --git a/packages/token-distribution/contracts/tests/L1TokenGatewayMock.sol b/packages/token-distribution/contracts/tests/L1TokenGatewayMock.sol new file mode 100644 index 000000000..af0d6e34d --- /dev/null +++ b/packages/token-distribution/contracts/tests/L1TokenGatewayMock.sol @@ -0,0 +1,168 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.7.3; + +import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; +import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; +import { SafeMath } from "@openzeppelin/contracts/math/SafeMath.sol"; +import { ITokenGateway } from "../arbitrum//ITokenGateway.sol"; + +/** + * @title L1 Token Gateway mock contract + * @dev Used for testing purposes, DO NOT USE IN PRODUCTION + */ +contract L1TokenGatewayMock is Ownable { + using SafeMath for uint256; + /// Next sequence number to return when outboundTransfer is called + uint256 public nextSeqNum; + + /// @dev Emitted when a (fake) retryable ticket is created + event FakeTxToL2( + address from, + uint256 value, + uint256 maxGas, + uint256 gasPriceBid, + uint256 maxSubmissionCost, + bytes outboundCalldata + ); + + /// @dev Emitted when an outbound transfer is initiated, i.e. tokens are deposited from L1 to L2 + event DepositInitiated( + address l1Token, + address indexed from, + address indexed to, + uint256 indexed sequenceNumber, + uint256 amount + ); + + /** + * @notice L1 Token Gateway Contract Constructor. + */ + constructor() {} + + /** + * @notice Creates and sends a fake retryable ticket to transfer GRT to L2. + * This mock will actually just emit an event with parameters equivalent to what the real L1GraphTokenGateway + * would send to L2. + * @param _l1Token L1 Address of the GRT contract (needed for compatibility with Arbitrum Gateway Router) + * @param _to Recipient address on L2 + * @param _amount Amount of tokens to tranfer + * @param _maxGas Gas limit for L2 execution of the ticket + * @param _gasPriceBid Price per gas on L2 + * @param _data Encoded maxSubmissionCost and sender address along with additional calldata + * @return Sequence number of the retryable ticket created by Inbox (always ) + */ + function outboundTransfer( + address _l1Token, + address _to, + uint256 _amount, + uint256 _maxGas, + uint256 _gasPriceBid, + bytes calldata _data + ) external payable returns (bytes memory) { + require(_amount > 0, "INVALID_ZERO_AMOUNT"); + require(_to != address(0), "INVALID_DESTINATION"); + + // nested scopes to avoid stack too deep errors + address from; + uint256 seqNum = nextSeqNum; + nextSeqNum += 1; + { + uint256 maxSubmissionCost; + bytes memory outboundCalldata; + { + bytes memory extraData; + (from, maxSubmissionCost, extraData) = _parseOutboundData(_data); + require(maxSubmissionCost > 0, "NO_SUBMISSION_COST"); + + { + // makes sure only sufficient ETH is supplied as required for successful redemption on L2 + // if a user does not desire immediate redemption they should provide + // a msg.value of AT LEAST maxSubmissionCost + uint256 expectedEth = maxSubmissionCost.add(_maxGas.mul(_gasPriceBid)); + require(msg.value >= expectedEth, "WRONG_ETH_VALUE"); + } + outboundCalldata = getOutboundCalldata(_l1Token, from, _to, _amount, extraData); + } + { + // transfer tokens to escrow + IERC20(_l1Token).transferFrom(from, address(this), _amount); + + emit FakeTxToL2(from, msg.value, _maxGas, _gasPriceBid, maxSubmissionCost, outboundCalldata); + } + } + emit DepositInitiated(_l1Token, from, _to, seqNum, _amount); + + return abi.encode(seqNum); + } + + /** + * @notice (Mock) Receives withdrawn tokens from L2 + * Actually does nothing, just keeping it here as its useful to define the expected + * calldata for the outgoing transfer in tests. + * @param _l1Token L1 Address of the GRT contract (needed for compatibility with Arbitrum Gateway Router) + * @param _from Address of the sender + * @param _to Recepient address on L1 + * @param _amount Amount of tokens transferred + * @param _data Additional calldata + */ + function finalizeInboundTransfer( + address _l1Token, + address _from, + address _to, + uint256 _amount, + bytes calldata _data + ) external payable {} + + /** + * @notice Creates calldata required to create a retryable ticket + * @dev encodes the target function with its params which + * will be called on L2 when the retryable ticket is redeemed + * @param _l1Token Address of the Graph token contract on L1 + * @param _from Address on L1 from which we're transferring tokens + * @param _to Address on L2 to which we're transferring tokens + * @param _amount Amount of GRT to transfer + * @param _data Additional call data for the L2 transaction, which must be empty unless the caller is whitelisted + * @return Encoded calldata (including function selector) for the L2 transaction + */ + function getOutboundCalldata( + address _l1Token, + address _from, + address _to, + uint256 _amount, + bytes memory _data + ) public pure returns (bytes memory) { + bytes memory emptyBytes; + + return + abi.encodeWithSelector( + ITokenGateway.finalizeInboundTransfer.selector, + _l1Token, + _from, + _to, + _amount, + abi.encode(emptyBytes, _data) + ); + } + + /** + * @notice Decodes calldata required for transfer of tokens to L2 + * @dev Data must include maxSubmissionCost, extraData can be left empty. When the router + * sends an outbound message, data also contains the from address, but this mock + * doesn't consider this case + * @param _data Encoded callhook data containing maxSubmissionCost and extraData + * @return Sender of the tx + * @return Max ether value used to submit the retryable ticket + * @return Additional data sent to L2 + */ + function _parseOutboundData(bytes memory _data) private view returns (address, uint256, bytes memory) { + address from; + uint256 maxSubmissionCost; + bytes memory extraData; + from = msg.sender; + // User-encoded data contains the max retryable ticket submission cost + // and additional L2 calldata + (maxSubmissionCost, extraData) = abi.decode(_data, (uint256, bytes)); + return (from, maxSubmissionCost, extraData); + } +} diff --git a/packages/token-distribution/contracts/tests/L2TokenGatewayMock.sol b/packages/token-distribution/contracts/tests/L2TokenGatewayMock.sol new file mode 100644 index 000000000..72665b8d4 --- /dev/null +++ b/packages/token-distribution/contracts/tests/L2TokenGatewayMock.sol @@ -0,0 +1,177 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.7.3; + +import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; +import { ITokenGateway } from "../arbitrum//ITokenGateway.sol"; +import { GraphTokenMock } from "./GraphTokenMock.sol"; +import { ICallhookReceiver } from "../ICallhookReceiver.sol"; + +/** + * @title L2 Token Gateway mock contract + * @dev Used for testing purposes, DO NOT USE IN PRODUCTION + */ +contract L2TokenGatewayMock is Ownable { + /// Address of the L1 GRT contract + address public immutable l1Token; + /// Address of the L2 GRT contract + address public immutable l2Token; + /// Next ID to return when sending an outboundTransfer + uint256 public nextId; + + /// @dev Emitted when a (fake) transaction to L1 is created + event FakeTxToL1(address from, bytes outboundCalldata); + /// @dev Emitted when a (fake) retryable ticket is received from L1 + event DepositFinalized(address token, address indexed from, address indexed to, uint256 amount); + + /// @dev Emitted when an outbound transfer is initiated, i.e. tokens are withdrawn to L1 from L2 + event WithdrawalInitiated( + address l1Token, + address indexed from, + address indexed to, + uint256 indexed sequenceNumber, + uint256 amount + ); + + /** + * @notice L2 Token Gateway Contract Constructor. + * @param _l1Token Address of the L1 GRT contract + * @param _l2Token Address of the L2 GRT contract + */ + constructor(address _l1Token, address _l2Token) { + l1Token = _l1Token; + l2Token = _l2Token; + } + + /** + * @notice Creates and sends a (fake) transfer of GRT to L1. + * This mock will actually just emit an event with parameters equivalent to what the real L2GraphTokenGateway + * would send to L1. + * @param _l1Token L1 Address of the GRT contract (needed for compatibility with Arbitrum Gateway Router) + * @param _to Recipient address on L2 + * @param _amount Amount of tokens to tranfer + * @param _data Encoded maxSubmissionCost and sender address along with additional calldata + * @return ID of the L2-L1 message (incrementing on every call) + */ + function outboundTransfer( + address _l1Token, + address _to, + uint256 _amount, + uint256, + uint256, + bytes calldata _data + ) external payable returns (bytes memory) { + require(_l1Token == l1Token, "INVALID_L1_TOKEN"); + require(_amount > 0, "INVALID_ZERO_AMOUNT"); + require(_to != address(0), "INVALID_DESTINATION"); + + // nested scopes to avoid stack too deep errors + address from; + uint256 id = nextId; + nextId += 1; + { + bytes memory outboundCalldata; + { + bytes memory extraData; + (from, extraData) = _parseOutboundData(_data); + + require(msg.value == 0, "!value"); + require(extraData.length == 0, "!extraData"); + outboundCalldata = getOutboundCalldata(_l1Token, from, _to, _amount, extraData); + } + { + // burn tokens from the sender, they will be released from escrow in L1 + GraphTokenMock(l2Token).bridgeBurn(from, _amount); + + emit FakeTxToL1(from, outboundCalldata); + } + } + emit WithdrawalInitiated(_l1Token, from, _to, id, _amount); + + return abi.encode(id); + } + + /** + * @notice (Mock) Receives withdrawn tokens from L1 + * Implements calling callhooks if data is non-empty. + * @param _l1Token L1 Address of the GRT contract (needed for compatibility with Arbitrum Gateway Router) + * @param _from Address of the sender + * @param _to Recipient address on L1 + * @param _amount Amount of tokens transferred + * @param _data Additional calldata, will trigger an onTokenTransfer call if non-empty + */ + function finalizeInboundTransfer( + address _l1Token, + address _from, + address _to, + uint256 _amount, + bytes calldata _data + ) external payable { + require(_l1Token == l1Token, "TOKEN_NOT_GRT"); + require(msg.value == 0, "INVALID_NONZERO_VALUE"); + + GraphTokenMock(l2Token).bridgeMint(_to, _amount); + + if (_data.length > 0) { + ICallhookReceiver(_to).onTokenTransfer(_from, _amount, _data); + } + + emit DepositFinalized(_l1Token, _from, _to, _amount); + } + + /** + * @notice Calculate the L2 address of a bridged token + * @dev In our case, this would only work for GRT. + * @param l1ERC20 address of L1 GRT contract + * @return L2 address of the bridged GRT token + */ + function calculateL2TokenAddress(address l1ERC20) public view returns (address) { + if (l1ERC20 != l1Token) { + return address(0); + } + return l2Token; + } + + /** + * @notice Creates calldata required to create a tx to L1 + * @param _l1Token Address of the Graph token contract on L1 + * @param _from Address on L2 from which we're transferring tokens + * @param _to Address on L1 to which we're transferring tokens + * @param _amount Amount of GRT to transfer + * @param _data Additional call data for the L1 transaction, which must be empty + * @return Encoded calldata (including function selector) for the L1 transaction + */ + function getOutboundCalldata( + address _l1Token, + address _from, + address _to, + uint256 _amount, + bytes memory _data + ) public pure returns (bytes memory) { + return + abi.encodeWithSelector( + ITokenGateway.finalizeInboundTransfer.selector, + _l1Token, + _from, + _to, + _amount, + abi.encode(0, _data) + ); + } + + /** + * @dev Decodes calldata required for transfer of tokens to L1. + * extraData can be left empty + * @param _data Encoded callhook data + * @return Sender of the tx + * @return Any other data sent to L1 + */ + function _parseOutboundData(bytes calldata _data) private view returns (address, bytes memory) { + address from; + bytes memory extraData; + // The mock doesn't take messages from the Router + from = msg.sender; + extraData = _data; + return (from, extraData); + } +} diff --git a/packages/token-distribution/contracts/tests/Stakes.sol b/packages/token-distribution/contracts/tests/Stakes.sol new file mode 100644 index 000000000..bf140aa8f --- /dev/null +++ b/packages/token-distribution/contracts/tests/Stakes.sol @@ -0,0 +1,214 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.7.3; +pragma experimental ABIEncoderV2; + +import "@openzeppelin/contracts/math/SafeMath.sol"; + +/** + * @title A collection of data structures and functions to manage the Indexer Stake state. + * Used for low-level state changes, require() conditions should be evaluated + * at the caller function scope. + */ +library Stakes { + using SafeMath for uint256; + using Stakes for Stakes.Indexer; + + struct Indexer { + uint256 tokensStaked; // Tokens on the indexer stake (staked by the indexer) + uint256 tokensAllocated; // Tokens used in allocations + uint256 tokensLocked; // Tokens locked for withdrawal subject to thawing period + uint256 tokensLockedUntil; // Block when locked tokens can be withdrawn + } + + /** + * @dev Deposit tokens to the indexer stake. + * @param stake Stake data + * @param _tokens Amount of tokens to deposit + */ + function deposit(Stakes.Indexer storage stake, uint256 _tokens) internal { + stake.tokensStaked = stake.tokensStaked.add(_tokens); + } + + /** + * @dev Release tokens from the indexer stake. + * @param stake Stake data + * @param _tokens Amount of tokens to release + */ + function release(Stakes.Indexer storage stake, uint256 _tokens) internal { + stake.tokensStaked = stake.tokensStaked.sub(_tokens); + } + + /** + * @dev Allocate tokens from the main stack to a SubgraphDeployment. + * @param stake Stake data + * @param _tokens Amount of tokens to allocate + */ + function allocate(Stakes.Indexer storage stake, uint256 _tokens) internal { + stake.tokensAllocated = stake.tokensAllocated.add(_tokens); + } + + /** + * @dev Unallocate tokens from a SubgraphDeployment back to the main stack. + * @param stake Stake data + * @param _tokens Amount of tokens to unallocate + */ + function unallocate(Stakes.Indexer storage stake, uint256 _tokens) internal { + stake.tokensAllocated = stake.tokensAllocated.sub(_tokens); + } + + /** + * @dev Lock tokens until a thawing period pass. + * @param stake Stake data + * @param _tokens Amount of tokens to unstake + * @param _period Period in blocks that need to pass before withdrawal + */ + function lockTokens(Stakes.Indexer storage stake, uint256 _tokens, uint256 _period) internal { + // Take into account period averaging for multiple unstake requests + uint256 lockingPeriod = _period; + if (stake.tokensLocked > 0) { + lockingPeriod = stake.getLockingPeriod(_tokens, _period); + } + + // Update balances + stake.tokensLocked = stake.tokensLocked.add(_tokens); + stake.tokensLockedUntil = block.number.add(lockingPeriod); + } + + /** + * @dev Unlock tokens. + * @param stake Stake data + * @param _tokens Amount of tokens to unkock + */ + function unlockTokens(Stakes.Indexer storage stake, uint256 _tokens) internal { + stake.tokensLocked = stake.tokensLocked.sub(_tokens); + if (stake.tokensLocked == 0) { + stake.tokensLockedUntil = 0; + } + } + + /** + * @dev Take all tokens out from the locked stake for withdrawal. + * @param stake Stake data + * @return Amount of tokens being withdrawn + */ + function withdrawTokens(Stakes.Indexer storage stake) internal returns (uint256) { + // Calculate tokens that can be released + uint256 tokensToWithdraw = stake.tokensWithdrawable(); + + if (tokensToWithdraw > 0) { + // Reset locked tokens + stake.unlockTokens(tokensToWithdraw); + + // Decrease indexer stake + stake.release(tokensToWithdraw); + } + + return tokensToWithdraw; + } + + /** + * @dev Get the locking period of the tokens to unstake. + * If already unstaked before calculate the weighted average. + * @param stake Stake data + * @param _tokens Amount of tokens to unstake + * @param _thawingPeriod Period in blocks that need to pass before withdrawal + * @return True if staked + */ + function getLockingPeriod( + Stakes.Indexer memory stake, + uint256 _tokens, + uint256 _thawingPeriod + ) internal view returns (uint256) { + uint256 blockNum = block.number; + uint256 periodA = (stake.tokensLockedUntil > blockNum) ? stake.tokensLockedUntil.sub(blockNum) : 0; + uint256 periodB = _thawingPeriod; + uint256 stakeA = stake.tokensLocked; + uint256 stakeB = _tokens; + return periodA.mul(stakeA).add(periodB.mul(stakeB)).div(stakeA.add(stakeB)); + } + + /** + * @dev Return true if there are tokens staked by the Indexer. + * @param stake Stake data + * @return True if staked + */ + function hasTokens(Stakes.Indexer memory stake) internal pure returns (bool) { + return stake.tokensStaked > 0; + } + + /** + * @dev Return the amount of tokens used in allocations and locked for withdrawal. + * @param stake Stake data + * @return Token amount + */ + function tokensUsed(Stakes.Indexer memory stake) internal pure returns (uint256) { + return stake.tokensAllocated.add(stake.tokensLocked); + } + + /** + * @dev Return the amount of tokens staked not considering the ones that are already going + * through the thawing period or are ready for withdrawal. We call it secure stake because + * it is not subject to change by a withdraw call from the indexer. + * @param stake Stake data + * @return Token amount + */ + function tokensSecureStake(Stakes.Indexer memory stake) internal pure returns (uint256) { + return stake.tokensStaked.sub(stake.tokensLocked); + } + + /** + * @dev Tokens free balance on the indexer stake that can be used for any purpose. + * Any token that is allocated cannot be used as well as tokens that are going through the + * thawing period or are withdrawable + * Calc: tokensStaked - tokensAllocated - tokensLocked + * @param stake Stake data + * @return Token amount + */ + function tokensAvailable(Stakes.Indexer memory stake) internal pure returns (uint256) { + return stake.tokensAvailableWithDelegation(0); + } + + /** + * @dev Tokens free balance on the indexer stake that can be used for allocations. + * This function accepts a parameter for extra delegated capacity that takes into + * account delegated tokens + * @param stake Stake data + * @param _delegatedCapacity Amount of tokens used from delegators to calculate availability + * @return Token amount + */ + function tokensAvailableWithDelegation( + Stakes.Indexer memory stake, + uint256 _delegatedCapacity + ) internal pure returns (uint256) { + uint256 tokensCapacity = stake.tokensStaked.add(_delegatedCapacity); + uint256 _tokensUsed = stake.tokensUsed(); + // If more tokens are used than the current capacity, the indexer is overallocated. + // This means the indexer doesn't have available capacity to create new allocations. + // We can reach this state when the indexer has funds allocated and then any + // of these conditions happen: + // - The delegationCapacity ratio is reduced. + // - The indexer stake is slashed. + // - A delegator removes enough stake. + if (_tokensUsed > tokensCapacity) { + // Indexer stake is over allocated: return 0 to avoid stake to be used until + // the overallocation is restored by staking more tokens, unallocating tokens + // or using more delegated funds + return 0; + } + return tokensCapacity.sub(_tokensUsed); + } + + /** + * @dev Tokens available for withdrawal after thawing period. + * @param stake Stake data + * @return Token amount + */ + function tokensWithdrawable(Stakes.Indexer memory stake) internal view returns (uint256) { + // No tokens to withdraw before locking period + if (stake.tokensLockedUntil == 0 || block.number < stake.tokensLockedUntil) { + return 0; + } + return stake.tokensLocked; + } +} diff --git a/packages/token-distribution/contracts/tests/StakingMock.sol b/packages/token-distribution/contracts/tests/StakingMock.sol new file mode 100644 index 000000000..8c5fffc80 --- /dev/null +++ b/packages/token-distribution/contracts/tests/StakingMock.sol @@ -0,0 +1,128 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.7.3; +pragma experimental ABIEncoderV2; + +import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; + +import "./Stakes.sol"; + +contract StakingMock { + using SafeMath for uint256; + using Stakes for Stakes.Indexer; + + // -- State -- + + uint256 public minimumIndexerStake = 100e18; + uint256 public thawingPeriod = 10; // 10 blocks + IERC20 public token; + + // Indexer stakes : indexer => Stake + mapping(address => Stakes.Indexer) public stakes; + + /** + * @dev Emitted when `indexer` stake `tokens` amount. + */ + event StakeDeposited(address indexed indexer, uint256 tokens); + + /** + * @dev Emitted when `indexer` unstaked and locked `tokens` amount `until` block. + */ + event StakeLocked(address indexed indexer, uint256 tokens, uint256 until); + + /** + * @dev Emitted when `indexer` withdrew `tokens` staked. + */ + event StakeWithdrawn(address indexed indexer, uint256 tokens); + + // Contract constructor. + constructor(IERC20 _token) { + require(address(_token) != address(0), "!token"); + token = _token; + } + + receive() external payable {} + + /** + * @dev Deposit tokens on the indexer stake. + * @param _tokens Amount of tokens to stake + */ + function stake(uint256 _tokens) external { + stakeTo(msg.sender, _tokens); + } + + /** + * @dev Deposit tokens on the indexer stake. + * @param _indexer Address of the indexer + * @param _tokens Amount of tokens to stake + */ + function stakeTo(address _indexer, uint256 _tokens) public { + require(_tokens > 0, "!tokens"); + + // Ensure minimum stake + require(stakes[_indexer].tokensSecureStake().add(_tokens) >= minimumIndexerStake, "!minimumIndexerStake"); + + // Transfer tokens to stake from caller to this contract + require(token.transferFrom(msg.sender, address(this), _tokens), "!transfer"); + + // Stake the transferred tokens + _stake(_indexer, _tokens); + } + + /** + * @dev Unstake tokens from the indexer stake, lock them until thawing period expires. + * @param _tokens Amount of tokens to unstake + */ + function unstake(uint256 _tokens) external { + address indexer = msg.sender; + Stakes.Indexer storage indexerStake = stakes[indexer]; + + require(_tokens > 0, "!tokens"); + require(indexerStake.hasTokens(), "!stake"); + require(indexerStake.tokensAvailable() >= _tokens, "!stake-avail"); + + // Ensure minimum stake + uint256 newStake = indexerStake.tokensSecureStake().sub(_tokens); + require(newStake == 0 || newStake >= minimumIndexerStake, "!minimumIndexerStake"); + + // Before locking more tokens, withdraw any unlocked ones + uint256 tokensToWithdraw = indexerStake.tokensWithdrawable(); + if (tokensToWithdraw > 0) { + _withdraw(indexer); + } + + indexerStake.lockTokens(_tokens, thawingPeriod); + + emit StakeLocked(indexer, indexerStake.tokensLocked, indexerStake.tokensLockedUntil); + } + + /** + * @dev Withdraw indexer tokens once the thawing period has passed. + */ + function withdraw() external { + _withdraw(msg.sender); + } + + function _stake(address _indexer, uint256 _tokens) internal { + // Deposit tokens into the indexer stake + Stakes.Indexer storage indexerStake = stakes[_indexer]; + indexerStake.deposit(_tokens); + + emit StakeDeposited(_indexer, _tokens); + } + + /** + * @dev Withdraw indexer tokens once the thawing period has passed. + * @param _indexer Address of indexer to withdraw funds from + */ + function _withdraw(address _indexer) private { + // Get tokens available for withdraw and update balance + uint256 tokensToWithdraw = stakes[_indexer].withdrawTokens(); + require(tokensToWithdraw > 0, "!tokens"); + + // Return tokens to the indexer + require(token.transfer(_indexer, tokensToWithdraw), "!transfer"); + + emit StakeWithdrawn(_indexer, tokensToWithdraw); + } +} diff --git a/packages/token-distribution/contracts/tests/WalletMock.sol b/packages/token-distribution/contracts/tests/WalletMock.sol new file mode 100644 index 000000000..872760d6e --- /dev/null +++ b/packages/token-distribution/contracts/tests/WalletMock.sol @@ -0,0 +1,62 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.7.3; +pragma experimental ABIEncoderV2; + +import { Address } from "@openzeppelin/contracts/utils/Address.sol"; + +/** + * @title WalletMock: a mock wallet contract for testing purposes + * @dev For testing only, DO NOT USE IN PRODUCTION. + * This is used to test L1-L2 transfer tools and to create scenarios + * where an invalid wallet calls the transfer tool, e.g. a wallet that has an invalid + * manager, or a wallet that has not been initialized. + */ +contract WalletMock { + /// Target contract for the fallback function (usually a transfer tool contract) + address public immutable target; + /// Address of the GRT (mock) token + address public immutable token; + /// Address of the wallet's manager + address public immutable manager; + /// Whether the wallet has been initialized + bool public immutable isInitialized; + /// Whether the beneficiary has accepted the lock + bool public immutable isAccepted; + + /** + * @notice WalletMock constructor + * @dev This constructor sets all the state variables so that + * specific test scenarios can be created just by deploying this contract. + * @param _target Target contract for the fallback function + * @param _token Address of the GRT (mock) token + * @param _manager Address of the wallet's manager + * @param _isInitialized Whether the wallet has been initialized + * @param _isAccepted Whether the beneficiary has accepted the lock + */ + constructor(address _target, address _token, address _manager, bool _isInitialized, bool _isAccepted) { + target = _target; + token = _token; + manager = _manager; + isInitialized = _isInitialized; + isAccepted = _isAccepted; + } + + /** + * @notice Fallback function + * @dev This function calls the target contract with the data sent to this contract. + * This is used to test the L1-L2 transfer tool. + */ + fallback() external payable { + // Call function with data + Address.functionCall(target, msg.data); + } + + /** + * @notice Receive function + * @dev This function is added to avoid compiler warnings, but just reverts. + */ + receive() external payable { + revert("Invalid call"); + } +} diff --git a/packages/token-distribution/contracts/tests/arbitrum/AddressAliasHelper.sol b/packages/token-distribution/contracts/tests/arbitrum/AddressAliasHelper.sol new file mode 100644 index 000000000..146c1c876 --- /dev/null +++ b/packages/token-distribution/contracts/tests/arbitrum/AddressAliasHelper.sol @@ -0,0 +1,46 @@ +// SPDX-License-Identifier: Apache-2.0 + +/* + * Copyright 2019-2021, Offchain Labs, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Originally copied from: + * https://github.com/OffchainLabs/arbitrum/tree/84e64dee6ee82adbf8ec34fd4b86c207a61d9007/packages/arb-bridge-eth + * + * MODIFIED from Offchain Labs' implementation: + * - Changed solidity version to 0.7.3 (pablo@edgeandnode.com) + * + */ + +pragma solidity ^0.7.3; + +library AddressAliasHelper { + uint160 constant offset = uint160(0x1111000000000000000000000000000000001111); + + /// @notice Utility function that converts the address in the L1 that submitted a tx to + /// the inbox to the msg.sender viewed in the L2 + /// @param l1Address the address in the L1 that triggered the tx to L2 + /// @return l2Address L2 address as viewed in msg.sender + function applyL1ToL2Alias(address l1Address) internal pure returns (address l2Address) { + l2Address = address(uint160(l1Address) + offset); + } + + /// @notice Utility function that converts the msg.sender viewed in the L2 to the + /// address in the L1 that submitted a tx to the inbox + /// @param l2Address L2 address as viewed in msg.sender + /// @return l1Address the address in the L1 that triggered the tx to L2 + function undoL1ToL2Alias(address l2Address) internal pure returns (address l1Address) { + l1Address = address(uint160(l2Address) - offset); + } +} diff --git a/packages/token-distribution/contracts/tests/arbitrum/IBridge.sol b/packages/token-distribution/contracts/tests/arbitrum/IBridge.sol new file mode 100644 index 000000000..fdfa34eed --- /dev/null +++ b/packages/token-distribution/contracts/tests/arbitrum/IBridge.sol @@ -0,0 +1,72 @@ +// SPDX-License-Identifier: Apache-2.0 + +/* + * Copyright 2021, Offchain Labs, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Originally copied from: + * https://github.com/OffchainLabs/arbitrum/tree/e3a6307ad8a2dc2cad35728a2a9908cfd8dd8ef9/packages/arb-bridge-eth + * + * MODIFIED from Offchain Labs' implementation: + * - Changed solidity version to 0.7.3 (pablo@edgeandnode.com) + * + */ + +pragma solidity ^0.7.3; + +interface IBridge { + event MessageDelivered( + uint256 indexed messageIndex, + bytes32 indexed beforeInboxAcc, + address inbox, + uint8 kind, + address sender, + bytes32 messageDataHash + ); + + event BridgeCallTriggered(address indexed outbox, address indexed destAddr, uint256 amount, bytes data); + + event InboxToggle(address indexed inbox, bool enabled); + + event OutboxToggle(address indexed outbox, bool enabled); + + function deliverMessageToInbox( + uint8 kind, + address sender, + bytes32 messageDataHash + ) external payable returns (uint256); + + function executeCall( + address destAddr, + uint256 amount, + bytes calldata data + ) external returns (bool success, bytes memory returnData); + + // These are only callable by the admin + function setInbox(address inbox, bool enabled) external; + + function setOutbox(address inbox, bool enabled) external; + + // View functions + + function activeOutbox() external view returns (address); + + function allowedInboxes(address inbox) external view returns (bool); + + function allowedOutboxes(address outbox) external view returns (bool); + + function inboxAccs(uint256 index) external view returns (bytes32); + + function messageCount() external view returns (uint256); +} diff --git a/packages/token-distribution/contracts/tests/arbitrum/IInbox.sol b/packages/token-distribution/contracts/tests/arbitrum/IInbox.sol new file mode 100644 index 000000000..0a6e78dc3 --- /dev/null +++ b/packages/token-distribution/contracts/tests/arbitrum/IInbox.sol @@ -0,0 +1,88 @@ +// SPDX-License-Identifier: Apache-2.0 + +/* + * Copyright 2021, Offchain Labs, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Originally copied from: + * https://github.com/OffchainLabs/arbitrum/tree/e3a6307ad8a2dc2cad35728a2a9908cfd8dd8ef9/packages/arb-bridge-eth + * + * MODIFIED from Offchain Labs' implementation: + * - Changed solidity version to 0.7.3 (pablo@edgeandnode.com) + * + */ + +pragma solidity ^0.7.3; + +import "./IBridge.sol"; +import "./IMessageProvider.sol"; + +interface IInbox is IMessageProvider { + function sendL2Message(bytes calldata messageData) external returns (uint256); + + function sendUnsignedTransaction( + uint256 maxGas, + uint256 gasPriceBid, + uint256 nonce, + address destAddr, + uint256 amount, + bytes calldata data + ) external returns (uint256); + + function sendContractTransaction( + uint256 maxGas, + uint256 gasPriceBid, + address destAddr, + uint256 amount, + bytes calldata data + ) external returns (uint256); + + function sendL1FundedUnsignedTransaction( + uint256 maxGas, + uint256 gasPriceBid, + uint256 nonce, + address destAddr, + bytes calldata data + ) external payable returns (uint256); + + function sendL1FundedContractTransaction( + uint256 maxGas, + uint256 gasPriceBid, + address destAddr, + bytes calldata data + ) external payable returns (uint256); + + function createRetryableTicket( + address destAddr, + uint256 arbTxCallValue, + uint256 maxSubmissionCost, + address submissionRefundAddress, + address valueRefundAddress, + uint256 maxGas, + uint256 gasPriceBid, + bytes calldata data + ) external payable returns (uint256); + + function depositEth(uint256 maxSubmissionCost) external payable returns (uint256); + + function bridge() external view returns (IBridge); + + function pauseCreateRetryables() external; + + function unpauseCreateRetryables() external; + + function startRewriteAddress() external; + + function stopRewriteAddress() external; +} diff --git a/packages/token-distribution/contracts/tests/arbitrum/IMessageProvider.sol b/packages/token-distribution/contracts/tests/arbitrum/IMessageProvider.sol new file mode 100644 index 000000000..cf8446af2 --- /dev/null +++ b/packages/token-distribution/contracts/tests/arbitrum/IMessageProvider.sol @@ -0,0 +1,32 @@ +// SPDX-License-Identifier: Apache-2.0 + +/* + * Copyright 2021, Offchain Labs, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Originally copied from: + * https://github.com/OffchainLabs/arbitrum/tree/e3a6307ad8a2dc2cad35728a2a9908cfd8dd8ef9/packages/arb-bridge-eth + * + * MODIFIED from Offchain Labs' implementation: + * - Changed solidity version to 0.7.3 (pablo@edgeandnode.com) + * + */ + +pragma solidity ^0.7.3; + +interface IMessageProvider { + event InboxMessageDelivered(uint256 indexed messageNum, bytes data); + + event InboxMessageDeliveredFromOrigin(uint256 indexed messageNum); +} diff --git a/packages/token-distribution/deploy/1_test.ts b/packages/token-distribution/deploy/1_test.ts new file mode 100644 index 000000000..92b626012 --- /dev/null +++ b/packages/token-distribution/deploy/1_test.ts @@ -0,0 +1,32 @@ +import { utils } from 'ethers' +import consola from 'consola' + +import { HardhatRuntimeEnvironment } from 'hardhat/types' +import { DeployFunction, DeployOptions } from 'hardhat-deploy/types' + +const { parseEther } = utils + +const logger = consola.create({}) + +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { + const deploy = (name: string, options: DeployOptions) => hre.deployments.deploy(name, options) + const { deployer } = await hre.getNamedAccounts() + + // -- Fake Graph Token -- + + logger.info('Deploying GraphTokenMock...') + + await deploy('GraphTokenMock', { + from: deployer, + args: [ + parseEther('10000000000'), // 10B + deployer, + ], + log: true, + }) +} + +func.skip = (hre: HardhatRuntimeEnvironment) => Promise.resolve(hre.network.name === 'mainnet') +func.tags = ['test'] + +export default func diff --git a/packages/token-distribution/deploy/2_l1_manager_wallet.ts b/packages/token-distribution/deploy/2_l1_manager_wallet.ts new file mode 100644 index 000000000..a2bd7ecac --- /dev/null +++ b/packages/token-distribution/deploy/2_l1_manager_wallet.ts @@ -0,0 +1,73 @@ +import consola from 'consola' +import { utils } from 'ethers' + +import '@nomiclabs/hardhat-ethers' +import { HardhatRuntimeEnvironment } from 'hardhat/types' +import { DeployFunction, DeployOptions } from 'hardhat-deploy/types' + +import { GraphTokenMock } from '../build/typechain/contracts/GraphTokenMock' +import { GraphTokenLockManager } from '../build/typechain/contracts/GraphTokenLockManager' +import { askConfirm, getDeploymentName, promptContractAddress } from './lib/utils' + +const { parseEther, formatEther } = utils + +const logger = consola.create({}) + +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { + const deploy = (name: string, options: DeployOptions) => hre.deployments.deploy(name, options) + const { deployer } = await hre.getNamedAccounts() + + // -- Graph Token -- + + // Get the token address we will use + const tokenAddress = await promptContractAddress('L1 GRT', logger) + if (!tokenAddress) { + logger.warn('No token address provided') + process.exit(1) + } + + // -- Token Lock Manager -- + + // Deploy the master copy of GraphTokenLockWallet + logger.info('Deploying GraphTokenLockWallet master copy...') + const masterCopySaveName = await getDeploymentName('GraphTokenLockWallet') + const masterCopyDeploy = await deploy(masterCopySaveName, { + from: deployer, + log: true, + contract: 'GraphTokenLockWallet', + }) + + // Deploy the Manager that uses the master copy to clone contracts + logger.info('Deploying GraphTokenLockManager...') + const managerSaveName = await getDeploymentName('GraphTokenLockManager') + const managerDeploy = await deploy(managerSaveName, { + from: deployer, + args: [tokenAddress, masterCopyDeploy.address], + log: true, + contract: 'GraphTokenLockManager', + }) + + // -- Fund -- + + if (await askConfirm('Do you want to fund the manager?')) { + const fundAmount = parseEther('100000000') + logger.info(`Funding ${managerDeploy.address} with ${formatEther(fundAmount)} GRT...`) + + // Approve + const grt = (await hre.ethers.getContractAt('GraphTokenMock', tokenAddress)) as GraphTokenMock + await grt.approve(managerDeploy.address, fundAmount) + + // Deposit + const manager = (await hre.ethers.getContractAt( + 'GraphTokenLockManager', + managerDeploy.address, + )) as GraphTokenLockManager + await manager.deposit(fundAmount) + + logger.success('Done!') + } +} + +func.tags = ['manager', 'l1', 'l1-manager', 'l1-wallet'] + +export default func diff --git a/packages/token-distribution/deploy/3_l2_wallet.ts b/packages/token-distribution/deploy/3_l2_wallet.ts new file mode 100644 index 000000000..36679613c --- /dev/null +++ b/packages/token-distribution/deploy/3_l2_wallet.ts @@ -0,0 +1,26 @@ +import consola from 'consola' +import '@nomiclabs/hardhat-ethers' +import { HardhatRuntimeEnvironment } from 'hardhat/types' +import { DeployFunction, DeployOptions } from 'hardhat-deploy/types' + +import { getDeploymentName } from './lib/utils' + +const logger = consola.create({}) + +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { + const deploy = (name: string, options: DeployOptions) => hre.deployments.deploy(name, options) + const { deployer } = await hre.getNamedAccounts() + + // Deploy the master copy of GraphTokenLockWallet + logger.info('Deploying L2GraphTokenLockWallet master copy...') + const masterCopySaveName = await getDeploymentName('L2GraphTokenLockWallet') + await deploy(masterCopySaveName, { + from: deployer, + log: true, + contract: 'L2GraphTokenLockWallet', + }) +} + +func.tags = ['l2-wallet', 'l2'] + +export default func diff --git a/packages/token-distribution/deploy/4_l1_transfer_tool.ts b/packages/token-distribution/deploy/4_l1_transfer_tool.ts new file mode 100644 index 000000000..125483f56 --- /dev/null +++ b/packages/token-distribution/deploy/4_l1_transfer_tool.ts @@ -0,0 +1,78 @@ +import consola from 'consola' + +import '@nomiclabs/hardhat-ethers' +import { HardhatRuntimeEnvironment } from 'hardhat/types' +import { DeployFunction } from 'hardhat-deploy/types' + +import { getDeploymentName, promptContractAddress } from './lib/utils' +import { ethers, upgrades } from 'hardhat' +import { L1GraphTokenLockTransferTool } from '../build/typechain/contracts/L1GraphTokenLockTransferTool' +import path from 'path' +import { Artifacts } from 'hardhat/internal/artifacts' + +const logger = consola.create({}) + +const ARTIFACTS_PATH = path.resolve('build/artifacts') +const artifacts = new Artifacts(ARTIFACTS_PATH) +const l1TransferToolAbi = artifacts.readArtifactSync('L1GraphTokenLockTransferTool').abi + +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { + const { deployer } = await hre.getNamedAccounts() + + // Get the addresses we will use + const tokenAddress = await promptContractAddress('L1 GRT', logger) + if (!tokenAddress) { + logger.warn('No token address provided') + process.exit(1) + } + + const l2Implementation = await promptContractAddress('L2GraphTokenLockWallet implementation', logger) + if (!l2Implementation) { + logger.warn('No L2 implementation address provided') + process.exit(1) + } + + const l1Gateway = await promptContractAddress('L1 token gateway', logger) + if (!l1Gateway) { + logger.warn('No L1 gateway address provided') + process.exit(1) + } + + const l1Staking = await promptContractAddress('L1 Staking', logger) + if (!l1Staking) { + logger.warn('No L1 Staking address provided') + process.exit(1) + } + + let owner = await promptContractAddress('owner (optional)', logger) + if (!owner) { + owner = deployer + logger.warn(`No owner address provided, will use the deployer address as owner: ${owner}`) + } + + // Deploy the L1GraphTokenLockTransferTool with a proxy. + // hardhat-deploy doesn't get along with constructor arguments in the implementation + // combined with an OpenZeppelin transparent proxy, so we need to do this using + // the OpenZeppelin hardhat-upgrades tooling, and save the deployment manually. + + // TODO modify this to use upgradeProxy if a deployment already exists? + logger.info('Deploying L1GraphTokenLockTransferTool proxy...') + const transferToolFactory = await ethers.getContractFactory('L1GraphTokenLockTransferTool') + const transferTool = (await upgrades.deployProxy(transferToolFactory, [owner], { + kind: 'transparent', + unsafeAllow: ['state-variable-immutable', 'constructor'], + constructorArgs: [tokenAddress, l2Implementation, l1Gateway, l1Staking], + })) as L1GraphTokenLockTransferTool + + // Save the deployment + const deploymentName = await getDeploymentName('L1GraphTokenLockTransferTool') + await hre.deployments.save(deploymentName, { + abi: l1TransferToolAbi, + address: transferTool.address, + transactionHash: transferTool.deployTransaction.hash, + }) +} + +func.tags = ['l1', 'l1-transfer-tool'] + +export default func diff --git a/packages/token-distribution/deploy/5_l2_manager.ts b/packages/token-distribution/deploy/5_l2_manager.ts new file mode 100644 index 000000000..93016663f --- /dev/null +++ b/packages/token-distribution/deploy/5_l2_manager.ts @@ -0,0 +1,79 @@ +import consola from 'consola' +import { utils } from 'ethers' + +import '@nomiclabs/hardhat-ethers' +import { HardhatRuntimeEnvironment } from 'hardhat/types' +import { DeployFunction, DeployOptions } from 'hardhat-deploy/types' + +import { GraphTokenMock } from '../build/typechain/contracts/GraphTokenMock' +import { askConfirm, getDeploymentName, promptContractAddress } from './lib/utils' +import { L2GraphTokenLockManager } from '../build/typechain/contracts/L2GraphTokenLockManager' + +const { parseEther, formatEther } = utils + +const logger = consola.create({}) + +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { + const deploy = (name: string, options: DeployOptions) => hre.deployments.deploy(name, options) + const { deployer } = await hre.getNamedAccounts() + + // -- Graph Token -- + + // Get the token address we will use + const tokenAddress = await promptContractAddress('L2 GRT', logger) + if (!tokenAddress) { + logger.warn('No token address provided') + process.exit(1) + } + + const l2Gateway = await promptContractAddress('L2 Gateway', logger) + if (!l2Gateway) { + logger.warn('No L2 Gateway address provided') + process.exit(1) + } + + const l1TransferTool = await promptContractAddress('L1 Transfer Tool', logger) + if (!l1TransferTool) { + logger.warn('No L1 Transfer Tool address provided') + process.exit(1) + } + + // -- L2 Token Lock Manager -- + // Get the deployed L2GraphTokenLockWallet master copy address + const masterCopyDeploy = await hre.deployments.get('L2GraphTokenLockWallet') + + logger.info(`Using L2GraphTokenLockWallet at address: ${masterCopyDeploy.address}`) + // Deploy the Manager that uses the master copy to clone contracts + logger.info('Deploying L2GraphTokenLockManager...') + const managerSaveName = await getDeploymentName('L2GraphTokenLockManager') + const managerDeploy = await deploy(managerSaveName, { + from: deployer, + args: [tokenAddress, masterCopyDeploy.address, l2Gateway, l1TransferTool], + log: true, + contract: 'L2GraphTokenLockManager', + }) + + // -- Fund -- + + if (await askConfirm('Do you want to fund the L2 manager?')) { + const fundAmount = parseEther('100000000') + logger.info(`Funding ${managerDeploy.address} with ${formatEther(fundAmount)} GRT...`) + + // Approve + const grt = (await hre.ethers.getContractAt('GraphTokenMock', tokenAddress)) as GraphTokenMock + await grt.approve(managerDeploy.address, fundAmount) + + // Deposit + const manager = (await hre.ethers.getContractAt( + 'L2GraphTokenLockManager', + managerDeploy.address, + )) as L2GraphTokenLockManager + await manager.deposit(fundAmount) + + logger.success('Done!') + } +} + +func.tags = ['l2-manager', 'l2'] + +export default func diff --git a/packages/token-distribution/deploy/6_l2_transfer_tool.ts b/packages/token-distribution/deploy/6_l2_transfer_tool.ts new file mode 100644 index 000000000..f449ebe84 --- /dev/null +++ b/packages/token-distribution/deploy/6_l2_transfer_tool.ts @@ -0,0 +1,66 @@ +import consola from 'consola' + +import '@nomiclabs/hardhat-ethers' +import { HardhatRuntimeEnvironment } from 'hardhat/types' +import { DeployFunction } from 'hardhat-deploy/types' + +import { getDeploymentName, promptContractAddress } from './lib/utils' +import { ethers, upgrades } from 'hardhat' +import { L1GraphTokenLockTransferTool } from '../build/typechain/contracts/L1GraphTokenLockTransferTool' +import path from 'path' +import { Artifacts } from 'hardhat/internal/artifacts' + +const logger = consola.create({}) + +const ARTIFACTS_PATH = path.resolve('build/artifacts') +const artifacts = new Artifacts(ARTIFACTS_PATH) +const l2TransferToolAbi = artifacts.readArtifactSync('L2GraphTokenLockTransferTool').abi + +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { + // -- Graph Token -- + + // Get the addresses we will use + const tokenAddress = await promptContractAddress('L2 GRT', logger) + if (!tokenAddress) { + logger.warn('No token address provided') + process.exit(1) + } + + const l2Gateway = await promptContractAddress('L2 token gateway', logger) + if (!l2Gateway) { + logger.warn('No L2 gateway address provided') + process.exit(1) + } + + const l1Token = await promptContractAddress('L1 GRT', logger) + if (!l1Token) { + logger.warn('No L1 GRT address provided') + process.exit(1) + } + + // Deploy the L2GraphTokenLockTransferTool with a proxy. + // hardhat-deploy doesn't get along with constructor arguments in the implementation + // combined with an OpenZeppelin transparent proxy, so we need to do this using + // the OpenZeppelin hardhat-upgrades tooling, and save the deployment manually. + + // TODO modify this to use upgradeProxy if a deployment already exists? + logger.info('Deploying L2GraphTokenLockTransferTool proxy...') + const transferToolFactory = await ethers.getContractFactory('L2GraphTokenLockTransferTool') + const transferTool = (await upgrades.deployProxy(transferToolFactory, [], { + kind: 'transparent', + unsafeAllow: ['state-variable-immutable', 'constructor'], + constructorArgs: [tokenAddress, l2Gateway, l1Token], + })) as L1GraphTokenLockTransferTool + + // Save the deployment + const deploymentName = await getDeploymentName('L2GraphTokenLockTransferTool') + await hre.deployments.save(deploymentName, { + abi: l2TransferToolAbi, + address: transferTool.address, + transactionHash: transferTool.deployTransaction.hash, + }) +} + +func.tags = ['l2', 'l2-transfer-tool'] + +export default func diff --git a/packages/token-distribution/deploy/lib/utils.ts b/packages/token-distribution/deploy/lib/utils.ts new file mode 100644 index 000000000..afc38555b --- /dev/null +++ b/packages/token-distribution/deploy/lib/utils.ts @@ -0,0 +1,41 @@ +import { Consola } from 'consola' +import inquirer from 'inquirer' +import { utils } from 'ethers' + +import '@nomiclabs/hardhat-ethers' + +const { getAddress } = utils + +export const askConfirm = async (message: string) => { + const res = await inquirer.prompt({ + name: 'confirm', + type: 'confirm', + message, + }) + return res.confirm ? res.confirm as boolean : false +} + +export const promptContractAddress = async (name: string, logger: Consola): Promise => { + const res1 = await inquirer.prompt({ + name: 'contract', + type: 'input', + message: `What is the ${name} address?`, + }) + + try { + return getAddress(res1.contract) + } catch (err) { + logger.error(err) + return null + } +} + +export const getDeploymentName = async (defaultName: string): Promise => { + const res = await inquirer.prompt({ + name: 'deployment-name', + type: 'input', + default: defaultName, + message: 'Save deployment as?', + }) + return res['deployment-name'] as string +} diff --git a/packages/token-distribution/deployments/arbitrum-goerli/.chainId b/packages/token-distribution/deployments/arbitrum-goerli/.chainId new file mode 100644 index 000000000..16be23a37 --- /dev/null +++ b/packages/token-distribution/deployments/arbitrum-goerli/.chainId @@ -0,0 +1 @@ +421613 \ No newline at end of file diff --git a/packages/token-distribution/deployments/arbitrum-goerli/L2GraphTokenLockManager-Testnet.json b/packages/token-distribution/deployments/arbitrum-goerli/L2GraphTokenLockManager-Testnet.json new file mode 100644 index 000000000..a26292a14 --- /dev/null +++ b/packages/token-distribution/deployments/arbitrum-goerli/L2GraphTokenLockManager-Testnet.json @@ -0,0 +1,1161 @@ +{ + "address": "0xF3b617e0c966329363e78c266361794e84223313", + "abi": [ + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_graphToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_masterCopy", + "type": "address" + }, + { + "internalType": "address", + "name": "_l2Gateway", + "type": "address" + }, + { + "internalType": "address", + "name": "_l1TransferTool", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes4", + "name": "sigHash", + "type": "bytes4" + }, + { + "indexed": true, + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "indexed": false, + "internalType": "string", + "name": "signature", + "type": "string" + } + ], + "name": "FunctionCallAuth", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "l1Address", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "l2Address", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "LockedTokensReceivedFromL1", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "masterCopy", + "type": "address" + } + ], + "name": "MasterCopyUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "proxy", + "type": "address" + } + ], + "name": "ProxyCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "dst", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "TokenDestinationAllowed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "contractAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "initHash", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "managedAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "startTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "endTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "periods", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "releaseStartTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "vestingCliffTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "enum IGraphTokenLock.Revocability", + "name": "revocable", + "type": "uint8" + } + ], + "name": "TokenLockCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "contractAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "initHash", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "managedAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "startTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "endTime", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "l1Address", + "type": "address" + } + ], + "name": "TokenLockCreatedFromL1", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensDeposited", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensWithdrawn", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_dst", + "type": "address" + } + ], + "name": "addTokenDestination", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "", + "type": "bytes4" + } + ], + "name": "authFnCalls", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_owner", + "type": "address" + }, + { + "internalType": "address", + "name": "_beneficiary", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_managedAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_startTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_endTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_periods", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_releaseStartTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_vestingCliffTime", + "type": "uint256" + }, + { + "internalType": "enum IGraphTokenLock.Revocability", + "name": "_revocable", + "type": "uint8" + } + ], + "name": "createTokenLockWallet", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "deposit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_sigHash", + "type": "bytes4" + } + ], + "name": "getAuthFunctionCallTarget", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_salt", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "_implementation", + "type": "address" + }, + { + "internalType": "address", + "name": "_deployer", + "type": "address" + } + ], + "name": "getDeploymentAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "getTokenDestinations", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_sigHash", + "type": "bytes4" + } + ], + "name": "isAuthFunctionCall", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_dst", + "type": "address" + } + ], + "name": "isTokenDestination", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "l1TransferTool", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "l1WalletToL2Wallet", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "l2Gateway", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "l2WalletToL1Wallet", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "masterCopy", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_from", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "onTokenTransfer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_dst", + "type": "address" + } + ], + "name": "removeTokenDestination", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_signature", + "type": "string" + }, + { + "internalType": "address", + "name": "_target", + "type": "address" + } + ], + "name": "setAuthFunctionCall", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string[]", + "name": "_signatures", + "type": "string[]" + }, + { + "internalType": "address[]", + "name": "_targets", + "type": "address[]" + } + ], + "name": "setAuthFunctionCallMany", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_masterCopy", + "type": "address" + } + ], + "name": "setMasterCopy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "token", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_signature", + "type": "string" + } + ], + "name": "unsetAuthFunctionCall", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x2bb1e86bcd24dde8f082234f452f48613cacf5f8ed49b7e7754ad12b94e819ac", + "receipt": { + "to": null, + "from": "0xB15599AC1261C4828Ac7E66383ae520655d3D300", + "contractAddress": "0xF3b617e0c966329363e78c266361794e84223313", + "transactionIndex": 1, + "gasUsed": "3854618", + "logsBloom": "0x00000000000000000000000000020000000004010000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000400000000000040000020000000000000000000800000000000000000001000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000010000000000002000000002000000000000000000000000000000000000000000000000000000000020000020000000000000000000000000000000000000000000000000100000000000000000", + "blockHash": "0x17ed68b2e729840cca04decf7c536a25530754b7b536028e9e900c538bac6fe6", + "transactionHash": "0x2bb1e86bcd24dde8f082234f452f48613cacf5f8ed49b7e7754ad12b94e819ac", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 30437370, + "transactionHash": "0x2bb1e86bcd24dde8f082234f452f48613cacf5f8ed49b7e7754ad12b94e819ac", + "address": "0xF3b617e0c966329363e78c266361794e84223313", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000b15599ac1261c4828ac7e66383ae520655d3d300" + ], + "data": "0x", + "logIndex": 0, + "blockHash": "0x17ed68b2e729840cca04decf7c536a25530754b7b536028e9e900c538bac6fe6" + }, + { + "transactionIndex": 1, + "blockNumber": 30437370, + "transactionHash": "0x2bb1e86bcd24dde8f082234f452f48613cacf5f8ed49b7e7754ad12b94e819ac", + "address": "0xF3b617e0c966329363e78c266361794e84223313", + "topics": [ + "0x30909084afc859121ffc3a5aef7fe37c540a9a1ef60bd4d8dcdb76376fadf9de", + "0x000000000000000000000000c93df24c3a1ebeccd0e5d41198460081cfb38c49" + ], + "data": "0x", + "logIndex": 1, + "blockHash": "0x17ed68b2e729840cca04decf7c536a25530754b7b536028e9e900c538bac6fe6" + } + ], + "blockNumber": 30437370, + "cumulativeGasUsed": "3854618", + "status": 1, + "byzantium": true + }, + "args": [ + "0x18C924BD5E8b83b47EFaDD632b7178E2Fd36073D", + "0xc93df24c3A1ebeCcd0e5D41198460081CFB38c49", + "0xef2757855d2802bA53733901F90C91645973f743", + "0xa725CF32c367778CFF2ba7089Ab4e941BDD88612" + ], + "solcInputHash": "b5cdad58099d39cd1aed000b2fd864d8", + "metadata": "{\"compiler\":{\"version\":\"0.7.3+commit.9bfce1f6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"_graphToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_masterCopy\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_l2Gateway\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_l1TransferTool\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes4\",\"name\":\"sigHash\",\"type\":\"bytes4\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"signature\",\"type\":\"string\"}],\"name\":\"FunctionCallAuth\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"l1Address\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"l2Address\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"LockedTokensReceivedFromL1\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"masterCopy\",\"type\":\"address\"}],\"name\":\"MasterCopyUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"proxy\",\"type\":\"address\"}],\"name\":\"ProxyCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dst\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"}],\"name\":\"TokenDestinationAllowed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"contractAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"initHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"managedAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"startTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"endTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"periods\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"releaseStartTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"vestingCliffTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"enum IGraphTokenLock.Revocability\",\"name\":\"revocable\",\"type\":\"uint8\"}],\"name\":\"TokenLockCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"contractAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"initHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"managedAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"startTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"endTime\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"l1Address\",\"type\":\"address\"}],\"name\":\"TokenLockCreatedFromL1\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensWithdrawn\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_dst\",\"type\":\"address\"}],\"name\":\"addTokenDestination\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"name\":\"authFnCalls\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_beneficiary\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_managedAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_startTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_endTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_periods\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_releaseStartTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_vestingCliffTime\",\"type\":\"uint256\"},{\"internalType\":\"enum IGraphTokenLock.Revocability\",\"name\":\"_revocable\",\"type\":\"uint8\"}],\"name\":\"createTokenLockWallet\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"deposit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"_sigHash\",\"type\":\"bytes4\"}],\"name\":\"getAuthFunctionCallTarget\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_salt\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_deployer\",\"type\":\"address\"}],\"name\":\"getDeploymentAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTokenDestinations\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"_sigHash\",\"type\":\"bytes4\"}],\"name\":\"isAuthFunctionCall\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_dst\",\"type\":\"address\"}],\"name\":\"isTokenDestination\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"l1TransferTool\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"l1WalletToL2Wallet\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"l2Gateway\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"l2WalletToL1Wallet\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"masterCopy\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_from\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"onTokenTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_dst\",\"type\":\"address\"}],\"name\":\"removeTokenDestination\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_signature\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"_target\",\"type\":\"address\"}],\"name\":\"setAuthFunctionCall\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string[]\",\"name\":\"_signatures\",\"type\":\"string[]\"},{\"internalType\":\"address[]\",\"name\":\"_targets\",\"type\":\"address[]\"}],\"name\":\"setAuthFunctionCallMany\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_masterCopy\",\"type\":\"address\"}],\"name\":\"setMasterCopy\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_signature\",\"type\":\"string\"}],\"name\":\"unsetAuthFunctionCall\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"events\":{\"LockedTokensReceivedFromL1(address,address,uint256)\":{\"details\":\"Emitted when locked tokens are received from L1 (whether the wallet had already been received or not)\"},\"TokenLockCreatedFromL1(address,bytes32,address,uint256,uint256,uint256,address)\":{\"details\":\"Event emitted when a wallet is received and created from L1\"}},\"kind\":\"dev\",\"methods\":{\"addTokenDestination(address)\":{\"params\":{\"_dst\":\"Destination address\"}},\"constructor\":{\"params\":{\"_graphToken\":\"Address of the L2 GRT token contract\",\"_l1TransferTool\":\"Address of the L1 transfer tool contract (in L1, without aliasing)\",\"_l2Gateway\":\"Address of the L2GraphTokenGateway contract\",\"_masterCopy\":\"Address of the master copy of the L2GraphTokenLockWallet implementation\"}},\"createTokenLockWallet(address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)\":{\"params\":{\"_beneficiary\":\"Address of the beneficiary of locked tokens\",\"_endTime\":\"End time of the release schedule\",\"_managedAmount\":\"Amount of tokens to be managed by the lock contract\",\"_owner\":\"Address of the contract owner\",\"_periods\":\"Number of periods between start time and end time\",\"_releaseStartTime\":\"Override time for when the releases start\",\"_revocable\":\"Whether the contract is revocable\",\"_startTime\":\"Start time of the release schedule\"}},\"deposit(uint256)\":{\"details\":\"Even if the ERC20 token can be transferred directly to the contract this function provide a safe interface to do the transfer and avoid mistakes\",\"params\":{\"_amount\":\"Amount to deposit\"}},\"getAuthFunctionCallTarget(bytes4)\":{\"params\":{\"_sigHash\":\"Function signature hash\"},\"returns\":{\"_0\":\"Address of the target contract where to send the call\"}},\"getDeploymentAddress(bytes32,address,address)\":{\"params\":{\"_deployer\":\"Address of the deployer that creates the contract\",\"_implementation\":\"Address of the proxy target implementation\",\"_salt\":\"Bytes32 salt to use for CREATE2\"},\"returns\":{\"_0\":\"Address of the counterfactual MinimalProxy\"}},\"getTokenDestinations()\":{\"returns\":{\"_0\":\"Array of addresses authorized to pull funds from a token lock\"}},\"isAuthFunctionCall(bytes4)\":{\"params\":{\"_sigHash\":\"Function signature hash\"},\"returns\":{\"_0\":\"True if authorized\"}},\"isTokenDestination(address)\":{\"params\":{\"_dst\":\"Destination address\"},\"returns\":{\"_0\":\"True if authorized\"}},\"onTokenTransfer(address,uint256,bytes)\":{\"details\":\"This function will create a new wallet if it doesn't exist yet, or send the tokens to the existing wallet if it does.\",\"params\":{\"_amount\":\"Amount of tokens received\",\"_data\":\"Encoded data of the transferred wallet, which must be an ABI-encoded TransferredWalletData struct\",\"_from\":\"Address of the sender in L1, which must be the L1GraphTokenLockTransferTool\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"removeTokenDestination(address)\":{\"params\":{\"_dst\":\"Destination address\"}},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"setAuthFunctionCall(string,address)\":{\"details\":\"Input expected is the function signature as 'transfer(address,uint256)'\",\"params\":{\"_signature\":\"Function signature\",\"_target\":\"Address of the destination contract to call\"}},\"setAuthFunctionCallMany(string[],address[])\":{\"details\":\"Input expected is the function signature as 'transfer(address,uint256)'\",\"params\":{\"_signatures\":\"Function signatures\",\"_targets\":\"Address of the destination contract to call\"}},\"setMasterCopy(address)\":{\"params\":{\"_masterCopy\":\"Address of contract bytecode to factory clone\"}},\"token()\":{\"returns\":{\"_0\":\"Token used for transfers and approvals\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"unsetAuthFunctionCall(string)\":{\"details\":\"Input expected is the function signature as 'transfer(address,uint256)'\",\"params\":{\"_signature\":\"Function signature\"}},\"withdraw(uint256)\":{\"details\":\"Escape hatch in case of mistakes or to recover remaining funds\",\"params\":{\"_amount\":\"Amount of tokens to withdraw\"}}},\"title\":\"L2GraphTokenLockManager\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"addTokenDestination(address)\":{\"notice\":\"Adds an address that can be allowed by a token lock to pull funds\"},\"constructor\":{\"notice\":\"Constructor for the L2GraphTokenLockManager contract.\"},\"createTokenLockWallet(address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)\":{\"notice\":\"Creates and fund a new token lock wallet using a minimum proxy\"},\"deposit(uint256)\":{\"notice\":\"Deposits tokens into the contract\"},\"getAuthFunctionCallTarget(bytes4)\":{\"notice\":\"Gets the target contract to call for a particular function signature\"},\"getDeploymentAddress(bytes32,address,address)\":{\"notice\":\"Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation\"},\"getTokenDestinations()\":{\"notice\":\"Returns an array of authorized destination addresses\"},\"isAuthFunctionCall(bytes4)\":{\"notice\":\"Returns true if the function call is authorized\"},\"isTokenDestination(address)\":{\"notice\":\"Returns True if the address is authorized to be a destination of tokens\"},\"l1TransferTool()\":{\"notice\":\"Address of the L1 transfer tool contract (in L1, no aliasing)\"},\"l1WalletToL2Wallet(address)\":{\"notice\":\"Mapping of each L1 wallet to its L2 wallet counterpart (populated when each wallet is received) L1 address => L2 address\"},\"l2Gateway()\":{\"notice\":\"Address of the L2GraphTokenGateway\"},\"l2WalletToL1Wallet(address)\":{\"notice\":\"Mapping of each L2 wallet to its L1 wallet counterpart (populated when each wallet is received) L2 address => L1 address\"},\"onTokenTransfer(address,uint256,bytes)\":{\"notice\":\"This function is called by the L2GraphTokenGateway when tokens are sent from L1.\"},\"removeTokenDestination(address)\":{\"notice\":\"Removes an address that can be allowed by a token lock to pull funds\"},\"setAuthFunctionCall(string,address)\":{\"notice\":\"Sets an authorized function call to target\"},\"setAuthFunctionCallMany(string[],address[])\":{\"notice\":\"Sets an authorized function call to target in bulk\"},\"setMasterCopy(address)\":{\"notice\":\"Sets the masterCopy bytecode to use to create clones of TokenLock contracts\"},\"token()\":{\"notice\":\"Gets the GRT token address\"},\"unsetAuthFunctionCall(string)\":{\"notice\":\"Unsets an authorized function call to target\"},\"withdraw(uint256)\":{\"notice\":\"Withdraws tokens from the contract\"}},\"notice\":\"This contract manages a list of authorized function calls and targets that can be called by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts. This contract receives funds to make the process of creating TokenLockWallet contracts easier by distributing them the initial tokens to be managed. In particular, this L2 variant is designed to receive token lock wallets from L1, through the GRT bridge. These transferred wallets will not allow releasing funds in L2 until the end of the vesting timeline, but they can allow withdrawing funds back to L1 using the L2GraphTokenLockTransferTool contract. The owner can setup a list of token destinations that will be used by TokenLock contracts to approve the pulling of funds, this way in can be guaranteed that only protocol contracts will manipulate users funds.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/L2GraphTokenLockManager.sol\":\"L2GraphTokenLockManager\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor () internal {\\n address msgSender = _msgSender();\\n _owner = msgSender;\\n emit OwnershipTransferred(address(0), msgSender);\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n emit OwnershipTransferred(_owner, address(0));\\n _owner = address(0);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n emit OwnershipTransferred(_owner, newOwner);\\n _owner = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0x15e2d5bd4c28a88548074c54d220e8086f638a71ed07e6b3ba5a70066fcf458d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/math/SafeMath.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Wrappers over Solidity's arithmetic operations with added overflow\\n * checks.\\n *\\n * Arithmetic operations in Solidity wrap on overflow. This can easily result\\n * in bugs, because programmers usually assume that an overflow raises an\\n * error, which is the standard behavior in high level programming languages.\\n * `SafeMath` restores this intuition by reverting the transaction when an\\n * operation overflows.\\n *\\n * Using this library instead of the unchecked operations eliminates an entire\\n * class of bugs, so it's recommended to use it always.\\n */\\nlibrary SafeMath {\\n /**\\n * @dev Returns the addition of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n uint256 c = a + b;\\n if (c < a) return (false, 0);\\n return (true, c);\\n }\\n\\n /**\\n * @dev Returns the substraction of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b > a) return (false, 0);\\n return (true, a - b);\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\\n if (a == 0) return (true, 0);\\n uint256 c = a * b;\\n if (c / a != b) return (false, 0);\\n return (true, c);\\n }\\n\\n /**\\n * @dev Returns the division of two unsigned integers, with a division by zero flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b == 0) return (false, 0);\\n return (true, a / b);\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b == 0) return (false, 0);\\n return (true, a % b);\\n }\\n\\n /**\\n * @dev Returns the addition of two unsigned integers, reverting on\\n * overflow.\\n *\\n * Counterpart to Solidity's `+` operator.\\n *\\n * Requirements:\\n *\\n * - Addition cannot overflow.\\n */\\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\\n uint256 c = a + b;\\n require(c >= a, \\\"SafeMath: addition overflow\\\");\\n return c;\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting on\\n * overflow (when the result is negative).\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n *\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b <= a, \\\"SafeMath: subtraction overflow\\\");\\n return a - b;\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, reverting on\\n * overflow.\\n *\\n * Counterpart to Solidity's `*` operator.\\n *\\n * Requirements:\\n *\\n * - Multiplication cannot overflow.\\n */\\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\\n if (a == 0) return 0;\\n uint256 c = a * b;\\n require(c / a == b, \\\"SafeMath: multiplication overflow\\\");\\n return c;\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers, reverting on\\n * division by zero. The result is rounded towards zero.\\n *\\n * Counterpart to Solidity's `/` operator. Note: this function uses a\\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\\n * uses an invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b > 0, \\\"SafeMath: division by zero\\\");\\n return a / b;\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * reverting when dividing by zero.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b > 0, \\\"SafeMath: modulo by zero\\\");\\n return a % b;\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\\n * overflow (when the result is negative).\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {trySub}.\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n *\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b <= a, errorMessage);\\n return a - b;\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers, reverting with custom message on\\n * division by zero. The result is rounded towards zero.\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {tryDiv}.\\n *\\n * Counterpart to Solidity's `/` operator. Note: this function uses a\\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\\n * uses an invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b > 0, errorMessage);\\n return a / b;\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * reverting with custom message when dividing by zero.\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {tryMod}.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b > 0, errorMessage);\\n return a % b;\\n }\\n}\\n\",\"keccak256\":\"0xcc78a17dd88fa5a2edc60c8489e2f405c0913b377216a5b26b35656b2d0dab52\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `recipient`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address recipient, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `sender` to `recipient` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n}\\n\",\"keccak256\":\"0x5f02220344881ce43204ae4a6281145a67bc52c2bb1290a791857df3d19d78f5\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\nimport \\\"./IERC20.sol\\\";\\nimport \\\"../../math/SafeMath.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @title SafeERC20\\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\\n * contract returns false). Tokens that return no value (and instead revert or\\n * throw on failure) are also supported, non-reverting calls are assumed to be\\n * successful.\\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\n */\\nlibrary SafeERC20 {\\n using SafeMath for uint256;\\n using Address for address;\\n\\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\\n }\\n\\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\\n }\\n\\n /**\\n * @dev Deprecated. This function has issues similar to the ones found in\\n * {IERC20-approve}, and its usage is discouraged.\\n *\\n * Whenever possible, use {safeIncreaseAllowance} and\\n * {safeDecreaseAllowance} instead.\\n */\\n function safeApprove(IERC20 token, address spender, uint256 value) internal {\\n // safeApprove should only be called when setting an initial allowance,\\n // or when resetting it to zero. To increase and decrease it, use\\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\\n // solhint-disable-next-line max-line-length\\n require((value == 0) || (token.allowance(address(this), spender) == 0),\\n \\\"SafeERC20: approve from non-zero to non-zero allowance\\\"\\n );\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\\n }\\n\\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n uint256 newAllowance = token.allowance(address(this), spender).add(value);\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n uint256 newAllowance = token.allowance(address(this), spender).sub(value, \\\"SafeERC20: decreased allowance below zero\\\");\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n */\\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that\\n // the target address contains contract code and also asserts for success in the low-level call.\\n\\n bytes memory returndata = address(token).functionCall(data, \\\"SafeERC20: low-level call failed\\\");\\n if (returndata.length > 0) { // Return data is optional\\n // solhint-disable-next-line max-line-length\\n require(abi.decode(returndata, (bool)), \\\"SafeERC20: ERC20 operation did not succeed\\\");\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf12dfbe97e6276980b83d2830bb0eb75e0cf4f3e626c2471137f82158ae6a0fc\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.2 <0.8.0;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize, which returns 0 for contracts in\\n // construction, since the code is only stored at the end of the\\n // constructor execution.\\n\\n uint256 size;\\n // solhint-disable-next-line no-inline-assembly\\n assembly { size := extcodesize(account) }\\n return size > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls, avoid-call-value\\n (bool success, ) = recipient.call{ value: amount }(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain`call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.call{ value: value }(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x28911e614500ae7c607a432a709d35da25f3bc5ddc8bd12b278b66358070c0ea\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/*\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with GSN meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address payable) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes memory) {\\n this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0x8d3cb350f04ff49cfb10aef08d87f19dcbaecc8027b0bed12f3275cd12f38cf0\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Create2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Helper to make usage of the `CREATE2` EVM opcode easier and safer.\\n * `CREATE2` can be used to compute in advance the address where a smart\\n * contract will be deployed, which allows for interesting new mechanisms known\\n * as 'counterfactual interactions'.\\n *\\n * See the https://eips.ethereum.org/EIPS/eip-1014#motivation[EIP] for more\\n * information.\\n */\\nlibrary Create2 {\\n /**\\n * @dev Deploys a contract using `CREATE2`. The address where the contract\\n * will be deployed can be known in advance via {computeAddress}.\\n *\\n * The bytecode for a contract can be obtained from Solidity with\\n * `type(contractName).creationCode`.\\n *\\n * Requirements:\\n *\\n * - `bytecode` must not be empty.\\n * - `salt` must have not been used for `bytecode` already.\\n * - the factory must have a balance of at least `amount`.\\n * - if `amount` is non-zero, `bytecode` must have a `payable` constructor.\\n */\\n function deploy(uint256 amount, bytes32 salt, bytes memory bytecode) internal returns (address) {\\n address addr;\\n require(address(this).balance >= amount, \\\"Create2: insufficient balance\\\");\\n require(bytecode.length != 0, \\\"Create2: bytecode length is zero\\\");\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n addr := create2(amount, add(bytecode, 0x20), mload(bytecode), salt)\\n }\\n require(addr != address(0), \\\"Create2: Failed on deploy\\\");\\n return addr;\\n }\\n\\n /**\\n * @dev Returns the address where a contract will be stored if deployed via {deploy}. Any change in the\\n * `bytecodeHash` or `salt` will result in a new destination address.\\n */\\n function computeAddress(bytes32 salt, bytes32 bytecodeHash) internal view returns (address) {\\n return computeAddress(salt, bytecodeHash, address(this));\\n }\\n\\n /**\\n * @dev Returns the address where a contract will be stored if deployed via {deploy} from a contract located at\\n * `deployer`. If `deployer` is this contract's address, returns the same value as {computeAddress}.\\n */\\n function computeAddress(bytes32 salt, bytes32 bytecodeHash, address deployer) internal pure returns (address) {\\n bytes32 _data = keccak256(\\n abi.encodePacked(bytes1(0xff), deployer, salt, bytecodeHash)\\n );\\n return address(uint160(uint256(_data)));\\n }\\n}\\n\",\"keccak256\":\"0x0a0b021149946014fe1cd04af11e7a937a29986c47e8b1b718c2d50d729472db\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/EnumerableSet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Library for managing\\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\\n * types.\\n *\\n * Sets have the following properties:\\n *\\n * - Elements are added, removed, and checked for existence in constant time\\n * (O(1)).\\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\\n *\\n * ```\\n * contract Example {\\n * // Add the library methods\\n * using EnumerableSet for EnumerableSet.AddressSet;\\n *\\n * // Declare a set state variable\\n * EnumerableSet.AddressSet private mySet;\\n * }\\n * ```\\n *\\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\\n * and `uint256` (`UintSet`) are supported.\\n */\\nlibrary EnumerableSet {\\n // To implement this library for multiple types with as little code\\n // repetition as possible, we write it in terms of a generic Set type with\\n // bytes32 values.\\n // The Set implementation uses private functions, and user-facing\\n // implementations (such as AddressSet) are just wrappers around the\\n // underlying Set.\\n // This means that we can only create new EnumerableSets for types that fit\\n // in bytes32.\\n\\n struct Set {\\n // Storage of set values\\n bytes32[] _values;\\n\\n // Position of the value in the `values` array, plus 1 because index 0\\n // means a value is not in the set.\\n mapping (bytes32 => uint256) _indexes;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function _add(Set storage set, bytes32 value) private returns (bool) {\\n if (!_contains(set, value)) {\\n set._values.push(value);\\n // The value is stored at length-1, but we add 1 to all indexes\\n // and use 0 as a sentinel value\\n set._indexes[value] = set._values.length;\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function _remove(Set storage set, bytes32 value) private returns (bool) {\\n // We read and store the value's index to prevent multiple reads from the same storage slot\\n uint256 valueIndex = set._indexes[value];\\n\\n if (valueIndex != 0) { // Equivalent to contains(set, value)\\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\\n // the array, and then remove the last element (sometimes called as 'swap and pop').\\n // This modifies the order of the array, as noted in {at}.\\n\\n uint256 toDeleteIndex = valueIndex - 1;\\n uint256 lastIndex = set._values.length - 1;\\n\\n // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs\\n // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.\\n\\n bytes32 lastvalue = set._values[lastIndex];\\n\\n // Move the last value to the index where the value to delete is\\n set._values[toDeleteIndex] = lastvalue;\\n // Update the index for the moved value\\n set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based\\n\\n // Delete the slot where the moved value was stored\\n set._values.pop();\\n\\n // Delete the index for the deleted slot\\n delete set._indexes[value];\\n\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\\n return set._indexes[value] != 0;\\n }\\n\\n /**\\n * @dev Returns the number of values on the set. O(1).\\n */\\n function _length(Set storage set) private view returns (uint256) {\\n return set._values.length;\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\\n require(set._values.length > index, \\\"EnumerableSet: index out of bounds\\\");\\n return set._values[index];\\n }\\n\\n // Bytes32Set\\n\\n struct Bytes32Set {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _add(set._inner, value);\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _remove(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\\n return _contains(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(Bytes32Set storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\\n return _at(set._inner, index);\\n }\\n\\n // AddressSet\\n\\n struct AddressSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(AddressSet storage set, address value) internal returns (bool) {\\n return _add(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(AddressSet storage set, address value) internal returns (bool) {\\n return _remove(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(AddressSet storage set, address value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(AddressSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\\n return address(uint160(uint256(_at(set._inner, index))));\\n }\\n\\n\\n // UintSet\\n\\n struct UintSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(UintSet storage set, uint256 value) internal returns (bool) {\\n return _add(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\\n return _remove(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns the number of values on the set. O(1).\\n */\\n function length(UintSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\\n return uint256(_at(set._inner, index));\\n }\\n}\\n\",\"keccak256\":\"0x1562cd9922fbf739edfb979f506809e2743789cbde3177515542161c3d04b164\",\"license\":\"MIT\"},\"contracts/GraphTokenLock.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nimport \\\"@openzeppelin/contracts/math/SafeMath.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\\\";\\n\\nimport { Ownable as OwnableInitializable } from \\\"./Ownable.sol\\\";\\nimport \\\"./MathUtils.sol\\\";\\nimport \\\"./IGraphTokenLock.sol\\\";\\n\\n/**\\n * @title GraphTokenLock\\n * @notice Contract that manages an unlocking schedule of tokens.\\n * @dev The contract lock manage a number of tokens deposited into the contract to ensure that\\n * they can only be released under certain time conditions.\\n *\\n * This contract implements a release scheduled based on periods and tokens are released in steps\\n * after each period ends. It can be configured with one period in which case it is like a plain TimeLock.\\n * It also supports revocation to be used for vesting schedules.\\n *\\n * The contract supports receiving extra funds than the managed tokens ones that can be\\n * withdrawn by the beneficiary at any time.\\n *\\n * A releaseStartTime parameter is included to override the default release schedule and\\n * perform the first release on the configured time. After that it will continue with the\\n * default schedule.\\n */\\nabstract contract GraphTokenLock is OwnableInitializable, IGraphTokenLock {\\n using SafeMath for uint256;\\n using SafeERC20 for IERC20;\\n\\n uint256 private constant MIN_PERIOD = 1;\\n\\n // -- State --\\n\\n IERC20 public token;\\n address public beneficiary;\\n\\n // Configuration\\n\\n // Amount of tokens managed by the contract schedule\\n uint256 public managedAmount;\\n\\n uint256 public startTime; // Start datetime (in unixtimestamp)\\n uint256 public endTime; // Datetime after all funds are fully vested/unlocked (in unixtimestamp)\\n uint256 public periods; // Number of vesting/release periods\\n\\n // First release date for tokens (in unixtimestamp)\\n // If set, no tokens will be released before releaseStartTime ignoring\\n // the amount to release each period\\n uint256 public releaseStartTime;\\n // A cliff set a date to which a beneficiary needs to get to vest\\n // all preceding periods\\n uint256 public vestingCliffTime;\\n Revocability public revocable; // Whether to use vesting for locked funds\\n\\n // State\\n\\n bool public isRevoked;\\n bool public isInitialized;\\n bool public isAccepted;\\n uint256 public releasedAmount;\\n uint256 public revokedAmount;\\n\\n // -- Events --\\n\\n event TokensReleased(address indexed beneficiary, uint256 amount);\\n event TokensWithdrawn(address indexed beneficiary, uint256 amount);\\n event TokensRevoked(address indexed beneficiary, uint256 amount);\\n event BeneficiaryChanged(address newBeneficiary);\\n event LockAccepted();\\n event LockCanceled();\\n\\n /**\\n * @dev Only allow calls from the beneficiary of the contract\\n */\\n modifier onlyBeneficiary() {\\n require(msg.sender == beneficiary, \\\"!auth\\\");\\n _;\\n }\\n\\n /**\\n * @notice Initializes the contract\\n * @param _owner Address of the contract owner\\n * @param _beneficiary Address of the beneficiary of locked tokens\\n * @param _managedAmount Amount of tokens to be managed by the lock contract\\n * @param _startTime Start time of the release schedule\\n * @param _endTime End time of the release schedule\\n * @param _periods Number of periods between start time and end time\\n * @param _releaseStartTime Override time for when the releases start\\n * @param _vestingCliffTime Override time for when the vesting start\\n * @param _revocable Whether the contract is revocable\\n */\\n function _initialize(\\n address _owner,\\n address _beneficiary,\\n address _token,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n Revocability _revocable\\n ) internal {\\n require(!isInitialized, \\\"Already initialized\\\");\\n require(_owner != address(0), \\\"Owner cannot be zero\\\");\\n require(_beneficiary != address(0), \\\"Beneficiary cannot be zero\\\");\\n require(_token != address(0), \\\"Token cannot be zero\\\");\\n require(_managedAmount > 0, \\\"Managed tokens cannot be zero\\\");\\n require(_startTime != 0, \\\"Start time must be set\\\");\\n require(_startTime < _endTime, \\\"Start time > end time\\\");\\n require(_periods >= MIN_PERIOD, \\\"Periods cannot be below minimum\\\");\\n require(_revocable != Revocability.NotSet, \\\"Must set a revocability option\\\");\\n require(_releaseStartTime < _endTime, \\\"Release start time must be before end time\\\");\\n require(_vestingCliffTime < _endTime, \\\"Cliff time must be before end time\\\");\\n\\n isInitialized = true;\\n\\n OwnableInitializable._initialize(_owner);\\n beneficiary = _beneficiary;\\n token = IERC20(_token);\\n\\n managedAmount = _managedAmount;\\n\\n startTime = _startTime;\\n endTime = _endTime;\\n periods = _periods;\\n\\n // Optionals\\n releaseStartTime = _releaseStartTime;\\n vestingCliffTime = _vestingCliffTime;\\n revocable = _revocable;\\n }\\n\\n /**\\n * @notice Change the beneficiary of funds managed by the contract\\n * @dev Can only be called by the beneficiary\\n * @param _newBeneficiary Address of the new beneficiary address\\n */\\n function changeBeneficiary(address _newBeneficiary) external onlyBeneficiary {\\n require(_newBeneficiary != address(0), \\\"Empty beneficiary\\\");\\n beneficiary = _newBeneficiary;\\n emit BeneficiaryChanged(_newBeneficiary);\\n }\\n\\n /**\\n * @notice Beneficiary accepts the lock, the owner cannot retrieve back the tokens\\n * @dev Can only be called by the beneficiary\\n */\\n function acceptLock() external onlyBeneficiary {\\n isAccepted = true;\\n emit LockAccepted();\\n }\\n\\n /**\\n * @notice Owner cancel the lock and return the balance in the contract\\n * @dev Can only be called by the owner\\n */\\n function cancelLock() external onlyOwner {\\n require(isAccepted == false, \\\"Cannot cancel accepted contract\\\");\\n\\n token.safeTransfer(owner(), currentBalance());\\n\\n emit LockCanceled();\\n }\\n\\n // -- Balances --\\n\\n /**\\n * @notice Returns the amount of tokens currently held by the contract\\n * @return Tokens held in the contract\\n */\\n function currentBalance() public view override returns (uint256) {\\n return token.balanceOf(address(this));\\n }\\n\\n // -- Time & Periods --\\n\\n /**\\n * @notice Returns the current block timestamp\\n * @return Current block timestamp\\n */\\n function currentTime() public view override returns (uint256) {\\n return block.timestamp;\\n }\\n\\n /**\\n * @notice Gets duration of contract from start to end in seconds\\n * @return Amount of seconds from contract startTime to endTime\\n */\\n function duration() public view override returns (uint256) {\\n return endTime.sub(startTime);\\n }\\n\\n /**\\n * @notice Gets time elapsed since the start of the contract\\n * @dev Returns zero if called before conctract starTime\\n * @return Seconds elapsed from contract startTime\\n */\\n function sinceStartTime() public view override returns (uint256) {\\n uint256 current = currentTime();\\n if (current <= startTime) {\\n return 0;\\n }\\n return current.sub(startTime);\\n }\\n\\n /**\\n * @notice Returns amount available to be released after each period according to schedule\\n * @return Amount of tokens available after each period\\n */\\n function amountPerPeriod() public view override returns (uint256) {\\n return managedAmount.div(periods);\\n }\\n\\n /**\\n * @notice Returns the duration of each period in seconds\\n * @return Duration of each period in seconds\\n */\\n function periodDuration() public view override returns (uint256) {\\n return duration().div(periods);\\n }\\n\\n /**\\n * @notice Gets the current period based on the schedule\\n * @return A number that represents the current period\\n */\\n function currentPeriod() public view override returns (uint256) {\\n return sinceStartTime().div(periodDuration()).add(MIN_PERIOD);\\n }\\n\\n /**\\n * @notice Gets the number of periods that passed since the first period\\n * @return A number of periods that passed since the schedule started\\n */\\n function passedPeriods() public view override returns (uint256) {\\n return currentPeriod().sub(MIN_PERIOD);\\n }\\n\\n // -- Locking & Release Schedule --\\n\\n /**\\n * @notice Gets the currently available token according to the schedule\\n * @dev Implements the step-by-step schedule based on periods for available tokens\\n * @return Amount of tokens available according to the schedule\\n */\\n function availableAmount() public view override returns (uint256) {\\n uint256 current = currentTime();\\n\\n // Before contract start no funds are available\\n if (current < startTime) {\\n return 0;\\n }\\n\\n // After contract ended all funds are available\\n if (current > endTime) {\\n return managedAmount;\\n }\\n\\n // Get available amount based on period\\n return passedPeriods().mul(amountPerPeriod());\\n }\\n\\n /**\\n * @notice Gets the amount of currently vested tokens\\n * @dev Similar to available amount, but is fully vested when contract is non-revocable\\n * @return Amount of tokens already vested\\n */\\n function vestedAmount() public view override returns (uint256) {\\n // If non-revocable it is fully vested\\n if (revocable == Revocability.Disabled) {\\n return managedAmount;\\n }\\n\\n // Vesting cliff is activated and it has not passed means nothing is vested yet\\n if (vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\\n return 0;\\n }\\n\\n return availableAmount();\\n }\\n\\n /**\\n * @notice Gets tokens currently available for release\\n * @dev Considers the schedule and takes into account already released tokens\\n * @return Amount of tokens ready to be released\\n */\\n function releasableAmount() public view virtual override returns (uint256) {\\n // If a release start time is set no tokens are available for release before this date\\n // If not set it follows the default schedule and tokens are available on\\n // the first period passed\\n if (releaseStartTime > 0 && currentTime() < releaseStartTime) {\\n return 0;\\n }\\n\\n // Vesting cliff is activated and it has not passed means nothing is vested yet\\n // so funds cannot be released\\n if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\\n return 0;\\n }\\n\\n // A beneficiary can never have more releasable tokens than the contract balance\\n uint256 releasable = availableAmount().sub(releasedAmount);\\n return MathUtils.min(currentBalance(), releasable);\\n }\\n\\n /**\\n * @notice Gets the outstanding amount yet to be released based on the whole contract lifetime\\n * @dev Does not consider schedule but just global amounts tracked\\n * @return Amount of outstanding tokens for the lifetime of the contract\\n */\\n function totalOutstandingAmount() public view override returns (uint256) {\\n return managedAmount.sub(releasedAmount).sub(revokedAmount);\\n }\\n\\n /**\\n * @notice Gets surplus amount in the contract based on outstanding amount to release\\n * @dev All funds over outstanding amount is considered surplus that can be withdrawn by beneficiary.\\n * Note this might not be the correct value for wallets transferred to L2 (i.e. an L2GraphTokenLockWallet), as the released amount will be\\n * skewed, so the beneficiary might have to bridge back to L1 to release the surplus.\\n * @return Amount of tokens considered as surplus\\n */\\n function surplusAmount() public view override returns (uint256) {\\n uint256 balance = currentBalance();\\n uint256 outstandingAmount = totalOutstandingAmount();\\n if (balance > outstandingAmount) {\\n return balance.sub(outstandingAmount);\\n }\\n return 0;\\n }\\n\\n // -- Value Transfer --\\n\\n /**\\n * @notice Releases tokens based on the configured schedule\\n * @dev All available releasable tokens are transferred to beneficiary\\n */\\n function release() external override onlyBeneficiary {\\n uint256 amountToRelease = releasableAmount();\\n require(amountToRelease > 0, \\\"No available releasable amount\\\");\\n\\n releasedAmount = releasedAmount.add(amountToRelease);\\n\\n token.safeTransfer(beneficiary, amountToRelease);\\n\\n emit TokensReleased(beneficiary, amountToRelease);\\n }\\n\\n /**\\n * @notice Withdraws surplus, unmanaged tokens from the contract\\n * @dev Tokens in the contract over outstanding amount are considered as surplus\\n * @param _amount Amount of tokens to withdraw\\n */\\n function withdrawSurplus(uint256 _amount) external override onlyBeneficiary {\\n require(_amount > 0, \\\"Amount cannot be zero\\\");\\n require(surplusAmount() >= _amount, \\\"Amount requested > surplus available\\\");\\n\\n token.safeTransfer(beneficiary, _amount);\\n\\n emit TokensWithdrawn(beneficiary, _amount);\\n }\\n\\n /**\\n * @notice Revokes a vesting schedule and return the unvested tokens to the owner\\n * @dev Vesting schedule is always calculated based on managed tokens\\n */\\n function revoke() external override onlyOwner {\\n require(revocable == Revocability.Enabled, \\\"Contract is non-revocable\\\");\\n require(isRevoked == false, \\\"Already revoked\\\");\\n\\n uint256 unvestedAmount = managedAmount.sub(vestedAmount());\\n require(unvestedAmount > 0, \\\"No available unvested amount\\\");\\n\\n revokedAmount = unvestedAmount;\\n isRevoked = true;\\n\\n token.safeTransfer(owner(), unvestedAmount);\\n\\n emit TokensRevoked(beneficiary, unvestedAmount);\\n }\\n}\\n\",\"keccak256\":\"0xd89470956a476c2fcf4a09625775573f95ba2c60a57fe866d90f65de1bcf5f2d\",\"license\":\"MIT\"},\"contracts/GraphTokenLockManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/EnumerableSet.sol\\\";\\nimport { Ownable } from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\n\\nimport \\\"./MinimalProxyFactory.sol\\\";\\nimport \\\"./IGraphTokenLockManager.sol\\\";\\nimport { GraphTokenLockWallet } from \\\"./GraphTokenLockWallet.sol\\\";\\n\\n/**\\n * @title GraphTokenLockManager\\n * @notice This contract manages a list of authorized function calls and targets that can be called\\n * by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts.\\n *\\n * This contract receives funds to make the process of creating TokenLockWallet contracts\\n * easier by distributing them the initial tokens to be managed.\\n *\\n * The owner can setup a list of token destinations that will be used by TokenLock contracts to\\n * approve the pulling of funds, this way in can be guaranteed that only protocol contracts\\n * will manipulate users funds.\\n */\\ncontract GraphTokenLockManager is Ownable, MinimalProxyFactory, IGraphTokenLockManager {\\n using SafeERC20 for IERC20;\\n using EnumerableSet for EnumerableSet.AddressSet;\\n\\n // -- State --\\n\\n mapping(bytes4 => address) public authFnCalls;\\n EnumerableSet.AddressSet private _tokenDestinations;\\n\\n address public masterCopy;\\n IERC20 internal _token;\\n\\n // -- Events --\\n\\n event MasterCopyUpdated(address indexed masterCopy);\\n event TokenLockCreated(\\n address indexed contractAddress,\\n bytes32 indexed initHash,\\n address indexed beneficiary,\\n address token,\\n uint256 managedAmount,\\n uint256 startTime,\\n uint256 endTime,\\n uint256 periods,\\n uint256 releaseStartTime,\\n uint256 vestingCliffTime,\\n IGraphTokenLock.Revocability revocable\\n );\\n\\n event TokensDeposited(address indexed sender, uint256 amount);\\n event TokensWithdrawn(address indexed sender, uint256 amount);\\n\\n event FunctionCallAuth(address indexed caller, bytes4 indexed sigHash, address indexed target, string signature);\\n event TokenDestinationAllowed(address indexed dst, bool allowed);\\n\\n /**\\n * Constructor.\\n * @param _graphToken Token to use for deposits and withdrawals\\n * @param _masterCopy Address of the master copy to use to clone proxies\\n */\\n constructor(IERC20 _graphToken, address _masterCopy) {\\n require(address(_graphToken) != address(0), \\\"Token cannot be zero\\\");\\n _token = _graphToken;\\n setMasterCopy(_masterCopy);\\n }\\n\\n // -- Factory --\\n\\n /**\\n * @notice Sets the masterCopy bytecode to use to create clones of TokenLock contracts\\n * @param _masterCopy Address of contract bytecode to factory clone\\n */\\n function setMasterCopy(address _masterCopy) public override onlyOwner {\\n require(_masterCopy != address(0), \\\"MasterCopy cannot be zero\\\");\\n masterCopy = _masterCopy;\\n emit MasterCopyUpdated(_masterCopy);\\n }\\n\\n /**\\n * @notice Creates and fund a new token lock wallet using a minimum proxy\\n * @param _owner Address of the contract owner\\n * @param _beneficiary Address of the beneficiary of locked tokens\\n * @param _managedAmount Amount of tokens to be managed by the lock contract\\n * @param _startTime Start time of the release schedule\\n * @param _endTime End time of the release schedule\\n * @param _periods Number of periods between start time and end time\\n * @param _releaseStartTime Override time for when the releases start\\n * @param _revocable Whether the contract is revocable\\n */\\n function createTokenLockWallet(\\n address _owner,\\n address _beneficiary,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n IGraphTokenLock.Revocability _revocable\\n ) external override onlyOwner {\\n require(_token.balanceOf(address(this)) >= _managedAmount, \\\"Not enough tokens to create lock\\\");\\n\\n // Create contract using a minimal proxy and call initializer\\n bytes memory initializer = abi.encodeWithSelector(\\n GraphTokenLockWallet.initialize.selector,\\n address(this),\\n _owner,\\n _beneficiary,\\n address(_token),\\n _managedAmount,\\n _startTime,\\n _endTime,\\n _periods,\\n _releaseStartTime,\\n _vestingCliffTime,\\n _revocable\\n );\\n address contractAddress = _deployProxy2(keccak256(initializer), masterCopy, initializer);\\n\\n // Send managed amount to the created contract\\n _token.safeTransfer(contractAddress, _managedAmount);\\n\\n emit TokenLockCreated(\\n contractAddress,\\n keccak256(initializer),\\n _beneficiary,\\n address(_token),\\n _managedAmount,\\n _startTime,\\n _endTime,\\n _periods,\\n _releaseStartTime,\\n _vestingCliffTime,\\n _revocable\\n );\\n }\\n\\n // -- Funds Management --\\n\\n /**\\n * @notice Gets the GRT token address\\n * @return Token used for transfers and approvals\\n */\\n function token() external view override returns (IERC20) {\\n return _token;\\n }\\n\\n /**\\n * @notice Deposits tokens into the contract\\n * @dev Even if the ERC20 token can be transferred directly to the contract\\n * this function provide a safe interface to do the transfer and avoid mistakes\\n * @param _amount Amount to deposit\\n */\\n function deposit(uint256 _amount) external override {\\n require(_amount > 0, \\\"Amount cannot be zero\\\");\\n _token.safeTransferFrom(msg.sender, address(this), _amount);\\n emit TokensDeposited(msg.sender, _amount);\\n }\\n\\n /**\\n * @notice Withdraws tokens from the contract\\n * @dev Escape hatch in case of mistakes or to recover remaining funds\\n * @param _amount Amount of tokens to withdraw\\n */\\n function withdraw(uint256 _amount) external override onlyOwner {\\n require(_amount > 0, \\\"Amount cannot be zero\\\");\\n _token.safeTransfer(msg.sender, _amount);\\n emit TokensWithdrawn(msg.sender, _amount);\\n }\\n\\n // -- Token Destinations --\\n\\n /**\\n * @notice Adds an address that can be allowed by a token lock to pull funds\\n * @param _dst Destination address\\n */\\n function addTokenDestination(address _dst) external override onlyOwner {\\n require(_dst != address(0), \\\"Destination cannot be zero\\\");\\n require(_tokenDestinations.add(_dst), \\\"Destination already added\\\");\\n emit TokenDestinationAllowed(_dst, true);\\n }\\n\\n /**\\n * @notice Removes an address that can be allowed by a token lock to pull funds\\n * @param _dst Destination address\\n */\\n function removeTokenDestination(address _dst) external override onlyOwner {\\n require(_tokenDestinations.remove(_dst), \\\"Destination already removed\\\");\\n emit TokenDestinationAllowed(_dst, false);\\n }\\n\\n /**\\n * @notice Returns True if the address is authorized to be a destination of tokens\\n * @param _dst Destination address\\n * @return True if authorized\\n */\\n function isTokenDestination(address _dst) external view override returns (bool) {\\n return _tokenDestinations.contains(_dst);\\n }\\n\\n /**\\n * @notice Returns an array of authorized destination addresses\\n * @return Array of addresses authorized to pull funds from a token lock\\n */\\n function getTokenDestinations() external view override returns (address[] memory) {\\n address[] memory dstList = new address[](_tokenDestinations.length());\\n for (uint256 i = 0; i < _tokenDestinations.length(); i++) {\\n dstList[i] = _tokenDestinations.at(i);\\n }\\n return dstList;\\n }\\n\\n // -- Function Call Authorization --\\n\\n /**\\n * @notice Sets an authorized function call to target\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @param _signature Function signature\\n * @param _target Address of the destination contract to call\\n */\\n function setAuthFunctionCall(string calldata _signature, address _target) external override onlyOwner {\\n _setAuthFunctionCall(_signature, _target);\\n }\\n\\n /**\\n * @notice Unsets an authorized function call to target\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @param _signature Function signature\\n */\\n function unsetAuthFunctionCall(string calldata _signature) external override onlyOwner {\\n bytes4 sigHash = _toFunctionSigHash(_signature);\\n authFnCalls[sigHash] = address(0);\\n\\n emit FunctionCallAuth(msg.sender, sigHash, address(0), _signature);\\n }\\n\\n /**\\n * @notice Sets an authorized function call to target in bulk\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @param _signatures Function signatures\\n * @param _targets Address of the destination contract to call\\n */\\n function setAuthFunctionCallMany(\\n string[] calldata _signatures,\\n address[] calldata _targets\\n ) external override onlyOwner {\\n require(_signatures.length == _targets.length, \\\"Array length mismatch\\\");\\n\\n for (uint256 i = 0; i < _signatures.length; i++) {\\n _setAuthFunctionCall(_signatures[i], _targets[i]);\\n }\\n }\\n\\n /**\\n * @notice Sets an authorized function call to target\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @dev Function signatures of Graph Protocol contracts to be used are known ahead of time\\n * @param _signature Function signature\\n * @param _target Address of the destination contract to call\\n */\\n function _setAuthFunctionCall(string calldata _signature, address _target) internal {\\n require(_target != address(this), \\\"Target must be other contract\\\");\\n require(Address.isContract(_target), \\\"Target must be a contract\\\");\\n\\n bytes4 sigHash = _toFunctionSigHash(_signature);\\n authFnCalls[sigHash] = _target;\\n\\n emit FunctionCallAuth(msg.sender, sigHash, _target, _signature);\\n }\\n\\n /**\\n * @notice Gets the target contract to call for a particular function signature\\n * @param _sigHash Function signature hash\\n * @return Address of the target contract where to send the call\\n */\\n function getAuthFunctionCallTarget(bytes4 _sigHash) public view override returns (address) {\\n return authFnCalls[_sigHash];\\n }\\n\\n /**\\n * @notice Returns true if the function call is authorized\\n * @param _sigHash Function signature hash\\n * @return True if authorized\\n */\\n function isAuthFunctionCall(bytes4 _sigHash) external view override returns (bool) {\\n return getAuthFunctionCallTarget(_sigHash) != address(0);\\n }\\n\\n /**\\n * @dev Converts a function signature string to 4-bytes hash\\n * @param _signature Function signature string\\n * @return Function signature hash\\n */\\n function _toFunctionSigHash(string calldata _signature) internal pure returns (bytes4) {\\n return _convertToBytes4(abi.encodeWithSignature(_signature));\\n }\\n\\n /**\\n * @dev Converts function signature bytes to function signature hash (bytes4)\\n * @param _signature Function signature\\n * @return Function signature in bytes4\\n */\\n function _convertToBytes4(bytes memory _signature) internal pure returns (bytes4) {\\n require(_signature.length == 4, \\\"Invalid method signature\\\");\\n bytes4 sigHash;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n sigHash := mload(add(_signature, 32))\\n }\\n return sigHash;\\n }\\n}\\n\",\"keccak256\":\"0x2bb51cc1a18bd88113fd6947067ad2fff33048c8904cb54adfda8e2ab86752f2\",\"license\":\"MIT\"},\"contracts/GraphTokenLockWallet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"@openzeppelin/contracts/math/SafeMath.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nimport \\\"./GraphTokenLock.sol\\\";\\nimport \\\"./IGraphTokenLockManager.sol\\\";\\n\\n/**\\n * @title GraphTokenLockWallet\\n * @notice This contract is built on top of the base GraphTokenLock functionality.\\n * It allows wallet beneficiaries to use the deposited funds to perform specific function calls\\n * on specific contracts.\\n *\\n * The idea is that supporters with locked tokens can participate in the protocol\\n * but disallow any release before the vesting/lock schedule.\\n * The beneficiary can issue authorized function calls to this contract that will\\n * get forwarded to a target contract. A target contract is any of our protocol contracts.\\n * The function calls allowed are queried to the GraphTokenLockManager, this way\\n * the same configuration can be shared for all the created lock wallet contracts.\\n *\\n * NOTE: Contracts used as target must have its function signatures checked to avoid collisions\\n * with any of this contract functions.\\n * Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience\\n * the maximum amount of tokens is authorized.\\n * Function calls do not forward ETH value so DO NOT SEND ETH TO THIS CONTRACT.\\n */\\ncontract GraphTokenLockWallet is GraphTokenLock {\\n using SafeMath for uint256;\\n\\n // -- State --\\n\\n IGraphTokenLockManager public manager;\\n uint256 public usedAmount;\\n\\n // -- Events --\\n\\n event ManagerUpdated(address indexed _oldManager, address indexed _newManager);\\n event TokenDestinationsApproved();\\n event TokenDestinationsRevoked();\\n\\n // Initializer\\n function initialize(\\n address _manager,\\n address _owner,\\n address _beneficiary,\\n address _token,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n Revocability _revocable\\n ) external {\\n _initialize(\\n _owner,\\n _beneficiary,\\n _token,\\n _managedAmount,\\n _startTime,\\n _endTime,\\n _periods,\\n _releaseStartTime,\\n _vestingCliffTime,\\n _revocable\\n );\\n _setManager(_manager);\\n }\\n\\n // -- Admin --\\n\\n /**\\n * @notice Sets a new manager for this contract\\n * @param _newManager Address of the new manager\\n */\\n function setManager(address _newManager) external onlyOwner {\\n _setManager(_newManager);\\n }\\n\\n /**\\n * @dev Sets a new manager for this contract\\n * @param _newManager Address of the new manager\\n */\\n function _setManager(address _newManager) internal {\\n require(_newManager != address(0), \\\"Manager cannot be empty\\\");\\n require(Address.isContract(_newManager), \\\"Manager must be a contract\\\");\\n\\n address oldManager = address(manager);\\n manager = IGraphTokenLockManager(_newManager);\\n\\n emit ManagerUpdated(oldManager, _newManager);\\n }\\n\\n // -- Beneficiary --\\n\\n /**\\n * @notice Approves protocol access of the tokens managed by this contract\\n * @dev Approves all token destinations registered in the manager to pull tokens\\n */\\n function approveProtocol() external onlyBeneficiary {\\n address[] memory dstList = manager.getTokenDestinations();\\n for (uint256 i = 0; i < dstList.length; i++) {\\n // Note this is only safe because we are using the max uint256 value\\n token.approve(dstList[i], type(uint256).max);\\n }\\n emit TokenDestinationsApproved();\\n }\\n\\n /**\\n * @notice Revokes protocol access of the tokens managed by this contract\\n * @dev Revokes approval to all token destinations in the manager to pull tokens\\n */\\n function revokeProtocol() external onlyBeneficiary {\\n address[] memory dstList = manager.getTokenDestinations();\\n for (uint256 i = 0; i < dstList.length; i++) {\\n // Note this is only safe cause we're using 0 as the amount\\n token.approve(dstList[i], 0);\\n }\\n emit TokenDestinationsRevoked();\\n }\\n\\n /**\\n * @notice Gets tokens currently available for release\\n * @dev Considers the schedule, takes into account already released tokens and used amount\\n * @return Amount of tokens ready to be released\\n */\\n function releasableAmount() public view override returns (uint256) {\\n if (revocable == Revocability.Disabled) {\\n return super.releasableAmount();\\n }\\n\\n // -- Revocability enabled logic\\n // This needs to deal with additional considerations for when tokens are used in the protocol\\n\\n // If a release start time is set no tokens are available for release before this date\\n // If not set it follows the default schedule and tokens are available on\\n // the first period passed\\n if (releaseStartTime > 0 && currentTime() < releaseStartTime) {\\n return 0;\\n }\\n\\n // Vesting cliff is activated and it has not passed means nothing is vested yet\\n // so funds cannot be released\\n if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\\n return 0;\\n }\\n\\n // A beneficiary can never have more releasable tokens than the contract balance\\n // We consider the `usedAmount` in the protocol as part of the calculations\\n // the beneficiary should not release funds that are used.\\n uint256 releasable = availableAmount().sub(releasedAmount).sub(usedAmount);\\n return MathUtils.min(currentBalance(), releasable);\\n }\\n\\n /**\\n * @notice Forward authorized contract calls to protocol contracts\\n * @dev Fallback function can be called by the beneficiary only if function call is allowed\\n */\\n // solhint-disable-next-line no-complex-fallback\\n fallback() external payable {\\n // Only beneficiary can forward calls\\n require(msg.sender == beneficiary, \\\"Unauthorized caller\\\");\\n require(msg.value == 0, \\\"ETH transfers not supported\\\");\\n\\n // Function call validation\\n address _target = manager.getAuthFunctionCallTarget(msg.sig);\\n require(_target != address(0), \\\"Unauthorized function\\\");\\n\\n uint256 oldBalance = currentBalance();\\n\\n // Call function with data\\n Address.functionCall(_target, msg.data);\\n\\n // Tracked used tokens in the protocol\\n // We do this check after balances were updated by the forwarded call\\n // Check is only enforced for revocable contracts to save some gas\\n if (revocable == Revocability.Enabled) {\\n // Track contract balance change\\n uint256 newBalance = currentBalance();\\n if (newBalance < oldBalance) {\\n // Outflow\\n uint256 diff = oldBalance.sub(newBalance);\\n usedAmount = usedAmount.add(diff);\\n } else {\\n // Inflow: We can receive profits from the protocol, that could make usedAmount to\\n // underflow. We set it to zero in that case.\\n uint256 diff = newBalance.sub(oldBalance);\\n usedAmount = (diff >= usedAmount) ? 0 : usedAmount.sub(diff);\\n }\\n require(usedAmount <= vestedAmount(), \\\"Cannot use more tokens than vested amount\\\");\\n }\\n }\\n\\n /**\\n * @notice Receive function that always reverts.\\n * @dev Only included to supress warnings, see https://github.com/ethereum/solidity/issues/10159\\n */\\n receive() external payable {\\n revert(\\\"Bad call\\\");\\n }\\n}\\n\",\"keccak256\":\"0x976c2ba4c1503a81ea02bd84539c516e99af611ff767968ee25456b50a6deb7b\",\"license\":\"MIT\"},\"contracts/ICallhookReceiver.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\n\\n// Copied from graphprotocol/contracts, changed solidity version to 0.7.3\\n\\n/**\\n * @title Interface for contracts that can receive callhooks through the Arbitrum GRT bridge\\n * @dev Any contract that can receive a callhook on L2, sent through the bridge from L1, must\\n * be allowlisted by the governor, but also implement this interface that contains\\n * the function that will actually be called by the L2GraphTokenGateway.\\n */\\npragma solidity ^0.7.3;\\n\\ninterface ICallhookReceiver {\\n /**\\n * @notice Receive tokens with a callhook from the bridge\\n * @param _from Token sender in L1\\n * @param _amount Amount of tokens that were transferred\\n * @param _data ABI-encoded callhook data\\n */\\n function onTokenTransfer(address _from, uint256 _amount, bytes calldata _data) external;\\n}\\n\",\"keccak256\":\"0xb90eae14e8bac012a4b99fabe7a1110f70143eb78476ea0d6b52557ef979fa0e\",\"license\":\"GPL-2.0-or-later\"},\"contracts/IGraphTokenLock.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\ninterface IGraphTokenLock {\\n enum Revocability {\\n NotSet,\\n Enabled,\\n Disabled\\n }\\n\\n // -- Balances --\\n\\n function currentBalance() external view returns (uint256);\\n\\n // -- Time & Periods --\\n\\n function currentTime() external view returns (uint256);\\n\\n function duration() external view returns (uint256);\\n\\n function sinceStartTime() external view returns (uint256);\\n\\n function amountPerPeriod() external view returns (uint256);\\n\\n function periodDuration() external view returns (uint256);\\n\\n function currentPeriod() external view returns (uint256);\\n\\n function passedPeriods() external view returns (uint256);\\n\\n // -- Locking & Release Schedule --\\n\\n function availableAmount() external view returns (uint256);\\n\\n function vestedAmount() external view returns (uint256);\\n\\n function releasableAmount() external view returns (uint256);\\n\\n function totalOutstandingAmount() external view returns (uint256);\\n\\n function surplusAmount() external view returns (uint256);\\n\\n // -- Value Transfer --\\n\\n function release() external;\\n\\n function withdrawSurplus(uint256 _amount) external;\\n\\n function revoke() external;\\n}\\n\",\"keccak256\":\"0xceb9d258276fe25ec858191e1deae5778f1b2f612a669fb7b37bab1a064756ab\",\"license\":\"MIT\"},\"contracts/IGraphTokenLockManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nimport \\\"./IGraphTokenLock.sol\\\";\\n\\ninterface IGraphTokenLockManager {\\n // -- Factory --\\n\\n function setMasterCopy(address _masterCopy) external;\\n\\n function createTokenLockWallet(\\n address _owner,\\n address _beneficiary,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n IGraphTokenLock.Revocability _revocable\\n ) external;\\n\\n // -- Funds Management --\\n\\n function token() external returns (IERC20);\\n\\n function deposit(uint256 _amount) external;\\n\\n function withdraw(uint256 _amount) external;\\n\\n // -- Allowed Funds Destinations --\\n\\n function addTokenDestination(address _dst) external;\\n\\n function removeTokenDestination(address _dst) external;\\n\\n function isTokenDestination(address _dst) external view returns (bool);\\n\\n function getTokenDestinations() external view returns (address[] memory);\\n\\n // -- Function Call Authorization --\\n\\n function setAuthFunctionCall(string calldata _signature, address _target) external;\\n\\n function unsetAuthFunctionCall(string calldata _signature) external;\\n\\n function setAuthFunctionCallMany(string[] calldata _signatures, address[] calldata _targets) external;\\n\\n function getAuthFunctionCallTarget(bytes4 _sigHash) external view returns (address);\\n\\n function isAuthFunctionCall(bytes4 _sigHash) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x2d78d41909a6de5b316ac39b100ea087a8f317cf306379888a045523e15c4d9a\",\"license\":\"MIT\"},\"contracts/L2GraphTokenLockManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport { SafeERC20 } from \\\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\\\";\\n\\nimport { ICallhookReceiver } from \\\"./ICallhookReceiver.sol\\\";\\nimport { GraphTokenLockManager } from \\\"./GraphTokenLockManager.sol\\\";\\nimport { L2GraphTokenLockWallet } from \\\"./L2GraphTokenLockWallet.sol\\\";\\n\\n/**\\n * @title L2GraphTokenLockManager\\n * @notice This contract manages a list of authorized function calls and targets that can be called\\n * by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts.\\n *\\n * This contract receives funds to make the process of creating TokenLockWallet contracts\\n * easier by distributing them the initial tokens to be managed.\\n *\\n * In particular, this L2 variant is designed to receive token lock wallets from L1,\\n * through the GRT bridge. These transferred wallets will not allow releasing funds in L2 until\\n * the end of the vesting timeline, but they can allow withdrawing funds back to L1 using\\n * the L2GraphTokenLockTransferTool contract.\\n *\\n * The owner can setup a list of token destinations that will be used by TokenLock contracts to\\n * approve the pulling of funds, this way in can be guaranteed that only protocol contracts\\n * will manipulate users funds.\\n */\\ncontract L2GraphTokenLockManager is GraphTokenLockManager, ICallhookReceiver {\\n using SafeERC20 for IERC20;\\n\\n /// @dev Struct to hold the data of a transferred wallet; this is\\n /// the data that must be encoded in L1 to send a wallet to L2.\\n struct TransferredWalletData {\\n address l1Address;\\n address owner;\\n address beneficiary;\\n uint256 managedAmount;\\n uint256 startTime;\\n uint256 endTime;\\n }\\n\\n /// Address of the L2GraphTokenGateway\\n address public immutable l2Gateway;\\n /// Address of the L1 transfer tool contract (in L1, no aliasing)\\n address public immutable l1TransferTool;\\n /// Mapping of each L1 wallet to its L2 wallet counterpart (populated when each wallet is received)\\n /// L1 address => L2 address\\n mapping(address => address) public l1WalletToL2Wallet;\\n /// Mapping of each L2 wallet to its L1 wallet counterpart (populated when each wallet is received)\\n /// L2 address => L1 address\\n mapping(address => address) public l2WalletToL1Wallet;\\n\\n /// @dev Event emitted when a wallet is received and created from L1\\n event TokenLockCreatedFromL1(\\n address indexed contractAddress,\\n bytes32 initHash,\\n address indexed beneficiary,\\n uint256 managedAmount,\\n uint256 startTime,\\n uint256 endTime,\\n address indexed l1Address\\n );\\n\\n /// @dev Emitted when locked tokens are received from L1 (whether the wallet\\n /// had already been received or not)\\n event LockedTokensReceivedFromL1(address indexed l1Address, address indexed l2Address, uint256 amount);\\n\\n /**\\n * @dev Checks that the sender is the L2GraphTokenGateway.\\n */\\n modifier onlyL2Gateway() {\\n require(msg.sender == l2Gateway, \\\"ONLY_GATEWAY\\\");\\n _;\\n }\\n\\n /**\\n * @notice Constructor for the L2GraphTokenLockManager contract.\\n * @param _graphToken Address of the L2 GRT token contract\\n * @param _masterCopy Address of the master copy of the L2GraphTokenLockWallet implementation\\n * @param _l2Gateway Address of the L2GraphTokenGateway contract\\n * @param _l1TransferTool Address of the L1 transfer tool contract (in L1, without aliasing)\\n */\\n constructor(\\n IERC20 _graphToken,\\n address _masterCopy,\\n address _l2Gateway,\\n address _l1TransferTool\\n ) GraphTokenLockManager(_graphToken, _masterCopy) {\\n l2Gateway = _l2Gateway;\\n l1TransferTool = _l1TransferTool;\\n }\\n\\n /**\\n * @notice This function is called by the L2GraphTokenGateway when tokens are sent from L1.\\n * @dev This function will create a new wallet if it doesn't exist yet, or send the tokens to\\n * the existing wallet if it does.\\n * @param _from Address of the sender in L1, which must be the L1GraphTokenLockTransferTool\\n * @param _amount Amount of tokens received\\n * @param _data Encoded data of the transferred wallet, which must be an ABI-encoded TransferredWalletData struct\\n */\\n function onTokenTransfer(address _from, uint256 _amount, bytes calldata _data) external override onlyL2Gateway {\\n require(_from == l1TransferTool, \\\"ONLY_TRANSFER_TOOL\\\");\\n TransferredWalletData memory walletData = abi.decode(_data, (TransferredWalletData));\\n\\n if (l1WalletToL2Wallet[walletData.l1Address] != address(0)) {\\n // If the wallet was already received, just send the tokens to the L2 address\\n _token.safeTransfer(l1WalletToL2Wallet[walletData.l1Address], _amount);\\n } else {\\n // Create contract using a minimal proxy and call initializer\\n (bytes32 initHash, address contractAddress) = _deployFromL1(keccak256(_data), walletData);\\n l1WalletToL2Wallet[walletData.l1Address] = contractAddress;\\n l2WalletToL1Wallet[contractAddress] = walletData.l1Address;\\n\\n // Send managed amount to the created contract\\n _token.safeTransfer(contractAddress, _amount);\\n\\n emit TokenLockCreatedFromL1(\\n contractAddress,\\n initHash,\\n walletData.beneficiary,\\n walletData.managedAmount,\\n walletData.startTime,\\n walletData.endTime,\\n walletData.l1Address\\n );\\n }\\n emit LockedTokensReceivedFromL1(walletData.l1Address, l1WalletToL2Wallet[walletData.l1Address], _amount);\\n }\\n\\n /**\\n * @dev Deploy a token lock wallet with data received from L1\\n * @param _salt Salt for the CREATE2 call, which must be the hash of the wallet data\\n * @param _walletData Data of the wallet to be created\\n * @return Hash of the initialization calldata\\n * @return Address of the created contract\\n */\\n function _deployFromL1(bytes32 _salt, TransferredWalletData memory _walletData) internal returns (bytes32, address) {\\n bytes memory initializer = _encodeInitializer(_walletData);\\n address contractAddress = _deployProxy2(_salt, masterCopy, initializer);\\n return (keccak256(initializer), contractAddress);\\n }\\n\\n /**\\n * @dev Encode the initializer for the token lock wallet received from L1\\n * @param _walletData Data of the wallet to be created\\n * @return Encoded initializer calldata, including the function signature\\n */\\n function _encodeInitializer(TransferredWalletData memory _walletData) internal view returns (bytes memory) {\\n return\\n abi.encodeWithSelector(\\n L2GraphTokenLockWallet.initializeFromL1.selector,\\n address(this),\\n address(_token),\\n _walletData\\n );\\n }\\n}\\n\",\"keccak256\":\"0x34ca0ffc898ce3615a000d53a9c58708354b8cd8093b3c61decfe7388f0c16e0\",\"license\":\"MIT\"},\"contracts/L2GraphTokenLockWallet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nimport { GraphTokenLockWallet } from \\\"./GraphTokenLockWallet.sol\\\";\\nimport { Ownable as OwnableInitializable } from \\\"./Ownable.sol\\\";\\nimport { L2GraphTokenLockManager } from \\\"./L2GraphTokenLockManager.sol\\\";\\n\\n/**\\n * @title L2GraphTokenLockWallet\\n * @notice This contract is built on top of the base GraphTokenLock functionality.\\n * It allows wallet beneficiaries to use the deposited funds to perform specific function calls\\n * on specific contracts.\\n *\\n * The idea is that supporters with locked tokens can participate in the protocol\\n * but disallow any release before the vesting/lock schedule.\\n * The beneficiary can issue authorized function calls to this contract that will\\n * get forwarded to a target contract. A target contract is any of our protocol contracts.\\n * The function calls allowed are queried to the GraphTokenLockManager, this way\\n * the same configuration can be shared for all the created lock wallet contracts.\\n *\\n * This L2 variant includes a special initializer so that it can be created from\\n * a wallet's data received from L1. These transferred wallets will not allow releasing\\n * funds in L2 until the end of the vesting timeline, but they can allow withdrawing\\n * funds back to L1 using the L2GraphTokenLockTransferTool contract.\\n *\\n * Note that surplusAmount and releasedAmount in L2 will be skewed for wallets received from L1,\\n * so releasing surplus tokens might also only be possible by bridging tokens back to L1.\\n *\\n * NOTE: Contracts used as target must have its function signatures checked to avoid collisions\\n * with any of this contract functions.\\n * Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience\\n * the maximum amount of tokens is authorized.\\n * Function calls do not forward ETH value so DO NOT SEND ETH TO THIS CONTRACT.\\n */\\ncontract L2GraphTokenLockWallet is GraphTokenLockWallet {\\n // Initializer when created from a message from L1\\n function initializeFromL1(\\n address _manager,\\n address _token,\\n L2GraphTokenLockManager.TransferredWalletData calldata _walletData\\n ) external {\\n require(!isInitialized, \\\"Already initialized\\\");\\n isInitialized = true;\\n\\n OwnableInitializable._initialize(_walletData.owner);\\n beneficiary = _walletData.beneficiary;\\n token = IERC20(_token);\\n\\n managedAmount = _walletData.managedAmount;\\n\\n startTime = _walletData.startTime;\\n endTime = _walletData.endTime;\\n periods = 1;\\n isAccepted = true;\\n\\n // Optionals\\n releaseStartTime = _walletData.endTime;\\n revocable = Revocability.Disabled;\\n\\n _setManager(_manager);\\n }\\n}\\n\",\"keccak256\":\"0x8842140c2c7924be4ab1bca71e0b0ad6dd1dba6433cfdc523bfd204288b25d20\",\"license\":\"MIT\"},\"contracts/MathUtils.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nlibrary MathUtils {\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n}\\n\",\"keccak256\":\"0xe2512e1da48bc8363acd15f66229564b02d66706665d7da740604566913c1400\",\"license\":\"MIT\"},\"contracts/MinimalProxyFactory.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nimport { Address } from \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport { Create2 } from \\\"@openzeppelin/contracts/utils/Create2.sol\\\";\\n\\n/**\\n * @title MinimalProxyFactory: a factory contract for creating minimal proxies\\n * @notice Adapted from https://github.com/OpenZeppelin/openzeppelin-sdk/blob/v2.5.0/packages/lib/contracts/upgradeability/ProxyFactory.sol\\n * Based on https://eips.ethereum.org/EIPS/eip-1167\\n */\\ncontract MinimalProxyFactory {\\n /// @dev Emitted when a new proxy is created\\n event ProxyCreated(address indexed proxy);\\n\\n /**\\n * @notice Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation\\n * @param _salt Bytes32 salt to use for CREATE2\\n * @param _implementation Address of the proxy target implementation\\n * @param _deployer Address of the deployer that creates the contract\\n * @return Address of the counterfactual MinimalProxy\\n */\\n function getDeploymentAddress(\\n bytes32 _salt,\\n address _implementation,\\n address _deployer\\n ) public pure returns (address) {\\n return Create2.computeAddress(_salt, keccak256(_getContractCreationCode(_implementation)), _deployer);\\n }\\n\\n /**\\n * @dev Deploys a MinimalProxy with CREATE2\\n * @param _salt Bytes32 salt to use for CREATE2\\n * @param _implementation Address of the proxy target implementation\\n * @param _data Bytes with the initializer call\\n * @return Address of the deployed MinimalProxy\\n */\\n function _deployProxy2(bytes32 _salt, address _implementation, bytes memory _data) internal returns (address) {\\n address proxyAddress = Create2.deploy(0, _salt, _getContractCreationCode(_implementation));\\n\\n emit ProxyCreated(proxyAddress);\\n\\n // Call function with data\\n if (_data.length > 0) {\\n Address.functionCall(proxyAddress, _data);\\n }\\n\\n return proxyAddress;\\n }\\n\\n /**\\n * @dev Gets the MinimalProxy bytecode\\n * @param _implementation Address of the proxy target implementation\\n * @return MinimalProxy bytecode\\n */\\n function _getContractCreationCode(address _implementation) internal pure returns (bytes memory) {\\n bytes10 creation = 0x3d602d80600a3d3981f3;\\n bytes10 prefix = 0x363d3d373d3d3d363d73;\\n bytes20 targetBytes = bytes20(_implementation);\\n bytes15 suffix = 0x5af43d82803e903d91602b57fd5bf3;\\n return abi.encodePacked(creation, prefix, targetBytes, suffix);\\n }\\n}\\n\",\"keccak256\":\"0x67d67a567bceb363ddb199b1e4ab06e7a99f16e034e03086971a332c09ec5c0e\",\"license\":\"MIT\"},\"contracts/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * The owner account will be passed on initialization of the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\ncontract Ownable {\\n /// @dev Owner of the contract, can be retrieved with the public owner() function\\n address private _owner;\\n /// @dev Since upgradeable contracts might inherit this, we add a storage gap\\n /// to allow adding variables here without breaking the proxy storage layout\\n uint256[50] private __gap;\\n\\n /// @dev Emitted when ownership of the contract is transferred\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n function _initialize(address owner) internal {\\n _owner = owner;\\n emit OwnershipTransferred(address(0), owner);\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(_owner == msg.sender, \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() external virtual onlyOwner {\\n emit OwnershipTransferred(_owner, address(0));\\n _owner = address(0);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) external virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n emit OwnershipTransferred(_owner, newOwner);\\n _owner = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0xe8750687082e8e24b620dbf58c3a08eee591ed7b4d5a3e13cc93554ec647fd09\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60c06040523480156200001157600080fd5b506040516200499938038062004999833981810160405281019062000037919062000410565b838360006200004b6200022860201b60201c565b9050806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a350600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156200015c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620001539062000586565b60405180910390fd5b81600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550620001ae816200023060201b60201c565b50508173ffffffffffffffffffffffffffffffffffffffff1660808173ffffffffffffffffffffffffffffffffffffffff1660601b815250508073ffffffffffffffffffffffffffffffffffffffff1660a08173ffffffffffffffffffffffffffffffffffffffff1660601b815250505050505062000635565b600033905090565b620002406200022860201b60201c565b73ffffffffffffffffffffffffffffffffffffffff1662000266620003b960201b60201c565b73ffffffffffffffffffffffffffffffffffffffff1614620002bf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620002b69062000564565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141562000332576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620003299062000542565b60405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167f30909084afc859121ffc3a5aef7fe37c540a9a1ef60bd4d8dcdb76376fadf9de60405160405180910390a250565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600081519050620003f38162000601565b92915050565b6000815190506200040a816200061b565b92915050565b600080600080608085870312156200042757600080fd5b60006200043787828801620003f9565b94505060206200044a87828801620003e2565b93505060406200045d87828801620003e2565b92505060606200047087828801620003e2565b91505092959194509250565b60006200048b601983620005a8565b91507f4d6173746572436f70792063616e6e6f74206265207a65726f000000000000006000830152602082019050919050565b6000620004cd602083620005a8565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b60006200050f601483620005a8565b91507f546f6b656e2063616e6e6f74206265207a65726f0000000000000000000000006000830152602082019050919050565b600060208201905081810360008301526200055d816200047c565b9050919050565b600060208201905081810360008301526200057f81620004be565b9050919050565b60006020820190508181036000830152620005a18162000500565b9050919050565b600082825260208201905092915050565b6000620005c682620005e1565b9050919050565b6000620005da82620005b9565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6200060c81620005b9565b81146200061857600080fd5b50565b6200062681620005cd565b81146200063257600080fd5b50565b60805160601c60a05160601c61433062000669600039806109195280611280525080610fc952806111f252506143306000f3fe608060405234801561001057600080fd5b50600436106101735760003560e01c806379ee1bdf116100de578063a619486e11610097578063cf497e6c11610071578063cf497e6c14610434578063f1d24c4514610450578063f2fde38b14610480578063fc0c546a1461049c57610173565b8063a619486e146103de578063b6b55f25146103fc578063c1ab13db1461041857610173565b806379ee1bdf1461031c5780638da5cb5b1461034c5780638fa74a0e1461036a5780639c05fc6014610388578063a3457466146103a4578063a4c0ed36146103c257610173565b8063463013a211610130578063463013a214610270578063586a53531461028c5780635975e00c146102aa57806368d30c2e146102c65780636e03b8dc146102e2578063715018a61461031257610173565b806303990a6c14610178578063045b7fe2146101945780630602ba2b146101c45780630cd6178f146101f45780632e1a7d4d1461022457806343fb93d914610240575b600080fd5b610192600480360381019061018d9190612f13565b6104ba565b005b6101ae60048036038101906101a99190612ca2565b610662565b6040516101bb91906139bc565b60405180910390f35b6101de60048036038101906101d99190612eea565b610695565b6040516101eb9190613bba565b60405180910390f35b61020e60048036038101906102099190612ca2565b6106d6565b60405161021b91906139bc565b60405180910390f35b61023e60048036038101906102399190612fd9565b610709565b005b61025a60048036038101906102559190612e9b565b610866565b60405161026791906139bc565b60405180910390f35b61028a60048036038101906102859190612f58565b61088b565b005b610294610917565b6040516102a191906139bc565b60405180910390f35b6102c460048036038101906102bf9190612ca2565b61093b565b005b6102e060048036038101906102db9190612ccb565b610acc565b005b6102fc60048036038101906102f79190612eea565b610e14565b60405161030991906139bc565b60405180910390f35b61031a610e47565b005b61033660048036038101906103319190612ca2565b610f81565b6040516103439190613bba565b60405180910390f35b610354610f9e565b60405161036191906139bc565b60405180910390f35b610372610fc7565b60405161037f91906139bc565b60405180910390f35b6103a2600480360381019061039d9190612dfd565b610feb565b005b6103ac611118565b6040516103b99190613b98565b60405180910390f35b6103dc60048036038101906103d79190612d91565b6111f0565b005b6103e6611756565b6040516103f391906139bc565b60405180910390f35b61041660048036038101906104119190612fd9565b61177c565b005b610432600480360381019061042d9190612ca2565b61185f565b005b61044e60048036038101906104499190612ca2565b611980565b005b61046a60048036038101906104659190612eea565b611af3565b60405161047791906139bc565b60405180910390f35b61049a60048036038101906104959190612ca2565b611b6e565b005b6104a4611d17565b6040516104b19190613c1a565b60405180910390f35b6104c2611d41565b73ffffffffffffffffffffffffffffffffffffffff166104e0610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614610536576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161052d90613e3b565b60405180910390fd5b60006105428383611d49565b9050600060016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff16817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163373ffffffffffffffffffffffffffffffffffffffff167f450397a2db0e89eccfe664cc6cdfd274a88bc00d29aaec4d991754a42f19f8c98686604051610655929190613c35565b60405180910390a4505050565b60076020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008073ffffffffffffffffffffffffffffffffffffffff166106b783611af3565b73ffffffffffffffffffffffffffffffffffffffff1614159050919050565b60066020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610711611d41565b73ffffffffffffffffffffffffffffffffffffffff1661072f610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614610785576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077c90613e3b565b60405180910390fd5b600081116107c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107bf90613e1b565b60405180910390fd5b6108153382600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611dd79092919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b8260405161085b9190613f1b565b60405180910390a250565b60006108828461087585611e5d565b8051906020012084611ed3565b90509392505050565b610893611d41565b73ffffffffffffffffffffffffffffffffffffffff166108b1610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614610907576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108fe90613e3b565b60405180910390fd5b610912838383611f17565b505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b610943611d41565b73ffffffffffffffffffffffffffffffffffffffff16610961610f9e565b73ffffffffffffffffffffffffffffffffffffffff16146109b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109ae90613e3b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610a27576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a1e90613cfb565b60405180910390fd5b610a3b8160026120f990919063ffffffff16565b610a7a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7190613e7b565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f33442b8c13e72dd75a027f08f9bff4eed2dfd26e43cdea857365f5163b359a796001604051610ac19190613bba565b60405180910390a250565b610ad4611d41565b73ffffffffffffffffffffffffffffffffffffffff16610af2610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614610b48576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b3f90613e3b565b60405180910390fd5b86600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610ba491906139bc565b60206040518083038186803b158015610bbc57600080fd5b505afa158015610bd0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bf49190613002565b1015610c35576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2c90613d3b565b60405180910390fd5b606063bd896dcb60e01b308b8b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168c8c8c8c8c8c8c604051602401610c869b9a999897969594939291906139d7565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505090506000610d1b8280519060200120600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684612129565b9050610d6a818a600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611dd79092919063ffffffff16565b8973ffffffffffffffffffffffffffffffffffffffff1682805190602001208273ffffffffffffffffffffffffffffffffffffffff167f3c7ff6acee351ed98200c285a04745858a107e16da2f13c3a81a43073c17d644600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168d8d8d8d8d8d8d604051610dff989796959493929190613b1a565b60405180910390a45050505050505050505050565b60016020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610e4f611d41565b73ffffffffffffffffffffffffffffffffffffffff16610e6d610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614610ec3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eba90613e3b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000610f978260026121a590919063ffffffff16565b9050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b7f000000000000000000000000000000000000000000000000000000000000000081565b610ff3611d41565b73ffffffffffffffffffffffffffffffffffffffff16611011610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161105e90613e3b565b60405180910390fd5b8181905084849050146110af576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110a690613cbb565b60405180910390fd5b60005b84849050811015611111576111048585838181106110cc57fe5b90506020028101906110de9190613f36565b8585858181106110ea57fe5b90506020020160208101906110ff9190612ca2565b611f17565b80806001019150506110b2565b5050505050565b60608061112560026121d5565b67ffffffffffffffff8111801561113b57600080fd5b5060405190808252806020026020018201604052801561116a5781602001602082028036833780820191505090505b50905060005b61117a60026121d5565b8110156111e8576111958160026121ea90919063ffffffff16565b8282815181106111a157fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508080600101915050611170565b508091505090565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461127e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161127590613cdb565b60405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161461130c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161130390613d7b565b60405180910390fd5b6113146129d3565b82828101906113239190612fb0565b9050600073ffffffffffffffffffffffffffffffffffffffff1660066000836000015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146114715761146c60066000836000015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1685600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611dd79092919063ffffffff16565b611683565b6000806114958585604051611487929190613973565b604051809103902084612204565b915091508060066000856000015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508260000151600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506115ea8187600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611dd79092919063ffffffff16565b826000015173ffffffffffffffffffffffffffffffffffffffff16836040015173ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fd74fe60cbf1e5bf07ef3fad0e00c45f66345c5226474786d8dc086527dc8414785876060015188608001518960a001516040516116789493929190613bd5565b60405180910390a450505b60066000826000015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16816000015173ffffffffffffffffffffffffffffffffffffffff167fe34903cfa4ad8362651171309d05bcbc2fc581a5ec83ca7b0c8d10743de766e2866040516117479190613f1b565b60405180910390a35050505050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600081116117bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117b690613e1b565b60405180910390fd5b61180e333083600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661225b909392919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f59062170a285eb80e8c6b8ced60428442a51910635005233fc4ce084a475845e826040516118549190613f1b565b60405180910390a250565b611867611d41565b73ffffffffffffffffffffffffffffffffffffffff16611885610f9e565b73ffffffffffffffffffffffffffffffffffffffff16146118db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118d290613e3b565b60405180910390fd5b6118ef8160026122e490919063ffffffff16565b61192e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192590613d9b565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f33442b8c13e72dd75a027f08f9bff4eed2dfd26e43cdea857365f5163b359a7960006040516119759190613bba565b60405180910390a250565b611988611d41565b73ffffffffffffffffffffffffffffffffffffffff166119a6610f9e565b73ffffffffffffffffffffffffffffffffffffffff16146119fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119f390613e3b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611a6c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a6390613dbb565b60405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167f30909084afc859121ffc3a5aef7fe37c540a9a1ef60bd4d8dcdb76376fadf9de60405160405180910390a250565b600060016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b611b76611d41565b73ffffffffffffffffffffffffffffffffffffffff16611b94610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614611bea576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611be190613e3b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c5190613d1b565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600033905090565b6000611dcf83836040516024016040516020818303038152906040529190604051611d759291906139a3565b60405180910390207bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050612314565b905092915050565b611e588363a9059cbb60e01b8484604051602401611df6929190613af1565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505061236c565b505050565b60606000693d602d80600a3d3981f360b01b9050600069363d3d373d3d3d363d7360b01b905060008460601b905060006e5af43d82803e903d91602b57fd5bf360881b905083838383604051602001611eb994939291906138d7565b604051602081830303815290604052945050505050919050565b60008060ff60f81b838686604051602001611ef19493929190613925565b6040516020818303038152906040528051906020012090508060001c9150509392505050565b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611f86576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f7d90613ddb565b60405180910390fd5b611f8f81612433565b611fce576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fc590613efb565b60405180910390fd5b6000611fda8484611d49565b90508160016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff16817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163373ffffffffffffffffffffffffffffffffffffffff167f450397a2db0e89eccfe664cc6cdfd274a88bc00d29aaec4d991754a42f19f8c987876040516120eb929190613c35565b60405180910390a450505050565b6000612121836000018373ffffffffffffffffffffffffffffffffffffffff1660001b612446565b905092915050565b60008061214060008661213b87611e5d565b6124b6565b90508073ffffffffffffffffffffffffffffffffffffffff167efffc2da0b561cae30d9826d37709e9421c4725faebc226cbbb7ef5fc5e734960405160405180910390a260008351111561219a5761219881846125c7565b505b809150509392505050565b60006121cd836000018373ffffffffffffffffffffffffffffffffffffffff1660001b612611565b905092915050565b60006121e382600001612634565b9050919050565b60006121f98360000183612645565b60001c905092915050565b6000806060612212846126b2565b9050600061224386600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684612129565b90508180519060200120819350935050509250929050565b6122de846323b872dd60e01b85858560405160240161227c93929190613aba565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505061236c565b50505050565b600061230c836000018373ffffffffffffffffffffffffffffffffffffffff1660001b612757565b905092915050565b6000600482511461235a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161235190613e5b565b60405180910390fd5b60006020830151905080915050919050565b60606123ce826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff1661283f9092919063ffffffff16565b905060008151111561242e57808060200190518101906123ee9190612e72565b61242d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161242490613ebb565b60405180910390fd5b5b505050565b600080823b905060008111915050919050565b60006124528383612611565b6124ab5782600001829080600181540180825580915050600190039060005260206000200160009091909190915055826000018054905083600101600084815260200190815260200160002081905550600190506124b0565b600090505b92915050565b600080844710156124fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124f390613edb565b60405180910390fd5b600083511415612541576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161253890613c9b565b60405180910390fd5b8383516020850187f59050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156125bc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125b390613dfb565b60405180910390fd5b809150509392505050565b606061260983836040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061283f565b905092915050565b600080836001016000848152602001908152602001600020541415905092915050565b600081600001805490509050919050565b600081836000018054905011612690576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161268790613c7b565b60405180910390fd5b82600001828154811061269f57fe5b9060005260206000200154905092915050565b60606320dc203d60e01b30600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040516024016126f393929190613a82565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050509050919050565b6000808360010160008481526020019081526020016000205490506000811461283357600060018203905060006001866000018054905003905060008660000182815481106127a257fe5b90600052602060002001549050808760000184815481106127bf57fe5b90600052602060002001819055506001830187600101600083815260200190815260200160002081905550866000018054806127f757fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050612839565b60009150505b92915050565b606061284e8484600085612857565b90509392505050565b60608247101561289c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161289390613d5b565b60405180910390fd5b6128a585612433565b6128e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128db90613e9b565b60405180910390fd5b600060608673ffffffffffffffffffffffffffffffffffffffff16858760405161290e919061398c565b60006040518083038185875af1925050503d806000811461294b576040519150601f19603f3d011682016040523d82523d6000602084013e612950565b606091505b509150915061296082828661296c565b92505050949350505050565b6060831561297c578290506129cc565b60008351111561298f5782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129c39190613c59565b60405180910390fd5b9392505050565b6040518060c00160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff1681526020016000815260200160008152602001600081525090565b600081359050612a5a81614277565b92915050565b60008083601f840112612a7257600080fd5b8235905067ffffffffffffffff811115612a8b57600080fd5b602083019150836020820283011115612aa357600080fd5b9250929050565b60008083601f840112612abc57600080fd5b8235905067ffffffffffffffff811115612ad557600080fd5b602083019150836020820283011115612aed57600080fd5b9250929050565b600081519050612b038161428e565b92915050565b600081359050612b18816142a5565b92915050565b600081359050612b2d816142bc565b92915050565b60008083601f840112612b4557600080fd5b8235905067ffffffffffffffff811115612b5e57600080fd5b602083019150836001820283011115612b7657600080fd5b9250929050565b600081359050612b8c816142d3565b92915050565b60008083601f840112612ba457600080fd5b8235905067ffffffffffffffff811115612bbd57600080fd5b602083019150836001820283011115612bd557600080fd5b9250929050565b600060c08284031215612bee57600080fd5b612bf860c0613f8d565b90506000612c0884828501612a4b565b6000830152506020612c1c84828501612a4b565b6020830152506040612c3084828501612a4b565b6040830152506060612c4484828501612c78565b6060830152506080612c5884828501612c78565b60808301525060a0612c6c84828501612c78565b60a08301525092915050565b600081359050612c87816142e3565b92915050565b600081519050612c9c816142e3565b92915050565b600060208284031215612cb457600080fd5b6000612cc284828501612a4b565b91505092915050565b60008060008060008060008060006101208a8c031215612cea57600080fd5b6000612cf88c828d01612a4b565b9950506020612d098c828d01612a4b565b9850506040612d1a8c828d01612c78565b9750506060612d2b8c828d01612c78565b9650506080612d3c8c828d01612c78565b95505060a0612d4d8c828d01612c78565b94505060c0612d5e8c828d01612c78565b93505060e0612d6f8c828d01612c78565b925050610100612d818c828d01612b7d565b9150509295985092959850929598565b60008060008060608587031215612da757600080fd5b6000612db587828801612a4b565b9450506020612dc687828801612c78565b935050604085013567ffffffffffffffff811115612de357600080fd5b612def87828801612b33565b925092505092959194509250565b60008060008060408587031215612e1357600080fd5b600085013567ffffffffffffffff811115612e2d57600080fd5b612e3987828801612aaa565b9450945050602085013567ffffffffffffffff811115612e5857600080fd5b612e6487828801612a60565b925092505092959194509250565b600060208284031215612e8457600080fd5b6000612e9284828501612af4565b91505092915050565b600080600060608486031215612eb057600080fd5b6000612ebe86828701612b09565b9350506020612ecf86828701612a4b565b9250506040612ee086828701612a4b565b9150509250925092565b600060208284031215612efc57600080fd5b6000612f0a84828501612b1e565b91505092915050565b60008060208385031215612f2657600080fd5b600083013567ffffffffffffffff811115612f4057600080fd5b612f4c85828601612b92565b92509250509250929050565b600080600060408486031215612f6d57600080fd5b600084013567ffffffffffffffff811115612f8757600080fd5b612f9386828701612b92565b93509350506020612fa686828701612a4b565b9150509250925092565b600060c08284031215612fc257600080fd5b6000612fd084828501612bdc565b91505092915050565b600060208284031215612feb57600080fd5b6000612ff984828501612c78565b91505092915050565b60006020828403121561301457600080fd5b600061302284828501612c8d565b91505092915050565b60006130378383613043565b60208301905092915050565b61304c81614034565b82525050565b61305b81614034565b82525050565b61307261306d82614034565b6141ed565b82525050565b600061308382613fce565b61308d8185613ffc565b935061309883613fbe565b8060005b838110156130c95781516130b0888261302b565b97506130bb83613fef565b92505060018101905061309c565b5085935050505092915050565b6130df81614046565b82525050565b6130f66130f18261407e565b614209565b82525050565b61310d613108826140aa565b614213565b82525050565b61312461311f82614052565b6141ff565b82525050565b61313b613136826140d6565b61421d565b82525050565b61314a81614102565b82525050565b61316161315c82614102565b614227565b82525050565b6000613173838561400d565b93506131808385846141ab565b82840190509392505050565b600061319782613fd9565b6131a1818561400d565b93506131b18185602086016141ba565b80840191505092915050565b6131c681614175565b82525050565b6131d581614199565b82525050565b60006131e78385614018565b93506131f48385846141ab565b6131fd83614245565b840190509392505050565b60006132148385614029565b93506132218385846141ab565b82840190509392505050565b600061323882613fe4565b6132428185614018565b93506132528185602086016141ba565b61325b81614245565b840191505092915050565b6000613273602283614018565b91507f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e60008301527f64730000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006132d9602083614018565b91507f437265617465323a2062797465636f6465206c656e677468206973207a65726f6000830152602082019050919050565b6000613319601583614018565b91507f4172726179206c656e677468206d69736d6174636800000000000000000000006000830152602082019050919050565b6000613359600c83614018565b91507f4f4e4c595f4741544557415900000000000000000000000000000000000000006000830152602082019050919050565b6000613399601a83614018565b91507f44657374696e6174696f6e2063616e6e6f74206265207a65726f0000000000006000830152602082019050919050565b60006133d9602683614018565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b600061343f602083614018565b91507f4e6f7420656e6f75676820746f6b656e7320746f20637265617465206c6f636b6000830152602082019050919050565b600061347f602683614018565b91507f416464726573733a20696e73756666696369656e742062616c616e636520666f60008301527f722063616c6c00000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006134e5601283614018565b91507f4f4e4c595f5452414e534645525f544f4f4c00000000000000000000000000006000830152602082019050919050565b6000613525601b83614018565b91507f44657374696e6174696f6e20616c72656164792072656d6f76656400000000006000830152602082019050919050565b6000613565601983614018565b91507f4d6173746572436f70792063616e6e6f74206265207a65726f000000000000006000830152602082019050919050565b60006135a5601d83614018565b91507f546172676574206d757374206265206f7468657220636f6e74726163740000006000830152602082019050919050565b60006135e5601983614018565b91507f437265617465323a204661696c6564206f6e206465706c6f79000000000000006000830152602082019050919050565b6000613625601583614018565b91507f416d6f756e742063616e6e6f74206265207a65726f00000000000000000000006000830152602082019050919050565b6000613665602083614018565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b60006136a5601883614018565b91507f496e76616c6964206d6574686f64207369676e617475726500000000000000006000830152602082019050919050565b60006136e5601983614018565b91507f44657374696e6174696f6e20616c7265616479206164646564000000000000006000830152602082019050919050565b6000613725601d83614018565b91507f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006000830152602082019050919050565b6000613765602a83614018565b91507f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008301527f6f742073756363656564000000000000000000000000000000000000000000006020830152604082019050919050565b60006137cb601d83614018565b91507f437265617465323a20696e73756666696369656e742062616c616e63650000006000830152602082019050919050565b600061380b601983614018565b91507f546172676574206d757374206265206120636f6e7472616374000000000000006000830152602082019050919050565b60c0820160008201516138546000850182613043565b5060208201516138676020850182613043565b50604082015161387a6040850182613043565b50606082015161388d60608501826138b9565b5060808201516138a060808501826138b9565b5060a08201516138b360a08501826138b9565b50505050565b6138c28161416b565b82525050565b6138d18161416b565b82525050565b60006138e382876130e5565b600a820191506138f382866130e5565b600a82019150613903828561312a565b60148201915061391382846130fc565b600f8201915081905095945050505050565b60006139318287613113565b6001820191506139418286613061565b6014820191506139518285613150565b6020820191506139618284613150565b60208201915081905095945050505050565b6000613980828486613167565b91508190509392505050565b6000613998828461318c565b915081905092915050565b60006139b0828486613208565b91508190509392505050565b60006020820190506139d16000830184613052565b92915050565b6000610160820190506139ed600083018e613052565b6139fa602083018d613052565b613a07604083018c613052565b613a14606083018b613052565b613a21608083018a6138c8565b613a2e60a08301896138c8565b613a3b60c08301886138c8565b613a4860e08301876138c8565b613a566101008301866138c8565b613a646101208301856138c8565b613a726101408301846131cc565b9c9b505050505050505050505050565b600061010082019050613a986000830186613052565b613aa56020830185613052565b613ab2604083018461383e565b949350505050565b6000606082019050613acf6000830186613052565b613adc6020830185613052565b613ae960408301846138c8565b949350505050565b6000604082019050613b066000830185613052565b613b1360208301846138c8565b9392505050565b600061010082019050613b30600083018b613052565b613b3d602083018a6138c8565b613b4a60408301896138c8565b613b5760608301886138c8565b613b6460808301876138c8565b613b7160a08301866138c8565b613b7e60c08301856138c8565b613b8b60e08301846131cc565b9998505050505050505050565b60006020820190508181036000830152613bb28184613078565b905092915050565b6000602082019050613bcf60008301846130d6565b92915050565b6000608082019050613bea6000830187613141565b613bf760208301866138c8565b613c0460408301856138c8565b613c1160608301846138c8565b95945050505050565b6000602082019050613c2f60008301846131bd565b92915050565b60006020820190508181036000830152613c508184866131db565b90509392505050565b60006020820190508181036000830152613c73818461322d565b905092915050565b60006020820190508181036000830152613c9481613266565b9050919050565b60006020820190508181036000830152613cb4816132cc565b9050919050565b60006020820190508181036000830152613cd48161330c565b9050919050565b60006020820190508181036000830152613cf48161334c565b9050919050565b60006020820190508181036000830152613d148161338c565b9050919050565b60006020820190508181036000830152613d34816133cc565b9050919050565b60006020820190508181036000830152613d5481613432565b9050919050565b60006020820190508181036000830152613d7481613472565b9050919050565b60006020820190508181036000830152613d94816134d8565b9050919050565b60006020820190508181036000830152613db481613518565b9050919050565b60006020820190508181036000830152613dd481613558565b9050919050565b60006020820190508181036000830152613df481613598565b9050919050565b60006020820190508181036000830152613e14816135d8565b9050919050565b60006020820190508181036000830152613e3481613618565b9050919050565b60006020820190508181036000830152613e5481613658565b9050919050565b60006020820190508181036000830152613e7481613698565b9050919050565b60006020820190508181036000830152613e94816136d8565b9050919050565b60006020820190508181036000830152613eb481613718565b9050919050565b60006020820190508181036000830152613ed481613758565b9050919050565b60006020820190508181036000830152613ef4816137be565b9050919050565b60006020820190508181036000830152613f14816137fe565b9050919050565b6000602082019050613f3060008301846138c8565b92915050565b60008083356001602003843603038112613f4f57600080fd5b80840192508235915067ffffffffffffffff821115613f6d57600080fd5b602083019250600182023603831315613f8557600080fd5b509250929050565b6000604051905081810181811067ffffffffffffffff82111715613fb457613fb3614243565b5b8060405250919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b600061403f8261414b565b9050919050565b60008115159050919050565b60007fff0000000000000000000000000000000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffff0000000000000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffffffffffffff000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffffffffffffffffffffffff00000000000000000000000082169050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600081905061414682614263565b919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600061418082614187565b9050919050565b60006141928261414b565b9050919050565b60006141a482614138565b9050919050565b82818337600083830152505050565b60005b838110156141d85780820151818401526020810190506141bd565b838111156141e7576000848401525b50505050565b60006141f882614231565b9050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b600061423c82614256565b9050919050565bfe5b6000601f19601f8301169050919050565b60008160601b9050919050565b6003811061427457614273614243565b5b50565b61428081614034565b811461428b57600080fd5b50565b61429781614046565b81146142a257600080fd5b50565b6142ae81614102565b81146142b957600080fd5b50565b6142c58161410c565b81146142d057600080fd5b50565b600381106142e057600080fd5b50565b6142ec8161416b565b81146142f757600080fd5b5056fea264697066735822122010f167ec85dbd4b07aedb6960f9f6ac5ae1b0f5473409617dcd319393591837164736f6c63430007030033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101735760003560e01c806379ee1bdf116100de578063a619486e11610097578063cf497e6c11610071578063cf497e6c14610434578063f1d24c4514610450578063f2fde38b14610480578063fc0c546a1461049c57610173565b8063a619486e146103de578063b6b55f25146103fc578063c1ab13db1461041857610173565b806379ee1bdf1461031c5780638da5cb5b1461034c5780638fa74a0e1461036a5780639c05fc6014610388578063a3457466146103a4578063a4c0ed36146103c257610173565b8063463013a211610130578063463013a214610270578063586a53531461028c5780635975e00c146102aa57806368d30c2e146102c65780636e03b8dc146102e2578063715018a61461031257610173565b806303990a6c14610178578063045b7fe2146101945780630602ba2b146101c45780630cd6178f146101f45780632e1a7d4d1461022457806343fb93d914610240575b600080fd5b610192600480360381019061018d9190612f13565b6104ba565b005b6101ae60048036038101906101a99190612ca2565b610662565b6040516101bb91906139bc565b60405180910390f35b6101de60048036038101906101d99190612eea565b610695565b6040516101eb9190613bba565b60405180910390f35b61020e60048036038101906102099190612ca2565b6106d6565b60405161021b91906139bc565b60405180910390f35b61023e60048036038101906102399190612fd9565b610709565b005b61025a60048036038101906102559190612e9b565b610866565b60405161026791906139bc565b60405180910390f35b61028a60048036038101906102859190612f58565b61088b565b005b610294610917565b6040516102a191906139bc565b60405180910390f35b6102c460048036038101906102bf9190612ca2565b61093b565b005b6102e060048036038101906102db9190612ccb565b610acc565b005b6102fc60048036038101906102f79190612eea565b610e14565b60405161030991906139bc565b60405180910390f35b61031a610e47565b005b61033660048036038101906103319190612ca2565b610f81565b6040516103439190613bba565b60405180910390f35b610354610f9e565b60405161036191906139bc565b60405180910390f35b610372610fc7565b60405161037f91906139bc565b60405180910390f35b6103a2600480360381019061039d9190612dfd565b610feb565b005b6103ac611118565b6040516103b99190613b98565b60405180910390f35b6103dc60048036038101906103d79190612d91565b6111f0565b005b6103e6611756565b6040516103f391906139bc565b60405180910390f35b61041660048036038101906104119190612fd9565b61177c565b005b610432600480360381019061042d9190612ca2565b61185f565b005b61044e60048036038101906104499190612ca2565b611980565b005b61046a60048036038101906104659190612eea565b611af3565b60405161047791906139bc565b60405180910390f35b61049a60048036038101906104959190612ca2565b611b6e565b005b6104a4611d17565b6040516104b19190613c1a565b60405180910390f35b6104c2611d41565b73ffffffffffffffffffffffffffffffffffffffff166104e0610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614610536576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161052d90613e3b565b60405180910390fd5b60006105428383611d49565b9050600060016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff16817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163373ffffffffffffffffffffffffffffffffffffffff167f450397a2db0e89eccfe664cc6cdfd274a88bc00d29aaec4d991754a42f19f8c98686604051610655929190613c35565b60405180910390a4505050565b60076020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008073ffffffffffffffffffffffffffffffffffffffff166106b783611af3565b73ffffffffffffffffffffffffffffffffffffffff1614159050919050565b60066020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610711611d41565b73ffffffffffffffffffffffffffffffffffffffff1661072f610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614610785576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077c90613e3b565b60405180910390fd5b600081116107c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107bf90613e1b565b60405180910390fd5b6108153382600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611dd79092919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b8260405161085b9190613f1b565b60405180910390a250565b60006108828461087585611e5d565b8051906020012084611ed3565b90509392505050565b610893611d41565b73ffffffffffffffffffffffffffffffffffffffff166108b1610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614610907576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108fe90613e3b565b60405180910390fd5b610912838383611f17565b505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b610943611d41565b73ffffffffffffffffffffffffffffffffffffffff16610961610f9e565b73ffffffffffffffffffffffffffffffffffffffff16146109b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109ae90613e3b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610a27576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a1e90613cfb565b60405180910390fd5b610a3b8160026120f990919063ffffffff16565b610a7a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7190613e7b565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f33442b8c13e72dd75a027f08f9bff4eed2dfd26e43cdea857365f5163b359a796001604051610ac19190613bba565b60405180910390a250565b610ad4611d41565b73ffffffffffffffffffffffffffffffffffffffff16610af2610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614610b48576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b3f90613e3b565b60405180910390fd5b86600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610ba491906139bc565b60206040518083038186803b158015610bbc57600080fd5b505afa158015610bd0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bf49190613002565b1015610c35576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2c90613d3b565b60405180910390fd5b606063bd896dcb60e01b308b8b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168c8c8c8c8c8c8c604051602401610c869b9a999897969594939291906139d7565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505090506000610d1b8280519060200120600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684612129565b9050610d6a818a600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611dd79092919063ffffffff16565b8973ffffffffffffffffffffffffffffffffffffffff1682805190602001208273ffffffffffffffffffffffffffffffffffffffff167f3c7ff6acee351ed98200c285a04745858a107e16da2f13c3a81a43073c17d644600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168d8d8d8d8d8d8d604051610dff989796959493929190613b1a565b60405180910390a45050505050505050505050565b60016020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610e4f611d41565b73ffffffffffffffffffffffffffffffffffffffff16610e6d610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614610ec3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eba90613e3b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000610f978260026121a590919063ffffffff16565b9050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b7f000000000000000000000000000000000000000000000000000000000000000081565b610ff3611d41565b73ffffffffffffffffffffffffffffffffffffffff16611011610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161105e90613e3b565b60405180910390fd5b8181905084849050146110af576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110a690613cbb565b60405180910390fd5b60005b84849050811015611111576111048585838181106110cc57fe5b90506020028101906110de9190613f36565b8585858181106110ea57fe5b90506020020160208101906110ff9190612ca2565b611f17565b80806001019150506110b2565b5050505050565b60608061112560026121d5565b67ffffffffffffffff8111801561113b57600080fd5b5060405190808252806020026020018201604052801561116a5781602001602082028036833780820191505090505b50905060005b61117a60026121d5565b8110156111e8576111958160026121ea90919063ffffffff16565b8282815181106111a157fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508080600101915050611170565b508091505090565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461127e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161127590613cdb565b60405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161461130c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161130390613d7b565b60405180910390fd5b6113146129d3565b82828101906113239190612fb0565b9050600073ffffffffffffffffffffffffffffffffffffffff1660066000836000015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146114715761146c60066000836000015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1685600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611dd79092919063ffffffff16565b611683565b6000806114958585604051611487929190613973565b604051809103902084612204565b915091508060066000856000015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508260000151600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506115ea8187600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611dd79092919063ffffffff16565b826000015173ffffffffffffffffffffffffffffffffffffffff16836040015173ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fd74fe60cbf1e5bf07ef3fad0e00c45f66345c5226474786d8dc086527dc8414785876060015188608001518960a001516040516116789493929190613bd5565b60405180910390a450505b60066000826000015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16816000015173ffffffffffffffffffffffffffffffffffffffff167fe34903cfa4ad8362651171309d05bcbc2fc581a5ec83ca7b0c8d10743de766e2866040516117479190613f1b565b60405180910390a35050505050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600081116117bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117b690613e1b565b60405180910390fd5b61180e333083600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661225b909392919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f59062170a285eb80e8c6b8ced60428442a51910635005233fc4ce084a475845e826040516118549190613f1b565b60405180910390a250565b611867611d41565b73ffffffffffffffffffffffffffffffffffffffff16611885610f9e565b73ffffffffffffffffffffffffffffffffffffffff16146118db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118d290613e3b565b60405180910390fd5b6118ef8160026122e490919063ffffffff16565b61192e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192590613d9b565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f33442b8c13e72dd75a027f08f9bff4eed2dfd26e43cdea857365f5163b359a7960006040516119759190613bba565b60405180910390a250565b611988611d41565b73ffffffffffffffffffffffffffffffffffffffff166119a6610f9e565b73ffffffffffffffffffffffffffffffffffffffff16146119fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119f390613e3b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611a6c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a6390613dbb565b60405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167f30909084afc859121ffc3a5aef7fe37c540a9a1ef60bd4d8dcdb76376fadf9de60405160405180910390a250565b600060016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b611b76611d41565b73ffffffffffffffffffffffffffffffffffffffff16611b94610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614611bea576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611be190613e3b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c5190613d1b565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600033905090565b6000611dcf83836040516024016040516020818303038152906040529190604051611d759291906139a3565b60405180910390207bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050612314565b905092915050565b611e588363a9059cbb60e01b8484604051602401611df6929190613af1565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505061236c565b505050565b60606000693d602d80600a3d3981f360b01b9050600069363d3d373d3d3d363d7360b01b905060008460601b905060006e5af43d82803e903d91602b57fd5bf360881b905083838383604051602001611eb994939291906138d7565b604051602081830303815290604052945050505050919050565b60008060ff60f81b838686604051602001611ef19493929190613925565b6040516020818303038152906040528051906020012090508060001c9150509392505050565b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611f86576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f7d90613ddb565b60405180910390fd5b611f8f81612433565b611fce576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fc590613efb565b60405180910390fd5b6000611fda8484611d49565b90508160016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff16817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163373ffffffffffffffffffffffffffffffffffffffff167f450397a2db0e89eccfe664cc6cdfd274a88bc00d29aaec4d991754a42f19f8c987876040516120eb929190613c35565b60405180910390a450505050565b6000612121836000018373ffffffffffffffffffffffffffffffffffffffff1660001b612446565b905092915050565b60008061214060008661213b87611e5d565b6124b6565b90508073ffffffffffffffffffffffffffffffffffffffff167efffc2da0b561cae30d9826d37709e9421c4725faebc226cbbb7ef5fc5e734960405160405180910390a260008351111561219a5761219881846125c7565b505b809150509392505050565b60006121cd836000018373ffffffffffffffffffffffffffffffffffffffff1660001b612611565b905092915050565b60006121e382600001612634565b9050919050565b60006121f98360000183612645565b60001c905092915050565b6000806060612212846126b2565b9050600061224386600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684612129565b90508180519060200120819350935050509250929050565b6122de846323b872dd60e01b85858560405160240161227c93929190613aba565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505061236c565b50505050565b600061230c836000018373ffffffffffffffffffffffffffffffffffffffff1660001b612757565b905092915050565b6000600482511461235a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161235190613e5b565b60405180910390fd5b60006020830151905080915050919050565b60606123ce826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff1661283f9092919063ffffffff16565b905060008151111561242e57808060200190518101906123ee9190612e72565b61242d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161242490613ebb565b60405180910390fd5b5b505050565b600080823b905060008111915050919050565b60006124528383612611565b6124ab5782600001829080600181540180825580915050600190039060005260206000200160009091909190915055826000018054905083600101600084815260200190815260200160002081905550600190506124b0565b600090505b92915050565b600080844710156124fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124f390613edb565b60405180910390fd5b600083511415612541576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161253890613c9b565b60405180910390fd5b8383516020850187f59050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156125bc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125b390613dfb565b60405180910390fd5b809150509392505050565b606061260983836040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061283f565b905092915050565b600080836001016000848152602001908152602001600020541415905092915050565b600081600001805490509050919050565b600081836000018054905011612690576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161268790613c7b565b60405180910390fd5b82600001828154811061269f57fe5b9060005260206000200154905092915050565b60606320dc203d60e01b30600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040516024016126f393929190613a82565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050509050919050565b6000808360010160008481526020019081526020016000205490506000811461283357600060018203905060006001866000018054905003905060008660000182815481106127a257fe5b90600052602060002001549050808760000184815481106127bf57fe5b90600052602060002001819055506001830187600101600083815260200190815260200160002081905550866000018054806127f757fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050612839565b60009150505b92915050565b606061284e8484600085612857565b90509392505050565b60608247101561289c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161289390613d5b565b60405180910390fd5b6128a585612433565b6128e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128db90613e9b565b60405180910390fd5b600060608673ffffffffffffffffffffffffffffffffffffffff16858760405161290e919061398c565b60006040518083038185875af1925050503d806000811461294b576040519150601f19603f3d011682016040523d82523d6000602084013e612950565b606091505b509150915061296082828661296c565b92505050949350505050565b6060831561297c578290506129cc565b60008351111561298f5782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129c39190613c59565b60405180910390fd5b9392505050565b6040518060c00160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff1681526020016000815260200160008152602001600081525090565b600081359050612a5a81614277565b92915050565b60008083601f840112612a7257600080fd5b8235905067ffffffffffffffff811115612a8b57600080fd5b602083019150836020820283011115612aa357600080fd5b9250929050565b60008083601f840112612abc57600080fd5b8235905067ffffffffffffffff811115612ad557600080fd5b602083019150836020820283011115612aed57600080fd5b9250929050565b600081519050612b038161428e565b92915050565b600081359050612b18816142a5565b92915050565b600081359050612b2d816142bc565b92915050565b60008083601f840112612b4557600080fd5b8235905067ffffffffffffffff811115612b5e57600080fd5b602083019150836001820283011115612b7657600080fd5b9250929050565b600081359050612b8c816142d3565b92915050565b60008083601f840112612ba457600080fd5b8235905067ffffffffffffffff811115612bbd57600080fd5b602083019150836001820283011115612bd557600080fd5b9250929050565b600060c08284031215612bee57600080fd5b612bf860c0613f8d565b90506000612c0884828501612a4b565b6000830152506020612c1c84828501612a4b565b6020830152506040612c3084828501612a4b565b6040830152506060612c4484828501612c78565b6060830152506080612c5884828501612c78565b60808301525060a0612c6c84828501612c78565b60a08301525092915050565b600081359050612c87816142e3565b92915050565b600081519050612c9c816142e3565b92915050565b600060208284031215612cb457600080fd5b6000612cc284828501612a4b565b91505092915050565b60008060008060008060008060006101208a8c031215612cea57600080fd5b6000612cf88c828d01612a4b565b9950506020612d098c828d01612a4b565b9850506040612d1a8c828d01612c78565b9750506060612d2b8c828d01612c78565b9650506080612d3c8c828d01612c78565b95505060a0612d4d8c828d01612c78565b94505060c0612d5e8c828d01612c78565b93505060e0612d6f8c828d01612c78565b925050610100612d818c828d01612b7d565b9150509295985092959850929598565b60008060008060608587031215612da757600080fd5b6000612db587828801612a4b565b9450506020612dc687828801612c78565b935050604085013567ffffffffffffffff811115612de357600080fd5b612def87828801612b33565b925092505092959194509250565b60008060008060408587031215612e1357600080fd5b600085013567ffffffffffffffff811115612e2d57600080fd5b612e3987828801612aaa565b9450945050602085013567ffffffffffffffff811115612e5857600080fd5b612e6487828801612a60565b925092505092959194509250565b600060208284031215612e8457600080fd5b6000612e9284828501612af4565b91505092915050565b600080600060608486031215612eb057600080fd5b6000612ebe86828701612b09565b9350506020612ecf86828701612a4b565b9250506040612ee086828701612a4b565b9150509250925092565b600060208284031215612efc57600080fd5b6000612f0a84828501612b1e565b91505092915050565b60008060208385031215612f2657600080fd5b600083013567ffffffffffffffff811115612f4057600080fd5b612f4c85828601612b92565b92509250509250929050565b600080600060408486031215612f6d57600080fd5b600084013567ffffffffffffffff811115612f8757600080fd5b612f9386828701612b92565b93509350506020612fa686828701612a4b565b9150509250925092565b600060c08284031215612fc257600080fd5b6000612fd084828501612bdc565b91505092915050565b600060208284031215612feb57600080fd5b6000612ff984828501612c78565b91505092915050565b60006020828403121561301457600080fd5b600061302284828501612c8d565b91505092915050565b60006130378383613043565b60208301905092915050565b61304c81614034565b82525050565b61305b81614034565b82525050565b61307261306d82614034565b6141ed565b82525050565b600061308382613fce565b61308d8185613ffc565b935061309883613fbe565b8060005b838110156130c95781516130b0888261302b565b97506130bb83613fef565b92505060018101905061309c565b5085935050505092915050565b6130df81614046565b82525050565b6130f66130f18261407e565b614209565b82525050565b61310d613108826140aa565b614213565b82525050565b61312461311f82614052565b6141ff565b82525050565b61313b613136826140d6565b61421d565b82525050565b61314a81614102565b82525050565b61316161315c82614102565b614227565b82525050565b6000613173838561400d565b93506131808385846141ab565b82840190509392505050565b600061319782613fd9565b6131a1818561400d565b93506131b18185602086016141ba565b80840191505092915050565b6131c681614175565b82525050565b6131d581614199565b82525050565b60006131e78385614018565b93506131f48385846141ab565b6131fd83614245565b840190509392505050565b60006132148385614029565b93506132218385846141ab565b82840190509392505050565b600061323882613fe4565b6132428185614018565b93506132528185602086016141ba565b61325b81614245565b840191505092915050565b6000613273602283614018565b91507f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e60008301527f64730000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006132d9602083614018565b91507f437265617465323a2062797465636f6465206c656e677468206973207a65726f6000830152602082019050919050565b6000613319601583614018565b91507f4172726179206c656e677468206d69736d6174636800000000000000000000006000830152602082019050919050565b6000613359600c83614018565b91507f4f4e4c595f4741544557415900000000000000000000000000000000000000006000830152602082019050919050565b6000613399601a83614018565b91507f44657374696e6174696f6e2063616e6e6f74206265207a65726f0000000000006000830152602082019050919050565b60006133d9602683614018565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b600061343f602083614018565b91507f4e6f7420656e6f75676820746f6b656e7320746f20637265617465206c6f636b6000830152602082019050919050565b600061347f602683614018565b91507f416464726573733a20696e73756666696369656e742062616c616e636520666f60008301527f722063616c6c00000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006134e5601283614018565b91507f4f4e4c595f5452414e534645525f544f4f4c00000000000000000000000000006000830152602082019050919050565b6000613525601b83614018565b91507f44657374696e6174696f6e20616c72656164792072656d6f76656400000000006000830152602082019050919050565b6000613565601983614018565b91507f4d6173746572436f70792063616e6e6f74206265207a65726f000000000000006000830152602082019050919050565b60006135a5601d83614018565b91507f546172676574206d757374206265206f7468657220636f6e74726163740000006000830152602082019050919050565b60006135e5601983614018565b91507f437265617465323a204661696c6564206f6e206465706c6f79000000000000006000830152602082019050919050565b6000613625601583614018565b91507f416d6f756e742063616e6e6f74206265207a65726f00000000000000000000006000830152602082019050919050565b6000613665602083614018565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b60006136a5601883614018565b91507f496e76616c6964206d6574686f64207369676e617475726500000000000000006000830152602082019050919050565b60006136e5601983614018565b91507f44657374696e6174696f6e20616c7265616479206164646564000000000000006000830152602082019050919050565b6000613725601d83614018565b91507f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006000830152602082019050919050565b6000613765602a83614018565b91507f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008301527f6f742073756363656564000000000000000000000000000000000000000000006020830152604082019050919050565b60006137cb601d83614018565b91507f437265617465323a20696e73756666696369656e742062616c616e63650000006000830152602082019050919050565b600061380b601983614018565b91507f546172676574206d757374206265206120636f6e7472616374000000000000006000830152602082019050919050565b60c0820160008201516138546000850182613043565b5060208201516138676020850182613043565b50604082015161387a6040850182613043565b50606082015161388d60608501826138b9565b5060808201516138a060808501826138b9565b5060a08201516138b360a08501826138b9565b50505050565b6138c28161416b565b82525050565b6138d18161416b565b82525050565b60006138e382876130e5565b600a820191506138f382866130e5565b600a82019150613903828561312a565b60148201915061391382846130fc565b600f8201915081905095945050505050565b60006139318287613113565b6001820191506139418286613061565b6014820191506139518285613150565b6020820191506139618284613150565b60208201915081905095945050505050565b6000613980828486613167565b91508190509392505050565b6000613998828461318c565b915081905092915050565b60006139b0828486613208565b91508190509392505050565b60006020820190506139d16000830184613052565b92915050565b6000610160820190506139ed600083018e613052565b6139fa602083018d613052565b613a07604083018c613052565b613a14606083018b613052565b613a21608083018a6138c8565b613a2e60a08301896138c8565b613a3b60c08301886138c8565b613a4860e08301876138c8565b613a566101008301866138c8565b613a646101208301856138c8565b613a726101408301846131cc565b9c9b505050505050505050505050565b600061010082019050613a986000830186613052565b613aa56020830185613052565b613ab2604083018461383e565b949350505050565b6000606082019050613acf6000830186613052565b613adc6020830185613052565b613ae960408301846138c8565b949350505050565b6000604082019050613b066000830185613052565b613b1360208301846138c8565b9392505050565b600061010082019050613b30600083018b613052565b613b3d602083018a6138c8565b613b4a60408301896138c8565b613b5760608301886138c8565b613b6460808301876138c8565b613b7160a08301866138c8565b613b7e60c08301856138c8565b613b8b60e08301846131cc565b9998505050505050505050565b60006020820190508181036000830152613bb28184613078565b905092915050565b6000602082019050613bcf60008301846130d6565b92915050565b6000608082019050613bea6000830187613141565b613bf760208301866138c8565b613c0460408301856138c8565b613c1160608301846138c8565b95945050505050565b6000602082019050613c2f60008301846131bd565b92915050565b60006020820190508181036000830152613c508184866131db565b90509392505050565b60006020820190508181036000830152613c73818461322d565b905092915050565b60006020820190508181036000830152613c9481613266565b9050919050565b60006020820190508181036000830152613cb4816132cc565b9050919050565b60006020820190508181036000830152613cd48161330c565b9050919050565b60006020820190508181036000830152613cf48161334c565b9050919050565b60006020820190508181036000830152613d148161338c565b9050919050565b60006020820190508181036000830152613d34816133cc565b9050919050565b60006020820190508181036000830152613d5481613432565b9050919050565b60006020820190508181036000830152613d7481613472565b9050919050565b60006020820190508181036000830152613d94816134d8565b9050919050565b60006020820190508181036000830152613db481613518565b9050919050565b60006020820190508181036000830152613dd481613558565b9050919050565b60006020820190508181036000830152613df481613598565b9050919050565b60006020820190508181036000830152613e14816135d8565b9050919050565b60006020820190508181036000830152613e3481613618565b9050919050565b60006020820190508181036000830152613e5481613658565b9050919050565b60006020820190508181036000830152613e7481613698565b9050919050565b60006020820190508181036000830152613e94816136d8565b9050919050565b60006020820190508181036000830152613eb481613718565b9050919050565b60006020820190508181036000830152613ed481613758565b9050919050565b60006020820190508181036000830152613ef4816137be565b9050919050565b60006020820190508181036000830152613f14816137fe565b9050919050565b6000602082019050613f3060008301846138c8565b92915050565b60008083356001602003843603038112613f4f57600080fd5b80840192508235915067ffffffffffffffff821115613f6d57600080fd5b602083019250600182023603831315613f8557600080fd5b509250929050565b6000604051905081810181811067ffffffffffffffff82111715613fb457613fb3614243565b5b8060405250919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b600061403f8261414b565b9050919050565b60008115159050919050565b60007fff0000000000000000000000000000000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffff0000000000000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffffffffffffff000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffffffffffffffffffffffff00000000000000000000000082169050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600081905061414682614263565b919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600061418082614187565b9050919050565b60006141928261414b565b9050919050565b60006141a482614138565b9050919050565b82818337600083830152505050565b60005b838110156141d85780820151818401526020810190506141bd565b838111156141e7576000848401525b50505050565b60006141f882614231565b9050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b600061423c82614256565b9050919050565bfe5b6000601f19601f8301169050919050565b60008160601b9050919050565b6003811061427457614273614243565b5b50565b61428081614034565b811461428b57600080fd5b50565b61429781614046565b81146142a257600080fd5b50565b6142ae81614102565b81146142b957600080fd5b50565b6142c58161410c565b81146142d057600080fd5b50565b600381106142e057600080fd5b50565b6142ec8161416b565b81146142f757600080fd5b5056fea264697066735822122010f167ec85dbd4b07aedb6960f9f6ac5ae1b0f5473409617dcd319393591837164736f6c63430007030033", + "devdoc": { + "events": { + "LockedTokensReceivedFromL1(address,address,uint256)": { + "details": "Emitted when locked tokens are received from L1 (whether the wallet had already been received or not)" + }, + "TokenLockCreatedFromL1(address,bytes32,address,uint256,uint256,uint256,address)": { + "details": "Event emitted when a wallet is received and created from L1" + } + }, + "kind": "dev", + "methods": { + "addTokenDestination(address)": { + "params": { + "_dst": "Destination address" + } + }, + "constructor": { + "params": { + "_graphToken": "Address of the L2 GRT token contract", + "_l1TransferTool": "Address of the L1 transfer tool contract (in L1, without aliasing)", + "_l2Gateway": "Address of the L2GraphTokenGateway contract", + "_masterCopy": "Address of the master copy of the L2GraphTokenLockWallet implementation" + } + }, + "createTokenLockWallet(address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)": { + "params": { + "_beneficiary": "Address of the beneficiary of locked tokens", + "_endTime": "End time of the release schedule", + "_managedAmount": "Amount of tokens to be managed by the lock contract", + "_owner": "Address of the contract owner", + "_periods": "Number of periods between start time and end time", + "_releaseStartTime": "Override time for when the releases start", + "_revocable": "Whether the contract is revocable", + "_startTime": "Start time of the release schedule" + } + }, + "deposit(uint256)": { + "details": "Even if the ERC20 token can be transferred directly to the contract this function provide a safe interface to do the transfer and avoid mistakes", + "params": { + "_amount": "Amount to deposit" + } + }, + "getAuthFunctionCallTarget(bytes4)": { + "params": { + "_sigHash": "Function signature hash" + }, + "returns": { + "_0": "Address of the target contract where to send the call" + } + }, + "getDeploymentAddress(bytes32,address,address)": { + "params": { + "_deployer": "Address of the deployer that creates the contract", + "_implementation": "Address of the proxy target implementation", + "_salt": "Bytes32 salt to use for CREATE2" + }, + "returns": { + "_0": "Address of the counterfactual MinimalProxy" + } + }, + "getTokenDestinations()": { + "returns": { + "_0": "Array of addresses authorized to pull funds from a token lock" + } + }, + "isAuthFunctionCall(bytes4)": { + "params": { + "_sigHash": "Function signature hash" + }, + "returns": { + "_0": "True if authorized" + } + }, + "isTokenDestination(address)": { + "params": { + "_dst": "Destination address" + }, + "returns": { + "_0": "True if authorized" + } + }, + "onTokenTransfer(address,uint256,bytes)": { + "details": "This function will create a new wallet if it doesn't exist yet, or send the tokens to the existing wallet if it does.", + "params": { + "_amount": "Amount of tokens received", + "_data": "Encoded data of the transferred wallet, which must be an ABI-encoded TransferredWalletData struct", + "_from": "Address of the sender in L1, which must be the L1GraphTokenLockTransferTool" + } + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "removeTokenDestination(address)": { + "params": { + "_dst": "Destination address" + } + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." + }, + "setAuthFunctionCall(string,address)": { + "details": "Input expected is the function signature as 'transfer(address,uint256)'", + "params": { + "_signature": "Function signature", + "_target": "Address of the destination contract to call" + } + }, + "setAuthFunctionCallMany(string[],address[])": { + "details": "Input expected is the function signature as 'transfer(address,uint256)'", + "params": { + "_signatures": "Function signatures", + "_targets": "Address of the destination contract to call" + } + }, + "setMasterCopy(address)": { + "params": { + "_masterCopy": "Address of contract bytecode to factory clone" + } + }, + "token()": { + "returns": { + "_0": "Token used for transfers and approvals" + } + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + }, + "unsetAuthFunctionCall(string)": { + "details": "Input expected is the function signature as 'transfer(address,uint256)'", + "params": { + "_signature": "Function signature" + } + }, + "withdraw(uint256)": { + "details": "Escape hatch in case of mistakes or to recover remaining funds", + "params": { + "_amount": "Amount of tokens to withdraw" + } + } + }, + "title": "L2GraphTokenLockManager", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "addTokenDestination(address)": { + "notice": "Adds an address that can be allowed by a token lock to pull funds" + }, + "constructor": { + "notice": "Constructor for the L2GraphTokenLockManager contract." + }, + "createTokenLockWallet(address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)": { + "notice": "Creates and fund a new token lock wallet using a minimum proxy" + }, + "deposit(uint256)": { + "notice": "Deposits tokens into the contract" + }, + "getAuthFunctionCallTarget(bytes4)": { + "notice": "Gets the target contract to call for a particular function signature" + }, + "getDeploymentAddress(bytes32,address,address)": { + "notice": "Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation" + }, + "getTokenDestinations()": { + "notice": "Returns an array of authorized destination addresses" + }, + "isAuthFunctionCall(bytes4)": { + "notice": "Returns true if the function call is authorized" + }, + "isTokenDestination(address)": { + "notice": "Returns True if the address is authorized to be a destination of tokens" + }, + "l1TransferTool()": { + "notice": "Address of the L1 transfer tool contract (in L1, no aliasing)" + }, + "l1WalletToL2Wallet(address)": { + "notice": "Mapping of each L1 wallet to its L2 wallet counterpart (populated when each wallet is received) L1 address => L2 address" + }, + "l2Gateway()": { + "notice": "Address of the L2GraphTokenGateway" + }, + "l2WalletToL1Wallet(address)": { + "notice": "Mapping of each L2 wallet to its L1 wallet counterpart (populated when each wallet is received) L2 address => L1 address" + }, + "onTokenTransfer(address,uint256,bytes)": { + "notice": "This function is called by the L2GraphTokenGateway when tokens are sent from L1." + }, + "removeTokenDestination(address)": { + "notice": "Removes an address that can be allowed by a token lock to pull funds" + }, + "setAuthFunctionCall(string,address)": { + "notice": "Sets an authorized function call to target" + }, + "setAuthFunctionCallMany(string[],address[])": { + "notice": "Sets an authorized function call to target in bulk" + }, + "setMasterCopy(address)": { + "notice": "Sets the masterCopy bytecode to use to create clones of TokenLock contracts" + }, + "token()": { + "notice": "Gets the GRT token address" + }, + "unsetAuthFunctionCall(string)": { + "notice": "Unsets an authorized function call to target" + }, + "withdraw(uint256)": { + "notice": "Withdraws tokens from the contract" + } + }, + "notice": "This contract manages a list of authorized function calls and targets that can be called by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts. This contract receives funds to make the process of creating TokenLockWallet contracts easier by distributing them the initial tokens to be managed. In particular, this L2 variant is designed to receive token lock wallets from L1, through the GRT bridge. These transferred wallets will not allow releasing funds in L2 until the end of the vesting timeline, but they can allow withdrawing funds back to L1 using the L2GraphTokenLockTransferTool contract. The owner can setup a list of token destinations that will be used by TokenLock contracts to approve the pulling of funds, this way in can be guaranteed that only protocol contracts will manipulate users funds.", + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 672, + "contract": "contracts/L2GraphTokenLockManager.sol:L2GraphTokenLockManager", + "label": "_owner", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 3988, + "contract": "contracts/L2GraphTokenLockManager.sol:L2GraphTokenLockManager", + "label": "authFnCalls", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_bytes4,t_address)" + }, + { + "astId": 3990, + "contract": "contracts/L2GraphTokenLockManager.sol:L2GraphTokenLockManager", + "label": "_tokenDestinations", + "offset": 0, + "slot": "2", + "type": "t_struct(AddressSet)2629_storage" + }, + { + "astId": 3992, + "contract": "contracts/L2GraphTokenLockManager.sol:L2GraphTokenLockManager", + "label": "masterCopy", + "offset": 0, + "slot": "4", + "type": "t_address" + }, + { + "astId": 3994, + "contract": "contracts/L2GraphTokenLockManager.sol:L2GraphTokenLockManager", + "label": "_token", + "offset": 0, + "slot": "5", + "type": "t_contract(IERC20)1710" + }, + { + "astId": 6154, + "contract": "contracts/L2GraphTokenLockManager.sol:L2GraphTokenLockManager", + "label": "l1WalletToL2Wallet", + "offset": 0, + "slot": "6", + "type": "t_mapping(t_address,t_address)" + }, + { + "astId": 6159, + "contract": "contracts/L2GraphTokenLockManager.sol:L2GraphTokenLockManager", + "label": "l2WalletToL1Wallet", + "offset": 0, + "slot": "7", + "type": "t_mapping(t_address,t_address)" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_bytes32)dyn_storage": { + "base": "t_bytes32", + "encoding": "dynamic_array", + "label": "bytes32[]", + "numberOfBytes": "32" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_bytes4": { + "encoding": "inplace", + "label": "bytes4", + "numberOfBytes": "4" + }, + "t_contract(IERC20)1710": { + "encoding": "inplace", + "label": "contract IERC20", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_address)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => address)", + "numberOfBytes": "32", + "value": "t_address" + }, + "t_mapping(t_bytes32,t_uint256)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_mapping(t_bytes4,t_address)": { + "encoding": "mapping", + "key": "t_bytes4", + "label": "mapping(bytes4 => address)", + "numberOfBytes": "32", + "value": "t_address" + }, + "t_struct(AddressSet)2629_storage": { + "encoding": "inplace", + "label": "struct EnumerableSet.AddressSet", + "members": [ + { + "astId": 2628, + "contract": "contracts/L2GraphTokenLockManager.sol:L2GraphTokenLockManager", + "label": "_inner", + "offset": 0, + "slot": "0", + "type": "t_struct(Set)2364_storage" + } + ], + "numberOfBytes": "64" + }, + "t_struct(Set)2364_storage": { + "encoding": "inplace", + "label": "struct EnumerableSet.Set", + "members": [ + { + "astId": 2359, + "contract": "contracts/L2GraphTokenLockManager.sol:L2GraphTokenLockManager", + "label": "_values", + "offset": 0, + "slot": "0", + "type": "t_array(t_bytes32)dyn_storage" + }, + { + "astId": 2363, + "contract": "contracts/L2GraphTokenLockManager.sol:L2GraphTokenLockManager", + "label": "_indexes", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_bytes32,t_uint256)" + } + ], + "numberOfBytes": "64" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} \ No newline at end of file diff --git a/packages/token-distribution/deployments/arbitrum-goerli/L2GraphTokenLockTransferTool.json b/packages/token-distribution/deployments/arbitrum-goerli/L2GraphTokenLockTransferTool.json new file mode 100644 index 000000000..8f2a27976 --- /dev/null +++ b/packages/token-distribution/deployments/arbitrum-goerli/L2GraphTokenLockTransferTool.json @@ -0,0 +1,110 @@ +{ + "address": "0xc1A9C2E76171e64Cd5669B3E89D9A25a6b0FAfB7", + "abi": [ + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_graphToken", + "type": "address" + }, + { + "internalType": "contract ITokenGateway", + "name": "_l2Gateway", + "type": "address" + }, + { + "internalType": "address", + "name": "_l1GraphToken", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "l1Wallet", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "l2Wallet", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "l2LockManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "LockedFundsSentToL1", + "type": "event" + }, + { + "inputs": [], + "name": "graphToken", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "l1GraphToken", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "l2Gateway", + "outputs": [ + { + "internalType": "contract ITokenGateway", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "withdrawToL1Locked", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x4c0fdb3290d0e247de1d0863bc2a7b13ea9414a86e5bfe94f1e2eba7c5c47f70" +} \ No newline at end of file diff --git a/packages/token-distribution/deployments/arbitrum-goerli/L2GraphTokenLockWallet.json b/packages/token-distribution/deployments/arbitrum-goerli/L2GraphTokenLockWallet.json new file mode 100644 index 000000000..9b76d53e0 --- /dev/null +++ b/packages/token-distribution/deployments/arbitrum-goerli/L2GraphTokenLockWallet.json @@ -0,0 +1,1156 @@ +{ + "address": "0xc93df24c3A1ebeCcd0e5D41198460081CFB38c49", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "newBeneficiary", + "type": "address" + } + ], + "name": "BeneficiaryChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "LockAccepted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "LockCanceled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_oldManager", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "_newManager", + "type": "address" + } + ], + "name": "ManagerUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "TokenDestinationsApproved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "TokenDestinationsRevoked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensReleased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensRevoked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensWithdrawn", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "acceptLock", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "amountPerPeriod", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "approveProtocol", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "availableAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "beneficiary", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "cancelLock", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newBeneficiary", + "type": "address" + } + ], + "name": "changeBeneficiary", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "currentBalance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "currentPeriod", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "currentTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "duration", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "endTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_manager", + "type": "address" + }, + { + "internalType": "address", + "name": "_owner", + "type": "address" + }, + { + "internalType": "address", + "name": "_beneficiary", + "type": "address" + }, + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_managedAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_startTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_endTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_periods", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_releaseStartTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_vestingCliffTime", + "type": "uint256" + }, + { + "internalType": "enum IGraphTokenLock.Revocability", + "name": "_revocable", + "type": "uint8" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_manager", + "type": "address" + }, + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "components": [ + { + "internalType": "address", + "name": "l1Address", + "type": "address" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "internalType": "uint256", + "name": "managedAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "startTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "endTime", + "type": "uint256" + } + ], + "internalType": "struct L2GraphTokenLockManager.TransferredWalletData", + "name": "_walletData", + "type": "tuple" + } + ], + "name": "initializeFromL1", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "isAccepted", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isInitialized", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isRevoked", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "managedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "manager", + "outputs": [ + { + "internalType": "contract IGraphTokenLockManager", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "passedPeriods", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "periodDuration", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "periods", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "releasableAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "release", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "releaseStartTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "releasedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "revocable", + "outputs": [ + { + "internalType": "enum IGraphTokenLock.Revocability", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "revoke", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "revokeProtocol", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "revokedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newManager", + "type": "address" + } + ], + "name": "setManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "sinceStartTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "startTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "surplusAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "token", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalOutstandingAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "usedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "vestedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "vestingCliffTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "withdrawSurplus", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0x3342cbf5abb884c865fcdb43dda39ebdde525df610352ef732cff970efb0fdc9", + "receipt": { + "to": null, + "from": "0xB15599AC1261C4828Ac7E66383ae520655d3D300", + "contractAddress": "0xc93df24c3A1ebeCcd0e5D41198460081CFB38c49", + "transactionIndex": 1, + "gasUsed": "4086023", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xf5d75eaf427f71f4729137e3c372fa1fc040578674861fa4eb188d692d47b8a6", + "transactionHash": "0x3342cbf5abb884c865fcdb43dda39ebdde525df610352ef732cff970efb0fdc9", + "logs": [], + "blockNumber": 30437051, + "cumulativeGasUsed": "4086023", + "status": 1, + "byzantium": true + }, + "args": [], + "solcInputHash": "b5cdad58099d39cd1aed000b2fd864d8", + "metadata": "{\"compiler\":{\"version\":\"0.7.3+commit.9bfce1f6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newBeneficiary\",\"type\":\"address\"}],\"name\":\"BeneficiaryChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"LockAccepted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"LockCanceled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_oldManager\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_newManager\",\"type\":\"address\"}],\"name\":\"ManagerUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"TokenDestinationsApproved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"TokenDestinationsRevoked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensReleased\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensRevoked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensWithdrawn\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"acceptLock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"amountPerPeriod\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"approveProtocol\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"availableAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"beneficiary\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"cancelLock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_newBeneficiary\",\"type\":\"address\"}],\"name\":\"changeBeneficiary\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"currentBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"currentPeriod\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"currentTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"duration\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"endTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_manager\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_beneficiary\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_managedAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_startTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_endTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_periods\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_releaseStartTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_vestingCliffTime\",\"type\":\"uint256\"},{\"internalType\":\"enum IGraphTokenLock.Revocability\",\"name\":\"_revocable\",\"type\":\"uint8\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_manager\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_token\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"l1Address\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"managedAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"startTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"endTime\",\"type\":\"uint256\"}],\"internalType\":\"struct L2GraphTokenLockManager.TransferredWalletData\",\"name\":\"_walletData\",\"type\":\"tuple\"}],\"name\":\"initializeFromL1\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isAccepted\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isInitialized\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isRevoked\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"managedAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"manager\",\"outputs\":[{\"internalType\":\"contract IGraphTokenLockManager\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"passedPeriods\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"periodDuration\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"periods\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"releasableAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"release\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"releaseStartTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"releasedAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"revocable\",\"outputs\":[{\"internalType\":\"enum IGraphTokenLock.Revocability\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"revoke\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"revokeProtocol\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"revokedAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_newManager\",\"type\":\"address\"}],\"name\":\"setManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"sinceStartTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"startTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"surplusAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalOutstandingAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"usedAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"vestedAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"vestingCliffTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdrawSurplus\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"acceptLock()\":{\"details\":\"Can only be called by the beneficiary\"},\"amountPerPeriod()\":{\"returns\":{\"_0\":\"Amount of tokens available after each period\"}},\"approveProtocol()\":{\"details\":\"Approves all token destinations registered in the manager to pull tokens\"},\"availableAmount()\":{\"details\":\"Implements the step-by-step schedule based on periods for available tokens\",\"returns\":{\"_0\":\"Amount of tokens available according to the schedule\"}},\"cancelLock()\":{\"details\":\"Can only be called by the owner\"},\"changeBeneficiary(address)\":{\"details\":\"Can only be called by the beneficiary\",\"params\":{\"_newBeneficiary\":\"Address of the new beneficiary address\"}},\"currentBalance()\":{\"returns\":{\"_0\":\"Tokens held in the contract\"}},\"currentPeriod()\":{\"returns\":{\"_0\":\"A number that represents the current period\"}},\"currentTime()\":{\"returns\":{\"_0\":\"Current block timestamp\"}},\"duration()\":{\"returns\":{\"_0\":\"Amount of seconds from contract startTime to endTime\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"passedPeriods()\":{\"returns\":{\"_0\":\"A number of periods that passed since the schedule started\"}},\"periodDuration()\":{\"returns\":{\"_0\":\"Duration of each period in seconds\"}},\"releasableAmount()\":{\"details\":\"Considers the schedule, takes into account already released tokens and used amount\",\"returns\":{\"_0\":\"Amount of tokens ready to be released\"}},\"release()\":{\"details\":\"All available releasable tokens are transferred to beneficiary\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"revoke()\":{\"details\":\"Vesting schedule is always calculated based on managed tokens\"},\"revokeProtocol()\":{\"details\":\"Revokes approval to all token destinations in the manager to pull tokens\"},\"setManager(address)\":{\"params\":{\"_newManager\":\"Address of the new manager\"}},\"sinceStartTime()\":{\"details\":\"Returns zero if called before conctract starTime\",\"returns\":{\"_0\":\"Seconds elapsed from contract startTime\"}},\"surplusAmount()\":{\"details\":\"All funds over outstanding amount is considered surplus that can be withdrawn by beneficiary. Note this might not be the correct value for wallets transferred to L2 (i.e. an L2GraphTokenLockWallet), as the released amount will be skewed, so the beneficiary might have to bridge back to L1 to release the surplus.\",\"returns\":{\"_0\":\"Amount of tokens considered as surplus\"}},\"totalOutstandingAmount()\":{\"details\":\"Does not consider schedule but just global amounts tracked\",\"returns\":{\"_0\":\"Amount of outstanding tokens for the lifetime of the contract\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"vestedAmount()\":{\"details\":\"Similar to available amount, but is fully vested when contract is non-revocable\",\"returns\":{\"_0\":\"Amount of tokens already vested\"}},\"withdrawSurplus(uint256)\":{\"details\":\"Tokens in the contract over outstanding amount are considered as surplus\",\"params\":{\"_amount\":\"Amount of tokens to withdraw\"}}},\"title\":\"L2GraphTokenLockWallet\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"acceptLock()\":{\"notice\":\"Beneficiary accepts the lock, the owner cannot retrieve back the tokens\"},\"amountPerPeriod()\":{\"notice\":\"Returns amount available to be released after each period according to schedule\"},\"approveProtocol()\":{\"notice\":\"Approves protocol access of the tokens managed by this contract\"},\"availableAmount()\":{\"notice\":\"Gets the currently available token according to the schedule\"},\"cancelLock()\":{\"notice\":\"Owner cancel the lock and return the balance in the contract\"},\"changeBeneficiary(address)\":{\"notice\":\"Change the beneficiary of funds managed by the contract\"},\"currentBalance()\":{\"notice\":\"Returns the amount of tokens currently held by the contract\"},\"currentPeriod()\":{\"notice\":\"Gets the current period based on the schedule\"},\"currentTime()\":{\"notice\":\"Returns the current block timestamp\"},\"duration()\":{\"notice\":\"Gets duration of contract from start to end in seconds\"},\"passedPeriods()\":{\"notice\":\"Gets the number of periods that passed since the first period\"},\"periodDuration()\":{\"notice\":\"Returns the duration of each period in seconds\"},\"releasableAmount()\":{\"notice\":\"Gets tokens currently available for release\"},\"release()\":{\"notice\":\"Releases tokens based on the configured schedule\"},\"revoke()\":{\"notice\":\"Revokes a vesting schedule and return the unvested tokens to the owner\"},\"revokeProtocol()\":{\"notice\":\"Revokes protocol access of the tokens managed by this contract\"},\"setManager(address)\":{\"notice\":\"Sets a new manager for this contract\"},\"sinceStartTime()\":{\"notice\":\"Gets time elapsed since the start of the contract\"},\"surplusAmount()\":{\"notice\":\"Gets surplus amount in the contract based on outstanding amount to release\"},\"totalOutstandingAmount()\":{\"notice\":\"Gets the outstanding amount yet to be released based on the whole contract lifetime\"},\"vestedAmount()\":{\"notice\":\"Gets the amount of currently vested tokens\"},\"withdrawSurplus(uint256)\":{\"notice\":\"Withdraws surplus, unmanaged tokens from the contract\"}},\"notice\":\"This contract is built on top of the base GraphTokenLock functionality. It allows wallet beneficiaries to use the deposited funds to perform specific function calls on specific contracts. The idea is that supporters with locked tokens can participate in the protocol but disallow any release before the vesting/lock schedule. The beneficiary can issue authorized function calls to this contract that will get forwarded to a target contract. A target contract is any of our protocol contracts. The function calls allowed are queried to the GraphTokenLockManager, this way the same configuration can be shared for all the created lock wallet contracts. This L2 variant includes a special initializer so that it can be created from a wallet's data received from L1. These transferred wallets will not allow releasing funds in L2 until the end of the vesting timeline, but they can allow withdrawing funds back to L1 using the L2GraphTokenLockTransferTool contract. Note that surplusAmount and releasedAmount in L2 will be skewed for wallets received from L1, so releasing surplus tokens might also only be possible by bridging tokens back to L1. NOTE: Contracts used as target must have its function signatures checked to avoid collisions with any of this contract functions. Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience the maximum amount of tokens is authorized. Function calls do not forward ETH value so DO NOT SEND ETH TO THIS CONTRACT.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/L2GraphTokenLockWallet.sol\":\"L2GraphTokenLockWallet\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor () internal {\\n address msgSender = _msgSender();\\n _owner = msgSender;\\n emit OwnershipTransferred(address(0), msgSender);\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n emit OwnershipTransferred(_owner, address(0));\\n _owner = address(0);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n emit OwnershipTransferred(_owner, newOwner);\\n _owner = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0x15e2d5bd4c28a88548074c54d220e8086f638a71ed07e6b3ba5a70066fcf458d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/math/SafeMath.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Wrappers over Solidity's arithmetic operations with added overflow\\n * checks.\\n *\\n * Arithmetic operations in Solidity wrap on overflow. This can easily result\\n * in bugs, because programmers usually assume that an overflow raises an\\n * error, which is the standard behavior in high level programming languages.\\n * `SafeMath` restores this intuition by reverting the transaction when an\\n * operation overflows.\\n *\\n * Using this library instead of the unchecked operations eliminates an entire\\n * class of bugs, so it's recommended to use it always.\\n */\\nlibrary SafeMath {\\n /**\\n * @dev Returns the addition of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n uint256 c = a + b;\\n if (c < a) return (false, 0);\\n return (true, c);\\n }\\n\\n /**\\n * @dev Returns the substraction of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b > a) return (false, 0);\\n return (true, a - b);\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\\n if (a == 0) return (true, 0);\\n uint256 c = a * b;\\n if (c / a != b) return (false, 0);\\n return (true, c);\\n }\\n\\n /**\\n * @dev Returns the division of two unsigned integers, with a division by zero flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b == 0) return (false, 0);\\n return (true, a / b);\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b == 0) return (false, 0);\\n return (true, a % b);\\n }\\n\\n /**\\n * @dev Returns the addition of two unsigned integers, reverting on\\n * overflow.\\n *\\n * Counterpart to Solidity's `+` operator.\\n *\\n * Requirements:\\n *\\n * - Addition cannot overflow.\\n */\\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\\n uint256 c = a + b;\\n require(c >= a, \\\"SafeMath: addition overflow\\\");\\n return c;\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting on\\n * overflow (when the result is negative).\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n *\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b <= a, \\\"SafeMath: subtraction overflow\\\");\\n return a - b;\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, reverting on\\n * overflow.\\n *\\n * Counterpart to Solidity's `*` operator.\\n *\\n * Requirements:\\n *\\n * - Multiplication cannot overflow.\\n */\\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\\n if (a == 0) return 0;\\n uint256 c = a * b;\\n require(c / a == b, \\\"SafeMath: multiplication overflow\\\");\\n return c;\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers, reverting on\\n * division by zero. The result is rounded towards zero.\\n *\\n * Counterpart to Solidity's `/` operator. Note: this function uses a\\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\\n * uses an invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b > 0, \\\"SafeMath: division by zero\\\");\\n return a / b;\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * reverting when dividing by zero.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b > 0, \\\"SafeMath: modulo by zero\\\");\\n return a % b;\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\\n * overflow (when the result is negative).\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {trySub}.\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n *\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b <= a, errorMessage);\\n return a - b;\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers, reverting with custom message on\\n * division by zero. The result is rounded towards zero.\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {tryDiv}.\\n *\\n * Counterpart to Solidity's `/` operator. Note: this function uses a\\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\\n * uses an invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b > 0, errorMessage);\\n return a / b;\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * reverting with custom message when dividing by zero.\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {tryMod}.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b > 0, errorMessage);\\n return a % b;\\n }\\n}\\n\",\"keccak256\":\"0xcc78a17dd88fa5a2edc60c8489e2f405c0913b377216a5b26b35656b2d0dab52\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `recipient`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address recipient, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `sender` to `recipient` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n}\\n\",\"keccak256\":\"0x5f02220344881ce43204ae4a6281145a67bc52c2bb1290a791857df3d19d78f5\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\nimport \\\"./IERC20.sol\\\";\\nimport \\\"../../math/SafeMath.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @title SafeERC20\\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\\n * contract returns false). Tokens that return no value (and instead revert or\\n * throw on failure) are also supported, non-reverting calls are assumed to be\\n * successful.\\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\n */\\nlibrary SafeERC20 {\\n using SafeMath for uint256;\\n using Address for address;\\n\\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\\n }\\n\\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\\n }\\n\\n /**\\n * @dev Deprecated. This function has issues similar to the ones found in\\n * {IERC20-approve}, and its usage is discouraged.\\n *\\n * Whenever possible, use {safeIncreaseAllowance} and\\n * {safeDecreaseAllowance} instead.\\n */\\n function safeApprove(IERC20 token, address spender, uint256 value) internal {\\n // safeApprove should only be called when setting an initial allowance,\\n // or when resetting it to zero. To increase and decrease it, use\\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\\n // solhint-disable-next-line max-line-length\\n require((value == 0) || (token.allowance(address(this), spender) == 0),\\n \\\"SafeERC20: approve from non-zero to non-zero allowance\\\"\\n );\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\\n }\\n\\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n uint256 newAllowance = token.allowance(address(this), spender).add(value);\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n uint256 newAllowance = token.allowance(address(this), spender).sub(value, \\\"SafeERC20: decreased allowance below zero\\\");\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n */\\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that\\n // the target address contains contract code and also asserts for success in the low-level call.\\n\\n bytes memory returndata = address(token).functionCall(data, \\\"SafeERC20: low-level call failed\\\");\\n if (returndata.length > 0) { // Return data is optional\\n // solhint-disable-next-line max-line-length\\n require(abi.decode(returndata, (bool)), \\\"SafeERC20: ERC20 operation did not succeed\\\");\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf12dfbe97e6276980b83d2830bb0eb75e0cf4f3e626c2471137f82158ae6a0fc\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.2 <0.8.0;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize, which returns 0 for contracts in\\n // construction, since the code is only stored at the end of the\\n // constructor execution.\\n\\n uint256 size;\\n // solhint-disable-next-line no-inline-assembly\\n assembly { size := extcodesize(account) }\\n return size > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls, avoid-call-value\\n (bool success, ) = recipient.call{ value: amount }(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain`call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.call{ value: value }(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x28911e614500ae7c607a432a709d35da25f3bc5ddc8bd12b278b66358070c0ea\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/*\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with GSN meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address payable) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes memory) {\\n this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0x8d3cb350f04ff49cfb10aef08d87f19dcbaecc8027b0bed12f3275cd12f38cf0\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Create2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Helper to make usage of the `CREATE2` EVM opcode easier and safer.\\n * `CREATE2` can be used to compute in advance the address where a smart\\n * contract will be deployed, which allows for interesting new mechanisms known\\n * as 'counterfactual interactions'.\\n *\\n * See the https://eips.ethereum.org/EIPS/eip-1014#motivation[EIP] for more\\n * information.\\n */\\nlibrary Create2 {\\n /**\\n * @dev Deploys a contract using `CREATE2`. The address where the contract\\n * will be deployed can be known in advance via {computeAddress}.\\n *\\n * The bytecode for a contract can be obtained from Solidity with\\n * `type(contractName).creationCode`.\\n *\\n * Requirements:\\n *\\n * - `bytecode` must not be empty.\\n * - `salt` must have not been used for `bytecode` already.\\n * - the factory must have a balance of at least `amount`.\\n * - if `amount` is non-zero, `bytecode` must have a `payable` constructor.\\n */\\n function deploy(uint256 amount, bytes32 salt, bytes memory bytecode) internal returns (address) {\\n address addr;\\n require(address(this).balance >= amount, \\\"Create2: insufficient balance\\\");\\n require(bytecode.length != 0, \\\"Create2: bytecode length is zero\\\");\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n addr := create2(amount, add(bytecode, 0x20), mload(bytecode), salt)\\n }\\n require(addr != address(0), \\\"Create2: Failed on deploy\\\");\\n return addr;\\n }\\n\\n /**\\n * @dev Returns the address where a contract will be stored if deployed via {deploy}. Any change in the\\n * `bytecodeHash` or `salt` will result in a new destination address.\\n */\\n function computeAddress(bytes32 salt, bytes32 bytecodeHash) internal view returns (address) {\\n return computeAddress(salt, bytecodeHash, address(this));\\n }\\n\\n /**\\n * @dev Returns the address where a contract will be stored if deployed via {deploy} from a contract located at\\n * `deployer`. If `deployer` is this contract's address, returns the same value as {computeAddress}.\\n */\\n function computeAddress(bytes32 salt, bytes32 bytecodeHash, address deployer) internal pure returns (address) {\\n bytes32 _data = keccak256(\\n abi.encodePacked(bytes1(0xff), deployer, salt, bytecodeHash)\\n );\\n return address(uint160(uint256(_data)));\\n }\\n}\\n\",\"keccak256\":\"0x0a0b021149946014fe1cd04af11e7a937a29986c47e8b1b718c2d50d729472db\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/EnumerableSet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Library for managing\\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\\n * types.\\n *\\n * Sets have the following properties:\\n *\\n * - Elements are added, removed, and checked for existence in constant time\\n * (O(1)).\\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\\n *\\n * ```\\n * contract Example {\\n * // Add the library methods\\n * using EnumerableSet for EnumerableSet.AddressSet;\\n *\\n * // Declare a set state variable\\n * EnumerableSet.AddressSet private mySet;\\n * }\\n * ```\\n *\\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\\n * and `uint256` (`UintSet`) are supported.\\n */\\nlibrary EnumerableSet {\\n // To implement this library for multiple types with as little code\\n // repetition as possible, we write it in terms of a generic Set type with\\n // bytes32 values.\\n // The Set implementation uses private functions, and user-facing\\n // implementations (such as AddressSet) are just wrappers around the\\n // underlying Set.\\n // This means that we can only create new EnumerableSets for types that fit\\n // in bytes32.\\n\\n struct Set {\\n // Storage of set values\\n bytes32[] _values;\\n\\n // Position of the value in the `values` array, plus 1 because index 0\\n // means a value is not in the set.\\n mapping (bytes32 => uint256) _indexes;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function _add(Set storage set, bytes32 value) private returns (bool) {\\n if (!_contains(set, value)) {\\n set._values.push(value);\\n // The value is stored at length-1, but we add 1 to all indexes\\n // and use 0 as a sentinel value\\n set._indexes[value] = set._values.length;\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function _remove(Set storage set, bytes32 value) private returns (bool) {\\n // We read and store the value's index to prevent multiple reads from the same storage slot\\n uint256 valueIndex = set._indexes[value];\\n\\n if (valueIndex != 0) { // Equivalent to contains(set, value)\\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\\n // the array, and then remove the last element (sometimes called as 'swap and pop').\\n // This modifies the order of the array, as noted in {at}.\\n\\n uint256 toDeleteIndex = valueIndex - 1;\\n uint256 lastIndex = set._values.length - 1;\\n\\n // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs\\n // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.\\n\\n bytes32 lastvalue = set._values[lastIndex];\\n\\n // Move the last value to the index where the value to delete is\\n set._values[toDeleteIndex] = lastvalue;\\n // Update the index for the moved value\\n set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based\\n\\n // Delete the slot where the moved value was stored\\n set._values.pop();\\n\\n // Delete the index for the deleted slot\\n delete set._indexes[value];\\n\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\\n return set._indexes[value] != 0;\\n }\\n\\n /**\\n * @dev Returns the number of values on the set. O(1).\\n */\\n function _length(Set storage set) private view returns (uint256) {\\n return set._values.length;\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\\n require(set._values.length > index, \\\"EnumerableSet: index out of bounds\\\");\\n return set._values[index];\\n }\\n\\n // Bytes32Set\\n\\n struct Bytes32Set {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _add(set._inner, value);\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _remove(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\\n return _contains(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(Bytes32Set storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\\n return _at(set._inner, index);\\n }\\n\\n // AddressSet\\n\\n struct AddressSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(AddressSet storage set, address value) internal returns (bool) {\\n return _add(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(AddressSet storage set, address value) internal returns (bool) {\\n return _remove(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(AddressSet storage set, address value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(AddressSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\\n return address(uint160(uint256(_at(set._inner, index))));\\n }\\n\\n\\n // UintSet\\n\\n struct UintSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(UintSet storage set, uint256 value) internal returns (bool) {\\n return _add(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\\n return _remove(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns the number of values on the set. O(1).\\n */\\n function length(UintSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\\n return uint256(_at(set._inner, index));\\n }\\n}\\n\",\"keccak256\":\"0x1562cd9922fbf739edfb979f506809e2743789cbde3177515542161c3d04b164\",\"license\":\"MIT\"},\"contracts/GraphTokenLock.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nimport \\\"@openzeppelin/contracts/math/SafeMath.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\\\";\\n\\nimport { Ownable as OwnableInitializable } from \\\"./Ownable.sol\\\";\\nimport \\\"./MathUtils.sol\\\";\\nimport \\\"./IGraphTokenLock.sol\\\";\\n\\n/**\\n * @title GraphTokenLock\\n * @notice Contract that manages an unlocking schedule of tokens.\\n * @dev The contract lock manage a number of tokens deposited into the contract to ensure that\\n * they can only be released under certain time conditions.\\n *\\n * This contract implements a release scheduled based on periods and tokens are released in steps\\n * after each period ends. It can be configured with one period in which case it is like a plain TimeLock.\\n * It also supports revocation to be used for vesting schedules.\\n *\\n * The contract supports receiving extra funds than the managed tokens ones that can be\\n * withdrawn by the beneficiary at any time.\\n *\\n * A releaseStartTime parameter is included to override the default release schedule and\\n * perform the first release on the configured time. After that it will continue with the\\n * default schedule.\\n */\\nabstract contract GraphTokenLock is OwnableInitializable, IGraphTokenLock {\\n using SafeMath for uint256;\\n using SafeERC20 for IERC20;\\n\\n uint256 private constant MIN_PERIOD = 1;\\n\\n // -- State --\\n\\n IERC20 public token;\\n address public beneficiary;\\n\\n // Configuration\\n\\n // Amount of tokens managed by the contract schedule\\n uint256 public managedAmount;\\n\\n uint256 public startTime; // Start datetime (in unixtimestamp)\\n uint256 public endTime; // Datetime after all funds are fully vested/unlocked (in unixtimestamp)\\n uint256 public periods; // Number of vesting/release periods\\n\\n // First release date for tokens (in unixtimestamp)\\n // If set, no tokens will be released before releaseStartTime ignoring\\n // the amount to release each period\\n uint256 public releaseStartTime;\\n // A cliff set a date to which a beneficiary needs to get to vest\\n // all preceding periods\\n uint256 public vestingCliffTime;\\n Revocability public revocable; // Whether to use vesting for locked funds\\n\\n // State\\n\\n bool public isRevoked;\\n bool public isInitialized;\\n bool public isAccepted;\\n uint256 public releasedAmount;\\n uint256 public revokedAmount;\\n\\n // -- Events --\\n\\n event TokensReleased(address indexed beneficiary, uint256 amount);\\n event TokensWithdrawn(address indexed beneficiary, uint256 amount);\\n event TokensRevoked(address indexed beneficiary, uint256 amount);\\n event BeneficiaryChanged(address newBeneficiary);\\n event LockAccepted();\\n event LockCanceled();\\n\\n /**\\n * @dev Only allow calls from the beneficiary of the contract\\n */\\n modifier onlyBeneficiary() {\\n require(msg.sender == beneficiary, \\\"!auth\\\");\\n _;\\n }\\n\\n /**\\n * @notice Initializes the contract\\n * @param _owner Address of the contract owner\\n * @param _beneficiary Address of the beneficiary of locked tokens\\n * @param _managedAmount Amount of tokens to be managed by the lock contract\\n * @param _startTime Start time of the release schedule\\n * @param _endTime End time of the release schedule\\n * @param _periods Number of periods between start time and end time\\n * @param _releaseStartTime Override time for when the releases start\\n * @param _vestingCliffTime Override time for when the vesting start\\n * @param _revocable Whether the contract is revocable\\n */\\n function _initialize(\\n address _owner,\\n address _beneficiary,\\n address _token,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n Revocability _revocable\\n ) internal {\\n require(!isInitialized, \\\"Already initialized\\\");\\n require(_owner != address(0), \\\"Owner cannot be zero\\\");\\n require(_beneficiary != address(0), \\\"Beneficiary cannot be zero\\\");\\n require(_token != address(0), \\\"Token cannot be zero\\\");\\n require(_managedAmount > 0, \\\"Managed tokens cannot be zero\\\");\\n require(_startTime != 0, \\\"Start time must be set\\\");\\n require(_startTime < _endTime, \\\"Start time > end time\\\");\\n require(_periods >= MIN_PERIOD, \\\"Periods cannot be below minimum\\\");\\n require(_revocable != Revocability.NotSet, \\\"Must set a revocability option\\\");\\n require(_releaseStartTime < _endTime, \\\"Release start time must be before end time\\\");\\n require(_vestingCliffTime < _endTime, \\\"Cliff time must be before end time\\\");\\n\\n isInitialized = true;\\n\\n OwnableInitializable._initialize(_owner);\\n beneficiary = _beneficiary;\\n token = IERC20(_token);\\n\\n managedAmount = _managedAmount;\\n\\n startTime = _startTime;\\n endTime = _endTime;\\n periods = _periods;\\n\\n // Optionals\\n releaseStartTime = _releaseStartTime;\\n vestingCliffTime = _vestingCliffTime;\\n revocable = _revocable;\\n }\\n\\n /**\\n * @notice Change the beneficiary of funds managed by the contract\\n * @dev Can only be called by the beneficiary\\n * @param _newBeneficiary Address of the new beneficiary address\\n */\\n function changeBeneficiary(address _newBeneficiary) external onlyBeneficiary {\\n require(_newBeneficiary != address(0), \\\"Empty beneficiary\\\");\\n beneficiary = _newBeneficiary;\\n emit BeneficiaryChanged(_newBeneficiary);\\n }\\n\\n /**\\n * @notice Beneficiary accepts the lock, the owner cannot retrieve back the tokens\\n * @dev Can only be called by the beneficiary\\n */\\n function acceptLock() external onlyBeneficiary {\\n isAccepted = true;\\n emit LockAccepted();\\n }\\n\\n /**\\n * @notice Owner cancel the lock and return the balance in the contract\\n * @dev Can only be called by the owner\\n */\\n function cancelLock() external onlyOwner {\\n require(isAccepted == false, \\\"Cannot cancel accepted contract\\\");\\n\\n token.safeTransfer(owner(), currentBalance());\\n\\n emit LockCanceled();\\n }\\n\\n // -- Balances --\\n\\n /**\\n * @notice Returns the amount of tokens currently held by the contract\\n * @return Tokens held in the contract\\n */\\n function currentBalance() public view override returns (uint256) {\\n return token.balanceOf(address(this));\\n }\\n\\n // -- Time & Periods --\\n\\n /**\\n * @notice Returns the current block timestamp\\n * @return Current block timestamp\\n */\\n function currentTime() public view override returns (uint256) {\\n return block.timestamp;\\n }\\n\\n /**\\n * @notice Gets duration of contract from start to end in seconds\\n * @return Amount of seconds from contract startTime to endTime\\n */\\n function duration() public view override returns (uint256) {\\n return endTime.sub(startTime);\\n }\\n\\n /**\\n * @notice Gets time elapsed since the start of the contract\\n * @dev Returns zero if called before conctract starTime\\n * @return Seconds elapsed from contract startTime\\n */\\n function sinceStartTime() public view override returns (uint256) {\\n uint256 current = currentTime();\\n if (current <= startTime) {\\n return 0;\\n }\\n return current.sub(startTime);\\n }\\n\\n /**\\n * @notice Returns amount available to be released after each period according to schedule\\n * @return Amount of tokens available after each period\\n */\\n function amountPerPeriod() public view override returns (uint256) {\\n return managedAmount.div(periods);\\n }\\n\\n /**\\n * @notice Returns the duration of each period in seconds\\n * @return Duration of each period in seconds\\n */\\n function periodDuration() public view override returns (uint256) {\\n return duration().div(periods);\\n }\\n\\n /**\\n * @notice Gets the current period based on the schedule\\n * @return A number that represents the current period\\n */\\n function currentPeriod() public view override returns (uint256) {\\n return sinceStartTime().div(periodDuration()).add(MIN_PERIOD);\\n }\\n\\n /**\\n * @notice Gets the number of periods that passed since the first period\\n * @return A number of periods that passed since the schedule started\\n */\\n function passedPeriods() public view override returns (uint256) {\\n return currentPeriod().sub(MIN_PERIOD);\\n }\\n\\n // -- Locking & Release Schedule --\\n\\n /**\\n * @notice Gets the currently available token according to the schedule\\n * @dev Implements the step-by-step schedule based on periods for available tokens\\n * @return Amount of tokens available according to the schedule\\n */\\n function availableAmount() public view override returns (uint256) {\\n uint256 current = currentTime();\\n\\n // Before contract start no funds are available\\n if (current < startTime) {\\n return 0;\\n }\\n\\n // After contract ended all funds are available\\n if (current > endTime) {\\n return managedAmount;\\n }\\n\\n // Get available amount based on period\\n return passedPeriods().mul(amountPerPeriod());\\n }\\n\\n /**\\n * @notice Gets the amount of currently vested tokens\\n * @dev Similar to available amount, but is fully vested when contract is non-revocable\\n * @return Amount of tokens already vested\\n */\\n function vestedAmount() public view override returns (uint256) {\\n // If non-revocable it is fully vested\\n if (revocable == Revocability.Disabled) {\\n return managedAmount;\\n }\\n\\n // Vesting cliff is activated and it has not passed means nothing is vested yet\\n if (vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\\n return 0;\\n }\\n\\n return availableAmount();\\n }\\n\\n /**\\n * @notice Gets tokens currently available for release\\n * @dev Considers the schedule and takes into account already released tokens\\n * @return Amount of tokens ready to be released\\n */\\n function releasableAmount() public view virtual override returns (uint256) {\\n // If a release start time is set no tokens are available for release before this date\\n // If not set it follows the default schedule and tokens are available on\\n // the first period passed\\n if (releaseStartTime > 0 && currentTime() < releaseStartTime) {\\n return 0;\\n }\\n\\n // Vesting cliff is activated and it has not passed means nothing is vested yet\\n // so funds cannot be released\\n if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\\n return 0;\\n }\\n\\n // A beneficiary can never have more releasable tokens than the contract balance\\n uint256 releasable = availableAmount().sub(releasedAmount);\\n return MathUtils.min(currentBalance(), releasable);\\n }\\n\\n /**\\n * @notice Gets the outstanding amount yet to be released based on the whole contract lifetime\\n * @dev Does not consider schedule but just global amounts tracked\\n * @return Amount of outstanding tokens for the lifetime of the contract\\n */\\n function totalOutstandingAmount() public view override returns (uint256) {\\n return managedAmount.sub(releasedAmount).sub(revokedAmount);\\n }\\n\\n /**\\n * @notice Gets surplus amount in the contract based on outstanding amount to release\\n * @dev All funds over outstanding amount is considered surplus that can be withdrawn by beneficiary.\\n * Note this might not be the correct value for wallets transferred to L2 (i.e. an L2GraphTokenLockWallet), as the released amount will be\\n * skewed, so the beneficiary might have to bridge back to L1 to release the surplus.\\n * @return Amount of tokens considered as surplus\\n */\\n function surplusAmount() public view override returns (uint256) {\\n uint256 balance = currentBalance();\\n uint256 outstandingAmount = totalOutstandingAmount();\\n if (balance > outstandingAmount) {\\n return balance.sub(outstandingAmount);\\n }\\n return 0;\\n }\\n\\n // -- Value Transfer --\\n\\n /**\\n * @notice Releases tokens based on the configured schedule\\n * @dev All available releasable tokens are transferred to beneficiary\\n */\\n function release() external override onlyBeneficiary {\\n uint256 amountToRelease = releasableAmount();\\n require(amountToRelease > 0, \\\"No available releasable amount\\\");\\n\\n releasedAmount = releasedAmount.add(amountToRelease);\\n\\n token.safeTransfer(beneficiary, amountToRelease);\\n\\n emit TokensReleased(beneficiary, amountToRelease);\\n }\\n\\n /**\\n * @notice Withdraws surplus, unmanaged tokens from the contract\\n * @dev Tokens in the contract over outstanding amount are considered as surplus\\n * @param _amount Amount of tokens to withdraw\\n */\\n function withdrawSurplus(uint256 _amount) external override onlyBeneficiary {\\n require(_amount > 0, \\\"Amount cannot be zero\\\");\\n require(surplusAmount() >= _amount, \\\"Amount requested > surplus available\\\");\\n\\n token.safeTransfer(beneficiary, _amount);\\n\\n emit TokensWithdrawn(beneficiary, _amount);\\n }\\n\\n /**\\n * @notice Revokes a vesting schedule and return the unvested tokens to the owner\\n * @dev Vesting schedule is always calculated based on managed tokens\\n */\\n function revoke() external override onlyOwner {\\n require(revocable == Revocability.Enabled, \\\"Contract is non-revocable\\\");\\n require(isRevoked == false, \\\"Already revoked\\\");\\n\\n uint256 unvestedAmount = managedAmount.sub(vestedAmount());\\n require(unvestedAmount > 0, \\\"No available unvested amount\\\");\\n\\n revokedAmount = unvestedAmount;\\n isRevoked = true;\\n\\n token.safeTransfer(owner(), unvestedAmount);\\n\\n emit TokensRevoked(beneficiary, unvestedAmount);\\n }\\n}\\n\",\"keccak256\":\"0xd89470956a476c2fcf4a09625775573f95ba2c60a57fe866d90f65de1bcf5f2d\",\"license\":\"MIT\"},\"contracts/GraphTokenLockManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/EnumerableSet.sol\\\";\\nimport { Ownable } from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\n\\nimport \\\"./MinimalProxyFactory.sol\\\";\\nimport \\\"./IGraphTokenLockManager.sol\\\";\\nimport { GraphTokenLockWallet } from \\\"./GraphTokenLockWallet.sol\\\";\\n\\n/**\\n * @title GraphTokenLockManager\\n * @notice This contract manages a list of authorized function calls and targets that can be called\\n * by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts.\\n *\\n * This contract receives funds to make the process of creating TokenLockWallet contracts\\n * easier by distributing them the initial tokens to be managed.\\n *\\n * The owner can setup a list of token destinations that will be used by TokenLock contracts to\\n * approve the pulling of funds, this way in can be guaranteed that only protocol contracts\\n * will manipulate users funds.\\n */\\ncontract GraphTokenLockManager is Ownable, MinimalProxyFactory, IGraphTokenLockManager {\\n using SafeERC20 for IERC20;\\n using EnumerableSet for EnumerableSet.AddressSet;\\n\\n // -- State --\\n\\n mapping(bytes4 => address) public authFnCalls;\\n EnumerableSet.AddressSet private _tokenDestinations;\\n\\n address public masterCopy;\\n IERC20 internal _token;\\n\\n // -- Events --\\n\\n event MasterCopyUpdated(address indexed masterCopy);\\n event TokenLockCreated(\\n address indexed contractAddress,\\n bytes32 indexed initHash,\\n address indexed beneficiary,\\n address token,\\n uint256 managedAmount,\\n uint256 startTime,\\n uint256 endTime,\\n uint256 periods,\\n uint256 releaseStartTime,\\n uint256 vestingCliffTime,\\n IGraphTokenLock.Revocability revocable\\n );\\n\\n event TokensDeposited(address indexed sender, uint256 amount);\\n event TokensWithdrawn(address indexed sender, uint256 amount);\\n\\n event FunctionCallAuth(address indexed caller, bytes4 indexed sigHash, address indexed target, string signature);\\n event TokenDestinationAllowed(address indexed dst, bool allowed);\\n\\n /**\\n * Constructor.\\n * @param _graphToken Token to use for deposits and withdrawals\\n * @param _masterCopy Address of the master copy to use to clone proxies\\n */\\n constructor(IERC20 _graphToken, address _masterCopy) {\\n require(address(_graphToken) != address(0), \\\"Token cannot be zero\\\");\\n _token = _graphToken;\\n setMasterCopy(_masterCopy);\\n }\\n\\n // -- Factory --\\n\\n /**\\n * @notice Sets the masterCopy bytecode to use to create clones of TokenLock contracts\\n * @param _masterCopy Address of contract bytecode to factory clone\\n */\\n function setMasterCopy(address _masterCopy) public override onlyOwner {\\n require(_masterCopy != address(0), \\\"MasterCopy cannot be zero\\\");\\n masterCopy = _masterCopy;\\n emit MasterCopyUpdated(_masterCopy);\\n }\\n\\n /**\\n * @notice Creates and fund a new token lock wallet using a minimum proxy\\n * @param _owner Address of the contract owner\\n * @param _beneficiary Address of the beneficiary of locked tokens\\n * @param _managedAmount Amount of tokens to be managed by the lock contract\\n * @param _startTime Start time of the release schedule\\n * @param _endTime End time of the release schedule\\n * @param _periods Number of periods between start time and end time\\n * @param _releaseStartTime Override time for when the releases start\\n * @param _revocable Whether the contract is revocable\\n */\\n function createTokenLockWallet(\\n address _owner,\\n address _beneficiary,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n IGraphTokenLock.Revocability _revocable\\n ) external override onlyOwner {\\n require(_token.balanceOf(address(this)) >= _managedAmount, \\\"Not enough tokens to create lock\\\");\\n\\n // Create contract using a minimal proxy and call initializer\\n bytes memory initializer = abi.encodeWithSelector(\\n GraphTokenLockWallet.initialize.selector,\\n address(this),\\n _owner,\\n _beneficiary,\\n address(_token),\\n _managedAmount,\\n _startTime,\\n _endTime,\\n _periods,\\n _releaseStartTime,\\n _vestingCliffTime,\\n _revocable\\n );\\n address contractAddress = _deployProxy2(keccak256(initializer), masterCopy, initializer);\\n\\n // Send managed amount to the created contract\\n _token.safeTransfer(contractAddress, _managedAmount);\\n\\n emit TokenLockCreated(\\n contractAddress,\\n keccak256(initializer),\\n _beneficiary,\\n address(_token),\\n _managedAmount,\\n _startTime,\\n _endTime,\\n _periods,\\n _releaseStartTime,\\n _vestingCliffTime,\\n _revocable\\n );\\n }\\n\\n // -- Funds Management --\\n\\n /**\\n * @notice Gets the GRT token address\\n * @return Token used for transfers and approvals\\n */\\n function token() external view override returns (IERC20) {\\n return _token;\\n }\\n\\n /**\\n * @notice Deposits tokens into the contract\\n * @dev Even if the ERC20 token can be transferred directly to the contract\\n * this function provide a safe interface to do the transfer and avoid mistakes\\n * @param _amount Amount to deposit\\n */\\n function deposit(uint256 _amount) external override {\\n require(_amount > 0, \\\"Amount cannot be zero\\\");\\n _token.safeTransferFrom(msg.sender, address(this), _amount);\\n emit TokensDeposited(msg.sender, _amount);\\n }\\n\\n /**\\n * @notice Withdraws tokens from the contract\\n * @dev Escape hatch in case of mistakes or to recover remaining funds\\n * @param _amount Amount of tokens to withdraw\\n */\\n function withdraw(uint256 _amount) external override onlyOwner {\\n require(_amount > 0, \\\"Amount cannot be zero\\\");\\n _token.safeTransfer(msg.sender, _amount);\\n emit TokensWithdrawn(msg.sender, _amount);\\n }\\n\\n // -- Token Destinations --\\n\\n /**\\n * @notice Adds an address that can be allowed by a token lock to pull funds\\n * @param _dst Destination address\\n */\\n function addTokenDestination(address _dst) external override onlyOwner {\\n require(_dst != address(0), \\\"Destination cannot be zero\\\");\\n require(_tokenDestinations.add(_dst), \\\"Destination already added\\\");\\n emit TokenDestinationAllowed(_dst, true);\\n }\\n\\n /**\\n * @notice Removes an address that can be allowed by a token lock to pull funds\\n * @param _dst Destination address\\n */\\n function removeTokenDestination(address _dst) external override onlyOwner {\\n require(_tokenDestinations.remove(_dst), \\\"Destination already removed\\\");\\n emit TokenDestinationAllowed(_dst, false);\\n }\\n\\n /**\\n * @notice Returns True if the address is authorized to be a destination of tokens\\n * @param _dst Destination address\\n * @return True if authorized\\n */\\n function isTokenDestination(address _dst) external view override returns (bool) {\\n return _tokenDestinations.contains(_dst);\\n }\\n\\n /**\\n * @notice Returns an array of authorized destination addresses\\n * @return Array of addresses authorized to pull funds from a token lock\\n */\\n function getTokenDestinations() external view override returns (address[] memory) {\\n address[] memory dstList = new address[](_tokenDestinations.length());\\n for (uint256 i = 0; i < _tokenDestinations.length(); i++) {\\n dstList[i] = _tokenDestinations.at(i);\\n }\\n return dstList;\\n }\\n\\n // -- Function Call Authorization --\\n\\n /**\\n * @notice Sets an authorized function call to target\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @param _signature Function signature\\n * @param _target Address of the destination contract to call\\n */\\n function setAuthFunctionCall(string calldata _signature, address _target) external override onlyOwner {\\n _setAuthFunctionCall(_signature, _target);\\n }\\n\\n /**\\n * @notice Unsets an authorized function call to target\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @param _signature Function signature\\n */\\n function unsetAuthFunctionCall(string calldata _signature) external override onlyOwner {\\n bytes4 sigHash = _toFunctionSigHash(_signature);\\n authFnCalls[sigHash] = address(0);\\n\\n emit FunctionCallAuth(msg.sender, sigHash, address(0), _signature);\\n }\\n\\n /**\\n * @notice Sets an authorized function call to target in bulk\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @param _signatures Function signatures\\n * @param _targets Address of the destination contract to call\\n */\\n function setAuthFunctionCallMany(\\n string[] calldata _signatures,\\n address[] calldata _targets\\n ) external override onlyOwner {\\n require(_signatures.length == _targets.length, \\\"Array length mismatch\\\");\\n\\n for (uint256 i = 0; i < _signatures.length; i++) {\\n _setAuthFunctionCall(_signatures[i], _targets[i]);\\n }\\n }\\n\\n /**\\n * @notice Sets an authorized function call to target\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @dev Function signatures of Graph Protocol contracts to be used are known ahead of time\\n * @param _signature Function signature\\n * @param _target Address of the destination contract to call\\n */\\n function _setAuthFunctionCall(string calldata _signature, address _target) internal {\\n require(_target != address(this), \\\"Target must be other contract\\\");\\n require(Address.isContract(_target), \\\"Target must be a contract\\\");\\n\\n bytes4 sigHash = _toFunctionSigHash(_signature);\\n authFnCalls[sigHash] = _target;\\n\\n emit FunctionCallAuth(msg.sender, sigHash, _target, _signature);\\n }\\n\\n /**\\n * @notice Gets the target contract to call for a particular function signature\\n * @param _sigHash Function signature hash\\n * @return Address of the target contract where to send the call\\n */\\n function getAuthFunctionCallTarget(bytes4 _sigHash) public view override returns (address) {\\n return authFnCalls[_sigHash];\\n }\\n\\n /**\\n * @notice Returns true if the function call is authorized\\n * @param _sigHash Function signature hash\\n * @return True if authorized\\n */\\n function isAuthFunctionCall(bytes4 _sigHash) external view override returns (bool) {\\n return getAuthFunctionCallTarget(_sigHash) != address(0);\\n }\\n\\n /**\\n * @dev Converts a function signature string to 4-bytes hash\\n * @param _signature Function signature string\\n * @return Function signature hash\\n */\\n function _toFunctionSigHash(string calldata _signature) internal pure returns (bytes4) {\\n return _convertToBytes4(abi.encodeWithSignature(_signature));\\n }\\n\\n /**\\n * @dev Converts function signature bytes to function signature hash (bytes4)\\n * @param _signature Function signature\\n * @return Function signature in bytes4\\n */\\n function _convertToBytes4(bytes memory _signature) internal pure returns (bytes4) {\\n require(_signature.length == 4, \\\"Invalid method signature\\\");\\n bytes4 sigHash;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n sigHash := mload(add(_signature, 32))\\n }\\n return sigHash;\\n }\\n}\\n\",\"keccak256\":\"0x2bb51cc1a18bd88113fd6947067ad2fff33048c8904cb54adfda8e2ab86752f2\",\"license\":\"MIT\"},\"contracts/GraphTokenLockWallet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"@openzeppelin/contracts/math/SafeMath.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nimport \\\"./GraphTokenLock.sol\\\";\\nimport \\\"./IGraphTokenLockManager.sol\\\";\\n\\n/**\\n * @title GraphTokenLockWallet\\n * @notice This contract is built on top of the base GraphTokenLock functionality.\\n * It allows wallet beneficiaries to use the deposited funds to perform specific function calls\\n * on specific contracts.\\n *\\n * The idea is that supporters with locked tokens can participate in the protocol\\n * but disallow any release before the vesting/lock schedule.\\n * The beneficiary can issue authorized function calls to this contract that will\\n * get forwarded to a target contract. A target contract is any of our protocol contracts.\\n * The function calls allowed are queried to the GraphTokenLockManager, this way\\n * the same configuration can be shared for all the created lock wallet contracts.\\n *\\n * NOTE: Contracts used as target must have its function signatures checked to avoid collisions\\n * with any of this contract functions.\\n * Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience\\n * the maximum amount of tokens is authorized.\\n * Function calls do not forward ETH value so DO NOT SEND ETH TO THIS CONTRACT.\\n */\\ncontract GraphTokenLockWallet is GraphTokenLock {\\n using SafeMath for uint256;\\n\\n // -- State --\\n\\n IGraphTokenLockManager public manager;\\n uint256 public usedAmount;\\n\\n // -- Events --\\n\\n event ManagerUpdated(address indexed _oldManager, address indexed _newManager);\\n event TokenDestinationsApproved();\\n event TokenDestinationsRevoked();\\n\\n // Initializer\\n function initialize(\\n address _manager,\\n address _owner,\\n address _beneficiary,\\n address _token,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n Revocability _revocable\\n ) external {\\n _initialize(\\n _owner,\\n _beneficiary,\\n _token,\\n _managedAmount,\\n _startTime,\\n _endTime,\\n _periods,\\n _releaseStartTime,\\n _vestingCliffTime,\\n _revocable\\n );\\n _setManager(_manager);\\n }\\n\\n // -- Admin --\\n\\n /**\\n * @notice Sets a new manager for this contract\\n * @param _newManager Address of the new manager\\n */\\n function setManager(address _newManager) external onlyOwner {\\n _setManager(_newManager);\\n }\\n\\n /**\\n * @dev Sets a new manager for this contract\\n * @param _newManager Address of the new manager\\n */\\n function _setManager(address _newManager) internal {\\n require(_newManager != address(0), \\\"Manager cannot be empty\\\");\\n require(Address.isContract(_newManager), \\\"Manager must be a contract\\\");\\n\\n address oldManager = address(manager);\\n manager = IGraphTokenLockManager(_newManager);\\n\\n emit ManagerUpdated(oldManager, _newManager);\\n }\\n\\n // -- Beneficiary --\\n\\n /**\\n * @notice Approves protocol access of the tokens managed by this contract\\n * @dev Approves all token destinations registered in the manager to pull tokens\\n */\\n function approveProtocol() external onlyBeneficiary {\\n address[] memory dstList = manager.getTokenDestinations();\\n for (uint256 i = 0; i < dstList.length; i++) {\\n // Note this is only safe because we are using the max uint256 value\\n token.approve(dstList[i], type(uint256).max);\\n }\\n emit TokenDestinationsApproved();\\n }\\n\\n /**\\n * @notice Revokes protocol access of the tokens managed by this contract\\n * @dev Revokes approval to all token destinations in the manager to pull tokens\\n */\\n function revokeProtocol() external onlyBeneficiary {\\n address[] memory dstList = manager.getTokenDestinations();\\n for (uint256 i = 0; i < dstList.length; i++) {\\n // Note this is only safe cause we're using 0 as the amount\\n token.approve(dstList[i], 0);\\n }\\n emit TokenDestinationsRevoked();\\n }\\n\\n /**\\n * @notice Gets tokens currently available for release\\n * @dev Considers the schedule, takes into account already released tokens and used amount\\n * @return Amount of tokens ready to be released\\n */\\n function releasableAmount() public view override returns (uint256) {\\n if (revocable == Revocability.Disabled) {\\n return super.releasableAmount();\\n }\\n\\n // -- Revocability enabled logic\\n // This needs to deal with additional considerations for when tokens are used in the protocol\\n\\n // If a release start time is set no tokens are available for release before this date\\n // If not set it follows the default schedule and tokens are available on\\n // the first period passed\\n if (releaseStartTime > 0 && currentTime() < releaseStartTime) {\\n return 0;\\n }\\n\\n // Vesting cliff is activated and it has not passed means nothing is vested yet\\n // so funds cannot be released\\n if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\\n return 0;\\n }\\n\\n // A beneficiary can never have more releasable tokens than the contract balance\\n // We consider the `usedAmount` in the protocol as part of the calculations\\n // the beneficiary should not release funds that are used.\\n uint256 releasable = availableAmount().sub(releasedAmount).sub(usedAmount);\\n return MathUtils.min(currentBalance(), releasable);\\n }\\n\\n /**\\n * @notice Forward authorized contract calls to protocol contracts\\n * @dev Fallback function can be called by the beneficiary only if function call is allowed\\n */\\n // solhint-disable-next-line no-complex-fallback\\n fallback() external payable {\\n // Only beneficiary can forward calls\\n require(msg.sender == beneficiary, \\\"Unauthorized caller\\\");\\n require(msg.value == 0, \\\"ETH transfers not supported\\\");\\n\\n // Function call validation\\n address _target = manager.getAuthFunctionCallTarget(msg.sig);\\n require(_target != address(0), \\\"Unauthorized function\\\");\\n\\n uint256 oldBalance = currentBalance();\\n\\n // Call function with data\\n Address.functionCall(_target, msg.data);\\n\\n // Tracked used tokens in the protocol\\n // We do this check after balances were updated by the forwarded call\\n // Check is only enforced for revocable contracts to save some gas\\n if (revocable == Revocability.Enabled) {\\n // Track contract balance change\\n uint256 newBalance = currentBalance();\\n if (newBalance < oldBalance) {\\n // Outflow\\n uint256 diff = oldBalance.sub(newBalance);\\n usedAmount = usedAmount.add(diff);\\n } else {\\n // Inflow: We can receive profits from the protocol, that could make usedAmount to\\n // underflow. We set it to zero in that case.\\n uint256 diff = newBalance.sub(oldBalance);\\n usedAmount = (diff >= usedAmount) ? 0 : usedAmount.sub(diff);\\n }\\n require(usedAmount <= vestedAmount(), \\\"Cannot use more tokens than vested amount\\\");\\n }\\n }\\n\\n /**\\n * @notice Receive function that always reverts.\\n * @dev Only included to supress warnings, see https://github.com/ethereum/solidity/issues/10159\\n */\\n receive() external payable {\\n revert(\\\"Bad call\\\");\\n }\\n}\\n\",\"keccak256\":\"0x976c2ba4c1503a81ea02bd84539c516e99af611ff767968ee25456b50a6deb7b\",\"license\":\"MIT\"},\"contracts/ICallhookReceiver.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\n\\n// Copied from graphprotocol/contracts, changed solidity version to 0.7.3\\n\\n/**\\n * @title Interface for contracts that can receive callhooks through the Arbitrum GRT bridge\\n * @dev Any contract that can receive a callhook on L2, sent through the bridge from L1, must\\n * be allowlisted by the governor, but also implement this interface that contains\\n * the function that will actually be called by the L2GraphTokenGateway.\\n */\\npragma solidity ^0.7.3;\\n\\ninterface ICallhookReceiver {\\n /**\\n * @notice Receive tokens with a callhook from the bridge\\n * @param _from Token sender in L1\\n * @param _amount Amount of tokens that were transferred\\n * @param _data ABI-encoded callhook data\\n */\\n function onTokenTransfer(address _from, uint256 _amount, bytes calldata _data) external;\\n}\\n\",\"keccak256\":\"0xb90eae14e8bac012a4b99fabe7a1110f70143eb78476ea0d6b52557ef979fa0e\",\"license\":\"GPL-2.0-or-later\"},\"contracts/IGraphTokenLock.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\ninterface IGraphTokenLock {\\n enum Revocability {\\n NotSet,\\n Enabled,\\n Disabled\\n }\\n\\n // -- Balances --\\n\\n function currentBalance() external view returns (uint256);\\n\\n // -- Time & Periods --\\n\\n function currentTime() external view returns (uint256);\\n\\n function duration() external view returns (uint256);\\n\\n function sinceStartTime() external view returns (uint256);\\n\\n function amountPerPeriod() external view returns (uint256);\\n\\n function periodDuration() external view returns (uint256);\\n\\n function currentPeriod() external view returns (uint256);\\n\\n function passedPeriods() external view returns (uint256);\\n\\n // -- Locking & Release Schedule --\\n\\n function availableAmount() external view returns (uint256);\\n\\n function vestedAmount() external view returns (uint256);\\n\\n function releasableAmount() external view returns (uint256);\\n\\n function totalOutstandingAmount() external view returns (uint256);\\n\\n function surplusAmount() external view returns (uint256);\\n\\n // -- Value Transfer --\\n\\n function release() external;\\n\\n function withdrawSurplus(uint256 _amount) external;\\n\\n function revoke() external;\\n}\\n\",\"keccak256\":\"0xceb9d258276fe25ec858191e1deae5778f1b2f612a669fb7b37bab1a064756ab\",\"license\":\"MIT\"},\"contracts/IGraphTokenLockManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nimport \\\"./IGraphTokenLock.sol\\\";\\n\\ninterface IGraphTokenLockManager {\\n // -- Factory --\\n\\n function setMasterCopy(address _masterCopy) external;\\n\\n function createTokenLockWallet(\\n address _owner,\\n address _beneficiary,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n IGraphTokenLock.Revocability _revocable\\n ) external;\\n\\n // -- Funds Management --\\n\\n function token() external returns (IERC20);\\n\\n function deposit(uint256 _amount) external;\\n\\n function withdraw(uint256 _amount) external;\\n\\n // -- Allowed Funds Destinations --\\n\\n function addTokenDestination(address _dst) external;\\n\\n function removeTokenDestination(address _dst) external;\\n\\n function isTokenDestination(address _dst) external view returns (bool);\\n\\n function getTokenDestinations() external view returns (address[] memory);\\n\\n // -- Function Call Authorization --\\n\\n function setAuthFunctionCall(string calldata _signature, address _target) external;\\n\\n function unsetAuthFunctionCall(string calldata _signature) external;\\n\\n function setAuthFunctionCallMany(string[] calldata _signatures, address[] calldata _targets) external;\\n\\n function getAuthFunctionCallTarget(bytes4 _sigHash) external view returns (address);\\n\\n function isAuthFunctionCall(bytes4 _sigHash) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x2d78d41909a6de5b316ac39b100ea087a8f317cf306379888a045523e15c4d9a\",\"license\":\"MIT\"},\"contracts/L2GraphTokenLockManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport { SafeERC20 } from \\\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\\\";\\n\\nimport { ICallhookReceiver } from \\\"./ICallhookReceiver.sol\\\";\\nimport { GraphTokenLockManager } from \\\"./GraphTokenLockManager.sol\\\";\\nimport { L2GraphTokenLockWallet } from \\\"./L2GraphTokenLockWallet.sol\\\";\\n\\n/**\\n * @title L2GraphTokenLockManager\\n * @notice This contract manages a list of authorized function calls and targets that can be called\\n * by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts.\\n *\\n * This contract receives funds to make the process of creating TokenLockWallet contracts\\n * easier by distributing them the initial tokens to be managed.\\n *\\n * In particular, this L2 variant is designed to receive token lock wallets from L1,\\n * through the GRT bridge. These transferred wallets will not allow releasing funds in L2 until\\n * the end of the vesting timeline, but they can allow withdrawing funds back to L1 using\\n * the L2GraphTokenLockTransferTool contract.\\n *\\n * The owner can setup a list of token destinations that will be used by TokenLock contracts to\\n * approve the pulling of funds, this way in can be guaranteed that only protocol contracts\\n * will manipulate users funds.\\n */\\ncontract L2GraphTokenLockManager is GraphTokenLockManager, ICallhookReceiver {\\n using SafeERC20 for IERC20;\\n\\n /// @dev Struct to hold the data of a transferred wallet; this is\\n /// the data that must be encoded in L1 to send a wallet to L2.\\n struct TransferredWalletData {\\n address l1Address;\\n address owner;\\n address beneficiary;\\n uint256 managedAmount;\\n uint256 startTime;\\n uint256 endTime;\\n }\\n\\n /// Address of the L2GraphTokenGateway\\n address public immutable l2Gateway;\\n /// Address of the L1 transfer tool contract (in L1, no aliasing)\\n address public immutable l1TransferTool;\\n /// Mapping of each L1 wallet to its L2 wallet counterpart (populated when each wallet is received)\\n /// L1 address => L2 address\\n mapping(address => address) public l1WalletToL2Wallet;\\n /// Mapping of each L2 wallet to its L1 wallet counterpart (populated when each wallet is received)\\n /// L2 address => L1 address\\n mapping(address => address) public l2WalletToL1Wallet;\\n\\n /// @dev Event emitted when a wallet is received and created from L1\\n event TokenLockCreatedFromL1(\\n address indexed contractAddress,\\n bytes32 initHash,\\n address indexed beneficiary,\\n uint256 managedAmount,\\n uint256 startTime,\\n uint256 endTime,\\n address indexed l1Address\\n );\\n\\n /// @dev Emitted when locked tokens are received from L1 (whether the wallet\\n /// had already been received or not)\\n event LockedTokensReceivedFromL1(address indexed l1Address, address indexed l2Address, uint256 amount);\\n\\n /**\\n * @dev Checks that the sender is the L2GraphTokenGateway.\\n */\\n modifier onlyL2Gateway() {\\n require(msg.sender == l2Gateway, \\\"ONLY_GATEWAY\\\");\\n _;\\n }\\n\\n /**\\n * @notice Constructor for the L2GraphTokenLockManager contract.\\n * @param _graphToken Address of the L2 GRT token contract\\n * @param _masterCopy Address of the master copy of the L2GraphTokenLockWallet implementation\\n * @param _l2Gateway Address of the L2GraphTokenGateway contract\\n * @param _l1TransferTool Address of the L1 transfer tool contract (in L1, without aliasing)\\n */\\n constructor(\\n IERC20 _graphToken,\\n address _masterCopy,\\n address _l2Gateway,\\n address _l1TransferTool\\n ) GraphTokenLockManager(_graphToken, _masterCopy) {\\n l2Gateway = _l2Gateway;\\n l1TransferTool = _l1TransferTool;\\n }\\n\\n /**\\n * @notice This function is called by the L2GraphTokenGateway when tokens are sent from L1.\\n * @dev This function will create a new wallet if it doesn't exist yet, or send the tokens to\\n * the existing wallet if it does.\\n * @param _from Address of the sender in L1, which must be the L1GraphTokenLockTransferTool\\n * @param _amount Amount of tokens received\\n * @param _data Encoded data of the transferred wallet, which must be an ABI-encoded TransferredWalletData struct\\n */\\n function onTokenTransfer(address _from, uint256 _amount, bytes calldata _data) external override onlyL2Gateway {\\n require(_from == l1TransferTool, \\\"ONLY_TRANSFER_TOOL\\\");\\n TransferredWalletData memory walletData = abi.decode(_data, (TransferredWalletData));\\n\\n if (l1WalletToL2Wallet[walletData.l1Address] != address(0)) {\\n // If the wallet was already received, just send the tokens to the L2 address\\n _token.safeTransfer(l1WalletToL2Wallet[walletData.l1Address], _amount);\\n } else {\\n // Create contract using a minimal proxy and call initializer\\n (bytes32 initHash, address contractAddress) = _deployFromL1(keccak256(_data), walletData);\\n l1WalletToL2Wallet[walletData.l1Address] = contractAddress;\\n l2WalletToL1Wallet[contractAddress] = walletData.l1Address;\\n\\n // Send managed amount to the created contract\\n _token.safeTransfer(contractAddress, _amount);\\n\\n emit TokenLockCreatedFromL1(\\n contractAddress,\\n initHash,\\n walletData.beneficiary,\\n walletData.managedAmount,\\n walletData.startTime,\\n walletData.endTime,\\n walletData.l1Address\\n );\\n }\\n emit LockedTokensReceivedFromL1(walletData.l1Address, l1WalletToL2Wallet[walletData.l1Address], _amount);\\n }\\n\\n /**\\n * @dev Deploy a token lock wallet with data received from L1\\n * @param _salt Salt for the CREATE2 call, which must be the hash of the wallet data\\n * @param _walletData Data of the wallet to be created\\n * @return Hash of the initialization calldata\\n * @return Address of the created contract\\n */\\n function _deployFromL1(bytes32 _salt, TransferredWalletData memory _walletData) internal returns (bytes32, address) {\\n bytes memory initializer = _encodeInitializer(_walletData);\\n address contractAddress = _deployProxy2(_salt, masterCopy, initializer);\\n return (keccak256(initializer), contractAddress);\\n }\\n\\n /**\\n * @dev Encode the initializer for the token lock wallet received from L1\\n * @param _walletData Data of the wallet to be created\\n * @return Encoded initializer calldata, including the function signature\\n */\\n function _encodeInitializer(TransferredWalletData memory _walletData) internal view returns (bytes memory) {\\n return\\n abi.encodeWithSelector(\\n L2GraphTokenLockWallet.initializeFromL1.selector,\\n address(this),\\n address(_token),\\n _walletData\\n );\\n }\\n}\\n\",\"keccak256\":\"0x34ca0ffc898ce3615a000d53a9c58708354b8cd8093b3c61decfe7388f0c16e0\",\"license\":\"MIT\"},\"contracts/L2GraphTokenLockWallet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nimport { GraphTokenLockWallet } from \\\"./GraphTokenLockWallet.sol\\\";\\nimport { Ownable as OwnableInitializable } from \\\"./Ownable.sol\\\";\\nimport { L2GraphTokenLockManager } from \\\"./L2GraphTokenLockManager.sol\\\";\\n\\n/**\\n * @title L2GraphTokenLockWallet\\n * @notice This contract is built on top of the base GraphTokenLock functionality.\\n * It allows wallet beneficiaries to use the deposited funds to perform specific function calls\\n * on specific contracts.\\n *\\n * The idea is that supporters with locked tokens can participate in the protocol\\n * but disallow any release before the vesting/lock schedule.\\n * The beneficiary can issue authorized function calls to this contract that will\\n * get forwarded to a target contract. A target contract is any of our protocol contracts.\\n * The function calls allowed are queried to the GraphTokenLockManager, this way\\n * the same configuration can be shared for all the created lock wallet contracts.\\n *\\n * This L2 variant includes a special initializer so that it can be created from\\n * a wallet's data received from L1. These transferred wallets will not allow releasing\\n * funds in L2 until the end of the vesting timeline, but they can allow withdrawing\\n * funds back to L1 using the L2GraphTokenLockTransferTool contract.\\n *\\n * Note that surplusAmount and releasedAmount in L2 will be skewed for wallets received from L1,\\n * so releasing surplus tokens might also only be possible by bridging tokens back to L1.\\n *\\n * NOTE: Contracts used as target must have its function signatures checked to avoid collisions\\n * with any of this contract functions.\\n * Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience\\n * the maximum amount of tokens is authorized.\\n * Function calls do not forward ETH value so DO NOT SEND ETH TO THIS CONTRACT.\\n */\\ncontract L2GraphTokenLockWallet is GraphTokenLockWallet {\\n // Initializer when created from a message from L1\\n function initializeFromL1(\\n address _manager,\\n address _token,\\n L2GraphTokenLockManager.TransferredWalletData calldata _walletData\\n ) external {\\n require(!isInitialized, \\\"Already initialized\\\");\\n isInitialized = true;\\n\\n OwnableInitializable._initialize(_walletData.owner);\\n beneficiary = _walletData.beneficiary;\\n token = IERC20(_token);\\n\\n managedAmount = _walletData.managedAmount;\\n\\n startTime = _walletData.startTime;\\n endTime = _walletData.endTime;\\n periods = 1;\\n isAccepted = true;\\n\\n // Optionals\\n releaseStartTime = _walletData.endTime;\\n revocable = Revocability.Disabled;\\n\\n _setManager(_manager);\\n }\\n}\\n\",\"keccak256\":\"0x8842140c2c7924be4ab1bca71e0b0ad6dd1dba6433cfdc523bfd204288b25d20\",\"license\":\"MIT\"},\"contracts/MathUtils.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nlibrary MathUtils {\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n}\\n\",\"keccak256\":\"0xe2512e1da48bc8363acd15f66229564b02d66706665d7da740604566913c1400\",\"license\":\"MIT\"},\"contracts/MinimalProxyFactory.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nimport { Address } from \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport { Create2 } from \\\"@openzeppelin/contracts/utils/Create2.sol\\\";\\n\\n/**\\n * @title MinimalProxyFactory: a factory contract for creating minimal proxies\\n * @notice Adapted from https://github.com/OpenZeppelin/openzeppelin-sdk/blob/v2.5.0/packages/lib/contracts/upgradeability/ProxyFactory.sol\\n * Based on https://eips.ethereum.org/EIPS/eip-1167\\n */\\ncontract MinimalProxyFactory {\\n /// @dev Emitted when a new proxy is created\\n event ProxyCreated(address indexed proxy);\\n\\n /**\\n * @notice Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation\\n * @param _salt Bytes32 salt to use for CREATE2\\n * @param _implementation Address of the proxy target implementation\\n * @param _deployer Address of the deployer that creates the contract\\n * @return Address of the counterfactual MinimalProxy\\n */\\n function getDeploymentAddress(\\n bytes32 _salt,\\n address _implementation,\\n address _deployer\\n ) public pure returns (address) {\\n return Create2.computeAddress(_salt, keccak256(_getContractCreationCode(_implementation)), _deployer);\\n }\\n\\n /**\\n * @dev Deploys a MinimalProxy with CREATE2\\n * @param _salt Bytes32 salt to use for CREATE2\\n * @param _implementation Address of the proxy target implementation\\n * @param _data Bytes with the initializer call\\n * @return Address of the deployed MinimalProxy\\n */\\n function _deployProxy2(bytes32 _salt, address _implementation, bytes memory _data) internal returns (address) {\\n address proxyAddress = Create2.deploy(0, _salt, _getContractCreationCode(_implementation));\\n\\n emit ProxyCreated(proxyAddress);\\n\\n // Call function with data\\n if (_data.length > 0) {\\n Address.functionCall(proxyAddress, _data);\\n }\\n\\n return proxyAddress;\\n }\\n\\n /**\\n * @dev Gets the MinimalProxy bytecode\\n * @param _implementation Address of the proxy target implementation\\n * @return MinimalProxy bytecode\\n */\\n function _getContractCreationCode(address _implementation) internal pure returns (bytes memory) {\\n bytes10 creation = 0x3d602d80600a3d3981f3;\\n bytes10 prefix = 0x363d3d373d3d3d363d73;\\n bytes20 targetBytes = bytes20(_implementation);\\n bytes15 suffix = 0x5af43d82803e903d91602b57fd5bf3;\\n return abi.encodePacked(creation, prefix, targetBytes, suffix);\\n }\\n}\\n\",\"keccak256\":\"0x67d67a567bceb363ddb199b1e4ab06e7a99f16e034e03086971a332c09ec5c0e\",\"license\":\"MIT\"},\"contracts/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * The owner account will be passed on initialization of the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\ncontract Ownable {\\n /// @dev Owner of the contract, can be retrieved with the public owner() function\\n address private _owner;\\n /// @dev Since upgradeable contracts might inherit this, we add a storage gap\\n /// to allow adding variables here without breaking the proxy storage layout\\n uint256[50] private __gap;\\n\\n /// @dev Emitted when ownership of the contract is transferred\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n function _initialize(address owner) internal {\\n _owner = owner;\\n emit OwnershipTransferred(address(0), owner);\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(_owner == msg.sender, \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() external virtual onlyOwner {\\n emit OwnershipTransferred(_owner, address(0));\\n _owner = address(0);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) external virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n emit OwnershipTransferred(_owner, newOwner);\\n _owner = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0xe8750687082e8e24b620dbf58c3a08eee591ed7b4d5a3e13cc93554ec647fd09\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b506148f5806100206000396000f3fe6080604052600436106102605760003560e01c80637bdf05af11610144578063bc0163c1116100b6578063dc0706571161007a578063dc07065714610bc7578063e8dda6f514610bf0578063e97d87d514610c1b578063ebbab99214610c46578063f2fde38b14610c71578063fc0c546a14610c9a576102a0565b8063bc0163c114610af4578063bd896dcb14610b1f578063ce845d1d14610b48578063d0ebdbe714610b73578063d18e81b314610b9c576102a0565b80638da5cb5b116101085780638da5cb5b14610a0857806391f7cfb914610a33578063a4caeb4214610a5e578063b0d1818c14610a89578063b470aade14610ab2578063b6549f7514610add576102a0565b80637bdf05af1461095957806386d00e021461098457806386d1a69f146109af578063872a7810146109c65780638a5bdf5c146109f1576102a0565b806338af3eed116101dd578063481c6a75116101a1578063481c6a751461087f5780635051a5ec146108aa5780635b940081146108d557806360e7994414610900578063715018a61461091757806378e979251461092e576102a0565b806338af3eed146107a8578063392e53cd146107d3578063398057a3146107fe57806344b1231f1461082957806345d30a1714610854576102a0565b806320dc203d1161022457806320dc203d146106e75780632a627814146107105780632bc9ed02146107275780633197cbb61461075257806337aeb0861461077d576102a0565b8063029c6c9f14610624578063060406181461064f5780630b80f7771461067a5780630dff24d5146106915780630fb5a6b4146106bc576102a0565b366102a0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610297906141f3565b60405180910390fd5b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610330576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610327906143d3565b60405180910390fd5b60003414610373576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161036a90614213565b60405180910390fd5b6000603e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f1d24c456000357fffffffff00000000000000000000000000000000000000000000000000000000166040518263ffffffff1660e01b81526004016103f49190614165565b60206040518083038186803b15801561040c57600080fd5b505afa158015610420573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610444919061338f565b9050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156104b6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104ad906144d3565b60405180910390fd5b60006104c0610cc5565b9050610511826000368080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610d77565b506001600281111561051f57fe5b603b60009054906101000a900460ff16600281111561053a57fe5b141561062057600061054a610cc5565b90508181101561058c5760006105698284610dc190919063ffffffff16565b905061058081603f54610e1190919063ffffffff16565b603f81905550506105d2565b60006105a18383610dc190919063ffffffff16565b9050603f548110156105c7576105c281603f54610dc190919063ffffffff16565b6105ca565b60005b603f81905550505b6105da610e66565b603f54111561061e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161061590614433565b60405180910390fd5b505b5050005b34801561063057600080fd5b50610639610ed5565b6040516106469190614673565b60405180910390f35b34801561065b57600080fd5b50610664610ef3565b6040516106719190614673565b60405180910390f35b34801561068657600080fd5b5061068f610f2e565b005b34801561069d57600080fd5b506106a661109b565b6040516106b39190614673565b60405180910390f35b3480156106c857600080fd5b506106d16110e2565b6040516106de9190614673565b60405180910390f35b3480156106f357600080fd5b5061070e600480360381019061070991906134a8565b611100565b005b34801561071c57600080fd5b5061072561129b565b005b34801561073357600080fd5b5061073c611500565b604051610749919061414a565b60405180910390f35b34801561075e57600080fd5b50610767611513565b6040516107749190614673565b60405180910390f35b34801561078957600080fd5b50610792611519565b60405161079f9190614673565b60405180910390f35b3480156107b457600080fd5b506107bd61151f565b6040516107ca91906140dd565b60405180910390f35b3480156107df57600080fd5b506107e8611545565b6040516107f5919061414a565b60405180910390f35b34801561080a57600080fd5b50610813611558565b6040516108209190614673565b60405180910390f35b34801561083557600080fd5b5061083e610e66565b60405161084b9190614673565b60405180910390f35b34801561086057600080fd5b5061086961155e565b6040516108769190614673565b60405180910390f35b34801561088b57600080fd5b50610894611564565b6040516108a1919061419b565b60405180910390f35b3480156108b657600080fd5b506108bf61158a565b6040516108cc919061414a565b60405180910390f35b3480156108e157600080fd5b506108ea61159d565b6040516108f79190614673565b60405180910390f35b34801561090c57600080fd5b506109156116a8565b005b34801561092357600080fd5b5061092c6118ee565b005b34801561093a57600080fd5b50610943611a3a565b6040516109509190614673565b60405180910390f35b34801561096557600080fd5b5061096e611a40565b60405161097b9190614673565b60405180910390f35b34801561099057600080fd5b50610999611a7c565b6040516109a69190614673565b60405180910390f35b3480156109bb57600080fd5b506109c4611a82565b005b3480156109d257600080fd5b506109db611c5e565b6040516109e891906141b6565b60405180910390f35b3480156109fd57600080fd5b50610a06611c71565b005b348015610a1457600080fd5b50610a1d611d4a565b604051610a2a91906140dd565b60405180910390f35b348015610a3f57600080fd5b50610a48611d73565b604051610a559190614673565b60405180910390f35b348015610a6a57600080fd5b50610a73611dd1565b604051610a809190614673565b60405180910390f35b348015610a9557600080fd5b50610ab06004803603810190610aab9190613562565b611dd7565b005b348015610abe57600080fd5b50610ac7611fd6565b604051610ad49190614673565b60405180910390f35b348015610ae957600080fd5b50610af2611ff9565b005b348015610b0057600080fd5b50610b09612291565b604051610b169190614673565b60405180910390f35b348015610b2b57600080fd5b50610b466004803603810190610b4191906133b8565b6122c3565b005b348015610b5457600080fd5b50610b5d610cc5565b604051610b6a9190614673565b60405180910390f35b348015610b7f57600080fd5b50610b9a6004803603810190610b959190613366565b6122eb565b005b348015610ba857600080fd5b50610bb1612385565b604051610bbe9190614673565b60405180910390f35b348015610bd357600080fd5b50610bee6004803603810190610be99190613366565b61238d565b005b348015610bfc57600080fd5b50610c05612508565b604051610c129190614673565b60405180910390f35b348015610c2757600080fd5b50610c3061250e565b604051610c3d9190614673565b60405180910390f35b348015610c5257600080fd5b50610c5b612514565b604051610c689190614673565b60405180910390f35b348015610c7d57600080fd5b50610c986004803603810190610c939190613366565b612536565b005b348015610ca657600080fd5b50610caf6126f1565b604051610cbc9190614180565b60405180910390f35b6000603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610d2291906140dd565b60206040518083038186803b158015610d3a57600080fd5b505afa158015610d4e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d72919061358b565b905090565b6060610db983836040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c65640000815250612717565b905092915050565b600082821115610e06576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dfd90614333565b60405180910390fd5b818303905092915050565b600080828401905083811015610e5c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e53906142b3565b60405180910390fd5b8091505092915050565b6000600280811115610e7457fe5b603b60009054906101000a900460ff166002811115610e8f57fe5b1415610e9f576035549050610ed2565b6000603a54118015610eb95750603a54610eb7612385565b105b15610ec75760009050610ed2565b610ecf611d73565b90505b90565b6000610eee60385460355461272f90919063ffffffff16565b905090565b6000610f296001610f1b610f05611fd6565b610f0d611a40565b61272f90919063ffffffff16565b610e1190919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610fbc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fb390614493565b60405180910390fd5b60001515603b60039054906101000a900460ff16151514611012576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161100990614313565b60405180910390fd5b61106d61101d611d4a565b611025610cc5565b603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166127859092919063ffffffff16565b7f171f0bcbda3370351cea17f3b164bee87d77c2503b94abdf2720a814ebe7e9df60405160405180910390a1565b6000806110a6610cc5565b905060006110b2612291565b9050808211156110d8576110cf8183610dc190919063ffffffff16565b925050506110df565b6000925050505b90565b60006110fb603654603754610dc190919063ffffffff16565b905090565b603b60029054906101000a900460ff1615611150576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161114790614533565b60405180910390fd5b6001603b60026101000a81548160ff0219169083151502179055506111868160200160208101906111819190613366565b61280b565b8060400160208101906111999190613366565b603460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081603360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550806060013560358190555080608001356036819055508060a0013560378190555060016038819055506001603b60036101000a81548160ff0219169083151502179055508060a001356039819055506002603b60006101000a81548160ff0219169083600281111561128857fe5b0217905550611296836128a9565b505050565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461132b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161132290614593565b60405180910390fd5b6060603e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a34574666040518163ffffffff1660e01b815260040160006040518083038186803b15801561139557600080fd5b505afa1580156113a9573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906113d291906134f8565b905060005b81518110156114d057603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b383838151811061142a57fe5b60200260200101517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611470929190614121565b602060405180830381600087803b15801561148a57600080fd5b505af115801561149e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114c29190613539565b5080806001019150506113d7565b507fb837fd51506ba3cc623a37c78ed22fd521f2f6e9f69a34d5c2a4a9474f27579360405160405180910390a150565b603b60019054906101000a900460ff1681565b60375481565b603d5481565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b603b60029054906101000a900460ff1681565b60355481565b603c5481565b603e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b603b60039054906101000a900460ff1681565b60006002808111156115ab57fe5b603b60009054906101000a900460ff1660028111156115c657fe5b14156115db576115d4612a27565b90506116a5565b60006039541180156115f557506039546115f3612385565b105b1561160357600090506116a5565b6001600281111561161057fe5b603b60009054906101000a900460ff16600281111561162b57fe5b14801561163a57506000603a54115b801561164e5750603a5461164c612385565b105b1561165c57600090506116a5565b600061168e603f54611680603c54611672611d73565b610dc190919063ffffffff16565b610dc190919063ffffffff16565b90506116a161169b610cc5565b82612ae1565b9150505b90565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611738576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161172f90614593565b60405180910390fd5b6060603e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a34574666040518163ffffffff1660e01b815260040160006040518083038186803b1580156117a257600080fd5b505afa1580156117b6573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906117df91906134f8565b905060005b81518110156118be57603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b383838151811061183757fe5b602002602001015160006040518363ffffffff1660e01b815260040161185e9291906140f8565b602060405180830381600087803b15801561187857600080fd5b505af115801561188c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118b09190613539565b5080806001019150506117e4565b507f6d317a20ba9d790014284bef285283cd61fde92e0f2711050f563a9d2cf4171160405160405180910390a150565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461197c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161197390614493565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60365481565b600080611a4b612385565b90506036548111611a60576000915050611a79565b611a7560365482610dc190919063ffffffff16565b9150505b90565b603a5481565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611b12576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b0990614593565b60405180910390fd5b6000611b1c61159d565b905060008111611b61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b58906145f3565b60405180910390fd5b611b7681603c54610e1190919063ffffffff16565b603c81905550611beb603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166127859092919063ffffffff16565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fc7798891864187665ac6dd119286e44ec13f014527aeeb2b8eb3fd413df9317982604051611c539190614673565b60405180910390a250565b603b60009054906101000a900460ff1681565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611d01576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cf890614593565b60405180910390fd5b6001603b60036101000a81548160ff0219169083151502179055507fbeb3313724453131feb0a765a03e6715bb720e0f973a31fcbafa2d2f048c188b60405160405180910390a1565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600080611d7e612385565b9050603654811015611d94576000915050611dce565b603754811115611da957603554915050611dce565b611dca611db4610ed5565b611dbc612514565b612afa90919063ffffffff16565b9150505b90565b60385481565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611e67576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e5e90614593565b60405180910390fd5b60008111611eaa576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ea190614413565b60405180910390fd5b80611eb361109b565b1015611ef4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611eeb90614513565b60405180910390fd5b611f63603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166127859092919063ffffffff16565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b82604051611fcb9190614673565b60405180910390a250565b6000611ff4603854611fe66110e2565b61272f90919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612087576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161207e90614493565b60405180910390fd5b6001600281111561209457fe5b603b60009054906101000a900460ff1660028111156120af57fe5b146120ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120e690614553565b60405180910390fd5b60001515603b60019054906101000a900460ff16151514612145576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161213c90614653565b60405180910390fd5b6000612163612152610e66565b603554610dc190919063ffffffff16565b9050600081116121a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161219f906142d3565b60405180910390fd5b80603d819055506001603b60016101000a81548160ff02191690831515021790555061221e6121d5611d4a565b82603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166127859092919063ffffffff16565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fb73c49a3a37a7aca291ba0ceaa41657012def406106a7fc386888f0f66e941cf826040516122869190614673565b60405180910390a250565b60006122be603d546122b0603c54603554610dc190919063ffffffff16565b610dc190919063ffffffff16565b905090565b6122d58a8a8a8a8a8a8a8a8a8a612b6a565b6122de8b6128a9565b5050505050505050505050565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612379576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161237090614493565b60405180910390fd5b612382816128a9565b50565b600042905090565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461241d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161241490614593565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561248d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612484906143b3565b60405180910390fd5b80603460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f373c72efabe4ef3e552ff77838be729f3bc3d8c586df0012902d1baa2377fa1d816040516124fd91906140dd565b60405180910390a150565b603f5481565b60395481565b60006125316001612523610ef3565b610dc190919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146125c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125bb90614493565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612634576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161262b90614293565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60606127268484600085612ff4565b90509392505050565b6000808211612773576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161276a90614393565b60405180910390fd5b81838161277c57fe5b04905092915050565b6128068363a9059cbb60e01b84846040516024016127a4929190614121565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050613109565b505050565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a350565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612919576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161291090614573565b60405180910390fd5b612922816131d0565b612961576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612958906143f3565b60405180910390fd5b6000603e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081603e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fdac3632743b879638fd2d51c4d3c1dd796615b4758a55b50b0c19b971ba9fbc760405160405180910390a35050565b600080603954118015612a425750603954612a40612385565b105b15612a505760009050612ade565b60016002811115612a5d57fe5b603b60009054906101000a900460ff166002811115612a7857fe5b148015612a8757506000603a54115b8015612a9b5750603a54612a99612385565b105b15612aa95760009050612ade565b6000612ac7603c54612ab9611d73565b610dc190919063ffffffff16565b9050612ada612ad4610cc5565b82612ae1565b9150505b90565b6000818310612af05781612af2565b825b905092915050565b600080831415612b0d5760009050612b64565b6000828402905082848281612b1e57fe5b0414612b5f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b5690614473565b60405180910390fd5b809150505b92915050565b603b60029054906101000a900460ff1615612bba576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612bb190614533565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff161415612c2a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c21906142f3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff161415612c9a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c9190614633565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff161415612d0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d0190614613565b60405180910390fd5b60008711612d4d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d4490614373565b60405180910390fd5b6000861415612d91576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d88906144b3565b60405180910390fd5b848610612dd3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612dca90614253565b60405180910390fd5b6001841015612e17576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e0e90614453565b60405180910390fd5b60006002811115612e2457fe5b816002811115612e3057fe5b1415612e71576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e6890614273565b60405180910390fd5b848310612eb3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612eaa906145b3565b60405180910390fd5b848210612ef5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612eec90614233565b60405180910390fd5b6001603b60026101000a81548160ff021916908315150217905550612f198a61280b565b88603460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555087603360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550866035819055508560368190555084603781905550836038819055508260398190555081603a8190555080603b60006101000a81548160ff02191690836002811115612fe357fe5b021790555050505050505050505050565b606082471015613039576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161303090614353565b60405180910390fd5b613042856131d0565b613081576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613078906144f3565b60405180910390fd5b600060608673ffffffffffffffffffffffffffffffffffffffff1685876040516130ab91906140c6565b60006040518083038185875af1925050503d80600081146130e8576040519150601f19603f3d011682016040523d82523d6000602084013e6130ed565b606091505b50915091506130fd8282866131e3565b92505050949350505050565b606061316b826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166127179092919063ffffffff16565b90506000815111156131cb578080602001905181019061318b9190613539565b6131ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016131c1906145d3565b60405180910390fd5b5b505050565b600080823b905060008111915050919050565b606083156131f357829050613243565b6000835111156132065782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161323a91906141d1565b60405180910390fd5b9392505050565b6000813590506132598161486a565b92915050565b60008151905061326e8161486a565b92915050565b600082601f83011261328557600080fd5b8151613298613293826146bf565b61468e565b915081818352602084019350602081019050838560208402820111156132bd57600080fd5b60005b838110156132ed57816132d3888261325f565b8452602084019350602083019250506001810190506132c0565b5050505092915050565b60008151905061330681614881565b92915050565b60008135905061331b81614898565b92915050565b600060c0828403121561333357600080fd5b81905092915050565b60008135905061334b816148a8565b92915050565b600081519050613360816148a8565b92915050565b60006020828403121561337857600080fd5b60006133868482850161324a565b91505092915050565b6000602082840312156133a157600080fd5b60006133af8482850161325f565b91505092915050565b60008060008060008060008060008060006101608c8e0312156133da57600080fd5b60006133e88e828f0161324a565b9b505060206133f98e828f0161324a565b9a5050604061340a8e828f0161324a565b995050606061341b8e828f0161324a565b985050608061342c8e828f0161333c565b97505060a061343d8e828f0161333c565b96505060c061344e8e828f0161333c565b95505060e061345f8e828f0161333c565b9450506101006134718e828f0161333c565b9350506101206134838e828f0161333c565b9250506101406134958e828f0161330c565b9150509295989b509295989b9093969950565b600080600061010084860312156134be57600080fd5b60006134cc8682870161324a565b93505060206134dd8682870161324a565b92505060406134ee86828701613321565b9150509250925092565b60006020828403121561350a57600080fd5b600082015167ffffffffffffffff81111561352457600080fd5b61353084828501613274565b91505092915050565b60006020828403121561354b57600080fd5b6000613559848285016132f7565b91505092915050565b60006020828403121561357457600080fd5b60006135828482850161333c565b91505092915050565b60006020828403121561359d57600080fd5b60006135ab84828501613351565b91505092915050565b6135bd8161471d565b82525050565b6135cc8161472f565b82525050565b6135db8161473b565b82525050565b60006135ec826146eb565b6135f68185614701565b9350613606818560208601614810565b80840191505092915050565b61361b816147a4565b82525050565b61362a816147c8565b82525050565b613639816147ec565b82525050565b613648816147fe565b82525050565b6000613659826146f6565b613663818561470c565b9350613673818560208601614810565b61367c81614845565b840191505092915050565b600061369460088361470c565b91507f4261642063616c6c0000000000000000000000000000000000000000000000006000830152602082019050919050565b60006136d4601b8361470c565b91507f455448207472616e7366657273206e6f7420737570706f7274656400000000006000830152602082019050919050565b600061371460228361470c565b91507f436c6966662074696d65206d757374206265206265666f726520656e6420746960008301527f6d650000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b600061377a60158361470c565b91507f53746172742074696d65203e20656e642074696d6500000000000000000000006000830152602082019050919050565b60006137ba601e8361470c565b91507f4d757374207365742061207265766f636162696c697479206f7074696f6e00006000830152602082019050919050565b60006137fa60268361470c565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613860601b8361470c565b91507f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006000830152602082019050919050565b60006138a0601c8361470c565b91507f4e6f20617661696c61626c6520756e76657374656420616d6f756e74000000006000830152602082019050919050565b60006138e060148361470c565b91507f4f776e65722063616e6e6f74206265207a65726f0000000000000000000000006000830152602082019050919050565b6000613920601f8361470c565b91507f43616e6e6f742063616e63656c20616363657074656420636f6e7472616374006000830152602082019050919050565b6000613960601e8361470c565b91507f536166654d6174683a207375627472616374696f6e206f766572666c6f7700006000830152602082019050919050565b60006139a060268361470c565b91507f416464726573733a20696e73756666696369656e742062616c616e636520666f60008301527f722063616c6c00000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613a06601d8361470c565b91507f4d616e6167656420746f6b656e732063616e6e6f74206265207a65726f0000006000830152602082019050919050565b6000613a46601a8361470c565b91507f536166654d6174683a206469766973696f6e206279207a65726f0000000000006000830152602082019050919050565b6000613a8660118361470c565b91507f456d7074792062656e65666963696172790000000000000000000000000000006000830152602082019050919050565b6000613ac660138361470c565b91507f556e617574686f72697a65642063616c6c6572000000000000000000000000006000830152602082019050919050565b6000613b06601a8361470c565b91507f4d616e61676572206d757374206265206120636f6e74726163740000000000006000830152602082019050919050565b6000613b4660158361470c565b91507f416d6f756e742063616e6e6f74206265207a65726f00000000000000000000006000830152602082019050919050565b6000613b8660298361470c565b91507f43616e6e6f7420757365206d6f726520746f6b656e73207468616e207665737460008301527f656420616d6f756e7400000000000000000000000000000000000000000000006020830152604082019050919050565b6000613bec601f8361470c565b91507f506572696f64732063616e6e6f742062652062656c6f77206d696e696d756d006000830152602082019050919050565b6000613c2c60218361470c565b91507f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008301527f77000000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613c9260208361470c565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b6000613cd260168361470c565b91507f53746172742074696d65206d75737420626520736574000000000000000000006000830152602082019050919050565b6000613d1260158361470c565b91507f556e617574686f72697a65642066756e6374696f6e00000000000000000000006000830152602082019050919050565b6000613d52601d8361470c565b91507f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006000830152602082019050919050565b6000613d9260248361470c565b91507f416d6f756e7420726571756573746564203e20737572706c757320617661696c60008301527f61626c65000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613df860138361470c565b91507f416c726561647920696e697469616c697a6564000000000000000000000000006000830152602082019050919050565b6000613e3860198361470c565b91507f436f6e7472616374206973206e6f6e2d7265766f6361626c65000000000000006000830152602082019050919050565b6000613e7860178361470c565b91507f4d616e616765722063616e6e6f7420626520656d7074790000000000000000006000830152602082019050919050565b6000613eb860058361470c565b91507f21617574680000000000000000000000000000000000000000000000000000006000830152602082019050919050565b6000613ef8602a8361470c565b91507f52656c656173652073746172742074696d65206d757374206265206265666f7260008301527f6520656e642074696d65000000000000000000000000000000000000000000006020830152604082019050919050565b6000613f5e602a8361470c565b91507f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008301527f6f742073756363656564000000000000000000000000000000000000000000006020830152604082019050919050565b6000613fc4601e8361470c565b91507f4e6f20617661696c61626c652072656c65617361626c6520616d6f756e7400006000830152602082019050919050565b600061400460148361470c565b91507f546f6b656e2063616e6e6f74206265207a65726f0000000000000000000000006000830152602082019050919050565b6000614044601a8361470c565b91507f42656e65666963696172792063616e6e6f74206265207a65726f0000000000006000830152602082019050919050565b6000614084600f8361470c565b91507f416c7265616479207265766f6b656400000000000000000000000000000000006000830152602082019050919050565b6140c08161479a565b82525050565b60006140d282846135e1565b915081905092915050565b60006020820190506140f260008301846135b4565b92915050565b600060408201905061410d60008301856135b4565b61411a602083018461363f565b9392505050565b600060408201905061413660008301856135b4565b61414360208301846140b7565b9392505050565b600060208201905061415f60008301846135c3565b92915050565b600060208201905061417a60008301846135d2565b92915050565b60006020820190506141956000830184613612565b92915050565b60006020820190506141b06000830184613621565b92915050565b60006020820190506141cb6000830184613630565b92915050565b600060208201905081810360008301526141eb818461364e565b905092915050565b6000602082019050818103600083015261420c81613687565b9050919050565b6000602082019050818103600083015261422c816136c7565b9050919050565b6000602082019050818103600083015261424c81613707565b9050919050565b6000602082019050818103600083015261426c8161376d565b9050919050565b6000602082019050818103600083015261428c816137ad565b9050919050565b600060208201905081810360008301526142ac816137ed565b9050919050565b600060208201905081810360008301526142cc81613853565b9050919050565b600060208201905081810360008301526142ec81613893565b9050919050565b6000602082019050818103600083015261430c816138d3565b9050919050565b6000602082019050818103600083015261432c81613913565b9050919050565b6000602082019050818103600083015261434c81613953565b9050919050565b6000602082019050818103600083015261436c81613993565b9050919050565b6000602082019050818103600083015261438c816139f9565b9050919050565b600060208201905081810360008301526143ac81613a39565b9050919050565b600060208201905081810360008301526143cc81613a79565b9050919050565b600060208201905081810360008301526143ec81613ab9565b9050919050565b6000602082019050818103600083015261440c81613af9565b9050919050565b6000602082019050818103600083015261442c81613b39565b9050919050565b6000602082019050818103600083015261444c81613b79565b9050919050565b6000602082019050818103600083015261446c81613bdf565b9050919050565b6000602082019050818103600083015261448c81613c1f565b9050919050565b600060208201905081810360008301526144ac81613c85565b9050919050565b600060208201905081810360008301526144cc81613cc5565b9050919050565b600060208201905081810360008301526144ec81613d05565b9050919050565b6000602082019050818103600083015261450c81613d45565b9050919050565b6000602082019050818103600083015261452c81613d85565b9050919050565b6000602082019050818103600083015261454c81613deb565b9050919050565b6000602082019050818103600083015261456c81613e2b565b9050919050565b6000602082019050818103600083015261458c81613e6b565b9050919050565b600060208201905081810360008301526145ac81613eab565b9050919050565b600060208201905081810360008301526145cc81613eeb565b9050919050565b600060208201905081810360008301526145ec81613f51565b9050919050565b6000602082019050818103600083015261460c81613fb7565b9050919050565b6000602082019050818103600083015261462c81613ff7565b9050919050565b6000602082019050818103600083015261464c81614037565b9050919050565b6000602082019050818103600083015261466c81614077565b9050919050565b600060208201905061468860008301846140b7565b92915050565b6000604051905081810181811067ffffffffffffffff821117156146b5576146b4614843565b5b8060405250919050565b600067ffffffffffffffff8211156146da576146d9614843565b5b602082029050602081019050919050565b600081519050919050565b600081519050919050565b600081905092915050565b600082825260208201905092915050565b60006147288261477a565b9050919050565b60008115159050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600081905061477582614856565b919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60006147af826147b6565b9050919050565b60006147c18261477a565b9050919050565b60006147d3826147da565b9050919050565b60006147e58261477a565b9050919050565b60006147f782614767565b9050919050565b60006148098261479a565b9050919050565b60005b8381101561482e578082015181840152602081019050614813565b8381111561483d576000848401525b50505050565bfe5b6000601f19601f8301169050919050565b6003811061486757614866614843565b5b50565b6148738161471d565b811461487e57600080fd5b50565b61488a8161472f565b811461489557600080fd5b50565b600381106148a557600080fd5b50565b6148b18161479a565b81146148bc57600080fd5b5056fea2646970667358221220e7181b2ba4d1c3bb9e57d12c063690ecc18fa07966017865e716378e6ce1068c64736f6c63430007030033", + "deployedBytecode": "0x6080604052600436106102605760003560e01c80637bdf05af11610144578063bc0163c1116100b6578063dc0706571161007a578063dc07065714610bc7578063e8dda6f514610bf0578063e97d87d514610c1b578063ebbab99214610c46578063f2fde38b14610c71578063fc0c546a14610c9a576102a0565b8063bc0163c114610af4578063bd896dcb14610b1f578063ce845d1d14610b48578063d0ebdbe714610b73578063d18e81b314610b9c576102a0565b80638da5cb5b116101085780638da5cb5b14610a0857806391f7cfb914610a33578063a4caeb4214610a5e578063b0d1818c14610a89578063b470aade14610ab2578063b6549f7514610add576102a0565b80637bdf05af1461095957806386d00e021461098457806386d1a69f146109af578063872a7810146109c65780638a5bdf5c146109f1576102a0565b806338af3eed116101dd578063481c6a75116101a1578063481c6a751461087f5780635051a5ec146108aa5780635b940081146108d557806360e7994414610900578063715018a61461091757806378e979251461092e576102a0565b806338af3eed146107a8578063392e53cd146107d3578063398057a3146107fe57806344b1231f1461082957806345d30a1714610854576102a0565b806320dc203d1161022457806320dc203d146106e75780632a627814146107105780632bc9ed02146107275780633197cbb61461075257806337aeb0861461077d576102a0565b8063029c6c9f14610624578063060406181461064f5780630b80f7771461067a5780630dff24d5146106915780630fb5a6b4146106bc576102a0565b366102a0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610297906141f3565b60405180910390fd5b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610330576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610327906143d3565b60405180910390fd5b60003414610373576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161036a90614213565b60405180910390fd5b6000603e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f1d24c456000357fffffffff00000000000000000000000000000000000000000000000000000000166040518263ffffffff1660e01b81526004016103f49190614165565b60206040518083038186803b15801561040c57600080fd5b505afa158015610420573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610444919061338f565b9050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156104b6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104ad906144d3565b60405180910390fd5b60006104c0610cc5565b9050610511826000368080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610d77565b506001600281111561051f57fe5b603b60009054906101000a900460ff16600281111561053a57fe5b141561062057600061054a610cc5565b90508181101561058c5760006105698284610dc190919063ffffffff16565b905061058081603f54610e1190919063ffffffff16565b603f81905550506105d2565b60006105a18383610dc190919063ffffffff16565b9050603f548110156105c7576105c281603f54610dc190919063ffffffff16565b6105ca565b60005b603f81905550505b6105da610e66565b603f54111561061e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161061590614433565b60405180910390fd5b505b5050005b34801561063057600080fd5b50610639610ed5565b6040516106469190614673565b60405180910390f35b34801561065b57600080fd5b50610664610ef3565b6040516106719190614673565b60405180910390f35b34801561068657600080fd5b5061068f610f2e565b005b34801561069d57600080fd5b506106a661109b565b6040516106b39190614673565b60405180910390f35b3480156106c857600080fd5b506106d16110e2565b6040516106de9190614673565b60405180910390f35b3480156106f357600080fd5b5061070e600480360381019061070991906134a8565b611100565b005b34801561071c57600080fd5b5061072561129b565b005b34801561073357600080fd5b5061073c611500565b604051610749919061414a565b60405180910390f35b34801561075e57600080fd5b50610767611513565b6040516107749190614673565b60405180910390f35b34801561078957600080fd5b50610792611519565b60405161079f9190614673565b60405180910390f35b3480156107b457600080fd5b506107bd61151f565b6040516107ca91906140dd565b60405180910390f35b3480156107df57600080fd5b506107e8611545565b6040516107f5919061414a565b60405180910390f35b34801561080a57600080fd5b50610813611558565b6040516108209190614673565b60405180910390f35b34801561083557600080fd5b5061083e610e66565b60405161084b9190614673565b60405180910390f35b34801561086057600080fd5b5061086961155e565b6040516108769190614673565b60405180910390f35b34801561088b57600080fd5b50610894611564565b6040516108a1919061419b565b60405180910390f35b3480156108b657600080fd5b506108bf61158a565b6040516108cc919061414a565b60405180910390f35b3480156108e157600080fd5b506108ea61159d565b6040516108f79190614673565b60405180910390f35b34801561090c57600080fd5b506109156116a8565b005b34801561092357600080fd5b5061092c6118ee565b005b34801561093a57600080fd5b50610943611a3a565b6040516109509190614673565b60405180910390f35b34801561096557600080fd5b5061096e611a40565b60405161097b9190614673565b60405180910390f35b34801561099057600080fd5b50610999611a7c565b6040516109a69190614673565b60405180910390f35b3480156109bb57600080fd5b506109c4611a82565b005b3480156109d257600080fd5b506109db611c5e565b6040516109e891906141b6565b60405180910390f35b3480156109fd57600080fd5b50610a06611c71565b005b348015610a1457600080fd5b50610a1d611d4a565b604051610a2a91906140dd565b60405180910390f35b348015610a3f57600080fd5b50610a48611d73565b604051610a559190614673565b60405180910390f35b348015610a6a57600080fd5b50610a73611dd1565b604051610a809190614673565b60405180910390f35b348015610a9557600080fd5b50610ab06004803603810190610aab9190613562565b611dd7565b005b348015610abe57600080fd5b50610ac7611fd6565b604051610ad49190614673565b60405180910390f35b348015610ae957600080fd5b50610af2611ff9565b005b348015610b0057600080fd5b50610b09612291565b604051610b169190614673565b60405180910390f35b348015610b2b57600080fd5b50610b466004803603810190610b4191906133b8565b6122c3565b005b348015610b5457600080fd5b50610b5d610cc5565b604051610b6a9190614673565b60405180910390f35b348015610b7f57600080fd5b50610b9a6004803603810190610b959190613366565b6122eb565b005b348015610ba857600080fd5b50610bb1612385565b604051610bbe9190614673565b60405180910390f35b348015610bd357600080fd5b50610bee6004803603810190610be99190613366565b61238d565b005b348015610bfc57600080fd5b50610c05612508565b604051610c129190614673565b60405180910390f35b348015610c2757600080fd5b50610c3061250e565b604051610c3d9190614673565b60405180910390f35b348015610c5257600080fd5b50610c5b612514565b604051610c689190614673565b60405180910390f35b348015610c7d57600080fd5b50610c986004803603810190610c939190613366565b612536565b005b348015610ca657600080fd5b50610caf6126f1565b604051610cbc9190614180565b60405180910390f35b6000603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610d2291906140dd565b60206040518083038186803b158015610d3a57600080fd5b505afa158015610d4e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d72919061358b565b905090565b6060610db983836040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c65640000815250612717565b905092915050565b600082821115610e06576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dfd90614333565b60405180910390fd5b818303905092915050565b600080828401905083811015610e5c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e53906142b3565b60405180910390fd5b8091505092915050565b6000600280811115610e7457fe5b603b60009054906101000a900460ff166002811115610e8f57fe5b1415610e9f576035549050610ed2565b6000603a54118015610eb95750603a54610eb7612385565b105b15610ec75760009050610ed2565b610ecf611d73565b90505b90565b6000610eee60385460355461272f90919063ffffffff16565b905090565b6000610f296001610f1b610f05611fd6565b610f0d611a40565b61272f90919063ffffffff16565b610e1190919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610fbc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fb390614493565b60405180910390fd5b60001515603b60039054906101000a900460ff16151514611012576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161100990614313565b60405180910390fd5b61106d61101d611d4a565b611025610cc5565b603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166127859092919063ffffffff16565b7f171f0bcbda3370351cea17f3b164bee87d77c2503b94abdf2720a814ebe7e9df60405160405180910390a1565b6000806110a6610cc5565b905060006110b2612291565b9050808211156110d8576110cf8183610dc190919063ffffffff16565b925050506110df565b6000925050505b90565b60006110fb603654603754610dc190919063ffffffff16565b905090565b603b60029054906101000a900460ff1615611150576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161114790614533565b60405180910390fd5b6001603b60026101000a81548160ff0219169083151502179055506111868160200160208101906111819190613366565b61280b565b8060400160208101906111999190613366565b603460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081603360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550806060013560358190555080608001356036819055508060a0013560378190555060016038819055506001603b60036101000a81548160ff0219169083151502179055508060a001356039819055506002603b60006101000a81548160ff0219169083600281111561128857fe5b0217905550611296836128a9565b505050565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461132b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161132290614593565b60405180910390fd5b6060603e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a34574666040518163ffffffff1660e01b815260040160006040518083038186803b15801561139557600080fd5b505afa1580156113a9573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906113d291906134f8565b905060005b81518110156114d057603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b383838151811061142a57fe5b60200260200101517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611470929190614121565b602060405180830381600087803b15801561148a57600080fd5b505af115801561149e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114c29190613539565b5080806001019150506113d7565b507fb837fd51506ba3cc623a37c78ed22fd521f2f6e9f69a34d5c2a4a9474f27579360405160405180910390a150565b603b60019054906101000a900460ff1681565b60375481565b603d5481565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b603b60029054906101000a900460ff1681565b60355481565b603c5481565b603e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b603b60039054906101000a900460ff1681565b60006002808111156115ab57fe5b603b60009054906101000a900460ff1660028111156115c657fe5b14156115db576115d4612a27565b90506116a5565b60006039541180156115f557506039546115f3612385565b105b1561160357600090506116a5565b6001600281111561161057fe5b603b60009054906101000a900460ff16600281111561162b57fe5b14801561163a57506000603a54115b801561164e5750603a5461164c612385565b105b1561165c57600090506116a5565b600061168e603f54611680603c54611672611d73565b610dc190919063ffffffff16565b610dc190919063ffffffff16565b90506116a161169b610cc5565b82612ae1565b9150505b90565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611738576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161172f90614593565b60405180910390fd5b6060603e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a34574666040518163ffffffff1660e01b815260040160006040518083038186803b1580156117a257600080fd5b505afa1580156117b6573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906117df91906134f8565b905060005b81518110156118be57603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b383838151811061183757fe5b602002602001015160006040518363ffffffff1660e01b815260040161185e9291906140f8565b602060405180830381600087803b15801561187857600080fd5b505af115801561188c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118b09190613539565b5080806001019150506117e4565b507f6d317a20ba9d790014284bef285283cd61fde92e0f2711050f563a9d2cf4171160405160405180910390a150565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461197c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161197390614493565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60365481565b600080611a4b612385565b90506036548111611a60576000915050611a79565b611a7560365482610dc190919063ffffffff16565b9150505b90565b603a5481565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611b12576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b0990614593565b60405180910390fd5b6000611b1c61159d565b905060008111611b61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b58906145f3565b60405180910390fd5b611b7681603c54610e1190919063ffffffff16565b603c81905550611beb603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166127859092919063ffffffff16565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fc7798891864187665ac6dd119286e44ec13f014527aeeb2b8eb3fd413df9317982604051611c539190614673565b60405180910390a250565b603b60009054906101000a900460ff1681565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611d01576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cf890614593565b60405180910390fd5b6001603b60036101000a81548160ff0219169083151502179055507fbeb3313724453131feb0a765a03e6715bb720e0f973a31fcbafa2d2f048c188b60405160405180910390a1565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600080611d7e612385565b9050603654811015611d94576000915050611dce565b603754811115611da957603554915050611dce565b611dca611db4610ed5565b611dbc612514565b612afa90919063ffffffff16565b9150505b90565b60385481565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611e67576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e5e90614593565b60405180910390fd5b60008111611eaa576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ea190614413565b60405180910390fd5b80611eb361109b565b1015611ef4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611eeb90614513565b60405180910390fd5b611f63603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166127859092919063ffffffff16565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b82604051611fcb9190614673565b60405180910390a250565b6000611ff4603854611fe66110e2565b61272f90919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612087576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161207e90614493565b60405180910390fd5b6001600281111561209457fe5b603b60009054906101000a900460ff1660028111156120af57fe5b146120ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120e690614553565b60405180910390fd5b60001515603b60019054906101000a900460ff16151514612145576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161213c90614653565b60405180910390fd5b6000612163612152610e66565b603554610dc190919063ffffffff16565b9050600081116121a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161219f906142d3565b60405180910390fd5b80603d819055506001603b60016101000a81548160ff02191690831515021790555061221e6121d5611d4a565b82603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166127859092919063ffffffff16565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fb73c49a3a37a7aca291ba0ceaa41657012def406106a7fc386888f0f66e941cf826040516122869190614673565b60405180910390a250565b60006122be603d546122b0603c54603554610dc190919063ffffffff16565b610dc190919063ffffffff16565b905090565b6122d58a8a8a8a8a8a8a8a8a8a612b6a565b6122de8b6128a9565b5050505050505050505050565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612379576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161237090614493565b60405180910390fd5b612382816128a9565b50565b600042905090565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461241d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161241490614593565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561248d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612484906143b3565b60405180910390fd5b80603460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f373c72efabe4ef3e552ff77838be729f3bc3d8c586df0012902d1baa2377fa1d816040516124fd91906140dd565b60405180910390a150565b603f5481565b60395481565b60006125316001612523610ef3565b610dc190919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146125c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125bb90614493565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612634576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161262b90614293565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60606127268484600085612ff4565b90509392505050565b6000808211612773576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161276a90614393565b60405180910390fd5b81838161277c57fe5b04905092915050565b6128068363a9059cbb60e01b84846040516024016127a4929190614121565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050613109565b505050565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a350565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612919576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161291090614573565b60405180910390fd5b612922816131d0565b612961576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612958906143f3565b60405180910390fd5b6000603e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081603e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fdac3632743b879638fd2d51c4d3c1dd796615b4758a55b50b0c19b971ba9fbc760405160405180910390a35050565b600080603954118015612a425750603954612a40612385565b105b15612a505760009050612ade565b60016002811115612a5d57fe5b603b60009054906101000a900460ff166002811115612a7857fe5b148015612a8757506000603a54115b8015612a9b5750603a54612a99612385565b105b15612aa95760009050612ade565b6000612ac7603c54612ab9611d73565b610dc190919063ffffffff16565b9050612ada612ad4610cc5565b82612ae1565b9150505b90565b6000818310612af05781612af2565b825b905092915050565b600080831415612b0d5760009050612b64565b6000828402905082848281612b1e57fe5b0414612b5f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b5690614473565b60405180910390fd5b809150505b92915050565b603b60029054906101000a900460ff1615612bba576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612bb190614533565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff161415612c2a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c21906142f3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff161415612c9a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c9190614633565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff161415612d0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d0190614613565b60405180910390fd5b60008711612d4d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d4490614373565b60405180910390fd5b6000861415612d91576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d88906144b3565b60405180910390fd5b848610612dd3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612dca90614253565b60405180910390fd5b6001841015612e17576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e0e90614453565b60405180910390fd5b60006002811115612e2457fe5b816002811115612e3057fe5b1415612e71576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e6890614273565b60405180910390fd5b848310612eb3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612eaa906145b3565b60405180910390fd5b848210612ef5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612eec90614233565b60405180910390fd5b6001603b60026101000a81548160ff021916908315150217905550612f198a61280b565b88603460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555087603360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550866035819055508560368190555084603781905550836038819055508260398190555081603a8190555080603b60006101000a81548160ff02191690836002811115612fe357fe5b021790555050505050505050505050565b606082471015613039576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161303090614353565b60405180910390fd5b613042856131d0565b613081576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613078906144f3565b60405180910390fd5b600060608673ffffffffffffffffffffffffffffffffffffffff1685876040516130ab91906140c6565b60006040518083038185875af1925050503d80600081146130e8576040519150601f19603f3d011682016040523d82523d6000602084013e6130ed565b606091505b50915091506130fd8282866131e3565b92505050949350505050565b606061316b826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166127179092919063ffffffff16565b90506000815111156131cb578080602001905181019061318b9190613539565b6131ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016131c1906145d3565b60405180910390fd5b5b505050565b600080823b905060008111915050919050565b606083156131f357829050613243565b6000835111156132065782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161323a91906141d1565b60405180910390fd5b9392505050565b6000813590506132598161486a565b92915050565b60008151905061326e8161486a565b92915050565b600082601f83011261328557600080fd5b8151613298613293826146bf565b61468e565b915081818352602084019350602081019050838560208402820111156132bd57600080fd5b60005b838110156132ed57816132d3888261325f565b8452602084019350602083019250506001810190506132c0565b5050505092915050565b60008151905061330681614881565b92915050565b60008135905061331b81614898565b92915050565b600060c0828403121561333357600080fd5b81905092915050565b60008135905061334b816148a8565b92915050565b600081519050613360816148a8565b92915050565b60006020828403121561337857600080fd5b60006133868482850161324a565b91505092915050565b6000602082840312156133a157600080fd5b60006133af8482850161325f565b91505092915050565b60008060008060008060008060008060006101608c8e0312156133da57600080fd5b60006133e88e828f0161324a565b9b505060206133f98e828f0161324a565b9a5050604061340a8e828f0161324a565b995050606061341b8e828f0161324a565b985050608061342c8e828f0161333c565b97505060a061343d8e828f0161333c565b96505060c061344e8e828f0161333c565b95505060e061345f8e828f0161333c565b9450506101006134718e828f0161333c565b9350506101206134838e828f0161333c565b9250506101406134958e828f0161330c565b9150509295989b509295989b9093969950565b600080600061010084860312156134be57600080fd5b60006134cc8682870161324a565b93505060206134dd8682870161324a565b92505060406134ee86828701613321565b9150509250925092565b60006020828403121561350a57600080fd5b600082015167ffffffffffffffff81111561352457600080fd5b61353084828501613274565b91505092915050565b60006020828403121561354b57600080fd5b6000613559848285016132f7565b91505092915050565b60006020828403121561357457600080fd5b60006135828482850161333c565b91505092915050565b60006020828403121561359d57600080fd5b60006135ab84828501613351565b91505092915050565b6135bd8161471d565b82525050565b6135cc8161472f565b82525050565b6135db8161473b565b82525050565b60006135ec826146eb565b6135f68185614701565b9350613606818560208601614810565b80840191505092915050565b61361b816147a4565b82525050565b61362a816147c8565b82525050565b613639816147ec565b82525050565b613648816147fe565b82525050565b6000613659826146f6565b613663818561470c565b9350613673818560208601614810565b61367c81614845565b840191505092915050565b600061369460088361470c565b91507f4261642063616c6c0000000000000000000000000000000000000000000000006000830152602082019050919050565b60006136d4601b8361470c565b91507f455448207472616e7366657273206e6f7420737570706f7274656400000000006000830152602082019050919050565b600061371460228361470c565b91507f436c6966662074696d65206d757374206265206265666f726520656e6420746960008301527f6d650000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b600061377a60158361470c565b91507f53746172742074696d65203e20656e642074696d6500000000000000000000006000830152602082019050919050565b60006137ba601e8361470c565b91507f4d757374207365742061207265766f636162696c697479206f7074696f6e00006000830152602082019050919050565b60006137fa60268361470c565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613860601b8361470c565b91507f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006000830152602082019050919050565b60006138a0601c8361470c565b91507f4e6f20617661696c61626c6520756e76657374656420616d6f756e74000000006000830152602082019050919050565b60006138e060148361470c565b91507f4f776e65722063616e6e6f74206265207a65726f0000000000000000000000006000830152602082019050919050565b6000613920601f8361470c565b91507f43616e6e6f742063616e63656c20616363657074656420636f6e7472616374006000830152602082019050919050565b6000613960601e8361470c565b91507f536166654d6174683a207375627472616374696f6e206f766572666c6f7700006000830152602082019050919050565b60006139a060268361470c565b91507f416464726573733a20696e73756666696369656e742062616c616e636520666f60008301527f722063616c6c00000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613a06601d8361470c565b91507f4d616e6167656420746f6b656e732063616e6e6f74206265207a65726f0000006000830152602082019050919050565b6000613a46601a8361470c565b91507f536166654d6174683a206469766973696f6e206279207a65726f0000000000006000830152602082019050919050565b6000613a8660118361470c565b91507f456d7074792062656e65666963696172790000000000000000000000000000006000830152602082019050919050565b6000613ac660138361470c565b91507f556e617574686f72697a65642063616c6c6572000000000000000000000000006000830152602082019050919050565b6000613b06601a8361470c565b91507f4d616e61676572206d757374206265206120636f6e74726163740000000000006000830152602082019050919050565b6000613b4660158361470c565b91507f416d6f756e742063616e6e6f74206265207a65726f00000000000000000000006000830152602082019050919050565b6000613b8660298361470c565b91507f43616e6e6f7420757365206d6f726520746f6b656e73207468616e207665737460008301527f656420616d6f756e7400000000000000000000000000000000000000000000006020830152604082019050919050565b6000613bec601f8361470c565b91507f506572696f64732063616e6e6f742062652062656c6f77206d696e696d756d006000830152602082019050919050565b6000613c2c60218361470c565b91507f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008301527f77000000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613c9260208361470c565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b6000613cd260168361470c565b91507f53746172742074696d65206d75737420626520736574000000000000000000006000830152602082019050919050565b6000613d1260158361470c565b91507f556e617574686f72697a65642066756e6374696f6e00000000000000000000006000830152602082019050919050565b6000613d52601d8361470c565b91507f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006000830152602082019050919050565b6000613d9260248361470c565b91507f416d6f756e7420726571756573746564203e20737572706c757320617661696c60008301527f61626c65000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613df860138361470c565b91507f416c726561647920696e697469616c697a6564000000000000000000000000006000830152602082019050919050565b6000613e3860198361470c565b91507f436f6e7472616374206973206e6f6e2d7265766f6361626c65000000000000006000830152602082019050919050565b6000613e7860178361470c565b91507f4d616e616765722063616e6e6f7420626520656d7074790000000000000000006000830152602082019050919050565b6000613eb860058361470c565b91507f21617574680000000000000000000000000000000000000000000000000000006000830152602082019050919050565b6000613ef8602a8361470c565b91507f52656c656173652073746172742074696d65206d757374206265206265666f7260008301527f6520656e642074696d65000000000000000000000000000000000000000000006020830152604082019050919050565b6000613f5e602a8361470c565b91507f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008301527f6f742073756363656564000000000000000000000000000000000000000000006020830152604082019050919050565b6000613fc4601e8361470c565b91507f4e6f20617661696c61626c652072656c65617361626c6520616d6f756e7400006000830152602082019050919050565b600061400460148361470c565b91507f546f6b656e2063616e6e6f74206265207a65726f0000000000000000000000006000830152602082019050919050565b6000614044601a8361470c565b91507f42656e65666963696172792063616e6e6f74206265207a65726f0000000000006000830152602082019050919050565b6000614084600f8361470c565b91507f416c7265616479207265766f6b656400000000000000000000000000000000006000830152602082019050919050565b6140c08161479a565b82525050565b60006140d282846135e1565b915081905092915050565b60006020820190506140f260008301846135b4565b92915050565b600060408201905061410d60008301856135b4565b61411a602083018461363f565b9392505050565b600060408201905061413660008301856135b4565b61414360208301846140b7565b9392505050565b600060208201905061415f60008301846135c3565b92915050565b600060208201905061417a60008301846135d2565b92915050565b60006020820190506141956000830184613612565b92915050565b60006020820190506141b06000830184613621565b92915050565b60006020820190506141cb6000830184613630565b92915050565b600060208201905081810360008301526141eb818461364e565b905092915050565b6000602082019050818103600083015261420c81613687565b9050919050565b6000602082019050818103600083015261422c816136c7565b9050919050565b6000602082019050818103600083015261424c81613707565b9050919050565b6000602082019050818103600083015261426c8161376d565b9050919050565b6000602082019050818103600083015261428c816137ad565b9050919050565b600060208201905081810360008301526142ac816137ed565b9050919050565b600060208201905081810360008301526142cc81613853565b9050919050565b600060208201905081810360008301526142ec81613893565b9050919050565b6000602082019050818103600083015261430c816138d3565b9050919050565b6000602082019050818103600083015261432c81613913565b9050919050565b6000602082019050818103600083015261434c81613953565b9050919050565b6000602082019050818103600083015261436c81613993565b9050919050565b6000602082019050818103600083015261438c816139f9565b9050919050565b600060208201905081810360008301526143ac81613a39565b9050919050565b600060208201905081810360008301526143cc81613a79565b9050919050565b600060208201905081810360008301526143ec81613ab9565b9050919050565b6000602082019050818103600083015261440c81613af9565b9050919050565b6000602082019050818103600083015261442c81613b39565b9050919050565b6000602082019050818103600083015261444c81613b79565b9050919050565b6000602082019050818103600083015261446c81613bdf565b9050919050565b6000602082019050818103600083015261448c81613c1f565b9050919050565b600060208201905081810360008301526144ac81613c85565b9050919050565b600060208201905081810360008301526144cc81613cc5565b9050919050565b600060208201905081810360008301526144ec81613d05565b9050919050565b6000602082019050818103600083015261450c81613d45565b9050919050565b6000602082019050818103600083015261452c81613d85565b9050919050565b6000602082019050818103600083015261454c81613deb565b9050919050565b6000602082019050818103600083015261456c81613e2b565b9050919050565b6000602082019050818103600083015261458c81613e6b565b9050919050565b600060208201905081810360008301526145ac81613eab565b9050919050565b600060208201905081810360008301526145cc81613eeb565b9050919050565b600060208201905081810360008301526145ec81613f51565b9050919050565b6000602082019050818103600083015261460c81613fb7565b9050919050565b6000602082019050818103600083015261462c81613ff7565b9050919050565b6000602082019050818103600083015261464c81614037565b9050919050565b6000602082019050818103600083015261466c81614077565b9050919050565b600060208201905061468860008301846140b7565b92915050565b6000604051905081810181811067ffffffffffffffff821117156146b5576146b4614843565b5b8060405250919050565b600067ffffffffffffffff8211156146da576146d9614843565b5b602082029050602081019050919050565b600081519050919050565b600081519050919050565b600081905092915050565b600082825260208201905092915050565b60006147288261477a565b9050919050565b60008115159050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600081905061477582614856565b919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60006147af826147b6565b9050919050565b60006147c18261477a565b9050919050565b60006147d3826147da565b9050919050565b60006147e58261477a565b9050919050565b60006147f782614767565b9050919050565b60006148098261479a565b9050919050565b60005b8381101561482e578082015181840152602081019050614813565b8381111561483d576000848401525b50505050565bfe5b6000601f19601f8301169050919050565b6003811061486757614866614843565b5b50565b6148738161471d565b811461487e57600080fd5b50565b61488a8161472f565b811461489557600080fd5b50565b600381106148a557600080fd5b50565b6148b18161479a565b81146148bc57600080fd5b5056fea2646970667358221220e7181b2ba4d1c3bb9e57d12c063690ecc18fa07966017865e716378e6ce1068c64736f6c63430007030033", + "devdoc": { + "kind": "dev", + "methods": { + "acceptLock()": { + "details": "Can only be called by the beneficiary" + }, + "amountPerPeriod()": { + "returns": { + "_0": "Amount of tokens available after each period" + } + }, + "approveProtocol()": { + "details": "Approves all token destinations registered in the manager to pull tokens" + }, + "availableAmount()": { + "details": "Implements the step-by-step schedule based on periods for available tokens", + "returns": { + "_0": "Amount of tokens available according to the schedule" + } + }, + "cancelLock()": { + "details": "Can only be called by the owner" + }, + "changeBeneficiary(address)": { + "details": "Can only be called by the beneficiary", + "params": { + "_newBeneficiary": "Address of the new beneficiary address" + } + }, + "currentBalance()": { + "returns": { + "_0": "Tokens held in the contract" + } + }, + "currentPeriod()": { + "returns": { + "_0": "A number that represents the current period" + } + }, + "currentTime()": { + "returns": { + "_0": "Current block timestamp" + } + }, + "duration()": { + "returns": { + "_0": "Amount of seconds from contract startTime to endTime" + } + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "passedPeriods()": { + "returns": { + "_0": "A number of periods that passed since the schedule started" + } + }, + "periodDuration()": { + "returns": { + "_0": "Duration of each period in seconds" + } + }, + "releasableAmount()": { + "details": "Considers the schedule, takes into account already released tokens and used amount", + "returns": { + "_0": "Amount of tokens ready to be released" + } + }, + "release()": { + "details": "All available releasable tokens are transferred to beneficiary" + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." + }, + "revoke()": { + "details": "Vesting schedule is always calculated based on managed tokens" + }, + "revokeProtocol()": { + "details": "Revokes approval to all token destinations in the manager to pull tokens" + }, + "setManager(address)": { + "params": { + "_newManager": "Address of the new manager" + } + }, + "sinceStartTime()": { + "details": "Returns zero if called before conctract starTime", + "returns": { + "_0": "Seconds elapsed from contract startTime" + } + }, + "surplusAmount()": { + "details": "All funds over outstanding amount is considered surplus that can be withdrawn by beneficiary. Note this might not be the correct value for wallets transferred to L2 (i.e. an L2GraphTokenLockWallet), as the released amount will be skewed, so the beneficiary might have to bridge back to L1 to release the surplus.", + "returns": { + "_0": "Amount of tokens considered as surplus" + } + }, + "totalOutstandingAmount()": { + "details": "Does not consider schedule but just global amounts tracked", + "returns": { + "_0": "Amount of outstanding tokens for the lifetime of the contract" + } + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + }, + "vestedAmount()": { + "details": "Similar to available amount, but is fully vested when contract is non-revocable", + "returns": { + "_0": "Amount of tokens already vested" + } + }, + "withdrawSurplus(uint256)": { + "details": "Tokens in the contract over outstanding amount are considered as surplus", + "params": { + "_amount": "Amount of tokens to withdraw" + } + } + }, + "title": "L2GraphTokenLockWallet", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "acceptLock()": { + "notice": "Beneficiary accepts the lock, the owner cannot retrieve back the tokens" + }, + "amountPerPeriod()": { + "notice": "Returns amount available to be released after each period according to schedule" + }, + "approveProtocol()": { + "notice": "Approves protocol access of the tokens managed by this contract" + }, + "availableAmount()": { + "notice": "Gets the currently available token according to the schedule" + }, + "cancelLock()": { + "notice": "Owner cancel the lock and return the balance in the contract" + }, + "changeBeneficiary(address)": { + "notice": "Change the beneficiary of funds managed by the contract" + }, + "currentBalance()": { + "notice": "Returns the amount of tokens currently held by the contract" + }, + "currentPeriod()": { + "notice": "Gets the current period based on the schedule" + }, + "currentTime()": { + "notice": "Returns the current block timestamp" + }, + "duration()": { + "notice": "Gets duration of contract from start to end in seconds" + }, + "passedPeriods()": { + "notice": "Gets the number of periods that passed since the first period" + }, + "periodDuration()": { + "notice": "Returns the duration of each period in seconds" + }, + "releasableAmount()": { + "notice": "Gets tokens currently available for release" + }, + "release()": { + "notice": "Releases tokens based on the configured schedule" + }, + "revoke()": { + "notice": "Revokes a vesting schedule and return the unvested tokens to the owner" + }, + "revokeProtocol()": { + "notice": "Revokes protocol access of the tokens managed by this contract" + }, + "setManager(address)": { + "notice": "Sets a new manager for this contract" + }, + "sinceStartTime()": { + "notice": "Gets time elapsed since the start of the contract" + }, + "surplusAmount()": { + "notice": "Gets surplus amount in the contract based on outstanding amount to release" + }, + "totalOutstandingAmount()": { + "notice": "Gets the outstanding amount yet to be released based on the whole contract lifetime" + }, + "vestedAmount()": { + "notice": "Gets the amount of currently vested tokens" + }, + "withdrawSurplus(uint256)": { + "notice": "Withdraws surplus, unmanaged tokens from the contract" + } + }, + "notice": "This contract is built on top of the base GraphTokenLock functionality. It allows wallet beneficiaries to use the deposited funds to perform specific function calls on specific contracts. The idea is that supporters with locked tokens can participate in the protocol but disallow any release before the vesting/lock schedule. The beneficiary can issue authorized function calls to this contract that will get forwarded to a target contract. A target contract is any of our protocol contracts. The function calls allowed are queried to the GraphTokenLockManager, this way the same configuration can be shared for all the created lock wallet contracts. This L2 variant includes a special initializer so that it can be created from a wallet's data received from L1. These transferred wallets will not allow releasing funds in L2 until the end of the vesting timeline, but they can allow withdrawing funds back to L1 using the L2GraphTokenLockTransferTool contract. Note that surplusAmount and releasedAmount in L2 will be skewed for wallets received from L1, so releasing surplus tokens might also only be possible by bridging tokens back to L1. NOTE: Contracts used as target must have its function signatures checked to avoid collisions with any of this contract functions. Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience the maximum amount of tokens is authorized. Function calls do not forward ETH value so DO NOT SEND ETH TO THIS CONTRACT.", + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 6797, + "contract": "contracts/L2GraphTokenLockWallet.sol:L2GraphTokenLockWallet", + "label": "_owner", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 6802, + "contract": "contracts/L2GraphTokenLockWallet.sol:L2GraphTokenLockWallet", + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 3244, + "contract": "contracts/L2GraphTokenLockWallet.sol:L2GraphTokenLockWallet", + "label": "token", + "offset": 0, + "slot": "51", + "type": "t_contract(IERC20)1710" + }, + { + "astId": 3246, + "contract": "contracts/L2GraphTokenLockWallet.sol:L2GraphTokenLockWallet", + "label": "beneficiary", + "offset": 0, + "slot": "52", + "type": "t_address" + }, + { + "astId": 3248, + "contract": "contracts/L2GraphTokenLockWallet.sol:L2GraphTokenLockWallet", + "label": "managedAmount", + "offset": 0, + "slot": "53", + "type": "t_uint256" + }, + { + "astId": 3250, + "contract": "contracts/L2GraphTokenLockWallet.sol:L2GraphTokenLockWallet", + "label": "startTime", + "offset": 0, + "slot": "54", + "type": "t_uint256" + }, + { + "astId": 3252, + "contract": "contracts/L2GraphTokenLockWallet.sol:L2GraphTokenLockWallet", + "label": "endTime", + "offset": 0, + "slot": "55", + "type": "t_uint256" + }, + { + "astId": 3254, + "contract": "contracts/L2GraphTokenLockWallet.sol:L2GraphTokenLockWallet", + "label": "periods", + "offset": 0, + "slot": "56", + "type": "t_uint256" + }, + { + "astId": 3256, + "contract": "contracts/L2GraphTokenLockWallet.sol:L2GraphTokenLockWallet", + "label": "releaseStartTime", + "offset": 0, + "slot": "57", + "type": "t_uint256" + }, + { + "astId": 3258, + "contract": "contracts/L2GraphTokenLockWallet.sol:L2GraphTokenLockWallet", + "label": "vestingCliffTime", + "offset": 0, + "slot": "58", + "type": "t_uint256" + }, + { + "astId": 3260, + "contract": "contracts/L2GraphTokenLockWallet.sol:L2GraphTokenLockWallet", + "label": "revocable", + "offset": 0, + "slot": "59", + "type": "t_enum(Revocability)5096" + }, + { + "astId": 3262, + "contract": "contracts/L2GraphTokenLockWallet.sol:L2GraphTokenLockWallet", + "label": "isRevoked", + "offset": 1, + "slot": "59", + "type": "t_bool" + }, + { + "astId": 3264, + "contract": "contracts/L2GraphTokenLockWallet.sol:L2GraphTokenLockWallet", + "label": "isInitialized", + "offset": 2, + "slot": "59", + "type": "t_bool" + }, + { + "astId": 3266, + "contract": "contracts/L2GraphTokenLockWallet.sol:L2GraphTokenLockWallet", + "label": "isAccepted", + "offset": 3, + "slot": "59", + "type": "t_bool" + }, + { + "astId": 3268, + "contract": "contracts/L2GraphTokenLockWallet.sol:L2GraphTokenLockWallet", + "label": "releasedAmount", + "offset": 0, + "slot": "60", + "type": "t_uint256" + }, + { + "astId": 3270, + "contract": "contracts/L2GraphTokenLockWallet.sol:L2GraphTokenLockWallet", + "label": "revokedAmount", + "offset": 0, + "slot": "61", + "type": "t_uint256" + }, + { + "astId": 4692, + "contract": "contracts/L2GraphTokenLockWallet.sol:L2GraphTokenLockWallet", + "label": "manager", + "offset": 0, + "slot": "62", + "type": "t_contract(IGraphTokenLockManager)5278" + }, + { + "astId": 4694, + "contract": "contracts/L2GraphTokenLockWallet.sol:L2GraphTokenLockWallet", + "label": "usedAmount", + "offset": 0, + "slot": "63", + "type": "t_uint256" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)50_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_contract(IERC20)1710": { + "encoding": "inplace", + "label": "contract IERC20", + "numberOfBytes": "20" + }, + "t_contract(IGraphTokenLockManager)5278": { + "encoding": "inplace", + "label": "contract IGraphTokenLockManager", + "numberOfBytes": "20" + }, + "t_enum(Revocability)5096": { + "encoding": "inplace", + "label": "enum IGraphTokenLock.Revocability", + "numberOfBytes": "1" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} \ No newline at end of file diff --git a/packages/token-distribution/deployments/arbitrum-goerli/solcInputs/b5cdad58099d39cd1aed000b2fd864d8.json b/packages/token-distribution/deployments/arbitrum-goerli/solcInputs/b5cdad58099d39cd1aed000b2fd864d8.json new file mode 100644 index 000000000..4eda754ae --- /dev/null +++ b/packages/token-distribution/deployments/arbitrum-goerli/solcInputs/b5cdad58099d39cd1aed000b2fd864d8.json @@ -0,0 +1,152 @@ +{ + "language": "Solidity", + "sources": { + "@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/**\n * @dev Wrappers over Solidity's arithmetic operations with added overflow\n * checks.\n *\n * Arithmetic operations in Solidity wrap on overflow. This can easily result\n * in bugs, because programmers usually assume that an overflow raises an\n * error, which is the standard behavior in high level programming languages.\n * `SafeMath` restores this intuition by reverting the transaction when an\n * operation overflows.\n *\n * Using this library instead of the unchecked operations eliminates an entire\n * class of bugs, so it's recommended to use it always.\n */\nlibrary SafeMathUpgradeable {\n /**\n * @dev Returns the addition of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n uint256 c = a + b;\n if (c < a) return (false, 0);\n return (true, c);\n }\n\n /**\n * @dev Returns the substraction of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n if (b > a) return (false, 0);\n return (true, a - b);\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\n // benefit is lost if 'b' is also tested.\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\n if (a == 0) return (true, 0);\n uint256 c = a * b;\n if (c / a != b) return (false, 0);\n return (true, c);\n }\n\n /**\n * @dev Returns the division of two unsigned integers, with a division by zero flag.\n *\n * _Available since v3.4._\n */\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n if (b == 0) return (false, 0);\n return (true, a / b);\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\n *\n * _Available since v3.4._\n */\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n if (b == 0) return (false, 0);\n return (true, a % b);\n }\n\n /**\n * @dev Returns the addition of two unsigned integers, reverting on\n * overflow.\n *\n * Counterpart to Solidity's `+` operator.\n *\n * Requirements:\n *\n * - Addition cannot overflow.\n */\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\n uint256 c = a + b;\n require(c >= a, \"SafeMath: addition overflow\");\n return c;\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, reverting on\n * overflow (when the result is negative).\n *\n * Counterpart to Solidity's `-` operator.\n *\n * Requirements:\n *\n * - Subtraction cannot overflow.\n */\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b <= a, \"SafeMath: subtraction overflow\");\n return a - b;\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, reverting on\n * overflow.\n *\n * Counterpart to Solidity's `*` operator.\n *\n * Requirements:\n *\n * - Multiplication cannot overflow.\n */\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n if (a == 0) return 0;\n uint256 c = a * b;\n require(c / a == b, \"SafeMath: multiplication overflow\");\n return c;\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers, reverting on\n * division by zero. The result is rounded towards zero.\n *\n * Counterpart to Solidity's `/` operator. Note: this function uses a\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\n * uses an invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b > 0, \"SafeMath: division by zero\");\n return a / b;\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * reverting when dividing by zero.\n *\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\n * opcode (which leaves remaining gas untouched) while Solidity uses an\n * invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b > 0, \"SafeMath: modulo by zero\");\n return a % b;\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\n * overflow (when the result is negative).\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {trySub}.\n *\n * Counterpart to Solidity's `-` operator.\n *\n * Requirements:\n *\n * - Subtraction cannot overflow.\n */\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b <= a, errorMessage);\n return a - b;\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers, reverting with custom message on\n * division by zero. The result is rounded towards zero.\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {tryDiv}.\n *\n * Counterpart to Solidity's `/` operator. Note: this function uses a\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\n * uses an invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b > 0, errorMessage);\n return a / b;\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * reverting with custom message when dividing by zero.\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {tryMod}.\n *\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\n * opcode (which leaves remaining gas untouched) while Solidity uses an\n * invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b > 0, errorMessage);\n return a % b;\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\n// solhint-disable-next-line compiler-version\npragma solidity >=0.4.24 <0.8.0;\n\nimport \"../utils/AddressUpgradeable.sol\";\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {UpgradeableProxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n */\nabstract contract Initializable {\n\n /**\n * @dev Indicates that the contract has been initialized.\n */\n bool private _initialized;\n\n /**\n * @dev Indicates that the contract is in the process of being initialized.\n */\n bool private _initializing;\n\n /**\n * @dev Modifier to protect an initializer function from being invoked twice.\n */\n modifier initializer() {\n require(_initializing || _isConstructor() || !_initialized, \"Initializable: contract is already initialized\");\n\n bool isTopLevelCall = !_initializing;\n if (isTopLevelCall) {\n _initializing = true;\n _initialized = true;\n }\n\n _;\n\n if (isTopLevelCall) {\n _initializing = false;\n }\n }\n\n /// @dev Returns true if and only if the function is running in the constructor\n function _isConstructor() private view returns (bool) {\n return !AddressUpgradeable.isContract(address(this));\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.2 <0.8.0;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary AddressUpgradeable {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize, which returns 0 for contracts in\n // construction, since the code is only stored at the end of the\n // constructor execution.\n\n uint256 size;\n // solhint-disable-next-line no-inline-assembly\n assembly { size := extcodesize(account) }\n return size > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n // solhint-disable-next-line avoid-low-level-calls, avoid-call-value\n (bool success, ) = recipient.call{ value: amount }(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain`call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCall(target, data, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n require(isContract(target), \"Address: call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.call{ value: value }(data);\n return _verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {\n require(isContract(target), \"Address: static call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.staticcall(data);\n return _verifyCallResult(success, returndata, errorMessage);\n }\n\n function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {\n if (success) {\n return returndata;\n } else {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n }\n}\n" + }, + "@openzeppelin/contracts/access/Ownable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\nimport \"../utils/Context.sol\";\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor () internal {\n address msgSender = _msgSender();\n _owner = msgSender;\n emit OwnershipTransferred(address(0), msgSender);\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n _;\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n emit OwnershipTransferred(_owner, address(0));\n _owner = address(0);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n emit OwnershipTransferred(_owner, newOwner);\n _owner = newOwner;\n }\n}\n" + }, + "@openzeppelin/contracts/math/SafeMath.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/**\n * @dev Wrappers over Solidity's arithmetic operations with added overflow\n * checks.\n *\n * Arithmetic operations in Solidity wrap on overflow. This can easily result\n * in bugs, because programmers usually assume that an overflow raises an\n * error, which is the standard behavior in high level programming languages.\n * `SafeMath` restores this intuition by reverting the transaction when an\n * operation overflows.\n *\n * Using this library instead of the unchecked operations eliminates an entire\n * class of bugs, so it's recommended to use it always.\n */\nlibrary SafeMath {\n /**\n * @dev Returns the addition of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n uint256 c = a + b;\n if (c < a) return (false, 0);\n return (true, c);\n }\n\n /**\n * @dev Returns the substraction of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n if (b > a) return (false, 0);\n return (true, a - b);\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\n // benefit is lost if 'b' is also tested.\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\n if (a == 0) return (true, 0);\n uint256 c = a * b;\n if (c / a != b) return (false, 0);\n return (true, c);\n }\n\n /**\n * @dev Returns the division of two unsigned integers, with a division by zero flag.\n *\n * _Available since v3.4._\n */\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n if (b == 0) return (false, 0);\n return (true, a / b);\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\n *\n * _Available since v3.4._\n */\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n if (b == 0) return (false, 0);\n return (true, a % b);\n }\n\n /**\n * @dev Returns the addition of two unsigned integers, reverting on\n * overflow.\n *\n * Counterpart to Solidity's `+` operator.\n *\n * Requirements:\n *\n * - Addition cannot overflow.\n */\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\n uint256 c = a + b;\n require(c >= a, \"SafeMath: addition overflow\");\n return c;\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, reverting on\n * overflow (when the result is negative).\n *\n * Counterpart to Solidity's `-` operator.\n *\n * Requirements:\n *\n * - Subtraction cannot overflow.\n */\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b <= a, \"SafeMath: subtraction overflow\");\n return a - b;\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, reverting on\n * overflow.\n *\n * Counterpart to Solidity's `*` operator.\n *\n * Requirements:\n *\n * - Multiplication cannot overflow.\n */\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n if (a == 0) return 0;\n uint256 c = a * b;\n require(c / a == b, \"SafeMath: multiplication overflow\");\n return c;\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers, reverting on\n * division by zero. The result is rounded towards zero.\n *\n * Counterpart to Solidity's `/` operator. Note: this function uses a\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\n * uses an invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b > 0, \"SafeMath: division by zero\");\n return a / b;\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * reverting when dividing by zero.\n *\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\n * opcode (which leaves remaining gas untouched) while Solidity uses an\n * invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b > 0, \"SafeMath: modulo by zero\");\n return a % b;\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\n * overflow (when the result is negative).\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {trySub}.\n *\n * Counterpart to Solidity's `-` operator.\n *\n * Requirements:\n *\n * - Subtraction cannot overflow.\n */\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b <= a, errorMessage);\n return a - b;\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers, reverting with custom message on\n * division by zero. The result is rounded towards zero.\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {tryDiv}.\n *\n * Counterpart to Solidity's `/` operator. Note: this function uses a\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\n * uses an invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b > 0, errorMessage);\n return a / b;\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * reverting with custom message when dividing by zero.\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {tryMod}.\n *\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\n * opcode (which leaves remaining gas untouched) while Solidity uses an\n * invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b > 0, errorMessage);\n return a % b;\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/ERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\nimport \"../../utils/Context.sol\";\nimport \"./IERC20.sol\";\nimport \"../../math/SafeMath.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin guidelines: functions revert instead\n * of returning `false` on failure. This behavior is nonetheless conventional\n * and does not conflict with the expectations of ERC20 applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20 {\n using SafeMath for uint256;\n\n mapping (address => uint256) private _balances;\n\n mapping (address => mapping (address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n uint8 private _decimals;\n\n /**\n * @dev Sets the values for {name} and {symbol}, initializes {decimals} with\n * a default value of 18.\n *\n * To select a different value for {decimals}, use {_setupDecimals}.\n *\n * All three of these values are immutable: they can only be set once during\n * construction.\n */\n constructor (string memory name_, string memory symbol_) public {\n _name = name_;\n _symbol = symbol_;\n _decimals = 18;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5,05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless {_setupDecimals} is\n * called.\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual returns (uint8) {\n return _decimals;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `recipient` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address recipient, uint256 amount) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * Requirements:\n *\n * - `sender` and `recipient` cannot be the zero address.\n * - `sender` must have a balance of at least `amount`.\n * - the caller must have allowance for ``sender``'s tokens of at least\n * `amount`.\n */\n function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, \"ERC20: transfer amount exceeds allowance\"));\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, \"ERC20: decreased allowance below zero\"));\n return true;\n }\n\n /**\n * @dev Moves tokens `amount` from `sender` to `recipient`.\n *\n * This is internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `sender` cannot be the zero address.\n * - `recipient` cannot be the zero address.\n * - `sender` must have a balance of at least `amount`.\n */\n function _transfer(address sender, address recipient, uint256 amount) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(sender, recipient, amount);\n\n _balances[sender] = _balances[sender].sub(amount, \"ERC20: transfer amount exceeds balance\");\n _balances[recipient] = _balances[recipient].add(amount);\n emit Transfer(sender, recipient, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply = _totalSupply.add(amount);\n _balances[account] = _balances[account].add(amount);\n emit Transfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n _balances[account] = _balances[account].sub(amount, \"ERC20: burn amount exceeds balance\");\n _totalSupply = _totalSupply.sub(amount);\n emit Transfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(address owner, address spender, uint256 amount) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Sets {decimals} to a value other than the default one of 18.\n *\n * WARNING: This function should only be called from the constructor. Most\n * applications that interact with token contracts will not expect\n * {decimals} to ever change, and may work incorrectly if it does.\n */\n function _setupDecimals(uint8 decimals_) internal virtual {\n _decimals = decimals_;\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be to transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `recipient`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address recipient, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `sender` to `recipient` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);\n\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/SafeERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"../../math/SafeMath.sol\";\nimport \"../../utils/Address.sol\";\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n using SafeMath for uint256;\n using Address for address;\n\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\n }\n\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\n }\n\n /**\n * @dev Deprecated. This function has issues similar to the ones found in\n * {IERC20-approve}, and its usage is discouraged.\n *\n * Whenever possible, use {safeIncreaseAllowance} and\n * {safeDecreaseAllowance} instead.\n */\n function safeApprove(IERC20 token, address spender, uint256 value) internal {\n // safeApprove should only be called when setting an initial allowance,\n // or when resetting it to zero. To increase and decrease it, use\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\n // solhint-disable-next-line max-line-length\n require((value == 0) || (token.allowance(address(this), spender) == 0),\n \"SafeERC20: approve from non-zero to non-zero allowance\"\n );\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\n }\n\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n uint256 newAllowance = token.allowance(address(this), spender).add(value);\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\n\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n uint256 newAllowance = token.allowance(address(this), spender).sub(value, \"SafeERC20: decreased allowance below zero\");\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n */\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that\n // the target address contains contract code and also asserts for success in the low-level call.\n\n bytes memory returndata = address(token).functionCall(data, \"SafeERC20: low-level call failed\");\n if (returndata.length > 0) { // Return data is optional\n // solhint-disable-next-line max-line-length\n require(abi.decode(returndata, (bool)), \"SafeERC20: ERC20 operation did not succeed\");\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Address.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.2 <0.8.0;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize, which returns 0 for contracts in\n // construction, since the code is only stored at the end of the\n // constructor execution.\n\n uint256 size;\n // solhint-disable-next-line no-inline-assembly\n assembly { size := extcodesize(account) }\n return size > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n // solhint-disable-next-line avoid-low-level-calls, avoid-call-value\n (bool success, ) = recipient.call{ value: amount }(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain`call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCall(target, data, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n require(isContract(target), \"Address: call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.call{ value: value }(data);\n return _verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {\n require(isContract(target), \"Address: static call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.staticcall(data);\n return _verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\n require(isContract(target), \"Address: delegate call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return _verifyCallResult(success, returndata, errorMessage);\n }\n\n function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {\n if (success) {\n return returndata;\n } else {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/*\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with GSN meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address payable) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes memory) {\n this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\n return msg.data;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Create2.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/**\n * @dev Helper to make usage of the `CREATE2` EVM opcode easier and safer.\n * `CREATE2` can be used to compute in advance the address where a smart\n * contract will be deployed, which allows for interesting new mechanisms known\n * as 'counterfactual interactions'.\n *\n * See the https://eips.ethereum.org/EIPS/eip-1014#motivation[EIP] for more\n * information.\n */\nlibrary Create2 {\n /**\n * @dev Deploys a contract using `CREATE2`. The address where the contract\n * will be deployed can be known in advance via {computeAddress}.\n *\n * The bytecode for a contract can be obtained from Solidity with\n * `type(contractName).creationCode`.\n *\n * Requirements:\n *\n * - `bytecode` must not be empty.\n * - `salt` must have not been used for `bytecode` already.\n * - the factory must have a balance of at least `amount`.\n * - if `amount` is non-zero, `bytecode` must have a `payable` constructor.\n */\n function deploy(uint256 amount, bytes32 salt, bytes memory bytecode) internal returns (address) {\n address addr;\n require(address(this).balance >= amount, \"Create2: insufficient balance\");\n require(bytecode.length != 0, \"Create2: bytecode length is zero\");\n // solhint-disable-next-line no-inline-assembly\n assembly {\n addr := create2(amount, add(bytecode, 0x20), mload(bytecode), salt)\n }\n require(addr != address(0), \"Create2: Failed on deploy\");\n return addr;\n }\n\n /**\n * @dev Returns the address where a contract will be stored if deployed via {deploy}. Any change in the\n * `bytecodeHash` or `salt` will result in a new destination address.\n */\n function computeAddress(bytes32 salt, bytes32 bytecodeHash) internal view returns (address) {\n return computeAddress(salt, bytecodeHash, address(this));\n }\n\n /**\n * @dev Returns the address where a contract will be stored if deployed via {deploy} from a contract located at\n * `deployer`. If `deployer` is this contract's address, returns the same value as {computeAddress}.\n */\n function computeAddress(bytes32 salt, bytes32 bytecodeHash, address deployer) internal pure returns (address) {\n bytes32 _data = keccak256(\n abi.encodePacked(bytes1(0xff), deployer, salt, bytecodeHash)\n );\n return address(uint160(uint256(_data)));\n }\n}\n" + }, + "@openzeppelin/contracts/utils/EnumerableSet.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/**\n * @dev Library for managing\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\n * types.\n *\n * Sets have the following properties:\n *\n * - Elements are added, removed, and checked for existence in constant time\n * (O(1)).\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\n *\n * ```\n * contract Example {\n * // Add the library methods\n * using EnumerableSet for EnumerableSet.AddressSet;\n *\n * // Declare a set state variable\n * EnumerableSet.AddressSet private mySet;\n * }\n * ```\n *\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\n * and `uint256` (`UintSet`) are supported.\n */\nlibrary EnumerableSet {\n // To implement this library for multiple types with as little code\n // repetition as possible, we write it in terms of a generic Set type with\n // bytes32 values.\n // The Set implementation uses private functions, and user-facing\n // implementations (such as AddressSet) are just wrappers around the\n // underlying Set.\n // This means that we can only create new EnumerableSets for types that fit\n // in bytes32.\n\n struct Set {\n // Storage of set values\n bytes32[] _values;\n\n // Position of the value in the `values` array, plus 1 because index 0\n // means a value is not in the set.\n mapping (bytes32 => uint256) _indexes;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function _add(Set storage set, bytes32 value) private returns (bool) {\n if (!_contains(set, value)) {\n set._values.push(value);\n // The value is stored at length-1, but we add 1 to all indexes\n // and use 0 as a sentinel value\n set._indexes[value] = set._values.length;\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function _remove(Set storage set, bytes32 value) private returns (bool) {\n // We read and store the value's index to prevent multiple reads from the same storage slot\n uint256 valueIndex = set._indexes[value];\n\n if (valueIndex != 0) { // Equivalent to contains(set, value)\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\n // the array, and then remove the last element (sometimes called as 'swap and pop').\n // This modifies the order of the array, as noted in {at}.\n\n uint256 toDeleteIndex = valueIndex - 1;\n uint256 lastIndex = set._values.length - 1;\n\n // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs\n // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.\n\n bytes32 lastvalue = set._values[lastIndex];\n\n // Move the last value to the index where the value to delete is\n set._values[toDeleteIndex] = lastvalue;\n // Update the index for the moved value\n set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based\n\n // Delete the slot where the moved value was stored\n set._values.pop();\n\n // Delete the index for the deleted slot\n delete set._indexes[value];\n\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\n return set._indexes[value] != 0;\n }\n\n /**\n * @dev Returns the number of values on the set. O(1).\n */\n function _length(Set storage set) private view returns (uint256) {\n return set._values.length;\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\n require(set._values.length > index, \"EnumerableSet: index out of bounds\");\n return set._values[index];\n }\n\n // Bytes32Set\n\n struct Bytes32Set {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _add(set._inner, value);\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _remove(set._inner, value);\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\n return _contains(set._inner, value);\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(Bytes32Set storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\n return _at(set._inner, index);\n }\n\n // AddressSet\n\n struct AddressSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(AddressSet storage set, address value) internal returns (bool) {\n return _add(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(AddressSet storage set, address value) internal returns (bool) {\n return _remove(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(AddressSet storage set, address value) internal view returns (bool) {\n return _contains(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(AddressSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\n return address(uint160(uint256(_at(set._inner, index))));\n }\n\n\n // UintSet\n\n struct UintSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(UintSet storage set, uint256 value) internal returns (bool) {\n return _add(set._inner, bytes32(value));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\n return _remove(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\n return _contains(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns the number of values on the set. O(1).\n */\n function length(UintSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\n return uint256(_at(set._inner, index));\n }\n}\n" + }, + "contracts/arbitrum/ITokenGateway.sol": { + "content": "// SPDX-License-Identifier: Apache-2.0\n\n/*\n * Copyright 2020, Offchain Labs, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * Originally copied from:\n * https://github.com/OffchainLabs/arbitrum/tree/e3a6307ad8a2dc2cad35728a2a9908cfd8dd8ef9/packages/arb-bridge-peripherals\n *\n * MODIFIED from Offchain Labs' implementation:\n * - Changed solidity version to 0.7.6 (pablo@edgeandnode.com)\n *\n */\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\ninterface ITokenGateway {\n /// @notice event deprecated in favor of DepositInitiated and WithdrawalInitiated\n // event OutboundTransferInitiated(\n // address token,\n // address indexed _from,\n // address indexed _to,\n // uint256 indexed _transferId,\n // uint256 _amount,\n // bytes _data\n // );\n\n /// @notice event deprecated in favor of DepositFinalized and WithdrawalFinalized\n // event InboundTransferFinalized(\n // address token,\n // address indexed _from,\n // address indexed _to,\n // uint256 indexed _transferId,\n // uint256 _amount,\n // bytes _data\n // );\n\n function outboundTransfer(\n address _token,\n address _to,\n uint256 _amount,\n uint256 _maxGas,\n uint256 _gasPriceBid,\n bytes calldata _data\n ) external payable returns (bytes memory);\n\n function finalizeInboundTransfer(\n address _token,\n address _from,\n address _to,\n uint256 _amount,\n bytes calldata _data\n ) external payable;\n\n /**\n * @notice Calculate the address used when bridging an ERC20 token\n * @dev the L1 and L2 address oracles may not always be in sync.\n * For example, a custom token may have been registered but not deployed or the contract self destructed.\n * @param l1ERC20 address of L1 token\n * @return L2 address of a bridged ERC20 token\n */\n function calculateL2TokenAddress(address l1ERC20) external view returns (address);\n}\n" + }, + "contracts/GraphTokenDistributor.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\nimport \"@openzeppelin/contracts/math/SafeMath.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\";\n\n/**\n * @title GraphTokenDistributor\n * @dev Contract that allows distribution of tokens to multiple beneficiaries.\n * The contract accept deposits in the configured token by anyone.\n * The owner can setup the desired distribution by setting the amount of tokens\n * assigned to each beneficiary account.\n * Beneficiaries claim for their allocated tokens.\n * Only the owner can withdraw tokens from this contract without limitations.\n * For the distribution to work this contract must be unlocked by the owner.\n */\ncontract GraphTokenDistributor is Ownable {\n using SafeMath for uint256;\n using SafeERC20 for IERC20;\n\n // -- State --\n\n bool public locked;\n mapping(address => uint256) public beneficiaries;\n\n IERC20 public token;\n\n // -- Events --\n\n event BeneficiaryUpdated(address indexed beneficiary, uint256 amount);\n event TokensDeposited(address indexed sender, uint256 amount);\n event TokensWithdrawn(address indexed sender, uint256 amount);\n event TokensClaimed(address indexed beneficiary, address to, uint256 amount);\n event LockUpdated(bool locked);\n\n modifier whenNotLocked() {\n require(locked == false, \"Distributor: Claim is locked\");\n _;\n }\n\n /**\n * Constructor.\n * @param _token Token to use for deposits and withdrawals\n */\n constructor(IERC20 _token) {\n token = _token;\n locked = true;\n }\n\n /**\n * Deposit tokens into the contract.\n * Even if the ERC20 token can be transferred directly to the contract\n * this function provide a safe interface to do the transfer and avoid mistakes\n * @param _amount Amount to deposit\n */\n function deposit(uint256 _amount) external {\n token.safeTransferFrom(msg.sender, address(this), _amount);\n emit TokensDeposited(msg.sender, _amount);\n }\n\n // -- Admin functions --\n\n /**\n * Add token balance available for account.\n * @param _account Address to assign tokens to\n * @param _amount Amount of tokens to assign to beneficiary\n */\n function addBeneficiaryTokens(address _account, uint256 _amount) external onlyOwner {\n _setBeneficiaryTokens(_account, beneficiaries[_account].add(_amount));\n }\n\n /**\n * Add token balance available for multiple accounts.\n * @param _accounts Addresses to assign tokens to\n * @param _amounts Amounts of tokens to assign to beneficiary\n */\n function addBeneficiaryTokensMulti(address[] calldata _accounts, uint256[] calldata _amounts) external onlyOwner {\n require(_accounts.length == _amounts.length, \"Distributor: !length\");\n for (uint256 i = 0; i < _accounts.length; i++) {\n _setBeneficiaryTokens(_accounts[i], beneficiaries[_accounts[i]].add(_amounts[i]));\n }\n }\n\n /**\n * Remove token balance available for account.\n * @param _account Address to assign tokens to\n * @param _amount Amount of tokens to assign to beneficiary\n */\n function subBeneficiaryTokens(address _account, uint256 _amount) external onlyOwner {\n _setBeneficiaryTokens(_account, beneficiaries[_account].sub(_amount));\n }\n\n /**\n * Remove token balance available for multiple accounts.\n * @param _accounts Addresses to assign tokens to\n * @param _amounts Amounts of tokens to assign to beneficiary\n */\n function subBeneficiaryTokensMulti(address[] calldata _accounts, uint256[] calldata _amounts) external onlyOwner {\n require(_accounts.length == _amounts.length, \"Distributor: !length\");\n for (uint256 i = 0; i < _accounts.length; i++) {\n _setBeneficiaryTokens(_accounts[i], beneficiaries[_accounts[i]].sub(_amounts[i]));\n }\n }\n\n /**\n * Set amount of tokens available for beneficiary account.\n * @param _account Address to assign tokens to\n * @param _amount Amount of tokens to assign to beneficiary\n */\n function _setBeneficiaryTokens(address _account, uint256 _amount) private {\n require(_account != address(0), \"Distributor: !account\");\n\n beneficiaries[_account] = _amount;\n emit BeneficiaryUpdated(_account, _amount);\n }\n\n /**\n * Set locked withdrawals.\n * @param _locked True to lock withdrawals\n */\n function setLocked(bool _locked) external onlyOwner {\n locked = _locked;\n emit LockUpdated(_locked);\n }\n\n /**\n * Withdraw tokens from the contract. This function is included as\n * a escape hatch in case of mistakes or to recover remaining funds.\n * @param _amount Amount of tokens to withdraw\n */\n function withdraw(uint256 _amount) external onlyOwner {\n token.safeTransfer(msg.sender, _amount);\n emit TokensWithdrawn(msg.sender, _amount);\n }\n\n // -- Beneficiary functions --\n\n /**\n * Claim tokens and send to caller.\n */\n function claim() external whenNotLocked {\n claimTo(msg.sender);\n }\n\n /**\n * Claim tokens and send to address.\n * @param _to Address where to send tokens\n */\n function claimTo(address _to) public whenNotLocked {\n uint256 claimableTokens = beneficiaries[msg.sender];\n require(claimableTokens > 0, \"Distributor: Unavailable funds\");\n\n _setBeneficiaryTokens(msg.sender, 0);\n\n token.safeTransfer(_to, claimableTokens);\n emit TokensClaimed(msg.sender, _to, claimableTokens);\n }\n}\n" + }, + "contracts/GraphTokenLock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport \"@openzeppelin/contracts/math/SafeMath.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\";\n\nimport { Ownable as OwnableInitializable } from \"./Ownable.sol\";\nimport \"./MathUtils.sol\";\nimport \"./IGraphTokenLock.sol\";\n\n/**\n * @title GraphTokenLock\n * @notice Contract that manages an unlocking schedule of tokens.\n * @dev The contract lock manage a number of tokens deposited into the contract to ensure that\n * they can only be released under certain time conditions.\n *\n * This contract implements a release scheduled based on periods and tokens are released in steps\n * after each period ends. It can be configured with one period in which case it is like a plain TimeLock.\n * It also supports revocation to be used for vesting schedules.\n *\n * The contract supports receiving extra funds than the managed tokens ones that can be\n * withdrawn by the beneficiary at any time.\n *\n * A releaseStartTime parameter is included to override the default release schedule and\n * perform the first release on the configured time. After that it will continue with the\n * default schedule.\n */\nabstract contract GraphTokenLock is OwnableInitializable, IGraphTokenLock {\n using SafeMath for uint256;\n using SafeERC20 for IERC20;\n\n uint256 private constant MIN_PERIOD = 1;\n\n // -- State --\n\n IERC20 public token;\n address public beneficiary;\n\n // Configuration\n\n // Amount of tokens managed by the contract schedule\n uint256 public managedAmount;\n\n uint256 public startTime; // Start datetime (in unixtimestamp)\n uint256 public endTime; // Datetime after all funds are fully vested/unlocked (in unixtimestamp)\n uint256 public periods; // Number of vesting/release periods\n\n // First release date for tokens (in unixtimestamp)\n // If set, no tokens will be released before releaseStartTime ignoring\n // the amount to release each period\n uint256 public releaseStartTime;\n // A cliff set a date to which a beneficiary needs to get to vest\n // all preceding periods\n uint256 public vestingCliffTime;\n Revocability public revocable; // Whether to use vesting for locked funds\n\n // State\n\n bool public isRevoked;\n bool public isInitialized;\n bool public isAccepted;\n uint256 public releasedAmount;\n uint256 public revokedAmount;\n\n // -- Events --\n\n event TokensReleased(address indexed beneficiary, uint256 amount);\n event TokensWithdrawn(address indexed beneficiary, uint256 amount);\n event TokensRevoked(address indexed beneficiary, uint256 amount);\n event BeneficiaryChanged(address newBeneficiary);\n event LockAccepted();\n event LockCanceled();\n\n /**\n * @dev Only allow calls from the beneficiary of the contract\n */\n modifier onlyBeneficiary() {\n require(msg.sender == beneficiary, \"!auth\");\n _;\n }\n\n /**\n * @notice Initializes the contract\n * @param _owner Address of the contract owner\n * @param _beneficiary Address of the beneficiary of locked tokens\n * @param _managedAmount Amount of tokens to be managed by the lock contract\n * @param _startTime Start time of the release schedule\n * @param _endTime End time of the release schedule\n * @param _periods Number of periods between start time and end time\n * @param _releaseStartTime Override time for when the releases start\n * @param _vestingCliffTime Override time for when the vesting start\n * @param _revocable Whether the contract is revocable\n */\n function _initialize(\n address _owner,\n address _beneficiary,\n address _token,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n Revocability _revocable\n ) internal {\n require(!isInitialized, \"Already initialized\");\n require(_owner != address(0), \"Owner cannot be zero\");\n require(_beneficiary != address(0), \"Beneficiary cannot be zero\");\n require(_token != address(0), \"Token cannot be zero\");\n require(_managedAmount > 0, \"Managed tokens cannot be zero\");\n require(_startTime != 0, \"Start time must be set\");\n require(_startTime < _endTime, \"Start time > end time\");\n require(_periods >= MIN_PERIOD, \"Periods cannot be below minimum\");\n require(_revocable != Revocability.NotSet, \"Must set a revocability option\");\n require(_releaseStartTime < _endTime, \"Release start time must be before end time\");\n require(_vestingCliffTime < _endTime, \"Cliff time must be before end time\");\n\n isInitialized = true;\n\n OwnableInitializable._initialize(_owner);\n beneficiary = _beneficiary;\n token = IERC20(_token);\n\n managedAmount = _managedAmount;\n\n startTime = _startTime;\n endTime = _endTime;\n periods = _periods;\n\n // Optionals\n releaseStartTime = _releaseStartTime;\n vestingCliffTime = _vestingCliffTime;\n revocable = _revocable;\n }\n\n /**\n * @notice Change the beneficiary of funds managed by the contract\n * @dev Can only be called by the beneficiary\n * @param _newBeneficiary Address of the new beneficiary address\n */\n function changeBeneficiary(address _newBeneficiary) external onlyBeneficiary {\n require(_newBeneficiary != address(0), \"Empty beneficiary\");\n beneficiary = _newBeneficiary;\n emit BeneficiaryChanged(_newBeneficiary);\n }\n\n /**\n * @notice Beneficiary accepts the lock, the owner cannot retrieve back the tokens\n * @dev Can only be called by the beneficiary\n */\n function acceptLock() external onlyBeneficiary {\n isAccepted = true;\n emit LockAccepted();\n }\n\n /**\n * @notice Owner cancel the lock and return the balance in the contract\n * @dev Can only be called by the owner\n */\n function cancelLock() external onlyOwner {\n require(isAccepted == false, \"Cannot cancel accepted contract\");\n\n token.safeTransfer(owner(), currentBalance());\n\n emit LockCanceled();\n }\n\n // -- Balances --\n\n /**\n * @notice Returns the amount of tokens currently held by the contract\n * @return Tokens held in the contract\n */\n function currentBalance() public view override returns (uint256) {\n return token.balanceOf(address(this));\n }\n\n // -- Time & Periods --\n\n /**\n * @notice Returns the current block timestamp\n * @return Current block timestamp\n */\n function currentTime() public view override returns (uint256) {\n return block.timestamp;\n }\n\n /**\n * @notice Gets duration of contract from start to end in seconds\n * @return Amount of seconds from contract startTime to endTime\n */\n function duration() public view override returns (uint256) {\n return endTime.sub(startTime);\n }\n\n /**\n * @notice Gets time elapsed since the start of the contract\n * @dev Returns zero if called before conctract starTime\n * @return Seconds elapsed from contract startTime\n */\n function sinceStartTime() public view override returns (uint256) {\n uint256 current = currentTime();\n if (current <= startTime) {\n return 0;\n }\n return current.sub(startTime);\n }\n\n /**\n * @notice Returns amount available to be released after each period according to schedule\n * @return Amount of tokens available after each period\n */\n function amountPerPeriod() public view override returns (uint256) {\n return managedAmount.div(periods);\n }\n\n /**\n * @notice Returns the duration of each period in seconds\n * @return Duration of each period in seconds\n */\n function periodDuration() public view override returns (uint256) {\n return duration().div(periods);\n }\n\n /**\n * @notice Gets the current period based on the schedule\n * @return A number that represents the current period\n */\n function currentPeriod() public view override returns (uint256) {\n return sinceStartTime().div(periodDuration()).add(MIN_PERIOD);\n }\n\n /**\n * @notice Gets the number of periods that passed since the first period\n * @return A number of periods that passed since the schedule started\n */\n function passedPeriods() public view override returns (uint256) {\n return currentPeriod().sub(MIN_PERIOD);\n }\n\n // -- Locking & Release Schedule --\n\n /**\n * @notice Gets the currently available token according to the schedule\n * @dev Implements the step-by-step schedule based on periods for available tokens\n * @return Amount of tokens available according to the schedule\n */\n function availableAmount() public view override returns (uint256) {\n uint256 current = currentTime();\n\n // Before contract start no funds are available\n if (current < startTime) {\n return 0;\n }\n\n // After contract ended all funds are available\n if (current > endTime) {\n return managedAmount;\n }\n\n // Get available amount based on period\n return passedPeriods().mul(amountPerPeriod());\n }\n\n /**\n * @notice Gets the amount of currently vested tokens\n * @dev Similar to available amount, but is fully vested when contract is non-revocable\n * @return Amount of tokens already vested\n */\n function vestedAmount() public view override returns (uint256) {\n // If non-revocable it is fully vested\n if (revocable == Revocability.Disabled) {\n return managedAmount;\n }\n\n // Vesting cliff is activated and it has not passed means nothing is vested yet\n if (vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\n return 0;\n }\n\n return availableAmount();\n }\n\n /**\n * @notice Gets tokens currently available for release\n * @dev Considers the schedule and takes into account already released tokens\n * @return Amount of tokens ready to be released\n */\n function releasableAmount() public view virtual override returns (uint256) {\n // If a release start time is set no tokens are available for release before this date\n // If not set it follows the default schedule and tokens are available on\n // the first period passed\n if (releaseStartTime > 0 && currentTime() < releaseStartTime) {\n return 0;\n }\n\n // Vesting cliff is activated and it has not passed means nothing is vested yet\n // so funds cannot be released\n if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\n return 0;\n }\n\n // A beneficiary can never have more releasable tokens than the contract balance\n uint256 releasable = availableAmount().sub(releasedAmount);\n return MathUtils.min(currentBalance(), releasable);\n }\n\n /**\n * @notice Gets the outstanding amount yet to be released based on the whole contract lifetime\n * @dev Does not consider schedule but just global amounts tracked\n * @return Amount of outstanding tokens for the lifetime of the contract\n */\n function totalOutstandingAmount() public view override returns (uint256) {\n return managedAmount.sub(releasedAmount).sub(revokedAmount);\n }\n\n /**\n * @notice Gets surplus amount in the contract based on outstanding amount to release\n * @dev All funds over outstanding amount is considered surplus that can be withdrawn by beneficiary.\n * Note this might not be the correct value for wallets transferred to L2 (i.e. an L2GraphTokenLockWallet), as the released amount will be\n * skewed, so the beneficiary might have to bridge back to L1 to release the surplus.\n * @return Amount of tokens considered as surplus\n */\n function surplusAmount() public view override returns (uint256) {\n uint256 balance = currentBalance();\n uint256 outstandingAmount = totalOutstandingAmount();\n if (balance > outstandingAmount) {\n return balance.sub(outstandingAmount);\n }\n return 0;\n }\n\n // -- Value Transfer --\n\n /**\n * @notice Releases tokens based on the configured schedule\n * @dev All available releasable tokens are transferred to beneficiary\n */\n function release() external override onlyBeneficiary {\n uint256 amountToRelease = releasableAmount();\n require(amountToRelease > 0, \"No available releasable amount\");\n\n releasedAmount = releasedAmount.add(amountToRelease);\n\n token.safeTransfer(beneficiary, amountToRelease);\n\n emit TokensReleased(beneficiary, amountToRelease);\n }\n\n /**\n * @notice Withdraws surplus, unmanaged tokens from the contract\n * @dev Tokens in the contract over outstanding amount are considered as surplus\n * @param _amount Amount of tokens to withdraw\n */\n function withdrawSurplus(uint256 _amount) external override onlyBeneficiary {\n require(_amount > 0, \"Amount cannot be zero\");\n require(surplusAmount() >= _amount, \"Amount requested > surplus available\");\n\n token.safeTransfer(beneficiary, _amount);\n\n emit TokensWithdrawn(beneficiary, _amount);\n }\n\n /**\n * @notice Revokes a vesting schedule and return the unvested tokens to the owner\n * @dev Vesting schedule is always calculated based on managed tokens\n */\n function revoke() external override onlyOwner {\n require(revocable == Revocability.Enabled, \"Contract is non-revocable\");\n require(isRevoked == false, \"Already revoked\");\n\n uint256 unvestedAmount = managedAmount.sub(vestedAmount());\n require(unvestedAmount > 0, \"No available unvested amount\");\n\n revokedAmount = unvestedAmount;\n isRevoked = true;\n\n token.safeTransfer(owner(), unvestedAmount);\n\n emit TokensRevoked(beneficiary, unvestedAmount);\n }\n}\n" + }, + "contracts/GraphTokenLockManager.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\";\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"@openzeppelin/contracts/utils/EnumerableSet.sol\";\nimport { Ownable } from \"@openzeppelin/contracts/access/Ownable.sol\";\n\nimport \"./MinimalProxyFactory.sol\";\nimport \"./IGraphTokenLockManager.sol\";\nimport { GraphTokenLockWallet } from \"./GraphTokenLockWallet.sol\";\n\n/**\n * @title GraphTokenLockManager\n * @notice This contract manages a list of authorized function calls and targets that can be called\n * by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts.\n *\n * This contract receives funds to make the process of creating TokenLockWallet contracts\n * easier by distributing them the initial tokens to be managed.\n *\n * The owner can setup a list of token destinations that will be used by TokenLock contracts to\n * approve the pulling of funds, this way in can be guaranteed that only protocol contracts\n * will manipulate users funds.\n */\ncontract GraphTokenLockManager is Ownable, MinimalProxyFactory, IGraphTokenLockManager {\n using SafeERC20 for IERC20;\n using EnumerableSet for EnumerableSet.AddressSet;\n\n // -- State --\n\n mapping(bytes4 => address) public authFnCalls;\n EnumerableSet.AddressSet private _tokenDestinations;\n\n address public masterCopy;\n IERC20 internal _token;\n\n // -- Events --\n\n event MasterCopyUpdated(address indexed masterCopy);\n event TokenLockCreated(\n address indexed contractAddress,\n bytes32 indexed initHash,\n address indexed beneficiary,\n address token,\n uint256 managedAmount,\n uint256 startTime,\n uint256 endTime,\n uint256 periods,\n uint256 releaseStartTime,\n uint256 vestingCliffTime,\n IGraphTokenLock.Revocability revocable\n );\n\n event TokensDeposited(address indexed sender, uint256 amount);\n event TokensWithdrawn(address indexed sender, uint256 amount);\n\n event FunctionCallAuth(address indexed caller, bytes4 indexed sigHash, address indexed target, string signature);\n event TokenDestinationAllowed(address indexed dst, bool allowed);\n\n /**\n * Constructor.\n * @param _graphToken Token to use for deposits and withdrawals\n * @param _masterCopy Address of the master copy to use to clone proxies\n */\n constructor(IERC20 _graphToken, address _masterCopy) {\n require(address(_graphToken) != address(0), \"Token cannot be zero\");\n _token = _graphToken;\n setMasterCopy(_masterCopy);\n }\n\n // -- Factory --\n\n /**\n * @notice Sets the masterCopy bytecode to use to create clones of TokenLock contracts\n * @param _masterCopy Address of contract bytecode to factory clone\n */\n function setMasterCopy(address _masterCopy) public override onlyOwner {\n require(_masterCopy != address(0), \"MasterCopy cannot be zero\");\n masterCopy = _masterCopy;\n emit MasterCopyUpdated(_masterCopy);\n }\n\n /**\n * @notice Creates and fund a new token lock wallet using a minimum proxy\n * @param _owner Address of the contract owner\n * @param _beneficiary Address of the beneficiary of locked tokens\n * @param _managedAmount Amount of tokens to be managed by the lock contract\n * @param _startTime Start time of the release schedule\n * @param _endTime End time of the release schedule\n * @param _periods Number of periods between start time and end time\n * @param _releaseStartTime Override time for when the releases start\n * @param _revocable Whether the contract is revocable\n */\n function createTokenLockWallet(\n address _owner,\n address _beneficiary,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n IGraphTokenLock.Revocability _revocable\n ) external override onlyOwner {\n require(_token.balanceOf(address(this)) >= _managedAmount, \"Not enough tokens to create lock\");\n\n // Create contract using a minimal proxy and call initializer\n bytes memory initializer = abi.encodeWithSelector(\n GraphTokenLockWallet.initialize.selector,\n address(this),\n _owner,\n _beneficiary,\n address(_token),\n _managedAmount,\n _startTime,\n _endTime,\n _periods,\n _releaseStartTime,\n _vestingCliffTime,\n _revocable\n );\n address contractAddress = _deployProxy2(keccak256(initializer), masterCopy, initializer);\n\n // Send managed amount to the created contract\n _token.safeTransfer(contractAddress, _managedAmount);\n\n emit TokenLockCreated(\n contractAddress,\n keccak256(initializer),\n _beneficiary,\n address(_token),\n _managedAmount,\n _startTime,\n _endTime,\n _periods,\n _releaseStartTime,\n _vestingCliffTime,\n _revocable\n );\n }\n\n // -- Funds Management --\n\n /**\n * @notice Gets the GRT token address\n * @return Token used for transfers and approvals\n */\n function token() external view override returns (IERC20) {\n return _token;\n }\n\n /**\n * @notice Deposits tokens into the contract\n * @dev Even if the ERC20 token can be transferred directly to the contract\n * this function provide a safe interface to do the transfer and avoid mistakes\n * @param _amount Amount to deposit\n */\n function deposit(uint256 _amount) external override {\n require(_amount > 0, \"Amount cannot be zero\");\n _token.safeTransferFrom(msg.sender, address(this), _amount);\n emit TokensDeposited(msg.sender, _amount);\n }\n\n /**\n * @notice Withdraws tokens from the contract\n * @dev Escape hatch in case of mistakes or to recover remaining funds\n * @param _amount Amount of tokens to withdraw\n */\n function withdraw(uint256 _amount) external override onlyOwner {\n require(_amount > 0, \"Amount cannot be zero\");\n _token.safeTransfer(msg.sender, _amount);\n emit TokensWithdrawn(msg.sender, _amount);\n }\n\n // -- Token Destinations --\n\n /**\n * @notice Adds an address that can be allowed by a token lock to pull funds\n * @param _dst Destination address\n */\n function addTokenDestination(address _dst) external override onlyOwner {\n require(_dst != address(0), \"Destination cannot be zero\");\n require(_tokenDestinations.add(_dst), \"Destination already added\");\n emit TokenDestinationAllowed(_dst, true);\n }\n\n /**\n * @notice Removes an address that can be allowed by a token lock to pull funds\n * @param _dst Destination address\n */\n function removeTokenDestination(address _dst) external override onlyOwner {\n require(_tokenDestinations.remove(_dst), \"Destination already removed\");\n emit TokenDestinationAllowed(_dst, false);\n }\n\n /**\n * @notice Returns True if the address is authorized to be a destination of tokens\n * @param _dst Destination address\n * @return True if authorized\n */\n function isTokenDestination(address _dst) external view override returns (bool) {\n return _tokenDestinations.contains(_dst);\n }\n\n /**\n * @notice Returns an array of authorized destination addresses\n * @return Array of addresses authorized to pull funds from a token lock\n */\n function getTokenDestinations() external view override returns (address[] memory) {\n address[] memory dstList = new address[](_tokenDestinations.length());\n for (uint256 i = 0; i < _tokenDestinations.length(); i++) {\n dstList[i] = _tokenDestinations.at(i);\n }\n return dstList;\n }\n\n // -- Function Call Authorization --\n\n /**\n * @notice Sets an authorized function call to target\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\n * @param _signature Function signature\n * @param _target Address of the destination contract to call\n */\n function setAuthFunctionCall(string calldata _signature, address _target) external override onlyOwner {\n _setAuthFunctionCall(_signature, _target);\n }\n\n /**\n * @notice Unsets an authorized function call to target\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\n * @param _signature Function signature\n */\n function unsetAuthFunctionCall(string calldata _signature) external override onlyOwner {\n bytes4 sigHash = _toFunctionSigHash(_signature);\n authFnCalls[sigHash] = address(0);\n\n emit FunctionCallAuth(msg.sender, sigHash, address(0), _signature);\n }\n\n /**\n * @notice Sets an authorized function call to target in bulk\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\n * @param _signatures Function signatures\n * @param _targets Address of the destination contract to call\n */\n function setAuthFunctionCallMany(\n string[] calldata _signatures,\n address[] calldata _targets\n ) external override onlyOwner {\n require(_signatures.length == _targets.length, \"Array length mismatch\");\n\n for (uint256 i = 0; i < _signatures.length; i++) {\n _setAuthFunctionCall(_signatures[i], _targets[i]);\n }\n }\n\n /**\n * @notice Sets an authorized function call to target\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\n * @dev Function signatures of Graph Protocol contracts to be used are known ahead of time\n * @param _signature Function signature\n * @param _target Address of the destination contract to call\n */\n function _setAuthFunctionCall(string calldata _signature, address _target) internal {\n require(_target != address(this), \"Target must be other contract\");\n require(Address.isContract(_target), \"Target must be a contract\");\n\n bytes4 sigHash = _toFunctionSigHash(_signature);\n authFnCalls[sigHash] = _target;\n\n emit FunctionCallAuth(msg.sender, sigHash, _target, _signature);\n }\n\n /**\n * @notice Gets the target contract to call for a particular function signature\n * @param _sigHash Function signature hash\n * @return Address of the target contract where to send the call\n */\n function getAuthFunctionCallTarget(bytes4 _sigHash) public view override returns (address) {\n return authFnCalls[_sigHash];\n }\n\n /**\n * @notice Returns true if the function call is authorized\n * @param _sigHash Function signature hash\n * @return True if authorized\n */\n function isAuthFunctionCall(bytes4 _sigHash) external view override returns (bool) {\n return getAuthFunctionCallTarget(_sigHash) != address(0);\n }\n\n /**\n * @dev Converts a function signature string to 4-bytes hash\n * @param _signature Function signature string\n * @return Function signature hash\n */\n function _toFunctionSigHash(string calldata _signature) internal pure returns (bytes4) {\n return _convertToBytes4(abi.encodeWithSignature(_signature));\n }\n\n /**\n * @dev Converts function signature bytes to function signature hash (bytes4)\n * @param _signature Function signature\n * @return Function signature in bytes4\n */\n function _convertToBytes4(bytes memory _signature) internal pure returns (bytes4) {\n require(_signature.length == 4, \"Invalid method signature\");\n bytes4 sigHash;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n sigHash := mload(add(_signature, 32))\n }\n return sigHash;\n }\n}\n" + }, + "contracts/GraphTokenLockSimple.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport \"./GraphTokenLock.sol\";\n\n/**\n * @title GraphTokenLockSimple\n * @notice This contract is the concrete simple implementation built on top of the base\n * GraphTokenLock functionality for use when we only need the token lock schedule\n * features but no interaction with the network.\n *\n * This contract is designed to be deployed without the use of a TokenManager.\n */\ncontract GraphTokenLockSimple is GraphTokenLock {\n // Constructor\n constructor() {\n OwnableInitializable._initialize(msg.sender);\n }\n\n // Initializer\n function initialize(\n address _owner,\n address _beneficiary,\n address _token,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n Revocability _revocable\n ) external onlyOwner {\n _initialize(\n _owner,\n _beneficiary,\n _token,\n _managedAmount,\n _startTime,\n _endTime,\n _periods,\n _releaseStartTime,\n _vestingCliffTime,\n _revocable\n );\n }\n}\n" + }, + "contracts/GraphTokenLockWallet.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"@openzeppelin/contracts/math/SafeMath.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\nimport \"./GraphTokenLock.sol\";\nimport \"./IGraphTokenLockManager.sol\";\n\n/**\n * @title GraphTokenLockWallet\n * @notice This contract is built on top of the base GraphTokenLock functionality.\n * It allows wallet beneficiaries to use the deposited funds to perform specific function calls\n * on specific contracts.\n *\n * The idea is that supporters with locked tokens can participate in the protocol\n * but disallow any release before the vesting/lock schedule.\n * The beneficiary can issue authorized function calls to this contract that will\n * get forwarded to a target contract. A target contract is any of our protocol contracts.\n * The function calls allowed are queried to the GraphTokenLockManager, this way\n * the same configuration can be shared for all the created lock wallet contracts.\n *\n * NOTE: Contracts used as target must have its function signatures checked to avoid collisions\n * with any of this contract functions.\n * Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience\n * the maximum amount of tokens is authorized.\n * Function calls do not forward ETH value so DO NOT SEND ETH TO THIS CONTRACT.\n */\ncontract GraphTokenLockWallet is GraphTokenLock {\n using SafeMath for uint256;\n\n // -- State --\n\n IGraphTokenLockManager public manager;\n uint256 public usedAmount;\n\n // -- Events --\n\n event ManagerUpdated(address indexed _oldManager, address indexed _newManager);\n event TokenDestinationsApproved();\n event TokenDestinationsRevoked();\n\n // Initializer\n function initialize(\n address _manager,\n address _owner,\n address _beneficiary,\n address _token,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n Revocability _revocable\n ) external {\n _initialize(\n _owner,\n _beneficiary,\n _token,\n _managedAmount,\n _startTime,\n _endTime,\n _periods,\n _releaseStartTime,\n _vestingCliffTime,\n _revocable\n );\n _setManager(_manager);\n }\n\n // -- Admin --\n\n /**\n * @notice Sets a new manager for this contract\n * @param _newManager Address of the new manager\n */\n function setManager(address _newManager) external onlyOwner {\n _setManager(_newManager);\n }\n\n /**\n * @dev Sets a new manager for this contract\n * @param _newManager Address of the new manager\n */\n function _setManager(address _newManager) internal {\n require(_newManager != address(0), \"Manager cannot be empty\");\n require(Address.isContract(_newManager), \"Manager must be a contract\");\n\n address oldManager = address(manager);\n manager = IGraphTokenLockManager(_newManager);\n\n emit ManagerUpdated(oldManager, _newManager);\n }\n\n // -- Beneficiary --\n\n /**\n * @notice Approves protocol access of the tokens managed by this contract\n * @dev Approves all token destinations registered in the manager to pull tokens\n */\n function approveProtocol() external onlyBeneficiary {\n address[] memory dstList = manager.getTokenDestinations();\n for (uint256 i = 0; i < dstList.length; i++) {\n // Note this is only safe because we are using the max uint256 value\n token.approve(dstList[i], type(uint256).max);\n }\n emit TokenDestinationsApproved();\n }\n\n /**\n * @notice Revokes protocol access of the tokens managed by this contract\n * @dev Revokes approval to all token destinations in the manager to pull tokens\n */\n function revokeProtocol() external onlyBeneficiary {\n address[] memory dstList = manager.getTokenDestinations();\n for (uint256 i = 0; i < dstList.length; i++) {\n // Note this is only safe cause we're using 0 as the amount\n token.approve(dstList[i], 0);\n }\n emit TokenDestinationsRevoked();\n }\n\n /**\n * @notice Gets tokens currently available for release\n * @dev Considers the schedule, takes into account already released tokens and used amount\n * @return Amount of tokens ready to be released\n */\n function releasableAmount() public view override returns (uint256) {\n if (revocable == Revocability.Disabled) {\n return super.releasableAmount();\n }\n\n // -- Revocability enabled logic\n // This needs to deal with additional considerations for when tokens are used in the protocol\n\n // If a release start time is set no tokens are available for release before this date\n // If not set it follows the default schedule and tokens are available on\n // the first period passed\n if (releaseStartTime > 0 && currentTime() < releaseStartTime) {\n return 0;\n }\n\n // Vesting cliff is activated and it has not passed means nothing is vested yet\n // so funds cannot be released\n if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\n return 0;\n }\n\n // A beneficiary can never have more releasable tokens than the contract balance\n // We consider the `usedAmount` in the protocol as part of the calculations\n // the beneficiary should not release funds that are used.\n uint256 releasable = availableAmount().sub(releasedAmount).sub(usedAmount);\n return MathUtils.min(currentBalance(), releasable);\n }\n\n /**\n * @notice Forward authorized contract calls to protocol contracts\n * @dev Fallback function can be called by the beneficiary only if function call is allowed\n */\n // solhint-disable-next-line no-complex-fallback\n fallback() external payable {\n // Only beneficiary can forward calls\n require(msg.sender == beneficiary, \"Unauthorized caller\");\n require(msg.value == 0, \"ETH transfers not supported\");\n\n // Function call validation\n address _target = manager.getAuthFunctionCallTarget(msg.sig);\n require(_target != address(0), \"Unauthorized function\");\n\n uint256 oldBalance = currentBalance();\n\n // Call function with data\n Address.functionCall(_target, msg.data);\n\n // Tracked used tokens in the protocol\n // We do this check after balances were updated by the forwarded call\n // Check is only enforced for revocable contracts to save some gas\n if (revocable == Revocability.Enabled) {\n // Track contract balance change\n uint256 newBalance = currentBalance();\n if (newBalance < oldBalance) {\n // Outflow\n uint256 diff = oldBalance.sub(newBalance);\n usedAmount = usedAmount.add(diff);\n } else {\n // Inflow: We can receive profits from the protocol, that could make usedAmount to\n // underflow. We set it to zero in that case.\n uint256 diff = newBalance.sub(oldBalance);\n usedAmount = (diff >= usedAmount) ? 0 : usedAmount.sub(diff);\n }\n require(usedAmount <= vestedAmount(), \"Cannot use more tokens than vested amount\");\n }\n }\n\n /**\n * @notice Receive function that always reverts.\n * @dev Only included to supress warnings, see https://github.com/ethereum/solidity/issues/10159\n */\n receive() external payable {\n revert(\"Bad call\");\n }\n}\n" + }, + "contracts/ICallhookReceiver.sol": { + "content": "// SPDX-License-Identifier: GPL-2.0-or-later\n\n// Copied from graphprotocol/contracts, changed solidity version to 0.7.3\n\n/**\n * @title Interface for contracts that can receive callhooks through the Arbitrum GRT bridge\n * @dev Any contract that can receive a callhook on L2, sent through the bridge from L1, must\n * be allowlisted by the governor, but also implement this interface that contains\n * the function that will actually be called by the L2GraphTokenGateway.\n */\npragma solidity ^0.7.3;\n\ninterface ICallhookReceiver {\n /**\n * @notice Receive tokens with a callhook from the bridge\n * @param _from Token sender in L1\n * @param _amount Amount of tokens that were transferred\n * @param _data ABI-encoded callhook data\n */\n function onTokenTransfer(address _from, uint256 _amount, bytes calldata _data) external;\n}\n" + }, + "contracts/IGraphTokenLock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\ninterface IGraphTokenLock {\n enum Revocability {\n NotSet,\n Enabled,\n Disabled\n }\n\n // -- Balances --\n\n function currentBalance() external view returns (uint256);\n\n // -- Time & Periods --\n\n function currentTime() external view returns (uint256);\n\n function duration() external view returns (uint256);\n\n function sinceStartTime() external view returns (uint256);\n\n function amountPerPeriod() external view returns (uint256);\n\n function periodDuration() external view returns (uint256);\n\n function currentPeriod() external view returns (uint256);\n\n function passedPeriods() external view returns (uint256);\n\n // -- Locking & Release Schedule --\n\n function availableAmount() external view returns (uint256);\n\n function vestedAmount() external view returns (uint256);\n\n function releasableAmount() external view returns (uint256);\n\n function totalOutstandingAmount() external view returns (uint256);\n\n function surplusAmount() external view returns (uint256);\n\n // -- Value Transfer --\n\n function release() external;\n\n function withdrawSurplus(uint256 _amount) external;\n\n function revoke() external;\n}\n" + }, + "contracts/IGraphTokenLockManager.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\nimport \"./IGraphTokenLock.sol\";\n\ninterface IGraphTokenLockManager {\n // -- Factory --\n\n function setMasterCopy(address _masterCopy) external;\n\n function createTokenLockWallet(\n address _owner,\n address _beneficiary,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n IGraphTokenLock.Revocability _revocable\n ) external;\n\n // -- Funds Management --\n\n function token() external returns (IERC20);\n\n function deposit(uint256 _amount) external;\n\n function withdraw(uint256 _amount) external;\n\n // -- Allowed Funds Destinations --\n\n function addTokenDestination(address _dst) external;\n\n function removeTokenDestination(address _dst) external;\n\n function isTokenDestination(address _dst) external view returns (bool);\n\n function getTokenDestinations() external view returns (address[] memory);\n\n // -- Function Call Authorization --\n\n function setAuthFunctionCall(string calldata _signature, address _target) external;\n\n function unsetAuthFunctionCall(string calldata _signature) external;\n\n function setAuthFunctionCallMany(string[] calldata _signatures, address[] calldata _targets) external;\n\n function getAuthFunctionCallTarget(bytes4 _sigHash) external view returns (address);\n\n function isAuthFunctionCall(bytes4 _sigHash) external view returns (bool);\n}\n" + }, + "contracts/L1GraphTokenLockTransferTool.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport { AddressUpgradeable } from \"@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol\";\nimport { ITokenGateway } from \"./arbitrum/ITokenGateway.sol\";\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport { L2GraphTokenLockManager } from \"./L2GraphTokenLockManager.sol\";\nimport { GraphTokenLockWallet } from \"./GraphTokenLockWallet.sol\";\nimport { MinimalProxyFactory } from \"./MinimalProxyFactory.sol\";\nimport { IGraphTokenLock } from \"./IGraphTokenLock.sol\";\nimport { Ownable as OwnableInitializable } from \"./Ownable.sol\";\nimport { SafeMathUpgradeable } from \"@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol\";\nimport { Initializable } from \"@openzeppelin/contracts-upgradeable/proxy/Initializable.sol\";\n\n/**\n * @title L1GraphTokenLockTransferTool contract\n * @notice This contract is used to transfer GRT from GraphTokenLockWallets\n * to a counterpart on L2. It is deployed on L1 and will send the GRT through\n * the L1GraphTokenGateway with a callhook to the L2GraphTokenLockManager, including\n * data to create a L2GraphTokenLockWallet on L2.\n *\n * Note that the L2GraphTokenLockWallet will not allow releasing any GRT until the end of\n * the vesting timeline, but will allow sending the GRT back to the L1 wallet.\n *\n * Beneficiaries for a GraphTokenLockWallet can perform the depositToL2Locked call\n * as many times as they want, and the GRT will be sent to the same L2GraphTokenLockWallet.\n *\n * Since all retryable tickets to send transactions to L2 require ETH for gas, this\n * contract also allows users to deposit ETH to be used for gas on L2, both for\n * the depositToL2Locked calls and for the transfer tools in the Staking contract for\n * The Graph.\n *\n * See GIP-0046 for more details: https://forum.thegraph.com/t/4023\n */\ncontract L1GraphTokenLockTransferTool is OwnableInitializable, Initializable, MinimalProxyFactory {\n using SafeMathUpgradeable for uint256;\n\n /// Address of the L1 GRT token contract\n IERC20 public immutable graphToken;\n /// Address of the L2GraphTokenLockWallet implementation in L2, used to compute L2 wallet addresses\n address public immutable l2Implementation;\n /// Address of the L1GraphTokenGateway contract\n ITokenGateway public immutable l1Gateway;\n /// Address of the Staking contract, used to pull ETH for L2 ticket gas\n address payable public immutable staking;\n /// L2 lock manager for each L1 lock manager.\n /// L1 GraphTokenLockManager => L2GraphTokenLockManager\n mapping(address => address) public l2LockManager;\n /// L2 wallet owner for each L1 wallet owner.\n /// L1 wallet owner => L2 wallet owner\n mapping(address => address) public l2WalletOwner;\n /// L2 wallet address for each L1 wallet address.\n /// L1 wallet => L2 wallet\n mapping(address => address) public l2WalletAddress;\n /// ETH balance from each token lock, used to pay for L2 gas:\n /// L1 wallet address => ETH balance\n mapping(address => uint256) public tokenLockETHBalances;\n /// L2 beneficiary corresponding to each L1 wallet address.\n /// L1 wallet => L2 beneficiary\n mapping(address => address) public l2Beneficiary;\n /// Indicates whether an L2 wallet address for a wallet\n /// has been set manually, in which case it can't call depositToL2Locked.\n /// L1 wallet => bool\n mapping(address => bool) public l2WalletAddressSetManually;\n\n /// @dev Emitted when the L2 lock manager for an L1 lock manager is set\n event L2LockManagerSet(address indexed l1LockManager, address indexed l2LockManager);\n /// @dev Emitted when the L2 wallet owner for an L1 wallet owner is set\n event L2WalletOwnerSet(address indexed l1WalletOwner, address indexed l2WalletOwner);\n /// @dev Emitted when GRT is sent to L2 from a token lock\n event LockedFundsSentToL2(\n address indexed l1Wallet,\n address indexed l2Wallet,\n address indexed l1LockManager,\n address l2LockManager,\n uint256 amount\n );\n /// @dev Emitted when an L2 wallet address is set for an L1 wallet\n event L2WalletAddressSet(address indexed l1Wallet, address indexed l2Wallet);\n /// @dev Emitted when ETH is deposited to a token lock's account\n event ETHDeposited(address indexed tokenLock, uint256 amount);\n /// @dev Emitted when ETH is withdrawn from a token lock's account\n event ETHWithdrawn(address indexed tokenLock, address indexed destination, uint256 amount);\n /// @dev Emitted when ETH is pulled from a token lock's account by Staking or this tool to pay for an L2 ticket\n event ETHPulled(address indexed tokenLock, uint256 amount);\n /// @dev Emitted when the L2 beneficiary for a partially vested L1 lock is set\n event L2BeneficiarySet(address indexed l1Wallet, address indexed l2Beneficiary);\n\n /**\n * @notice Construct a new L1GraphTokenLockTransferTool contract\n * @dev The deployer of the contract will become its owner.\n * Note this contract is meant to be deployed behind a transparent proxy,\n * so this will run at the implementation's storage context; it will set\n * immutable variables and make the implementation be owned by the deployer.\n * @param _graphToken Address of the L1 GRT token contract\n * @param _l2Implementation Address of the L2GraphTokenLockWallet implementation in L2\n * @param _l1Gateway Address of the L1GraphTokenGateway contract\n * @param _staking Address of the Staking contract\n */\n constructor(\n IERC20 _graphToken,\n address _l2Implementation,\n ITokenGateway _l1Gateway,\n address payable _staking\n ) initializer {\n OwnableInitializable._initialize(msg.sender);\n graphToken = _graphToken;\n l2Implementation = _l2Implementation;\n l1Gateway = _l1Gateway;\n staking = _staking;\n }\n\n /**\n * @notice Initialize the L1GraphTokenLockTransferTool contract\n * @dev This function will run in the proxy's storage context, so it will\n * set the owner of the proxy contract which can be different from the implementation owner.\n * @param _owner Address of the owner of the L1GraphTokenLockTransferTool contract\n */\n function initialize(address _owner) external initializer {\n OwnableInitializable._initialize(_owner);\n }\n\n /**\n * @notice Set the L2 lock manager that corresponds to an L1 lock manager\n * @param _l1LockManager Address of the L1 lock manager\n * @param _l2LockManager Address of the L2 lock manager (in L2)\n */\n function setL2LockManager(address _l1LockManager, address _l2LockManager) external onlyOwner {\n l2LockManager[_l1LockManager] = _l2LockManager;\n emit L2LockManagerSet(_l1LockManager, _l2LockManager);\n }\n\n /**\n * @notice Set the L2 wallet owner that corresponds to an L1 wallet owner\n * @param _l1WalletOwner Address of the L1 wallet owner\n * @param _l2WalletOwner Address of the L2 wallet owner (in L2)\n */\n function setL2WalletOwner(address _l1WalletOwner, address _l2WalletOwner) external onlyOwner {\n l2WalletOwner[_l1WalletOwner] = _l2WalletOwner;\n emit L2WalletOwnerSet(_l1WalletOwner, _l2WalletOwner);\n }\n\n /**\n * @notice Deposit ETH on a token lock's account, to be used for L2 retryable ticket gas.\n * This function can be called by anyone, but the ETH will be credited to the token lock.\n * DO NOT try to call this through the token lock, as locks do not forward ETH value (and the\n * function call should not be allowlisted).\n * @param _tokenLock Address of the L1 GraphTokenLockWallet that will own the ETH\n */\n function depositETH(address _tokenLock) external payable {\n tokenLockETHBalances[_tokenLock] = tokenLockETHBalances[_tokenLock].add(msg.value);\n emit ETHDeposited(_tokenLock, msg.value);\n }\n\n /**\n * @notice Withdraw ETH from a token lock's account.\n * This function must be called from the token lock contract, but the destination\n * _must_ be a different address, as any ETH sent to the token lock would otherwise be\n * lost.\n * @param _destination Address to send the ETH\n * @param _amount Amount of ETH to send\n */\n function withdrawETH(address _destination, uint256 _amount) external {\n require(_amount > 0, \"INVALID_AMOUNT\");\n // We can't send eth to a token lock or it will be stuck\n require(msg.sender != _destination, \"INVALID_DESTINATION\");\n require(tokenLockETHBalances[msg.sender] >= _amount, \"INSUFFICIENT_BALANCE\");\n tokenLockETHBalances[msg.sender] -= _amount;\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, ) = payable(_destination).call{ value: _amount }(\"\");\n require(success, \"TRANSFER_FAILED\");\n emit ETHWithdrawn(msg.sender, _destination, _amount);\n }\n\n /**\n * @notice Pull ETH from a token lock's account, to be used for L2 retryable ticket gas.\n * This can only be called by the Staking contract.\n * @param _tokenLock GraphTokenLockWallet that owns the ETH that will be debited\n * @param _amount Amount of ETH to pull\n */\n function pullETH(address _tokenLock, uint256 _amount) external {\n require(msg.sender == staking, \"ONLY_STAKING\");\n require(tokenLockETHBalances[_tokenLock] >= _amount, \"INSUFFICIENT_BALANCE\");\n tokenLockETHBalances[_tokenLock] -= _amount;\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, ) = staking.call{ value: _amount }(\"\");\n require(success, \"TRANSFER_FAILED\");\n emit ETHPulled(_tokenLock, _amount);\n }\n\n /**\n * @notice Deposit GRT to L2, from a token lock in L1 to a token lock in L2.\n * If the token lock in L2 does not exist, it will be created when the message is received\n * by the L2GraphTokenLockManager.\n * Before calling this (which must be done through the token lock wallet), make sure\n * there is enough ETH in the token lock's account to cover the L2 retryable ticket gas.\n * Note that L2 submission fee and gas refunds will be lost.\n * You can add ETH to the token lock's account by calling depositETH().\n * Note that after calling this, you will NOT be able to use setL2WalletAddressManually() to\n * set an L2 wallet address, as the L2 wallet address will be set automatically when the\n * message is received by the L2GraphTokenLockManager.\n * @dev The gas parameters for L2 can be estimated using the Arbitrum SDK.\n * @param _amount Amount of GRT to deposit\n * @param _l2Beneficiary Address of the beneficiary for the token lock in L2. Must be the same for subsequent calls of this function, and not an L1 contract.\n * @param _maxGas Maximum gas to use for the L2 retryable ticket\n * @param _gasPriceBid Gas price to use for the L2 retryable ticket\n * @param _maxSubmissionCost Max submission cost for the L2 retryable ticket\n */\n function depositToL2Locked(\n uint256 _amount,\n address _l2Beneficiary,\n uint256 _maxGas,\n uint256 _gasPriceBid,\n uint256 _maxSubmissionCost\n ) external {\n // Check that msg.sender is a GraphTokenLockWallet\n // That uses GRT and has a corresponding manager set in L2.\n GraphTokenLockWallet wallet = GraphTokenLockWallet(msg.sender);\n require(wallet.token() == graphToken, \"INVALID_TOKEN\");\n address l1Manager = address(wallet.manager());\n address l2Manager = l2LockManager[l1Manager];\n require(l2Manager != address(0), \"INVALID_MANAGER\");\n require(wallet.isInitialized(), \"!INITIALIZED\");\n require(wallet.revocable() != IGraphTokenLock.Revocability.Enabled, \"REVOCABLE\");\n require(_amount <= graphToken.balanceOf(msg.sender), \"INSUFFICIENT_BALANCE\");\n require(_amount != 0, \"ZERO_AMOUNT\");\n\n if (l2Beneficiary[msg.sender] == address(0)) {\n require(_l2Beneficiary != address(0), \"INVALID_BENEFICIARY_ZERO\");\n require(!AddressUpgradeable.isContract(_l2Beneficiary), \"INVALID_BENEFICIARY_CONTRACT\");\n l2Beneficiary[msg.sender] = _l2Beneficiary;\n emit L2BeneficiarySet(msg.sender, _l2Beneficiary);\n } else {\n require(l2Beneficiary[msg.sender] == _l2Beneficiary, \"INVALID_BENEFICIARY\");\n }\n\n uint256 expectedEth = _maxSubmissionCost.add(_maxGas.mul(_gasPriceBid));\n require(tokenLockETHBalances[msg.sender] >= expectedEth, \"INSUFFICIENT_ETH_BALANCE\");\n tokenLockETHBalances[msg.sender] -= expectedEth;\n\n bytes memory encodedData;\n {\n address l2Owner = l2WalletOwner[wallet.owner()];\n require(l2Owner != address(0), \"L2_OWNER_NOT_SET\");\n // Extract all the storage variables from the GraphTokenLockWallet\n L2GraphTokenLockManager.TransferredWalletData memory data = L2GraphTokenLockManager.TransferredWalletData({\n l1Address: msg.sender,\n owner: l2Owner,\n beneficiary: l2Beneficiary[msg.sender],\n managedAmount: wallet.managedAmount(),\n startTime: wallet.startTime(),\n endTime: wallet.endTime()\n });\n encodedData = abi.encode(data);\n }\n\n if (l2WalletAddress[msg.sender] == address(0)) {\n require(wallet.endTime() >= block.timestamp, \"FULLY_VESTED_USE_MANUAL_ADDRESS\");\n address newAddress = getDeploymentAddress(keccak256(encodedData), l2Implementation, l2Manager);\n l2WalletAddress[msg.sender] = newAddress;\n emit L2WalletAddressSet(msg.sender, newAddress);\n } else {\n require(!l2WalletAddressSetManually[msg.sender], \"CANT_DEPOSIT_TO_MANUAL_ADDRESS\");\n }\n\n graphToken.transferFrom(msg.sender, address(this), _amount);\n\n // Send the tokens with a message through the L1GraphTokenGateway to the L2GraphTokenLockManager\n graphToken.approve(address(l1Gateway), _amount);\n {\n bytes memory transferData = abi.encode(_maxSubmissionCost, encodedData);\n l1Gateway.outboundTransfer{ value: expectedEth }(\n address(graphToken),\n l2Manager,\n _amount,\n _maxGas,\n _gasPriceBid,\n transferData\n );\n }\n emit ETHPulled(msg.sender, expectedEth);\n emit LockedFundsSentToL2(msg.sender, l2WalletAddress[msg.sender], l1Manager, l2Manager, _amount);\n }\n\n /**\n * @notice Manually set the L2 wallet address for a token lock in L1.\n * This will only work for token locks that have not been initialized in L2 yet, and\n * that are fully vested (endTime < current timestamp).\n * This address can then be used to send stake or delegation to L2 on the Staking contract.\n * After calling this, the vesting lock will NOT be allowed to use depositToL2Locked\n * to send GRT to L2, the beneficiary must withdraw the tokens and bridge them manually.\n * @param _l2Wallet Address of the L2 wallet\n */\n function setL2WalletAddressManually(address _l2Wallet) external {\n // Check that msg.sender is a GraphTokenLockWallet\n // That uses GRT and has a corresponding manager set in L2.\n GraphTokenLockWallet wallet = GraphTokenLockWallet(msg.sender);\n require(wallet.token() == graphToken, \"INVALID_TOKEN\");\n address l1Manager = address(wallet.manager());\n address l2Manager = l2LockManager[l1Manager];\n require(l2Manager != address(0), \"INVALID_MANAGER\");\n require(wallet.isInitialized(), \"!INITIALIZED\");\n\n // Check that the wallet is fully vested\n require(wallet.endTime() < block.timestamp, \"NOT_FULLY_VESTED\");\n\n // Check that the wallet has not set an L2 wallet yet\n require(l2WalletAddress[msg.sender] == address(0), \"L2_WALLET_ALREADY_SET\");\n\n // Check that the L2 address is not zero\n require(_l2Wallet != address(0), \"ZERO_ADDRESS\");\n // Set the L2 wallet address\n l2WalletAddress[msg.sender] = _l2Wallet;\n l2WalletAddressSetManually[msg.sender] = true;\n emit L2WalletAddressSet(msg.sender, _l2Wallet);\n }\n}\n" + }, + "contracts/L2GraphTokenLockManager.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport { SafeERC20 } from \"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\";\n\nimport { ICallhookReceiver } from \"./ICallhookReceiver.sol\";\nimport { GraphTokenLockManager } from \"./GraphTokenLockManager.sol\";\nimport { L2GraphTokenLockWallet } from \"./L2GraphTokenLockWallet.sol\";\n\n/**\n * @title L2GraphTokenLockManager\n * @notice This contract manages a list of authorized function calls and targets that can be called\n * by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts.\n *\n * This contract receives funds to make the process of creating TokenLockWallet contracts\n * easier by distributing them the initial tokens to be managed.\n *\n * In particular, this L2 variant is designed to receive token lock wallets from L1,\n * through the GRT bridge. These transferred wallets will not allow releasing funds in L2 until\n * the end of the vesting timeline, but they can allow withdrawing funds back to L1 using\n * the L2GraphTokenLockTransferTool contract.\n *\n * The owner can setup a list of token destinations that will be used by TokenLock contracts to\n * approve the pulling of funds, this way in can be guaranteed that only protocol contracts\n * will manipulate users funds.\n */\ncontract L2GraphTokenLockManager is GraphTokenLockManager, ICallhookReceiver {\n using SafeERC20 for IERC20;\n\n /// @dev Struct to hold the data of a transferred wallet; this is\n /// the data that must be encoded in L1 to send a wallet to L2.\n struct TransferredWalletData {\n address l1Address;\n address owner;\n address beneficiary;\n uint256 managedAmount;\n uint256 startTime;\n uint256 endTime;\n }\n\n /// Address of the L2GraphTokenGateway\n address public immutable l2Gateway;\n /// Address of the L1 transfer tool contract (in L1, no aliasing)\n address public immutable l1TransferTool;\n /// Mapping of each L1 wallet to its L2 wallet counterpart (populated when each wallet is received)\n /// L1 address => L2 address\n mapping(address => address) public l1WalletToL2Wallet;\n /// Mapping of each L2 wallet to its L1 wallet counterpart (populated when each wallet is received)\n /// L2 address => L1 address\n mapping(address => address) public l2WalletToL1Wallet;\n\n /// @dev Event emitted when a wallet is received and created from L1\n event TokenLockCreatedFromL1(\n address indexed contractAddress,\n bytes32 initHash,\n address indexed beneficiary,\n uint256 managedAmount,\n uint256 startTime,\n uint256 endTime,\n address indexed l1Address\n );\n\n /// @dev Emitted when locked tokens are received from L1 (whether the wallet\n /// had already been received or not)\n event LockedTokensReceivedFromL1(address indexed l1Address, address indexed l2Address, uint256 amount);\n\n /**\n * @dev Checks that the sender is the L2GraphTokenGateway.\n */\n modifier onlyL2Gateway() {\n require(msg.sender == l2Gateway, \"ONLY_GATEWAY\");\n _;\n }\n\n /**\n * @notice Constructor for the L2GraphTokenLockManager contract.\n * @param _graphToken Address of the L2 GRT token contract\n * @param _masterCopy Address of the master copy of the L2GraphTokenLockWallet implementation\n * @param _l2Gateway Address of the L2GraphTokenGateway contract\n * @param _l1TransferTool Address of the L1 transfer tool contract (in L1, without aliasing)\n */\n constructor(\n IERC20 _graphToken,\n address _masterCopy,\n address _l2Gateway,\n address _l1TransferTool\n ) GraphTokenLockManager(_graphToken, _masterCopy) {\n l2Gateway = _l2Gateway;\n l1TransferTool = _l1TransferTool;\n }\n\n /**\n * @notice This function is called by the L2GraphTokenGateway when tokens are sent from L1.\n * @dev This function will create a new wallet if it doesn't exist yet, or send the tokens to\n * the existing wallet if it does.\n * @param _from Address of the sender in L1, which must be the L1GraphTokenLockTransferTool\n * @param _amount Amount of tokens received\n * @param _data Encoded data of the transferred wallet, which must be an ABI-encoded TransferredWalletData struct\n */\n function onTokenTransfer(address _from, uint256 _amount, bytes calldata _data) external override onlyL2Gateway {\n require(_from == l1TransferTool, \"ONLY_TRANSFER_TOOL\");\n TransferredWalletData memory walletData = abi.decode(_data, (TransferredWalletData));\n\n if (l1WalletToL2Wallet[walletData.l1Address] != address(0)) {\n // If the wallet was already received, just send the tokens to the L2 address\n _token.safeTransfer(l1WalletToL2Wallet[walletData.l1Address], _amount);\n } else {\n // Create contract using a minimal proxy and call initializer\n (bytes32 initHash, address contractAddress) = _deployFromL1(keccak256(_data), walletData);\n l1WalletToL2Wallet[walletData.l1Address] = contractAddress;\n l2WalletToL1Wallet[contractAddress] = walletData.l1Address;\n\n // Send managed amount to the created contract\n _token.safeTransfer(contractAddress, _amount);\n\n emit TokenLockCreatedFromL1(\n contractAddress,\n initHash,\n walletData.beneficiary,\n walletData.managedAmount,\n walletData.startTime,\n walletData.endTime,\n walletData.l1Address\n );\n }\n emit LockedTokensReceivedFromL1(walletData.l1Address, l1WalletToL2Wallet[walletData.l1Address], _amount);\n }\n\n /**\n * @dev Deploy a token lock wallet with data received from L1\n * @param _salt Salt for the CREATE2 call, which must be the hash of the wallet data\n * @param _walletData Data of the wallet to be created\n * @return Hash of the initialization calldata\n * @return Address of the created contract\n */\n function _deployFromL1(bytes32 _salt, TransferredWalletData memory _walletData) internal returns (bytes32, address) {\n bytes memory initializer = _encodeInitializer(_walletData);\n address contractAddress = _deployProxy2(_salt, masterCopy, initializer);\n return (keccak256(initializer), contractAddress);\n }\n\n /**\n * @dev Encode the initializer for the token lock wallet received from L1\n * @param _walletData Data of the wallet to be created\n * @return Encoded initializer calldata, including the function signature\n */\n function _encodeInitializer(TransferredWalletData memory _walletData) internal view returns (bytes memory) {\n return\n abi.encodeWithSelector(\n L2GraphTokenLockWallet.initializeFromL1.selector,\n address(this),\n address(_token),\n _walletData\n );\n }\n}\n" + }, + "contracts/L2GraphTokenLockTransferTool.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\nimport { L2GraphTokenLockManager } from \"./L2GraphTokenLockManager.sol\";\nimport { L2GraphTokenLockWallet } from \"./L2GraphTokenLockWallet.sol\";\nimport { ITokenGateway } from \"./arbitrum/ITokenGateway.sol\";\n\n/**\n * @title L2GraphTokenLockTransferTool contract\n * @notice This contract is used to transfer GRT from L2 token lock wallets\n * back to their L1 counterparts.\n */\ncontract L2GraphTokenLockTransferTool {\n /// Address of the L2 GRT token\n IERC20 public immutable graphToken;\n /// Address of the L2GraphTokenGateway\n ITokenGateway public immutable l2Gateway;\n /// Address of the L1 GRT token (in L1, no aliasing)\n address public immutable l1GraphToken;\n\n /// @dev Emitted when GRT is sent to L1 from a token lock\n event LockedFundsSentToL1(\n address indexed l1Wallet,\n address indexed l2Wallet,\n address indexed l2LockManager,\n uint256 amount\n );\n\n /**\n * @notice Constructor for the L2GraphTokenLockTransferTool contract\n * @dev Note the L2GraphTokenLockTransferTool can be deployed behind a proxy,\n * and the constructor for the implementation will only set some immutable\n * variables.\n * @param _graphToken Address of the L2 GRT token\n * @param _l2Gateway Address of the L2GraphTokenGateway\n * @param _l1GraphToken Address of the L1 GRT token (in L1, no aliasing)\n */\n constructor(IERC20 _graphToken, ITokenGateway _l2Gateway, address _l1GraphToken) {\n graphToken = _graphToken;\n l2Gateway = _l2Gateway;\n l1GraphToken = _l1GraphToken;\n }\n\n /**\n * @notice Withdraw GRT from an L2 token lock wallet to its L1 counterpart.\n * This function must be called from an L2GraphTokenLockWallet contract.\n * The GRT will be sent to L1 and must be claimed using the Arbitrum Outbox on L1\n * after the standard Arbitrum withdrawal period (7 days).\n * @param _amount Amount of GRT to withdraw\n */\n function withdrawToL1Locked(uint256 _amount) external {\n L2GraphTokenLockWallet wallet = L2GraphTokenLockWallet(msg.sender);\n L2GraphTokenLockManager manager = L2GraphTokenLockManager(address(wallet.manager()));\n require(address(manager) != address(0), \"INVALID_SENDER\");\n address l1Wallet = manager.l2WalletToL1Wallet(msg.sender);\n require(l1Wallet != address(0), \"NOT_L1_WALLET\");\n require(_amount <= graphToken.balanceOf(msg.sender), \"INSUFFICIENT_BALANCE\");\n require(_amount != 0, \"ZERO_AMOUNT\");\n\n graphToken.transferFrom(msg.sender, address(this), _amount);\n graphToken.approve(address(l2Gateway), _amount);\n\n // Send the tokens through the L2GraphTokenGateway to the L1 wallet counterpart\n l2Gateway.outboundTransfer(l1GraphToken, l1Wallet, _amount, 0, 0, \"\");\n emit LockedFundsSentToL1(l1Wallet, msg.sender, address(manager), _amount);\n }\n}\n" + }, + "contracts/L2GraphTokenLockWallet.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\nimport { GraphTokenLockWallet } from \"./GraphTokenLockWallet.sol\";\nimport { Ownable as OwnableInitializable } from \"./Ownable.sol\";\nimport { L2GraphTokenLockManager } from \"./L2GraphTokenLockManager.sol\";\n\n/**\n * @title L2GraphTokenLockWallet\n * @notice This contract is built on top of the base GraphTokenLock functionality.\n * It allows wallet beneficiaries to use the deposited funds to perform specific function calls\n * on specific contracts.\n *\n * The idea is that supporters with locked tokens can participate in the protocol\n * but disallow any release before the vesting/lock schedule.\n * The beneficiary can issue authorized function calls to this contract that will\n * get forwarded to a target contract. A target contract is any of our protocol contracts.\n * The function calls allowed are queried to the GraphTokenLockManager, this way\n * the same configuration can be shared for all the created lock wallet contracts.\n *\n * This L2 variant includes a special initializer so that it can be created from\n * a wallet's data received from L1. These transferred wallets will not allow releasing\n * funds in L2 until the end of the vesting timeline, but they can allow withdrawing\n * funds back to L1 using the L2GraphTokenLockTransferTool contract.\n *\n * Note that surplusAmount and releasedAmount in L2 will be skewed for wallets received from L1,\n * so releasing surplus tokens might also only be possible by bridging tokens back to L1.\n *\n * NOTE: Contracts used as target must have its function signatures checked to avoid collisions\n * with any of this contract functions.\n * Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience\n * the maximum amount of tokens is authorized.\n * Function calls do not forward ETH value so DO NOT SEND ETH TO THIS CONTRACT.\n */\ncontract L2GraphTokenLockWallet is GraphTokenLockWallet {\n // Initializer when created from a message from L1\n function initializeFromL1(\n address _manager,\n address _token,\n L2GraphTokenLockManager.TransferredWalletData calldata _walletData\n ) external {\n require(!isInitialized, \"Already initialized\");\n isInitialized = true;\n\n OwnableInitializable._initialize(_walletData.owner);\n beneficiary = _walletData.beneficiary;\n token = IERC20(_token);\n\n managedAmount = _walletData.managedAmount;\n\n startTime = _walletData.startTime;\n endTime = _walletData.endTime;\n periods = 1;\n isAccepted = true;\n\n // Optionals\n releaseStartTime = _walletData.endTime;\n revocable = Revocability.Disabled;\n\n _setManager(_manager);\n }\n}\n" + }, + "contracts/MathUtils.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nlibrary MathUtils {\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n}\n" + }, + "contracts/MinimalProxyFactory.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport { Address } from \"@openzeppelin/contracts/utils/Address.sol\";\nimport { Create2 } from \"@openzeppelin/contracts/utils/Create2.sol\";\n\n/**\n * @title MinimalProxyFactory: a factory contract for creating minimal proxies\n * @notice Adapted from https://github.com/OpenZeppelin/openzeppelin-sdk/blob/v2.5.0/packages/lib/contracts/upgradeability/ProxyFactory.sol\n * Based on https://eips.ethereum.org/EIPS/eip-1167\n */\ncontract MinimalProxyFactory {\n /// @dev Emitted when a new proxy is created\n event ProxyCreated(address indexed proxy);\n\n /**\n * @notice Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation\n * @param _salt Bytes32 salt to use for CREATE2\n * @param _implementation Address of the proxy target implementation\n * @param _deployer Address of the deployer that creates the contract\n * @return Address of the counterfactual MinimalProxy\n */\n function getDeploymentAddress(\n bytes32 _salt,\n address _implementation,\n address _deployer\n ) public pure returns (address) {\n return Create2.computeAddress(_salt, keccak256(_getContractCreationCode(_implementation)), _deployer);\n }\n\n /**\n * @dev Deploys a MinimalProxy with CREATE2\n * @param _salt Bytes32 salt to use for CREATE2\n * @param _implementation Address of the proxy target implementation\n * @param _data Bytes with the initializer call\n * @return Address of the deployed MinimalProxy\n */\n function _deployProxy2(bytes32 _salt, address _implementation, bytes memory _data) internal returns (address) {\n address proxyAddress = Create2.deploy(0, _salt, _getContractCreationCode(_implementation));\n\n emit ProxyCreated(proxyAddress);\n\n // Call function with data\n if (_data.length > 0) {\n Address.functionCall(proxyAddress, _data);\n }\n\n return proxyAddress;\n }\n\n /**\n * @dev Gets the MinimalProxy bytecode\n * @param _implementation Address of the proxy target implementation\n * @return MinimalProxy bytecode\n */\n function _getContractCreationCode(address _implementation) internal pure returns (bytes memory) {\n bytes10 creation = 0x3d602d80600a3d3981f3;\n bytes10 prefix = 0x363d3d373d3d3d363d73;\n bytes20 targetBytes = bytes20(_implementation);\n bytes15 suffix = 0x5af43d82803e903d91602b57fd5bf3;\n return abi.encodePacked(creation, prefix, targetBytes, suffix);\n }\n}\n" + }, + "contracts/Ownable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * The owner account will be passed on initialization of the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\ncontract Ownable {\n /// @dev Owner of the contract, can be retrieved with the public owner() function\n address private _owner;\n /// @dev Since upgradeable contracts might inherit this, we add a storage gap\n /// to allow adding variables here without breaking the proxy storage layout\n uint256[50] private __gap;\n\n /// @dev Emitted when ownership of the contract is transferred\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n function _initialize(address owner) internal {\n _owner = owner;\n emit OwnershipTransferred(address(0), owner);\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(_owner == msg.sender, \"Ownable: caller is not the owner\");\n _;\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() external virtual onlyOwner {\n emit OwnershipTransferred(_owner, address(0));\n _owner = address(0);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) external virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n emit OwnershipTransferred(_owner, newOwner);\n _owner = newOwner;\n }\n}\n" + }, + "contracts/tests/arbitrum/AddressAliasHelper.sol": { + "content": "// SPDX-License-Identifier: Apache-2.0\n\n/*\n * Copyright 2019-2021, Offchain Labs, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * Originally copied from:\n * https://github.com/OffchainLabs/arbitrum/tree/84e64dee6ee82adbf8ec34fd4b86c207a61d9007/packages/arb-bridge-eth\n *\n * MODIFIED from Offchain Labs' implementation:\n * - Changed solidity version to 0.7.3 (pablo@edgeandnode.com)\n *\n */\n\npragma solidity ^0.7.3;\n\nlibrary AddressAliasHelper {\n uint160 constant offset = uint160(0x1111000000000000000000000000000000001111);\n\n /// @notice Utility function that converts the address in the L1 that submitted a tx to\n /// the inbox to the msg.sender viewed in the L2\n /// @param l1Address the address in the L1 that triggered the tx to L2\n /// @return l2Address L2 address as viewed in msg.sender\n function applyL1ToL2Alias(address l1Address) internal pure returns (address l2Address) {\n l2Address = address(uint160(l1Address) + offset);\n }\n\n /// @notice Utility function that converts the msg.sender viewed in the L2 to the\n /// address in the L1 that submitted a tx to the inbox\n /// @param l2Address L2 address as viewed in msg.sender\n /// @return l1Address the address in the L1 that triggered the tx to L2\n function undoL1ToL2Alias(address l2Address) internal pure returns (address l1Address) {\n l1Address = address(uint160(l2Address) - offset);\n }\n}\n" + }, + "contracts/tests/arbitrum/IBridge.sol": { + "content": "// SPDX-License-Identifier: Apache-2.0\n\n/*\n * Copyright 2021, Offchain Labs, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * Originally copied from:\n * https://github.com/OffchainLabs/arbitrum/tree/e3a6307ad8a2dc2cad35728a2a9908cfd8dd8ef9/packages/arb-bridge-eth\n *\n * MODIFIED from Offchain Labs' implementation:\n * - Changed solidity version to 0.7.3 (pablo@edgeandnode.com)\n *\n */\n\npragma solidity ^0.7.3;\n\ninterface IBridge {\n event MessageDelivered(\n uint256 indexed messageIndex,\n bytes32 indexed beforeInboxAcc,\n address inbox,\n uint8 kind,\n address sender,\n bytes32 messageDataHash\n );\n\n event BridgeCallTriggered(address indexed outbox, address indexed destAddr, uint256 amount, bytes data);\n\n event InboxToggle(address indexed inbox, bool enabled);\n\n event OutboxToggle(address indexed outbox, bool enabled);\n\n function deliverMessageToInbox(\n uint8 kind,\n address sender,\n bytes32 messageDataHash\n ) external payable returns (uint256);\n\n function executeCall(\n address destAddr,\n uint256 amount,\n bytes calldata data\n ) external returns (bool success, bytes memory returnData);\n\n // These are only callable by the admin\n function setInbox(address inbox, bool enabled) external;\n\n function setOutbox(address inbox, bool enabled) external;\n\n // View functions\n\n function activeOutbox() external view returns (address);\n\n function allowedInboxes(address inbox) external view returns (bool);\n\n function allowedOutboxes(address outbox) external view returns (bool);\n\n function inboxAccs(uint256 index) external view returns (bytes32);\n\n function messageCount() external view returns (uint256);\n}\n" + }, + "contracts/tests/arbitrum/IInbox.sol": { + "content": "// SPDX-License-Identifier: Apache-2.0\n\n/*\n * Copyright 2021, Offchain Labs, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * Originally copied from:\n * https://github.com/OffchainLabs/arbitrum/tree/e3a6307ad8a2dc2cad35728a2a9908cfd8dd8ef9/packages/arb-bridge-eth\n *\n * MODIFIED from Offchain Labs' implementation:\n * - Changed solidity version to 0.7.3 (pablo@edgeandnode.com)\n *\n */\n\npragma solidity ^0.7.3;\n\nimport \"./IBridge.sol\";\nimport \"./IMessageProvider.sol\";\n\ninterface IInbox is IMessageProvider {\n function sendL2Message(bytes calldata messageData) external returns (uint256);\n\n function sendUnsignedTransaction(\n uint256 maxGas,\n uint256 gasPriceBid,\n uint256 nonce,\n address destAddr,\n uint256 amount,\n bytes calldata data\n ) external returns (uint256);\n\n function sendContractTransaction(\n uint256 maxGas,\n uint256 gasPriceBid,\n address destAddr,\n uint256 amount,\n bytes calldata data\n ) external returns (uint256);\n\n function sendL1FundedUnsignedTransaction(\n uint256 maxGas,\n uint256 gasPriceBid,\n uint256 nonce,\n address destAddr,\n bytes calldata data\n ) external payable returns (uint256);\n\n function sendL1FundedContractTransaction(\n uint256 maxGas,\n uint256 gasPriceBid,\n address destAddr,\n bytes calldata data\n ) external payable returns (uint256);\n\n function createRetryableTicket(\n address destAddr,\n uint256 arbTxCallValue,\n uint256 maxSubmissionCost,\n address submissionRefundAddress,\n address valueRefundAddress,\n uint256 maxGas,\n uint256 gasPriceBid,\n bytes calldata data\n ) external payable returns (uint256);\n\n function depositEth(uint256 maxSubmissionCost) external payable returns (uint256);\n\n function bridge() external view returns (IBridge);\n\n function pauseCreateRetryables() external;\n\n function unpauseCreateRetryables() external;\n\n function startRewriteAddress() external;\n\n function stopRewriteAddress() external;\n}\n" + }, + "contracts/tests/arbitrum/IMessageProvider.sol": { + "content": "// SPDX-License-Identifier: Apache-2.0\n\n/*\n * Copyright 2021, Offchain Labs, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * Originally copied from:\n * https://github.com/OffchainLabs/arbitrum/tree/e3a6307ad8a2dc2cad35728a2a9908cfd8dd8ef9/packages/arb-bridge-eth\n *\n * MODIFIED from Offchain Labs' implementation:\n * - Changed solidity version to 0.7.3 (pablo@edgeandnode.com)\n *\n */\n\npragma solidity ^0.7.3;\n\ninterface IMessageProvider {\n event InboxMessageDelivered(uint256 indexed messageNum, bytes data);\n\n event InboxMessageDeliveredFromOrigin(uint256 indexed messageNum);\n}\n" + }, + "contracts/tests/BridgeMock.sol": { + "content": "// SPDX-License-Identifier: GPL-2.0-or-later\n\npragma solidity ^0.7.3;\n\nimport \"./arbitrum/IBridge.sol\";\n\n/**\n * @title Arbitrum Bridge mock contract\n * @dev This contract implements Arbitrum's IBridge interface for testing purposes\n */\ncontract BridgeMock is IBridge {\n /// Address of the (mock) Arbitrum Inbox\n address public inbox;\n /// Address of the (mock) Arbitrum Outbox\n address public outbox;\n /// Index of the next message on the inbox messages array\n uint256 public messageIndex;\n /// Inbox messages array\n bytes32[] public override inboxAccs;\n\n /**\n * @notice Deliver a message to the inbox. The encoded message will be\n * added to the inbox array, and messageIndex will be incremented.\n * @param _kind Type of the message\n * @param _sender Address that is sending the message\n * @param _messageDataHash keccak256 hash of the message data\n * @return The next index for the inbox array\n */\n function deliverMessageToInbox(\n uint8 _kind,\n address _sender,\n bytes32 _messageDataHash\n ) external payable override returns (uint256) {\n messageIndex = messageIndex + 1;\n inboxAccs.push(keccak256(abi.encodePacked(inbox, _kind, _sender, _messageDataHash)));\n emit MessageDelivered(messageIndex, inboxAccs[messageIndex - 1], msg.sender, _kind, _sender, _messageDataHash);\n return messageIndex;\n }\n\n /**\n * @notice Executes an L1 function call incoing from L2. This can only be called\n * by the Outbox.\n * @param _destAddr Contract to call\n * @param _amount ETH value to send\n * @param _data Calldata for the function call\n * @return True if the call was successful, false otherwise\n * @return Return data from the call\n */\n function executeCall(\n address _destAddr,\n uint256 _amount,\n bytes calldata _data\n ) external override returns (bool, bytes memory) {\n require(outbox == msg.sender, \"NOT_FROM_OUTBOX\");\n bool success;\n bytes memory returnData;\n\n // solhint-disable-next-line avoid-low-level-calls\n (success, returnData) = _destAddr.call{ value: _amount }(_data);\n emit BridgeCallTriggered(msg.sender, _destAddr, _amount, _data);\n return (success, returnData);\n }\n\n /**\n * @notice Set the address of the inbox. Anyone can call this, because it's a mock.\n * @param _inbox Address of the inbox\n * @param _enabled Enable the inbox (ignored)\n */\n function setInbox(address _inbox, bool _enabled) external override {\n inbox = _inbox;\n emit InboxToggle(inbox, _enabled);\n }\n\n /**\n * @notice Set the address of the outbox. Anyone can call this, because it's a mock.\n * @param _outbox Address of the outbox\n * @param _enabled Enable the outbox (ignored)\n */\n function setOutbox(address _outbox, bool _enabled) external override {\n outbox = _outbox;\n emit OutboxToggle(outbox, _enabled);\n }\n\n // View functions\n\n /**\n * @notice Getter for the active outbox (in this case there's only one)\n */\n function activeOutbox() external view override returns (address) {\n return outbox;\n }\n\n /**\n * @notice Getter for whether an address is an allowed inbox (in this case there's only one)\n * @param _inbox Address to check\n * @return True if the address is the allowed inbox, false otherwise\n */\n function allowedInboxes(address _inbox) external view override returns (bool) {\n return _inbox == inbox;\n }\n\n /**\n * @notice Getter for whether an address is an allowed outbox (in this case there's only one)\n * @param _outbox Address to check\n * @return True if the address is the allowed outbox, false otherwise\n */\n function allowedOutboxes(address _outbox) external view override returns (bool) {\n return _outbox == outbox;\n }\n\n /**\n * @notice Getter for the count of messages in the inboxAccs\n * @return Number of messages in inboxAccs\n */\n function messageCount() external view override returns (uint256) {\n return inboxAccs.length;\n }\n}\n" + }, + "contracts/tests/GraphTokenMock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\n\n/**\n * @title Graph Token Mock contract.\n * @dev Used for testing purposes, DO NOT USE IN PRODUCTION\n */\ncontract GraphTokenMock is Ownable, ERC20 {\n /**\n * @notice Contract Constructor.\n * @param _initialSupply Initial supply\n * @param _mintTo Address to whitch to mint the initial supply\n */\n constructor(uint256 _initialSupply, address _mintTo) ERC20(\"Graph Token Mock\", \"GRT-Mock\") {\n // Deploy to mint address\n _mint(_mintTo, _initialSupply);\n }\n\n /**\n * @notice Mint tokens to an address from the bridge.\n * (The real one has an onlyGateway modifier)\n * @param _to Address to mint tokens to\n * @param _amount Amount of tokens to mint\n */\n function bridgeMint(address _to, uint256 _amount) external {\n _mint(_to, _amount);\n }\n\n /**\n * @notice Burn tokens from an address from the bridge.\n * (The real one has an onlyGateway modifier)\n * @param _from Address to burn tokens from\n * @param _amount Amount of tokens to burn\n */\n function bridgeBurn(address _from, uint256 _amount) external {\n _burn(_from, _amount);\n }\n}\n" + }, + "contracts/tests/InboxMock.sol": { + "content": "// SPDX-License-Identifier: GPL-2.0-or-later\n\npragma solidity ^0.7.3;\n\nimport \"./arbitrum/IInbox.sol\";\nimport \"./arbitrum/AddressAliasHelper.sol\";\n\n/**\n * @title Arbitrum Inbox mock contract\n * @dev This contract implements (a subset of) Arbitrum's IInbox interface for testing purposes\n */\ncontract InboxMock is IInbox {\n /// @dev Type indicator for a standard L2 message\n uint8 internal constant L2_MSG = 3;\n /// @dev Type indicator for a retryable ticket message\n // solhint-disable-next-line const-name-snakecase\n uint8 internal constant L1MessageType_submitRetryableTx = 9;\n /// Address of the Bridge (mock) contract\n IBridge public override bridge;\n\n /**\n * @notice Send a message to L2 (by delivering it to the Bridge)\n * @param _messageData Encoded data to send in the message\n * @return Message number returned by the inbox\n */\n function sendL2Message(bytes calldata _messageData) external override returns (uint256) {\n uint256 msgNum = deliverToBridge(L2_MSG, msg.sender, keccak256(_messageData));\n emit InboxMessageDelivered(msgNum, _messageData);\n return msgNum;\n }\n\n /**\n * @notice Set the address of the (mock) bridge\n * @param _bridge Address of the bridge\n */\n function setBridge(address _bridge) external {\n bridge = IBridge(_bridge);\n }\n\n /**\n * @notice Unimplemented in this mock\n */\n function sendUnsignedTransaction(\n uint256,\n uint256,\n uint256,\n address,\n uint256,\n bytes calldata\n ) external pure override returns (uint256) {\n revert(\"Unimplemented\");\n }\n\n /**\n * @notice Unimplemented in this mock\n */\n function sendContractTransaction(\n uint256,\n uint256,\n address,\n uint256,\n bytes calldata\n ) external pure override returns (uint256) {\n revert(\"Unimplemented\");\n }\n\n /**\n * @notice Unimplemented in this mock\n */\n function sendL1FundedUnsignedTransaction(\n uint256,\n uint256,\n uint256,\n address,\n bytes calldata\n ) external payable override returns (uint256) {\n revert(\"Unimplemented\");\n }\n\n /**\n * @notice Unimplemented in this mock\n */\n function sendL1FundedContractTransaction(\n uint256,\n uint256,\n address,\n bytes calldata\n ) external payable override returns (uint256) {\n revert(\"Unimplemented\");\n }\n\n /**\n * @notice Creates a retryable ticket for an L2 transaction\n * @param _destAddr Address of the contract to call in L2\n * @param _arbTxCallValue Callvalue to use in the L2 transaction\n * @param _maxSubmissionCost Max cost of submitting the ticket, in Wei\n * @param _submissionRefundAddress L2 address to refund for any remaining value from the submission cost\n * @param _valueRefundAddress L2 address to refund if the ticket times out or gets cancelled\n * @param _maxGas Max gas for the L2 transcation\n * @param _gasPriceBid Gas price bid on L2\n * @param _data Encoded calldata for the L2 transaction (including function selector)\n * @return Message number returned by the bridge\n */\n function createRetryableTicket(\n address _destAddr,\n uint256 _arbTxCallValue,\n uint256 _maxSubmissionCost,\n address _submissionRefundAddress,\n address _valueRefundAddress,\n uint256 _maxGas,\n uint256 _gasPriceBid,\n bytes calldata _data\n ) external payable override returns (uint256) {\n _submissionRefundAddress = AddressAliasHelper.applyL1ToL2Alias(_submissionRefundAddress);\n _valueRefundAddress = AddressAliasHelper.applyL1ToL2Alias(_valueRefundAddress);\n return\n _deliverMessage(\n L1MessageType_submitRetryableTx,\n msg.sender,\n abi.encodePacked(\n uint256(uint160(bytes20(_destAddr))),\n _arbTxCallValue,\n msg.value,\n _maxSubmissionCost,\n uint256(uint160(bytes20(_submissionRefundAddress))),\n uint256(uint160(bytes20(_valueRefundAddress))),\n _maxGas,\n _gasPriceBid,\n _data.length,\n _data\n )\n );\n }\n\n /**\n * @notice Unimplemented in this mock\n */\n function depositEth(uint256) external payable override returns (uint256) {\n revert(\"Unimplemented\");\n }\n\n /**\n * @notice Unimplemented in this mock\n */\n function pauseCreateRetryables() external pure override {\n revert(\"Unimplemented\");\n }\n\n /**\n * @notice Unimplemented in this mock\n */\n function unpauseCreateRetryables() external pure override {\n revert(\"Unimplemented\");\n }\n\n /**\n * @notice Unimplemented in this mock\n */\n function startRewriteAddress() external pure override {\n revert(\"Unimplemented\");\n }\n\n /**\n * @notice Unimplemented in this mock\n */\n function stopRewriteAddress() external pure override {\n revert(\"Unimplemented\");\n }\n\n /**\n * @dev Deliver a message to the bridge\n * @param _kind Type of the message\n * @param _sender Address that is sending the message\n * @param _messageData Encoded message data\n * @return Message number returned by the bridge\n */\n function _deliverMessage(uint8 _kind, address _sender, bytes memory _messageData) internal returns (uint256) {\n uint256 msgNum = deliverToBridge(_kind, _sender, keccak256(_messageData));\n emit InboxMessageDelivered(msgNum, _messageData);\n return msgNum;\n }\n\n /**\n * @dev Deliver a message to the bridge\n * @param _kind Type of the message\n * @param _sender Address that is sending the message\n * @param _messageDataHash keccak256 hash of the encoded message data\n * @return Message number returned by the bridge\n */\n function deliverToBridge(uint8 _kind, address _sender, bytes32 _messageDataHash) internal returns (uint256) {\n return bridge.deliverMessageToInbox{ value: msg.value }(_kind, _sender, _messageDataHash);\n }\n}\n" + }, + "contracts/tests/L1TokenGatewayMock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport { Ownable } from \"@openzeppelin/contracts/access/Ownable.sol\";\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport { SafeMath } from \"@openzeppelin/contracts/math/SafeMath.sol\";\nimport { ITokenGateway } from \"../arbitrum//ITokenGateway.sol\";\n\n/**\n * @title L1 Token Gateway mock contract\n * @dev Used for testing purposes, DO NOT USE IN PRODUCTION\n */\ncontract L1TokenGatewayMock is Ownable {\n using SafeMath for uint256;\n /// Next sequence number to return when outboundTransfer is called\n uint256 public nextSeqNum;\n\n /// @dev Emitted when a (fake) retryable ticket is created\n event FakeTxToL2(\n address from,\n uint256 value,\n uint256 maxGas,\n uint256 gasPriceBid,\n uint256 maxSubmissionCost,\n bytes outboundCalldata\n );\n\n /// @dev Emitted when an outbound transfer is initiated, i.e. tokens are deposited from L1 to L2\n event DepositInitiated(\n address l1Token,\n address indexed from,\n address indexed to,\n uint256 indexed sequenceNumber,\n uint256 amount\n );\n\n /**\n * @notice L1 Token Gateway Contract Constructor.\n */\n constructor() {}\n\n /**\n * @notice Creates and sends a fake retryable ticket to transfer GRT to L2.\n * This mock will actually just emit an event with parameters equivalent to what the real L1GraphTokenGateway\n * would send to L2.\n * @param _l1Token L1 Address of the GRT contract (needed for compatibility with Arbitrum Gateway Router)\n * @param _to Recipient address on L2\n * @param _amount Amount of tokens to tranfer\n * @param _maxGas Gas limit for L2 execution of the ticket\n * @param _gasPriceBid Price per gas on L2\n * @param _data Encoded maxSubmissionCost and sender address along with additional calldata\n * @return Sequence number of the retryable ticket created by Inbox (always )\n */\n function outboundTransfer(\n address _l1Token,\n address _to,\n uint256 _amount,\n uint256 _maxGas,\n uint256 _gasPriceBid,\n bytes calldata _data\n ) external payable returns (bytes memory) {\n require(_amount > 0, \"INVALID_ZERO_AMOUNT\");\n require(_to != address(0), \"INVALID_DESTINATION\");\n\n // nested scopes to avoid stack too deep errors\n address from;\n uint256 seqNum = nextSeqNum;\n nextSeqNum += 1;\n {\n uint256 maxSubmissionCost;\n bytes memory outboundCalldata;\n {\n bytes memory extraData;\n (from, maxSubmissionCost, extraData) = _parseOutboundData(_data);\n require(maxSubmissionCost > 0, \"NO_SUBMISSION_COST\");\n\n {\n // makes sure only sufficient ETH is supplied as required for successful redemption on L2\n // if a user does not desire immediate redemption they should provide\n // a msg.value of AT LEAST maxSubmissionCost\n uint256 expectedEth = maxSubmissionCost.add(_maxGas.mul(_gasPriceBid));\n require(msg.value >= expectedEth, \"WRONG_ETH_VALUE\");\n }\n outboundCalldata = getOutboundCalldata(_l1Token, from, _to, _amount, extraData);\n }\n {\n // transfer tokens to escrow\n IERC20(_l1Token).transferFrom(from, address(this), _amount);\n\n emit FakeTxToL2(from, msg.value, _maxGas, _gasPriceBid, maxSubmissionCost, outboundCalldata);\n }\n }\n emit DepositInitiated(_l1Token, from, _to, seqNum, _amount);\n\n return abi.encode(seqNum);\n }\n\n /**\n * @notice (Mock) Receives withdrawn tokens from L2\n * Actually does nothing, just keeping it here as its useful to define the expected\n * calldata for the outgoing transfer in tests.\n * @param _l1Token L1 Address of the GRT contract (needed for compatibility with Arbitrum Gateway Router)\n * @param _from Address of the sender\n * @param _to Recepient address on L1\n * @param _amount Amount of tokens transferred\n * @param _data Additional calldata\n */\n function finalizeInboundTransfer(\n address _l1Token,\n address _from,\n address _to,\n uint256 _amount,\n bytes calldata _data\n ) external payable {}\n\n /**\n * @notice Creates calldata required to create a retryable ticket\n * @dev encodes the target function with its params which\n * will be called on L2 when the retryable ticket is redeemed\n * @param _l1Token Address of the Graph token contract on L1\n * @param _from Address on L1 from which we're transferring tokens\n * @param _to Address on L2 to which we're transferring tokens\n * @param _amount Amount of GRT to transfer\n * @param _data Additional call data for the L2 transaction, which must be empty unless the caller is whitelisted\n * @return Encoded calldata (including function selector) for the L2 transaction\n */\n function getOutboundCalldata(\n address _l1Token,\n address _from,\n address _to,\n uint256 _amount,\n bytes memory _data\n ) public pure returns (bytes memory) {\n bytes memory emptyBytes;\n\n return\n abi.encodeWithSelector(\n ITokenGateway.finalizeInboundTransfer.selector,\n _l1Token,\n _from,\n _to,\n _amount,\n abi.encode(emptyBytes, _data)\n );\n }\n\n /**\n * @notice Decodes calldata required for transfer of tokens to L2\n * @dev Data must include maxSubmissionCost, extraData can be left empty. When the router\n * sends an outbound message, data also contains the from address, but this mock\n * doesn't consider this case\n * @param _data Encoded callhook data containing maxSubmissionCost and extraData\n * @return Sender of the tx\n * @return Max ether value used to submit the retryable ticket\n * @return Additional data sent to L2\n */\n function _parseOutboundData(bytes memory _data) private view returns (address, uint256, bytes memory) {\n address from;\n uint256 maxSubmissionCost;\n bytes memory extraData;\n from = msg.sender;\n // User-encoded data contains the max retryable ticket submission cost\n // and additional L2 calldata\n (maxSubmissionCost, extraData) = abi.decode(_data, (uint256, bytes));\n return (from, maxSubmissionCost, extraData);\n }\n}\n" + }, + "contracts/tests/L2TokenGatewayMock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport { Ownable } from \"@openzeppelin/contracts/access/Ownable.sol\";\nimport { ITokenGateway } from \"../arbitrum//ITokenGateway.sol\";\nimport { GraphTokenMock } from \"./GraphTokenMock.sol\";\nimport { ICallhookReceiver } from \"../ICallhookReceiver.sol\";\n\n/**\n * @title L2 Token Gateway mock contract\n * @dev Used for testing purposes, DO NOT USE IN PRODUCTION\n */\ncontract L2TokenGatewayMock is Ownable {\n /// Address of the L1 GRT contract\n address public immutable l1Token;\n /// Address of the L2 GRT contract\n address public immutable l2Token;\n /// Next ID to return when sending an outboundTransfer\n uint256 public nextId;\n\n /// @dev Emitted when a (fake) transaction to L1 is created\n event FakeTxToL1(address from, bytes outboundCalldata);\n /// @dev Emitted when a (fake) retryable ticket is received from L1\n event DepositFinalized(address token, address indexed from, address indexed to, uint256 amount);\n\n /// @dev Emitted when an outbound transfer is initiated, i.e. tokens are withdrawn to L1 from L2\n event WithdrawalInitiated(\n address l1Token,\n address indexed from,\n address indexed to,\n uint256 indexed sequenceNumber,\n uint256 amount\n );\n\n /**\n * @notice L2 Token Gateway Contract Constructor.\n * @param _l1Token Address of the L1 GRT contract\n * @param _l2Token Address of the L2 GRT contract\n */\n constructor(address _l1Token, address _l2Token) {\n l1Token = _l1Token;\n l2Token = _l2Token;\n }\n\n /**\n * @notice Creates and sends a (fake) transfer of GRT to L1.\n * This mock will actually just emit an event with parameters equivalent to what the real L2GraphTokenGateway\n * would send to L1.\n * @param _l1Token L1 Address of the GRT contract (needed for compatibility with Arbitrum Gateway Router)\n * @param _to Recipient address on L2\n * @param _amount Amount of tokens to tranfer\n * @param _data Encoded maxSubmissionCost and sender address along with additional calldata\n * @return ID of the L2-L1 message (incrementing on every call)\n */\n function outboundTransfer(\n address _l1Token,\n address _to,\n uint256 _amount,\n uint256,\n uint256,\n bytes calldata _data\n ) external payable returns (bytes memory) {\n require(_l1Token == l1Token, \"INVALID_L1_TOKEN\");\n require(_amount > 0, \"INVALID_ZERO_AMOUNT\");\n require(_to != address(0), \"INVALID_DESTINATION\");\n\n // nested scopes to avoid stack too deep errors\n address from;\n uint256 id = nextId;\n nextId += 1;\n {\n bytes memory outboundCalldata;\n {\n bytes memory extraData;\n (from, extraData) = _parseOutboundData(_data);\n\n require(msg.value == 0, \"!value\");\n require(extraData.length == 0, \"!extraData\");\n outboundCalldata = getOutboundCalldata(_l1Token, from, _to, _amount, extraData);\n }\n {\n // burn tokens from the sender, they will be released from escrow in L1\n GraphTokenMock(l2Token).bridgeBurn(from, _amount);\n\n emit FakeTxToL1(from, outboundCalldata);\n }\n }\n emit WithdrawalInitiated(_l1Token, from, _to, id, _amount);\n\n return abi.encode(id);\n }\n\n /**\n * @notice (Mock) Receives withdrawn tokens from L1\n * Implements calling callhooks if data is non-empty.\n * @param _l1Token L1 Address of the GRT contract (needed for compatibility with Arbitrum Gateway Router)\n * @param _from Address of the sender\n * @param _to Recipient address on L1\n * @param _amount Amount of tokens transferred\n * @param _data Additional calldata, will trigger an onTokenTransfer call if non-empty\n */\n function finalizeInboundTransfer(\n address _l1Token,\n address _from,\n address _to,\n uint256 _amount,\n bytes calldata _data\n ) external payable {\n require(_l1Token == l1Token, \"TOKEN_NOT_GRT\");\n require(msg.value == 0, \"INVALID_NONZERO_VALUE\");\n\n GraphTokenMock(l2Token).bridgeMint(_to, _amount);\n\n if (_data.length > 0) {\n ICallhookReceiver(_to).onTokenTransfer(_from, _amount, _data);\n }\n\n emit DepositFinalized(_l1Token, _from, _to, _amount);\n }\n\n /**\n * @notice Calculate the L2 address of a bridged token\n * @dev In our case, this would only work for GRT.\n * @param l1ERC20 address of L1 GRT contract\n * @return L2 address of the bridged GRT token\n */\n function calculateL2TokenAddress(address l1ERC20) public view returns (address) {\n if (l1ERC20 != l1Token) {\n return address(0);\n }\n return l2Token;\n }\n\n /**\n * @notice Creates calldata required to create a tx to L1\n * @param _l1Token Address of the Graph token contract on L1\n * @param _from Address on L2 from which we're transferring tokens\n * @param _to Address on L1 to which we're transferring tokens\n * @param _amount Amount of GRT to transfer\n * @param _data Additional call data for the L1 transaction, which must be empty\n * @return Encoded calldata (including function selector) for the L1 transaction\n */\n function getOutboundCalldata(\n address _l1Token,\n address _from,\n address _to,\n uint256 _amount,\n bytes memory _data\n ) public pure returns (bytes memory) {\n return\n abi.encodeWithSelector(\n ITokenGateway.finalizeInboundTransfer.selector,\n _l1Token,\n _from,\n _to,\n _amount,\n abi.encode(0, _data)\n );\n }\n\n /**\n * @dev Decodes calldata required for transfer of tokens to L1.\n * extraData can be left empty\n * @param _data Encoded callhook data\n * @return Sender of the tx\n * @return Any other data sent to L1\n */\n function _parseOutboundData(bytes calldata _data) private view returns (address, bytes memory) {\n address from;\n bytes memory extraData;\n // The mock doesn't take messages from the Router\n from = msg.sender;\n extraData = _data;\n return (from, extraData);\n }\n}\n" + }, + "contracts/tests/Stakes.sol": { + "content": "// SPDX-License-Identifier: GPL-2.0-or-later\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/math/SafeMath.sol\";\n\n/**\n * @title A collection of data structures and functions to manage the Indexer Stake state.\n * Used for low-level state changes, require() conditions should be evaluated\n * at the caller function scope.\n */\nlibrary Stakes {\n using SafeMath for uint256;\n using Stakes for Stakes.Indexer;\n\n struct Indexer {\n uint256 tokensStaked; // Tokens on the indexer stake (staked by the indexer)\n uint256 tokensAllocated; // Tokens used in allocations\n uint256 tokensLocked; // Tokens locked for withdrawal subject to thawing period\n uint256 tokensLockedUntil; // Block when locked tokens can be withdrawn\n }\n\n /**\n * @dev Deposit tokens to the indexer stake.\n * @param stake Stake data\n * @param _tokens Amount of tokens to deposit\n */\n function deposit(Stakes.Indexer storage stake, uint256 _tokens) internal {\n stake.tokensStaked = stake.tokensStaked.add(_tokens);\n }\n\n /**\n * @dev Release tokens from the indexer stake.\n * @param stake Stake data\n * @param _tokens Amount of tokens to release\n */\n function release(Stakes.Indexer storage stake, uint256 _tokens) internal {\n stake.tokensStaked = stake.tokensStaked.sub(_tokens);\n }\n\n /**\n * @dev Allocate tokens from the main stack to a SubgraphDeployment.\n * @param stake Stake data\n * @param _tokens Amount of tokens to allocate\n */\n function allocate(Stakes.Indexer storage stake, uint256 _tokens) internal {\n stake.tokensAllocated = stake.tokensAllocated.add(_tokens);\n }\n\n /**\n * @dev Unallocate tokens from a SubgraphDeployment back to the main stack.\n * @param stake Stake data\n * @param _tokens Amount of tokens to unallocate\n */\n function unallocate(Stakes.Indexer storage stake, uint256 _tokens) internal {\n stake.tokensAllocated = stake.tokensAllocated.sub(_tokens);\n }\n\n /**\n * @dev Lock tokens until a thawing period pass.\n * @param stake Stake data\n * @param _tokens Amount of tokens to unstake\n * @param _period Period in blocks that need to pass before withdrawal\n */\n function lockTokens(Stakes.Indexer storage stake, uint256 _tokens, uint256 _period) internal {\n // Take into account period averaging for multiple unstake requests\n uint256 lockingPeriod = _period;\n if (stake.tokensLocked > 0) {\n lockingPeriod = stake.getLockingPeriod(_tokens, _period);\n }\n\n // Update balances\n stake.tokensLocked = stake.tokensLocked.add(_tokens);\n stake.tokensLockedUntil = block.number.add(lockingPeriod);\n }\n\n /**\n * @dev Unlock tokens.\n * @param stake Stake data\n * @param _tokens Amount of tokens to unkock\n */\n function unlockTokens(Stakes.Indexer storage stake, uint256 _tokens) internal {\n stake.tokensLocked = stake.tokensLocked.sub(_tokens);\n if (stake.tokensLocked == 0) {\n stake.tokensLockedUntil = 0;\n }\n }\n\n /**\n * @dev Take all tokens out from the locked stake for withdrawal.\n * @param stake Stake data\n * @return Amount of tokens being withdrawn\n */\n function withdrawTokens(Stakes.Indexer storage stake) internal returns (uint256) {\n // Calculate tokens that can be released\n uint256 tokensToWithdraw = stake.tokensWithdrawable();\n\n if (tokensToWithdraw > 0) {\n // Reset locked tokens\n stake.unlockTokens(tokensToWithdraw);\n\n // Decrease indexer stake\n stake.release(tokensToWithdraw);\n }\n\n return tokensToWithdraw;\n }\n\n /**\n * @dev Get the locking period of the tokens to unstake.\n * If already unstaked before calculate the weighted average.\n * @param stake Stake data\n * @param _tokens Amount of tokens to unstake\n * @param _thawingPeriod Period in blocks that need to pass before withdrawal\n * @return True if staked\n */\n function getLockingPeriod(\n Stakes.Indexer memory stake,\n uint256 _tokens,\n uint256 _thawingPeriod\n ) internal view returns (uint256) {\n uint256 blockNum = block.number;\n uint256 periodA = (stake.tokensLockedUntil > blockNum) ? stake.tokensLockedUntil.sub(blockNum) : 0;\n uint256 periodB = _thawingPeriod;\n uint256 stakeA = stake.tokensLocked;\n uint256 stakeB = _tokens;\n return periodA.mul(stakeA).add(periodB.mul(stakeB)).div(stakeA.add(stakeB));\n }\n\n /**\n * @dev Return true if there are tokens staked by the Indexer.\n * @param stake Stake data\n * @return True if staked\n */\n function hasTokens(Stakes.Indexer memory stake) internal pure returns (bool) {\n return stake.tokensStaked > 0;\n }\n\n /**\n * @dev Return the amount of tokens used in allocations and locked for withdrawal.\n * @param stake Stake data\n * @return Token amount\n */\n function tokensUsed(Stakes.Indexer memory stake) internal pure returns (uint256) {\n return stake.tokensAllocated.add(stake.tokensLocked);\n }\n\n /**\n * @dev Return the amount of tokens staked not considering the ones that are already going\n * through the thawing period or are ready for withdrawal. We call it secure stake because\n * it is not subject to change by a withdraw call from the indexer.\n * @param stake Stake data\n * @return Token amount\n */\n function tokensSecureStake(Stakes.Indexer memory stake) internal pure returns (uint256) {\n return stake.tokensStaked.sub(stake.tokensLocked);\n }\n\n /**\n * @dev Tokens free balance on the indexer stake that can be used for any purpose.\n * Any token that is allocated cannot be used as well as tokens that are going through the\n * thawing period or are withdrawable\n * Calc: tokensStaked - tokensAllocated - tokensLocked\n * @param stake Stake data\n * @return Token amount\n */\n function tokensAvailable(Stakes.Indexer memory stake) internal pure returns (uint256) {\n return stake.tokensAvailableWithDelegation(0);\n }\n\n /**\n * @dev Tokens free balance on the indexer stake that can be used for allocations.\n * This function accepts a parameter for extra delegated capacity that takes into\n * account delegated tokens\n * @param stake Stake data\n * @param _delegatedCapacity Amount of tokens used from delegators to calculate availability\n * @return Token amount\n */\n function tokensAvailableWithDelegation(\n Stakes.Indexer memory stake,\n uint256 _delegatedCapacity\n ) internal pure returns (uint256) {\n uint256 tokensCapacity = stake.tokensStaked.add(_delegatedCapacity);\n uint256 _tokensUsed = stake.tokensUsed();\n // If more tokens are used than the current capacity, the indexer is overallocated.\n // This means the indexer doesn't have available capacity to create new allocations.\n // We can reach this state when the indexer has funds allocated and then any\n // of these conditions happen:\n // - The delegationCapacity ratio is reduced.\n // - The indexer stake is slashed.\n // - A delegator removes enough stake.\n if (_tokensUsed > tokensCapacity) {\n // Indexer stake is over allocated: return 0 to avoid stake to be used until\n // the overallocation is restored by staking more tokens, unallocating tokens\n // or using more delegated funds\n return 0;\n }\n return tokensCapacity.sub(_tokensUsed);\n }\n\n /**\n * @dev Tokens available for withdrawal after thawing period.\n * @param stake Stake data\n * @return Token amount\n */\n function tokensWithdrawable(Stakes.Indexer memory stake) internal view returns (uint256) {\n // No tokens to withdraw before locking period\n if (stake.tokensLockedUntil == 0 || block.number < stake.tokensLockedUntil) {\n return 0;\n }\n return stake.tokensLocked;\n }\n}\n" + }, + "contracts/tests/StakingMock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\nimport \"./Stakes.sol\";\n\ncontract StakingMock {\n using SafeMath for uint256;\n using Stakes for Stakes.Indexer;\n\n // -- State --\n\n uint256 public minimumIndexerStake = 100e18;\n uint256 public thawingPeriod = 10; // 10 blocks\n IERC20 public token;\n\n // Indexer stakes : indexer => Stake\n mapping(address => Stakes.Indexer) public stakes;\n\n /**\n * @dev Emitted when `indexer` stake `tokens` amount.\n */\n event StakeDeposited(address indexed indexer, uint256 tokens);\n\n /**\n * @dev Emitted when `indexer` unstaked and locked `tokens` amount `until` block.\n */\n event StakeLocked(address indexed indexer, uint256 tokens, uint256 until);\n\n /**\n * @dev Emitted when `indexer` withdrew `tokens` staked.\n */\n event StakeWithdrawn(address indexed indexer, uint256 tokens);\n\n // Contract constructor.\n constructor(IERC20 _token) {\n require(address(_token) != address(0), \"!token\");\n token = _token;\n }\n\n receive() external payable {}\n\n /**\n * @dev Deposit tokens on the indexer stake.\n * @param _tokens Amount of tokens to stake\n */\n function stake(uint256 _tokens) external {\n stakeTo(msg.sender, _tokens);\n }\n\n /**\n * @dev Deposit tokens on the indexer stake.\n * @param _indexer Address of the indexer\n * @param _tokens Amount of tokens to stake\n */\n function stakeTo(address _indexer, uint256 _tokens) public {\n require(_tokens > 0, \"!tokens\");\n\n // Ensure minimum stake\n require(stakes[_indexer].tokensSecureStake().add(_tokens) >= minimumIndexerStake, \"!minimumIndexerStake\");\n\n // Transfer tokens to stake from caller to this contract\n require(token.transferFrom(msg.sender, address(this), _tokens), \"!transfer\");\n\n // Stake the transferred tokens\n _stake(_indexer, _tokens);\n }\n\n /**\n * @dev Unstake tokens from the indexer stake, lock them until thawing period expires.\n * @param _tokens Amount of tokens to unstake\n */\n function unstake(uint256 _tokens) external {\n address indexer = msg.sender;\n Stakes.Indexer storage indexerStake = stakes[indexer];\n\n require(_tokens > 0, \"!tokens\");\n require(indexerStake.hasTokens(), \"!stake\");\n require(indexerStake.tokensAvailable() >= _tokens, \"!stake-avail\");\n\n // Ensure minimum stake\n uint256 newStake = indexerStake.tokensSecureStake().sub(_tokens);\n require(newStake == 0 || newStake >= minimumIndexerStake, \"!minimumIndexerStake\");\n\n // Before locking more tokens, withdraw any unlocked ones\n uint256 tokensToWithdraw = indexerStake.tokensWithdrawable();\n if (tokensToWithdraw > 0) {\n _withdraw(indexer);\n }\n\n indexerStake.lockTokens(_tokens, thawingPeriod);\n\n emit StakeLocked(indexer, indexerStake.tokensLocked, indexerStake.tokensLockedUntil);\n }\n\n /**\n * @dev Withdraw indexer tokens once the thawing period has passed.\n */\n function withdraw() external {\n _withdraw(msg.sender);\n }\n\n function _stake(address _indexer, uint256 _tokens) internal {\n // Deposit tokens into the indexer stake\n Stakes.Indexer storage indexerStake = stakes[_indexer];\n indexerStake.deposit(_tokens);\n\n emit StakeDeposited(_indexer, _tokens);\n }\n\n /**\n * @dev Withdraw indexer tokens once the thawing period has passed.\n * @param _indexer Address of indexer to withdraw funds from\n */\n function _withdraw(address _indexer) private {\n // Get tokens available for withdraw and update balance\n uint256 tokensToWithdraw = stakes[_indexer].withdrawTokens();\n require(tokensToWithdraw > 0, \"!tokens\");\n\n // Return tokens to the indexer\n require(token.transfer(_indexer, tokensToWithdraw), \"!transfer\");\n\n emit StakeWithdrawn(_indexer, tokensToWithdraw);\n }\n}\n" + }, + "contracts/tests/WalletMock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport { Address } from \"@openzeppelin/contracts/utils/Address.sol\";\n\n/**\n * @title WalletMock: a mock wallet contract for testing purposes\n * @dev For testing only, DO NOT USE IN PRODUCTION.\n * This is used to test L1-L2 transfer tools and to create scenarios\n * where an invalid wallet calls the transfer tool, e.g. a wallet that has an invalid\n * manager, or a wallet that has not been initialized.\n */\ncontract WalletMock {\n /// Target contract for the fallback function (usually a transfer tool contract)\n address public immutable target;\n /// Address of the GRT (mock) token\n address public immutable token;\n /// Address of the wallet's manager\n address public immutable manager;\n /// Whether the wallet has been initialized\n bool public immutable isInitialized;\n /// Whether the beneficiary has accepted the lock\n bool public immutable isAccepted;\n\n /**\n * @notice WalletMock constructor\n * @dev This constructor sets all the state variables so that\n * specific test scenarios can be created just by deploying this contract.\n * @param _target Target contract for the fallback function\n * @param _token Address of the GRT (mock) token\n * @param _manager Address of the wallet's manager\n * @param _isInitialized Whether the wallet has been initialized\n * @param _isAccepted Whether the beneficiary has accepted the lock\n */\n constructor(address _target, address _token, address _manager, bool _isInitialized, bool _isAccepted) {\n target = _target;\n token = _token;\n manager = _manager;\n isInitialized = _isInitialized;\n isAccepted = _isAccepted;\n }\n\n /**\n * @notice Fallback function\n * @dev This function calls the target contract with the data sent to this contract.\n * This is used to test the L1-L2 transfer tool.\n */\n fallback() external payable {\n // Call function with data\n Address.functionCall(target, msg.data);\n }\n\n /**\n * @notice Receive function\n * @dev This function is added to avoid compiler warnings, but just reverts.\n */\n receive() external payable {\n revert(\"Invalid call\");\n }\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": false, + "runs": 200 + }, + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file diff --git a/packages/token-distribution/deployments/arbitrum-one/.chainId b/packages/token-distribution/deployments/arbitrum-one/.chainId new file mode 100644 index 000000000..7df83ecbe --- /dev/null +++ b/packages/token-distribution/deployments/arbitrum-one/.chainId @@ -0,0 +1 @@ +42161 \ No newline at end of file diff --git a/packages/token-distribution/deployments/arbitrum-one/L2GraphTokenLockManager-Foundation-v1.json b/packages/token-distribution/deployments/arbitrum-one/L2GraphTokenLockManager-Foundation-v1.json new file mode 100644 index 000000000..5118e146d --- /dev/null +++ b/packages/token-distribution/deployments/arbitrum-one/L2GraphTokenLockManager-Foundation-v1.json @@ -0,0 +1,1161 @@ +{ + "address": "0x4f74c728CEe713191E500e68a8C8cC32bff9d911", + "abi": [ + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_graphToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_masterCopy", + "type": "address" + }, + { + "internalType": "address", + "name": "_l2Gateway", + "type": "address" + }, + { + "internalType": "address", + "name": "_l1TransferTool", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes4", + "name": "sigHash", + "type": "bytes4" + }, + { + "indexed": true, + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "indexed": false, + "internalType": "string", + "name": "signature", + "type": "string" + } + ], + "name": "FunctionCallAuth", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "l1Address", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "l2Address", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "LockedTokensReceivedFromL1", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "masterCopy", + "type": "address" + } + ], + "name": "MasterCopyUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "proxy", + "type": "address" + } + ], + "name": "ProxyCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "dst", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "TokenDestinationAllowed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "contractAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "initHash", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "managedAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "startTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "endTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "periods", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "releaseStartTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "vestingCliffTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "enum IGraphTokenLock.Revocability", + "name": "revocable", + "type": "uint8" + } + ], + "name": "TokenLockCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "contractAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "initHash", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "managedAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "startTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "endTime", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "l1Address", + "type": "address" + } + ], + "name": "TokenLockCreatedFromL1", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensDeposited", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensWithdrawn", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_dst", + "type": "address" + } + ], + "name": "addTokenDestination", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "", + "type": "bytes4" + } + ], + "name": "authFnCalls", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_owner", + "type": "address" + }, + { + "internalType": "address", + "name": "_beneficiary", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_managedAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_startTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_endTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_periods", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_releaseStartTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_vestingCliffTime", + "type": "uint256" + }, + { + "internalType": "enum IGraphTokenLock.Revocability", + "name": "_revocable", + "type": "uint8" + } + ], + "name": "createTokenLockWallet", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "deposit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_sigHash", + "type": "bytes4" + } + ], + "name": "getAuthFunctionCallTarget", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_salt", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "_implementation", + "type": "address" + }, + { + "internalType": "address", + "name": "_deployer", + "type": "address" + } + ], + "name": "getDeploymentAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "getTokenDestinations", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_sigHash", + "type": "bytes4" + } + ], + "name": "isAuthFunctionCall", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_dst", + "type": "address" + } + ], + "name": "isTokenDestination", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "l1TransferTool", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "l1WalletToL2Wallet", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "l2Gateway", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "l2WalletToL1Wallet", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "masterCopy", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_from", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "onTokenTransfer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_dst", + "type": "address" + } + ], + "name": "removeTokenDestination", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_signature", + "type": "string" + }, + { + "internalType": "address", + "name": "_target", + "type": "address" + } + ], + "name": "setAuthFunctionCall", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string[]", + "name": "_signatures", + "type": "string[]" + }, + { + "internalType": "address[]", + "name": "_targets", + "type": "address[]" + } + ], + "name": "setAuthFunctionCallMany", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_masterCopy", + "type": "address" + } + ], + "name": "setMasterCopy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "token", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_signature", + "type": "string" + } + ], + "name": "unsetAuthFunctionCall", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x7e5d9b96ea7bdce06eea3febf62543c269b4f4a9e2a03a5be0dad97ca14b3564", + "receipt": { + "to": null, + "from": "0x4528FD7868c91Ef64B9907450Ee8d82dC639612c", + "contractAddress": "0x4f74c728CEe713191E500e68a8C8cC32bff9d911", + "transactionIndex": 1, + "gasUsed": "25715468", + "logsBloom": "0x00000000000000200000200000000000000004000000000100800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000200000000001000000000000000000400000000002000000020000000000000000000800000000000000000000000000000000400000002000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000020000000000000000000000000000000000000000000000020000000000000000000", + "blockHash": "0x8b77a265ed1e911a014daec707ce98c5c0764980b4151dbd09679fd936fe4369", + "transactionHash": "0x7e5d9b96ea7bdce06eea3febf62543c269b4f4a9e2a03a5be0dad97ca14b3564", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 113597444, + "transactionHash": "0x7e5d9b96ea7bdce06eea3febf62543c269b4f4a9e2a03a5be0dad97ca14b3564", + "address": "0x4f74c728CEe713191E500e68a8C8cC32bff9d911", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000004528fd7868c91ef64b9907450ee8d82dc639612c" + ], + "data": "0x", + "logIndex": 0, + "blockHash": "0x8b77a265ed1e911a014daec707ce98c5c0764980b4151dbd09679fd936fe4369" + }, + { + "transactionIndex": 1, + "blockNumber": 113597444, + "transactionHash": "0x7e5d9b96ea7bdce06eea3febf62543c269b4f4a9e2a03a5be0dad97ca14b3564", + "address": "0x4f74c728CEe713191E500e68a8C8cC32bff9d911", + "topics": [ + "0x30909084afc859121ffc3a5aef7fe37c540a9a1ef60bd4d8dcdb76376fadf9de", + "0x0000000000000000000000006864cdd6d69dbef02e5e06c5534b20fdaf8b51b0" + ], + "data": "0x", + "logIndex": 1, + "blockHash": "0x8b77a265ed1e911a014daec707ce98c5c0764980b4151dbd09679fd936fe4369" + } + ], + "blockNumber": 113597444, + "cumulativeGasUsed": "25715468", + "status": 1, + "byzantium": true + }, + "args": [ + "0x9623063377AD1B27544C965cCd7342f7EA7e88C7", + "0x6864Cdd6D69Dbef02E5e06c5534b20fdaf8b51b0", + "0x65E1a5e8946e7E87d9774f5288f41c30a99fD302", + "0xCa82c7Ce3388b0B5d307574099aC57d7a00d509F" + ], + "solcInputHash": "b5cdad58099d39cd1aed000b2fd864d8", + "metadata": "{\"compiler\":{\"version\":\"0.7.3+commit.9bfce1f6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"_graphToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_masterCopy\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_l2Gateway\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_l1TransferTool\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes4\",\"name\":\"sigHash\",\"type\":\"bytes4\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"signature\",\"type\":\"string\"}],\"name\":\"FunctionCallAuth\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"l1Address\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"l2Address\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"LockedTokensReceivedFromL1\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"masterCopy\",\"type\":\"address\"}],\"name\":\"MasterCopyUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"proxy\",\"type\":\"address\"}],\"name\":\"ProxyCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dst\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"}],\"name\":\"TokenDestinationAllowed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"contractAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"initHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"managedAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"startTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"endTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"periods\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"releaseStartTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"vestingCliffTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"enum IGraphTokenLock.Revocability\",\"name\":\"revocable\",\"type\":\"uint8\"}],\"name\":\"TokenLockCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"contractAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"initHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"managedAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"startTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"endTime\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"l1Address\",\"type\":\"address\"}],\"name\":\"TokenLockCreatedFromL1\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensWithdrawn\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_dst\",\"type\":\"address\"}],\"name\":\"addTokenDestination\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"name\":\"authFnCalls\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_beneficiary\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_managedAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_startTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_endTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_periods\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_releaseStartTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_vestingCliffTime\",\"type\":\"uint256\"},{\"internalType\":\"enum IGraphTokenLock.Revocability\",\"name\":\"_revocable\",\"type\":\"uint8\"}],\"name\":\"createTokenLockWallet\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"deposit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"_sigHash\",\"type\":\"bytes4\"}],\"name\":\"getAuthFunctionCallTarget\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_salt\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_deployer\",\"type\":\"address\"}],\"name\":\"getDeploymentAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTokenDestinations\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"_sigHash\",\"type\":\"bytes4\"}],\"name\":\"isAuthFunctionCall\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_dst\",\"type\":\"address\"}],\"name\":\"isTokenDestination\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"l1TransferTool\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"l1WalletToL2Wallet\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"l2Gateway\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"l2WalletToL1Wallet\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"masterCopy\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_from\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"onTokenTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_dst\",\"type\":\"address\"}],\"name\":\"removeTokenDestination\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_signature\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"_target\",\"type\":\"address\"}],\"name\":\"setAuthFunctionCall\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string[]\",\"name\":\"_signatures\",\"type\":\"string[]\"},{\"internalType\":\"address[]\",\"name\":\"_targets\",\"type\":\"address[]\"}],\"name\":\"setAuthFunctionCallMany\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_masterCopy\",\"type\":\"address\"}],\"name\":\"setMasterCopy\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_signature\",\"type\":\"string\"}],\"name\":\"unsetAuthFunctionCall\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"events\":{\"LockedTokensReceivedFromL1(address,address,uint256)\":{\"details\":\"Emitted when locked tokens are received from L1 (whether the wallet had already been received or not)\"},\"TokenLockCreatedFromL1(address,bytes32,address,uint256,uint256,uint256,address)\":{\"details\":\"Event emitted when a wallet is received and created from L1\"}},\"kind\":\"dev\",\"methods\":{\"addTokenDestination(address)\":{\"params\":{\"_dst\":\"Destination address\"}},\"constructor\":{\"params\":{\"_graphToken\":\"Address of the L2 GRT token contract\",\"_l1TransferTool\":\"Address of the L1 transfer tool contract (in L1, without aliasing)\",\"_l2Gateway\":\"Address of the L2GraphTokenGateway contract\",\"_masterCopy\":\"Address of the master copy of the L2GraphTokenLockWallet implementation\"}},\"createTokenLockWallet(address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)\":{\"params\":{\"_beneficiary\":\"Address of the beneficiary of locked tokens\",\"_endTime\":\"End time of the release schedule\",\"_managedAmount\":\"Amount of tokens to be managed by the lock contract\",\"_owner\":\"Address of the contract owner\",\"_periods\":\"Number of periods between start time and end time\",\"_releaseStartTime\":\"Override time for when the releases start\",\"_revocable\":\"Whether the contract is revocable\",\"_startTime\":\"Start time of the release schedule\"}},\"deposit(uint256)\":{\"details\":\"Even if the ERC20 token can be transferred directly to the contract this function provide a safe interface to do the transfer and avoid mistakes\",\"params\":{\"_amount\":\"Amount to deposit\"}},\"getAuthFunctionCallTarget(bytes4)\":{\"params\":{\"_sigHash\":\"Function signature hash\"},\"returns\":{\"_0\":\"Address of the target contract where to send the call\"}},\"getDeploymentAddress(bytes32,address,address)\":{\"params\":{\"_deployer\":\"Address of the deployer that creates the contract\",\"_implementation\":\"Address of the proxy target implementation\",\"_salt\":\"Bytes32 salt to use for CREATE2\"},\"returns\":{\"_0\":\"Address of the counterfactual MinimalProxy\"}},\"getTokenDestinations()\":{\"returns\":{\"_0\":\"Array of addresses authorized to pull funds from a token lock\"}},\"isAuthFunctionCall(bytes4)\":{\"params\":{\"_sigHash\":\"Function signature hash\"},\"returns\":{\"_0\":\"True if authorized\"}},\"isTokenDestination(address)\":{\"params\":{\"_dst\":\"Destination address\"},\"returns\":{\"_0\":\"True if authorized\"}},\"onTokenTransfer(address,uint256,bytes)\":{\"details\":\"This function will create a new wallet if it doesn't exist yet, or send the tokens to the existing wallet if it does.\",\"params\":{\"_amount\":\"Amount of tokens received\",\"_data\":\"Encoded data of the transferred wallet, which must be an ABI-encoded TransferredWalletData struct\",\"_from\":\"Address of the sender in L1, which must be the L1GraphTokenLockTransferTool\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"removeTokenDestination(address)\":{\"params\":{\"_dst\":\"Destination address\"}},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"setAuthFunctionCall(string,address)\":{\"details\":\"Input expected is the function signature as 'transfer(address,uint256)'\",\"params\":{\"_signature\":\"Function signature\",\"_target\":\"Address of the destination contract to call\"}},\"setAuthFunctionCallMany(string[],address[])\":{\"details\":\"Input expected is the function signature as 'transfer(address,uint256)'\",\"params\":{\"_signatures\":\"Function signatures\",\"_targets\":\"Address of the destination contract to call\"}},\"setMasterCopy(address)\":{\"params\":{\"_masterCopy\":\"Address of contract bytecode to factory clone\"}},\"token()\":{\"returns\":{\"_0\":\"Token used for transfers and approvals\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"unsetAuthFunctionCall(string)\":{\"details\":\"Input expected is the function signature as 'transfer(address,uint256)'\",\"params\":{\"_signature\":\"Function signature\"}},\"withdraw(uint256)\":{\"details\":\"Escape hatch in case of mistakes or to recover remaining funds\",\"params\":{\"_amount\":\"Amount of tokens to withdraw\"}}},\"title\":\"L2GraphTokenLockManager\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"addTokenDestination(address)\":{\"notice\":\"Adds an address that can be allowed by a token lock to pull funds\"},\"constructor\":{\"notice\":\"Constructor for the L2GraphTokenLockManager contract.\"},\"createTokenLockWallet(address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)\":{\"notice\":\"Creates and fund a new token lock wallet using a minimum proxy\"},\"deposit(uint256)\":{\"notice\":\"Deposits tokens into the contract\"},\"getAuthFunctionCallTarget(bytes4)\":{\"notice\":\"Gets the target contract to call for a particular function signature\"},\"getDeploymentAddress(bytes32,address,address)\":{\"notice\":\"Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation\"},\"getTokenDestinations()\":{\"notice\":\"Returns an array of authorized destination addresses\"},\"isAuthFunctionCall(bytes4)\":{\"notice\":\"Returns true if the function call is authorized\"},\"isTokenDestination(address)\":{\"notice\":\"Returns True if the address is authorized to be a destination of tokens\"},\"l1TransferTool()\":{\"notice\":\"Address of the L1 transfer tool contract (in L1, no aliasing)\"},\"l1WalletToL2Wallet(address)\":{\"notice\":\"Mapping of each L1 wallet to its L2 wallet counterpart (populated when each wallet is received) L1 address => L2 address\"},\"l2Gateway()\":{\"notice\":\"Address of the L2GraphTokenGateway\"},\"l2WalletToL1Wallet(address)\":{\"notice\":\"Mapping of each L2 wallet to its L1 wallet counterpart (populated when each wallet is received) L2 address => L1 address\"},\"onTokenTransfer(address,uint256,bytes)\":{\"notice\":\"This function is called by the L2GraphTokenGateway when tokens are sent from L1.\"},\"removeTokenDestination(address)\":{\"notice\":\"Removes an address that can be allowed by a token lock to pull funds\"},\"setAuthFunctionCall(string,address)\":{\"notice\":\"Sets an authorized function call to target\"},\"setAuthFunctionCallMany(string[],address[])\":{\"notice\":\"Sets an authorized function call to target in bulk\"},\"setMasterCopy(address)\":{\"notice\":\"Sets the masterCopy bytecode to use to create clones of TokenLock contracts\"},\"token()\":{\"notice\":\"Gets the GRT token address\"},\"unsetAuthFunctionCall(string)\":{\"notice\":\"Unsets an authorized function call to target\"},\"withdraw(uint256)\":{\"notice\":\"Withdraws tokens from the contract\"}},\"notice\":\"This contract manages a list of authorized function calls and targets that can be called by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts. This contract receives funds to make the process of creating TokenLockWallet contracts easier by distributing them the initial tokens to be managed. In particular, this L2 variant is designed to receive token lock wallets from L1, through the GRT bridge. These transferred wallets will not allow releasing funds in L2 until the end of the vesting timeline, but they can allow withdrawing funds back to L1 using the L2GraphTokenLockTransferTool contract. The owner can setup a list of token destinations that will be used by TokenLock contracts to approve the pulling of funds, this way in can be guaranteed that only protocol contracts will manipulate users funds.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/L2GraphTokenLockManager.sol\":\"L2GraphTokenLockManager\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor () internal {\\n address msgSender = _msgSender();\\n _owner = msgSender;\\n emit OwnershipTransferred(address(0), msgSender);\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n emit OwnershipTransferred(_owner, address(0));\\n _owner = address(0);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n emit OwnershipTransferred(_owner, newOwner);\\n _owner = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0x15e2d5bd4c28a88548074c54d220e8086f638a71ed07e6b3ba5a70066fcf458d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/math/SafeMath.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Wrappers over Solidity's arithmetic operations with added overflow\\n * checks.\\n *\\n * Arithmetic operations in Solidity wrap on overflow. This can easily result\\n * in bugs, because programmers usually assume that an overflow raises an\\n * error, which is the standard behavior in high level programming languages.\\n * `SafeMath` restores this intuition by reverting the transaction when an\\n * operation overflows.\\n *\\n * Using this library instead of the unchecked operations eliminates an entire\\n * class of bugs, so it's recommended to use it always.\\n */\\nlibrary SafeMath {\\n /**\\n * @dev Returns the addition of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n uint256 c = a + b;\\n if (c < a) return (false, 0);\\n return (true, c);\\n }\\n\\n /**\\n * @dev Returns the substraction of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b > a) return (false, 0);\\n return (true, a - b);\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\\n if (a == 0) return (true, 0);\\n uint256 c = a * b;\\n if (c / a != b) return (false, 0);\\n return (true, c);\\n }\\n\\n /**\\n * @dev Returns the division of two unsigned integers, with a division by zero flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b == 0) return (false, 0);\\n return (true, a / b);\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b == 0) return (false, 0);\\n return (true, a % b);\\n }\\n\\n /**\\n * @dev Returns the addition of two unsigned integers, reverting on\\n * overflow.\\n *\\n * Counterpart to Solidity's `+` operator.\\n *\\n * Requirements:\\n *\\n * - Addition cannot overflow.\\n */\\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\\n uint256 c = a + b;\\n require(c >= a, \\\"SafeMath: addition overflow\\\");\\n return c;\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting on\\n * overflow (when the result is negative).\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n *\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b <= a, \\\"SafeMath: subtraction overflow\\\");\\n return a - b;\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, reverting on\\n * overflow.\\n *\\n * Counterpart to Solidity's `*` operator.\\n *\\n * Requirements:\\n *\\n * - Multiplication cannot overflow.\\n */\\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\\n if (a == 0) return 0;\\n uint256 c = a * b;\\n require(c / a == b, \\\"SafeMath: multiplication overflow\\\");\\n return c;\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers, reverting on\\n * division by zero. The result is rounded towards zero.\\n *\\n * Counterpart to Solidity's `/` operator. Note: this function uses a\\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\\n * uses an invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b > 0, \\\"SafeMath: division by zero\\\");\\n return a / b;\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * reverting when dividing by zero.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b > 0, \\\"SafeMath: modulo by zero\\\");\\n return a % b;\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\\n * overflow (when the result is negative).\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {trySub}.\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n *\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b <= a, errorMessage);\\n return a - b;\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers, reverting with custom message on\\n * division by zero. The result is rounded towards zero.\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {tryDiv}.\\n *\\n * Counterpart to Solidity's `/` operator. Note: this function uses a\\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\\n * uses an invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b > 0, errorMessage);\\n return a / b;\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * reverting with custom message when dividing by zero.\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {tryMod}.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b > 0, errorMessage);\\n return a % b;\\n }\\n}\\n\",\"keccak256\":\"0xcc78a17dd88fa5a2edc60c8489e2f405c0913b377216a5b26b35656b2d0dab52\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `recipient`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address recipient, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `sender` to `recipient` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n}\\n\",\"keccak256\":\"0x5f02220344881ce43204ae4a6281145a67bc52c2bb1290a791857df3d19d78f5\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\nimport \\\"./IERC20.sol\\\";\\nimport \\\"../../math/SafeMath.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @title SafeERC20\\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\\n * contract returns false). Tokens that return no value (and instead revert or\\n * throw on failure) are also supported, non-reverting calls are assumed to be\\n * successful.\\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\n */\\nlibrary SafeERC20 {\\n using SafeMath for uint256;\\n using Address for address;\\n\\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\\n }\\n\\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\\n }\\n\\n /**\\n * @dev Deprecated. This function has issues similar to the ones found in\\n * {IERC20-approve}, and its usage is discouraged.\\n *\\n * Whenever possible, use {safeIncreaseAllowance} and\\n * {safeDecreaseAllowance} instead.\\n */\\n function safeApprove(IERC20 token, address spender, uint256 value) internal {\\n // safeApprove should only be called when setting an initial allowance,\\n // or when resetting it to zero. To increase and decrease it, use\\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\\n // solhint-disable-next-line max-line-length\\n require((value == 0) || (token.allowance(address(this), spender) == 0),\\n \\\"SafeERC20: approve from non-zero to non-zero allowance\\\"\\n );\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\\n }\\n\\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n uint256 newAllowance = token.allowance(address(this), spender).add(value);\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n uint256 newAllowance = token.allowance(address(this), spender).sub(value, \\\"SafeERC20: decreased allowance below zero\\\");\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n */\\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that\\n // the target address contains contract code and also asserts for success in the low-level call.\\n\\n bytes memory returndata = address(token).functionCall(data, \\\"SafeERC20: low-level call failed\\\");\\n if (returndata.length > 0) { // Return data is optional\\n // solhint-disable-next-line max-line-length\\n require(abi.decode(returndata, (bool)), \\\"SafeERC20: ERC20 operation did not succeed\\\");\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf12dfbe97e6276980b83d2830bb0eb75e0cf4f3e626c2471137f82158ae6a0fc\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.2 <0.8.0;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize, which returns 0 for contracts in\\n // construction, since the code is only stored at the end of the\\n // constructor execution.\\n\\n uint256 size;\\n // solhint-disable-next-line no-inline-assembly\\n assembly { size := extcodesize(account) }\\n return size > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls, avoid-call-value\\n (bool success, ) = recipient.call{ value: amount }(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain`call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.call{ value: value }(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x28911e614500ae7c607a432a709d35da25f3bc5ddc8bd12b278b66358070c0ea\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/*\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with GSN meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address payable) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes memory) {\\n this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0x8d3cb350f04ff49cfb10aef08d87f19dcbaecc8027b0bed12f3275cd12f38cf0\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Create2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Helper to make usage of the `CREATE2` EVM opcode easier and safer.\\n * `CREATE2` can be used to compute in advance the address where a smart\\n * contract will be deployed, which allows for interesting new mechanisms known\\n * as 'counterfactual interactions'.\\n *\\n * See the https://eips.ethereum.org/EIPS/eip-1014#motivation[EIP] for more\\n * information.\\n */\\nlibrary Create2 {\\n /**\\n * @dev Deploys a contract using `CREATE2`. The address where the contract\\n * will be deployed can be known in advance via {computeAddress}.\\n *\\n * The bytecode for a contract can be obtained from Solidity with\\n * `type(contractName).creationCode`.\\n *\\n * Requirements:\\n *\\n * - `bytecode` must not be empty.\\n * - `salt` must have not been used for `bytecode` already.\\n * - the factory must have a balance of at least `amount`.\\n * - if `amount` is non-zero, `bytecode` must have a `payable` constructor.\\n */\\n function deploy(uint256 amount, bytes32 salt, bytes memory bytecode) internal returns (address) {\\n address addr;\\n require(address(this).balance >= amount, \\\"Create2: insufficient balance\\\");\\n require(bytecode.length != 0, \\\"Create2: bytecode length is zero\\\");\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n addr := create2(amount, add(bytecode, 0x20), mload(bytecode), salt)\\n }\\n require(addr != address(0), \\\"Create2: Failed on deploy\\\");\\n return addr;\\n }\\n\\n /**\\n * @dev Returns the address where a contract will be stored if deployed via {deploy}. Any change in the\\n * `bytecodeHash` or `salt` will result in a new destination address.\\n */\\n function computeAddress(bytes32 salt, bytes32 bytecodeHash) internal view returns (address) {\\n return computeAddress(salt, bytecodeHash, address(this));\\n }\\n\\n /**\\n * @dev Returns the address where a contract will be stored if deployed via {deploy} from a contract located at\\n * `deployer`. If `deployer` is this contract's address, returns the same value as {computeAddress}.\\n */\\n function computeAddress(bytes32 salt, bytes32 bytecodeHash, address deployer) internal pure returns (address) {\\n bytes32 _data = keccak256(\\n abi.encodePacked(bytes1(0xff), deployer, salt, bytecodeHash)\\n );\\n return address(uint160(uint256(_data)));\\n }\\n}\\n\",\"keccak256\":\"0x0a0b021149946014fe1cd04af11e7a937a29986c47e8b1b718c2d50d729472db\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/EnumerableSet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Library for managing\\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\\n * types.\\n *\\n * Sets have the following properties:\\n *\\n * - Elements are added, removed, and checked for existence in constant time\\n * (O(1)).\\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\\n *\\n * ```\\n * contract Example {\\n * // Add the library methods\\n * using EnumerableSet for EnumerableSet.AddressSet;\\n *\\n * // Declare a set state variable\\n * EnumerableSet.AddressSet private mySet;\\n * }\\n * ```\\n *\\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\\n * and `uint256` (`UintSet`) are supported.\\n */\\nlibrary EnumerableSet {\\n // To implement this library for multiple types with as little code\\n // repetition as possible, we write it in terms of a generic Set type with\\n // bytes32 values.\\n // The Set implementation uses private functions, and user-facing\\n // implementations (such as AddressSet) are just wrappers around the\\n // underlying Set.\\n // This means that we can only create new EnumerableSets for types that fit\\n // in bytes32.\\n\\n struct Set {\\n // Storage of set values\\n bytes32[] _values;\\n\\n // Position of the value in the `values` array, plus 1 because index 0\\n // means a value is not in the set.\\n mapping (bytes32 => uint256) _indexes;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function _add(Set storage set, bytes32 value) private returns (bool) {\\n if (!_contains(set, value)) {\\n set._values.push(value);\\n // The value is stored at length-1, but we add 1 to all indexes\\n // and use 0 as a sentinel value\\n set._indexes[value] = set._values.length;\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function _remove(Set storage set, bytes32 value) private returns (bool) {\\n // We read and store the value's index to prevent multiple reads from the same storage slot\\n uint256 valueIndex = set._indexes[value];\\n\\n if (valueIndex != 0) { // Equivalent to contains(set, value)\\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\\n // the array, and then remove the last element (sometimes called as 'swap and pop').\\n // This modifies the order of the array, as noted in {at}.\\n\\n uint256 toDeleteIndex = valueIndex - 1;\\n uint256 lastIndex = set._values.length - 1;\\n\\n // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs\\n // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.\\n\\n bytes32 lastvalue = set._values[lastIndex];\\n\\n // Move the last value to the index where the value to delete is\\n set._values[toDeleteIndex] = lastvalue;\\n // Update the index for the moved value\\n set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based\\n\\n // Delete the slot where the moved value was stored\\n set._values.pop();\\n\\n // Delete the index for the deleted slot\\n delete set._indexes[value];\\n\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\\n return set._indexes[value] != 0;\\n }\\n\\n /**\\n * @dev Returns the number of values on the set. O(1).\\n */\\n function _length(Set storage set) private view returns (uint256) {\\n return set._values.length;\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\\n require(set._values.length > index, \\\"EnumerableSet: index out of bounds\\\");\\n return set._values[index];\\n }\\n\\n // Bytes32Set\\n\\n struct Bytes32Set {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _add(set._inner, value);\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _remove(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\\n return _contains(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(Bytes32Set storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\\n return _at(set._inner, index);\\n }\\n\\n // AddressSet\\n\\n struct AddressSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(AddressSet storage set, address value) internal returns (bool) {\\n return _add(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(AddressSet storage set, address value) internal returns (bool) {\\n return _remove(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(AddressSet storage set, address value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(AddressSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\\n return address(uint160(uint256(_at(set._inner, index))));\\n }\\n\\n\\n // UintSet\\n\\n struct UintSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(UintSet storage set, uint256 value) internal returns (bool) {\\n return _add(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\\n return _remove(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns the number of values on the set. O(1).\\n */\\n function length(UintSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\\n return uint256(_at(set._inner, index));\\n }\\n}\\n\",\"keccak256\":\"0x1562cd9922fbf739edfb979f506809e2743789cbde3177515542161c3d04b164\",\"license\":\"MIT\"},\"contracts/GraphTokenLock.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nimport \\\"@openzeppelin/contracts/math/SafeMath.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\\\";\\n\\nimport { Ownable as OwnableInitializable } from \\\"./Ownable.sol\\\";\\nimport \\\"./MathUtils.sol\\\";\\nimport \\\"./IGraphTokenLock.sol\\\";\\n\\n/**\\n * @title GraphTokenLock\\n * @notice Contract that manages an unlocking schedule of tokens.\\n * @dev The contract lock manage a number of tokens deposited into the contract to ensure that\\n * they can only be released under certain time conditions.\\n *\\n * This contract implements a release scheduled based on periods and tokens are released in steps\\n * after each period ends. It can be configured with one period in which case it is like a plain TimeLock.\\n * It also supports revocation to be used for vesting schedules.\\n *\\n * The contract supports receiving extra funds than the managed tokens ones that can be\\n * withdrawn by the beneficiary at any time.\\n *\\n * A releaseStartTime parameter is included to override the default release schedule and\\n * perform the first release on the configured time. After that it will continue with the\\n * default schedule.\\n */\\nabstract contract GraphTokenLock is OwnableInitializable, IGraphTokenLock {\\n using SafeMath for uint256;\\n using SafeERC20 for IERC20;\\n\\n uint256 private constant MIN_PERIOD = 1;\\n\\n // -- State --\\n\\n IERC20 public token;\\n address public beneficiary;\\n\\n // Configuration\\n\\n // Amount of tokens managed by the contract schedule\\n uint256 public managedAmount;\\n\\n uint256 public startTime; // Start datetime (in unixtimestamp)\\n uint256 public endTime; // Datetime after all funds are fully vested/unlocked (in unixtimestamp)\\n uint256 public periods; // Number of vesting/release periods\\n\\n // First release date for tokens (in unixtimestamp)\\n // If set, no tokens will be released before releaseStartTime ignoring\\n // the amount to release each period\\n uint256 public releaseStartTime;\\n // A cliff set a date to which a beneficiary needs to get to vest\\n // all preceding periods\\n uint256 public vestingCliffTime;\\n Revocability public revocable; // Whether to use vesting for locked funds\\n\\n // State\\n\\n bool public isRevoked;\\n bool public isInitialized;\\n bool public isAccepted;\\n uint256 public releasedAmount;\\n uint256 public revokedAmount;\\n\\n // -- Events --\\n\\n event TokensReleased(address indexed beneficiary, uint256 amount);\\n event TokensWithdrawn(address indexed beneficiary, uint256 amount);\\n event TokensRevoked(address indexed beneficiary, uint256 amount);\\n event BeneficiaryChanged(address newBeneficiary);\\n event LockAccepted();\\n event LockCanceled();\\n\\n /**\\n * @dev Only allow calls from the beneficiary of the contract\\n */\\n modifier onlyBeneficiary() {\\n require(msg.sender == beneficiary, \\\"!auth\\\");\\n _;\\n }\\n\\n /**\\n * @notice Initializes the contract\\n * @param _owner Address of the contract owner\\n * @param _beneficiary Address of the beneficiary of locked tokens\\n * @param _managedAmount Amount of tokens to be managed by the lock contract\\n * @param _startTime Start time of the release schedule\\n * @param _endTime End time of the release schedule\\n * @param _periods Number of periods between start time and end time\\n * @param _releaseStartTime Override time for when the releases start\\n * @param _vestingCliffTime Override time for when the vesting start\\n * @param _revocable Whether the contract is revocable\\n */\\n function _initialize(\\n address _owner,\\n address _beneficiary,\\n address _token,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n Revocability _revocable\\n ) internal {\\n require(!isInitialized, \\\"Already initialized\\\");\\n require(_owner != address(0), \\\"Owner cannot be zero\\\");\\n require(_beneficiary != address(0), \\\"Beneficiary cannot be zero\\\");\\n require(_token != address(0), \\\"Token cannot be zero\\\");\\n require(_managedAmount > 0, \\\"Managed tokens cannot be zero\\\");\\n require(_startTime != 0, \\\"Start time must be set\\\");\\n require(_startTime < _endTime, \\\"Start time > end time\\\");\\n require(_periods >= MIN_PERIOD, \\\"Periods cannot be below minimum\\\");\\n require(_revocable != Revocability.NotSet, \\\"Must set a revocability option\\\");\\n require(_releaseStartTime < _endTime, \\\"Release start time must be before end time\\\");\\n require(_vestingCliffTime < _endTime, \\\"Cliff time must be before end time\\\");\\n\\n isInitialized = true;\\n\\n OwnableInitializable._initialize(_owner);\\n beneficiary = _beneficiary;\\n token = IERC20(_token);\\n\\n managedAmount = _managedAmount;\\n\\n startTime = _startTime;\\n endTime = _endTime;\\n periods = _periods;\\n\\n // Optionals\\n releaseStartTime = _releaseStartTime;\\n vestingCliffTime = _vestingCliffTime;\\n revocable = _revocable;\\n }\\n\\n /**\\n * @notice Change the beneficiary of funds managed by the contract\\n * @dev Can only be called by the beneficiary\\n * @param _newBeneficiary Address of the new beneficiary address\\n */\\n function changeBeneficiary(address _newBeneficiary) external onlyBeneficiary {\\n require(_newBeneficiary != address(0), \\\"Empty beneficiary\\\");\\n beneficiary = _newBeneficiary;\\n emit BeneficiaryChanged(_newBeneficiary);\\n }\\n\\n /**\\n * @notice Beneficiary accepts the lock, the owner cannot retrieve back the tokens\\n * @dev Can only be called by the beneficiary\\n */\\n function acceptLock() external onlyBeneficiary {\\n isAccepted = true;\\n emit LockAccepted();\\n }\\n\\n /**\\n * @notice Owner cancel the lock and return the balance in the contract\\n * @dev Can only be called by the owner\\n */\\n function cancelLock() external onlyOwner {\\n require(isAccepted == false, \\\"Cannot cancel accepted contract\\\");\\n\\n token.safeTransfer(owner(), currentBalance());\\n\\n emit LockCanceled();\\n }\\n\\n // -- Balances --\\n\\n /**\\n * @notice Returns the amount of tokens currently held by the contract\\n * @return Tokens held in the contract\\n */\\n function currentBalance() public view override returns (uint256) {\\n return token.balanceOf(address(this));\\n }\\n\\n // -- Time & Periods --\\n\\n /**\\n * @notice Returns the current block timestamp\\n * @return Current block timestamp\\n */\\n function currentTime() public view override returns (uint256) {\\n return block.timestamp;\\n }\\n\\n /**\\n * @notice Gets duration of contract from start to end in seconds\\n * @return Amount of seconds from contract startTime to endTime\\n */\\n function duration() public view override returns (uint256) {\\n return endTime.sub(startTime);\\n }\\n\\n /**\\n * @notice Gets time elapsed since the start of the contract\\n * @dev Returns zero if called before conctract starTime\\n * @return Seconds elapsed from contract startTime\\n */\\n function sinceStartTime() public view override returns (uint256) {\\n uint256 current = currentTime();\\n if (current <= startTime) {\\n return 0;\\n }\\n return current.sub(startTime);\\n }\\n\\n /**\\n * @notice Returns amount available to be released after each period according to schedule\\n * @return Amount of tokens available after each period\\n */\\n function amountPerPeriod() public view override returns (uint256) {\\n return managedAmount.div(periods);\\n }\\n\\n /**\\n * @notice Returns the duration of each period in seconds\\n * @return Duration of each period in seconds\\n */\\n function periodDuration() public view override returns (uint256) {\\n return duration().div(periods);\\n }\\n\\n /**\\n * @notice Gets the current period based on the schedule\\n * @return A number that represents the current period\\n */\\n function currentPeriod() public view override returns (uint256) {\\n return sinceStartTime().div(periodDuration()).add(MIN_PERIOD);\\n }\\n\\n /**\\n * @notice Gets the number of periods that passed since the first period\\n * @return A number of periods that passed since the schedule started\\n */\\n function passedPeriods() public view override returns (uint256) {\\n return currentPeriod().sub(MIN_PERIOD);\\n }\\n\\n // -- Locking & Release Schedule --\\n\\n /**\\n * @notice Gets the currently available token according to the schedule\\n * @dev Implements the step-by-step schedule based on periods for available tokens\\n * @return Amount of tokens available according to the schedule\\n */\\n function availableAmount() public view override returns (uint256) {\\n uint256 current = currentTime();\\n\\n // Before contract start no funds are available\\n if (current < startTime) {\\n return 0;\\n }\\n\\n // After contract ended all funds are available\\n if (current > endTime) {\\n return managedAmount;\\n }\\n\\n // Get available amount based on period\\n return passedPeriods().mul(amountPerPeriod());\\n }\\n\\n /**\\n * @notice Gets the amount of currently vested tokens\\n * @dev Similar to available amount, but is fully vested when contract is non-revocable\\n * @return Amount of tokens already vested\\n */\\n function vestedAmount() public view override returns (uint256) {\\n // If non-revocable it is fully vested\\n if (revocable == Revocability.Disabled) {\\n return managedAmount;\\n }\\n\\n // Vesting cliff is activated and it has not passed means nothing is vested yet\\n if (vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\\n return 0;\\n }\\n\\n return availableAmount();\\n }\\n\\n /**\\n * @notice Gets tokens currently available for release\\n * @dev Considers the schedule and takes into account already released tokens\\n * @return Amount of tokens ready to be released\\n */\\n function releasableAmount() public view virtual override returns (uint256) {\\n // If a release start time is set no tokens are available for release before this date\\n // If not set it follows the default schedule and tokens are available on\\n // the first period passed\\n if (releaseStartTime > 0 && currentTime() < releaseStartTime) {\\n return 0;\\n }\\n\\n // Vesting cliff is activated and it has not passed means nothing is vested yet\\n // so funds cannot be released\\n if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\\n return 0;\\n }\\n\\n // A beneficiary can never have more releasable tokens than the contract balance\\n uint256 releasable = availableAmount().sub(releasedAmount);\\n return MathUtils.min(currentBalance(), releasable);\\n }\\n\\n /**\\n * @notice Gets the outstanding amount yet to be released based on the whole contract lifetime\\n * @dev Does not consider schedule but just global amounts tracked\\n * @return Amount of outstanding tokens for the lifetime of the contract\\n */\\n function totalOutstandingAmount() public view override returns (uint256) {\\n return managedAmount.sub(releasedAmount).sub(revokedAmount);\\n }\\n\\n /**\\n * @notice Gets surplus amount in the contract based on outstanding amount to release\\n * @dev All funds over outstanding amount is considered surplus that can be withdrawn by beneficiary.\\n * Note this might not be the correct value for wallets transferred to L2 (i.e. an L2GraphTokenLockWallet), as the released amount will be\\n * skewed, so the beneficiary might have to bridge back to L1 to release the surplus.\\n * @return Amount of tokens considered as surplus\\n */\\n function surplusAmount() public view override returns (uint256) {\\n uint256 balance = currentBalance();\\n uint256 outstandingAmount = totalOutstandingAmount();\\n if (balance > outstandingAmount) {\\n return balance.sub(outstandingAmount);\\n }\\n return 0;\\n }\\n\\n // -- Value Transfer --\\n\\n /**\\n * @notice Releases tokens based on the configured schedule\\n * @dev All available releasable tokens are transferred to beneficiary\\n */\\n function release() external override onlyBeneficiary {\\n uint256 amountToRelease = releasableAmount();\\n require(amountToRelease > 0, \\\"No available releasable amount\\\");\\n\\n releasedAmount = releasedAmount.add(amountToRelease);\\n\\n token.safeTransfer(beneficiary, amountToRelease);\\n\\n emit TokensReleased(beneficiary, amountToRelease);\\n }\\n\\n /**\\n * @notice Withdraws surplus, unmanaged tokens from the contract\\n * @dev Tokens in the contract over outstanding amount are considered as surplus\\n * @param _amount Amount of tokens to withdraw\\n */\\n function withdrawSurplus(uint256 _amount) external override onlyBeneficiary {\\n require(_amount > 0, \\\"Amount cannot be zero\\\");\\n require(surplusAmount() >= _amount, \\\"Amount requested > surplus available\\\");\\n\\n token.safeTransfer(beneficiary, _amount);\\n\\n emit TokensWithdrawn(beneficiary, _amount);\\n }\\n\\n /**\\n * @notice Revokes a vesting schedule and return the unvested tokens to the owner\\n * @dev Vesting schedule is always calculated based on managed tokens\\n */\\n function revoke() external override onlyOwner {\\n require(revocable == Revocability.Enabled, \\\"Contract is non-revocable\\\");\\n require(isRevoked == false, \\\"Already revoked\\\");\\n\\n uint256 unvestedAmount = managedAmount.sub(vestedAmount());\\n require(unvestedAmount > 0, \\\"No available unvested amount\\\");\\n\\n revokedAmount = unvestedAmount;\\n isRevoked = true;\\n\\n token.safeTransfer(owner(), unvestedAmount);\\n\\n emit TokensRevoked(beneficiary, unvestedAmount);\\n }\\n}\\n\",\"keccak256\":\"0xd89470956a476c2fcf4a09625775573f95ba2c60a57fe866d90f65de1bcf5f2d\",\"license\":\"MIT\"},\"contracts/GraphTokenLockManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/EnumerableSet.sol\\\";\\nimport { Ownable } from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\n\\nimport \\\"./MinimalProxyFactory.sol\\\";\\nimport \\\"./IGraphTokenLockManager.sol\\\";\\nimport { GraphTokenLockWallet } from \\\"./GraphTokenLockWallet.sol\\\";\\n\\n/**\\n * @title GraphTokenLockManager\\n * @notice This contract manages a list of authorized function calls and targets that can be called\\n * by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts.\\n *\\n * This contract receives funds to make the process of creating TokenLockWallet contracts\\n * easier by distributing them the initial tokens to be managed.\\n *\\n * The owner can setup a list of token destinations that will be used by TokenLock contracts to\\n * approve the pulling of funds, this way in can be guaranteed that only protocol contracts\\n * will manipulate users funds.\\n */\\ncontract GraphTokenLockManager is Ownable, MinimalProxyFactory, IGraphTokenLockManager {\\n using SafeERC20 for IERC20;\\n using EnumerableSet for EnumerableSet.AddressSet;\\n\\n // -- State --\\n\\n mapping(bytes4 => address) public authFnCalls;\\n EnumerableSet.AddressSet private _tokenDestinations;\\n\\n address public masterCopy;\\n IERC20 internal _token;\\n\\n // -- Events --\\n\\n event MasterCopyUpdated(address indexed masterCopy);\\n event TokenLockCreated(\\n address indexed contractAddress,\\n bytes32 indexed initHash,\\n address indexed beneficiary,\\n address token,\\n uint256 managedAmount,\\n uint256 startTime,\\n uint256 endTime,\\n uint256 periods,\\n uint256 releaseStartTime,\\n uint256 vestingCliffTime,\\n IGraphTokenLock.Revocability revocable\\n );\\n\\n event TokensDeposited(address indexed sender, uint256 amount);\\n event TokensWithdrawn(address indexed sender, uint256 amount);\\n\\n event FunctionCallAuth(address indexed caller, bytes4 indexed sigHash, address indexed target, string signature);\\n event TokenDestinationAllowed(address indexed dst, bool allowed);\\n\\n /**\\n * Constructor.\\n * @param _graphToken Token to use for deposits and withdrawals\\n * @param _masterCopy Address of the master copy to use to clone proxies\\n */\\n constructor(IERC20 _graphToken, address _masterCopy) {\\n require(address(_graphToken) != address(0), \\\"Token cannot be zero\\\");\\n _token = _graphToken;\\n setMasterCopy(_masterCopy);\\n }\\n\\n // -- Factory --\\n\\n /**\\n * @notice Sets the masterCopy bytecode to use to create clones of TokenLock contracts\\n * @param _masterCopy Address of contract bytecode to factory clone\\n */\\n function setMasterCopy(address _masterCopy) public override onlyOwner {\\n require(_masterCopy != address(0), \\\"MasterCopy cannot be zero\\\");\\n masterCopy = _masterCopy;\\n emit MasterCopyUpdated(_masterCopy);\\n }\\n\\n /**\\n * @notice Creates and fund a new token lock wallet using a minimum proxy\\n * @param _owner Address of the contract owner\\n * @param _beneficiary Address of the beneficiary of locked tokens\\n * @param _managedAmount Amount of tokens to be managed by the lock contract\\n * @param _startTime Start time of the release schedule\\n * @param _endTime End time of the release schedule\\n * @param _periods Number of periods between start time and end time\\n * @param _releaseStartTime Override time for when the releases start\\n * @param _revocable Whether the contract is revocable\\n */\\n function createTokenLockWallet(\\n address _owner,\\n address _beneficiary,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n IGraphTokenLock.Revocability _revocable\\n ) external override onlyOwner {\\n require(_token.balanceOf(address(this)) >= _managedAmount, \\\"Not enough tokens to create lock\\\");\\n\\n // Create contract using a minimal proxy and call initializer\\n bytes memory initializer = abi.encodeWithSelector(\\n GraphTokenLockWallet.initialize.selector,\\n address(this),\\n _owner,\\n _beneficiary,\\n address(_token),\\n _managedAmount,\\n _startTime,\\n _endTime,\\n _periods,\\n _releaseStartTime,\\n _vestingCliffTime,\\n _revocable\\n );\\n address contractAddress = _deployProxy2(keccak256(initializer), masterCopy, initializer);\\n\\n // Send managed amount to the created contract\\n _token.safeTransfer(contractAddress, _managedAmount);\\n\\n emit TokenLockCreated(\\n contractAddress,\\n keccak256(initializer),\\n _beneficiary,\\n address(_token),\\n _managedAmount,\\n _startTime,\\n _endTime,\\n _periods,\\n _releaseStartTime,\\n _vestingCliffTime,\\n _revocable\\n );\\n }\\n\\n // -- Funds Management --\\n\\n /**\\n * @notice Gets the GRT token address\\n * @return Token used for transfers and approvals\\n */\\n function token() external view override returns (IERC20) {\\n return _token;\\n }\\n\\n /**\\n * @notice Deposits tokens into the contract\\n * @dev Even if the ERC20 token can be transferred directly to the contract\\n * this function provide a safe interface to do the transfer and avoid mistakes\\n * @param _amount Amount to deposit\\n */\\n function deposit(uint256 _amount) external override {\\n require(_amount > 0, \\\"Amount cannot be zero\\\");\\n _token.safeTransferFrom(msg.sender, address(this), _amount);\\n emit TokensDeposited(msg.sender, _amount);\\n }\\n\\n /**\\n * @notice Withdraws tokens from the contract\\n * @dev Escape hatch in case of mistakes or to recover remaining funds\\n * @param _amount Amount of tokens to withdraw\\n */\\n function withdraw(uint256 _amount) external override onlyOwner {\\n require(_amount > 0, \\\"Amount cannot be zero\\\");\\n _token.safeTransfer(msg.sender, _amount);\\n emit TokensWithdrawn(msg.sender, _amount);\\n }\\n\\n // -- Token Destinations --\\n\\n /**\\n * @notice Adds an address that can be allowed by a token lock to pull funds\\n * @param _dst Destination address\\n */\\n function addTokenDestination(address _dst) external override onlyOwner {\\n require(_dst != address(0), \\\"Destination cannot be zero\\\");\\n require(_tokenDestinations.add(_dst), \\\"Destination already added\\\");\\n emit TokenDestinationAllowed(_dst, true);\\n }\\n\\n /**\\n * @notice Removes an address that can be allowed by a token lock to pull funds\\n * @param _dst Destination address\\n */\\n function removeTokenDestination(address _dst) external override onlyOwner {\\n require(_tokenDestinations.remove(_dst), \\\"Destination already removed\\\");\\n emit TokenDestinationAllowed(_dst, false);\\n }\\n\\n /**\\n * @notice Returns True if the address is authorized to be a destination of tokens\\n * @param _dst Destination address\\n * @return True if authorized\\n */\\n function isTokenDestination(address _dst) external view override returns (bool) {\\n return _tokenDestinations.contains(_dst);\\n }\\n\\n /**\\n * @notice Returns an array of authorized destination addresses\\n * @return Array of addresses authorized to pull funds from a token lock\\n */\\n function getTokenDestinations() external view override returns (address[] memory) {\\n address[] memory dstList = new address[](_tokenDestinations.length());\\n for (uint256 i = 0; i < _tokenDestinations.length(); i++) {\\n dstList[i] = _tokenDestinations.at(i);\\n }\\n return dstList;\\n }\\n\\n // -- Function Call Authorization --\\n\\n /**\\n * @notice Sets an authorized function call to target\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @param _signature Function signature\\n * @param _target Address of the destination contract to call\\n */\\n function setAuthFunctionCall(string calldata _signature, address _target) external override onlyOwner {\\n _setAuthFunctionCall(_signature, _target);\\n }\\n\\n /**\\n * @notice Unsets an authorized function call to target\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @param _signature Function signature\\n */\\n function unsetAuthFunctionCall(string calldata _signature) external override onlyOwner {\\n bytes4 sigHash = _toFunctionSigHash(_signature);\\n authFnCalls[sigHash] = address(0);\\n\\n emit FunctionCallAuth(msg.sender, sigHash, address(0), _signature);\\n }\\n\\n /**\\n * @notice Sets an authorized function call to target in bulk\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @param _signatures Function signatures\\n * @param _targets Address of the destination contract to call\\n */\\n function setAuthFunctionCallMany(\\n string[] calldata _signatures,\\n address[] calldata _targets\\n ) external override onlyOwner {\\n require(_signatures.length == _targets.length, \\\"Array length mismatch\\\");\\n\\n for (uint256 i = 0; i < _signatures.length; i++) {\\n _setAuthFunctionCall(_signatures[i], _targets[i]);\\n }\\n }\\n\\n /**\\n * @notice Sets an authorized function call to target\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @dev Function signatures of Graph Protocol contracts to be used are known ahead of time\\n * @param _signature Function signature\\n * @param _target Address of the destination contract to call\\n */\\n function _setAuthFunctionCall(string calldata _signature, address _target) internal {\\n require(_target != address(this), \\\"Target must be other contract\\\");\\n require(Address.isContract(_target), \\\"Target must be a contract\\\");\\n\\n bytes4 sigHash = _toFunctionSigHash(_signature);\\n authFnCalls[sigHash] = _target;\\n\\n emit FunctionCallAuth(msg.sender, sigHash, _target, _signature);\\n }\\n\\n /**\\n * @notice Gets the target contract to call for a particular function signature\\n * @param _sigHash Function signature hash\\n * @return Address of the target contract where to send the call\\n */\\n function getAuthFunctionCallTarget(bytes4 _sigHash) public view override returns (address) {\\n return authFnCalls[_sigHash];\\n }\\n\\n /**\\n * @notice Returns true if the function call is authorized\\n * @param _sigHash Function signature hash\\n * @return True if authorized\\n */\\n function isAuthFunctionCall(bytes4 _sigHash) external view override returns (bool) {\\n return getAuthFunctionCallTarget(_sigHash) != address(0);\\n }\\n\\n /**\\n * @dev Converts a function signature string to 4-bytes hash\\n * @param _signature Function signature string\\n * @return Function signature hash\\n */\\n function _toFunctionSigHash(string calldata _signature) internal pure returns (bytes4) {\\n return _convertToBytes4(abi.encodeWithSignature(_signature));\\n }\\n\\n /**\\n * @dev Converts function signature bytes to function signature hash (bytes4)\\n * @param _signature Function signature\\n * @return Function signature in bytes4\\n */\\n function _convertToBytes4(bytes memory _signature) internal pure returns (bytes4) {\\n require(_signature.length == 4, \\\"Invalid method signature\\\");\\n bytes4 sigHash;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n sigHash := mload(add(_signature, 32))\\n }\\n return sigHash;\\n }\\n}\\n\",\"keccak256\":\"0x2bb51cc1a18bd88113fd6947067ad2fff33048c8904cb54adfda8e2ab86752f2\",\"license\":\"MIT\"},\"contracts/GraphTokenLockWallet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"@openzeppelin/contracts/math/SafeMath.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nimport \\\"./GraphTokenLock.sol\\\";\\nimport \\\"./IGraphTokenLockManager.sol\\\";\\n\\n/**\\n * @title GraphTokenLockWallet\\n * @notice This contract is built on top of the base GraphTokenLock functionality.\\n * It allows wallet beneficiaries to use the deposited funds to perform specific function calls\\n * on specific contracts.\\n *\\n * The idea is that supporters with locked tokens can participate in the protocol\\n * but disallow any release before the vesting/lock schedule.\\n * The beneficiary can issue authorized function calls to this contract that will\\n * get forwarded to a target contract. A target contract is any of our protocol contracts.\\n * The function calls allowed are queried to the GraphTokenLockManager, this way\\n * the same configuration can be shared for all the created lock wallet contracts.\\n *\\n * NOTE: Contracts used as target must have its function signatures checked to avoid collisions\\n * with any of this contract functions.\\n * Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience\\n * the maximum amount of tokens is authorized.\\n * Function calls do not forward ETH value so DO NOT SEND ETH TO THIS CONTRACT.\\n */\\ncontract GraphTokenLockWallet is GraphTokenLock {\\n using SafeMath for uint256;\\n\\n // -- State --\\n\\n IGraphTokenLockManager public manager;\\n uint256 public usedAmount;\\n\\n // -- Events --\\n\\n event ManagerUpdated(address indexed _oldManager, address indexed _newManager);\\n event TokenDestinationsApproved();\\n event TokenDestinationsRevoked();\\n\\n // Initializer\\n function initialize(\\n address _manager,\\n address _owner,\\n address _beneficiary,\\n address _token,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n Revocability _revocable\\n ) external {\\n _initialize(\\n _owner,\\n _beneficiary,\\n _token,\\n _managedAmount,\\n _startTime,\\n _endTime,\\n _periods,\\n _releaseStartTime,\\n _vestingCliffTime,\\n _revocable\\n );\\n _setManager(_manager);\\n }\\n\\n // -- Admin --\\n\\n /**\\n * @notice Sets a new manager for this contract\\n * @param _newManager Address of the new manager\\n */\\n function setManager(address _newManager) external onlyOwner {\\n _setManager(_newManager);\\n }\\n\\n /**\\n * @dev Sets a new manager for this contract\\n * @param _newManager Address of the new manager\\n */\\n function _setManager(address _newManager) internal {\\n require(_newManager != address(0), \\\"Manager cannot be empty\\\");\\n require(Address.isContract(_newManager), \\\"Manager must be a contract\\\");\\n\\n address oldManager = address(manager);\\n manager = IGraphTokenLockManager(_newManager);\\n\\n emit ManagerUpdated(oldManager, _newManager);\\n }\\n\\n // -- Beneficiary --\\n\\n /**\\n * @notice Approves protocol access of the tokens managed by this contract\\n * @dev Approves all token destinations registered in the manager to pull tokens\\n */\\n function approveProtocol() external onlyBeneficiary {\\n address[] memory dstList = manager.getTokenDestinations();\\n for (uint256 i = 0; i < dstList.length; i++) {\\n // Note this is only safe because we are using the max uint256 value\\n token.approve(dstList[i], type(uint256).max);\\n }\\n emit TokenDestinationsApproved();\\n }\\n\\n /**\\n * @notice Revokes protocol access of the tokens managed by this contract\\n * @dev Revokes approval to all token destinations in the manager to pull tokens\\n */\\n function revokeProtocol() external onlyBeneficiary {\\n address[] memory dstList = manager.getTokenDestinations();\\n for (uint256 i = 0; i < dstList.length; i++) {\\n // Note this is only safe cause we're using 0 as the amount\\n token.approve(dstList[i], 0);\\n }\\n emit TokenDestinationsRevoked();\\n }\\n\\n /**\\n * @notice Gets tokens currently available for release\\n * @dev Considers the schedule, takes into account already released tokens and used amount\\n * @return Amount of tokens ready to be released\\n */\\n function releasableAmount() public view override returns (uint256) {\\n if (revocable == Revocability.Disabled) {\\n return super.releasableAmount();\\n }\\n\\n // -- Revocability enabled logic\\n // This needs to deal with additional considerations for when tokens are used in the protocol\\n\\n // If a release start time is set no tokens are available for release before this date\\n // If not set it follows the default schedule and tokens are available on\\n // the first period passed\\n if (releaseStartTime > 0 && currentTime() < releaseStartTime) {\\n return 0;\\n }\\n\\n // Vesting cliff is activated and it has not passed means nothing is vested yet\\n // so funds cannot be released\\n if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\\n return 0;\\n }\\n\\n // A beneficiary can never have more releasable tokens than the contract balance\\n // We consider the `usedAmount` in the protocol as part of the calculations\\n // the beneficiary should not release funds that are used.\\n uint256 releasable = availableAmount().sub(releasedAmount).sub(usedAmount);\\n return MathUtils.min(currentBalance(), releasable);\\n }\\n\\n /**\\n * @notice Forward authorized contract calls to protocol contracts\\n * @dev Fallback function can be called by the beneficiary only if function call is allowed\\n */\\n // solhint-disable-next-line no-complex-fallback\\n fallback() external payable {\\n // Only beneficiary can forward calls\\n require(msg.sender == beneficiary, \\\"Unauthorized caller\\\");\\n require(msg.value == 0, \\\"ETH transfers not supported\\\");\\n\\n // Function call validation\\n address _target = manager.getAuthFunctionCallTarget(msg.sig);\\n require(_target != address(0), \\\"Unauthorized function\\\");\\n\\n uint256 oldBalance = currentBalance();\\n\\n // Call function with data\\n Address.functionCall(_target, msg.data);\\n\\n // Tracked used tokens in the protocol\\n // We do this check after balances were updated by the forwarded call\\n // Check is only enforced for revocable contracts to save some gas\\n if (revocable == Revocability.Enabled) {\\n // Track contract balance change\\n uint256 newBalance = currentBalance();\\n if (newBalance < oldBalance) {\\n // Outflow\\n uint256 diff = oldBalance.sub(newBalance);\\n usedAmount = usedAmount.add(diff);\\n } else {\\n // Inflow: We can receive profits from the protocol, that could make usedAmount to\\n // underflow. We set it to zero in that case.\\n uint256 diff = newBalance.sub(oldBalance);\\n usedAmount = (diff >= usedAmount) ? 0 : usedAmount.sub(diff);\\n }\\n require(usedAmount <= vestedAmount(), \\\"Cannot use more tokens than vested amount\\\");\\n }\\n }\\n\\n /**\\n * @notice Receive function that always reverts.\\n * @dev Only included to supress warnings, see https://github.com/ethereum/solidity/issues/10159\\n */\\n receive() external payable {\\n revert(\\\"Bad call\\\");\\n }\\n}\\n\",\"keccak256\":\"0x976c2ba4c1503a81ea02bd84539c516e99af611ff767968ee25456b50a6deb7b\",\"license\":\"MIT\"},\"contracts/ICallhookReceiver.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\n\\n// Copied from graphprotocol/contracts, changed solidity version to 0.7.3\\n\\n/**\\n * @title Interface for contracts that can receive callhooks through the Arbitrum GRT bridge\\n * @dev Any contract that can receive a callhook on L2, sent through the bridge from L1, must\\n * be allowlisted by the governor, but also implement this interface that contains\\n * the function that will actually be called by the L2GraphTokenGateway.\\n */\\npragma solidity ^0.7.3;\\n\\ninterface ICallhookReceiver {\\n /**\\n * @notice Receive tokens with a callhook from the bridge\\n * @param _from Token sender in L1\\n * @param _amount Amount of tokens that were transferred\\n * @param _data ABI-encoded callhook data\\n */\\n function onTokenTransfer(address _from, uint256 _amount, bytes calldata _data) external;\\n}\\n\",\"keccak256\":\"0xb90eae14e8bac012a4b99fabe7a1110f70143eb78476ea0d6b52557ef979fa0e\",\"license\":\"GPL-2.0-or-later\"},\"contracts/IGraphTokenLock.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\ninterface IGraphTokenLock {\\n enum Revocability {\\n NotSet,\\n Enabled,\\n Disabled\\n }\\n\\n // -- Balances --\\n\\n function currentBalance() external view returns (uint256);\\n\\n // -- Time & Periods --\\n\\n function currentTime() external view returns (uint256);\\n\\n function duration() external view returns (uint256);\\n\\n function sinceStartTime() external view returns (uint256);\\n\\n function amountPerPeriod() external view returns (uint256);\\n\\n function periodDuration() external view returns (uint256);\\n\\n function currentPeriod() external view returns (uint256);\\n\\n function passedPeriods() external view returns (uint256);\\n\\n // -- Locking & Release Schedule --\\n\\n function availableAmount() external view returns (uint256);\\n\\n function vestedAmount() external view returns (uint256);\\n\\n function releasableAmount() external view returns (uint256);\\n\\n function totalOutstandingAmount() external view returns (uint256);\\n\\n function surplusAmount() external view returns (uint256);\\n\\n // -- Value Transfer --\\n\\n function release() external;\\n\\n function withdrawSurplus(uint256 _amount) external;\\n\\n function revoke() external;\\n}\\n\",\"keccak256\":\"0xceb9d258276fe25ec858191e1deae5778f1b2f612a669fb7b37bab1a064756ab\",\"license\":\"MIT\"},\"contracts/IGraphTokenLockManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nimport \\\"./IGraphTokenLock.sol\\\";\\n\\ninterface IGraphTokenLockManager {\\n // -- Factory --\\n\\n function setMasterCopy(address _masterCopy) external;\\n\\n function createTokenLockWallet(\\n address _owner,\\n address _beneficiary,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n IGraphTokenLock.Revocability _revocable\\n ) external;\\n\\n // -- Funds Management --\\n\\n function token() external returns (IERC20);\\n\\n function deposit(uint256 _amount) external;\\n\\n function withdraw(uint256 _amount) external;\\n\\n // -- Allowed Funds Destinations --\\n\\n function addTokenDestination(address _dst) external;\\n\\n function removeTokenDestination(address _dst) external;\\n\\n function isTokenDestination(address _dst) external view returns (bool);\\n\\n function getTokenDestinations() external view returns (address[] memory);\\n\\n // -- Function Call Authorization --\\n\\n function setAuthFunctionCall(string calldata _signature, address _target) external;\\n\\n function unsetAuthFunctionCall(string calldata _signature) external;\\n\\n function setAuthFunctionCallMany(string[] calldata _signatures, address[] calldata _targets) external;\\n\\n function getAuthFunctionCallTarget(bytes4 _sigHash) external view returns (address);\\n\\n function isAuthFunctionCall(bytes4 _sigHash) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x2d78d41909a6de5b316ac39b100ea087a8f317cf306379888a045523e15c4d9a\",\"license\":\"MIT\"},\"contracts/L2GraphTokenLockManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport { SafeERC20 } from \\\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\\\";\\n\\nimport { ICallhookReceiver } from \\\"./ICallhookReceiver.sol\\\";\\nimport { GraphTokenLockManager } from \\\"./GraphTokenLockManager.sol\\\";\\nimport { L2GraphTokenLockWallet } from \\\"./L2GraphTokenLockWallet.sol\\\";\\n\\n/**\\n * @title L2GraphTokenLockManager\\n * @notice This contract manages a list of authorized function calls and targets that can be called\\n * by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts.\\n *\\n * This contract receives funds to make the process of creating TokenLockWallet contracts\\n * easier by distributing them the initial tokens to be managed.\\n *\\n * In particular, this L2 variant is designed to receive token lock wallets from L1,\\n * through the GRT bridge. These transferred wallets will not allow releasing funds in L2 until\\n * the end of the vesting timeline, but they can allow withdrawing funds back to L1 using\\n * the L2GraphTokenLockTransferTool contract.\\n *\\n * The owner can setup a list of token destinations that will be used by TokenLock contracts to\\n * approve the pulling of funds, this way in can be guaranteed that only protocol contracts\\n * will manipulate users funds.\\n */\\ncontract L2GraphTokenLockManager is GraphTokenLockManager, ICallhookReceiver {\\n using SafeERC20 for IERC20;\\n\\n /// @dev Struct to hold the data of a transferred wallet; this is\\n /// the data that must be encoded in L1 to send a wallet to L2.\\n struct TransferredWalletData {\\n address l1Address;\\n address owner;\\n address beneficiary;\\n uint256 managedAmount;\\n uint256 startTime;\\n uint256 endTime;\\n }\\n\\n /// Address of the L2GraphTokenGateway\\n address public immutable l2Gateway;\\n /// Address of the L1 transfer tool contract (in L1, no aliasing)\\n address public immutable l1TransferTool;\\n /// Mapping of each L1 wallet to its L2 wallet counterpart (populated when each wallet is received)\\n /// L1 address => L2 address\\n mapping(address => address) public l1WalletToL2Wallet;\\n /// Mapping of each L2 wallet to its L1 wallet counterpart (populated when each wallet is received)\\n /// L2 address => L1 address\\n mapping(address => address) public l2WalletToL1Wallet;\\n\\n /// @dev Event emitted when a wallet is received and created from L1\\n event TokenLockCreatedFromL1(\\n address indexed contractAddress,\\n bytes32 initHash,\\n address indexed beneficiary,\\n uint256 managedAmount,\\n uint256 startTime,\\n uint256 endTime,\\n address indexed l1Address\\n );\\n\\n /// @dev Emitted when locked tokens are received from L1 (whether the wallet\\n /// had already been received or not)\\n event LockedTokensReceivedFromL1(address indexed l1Address, address indexed l2Address, uint256 amount);\\n\\n /**\\n * @dev Checks that the sender is the L2GraphTokenGateway.\\n */\\n modifier onlyL2Gateway() {\\n require(msg.sender == l2Gateway, \\\"ONLY_GATEWAY\\\");\\n _;\\n }\\n\\n /**\\n * @notice Constructor for the L2GraphTokenLockManager contract.\\n * @param _graphToken Address of the L2 GRT token contract\\n * @param _masterCopy Address of the master copy of the L2GraphTokenLockWallet implementation\\n * @param _l2Gateway Address of the L2GraphTokenGateway contract\\n * @param _l1TransferTool Address of the L1 transfer tool contract (in L1, without aliasing)\\n */\\n constructor(\\n IERC20 _graphToken,\\n address _masterCopy,\\n address _l2Gateway,\\n address _l1TransferTool\\n ) GraphTokenLockManager(_graphToken, _masterCopy) {\\n l2Gateway = _l2Gateway;\\n l1TransferTool = _l1TransferTool;\\n }\\n\\n /**\\n * @notice This function is called by the L2GraphTokenGateway when tokens are sent from L1.\\n * @dev This function will create a new wallet if it doesn't exist yet, or send the tokens to\\n * the existing wallet if it does.\\n * @param _from Address of the sender in L1, which must be the L1GraphTokenLockTransferTool\\n * @param _amount Amount of tokens received\\n * @param _data Encoded data of the transferred wallet, which must be an ABI-encoded TransferredWalletData struct\\n */\\n function onTokenTransfer(address _from, uint256 _amount, bytes calldata _data) external override onlyL2Gateway {\\n require(_from == l1TransferTool, \\\"ONLY_TRANSFER_TOOL\\\");\\n TransferredWalletData memory walletData = abi.decode(_data, (TransferredWalletData));\\n\\n if (l1WalletToL2Wallet[walletData.l1Address] != address(0)) {\\n // If the wallet was already received, just send the tokens to the L2 address\\n _token.safeTransfer(l1WalletToL2Wallet[walletData.l1Address], _amount);\\n } else {\\n // Create contract using a minimal proxy and call initializer\\n (bytes32 initHash, address contractAddress) = _deployFromL1(keccak256(_data), walletData);\\n l1WalletToL2Wallet[walletData.l1Address] = contractAddress;\\n l2WalletToL1Wallet[contractAddress] = walletData.l1Address;\\n\\n // Send managed amount to the created contract\\n _token.safeTransfer(contractAddress, _amount);\\n\\n emit TokenLockCreatedFromL1(\\n contractAddress,\\n initHash,\\n walletData.beneficiary,\\n walletData.managedAmount,\\n walletData.startTime,\\n walletData.endTime,\\n walletData.l1Address\\n );\\n }\\n emit LockedTokensReceivedFromL1(walletData.l1Address, l1WalletToL2Wallet[walletData.l1Address], _amount);\\n }\\n\\n /**\\n * @dev Deploy a token lock wallet with data received from L1\\n * @param _salt Salt for the CREATE2 call, which must be the hash of the wallet data\\n * @param _walletData Data of the wallet to be created\\n * @return Hash of the initialization calldata\\n * @return Address of the created contract\\n */\\n function _deployFromL1(bytes32 _salt, TransferredWalletData memory _walletData) internal returns (bytes32, address) {\\n bytes memory initializer = _encodeInitializer(_walletData);\\n address contractAddress = _deployProxy2(_salt, masterCopy, initializer);\\n return (keccak256(initializer), contractAddress);\\n }\\n\\n /**\\n * @dev Encode the initializer for the token lock wallet received from L1\\n * @param _walletData Data of the wallet to be created\\n * @return Encoded initializer calldata, including the function signature\\n */\\n function _encodeInitializer(TransferredWalletData memory _walletData) internal view returns (bytes memory) {\\n return\\n abi.encodeWithSelector(\\n L2GraphTokenLockWallet.initializeFromL1.selector,\\n address(this),\\n address(_token),\\n _walletData\\n );\\n }\\n}\\n\",\"keccak256\":\"0x34ca0ffc898ce3615a000d53a9c58708354b8cd8093b3c61decfe7388f0c16e0\",\"license\":\"MIT\"},\"contracts/L2GraphTokenLockWallet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nimport { GraphTokenLockWallet } from \\\"./GraphTokenLockWallet.sol\\\";\\nimport { Ownable as OwnableInitializable } from \\\"./Ownable.sol\\\";\\nimport { L2GraphTokenLockManager } from \\\"./L2GraphTokenLockManager.sol\\\";\\n\\n/**\\n * @title L2GraphTokenLockWallet\\n * @notice This contract is built on top of the base GraphTokenLock functionality.\\n * It allows wallet beneficiaries to use the deposited funds to perform specific function calls\\n * on specific contracts.\\n *\\n * The idea is that supporters with locked tokens can participate in the protocol\\n * but disallow any release before the vesting/lock schedule.\\n * The beneficiary can issue authorized function calls to this contract that will\\n * get forwarded to a target contract. A target contract is any of our protocol contracts.\\n * The function calls allowed are queried to the GraphTokenLockManager, this way\\n * the same configuration can be shared for all the created lock wallet contracts.\\n *\\n * This L2 variant includes a special initializer so that it can be created from\\n * a wallet's data received from L1. These transferred wallets will not allow releasing\\n * funds in L2 until the end of the vesting timeline, but they can allow withdrawing\\n * funds back to L1 using the L2GraphTokenLockTransferTool contract.\\n *\\n * Note that surplusAmount and releasedAmount in L2 will be skewed for wallets received from L1,\\n * so releasing surplus tokens might also only be possible by bridging tokens back to L1.\\n *\\n * NOTE: Contracts used as target must have its function signatures checked to avoid collisions\\n * with any of this contract functions.\\n * Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience\\n * the maximum amount of tokens is authorized.\\n * Function calls do not forward ETH value so DO NOT SEND ETH TO THIS CONTRACT.\\n */\\ncontract L2GraphTokenLockWallet is GraphTokenLockWallet {\\n // Initializer when created from a message from L1\\n function initializeFromL1(\\n address _manager,\\n address _token,\\n L2GraphTokenLockManager.TransferredWalletData calldata _walletData\\n ) external {\\n require(!isInitialized, \\\"Already initialized\\\");\\n isInitialized = true;\\n\\n OwnableInitializable._initialize(_walletData.owner);\\n beneficiary = _walletData.beneficiary;\\n token = IERC20(_token);\\n\\n managedAmount = _walletData.managedAmount;\\n\\n startTime = _walletData.startTime;\\n endTime = _walletData.endTime;\\n periods = 1;\\n isAccepted = true;\\n\\n // Optionals\\n releaseStartTime = _walletData.endTime;\\n revocable = Revocability.Disabled;\\n\\n _setManager(_manager);\\n }\\n}\\n\",\"keccak256\":\"0x8842140c2c7924be4ab1bca71e0b0ad6dd1dba6433cfdc523bfd204288b25d20\",\"license\":\"MIT\"},\"contracts/MathUtils.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nlibrary MathUtils {\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n}\\n\",\"keccak256\":\"0xe2512e1da48bc8363acd15f66229564b02d66706665d7da740604566913c1400\",\"license\":\"MIT\"},\"contracts/MinimalProxyFactory.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nimport { Address } from \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport { Create2 } from \\\"@openzeppelin/contracts/utils/Create2.sol\\\";\\n\\n/**\\n * @title MinimalProxyFactory: a factory contract for creating minimal proxies\\n * @notice Adapted from https://github.com/OpenZeppelin/openzeppelin-sdk/blob/v2.5.0/packages/lib/contracts/upgradeability/ProxyFactory.sol\\n * Based on https://eips.ethereum.org/EIPS/eip-1167\\n */\\ncontract MinimalProxyFactory {\\n /// @dev Emitted when a new proxy is created\\n event ProxyCreated(address indexed proxy);\\n\\n /**\\n * @notice Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation\\n * @param _salt Bytes32 salt to use for CREATE2\\n * @param _implementation Address of the proxy target implementation\\n * @param _deployer Address of the deployer that creates the contract\\n * @return Address of the counterfactual MinimalProxy\\n */\\n function getDeploymentAddress(\\n bytes32 _salt,\\n address _implementation,\\n address _deployer\\n ) public pure returns (address) {\\n return Create2.computeAddress(_salt, keccak256(_getContractCreationCode(_implementation)), _deployer);\\n }\\n\\n /**\\n * @dev Deploys a MinimalProxy with CREATE2\\n * @param _salt Bytes32 salt to use for CREATE2\\n * @param _implementation Address of the proxy target implementation\\n * @param _data Bytes with the initializer call\\n * @return Address of the deployed MinimalProxy\\n */\\n function _deployProxy2(bytes32 _salt, address _implementation, bytes memory _data) internal returns (address) {\\n address proxyAddress = Create2.deploy(0, _salt, _getContractCreationCode(_implementation));\\n\\n emit ProxyCreated(proxyAddress);\\n\\n // Call function with data\\n if (_data.length > 0) {\\n Address.functionCall(proxyAddress, _data);\\n }\\n\\n return proxyAddress;\\n }\\n\\n /**\\n * @dev Gets the MinimalProxy bytecode\\n * @param _implementation Address of the proxy target implementation\\n * @return MinimalProxy bytecode\\n */\\n function _getContractCreationCode(address _implementation) internal pure returns (bytes memory) {\\n bytes10 creation = 0x3d602d80600a3d3981f3;\\n bytes10 prefix = 0x363d3d373d3d3d363d73;\\n bytes20 targetBytes = bytes20(_implementation);\\n bytes15 suffix = 0x5af43d82803e903d91602b57fd5bf3;\\n return abi.encodePacked(creation, prefix, targetBytes, suffix);\\n }\\n}\\n\",\"keccak256\":\"0x67d67a567bceb363ddb199b1e4ab06e7a99f16e034e03086971a332c09ec5c0e\",\"license\":\"MIT\"},\"contracts/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * The owner account will be passed on initialization of the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\ncontract Ownable {\\n /// @dev Owner of the contract, can be retrieved with the public owner() function\\n address private _owner;\\n /// @dev Since upgradeable contracts might inherit this, we add a storage gap\\n /// to allow adding variables here without breaking the proxy storage layout\\n uint256[50] private __gap;\\n\\n /// @dev Emitted when ownership of the contract is transferred\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n function _initialize(address owner) internal {\\n _owner = owner;\\n emit OwnershipTransferred(address(0), owner);\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(_owner == msg.sender, \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() external virtual onlyOwner {\\n emit OwnershipTransferred(_owner, address(0));\\n _owner = address(0);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) external virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n emit OwnershipTransferred(_owner, newOwner);\\n _owner = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0xe8750687082e8e24b620dbf58c3a08eee591ed7b4d5a3e13cc93554ec647fd09\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60c06040523480156200001157600080fd5b506040516200499938038062004999833981810160405281019062000037919062000410565b838360006200004b6200022860201b60201c565b9050806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a350600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156200015c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620001539062000586565b60405180910390fd5b81600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550620001ae816200023060201b60201c565b50508173ffffffffffffffffffffffffffffffffffffffff1660808173ffffffffffffffffffffffffffffffffffffffff1660601b815250508073ffffffffffffffffffffffffffffffffffffffff1660a08173ffffffffffffffffffffffffffffffffffffffff1660601b815250505050505062000635565b600033905090565b620002406200022860201b60201c565b73ffffffffffffffffffffffffffffffffffffffff1662000266620003b960201b60201c565b73ffffffffffffffffffffffffffffffffffffffff1614620002bf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620002b69062000564565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141562000332576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620003299062000542565b60405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167f30909084afc859121ffc3a5aef7fe37c540a9a1ef60bd4d8dcdb76376fadf9de60405160405180910390a250565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600081519050620003f38162000601565b92915050565b6000815190506200040a816200061b565b92915050565b600080600080608085870312156200042757600080fd5b60006200043787828801620003f9565b94505060206200044a87828801620003e2565b93505060406200045d87828801620003e2565b92505060606200047087828801620003e2565b91505092959194509250565b60006200048b601983620005a8565b91507f4d6173746572436f70792063616e6e6f74206265207a65726f000000000000006000830152602082019050919050565b6000620004cd602083620005a8565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b60006200050f601483620005a8565b91507f546f6b656e2063616e6e6f74206265207a65726f0000000000000000000000006000830152602082019050919050565b600060208201905081810360008301526200055d816200047c565b9050919050565b600060208201905081810360008301526200057f81620004be565b9050919050565b60006020820190508181036000830152620005a18162000500565b9050919050565b600082825260208201905092915050565b6000620005c682620005e1565b9050919050565b6000620005da82620005b9565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6200060c81620005b9565b81146200061857600080fd5b50565b6200062681620005cd565b81146200063257600080fd5b50565b60805160601c60a05160601c61433062000669600039806109195280611280525080610fc952806111f252506143306000f3fe608060405234801561001057600080fd5b50600436106101735760003560e01c806379ee1bdf116100de578063a619486e11610097578063cf497e6c11610071578063cf497e6c14610434578063f1d24c4514610450578063f2fde38b14610480578063fc0c546a1461049c57610173565b8063a619486e146103de578063b6b55f25146103fc578063c1ab13db1461041857610173565b806379ee1bdf1461031c5780638da5cb5b1461034c5780638fa74a0e1461036a5780639c05fc6014610388578063a3457466146103a4578063a4c0ed36146103c257610173565b8063463013a211610130578063463013a214610270578063586a53531461028c5780635975e00c146102aa57806368d30c2e146102c65780636e03b8dc146102e2578063715018a61461031257610173565b806303990a6c14610178578063045b7fe2146101945780630602ba2b146101c45780630cd6178f146101f45780632e1a7d4d1461022457806343fb93d914610240575b600080fd5b610192600480360381019061018d9190612f13565b6104ba565b005b6101ae60048036038101906101a99190612ca2565b610662565b6040516101bb91906139bc565b60405180910390f35b6101de60048036038101906101d99190612eea565b610695565b6040516101eb9190613bba565b60405180910390f35b61020e60048036038101906102099190612ca2565b6106d6565b60405161021b91906139bc565b60405180910390f35b61023e60048036038101906102399190612fd9565b610709565b005b61025a60048036038101906102559190612e9b565b610866565b60405161026791906139bc565b60405180910390f35b61028a60048036038101906102859190612f58565b61088b565b005b610294610917565b6040516102a191906139bc565b60405180910390f35b6102c460048036038101906102bf9190612ca2565b61093b565b005b6102e060048036038101906102db9190612ccb565b610acc565b005b6102fc60048036038101906102f79190612eea565b610e14565b60405161030991906139bc565b60405180910390f35b61031a610e47565b005b61033660048036038101906103319190612ca2565b610f81565b6040516103439190613bba565b60405180910390f35b610354610f9e565b60405161036191906139bc565b60405180910390f35b610372610fc7565b60405161037f91906139bc565b60405180910390f35b6103a2600480360381019061039d9190612dfd565b610feb565b005b6103ac611118565b6040516103b99190613b98565b60405180910390f35b6103dc60048036038101906103d79190612d91565b6111f0565b005b6103e6611756565b6040516103f391906139bc565b60405180910390f35b61041660048036038101906104119190612fd9565b61177c565b005b610432600480360381019061042d9190612ca2565b61185f565b005b61044e60048036038101906104499190612ca2565b611980565b005b61046a60048036038101906104659190612eea565b611af3565b60405161047791906139bc565b60405180910390f35b61049a60048036038101906104959190612ca2565b611b6e565b005b6104a4611d17565b6040516104b19190613c1a565b60405180910390f35b6104c2611d41565b73ffffffffffffffffffffffffffffffffffffffff166104e0610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614610536576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161052d90613e3b565b60405180910390fd5b60006105428383611d49565b9050600060016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff16817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163373ffffffffffffffffffffffffffffffffffffffff167f450397a2db0e89eccfe664cc6cdfd274a88bc00d29aaec4d991754a42f19f8c98686604051610655929190613c35565b60405180910390a4505050565b60076020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008073ffffffffffffffffffffffffffffffffffffffff166106b783611af3565b73ffffffffffffffffffffffffffffffffffffffff1614159050919050565b60066020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610711611d41565b73ffffffffffffffffffffffffffffffffffffffff1661072f610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614610785576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077c90613e3b565b60405180910390fd5b600081116107c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107bf90613e1b565b60405180910390fd5b6108153382600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611dd79092919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b8260405161085b9190613f1b565b60405180910390a250565b60006108828461087585611e5d565b8051906020012084611ed3565b90509392505050565b610893611d41565b73ffffffffffffffffffffffffffffffffffffffff166108b1610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614610907576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108fe90613e3b565b60405180910390fd5b610912838383611f17565b505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b610943611d41565b73ffffffffffffffffffffffffffffffffffffffff16610961610f9e565b73ffffffffffffffffffffffffffffffffffffffff16146109b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109ae90613e3b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610a27576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a1e90613cfb565b60405180910390fd5b610a3b8160026120f990919063ffffffff16565b610a7a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7190613e7b565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f33442b8c13e72dd75a027f08f9bff4eed2dfd26e43cdea857365f5163b359a796001604051610ac19190613bba565b60405180910390a250565b610ad4611d41565b73ffffffffffffffffffffffffffffffffffffffff16610af2610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614610b48576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b3f90613e3b565b60405180910390fd5b86600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610ba491906139bc565b60206040518083038186803b158015610bbc57600080fd5b505afa158015610bd0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bf49190613002565b1015610c35576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2c90613d3b565b60405180910390fd5b606063bd896dcb60e01b308b8b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168c8c8c8c8c8c8c604051602401610c869b9a999897969594939291906139d7565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505090506000610d1b8280519060200120600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684612129565b9050610d6a818a600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611dd79092919063ffffffff16565b8973ffffffffffffffffffffffffffffffffffffffff1682805190602001208273ffffffffffffffffffffffffffffffffffffffff167f3c7ff6acee351ed98200c285a04745858a107e16da2f13c3a81a43073c17d644600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168d8d8d8d8d8d8d604051610dff989796959493929190613b1a565b60405180910390a45050505050505050505050565b60016020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610e4f611d41565b73ffffffffffffffffffffffffffffffffffffffff16610e6d610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614610ec3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eba90613e3b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000610f978260026121a590919063ffffffff16565b9050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b7f000000000000000000000000000000000000000000000000000000000000000081565b610ff3611d41565b73ffffffffffffffffffffffffffffffffffffffff16611011610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161105e90613e3b565b60405180910390fd5b8181905084849050146110af576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110a690613cbb565b60405180910390fd5b60005b84849050811015611111576111048585838181106110cc57fe5b90506020028101906110de9190613f36565b8585858181106110ea57fe5b90506020020160208101906110ff9190612ca2565b611f17565b80806001019150506110b2565b5050505050565b60608061112560026121d5565b67ffffffffffffffff8111801561113b57600080fd5b5060405190808252806020026020018201604052801561116a5781602001602082028036833780820191505090505b50905060005b61117a60026121d5565b8110156111e8576111958160026121ea90919063ffffffff16565b8282815181106111a157fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508080600101915050611170565b508091505090565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461127e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161127590613cdb565b60405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161461130c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161130390613d7b565b60405180910390fd5b6113146129d3565b82828101906113239190612fb0565b9050600073ffffffffffffffffffffffffffffffffffffffff1660066000836000015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146114715761146c60066000836000015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1685600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611dd79092919063ffffffff16565b611683565b6000806114958585604051611487929190613973565b604051809103902084612204565b915091508060066000856000015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508260000151600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506115ea8187600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611dd79092919063ffffffff16565b826000015173ffffffffffffffffffffffffffffffffffffffff16836040015173ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fd74fe60cbf1e5bf07ef3fad0e00c45f66345c5226474786d8dc086527dc8414785876060015188608001518960a001516040516116789493929190613bd5565b60405180910390a450505b60066000826000015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16816000015173ffffffffffffffffffffffffffffffffffffffff167fe34903cfa4ad8362651171309d05bcbc2fc581a5ec83ca7b0c8d10743de766e2866040516117479190613f1b565b60405180910390a35050505050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600081116117bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117b690613e1b565b60405180910390fd5b61180e333083600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661225b909392919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f59062170a285eb80e8c6b8ced60428442a51910635005233fc4ce084a475845e826040516118549190613f1b565b60405180910390a250565b611867611d41565b73ffffffffffffffffffffffffffffffffffffffff16611885610f9e565b73ffffffffffffffffffffffffffffffffffffffff16146118db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118d290613e3b565b60405180910390fd5b6118ef8160026122e490919063ffffffff16565b61192e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192590613d9b565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f33442b8c13e72dd75a027f08f9bff4eed2dfd26e43cdea857365f5163b359a7960006040516119759190613bba565b60405180910390a250565b611988611d41565b73ffffffffffffffffffffffffffffffffffffffff166119a6610f9e565b73ffffffffffffffffffffffffffffffffffffffff16146119fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119f390613e3b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611a6c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a6390613dbb565b60405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167f30909084afc859121ffc3a5aef7fe37c540a9a1ef60bd4d8dcdb76376fadf9de60405160405180910390a250565b600060016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b611b76611d41565b73ffffffffffffffffffffffffffffffffffffffff16611b94610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614611bea576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611be190613e3b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c5190613d1b565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600033905090565b6000611dcf83836040516024016040516020818303038152906040529190604051611d759291906139a3565b60405180910390207bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050612314565b905092915050565b611e588363a9059cbb60e01b8484604051602401611df6929190613af1565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505061236c565b505050565b60606000693d602d80600a3d3981f360b01b9050600069363d3d373d3d3d363d7360b01b905060008460601b905060006e5af43d82803e903d91602b57fd5bf360881b905083838383604051602001611eb994939291906138d7565b604051602081830303815290604052945050505050919050565b60008060ff60f81b838686604051602001611ef19493929190613925565b6040516020818303038152906040528051906020012090508060001c9150509392505050565b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611f86576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f7d90613ddb565b60405180910390fd5b611f8f81612433565b611fce576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fc590613efb565b60405180910390fd5b6000611fda8484611d49565b90508160016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff16817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163373ffffffffffffffffffffffffffffffffffffffff167f450397a2db0e89eccfe664cc6cdfd274a88bc00d29aaec4d991754a42f19f8c987876040516120eb929190613c35565b60405180910390a450505050565b6000612121836000018373ffffffffffffffffffffffffffffffffffffffff1660001b612446565b905092915050565b60008061214060008661213b87611e5d565b6124b6565b90508073ffffffffffffffffffffffffffffffffffffffff167efffc2da0b561cae30d9826d37709e9421c4725faebc226cbbb7ef5fc5e734960405160405180910390a260008351111561219a5761219881846125c7565b505b809150509392505050565b60006121cd836000018373ffffffffffffffffffffffffffffffffffffffff1660001b612611565b905092915050565b60006121e382600001612634565b9050919050565b60006121f98360000183612645565b60001c905092915050565b6000806060612212846126b2565b9050600061224386600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684612129565b90508180519060200120819350935050509250929050565b6122de846323b872dd60e01b85858560405160240161227c93929190613aba565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505061236c565b50505050565b600061230c836000018373ffffffffffffffffffffffffffffffffffffffff1660001b612757565b905092915050565b6000600482511461235a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161235190613e5b565b60405180910390fd5b60006020830151905080915050919050565b60606123ce826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff1661283f9092919063ffffffff16565b905060008151111561242e57808060200190518101906123ee9190612e72565b61242d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161242490613ebb565b60405180910390fd5b5b505050565b600080823b905060008111915050919050565b60006124528383612611565b6124ab5782600001829080600181540180825580915050600190039060005260206000200160009091909190915055826000018054905083600101600084815260200190815260200160002081905550600190506124b0565b600090505b92915050565b600080844710156124fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124f390613edb565b60405180910390fd5b600083511415612541576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161253890613c9b565b60405180910390fd5b8383516020850187f59050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156125bc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125b390613dfb565b60405180910390fd5b809150509392505050565b606061260983836040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061283f565b905092915050565b600080836001016000848152602001908152602001600020541415905092915050565b600081600001805490509050919050565b600081836000018054905011612690576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161268790613c7b565b60405180910390fd5b82600001828154811061269f57fe5b9060005260206000200154905092915050565b60606320dc203d60e01b30600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040516024016126f393929190613a82565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050509050919050565b6000808360010160008481526020019081526020016000205490506000811461283357600060018203905060006001866000018054905003905060008660000182815481106127a257fe5b90600052602060002001549050808760000184815481106127bf57fe5b90600052602060002001819055506001830187600101600083815260200190815260200160002081905550866000018054806127f757fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050612839565b60009150505b92915050565b606061284e8484600085612857565b90509392505050565b60608247101561289c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161289390613d5b565b60405180910390fd5b6128a585612433565b6128e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128db90613e9b565b60405180910390fd5b600060608673ffffffffffffffffffffffffffffffffffffffff16858760405161290e919061398c565b60006040518083038185875af1925050503d806000811461294b576040519150601f19603f3d011682016040523d82523d6000602084013e612950565b606091505b509150915061296082828661296c565b92505050949350505050565b6060831561297c578290506129cc565b60008351111561298f5782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129c39190613c59565b60405180910390fd5b9392505050565b6040518060c00160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff1681526020016000815260200160008152602001600081525090565b600081359050612a5a81614277565b92915050565b60008083601f840112612a7257600080fd5b8235905067ffffffffffffffff811115612a8b57600080fd5b602083019150836020820283011115612aa357600080fd5b9250929050565b60008083601f840112612abc57600080fd5b8235905067ffffffffffffffff811115612ad557600080fd5b602083019150836020820283011115612aed57600080fd5b9250929050565b600081519050612b038161428e565b92915050565b600081359050612b18816142a5565b92915050565b600081359050612b2d816142bc565b92915050565b60008083601f840112612b4557600080fd5b8235905067ffffffffffffffff811115612b5e57600080fd5b602083019150836001820283011115612b7657600080fd5b9250929050565b600081359050612b8c816142d3565b92915050565b60008083601f840112612ba457600080fd5b8235905067ffffffffffffffff811115612bbd57600080fd5b602083019150836001820283011115612bd557600080fd5b9250929050565b600060c08284031215612bee57600080fd5b612bf860c0613f8d565b90506000612c0884828501612a4b565b6000830152506020612c1c84828501612a4b565b6020830152506040612c3084828501612a4b565b6040830152506060612c4484828501612c78565b6060830152506080612c5884828501612c78565b60808301525060a0612c6c84828501612c78565b60a08301525092915050565b600081359050612c87816142e3565b92915050565b600081519050612c9c816142e3565b92915050565b600060208284031215612cb457600080fd5b6000612cc284828501612a4b565b91505092915050565b60008060008060008060008060006101208a8c031215612cea57600080fd5b6000612cf88c828d01612a4b565b9950506020612d098c828d01612a4b565b9850506040612d1a8c828d01612c78565b9750506060612d2b8c828d01612c78565b9650506080612d3c8c828d01612c78565b95505060a0612d4d8c828d01612c78565b94505060c0612d5e8c828d01612c78565b93505060e0612d6f8c828d01612c78565b925050610100612d818c828d01612b7d565b9150509295985092959850929598565b60008060008060608587031215612da757600080fd5b6000612db587828801612a4b565b9450506020612dc687828801612c78565b935050604085013567ffffffffffffffff811115612de357600080fd5b612def87828801612b33565b925092505092959194509250565b60008060008060408587031215612e1357600080fd5b600085013567ffffffffffffffff811115612e2d57600080fd5b612e3987828801612aaa565b9450945050602085013567ffffffffffffffff811115612e5857600080fd5b612e6487828801612a60565b925092505092959194509250565b600060208284031215612e8457600080fd5b6000612e9284828501612af4565b91505092915050565b600080600060608486031215612eb057600080fd5b6000612ebe86828701612b09565b9350506020612ecf86828701612a4b565b9250506040612ee086828701612a4b565b9150509250925092565b600060208284031215612efc57600080fd5b6000612f0a84828501612b1e565b91505092915050565b60008060208385031215612f2657600080fd5b600083013567ffffffffffffffff811115612f4057600080fd5b612f4c85828601612b92565b92509250509250929050565b600080600060408486031215612f6d57600080fd5b600084013567ffffffffffffffff811115612f8757600080fd5b612f9386828701612b92565b93509350506020612fa686828701612a4b565b9150509250925092565b600060c08284031215612fc257600080fd5b6000612fd084828501612bdc565b91505092915050565b600060208284031215612feb57600080fd5b6000612ff984828501612c78565b91505092915050565b60006020828403121561301457600080fd5b600061302284828501612c8d565b91505092915050565b60006130378383613043565b60208301905092915050565b61304c81614034565b82525050565b61305b81614034565b82525050565b61307261306d82614034565b6141ed565b82525050565b600061308382613fce565b61308d8185613ffc565b935061309883613fbe565b8060005b838110156130c95781516130b0888261302b565b97506130bb83613fef565b92505060018101905061309c565b5085935050505092915050565b6130df81614046565b82525050565b6130f66130f18261407e565b614209565b82525050565b61310d613108826140aa565b614213565b82525050565b61312461311f82614052565b6141ff565b82525050565b61313b613136826140d6565b61421d565b82525050565b61314a81614102565b82525050565b61316161315c82614102565b614227565b82525050565b6000613173838561400d565b93506131808385846141ab565b82840190509392505050565b600061319782613fd9565b6131a1818561400d565b93506131b18185602086016141ba565b80840191505092915050565b6131c681614175565b82525050565b6131d581614199565b82525050565b60006131e78385614018565b93506131f48385846141ab565b6131fd83614245565b840190509392505050565b60006132148385614029565b93506132218385846141ab565b82840190509392505050565b600061323882613fe4565b6132428185614018565b93506132528185602086016141ba565b61325b81614245565b840191505092915050565b6000613273602283614018565b91507f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e60008301527f64730000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006132d9602083614018565b91507f437265617465323a2062797465636f6465206c656e677468206973207a65726f6000830152602082019050919050565b6000613319601583614018565b91507f4172726179206c656e677468206d69736d6174636800000000000000000000006000830152602082019050919050565b6000613359600c83614018565b91507f4f4e4c595f4741544557415900000000000000000000000000000000000000006000830152602082019050919050565b6000613399601a83614018565b91507f44657374696e6174696f6e2063616e6e6f74206265207a65726f0000000000006000830152602082019050919050565b60006133d9602683614018565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b600061343f602083614018565b91507f4e6f7420656e6f75676820746f6b656e7320746f20637265617465206c6f636b6000830152602082019050919050565b600061347f602683614018565b91507f416464726573733a20696e73756666696369656e742062616c616e636520666f60008301527f722063616c6c00000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006134e5601283614018565b91507f4f4e4c595f5452414e534645525f544f4f4c00000000000000000000000000006000830152602082019050919050565b6000613525601b83614018565b91507f44657374696e6174696f6e20616c72656164792072656d6f76656400000000006000830152602082019050919050565b6000613565601983614018565b91507f4d6173746572436f70792063616e6e6f74206265207a65726f000000000000006000830152602082019050919050565b60006135a5601d83614018565b91507f546172676574206d757374206265206f7468657220636f6e74726163740000006000830152602082019050919050565b60006135e5601983614018565b91507f437265617465323a204661696c6564206f6e206465706c6f79000000000000006000830152602082019050919050565b6000613625601583614018565b91507f416d6f756e742063616e6e6f74206265207a65726f00000000000000000000006000830152602082019050919050565b6000613665602083614018565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b60006136a5601883614018565b91507f496e76616c6964206d6574686f64207369676e617475726500000000000000006000830152602082019050919050565b60006136e5601983614018565b91507f44657374696e6174696f6e20616c7265616479206164646564000000000000006000830152602082019050919050565b6000613725601d83614018565b91507f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006000830152602082019050919050565b6000613765602a83614018565b91507f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008301527f6f742073756363656564000000000000000000000000000000000000000000006020830152604082019050919050565b60006137cb601d83614018565b91507f437265617465323a20696e73756666696369656e742062616c616e63650000006000830152602082019050919050565b600061380b601983614018565b91507f546172676574206d757374206265206120636f6e7472616374000000000000006000830152602082019050919050565b60c0820160008201516138546000850182613043565b5060208201516138676020850182613043565b50604082015161387a6040850182613043565b50606082015161388d60608501826138b9565b5060808201516138a060808501826138b9565b5060a08201516138b360a08501826138b9565b50505050565b6138c28161416b565b82525050565b6138d18161416b565b82525050565b60006138e382876130e5565b600a820191506138f382866130e5565b600a82019150613903828561312a565b60148201915061391382846130fc565b600f8201915081905095945050505050565b60006139318287613113565b6001820191506139418286613061565b6014820191506139518285613150565b6020820191506139618284613150565b60208201915081905095945050505050565b6000613980828486613167565b91508190509392505050565b6000613998828461318c565b915081905092915050565b60006139b0828486613208565b91508190509392505050565b60006020820190506139d16000830184613052565b92915050565b6000610160820190506139ed600083018e613052565b6139fa602083018d613052565b613a07604083018c613052565b613a14606083018b613052565b613a21608083018a6138c8565b613a2e60a08301896138c8565b613a3b60c08301886138c8565b613a4860e08301876138c8565b613a566101008301866138c8565b613a646101208301856138c8565b613a726101408301846131cc565b9c9b505050505050505050505050565b600061010082019050613a986000830186613052565b613aa56020830185613052565b613ab2604083018461383e565b949350505050565b6000606082019050613acf6000830186613052565b613adc6020830185613052565b613ae960408301846138c8565b949350505050565b6000604082019050613b066000830185613052565b613b1360208301846138c8565b9392505050565b600061010082019050613b30600083018b613052565b613b3d602083018a6138c8565b613b4a60408301896138c8565b613b5760608301886138c8565b613b6460808301876138c8565b613b7160a08301866138c8565b613b7e60c08301856138c8565b613b8b60e08301846131cc565b9998505050505050505050565b60006020820190508181036000830152613bb28184613078565b905092915050565b6000602082019050613bcf60008301846130d6565b92915050565b6000608082019050613bea6000830187613141565b613bf760208301866138c8565b613c0460408301856138c8565b613c1160608301846138c8565b95945050505050565b6000602082019050613c2f60008301846131bd565b92915050565b60006020820190508181036000830152613c508184866131db565b90509392505050565b60006020820190508181036000830152613c73818461322d565b905092915050565b60006020820190508181036000830152613c9481613266565b9050919050565b60006020820190508181036000830152613cb4816132cc565b9050919050565b60006020820190508181036000830152613cd48161330c565b9050919050565b60006020820190508181036000830152613cf48161334c565b9050919050565b60006020820190508181036000830152613d148161338c565b9050919050565b60006020820190508181036000830152613d34816133cc565b9050919050565b60006020820190508181036000830152613d5481613432565b9050919050565b60006020820190508181036000830152613d7481613472565b9050919050565b60006020820190508181036000830152613d94816134d8565b9050919050565b60006020820190508181036000830152613db481613518565b9050919050565b60006020820190508181036000830152613dd481613558565b9050919050565b60006020820190508181036000830152613df481613598565b9050919050565b60006020820190508181036000830152613e14816135d8565b9050919050565b60006020820190508181036000830152613e3481613618565b9050919050565b60006020820190508181036000830152613e5481613658565b9050919050565b60006020820190508181036000830152613e7481613698565b9050919050565b60006020820190508181036000830152613e94816136d8565b9050919050565b60006020820190508181036000830152613eb481613718565b9050919050565b60006020820190508181036000830152613ed481613758565b9050919050565b60006020820190508181036000830152613ef4816137be565b9050919050565b60006020820190508181036000830152613f14816137fe565b9050919050565b6000602082019050613f3060008301846138c8565b92915050565b60008083356001602003843603038112613f4f57600080fd5b80840192508235915067ffffffffffffffff821115613f6d57600080fd5b602083019250600182023603831315613f8557600080fd5b509250929050565b6000604051905081810181811067ffffffffffffffff82111715613fb457613fb3614243565b5b8060405250919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b600061403f8261414b565b9050919050565b60008115159050919050565b60007fff0000000000000000000000000000000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffff0000000000000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffffffffffffff000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffffffffffffffffffffffff00000000000000000000000082169050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600081905061414682614263565b919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600061418082614187565b9050919050565b60006141928261414b565b9050919050565b60006141a482614138565b9050919050565b82818337600083830152505050565b60005b838110156141d85780820151818401526020810190506141bd565b838111156141e7576000848401525b50505050565b60006141f882614231565b9050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b600061423c82614256565b9050919050565bfe5b6000601f19601f8301169050919050565b60008160601b9050919050565b6003811061427457614273614243565b5b50565b61428081614034565b811461428b57600080fd5b50565b61429781614046565b81146142a257600080fd5b50565b6142ae81614102565b81146142b957600080fd5b50565b6142c58161410c565b81146142d057600080fd5b50565b600381106142e057600080fd5b50565b6142ec8161416b565b81146142f757600080fd5b5056fea264697066735822122010f167ec85dbd4b07aedb6960f9f6ac5ae1b0f5473409617dcd319393591837164736f6c63430007030033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101735760003560e01c806379ee1bdf116100de578063a619486e11610097578063cf497e6c11610071578063cf497e6c14610434578063f1d24c4514610450578063f2fde38b14610480578063fc0c546a1461049c57610173565b8063a619486e146103de578063b6b55f25146103fc578063c1ab13db1461041857610173565b806379ee1bdf1461031c5780638da5cb5b1461034c5780638fa74a0e1461036a5780639c05fc6014610388578063a3457466146103a4578063a4c0ed36146103c257610173565b8063463013a211610130578063463013a214610270578063586a53531461028c5780635975e00c146102aa57806368d30c2e146102c65780636e03b8dc146102e2578063715018a61461031257610173565b806303990a6c14610178578063045b7fe2146101945780630602ba2b146101c45780630cd6178f146101f45780632e1a7d4d1461022457806343fb93d914610240575b600080fd5b610192600480360381019061018d9190612f13565b6104ba565b005b6101ae60048036038101906101a99190612ca2565b610662565b6040516101bb91906139bc565b60405180910390f35b6101de60048036038101906101d99190612eea565b610695565b6040516101eb9190613bba565b60405180910390f35b61020e60048036038101906102099190612ca2565b6106d6565b60405161021b91906139bc565b60405180910390f35b61023e60048036038101906102399190612fd9565b610709565b005b61025a60048036038101906102559190612e9b565b610866565b60405161026791906139bc565b60405180910390f35b61028a60048036038101906102859190612f58565b61088b565b005b610294610917565b6040516102a191906139bc565b60405180910390f35b6102c460048036038101906102bf9190612ca2565b61093b565b005b6102e060048036038101906102db9190612ccb565b610acc565b005b6102fc60048036038101906102f79190612eea565b610e14565b60405161030991906139bc565b60405180910390f35b61031a610e47565b005b61033660048036038101906103319190612ca2565b610f81565b6040516103439190613bba565b60405180910390f35b610354610f9e565b60405161036191906139bc565b60405180910390f35b610372610fc7565b60405161037f91906139bc565b60405180910390f35b6103a2600480360381019061039d9190612dfd565b610feb565b005b6103ac611118565b6040516103b99190613b98565b60405180910390f35b6103dc60048036038101906103d79190612d91565b6111f0565b005b6103e6611756565b6040516103f391906139bc565b60405180910390f35b61041660048036038101906104119190612fd9565b61177c565b005b610432600480360381019061042d9190612ca2565b61185f565b005b61044e60048036038101906104499190612ca2565b611980565b005b61046a60048036038101906104659190612eea565b611af3565b60405161047791906139bc565b60405180910390f35b61049a60048036038101906104959190612ca2565b611b6e565b005b6104a4611d17565b6040516104b19190613c1a565b60405180910390f35b6104c2611d41565b73ffffffffffffffffffffffffffffffffffffffff166104e0610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614610536576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161052d90613e3b565b60405180910390fd5b60006105428383611d49565b9050600060016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff16817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163373ffffffffffffffffffffffffffffffffffffffff167f450397a2db0e89eccfe664cc6cdfd274a88bc00d29aaec4d991754a42f19f8c98686604051610655929190613c35565b60405180910390a4505050565b60076020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008073ffffffffffffffffffffffffffffffffffffffff166106b783611af3565b73ffffffffffffffffffffffffffffffffffffffff1614159050919050565b60066020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610711611d41565b73ffffffffffffffffffffffffffffffffffffffff1661072f610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614610785576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077c90613e3b565b60405180910390fd5b600081116107c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107bf90613e1b565b60405180910390fd5b6108153382600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611dd79092919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b8260405161085b9190613f1b565b60405180910390a250565b60006108828461087585611e5d565b8051906020012084611ed3565b90509392505050565b610893611d41565b73ffffffffffffffffffffffffffffffffffffffff166108b1610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614610907576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108fe90613e3b565b60405180910390fd5b610912838383611f17565b505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b610943611d41565b73ffffffffffffffffffffffffffffffffffffffff16610961610f9e565b73ffffffffffffffffffffffffffffffffffffffff16146109b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109ae90613e3b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610a27576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a1e90613cfb565b60405180910390fd5b610a3b8160026120f990919063ffffffff16565b610a7a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7190613e7b565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f33442b8c13e72dd75a027f08f9bff4eed2dfd26e43cdea857365f5163b359a796001604051610ac19190613bba565b60405180910390a250565b610ad4611d41565b73ffffffffffffffffffffffffffffffffffffffff16610af2610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614610b48576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b3f90613e3b565b60405180910390fd5b86600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610ba491906139bc565b60206040518083038186803b158015610bbc57600080fd5b505afa158015610bd0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bf49190613002565b1015610c35576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2c90613d3b565b60405180910390fd5b606063bd896dcb60e01b308b8b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168c8c8c8c8c8c8c604051602401610c869b9a999897969594939291906139d7565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505090506000610d1b8280519060200120600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684612129565b9050610d6a818a600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611dd79092919063ffffffff16565b8973ffffffffffffffffffffffffffffffffffffffff1682805190602001208273ffffffffffffffffffffffffffffffffffffffff167f3c7ff6acee351ed98200c285a04745858a107e16da2f13c3a81a43073c17d644600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168d8d8d8d8d8d8d604051610dff989796959493929190613b1a565b60405180910390a45050505050505050505050565b60016020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610e4f611d41565b73ffffffffffffffffffffffffffffffffffffffff16610e6d610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614610ec3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eba90613e3b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000610f978260026121a590919063ffffffff16565b9050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b7f000000000000000000000000000000000000000000000000000000000000000081565b610ff3611d41565b73ffffffffffffffffffffffffffffffffffffffff16611011610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161105e90613e3b565b60405180910390fd5b8181905084849050146110af576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110a690613cbb565b60405180910390fd5b60005b84849050811015611111576111048585838181106110cc57fe5b90506020028101906110de9190613f36565b8585858181106110ea57fe5b90506020020160208101906110ff9190612ca2565b611f17565b80806001019150506110b2565b5050505050565b60608061112560026121d5565b67ffffffffffffffff8111801561113b57600080fd5b5060405190808252806020026020018201604052801561116a5781602001602082028036833780820191505090505b50905060005b61117a60026121d5565b8110156111e8576111958160026121ea90919063ffffffff16565b8282815181106111a157fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508080600101915050611170565b508091505090565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461127e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161127590613cdb565b60405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161461130c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161130390613d7b565b60405180910390fd5b6113146129d3565b82828101906113239190612fb0565b9050600073ffffffffffffffffffffffffffffffffffffffff1660066000836000015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146114715761146c60066000836000015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1685600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611dd79092919063ffffffff16565b611683565b6000806114958585604051611487929190613973565b604051809103902084612204565b915091508060066000856000015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508260000151600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506115ea8187600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611dd79092919063ffffffff16565b826000015173ffffffffffffffffffffffffffffffffffffffff16836040015173ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fd74fe60cbf1e5bf07ef3fad0e00c45f66345c5226474786d8dc086527dc8414785876060015188608001518960a001516040516116789493929190613bd5565b60405180910390a450505b60066000826000015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16816000015173ffffffffffffffffffffffffffffffffffffffff167fe34903cfa4ad8362651171309d05bcbc2fc581a5ec83ca7b0c8d10743de766e2866040516117479190613f1b565b60405180910390a35050505050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600081116117bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117b690613e1b565b60405180910390fd5b61180e333083600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661225b909392919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f59062170a285eb80e8c6b8ced60428442a51910635005233fc4ce084a475845e826040516118549190613f1b565b60405180910390a250565b611867611d41565b73ffffffffffffffffffffffffffffffffffffffff16611885610f9e565b73ffffffffffffffffffffffffffffffffffffffff16146118db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118d290613e3b565b60405180910390fd5b6118ef8160026122e490919063ffffffff16565b61192e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192590613d9b565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f33442b8c13e72dd75a027f08f9bff4eed2dfd26e43cdea857365f5163b359a7960006040516119759190613bba565b60405180910390a250565b611988611d41565b73ffffffffffffffffffffffffffffffffffffffff166119a6610f9e565b73ffffffffffffffffffffffffffffffffffffffff16146119fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119f390613e3b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611a6c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a6390613dbb565b60405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167f30909084afc859121ffc3a5aef7fe37c540a9a1ef60bd4d8dcdb76376fadf9de60405160405180910390a250565b600060016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b611b76611d41565b73ffffffffffffffffffffffffffffffffffffffff16611b94610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614611bea576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611be190613e3b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c5190613d1b565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600033905090565b6000611dcf83836040516024016040516020818303038152906040529190604051611d759291906139a3565b60405180910390207bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050612314565b905092915050565b611e588363a9059cbb60e01b8484604051602401611df6929190613af1565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505061236c565b505050565b60606000693d602d80600a3d3981f360b01b9050600069363d3d373d3d3d363d7360b01b905060008460601b905060006e5af43d82803e903d91602b57fd5bf360881b905083838383604051602001611eb994939291906138d7565b604051602081830303815290604052945050505050919050565b60008060ff60f81b838686604051602001611ef19493929190613925565b6040516020818303038152906040528051906020012090508060001c9150509392505050565b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611f86576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f7d90613ddb565b60405180910390fd5b611f8f81612433565b611fce576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fc590613efb565b60405180910390fd5b6000611fda8484611d49565b90508160016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff16817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163373ffffffffffffffffffffffffffffffffffffffff167f450397a2db0e89eccfe664cc6cdfd274a88bc00d29aaec4d991754a42f19f8c987876040516120eb929190613c35565b60405180910390a450505050565b6000612121836000018373ffffffffffffffffffffffffffffffffffffffff1660001b612446565b905092915050565b60008061214060008661213b87611e5d565b6124b6565b90508073ffffffffffffffffffffffffffffffffffffffff167efffc2da0b561cae30d9826d37709e9421c4725faebc226cbbb7ef5fc5e734960405160405180910390a260008351111561219a5761219881846125c7565b505b809150509392505050565b60006121cd836000018373ffffffffffffffffffffffffffffffffffffffff1660001b612611565b905092915050565b60006121e382600001612634565b9050919050565b60006121f98360000183612645565b60001c905092915050565b6000806060612212846126b2565b9050600061224386600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684612129565b90508180519060200120819350935050509250929050565b6122de846323b872dd60e01b85858560405160240161227c93929190613aba565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505061236c565b50505050565b600061230c836000018373ffffffffffffffffffffffffffffffffffffffff1660001b612757565b905092915050565b6000600482511461235a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161235190613e5b565b60405180910390fd5b60006020830151905080915050919050565b60606123ce826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff1661283f9092919063ffffffff16565b905060008151111561242e57808060200190518101906123ee9190612e72565b61242d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161242490613ebb565b60405180910390fd5b5b505050565b600080823b905060008111915050919050565b60006124528383612611565b6124ab5782600001829080600181540180825580915050600190039060005260206000200160009091909190915055826000018054905083600101600084815260200190815260200160002081905550600190506124b0565b600090505b92915050565b600080844710156124fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124f390613edb565b60405180910390fd5b600083511415612541576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161253890613c9b565b60405180910390fd5b8383516020850187f59050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156125bc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125b390613dfb565b60405180910390fd5b809150509392505050565b606061260983836040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061283f565b905092915050565b600080836001016000848152602001908152602001600020541415905092915050565b600081600001805490509050919050565b600081836000018054905011612690576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161268790613c7b565b60405180910390fd5b82600001828154811061269f57fe5b9060005260206000200154905092915050565b60606320dc203d60e01b30600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040516024016126f393929190613a82565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050509050919050565b6000808360010160008481526020019081526020016000205490506000811461283357600060018203905060006001866000018054905003905060008660000182815481106127a257fe5b90600052602060002001549050808760000184815481106127bf57fe5b90600052602060002001819055506001830187600101600083815260200190815260200160002081905550866000018054806127f757fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050612839565b60009150505b92915050565b606061284e8484600085612857565b90509392505050565b60608247101561289c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161289390613d5b565b60405180910390fd5b6128a585612433565b6128e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128db90613e9b565b60405180910390fd5b600060608673ffffffffffffffffffffffffffffffffffffffff16858760405161290e919061398c565b60006040518083038185875af1925050503d806000811461294b576040519150601f19603f3d011682016040523d82523d6000602084013e612950565b606091505b509150915061296082828661296c565b92505050949350505050565b6060831561297c578290506129cc565b60008351111561298f5782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129c39190613c59565b60405180910390fd5b9392505050565b6040518060c00160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff1681526020016000815260200160008152602001600081525090565b600081359050612a5a81614277565b92915050565b60008083601f840112612a7257600080fd5b8235905067ffffffffffffffff811115612a8b57600080fd5b602083019150836020820283011115612aa357600080fd5b9250929050565b60008083601f840112612abc57600080fd5b8235905067ffffffffffffffff811115612ad557600080fd5b602083019150836020820283011115612aed57600080fd5b9250929050565b600081519050612b038161428e565b92915050565b600081359050612b18816142a5565b92915050565b600081359050612b2d816142bc565b92915050565b60008083601f840112612b4557600080fd5b8235905067ffffffffffffffff811115612b5e57600080fd5b602083019150836001820283011115612b7657600080fd5b9250929050565b600081359050612b8c816142d3565b92915050565b60008083601f840112612ba457600080fd5b8235905067ffffffffffffffff811115612bbd57600080fd5b602083019150836001820283011115612bd557600080fd5b9250929050565b600060c08284031215612bee57600080fd5b612bf860c0613f8d565b90506000612c0884828501612a4b565b6000830152506020612c1c84828501612a4b565b6020830152506040612c3084828501612a4b565b6040830152506060612c4484828501612c78565b6060830152506080612c5884828501612c78565b60808301525060a0612c6c84828501612c78565b60a08301525092915050565b600081359050612c87816142e3565b92915050565b600081519050612c9c816142e3565b92915050565b600060208284031215612cb457600080fd5b6000612cc284828501612a4b565b91505092915050565b60008060008060008060008060006101208a8c031215612cea57600080fd5b6000612cf88c828d01612a4b565b9950506020612d098c828d01612a4b565b9850506040612d1a8c828d01612c78565b9750506060612d2b8c828d01612c78565b9650506080612d3c8c828d01612c78565b95505060a0612d4d8c828d01612c78565b94505060c0612d5e8c828d01612c78565b93505060e0612d6f8c828d01612c78565b925050610100612d818c828d01612b7d565b9150509295985092959850929598565b60008060008060608587031215612da757600080fd5b6000612db587828801612a4b565b9450506020612dc687828801612c78565b935050604085013567ffffffffffffffff811115612de357600080fd5b612def87828801612b33565b925092505092959194509250565b60008060008060408587031215612e1357600080fd5b600085013567ffffffffffffffff811115612e2d57600080fd5b612e3987828801612aaa565b9450945050602085013567ffffffffffffffff811115612e5857600080fd5b612e6487828801612a60565b925092505092959194509250565b600060208284031215612e8457600080fd5b6000612e9284828501612af4565b91505092915050565b600080600060608486031215612eb057600080fd5b6000612ebe86828701612b09565b9350506020612ecf86828701612a4b565b9250506040612ee086828701612a4b565b9150509250925092565b600060208284031215612efc57600080fd5b6000612f0a84828501612b1e565b91505092915050565b60008060208385031215612f2657600080fd5b600083013567ffffffffffffffff811115612f4057600080fd5b612f4c85828601612b92565b92509250509250929050565b600080600060408486031215612f6d57600080fd5b600084013567ffffffffffffffff811115612f8757600080fd5b612f9386828701612b92565b93509350506020612fa686828701612a4b565b9150509250925092565b600060c08284031215612fc257600080fd5b6000612fd084828501612bdc565b91505092915050565b600060208284031215612feb57600080fd5b6000612ff984828501612c78565b91505092915050565b60006020828403121561301457600080fd5b600061302284828501612c8d565b91505092915050565b60006130378383613043565b60208301905092915050565b61304c81614034565b82525050565b61305b81614034565b82525050565b61307261306d82614034565b6141ed565b82525050565b600061308382613fce565b61308d8185613ffc565b935061309883613fbe565b8060005b838110156130c95781516130b0888261302b565b97506130bb83613fef565b92505060018101905061309c565b5085935050505092915050565b6130df81614046565b82525050565b6130f66130f18261407e565b614209565b82525050565b61310d613108826140aa565b614213565b82525050565b61312461311f82614052565b6141ff565b82525050565b61313b613136826140d6565b61421d565b82525050565b61314a81614102565b82525050565b61316161315c82614102565b614227565b82525050565b6000613173838561400d565b93506131808385846141ab565b82840190509392505050565b600061319782613fd9565b6131a1818561400d565b93506131b18185602086016141ba565b80840191505092915050565b6131c681614175565b82525050565b6131d581614199565b82525050565b60006131e78385614018565b93506131f48385846141ab565b6131fd83614245565b840190509392505050565b60006132148385614029565b93506132218385846141ab565b82840190509392505050565b600061323882613fe4565b6132428185614018565b93506132528185602086016141ba565b61325b81614245565b840191505092915050565b6000613273602283614018565b91507f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e60008301527f64730000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006132d9602083614018565b91507f437265617465323a2062797465636f6465206c656e677468206973207a65726f6000830152602082019050919050565b6000613319601583614018565b91507f4172726179206c656e677468206d69736d6174636800000000000000000000006000830152602082019050919050565b6000613359600c83614018565b91507f4f4e4c595f4741544557415900000000000000000000000000000000000000006000830152602082019050919050565b6000613399601a83614018565b91507f44657374696e6174696f6e2063616e6e6f74206265207a65726f0000000000006000830152602082019050919050565b60006133d9602683614018565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b600061343f602083614018565b91507f4e6f7420656e6f75676820746f6b656e7320746f20637265617465206c6f636b6000830152602082019050919050565b600061347f602683614018565b91507f416464726573733a20696e73756666696369656e742062616c616e636520666f60008301527f722063616c6c00000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006134e5601283614018565b91507f4f4e4c595f5452414e534645525f544f4f4c00000000000000000000000000006000830152602082019050919050565b6000613525601b83614018565b91507f44657374696e6174696f6e20616c72656164792072656d6f76656400000000006000830152602082019050919050565b6000613565601983614018565b91507f4d6173746572436f70792063616e6e6f74206265207a65726f000000000000006000830152602082019050919050565b60006135a5601d83614018565b91507f546172676574206d757374206265206f7468657220636f6e74726163740000006000830152602082019050919050565b60006135e5601983614018565b91507f437265617465323a204661696c6564206f6e206465706c6f79000000000000006000830152602082019050919050565b6000613625601583614018565b91507f416d6f756e742063616e6e6f74206265207a65726f00000000000000000000006000830152602082019050919050565b6000613665602083614018565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b60006136a5601883614018565b91507f496e76616c6964206d6574686f64207369676e617475726500000000000000006000830152602082019050919050565b60006136e5601983614018565b91507f44657374696e6174696f6e20616c7265616479206164646564000000000000006000830152602082019050919050565b6000613725601d83614018565b91507f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006000830152602082019050919050565b6000613765602a83614018565b91507f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008301527f6f742073756363656564000000000000000000000000000000000000000000006020830152604082019050919050565b60006137cb601d83614018565b91507f437265617465323a20696e73756666696369656e742062616c616e63650000006000830152602082019050919050565b600061380b601983614018565b91507f546172676574206d757374206265206120636f6e7472616374000000000000006000830152602082019050919050565b60c0820160008201516138546000850182613043565b5060208201516138676020850182613043565b50604082015161387a6040850182613043565b50606082015161388d60608501826138b9565b5060808201516138a060808501826138b9565b5060a08201516138b360a08501826138b9565b50505050565b6138c28161416b565b82525050565b6138d18161416b565b82525050565b60006138e382876130e5565b600a820191506138f382866130e5565b600a82019150613903828561312a565b60148201915061391382846130fc565b600f8201915081905095945050505050565b60006139318287613113565b6001820191506139418286613061565b6014820191506139518285613150565b6020820191506139618284613150565b60208201915081905095945050505050565b6000613980828486613167565b91508190509392505050565b6000613998828461318c565b915081905092915050565b60006139b0828486613208565b91508190509392505050565b60006020820190506139d16000830184613052565b92915050565b6000610160820190506139ed600083018e613052565b6139fa602083018d613052565b613a07604083018c613052565b613a14606083018b613052565b613a21608083018a6138c8565b613a2e60a08301896138c8565b613a3b60c08301886138c8565b613a4860e08301876138c8565b613a566101008301866138c8565b613a646101208301856138c8565b613a726101408301846131cc565b9c9b505050505050505050505050565b600061010082019050613a986000830186613052565b613aa56020830185613052565b613ab2604083018461383e565b949350505050565b6000606082019050613acf6000830186613052565b613adc6020830185613052565b613ae960408301846138c8565b949350505050565b6000604082019050613b066000830185613052565b613b1360208301846138c8565b9392505050565b600061010082019050613b30600083018b613052565b613b3d602083018a6138c8565b613b4a60408301896138c8565b613b5760608301886138c8565b613b6460808301876138c8565b613b7160a08301866138c8565b613b7e60c08301856138c8565b613b8b60e08301846131cc565b9998505050505050505050565b60006020820190508181036000830152613bb28184613078565b905092915050565b6000602082019050613bcf60008301846130d6565b92915050565b6000608082019050613bea6000830187613141565b613bf760208301866138c8565b613c0460408301856138c8565b613c1160608301846138c8565b95945050505050565b6000602082019050613c2f60008301846131bd565b92915050565b60006020820190508181036000830152613c508184866131db565b90509392505050565b60006020820190508181036000830152613c73818461322d565b905092915050565b60006020820190508181036000830152613c9481613266565b9050919050565b60006020820190508181036000830152613cb4816132cc565b9050919050565b60006020820190508181036000830152613cd48161330c565b9050919050565b60006020820190508181036000830152613cf48161334c565b9050919050565b60006020820190508181036000830152613d148161338c565b9050919050565b60006020820190508181036000830152613d34816133cc565b9050919050565b60006020820190508181036000830152613d5481613432565b9050919050565b60006020820190508181036000830152613d7481613472565b9050919050565b60006020820190508181036000830152613d94816134d8565b9050919050565b60006020820190508181036000830152613db481613518565b9050919050565b60006020820190508181036000830152613dd481613558565b9050919050565b60006020820190508181036000830152613df481613598565b9050919050565b60006020820190508181036000830152613e14816135d8565b9050919050565b60006020820190508181036000830152613e3481613618565b9050919050565b60006020820190508181036000830152613e5481613658565b9050919050565b60006020820190508181036000830152613e7481613698565b9050919050565b60006020820190508181036000830152613e94816136d8565b9050919050565b60006020820190508181036000830152613eb481613718565b9050919050565b60006020820190508181036000830152613ed481613758565b9050919050565b60006020820190508181036000830152613ef4816137be565b9050919050565b60006020820190508181036000830152613f14816137fe565b9050919050565b6000602082019050613f3060008301846138c8565b92915050565b60008083356001602003843603038112613f4f57600080fd5b80840192508235915067ffffffffffffffff821115613f6d57600080fd5b602083019250600182023603831315613f8557600080fd5b509250929050565b6000604051905081810181811067ffffffffffffffff82111715613fb457613fb3614243565b5b8060405250919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b600061403f8261414b565b9050919050565b60008115159050919050565b60007fff0000000000000000000000000000000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffff0000000000000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffffffffffffff000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffffffffffffffffffffffff00000000000000000000000082169050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600081905061414682614263565b919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600061418082614187565b9050919050565b60006141928261414b565b9050919050565b60006141a482614138565b9050919050565b82818337600083830152505050565b60005b838110156141d85780820151818401526020810190506141bd565b838111156141e7576000848401525b50505050565b60006141f882614231565b9050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b600061423c82614256565b9050919050565bfe5b6000601f19601f8301169050919050565b60008160601b9050919050565b6003811061427457614273614243565b5b50565b61428081614034565b811461428b57600080fd5b50565b61429781614046565b81146142a257600080fd5b50565b6142ae81614102565b81146142b957600080fd5b50565b6142c58161410c565b81146142d057600080fd5b50565b600381106142e057600080fd5b50565b6142ec8161416b565b81146142f757600080fd5b5056fea264697066735822122010f167ec85dbd4b07aedb6960f9f6ac5ae1b0f5473409617dcd319393591837164736f6c63430007030033", + "devdoc": { + "events": { + "LockedTokensReceivedFromL1(address,address,uint256)": { + "details": "Emitted when locked tokens are received from L1 (whether the wallet had already been received or not)" + }, + "TokenLockCreatedFromL1(address,bytes32,address,uint256,uint256,uint256,address)": { + "details": "Event emitted when a wallet is received and created from L1" + } + }, + "kind": "dev", + "methods": { + "addTokenDestination(address)": { + "params": { + "_dst": "Destination address" + } + }, + "constructor": { + "params": { + "_graphToken": "Address of the L2 GRT token contract", + "_l1TransferTool": "Address of the L1 transfer tool contract (in L1, without aliasing)", + "_l2Gateway": "Address of the L2GraphTokenGateway contract", + "_masterCopy": "Address of the master copy of the L2GraphTokenLockWallet implementation" + } + }, + "createTokenLockWallet(address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)": { + "params": { + "_beneficiary": "Address of the beneficiary of locked tokens", + "_endTime": "End time of the release schedule", + "_managedAmount": "Amount of tokens to be managed by the lock contract", + "_owner": "Address of the contract owner", + "_periods": "Number of periods between start time and end time", + "_releaseStartTime": "Override time for when the releases start", + "_revocable": "Whether the contract is revocable", + "_startTime": "Start time of the release schedule" + } + }, + "deposit(uint256)": { + "details": "Even if the ERC20 token can be transferred directly to the contract this function provide a safe interface to do the transfer and avoid mistakes", + "params": { + "_amount": "Amount to deposit" + } + }, + "getAuthFunctionCallTarget(bytes4)": { + "params": { + "_sigHash": "Function signature hash" + }, + "returns": { + "_0": "Address of the target contract where to send the call" + } + }, + "getDeploymentAddress(bytes32,address,address)": { + "params": { + "_deployer": "Address of the deployer that creates the contract", + "_implementation": "Address of the proxy target implementation", + "_salt": "Bytes32 salt to use for CREATE2" + }, + "returns": { + "_0": "Address of the counterfactual MinimalProxy" + } + }, + "getTokenDestinations()": { + "returns": { + "_0": "Array of addresses authorized to pull funds from a token lock" + } + }, + "isAuthFunctionCall(bytes4)": { + "params": { + "_sigHash": "Function signature hash" + }, + "returns": { + "_0": "True if authorized" + } + }, + "isTokenDestination(address)": { + "params": { + "_dst": "Destination address" + }, + "returns": { + "_0": "True if authorized" + } + }, + "onTokenTransfer(address,uint256,bytes)": { + "details": "This function will create a new wallet if it doesn't exist yet, or send the tokens to the existing wallet if it does.", + "params": { + "_amount": "Amount of tokens received", + "_data": "Encoded data of the transferred wallet, which must be an ABI-encoded TransferredWalletData struct", + "_from": "Address of the sender in L1, which must be the L1GraphTokenLockTransferTool" + } + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "removeTokenDestination(address)": { + "params": { + "_dst": "Destination address" + } + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." + }, + "setAuthFunctionCall(string,address)": { + "details": "Input expected is the function signature as 'transfer(address,uint256)'", + "params": { + "_signature": "Function signature", + "_target": "Address of the destination contract to call" + } + }, + "setAuthFunctionCallMany(string[],address[])": { + "details": "Input expected is the function signature as 'transfer(address,uint256)'", + "params": { + "_signatures": "Function signatures", + "_targets": "Address of the destination contract to call" + } + }, + "setMasterCopy(address)": { + "params": { + "_masterCopy": "Address of contract bytecode to factory clone" + } + }, + "token()": { + "returns": { + "_0": "Token used for transfers and approvals" + } + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + }, + "unsetAuthFunctionCall(string)": { + "details": "Input expected is the function signature as 'transfer(address,uint256)'", + "params": { + "_signature": "Function signature" + } + }, + "withdraw(uint256)": { + "details": "Escape hatch in case of mistakes or to recover remaining funds", + "params": { + "_amount": "Amount of tokens to withdraw" + } + } + }, + "title": "L2GraphTokenLockManager", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "addTokenDestination(address)": { + "notice": "Adds an address that can be allowed by a token lock to pull funds" + }, + "constructor": { + "notice": "Constructor for the L2GraphTokenLockManager contract." + }, + "createTokenLockWallet(address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)": { + "notice": "Creates and fund a new token lock wallet using a minimum proxy" + }, + "deposit(uint256)": { + "notice": "Deposits tokens into the contract" + }, + "getAuthFunctionCallTarget(bytes4)": { + "notice": "Gets the target contract to call for a particular function signature" + }, + "getDeploymentAddress(bytes32,address,address)": { + "notice": "Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation" + }, + "getTokenDestinations()": { + "notice": "Returns an array of authorized destination addresses" + }, + "isAuthFunctionCall(bytes4)": { + "notice": "Returns true if the function call is authorized" + }, + "isTokenDestination(address)": { + "notice": "Returns True if the address is authorized to be a destination of tokens" + }, + "l1TransferTool()": { + "notice": "Address of the L1 transfer tool contract (in L1, no aliasing)" + }, + "l1WalletToL2Wallet(address)": { + "notice": "Mapping of each L1 wallet to its L2 wallet counterpart (populated when each wallet is received) L1 address => L2 address" + }, + "l2Gateway()": { + "notice": "Address of the L2GraphTokenGateway" + }, + "l2WalletToL1Wallet(address)": { + "notice": "Mapping of each L2 wallet to its L1 wallet counterpart (populated when each wallet is received) L2 address => L1 address" + }, + "onTokenTransfer(address,uint256,bytes)": { + "notice": "This function is called by the L2GraphTokenGateway when tokens are sent from L1." + }, + "removeTokenDestination(address)": { + "notice": "Removes an address that can be allowed by a token lock to pull funds" + }, + "setAuthFunctionCall(string,address)": { + "notice": "Sets an authorized function call to target" + }, + "setAuthFunctionCallMany(string[],address[])": { + "notice": "Sets an authorized function call to target in bulk" + }, + "setMasterCopy(address)": { + "notice": "Sets the masterCopy bytecode to use to create clones of TokenLock contracts" + }, + "token()": { + "notice": "Gets the GRT token address" + }, + "unsetAuthFunctionCall(string)": { + "notice": "Unsets an authorized function call to target" + }, + "withdraw(uint256)": { + "notice": "Withdraws tokens from the contract" + } + }, + "notice": "This contract manages a list of authorized function calls and targets that can be called by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts. This contract receives funds to make the process of creating TokenLockWallet contracts easier by distributing them the initial tokens to be managed. In particular, this L2 variant is designed to receive token lock wallets from L1, through the GRT bridge. These transferred wallets will not allow releasing funds in L2 until the end of the vesting timeline, but they can allow withdrawing funds back to L1 using the L2GraphTokenLockTransferTool contract. The owner can setup a list of token destinations that will be used by TokenLock contracts to approve the pulling of funds, this way in can be guaranteed that only protocol contracts will manipulate users funds.", + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 672, + "contract": "contracts/L2GraphTokenLockManager.sol:L2GraphTokenLockManager", + "label": "_owner", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 3988, + "contract": "contracts/L2GraphTokenLockManager.sol:L2GraphTokenLockManager", + "label": "authFnCalls", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_bytes4,t_address)" + }, + { + "astId": 3990, + "contract": "contracts/L2GraphTokenLockManager.sol:L2GraphTokenLockManager", + "label": "_tokenDestinations", + "offset": 0, + "slot": "2", + "type": "t_struct(AddressSet)2629_storage" + }, + { + "astId": 3992, + "contract": "contracts/L2GraphTokenLockManager.sol:L2GraphTokenLockManager", + "label": "masterCopy", + "offset": 0, + "slot": "4", + "type": "t_address" + }, + { + "astId": 3994, + "contract": "contracts/L2GraphTokenLockManager.sol:L2GraphTokenLockManager", + "label": "_token", + "offset": 0, + "slot": "5", + "type": "t_contract(IERC20)1710" + }, + { + "astId": 6154, + "contract": "contracts/L2GraphTokenLockManager.sol:L2GraphTokenLockManager", + "label": "l1WalletToL2Wallet", + "offset": 0, + "slot": "6", + "type": "t_mapping(t_address,t_address)" + }, + { + "astId": 6159, + "contract": "contracts/L2GraphTokenLockManager.sol:L2GraphTokenLockManager", + "label": "l2WalletToL1Wallet", + "offset": 0, + "slot": "7", + "type": "t_mapping(t_address,t_address)" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_bytes32)dyn_storage": { + "base": "t_bytes32", + "encoding": "dynamic_array", + "label": "bytes32[]", + "numberOfBytes": "32" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_bytes4": { + "encoding": "inplace", + "label": "bytes4", + "numberOfBytes": "4" + }, + "t_contract(IERC20)1710": { + "encoding": "inplace", + "label": "contract IERC20", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_address)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => address)", + "numberOfBytes": "32", + "value": "t_address" + }, + "t_mapping(t_bytes32,t_uint256)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_mapping(t_bytes4,t_address)": { + "encoding": "mapping", + "key": "t_bytes4", + "label": "mapping(bytes4 => address)", + "numberOfBytes": "32", + "value": "t_address" + }, + "t_struct(AddressSet)2629_storage": { + "encoding": "inplace", + "label": "struct EnumerableSet.AddressSet", + "members": [ + { + "astId": 2628, + "contract": "contracts/L2GraphTokenLockManager.sol:L2GraphTokenLockManager", + "label": "_inner", + "offset": 0, + "slot": "0", + "type": "t_struct(Set)2364_storage" + } + ], + "numberOfBytes": "64" + }, + "t_struct(Set)2364_storage": { + "encoding": "inplace", + "label": "struct EnumerableSet.Set", + "members": [ + { + "astId": 2359, + "contract": "contracts/L2GraphTokenLockManager.sol:L2GraphTokenLockManager", + "label": "_values", + "offset": 0, + "slot": "0", + "type": "t_array(t_bytes32)dyn_storage" + }, + { + "astId": 2363, + "contract": "contracts/L2GraphTokenLockManager.sol:L2GraphTokenLockManager", + "label": "_indexes", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_bytes32,t_uint256)" + } + ], + "numberOfBytes": "64" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} \ No newline at end of file diff --git a/packages/token-distribution/deployments/arbitrum-one/L2GraphTokenLockManager-MIPs.json b/packages/token-distribution/deployments/arbitrum-one/L2GraphTokenLockManager-MIPs.json new file mode 100644 index 000000000..8ef6613eb --- /dev/null +++ b/packages/token-distribution/deployments/arbitrum-one/L2GraphTokenLockManager-MIPs.json @@ -0,0 +1,1161 @@ +{ + "address": "0xf2F89D0bB013c9c292B8E398903e421a1028bDA5", + "abi": [ + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_graphToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_masterCopy", + "type": "address" + }, + { + "internalType": "address", + "name": "_l2Gateway", + "type": "address" + }, + { + "internalType": "address", + "name": "_l1TransferTool", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes4", + "name": "sigHash", + "type": "bytes4" + }, + { + "indexed": true, + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "indexed": false, + "internalType": "string", + "name": "signature", + "type": "string" + } + ], + "name": "FunctionCallAuth", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "l1Address", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "l2Address", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "LockedTokensReceivedFromL1", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "masterCopy", + "type": "address" + } + ], + "name": "MasterCopyUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "proxy", + "type": "address" + } + ], + "name": "ProxyCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "dst", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "TokenDestinationAllowed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "contractAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "initHash", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "managedAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "startTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "endTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "periods", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "releaseStartTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "vestingCliffTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "enum IGraphTokenLock.Revocability", + "name": "revocable", + "type": "uint8" + } + ], + "name": "TokenLockCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "contractAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "initHash", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "managedAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "startTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "endTime", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "l1Address", + "type": "address" + } + ], + "name": "TokenLockCreatedFromL1", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensDeposited", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensWithdrawn", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_dst", + "type": "address" + } + ], + "name": "addTokenDestination", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "", + "type": "bytes4" + } + ], + "name": "authFnCalls", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_owner", + "type": "address" + }, + { + "internalType": "address", + "name": "_beneficiary", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_managedAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_startTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_endTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_periods", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_releaseStartTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_vestingCliffTime", + "type": "uint256" + }, + { + "internalType": "enum IGraphTokenLock.Revocability", + "name": "_revocable", + "type": "uint8" + } + ], + "name": "createTokenLockWallet", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "deposit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_sigHash", + "type": "bytes4" + } + ], + "name": "getAuthFunctionCallTarget", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_salt", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "_implementation", + "type": "address" + }, + { + "internalType": "address", + "name": "_deployer", + "type": "address" + } + ], + "name": "getDeploymentAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "getTokenDestinations", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_sigHash", + "type": "bytes4" + } + ], + "name": "isAuthFunctionCall", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_dst", + "type": "address" + } + ], + "name": "isTokenDestination", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "l1TransferTool", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "l1WalletToL2Wallet", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "l2Gateway", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "l2WalletToL1Wallet", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "masterCopy", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_from", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "onTokenTransfer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_dst", + "type": "address" + } + ], + "name": "removeTokenDestination", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_signature", + "type": "string" + }, + { + "internalType": "address", + "name": "_target", + "type": "address" + } + ], + "name": "setAuthFunctionCall", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string[]", + "name": "_signatures", + "type": "string[]" + }, + { + "internalType": "address[]", + "name": "_targets", + "type": "address[]" + } + ], + "name": "setAuthFunctionCallMany", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_masterCopy", + "type": "address" + } + ], + "name": "setMasterCopy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "token", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_signature", + "type": "string" + } + ], + "name": "unsetAuthFunctionCall", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0xda00bc8ee16463f5491e1d0d5406d2068a44986ad87a7a81c1f8b94ed284e954", + "receipt": { + "to": null, + "from": "0x4528FD7868c91Ef64B9907450Ee8d82dC639612c", + "contractAddress": "0xf2F89D0bB013c9c292B8E398903e421a1028bDA5", + "transactionIndex": 3, + "gasUsed": "26151593", + "logsBloom": "0x00000000000000200000200000000000000004000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000001000000000000000000400000000002000000020000000000000000000800000000000000000000000000000000400000002000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000020000000000000000000000000000000000000000000000010000000004000020000", + "blockHash": "0xce6940bbead1193970faa244e6434732ef3bd91cbc9a2c47e80eec17b9d5647f", + "transactionHash": "0xda00bc8ee16463f5491e1d0d5406d2068a44986ad87a7a81c1f8b94ed284e954", + "logs": [ + { + "transactionIndex": 3, + "blockNumber": 113600719, + "transactionHash": "0xda00bc8ee16463f5491e1d0d5406d2068a44986ad87a7a81c1f8b94ed284e954", + "address": "0xf2F89D0bB013c9c292B8E398903e421a1028bDA5", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000004528fd7868c91ef64b9907450ee8d82dc639612c" + ], + "data": "0x", + "logIndex": 1, + "blockHash": "0xce6940bbead1193970faa244e6434732ef3bd91cbc9a2c47e80eec17b9d5647f" + }, + { + "transactionIndex": 3, + "blockNumber": 113600719, + "transactionHash": "0xda00bc8ee16463f5491e1d0d5406d2068a44986ad87a7a81c1f8b94ed284e954", + "address": "0xf2F89D0bB013c9c292B8E398903e421a1028bDA5", + "topics": [ + "0x30909084afc859121ffc3a5aef7fe37c540a9a1ef60bd4d8dcdb76376fadf9de", + "0x0000000000000000000000006864cdd6d69dbef02e5e06c5534b20fdaf8b51b0" + ], + "data": "0x", + "logIndex": 2, + "blockHash": "0xce6940bbead1193970faa244e6434732ef3bd91cbc9a2c47e80eec17b9d5647f" + } + ], + "blockNumber": 113600719, + "cumulativeGasUsed": "27174901", + "status": 1, + "byzantium": true + }, + "args": [ + "0x9623063377AD1B27544C965cCd7342f7EA7e88C7", + "0x6864Cdd6D69Dbef02E5e06c5534b20fdaf8b51b0", + "0x65E1a5e8946e7E87d9774f5288f41c30a99fD302", + "0xCa82c7Ce3388b0B5d307574099aC57d7a00d509F" + ], + "solcInputHash": "b5cdad58099d39cd1aed000b2fd864d8", + "metadata": "{\"compiler\":{\"version\":\"0.7.3+commit.9bfce1f6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"_graphToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_masterCopy\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_l2Gateway\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_l1TransferTool\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes4\",\"name\":\"sigHash\",\"type\":\"bytes4\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"signature\",\"type\":\"string\"}],\"name\":\"FunctionCallAuth\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"l1Address\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"l2Address\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"LockedTokensReceivedFromL1\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"masterCopy\",\"type\":\"address\"}],\"name\":\"MasterCopyUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"proxy\",\"type\":\"address\"}],\"name\":\"ProxyCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dst\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"}],\"name\":\"TokenDestinationAllowed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"contractAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"initHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"managedAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"startTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"endTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"periods\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"releaseStartTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"vestingCliffTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"enum IGraphTokenLock.Revocability\",\"name\":\"revocable\",\"type\":\"uint8\"}],\"name\":\"TokenLockCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"contractAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"initHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"managedAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"startTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"endTime\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"l1Address\",\"type\":\"address\"}],\"name\":\"TokenLockCreatedFromL1\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensWithdrawn\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_dst\",\"type\":\"address\"}],\"name\":\"addTokenDestination\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"name\":\"authFnCalls\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_beneficiary\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_managedAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_startTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_endTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_periods\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_releaseStartTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_vestingCliffTime\",\"type\":\"uint256\"},{\"internalType\":\"enum IGraphTokenLock.Revocability\",\"name\":\"_revocable\",\"type\":\"uint8\"}],\"name\":\"createTokenLockWallet\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"deposit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"_sigHash\",\"type\":\"bytes4\"}],\"name\":\"getAuthFunctionCallTarget\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_salt\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_deployer\",\"type\":\"address\"}],\"name\":\"getDeploymentAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTokenDestinations\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"_sigHash\",\"type\":\"bytes4\"}],\"name\":\"isAuthFunctionCall\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_dst\",\"type\":\"address\"}],\"name\":\"isTokenDestination\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"l1TransferTool\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"l1WalletToL2Wallet\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"l2Gateway\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"l2WalletToL1Wallet\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"masterCopy\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_from\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"onTokenTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_dst\",\"type\":\"address\"}],\"name\":\"removeTokenDestination\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_signature\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"_target\",\"type\":\"address\"}],\"name\":\"setAuthFunctionCall\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string[]\",\"name\":\"_signatures\",\"type\":\"string[]\"},{\"internalType\":\"address[]\",\"name\":\"_targets\",\"type\":\"address[]\"}],\"name\":\"setAuthFunctionCallMany\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_masterCopy\",\"type\":\"address\"}],\"name\":\"setMasterCopy\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_signature\",\"type\":\"string\"}],\"name\":\"unsetAuthFunctionCall\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"events\":{\"LockedTokensReceivedFromL1(address,address,uint256)\":{\"details\":\"Emitted when locked tokens are received from L1 (whether the wallet had already been received or not)\"},\"TokenLockCreatedFromL1(address,bytes32,address,uint256,uint256,uint256,address)\":{\"details\":\"Event emitted when a wallet is received and created from L1\"}},\"kind\":\"dev\",\"methods\":{\"addTokenDestination(address)\":{\"params\":{\"_dst\":\"Destination address\"}},\"constructor\":{\"params\":{\"_graphToken\":\"Address of the L2 GRT token contract\",\"_l1TransferTool\":\"Address of the L1 transfer tool contract (in L1, without aliasing)\",\"_l2Gateway\":\"Address of the L2GraphTokenGateway contract\",\"_masterCopy\":\"Address of the master copy of the L2GraphTokenLockWallet implementation\"}},\"createTokenLockWallet(address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)\":{\"params\":{\"_beneficiary\":\"Address of the beneficiary of locked tokens\",\"_endTime\":\"End time of the release schedule\",\"_managedAmount\":\"Amount of tokens to be managed by the lock contract\",\"_owner\":\"Address of the contract owner\",\"_periods\":\"Number of periods between start time and end time\",\"_releaseStartTime\":\"Override time for when the releases start\",\"_revocable\":\"Whether the contract is revocable\",\"_startTime\":\"Start time of the release schedule\"}},\"deposit(uint256)\":{\"details\":\"Even if the ERC20 token can be transferred directly to the contract this function provide a safe interface to do the transfer and avoid mistakes\",\"params\":{\"_amount\":\"Amount to deposit\"}},\"getAuthFunctionCallTarget(bytes4)\":{\"params\":{\"_sigHash\":\"Function signature hash\"},\"returns\":{\"_0\":\"Address of the target contract where to send the call\"}},\"getDeploymentAddress(bytes32,address,address)\":{\"params\":{\"_deployer\":\"Address of the deployer that creates the contract\",\"_implementation\":\"Address of the proxy target implementation\",\"_salt\":\"Bytes32 salt to use for CREATE2\"},\"returns\":{\"_0\":\"Address of the counterfactual MinimalProxy\"}},\"getTokenDestinations()\":{\"returns\":{\"_0\":\"Array of addresses authorized to pull funds from a token lock\"}},\"isAuthFunctionCall(bytes4)\":{\"params\":{\"_sigHash\":\"Function signature hash\"},\"returns\":{\"_0\":\"True if authorized\"}},\"isTokenDestination(address)\":{\"params\":{\"_dst\":\"Destination address\"},\"returns\":{\"_0\":\"True if authorized\"}},\"onTokenTransfer(address,uint256,bytes)\":{\"details\":\"This function will create a new wallet if it doesn't exist yet, or send the tokens to the existing wallet if it does.\",\"params\":{\"_amount\":\"Amount of tokens received\",\"_data\":\"Encoded data of the transferred wallet, which must be an ABI-encoded TransferredWalletData struct\",\"_from\":\"Address of the sender in L1, which must be the L1GraphTokenLockTransferTool\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"removeTokenDestination(address)\":{\"params\":{\"_dst\":\"Destination address\"}},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"setAuthFunctionCall(string,address)\":{\"details\":\"Input expected is the function signature as 'transfer(address,uint256)'\",\"params\":{\"_signature\":\"Function signature\",\"_target\":\"Address of the destination contract to call\"}},\"setAuthFunctionCallMany(string[],address[])\":{\"details\":\"Input expected is the function signature as 'transfer(address,uint256)'\",\"params\":{\"_signatures\":\"Function signatures\",\"_targets\":\"Address of the destination contract to call\"}},\"setMasterCopy(address)\":{\"params\":{\"_masterCopy\":\"Address of contract bytecode to factory clone\"}},\"token()\":{\"returns\":{\"_0\":\"Token used for transfers and approvals\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"unsetAuthFunctionCall(string)\":{\"details\":\"Input expected is the function signature as 'transfer(address,uint256)'\",\"params\":{\"_signature\":\"Function signature\"}},\"withdraw(uint256)\":{\"details\":\"Escape hatch in case of mistakes or to recover remaining funds\",\"params\":{\"_amount\":\"Amount of tokens to withdraw\"}}},\"title\":\"L2GraphTokenLockManager\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"addTokenDestination(address)\":{\"notice\":\"Adds an address that can be allowed by a token lock to pull funds\"},\"constructor\":{\"notice\":\"Constructor for the L2GraphTokenLockManager contract.\"},\"createTokenLockWallet(address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)\":{\"notice\":\"Creates and fund a new token lock wallet using a minimum proxy\"},\"deposit(uint256)\":{\"notice\":\"Deposits tokens into the contract\"},\"getAuthFunctionCallTarget(bytes4)\":{\"notice\":\"Gets the target contract to call for a particular function signature\"},\"getDeploymentAddress(bytes32,address,address)\":{\"notice\":\"Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation\"},\"getTokenDestinations()\":{\"notice\":\"Returns an array of authorized destination addresses\"},\"isAuthFunctionCall(bytes4)\":{\"notice\":\"Returns true if the function call is authorized\"},\"isTokenDestination(address)\":{\"notice\":\"Returns True if the address is authorized to be a destination of tokens\"},\"l1TransferTool()\":{\"notice\":\"Address of the L1 transfer tool contract (in L1, no aliasing)\"},\"l1WalletToL2Wallet(address)\":{\"notice\":\"Mapping of each L1 wallet to its L2 wallet counterpart (populated when each wallet is received) L1 address => L2 address\"},\"l2Gateway()\":{\"notice\":\"Address of the L2GraphTokenGateway\"},\"l2WalletToL1Wallet(address)\":{\"notice\":\"Mapping of each L2 wallet to its L1 wallet counterpart (populated when each wallet is received) L2 address => L1 address\"},\"onTokenTransfer(address,uint256,bytes)\":{\"notice\":\"This function is called by the L2GraphTokenGateway when tokens are sent from L1.\"},\"removeTokenDestination(address)\":{\"notice\":\"Removes an address that can be allowed by a token lock to pull funds\"},\"setAuthFunctionCall(string,address)\":{\"notice\":\"Sets an authorized function call to target\"},\"setAuthFunctionCallMany(string[],address[])\":{\"notice\":\"Sets an authorized function call to target in bulk\"},\"setMasterCopy(address)\":{\"notice\":\"Sets the masterCopy bytecode to use to create clones of TokenLock contracts\"},\"token()\":{\"notice\":\"Gets the GRT token address\"},\"unsetAuthFunctionCall(string)\":{\"notice\":\"Unsets an authorized function call to target\"},\"withdraw(uint256)\":{\"notice\":\"Withdraws tokens from the contract\"}},\"notice\":\"This contract manages a list of authorized function calls and targets that can be called by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts. This contract receives funds to make the process of creating TokenLockWallet contracts easier by distributing them the initial tokens to be managed. In particular, this L2 variant is designed to receive token lock wallets from L1, through the GRT bridge. These transferred wallets will not allow releasing funds in L2 until the end of the vesting timeline, but they can allow withdrawing funds back to L1 using the L2GraphTokenLockTransferTool contract. The owner can setup a list of token destinations that will be used by TokenLock contracts to approve the pulling of funds, this way in can be guaranteed that only protocol contracts will manipulate users funds.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/L2GraphTokenLockManager.sol\":\"L2GraphTokenLockManager\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor () internal {\\n address msgSender = _msgSender();\\n _owner = msgSender;\\n emit OwnershipTransferred(address(0), msgSender);\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n emit OwnershipTransferred(_owner, address(0));\\n _owner = address(0);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n emit OwnershipTransferred(_owner, newOwner);\\n _owner = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0x15e2d5bd4c28a88548074c54d220e8086f638a71ed07e6b3ba5a70066fcf458d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/math/SafeMath.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Wrappers over Solidity's arithmetic operations with added overflow\\n * checks.\\n *\\n * Arithmetic operations in Solidity wrap on overflow. This can easily result\\n * in bugs, because programmers usually assume that an overflow raises an\\n * error, which is the standard behavior in high level programming languages.\\n * `SafeMath` restores this intuition by reverting the transaction when an\\n * operation overflows.\\n *\\n * Using this library instead of the unchecked operations eliminates an entire\\n * class of bugs, so it's recommended to use it always.\\n */\\nlibrary SafeMath {\\n /**\\n * @dev Returns the addition of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n uint256 c = a + b;\\n if (c < a) return (false, 0);\\n return (true, c);\\n }\\n\\n /**\\n * @dev Returns the substraction of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b > a) return (false, 0);\\n return (true, a - b);\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\\n if (a == 0) return (true, 0);\\n uint256 c = a * b;\\n if (c / a != b) return (false, 0);\\n return (true, c);\\n }\\n\\n /**\\n * @dev Returns the division of two unsigned integers, with a division by zero flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b == 0) return (false, 0);\\n return (true, a / b);\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b == 0) return (false, 0);\\n return (true, a % b);\\n }\\n\\n /**\\n * @dev Returns the addition of two unsigned integers, reverting on\\n * overflow.\\n *\\n * Counterpart to Solidity's `+` operator.\\n *\\n * Requirements:\\n *\\n * - Addition cannot overflow.\\n */\\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\\n uint256 c = a + b;\\n require(c >= a, \\\"SafeMath: addition overflow\\\");\\n return c;\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting on\\n * overflow (when the result is negative).\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n *\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b <= a, \\\"SafeMath: subtraction overflow\\\");\\n return a - b;\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, reverting on\\n * overflow.\\n *\\n * Counterpart to Solidity's `*` operator.\\n *\\n * Requirements:\\n *\\n * - Multiplication cannot overflow.\\n */\\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\\n if (a == 0) return 0;\\n uint256 c = a * b;\\n require(c / a == b, \\\"SafeMath: multiplication overflow\\\");\\n return c;\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers, reverting on\\n * division by zero. The result is rounded towards zero.\\n *\\n * Counterpart to Solidity's `/` operator. Note: this function uses a\\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\\n * uses an invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b > 0, \\\"SafeMath: division by zero\\\");\\n return a / b;\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * reverting when dividing by zero.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b > 0, \\\"SafeMath: modulo by zero\\\");\\n return a % b;\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\\n * overflow (when the result is negative).\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {trySub}.\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n *\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b <= a, errorMessage);\\n return a - b;\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers, reverting with custom message on\\n * division by zero. The result is rounded towards zero.\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {tryDiv}.\\n *\\n * Counterpart to Solidity's `/` operator. Note: this function uses a\\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\\n * uses an invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b > 0, errorMessage);\\n return a / b;\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * reverting with custom message when dividing by zero.\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {tryMod}.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b > 0, errorMessage);\\n return a % b;\\n }\\n}\\n\",\"keccak256\":\"0xcc78a17dd88fa5a2edc60c8489e2f405c0913b377216a5b26b35656b2d0dab52\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `recipient`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address recipient, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `sender` to `recipient` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n}\\n\",\"keccak256\":\"0x5f02220344881ce43204ae4a6281145a67bc52c2bb1290a791857df3d19d78f5\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\nimport \\\"./IERC20.sol\\\";\\nimport \\\"../../math/SafeMath.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @title SafeERC20\\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\\n * contract returns false). Tokens that return no value (and instead revert or\\n * throw on failure) are also supported, non-reverting calls are assumed to be\\n * successful.\\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\n */\\nlibrary SafeERC20 {\\n using SafeMath for uint256;\\n using Address for address;\\n\\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\\n }\\n\\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\\n }\\n\\n /**\\n * @dev Deprecated. This function has issues similar to the ones found in\\n * {IERC20-approve}, and its usage is discouraged.\\n *\\n * Whenever possible, use {safeIncreaseAllowance} and\\n * {safeDecreaseAllowance} instead.\\n */\\n function safeApprove(IERC20 token, address spender, uint256 value) internal {\\n // safeApprove should only be called when setting an initial allowance,\\n // or when resetting it to zero. To increase and decrease it, use\\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\\n // solhint-disable-next-line max-line-length\\n require((value == 0) || (token.allowance(address(this), spender) == 0),\\n \\\"SafeERC20: approve from non-zero to non-zero allowance\\\"\\n );\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\\n }\\n\\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n uint256 newAllowance = token.allowance(address(this), spender).add(value);\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n uint256 newAllowance = token.allowance(address(this), spender).sub(value, \\\"SafeERC20: decreased allowance below zero\\\");\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n */\\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that\\n // the target address contains contract code and also asserts for success in the low-level call.\\n\\n bytes memory returndata = address(token).functionCall(data, \\\"SafeERC20: low-level call failed\\\");\\n if (returndata.length > 0) { // Return data is optional\\n // solhint-disable-next-line max-line-length\\n require(abi.decode(returndata, (bool)), \\\"SafeERC20: ERC20 operation did not succeed\\\");\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf12dfbe97e6276980b83d2830bb0eb75e0cf4f3e626c2471137f82158ae6a0fc\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.2 <0.8.0;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize, which returns 0 for contracts in\\n // construction, since the code is only stored at the end of the\\n // constructor execution.\\n\\n uint256 size;\\n // solhint-disable-next-line no-inline-assembly\\n assembly { size := extcodesize(account) }\\n return size > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls, avoid-call-value\\n (bool success, ) = recipient.call{ value: amount }(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain`call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.call{ value: value }(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x28911e614500ae7c607a432a709d35da25f3bc5ddc8bd12b278b66358070c0ea\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/*\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with GSN meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address payable) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes memory) {\\n this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0x8d3cb350f04ff49cfb10aef08d87f19dcbaecc8027b0bed12f3275cd12f38cf0\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Create2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Helper to make usage of the `CREATE2` EVM opcode easier and safer.\\n * `CREATE2` can be used to compute in advance the address where a smart\\n * contract will be deployed, which allows for interesting new mechanisms known\\n * as 'counterfactual interactions'.\\n *\\n * See the https://eips.ethereum.org/EIPS/eip-1014#motivation[EIP] for more\\n * information.\\n */\\nlibrary Create2 {\\n /**\\n * @dev Deploys a contract using `CREATE2`. The address where the contract\\n * will be deployed can be known in advance via {computeAddress}.\\n *\\n * The bytecode for a contract can be obtained from Solidity with\\n * `type(contractName).creationCode`.\\n *\\n * Requirements:\\n *\\n * - `bytecode` must not be empty.\\n * - `salt` must have not been used for `bytecode` already.\\n * - the factory must have a balance of at least `amount`.\\n * - if `amount` is non-zero, `bytecode` must have a `payable` constructor.\\n */\\n function deploy(uint256 amount, bytes32 salt, bytes memory bytecode) internal returns (address) {\\n address addr;\\n require(address(this).balance >= amount, \\\"Create2: insufficient balance\\\");\\n require(bytecode.length != 0, \\\"Create2: bytecode length is zero\\\");\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n addr := create2(amount, add(bytecode, 0x20), mload(bytecode), salt)\\n }\\n require(addr != address(0), \\\"Create2: Failed on deploy\\\");\\n return addr;\\n }\\n\\n /**\\n * @dev Returns the address where a contract will be stored if deployed via {deploy}. Any change in the\\n * `bytecodeHash` or `salt` will result in a new destination address.\\n */\\n function computeAddress(bytes32 salt, bytes32 bytecodeHash) internal view returns (address) {\\n return computeAddress(salt, bytecodeHash, address(this));\\n }\\n\\n /**\\n * @dev Returns the address where a contract will be stored if deployed via {deploy} from a contract located at\\n * `deployer`. If `deployer` is this contract's address, returns the same value as {computeAddress}.\\n */\\n function computeAddress(bytes32 salt, bytes32 bytecodeHash, address deployer) internal pure returns (address) {\\n bytes32 _data = keccak256(\\n abi.encodePacked(bytes1(0xff), deployer, salt, bytecodeHash)\\n );\\n return address(uint160(uint256(_data)));\\n }\\n}\\n\",\"keccak256\":\"0x0a0b021149946014fe1cd04af11e7a937a29986c47e8b1b718c2d50d729472db\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/EnumerableSet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Library for managing\\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\\n * types.\\n *\\n * Sets have the following properties:\\n *\\n * - Elements are added, removed, and checked for existence in constant time\\n * (O(1)).\\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\\n *\\n * ```\\n * contract Example {\\n * // Add the library methods\\n * using EnumerableSet for EnumerableSet.AddressSet;\\n *\\n * // Declare a set state variable\\n * EnumerableSet.AddressSet private mySet;\\n * }\\n * ```\\n *\\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\\n * and `uint256` (`UintSet`) are supported.\\n */\\nlibrary EnumerableSet {\\n // To implement this library for multiple types with as little code\\n // repetition as possible, we write it in terms of a generic Set type with\\n // bytes32 values.\\n // The Set implementation uses private functions, and user-facing\\n // implementations (such as AddressSet) are just wrappers around the\\n // underlying Set.\\n // This means that we can only create new EnumerableSets for types that fit\\n // in bytes32.\\n\\n struct Set {\\n // Storage of set values\\n bytes32[] _values;\\n\\n // Position of the value in the `values` array, plus 1 because index 0\\n // means a value is not in the set.\\n mapping (bytes32 => uint256) _indexes;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function _add(Set storage set, bytes32 value) private returns (bool) {\\n if (!_contains(set, value)) {\\n set._values.push(value);\\n // The value is stored at length-1, but we add 1 to all indexes\\n // and use 0 as a sentinel value\\n set._indexes[value] = set._values.length;\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function _remove(Set storage set, bytes32 value) private returns (bool) {\\n // We read and store the value's index to prevent multiple reads from the same storage slot\\n uint256 valueIndex = set._indexes[value];\\n\\n if (valueIndex != 0) { // Equivalent to contains(set, value)\\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\\n // the array, and then remove the last element (sometimes called as 'swap and pop').\\n // This modifies the order of the array, as noted in {at}.\\n\\n uint256 toDeleteIndex = valueIndex - 1;\\n uint256 lastIndex = set._values.length - 1;\\n\\n // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs\\n // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.\\n\\n bytes32 lastvalue = set._values[lastIndex];\\n\\n // Move the last value to the index where the value to delete is\\n set._values[toDeleteIndex] = lastvalue;\\n // Update the index for the moved value\\n set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based\\n\\n // Delete the slot where the moved value was stored\\n set._values.pop();\\n\\n // Delete the index for the deleted slot\\n delete set._indexes[value];\\n\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\\n return set._indexes[value] != 0;\\n }\\n\\n /**\\n * @dev Returns the number of values on the set. O(1).\\n */\\n function _length(Set storage set) private view returns (uint256) {\\n return set._values.length;\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\\n require(set._values.length > index, \\\"EnumerableSet: index out of bounds\\\");\\n return set._values[index];\\n }\\n\\n // Bytes32Set\\n\\n struct Bytes32Set {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _add(set._inner, value);\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _remove(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\\n return _contains(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(Bytes32Set storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\\n return _at(set._inner, index);\\n }\\n\\n // AddressSet\\n\\n struct AddressSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(AddressSet storage set, address value) internal returns (bool) {\\n return _add(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(AddressSet storage set, address value) internal returns (bool) {\\n return _remove(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(AddressSet storage set, address value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(AddressSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\\n return address(uint160(uint256(_at(set._inner, index))));\\n }\\n\\n\\n // UintSet\\n\\n struct UintSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(UintSet storage set, uint256 value) internal returns (bool) {\\n return _add(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\\n return _remove(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns the number of values on the set. O(1).\\n */\\n function length(UintSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\\n return uint256(_at(set._inner, index));\\n }\\n}\\n\",\"keccak256\":\"0x1562cd9922fbf739edfb979f506809e2743789cbde3177515542161c3d04b164\",\"license\":\"MIT\"},\"contracts/GraphTokenLock.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nimport \\\"@openzeppelin/contracts/math/SafeMath.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\\\";\\n\\nimport { Ownable as OwnableInitializable } from \\\"./Ownable.sol\\\";\\nimport \\\"./MathUtils.sol\\\";\\nimport \\\"./IGraphTokenLock.sol\\\";\\n\\n/**\\n * @title GraphTokenLock\\n * @notice Contract that manages an unlocking schedule of tokens.\\n * @dev The contract lock manage a number of tokens deposited into the contract to ensure that\\n * they can only be released under certain time conditions.\\n *\\n * This contract implements a release scheduled based on periods and tokens are released in steps\\n * after each period ends. It can be configured with one period in which case it is like a plain TimeLock.\\n * It also supports revocation to be used for vesting schedules.\\n *\\n * The contract supports receiving extra funds than the managed tokens ones that can be\\n * withdrawn by the beneficiary at any time.\\n *\\n * A releaseStartTime parameter is included to override the default release schedule and\\n * perform the first release on the configured time. After that it will continue with the\\n * default schedule.\\n */\\nabstract contract GraphTokenLock is OwnableInitializable, IGraphTokenLock {\\n using SafeMath for uint256;\\n using SafeERC20 for IERC20;\\n\\n uint256 private constant MIN_PERIOD = 1;\\n\\n // -- State --\\n\\n IERC20 public token;\\n address public beneficiary;\\n\\n // Configuration\\n\\n // Amount of tokens managed by the contract schedule\\n uint256 public managedAmount;\\n\\n uint256 public startTime; // Start datetime (in unixtimestamp)\\n uint256 public endTime; // Datetime after all funds are fully vested/unlocked (in unixtimestamp)\\n uint256 public periods; // Number of vesting/release periods\\n\\n // First release date for tokens (in unixtimestamp)\\n // If set, no tokens will be released before releaseStartTime ignoring\\n // the amount to release each period\\n uint256 public releaseStartTime;\\n // A cliff set a date to which a beneficiary needs to get to vest\\n // all preceding periods\\n uint256 public vestingCliffTime;\\n Revocability public revocable; // Whether to use vesting for locked funds\\n\\n // State\\n\\n bool public isRevoked;\\n bool public isInitialized;\\n bool public isAccepted;\\n uint256 public releasedAmount;\\n uint256 public revokedAmount;\\n\\n // -- Events --\\n\\n event TokensReleased(address indexed beneficiary, uint256 amount);\\n event TokensWithdrawn(address indexed beneficiary, uint256 amount);\\n event TokensRevoked(address indexed beneficiary, uint256 amount);\\n event BeneficiaryChanged(address newBeneficiary);\\n event LockAccepted();\\n event LockCanceled();\\n\\n /**\\n * @dev Only allow calls from the beneficiary of the contract\\n */\\n modifier onlyBeneficiary() {\\n require(msg.sender == beneficiary, \\\"!auth\\\");\\n _;\\n }\\n\\n /**\\n * @notice Initializes the contract\\n * @param _owner Address of the contract owner\\n * @param _beneficiary Address of the beneficiary of locked tokens\\n * @param _managedAmount Amount of tokens to be managed by the lock contract\\n * @param _startTime Start time of the release schedule\\n * @param _endTime End time of the release schedule\\n * @param _periods Number of periods between start time and end time\\n * @param _releaseStartTime Override time for when the releases start\\n * @param _vestingCliffTime Override time for when the vesting start\\n * @param _revocable Whether the contract is revocable\\n */\\n function _initialize(\\n address _owner,\\n address _beneficiary,\\n address _token,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n Revocability _revocable\\n ) internal {\\n require(!isInitialized, \\\"Already initialized\\\");\\n require(_owner != address(0), \\\"Owner cannot be zero\\\");\\n require(_beneficiary != address(0), \\\"Beneficiary cannot be zero\\\");\\n require(_token != address(0), \\\"Token cannot be zero\\\");\\n require(_managedAmount > 0, \\\"Managed tokens cannot be zero\\\");\\n require(_startTime != 0, \\\"Start time must be set\\\");\\n require(_startTime < _endTime, \\\"Start time > end time\\\");\\n require(_periods >= MIN_PERIOD, \\\"Periods cannot be below minimum\\\");\\n require(_revocable != Revocability.NotSet, \\\"Must set a revocability option\\\");\\n require(_releaseStartTime < _endTime, \\\"Release start time must be before end time\\\");\\n require(_vestingCliffTime < _endTime, \\\"Cliff time must be before end time\\\");\\n\\n isInitialized = true;\\n\\n OwnableInitializable._initialize(_owner);\\n beneficiary = _beneficiary;\\n token = IERC20(_token);\\n\\n managedAmount = _managedAmount;\\n\\n startTime = _startTime;\\n endTime = _endTime;\\n periods = _periods;\\n\\n // Optionals\\n releaseStartTime = _releaseStartTime;\\n vestingCliffTime = _vestingCliffTime;\\n revocable = _revocable;\\n }\\n\\n /**\\n * @notice Change the beneficiary of funds managed by the contract\\n * @dev Can only be called by the beneficiary\\n * @param _newBeneficiary Address of the new beneficiary address\\n */\\n function changeBeneficiary(address _newBeneficiary) external onlyBeneficiary {\\n require(_newBeneficiary != address(0), \\\"Empty beneficiary\\\");\\n beneficiary = _newBeneficiary;\\n emit BeneficiaryChanged(_newBeneficiary);\\n }\\n\\n /**\\n * @notice Beneficiary accepts the lock, the owner cannot retrieve back the tokens\\n * @dev Can only be called by the beneficiary\\n */\\n function acceptLock() external onlyBeneficiary {\\n isAccepted = true;\\n emit LockAccepted();\\n }\\n\\n /**\\n * @notice Owner cancel the lock and return the balance in the contract\\n * @dev Can only be called by the owner\\n */\\n function cancelLock() external onlyOwner {\\n require(isAccepted == false, \\\"Cannot cancel accepted contract\\\");\\n\\n token.safeTransfer(owner(), currentBalance());\\n\\n emit LockCanceled();\\n }\\n\\n // -- Balances --\\n\\n /**\\n * @notice Returns the amount of tokens currently held by the contract\\n * @return Tokens held in the contract\\n */\\n function currentBalance() public view override returns (uint256) {\\n return token.balanceOf(address(this));\\n }\\n\\n // -- Time & Periods --\\n\\n /**\\n * @notice Returns the current block timestamp\\n * @return Current block timestamp\\n */\\n function currentTime() public view override returns (uint256) {\\n return block.timestamp;\\n }\\n\\n /**\\n * @notice Gets duration of contract from start to end in seconds\\n * @return Amount of seconds from contract startTime to endTime\\n */\\n function duration() public view override returns (uint256) {\\n return endTime.sub(startTime);\\n }\\n\\n /**\\n * @notice Gets time elapsed since the start of the contract\\n * @dev Returns zero if called before conctract starTime\\n * @return Seconds elapsed from contract startTime\\n */\\n function sinceStartTime() public view override returns (uint256) {\\n uint256 current = currentTime();\\n if (current <= startTime) {\\n return 0;\\n }\\n return current.sub(startTime);\\n }\\n\\n /**\\n * @notice Returns amount available to be released after each period according to schedule\\n * @return Amount of tokens available after each period\\n */\\n function amountPerPeriod() public view override returns (uint256) {\\n return managedAmount.div(periods);\\n }\\n\\n /**\\n * @notice Returns the duration of each period in seconds\\n * @return Duration of each period in seconds\\n */\\n function periodDuration() public view override returns (uint256) {\\n return duration().div(periods);\\n }\\n\\n /**\\n * @notice Gets the current period based on the schedule\\n * @return A number that represents the current period\\n */\\n function currentPeriod() public view override returns (uint256) {\\n return sinceStartTime().div(periodDuration()).add(MIN_PERIOD);\\n }\\n\\n /**\\n * @notice Gets the number of periods that passed since the first period\\n * @return A number of periods that passed since the schedule started\\n */\\n function passedPeriods() public view override returns (uint256) {\\n return currentPeriod().sub(MIN_PERIOD);\\n }\\n\\n // -- Locking & Release Schedule --\\n\\n /**\\n * @notice Gets the currently available token according to the schedule\\n * @dev Implements the step-by-step schedule based on periods for available tokens\\n * @return Amount of tokens available according to the schedule\\n */\\n function availableAmount() public view override returns (uint256) {\\n uint256 current = currentTime();\\n\\n // Before contract start no funds are available\\n if (current < startTime) {\\n return 0;\\n }\\n\\n // After contract ended all funds are available\\n if (current > endTime) {\\n return managedAmount;\\n }\\n\\n // Get available amount based on period\\n return passedPeriods().mul(amountPerPeriod());\\n }\\n\\n /**\\n * @notice Gets the amount of currently vested tokens\\n * @dev Similar to available amount, but is fully vested when contract is non-revocable\\n * @return Amount of tokens already vested\\n */\\n function vestedAmount() public view override returns (uint256) {\\n // If non-revocable it is fully vested\\n if (revocable == Revocability.Disabled) {\\n return managedAmount;\\n }\\n\\n // Vesting cliff is activated and it has not passed means nothing is vested yet\\n if (vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\\n return 0;\\n }\\n\\n return availableAmount();\\n }\\n\\n /**\\n * @notice Gets tokens currently available for release\\n * @dev Considers the schedule and takes into account already released tokens\\n * @return Amount of tokens ready to be released\\n */\\n function releasableAmount() public view virtual override returns (uint256) {\\n // If a release start time is set no tokens are available for release before this date\\n // If not set it follows the default schedule and tokens are available on\\n // the first period passed\\n if (releaseStartTime > 0 && currentTime() < releaseStartTime) {\\n return 0;\\n }\\n\\n // Vesting cliff is activated and it has not passed means nothing is vested yet\\n // so funds cannot be released\\n if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\\n return 0;\\n }\\n\\n // A beneficiary can never have more releasable tokens than the contract balance\\n uint256 releasable = availableAmount().sub(releasedAmount);\\n return MathUtils.min(currentBalance(), releasable);\\n }\\n\\n /**\\n * @notice Gets the outstanding amount yet to be released based on the whole contract lifetime\\n * @dev Does not consider schedule but just global amounts tracked\\n * @return Amount of outstanding tokens for the lifetime of the contract\\n */\\n function totalOutstandingAmount() public view override returns (uint256) {\\n return managedAmount.sub(releasedAmount).sub(revokedAmount);\\n }\\n\\n /**\\n * @notice Gets surplus amount in the contract based on outstanding amount to release\\n * @dev All funds over outstanding amount is considered surplus that can be withdrawn by beneficiary.\\n * Note this might not be the correct value for wallets transferred to L2 (i.e. an L2GraphTokenLockWallet), as the released amount will be\\n * skewed, so the beneficiary might have to bridge back to L1 to release the surplus.\\n * @return Amount of tokens considered as surplus\\n */\\n function surplusAmount() public view override returns (uint256) {\\n uint256 balance = currentBalance();\\n uint256 outstandingAmount = totalOutstandingAmount();\\n if (balance > outstandingAmount) {\\n return balance.sub(outstandingAmount);\\n }\\n return 0;\\n }\\n\\n // -- Value Transfer --\\n\\n /**\\n * @notice Releases tokens based on the configured schedule\\n * @dev All available releasable tokens are transferred to beneficiary\\n */\\n function release() external override onlyBeneficiary {\\n uint256 amountToRelease = releasableAmount();\\n require(amountToRelease > 0, \\\"No available releasable amount\\\");\\n\\n releasedAmount = releasedAmount.add(amountToRelease);\\n\\n token.safeTransfer(beneficiary, amountToRelease);\\n\\n emit TokensReleased(beneficiary, amountToRelease);\\n }\\n\\n /**\\n * @notice Withdraws surplus, unmanaged tokens from the contract\\n * @dev Tokens in the contract over outstanding amount are considered as surplus\\n * @param _amount Amount of tokens to withdraw\\n */\\n function withdrawSurplus(uint256 _amount) external override onlyBeneficiary {\\n require(_amount > 0, \\\"Amount cannot be zero\\\");\\n require(surplusAmount() >= _amount, \\\"Amount requested > surplus available\\\");\\n\\n token.safeTransfer(beneficiary, _amount);\\n\\n emit TokensWithdrawn(beneficiary, _amount);\\n }\\n\\n /**\\n * @notice Revokes a vesting schedule and return the unvested tokens to the owner\\n * @dev Vesting schedule is always calculated based on managed tokens\\n */\\n function revoke() external override onlyOwner {\\n require(revocable == Revocability.Enabled, \\\"Contract is non-revocable\\\");\\n require(isRevoked == false, \\\"Already revoked\\\");\\n\\n uint256 unvestedAmount = managedAmount.sub(vestedAmount());\\n require(unvestedAmount > 0, \\\"No available unvested amount\\\");\\n\\n revokedAmount = unvestedAmount;\\n isRevoked = true;\\n\\n token.safeTransfer(owner(), unvestedAmount);\\n\\n emit TokensRevoked(beneficiary, unvestedAmount);\\n }\\n}\\n\",\"keccak256\":\"0xd89470956a476c2fcf4a09625775573f95ba2c60a57fe866d90f65de1bcf5f2d\",\"license\":\"MIT\"},\"contracts/GraphTokenLockManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/EnumerableSet.sol\\\";\\nimport { Ownable } from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\n\\nimport \\\"./MinimalProxyFactory.sol\\\";\\nimport \\\"./IGraphTokenLockManager.sol\\\";\\nimport { GraphTokenLockWallet } from \\\"./GraphTokenLockWallet.sol\\\";\\n\\n/**\\n * @title GraphTokenLockManager\\n * @notice This contract manages a list of authorized function calls and targets that can be called\\n * by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts.\\n *\\n * This contract receives funds to make the process of creating TokenLockWallet contracts\\n * easier by distributing them the initial tokens to be managed.\\n *\\n * The owner can setup a list of token destinations that will be used by TokenLock contracts to\\n * approve the pulling of funds, this way in can be guaranteed that only protocol contracts\\n * will manipulate users funds.\\n */\\ncontract GraphTokenLockManager is Ownable, MinimalProxyFactory, IGraphTokenLockManager {\\n using SafeERC20 for IERC20;\\n using EnumerableSet for EnumerableSet.AddressSet;\\n\\n // -- State --\\n\\n mapping(bytes4 => address) public authFnCalls;\\n EnumerableSet.AddressSet private _tokenDestinations;\\n\\n address public masterCopy;\\n IERC20 internal _token;\\n\\n // -- Events --\\n\\n event MasterCopyUpdated(address indexed masterCopy);\\n event TokenLockCreated(\\n address indexed contractAddress,\\n bytes32 indexed initHash,\\n address indexed beneficiary,\\n address token,\\n uint256 managedAmount,\\n uint256 startTime,\\n uint256 endTime,\\n uint256 periods,\\n uint256 releaseStartTime,\\n uint256 vestingCliffTime,\\n IGraphTokenLock.Revocability revocable\\n );\\n\\n event TokensDeposited(address indexed sender, uint256 amount);\\n event TokensWithdrawn(address indexed sender, uint256 amount);\\n\\n event FunctionCallAuth(address indexed caller, bytes4 indexed sigHash, address indexed target, string signature);\\n event TokenDestinationAllowed(address indexed dst, bool allowed);\\n\\n /**\\n * Constructor.\\n * @param _graphToken Token to use for deposits and withdrawals\\n * @param _masterCopy Address of the master copy to use to clone proxies\\n */\\n constructor(IERC20 _graphToken, address _masterCopy) {\\n require(address(_graphToken) != address(0), \\\"Token cannot be zero\\\");\\n _token = _graphToken;\\n setMasterCopy(_masterCopy);\\n }\\n\\n // -- Factory --\\n\\n /**\\n * @notice Sets the masterCopy bytecode to use to create clones of TokenLock contracts\\n * @param _masterCopy Address of contract bytecode to factory clone\\n */\\n function setMasterCopy(address _masterCopy) public override onlyOwner {\\n require(_masterCopy != address(0), \\\"MasterCopy cannot be zero\\\");\\n masterCopy = _masterCopy;\\n emit MasterCopyUpdated(_masterCopy);\\n }\\n\\n /**\\n * @notice Creates and fund a new token lock wallet using a minimum proxy\\n * @param _owner Address of the contract owner\\n * @param _beneficiary Address of the beneficiary of locked tokens\\n * @param _managedAmount Amount of tokens to be managed by the lock contract\\n * @param _startTime Start time of the release schedule\\n * @param _endTime End time of the release schedule\\n * @param _periods Number of periods between start time and end time\\n * @param _releaseStartTime Override time for when the releases start\\n * @param _revocable Whether the contract is revocable\\n */\\n function createTokenLockWallet(\\n address _owner,\\n address _beneficiary,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n IGraphTokenLock.Revocability _revocable\\n ) external override onlyOwner {\\n require(_token.balanceOf(address(this)) >= _managedAmount, \\\"Not enough tokens to create lock\\\");\\n\\n // Create contract using a minimal proxy and call initializer\\n bytes memory initializer = abi.encodeWithSelector(\\n GraphTokenLockWallet.initialize.selector,\\n address(this),\\n _owner,\\n _beneficiary,\\n address(_token),\\n _managedAmount,\\n _startTime,\\n _endTime,\\n _periods,\\n _releaseStartTime,\\n _vestingCliffTime,\\n _revocable\\n );\\n address contractAddress = _deployProxy2(keccak256(initializer), masterCopy, initializer);\\n\\n // Send managed amount to the created contract\\n _token.safeTransfer(contractAddress, _managedAmount);\\n\\n emit TokenLockCreated(\\n contractAddress,\\n keccak256(initializer),\\n _beneficiary,\\n address(_token),\\n _managedAmount,\\n _startTime,\\n _endTime,\\n _periods,\\n _releaseStartTime,\\n _vestingCliffTime,\\n _revocable\\n );\\n }\\n\\n // -- Funds Management --\\n\\n /**\\n * @notice Gets the GRT token address\\n * @return Token used for transfers and approvals\\n */\\n function token() external view override returns (IERC20) {\\n return _token;\\n }\\n\\n /**\\n * @notice Deposits tokens into the contract\\n * @dev Even if the ERC20 token can be transferred directly to the contract\\n * this function provide a safe interface to do the transfer and avoid mistakes\\n * @param _amount Amount to deposit\\n */\\n function deposit(uint256 _amount) external override {\\n require(_amount > 0, \\\"Amount cannot be zero\\\");\\n _token.safeTransferFrom(msg.sender, address(this), _amount);\\n emit TokensDeposited(msg.sender, _amount);\\n }\\n\\n /**\\n * @notice Withdraws tokens from the contract\\n * @dev Escape hatch in case of mistakes or to recover remaining funds\\n * @param _amount Amount of tokens to withdraw\\n */\\n function withdraw(uint256 _amount) external override onlyOwner {\\n require(_amount > 0, \\\"Amount cannot be zero\\\");\\n _token.safeTransfer(msg.sender, _amount);\\n emit TokensWithdrawn(msg.sender, _amount);\\n }\\n\\n // -- Token Destinations --\\n\\n /**\\n * @notice Adds an address that can be allowed by a token lock to pull funds\\n * @param _dst Destination address\\n */\\n function addTokenDestination(address _dst) external override onlyOwner {\\n require(_dst != address(0), \\\"Destination cannot be zero\\\");\\n require(_tokenDestinations.add(_dst), \\\"Destination already added\\\");\\n emit TokenDestinationAllowed(_dst, true);\\n }\\n\\n /**\\n * @notice Removes an address that can be allowed by a token lock to pull funds\\n * @param _dst Destination address\\n */\\n function removeTokenDestination(address _dst) external override onlyOwner {\\n require(_tokenDestinations.remove(_dst), \\\"Destination already removed\\\");\\n emit TokenDestinationAllowed(_dst, false);\\n }\\n\\n /**\\n * @notice Returns True if the address is authorized to be a destination of tokens\\n * @param _dst Destination address\\n * @return True if authorized\\n */\\n function isTokenDestination(address _dst) external view override returns (bool) {\\n return _tokenDestinations.contains(_dst);\\n }\\n\\n /**\\n * @notice Returns an array of authorized destination addresses\\n * @return Array of addresses authorized to pull funds from a token lock\\n */\\n function getTokenDestinations() external view override returns (address[] memory) {\\n address[] memory dstList = new address[](_tokenDestinations.length());\\n for (uint256 i = 0; i < _tokenDestinations.length(); i++) {\\n dstList[i] = _tokenDestinations.at(i);\\n }\\n return dstList;\\n }\\n\\n // -- Function Call Authorization --\\n\\n /**\\n * @notice Sets an authorized function call to target\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @param _signature Function signature\\n * @param _target Address of the destination contract to call\\n */\\n function setAuthFunctionCall(string calldata _signature, address _target) external override onlyOwner {\\n _setAuthFunctionCall(_signature, _target);\\n }\\n\\n /**\\n * @notice Unsets an authorized function call to target\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @param _signature Function signature\\n */\\n function unsetAuthFunctionCall(string calldata _signature) external override onlyOwner {\\n bytes4 sigHash = _toFunctionSigHash(_signature);\\n authFnCalls[sigHash] = address(0);\\n\\n emit FunctionCallAuth(msg.sender, sigHash, address(0), _signature);\\n }\\n\\n /**\\n * @notice Sets an authorized function call to target in bulk\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @param _signatures Function signatures\\n * @param _targets Address of the destination contract to call\\n */\\n function setAuthFunctionCallMany(\\n string[] calldata _signatures,\\n address[] calldata _targets\\n ) external override onlyOwner {\\n require(_signatures.length == _targets.length, \\\"Array length mismatch\\\");\\n\\n for (uint256 i = 0; i < _signatures.length; i++) {\\n _setAuthFunctionCall(_signatures[i], _targets[i]);\\n }\\n }\\n\\n /**\\n * @notice Sets an authorized function call to target\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @dev Function signatures of Graph Protocol contracts to be used are known ahead of time\\n * @param _signature Function signature\\n * @param _target Address of the destination contract to call\\n */\\n function _setAuthFunctionCall(string calldata _signature, address _target) internal {\\n require(_target != address(this), \\\"Target must be other contract\\\");\\n require(Address.isContract(_target), \\\"Target must be a contract\\\");\\n\\n bytes4 sigHash = _toFunctionSigHash(_signature);\\n authFnCalls[sigHash] = _target;\\n\\n emit FunctionCallAuth(msg.sender, sigHash, _target, _signature);\\n }\\n\\n /**\\n * @notice Gets the target contract to call for a particular function signature\\n * @param _sigHash Function signature hash\\n * @return Address of the target contract where to send the call\\n */\\n function getAuthFunctionCallTarget(bytes4 _sigHash) public view override returns (address) {\\n return authFnCalls[_sigHash];\\n }\\n\\n /**\\n * @notice Returns true if the function call is authorized\\n * @param _sigHash Function signature hash\\n * @return True if authorized\\n */\\n function isAuthFunctionCall(bytes4 _sigHash) external view override returns (bool) {\\n return getAuthFunctionCallTarget(_sigHash) != address(0);\\n }\\n\\n /**\\n * @dev Converts a function signature string to 4-bytes hash\\n * @param _signature Function signature string\\n * @return Function signature hash\\n */\\n function _toFunctionSigHash(string calldata _signature) internal pure returns (bytes4) {\\n return _convertToBytes4(abi.encodeWithSignature(_signature));\\n }\\n\\n /**\\n * @dev Converts function signature bytes to function signature hash (bytes4)\\n * @param _signature Function signature\\n * @return Function signature in bytes4\\n */\\n function _convertToBytes4(bytes memory _signature) internal pure returns (bytes4) {\\n require(_signature.length == 4, \\\"Invalid method signature\\\");\\n bytes4 sigHash;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n sigHash := mload(add(_signature, 32))\\n }\\n return sigHash;\\n }\\n}\\n\",\"keccak256\":\"0x2bb51cc1a18bd88113fd6947067ad2fff33048c8904cb54adfda8e2ab86752f2\",\"license\":\"MIT\"},\"contracts/GraphTokenLockWallet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"@openzeppelin/contracts/math/SafeMath.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nimport \\\"./GraphTokenLock.sol\\\";\\nimport \\\"./IGraphTokenLockManager.sol\\\";\\n\\n/**\\n * @title GraphTokenLockWallet\\n * @notice This contract is built on top of the base GraphTokenLock functionality.\\n * It allows wallet beneficiaries to use the deposited funds to perform specific function calls\\n * on specific contracts.\\n *\\n * The idea is that supporters with locked tokens can participate in the protocol\\n * but disallow any release before the vesting/lock schedule.\\n * The beneficiary can issue authorized function calls to this contract that will\\n * get forwarded to a target contract. A target contract is any of our protocol contracts.\\n * The function calls allowed are queried to the GraphTokenLockManager, this way\\n * the same configuration can be shared for all the created lock wallet contracts.\\n *\\n * NOTE: Contracts used as target must have its function signatures checked to avoid collisions\\n * with any of this contract functions.\\n * Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience\\n * the maximum amount of tokens is authorized.\\n * Function calls do not forward ETH value so DO NOT SEND ETH TO THIS CONTRACT.\\n */\\ncontract GraphTokenLockWallet is GraphTokenLock {\\n using SafeMath for uint256;\\n\\n // -- State --\\n\\n IGraphTokenLockManager public manager;\\n uint256 public usedAmount;\\n\\n // -- Events --\\n\\n event ManagerUpdated(address indexed _oldManager, address indexed _newManager);\\n event TokenDestinationsApproved();\\n event TokenDestinationsRevoked();\\n\\n // Initializer\\n function initialize(\\n address _manager,\\n address _owner,\\n address _beneficiary,\\n address _token,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n Revocability _revocable\\n ) external {\\n _initialize(\\n _owner,\\n _beneficiary,\\n _token,\\n _managedAmount,\\n _startTime,\\n _endTime,\\n _periods,\\n _releaseStartTime,\\n _vestingCliffTime,\\n _revocable\\n );\\n _setManager(_manager);\\n }\\n\\n // -- Admin --\\n\\n /**\\n * @notice Sets a new manager for this contract\\n * @param _newManager Address of the new manager\\n */\\n function setManager(address _newManager) external onlyOwner {\\n _setManager(_newManager);\\n }\\n\\n /**\\n * @dev Sets a new manager for this contract\\n * @param _newManager Address of the new manager\\n */\\n function _setManager(address _newManager) internal {\\n require(_newManager != address(0), \\\"Manager cannot be empty\\\");\\n require(Address.isContract(_newManager), \\\"Manager must be a contract\\\");\\n\\n address oldManager = address(manager);\\n manager = IGraphTokenLockManager(_newManager);\\n\\n emit ManagerUpdated(oldManager, _newManager);\\n }\\n\\n // -- Beneficiary --\\n\\n /**\\n * @notice Approves protocol access of the tokens managed by this contract\\n * @dev Approves all token destinations registered in the manager to pull tokens\\n */\\n function approveProtocol() external onlyBeneficiary {\\n address[] memory dstList = manager.getTokenDestinations();\\n for (uint256 i = 0; i < dstList.length; i++) {\\n // Note this is only safe because we are using the max uint256 value\\n token.approve(dstList[i], type(uint256).max);\\n }\\n emit TokenDestinationsApproved();\\n }\\n\\n /**\\n * @notice Revokes protocol access of the tokens managed by this contract\\n * @dev Revokes approval to all token destinations in the manager to pull tokens\\n */\\n function revokeProtocol() external onlyBeneficiary {\\n address[] memory dstList = manager.getTokenDestinations();\\n for (uint256 i = 0; i < dstList.length; i++) {\\n // Note this is only safe cause we're using 0 as the amount\\n token.approve(dstList[i], 0);\\n }\\n emit TokenDestinationsRevoked();\\n }\\n\\n /**\\n * @notice Gets tokens currently available for release\\n * @dev Considers the schedule, takes into account already released tokens and used amount\\n * @return Amount of tokens ready to be released\\n */\\n function releasableAmount() public view override returns (uint256) {\\n if (revocable == Revocability.Disabled) {\\n return super.releasableAmount();\\n }\\n\\n // -- Revocability enabled logic\\n // This needs to deal with additional considerations for when tokens are used in the protocol\\n\\n // If a release start time is set no tokens are available for release before this date\\n // If not set it follows the default schedule and tokens are available on\\n // the first period passed\\n if (releaseStartTime > 0 && currentTime() < releaseStartTime) {\\n return 0;\\n }\\n\\n // Vesting cliff is activated and it has not passed means nothing is vested yet\\n // so funds cannot be released\\n if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\\n return 0;\\n }\\n\\n // A beneficiary can never have more releasable tokens than the contract balance\\n // We consider the `usedAmount` in the protocol as part of the calculations\\n // the beneficiary should not release funds that are used.\\n uint256 releasable = availableAmount().sub(releasedAmount).sub(usedAmount);\\n return MathUtils.min(currentBalance(), releasable);\\n }\\n\\n /**\\n * @notice Forward authorized contract calls to protocol contracts\\n * @dev Fallback function can be called by the beneficiary only if function call is allowed\\n */\\n // solhint-disable-next-line no-complex-fallback\\n fallback() external payable {\\n // Only beneficiary can forward calls\\n require(msg.sender == beneficiary, \\\"Unauthorized caller\\\");\\n require(msg.value == 0, \\\"ETH transfers not supported\\\");\\n\\n // Function call validation\\n address _target = manager.getAuthFunctionCallTarget(msg.sig);\\n require(_target != address(0), \\\"Unauthorized function\\\");\\n\\n uint256 oldBalance = currentBalance();\\n\\n // Call function with data\\n Address.functionCall(_target, msg.data);\\n\\n // Tracked used tokens in the protocol\\n // We do this check after balances were updated by the forwarded call\\n // Check is only enforced for revocable contracts to save some gas\\n if (revocable == Revocability.Enabled) {\\n // Track contract balance change\\n uint256 newBalance = currentBalance();\\n if (newBalance < oldBalance) {\\n // Outflow\\n uint256 diff = oldBalance.sub(newBalance);\\n usedAmount = usedAmount.add(diff);\\n } else {\\n // Inflow: We can receive profits from the protocol, that could make usedAmount to\\n // underflow. We set it to zero in that case.\\n uint256 diff = newBalance.sub(oldBalance);\\n usedAmount = (diff >= usedAmount) ? 0 : usedAmount.sub(diff);\\n }\\n require(usedAmount <= vestedAmount(), \\\"Cannot use more tokens than vested amount\\\");\\n }\\n }\\n\\n /**\\n * @notice Receive function that always reverts.\\n * @dev Only included to supress warnings, see https://github.com/ethereum/solidity/issues/10159\\n */\\n receive() external payable {\\n revert(\\\"Bad call\\\");\\n }\\n}\\n\",\"keccak256\":\"0x976c2ba4c1503a81ea02bd84539c516e99af611ff767968ee25456b50a6deb7b\",\"license\":\"MIT\"},\"contracts/ICallhookReceiver.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\n\\n// Copied from graphprotocol/contracts, changed solidity version to 0.7.3\\n\\n/**\\n * @title Interface for contracts that can receive callhooks through the Arbitrum GRT bridge\\n * @dev Any contract that can receive a callhook on L2, sent through the bridge from L1, must\\n * be allowlisted by the governor, but also implement this interface that contains\\n * the function that will actually be called by the L2GraphTokenGateway.\\n */\\npragma solidity ^0.7.3;\\n\\ninterface ICallhookReceiver {\\n /**\\n * @notice Receive tokens with a callhook from the bridge\\n * @param _from Token sender in L1\\n * @param _amount Amount of tokens that were transferred\\n * @param _data ABI-encoded callhook data\\n */\\n function onTokenTransfer(address _from, uint256 _amount, bytes calldata _data) external;\\n}\\n\",\"keccak256\":\"0xb90eae14e8bac012a4b99fabe7a1110f70143eb78476ea0d6b52557ef979fa0e\",\"license\":\"GPL-2.0-or-later\"},\"contracts/IGraphTokenLock.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\ninterface IGraphTokenLock {\\n enum Revocability {\\n NotSet,\\n Enabled,\\n Disabled\\n }\\n\\n // -- Balances --\\n\\n function currentBalance() external view returns (uint256);\\n\\n // -- Time & Periods --\\n\\n function currentTime() external view returns (uint256);\\n\\n function duration() external view returns (uint256);\\n\\n function sinceStartTime() external view returns (uint256);\\n\\n function amountPerPeriod() external view returns (uint256);\\n\\n function periodDuration() external view returns (uint256);\\n\\n function currentPeriod() external view returns (uint256);\\n\\n function passedPeriods() external view returns (uint256);\\n\\n // -- Locking & Release Schedule --\\n\\n function availableAmount() external view returns (uint256);\\n\\n function vestedAmount() external view returns (uint256);\\n\\n function releasableAmount() external view returns (uint256);\\n\\n function totalOutstandingAmount() external view returns (uint256);\\n\\n function surplusAmount() external view returns (uint256);\\n\\n // -- Value Transfer --\\n\\n function release() external;\\n\\n function withdrawSurplus(uint256 _amount) external;\\n\\n function revoke() external;\\n}\\n\",\"keccak256\":\"0xceb9d258276fe25ec858191e1deae5778f1b2f612a669fb7b37bab1a064756ab\",\"license\":\"MIT\"},\"contracts/IGraphTokenLockManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nimport \\\"./IGraphTokenLock.sol\\\";\\n\\ninterface IGraphTokenLockManager {\\n // -- Factory --\\n\\n function setMasterCopy(address _masterCopy) external;\\n\\n function createTokenLockWallet(\\n address _owner,\\n address _beneficiary,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n IGraphTokenLock.Revocability _revocable\\n ) external;\\n\\n // -- Funds Management --\\n\\n function token() external returns (IERC20);\\n\\n function deposit(uint256 _amount) external;\\n\\n function withdraw(uint256 _amount) external;\\n\\n // -- Allowed Funds Destinations --\\n\\n function addTokenDestination(address _dst) external;\\n\\n function removeTokenDestination(address _dst) external;\\n\\n function isTokenDestination(address _dst) external view returns (bool);\\n\\n function getTokenDestinations() external view returns (address[] memory);\\n\\n // -- Function Call Authorization --\\n\\n function setAuthFunctionCall(string calldata _signature, address _target) external;\\n\\n function unsetAuthFunctionCall(string calldata _signature) external;\\n\\n function setAuthFunctionCallMany(string[] calldata _signatures, address[] calldata _targets) external;\\n\\n function getAuthFunctionCallTarget(bytes4 _sigHash) external view returns (address);\\n\\n function isAuthFunctionCall(bytes4 _sigHash) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x2d78d41909a6de5b316ac39b100ea087a8f317cf306379888a045523e15c4d9a\",\"license\":\"MIT\"},\"contracts/L2GraphTokenLockManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport { SafeERC20 } from \\\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\\\";\\n\\nimport { ICallhookReceiver } from \\\"./ICallhookReceiver.sol\\\";\\nimport { GraphTokenLockManager } from \\\"./GraphTokenLockManager.sol\\\";\\nimport { L2GraphTokenLockWallet } from \\\"./L2GraphTokenLockWallet.sol\\\";\\n\\n/**\\n * @title L2GraphTokenLockManager\\n * @notice This contract manages a list of authorized function calls and targets that can be called\\n * by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts.\\n *\\n * This contract receives funds to make the process of creating TokenLockWallet contracts\\n * easier by distributing them the initial tokens to be managed.\\n *\\n * In particular, this L2 variant is designed to receive token lock wallets from L1,\\n * through the GRT bridge. These transferred wallets will not allow releasing funds in L2 until\\n * the end of the vesting timeline, but they can allow withdrawing funds back to L1 using\\n * the L2GraphTokenLockTransferTool contract.\\n *\\n * The owner can setup a list of token destinations that will be used by TokenLock contracts to\\n * approve the pulling of funds, this way in can be guaranteed that only protocol contracts\\n * will manipulate users funds.\\n */\\ncontract L2GraphTokenLockManager is GraphTokenLockManager, ICallhookReceiver {\\n using SafeERC20 for IERC20;\\n\\n /// @dev Struct to hold the data of a transferred wallet; this is\\n /// the data that must be encoded in L1 to send a wallet to L2.\\n struct TransferredWalletData {\\n address l1Address;\\n address owner;\\n address beneficiary;\\n uint256 managedAmount;\\n uint256 startTime;\\n uint256 endTime;\\n }\\n\\n /// Address of the L2GraphTokenGateway\\n address public immutable l2Gateway;\\n /// Address of the L1 transfer tool contract (in L1, no aliasing)\\n address public immutable l1TransferTool;\\n /// Mapping of each L1 wallet to its L2 wallet counterpart (populated when each wallet is received)\\n /// L1 address => L2 address\\n mapping(address => address) public l1WalletToL2Wallet;\\n /// Mapping of each L2 wallet to its L1 wallet counterpart (populated when each wallet is received)\\n /// L2 address => L1 address\\n mapping(address => address) public l2WalletToL1Wallet;\\n\\n /// @dev Event emitted when a wallet is received and created from L1\\n event TokenLockCreatedFromL1(\\n address indexed contractAddress,\\n bytes32 initHash,\\n address indexed beneficiary,\\n uint256 managedAmount,\\n uint256 startTime,\\n uint256 endTime,\\n address indexed l1Address\\n );\\n\\n /// @dev Emitted when locked tokens are received from L1 (whether the wallet\\n /// had already been received or not)\\n event LockedTokensReceivedFromL1(address indexed l1Address, address indexed l2Address, uint256 amount);\\n\\n /**\\n * @dev Checks that the sender is the L2GraphTokenGateway.\\n */\\n modifier onlyL2Gateway() {\\n require(msg.sender == l2Gateway, \\\"ONLY_GATEWAY\\\");\\n _;\\n }\\n\\n /**\\n * @notice Constructor for the L2GraphTokenLockManager contract.\\n * @param _graphToken Address of the L2 GRT token contract\\n * @param _masterCopy Address of the master copy of the L2GraphTokenLockWallet implementation\\n * @param _l2Gateway Address of the L2GraphTokenGateway contract\\n * @param _l1TransferTool Address of the L1 transfer tool contract (in L1, without aliasing)\\n */\\n constructor(\\n IERC20 _graphToken,\\n address _masterCopy,\\n address _l2Gateway,\\n address _l1TransferTool\\n ) GraphTokenLockManager(_graphToken, _masterCopy) {\\n l2Gateway = _l2Gateway;\\n l1TransferTool = _l1TransferTool;\\n }\\n\\n /**\\n * @notice This function is called by the L2GraphTokenGateway when tokens are sent from L1.\\n * @dev This function will create a new wallet if it doesn't exist yet, or send the tokens to\\n * the existing wallet if it does.\\n * @param _from Address of the sender in L1, which must be the L1GraphTokenLockTransferTool\\n * @param _amount Amount of tokens received\\n * @param _data Encoded data of the transferred wallet, which must be an ABI-encoded TransferredWalletData struct\\n */\\n function onTokenTransfer(address _from, uint256 _amount, bytes calldata _data) external override onlyL2Gateway {\\n require(_from == l1TransferTool, \\\"ONLY_TRANSFER_TOOL\\\");\\n TransferredWalletData memory walletData = abi.decode(_data, (TransferredWalletData));\\n\\n if (l1WalletToL2Wallet[walletData.l1Address] != address(0)) {\\n // If the wallet was already received, just send the tokens to the L2 address\\n _token.safeTransfer(l1WalletToL2Wallet[walletData.l1Address], _amount);\\n } else {\\n // Create contract using a minimal proxy and call initializer\\n (bytes32 initHash, address contractAddress) = _deployFromL1(keccak256(_data), walletData);\\n l1WalletToL2Wallet[walletData.l1Address] = contractAddress;\\n l2WalletToL1Wallet[contractAddress] = walletData.l1Address;\\n\\n // Send managed amount to the created contract\\n _token.safeTransfer(contractAddress, _amount);\\n\\n emit TokenLockCreatedFromL1(\\n contractAddress,\\n initHash,\\n walletData.beneficiary,\\n walletData.managedAmount,\\n walletData.startTime,\\n walletData.endTime,\\n walletData.l1Address\\n );\\n }\\n emit LockedTokensReceivedFromL1(walletData.l1Address, l1WalletToL2Wallet[walletData.l1Address], _amount);\\n }\\n\\n /**\\n * @dev Deploy a token lock wallet with data received from L1\\n * @param _salt Salt for the CREATE2 call, which must be the hash of the wallet data\\n * @param _walletData Data of the wallet to be created\\n * @return Hash of the initialization calldata\\n * @return Address of the created contract\\n */\\n function _deployFromL1(bytes32 _salt, TransferredWalletData memory _walletData) internal returns (bytes32, address) {\\n bytes memory initializer = _encodeInitializer(_walletData);\\n address contractAddress = _deployProxy2(_salt, masterCopy, initializer);\\n return (keccak256(initializer), contractAddress);\\n }\\n\\n /**\\n * @dev Encode the initializer for the token lock wallet received from L1\\n * @param _walletData Data of the wallet to be created\\n * @return Encoded initializer calldata, including the function signature\\n */\\n function _encodeInitializer(TransferredWalletData memory _walletData) internal view returns (bytes memory) {\\n return\\n abi.encodeWithSelector(\\n L2GraphTokenLockWallet.initializeFromL1.selector,\\n address(this),\\n address(_token),\\n _walletData\\n );\\n }\\n}\\n\",\"keccak256\":\"0x34ca0ffc898ce3615a000d53a9c58708354b8cd8093b3c61decfe7388f0c16e0\",\"license\":\"MIT\"},\"contracts/L2GraphTokenLockWallet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nimport { GraphTokenLockWallet } from \\\"./GraphTokenLockWallet.sol\\\";\\nimport { Ownable as OwnableInitializable } from \\\"./Ownable.sol\\\";\\nimport { L2GraphTokenLockManager } from \\\"./L2GraphTokenLockManager.sol\\\";\\n\\n/**\\n * @title L2GraphTokenLockWallet\\n * @notice This contract is built on top of the base GraphTokenLock functionality.\\n * It allows wallet beneficiaries to use the deposited funds to perform specific function calls\\n * on specific contracts.\\n *\\n * The idea is that supporters with locked tokens can participate in the protocol\\n * but disallow any release before the vesting/lock schedule.\\n * The beneficiary can issue authorized function calls to this contract that will\\n * get forwarded to a target contract. A target contract is any of our protocol contracts.\\n * The function calls allowed are queried to the GraphTokenLockManager, this way\\n * the same configuration can be shared for all the created lock wallet contracts.\\n *\\n * This L2 variant includes a special initializer so that it can be created from\\n * a wallet's data received from L1. These transferred wallets will not allow releasing\\n * funds in L2 until the end of the vesting timeline, but they can allow withdrawing\\n * funds back to L1 using the L2GraphTokenLockTransferTool contract.\\n *\\n * Note that surplusAmount and releasedAmount in L2 will be skewed for wallets received from L1,\\n * so releasing surplus tokens might also only be possible by bridging tokens back to L1.\\n *\\n * NOTE: Contracts used as target must have its function signatures checked to avoid collisions\\n * with any of this contract functions.\\n * Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience\\n * the maximum amount of tokens is authorized.\\n * Function calls do not forward ETH value so DO NOT SEND ETH TO THIS CONTRACT.\\n */\\ncontract L2GraphTokenLockWallet is GraphTokenLockWallet {\\n // Initializer when created from a message from L1\\n function initializeFromL1(\\n address _manager,\\n address _token,\\n L2GraphTokenLockManager.TransferredWalletData calldata _walletData\\n ) external {\\n require(!isInitialized, \\\"Already initialized\\\");\\n isInitialized = true;\\n\\n OwnableInitializable._initialize(_walletData.owner);\\n beneficiary = _walletData.beneficiary;\\n token = IERC20(_token);\\n\\n managedAmount = _walletData.managedAmount;\\n\\n startTime = _walletData.startTime;\\n endTime = _walletData.endTime;\\n periods = 1;\\n isAccepted = true;\\n\\n // Optionals\\n releaseStartTime = _walletData.endTime;\\n revocable = Revocability.Disabled;\\n\\n _setManager(_manager);\\n }\\n}\\n\",\"keccak256\":\"0x8842140c2c7924be4ab1bca71e0b0ad6dd1dba6433cfdc523bfd204288b25d20\",\"license\":\"MIT\"},\"contracts/MathUtils.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nlibrary MathUtils {\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n}\\n\",\"keccak256\":\"0xe2512e1da48bc8363acd15f66229564b02d66706665d7da740604566913c1400\",\"license\":\"MIT\"},\"contracts/MinimalProxyFactory.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nimport { Address } from \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport { Create2 } from \\\"@openzeppelin/contracts/utils/Create2.sol\\\";\\n\\n/**\\n * @title MinimalProxyFactory: a factory contract for creating minimal proxies\\n * @notice Adapted from https://github.com/OpenZeppelin/openzeppelin-sdk/blob/v2.5.0/packages/lib/contracts/upgradeability/ProxyFactory.sol\\n * Based on https://eips.ethereum.org/EIPS/eip-1167\\n */\\ncontract MinimalProxyFactory {\\n /// @dev Emitted when a new proxy is created\\n event ProxyCreated(address indexed proxy);\\n\\n /**\\n * @notice Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation\\n * @param _salt Bytes32 salt to use for CREATE2\\n * @param _implementation Address of the proxy target implementation\\n * @param _deployer Address of the deployer that creates the contract\\n * @return Address of the counterfactual MinimalProxy\\n */\\n function getDeploymentAddress(\\n bytes32 _salt,\\n address _implementation,\\n address _deployer\\n ) public pure returns (address) {\\n return Create2.computeAddress(_salt, keccak256(_getContractCreationCode(_implementation)), _deployer);\\n }\\n\\n /**\\n * @dev Deploys a MinimalProxy with CREATE2\\n * @param _salt Bytes32 salt to use for CREATE2\\n * @param _implementation Address of the proxy target implementation\\n * @param _data Bytes with the initializer call\\n * @return Address of the deployed MinimalProxy\\n */\\n function _deployProxy2(bytes32 _salt, address _implementation, bytes memory _data) internal returns (address) {\\n address proxyAddress = Create2.deploy(0, _salt, _getContractCreationCode(_implementation));\\n\\n emit ProxyCreated(proxyAddress);\\n\\n // Call function with data\\n if (_data.length > 0) {\\n Address.functionCall(proxyAddress, _data);\\n }\\n\\n return proxyAddress;\\n }\\n\\n /**\\n * @dev Gets the MinimalProxy bytecode\\n * @param _implementation Address of the proxy target implementation\\n * @return MinimalProxy bytecode\\n */\\n function _getContractCreationCode(address _implementation) internal pure returns (bytes memory) {\\n bytes10 creation = 0x3d602d80600a3d3981f3;\\n bytes10 prefix = 0x363d3d373d3d3d363d73;\\n bytes20 targetBytes = bytes20(_implementation);\\n bytes15 suffix = 0x5af43d82803e903d91602b57fd5bf3;\\n return abi.encodePacked(creation, prefix, targetBytes, suffix);\\n }\\n}\\n\",\"keccak256\":\"0x67d67a567bceb363ddb199b1e4ab06e7a99f16e034e03086971a332c09ec5c0e\",\"license\":\"MIT\"},\"contracts/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * The owner account will be passed on initialization of the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\ncontract Ownable {\\n /// @dev Owner of the contract, can be retrieved with the public owner() function\\n address private _owner;\\n /// @dev Since upgradeable contracts might inherit this, we add a storage gap\\n /// to allow adding variables here without breaking the proxy storage layout\\n uint256[50] private __gap;\\n\\n /// @dev Emitted when ownership of the contract is transferred\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n function _initialize(address owner) internal {\\n _owner = owner;\\n emit OwnershipTransferred(address(0), owner);\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(_owner == msg.sender, \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() external virtual onlyOwner {\\n emit OwnershipTransferred(_owner, address(0));\\n _owner = address(0);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) external virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n emit OwnershipTransferred(_owner, newOwner);\\n _owner = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0xe8750687082e8e24b620dbf58c3a08eee591ed7b4d5a3e13cc93554ec647fd09\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60c06040523480156200001157600080fd5b506040516200499938038062004999833981810160405281019062000037919062000410565b838360006200004b6200022860201b60201c565b9050806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a350600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156200015c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620001539062000586565b60405180910390fd5b81600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550620001ae816200023060201b60201c565b50508173ffffffffffffffffffffffffffffffffffffffff1660808173ffffffffffffffffffffffffffffffffffffffff1660601b815250508073ffffffffffffffffffffffffffffffffffffffff1660a08173ffffffffffffffffffffffffffffffffffffffff1660601b815250505050505062000635565b600033905090565b620002406200022860201b60201c565b73ffffffffffffffffffffffffffffffffffffffff1662000266620003b960201b60201c565b73ffffffffffffffffffffffffffffffffffffffff1614620002bf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620002b69062000564565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141562000332576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620003299062000542565b60405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167f30909084afc859121ffc3a5aef7fe37c540a9a1ef60bd4d8dcdb76376fadf9de60405160405180910390a250565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600081519050620003f38162000601565b92915050565b6000815190506200040a816200061b565b92915050565b600080600080608085870312156200042757600080fd5b60006200043787828801620003f9565b94505060206200044a87828801620003e2565b93505060406200045d87828801620003e2565b92505060606200047087828801620003e2565b91505092959194509250565b60006200048b601983620005a8565b91507f4d6173746572436f70792063616e6e6f74206265207a65726f000000000000006000830152602082019050919050565b6000620004cd602083620005a8565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b60006200050f601483620005a8565b91507f546f6b656e2063616e6e6f74206265207a65726f0000000000000000000000006000830152602082019050919050565b600060208201905081810360008301526200055d816200047c565b9050919050565b600060208201905081810360008301526200057f81620004be565b9050919050565b60006020820190508181036000830152620005a18162000500565b9050919050565b600082825260208201905092915050565b6000620005c682620005e1565b9050919050565b6000620005da82620005b9565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6200060c81620005b9565b81146200061857600080fd5b50565b6200062681620005cd565b81146200063257600080fd5b50565b60805160601c60a05160601c61433062000669600039806109195280611280525080610fc952806111f252506143306000f3fe608060405234801561001057600080fd5b50600436106101735760003560e01c806379ee1bdf116100de578063a619486e11610097578063cf497e6c11610071578063cf497e6c14610434578063f1d24c4514610450578063f2fde38b14610480578063fc0c546a1461049c57610173565b8063a619486e146103de578063b6b55f25146103fc578063c1ab13db1461041857610173565b806379ee1bdf1461031c5780638da5cb5b1461034c5780638fa74a0e1461036a5780639c05fc6014610388578063a3457466146103a4578063a4c0ed36146103c257610173565b8063463013a211610130578063463013a214610270578063586a53531461028c5780635975e00c146102aa57806368d30c2e146102c65780636e03b8dc146102e2578063715018a61461031257610173565b806303990a6c14610178578063045b7fe2146101945780630602ba2b146101c45780630cd6178f146101f45780632e1a7d4d1461022457806343fb93d914610240575b600080fd5b610192600480360381019061018d9190612f13565b6104ba565b005b6101ae60048036038101906101a99190612ca2565b610662565b6040516101bb91906139bc565b60405180910390f35b6101de60048036038101906101d99190612eea565b610695565b6040516101eb9190613bba565b60405180910390f35b61020e60048036038101906102099190612ca2565b6106d6565b60405161021b91906139bc565b60405180910390f35b61023e60048036038101906102399190612fd9565b610709565b005b61025a60048036038101906102559190612e9b565b610866565b60405161026791906139bc565b60405180910390f35b61028a60048036038101906102859190612f58565b61088b565b005b610294610917565b6040516102a191906139bc565b60405180910390f35b6102c460048036038101906102bf9190612ca2565b61093b565b005b6102e060048036038101906102db9190612ccb565b610acc565b005b6102fc60048036038101906102f79190612eea565b610e14565b60405161030991906139bc565b60405180910390f35b61031a610e47565b005b61033660048036038101906103319190612ca2565b610f81565b6040516103439190613bba565b60405180910390f35b610354610f9e565b60405161036191906139bc565b60405180910390f35b610372610fc7565b60405161037f91906139bc565b60405180910390f35b6103a2600480360381019061039d9190612dfd565b610feb565b005b6103ac611118565b6040516103b99190613b98565b60405180910390f35b6103dc60048036038101906103d79190612d91565b6111f0565b005b6103e6611756565b6040516103f391906139bc565b60405180910390f35b61041660048036038101906104119190612fd9565b61177c565b005b610432600480360381019061042d9190612ca2565b61185f565b005b61044e60048036038101906104499190612ca2565b611980565b005b61046a60048036038101906104659190612eea565b611af3565b60405161047791906139bc565b60405180910390f35b61049a60048036038101906104959190612ca2565b611b6e565b005b6104a4611d17565b6040516104b19190613c1a565b60405180910390f35b6104c2611d41565b73ffffffffffffffffffffffffffffffffffffffff166104e0610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614610536576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161052d90613e3b565b60405180910390fd5b60006105428383611d49565b9050600060016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff16817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163373ffffffffffffffffffffffffffffffffffffffff167f450397a2db0e89eccfe664cc6cdfd274a88bc00d29aaec4d991754a42f19f8c98686604051610655929190613c35565b60405180910390a4505050565b60076020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008073ffffffffffffffffffffffffffffffffffffffff166106b783611af3565b73ffffffffffffffffffffffffffffffffffffffff1614159050919050565b60066020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610711611d41565b73ffffffffffffffffffffffffffffffffffffffff1661072f610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614610785576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077c90613e3b565b60405180910390fd5b600081116107c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107bf90613e1b565b60405180910390fd5b6108153382600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611dd79092919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b8260405161085b9190613f1b565b60405180910390a250565b60006108828461087585611e5d565b8051906020012084611ed3565b90509392505050565b610893611d41565b73ffffffffffffffffffffffffffffffffffffffff166108b1610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614610907576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108fe90613e3b565b60405180910390fd5b610912838383611f17565b505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b610943611d41565b73ffffffffffffffffffffffffffffffffffffffff16610961610f9e565b73ffffffffffffffffffffffffffffffffffffffff16146109b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109ae90613e3b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610a27576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a1e90613cfb565b60405180910390fd5b610a3b8160026120f990919063ffffffff16565b610a7a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7190613e7b565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f33442b8c13e72dd75a027f08f9bff4eed2dfd26e43cdea857365f5163b359a796001604051610ac19190613bba565b60405180910390a250565b610ad4611d41565b73ffffffffffffffffffffffffffffffffffffffff16610af2610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614610b48576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b3f90613e3b565b60405180910390fd5b86600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610ba491906139bc565b60206040518083038186803b158015610bbc57600080fd5b505afa158015610bd0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bf49190613002565b1015610c35576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2c90613d3b565b60405180910390fd5b606063bd896dcb60e01b308b8b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168c8c8c8c8c8c8c604051602401610c869b9a999897969594939291906139d7565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505090506000610d1b8280519060200120600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684612129565b9050610d6a818a600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611dd79092919063ffffffff16565b8973ffffffffffffffffffffffffffffffffffffffff1682805190602001208273ffffffffffffffffffffffffffffffffffffffff167f3c7ff6acee351ed98200c285a04745858a107e16da2f13c3a81a43073c17d644600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168d8d8d8d8d8d8d604051610dff989796959493929190613b1a565b60405180910390a45050505050505050505050565b60016020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610e4f611d41565b73ffffffffffffffffffffffffffffffffffffffff16610e6d610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614610ec3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eba90613e3b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000610f978260026121a590919063ffffffff16565b9050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b7f000000000000000000000000000000000000000000000000000000000000000081565b610ff3611d41565b73ffffffffffffffffffffffffffffffffffffffff16611011610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161105e90613e3b565b60405180910390fd5b8181905084849050146110af576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110a690613cbb565b60405180910390fd5b60005b84849050811015611111576111048585838181106110cc57fe5b90506020028101906110de9190613f36565b8585858181106110ea57fe5b90506020020160208101906110ff9190612ca2565b611f17565b80806001019150506110b2565b5050505050565b60608061112560026121d5565b67ffffffffffffffff8111801561113b57600080fd5b5060405190808252806020026020018201604052801561116a5781602001602082028036833780820191505090505b50905060005b61117a60026121d5565b8110156111e8576111958160026121ea90919063ffffffff16565b8282815181106111a157fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508080600101915050611170565b508091505090565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461127e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161127590613cdb565b60405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161461130c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161130390613d7b565b60405180910390fd5b6113146129d3565b82828101906113239190612fb0565b9050600073ffffffffffffffffffffffffffffffffffffffff1660066000836000015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146114715761146c60066000836000015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1685600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611dd79092919063ffffffff16565b611683565b6000806114958585604051611487929190613973565b604051809103902084612204565b915091508060066000856000015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508260000151600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506115ea8187600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611dd79092919063ffffffff16565b826000015173ffffffffffffffffffffffffffffffffffffffff16836040015173ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fd74fe60cbf1e5bf07ef3fad0e00c45f66345c5226474786d8dc086527dc8414785876060015188608001518960a001516040516116789493929190613bd5565b60405180910390a450505b60066000826000015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16816000015173ffffffffffffffffffffffffffffffffffffffff167fe34903cfa4ad8362651171309d05bcbc2fc581a5ec83ca7b0c8d10743de766e2866040516117479190613f1b565b60405180910390a35050505050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600081116117bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117b690613e1b565b60405180910390fd5b61180e333083600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661225b909392919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f59062170a285eb80e8c6b8ced60428442a51910635005233fc4ce084a475845e826040516118549190613f1b565b60405180910390a250565b611867611d41565b73ffffffffffffffffffffffffffffffffffffffff16611885610f9e565b73ffffffffffffffffffffffffffffffffffffffff16146118db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118d290613e3b565b60405180910390fd5b6118ef8160026122e490919063ffffffff16565b61192e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192590613d9b565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f33442b8c13e72dd75a027f08f9bff4eed2dfd26e43cdea857365f5163b359a7960006040516119759190613bba565b60405180910390a250565b611988611d41565b73ffffffffffffffffffffffffffffffffffffffff166119a6610f9e565b73ffffffffffffffffffffffffffffffffffffffff16146119fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119f390613e3b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611a6c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a6390613dbb565b60405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167f30909084afc859121ffc3a5aef7fe37c540a9a1ef60bd4d8dcdb76376fadf9de60405160405180910390a250565b600060016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b611b76611d41565b73ffffffffffffffffffffffffffffffffffffffff16611b94610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614611bea576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611be190613e3b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c5190613d1b565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600033905090565b6000611dcf83836040516024016040516020818303038152906040529190604051611d759291906139a3565b60405180910390207bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050612314565b905092915050565b611e588363a9059cbb60e01b8484604051602401611df6929190613af1565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505061236c565b505050565b60606000693d602d80600a3d3981f360b01b9050600069363d3d373d3d3d363d7360b01b905060008460601b905060006e5af43d82803e903d91602b57fd5bf360881b905083838383604051602001611eb994939291906138d7565b604051602081830303815290604052945050505050919050565b60008060ff60f81b838686604051602001611ef19493929190613925565b6040516020818303038152906040528051906020012090508060001c9150509392505050565b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611f86576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f7d90613ddb565b60405180910390fd5b611f8f81612433565b611fce576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fc590613efb565b60405180910390fd5b6000611fda8484611d49565b90508160016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff16817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163373ffffffffffffffffffffffffffffffffffffffff167f450397a2db0e89eccfe664cc6cdfd274a88bc00d29aaec4d991754a42f19f8c987876040516120eb929190613c35565b60405180910390a450505050565b6000612121836000018373ffffffffffffffffffffffffffffffffffffffff1660001b612446565b905092915050565b60008061214060008661213b87611e5d565b6124b6565b90508073ffffffffffffffffffffffffffffffffffffffff167efffc2da0b561cae30d9826d37709e9421c4725faebc226cbbb7ef5fc5e734960405160405180910390a260008351111561219a5761219881846125c7565b505b809150509392505050565b60006121cd836000018373ffffffffffffffffffffffffffffffffffffffff1660001b612611565b905092915050565b60006121e382600001612634565b9050919050565b60006121f98360000183612645565b60001c905092915050565b6000806060612212846126b2565b9050600061224386600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684612129565b90508180519060200120819350935050509250929050565b6122de846323b872dd60e01b85858560405160240161227c93929190613aba565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505061236c565b50505050565b600061230c836000018373ffffffffffffffffffffffffffffffffffffffff1660001b612757565b905092915050565b6000600482511461235a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161235190613e5b565b60405180910390fd5b60006020830151905080915050919050565b60606123ce826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff1661283f9092919063ffffffff16565b905060008151111561242e57808060200190518101906123ee9190612e72565b61242d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161242490613ebb565b60405180910390fd5b5b505050565b600080823b905060008111915050919050565b60006124528383612611565b6124ab5782600001829080600181540180825580915050600190039060005260206000200160009091909190915055826000018054905083600101600084815260200190815260200160002081905550600190506124b0565b600090505b92915050565b600080844710156124fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124f390613edb565b60405180910390fd5b600083511415612541576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161253890613c9b565b60405180910390fd5b8383516020850187f59050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156125bc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125b390613dfb565b60405180910390fd5b809150509392505050565b606061260983836040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061283f565b905092915050565b600080836001016000848152602001908152602001600020541415905092915050565b600081600001805490509050919050565b600081836000018054905011612690576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161268790613c7b565b60405180910390fd5b82600001828154811061269f57fe5b9060005260206000200154905092915050565b60606320dc203d60e01b30600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040516024016126f393929190613a82565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050509050919050565b6000808360010160008481526020019081526020016000205490506000811461283357600060018203905060006001866000018054905003905060008660000182815481106127a257fe5b90600052602060002001549050808760000184815481106127bf57fe5b90600052602060002001819055506001830187600101600083815260200190815260200160002081905550866000018054806127f757fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050612839565b60009150505b92915050565b606061284e8484600085612857565b90509392505050565b60608247101561289c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161289390613d5b565b60405180910390fd5b6128a585612433565b6128e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128db90613e9b565b60405180910390fd5b600060608673ffffffffffffffffffffffffffffffffffffffff16858760405161290e919061398c565b60006040518083038185875af1925050503d806000811461294b576040519150601f19603f3d011682016040523d82523d6000602084013e612950565b606091505b509150915061296082828661296c565b92505050949350505050565b6060831561297c578290506129cc565b60008351111561298f5782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129c39190613c59565b60405180910390fd5b9392505050565b6040518060c00160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff1681526020016000815260200160008152602001600081525090565b600081359050612a5a81614277565b92915050565b60008083601f840112612a7257600080fd5b8235905067ffffffffffffffff811115612a8b57600080fd5b602083019150836020820283011115612aa357600080fd5b9250929050565b60008083601f840112612abc57600080fd5b8235905067ffffffffffffffff811115612ad557600080fd5b602083019150836020820283011115612aed57600080fd5b9250929050565b600081519050612b038161428e565b92915050565b600081359050612b18816142a5565b92915050565b600081359050612b2d816142bc565b92915050565b60008083601f840112612b4557600080fd5b8235905067ffffffffffffffff811115612b5e57600080fd5b602083019150836001820283011115612b7657600080fd5b9250929050565b600081359050612b8c816142d3565b92915050565b60008083601f840112612ba457600080fd5b8235905067ffffffffffffffff811115612bbd57600080fd5b602083019150836001820283011115612bd557600080fd5b9250929050565b600060c08284031215612bee57600080fd5b612bf860c0613f8d565b90506000612c0884828501612a4b565b6000830152506020612c1c84828501612a4b565b6020830152506040612c3084828501612a4b565b6040830152506060612c4484828501612c78565b6060830152506080612c5884828501612c78565b60808301525060a0612c6c84828501612c78565b60a08301525092915050565b600081359050612c87816142e3565b92915050565b600081519050612c9c816142e3565b92915050565b600060208284031215612cb457600080fd5b6000612cc284828501612a4b565b91505092915050565b60008060008060008060008060006101208a8c031215612cea57600080fd5b6000612cf88c828d01612a4b565b9950506020612d098c828d01612a4b565b9850506040612d1a8c828d01612c78565b9750506060612d2b8c828d01612c78565b9650506080612d3c8c828d01612c78565b95505060a0612d4d8c828d01612c78565b94505060c0612d5e8c828d01612c78565b93505060e0612d6f8c828d01612c78565b925050610100612d818c828d01612b7d565b9150509295985092959850929598565b60008060008060608587031215612da757600080fd5b6000612db587828801612a4b565b9450506020612dc687828801612c78565b935050604085013567ffffffffffffffff811115612de357600080fd5b612def87828801612b33565b925092505092959194509250565b60008060008060408587031215612e1357600080fd5b600085013567ffffffffffffffff811115612e2d57600080fd5b612e3987828801612aaa565b9450945050602085013567ffffffffffffffff811115612e5857600080fd5b612e6487828801612a60565b925092505092959194509250565b600060208284031215612e8457600080fd5b6000612e9284828501612af4565b91505092915050565b600080600060608486031215612eb057600080fd5b6000612ebe86828701612b09565b9350506020612ecf86828701612a4b565b9250506040612ee086828701612a4b565b9150509250925092565b600060208284031215612efc57600080fd5b6000612f0a84828501612b1e565b91505092915050565b60008060208385031215612f2657600080fd5b600083013567ffffffffffffffff811115612f4057600080fd5b612f4c85828601612b92565b92509250509250929050565b600080600060408486031215612f6d57600080fd5b600084013567ffffffffffffffff811115612f8757600080fd5b612f9386828701612b92565b93509350506020612fa686828701612a4b565b9150509250925092565b600060c08284031215612fc257600080fd5b6000612fd084828501612bdc565b91505092915050565b600060208284031215612feb57600080fd5b6000612ff984828501612c78565b91505092915050565b60006020828403121561301457600080fd5b600061302284828501612c8d565b91505092915050565b60006130378383613043565b60208301905092915050565b61304c81614034565b82525050565b61305b81614034565b82525050565b61307261306d82614034565b6141ed565b82525050565b600061308382613fce565b61308d8185613ffc565b935061309883613fbe565b8060005b838110156130c95781516130b0888261302b565b97506130bb83613fef565b92505060018101905061309c565b5085935050505092915050565b6130df81614046565b82525050565b6130f66130f18261407e565b614209565b82525050565b61310d613108826140aa565b614213565b82525050565b61312461311f82614052565b6141ff565b82525050565b61313b613136826140d6565b61421d565b82525050565b61314a81614102565b82525050565b61316161315c82614102565b614227565b82525050565b6000613173838561400d565b93506131808385846141ab565b82840190509392505050565b600061319782613fd9565b6131a1818561400d565b93506131b18185602086016141ba565b80840191505092915050565b6131c681614175565b82525050565b6131d581614199565b82525050565b60006131e78385614018565b93506131f48385846141ab565b6131fd83614245565b840190509392505050565b60006132148385614029565b93506132218385846141ab565b82840190509392505050565b600061323882613fe4565b6132428185614018565b93506132528185602086016141ba565b61325b81614245565b840191505092915050565b6000613273602283614018565b91507f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e60008301527f64730000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006132d9602083614018565b91507f437265617465323a2062797465636f6465206c656e677468206973207a65726f6000830152602082019050919050565b6000613319601583614018565b91507f4172726179206c656e677468206d69736d6174636800000000000000000000006000830152602082019050919050565b6000613359600c83614018565b91507f4f4e4c595f4741544557415900000000000000000000000000000000000000006000830152602082019050919050565b6000613399601a83614018565b91507f44657374696e6174696f6e2063616e6e6f74206265207a65726f0000000000006000830152602082019050919050565b60006133d9602683614018565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b600061343f602083614018565b91507f4e6f7420656e6f75676820746f6b656e7320746f20637265617465206c6f636b6000830152602082019050919050565b600061347f602683614018565b91507f416464726573733a20696e73756666696369656e742062616c616e636520666f60008301527f722063616c6c00000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006134e5601283614018565b91507f4f4e4c595f5452414e534645525f544f4f4c00000000000000000000000000006000830152602082019050919050565b6000613525601b83614018565b91507f44657374696e6174696f6e20616c72656164792072656d6f76656400000000006000830152602082019050919050565b6000613565601983614018565b91507f4d6173746572436f70792063616e6e6f74206265207a65726f000000000000006000830152602082019050919050565b60006135a5601d83614018565b91507f546172676574206d757374206265206f7468657220636f6e74726163740000006000830152602082019050919050565b60006135e5601983614018565b91507f437265617465323a204661696c6564206f6e206465706c6f79000000000000006000830152602082019050919050565b6000613625601583614018565b91507f416d6f756e742063616e6e6f74206265207a65726f00000000000000000000006000830152602082019050919050565b6000613665602083614018565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b60006136a5601883614018565b91507f496e76616c6964206d6574686f64207369676e617475726500000000000000006000830152602082019050919050565b60006136e5601983614018565b91507f44657374696e6174696f6e20616c7265616479206164646564000000000000006000830152602082019050919050565b6000613725601d83614018565b91507f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006000830152602082019050919050565b6000613765602a83614018565b91507f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008301527f6f742073756363656564000000000000000000000000000000000000000000006020830152604082019050919050565b60006137cb601d83614018565b91507f437265617465323a20696e73756666696369656e742062616c616e63650000006000830152602082019050919050565b600061380b601983614018565b91507f546172676574206d757374206265206120636f6e7472616374000000000000006000830152602082019050919050565b60c0820160008201516138546000850182613043565b5060208201516138676020850182613043565b50604082015161387a6040850182613043565b50606082015161388d60608501826138b9565b5060808201516138a060808501826138b9565b5060a08201516138b360a08501826138b9565b50505050565b6138c28161416b565b82525050565b6138d18161416b565b82525050565b60006138e382876130e5565b600a820191506138f382866130e5565b600a82019150613903828561312a565b60148201915061391382846130fc565b600f8201915081905095945050505050565b60006139318287613113565b6001820191506139418286613061565b6014820191506139518285613150565b6020820191506139618284613150565b60208201915081905095945050505050565b6000613980828486613167565b91508190509392505050565b6000613998828461318c565b915081905092915050565b60006139b0828486613208565b91508190509392505050565b60006020820190506139d16000830184613052565b92915050565b6000610160820190506139ed600083018e613052565b6139fa602083018d613052565b613a07604083018c613052565b613a14606083018b613052565b613a21608083018a6138c8565b613a2e60a08301896138c8565b613a3b60c08301886138c8565b613a4860e08301876138c8565b613a566101008301866138c8565b613a646101208301856138c8565b613a726101408301846131cc565b9c9b505050505050505050505050565b600061010082019050613a986000830186613052565b613aa56020830185613052565b613ab2604083018461383e565b949350505050565b6000606082019050613acf6000830186613052565b613adc6020830185613052565b613ae960408301846138c8565b949350505050565b6000604082019050613b066000830185613052565b613b1360208301846138c8565b9392505050565b600061010082019050613b30600083018b613052565b613b3d602083018a6138c8565b613b4a60408301896138c8565b613b5760608301886138c8565b613b6460808301876138c8565b613b7160a08301866138c8565b613b7e60c08301856138c8565b613b8b60e08301846131cc565b9998505050505050505050565b60006020820190508181036000830152613bb28184613078565b905092915050565b6000602082019050613bcf60008301846130d6565b92915050565b6000608082019050613bea6000830187613141565b613bf760208301866138c8565b613c0460408301856138c8565b613c1160608301846138c8565b95945050505050565b6000602082019050613c2f60008301846131bd565b92915050565b60006020820190508181036000830152613c508184866131db565b90509392505050565b60006020820190508181036000830152613c73818461322d565b905092915050565b60006020820190508181036000830152613c9481613266565b9050919050565b60006020820190508181036000830152613cb4816132cc565b9050919050565b60006020820190508181036000830152613cd48161330c565b9050919050565b60006020820190508181036000830152613cf48161334c565b9050919050565b60006020820190508181036000830152613d148161338c565b9050919050565b60006020820190508181036000830152613d34816133cc565b9050919050565b60006020820190508181036000830152613d5481613432565b9050919050565b60006020820190508181036000830152613d7481613472565b9050919050565b60006020820190508181036000830152613d94816134d8565b9050919050565b60006020820190508181036000830152613db481613518565b9050919050565b60006020820190508181036000830152613dd481613558565b9050919050565b60006020820190508181036000830152613df481613598565b9050919050565b60006020820190508181036000830152613e14816135d8565b9050919050565b60006020820190508181036000830152613e3481613618565b9050919050565b60006020820190508181036000830152613e5481613658565b9050919050565b60006020820190508181036000830152613e7481613698565b9050919050565b60006020820190508181036000830152613e94816136d8565b9050919050565b60006020820190508181036000830152613eb481613718565b9050919050565b60006020820190508181036000830152613ed481613758565b9050919050565b60006020820190508181036000830152613ef4816137be565b9050919050565b60006020820190508181036000830152613f14816137fe565b9050919050565b6000602082019050613f3060008301846138c8565b92915050565b60008083356001602003843603038112613f4f57600080fd5b80840192508235915067ffffffffffffffff821115613f6d57600080fd5b602083019250600182023603831315613f8557600080fd5b509250929050565b6000604051905081810181811067ffffffffffffffff82111715613fb457613fb3614243565b5b8060405250919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b600061403f8261414b565b9050919050565b60008115159050919050565b60007fff0000000000000000000000000000000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffff0000000000000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffffffffffffff000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffffffffffffffffffffffff00000000000000000000000082169050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600081905061414682614263565b919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600061418082614187565b9050919050565b60006141928261414b565b9050919050565b60006141a482614138565b9050919050565b82818337600083830152505050565b60005b838110156141d85780820151818401526020810190506141bd565b838111156141e7576000848401525b50505050565b60006141f882614231565b9050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b600061423c82614256565b9050919050565bfe5b6000601f19601f8301169050919050565b60008160601b9050919050565b6003811061427457614273614243565b5b50565b61428081614034565b811461428b57600080fd5b50565b61429781614046565b81146142a257600080fd5b50565b6142ae81614102565b81146142b957600080fd5b50565b6142c58161410c565b81146142d057600080fd5b50565b600381106142e057600080fd5b50565b6142ec8161416b565b81146142f757600080fd5b5056fea264697066735822122010f167ec85dbd4b07aedb6960f9f6ac5ae1b0f5473409617dcd319393591837164736f6c63430007030033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101735760003560e01c806379ee1bdf116100de578063a619486e11610097578063cf497e6c11610071578063cf497e6c14610434578063f1d24c4514610450578063f2fde38b14610480578063fc0c546a1461049c57610173565b8063a619486e146103de578063b6b55f25146103fc578063c1ab13db1461041857610173565b806379ee1bdf1461031c5780638da5cb5b1461034c5780638fa74a0e1461036a5780639c05fc6014610388578063a3457466146103a4578063a4c0ed36146103c257610173565b8063463013a211610130578063463013a214610270578063586a53531461028c5780635975e00c146102aa57806368d30c2e146102c65780636e03b8dc146102e2578063715018a61461031257610173565b806303990a6c14610178578063045b7fe2146101945780630602ba2b146101c45780630cd6178f146101f45780632e1a7d4d1461022457806343fb93d914610240575b600080fd5b610192600480360381019061018d9190612f13565b6104ba565b005b6101ae60048036038101906101a99190612ca2565b610662565b6040516101bb91906139bc565b60405180910390f35b6101de60048036038101906101d99190612eea565b610695565b6040516101eb9190613bba565b60405180910390f35b61020e60048036038101906102099190612ca2565b6106d6565b60405161021b91906139bc565b60405180910390f35b61023e60048036038101906102399190612fd9565b610709565b005b61025a60048036038101906102559190612e9b565b610866565b60405161026791906139bc565b60405180910390f35b61028a60048036038101906102859190612f58565b61088b565b005b610294610917565b6040516102a191906139bc565b60405180910390f35b6102c460048036038101906102bf9190612ca2565b61093b565b005b6102e060048036038101906102db9190612ccb565b610acc565b005b6102fc60048036038101906102f79190612eea565b610e14565b60405161030991906139bc565b60405180910390f35b61031a610e47565b005b61033660048036038101906103319190612ca2565b610f81565b6040516103439190613bba565b60405180910390f35b610354610f9e565b60405161036191906139bc565b60405180910390f35b610372610fc7565b60405161037f91906139bc565b60405180910390f35b6103a2600480360381019061039d9190612dfd565b610feb565b005b6103ac611118565b6040516103b99190613b98565b60405180910390f35b6103dc60048036038101906103d79190612d91565b6111f0565b005b6103e6611756565b6040516103f391906139bc565b60405180910390f35b61041660048036038101906104119190612fd9565b61177c565b005b610432600480360381019061042d9190612ca2565b61185f565b005b61044e60048036038101906104499190612ca2565b611980565b005b61046a60048036038101906104659190612eea565b611af3565b60405161047791906139bc565b60405180910390f35b61049a60048036038101906104959190612ca2565b611b6e565b005b6104a4611d17565b6040516104b19190613c1a565b60405180910390f35b6104c2611d41565b73ffffffffffffffffffffffffffffffffffffffff166104e0610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614610536576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161052d90613e3b565b60405180910390fd5b60006105428383611d49565b9050600060016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff16817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163373ffffffffffffffffffffffffffffffffffffffff167f450397a2db0e89eccfe664cc6cdfd274a88bc00d29aaec4d991754a42f19f8c98686604051610655929190613c35565b60405180910390a4505050565b60076020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008073ffffffffffffffffffffffffffffffffffffffff166106b783611af3565b73ffffffffffffffffffffffffffffffffffffffff1614159050919050565b60066020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610711611d41565b73ffffffffffffffffffffffffffffffffffffffff1661072f610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614610785576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077c90613e3b565b60405180910390fd5b600081116107c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107bf90613e1b565b60405180910390fd5b6108153382600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611dd79092919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b8260405161085b9190613f1b565b60405180910390a250565b60006108828461087585611e5d565b8051906020012084611ed3565b90509392505050565b610893611d41565b73ffffffffffffffffffffffffffffffffffffffff166108b1610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614610907576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108fe90613e3b565b60405180910390fd5b610912838383611f17565b505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b610943611d41565b73ffffffffffffffffffffffffffffffffffffffff16610961610f9e565b73ffffffffffffffffffffffffffffffffffffffff16146109b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109ae90613e3b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610a27576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a1e90613cfb565b60405180910390fd5b610a3b8160026120f990919063ffffffff16565b610a7a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7190613e7b565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f33442b8c13e72dd75a027f08f9bff4eed2dfd26e43cdea857365f5163b359a796001604051610ac19190613bba565b60405180910390a250565b610ad4611d41565b73ffffffffffffffffffffffffffffffffffffffff16610af2610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614610b48576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b3f90613e3b565b60405180910390fd5b86600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610ba491906139bc565b60206040518083038186803b158015610bbc57600080fd5b505afa158015610bd0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bf49190613002565b1015610c35576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2c90613d3b565b60405180910390fd5b606063bd896dcb60e01b308b8b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168c8c8c8c8c8c8c604051602401610c869b9a999897969594939291906139d7565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505090506000610d1b8280519060200120600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684612129565b9050610d6a818a600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611dd79092919063ffffffff16565b8973ffffffffffffffffffffffffffffffffffffffff1682805190602001208273ffffffffffffffffffffffffffffffffffffffff167f3c7ff6acee351ed98200c285a04745858a107e16da2f13c3a81a43073c17d644600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168d8d8d8d8d8d8d604051610dff989796959493929190613b1a565b60405180910390a45050505050505050505050565b60016020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610e4f611d41565b73ffffffffffffffffffffffffffffffffffffffff16610e6d610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614610ec3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eba90613e3b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000610f978260026121a590919063ffffffff16565b9050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b7f000000000000000000000000000000000000000000000000000000000000000081565b610ff3611d41565b73ffffffffffffffffffffffffffffffffffffffff16611011610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161105e90613e3b565b60405180910390fd5b8181905084849050146110af576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110a690613cbb565b60405180910390fd5b60005b84849050811015611111576111048585838181106110cc57fe5b90506020028101906110de9190613f36565b8585858181106110ea57fe5b90506020020160208101906110ff9190612ca2565b611f17565b80806001019150506110b2565b5050505050565b60608061112560026121d5565b67ffffffffffffffff8111801561113b57600080fd5b5060405190808252806020026020018201604052801561116a5781602001602082028036833780820191505090505b50905060005b61117a60026121d5565b8110156111e8576111958160026121ea90919063ffffffff16565b8282815181106111a157fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508080600101915050611170565b508091505090565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461127e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161127590613cdb565b60405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161461130c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161130390613d7b565b60405180910390fd5b6113146129d3565b82828101906113239190612fb0565b9050600073ffffffffffffffffffffffffffffffffffffffff1660066000836000015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146114715761146c60066000836000015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1685600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611dd79092919063ffffffff16565b611683565b6000806114958585604051611487929190613973565b604051809103902084612204565b915091508060066000856000015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508260000151600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506115ea8187600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611dd79092919063ffffffff16565b826000015173ffffffffffffffffffffffffffffffffffffffff16836040015173ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fd74fe60cbf1e5bf07ef3fad0e00c45f66345c5226474786d8dc086527dc8414785876060015188608001518960a001516040516116789493929190613bd5565b60405180910390a450505b60066000826000015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16816000015173ffffffffffffffffffffffffffffffffffffffff167fe34903cfa4ad8362651171309d05bcbc2fc581a5ec83ca7b0c8d10743de766e2866040516117479190613f1b565b60405180910390a35050505050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600081116117bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117b690613e1b565b60405180910390fd5b61180e333083600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661225b909392919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f59062170a285eb80e8c6b8ced60428442a51910635005233fc4ce084a475845e826040516118549190613f1b565b60405180910390a250565b611867611d41565b73ffffffffffffffffffffffffffffffffffffffff16611885610f9e565b73ffffffffffffffffffffffffffffffffffffffff16146118db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118d290613e3b565b60405180910390fd5b6118ef8160026122e490919063ffffffff16565b61192e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192590613d9b565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f33442b8c13e72dd75a027f08f9bff4eed2dfd26e43cdea857365f5163b359a7960006040516119759190613bba565b60405180910390a250565b611988611d41565b73ffffffffffffffffffffffffffffffffffffffff166119a6610f9e565b73ffffffffffffffffffffffffffffffffffffffff16146119fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119f390613e3b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611a6c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a6390613dbb565b60405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167f30909084afc859121ffc3a5aef7fe37c540a9a1ef60bd4d8dcdb76376fadf9de60405160405180910390a250565b600060016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b611b76611d41565b73ffffffffffffffffffffffffffffffffffffffff16611b94610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614611bea576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611be190613e3b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c5190613d1b565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600033905090565b6000611dcf83836040516024016040516020818303038152906040529190604051611d759291906139a3565b60405180910390207bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050612314565b905092915050565b611e588363a9059cbb60e01b8484604051602401611df6929190613af1565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505061236c565b505050565b60606000693d602d80600a3d3981f360b01b9050600069363d3d373d3d3d363d7360b01b905060008460601b905060006e5af43d82803e903d91602b57fd5bf360881b905083838383604051602001611eb994939291906138d7565b604051602081830303815290604052945050505050919050565b60008060ff60f81b838686604051602001611ef19493929190613925565b6040516020818303038152906040528051906020012090508060001c9150509392505050565b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611f86576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f7d90613ddb565b60405180910390fd5b611f8f81612433565b611fce576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fc590613efb565b60405180910390fd5b6000611fda8484611d49565b90508160016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff16817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163373ffffffffffffffffffffffffffffffffffffffff167f450397a2db0e89eccfe664cc6cdfd274a88bc00d29aaec4d991754a42f19f8c987876040516120eb929190613c35565b60405180910390a450505050565b6000612121836000018373ffffffffffffffffffffffffffffffffffffffff1660001b612446565b905092915050565b60008061214060008661213b87611e5d565b6124b6565b90508073ffffffffffffffffffffffffffffffffffffffff167efffc2da0b561cae30d9826d37709e9421c4725faebc226cbbb7ef5fc5e734960405160405180910390a260008351111561219a5761219881846125c7565b505b809150509392505050565b60006121cd836000018373ffffffffffffffffffffffffffffffffffffffff1660001b612611565b905092915050565b60006121e382600001612634565b9050919050565b60006121f98360000183612645565b60001c905092915050565b6000806060612212846126b2565b9050600061224386600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684612129565b90508180519060200120819350935050509250929050565b6122de846323b872dd60e01b85858560405160240161227c93929190613aba565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505061236c565b50505050565b600061230c836000018373ffffffffffffffffffffffffffffffffffffffff1660001b612757565b905092915050565b6000600482511461235a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161235190613e5b565b60405180910390fd5b60006020830151905080915050919050565b60606123ce826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff1661283f9092919063ffffffff16565b905060008151111561242e57808060200190518101906123ee9190612e72565b61242d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161242490613ebb565b60405180910390fd5b5b505050565b600080823b905060008111915050919050565b60006124528383612611565b6124ab5782600001829080600181540180825580915050600190039060005260206000200160009091909190915055826000018054905083600101600084815260200190815260200160002081905550600190506124b0565b600090505b92915050565b600080844710156124fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124f390613edb565b60405180910390fd5b600083511415612541576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161253890613c9b565b60405180910390fd5b8383516020850187f59050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156125bc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125b390613dfb565b60405180910390fd5b809150509392505050565b606061260983836040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061283f565b905092915050565b600080836001016000848152602001908152602001600020541415905092915050565b600081600001805490509050919050565b600081836000018054905011612690576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161268790613c7b565b60405180910390fd5b82600001828154811061269f57fe5b9060005260206000200154905092915050565b60606320dc203d60e01b30600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040516024016126f393929190613a82565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050509050919050565b6000808360010160008481526020019081526020016000205490506000811461283357600060018203905060006001866000018054905003905060008660000182815481106127a257fe5b90600052602060002001549050808760000184815481106127bf57fe5b90600052602060002001819055506001830187600101600083815260200190815260200160002081905550866000018054806127f757fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050612839565b60009150505b92915050565b606061284e8484600085612857565b90509392505050565b60608247101561289c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161289390613d5b565b60405180910390fd5b6128a585612433565b6128e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128db90613e9b565b60405180910390fd5b600060608673ffffffffffffffffffffffffffffffffffffffff16858760405161290e919061398c565b60006040518083038185875af1925050503d806000811461294b576040519150601f19603f3d011682016040523d82523d6000602084013e612950565b606091505b509150915061296082828661296c565b92505050949350505050565b6060831561297c578290506129cc565b60008351111561298f5782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129c39190613c59565b60405180910390fd5b9392505050565b6040518060c00160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff1681526020016000815260200160008152602001600081525090565b600081359050612a5a81614277565b92915050565b60008083601f840112612a7257600080fd5b8235905067ffffffffffffffff811115612a8b57600080fd5b602083019150836020820283011115612aa357600080fd5b9250929050565b60008083601f840112612abc57600080fd5b8235905067ffffffffffffffff811115612ad557600080fd5b602083019150836020820283011115612aed57600080fd5b9250929050565b600081519050612b038161428e565b92915050565b600081359050612b18816142a5565b92915050565b600081359050612b2d816142bc565b92915050565b60008083601f840112612b4557600080fd5b8235905067ffffffffffffffff811115612b5e57600080fd5b602083019150836001820283011115612b7657600080fd5b9250929050565b600081359050612b8c816142d3565b92915050565b60008083601f840112612ba457600080fd5b8235905067ffffffffffffffff811115612bbd57600080fd5b602083019150836001820283011115612bd557600080fd5b9250929050565b600060c08284031215612bee57600080fd5b612bf860c0613f8d565b90506000612c0884828501612a4b565b6000830152506020612c1c84828501612a4b565b6020830152506040612c3084828501612a4b565b6040830152506060612c4484828501612c78565b6060830152506080612c5884828501612c78565b60808301525060a0612c6c84828501612c78565b60a08301525092915050565b600081359050612c87816142e3565b92915050565b600081519050612c9c816142e3565b92915050565b600060208284031215612cb457600080fd5b6000612cc284828501612a4b565b91505092915050565b60008060008060008060008060006101208a8c031215612cea57600080fd5b6000612cf88c828d01612a4b565b9950506020612d098c828d01612a4b565b9850506040612d1a8c828d01612c78565b9750506060612d2b8c828d01612c78565b9650506080612d3c8c828d01612c78565b95505060a0612d4d8c828d01612c78565b94505060c0612d5e8c828d01612c78565b93505060e0612d6f8c828d01612c78565b925050610100612d818c828d01612b7d565b9150509295985092959850929598565b60008060008060608587031215612da757600080fd5b6000612db587828801612a4b565b9450506020612dc687828801612c78565b935050604085013567ffffffffffffffff811115612de357600080fd5b612def87828801612b33565b925092505092959194509250565b60008060008060408587031215612e1357600080fd5b600085013567ffffffffffffffff811115612e2d57600080fd5b612e3987828801612aaa565b9450945050602085013567ffffffffffffffff811115612e5857600080fd5b612e6487828801612a60565b925092505092959194509250565b600060208284031215612e8457600080fd5b6000612e9284828501612af4565b91505092915050565b600080600060608486031215612eb057600080fd5b6000612ebe86828701612b09565b9350506020612ecf86828701612a4b565b9250506040612ee086828701612a4b565b9150509250925092565b600060208284031215612efc57600080fd5b6000612f0a84828501612b1e565b91505092915050565b60008060208385031215612f2657600080fd5b600083013567ffffffffffffffff811115612f4057600080fd5b612f4c85828601612b92565b92509250509250929050565b600080600060408486031215612f6d57600080fd5b600084013567ffffffffffffffff811115612f8757600080fd5b612f9386828701612b92565b93509350506020612fa686828701612a4b565b9150509250925092565b600060c08284031215612fc257600080fd5b6000612fd084828501612bdc565b91505092915050565b600060208284031215612feb57600080fd5b6000612ff984828501612c78565b91505092915050565b60006020828403121561301457600080fd5b600061302284828501612c8d565b91505092915050565b60006130378383613043565b60208301905092915050565b61304c81614034565b82525050565b61305b81614034565b82525050565b61307261306d82614034565b6141ed565b82525050565b600061308382613fce565b61308d8185613ffc565b935061309883613fbe565b8060005b838110156130c95781516130b0888261302b565b97506130bb83613fef565b92505060018101905061309c565b5085935050505092915050565b6130df81614046565b82525050565b6130f66130f18261407e565b614209565b82525050565b61310d613108826140aa565b614213565b82525050565b61312461311f82614052565b6141ff565b82525050565b61313b613136826140d6565b61421d565b82525050565b61314a81614102565b82525050565b61316161315c82614102565b614227565b82525050565b6000613173838561400d565b93506131808385846141ab565b82840190509392505050565b600061319782613fd9565b6131a1818561400d565b93506131b18185602086016141ba565b80840191505092915050565b6131c681614175565b82525050565b6131d581614199565b82525050565b60006131e78385614018565b93506131f48385846141ab565b6131fd83614245565b840190509392505050565b60006132148385614029565b93506132218385846141ab565b82840190509392505050565b600061323882613fe4565b6132428185614018565b93506132528185602086016141ba565b61325b81614245565b840191505092915050565b6000613273602283614018565b91507f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e60008301527f64730000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006132d9602083614018565b91507f437265617465323a2062797465636f6465206c656e677468206973207a65726f6000830152602082019050919050565b6000613319601583614018565b91507f4172726179206c656e677468206d69736d6174636800000000000000000000006000830152602082019050919050565b6000613359600c83614018565b91507f4f4e4c595f4741544557415900000000000000000000000000000000000000006000830152602082019050919050565b6000613399601a83614018565b91507f44657374696e6174696f6e2063616e6e6f74206265207a65726f0000000000006000830152602082019050919050565b60006133d9602683614018565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b600061343f602083614018565b91507f4e6f7420656e6f75676820746f6b656e7320746f20637265617465206c6f636b6000830152602082019050919050565b600061347f602683614018565b91507f416464726573733a20696e73756666696369656e742062616c616e636520666f60008301527f722063616c6c00000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006134e5601283614018565b91507f4f4e4c595f5452414e534645525f544f4f4c00000000000000000000000000006000830152602082019050919050565b6000613525601b83614018565b91507f44657374696e6174696f6e20616c72656164792072656d6f76656400000000006000830152602082019050919050565b6000613565601983614018565b91507f4d6173746572436f70792063616e6e6f74206265207a65726f000000000000006000830152602082019050919050565b60006135a5601d83614018565b91507f546172676574206d757374206265206f7468657220636f6e74726163740000006000830152602082019050919050565b60006135e5601983614018565b91507f437265617465323a204661696c6564206f6e206465706c6f79000000000000006000830152602082019050919050565b6000613625601583614018565b91507f416d6f756e742063616e6e6f74206265207a65726f00000000000000000000006000830152602082019050919050565b6000613665602083614018565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b60006136a5601883614018565b91507f496e76616c6964206d6574686f64207369676e617475726500000000000000006000830152602082019050919050565b60006136e5601983614018565b91507f44657374696e6174696f6e20616c7265616479206164646564000000000000006000830152602082019050919050565b6000613725601d83614018565b91507f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006000830152602082019050919050565b6000613765602a83614018565b91507f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008301527f6f742073756363656564000000000000000000000000000000000000000000006020830152604082019050919050565b60006137cb601d83614018565b91507f437265617465323a20696e73756666696369656e742062616c616e63650000006000830152602082019050919050565b600061380b601983614018565b91507f546172676574206d757374206265206120636f6e7472616374000000000000006000830152602082019050919050565b60c0820160008201516138546000850182613043565b5060208201516138676020850182613043565b50604082015161387a6040850182613043565b50606082015161388d60608501826138b9565b5060808201516138a060808501826138b9565b5060a08201516138b360a08501826138b9565b50505050565b6138c28161416b565b82525050565b6138d18161416b565b82525050565b60006138e382876130e5565b600a820191506138f382866130e5565b600a82019150613903828561312a565b60148201915061391382846130fc565b600f8201915081905095945050505050565b60006139318287613113565b6001820191506139418286613061565b6014820191506139518285613150565b6020820191506139618284613150565b60208201915081905095945050505050565b6000613980828486613167565b91508190509392505050565b6000613998828461318c565b915081905092915050565b60006139b0828486613208565b91508190509392505050565b60006020820190506139d16000830184613052565b92915050565b6000610160820190506139ed600083018e613052565b6139fa602083018d613052565b613a07604083018c613052565b613a14606083018b613052565b613a21608083018a6138c8565b613a2e60a08301896138c8565b613a3b60c08301886138c8565b613a4860e08301876138c8565b613a566101008301866138c8565b613a646101208301856138c8565b613a726101408301846131cc565b9c9b505050505050505050505050565b600061010082019050613a986000830186613052565b613aa56020830185613052565b613ab2604083018461383e565b949350505050565b6000606082019050613acf6000830186613052565b613adc6020830185613052565b613ae960408301846138c8565b949350505050565b6000604082019050613b066000830185613052565b613b1360208301846138c8565b9392505050565b600061010082019050613b30600083018b613052565b613b3d602083018a6138c8565b613b4a60408301896138c8565b613b5760608301886138c8565b613b6460808301876138c8565b613b7160a08301866138c8565b613b7e60c08301856138c8565b613b8b60e08301846131cc565b9998505050505050505050565b60006020820190508181036000830152613bb28184613078565b905092915050565b6000602082019050613bcf60008301846130d6565b92915050565b6000608082019050613bea6000830187613141565b613bf760208301866138c8565b613c0460408301856138c8565b613c1160608301846138c8565b95945050505050565b6000602082019050613c2f60008301846131bd565b92915050565b60006020820190508181036000830152613c508184866131db565b90509392505050565b60006020820190508181036000830152613c73818461322d565b905092915050565b60006020820190508181036000830152613c9481613266565b9050919050565b60006020820190508181036000830152613cb4816132cc565b9050919050565b60006020820190508181036000830152613cd48161330c565b9050919050565b60006020820190508181036000830152613cf48161334c565b9050919050565b60006020820190508181036000830152613d148161338c565b9050919050565b60006020820190508181036000830152613d34816133cc565b9050919050565b60006020820190508181036000830152613d5481613432565b9050919050565b60006020820190508181036000830152613d7481613472565b9050919050565b60006020820190508181036000830152613d94816134d8565b9050919050565b60006020820190508181036000830152613db481613518565b9050919050565b60006020820190508181036000830152613dd481613558565b9050919050565b60006020820190508181036000830152613df481613598565b9050919050565b60006020820190508181036000830152613e14816135d8565b9050919050565b60006020820190508181036000830152613e3481613618565b9050919050565b60006020820190508181036000830152613e5481613658565b9050919050565b60006020820190508181036000830152613e7481613698565b9050919050565b60006020820190508181036000830152613e94816136d8565b9050919050565b60006020820190508181036000830152613eb481613718565b9050919050565b60006020820190508181036000830152613ed481613758565b9050919050565b60006020820190508181036000830152613ef4816137be565b9050919050565b60006020820190508181036000830152613f14816137fe565b9050919050565b6000602082019050613f3060008301846138c8565b92915050565b60008083356001602003843603038112613f4f57600080fd5b80840192508235915067ffffffffffffffff821115613f6d57600080fd5b602083019250600182023603831315613f8557600080fd5b509250929050565b6000604051905081810181811067ffffffffffffffff82111715613fb457613fb3614243565b5b8060405250919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b600061403f8261414b565b9050919050565b60008115159050919050565b60007fff0000000000000000000000000000000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffff0000000000000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffffffffffffff000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffffffffffffffffffffffff00000000000000000000000082169050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600081905061414682614263565b919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600061418082614187565b9050919050565b60006141928261414b565b9050919050565b60006141a482614138565b9050919050565b82818337600083830152505050565b60005b838110156141d85780820151818401526020810190506141bd565b838111156141e7576000848401525b50505050565b60006141f882614231565b9050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b600061423c82614256565b9050919050565bfe5b6000601f19601f8301169050919050565b60008160601b9050919050565b6003811061427457614273614243565b5b50565b61428081614034565b811461428b57600080fd5b50565b61429781614046565b81146142a257600080fd5b50565b6142ae81614102565b81146142b957600080fd5b50565b6142c58161410c565b81146142d057600080fd5b50565b600381106142e057600080fd5b50565b6142ec8161416b565b81146142f757600080fd5b5056fea264697066735822122010f167ec85dbd4b07aedb6960f9f6ac5ae1b0f5473409617dcd319393591837164736f6c63430007030033", + "devdoc": { + "events": { + "LockedTokensReceivedFromL1(address,address,uint256)": { + "details": "Emitted when locked tokens are received from L1 (whether the wallet had already been received or not)" + }, + "TokenLockCreatedFromL1(address,bytes32,address,uint256,uint256,uint256,address)": { + "details": "Event emitted when a wallet is received and created from L1" + } + }, + "kind": "dev", + "methods": { + "addTokenDestination(address)": { + "params": { + "_dst": "Destination address" + } + }, + "constructor": { + "params": { + "_graphToken": "Address of the L2 GRT token contract", + "_l1TransferTool": "Address of the L1 transfer tool contract (in L1, without aliasing)", + "_l2Gateway": "Address of the L2GraphTokenGateway contract", + "_masterCopy": "Address of the master copy of the L2GraphTokenLockWallet implementation" + } + }, + "createTokenLockWallet(address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)": { + "params": { + "_beneficiary": "Address of the beneficiary of locked tokens", + "_endTime": "End time of the release schedule", + "_managedAmount": "Amount of tokens to be managed by the lock contract", + "_owner": "Address of the contract owner", + "_periods": "Number of periods between start time and end time", + "_releaseStartTime": "Override time for when the releases start", + "_revocable": "Whether the contract is revocable", + "_startTime": "Start time of the release schedule" + } + }, + "deposit(uint256)": { + "details": "Even if the ERC20 token can be transferred directly to the contract this function provide a safe interface to do the transfer and avoid mistakes", + "params": { + "_amount": "Amount to deposit" + } + }, + "getAuthFunctionCallTarget(bytes4)": { + "params": { + "_sigHash": "Function signature hash" + }, + "returns": { + "_0": "Address of the target contract where to send the call" + } + }, + "getDeploymentAddress(bytes32,address,address)": { + "params": { + "_deployer": "Address of the deployer that creates the contract", + "_implementation": "Address of the proxy target implementation", + "_salt": "Bytes32 salt to use for CREATE2" + }, + "returns": { + "_0": "Address of the counterfactual MinimalProxy" + } + }, + "getTokenDestinations()": { + "returns": { + "_0": "Array of addresses authorized to pull funds from a token lock" + } + }, + "isAuthFunctionCall(bytes4)": { + "params": { + "_sigHash": "Function signature hash" + }, + "returns": { + "_0": "True if authorized" + } + }, + "isTokenDestination(address)": { + "params": { + "_dst": "Destination address" + }, + "returns": { + "_0": "True if authorized" + } + }, + "onTokenTransfer(address,uint256,bytes)": { + "details": "This function will create a new wallet if it doesn't exist yet, or send the tokens to the existing wallet if it does.", + "params": { + "_amount": "Amount of tokens received", + "_data": "Encoded data of the transferred wallet, which must be an ABI-encoded TransferredWalletData struct", + "_from": "Address of the sender in L1, which must be the L1GraphTokenLockTransferTool" + } + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "removeTokenDestination(address)": { + "params": { + "_dst": "Destination address" + } + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." + }, + "setAuthFunctionCall(string,address)": { + "details": "Input expected is the function signature as 'transfer(address,uint256)'", + "params": { + "_signature": "Function signature", + "_target": "Address of the destination contract to call" + } + }, + "setAuthFunctionCallMany(string[],address[])": { + "details": "Input expected is the function signature as 'transfer(address,uint256)'", + "params": { + "_signatures": "Function signatures", + "_targets": "Address of the destination contract to call" + } + }, + "setMasterCopy(address)": { + "params": { + "_masterCopy": "Address of contract bytecode to factory clone" + } + }, + "token()": { + "returns": { + "_0": "Token used for transfers and approvals" + } + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + }, + "unsetAuthFunctionCall(string)": { + "details": "Input expected is the function signature as 'transfer(address,uint256)'", + "params": { + "_signature": "Function signature" + } + }, + "withdraw(uint256)": { + "details": "Escape hatch in case of mistakes or to recover remaining funds", + "params": { + "_amount": "Amount of tokens to withdraw" + } + } + }, + "title": "L2GraphTokenLockManager", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "addTokenDestination(address)": { + "notice": "Adds an address that can be allowed by a token lock to pull funds" + }, + "constructor": { + "notice": "Constructor for the L2GraphTokenLockManager contract." + }, + "createTokenLockWallet(address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)": { + "notice": "Creates and fund a new token lock wallet using a minimum proxy" + }, + "deposit(uint256)": { + "notice": "Deposits tokens into the contract" + }, + "getAuthFunctionCallTarget(bytes4)": { + "notice": "Gets the target contract to call for a particular function signature" + }, + "getDeploymentAddress(bytes32,address,address)": { + "notice": "Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation" + }, + "getTokenDestinations()": { + "notice": "Returns an array of authorized destination addresses" + }, + "isAuthFunctionCall(bytes4)": { + "notice": "Returns true if the function call is authorized" + }, + "isTokenDestination(address)": { + "notice": "Returns True if the address is authorized to be a destination of tokens" + }, + "l1TransferTool()": { + "notice": "Address of the L1 transfer tool contract (in L1, no aliasing)" + }, + "l1WalletToL2Wallet(address)": { + "notice": "Mapping of each L1 wallet to its L2 wallet counterpart (populated when each wallet is received) L1 address => L2 address" + }, + "l2Gateway()": { + "notice": "Address of the L2GraphTokenGateway" + }, + "l2WalletToL1Wallet(address)": { + "notice": "Mapping of each L2 wallet to its L1 wallet counterpart (populated when each wallet is received) L2 address => L1 address" + }, + "onTokenTransfer(address,uint256,bytes)": { + "notice": "This function is called by the L2GraphTokenGateway when tokens are sent from L1." + }, + "removeTokenDestination(address)": { + "notice": "Removes an address that can be allowed by a token lock to pull funds" + }, + "setAuthFunctionCall(string,address)": { + "notice": "Sets an authorized function call to target" + }, + "setAuthFunctionCallMany(string[],address[])": { + "notice": "Sets an authorized function call to target in bulk" + }, + "setMasterCopy(address)": { + "notice": "Sets the masterCopy bytecode to use to create clones of TokenLock contracts" + }, + "token()": { + "notice": "Gets the GRT token address" + }, + "unsetAuthFunctionCall(string)": { + "notice": "Unsets an authorized function call to target" + }, + "withdraw(uint256)": { + "notice": "Withdraws tokens from the contract" + } + }, + "notice": "This contract manages a list of authorized function calls and targets that can be called by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts. This contract receives funds to make the process of creating TokenLockWallet contracts easier by distributing them the initial tokens to be managed. In particular, this L2 variant is designed to receive token lock wallets from L1, through the GRT bridge. These transferred wallets will not allow releasing funds in L2 until the end of the vesting timeline, but they can allow withdrawing funds back to L1 using the L2GraphTokenLockTransferTool contract. The owner can setup a list of token destinations that will be used by TokenLock contracts to approve the pulling of funds, this way in can be guaranteed that only protocol contracts will manipulate users funds.", + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 672, + "contract": "contracts/L2GraphTokenLockManager.sol:L2GraphTokenLockManager", + "label": "_owner", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 3988, + "contract": "contracts/L2GraphTokenLockManager.sol:L2GraphTokenLockManager", + "label": "authFnCalls", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_bytes4,t_address)" + }, + { + "astId": 3990, + "contract": "contracts/L2GraphTokenLockManager.sol:L2GraphTokenLockManager", + "label": "_tokenDestinations", + "offset": 0, + "slot": "2", + "type": "t_struct(AddressSet)2629_storage" + }, + { + "astId": 3992, + "contract": "contracts/L2GraphTokenLockManager.sol:L2GraphTokenLockManager", + "label": "masterCopy", + "offset": 0, + "slot": "4", + "type": "t_address" + }, + { + "astId": 3994, + "contract": "contracts/L2GraphTokenLockManager.sol:L2GraphTokenLockManager", + "label": "_token", + "offset": 0, + "slot": "5", + "type": "t_contract(IERC20)1710" + }, + { + "astId": 6154, + "contract": "contracts/L2GraphTokenLockManager.sol:L2GraphTokenLockManager", + "label": "l1WalletToL2Wallet", + "offset": 0, + "slot": "6", + "type": "t_mapping(t_address,t_address)" + }, + { + "astId": 6159, + "contract": "contracts/L2GraphTokenLockManager.sol:L2GraphTokenLockManager", + "label": "l2WalletToL1Wallet", + "offset": 0, + "slot": "7", + "type": "t_mapping(t_address,t_address)" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_bytes32)dyn_storage": { + "base": "t_bytes32", + "encoding": "dynamic_array", + "label": "bytes32[]", + "numberOfBytes": "32" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_bytes4": { + "encoding": "inplace", + "label": "bytes4", + "numberOfBytes": "4" + }, + "t_contract(IERC20)1710": { + "encoding": "inplace", + "label": "contract IERC20", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_address)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => address)", + "numberOfBytes": "32", + "value": "t_address" + }, + "t_mapping(t_bytes32,t_uint256)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_mapping(t_bytes4,t_address)": { + "encoding": "mapping", + "key": "t_bytes4", + "label": "mapping(bytes4 => address)", + "numberOfBytes": "32", + "value": "t_address" + }, + "t_struct(AddressSet)2629_storage": { + "encoding": "inplace", + "label": "struct EnumerableSet.AddressSet", + "members": [ + { + "astId": 2628, + "contract": "contracts/L2GraphTokenLockManager.sol:L2GraphTokenLockManager", + "label": "_inner", + "offset": 0, + "slot": "0", + "type": "t_struct(Set)2364_storage" + } + ], + "numberOfBytes": "64" + }, + "t_struct(Set)2364_storage": { + "encoding": "inplace", + "label": "struct EnumerableSet.Set", + "members": [ + { + "astId": 2359, + "contract": "contracts/L2GraphTokenLockManager.sol:L2GraphTokenLockManager", + "label": "_values", + "offset": 0, + "slot": "0", + "type": "t_array(t_bytes32)dyn_storage" + }, + { + "astId": 2363, + "contract": "contracts/L2GraphTokenLockManager.sol:L2GraphTokenLockManager", + "label": "_indexes", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_bytes32,t_uint256)" + } + ], + "numberOfBytes": "64" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} \ No newline at end of file diff --git a/packages/token-distribution/deployments/arbitrum-one/L2GraphTokenLockManager.json b/packages/token-distribution/deployments/arbitrum-one/L2GraphTokenLockManager.json new file mode 100644 index 000000000..f3aff0d3b --- /dev/null +++ b/packages/token-distribution/deployments/arbitrum-one/L2GraphTokenLockManager.json @@ -0,0 +1,1161 @@ +{ + "address": "0xF1ef3f2007E63cAA4F3B8e22D73B31CCF434500D", + "abi": [ + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_graphToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_masterCopy", + "type": "address" + }, + { + "internalType": "address", + "name": "_l2Gateway", + "type": "address" + }, + { + "internalType": "address", + "name": "_l1TransferTool", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes4", + "name": "sigHash", + "type": "bytes4" + }, + { + "indexed": true, + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "indexed": false, + "internalType": "string", + "name": "signature", + "type": "string" + } + ], + "name": "FunctionCallAuth", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "l1Address", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "l2Address", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "LockedTokensReceivedFromL1", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "masterCopy", + "type": "address" + } + ], + "name": "MasterCopyUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "proxy", + "type": "address" + } + ], + "name": "ProxyCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "dst", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "TokenDestinationAllowed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "contractAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "initHash", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "managedAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "startTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "endTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "periods", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "releaseStartTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "vestingCliffTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "enum IGraphTokenLock.Revocability", + "name": "revocable", + "type": "uint8" + } + ], + "name": "TokenLockCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "contractAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "initHash", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "managedAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "startTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "endTime", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "l1Address", + "type": "address" + } + ], + "name": "TokenLockCreatedFromL1", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensDeposited", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensWithdrawn", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_dst", + "type": "address" + } + ], + "name": "addTokenDestination", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "", + "type": "bytes4" + } + ], + "name": "authFnCalls", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_owner", + "type": "address" + }, + { + "internalType": "address", + "name": "_beneficiary", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_managedAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_startTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_endTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_periods", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_releaseStartTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_vestingCliffTime", + "type": "uint256" + }, + { + "internalType": "enum IGraphTokenLock.Revocability", + "name": "_revocable", + "type": "uint8" + } + ], + "name": "createTokenLockWallet", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "deposit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_sigHash", + "type": "bytes4" + } + ], + "name": "getAuthFunctionCallTarget", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_salt", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "_implementation", + "type": "address" + }, + { + "internalType": "address", + "name": "_deployer", + "type": "address" + } + ], + "name": "getDeploymentAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "getTokenDestinations", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_sigHash", + "type": "bytes4" + } + ], + "name": "isAuthFunctionCall", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_dst", + "type": "address" + } + ], + "name": "isTokenDestination", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "l1TransferTool", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "l1WalletToL2Wallet", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "l2Gateway", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "l2WalletToL1Wallet", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "masterCopy", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_from", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "onTokenTransfer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_dst", + "type": "address" + } + ], + "name": "removeTokenDestination", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_signature", + "type": "string" + }, + { + "internalType": "address", + "name": "_target", + "type": "address" + } + ], + "name": "setAuthFunctionCall", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string[]", + "name": "_signatures", + "type": "string[]" + }, + { + "internalType": "address[]", + "name": "_targets", + "type": "address[]" + } + ], + "name": "setAuthFunctionCallMany", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_masterCopy", + "type": "address" + } + ], + "name": "setMasterCopy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "token", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_signature", + "type": "string" + } + ], + "name": "unsetAuthFunctionCall", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x9e01867e9d647a91c2607bcf14fa3d106edff3d0010c593ee9535854ac1a4a72", + "receipt": { + "to": null, + "from": "0x4528FD7868c91Ef64B9907450Ee8d82dC639612c", + "contractAddress": "0xF1ef3f2007E63cAA4F3B8e22D73B31CCF434500D", + "transactionIndex": 1, + "gasUsed": "26151593", + "logsBloom": "0x00004000000000200000200100000000000004000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000001000000000000000000400000000002000000020000000000000000000800000000000000000000000000000000400000002000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000020000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x8a49288c8778e5b27f878e249cf123940a27ce6b026ed980e94ccd65813647ac", + "transactionHash": "0x9e01867e9d647a91c2607bcf14fa3d106edff3d0010c593ee9535854ac1a4a72", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 113600391, + "transactionHash": "0x9e01867e9d647a91c2607bcf14fa3d106edff3d0010c593ee9535854ac1a4a72", + "address": "0xF1ef3f2007E63cAA4F3B8e22D73B31CCF434500D", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000004528fd7868c91ef64b9907450ee8d82dc639612c" + ], + "data": "0x", + "logIndex": 0, + "blockHash": "0x8a49288c8778e5b27f878e249cf123940a27ce6b026ed980e94ccd65813647ac" + }, + { + "transactionIndex": 1, + "blockNumber": 113600391, + "transactionHash": "0x9e01867e9d647a91c2607bcf14fa3d106edff3d0010c593ee9535854ac1a4a72", + "address": "0xF1ef3f2007E63cAA4F3B8e22D73B31CCF434500D", + "topics": [ + "0x30909084afc859121ffc3a5aef7fe37c540a9a1ef60bd4d8dcdb76376fadf9de", + "0x0000000000000000000000006864cdd6d69dbef02e5e06c5534b20fdaf8b51b0" + ], + "data": "0x", + "logIndex": 1, + "blockHash": "0x8a49288c8778e5b27f878e249cf123940a27ce6b026ed980e94ccd65813647ac" + } + ], + "blockNumber": 113600391, + "cumulativeGasUsed": "26151593", + "status": 1, + "byzantium": true + }, + "args": [ + "0x9623063377AD1B27544C965cCd7342f7EA7e88C7", + "0x6864Cdd6D69Dbef02E5e06c5534b20fdaf8b51b0", + "0x65E1a5e8946e7E87d9774f5288f41c30a99fD302", + "0xCa82c7Ce3388b0B5d307574099aC57d7a00d509F" + ], + "solcInputHash": "b5cdad58099d39cd1aed000b2fd864d8", + "metadata": "{\"compiler\":{\"version\":\"0.7.3+commit.9bfce1f6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"_graphToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_masterCopy\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_l2Gateway\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_l1TransferTool\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes4\",\"name\":\"sigHash\",\"type\":\"bytes4\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"signature\",\"type\":\"string\"}],\"name\":\"FunctionCallAuth\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"l1Address\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"l2Address\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"LockedTokensReceivedFromL1\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"masterCopy\",\"type\":\"address\"}],\"name\":\"MasterCopyUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"proxy\",\"type\":\"address\"}],\"name\":\"ProxyCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dst\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"}],\"name\":\"TokenDestinationAllowed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"contractAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"initHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"managedAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"startTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"endTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"periods\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"releaseStartTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"vestingCliffTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"enum IGraphTokenLock.Revocability\",\"name\":\"revocable\",\"type\":\"uint8\"}],\"name\":\"TokenLockCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"contractAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"initHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"managedAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"startTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"endTime\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"l1Address\",\"type\":\"address\"}],\"name\":\"TokenLockCreatedFromL1\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensWithdrawn\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_dst\",\"type\":\"address\"}],\"name\":\"addTokenDestination\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"name\":\"authFnCalls\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_beneficiary\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_managedAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_startTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_endTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_periods\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_releaseStartTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_vestingCliffTime\",\"type\":\"uint256\"},{\"internalType\":\"enum IGraphTokenLock.Revocability\",\"name\":\"_revocable\",\"type\":\"uint8\"}],\"name\":\"createTokenLockWallet\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"deposit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"_sigHash\",\"type\":\"bytes4\"}],\"name\":\"getAuthFunctionCallTarget\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_salt\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_deployer\",\"type\":\"address\"}],\"name\":\"getDeploymentAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTokenDestinations\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"_sigHash\",\"type\":\"bytes4\"}],\"name\":\"isAuthFunctionCall\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_dst\",\"type\":\"address\"}],\"name\":\"isTokenDestination\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"l1TransferTool\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"l1WalletToL2Wallet\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"l2Gateway\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"l2WalletToL1Wallet\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"masterCopy\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_from\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"onTokenTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_dst\",\"type\":\"address\"}],\"name\":\"removeTokenDestination\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_signature\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"_target\",\"type\":\"address\"}],\"name\":\"setAuthFunctionCall\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string[]\",\"name\":\"_signatures\",\"type\":\"string[]\"},{\"internalType\":\"address[]\",\"name\":\"_targets\",\"type\":\"address[]\"}],\"name\":\"setAuthFunctionCallMany\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_masterCopy\",\"type\":\"address\"}],\"name\":\"setMasterCopy\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_signature\",\"type\":\"string\"}],\"name\":\"unsetAuthFunctionCall\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"events\":{\"LockedTokensReceivedFromL1(address,address,uint256)\":{\"details\":\"Emitted when locked tokens are received from L1 (whether the wallet had already been received or not)\"},\"TokenLockCreatedFromL1(address,bytes32,address,uint256,uint256,uint256,address)\":{\"details\":\"Event emitted when a wallet is received and created from L1\"}},\"kind\":\"dev\",\"methods\":{\"addTokenDestination(address)\":{\"params\":{\"_dst\":\"Destination address\"}},\"constructor\":{\"params\":{\"_graphToken\":\"Address of the L2 GRT token contract\",\"_l1TransferTool\":\"Address of the L1 transfer tool contract (in L1, without aliasing)\",\"_l2Gateway\":\"Address of the L2GraphTokenGateway contract\",\"_masterCopy\":\"Address of the master copy of the L2GraphTokenLockWallet implementation\"}},\"createTokenLockWallet(address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)\":{\"params\":{\"_beneficiary\":\"Address of the beneficiary of locked tokens\",\"_endTime\":\"End time of the release schedule\",\"_managedAmount\":\"Amount of tokens to be managed by the lock contract\",\"_owner\":\"Address of the contract owner\",\"_periods\":\"Number of periods between start time and end time\",\"_releaseStartTime\":\"Override time for when the releases start\",\"_revocable\":\"Whether the contract is revocable\",\"_startTime\":\"Start time of the release schedule\"}},\"deposit(uint256)\":{\"details\":\"Even if the ERC20 token can be transferred directly to the contract this function provide a safe interface to do the transfer and avoid mistakes\",\"params\":{\"_amount\":\"Amount to deposit\"}},\"getAuthFunctionCallTarget(bytes4)\":{\"params\":{\"_sigHash\":\"Function signature hash\"},\"returns\":{\"_0\":\"Address of the target contract where to send the call\"}},\"getDeploymentAddress(bytes32,address,address)\":{\"params\":{\"_deployer\":\"Address of the deployer that creates the contract\",\"_implementation\":\"Address of the proxy target implementation\",\"_salt\":\"Bytes32 salt to use for CREATE2\"},\"returns\":{\"_0\":\"Address of the counterfactual MinimalProxy\"}},\"getTokenDestinations()\":{\"returns\":{\"_0\":\"Array of addresses authorized to pull funds from a token lock\"}},\"isAuthFunctionCall(bytes4)\":{\"params\":{\"_sigHash\":\"Function signature hash\"},\"returns\":{\"_0\":\"True if authorized\"}},\"isTokenDestination(address)\":{\"params\":{\"_dst\":\"Destination address\"},\"returns\":{\"_0\":\"True if authorized\"}},\"onTokenTransfer(address,uint256,bytes)\":{\"details\":\"This function will create a new wallet if it doesn't exist yet, or send the tokens to the existing wallet if it does.\",\"params\":{\"_amount\":\"Amount of tokens received\",\"_data\":\"Encoded data of the transferred wallet, which must be an ABI-encoded TransferredWalletData struct\",\"_from\":\"Address of the sender in L1, which must be the L1GraphTokenLockTransferTool\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"removeTokenDestination(address)\":{\"params\":{\"_dst\":\"Destination address\"}},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"setAuthFunctionCall(string,address)\":{\"details\":\"Input expected is the function signature as 'transfer(address,uint256)'\",\"params\":{\"_signature\":\"Function signature\",\"_target\":\"Address of the destination contract to call\"}},\"setAuthFunctionCallMany(string[],address[])\":{\"details\":\"Input expected is the function signature as 'transfer(address,uint256)'\",\"params\":{\"_signatures\":\"Function signatures\",\"_targets\":\"Address of the destination contract to call\"}},\"setMasterCopy(address)\":{\"params\":{\"_masterCopy\":\"Address of contract bytecode to factory clone\"}},\"token()\":{\"returns\":{\"_0\":\"Token used for transfers and approvals\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"unsetAuthFunctionCall(string)\":{\"details\":\"Input expected is the function signature as 'transfer(address,uint256)'\",\"params\":{\"_signature\":\"Function signature\"}},\"withdraw(uint256)\":{\"details\":\"Escape hatch in case of mistakes or to recover remaining funds\",\"params\":{\"_amount\":\"Amount of tokens to withdraw\"}}},\"title\":\"L2GraphTokenLockManager\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"addTokenDestination(address)\":{\"notice\":\"Adds an address that can be allowed by a token lock to pull funds\"},\"constructor\":{\"notice\":\"Constructor for the L2GraphTokenLockManager contract.\"},\"createTokenLockWallet(address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)\":{\"notice\":\"Creates and fund a new token lock wallet using a minimum proxy\"},\"deposit(uint256)\":{\"notice\":\"Deposits tokens into the contract\"},\"getAuthFunctionCallTarget(bytes4)\":{\"notice\":\"Gets the target contract to call for a particular function signature\"},\"getDeploymentAddress(bytes32,address,address)\":{\"notice\":\"Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation\"},\"getTokenDestinations()\":{\"notice\":\"Returns an array of authorized destination addresses\"},\"isAuthFunctionCall(bytes4)\":{\"notice\":\"Returns true if the function call is authorized\"},\"isTokenDestination(address)\":{\"notice\":\"Returns True if the address is authorized to be a destination of tokens\"},\"l1TransferTool()\":{\"notice\":\"Address of the L1 transfer tool contract (in L1, no aliasing)\"},\"l1WalletToL2Wallet(address)\":{\"notice\":\"Mapping of each L1 wallet to its L2 wallet counterpart (populated when each wallet is received) L1 address => L2 address\"},\"l2Gateway()\":{\"notice\":\"Address of the L2GraphTokenGateway\"},\"l2WalletToL1Wallet(address)\":{\"notice\":\"Mapping of each L2 wallet to its L1 wallet counterpart (populated when each wallet is received) L2 address => L1 address\"},\"onTokenTransfer(address,uint256,bytes)\":{\"notice\":\"This function is called by the L2GraphTokenGateway when tokens are sent from L1.\"},\"removeTokenDestination(address)\":{\"notice\":\"Removes an address that can be allowed by a token lock to pull funds\"},\"setAuthFunctionCall(string,address)\":{\"notice\":\"Sets an authorized function call to target\"},\"setAuthFunctionCallMany(string[],address[])\":{\"notice\":\"Sets an authorized function call to target in bulk\"},\"setMasterCopy(address)\":{\"notice\":\"Sets the masterCopy bytecode to use to create clones of TokenLock contracts\"},\"token()\":{\"notice\":\"Gets the GRT token address\"},\"unsetAuthFunctionCall(string)\":{\"notice\":\"Unsets an authorized function call to target\"},\"withdraw(uint256)\":{\"notice\":\"Withdraws tokens from the contract\"}},\"notice\":\"This contract manages a list of authorized function calls and targets that can be called by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts. This contract receives funds to make the process of creating TokenLockWallet contracts easier by distributing them the initial tokens to be managed. In particular, this L2 variant is designed to receive token lock wallets from L1, through the GRT bridge. These transferred wallets will not allow releasing funds in L2 until the end of the vesting timeline, but they can allow withdrawing funds back to L1 using the L2GraphTokenLockTransferTool contract. The owner can setup a list of token destinations that will be used by TokenLock contracts to approve the pulling of funds, this way in can be guaranteed that only protocol contracts will manipulate users funds.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/L2GraphTokenLockManager.sol\":\"L2GraphTokenLockManager\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor () internal {\\n address msgSender = _msgSender();\\n _owner = msgSender;\\n emit OwnershipTransferred(address(0), msgSender);\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n emit OwnershipTransferred(_owner, address(0));\\n _owner = address(0);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n emit OwnershipTransferred(_owner, newOwner);\\n _owner = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0x15e2d5bd4c28a88548074c54d220e8086f638a71ed07e6b3ba5a70066fcf458d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/math/SafeMath.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Wrappers over Solidity's arithmetic operations with added overflow\\n * checks.\\n *\\n * Arithmetic operations in Solidity wrap on overflow. This can easily result\\n * in bugs, because programmers usually assume that an overflow raises an\\n * error, which is the standard behavior in high level programming languages.\\n * `SafeMath` restores this intuition by reverting the transaction when an\\n * operation overflows.\\n *\\n * Using this library instead of the unchecked operations eliminates an entire\\n * class of bugs, so it's recommended to use it always.\\n */\\nlibrary SafeMath {\\n /**\\n * @dev Returns the addition of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n uint256 c = a + b;\\n if (c < a) return (false, 0);\\n return (true, c);\\n }\\n\\n /**\\n * @dev Returns the substraction of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b > a) return (false, 0);\\n return (true, a - b);\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\\n if (a == 0) return (true, 0);\\n uint256 c = a * b;\\n if (c / a != b) return (false, 0);\\n return (true, c);\\n }\\n\\n /**\\n * @dev Returns the division of two unsigned integers, with a division by zero flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b == 0) return (false, 0);\\n return (true, a / b);\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b == 0) return (false, 0);\\n return (true, a % b);\\n }\\n\\n /**\\n * @dev Returns the addition of two unsigned integers, reverting on\\n * overflow.\\n *\\n * Counterpart to Solidity's `+` operator.\\n *\\n * Requirements:\\n *\\n * - Addition cannot overflow.\\n */\\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\\n uint256 c = a + b;\\n require(c >= a, \\\"SafeMath: addition overflow\\\");\\n return c;\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting on\\n * overflow (when the result is negative).\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n *\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b <= a, \\\"SafeMath: subtraction overflow\\\");\\n return a - b;\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, reverting on\\n * overflow.\\n *\\n * Counterpart to Solidity's `*` operator.\\n *\\n * Requirements:\\n *\\n * - Multiplication cannot overflow.\\n */\\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\\n if (a == 0) return 0;\\n uint256 c = a * b;\\n require(c / a == b, \\\"SafeMath: multiplication overflow\\\");\\n return c;\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers, reverting on\\n * division by zero. The result is rounded towards zero.\\n *\\n * Counterpart to Solidity's `/` operator. Note: this function uses a\\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\\n * uses an invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b > 0, \\\"SafeMath: division by zero\\\");\\n return a / b;\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * reverting when dividing by zero.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b > 0, \\\"SafeMath: modulo by zero\\\");\\n return a % b;\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\\n * overflow (when the result is negative).\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {trySub}.\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n *\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b <= a, errorMessage);\\n return a - b;\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers, reverting with custom message on\\n * division by zero. The result is rounded towards zero.\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {tryDiv}.\\n *\\n * Counterpart to Solidity's `/` operator. Note: this function uses a\\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\\n * uses an invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b > 0, errorMessage);\\n return a / b;\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * reverting with custom message when dividing by zero.\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {tryMod}.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b > 0, errorMessage);\\n return a % b;\\n }\\n}\\n\",\"keccak256\":\"0xcc78a17dd88fa5a2edc60c8489e2f405c0913b377216a5b26b35656b2d0dab52\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `recipient`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address recipient, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `sender` to `recipient` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n}\\n\",\"keccak256\":\"0x5f02220344881ce43204ae4a6281145a67bc52c2bb1290a791857df3d19d78f5\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\nimport \\\"./IERC20.sol\\\";\\nimport \\\"../../math/SafeMath.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @title SafeERC20\\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\\n * contract returns false). Tokens that return no value (and instead revert or\\n * throw on failure) are also supported, non-reverting calls are assumed to be\\n * successful.\\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\n */\\nlibrary SafeERC20 {\\n using SafeMath for uint256;\\n using Address for address;\\n\\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\\n }\\n\\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\\n }\\n\\n /**\\n * @dev Deprecated. This function has issues similar to the ones found in\\n * {IERC20-approve}, and its usage is discouraged.\\n *\\n * Whenever possible, use {safeIncreaseAllowance} and\\n * {safeDecreaseAllowance} instead.\\n */\\n function safeApprove(IERC20 token, address spender, uint256 value) internal {\\n // safeApprove should only be called when setting an initial allowance,\\n // or when resetting it to zero. To increase and decrease it, use\\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\\n // solhint-disable-next-line max-line-length\\n require((value == 0) || (token.allowance(address(this), spender) == 0),\\n \\\"SafeERC20: approve from non-zero to non-zero allowance\\\"\\n );\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\\n }\\n\\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n uint256 newAllowance = token.allowance(address(this), spender).add(value);\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n uint256 newAllowance = token.allowance(address(this), spender).sub(value, \\\"SafeERC20: decreased allowance below zero\\\");\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n */\\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that\\n // the target address contains contract code and also asserts for success in the low-level call.\\n\\n bytes memory returndata = address(token).functionCall(data, \\\"SafeERC20: low-level call failed\\\");\\n if (returndata.length > 0) { // Return data is optional\\n // solhint-disable-next-line max-line-length\\n require(abi.decode(returndata, (bool)), \\\"SafeERC20: ERC20 operation did not succeed\\\");\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf12dfbe97e6276980b83d2830bb0eb75e0cf4f3e626c2471137f82158ae6a0fc\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.2 <0.8.0;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize, which returns 0 for contracts in\\n // construction, since the code is only stored at the end of the\\n // constructor execution.\\n\\n uint256 size;\\n // solhint-disable-next-line no-inline-assembly\\n assembly { size := extcodesize(account) }\\n return size > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls, avoid-call-value\\n (bool success, ) = recipient.call{ value: amount }(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain`call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.call{ value: value }(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x28911e614500ae7c607a432a709d35da25f3bc5ddc8bd12b278b66358070c0ea\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/*\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with GSN meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address payable) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes memory) {\\n this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0x8d3cb350f04ff49cfb10aef08d87f19dcbaecc8027b0bed12f3275cd12f38cf0\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Create2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Helper to make usage of the `CREATE2` EVM opcode easier and safer.\\n * `CREATE2` can be used to compute in advance the address where a smart\\n * contract will be deployed, which allows for interesting new mechanisms known\\n * as 'counterfactual interactions'.\\n *\\n * See the https://eips.ethereum.org/EIPS/eip-1014#motivation[EIP] for more\\n * information.\\n */\\nlibrary Create2 {\\n /**\\n * @dev Deploys a contract using `CREATE2`. The address where the contract\\n * will be deployed can be known in advance via {computeAddress}.\\n *\\n * The bytecode for a contract can be obtained from Solidity with\\n * `type(contractName).creationCode`.\\n *\\n * Requirements:\\n *\\n * - `bytecode` must not be empty.\\n * - `salt` must have not been used for `bytecode` already.\\n * - the factory must have a balance of at least `amount`.\\n * - if `amount` is non-zero, `bytecode` must have a `payable` constructor.\\n */\\n function deploy(uint256 amount, bytes32 salt, bytes memory bytecode) internal returns (address) {\\n address addr;\\n require(address(this).balance >= amount, \\\"Create2: insufficient balance\\\");\\n require(bytecode.length != 0, \\\"Create2: bytecode length is zero\\\");\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n addr := create2(amount, add(bytecode, 0x20), mload(bytecode), salt)\\n }\\n require(addr != address(0), \\\"Create2: Failed on deploy\\\");\\n return addr;\\n }\\n\\n /**\\n * @dev Returns the address where a contract will be stored if deployed via {deploy}. Any change in the\\n * `bytecodeHash` or `salt` will result in a new destination address.\\n */\\n function computeAddress(bytes32 salt, bytes32 bytecodeHash) internal view returns (address) {\\n return computeAddress(salt, bytecodeHash, address(this));\\n }\\n\\n /**\\n * @dev Returns the address where a contract will be stored if deployed via {deploy} from a contract located at\\n * `deployer`. If `deployer` is this contract's address, returns the same value as {computeAddress}.\\n */\\n function computeAddress(bytes32 salt, bytes32 bytecodeHash, address deployer) internal pure returns (address) {\\n bytes32 _data = keccak256(\\n abi.encodePacked(bytes1(0xff), deployer, salt, bytecodeHash)\\n );\\n return address(uint160(uint256(_data)));\\n }\\n}\\n\",\"keccak256\":\"0x0a0b021149946014fe1cd04af11e7a937a29986c47e8b1b718c2d50d729472db\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/EnumerableSet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Library for managing\\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\\n * types.\\n *\\n * Sets have the following properties:\\n *\\n * - Elements are added, removed, and checked for existence in constant time\\n * (O(1)).\\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\\n *\\n * ```\\n * contract Example {\\n * // Add the library methods\\n * using EnumerableSet for EnumerableSet.AddressSet;\\n *\\n * // Declare a set state variable\\n * EnumerableSet.AddressSet private mySet;\\n * }\\n * ```\\n *\\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\\n * and `uint256` (`UintSet`) are supported.\\n */\\nlibrary EnumerableSet {\\n // To implement this library for multiple types with as little code\\n // repetition as possible, we write it in terms of a generic Set type with\\n // bytes32 values.\\n // The Set implementation uses private functions, and user-facing\\n // implementations (such as AddressSet) are just wrappers around the\\n // underlying Set.\\n // This means that we can only create new EnumerableSets for types that fit\\n // in bytes32.\\n\\n struct Set {\\n // Storage of set values\\n bytes32[] _values;\\n\\n // Position of the value in the `values` array, plus 1 because index 0\\n // means a value is not in the set.\\n mapping (bytes32 => uint256) _indexes;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function _add(Set storage set, bytes32 value) private returns (bool) {\\n if (!_contains(set, value)) {\\n set._values.push(value);\\n // The value is stored at length-1, but we add 1 to all indexes\\n // and use 0 as a sentinel value\\n set._indexes[value] = set._values.length;\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function _remove(Set storage set, bytes32 value) private returns (bool) {\\n // We read and store the value's index to prevent multiple reads from the same storage slot\\n uint256 valueIndex = set._indexes[value];\\n\\n if (valueIndex != 0) { // Equivalent to contains(set, value)\\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\\n // the array, and then remove the last element (sometimes called as 'swap and pop').\\n // This modifies the order of the array, as noted in {at}.\\n\\n uint256 toDeleteIndex = valueIndex - 1;\\n uint256 lastIndex = set._values.length - 1;\\n\\n // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs\\n // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.\\n\\n bytes32 lastvalue = set._values[lastIndex];\\n\\n // Move the last value to the index where the value to delete is\\n set._values[toDeleteIndex] = lastvalue;\\n // Update the index for the moved value\\n set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based\\n\\n // Delete the slot where the moved value was stored\\n set._values.pop();\\n\\n // Delete the index for the deleted slot\\n delete set._indexes[value];\\n\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\\n return set._indexes[value] != 0;\\n }\\n\\n /**\\n * @dev Returns the number of values on the set. O(1).\\n */\\n function _length(Set storage set) private view returns (uint256) {\\n return set._values.length;\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\\n require(set._values.length > index, \\\"EnumerableSet: index out of bounds\\\");\\n return set._values[index];\\n }\\n\\n // Bytes32Set\\n\\n struct Bytes32Set {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _add(set._inner, value);\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _remove(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\\n return _contains(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(Bytes32Set storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\\n return _at(set._inner, index);\\n }\\n\\n // AddressSet\\n\\n struct AddressSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(AddressSet storage set, address value) internal returns (bool) {\\n return _add(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(AddressSet storage set, address value) internal returns (bool) {\\n return _remove(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(AddressSet storage set, address value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(AddressSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\\n return address(uint160(uint256(_at(set._inner, index))));\\n }\\n\\n\\n // UintSet\\n\\n struct UintSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(UintSet storage set, uint256 value) internal returns (bool) {\\n return _add(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\\n return _remove(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns the number of values on the set. O(1).\\n */\\n function length(UintSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\\n return uint256(_at(set._inner, index));\\n }\\n}\\n\",\"keccak256\":\"0x1562cd9922fbf739edfb979f506809e2743789cbde3177515542161c3d04b164\",\"license\":\"MIT\"},\"contracts/GraphTokenLock.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nimport \\\"@openzeppelin/contracts/math/SafeMath.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\\\";\\n\\nimport { Ownable as OwnableInitializable } from \\\"./Ownable.sol\\\";\\nimport \\\"./MathUtils.sol\\\";\\nimport \\\"./IGraphTokenLock.sol\\\";\\n\\n/**\\n * @title GraphTokenLock\\n * @notice Contract that manages an unlocking schedule of tokens.\\n * @dev The contract lock manage a number of tokens deposited into the contract to ensure that\\n * they can only be released under certain time conditions.\\n *\\n * This contract implements a release scheduled based on periods and tokens are released in steps\\n * after each period ends. It can be configured with one period in which case it is like a plain TimeLock.\\n * It also supports revocation to be used for vesting schedules.\\n *\\n * The contract supports receiving extra funds than the managed tokens ones that can be\\n * withdrawn by the beneficiary at any time.\\n *\\n * A releaseStartTime parameter is included to override the default release schedule and\\n * perform the first release on the configured time. After that it will continue with the\\n * default schedule.\\n */\\nabstract contract GraphTokenLock is OwnableInitializable, IGraphTokenLock {\\n using SafeMath for uint256;\\n using SafeERC20 for IERC20;\\n\\n uint256 private constant MIN_PERIOD = 1;\\n\\n // -- State --\\n\\n IERC20 public token;\\n address public beneficiary;\\n\\n // Configuration\\n\\n // Amount of tokens managed by the contract schedule\\n uint256 public managedAmount;\\n\\n uint256 public startTime; // Start datetime (in unixtimestamp)\\n uint256 public endTime; // Datetime after all funds are fully vested/unlocked (in unixtimestamp)\\n uint256 public periods; // Number of vesting/release periods\\n\\n // First release date for tokens (in unixtimestamp)\\n // If set, no tokens will be released before releaseStartTime ignoring\\n // the amount to release each period\\n uint256 public releaseStartTime;\\n // A cliff set a date to which a beneficiary needs to get to vest\\n // all preceding periods\\n uint256 public vestingCliffTime;\\n Revocability public revocable; // Whether to use vesting for locked funds\\n\\n // State\\n\\n bool public isRevoked;\\n bool public isInitialized;\\n bool public isAccepted;\\n uint256 public releasedAmount;\\n uint256 public revokedAmount;\\n\\n // -- Events --\\n\\n event TokensReleased(address indexed beneficiary, uint256 amount);\\n event TokensWithdrawn(address indexed beneficiary, uint256 amount);\\n event TokensRevoked(address indexed beneficiary, uint256 amount);\\n event BeneficiaryChanged(address newBeneficiary);\\n event LockAccepted();\\n event LockCanceled();\\n\\n /**\\n * @dev Only allow calls from the beneficiary of the contract\\n */\\n modifier onlyBeneficiary() {\\n require(msg.sender == beneficiary, \\\"!auth\\\");\\n _;\\n }\\n\\n /**\\n * @notice Initializes the contract\\n * @param _owner Address of the contract owner\\n * @param _beneficiary Address of the beneficiary of locked tokens\\n * @param _managedAmount Amount of tokens to be managed by the lock contract\\n * @param _startTime Start time of the release schedule\\n * @param _endTime End time of the release schedule\\n * @param _periods Number of periods between start time and end time\\n * @param _releaseStartTime Override time for when the releases start\\n * @param _vestingCliffTime Override time for when the vesting start\\n * @param _revocable Whether the contract is revocable\\n */\\n function _initialize(\\n address _owner,\\n address _beneficiary,\\n address _token,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n Revocability _revocable\\n ) internal {\\n require(!isInitialized, \\\"Already initialized\\\");\\n require(_owner != address(0), \\\"Owner cannot be zero\\\");\\n require(_beneficiary != address(0), \\\"Beneficiary cannot be zero\\\");\\n require(_token != address(0), \\\"Token cannot be zero\\\");\\n require(_managedAmount > 0, \\\"Managed tokens cannot be zero\\\");\\n require(_startTime != 0, \\\"Start time must be set\\\");\\n require(_startTime < _endTime, \\\"Start time > end time\\\");\\n require(_periods >= MIN_PERIOD, \\\"Periods cannot be below minimum\\\");\\n require(_revocable != Revocability.NotSet, \\\"Must set a revocability option\\\");\\n require(_releaseStartTime < _endTime, \\\"Release start time must be before end time\\\");\\n require(_vestingCliffTime < _endTime, \\\"Cliff time must be before end time\\\");\\n\\n isInitialized = true;\\n\\n OwnableInitializable._initialize(_owner);\\n beneficiary = _beneficiary;\\n token = IERC20(_token);\\n\\n managedAmount = _managedAmount;\\n\\n startTime = _startTime;\\n endTime = _endTime;\\n periods = _periods;\\n\\n // Optionals\\n releaseStartTime = _releaseStartTime;\\n vestingCliffTime = _vestingCliffTime;\\n revocable = _revocable;\\n }\\n\\n /**\\n * @notice Change the beneficiary of funds managed by the contract\\n * @dev Can only be called by the beneficiary\\n * @param _newBeneficiary Address of the new beneficiary address\\n */\\n function changeBeneficiary(address _newBeneficiary) external onlyBeneficiary {\\n require(_newBeneficiary != address(0), \\\"Empty beneficiary\\\");\\n beneficiary = _newBeneficiary;\\n emit BeneficiaryChanged(_newBeneficiary);\\n }\\n\\n /**\\n * @notice Beneficiary accepts the lock, the owner cannot retrieve back the tokens\\n * @dev Can only be called by the beneficiary\\n */\\n function acceptLock() external onlyBeneficiary {\\n isAccepted = true;\\n emit LockAccepted();\\n }\\n\\n /**\\n * @notice Owner cancel the lock and return the balance in the contract\\n * @dev Can only be called by the owner\\n */\\n function cancelLock() external onlyOwner {\\n require(isAccepted == false, \\\"Cannot cancel accepted contract\\\");\\n\\n token.safeTransfer(owner(), currentBalance());\\n\\n emit LockCanceled();\\n }\\n\\n // -- Balances --\\n\\n /**\\n * @notice Returns the amount of tokens currently held by the contract\\n * @return Tokens held in the contract\\n */\\n function currentBalance() public view override returns (uint256) {\\n return token.balanceOf(address(this));\\n }\\n\\n // -- Time & Periods --\\n\\n /**\\n * @notice Returns the current block timestamp\\n * @return Current block timestamp\\n */\\n function currentTime() public view override returns (uint256) {\\n return block.timestamp;\\n }\\n\\n /**\\n * @notice Gets duration of contract from start to end in seconds\\n * @return Amount of seconds from contract startTime to endTime\\n */\\n function duration() public view override returns (uint256) {\\n return endTime.sub(startTime);\\n }\\n\\n /**\\n * @notice Gets time elapsed since the start of the contract\\n * @dev Returns zero if called before conctract starTime\\n * @return Seconds elapsed from contract startTime\\n */\\n function sinceStartTime() public view override returns (uint256) {\\n uint256 current = currentTime();\\n if (current <= startTime) {\\n return 0;\\n }\\n return current.sub(startTime);\\n }\\n\\n /**\\n * @notice Returns amount available to be released after each period according to schedule\\n * @return Amount of tokens available after each period\\n */\\n function amountPerPeriod() public view override returns (uint256) {\\n return managedAmount.div(periods);\\n }\\n\\n /**\\n * @notice Returns the duration of each period in seconds\\n * @return Duration of each period in seconds\\n */\\n function periodDuration() public view override returns (uint256) {\\n return duration().div(periods);\\n }\\n\\n /**\\n * @notice Gets the current period based on the schedule\\n * @return A number that represents the current period\\n */\\n function currentPeriod() public view override returns (uint256) {\\n return sinceStartTime().div(periodDuration()).add(MIN_PERIOD);\\n }\\n\\n /**\\n * @notice Gets the number of periods that passed since the first period\\n * @return A number of periods that passed since the schedule started\\n */\\n function passedPeriods() public view override returns (uint256) {\\n return currentPeriod().sub(MIN_PERIOD);\\n }\\n\\n // -- Locking & Release Schedule --\\n\\n /**\\n * @notice Gets the currently available token according to the schedule\\n * @dev Implements the step-by-step schedule based on periods for available tokens\\n * @return Amount of tokens available according to the schedule\\n */\\n function availableAmount() public view override returns (uint256) {\\n uint256 current = currentTime();\\n\\n // Before contract start no funds are available\\n if (current < startTime) {\\n return 0;\\n }\\n\\n // After contract ended all funds are available\\n if (current > endTime) {\\n return managedAmount;\\n }\\n\\n // Get available amount based on period\\n return passedPeriods().mul(amountPerPeriod());\\n }\\n\\n /**\\n * @notice Gets the amount of currently vested tokens\\n * @dev Similar to available amount, but is fully vested when contract is non-revocable\\n * @return Amount of tokens already vested\\n */\\n function vestedAmount() public view override returns (uint256) {\\n // If non-revocable it is fully vested\\n if (revocable == Revocability.Disabled) {\\n return managedAmount;\\n }\\n\\n // Vesting cliff is activated and it has not passed means nothing is vested yet\\n if (vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\\n return 0;\\n }\\n\\n return availableAmount();\\n }\\n\\n /**\\n * @notice Gets tokens currently available for release\\n * @dev Considers the schedule and takes into account already released tokens\\n * @return Amount of tokens ready to be released\\n */\\n function releasableAmount() public view virtual override returns (uint256) {\\n // If a release start time is set no tokens are available for release before this date\\n // If not set it follows the default schedule and tokens are available on\\n // the first period passed\\n if (releaseStartTime > 0 && currentTime() < releaseStartTime) {\\n return 0;\\n }\\n\\n // Vesting cliff is activated and it has not passed means nothing is vested yet\\n // so funds cannot be released\\n if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\\n return 0;\\n }\\n\\n // A beneficiary can never have more releasable tokens than the contract balance\\n uint256 releasable = availableAmount().sub(releasedAmount);\\n return MathUtils.min(currentBalance(), releasable);\\n }\\n\\n /**\\n * @notice Gets the outstanding amount yet to be released based on the whole contract lifetime\\n * @dev Does not consider schedule but just global amounts tracked\\n * @return Amount of outstanding tokens for the lifetime of the contract\\n */\\n function totalOutstandingAmount() public view override returns (uint256) {\\n return managedAmount.sub(releasedAmount).sub(revokedAmount);\\n }\\n\\n /**\\n * @notice Gets surplus amount in the contract based on outstanding amount to release\\n * @dev All funds over outstanding amount is considered surplus that can be withdrawn by beneficiary.\\n * Note this might not be the correct value for wallets transferred to L2 (i.e. an L2GraphTokenLockWallet), as the released amount will be\\n * skewed, so the beneficiary might have to bridge back to L1 to release the surplus.\\n * @return Amount of tokens considered as surplus\\n */\\n function surplusAmount() public view override returns (uint256) {\\n uint256 balance = currentBalance();\\n uint256 outstandingAmount = totalOutstandingAmount();\\n if (balance > outstandingAmount) {\\n return balance.sub(outstandingAmount);\\n }\\n return 0;\\n }\\n\\n // -- Value Transfer --\\n\\n /**\\n * @notice Releases tokens based on the configured schedule\\n * @dev All available releasable tokens are transferred to beneficiary\\n */\\n function release() external override onlyBeneficiary {\\n uint256 amountToRelease = releasableAmount();\\n require(amountToRelease > 0, \\\"No available releasable amount\\\");\\n\\n releasedAmount = releasedAmount.add(amountToRelease);\\n\\n token.safeTransfer(beneficiary, amountToRelease);\\n\\n emit TokensReleased(beneficiary, amountToRelease);\\n }\\n\\n /**\\n * @notice Withdraws surplus, unmanaged tokens from the contract\\n * @dev Tokens in the contract over outstanding amount are considered as surplus\\n * @param _amount Amount of tokens to withdraw\\n */\\n function withdrawSurplus(uint256 _amount) external override onlyBeneficiary {\\n require(_amount > 0, \\\"Amount cannot be zero\\\");\\n require(surplusAmount() >= _amount, \\\"Amount requested > surplus available\\\");\\n\\n token.safeTransfer(beneficiary, _amount);\\n\\n emit TokensWithdrawn(beneficiary, _amount);\\n }\\n\\n /**\\n * @notice Revokes a vesting schedule and return the unvested tokens to the owner\\n * @dev Vesting schedule is always calculated based on managed tokens\\n */\\n function revoke() external override onlyOwner {\\n require(revocable == Revocability.Enabled, \\\"Contract is non-revocable\\\");\\n require(isRevoked == false, \\\"Already revoked\\\");\\n\\n uint256 unvestedAmount = managedAmount.sub(vestedAmount());\\n require(unvestedAmount > 0, \\\"No available unvested amount\\\");\\n\\n revokedAmount = unvestedAmount;\\n isRevoked = true;\\n\\n token.safeTransfer(owner(), unvestedAmount);\\n\\n emit TokensRevoked(beneficiary, unvestedAmount);\\n }\\n}\\n\",\"keccak256\":\"0xd89470956a476c2fcf4a09625775573f95ba2c60a57fe866d90f65de1bcf5f2d\",\"license\":\"MIT\"},\"contracts/GraphTokenLockManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/EnumerableSet.sol\\\";\\nimport { Ownable } from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\n\\nimport \\\"./MinimalProxyFactory.sol\\\";\\nimport \\\"./IGraphTokenLockManager.sol\\\";\\nimport { GraphTokenLockWallet } from \\\"./GraphTokenLockWallet.sol\\\";\\n\\n/**\\n * @title GraphTokenLockManager\\n * @notice This contract manages a list of authorized function calls and targets that can be called\\n * by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts.\\n *\\n * This contract receives funds to make the process of creating TokenLockWallet contracts\\n * easier by distributing them the initial tokens to be managed.\\n *\\n * The owner can setup a list of token destinations that will be used by TokenLock contracts to\\n * approve the pulling of funds, this way in can be guaranteed that only protocol contracts\\n * will manipulate users funds.\\n */\\ncontract GraphTokenLockManager is Ownable, MinimalProxyFactory, IGraphTokenLockManager {\\n using SafeERC20 for IERC20;\\n using EnumerableSet for EnumerableSet.AddressSet;\\n\\n // -- State --\\n\\n mapping(bytes4 => address) public authFnCalls;\\n EnumerableSet.AddressSet private _tokenDestinations;\\n\\n address public masterCopy;\\n IERC20 internal _token;\\n\\n // -- Events --\\n\\n event MasterCopyUpdated(address indexed masterCopy);\\n event TokenLockCreated(\\n address indexed contractAddress,\\n bytes32 indexed initHash,\\n address indexed beneficiary,\\n address token,\\n uint256 managedAmount,\\n uint256 startTime,\\n uint256 endTime,\\n uint256 periods,\\n uint256 releaseStartTime,\\n uint256 vestingCliffTime,\\n IGraphTokenLock.Revocability revocable\\n );\\n\\n event TokensDeposited(address indexed sender, uint256 amount);\\n event TokensWithdrawn(address indexed sender, uint256 amount);\\n\\n event FunctionCallAuth(address indexed caller, bytes4 indexed sigHash, address indexed target, string signature);\\n event TokenDestinationAllowed(address indexed dst, bool allowed);\\n\\n /**\\n * Constructor.\\n * @param _graphToken Token to use for deposits and withdrawals\\n * @param _masterCopy Address of the master copy to use to clone proxies\\n */\\n constructor(IERC20 _graphToken, address _masterCopy) {\\n require(address(_graphToken) != address(0), \\\"Token cannot be zero\\\");\\n _token = _graphToken;\\n setMasterCopy(_masterCopy);\\n }\\n\\n // -- Factory --\\n\\n /**\\n * @notice Sets the masterCopy bytecode to use to create clones of TokenLock contracts\\n * @param _masterCopy Address of contract bytecode to factory clone\\n */\\n function setMasterCopy(address _masterCopy) public override onlyOwner {\\n require(_masterCopy != address(0), \\\"MasterCopy cannot be zero\\\");\\n masterCopy = _masterCopy;\\n emit MasterCopyUpdated(_masterCopy);\\n }\\n\\n /**\\n * @notice Creates and fund a new token lock wallet using a minimum proxy\\n * @param _owner Address of the contract owner\\n * @param _beneficiary Address of the beneficiary of locked tokens\\n * @param _managedAmount Amount of tokens to be managed by the lock contract\\n * @param _startTime Start time of the release schedule\\n * @param _endTime End time of the release schedule\\n * @param _periods Number of periods between start time and end time\\n * @param _releaseStartTime Override time for when the releases start\\n * @param _revocable Whether the contract is revocable\\n */\\n function createTokenLockWallet(\\n address _owner,\\n address _beneficiary,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n IGraphTokenLock.Revocability _revocable\\n ) external override onlyOwner {\\n require(_token.balanceOf(address(this)) >= _managedAmount, \\\"Not enough tokens to create lock\\\");\\n\\n // Create contract using a minimal proxy and call initializer\\n bytes memory initializer = abi.encodeWithSelector(\\n GraphTokenLockWallet.initialize.selector,\\n address(this),\\n _owner,\\n _beneficiary,\\n address(_token),\\n _managedAmount,\\n _startTime,\\n _endTime,\\n _periods,\\n _releaseStartTime,\\n _vestingCliffTime,\\n _revocable\\n );\\n address contractAddress = _deployProxy2(keccak256(initializer), masterCopy, initializer);\\n\\n // Send managed amount to the created contract\\n _token.safeTransfer(contractAddress, _managedAmount);\\n\\n emit TokenLockCreated(\\n contractAddress,\\n keccak256(initializer),\\n _beneficiary,\\n address(_token),\\n _managedAmount,\\n _startTime,\\n _endTime,\\n _periods,\\n _releaseStartTime,\\n _vestingCliffTime,\\n _revocable\\n );\\n }\\n\\n // -- Funds Management --\\n\\n /**\\n * @notice Gets the GRT token address\\n * @return Token used for transfers and approvals\\n */\\n function token() external view override returns (IERC20) {\\n return _token;\\n }\\n\\n /**\\n * @notice Deposits tokens into the contract\\n * @dev Even if the ERC20 token can be transferred directly to the contract\\n * this function provide a safe interface to do the transfer and avoid mistakes\\n * @param _amount Amount to deposit\\n */\\n function deposit(uint256 _amount) external override {\\n require(_amount > 0, \\\"Amount cannot be zero\\\");\\n _token.safeTransferFrom(msg.sender, address(this), _amount);\\n emit TokensDeposited(msg.sender, _amount);\\n }\\n\\n /**\\n * @notice Withdraws tokens from the contract\\n * @dev Escape hatch in case of mistakes or to recover remaining funds\\n * @param _amount Amount of tokens to withdraw\\n */\\n function withdraw(uint256 _amount) external override onlyOwner {\\n require(_amount > 0, \\\"Amount cannot be zero\\\");\\n _token.safeTransfer(msg.sender, _amount);\\n emit TokensWithdrawn(msg.sender, _amount);\\n }\\n\\n // -- Token Destinations --\\n\\n /**\\n * @notice Adds an address that can be allowed by a token lock to pull funds\\n * @param _dst Destination address\\n */\\n function addTokenDestination(address _dst) external override onlyOwner {\\n require(_dst != address(0), \\\"Destination cannot be zero\\\");\\n require(_tokenDestinations.add(_dst), \\\"Destination already added\\\");\\n emit TokenDestinationAllowed(_dst, true);\\n }\\n\\n /**\\n * @notice Removes an address that can be allowed by a token lock to pull funds\\n * @param _dst Destination address\\n */\\n function removeTokenDestination(address _dst) external override onlyOwner {\\n require(_tokenDestinations.remove(_dst), \\\"Destination already removed\\\");\\n emit TokenDestinationAllowed(_dst, false);\\n }\\n\\n /**\\n * @notice Returns True if the address is authorized to be a destination of tokens\\n * @param _dst Destination address\\n * @return True if authorized\\n */\\n function isTokenDestination(address _dst) external view override returns (bool) {\\n return _tokenDestinations.contains(_dst);\\n }\\n\\n /**\\n * @notice Returns an array of authorized destination addresses\\n * @return Array of addresses authorized to pull funds from a token lock\\n */\\n function getTokenDestinations() external view override returns (address[] memory) {\\n address[] memory dstList = new address[](_tokenDestinations.length());\\n for (uint256 i = 0; i < _tokenDestinations.length(); i++) {\\n dstList[i] = _tokenDestinations.at(i);\\n }\\n return dstList;\\n }\\n\\n // -- Function Call Authorization --\\n\\n /**\\n * @notice Sets an authorized function call to target\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @param _signature Function signature\\n * @param _target Address of the destination contract to call\\n */\\n function setAuthFunctionCall(string calldata _signature, address _target) external override onlyOwner {\\n _setAuthFunctionCall(_signature, _target);\\n }\\n\\n /**\\n * @notice Unsets an authorized function call to target\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @param _signature Function signature\\n */\\n function unsetAuthFunctionCall(string calldata _signature) external override onlyOwner {\\n bytes4 sigHash = _toFunctionSigHash(_signature);\\n authFnCalls[sigHash] = address(0);\\n\\n emit FunctionCallAuth(msg.sender, sigHash, address(0), _signature);\\n }\\n\\n /**\\n * @notice Sets an authorized function call to target in bulk\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @param _signatures Function signatures\\n * @param _targets Address of the destination contract to call\\n */\\n function setAuthFunctionCallMany(\\n string[] calldata _signatures,\\n address[] calldata _targets\\n ) external override onlyOwner {\\n require(_signatures.length == _targets.length, \\\"Array length mismatch\\\");\\n\\n for (uint256 i = 0; i < _signatures.length; i++) {\\n _setAuthFunctionCall(_signatures[i], _targets[i]);\\n }\\n }\\n\\n /**\\n * @notice Sets an authorized function call to target\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @dev Function signatures of Graph Protocol contracts to be used are known ahead of time\\n * @param _signature Function signature\\n * @param _target Address of the destination contract to call\\n */\\n function _setAuthFunctionCall(string calldata _signature, address _target) internal {\\n require(_target != address(this), \\\"Target must be other contract\\\");\\n require(Address.isContract(_target), \\\"Target must be a contract\\\");\\n\\n bytes4 sigHash = _toFunctionSigHash(_signature);\\n authFnCalls[sigHash] = _target;\\n\\n emit FunctionCallAuth(msg.sender, sigHash, _target, _signature);\\n }\\n\\n /**\\n * @notice Gets the target contract to call for a particular function signature\\n * @param _sigHash Function signature hash\\n * @return Address of the target contract where to send the call\\n */\\n function getAuthFunctionCallTarget(bytes4 _sigHash) public view override returns (address) {\\n return authFnCalls[_sigHash];\\n }\\n\\n /**\\n * @notice Returns true if the function call is authorized\\n * @param _sigHash Function signature hash\\n * @return True if authorized\\n */\\n function isAuthFunctionCall(bytes4 _sigHash) external view override returns (bool) {\\n return getAuthFunctionCallTarget(_sigHash) != address(0);\\n }\\n\\n /**\\n * @dev Converts a function signature string to 4-bytes hash\\n * @param _signature Function signature string\\n * @return Function signature hash\\n */\\n function _toFunctionSigHash(string calldata _signature) internal pure returns (bytes4) {\\n return _convertToBytes4(abi.encodeWithSignature(_signature));\\n }\\n\\n /**\\n * @dev Converts function signature bytes to function signature hash (bytes4)\\n * @param _signature Function signature\\n * @return Function signature in bytes4\\n */\\n function _convertToBytes4(bytes memory _signature) internal pure returns (bytes4) {\\n require(_signature.length == 4, \\\"Invalid method signature\\\");\\n bytes4 sigHash;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n sigHash := mload(add(_signature, 32))\\n }\\n return sigHash;\\n }\\n}\\n\",\"keccak256\":\"0x2bb51cc1a18bd88113fd6947067ad2fff33048c8904cb54adfda8e2ab86752f2\",\"license\":\"MIT\"},\"contracts/GraphTokenLockWallet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"@openzeppelin/contracts/math/SafeMath.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nimport \\\"./GraphTokenLock.sol\\\";\\nimport \\\"./IGraphTokenLockManager.sol\\\";\\n\\n/**\\n * @title GraphTokenLockWallet\\n * @notice This contract is built on top of the base GraphTokenLock functionality.\\n * It allows wallet beneficiaries to use the deposited funds to perform specific function calls\\n * on specific contracts.\\n *\\n * The idea is that supporters with locked tokens can participate in the protocol\\n * but disallow any release before the vesting/lock schedule.\\n * The beneficiary can issue authorized function calls to this contract that will\\n * get forwarded to a target contract. A target contract is any of our protocol contracts.\\n * The function calls allowed are queried to the GraphTokenLockManager, this way\\n * the same configuration can be shared for all the created lock wallet contracts.\\n *\\n * NOTE: Contracts used as target must have its function signatures checked to avoid collisions\\n * with any of this contract functions.\\n * Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience\\n * the maximum amount of tokens is authorized.\\n * Function calls do not forward ETH value so DO NOT SEND ETH TO THIS CONTRACT.\\n */\\ncontract GraphTokenLockWallet is GraphTokenLock {\\n using SafeMath for uint256;\\n\\n // -- State --\\n\\n IGraphTokenLockManager public manager;\\n uint256 public usedAmount;\\n\\n // -- Events --\\n\\n event ManagerUpdated(address indexed _oldManager, address indexed _newManager);\\n event TokenDestinationsApproved();\\n event TokenDestinationsRevoked();\\n\\n // Initializer\\n function initialize(\\n address _manager,\\n address _owner,\\n address _beneficiary,\\n address _token,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n Revocability _revocable\\n ) external {\\n _initialize(\\n _owner,\\n _beneficiary,\\n _token,\\n _managedAmount,\\n _startTime,\\n _endTime,\\n _periods,\\n _releaseStartTime,\\n _vestingCliffTime,\\n _revocable\\n );\\n _setManager(_manager);\\n }\\n\\n // -- Admin --\\n\\n /**\\n * @notice Sets a new manager for this contract\\n * @param _newManager Address of the new manager\\n */\\n function setManager(address _newManager) external onlyOwner {\\n _setManager(_newManager);\\n }\\n\\n /**\\n * @dev Sets a new manager for this contract\\n * @param _newManager Address of the new manager\\n */\\n function _setManager(address _newManager) internal {\\n require(_newManager != address(0), \\\"Manager cannot be empty\\\");\\n require(Address.isContract(_newManager), \\\"Manager must be a contract\\\");\\n\\n address oldManager = address(manager);\\n manager = IGraphTokenLockManager(_newManager);\\n\\n emit ManagerUpdated(oldManager, _newManager);\\n }\\n\\n // -- Beneficiary --\\n\\n /**\\n * @notice Approves protocol access of the tokens managed by this contract\\n * @dev Approves all token destinations registered in the manager to pull tokens\\n */\\n function approveProtocol() external onlyBeneficiary {\\n address[] memory dstList = manager.getTokenDestinations();\\n for (uint256 i = 0; i < dstList.length; i++) {\\n // Note this is only safe because we are using the max uint256 value\\n token.approve(dstList[i], type(uint256).max);\\n }\\n emit TokenDestinationsApproved();\\n }\\n\\n /**\\n * @notice Revokes protocol access of the tokens managed by this contract\\n * @dev Revokes approval to all token destinations in the manager to pull tokens\\n */\\n function revokeProtocol() external onlyBeneficiary {\\n address[] memory dstList = manager.getTokenDestinations();\\n for (uint256 i = 0; i < dstList.length; i++) {\\n // Note this is only safe cause we're using 0 as the amount\\n token.approve(dstList[i], 0);\\n }\\n emit TokenDestinationsRevoked();\\n }\\n\\n /**\\n * @notice Gets tokens currently available for release\\n * @dev Considers the schedule, takes into account already released tokens and used amount\\n * @return Amount of tokens ready to be released\\n */\\n function releasableAmount() public view override returns (uint256) {\\n if (revocable == Revocability.Disabled) {\\n return super.releasableAmount();\\n }\\n\\n // -- Revocability enabled logic\\n // This needs to deal with additional considerations for when tokens are used in the protocol\\n\\n // If a release start time is set no tokens are available for release before this date\\n // If not set it follows the default schedule and tokens are available on\\n // the first period passed\\n if (releaseStartTime > 0 && currentTime() < releaseStartTime) {\\n return 0;\\n }\\n\\n // Vesting cliff is activated and it has not passed means nothing is vested yet\\n // so funds cannot be released\\n if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\\n return 0;\\n }\\n\\n // A beneficiary can never have more releasable tokens than the contract balance\\n // We consider the `usedAmount` in the protocol as part of the calculations\\n // the beneficiary should not release funds that are used.\\n uint256 releasable = availableAmount().sub(releasedAmount).sub(usedAmount);\\n return MathUtils.min(currentBalance(), releasable);\\n }\\n\\n /**\\n * @notice Forward authorized contract calls to protocol contracts\\n * @dev Fallback function can be called by the beneficiary only if function call is allowed\\n */\\n // solhint-disable-next-line no-complex-fallback\\n fallback() external payable {\\n // Only beneficiary can forward calls\\n require(msg.sender == beneficiary, \\\"Unauthorized caller\\\");\\n require(msg.value == 0, \\\"ETH transfers not supported\\\");\\n\\n // Function call validation\\n address _target = manager.getAuthFunctionCallTarget(msg.sig);\\n require(_target != address(0), \\\"Unauthorized function\\\");\\n\\n uint256 oldBalance = currentBalance();\\n\\n // Call function with data\\n Address.functionCall(_target, msg.data);\\n\\n // Tracked used tokens in the protocol\\n // We do this check after balances were updated by the forwarded call\\n // Check is only enforced for revocable contracts to save some gas\\n if (revocable == Revocability.Enabled) {\\n // Track contract balance change\\n uint256 newBalance = currentBalance();\\n if (newBalance < oldBalance) {\\n // Outflow\\n uint256 diff = oldBalance.sub(newBalance);\\n usedAmount = usedAmount.add(diff);\\n } else {\\n // Inflow: We can receive profits from the protocol, that could make usedAmount to\\n // underflow. We set it to zero in that case.\\n uint256 diff = newBalance.sub(oldBalance);\\n usedAmount = (diff >= usedAmount) ? 0 : usedAmount.sub(diff);\\n }\\n require(usedAmount <= vestedAmount(), \\\"Cannot use more tokens than vested amount\\\");\\n }\\n }\\n\\n /**\\n * @notice Receive function that always reverts.\\n * @dev Only included to supress warnings, see https://github.com/ethereum/solidity/issues/10159\\n */\\n receive() external payable {\\n revert(\\\"Bad call\\\");\\n }\\n}\\n\",\"keccak256\":\"0x976c2ba4c1503a81ea02bd84539c516e99af611ff767968ee25456b50a6deb7b\",\"license\":\"MIT\"},\"contracts/ICallhookReceiver.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\n\\n// Copied from graphprotocol/contracts, changed solidity version to 0.7.3\\n\\n/**\\n * @title Interface for contracts that can receive callhooks through the Arbitrum GRT bridge\\n * @dev Any contract that can receive a callhook on L2, sent through the bridge from L1, must\\n * be allowlisted by the governor, but also implement this interface that contains\\n * the function that will actually be called by the L2GraphTokenGateway.\\n */\\npragma solidity ^0.7.3;\\n\\ninterface ICallhookReceiver {\\n /**\\n * @notice Receive tokens with a callhook from the bridge\\n * @param _from Token sender in L1\\n * @param _amount Amount of tokens that were transferred\\n * @param _data ABI-encoded callhook data\\n */\\n function onTokenTransfer(address _from, uint256 _amount, bytes calldata _data) external;\\n}\\n\",\"keccak256\":\"0xb90eae14e8bac012a4b99fabe7a1110f70143eb78476ea0d6b52557ef979fa0e\",\"license\":\"GPL-2.0-or-later\"},\"contracts/IGraphTokenLock.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\ninterface IGraphTokenLock {\\n enum Revocability {\\n NotSet,\\n Enabled,\\n Disabled\\n }\\n\\n // -- Balances --\\n\\n function currentBalance() external view returns (uint256);\\n\\n // -- Time & Periods --\\n\\n function currentTime() external view returns (uint256);\\n\\n function duration() external view returns (uint256);\\n\\n function sinceStartTime() external view returns (uint256);\\n\\n function amountPerPeriod() external view returns (uint256);\\n\\n function periodDuration() external view returns (uint256);\\n\\n function currentPeriod() external view returns (uint256);\\n\\n function passedPeriods() external view returns (uint256);\\n\\n // -- Locking & Release Schedule --\\n\\n function availableAmount() external view returns (uint256);\\n\\n function vestedAmount() external view returns (uint256);\\n\\n function releasableAmount() external view returns (uint256);\\n\\n function totalOutstandingAmount() external view returns (uint256);\\n\\n function surplusAmount() external view returns (uint256);\\n\\n // -- Value Transfer --\\n\\n function release() external;\\n\\n function withdrawSurplus(uint256 _amount) external;\\n\\n function revoke() external;\\n}\\n\",\"keccak256\":\"0xceb9d258276fe25ec858191e1deae5778f1b2f612a669fb7b37bab1a064756ab\",\"license\":\"MIT\"},\"contracts/IGraphTokenLockManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nimport \\\"./IGraphTokenLock.sol\\\";\\n\\ninterface IGraphTokenLockManager {\\n // -- Factory --\\n\\n function setMasterCopy(address _masterCopy) external;\\n\\n function createTokenLockWallet(\\n address _owner,\\n address _beneficiary,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n IGraphTokenLock.Revocability _revocable\\n ) external;\\n\\n // -- Funds Management --\\n\\n function token() external returns (IERC20);\\n\\n function deposit(uint256 _amount) external;\\n\\n function withdraw(uint256 _amount) external;\\n\\n // -- Allowed Funds Destinations --\\n\\n function addTokenDestination(address _dst) external;\\n\\n function removeTokenDestination(address _dst) external;\\n\\n function isTokenDestination(address _dst) external view returns (bool);\\n\\n function getTokenDestinations() external view returns (address[] memory);\\n\\n // -- Function Call Authorization --\\n\\n function setAuthFunctionCall(string calldata _signature, address _target) external;\\n\\n function unsetAuthFunctionCall(string calldata _signature) external;\\n\\n function setAuthFunctionCallMany(string[] calldata _signatures, address[] calldata _targets) external;\\n\\n function getAuthFunctionCallTarget(bytes4 _sigHash) external view returns (address);\\n\\n function isAuthFunctionCall(bytes4 _sigHash) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x2d78d41909a6de5b316ac39b100ea087a8f317cf306379888a045523e15c4d9a\",\"license\":\"MIT\"},\"contracts/L2GraphTokenLockManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport { SafeERC20 } from \\\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\\\";\\n\\nimport { ICallhookReceiver } from \\\"./ICallhookReceiver.sol\\\";\\nimport { GraphTokenLockManager } from \\\"./GraphTokenLockManager.sol\\\";\\nimport { L2GraphTokenLockWallet } from \\\"./L2GraphTokenLockWallet.sol\\\";\\n\\n/**\\n * @title L2GraphTokenLockManager\\n * @notice This contract manages a list of authorized function calls and targets that can be called\\n * by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts.\\n *\\n * This contract receives funds to make the process of creating TokenLockWallet contracts\\n * easier by distributing them the initial tokens to be managed.\\n *\\n * In particular, this L2 variant is designed to receive token lock wallets from L1,\\n * through the GRT bridge. These transferred wallets will not allow releasing funds in L2 until\\n * the end of the vesting timeline, but they can allow withdrawing funds back to L1 using\\n * the L2GraphTokenLockTransferTool contract.\\n *\\n * The owner can setup a list of token destinations that will be used by TokenLock contracts to\\n * approve the pulling of funds, this way in can be guaranteed that only protocol contracts\\n * will manipulate users funds.\\n */\\ncontract L2GraphTokenLockManager is GraphTokenLockManager, ICallhookReceiver {\\n using SafeERC20 for IERC20;\\n\\n /// @dev Struct to hold the data of a transferred wallet; this is\\n /// the data that must be encoded in L1 to send a wallet to L2.\\n struct TransferredWalletData {\\n address l1Address;\\n address owner;\\n address beneficiary;\\n uint256 managedAmount;\\n uint256 startTime;\\n uint256 endTime;\\n }\\n\\n /// Address of the L2GraphTokenGateway\\n address public immutable l2Gateway;\\n /// Address of the L1 transfer tool contract (in L1, no aliasing)\\n address public immutable l1TransferTool;\\n /// Mapping of each L1 wallet to its L2 wallet counterpart (populated when each wallet is received)\\n /// L1 address => L2 address\\n mapping(address => address) public l1WalletToL2Wallet;\\n /// Mapping of each L2 wallet to its L1 wallet counterpart (populated when each wallet is received)\\n /// L2 address => L1 address\\n mapping(address => address) public l2WalletToL1Wallet;\\n\\n /// @dev Event emitted when a wallet is received and created from L1\\n event TokenLockCreatedFromL1(\\n address indexed contractAddress,\\n bytes32 initHash,\\n address indexed beneficiary,\\n uint256 managedAmount,\\n uint256 startTime,\\n uint256 endTime,\\n address indexed l1Address\\n );\\n\\n /// @dev Emitted when locked tokens are received from L1 (whether the wallet\\n /// had already been received or not)\\n event LockedTokensReceivedFromL1(address indexed l1Address, address indexed l2Address, uint256 amount);\\n\\n /**\\n * @dev Checks that the sender is the L2GraphTokenGateway.\\n */\\n modifier onlyL2Gateway() {\\n require(msg.sender == l2Gateway, \\\"ONLY_GATEWAY\\\");\\n _;\\n }\\n\\n /**\\n * @notice Constructor for the L2GraphTokenLockManager contract.\\n * @param _graphToken Address of the L2 GRT token contract\\n * @param _masterCopy Address of the master copy of the L2GraphTokenLockWallet implementation\\n * @param _l2Gateway Address of the L2GraphTokenGateway contract\\n * @param _l1TransferTool Address of the L1 transfer tool contract (in L1, without aliasing)\\n */\\n constructor(\\n IERC20 _graphToken,\\n address _masterCopy,\\n address _l2Gateway,\\n address _l1TransferTool\\n ) GraphTokenLockManager(_graphToken, _masterCopy) {\\n l2Gateway = _l2Gateway;\\n l1TransferTool = _l1TransferTool;\\n }\\n\\n /**\\n * @notice This function is called by the L2GraphTokenGateway when tokens are sent from L1.\\n * @dev This function will create a new wallet if it doesn't exist yet, or send the tokens to\\n * the existing wallet if it does.\\n * @param _from Address of the sender in L1, which must be the L1GraphTokenLockTransferTool\\n * @param _amount Amount of tokens received\\n * @param _data Encoded data of the transferred wallet, which must be an ABI-encoded TransferredWalletData struct\\n */\\n function onTokenTransfer(address _from, uint256 _amount, bytes calldata _data) external override onlyL2Gateway {\\n require(_from == l1TransferTool, \\\"ONLY_TRANSFER_TOOL\\\");\\n TransferredWalletData memory walletData = abi.decode(_data, (TransferredWalletData));\\n\\n if (l1WalletToL2Wallet[walletData.l1Address] != address(0)) {\\n // If the wallet was already received, just send the tokens to the L2 address\\n _token.safeTransfer(l1WalletToL2Wallet[walletData.l1Address], _amount);\\n } else {\\n // Create contract using a minimal proxy and call initializer\\n (bytes32 initHash, address contractAddress) = _deployFromL1(keccak256(_data), walletData);\\n l1WalletToL2Wallet[walletData.l1Address] = contractAddress;\\n l2WalletToL1Wallet[contractAddress] = walletData.l1Address;\\n\\n // Send managed amount to the created contract\\n _token.safeTransfer(contractAddress, _amount);\\n\\n emit TokenLockCreatedFromL1(\\n contractAddress,\\n initHash,\\n walletData.beneficiary,\\n walletData.managedAmount,\\n walletData.startTime,\\n walletData.endTime,\\n walletData.l1Address\\n );\\n }\\n emit LockedTokensReceivedFromL1(walletData.l1Address, l1WalletToL2Wallet[walletData.l1Address], _amount);\\n }\\n\\n /**\\n * @dev Deploy a token lock wallet with data received from L1\\n * @param _salt Salt for the CREATE2 call, which must be the hash of the wallet data\\n * @param _walletData Data of the wallet to be created\\n * @return Hash of the initialization calldata\\n * @return Address of the created contract\\n */\\n function _deployFromL1(bytes32 _salt, TransferredWalletData memory _walletData) internal returns (bytes32, address) {\\n bytes memory initializer = _encodeInitializer(_walletData);\\n address contractAddress = _deployProxy2(_salt, masterCopy, initializer);\\n return (keccak256(initializer), contractAddress);\\n }\\n\\n /**\\n * @dev Encode the initializer for the token lock wallet received from L1\\n * @param _walletData Data of the wallet to be created\\n * @return Encoded initializer calldata, including the function signature\\n */\\n function _encodeInitializer(TransferredWalletData memory _walletData) internal view returns (bytes memory) {\\n return\\n abi.encodeWithSelector(\\n L2GraphTokenLockWallet.initializeFromL1.selector,\\n address(this),\\n address(_token),\\n _walletData\\n );\\n }\\n}\\n\",\"keccak256\":\"0x34ca0ffc898ce3615a000d53a9c58708354b8cd8093b3c61decfe7388f0c16e0\",\"license\":\"MIT\"},\"contracts/L2GraphTokenLockWallet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nimport { GraphTokenLockWallet } from \\\"./GraphTokenLockWallet.sol\\\";\\nimport { Ownable as OwnableInitializable } from \\\"./Ownable.sol\\\";\\nimport { L2GraphTokenLockManager } from \\\"./L2GraphTokenLockManager.sol\\\";\\n\\n/**\\n * @title L2GraphTokenLockWallet\\n * @notice This contract is built on top of the base GraphTokenLock functionality.\\n * It allows wallet beneficiaries to use the deposited funds to perform specific function calls\\n * on specific contracts.\\n *\\n * The idea is that supporters with locked tokens can participate in the protocol\\n * but disallow any release before the vesting/lock schedule.\\n * The beneficiary can issue authorized function calls to this contract that will\\n * get forwarded to a target contract. A target contract is any of our protocol contracts.\\n * The function calls allowed are queried to the GraphTokenLockManager, this way\\n * the same configuration can be shared for all the created lock wallet contracts.\\n *\\n * This L2 variant includes a special initializer so that it can be created from\\n * a wallet's data received from L1. These transferred wallets will not allow releasing\\n * funds in L2 until the end of the vesting timeline, but they can allow withdrawing\\n * funds back to L1 using the L2GraphTokenLockTransferTool contract.\\n *\\n * Note that surplusAmount and releasedAmount in L2 will be skewed for wallets received from L1,\\n * so releasing surplus tokens might also only be possible by bridging tokens back to L1.\\n *\\n * NOTE: Contracts used as target must have its function signatures checked to avoid collisions\\n * with any of this contract functions.\\n * Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience\\n * the maximum amount of tokens is authorized.\\n * Function calls do not forward ETH value so DO NOT SEND ETH TO THIS CONTRACT.\\n */\\ncontract L2GraphTokenLockWallet is GraphTokenLockWallet {\\n // Initializer when created from a message from L1\\n function initializeFromL1(\\n address _manager,\\n address _token,\\n L2GraphTokenLockManager.TransferredWalletData calldata _walletData\\n ) external {\\n require(!isInitialized, \\\"Already initialized\\\");\\n isInitialized = true;\\n\\n OwnableInitializable._initialize(_walletData.owner);\\n beneficiary = _walletData.beneficiary;\\n token = IERC20(_token);\\n\\n managedAmount = _walletData.managedAmount;\\n\\n startTime = _walletData.startTime;\\n endTime = _walletData.endTime;\\n periods = 1;\\n isAccepted = true;\\n\\n // Optionals\\n releaseStartTime = _walletData.endTime;\\n revocable = Revocability.Disabled;\\n\\n _setManager(_manager);\\n }\\n}\\n\",\"keccak256\":\"0x8842140c2c7924be4ab1bca71e0b0ad6dd1dba6433cfdc523bfd204288b25d20\",\"license\":\"MIT\"},\"contracts/MathUtils.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nlibrary MathUtils {\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n}\\n\",\"keccak256\":\"0xe2512e1da48bc8363acd15f66229564b02d66706665d7da740604566913c1400\",\"license\":\"MIT\"},\"contracts/MinimalProxyFactory.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nimport { Address } from \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport { Create2 } from \\\"@openzeppelin/contracts/utils/Create2.sol\\\";\\n\\n/**\\n * @title MinimalProxyFactory: a factory contract for creating minimal proxies\\n * @notice Adapted from https://github.com/OpenZeppelin/openzeppelin-sdk/blob/v2.5.0/packages/lib/contracts/upgradeability/ProxyFactory.sol\\n * Based on https://eips.ethereum.org/EIPS/eip-1167\\n */\\ncontract MinimalProxyFactory {\\n /// @dev Emitted when a new proxy is created\\n event ProxyCreated(address indexed proxy);\\n\\n /**\\n * @notice Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation\\n * @param _salt Bytes32 salt to use for CREATE2\\n * @param _implementation Address of the proxy target implementation\\n * @param _deployer Address of the deployer that creates the contract\\n * @return Address of the counterfactual MinimalProxy\\n */\\n function getDeploymentAddress(\\n bytes32 _salt,\\n address _implementation,\\n address _deployer\\n ) public pure returns (address) {\\n return Create2.computeAddress(_salt, keccak256(_getContractCreationCode(_implementation)), _deployer);\\n }\\n\\n /**\\n * @dev Deploys a MinimalProxy with CREATE2\\n * @param _salt Bytes32 salt to use for CREATE2\\n * @param _implementation Address of the proxy target implementation\\n * @param _data Bytes with the initializer call\\n * @return Address of the deployed MinimalProxy\\n */\\n function _deployProxy2(bytes32 _salt, address _implementation, bytes memory _data) internal returns (address) {\\n address proxyAddress = Create2.deploy(0, _salt, _getContractCreationCode(_implementation));\\n\\n emit ProxyCreated(proxyAddress);\\n\\n // Call function with data\\n if (_data.length > 0) {\\n Address.functionCall(proxyAddress, _data);\\n }\\n\\n return proxyAddress;\\n }\\n\\n /**\\n * @dev Gets the MinimalProxy bytecode\\n * @param _implementation Address of the proxy target implementation\\n * @return MinimalProxy bytecode\\n */\\n function _getContractCreationCode(address _implementation) internal pure returns (bytes memory) {\\n bytes10 creation = 0x3d602d80600a3d3981f3;\\n bytes10 prefix = 0x363d3d373d3d3d363d73;\\n bytes20 targetBytes = bytes20(_implementation);\\n bytes15 suffix = 0x5af43d82803e903d91602b57fd5bf3;\\n return abi.encodePacked(creation, prefix, targetBytes, suffix);\\n }\\n}\\n\",\"keccak256\":\"0x67d67a567bceb363ddb199b1e4ab06e7a99f16e034e03086971a332c09ec5c0e\",\"license\":\"MIT\"},\"contracts/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * The owner account will be passed on initialization of the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\ncontract Ownable {\\n /// @dev Owner of the contract, can be retrieved with the public owner() function\\n address private _owner;\\n /// @dev Since upgradeable contracts might inherit this, we add a storage gap\\n /// to allow adding variables here without breaking the proxy storage layout\\n uint256[50] private __gap;\\n\\n /// @dev Emitted when ownership of the contract is transferred\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n function _initialize(address owner) internal {\\n _owner = owner;\\n emit OwnershipTransferred(address(0), owner);\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(_owner == msg.sender, \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() external virtual onlyOwner {\\n emit OwnershipTransferred(_owner, address(0));\\n _owner = address(0);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) external virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n emit OwnershipTransferred(_owner, newOwner);\\n _owner = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0xe8750687082e8e24b620dbf58c3a08eee591ed7b4d5a3e13cc93554ec647fd09\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60c06040523480156200001157600080fd5b506040516200499938038062004999833981810160405281019062000037919062000410565b838360006200004b6200022860201b60201c565b9050806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a350600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156200015c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620001539062000586565b60405180910390fd5b81600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550620001ae816200023060201b60201c565b50508173ffffffffffffffffffffffffffffffffffffffff1660808173ffffffffffffffffffffffffffffffffffffffff1660601b815250508073ffffffffffffffffffffffffffffffffffffffff1660a08173ffffffffffffffffffffffffffffffffffffffff1660601b815250505050505062000635565b600033905090565b620002406200022860201b60201c565b73ffffffffffffffffffffffffffffffffffffffff1662000266620003b960201b60201c565b73ffffffffffffffffffffffffffffffffffffffff1614620002bf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620002b69062000564565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141562000332576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620003299062000542565b60405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167f30909084afc859121ffc3a5aef7fe37c540a9a1ef60bd4d8dcdb76376fadf9de60405160405180910390a250565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600081519050620003f38162000601565b92915050565b6000815190506200040a816200061b565b92915050565b600080600080608085870312156200042757600080fd5b60006200043787828801620003f9565b94505060206200044a87828801620003e2565b93505060406200045d87828801620003e2565b92505060606200047087828801620003e2565b91505092959194509250565b60006200048b601983620005a8565b91507f4d6173746572436f70792063616e6e6f74206265207a65726f000000000000006000830152602082019050919050565b6000620004cd602083620005a8565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b60006200050f601483620005a8565b91507f546f6b656e2063616e6e6f74206265207a65726f0000000000000000000000006000830152602082019050919050565b600060208201905081810360008301526200055d816200047c565b9050919050565b600060208201905081810360008301526200057f81620004be565b9050919050565b60006020820190508181036000830152620005a18162000500565b9050919050565b600082825260208201905092915050565b6000620005c682620005e1565b9050919050565b6000620005da82620005b9565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6200060c81620005b9565b81146200061857600080fd5b50565b6200062681620005cd565b81146200063257600080fd5b50565b60805160601c60a05160601c61433062000669600039806109195280611280525080610fc952806111f252506143306000f3fe608060405234801561001057600080fd5b50600436106101735760003560e01c806379ee1bdf116100de578063a619486e11610097578063cf497e6c11610071578063cf497e6c14610434578063f1d24c4514610450578063f2fde38b14610480578063fc0c546a1461049c57610173565b8063a619486e146103de578063b6b55f25146103fc578063c1ab13db1461041857610173565b806379ee1bdf1461031c5780638da5cb5b1461034c5780638fa74a0e1461036a5780639c05fc6014610388578063a3457466146103a4578063a4c0ed36146103c257610173565b8063463013a211610130578063463013a214610270578063586a53531461028c5780635975e00c146102aa57806368d30c2e146102c65780636e03b8dc146102e2578063715018a61461031257610173565b806303990a6c14610178578063045b7fe2146101945780630602ba2b146101c45780630cd6178f146101f45780632e1a7d4d1461022457806343fb93d914610240575b600080fd5b610192600480360381019061018d9190612f13565b6104ba565b005b6101ae60048036038101906101a99190612ca2565b610662565b6040516101bb91906139bc565b60405180910390f35b6101de60048036038101906101d99190612eea565b610695565b6040516101eb9190613bba565b60405180910390f35b61020e60048036038101906102099190612ca2565b6106d6565b60405161021b91906139bc565b60405180910390f35b61023e60048036038101906102399190612fd9565b610709565b005b61025a60048036038101906102559190612e9b565b610866565b60405161026791906139bc565b60405180910390f35b61028a60048036038101906102859190612f58565b61088b565b005b610294610917565b6040516102a191906139bc565b60405180910390f35b6102c460048036038101906102bf9190612ca2565b61093b565b005b6102e060048036038101906102db9190612ccb565b610acc565b005b6102fc60048036038101906102f79190612eea565b610e14565b60405161030991906139bc565b60405180910390f35b61031a610e47565b005b61033660048036038101906103319190612ca2565b610f81565b6040516103439190613bba565b60405180910390f35b610354610f9e565b60405161036191906139bc565b60405180910390f35b610372610fc7565b60405161037f91906139bc565b60405180910390f35b6103a2600480360381019061039d9190612dfd565b610feb565b005b6103ac611118565b6040516103b99190613b98565b60405180910390f35b6103dc60048036038101906103d79190612d91565b6111f0565b005b6103e6611756565b6040516103f391906139bc565b60405180910390f35b61041660048036038101906104119190612fd9565b61177c565b005b610432600480360381019061042d9190612ca2565b61185f565b005b61044e60048036038101906104499190612ca2565b611980565b005b61046a60048036038101906104659190612eea565b611af3565b60405161047791906139bc565b60405180910390f35b61049a60048036038101906104959190612ca2565b611b6e565b005b6104a4611d17565b6040516104b19190613c1a565b60405180910390f35b6104c2611d41565b73ffffffffffffffffffffffffffffffffffffffff166104e0610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614610536576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161052d90613e3b565b60405180910390fd5b60006105428383611d49565b9050600060016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff16817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163373ffffffffffffffffffffffffffffffffffffffff167f450397a2db0e89eccfe664cc6cdfd274a88bc00d29aaec4d991754a42f19f8c98686604051610655929190613c35565b60405180910390a4505050565b60076020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008073ffffffffffffffffffffffffffffffffffffffff166106b783611af3565b73ffffffffffffffffffffffffffffffffffffffff1614159050919050565b60066020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610711611d41565b73ffffffffffffffffffffffffffffffffffffffff1661072f610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614610785576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077c90613e3b565b60405180910390fd5b600081116107c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107bf90613e1b565b60405180910390fd5b6108153382600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611dd79092919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b8260405161085b9190613f1b565b60405180910390a250565b60006108828461087585611e5d565b8051906020012084611ed3565b90509392505050565b610893611d41565b73ffffffffffffffffffffffffffffffffffffffff166108b1610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614610907576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108fe90613e3b565b60405180910390fd5b610912838383611f17565b505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b610943611d41565b73ffffffffffffffffffffffffffffffffffffffff16610961610f9e565b73ffffffffffffffffffffffffffffffffffffffff16146109b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109ae90613e3b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610a27576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a1e90613cfb565b60405180910390fd5b610a3b8160026120f990919063ffffffff16565b610a7a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7190613e7b565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f33442b8c13e72dd75a027f08f9bff4eed2dfd26e43cdea857365f5163b359a796001604051610ac19190613bba565b60405180910390a250565b610ad4611d41565b73ffffffffffffffffffffffffffffffffffffffff16610af2610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614610b48576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b3f90613e3b565b60405180910390fd5b86600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610ba491906139bc565b60206040518083038186803b158015610bbc57600080fd5b505afa158015610bd0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bf49190613002565b1015610c35576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2c90613d3b565b60405180910390fd5b606063bd896dcb60e01b308b8b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168c8c8c8c8c8c8c604051602401610c869b9a999897969594939291906139d7565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505090506000610d1b8280519060200120600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684612129565b9050610d6a818a600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611dd79092919063ffffffff16565b8973ffffffffffffffffffffffffffffffffffffffff1682805190602001208273ffffffffffffffffffffffffffffffffffffffff167f3c7ff6acee351ed98200c285a04745858a107e16da2f13c3a81a43073c17d644600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168d8d8d8d8d8d8d604051610dff989796959493929190613b1a565b60405180910390a45050505050505050505050565b60016020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610e4f611d41565b73ffffffffffffffffffffffffffffffffffffffff16610e6d610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614610ec3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eba90613e3b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000610f978260026121a590919063ffffffff16565b9050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b7f000000000000000000000000000000000000000000000000000000000000000081565b610ff3611d41565b73ffffffffffffffffffffffffffffffffffffffff16611011610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161105e90613e3b565b60405180910390fd5b8181905084849050146110af576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110a690613cbb565b60405180910390fd5b60005b84849050811015611111576111048585838181106110cc57fe5b90506020028101906110de9190613f36565b8585858181106110ea57fe5b90506020020160208101906110ff9190612ca2565b611f17565b80806001019150506110b2565b5050505050565b60608061112560026121d5565b67ffffffffffffffff8111801561113b57600080fd5b5060405190808252806020026020018201604052801561116a5781602001602082028036833780820191505090505b50905060005b61117a60026121d5565b8110156111e8576111958160026121ea90919063ffffffff16565b8282815181106111a157fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508080600101915050611170565b508091505090565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461127e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161127590613cdb565b60405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161461130c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161130390613d7b565b60405180910390fd5b6113146129d3565b82828101906113239190612fb0565b9050600073ffffffffffffffffffffffffffffffffffffffff1660066000836000015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146114715761146c60066000836000015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1685600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611dd79092919063ffffffff16565b611683565b6000806114958585604051611487929190613973565b604051809103902084612204565b915091508060066000856000015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508260000151600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506115ea8187600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611dd79092919063ffffffff16565b826000015173ffffffffffffffffffffffffffffffffffffffff16836040015173ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fd74fe60cbf1e5bf07ef3fad0e00c45f66345c5226474786d8dc086527dc8414785876060015188608001518960a001516040516116789493929190613bd5565b60405180910390a450505b60066000826000015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16816000015173ffffffffffffffffffffffffffffffffffffffff167fe34903cfa4ad8362651171309d05bcbc2fc581a5ec83ca7b0c8d10743de766e2866040516117479190613f1b565b60405180910390a35050505050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600081116117bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117b690613e1b565b60405180910390fd5b61180e333083600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661225b909392919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f59062170a285eb80e8c6b8ced60428442a51910635005233fc4ce084a475845e826040516118549190613f1b565b60405180910390a250565b611867611d41565b73ffffffffffffffffffffffffffffffffffffffff16611885610f9e565b73ffffffffffffffffffffffffffffffffffffffff16146118db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118d290613e3b565b60405180910390fd5b6118ef8160026122e490919063ffffffff16565b61192e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192590613d9b565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f33442b8c13e72dd75a027f08f9bff4eed2dfd26e43cdea857365f5163b359a7960006040516119759190613bba565b60405180910390a250565b611988611d41565b73ffffffffffffffffffffffffffffffffffffffff166119a6610f9e565b73ffffffffffffffffffffffffffffffffffffffff16146119fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119f390613e3b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611a6c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a6390613dbb565b60405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167f30909084afc859121ffc3a5aef7fe37c540a9a1ef60bd4d8dcdb76376fadf9de60405160405180910390a250565b600060016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b611b76611d41565b73ffffffffffffffffffffffffffffffffffffffff16611b94610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614611bea576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611be190613e3b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c5190613d1b565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600033905090565b6000611dcf83836040516024016040516020818303038152906040529190604051611d759291906139a3565b60405180910390207bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050612314565b905092915050565b611e588363a9059cbb60e01b8484604051602401611df6929190613af1565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505061236c565b505050565b60606000693d602d80600a3d3981f360b01b9050600069363d3d373d3d3d363d7360b01b905060008460601b905060006e5af43d82803e903d91602b57fd5bf360881b905083838383604051602001611eb994939291906138d7565b604051602081830303815290604052945050505050919050565b60008060ff60f81b838686604051602001611ef19493929190613925565b6040516020818303038152906040528051906020012090508060001c9150509392505050565b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611f86576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f7d90613ddb565b60405180910390fd5b611f8f81612433565b611fce576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fc590613efb565b60405180910390fd5b6000611fda8484611d49565b90508160016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff16817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163373ffffffffffffffffffffffffffffffffffffffff167f450397a2db0e89eccfe664cc6cdfd274a88bc00d29aaec4d991754a42f19f8c987876040516120eb929190613c35565b60405180910390a450505050565b6000612121836000018373ffffffffffffffffffffffffffffffffffffffff1660001b612446565b905092915050565b60008061214060008661213b87611e5d565b6124b6565b90508073ffffffffffffffffffffffffffffffffffffffff167efffc2da0b561cae30d9826d37709e9421c4725faebc226cbbb7ef5fc5e734960405160405180910390a260008351111561219a5761219881846125c7565b505b809150509392505050565b60006121cd836000018373ffffffffffffffffffffffffffffffffffffffff1660001b612611565b905092915050565b60006121e382600001612634565b9050919050565b60006121f98360000183612645565b60001c905092915050565b6000806060612212846126b2565b9050600061224386600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684612129565b90508180519060200120819350935050509250929050565b6122de846323b872dd60e01b85858560405160240161227c93929190613aba565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505061236c565b50505050565b600061230c836000018373ffffffffffffffffffffffffffffffffffffffff1660001b612757565b905092915050565b6000600482511461235a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161235190613e5b565b60405180910390fd5b60006020830151905080915050919050565b60606123ce826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff1661283f9092919063ffffffff16565b905060008151111561242e57808060200190518101906123ee9190612e72565b61242d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161242490613ebb565b60405180910390fd5b5b505050565b600080823b905060008111915050919050565b60006124528383612611565b6124ab5782600001829080600181540180825580915050600190039060005260206000200160009091909190915055826000018054905083600101600084815260200190815260200160002081905550600190506124b0565b600090505b92915050565b600080844710156124fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124f390613edb565b60405180910390fd5b600083511415612541576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161253890613c9b565b60405180910390fd5b8383516020850187f59050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156125bc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125b390613dfb565b60405180910390fd5b809150509392505050565b606061260983836040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061283f565b905092915050565b600080836001016000848152602001908152602001600020541415905092915050565b600081600001805490509050919050565b600081836000018054905011612690576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161268790613c7b565b60405180910390fd5b82600001828154811061269f57fe5b9060005260206000200154905092915050565b60606320dc203d60e01b30600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040516024016126f393929190613a82565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050509050919050565b6000808360010160008481526020019081526020016000205490506000811461283357600060018203905060006001866000018054905003905060008660000182815481106127a257fe5b90600052602060002001549050808760000184815481106127bf57fe5b90600052602060002001819055506001830187600101600083815260200190815260200160002081905550866000018054806127f757fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050612839565b60009150505b92915050565b606061284e8484600085612857565b90509392505050565b60608247101561289c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161289390613d5b565b60405180910390fd5b6128a585612433565b6128e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128db90613e9b565b60405180910390fd5b600060608673ffffffffffffffffffffffffffffffffffffffff16858760405161290e919061398c565b60006040518083038185875af1925050503d806000811461294b576040519150601f19603f3d011682016040523d82523d6000602084013e612950565b606091505b509150915061296082828661296c565b92505050949350505050565b6060831561297c578290506129cc565b60008351111561298f5782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129c39190613c59565b60405180910390fd5b9392505050565b6040518060c00160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff1681526020016000815260200160008152602001600081525090565b600081359050612a5a81614277565b92915050565b60008083601f840112612a7257600080fd5b8235905067ffffffffffffffff811115612a8b57600080fd5b602083019150836020820283011115612aa357600080fd5b9250929050565b60008083601f840112612abc57600080fd5b8235905067ffffffffffffffff811115612ad557600080fd5b602083019150836020820283011115612aed57600080fd5b9250929050565b600081519050612b038161428e565b92915050565b600081359050612b18816142a5565b92915050565b600081359050612b2d816142bc565b92915050565b60008083601f840112612b4557600080fd5b8235905067ffffffffffffffff811115612b5e57600080fd5b602083019150836001820283011115612b7657600080fd5b9250929050565b600081359050612b8c816142d3565b92915050565b60008083601f840112612ba457600080fd5b8235905067ffffffffffffffff811115612bbd57600080fd5b602083019150836001820283011115612bd557600080fd5b9250929050565b600060c08284031215612bee57600080fd5b612bf860c0613f8d565b90506000612c0884828501612a4b565b6000830152506020612c1c84828501612a4b565b6020830152506040612c3084828501612a4b565b6040830152506060612c4484828501612c78565b6060830152506080612c5884828501612c78565b60808301525060a0612c6c84828501612c78565b60a08301525092915050565b600081359050612c87816142e3565b92915050565b600081519050612c9c816142e3565b92915050565b600060208284031215612cb457600080fd5b6000612cc284828501612a4b565b91505092915050565b60008060008060008060008060006101208a8c031215612cea57600080fd5b6000612cf88c828d01612a4b565b9950506020612d098c828d01612a4b565b9850506040612d1a8c828d01612c78565b9750506060612d2b8c828d01612c78565b9650506080612d3c8c828d01612c78565b95505060a0612d4d8c828d01612c78565b94505060c0612d5e8c828d01612c78565b93505060e0612d6f8c828d01612c78565b925050610100612d818c828d01612b7d565b9150509295985092959850929598565b60008060008060608587031215612da757600080fd5b6000612db587828801612a4b565b9450506020612dc687828801612c78565b935050604085013567ffffffffffffffff811115612de357600080fd5b612def87828801612b33565b925092505092959194509250565b60008060008060408587031215612e1357600080fd5b600085013567ffffffffffffffff811115612e2d57600080fd5b612e3987828801612aaa565b9450945050602085013567ffffffffffffffff811115612e5857600080fd5b612e6487828801612a60565b925092505092959194509250565b600060208284031215612e8457600080fd5b6000612e9284828501612af4565b91505092915050565b600080600060608486031215612eb057600080fd5b6000612ebe86828701612b09565b9350506020612ecf86828701612a4b565b9250506040612ee086828701612a4b565b9150509250925092565b600060208284031215612efc57600080fd5b6000612f0a84828501612b1e565b91505092915050565b60008060208385031215612f2657600080fd5b600083013567ffffffffffffffff811115612f4057600080fd5b612f4c85828601612b92565b92509250509250929050565b600080600060408486031215612f6d57600080fd5b600084013567ffffffffffffffff811115612f8757600080fd5b612f9386828701612b92565b93509350506020612fa686828701612a4b565b9150509250925092565b600060c08284031215612fc257600080fd5b6000612fd084828501612bdc565b91505092915050565b600060208284031215612feb57600080fd5b6000612ff984828501612c78565b91505092915050565b60006020828403121561301457600080fd5b600061302284828501612c8d565b91505092915050565b60006130378383613043565b60208301905092915050565b61304c81614034565b82525050565b61305b81614034565b82525050565b61307261306d82614034565b6141ed565b82525050565b600061308382613fce565b61308d8185613ffc565b935061309883613fbe565b8060005b838110156130c95781516130b0888261302b565b97506130bb83613fef565b92505060018101905061309c565b5085935050505092915050565b6130df81614046565b82525050565b6130f66130f18261407e565b614209565b82525050565b61310d613108826140aa565b614213565b82525050565b61312461311f82614052565b6141ff565b82525050565b61313b613136826140d6565b61421d565b82525050565b61314a81614102565b82525050565b61316161315c82614102565b614227565b82525050565b6000613173838561400d565b93506131808385846141ab565b82840190509392505050565b600061319782613fd9565b6131a1818561400d565b93506131b18185602086016141ba565b80840191505092915050565b6131c681614175565b82525050565b6131d581614199565b82525050565b60006131e78385614018565b93506131f48385846141ab565b6131fd83614245565b840190509392505050565b60006132148385614029565b93506132218385846141ab565b82840190509392505050565b600061323882613fe4565b6132428185614018565b93506132528185602086016141ba565b61325b81614245565b840191505092915050565b6000613273602283614018565b91507f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e60008301527f64730000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006132d9602083614018565b91507f437265617465323a2062797465636f6465206c656e677468206973207a65726f6000830152602082019050919050565b6000613319601583614018565b91507f4172726179206c656e677468206d69736d6174636800000000000000000000006000830152602082019050919050565b6000613359600c83614018565b91507f4f4e4c595f4741544557415900000000000000000000000000000000000000006000830152602082019050919050565b6000613399601a83614018565b91507f44657374696e6174696f6e2063616e6e6f74206265207a65726f0000000000006000830152602082019050919050565b60006133d9602683614018565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b600061343f602083614018565b91507f4e6f7420656e6f75676820746f6b656e7320746f20637265617465206c6f636b6000830152602082019050919050565b600061347f602683614018565b91507f416464726573733a20696e73756666696369656e742062616c616e636520666f60008301527f722063616c6c00000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006134e5601283614018565b91507f4f4e4c595f5452414e534645525f544f4f4c00000000000000000000000000006000830152602082019050919050565b6000613525601b83614018565b91507f44657374696e6174696f6e20616c72656164792072656d6f76656400000000006000830152602082019050919050565b6000613565601983614018565b91507f4d6173746572436f70792063616e6e6f74206265207a65726f000000000000006000830152602082019050919050565b60006135a5601d83614018565b91507f546172676574206d757374206265206f7468657220636f6e74726163740000006000830152602082019050919050565b60006135e5601983614018565b91507f437265617465323a204661696c6564206f6e206465706c6f79000000000000006000830152602082019050919050565b6000613625601583614018565b91507f416d6f756e742063616e6e6f74206265207a65726f00000000000000000000006000830152602082019050919050565b6000613665602083614018565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b60006136a5601883614018565b91507f496e76616c6964206d6574686f64207369676e617475726500000000000000006000830152602082019050919050565b60006136e5601983614018565b91507f44657374696e6174696f6e20616c7265616479206164646564000000000000006000830152602082019050919050565b6000613725601d83614018565b91507f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006000830152602082019050919050565b6000613765602a83614018565b91507f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008301527f6f742073756363656564000000000000000000000000000000000000000000006020830152604082019050919050565b60006137cb601d83614018565b91507f437265617465323a20696e73756666696369656e742062616c616e63650000006000830152602082019050919050565b600061380b601983614018565b91507f546172676574206d757374206265206120636f6e7472616374000000000000006000830152602082019050919050565b60c0820160008201516138546000850182613043565b5060208201516138676020850182613043565b50604082015161387a6040850182613043565b50606082015161388d60608501826138b9565b5060808201516138a060808501826138b9565b5060a08201516138b360a08501826138b9565b50505050565b6138c28161416b565b82525050565b6138d18161416b565b82525050565b60006138e382876130e5565b600a820191506138f382866130e5565b600a82019150613903828561312a565b60148201915061391382846130fc565b600f8201915081905095945050505050565b60006139318287613113565b6001820191506139418286613061565b6014820191506139518285613150565b6020820191506139618284613150565b60208201915081905095945050505050565b6000613980828486613167565b91508190509392505050565b6000613998828461318c565b915081905092915050565b60006139b0828486613208565b91508190509392505050565b60006020820190506139d16000830184613052565b92915050565b6000610160820190506139ed600083018e613052565b6139fa602083018d613052565b613a07604083018c613052565b613a14606083018b613052565b613a21608083018a6138c8565b613a2e60a08301896138c8565b613a3b60c08301886138c8565b613a4860e08301876138c8565b613a566101008301866138c8565b613a646101208301856138c8565b613a726101408301846131cc565b9c9b505050505050505050505050565b600061010082019050613a986000830186613052565b613aa56020830185613052565b613ab2604083018461383e565b949350505050565b6000606082019050613acf6000830186613052565b613adc6020830185613052565b613ae960408301846138c8565b949350505050565b6000604082019050613b066000830185613052565b613b1360208301846138c8565b9392505050565b600061010082019050613b30600083018b613052565b613b3d602083018a6138c8565b613b4a60408301896138c8565b613b5760608301886138c8565b613b6460808301876138c8565b613b7160a08301866138c8565b613b7e60c08301856138c8565b613b8b60e08301846131cc565b9998505050505050505050565b60006020820190508181036000830152613bb28184613078565b905092915050565b6000602082019050613bcf60008301846130d6565b92915050565b6000608082019050613bea6000830187613141565b613bf760208301866138c8565b613c0460408301856138c8565b613c1160608301846138c8565b95945050505050565b6000602082019050613c2f60008301846131bd565b92915050565b60006020820190508181036000830152613c508184866131db565b90509392505050565b60006020820190508181036000830152613c73818461322d565b905092915050565b60006020820190508181036000830152613c9481613266565b9050919050565b60006020820190508181036000830152613cb4816132cc565b9050919050565b60006020820190508181036000830152613cd48161330c565b9050919050565b60006020820190508181036000830152613cf48161334c565b9050919050565b60006020820190508181036000830152613d148161338c565b9050919050565b60006020820190508181036000830152613d34816133cc565b9050919050565b60006020820190508181036000830152613d5481613432565b9050919050565b60006020820190508181036000830152613d7481613472565b9050919050565b60006020820190508181036000830152613d94816134d8565b9050919050565b60006020820190508181036000830152613db481613518565b9050919050565b60006020820190508181036000830152613dd481613558565b9050919050565b60006020820190508181036000830152613df481613598565b9050919050565b60006020820190508181036000830152613e14816135d8565b9050919050565b60006020820190508181036000830152613e3481613618565b9050919050565b60006020820190508181036000830152613e5481613658565b9050919050565b60006020820190508181036000830152613e7481613698565b9050919050565b60006020820190508181036000830152613e94816136d8565b9050919050565b60006020820190508181036000830152613eb481613718565b9050919050565b60006020820190508181036000830152613ed481613758565b9050919050565b60006020820190508181036000830152613ef4816137be565b9050919050565b60006020820190508181036000830152613f14816137fe565b9050919050565b6000602082019050613f3060008301846138c8565b92915050565b60008083356001602003843603038112613f4f57600080fd5b80840192508235915067ffffffffffffffff821115613f6d57600080fd5b602083019250600182023603831315613f8557600080fd5b509250929050565b6000604051905081810181811067ffffffffffffffff82111715613fb457613fb3614243565b5b8060405250919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b600061403f8261414b565b9050919050565b60008115159050919050565b60007fff0000000000000000000000000000000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffff0000000000000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffffffffffffff000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffffffffffffffffffffffff00000000000000000000000082169050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600081905061414682614263565b919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600061418082614187565b9050919050565b60006141928261414b565b9050919050565b60006141a482614138565b9050919050565b82818337600083830152505050565b60005b838110156141d85780820151818401526020810190506141bd565b838111156141e7576000848401525b50505050565b60006141f882614231565b9050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b600061423c82614256565b9050919050565bfe5b6000601f19601f8301169050919050565b60008160601b9050919050565b6003811061427457614273614243565b5b50565b61428081614034565b811461428b57600080fd5b50565b61429781614046565b81146142a257600080fd5b50565b6142ae81614102565b81146142b957600080fd5b50565b6142c58161410c565b81146142d057600080fd5b50565b600381106142e057600080fd5b50565b6142ec8161416b565b81146142f757600080fd5b5056fea264697066735822122010f167ec85dbd4b07aedb6960f9f6ac5ae1b0f5473409617dcd319393591837164736f6c63430007030033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101735760003560e01c806379ee1bdf116100de578063a619486e11610097578063cf497e6c11610071578063cf497e6c14610434578063f1d24c4514610450578063f2fde38b14610480578063fc0c546a1461049c57610173565b8063a619486e146103de578063b6b55f25146103fc578063c1ab13db1461041857610173565b806379ee1bdf1461031c5780638da5cb5b1461034c5780638fa74a0e1461036a5780639c05fc6014610388578063a3457466146103a4578063a4c0ed36146103c257610173565b8063463013a211610130578063463013a214610270578063586a53531461028c5780635975e00c146102aa57806368d30c2e146102c65780636e03b8dc146102e2578063715018a61461031257610173565b806303990a6c14610178578063045b7fe2146101945780630602ba2b146101c45780630cd6178f146101f45780632e1a7d4d1461022457806343fb93d914610240575b600080fd5b610192600480360381019061018d9190612f13565b6104ba565b005b6101ae60048036038101906101a99190612ca2565b610662565b6040516101bb91906139bc565b60405180910390f35b6101de60048036038101906101d99190612eea565b610695565b6040516101eb9190613bba565b60405180910390f35b61020e60048036038101906102099190612ca2565b6106d6565b60405161021b91906139bc565b60405180910390f35b61023e60048036038101906102399190612fd9565b610709565b005b61025a60048036038101906102559190612e9b565b610866565b60405161026791906139bc565b60405180910390f35b61028a60048036038101906102859190612f58565b61088b565b005b610294610917565b6040516102a191906139bc565b60405180910390f35b6102c460048036038101906102bf9190612ca2565b61093b565b005b6102e060048036038101906102db9190612ccb565b610acc565b005b6102fc60048036038101906102f79190612eea565b610e14565b60405161030991906139bc565b60405180910390f35b61031a610e47565b005b61033660048036038101906103319190612ca2565b610f81565b6040516103439190613bba565b60405180910390f35b610354610f9e565b60405161036191906139bc565b60405180910390f35b610372610fc7565b60405161037f91906139bc565b60405180910390f35b6103a2600480360381019061039d9190612dfd565b610feb565b005b6103ac611118565b6040516103b99190613b98565b60405180910390f35b6103dc60048036038101906103d79190612d91565b6111f0565b005b6103e6611756565b6040516103f391906139bc565b60405180910390f35b61041660048036038101906104119190612fd9565b61177c565b005b610432600480360381019061042d9190612ca2565b61185f565b005b61044e60048036038101906104499190612ca2565b611980565b005b61046a60048036038101906104659190612eea565b611af3565b60405161047791906139bc565b60405180910390f35b61049a60048036038101906104959190612ca2565b611b6e565b005b6104a4611d17565b6040516104b19190613c1a565b60405180910390f35b6104c2611d41565b73ffffffffffffffffffffffffffffffffffffffff166104e0610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614610536576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161052d90613e3b565b60405180910390fd5b60006105428383611d49565b9050600060016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff16817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163373ffffffffffffffffffffffffffffffffffffffff167f450397a2db0e89eccfe664cc6cdfd274a88bc00d29aaec4d991754a42f19f8c98686604051610655929190613c35565b60405180910390a4505050565b60076020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008073ffffffffffffffffffffffffffffffffffffffff166106b783611af3565b73ffffffffffffffffffffffffffffffffffffffff1614159050919050565b60066020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610711611d41565b73ffffffffffffffffffffffffffffffffffffffff1661072f610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614610785576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077c90613e3b565b60405180910390fd5b600081116107c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107bf90613e1b565b60405180910390fd5b6108153382600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611dd79092919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b8260405161085b9190613f1b565b60405180910390a250565b60006108828461087585611e5d565b8051906020012084611ed3565b90509392505050565b610893611d41565b73ffffffffffffffffffffffffffffffffffffffff166108b1610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614610907576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108fe90613e3b565b60405180910390fd5b610912838383611f17565b505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b610943611d41565b73ffffffffffffffffffffffffffffffffffffffff16610961610f9e565b73ffffffffffffffffffffffffffffffffffffffff16146109b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109ae90613e3b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610a27576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a1e90613cfb565b60405180910390fd5b610a3b8160026120f990919063ffffffff16565b610a7a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7190613e7b565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f33442b8c13e72dd75a027f08f9bff4eed2dfd26e43cdea857365f5163b359a796001604051610ac19190613bba565b60405180910390a250565b610ad4611d41565b73ffffffffffffffffffffffffffffffffffffffff16610af2610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614610b48576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b3f90613e3b565b60405180910390fd5b86600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610ba491906139bc565b60206040518083038186803b158015610bbc57600080fd5b505afa158015610bd0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bf49190613002565b1015610c35576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2c90613d3b565b60405180910390fd5b606063bd896dcb60e01b308b8b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168c8c8c8c8c8c8c604051602401610c869b9a999897969594939291906139d7565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505090506000610d1b8280519060200120600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684612129565b9050610d6a818a600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611dd79092919063ffffffff16565b8973ffffffffffffffffffffffffffffffffffffffff1682805190602001208273ffffffffffffffffffffffffffffffffffffffff167f3c7ff6acee351ed98200c285a04745858a107e16da2f13c3a81a43073c17d644600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168d8d8d8d8d8d8d604051610dff989796959493929190613b1a565b60405180910390a45050505050505050505050565b60016020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610e4f611d41565b73ffffffffffffffffffffffffffffffffffffffff16610e6d610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614610ec3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eba90613e3b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000610f978260026121a590919063ffffffff16565b9050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b7f000000000000000000000000000000000000000000000000000000000000000081565b610ff3611d41565b73ffffffffffffffffffffffffffffffffffffffff16611011610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161105e90613e3b565b60405180910390fd5b8181905084849050146110af576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110a690613cbb565b60405180910390fd5b60005b84849050811015611111576111048585838181106110cc57fe5b90506020028101906110de9190613f36565b8585858181106110ea57fe5b90506020020160208101906110ff9190612ca2565b611f17565b80806001019150506110b2565b5050505050565b60608061112560026121d5565b67ffffffffffffffff8111801561113b57600080fd5b5060405190808252806020026020018201604052801561116a5781602001602082028036833780820191505090505b50905060005b61117a60026121d5565b8110156111e8576111958160026121ea90919063ffffffff16565b8282815181106111a157fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508080600101915050611170565b508091505090565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461127e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161127590613cdb565b60405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161461130c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161130390613d7b565b60405180910390fd5b6113146129d3565b82828101906113239190612fb0565b9050600073ffffffffffffffffffffffffffffffffffffffff1660066000836000015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146114715761146c60066000836000015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1685600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611dd79092919063ffffffff16565b611683565b6000806114958585604051611487929190613973565b604051809103902084612204565b915091508060066000856000015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508260000151600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506115ea8187600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611dd79092919063ffffffff16565b826000015173ffffffffffffffffffffffffffffffffffffffff16836040015173ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fd74fe60cbf1e5bf07ef3fad0e00c45f66345c5226474786d8dc086527dc8414785876060015188608001518960a001516040516116789493929190613bd5565b60405180910390a450505b60066000826000015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16816000015173ffffffffffffffffffffffffffffffffffffffff167fe34903cfa4ad8362651171309d05bcbc2fc581a5ec83ca7b0c8d10743de766e2866040516117479190613f1b565b60405180910390a35050505050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600081116117bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117b690613e1b565b60405180910390fd5b61180e333083600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661225b909392919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f59062170a285eb80e8c6b8ced60428442a51910635005233fc4ce084a475845e826040516118549190613f1b565b60405180910390a250565b611867611d41565b73ffffffffffffffffffffffffffffffffffffffff16611885610f9e565b73ffffffffffffffffffffffffffffffffffffffff16146118db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118d290613e3b565b60405180910390fd5b6118ef8160026122e490919063ffffffff16565b61192e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192590613d9b565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f33442b8c13e72dd75a027f08f9bff4eed2dfd26e43cdea857365f5163b359a7960006040516119759190613bba565b60405180910390a250565b611988611d41565b73ffffffffffffffffffffffffffffffffffffffff166119a6610f9e565b73ffffffffffffffffffffffffffffffffffffffff16146119fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119f390613e3b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611a6c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a6390613dbb565b60405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167f30909084afc859121ffc3a5aef7fe37c540a9a1ef60bd4d8dcdb76376fadf9de60405160405180910390a250565b600060016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b611b76611d41565b73ffffffffffffffffffffffffffffffffffffffff16611b94610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614611bea576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611be190613e3b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c5190613d1b565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600033905090565b6000611dcf83836040516024016040516020818303038152906040529190604051611d759291906139a3565b60405180910390207bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050612314565b905092915050565b611e588363a9059cbb60e01b8484604051602401611df6929190613af1565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505061236c565b505050565b60606000693d602d80600a3d3981f360b01b9050600069363d3d373d3d3d363d7360b01b905060008460601b905060006e5af43d82803e903d91602b57fd5bf360881b905083838383604051602001611eb994939291906138d7565b604051602081830303815290604052945050505050919050565b60008060ff60f81b838686604051602001611ef19493929190613925565b6040516020818303038152906040528051906020012090508060001c9150509392505050565b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611f86576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f7d90613ddb565b60405180910390fd5b611f8f81612433565b611fce576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fc590613efb565b60405180910390fd5b6000611fda8484611d49565b90508160016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff16817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163373ffffffffffffffffffffffffffffffffffffffff167f450397a2db0e89eccfe664cc6cdfd274a88bc00d29aaec4d991754a42f19f8c987876040516120eb929190613c35565b60405180910390a450505050565b6000612121836000018373ffffffffffffffffffffffffffffffffffffffff1660001b612446565b905092915050565b60008061214060008661213b87611e5d565b6124b6565b90508073ffffffffffffffffffffffffffffffffffffffff167efffc2da0b561cae30d9826d37709e9421c4725faebc226cbbb7ef5fc5e734960405160405180910390a260008351111561219a5761219881846125c7565b505b809150509392505050565b60006121cd836000018373ffffffffffffffffffffffffffffffffffffffff1660001b612611565b905092915050565b60006121e382600001612634565b9050919050565b60006121f98360000183612645565b60001c905092915050565b6000806060612212846126b2565b9050600061224386600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684612129565b90508180519060200120819350935050509250929050565b6122de846323b872dd60e01b85858560405160240161227c93929190613aba565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505061236c565b50505050565b600061230c836000018373ffffffffffffffffffffffffffffffffffffffff1660001b612757565b905092915050565b6000600482511461235a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161235190613e5b565b60405180910390fd5b60006020830151905080915050919050565b60606123ce826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff1661283f9092919063ffffffff16565b905060008151111561242e57808060200190518101906123ee9190612e72565b61242d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161242490613ebb565b60405180910390fd5b5b505050565b600080823b905060008111915050919050565b60006124528383612611565b6124ab5782600001829080600181540180825580915050600190039060005260206000200160009091909190915055826000018054905083600101600084815260200190815260200160002081905550600190506124b0565b600090505b92915050565b600080844710156124fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124f390613edb565b60405180910390fd5b600083511415612541576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161253890613c9b565b60405180910390fd5b8383516020850187f59050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156125bc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125b390613dfb565b60405180910390fd5b809150509392505050565b606061260983836040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061283f565b905092915050565b600080836001016000848152602001908152602001600020541415905092915050565b600081600001805490509050919050565b600081836000018054905011612690576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161268790613c7b565b60405180910390fd5b82600001828154811061269f57fe5b9060005260206000200154905092915050565b60606320dc203d60e01b30600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040516024016126f393929190613a82565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050509050919050565b6000808360010160008481526020019081526020016000205490506000811461283357600060018203905060006001866000018054905003905060008660000182815481106127a257fe5b90600052602060002001549050808760000184815481106127bf57fe5b90600052602060002001819055506001830187600101600083815260200190815260200160002081905550866000018054806127f757fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050612839565b60009150505b92915050565b606061284e8484600085612857565b90509392505050565b60608247101561289c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161289390613d5b565b60405180910390fd5b6128a585612433565b6128e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128db90613e9b565b60405180910390fd5b600060608673ffffffffffffffffffffffffffffffffffffffff16858760405161290e919061398c565b60006040518083038185875af1925050503d806000811461294b576040519150601f19603f3d011682016040523d82523d6000602084013e612950565b606091505b509150915061296082828661296c565b92505050949350505050565b6060831561297c578290506129cc565b60008351111561298f5782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129c39190613c59565b60405180910390fd5b9392505050565b6040518060c00160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff1681526020016000815260200160008152602001600081525090565b600081359050612a5a81614277565b92915050565b60008083601f840112612a7257600080fd5b8235905067ffffffffffffffff811115612a8b57600080fd5b602083019150836020820283011115612aa357600080fd5b9250929050565b60008083601f840112612abc57600080fd5b8235905067ffffffffffffffff811115612ad557600080fd5b602083019150836020820283011115612aed57600080fd5b9250929050565b600081519050612b038161428e565b92915050565b600081359050612b18816142a5565b92915050565b600081359050612b2d816142bc565b92915050565b60008083601f840112612b4557600080fd5b8235905067ffffffffffffffff811115612b5e57600080fd5b602083019150836001820283011115612b7657600080fd5b9250929050565b600081359050612b8c816142d3565b92915050565b60008083601f840112612ba457600080fd5b8235905067ffffffffffffffff811115612bbd57600080fd5b602083019150836001820283011115612bd557600080fd5b9250929050565b600060c08284031215612bee57600080fd5b612bf860c0613f8d565b90506000612c0884828501612a4b565b6000830152506020612c1c84828501612a4b565b6020830152506040612c3084828501612a4b565b6040830152506060612c4484828501612c78565b6060830152506080612c5884828501612c78565b60808301525060a0612c6c84828501612c78565b60a08301525092915050565b600081359050612c87816142e3565b92915050565b600081519050612c9c816142e3565b92915050565b600060208284031215612cb457600080fd5b6000612cc284828501612a4b565b91505092915050565b60008060008060008060008060006101208a8c031215612cea57600080fd5b6000612cf88c828d01612a4b565b9950506020612d098c828d01612a4b565b9850506040612d1a8c828d01612c78565b9750506060612d2b8c828d01612c78565b9650506080612d3c8c828d01612c78565b95505060a0612d4d8c828d01612c78565b94505060c0612d5e8c828d01612c78565b93505060e0612d6f8c828d01612c78565b925050610100612d818c828d01612b7d565b9150509295985092959850929598565b60008060008060608587031215612da757600080fd5b6000612db587828801612a4b565b9450506020612dc687828801612c78565b935050604085013567ffffffffffffffff811115612de357600080fd5b612def87828801612b33565b925092505092959194509250565b60008060008060408587031215612e1357600080fd5b600085013567ffffffffffffffff811115612e2d57600080fd5b612e3987828801612aaa565b9450945050602085013567ffffffffffffffff811115612e5857600080fd5b612e6487828801612a60565b925092505092959194509250565b600060208284031215612e8457600080fd5b6000612e9284828501612af4565b91505092915050565b600080600060608486031215612eb057600080fd5b6000612ebe86828701612b09565b9350506020612ecf86828701612a4b565b9250506040612ee086828701612a4b565b9150509250925092565b600060208284031215612efc57600080fd5b6000612f0a84828501612b1e565b91505092915050565b60008060208385031215612f2657600080fd5b600083013567ffffffffffffffff811115612f4057600080fd5b612f4c85828601612b92565b92509250509250929050565b600080600060408486031215612f6d57600080fd5b600084013567ffffffffffffffff811115612f8757600080fd5b612f9386828701612b92565b93509350506020612fa686828701612a4b565b9150509250925092565b600060c08284031215612fc257600080fd5b6000612fd084828501612bdc565b91505092915050565b600060208284031215612feb57600080fd5b6000612ff984828501612c78565b91505092915050565b60006020828403121561301457600080fd5b600061302284828501612c8d565b91505092915050565b60006130378383613043565b60208301905092915050565b61304c81614034565b82525050565b61305b81614034565b82525050565b61307261306d82614034565b6141ed565b82525050565b600061308382613fce565b61308d8185613ffc565b935061309883613fbe565b8060005b838110156130c95781516130b0888261302b565b97506130bb83613fef565b92505060018101905061309c565b5085935050505092915050565b6130df81614046565b82525050565b6130f66130f18261407e565b614209565b82525050565b61310d613108826140aa565b614213565b82525050565b61312461311f82614052565b6141ff565b82525050565b61313b613136826140d6565b61421d565b82525050565b61314a81614102565b82525050565b61316161315c82614102565b614227565b82525050565b6000613173838561400d565b93506131808385846141ab565b82840190509392505050565b600061319782613fd9565b6131a1818561400d565b93506131b18185602086016141ba565b80840191505092915050565b6131c681614175565b82525050565b6131d581614199565b82525050565b60006131e78385614018565b93506131f48385846141ab565b6131fd83614245565b840190509392505050565b60006132148385614029565b93506132218385846141ab565b82840190509392505050565b600061323882613fe4565b6132428185614018565b93506132528185602086016141ba565b61325b81614245565b840191505092915050565b6000613273602283614018565b91507f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e60008301527f64730000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006132d9602083614018565b91507f437265617465323a2062797465636f6465206c656e677468206973207a65726f6000830152602082019050919050565b6000613319601583614018565b91507f4172726179206c656e677468206d69736d6174636800000000000000000000006000830152602082019050919050565b6000613359600c83614018565b91507f4f4e4c595f4741544557415900000000000000000000000000000000000000006000830152602082019050919050565b6000613399601a83614018565b91507f44657374696e6174696f6e2063616e6e6f74206265207a65726f0000000000006000830152602082019050919050565b60006133d9602683614018565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b600061343f602083614018565b91507f4e6f7420656e6f75676820746f6b656e7320746f20637265617465206c6f636b6000830152602082019050919050565b600061347f602683614018565b91507f416464726573733a20696e73756666696369656e742062616c616e636520666f60008301527f722063616c6c00000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006134e5601283614018565b91507f4f4e4c595f5452414e534645525f544f4f4c00000000000000000000000000006000830152602082019050919050565b6000613525601b83614018565b91507f44657374696e6174696f6e20616c72656164792072656d6f76656400000000006000830152602082019050919050565b6000613565601983614018565b91507f4d6173746572436f70792063616e6e6f74206265207a65726f000000000000006000830152602082019050919050565b60006135a5601d83614018565b91507f546172676574206d757374206265206f7468657220636f6e74726163740000006000830152602082019050919050565b60006135e5601983614018565b91507f437265617465323a204661696c6564206f6e206465706c6f79000000000000006000830152602082019050919050565b6000613625601583614018565b91507f416d6f756e742063616e6e6f74206265207a65726f00000000000000000000006000830152602082019050919050565b6000613665602083614018565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b60006136a5601883614018565b91507f496e76616c6964206d6574686f64207369676e617475726500000000000000006000830152602082019050919050565b60006136e5601983614018565b91507f44657374696e6174696f6e20616c7265616479206164646564000000000000006000830152602082019050919050565b6000613725601d83614018565b91507f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006000830152602082019050919050565b6000613765602a83614018565b91507f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008301527f6f742073756363656564000000000000000000000000000000000000000000006020830152604082019050919050565b60006137cb601d83614018565b91507f437265617465323a20696e73756666696369656e742062616c616e63650000006000830152602082019050919050565b600061380b601983614018565b91507f546172676574206d757374206265206120636f6e7472616374000000000000006000830152602082019050919050565b60c0820160008201516138546000850182613043565b5060208201516138676020850182613043565b50604082015161387a6040850182613043565b50606082015161388d60608501826138b9565b5060808201516138a060808501826138b9565b5060a08201516138b360a08501826138b9565b50505050565b6138c28161416b565b82525050565b6138d18161416b565b82525050565b60006138e382876130e5565b600a820191506138f382866130e5565b600a82019150613903828561312a565b60148201915061391382846130fc565b600f8201915081905095945050505050565b60006139318287613113565b6001820191506139418286613061565b6014820191506139518285613150565b6020820191506139618284613150565b60208201915081905095945050505050565b6000613980828486613167565b91508190509392505050565b6000613998828461318c565b915081905092915050565b60006139b0828486613208565b91508190509392505050565b60006020820190506139d16000830184613052565b92915050565b6000610160820190506139ed600083018e613052565b6139fa602083018d613052565b613a07604083018c613052565b613a14606083018b613052565b613a21608083018a6138c8565b613a2e60a08301896138c8565b613a3b60c08301886138c8565b613a4860e08301876138c8565b613a566101008301866138c8565b613a646101208301856138c8565b613a726101408301846131cc565b9c9b505050505050505050505050565b600061010082019050613a986000830186613052565b613aa56020830185613052565b613ab2604083018461383e565b949350505050565b6000606082019050613acf6000830186613052565b613adc6020830185613052565b613ae960408301846138c8565b949350505050565b6000604082019050613b066000830185613052565b613b1360208301846138c8565b9392505050565b600061010082019050613b30600083018b613052565b613b3d602083018a6138c8565b613b4a60408301896138c8565b613b5760608301886138c8565b613b6460808301876138c8565b613b7160a08301866138c8565b613b7e60c08301856138c8565b613b8b60e08301846131cc565b9998505050505050505050565b60006020820190508181036000830152613bb28184613078565b905092915050565b6000602082019050613bcf60008301846130d6565b92915050565b6000608082019050613bea6000830187613141565b613bf760208301866138c8565b613c0460408301856138c8565b613c1160608301846138c8565b95945050505050565b6000602082019050613c2f60008301846131bd565b92915050565b60006020820190508181036000830152613c508184866131db565b90509392505050565b60006020820190508181036000830152613c73818461322d565b905092915050565b60006020820190508181036000830152613c9481613266565b9050919050565b60006020820190508181036000830152613cb4816132cc565b9050919050565b60006020820190508181036000830152613cd48161330c565b9050919050565b60006020820190508181036000830152613cf48161334c565b9050919050565b60006020820190508181036000830152613d148161338c565b9050919050565b60006020820190508181036000830152613d34816133cc565b9050919050565b60006020820190508181036000830152613d5481613432565b9050919050565b60006020820190508181036000830152613d7481613472565b9050919050565b60006020820190508181036000830152613d94816134d8565b9050919050565b60006020820190508181036000830152613db481613518565b9050919050565b60006020820190508181036000830152613dd481613558565b9050919050565b60006020820190508181036000830152613df481613598565b9050919050565b60006020820190508181036000830152613e14816135d8565b9050919050565b60006020820190508181036000830152613e3481613618565b9050919050565b60006020820190508181036000830152613e5481613658565b9050919050565b60006020820190508181036000830152613e7481613698565b9050919050565b60006020820190508181036000830152613e94816136d8565b9050919050565b60006020820190508181036000830152613eb481613718565b9050919050565b60006020820190508181036000830152613ed481613758565b9050919050565b60006020820190508181036000830152613ef4816137be565b9050919050565b60006020820190508181036000830152613f14816137fe565b9050919050565b6000602082019050613f3060008301846138c8565b92915050565b60008083356001602003843603038112613f4f57600080fd5b80840192508235915067ffffffffffffffff821115613f6d57600080fd5b602083019250600182023603831315613f8557600080fd5b509250929050565b6000604051905081810181811067ffffffffffffffff82111715613fb457613fb3614243565b5b8060405250919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b600061403f8261414b565b9050919050565b60008115159050919050565b60007fff0000000000000000000000000000000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffff0000000000000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffffffffffffff000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffffffffffffffffffffffff00000000000000000000000082169050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600081905061414682614263565b919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600061418082614187565b9050919050565b60006141928261414b565b9050919050565b60006141a482614138565b9050919050565b82818337600083830152505050565b60005b838110156141d85780820151818401526020810190506141bd565b838111156141e7576000848401525b50505050565b60006141f882614231565b9050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b600061423c82614256565b9050919050565bfe5b6000601f19601f8301169050919050565b60008160601b9050919050565b6003811061427457614273614243565b5b50565b61428081614034565b811461428b57600080fd5b50565b61429781614046565b81146142a257600080fd5b50565b6142ae81614102565b81146142b957600080fd5b50565b6142c58161410c565b81146142d057600080fd5b50565b600381106142e057600080fd5b50565b6142ec8161416b565b81146142f757600080fd5b5056fea264697066735822122010f167ec85dbd4b07aedb6960f9f6ac5ae1b0f5473409617dcd319393591837164736f6c63430007030033", + "devdoc": { + "events": { + "LockedTokensReceivedFromL1(address,address,uint256)": { + "details": "Emitted when locked tokens are received from L1 (whether the wallet had already been received or not)" + }, + "TokenLockCreatedFromL1(address,bytes32,address,uint256,uint256,uint256,address)": { + "details": "Event emitted when a wallet is received and created from L1" + } + }, + "kind": "dev", + "methods": { + "addTokenDestination(address)": { + "params": { + "_dst": "Destination address" + } + }, + "constructor": { + "params": { + "_graphToken": "Address of the L2 GRT token contract", + "_l1TransferTool": "Address of the L1 transfer tool contract (in L1, without aliasing)", + "_l2Gateway": "Address of the L2GraphTokenGateway contract", + "_masterCopy": "Address of the master copy of the L2GraphTokenLockWallet implementation" + } + }, + "createTokenLockWallet(address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)": { + "params": { + "_beneficiary": "Address of the beneficiary of locked tokens", + "_endTime": "End time of the release schedule", + "_managedAmount": "Amount of tokens to be managed by the lock contract", + "_owner": "Address of the contract owner", + "_periods": "Number of periods between start time and end time", + "_releaseStartTime": "Override time for when the releases start", + "_revocable": "Whether the contract is revocable", + "_startTime": "Start time of the release schedule" + } + }, + "deposit(uint256)": { + "details": "Even if the ERC20 token can be transferred directly to the contract this function provide a safe interface to do the transfer and avoid mistakes", + "params": { + "_amount": "Amount to deposit" + } + }, + "getAuthFunctionCallTarget(bytes4)": { + "params": { + "_sigHash": "Function signature hash" + }, + "returns": { + "_0": "Address of the target contract where to send the call" + } + }, + "getDeploymentAddress(bytes32,address,address)": { + "params": { + "_deployer": "Address of the deployer that creates the contract", + "_implementation": "Address of the proxy target implementation", + "_salt": "Bytes32 salt to use for CREATE2" + }, + "returns": { + "_0": "Address of the counterfactual MinimalProxy" + } + }, + "getTokenDestinations()": { + "returns": { + "_0": "Array of addresses authorized to pull funds from a token lock" + } + }, + "isAuthFunctionCall(bytes4)": { + "params": { + "_sigHash": "Function signature hash" + }, + "returns": { + "_0": "True if authorized" + } + }, + "isTokenDestination(address)": { + "params": { + "_dst": "Destination address" + }, + "returns": { + "_0": "True if authorized" + } + }, + "onTokenTransfer(address,uint256,bytes)": { + "details": "This function will create a new wallet if it doesn't exist yet, or send the tokens to the existing wallet if it does.", + "params": { + "_amount": "Amount of tokens received", + "_data": "Encoded data of the transferred wallet, which must be an ABI-encoded TransferredWalletData struct", + "_from": "Address of the sender in L1, which must be the L1GraphTokenLockTransferTool" + } + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "removeTokenDestination(address)": { + "params": { + "_dst": "Destination address" + } + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." + }, + "setAuthFunctionCall(string,address)": { + "details": "Input expected is the function signature as 'transfer(address,uint256)'", + "params": { + "_signature": "Function signature", + "_target": "Address of the destination contract to call" + } + }, + "setAuthFunctionCallMany(string[],address[])": { + "details": "Input expected is the function signature as 'transfer(address,uint256)'", + "params": { + "_signatures": "Function signatures", + "_targets": "Address of the destination contract to call" + } + }, + "setMasterCopy(address)": { + "params": { + "_masterCopy": "Address of contract bytecode to factory clone" + } + }, + "token()": { + "returns": { + "_0": "Token used for transfers and approvals" + } + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + }, + "unsetAuthFunctionCall(string)": { + "details": "Input expected is the function signature as 'transfer(address,uint256)'", + "params": { + "_signature": "Function signature" + } + }, + "withdraw(uint256)": { + "details": "Escape hatch in case of mistakes or to recover remaining funds", + "params": { + "_amount": "Amount of tokens to withdraw" + } + } + }, + "title": "L2GraphTokenLockManager", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "addTokenDestination(address)": { + "notice": "Adds an address that can be allowed by a token lock to pull funds" + }, + "constructor": { + "notice": "Constructor for the L2GraphTokenLockManager contract." + }, + "createTokenLockWallet(address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)": { + "notice": "Creates and fund a new token lock wallet using a minimum proxy" + }, + "deposit(uint256)": { + "notice": "Deposits tokens into the contract" + }, + "getAuthFunctionCallTarget(bytes4)": { + "notice": "Gets the target contract to call for a particular function signature" + }, + "getDeploymentAddress(bytes32,address,address)": { + "notice": "Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation" + }, + "getTokenDestinations()": { + "notice": "Returns an array of authorized destination addresses" + }, + "isAuthFunctionCall(bytes4)": { + "notice": "Returns true if the function call is authorized" + }, + "isTokenDestination(address)": { + "notice": "Returns True if the address is authorized to be a destination of tokens" + }, + "l1TransferTool()": { + "notice": "Address of the L1 transfer tool contract (in L1, no aliasing)" + }, + "l1WalletToL2Wallet(address)": { + "notice": "Mapping of each L1 wallet to its L2 wallet counterpart (populated when each wallet is received) L1 address => L2 address" + }, + "l2Gateway()": { + "notice": "Address of the L2GraphTokenGateway" + }, + "l2WalletToL1Wallet(address)": { + "notice": "Mapping of each L2 wallet to its L1 wallet counterpart (populated when each wallet is received) L2 address => L1 address" + }, + "onTokenTransfer(address,uint256,bytes)": { + "notice": "This function is called by the L2GraphTokenGateway when tokens are sent from L1." + }, + "removeTokenDestination(address)": { + "notice": "Removes an address that can be allowed by a token lock to pull funds" + }, + "setAuthFunctionCall(string,address)": { + "notice": "Sets an authorized function call to target" + }, + "setAuthFunctionCallMany(string[],address[])": { + "notice": "Sets an authorized function call to target in bulk" + }, + "setMasterCopy(address)": { + "notice": "Sets the masterCopy bytecode to use to create clones of TokenLock contracts" + }, + "token()": { + "notice": "Gets the GRT token address" + }, + "unsetAuthFunctionCall(string)": { + "notice": "Unsets an authorized function call to target" + }, + "withdraw(uint256)": { + "notice": "Withdraws tokens from the contract" + } + }, + "notice": "This contract manages a list of authorized function calls and targets that can be called by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts. This contract receives funds to make the process of creating TokenLockWallet contracts easier by distributing them the initial tokens to be managed. In particular, this L2 variant is designed to receive token lock wallets from L1, through the GRT bridge. These transferred wallets will not allow releasing funds in L2 until the end of the vesting timeline, but they can allow withdrawing funds back to L1 using the L2GraphTokenLockTransferTool contract. The owner can setup a list of token destinations that will be used by TokenLock contracts to approve the pulling of funds, this way in can be guaranteed that only protocol contracts will manipulate users funds.", + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 672, + "contract": "contracts/L2GraphTokenLockManager.sol:L2GraphTokenLockManager", + "label": "_owner", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 3988, + "contract": "contracts/L2GraphTokenLockManager.sol:L2GraphTokenLockManager", + "label": "authFnCalls", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_bytes4,t_address)" + }, + { + "astId": 3990, + "contract": "contracts/L2GraphTokenLockManager.sol:L2GraphTokenLockManager", + "label": "_tokenDestinations", + "offset": 0, + "slot": "2", + "type": "t_struct(AddressSet)2629_storage" + }, + { + "astId": 3992, + "contract": "contracts/L2GraphTokenLockManager.sol:L2GraphTokenLockManager", + "label": "masterCopy", + "offset": 0, + "slot": "4", + "type": "t_address" + }, + { + "astId": 3994, + "contract": "contracts/L2GraphTokenLockManager.sol:L2GraphTokenLockManager", + "label": "_token", + "offset": 0, + "slot": "5", + "type": "t_contract(IERC20)1710" + }, + { + "astId": 6154, + "contract": "contracts/L2GraphTokenLockManager.sol:L2GraphTokenLockManager", + "label": "l1WalletToL2Wallet", + "offset": 0, + "slot": "6", + "type": "t_mapping(t_address,t_address)" + }, + { + "astId": 6159, + "contract": "contracts/L2GraphTokenLockManager.sol:L2GraphTokenLockManager", + "label": "l2WalletToL1Wallet", + "offset": 0, + "slot": "7", + "type": "t_mapping(t_address,t_address)" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_bytes32)dyn_storage": { + "base": "t_bytes32", + "encoding": "dynamic_array", + "label": "bytes32[]", + "numberOfBytes": "32" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_bytes4": { + "encoding": "inplace", + "label": "bytes4", + "numberOfBytes": "4" + }, + "t_contract(IERC20)1710": { + "encoding": "inplace", + "label": "contract IERC20", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_address)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => address)", + "numberOfBytes": "32", + "value": "t_address" + }, + "t_mapping(t_bytes32,t_uint256)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_mapping(t_bytes4,t_address)": { + "encoding": "mapping", + "key": "t_bytes4", + "label": "mapping(bytes4 => address)", + "numberOfBytes": "32", + "value": "t_address" + }, + "t_struct(AddressSet)2629_storage": { + "encoding": "inplace", + "label": "struct EnumerableSet.AddressSet", + "members": [ + { + "astId": 2628, + "contract": "contracts/L2GraphTokenLockManager.sol:L2GraphTokenLockManager", + "label": "_inner", + "offset": 0, + "slot": "0", + "type": "t_struct(Set)2364_storage" + } + ], + "numberOfBytes": "64" + }, + "t_struct(Set)2364_storage": { + "encoding": "inplace", + "label": "struct EnumerableSet.Set", + "members": [ + { + "astId": 2359, + "contract": "contracts/L2GraphTokenLockManager.sol:L2GraphTokenLockManager", + "label": "_values", + "offset": 0, + "slot": "0", + "type": "t_array(t_bytes32)dyn_storage" + }, + { + "astId": 2363, + "contract": "contracts/L2GraphTokenLockManager.sol:L2GraphTokenLockManager", + "label": "_indexes", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_bytes32,t_uint256)" + } + ], + "numberOfBytes": "64" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} \ No newline at end of file diff --git a/packages/token-distribution/deployments/arbitrum-one/L2GraphTokenLockTransferTool.json b/packages/token-distribution/deployments/arbitrum-one/L2GraphTokenLockTransferTool.json new file mode 100644 index 000000000..d79990d2d --- /dev/null +++ b/packages/token-distribution/deployments/arbitrum-one/L2GraphTokenLockTransferTool.json @@ -0,0 +1,110 @@ +{ + "address": "0x23C9c8575E6bA0349a497b6D0E8F0b9239e68028", + "abi": [ + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_graphToken", + "type": "address" + }, + { + "internalType": "contract ITokenGateway", + "name": "_l2Gateway", + "type": "address" + }, + { + "internalType": "address", + "name": "_l1GraphToken", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "l1Wallet", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "l2Wallet", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "l2LockManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "LockedFundsSentToL1", + "type": "event" + }, + { + "inputs": [], + "name": "graphToken", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "l1GraphToken", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "l2Gateway", + "outputs": [ + { + "internalType": "contract ITokenGateway", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "withdrawToL1Locked", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0xecb5b61a0d6fbca8f01174fea87d34172d4321650ba0566b0a9c87c7eca8df73" +} \ No newline at end of file diff --git a/packages/token-distribution/deployments/arbitrum-one/L2GraphTokenLockWallet.json b/packages/token-distribution/deployments/arbitrum-one/L2GraphTokenLockWallet.json new file mode 100644 index 000000000..f80fc8a4b --- /dev/null +++ b/packages/token-distribution/deployments/arbitrum-one/L2GraphTokenLockWallet.json @@ -0,0 +1,1156 @@ +{ + "address": "0x6864Cdd6D69Dbef02E5e06c5534b20fdaf8b51b0", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "newBeneficiary", + "type": "address" + } + ], + "name": "BeneficiaryChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "LockAccepted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "LockCanceled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_oldManager", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "_newManager", + "type": "address" + } + ], + "name": "ManagerUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "TokenDestinationsApproved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "TokenDestinationsRevoked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensReleased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensRevoked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensWithdrawn", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "acceptLock", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "amountPerPeriod", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "approveProtocol", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "availableAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "beneficiary", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "cancelLock", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newBeneficiary", + "type": "address" + } + ], + "name": "changeBeneficiary", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "currentBalance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "currentPeriod", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "currentTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "duration", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "endTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_manager", + "type": "address" + }, + { + "internalType": "address", + "name": "_owner", + "type": "address" + }, + { + "internalType": "address", + "name": "_beneficiary", + "type": "address" + }, + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_managedAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_startTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_endTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_periods", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_releaseStartTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_vestingCliffTime", + "type": "uint256" + }, + { + "internalType": "enum IGraphTokenLock.Revocability", + "name": "_revocable", + "type": "uint8" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_manager", + "type": "address" + }, + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "components": [ + { + "internalType": "address", + "name": "l1Address", + "type": "address" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "internalType": "uint256", + "name": "managedAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "startTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "endTime", + "type": "uint256" + } + ], + "internalType": "struct L2GraphTokenLockManager.TransferredWalletData", + "name": "_walletData", + "type": "tuple" + } + ], + "name": "initializeFromL1", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "isAccepted", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isInitialized", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isRevoked", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "managedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "manager", + "outputs": [ + { + "internalType": "contract IGraphTokenLockManager", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "passedPeriods", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "periodDuration", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "periods", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "releasableAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "release", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "releaseStartTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "releasedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "revocable", + "outputs": [ + { + "internalType": "enum IGraphTokenLock.Revocability", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "revoke", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "revokeProtocol", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "revokedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newManager", + "type": "address" + } + ], + "name": "setManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "sinceStartTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "startTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "surplusAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "token", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalOutstandingAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "usedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "vestedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "vestingCliffTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "withdrawSurplus", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0x62d5d07e799bf37a4758be9f534d365caaf94bffd008ce65ff686ab50ca7c959", + "receipt": { + "to": null, + "from": "0x4528FD7868c91Ef64B9907450Ee8d82dC639612c", + "contractAddress": "0x6864Cdd6D69Dbef02E5e06c5534b20fdaf8b51b0", + "transactionIndex": 1, + "gasUsed": "40523081", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x53f3c15e6c6c7a7b162732859ee6c5066dc3a3a2c97b93157c5ad03c9967f636", + "transactionHash": "0x62d5d07e799bf37a4758be9f534d365caaf94bffd008ce65ff686ab50ca7c959", + "logs": [], + "blockNumber": 113551330, + "cumulativeGasUsed": "40523081", + "status": 1, + "byzantium": true + }, + "args": [], + "solcInputHash": "b5cdad58099d39cd1aed000b2fd864d8", + "metadata": "{\"compiler\":{\"version\":\"0.7.3+commit.9bfce1f6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newBeneficiary\",\"type\":\"address\"}],\"name\":\"BeneficiaryChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"LockAccepted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"LockCanceled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_oldManager\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_newManager\",\"type\":\"address\"}],\"name\":\"ManagerUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"TokenDestinationsApproved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"TokenDestinationsRevoked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensReleased\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensRevoked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensWithdrawn\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"acceptLock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"amountPerPeriod\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"approveProtocol\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"availableAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"beneficiary\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"cancelLock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_newBeneficiary\",\"type\":\"address\"}],\"name\":\"changeBeneficiary\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"currentBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"currentPeriod\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"currentTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"duration\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"endTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_manager\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_beneficiary\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_managedAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_startTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_endTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_periods\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_releaseStartTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_vestingCliffTime\",\"type\":\"uint256\"},{\"internalType\":\"enum IGraphTokenLock.Revocability\",\"name\":\"_revocable\",\"type\":\"uint8\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_manager\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_token\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"l1Address\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"managedAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"startTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"endTime\",\"type\":\"uint256\"}],\"internalType\":\"struct L2GraphTokenLockManager.TransferredWalletData\",\"name\":\"_walletData\",\"type\":\"tuple\"}],\"name\":\"initializeFromL1\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isAccepted\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isInitialized\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isRevoked\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"managedAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"manager\",\"outputs\":[{\"internalType\":\"contract IGraphTokenLockManager\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"passedPeriods\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"periodDuration\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"periods\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"releasableAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"release\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"releaseStartTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"releasedAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"revocable\",\"outputs\":[{\"internalType\":\"enum IGraphTokenLock.Revocability\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"revoke\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"revokeProtocol\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"revokedAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_newManager\",\"type\":\"address\"}],\"name\":\"setManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"sinceStartTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"startTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"surplusAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalOutstandingAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"usedAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"vestedAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"vestingCliffTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdrawSurplus\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"acceptLock()\":{\"details\":\"Can only be called by the beneficiary\"},\"amountPerPeriod()\":{\"returns\":{\"_0\":\"Amount of tokens available after each period\"}},\"approveProtocol()\":{\"details\":\"Approves all token destinations registered in the manager to pull tokens\"},\"availableAmount()\":{\"details\":\"Implements the step-by-step schedule based on periods for available tokens\",\"returns\":{\"_0\":\"Amount of tokens available according to the schedule\"}},\"cancelLock()\":{\"details\":\"Can only be called by the owner\"},\"changeBeneficiary(address)\":{\"details\":\"Can only be called by the beneficiary\",\"params\":{\"_newBeneficiary\":\"Address of the new beneficiary address\"}},\"currentBalance()\":{\"returns\":{\"_0\":\"Tokens held in the contract\"}},\"currentPeriod()\":{\"returns\":{\"_0\":\"A number that represents the current period\"}},\"currentTime()\":{\"returns\":{\"_0\":\"Current block timestamp\"}},\"duration()\":{\"returns\":{\"_0\":\"Amount of seconds from contract startTime to endTime\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"passedPeriods()\":{\"returns\":{\"_0\":\"A number of periods that passed since the schedule started\"}},\"periodDuration()\":{\"returns\":{\"_0\":\"Duration of each period in seconds\"}},\"releasableAmount()\":{\"details\":\"Considers the schedule, takes into account already released tokens and used amount\",\"returns\":{\"_0\":\"Amount of tokens ready to be released\"}},\"release()\":{\"details\":\"All available releasable tokens are transferred to beneficiary\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"revoke()\":{\"details\":\"Vesting schedule is always calculated based on managed tokens\"},\"revokeProtocol()\":{\"details\":\"Revokes approval to all token destinations in the manager to pull tokens\"},\"setManager(address)\":{\"params\":{\"_newManager\":\"Address of the new manager\"}},\"sinceStartTime()\":{\"details\":\"Returns zero if called before conctract starTime\",\"returns\":{\"_0\":\"Seconds elapsed from contract startTime\"}},\"surplusAmount()\":{\"details\":\"All funds over outstanding amount is considered surplus that can be withdrawn by beneficiary. Note this might not be the correct value for wallets transferred to L2 (i.e. an L2GraphTokenLockWallet), as the released amount will be skewed, so the beneficiary might have to bridge back to L1 to release the surplus.\",\"returns\":{\"_0\":\"Amount of tokens considered as surplus\"}},\"totalOutstandingAmount()\":{\"details\":\"Does not consider schedule but just global amounts tracked\",\"returns\":{\"_0\":\"Amount of outstanding tokens for the lifetime of the contract\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"vestedAmount()\":{\"details\":\"Similar to available amount, but is fully vested when contract is non-revocable\",\"returns\":{\"_0\":\"Amount of tokens already vested\"}},\"withdrawSurplus(uint256)\":{\"details\":\"Tokens in the contract over outstanding amount are considered as surplus\",\"params\":{\"_amount\":\"Amount of tokens to withdraw\"}}},\"title\":\"L2GraphTokenLockWallet\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"acceptLock()\":{\"notice\":\"Beneficiary accepts the lock, the owner cannot retrieve back the tokens\"},\"amountPerPeriod()\":{\"notice\":\"Returns amount available to be released after each period according to schedule\"},\"approveProtocol()\":{\"notice\":\"Approves protocol access of the tokens managed by this contract\"},\"availableAmount()\":{\"notice\":\"Gets the currently available token according to the schedule\"},\"cancelLock()\":{\"notice\":\"Owner cancel the lock and return the balance in the contract\"},\"changeBeneficiary(address)\":{\"notice\":\"Change the beneficiary of funds managed by the contract\"},\"currentBalance()\":{\"notice\":\"Returns the amount of tokens currently held by the contract\"},\"currentPeriod()\":{\"notice\":\"Gets the current period based on the schedule\"},\"currentTime()\":{\"notice\":\"Returns the current block timestamp\"},\"duration()\":{\"notice\":\"Gets duration of contract from start to end in seconds\"},\"passedPeriods()\":{\"notice\":\"Gets the number of periods that passed since the first period\"},\"periodDuration()\":{\"notice\":\"Returns the duration of each period in seconds\"},\"releasableAmount()\":{\"notice\":\"Gets tokens currently available for release\"},\"release()\":{\"notice\":\"Releases tokens based on the configured schedule\"},\"revoke()\":{\"notice\":\"Revokes a vesting schedule and return the unvested tokens to the owner\"},\"revokeProtocol()\":{\"notice\":\"Revokes protocol access of the tokens managed by this contract\"},\"setManager(address)\":{\"notice\":\"Sets a new manager for this contract\"},\"sinceStartTime()\":{\"notice\":\"Gets time elapsed since the start of the contract\"},\"surplusAmount()\":{\"notice\":\"Gets surplus amount in the contract based on outstanding amount to release\"},\"totalOutstandingAmount()\":{\"notice\":\"Gets the outstanding amount yet to be released based on the whole contract lifetime\"},\"vestedAmount()\":{\"notice\":\"Gets the amount of currently vested tokens\"},\"withdrawSurplus(uint256)\":{\"notice\":\"Withdraws surplus, unmanaged tokens from the contract\"}},\"notice\":\"This contract is built on top of the base GraphTokenLock functionality. It allows wallet beneficiaries to use the deposited funds to perform specific function calls on specific contracts. The idea is that supporters with locked tokens can participate in the protocol but disallow any release before the vesting/lock schedule. The beneficiary can issue authorized function calls to this contract that will get forwarded to a target contract. A target contract is any of our protocol contracts. The function calls allowed are queried to the GraphTokenLockManager, this way the same configuration can be shared for all the created lock wallet contracts. This L2 variant includes a special initializer so that it can be created from a wallet's data received from L1. These transferred wallets will not allow releasing funds in L2 until the end of the vesting timeline, but they can allow withdrawing funds back to L1 using the L2GraphTokenLockTransferTool contract. Note that surplusAmount and releasedAmount in L2 will be skewed for wallets received from L1, so releasing surplus tokens might also only be possible by bridging tokens back to L1. NOTE: Contracts used as target must have its function signatures checked to avoid collisions with any of this contract functions. Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience the maximum amount of tokens is authorized. Function calls do not forward ETH value so DO NOT SEND ETH TO THIS CONTRACT.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/L2GraphTokenLockWallet.sol\":\"L2GraphTokenLockWallet\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor () internal {\\n address msgSender = _msgSender();\\n _owner = msgSender;\\n emit OwnershipTransferred(address(0), msgSender);\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n emit OwnershipTransferred(_owner, address(0));\\n _owner = address(0);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n emit OwnershipTransferred(_owner, newOwner);\\n _owner = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0x15e2d5bd4c28a88548074c54d220e8086f638a71ed07e6b3ba5a70066fcf458d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/math/SafeMath.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Wrappers over Solidity's arithmetic operations with added overflow\\n * checks.\\n *\\n * Arithmetic operations in Solidity wrap on overflow. This can easily result\\n * in bugs, because programmers usually assume that an overflow raises an\\n * error, which is the standard behavior in high level programming languages.\\n * `SafeMath` restores this intuition by reverting the transaction when an\\n * operation overflows.\\n *\\n * Using this library instead of the unchecked operations eliminates an entire\\n * class of bugs, so it's recommended to use it always.\\n */\\nlibrary SafeMath {\\n /**\\n * @dev Returns the addition of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n uint256 c = a + b;\\n if (c < a) return (false, 0);\\n return (true, c);\\n }\\n\\n /**\\n * @dev Returns the substraction of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b > a) return (false, 0);\\n return (true, a - b);\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\\n if (a == 0) return (true, 0);\\n uint256 c = a * b;\\n if (c / a != b) return (false, 0);\\n return (true, c);\\n }\\n\\n /**\\n * @dev Returns the division of two unsigned integers, with a division by zero flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b == 0) return (false, 0);\\n return (true, a / b);\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b == 0) return (false, 0);\\n return (true, a % b);\\n }\\n\\n /**\\n * @dev Returns the addition of two unsigned integers, reverting on\\n * overflow.\\n *\\n * Counterpart to Solidity's `+` operator.\\n *\\n * Requirements:\\n *\\n * - Addition cannot overflow.\\n */\\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\\n uint256 c = a + b;\\n require(c >= a, \\\"SafeMath: addition overflow\\\");\\n return c;\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting on\\n * overflow (when the result is negative).\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n *\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b <= a, \\\"SafeMath: subtraction overflow\\\");\\n return a - b;\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, reverting on\\n * overflow.\\n *\\n * Counterpart to Solidity's `*` operator.\\n *\\n * Requirements:\\n *\\n * - Multiplication cannot overflow.\\n */\\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\\n if (a == 0) return 0;\\n uint256 c = a * b;\\n require(c / a == b, \\\"SafeMath: multiplication overflow\\\");\\n return c;\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers, reverting on\\n * division by zero. The result is rounded towards zero.\\n *\\n * Counterpart to Solidity's `/` operator. Note: this function uses a\\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\\n * uses an invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b > 0, \\\"SafeMath: division by zero\\\");\\n return a / b;\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * reverting when dividing by zero.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b > 0, \\\"SafeMath: modulo by zero\\\");\\n return a % b;\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\\n * overflow (when the result is negative).\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {trySub}.\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n *\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b <= a, errorMessage);\\n return a - b;\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers, reverting with custom message on\\n * division by zero. The result is rounded towards zero.\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {tryDiv}.\\n *\\n * Counterpart to Solidity's `/` operator. Note: this function uses a\\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\\n * uses an invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b > 0, errorMessage);\\n return a / b;\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * reverting with custom message when dividing by zero.\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {tryMod}.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b > 0, errorMessage);\\n return a % b;\\n }\\n}\\n\",\"keccak256\":\"0xcc78a17dd88fa5a2edc60c8489e2f405c0913b377216a5b26b35656b2d0dab52\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `recipient`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address recipient, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `sender` to `recipient` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n}\\n\",\"keccak256\":\"0x5f02220344881ce43204ae4a6281145a67bc52c2bb1290a791857df3d19d78f5\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\nimport \\\"./IERC20.sol\\\";\\nimport \\\"../../math/SafeMath.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @title SafeERC20\\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\\n * contract returns false). Tokens that return no value (and instead revert or\\n * throw on failure) are also supported, non-reverting calls are assumed to be\\n * successful.\\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\n */\\nlibrary SafeERC20 {\\n using SafeMath for uint256;\\n using Address for address;\\n\\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\\n }\\n\\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\\n }\\n\\n /**\\n * @dev Deprecated. This function has issues similar to the ones found in\\n * {IERC20-approve}, and its usage is discouraged.\\n *\\n * Whenever possible, use {safeIncreaseAllowance} and\\n * {safeDecreaseAllowance} instead.\\n */\\n function safeApprove(IERC20 token, address spender, uint256 value) internal {\\n // safeApprove should only be called when setting an initial allowance,\\n // or when resetting it to zero. To increase and decrease it, use\\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\\n // solhint-disable-next-line max-line-length\\n require((value == 0) || (token.allowance(address(this), spender) == 0),\\n \\\"SafeERC20: approve from non-zero to non-zero allowance\\\"\\n );\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\\n }\\n\\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n uint256 newAllowance = token.allowance(address(this), spender).add(value);\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n uint256 newAllowance = token.allowance(address(this), spender).sub(value, \\\"SafeERC20: decreased allowance below zero\\\");\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n */\\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that\\n // the target address contains contract code and also asserts for success in the low-level call.\\n\\n bytes memory returndata = address(token).functionCall(data, \\\"SafeERC20: low-level call failed\\\");\\n if (returndata.length > 0) { // Return data is optional\\n // solhint-disable-next-line max-line-length\\n require(abi.decode(returndata, (bool)), \\\"SafeERC20: ERC20 operation did not succeed\\\");\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf12dfbe97e6276980b83d2830bb0eb75e0cf4f3e626c2471137f82158ae6a0fc\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.2 <0.8.0;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize, which returns 0 for contracts in\\n // construction, since the code is only stored at the end of the\\n // constructor execution.\\n\\n uint256 size;\\n // solhint-disable-next-line no-inline-assembly\\n assembly { size := extcodesize(account) }\\n return size > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls, avoid-call-value\\n (bool success, ) = recipient.call{ value: amount }(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain`call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.call{ value: value }(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x28911e614500ae7c607a432a709d35da25f3bc5ddc8bd12b278b66358070c0ea\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/*\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with GSN meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address payable) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes memory) {\\n this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0x8d3cb350f04ff49cfb10aef08d87f19dcbaecc8027b0bed12f3275cd12f38cf0\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Create2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Helper to make usage of the `CREATE2` EVM opcode easier and safer.\\n * `CREATE2` can be used to compute in advance the address where a smart\\n * contract will be deployed, which allows for interesting new mechanisms known\\n * as 'counterfactual interactions'.\\n *\\n * See the https://eips.ethereum.org/EIPS/eip-1014#motivation[EIP] for more\\n * information.\\n */\\nlibrary Create2 {\\n /**\\n * @dev Deploys a contract using `CREATE2`. The address where the contract\\n * will be deployed can be known in advance via {computeAddress}.\\n *\\n * The bytecode for a contract can be obtained from Solidity with\\n * `type(contractName).creationCode`.\\n *\\n * Requirements:\\n *\\n * - `bytecode` must not be empty.\\n * - `salt` must have not been used for `bytecode` already.\\n * - the factory must have a balance of at least `amount`.\\n * - if `amount` is non-zero, `bytecode` must have a `payable` constructor.\\n */\\n function deploy(uint256 amount, bytes32 salt, bytes memory bytecode) internal returns (address) {\\n address addr;\\n require(address(this).balance >= amount, \\\"Create2: insufficient balance\\\");\\n require(bytecode.length != 0, \\\"Create2: bytecode length is zero\\\");\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n addr := create2(amount, add(bytecode, 0x20), mload(bytecode), salt)\\n }\\n require(addr != address(0), \\\"Create2: Failed on deploy\\\");\\n return addr;\\n }\\n\\n /**\\n * @dev Returns the address where a contract will be stored if deployed via {deploy}. Any change in the\\n * `bytecodeHash` or `salt` will result in a new destination address.\\n */\\n function computeAddress(bytes32 salt, bytes32 bytecodeHash) internal view returns (address) {\\n return computeAddress(salt, bytecodeHash, address(this));\\n }\\n\\n /**\\n * @dev Returns the address where a contract will be stored if deployed via {deploy} from a contract located at\\n * `deployer`. If `deployer` is this contract's address, returns the same value as {computeAddress}.\\n */\\n function computeAddress(bytes32 salt, bytes32 bytecodeHash, address deployer) internal pure returns (address) {\\n bytes32 _data = keccak256(\\n abi.encodePacked(bytes1(0xff), deployer, salt, bytecodeHash)\\n );\\n return address(uint160(uint256(_data)));\\n }\\n}\\n\",\"keccak256\":\"0x0a0b021149946014fe1cd04af11e7a937a29986c47e8b1b718c2d50d729472db\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/EnumerableSet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Library for managing\\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\\n * types.\\n *\\n * Sets have the following properties:\\n *\\n * - Elements are added, removed, and checked for existence in constant time\\n * (O(1)).\\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\\n *\\n * ```\\n * contract Example {\\n * // Add the library methods\\n * using EnumerableSet for EnumerableSet.AddressSet;\\n *\\n * // Declare a set state variable\\n * EnumerableSet.AddressSet private mySet;\\n * }\\n * ```\\n *\\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\\n * and `uint256` (`UintSet`) are supported.\\n */\\nlibrary EnumerableSet {\\n // To implement this library for multiple types with as little code\\n // repetition as possible, we write it in terms of a generic Set type with\\n // bytes32 values.\\n // The Set implementation uses private functions, and user-facing\\n // implementations (such as AddressSet) are just wrappers around the\\n // underlying Set.\\n // This means that we can only create new EnumerableSets for types that fit\\n // in bytes32.\\n\\n struct Set {\\n // Storage of set values\\n bytes32[] _values;\\n\\n // Position of the value in the `values` array, plus 1 because index 0\\n // means a value is not in the set.\\n mapping (bytes32 => uint256) _indexes;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function _add(Set storage set, bytes32 value) private returns (bool) {\\n if (!_contains(set, value)) {\\n set._values.push(value);\\n // The value is stored at length-1, but we add 1 to all indexes\\n // and use 0 as a sentinel value\\n set._indexes[value] = set._values.length;\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function _remove(Set storage set, bytes32 value) private returns (bool) {\\n // We read and store the value's index to prevent multiple reads from the same storage slot\\n uint256 valueIndex = set._indexes[value];\\n\\n if (valueIndex != 0) { // Equivalent to contains(set, value)\\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\\n // the array, and then remove the last element (sometimes called as 'swap and pop').\\n // This modifies the order of the array, as noted in {at}.\\n\\n uint256 toDeleteIndex = valueIndex - 1;\\n uint256 lastIndex = set._values.length - 1;\\n\\n // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs\\n // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.\\n\\n bytes32 lastvalue = set._values[lastIndex];\\n\\n // Move the last value to the index where the value to delete is\\n set._values[toDeleteIndex] = lastvalue;\\n // Update the index for the moved value\\n set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based\\n\\n // Delete the slot where the moved value was stored\\n set._values.pop();\\n\\n // Delete the index for the deleted slot\\n delete set._indexes[value];\\n\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\\n return set._indexes[value] != 0;\\n }\\n\\n /**\\n * @dev Returns the number of values on the set. O(1).\\n */\\n function _length(Set storage set) private view returns (uint256) {\\n return set._values.length;\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\\n require(set._values.length > index, \\\"EnumerableSet: index out of bounds\\\");\\n return set._values[index];\\n }\\n\\n // Bytes32Set\\n\\n struct Bytes32Set {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _add(set._inner, value);\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _remove(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\\n return _contains(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(Bytes32Set storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\\n return _at(set._inner, index);\\n }\\n\\n // AddressSet\\n\\n struct AddressSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(AddressSet storage set, address value) internal returns (bool) {\\n return _add(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(AddressSet storage set, address value) internal returns (bool) {\\n return _remove(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(AddressSet storage set, address value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(AddressSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\\n return address(uint160(uint256(_at(set._inner, index))));\\n }\\n\\n\\n // UintSet\\n\\n struct UintSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(UintSet storage set, uint256 value) internal returns (bool) {\\n return _add(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\\n return _remove(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns the number of values on the set. O(1).\\n */\\n function length(UintSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\\n return uint256(_at(set._inner, index));\\n }\\n}\\n\",\"keccak256\":\"0x1562cd9922fbf739edfb979f506809e2743789cbde3177515542161c3d04b164\",\"license\":\"MIT\"},\"contracts/GraphTokenLock.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nimport \\\"@openzeppelin/contracts/math/SafeMath.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\\\";\\n\\nimport { Ownable as OwnableInitializable } from \\\"./Ownable.sol\\\";\\nimport \\\"./MathUtils.sol\\\";\\nimport \\\"./IGraphTokenLock.sol\\\";\\n\\n/**\\n * @title GraphTokenLock\\n * @notice Contract that manages an unlocking schedule of tokens.\\n * @dev The contract lock manage a number of tokens deposited into the contract to ensure that\\n * they can only be released under certain time conditions.\\n *\\n * This contract implements a release scheduled based on periods and tokens are released in steps\\n * after each period ends. It can be configured with one period in which case it is like a plain TimeLock.\\n * It also supports revocation to be used for vesting schedules.\\n *\\n * The contract supports receiving extra funds than the managed tokens ones that can be\\n * withdrawn by the beneficiary at any time.\\n *\\n * A releaseStartTime parameter is included to override the default release schedule and\\n * perform the first release on the configured time. After that it will continue with the\\n * default schedule.\\n */\\nabstract contract GraphTokenLock is OwnableInitializable, IGraphTokenLock {\\n using SafeMath for uint256;\\n using SafeERC20 for IERC20;\\n\\n uint256 private constant MIN_PERIOD = 1;\\n\\n // -- State --\\n\\n IERC20 public token;\\n address public beneficiary;\\n\\n // Configuration\\n\\n // Amount of tokens managed by the contract schedule\\n uint256 public managedAmount;\\n\\n uint256 public startTime; // Start datetime (in unixtimestamp)\\n uint256 public endTime; // Datetime after all funds are fully vested/unlocked (in unixtimestamp)\\n uint256 public periods; // Number of vesting/release periods\\n\\n // First release date for tokens (in unixtimestamp)\\n // If set, no tokens will be released before releaseStartTime ignoring\\n // the amount to release each period\\n uint256 public releaseStartTime;\\n // A cliff set a date to which a beneficiary needs to get to vest\\n // all preceding periods\\n uint256 public vestingCliffTime;\\n Revocability public revocable; // Whether to use vesting for locked funds\\n\\n // State\\n\\n bool public isRevoked;\\n bool public isInitialized;\\n bool public isAccepted;\\n uint256 public releasedAmount;\\n uint256 public revokedAmount;\\n\\n // -- Events --\\n\\n event TokensReleased(address indexed beneficiary, uint256 amount);\\n event TokensWithdrawn(address indexed beneficiary, uint256 amount);\\n event TokensRevoked(address indexed beneficiary, uint256 amount);\\n event BeneficiaryChanged(address newBeneficiary);\\n event LockAccepted();\\n event LockCanceled();\\n\\n /**\\n * @dev Only allow calls from the beneficiary of the contract\\n */\\n modifier onlyBeneficiary() {\\n require(msg.sender == beneficiary, \\\"!auth\\\");\\n _;\\n }\\n\\n /**\\n * @notice Initializes the contract\\n * @param _owner Address of the contract owner\\n * @param _beneficiary Address of the beneficiary of locked tokens\\n * @param _managedAmount Amount of tokens to be managed by the lock contract\\n * @param _startTime Start time of the release schedule\\n * @param _endTime End time of the release schedule\\n * @param _periods Number of periods between start time and end time\\n * @param _releaseStartTime Override time for when the releases start\\n * @param _vestingCliffTime Override time for when the vesting start\\n * @param _revocable Whether the contract is revocable\\n */\\n function _initialize(\\n address _owner,\\n address _beneficiary,\\n address _token,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n Revocability _revocable\\n ) internal {\\n require(!isInitialized, \\\"Already initialized\\\");\\n require(_owner != address(0), \\\"Owner cannot be zero\\\");\\n require(_beneficiary != address(0), \\\"Beneficiary cannot be zero\\\");\\n require(_token != address(0), \\\"Token cannot be zero\\\");\\n require(_managedAmount > 0, \\\"Managed tokens cannot be zero\\\");\\n require(_startTime != 0, \\\"Start time must be set\\\");\\n require(_startTime < _endTime, \\\"Start time > end time\\\");\\n require(_periods >= MIN_PERIOD, \\\"Periods cannot be below minimum\\\");\\n require(_revocable != Revocability.NotSet, \\\"Must set a revocability option\\\");\\n require(_releaseStartTime < _endTime, \\\"Release start time must be before end time\\\");\\n require(_vestingCliffTime < _endTime, \\\"Cliff time must be before end time\\\");\\n\\n isInitialized = true;\\n\\n OwnableInitializable._initialize(_owner);\\n beneficiary = _beneficiary;\\n token = IERC20(_token);\\n\\n managedAmount = _managedAmount;\\n\\n startTime = _startTime;\\n endTime = _endTime;\\n periods = _periods;\\n\\n // Optionals\\n releaseStartTime = _releaseStartTime;\\n vestingCliffTime = _vestingCliffTime;\\n revocable = _revocable;\\n }\\n\\n /**\\n * @notice Change the beneficiary of funds managed by the contract\\n * @dev Can only be called by the beneficiary\\n * @param _newBeneficiary Address of the new beneficiary address\\n */\\n function changeBeneficiary(address _newBeneficiary) external onlyBeneficiary {\\n require(_newBeneficiary != address(0), \\\"Empty beneficiary\\\");\\n beneficiary = _newBeneficiary;\\n emit BeneficiaryChanged(_newBeneficiary);\\n }\\n\\n /**\\n * @notice Beneficiary accepts the lock, the owner cannot retrieve back the tokens\\n * @dev Can only be called by the beneficiary\\n */\\n function acceptLock() external onlyBeneficiary {\\n isAccepted = true;\\n emit LockAccepted();\\n }\\n\\n /**\\n * @notice Owner cancel the lock and return the balance in the contract\\n * @dev Can only be called by the owner\\n */\\n function cancelLock() external onlyOwner {\\n require(isAccepted == false, \\\"Cannot cancel accepted contract\\\");\\n\\n token.safeTransfer(owner(), currentBalance());\\n\\n emit LockCanceled();\\n }\\n\\n // -- Balances --\\n\\n /**\\n * @notice Returns the amount of tokens currently held by the contract\\n * @return Tokens held in the contract\\n */\\n function currentBalance() public view override returns (uint256) {\\n return token.balanceOf(address(this));\\n }\\n\\n // -- Time & Periods --\\n\\n /**\\n * @notice Returns the current block timestamp\\n * @return Current block timestamp\\n */\\n function currentTime() public view override returns (uint256) {\\n return block.timestamp;\\n }\\n\\n /**\\n * @notice Gets duration of contract from start to end in seconds\\n * @return Amount of seconds from contract startTime to endTime\\n */\\n function duration() public view override returns (uint256) {\\n return endTime.sub(startTime);\\n }\\n\\n /**\\n * @notice Gets time elapsed since the start of the contract\\n * @dev Returns zero if called before conctract starTime\\n * @return Seconds elapsed from contract startTime\\n */\\n function sinceStartTime() public view override returns (uint256) {\\n uint256 current = currentTime();\\n if (current <= startTime) {\\n return 0;\\n }\\n return current.sub(startTime);\\n }\\n\\n /**\\n * @notice Returns amount available to be released after each period according to schedule\\n * @return Amount of tokens available after each period\\n */\\n function amountPerPeriod() public view override returns (uint256) {\\n return managedAmount.div(periods);\\n }\\n\\n /**\\n * @notice Returns the duration of each period in seconds\\n * @return Duration of each period in seconds\\n */\\n function periodDuration() public view override returns (uint256) {\\n return duration().div(periods);\\n }\\n\\n /**\\n * @notice Gets the current period based on the schedule\\n * @return A number that represents the current period\\n */\\n function currentPeriod() public view override returns (uint256) {\\n return sinceStartTime().div(periodDuration()).add(MIN_PERIOD);\\n }\\n\\n /**\\n * @notice Gets the number of periods that passed since the first period\\n * @return A number of periods that passed since the schedule started\\n */\\n function passedPeriods() public view override returns (uint256) {\\n return currentPeriod().sub(MIN_PERIOD);\\n }\\n\\n // -- Locking & Release Schedule --\\n\\n /**\\n * @notice Gets the currently available token according to the schedule\\n * @dev Implements the step-by-step schedule based on periods for available tokens\\n * @return Amount of tokens available according to the schedule\\n */\\n function availableAmount() public view override returns (uint256) {\\n uint256 current = currentTime();\\n\\n // Before contract start no funds are available\\n if (current < startTime) {\\n return 0;\\n }\\n\\n // After contract ended all funds are available\\n if (current > endTime) {\\n return managedAmount;\\n }\\n\\n // Get available amount based on period\\n return passedPeriods().mul(amountPerPeriod());\\n }\\n\\n /**\\n * @notice Gets the amount of currently vested tokens\\n * @dev Similar to available amount, but is fully vested when contract is non-revocable\\n * @return Amount of tokens already vested\\n */\\n function vestedAmount() public view override returns (uint256) {\\n // If non-revocable it is fully vested\\n if (revocable == Revocability.Disabled) {\\n return managedAmount;\\n }\\n\\n // Vesting cliff is activated and it has not passed means nothing is vested yet\\n if (vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\\n return 0;\\n }\\n\\n return availableAmount();\\n }\\n\\n /**\\n * @notice Gets tokens currently available for release\\n * @dev Considers the schedule and takes into account already released tokens\\n * @return Amount of tokens ready to be released\\n */\\n function releasableAmount() public view virtual override returns (uint256) {\\n // If a release start time is set no tokens are available for release before this date\\n // If not set it follows the default schedule and tokens are available on\\n // the first period passed\\n if (releaseStartTime > 0 && currentTime() < releaseStartTime) {\\n return 0;\\n }\\n\\n // Vesting cliff is activated and it has not passed means nothing is vested yet\\n // so funds cannot be released\\n if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\\n return 0;\\n }\\n\\n // A beneficiary can never have more releasable tokens than the contract balance\\n uint256 releasable = availableAmount().sub(releasedAmount);\\n return MathUtils.min(currentBalance(), releasable);\\n }\\n\\n /**\\n * @notice Gets the outstanding amount yet to be released based on the whole contract lifetime\\n * @dev Does not consider schedule but just global amounts tracked\\n * @return Amount of outstanding tokens for the lifetime of the contract\\n */\\n function totalOutstandingAmount() public view override returns (uint256) {\\n return managedAmount.sub(releasedAmount).sub(revokedAmount);\\n }\\n\\n /**\\n * @notice Gets surplus amount in the contract based on outstanding amount to release\\n * @dev All funds over outstanding amount is considered surplus that can be withdrawn by beneficiary.\\n * Note this might not be the correct value for wallets transferred to L2 (i.e. an L2GraphTokenLockWallet), as the released amount will be\\n * skewed, so the beneficiary might have to bridge back to L1 to release the surplus.\\n * @return Amount of tokens considered as surplus\\n */\\n function surplusAmount() public view override returns (uint256) {\\n uint256 balance = currentBalance();\\n uint256 outstandingAmount = totalOutstandingAmount();\\n if (balance > outstandingAmount) {\\n return balance.sub(outstandingAmount);\\n }\\n return 0;\\n }\\n\\n // -- Value Transfer --\\n\\n /**\\n * @notice Releases tokens based on the configured schedule\\n * @dev All available releasable tokens are transferred to beneficiary\\n */\\n function release() external override onlyBeneficiary {\\n uint256 amountToRelease = releasableAmount();\\n require(amountToRelease > 0, \\\"No available releasable amount\\\");\\n\\n releasedAmount = releasedAmount.add(amountToRelease);\\n\\n token.safeTransfer(beneficiary, amountToRelease);\\n\\n emit TokensReleased(beneficiary, amountToRelease);\\n }\\n\\n /**\\n * @notice Withdraws surplus, unmanaged tokens from the contract\\n * @dev Tokens in the contract over outstanding amount are considered as surplus\\n * @param _amount Amount of tokens to withdraw\\n */\\n function withdrawSurplus(uint256 _amount) external override onlyBeneficiary {\\n require(_amount > 0, \\\"Amount cannot be zero\\\");\\n require(surplusAmount() >= _amount, \\\"Amount requested > surplus available\\\");\\n\\n token.safeTransfer(beneficiary, _amount);\\n\\n emit TokensWithdrawn(beneficiary, _amount);\\n }\\n\\n /**\\n * @notice Revokes a vesting schedule and return the unvested tokens to the owner\\n * @dev Vesting schedule is always calculated based on managed tokens\\n */\\n function revoke() external override onlyOwner {\\n require(revocable == Revocability.Enabled, \\\"Contract is non-revocable\\\");\\n require(isRevoked == false, \\\"Already revoked\\\");\\n\\n uint256 unvestedAmount = managedAmount.sub(vestedAmount());\\n require(unvestedAmount > 0, \\\"No available unvested amount\\\");\\n\\n revokedAmount = unvestedAmount;\\n isRevoked = true;\\n\\n token.safeTransfer(owner(), unvestedAmount);\\n\\n emit TokensRevoked(beneficiary, unvestedAmount);\\n }\\n}\\n\",\"keccak256\":\"0xd89470956a476c2fcf4a09625775573f95ba2c60a57fe866d90f65de1bcf5f2d\",\"license\":\"MIT\"},\"contracts/GraphTokenLockManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/EnumerableSet.sol\\\";\\nimport { Ownable } from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\n\\nimport \\\"./MinimalProxyFactory.sol\\\";\\nimport \\\"./IGraphTokenLockManager.sol\\\";\\nimport { GraphTokenLockWallet } from \\\"./GraphTokenLockWallet.sol\\\";\\n\\n/**\\n * @title GraphTokenLockManager\\n * @notice This contract manages a list of authorized function calls and targets that can be called\\n * by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts.\\n *\\n * This contract receives funds to make the process of creating TokenLockWallet contracts\\n * easier by distributing them the initial tokens to be managed.\\n *\\n * The owner can setup a list of token destinations that will be used by TokenLock contracts to\\n * approve the pulling of funds, this way in can be guaranteed that only protocol contracts\\n * will manipulate users funds.\\n */\\ncontract GraphTokenLockManager is Ownable, MinimalProxyFactory, IGraphTokenLockManager {\\n using SafeERC20 for IERC20;\\n using EnumerableSet for EnumerableSet.AddressSet;\\n\\n // -- State --\\n\\n mapping(bytes4 => address) public authFnCalls;\\n EnumerableSet.AddressSet private _tokenDestinations;\\n\\n address public masterCopy;\\n IERC20 internal _token;\\n\\n // -- Events --\\n\\n event MasterCopyUpdated(address indexed masterCopy);\\n event TokenLockCreated(\\n address indexed contractAddress,\\n bytes32 indexed initHash,\\n address indexed beneficiary,\\n address token,\\n uint256 managedAmount,\\n uint256 startTime,\\n uint256 endTime,\\n uint256 periods,\\n uint256 releaseStartTime,\\n uint256 vestingCliffTime,\\n IGraphTokenLock.Revocability revocable\\n );\\n\\n event TokensDeposited(address indexed sender, uint256 amount);\\n event TokensWithdrawn(address indexed sender, uint256 amount);\\n\\n event FunctionCallAuth(address indexed caller, bytes4 indexed sigHash, address indexed target, string signature);\\n event TokenDestinationAllowed(address indexed dst, bool allowed);\\n\\n /**\\n * Constructor.\\n * @param _graphToken Token to use for deposits and withdrawals\\n * @param _masterCopy Address of the master copy to use to clone proxies\\n */\\n constructor(IERC20 _graphToken, address _masterCopy) {\\n require(address(_graphToken) != address(0), \\\"Token cannot be zero\\\");\\n _token = _graphToken;\\n setMasterCopy(_masterCopy);\\n }\\n\\n // -- Factory --\\n\\n /**\\n * @notice Sets the masterCopy bytecode to use to create clones of TokenLock contracts\\n * @param _masterCopy Address of contract bytecode to factory clone\\n */\\n function setMasterCopy(address _masterCopy) public override onlyOwner {\\n require(_masterCopy != address(0), \\\"MasterCopy cannot be zero\\\");\\n masterCopy = _masterCopy;\\n emit MasterCopyUpdated(_masterCopy);\\n }\\n\\n /**\\n * @notice Creates and fund a new token lock wallet using a minimum proxy\\n * @param _owner Address of the contract owner\\n * @param _beneficiary Address of the beneficiary of locked tokens\\n * @param _managedAmount Amount of tokens to be managed by the lock contract\\n * @param _startTime Start time of the release schedule\\n * @param _endTime End time of the release schedule\\n * @param _periods Number of periods between start time and end time\\n * @param _releaseStartTime Override time for when the releases start\\n * @param _revocable Whether the contract is revocable\\n */\\n function createTokenLockWallet(\\n address _owner,\\n address _beneficiary,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n IGraphTokenLock.Revocability _revocable\\n ) external override onlyOwner {\\n require(_token.balanceOf(address(this)) >= _managedAmount, \\\"Not enough tokens to create lock\\\");\\n\\n // Create contract using a minimal proxy and call initializer\\n bytes memory initializer = abi.encodeWithSelector(\\n GraphTokenLockWallet.initialize.selector,\\n address(this),\\n _owner,\\n _beneficiary,\\n address(_token),\\n _managedAmount,\\n _startTime,\\n _endTime,\\n _periods,\\n _releaseStartTime,\\n _vestingCliffTime,\\n _revocable\\n );\\n address contractAddress = _deployProxy2(keccak256(initializer), masterCopy, initializer);\\n\\n // Send managed amount to the created contract\\n _token.safeTransfer(contractAddress, _managedAmount);\\n\\n emit TokenLockCreated(\\n contractAddress,\\n keccak256(initializer),\\n _beneficiary,\\n address(_token),\\n _managedAmount,\\n _startTime,\\n _endTime,\\n _periods,\\n _releaseStartTime,\\n _vestingCliffTime,\\n _revocable\\n );\\n }\\n\\n // -- Funds Management --\\n\\n /**\\n * @notice Gets the GRT token address\\n * @return Token used for transfers and approvals\\n */\\n function token() external view override returns (IERC20) {\\n return _token;\\n }\\n\\n /**\\n * @notice Deposits tokens into the contract\\n * @dev Even if the ERC20 token can be transferred directly to the contract\\n * this function provide a safe interface to do the transfer and avoid mistakes\\n * @param _amount Amount to deposit\\n */\\n function deposit(uint256 _amount) external override {\\n require(_amount > 0, \\\"Amount cannot be zero\\\");\\n _token.safeTransferFrom(msg.sender, address(this), _amount);\\n emit TokensDeposited(msg.sender, _amount);\\n }\\n\\n /**\\n * @notice Withdraws tokens from the contract\\n * @dev Escape hatch in case of mistakes or to recover remaining funds\\n * @param _amount Amount of tokens to withdraw\\n */\\n function withdraw(uint256 _amount) external override onlyOwner {\\n require(_amount > 0, \\\"Amount cannot be zero\\\");\\n _token.safeTransfer(msg.sender, _amount);\\n emit TokensWithdrawn(msg.sender, _amount);\\n }\\n\\n // -- Token Destinations --\\n\\n /**\\n * @notice Adds an address that can be allowed by a token lock to pull funds\\n * @param _dst Destination address\\n */\\n function addTokenDestination(address _dst) external override onlyOwner {\\n require(_dst != address(0), \\\"Destination cannot be zero\\\");\\n require(_tokenDestinations.add(_dst), \\\"Destination already added\\\");\\n emit TokenDestinationAllowed(_dst, true);\\n }\\n\\n /**\\n * @notice Removes an address that can be allowed by a token lock to pull funds\\n * @param _dst Destination address\\n */\\n function removeTokenDestination(address _dst) external override onlyOwner {\\n require(_tokenDestinations.remove(_dst), \\\"Destination already removed\\\");\\n emit TokenDestinationAllowed(_dst, false);\\n }\\n\\n /**\\n * @notice Returns True if the address is authorized to be a destination of tokens\\n * @param _dst Destination address\\n * @return True if authorized\\n */\\n function isTokenDestination(address _dst) external view override returns (bool) {\\n return _tokenDestinations.contains(_dst);\\n }\\n\\n /**\\n * @notice Returns an array of authorized destination addresses\\n * @return Array of addresses authorized to pull funds from a token lock\\n */\\n function getTokenDestinations() external view override returns (address[] memory) {\\n address[] memory dstList = new address[](_tokenDestinations.length());\\n for (uint256 i = 0; i < _tokenDestinations.length(); i++) {\\n dstList[i] = _tokenDestinations.at(i);\\n }\\n return dstList;\\n }\\n\\n // -- Function Call Authorization --\\n\\n /**\\n * @notice Sets an authorized function call to target\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @param _signature Function signature\\n * @param _target Address of the destination contract to call\\n */\\n function setAuthFunctionCall(string calldata _signature, address _target) external override onlyOwner {\\n _setAuthFunctionCall(_signature, _target);\\n }\\n\\n /**\\n * @notice Unsets an authorized function call to target\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @param _signature Function signature\\n */\\n function unsetAuthFunctionCall(string calldata _signature) external override onlyOwner {\\n bytes4 sigHash = _toFunctionSigHash(_signature);\\n authFnCalls[sigHash] = address(0);\\n\\n emit FunctionCallAuth(msg.sender, sigHash, address(0), _signature);\\n }\\n\\n /**\\n * @notice Sets an authorized function call to target in bulk\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @param _signatures Function signatures\\n * @param _targets Address of the destination contract to call\\n */\\n function setAuthFunctionCallMany(\\n string[] calldata _signatures,\\n address[] calldata _targets\\n ) external override onlyOwner {\\n require(_signatures.length == _targets.length, \\\"Array length mismatch\\\");\\n\\n for (uint256 i = 0; i < _signatures.length; i++) {\\n _setAuthFunctionCall(_signatures[i], _targets[i]);\\n }\\n }\\n\\n /**\\n * @notice Sets an authorized function call to target\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @dev Function signatures of Graph Protocol contracts to be used are known ahead of time\\n * @param _signature Function signature\\n * @param _target Address of the destination contract to call\\n */\\n function _setAuthFunctionCall(string calldata _signature, address _target) internal {\\n require(_target != address(this), \\\"Target must be other contract\\\");\\n require(Address.isContract(_target), \\\"Target must be a contract\\\");\\n\\n bytes4 sigHash = _toFunctionSigHash(_signature);\\n authFnCalls[sigHash] = _target;\\n\\n emit FunctionCallAuth(msg.sender, sigHash, _target, _signature);\\n }\\n\\n /**\\n * @notice Gets the target contract to call for a particular function signature\\n * @param _sigHash Function signature hash\\n * @return Address of the target contract where to send the call\\n */\\n function getAuthFunctionCallTarget(bytes4 _sigHash) public view override returns (address) {\\n return authFnCalls[_sigHash];\\n }\\n\\n /**\\n * @notice Returns true if the function call is authorized\\n * @param _sigHash Function signature hash\\n * @return True if authorized\\n */\\n function isAuthFunctionCall(bytes4 _sigHash) external view override returns (bool) {\\n return getAuthFunctionCallTarget(_sigHash) != address(0);\\n }\\n\\n /**\\n * @dev Converts a function signature string to 4-bytes hash\\n * @param _signature Function signature string\\n * @return Function signature hash\\n */\\n function _toFunctionSigHash(string calldata _signature) internal pure returns (bytes4) {\\n return _convertToBytes4(abi.encodeWithSignature(_signature));\\n }\\n\\n /**\\n * @dev Converts function signature bytes to function signature hash (bytes4)\\n * @param _signature Function signature\\n * @return Function signature in bytes4\\n */\\n function _convertToBytes4(bytes memory _signature) internal pure returns (bytes4) {\\n require(_signature.length == 4, \\\"Invalid method signature\\\");\\n bytes4 sigHash;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n sigHash := mload(add(_signature, 32))\\n }\\n return sigHash;\\n }\\n}\\n\",\"keccak256\":\"0x2bb51cc1a18bd88113fd6947067ad2fff33048c8904cb54adfda8e2ab86752f2\",\"license\":\"MIT\"},\"contracts/GraphTokenLockWallet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"@openzeppelin/contracts/math/SafeMath.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nimport \\\"./GraphTokenLock.sol\\\";\\nimport \\\"./IGraphTokenLockManager.sol\\\";\\n\\n/**\\n * @title GraphTokenLockWallet\\n * @notice This contract is built on top of the base GraphTokenLock functionality.\\n * It allows wallet beneficiaries to use the deposited funds to perform specific function calls\\n * on specific contracts.\\n *\\n * The idea is that supporters with locked tokens can participate in the protocol\\n * but disallow any release before the vesting/lock schedule.\\n * The beneficiary can issue authorized function calls to this contract that will\\n * get forwarded to a target contract. A target contract is any of our protocol contracts.\\n * The function calls allowed are queried to the GraphTokenLockManager, this way\\n * the same configuration can be shared for all the created lock wallet contracts.\\n *\\n * NOTE: Contracts used as target must have its function signatures checked to avoid collisions\\n * with any of this contract functions.\\n * Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience\\n * the maximum amount of tokens is authorized.\\n * Function calls do not forward ETH value so DO NOT SEND ETH TO THIS CONTRACT.\\n */\\ncontract GraphTokenLockWallet is GraphTokenLock {\\n using SafeMath for uint256;\\n\\n // -- State --\\n\\n IGraphTokenLockManager public manager;\\n uint256 public usedAmount;\\n\\n // -- Events --\\n\\n event ManagerUpdated(address indexed _oldManager, address indexed _newManager);\\n event TokenDestinationsApproved();\\n event TokenDestinationsRevoked();\\n\\n // Initializer\\n function initialize(\\n address _manager,\\n address _owner,\\n address _beneficiary,\\n address _token,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n Revocability _revocable\\n ) external {\\n _initialize(\\n _owner,\\n _beneficiary,\\n _token,\\n _managedAmount,\\n _startTime,\\n _endTime,\\n _periods,\\n _releaseStartTime,\\n _vestingCliffTime,\\n _revocable\\n );\\n _setManager(_manager);\\n }\\n\\n // -- Admin --\\n\\n /**\\n * @notice Sets a new manager for this contract\\n * @param _newManager Address of the new manager\\n */\\n function setManager(address _newManager) external onlyOwner {\\n _setManager(_newManager);\\n }\\n\\n /**\\n * @dev Sets a new manager for this contract\\n * @param _newManager Address of the new manager\\n */\\n function _setManager(address _newManager) internal {\\n require(_newManager != address(0), \\\"Manager cannot be empty\\\");\\n require(Address.isContract(_newManager), \\\"Manager must be a contract\\\");\\n\\n address oldManager = address(manager);\\n manager = IGraphTokenLockManager(_newManager);\\n\\n emit ManagerUpdated(oldManager, _newManager);\\n }\\n\\n // -- Beneficiary --\\n\\n /**\\n * @notice Approves protocol access of the tokens managed by this contract\\n * @dev Approves all token destinations registered in the manager to pull tokens\\n */\\n function approveProtocol() external onlyBeneficiary {\\n address[] memory dstList = manager.getTokenDestinations();\\n for (uint256 i = 0; i < dstList.length; i++) {\\n // Note this is only safe because we are using the max uint256 value\\n token.approve(dstList[i], type(uint256).max);\\n }\\n emit TokenDestinationsApproved();\\n }\\n\\n /**\\n * @notice Revokes protocol access of the tokens managed by this contract\\n * @dev Revokes approval to all token destinations in the manager to pull tokens\\n */\\n function revokeProtocol() external onlyBeneficiary {\\n address[] memory dstList = manager.getTokenDestinations();\\n for (uint256 i = 0; i < dstList.length; i++) {\\n // Note this is only safe cause we're using 0 as the amount\\n token.approve(dstList[i], 0);\\n }\\n emit TokenDestinationsRevoked();\\n }\\n\\n /**\\n * @notice Gets tokens currently available for release\\n * @dev Considers the schedule, takes into account already released tokens and used amount\\n * @return Amount of tokens ready to be released\\n */\\n function releasableAmount() public view override returns (uint256) {\\n if (revocable == Revocability.Disabled) {\\n return super.releasableAmount();\\n }\\n\\n // -- Revocability enabled logic\\n // This needs to deal with additional considerations for when tokens are used in the protocol\\n\\n // If a release start time is set no tokens are available for release before this date\\n // If not set it follows the default schedule and tokens are available on\\n // the first period passed\\n if (releaseStartTime > 0 && currentTime() < releaseStartTime) {\\n return 0;\\n }\\n\\n // Vesting cliff is activated and it has not passed means nothing is vested yet\\n // so funds cannot be released\\n if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\\n return 0;\\n }\\n\\n // A beneficiary can never have more releasable tokens than the contract balance\\n // We consider the `usedAmount` in the protocol as part of the calculations\\n // the beneficiary should not release funds that are used.\\n uint256 releasable = availableAmount().sub(releasedAmount).sub(usedAmount);\\n return MathUtils.min(currentBalance(), releasable);\\n }\\n\\n /**\\n * @notice Forward authorized contract calls to protocol contracts\\n * @dev Fallback function can be called by the beneficiary only if function call is allowed\\n */\\n // solhint-disable-next-line no-complex-fallback\\n fallback() external payable {\\n // Only beneficiary can forward calls\\n require(msg.sender == beneficiary, \\\"Unauthorized caller\\\");\\n require(msg.value == 0, \\\"ETH transfers not supported\\\");\\n\\n // Function call validation\\n address _target = manager.getAuthFunctionCallTarget(msg.sig);\\n require(_target != address(0), \\\"Unauthorized function\\\");\\n\\n uint256 oldBalance = currentBalance();\\n\\n // Call function with data\\n Address.functionCall(_target, msg.data);\\n\\n // Tracked used tokens in the protocol\\n // We do this check after balances were updated by the forwarded call\\n // Check is only enforced for revocable contracts to save some gas\\n if (revocable == Revocability.Enabled) {\\n // Track contract balance change\\n uint256 newBalance = currentBalance();\\n if (newBalance < oldBalance) {\\n // Outflow\\n uint256 diff = oldBalance.sub(newBalance);\\n usedAmount = usedAmount.add(diff);\\n } else {\\n // Inflow: We can receive profits from the protocol, that could make usedAmount to\\n // underflow. We set it to zero in that case.\\n uint256 diff = newBalance.sub(oldBalance);\\n usedAmount = (diff >= usedAmount) ? 0 : usedAmount.sub(diff);\\n }\\n require(usedAmount <= vestedAmount(), \\\"Cannot use more tokens than vested amount\\\");\\n }\\n }\\n\\n /**\\n * @notice Receive function that always reverts.\\n * @dev Only included to supress warnings, see https://github.com/ethereum/solidity/issues/10159\\n */\\n receive() external payable {\\n revert(\\\"Bad call\\\");\\n }\\n}\\n\",\"keccak256\":\"0x976c2ba4c1503a81ea02bd84539c516e99af611ff767968ee25456b50a6deb7b\",\"license\":\"MIT\"},\"contracts/ICallhookReceiver.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\n\\n// Copied from graphprotocol/contracts, changed solidity version to 0.7.3\\n\\n/**\\n * @title Interface for contracts that can receive callhooks through the Arbitrum GRT bridge\\n * @dev Any contract that can receive a callhook on L2, sent through the bridge from L1, must\\n * be allowlisted by the governor, but also implement this interface that contains\\n * the function that will actually be called by the L2GraphTokenGateway.\\n */\\npragma solidity ^0.7.3;\\n\\ninterface ICallhookReceiver {\\n /**\\n * @notice Receive tokens with a callhook from the bridge\\n * @param _from Token sender in L1\\n * @param _amount Amount of tokens that were transferred\\n * @param _data ABI-encoded callhook data\\n */\\n function onTokenTransfer(address _from, uint256 _amount, bytes calldata _data) external;\\n}\\n\",\"keccak256\":\"0xb90eae14e8bac012a4b99fabe7a1110f70143eb78476ea0d6b52557ef979fa0e\",\"license\":\"GPL-2.0-or-later\"},\"contracts/IGraphTokenLock.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\ninterface IGraphTokenLock {\\n enum Revocability {\\n NotSet,\\n Enabled,\\n Disabled\\n }\\n\\n // -- Balances --\\n\\n function currentBalance() external view returns (uint256);\\n\\n // -- Time & Periods --\\n\\n function currentTime() external view returns (uint256);\\n\\n function duration() external view returns (uint256);\\n\\n function sinceStartTime() external view returns (uint256);\\n\\n function amountPerPeriod() external view returns (uint256);\\n\\n function periodDuration() external view returns (uint256);\\n\\n function currentPeriod() external view returns (uint256);\\n\\n function passedPeriods() external view returns (uint256);\\n\\n // -- Locking & Release Schedule --\\n\\n function availableAmount() external view returns (uint256);\\n\\n function vestedAmount() external view returns (uint256);\\n\\n function releasableAmount() external view returns (uint256);\\n\\n function totalOutstandingAmount() external view returns (uint256);\\n\\n function surplusAmount() external view returns (uint256);\\n\\n // -- Value Transfer --\\n\\n function release() external;\\n\\n function withdrawSurplus(uint256 _amount) external;\\n\\n function revoke() external;\\n}\\n\",\"keccak256\":\"0xceb9d258276fe25ec858191e1deae5778f1b2f612a669fb7b37bab1a064756ab\",\"license\":\"MIT\"},\"contracts/IGraphTokenLockManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nimport \\\"./IGraphTokenLock.sol\\\";\\n\\ninterface IGraphTokenLockManager {\\n // -- Factory --\\n\\n function setMasterCopy(address _masterCopy) external;\\n\\n function createTokenLockWallet(\\n address _owner,\\n address _beneficiary,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n IGraphTokenLock.Revocability _revocable\\n ) external;\\n\\n // -- Funds Management --\\n\\n function token() external returns (IERC20);\\n\\n function deposit(uint256 _amount) external;\\n\\n function withdraw(uint256 _amount) external;\\n\\n // -- Allowed Funds Destinations --\\n\\n function addTokenDestination(address _dst) external;\\n\\n function removeTokenDestination(address _dst) external;\\n\\n function isTokenDestination(address _dst) external view returns (bool);\\n\\n function getTokenDestinations() external view returns (address[] memory);\\n\\n // -- Function Call Authorization --\\n\\n function setAuthFunctionCall(string calldata _signature, address _target) external;\\n\\n function unsetAuthFunctionCall(string calldata _signature) external;\\n\\n function setAuthFunctionCallMany(string[] calldata _signatures, address[] calldata _targets) external;\\n\\n function getAuthFunctionCallTarget(bytes4 _sigHash) external view returns (address);\\n\\n function isAuthFunctionCall(bytes4 _sigHash) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x2d78d41909a6de5b316ac39b100ea087a8f317cf306379888a045523e15c4d9a\",\"license\":\"MIT\"},\"contracts/L2GraphTokenLockManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport { SafeERC20 } from \\\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\\\";\\n\\nimport { ICallhookReceiver } from \\\"./ICallhookReceiver.sol\\\";\\nimport { GraphTokenLockManager } from \\\"./GraphTokenLockManager.sol\\\";\\nimport { L2GraphTokenLockWallet } from \\\"./L2GraphTokenLockWallet.sol\\\";\\n\\n/**\\n * @title L2GraphTokenLockManager\\n * @notice This contract manages a list of authorized function calls and targets that can be called\\n * by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts.\\n *\\n * This contract receives funds to make the process of creating TokenLockWallet contracts\\n * easier by distributing them the initial tokens to be managed.\\n *\\n * In particular, this L2 variant is designed to receive token lock wallets from L1,\\n * through the GRT bridge. These transferred wallets will not allow releasing funds in L2 until\\n * the end of the vesting timeline, but they can allow withdrawing funds back to L1 using\\n * the L2GraphTokenLockTransferTool contract.\\n *\\n * The owner can setup a list of token destinations that will be used by TokenLock contracts to\\n * approve the pulling of funds, this way in can be guaranteed that only protocol contracts\\n * will manipulate users funds.\\n */\\ncontract L2GraphTokenLockManager is GraphTokenLockManager, ICallhookReceiver {\\n using SafeERC20 for IERC20;\\n\\n /// @dev Struct to hold the data of a transferred wallet; this is\\n /// the data that must be encoded in L1 to send a wallet to L2.\\n struct TransferredWalletData {\\n address l1Address;\\n address owner;\\n address beneficiary;\\n uint256 managedAmount;\\n uint256 startTime;\\n uint256 endTime;\\n }\\n\\n /// Address of the L2GraphTokenGateway\\n address public immutable l2Gateway;\\n /// Address of the L1 transfer tool contract (in L1, no aliasing)\\n address public immutable l1TransferTool;\\n /// Mapping of each L1 wallet to its L2 wallet counterpart (populated when each wallet is received)\\n /// L1 address => L2 address\\n mapping(address => address) public l1WalletToL2Wallet;\\n /// Mapping of each L2 wallet to its L1 wallet counterpart (populated when each wallet is received)\\n /// L2 address => L1 address\\n mapping(address => address) public l2WalletToL1Wallet;\\n\\n /// @dev Event emitted when a wallet is received and created from L1\\n event TokenLockCreatedFromL1(\\n address indexed contractAddress,\\n bytes32 initHash,\\n address indexed beneficiary,\\n uint256 managedAmount,\\n uint256 startTime,\\n uint256 endTime,\\n address indexed l1Address\\n );\\n\\n /// @dev Emitted when locked tokens are received from L1 (whether the wallet\\n /// had already been received or not)\\n event LockedTokensReceivedFromL1(address indexed l1Address, address indexed l2Address, uint256 amount);\\n\\n /**\\n * @dev Checks that the sender is the L2GraphTokenGateway.\\n */\\n modifier onlyL2Gateway() {\\n require(msg.sender == l2Gateway, \\\"ONLY_GATEWAY\\\");\\n _;\\n }\\n\\n /**\\n * @notice Constructor for the L2GraphTokenLockManager contract.\\n * @param _graphToken Address of the L2 GRT token contract\\n * @param _masterCopy Address of the master copy of the L2GraphTokenLockWallet implementation\\n * @param _l2Gateway Address of the L2GraphTokenGateway contract\\n * @param _l1TransferTool Address of the L1 transfer tool contract (in L1, without aliasing)\\n */\\n constructor(\\n IERC20 _graphToken,\\n address _masterCopy,\\n address _l2Gateway,\\n address _l1TransferTool\\n ) GraphTokenLockManager(_graphToken, _masterCopy) {\\n l2Gateway = _l2Gateway;\\n l1TransferTool = _l1TransferTool;\\n }\\n\\n /**\\n * @notice This function is called by the L2GraphTokenGateway when tokens are sent from L1.\\n * @dev This function will create a new wallet if it doesn't exist yet, or send the tokens to\\n * the existing wallet if it does.\\n * @param _from Address of the sender in L1, which must be the L1GraphTokenLockTransferTool\\n * @param _amount Amount of tokens received\\n * @param _data Encoded data of the transferred wallet, which must be an ABI-encoded TransferredWalletData struct\\n */\\n function onTokenTransfer(address _from, uint256 _amount, bytes calldata _data) external override onlyL2Gateway {\\n require(_from == l1TransferTool, \\\"ONLY_TRANSFER_TOOL\\\");\\n TransferredWalletData memory walletData = abi.decode(_data, (TransferredWalletData));\\n\\n if (l1WalletToL2Wallet[walletData.l1Address] != address(0)) {\\n // If the wallet was already received, just send the tokens to the L2 address\\n _token.safeTransfer(l1WalletToL2Wallet[walletData.l1Address], _amount);\\n } else {\\n // Create contract using a minimal proxy and call initializer\\n (bytes32 initHash, address contractAddress) = _deployFromL1(keccak256(_data), walletData);\\n l1WalletToL2Wallet[walletData.l1Address] = contractAddress;\\n l2WalletToL1Wallet[contractAddress] = walletData.l1Address;\\n\\n // Send managed amount to the created contract\\n _token.safeTransfer(contractAddress, _amount);\\n\\n emit TokenLockCreatedFromL1(\\n contractAddress,\\n initHash,\\n walletData.beneficiary,\\n walletData.managedAmount,\\n walletData.startTime,\\n walletData.endTime,\\n walletData.l1Address\\n );\\n }\\n emit LockedTokensReceivedFromL1(walletData.l1Address, l1WalletToL2Wallet[walletData.l1Address], _amount);\\n }\\n\\n /**\\n * @dev Deploy a token lock wallet with data received from L1\\n * @param _salt Salt for the CREATE2 call, which must be the hash of the wallet data\\n * @param _walletData Data of the wallet to be created\\n * @return Hash of the initialization calldata\\n * @return Address of the created contract\\n */\\n function _deployFromL1(bytes32 _salt, TransferredWalletData memory _walletData) internal returns (bytes32, address) {\\n bytes memory initializer = _encodeInitializer(_walletData);\\n address contractAddress = _deployProxy2(_salt, masterCopy, initializer);\\n return (keccak256(initializer), contractAddress);\\n }\\n\\n /**\\n * @dev Encode the initializer for the token lock wallet received from L1\\n * @param _walletData Data of the wallet to be created\\n * @return Encoded initializer calldata, including the function signature\\n */\\n function _encodeInitializer(TransferredWalletData memory _walletData) internal view returns (bytes memory) {\\n return\\n abi.encodeWithSelector(\\n L2GraphTokenLockWallet.initializeFromL1.selector,\\n address(this),\\n address(_token),\\n _walletData\\n );\\n }\\n}\\n\",\"keccak256\":\"0x34ca0ffc898ce3615a000d53a9c58708354b8cd8093b3c61decfe7388f0c16e0\",\"license\":\"MIT\"},\"contracts/L2GraphTokenLockWallet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nimport { GraphTokenLockWallet } from \\\"./GraphTokenLockWallet.sol\\\";\\nimport { Ownable as OwnableInitializable } from \\\"./Ownable.sol\\\";\\nimport { L2GraphTokenLockManager } from \\\"./L2GraphTokenLockManager.sol\\\";\\n\\n/**\\n * @title L2GraphTokenLockWallet\\n * @notice This contract is built on top of the base GraphTokenLock functionality.\\n * It allows wallet beneficiaries to use the deposited funds to perform specific function calls\\n * on specific contracts.\\n *\\n * The idea is that supporters with locked tokens can participate in the protocol\\n * but disallow any release before the vesting/lock schedule.\\n * The beneficiary can issue authorized function calls to this contract that will\\n * get forwarded to a target contract. A target contract is any of our protocol contracts.\\n * The function calls allowed are queried to the GraphTokenLockManager, this way\\n * the same configuration can be shared for all the created lock wallet contracts.\\n *\\n * This L2 variant includes a special initializer so that it can be created from\\n * a wallet's data received from L1. These transferred wallets will not allow releasing\\n * funds in L2 until the end of the vesting timeline, but they can allow withdrawing\\n * funds back to L1 using the L2GraphTokenLockTransferTool contract.\\n *\\n * Note that surplusAmount and releasedAmount in L2 will be skewed for wallets received from L1,\\n * so releasing surplus tokens might also only be possible by bridging tokens back to L1.\\n *\\n * NOTE: Contracts used as target must have its function signatures checked to avoid collisions\\n * with any of this contract functions.\\n * Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience\\n * the maximum amount of tokens is authorized.\\n * Function calls do not forward ETH value so DO NOT SEND ETH TO THIS CONTRACT.\\n */\\ncontract L2GraphTokenLockWallet is GraphTokenLockWallet {\\n // Initializer when created from a message from L1\\n function initializeFromL1(\\n address _manager,\\n address _token,\\n L2GraphTokenLockManager.TransferredWalletData calldata _walletData\\n ) external {\\n require(!isInitialized, \\\"Already initialized\\\");\\n isInitialized = true;\\n\\n OwnableInitializable._initialize(_walletData.owner);\\n beneficiary = _walletData.beneficiary;\\n token = IERC20(_token);\\n\\n managedAmount = _walletData.managedAmount;\\n\\n startTime = _walletData.startTime;\\n endTime = _walletData.endTime;\\n periods = 1;\\n isAccepted = true;\\n\\n // Optionals\\n releaseStartTime = _walletData.endTime;\\n revocable = Revocability.Disabled;\\n\\n _setManager(_manager);\\n }\\n}\\n\",\"keccak256\":\"0x8842140c2c7924be4ab1bca71e0b0ad6dd1dba6433cfdc523bfd204288b25d20\",\"license\":\"MIT\"},\"contracts/MathUtils.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nlibrary MathUtils {\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n}\\n\",\"keccak256\":\"0xe2512e1da48bc8363acd15f66229564b02d66706665d7da740604566913c1400\",\"license\":\"MIT\"},\"contracts/MinimalProxyFactory.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nimport { Address } from \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport { Create2 } from \\\"@openzeppelin/contracts/utils/Create2.sol\\\";\\n\\n/**\\n * @title MinimalProxyFactory: a factory contract for creating minimal proxies\\n * @notice Adapted from https://github.com/OpenZeppelin/openzeppelin-sdk/blob/v2.5.0/packages/lib/contracts/upgradeability/ProxyFactory.sol\\n * Based on https://eips.ethereum.org/EIPS/eip-1167\\n */\\ncontract MinimalProxyFactory {\\n /// @dev Emitted when a new proxy is created\\n event ProxyCreated(address indexed proxy);\\n\\n /**\\n * @notice Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation\\n * @param _salt Bytes32 salt to use for CREATE2\\n * @param _implementation Address of the proxy target implementation\\n * @param _deployer Address of the deployer that creates the contract\\n * @return Address of the counterfactual MinimalProxy\\n */\\n function getDeploymentAddress(\\n bytes32 _salt,\\n address _implementation,\\n address _deployer\\n ) public pure returns (address) {\\n return Create2.computeAddress(_salt, keccak256(_getContractCreationCode(_implementation)), _deployer);\\n }\\n\\n /**\\n * @dev Deploys a MinimalProxy with CREATE2\\n * @param _salt Bytes32 salt to use for CREATE2\\n * @param _implementation Address of the proxy target implementation\\n * @param _data Bytes with the initializer call\\n * @return Address of the deployed MinimalProxy\\n */\\n function _deployProxy2(bytes32 _salt, address _implementation, bytes memory _data) internal returns (address) {\\n address proxyAddress = Create2.deploy(0, _salt, _getContractCreationCode(_implementation));\\n\\n emit ProxyCreated(proxyAddress);\\n\\n // Call function with data\\n if (_data.length > 0) {\\n Address.functionCall(proxyAddress, _data);\\n }\\n\\n return proxyAddress;\\n }\\n\\n /**\\n * @dev Gets the MinimalProxy bytecode\\n * @param _implementation Address of the proxy target implementation\\n * @return MinimalProxy bytecode\\n */\\n function _getContractCreationCode(address _implementation) internal pure returns (bytes memory) {\\n bytes10 creation = 0x3d602d80600a3d3981f3;\\n bytes10 prefix = 0x363d3d373d3d3d363d73;\\n bytes20 targetBytes = bytes20(_implementation);\\n bytes15 suffix = 0x5af43d82803e903d91602b57fd5bf3;\\n return abi.encodePacked(creation, prefix, targetBytes, suffix);\\n }\\n}\\n\",\"keccak256\":\"0x67d67a567bceb363ddb199b1e4ab06e7a99f16e034e03086971a332c09ec5c0e\",\"license\":\"MIT\"},\"contracts/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * The owner account will be passed on initialization of the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\ncontract Ownable {\\n /// @dev Owner of the contract, can be retrieved with the public owner() function\\n address private _owner;\\n /// @dev Since upgradeable contracts might inherit this, we add a storage gap\\n /// to allow adding variables here without breaking the proxy storage layout\\n uint256[50] private __gap;\\n\\n /// @dev Emitted when ownership of the contract is transferred\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n function _initialize(address owner) internal {\\n _owner = owner;\\n emit OwnershipTransferred(address(0), owner);\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(_owner == msg.sender, \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() external virtual onlyOwner {\\n emit OwnershipTransferred(_owner, address(0));\\n _owner = address(0);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) external virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n emit OwnershipTransferred(_owner, newOwner);\\n _owner = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0xe8750687082e8e24b620dbf58c3a08eee591ed7b4d5a3e13cc93554ec647fd09\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b506148f5806100206000396000f3fe6080604052600436106102605760003560e01c80637bdf05af11610144578063bc0163c1116100b6578063dc0706571161007a578063dc07065714610bc7578063e8dda6f514610bf0578063e97d87d514610c1b578063ebbab99214610c46578063f2fde38b14610c71578063fc0c546a14610c9a576102a0565b8063bc0163c114610af4578063bd896dcb14610b1f578063ce845d1d14610b48578063d0ebdbe714610b73578063d18e81b314610b9c576102a0565b80638da5cb5b116101085780638da5cb5b14610a0857806391f7cfb914610a33578063a4caeb4214610a5e578063b0d1818c14610a89578063b470aade14610ab2578063b6549f7514610add576102a0565b80637bdf05af1461095957806386d00e021461098457806386d1a69f146109af578063872a7810146109c65780638a5bdf5c146109f1576102a0565b806338af3eed116101dd578063481c6a75116101a1578063481c6a751461087f5780635051a5ec146108aa5780635b940081146108d557806360e7994414610900578063715018a61461091757806378e979251461092e576102a0565b806338af3eed146107a8578063392e53cd146107d3578063398057a3146107fe57806344b1231f1461082957806345d30a1714610854576102a0565b806320dc203d1161022457806320dc203d146106e75780632a627814146107105780632bc9ed02146107275780633197cbb61461075257806337aeb0861461077d576102a0565b8063029c6c9f14610624578063060406181461064f5780630b80f7771461067a5780630dff24d5146106915780630fb5a6b4146106bc576102a0565b366102a0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610297906141f3565b60405180910390fd5b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610330576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610327906143d3565b60405180910390fd5b60003414610373576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161036a90614213565b60405180910390fd5b6000603e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f1d24c456000357fffffffff00000000000000000000000000000000000000000000000000000000166040518263ffffffff1660e01b81526004016103f49190614165565b60206040518083038186803b15801561040c57600080fd5b505afa158015610420573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610444919061338f565b9050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156104b6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104ad906144d3565b60405180910390fd5b60006104c0610cc5565b9050610511826000368080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610d77565b506001600281111561051f57fe5b603b60009054906101000a900460ff16600281111561053a57fe5b141561062057600061054a610cc5565b90508181101561058c5760006105698284610dc190919063ffffffff16565b905061058081603f54610e1190919063ffffffff16565b603f81905550506105d2565b60006105a18383610dc190919063ffffffff16565b9050603f548110156105c7576105c281603f54610dc190919063ffffffff16565b6105ca565b60005b603f81905550505b6105da610e66565b603f54111561061e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161061590614433565b60405180910390fd5b505b5050005b34801561063057600080fd5b50610639610ed5565b6040516106469190614673565b60405180910390f35b34801561065b57600080fd5b50610664610ef3565b6040516106719190614673565b60405180910390f35b34801561068657600080fd5b5061068f610f2e565b005b34801561069d57600080fd5b506106a661109b565b6040516106b39190614673565b60405180910390f35b3480156106c857600080fd5b506106d16110e2565b6040516106de9190614673565b60405180910390f35b3480156106f357600080fd5b5061070e600480360381019061070991906134a8565b611100565b005b34801561071c57600080fd5b5061072561129b565b005b34801561073357600080fd5b5061073c611500565b604051610749919061414a565b60405180910390f35b34801561075e57600080fd5b50610767611513565b6040516107749190614673565b60405180910390f35b34801561078957600080fd5b50610792611519565b60405161079f9190614673565b60405180910390f35b3480156107b457600080fd5b506107bd61151f565b6040516107ca91906140dd565b60405180910390f35b3480156107df57600080fd5b506107e8611545565b6040516107f5919061414a565b60405180910390f35b34801561080a57600080fd5b50610813611558565b6040516108209190614673565b60405180910390f35b34801561083557600080fd5b5061083e610e66565b60405161084b9190614673565b60405180910390f35b34801561086057600080fd5b5061086961155e565b6040516108769190614673565b60405180910390f35b34801561088b57600080fd5b50610894611564565b6040516108a1919061419b565b60405180910390f35b3480156108b657600080fd5b506108bf61158a565b6040516108cc919061414a565b60405180910390f35b3480156108e157600080fd5b506108ea61159d565b6040516108f79190614673565b60405180910390f35b34801561090c57600080fd5b506109156116a8565b005b34801561092357600080fd5b5061092c6118ee565b005b34801561093a57600080fd5b50610943611a3a565b6040516109509190614673565b60405180910390f35b34801561096557600080fd5b5061096e611a40565b60405161097b9190614673565b60405180910390f35b34801561099057600080fd5b50610999611a7c565b6040516109a69190614673565b60405180910390f35b3480156109bb57600080fd5b506109c4611a82565b005b3480156109d257600080fd5b506109db611c5e565b6040516109e891906141b6565b60405180910390f35b3480156109fd57600080fd5b50610a06611c71565b005b348015610a1457600080fd5b50610a1d611d4a565b604051610a2a91906140dd565b60405180910390f35b348015610a3f57600080fd5b50610a48611d73565b604051610a559190614673565b60405180910390f35b348015610a6a57600080fd5b50610a73611dd1565b604051610a809190614673565b60405180910390f35b348015610a9557600080fd5b50610ab06004803603810190610aab9190613562565b611dd7565b005b348015610abe57600080fd5b50610ac7611fd6565b604051610ad49190614673565b60405180910390f35b348015610ae957600080fd5b50610af2611ff9565b005b348015610b0057600080fd5b50610b09612291565b604051610b169190614673565b60405180910390f35b348015610b2b57600080fd5b50610b466004803603810190610b4191906133b8565b6122c3565b005b348015610b5457600080fd5b50610b5d610cc5565b604051610b6a9190614673565b60405180910390f35b348015610b7f57600080fd5b50610b9a6004803603810190610b959190613366565b6122eb565b005b348015610ba857600080fd5b50610bb1612385565b604051610bbe9190614673565b60405180910390f35b348015610bd357600080fd5b50610bee6004803603810190610be99190613366565b61238d565b005b348015610bfc57600080fd5b50610c05612508565b604051610c129190614673565b60405180910390f35b348015610c2757600080fd5b50610c3061250e565b604051610c3d9190614673565b60405180910390f35b348015610c5257600080fd5b50610c5b612514565b604051610c689190614673565b60405180910390f35b348015610c7d57600080fd5b50610c986004803603810190610c939190613366565b612536565b005b348015610ca657600080fd5b50610caf6126f1565b604051610cbc9190614180565b60405180910390f35b6000603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610d2291906140dd565b60206040518083038186803b158015610d3a57600080fd5b505afa158015610d4e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d72919061358b565b905090565b6060610db983836040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c65640000815250612717565b905092915050565b600082821115610e06576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dfd90614333565b60405180910390fd5b818303905092915050565b600080828401905083811015610e5c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e53906142b3565b60405180910390fd5b8091505092915050565b6000600280811115610e7457fe5b603b60009054906101000a900460ff166002811115610e8f57fe5b1415610e9f576035549050610ed2565b6000603a54118015610eb95750603a54610eb7612385565b105b15610ec75760009050610ed2565b610ecf611d73565b90505b90565b6000610eee60385460355461272f90919063ffffffff16565b905090565b6000610f296001610f1b610f05611fd6565b610f0d611a40565b61272f90919063ffffffff16565b610e1190919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610fbc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fb390614493565b60405180910390fd5b60001515603b60039054906101000a900460ff16151514611012576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161100990614313565b60405180910390fd5b61106d61101d611d4a565b611025610cc5565b603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166127859092919063ffffffff16565b7f171f0bcbda3370351cea17f3b164bee87d77c2503b94abdf2720a814ebe7e9df60405160405180910390a1565b6000806110a6610cc5565b905060006110b2612291565b9050808211156110d8576110cf8183610dc190919063ffffffff16565b925050506110df565b6000925050505b90565b60006110fb603654603754610dc190919063ffffffff16565b905090565b603b60029054906101000a900460ff1615611150576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161114790614533565b60405180910390fd5b6001603b60026101000a81548160ff0219169083151502179055506111868160200160208101906111819190613366565b61280b565b8060400160208101906111999190613366565b603460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081603360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550806060013560358190555080608001356036819055508060a0013560378190555060016038819055506001603b60036101000a81548160ff0219169083151502179055508060a001356039819055506002603b60006101000a81548160ff0219169083600281111561128857fe5b0217905550611296836128a9565b505050565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461132b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161132290614593565b60405180910390fd5b6060603e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a34574666040518163ffffffff1660e01b815260040160006040518083038186803b15801561139557600080fd5b505afa1580156113a9573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906113d291906134f8565b905060005b81518110156114d057603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b383838151811061142a57fe5b60200260200101517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611470929190614121565b602060405180830381600087803b15801561148a57600080fd5b505af115801561149e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114c29190613539565b5080806001019150506113d7565b507fb837fd51506ba3cc623a37c78ed22fd521f2f6e9f69a34d5c2a4a9474f27579360405160405180910390a150565b603b60019054906101000a900460ff1681565b60375481565b603d5481565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b603b60029054906101000a900460ff1681565b60355481565b603c5481565b603e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b603b60039054906101000a900460ff1681565b60006002808111156115ab57fe5b603b60009054906101000a900460ff1660028111156115c657fe5b14156115db576115d4612a27565b90506116a5565b60006039541180156115f557506039546115f3612385565b105b1561160357600090506116a5565b6001600281111561161057fe5b603b60009054906101000a900460ff16600281111561162b57fe5b14801561163a57506000603a54115b801561164e5750603a5461164c612385565b105b1561165c57600090506116a5565b600061168e603f54611680603c54611672611d73565b610dc190919063ffffffff16565b610dc190919063ffffffff16565b90506116a161169b610cc5565b82612ae1565b9150505b90565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611738576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161172f90614593565b60405180910390fd5b6060603e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a34574666040518163ffffffff1660e01b815260040160006040518083038186803b1580156117a257600080fd5b505afa1580156117b6573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906117df91906134f8565b905060005b81518110156118be57603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b383838151811061183757fe5b602002602001015160006040518363ffffffff1660e01b815260040161185e9291906140f8565b602060405180830381600087803b15801561187857600080fd5b505af115801561188c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118b09190613539565b5080806001019150506117e4565b507f6d317a20ba9d790014284bef285283cd61fde92e0f2711050f563a9d2cf4171160405160405180910390a150565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461197c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161197390614493565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60365481565b600080611a4b612385565b90506036548111611a60576000915050611a79565b611a7560365482610dc190919063ffffffff16565b9150505b90565b603a5481565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611b12576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b0990614593565b60405180910390fd5b6000611b1c61159d565b905060008111611b61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b58906145f3565b60405180910390fd5b611b7681603c54610e1190919063ffffffff16565b603c81905550611beb603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166127859092919063ffffffff16565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fc7798891864187665ac6dd119286e44ec13f014527aeeb2b8eb3fd413df9317982604051611c539190614673565b60405180910390a250565b603b60009054906101000a900460ff1681565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611d01576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cf890614593565b60405180910390fd5b6001603b60036101000a81548160ff0219169083151502179055507fbeb3313724453131feb0a765a03e6715bb720e0f973a31fcbafa2d2f048c188b60405160405180910390a1565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600080611d7e612385565b9050603654811015611d94576000915050611dce565b603754811115611da957603554915050611dce565b611dca611db4610ed5565b611dbc612514565b612afa90919063ffffffff16565b9150505b90565b60385481565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611e67576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e5e90614593565b60405180910390fd5b60008111611eaa576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ea190614413565b60405180910390fd5b80611eb361109b565b1015611ef4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611eeb90614513565b60405180910390fd5b611f63603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166127859092919063ffffffff16565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b82604051611fcb9190614673565b60405180910390a250565b6000611ff4603854611fe66110e2565b61272f90919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612087576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161207e90614493565b60405180910390fd5b6001600281111561209457fe5b603b60009054906101000a900460ff1660028111156120af57fe5b146120ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120e690614553565b60405180910390fd5b60001515603b60019054906101000a900460ff16151514612145576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161213c90614653565b60405180910390fd5b6000612163612152610e66565b603554610dc190919063ffffffff16565b9050600081116121a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161219f906142d3565b60405180910390fd5b80603d819055506001603b60016101000a81548160ff02191690831515021790555061221e6121d5611d4a565b82603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166127859092919063ffffffff16565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fb73c49a3a37a7aca291ba0ceaa41657012def406106a7fc386888f0f66e941cf826040516122869190614673565b60405180910390a250565b60006122be603d546122b0603c54603554610dc190919063ffffffff16565b610dc190919063ffffffff16565b905090565b6122d58a8a8a8a8a8a8a8a8a8a612b6a565b6122de8b6128a9565b5050505050505050505050565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612379576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161237090614493565b60405180910390fd5b612382816128a9565b50565b600042905090565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461241d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161241490614593565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561248d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612484906143b3565b60405180910390fd5b80603460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f373c72efabe4ef3e552ff77838be729f3bc3d8c586df0012902d1baa2377fa1d816040516124fd91906140dd565b60405180910390a150565b603f5481565b60395481565b60006125316001612523610ef3565b610dc190919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146125c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125bb90614493565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612634576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161262b90614293565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60606127268484600085612ff4565b90509392505050565b6000808211612773576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161276a90614393565b60405180910390fd5b81838161277c57fe5b04905092915050565b6128068363a9059cbb60e01b84846040516024016127a4929190614121565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050613109565b505050565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a350565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612919576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161291090614573565b60405180910390fd5b612922816131d0565b612961576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612958906143f3565b60405180910390fd5b6000603e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081603e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fdac3632743b879638fd2d51c4d3c1dd796615b4758a55b50b0c19b971ba9fbc760405160405180910390a35050565b600080603954118015612a425750603954612a40612385565b105b15612a505760009050612ade565b60016002811115612a5d57fe5b603b60009054906101000a900460ff166002811115612a7857fe5b148015612a8757506000603a54115b8015612a9b5750603a54612a99612385565b105b15612aa95760009050612ade565b6000612ac7603c54612ab9611d73565b610dc190919063ffffffff16565b9050612ada612ad4610cc5565b82612ae1565b9150505b90565b6000818310612af05781612af2565b825b905092915050565b600080831415612b0d5760009050612b64565b6000828402905082848281612b1e57fe5b0414612b5f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b5690614473565b60405180910390fd5b809150505b92915050565b603b60029054906101000a900460ff1615612bba576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612bb190614533565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff161415612c2a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c21906142f3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff161415612c9a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c9190614633565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff161415612d0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d0190614613565b60405180910390fd5b60008711612d4d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d4490614373565b60405180910390fd5b6000861415612d91576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d88906144b3565b60405180910390fd5b848610612dd3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612dca90614253565b60405180910390fd5b6001841015612e17576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e0e90614453565b60405180910390fd5b60006002811115612e2457fe5b816002811115612e3057fe5b1415612e71576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e6890614273565b60405180910390fd5b848310612eb3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612eaa906145b3565b60405180910390fd5b848210612ef5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612eec90614233565b60405180910390fd5b6001603b60026101000a81548160ff021916908315150217905550612f198a61280b565b88603460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555087603360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550866035819055508560368190555084603781905550836038819055508260398190555081603a8190555080603b60006101000a81548160ff02191690836002811115612fe357fe5b021790555050505050505050505050565b606082471015613039576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161303090614353565b60405180910390fd5b613042856131d0565b613081576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613078906144f3565b60405180910390fd5b600060608673ffffffffffffffffffffffffffffffffffffffff1685876040516130ab91906140c6565b60006040518083038185875af1925050503d80600081146130e8576040519150601f19603f3d011682016040523d82523d6000602084013e6130ed565b606091505b50915091506130fd8282866131e3565b92505050949350505050565b606061316b826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166127179092919063ffffffff16565b90506000815111156131cb578080602001905181019061318b9190613539565b6131ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016131c1906145d3565b60405180910390fd5b5b505050565b600080823b905060008111915050919050565b606083156131f357829050613243565b6000835111156132065782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161323a91906141d1565b60405180910390fd5b9392505050565b6000813590506132598161486a565b92915050565b60008151905061326e8161486a565b92915050565b600082601f83011261328557600080fd5b8151613298613293826146bf565b61468e565b915081818352602084019350602081019050838560208402820111156132bd57600080fd5b60005b838110156132ed57816132d3888261325f565b8452602084019350602083019250506001810190506132c0565b5050505092915050565b60008151905061330681614881565b92915050565b60008135905061331b81614898565b92915050565b600060c0828403121561333357600080fd5b81905092915050565b60008135905061334b816148a8565b92915050565b600081519050613360816148a8565b92915050565b60006020828403121561337857600080fd5b60006133868482850161324a565b91505092915050565b6000602082840312156133a157600080fd5b60006133af8482850161325f565b91505092915050565b60008060008060008060008060008060006101608c8e0312156133da57600080fd5b60006133e88e828f0161324a565b9b505060206133f98e828f0161324a565b9a5050604061340a8e828f0161324a565b995050606061341b8e828f0161324a565b985050608061342c8e828f0161333c565b97505060a061343d8e828f0161333c565b96505060c061344e8e828f0161333c565b95505060e061345f8e828f0161333c565b9450506101006134718e828f0161333c565b9350506101206134838e828f0161333c565b9250506101406134958e828f0161330c565b9150509295989b509295989b9093969950565b600080600061010084860312156134be57600080fd5b60006134cc8682870161324a565b93505060206134dd8682870161324a565b92505060406134ee86828701613321565b9150509250925092565b60006020828403121561350a57600080fd5b600082015167ffffffffffffffff81111561352457600080fd5b61353084828501613274565b91505092915050565b60006020828403121561354b57600080fd5b6000613559848285016132f7565b91505092915050565b60006020828403121561357457600080fd5b60006135828482850161333c565b91505092915050565b60006020828403121561359d57600080fd5b60006135ab84828501613351565b91505092915050565b6135bd8161471d565b82525050565b6135cc8161472f565b82525050565b6135db8161473b565b82525050565b60006135ec826146eb565b6135f68185614701565b9350613606818560208601614810565b80840191505092915050565b61361b816147a4565b82525050565b61362a816147c8565b82525050565b613639816147ec565b82525050565b613648816147fe565b82525050565b6000613659826146f6565b613663818561470c565b9350613673818560208601614810565b61367c81614845565b840191505092915050565b600061369460088361470c565b91507f4261642063616c6c0000000000000000000000000000000000000000000000006000830152602082019050919050565b60006136d4601b8361470c565b91507f455448207472616e7366657273206e6f7420737570706f7274656400000000006000830152602082019050919050565b600061371460228361470c565b91507f436c6966662074696d65206d757374206265206265666f726520656e6420746960008301527f6d650000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b600061377a60158361470c565b91507f53746172742074696d65203e20656e642074696d6500000000000000000000006000830152602082019050919050565b60006137ba601e8361470c565b91507f4d757374207365742061207265766f636162696c697479206f7074696f6e00006000830152602082019050919050565b60006137fa60268361470c565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613860601b8361470c565b91507f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006000830152602082019050919050565b60006138a0601c8361470c565b91507f4e6f20617661696c61626c6520756e76657374656420616d6f756e74000000006000830152602082019050919050565b60006138e060148361470c565b91507f4f776e65722063616e6e6f74206265207a65726f0000000000000000000000006000830152602082019050919050565b6000613920601f8361470c565b91507f43616e6e6f742063616e63656c20616363657074656420636f6e7472616374006000830152602082019050919050565b6000613960601e8361470c565b91507f536166654d6174683a207375627472616374696f6e206f766572666c6f7700006000830152602082019050919050565b60006139a060268361470c565b91507f416464726573733a20696e73756666696369656e742062616c616e636520666f60008301527f722063616c6c00000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613a06601d8361470c565b91507f4d616e6167656420746f6b656e732063616e6e6f74206265207a65726f0000006000830152602082019050919050565b6000613a46601a8361470c565b91507f536166654d6174683a206469766973696f6e206279207a65726f0000000000006000830152602082019050919050565b6000613a8660118361470c565b91507f456d7074792062656e65666963696172790000000000000000000000000000006000830152602082019050919050565b6000613ac660138361470c565b91507f556e617574686f72697a65642063616c6c6572000000000000000000000000006000830152602082019050919050565b6000613b06601a8361470c565b91507f4d616e61676572206d757374206265206120636f6e74726163740000000000006000830152602082019050919050565b6000613b4660158361470c565b91507f416d6f756e742063616e6e6f74206265207a65726f00000000000000000000006000830152602082019050919050565b6000613b8660298361470c565b91507f43616e6e6f7420757365206d6f726520746f6b656e73207468616e207665737460008301527f656420616d6f756e7400000000000000000000000000000000000000000000006020830152604082019050919050565b6000613bec601f8361470c565b91507f506572696f64732063616e6e6f742062652062656c6f77206d696e696d756d006000830152602082019050919050565b6000613c2c60218361470c565b91507f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008301527f77000000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613c9260208361470c565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b6000613cd260168361470c565b91507f53746172742074696d65206d75737420626520736574000000000000000000006000830152602082019050919050565b6000613d1260158361470c565b91507f556e617574686f72697a65642066756e6374696f6e00000000000000000000006000830152602082019050919050565b6000613d52601d8361470c565b91507f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006000830152602082019050919050565b6000613d9260248361470c565b91507f416d6f756e7420726571756573746564203e20737572706c757320617661696c60008301527f61626c65000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613df860138361470c565b91507f416c726561647920696e697469616c697a6564000000000000000000000000006000830152602082019050919050565b6000613e3860198361470c565b91507f436f6e7472616374206973206e6f6e2d7265766f6361626c65000000000000006000830152602082019050919050565b6000613e7860178361470c565b91507f4d616e616765722063616e6e6f7420626520656d7074790000000000000000006000830152602082019050919050565b6000613eb860058361470c565b91507f21617574680000000000000000000000000000000000000000000000000000006000830152602082019050919050565b6000613ef8602a8361470c565b91507f52656c656173652073746172742074696d65206d757374206265206265666f7260008301527f6520656e642074696d65000000000000000000000000000000000000000000006020830152604082019050919050565b6000613f5e602a8361470c565b91507f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008301527f6f742073756363656564000000000000000000000000000000000000000000006020830152604082019050919050565b6000613fc4601e8361470c565b91507f4e6f20617661696c61626c652072656c65617361626c6520616d6f756e7400006000830152602082019050919050565b600061400460148361470c565b91507f546f6b656e2063616e6e6f74206265207a65726f0000000000000000000000006000830152602082019050919050565b6000614044601a8361470c565b91507f42656e65666963696172792063616e6e6f74206265207a65726f0000000000006000830152602082019050919050565b6000614084600f8361470c565b91507f416c7265616479207265766f6b656400000000000000000000000000000000006000830152602082019050919050565b6140c08161479a565b82525050565b60006140d282846135e1565b915081905092915050565b60006020820190506140f260008301846135b4565b92915050565b600060408201905061410d60008301856135b4565b61411a602083018461363f565b9392505050565b600060408201905061413660008301856135b4565b61414360208301846140b7565b9392505050565b600060208201905061415f60008301846135c3565b92915050565b600060208201905061417a60008301846135d2565b92915050565b60006020820190506141956000830184613612565b92915050565b60006020820190506141b06000830184613621565b92915050565b60006020820190506141cb6000830184613630565b92915050565b600060208201905081810360008301526141eb818461364e565b905092915050565b6000602082019050818103600083015261420c81613687565b9050919050565b6000602082019050818103600083015261422c816136c7565b9050919050565b6000602082019050818103600083015261424c81613707565b9050919050565b6000602082019050818103600083015261426c8161376d565b9050919050565b6000602082019050818103600083015261428c816137ad565b9050919050565b600060208201905081810360008301526142ac816137ed565b9050919050565b600060208201905081810360008301526142cc81613853565b9050919050565b600060208201905081810360008301526142ec81613893565b9050919050565b6000602082019050818103600083015261430c816138d3565b9050919050565b6000602082019050818103600083015261432c81613913565b9050919050565b6000602082019050818103600083015261434c81613953565b9050919050565b6000602082019050818103600083015261436c81613993565b9050919050565b6000602082019050818103600083015261438c816139f9565b9050919050565b600060208201905081810360008301526143ac81613a39565b9050919050565b600060208201905081810360008301526143cc81613a79565b9050919050565b600060208201905081810360008301526143ec81613ab9565b9050919050565b6000602082019050818103600083015261440c81613af9565b9050919050565b6000602082019050818103600083015261442c81613b39565b9050919050565b6000602082019050818103600083015261444c81613b79565b9050919050565b6000602082019050818103600083015261446c81613bdf565b9050919050565b6000602082019050818103600083015261448c81613c1f565b9050919050565b600060208201905081810360008301526144ac81613c85565b9050919050565b600060208201905081810360008301526144cc81613cc5565b9050919050565b600060208201905081810360008301526144ec81613d05565b9050919050565b6000602082019050818103600083015261450c81613d45565b9050919050565b6000602082019050818103600083015261452c81613d85565b9050919050565b6000602082019050818103600083015261454c81613deb565b9050919050565b6000602082019050818103600083015261456c81613e2b565b9050919050565b6000602082019050818103600083015261458c81613e6b565b9050919050565b600060208201905081810360008301526145ac81613eab565b9050919050565b600060208201905081810360008301526145cc81613eeb565b9050919050565b600060208201905081810360008301526145ec81613f51565b9050919050565b6000602082019050818103600083015261460c81613fb7565b9050919050565b6000602082019050818103600083015261462c81613ff7565b9050919050565b6000602082019050818103600083015261464c81614037565b9050919050565b6000602082019050818103600083015261466c81614077565b9050919050565b600060208201905061468860008301846140b7565b92915050565b6000604051905081810181811067ffffffffffffffff821117156146b5576146b4614843565b5b8060405250919050565b600067ffffffffffffffff8211156146da576146d9614843565b5b602082029050602081019050919050565b600081519050919050565b600081519050919050565b600081905092915050565b600082825260208201905092915050565b60006147288261477a565b9050919050565b60008115159050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600081905061477582614856565b919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60006147af826147b6565b9050919050565b60006147c18261477a565b9050919050565b60006147d3826147da565b9050919050565b60006147e58261477a565b9050919050565b60006147f782614767565b9050919050565b60006148098261479a565b9050919050565b60005b8381101561482e578082015181840152602081019050614813565b8381111561483d576000848401525b50505050565bfe5b6000601f19601f8301169050919050565b6003811061486757614866614843565b5b50565b6148738161471d565b811461487e57600080fd5b50565b61488a8161472f565b811461489557600080fd5b50565b600381106148a557600080fd5b50565b6148b18161479a565b81146148bc57600080fd5b5056fea2646970667358221220e7181b2ba4d1c3bb9e57d12c063690ecc18fa07966017865e716378e6ce1068c64736f6c63430007030033", + "deployedBytecode": "0x6080604052600436106102605760003560e01c80637bdf05af11610144578063bc0163c1116100b6578063dc0706571161007a578063dc07065714610bc7578063e8dda6f514610bf0578063e97d87d514610c1b578063ebbab99214610c46578063f2fde38b14610c71578063fc0c546a14610c9a576102a0565b8063bc0163c114610af4578063bd896dcb14610b1f578063ce845d1d14610b48578063d0ebdbe714610b73578063d18e81b314610b9c576102a0565b80638da5cb5b116101085780638da5cb5b14610a0857806391f7cfb914610a33578063a4caeb4214610a5e578063b0d1818c14610a89578063b470aade14610ab2578063b6549f7514610add576102a0565b80637bdf05af1461095957806386d00e021461098457806386d1a69f146109af578063872a7810146109c65780638a5bdf5c146109f1576102a0565b806338af3eed116101dd578063481c6a75116101a1578063481c6a751461087f5780635051a5ec146108aa5780635b940081146108d557806360e7994414610900578063715018a61461091757806378e979251461092e576102a0565b806338af3eed146107a8578063392e53cd146107d3578063398057a3146107fe57806344b1231f1461082957806345d30a1714610854576102a0565b806320dc203d1161022457806320dc203d146106e75780632a627814146107105780632bc9ed02146107275780633197cbb61461075257806337aeb0861461077d576102a0565b8063029c6c9f14610624578063060406181461064f5780630b80f7771461067a5780630dff24d5146106915780630fb5a6b4146106bc576102a0565b366102a0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610297906141f3565b60405180910390fd5b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610330576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610327906143d3565b60405180910390fd5b60003414610373576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161036a90614213565b60405180910390fd5b6000603e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f1d24c456000357fffffffff00000000000000000000000000000000000000000000000000000000166040518263ffffffff1660e01b81526004016103f49190614165565b60206040518083038186803b15801561040c57600080fd5b505afa158015610420573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610444919061338f565b9050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156104b6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104ad906144d3565b60405180910390fd5b60006104c0610cc5565b9050610511826000368080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610d77565b506001600281111561051f57fe5b603b60009054906101000a900460ff16600281111561053a57fe5b141561062057600061054a610cc5565b90508181101561058c5760006105698284610dc190919063ffffffff16565b905061058081603f54610e1190919063ffffffff16565b603f81905550506105d2565b60006105a18383610dc190919063ffffffff16565b9050603f548110156105c7576105c281603f54610dc190919063ffffffff16565b6105ca565b60005b603f81905550505b6105da610e66565b603f54111561061e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161061590614433565b60405180910390fd5b505b5050005b34801561063057600080fd5b50610639610ed5565b6040516106469190614673565b60405180910390f35b34801561065b57600080fd5b50610664610ef3565b6040516106719190614673565b60405180910390f35b34801561068657600080fd5b5061068f610f2e565b005b34801561069d57600080fd5b506106a661109b565b6040516106b39190614673565b60405180910390f35b3480156106c857600080fd5b506106d16110e2565b6040516106de9190614673565b60405180910390f35b3480156106f357600080fd5b5061070e600480360381019061070991906134a8565b611100565b005b34801561071c57600080fd5b5061072561129b565b005b34801561073357600080fd5b5061073c611500565b604051610749919061414a565b60405180910390f35b34801561075e57600080fd5b50610767611513565b6040516107749190614673565b60405180910390f35b34801561078957600080fd5b50610792611519565b60405161079f9190614673565b60405180910390f35b3480156107b457600080fd5b506107bd61151f565b6040516107ca91906140dd565b60405180910390f35b3480156107df57600080fd5b506107e8611545565b6040516107f5919061414a565b60405180910390f35b34801561080a57600080fd5b50610813611558565b6040516108209190614673565b60405180910390f35b34801561083557600080fd5b5061083e610e66565b60405161084b9190614673565b60405180910390f35b34801561086057600080fd5b5061086961155e565b6040516108769190614673565b60405180910390f35b34801561088b57600080fd5b50610894611564565b6040516108a1919061419b565b60405180910390f35b3480156108b657600080fd5b506108bf61158a565b6040516108cc919061414a565b60405180910390f35b3480156108e157600080fd5b506108ea61159d565b6040516108f79190614673565b60405180910390f35b34801561090c57600080fd5b506109156116a8565b005b34801561092357600080fd5b5061092c6118ee565b005b34801561093a57600080fd5b50610943611a3a565b6040516109509190614673565b60405180910390f35b34801561096557600080fd5b5061096e611a40565b60405161097b9190614673565b60405180910390f35b34801561099057600080fd5b50610999611a7c565b6040516109a69190614673565b60405180910390f35b3480156109bb57600080fd5b506109c4611a82565b005b3480156109d257600080fd5b506109db611c5e565b6040516109e891906141b6565b60405180910390f35b3480156109fd57600080fd5b50610a06611c71565b005b348015610a1457600080fd5b50610a1d611d4a565b604051610a2a91906140dd565b60405180910390f35b348015610a3f57600080fd5b50610a48611d73565b604051610a559190614673565b60405180910390f35b348015610a6a57600080fd5b50610a73611dd1565b604051610a809190614673565b60405180910390f35b348015610a9557600080fd5b50610ab06004803603810190610aab9190613562565b611dd7565b005b348015610abe57600080fd5b50610ac7611fd6565b604051610ad49190614673565b60405180910390f35b348015610ae957600080fd5b50610af2611ff9565b005b348015610b0057600080fd5b50610b09612291565b604051610b169190614673565b60405180910390f35b348015610b2b57600080fd5b50610b466004803603810190610b4191906133b8565b6122c3565b005b348015610b5457600080fd5b50610b5d610cc5565b604051610b6a9190614673565b60405180910390f35b348015610b7f57600080fd5b50610b9a6004803603810190610b959190613366565b6122eb565b005b348015610ba857600080fd5b50610bb1612385565b604051610bbe9190614673565b60405180910390f35b348015610bd357600080fd5b50610bee6004803603810190610be99190613366565b61238d565b005b348015610bfc57600080fd5b50610c05612508565b604051610c129190614673565b60405180910390f35b348015610c2757600080fd5b50610c3061250e565b604051610c3d9190614673565b60405180910390f35b348015610c5257600080fd5b50610c5b612514565b604051610c689190614673565b60405180910390f35b348015610c7d57600080fd5b50610c986004803603810190610c939190613366565b612536565b005b348015610ca657600080fd5b50610caf6126f1565b604051610cbc9190614180565b60405180910390f35b6000603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610d2291906140dd565b60206040518083038186803b158015610d3a57600080fd5b505afa158015610d4e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d72919061358b565b905090565b6060610db983836040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c65640000815250612717565b905092915050565b600082821115610e06576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dfd90614333565b60405180910390fd5b818303905092915050565b600080828401905083811015610e5c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e53906142b3565b60405180910390fd5b8091505092915050565b6000600280811115610e7457fe5b603b60009054906101000a900460ff166002811115610e8f57fe5b1415610e9f576035549050610ed2565b6000603a54118015610eb95750603a54610eb7612385565b105b15610ec75760009050610ed2565b610ecf611d73565b90505b90565b6000610eee60385460355461272f90919063ffffffff16565b905090565b6000610f296001610f1b610f05611fd6565b610f0d611a40565b61272f90919063ffffffff16565b610e1190919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610fbc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fb390614493565b60405180910390fd5b60001515603b60039054906101000a900460ff16151514611012576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161100990614313565b60405180910390fd5b61106d61101d611d4a565b611025610cc5565b603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166127859092919063ffffffff16565b7f171f0bcbda3370351cea17f3b164bee87d77c2503b94abdf2720a814ebe7e9df60405160405180910390a1565b6000806110a6610cc5565b905060006110b2612291565b9050808211156110d8576110cf8183610dc190919063ffffffff16565b925050506110df565b6000925050505b90565b60006110fb603654603754610dc190919063ffffffff16565b905090565b603b60029054906101000a900460ff1615611150576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161114790614533565b60405180910390fd5b6001603b60026101000a81548160ff0219169083151502179055506111868160200160208101906111819190613366565b61280b565b8060400160208101906111999190613366565b603460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081603360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550806060013560358190555080608001356036819055508060a0013560378190555060016038819055506001603b60036101000a81548160ff0219169083151502179055508060a001356039819055506002603b60006101000a81548160ff0219169083600281111561128857fe5b0217905550611296836128a9565b505050565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461132b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161132290614593565b60405180910390fd5b6060603e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a34574666040518163ffffffff1660e01b815260040160006040518083038186803b15801561139557600080fd5b505afa1580156113a9573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906113d291906134f8565b905060005b81518110156114d057603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b383838151811061142a57fe5b60200260200101517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611470929190614121565b602060405180830381600087803b15801561148a57600080fd5b505af115801561149e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114c29190613539565b5080806001019150506113d7565b507fb837fd51506ba3cc623a37c78ed22fd521f2f6e9f69a34d5c2a4a9474f27579360405160405180910390a150565b603b60019054906101000a900460ff1681565b60375481565b603d5481565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b603b60029054906101000a900460ff1681565b60355481565b603c5481565b603e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b603b60039054906101000a900460ff1681565b60006002808111156115ab57fe5b603b60009054906101000a900460ff1660028111156115c657fe5b14156115db576115d4612a27565b90506116a5565b60006039541180156115f557506039546115f3612385565b105b1561160357600090506116a5565b6001600281111561161057fe5b603b60009054906101000a900460ff16600281111561162b57fe5b14801561163a57506000603a54115b801561164e5750603a5461164c612385565b105b1561165c57600090506116a5565b600061168e603f54611680603c54611672611d73565b610dc190919063ffffffff16565b610dc190919063ffffffff16565b90506116a161169b610cc5565b82612ae1565b9150505b90565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611738576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161172f90614593565b60405180910390fd5b6060603e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a34574666040518163ffffffff1660e01b815260040160006040518083038186803b1580156117a257600080fd5b505afa1580156117b6573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906117df91906134f8565b905060005b81518110156118be57603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b383838151811061183757fe5b602002602001015160006040518363ffffffff1660e01b815260040161185e9291906140f8565b602060405180830381600087803b15801561187857600080fd5b505af115801561188c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118b09190613539565b5080806001019150506117e4565b507f6d317a20ba9d790014284bef285283cd61fde92e0f2711050f563a9d2cf4171160405160405180910390a150565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461197c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161197390614493565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60365481565b600080611a4b612385565b90506036548111611a60576000915050611a79565b611a7560365482610dc190919063ffffffff16565b9150505b90565b603a5481565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611b12576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b0990614593565b60405180910390fd5b6000611b1c61159d565b905060008111611b61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b58906145f3565b60405180910390fd5b611b7681603c54610e1190919063ffffffff16565b603c81905550611beb603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166127859092919063ffffffff16565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fc7798891864187665ac6dd119286e44ec13f014527aeeb2b8eb3fd413df9317982604051611c539190614673565b60405180910390a250565b603b60009054906101000a900460ff1681565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611d01576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cf890614593565b60405180910390fd5b6001603b60036101000a81548160ff0219169083151502179055507fbeb3313724453131feb0a765a03e6715bb720e0f973a31fcbafa2d2f048c188b60405160405180910390a1565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600080611d7e612385565b9050603654811015611d94576000915050611dce565b603754811115611da957603554915050611dce565b611dca611db4610ed5565b611dbc612514565b612afa90919063ffffffff16565b9150505b90565b60385481565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611e67576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e5e90614593565b60405180910390fd5b60008111611eaa576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ea190614413565b60405180910390fd5b80611eb361109b565b1015611ef4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611eeb90614513565b60405180910390fd5b611f63603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166127859092919063ffffffff16565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b82604051611fcb9190614673565b60405180910390a250565b6000611ff4603854611fe66110e2565b61272f90919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612087576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161207e90614493565b60405180910390fd5b6001600281111561209457fe5b603b60009054906101000a900460ff1660028111156120af57fe5b146120ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120e690614553565b60405180910390fd5b60001515603b60019054906101000a900460ff16151514612145576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161213c90614653565b60405180910390fd5b6000612163612152610e66565b603554610dc190919063ffffffff16565b9050600081116121a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161219f906142d3565b60405180910390fd5b80603d819055506001603b60016101000a81548160ff02191690831515021790555061221e6121d5611d4a565b82603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166127859092919063ffffffff16565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fb73c49a3a37a7aca291ba0ceaa41657012def406106a7fc386888f0f66e941cf826040516122869190614673565b60405180910390a250565b60006122be603d546122b0603c54603554610dc190919063ffffffff16565b610dc190919063ffffffff16565b905090565b6122d58a8a8a8a8a8a8a8a8a8a612b6a565b6122de8b6128a9565b5050505050505050505050565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612379576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161237090614493565b60405180910390fd5b612382816128a9565b50565b600042905090565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461241d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161241490614593565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561248d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612484906143b3565b60405180910390fd5b80603460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f373c72efabe4ef3e552ff77838be729f3bc3d8c586df0012902d1baa2377fa1d816040516124fd91906140dd565b60405180910390a150565b603f5481565b60395481565b60006125316001612523610ef3565b610dc190919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146125c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125bb90614493565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612634576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161262b90614293565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60606127268484600085612ff4565b90509392505050565b6000808211612773576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161276a90614393565b60405180910390fd5b81838161277c57fe5b04905092915050565b6128068363a9059cbb60e01b84846040516024016127a4929190614121565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050613109565b505050565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a350565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612919576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161291090614573565b60405180910390fd5b612922816131d0565b612961576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612958906143f3565b60405180910390fd5b6000603e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081603e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fdac3632743b879638fd2d51c4d3c1dd796615b4758a55b50b0c19b971ba9fbc760405160405180910390a35050565b600080603954118015612a425750603954612a40612385565b105b15612a505760009050612ade565b60016002811115612a5d57fe5b603b60009054906101000a900460ff166002811115612a7857fe5b148015612a8757506000603a54115b8015612a9b5750603a54612a99612385565b105b15612aa95760009050612ade565b6000612ac7603c54612ab9611d73565b610dc190919063ffffffff16565b9050612ada612ad4610cc5565b82612ae1565b9150505b90565b6000818310612af05781612af2565b825b905092915050565b600080831415612b0d5760009050612b64565b6000828402905082848281612b1e57fe5b0414612b5f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b5690614473565b60405180910390fd5b809150505b92915050565b603b60029054906101000a900460ff1615612bba576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612bb190614533565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff161415612c2a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c21906142f3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff161415612c9a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c9190614633565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff161415612d0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d0190614613565b60405180910390fd5b60008711612d4d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d4490614373565b60405180910390fd5b6000861415612d91576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d88906144b3565b60405180910390fd5b848610612dd3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612dca90614253565b60405180910390fd5b6001841015612e17576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e0e90614453565b60405180910390fd5b60006002811115612e2457fe5b816002811115612e3057fe5b1415612e71576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e6890614273565b60405180910390fd5b848310612eb3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612eaa906145b3565b60405180910390fd5b848210612ef5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612eec90614233565b60405180910390fd5b6001603b60026101000a81548160ff021916908315150217905550612f198a61280b565b88603460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555087603360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550866035819055508560368190555084603781905550836038819055508260398190555081603a8190555080603b60006101000a81548160ff02191690836002811115612fe357fe5b021790555050505050505050505050565b606082471015613039576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161303090614353565b60405180910390fd5b613042856131d0565b613081576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613078906144f3565b60405180910390fd5b600060608673ffffffffffffffffffffffffffffffffffffffff1685876040516130ab91906140c6565b60006040518083038185875af1925050503d80600081146130e8576040519150601f19603f3d011682016040523d82523d6000602084013e6130ed565b606091505b50915091506130fd8282866131e3565b92505050949350505050565b606061316b826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166127179092919063ffffffff16565b90506000815111156131cb578080602001905181019061318b9190613539565b6131ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016131c1906145d3565b60405180910390fd5b5b505050565b600080823b905060008111915050919050565b606083156131f357829050613243565b6000835111156132065782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161323a91906141d1565b60405180910390fd5b9392505050565b6000813590506132598161486a565b92915050565b60008151905061326e8161486a565b92915050565b600082601f83011261328557600080fd5b8151613298613293826146bf565b61468e565b915081818352602084019350602081019050838560208402820111156132bd57600080fd5b60005b838110156132ed57816132d3888261325f565b8452602084019350602083019250506001810190506132c0565b5050505092915050565b60008151905061330681614881565b92915050565b60008135905061331b81614898565b92915050565b600060c0828403121561333357600080fd5b81905092915050565b60008135905061334b816148a8565b92915050565b600081519050613360816148a8565b92915050565b60006020828403121561337857600080fd5b60006133868482850161324a565b91505092915050565b6000602082840312156133a157600080fd5b60006133af8482850161325f565b91505092915050565b60008060008060008060008060008060006101608c8e0312156133da57600080fd5b60006133e88e828f0161324a565b9b505060206133f98e828f0161324a565b9a5050604061340a8e828f0161324a565b995050606061341b8e828f0161324a565b985050608061342c8e828f0161333c565b97505060a061343d8e828f0161333c565b96505060c061344e8e828f0161333c565b95505060e061345f8e828f0161333c565b9450506101006134718e828f0161333c565b9350506101206134838e828f0161333c565b9250506101406134958e828f0161330c565b9150509295989b509295989b9093969950565b600080600061010084860312156134be57600080fd5b60006134cc8682870161324a565b93505060206134dd8682870161324a565b92505060406134ee86828701613321565b9150509250925092565b60006020828403121561350a57600080fd5b600082015167ffffffffffffffff81111561352457600080fd5b61353084828501613274565b91505092915050565b60006020828403121561354b57600080fd5b6000613559848285016132f7565b91505092915050565b60006020828403121561357457600080fd5b60006135828482850161333c565b91505092915050565b60006020828403121561359d57600080fd5b60006135ab84828501613351565b91505092915050565b6135bd8161471d565b82525050565b6135cc8161472f565b82525050565b6135db8161473b565b82525050565b60006135ec826146eb565b6135f68185614701565b9350613606818560208601614810565b80840191505092915050565b61361b816147a4565b82525050565b61362a816147c8565b82525050565b613639816147ec565b82525050565b613648816147fe565b82525050565b6000613659826146f6565b613663818561470c565b9350613673818560208601614810565b61367c81614845565b840191505092915050565b600061369460088361470c565b91507f4261642063616c6c0000000000000000000000000000000000000000000000006000830152602082019050919050565b60006136d4601b8361470c565b91507f455448207472616e7366657273206e6f7420737570706f7274656400000000006000830152602082019050919050565b600061371460228361470c565b91507f436c6966662074696d65206d757374206265206265666f726520656e6420746960008301527f6d650000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b600061377a60158361470c565b91507f53746172742074696d65203e20656e642074696d6500000000000000000000006000830152602082019050919050565b60006137ba601e8361470c565b91507f4d757374207365742061207265766f636162696c697479206f7074696f6e00006000830152602082019050919050565b60006137fa60268361470c565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613860601b8361470c565b91507f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006000830152602082019050919050565b60006138a0601c8361470c565b91507f4e6f20617661696c61626c6520756e76657374656420616d6f756e74000000006000830152602082019050919050565b60006138e060148361470c565b91507f4f776e65722063616e6e6f74206265207a65726f0000000000000000000000006000830152602082019050919050565b6000613920601f8361470c565b91507f43616e6e6f742063616e63656c20616363657074656420636f6e7472616374006000830152602082019050919050565b6000613960601e8361470c565b91507f536166654d6174683a207375627472616374696f6e206f766572666c6f7700006000830152602082019050919050565b60006139a060268361470c565b91507f416464726573733a20696e73756666696369656e742062616c616e636520666f60008301527f722063616c6c00000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613a06601d8361470c565b91507f4d616e6167656420746f6b656e732063616e6e6f74206265207a65726f0000006000830152602082019050919050565b6000613a46601a8361470c565b91507f536166654d6174683a206469766973696f6e206279207a65726f0000000000006000830152602082019050919050565b6000613a8660118361470c565b91507f456d7074792062656e65666963696172790000000000000000000000000000006000830152602082019050919050565b6000613ac660138361470c565b91507f556e617574686f72697a65642063616c6c6572000000000000000000000000006000830152602082019050919050565b6000613b06601a8361470c565b91507f4d616e61676572206d757374206265206120636f6e74726163740000000000006000830152602082019050919050565b6000613b4660158361470c565b91507f416d6f756e742063616e6e6f74206265207a65726f00000000000000000000006000830152602082019050919050565b6000613b8660298361470c565b91507f43616e6e6f7420757365206d6f726520746f6b656e73207468616e207665737460008301527f656420616d6f756e7400000000000000000000000000000000000000000000006020830152604082019050919050565b6000613bec601f8361470c565b91507f506572696f64732063616e6e6f742062652062656c6f77206d696e696d756d006000830152602082019050919050565b6000613c2c60218361470c565b91507f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008301527f77000000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613c9260208361470c565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b6000613cd260168361470c565b91507f53746172742074696d65206d75737420626520736574000000000000000000006000830152602082019050919050565b6000613d1260158361470c565b91507f556e617574686f72697a65642066756e6374696f6e00000000000000000000006000830152602082019050919050565b6000613d52601d8361470c565b91507f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006000830152602082019050919050565b6000613d9260248361470c565b91507f416d6f756e7420726571756573746564203e20737572706c757320617661696c60008301527f61626c65000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613df860138361470c565b91507f416c726561647920696e697469616c697a6564000000000000000000000000006000830152602082019050919050565b6000613e3860198361470c565b91507f436f6e7472616374206973206e6f6e2d7265766f6361626c65000000000000006000830152602082019050919050565b6000613e7860178361470c565b91507f4d616e616765722063616e6e6f7420626520656d7074790000000000000000006000830152602082019050919050565b6000613eb860058361470c565b91507f21617574680000000000000000000000000000000000000000000000000000006000830152602082019050919050565b6000613ef8602a8361470c565b91507f52656c656173652073746172742074696d65206d757374206265206265666f7260008301527f6520656e642074696d65000000000000000000000000000000000000000000006020830152604082019050919050565b6000613f5e602a8361470c565b91507f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008301527f6f742073756363656564000000000000000000000000000000000000000000006020830152604082019050919050565b6000613fc4601e8361470c565b91507f4e6f20617661696c61626c652072656c65617361626c6520616d6f756e7400006000830152602082019050919050565b600061400460148361470c565b91507f546f6b656e2063616e6e6f74206265207a65726f0000000000000000000000006000830152602082019050919050565b6000614044601a8361470c565b91507f42656e65666963696172792063616e6e6f74206265207a65726f0000000000006000830152602082019050919050565b6000614084600f8361470c565b91507f416c7265616479207265766f6b656400000000000000000000000000000000006000830152602082019050919050565b6140c08161479a565b82525050565b60006140d282846135e1565b915081905092915050565b60006020820190506140f260008301846135b4565b92915050565b600060408201905061410d60008301856135b4565b61411a602083018461363f565b9392505050565b600060408201905061413660008301856135b4565b61414360208301846140b7565b9392505050565b600060208201905061415f60008301846135c3565b92915050565b600060208201905061417a60008301846135d2565b92915050565b60006020820190506141956000830184613612565b92915050565b60006020820190506141b06000830184613621565b92915050565b60006020820190506141cb6000830184613630565b92915050565b600060208201905081810360008301526141eb818461364e565b905092915050565b6000602082019050818103600083015261420c81613687565b9050919050565b6000602082019050818103600083015261422c816136c7565b9050919050565b6000602082019050818103600083015261424c81613707565b9050919050565b6000602082019050818103600083015261426c8161376d565b9050919050565b6000602082019050818103600083015261428c816137ad565b9050919050565b600060208201905081810360008301526142ac816137ed565b9050919050565b600060208201905081810360008301526142cc81613853565b9050919050565b600060208201905081810360008301526142ec81613893565b9050919050565b6000602082019050818103600083015261430c816138d3565b9050919050565b6000602082019050818103600083015261432c81613913565b9050919050565b6000602082019050818103600083015261434c81613953565b9050919050565b6000602082019050818103600083015261436c81613993565b9050919050565b6000602082019050818103600083015261438c816139f9565b9050919050565b600060208201905081810360008301526143ac81613a39565b9050919050565b600060208201905081810360008301526143cc81613a79565b9050919050565b600060208201905081810360008301526143ec81613ab9565b9050919050565b6000602082019050818103600083015261440c81613af9565b9050919050565b6000602082019050818103600083015261442c81613b39565b9050919050565b6000602082019050818103600083015261444c81613b79565b9050919050565b6000602082019050818103600083015261446c81613bdf565b9050919050565b6000602082019050818103600083015261448c81613c1f565b9050919050565b600060208201905081810360008301526144ac81613c85565b9050919050565b600060208201905081810360008301526144cc81613cc5565b9050919050565b600060208201905081810360008301526144ec81613d05565b9050919050565b6000602082019050818103600083015261450c81613d45565b9050919050565b6000602082019050818103600083015261452c81613d85565b9050919050565b6000602082019050818103600083015261454c81613deb565b9050919050565b6000602082019050818103600083015261456c81613e2b565b9050919050565b6000602082019050818103600083015261458c81613e6b565b9050919050565b600060208201905081810360008301526145ac81613eab565b9050919050565b600060208201905081810360008301526145cc81613eeb565b9050919050565b600060208201905081810360008301526145ec81613f51565b9050919050565b6000602082019050818103600083015261460c81613fb7565b9050919050565b6000602082019050818103600083015261462c81613ff7565b9050919050565b6000602082019050818103600083015261464c81614037565b9050919050565b6000602082019050818103600083015261466c81614077565b9050919050565b600060208201905061468860008301846140b7565b92915050565b6000604051905081810181811067ffffffffffffffff821117156146b5576146b4614843565b5b8060405250919050565b600067ffffffffffffffff8211156146da576146d9614843565b5b602082029050602081019050919050565b600081519050919050565b600081519050919050565b600081905092915050565b600082825260208201905092915050565b60006147288261477a565b9050919050565b60008115159050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600081905061477582614856565b919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60006147af826147b6565b9050919050565b60006147c18261477a565b9050919050565b60006147d3826147da565b9050919050565b60006147e58261477a565b9050919050565b60006147f782614767565b9050919050565b60006148098261479a565b9050919050565b60005b8381101561482e578082015181840152602081019050614813565b8381111561483d576000848401525b50505050565bfe5b6000601f19601f8301169050919050565b6003811061486757614866614843565b5b50565b6148738161471d565b811461487e57600080fd5b50565b61488a8161472f565b811461489557600080fd5b50565b600381106148a557600080fd5b50565b6148b18161479a565b81146148bc57600080fd5b5056fea2646970667358221220e7181b2ba4d1c3bb9e57d12c063690ecc18fa07966017865e716378e6ce1068c64736f6c63430007030033", + "devdoc": { + "kind": "dev", + "methods": { + "acceptLock()": { + "details": "Can only be called by the beneficiary" + }, + "amountPerPeriod()": { + "returns": { + "_0": "Amount of tokens available after each period" + } + }, + "approveProtocol()": { + "details": "Approves all token destinations registered in the manager to pull tokens" + }, + "availableAmount()": { + "details": "Implements the step-by-step schedule based on periods for available tokens", + "returns": { + "_0": "Amount of tokens available according to the schedule" + } + }, + "cancelLock()": { + "details": "Can only be called by the owner" + }, + "changeBeneficiary(address)": { + "details": "Can only be called by the beneficiary", + "params": { + "_newBeneficiary": "Address of the new beneficiary address" + } + }, + "currentBalance()": { + "returns": { + "_0": "Tokens held in the contract" + } + }, + "currentPeriod()": { + "returns": { + "_0": "A number that represents the current period" + } + }, + "currentTime()": { + "returns": { + "_0": "Current block timestamp" + } + }, + "duration()": { + "returns": { + "_0": "Amount of seconds from contract startTime to endTime" + } + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "passedPeriods()": { + "returns": { + "_0": "A number of periods that passed since the schedule started" + } + }, + "periodDuration()": { + "returns": { + "_0": "Duration of each period in seconds" + } + }, + "releasableAmount()": { + "details": "Considers the schedule, takes into account already released tokens and used amount", + "returns": { + "_0": "Amount of tokens ready to be released" + } + }, + "release()": { + "details": "All available releasable tokens are transferred to beneficiary" + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." + }, + "revoke()": { + "details": "Vesting schedule is always calculated based on managed tokens" + }, + "revokeProtocol()": { + "details": "Revokes approval to all token destinations in the manager to pull tokens" + }, + "setManager(address)": { + "params": { + "_newManager": "Address of the new manager" + } + }, + "sinceStartTime()": { + "details": "Returns zero if called before conctract starTime", + "returns": { + "_0": "Seconds elapsed from contract startTime" + } + }, + "surplusAmount()": { + "details": "All funds over outstanding amount is considered surplus that can be withdrawn by beneficiary. Note this might not be the correct value for wallets transferred to L2 (i.e. an L2GraphTokenLockWallet), as the released amount will be skewed, so the beneficiary might have to bridge back to L1 to release the surplus.", + "returns": { + "_0": "Amount of tokens considered as surplus" + } + }, + "totalOutstandingAmount()": { + "details": "Does not consider schedule but just global amounts tracked", + "returns": { + "_0": "Amount of outstanding tokens for the lifetime of the contract" + } + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + }, + "vestedAmount()": { + "details": "Similar to available amount, but is fully vested when contract is non-revocable", + "returns": { + "_0": "Amount of tokens already vested" + } + }, + "withdrawSurplus(uint256)": { + "details": "Tokens in the contract over outstanding amount are considered as surplus", + "params": { + "_amount": "Amount of tokens to withdraw" + } + } + }, + "title": "L2GraphTokenLockWallet", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "acceptLock()": { + "notice": "Beneficiary accepts the lock, the owner cannot retrieve back the tokens" + }, + "amountPerPeriod()": { + "notice": "Returns amount available to be released after each period according to schedule" + }, + "approveProtocol()": { + "notice": "Approves protocol access of the tokens managed by this contract" + }, + "availableAmount()": { + "notice": "Gets the currently available token according to the schedule" + }, + "cancelLock()": { + "notice": "Owner cancel the lock and return the balance in the contract" + }, + "changeBeneficiary(address)": { + "notice": "Change the beneficiary of funds managed by the contract" + }, + "currentBalance()": { + "notice": "Returns the amount of tokens currently held by the contract" + }, + "currentPeriod()": { + "notice": "Gets the current period based on the schedule" + }, + "currentTime()": { + "notice": "Returns the current block timestamp" + }, + "duration()": { + "notice": "Gets duration of contract from start to end in seconds" + }, + "passedPeriods()": { + "notice": "Gets the number of periods that passed since the first period" + }, + "periodDuration()": { + "notice": "Returns the duration of each period in seconds" + }, + "releasableAmount()": { + "notice": "Gets tokens currently available for release" + }, + "release()": { + "notice": "Releases tokens based on the configured schedule" + }, + "revoke()": { + "notice": "Revokes a vesting schedule and return the unvested tokens to the owner" + }, + "revokeProtocol()": { + "notice": "Revokes protocol access of the tokens managed by this contract" + }, + "setManager(address)": { + "notice": "Sets a new manager for this contract" + }, + "sinceStartTime()": { + "notice": "Gets time elapsed since the start of the contract" + }, + "surplusAmount()": { + "notice": "Gets surplus amount in the contract based on outstanding amount to release" + }, + "totalOutstandingAmount()": { + "notice": "Gets the outstanding amount yet to be released based on the whole contract lifetime" + }, + "vestedAmount()": { + "notice": "Gets the amount of currently vested tokens" + }, + "withdrawSurplus(uint256)": { + "notice": "Withdraws surplus, unmanaged tokens from the contract" + } + }, + "notice": "This contract is built on top of the base GraphTokenLock functionality. It allows wallet beneficiaries to use the deposited funds to perform specific function calls on specific contracts. The idea is that supporters with locked tokens can participate in the protocol but disallow any release before the vesting/lock schedule. The beneficiary can issue authorized function calls to this contract that will get forwarded to a target contract. A target contract is any of our protocol contracts. The function calls allowed are queried to the GraphTokenLockManager, this way the same configuration can be shared for all the created lock wallet contracts. This L2 variant includes a special initializer so that it can be created from a wallet's data received from L1. These transferred wallets will not allow releasing funds in L2 until the end of the vesting timeline, but they can allow withdrawing funds back to L1 using the L2GraphTokenLockTransferTool contract. Note that surplusAmount and releasedAmount in L2 will be skewed for wallets received from L1, so releasing surplus tokens might also only be possible by bridging tokens back to L1. NOTE: Contracts used as target must have its function signatures checked to avoid collisions with any of this contract functions. Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience the maximum amount of tokens is authorized. Function calls do not forward ETH value so DO NOT SEND ETH TO THIS CONTRACT.", + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 6797, + "contract": "contracts/L2GraphTokenLockWallet.sol:L2GraphTokenLockWallet", + "label": "_owner", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 6802, + "contract": "contracts/L2GraphTokenLockWallet.sol:L2GraphTokenLockWallet", + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 3244, + "contract": "contracts/L2GraphTokenLockWallet.sol:L2GraphTokenLockWallet", + "label": "token", + "offset": 0, + "slot": "51", + "type": "t_contract(IERC20)1710" + }, + { + "astId": 3246, + "contract": "contracts/L2GraphTokenLockWallet.sol:L2GraphTokenLockWallet", + "label": "beneficiary", + "offset": 0, + "slot": "52", + "type": "t_address" + }, + { + "astId": 3248, + "contract": "contracts/L2GraphTokenLockWallet.sol:L2GraphTokenLockWallet", + "label": "managedAmount", + "offset": 0, + "slot": "53", + "type": "t_uint256" + }, + { + "astId": 3250, + "contract": "contracts/L2GraphTokenLockWallet.sol:L2GraphTokenLockWallet", + "label": "startTime", + "offset": 0, + "slot": "54", + "type": "t_uint256" + }, + { + "astId": 3252, + "contract": "contracts/L2GraphTokenLockWallet.sol:L2GraphTokenLockWallet", + "label": "endTime", + "offset": 0, + "slot": "55", + "type": "t_uint256" + }, + { + "astId": 3254, + "contract": "contracts/L2GraphTokenLockWallet.sol:L2GraphTokenLockWallet", + "label": "periods", + "offset": 0, + "slot": "56", + "type": "t_uint256" + }, + { + "astId": 3256, + "contract": "contracts/L2GraphTokenLockWallet.sol:L2GraphTokenLockWallet", + "label": "releaseStartTime", + "offset": 0, + "slot": "57", + "type": "t_uint256" + }, + { + "astId": 3258, + "contract": "contracts/L2GraphTokenLockWallet.sol:L2GraphTokenLockWallet", + "label": "vestingCliffTime", + "offset": 0, + "slot": "58", + "type": "t_uint256" + }, + { + "astId": 3260, + "contract": "contracts/L2GraphTokenLockWallet.sol:L2GraphTokenLockWallet", + "label": "revocable", + "offset": 0, + "slot": "59", + "type": "t_enum(Revocability)5096" + }, + { + "astId": 3262, + "contract": "contracts/L2GraphTokenLockWallet.sol:L2GraphTokenLockWallet", + "label": "isRevoked", + "offset": 1, + "slot": "59", + "type": "t_bool" + }, + { + "astId": 3264, + "contract": "contracts/L2GraphTokenLockWallet.sol:L2GraphTokenLockWallet", + "label": "isInitialized", + "offset": 2, + "slot": "59", + "type": "t_bool" + }, + { + "astId": 3266, + "contract": "contracts/L2GraphTokenLockWallet.sol:L2GraphTokenLockWallet", + "label": "isAccepted", + "offset": 3, + "slot": "59", + "type": "t_bool" + }, + { + "astId": 3268, + "contract": "contracts/L2GraphTokenLockWallet.sol:L2GraphTokenLockWallet", + "label": "releasedAmount", + "offset": 0, + "slot": "60", + "type": "t_uint256" + }, + { + "astId": 3270, + "contract": "contracts/L2GraphTokenLockWallet.sol:L2GraphTokenLockWallet", + "label": "revokedAmount", + "offset": 0, + "slot": "61", + "type": "t_uint256" + }, + { + "astId": 4692, + "contract": "contracts/L2GraphTokenLockWallet.sol:L2GraphTokenLockWallet", + "label": "manager", + "offset": 0, + "slot": "62", + "type": "t_contract(IGraphTokenLockManager)5278" + }, + { + "astId": 4694, + "contract": "contracts/L2GraphTokenLockWallet.sol:L2GraphTokenLockWallet", + "label": "usedAmount", + "offset": 0, + "slot": "63", + "type": "t_uint256" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)50_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_contract(IERC20)1710": { + "encoding": "inplace", + "label": "contract IERC20", + "numberOfBytes": "20" + }, + "t_contract(IGraphTokenLockManager)5278": { + "encoding": "inplace", + "label": "contract IGraphTokenLockManager", + "numberOfBytes": "20" + }, + "t_enum(Revocability)5096": { + "encoding": "inplace", + "label": "enum IGraphTokenLock.Revocability", + "numberOfBytes": "1" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} \ No newline at end of file diff --git a/packages/token-distribution/deployments/arbitrum-one/solcInputs/b5cdad58099d39cd1aed000b2fd864d8.json b/packages/token-distribution/deployments/arbitrum-one/solcInputs/b5cdad58099d39cd1aed000b2fd864d8.json new file mode 100644 index 000000000..4eda754ae --- /dev/null +++ b/packages/token-distribution/deployments/arbitrum-one/solcInputs/b5cdad58099d39cd1aed000b2fd864d8.json @@ -0,0 +1,152 @@ +{ + "language": "Solidity", + "sources": { + "@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/**\n * @dev Wrappers over Solidity's arithmetic operations with added overflow\n * checks.\n *\n * Arithmetic operations in Solidity wrap on overflow. This can easily result\n * in bugs, because programmers usually assume that an overflow raises an\n * error, which is the standard behavior in high level programming languages.\n * `SafeMath` restores this intuition by reverting the transaction when an\n * operation overflows.\n *\n * Using this library instead of the unchecked operations eliminates an entire\n * class of bugs, so it's recommended to use it always.\n */\nlibrary SafeMathUpgradeable {\n /**\n * @dev Returns the addition of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n uint256 c = a + b;\n if (c < a) return (false, 0);\n return (true, c);\n }\n\n /**\n * @dev Returns the substraction of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n if (b > a) return (false, 0);\n return (true, a - b);\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\n // benefit is lost if 'b' is also tested.\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\n if (a == 0) return (true, 0);\n uint256 c = a * b;\n if (c / a != b) return (false, 0);\n return (true, c);\n }\n\n /**\n * @dev Returns the division of two unsigned integers, with a division by zero flag.\n *\n * _Available since v3.4._\n */\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n if (b == 0) return (false, 0);\n return (true, a / b);\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\n *\n * _Available since v3.4._\n */\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n if (b == 0) return (false, 0);\n return (true, a % b);\n }\n\n /**\n * @dev Returns the addition of two unsigned integers, reverting on\n * overflow.\n *\n * Counterpart to Solidity's `+` operator.\n *\n * Requirements:\n *\n * - Addition cannot overflow.\n */\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\n uint256 c = a + b;\n require(c >= a, \"SafeMath: addition overflow\");\n return c;\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, reverting on\n * overflow (when the result is negative).\n *\n * Counterpart to Solidity's `-` operator.\n *\n * Requirements:\n *\n * - Subtraction cannot overflow.\n */\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b <= a, \"SafeMath: subtraction overflow\");\n return a - b;\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, reverting on\n * overflow.\n *\n * Counterpart to Solidity's `*` operator.\n *\n * Requirements:\n *\n * - Multiplication cannot overflow.\n */\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n if (a == 0) return 0;\n uint256 c = a * b;\n require(c / a == b, \"SafeMath: multiplication overflow\");\n return c;\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers, reverting on\n * division by zero. The result is rounded towards zero.\n *\n * Counterpart to Solidity's `/` operator. Note: this function uses a\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\n * uses an invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b > 0, \"SafeMath: division by zero\");\n return a / b;\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * reverting when dividing by zero.\n *\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\n * opcode (which leaves remaining gas untouched) while Solidity uses an\n * invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b > 0, \"SafeMath: modulo by zero\");\n return a % b;\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\n * overflow (when the result is negative).\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {trySub}.\n *\n * Counterpart to Solidity's `-` operator.\n *\n * Requirements:\n *\n * - Subtraction cannot overflow.\n */\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b <= a, errorMessage);\n return a - b;\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers, reverting with custom message on\n * division by zero. The result is rounded towards zero.\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {tryDiv}.\n *\n * Counterpart to Solidity's `/` operator. Note: this function uses a\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\n * uses an invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b > 0, errorMessage);\n return a / b;\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * reverting with custom message when dividing by zero.\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {tryMod}.\n *\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\n * opcode (which leaves remaining gas untouched) while Solidity uses an\n * invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b > 0, errorMessage);\n return a % b;\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\n// solhint-disable-next-line compiler-version\npragma solidity >=0.4.24 <0.8.0;\n\nimport \"../utils/AddressUpgradeable.sol\";\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {UpgradeableProxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n */\nabstract contract Initializable {\n\n /**\n * @dev Indicates that the contract has been initialized.\n */\n bool private _initialized;\n\n /**\n * @dev Indicates that the contract is in the process of being initialized.\n */\n bool private _initializing;\n\n /**\n * @dev Modifier to protect an initializer function from being invoked twice.\n */\n modifier initializer() {\n require(_initializing || _isConstructor() || !_initialized, \"Initializable: contract is already initialized\");\n\n bool isTopLevelCall = !_initializing;\n if (isTopLevelCall) {\n _initializing = true;\n _initialized = true;\n }\n\n _;\n\n if (isTopLevelCall) {\n _initializing = false;\n }\n }\n\n /// @dev Returns true if and only if the function is running in the constructor\n function _isConstructor() private view returns (bool) {\n return !AddressUpgradeable.isContract(address(this));\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.2 <0.8.0;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary AddressUpgradeable {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize, which returns 0 for contracts in\n // construction, since the code is only stored at the end of the\n // constructor execution.\n\n uint256 size;\n // solhint-disable-next-line no-inline-assembly\n assembly { size := extcodesize(account) }\n return size > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n // solhint-disable-next-line avoid-low-level-calls, avoid-call-value\n (bool success, ) = recipient.call{ value: amount }(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain`call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCall(target, data, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n require(isContract(target), \"Address: call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.call{ value: value }(data);\n return _verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {\n require(isContract(target), \"Address: static call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.staticcall(data);\n return _verifyCallResult(success, returndata, errorMessage);\n }\n\n function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {\n if (success) {\n return returndata;\n } else {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n }\n}\n" + }, + "@openzeppelin/contracts/access/Ownable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\nimport \"../utils/Context.sol\";\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor () internal {\n address msgSender = _msgSender();\n _owner = msgSender;\n emit OwnershipTransferred(address(0), msgSender);\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n _;\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n emit OwnershipTransferred(_owner, address(0));\n _owner = address(0);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n emit OwnershipTransferred(_owner, newOwner);\n _owner = newOwner;\n }\n}\n" + }, + "@openzeppelin/contracts/math/SafeMath.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/**\n * @dev Wrappers over Solidity's arithmetic operations with added overflow\n * checks.\n *\n * Arithmetic operations in Solidity wrap on overflow. This can easily result\n * in bugs, because programmers usually assume that an overflow raises an\n * error, which is the standard behavior in high level programming languages.\n * `SafeMath` restores this intuition by reverting the transaction when an\n * operation overflows.\n *\n * Using this library instead of the unchecked operations eliminates an entire\n * class of bugs, so it's recommended to use it always.\n */\nlibrary SafeMath {\n /**\n * @dev Returns the addition of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n uint256 c = a + b;\n if (c < a) return (false, 0);\n return (true, c);\n }\n\n /**\n * @dev Returns the substraction of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n if (b > a) return (false, 0);\n return (true, a - b);\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\n // benefit is lost if 'b' is also tested.\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\n if (a == 0) return (true, 0);\n uint256 c = a * b;\n if (c / a != b) return (false, 0);\n return (true, c);\n }\n\n /**\n * @dev Returns the division of two unsigned integers, with a division by zero flag.\n *\n * _Available since v3.4._\n */\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n if (b == 0) return (false, 0);\n return (true, a / b);\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\n *\n * _Available since v3.4._\n */\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n if (b == 0) return (false, 0);\n return (true, a % b);\n }\n\n /**\n * @dev Returns the addition of two unsigned integers, reverting on\n * overflow.\n *\n * Counterpart to Solidity's `+` operator.\n *\n * Requirements:\n *\n * - Addition cannot overflow.\n */\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\n uint256 c = a + b;\n require(c >= a, \"SafeMath: addition overflow\");\n return c;\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, reverting on\n * overflow (when the result is negative).\n *\n * Counterpart to Solidity's `-` operator.\n *\n * Requirements:\n *\n * - Subtraction cannot overflow.\n */\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b <= a, \"SafeMath: subtraction overflow\");\n return a - b;\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, reverting on\n * overflow.\n *\n * Counterpart to Solidity's `*` operator.\n *\n * Requirements:\n *\n * - Multiplication cannot overflow.\n */\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n if (a == 0) return 0;\n uint256 c = a * b;\n require(c / a == b, \"SafeMath: multiplication overflow\");\n return c;\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers, reverting on\n * division by zero. The result is rounded towards zero.\n *\n * Counterpart to Solidity's `/` operator. Note: this function uses a\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\n * uses an invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b > 0, \"SafeMath: division by zero\");\n return a / b;\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * reverting when dividing by zero.\n *\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\n * opcode (which leaves remaining gas untouched) while Solidity uses an\n * invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b > 0, \"SafeMath: modulo by zero\");\n return a % b;\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\n * overflow (when the result is negative).\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {trySub}.\n *\n * Counterpart to Solidity's `-` operator.\n *\n * Requirements:\n *\n * - Subtraction cannot overflow.\n */\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b <= a, errorMessage);\n return a - b;\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers, reverting with custom message on\n * division by zero. The result is rounded towards zero.\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {tryDiv}.\n *\n * Counterpart to Solidity's `/` operator. Note: this function uses a\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\n * uses an invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b > 0, errorMessage);\n return a / b;\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * reverting with custom message when dividing by zero.\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {tryMod}.\n *\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\n * opcode (which leaves remaining gas untouched) while Solidity uses an\n * invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b > 0, errorMessage);\n return a % b;\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/ERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\nimport \"../../utils/Context.sol\";\nimport \"./IERC20.sol\";\nimport \"../../math/SafeMath.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin guidelines: functions revert instead\n * of returning `false` on failure. This behavior is nonetheless conventional\n * and does not conflict with the expectations of ERC20 applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20 {\n using SafeMath for uint256;\n\n mapping (address => uint256) private _balances;\n\n mapping (address => mapping (address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n uint8 private _decimals;\n\n /**\n * @dev Sets the values for {name} and {symbol}, initializes {decimals} with\n * a default value of 18.\n *\n * To select a different value for {decimals}, use {_setupDecimals}.\n *\n * All three of these values are immutable: they can only be set once during\n * construction.\n */\n constructor (string memory name_, string memory symbol_) public {\n _name = name_;\n _symbol = symbol_;\n _decimals = 18;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5,05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless {_setupDecimals} is\n * called.\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual returns (uint8) {\n return _decimals;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `recipient` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address recipient, uint256 amount) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * Requirements:\n *\n * - `sender` and `recipient` cannot be the zero address.\n * - `sender` must have a balance of at least `amount`.\n * - the caller must have allowance for ``sender``'s tokens of at least\n * `amount`.\n */\n function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, \"ERC20: transfer amount exceeds allowance\"));\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, \"ERC20: decreased allowance below zero\"));\n return true;\n }\n\n /**\n * @dev Moves tokens `amount` from `sender` to `recipient`.\n *\n * This is internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `sender` cannot be the zero address.\n * - `recipient` cannot be the zero address.\n * - `sender` must have a balance of at least `amount`.\n */\n function _transfer(address sender, address recipient, uint256 amount) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(sender, recipient, amount);\n\n _balances[sender] = _balances[sender].sub(amount, \"ERC20: transfer amount exceeds balance\");\n _balances[recipient] = _balances[recipient].add(amount);\n emit Transfer(sender, recipient, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply = _totalSupply.add(amount);\n _balances[account] = _balances[account].add(amount);\n emit Transfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n _balances[account] = _balances[account].sub(amount, \"ERC20: burn amount exceeds balance\");\n _totalSupply = _totalSupply.sub(amount);\n emit Transfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(address owner, address spender, uint256 amount) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Sets {decimals} to a value other than the default one of 18.\n *\n * WARNING: This function should only be called from the constructor. Most\n * applications that interact with token contracts will not expect\n * {decimals} to ever change, and may work incorrectly if it does.\n */\n function _setupDecimals(uint8 decimals_) internal virtual {\n _decimals = decimals_;\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be to transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `recipient`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address recipient, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `sender` to `recipient` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);\n\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/SafeERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"../../math/SafeMath.sol\";\nimport \"../../utils/Address.sol\";\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n using SafeMath for uint256;\n using Address for address;\n\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\n }\n\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\n }\n\n /**\n * @dev Deprecated. This function has issues similar to the ones found in\n * {IERC20-approve}, and its usage is discouraged.\n *\n * Whenever possible, use {safeIncreaseAllowance} and\n * {safeDecreaseAllowance} instead.\n */\n function safeApprove(IERC20 token, address spender, uint256 value) internal {\n // safeApprove should only be called when setting an initial allowance,\n // or when resetting it to zero. To increase and decrease it, use\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\n // solhint-disable-next-line max-line-length\n require((value == 0) || (token.allowance(address(this), spender) == 0),\n \"SafeERC20: approve from non-zero to non-zero allowance\"\n );\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\n }\n\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n uint256 newAllowance = token.allowance(address(this), spender).add(value);\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\n\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n uint256 newAllowance = token.allowance(address(this), spender).sub(value, \"SafeERC20: decreased allowance below zero\");\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n */\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that\n // the target address contains contract code and also asserts for success in the low-level call.\n\n bytes memory returndata = address(token).functionCall(data, \"SafeERC20: low-level call failed\");\n if (returndata.length > 0) { // Return data is optional\n // solhint-disable-next-line max-line-length\n require(abi.decode(returndata, (bool)), \"SafeERC20: ERC20 operation did not succeed\");\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Address.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.2 <0.8.0;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize, which returns 0 for contracts in\n // construction, since the code is only stored at the end of the\n // constructor execution.\n\n uint256 size;\n // solhint-disable-next-line no-inline-assembly\n assembly { size := extcodesize(account) }\n return size > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n // solhint-disable-next-line avoid-low-level-calls, avoid-call-value\n (bool success, ) = recipient.call{ value: amount }(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain`call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCall(target, data, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n require(isContract(target), \"Address: call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.call{ value: value }(data);\n return _verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {\n require(isContract(target), \"Address: static call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.staticcall(data);\n return _verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\n require(isContract(target), \"Address: delegate call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return _verifyCallResult(success, returndata, errorMessage);\n }\n\n function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {\n if (success) {\n return returndata;\n } else {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/*\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with GSN meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address payable) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes memory) {\n this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\n return msg.data;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Create2.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/**\n * @dev Helper to make usage of the `CREATE2` EVM opcode easier and safer.\n * `CREATE2` can be used to compute in advance the address where a smart\n * contract will be deployed, which allows for interesting new mechanisms known\n * as 'counterfactual interactions'.\n *\n * See the https://eips.ethereum.org/EIPS/eip-1014#motivation[EIP] for more\n * information.\n */\nlibrary Create2 {\n /**\n * @dev Deploys a contract using `CREATE2`. The address where the contract\n * will be deployed can be known in advance via {computeAddress}.\n *\n * The bytecode for a contract can be obtained from Solidity with\n * `type(contractName).creationCode`.\n *\n * Requirements:\n *\n * - `bytecode` must not be empty.\n * - `salt` must have not been used for `bytecode` already.\n * - the factory must have a balance of at least `amount`.\n * - if `amount` is non-zero, `bytecode` must have a `payable` constructor.\n */\n function deploy(uint256 amount, bytes32 salt, bytes memory bytecode) internal returns (address) {\n address addr;\n require(address(this).balance >= amount, \"Create2: insufficient balance\");\n require(bytecode.length != 0, \"Create2: bytecode length is zero\");\n // solhint-disable-next-line no-inline-assembly\n assembly {\n addr := create2(amount, add(bytecode, 0x20), mload(bytecode), salt)\n }\n require(addr != address(0), \"Create2: Failed on deploy\");\n return addr;\n }\n\n /**\n * @dev Returns the address where a contract will be stored if deployed via {deploy}. Any change in the\n * `bytecodeHash` or `salt` will result in a new destination address.\n */\n function computeAddress(bytes32 salt, bytes32 bytecodeHash) internal view returns (address) {\n return computeAddress(salt, bytecodeHash, address(this));\n }\n\n /**\n * @dev Returns the address where a contract will be stored if deployed via {deploy} from a contract located at\n * `deployer`. If `deployer` is this contract's address, returns the same value as {computeAddress}.\n */\n function computeAddress(bytes32 salt, bytes32 bytecodeHash, address deployer) internal pure returns (address) {\n bytes32 _data = keccak256(\n abi.encodePacked(bytes1(0xff), deployer, salt, bytecodeHash)\n );\n return address(uint160(uint256(_data)));\n }\n}\n" + }, + "@openzeppelin/contracts/utils/EnumerableSet.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/**\n * @dev Library for managing\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\n * types.\n *\n * Sets have the following properties:\n *\n * - Elements are added, removed, and checked for existence in constant time\n * (O(1)).\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\n *\n * ```\n * contract Example {\n * // Add the library methods\n * using EnumerableSet for EnumerableSet.AddressSet;\n *\n * // Declare a set state variable\n * EnumerableSet.AddressSet private mySet;\n * }\n * ```\n *\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\n * and `uint256` (`UintSet`) are supported.\n */\nlibrary EnumerableSet {\n // To implement this library for multiple types with as little code\n // repetition as possible, we write it in terms of a generic Set type with\n // bytes32 values.\n // The Set implementation uses private functions, and user-facing\n // implementations (such as AddressSet) are just wrappers around the\n // underlying Set.\n // This means that we can only create new EnumerableSets for types that fit\n // in bytes32.\n\n struct Set {\n // Storage of set values\n bytes32[] _values;\n\n // Position of the value in the `values` array, plus 1 because index 0\n // means a value is not in the set.\n mapping (bytes32 => uint256) _indexes;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function _add(Set storage set, bytes32 value) private returns (bool) {\n if (!_contains(set, value)) {\n set._values.push(value);\n // The value is stored at length-1, but we add 1 to all indexes\n // and use 0 as a sentinel value\n set._indexes[value] = set._values.length;\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function _remove(Set storage set, bytes32 value) private returns (bool) {\n // We read and store the value's index to prevent multiple reads from the same storage slot\n uint256 valueIndex = set._indexes[value];\n\n if (valueIndex != 0) { // Equivalent to contains(set, value)\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\n // the array, and then remove the last element (sometimes called as 'swap and pop').\n // This modifies the order of the array, as noted in {at}.\n\n uint256 toDeleteIndex = valueIndex - 1;\n uint256 lastIndex = set._values.length - 1;\n\n // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs\n // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.\n\n bytes32 lastvalue = set._values[lastIndex];\n\n // Move the last value to the index where the value to delete is\n set._values[toDeleteIndex] = lastvalue;\n // Update the index for the moved value\n set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based\n\n // Delete the slot where the moved value was stored\n set._values.pop();\n\n // Delete the index for the deleted slot\n delete set._indexes[value];\n\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\n return set._indexes[value] != 0;\n }\n\n /**\n * @dev Returns the number of values on the set. O(1).\n */\n function _length(Set storage set) private view returns (uint256) {\n return set._values.length;\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\n require(set._values.length > index, \"EnumerableSet: index out of bounds\");\n return set._values[index];\n }\n\n // Bytes32Set\n\n struct Bytes32Set {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _add(set._inner, value);\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _remove(set._inner, value);\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\n return _contains(set._inner, value);\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(Bytes32Set storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\n return _at(set._inner, index);\n }\n\n // AddressSet\n\n struct AddressSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(AddressSet storage set, address value) internal returns (bool) {\n return _add(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(AddressSet storage set, address value) internal returns (bool) {\n return _remove(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(AddressSet storage set, address value) internal view returns (bool) {\n return _contains(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(AddressSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\n return address(uint160(uint256(_at(set._inner, index))));\n }\n\n\n // UintSet\n\n struct UintSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(UintSet storage set, uint256 value) internal returns (bool) {\n return _add(set._inner, bytes32(value));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\n return _remove(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\n return _contains(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns the number of values on the set. O(1).\n */\n function length(UintSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\n return uint256(_at(set._inner, index));\n }\n}\n" + }, + "contracts/arbitrum/ITokenGateway.sol": { + "content": "// SPDX-License-Identifier: Apache-2.0\n\n/*\n * Copyright 2020, Offchain Labs, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * Originally copied from:\n * https://github.com/OffchainLabs/arbitrum/tree/e3a6307ad8a2dc2cad35728a2a9908cfd8dd8ef9/packages/arb-bridge-peripherals\n *\n * MODIFIED from Offchain Labs' implementation:\n * - Changed solidity version to 0.7.6 (pablo@edgeandnode.com)\n *\n */\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\ninterface ITokenGateway {\n /// @notice event deprecated in favor of DepositInitiated and WithdrawalInitiated\n // event OutboundTransferInitiated(\n // address token,\n // address indexed _from,\n // address indexed _to,\n // uint256 indexed _transferId,\n // uint256 _amount,\n // bytes _data\n // );\n\n /// @notice event deprecated in favor of DepositFinalized and WithdrawalFinalized\n // event InboundTransferFinalized(\n // address token,\n // address indexed _from,\n // address indexed _to,\n // uint256 indexed _transferId,\n // uint256 _amount,\n // bytes _data\n // );\n\n function outboundTransfer(\n address _token,\n address _to,\n uint256 _amount,\n uint256 _maxGas,\n uint256 _gasPriceBid,\n bytes calldata _data\n ) external payable returns (bytes memory);\n\n function finalizeInboundTransfer(\n address _token,\n address _from,\n address _to,\n uint256 _amount,\n bytes calldata _data\n ) external payable;\n\n /**\n * @notice Calculate the address used when bridging an ERC20 token\n * @dev the L1 and L2 address oracles may not always be in sync.\n * For example, a custom token may have been registered but not deployed or the contract self destructed.\n * @param l1ERC20 address of L1 token\n * @return L2 address of a bridged ERC20 token\n */\n function calculateL2TokenAddress(address l1ERC20) external view returns (address);\n}\n" + }, + "contracts/GraphTokenDistributor.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\nimport \"@openzeppelin/contracts/math/SafeMath.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\";\n\n/**\n * @title GraphTokenDistributor\n * @dev Contract that allows distribution of tokens to multiple beneficiaries.\n * The contract accept deposits in the configured token by anyone.\n * The owner can setup the desired distribution by setting the amount of tokens\n * assigned to each beneficiary account.\n * Beneficiaries claim for their allocated tokens.\n * Only the owner can withdraw tokens from this contract without limitations.\n * For the distribution to work this contract must be unlocked by the owner.\n */\ncontract GraphTokenDistributor is Ownable {\n using SafeMath for uint256;\n using SafeERC20 for IERC20;\n\n // -- State --\n\n bool public locked;\n mapping(address => uint256) public beneficiaries;\n\n IERC20 public token;\n\n // -- Events --\n\n event BeneficiaryUpdated(address indexed beneficiary, uint256 amount);\n event TokensDeposited(address indexed sender, uint256 amount);\n event TokensWithdrawn(address indexed sender, uint256 amount);\n event TokensClaimed(address indexed beneficiary, address to, uint256 amount);\n event LockUpdated(bool locked);\n\n modifier whenNotLocked() {\n require(locked == false, \"Distributor: Claim is locked\");\n _;\n }\n\n /**\n * Constructor.\n * @param _token Token to use for deposits and withdrawals\n */\n constructor(IERC20 _token) {\n token = _token;\n locked = true;\n }\n\n /**\n * Deposit tokens into the contract.\n * Even if the ERC20 token can be transferred directly to the contract\n * this function provide a safe interface to do the transfer and avoid mistakes\n * @param _amount Amount to deposit\n */\n function deposit(uint256 _amount) external {\n token.safeTransferFrom(msg.sender, address(this), _amount);\n emit TokensDeposited(msg.sender, _amount);\n }\n\n // -- Admin functions --\n\n /**\n * Add token balance available for account.\n * @param _account Address to assign tokens to\n * @param _amount Amount of tokens to assign to beneficiary\n */\n function addBeneficiaryTokens(address _account, uint256 _amount) external onlyOwner {\n _setBeneficiaryTokens(_account, beneficiaries[_account].add(_amount));\n }\n\n /**\n * Add token balance available for multiple accounts.\n * @param _accounts Addresses to assign tokens to\n * @param _amounts Amounts of tokens to assign to beneficiary\n */\n function addBeneficiaryTokensMulti(address[] calldata _accounts, uint256[] calldata _amounts) external onlyOwner {\n require(_accounts.length == _amounts.length, \"Distributor: !length\");\n for (uint256 i = 0; i < _accounts.length; i++) {\n _setBeneficiaryTokens(_accounts[i], beneficiaries[_accounts[i]].add(_amounts[i]));\n }\n }\n\n /**\n * Remove token balance available for account.\n * @param _account Address to assign tokens to\n * @param _amount Amount of tokens to assign to beneficiary\n */\n function subBeneficiaryTokens(address _account, uint256 _amount) external onlyOwner {\n _setBeneficiaryTokens(_account, beneficiaries[_account].sub(_amount));\n }\n\n /**\n * Remove token balance available for multiple accounts.\n * @param _accounts Addresses to assign tokens to\n * @param _amounts Amounts of tokens to assign to beneficiary\n */\n function subBeneficiaryTokensMulti(address[] calldata _accounts, uint256[] calldata _amounts) external onlyOwner {\n require(_accounts.length == _amounts.length, \"Distributor: !length\");\n for (uint256 i = 0; i < _accounts.length; i++) {\n _setBeneficiaryTokens(_accounts[i], beneficiaries[_accounts[i]].sub(_amounts[i]));\n }\n }\n\n /**\n * Set amount of tokens available for beneficiary account.\n * @param _account Address to assign tokens to\n * @param _amount Amount of tokens to assign to beneficiary\n */\n function _setBeneficiaryTokens(address _account, uint256 _amount) private {\n require(_account != address(0), \"Distributor: !account\");\n\n beneficiaries[_account] = _amount;\n emit BeneficiaryUpdated(_account, _amount);\n }\n\n /**\n * Set locked withdrawals.\n * @param _locked True to lock withdrawals\n */\n function setLocked(bool _locked) external onlyOwner {\n locked = _locked;\n emit LockUpdated(_locked);\n }\n\n /**\n * Withdraw tokens from the contract. This function is included as\n * a escape hatch in case of mistakes or to recover remaining funds.\n * @param _amount Amount of tokens to withdraw\n */\n function withdraw(uint256 _amount) external onlyOwner {\n token.safeTransfer(msg.sender, _amount);\n emit TokensWithdrawn(msg.sender, _amount);\n }\n\n // -- Beneficiary functions --\n\n /**\n * Claim tokens and send to caller.\n */\n function claim() external whenNotLocked {\n claimTo(msg.sender);\n }\n\n /**\n * Claim tokens and send to address.\n * @param _to Address where to send tokens\n */\n function claimTo(address _to) public whenNotLocked {\n uint256 claimableTokens = beneficiaries[msg.sender];\n require(claimableTokens > 0, \"Distributor: Unavailable funds\");\n\n _setBeneficiaryTokens(msg.sender, 0);\n\n token.safeTransfer(_to, claimableTokens);\n emit TokensClaimed(msg.sender, _to, claimableTokens);\n }\n}\n" + }, + "contracts/GraphTokenLock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport \"@openzeppelin/contracts/math/SafeMath.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\";\n\nimport { Ownable as OwnableInitializable } from \"./Ownable.sol\";\nimport \"./MathUtils.sol\";\nimport \"./IGraphTokenLock.sol\";\n\n/**\n * @title GraphTokenLock\n * @notice Contract that manages an unlocking schedule of tokens.\n * @dev The contract lock manage a number of tokens deposited into the contract to ensure that\n * they can only be released under certain time conditions.\n *\n * This contract implements a release scheduled based on periods and tokens are released in steps\n * after each period ends. It can be configured with one period in which case it is like a plain TimeLock.\n * It also supports revocation to be used for vesting schedules.\n *\n * The contract supports receiving extra funds than the managed tokens ones that can be\n * withdrawn by the beneficiary at any time.\n *\n * A releaseStartTime parameter is included to override the default release schedule and\n * perform the first release on the configured time. After that it will continue with the\n * default schedule.\n */\nabstract contract GraphTokenLock is OwnableInitializable, IGraphTokenLock {\n using SafeMath for uint256;\n using SafeERC20 for IERC20;\n\n uint256 private constant MIN_PERIOD = 1;\n\n // -- State --\n\n IERC20 public token;\n address public beneficiary;\n\n // Configuration\n\n // Amount of tokens managed by the contract schedule\n uint256 public managedAmount;\n\n uint256 public startTime; // Start datetime (in unixtimestamp)\n uint256 public endTime; // Datetime after all funds are fully vested/unlocked (in unixtimestamp)\n uint256 public periods; // Number of vesting/release periods\n\n // First release date for tokens (in unixtimestamp)\n // If set, no tokens will be released before releaseStartTime ignoring\n // the amount to release each period\n uint256 public releaseStartTime;\n // A cliff set a date to which a beneficiary needs to get to vest\n // all preceding periods\n uint256 public vestingCliffTime;\n Revocability public revocable; // Whether to use vesting for locked funds\n\n // State\n\n bool public isRevoked;\n bool public isInitialized;\n bool public isAccepted;\n uint256 public releasedAmount;\n uint256 public revokedAmount;\n\n // -- Events --\n\n event TokensReleased(address indexed beneficiary, uint256 amount);\n event TokensWithdrawn(address indexed beneficiary, uint256 amount);\n event TokensRevoked(address indexed beneficiary, uint256 amount);\n event BeneficiaryChanged(address newBeneficiary);\n event LockAccepted();\n event LockCanceled();\n\n /**\n * @dev Only allow calls from the beneficiary of the contract\n */\n modifier onlyBeneficiary() {\n require(msg.sender == beneficiary, \"!auth\");\n _;\n }\n\n /**\n * @notice Initializes the contract\n * @param _owner Address of the contract owner\n * @param _beneficiary Address of the beneficiary of locked tokens\n * @param _managedAmount Amount of tokens to be managed by the lock contract\n * @param _startTime Start time of the release schedule\n * @param _endTime End time of the release schedule\n * @param _periods Number of periods between start time and end time\n * @param _releaseStartTime Override time for when the releases start\n * @param _vestingCliffTime Override time for when the vesting start\n * @param _revocable Whether the contract is revocable\n */\n function _initialize(\n address _owner,\n address _beneficiary,\n address _token,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n Revocability _revocable\n ) internal {\n require(!isInitialized, \"Already initialized\");\n require(_owner != address(0), \"Owner cannot be zero\");\n require(_beneficiary != address(0), \"Beneficiary cannot be zero\");\n require(_token != address(0), \"Token cannot be zero\");\n require(_managedAmount > 0, \"Managed tokens cannot be zero\");\n require(_startTime != 0, \"Start time must be set\");\n require(_startTime < _endTime, \"Start time > end time\");\n require(_periods >= MIN_PERIOD, \"Periods cannot be below minimum\");\n require(_revocable != Revocability.NotSet, \"Must set a revocability option\");\n require(_releaseStartTime < _endTime, \"Release start time must be before end time\");\n require(_vestingCliffTime < _endTime, \"Cliff time must be before end time\");\n\n isInitialized = true;\n\n OwnableInitializable._initialize(_owner);\n beneficiary = _beneficiary;\n token = IERC20(_token);\n\n managedAmount = _managedAmount;\n\n startTime = _startTime;\n endTime = _endTime;\n periods = _periods;\n\n // Optionals\n releaseStartTime = _releaseStartTime;\n vestingCliffTime = _vestingCliffTime;\n revocable = _revocable;\n }\n\n /**\n * @notice Change the beneficiary of funds managed by the contract\n * @dev Can only be called by the beneficiary\n * @param _newBeneficiary Address of the new beneficiary address\n */\n function changeBeneficiary(address _newBeneficiary) external onlyBeneficiary {\n require(_newBeneficiary != address(0), \"Empty beneficiary\");\n beneficiary = _newBeneficiary;\n emit BeneficiaryChanged(_newBeneficiary);\n }\n\n /**\n * @notice Beneficiary accepts the lock, the owner cannot retrieve back the tokens\n * @dev Can only be called by the beneficiary\n */\n function acceptLock() external onlyBeneficiary {\n isAccepted = true;\n emit LockAccepted();\n }\n\n /**\n * @notice Owner cancel the lock and return the balance in the contract\n * @dev Can only be called by the owner\n */\n function cancelLock() external onlyOwner {\n require(isAccepted == false, \"Cannot cancel accepted contract\");\n\n token.safeTransfer(owner(), currentBalance());\n\n emit LockCanceled();\n }\n\n // -- Balances --\n\n /**\n * @notice Returns the amount of tokens currently held by the contract\n * @return Tokens held in the contract\n */\n function currentBalance() public view override returns (uint256) {\n return token.balanceOf(address(this));\n }\n\n // -- Time & Periods --\n\n /**\n * @notice Returns the current block timestamp\n * @return Current block timestamp\n */\n function currentTime() public view override returns (uint256) {\n return block.timestamp;\n }\n\n /**\n * @notice Gets duration of contract from start to end in seconds\n * @return Amount of seconds from contract startTime to endTime\n */\n function duration() public view override returns (uint256) {\n return endTime.sub(startTime);\n }\n\n /**\n * @notice Gets time elapsed since the start of the contract\n * @dev Returns zero if called before conctract starTime\n * @return Seconds elapsed from contract startTime\n */\n function sinceStartTime() public view override returns (uint256) {\n uint256 current = currentTime();\n if (current <= startTime) {\n return 0;\n }\n return current.sub(startTime);\n }\n\n /**\n * @notice Returns amount available to be released after each period according to schedule\n * @return Amount of tokens available after each period\n */\n function amountPerPeriod() public view override returns (uint256) {\n return managedAmount.div(periods);\n }\n\n /**\n * @notice Returns the duration of each period in seconds\n * @return Duration of each period in seconds\n */\n function periodDuration() public view override returns (uint256) {\n return duration().div(periods);\n }\n\n /**\n * @notice Gets the current period based on the schedule\n * @return A number that represents the current period\n */\n function currentPeriod() public view override returns (uint256) {\n return sinceStartTime().div(periodDuration()).add(MIN_PERIOD);\n }\n\n /**\n * @notice Gets the number of periods that passed since the first period\n * @return A number of periods that passed since the schedule started\n */\n function passedPeriods() public view override returns (uint256) {\n return currentPeriod().sub(MIN_PERIOD);\n }\n\n // -- Locking & Release Schedule --\n\n /**\n * @notice Gets the currently available token according to the schedule\n * @dev Implements the step-by-step schedule based on periods for available tokens\n * @return Amount of tokens available according to the schedule\n */\n function availableAmount() public view override returns (uint256) {\n uint256 current = currentTime();\n\n // Before contract start no funds are available\n if (current < startTime) {\n return 0;\n }\n\n // After contract ended all funds are available\n if (current > endTime) {\n return managedAmount;\n }\n\n // Get available amount based on period\n return passedPeriods().mul(amountPerPeriod());\n }\n\n /**\n * @notice Gets the amount of currently vested tokens\n * @dev Similar to available amount, but is fully vested when contract is non-revocable\n * @return Amount of tokens already vested\n */\n function vestedAmount() public view override returns (uint256) {\n // If non-revocable it is fully vested\n if (revocable == Revocability.Disabled) {\n return managedAmount;\n }\n\n // Vesting cliff is activated and it has not passed means nothing is vested yet\n if (vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\n return 0;\n }\n\n return availableAmount();\n }\n\n /**\n * @notice Gets tokens currently available for release\n * @dev Considers the schedule and takes into account already released tokens\n * @return Amount of tokens ready to be released\n */\n function releasableAmount() public view virtual override returns (uint256) {\n // If a release start time is set no tokens are available for release before this date\n // If not set it follows the default schedule and tokens are available on\n // the first period passed\n if (releaseStartTime > 0 && currentTime() < releaseStartTime) {\n return 0;\n }\n\n // Vesting cliff is activated and it has not passed means nothing is vested yet\n // so funds cannot be released\n if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\n return 0;\n }\n\n // A beneficiary can never have more releasable tokens than the contract balance\n uint256 releasable = availableAmount().sub(releasedAmount);\n return MathUtils.min(currentBalance(), releasable);\n }\n\n /**\n * @notice Gets the outstanding amount yet to be released based on the whole contract lifetime\n * @dev Does not consider schedule but just global amounts tracked\n * @return Amount of outstanding tokens for the lifetime of the contract\n */\n function totalOutstandingAmount() public view override returns (uint256) {\n return managedAmount.sub(releasedAmount).sub(revokedAmount);\n }\n\n /**\n * @notice Gets surplus amount in the contract based on outstanding amount to release\n * @dev All funds over outstanding amount is considered surplus that can be withdrawn by beneficiary.\n * Note this might not be the correct value for wallets transferred to L2 (i.e. an L2GraphTokenLockWallet), as the released amount will be\n * skewed, so the beneficiary might have to bridge back to L1 to release the surplus.\n * @return Amount of tokens considered as surplus\n */\n function surplusAmount() public view override returns (uint256) {\n uint256 balance = currentBalance();\n uint256 outstandingAmount = totalOutstandingAmount();\n if (balance > outstandingAmount) {\n return balance.sub(outstandingAmount);\n }\n return 0;\n }\n\n // -- Value Transfer --\n\n /**\n * @notice Releases tokens based on the configured schedule\n * @dev All available releasable tokens are transferred to beneficiary\n */\n function release() external override onlyBeneficiary {\n uint256 amountToRelease = releasableAmount();\n require(amountToRelease > 0, \"No available releasable amount\");\n\n releasedAmount = releasedAmount.add(amountToRelease);\n\n token.safeTransfer(beneficiary, amountToRelease);\n\n emit TokensReleased(beneficiary, amountToRelease);\n }\n\n /**\n * @notice Withdraws surplus, unmanaged tokens from the contract\n * @dev Tokens in the contract over outstanding amount are considered as surplus\n * @param _amount Amount of tokens to withdraw\n */\n function withdrawSurplus(uint256 _amount) external override onlyBeneficiary {\n require(_amount > 0, \"Amount cannot be zero\");\n require(surplusAmount() >= _amount, \"Amount requested > surplus available\");\n\n token.safeTransfer(beneficiary, _amount);\n\n emit TokensWithdrawn(beneficiary, _amount);\n }\n\n /**\n * @notice Revokes a vesting schedule and return the unvested tokens to the owner\n * @dev Vesting schedule is always calculated based on managed tokens\n */\n function revoke() external override onlyOwner {\n require(revocable == Revocability.Enabled, \"Contract is non-revocable\");\n require(isRevoked == false, \"Already revoked\");\n\n uint256 unvestedAmount = managedAmount.sub(vestedAmount());\n require(unvestedAmount > 0, \"No available unvested amount\");\n\n revokedAmount = unvestedAmount;\n isRevoked = true;\n\n token.safeTransfer(owner(), unvestedAmount);\n\n emit TokensRevoked(beneficiary, unvestedAmount);\n }\n}\n" + }, + "contracts/GraphTokenLockManager.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\";\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"@openzeppelin/contracts/utils/EnumerableSet.sol\";\nimport { Ownable } from \"@openzeppelin/contracts/access/Ownable.sol\";\n\nimport \"./MinimalProxyFactory.sol\";\nimport \"./IGraphTokenLockManager.sol\";\nimport { GraphTokenLockWallet } from \"./GraphTokenLockWallet.sol\";\n\n/**\n * @title GraphTokenLockManager\n * @notice This contract manages a list of authorized function calls and targets that can be called\n * by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts.\n *\n * This contract receives funds to make the process of creating TokenLockWallet contracts\n * easier by distributing them the initial tokens to be managed.\n *\n * The owner can setup a list of token destinations that will be used by TokenLock contracts to\n * approve the pulling of funds, this way in can be guaranteed that only protocol contracts\n * will manipulate users funds.\n */\ncontract GraphTokenLockManager is Ownable, MinimalProxyFactory, IGraphTokenLockManager {\n using SafeERC20 for IERC20;\n using EnumerableSet for EnumerableSet.AddressSet;\n\n // -- State --\n\n mapping(bytes4 => address) public authFnCalls;\n EnumerableSet.AddressSet private _tokenDestinations;\n\n address public masterCopy;\n IERC20 internal _token;\n\n // -- Events --\n\n event MasterCopyUpdated(address indexed masterCopy);\n event TokenLockCreated(\n address indexed contractAddress,\n bytes32 indexed initHash,\n address indexed beneficiary,\n address token,\n uint256 managedAmount,\n uint256 startTime,\n uint256 endTime,\n uint256 periods,\n uint256 releaseStartTime,\n uint256 vestingCliffTime,\n IGraphTokenLock.Revocability revocable\n );\n\n event TokensDeposited(address indexed sender, uint256 amount);\n event TokensWithdrawn(address indexed sender, uint256 amount);\n\n event FunctionCallAuth(address indexed caller, bytes4 indexed sigHash, address indexed target, string signature);\n event TokenDestinationAllowed(address indexed dst, bool allowed);\n\n /**\n * Constructor.\n * @param _graphToken Token to use for deposits and withdrawals\n * @param _masterCopy Address of the master copy to use to clone proxies\n */\n constructor(IERC20 _graphToken, address _masterCopy) {\n require(address(_graphToken) != address(0), \"Token cannot be zero\");\n _token = _graphToken;\n setMasterCopy(_masterCopy);\n }\n\n // -- Factory --\n\n /**\n * @notice Sets the masterCopy bytecode to use to create clones of TokenLock contracts\n * @param _masterCopy Address of contract bytecode to factory clone\n */\n function setMasterCopy(address _masterCopy) public override onlyOwner {\n require(_masterCopy != address(0), \"MasterCopy cannot be zero\");\n masterCopy = _masterCopy;\n emit MasterCopyUpdated(_masterCopy);\n }\n\n /**\n * @notice Creates and fund a new token lock wallet using a minimum proxy\n * @param _owner Address of the contract owner\n * @param _beneficiary Address of the beneficiary of locked tokens\n * @param _managedAmount Amount of tokens to be managed by the lock contract\n * @param _startTime Start time of the release schedule\n * @param _endTime End time of the release schedule\n * @param _periods Number of periods between start time and end time\n * @param _releaseStartTime Override time for when the releases start\n * @param _revocable Whether the contract is revocable\n */\n function createTokenLockWallet(\n address _owner,\n address _beneficiary,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n IGraphTokenLock.Revocability _revocable\n ) external override onlyOwner {\n require(_token.balanceOf(address(this)) >= _managedAmount, \"Not enough tokens to create lock\");\n\n // Create contract using a minimal proxy and call initializer\n bytes memory initializer = abi.encodeWithSelector(\n GraphTokenLockWallet.initialize.selector,\n address(this),\n _owner,\n _beneficiary,\n address(_token),\n _managedAmount,\n _startTime,\n _endTime,\n _periods,\n _releaseStartTime,\n _vestingCliffTime,\n _revocable\n );\n address contractAddress = _deployProxy2(keccak256(initializer), masterCopy, initializer);\n\n // Send managed amount to the created contract\n _token.safeTransfer(contractAddress, _managedAmount);\n\n emit TokenLockCreated(\n contractAddress,\n keccak256(initializer),\n _beneficiary,\n address(_token),\n _managedAmount,\n _startTime,\n _endTime,\n _periods,\n _releaseStartTime,\n _vestingCliffTime,\n _revocable\n );\n }\n\n // -- Funds Management --\n\n /**\n * @notice Gets the GRT token address\n * @return Token used for transfers and approvals\n */\n function token() external view override returns (IERC20) {\n return _token;\n }\n\n /**\n * @notice Deposits tokens into the contract\n * @dev Even if the ERC20 token can be transferred directly to the contract\n * this function provide a safe interface to do the transfer and avoid mistakes\n * @param _amount Amount to deposit\n */\n function deposit(uint256 _amount) external override {\n require(_amount > 0, \"Amount cannot be zero\");\n _token.safeTransferFrom(msg.sender, address(this), _amount);\n emit TokensDeposited(msg.sender, _amount);\n }\n\n /**\n * @notice Withdraws tokens from the contract\n * @dev Escape hatch in case of mistakes or to recover remaining funds\n * @param _amount Amount of tokens to withdraw\n */\n function withdraw(uint256 _amount) external override onlyOwner {\n require(_amount > 0, \"Amount cannot be zero\");\n _token.safeTransfer(msg.sender, _amount);\n emit TokensWithdrawn(msg.sender, _amount);\n }\n\n // -- Token Destinations --\n\n /**\n * @notice Adds an address that can be allowed by a token lock to pull funds\n * @param _dst Destination address\n */\n function addTokenDestination(address _dst) external override onlyOwner {\n require(_dst != address(0), \"Destination cannot be zero\");\n require(_tokenDestinations.add(_dst), \"Destination already added\");\n emit TokenDestinationAllowed(_dst, true);\n }\n\n /**\n * @notice Removes an address that can be allowed by a token lock to pull funds\n * @param _dst Destination address\n */\n function removeTokenDestination(address _dst) external override onlyOwner {\n require(_tokenDestinations.remove(_dst), \"Destination already removed\");\n emit TokenDestinationAllowed(_dst, false);\n }\n\n /**\n * @notice Returns True if the address is authorized to be a destination of tokens\n * @param _dst Destination address\n * @return True if authorized\n */\n function isTokenDestination(address _dst) external view override returns (bool) {\n return _tokenDestinations.contains(_dst);\n }\n\n /**\n * @notice Returns an array of authorized destination addresses\n * @return Array of addresses authorized to pull funds from a token lock\n */\n function getTokenDestinations() external view override returns (address[] memory) {\n address[] memory dstList = new address[](_tokenDestinations.length());\n for (uint256 i = 0; i < _tokenDestinations.length(); i++) {\n dstList[i] = _tokenDestinations.at(i);\n }\n return dstList;\n }\n\n // -- Function Call Authorization --\n\n /**\n * @notice Sets an authorized function call to target\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\n * @param _signature Function signature\n * @param _target Address of the destination contract to call\n */\n function setAuthFunctionCall(string calldata _signature, address _target) external override onlyOwner {\n _setAuthFunctionCall(_signature, _target);\n }\n\n /**\n * @notice Unsets an authorized function call to target\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\n * @param _signature Function signature\n */\n function unsetAuthFunctionCall(string calldata _signature) external override onlyOwner {\n bytes4 sigHash = _toFunctionSigHash(_signature);\n authFnCalls[sigHash] = address(0);\n\n emit FunctionCallAuth(msg.sender, sigHash, address(0), _signature);\n }\n\n /**\n * @notice Sets an authorized function call to target in bulk\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\n * @param _signatures Function signatures\n * @param _targets Address of the destination contract to call\n */\n function setAuthFunctionCallMany(\n string[] calldata _signatures,\n address[] calldata _targets\n ) external override onlyOwner {\n require(_signatures.length == _targets.length, \"Array length mismatch\");\n\n for (uint256 i = 0; i < _signatures.length; i++) {\n _setAuthFunctionCall(_signatures[i], _targets[i]);\n }\n }\n\n /**\n * @notice Sets an authorized function call to target\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\n * @dev Function signatures of Graph Protocol contracts to be used are known ahead of time\n * @param _signature Function signature\n * @param _target Address of the destination contract to call\n */\n function _setAuthFunctionCall(string calldata _signature, address _target) internal {\n require(_target != address(this), \"Target must be other contract\");\n require(Address.isContract(_target), \"Target must be a contract\");\n\n bytes4 sigHash = _toFunctionSigHash(_signature);\n authFnCalls[sigHash] = _target;\n\n emit FunctionCallAuth(msg.sender, sigHash, _target, _signature);\n }\n\n /**\n * @notice Gets the target contract to call for a particular function signature\n * @param _sigHash Function signature hash\n * @return Address of the target contract where to send the call\n */\n function getAuthFunctionCallTarget(bytes4 _sigHash) public view override returns (address) {\n return authFnCalls[_sigHash];\n }\n\n /**\n * @notice Returns true if the function call is authorized\n * @param _sigHash Function signature hash\n * @return True if authorized\n */\n function isAuthFunctionCall(bytes4 _sigHash) external view override returns (bool) {\n return getAuthFunctionCallTarget(_sigHash) != address(0);\n }\n\n /**\n * @dev Converts a function signature string to 4-bytes hash\n * @param _signature Function signature string\n * @return Function signature hash\n */\n function _toFunctionSigHash(string calldata _signature) internal pure returns (bytes4) {\n return _convertToBytes4(abi.encodeWithSignature(_signature));\n }\n\n /**\n * @dev Converts function signature bytes to function signature hash (bytes4)\n * @param _signature Function signature\n * @return Function signature in bytes4\n */\n function _convertToBytes4(bytes memory _signature) internal pure returns (bytes4) {\n require(_signature.length == 4, \"Invalid method signature\");\n bytes4 sigHash;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n sigHash := mload(add(_signature, 32))\n }\n return sigHash;\n }\n}\n" + }, + "contracts/GraphTokenLockSimple.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport \"./GraphTokenLock.sol\";\n\n/**\n * @title GraphTokenLockSimple\n * @notice This contract is the concrete simple implementation built on top of the base\n * GraphTokenLock functionality for use when we only need the token lock schedule\n * features but no interaction with the network.\n *\n * This contract is designed to be deployed without the use of a TokenManager.\n */\ncontract GraphTokenLockSimple is GraphTokenLock {\n // Constructor\n constructor() {\n OwnableInitializable._initialize(msg.sender);\n }\n\n // Initializer\n function initialize(\n address _owner,\n address _beneficiary,\n address _token,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n Revocability _revocable\n ) external onlyOwner {\n _initialize(\n _owner,\n _beneficiary,\n _token,\n _managedAmount,\n _startTime,\n _endTime,\n _periods,\n _releaseStartTime,\n _vestingCliffTime,\n _revocable\n );\n }\n}\n" + }, + "contracts/GraphTokenLockWallet.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"@openzeppelin/contracts/math/SafeMath.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\nimport \"./GraphTokenLock.sol\";\nimport \"./IGraphTokenLockManager.sol\";\n\n/**\n * @title GraphTokenLockWallet\n * @notice This contract is built on top of the base GraphTokenLock functionality.\n * It allows wallet beneficiaries to use the deposited funds to perform specific function calls\n * on specific contracts.\n *\n * The idea is that supporters with locked tokens can participate in the protocol\n * but disallow any release before the vesting/lock schedule.\n * The beneficiary can issue authorized function calls to this contract that will\n * get forwarded to a target contract. A target contract is any of our protocol contracts.\n * The function calls allowed are queried to the GraphTokenLockManager, this way\n * the same configuration can be shared for all the created lock wallet contracts.\n *\n * NOTE: Contracts used as target must have its function signatures checked to avoid collisions\n * with any of this contract functions.\n * Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience\n * the maximum amount of tokens is authorized.\n * Function calls do not forward ETH value so DO NOT SEND ETH TO THIS CONTRACT.\n */\ncontract GraphTokenLockWallet is GraphTokenLock {\n using SafeMath for uint256;\n\n // -- State --\n\n IGraphTokenLockManager public manager;\n uint256 public usedAmount;\n\n // -- Events --\n\n event ManagerUpdated(address indexed _oldManager, address indexed _newManager);\n event TokenDestinationsApproved();\n event TokenDestinationsRevoked();\n\n // Initializer\n function initialize(\n address _manager,\n address _owner,\n address _beneficiary,\n address _token,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n Revocability _revocable\n ) external {\n _initialize(\n _owner,\n _beneficiary,\n _token,\n _managedAmount,\n _startTime,\n _endTime,\n _periods,\n _releaseStartTime,\n _vestingCliffTime,\n _revocable\n );\n _setManager(_manager);\n }\n\n // -- Admin --\n\n /**\n * @notice Sets a new manager for this contract\n * @param _newManager Address of the new manager\n */\n function setManager(address _newManager) external onlyOwner {\n _setManager(_newManager);\n }\n\n /**\n * @dev Sets a new manager for this contract\n * @param _newManager Address of the new manager\n */\n function _setManager(address _newManager) internal {\n require(_newManager != address(0), \"Manager cannot be empty\");\n require(Address.isContract(_newManager), \"Manager must be a contract\");\n\n address oldManager = address(manager);\n manager = IGraphTokenLockManager(_newManager);\n\n emit ManagerUpdated(oldManager, _newManager);\n }\n\n // -- Beneficiary --\n\n /**\n * @notice Approves protocol access of the tokens managed by this contract\n * @dev Approves all token destinations registered in the manager to pull tokens\n */\n function approveProtocol() external onlyBeneficiary {\n address[] memory dstList = manager.getTokenDestinations();\n for (uint256 i = 0; i < dstList.length; i++) {\n // Note this is only safe because we are using the max uint256 value\n token.approve(dstList[i], type(uint256).max);\n }\n emit TokenDestinationsApproved();\n }\n\n /**\n * @notice Revokes protocol access of the tokens managed by this contract\n * @dev Revokes approval to all token destinations in the manager to pull tokens\n */\n function revokeProtocol() external onlyBeneficiary {\n address[] memory dstList = manager.getTokenDestinations();\n for (uint256 i = 0; i < dstList.length; i++) {\n // Note this is only safe cause we're using 0 as the amount\n token.approve(dstList[i], 0);\n }\n emit TokenDestinationsRevoked();\n }\n\n /**\n * @notice Gets tokens currently available for release\n * @dev Considers the schedule, takes into account already released tokens and used amount\n * @return Amount of tokens ready to be released\n */\n function releasableAmount() public view override returns (uint256) {\n if (revocable == Revocability.Disabled) {\n return super.releasableAmount();\n }\n\n // -- Revocability enabled logic\n // This needs to deal with additional considerations for when tokens are used in the protocol\n\n // If a release start time is set no tokens are available for release before this date\n // If not set it follows the default schedule and tokens are available on\n // the first period passed\n if (releaseStartTime > 0 && currentTime() < releaseStartTime) {\n return 0;\n }\n\n // Vesting cliff is activated and it has not passed means nothing is vested yet\n // so funds cannot be released\n if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\n return 0;\n }\n\n // A beneficiary can never have more releasable tokens than the contract balance\n // We consider the `usedAmount` in the protocol as part of the calculations\n // the beneficiary should not release funds that are used.\n uint256 releasable = availableAmount().sub(releasedAmount).sub(usedAmount);\n return MathUtils.min(currentBalance(), releasable);\n }\n\n /**\n * @notice Forward authorized contract calls to protocol contracts\n * @dev Fallback function can be called by the beneficiary only if function call is allowed\n */\n // solhint-disable-next-line no-complex-fallback\n fallback() external payable {\n // Only beneficiary can forward calls\n require(msg.sender == beneficiary, \"Unauthorized caller\");\n require(msg.value == 0, \"ETH transfers not supported\");\n\n // Function call validation\n address _target = manager.getAuthFunctionCallTarget(msg.sig);\n require(_target != address(0), \"Unauthorized function\");\n\n uint256 oldBalance = currentBalance();\n\n // Call function with data\n Address.functionCall(_target, msg.data);\n\n // Tracked used tokens in the protocol\n // We do this check after balances were updated by the forwarded call\n // Check is only enforced for revocable contracts to save some gas\n if (revocable == Revocability.Enabled) {\n // Track contract balance change\n uint256 newBalance = currentBalance();\n if (newBalance < oldBalance) {\n // Outflow\n uint256 diff = oldBalance.sub(newBalance);\n usedAmount = usedAmount.add(diff);\n } else {\n // Inflow: We can receive profits from the protocol, that could make usedAmount to\n // underflow. We set it to zero in that case.\n uint256 diff = newBalance.sub(oldBalance);\n usedAmount = (diff >= usedAmount) ? 0 : usedAmount.sub(diff);\n }\n require(usedAmount <= vestedAmount(), \"Cannot use more tokens than vested amount\");\n }\n }\n\n /**\n * @notice Receive function that always reverts.\n * @dev Only included to supress warnings, see https://github.com/ethereum/solidity/issues/10159\n */\n receive() external payable {\n revert(\"Bad call\");\n }\n}\n" + }, + "contracts/ICallhookReceiver.sol": { + "content": "// SPDX-License-Identifier: GPL-2.0-or-later\n\n// Copied from graphprotocol/contracts, changed solidity version to 0.7.3\n\n/**\n * @title Interface for contracts that can receive callhooks through the Arbitrum GRT bridge\n * @dev Any contract that can receive a callhook on L2, sent through the bridge from L1, must\n * be allowlisted by the governor, but also implement this interface that contains\n * the function that will actually be called by the L2GraphTokenGateway.\n */\npragma solidity ^0.7.3;\n\ninterface ICallhookReceiver {\n /**\n * @notice Receive tokens with a callhook from the bridge\n * @param _from Token sender in L1\n * @param _amount Amount of tokens that were transferred\n * @param _data ABI-encoded callhook data\n */\n function onTokenTransfer(address _from, uint256 _amount, bytes calldata _data) external;\n}\n" + }, + "contracts/IGraphTokenLock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\ninterface IGraphTokenLock {\n enum Revocability {\n NotSet,\n Enabled,\n Disabled\n }\n\n // -- Balances --\n\n function currentBalance() external view returns (uint256);\n\n // -- Time & Periods --\n\n function currentTime() external view returns (uint256);\n\n function duration() external view returns (uint256);\n\n function sinceStartTime() external view returns (uint256);\n\n function amountPerPeriod() external view returns (uint256);\n\n function periodDuration() external view returns (uint256);\n\n function currentPeriod() external view returns (uint256);\n\n function passedPeriods() external view returns (uint256);\n\n // -- Locking & Release Schedule --\n\n function availableAmount() external view returns (uint256);\n\n function vestedAmount() external view returns (uint256);\n\n function releasableAmount() external view returns (uint256);\n\n function totalOutstandingAmount() external view returns (uint256);\n\n function surplusAmount() external view returns (uint256);\n\n // -- Value Transfer --\n\n function release() external;\n\n function withdrawSurplus(uint256 _amount) external;\n\n function revoke() external;\n}\n" + }, + "contracts/IGraphTokenLockManager.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\nimport \"./IGraphTokenLock.sol\";\n\ninterface IGraphTokenLockManager {\n // -- Factory --\n\n function setMasterCopy(address _masterCopy) external;\n\n function createTokenLockWallet(\n address _owner,\n address _beneficiary,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n IGraphTokenLock.Revocability _revocable\n ) external;\n\n // -- Funds Management --\n\n function token() external returns (IERC20);\n\n function deposit(uint256 _amount) external;\n\n function withdraw(uint256 _amount) external;\n\n // -- Allowed Funds Destinations --\n\n function addTokenDestination(address _dst) external;\n\n function removeTokenDestination(address _dst) external;\n\n function isTokenDestination(address _dst) external view returns (bool);\n\n function getTokenDestinations() external view returns (address[] memory);\n\n // -- Function Call Authorization --\n\n function setAuthFunctionCall(string calldata _signature, address _target) external;\n\n function unsetAuthFunctionCall(string calldata _signature) external;\n\n function setAuthFunctionCallMany(string[] calldata _signatures, address[] calldata _targets) external;\n\n function getAuthFunctionCallTarget(bytes4 _sigHash) external view returns (address);\n\n function isAuthFunctionCall(bytes4 _sigHash) external view returns (bool);\n}\n" + }, + "contracts/L1GraphTokenLockTransferTool.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport { AddressUpgradeable } from \"@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol\";\nimport { ITokenGateway } from \"./arbitrum/ITokenGateway.sol\";\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport { L2GraphTokenLockManager } from \"./L2GraphTokenLockManager.sol\";\nimport { GraphTokenLockWallet } from \"./GraphTokenLockWallet.sol\";\nimport { MinimalProxyFactory } from \"./MinimalProxyFactory.sol\";\nimport { IGraphTokenLock } from \"./IGraphTokenLock.sol\";\nimport { Ownable as OwnableInitializable } from \"./Ownable.sol\";\nimport { SafeMathUpgradeable } from \"@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol\";\nimport { Initializable } from \"@openzeppelin/contracts-upgradeable/proxy/Initializable.sol\";\n\n/**\n * @title L1GraphTokenLockTransferTool contract\n * @notice This contract is used to transfer GRT from GraphTokenLockWallets\n * to a counterpart on L2. It is deployed on L1 and will send the GRT through\n * the L1GraphTokenGateway with a callhook to the L2GraphTokenLockManager, including\n * data to create a L2GraphTokenLockWallet on L2.\n *\n * Note that the L2GraphTokenLockWallet will not allow releasing any GRT until the end of\n * the vesting timeline, but will allow sending the GRT back to the L1 wallet.\n *\n * Beneficiaries for a GraphTokenLockWallet can perform the depositToL2Locked call\n * as many times as they want, and the GRT will be sent to the same L2GraphTokenLockWallet.\n *\n * Since all retryable tickets to send transactions to L2 require ETH for gas, this\n * contract also allows users to deposit ETH to be used for gas on L2, both for\n * the depositToL2Locked calls and for the transfer tools in the Staking contract for\n * The Graph.\n *\n * See GIP-0046 for more details: https://forum.thegraph.com/t/4023\n */\ncontract L1GraphTokenLockTransferTool is OwnableInitializable, Initializable, MinimalProxyFactory {\n using SafeMathUpgradeable for uint256;\n\n /// Address of the L1 GRT token contract\n IERC20 public immutable graphToken;\n /// Address of the L2GraphTokenLockWallet implementation in L2, used to compute L2 wallet addresses\n address public immutable l2Implementation;\n /// Address of the L1GraphTokenGateway contract\n ITokenGateway public immutable l1Gateway;\n /// Address of the Staking contract, used to pull ETH for L2 ticket gas\n address payable public immutable staking;\n /// L2 lock manager for each L1 lock manager.\n /// L1 GraphTokenLockManager => L2GraphTokenLockManager\n mapping(address => address) public l2LockManager;\n /// L2 wallet owner for each L1 wallet owner.\n /// L1 wallet owner => L2 wallet owner\n mapping(address => address) public l2WalletOwner;\n /// L2 wallet address for each L1 wallet address.\n /// L1 wallet => L2 wallet\n mapping(address => address) public l2WalletAddress;\n /// ETH balance from each token lock, used to pay for L2 gas:\n /// L1 wallet address => ETH balance\n mapping(address => uint256) public tokenLockETHBalances;\n /// L2 beneficiary corresponding to each L1 wallet address.\n /// L1 wallet => L2 beneficiary\n mapping(address => address) public l2Beneficiary;\n /// Indicates whether an L2 wallet address for a wallet\n /// has been set manually, in which case it can't call depositToL2Locked.\n /// L1 wallet => bool\n mapping(address => bool) public l2WalletAddressSetManually;\n\n /// @dev Emitted when the L2 lock manager for an L1 lock manager is set\n event L2LockManagerSet(address indexed l1LockManager, address indexed l2LockManager);\n /// @dev Emitted when the L2 wallet owner for an L1 wallet owner is set\n event L2WalletOwnerSet(address indexed l1WalletOwner, address indexed l2WalletOwner);\n /// @dev Emitted when GRT is sent to L2 from a token lock\n event LockedFundsSentToL2(\n address indexed l1Wallet,\n address indexed l2Wallet,\n address indexed l1LockManager,\n address l2LockManager,\n uint256 amount\n );\n /// @dev Emitted when an L2 wallet address is set for an L1 wallet\n event L2WalletAddressSet(address indexed l1Wallet, address indexed l2Wallet);\n /// @dev Emitted when ETH is deposited to a token lock's account\n event ETHDeposited(address indexed tokenLock, uint256 amount);\n /// @dev Emitted when ETH is withdrawn from a token lock's account\n event ETHWithdrawn(address indexed tokenLock, address indexed destination, uint256 amount);\n /// @dev Emitted when ETH is pulled from a token lock's account by Staking or this tool to pay for an L2 ticket\n event ETHPulled(address indexed tokenLock, uint256 amount);\n /// @dev Emitted when the L2 beneficiary for a partially vested L1 lock is set\n event L2BeneficiarySet(address indexed l1Wallet, address indexed l2Beneficiary);\n\n /**\n * @notice Construct a new L1GraphTokenLockTransferTool contract\n * @dev The deployer of the contract will become its owner.\n * Note this contract is meant to be deployed behind a transparent proxy,\n * so this will run at the implementation's storage context; it will set\n * immutable variables and make the implementation be owned by the deployer.\n * @param _graphToken Address of the L1 GRT token contract\n * @param _l2Implementation Address of the L2GraphTokenLockWallet implementation in L2\n * @param _l1Gateway Address of the L1GraphTokenGateway contract\n * @param _staking Address of the Staking contract\n */\n constructor(\n IERC20 _graphToken,\n address _l2Implementation,\n ITokenGateway _l1Gateway,\n address payable _staking\n ) initializer {\n OwnableInitializable._initialize(msg.sender);\n graphToken = _graphToken;\n l2Implementation = _l2Implementation;\n l1Gateway = _l1Gateway;\n staking = _staking;\n }\n\n /**\n * @notice Initialize the L1GraphTokenLockTransferTool contract\n * @dev This function will run in the proxy's storage context, so it will\n * set the owner of the proxy contract which can be different from the implementation owner.\n * @param _owner Address of the owner of the L1GraphTokenLockTransferTool contract\n */\n function initialize(address _owner) external initializer {\n OwnableInitializable._initialize(_owner);\n }\n\n /**\n * @notice Set the L2 lock manager that corresponds to an L1 lock manager\n * @param _l1LockManager Address of the L1 lock manager\n * @param _l2LockManager Address of the L2 lock manager (in L2)\n */\n function setL2LockManager(address _l1LockManager, address _l2LockManager) external onlyOwner {\n l2LockManager[_l1LockManager] = _l2LockManager;\n emit L2LockManagerSet(_l1LockManager, _l2LockManager);\n }\n\n /**\n * @notice Set the L2 wallet owner that corresponds to an L1 wallet owner\n * @param _l1WalletOwner Address of the L1 wallet owner\n * @param _l2WalletOwner Address of the L2 wallet owner (in L2)\n */\n function setL2WalletOwner(address _l1WalletOwner, address _l2WalletOwner) external onlyOwner {\n l2WalletOwner[_l1WalletOwner] = _l2WalletOwner;\n emit L2WalletOwnerSet(_l1WalletOwner, _l2WalletOwner);\n }\n\n /**\n * @notice Deposit ETH on a token lock's account, to be used for L2 retryable ticket gas.\n * This function can be called by anyone, but the ETH will be credited to the token lock.\n * DO NOT try to call this through the token lock, as locks do not forward ETH value (and the\n * function call should not be allowlisted).\n * @param _tokenLock Address of the L1 GraphTokenLockWallet that will own the ETH\n */\n function depositETH(address _tokenLock) external payable {\n tokenLockETHBalances[_tokenLock] = tokenLockETHBalances[_tokenLock].add(msg.value);\n emit ETHDeposited(_tokenLock, msg.value);\n }\n\n /**\n * @notice Withdraw ETH from a token lock's account.\n * This function must be called from the token lock contract, but the destination\n * _must_ be a different address, as any ETH sent to the token lock would otherwise be\n * lost.\n * @param _destination Address to send the ETH\n * @param _amount Amount of ETH to send\n */\n function withdrawETH(address _destination, uint256 _amount) external {\n require(_amount > 0, \"INVALID_AMOUNT\");\n // We can't send eth to a token lock or it will be stuck\n require(msg.sender != _destination, \"INVALID_DESTINATION\");\n require(tokenLockETHBalances[msg.sender] >= _amount, \"INSUFFICIENT_BALANCE\");\n tokenLockETHBalances[msg.sender] -= _amount;\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, ) = payable(_destination).call{ value: _amount }(\"\");\n require(success, \"TRANSFER_FAILED\");\n emit ETHWithdrawn(msg.sender, _destination, _amount);\n }\n\n /**\n * @notice Pull ETH from a token lock's account, to be used for L2 retryable ticket gas.\n * This can only be called by the Staking contract.\n * @param _tokenLock GraphTokenLockWallet that owns the ETH that will be debited\n * @param _amount Amount of ETH to pull\n */\n function pullETH(address _tokenLock, uint256 _amount) external {\n require(msg.sender == staking, \"ONLY_STAKING\");\n require(tokenLockETHBalances[_tokenLock] >= _amount, \"INSUFFICIENT_BALANCE\");\n tokenLockETHBalances[_tokenLock] -= _amount;\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, ) = staking.call{ value: _amount }(\"\");\n require(success, \"TRANSFER_FAILED\");\n emit ETHPulled(_tokenLock, _amount);\n }\n\n /**\n * @notice Deposit GRT to L2, from a token lock in L1 to a token lock in L2.\n * If the token lock in L2 does not exist, it will be created when the message is received\n * by the L2GraphTokenLockManager.\n * Before calling this (which must be done through the token lock wallet), make sure\n * there is enough ETH in the token lock's account to cover the L2 retryable ticket gas.\n * Note that L2 submission fee and gas refunds will be lost.\n * You can add ETH to the token lock's account by calling depositETH().\n * Note that after calling this, you will NOT be able to use setL2WalletAddressManually() to\n * set an L2 wallet address, as the L2 wallet address will be set automatically when the\n * message is received by the L2GraphTokenLockManager.\n * @dev The gas parameters for L2 can be estimated using the Arbitrum SDK.\n * @param _amount Amount of GRT to deposit\n * @param _l2Beneficiary Address of the beneficiary for the token lock in L2. Must be the same for subsequent calls of this function, and not an L1 contract.\n * @param _maxGas Maximum gas to use for the L2 retryable ticket\n * @param _gasPriceBid Gas price to use for the L2 retryable ticket\n * @param _maxSubmissionCost Max submission cost for the L2 retryable ticket\n */\n function depositToL2Locked(\n uint256 _amount,\n address _l2Beneficiary,\n uint256 _maxGas,\n uint256 _gasPriceBid,\n uint256 _maxSubmissionCost\n ) external {\n // Check that msg.sender is a GraphTokenLockWallet\n // That uses GRT and has a corresponding manager set in L2.\n GraphTokenLockWallet wallet = GraphTokenLockWallet(msg.sender);\n require(wallet.token() == graphToken, \"INVALID_TOKEN\");\n address l1Manager = address(wallet.manager());\n address l2Manager = l2LockManager[l1Manager];\n require(l2Manager != address(0), \"INVALID_MANAGER\");\n require(wallet.isInitialized(), \"!INITIALIZED\");\n require(wallet.revocable() != IGraphTokenLock.Revocability.Enabled, \"REVOCABLE\");\n require(_amount <= graphToken.balanceOf(msg.sender), \"INSUFFICIENT_BALANCE\");\n require(_amount != 0, \"ZERO_AMOUNT\");\n\n if (l2Beneficiary[msg.sender] == address(0)) {\n require(_l2Beneficiary != address(0), \"INVALID_BENEFICIARY_ZERO\");\n require(!AddressUpgradeable.isContract(_l2Beneficiary), \"INVALID_BENEFICIARY_CONTRACT\");\n l2Beneficiary[msg.sender] = _l2Beneficiary;\n emit L2BeneficiarySet(msg.sender, _l2Beneficiary);\n } else {\n require(l2Beneficiary[msg.sender] == _l2Beneficiary, \"INVALID_BENEFICIARY\");\n }\n\n uint256 expectedEth = _maxSubmissionCost.add(_maxGas.mul(_gasPriceBid));\n require(tokenLockETHBalances[msg.sender] >= expectedEth, \"INSUFFICIENT_ETH_BALANCE\");\n tokenLockETHBalances[msg.sender] -= expectedEth;\n\n bytes memory encodedData;\n {\n address l2Owner = l2WalletOwner[wallet.owner()];\n require(l2Owner != address(0), \"L2_OWNER_NOT_SET\");\n // Extract all the storage variables from the GraphTokenLockWallet\n L2GraphTokenLockManager.TransferredWalletData memory data = L2GraphTokenLockManager.TransferredWalletData({\n l1Address: msg.sender,\n owner: l2Owner,\n beneficiary: l2Beneficiary[msg.sender],\n managedAmount: wallet.managedAmount(),\n startTime: wallet.startTime(),\n endTime: wallet.endTime()\n });\n encodedData = abi.encode(data);\n }\n\n if (l2WalletAddress[msg.sender] == address(0)) {\n require(wallet.endTime() >= block.timestamp, \"FULLY_VESTED_USE_MANUAL_ADDRESS\");\n address newAddress = getDeploymentAddress(keccak256(encodedData), l2Implementation, l2Manager);\n l2WalletAddress[msg.sender] = newAddress;\n emit L2WalletAddressSet(msg.sender, newAddress);\n } else {\n require(!l2WalletAddressSetManually[msg.sender], \"CANT_DEPOSIT_TO_MANUAL_ADDRESS\");\n }\n\n graphToken.transferFrom(msg.sender, address(this), _amount);\n\n // Send the tokens with a message through the L1GraphTokenGateway to the L2GraphTokenLockManager\n graphToken.approve(address(l1Gateway), _amount);\n {\n bytes memory transferData = abi.encode(_maxSubmissionCost, encodedData);\n l1Gateway.outboundTransfer{ value: expectedEth }(\n address(graphToken),\n l2Manager,\n _amount,\n _maxGas,\n _gasPriceBid,\n transferData\n );\n }\n emit ETHPulled(msg.sender, expectedEth);\n emit LockedFundsSentToL2(msg.sender, l2WalletAddress[msg.sender], l1Manager, l2Manager, _amount);\n }\n\n /**\n * @notice Manually set the L2 wallet address for a token lock in L1.\n * This will only work for token locks that have not been initialized in L2 yet, and\n * that are fully vested (endTime < current timestamp).\n * This address can then be used to send stake or delegation to L2 on the Staking contract.\n * After calling this, the vesting lock will NOT be allowed to use depositToL2Locked\n * to send GRT to L2, the beneficiary must withdraw the tokens and bridge them manually.\n * @param _l2Wallet Address of the L2 wallet\n */\n function setL2WalletAddressManually(address _l2Wallet) external {\n // Check that msg.sender is a GraphTokenLockWallet\n // That uses GRT and has a corresponding manager set in L2.\n GraphTokenLockWallet wallet = GraphTokenLockWallet(msg.sender);\n require(wallet.token() == graphToken, \"INVALID_TOKEN\");\n address l1Manager = address(wallet.manager());\n address l2Manager = l2LockManager[l1Manager];\n require(l2Manager != address(0), \"INVALID_MANAGER\");\n require(wallet.isInitialized(), \"!INITIALIZED\");\n\n // Check that the wallet is fully vested\n require(wallet.endTime() < block.timestamp, \"NOT_FULLY_VESTED\");\n\n // Check that the wallet has not set an L2 wallet yet\n require(l2WalletAddress[msg.sender] == address(0), \"L2_WALLET_ALREADY_SET\");\n\n // Check that the L2 address is not zero\n require(_l2Wallet != address(0), \"ZERO_ADDRESS\");\n // Set the L2 wallet address\n l2WalletAddress[msg.sender] = _l2Wallet;\n l2WalletAddressSetManually[msg.sender] = true;\n emit L2WalletAddressSet(msg.sender, _l2Wallet);\n }\n}\n" + }, + "contracts/L2GraphTokenLockManager.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport { SafeERC20 } from \"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\";\n\nimport { ICallhookReceiver } from \"./ICallhookReceiver.sol\";\nimport { GraphTokenLockManager } from \"./GraphTokenLockManager.sol\";\nimport { L2GraphTokenLockWallet } from \"./L2GraphTokenLockWallet.sol\";\n\n/**\n * @title L2GraphTokenLockManager\n * @notice This contract manages a list of authorized function calls and targets that can be called\n * by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts.\n *\n * This contract receives funds to make the process of creating TokenLockWallet contracts\n * easier by distributing them the initial tokens to be managed.\n *\n * In particular, this L2 variant is designed to receive token lock wallets from L1,\n * through the GRT bridge. These transferred wallets will not allow releasing funds in L2 until\n * the end of the vesting timeline, but they can allow withdrawing funds back to L1 using\n * the L2GraphTokenLockTransferTool contract.\n *\n * The owner can setup a list of token destinations that will be used by TokenLock contracts to\n * approve the pulling of funds, this way in can be guaranteed that only protocol contracts\n * will manipulate users funds.\n */\ncontract L2GraphTokenLockManager is GraphTokenLockManager, ICallhookReceiver {\n using SafeERC20 for IERC20;\n\n /// @dev Struct to hold the data of a transferred wallet; this is\n /// the data that must be encoded in L1 to send a wallet to L2.\n struct TransferredWalletData {\n address l1Address;\n address owner;\n address beneficiary;\n uint256 managedAmount;\n uint256 startTime;\n uint256 endTime;\n }\n\n /// Address of the L2GraphTokenGateway\n address public immutable l2Gateway;\n /// Address of the L1 transfer tool contract (in L1, no aliasing)\n address public immutable l1TransferTool;\n /// Mapping of each L1 wallet to its L2 wallet counterpart (populated when each wallet is received)\n /// L1 address => L2 address\n mapping(address => address) public l1WalletToL2Wallet;\n /// Mapping of each L2 wallet to its L1 wallet counterpart (populated when each wallet is received)\n /// L2 address => L1 address\n mapping(address => address) public l2WalletToL1Wallet;\n\n /// @dev Event emitted when a wallet is received and created from L1\n event TokenLockCreatedFromL1(\n address indexed contractAddress,\n bytes32 initHash,\n address indexed beneficiary,\n uint256 managedAmount,\n uint256 startTime,\n uint256 endTime,\n address indexed l1Address\n );\n\n /// @dev Emitted when locked tokens are received from L1 (whether the wallet\n /// had already been received or not)\n event LockedTokensReceivedFromL1(address indexed l1Address, address indexed l2Address, uint256 amount);\n\n /**\n * @dev Checks that the sender is the L2GraphTokenGateway.\n */\n modifier onlyL2Gateway() {\n require(msg.sender == l2Gateway, \"ONLY_GATEWAY\");\n _;\n }\n\n /**\n * @notice Constructor for the L2GraphTokenLockManager contract.\n * @param _graphToken Address of the L2 GRT token contract\n * @param _masterCopy Address of the master copy of the L2GraphTokenLockWallet implementation\n * @param _l2Gateway Address of the L2GraphTokenGateway contract\n * @param _l1TransferTool Address of the L1 transfer tool contract (in L1, without aliasing)\n */\n constructor(\n IERC20 _graphToken,\n address _masterCopy,\n address _l2Gateway,\n address _l1TransferTool\n ) GraphTokenLockManager(_graphToken, _masterCopy) {\n l2Gateway = _l2Gateway;\n l1TransferTool = _l1TransferTool;\n }\n\n /**\n * @notice This function is called by the L2GraphTokenGateway when tokens are sent from L1.\n * @dev This function will create a new wallet if it doesn't exist yet, or send the tokens to\n * the existing wallet if it does.\n * @param _from Address of the sender in L1, which must be the L1GraphTokenLockTransferTool\n * @param _amount Amount of tokens received\n * @param _data Encoded data of the transferred wallet, which must be an ABI-encoded TransferredWalletData struct\n */\n function onTokenTransfer(address _from, uint256 _amount, bytes calldata _data) external override onlyL2Gateway {\n require(_from == l1TransferTool, \"ONLY_TRANSFER_TOOL\");\n TransferredWalletData memory walletData = abi.decode(_data, (TransferredWalletData));\n\n if (l1WalletToL2Wallet[walletData.l1Address] != address(0)) {\n // If the wallet was already received, just send the tokens to the L2 address\n _token.safeTransfer(l1WalletToL2Wallet[walletData.l1Address], _amount);\n } else {\n // Create contract using a minimal proxy and call initializer\n (bytes32 initHash, address contractAddress) = _deployFromL1(keccak256(_data), walletData);\n l1WalletToL2Wallet[walletData.l1Address] = contractAddress;\n l2WalletToL1Wallet[contractAddress] = walletData.l1Address;\n\n // Send managed amount to the created contract\n _token.safeTransfer(contractAddress, _amount);\n\n emit TokenLockCreatedFromL1(\n contractAddress,\n initHash,\n walletData.beneficiary,\n walletData.managedAmount,\n walletData.startTime,\n walletData.endTime,\n walletData.l1Address\n );\n }\n emit LockedTokensReceivedFromL1(walletData.l1Address, l1WalletToL2Wallet[walletData.l1Address], _amount);\n }\n\n /**\n * @dev Deploy a token lock wallet with data received from L1\n * @param _salt Salt for the CREATE2 call, which must be the hash of the wallet data\n * @param _walletData Data of the wallet to be created\n * @return Hash of the initialization calldata\n * @return Address of the created contract\n */\n function _deployFromL1(bytes32 _salt, TransferredWalletData memory _walletData) internal returns (bytes32, address) {\n bytes memory initializer = _encodeInitializer(_walletData);\n address contractAddress = _deployProxy2(_salt, masterCopy, initializer);\n return (keccak256(initializer), contractAddress);\n }\n\n /**\n * @dev Encode the initializer for the token lock wallet received from L1\n * @param _walletData Data of the wallet to be created\n * @return Encoded initializer calldata, including the function signature\n */\n function _encodeInitializer(TransferredWalletData memory _walletData) internal view returns (bytes memory) {\n return\n abi.encodeWithSelector(\n L2GraphTokenLockWallet.initializeFromL1.selector,\n address(this),\n address(_token),\n _walletData\n );\n }\n}\n" + }, + "contracts/L2GraphTokenLockTransferTool.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\nimport { L2GraphTokenLockManager } from \"./L2GraphTokenLockManager.sol\";\nimport { L2GraphTokenLockWallet } from \"./L2GraphTokenLockWallet.sol\";\nimport { ITokenGateway } from \"./arbitrum/ITokenGateway.sol\";\n\n/**\n * @title L2GraphTokenLockTransferTool contract\n * @notice This contract is used to transfer GRT from L2 token lock wallets\n * back to their L1 counterparts.\n */\ncontract L2GraphTokenLockTransferTool {\n /// Address of the L2 GRT token\n IERC20 public immutable graphToken;\n /// Address of the L2GraphTokenGateway\n ITokenGateway public immutable l2Gateway;\n /// Address of the L1 GRT token (in L1, no aliasing)\n address public immutable l1GraphToken;\n\n /// @dev Emitted when GRT is sent to L1 from a token lock\n event LockedFundsSentToL1(\n address indexed l1Wallet,\n address indexed l2Wallet,\n address indexed l2LockManager,\n uint256 amount\n );\n\n /**\n * @notice Constructor for the L2GraphTokenLockTransferTool contract\n * @dev Note the L2GraphTokenLockTransferTool can be deployed behind a proxy,\n * and the constructor for the implementation will only set some immutable\n * variables.\n * @param _graphToken Address of the L2 GRT token\n * @param _l2Gateway Address of the L2GraphTokenGateway\n * @param _l1GraphToken Address of the L1 GRT token (in L1, no aliasing)\n */\n constructor(IERC20 _graphToken, ITokenGateway _l2Gateway, address _l1GraphToken) {\n graphToken = _graphToken;\n l2Gateway = _l2Gateway;\n l1GraphToken = _l1GraphToken;\n }\n\n /**\n * @notice Withdraw GRT from an L2 token lock wallet to its L1 counterpart.\n * This function must be called from an L2GraphTokenLockWallet contract.\n * The GRT will be sent to L1 and must be claimed using the Arbitrum Outbox on L1\n * after the standard Arbitrum withdrawal period (7 days).\n * @param _amount Amount of GRT to withdraw\n */\n function withdrawToL1Locked(uint256 _amount) external {\n L2GraphTokenLockWallet wallet = L2GraphTokenLockWallet(msg.sender);\n L2GraphTokenLockManager manager = L2GraphTokenLockManager(address(wallet.manager()));\n require(address(manager) != address(0), \"INVALID_SENDER\");\n address l1Wallet = manager.l2WalletToL1Wallet(msg.sender);\n require(l1Wallet != address(0), \"NOT_L1_WALLET\");\n require(_amount <= graphToken.balanceOf(msg.sender), \"INSUFFICIENT_BALANCE\");\n require(_amount != 0, \"ZERO_AMOUNT\");\n\n graphToken.transferFrom(msg.sender, address(this), _amount);\n graphToken.approve(address(l2Gateway), _amount);\n\n // Send the tokens through the L2GraphTokenGateway to the L1 wallet counterpart\n l2Gateway.outboundTransfer(l1GraphToken, l1Wallet, _amount, 0, 0, \"\");\n emit LockedFundsSentToL1(l1Wallet, msg.sender, address(manager), _amount);\n }\n}\n" + }, + "contracts/L2GraphTokenLockWallet.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\nimport { GraphTokenLockWallet } from \"./GraphTokenLockWallet.sol\";\nimport { Ownable as OwnableInitializable } from \"./Ownable.sol\";\nimport { L2GraphTokenLockManager } from \"./L2GraphTokenLockManager.sol\";\n\n/**\n * @title L2GraphTokenLockWallet\n * @notice This contract is built on top of the base GraphTokenLock functionality.\n * It allows wallet beneficiaries to use the deposited funds to perform specific function calls\n * on specific contracts.\n *\n * The idea is that supporters with locked tokens can participate in the protocol\n * but disallow any release before the vesting/lock schedule.\n * The beneficiary can issue authorized function calls to this contract that will\n * get forwarded to a target contract. A target contract is any of our protocol contracts.\n * The function calls allowed are queried to the GraphTokenLockManager, this way\n * the same configuration can be shared for all the created lock wallet contracts.\n *\n * This L2 variant includes a special initializer so that it can be created from\n * a wallet's data received from L1. These transferred wallets will not allow releasing\n * funds in L2 until the end of the vesting timeline, but they can allow withdrawing\n * funds back to L1 using the L2GraphTokenLockTransferTool contract.\n *\n * Note that surplusAmount and releasedAmount in L2 will be skewed for wallets received from L1,\n * so releasing surplus tokens might also only be possible by bridging tokens back to L1.\n *\n * NOTE: Contracts used as target must have its function signatures checked to avoid collisions\n * with any of this contract functions.\n * Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience\n * the maximum amount of tokens is authorized.\n * Function calls do not forward ETH value so DO NOT SEND ETH TO THIS CONTRACT.\n */\ncontract L2GraphTokenLockWallet is GraphTokenLockWallet {\n // Initializer when created from a message from L1\n function initializeFromL1(\n address _manager,\n address _token,\n L2GraphTokenLockManager.TransferredWalletData calldata _walletData\n ) external {\n require(!isInitialized, \"Already initialized\");\n isInitialized = true;\n\n OwnableInitializable._initialize(_walletData.owner);\n beneficiary = _walletData.beneficiary;\n token = IERC20(_token);\n\n managedAmount = _walletData.managedAmount;\n\n startTime = _walletData.startTime;\n endTime = _walletData.endTime;\n periods = 1;\n isAccepted = true;\n\n // Optionals\n releaseStartTime = _walletData.endTime;\n revocable = Revocability.Disabled;\n\n _setManager(_manager);\n }\n}\n" + }, + "contracts/MathUtils.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nlibrary MathUtils {\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n}\n" + }, + "contracts/MinimalProxyFactory.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport { Address } from \"@openzeppelin/contracts/utils/Address.sol\";\nimport { Create2 } from \"@openzeppelin/contracts/utils/Create2.sol\";\n\n/**\n * @title MinimalProxyFactory: a factory contract for creating minimal proxies\n * @notice Adapted from https://github.com/OpenZeppelin/openzeppelin-sdk/blob/v2.5.0/packages/lib/contracts/upgradeability/ProxyFactory.sol\n * Based on https://eips.ethereum.org/EIPS/eip-1167\n */\ncontract MinimalProxyFactory {\n /// @dev Emitted when a new proxy is created\n event ProxyCreated(address indexed proxy);\n\n /**\n * @notice Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation\n * @param _salt Bytes32 salt to use for CREATE2\n * @param _implementation Address of the proxy target implementation\n * @param _deployer Address of the deployer that creates the contract\n * @return Address of the counterfactual MinimalProxy\n */\n function getDeploymentAddress(\n bytes32 _salt,\n address _implementation,\n address _deployer\n ) public pure returns (address) {\n return Create2.computeAddress(_salt, keccak256(_getContractCreationCode(_implementation)), _deployer);\n }\n\n /**\n * @dev Deploys a MinimalProxy with CREATE2\n * @param _salt Bytes32 salt to use for CREATE2\n * @param _implementation Address of the proxy target implementation\n * @param _data Bytes with the initializer call\n * @return Address of the deployed MinimalProxy\n */\n function _deployProxy2(bytes32 _salt, address _implementation, bytes memory _data) internal returns (address) {\n address proxyAddress = Create2.deploy(0, _salt, _getContractCreationCode(_implementation));\n\n emit ProxyCreated(proxyAddress);\n\n // Call function with data\n if (_data.length > 0) {\n Address.functionCall(proxyAddress, _data);\n }\n\n return proxyAddress;\n }\n\n /**\n * @dev Gets the MinimalProxy bytecode\n * @param _implementation Address of the proxy target implementation\n * @return MinimalProxy bytecode\n */\n function _getContractCreationCode(address _implementation) internal pure returns (bytes memory) {\n bytes10 creation = 0x3d602d80600a3d3981f3;\n bytes10 prefix = 0x363d3d373d3d3d363d73;\n bytes20 targetBytes = bytes20(_implementation);\n bytes15 suffix = 0x5af43d82803e903d91602b57fd5bf3;\n return abi.encodePacked(creation, prefix, targetBytes, suffix);\n }\n}\n" + }, + "contracts/Ownable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * The owner account will be passed on initialization of the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\ncontract Ownable {\n /// @dev Owner of the contract, can be retrieved with the public owner() function\n address private _owner;\n /// @dev Since upgradeable contracts might inherit this, we add a storage gap\n /// to allow adding variables here without breaking the proxy storage layout\n uint256[50] private __gap;\n\n /// @dev Emitted when ownership of the contract is transferred\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n function _initialize(address owner) internal {\n _owner = owner;\n emit OwnershipTransferred(address(0), owner);\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(_owner == msg.sender, \"Ownable: caller is not the owner\");\n _;\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() external virtual onlyOwner {\n emit OwnershipTransferred(_owner, address(0));\n _owner = address(0);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) external virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n emit OwnershipTransferred(_owner, newOwner);\n _owner = newOwner;\n }\n}\n" + }, + "contracts/tests/arbitrum/AddressAliasHelper.sol": { + "content": "// SPDX-License-Identifier: Apache-2.0\n\n/*\n * Copyright 2019-2021, Offchain Labs, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * Originally copied from:\n * https://github.com/OffchainLabs/arbitrum/tree/84e64dee6ee82adbf8ec34fd4b86c207a61d9007/packages/arb-bridge-eth\n *\n * MODIFIED from Offchain Labs' implementation:\n * - Changed solidity version to 0.7.3 (pablo@edgeandnode.com)\n *\n */\n\npragma solidity ^0.7.3;\n\nlibrary AddressAliasHelper {\n uint160 constant offset = uint160(0x1111000000000000000000000000000000001111);\n\n /// @notice Utility function that converts the address in the L1 that submitted a tx to\n /// the inbox to the msg.sender viewed in the L2\n /// @param l1Address the address in the L1 that triggered the tx to L2\n /// @return l2Address L2 address as viewed in msg.sender\n function applyL1ToL2Alias(address l1Address) internal pure returns (address l2Address) {\n l2Address = address(uint160(l1Address) + offset);\n }\n\n /// @notice Utility function that converts the msg.sender viewed in the L2 to the\n /// address in the L1 that submitted a tx to the inbox\n /// @param l2Address L2 address as viewed in msg.sender\n /// @return l1Address the address in the L1 that triggered the tx to L2\n function undoL1ToL2Alias(address l2Address) internal pure returns (address l1Address) {\n l1Address = address(uint160(l2Address) - offset);\n }\n}\n" + }, + "contracts/tests/arbitrum/IBridge.sol": { + "content": "// SPDX-License-Identifier: Apache-2.0\n\n/*\n * Copyright 2021, Offchain Labs, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * Originally copied from:\n * https://github.com/OffchainLabs/arbitrum/tree/e3a6307ad8a2dc2cad35728a2a9908cfd8dd8ef9/packages/arb-bridge-eth\n *\n * MODIFIED from Offchain Labs' implementation:\n * - Changed solidity version to 0.7.3 (pablo@edgeandnode.com)\n *\n */\n\npragma solidity ^0.7.3;\n\ninterface IBridge {\n event MessageDelivered(\n uint256 indexed messageIndex,\n bytes32 indexed beforeInboxAcc,\n address inbox,\n uint8 kind,\n address sender,\n bytes32 messageDataHash\n );\n\n event BridgeCallTriggered(address indexed outbox, address indexed destAddr, uint256 amount, bytes data);\n\n event InboxToggle(address indexed inbox, bool enabled);\n\n event OutboxToggle(address indexed outbox, bool enabled);\n\n function deliverMessageToInbox(\n uint8 kind,\n address sender,\n bytes32 messageDataHash\n ) external payable returns (uint256);\n\n function executeCall(\n address destAddr,\n uint256 amount,\n bytes calldata data\n ) external returns (bool success, bytes memory returnData);\n\n // These are only callable by the admin\n function setInbox(address inbox, bool enabled) external;\n\n function setOutbox(address inbox, bool enabled) external;\n\n // View functions\n\n function activeOutbox() external view returns (address);\n\n function allowedInboxes(address inbox) external view returns (bool);\n\n function allowedOutboxes(address outbox) external view returns (bool);\n\n function inboxAccs(uint256 index) external view returns (bytes32);\n\n function messageCount() external view returns (uint256);\n}\n" + }, + "contracts/tests/arbitrum/IInbox.sol": { + "content": "// SPDX-License-Identifier: Apache-2.0\n\n/*\n * Copyright 2021, Offchain Labs, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * Originally copied from:\n * https://github.com/OffchainLabs/arbitrum/tree/e3a6307ad8a2dc2cad35728a2a9908cfd8dd8ef9/packages/arb-bridge-eth\n *\n * MODIFIED from Offchain Labs' implementation:\n * - Changed solidity version to 0.7.3 (pablo@edgeandnode.com)\n *\n */\n\npragma solidity ^0.7.3;\n\nimport \"./IBridge.sol\";\nimport \"./IMessageProvider.sol\";\n\ninterface IInbox is IMessageProvider {\n function sendL2Message(bytes calldata messageData) external returns (uint256);\n\n function sendUnsignedTransaction(\n uint256 maxGas,\n uint256 gasPriceBid,\n uint256 nonce,\n address destAddr,\n uint256 amount,\n bytes calldata data\n ) external returns (uint256);\n\n function sendContractTransaction(\n uint256 maxGas,\n uint256 gasPriceBid,\n address destAddr,\n uint256 amount,\n bytes calldata data\n ) external returns (uint256);\n\n function sendL1FundedUnsignedTransaction(\n uint256 maxGas,\n uint256 gasPriceBid,\n uint256 nonce,\n address destAddr,\n bytes calldata data\n ) external payable returns (uint256);\n\n function sendL1FundedContractTransaction(\n uint256 maxGas,\n uint256 gasPriceBid,\n address destAddr,\n bytes calldata data\n ) external payable returns (uint256);\n\n function createRetryableTicket(\n address destAddr,\n uint256 arbTxCallValue,\n uint256 maxSubmissionCost,\n address submissionRefundAddress,\n address valueRefundAddress,\n uint256 maxGas,\n uint256 gasPriceBid,\n bytes calldata data\n ) external payable returns (uint256);\n\n function depositEth(uint256 maxSubmissionCost) external payable returns (uint256);\n\n function bridge() external view returns (IBridge);\n\n function pauseCreateRetryables() external;\n\n function unpauseCreateRetryables() external;\n\n function startRewriteAddress() external;\n\n function stopRewriteAddress() external;\n}\n" + }, + "contracts/tests/arbitrum/IMessageProvider.sol": { + "content": "// SPDX-License-Identifier: Apache-2.0\n\n/*\n * Copyright 2021, Offchain Labs, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * Originally copied from:\n * https://github.com/OffchainLabs/arbitrum/tree/e3a6307ad8a2dc2cad35728a2a9908cfd8dd8ef9/packages/arb-bridge-eth\n *\n * MODIFIED from Offchain Labs' implementation:\n * - Changed solidity version to 0.7.3 (pablo@edgeandnode.com)\n *\n */\n\npragma solidity ^0.7.3;\n\ninterface IMessageProvider {\n event InboxMessageDelivered(uint256 indexed messageNum, bytes data);\n\n event InboxMessageDeliveredFromOrigin(uint256 indexed messageNum);\n}\n" + }, + "contracts/tests/BridgeMock.sol": { + "content": "// SPDX-License-Identifier: GPL-2.0-or-later\n\npragma solidity ^0.7.3;\n\nimport \"./arbitrum/IBridge.sol\";\n\n/**\n * @title Arbitrum Bridge mock contract\n * @dev This contract implements Arbitrum's IBridge interface for testing purposes\n */\ncontract BridgeMock is IBridge {\n /// Address of the (mock) Arbitrum Inbox\n address public inbox;\n /// Address of the (mock) Arbitrum Outbox\n address public outbox;\n /// Index of the next message on the inbox messages array\n uint256 public messageIndex;\n /// Inbox messages array\n bytes32[] public override inboxAccs;\n\n /**\n * @notice Deliver a message to the inbox. The encoded message will be\n * added to the inbox array, and messageIndex will be incremented.\n * @param _kind Type of the message\n * @param _sender Address that is sending the message\n * @param _messageDataHash keccak256 hash of the message data\n * @return The next index for the inbox array\n */\n function deliverMessageToInbox(\n uint8 _kind,\n address _sender,\n bytes32 _messageDataHash\n ) external payable override returns (uint256) {\n messageIndex = messageIndex + 1;\n inboxAccs.push(keccak256(abi.encodePacked(inbox, _kind, _sender, _messageDataHash)));\n emit MessageDelivered(messageIndex, inboxAccs[messageIndex - 1], msg.sender, _kind, _sender, _messageDataHash);\n return messageIndex;\n }\n\n /**\n * @notice Executes an L1 function call incoing from L2. This can only be called\n * by the Outbox.\n * @param _destAddr Contract to call\n * @param _amount ETH value to send\n * @param _data Calldata for the function call\n * @return True if the call was successful, false otherwise\n * @return Return data from the call\n */\n function executeCall(\n address _destAddr,\n uint256 _amount,\n bytes calldata _data\n ) external override returns (bool, bytes memory) {\n require(outbox == msg.sender, \"NOT_FROM_OUTBOX\");\n bool success;\n bytes memory returnData;\n\n // solhint-disable-next-line avoid-low-level-calls\n (success, returnData) = _destAddr.call{ value: _amount }(_data);\n emit BridgeCallTriggered(msg.sender, _destAddr, _amount, _data);\n return (success, returnData);\n }\n\n /**\n * @notice Set the address of the inbox. Anyone can call this, because it's a mock.\n * @param _inbox Address of the inbox\n * @param _enabled Enable the inbox (ignored)\n */\n function setInbox(address _inbox, bool _enabled) external override {\n inbox = _inbox;\n emit InboxToggle(inbox, _enabled);\n }\n\n /**\n * @notice Set the address of the outbox. Anyone can call this, because it's a mock.\n * @param _outbox Address of the outbox\n * @param _enabled Enable the outbox (ignored)\n */\n function setOutbox(address _outbox, bool _enabled) external override {\n outbox = _outbox;\n emit OutboxToggle(outbox, _enabled);\n }\n\n // View functions\n\n /**\n * @notice Getter for the active outbox (in this case there's only one)\n */\n function activeOutbox() external view override returns (address) {\n return outbox;\n }\n\n /**\n * @notice Getter for whether an address is an allowed inbox (in this case there's only one)\n * @param _inbox Address to check\n * @return True if the address is the allowed inbox, false otherwise\n */\n function allowedInboxes(address _inbox) external view override returns (bool) {\n return _inbox == inbox;\n }\n\n /**\n * @notice Getter for whether an address is an allowed outbox (in this case there's only one)\n * @param _outbox Address to check\n * @return True if the address is the allowed outbox, false otherwise\n */\n function allowedOutboxes(address _outbox) external view override returns (bool) {\n return _outbox == outbox;\n }\n\n /**\n * @notice Getter for the count of messages in the inboxAccs\n * @return Number of messages in inboxAccs\n */\n function messageCount() external view override returns (uint256) {\n return inboxAccs.length;\n }\n}\n" + }, + "contracts/tests/GraphTokenMock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\n\n/**\n * @title Graph Token Mock contract.\n * @dev Used for testing purposes, DO NOT USE IN PRODUCTION\n */\ncontract GraphTokenMock is Ownable, ERC20 {\n /**\n * @notice Contract Constructor.\n * @param _initialSupply Initial supply\n * @param _mintTo Address to whitch to mint the initial supply\n */\n constructor(uint256 _initialSupply, address _mintTo) ERC20(\"Graph Token Mock\", \"GRT-Mock\") {\n // Deploy to mint address\n _mint(_mintTo, _initialSupply);\n }\n\n /**\n * @notice Mint tokens to an address from the bridge.\n * (The real one has an onlyGateway modifier)\n * @param _to Address to mint tokens to\n * @param _amount Amount of tokens to mint\n */\n function bridgeMint(address _to, uint256 _amount) external {\n _mint(_to, _amount);\n }\n\n /**\n * @notice Burn tokens from an address from the bridge.\n * (The real one has an onlyGateway modifier)\n * @param _from Address to burn tokens from\n * @param _amount Amount of tokens to burn\n */\n function bridgeBurn(address _from, uint256 _amount) external {\n _burn(_from, _amount);\n }\n}\n" + }, + "contracts/tests/InboxMock.sol": { + "content": "// SPDX-License-Identifier: GPL-2.0-or-later\n\npragma solidity ^0.7.3;\n\nimport \"./arbitrum/IInbox.sol\";\nimport \"./arbitrum/AddressAliasHelper.sol\";\n\n/**\n * @title Arbitrum Inbox mock contract\n * @dev This contract implements (a subset of) Arbitrum's IInbox interface for testing purposes\n */\ncontract InboxMock is IInbox {\n /// @dev Type indicator for a standard L2 message\n uint8 internal constant L2_MSG = 3;\n /// @dev Type indicator for a retryable ticket message\n // solhint-disable-next-line const-name-snakecase\n uint8 internal constant L1MessageType_submitRetryableTx = 9;\n /// Address of the Bridge (mock) contract\n IBridge public override bridge;\n\n /**\n * @notice Send a message to L2 (by delivering it to the Bridge)\n * @param _messageData Encoded data to send in the message\n * @return Message number returned by the inbox\n */\n function sendL2Message(bytes calldata _messageData) external override returns (uint256) {\n uint256 msgNum = deliverToBridge(L2_MSG, msg.sender, keccak256(_messageData));\n emit InboxMessageDelivered(msgNum, _messageData);\n return msgNum;\n }\n\n /**\n * @notice Set the address of the (mock) bridge\n * @param _bridge Address of the bridge\n */\n function setBridge(address _bridge) external {\n bridge = IBridge(_bridge);\n }\n\n /**\n * @notice Unimplemented in this mock\n */\n function sendUnsignedTransaction(\n uint256,\n uint256,\n uint256,\n address,\n uint256,\n bytes calldata\n ) external pure override returns (uint256) {\n revert(\"Unimplemented\");\n }\n\n /**\n * @notice Unimplemented in this mock\n */\n function sendContractTransaction(\n uint256,\n uint256,\n address,\n uint256,\n bytes calldata\n ) external pure override returns (uint256) {\n revert(\"Unimplemented\");\n }\n\n /**\n * @notice Unimplemented in this mock\n */\n function sendL1FundedUnsignedTransaction(\n uint256,\n uint256,\n uint256,\n address,\n bytes calldata\n ) external payable override returns (uint256) {\n revert(\"Unimplemented\");\n }\n\n /**\n * @notice Unimplemented in this mock\n */\n function sendL1FundedContractTransaction(\n uint256,\n uint256,\n address,\n bytes calldata\n ) external payable override returns (uint256) {\n revert(\"Unimplemented\");\n }\n\n /**\n * @notice Creates a retryable ticket for an L2 transaction\n * @param _destAddr Address of the contract to call in L2\n * @param _arbTxCallValue Callvalue to use in the L2 transaction\n * @param _maxSubmissionCost Max cost of submitting the ticket, in Wei\n * @param _submissionRefundAddress L2 address to refund for any remaining value from the submission cost\n * @param _valueRefundAddress L2 address to refund if the ticket times out or gets cancelled\n * @param _maxGas Max gas for the L2 transcation\n * @param _gasPriceBid Gas price bid on L2\n * @param _data Encoded calldata for the L2 transaction (including function selector)\n * @return Message number returned by the bridge\n */\n function createRetryableTicket(\n address _destAddr,\n uint256 _arbTxCallValue,\n uint256 _maxSubmissionCost,\n address _submissionRefundAddress,\n address _valueRefundAddress,\n uint256 _maxGas,\n uint256 _gasPriceBid,\n bytes calldata _data\n ) external payable override returns (uint256) {\n _submissionRefundAddress = AddressAliasHelper.applyL1ToL2Alias(_submissionRefundAddress);\n _valueRefundAddress = AddressAliasHelper.applyL1ToL2Alias(_valueRefundAddress);\n return\n _deliverMessage(\n L1MessageType_submitRetryableTx,\n msg.sender,\n abi.encodePacked(\n uint256(uint160(bytes20(_destAddr))),\n _arbTxCallValue,\n msg.value,\n _maxSubmissionCost,\n uint256(uint160(bytes20(_submissionRefundAddress))),\n uint256(uint160(bytes20(_valueRefundAddress))),\n _maxGas,\n _gasPriceBid,\n _data.length,\n _data\n )\n );\n }\n\n /**\n * @notice Unimplemented in this mock\n */\n function depositEth(uint256) external payable override returns (uint256) {\n revert(\"Unimplemented\");\n }\n\n /**\n * @notice Unimplemented in this mock\n */\n function pauseCreateRetryables() external pure override {\n revert(\"Unimplemented\");\n }\n\n /**\n * @notice Unimplemented in this mock\n */\n function unpauseCreateRetryables() external pure override {\n revert(\"Unimplemented\");\n }\n\n /**\n * @notice Unimplemented in this mock\n */\n function startRewriteAddress() external pure override {\n revert(\"Unimplemented\");\n }\n\n /**\n * @notice Unimplemented in this mock\n */\n function stopRewriteAddress() external pure override {\n revert(\"Unimplemented\");\n }\n\n /**\n * @dev Deliver a message to the bridge\n * @param _kind Type of the message\n * @param _sender Address that is sending the message\n * @param _messageData Encoded message data\n * @return Message number returned by the bridge\n */\n function _deliverMessage(uint8 _kind, address _sender, bytes memory _messageData) internal returns (uint256) {\n uint256 msgNum = deliverToBridge(_kind, _sender, keccak256(_messageData));\n emit InboxMessageDelivered(msgNum, _messageData);\n return msgNum;\n }\n\n /**\n * @dev Deliver a message to the bridge\n * @param _kind Type of the message\n * @param _sender Address that is sending the message\n * @param _messageDataHash keccak256 hash of the encoded message data\n * @return Message number returned by the bridge\n */\n function deliverToBridge(uint8 _kind, address _sender, bytes32 _messageDataHash) internal returns (uint256) {\n return bridge.deliverMessageToInbox{ value: msg.value }(_kind, _sender, _messageDataHash);\n }\n}\n" + }, + "contracts/tests/L1TokenGatewayMock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport { Ownable } from \"@openzeppelin/contracts/access/Ownable.sol\";\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport { SafeMath } from \"@openzeppelin/contracts/math/SafeMath.sol\";\nimport { ITokenGateway } from \"../arbitrum//ITokenGateway.sol\";\n\n/**\n * @title L1 Token Gateway mock contract\n * @dev Used for testing purposes, DO NOT USE IN PRODUCTION\n */\ncontract L1TokenGatewayMock is Ownable {\n using SafeMath for uint256;\n /// Next sequence number to return when outboundTransfer is called\n uint256 public nextSeqNum;\n\n /// @dev Emitted when a (fake) retryable ticket is created\n event FakeTxToL2(\n address from,\n uint256 value,\n uint256 maxGas,\n uint256 gasPriceBid,\n uint256 maxSubmissionCost,\n bytes outboundCalldata\n );\n\n /// @dev Emitted when an outbound transfer is initiated, i.e. tokens are deposited from L1 to L2\n event DepositInitiated(\n address l1Token,\n address indexed from,\n address indexed to,\n uint256 indexed sequenceNumber,\n uint256 amount\n );\n\n /**\n * @notice L1 Token Gateway Contract Constructor.\n */\n constructor() {}\n\n /**\n * @notice Creates and sends a fake retryable ticket to transfer GRT to L2.\n * This mock will actually just emit an event with parameters equivalent to what the real L1GraphTokenGateway\n * would send to L2.\n * @param _l1Token L1 Address of the GRT contract (needed for compatibility with Arbitrum Gateway Router)\n * @param _to Recipient address on L2\n * @param _amount Amount of tokens to tranfer\n * @param _maxGas Gas limit for L2 execution of the ticket\n * @param _gasPriceBid Price per gas on L2\n * @param _data Encoded maxSubmissionCost and sender address along with additional calldata\n * @return Sequence number of the retryable ticket created by Inbox (always )\n */\n function outboundTransfer(\n address _l1Token,\n address _to,\n uint256 _amount,\n uint256 _maxGas,\n uint256 _gasPriceBid,\n bytes calldata _data\n ) external payable returns (bytes memory) {\n require(_amount > 0, \"INVALID_ZERO_AMOUNT\");\n require(_to != address(0), \"INVALID_DESTINATION\");\n\n // nested scopes to avoid stack too deep errors\n address from;\n uint256 seqNum = nextSeqNum;\n nextSeqNum += 1;\n {\n uint256 maxSubmissionCost;\n bytes memory outboundCalldata;\n {\n bytes memory extraData;\n (from, maxSubmissionCost, extraData) = _parseOutboundData(_data);\n require(maxSubmissionCost > 0, \"NO_SUBMISSION_COST\");\n\n {\n // makes sure only sufficient ETH is supplied as required for successful redemption on L2\n // if a user does not desire immediate redemption they should provide\n // a msg.value of AT LEAST maxSubmissionCost\n uint256 expectedEth = maxSubmissionCost.add(_maxGas.mul(_gasPriceBid));\n require(msg.value >= expectedEth, \"WRONG_ETH_VALUE\");\n }\n outboundCalldata = getOutboundCalldata(_l1Token, from, _to, _amount, extraData);\n }\n {\n // transfer tokens to escrow\n IERC20(_l1Token).transferFrom(from, address(this), _amount);\n\n emit FakeTxToL2(from, msg.value, _maxGas, _gasPriceBid, maxSubmissionCost, outboundCalldata);\n }\n }\n emit DepositInitiated(_l1Token, from, _to, seqNum, _amount);\n\n return abi.encode(seqNum);\n }\n\n /**\n * @notice (Mock) Receives withdrawn tokens from L2\n * Actually does nothing, just keeping it here as its useful to define the expected\n * calldata for the outgoing transfer in tests.\n * @param _l1Token L1 Address of the GRT contract (needed for compatibility with Arbitrum Gateway Router)\n * @param _from Address of the sender\n * @param _to Recepient address on L1\n * @param _amount Amount of tokens transferred\n * @param _data Additional calldata\n */\n function finalizeInboundTransfer(\n address _l1Token,\n address _from,\n address _to,\n uint256 _amount,\n bytes calldata _data\n ) external payable {}\n\n /**\n * @notice Creates calldata required to create a retryable ticket\n * @dev encodes the target function with its params which\n * will be called on L2 when the retryable ticket is redeemed\n * @param _l1Token Address of the Graph token contract on L1\n * @param _from Address on L1 from which we're transferring tokens\n * @param _to Address on L2 to which we're transferring tokens\n * @param _amount Amount of GRT to transfer\n * @param _data Additional call data for the L2 transaction, which must be empty unless the caller is whitelisted\n * @return Encoded calldata (including function selector) for the L2 transaction\n */\n function getOutboundCalldata(\n address _l1Token,\n address _from,\n address _to,\n uint256 _amount,\n bytes memory _data\n ) public pure returns (bytes memory) {\n bytes memory emptyBytes;\n\n return\n abi.encodeWithSelector(\n ITokenGateway.finalizeInboundTransfer.selector,\n _l1Token,\n _from,\n _to,\n _amount,\n abi.encode(emptyBytes, _data)\n );\n }\n\n /**\n * @notice Decodes calldata required for transfer of tokens to L2\n * @dev Data must include maxSubmissionCost, extraData can be left empty. When the router\n * sends an outbound message, data also contains the from address, but this mock\n * doesn't consider this case\n * @param _data Encoded callhook data containing maxSubmissionCost and extraData\n * @return Sender of the tx\n * @return Max ether value used to submit the retryable ticket\n * @return Additional data sent to L2\n */\n function _parseOutboundData(bytes memory _data) private view returns (address, uint256, bytes memory) {\n address from;\n uint256 maxSubmissionCost;\n bytes memory extraData;\n from = msg.sender;\n // User-encoded data contains the max retryable ticket submission cost\n // and additional L2 calldata\n (maxSubmissionCost, extraData) = abi.decode(_data, (uint256, bytes));\n return (from, maxSubmissionCost, extraData);\n }\n}\n" + }, + "contracts/tests/L2TokenGatewayMock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport { Ownable } from \"@openzeppelin/contracts/access/Ownable.sol\";\nimport { ITokenGateway } from \"../arbitrum//ITokenGateway.sol\";\nimport { GraphTokenMock } from \"./GraphTokenMock.sol\";\nimport { ICallhookReceiver } from \"../ICallhookReceiver.sol\";\n\n/**\n * @title L2 Token Gateway mock contract\n * @dev Used for testing purposes, DO NOT USE IN PRODUCTION\n */\ncontract L2TokenGatewayMock is Ownable {\n /// Address of the L1 GRT contract\n address public immutable l1Token;\n /// Address of the L2 GRT contract\n address public immutable l2Token;\n /// Next ID to return when sending an outboundTransfer\n uint256 public nextId;\n\n /// @dev Emitted when a (fake) transaction to L1 is created\n event FakeTxToL1(address from, bytes outboundCalldata);\n /// @dev Emitted when a (fake) retryable ticket is received from L1\n event DepositFinalized(address token, address indexed from, address indexed to, uint256 amount);\n\n /// @dev Emitted when an outbound transfer is initiated, i.e. tokens are withdrawn to L1 from L2\n event WithdrawalInitiated(\n address l1Token,\n address indexed from,\n address indexed to,\n uint256 indexed sequenceNumber,\n uint256 amount\n );\n\n /**\n * @notice L2 Token Gateway Contract Constructor.\n * @param _l1Token Address of the L1 GRT contract\n * @param _l2Token Address of the L2 GRT contract\n */\n constructor(address _l1Token, address _l2Token) {\n l1Token = _l1Token;\n l2Token = _l2Token;\n }\n\n /**\n * @notice Creates and sends a (fake) transfer of GRT to L1.\n * This mock will actually just emit an event with parameters equivalent to what the real L2GraphTokenGateway\n * would send to L1.\n * @param _l1Token L1 Address of the GRT contract (needed for compatibility with Arbitrum Gateway Router)\n * @param _to Recipient address on L2\n * @param _amount Amount of tokens to tranfer\n * @param _data Encoded maxSubmissionCost and sender address along with additional calldata\n * @return ID of the L2-L1 message (incrementing on every call)\n */\n function outboundTransfer(\n address _l1Token,\n address _to,\n uint256 _amount,\n uint256,\n uint256,\n bytes calldata _data\n ) external payable returns (bytes memory) {\n require(_l1Token == l1Token, \"INVALID_L1_TOKEN\");\n require(_amount > 0, \"INVALID_ZERO_AMOUNT\");\n require(_to != address(0), \"INVALID_DESTINATION\");\n\n // nested scopes to avoid stack too deep errors\n address from;\n uint256 id = nextId;\n nextId += 1;\n {\n bytes memory outboundCalldata;\n {\n bytes memory extraData;\n (from, extraData) = _parseOutboundData(_data);\n\n require(msg.value == 0, \"!value\");\n require(extraData.length == 0, \"!extraData\");\n outboundCalldata = getOutboundCalldata(_l1Token, from, _to, _amount, extraData);\n }\n {\n // burn tokens from the sender, they will be released from escrow in L1\n GraphTokenMock(l2Token).bridgeBurn(from, _amount);\n\n emit FakeTxToL1(from, outboundCalldata);\n }\n }\n emit WithdrawalInitiated(_l1Token, from, _to, id, _amount);\n\n return abi.encode(id);\n }\n\n /**\n * @notice (Mock) Receives withdrawn tokens from L1\n * Implements calling callhooks if data is non-empty.\n * @param _l1Token L1 Address of the GRT contract (needed for compatibility with Arbitrum Gateway Router)\n * @param _from Address of the sender\n * @param _to Recipient address on L1\n * @param _amount Amount of tokens transferred\n * @param _data Additional calldata, will trigger an onTokenTransfer call if non-empty\n */\n function finalizeInboundTransfer(\n address _l1Token,\n address _from,\n address _to,\n uint256 _amount,\n bytes calldata _data\n ) external payable {\n require(_l1Token == l1Token, \"TOKEN_NOT_GRT\");\n require(msg.value == 0, \"INVALID_NONZERO_VALUE\");\n\n GraphTokenMock(l2Token).bridgeMint(_to, _amount);\n\n if (_data.length > 0) {\n ICallhookReceiver(_to).onTokenTransfer(_from, _amount, _data);\n }\n\n emit DepositFinalized(_l1Token, _from, _to, _amount);\n }\n\n /**\n * @notice Calculate the L2 address of a bridged token\n * @dev In our case, this would only work for GRT.\n * @param l1ERC20 address of L1 GRT contract\n * @return L2 address of the bridged GRT token\n */\n function calculateL2TokenAddress(address l1ERC20) public view returns (address) {\n if (l1ERC20 != l1Token) {\n return address(0);\n }\n return l2Token;\n }\n\n /**\n * @notice Creates calldata required to create a tx to L1\n * @param _l1Token Address of the Graph token contract on L1\n * @param _from Address on L2 from which we're transferring tokens\n * @param _to Address on L1 to which we're transferring tokens\n * @param _amount Amount of GRT to transfer\n * @param _data Additional call data for the L1 transaction, which must be empty\n * @return Encoded calldata (including function selector) for the L1 transaction\n */\n function getOutboundCalldata(\n address _l1Token,\n address _from,\n address _to,\n uint256 _amount,\n bytes memory _data\n ) public pure returns (bytes memory) {\n return\n abi.encodeWithSelector(\n ITokenGateway.finalizeInboundTransfer.selector,\n _l1Token,\n _from,\n _to,\n _amount,\n abi.encode(0, _data)\n );\n }\n\n /**\n * @dev Decodes calldata required for transfer of tokens to L1.\n * extraData can be left empty\n * @param _data Encoded callhook data\n * @return Sender of the tx\n * @return Any other data sent to L1\n */\n function _parseOutboundData(bytes calldata _data) private view returns (address, bytes memory) {\n address from;\n bytes memory extraData;\n // The mock doesn't take messages from the Router\n from = msg.sender;\n extraData = _data;\n return (from, extraData);\n }\n}\n" + }, + "contracts/tests/Stakes.sol": { + "content": "// SPDX-License-Identifier: GPL-2.0-or-later\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/math/SafeMath.sol\";\n\n/**\n * @title A collection of data structures and functions to manage the Indexer Stake state.\n * Used for low-level state changes, require() conditions should be evaluated\n * at the caller function scope.\n */\nlibrary Stakes {\n using SafeMath for uint256;\n using Stakes for Stakes.Indexer;\n\n struct Indexer {\n uint256 tokensStaked; // Tokens on the indexer stake (staked by the indexer)\n uint256 tokensAllocated; // Tokens used in allocations\n uint256 tokensLocked; // Tokens locked for withdrawal subject to thawing period\n uint256 tokensLockedUntil; // Block when locked tokens can be withdrawn\n }\n\n /**\n * @dev Deposit tokens to the indexer stake.\n * @param stake Stake data\n * @param _tokens Amount of tokens to deposit\n */\n function deposit(Stakes.Indexer storage stake, uint256 _tokens) internal {\n stake.tokensStaked = stake.tokensStaked.add(_tokens);\n }\n\n /**\n * @dev Release tokens from the indexer stake.\n * @param stake Stake data\n * @param _tokens Amount of tokens to release\n */\n function release(Stakes.Indexer storage stake, uint256 _tokens) internal {\n stake.tokensStaked = stake.tokensStaked.sub(_tokens);\n }\n\n /**\n * @dev Allocate tokens from the main stack to a SubgraphDeployment.\n * @param stake Stake data\n * @param _tokens Amount of tokens to allocate\n */\n function allocate(Stakes.Indexer storage stake, uint256 _tokens) internal {\n stake.tokensAllocated = stake.tokensAllocated.add(_tokens);\n }\n\n /**\n * @dev Unallocate tokens from a SubgraphDeployment back to the main stack.\n * @param stake Stake data\n * @param _tokens Amount of tokens to unallocate\n */\n function unallocate(Stakes.Indexer storage stake, uint256 _tokens) internal {\n stake.tokensAllocated = stake.tokensAllocated.sub(_tokens);\n }\n\n /**\n * @dev Lock tokens until a thawing period pass.\n * @param stake Stake data\n * @param _tokens Amount of tokens to unstake\n * @param _period Period in blocks that need to pass before withdrawal\n */\n function lockTokens(Stakes.Indexer storage stake, uint256 _tokens, uint256 _period) internal {\n // Take into account period averaging for multiple unstake requests\n uint256 lockingPeriod = _period;\n if (stake.tokensLocked > 0) {\n lockingPeriod = stake.getLockingPeriod(_tokens, _period);\n }\n\n // Update balances\n stake.tokensLocked = stake.tokensLocked.add(_tokens);\n stake.tokensLockedUntil = block.number.add(lockingPeriod);\n }\n\n /**\n * @dev Unlock tokens.\n * @param stake Stake data\n * @param _tokens Amount of tokens to unkock\n */\n function unlockTokens(Stakes.Indexer storage stake, uint256 _tokens) internal {\n stake.tokensLocked = stake.tokensLocked.sub(_tokens);\n if (stake.tokensLocked == 0) {\n stake.tokensLockedUntil = 0;\n }\n }\n\n /**\n * @dev Take all tokens out from the locked stake for withdrawal.\n * @param stake Stake data\n * @return Amount of tokens being withdrawn\n */\n function withdrawTokens(Stakes.Indexer storage stake) internal returns (uint256) {\n // Calculate tokens that can be released\n uint256 tokensToWithdraw = stake.tokensWithdrawable();\n\n if (tokensToWithdraw > 0) {\n // Reset locked tokens\n stake.unlockTokens(tokensToWithdraw);\n\n // Decrease indexer stake\n stake.release(tokensToWithdraw);\n }\n\n return tokensToWithdraw;\n }\n\n /**\n * @dev Get the locking period of the tokens to unstake.\n * If already unstaked before calculate the weighted average.\n * @param stake Stake data\n * @param _tokens Amount of tokens to unstake\n * @param _thawingPeriod Period in blocks that need to pass before withdrawal\n * @return True if staked\n */\n function getLockingPeriod(\n Stakes.Indexer memory stake,\n uint256 _tokens,\n uint256 _thawingPeriod\n ) internal view returns (uint256) {\n uint256 blockNum = block.number;\n uint256 periodA = (stake.tokensLockedUntil > blockNum) ? stake.tokensLockedUntil.sub(blockNum) : 0;\n uint256 periodB = _thawingPeriod;\n uint256 stakeA = stake.tokensLocked;\n uint256 stakeB = _tokens;\n return periodA.mul(stakeA).add(periodB.mul(stakeB)).div(stakeA.add(stakeB));\n }\n\n /**\n * @dev Return true if there are tokens staked by the Indexer.\n * @param stake Stake data\n * @return True if staked\n */\n function hasTokens(Stakes.Indexer memory stake) internal pure returns (bool) {\n return stake.tokensStaked > 0;\n }\n\n /**\n * @dev Return the amount of tokens used in allocations and locked for withdrawal.\n * @param stake Stake data\n * @return Token amount\n */\n function tokensUsed(Stakes.Indexer memory stake) internal pure returns (uint256) {\n return stake.tokensAllocated.add(stake.tokensLocked);\n }\n\n /**\n * @dev Return the amount of tokens staked not considering the ones that are already going\n * through the thawing period or are ready for withdrawal. We call it secure stake because\n * it is not subject to change by a withdraw call from the indexer.\n * @param stake Stake data\n * @return Token amount\n */\n function tokensSecureStake(Stakes.Indexer memory stake) internal pure returns (uint256) {\n return stake.tokensStaked.sub(stake.tokensLocked);\n }\n\n /**\n * @dev Tokens free balance on the indexer stake that can be used for any purpose.\n * Any token that is allocated cannot be used as well as tokens that are going through the\n * thawing period or are withdrawable\n * Calc: tokensStaked - tokensAllocated - tokensLocked\n * @param stake Stake data\n * @return Token amount\n */\n function tokensAvailable(Stakes.Indexer memory stake) internal pure returns (uint256) {\n return stake.tokensAvailableWithDelegation(0);\n }\n\n /**\n * @dev Tokens free balance on the indexer stake that can be used for allocations.\n * This function accepts a parameter for extra delegated capacity that takes into\n * account delegated tokens\n * @param stake Stake data\n * @param _delegatedCapacity Amount of tokens used from delegators to calculate availability\n * @return Token amount\n */\n function tokensAvailableWithDelegation(\n Stakes.Indexer memory stake,\n uint256 _delegatedCapacity\n ) internal pure returns (uint256) {\n uint256 tokensCapacity = stake.tokensStaked.add(_delegatedCapacity);\n uint256 _tokensUsed = stake.tokensUsed();\n // If more tokens are used than the current capacity, the indexer is overallocated.\n // This means the indexer doesn't have available capacity to create new allocations.\n // We can reach this state when the indexer has funds allocated and then any\n // of these conditions happen:\n // - The delegationCapacity ratio is reduced.\n // - The indexer stake is slashed.\n // - A delegator removes enough stake.\n if (_tokensUsed > tokensCapacity) {\n // Indexer stake is over allocated: return 0 to avoid stake to be used until\n // the overallocation is restored by staking more tokens, unallocating tokens\n // or using more delegated funds\n return 0;\n }\n return tokensCapacity.sub(_tokensUsed);\n }\n\n /**\n * @dev Tokens available for withdrawal after thawing period.\n * @param stake Stake data\n * @return Token amount\n */\n function tokensWithdrawable(Stakes.Indexer memory stake) internal view returns (uint256) {\n // No tokens to withdraw before locking period\n if (stake.tokensLockedUntil == 0 || block.number < stake.tokensLockedUntil) {\n return 0;\n }\n return stake.tokensLocked;\n }\n}\n" + }, + "contracts/tests/StakingMock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\nimport \"./Stakes.sol\";\n\ncontract StakingMock {\n using SafeMath for uint256;\n using Stakes for Stakes.Indexer;\n\n // -- State --\n\n uint256 public minimumIndexerStake = 100e18;\n uint256 public thawingPeriod = 10; // 10 blocks\n IERC20 public token;\n\n // Indexer stakes : indexer => Stake\n mapping(address => Stakes.Indexer) public stakes;\n\n /**\n * @dev Emitted when `indexer` stake `tokens` amount.\n */\n event StakeDeposited(address indexed indexer, uint256 tokens);\n\n /**\n * @dev Emitted when `indexer` unstaked and locked `tokens` amount `until` block.\n */\n event StakeLocked(address indexed indexer, uint256 tokens, uint256 until);\n\n /**\n * @dev Emitted when `indexer` withdrew `tokens` staked.\n */\n event StakeWithdrawn(address indexed indexer, uint256 tokens);\n\n // Contract constructor.\n constructor(IERC20 _token) {\n require(address(_token) != address(0), \"!token\");\n token = _token;\n }\n\n receive() external payable {}\n\n /**\n * @dev Deposit tokens on the indexer stake.\n * @param _tokens Amount of tokens to stake\n */\n function stake(uint256 _tokens) external {\n stakeTo(msg.sender, _tokens);\n }\n\n /**\n * @dev Deposit tokens on the indexer stake.\n * @param _indexer Address of the indexer\n * @param _tokens Amount of tokens to stake\n */\n function stakeTo(address _indexer, uint256 _tokens) public {\n require(_tokens > 0, \"!tokens\");\n\n // Ensure minimum stake\n require(stakes[_indexer].tokensSecureStake().add(_tokens) >= minimumIndexerStake, \"!minimumIndexerStake\");\n\n // Transfer tokens to stake from caller to this contract\n require(token.transferFrom(msg.sender, address(this), _tokens), \"!transfer\");\n\n // Stake the transferred tokens\n _stake(_indexer, _tokens);\n }\n\n /**\n * @dev Unstake tokens from the indexer stake, lock them until thawing period expires.\n * @param _tokens Amount of tokens to unstake\n */\n function unstake(uint256 _tokens) external {\n address indexer = msg.sender;\n Stakes.Indexer storage indexerStake = stakes[indexer];\n\n require(_tokens > 0, \"!tokens\");\n require(indexerStake.hasTokens(), \"!stake\");\n require(indexerStake.tokensAvailable() >= _tokens, \"!stake-avail\");\n\n // Ensure minimum stake\n uint256 newStake = indexerStake.tokensSecureStake().sub(_tokens);\n require(newStake == 0 || newStake >= minimumIndexerStake, \"!minimumIndexerStake\");\n\n // Before locking more tokens, withdraw any unlocked ones\n uint256 tokensToWithdraw = indexerStake.tokensWithdrawable();\n if (tokensToWithdraw > 0) {\n _withdraw(indexer);\n }\n\n indexerStake.lockTokens(_tokens, thawingPeriod);\n\n emit StakeLocked(indexer, indexerStake.tokensLocked, indexerStake.tokensLockedUntil);\n }\n\n /**\n * @dev Withdraw indexer tokens once the thawing period has passed.\n */\n function withdraw() external {\n _withdraw(msg.sender);\n }\n\n function _stake(address _indexer, uint256 _tokens) internal {\n // Deposit tokens into the indexer stake\n Stakes.Indexer storage indexerStake = stakes[_indexer];\n indexerStake.deposit(_tokens);\n\n emit StakeDeposited(_indexer, _tokens);\n }\n\n /**\n * @dev Withdraw indexer tokens once the thawing period has passed.\n * @param _indexer Address of indexer to withdraw funds from\n */\n function _withdraw(address _indexer) private {\n // Get tokens available for withdraw and update balance\n uint256 tokensToWithdraw = stakes[_indexer].withdrawTokens();\n require(tokensToWithdraw > 0, \"!tokens\");\n\n // Return tokens to the indexer\n require(token.transfer(_indexer, tokensToWithdraw), \"!transfer\");\n\n emit StakeWithdrawn(_indexer, tokensToWithdraw);\n }\n}\n" + }, + "contracts/tests/WalletMock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport { Address } from \"@openzeppelin/contracts/utils/Address.sol\";\n\n/**\n * @title WalletMock: a mock wallet contract for testing purposes\n * @dev For testing only, DO NOT USE IN PRODUCTION.\n * This is used to test L1-L2 transfer tools and to create scenarios\n * where an invalid wallet calls the transfer tool, e.g. a wallet that has an invalid\n * manager, or a wallet that has not been initialized.\n */\ncontract WalletMock {\n /// Target contract for the fallback function (usually a transfer tool contract)\n address public immutable target;\n /// Address of the GRT (mock) token\n address public immutable token;\n /// Address of the wallet's manager\n address public immutable manager;\n /// Whether the wallet has been initialized\n bool public immutable isInitialized;\n /// Whether the beneficiary has accepted the lock\n bool public immutable isAccepted;\n\n /**\n * @notice WalletMock constructor\n * @dev This constructor sets all the state variables so that\n * specific test scenarios can be created just by deploying this contract.\n * @param _target Target contract for the fallback function\n * @param _token Address of the GRT (mock) token\n * @param _manager Address of the wallet's manager\n * @param _isInitialized Whether the wallet has been initialized\n * @param _isAccepted Whether the beneficiary has accepted the lock\n */\n constructor(address _target, address _token, address _manager, bool _isInitialized, bool _isAccepted) {\n target = _target;\n token = _token;\n manager = _manager;\n isInitialized = _isInitialized;\n isAccepted = _isAccepted;\n }\n\n /**\n * @notice Fallback function\n * @dev This function calls the target contract with the data sent to this contract.\n * This is used to test the L1-L2 transfer tool.\n */\n fallback() external payable {\n // Call function with data\n Address.functionCall(target, msg.data);\n }\n\n /**\n * @notice Receive function\n * @dev This function is added to avoid compiler warnings, but just reverts.\n */\n receive() external payable {\n revert(\"Invalid call\");\n }\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": false, + "runs": 200 + }, + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file diff --git a/packages/token-distribution/deployments/arbitrum-sepolia/.chainId b/packages/token-distribution/deployments/arbitrum-sepolia/.chainId new file mode 100644 index 000000000..71ba4d632 --- /dev/null +++ b/packages/token-distribution/deployments/arbitrum-sepolia/.chainId @@ -0,0 +1 @@ +421614 \ No newline at end of file diff --git a/packages/token-distribution/deployments/arbitrum-sepolia/L2GraphTokenLockManager.json b/packages/token-distribution/deployments/arbitrum-sepolia/L2GraphTokenLockManager.json new file mode 100644 index 000000000..c0a2d0689 --- /dev/null +++ b/packages/token-distribution/deployments/arbitrum-sepolia/L2GraphTokenLockManager.json @@ -0,0 +1,1198 @@ +{ + "address": "0x63E25D0319970253B003464b4008A8238B6FC02c", + "abi": [ + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_graphToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_masterCopy", + "type": "address" + }, + { + "internalType": "address", + "name": "_l2Gateway", + "type": "address" + }, + { + "internalType": "address", + "name": "_l1TransferTool", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes4", + "name": "sigHash", + "type": "bytes4" + }, + { + "indexed": true, + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "indexed": false, + "internalType": "string", + "name": "signature", + "type": "string" + } + ], + "name": "FunctionCallAuth", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "l1Address", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "l2Address", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "LockedTokensReceivedFromL1", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "masterCopy", + "type": "address" + } + ], + "name": "MasterCopyUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "proxy", + "type": "address" + } + ], + "name": "ProxyCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "dst", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "TokenDestinationAllowed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "contractAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "initHash", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "managedAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "startTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "endTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "periods", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "releaseStartTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "vestingCliffTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "enum IGraphTokenLock.Revocability", + "name": "revocable", + "type": "uint8" + } + ], + "name": "TokenLockCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "contractAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "initHash", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "managedAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "startTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "endTime", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "l1Address", + "type": "address" + } + ], + "name": "TokenLockCreatedFromL1", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensDeposited", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensWithdrawn", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_dst", + "type": "address" + } + ], + "name": "addTokenDestination", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "", + "type": "bytes4" + } + ], + "name": "authFnCalls", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_owner", + "type": "address" + }, + { + "internalType": "address", + "name": "_beneficiary", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_managedAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_startTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_endTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_periods", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_releaseStartTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_vestingCliffTime", + "type": "uint256" + }, + { + "internalType": "enum IGraphTokenLock.Revocability", + "name": "_revocable", + "type": "uint8" + } + ], + "name": "createTokenLockWallet", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "deposit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_sigHash", + "type": "bytes4" + } + ], + "name": "getAuthFunctionCallTarget", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_salt", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "_implementation", + "type": "address" + }, + { + "internalType": "address", + "name": "_deployer", + "type": "address" + } + ], + "name": "getDeploymentAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_salt", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "_implementation", + "type": "address" + } + ], + "name": "getDeploymentAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getTokenDestinations", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_sigHash", + "type": "bytes4" + } + ], + "name": "isAuthFunctionCall", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_dst", + "type": "address" + } + ], + "name": "isTokenDestination", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "l1TransferTool", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "l1WalletToL2Wallet", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "l2Gateway", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "l2WalletToL1Wallet", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "masterCopy", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_from", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "onTokenTransfer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_dst", + "type": "address" + } + ], + "name": "removeTokenDestination", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_signature", + "type": "string" + }, + { + "internalType": "address", + "name": "_target", + "type": "address" + } + ], + "name": "setAuthFunctionCall", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string[]", + "name": "_signatures", + "type": "string[]" + }, + { + "internalType": "address[]", + "name": "_targets", + "type": "address[]" + } + ], + "name": "setAuthFunctionCallMany", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_masterCopy", + "type": "address" + } + ], + "name": "setMasterCopy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "token", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_signature", + "type": "string" + } + ], + "name": "unsetAuthFunctionCall", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x898911d0d648301e5f07e9a17e2f615dc4e9fd02a233bf0a10a46ccbdb052119", + "receipt": { + "to": null, + "from": "0xadE6B8EB69a49B56929C1d4F4b428d791861dB6f", + "contractAddress": "0x63E25D0319970253B003464b4008A8238B6FC02c", + "transactionIndex": 1, + "gasUsed": "3879837", + "logsBloom": "0x00000000000000000000000000000000000004000000000000800000000000000000000000020004000000000000000000000000000000000000000000002000000000000000000000000000000000200001000000000000000000400000000000000000028000000001000000000800010000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000020000000000000000000000000000000000000000200000000000000000000000000", + "blockHash": "0x6792d699b56a62528ab4fe1f2bf96bf061087ddbc7f786a30a253b7e46bf0eee", + "transactionHash": "0x898911d0d648301e5f07e9a17e2f615dc4e9fd02a233bf0a10a46ccbdb052119", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 675027, + "transactionHash": "0x898911d0d648301e5f07e9a17e2f615dc4e9fd02a233bf0a10a46ccbdb052119", + "address": "0x63E25D0319970253B003464b4008A8238B6FC02c", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000ade6b8eb69a49b56929c1d4f4b428d791861db6f" + ], + "data": "0x", + "logIndex": 0, + "blockHash": "0x6792d699b56a62528ab4fe1f2bf96bf061087ddbc7f786a30a253b7e46bf0eee" + }, + { + "transactionIndex": 1, + "blockNumber": 675027, + "transactionHash": "0x898911d0d648301e5f07e9a17e2f615dc4e9fd02a233bf0a10a46ccbdb052119", + "address": "0x63E25D0319970253B003464b4008A8238B6FC02c", + "topics": [ + "0x30909084afc859121ffc3a5aef7fe37c540a9a1ef60bd4d8dcdb76376fadf9de", + "0x00000000000000000000000045ffa6dad9f49c5018e5345eadf6e2e5c7116f64" + ], + "data": "0x", + "logIndex": 1, + "blockHash": "0x6792d699b56a62528ab4fe1f2bf96bf061087ddbc7f786a30a253b7e46bf0eee" + } + ], + "blockNumber": 675027, + "cumulativeGasUsed": "3879837", + "status": 1, + "byzantium": true + }, + "args": [ + "0xf8c05dCF59E8B28BFD5eed176C562bEbcfc7Ac04", + "0x45FfA6DaD9F49C5018E5345eAdf6E2e5C7116F64", + "0xB24Ce0f8c18c4DdDa584A7EeC132F49C966813bb", + "0x543F8BFFb65c46091B4eEF4b1c394dFa43C4b065" + ], + "solcInputHash": "095bd30babc75057be19228ca1fd7aa4", + "metadata": "{\"compiler\":{\"version\":\"0.7.3+commit.9bfce1f6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"_graphToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_masterCopy\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_l2Gateway\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_l1TransferTool\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes4\",\"name\":\"sigHash\",\"type\":\"bytes4\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"signature\",\"type\":\"string\"}],\"name\":\"FunctionCallAuth\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"l1Address\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"l2Address\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"LockedTokensReceivedFromL1\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"masterCopy\",\"type\":\"address\"}],\"name\":\"MasterCopyUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"proxy\",\"type\":\"address\"}],\"name\":\"ProxyCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dst\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"}],\"name\":\"TokenDestinationAllowed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"contractAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"initHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"managedAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"startTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"endTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"periods\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"releaseStartTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"vestingCliffTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"enum IGraphTokenLock.Revocability\",\"name\":\"revocable\",\"type\":\"uint8\"}],\"name\":\"TokenLockCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"contractAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"initHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"managedAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"startTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"endTime\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"l1Address\",\"type\":\"address\"}],\"name\":\"TokenLockCreatedFromL1\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensWithdrawn\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_dst\",\"type\":\"address\"}],\"name\":\"addTokenDestination\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"name\":\"authFnCalls\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_beneficiary\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_managedAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_startTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_endTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_periods\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_releaseStartTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_vestingCliffTime\",\"type\":\"uint256\"},{\"internalType\":\"enum IGraphTokenLock.Revocability\",\"name\":\"_revocable\",\"type\":\"uint8\"}],\"name\":\"createTokenLockWallet\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"deposit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"_sigHash\",\"type\":\"bytes4\"}],\"name\":\"getAuthFunctionCallTarget\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_salt\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_deployer\",\"type\":\"address\"}],\"name\":\"getDeploymentAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_salt\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"}],\"name\":\"getDeploymentAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTokenDestinations\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"_sigHash\",\"type\":\"bytes4\"}],\"name\":\"isAuthFunctionCall\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_dst\",\"type\":\"address\"}],\"name\":\"isTokenDestination\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"l1TransferTool\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"l1WalletToL2Wallet\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"l2Gateway\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"l2WalletToL1Wallet\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"masterCopy\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_from\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"onTokenTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_dst\",\"type\":\"address\"}],\"name\":\"removeTokenDestination\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_signature\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"_target\",\"type\":\"address\"}],\"name\":\"setAuthFunctionCall\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string[]\",\"name\":\"_signatures\",\"type\":\"string[]\"},{\"internalType\":\"address[]\",\"name\":\"_targets\",\"type\":\"address[]\"}],\"name\":\"setAuthFunctionCallMany\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_masterCopy\",\"type\":\"address\"}],\"name\":\"setMasterCopy\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_signature\",\"type\":\"string\"}],\"name\":\"unsetAuthFunctionCall\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"events\":{\"LockedTokensReceivedFromL1(address,address,uint256)\":{\"details\":\"Emitted when locked tokens are received from L1 (whether the wallet had already been received or not)\"},\"TokenLockCreatedFromL1(address,bytes32,address,uint256,uint256,uint256,address)\":{\"details\":\"Event emitted when a wallet is received and created from L1\"}},\"kind\":\"dev\",\"methods\":{\"addTokenDestination(address)\":{\"params\":{\"_dst\":\"Destination address\"}},\"constructor\":{\"params\":{\"_graphToken\":\"Address of the L2 GRT token contract\",\"_l1TransferTool\":\"Address of the L1 transfer tool contract (in L1, without aliasing)\",\"_l2Gateway\":\"Address of the L2GraphTokenGateway contract\",\"_masterCopy\":\"Address of the master copy of the L2GraphTokenLockWallet implementation\"}},\"createTokenLockWallet(address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)\":{\"params\":{\"_beneficiary\":\"Address of the beneficiary of locked tokens\",\"_endTime\":\"End time of the release schedule\",\"_managedAmount\":\"Amount of tokens to be managed by the lock contract\",\"_owner\":\"Address of the contract owner\",\"_periods\":\"Number of periods between start time and end time\",\"_releaseStartTime\":\"Override time for when the releases start\",\"_revocable\":\"Whether the contract is revocable\",\"_startTime\":\"Start time of the release schedule\"}},\"deposit(uint256)\":{\"details\":\"Even if the ERC20 token can be transferred directly to the contract this function provide a safe interface to do the transfer and avoid mistakes\",\"params\":{\"_amount\":\"Amount to deposit\"}},\"getAuthFunctionCallTarget(bytes4)\":{\"params\":{\"_sigHash\":\"Function signature hash\"},\"returns\":{\"_0\":\"Address of the target contract where to send the call\"}},\"getDeploymentAddress(bytes32,address)\":{\"details\":\"Uses address(this) as deployer to compute the address. Only for backwards compatibility.\",\"params\":{\"_implementation\":\"Address of the proxy target implementation\",\"_salt\":\"Bytes32 salt to use for CREATE2\"},\"returns\":{\"_0\":\"Address of the counterfactual MinimalProxy\"}},\"getDeploymentAddress(bytes32,address,address)\":{\"params\":{\"_deployer\":\"Address of the deployer that creates the contract\",\"_implementation\":\"Address of the proxy target implementation\",\"_salt\":\"Bytes32 salt to use for CREATE2\"},\"returns\":{\"_0\":\"Address of the counterfactual MinimalProxy\"}},\"getTokenDestinations()\":{\"returns\":{\"_0\":\"Array of addresses authorized to pull funds from a token lock\"}},\"isAuthFunctionCall(bytes4)\":{\"params\":{\"_sigHash\":\"Function signature hash\"},\"returns\":{\"_0\":\"True if authorized\"}},\"isTokenDestination(address)\":{\"params\":{\"_dst\":\"Destination address\"},\"returns\":{\"_0\":\"True if authorized\"}},\"onTokenTransfer(address,uint256,bytes)\":{\"details\":\"This function will create a new wallet if it doesn't exist yet, or send the tokens to the existing wallet if it does.\",\"params\":{\"_amount\":\"Amount of tokens received\",\"_data\":\"Encoded data of the transferred wallet, which must be an ABI-encoded TransferredWalletData struct\",\"_from\":\"Address of the sender in L1, which must be the L1GraphTokenLockTransferTool\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"removeTokenDestination(address)\":{\"params\":{\"_dst\":\"Destination address\"}},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"setAuthFunctionCall(string,address)\":{\"details\":\"Input expected is the function signature as 'transfer(address,uint256)'\",\"params\":{\"_signature\":\"Function signature\",\"_target\":\"Address of the destination contract to call\"}},\"setAuthFunctionCallMany(string[],address[])\":{\"details\":\"Input expected is the function signature as 'transfer(address,uint256)'\",\"params\":{\"_signatures\":\"Function signatures\",\"_targets\":\"Address of the destination contract to call\"}},\"setMasterCopy(address)\":{\"params\":{\"_masterCopy\":\"Address of contract bytecode to factory clone\"}},\"token()\":{\"returns\":{\"_0\":\"Token used for transfers and approvals\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"unsetAuthFunctionCall(string)\":{\"details\":\"Input expected is the function signature as 'transfer(address,uint256)'\",\"params\":{\"_signature\":\"Function signature\"}},\"withdraw(uint256)\":{\"details\":\"Escape hatch in case of mistakes or to recover remaining funds\",\"params\":{\"_amount\":\"Amount of tokens to withdraw\"}}},\"title\":\"L2GraphTokenLockManager\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"addTokenDestination(address)\":{\"notice\":\"Adds an address that can be allowed by a token lock to pull funds\"},\"constructor\":{\"notice\":\"Constructor for the L2GraphTokenLockManager contract.\"},\"createTokenLockWallet(address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)\":{\"notice\":\"Creates and fund a new token lock wallet using a minimum proxy\"},\"deposit(uint256)\":{\"notice\":\"Deposits tokens into the contract\"},\"getAuthFunctionCallTarget(bytes4)\":{\"notice\":\"Gets the target contract to call for a particular function signature\"},\"getDeploymentAddress(bytes32,address)\":{\"notice\":\"Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation\"},\"getDeploymentAddress(bytes32,address,address)\":{\"notice\":\"Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation\"},\"getTokenDestinations()\":{\"notice\":\"Returns an array of authorized destination addresses\"},\"isAuthFunctionCall(bytes4)\":{\"notice\":\"Returns true if the function call is authorized\"},\"isTokenDestination(address)\":{\"notice\":\"Returns True if the address is authorized to be a destination of tokens\"},\"l1TransferTool()\":{\"notice\":\"Address of the L1 transfer tool contract (in L1, no aliasing)\"},\"l1WalletToL2Wallet(address)\":{\"notice\":\"Mapping of each L1 wallet to its L2 wallet counterpart (populated when each wallet is received) L1 address => L2 address\"},\"l2Gateway()\":{\"notice\":\"Address of the L2GraphTokenGateway\"},\"l2WalletToL1Wallet(address)\":{\"notice\":\"Mapping of each L2 wallet to its L1 wallet counterpart (populated when each wallet is received) L2 address => L1 address\"},\"onTokenTransfer(address,uint256,bytes)\":{\"notice\":\"This function is called by the L2GraphTokenGateway when tokens are sent from L1.\"},\"removeTokenDestination(address)\":{\"notice\":\"Removes an address that can be allowed by a token lock to pull funds\"},\"setAuthFunctionCall(string,address)\":{\"notice\":\"Sets an authorized function call to target\"},\"setAuthFunctionCallMany(string[],address[])\":{\"notice\":\"Sets an authorized function call to target in bulk\"},\"setMasterCopy(address)\":{\"notice\":\"Sets the masterCopy bytecode to use to create clones of TokenLock contracts\"},\"token()\":{\"notice\":\"Gets the GRT token address\"},\"unsetAuthFunctionCall(string)\":{\"notice\":\"Unsets an authorized function call to target\"},\"withdraw(uint256)\":{\"notice\":\"Withdraws tokens from the contract\"}},\"notice\":\"This contract manages a list of authorized function calls and targets that can be called by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts. This contract receives funds to make the process of creating TokenLockWallet contracts easier by distributing them the initial tokens to be managed. In particular, this L2 variant is designed to receive token lock wallets from L1, through the GRT bridge. These transferred wallets will not allow releasing funds in L2 until the end of the vesting timeline, but they can allow withdrawing funds back to L1 using the L2GraphTokenLockTransferTool contract. The owner can setup a list of token destinations that will be used by TokenLock contracts to approve the pulling of funds, this way in can be guaranteed that only protocol contracts will manipulate users funds.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/L2GraphTokenLockManager.sol\":\"L2GraphTokenLockManager\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor () internal {\\n address msgSender = _msgSender();\\n _owner = msgSender;\\n emit OwnershipTransferred(address(0), msgSender);\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n emit OwnershipTransferred(_owner, address(0));\\n _owner = address(0);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n emit OwnershipTransferred(_owner, newOwner);\\n _owner = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0x15e2d5bd4c28a88548074c54d220e8086f638a71ed07e6b3ba5a70066fcf458d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/math/SafeMath.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Wrappers over Solidity's arithmetic operations with added overflow\\n * checks.\\n *\\n * Arithmetic operations in Solidity wrap on overflow. This can easily result\\n * in bugs, because programmers usually assume that an overflow raises an\\n * error, which is the standard behavior in high level programming languages.\\n * `SafeMath` restores this intuition by reverting the transaction when an\\n * operation overflows.\\n *\\n * Using this library instead of the unchecked operations eliminates an entire\\n * class of bugs, so it's recommended to use it always.\\n */\\nlibrary SafeMath {\\n /**\\n * @dev Returns the addition of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n uint256 c = a + b;\\n if (c < a) return (false, 0);\\n return (true, c);\\n }\\n\\n /**\\n * @dev Returns the substraction of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b > a) return (false, 0);\\n return (true, a - b);\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\\n if (a == 0) return (true, 0);\\n uint256 c = a * b;\\n if (c / a != b) return (false, 0);\\n return (true, c);\\n }\\n\\n /**\\n * @dev Returns the division of two unsigned integers, with a division by zero flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b == 0) return (false, 0);\\n return (true, a / b);\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b == 0) return (false, 0);\\n return (true, a % b);\\n }\\n\\n /**\\n * @dev Returns the addition of two unsigned integers, reverting on\\n * overflow.\\n *\\n * Counterpart to Solidity's `+` operator.\\n *\\n * Requirements:\\n *\\n * - Addition cannot overflow.\\n */\\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\\n uint256 c = a + b;\\n require(c >= a, \\\"SafeMath: addition overflow\\\");\\n return c;\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting on\\n * overflow (when the result is negative).\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n *\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b <= a, \\\"SafeMath: subtraction overflow\\\");\\n return a - b;\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, reverting on\\n * overflow.\\n *\\n * Counterpart to Solidity's `*` operator.\\n *\\n * Requirements:\\n *\\n * - Multiplication cannot overflow.\\n */\\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\\n if (a == 0) return 0;\\n uint256 c = a * b;\\n require(c / a == b, \\\"SafeMath: multiplication overflow\\\");\\n return c;\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers, reverting on\\n * division by zero. The result is rounded towards zero.\\n *\\n * Counterpart to Solidity's `/` operator. Note: this function uses a\\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\\n * uses an invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b > 0, \\\"SafeMath: division by zero\\\");\\n return a / b;\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * reverting when dividing by zero.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b > 0, \\\"SafeMath: modulo by zero\\\");\\n return a % b;\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\\n * overflow (when the result is negative).\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {trySub}.\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n *\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b <= a, errorMessage);\\n return a - b;\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers, reverting with custom message on\\n * division by zero. The result is rounded towards zero.\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {tryDiv}.\\n *\\n * Counterpart to Solidity's `/` operator. Note: this function uses a\\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\\n * uses an invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b > 0, errorMessage);\\n return a / b;\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * reverting with custom message when dividing by zero.\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {tryMod}.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b > 0, errorMessage);\\n return a % b;\\n }\\n}\\n\",\"keccak256\":\"0xcc78a17dd88fa5a2edc60c8489e2f405c0913b377216a5b26b35656b2d0dab52\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `recipient`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address recipient, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `sender` to `recipient` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n}\\n\",\"keccak256\":\"0x5f02220344881ce43204ae4a6281145a67bc52c2bb1290a791857df3d19d78f5\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\nimport \\\"./IERC20.sol\\\";\\nimport \\\"../../math/SafeMath.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @title SafeERC20\\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\\n * contract returns false). Tokens that return no value (and instead revert or\\n * throw on failure) are also supported, non-reverting calls are assumed to be\\n * successful.\\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\n */\\nlibrary SafeERC20 {\\n using SafeMath for uint256;\\n using Address for address;\\n\\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\\n }\\n\\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\\n }\\n\\n /**\\n * @dev Deprecated. This function has issues similar to the ones found in\\n * {IERC20-approve}, and its usage is discouraged.\\n *\\n * Whenever possible, use {safeIncreaseAllowance} and\\n * {safeDecreaseAllowance} instead.\\n */\\n function safeApprove(IERC20 token, address spender, uint256 value) internal {\\n // safeApprove should only be called when setting an initial allowance,\\n // or when resetting it to zero. To increase and decrease it, use\\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\\n // solhint-disable-next-line max-line-length\\n require((value == 0) || (token.allowance(address(this), spender) == 0),\\n \\\"SafeERC20: approve from non-zero to non-zero allowance\\\"\\n );\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\\n }\\n\\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n uint256 newAllowance = token.allowance(address(this), spender).add(value);\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n uint256 newAllowance = token.allowance(address(this), spender).sub(value, \\\"SafeERC20: decreased allowance below zero\\\");\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n */\\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that\\n // the target address contains contract code and also asserts for success in the low-level call.\\n\\n bytes memory returndata = address(token).functionCall(data, \\\"SafeERC20: low-level call failed\\\");\\n if (returndata.length > 0) { // Return data is optional\\n // solhint-disable-next-line max-line-length\\n require(abi.decode(returndata, (bool)), \\\"SafeERC20: ERC20 operation did not succeed\\\");\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf12dfbe97e6276980b83d2830bb0eb75e0cf4f3e626c2471137f82158ae6a0fc\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.2 <0.8.0;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize, which returns 0 for contracts in\\n // construction, since the code is only stored at the end of the\\n // constructor execution.\\n\\n uint256 size;\\n // solhint-disable-next-line no-inline-assembly\\n assembly { size := extcodesize(account) }\\n return size > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls, avoid-call-value\\n (bool success, ) = recipient.call{ value: amount }(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain`call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.call{ value: value }(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x28911e614500ae7c607a432a709d35da25f3bc5ddc8bd12b278b66358070c0ea\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/*\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with GSN meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address payable) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes memory) {\\n this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0x8d3cb350f04ff49cfb10aef08d87f19dcbaecc8027b0bed12f3275cd12f38cf0\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Create2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Helper to make usage of the `CREATE2` EVM opcode easier and safer.\\n * `CREATE2` can be used to compute in advance the address where a smart\\n * contract will be deployed, which allows for interesting new mechanisms known\\n * as 'counterfactual interactions'.\\n *\\n * See the https://eips.ethereum.org/EIPS/eip-1014#motivation[EIP] for more\\n * information.\\n */\\nlibrary Create2 {\\n /**\\n * @dev Deploys a contract using `CREATE2`. The address where the contract\\n * will be deployed can be known in advance via {computeAddress}.\\n *\\n * The bytecode for a contract can be obtained from Solidity with\\n * `type(contractName).creationCode`.\\n *\\n * Requirements:\\n *\\n * - `bytecode` must not be empty.\\n * - `salt` must have not been used for `bytecode` already.\\n * - the factory must have a balance of at least `amount`.\\n * - if `amount` is non-zero, `bytecode` must have a `payable` constructor.\\n */\\n function deploy(uint256 amount, bytes32 salt, bytes memory bytecode) internal returns (address) {\\n address addr;\\n require(address(this).balance >= amount, \\\"Create2: insufficient balance\\\");\\n require(bytecode.length != 0, \\\"Create2: bytecode length is zero\\\");\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n addr := create2(amount, add(bytecode, 0x20), mload(bytecode), salt)\\n }\\n require(addr != address(0), \\\"Create2: Failed on deploy\\\");\\n return addr;\\n }\\n\\n /**\\n * @dev Returns the address where a contract will be stored if deployed via {deploy}. Any change in the\\n * `bytecodeHash` or `salt` will result in a new destination address.\\n */\\n function computeAddress(bytes32 salt, bytes32 bytecodeHash) internal view returns (address) {\\n return computeAddress(salt, bytecodeHash, address(this));\\n }\\n\\n /**\\n * @dev Returns the address where a contract will be stored if deployed via {deploy} from a contract located at\\n * `deployer`. If `deployer` is this contract's address, returns the same value as {computeAddress}.\\n */\\n function computeAddress(bytes32 salt, bytes32 bytecodeHash, address deployer) internal pure returns (address) {\\n bytes32 _data = keccak256(\\n abi.encodePacked(bytes1(0xff), deployer, salt, bytecodeHash)\\n );\\n return address(uint160(uint256(_data)));\\n }\\n}\\n\",\"keccak256\":\"0x0a0b021149946014fe1cd04af11e7a937a29986c47e8b1b718c2d50d729472db\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/EnumerableSet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Library for managing\\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\\n * types.\\n *\\n * Sets have the following properties:\\n *\\n * - Elements are added, removed, and checked for existence in constant time\\n * (O(1)).\\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\\n *\\n * ```\\n * contract Example {\\n * // Add the library methods\\n * using EnumerableSet for EnumerableSet.AddressSet;\\n *\\n * // Declare a set state variable\\n * EnumerableSet.AddressSet private mySet;\\n * }\\n * ```\\n *\\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\\n * and `uint256` (`UintSet`) are supported.\\n */\\nlibrary EnumerableSet {\\n // To implement this library for multiple types with as little code\\n // repetition as possible, we write it in terms of a generic Set type with\\n // bytes32 values.\\n // The Set implementation uses private functions, and user-facing\\n // implementations (such as AddressSet) are just wrappers around the\\n // underlying Set.\\n // This means that we can only create new EnumerableSets for types that fit\\n // in bytes32.\\n\\n struct Set {\\n // Storage of set values\\n bytes32[] _values;\\n\\n // Position of the value in the `values` array, plus 1 because index 0\\n // means a value is not in the set.\\n mapping (bytes32 => uint256) _indexes;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function _add(Set storage set, bytes32 value) private returns (bool) {\\n if (!_contains(set, value)) {\\n set._values.push(value);\\n // The value is stored at length-1, but we add 1 to all indexes\\n // and use 0 as a sentinel value\\n set._indexes[value] = set._values.length;\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function _remove(Set storage set, bytes32 value) private returns (bool) {\\n // We read and store the value's index to prevent multiple reads from the same storage slot\\n uint256 valueIndex = set._indexes[value];\\n\\n if (valueIndex != 0) { // Equivalent to contains(set, value)\\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\\n // the array, and then remove the last element (sometimes called as 'swap and pop').\\n // This modifies the order of the array, as noted in {at}.\\n\\n uint256 toDeleteIndex = valueIndex - 1;\\n uint256 lastIndex = set._values.length - 1;\\n\\n // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs\\n // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.\\n\\n bytes32 lastvalue = set._values[lastIndex];\\n\\n // Move the last value to the index where the value to delete is\\n set._values[toDeleteIndex] = lastvalue;\\n // Update the index for the moved value\\n set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based\\n\\n // Delete the slot where the moved value was stored\\n set._values.pop();\\n\\n // Delete the index for the deleted slot\\n delete set._indexes[value];\\n\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\\n return set._indexes[value] != 0;\\n }\\n\\n /**\\n * @dev Returns the number of values on the set. O(1).\\n */\\n function _length(Set storage set) private view returns (uint256) {\\n return set._values.length;\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\\n require(set._values.length > index, \\\"EnumerableSet: index out of bounds\\\");\\n return set._values[index];\\n }\\n\\n // Bytes32Set\\n\\n struct Bytes32Set {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _add(set._inner, value);\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _remove(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\\n return _contains(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(Bytes32Set storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\\n return _at(set._inner, index);\\n }\\n\\n // AddressSet\\n\\n struct AddressSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(AddressSet storage set, address value) internal returns (bool) {\\n return _add(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(AddressSet storage set, address value) internal returns (bool) {\\n return _remove(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(AddressSet storage set, address value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(AddressSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\\n return address(uint160(uint256(_at(set._inner, index))));\\n }\\n\\n\\n // UintSet\\n\\n struct UintSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(UintSet storage set, uint256 value) internal returns (bool) {\\n return _add(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\\n return _remove(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns the number of values on the set. O(1).\\n */\\n function length(UintSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\\n return uint256(_at(set._inner, index));\\n }\\n}\\n\",\"keccak256\":\"0x1562cd9922fbf739edfb979f506809e2743789cbde3177515542161c3d04b164\",\"license\":\"MIT\"},\"contracts/GraphTokenLock.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nimport \\\"@openzeppelin/contracts/math/SafeMath.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\\\";\\n\\nimport { Ownable as OwnableInitializable } from \\\"./Ownable.sol\\\";\\nimport \\\"./MathUtils.sol\\\";\\nimport \\\"./IGraphTokenLock.sol\\\";\\n\\n/**\\n * @title GraphTokenLock\\n * @notice Contract that manages an unlocking schedule of tokens.\\n * @dev The contract lock manage a number of tokens deposited into the contract to ensure that\\n * they can only be released under certain time conditions.\\n *\\n * This contract implements a release scheduled based on periods and tokens are released in steps\\n * after each period ends. It can be configured with one period in which case it is like a plain TimeLock.\\n * It also supports revocation to be used for vesting schedules.\\n *\\n * The contract supports receiving extra funds than the managed tokens ones that can be\\n * withdrawn by the beneficiary at any time.\\n *\\n * A releaseStartTime parameter is included to override the default release schedule and\\n * perform the first release on the configured time. After that it will continue with the\\n * default schedule.\\n */\\nabstract contract GraphTokenLock is OwnableInitializable, IGraphTokenLock {\\n using SafeMath for uint256;\\n using SafeERC20 for IERC20;\\n\\n uint256 private constant MIN_PERIOD = 1;\\n\\n // -- State --\\n\\n IERC20 public token;\\n address public beneficiary;\\n\\n // Configuration\\n\\n // Amount of tokens managed by the contract schedule\\n uint256 public managedAmount;\\n\\n uint256 public startTime; // Start datetime (in unixtimestamp)\\n uint256 public endTime; // Datetime after all funds are fully vested/unlocked (in unixtimestamp)\\n uint256 public periods; // Number of vesting/release periods\\n\\n // First release date for tokens (in unixtimestamp)\\n // If set, no tokens will be released before releaseStartTime ignoring\\n // the amount to release each period\\n uint256 public releaseStartTime;\\n // A cliff set a date to which a beneficiary needs to get to vest\\n // all preceding periods\\n uint256 public vestingCliffTime;\\n Revocability public revocable; // Whether to use vesting for locked funds\\n\\n // State\\n\\n bool public isRevoked;\\n bool public isInitialized;\\n bool public isAccepted;\\n uint256 public releasedAmount;\\n uint256 public revokedAmount;\\n\\n // -- Events --\\n\\n event TokensReleased(address indexed beneficiary, uint256 amount);\\n event TokensWithdrawn(address indexed beneficiary, uint256 amount);\\n event TokensRevoked(address indexed beneficiary, uint256 amount);\\n event BeneficiaryChanged(address newBeneficiary);\\n event LockAccepted();\\n event LockCanceled();\\n\\n /**\\n * @dev Only allow calls from the beneficiary of the contract\\n */\\n modifier onlyBeneficiary() {\\n require(msg.sender == beneficiary, \\\"!auth\\\");\\n _;\\n }\\n\\n /**\\n * @notice Initializes the contract\\n * @param _owner Address of the contract owner\\n * @param _beneficiary Address of the beneficiary of locked tokens\\n * @param _managedAmount Amount of tokens to be managed by the lock contract\\n * @param _startTime Start time of the release schedule\\n * @param _endTime End time of the release schedule\\n * @param _periods Number of periods between start time and end time\\n * @param _releaseStartTime Override time for when the releases start\\n * @param _vestingCliffTime Override time for when the vesting start\\n * @param _revocable Whether the contract is revocable\\n */\\n function _initialize(\\n address _owner,\\n address _beneficiary,\\n address _token,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n Revocability _revocable\\n ) internal {\\n require(!isInitialized, \\\"Already initialized\\\");\\n require(_owner != address(0), \\\"Owner cannot be zero\\\");\\n require(_beneficiary != address(0), \\\"Beneficiary cannot be zero\\\");\\n require(_token != address(0), \\\"Token cannot be zero\\\");\\n require(_managedAmount > 0, \\\"Managed tokens cannot be zero\\\");\\n require(_startTime != 0, \\\"Start time must be set\\\");\\n require(_startTime < _endTime, \\\"Start time > end time\\\");\\n require(_periods >= MIN_PERIOD, \\\"Periods cannot be below minimum\\\");\\n require(_revocable != Revocability.NotSet, \\\"Must set a revocability option\\\");\\n require(_releaseStartTime < _endTime, \\\"Release start time must be before end time\\\");\\n require(_vestingCliffTime < _endTime, \\\"Cliff time must be before end time\\\");\\n\\n isInitialized = true;\\n\\n OwnableInitializable._initialize(_owner);\\n beneficiary = _beneficiary;\\n token = IERC20(_token);\\n\\n managedAmount = _managedAmount;\\n\\n startTime = _startTime;\\n endTime = _endTime;\\n periods = _periods;\\n\\n // Optionals\\n releaseStartTime = _releaseStartTime;\\n vestingCliffTime = _vestingCliffTime;\\n revocable = _revocable;\\n }\\n\\n /**\\n * @notice Change the beneficiary of funds managed by the contract\\n * @dev Can only be called by the beneficiary\\n * @param _newBeneficiary Address of the new beneficiary address\\n */\\n function changeBeneficiary(address _newBeneficiary) external onlyBeneficiary {\\n require(_newBeneficiary != address(0), \\\"Empty beneficiary\\\");\\n beneficiary = _newBeneficiary;\\n emit BeneficiaryChanged(_newBeneficiary);\\n }\\n\\n /**\\n * @notice Beneficiary accepts the lock, the owner cannot retrieve back the tokens\\n * @dev Can only be called by the beneficiary\\n */\\n function acceptLock() external onlyBeneficiary {\\n isAccepted = true;\\n emit LockAccepted();\\n }\\n\\n /**\\n * @notice Owner cancel the lock and return the balance in the contract\\n * @dev Can only be called by the owner\\n */\\n function cancelLock() external onlyOwner {\\n require(isAccepted == false, \\\"Cannot cancel accepted contract\\\");\\n\\n token.safeTransfer(owner(), currentBalance());\\n\\n emit LockCanceled();\\n }\\n\\n // -- Balances --\\n\\n /**\\n * @notice Returns the amount of tokens currently held by the contract\\n * @return Tokens held in the contract\\n */\\n function currentBalance() public view override returns (uint256) {\\n return token.balanceOf(address(this));\\n }\\n\\n // -- Time & Periods --\\n\\n /**\\n * @notice Returns the current block timestamp\\n * @return Current block timestamp\\n */\\n function currentTime() public view override returns (uint256) {\\n return block.timestamp;\\n }\\n\\n /**\\n * @notice Gets duration of contract from start to end in seconds\\n * @return Amount of seconds from contract startTime to endTime\\n */\\n function duration() public view override returns (uint256) {\\n return endTime.sub(startTime);\\n }\\n\\n /**\\n * @notice Gets time elapsed since the start of the contract\\n * @dev Returns zero if called before conctract starTime\\n * @return Seconds elapsed from contract startTime\\n */\\n function sinceStartTime() public view override returns (uint256) {\\n uint256 current = currentTime();\\n if (current <= startTime) {\\n return 0;\\n }\\n return current.sub(startTime);\\n }\\n\\n /**\\n * @notice Returns amount available to be released after each period according to schedule\\n * @return Amount of tokens available after each period\\n */\\n function amountPerPeriod() public view override returns (uint256) {\\n return managedAmount.div(periods);\\n }\\n\\n /**\\n * @notice Returns the duration of each period in seconds\\n * @return Duration of each period in seconds\\n */\\n function periodDuration() public view override returns (uint256) {\\n return duration().div(periods);\\n }\\n\\n /**\\n * @notice Gets the current period based on the schedule\\n * @return A number that represents the current period\\n */\\n function currentPeriod() public view override returns (uint256) {\\n return sinceStartTime().div(periodDuration()).add(MIN_PERIOD);\\n }\\n\\n /**\\n * @notice Gets the number of periods that passed since the first period\\n * @return A number of periods that passed since the schedule started\\n */\\n function passedPeriods() public view override returns (uint256) {\\n return currentPeriod().sub(MIN_PERIOD);\\n }\\n\\n // -- Locking & Release Schedule --\\n\\n /**\\n * @notice Gets the currently available token according to the schedule\\n * @dev Implements the step-by-step schedule based on periods for available tokens\\n * @return Amount of tokens available according to the schedule\\n */\\n function availableAmount() public view override returns (uint256) {\\n uint256 current = currentTime();\\n\\n // Before contract start no funds are available\\n if (current < startTime) {\\n return 0;\\n }\\n\\n // After contract ended all funds are available\\n if (current > endTime) {\\n return managedAmount;\\n }\\n\\n // Get available amount based on period\\n return passedPeriods().mul(amountPerPeriod());\\n }\\n\\n /**\\n * @notice Gets the amount of currently vested tokens\\n * @dev Similar to available amount, but is fully vested when contract is non-revocable\\n * @return Amount of tokens already vested\\n */\\n function vestedAmount() public view override returns (uint256) {\\n // If non-revocable it is fully vested\\n if (revocable == Revocability.Disabled) {\\n return managedAmount;\\n }\\n\\n // Vesting cliff is activated and it has not passed means nothing is vested yet\\n if (vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\\n return 0;\\n }\\n\\n return availableAmount();\\n }\\n\\n /**\\n * @notice Gets tokens currently available for release\\n * @dev Considers the schedule and takes into account already released tokens\\n * @return Amount of tokens ready to be released\\n */\\n function releasableAmount() public view virtual override returns (uint256) {\\n // If a release start time is set no tokens are available for release before this date\\n // If not set it follows the default schedule and tokens are available on\\n // the first period passed\\n if (releaseStartTime > 0 && currentTime() < releaseStartTime) {\\n return 0;\\n }\\n\\n // Vesting cliff is activated and it has not passed means nothing is vested yet\\n // so funds cannot be released\\n if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\\n return 0;\\n }\\n\\n // A beneficiary can never have more releasable tokens than the contract balance\\n uint256 releasable = availableAmount().sub(releasedAmount);\\n return MathUtils.min(currentBalance(), releasable);\\n }\\n\\n /**\\n * @notice Gets the outstanding amount yet to be released based on the whole contract lifetime\\n * @dev Does not consider schedule but just global amounts tracked\\n * @return Amount of outstanding tokens for the lifetime of the contract\\n */\\n function totalOutstandingAmount() public view override returns (uint256) {\\n return managedAmount.sub(releasedAmount).sub(revokedAmount);\\n }\\n\\n /**\\n * @notice Gets surplus amount in the contract based on outstanding amount to release\\n * @dev All funds over outstanding amount is considered surplus that can be withdrawn by beneficiary.\\n * Note this might not be the correct value for wallets transferred to L2 (i.e. an L2GraphTokenLockWallet), as the released amount will be\\n * skewed, so the beneficiary might have to bridge back to L1 to release the surplus.\\n * @return Amount of tokens considered as surplus\\n */\\n function surplusAmount() public view override returns (uint256) {\\n uint256 balance = currentBalance();\\n uint256 outstandingAmount = totalOutstandingAmount();\\n if (balance > outstandingAmount) {\\n return balance.sub(outstandingAmount);\\n }\\n return 0;\\n }\\n\\n // -- Value Transfer --\\n\\n /**\\n * @notice Releases tokens based on the configured schedule\\n * @dev All available releasable tokens are transferred to beneficiary\\n */\\n function release() external override onlyBeneficiary {\\n uint256 amountToRelease = releasableAmount();\\n require(amountToRelease > 0, \\\"No available releasable amount\\\");\\n\\n releasedAmount = releasedAmount.add(amountToRelease);\\n\\n token.safeTransfer(beneficiary, amountToRelease);\\n\\n emit TokensReleased(beneficiary, amountToRelease);\\n }\\n\\n /**\\n * @notice Withdraws surplus, unmanaged tokens from the contract\\n * @dev Tokens in the contract over outstanding amount are considered as surplus\\n * @param _amount Amount of tokens to withdraw\\n */\\n function withdrawSurplus(uint256 _amount) external override onlyBeneficiary {\\n require(_amount > 0, \\\"Amount cannot be zero\\\");\\n require(surplusAmount() >= _amount, \\\"Amount requested > surplus available\\\");\\n\\n token.safeTransfer(beneficiary, _amount);\\n\\n emit TokensWithdrawn(beneficiary, _amount);\\n }\\n\\n /**\\n * @notice Revokes a vesting schedule and return the unvested tokens to the owner\\n * @dev Vesting schedule is always calculated based on managed tokens\\n */\\n function revoke() external override onlyOwner {\\n require(revocable == Revocability.Enabled, \\\"Contract is non-revocable\\\");\\n require(isRevoked == false, \\\"Already revoked\\\");\\n\\n uint256 unvestedAmount = managedAmount.sub(vestedAmount());\\n require(unvestedAmount > 0, \\\"No available unvested amount\\\");\\n\\n revokedAmount = unvestedAmount;\\n isRevoked = true;\\n\\n token.safeTransfer(owner(), unvestedAmount);\\n\\n emit TokensRevoked(beneficiary, unvestedAmount);\\n }\\n}\\n\",\"keccak256\":\"0xd89470956a476c2fcf4a09625775573f95ba2c60a57fe866d90f65de1bcf5f2d\",\"license\":\"MIT\"},\"contracts/GraphTokenLockManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/EnumerableSet.sol\\\";\\nimport { Ownable } from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\n\\nimport \\\"./MinimalProxyFactory.sol\\\";\\nimport \\\"./IGraphTokenLockManager.sol\\\";\\nimport { GraphTokenLockWallet } from \\\"./GraphTokenLockWallet.sol\\\";\\n\\n/**\\n * @title GraphTokenLockManager\\n * @notice This contract manages a list of authorized function calls and targets that can be called\\n * by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts.\\n *\\n * This contract receives funds to make the process of creating TokenLockWallet contracts\\n * easier by distributing them the initial tokens to be managed.\\n *\\n * The owner can setup a list of token destinations that will be used by TokenLock contracts to\\n * approve the pulling of funds, this way in can be guaranteed that only protocol contracts\\n * will manipulate users funds.\\n */\\ncontract GraphTokenLockManager is Ownable, MinimalProxyFactory, IGraphTokenLockManager {\\n using SafeERC20 for IERC20;\\n using EnumerableSet for EnumerableSet.AddressSet;\\n\\n // -- State --\\n\\n mapping(bytes4 => address) public authFnCalls;\\n EnumerableSet.AddressSet private _tokenDestinations;\\n\\n address public masterCopy;\\n IERC20 internal _token;\\n\\n // -- Events --\\n\\n event MasterCopyUpdated(address indexed masterCopy);\\n event TokenLockCreated(\\n address indexed contractAddress,\\n bytes32 indexed initHash,\\n address indexed beneficiary,\\n address token,\\n uint256 managedAmount,\\n uint256 startTime,\\n uint256 endTime,\\n uint256 periods,\\n uint256 releaseStartTime,\\n uint256 vestingCliffTime,\\n IGraphTokenLock.Revocability revocable\\n );\\n\\n event TokensDeposited(address indexed sender, uint256 amount);\\n event TokensWithdrawn(address indexed sender, uint256 amount);\\n\\n event FunctionCallAuth(address indexed caller, bytes4 indexed sigHash, address indexed target, string signature);\\n event TokenDestinationAllowed(address indexed dst, bool allowed);\\n\\n /**\\n * Constructor.\\n * @param _graphToken Token to use for deposits and withdrawals\\n * @param _masterCopy Address of the master copy to use to clone proxies\\n */\\n constructor(IERC20 _graphToken, address _masterCopy) {\\n require(address(_graphToken) != address(0), \\\"Token cannot be zero\\\");\\n _token = _graphToken;\\n setMasterCopy(_masterCopy);\\n }\\n\\n // -- Factory --\\n\\n /**\\n * @notice Sets the masterCopy bytecode to use to create clones of TokenLock contracts\\n * @param _masterCopy Address of contract bytecode to factory clone\\n */\\n function setMasterCopy(address _masterCopy) public override onlyOwner {\\n require(_masterCopy != address(0), \\\"MasterCopy cannot be zero\\\");\\n masterCopy = _masterCopy;\\n emit MasterCopyUpdated(_masterCopy);\\n }\\n\\n /**\\n * @notice Creates and fund a new token lock wallet using a minimum proxy\\n * @param _owner Address of the contract owner\\n * @param _beneficiary Address of the beneficiary of locked tokens\\n * @param _managedAmount Amount of tokens to be managed by the lock contract\\n * @param _startTime Start time of the release schedule\\n * @param _endTime End time of the release schedule\\n * @param _periods Number of periods between start time and end time\\n * @param _releaseStartTime Override time for when the releases start\\n * @param _revocable Whether the contract is revocable\\n */\\n function createTokenLockWallet(\\n address _owner,\\n address _beneficiary,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n IGraphTokenLock.Revocability _revocable\\n ) external override onlyOwner {\\n require(_token.balanceOf(address(this)) >= _managedAmount, \\\"Not enough tokens to create lock\\\");\\n\\n // Create contract using a minimal proxy and call initializer\\n bytes memory initializer = abi.encodeWithSelector(\\n GraphTokenLockWallet.initialize.selector,\\n address(this),\\n _owner,\\n _beneficiary,\\n address(_token),\\n _managedAmount,\\n _startTime,\\n _endTime,\\n _periods,\\n _releaseStartTime,\\n _vestingCliffTime,\\n _revocable\\n );\\n address contractAddress = _deployProxy2(keccak256(initializer), masterCopy, initializer);\\n\\n // Send managed amount to the created contract\\n _token.safeTransfer(contractAddress, _managedAmount);\\n\\n emit TokenLockCreated(\\n contractAddress,\\n keccak256(initializer),\\n _beneficiary,\\n address(_token),\\n _managedAmount,\\n _startTime,\\n _endTime,\\n _periods,\\n _releaseStartTime,\\n _vestingCliffTime,\\n _revocable\\n );\\n }\\n\\n // -- Funds Management --\\n\\n /**\\n * @notice Gets the GRT token address\\n * @return Token used for transfers and approvals\\n */\\n function token() external view override returns (IERC20) {\\n return _token;\\n }\\n\\n /**\\n * @notice Deposits tokens into the contract\\n * @dev Even if the ERC20 token can be transferred directly to the contract\\n * this function provide a safe interface to do the transfer and avoid mistakes\\n * @param _amount Amount to deposit\\n */\\n function deposit(uint256 _amount) external override {\\n require(_amount > 0, \\\"Amount cannot be zero\\\");\\n _token.safeTransferFrom(msg.sender, address(this), _amount);\\n emit TokensDeposited(msg.sender, _amount);\\n }\\n\\n /**\\n * @notice Withdraws tokens from the contract\\n * @dev Escape hatch in case of mistakes or to recover remaining funds\\n * @param _amount Amount of tokens to withdraw\\n */\\n function withdraw(uint256 _amount) external override onlyOwner {\\n require(_amount > 0, \\\"Amount cannot be zero\\\");\\n _token.safeTransfer(msg.sender, _amount);\\n emit TokensWithdrawn(msg.sender, _amount);\\n }\\n\\n // -- Token Destinations --\\n\\n /**\\n * @notice Adds an address that can be allowed by a token lock to pull funds\\n * @param _dst Destination address\\n */\\n function addTokenDestination(address _dst) external override onlyOwner {\\n require(_dst != address(0), \\\"Destination cannot be zero\\\");\\n require(_tokenDestinations.add(_dst), \\\"Destination already added\\\");\\n emit TokenDestinationAllowed(_dst, true);\\n }\\n\\n /**\\n * @notice Removes an address that can be allowed by a token lock to pull funds\\n * @param _dst Destination address\\n */\\n function removeTokenDestination(address _dst) external override onlyOwner {\\n require(_tokenDestinations.remove(_dst), \\\"Destination already removed\\\");\\n emit TokenDestinationAllowed(_dst, false);\\n }\\n\\n /**\\n * @notice Returns True if the address is authorized to be a destination of tokens\\n * @param _dst Destination address\\n * @return True if authorized\\n */\\n function isTokenDestination(address _dst) external view override returns (bool) {\\n return _tokenDestinations.contains(_dst);\\n }\\n\\n /**\\n * @notice Returns an array of authorized destination addresses\\n * @return Array of addresses authorized to pull funds from a token lock\\n */\\n function getTokenDestinations() external view override returns (address[] memory) {\\n address[] memory dstList = new address[](_tokenDestinations.length());\\n for (uint256 i = 0; i < _tokenDestinations.length(); i++) {\\n dstList[i] = _tokenDestinations.at(i);\\n }\\n return dstList;\\n }\\n\\n // -- Function Call Authorization --\\n\\n /**\\n * @notice Sets an authorized function call to target\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @param _signature Function signature\\n * @param _target Address of the destination contract to call\\n */\\n function setAuthFunctionCall(string calldata _signature, address _target) external override onlyOwner {\\n _setAuthFunctionCall(_signature, _target);\\n }\\n\\n /**\\n * @notice Unsets an authorized function call to target\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @param _signature Function signature\\n */\\n function unsetAuthFunctionCall(string calldata _signature) external override onlyOwner {\\n bytes4 sigHash = _toFunctionSigHash(_signature);\\n authFnCalls[sigHash] = address(0);\\n\\n emit FunctionCallAuth(msg.sender, sigHash, address(0), _signature);\\n }\\n\\n /**\\n * @notice Sets an authorized function call to target in bulk\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @param _signatures Function signatures\\n * @param _targets Address of the destination contract to call\\n */\\n function setAuthFunctionCallMany(\\n string[] calldata _signatures,\\n address[] calldata _targets\\n ) external override onlyOwner {\\n require(_signatures.length == _targets.length, \\\"Array length mismatch\\\");\\n\\n for (uint256 i = 0; i < _signatures.length; i++) {\\n _setAuthFunctionCall(_signatures[i], _targets[i]);\\n }\\n }\\n\\n /**\\n * @notice Sets an authorized function call to target\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @dev Function signatures of Graph Protocol contracts to be used are known ahead of time\\n * @param _signature Function signature\\n * @param _target Address of the destination contract to call\\n */\\n function _setAuthFunctionCall(string calldata _signature, address _target) internal {\\n require(_target != address(this), \\\"Target must be other contract\\\");\\n require(Address.isContract(_target), \\\"Target must be a contract\\\");\\n\\n bytes4 sigHash = _toFunctionSigHash(_signature);\\n authFnCalls[sigHash] = _target;\\n\\n emit FunctionCallAuth(msg.sender, sigHash, _target, _signature);\\n }\\n\\n /**\\n * @notice Gets the target contract to call for a particular function signature\\n * @param _sigHash Function signature hash\\n * @return Address of the target contract where to send the call\\n */\\n function getAuthFunctionCallTarget(bytes4 _sigHash) public view override returns (address) {\\n return authFnCalls[_sigHash];\\n }\\n\\n /**\\n * @notice Returns true if the function call is authorized\\n * @param _sigHash Function signature hash\\n * @return True if authorized\\n */\\n function isAuthFunctionCall(bytes4 _sigHash) external view override returns (bool) {\\n return getAuthFunctionCallTarget(_sigHash) != address(0);\\n }\\n\\n /**\\n * @dev Converts a function signature string to 4-bytes hash\\n * @param _signature Function signature string\\n * @return Function signature hash\\n */\\n function _toFunctionSigHash(string calldata _signature) internal pure returns (bytes4) {\\n return _convertToBytes4(abi.encodeWithSignature(_signature));\\n }\\n\\n /**\\n * @dev Converts function signature bytes to function signature hash (bytes4)\\n * @param _signature Function signature\\n * @return Function signature in bytes4\\n */\\n function _convertToBytes4(bytes memory _signature) internal pure returns (bytes4) {\\n require(_signature.length == 4, \\\"Invalid method signature\\\");\\n bytes4 sigHash;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n sigHash := mload(add(_signature, 32))\\n }\\n return sigHash;\\n }\\n}\\n\",\"keccak256\":\"0x2bb51cc1a18bd88113fd6947067ad2fff33048c8904cb54adfda8e2ab86752f2\",\"license\":\"MIT\"},\"contracts/GraphTokenLockWallet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"@openzeppelin/contracts/math/SafeMath.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nimport \\\"./GraphTokenLock.sol\\\";\\nimport \\\"./IGraphTokenLockManager.sol\\\";\\n\\n/**\\n * @title GraphTokenLockWallet\\n * @notice This contract is built on top of the base GraphTokenLock functionality.\\n * It allows wallet beneficiaries to use the deposited funds to perform specific function calls\\n * on specific contracts.\\n *\\n * The idea is that supporters with locked tokens can participate in the protocol\\n * but disallow any release before the vesting/lock schedule.\\n * The beneficiary can issue authorized function calls to this contract that will\\n * get forwarded to a target contract. A target contract is any of our protocol contracts.\\n * The function calls allowed are queried to the GraphTokenLockManager, this way\\n * the same configuration can be shared for all the created lock wallet contracts.\\n *\\n * NOTE: Contracts used as target must have its function signatures checked to avoid collisions\\n * with any of this contract functions.\\n * Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience\\n * the maximum amount of tokens is authorized.\\n * Function calls do not forward ETH value so DO NOT SEND ETH TO THIS CONTRACT.\\n */\\ncontract GraphTokenLockWallet is GraphTokenLock {\\n using SafeMath for uint256;\\n\\n // -- State --\\n\\n IGraphTokenLockManager public manager;\\n uint256 public usedAmount;\\n\\n // -- Events --\\n\\n event ManagerUpdated(address indexed _oldManager, address indexed _newManager);\\n event TokenDestinationsApproved();\\n event TokenDestinationsRevoked();\\n\\n // Initializer\\n function initialize(\\n address _manager,\\n address _owner,\\n address _beneficiary,\\n address _token,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n Revocability _revocable\\n ) external {\\n _initialize(\\n _owner,\\n _beneficiary,\\n _token,\\n _managedAmount,\\n _startTime,\\n _endTime,\\n _periods,\\n _releaseStartTime,\\n _vestingCliffTime,\\n _revocable\\n );\\n _setManager(_manager);\\n }\\n\\n // -- Admin --\\n\\n /**\\n * @notice Sets a new manager for this contract\\n * @param _newManager Address of the new manager\\n */\\n function setManager(address _newManager) external onlyOwner {\\n _setManager(_newManager);\\n }\\n\\n /**\\n * @dev Sets a new manager for this contract\\n * @param _newManager Address of the new manager\\n */\\n function _setManager(address _newManager) internal {\\n require(_newManager != address(0), \\\"Manager cannot be empty\\\");\\n require(Address.isContract(_newManager), \\\"Manager must be a contract\\\");\\n\\n address oldManager = address(manager);\\n manager = IGraphTokenLockManager(_newManager);\\n\\n emit ManagerUpdated(oldManager, _newManager);\\n }\\n\\n // -- Beneficiary --\\n\\n /**\\n * @notice Approves protocol access of the tokens managed by this contract\\n * @dev Approves all token destinations registered in the manager to pull tokens\\n */\\n function approveProtocol() external onlyBeneficiary {\\n address[] memory dstList = manager.getTokenDestinations();\\n for (uint256 i = 0; i < dstList.length; i++) {\\n // Note this is only safe because we are using the max uint256 value\\n token.approve(dstList[i], type(uint256).max);\\n }\\n emit TokenDestinationsApproved();\\n }\\n\\n /**\\n * @notice Revokes protocol access of the tokens managed by this contract\\n * @dev Revokes approval to all token destinations in the manager to pull tokens\\n */\\n function revokeProtocol() external onlyBeneficiary {\\n address[] memory dstList = manager.getTokenDestinations();\\n for (uint256 i = 0; i < dstList.length; i++) {\\n // Note this is only safe cause we're using 0 as the amount\\n token.approve(dstList[i], 0);\\n }\\n emit TokenDestinationsRevoked();\\n }\\n\\n /**\\n * @notice Gets tokens currently available for release\\n * @dev Considers the schedule, takes into account already released tokens and used amount\\n * @return Amount of tokens ready to be released\\n */\\n function releasableAmount() public view override returns (uint256) {\\n if (revocable == Revocability.Disabled) {\\n return super.releasableAmount();\\n }\\n\\n // -- Revocability enabled logic\\n // This needs to deal with additional considerations for when tokens are used in the protocol\\n\\n // If a release start time is set no tokens are available for release before this date\\n // If not set it follows the default schedule and tokens are available on\\n // the first period passed\\n if (releaseStartTime > 0 && currentTime() < releaseStartTime) {\\n return 0;\\n }\\n\\n // Vesting cliff is activated and it has not passed means nothing is vested yet\\n // so funds cannot be released\\n if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\\n return 0;\\n }\\n\\n // A beneficiary can never have more releasable tokens than the contract balance\\n // We consider the `usedAmount` in the protocol as part of the calculations\\n // the beneficiary should not release funds that are used.\\n uint256 releasable = availableAmount().sub(releasedAmount).sub(usedAmount);\\n return MathUtils.min(currentBalance(), releasable);\\n }\\n\\n /**\\n * @notice Forward authorized contract calls to protocol contracts\\n * @dev Fallback function can be called by the beneficiary only if function call is allowed\\n */\\n // solhint-disable-next-line no-complex-fallback\\n fallback() external payable {\\n // Only beneficiary can forward calls\\n require(msg.sender == beneficiary, \\\"Unauthorized caller\\\");\\n require(msg.value == 0, \\\"ETH transfers not supported\\\");\\n\\n // Function call validation\\n address _target = manager.getAuthFunctionCallTarget(msg.sig);\\n require(_target != address(0), \\\"Unauthorized function\\\");\\n\\n uint256 oldBalance = currentBalance();\\n\\n // Call function with data\\n Address.functionCall(_target, msg.data);\\n\\n // Tracked used tokens in the protocol\\n // We do this check after balances were updated by the forwarded call\\n // Check is only enforced for revocable contracts to save some gas\\n if (revocable == Revocability.Enabled) {\\n // Track contract balance change\\n uint256 newBalance = currentBalance();\\n if (newBalance < oldBalance) {\\n // Outflow\\n uint256 diff = oldBalance.sub(newBalance);\\n usedAmount = usedAmount.add(diff);\\n } else {\\n // Inflow: We can receive profits from the protocol, that could make usedAmount to\\n // underflow. We set it to zero in that case.\\n uint256 diff = newBalance.sub(oldBalance);\\n usedAmount = (diff >= usedAmount) ? 0 : usedAmount.sub(diff);\\n }\\n require(usedAmount <= vestedAmount(), \\\"Cannot use more tokens than vested amount\\\");\\n }\\n }\\n\\n /**\\n * @notice Receive function that always reverts.\\n * @dev Only included to supress warnings, see https://github.com/ethereum/solidity/issues/10159\\n */\\n receive() external payable {\\n revert(\\\"Bad call\\\");\\n }\\n}\\n\",\"keccak256\":\"0x976c2ba4c1503a81ea02bd84539c516e99af611ff767968ee25456b50a6deb7b\",\"license\":\"MIT\"},\"contracts/ICallhookReceiver.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\n\\n// Copied from graphprotocol/contracts, changed solidity version to 0.7.3\\n\\n/**\\n * @title Interface for contracts that can receive callhooks through the Arbitrum GRT bridge\\n * @dev Any contract that can receive a callhook on L2, sent through the bridge from L1, must\\n * be allowlisted by the governor, but also implement this interface that contains\\n * the function that will actually be called by the L2GraphTokenGateway.\\n */\\npragma solidity ^0.7.3;\\n\\ninterface ICallhookReceiver {\\n /**\\n * @notice Receive tokens with a callhook from the bridge\\n * @param _from Token sender in L1\\n * @param _amount Amount of tokens that were transferred\\n * @param _data ABI-encoded callhook data\\n */\\n function onTokenTransfer(address _from, uint256 _amount, bytes calldata _data) external;\\n}\\n\",\"keccak256\":\"0xb90eae14e8bac012a4b99fabe7a1110f70143eb78476ea0d6b52557ef979fa0e\",\"license\":\"GPL-2.0-or-later\"},\"contracts/IGraphTokenLock.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\ninterface IGraphTokenLock {\\n enum Revocability {\\n NotSet,\\n Enabled,\\n Disabled\\n }\\n\\n // -- Balances --\\n\\n function currentBalance() external view returns (uint256);\\n\\n // -- Time & Periods --\\n\\n function currentTime() external view returns (uint256);\\n\\n function duration() external view returns (uint256);\\n\\n function sinceStartTime() external view returns (uint256);\\n\\n function amountPerPeriod() external view returns (uint256);\\n\\n function periodDuration() external view returns (uint256);\\n\\n function currentPeriod() external view returns (uint256);\\n\\n function passedPeriods() external view returns (uint256);\\n\\n // -- Locking & Release Schedule --\\n\\n function availableAmount() external view returns (uint256);\\n\\n function vestedAmount() external view returns (uint256);\\n\\n function releasableAmount() external view returns (uint256);\\n\\n function totalOutstandingAmount() external view returns (uint256);\\n\\n function surplusAmount() external view returns (uint256);\\n\\n // -- Value Transfer --\\n\\n function release() external;\\n\\n function withdrawSurplus(uint256 _amount) external;\\n\\n function revoke() external;\\n}\\n\",\"keccak256\":\"0xceb9d258276fe25ec858191e1deae5778f1b2f612a669fb7b37bab1a064756ab\",\"license\":\"MIT\"},\"contracts/IGraphTokenLockManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nimport \\\"./IGraphTokenLock.sol\\\";\\n\\ninterface IGraphTokenLockManager {\\n // -- Factory --\\n\\n function setMasterCopy(address _masterCopy) external;\\n\\n function createTokenLockWallet(\\n address _owner,\\n address _beneficiary,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n IGraphTokenLock.Revocability _revocable\\n ) external;\\n\\n // -- Funds Management --\\n\\n function token() external returns (IERC20);\\n\\n function deposit(uint256 _amount) external;\\n\\n function withdraw(uint256 _amount) external;\\n\\n // -- Allowed Funds Destinations --\\n\\n function addTokenDestination(address _dst) external;\\n\\n function removeTokenDestination(address _dst) external;\\n\\n function isTokenDestination(address _dst) external view returns (bool);\\n\\n function getTokenDestinations() external view returns (address[] memory);\\n\\n // -- Function Call Authorization --\\n\\n function setAuthFunctionCall(string calldata _signature, address _target) external;\\n\\n function unsetAuthFunctionCall(string calldata _signature) external;\\n\\n function setAuthFunctionCallMany(string[] calldata _signatures, address[] calldata _targets) external;\\n\\n function getAuthFunctionCallTarget(bytes4 _sigHash) external view returns (address);\\n\\n function isAuthFunctionCall(bytes4 _sigHash) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x2d78d41909a6de5b316ac39b100ea087a8f317cf306379888a045523e15c4d9a\",\"license\":\"MIT\"},\"contracts/L2GraphTokenLockManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport { SafeERC20 } from \\\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\\\";\\n\\nimport { ICallhookReceiver } from \\\"./ICallhookReceiver.sol\\\";\\nimport { GraphTokenLockManager } from \\\"./GraphTokenLockManager.sol\\\";\\nimport { L2GraphTokenLockWallet } from \\\"./L2GraphTokenLockWallet.sol\\\";\\n\\n/**\\n * @title L2GraphTokenLockManager\\n * @notice This contract manages a list of authorized function calls and targets that can be called\\n * by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts.\\n *\\n * This contract receives funds to make the process of creating TokenLockWallet contracts\\n * easier by distributing them the initial tokens to be managed.\\n *\\n * In particular, this L2 variant is designed to receive token lock wallets from L1,\\n * through the GRT bridge. These transferred wallets will not allow releasing funds in L2 until\\n * the end of the vesting timeline, but they can allow withdrawing funds back to L1 using\\n * the L2GraphTokenLockTransferTool contract.\\n *\\n * The owner can setup a list of token destinations that will be used by TokenLock contracts to\\n * approve the pulling of funds, this way in can be guaranteed that only protocol contracts\\n * will manipulate users funds.\\n */\\ncontract L2GraphTokenLockManager is GraphTokenLockManager, ICallhookReceiver {\\n using SafeERC20 for IERC20;\\n\\n /// @dev Struct to hold the data of a transferred wallet; this is\\n /// the data that must be encoded in L1 to send a wallet to L2.\\n struct TransferredWalletData {\\n address l1Address;\\n address owner;\\n address beneficiary;\\n uint256 managedAmount;\\n uint256 startTime;\\n uint256 endTime;\\n }\\n\\n /// Address of the L2GraphTokenGateway\\n address public immutable l2Gateway;\\n /// Address of the L1 transfer tool contract (in L1, no aliasing)\\n address public immutable l1TransferTool;\\n /// Mapping of each L1 wallet to its L2 wallet counterpart (populated when each wallet is received)\\n /// L1 address => L2 address\\n mapping(address => address) public l1WalletToL2Wallet;\\n /// Mapping of each L2 wallet to its L1 wallet counterpart (populated when each wallet is received)\\n /// L2 address => L1 address\\n mapping(address => address) public l2WalletToL1Wallet;\\n\\n /// @dev Event emitted when a wallet is received and created from L1\\n event TokenLockCreatedFromL1(\\n address indexed contractAddress,\\n bytes32 initHash,\\n address indexed beneficiary,\\n uint256 managedAmount,\\n uint256 startTime,\\n uint256 endTime,\\n address indexed l1Address\\n );\\n\\n /// @dev Emitted when locked tokens are received from L1 (whether the wallet\\n /// had already been received or not)\\n event LockedTokensReceivedFromL1(address indexed l1Address, address indexed l2Address, uint256 amount);\\n\\n /**\\n * @dev Checks that the sender is the L2GraphTokenGateway.\\n */\\n modifier onlyL2Gateway() {\\n require(msg.sender == l2Gateway, \\\"ONLY_GATEWAY\\\");\\n _;\\n }\\n\\n /**\\n * @notice Constructor for the L2GraphTokenLockManager contract.\\n * @param _graphToken Address of the L2 GRT token contract\\n * @param _masterCopy Address of the master copy of the L2GraphTokenLockWallet implementation\\n * @param _l2Gateway Address of the L2GraphTokenGateway contract\\n * @param _l1TransferTool Address of the L1 transfer tool contract (in L1, without aliasing)\\n */\\n constructor(\\n IERC20 _graphToken,\\n address _masterCopy,\\n address _l2Gateway,\\n address _l1TransferTool\\n ) GraphTokenLockManager(_graphToken, _masterCopy) {\\n l2Gateway = _l2Gateway;\\n l1TransferTool = _l1TransferTool;\\n }\\n\\n /**\\n * @notice This function is called by the L2GraphTokenGateway when tokens are sent from L1.\\n * @dev This function will create a new wallet if it doesn't exist yet, or send the tokens to\\n * the existing wallet if it does.\\n * @param _from Address of the sender in L1, which must be the L1GraphTokenLockTransferTool\\n * @param _amount Amount of tokens received\\n * @param _data Encoded data of the transferred wallet, which must be an ABI-encoded TransferredWalletData struct\\n */\\n function onTokenTransfer(address _from, uint256 _amount, bytes calldata _data) external override onlyL2Gateway {\\n require(_from == l1TransferTool, \\\"ONLY_TRANSFER_TOOL\\\");\\n TransferredWalletData memory walletData = abi.decode(_data, (TransferredWalletData));\\n\\n if (l1WalletToL2Wallet[walletData.l1Address] != address(0)) {\\n // If the wallet was already received, just send the tokens to the L2 address\\n _token.safeTransfer(l1WalletToL2Wallet[walletData.l1Address], _amount);\\n } else {\\n // Create contract using a minimal proxy and call initializer\\n (bytes32 initHash, address contractAddress) = _deployFromL1(keccak256(_data), walletData);\\n l1WalletToL2Wallet[walletData.l1Address] = contractAddress;\\n l2WalletToL1Wallet[contractAddress] = walletData.l1Address;\\n\\n // Send managed amount to the created contract\\n _token.safeTransfer(contractAddress, _amount);\\n\\n emit TokenLockCreatedFromL1(\\n contractAddress,\\n initHash,\\n walletData.beneficiary,\\n walletData.managedAmount,\\n walletData.startTime,\\n walletData.endTime,\\n walletData.l1Address\\n );\\n }\\n emit LockedTokensReceivedFromL1(walletData.l1Address, l1WalletToL2Wallet[walletData.l1Address], _amount);\\n }\\n\\n /**\\n * @dev Deploy a token lock wallet with data received from L1\\n * @param _salt Salt for the CREATE2 call, which must be the hash of the wallet data\\n * @param _walletData Data of the wallet to be created\\n * @return Hash of the initialization calldata\\n * @return Address of the created contract\\n */\\n function _deployFromL1(bytes32 _salt, TransferredWalletData memory _walletData) internal returns (bytes32, address) {\\n bytes memory initializer = _encodeInitializer(_walletData);\\n address contractAddress = _deployProxy2(_salt, masterCopy, initializer);\\n return (keccak256(initializer), contractAddress);\\n }\\n\\n /**\\n * @dev Encode the initializer for the token lock wallet received from L1\\n * @param _walletData Data of the wallet to be created\\n * @return Encoded initializer calldata, including the function signature\\n */\\n function _encodeInitializer(TransferredWalletData memory _walletData) internal view returns (bytes memory) {\\n return\\n abi.encodeWithSelector(\\n L2GraphTokenLockWallet.initializeFromL1.selector,\\n address(this),\\n address(_token),\\n _walletData\\n );\\n }\\n}\\n\",\"keccak256\":\"0x34ca0ffc898ce3615a000d53a9c58708354b8cd8093b3c61decfe7388f0c16e0\",\"license\":\"MIT\"},\"contracts/L2GraphTokenLockWallet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nimport { GraphTokenLockWallet } from \\\"./GraphTokenLockWallet.sol\\\";\\nimport { Ownable as OwnableInitializable } from \\\"./Ownable.sol\\\";\\nimport { L2GraphTokenLockManager } from \\\"./L2GraphTokenLockManager.sol\\\";\\n\\n/**\\n * @title L2GraphTokenLockWallet\\n * @notice This contract is built on top of the base GraphTokenLock functionality.\\n * It allows wallet beneficiaries to use the deposited funds to perform specific function calls\\n * on specific contracts.\\n *\\n * The idea is that supporters with locked tokens can participate in the protocol\\n * but disallow any release before the vesting/lock schedule.\\n * The beneficiary can issue authorized function calls to this contract that will\\n * get forwarded to a target contract. A target contract is any of our protocol contracts.\\n * The function calls allowed are queried to the GraphTokenLockManager, this way\\n * the same configuration can be shared for all the created lock wallet contracts.\\n *\\n * This L2 variant includes a special initializer so that it can be created from\\n * a wallet's data received from L1. These transferred wallets will not allow releasing\\n * funds in L2 until the end of the vesting timeline, but they can allow withdrawing\\n * funds back to L1 using the L2GraphTokenLockTransferTool contract.\\n *\\n * Note that surplusAmount and releasedAmount in L2 will be skewed for wallets received from L1,\\n * so releasing surplus tokens might also only be possible by bridging tokens back to L1.\\n *\\n * NOTE: Contracts used as target must have its function signatures checked to avoid collisions\\n * with any of this contract functions.\\n * Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience\\n * the maximum amount of tokens is authorized.\\n * Function calls do not forward ETH value so DO NOT SEND ETH TO THIS CONTRACT.\\n */\\ncontract L2GraphTokenLockWallet is GraphTokenLockWallet {\\n // Initializer when created from a message from L1\\n function initializeFromL1(\\n address _manager,\\n address _token,\\n L2GraphTokenLockManager.TransferredWalletData calldata _walletData\\n ) external {\\n require(!isInitialized, \\\"Already initialized\\\");\\n isInitialized = true;\\n\\n OwnableInitializable._initialize(_walletData.owner);\\n beneficiary = _walletData.beneficiary;\\n token = IERC20(_token);\\n\\n managedAmount = _walletData.managedAmount;\\n\\n startTime = _walletData.startTime;\\n endTime = _walletData.endTime;\\n periods = 1;\\n isAccepted = true;\\n\\n // Optionals\\n releaseStartTime = _walletData.endTime;\\n revocable = Revocability.Disabled;\\n\\n _setManager(_manager);\\n }\\n}\\n\",\"keccak256\":\"0x8842140c2c7924be4ab1bca71e0b0ad6dd1dba6433cfdc523bfd204288b25d20\",\"license\":\"MIT\"},\"contracts/MathUtils.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nlibrary MathUtils {\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n}\\n\",\"keccak256\":\"0xe2512e1da48bc8363acd15f66229564b02d66706665d7da740604566913c1400\",\"license\":\"MIT\"},\"contracts/MinimalProxyFactory.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nimport { Address } from \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport { Create2 } from \\\"@openzeppelin/contracts/utils/Create2.sol\\\";\\n\\n/**\\n * @title MinimalProxyFactory: a factory contract for creating minimal proxies\\n * @notice Adapted from https://github.com/OpenZeppelin/openzeppelin-sdk/blob/v2.5.0/packages/lib/contracts/upgradeability/ProxyFactory.sol\\n * Based on https://eips.ethereum.org/EIPS/eip-1167\\n */\\ncontract MinimalProxyFactory {\\n /// @dev Emitted when a new proxy is created\\n event ProxyCreated(address indexed proxy);\\n\\n\\n /**\\n * @notice Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation\\n * @dev Uses address(this) as deployer to compute the address. Only for backwards compatibility.\\n * @param _salt Bytes32 salt to use for CREATE2\\n * @param _implementation Address of the proxy target implementation\\n * @return Address of the counterfactual MinimalProxy\\n */\\n function getDeploymentAddress(\\n bytes32 _salt,\\n address _implementation\\n ) public view returns (address) {\\n return getDeploymentAddress(_salt, _implementation, address(this));\\n }\\n\\n /**\\n * @notice Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation\\n * @param _salt Bytes32 salt to use for CREATE2\\n * @param _implementation Address of the proxy target implementation\\n * @param _deployer Address of the deployer that creates the contract\\n * @return Address of the counterfactual MinimalProxy\\n */\\n function getDeploymentAddress(\\n bytes32 _salt,\\n address _implementation,\\n address _deployer\\n ) public pure returns (address) {\\n return Create2.computeAddress(_salt, keccak256(_getContractCreationCode(_implementation)), _deployer);\\n }\\n\\n /**\\n * @dev Deploys a MinimalProxy with CREATE2\\n * @param _salt Bytes32 salt to use for CREATE2\\n * @param _implementation Address of the proxy target implementation\\n * @param _data Bytes with the initializer call\\n * @return Address of the deployed MinimalProxy\\n */\\n function _deployProxy2(bytes32 _salt, address _implementation, bytes memory _data) internal returns (address) {\\n address proxyAddress = Create2.deploy(0, _salt, _getContractCreationCode(_implementation));\\n\\n emit ProxyCreated(proxyAddress);\\n\\n // Call function with data\\n if (_data.length > 0) {\\n Address.functionCall(proxyAddress, _data);\\n }\\n\\n return proxyAddress;\\n }\\n\\n /**\\n * @dev Gets the MinimalProxy bytecode\\n * @param _implementation Address of the proxy target implementation\\n * @return MinimalProxy bytecode\\n */\\n function _getContractCreationCode(address _implementation) internal pure returns (bytes memory) {\\n bytes10 creation = 0x3d602d80600a3d3981f3;\\n bytes10 prefix = 0x363d3d373d3d3d363d73;\\n bytes20 targetBytes = bytes20(_implementation);\\n bytes15 suffix = 0x5af43d82803e903d91602b57fd5bf3;\\n return abi.encodePacked(creation, prefix, targetBytes, suffix);\\n }\\n}\\n\",\"keccak256\":\"0xc0ad119f676fe82b234fd5c830d9bc443e9038c0cfe5dc4de3a3bf621d3f69df\",\"license\":\"MIT\"},\"contracts/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * The owner account will be passed on initialization of the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\ncontract Ownable {\\n /// @dev Owner of the contract, can be retrieved with the public owner() function\\n address private _owner;\\n /// @dev Since upgradeable contracts might inherit this, we add a storage gap\\n /// to allow adding variables here without breaking the proxy storage layout\\n uint256[50] private __gap;\\n\\n /// @dev Emitted when ownership of the contract is transferred\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n function _initialize(address owner) internal {\\n _owner = owner;\\n emit OwnershipTransferred(address(0), owner);\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(_owner == msg.sender, \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() external virtual onlyOwner {\\n emit OwnershipTransferred(_owner, address(0));\\n _owner = address(0);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) external virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n emit OwnershipTransferred(_owner, newOwner);\\n _owner = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0xe8750687082e8e24b620dbf58c3a08eee591ed7b4d5a3e13cc93554ec647fd09\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60c06040523480156200001157600080fd5b5060405162004a3538038062004a35833981810160405281019062000037919062000410565b838360006200004b6200022860201b60201c565b9050806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a350600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156200015c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620001539062000586565b60405180910390fd5b81600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550620001ae816200023060201b60201c565b50508173ffffffffffffffffffffffffffffffffffffffff1660808173ffffffffffffffffffffffffffffffffffffffff1660601b815250508073ffffffffffffffffffffffffffffffffffffffff1660a08173ffffffffffffffffffffffffffffffffffffffff1660601b815250505050505062000635565b600033905090565b620002406200022860201b60201c565b73ffffffffffffffffffffffffffffffffffffffff1662000266620003b960201b60201c565b73ffffffffffffffffffffffffffffffffffffffff1614620002bf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620002b69062000564565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141562000332576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620003299062000542565b60405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167f30909084afc859121ffc3a5aef7fe37c540a9a1ef60bd4d8dcdb76376fadf9de60405160405180910390a250565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600081519050620003f38162000601565b92915050565b6000815190506200040a816200061b565b92915050565b600080600080608085870312156200042757600080fd5b60006200043787828801620003f9565b94505060206200044a87828801620003e2565b93505060406200045d87828801620003e2565b92505060606200047087828801620003e2565b91505092959194509250565b60006200048b601983620005a8565b91507f4d6173746572436f70792063616e6e6f74206265207a65726f000000000000006000830152602082019050919050565b6000620004cd602083620005a8565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b60006200050f601483620005a8565b91507f546f6b656e2063616e6e6f74206265207a65726f0000000000000000000000006000830152602082019050919050565b600060208201905081810360008301526200055d816200047c565b9050919050565b600060208201905081810360008301526200057f81620004be565b9050919050565b60006020820190508181036000830152620005a18162000500565b9050919050565b600082825260208201905092915050565b6000620005c682620005e1565b9050919050565b6000620005da82620005b9565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6200060c81620005b9565b81146200061857600080fd5b50565b6200062681620005cd565b81146200063257600080fd5b50565b60805160601c60a05160601c6143cc620006696000398061096452806112cb525080611014528061123d52506143cc6000f3fe608060405234801561001057600080fd5b506004361061018e5760003560e01c80638da5cb5b116100de578063b6b55f2511610097578063cf497e6c11610071578063cf497e6c1461047f578063f1d24c451461049b578063f2fde38b146104cb578063fc0c546a146104e75761018e565b8063b6b55f2514610417578063bdb62fbe14610433578063c1ab13db146104635761018e565b80638da5cb5b146103675780638fa74a0e146103855780639c05fc60146103a3578063a3457466146103bf578063a4c0ed36146103dd578063a619486e146103f95761018e565b8063463013a21161014b57806368d30c2e1161012557806368d30c2e146102e15780636e03b8dc146102fd578063715018a61461032d57806379ee1bdf146103375761018e565b8063463013a21461028b578063586a5353146102a75780635975e00c146102c55761018e565b806303990a6c14610193578063045b7fe2146101af5780630602ba2b146101df5780630cd6178f1461020f5780632e1a7d4d1461023f57806343fb93d91461025b575b600080fd5b6101ad60048036038101906101a89190612faf565b610505565b005b6101c960048036038101906101c49190612d02565b6106ad565b6040516101d69190613a58565b60405180910390f35b6101f960048036038101906101f49190612f86565b6106e0565b6040516102069190613c56565b60405180910390f35b61022960048036038101906102249190612d02565b610721565b6040516102369190613a58565b60405180910390f35b61025960048036038101906102549190613075565b610754565b005b61027560048036038101906102709190612f37565b6108b1565b6040516102829190613a58565b60405180910390f35b6102a560048036038101906102a09190612ff4565b6108d6565b005b6102af610962565b6040516102bc9190613a58565b60405180910390f35b6102df60048036038101906102da9190612d02565b610986565b005b6102fb60048036038101906102f69190612d2b565b610b17565b005b61031760048036038101906103129190612f86565b610e5f565b6040516103249190613a58565b60405180910390f35b610335610e92565b005b610351600480360381019061034c9190612d02565b610fcc565b60405161035e9190613c56565b60405180910390f35b61036f610fe9565b60405161037c9190613a58565b60405180910390f35b61038d611012565b60405161039a9190613a58565b60405180910390f35b6103bd60048036038101906103b89190612e5d565b611036565b005b6103c7611163565b6040516103d49190613c34565b60405180910390f35b6103f760048036038101906103f29190612df1565b61123b565b005b6104016117a1565b60405161040e9190613a58565b60405180910390f35b610431600480360381019061042c9190613075565b6117c7565b005b61044d60048036038101906104489190612efb565b6118aa565b60405161045a9190613a58565b60405180910390f35b61047d60048036038101906104789190612d02565b6118bf565b005b61049960048036038101906104949190612d02565b6119e0565b005b6104b560048036038101906104b09190612f86565b611b53565b6040516104c29190613a58565b60405180910390f35b6104e560048036038101906104e09190612d02565b611bce565b005b6104ef611d77565b6040516104fc9190613cb6565b60405180910390f35b61050d611da1565b73ffffffffffffffffffffffffffffffffffffffff1661052b610fe9565b73ffffffffffffffffffffffffffffffffffffffff1614610581576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161057890613ed7565b60405180910390fd5b600061058d8383611da9565b9050600060016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff16817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163373ffffffffffffffffffffffffffffffffffffffff167f450397a2db0e89eccfe664cc6cdfd274a88bc00d29aaec4d991754a42f19f8c986866040516106a0929190613cd1565b60405180910390a4505050565b60076020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008073ffffffffffffffffffffffffffffffffffffffff1661070283611b53565b73ffffffffffffffffffffffffffffffffffffffff1614159050919050565b60066020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61075c611da1565b73ffffffffffffffffffffffffffffffffffffffff1661077a610fe9565b73ffffffffffffffffffffffffffffffffffffffff16146107d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107c790613ed7565b60405180910390fd5b60008111610813576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080a90613eb7565b60405180910390fd5b6108603382600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611e379092919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b826040516108a69190613fb7565b60405180910390a250565b60006108cd846108c085611ebd565b8051906020012084611f33565b90509392505050565b6108de611da1565b73ffffffffffffffffffffffffffffffffffffffff166108fc610fe9565b73ffffffffffffffffffffffffffffffffffffffff1614610952576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161094990613ed7565b60405180910390fd5b61095d838383611f77565b505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b61098e611da1565b73ffffffffffffffffffffffffffffffffffffffff166109ac610fe9565b73ffffffffffffffffffffffffffffffffffffffff1614610a02576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109f990613ed7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610a72576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a6990613d97565b60405180910390fd5b610a8681600261215990919063ffffffff16565b610ac5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610abc90613f17565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f33442b8c13e72dd75a027f08f9bff4eed2dfd26e43cdea857365f5163b359a796001604051610b0c9190613c56565b60405180910390a250565b610b1f611da1565b73ffffffffffffffffffffffffffffffffffffffff16610b3d610fe9565b73ffffffffffffffffffffffffffffffffffffffff1614610b93576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b8a90613ed7565b60405180910390fd5b86600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610bef9190613a58565b60206040518083038186803b158015610c0757600080fd5b505afa158015610c1b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c3f919061309e565b1015610c80576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c7790613dd7565b60405180910390fd5b606063bd896dcb60e01b308b8b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168c8c8c8c8c8c8c604051602401610cd19b9a99989796959493929190613a73565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505090506000610d668280519060200120600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684612189565b9050610db5818a600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611e379092919063ffffffff16565b8973ffffffffffffffffffffffffffffffffffffffff1682805190602001208273ffffffffffffffffffffffffffffffffffffffff167f3c7ff6acee351ed98200c285a04745858a107e16da2f13c3a81a43073c17d644600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168d8d8d8d8d8d8d604051610e4a989796959493929190613bb6565b60405180910390a45050505050505050505050565b60016020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610e9a611da1565b73ffffffffffffffffffffffffffffffffffffffff16610eb8610fe9565b73ffffffffffffffffffffffffffffffffffffffff1614610f0e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f0590613ed7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000610fe282600261220590919063ffffffff16565b9050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b7f000000000000000000000000000000000000000000000000000000000000000081565b61103e611da1565b73ffffffffffffffffffffffffffffffffffffffff1661105c610fe9565b73ffffffffffffffffffffffffffffffffffffffff16146110b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110a990613ed7565b60405180910390fd5b8181905084849050146110fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110f190613d57565b60405180910390fd5b60005b8484905081101561115c5761114f85858381811061111757fe5b90506020028101906111299190613fd2565b85858581811061113557fe5b905060200201602081019061114a9190612d02565b611f77565b80806001019150506110fd565b5050505050565b6060806111706002612235565b67ffffffffffffffff8111801561118657600080fd5b506040519080825280602002602001820160405280156111b55781602001602082028036833780820191505090505b50905060005b6111c56002612235565b811015611233576111e081600261224a90919063ffffffff16565b8282815181106111ec57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505080806001019150506111bb565b508091505090565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146112c9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112c090613d77565b60405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614611357576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161134e90613e17565b60405180910390fd5b61135f612a33565b828281019061136e919061304c565b9050600073ffffffffffffffffffffffffffffffffffffffff1660066000836000015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146114bc576114b760066000836000015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1685600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611e379092919063ffffffff16565b6116ce565b6000806114e085856040516114d2929190613a0f565b604051809103902084612264565b915091508060066000856000015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508260000151600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506116358187600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611e379092919063ffffffff16565b826000015173ffffffffffffffffffffffffffffffffffffffff16836040015173ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fd74fe60cbf1e5bf07ef3fad0e00c45f66345c5226474786d8dc086527dc8414785876060015188608001518960a001516040516116c39493929190613c71565b60405180910390a450505b60066000826000015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16816000015173ffffffffffffffffffffffffffffffffffffffff167fe34903cfa4ad8362651171309d05bcbc2fc581a5ec83ca7b0c8d10743de766e2866040516117929190613fb7565b60405180910390a35050505050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000811161180a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161180190613eb7565b60405180910390fd5b611859333083600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166122bb909392919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f59062170a285eb80e8c6b8ced60428442a51910635005233fc4ce084a475845e8260405161189f9190613fb7565b60405180910390a250565b60006118b78383306108b1565b905092915050565b6118c7611da1565b73ffffffffffffffffffffffffffffffffffffffff166118e5610fe9565b73ffffffffffffffffffffffffffffffffffffffff161461193b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161193290613ed7565b60405180910390fd5b61194f81600261234490919063ffffffff16565b61198e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161198590613e37565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f33442b8c13e72dd75a027f08f9bff4eed2dfd26e43cdea857365f5163b359a7960006040516119d59190613c56565b60405180910390a250565b6119e8611da1565b73ffffffffffffffffffffffffffffffffffffffff16611a06610fe9565b73ffffffffffffffffffffffffffffffffffffffff1614611a5c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a5390613ed7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611acc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ac390613e57565b60405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167f30909084afc859121ffc3a5aef7fe37c540a9a1ef60bd4d8dcdb76376fadf9de60405160405180910390a250565b600060016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b611bd6611da1565b73ffffffffffffffffffffffffffffffffffffffff16611bf4610fe9565b73ffffffffffffffffffffffffffffffffffffffff1614611c4a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c4190613ed7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611cba576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cb190613db7565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600033905090565b6000611e2f83836040516024016040516020818303038152906040529190604051611dd5929190613a3f565b60405180910390207bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050612374565b905092915050565b611eb88363a9059cbb60e01b8484604051602401611e56929190613b8d565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506123cc565b505050565b60606000693d602d80600a3d3981f360b01b9050600069363d3d373d3d3d363d7360b01b905060008460601b905060006e5af43d82803e903d91602b57fd5bf360881b905083838383604051602001611f199493929190613973565b604051602081830303815290604052945050505050919050565b60008060ff60f81b838686604051602001611f5194939291906139c1565b6040516020818303038152906040528051906020012090508060001c9150509392505050565b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611fe6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fdd90613e77565b60405180910390fd5b611fef81612493565b61202e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161202590613f97565b60405180910390fd5b600061203a8484611da9565b90508160016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff16817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163373ffffffffffffffffffffffffffffffffffffffff167f450397a2db0e89eccfe664cc6cdfd274a88bc00d29aaec4d991754a42f19f8c9878760405161214b929190613cd1565b60405180910390a450505050565b6000612181836000018373ffffffffffffffffffffffffffffffffffffffff1660001b6124a6565b905092915050565b6000806121a060008661219b87611ebd565b612516565b90508073ffffffffffffffffffffffffffffffffffffffff167efffc2da0b561cae30d9826d37709e9421c4725faebc226cbbb7ef5fc5e734960405160405180910390a26000835111156121fa576121f88184612627565b505b809150509392505050565b600061222d836000018373ffffffffffffffffffffffffffffffffffffffff1660001b612671565b905092915050565b600061224382600001612694565b9050919050565b600061225983600001836126a5565b60001c905092915050565b600080606061227284612712565b905060006122a386600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684612189565b90508180519060200120819350935050509250929050565b61233e846323b872dd60e01b8585856040516024016122dc93929190613b56565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506123cc565b50505050565b600061236c836000018373ffffffffffffffffffffffffffffffffffffffff1660001b6127b7565b905092915050565b600060048251146123ba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123b190613ef7565b60405180910390fd5b60006020830151905080915050919050565b606061242e826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff1661289f9092919063ffffffff16565b905060008151111561248e578080602001905181019061244e9190612ed2565b61248d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161248490613f57565b60405180910390fd5b5b505050565b600080823b905060008111915050919050565b60006124b28383612671565b61250b578260000182908060018154018082558091505060019003906000526020600020016000909190919091505582600001805490508360010160008481526020019081526020016000208190555060019050612510565b600090505b92915050565b6000808447101561255c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161255390613f77565b60405180910390fd5b6000835114156125a1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161259890613d37565b60405180910390fd5b8383516020850187f59050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561261c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161261390613e97565b60405180910390fd5b809150509392505050565b606061266983836040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061289f565b905092915050565b600080836001016000848152602001908152602001600020541415905092915050565b600081600001805490509050919050565b6000818360000180549050116126f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126e790613d17565b60405180910390fd5b8260000182815481106126ff57fe5b9060005260206000200154905092915050565b60606320dc203d60e01b30600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168460405160240161275393929190613b1e565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050509050919050565b60008083600101600084815260200190815260200160002054905060008114612893576000600182039050600060018660000180549050039050600086600001828154811061280257fe5b906000526020600020015490508087600001848154811061281f57fe5b906000526020600020018190555060018301876001016000838152602001908152602001600020819055508660000180548061285757fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050612899565b60009150505b92915050565b60606128ae84846000856128b7565b90509392505050565b6060824710156128fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128f390613df7565b60405180910390fd5b61290585612493565b612944576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161293b90613f37565b60405180910390fd5b600060608673ffffffffffffffffffffffffffffffffffffffff16858760405161296e9190613a28565b60006040518083038185875af1925050503d80600081146129ab576040519150601f19603f3d011682016040523d82523d6000602084013e6129b0565b606091505b50915091506129c08282866129cc565b92505050949350505050565b606083156129dc57829050612a2c565b6000835111156129ef5782518084602001fd5b816040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a239190613cf5565b60405180910390fd5b9392505050565b6040518060c00160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff1681526020016000815260200160008152602001600081525090565b600081359050612aba81614313565b92915050565b60008083601f840112612ad257600080fd5b8235905067ffffffffffffffff811115612aeb57600080fd5b602083019150836020820283011115612b0357600080fd5b9250929050565b60008083601f840112612b1c57600080fd5b8235905067ffffffffffffffff811115612b3557600080fd5b602083019150836020820283011115612b4d57600080fd5b9250929050565b600081519050612b638161432a565b92915050565b600081359050612b7881614341565b92915050565b600081359050612b8d81614358565b92915050565b60008083601f840112612ba557600080fd5b8235905067ffffffffffffffff811115612bbe57600080fd5b602083019150836001820283011115612bd657600080fd5b9250929050565b600081359050612bec8161436f565b92915050565b60008083601f840112612c0457600080fd5b8235905067ffffffffffffffff811115612c1d57600080fd5b602083019150836001820283011115612c3557600080fd5b9250929050565b600060c08284031215612c4e57600080fd5b612c5860c0614029565b90506000612c6884828501612aab565b6000830152506020612c7c84828501612aab565b6020830152506040612c9084828501612aab565b6040830152506060612ca484828501612cd8565b6060830152506080612cb884828501612cd8565b60808301525060a0612ccc84828501612cd8565b60a08301525092915050565b600081359050612ce78161437f565b92915050565b600081519050612cfc8161437f565b92915050565b600060208284031215612d1457600080fd5b6000612d2284828501612aab565b91505092915050565b60008060008060008060008060006101208a8c031215612d4a57600080fd5b6000612d588c828d01612aab565b9950506020612d698c828d01612aab565b9850506040612d7a8c828d01612cd8565b9750506060612d8b8c828d01612cd8565b9650506080612d9c8c828d01612cd8565b95505060a0612dad8c828d01612cd8565b94505060c0612dbe8c828d01612cd8565b93505060e0612dcf8c828d01612cd8565b925050610100612de18c828d01612bdd565b9150509295985092959850929598565b60008060008060608587031215612e0757600080fd5b6000612e1587828801612aab565b9450506020612e2687828801612cd8565b935050604085013567ffffffffffffffff811115612e4357600080fd5b612e4f87828801612b93565b925092505092959194509250565b60008060008060408587031215612e7357600080fd5b600085013567ffffffffffffffff811115612e8d57600080fd5b612e9987828801612b0a565b9450945050602085013567ffffffffffffffff811115612eb857600080fd5b612ec487828801612ac0565b925092505092959194509250565b600060208284031215612ee457600080fd5b6000612ef284828501612b54565b91505092915050565b60008060408385031215612f0e57600080fd5b6000612f1c85828601612b69565b9250506020612f2d85828601612aab565b9150509250929050565b600080600060608486031215612f4c57600080fd5b6000612f5a86828701612b69565b9350506020612f6b86828701612aab565b9250506040612f7c86828701612aab565b9150509250925092565b600060208284031215612f9857600080fd5b6000612fa684828501612b7e565b91505092915050565b60008060208385031215612fc257600080fd5b600083013567ffffffffffffffff811115612fdc57600080fd5b612fe885828601612bf2565b92509250509250929050565b60008060006040848603121561300957600080fd5b600084013567ffffffffffffffff81111561302357600080fd5b61302f86828701612bf2565b9350935050602061304286828701612aab565b9150509250925092565b600060c0828403121561305e57600080fd5b600061306c84828501612c3c565b91505092915050565b60006020828403121561308757600080fd5b600061309584828501612cd8565b91505092915050565b6000602082840312156130b057600080fd5b60006130be84828501612ced565b91505092915050565b60006130d383836130df565b60208301905092915050565b6130e8816140d0565b82525050565b6130f7816140d0565b82525050565b61310e613109826140d0565b614289565b82525050565b600061311f8261406a565b6131298185614098565b93506131348361405a565b8060005b8381101561316557815161314c88826130c7565b97506131578361408b565b925050600181019050613138565b5085935050505092915050565b61317b816140e2565b82525050565b61319261318d8261411a565b6142a5565b82525050565b6131a96131a482614146565b6142af565b82525050565b6131c06131bb826140ee565b61429b565b82525050565b6131d76131d282614172565b6142b9565b82525050565b6131e68161419e565b82525050565b6131fd6131f88261419e565b6142c3565b82525050565b600061320f83856140a9565b935061321c838584614247565b82840190509392505050565b600061323382614075565b61323d81856140a9565b935061324d818560208601614256565b80840191505092915050565b61326281614211565b82525050565b61327181614235565b82525050565b600061328383856140b4565b9350613290838584614247565b613299836142e1565b840190509392505050565b60006132b083856140c5565b93506132bd838584614247565b82840190509392505050565b60006132d482614080565b6132de81856140b4565b93506132ee818560208601614256565b6132f7816142e1565b840191505092915050565b600061330f6022836140b4565b91507f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e60008301527f64730000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006133756020836140b4565b91507f437265617465323a2062797465636f6465206c656e677468206973207a65726f6000830152602082019050919050565b60006133b56015836140b4565b91507f4172726179206c656e677468206d69736d6174636800000000000000000000006000830152602082019050919050565b60006133f5600c836140b4565b91507f4f4e4c595f4741544557415900000000000000000000000000000000000000006000830152602082019050919050565b6000613435601a836140b4565b91507f44657374696e6174696f6e2063616e6e6f74206265207a65726f0000000000006000830152602082019050919050565b60006134756026836140b4565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006134db6020836140b4565b91507f4e6f7420656e6f75676820746f6b656e7320746f20637265617465206c6f636b6000830152602082019050919050565b600061351b6026836140b4565b91507f416464726573733a20696e73756666696369656e742062616c616e636520666f60008301527f722063616c6c00000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006135816012836140b4565b91507f4f4e4c595f5452414e534645525f544f4f4c00000000000000000000000000006000830152602082019050919050565b60006135c1601b836140b4565b91507f44657374696e6174696f6e20616c72656164792072656d6f76656400000000006000830152602082019050919050565b60006136016019836140b4565b91507f4d6173746572436f70792063616e6e6f74206265207a65726f000000000000006000830152602082019050919050565b6000613641601d836140b4565b91507f546172676574206d757374206265206f7468657220636f6e74726163740000006000830152602082019050919050565b60006136816019836140b4565b91507f437265617465323a204661696c6564206f6e206465706c6f79000000000000006000830152602082019050919050565b60006136c16015836140b4565b91507f416d6f756e742063616e6e6f74206265207a65726f00000000000000000000006000830152602082019050919050565b60006137016020836140b4565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b60006137416018836140b4565b91507f496e76616c6964206d6574686f64207369676e617475726500000000000000006000830152602082019050919050565b60006137816019836140b4565b91507f44657374696e6174696f6e20616c7265616479206164646564000000000000006000830152602082019050919050565b60006137c1601d836140b4565b91507f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006000830152602082019050919050565b6000613801602a836140b4565b91507f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008301527f6f742073756363656564000000000000000000000000000000000000000000006020830152604082019050919050565b6000613867601d836140b4565b91507f437265617465323a20696e73756666696369656e742062616c616e63650000006000830152602082019050919050565b60006138a76019836140b4565b91507f546172676574206d757374206265206120636f6e7472616374000000000000006000830152602082019050919050565b60c0820160008201516138f060008501826130df565b50602082015161390360208501826130df565b50604082015161391660408501826130df565b5060608201516139296060850182613955565b50608082015161393c6080850182613955565b5060a082015161394f60a0850182613955565b50505050565b61395e81614207565b82525050565b61396d81614207565b82525050565b600061397f8287613181565b600a8201915061398f8286613181565b600a8201915061399f82856131c6565b6014820191506139af8284613198565b600f8201915081905095945050505050565b60006139cd82876131af565b6001820191506139dd82866130fd565b6014820191506139ed82856131ec565b6020820191506139fd82846131ec565b60208201915081905095945050505050565b6000613a1c828486613203565b91508190509392505050565b6000613a348284613228565b915081905092915050565b6000613a4c8284866132a4565b91508190509392505050565b6000602082019050613a6d60008301846130ee565b92915050565b600061016082019050613a89600083018e6130ee565b613a96602083018d6130ee565b613aa3604083018c6130ee565b613ab0606083018b6130ee565b613abd608083018a613964565b613aca60a0830189613964565b613ad760c0830188613964565b613ae460e0830187613964565b613af2610100830186613964565b613b00610120830185613964565b613b0e610140830184613268565b9c9b505050505050505050505050565b600061010082019050613b3460008301866130ee565b613b4160208301856130ee565b613b4e60408301846138da565b949350505050565b6000606082019050613b6b60008301866130ee565b613b7860208301856130ee565b613b856040830184613964565b949350505050565b6000604082019050613ba260008301856130ee565b613baf6020830184613964565b9392505050565b600061010082019050613bcc600083018b6130ee565b613bd9602083018a613964565b613be66040830189613964565b613bf36060830188613964565b613c006080830187613964565b613c0d60a0830186613964565b613c1a60c0830185613964565b613c2760e0830184613268565b9998505050505050505050565b60006020820190508181036000830152613c4e8184613114565b905092915050565b6000602082019050613c6b6000830184613172565b92915050565b6000608082019050613c8660008301876131dd565b613c936020830186613964565b613ca06040830185613964565b613cad6060830184613964565b95945050505050565b6000602082019050613ccb6000830184613259565b92915050565b60006020820190508181036000830152613cec818486613277565b90509392505050565b60006020820190508181036000830152613d0f81846132c9565b905092915050565b60006020820190508181036000830152613d3081613302565b9050919050565b60006020820190508181036000830152613d5081613368565b9050919050565b60006020820190508181036000830152613d70816133a8565b9050919050565b60006020820190508181036000830152613d90816133e8565b9050919050565b60006020820190508181036000830152613db081613428565b9050919050565b60006020820190508181036000830152613dd081613468565b9050919050565b60006020820190508181036000830152613df0816134ce565b9050919050565b60006020820190508181036000830152613e108161350e565b9050919050565b60006020820190508181036000830152613e3081613574565b9050919050565b60006020820190508181036000830152613e50816135b4565b9050919050565b60006020820190508181036000830152613e70816135f4565b9050919050565b60006020820190508181036000830152613e9081613634565b9050919050565b60006020820190508181036000830152613eb081613674565b9050919050565b60006020820190508181036000830152613ed0816136b4565b9050919050565b60006020820190508181036000830152613ef0816136f4565b9050919050565b60006020820190508181036000830152613f1081613734565b9050919050565b60006020820190508181036000830152613f3081613774565b9050919050565b60006020820190508181036000830152613f50816137b4565b9050919050565b60006020820190508181036000830152613f70816137f4565b9050919050565b60006020820190508181036000830152613f908161385a565b9050919050565b60006020820190508181036000830152613fb08161389a565b9050919050565b6000602082019050613fcc6000830184613964565b92915050565b60008083356001602003843603038112613feb57600080fd5b80840192508235915067ffffffffffffffff82111561400957600080fd5b60208301925060018202360383131561402157600080fd5b509250929050565b6000604051905081810181811067ffffffffffffffff821117156140505761404f6142df565b5b8060405250919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b60006140db826141e7565b9050919050565b60008115159050919050565b60007fff0000000000000000000000000000000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffff0000000000000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffffffffffffff000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffffffffffffffffffffffff00000000000000000000000082169050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b60008190506141e2826142ff565b919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600061421c82614223565b9050919050565b600061422e826141e7565b9050919050565b6000614240826141d4565b9050919050565b82818337600083830152505050565b60005b83811015614274578082015181840152602081019050614259565b83811115614283576000848401525b50505050565b6000614294826142cd565b9050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b60006142d8826142f2565b9050919050565bfe5b6000601f19601f8301169050919050565b60008160601b9050919050565b600381106143105761430f6142df565b5b50565b61431c816140d0565b811461432757600080fd5b50565b614333816140e2565b811461433e57600080fd5b50565b61434a8161419e565b811461435557600080fd5b50565b614361816141a8565b811461436c57600080fd5b50565b6003811061437c57600080fd5b50565b61438881614207565b811461439357600080fd5b5056fea26469706673582212202dadc0d09d62f32774ff0e2d49549f8768c210a71ba59d9013abe0c5a6bef31064736f6c63430007030033", + "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061018e5760003560e01c80638da5cb5b116100de578063b6b55f2511610097578063cf497e6c11610071578063cf497e6c1461047f578063f1d24c451461049b578063f2fde38b146104cb578063fc0c546a146104e75761018e565b8063b6b55f2514610417578063bdb62fbe14610433578063c1ab13db146104635761018e565b80638da5cb5b146103675780638fa74a0e146103855780639c05fc60146103a3578063a3457466146103bf578063a4c0ed36146103dd578063a619486e146103f95761018e565b8063463013a21161014b57806368d30c2e1161012557806368d30c2e146102e15780636e03b8dc146102fd578063715018a61461032d57806379ee1bdf146103375761018e565b8063463013a21461028b578063586a5353146102a75780635975e00c146102c55761018e565b806303990a6c14610193578063045b7fe2146101af5780630602ba2b146101df5780630cd6178f1461020f5780632e1a7d4d1461023f57806343fb93d91461025b575b600080fd5b6101ad60048036038101906101a89190612faf565b610505565b005b6101c960048036038101906101c49190612d02565b6106ad565b6040516101d69190613a58565b60405180910390f35b6101f960048036038101906101f49190612f86565b6106e0565b6040516102069190613c56565b60405180910390f35b61022960048036038101906102249190612d02565b610721565b6040516102369190613a58565b60405180910390f35b61025960048036038101906102549190613075565b610754565b005b61027560048036038101906102709190612f37565b6108b1565b6040516102829190613a58565b60405180910390f35b6102a560048036038101906102a09190612ff4565b6108d6565b005b6102af610962565b6040516102bc9190613a58565b60405180910390f35b6102df60048036038101906102da9190612d02565b610986565b005b6102fb60048036038101906102f69190612d2b565b610b17565b005b61031760048036038101906103129190612f86565b610e5f565b6040516103249190613a58565b60405180910390f35b610335610e92565b005b610351600480360381019061034c9190612d02565b610fcc565b60405161035e9190613c56565b60405180910390f35b61036f610fe9565b60405161037c9190613a58565b60405180910390f35b61038d611012565b60405161039a9190613a58565b60405180910390f35b6103bd60048036038101906103b89190612e5d565b611036565b005b6103c7611163565b6040516103d49190613c34565b60405180910390f35b6103f760048036038101906103f29190612df1565b61123b565b005b6104016117a1565b60405161040e9190613a58565b60405180910390f35b610431600480360381019061042c9190613075565b6117c7565b005b61044d60048036038101906104489190612efb565b6118aa565b60405161045a9190613a58565b60405180910390f35b61047d60048036038101906104789190612d02565b6118bf565b005b61049960048036038101906104949190612d02565b6119e0565b005b6104b560048036038101906104b09190612f86565b611b53565b6040516104c29190613a58565b60405180910390f35b6104e560048036038101906104e09190612d02565b611bce565b005b6104ef611d77565b6040516104fc9190613cb6565b60405180910390f35b61050d611da1565b73ffffffffffffffffffffffffffffffffffffffff1661052b610fe9565b73ffffffffffffffffffffffffffffffffffffffff1614610581576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161057890613ed7565b60405180910390fd5b600061058d8383611da9565b9050600060016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff16817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163373ffffffffffffffffffffffffffffffffffffffff167f450397a2db0e89eccfe664cc6cdfd274a88bc00d29aaec4d991754a42f19f8c986866040516106a0929190613cd1565b60405180910390a4505050565b60076020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008073ffffffffffffffffffffffffffffffffffffffff1661070283611b53565b73ffffffffffffffffffffffffffffffffffffffff1614159050919050565b60066020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61075c611da1565b73ffffffffffffffffffffffffffffffffffffffff1661077a610fe9565b73ffffffffffffffffffffffffffffffffffffffff16146107d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107c790613ed7565b60405180910390fd5b60008111610813576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080a90613eb7565b60405180910390fd5b6108603382600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611e379092919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b826040516108a69190613fb7565b60405180910390a250565b60006108cd846108c085611ebd565b8051906020012084611f33565b90509392505050565b6108de611da1565b73ffffffffffffffffffffffffffffffffffffffff166108fc610fe9565b73ffffffffffffffffffffffffffffffffffffffff1614610952576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161094990613ed7565b60405180910390fd5b61095d838383611f77565b505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b61098e611da1565b73ffffffffffffffffffffffffffffffffffffffff166109ac610fe9565b73ffffffffffffffffffffffffffffffffffffffff1614610a02576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109f990613ed7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610a72576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a6990613d97565b60405180910390fd5b610a8681600261215990919063ffffffff16565b610ac5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610abc90613f17565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f33442b8c13e72dd75a027f08f9bff4eed2dfd26e43cdea857365f5163b359a796001604051610b0c9190613c56565b60405180910390a250565b610b1f611da1565b73ffffffffffffffffffffffffffffffffffffffff16610b3d610fe9565b73ffffffffffffffffffffffffffffffffffffffff1614610b93576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b8a90613ed7565b60405180910390fd5b86600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610bef9190613a58565b60206040518083038186803b158015610c0757600080fd5b505afa158015610c1b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c3f919061309e565b1015610c80576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c7790613dd7565b60405180910390fd5b606063bd896dcb60e01b308b8b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168c8c8c8c8c8c8c604051602401610cd19b9a99989796959493929190613a73565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505090506000610d668280519060200120600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684612189565b9050610db5818a600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611e379092919063ffffffff16565b8973ffffffffffffffffffffffffffffffffffffffff1682805190602001208273ffffffffffffffffffffffffffffffffffffffff167f3c7ff6acee351ed98200c285a04745858a107e16da2f13c3a81a43073c17d644600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168d8d8d8d8d8d8d604051610e4a989796959493929190613bb6565b60405180910390a45050505050505050505050565b60016020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610e9a611da1565b73ffffffffffffffffffffffffffffffffffffffff16610eb8610fe9565b73ffffffffffffffffffffffffffffffffffffffff1614610f0e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f0590613ed7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000610fe282600261220590919063ffffffff16565b9050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b7f000000000000000000000000000000000000000000000000000000000000000081565b61103e611da1565b73ffffffffffffffffffffffffffffffffffffffff1661105c610fe9565b73ffffffffffffffffffffffffffffffffffffffff16146110b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110a990613ed7565b60405180910390fd5b8181905084849050146110fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110f190613d57565b60405180910390fd5b60005b8484905081101561115c5761114f85858381811061111757fe5b90506020028101906111299190613fd2565b85858581811061113557fe5b905060200201602081019061114a9190612d02565b611f77565b80806001019150506110fd565b5050505050565b6060806111706002612235565b67ffffffffffffffff8111801561118657600080fd5b506040519080825280602002602001820160405280156111b55781602001602082028036833780820191505090505b50905060005b6111c56002612235565b811015611233576111e081600261224a90919063ffffffff16565b8282815181106111ec57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505080806001019150506111bb565b508091505090565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146112c9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112c090613d77565b60405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614611357576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161134e90613e17565b60405180910390fd5b61135f612a33565b828281019061136e919061304c565b9050600073ffffffffffffffffffffffffffffffffffffffff1660066000836000015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146114bc576114b760066000836000015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1685600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611e379092919063ffffffff16565b6116ce565b6000806114e085856040516114d2929190613a0f565b604051809103902084612264565b915091508060066000856000015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508260000151600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506116358187600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611e379092919063ffffffff16565b826000015173ffffffffffffffffffffffffffffffffffffffff16836040015173ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fd74fe60cbf1e5bf07ef3fad0e00c45f66345c5226474786d8dc086527dc8414785876060015188608001518960a001516040516116c39493929190613c71565b60405180910390a450505b60066000826000015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16816000015173ffffffffffffffffffffffffffffffffffffffff167fe34903cfa4ad8362651171309d05bcbc2fc581a5ec83ca7b0c8d10743de766e2866040516117929190613fb7565b60405180910390a35050505050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000811161180a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161180190613eb7565b60405180910390fd5b611859333083600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166122bb909392919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f59062170a285eb80e8c6b8ced60428442a51910635005233fc4ce084a475845e8260405161189f9190613fb7565b60405180910390a250565b60006118b78383306108b1565b905092915050565b6118c7611da1565b73ffffffffffffffffffffffffffffffffffffffff166118e5610fe9565b73ffffffffffffffffffffffffffffffffffffffff161461193b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161193290613ed7565b60405180910390fd5b61194f81600261234490919063ffffffff16565b61198e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161198590613e37565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f33442b8c13e72dd75a027f08f9bff4eed2dfd26e43cdea857365f5163b359a7960006040516119d59190613c56565b60405180910390a250565b6119e8611da1565b73ffffffffffffffffffffffffffffffffffffffff16611a06610fe9565b73ffffffffffffffffffffffffffffffffffffffff1614611a5c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a5390613ed7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611acc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ac390613e57565b60405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167f30909084afc859121ffc3a5aef7fe37c540a9a1ef60bd4d8dcdb76376fadf9de60405160405180910390a250565b600060016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b611bd6611da1565b73ffffffffffffffffffffffffffffffffffffffff16611bf4610fe9565b73ffffffffffffffffffffffffffffffffffffffff1614611c4a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c4190613ed7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611cba576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cb190613db7565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600033905090565b6000611e2f83836040516024016040516020818303038152906040529190604051611dd5929190613a3f565b60405180910390207bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050612374565b905092915050565b611eb88363a9059cbb60e01b8484604051602401611e56929190613b8d565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506123cc565b505050565b60606000693d602d80600a3d3981f360b01b9050600069363d3d373d3d3d363d7360b01b905060008460601b905060006e5af43d82803e903d91602b57fd5bf360881b905083838383604051602001611f199493929190613973565b604051602081830303815290604052945050505050919050565b60008060ff60f81b838686604051602001611f5194939291906139c1565b6040516020818303038152906040528051906020012090508060001c9150509392505050565b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611fe6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fdd90613e77565b60405180910390fd5b611fef81612493565b61202e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161202590613f97565b60405180910390fd5b600061203a8484611da9565b90508160016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff16817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163373ffffffffffffffffffffffffffffffffffffffff167f450397a2db0e89eccfe664cc6cdfd274a88bc00d29aaec4d991754a42f19f8c9878760405161214b929190613cd1565b60405180910390a450505050565b6000612181836000018373ffffffffffffffffffffffffffffffffffffffff1660001b6124a6565b905092915050565b6000806121a060008661219b87611ebd565b612516565b90508073ffffffffffffffffffffffffffffffffffffffff167efffc2da0b561cae30d9826d37709e9421c4725faebc226cbbb7ef5fc5e734960405160405180910390a26000835111156121fa576121f88184612627565b505b809150509392505050565b600061222d836000018373ffffffffffffffffffffffffffffffffffffffff1660001b612671565b905092915050565b600061224382600001612694565b9050919050565b600061225983600001836126a5565b60001c905092915050565b600080606061227284612712565b905060006122a386600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684612189565b90508180519060200120819350935050509250929050565b61233e846323b872dd60e01b8585856040516024016122dc93929190613b56565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506123cc565b50505050565b600061236c836000018373ffffffffffffffffffffffffffffffffffffffff1660001b6127b7565b905092915050565b600060048251146123ba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123b190613ef7565b60405180910390fd5b60006020830151905080915050919050565b606061242e826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff1661289f9092919063ffffffff16565b905060008151111561248e578080602001905181019061244e9190612ed2565b61248d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161248490613f57565b60405180910390fd5b5b505050565b600080823b905060008111915050919050565b60006124b28383612671565b61250b578260000182908060018154018082558091505060019003906000526020600020016000909190919091505582600001805490508360010160008481526020019081526020016000208190555060019050612510565b600090505b92915050565b6000808447101561255c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161255390613f77565b60405180910390fd5b6000835114156125a1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161259890613d37565b60405180910390fd5b8383516020850187f59050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561261c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161261390613e97565b60405180910390fd5b809150509392505050565b606061266983836040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061289f565b905092915050565b600080836001016000848152602001908152602001600020541415905092915050565b600081600001805490509050919050565b6000818360000180549050116126f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126e790613d17565b60405180910390fd5b8260000182815481106126ff57fe5b9060005260206000200154905092915050565b60606320dc203d60e01b30600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168460405160240161275393929190613b1e565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050509050919050565b60008083600101600084815260200190815260200160002054905060008114612893576000600182039050600060018660000180549050039050600086600001828154811061280257fe5b906000526020600020015490508087600001848154811061281f57fe5b906000526020600020018190555060018301876001016000838152602001908152602001600020819055508660000180548061285757fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050612899565b60009150505b92915050565b60606128ae84846000856128b7565b90509392505050565b6060824710156128fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128f390613df7565b60405180910390fd5b61290585612493565b612944576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161293b90613f37565b60405180910390fd5b600060608673ffffffffffffffffffffffffffffffffffffffff16858760405161296e9190613a28565b60006040518083038185875af1925050503d80600081146129ab576040519150601f19603f3d011682016040523d82523d6000602084013e6129b0565b606091505b50915091506129c08282866129cc565b92505050949350505050565b606083156129dc57829050612a2c565b6000835111156129ef5782518084602001fd5b816040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a239190613cf5565b60405180910390fd5b9392505050565b6040518060c00160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff1681526020016000815260200160008152602001600081525090565b600081359050612aba81614313565b92915050565b60008083601f840112612ad257600080fd5b8235905067ffffffffffffffff811115612aeb57600080fd5b602083019150836020820283011115612b0357600080fd5b9250929050565b60008083601f840112612b1c57600080fd5b8235905067ffffffffffffffff811115612b3557600080fd5b602083019150836020820283011115612b4d57600080fd5b9250929050565b600081519050612b638161432a565b92915050565b600081359050612b7881614341565b92915050565b600081359050612b8d81614358565b92915050565b60008083601f840112612ba557600080fd5b8235905067ffffffffffffffff811115612bbe57600080fd5b602083019150836001820283011115612bd657600080fd5b9250929050565b600081359050612bec8161436f565b92915050565b60008083601f840112612c0457600080fd5b8235905067ffffffffffffffff811115612c1d57600080fd5b602083019150836001820283011115612c3557600080fd5b9250929050565b600060c08284031215612c4e57600080fd5b612c5860c0614029565b90506000612c6884828501612aab565b6000830152506020612c7c84828501612aab565b6020830152506040612c9084828501612aab565b6040830152506060612ca484828501612cd8565b6060830152506080612cb884828501612cd8565b60808301525060a0612ccc84828501612cd8565b60a08301525092915050565b600081359050612ce78161437f565b92915050565b600081519050612cfc8161437f565b92915050565b600060208284031215612d1457600080fd5b6000612d2284828501612aab565b91505092915050565b60008060008060008060008060006101208a8c031215612d4a57600080fd5b6000612d588c828d01612aab565b9950506020612d698c828d01612aab565b9850506040612d7a8c828d01612cd8565b9750506060612d8b8c828d01612cd8565b9650506080612d9c8c828d01612cd8565b95505060a0612dad8c828d01612cd8565b94505060c0612dbe8c828d01612cd8565b93505060e0612dcf8c828d01612cd8565b925050610100612de18c828d01612bdd565b9150509295985092959850929598565b60008060008060608587031215612e0757600080fd5b6000612e1587828801612aab565b9450506020612e2687828801612cd8565b935050604085013567ffffffffffffffff811115612e4357600080fd5b612e4f87828801612b93565b925092505092959194509250565b60008060008060408587031215612e7357600080fd5b600085013567ffffffffffffffff811115612e8d57600080fd5b612e9987828801612b0a565b9450945050602085013567ffffffffffffffff811115612eb857600080fd5b612ec487828801612ac0565b925092505092959194509250565b600060208284031215612ee457600080fd5b6000612ef284828501612b54565b91505092915050565b60008060408385031215612f0e57600080fd5b6000612f1c85828601612b69565b9250506020612f2d85828601612aab565b9150509250929050565b600080600060608486031215612f4c57600080fd5b6000612f5a86828701612b69565b9350506020612f6b86828701612aab565b9250506040612f7c86828701612aab565b9150509250925092565b600060208284031215612f9857600080fd5b6000612fa684828501612b7e565b91505092915050565b60008060208385031215612fc257600080fd5b600083013567ffffffffffffffff811115612fdc57600080fd5b612fe885828601612bf2565b92509250509250929050565b60008060006040848603121561300957600080fd5b600084013567ffffffffffffffff81111561302357600080fd5b61302f86828701612bf2565b9350935050602061304286828701612aab565b9150509250925092565b600060c0828403121561305e57600080fd5b600061306c84828501612c3c565b91505092915050565b60006020828403121561308757600080fd5b600061309584828501612cd8565b91505092915050565b6000602082840312156130b057600080fd5b60006130be84828501612ced565b91505092915050565b60006130d383836130df565b60208301905092915050565b6130e8816140d0565b82525050565b6130f7816140d0565b82525050565b61310e613109826140d0565b614289565b82525050565b600061311f8261406a565b6131298185614098565b93506131348361405a565b8060005b8381101561316557815161314c88826130c7565b97506131578361408b565b925050600181019050613138565b5085935050505092915050565b61317b816140e2565b82525050565b61319261318d8261411a565b6142a5565b82525050565b6131a96131a482614146565b6142af565b82525050565b6131c06131bb826140ee565b61429b565b82525050565b6131d76131d282614172565b6142b9565b82525050565b6131e68161419e565b82525050565b6131fd6131f88261419e565b6142c3565b82525050565b600061320f83856140a9565b935061321c838584614247565b82840190509392505050565b600061323382614075565b61323d81856140a9565b935061324d818560208601614256565b80840191505092915050565b61326281614211565b82525050565b61327181614235565b82525050565b600061328383856140b4565b9350613290838584614247565b613299836142e1565b840190509392505050565b60006132b083856140c5565b93506132bd838584614247565b82840190509392505050565b60006132d482614080565b6132de81856140b4565b93506132ee818560208601614256565b6132f7816142e1565b840191505092915050565b600061330f6022836140b4565b91507f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e60008301527f64730000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006133756020836140b4565b91507f437265617465323a2062797465636f6465206c656e677468206973207a65726f6000830152602082019050919050565b60006133b56015836140b4565b91507f4172726179206c656e677468206d69736d6174636800000000000000000000006000830152602082019050919050565b60006133f5600c836140b4565b91507f4f4e4c595f4741544557415900000000000000000000000000000000000000006000830152602082019050919050565b6000613435601a836140b4565b91507f44657374696e6174696f6e2063616e6e6f74206265207a65726f0000000000006000830152602082019050919050565b60006134756026836140b4565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006134db6020836140b4565b91507f4e6f7420656e6f75676820746f6b656e7320746f20637265617465206c6f636b6000830152602082019050919050565b600061351b6026836140b4565b91507f416464726573733a20696e73756666696369656e742062616c616e636520666f60008301527f722063616c6c00000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006135816012836140b4565b91507f4f4e4c595f5452414e534645525f544f4f4c00000000000000000000000000006000830152602082019050919050565b60006135c1601b836140b4565b91507f44657374696e6174696f6e20616c72656164792072656d6f76656400000000006000830152602082019050919050565b60006136016019836140b4565b91507f4d6173746572436f70792063616e6e6f74206265207a65726f000000000000006000830152602082019050919050565b6000613641601d836140b4565b91507f546172676574206d757374206265206f7468657220636f6e74726163740000006000830152602082019050919050565b60006136816019836140b4565b91507f437265617465323a204661696c6564206f6e206465706c6f79000000000000006000830152602082019050919050565b60006136c16015836140b4565b91507f416d6f756e742063616e6e6f74206265207a65726f00000000000000000000006000830152602082019050919050565b60006137016020836140b4565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b60006137416018836140b4565b91507f496e76616c6964206d6574686f64207369676e617475726500000000000000006000830152602082019050919050565b60006137816019836140b4565b91507f44657374696e6174696f6e20616c7265616479206164646564000000000000006000830152602082019050919050565b60006137c1601d836140b4565b91507f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006000830152602082019050919050565b6000613801602a836140b4565b91507f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008301527f6f742073756363656564000000000000000000000000000000000000000000006020830152604082019050919050565b6000613867601d836140b4565b91507f437265617465323a20696e73756666696369656e742062616c616e63650000006000830152602082019050919050565b60006138a76019836140b4565b91507f546172676574206d757374206265206120636f6e7472616374000000000000006000830152602082019050919050565b60c0820160008201516138f060008501826130df565b50602082015161390360208501826130df565b50604082015161391660408501826130df565b5060608201516139296060850182613955565b50608082015161393c6080850182613955565b5060a082015161394f60a0850182613955565b50505050565b61395e81614207565b82525050565b61396d81614207565b82525050565b600061397f8287613181565b600a8201915061398f8286613181565b600a8201915061399f82856131c6565b6014820191506139af8284613198565b600f8201915081905095945050505050565b60006139cd82876131af565b6001820191506139dd82866130fd565b6014820191506139ed82856131ec565b6020820191506139fd82846131ec565b60208201915081905095945050505050565b6000613a1c828486613203565b91508190509392505050565b6000613a348284613228565b915081905092915050565b6000613a4c8284866132a4565b91508190509392505050565b6000602082019050613a6d60008301846130ee565b92915050565b600061016082019050613a89600083018e6130ee565b613a96602083018d6130ee565b613aa3604083018c6130ee565b613ab0606083018b6130ee565b613abd608083018a613964565b613aca60a0830189613964565b613ad760c0830188613964565b613ae460e0830187613964565b613af2610100830186613964565b613b00610120830185613964565b613b0e610140830184613268565b9c9b505050505050505050505050565b600061010082019050613b3460008301866130ee565b613b4160208301856130ee565b613b4e60408301846138da565b949350505050565b6000606082019050613b6b60008301866130ee565b613b7860208301856130ee565b613b856040830184613964565b949350505050565b6000604082019050613ba260008301856130ee565b613baf6020830184613964565b9392505050565b600061010082019050613bcc600083018b6130ee565b613bd9602083018a613964565b613be66040830189613964565b613bf36060830188613964565b613c006080830187613964565b613c0d60a0830186613964565b613c1a60c0830185613964565b613c2760e0830184613268565b9998505050505050505050565b60006020820190508181036000830152613c4e8184613114565b905092915050565b6000602082019050613c6b6000830184613172565b92915050565b6000608082019050613c8660008301876131dd565b613c936020830186613964565b613ca06040830185613964565b613cad6060830184613964565b95945050505050565b6000602082019050613ccb6000830184613259565b92915050565b60006020820190508181036000830152613cec818486613277565b90509392505050565b60006020820190508181036000830152613d0f81846132c9565b905092915050565b60006020820190508181036000830152613d3081613302565b9050919050565b60006020820190508181036000830152613d5081613368565b9050919050565b60006020820190508181036000830152613d70816133a8565b9050919050565b60006020820190508181036000830152613d90816133e8565b9050919050565b60006020820190508181036000830152613db081613428565b9050919050565b60006020820190508181036000830152613dd081613468565b9050919050565b60006020820190508181036000830152613df0816134ce565b9050919050565b60006020820190508181036000830152613e108161350e565b9050919050565b60006020820190508181036000830152613e3081613574565b9050919050565b60006020820190508181036000830152613e50816135b4565b9050919050565b60006020820190508181036000830152613e70816135f4565b9050919050565b60006020820190508181036000830152613e9081613634565b9050919050565b60006020820190508181036000830152613eb081613674565b9050919050565b60006020820190508181036000830152613ed0816136b4565b9050919050565b60006020820190508181036000830152613ef0816136f4565b9050919050565b60006020820190508181036000830152613f1081613734565b9050919050565b60006020820190508181036000830152613f3081613774565b9050919050565b60006020820190508181036000830152613f50816137b4565b9050919050565b60006020820190508181036000830152613f70816137f4565b9050919050565b60006020820190508181036000830152613f908161385a565b9050919050565b60006020820190508181036000830152613fb08161389a565b9050919050565b6000602082019050613fcc6000830184613964565b92915050565b60008083356001602003843603038112613feb57600080fd5b80840192508235915067ffffffffffffffff82111561400957600080fd5b60208301925060018202360383131561402157600080fd5b509250929050565b6000604051905081810181811067ffffffffffffffff821117156140505761404f6142df565b5b8060405250919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b60006140db826141e7565b9050919050565b60008115159050919050565b60007fff0000000000000000000000000000000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffff0000000000000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffffffffffffff000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffffffffffffffffffffffff00000000000000000000000082169050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b60008190506141e2826142ff565b919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600061421c82614223565b9050919050565b600061422e826141e7565b9050919050565b6000614240826141d4565b9050919050565b82818337600083830152505050565b60005b83811015614274578082015181840152602081019050614259565b83811115614283576000848401525b50505050565b6000614294826142cd565b9050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b60006142d8826142f2565b9050919050565bfe5b6000601f19601f8301169050919050565b60008160601b9050919050565b600381106143105761430f6142df565b5b50565b61431c816140d0565b811461432757600080fd5b50565b614333816140e2565b811461433e57600080fd5b50565b61434a8161419e565b811461435557600080fd5b50565b614361816141a8565b811461436c57600080fd5b50565b6003811061437c57600080fd5b50565b61438881614207565b811461439357600080fd5b5056fea26469706673582212202dadc0d09d62f32774ff0e2d49549f8768c210a71ba59d9013abe0c5a6bef31064736f6c63430007030033", + "devdoc": { + "events": { + "LockedTokensReceivedFromL1(address,address,uint256)": { + "details": "Emitted when locked tokens are received from L1 (whether the wallet had already been received or not)" + }, + "TokenLockCreatedFromL1(address,bytes32,address,uint256,uint256,uint256,address)": { + "details": "Event emitted when a wallet is received and created from L1" + } + }, + "kind": "dev", + "methods": { + "addTokenDestination(address)": { + "params": { + "_dst": "Destination address" + } + }, + "constructor": { + "params": { + "_graphToken": "Address of the L2 GRT token contract", + "_l1TransferTool": "Address of the L1 transfer tool contract (in L1, without aliasing)", + "_l2Gateway": "Address of the L2GraphTokenGateway contract", + "_masterCopy": "Address of the master copy of the L2GraphTokenLockWallet implementation" + } + }, + "createTokenLockWallet(address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)": { + "params": { + "_beneficiary": "Address of the beneficiary of locked tokens", + "_endTime": "End time of the release schedule", + "_managedAmount": "Amount of tokens to be managed by the lock contract", + "_owner": "Address of the contract owner", + "_periods": "Number of periods between start time and end time", + "_releaseStartTime": "Override time for when the releases start", + "_revocable": "Whether the contract is revocable", + "_startTime": "Start time of the release schedule" + } + }, + "deposit(uint256)": { + "details": "Even if the ERC20 token can be transferred directly to the contract this function provide a safe interface to do the transfer and avoid mistakes", + "params": { + "_amount": "Amount to deposit" + } + }, + "getAuthFunctionCallTarget(bytes4)": { + "params": { + "_sigHash": "Function signature hash" + }, + "returns": { + "_0": "Address of the target contract where to send the call" + } + }, + "getDeploymentAddress(bytes32,address)": { + "details": "Uses address(this) as deployer to compute the address. Only for backwards compatibility.", + "params": { + "_implementation": "Address of the proxy target implementation", + "_salt": "Bytes32 salt to use for CREATE2" + }, + "returns": { + "_0": "Address of the counterfactual MinimalProxy" + } + }, + "getDeploymentAddress(bytes32,address,address)": { + "params": { + "_deployer": "Address of the deployer that creates the contract", + "_implementation": "Address of the proxy target implementation", + "_salt": "Bytes32 salt to use for CREATE2" + }, + "returns": { + "_0": "Address of the counterfactual MinimalProxy" + } + }, + "getTokenDestinations()": { + "returns": { + "_0": "Array of addresses authorized to pull funds from a token lock" + } + }, + "isAuthFunctionCall(bytes4)": { + "params": { + "_sigHash": "Function signature hash" + }, + "returns": { + "_0": "True if authorized" + } + }, + "isTokenDestination(address)": { + "params": { + "_dst": "Destination address" + }, + "returns": { + "_0": "True if authorized" + } + }, + "onTokenTransfer(address,uint256,bytes)": { + "details": "This function will create a new wallet if it doesn't exist yet, or send the tokens to the existing wallet if it does.", + "params": { + "_amount": "Amount of tokens received", + "_data": "Encoded data of the transferred wallet, which must be an ABI-encoded TransferredWalletData struct", + "_from": "Address of the sender in L1, which must be the L1GraphTokenLockTransferTool" + } + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "removeTokenDestination(address)": { + "params": { + "_dst": "Destination address" + } + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." + }, + "setAuthFunctionCall(string,address)": { + "details": "Input expected is the function signature as 'transfer(address,uint256)'", + "params": { + "_signature": "Function signature", + "_target": "Address of the destination contract to call" + } + }, + "setAuthFunctionCallMany(string[],address[])": { + "details": "Input expected is the function signature as 'transfer(address,uint256)'", + "params": { + "_signatures": "Function signatures", + "_targets": "Address of the destination contract to call" + } + }, + "setMasterCopy(address)": { + "params": { + "_masterCopy": "Address of contract bytecode to factory clone" + } + }, + "token()": { + "returns": { + "_0": "Token used for transfers and approvals" + } + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + }, + "unsetAuthFunctionCall(string)": { + "details": "Input expected is the function signature as 'transfer(address,uint256)'", + "params": { + "_signature": "Function signature" + } + }, + "withdraw(uint256)": { + "details": "Escape hatch in case of mistakes or to recover remaining funds", + "params": { + "_amount": "Amount of tokens to withdraw" + } + } + }, + "title": "L2GraphTokenLockManager", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "addTokenDestination(address)": { + "notice": "Adds an address that can be allowed by a token lock to pull funds" + }, + "constructor": { + "notice": "Constructor for the L2GraphTokenLockManager contract." + }, + "createTokenLockWallet(address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)": { + "notice": "Creates and fund a new token lock wallet using a minimum proxy" + }, + "deposit(uint256)": { + "notice": "Deposits tokens into the contract" + }, + "getAuthFunctionCallTarget(bytes4)": { + "notice": "Gets the target contract to call for a particular function signature" + }, + "getDeploymentAddress(bytes32,address)": { + "notice": "Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation" + }, + "getDeploymentAddress(bytes32,address,address)": { + "notice": "Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation" + }, + "getTokenDestinations()": { + "notice": "Returns an array of authorized destination addresses" + }, + "isAuthFunctionCall(bytes4)": { + "notice": "Returns true if the function call is authorized" + }, + "isTokenDestination(address)": { + "notice": "Returns True if the address is authorized to be a destination of tokens" + }, + "l1TransferTool()": { + "notice": "Address of the L1 transfer tool contract (in L1, no aliasing)" + }, + "l1WalletToL2Wallet(address)": { + "notice": "Mapping of each L1 wallet to its L2 wallet counterpart (populated when each wallet is received) L1 address => L2 address" + }, + "l2Gateway()": { + "notice": "Address of the L2GraphTokenGateway" + }, + "l2WalletToL1Wallet(address)": { + "notice": "Mapping of each L2 wallet to its L1 wallet counterpart (populated when each wallet is received) L2 address => L1 address" + }, + "onTokenTransfer(address,uint256,bytes)": { + "notice": "This function is called by the L2GraphTokenGateway when tokens are sent from L1." + }, + "removeTokenDestination(address)": { + "notice": "Removes an address that can be allowed by a token lock to pull funds" + }, + "setAuthFunctionCall(string,address)": { + "notice": "Sets an authorized function call to target" + }, + "setAuthFunctionCallMany(string[],address[])": { + "notice": "Sets an authorized function call to target in bulk" + }, + "setMasterCopy(address)": { + "notice": "Sets the masterCopy bytecode to use to create clones of TokenLock contracts" + }, + "token()": { + "notice": "Gets the GRT token address" + }, + "unsetAuthFunctionCall(string)": { + "notice": "Unsets an authorized function call to target" + }, + "withdraw(uint256)": { + "notice": "Withdraws tokens from the contract" + } + }, + "notice": "This contract manages a list of authorized function calls and targets that can be called by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts. This contract receives funds to make the process of creating TokenLockWallet contracts easier by distributing them the initial tokens to be managed. In particular, this L2 variant is designed to receive token lock wallets from L1, through the GRT bridge. These transferred wallets will not allow releasing funds in L2 until the end of the vesting timeline, but they can allow withdrawing funds back to L1 using the L2GraphTokenLockTransferTool contract. The owner can setup a list of token destinations that will be used by TokenLock contracts to approve the pulling of funds, this way in can be guaranteed that only protocol contracts will manipulate users funds.", + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 672, + "contract": "contracts/L2GraphTokenLockManager.sol:L2GraphTokenLockManager", + "label": "_owner", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 3988, + "contract": "contracts/L2GraphTokenLockManager.sol:L2GraphTokenLockManager", + "label": "authFnCalls", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_bytes4,t_address)" + }, + { + "astId": 3990, + "contract": "contracts/L2GraphTokenLockManager.sol:L2GraphTokenLockManager", + "label": "_tokenDestinations", + "offset": 0, + "slot": "2", + "type": "t_struct(AddressSet)2629_storage" + }, + { + "astId": 3992, + "contract": "contracts/L2GraphTokenLockManager.sol:L2GraphTokenLockManager", + "label": "masterCopy", + "offset": 0, + "slot": "4", + "type": "t_address" + }, + { + "astId": 3994, + "contract": "contracts/L2GraphTokenLockManager.sol:L2GraphTokenLockManager", + "label": "_token", + "offset": 0, + "slot": "5", + "type": "t_contract(IERC20)1710" + }, + { + "astId": 6154, + "contract": "contracts/L2GraphTokenLockManager.sol:L2GraphTokenLockManager", + "label": "l1WalletToL2Wallet", + "offset": 0, + "slot": "6", + "type": "t_mapping(t_address,t_address)" + }, + { + "astId": 6159, + "contract": "contracts/L2GraphTokenLockManager.sol:L2GraphTokenLockManager", + "label": "l2WalletToL1Wallet", + "offset": 0, + "slot": "7", + "type": "t_mapping(t_address,t_address)" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_bytes32)dyn_storage": { + "base": "t_bytes32", + "encoding": "dynamic_array", + "label": "bytes32[]", + "numberOfBytes": "32" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_bytes4": { + "encoding": "inplace", + "label": "bytes4", + "numberOfBytes": "4" + }, + "t_contract(IERC20)1710": { + "encoding": "inplace", + "label": "contract IERC20", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_address)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => address)", + "numberOfBytes": "32", + "value": "t_address" + }, + "t_mapping(t_bytes32,t_uint256)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_mapping(t_bytes4,t_address)": { + "encoding": "mapping", + "key": "t_bytes4", + "label": "mapping(bytes4 => address)", + "numberOfBytes": "32", + "value": "t_address" + }, + "t_struct(AddressSet)2629_storage": { + "encoding": "inplace", + "label": "struct EnumerableSet.AddressSet", + "members": [ + { + "astId": 2628, + "contract": "contracts/L2GraphTokenLockManager.sol:L2GraphTokenLockManager", + "label": "_inner", + "offset": 0, + "slot": "0", + "type": "t_struct(Set)2364_storage" + } + ], + "numberOfBytes": "64" + }, + "t_struct(Set)2364_storage": { + "encoding": "inplace", + "label": "struct EnumerableSet.Set", + "members": [ + { + "astId": 2359, + "contract": "contracts/L2GraphTokenLockManager.sol:L2GraphTokenLockManager", + "label": "_values", + "offset": 0, + "slot": "0", + "type": "t_array(t_bytes32)dyn_storage" + }, + { + "astId": 2363, + "contract": "contracts/L2GraphTokenLockManager.sol:L2GraphTokenLockManager", + "label": "_indexes", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_bytes32,t_uint256)" + } + ], + "numberOfBytes": "64" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} \ No newline at end of file diff --git a/packages/token-distribution/deployments/arbitrum-sepolia/L2GraphTokenLockTransferTool.json b/packages/token-distribution/deployments/arbitrum-sepolia/L2GraphTokenLockTransferTool.json new file mode 100644 index 000000000..b8c71758e --- /dev/null +++ b/packages/token-distribution/deployments/arbitrum-sepolia/L2GraphTokenLockTransferTool.json @@ -0,0 +1,110 @@ +{ + "address": "0xe21cd62E1E0CD68476C47F518980226C0a05fB19", + "abi": [ + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_graphToken", + "type": "address" + }, + { + "internalType": "contract ITokenGateway", + "name": "_l2Gateway", + "type": "address" + }, + { + "internalType": "address", + "name": "_l1GraphToken", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "l1Wallet", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "l2Wallet", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "l2LockManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "LockedFundsSentToL1", + "type": "event" + }, + { + "inputs": [], + "name": "graphToken", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "l1GraphToken", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "l2Gateway", + "outputs": [ + { + "internalType": "contract ITokenGateway", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "withdrawToL1Locked", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x4785cb6bfeae00d727ed1199ad2724772507d6631135c73797069382a58af7d3" +} \ No newline at end of file diff --git a/packages/token-distribution/deployments/arbitrum-sepolia/L2GraphTokenLockWallet.json b/packages/token-distribution/deployments/arbitrum-sepolia/L2GraphTokenLockWallet.json new file mode 100644 index 000000000..b63a7619d --- /dev/null +++ b/packages/token-distribution/deployments/arbitrum-sepolia/L2GraphTokenLockWallet.json @@ -0,0 +1,1156 @@ +{ + "address": "0x45FfA6DaD9F49C5018E5345eAdf6E2e5C7116F64", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "newBeneficiary", + "type": "address" + } + ], + "name": "BeneficiaryChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "LockAccepted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "LockCanceled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_oldManager", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "_newManager", + "type": "address" + } + ], + "name": "ManagerUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "TokenDestinationsApproved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "TokenDestinationsRevoked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensReleased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensRevoked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensWithdrawn", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "acceptLock", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "amountPerPeriod", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "approveProtocol", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "availableAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "beneficiary", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "cancelLock", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newBeneficiary", + "type": "address" + } + ], + "name": "changeBeneficiary", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "currentBalance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "currentPeriod", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "currentTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "duration", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "endTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_manager", + "type": "address" + }, + { + "internalType": "address", + "name": "_owner", + "type": "address" + }, + { + "internalType": "address", + "name": "_beneficiary", + "type": "address" + }, + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_managedAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_startTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_endTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_periods", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_releaseStartTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_vestingCliffTime", + "type": "uint256" + }, + { + "internalType": "enum IGraphTokenLock.Revocability", + "name": "_revocable", + "type": "uint8" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_manager", + "type": "address" + }, + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "components": [ + { + "internalType": "address", + "name": "l1Address", + "type": "address" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "internalType": "uint256", + "name": "managedAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "startTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "endTime", + "type": "uint256" + } + ], + "internalType": "struct L2GraphTokenLockManager.TransferredWalletData", + "name": "_walletData", + "type": "tuple" + } + ], + "name": "initializeFromL1", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "isAccepted", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isInitialized", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isRevoked", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "managedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "manager", + "outputs": [ + { + "internalType": "contract IGraphTokenLockManager", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "passedPeriods", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "periodDuration", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "periods", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "releasableAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "release", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "releaseStartTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "releasedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "revocable", + "outputs": [ + { + "internalType": "enum IGraphTokenLock.Revocability", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "revoke", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "revokeProtocol", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "revokedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newManager", + "type": "address" + } + ], + "name": "setManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "sinceStartTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "startTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "surplusAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "token", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalOutstandingAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "usedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "vestedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "vestingCliffTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "withdrawSurplus", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0xc397d5636ef92c873da6587fc0124b89c87f7b12a8fa9c953868da0d501a5d05", + "receipt": { + "to": null, + "from": "0xadE6B8EB69a49B56929C1d4F4b428d791861dB6f", + "contractAddress": "0x45FfA6DaD9F49C5018E5345eAdf6E2e5C7116F64", + "transactionIndex": 1, + "gasUsed": "4063753", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x85b790be25ea48fba17a32160b852c89d43e36971a6a1732139f0c78483f96ea", + "transactionHash": "0xc397d5636ef92c873da6587fc0124b89c87f7b12a8fa9c953868da0d501a5d05", + "logs": [], + "blockNumber": 674827, + "cumulativeGasUsed": "4063753", + "status": 1, + "byzantium": true + }, + "args": [], + "solcInputHash": "095bd30babc75057be19228ca1fd7aa4", + "metadata": "{\"compiler\":{\"version\":\"0.7.3+commit.9bfce1f6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newBeneficiary\",\"type\":\"address\"}],\"name\":\"BeneficiaryChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"LockAccepted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"LockCanceled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_oldManager\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_newManager\",\"type\":\"address\"}],\"name\":\"ManagerUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"TokenDestinationsApproved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"TokenDestinationsRevoked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensReleased\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensRevoked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensWithdrawn\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"acceptLock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"amountPerPeriod\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"approveProtocol\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"availableAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"beneficiary\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"cancelLock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_newBeneficiary\",\"type\":\"address\"}],\"name\":\"changeBeneficiary\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"currentBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"currentPeriod\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"currentTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"duration\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"endTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_manager\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_beneficiary\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_managedAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_startTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_endTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_periods\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_releaseStartTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_vestingCliffTime\",\"type\":\"uint256\"},{\"internalType\":\"enum IGraphTokenLock.Revocability\",\"name\":\"_revocable\",\"type\":\"uint8\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_manager\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_token\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"l1Address\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"managedAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"startTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"endTime\",\"type\":\"uint256\"}],\"internalType\":\"struct L2GraphTokenLockManager.TransferredWalletData\",\"name\":\"_walletData\",\"type\":\"tuple\"}],\"name\":\"initializeFromL1\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isAccepted\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isInitialized\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isRevoked\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"managedAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"manager\",\"outputs\":[{\"internalType\":\"contract IGraphTokenLockManager\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"passedPeriods\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"periodDuration\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"periods\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"releasableAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"release\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"releaseStartTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"releasedAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"revocable\",\"outputs\":[{\"internalType\":\"enum IGraphTokenLock.Revocability\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"revoke\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"revokeProtocol\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"revokedAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_newManager\",\"type\":\"address\"}],\"name\":\"setManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"sinceStartTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"startTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"surplusAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalOutstandingAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"usedAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"vestedAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"vestingCliffTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdrawSurplus\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"acceptLock()\":{\"details\":\"Can only be called by the beneficiary\"},\"amountPerPeriod()\":{\"returns\":{\"_0\":\"Amount of tokens available after each period\"}},\"approveProtocol()\":{\"details\":\"Approves all token destinations registered in the manager to pull tokens\"},\"availableAmount()\":{\"details\":\"Implements the step-by-step schedule based on periods for available tokens\",\"returns\":{\"_0\":\"Amount of tokens available according to the schedule\"}},\"cancelLock()\":{\"details\":\"Can only be called by the owner\"},\"changeBeneficiary(address)\":{\"details\":\"Can only be called by the beneficiary\",\"params\":{\"_newBeneficiary\":\"Address of the new beneficiary address\"}},\"currentBalance()\":{\"returns\":{\"_0\":\"Tokens held in the contract\"}},\"currentPeriod()\":{\"returns\":{\"_0\":\"A number that represents the current period\"}},\"currentTime()\":{\"returns\":{\"_0\":\"Current block timestamp\"}},\"duration()\":{\"returns\":{\"_0\":\"Amount of seconds from contract startTime to endTime\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"passedPeriods()\":{\"returns\":{\"_0\":\"A number of periods that passed since the schedule started\"}},\"periodDuration()\":{\"returns\":{\"_0\":\"Duration of each period in seconds\"}},\"releasableAmount()\":{\"details\":\"Considers the schedule, takes into account already released tokens and used amount\",\"returns\":{\"_0\":\"Amount of tokens ready to be released\"}},\"release()\":{\"details\":\"All available releasable tokens are transferred to beneficiary\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"revoke()\":{\"details\":\"Vesting schedule is always calculated based on managed tokens\"},\"revokeProtocol()\":{\"details\":\"Revokes approval to all token destinations in the manager to pull tokens\"},\"setManager(address)\":{\"params\":{\"_newManager\":\"Address of the new manager\"}},\"sinceStartTime()\":{\"details\":\"Returns zero if called before conctract starTime\",\"returns\":{\"_0\":\"Seconds elapsed from contract startTime\"}},\"surplusAmount()\":{\"details\":\"All funds over outstanding amount is considered surplus that can be withdrawn by beneficiary. Note this might not be the correct value for wallets transferred to L2 (i.e. an L2GraphTokenLockWallet), as the released amount will be skewed, so the beneficiary might have to bridge back to L1 to release the surplus.\",\"returns\":{\"_0\":\"Amount of tokens considered as surplus\"}},\"totalOutstandingAmount()\":{\"details\":\"Does not consider schedule but just global amounts tracked\",\"returns\":{\"_0\":\"Amount of outstanding tokens for the lifetime of the contract\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"vestedAmount()\":{\"details\":\"Similar to available amount, but is fully vested when contract is non-revocable\",\"returns\":{\"_0\":\"Amount of tokens already vested\"}},\"withdrawSurplus(uint256)\":{\"details\":\"Tokens in the contract over outstanding amount are considered as surplus\",\"params\":{\"_amount\":\"Amount of tokens to withdraw\"}}},\"title\":\"L2GraphTokenLockWallet\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"acceptLock()\":{\"notice\":\"Beneficiary accepts the lock, the owner cannot retrieve back the tokens\"},\"amountPerPeriod()\":{\"notice\":\"Returns amount available to be released after each period according to schedule\"},\"approveProtocol()\":{\"notice\":\"Approves protocol access of the tokens managed by this contract\"},\"availableAmount()\":{\"notice\":\"Gets the currently available token according to the schedule\"},\"cancelLock()\":{\"notice\":\"Owner cancel the lock and return the balance in the contract\"},\"changeBeneficiary(address)\":{\"notice\":\"Change the beneficiary of funds managed by the contract\"},\"currentBalance()\":{\"notice\":\"Returns the amount of tokens currently held by the contract\"},\"currentPeriod()\":{\"notice\":\"Gets the current period based on the schedule\"},\"currentTime()\":{\"notice\":\"Returns the current block timestamp\"},\"duration()\":{\"notice\":\"Gets duration of contract from start to end in seconds\"},\"passedPeriods()\":{\"notice\":\"Gets the number of periods that passed since the first period\"},\"periodDuration()\":{\"notice\":\"Returns the duration of each period in seconds\"},\"releasableAmount()\":{\"notice\":\"Gets tokens currently available for release\"},\"release()\":{\"notice\":\"Releases tokens based on the configured schedule\"},\"revoke()\":{\"notice\":\"Revokes a vesting schedule and return the unvested tokens to the owner\"},\"revokeProtocol()\":{\"notice\":\"Revokes protocol access of the tokens managed by this contract\"},\"setManager(address)\":{\"notice\":\"Sets a new manager for this contract\"},\"sinceStartTime()\":{\"notice\":\"Gets time elapsed since the start of the contract\"},\"surplusAmount()\":{\"notice\":\"Gets surplus amount in the contract based on outstanding amount to release\"},\"totalOutstandingAmount()\":{\"notice\":\"Gets the outstanding amount yet to be released based on the whole contract lifetime\"},\"vestedAmount()\":{\"notice\":\"Gets the amount of currently vested tokens\"},\"withdrawSurplus(uint256)\":{\"notice\":\"Withdraws surplus, unmanaged tokens from the contract\"}},\"notice\":\"This contract is built on top of the base GraphTokenLock functionality. It allows wallet beneficiaries to use the deposited funds to perform specific function calls on specific contracts. The idea is that supporters with locked tokens can participate in the protocol but disallow any release before the vesting/lock schedule. The beneficiary can issue authorized function calls to this contract that will get forwarded to a target contract. A target contract is any of our protocol contracts. The function calls allowed are queried to the GraphTokenLockManager, this way the same configuration can be shared for all the created lock wallet contracts. This L2 variant includes a special initializer so that it can be created from a wallet's data received from L1. These transferred wallets will not allow releasing funds in L2 until the end of the vesting timeline, but they can allow withdrawing funds back to L1 using the L2GraphTokenLockTransferTool contract. Note that surplusAmount and releasedAmount in L2 will be skewed for wallets received from L1, so releasing surplus tokens might also only be possible by bridging tokens back to L1. NOTE: Contracts used as target must have its function signatures checked to avoid collisions with any of this contract functions. Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience the maximum amount of tokens is authorized. Function calls do not forward ETH value so DO NOT SEND ETH TO THIS CONTRACT.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/L2GraphTokenLockWallet.sol\":\"L2GraphTokenLockWallet\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor () internal {\\n address msgSender = _msgSender();\\n _owner = msgSender;\\n emit OwnershipTransferred(address(0), msgSender);\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n emit OwnershipTransferred(_owner, address(0));\\n _owner = address(0);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n emit OwnershipTransferred(_owner, newOwner);\\n _owner = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0x15e2d5bd4c28a88548074c54d220e8086f638a71ed07e6b3ba5a70066fcf458d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/math/SafeMath.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Wrappers over Solidity's arithmetic operations with added overflow\\n * checks.\\n *\\n * Arithmetic operations in Solidity wrap on overflow. This can easily result\\n * in bugs, because programmers usually assume that an overflow raises an\\n * error, which is the standard behavior in high level programming languages.\\n * `SafeMath` restores this intuition by reverting the transaction when an\\n * operation overflows.\\n *\\n * Using this library instead of the unchecked operations eliminates an entire\\n * class of bugs, so it's recommended to use it always.\\n */\\nlibrary SafeMath {\\n /**\\n * @dev Returns the addition of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n uint256 c = a + b;\\n if (c < a) return (false, 0);\\n return (true, c);\\n }\\n\\n /**\\n * @dev Returns the substraction of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b > a) return (false, 0);\\n return (true, a - b);\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\\n if (a == 0) return (true, 0);\\n uint256 c = a * b;\\n if (c / a != b) return (false, 0);\\n return (true, c);\\n }\\n\\n /**\\n * @dev Returns the division of two unsigned integers, with a division by zero flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b == 0) return (false, 0);\\n return (true, a / b);\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b == 0) return (false, 0);\\n return (true, a % b);\\n }\\n\\n /**\\n * @dev Returns the addition of two unsigned integers, reverting on\\n * overflow.\\n *\\n * Counterpart to Solidity's `+` operator.\\n *\\n * Requirements:\\n *\\n * - Addition cannot overflow.\\n */\\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\\n uint256 c = a + b;\\n require(c >= a, \\\"SafeMath: addition overflow\\\");\\n return c;\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting on\\n * overflow (when the result is negative).\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n *\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b <= a, \\\"SafeMath: subtraction overflow\\\");\\n return a - b;\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, reverting on\\n * overflow.\\n *\\n * Counterpart to Solidity's `*` operator.\\n *\\n * Requirements:\\n *\\n * - Multiplication cannot overflow.\\n */\\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\\n if (a == 0) return 0;\\n uint256 c = a * b;\\n require(c / a == b, \\\"SafeMath: multiplication overflow\\\");\\n return c;\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers, reverting on\\n * division by zero. The result is rounded towards zero.\\n *\\n * Counterpart to Solidity's `/` operator. Note: this function uses a\\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\\n * uses an invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b > 0, \\\"SafeMath: division by zero\\\");\\n return a / b;\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * reverting when dividing by zero.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b > 0, \\\"SafeMath: modulo by zero\\\");\\n return a % b;\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\\n * overflow (when the result is negative).\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {trySub}.\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n *\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b <= a, errorMessage);\\n return a - b;\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers, reverting with custom message on\\n * division by zero. The result is rounded towards zero.\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {tryDiv}.\\n *\\n * Counterpart to Solidity's `/` operator. Note: this function uses a\\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\\n * uses an invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b > 0, errorMessage);\\n return a / b;\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * reverting with custom message when dividing by zero.\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {tryMod}.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b > 0, errorMessage);\\n return a % b;\\n }\\n}\\n\",\"keccak256\":\"0xcc78a17dd88fa5a2edc60c8489e2f405c0913b377216a5b26b35656b2d0dab52\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `recipient`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address recipient, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `sender` to `recipient` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n}\\n\",\"keccak256\":\"0x5f02220344881ce43204ae4a6281145a67bc52c2bb1290a791857df3d19d78f5\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\nimport \\\"./IERC20.sol\\\";\\nimport \\\"../../math/SafeMath.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @title SafeERC20\\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\\n * contract returns false). Tokens that return no value (and instead revert or\\n * throw on failure) are also supported, non-reverting calls are assumed to be\\n * successful.\\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\n */\\nlibrary SafeERC20 {\\n using SafeMath for uint256;\\n using Address for address;\\n\\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\\n }\\n\\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\\n }\\n\\n /**\\n * @dev Deprecated. This function has issues similar to the ones found in\\n * {IERC20-approve}, and its usage is discouraged.\\n *\\n * Whenever possible, use {safeIncreaseAllowance} and\\n * {safeDecreaseAllowance} instead.\\n */\\n function safeApprove(IERC20 token, address spender, uint256 value) internal {\\n // safeApprove should only be called when setting an initial allowance,\\n // or when resetting it to zero. To increase and decrease it, use\\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\\n // solhint-disable-next-line max-line-length\\n require((value == 0) || (token.allowance(address(this), spender) == 0),\\n \\\"SafeERC20: approve from non-zero to non-zero allowance\\\"\\n );\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\\n }\\n\\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n uint256 newAllowance = token.allowance(address(this), spender).add(value);\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n uint256 newAllowance = token.allowance(address(this), spender).sub(value, \\\"SafeERC20: decreased allowance below zero\\\");\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n */\\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that\\n // the target address contains contract code and also asserts for success in the low-level call.\\n\\n bytes memory returndata = address(token).functionCall(data, \\\"SafeERC20: low-level call failed\\\");\\n if (returndata.length > 0) { // Return data is optional\\n // solhint-disable-next-line max-line-length\\n require(abi.decode(returndata, (bool)), \\\"SafeERC20: ERC20 operation did not succeed\\\");\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf12dfbe97e6276980b83d2830bb0eb75e0cf4f3e626c2471137f82158ae6a0fc\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.2 <0.8.0;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize, which returns 0 for contracts in\\n // construction, since the code is only stored at the end of the\\n // constructor execution.\\n\\n uint256 size;\\n // solhint-disable-next-line no-inline-assembly\\n assembly { size := extcodesize(account) }\\n return size > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls, avoid-call-value\\n (bool success, ) = recipient.call{ value: amount }(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain`call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.call{ value: value }(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x28911e614500ae7c607a432a709d35da25f3bc5ddc8bd12b278b66358070c0ea\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/*\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with GSN meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address payable) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes memory) {\\n this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0x8d3cb350f04ff49cfb10aef08d87f19dcbaecc8027b0bed12f3275cd12f38cf0\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Create2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Helper to make usage of the `CREATE2` EVM opcode easier and safer.\\n * `CREATE2` can be used to compute in advance the address where a smart\\n * contract will be deployed, which allows for interesting new mechanisms known\\n * as 'counterfactual interactions'.\\n *\\n * See the https://eips.ethereum.org/EIPS/eip-1014#motivation[EIP] for more\\n * information.\\n */\\nlibrary Create2 {\\n /**\\n * @dev Deploys a contract using `CREATE2`. The address where the contract\\n * will be deployed can be known in advance via {computeAddress}.\\n *\\n * The bytecode for a contract can be obtained from Solidity with\\n * `type(contractName).creationCode`.\\n *\\n * Requirements:\\n *\\n * - `bytecode` must not be empty.\\n * - `salt` must have not been used for `bytecode` already.\\n * - the factory must have a balance of at least `amount`.\\n * - if `amount` is non-zero, `bytecode` must have a `payable` constructor.\\n */\\n function deploy(uint256 amount, bytes32 salt, bytes memory bytecode) internal returns (address) {\\n address addr;\\n require(address(this).balance >= amount, \\\"Create2: insufficient balance\\\");\\n require(bytecode.length != 0, \\\"Create2: bytecode length is zero\\\");\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n addr := create2(amount, add(bytecode, 0x20), mload(bytecode), salt)\\n }\\n require(addr != address(0), \\\"Create2: Failed on deploy\\\");\\n return addr;\\n }\\n\\n /**\\n * @dev Returns the address where a contract will be stored if deployed via {deploy}. Any change in the\\n * `bytecodeHash` or `salt` will result in a new destination address.\\n */\\n function computeAddress(bytes32 salt, bytes32 bytecodeHash) internal view returns (address) {\\n return computeAddress(salt, bytecodeHash, address(this));\\n }\\n\\n /**\\n * @dev Returns the address where a contract will be stored if deployed via {deploy} from a contract located at\\n * `deployer`. If `deployer` is this contract's address, returns the same value as {computeAddress}.\\n */\\n function computeAddress(bytes32 salt, bytes32 bytecodeHash, address deployer) internal pure returns (address) {\\n bytes32 _data = keccak256(\\n abi.encodePacked(bytes1(0xff), deployer, salt, bytecodeHash)\\n );\\n return address(uint160(uint256(_data)));\\n }\\n}\\n\",\"keccak256\":\"0x0a0b021149946014fe1cd04af11e7a937a29986c47e8b1b718c2d50d729472db\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/EnumerableSet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Library for managing\\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\\n * types.\\n *\\n * Sets have the following properties:\\n *\\n * - Elements are added, removed, and checked for existence in constant time\\n * (O(1)).\\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\\n *\\n * ```\\n * contract Example {\\n * // Add the library methods\\n * using EnumerableSet for EnumerableSet.AddressSet;\\n *\\n * // Declare a set state variable\\n * EnumerableSet.AddressSet private mySet;\\n * }\\n * ```\\n *\\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\\n * and `uint256` (`UintSet`) are supported.\\n */\\nlibrary EnumerableSet {\\n // To implement this library for multiple types with as little code\\n // repetition as possible, we write it in terms of a generic Set type with\\n // bytes32 values.\\n // The Set implementation uses private functions, and user-facing\\n // implementations (such as AddressSet) are just wrappers around the\\n // underlying Set.\\n // This means that we can only create new EnumerableSets for types that fit\\n // in bytes32.\\n\\n struct Set {\\n // Storage of set values\\n bytes32[] _values;\\n\\n // Position of the value in the `values` array, plus 1 because index 0\\n // means a value is not in the set.\\n mapping (bytes32 => uint256) _indexes;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function _add(Set storage set, bytes32 value) private returns (bool) {\\n if (!_contains(set, value)) {\\n set._values.push(value);\\n // The value is stored at length-1, but we add 1 to all indexes\\n // and use 0 as a sentinel value\\n set._indexes[value] = set._values.length;\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function _remove(Set storage set, bytes32 value) private returns (bool) {\\n // We read and store the value's index to prevent multiple reads from the same storage slot\\n uint256 valueIndex = set._indexes[value];\\n\\n if (valueIndex != 0) { // Equivalent to contains(set, value)\\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\\n // the array, and then remove the last element (sometimes called as 'swap and pop').\\n // This modifies the order of the array, as noted in {at}.\\n\\n uint256 toDeleteIndex = valueIndex - 1;\\n uint256 lastIndex = set._values.length - 1;\\n\\n // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs\\n // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.\\n\\n bytes32 lastvalue = set._values[lastIndex];\\n\\n // Move the last value to the index where the value to delete is\\n set._values[toDeleteIndex] = lastvalue;\\n // Update the index for the moved value\\n set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based\\n\\n // Delete the slot where the moved value was stored\\n set._values.pop();\\n\\n // Delete the index for the deleted slot\\n delete set._indexes[value];\\n\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\\n return set._indexes[value] != 0;\\n }\\n\\n /**\\n * @dev Returns the number of values on the set. O(1).\\n */\\n function _length(Set storage set) private view returns (uint256) {\\n return set._values.length;\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\\n require(set._values.length > index, \\\"EnumerableSet: index out of bounds\\\");\\n return set._values[index];\\n }\\n\\n // Bytes32Set\\n\\n struct Bytes32Set {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _add(set._inner, value);\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _remove(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\\n return _contains(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(Bytes32Set storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\\n return _at(set._inner, index);\\n }\\n\\n // AddressSet\\n\\n struct AddressSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(AddressSet storage set, address value) internal returns (bool) {\\n return _add(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(AddressSet storage set, address value) internal returns (bool) {\\n return _remove(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(AddressSet storage set, address value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(AddressSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\\n return address(uint160(uint256(_at(set._inner, index))));\\n }\\n\\n\\n // UintSet\\n\\n struct UintSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(UintSet storage set, uint256 value) internal returns (bool) {\\n return _add(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\\n return _remove(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns the number of values on the set. O(1).\\n */\\n function length(UintSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\\n return uint256(_at(set._inner, index));\\n }\\n}\\n\",\"keccak256\":\"0x1562cd9922fbf739edfb979f506809e2743789cbde3177515542161c3d04b164\",\"license\":\"MIT\"},\"contracts/GraphTokenLock.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nimport \\\"@openzeppelin/contracts/math/SafeMath.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\\\";\\n\\nimport { Ownable as OwnableInitializable } from \\\"./Ownable.sol\\\";\\nimport \\\"./MathUtils.sol\\\";\\nimport \\\"./IGraphTokenLock.sol\\\";\\n\\n/**\\n * @title GraphTokenLock\\n * @notice Contract that manages an unlocking schedule of tokens.\\n * @dev The contract lock manage a number of tokens deposited into the contract to ensure that\\n * they can only be released under certain time conditions.\\n *\\n * This contract implements a release scheduled based on periods and tokens are released in steps\\n * after each period ends. It can be configured with one period in which case it is like a plain TimeLock.\\n * It also supports revocation to be used for vesting schedules.\\n *\\n * The contract supports receiving extra funds than the managed tokens ones that can be\\n * withdrawn by the beneficiary at any time.\\n *\\n * A releaseStartTime parameter is included to override the default release schedule and\\n * perform the first release on the configured time. After that it will continue with the\\n * default schedule.\\n */\\nabstract contract GraphTokenLock is OwnableInitializable, IGraphTokenLock {\\n using SafeMath for uint256;\\n using SafeERC20 for IERC20;\\n\\n uint256 private constant MIN_PERIOD = 1;\\n\\n // -- State --\\n\\n IERC20 public token;\\n address public beneficiary;\\n\\n // Configuration\\n\\n // Amount of tokens managed by the contract schedule\\n uint256 public managedAmount;\\n\\n uint256 public startTime; // Start datetime (in unixtimestamp)\\n uint256 public endTime; // Datetime after all funds are fully vested/unlocked (in unixtimestamp)\\n uint256 public periods; // Number of vesting/release periods\\n\\n // First release date for tokens (in unixtimestamp)\\n // If set, no tokens will be released before releaseStartTime ignoring\\n // the amount to release each period\\n uint256 public releaseStartTime;\\n // A cliff set a date to which a beneficiary needs to get to vest\\n // all preceding periods\\n uint256 public vestingCliffTime;\\n Revocability public revocable; // Whether to use vesting for locked funds\\n\\n // State\\n\\n bool public isRevoked;\\n bool public isInitialized;\\n bool public isAccepted;\\n uint256 public releasedAmount;\\n uint256 public revokedAmount;\\n\\n // -- Events --\\n\\n event TokensReleased(address indexed beneficiary, uint256 amount);\\n event TokensWithdrawn(address indexed beneficiary, uint256 amount);\\n event TokensRevoked(address indexed beneficiary, uint256 amount);\\n event BeneficiaryChanged(address newBeneficiary);\\n event LockAccepted();\\n event LockCanceled();\\n\\n /**\\n * @dev Only allow calls from the beneficiary of the contract\\n */\\n modifier onlyBeneficiary() {\\n require(msg.sender == beneficiary, \\\"!auth\\\");\\n _;\\n }\\n\\n /**\\n * @notice Initializes the contract\\n * @param _owner Address of the contract owner\\n * @param _beneficiary Address of the beneficiary of locked tokens\\n * @param _managedAmount Amount of tokens to be managed by the lock contract\\n * @param _startTime Start time of the release schedule\\n * @param _endTime End time of the release schedule\\n * @param _periods Number of periods between start time and end time\\n * @param _releaseStartTime Override time for when the releases start\\n * @param _vestingCliffTime Override time for when the vesting start\\n * @param _revocable Whether the contract is revocable\\n */\\n function _initialize(\\n address _owner,\\n address _beneficiary,\\n address _token,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n Revocability _revocable\\n ) internal {\\n require(!isInitialized, \\\"Already initialized\\\");\\n require(_owner != address(0), \\\"Owner cannot be zero\\\");\\n require(_beneficiary != address(0), \\\"Beneficiary cannot be zero\\\");\\n require(_token != address(0), \\\"Token cannot be zero\\\");\\n require(_managedAmount > 0, \\\"Managed tokens cannot be zero\\\");\\n require(_startTime != 0, \\\"Start time must be set\\\");\\n require(_startTime < _endTime, \\\"Start time > end time\\\");\\n require(_periods >= MIN_PERIOD, \\\"Periods cannot be below minimum\\\");\\n require(_revocable != Revocability.NotSet, \\\"Must set a revocability option\\\");\\n require(_releaseStartTime < _endTime, \\\"Release start time must be before end time\\\");\\n require(_vestingCliffTime < _endTime, \\\"Cliff time must be before end time\\\");\\n\\n isInitialized = true;\\n\\n OwnableInitializable._initialize(_owner);\\n beneficiary = _beneficiary;\\n token = IERC20(_token);\\n\\n managedAmount = _managedAmount;\\n\\n startTime = _startTime;\\n endTime = _endTime;\\n periods = _periods;\\n\\n // Optionals\\n releaseStartTime = _releaseStartTime;\\n vestingCliffTime = _vestingCliffTime;\\n revocable = _revocable;\\n }\\n\\n /**\\n * @notice Change the beneficiary of funds managed by the contract\\n * @dev Can only be called by the beneficiary\\n * @param _newBeneficiary Address of the new beneficiary address\\n */\\n function changeBeneficiary(address _newBeneficiary) external onlyBeneficiary {\\n require(_newBeneficiary != address(0), \\\"Empty beneficiary\\\");\\n beneficiary = _newBeneficiary;\\n emit BeneficiaryChanged(_newBeneficiary);\\n }\\n\\n /**\\n * @notice Beneficiary accepts the lock, the owner cannot retrieve back the tokens\\n * @dev Can only be called by the beneficiary\\n */\\n function acceptLock() external onlyBeneficiary {\\n isAccepted = true;\\n emit LockAccepted();\\n }\\n\\n /**\\n * @notice Owner cancel the lock and return the balance in the contract\\n * @dev Can only be called by the owner\\n */\\n function cancelLock() external onlyOwner {\\n require(isAccepted == false, \\\"Cannot cancel accepted contract\\\");\\n\\n token.safeTransfer(owner(), currentBalance());\\n\\n emit LockCanceled();\\n }\\n\\n // -- Balances --\\n\\n /**\\n * @notice Returns the amount of tokens currently held by the contract\\n * @return Tokens held in the contract\\n */\\n function currentBalance() public view override returns (uint256) {\\n return token.balanceOf(address(this));\\n }\\n\\n // -- Time & Periods --\\n\\n /**\\n * @notice Returns the current block timestamp\\n * @return Current block timestamp\\n */\\n function currentTime() public view override returns (uint256) {\\n return block.timestamp;\\n }\\n\\n /**\\n * @notice Gets duration of contract from start to end in seconds\\n * @return Amount of seconds from contract startTime to endTime\\n */\\n function duration() public view override returns (uint256) {\\n return endTime.sub(startTime);\\n }\\n\\n /**\\n * @notice Gets time elapsed since the start of the contract\\n * @dev Returns zero if called before conctract starTime\\n * @return Seconds elapsed from contract startTime\\n */\\n function sinceStartTime() public view override returns (uint256) {\\n uint256 current = currentTime();\\n if (current <= startTime) {\\n return 0;\\n }\\n return current.sub(startTime);\\n }\\n\\n /**\\n * @notice Returns amount available to be released after each period according to schedule\\n * @return Amount of tokens available after each period\\n */\\n function amountPerPeriod() public view override returns (uint256) {\\n return managedAmount.div(periods);\\n }\\n\\n /**\\n * @notice Returns the duration of each period in seconds\\n * @return Duration of each period in seconds\\n */\\n function periodDuration() public view override returns (uint256) {\\n return duration().div(periods);\\n }\\n\\n /**\\n * @notice Gets the current period based on the schedule\\n * @return A number that represents the current period\\n */\\n function currentPeriod() public view override returns (uint256) {\\n return sinceStartTime().div(periodDuration()).add(MIN_PERIOD);\\n }\\n\\n /**\\n * @notice Gets the number of periods that passed since the first period\\n * @return A number of periods that passed since the schedule started\\n */\\n function passedPeriods() public view override returns (uint256) {\\n return currentPeriod().sub(MIN_PERIOD);\\n }\\n\\n // -- Locking & Release Schedule --\\n\\n /**\\n * @notice Gets the currently available token according to the schedule\\n * @dev Implements the step-by-step schedule based on periods for available tokens\\n * @return Amount of tokens available according to the schedule\\n */\\n function availableAmount() public view override returns (uint256) {\\n uint256 current = currentTime();\\n\\n // Before contract start no funds are available\\n if (current < startTime) {\\n return 0;\\n }\\n\\n // After contract ended all funds are available\\n if (current > endTime) {\\n return managedAmount;\\n }\\n\\n // Get available amount based on period\\n return passedPeriods().mul(amountPerPeriod());\\n }\\n\\n /**\\n * @notice Gets the amount of currently vested tokens\\n * @dev Similar to available amount, but is fully vested when contract is non-revocable\\n * @return Amount of tokens already vested\\n */\\n function vestedAmount() public view override returns (uint256) {\\n // If non-revocable it is fully vested\\n if (revocable == Revocability.Disabled) {\\n return managedAmount;\\n }\\n\\n // Vesting cliff is activated and it has not passed means nothing is vested yet\\n if (vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\\n return 0;\\n }\\n\\n return availableAmount();\\n }\\n\\n /**\\n * @notice Gets tokens currently available for release\\n * @dev Considers the schedule and takes into account already released tokens\\n * @return Amount of tokens ready to be released\\n */\\n function releasableAmount() public view virtual override returns (uint256) {\\n // If a release start time is set no tokens are available for release before this date\\n // If not set it follows the default schedule and tokens are available on\\n // the first period passed\\n if (releaseStartTime > 0 && currentTime() < releaseStartTime) {\\n return 0;\\n }\\n\\n // Vesting cliff is activated and it has not passed means nothing is vested yet\\n // so funds cannot be released\\n if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\\n return 0;\\n }\\n\\n // A beneficiary can never have more releasable tokens than the contract balance\\n uint256 releasable = availableAmount().sub(releasedAmount);\\n return MathUtils.min(currentBalance(), releasable);\\n }\\n\\n /**\\n * @notice Gets the outstanding amount yet to be released based on the whole contract lifetime\\n * @dev Does not consider schedule but just global amounts tracked\\n * @return Amount of outstanding tokens for the lifetime of the contract\\n */\\n function totalOutstandingAmount() public view override returns (uint256) {\\n return managedAmount.sub(releasedAmount).sub(revokedAmount);\\n }\\n\\n /**\\n * @notice Gets surplus amount in the contract based on outstanding amount to release\\n * @dev All funds over outstanding amount is considered surplus that can be withdrawn by beneficiary.\\n * Note this might not be the correct value for wallets transferred to L2 (i.e. an L2GraphTokenLockWallet), as the released amount will be\\n * skewed, so the beneficiary might have to bridge back to L1 to release the surplus.\\n * @return Amount of tokens considered as surplus\\n */\\n function surplusAmount() public view override returns (uint256) {\\n uint256 balance = currentBalance();\\n uint256 outstandingAmount = totalOutstandingAmount();\\n if (balance > outstandingAmount) {\\n return balance.sub(outstandingAmount);\\n }\\n return 0;\\n }\\n\\n // -- Value Transfer --\\n\\n /**\\n * @notice Releases tokens based on the configured schedule\\n * @dev All available releasable tokens are transferred to beneficiary\\n */\\n function release() external override onlyBeneficiary {\\n uint256 amountToRelease = releasableAmount();\\n require(amountToRelease > 0, \\\"No available releasable amount\\\");\\n\\n releasedAmount = releasedAmount.add(amountToRelease);\\n\\n token.safeTransfer(beneficiary, amountToRelease);\\n\\n emit TokensReleased(beneficiary, amountToRelease);\\n }\\n\\n /**\\n * @notice Withdraws surplus, unmanaged tokens from the contract\\n * @dev Tokens in the contract over outstanding amount are considered as surplus\\n * @param _amount Amount of tokens to withdraw\\n */\\n function withdrawSurplus(uint256 _amount) external override onlyBeneficiary {\\n require(_amount > 0, \\\"Amount cannot be zero\\\");\\n require(surplusAmount() >= _amount, \\\"Amount requested > surplus available\\\");\\n\\n token.safeTransfer(beneficiary, _amount);\\n\\n emit TokensWithdrawn(beneficiary, _amount);\\n }\\n\\n /**\\n * @notice Revokes a vesting schedule and return the unvested tokens to the owner\\n * @dev Vesting schedule is always calculated based on managed tokens\\n */\\n function revoke() external override onlyOwner {\\n require(revocable == Revocability.Enabled, \\\"Contract is non-revocable\\\");\\n require(isRevoked == false, \\\"Already revoked\\\");\\n\\n uint256 unvestedAmount = managedAmount.sub(vestedAmount());\\n require(unvestedAmount > 0, \\\"No available unvested amount\\\");\\n\\n revokedAmount = unvestedAmount;\\n isRevoked = true;\\n\\n token.safeTransfer(owner(), unvestedAmount);\\n\\n emit TokensRevoked(beneficiary, unvestedAmount);\\n }\\n}\\n\",\"keccak256\":\"0xd89470956a476c2fcf4a09625775573f95ba2c60a57fe866d90f65de1bcf5f2d\",\"license\":\"MIT\"},\"contracts/GraphTokenLockManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/EnumerableSet.sol\\\";\\nimport { Ownable } from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\n\\nimport \\\"./MinimalProxyFactory.sol\\\";\\nimport \\\"./IGraphTokenLockManager.sol\\\";\\nimport { GraphTokenLockWallet } from \\\"./GraphTokenLockWallet.sol\\\";\\n\\n/**\\n * @title GraphTokenLockManager\\n * @notice This contract manages a list of authorized function calls and targets that can be called\\n * by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts.\\n *\\n * This contract receives funds to make the process of creating TokenLockWallet contracts\\n * easier by distributing them the initial tokens to be managed.\\n *\\n * The owner can setup a list of token destinations that will be used by TokenLock contracts to\\n * approve the pulling of funds, this way in can be guaranteed that only protocol contracts\\n * will manipulate users funds.\\n */\\ncontract GraphTokenLockManager is Ownable, MinimalProxyFactory, IGraphTokenLockManager {\\n using SafeERC20 for IERC20;\\n using EnumerableSet for EnumerableSet.AddressSet;\\n\\n // -- State --\\n\\n mapping(bytes4 => address) public authFnCalls;\\n EnumerableSet.AddressSet private _tokenDestinations;\\n\\n address public masterCopy;\\n IERC20 internal _token;\\n\\n // -- Events --\\n\\n event MasterCopyUpdated(address indexed masterCopy);\\n event TokenLockCreated(\\n address indexed contractAddress,\\n bytes32 indexed initHash,\\n address indexed beneficiary,\\n address token,\\n uint256 managedAmount,\\n uint256 startTime,\\n uint256 endTime,\\n uint256 periods,\\n uint256 releaseStartTime,\\n uint256 vestingCliffTime,\\n IGraphTokenLock.Revocability revocable\\n );\\n\\n event TokensDeposited(address indexed sender, uint256 amount);\\n event TokensWithdrawn(address indexed sender, uint256 amount);\\n\\n event FunctionCallAuth(address indexed caller, bytes4 indexed sigHash, address indexed target, string signature);\\n event TokenDestinationAllowed(address indexed dst, bool allowed);\\n\\n /**\\n * Constructor.\\n * @param _graphToken Token to use for deposits and withdrawals\\n * @param _masterCopy Address of the master copy to use to clone proxies\\n */\\n constructor(IERC20 _graphToken, address _masterCopy) {\\n require(address(_graphToken) != address(0), \\\"Token cannot be zero\\\");\\n _token = _graphToken;\\n setMasterCopy(_masterCopy);\\n }\\n\\n // -- Factory --\\n\\n /**\\n * @notice Sets the masterCopy bytecode to use to create clones of TokenLock contracts\\n * @param _masterCopy Address of contract bytecode to factory clone\\n */\\n function setMasterCopy(address _masterCopy) public override onlyOwner {\\n require(_masterCopy != address(0), \\\"MasterCopy cannot be zero\\\");\\n masterCopy = _masterCopy;\\n emit MasterCopyUpdated(_masterCopy);\\n }\\n\\n /**\\n * @notice Creates and fund a new token lock wallet using a minimum proxy\\n * @param _owner Address of the contract owner\\n * @param _beneficiary Address of the beneficiary of locked tokens\\n * @param _managedAmount Amount of tokens to be managed by the lock contract\\n * @param _startTime Start time of the release schedule\\n * @param _endTime End time of the release schedule\\n * @param _periods Number of periods between start time and end time\\n * @param _releaseStartTime Override time for when the releases start\\n * @param _revocable Whether the contract is revocable\\n */\\n function createTokenLockWallet(\\n address _owner,\\n address _beneficiary,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n IGraphTokenLock.Revocability _revocable\\n ) external override onlyOwner {\\n require(_token.balanceOf(address(this)) >= _managedAmount, \\\"Not enough tokens to create lock\\\");\\n\\n // Create contract using a minimal proxy and call initializer\\n bytes memory initializer = abi.encodeWithSelector(\\n GraphTokenLockWallet.initialize.selector,\\n address(this),\\n _owner,\\n _beneficiary,\\n address(_token),\\n _managedAmount,\\n _startTime,\\n _endTime,\\n _periods,\\n _releaseStartTime,\\n _vestingCliffTime,\\n _revocable\\n );\\n address contractAddress = _deployProxy2(keccak256(initializer), masterCopy, initializer);\\n\\n // Send managed amount to the created contract\\n _token.safeTransfer(contractAddress, _managedAmount);\\n\\n emit TokenLockCreated(\\n contractAddress,\\n keccak256(initializer),\\n _beneficiary,\\n address(_token),\\n _managedAmount,\\n _startTime,\\n _endTime,\\n _periods,\\n _releaseStartTime,\\n _vestingCliffTime,\\n _revocable\\n );\\n }\\n\\n // -- Funds Management --\\n\\n /**\\n * @notice Gets the GRT token address\\n * @return Token used for transfers and approvals\\n */\\n function token() external view override returns (IERC20) {\\n return _token;\\n }\\n\\n /**\\n * @notice Deposits tokens into the contract\\n * @dev Even if the ERC20 token can be transferred directly to the contract\\n * this function provide a safe interface to do the transfer and avoid mistakes\\n * @param _amount Amount to deposit\\n */\\n function deposit(uint256 _amount) external override {\\n require(_amount > 0, \\\"Amount cannot be zero\\\");\\n _token.safeTransferFrom(msg.sender, address(this), _amount);\\n emit TokensDeposited(msg.sender, _amount);\\n }\\n\\n /**\\n * @notice Withdraws tokens from the contract\\n * @dev Escape hatch in case of mistakes or to recover remaining funds\\n * @param _amount Amount of tokens to withdraw\\n */\\n function withdraw(uint256 _amount) external override onlyOwner {\\n require(_amount > 0, \\\"Amount cannot be zero\\\");\\n _token.safeTransfer(msg.sender, _amount);\\n emit TokensWithdrawn(msg.sender, _amount);\\n }\\n\\n // -- Token Destinations --\\n\\n /**\\n * @notice Adds an address that can be allowed by a token lock to pull funds\\n * @param _dst Destination address\\n */\\n function addTokenDestination(address _dst) external override onlyOwner {\\n require(_dst != address(0), \\\"Destination cannot be zero\\\");\\n require(_tokenDestinations.add(_dst), \\\"Destination already added\\\");\\n emit TokenDestinationAllowed(_dst, true);\\n }\\n\\n /**\\n * @notice Removes an address that can be allowed by a token lock to pull funds\\n * @param _dst Destination address\\n */\\n function removeTokenDestination(address _dst) external override onlyOwner {\\n require(_tokenDestinations.remove(_dst), \\\"Destination already removed\\\");\\n emit TokenDestinationAllowed(_dst, false);\\n }\\n\\n /**\\n * @notice Returns True if the address is authorized to be a destination of tokens\\n * @param _dst Destination address\\n * @return True if authorized\\n */\\n function isTokenDestination(address _dst) external view override returns (bool) {\\n return _tokenDestinations.contains(_dst);\\n }\\n\\n /**\\n * @notice Returns an array of authorized destination addresses\\n * @return Array of addresses authorized to pull funds from a token lock\\n */\\n function getTokenDestinations() external view override returns (address[] memory) {\\n address[] memory dstList = new address[](_tokenDestinations.length());\\n for (uint256 i = 0; i < _tokenDestinations.length(); i++) {\\n dstList[i] = _tokenDestinations.at(i);\\n }\\n return dstList;\\n }\\n\\n // -- Function Call Authorization --\\n\\n /**\\n * @notice Sets an authorized function call to target\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @param _signature Function signature\\n * @param _target Address of the destination contract to call\\n */\\n function setAuthFunctionCall(string calldata _signature, address _target) external override onlyOwner {\\n _setAuthFunctionCall(_signature, _target);\\n }\\n\\n /**\\n * @notice Unsets an authorized function call to target\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @param _signature Function signature\\n */\\n function unsetAuthFunctionCall(string calldata _signature) external override onlyOwner {\\n bytes4 sigHash = _toFunctionSigHash(_signature);\\n authFnCalls[sigHash] = address(0);\\n\\n emit FunctionCallAuth(msg.sender, sigHash, address(0), _signature);\\n }\\n\\n /**\\n * @notice Sets an authorized function call to target in bulk\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @param _signatures Function signatures\\n * @param _targets Address of the destination contract to call\\n */\\n function setAuthFunctionCallMany(\\n string[] calldata _signatures,\\n address[] calldata _targets\\n ) external override onlyOwner {\\n require(_signatures.length == _targets.length, \\\"Array length mismatch\\\");\\n\\n for (uint256 i = 0; i < _signatures.length; i++) {\\n _setAuthFunctionCall(_signatures[i], _targets[i]);\\n }\\n }\\n\\n /**\\n * @notice Sets an authorized function call to target\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @dev Function signatures of Graph Protocol contracts to be used are known ahead of time\\n * @param _signature Function signature\\n * @param _target Address of the destination contract to call\\n */\\n function _setAuthFunctionCall(string calldata _signature, address _target) internal {\\n require(_target != address(this), \\\"Target must be other contract\\\");\\n require(Address.isContract(_target), \\\"Target must be a contract\\\");\\n\\n bytes4 sigHash = _toFunctionSigHash(_signature);\\n authFnCalls[sigHash] = _target;\\n\\n emit FunctionCallAuth(msg.sender, sigHash, _target, _signature);\\n }\\n\\n /**\\n * @notice Gets the target contract to call for a particular function signature\\n * @param _sigHash Function signature hash\\n * @return Address of the target contract where to send the call\\n */\\n function getAuthFunctionCallTarget(bytes4 _sigHash) public view override returns (address) {\\n return authFnCalls[_sigHash];\\n }\\n\\n /**\\n * @notice Returns true if the function call is authorized\\n * @param _sigHash Function signature hash\\n * @return True if authorized\\n */\\n function isAuthFunctionCall(bytes4 _sigHash) external view override returns (bool) {\\n return getAuthFunctionCallTarget(_sigHash) != address(0);\\n }\\n\\n /**\\n * @dev Converts a function signature string to 4-bytes hash\\n * @param _signature Function signature string\\n * @return Function signature hash\\n */\\n function _toFunctionSigHash(string calldata _signature) internal pure returns (bytes4) {\\n return _convertToBytes4(abi.encodeWithSignature(_signature));\\n }\\n\\n /**\\n * @dev Converts function signature bytes to function signature hash (bytes4)\\n * @param _signature Function signature\\n * @return Function signature in bytes4\\n */\\n function _convertToBytes4(bytes memory _signature) internal pure returns (bytes4) {\\n require(_signature.length == 4, \\\"Invalid method signature\\\");\\n bytes4 sigHash;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n sigHash := mload(add(_signature, 32))\\n }\\n return sigHash;\\n }\\n}\\n\",\"keccak256\":\"0x2bb51cc1a18bd88113fd6947067ad2fff33048c8904cb54adfda8e2ab86752f2\",\"license\":\"MIT\"},\"contracts/GraphTokenLockWallet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"@openzeppelin/contracts/math/SafeMath.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nimport \\\"./GraphTokenLock.sol\\\";\\nimport \\\"./IGraphTokenLockManager.sol\\\";\\n\\n/**\\n * @title GraphTokenLockWallet\\n * @notice This contract is built on top of the base GraphTokenLock functionality.\\n * It allows wallet beneficiaries to use the deposited funds to perform specific function calls\\n * on specific contracts.\\n *\\n * The idea is that supporters with locked tokens can participate in the protocol\\n * but disallow any release before the vesting/lock schedule.\\n * The beneficiary can issue authorized function calls to this contract that will\\n * get forwarded to a target contract. A target contract is any of our protocol contracts.\\n * The function calls allowed are queried to the GraphTokenLockManager, this way\\n * the same configuration can be shared for all the created lock wallet contracts.\\n *\\n * NOTE: Contracts used as target must have its function signatures checked to avoid collisions\\n * with any of this contract functions.\\n * Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience\\n * the maximum amount of tokens is authorized.\\n * Function calls do not forward ETH value so DO NOT SEND ETH TO THIS CONTRACT.\\n */\\ncontract GraphTokenLockWallet is GraphTokenLock {\\n using SafeMath for uint256;\\n\\n // -- State --\\n\\n IGraphTokenLockManager public manager;\\n uint256 public usedAmount;\\n\\n // -- Events --\\n\\n event ManagerUpdated(address indexed _oldManager, address indexed _newManager);\\n event TokenDestinationsApproved();\\n event TokenDestinationsRevoked();\\n\\n // Initializer\\n function initialize(\\n address _manager,\\n address _owner,\\n address _beneficiary,\\n address _token,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n Revocability _revocable\\n ) external {\\n _initialize(\\n _owner,\\n _beneficiary,\\n _token,\\n _managedAmount,\\n _startTime,\\n _endTime,\\n _periods,\\n _releaseStartTime,\\n _vestingCliffTime,\\n _revocable\\n );\\n _setManager(_manager);\\n }\\n\\n // -- Admin --\\n\\n /**\\n * @notice Sets a new manager for this contract\\n * @param _newManager Address of the new manager\\n */\\n function setManager(address _newManager) external onlyOwner {\\n _setManager(_newManager);\\n }\\n\\n /**\\n * @dev Sets a new manager for this contract\\n * @param _newManager Address of the new manager\\n */\\n function _setManager(address _newManager) internal {\\n require(_newManager != address(0), \\\"Manager cannot be empty\\\");\\n require(Address.isContract(_newManager), \\\"Manager must be a contract\\\");\\n\\n address oldManager = address(manager);\\n manager = IGraphTokenLockManager(_newManager);\\n\\n emit ManagerUpdated(oldManager, _newManager);\\n }\\n\\n // -- Beneficiary --\\n\\n /**\\n * @notice Approves protocol access of the tokens managed by this contract\\n * @dev Approves all token destinations registered in the manager to pull tokens\\n */\\n function approveProtocol() external onlyBeneficiary {\\n address[] memory dstList = manager.getTokenDestinations();\\n for (uint256 i = 0; i < dstList.length; i++) {\\n // Note this is only safe because we are using the max uint256 value\\n token.approve(dstList[i], type(uint256).max);\\n }\\n emit TokenDestinationsApproved();\\n }\\n\\n /**\\n * @notice Revokes protocol access of the tokens managed by this contract\\n * @dev Revokes approval to all token destinations in the manager to pull tokens\\n */\\n function revokeProtocol() external onlyBeneficiary {\\n address[] memory dstList = manager.getTokenDestinations();\\n for (uint256 i = 0; i < dstList.length; i++) {\\n // Note this is only safe cause we're using 0 as the amount\\n token.approve(dstList[i], 0);\\n }\\n emit TokenDestinationsRevoked();\\n }\\n\\n /**\\n * @notice Gets tokens currently available for release\\n * @dev Considers the schedule, takes into account already released tokens and used amount\\n * @return Amount of tokens ready to be released\\n */\\n function releasableAmount() public view override returns (uint256) {\\n if (revocable == Revocability.Disabled) {\\n return super.releasableAmount();\\n }\\n\\n // -- Revocability enabled logic\\n // This needs to deal with additional considerations for when tokens are used in the protocol\\n\\n // If a release start time is set no tokens are available for release before this date\\n // If not set it follows the default schedule and tokens are available on\\n // the first period passed\\n if (releaseStartTime > 0 && currentTime() < releaseStartTime) {\\n return 0;\\n }\\n\\n // Vesting cliff is activated and it has not passed means nothing is vested yet\\n // so funds cannot be released\\n if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\\n return 0;\\n }\\n\\n // A beneficiary can never have more releasable tokens than the contract balance\\n // We consider the `usedAmount` in the protocol as part of the calculations\\n // the beneficiary should not release funds that are used.\\n uint256 releasable = availableAmount().sub(releasedAmount).sub(usedAmount);\\n return MathUtils.min(currentBalance(), releasable);\\n }\\n\\n /**\\n * @notice Forward authorized contract calls to protocol contracts\\n * @dev Fallback function can be called by the beneficiary only if function call is allowed\\n */\\n // solhint-disable-next-line no-complex-fallback\\n fallback() external payable {\\n // Only beneficiary can forward calls\\n require(msg.sender == beneficiary, \\\"Unauthorized caller\\\");\\n require(msg.value == 0, \\\"ETH transfers not supported\\\");\\n\\n // Function call validation\\n address _target = manager.getAuthFunctionCallTarget(msg.sig);\\n require(_target != address(0), \\\"Unauthorized function\\\");\\n\\n uint256 oldBalance = currentBalance();\\n\\n // Call function with data\\n Address.functionCall(_target, msg.data);\\n\\n // Tracked used tokens in the protocol\\n // We do this check after balances were updated by the forwarded call\\n // Check is only enforced for revocable contracts to save some gas\\n if (revocable == Revocability.Enabled) {\\n // Track contract balance change\\n uint256 newBalance = currentBalance();\\n if (newBalance < oldBalance) {\\n // Outflow\\n uint256 diff = oldBalance.sub(newBalance);\\n usedAmount = usedAmount.add(diff);\\n } else {\\n // Inflow: We can receive profits from the protocol, that could make usedAmount to\\n // underflow. We set it to zero in that case.\\n uint256 diff = newBalance.sub(oldBalance);\\n usedAmount = (diff >= usedAmount) ? 0 : usedAmount.sub(diff);\\n }\\n require(usedAmount <= vestedAmount(), \\\"Cannot use more tokens than vested amount\\\");\\n }\\n }\\n\\n /**\\n * @notice Receive function that always reverts.\\n * @dev Only included to supress warnings, see https://github.com/ethereum/solidity/issues/10159\\n */\\n receive() external payable {\\n revert(\\\"Bad call\\\");\\n }\\n}\\n\",\"keccak256\":\"0x976c2ba4c1503a81ea02bd84539c516e99af611ff767968ee25456b50a6deb7b\",\"license\":\"MIT\"},\"contracts/ICallhookReceiver.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\n\\n// Copied from graphprotocol/contracts, changed solidity version to 0.7.3\\n\\n/**\\n * @title Interface for contracts that can receive callhooks through the Arbitrum GRT bridge\\n * @dev Any contract that can receive a callhook on L2, sent through the bridge from L1, must\\n * be allowlisted by the governor, but also implement this interface that contains\\n * the function that will actually be called by the L2GraphTokenGateway.\\n */\\npragma solidity ^0.7.3;\\n\\ninterface ICallhookReceiver {\\n /**\\n * @notice Receive tokens with a callhook from the bridge\\n * @param _from Token sender in L1\\n * @param _amount Amount of tokens that were transferred\\n * @param _data ABI-encoded callhook data\\n */\\n function onTokenTransfer(address _from, uint256 _amount, bytes calldata _data) external;\\n}\\n\",\"keccak256\":\"0xb90eae14e8bac012a4b99fabe7a1110f70143eb78476ea0d6b52557ef979fa0e\",\"license\":\"GPL-2.0-or-later\"},\"contracts/IGraphTokenLock.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\ninterface IGraphTokenLock {\\n enum Revocability {\\n NotSet,\\n Enabled,\\n Disabled\\n }\\n\\n // -- Balances --\\n\\n function currentBalance() external view returns (uint256);\\n\\n // -- Time & Periods --\\n\\n function currentTime() external view returns (uint256);\\n\\n function duration() external view returns (uint256);\\n\\n function sinceStartTime() external view returns (uint256);\\n\\n function amountPerPeriod() external view returns (uint256);\\n\\n function periodDuration() external view returns (uint256);\\n\\n function currentPeriod() external view returns (uint256);\\n\\n function passedPeriods() external view returns (uint256);\\n\\n // -- Locking & Release Schedule --\\n\\n function availableAmount() external view returns (uint256);\\n\\n function vestedAmount() external view returns (uint256);\\n\\n function releasableAmount() external view returns (uint256);\\n\\n function totalOutstandingAmount() external view returns (uint256);\\n\\n function surplusAmount() external view returns (uint256);\\n\\n // -- Value Transfer --\\n\\n function release() external;\\n\\n function withdrawSurplus(uint256 _amount) external;\\n\\n function revoke() external;\\n}\\n\",\"keccak256\":\"0xceb9d258276fe25ec858191e1deae5778f1b2f612a669fb7b37bab1a064756ab\",\"license\":\"MIT\"},\"contracts/IGraphTokenLockManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nimport \\\"./IGraphTokenLock.sol\\\";\\n\\ninterface IGraphTokenLockManager {\\n // -- Factory --\\n\\n function setMasterCopy(address _masterCopy) external;\\n\\n function createTokenLockWallet(\\n address _owner,\\n address _beneficiary,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n IGraphTokenLock.Revocability _revocable\\n ) external;\\n\\n // -- Funds Management --\\n\\n function token() external returns (IERC20);\\n\\n function deposit(uint256 _amount) external;\\n\\n function withdraw(uint256 _amount) external;\\n\\n // -- Allowed Funds Destinations --\\n\\n function addTokenDestination(address _dst) external;\\n\\n function removeTokenDestination(address _dst) external;\\n\\n function isTokenDestination(address _dst) external view returns (bool);\\n\\n function getTokenDestinations() external view returns (address[] memory);\\n\\n // -- Function Call Authorization --\\n\\n function setAuthFunctionCall(string calldata _signature, address _target) external;\\n\\n function unsetAuthFunctionCall(string calldata _signature) external;\\n\\n function setAuthFunctionCallMany(string[] calldata _signatures, address[] calldata _targets) external;\\n\\n function getAuthFunctionCallTarget(bytes4 _sigHash) external view returns (address);\\n\\n function isAuthFunctionCall(bytes4 _sigHash) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x2d78d41909a6de5b316ac39b100ea087a8f317cf306379888a045523e15c4d9a\",\"license\":\"MIT\"},\"contracts/L2GraphTokenLockManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport { SafeERC20 } from \\\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\\\";\\n\\nimport { ICallhookReceiver } from \\\"./ICallhookReceiver.sol\\\";\\nimport { GraphTokenLockManager } from \\\"./GraphTokenLockManager.sol\\\";\\nimport { L2GraphTokenLockWallet } from \\\"./L2GraphTokenLockWallet.sol\\\";\\n\\n/**\\n * @title L2GraphTokenLockManager\\n * @notice This contract manages a list of authorized function calls and targets that can be called\\n * by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts.\\n *\\n * This contract receives funds to make the process of creating TokenLockWallet contracts\\n * easier by distributing them the initial tokens to be managed.\\n *\\n * In particular, this L2 variant is designed to receive token lock wallets from L1,\\n * through the GRT bridge. These transferred wallets will not allow releasing funds in L2 until\\n * the end of the vesting timeline, but they can allow withdrawing funds back to L1 using\\n * the L2GraphTokenLockTransferTool contract.\\n *\\n * The owner can setup a list of token destinations that will be used by TokenLock contracts to\\n * approve the pulling of funds, this way in can be guaranteed that only protocol contracts\\n * will manipulate users funds.\\n */\\ncontract L2GraphTokenLockManager is GraphTokenLockManager, ICallhookReceiver {\\n using SafeERC20 for IERC20;\\n\\n /// @dev Struct to hold the data of a transferred wallet; this is\\n /// the data that must be encoded in L1 to send a wallet to L2.\\n struct TransferredWalletData {\\n address l1Address;\\n address owner;\\n address beneficiary;\\n uint256 managedAmount;\\n uint256 startTime;\\n uint256 endTime;\\n }\\n\\n /// Address of the L2GraphTokenGateway\\n address public immutable l2Gateway;\\n /// Address of the L1 transfer tool contract (in L1, no aliasing)\\n address public immutable l1TransferTool;\\n /// Mapping of each L1 wallet to its L2 wallet counterpart (populated when each wallet is received)\\n /// L1 address => L2 address\\n mapping(address => address) public l1WalletToL2Wallet;\\n /// Mapping of each L2 wallet to its L1 wallet counterpart (populated when each wallet is received)\\n /// L2 address => L1 address\\n mapping(address => address) public l2WalletToL1Wallet;\\n\\n /// @dev Event emitted when a wallet is received and created from L1\\n event TokenLockCreatedFromL1(\\n address indexed contractAddress,\\n bytes32 initHash,\\n address indexed beneficiary,\\n uint256 managedAmount,\\n uint256 startTime,\\n uint256 endTime,\\n address indexed l1Address\\n );\\n\\n /// @dev Emitted when locked tokens are received from L1 (whether the wallet\\n /// had already been received or not)\\n event LockedTokensReceivedFromL1(address indexed l1Address, address indexed l2Address, uint256 amount);\\n\\n /**\\n * @dev Checks that the sender is the L2GraphTokenGateway.\\n */\\n modifier onlyL2Gateway() {\\n require(msg.sender == l2Gateway, \\\"ONLY_GATEWAY\\\");\\n _;\\n }\\n\\n /**\\n * @notice Constructor for the L2GraphTokenLockManager contract.\\n * @param _graphToken Address of the L2 GRT token contract\\n * @param _masterCopy Address of the master copy of the L2GraphTokenLockWallet implementation\\n * @param _l2Gateway Address of the L2GraphTokenGateway contract\\n * @param _l1TransferTool Address of the L1 transfer tool contract (in L1, without aliasing)\\n */\\n constructor(\\n IERC20 _graphToken,\\n address _masterCopy,\\n address _l2Gateway,\\n address _l1TransferTool\\n ) GraphTokenLockManager(_graphToken, _masterCopy) {\\n l2Gateway = _l2Gateway;\\n l1TransferTool = _l1TransferTool;\\n }\\n\\n /**\\n * @notice This function is called by the L2GraphTokenGateway when tokens are sent from L1.\\n * @dev This function will create a new wallet if it doesn't exist yet, or send the tokens to\\n * the existing wallet if it does.\\n * @param _from Address of the sender in L1, which must be the L1GraphTokenLockTransferTool\\n * @param _amount Amount of tokens received\\n * @param _data Encoded data of the transferred wallet, which must be an ABI-encoded TransferredWalletData struct\\n */\\n function onTokenTransfer(address _from, uint256 _amount, bytes calldata _data) external override onlyL2Gateway {\\n require(_from == l1TransferTool, \\\"ONLY_TRANSFER_TOOL\\\");\\n TransferredWalletData memory walletData = abi.decode(_data, (TransferredWalletData));\\n\\n if (l1WalletToL2Wallet[walletData.l1Address] != address(0)) {\\n // If the wallet was already received, just send the tokens to the L2 address\\n _token.safeTransfer(l1WalletToL2Wallet[walletData.l1Address], _amount);\\n } else {\\n // Create contract using a minimal proxy and call initializer\\n (bytes32 initHash, address contractAddress) = _deployFromL1(keccak256(_data), walletData);\\n l1WalletToL2Wallet[walletData.l1Address] = contractAddress;\\n l2WalletToL1Wallet[contractAddress] = walletData.l1Address;\\n\\n // Send managed amount to the created contract\\n _token.safeTransfer(contractAddress, _amount);\\n\\n emit TokenLockCreatedFromL1(\\n contractAddress,\\n initHash,\\n walletData.beneficiary,\\n walletData.managedAmount,\\n walletData.startTime,\\n walletData.endTime,\\n walletData.l1Address\\n );\\n }\\n emit LockedTokensReceivedFromL1(walletData.l1Address, l1WalletToL2Wallet[walletData.l1Address], _amount);\\n }\\n\\n /**\\n * @dev Deploy a token lock wallet with data received from L1\\n * @param _salt Salt for the CREATE2 call, which must be the hash of the wallet data\\n * @param _walletData Data of the wallet to be created\\n * @return Hash of the initialization calldata\\n * @return Address of the created contract\\n */\\n function _deployFromL1(bytes32 _salt, TransferredWalletData memory _walletData) internal returns (bytes32, address) {\\n bytes memory initializer = _encodeInitializer(_walletData);\\n address contractAddress = _deployProxy2(_salt, masterCopy, initializer);\\n return (keccak256(initializer), contractAddress);\\n }\\n\\n /**\\n * @dev Encode the initializer for the token lock wallet received from L1\\n * @param _walletData Data of the wallet to be created\\n * @return Encoded initializer calldata, including the function signature\\n */\\n function _encodeInitializer(TransferredWalletData memory _walletData) internal view returns (bytes memory) {\\n return\\n abi.encodeWithSelector(\\n L2GraphTokenLockWallet.initializeFromL1.selector,\\n address(this),\\n address(_token),\\n _walletData\\n );\\n }\\n}\\n\",\"keccak256\":\"0x34ca0ffc898ce3615a000d53a9c58708354b8cd8093b3c61decfe7388f0c16e0\",\"license\":\"MIT\"},\"contracts/L2GraphTokenLockWallet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nimport { GraphTokenLockWallet } from \\\"./GraphTokenLockWallet.sol\\\";\\nimport { Ownable as OwnableInitializable } from \\\"./Ownable.sol\\\";\\nimport { L2GraphTokenLockManager } from \\\"./L2GraphTokenLockManager.sol\\\";\\n\\n/**\\n * @title L2GraphTokenLockWallet\\n * @notice This contract is built on top of the base GraphTokenLock functionality.\\n * It allows wallet beneficiaries to use the deposited funds to perform specific function calls\\n * on specific contracts.\\n *\\n * The idea is that supporters with locked tokens can participate in the protocol\\n * but disallow any release before the vesting/lock schedule.\\n * The beneficiary can issue authorized function calls to this contract that will\\n * get forwarded to a target contract. A target contract is any of our protocol contracts.\\n * The function calls allowed are queried to the GraphTokenLockManager, this way\\n * the same configuration can be shared for all the created lock wallet contracts.\\n *\\n * This L2 variant includes a special initializer so that it can be created from\\n * a wallet's data received from L1. These transferred wallets will not allow releasing\\n * funds in L2 until the end of the vesting timeline, but they can allow withdrawing\\n * funds back to L1 using the L2GraphTokenLockTransferTool contract.\\n *\\n * Note that surplusAmount and releasedAmount in L2 will be skewed for wallets received from L1,\\n * so releasing surplus tokens might also only be possible by bridging tokens back to L1.\\n *\\n * NOTE: Contracts used as target must have its function signatures checked to avoid collisions\\n * with any of this contract functions.\\n * Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience\\n * the maximum amount of tokens is authorized.\\n * Function calls do not forward ETH value so DO NOT SEND ETH TO THIS CONTRACT.\\n */\\ncontract L2GraphTokenLockWallet is GraphTokenLockWallet {\\n // Initializer when created from a message from L1\\n function initializeFromL1(\\n address _manager,\\n address _token,\\n L2GraphTokenLockManager.TransferredWalletData calldata _walletData\\n ) external {\\n require(!isInitialized, \\\"Already initialized\\\");\\n isInitialized = true;\\n\\n OwnableInitializable._initialize(_walletData.owner);\\n beneficiary = _walletData.beneficiary;\\n token = IERC20(_token);\\n\\n managedAmount = _walletData.managedAmount;\\n\\n startTime = _walletData.startTime;\\n endTime = _walletData.endTime;\\n periods = 1;\\n isAccepted = true;\\n\\n // Optionals\\n releaseStartTime = _walletData.endTime;\\n revocable = Revocability.Disabled;\\n\\n _setManager(_manager);\\n }\\n}\\n\",\"keccak256\":\"0x8842140c2c7924be4ab1bca71e0b0ad6dd1dba6433cfdc523bfd204288b25d20\",\"license\":\"MIT\"},\"contracts/MathUtils.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nlibrary MathUtils {\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n}\\n\",\"keccak256\":\"0xe2512e1da48bc8363acd15f66229564b02d66706665d7da740604566913c1400\",\"license\":\"MIT\"},\"contracts/MinimalProxyFactory.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nimport { Address } from \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport { Create2 } from \\\"@openzeppelin/contracts/utils/Create2.sol\\\";\\n\\n/**\\n * @title MinimalProxyFactory: a factory contract for creating minimal proxies\\n * @notice Adapted from https://github.com/OpenZeppelin/openzeppelin-sdk/blob/v2.5.0/packages/lib/contracts/upgradeability/ProxyFactory.sol\\n * Based on https://eips.ethereum.org/EIPS/eip-1167\\n */\\ncontract MinimalProxyFactory {\\n /// @dev Emitted when a new proxy is created\\n event ProxyCreated(address indexed proxy);\\n\\n\\n /**\\n * @notice Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation\\n * @dev Uses address(this) as deployer to compute the address. Only for backwards compatibility.\\n * @param _salt Bytes32 salt to use for CREATE2\\n * @param _implementation Address of the proxy target implementation\\n * @return Address of the counterfactual MinimalProxy\\n */\\n function getDeploymentAddress(\\n bytes32 _salt,\\n address _implementation\\n ) public view returns (address) {\\n return getDeploymentAddress(_salt, _implementation, address(this));\\n }\\n\\n /**\\n * @notice Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation\\n * @param _salt Bytes32 salt to use for CREATE2\\n * @param _implementation Address of the proxy target implementation\\n * @param _deployer Address of the deployer that creates the contract\\n * @return Address of the counterfactual MinimalProxy\\n */\\n function getDeploymentAddress(\\n bytes32 _salt,\\n address _implementation,\\n address _deployer\\n ) public pure returns (address) {\\n return Create2.computeAddress(_salt, keccak256(_getContractCreationCode(_implementation)), _deployer);\\n }\\n\\n /**\\n * @dev Deploys a MinimalProxy with CREATE2\\n * @param _salt Bytes32 salt to use for CREATE2\\n * @param _implementation Address of the proxy target implementation\\n * @param _data Bytes with the initializer call\\n * @return Address of the deployed MinimalProxy\\n */\\n function _deployProxy2(bytes32 _salt, address _implementation, bytes memory _data) internal returns (address) {\\n address proxyAddress = Create2.deploy(0, _salt, _getContractCreationCode(_implementation));\\n\\n emit ProxyCreated(proxyAddress);\\n\\n // Call function with data\\n if (_data.length > 0) {\\n Address.functionCall(proxyAddress, _data);\\n }\\n\\n return proxyAddress;\\n }\\n\\n /**\\n * @dev Gets the MinimalProxy bytecode\\n * @param _implementation Address of the proxy target implementation\\n * @return MinimalProxy bytecode\\n */\\n function _getContractCreationCode(address _implementation) internal pure returns (bytes memory) {\\n bytes10 creation = 0x3d602d80600a3d3981f3;\\n bytes10 prefix = 0x363d3d373d3d3d363d73;\\n bytes20 targetBytes = bytes20(_implementation);\\n bytes15 suffix = 0x5af43d82803e903d91602b57fd5bf3;\\n return abi.encodePacked(creation, prefix, targetBytes, suffix);\\n }\\n}\\n\",\"keccak256\":\"0xc0ad119f676fe82b234fd5c830d9bc443e9038c0cfe5dc4de3a3bf621d3f69df\",\"license\":\"MIT\"},\"contracts/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * The owner account will be passed on initialization of the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\ncontract Ownable {\\n /// @dev Owner of the contract, can be retrieved with the public owner() function\\n address private _owner;\\n /// @dev Since upgradeable contracts might inherit this, we add a storage gap\\n /// to allow adding variables here without breaking the proxy storage layout\\n uint256[50] private __gap;\\n\\n /// @dev Emitted when ownership of the contract is transferred\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n function _initialize(address owner) internal {\\n _owner = owner;\\n emit OwnershipTransferred(address(0), owner);\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(_owner == msg.sender, \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() external virtual onlyOwner {\\n emit OwnershipTransferred(_owner, address(0));\\n _owner = address(0);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) external virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n emit OwnershipTransferred(_owner, newOwner);\\n _owner = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0xe8750687082e8e24b620dbf58c3a08eee591ed7b4d5a3e13cc93554ec647fd09\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b506148f5806100206000396000f3fe6080604052600436106102605760003560e01c80637bdf05af11610144578063bc0163c1116100b6578063dc0706571161007a578063dc07065714610bc7578063e8dda6f514610bf0578063e97d87d514610c1b578063ebbab99214610c46578063f2fde38b14610c71578063fc0c546a14610c9a576102a0565b8063bc0163c114610af4578063bd896dcb14610b1f578063ce845d1d14610b48578063d0ebdbe714610b73578063d18e81b314610b9c576102a0565b80638da5cb5b116101085780638da5cb5b14610a0857806391f7cfb914610a33578063a4caeb4214610a5e578063b0d1818c14610a89578063b470aade14610ab2578063b6549f7514610add576102a0565b80637bdf05af1461095957806386d00e021461098457806386d1a69f146109af578063872a7810146109c65780638a5bdf5c146109f1576102a0565b806338af3eed116101dd578063481c6a75116101a1578063481c6a751461087f5780635051a5ec146108aa5780635b940081146108d557806360e7994414610900578063715018a61461091757806378e979251461092e576102a0565b806338af3eed146107a8578063392e53cd146107d3578063398057a3146107fe57806344b1231f1461082957806345d30a1714610854576102a0565b806320dc203d1161022457806320dc203d146106e75780632a627814146107105780632bc9ed02146107275780633197cbb61461075257806337aeb0861461077d576102a0565b8063029c6c9f14610624578063060406181461064f5780630b80f7771461067a5780630dff24d5146106915780630fb5a6b4146106bc576102a0565b366102a0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610297906141f3565b60405180910390fd5b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610330576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610327906143d3565b60405180910390fd5b60003414610373576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161036a90614213565b60405180910390fd5b6000603e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f1d24c456000357fffffffff00000000000000000000000000000000000000000000000000000000166040518263ffffffff1660e01b81526004016103f49190614165565b60206040518083038186803b15801561040c57600080fd5b505afa158015610420573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610444919061338f565b9050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156104b6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104ad906144d3565b60405180910390fd5b60006104c0610cc5565b9050610511826000368080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610d77565b506001600281111561051f57fe5b603b60009054906101000a900460ff16600281111561053a57fe5b141561062057600061054a610cc5565b90508181101561058c5760006105698284610dc190919063ffffffff16565b905061058081603f54610e1190919063ffffffff16565b603f81905550506105d2565b60006105a18383610dc190919063ffffffff16565b9050603f548110156105c7576105c281603f54610dc190919063ffffffff16565b6105ca565b60005b603f81905550505b6105da610e66565b603f54111561061e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161061590614433565b60405180910390fd5b505b5050005b34801561063057600080fd5b50610639610ed5565b6040516106469190614673565b60405180910390f35b34801561065b57600080fd5b50610664610ef3565b6040516106719190614673565b60405180910390f35b34801561068657600080fd5b5061068f610f2e565b005b34801561069d57600080fd5b506106a661109b565b6040516106b39190614673565b60405180910390f35b3480156106c857600080fd5b506106d16110e2565b6040516106de9190614673565b60405180910390f35b3480156106f357600080fd5b5061070e600480360381019061070991906134a8565b611100565b005b34801561071c57600080fd5b5061072561129b565b005b34801561073357600080fd5b5061073c611500565b604051610749919061414a565b60405180910390f35b34801561075e57600080fd5b50610767611513565b6040516107749190614673565b60405180910390f35b34801561078957600080fd5b50610792611519565b60405161079f9190614673565b60405180910390f35b3480156107b457600080fd5b506107bd61151f565b6040516107ca91906140dd565b60405180910390f35b3480156107df57600080fd5b506107e8611545565b6040516107f5919061414a565b60405180910390f35b34801561080a57600080fd5b50610813611558565b6040516108209190614673565b60405180910390f35b34801561083557600080fd5b5061083e610e66565b60405161084b9190614673565b60405180910390f35b34801561086057600080fd5b5061086961155e565b6040516108769190614673565b60405180910390f35b34801561088b57600080fd5b50610894611564565b6040516108a1919061419b565b60405180910390f35b3480156108b657600080fd5b506108bf61158a565b6040516108cc919061414a565b60405180910390f35b3480156108e157600080fd5b506108ea61159d565b6040516108f79190614673565b60405180910390f35b34801561090c57600080fd5b506109156116a8565b005b34801561092357600080fd5b5061092c6118ee565b005b34801561093a57600080fd5b50610943611a3a565b6040516109509190614673565b60405180910390f35b34801561096557600080fd5b5061096e611a40565b60405161097b9190614673565b60405180910390f35b34801561099057600080fd5b50610999611a7c565b6040516109a69190614673565b60405180910390f35b3480156109bb57600080fd5b506109c4611a82565b005b3480156109d257600080fd5b506109db611c5e565b6040516109e891906141b6565b60405180910390f35b3480156109fd57600080fd5b50610a06611c71565b005b348015610a1457600080fd5b50610a1d611d4a565b604051610a2a91906140dd565b60405180910390f35b348015610a3f57600080fd5b50610a48611d73565b604051610a559190614673565b60405180910390f35b348015610a6a57600080fd5b50610a73611dd1565b604051610a809190614673565b60405180910390f35b348015610a9557600080fd5b50610ab06004803603810190610aab9190613562565b611dd7565b005b348015610abe57600080fd5b50610ac7611fd6565b604051610ad49190614673565b60405180910390f35b348015610ae957600080fd5b50610af2611ff9565b005b348015610b0057600080fd5b50610b09612291565b604051610b169190614673565b60405180910390f35b348015610b2b57600080fd5b50610b466004803603810190610b4191906133b8565b6122c3565b005b348015610b5457600080fd5b50610b5d610cc5565b604051610b6a9190614673565b60405180910390f35b348015610b7f57600080fd5b50610b9a6004803603810190610b959190613366565b6122eb565b005b348015610ba857600080fd5b50610bb1612385565b604051610bbe9190614673565b60405180910390f35b348015610bd357600080fd5b50610bee6004803603810190610be99190613366565b61238d565b005b348015610bfc57600080fd5b50610c05612508565b604051610c129190614673565b60405180910390f35b348015610c2757600080fd5b50610c3061250e565b604051610c3d9190614673565b60405180910390f35b348015610c5257600080fd5b50610c5b612514565b604051610c689190614673565b60405180910390f35b348015610c7d57600080fd5b50610c986004803603810190610c939190613366565b612536565b005b348015610ca657600080fd5b50610caf6126f1565b604051610cbc9190614180565b60405180910390f35b6000603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610d2291906140dd565b60206040518083038186803b158015610d3a57600080fd5b505afa158015610d4e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d72919061358b565b905090565b6060610db983836040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c65640000815250612717565b905092915050565b600082821115610e06576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dfd90614333565b60405180910390fd5b818303905092915050565b600080828401905083811015610e5c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e53906142b3565b60405180910390fd5b8091505092915050565b6000600280811115610e7457fe5b603b60009054906101000a900460ff166002811115610e8f57fe5b1415610e9f576035549050610ed2565b6000603a54118015610eb95750603a54610eb7612385565b105b15610ec75760009050610ed2565b610ecf611d73565b90505b90565b6000610eee60385460355461272f90919063ffffffff16565b905090565b6000610f296001610f1b610f05611fd6565b610f0d611a40565b61272f90919063ffffffff16565b610e1190919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610fbc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fb390614493565b60405180910390fd5b60001515603b60039054906101000a900460ff16151514611012576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161100990614313565b60405180910390fd5b61106d61101d611d4a565b611025610cc5565b603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166127859092919063ffffffff16565b7f171f0bcbda3370351cea17f3b164bee87d77c2503b94abdf2720a814ebe7e9df60405160405180910390a1565b6000806110a6610cc5565b905060006110b2612291565b9050808211156110d8576110cf8183610dc190919063ffffffff16565b925050506110df565b6000925050505b90565b60006110fb603654603754610dc190919063ffffffff16565b905090565b603b60029054906101000a900460ff1615611150576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161114790614533565b60405180910390fd5b6001603b60026101000a81548160ff0219169083151502179055506111868160200160208101906111819190613366565b61280b565b8060400160208101906111999190613366565b603460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081603360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550806060013560358190555080608001356036819055508060a0013560378190555060016038819055506001603b60036101000a81548160ff0219169083151502179055508060a001356039819055506002603b60006101000a81548160ff0219169083600281111561128857fe5b0217905550611296836128a9565b505050565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461132b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161132290614593565b60405180910390fd5b6060603e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a34574666040518163ffffffff1660e01b815260040160006040518083038186803b15801561139557600080fd5b505afa1580156113a9573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906113d291906134f8565b905060005b81518110156114d057603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b383838151811061142a57fe5b60200260200101517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611470929190614121565b602060405180830381600087803b15801561148a57600080fd5b505af115801561149e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114c29190613539565b5080806001019150506113d7565b507fb837fd51506ba3cc623a37c78ed22fd521f2f6e9f69a34d5c2a4a9474f27579360405160405180910390a150565b603b60019054906101000a900460ff1681565b60375481565b603d5481565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b603b60029054906101000a900460ff1681565b60355481565b603c5481565b603e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b603b60039054906101000a900460ff1681565b60006002808111156115ab57fe5b603b60009054906101000a900460ff1660028111156115c657fe5b14156115db576115d4612a27565b90506116a5565b60006039541180156115f557506039546115f3612385565b105b1561160357600090506116a5565b6001600281111561161057fe5b603b60009054906101000a900460ff16600281111561162b57fe5b14801561163a57506000603a54115b801561164e5750603a5461164c612385565b105b1561165c57600090506116a5565b600061168e603f54611680603c54611672611d73565b610dc190919063ffffffff16565b610dc190919063ffffffff16565b90506116a161169b610cc5565b82612ae1565b9150505b90565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611738576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161172f90614593565b60405180910390fd5b6060603e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a34574666040518163ffffffff1660e01b815260040160006040518083038186803b1580156117a257600080fd5b505afa1580156117b6573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906117df91906134f8565b905060005b81518110156118be57603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b383838151811061183757fe5b602002602001015160006040518363ffffffff1660e01b815260040161185e9291906140f8565b602060405180830381600087803b15801561187857600080fd5b505af115801561188c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118b09190613539565b5080806001019150506117e4565b507f6d317a20ba9d790014284bef285283cd61fde92e0f2711050f563a9d2cf4171160405160405180910390a150565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461197c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161197390614493565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60365481565b600080611a4b612385565b90506036548111611a60576000915050611a79565b611a7560365482610dc190919063ffffffff16565b9150505b90565b603a5481565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611b12576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b0990614593565b60405180910390fd5b6000611b1c61159d565b905060008111611b61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b58906145f3565b60405180910390fd5b611b7681603c54610e1190919063ffffffff16565b603c81905550611beb603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166127859092919063ffffffff16565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fc7798891864187665ac6dd119286e44ec13f014527aeeb2b8eb3fd413df9317982604051611c539190614673565b60405180910390a250565b603b60009054906101000a900460ff1681565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611d01576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cf890614593565b60405180910390fd5b6001603b60036101000a81548160ff0219169083151502179055507fbeb3313724453131feb0a765a03e6715bb720e0f973a31fcbafa2d2f048c188b60405160405180910390a1565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600080611d7e612385565b9050603654811015611d94576000915050611dce565b603754811115611da957603554915050611dce565b611dca611db4610ed5565b611dbc612514565b612afa90919063ffffffff16565b9150505b90565b60385481565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611e67576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e5e90614593565b60405180910390fd5b60008111611eaa576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ea190614413565b60405180910390fd5b80611eb361109b565b1015611ef4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611eeb90614513565b60405180910390fd5b611f63603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166127859092919063ffffffff16565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b82604051611fcb9190614673565b60405180910390a250565b6000611ff4603854611fe66110e2565b61272f90919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612087576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161207e90614493565b60405180910390fd5b6001600281111561209457fe5b603b60009054906101000a900460ff1660028111156120af57fe5b146120ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120e690614553565b60405180910390fd5b60001515603b60019054906101000a900460ff16151514612145576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161213c90614653565b60405180910390fd5b6000612163612152610e66565b603554610dc190919063ffffffff16565b9050600081116121a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161219f906142d3565b60405180910390fd5b80603d819055506001603b60016101000a81548160ff02191690831515021790555061221e6121d5611d4a565b82603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166127859092919063ffffffff16565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fb73c49a3a37a7aca291ba0ceaa41657012def406106a7fc386888f0f66e941cf826040516122869190614673565b60405180910390a250565b60006122be603d546122b0603c54603554610dc190919063ffffffff16565b610dc190919063ffffffff16565b905090565b6122d58a8a8a8a8a8a8a8a8a8a612b6a565b6122de8b6128a9565b5050505050505050505050565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612379576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161237090614493565b60405180910390fd5b612382816128a9565b50565b600042905090565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461241d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161241490614593565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561248d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612484906143b3565b60405180910390fd5b80603460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f373c72efabe4ef3e552ff77838be729f3bc3d8c586df0012902d1baa2377fa1d816040516124fd91906140dd565b60405180910390a150565b603f5481565b60395481565b60006125316001612523610ef3565b610dc190919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146125c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125bb90614493565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612634576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161262b90614293565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60606127268484600085612ff4565b90509392505050565b6000808211612773576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161276a90614393565b60405180910390fd5b81838161277c57fe5b04905092915050565b6128068363a9059cbb60e01b84846040516024016127a4929190614121565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050613109565b505050565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a350565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612919576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161291090614573565b60405180910390fd5b612922816131d0565b612961576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612958906143f3565b60405180910390fd5b6000603e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081603e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fdac3632743b879638fd2d51c4d3c1dd796615b4758a55b50b0c19b971ba9fbc760405160405180910390a35050565b600080603954118015612a425750603954612a40612385565b105b15612a505760009050612ade565b60016002811115612a5d57fe5b603b60009054906101000a900460ff166002811115612a7857fe5b148015612a8757506000603a54115b8015612a9b5750603a54612a99612385565b105b15612aa95760009050612ade565b6000612ac7603c54612ab9611d73565b610dc190919063ffffffff16565b9050612ada612ad4610cc5565b82612ae1565b9150505b90565b6000818310612af05781612af2565b825b905092915050565b600080831415612b0d5760009050612b64565b6000828402905082848281612b1e57fe5b0414612b5f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b5690614473565b60405180910390fd5b809150505b92915050565b603b60029054906101000a900460ff1615612bba576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612bb190614533565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff161415612c2a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c21906142f3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff161415612c9a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c9190614633565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff161415612d0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d0190614613565b60405180910390fd5b60008711612d4d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d4490614373565b60405180910390fd5b6000861415612d91576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d88906144b3565b60405180910390fd5b848610612dd3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612dca90614253565b60405180910390fd5b6001841015612e17576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e0e90614453565b60405180910390fd5b60006002811115612e2457fe5b816002811115612e3057fe5b1415612e71576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e6890614273565b60405180910390fd5b848310612eb3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612eaa906145b3565b60405180910390fd5b848210612ef5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612eec90614233565b60405180910390fd5b6001603b60026101000a81548160ff021916908315150217905550612f198a61280b565b88603460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555087603360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550866035819055508560368190555084603781905550836038819055508260398190555081603a8190555080603b60006101000a81548160ff02191690836002811115612fe357fe5b021790555050505050505050505050565b606082471015613039576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161303090614353565b60405180910390fd5b613042856131d0565b613081576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613078906144f3565b60405180910390fd5b600060608673ffffffffffffffffffffffffffffffffffffffff1685876040516130ab91906140c6565b60006040518083038185875af1925050503d80600081146130e8576040519150601f19603f3d011682016040523d82523d6000602084013e6130ed565b606091505b50915091506130fd8282866131e3565b92505050949350505050565b606061316b826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166127179092919063ffffffff16565b90506000815111156131cb578080602001905181019061318b9190613539565b6131ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016131c1906145d3565b60405180910390fd5b5b505050565b600080823b905060008111915050919050565b606083156131f357829050613243565b6000835111156132065782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161323a91906141d1565b60405180910390fd5b9392505050565b6000813590506132598161486a565b92915050565b60008151905061326e8161486a565b92915050565b600082601f83011261328557600080fd5b8151613298613293826146bf565b61468e565b915081818352602084019350602081019050838560208402820111156132bd57600080fd5b60005b838110156132ed57816132d3888261325f565b8452602084019350602083019250506001810190506132c0565b5050505092915050565b60008151905061330681614881565b92915050565b60008135905061331b81614898565b92915050565b600060c0828403121561333357600080fd5b81905092915050565b60008135905061334b816148a8565b92915050565b600081519050613360816148a8565b92915050565b60006020828403121561337857600080fd5b60006133868482850161324a565b91505092915050565b6000602082840312156133a157600080fd5b60006133af8482850161325f565b91505092915050565b60008060008060008060008060008060006101608c8e0312156133da57600080fd5b60006133e88e828f0161324a565b9b505060206133f98e828f0161324a565b9a5050604061340a8e828f0161324a565b995050606061341b8e828f0161324a565b985050608061342c8e828f0161333c565b97505060a061343d8e828f0161333c565b96505060c061344e8e828f0161333c565b95505060e061345f8e828f0161333c565b9450506101006134718e828f0161333c565b9350506101206134838e828f0161333c565b9250506101406134958e828f0161330c565b9150509295989b509295989b9093969950565b600080600061010084860312156134be57600080fd5b60006134cc8682870161324a565b93505060206134dd8682870161324a565b92505060406134ee86828701613321565b9150509250925092565b60006020828403121561350a57600080fd5b600082015167ffffffffffffffff81111561352457600080fd5b61353084828501613274565b91505092915050565b60006020828403121561354b57600080fd5b6000613559848285016132f7565b91505092915050565b60006020828403121561357457600080fd5b60006135828482850161333c565b91505092915050565b60006020828403121561359d57600080fd5b60006135ab84828501613351565b91505092915050565b6135bd8161471d565b82525050565b6135cc8161472f565b82525050565b6135db8161473b565b82525050565b60006135ec826146eb565b6135f68185614701565b9350613606818560208601614810565b80840191505092915050565b61361b816147a4565b82525050565b61362a816147c8565b82525050565b613639816147ec565b82525050565b613648816147fe565b82525050565b6000613659826146f6565b613663818561470c565b9350613673818560208601614810565b61367c81614845565b840191505092915050565b600061369460088361470c565b91507f4261642063616c6c0000000000000000000000000000000000000000000000006000830152602082019050919050565b60006136d4601b8361470c565b91507f455448207472616e7366657273206e6f7420737570706f7274656400000000006000830152602082019050919050565b600061371460228361470c565b91507f436c6966662074696d65206d757374206265206265666f726520656e6420746960008301527f6d650000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b600061377a60158361470c565b91507f53746172742074696d65203e20656e642074696d6500000000000000000000006000830152602082019050919050565b60006137ba601e8361470c565b91507f4d757374207365742061207265766f636162696c697479206f7074696f6e00006000830152602082019050919050565b60006137fa60268361470c565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613860601b8361470c565b91507f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006000830152602082019050919050565b60006138a0601c8361470c565b91507f4e6f20617661696c61626c6520756e76657374656420616d6f756e74000000006000830152602082019050919050565b60006138e060148361470c565b91507f4f776e65722063616e6e6f74206265207a65726f0000000000000000000000006000830152602082019050919050565b6000613920601f8361470c565b91507f43616e6e6f742063616e63656c20616363657074656420636f6e7472616374006000830152602082019050919050565b6000613960601e8361470c565b91507f536166654d6174683a207375627472616374696f6e206f766572666c6f7700006000830152602082019050919050565b60006139a060268361470c565b91507f416464726573733a20696e73756666696369656e742062616c616e636520666f60008301527f722063616c6c00000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613a06601d8361470c565b91507f4d616e6167656420746f6b656e732063616e6e6f74206265207a65726f0000006000830152602082019050919050565b6000613a46601a8361470c565b91507f536166654d6174683a206469766973696f6e206279207a65726f0000000000006000830152602082019050919050565b6000613a8660118361470c565b91507f456d7074792062656e65666963696172790000000000000000000000000000006000830152602082019050919050565b6000613ac660138361470c565b91507f556e617574686f72697a65642063616c6c6572000000000000000000000000006000830152602082019050919050565b6000613b06601a8361470c565b91507f4d616e61676572206d757374206265206120636f6e74726163740000000000006000830152602082019050919050565b6000613b4660158361470c565b91507f416d6f756e742063616e6e6f74206265207a65726f00000000000000000000006000830152602082019050919050565b6000613b8660298361470c565b91507f43616e6e6f7420757365206d6f726520746f6b656e73207468616e207665737460008301527f656420616d6f756e7400000000000000000000000000000000000000000000006020830152604082019050919050565b6000613bec601f8361470c565b91507f506572696f64732063616e6e6f742062652062656c6f77206d696e696d756d006000830152602082019050919050565b6000613c2c60218361470c565b91507f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008301527f77000000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613c9260208361470c565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b6000613cd260168361470c565b91507f53746172742074696d65206d75737420626520736574000000000000000000006000830152602082019050919050565b6000613d1260158361470c565b91507f556e617574686f72697a65642066756e6374696f6e00000000000000000000006000830152602082019050919050565b6000613d52601d8361470c565b91507f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006000830152602082019050919050565b6000613d9260248361470c565b91507f416d6f756e7420726571756573746564203e20737572706c757320617661696c60008301527f61626c65000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613df860138361470c565b91507f416c726561647920696e697469616c697a6564000000000000000000000000006000830152602082019050919050565b6000613e3860198361470c565b91507f436f6e7472616374206973206e6f6e2d7265766f6361626c65000000000000006000830152602082019050919050565b6000613e7860178361470c565b91507f4d616e616765722063616e6e6f7420626520656d7074790000000000000000006000830152602082019050919050565b6000613eb860058361470c565b91507f21617574680000000000000000000000000000000000000000000000000000006000830152602082019050919050565b6000613ef8602a8361470c565b91507f52656c656173652073746172742074696d65206d757374206265206265666f7260008301527f6520656e642074696d65000000000000000000000000000000000000000000006020830152604082019050919050565b6000613f5e602a8361470c565b91507f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008301527f6f742073756363656564000000000000000000000000000000000000000000006020830152604082019050919050565b6000613fc4601e8361470c565b91507f4e6f20617661696c61626c652072656c65617361626c6520616d6f756e7400006000830152602082019050919050565b600061400460148361470c565b91507f546f6b656e2063616e6e6f74206265207a65726f0000000000000000000000006000830152602082019050919050565b6000614044601a8361470c565b91507f42656e65666963696172792063616e6e6f74206265207a65726f0000000000006000830152602082019050919050565b6000614084600f8361470c565b91507f416c7265616479207265766f6b656400000000000000000000000000000000006000830152602082019050919050565b6140c08161479a565b82525050565b60006140d282846135e1565b915081905092915050565b60006020820190506140f260008301846135b4565b92915050565b600060408201905061410d60008301856135b4565b61411a602083018461363f565b9392505050565b600060408201905061413660008301856135b4565b61414360208301846140b7565b9392505050565b600060208201905061415f60008301846135c3565b92915050565b600060208201905061417a60008301846135d2565b92915050565b60006020820190506141956000830184613612565b92915050565b60006020820190506141b06000830184613621565b92915050565b60006020820190506141cb6000830184613630565b92915050565b600060208201905081810360008301526141eb818461364e565b905092915050565b6000602082019050818103600083015261420c81613687565b9050919050565b6000602082019050818103600083015261422c816136c7565b9050919050565b6000602082019050818103600083015261424c81613707565b9050919050565b6000602082019050818103600083015261426c8161376d565b9050919050565b6000602082019050818103600083015261428c816137ad565b9050919050565b600060208201905081810360008301526142ac816137ed565b9050919050565b600060208201905081810360008301526142cc81613853565b9050919050565b600060208201905081810360008301526142ec81613893565b9050919050565b6000602082019050818103600083015261430c816138d3565b9050919050565b6000602082019050818103600083015261432c81613913565b9050919050565b6000602082019050818103600083015261434c81613953565b9050919050565b6000602082019050818103600083015261436c81613993565b9050919050565b6000602082019050818103600083015261438c816139f9565b9050919050565b600060208201905081810360008301526143ac81613a39565b9050919050565b600060208201905081810360008301526143cc81613a79565b9050919050565b600060208201905081810360008301526143ec81613ab9565b9050919050565b6000602082019050818103600083015261440c81613af9565b9050919050565b6000602082019050818103600083015261442c81613b39565b9050919050565b6000602082019050818103600083015261444c81613b79565b9050919050565b6000602082019050818103600083015261446c81613bdf565b9050919050565b6000602082019050818103600083015261448c81613c1f565b9050919050565b600060208201905081810360008301526144ac81613c85565b9050919050565b600060208201905081810360008301526144cc81613cc5565b9050919050565b600060208201905081810360008301526144ec81613d05565b9050919050565b6000602082019050818103600083015261450c81613d45565b9050919050565b6000602082019050818103600083015261452c81613d85565b9050919050565b6000602082019050818103600083015261454c81613deb565b9050919050565b6000602082019050818103600083015261456c81613e2b565b9050919050565b6000602082019050818103600083015261458c81613e6b565b9050919050565b600060208201905081810360008301526145ac81613eab565b9050919050565b600060208201905081810360008301526145cc81613eeb565b9050919050565b600060208201905081810360008301526145ec81613f51565b9050919050565b6000602082019050818103600083015261460c81613fb7565b9050919050565b6000602082019050818103600083015261462c81613ff7565b9050919050565b6000602082019050818103600083015261464c81614037565b9050919050565b6000602082019050818103600083015261466c81614077565b9050919050565b600060208201905061468860008301846140b7565b92915050565b6000604051905081810181811067ffffffffffffffff821117156146b5576146b4614843565b5b8060405250919050565b600067ffffffffffffffff8211156146da576146d9614843565b5b602082029050602081019050919050565b600081519050919050565b600081519050919050565b600081905092915050565b600082825260208201905092915050565b60006147288261477a565b9050919050565b60008115159050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600081905061477582614856565b919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60006147af826147b6565b9050919050565b60006147c18261477a565b9050919050565b60006147d3826147da565b9050919050565b60006147e58261477a565b9050919050565b60006147f782614767565b9050919050565b60006148098261479a565b9050919050565b60005b8381101561482e578082015181840152602081019050614813565b8381111561483d576000848401525b50505050565bfe5b6000601f19601f8301169050919050565b6003811061486757614866614843565b5b50565b6148738161471d565b811461487e57600080fd5b50565b61488a8161472f565b811461489557600080fd5b50565b600381106148a557600080fd5b50565b6148b18161479a565b81146148bc57600080fd5b5056fea2646970667358221220b518abe45075b1a754063c65b10410a7c177459a73d10704d7ef06453ab5c8d464736f6c63430007030033", + "deployedBytecode": "0x6080604052600436106102605760003560e01c80637bdf05af11610144578063bc0163c1116100b6578063dc0706571161007a578063dc07065714610bc7578063e8dda6f514610bf0578063e97d87d514610c1b578063ebbab99214610c46578063f2fde38b14610c71578063fc0c546a14610c9a576102a0565b8063bc0163c114610af4578063bd896dcb14610b1f578063ce845d1d14610b48578063d0ebdbe714610b73578063d18e81b314610b9c576102a0565b80638da5cb5b116101085780638da5cb5b14610a0857806391f7cfb914610a33578063a4caeb4214610a5e578063b0d1818c14610a89578063b470aade14610ab2578063b6549f7514610add576102a0565b80637bdf05af1461095957806386d00e021461098457806386d1a69f146109af578063872a7810146109c65780638a5bdf5c146109f1576102a0565b806338af3eed116101dd578063481c6a75116101a1578063481c6a751461087f5780635051a5ec146108aa5780635b940081146108d557806360e7994414610900578063715018a61461091757806378e979251461092e576102a0565b806338af3eed146107a8578063392e53cd146107d3578063398057a3146107fe57806344b1231f1461082957806345d30a1714610854576102a0565b806320dc203d1161022457806320dc203d146106e75780632a627814146107105780632bc9ed02146107275780633197cbb61461075257806337aeb0861461077d576102a0565b8063029c6c9f14610624578063060406181461064f5780630b80f7771461067a5780630dff24d5146106915780630fb5a6b4146106bc576102a0565b366102a0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610297906141f3565b60405180910390fd5b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610330576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610327906143d3565b60405180910390fd5b60003414610373576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161036a90614213565b60405180910390fd5b6000603e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f1d24c456000357fffffffff00000000000000000000000000000000000000000000000000000000166040518263ffffffff1660e01b81526004016103f49190614165565b60206040518083038186803b15801561040c57600080fd5b505afa158015610420573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610444919061338f565b9050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156104b6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104ad906144d3565b60405180910390fd5b60006104c0610cc5565b9050610511826000368080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610d77565b506001600281111561051f57fe5b603b60009054906101000a900460ff16600281111561053a57fe5b141561062057600061054a610cc5565b90508181101561058c5760006105698284610dc190919063ffffffff16565b905061058081603f54610e1190919063ffffffff16565b603f81905550506105d2565b60006105a18383610dc190919063ffffffff16565b9050603f548110156105c7576105c281603f54610dc190919063ffffffff16565b6105ca565b60005b603f81905550505b6105da610e66565b603f54111561061e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161061590614433565b60405180910390fd5b505b5050005b34801561063057600080fd5b50610639610ed5565b6040516106469190614673565b60405180910390f35b34801561065b57600080fd5b50610664610ef3565b6040516106719190614673565b60405180910390f35b34801561068657600080fd5b5061068f610f2e565b005b34801561069d57600080fd5b506106a661109b565b6040516106b39190614673565b60405180910390f35b3480156106c857600080fd5b506106d16110e2565b6040516106de9190614673565b60405180910390f35b3480156106f357600080fd5b5061070e600480360381019061070991906134a8565b611100565b005b34801561071c57600080fd5b5061072561129b565b005b34801561073357600080fd5b5061073c611500565b604051610749919061414a565b60405180910390f35b34801561075e57600080fd5b50610767611513565b6040516107749190614673565b60405180910390f35b34801561078957600080fd5b50610792611519565b60405161079f9190614673565b60405180910390f35b3480156107b457600080fd5b506107bd61151f565b6040516107ca91906140dd565b60405180910390f35b3480156107df57600080fd5b506107e8611545565b6040516107f5919061414a565b60405180910390f35b34801561080a57600080fd5b50610813611558565b6040516108209190614673565b60405180910390f35b34801561083557600080fd5b5061083e610e66565b60405161084b9190614673565b60405180910390f35b34801561086057600080fd5b5061086961155e565b6040516108769190614673565b60405180910390f35b34801561088b57600080fd5b50610894611564565b6040516108a1919061419b565b60405180910390f35b3480156108b657600080fd5b506108bf61158a565b6040516108cc919061414a565b60405180910390f35b3480156108e157600080fd5b506108ea61159d565b6040516108f79190614673565b60405180910390f35b34801561090c57600080fd5b506109156116a8565b005b34801561092357600080fd5b5061092c6118ee565b005b34801561093a57600080fd5b50610943611a3a565b6040516109509190614673565b60405180910390f35b34801561096557600080fd5b5061096e611a40565b60405161097b9190614673565b60405180910390f35b34801561099057600080fd5b50610999611a7c565b6040516109a69190614673565b60405180910390f35b3480156109bb57600080fd5b506109c4611a82565b005b3480156109d257600080fd5b506109db611c5e565b6040516109e891906141b6565b60405180910390f35b3480156109fd57600080fd5b50610a06611c71565b005b348015610a1457600080fd5b50610a1d611d4a565b604051610a2a91906140dd565b60405180910390f35b348015610a3f57600080fd5b50610a48611d73565b604051610a559190614673565b60405180910390f35b348015610a6a57600080fd5b50610a73611dd1565b604051610a809190614673565b60405180910390f35b348015610a9557600080fd5b50610ab06004803603810190610aab9190613562565b611dd7565b005b348015610abe57600080fd5b50610ac7611fd6565b604051610ad49190614673565b60405180910390f35b348015610ae957600080fd5b50610af2611ff9565b005b348015610b0057600080fd5b50610b09612291565b604051610b169190614673565b60405180910390f35b348015610b2b57600080fd5b50610b466004803603810190610b4191906133b8565b6122c3565b005b348015610b5457600080fd5b50610b5d610cc5565b604051610b6a9190614673565b60405180910390f35b348015610b7f57600080fd5b50610b9a6004803603810190610b959190613366565b6122eb565b005b348015610ba857600080fd5b50610bb1612385565b604051610bbe9190614673565b60405180910390f35b348015610bd357600080fd5b50610bee6004803603810190610be99190613366565b61238d565b005b348015610bfc57600080fd5b50610c05612508565b604051610c129190614673565b60405180910390f35b348015610c2757600080fd5b50610c3061250e565b604051610c3d9190614673565b60405180910390f35b348015610c5257600080fd5b50610c5b612514565b604051610c689190614673565b60405180910390f35b348015610c7d57600080fd5b50610c986004803603810190610c939190613366565b612536565b005b348015610ca657600080fd5b50610caf6126f1565b604051610cbc9190614180565b60405180910390f35b6000603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610d2291906140dd565b60206040518083038186803b158015610d3a57600080fd5b505afa158015610d4e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d72919061358b565b905090565b6060610db983836040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c65640000815250612717565b905092915050565b600082821115610e06576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dfd90614333565b60405180910390fd5b818303905092915050565b600080828401905083811015610e5c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e53906142b3565b60405180910390fd5b8091505092915050565b6000600280811115610e7457fe5b603b60009054906101000a900460ff166002811115610e8f57fe5b1415610e9f576035549050610ed2565b6000603a54118015610eb95750603a54610eb7612385565b105b15610ec75760009050610ed2565b610ecf611d73565b90505b90565b6000610eee60385460355461272f90919063ffffffff16565b905090565b6000610f296001610f1b610f05611fd6565b610f0d611a40565b61272f90919063ffffffff16565b610e1190919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610fbc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fb390614493565b60405180910390fd5b60001515603b60039054906101000a900460ff16151514611012576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161100990614313565b60405180910390fd5b61106d61101d611d4a565b611025610cc5565b603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166127859092919063ffffffff16565b7f171f0bcbda3370351cea17f3b164bee87d77c2503b94abdf2720a814ebe7e9df60405160405180910390a1565b6000806110a6610cc5565b905060006110b2612291565b9050808211156110d8576110cf8183610dc190919063ffffffff16565b925050506110df565b6000925050505b90565b60006110fb603654603754610dc190919063ffffffff16565b905090565b603b60029054906101000a900460ff1615611150576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161114790614533565b60405180910390fd5b6001603b60026101000a81548160ff0219169083151502179055506111868160200160208101906111819190613366565b61280b565b8060400160208101906111999190613366565b603460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081603360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550806060013560358190555080608001356036819055508060a0013560378190555060016038819055506001603b60036101000a81548160ff0219169083151502179055508060a001356039819055506002603b60006101000a81548160ff0219169083600281111561128857fe5b0217905550611296836128a9565b505050565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461132b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161132290614593565b60405180910390fd5b6060603e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a34574666040518163ffffffff1660e01b815260040160006040518083038186803b15801561139557600080fd5b505afa1580156113a9573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906113d291906134f8565b905060005b81518110156114d057603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b383838151811061142a57fe5b60200260200101517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611470929190614121565b602060405180830381600087803b15801561148a57600080fd5b505af115801561149e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114c29190613539565b5080806001019150506113d7565b507fb837fd51506ba3cc623a37c78ed22fd521f2f6e9f69a34d5c2a4a9474f27579360405160405180910390a150565b603b60019054906101000a900460ff1681565b60375481565b603d5481565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b603b60029054906101000a900460ff1681565b60355481565b603c5481565b603e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b603b60039054906101000a900460ff1681565b60006002808111156115ab57fe5b603b60009054906101000a900460ff1660028111156115c657fe5b14156115db576115d4612a27565b90506116a5565b60006039541180156115f557506039546115f3612385565b105b1561160357600090506116a5565b6001600281111561161057fe5b603b60009054906101000a900460ff16600281111561162b57fe5b14801561163a57506000603a54115b801561164e5750603a5461164c612385565b105b1561165c57600090506116a5565b600061168e603f54611680603c54611672611d73565b610dc190919063ffffffff16565b610dc190919063ffffffff16565b90506116a161169b610cc5565b82612ae1565b9150505b90565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611738576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161172f90614593565b60405180910390fd5b6060603e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a34574666040518163ffffffff1660e01b815260040160006040518083038186803b1580156117a257600080fd5b505afa1580156117b6573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906117df91906134f8565b905060005b81518110156118be57603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b383838151811061183757fe5b602002602001015160006040518363ffffffff1660e01b815260040161185e9291906140f8565b602060405180830381600087803b15801561187857600080fd5b505af115801561188c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118b09190613539565b5080806001019150506117e4565b507f6d317a20ba9d790014284bef285283cd61fde92e0f2711050f563a9d2cf4171160405160405180910390a150565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461197c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161197390614493565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60365481565b600080611a4b612385565b90506036548111611a60576000915050611a79565b611a7560365482610dc190919063ffffffff16565b9150505b90565b603a5481565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611b12576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b0990614593565b60405180910390fd5b6000611b1c61159d565b905060008111611b61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b58906145f3565b60405180910390fd5b611b7681603c54610e1190919063ffffffff16565b603c81905550611beb603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166127859092919063ffffffff16565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fc7798891864187665ac6dd119286e44ec13f014527aeeb2b8eb3fd413df9317982604051611c539190614673565b60405180910390a250565b603b60009054906101000a900460ff1681565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611d01576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cf890614593565b60405180910390fd5b6001603b60036101000a81548160ff0219169083151502179055507fbeb3313724453131feb0a765a03e6715bb720e0f973a31fcbafa2d2f048c188b60405160405180910390a1565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600080611d7e612385565b9050603654811015611d94576000915050611dce565b603754811115611da957603554915050611dce565b611dca611db4610ed5565b611dbc612514565b612afa90919063ffffffff16565b9150505b90565b60385481565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611e67576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e5e90614593565b60405180910390fd5b60008111611eaa576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ea190614413565b60405180910390fd5b80611eb361109b565b1015611ef4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611eeb90614513565b60405180910390fd5b611f63603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166127859092919063ffffffff16565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b82604051611fcb9190614673565b60405180910390a250565b6000611ff4603854611fe66110e2565b61272f90919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612087576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161207e90614493565b60405180910390fd5b6001600281111561209457fe5b603b60009054906101000a900460ff1660028111156120af57fe5b146120ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120e690614553565b60405180910390fd5b60001515603b60019054906101000a900460ff16151514612145576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161213c90614653565b60405180910390fd5b6000612163612152610e66565b603554610dc190919063ffffffff16565b9050600081116121a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161219f906142d3565b60405180910390fd5b80603d819055506001603b60016101000a81548160ff02191690831515021790555061221e6121d5611d4a565b82603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166127859092919063ffffffff16565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fb73c49a3a37a7aca291ba0ceaa41657012def406106a7fc386888f0f66e941cf826040516122869190614673565b60405180910390a250565b60006122be603d546122b0603c54603554610dc190919063ffffffff16565b610dc190919063ffffffff16565b905090565b6122d58a8a8a8a8a8a8a8a8a8a612b6a565b6122de8b6128a9565b5050505050505050505050565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612379576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161237090614493565b60405180910390fd5b612382816128a9565b50565b600042905090565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461241d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161241490614593565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561248d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612484906143b3565b60405180910390fd5b80603460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f373c72efabe4ef3e552ff77838be729f3bc3d8c586df0012902d1baa2377fa1d816040516124fd91906140dd565b60405180910390a150565b603f5481565b60395481565b60006125316001612523610ef3565b610dc190919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146125c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125bb90614493565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612634576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161262b90614293565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60606127268484600085612ff4565b90509392505050565b6000808211612773576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161276a90614393565b60405180910390fd5b81838161277c57fe5b04905092915050565b6128068363a9059cbb60e01b84846040516024016127a4929190614121565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050613109565b505050565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a350565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612919576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161291090614573565b60405180910390fd5b612922816131d0565b612961576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612958906143f3565b60405180910390fd5b6000603e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081603e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fdac3632743b879638fd2d51c4d3c1dd796615b4758a55b50b0c19b971ba9fbc760405160405180910390a35050565b600080603954118015612a425750603954612a40612385565b105b15612a505760009050612ade565b60016002811115612a5d57fe5b603b60009054906101000a900460ff166002811115612a7857fe5b148015612a8757506000603a54115b8015612a9b5750603a54612a99612385565b105b15612aa95760009050612ade565b6000612ac7603c54612ab9611d73565b610dc190919063ffffffff16565b9050612ada612ad4610cc5565b82612ae1565b9150505b90565b6000818310612af05781612af2565b825b905092915050565b600080831415612b0d5760009050612b64565b6000828402905082848281612b1e57fe5b0414612b5f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b5690614473565b60405180910390fd5b809150505b92915050565b603b60029054906101000a900460ff1615612bba576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612bb190614533565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff161415612c2a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c21906142f3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff161415612c9a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c9190614633565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff161415612d0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d0190614613565b60405180910390fd5b60008711612d4d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d4490614373565b60405180910390fd5b6000861415612d91576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d88906144b3565b60405180910390fd5b848610612dd3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612dca90614253565b60405180910390fd5b6001841015612e17576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e0e90614453565b60405180910390fd5b60006002811115612e2457fe5b816002811115612e3057fe5b1415612e71576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e6890614273565b60405180910390fd5b848310612eb3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612eaa906145b3565b60405180910390fd5b848210612ef5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612eec90614233565b60405180910390fd5b6001603b60026101000a81548160ff021916908315150217905550612f198a61280b565b88603460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555087603360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550866035819055508560368190555084603781905550836038819055508260398190555081603a8190555080603b60006101000a81548160ff02191690836002811115612fe357fe5b021790555050505050505050505050565b606082471015613039576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161303090614353565b60405180910390fd5b613042856131d0565b613081576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613078906144f3565b60405180910390fd5b600060608673ffffffffffffffffffffffffffffffffffffffff1685876040516130ab91906140c6565b60006040518083038185875af1925050503d80600081146130e8576040519150601f19603f3d011682016040523d82523d6000602084013e6130ed565b606091505b50915091506130fd8282866131e3565b92505050949350505050565b606061316b826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166127179092919063ffffffff16565b90506000815111156131cb578080602001905181019061318b9190613539565b6131ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016131c1906145d3565b60405180910390fd5b5b505050565b600080823b905060008111915050919050565b606083156131f357829050613243565b6000835111156132065782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161323a91906141d1565b60405180910390fd5b9392505050565b6000813590506132598161486a565b92915050565b60008151905061326e8161486a565b92915050565b600082601f83011261328557600080fd5b8151613298613293826146bf565b61468e565b915081818352602084019350602081019050838560208402820111156132bd57600080fd5b60005b838110156132ed57816132d3888261325f565b8452602084019350602083019250506001810190506132c0565b5050505092915050565b60008151905061330681614881565b92915050565b60008135905061331b81614898565b92915050565b600060c0828403121561333357600080fd5b81905092915050565b60008135905061334b816148a8565b92915050565b600081519050613360816148a8565b92915050565b60006020828403121561337857600080fd5b60006133868482850161324a565b91505092915050565b6000602082840312156133a157600080fd5b60006133af8482850161325f565b91505092915050565b60008060008060008060008060008060006101608c8e0312156133da57600080fd5b60006133e88e828f0161324a565b9b505060206133f98e828f0161324a565b9a5050604061340a8e828f0161324a565b995050606061341b8e828f0161324a565b985050608061342c8e828f0161333c565b97505060a061343d8e828f0161333c565b96505060c061344e8e828f0161333c565b95505060e061345f8e828f0161333c565b9450506101006134718e828f0161333c565b9350506101206134838e828f0161333c565b9250506101406134958e828f0161330c565b9150509295989b509295989b9093969950565b600080600061010084860312156134be57600080fd5b60006134cc8682870161324a565b93505060206134dd8682870161324a565b92505060406134ee86828701613321565b9150509250925092565b60006020828403121561350a57600080fd5b600082015167ffffffffffffffff81111561352457600080fd5b61353084828501613274565b91505092915050565b60006020828403121561354b57600080fd5b6000613559848285016132f7565b91505092915050565b60006020828403121561357457600080fd5b60006135828482850161333c565b91505092915050565b60006020828403121561359d57600080fd5b60006135ab84828501613351565b91505092915050565b6135bd8161471d565b82525050565b6135cc8161472f565b82525050565b6135db8161473b565b82525050565b60006135ec826146eb565b6135f68185614701565b9350613606818560208601614810565b80840191505092915050565b61361b816147a4565b82525050565b61362a816147c8565b82525050565b613639816147ec565b82525050565b613648816147fe565b82525050565b6000613659826146f6565b613663818561470c565b9350613673818560208601614810565b61367c81614845565b840191505092915050565b600061369460088361470c565b91507f4261642063616c6c0000000000000000000000000000000000000000000000006000830152602082019050919050565b60006136d4601b8361470c565b91507f455448207472616e7366657273206e6f7420737570706f7274656400000000006000830152602082019050919050565b600061371460228361470c565b91507f436c6966662074696d65206d757374206265206265666f726520656e6420746960008301527f6d650000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b600061377a60158361470c565b91507f53746172742074696d65203e20656e642074696d6500000000000000000000006000830152602082019050919050565b60006137ba601e8361470c565b91507f4d757374207365742061207265766f636162696c697479206f7074696f6e00006000830152602082019050919050565b60006137fa60268361470c565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613860601b8361470c565b91507f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006000830152602082019050919050565b60006138a0601c8361470c565b91507f4e6f20617661696c61626c6520756e76657374656420616d6f756e74000000006000830152602082019050919050565b60006138e060148361470c565b91507f4f776e65722063616e6e6f74206265207a65726f0000000000000000000000006000830152602082019050919050565b6000613920601f8361470c565b91507f43616e6e6f742063616e63656c20616363657074656420636f6e7472616374006000830152602082019050919050565b6000613960601e8361470c565b91507f536166654d6174683a207375627472616374696f6e206f766572666c6f7700006000830152602082019050919050565b60006139a060268361470c565b91507f416464726573733a20696e73756666696369656e742062616c616e636520666f60008301527f722063616c6c00000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613a06601d8361470c565b91507f4d616e6167656420746f6b656e732063616e6e6f74206265207a65726f0000006000830152602082019050919050565b6000613a46601a8361470c565b91507f536166654d6174683a206469766973696f6e206279207a65726f0000000000006000830152602082019050919050565b6000613a8660118361470c565b91507f456d7074792062656e65666963696172790000000000000000000000000000006000830152602082019050919050565b6000613ac660138361470c565b91507f556e617574686f72697a65642063616c6c6572000000000000000000000000006000830152602082019050919050565b6000613b06601a8361470c565b91507f4d616e61676572206d757374206265206120636f6e74726163740000000000006000830152602082019050919050565b6000613b4660158361470c565b91507f416d6f756e742063616e6e6f74206265207a65726f00000000000000000000006000830152602082019050919050565b6000613b8660298361470c565b91507f43616e6e6f7420757365206d6f726520746f6b656e73207468616e207665737460008301527f656420616d6f756e7400000000000000000000000000000000000000000000006020830152604082019050919050565b6000613bec601f8361470c565b91507f506572696f64732063616e6e6f742062652062656c6f77206d696e696d756d006000830152602082019050919050565b6000613c2c60218361470c565b91507f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008301527f77000000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613c9260208361470c565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b6000613cd260168361470c565b91507f53746172742074696d65206d75737420626520736574000000000000000000006000830152602082019050919050565b6000613d1260158361470c565b91507f556e617574686f72697a65642066756e6374696f6e00000000000000000000006000830152602082019050919050565b6000613d52601d8361470c565b91507f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006000830152602082019050919050565b6000613d9260248361470c565b91507f416d6f756e7420726571756573746564203e20737572706c757320617661696c60008301527f61626c65000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613df860138361470c565b91507f416c726561647920696e697469616c697a6564000000000000000000000000006000830152602082019050919050565b6000613e3860198361470c565b91507f436f6e7472616374206973206e6f6e2d7265766f6361626c65000000000000006000830152602082019050919050565b6000613e7860178361470c565b91507f4d616e616765722063616e6e6f7420626520656d7074790000000000000000006000830152602082019050919050565b6000613eb860058361470c565b91507f21617574680000000000000000000000000000000000000000000000000000006000830152602082019050919050565b6000613ef8602a8361470c565b91507f52656c656173652073746172742074696d65206d757374206265206265666f7260008301527f6520656e642074696d65000000000000000000000000000000000000000000006020830152604082019050919050565b6000613f5e602a8361470c565b91507f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008301527f6f742073756363656564000000000000000000000000000000000000000000006020830152604082019050919050565b6000613fc4601e8361470c565b91507f4e6f20617661696c61626c652072656c65617361626c6520616d6f756e7400006000830152602082019050919050565b600061400460148361470c565b91507f546f6b656e2063616e6e6f74206265207a65726f0000000000000000000000006000830152602082019050919050565b6000614044601a8361470c565b91507f42656e65666963696172792063616e6e6f74206265207a65726f0000000000006000830152602082019050919050565b6000614084600f8361470c565b91507f416c7265616479207265766f6b656400000000000000000000000000000000006000830152602082019050919050565b6140c08161479a565b82525050565b60006140d282846135e1565b915081905092915050565b60006020820190506140f260008301846135b4565b92915050565b600060408201905061410d60008301856135b4565b61411a602083018461363f565b9392505050565b600060408201905061413660008301856135b4565b61414360208301846140b7565b9392505050565b600060208201905061415f60008301846135c3565b92915050565b600060208201905061417a60008301846135d2565b92915050565b60006020820190506141956000830184613612565b92915050565b60006020820190506141b06000830184613621565b92915050565b60006020820190506141cb6000830184613630565b92915050565b600060208201905081810360008301526141eb818461364e565b905092915050565b6000602082019050818103600083015261420c81613687565b9050919050565b6000602082019050818103600083015261422c816136c7565b9050919050565b6000602082019050818103600083015261424c81613707565b9050919050565b6000602082019050818103600083015261426c8161376d565b9050919050565b6000602082019050818103600083015261428c816137ad565b9050919050565b600060208201905081810360008301526142ac816137ed565b9050919050565b600060208201905081810360008301526142cc81613853565b9050919050565b600060208201905081810360008301526142ec81613893565b9050919050565b6000602082019050818103600083015261430c816138d3565b9050919050565b6000602082019050818103600083015261432c81613913565b9050919050565b6000602082019050818103600083015261434c81613953565b9050919050565b6000602082019050818103600083015261436c81613993565b9050919050565b6000602082019050818103600083015261438c816139f9565b9050919050565b600060208201905081810360008301526143ac81613a39565b9050919050565b600060208201905081810360008301526143cc81613a79565b9050919050565b600060208201905081810360008301526143ec81613ab9565b9050919050565b6000602082019050818103600083015261440c81613af9565b9050919050565b6000602082019050818103600083015261442c81613b39565b9050919050565b6000602082019050818103600083015261444c81613b79565b9050919050565b6000602082019050818103600083015261446c81613bdf565b9050919050565b6000602082019050818103600083015261448c81613c1f565b9050919050565b600060208201905081810360008301526144ac81613c85565b9050919050565b600060208201905081810360008301526144cc81613cc5565b9050919050565b600060208201905081810360008301526144ec81613d05565b9050919050565b6000602082019050818103600083015261450c81613d45565b9050919050565b6000602082019050818103600083015261452c81613d85565b9050919050565b6000602082019050818103600083015261454c81613deb565b9050919050565b6000602082019050818103600083015261456c81613e2b565b9050919050565b6000602082019050818103600083015261458c81613e6b565b9050919050565b600060208201905081810360008301526145ac81613eab565b9050919050565b600060208201905081810360008301526145cc81613eeb565b9050919050565b600060208201905081810360008301526145ec81613f51565b9050919050565b6000602082019050818103600083015261460c81613fb7565b9050919050565b6000602082019050818103600083015261462c81613ff7565b9050919050565b6000602082019050818103600083015261464c81614037565b9050919050565b6000602082019050818103600083015261466c81614077565b9050919050565b600060208201905061468860008301846140b7565b92915050565b6000604051905081810181811067ffffffffffffffff821117156146b5576146b4614843565b5b8060405250919050565b600067ffffffffffffffff8211156146da576146d9614843565b5b602082029050602081019050919050565b600081519050919050565b600081519050919050565b600081905092915050565b600082825260208201905092915050565b60006147288261477a565b9050919050565b60008115159050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600081905061477582614856565b919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60006147af826147b6565b9050919050565b60006147c18261477a565b9050919050565b60006147d3826147da565b9050919050565b60006147e58261477a565b9050919050565b60006147f782614767565b9050919050565b60006148098261479a565b9050919050565b60005b8381101561482e578082015181840152602081019050614813565b8381111561483d576000848401525b50505050565bfe5b6000601f19601f8301169050919050565b6003811061486757614866614843565b5b50565b6148738161471d565b811461487e57600080fd5b50565b61488a8161472f565b811461489557600080fd5b50565b600381106148a557600080fd5b50565b6148b18161479a565b81146148bc57600080fd5b5056fea2646970667358221220b518abe45075b1a754063c65b10410a7c177459a73d10704d7ef06453ab5c8d464736f6c63430007030033", + "devdoc": { + "kind": "dev", + "methods": { + "acceptLock()": { + "details": "Can only be called by the beneficiary" + }, + "amountPerPeriod()": { + "returns": { + "_0": "Amount of tokens available after each period" + } + }, + "approveProtocol()": { + "details": "Approves all token destinations registered in the manager to pull tokens" + }, + "availableAmount()": { + "details": "Implements the step-by-step schedule based on periods for available tokens", + "returns": { + "_0": "Amount of tokens available according to the schedule" + } + }, + "cancelLock()": { + "details": "Can only be called by the owner" + }, + "changeBeneficiary(address)": { + "details": "Can only be called by the beneficiary", + "params": { + "_newBeneficiary": "Address of the new beneficiary address" + } + }, + "currentBalance()": { + "returns": { + "_0": "Tokens held in the contract" + } + }, + "currentPeriod()": { + "returns": { + "_0": "A number that represents the current period" + } + }, + "currentTime()": { + "returns": { + "_0": "Current block timestamp" + } + }, + "duration()": { + "returns": { + "_0": "Amount of seconds from contract startTime to endTime" + } + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "passedPeriods()": { + "returns": { + "_0": "A number of periods that passed since the schedule started" + } + }, + "periodDuration()": { + "returns": { + "_0": "Duration of each period in seconds" + } + }, + "releasableAmount()": { + "details": "Considers the schedule, takes into account already released tokens and used amount", + "returns": { + "_0": "Amount of tokens ready to be released" + } + }, + "release()": { + "details": "All available releasable tokens are transferred to beneficiary" + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." + }, + "revoke()": { + "details": "Vesting schedule is always calculated based on managed tokens" + }, + "revokeProtocol()": { + "details": "Revokes approval to all token destinations in the manager to pull tokens" + }, + "setManager(address)": { + "params": { + "_newManager": "Address of the new manager" + } + }, + "sinceStartTime()": { + "details": "Returns zero if called before conctract starTime", + "returns": { + "_0": "Seconds elapsed from contract startTime" + } + }, + "surplusAmount()": { + "details": "All funds over outstanding amount is considered surplus that can be withdrawn by beneficiary. Note this might not be the correct value for wallets transferred to L2 (i.e. an L2GraphTokenLockWallet), as the released amount will be skewed, so the beneficiary might have to bridge back to L1 to release the surplus.", + "returns": { + "_0": "Amount of tokens considered as surplus" + } + }, + "totalOutstandingAmount()": { + "details": "Does not consider schedule but just global amounts tracked", + "returns": { + "_0": "Amount of outstanding tokens for the lifetime of the contract" + } + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + }, + "vestedAmount()": { + "details": "Similar to available amount, but is fully vested when contract is non-revocable", + "returns": { + "_0": "Amount of tokens already vested" + } + }, + "withdrawSurplus(uint256)": { + "details": "Tokens in the contract over outstanding amount are considered as surplus", + "params": { + "_amount": "Amount of tokens to withdraw" + } + } + }, + "title": "L2GraphTokenLockWallet", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "acceptLock()": { + "notice": "Beneficiary accepts the lock, the owner cannot retrieve back the tokens" + }, + "amountPerPeriod()": { + "notice": "Returns amount available to be released after each period according to schedule" + }, + "approveProtocol()": { + "notice": "Approves protocol access of the tokens managed by this contract" + }, + "availableAmount()": { + "notice": "Gets the currently available token according to the schedule" + }, + "cancelLock()": { + "notice": "Owner cancel the lock and return the balance in the contract" + }, + "changeBeneficiary(address)": { + "notice": "Change the beneficiary of funds managed by the contract" + }, + "currentBalance()": { + "notice": "Returns the amount of tokens currently held by the contract" + }, + "currentPeriod()": { + "notice": "Gets the current period based on the schedule" + }, + "currentTime()": { + "notice": "Returns the current block timestamp" + }, + "duration()": { + "notice": "Gets duration of contract from start to end in seconds" + }, + "passedPeriods()": { + "notice": "Gets the number of periods that passed since the first period" + }, + "periodDuration()": { + "notice": "Returns the duration of each period in seconds" + }, + "releasableAmount()": { + "notice": "Gets tokens currently available for release" + }, + "release()": { + "notice": "Releases tokens based on the configured schedule" + }, + "revoke()": { + "notice": "Revokes a vesting schedule and return the unvested tokens to the owner" + }, + "revokeProtocol()": { + "notice": "Revokes protocol access of the tokens managed by this contract" + }, + "setManager(address)": { + "notice": "Sets a new manager for this contract" + }, + "sinceStartTime()": { + "notice": "Gets time elapsed since the start of the contract" + }, + "surplusAmount()": { + "notice": "Gets surplus amount in the contract based on outstanding amount to release" + }, + "totalOutstandingAmount()": { + "notice": "Gets the outstanding amount yet to be released based on the whole contract lifetime" + }, + "vestedAmount()": { + "notice": "Gets the amount of currently vested tokens" + }, + "withdrawSurplus(uint256)": { + "notice": "Withdraws surplus, unmanaged tokens from the contract" + } + }, + "notice": "This contract is built on top of the base GraphTokenLock functionality. It allows wallet beneficiaries to use the deposited funds to perform specific function calls on specific contracts. The idea is that supporters with locked tokens can participate in the protocol but disallow any release before the vesting/lock schedule. The beneficiary can issue authorized function calls to this contract that will get forwarded to a target contract. A target contract is any of our protocol contracts. The function calls allowed are queried to the GraphTokenLockManager, this way the same configuration can be shared for all the created lock wallet contracts. This L2 variant includes a special initializer so that it can be created from a wallet's data received from L1. These transferred wallets will not allow releasing funds in L2 until the end of the vesting timeline, but they can allow withdrawing funds back to L1 using the L2GraphTokenLockTransferTool contract. Note that surplusAmount and releasedAmount in L2 will be skewed for wallets received from L1, so releasing surplus tokens might also only be possible by bridging tokens back to L1. NOTE: Contracts used as target must have its function signatures checked to avoid collisions with any of this contract functions. Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience the maximum amount of tokens is authorized. Function calls do not forward ETH value so DO NOT SEND ETH TO THIS CONTRACT.", + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 6817, + "contract": "contracts/L2GraphTokenLockWallet.sol:L2GraphTokenLockWallet", + "label": "_owner", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 6822, + "contract": "contracts/L2GraphTokenLockWallet.sol:L2GraphTokenLockWallet", + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 3244, + "contract": "contracts/L2GraphTokenLockWallet.sol:L2GraphTokenLockWallet", + "label": "token", + "offset": 0, + "slot": "51", + "type": "t_contract(IERC20)1710" + }, + { + "astId": 3246, + "contract": "contracts/L2GraphTokenLockWallet.sol:L2GraphTokenLockWallet", + "label": "beneficiary", + "offset": 0, + "slot": "52", + "type": "t_address" + }, + { + "astId": 3248, + "contract": "contracts/L2GraphTokenLockWallet.sol:L2GraphTokenLockWallet", + "label": "managedAmount", + "offset": 0, + "slot": "53", + "type": "t_uint256" + }, + { + "astId": 3250, + "contract": "contracts/L2GraphTokenLockWallet.sol:L2GraphTokenLockWallet", + "label": "startTime", + "offset": 0, + "slot": "54", + "type": "t_uint256" + }, + { + "astId": 3252, + "contract": "contracts/L2GraphTokenLockWallet.sol:L2GraphTokenLockWallet", + "label": "endTime", + "offset": 0, + "slot": "55", + "type": "t_uint256" + }, + { + "astId": 3254, + "contract": "contracts/L2GraphTokenLockWallet.sol:L2GraphTokenLockWallet", + "label": "periods", + "offset": 0, + "slot": "56", + "type": "t_uint256" + }, + { + "astId": 3256, + "contract": "contracts/L2GraphTokenLockWallet.sol:L2GraphTokenLockWallet", + "label": "releaseStartTime", + "offset": 0, + "slot": "57", + "type": "t_uint256" + }, + { + "astId": 3258, + "contract": "contracts/L2GraphTokenLockWallet.sol:L2GraphTokenLockWallet", + "label": "vestingCliffTime", + "offset": 0, + "slot": "58", + "type": "t_uint256" + }, + { + "astId": 3260, + "contract": "contracts/L2GraphTokenLockWallet.sol:L2GraphTokenLockWallet", + "label": "revocable", + "offset": 0, + "slot": "59", + "type": "t_enum(Revocability)5096" + }, + { + "astId": 3262, + "contract": "contracts/L2GraphTokenLockWallet.sol:L2GraphTokenLockWallet", + "label": "isRevoked", + "offset": 1, + "slot": "59", + "type": "t_bool" + }, + { + "astId": 3264, + "contract": "contracts/L2GraphTokenLockWallet.sol:L2GraphTokenLockWallet", + "label": "isInitialized", + "offset": 2, + "slot": "59", + "type": "t_bool" + }, + { + "astId": 3266, + "contract": "contracts/L2GraphTokenLockWallet.sol:L2GraphTokenLockWallet", + "label": "isAccepted", + "offset": 3, + "slot": "59", + "type": "t_bool" + }, + { + "astId": 3268, + "contract": "contracts/L2GraphTokenLockWallet.sol:L2GraphTokenLockWallet", + "label": "releasedAmount", + "offset": 0, + "slot": "60", + "type": "t_uint256" + }, + { + "astId": 3270, + "contract": "contracts/L2GraphTokenLockWallet.sol:L2GraphTokenLockWallet", + "label": "revokedAmount", + "offset": 0, + "slot": "61", + "type": "t_uint256" + }, + { + "astId": 4692, + "contract": "contracts/L2GraphTokenLockWallet.sol:L2GraphTokenLockWallet", + "label": "manager", + "offset": 0, + "slot": "62", + "type": "t_contract(IGraphTokenLockManager)5278" + }, + { + "astId": 4694, + "contract": "contracts/L2GraphTokenLockWallet.sol:L2GraphTokenLockWallet", + "label": "usedAmount", + "offset": 0, + "slot": "63", + "type": "t_uint256" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)50_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_contract(IERC20)1710": { + "encoding": "inplace", + "label": "contract IERC20", + "numberOfBytes": "20" + }, + "t_contract(IGraphTokenLockManager)5278": { + "encoding": "inplace", + "label": "contract IGraphTokenLockManager", + "numberOfBytes": "20" + }, + "t_enum(Revocability)5096": { + "encoding": "inplace", + "label": "enum IGraphTokenLock.Revocability", + "numberOfBytes": "1" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} \ No newline at end of file diff --git a/packages/token-distribution/deployments/arbitrum-sepolia/solcInputs/095bd30babc75057be19228ca1fd7aa4.json b/packages/token-distribution/deployments/arbitrum-sepolia/solcInputs/095bd30babc75057be19228ca1fd7aa4.json new file mode 100644 index 000000000..e7a4b87c0 --- /dev/null +++ b/packages/token-distribution/deployments/arbitrum-sepolia/solcInputs/095bd30babc75057be19228ca1fd7aa4.json @@ -0,0 +1,152 @@ +{ + "language": "Solidity", + "sources": { + "@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/**\n * @dev Wrappers over Solidity's arithmetic operations with added overflow\n * checks.\n *\n * Arithmetic operations in Solidity wrap on overflow. This can easily result\n * in bugs, because programmers usually assume that an overflow raises an\n * error, which is the standard behavior in high level programming languages.\n * `SafeMath` restores this intuition by reverting the transaction when an\n * operation overflows.\n *\n * Using this library instead of the unchecked operations eliminates an entire\n * class of bugs, so it's recommended to use it always.\n */\nlibrary SafeMathUpgradeable {\n /**\n * @dev Returns the addition of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n uint256 c = a + b;\n if (c < a) return (false, 0);\n return (true, c);\n }\n\n /**\n * @dev Returns the substraction of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n if (b > a) return (false, 0);\n return (true, a - b);\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\n // benefit is lost if 'b' is also tested.\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\n if (a == 0) return (true, 0);\n uint256 c = a * b;\n if (c / a != b) return (false, 0);\n return (true, c);\n }\n\n /**\n * @dev Returns the division of two unsigned integers, with a division by zero flag.\n *\n * _Available since v3.4._\n */\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n if (b == 0) return (false, 0);\n return (true, a / b);\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\n *\n * _Available since v3.4._\n */\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n if (b == 0) return (false, 0);\n return (true, a % b);\n }\n\n /**\n * @dev Returns the addition of two unsigned integers, reverting on\n * overflow.\n *\n * Counterpart to Solidity's `+` operator.\n *\n * Requirements:\n *\n * - Addition cannot overflow.\n */\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\n uint256 c = a + b;\n require(c >= a, \"SafeMath: addition overflow\");\n return c;\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, reverting on\n * overflow (when the result is negative).\n *\n * Counterpart to Solidity's `-` operator.\n *\n * Requirements:\n *\n * - Subtraction cannot overflow.\n */\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b <= a, \"SafeMath: subtraction overflow\");\n return a - b;\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, reverting on\n * overflow.\n *\n * Counterpart to Solidity's `*` operator.\n *\n * Requirements:\n *\n * - Multiplication cannot overflow.\n */\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n if (a == 0) return 0;\n uint256 c = a * b;\n require(c / a == b, \"SafeMath: multiplication overflow\");\n return c;\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers, reverting on\n * division by zero. The result is rounded towards zero.\n *\n * Counterpart to Solidity's `/` operator. Note: this function uses a\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\n * uses an invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b > 0, \"SafeMath: division by zero\");\n return a / b;\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * reverting when dividing by zero.\n *\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\n * opcode (which leaves remaining gas untouched) while Solidity uses an\n * invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b > 0, \"SafeMath: modulo by zero\");\n return a % b;\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\n * overflow (when the result is negative).\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {trySub}.\n *\n * Counterpart to Solidity's `-` operator.\n *\n * Requirements:\n *\n * - Subtraction cannot overflow.\n */\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b <= a, errorMessage);\n return a - b;\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers, reverting with custom message on\n * division by zero. The result is rounded towards zero.\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {tryDiv}.\n *\n * Counterpart to Solidity's `/` operator. Note: this function uses a\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\n * uses an invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b > 0, errorMessage);\n return a / b;\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * reverting with custom message when dividing by zero.\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {tryMod}.\n *\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\n * opcode (which leaves remaining gas untouched) while Solidity uses an\n * invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b > 0, errorMessage);\n return a % b;\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\n// solhint-disable-next-line compiler-version\npragma solidity >=0.4.24 <0.8.0;\n\nimport \"../utils/AddressUpgradeable.sol\";\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {UpgradeableProxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n */\nabstract contract Initializable {\n\n /**\n * @dev Indicates that the contract has been initialized.\n */\n bool private _initialized;\n\n /**\n * @dev Indicates that the contract is in the process of being initialized.\n */\n bool private _initializing;\n\n /**\n * @dev Modifier to protect an initializer function from being invoked twice.\n */\n modifier initializer() {\n require(_initializing || _isConstructor() || !_initialized, \"Initializable: contract is already initialized\");\n\n bool isTopLevelCall = !_initializing;\n if (isTopLevelCall) {\n _initializing = true;\n _initialized = true;\n }\n\n _;\n\n if (isTopLevelCall) {\n _initializing = false;\n }\n }\n\n /// @dev Returns true if and only if the function is running in the constructor\n function _isConstructor() private view returns (bool) {\n return !AddressUpgradeable.isContract(address(this));\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.2 <0.8.0;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary AddressUpgradeable {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize, which returns 0 for contracts in\n // construction, since the code is only stored at the end of the\n // constructor execution.\n\n uint256 size;\n // solhint-disable-next-line no-inline-assembly\n assembly { size := extcodesize(account) }\n return size > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n // solhint-disable-next-line avoid-low-level-calls, avoid-call-value\n (bool success, ) = recipient.call{ value: amount }(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain`call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCall(target, data, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n require(isContract(target), \"Address: call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.call{ value: value }(data);\n return _verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {\n require(isContract(target), \"Address: static call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.staticcall(data);\n return _verifyCallResult(success, returndata, errorMessage);\n }\n\n function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {\n if (success) {\n return returndata;\n } else {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n }\n}\n" + }, + "@openzeppelin/contracts/access/Ownable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\nimport \"../utils/Context.sol\";\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor () internal {\n address msgSender = _msgSender();\n _owner = msgSender;\n emit OwnershipTransferred(address(0), msgSender);\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n _;\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n emit OwnershipTransferred(_owner, address(0));\n _owner = address(0);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n emit OwnershipTransferred(_owner, newOwner);\n _owner = newOwner;\n }\n}\n" + }, + "@openzeppelin/contracts/math/SafeMath.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/**\n * @dev Wrappers over Solidity's arithmetic operations with added overflow\n * checks.\n *\n * Arithmetic operations in Solidity wrap on overflow. This can easily result\n * in bugs, because programmers usually assume that an overflow raises an\n * error, which is the standard behavior in high level programming languages.\n * `SafeMath` restores this intuition by reverting the transaction when an\n * operation overflows.\n *\n * Using this library instead of the unchecked operations eliminates an entire\n * class of bugs, so it's recommended to use it always.\n */\nlibrary SafeMath {\n /**\n * @dev Returns the addition of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n uint256 c = a + b;\n if (c < a) return (false, 0);\n return (true, c);\n }\n\n /**\n * @dev Returns the substraction of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n if (b > a) return (false, 0);\n return (true, a - b);\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\n // benefit is lost if 'b' is also tested.\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\n if (a == 0) return (true, 0);\n uint256 c = a * b;\n if (c / a != b) return (false, 0);\n return (true, c);\n }\n\n /**\n * @dev Returns the division of two unsigned integers, with a division by zero flag.\n *\n * _Available since v3.4._\n */\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n if (b == 0) return (false, 0);\n return (true, a / b);\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\n *\n * _Available since v3.4._\n */\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n if (b == 0) return (false, 0);\n return (true, a % b);\n }\n\n /**\n * @dev Returns the addition of two unsigned integers, reverting on\n * overflow.\n *\n * Counterpart to Solidity's `+` operator.\n *\n * Requirements:\n *\n * - Addition cannot overflow.\n */\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\n uint256 c = a + b;\n require(c >= a, \"SafeMath: addition overflow\");\n return c;\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, reverting on\n * overflow (when the result is negative).\n *\n * Counterpart to Solidity's `-` operator.\n *\n * Requirements:\n *\n * - Subtraction cannot overflow.\n */\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b <= a, \"SafeMath: subtraction overflow\");\n return a - b;\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, reverting on\n * overflow.\n *\n * Counterpart to Solidity's `*` operator.\n *\n * Requirements:\n *\n * - Multiplication cannot overflow.\n */\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n if (a == 0) return 0;\n uint256 c = a * b;\n require(c / a == b, \"SafeMath: multiplication overflow\");\n return c;\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers, reverting on\n * division by zero. The result is rounded towards zero.\n *\n * Counterpart to Solidity's `/` operator. Note: this function uses a\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\n * uses an invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b > 0, \"SafeMath: division by zero\");\n return a / b;\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * reverting when dividing by zero.\n *\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\n * opcode (which leaves remaining gas untouched) while Solidity uses an\n * invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b > 0, \"SafeMath: modulo by zero\");\n return a % b;\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\n * overflow (when the result is negative).\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {trySub}.\n *\n * Counterpart to Solidity's `-` operator.\n *\n * Requirements:\n *\n * - Subtraction cannot overflow.\n */\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b <= a, errorMessage);\n return a - b;\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers, reverting with custom message on\n * division by zero. The result is rounded towards zero.\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {tryDiv}.\n *\n * Counterpart to Solidity's `/` operator. Note: this function uses a\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\n * uses an invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b > 0, errorMessage);\n return a / b;\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * reverting with custom message when dividing by zero.\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {tryMod}.\n *\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\n * opcode (which leaves remaining gas untouched) while Solidity uses an\n * invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b > 0, errorMessage);\n return a % b;\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/ERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\nimport \"../../utils/Context.sol\";\nimport \"./IERC20.sol\";\nimport \"../../math/SafeMath.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin guidelines: functions revert instead\n * of returning `false` on failure. This behavior is nonetheless conventional\n * and does not conflict with the expectations of ERC20 applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20 {\n using SafeMath for uint256;\n\n mapping (address => uint256) private _balances;\n\n mapping (address => mapping (address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n uint8 private _decimals;\n\n /**\n * @dev Sets the values for {name} and {symbol}, initializes {decimals} with\n * a default value of 18.\n *\n * To select a different value for {decimals}, use {_setupDecimals}.\n *\n * All three of these values are immutable: they can only be set once during\n * construction.\n */\n constructor (string memory name_, string memory symbol_) public {\n _name = name_;\n _symbol = symbol_;\n _decimals = 18;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5,05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless {_setupDecimals} is\n * called.\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual returns (uint8) {\n return _decimals;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `recipient` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address recipient, uint256 amount) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * Requirements:\n *\n * - `sender` and `recipient` cannot be the zero address.\n * - `sender` must have a balance of at least `amount`.\n * - the caller must have allowance for ``sender``'s tokens of at least\n * `amount`.\n */\n function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, \"ERC20: transfer amount exceeds allowance\"));\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, \"ERC20: decreased allowance below zero\"));\n return true;\n }\n\n /**\n * @dev Moves tokens `amount` from `sender` to `recipient`.\n *\n * This is internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `sender` cannot be the zero address.\n * - `recipient` cannot be the zero address.\n * - `sender` must have a balance of at least `amount`.\n */\n function _transfer(address sender, address recipient, uint256 amount) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(sender, recipient, amount);\n\n _balances[sender] = _balances[sender].sub(amount, \"ERC20: transfer amount exceeds balance\");\n _balances[recipient] = _balances[recipient].add(amount);\n emit Transfer(sender, recipient, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply = _totalSupply.add(amount);\n _balances[account] = _balances[account].add(amount);\n emit Transfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n _balances[account] = _balances[account].sub(amount, \"ERC20: burn amount exceeds balance\");\n _totalSupply = _totalSupply.sub(amount);\n emit Transfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(address owner, address spender, uint256 amount) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Sets {decimals} to a value other than the default one of 18.\n *\n * WARNING: This function should only be called from the constructor. Most\n * applications that interact with token contracts will not expect\n * {decimals} to ever change, and may work incorrectly if it does.\n */\n function _setupDecimals(uint8 decimals_) internal virtual {\n _decimals = decimals_;\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be to transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `recipient`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address recipient, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `sender` to `recipient` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);\n\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/SafeERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"../../math/SafeMath.sol\";\nimport \"../../utils/Address.sol\";\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n using SafeMath for uint256;\n using Address for address;\n\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\n }\n\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\n }\n\n /**\n * @dev Deprecated. This function has issues similar to the ones found in\n * {IERC20-approve}, and its usage is discouraged.\n *\n * Whenever possible, use {safeIncreaseAllowance} and\n * {safeDecreaseAllowance} instead.\n */\n function safeApprove(IERC20 token, address spender, uint256 value) internal {\n // safeApprove should only be called when setting an initial allowance,\n // or when resetting it to zero. To increase and decrease it, use\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\n // solhint-disable-next-line max-line-length\n require((value == 0) || (token.allowance(address(this), spender) == 0),\n \"SafeERC20: approve from non-zero to non-zero allowance\"\n );\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\n }\n\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n uint256 newAllowance = token.allowance(address(this), spender).add(value);\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\n\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n uint256 newAllowance = token.allowance(address(this), spender).sub(value, \"SafeERC20: decreased allowance below zero\");\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n */\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that\n // the target address contains contract code and also asserts for success in the low-level call.\n\n bytes memory returndata = address(token).functionCall(data, \"SafeERC20: low-level call failed\");\n if (returndata.length > 0) { // Return data is optional\n // solhint-disable-next-line max-line-length\n require(abi.decode(returndata, (bool)), \"SafeERC20: ERC20 operation did not succeed\");\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Address.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.2 <0.8.0;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize, which returns 0 for contracts in\n // construction, since the code is only stored at the end of the\n // constructor execution.\n\n uint256 size;\n // solhint-disable-next-line no-inline-assembly\n assembly { size := extcodesize(account) }\n return size > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n // solhint-disable-next-line avoid-low-level-calls, avoid-call-value\n (bool success, ) = recipient.call{ value: amount }(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain`call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCall(target, data, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n require(isContract(target), \"Address: call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.call{ value: value }(data);\n return _verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {\n require(isContract(target), \"Address: static call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.staticcall(data);\n return _verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\n require(isContract(target), \"Address: delegate call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return _verifyCallResult(success, returndata, errorMessage);\n }\n\n function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {\n if (success) {\n return returndata;\n } else {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/*\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with GSN meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address payable) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes memory) {\n this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\n return msg.data;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Create2.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/**\n * @dev Helper to make usage of the `CREATE2` EVM opcode easier and safer.\n * `CREATE2` can be used to compute in advance the address where a smart\n * contract will be deployed, which allows for interesting new mechanisms known\n * as 'counterfactual interactions'.\n *\n * See the https://eips.ethereum.org/EIPS/eip-1014#motivation[EIP] for more\n * information.\n */\nlibrary Create2 {\n /**\n * @dev Deploys a contract using `CREATE2`. The address where the contract\n * will be deployed can be known in advance via {computeAddress}.\n *\n * The bytecode for a contract can be obtained from Solidity with\n * `type(contractName).creationCode`.\n *\n * Requirements:\n *\n * - `bytecode` must not be empty.\n * - `salt` must have not been used for `bytecode` already.\n * - the factory must have a balance of at least `amount`.\n * - if `amount` is non-zero, `bytecode` must have a `payable` constructor.\n */\n function deploy(uint256 amount, bytes32 salt, bytes memory bytecode) internal returns (address) {\n address addr;\n require(address(this).balance >= amount, \"Create2: insufficient balance\");\n require(bytecode.length != 0, \"Create2: bytecode length is zero\");\n // solhint-disable-next-line no-inline-assembly\n assembly {\n addr := create2(amount, add(bytecode, 0x20), mload(bytecode), salt)\n }\n require(addr != address(0), \"Create2: Failed on deploy\");\n return addr;\n }\n\n /**\n * @dev Returns the address where a contract will be stored if deployed via {deploy}. Any change in the\n * `bytecodeHash` or `salt` will result in a new destination address.\n */\n function computeAddress(bytes32 salt, bytes32 bytecodeHash) internal view returns (address) {\n return computeAddress(salt, bytecodeHash, address(this));\n }\n\n /**\n * @dev Returns the address where a contract will be stored if deployed via {deploy} from a contract located at\n * `deployer`. If `deployer` is this contract's address, returns the same value as {computeAddress}.\n */\n function computeAddress(bytes32 salt, bytes32 bytecodeHash, address deployer) internal pure returns (address) {\n bytes32 _data = keccak256(\n abi.encodePacked(bytes1(0xff), deployer, salt, bytecodeHash)\n );\n return address(uint160(uint256(_data)));\n }\n}\n" + }, + "@openzeppelin/contracts/utils/EnumerableSet.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/**\n * @dev Library for managing\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\n * types.\n *\n * Sets have the following properties:\n *\n * - Elements are added, removed, and checked for existence in constant time\n * (O(1)).\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\n *\n * ```\n * contract Example {\n * // Add the library methods\n * using EnumerableSet for EnumerableSet.AddressSet;\n *\n * // Declare a set state variable\n * EnumerableSet.AddressSet private mySet;\n * }\n * ```\n *\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\n * and `uint256` (`UintSet`) are supported.\n */\nlibrary EnumerableSet {\n // To implement this library for multiple types with as little code\n // repetition as possible, we write it in terms of a generic Set type with\n // bytes32 values.\n // The Set implementation uses private functions, and user-facing\n // implementations (such as AddressSet) are just wrappers around the\n // underlying Set.\n // This means that we can only create new EnumerableSets for types that fit\n // in bytes32.\n\n struct Set {\n // Storage of set values\n bytes32[] _values;\n\n // Position of the value in the `values` array, plus 1 because index 0\n // means a value is not in the set.\n mapping (bytes32 => uint256) _indexes;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function _add(Set storage set, bytes32 value) private returns (bool) {\n if (!_contains(set, value)) {\n set._values.push(value);\n // The value is stored at length-1, but we add 1 to all indexes\n // and use 0 as a sentinel value\n set._indexes[value] = set._values.length;\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function _remove(Set storage set, bytes32 value) private returns (bool) {\n // We read and store the value's index to prevent multiple reads from the same storage slot\n uint256 valueIndex = set._indexes[value];\n\n if (valueIndex != 0) { // Equivalent to contains(set, value)\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\n // the array, and then remove the last element (sometimes called as 'swap and pop').\n // This modifies the order of the array, as noted in {at}.\n\n uint256 toDeleteIndex = valueIndex - 1;\n uint256 lastIndex = set._values.length - 1;\n\n // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs\n // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.\n\n bytes32 lastvalue = set._values[lastIndex];\n\n // Move the last value to the index where the value to delete is\n set._values[toDeleteIndex] = lastvalue;\n // Update the index for the moved value\n set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based\n\n // Delete the slot where the moved value was stored\n set._values.pop();\n\n // Delete the index for the deleted slot\n delete set._indexes[value];\n\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\n return set._indexes[value] != 0;\n }\n\n /**\n * @dev Returns the number of values on the set. O(1).\n */\n function _length(Set storage set) private view returns (uint256) {\n return set._values.length;\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\n require(set._values.length > index, \"EnumerableSet: index out of bounds\");\n return set._values[index];\n }\n\n // Bytes32Set\n\n struct Bytes32Set {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _add(set._inner, value);\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _remove(set._inner, value);\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\n return _contains(set._inner, value);\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(Bytes32Set storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\n return _at(set._inner, index);\n }\n\n // AddressSet\n\n struct AddressSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(AddressSet storage set, address value) internal returns (bool) {\n return _add(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(AddressSet storage set, address value) internal returns (bool) {\n return _remove(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(AddressSet storage set, address value) internal view returns (bool) {\n return _contains(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(AddressSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\n return address(uint160(uint256(_at(set._inner, index))));\n }\n\n\n // UintSet\n\n struct UintSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(UintSet storage set, uint256 value) internal returns (bool) {\n return _add(set._inner, bytes32(value));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\n return _remove(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\n return _contains(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns the number of values on the set. O(1).\n */\n function length(UintSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\n return uint256(_at(set._inner, index));\n }\n}\n" + }, + "contracts/arbitrum/ITokenGateway.sol": { + "content": "// SPDX-License-Identifier: Apache-2.0\n\n/*\n * Copyright 2020, Offchain Labs, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * Originally copied from:\n * https://github.com/OffchainLabs/arbitrum/tree/e3a6307ad8a2dc2cad35728a2a9908cfd8dd8ef9/packages/arb-bridge-peripherals\n *\n * MODIFIED from Offchain Labs' implementation:\n * - Changed solidity version to 0.7.6 (pablo@edgeandnode.com)\n *\n */\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\ninterface ITokenGateway {\n /// @notice event deprecated in favor of DepositInitiated and WithdrawalInitiated\n // event OutboundTransferInitiated(\n // address token,\n // address indexed _from,\n // address indexed _to,\n // uint256 indexed _transferId,\n // uint256 _amount,\n // bytes _data\n // );\n\n /// @notice event deprecated in favor of DepositFinalized and WithdrawalFinalized\n // event InboundTransferFinalized(\n // address token,\n // address indexed _from,\n // address indexed _to,\n // uint256 indexed _transferId,\n // uint256 _amount,\n // bytes _data\n // );\n\n function outboundTransfer(\n address _token,\n address _to,\n uint256 _amount,\n uint256 _maxGas,\n uint256 _gasPriceBid,\n bytes calldata _data\n ) external payable returns (bytes memory);\n\n function finalizeInboundTransfer(\n address _token,\n address _from,\n address _to,\n uint256 _amount,\n bytes calldata _data\n ) external payable;\n\n /**\n * @notice Calculate the address used when bridging an ERC20 token\n * @dev the L1 and L2 address oracles may not always be in sync.\n * For example, a custom token may have been registered but not deployed or the contract self destructed.\n * @param l1ERC20 address of L1 token\n * @return L2 address of a bridged ERC20 token\n */\n function calculateL2TokenAddress(address l1ERC20) external view returns (address);\n}\n" + }, + "contracts/GraphTokenDistributor.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\nimport \"@openzeppelin/contracts/math/SafeMath.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\";\n\n/**\n * @title GraphTokenDistributor\n * @dev Contract that allows distribution of tokens to multiple beneficiaries.\n * The contract accept deposits in the configured token by anyone.\n * The owner can setup the desired distribution by setting the amount of tokens\n * assigned to each beneficiary account.\n * Beneficiaries claim for their allocated tokens.\n * Only the owner can withdraw tokens from this contract without limitations.\n * For the distribution to work this contract must be unlocked by the owner.\n */\ncontract GraphTokenDistributor is Ownable {\n using SafeMath for uint256;\n using SafeERC20 for IERC20;\n\n // -- State --\n\n bool public locked;\n mapping(address => uint256) public beneficiaries;\n\n IERC20 public token;\n\n // -- Events --\n\n event BeneficiaryUpdated(address indexed beneficiary, uint256 amount);\n event TokensDeposited(address indexed sender, uint256 amount);\n event TokensWithdrawn(address indexed sender, uint256 amount);\n event TokensClaimed(address indexed beneficiary, address to, uint256 amount);\n event LockUpdated(bool locked);\n\n modifier whenNotLocked() {\n require(locked == false, \"Distributor: Claim is locked\");\n _;\n }\n\n /**\n * Constructor.\n * @param _token Token to use for deposits and withdrawals\n */\n constructor(IERC20 _token) {\n token = _token;\n locked = true;\n }\n\n /**\n * Deposit tokens into the contract.\n * Even if the ERC20 token can be transferred directly to the contract\n * this function provide a safe interface to do the transfer and avoid mistakes\n * @param _amount Amount to deposit\n */\n function deposit(uint256 _amount) external {\n token.safeTransferFrom(msg.sender, address(this), _amount);\n emit TokensDeposited(msg.sender, _amount);\n }\n\n // -- Admin functions --\n\n /**\n * Add token balance available for account.\n * @param _account Address to assign tokens to\n * @param _amount Amount of tokens to assign to beneficiary\n */\n function addBeneficiaryTokens(address _account, uint256 _amount) external onlyOwner {\n _setBeneficiaryTokens(_account, beneficiaries[_account].add(_amount));\n }\n\n /**\n * Add token balance available for multiple accounts.\n * @param _accounts Addresses to assign tokens to\n * @param _amounts Amounts of tokens to assign to beneficiary\n */\n function addBeneficiaryTokensMulti(address[] calldata _accounts, uint256[] calldata _amounts) external onlyOwner {\n require(_accounts.length == _amounts.length, \"Distributor: !length\");\n for (uint256 i = 0; i < _accounts.length; i++) {\n _setBeneficiaryTokens(_accounts[i], beneficiaries[_accounts[i]].add(_amounts[i]));\n }\n }\n\n /**\n * Remove token balance available for account.\n * @param _account Address to assign tokens to\n * @param _amount Amount of tokens to assign to beneficiary\n */\n function subBeneficiaryTokens(address _account, uint256 _amount) external onlyOwner {\n _setBeneficiaryTokens(_account, beneficiaries[_account].sub(_amount));\n }\n\n /**\n * Remove token balance available for multiple accounts.\n * @param _accounts Addresses to assign tokens to\n * @param _amounts Amounts of tokens to assign to beneficiary\n */\n function subBeneficiaryTokensMulti(address[] calldata _accounts, uint256[] calldata _amounts) external onlyOwner {\n require(_accounts.length == _amounts.length, \"Distributor: !length\");\n for (uint256 i = 0; i < _accounts.length; i++) {\n _setBeneficiaryTokens(_accounts[i], beneficiaries[_accounts[i]].sub(_amounts[i]));\n }\n }\n\n /**\n * Set amount of tokens available for beneficiary account.\n * @param _account Address to assign tokens to\n * @param _amount Amount of tokens to assign to beneficiary\n */\n function _setBeneficiaryTokens(address _account, uint256 _amount) private {\n require(_account != address(0), \"Distributor: !account\");\n\n beneficiaries[_account] = _amount;\n emit BeneficiaryUpdated(_account, _amount);\n }\n\n /**\n * Set locked withdrawals.\n * @param _locked True to lock withdrawals\n */\n function setLocked(bool _locked) external onlyOwner {\n locked = _locked;\n emit LockUpdated(_locked);\n }\n\n /**\n * Withdraw tokens from the contract. This function is included as\n * a escape hatch in case of mistakes or to recover remaining funds.\n * @param _amount Amount of tokens to withdraw\n */\n function withdraw(uint256 _amount) external onlyOwner {\n token.safeTransfer(msg.sender, _amount);\n emit TokensWithdrawn(msg.sender, _amount);\n }\n\n // -- Beneficiary functions --\n\n /**\n * Claim tokens and send to caller.\n */\n function claim() external whenNotLocked {\n claimTo(msg.sender);\n }\n\n /**\n * Claim tokens and send to address.\n * @param _to Address where to send tokens\n */\n function claimTo(address _to) public whenNotLocked {\n uint256 claimableTokens = beneficiaries[msg.sender];\n require(claimableTokens > 0, \"Distributor: Unavailable funds\");\n\n _setBeneficiaryTokens(msg.sender, 0);\n\n token.safeTransfer(_to, claimableTokens);\n emit TokensClaimed(msg.sender, _to, claimableTokens);\n }\n}\n" + }, + "contracts/GraphTokenLock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport \"@openzeppelin/contracts/math/SafeMath.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\";\n\nimport { Ownable as OwnableInitializable } from \"./Ownable.sol\";\nimport \"./MathUtils.sol\";\nimport \"./IGraphTokenLock.sol\";\n\n/**\n * @title GraphTokenLock\n * @notice Contract that manages an unlocking schedule of tokens.\n * @dev The contract lock manage a number of tokens deposited into the contract to ensure that\n * they can only be released under certain time conditions.\n *\n * This contract implements a release scheduled based on periods and tokens are released in steps\n * after each period ends. It can be configured with one period in which case it is like a plain TimeLock.\n * It also supports revocation to be used for vesting schedules.\n *\n * The contract supports receiving extra funds than the managed tokens ones that can be\n * withdrawn by the beneficiary at any time.\n *\n * A releaseStartTime parameter is included to override the default release schedule and\n * perform the first release on the configured time. After that it will continue with the\n * default schedule.\n */\nabstract contract GraphTokenLock is OwnableInitializable, IGraphTokenLock {\n using SafeMath for uint256;\n using SafeERC20 for IERC20;\n\n uint256 private constant MIN_PERIOD = 1;\n\n // -- State --\n\n IERC20 public token;\n address public beneficiary;\n\n // Configuration\n\n // Amount of tokens managed by the contract schedule\n uint256 public managedAmount;\n\n uint256 public startTime; // Start datetime (in unixtimestamp)\n uint256 public endTime; // Datetime after all funds are fully vested/unlocked (in unixtimestamp)\n uint256 public periods; // Number of vesting/release periods\n\n // First release date for tokens (in unixtimestamp)\n // If set, no tokens will be released before releaseStartTime ignoring\n // the amount to release each period\n uint256 public releaseStartTime;\n // A cliff set a date to which a beneficiary needs to get to vest\n // all preceding periods\n uint256 public vestingCliffTime;\n Revocability public revocable; // Whether to use vesting for locked funds\n\n // State\n\n bool public isRevoked;\n bool public isInitialized;\n bool public isAccepted;\n uint256 public releasedAmount;\n uint256 public revokedAmount;\n\n // -- Events --\n\n event TokensReleased(address indexed beneficiary, uint256 amount);\n event TokensWithdrawn(address indexed beneficiary, uint256 amount);\n event TokensRevoked(address indexed beneficiary, uint256 amount);\n event BeneficiaryChanged(address newBeneficiary);\n event LockAccepted();\n event LockCanceled();\n\n /**\n * @dev Only allow calls from the beneficiary of the contract\n */\n modifier onlyBeneficiary() {\n require(msg.sender == beneficiary, \"!auth\");\n _;\n }\n\n /**\n * @notice Initializes the contract\n * @param _owner Address of the contract owner\n * @param _beneficiary Address of the beneficiary of locked tokens\n * @param _managedAmount Amount of tokens to be managed by the lock contract\n * @param _startTime Start time of the release schedule\n * @param _endTime End time of the release schedule\n * @param _periods Number of periods between start time and end time\n * @param _releaseStartTime Override time for when the releases start\n * @param _vestingCliffTime Override time for when the vesting start\n * @param _revocable Whether the contract is revocable\n */\n function _initialize(\n address _owner,\n address _beneficiary,\n address _token,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n Revocability _revocable\n ) internal {\n require(!isInitialized, \"Already initialized\");\n require(_owner != address(0), \"Owner cannot be zero\");\n require(_beneficiary != address(0), \"Beneficiary cannot be zero\");\n require(_token != address(0), \"Token cannot be zero\");\n require(_managedAmount > 0, \"Managed tokens cannot be zero\");\n require(_startTime != 0, \"Start time must be set\");\n require(_startTime < _endTime, \"Start time > end time\");\n require(_periods >= MIN_PERIOD, \"Periods cannot be below minimum\");\n require(_revocable != Revocability.NotSet, \"Must set a revocability option\");\n require(_releaseStartTime < _endTime, \"Release start time must be before end time\");\n require(_vestingCliffTime < _endTime, \"Cliff time must be before end time\");\n\n isInitialized = true;\n\n OwnableInitializable._initialize(_owner);\n beneficiary = _beneficiary;\n token = IERC20(_token);\n\n managedAmount = _managedAmount;\n\n startTime = _startTime;\n endTime = _endTime;\n periods = _periods;\n\n // Optionals\n releaseStartTime = _releaseStartTime;\n vestingCliffTime = _vestingCliffTime;\n revocable = _revocable;\n }\n\n /**\n * @notice Change the beneficiary of funds managed by the contract\n * @dev Can only be called by the beneficiary\n * @param _newBeneficiary Address of the new beneficiary address\n */\n function changeBeneficiary(address _newBeneficiary) external onlyBeneficiary {\n require(_newBeneficiary != address(0), \"Empty beneficiary\");\n beneficiary = _newBeneficiary;\n emit BeneficiaryChanged(_newBeneficiary);\n }\n\n /**\n * @notice Beneficiary accepts the lock, the owner cannot retrieve back the tokens\n * @dev Can only be called by the beneficiary\n */\n function acceptLock() external onlyBeneficiary {\n isAccepted = true;\n emit LockAccepted();\n }\n\n /**\n * @notice Owner cancel the lock and return the balance in the contract\n * @dev Can only be called by the owner\n */\n function cancelLock() external onlyOwner {\n require(isAccepted == false, \"Cannot cancel accepted contract\");\n\n token.safeTransfer(owner(), currentBalance());\n\n emit LockCanceled();\n }\n\n // -- Balances --\n\n /**\n * @notice Returns the amount of tokens currently held by the contract\n * @return Tokens held in the contract\n */\n function currentBalance() public view override returns (uint256) {\n return token.balanceOf(address(this));\n }\n\n // -- Time & Periods --\n\n /**\n * @notice Returns the current block timestamp\n * @return Current block timestamp\n */\n function currentTime() public view override returns (uint256) {\n return block.timestamp;\n }\n\n /**\n * @notice Gets duration of contract from start to end in seconds\n * @return Amount of seconds from contract startTime to endTime\n */\n function duration() public view override returns (uint256) {\n return endTime.sub(startTime);\n }\n\n /**\n * @notice Gets time elapsed since the start of the contract\n * @dev Returns zero if called before conctract starTime\n * @return Seconds elapsed from contract startTime\n */\n function sinceStartTime() public view override returns (uint256) {\n uint256 current = currentTime();\n if (current <= startTime) {\n return 0;\n }\n return current.sub(startTime);\n }\n\n /**\n * @notice Returns amount available to be released after each period according to schedule\n * @return Amount of tokens available after each period\n */\n function amountPerPeriod() public view override returns (uint256) {\n return managedAmount.div(periods);\n }\n\n /**\n * @notice Returns the duration of each period in seconds\n * @return Duration of each period in seconds\n */\n function periodDuration() public view override returns (uint256) {\n return duration().div(periods);\n }\n\n /**\n * @notice Gets the current period based on the schedule\n * @return A number that represents the current period\n */\n function currentPeriod() public view override returns (uint256) {\n return sinceStartTime().div(periodDuration()).add(MIN_PERIOD);\n }\n\n /**\n * @notice Gets the number of periods that passed since the first period\n * @return A number of periods that passed since the schedule started\n */\n function passedPeriods() public view override returns (uint256) {\n return currentPeriod().sub(MIN_PERIOD);\n }\n\n // -- Locking & Release Schedule --\n\n /**\n * @notice Gets the currently available token according to the schedule\n * @dev Implements the step-by-step schedule based on periods for available tokens\n * @return Amount of tokens available according to the schedule\n */\n function availableAmount() public view override returns (uint256) {\n uint256 current = currentTime();\n\n // Before contract start no funds are available\n if (current < startTime) {\n return 0;\n }\n\n // After contract ended all funds are available\n if (current > endTime) {\n return managedAmount;\n }\n\n // Get available amount based on period\n return passedPeriods().mul(amountPerPeriod());\n }\n\n /**\n * @notice Gets the amount of currently vested tokens\n * @dev Similar to available amount, but is fully vested when contract is non-revocable\n * @return Amount of tokens already vested\n */\n function vestedAmount() public view override returns (uint256) {\n // If non-revocable it is fully vested\n if (revocable == Revocability.Disabled) {\n return managedAmount;\n }\n\n // Vesting cliff is activated and it has not passed means nothing is vested yet\n if (vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\n return 0;\n }\n\n return availableAmount();\n }\n\n /**\n * @notice Gets tokens currently available for release\n * @dev Considers the schedule and takes into account already released tokens\n * @return Amount of tokens ready to be released\n */\n function releasableAmount() public view virtual override returns (uint256) {\n // If a release start time is set no tokens are available for release before this date\n // If not set it follows the default schedule and tokens are available on\n // the first period passed\n if (releaseStartTime > 0 && currentTime() < releaseStartTime) {\n return 0;\n }\n\n // Vesting cliff is activated and it has not passed means nothing is vested yet\n // so funds cannot be released\n if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\n return 0;\n }\n\n // A beneficiary can never have more releasable tokens than the contract balance\n uint256 releasable = availableAmount().sub(releasedAmount);\n return MathUtils.min(currentBalance(), releasable);\n }\n\n /**\n * @notice Gets the outstanding amount yet to be released based on the whole contract lifetime\n * @dev Does not consider schedule but just global amounts tracked\n * @return Amount of outstanding tokens for the lifetime of the contract\n */\n function totalOutstandingAmount() public view override returns (uint256) {\n return managedAmount.sub(releasedAmount).sub(revokedAmount);\n }\n\n /**\n * @notice Gets surplus amount in the contract based on outstanding amount to release\n * @dev All funds over outstanding amount is considered surplus that can be withdrawn by beneficiary.\n * Note this might not be the correct value for wallets transferred to L2 (i.e. an L2GraphTokenLockWallet), as the released amount will be\n * skewed, so the beneficiary might have to bridge back to L1 to release the surplus.\n * @return Amount of tokens considered as surplus\n */\n function surplusAmount() public view override returns (uint256) {\n uint256 balance = currentBalance();\n uint256 outstandingAmount = totalOutstandingAmount();\n if (balance > outstandingAmount) {\n return balance.sub(outstandingAmount);\n }\n return 0;\n }\n\n // -- Value Transfer --\n\n /**\n * @notice Releases tokens based on the configured schedule\n * @dev All available releasable tokens are transferred to beneficiary\n */\n function release() external override onlyBeneficiary {\n uint256 amountToRelease = releasableAmount();\n require(amountToRelease > 0, \"No available releasable amount\");\n\n releasedAmount = releasedAmount.add(amountToRelease);\n\n token.safeTransfer(beneficiary, amountToRelease);\n\n emit TokensReleased(beneficiary, amountToRelease);\n }\n\n /**\n * @notice Withdraws surplus, unmanaged tokens from the contract\n * @dev Tokens in the contract over outstanding amount are considered as surplus\n * @param _amount Amount of tokens to withdraw\n */\n function withdrawSurplus(uint256 _amount) external override onlyBeneficiary {\n require(_amount > 0, \"Amount cannot be zero\");\n require(surplusAmount() >= _amount, \"Amount requested > surplus available\");\n\n token.safeTransfer(beneficiary, _amount);\n\n emit TokensWithdrawn(beneficiary, _amount);\n }\n\n /**\n * @notice Revokes a vesting schedule and return the unvested tokens to the owner\n * @dev Vesting schedule is always calculated based on managed tokens\n */\n function revoke() external override onlyOwner {\n require(revocable == Revocability.Enabled, \"Contract is non-revocable\");\n require(isRevoked == false, \"Already revoked\");\n\n uint256 unvestedAmount = managedAmount.sub(vestedAmount());\n require(unvestedAmount > 0, \"No available unvested amount\");\n\n revokedAmount = unvestedAmount;\n isRevoked = true;\n\n token.safeTransfer(owner(), unvestedAmount);\n\n emit TokensRevoked(beneficiary, unvestedAmount);\n }\n}\n" + }, + "contracts/GraphTokenLockManager.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\";\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"@openzeppelin/contracts/utils/EnumerableSet.sol\";\nimport { Ownable } from \"@openzeppelin/contracts/access/Ownable.sol\";\n\nimport \"./MinimalProxyFactory.sol\";\nimport \"./IGraphTokenLockManager.sol\";\nimport { GraphTokenLockWallet } from \"./GraphTokenLockWallet.sol\";\n\n/**\n * @title GraphTokenLockManager\n * @notice This contract manages a list of authorized function calls and targets that can be called\n * by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts.\n *\n * This contract receives funds to make the process of creating TokenLockWallet contracts\n * easier by distributing them the initial tokens to be managed.\n *\n * The owner can setup a list of token destinations that will be used by TokenLock contracts to\n * approve the pulling of funds, this way in can be guaranteed that only protocol contracts\n * will manipulate users funds.\n */\ncontract GraphTokenLockManager is Ownable, MinimalProxyFactory, IGraphTokenLockManager {\n using SafeERC20 for IERC20;\n using EnumerableSet for EnumerableSet.AddressSet;\n\n // -- State --\n\n mapping(bytes4 => address) public authFnCalls;\n EnumerableSet.AddressSet private _tokenDestinations;\n\n address public masterCopy;\n IERC20 internal _token;\n\n // -- Events --\n\n event MasterCopyUpdated(address indexed masterCopy);\n event TokenLockCreated(\n address indexed contractAddress,\n bytes32 indexed initHash,\n address indexed beneficiary,\n address token,\n uint256 managedAmount,\n uint256 startTime,\n uint256 endTime,\n uint256 periods,\n uint256 releaseStartTime,\n uint256 vestingCliffTime,\n IGraphTokenLock.Revocability revocable\n );\n\n event TokensDeposited(address indexed sender, uint256 amount);\n event TokensWithdrawn(address indexed sender, uint256 amount);\n\n event FunctionCallAuth(address indexed caller, bytes4 indexed sigHash, address indexed target, string signature);\n event TokenDestinationAllowed(address indexed dst, bool allowed);\n\n /**\n * Constructor.\n * @param _graphToken Token to use for deposits and withdrawals\n * @param _masterCopy Address of the master copy to use to clone proxies\n */\n constructor(IERC20 _graphToken, address _masterCopy) {\n require(address(_graphToken) != address(0), \"Token cannot be zero\");\n _token = _graphToken;\n setMasterCopy(_masterCopy);\n }\n\n // -- Factory --\n\n /**\n * @notice Sets the masterCopy bytecode to use to create clones of TokenLock contracts\n * @param _masterCopy Address of contract bytecode to factory clone\n */\n function setMasterCopy(address _masterCopy) public override onlyOwner {\n require(_masterCopy != address(0), \"MasterCopy cannot be zero\");\n masterCopy = _masterCopy;\n emit MasterCopyUpdated(_masterCopy);\n }\n\n /**\n * @notice Creates and fund a new token lock wallet using a minimum proxy\n * @param _owner Address of the contract owner\n * @param _beneficiary Address of the beneficiary of locked tokens\n * @param _managedAmount Amount of tokens to be managed by the lock contract\n * @param _startTime Start time of the release schedule\n * @param _endTime End time of the release schedule\n * @param _periods Number of periods between start time and end time\n * @param _releaseStartTime Override time for when the releases start\n * @param _revocable Whether the contract is revocable\n */\n function createTokenLockWallet(\n address _owner,\n address _beneficiary,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n IGraphTokenLock.Revocability _revocable\n ) external override onlyOwner {\n require(_token.balanceOf(address(this)) >= _managedAmount, \"Not enough tokens to create lock\");\n\n // Create contract using a minimal proxy and call initializer\n bytes memory initializer = abi.encodeWithSelector(\n GraphTokenLockWallet.initialize.selector,\n address(this),\n _owner,\n _beneficiary,\n address(_token),\n _managedAmount,\n _startTime,\n _endTime,\n _periods,\n _releaseStartTime,\n _vestingCliffTime,\n _revocable\n );\n address contractAddress = _deployProxy2(keccak256(initializer), masterCopy, initializer);\n\n // Send managed amount to the created contract\n _token.safeTransfer(contractAddress, _managedAmount);\n\n emit TokenLockCreated(\n contractAddress,\n keccak256(initializer),\n _beneficiary,\n address(_token),\n _managedAmount,\n _startTime,\n _endTime,\n _periods,\n _releaseStartTime,\n _vestingCliffTime,\n _revocable\n );\n }\n\n // -- Funds Management --\n\n /**\n * @notice Gets the GRT token address\n * @return Token used for transfers and approvals\n */\n function token() external view override returns (IERC20) {\n return _token;\n }\n\n /**\n * @notice Deposits tokens into the contract\n * @dev Even if the ERC20 token can be transferred directly to the contract\n * this function provide a safe interface to do the transfer and avoid mistakes\n * @param _amount Amount to deposit\n */\n function deposit(uint256 _amount) external override {\n require(_amount > 0, \"Amount cannot be zero\");\n _token.safeTransferFrom(msg.sender, address(this), _amount);\n emit TokensDeposited(msg.sender, _amount);\n }\n\n /**\n * @notice Withdraws tokens from the contract\n * @dev Escape hatch in case of mistakes or to recover remaining funds\n * @param _amount Amount of tokens to withdraw\n */\n function withdraw(uint256 _amount) external override onlyOwner {\n require(_amount > 0, \"Amount cannot be zero\");\n _token.safeTransfer(msg.sender, _amount);\n emit TokensWithdrawn(msg.sender, _amount);\n }\n\n // -- Token Destinations --\n\n /**\n * @notice Adds an address that can be allowed by a token lock to pull funds\n * @param _dst Destination address\n */\n function addTokenDestination(address _dst) external override onlyOwner {\n require(_dst != address(0), \"Destination cannot be zero\");\n require(_tokenDestinations.add(_dst), \"Destination already added\");\n emit TokenDestinationAllowed(_dst, true);\n }\n\n /**\n * @notice Removes an address that can be allowed by a token lock to pull funds\n * @param _dst Destination address\n */\n function removeTokenDestination(address _dst) external override onlyOwner {\n require(_tokenDestinations.remove(_dst), \"Destination already removed\");\n emit TokenDestinationAllowed(_dst, false);\n }\n\n /**\n * @notice Returns True if the address is authorized to be a destination of tokens\n * @param _dst Destination address\n * @return True if authorized\n */\n function isTokenDestination(address _dst) external view override returns (bool) {\n return _tokenDestinations.contains(_dst);\n }\n\n /**\n * @notice Returns an array of authorized destination addresses\n * @return Array of addresses authorized to pull funds from a token lock\n */\n function getTokenDestinations() external view override returns (address[] memory) {\n address[] memory dstList = new address[](_tokenDestinations.length());\n for (uint256 i = 0; i < _tokenDestinations.length(); i++) {\n dstList[i] = _tokenDestinations.at(i);\n }\n return dstList;\n }\n\n // -- Function Call Authorization --\n\n /**\n * @notice Sets an authorized function call to target\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\n * @param _signature Function signature\n * @param _target Address of the destination contract to call\n */\n function setAuthFunctionCall(string calldata _signature, address _target) external override onlyOwner {\n _setAuthFunctionCall(_signature, _target);\n }\n\n /**\n * @notice Unsets an authorized function call to target\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\n * @param _signature Function signature\n */\n function unsetAuthFunctionCall(string calldata _signature) external override onlyOwner {\n bytes4 sigHash = _toFunctionSigHash(_signature);\n authFnCalls[sigHash] = address(0);\n\n emit FunctionCallAuth(msg.sender, sigHash, address(0), _signature);\n }\n\n /**\n * @notice Sets an authorized function call to target in bulk\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\n * @param _signatures Function signatures\n * @param _targets Address of the destination contract to call\n */\n function setAuthFunctionCallMany(\n string[] calldata _signatures,\n address[] calldata _targets\n ) external override onlyOwner {\n require(_signatures.length == _targets.length, \"Array length mismatch\");\n\n for (uint256 i = 0; i < _signatures.length; i++) {\n _setAuthFunctionCall(_signatures[i], _targets[i]);\n }\n }\n\n /**\n * @notice Sets an authorized function call to target\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\n * @dev Function signatures of Graph Protocol contracts to be used are known ahead of time\n * @param _signature Function signature\n * @param _target Address of the destination contract to call\n */\n function _setAuthFunctionCall(string calldata _signature, address _target) internal {\n require(_target != address(this), \"Target must be other contract\");\n require(Address.isContract(_target), \"Target must be a contract\");\n\n bytes4 sigHash = _toFunctionSigHash(_signature);\n authFnCalls[sigHash] = _target;\n\n emit FunctionCallAuth(msg.sender, sigHash, _target, _signature);\n }\n\n /**\n * @notice Gets the target contract to call for a particular function signature\n * @param _sigHash Function signature hash\n * @return Address of the target contract where to send the call\n */\n function getAuthFunctionCallTarget(bytes4 _sigHash) public view override returns (address) {\n return authFnCalls[_sigHash];\n }\n\n /**\n * @notice Returns true if the function call is authorized\n * @param _sigHash Function signature hash\n * @return True if authorized\n */\n function isAuthFunctionCall(bytes4 _sigHash) external view override returns (bool) {\n return getAuthFunctionCallTarget(_sigHash) != address(0);\n }\n\n /**\n * @dev Converts a function signature string to 4-bytes hash\n * @param _signature Function signature string\n * @return Function signature hash\n */\n function _toFunctionSigHash(string calldata _signature) internal pure returns (bytes4) {\n return _convertToBytes4(abi.encodeWithSignature(_signature));\n }\n\n /**\n * @dev Converts function signature bytes to function signature hash (bytes4)\n * @param _signature Function signature\n * @return Function signature in bytes4\n */\n function _convertToBytes4(bytes memory _signature) internal pure returns (bytes4) {\n require(_signature.length == 4, \"Invalid method signature\");\n bytes4 sigHash;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n sigHash := mload(add(_signature, 32))\n }\n return sigHash;\n }\n}\n" + }, + "contracts/GraphTokenLockSimple.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport \"./GraphTokenLock.sol\";\n\n/**\n * @title GraphTokenLockSimple\n * @notice This contract is the concrete simple implementation built on top of the base\n * GraphTokenLock functionality for use when we only need the token lock schedule\n * features but no interaction with the network.\n *\n * This contract is designed to be deployed without the use of a TokenManager.\n */\ncontract GraphTokenLockSimple is GraphTokenLock {\n // Constructor\n constructor() {\n OwnableInitializable._initialize(msg.sender);\n }\n\n // Initializer\n function initialize(\n address _owner,\n address _beneficiary,\n address _token,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n Revocability _revocable\n ) external onlyOwner {\n _initialize(\n _owner,\n _beneficiary,\n _token,\n _managedAmount,\n _startTime,\n _endTime,\n _periods,\n _releaseStartTime,\n _vestingCliffTime,\n _revocable\n );\n }\n}\n" + }, + "contracts/GraphTokenLockWallet.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"@openzeppelin/contracts/math/SafeMath.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\nimport \"./GraphTokenLock.sol\";\nimport \"./IGraphTokenLockManager.sol\";\n\n/**\n * @title GraphTokenLockWallet\n * @notice This contract is built on top of the base GraphTokenLock functionality.\n * It allows wallet beneficiaries to use the deposited funds to perform specific function calls\n * on specific contracts.\n *\n * The idea is that supporters with locked tokens can participate in the protocol\n * but disallow any release before the vesting/lock schedule.\n * The beneficiary can issue authorized function calls to this contract that will\n * get forwarded to a target contract. A target contract is any of our protocol contracts.\n * The function calls allowed are queried to the GraphTokenLockManager, this way\n * the same configuration can be shared for all the created lock wallet contracts.\n *\n * NOTE: Contracts used as target must have its function signatures checked to avoid collisions\n * with any of this contract functions.\n * Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience\n * the maximum amount of tokens is authorized.\n * Function calls do not forward ETH value so DO NOT SEND ETH TO THIS CONTRACT.\n */\ncontract GraphTokenLockWallet is GraphTokenLock {\n using SafeMath for uint256;\n\n // -- State --\n\n IGraphTokenLockManager public manager;\n uint256 public usedAmount;\n\n // -- Events --\n\n event ManagerUpdated(address indexed _oldManager, address indexed _newManager);\n event TokenDestinationsApproved();\n event TokenDestinationsRevoked();\n\n // Initializer\n function initialize(\n address _manager,\n address _owner,\n address _beneficiary,\n address _token,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n Revocability _revocable\n ) external {\n _initialize(\n _owner,\n _beneficiary,\n _token,\n _managedAmount,\n _startTime,\n _endTime,\n _periods,\n _releaseStartTime,\n _vestingCliffTime,\n _revocable\n );\n _setManager(_manager);\n }\n\n // -- Admin --\n\n /**\n * @notice Sets a new manager for this contract\n * @param _newManager Address of the new manager\n */\n function setManager(address _newManager) external onlyOwner {\n _setManager(_newManager);\n }\n\n /**\n * @dev Sets a new manager for this contract\n * @param _newManager Address of the new manager\n */\n function _setManager(address _newManager) internal {\n require(_newManager != address(0), \"Manager cannot be empty\");\n require(Address.isContract(_newManager), \"Manager must be a contract\");\n\n address oldManager = address(manager);\n manager = IGraphTokenLockManager(_newManager);\n\n emit ManagerUpdated(oldManager, _newManager);\n }\n\n // -- Beneficiary --\n\n /**\n * @notice Approves protocol access of the tokens managed by this contract\n * @dev Approves all token destinations registered in the manager to pull tokens\n */\n function approveProtocol() external onlyBeneficiary {\n address[] memory dstList = manager.getTokenDestinations();\n for (uint256 i = 0; i < dstList.length; i++) {\n // Note this is only safe because we are using the max uint256 value\n token.approve(dstList[i], type(uint256).max);\n }\n emit TokenDestinationsApproved();\n }\n\n /**\n * @notice Revokes protocol access of the tokens managed by this contract\n * @dev Revokes approval to all token destinations in the manager to pull tokens\n */\n function revokeProtocol() external onlyBeneficiary {\n address[] memory dstList = manager.getTokenDestinations();\n for (uint256 i = 0; i < dstList.length; i++) {\n // Note this is only safe cause we're using 0 as the amount\n token.approve(dstList[i], 0);\n }\n emit TokenDestinationsRevoked();\n }\n\n /**\n * @notice Gets tokens currently available for release\n * @dev Considers the schedule, takes into account already released tokens and used amount\n * @return Amount of tokens ready to be released\n */\n function releasableAmount() public view override returns (uint256) {\n if (revocable == Revocability.Disabled) {\n return super.releasableAmount();\n }\n\n // -- Revocability enabled logic\n // This needs to deal with additional considerations for when tokens are used in the protocol\n\n // If a release start time is set no tokens are available for release before this date\n // If not set it follows the default schedule and tokens are available on\n // the first period passed\n if (releaseStartTime > 0 && currentTime() < releaseStartTime) {\n return 0;\n }\n\n // Vesting cliff is activated and it has not passed means nothing is vested yet\n // so funds cannot be released\n if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\n return 0;\n }\n\n // A beneficiary can never have more releasable tokens than the contract balance\n // We consider the `usedAmount` in the protocol as part of the calculations\n // the beneficiary should not release funds that are used.\n uint256 releasable = availableAmount().sub(releasedAmount).sub(usedAmount);\n return MathUtils.min(currentBalance(), releasable);\n }\n\n /**\n * @notice Forward authorized contract calls to protocol contracts\n * @dev Fallback function can be called by the beneficiary only if function call is allowed\n */\n // solhint-disable-next-line no-complex-fallback\n fallback() external payable {\n // Only beneficiary can forward calls\n require(msg.sender == beneficiary, \"Unauthorized caller\");\n require(msg.value == 0, \"ETH transfers not supported\");\n\n // Function call validation\n address _target = manager.getAuthFunctionCallTarget(msg.sig);\n require(_target != address(0), \"Unauthorized function\");\n\n uint256 oldBalance = currentBalance();\n\n // Call function with data\n Address.functionCall(_target, msg.data);\n\n // Tracked used tokens in the protocol\n // We do this check after balances were updated by the forwarded call\n // Check is only enforced for revocable contracts to save some gas\n if (revocable == Revocability.Enabled) {\n // Track contract balance change\n uint256 newBalance = currentBalance();\n if (newBalance < oldBalance) {\n // Outflow\n uint256 diff = oldBalance.sub(newBalance);\n usedAmount = usedAmount.add(diff);\n } else {\n // Inflow: We can receive profits from the protocol, that could make usedAmount to\n // underflow. We set it to zero in that case.\n uint256 diff = newBalance.sub(oldBalance);\n usedAmount = (diff >= usedAmount) ? 0 : usedAmount.sub(diff);\n }\n require(usedAmount <= vestedAmount(), \"Cannot use more tokens than vested amount\");\n }\n }\n\n /**\n * @notice Receive function that always reverts.\n * @dev Only included to supress warnings, see https://github.com/ethereum/solidity/issues/10159\n */\n receive() external payable {\n revert(\"Bad call\");\n }\n}\n" + }, + "contracts/ICallhookReceiver.sol": { + "content": "// SPDX-License-Identifier: GPL-2.0-or-later\n\n// Copied from graphprotocol/contracts, changed solidity version to 0.7.3\n\n/**\n * @title Interface for contracts that can receive callhooks through the Arbitrum GRT bridge\n * @dev Any contract that can receive a callhook on L2, sent through the bridge from L1, must\n * be allowlisted by the governor, but also implement this interface that contains\n * the function that will actually be called by the L2GraphTokenGateway.\n */\npragma solidity ^0.7.3;\n\ninterface ICallhookReceiver {\n /**\n * @notice Receive tokens with a callhook from the bridge\n * @param _from Token sender in L1\n * @param _amount Amount of tokens that were transferred\n * @param _data ABI-encoded callhook data\n */\n function onTokenTransfer(address _from, uint256 _amount, bytes calldata _data) external;\n}\n" + }, + "contracts/IGraphTokenLock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\ninterface IGraphTokenLock {\n enum Revocability {\n NotSet,\n Enabled,\n Disabled\n }\n\n // -- Balances --\n\n function currentBalance() external view returns (uint256);\n\n // -- Time & Periods --\n\n function currentTime() external view returns (uint256);\n\n function duration() external view returns (uint256);\n\n function sinceStartTime() external view returns (uint256);\n\n function amountPerPeriod() external view returns (uint256);\n\n function periodDuration() external view returns (uint256);\n\n function currentPeriod() external view returns (uint256);\n\n function passedPeriods() external view returns (uint256);\n\n // -- Locking & Release Schedule --\n\n function availableAmount() external view returns (uint256);\n\n function vestedAmount() external view returns (uint256);\n\n function releasableAmount() external view returns (uint256);\n\n function totalOutstandingAmount() external view returns (uint256);\n\n function surplusAmount() external view returns (uint256);\n\n // -- Value Transfer --\n\n function release() external;\n\n function withdrawSurplus(uint256 _amount) external;\n\n function revoke() external;\n}\n" + }, + "contracts/IGraphTokenLockManager.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\nimport \"./IGraphTokenLock.sol\";\n\ninterface IGraphTokenLockManager {\n // -- Factory --\n\n function setMasterCopy(address _masterCopy) external;\n\n function createTokenLockWallet(\n address _owner,\n address _beneficiary,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n IGraphTokenLock.Revocability _revocable\n ) external;\n\n // -- Funds Management --\n\n function token() external returns (IERC20);\n\n function deposit(uint256 _amount) external;\n\n function withdraw(uint256 _amount) external;\n\n // -- Allowed Funds Destinations --\n\n function addTokenDestination(address _dst) external;\n\n function removeTokenDestination(address _dst) external;\n\n function isTokenDestination(address _dst) external view returns (bool);\n\n function getTokenDestinations() external view returns (address[] memory);\n\n // -- Function Call Authorization --\n\n function setAuthFunctionCall(string calldata _signature, address _target) external;\n\n function unsetAuthFunctionCall(string calldata _signature) external;\n\n function setAuthFunctionCallMany(string[] calldata _signatures, address[] calldata _targets) external;\n\n function getAuthFunctionCallTarget(bytes4 _sigHash) external view returns (address);\n\n function isAuthFunctionCall(bytes4 _sigHash) external view returns (bool);\n}\n" + }, + "contracts/L1GraphTokenLockTransferTool.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport { AddressUpgradeable } from \"@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol\";\nimport { ITokenGateway } from \"./arbitrum/ITokenGateway.sol\";\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport { L2GraphTokenLockManager } from \"./L2GraphTokenLockManager.sol\";\nimport { GraphTokenLockWallet } from \"./GraphTokenLockWallet.sol\";\nimport { MinimalProxyFactory } from \"./MinimalProxyFactory.sol\";\nimport { IGraphTokenLock } from \"./IGraphTokenLock.sol\";\nimport { Ownable as OwnableInitializable } from \"./Ownable.sol\";\nimport { SafeMathUpgradeable } from \"@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol\";\nimport { Initializable } from \"@openzeppelin/contracts-upgradeable/proxy/Initializable.sol\";\n\n/**\n * @title L1GraphTokenLockTransferTool contract\n * @notice This contract is used to transfer GRT from GraphTokenLockWallets\n * to a counterpart on L2. It is deployed on L1 and will send the GRT through\n * the L1GraphTokenGateway with a callhook to the L2GraphTokenLockManager, including\n * data to create a L2GraphTokenLockWallet on L2.\n *\n * Note that the L2GraphTokenLockWallet will not allow releasing any GRT until the end of\n * the vesting timeline, but will allow sending the GRT back to the L1 wallet.\n *\n * Beneficiaries for a GraphTokenLockWallet can perform the depositToL2Locked call\n * as many times as they want, and the GRT will be sent to the same L2GraphTokenLockWallet.\n *\n * Since all retryable tickets to send transactions to L2 require ETH for gas, this\n * contract also allows users to deposit ETH to be used for gas on L2, both for\n * the depositToL2Locked calls and for the transfer tools in the Staking contract for\n * The Graph.\n *\n * See GIP-0046 for more details: https://forum.thegraph.com/t/4023\n */\ncontract L1GraphTokenLockTransferTool is OwnableInitializable, Initializable, MinimalProxyFactory {\n using SafeMathUpgradeable for uint256;\n\n /// Address of the L1 GRT token contract\n IERC20 public immutable graphToken;\n /// Address of the L2GraphTokenLockWallet implementation in L2, used to compute L2 wallet addresses\n address public immutable l2Implementation;\n /// Address of the L1GraphTokenGateway contract\n ITokenGateway public immutable l1Gateway;\n /// Address of the Staking contract, used to pull ETH for L2 ticket gas\n address payable public immutable staking;\n /// L2 lock manager for each L1 lock manager.\n /// L1 GraphTokenLockManager => L2GraphTokenLockManager\n mapping(address => address) public l2LockManager;\n /// L2 wallet owner for each L1 wallet owner.\n /// L1 wallet owner => L2 wallet owner\n mapping(address => address) public l2WalletOwner;\n /// L2 wallet address for each L1 wallet address.\n /// L1 wallet => L2 wallet\n mapping(address => address) public l2WalletAddress;\n /// ETH balance from each token lock, used to pay for L2 gas:\n /// L1 wallet address => ETH balance\n mapping(address => uint256) public tokenLockETHBalances;\n /// L2 beneficiary corresponding to each L1 wallet address.\n /// L1 wallet => L2 beneficiary\n mapping(address => address) public l2Beneficiary;\n /// Indicates whether an L2 wallet address for a wallet\n /// has been set manually, in which case it can't call depositToL2Locked.\n /// L1 wallet => bool\n mapping(address => bool) public l2WalletAddressSetManually;\n\n /// @dev Emitted when the L2 lock manager for an L1 lock manager is set\n event L2LockManagerSet(address indexed l1LockManager, address indexed l2LockManager);\n /// @dev Emitted when the L2 wallet owner for an L1 wallet owner is set\n event L2WalletOwnerSet(address indexed l1WalletOwner, address indexed l2WalletOwner);\n /// @dev Emitted when GRT is sent to L2 from a token lock\n event LockedFundsSentToL2(\n address indexed l1Wallet,\n address indexed l2Wallet,\n address indexed l1LockManager,\n address l2LockManager,\n uint256 amount\n );\n /// @dev Emitted when an L2 wallet address is set for an L1 wallet\n event L2WalletAddressSet(address indexed l1Wallet, address indexed l2Wallet);\n /// @dev Emitted when ETH is deposited to a token lock's account\n event ETHDeposited(address indexed tokenLock, uint256 amount);\n /// @dev Emitted when ETH is withdrawn from a token lock's account\n event ETHWithdrawn(address indexed tokenLock, address indexed destination, uint256 amount);\n /// @dev Emitted when ETH is pulled from a token lock's account by Staking or this tool to pay for an L2 ticket\n event ETHPulled(address indexed tokenLock, uint256 amount);\n /// @dev Emitted when the L2 beneficiary for a partially vested L1 lock is set\n event L2BeneficiarySet(address indexed l1Wallet, address indexed l2Beneficiary);\n\n /**\n * @notice Construct a new L1GraphTokenLockTransferTool contract\n * @dev The deployer of the contract will become its owner.\n * Note this contract is meant to be deployed behind a transparent proxy,\n * so this will run at the implementation's storage context; it will set\n * immutable variables and make the implementation be owned by the deployer.\n * @param _graphToken Address of the L1 GRT token contract\n * @param _l2Implementation Address of the L2GraphTokenLockWallet implementation in L2\n * @param _l1Gateway Address of the L1GraphTokenGateway contract\n * @param _staking Address of the Staking contract\n */\n constructor(\n IERC20 _graphToken,\n address _l2Implementation,\n ITokenGateway _l1Gateway,\n address payable _staking\n ) initializer {\n OwnableInitializable._initialize(msg.sender);\n graphToken = _graphToken;\n l2Implementation = _l2Implementation;\n l1Gateway = _l1Gateway;\n staking = _staking;\n }\n\n /**\n * @notice Initialize the L1GraphTokenLockTransferTool contract\n * @dev This function will run in the proxy's storage context, so it will\n * set the owner of the proxy contract which can be different from the implementation owner.\n * @param _owner Address of the owner of the L1GraphTokenLockTransferTool contract\n */\n function initialize(address _owner) external initializer {\n OwnableInitializable._initialize(_owner);\n }\n\n /**\n * @notice Set the L2 lock manager that corresponds to an L1 lock manager\n * @param _l1LockManager Address of the L1 lock manager\n * @param _l2LockManager Address of the L2 lock manager (in L2)\n */\n function setL2LockManager(address _l1LockManager, address _l2LockManager) external onlyOwner {\n l2LockManager[_l1LockManager] = _l2LockManager;\n emit L2LockManagerSet(_l1LockManager, _l2LockManager);\n }\n\n /**\n * @notice Set the L2 wallet owner that corresponds to an L1 wallet owner\n * @param _l1WalletOwner Address of the L1 wallet owner\n * @param _l2WalletOwner Address of the L2 wallet owner (in L2)\n */\n function setL2WalletOwner(address _l1WalletOwner, address _l2WalletOwner) external onlyOwner {\n l2WalletOwner[_l1WalletOwner] = _l2WalletOwner;\n emit L2WalletOwnerSet(_l1WalletOwner, _l2WalletOwner);\n }\n\n /**\n * @notice Deposit ETH on a token lock's account, to be used for L2 retryable ticket gas.\n * This function can be called by anyone, but the ETH will be credited to the token lock.\n * DO NOT try to call this through the token lock, as locks do not forward ETH value (and the\n * function call should not be allowlisted).\n * @param _tokenLock Address of the L1 GraphTokenLockWallet that will own the ETH\n */\n function depositETH(address _tokenLock) external payable {\n tokenLockETHBalances[_tokenLock] = tokenLockETHBalances[_tokenLock].add(msg.value);\n emit ETHDeposited(_tokenLock, msg.value);\n }\n\n /**\n * @notice Withdraw ETH from a token lock's account.\n * This function must be called from the token lock contract, but the destination\n * _must_ be a different address, as any ETH sent to the token lock would otherwise be\n * lost.\n * @param _destination Address to send the ETH\n * @param _amount Amount of ETH to send\n */\n function withdrawETH(address _destination, uint256 _amount) external {\n require(_amount > 0, \"INVALID_AMOUNT\");\n // We can't send eth to a token lock or it will be stuck\n require(msg.sender != _destination, \"INVALID_DESTINATION\");\n require(tokenLockETHBalances[msg.sender] >= _amount, \"INSUFFICIENT_BALANCE\");\n tokenLockETHBalances[msg.sender] -= _amount;\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, ) = payable(_destination).call{ value: _amount }(\"\");\n require(success, \"TRANSFER_FAILED\");\n emit ETHWithdrawn(msg.sender, _destination, _amount);\n }\n\n /**\n * @notice Pull ETH from a token lock's account, to be used for L2 retryable ticket gas.\n * This can only be called by the Staking contract.\n * @param _tokenLock GraphTokenLockWallet that owns the ETH that will be debited\n * @param _amount Amount of ETH to pull\n */\n function pullETH(address _tokenLock, uint256 _amount) external {\n require(msg.sender == staking, \"ONLY_STAKING\");\n require(tokenLockETHBalances[_tokenLock] >= _amount, \"INSUFFICIENT_BALANCE\");\n tokenLockETHBalances[_tokenLock] -= _amount;\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, ) = staking.call{ value: _amount }(\"\");\n require(success, \"TRANSFER_FAILED\");\n emit ETHPulled(_tokenLock, _amount);\n }\n\n /**\n * @notice Deposit GRT to L2, from a token lock in L1 to a token lock in L2.\n * If the token lock in L2 does not exist, it will be created when the message is received\n * by the L2GraphTokenLockManager.\n * Before calling this (which must be done through the token lock wallet), make sure\n * there is enough ETH in the token lock's account to cover the L2 retryable ticket gas.\n * Note that L2 submission fee and gas refunds will be lost.\n * You can add ETH to the token lock's account by calling depositETH().\n * Note that after calling this, you will NOT be able to use setL2WalletAddressManually() to\n * set an L2 wallet address, as the L2 wallet address will be set automatically when the\n * message is received by the L2GraphTokenLockManager.\n * @dev The gas parameters for L2 can be estimated using the Arbitrum SDK.\n * @param _amount Amount of GRT to deposit\n * @param _l2Beneficiary Address of the beneficiary for the token lock in L2. Must be the same for subsequent calls of this function, and not an L1 contract.\n * @param _maxGas Maximum gas to use for the L2 retryable ticket\n * @param _gasPriceBid Gas price to use for the L2 retryable ticket\n * @param _maxSubmissionCost Max submission cost for the L2 retryable ticket\n */\n function depositToL2Locked(\n uint256 _amount,\n address _l2Beneficiary,\n uint256 _maxGas,\n uint256 _gasPriceBid,\n uint256 _maxSubmissionCost\n ) external {\n // Check that msg.sender is a GraphTokenLockWallet\n // That uses GRT and has a corresponding manager set in L2.\n GraphTokenLockWallet wallet = GraphTokenLockWallet(msg.sender);\n require(wallet.token() == graphToken, \"INVALID_TOKEN\");\n address l1Manager = address(wallet.manager());\n address l2Manager = l2LockManager[l1Manager];\n require(l2Manager != address(0), \"INVALID_MANAGER\");\n require(wallet.isInitialized(), \"!INITIALIZED\");\n require(wallet.revocable() != IGraphTokenLock.Revocability.Enabled, \"REVOCABLE\");\n require(_amount <= graphToken.balanceOf(msg.sender), \"INSUFFICIENT_BALANCE\");\n require(_amount != 0, \"ZERO_AMOUNT\");\n\n if (l2Beneficiary[msg.sender] == address(0)) {\n require(_l2Beneficiary != address(0), \"INVALID_BENEFICIARY_ZERO\");\n require(!AddressUpgradeable.isContract(_l2Beneficiary), \"INVALID_BENEFICIARY_CONTRACT\");\n l2Beneficiary[msg.sender] = _l2Beneficiary;\n emit L2BeneficiarySet(msg.sender, _l2Beneficiary);\n } else {\n require(l2Beneficiary[msg.sender] == _l2Beneficiary, \"INVALID_BENEFICIARY\");\n }\n\n uint256 expectedEth = _maxSubmissionCost.add(_maxGas.mul(_gasPriceBid));\n require(tokenLockETHBalances[msg.sender] >= expectedEth, \"INSUFFICIENT_ETH_BALANCE\");\n tokenLockETHBalances[msg.sender] -= expectedEth;\n\n bytes memory encodedData;\n {\n address l2Owner = l2WalletOwner[wallet.owner()];\n require(l2Owner != address(0), \"L2_OWNER_NOT_SET\");\n // Extract all the storage variables from the GraphTokenLockWallet\n L2GraphTokenLockManager.TransferredWalletData memory data = L2GraphTokenLockManager.TransferredWalletData({\n l1Address: msg.sender,\n owner: l2Owner,\n beneficiary: l2Beneficiary[msg.sender],\n managedAmount: wallet.managedAmount(),\n startTime: wallet.startTime(),\n endTime: wallet.endTime()\n });\n encodedData = abi.encode(data);\n }\n\n if (l2WalletAddress[msg.sender] == address(0)) {\n require(wallet.endTime() >= block.timestamp, \"FULLY_VESTED_USE_MANUAL_ADDRESS\");\n address newAddress = getDeploymentAddress(keccak256(encodedData), l2Implementation, l2Manager);\n l2WalletAddress[msg.sender] = newAddress;\n emit L2WalletAddressSet(msg.sender, newAddress);\n } else {\n require(!l2WalletAddressSetManually[msg.sender], \"CANT_DEPOSIT_TO_MANUAL_ADDRESS\");\n }\n\n graphToken.transferFrom(msg.sender, address(this), _amount);\n\n // Send the tokens with a message through the L1GraphTokenGateway to the L2GraphTokenLockManager\n graphToken.approve(address(l1Gateway), _amount);\n {\n bytes memory transferData = abi.encode(_maxSubmissionCost, encodedData);\n l1Gateway.outboundTransfer{ value: expectedEth }(\n address(graphToken),\n l2Manager,\n _amount,\n _maxGas,\n _gasPriceBid,\n transferData\n );\n }\n emit ETHPulled(msg.sender, expectedEth);\n emit LockedFundsSentToL2(msg.sender, l2WalletAddress[msg.sender], l1Manager, l2Manager, _amount);\n }\n\n /**\n * @notice Manually set the L2 wallet address for a token lock in L1.\n * This will only work for token locks that have not been initialized in L2 yet, and\n * that are fully vested (endTime < current timestamp).\n * This address can then be used to send stake or delegation to L2 on the Staking contract.\n * After calling this, the vesting lock will NOT be allowed to use depositToL2Locked\n * to send GRT to L2, the beneficiary must withdraw the tokens and bridge them manually.\n * @param _l2Wallet Address of the L2 wallet\n */\n function setL2WalletAddressManually(address _l2Wallet) external {\n // Check that msg.sender is a GraphTokenLockWallet\n // That uses GRT and has a corresponding manager set in L2.\n GraphTokenLockWallet wallet = GraphTokenLockWallet(msg.sender);\n require(wallet.token() == graphToken, \"INVALID_TOKEN\");\n address l1Manager = address(wallet.manager());\n address l2Manager = l2LockManager[l1Manager];\n require(l2Manager != address(0), \"INVALID_MANAGER\");\n require(wallet.isInitialized(), \"!INITIALIZED\");\n\n // Check that the wallet is fully vested\n require(wallet.endTime() < block.timestamp, \"NOT_FULLY_VESTED\");\n\n // Check that the wallet has not set an L2 wallet yet\n require(l2WalletAddress[msg.sender] == address(0), \"L2_WALLET_ALREADY_SET\");\n\n // Check that the L2 address is not zero\n require(_l2Wallet != address(0), \"ZERO_ADDRESS\");\n // Set the L2 wallet address\n l2WalletAddress[msg.sender] = _l2Wallet;\n l2WalletAddressSetManually[msg.sender] = true;\n emit L2WalletAddressSet(msg.sender, _l2Wallet);\n }\n}\n" + }, + "contracts/L2GraphTokenLockManager.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport { SafeERC20 } from \"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\";\n\nimport { ICallhookReceiver } from \"./ICallhookReceiver.sol\";\nimport { GraphTokenLockManager } from \"./GraphTokenLockManager.sol\";\nimport { L2GraphTokenLockWallet } from \"./L2GraphTokenLockWallet.sol\";\n\n/**\n * @title L2GraphTokenLockManager\n * @notice This contract manages a list of authorized function calls and targets that can be called\n * by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts.\n *\n * This contract receives funds to make the process of creating TokenLockWallet contracts\n * easier by distributing them the initial tokens to be managed.\n *\n * In particular, this L2 variant is designed to receive token lock wallets from L1,\n * through the GRT bridge. These transferred wallets will not allow releasing funds in L2 until\n * the end of the vesting timeline, but they can allow withdrawing funds back to L1 using\n * the L2GraphTokenLockTransferTool contract.\n *\n * The owner can setup a list of token destinations that will be used by TokenLock contracts to\n * approve the pulling of funds, this way in can be guaranteed that only protocol contracts\n * will manipulate users funds.\n */\ncontract L2GraphTokenLockManager is GraphTokenLockManager, ICallhookReceiver {\n using SafeERC20 for IERC20;\n\n /// @dev Struct to hold the data of a transferred wallet; this is\n /// the data that must be encoded in L1 to send a wallet to L2.\n struct TransferredWalletData {\n address l1Address;\n address owner;\n address beneficiary;\n uint256 managedAmount;\n uint256 startTime;\n uint256 endTime;\n }\n\n /// Address of the L2GraphTokenGateway\n address public immutable l2Gateway;\n /// Address of the L1 transfer tool contract (in L1, no aliasing)\n address public immutable l1TransferTool;\n /// Mapping of each L1 wallet to its L2 wallet counterpart (populated when each wallet is received)\n /// L1 address => L2 address\n mapping(address => address) public l1WalletToL2Wallet;\n /// Mapping of each L2 wallet to its L1 wallet counterpart (populated when each wallet is received)\n /// L2 address => L1 address\n mapping(address => address) public l2WalletToL1Wallet;\n\n /// @dev Event emitted when a wallet is received and created from L1\n event TokenLockCreatedFromL1(\n address indexed contractAddress,\n bytes32 initHash,\n address indexed beneficiary,\n uint256 managedAmount,\n uint256 startTime,\n uint256 endTime,\n address indexed l1Address\n );\n\n /// @dev Emitted when locked tokens are received from L1 (whether the wallet\n /// had already been received or not)\n event LockedTokensReceivedFromL1(address indexed l1Address, address indexed l2Address, uint256 amount);\n\n /**\n * @dev Checks that the sender is the L2GraphTokenGateway.\n */\n modifier onlyL2Gateway() {\n require(msg.sender == l2Gateway, \"ONLY_GATEWAY\");\n _;\n }\n\n /**\n * @notice Constructor for the L2GraphTokenLockManager contract.\n * @param _graphToken Address of the L2 GRT token contract\n * @param _masterCopy Address of the master copy of the L2GraphTokenLockWallet implementation\n * @param _l2Gateway Address of the L2GraphTokenGateway contract\n * @param _l1TransferTool Address of the L1 transfer tool contract (in L1, without aliasing)\n */\n constructor(\n IERC20 _graphToken,\n address _masterCopy,\n address _l2Gateway,\n address _l1TransferTool\n ) GraphTokenLockManager(_graphToken, _masterCopy) {\n l2Gateway = _l2Gateway;\n l1TransferTool = _l1TransferTool;\n }\n\n /**\n * @notice This function is called by the L2GraphTokenGateway when tokens are sent from L1.\n * @dev This function will create a new wallet if it doesn't exist yet, or send the tokens to\n * the existing wallet if it does.\n * @param _from Address of the sender in L1, which must be the L1GraphTokenLockTransferTool\n * @param _amount Amount of tokens received\n * @param _data Encoded data of the transferred wallet, which must be an ABI-encoded TransferredWalletData struct\n */\n function onTokenTransfer(address _from, uint256 _amount, bytes calldata _data) external override onlyL2Gateway {\n require(_from == l1TransferTool, \"ONLY_TRANSFER_TOOL\");\n TransferredWalletData memory walletData = abi.decode(_data, (TransferredWalletData));\n\n if (l1WalletToL2Wallet[walletData.l1Address] != address(0)) {\n // If the wallet was already received, just send the tokens to the L2 address\n _token.safeTransfer(l1WalletToL2Wallet[walletData.l1Address], _amount);\n } else {\n // Create contract using a minimal proxy and call initializer\n (bytes32 initHash, address contractAddress) = _deployFromL1(keccak256(_data), walletData);\n l1WalletToL2Wallet[walletData.l1Address] = contractAddress;\n l2WalletToL1Wallet[contractAddress] = walletData.l1Address;\n\n // Send managed amount to the created contract\n _token.safeTransfer(contractAddress, _amount);\n\n emit TokenLockCreatedFromL1(\n contractAddress,\n initHash,\n walletData.beneficiary,\n walletData.managedAmount,\n walletData.startTime,\n walletData.endTime,\n walletData.l1Address\n );\n }\n emit LockedTokensReceivedFromL1(walletData.l1Address, l1WalletToL2Wallet[walletData.l1Address], _amount);\n }\n\n /**\n * @dev Deploy a token lock wallet with data received from L1\n * @param _salt Salt for the CREATE2 call, which must be the hash of the wallet data\n * @param _walletData Data of the wallet to be created\n * @return Hash of the initialization calldata\n * @return Address of the created contract\n */\n function _deployFromL1(bytes32 _salt, TransferredWalletData memory _walletData) internal returns (bytes32, address) {\n bytes memory initializer = _encodeInitializer(_walletData);\n address contractAddress = _deployProxy2(_salt, masterCopy, initializer);\n return (keccak256(initializer), contractAddress);\n }\n\n /**\n * @dev Encode the initializer for the token lock wallet received from L1\n * @param _walletData Data of the wallet to be created\n * @return Encoded initializer calldata, including the function signature\n */\n function _encodeInitializer(TransferredWalletData memory _walletData) internal view returns (bytes memory) {\n return\n abi.encodeWithSelector(\n L2GraphTokenLockWallet.initializeFromL1.selector,\n address(this),\n address(_token),\n _walletData\n );\n }\n}\n" + }, + "contracts/L2GraphTokenLockTransferTool.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\nimport { L2GraphTokenLockManager } from \"./L2GraphTokenLockManager.sol\";\nimport { L2GraphTokenLockWallet } from \"./L2GraphTokenLockWallet.sol\";\nimport { ITokenGateway } from \"./arbitrum/ITokenGateway.sol\";\n\n/**\n * @title L2GraphTokenLockTransferTool contract\n * @notice This contract is used to transfer GRT from L2 token lock wallets\n * back to their L1 counterparts.\n */\ncontract L2GraphTokenLockTransferTool {\n /// Address of the L2 GRT token\n IERC20 public immutable graphToken;\n /// Address of the L2GraphTokenGateway\n ITokenGateway public immutable l2Gateway;\n /// Address of the L1 GRT token (in L1, no aliasing)\n address public immutable l1GraphToken;\n\n /// @dev Emitted when GRT is sent to L1 from a token lock\n event LockedFundsSentToL1(\n address indexed l1Wallet,\n address indexed l2Wallet,\n address indexed l2LockManager,\n uint256 amount\n );\n\n /**\n * @notice Constructor for the L2GraphTokenLockTransferTool contract\n * @dev Note the L2GraphTokenLockTransferTool can be deployed behind a proxy,\n * and the constructor for the implementation will only set some immutable\n * variables.\n * @param _graphToken Address of the L2 GRT token\n * @param _l2Gateway Address of the L2GraphTokenGateway\n * @param _l1GraphToken Address of the L1 GRT token (in L1, no aliasing)\n */\n constructor(IERC20 _graphToken, ITokenGateway _l2Gateway, address _l1GraphToken) {\n graphToken = _graphToken;\n l2Gateway = _l2Gateway;\n l1GraphToken = _l1GraphToken;\n }\n\n /**\n * @notice Withdraw GRT from an L2 token lock wallet to its L1 counterpart.\n * This function must be called from an L2GraphTokenLockWallet contract.\n * The GRT will be sent to L1 and must be claimed using the Arbitrum Outbox on L1\n * after the standard Arbitrum withdrawal period (7 days).\n * @param _amount Amount of GRT to withdraw\n */\n function withdrawToL1Locked(uint256 _amount) external {\n L2GraphTokenLockWallet wallet = L2GraphTokenLockWallet(msg.sender);\n L2GraphTokenLockManager manager = L2GraphTokenLockManager(address(wallet.manager()));\n require(address(manager) != address(0), \"INVALID_SENDER\");\n address l1Wallet = manager.l2WalletToL1Wallet(msg.sender);\n require(l1Wallet != address(0), \"NOT_L1_WALLET\");\n require(_amount <= graphToken.balanceOf(msg.sender), \"INSUFFICIENT_BALANCE\");\n require(_amount != 0, \"ZERO_AMOUNT\");\n\n graphToken.transferFrom(msg.sender, address(this), _amount);\n graphToken.approve(address(l2Gateway), _amount);\n\n // Send the tokens through the L2GraphTokenGateway to the L1 wallet counterpart\n l2Gateway.outboundTransfer(l1GraphToken, l1Wallet, _amount, 0, 0, \"\");\n emit LockedFundsSentToL1(l1Wallet, msg.sender, address(manager), _amount);\n }\n}\n" + }, + "contracts/L2GraphTokenLockWallet.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\nimport { GraphTokenLockWallet } from \"./GraphTokenLockWallet.sol\";\nimport { Ownable as OwnableInitializable } from \"./Ownable.sol\";\nimport { L2GraphTokenLockManager } from \"./L2GraphTokenLockManager.sol\";\n\n/**\n * @title L2GraphTokenLockWallet\n * @notice This contract is built on top of the base GraphTokenLock functionality.\n * It allows wallet beneficiaries to use the deposited funds to perform specific function calls\n * on specific contracts.\n *\n * The idea is that supporters with locked tokens can participate in the protocol\n * but disallow any release before the vesting/lock schedule.\n * The beneficiary can issue authorized function calls to this contract that will\n * get forwarded to a target contract. A target contract is any of our protocol contracts.\n * The function calls allowed are queried to the GraphTokenLockManager, this way\n * the same configuration can be shared for all the created lock wallet contracts.\n *\n * This L2 variant includes a special initializer so that it can be created from\n * a wallet's data received from L1. These transferred wallets will not allow releasing\n * funds in L2 until the end of the vesting timeline, but they can allow withdrawing\n * funds back to L1 using the L2GraphTokenLockTransferTool contract.\n *\n * Note that surplusAmount and releasedAmount in L2 will be skewed for wallets received from L1,\n * so releasing surplus tokens might also only be possible by bridging tokens back to L1.\n *\n * NOTE: Contracts used as target must have its function signatures checked to avoid collisions\n * with any of this contract functions.\n * Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience\n * the maximum amount of tokens is authorized.\n * Function calls do not forward ETH value so DO NOT SEND ETH TO THIS CONTRACT.\n */\ncontract L2GraphTokenLockWallet is GraphTokenLockWallet {\n // Initializer when created from a message from L1\n function initializeFromL1(\n address _manager,\n address _token,\n L2GraphTokenLockManager.TransferredWalletData calldata _walletData\n ) external {\n require(!isInitialized, \"Already initialized\");\n isInitialized = true;\n\n OwnableInitializable._initialize(_walletData.owner);\n beneficiary = _walletData.beneficiary;\n token = IERC20(_token);\n\n managedAmount = _walletData.managedAmount;\n\n startTime = _walletData.startTime;\n endTime = _walletData.endTime;\n periods = 1;\n isAccepted = true;\n\n // Optionals\n releaseStartTime = _walletData.endTime;\n revocable = Revocability.Disabled;\n\n _setManager(_manager);\n }\n}\n" + }, + "contracts/MathUtils.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nlibrary MathUtils {\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n}\n" + }, + "contracts/MinimalProxyFactory.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport { Address } from \"@openzeppelin/contracts/utils/Address.sol\";\nimport { Create2 } from \"@openzeppelin/contracts/utils/Create2.sol\";\n\n/**\n * @title MinimalProxyFactory: a factory contract for creating minimal proxies\n * @notice Adapted from https://github.com/OpenZeppelin/openzeppelin-sdk/blob/v2.5.0/packages/lib/contracts/upgradeability/ProxyFactory.sol\n * Based on https://eips.ethereum.org/EIPS/eip-1167\n */\ncontract MinimalProxyFactory {\n /// @dev Emitted when a new proxy is created\n event ProxyCreated(address indexed proxy);\n\n\n /**\n * @notice Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation\n * @dev Uses address(this) as deployer to compute the address. Only for backwards compatibility.\n * @param _salt Bytes32 salt to use for CREATE2\n * @param _implementation Address of the proxy target implementation\n * @return Address of the counterfactual MinimalProxy\n */\n function getDeploymentAddress(\n bytes32 _salt,\n address _implementation\n ) public view returns (address) {\n return getDeploymentAddress(_salt, _implementation, address(this));\n }\n\n /**\n * @notice Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation\n * @param _salt Bytes32 salt to use for CREATE2\n * @param _implementation Address of the proxy target implementation\n * @param _deployer Address of the deployer that creates the contract\n * @return Address of the counterfactual MinimalProxy\n */\n function getDeploymentAddress(\n bytes32 _salt,\n address _implementation,\n address _deployer\n ) public pure returns (address) {\n return Create2.computeAddress(_salt, keccak256(_getContractCreationCode(_implementation)), _deployer);\n }\n\n /**\n * @dev Deploys a MinimalProxy with CREATE2\n * @param _salt Bytes32 salt to use for CREATE2\n * @param _implementation Address of the proxy target implementation\n * @param _data Bytes with the initializer call\n * @return Address of the deployed MinimalProxy\n */\n function _deployProxy2(bytes32 _salt, address _implementation, bytes memory _data) internal returns (address) {\n address proxyAddress = Create2.deploy(0, _salt, _getContractCreationCode(_implementation));\n\n emit ProxyCreated(proxyAddress);\n\n // Call function with data\n if (_data.length > 0) {\n Address.functionCall(proxyAddress, _data);\n }\n\n return proxyAddress;\n }\n\n /**\n * @dev Gets the MinimalProxy bytecode\n * @param _implementation Address of the proxy target implementation\n * @return MinimalProxy bytecode\n */\n function _getContractCreationCode(address _implementation) internal pure returns (bytes memory) {\n bytes10 creation = 0x3d602d80600a3d3981f3;\n bytes10 prefix = 0x363d3d373d3d3d363d73;\n bytes20 targetBytes = bytes20(_implementation);\n bytes15 suffix = 0x5af43d82803e903d91602b57fd5bf3;\n return abi.encodePacked(creation, prefix, targetBytes, suffix);\n }\n}\n" + }, + "contracts/Ownable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * The owner account will be passed on initialization of the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\ncontract Ownable {\n /// @dev Owner of the contract, can be retrieved with the public owner() function\n address private _owner;\n /// @dev Since upgradeable contracts might inherit this, we add a storage gap\n /// to allow adding variables here without breaking the proxy storage layout\n uint256[50] private __gap;\n\n /// @dev Emitted when ownership of the contract is transferred\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n function _initialize(address owner) internal {\n _owner = owner;\n emit OwnershipTransferred(address(0), owner);\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(_owner == msg.sender, \"Ownable: caller is not the owner\");\n _;\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() external virtual onlyOwner {\n emit OwnershipTransferred(_owner, address(0));\n _owner = address(0);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) external virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n emit OwnershipTransferred(_owner, newOwner);\n _owner = newOwner;\n }\n}\n" + }, + "contracts/tests/arbitrum/AddressAliasHelper.sol": { + "content": "// SPDX-License-Identifier: Apache-2.0\n\n/*\n * Copyright 2019-2021, Offchain Labs, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * Originally copied from:\n * https://github.com/OffchainLabs/arbitrum/tree/84e64dee6ee82adbf8ec34fd4b86c207a61d9007/packages/arb-bridge-eth\n *\n * MODIFIED from Offchain Labs' implementation:\n * - Changed solidity version to 0.7.3 (pablo@edgeandnode.com)\n *\n */\n\npragma solidity ^0.7.3;\n\nlibrary AddressAliasHelper {\n uint160 constant offset = uint160(0x1111000000000000000000000000000000001111);\n\n /// @notice Utility function that converts the address in the L1 that submitted a tx to\n /// the inbox to the msg.sender viewed in the L2\n /// @param l1Address the address in the L1 that triggered the tx to L2\n /// @return l2Address L2 address as viewed in msg.sender\n function applyL1ToL2Alias(address l1Address) internal pure returns (address l2Address) {\n l2Address = address(uint160(l1Address) + offset);\n }\n\n /// @notice Utility function that converts the msg.sender viewed in the L2 to the\n /// address in the L1 that submitted a tx to the inbox\n /// @param l2Address L2 address as viewed in msg.sender\n /// @return l1Address the address in the L1 that triggered the tx to L2\n function undoL1ToL2Alias(address l2Address) internal pure returns (address l1Address) {\n l1Address = address(uint160(l2Address) - offset);\n }\n}\n" + }, + "contracts/tests/arbitrum/IBridge.sol": { + "content": "// SPDX-License-Identifier: Apache-2.0\n\n/*\n * Copyright 2021, Offchain Labs, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * Originally copied from:\n * https://github.com/OffchainLabs/arbitrum/tree/e3a6307ad8a2dc2cad35728a2a9908cfd8dd8ef9/packages/arb-bridge-eth\n *\n * MODIFIED from Offchain Labs' implementation:\n * - Changed solidity version to 0.7.3 (pablo@edgeandnode.com)\n *\n */\n\npragma solidity ^0.7.3;\n\ninterface IBridge {\n event MessageDelivered(\n uint256 indexed messageIndex,\n bytes32 indexed beforeInboxAcc,\n address inbox,\n uint8 kind,\n address sender,\n bytes32 messageDataHash\n );\n\n event BridgeCallTriggered(address indexed outbox, address indexed destAddr, uint256 amount, bytes data);\n\n event InboxToggle(address indexed inbox, bool enabled);\n\n event OutboxToggle(address indexed outbox, bool enabled);\n\n function deliverMessageToInbox(\n uint8 kind,\n address sender,\n bytes32 messageDataHash\n ) external payable returns (uint256);\n\n function executeCall(\n address destAddr,\n uint256 amount,\n bytes calldata data\n ) external returns (bool success, bytes memory returnData);\n\n // These are only callable by the admin\n function setInbox(address inbox, bool enabled) external;\n\n function setOutbox(address inbox, bool enabled) external;\n\n // View functions\n\n function activeOutbox() external view returns (address);\n\n function allowedInboxes(address inbox) external view returns (bool);\n\n function allowedOutboxes(address outbox) external view returns (bool);\n\n function inboxAccs(uint256 index) external view returns (bytes32);\n\n function messageCount() external view returns (uint256);\n}\n" + }, + "contracts/tests/arbitrum/IInbox.sol": { + "content": "// SPDX-License-Identifier: Apache-2.0\n\n/*\n * Copyright 2021, Offchain Labs, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * Originally copied from:\n * https://github.com/OffchainLabs/arbitrum/tree/e3a6307ad8a2dc2cad35728a2a9908cfd8dd8ef9/packages/arb-bridge-eth\n *\n * MODIFIED from Offchain Labs' implementation:\n * - Changed solidity version to 0.7.3 (pablo@edgeandnode.com)\n *\n */\n\npragma solidity ^0.7.3;\n\nimport \"./IBridge.sol\";\nimport \"./IMessageProvider.sol\";\n\ninterface IInbox is IMessageProvider {\n function sendL2Message(bytes calldata messageData) external returns (uint256);\n\n function sendUnsignedTransaction(\n uint256 maxGas,\n uint256 gasPriceBid,\n uint256 nonce,\n address destAddr,\n uint256 amount,\n bytes calldata data\n ) external returns (uint256);\n\n function sendContractTransaction(\n uint256 maxGas,\n uint256 gasPriceBid,\n address destAddr,\n uint256 amount,\n bytes calldata data\n ) external returns (uint256);\n\n function sendL1FundedUnsignedTransaction(\n uint256 maxGas,\n uint256 gasPriceBid,\n uint256 nonce,\n address destAddr,\n bytes calldata data\n ) external payable returns (uint256);\n\n function sendL1FundedContractTransaction(\n uint256 maxGas,\n uint256 gasPriceBid,\n address destAddr,\n bytes calldata data\n ) external payable returns (uint256);\n\n function createRetryableTicket(\n address destAddr,\n uint256 arbTxCallValue,\n uint256 maxSubmissionCost,\n address submissionRefundAddress,\n address valueRefundAddress,\n uint256 maxGas,\n uint256 gasPriceBid,\n bytes calldata data\n ) external payable returns (uint256);\n\n function depositEth(uint256 maxSubmissionCost) external payable returns (uint256);\n\n function bridge() external view returns (IBridge);\n\n function pauseCreateRetryables() external;\n\n function unpauseCreateRetryables() external;\n\n function startRewriteAddress() external;\n\n function stopRewriteAddress() external;\n}\n" + }, + "contracts/tests/arbitrum/IMessageProvider.sol": { + "content": "// SPDX-License-Identifier: Apache-2.0\n\n/*\n * Copyright 2021, Offchain Labs, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * Originally copied from:\n * https://github.com/OffchainLabs/arbitrum/tree/e3a6307ad8a2dc2cad35728a2a9908cfd8dd8ef9/packages/arb-bridge-eth\n *\n * MODIFIED from Offchain Labs' implementation:\n * - Changed solidity version to 0.7.3 (pablo@edgeandnode.com)\n *\n */\n\npragma solidity ^0.7.3;\n\ninterface IMessageProvider {\n event InboxMessageDelivered(uint256 indexed messageNum, bytes data);\n\n event InboxMessageDeliveredFromOrigin(uint256 indexed messageNum);\n}\n" + }, + "contracts/tests/BridgeMock.sol": { + "content": "// SPDX-License-Identifier: GPL-2.0-or-later\n\npragma solidity ^0.7.3;\n\nimport \"./arbitrum/IBridge.sol\";\n\n/**\n * @title Arbitrum Bridge mock contract\n * @dev This contract implements Arbitrum's IBridge interface for testing purposes\n */\ncontract BridgeMock is IBridge {\n /// Address of the (mock) Arbitrum Inbox\n address public inbox;\n /// Address of the (mock) Arbitrum Outbox\n address public outbox;\n /// Index of the next message on the inbox messages array\n uint256 public messageIndex;\n /// Inbox messages array\n bytes32[] public override inboxAccs;\n\n /**\n * @notice Deliver a message to the inbox. The encoded message will be\n * added to the inbox array, and messageIndex will be incremented.\n * @param _kind Type of the message\n * @param _sender Address that is sending the message\n * @param _messageDataHash keccak256 hash of the message data\n * @return The next index for the inbox array\n */\n function deliverMessageToInbox(\n uint8 _kind,\n address _sender,\n bytes32 _messageDataHash\n ) external payable override returns (uint256) {\n messageIndex = messageIndex + 1;\n inboxAccs.push(keccak256(abi.encodePacked(inbox, _kind, _sender, _messageDataHash)));\n emit MessageDelivered(messageIndex, inboxAccs[messageIndex - 1], msg.sender, _kind, _sender, _messageDataHash);\n return messageIndex;\n }\n\n /**\n * @notice Executes an L1 function call incoing from L2. This can only be called\n * by the Outbox.\n * @param _destAddr Contract to call\n * @param _amount ETH value to send\n * @param _data Calldata for the function call\n * @return True if the call was successful, false otherwise\n * @return Return data from the call\n */\n function executeCall(\n address _destAddr,\n uint256 _amount,\n bytes calldata _data\n ) external override returns (bool, bytes memory) {\n require(outbox == msg.sender, \"NOT_FROM_OUTBOX\");\n bool success;\n bytes memory returnData;\n\n // solhint-disable-next-line avoid-low-level-calls\n (success, returnData) = _destAddr.call{ value: _amount }(_data);\n emit BridgeCallTriggered(msg.sender, _destAddr, _amount, _data);\n return (success, returnData);\n }\n\n /**\n * @notice Set the address of the inbox. Anyone can call this, because it's a mock.\n * @param _inbox Address of the inbox\n * @param _enabled Enable the inbox (ignored)\n */\n function setInbox(address _inbox, bool _enabled) external override {\n inbox = _inbox;\n emit InboxToggle(inbox, _enabled);\n }\n\n /**\n * @notice Set the address of the outbox. Anyone can call this, because it's a mock.\n * @param _outbox Address of the outbox\n * @param _enabled Enable the outbox (ignored)\n */\n function setOutbox(address _outbox, bool _enabled) external override {\n outbox = _outbox;\n emit OutboxToggle(outbox, _enabled);\n }\n\n // View functions\n\n /**\n * @notice Getter for the active outbox (in this case there's only one)\n */\n function activeOutbox() external view override returns (address) {\n return outbox;\n }\n\n /**\n * @notice Getter for whether an address is an allowed inbox (in this case there's only one)\n * @param _inbox Address to check\n * @return True if the address is the allowed inbox, false otherwise\n */\n function allowedInboxes(address _inbox) external view override returns (bool) {\n return _inbox == inbox;\n }\n\n /**\n * @notice Getter for whether an address is an allowed outbox (in this case there's only one)\n * @param _outbox Address to check\n * @return True if the address is the allowed outbox, false otherwise\n */\n function allowedOutboxes(address _outbox) external view override returns (bool) {\n return _outbox == outbox;\n }\n\n /**\n * @notice Getter for the count of messages in the inboxAccs\n * @return Number of messages in inboxAccs\n */\n function messageCount() external view override returns (uint256) {\n return inboxAccs.length;\n }\n}\n" + }, + "contracts/tests/GraphTokenMock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\n\n/**\n * @title Graph Token Mock contract.\n * @dev Used for testing purposes, DO NOT USE IN PRODUCTION\n */\ncontract GraphTokenMock is Ownable, ERC20 {\n /**\n * @notice Contract Constructor.\n * @param _initialSupply Initial supply\n * @param _mintTo Address to whitch to mint the initial supply\n */\n constructor(uint256 _initialSupply, address _mintTo) ERC20(\"Graph Token Mock\", \"GRT-Mock\") {\n // Deploy to mint address\n _mint(_mintTo, _initialSupply);\n }\n\n /**\n * @notice Mint tokens to an address from the bridge.\n * (The real one has an onlyGateway modifier)\n * @param _to Address to mint tokens to\n * @param _amount Amount of tokens to mint\n */\n function bridgeMint(address _to, uint256 _amount) external {\n _mint(_to, _amount);\n }\n\n /**\n * @notice Burn tokens from an address from the bridge.\n * (The real one has an onlyGateway modifier)\n * @param _from Address to burn tokens from\n * @param _amount Amount of tokens to burn\n */\n function bridgeBurn(address _from, uint256 _amount) external {\n _burn(_from, _amount);\n }\n}\n" + }, + "contracts/tests/InboxMock.sol": { + "content": "// SPDX-License-Identifier: GPL-2.0-or-later\n\npragma solidity ^0.7.3;\n\nimport \"./arbitrum/IInbox.sol\";\nimport \"./arbitrum/AddressAliasHelper.sol\";\n\n/**\n * @title Arbitrum Inbox mock contract\n * @dev This contract implements (a subset of) Arbitrum's IInbox interface for testing purposes\n */\ncontract InboxMock is IInbox {\n /// @dev Type indicator for a standard L2 message\n uint8 internal constant L2_MSG = 3;\n /// @dev Type indicator for a retryable ticket message\n // solhint-disable-next-line const-name-snakecase\n uint8 internal constant L1MessageType_submitRetryableTx = 9;\n /// Address of the Bridge (mock) contract\n IBridge public override bridge;\n\n /**\n * @notice Send a message to L2 (by delivering it to the Bridge)\n * @param _messageData Encoded data to send in the message\n * @return Message number returned by the inbox\n */\n function sendL2Message(bytes calldata _messageData) external override returns (uint256) {\n uint256 msgNum = deliverToBridge(L2_MSG, msg.sender, keccak256(_messageData));\n emit InboxMessageDelivered(msgNum, _messageData);\n return msgNum;\n }\n\n /**\n * @notice Set the address of the (mock) bridge\n * @param _bridge Address of the bridge\n */\n function setBridge(address _bridge) external {\n bridge = IBridge(_bridge);\n }\n\n /**\n * @notice Unimplemented in this mock\n */\n function sendUnsignedTransaction(\n uint256,\n uint256,\n uint256,\n address,\n uint256,\n bytes calldata\n ) external pure override returns (uint256) {\n revert(\"Unimplemented\");\n }\n\n /**\n * @notice Unimplemented in this mock\n */\n function sendContractTransaction(\n uint256,\n uint256,\n address,\n uint256,\n bytes calldata\n ) external pure override returns (uint256) {\n revert(\"Unimplemented\");\n }\n\n /**\n * @notice Unimplemented in this mock\n */\n function sendL1FundedUnsignedTransaction(\n uint256,\n uint256,\n uint256,\n address,\n bytes calldata\n ) external payable override returns (uint256) {\n revert(\"Unimplemented\");\n }\n\n /**\n * @notice Unimplemented in this mock\n */\n function sendL1FundedContractTransaction(\n uint256,\n uint256,\n address,\n bytes calldata\n ) external payable override returns (uint256) {\n revert(\"Unimplemented\");\n }\n\n /**\n * @notice Creates a retryable ticket for an L2 transaction\n * @param _destAddr Address of the contract to call in L2\n * @param _arbTxCallValue Callvalue to use in the L2 transaction\n * @param _maxSubmissionCost Max cost of submitting the ticket, in Wei\n * @param _submissionRefundAddress L2 address to refund for any remaining value from the submission cost\n * @param _valueRefundAddress L2 address to refund if the ticket times out or gets cancelled\n * @param _maxGas Max gas for the L2 transcation\n * @param _gasPriceBid Gas price bid on L2\n * @param _data Encoded calldata for the L2 transaction (including function selector)\n * @return Message number returned by the bridge\n */\n function createRetryableTicket(\n address _destAddr,\n uint256 _arbTxCallValue,\n uint256 _maxSubmissionCost,\n address _submissionRefundAddress,\n address _valueRefundAddress,\n uint256 _maxGas,\n uint256 _gasPriceBid,\n bytes calldata _data\n ) external payable override returns (uint256) {\n _submissionRefundAddress = AddressAliasHelper.applyL1ToL2Alias(_submissionRefundAddress);\n _valueRefundAddress = AddressAliasHelper.applyL1ToL2Alias(_valueRefundAddress);\n return\n _deliverMessage(\n L1MessageType_submitRetryableTx,\n msg.sender,\n abi.encodePacked(\n uint256(uint160(bytes20(_destAddr))),\n _arbTxCallValue,\n msg.value,\n _maxSubmissionCost,\n uint256(uint160(bytes20(_submissionRefundAddress))),\n uint256(uint160(bytes20(_valueRefundAddress))),\n _maxGas,\n _gasPriceBid,\n _data.length,\n _data\n )\n );\n }\n\n /**\n * @notice Unimplemented in this mock\n */\n function depositEth(uint256) external payable override returns (uint256) {\n revert(\"Unimplemented\");\n }\n\n /**\n * @notice Unimplemented in this mock\n */\n function pauseCreateRetryables() external pure override {\n revert(\"Unimplemented\");\n }\n\n /**\n * @notice Unimplemented in this mock\n */\n function unpauseCreateRetryables() external pure override {\n revert(\"Unimplemented\");\n }\n\n /**\n * @notice Unimplemented in this mock\n */\n function startRewriteAddress() external pure override {\n revert(\"Unimplemented\");\n }\n\n /**\n * @notice Unimplemented in this mock\n */\n function stopRewriteAddress() external pure override {\n revert(\"Unimplemented\");\n }\n\n /**\n * @dev Deliver a message to the bridge\n * @param _kind Type of the message\n * @param _sender Address that is sending the message\n * @param _messageData Encoded message data\n * @return Message number returned by the bridge\n */\n function _deliverMessage(uint8 _kind, address _sender, bytes memory _messageData) internal returns (uint256) {\n uint256 msgNum = deliverToBridge(_kind, _sender, keccak256(_messageData));\n emit InboxMessageDelivered(msgNum, _messageData);\n return msgNum;\n }\n\n /**\n * @dev Deliver a message to the bridge\n * @param _kind Type of the message\n * @param _sender Address that is sending the message\n * @param _messageDataHash keccak256 hash of the encoded message data\n * @return Message number returned by the bridge\n */\n function deliverToBridge(uint8 _kind, address _sender, bytes32 _messageDataHash) internal returns (uint256) {\n return bridge.deliverMessageToInbox{ value: msg.value }(_kind, _sender, _messageDataHash);\n }\n}\n" + }, + "contracts/tests/L1TokenGatewayMock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport { Ownable } from \"@openzeppelin/contracts/access/Ownable.sol\";\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport { SafeMath } from \"@openzeppelin/contracts/math/SafeMath.sol\";\nimport { ITokenGateway } from \"../arbitrum//ITokenGateway.sol\";\n\n/**\n * @title L1 Token Gateway mock contract\n * @dev Used for testing purposes, DO NOT USE IN PRODUCTION\n */\ncontract L1TokenGatewayMock is Ownable {\n using SafeMath for uint256;\n /// Next sequence number to return when outboundTransfer is called\n uint256 public nextSeqNum;\n\n /// @dev Emitted when a (fake) retryable ticket is created\n event FakeTxToL2(\n address from,\n uint256 value,\n uint256 maxGas,\n uint256 gasPriceBid,\n uint256 maxSubmissionCost,\n bytes outboundCalldata\n );\n\n /// @dev Emitted when an outbound transfer is initiated, i.e. tokens are deposited from L1 to L2\n event DepositInitiated(\n address l1Token,\n address indexed from,\n address indexed to,\n uint256 indexed sequenceNumber,\n uint256 amount\n );\n\n /**\n * @notice L1 Token Gateway Contract Constructor.\n */\n constructor() {}\n\n /**\n * @notice Creates and sends a fake retryable ticket to transfer GRT to L2.\n * This mock will actually just emit an event with parameters equivalent to what the real L1GraphTokenGateway\n * would send to L2.\n * @param _l1Token L1 Address of the GRT contract (needed for compatibility with Arbitrum Gateway Router)\n * @param _to Recipient address on L2\n * @param _amount Amount of tokens to tranfer\n * @param _maxGas Gas limit for L2 execution of the ticket\n * @param _gasPriceBid Price per gas on L2\n * @param _data Encoded maxSubmissionCost and sender address along with additional calldata\n * @return Sequence number of the retryable ticket created by Inbox (always )\n */\n function outboundTransfer(\n address _l1Token,\n address _to,\n uint256 _amount,\n uint256 _maxGas,\n uint256 _gasPriceBid,\n bytes calldata _data\n ) external payable returns (bytes memory) {\n require(_amount > 0, \"INVALID_ZERO_AMOUNT\");\n require(_to != address(0), \"INVALID_DESTINATION\");\n\n // nested scopes to avoid stack too deep errors\n address from;\n uint256 seqNum = nextSeqNum;\n nextSeqNum += 1;\n {\n uint256 maxSubmissionCost;\n bytes memory outboundCalldata;\n {\n bytes memory extraData;\n (from, maxSubmissionCost, extraData) = _parseOutboundData(_data);\n require(maxSubmissionCost > 0, \"NO_SUBMISSION_COST\");\n\n {\n // makes sure only sufficient ETH is supplied as required for successful redemption on L2\n // if a user does not desire immediate redemption they should provide\n // a msg.value of AT LEAST maxSubmissionCost\n uint256 expectedEth = maxSubmissionCost.add(_maxGas.mul(_gasPriceBid));\n require(msg.value >= expectedEth, \"WRONG_ETH_VALUE\");\n }\n outboundCalldata = getOutboundCalldata(_l1Token, from, _to, _amount, extraData);\n }\n {\n // transfer tokens to escrow\n IERC20(_l1Token).transferFrom(from, address(this), _amount);\n\n emit FakeTxToL2(from, msg.value, _maxGas, _gasPriceBid, maxSubmissionCost, outboundCalldata);\n }\n }\n emit DepositInitiated(_l1Token, from, _to, seqNum, _amount);\n\n return abi.encode(seqNum);\n }\n\n /**\n * @notice (Mock) Receives withdrawn tokens from L2\n * Actually does nothing, just keeping it here as its useful to define the expected\n * calldata for the outgoing transfer in tests.\n * @param _l1Token L1 Address of the GRT contract (needed for compatibility with Arbitrum Gateway Router)\n * @param _from Address of the sender\n * @param _to Recepient address on L1\n * @param _amount Amount of tokens transferred\n * @param _data Additional calldata\n */\n function finalizeInboundTransfer(\n address _l1Token,\n address _from,\n address _to,\n uint256 _amount,\n bytes calldata _data\n ) external payable {}\n\n /**\n * @notice Creates calldata required to create a retryable ticket\n * @dev encodes the target function with its params which\n * will be called on L2 when the retryable ticket is redeemed\n * @param _l1Token Address of the Graph token contract on L1\n * @param _from Address on L1 from which we're transferring tokens\n * @param _to Address on L2 to which we're transferring tokens\n * @param _amount Amount of GRT to transfer\n * @param _data Additional call data for the L2 transaction, which must be empty unless the caller is whitelisted\n * @return Encoded calldata (including function selector) for the L2 transaction\n */\n function getOutboundCalldata(\n address _l1Token,\n address _from,\n address _to,\n uint256 _amount,\n bytes memory _data\n ) public pure returns (bytes memory) {\n bytes memory emptyBytes;\n\n return\n abi.encodeWithSelector(\n ITokenGateway.finalizeInboundTransfer.selector,\n _l1Token,\n _from,\n _to,\n _amount,\n abi.encode(emptyBytes, _data)\n );\n }\n\n /**\n * @notice Decodes calldata required for transfer of tokens to L2\n * @dev Data must include maxSubmissionCost, extraData can be left empty. When the router\n * sends an outbound message, data also contains the from address, but this mock\n * doesn't consider this case\n * @param _data Encoded callhook data containing maxSubmissionCost and extraData\n * @return Sender of the tx\n * @return Max ether value used to submit the retryable ticket\n * @return Additional data sent to L2\n */\n function _parseOutboundData(bytes memory _data) private view returns (address, uint256, bytes memory) {\n address from;\n uint256 maxSubmissionCost;\n bytes memory extraData;\n from = msg.sender;\n // User-encoded data contains the max retryable ticket submission cost\n // and additional L2 calldata\n (maxSubmissionCost, extraData) = abi.decode(_data, (uint256, bytes));\n return (from, maxSubmissionCost, extraData);\n }\n}\n" + }, + "contracts/tests/L2TokenGatewayMock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport { Ownable } from \"@openzeppelin/contracts/access/Ownable.sol\";\nimport { ITokenGateway } from \"../arbitrum//ITokenGateway.sol\";\nimport { GraphTokenMock } from \"./GraphTokenMock.sol\";\nimport { ICallhookReceiver } from \"../ICallhookReceiver.sol\";\n\n/**\n * @title L2 Token Gateway mock contract\n * @dev Used for testing purposes, DO NOT USE IN PRODUCTION\n */\ncontract L2TokenGatewayMock is Ownable {\n /// Address of the L1 GRT contract\n address public immutable l1Token;\n /// Address of the L2 GRT contract\n address public immutable l2Token;\n /// Next ID to return when sending an outboundTransfer\n uint256 public nextId;\n\n /// @dev Emitted when a (fake) transaction to L1 is created\n event FakeTxToL1(address from, bytes outboundCalldata);\n /// @dev Emitted when a (fake) retryable ticket is received from L1\n event DepositFinalized(address token, address indexed from, address indexed to, uint256 amount);\n\n /// @dev Emitted when an outbound transfer is initiated, i.e. tokens are withdrawn to L1 from L2\n event WithdrawalInitiated(\n address l1Token,\n address indexed from,\n address indexed to,\n uint256 indexed sequenceNumber,\n uint256 amount\n );\n\n /**\n * @notice L2 Token Gateway Contract Constructor.\n * @param _l1Token Address of the L1 GRT contract\n * @param _l2Token Address of the L2 GRT contract\n */\n constructor(address _l1Token, address _l2Token) {\n l1Token = _l1Token;\n l2Token = _l2Token;\n }\n\n /**\n * @notice Creates and sends a (fake) transfer of GRT to L1.\n * This mock will actually just emit an event with parameters equivalent to what the real L2GraphTokenGateway\n * would send to L1.\n * @param _l1Token L1 Address of the GRT contract (needed for compatibility with Arbitrum Gateway Router)\n * @param _to Recipient address on L2\n * @param _amount Amount of tokens to tranfer\n * @param _data Encoded maxSubmissionCost and sender address along with additional calldata\n * @return ID of the L2-L1 message (incrementing on every call)\n */\n function outboundTransfer(\n address _l1Token,\n address _to,\n uint256 _amount,\n uint256,\n uint256,\n bytes calldata _data\n ) external payable returns (bytes memory) {\n require(_l1Token == l1Token, \"INVALID_L1_TOKEN\");\n require(_amount > 0, \"INVALID_ZERO_AMOUNT\");\n require(_to != address(0), \"INVALID_DESTINATION\");\n\n // nested scopes to avoid stack too deep errors\n address from;\n uint256 id = nextId;\n nextId += 1;\n {\n bytes memory outboundCalldata;\n {\n bytes memory extraData;\n (from, extraData) = _parseOutboundData(_data);\n\n require(msg.value == 0, \"!value\");\n require(extraData.length == 0, \"!extraData\");\n outboundCalldata = getOutboundCalldata(_l1Token, from, _to, _amount, extraData);\n }\n {\n // burn tokens from the sender, they will be released from escrow in L1\n GraphTokenMock(l2Token).bridgeBurn(from, _amount);\n\n emit FakeTxToL1(from, outboundCalldata);\n }\n }\n emit WithdrawalInitiated(_l1Token, from, _to, id, _amount);\n\n return abi.encode(id);\n }\n\n /**\n * @notice (Mock) Receives withdrawn tokens from L1\n * Implements calling callhooks if data is non-empty.\n * @param _l1Token L1 Address of the GRT contract (needed for compatibility with Arbitrum Gateway Router)\n * @param _from Address of the sender\n * @param _to Recipient address on L1\n * @param _amount Amount of tokens transferred\n * @param _data Additional calldata, will trigger an onTokenTransfer call if non-empty\n */\n function finalizeInboundTransfer(\n address _l1Token,\n address _from,\n address _to,\n uint256 _amount,\n bytes calldata _data\n ) external payable {\n require(_l1Token == l1Token, \"TOKEN_NOT_GRT\");\n require(msg.value == 0, \"INVALID_NONZERO_VALUE\");\n\n GraphTokenMock(l2Token).bridgeMint(_to, _amount);\n\n if (_data.length > 0) {\n ICallhookReceiver(_to).onTokenTransfer(_from, _amount, _data);\n }\n\n emit DepositFinalized(_l1Token, _from, _to, _amount);\n }\n\n /**\n * @notice Calculate the L2 address of a bridged token\n * @dev In our case, this would only work for GRT.\n * @param l1ERC20 address of L1 GRT contract\n * @return L2 address of the bridged GRT token\n */\n function calculateL2TokenAddress(address l1ERC20) public view returns (address) {\n if (l1ERC20 != l1Token) {\n return address(0);\n }\n return l2Token;\n }\n\n /**\n * @notice Creates calldata required to create a tx to L1\n * @param _l1Token Address of the Graph token contract on L1\n * @param _from Address on L2 from which we're transferring tokens\n * @param _to Address on L1 to which we're transferring tokens\n * @param _amount Amount of GRT to transfer\n * @param _data Additional call data for the L1 transaction, which must be empty\n * @return Encoded calldata (including function selector) for the L1 transaction\n */\n function getOutboundCalldata(\n address _l1Token,\n address _from,\n address _to,\n uint256 _amount,\n bytes memory _data\n ) public pure returns (bytes memory) {\n return\n abi.encodeWithSelector(\n ITokenGateway.finalizeInboundTransfer.selector,\n _l1Token,\n _from,\n _to,\n _amount,\n abi.encode(0, _data)\n );\n }\n\n /**\n * @dev Decodes calldata required for transfer of tokens to L1.\n * extraData can be left empty\n * @param _data Encoded callhook data\n * @return Sender of the tx\n * @return Any other data sent to L1\n */\n function _parseOutboundData(bytes calldata _data) private view returns (address, bytes memory) {\n address from;\n bytes memory extraData;\n // The mock doesn't take messages from the Router\n from = msg.sender;\n extraData = _data;\n return (from, extraData);\n }\n}\n" + }, + "contracts/tests/Stakes.sol": { + "content": "// SPDX-License-Identifier: GPL-2.0-or-later\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/math/SafeMath.sol\";\n\n/**\n * @title A collection of data structures and functions to manage the Indexer Stake state.\n * Used for low-level state changes, require() conditions should be evaluated\n * at the caller function scope.\n */\nlibrary Stakes {\n using SafeMath for uint256;\n using Stakes for Stakes.Indexer;\n\n struct Indexer {\n uint256 tokensStaked; // Tokens on the indexer stake (staked by the indexer)\n uint256 tokensAllocated; // Tokens used in allocations\n uint256 tokensLocked; // Tokens locked for withdrawal subject to thawing period\n uint256 tokensLockedUntil; // Block when locked tokens can be withdrawn\n }\n\n /**\n * @dev Deposit tokens to the indexer stake.\n * @param stake Stake data\n * @param _tokens Amount of tokens to deposit\n */\n function deposit(Stakes.Indexer storage stake, uint256 _tokens) internal {\n stake.tokensStaked = stake.tokensStaked.add(_tokens);\n }\n\n /**\n * @dev Release tokens from the indexer stake.\n * @param stake Stake data\n * @param _tokens Amount of tokens to release\n */\n function release(Stakes.Indexer storage stake, uint256 _tokens) internal {\n stake.tokensStaked = stake.tokensStaked.sub(_tokens);\n }\n\n /**\n * @dev Allocate tokens from the main stack to a SubgraphDeployment.\n * @param stake Stake data\n * @param _tokens Amount of tokens to allocate\n */\n function allocate(Stakes.Indexer storage stake, uint256 _tokens) internal {\n stake.tokensAllocated = stake.tokensAllocated.add(_tokens);\n }\n\n /**\n * @dev Unallocate tokens from a SubgraphDeployment back to the main stack.\n * @param stake Stake data\n * @param _tokens Amount of tokens to unallocate\n */\n function unallocate(Stakes.Indexer storage stake, uint256 _tokens) internal {\n stake.tokensAllocated = stake.tokensAllocated.sub(_tokens);\n }\n\n /**\n * @dev Lock tokens until a thawing period pass.\n * @param stake Stake data\n * @param _tokens Amount of tokens to unstake\n * @param _period Period in blocks that need to pass before withdrawal\n */\n function lockTokens(Stakes.Indexer storage stake, uint256 _tokens, uint256 _period) internal {\n // Take into account period averaging for multiple unstake requests\n uint256 lockingPeriod = _period;\n if (stake.tokensLocked > 0) {\n lockingPeriod = stake.getLockingPeriod(_tokens, _period);\n }\n\n // Update balances\n stake.tokensLocked = stake.tokensLocked.add(_tokens);\n stake.tokensLockedUntil = block.number.add(lockingPeriod);\n }\n\n /**\n * @dev Unlock tokens.\n * @param stake Stake data\n * @param _tokens Amount of tokens to unkock\n */\n function unlockTokens(Stakes.Indexer storage stake, uint256 _tokens) internal {\n stake.tokensLocked = stake.tokensLocked.sub(_tokens);\n if (stake.tokensLocked == 0) {\n stake.tokensLockedUntil = 0;\n }\n }\n\n /**\n * @dev Take all tokens out from the locked stake for withdrawal.\n * @param stake Stake data\n * @return Amount of tokens being withdrawn\n */\n function withdrawTokens(Stakes.Indexer storage stake) internal returns (uint256) {\n // Calculate tokens that can be released\n uint256 tokensToWithdraw = stake.tokensWithdrawable();\n\n if (tokensToWithdraw > 0) {\n // Reset locked tokens\n stake.unlockTokens(tokensToWithdraw);\n\n // Decrease indexer stake\n stake.release(tokensToWithdraw);\n }\n\n return tokensToWithdraw;\n }\n\n /**\n * @dev Get the locking period of the tokens to unstake.\n * If already unstaked before calculate the weighted average.\n * @param stake Stake data\n * @param _tokens Amount of tokens to unstake\n * @param _thawingPeriod Period in blocks that need to pass before withdrawal\n * @return True if staked\n */\n function getLockingPeriod(\n Stakes.Indexer memory stake,\n uint256 _tokens,\n uint256 _thawingPeriod\n ) internal view returns (uint256) {\n uint256 blockNum = block.number;\n uint256 periodA = (stake.tokensLockedUntil > blockNum) ? stake.tokensLockedUntil.sub(blockNum) : 0;\n uint256 periodB = _thawingPeriod;\n uint256 stakeA = stake.tokensLocked;\n uint256 stakeB = _tokens;\n return periodA.mul(stakeA).add(periodB.mul(stakeB)).div(stakeA.add(stakeB));\n }\n\n /**\n * @dev Return true if there are tokens staked by the Indexer.\n * @param stake Stake data\n * @return True if staked\n */\n function hasTokens(Stakes.Indexer memory stake) internal pure returns (bool) {\n return stake.tokensStaked > 0;\n }\n\n /**\n * @dev Return the amount of tokens used in allocations and locked for withdrawal.\n * @param stake Stake data\n * @return Token amount\n */\n function tokensUsed(Stakes.Indexer memory stake) internal pure returns (uint256) {\n return stake.tokensAllocated.add(stake.tokensLocked);\n }\n\n /**\n * @dev Return the amount of tokens staked not considering the ones that are already going\n * through the thawing period or are ready for withdrawal. We call it secure stake because\n * it is not subject to change by a withdraw call from the indexer.\n * @param stake Stake data\n * @return Token amount\n */\n function tokensSecureStake(Stakes.Indexer memory stake) internal pure returns (uint256) {\n return stake.tokensStaked.sub(stake.tokensLocked);\n }\n\n /**\n * @dev Tokens free balance on the indexer stake that can be used for any purpose.\n * Any token that is allocated cannot be used as well as tokens that are going through the\n * thawing period or are withdrawable\n * Calc: tokensStaked - tokensAllocated - tokensLocked\n * @param stake Stake data\n * @return Token amount\n */\n function tokensAvailable(Stakes.Indexer memory stake) internal pure returns (uint256) {\n return stake.tokensAvailableWithDelegation(0);\n }\n\n /**\n * @dev Tokens free balance on the indexer stake that can be used for allocations.\n * This function accepts a parameter for extra delegated capacity that takes into\n * account delegated tokens\n * @param stake Stake data\n * @param _delegatedCapacity Amount of tokens used from delegators to calculate availability\n * @return Token amount\n */\n function tokensAvailableWithDelegation(\n Stakes.Indexer memory stake,\n uint256 _delegatedCapacity\n ) internal pure returns (uint256) {\n uint256 tokensCapacity = stake.tokensStaked.add(_delegatedCapacity);\n uint256 _tokensUsed = stake.tokensUsed();\n // If more tokens are used than the current capacity, the indexer is overallocated.\n // This means the indexer doesn't have available capacity to create new allocations.\n // We can reach this state when the indexer has funds allocated and then any\n // of these conditions happen:\n // - The delegationCapacity ratio is reduced.\n // - The indexer stake is slashed.\n // - A delegator removes enough stake.\n if (_tokensUsed > tokensCapacity) {\n // Indexer stake is over allocated: return 0 to avoid stake to be used until\n // the overallocation is restored by staking more tokens, unallocating tokens\n // or using more delegated funds\n return 0;\n }\n return tokensCapacity.sub(_tokensUsed);\n }\n\n /**\n * @dev Tokens available for withdrawal after thawing period.\n * @param stake Stake data\n * @return Token amount\n */\n function tokensWithdrawable(Stakes.Indexer memory stake) internal view returns (uint256) {\n // No tokens to withdraw before locking period\n if (stake.tokensLockedUntil == 0 || block.number < stake.tokensLockedUntil) {\n return 0;\n }\n return stake.tokensLocked;\n }\n}\n" + }, + "contracts/tests/StakingMock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\nimport \"./Stakes.sol\";\n\ncontract StakingMock {\n using SafeMath for uint256;\n using Stakes for Stakes.Indexer;\n\n // -- State --\n\n uint256 public minimumIndexerStake = 100e18;\n uint256 public thawingPeriod = 10; // 10 blocks\n IERC20 public token;\n\n // Indexer stakes : indexer => Stake\n mapping(address => Stakes.Indexer) public stakes;\n\n /**\n * @dev Emitted when `indexer` stake `tokens` amount.\n */\n event StakeDeposited(address indexed indexer, uint256 tokens);\n\n /**\n * @dev Emitted when `indexer` unstaked and locked `tokens` amount `until` block.\n */\n event StakeLocked(address indexed indexer, uint256 tokens, uint256 until);\n\n /**\n * @dev Emitted when `indexer` withdrew `tokens` staked.\n */\n event StakeWithdrawn(address indexed indexer, uint256 tokens);\n\n // Contract constructor.\n constructor(IERC20 _token) {\n require(address(_token) != address(0), \"!token\");\n token = _token;\n }\n\n receive() external payable {}\n\n /**\n * @dev Deposit tokens on the indexer stake.\n * @param _tokens Amount of tokens to stake\n */\n function stake(uint256 _tokens) external {\n stakeTo(msg.sender, _tokens);\n }\n\n /**\n * @dev Deposit tokens on the indexer stake.\n * @param _indexer Address of the indexer\n * @param _tokens Amount of tokens to stake\n */\n function stakeTo(address _indexer, uint256 _tokens) public {\n require(_tokens > 0, \"!tokens\");\n\n // Ensure minimum stake\n require(stakes[_indexer].tokensSecureStake().add(_tokens) >= minimumIndexerStake, \"!minimumIndexerStake\");\n\n // Transfer tokens to stake from caller to this contract\n require(token.transferFrom(msg.sender, address(this), _tokens), \"!transfer\");\n\n // Stake the transferred tokens\n _stake(_indexer, _tokens);\n }\n\n /**\n * @dev Unstake tokens from the indexer stake, lock them until thawing period expires.\n * @param _tokens Amount of tokens to unstake\n */\n function unstake(uint256 _tokens) external {\n address indexer = msg.sender;\n Stakes.Indexer storage indexerStake = stakes[indexer];\n\n require(_tokens > 0, \"!tokens\");\n require(indexerStake.hasTokens(), \"!stake\");\n require(indexerStake.tokensAvailable() >= _tokens, \"!stake-avail\");\n\n // Ensure minimum stake\n uint256 newStake = indexerStake.tokensSecureStake().sub(_tokens);\n require(newStake == 0 || newStake >= minimumIndexerStake, \"!minimumIndexerStake\");\n\n // Before locking more tokens, withdraw any unlocked ones\n uint256 tokensToWithdraw = indexerStake.tokensWithdrawable();\n if (tokensToWithdraw > 0) {\n _withdraw(indexer);\n }\n\n indexerStake.lockTokens(_tokens, thawingPeriod);\n\n emit StakeLocked(indexer, indexerStake.tokensLocked, indexerStake.tokensLockedUntil);\n }\n\n /**\n * @dev Withdraw indexer tokens once the thawing period has passed.\n */\n function withdraw() external {\n _withdraw(msg.sender);\n }\n\n function _stake(address _indexer, uint256 _tokens) internal {\n // Deposit tokens into the indexer stake\n Stakes.Indexer storage indexerStake = stakes[_indexer];\n indexerStake.deposit(_tokens);\n\n emit StakeDeposited(_indexer, _tokens);\n }\n\n /**\n * @dev Withdraw indexer tokens once the thawing period has passed.\n * @param _indexer Address of indexer to withdraw funds from\n */\n function _withdraw(address _indexer) private {\n // Get tokens available for withdraw and update balance\n uint256 tokensToWithdraw = stakes[_indexer].withdrawTokens();\n require(tokensToWithdraw > 0, \"!tokens\");\n\n // Return tokens to the indexer\n require(token.transfer(_indexer, tokensToWithdraw), \"!transfer\");\n\n emit StakeWithdrawn(_indexer, tokensToWithdraw);\n }\n}\n" + }, + "contracts/tests/WalletMock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport { Address } from \"@openzeppelin/contracts/utils/Address.sol\";\n\n/**\n * @title WalletMock: a mock wallet contract for testing purposes\n * @dev For testing only, DO NOT USE IN PRODUCTION.\n * This is used to test L1-L2 transfer tools and to create scenarios\n * where an invalid wallet calls the transfer tool, e.g. a wallet that has an invalid\n * manager, or a wallet that has not been initialized.\n */\ncontract WalletMock {\n /// Target contract for the fallback function (usually a transfer tool contract)\n address public immutable target;\n /// Address of the GRT (mock) token\n address public immutable token;\n /// Address of the wallet's manager\n address public immutable manager;\n /// Whether the wallet has been initialized\n bool public immutable isInitialized;\n /// Whether the beneficiary has accepted the lock\n bool public immutable isAccepted;\n\n /**\n * @notice WalletMock constructor\n * @dev This constructor sets all the state variables so that\n * specific test scenarios can be created just by deploying this contract.\n * @param _target Target contract for the fallback function\n * @param _token Address of the GRT (mock) token\n * @param _manager Address of the wallet's manager\n * @param _isInitialized Whether the wallet has been initialized\n * @param _isAccepted Whether the beneficiary has accepted the lock\n */\n constructor(address _target, address _token, address _manager, bool _isInitialized, bool _isAccepted) {\n target = _target;\n token = _token;\n manager = _manager;\n isInitialized = _isInitialized;\n isAccepted = _isAccepted;\n }\n\n /**\n * @notice Fallback function\n * @dev This function calls the target contract with the data sent to this contract.\n * This is used to test the L1-L2 transfer tool.\n */\n fallback() external payable {\n // Call function with data\n Address.functionCall(target, msg.data);\n }\n\n /**\n * @notice Receive function\n * @dev This function is added to avoid compiler warnings, but just reverts.\n */\n receive() external payable {\n revert(\"Invalid call\");\n }\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": false, + "runs": 200 + }, + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file diff --git a/packages/token-distribution/deployments/goerli/.chainId b/packages/token-distribution/deployments/goerli/.chainId new file mode 100644 index 000000000..7813681f5 --- /dev/null +++ b/packages/token-distribution/deployments/goerli/.chainId @@ -0,0 +1 @@ +5 \ No newline at end of file diff --git a/packages/token-distribution/deployments/goerli/GraphTokenLockManager-Testnet.json b/packages/token-distribution/deployments/goerli/GraphTokenLockManager-Testnet.json new file mode 100644 index 000000000..ec1a15ebd --- /dev/null +++ b/packages/token-distribution/deployments/goerli/GraphTokenLockManager-Testnet.json @@ -0,0 +1,932 @@ +{ + "address": "0xF3b617e0c966329363e78c266361794e84223313", + "abi": [ + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_graphToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_masterCopy", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes4", + "name": "sigHash", + "type": "bytes4" + }, + { + "indexed": true, + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "indexed": false, + "internalType": "string", + "name": "signature", + "type": "string" + } + ], + "name": "FunctionCallAuth", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "masterCopy", + "type": "address" + } + ], + "name": "MasterCopyUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "proxy", + "type": "address" + } + ], + "name": "ProxyCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "dst", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "TokenDestinationAllowed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "contractAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "initHash", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "managedAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "startTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "endTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "periods", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "releaseStartTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "vestingCliffTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "enum IGraphTokenLock.Revocability", + "name": "revocable", + "type": "uint8" + } + ], + "name": "TokenLockCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensDeposited", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensWithdrawn", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_dst", + "type": "address" + } + ], + "name": "addTokenDestination", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "", + "type": "bytes4" + } + ], + "name": "authFnCalls", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_owner", + "type": "address" + }, + { + "internalType": "address", + "name": "_beneficiary", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_managedAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_startTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_endTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_periods", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_releaseStartTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_vestingCliffTime", + "type": "uint256" + }, + { + "internalType": "enum IGraphTokenLock.Revocability", + "name": "_revocable", + "type": "uint8" + } + ], + "name": "createTokenLockWallet", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "deposit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_sigHash", + "type": "bytes4" + } + ], + "name": "getAuthFunctionCallTarget", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_salt", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "_implementation", + "type": "address" + }, + { + "internalType": "address", + "name": "_deployer", + "type": "address" + } + ], + "name": "getDeploymentAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "getTokenDestinations", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_sigHash", + "type": "bytes4" + } + ], + "name": "isAuthFunctionCall", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_dst", + "type": "address" + } + ], + "name": "isTokenDestination", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "masterCopy", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_dst", + "type": "address" + } + ], + "name": "removeTokenDestination", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_signature", + "type": "string" + }, + { + "internalType": "address", + "name": "_target", + "type": "address" + } + ], + "name": "setAuthFunctionCall", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string[]", + "name": "_signatures", + "type": "string[]" + }, + { + "internalType": "address[]", + "name": "_targets", + "type": "address[]" + } + ], + "name": "setAuthFunctionCallMany", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_masterCopy", + "type": "address" + } + ], + "name": "setMasterCopy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "token", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_signature", + "type": "string" + } + ], + "name": "unsetAuthFunctionCall", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x8ff337497a43f11d369102c1f1fcdca0475f0e8d199f0ce61f1012cdba528455", + "receipt": { + "to": null, + "from": "0xB15599AC1261C4828Ac7E66383ae520655d3D300", + "contractAddress": "0xF3b617e0c966329363e78c266361794e84223313", + "transactionIndex": 33, + "gasUsed": "3166750", + "logsBloom": "0x00000000000000000000000000020000000004010000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000400000000000040000020000000000000000000800000000000000000001000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000010000000000002000000002000000000000000000000000000000000000000000000000000000000020000020000000000000000000000000000000000000000000000000100000000000000000", + "blockHash": "0x3d4f81bf12b0231ab0b12d7c4f6f27334416efae9396ec4ec8f2766e1a0bc75e", + "transactionHash": "0x8ff337497a43f11d369102c1f1fcdca0475f0e8d199f0ce61f1012cdba528455", + "logs": [ + { + "transactionIndex": 33, + "blockNumber": 9345443, + "transactionHash": "0x8ff337497a43f11d369102c1f1fcdca0475f0e8d199f0ce61f1012cdba528455", + "address": "0xF3b617e0c966329363e78c266361794e84223313", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000b15599ac1261c4828ac7e66383ae520655d3d300" + ], + "data": "0x", + "logIndex": 2063, + "blockHash": "0x3d4f81bf12b0231ab0b12d7c4f6f27334416efae9396ec4ec8f2766e1a0bc75e" + }, + { + "transactionIndex": 33, + "blockNumber": 9345443, + "transactionHash": "0x8ff337497a43f11d369102c1f1fcdca0475f0e8d199f0ce61f1012cdba528455", + "address": "0xF3b617e0c966329363e78c266361794e84223313", + "topics": [ + "0x30909084afc859121ffc3a5aef7fe37c540a9a1ef60bd4d8dcdb76376fadf9de", + "0x000000000000000000000000c93df24c3a1ebeccd0e5d41198460081cfb38c49" + ], + "data": "0x", + "logIndex": 2064, + "blockHash": "0x3d4f81bf12b0231ab0b12d7c4f6f27334416efae9396ec4ec8f2766e1a0bc75e" + } + ], + "blockNumber": 9345443, + "cumulativeGasUsed": "11138915", + "status": 1, + "byzantium": true + }, + "args": [ + "0x5c946740441C12510a167B447B7dE565C20b9E3C", + "0xc93df24c3A1ebeCcd0e5D41198460081CFB38c49" + ], + "solcInputHash": "b5cdad58099d39cd1aed000b2fd864d8", + "metadata": "{\"compiler\":{\"version\":\"0.7.3+commit.9bfce1f6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"_graphToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_masterCopy\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes4\",\"name\":\"sigHash\",\"type\":\"bytes4\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"signature\",\"type\":\"string\"}],\"name\":\"FunctionCallAuth\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"masterCopy\",\"type\":\"address\"}],\"name\":\"MasterCopyUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"proxy\",\"type\":\"address\"}],\"name\":\"ProxyCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dst\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"}],\"name\":\"TokenDestinationAllowed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"contractAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"initHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"managedAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"startTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"endTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"periods\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"releaseStartTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"vestingCliffTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"enum IGraphTokenLock.Revocability\",\"name\":\"revocable\",\"type\":\"uint8\"}],\"name\":\"TokenLockCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensWithdrawn\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_dst\",\"type\":\"address\"}],\"name\":\"addTokenDestination\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"name\":\"authFnCalls\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_beneficiary\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_managedAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_startTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_endTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_periods\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_releaseStartTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_vestingCliffTime\",\"type\":\"uint256\"},{\"internalType\":\"enum IGraphTokenLock.Revocability\",\"name\":\"_revocable\",\"type\":\"uint8\"}],\"name\":\"createTokenLockWallet\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"deposit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"_sigHash\",\"type\":\"bytes4\"}],\"name\":\"getAuthFunctionCallTarget\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_salt\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_deployer\",\"type\":\"address\"}],\"name\":\"getDeploymentAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTokenDestinations\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"_sigHash\",\"type\":\"bytes4\"}],\"name\":\"isAuthFunctionCall\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_dst\",\"type\":\"address\"}],\"name\":\"isTokenDestination\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"masterCopy\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_dst\",\"type\":\"address\"}],\"name\":\"removeTokenDestination\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_signature\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"_target\",\"type\":\"address\"}],\"name\":\"setAuthFunctionCall\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string[]\",\"name\":\"_signatures\",\"type\":\"string[]\"},{\"internalType\":\"address[]\",\"name\":\"_targets\",\"type\":\"address[]\"}],\"name\":\"setAuthFunctionCallMany\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_masterCopy\",\"type\":\"address\"}],\"name\":\"setMasterCopy\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_signature\",\"type\":\"string\"}],\"name\":\"unsetAuthFunctionCall\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"addTokenDestination(address)\":{\"params\":{\"_dst\":\"Destination address\"}},\"constructor\":{\"params\":{\"_graphToken\":\"Token to use for deposits and withdrawals\",\"_masterCopy\":\"Address of the master copy to use to clone proxies\"}},\"createTokenLockWallet(address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)\":{\"params\":{\"_beneficiary\":\"Address of the beneficiary of locked tokens\",\"_endTime\":\"End time of the release schedule\",\"_managedAmount\":\"Amount of tokens to be managed by the lock contract\",\"_owner\":\"Address of the contract owner\",\"_periods\":\"Number of periods between start time and end time\",\"_releaseStartTime\":\"Override time for when the releases start\",\"_revocable\":\"Whether the contract is revocable\",\"_startTime\":\"Start time of the release schedule\"}},\"deposit(uint256)\":{\"details\":\"Even if the ERC20 token can be transferred directly to the contract this function provide a safe interface to do the transfer and avoid mistakes\",\"params\":{\"_amount\":\"Amount to deposit\"}},\"getAuthFunctionCallTarget(bytes4)\":{\"params\":{\"_sigHash\":\"Function signature hash\"},\"returns\":{\"_0\":\"Address of the target contract where to send the call\"}},\"getDeploymentAddress(bytes32,address,address)\":{\"params\":{\"_deployer\":\"Address of the deployer that creates the contract\",\"_implementation\":\"Address of the proxy target implementation\",\"_salt\":\"Bytes32 salt to use for CREATE2\"},\"returns\":{\"_0\":\"Address of the counterfactual MinimalProxy\"}},\"getTokenDestinations()\":{\"returns\":{\"_0\":\"Array of addresses authorized to pull funds from a token lock\"}},\"isAuthFunctionCall(bytes4)\":{\"params\":{\"_sigHash\":\"Function signature hash\"},\"returns\":{\"_0\":\"True if authorized\"}},\"isTokenDestination(address)\":{\"params\":{\"_dst\":\"Destination address\"},\"returns\":{\"_0\":\"True if authorized\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"removeTokenDestination(address)\":{\"params\":{\"_dst\":\"Destination address\"}},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"setAuthFunctionCall(string,address)\":{\"details\":\"Input expected is the function signature as 'transfer(address,uint256)'\",\"params\":{\"_signature\":\"Function signature\",\"_target\":\"Address of the destination contract to call\"}},\"setAuthFunctionCallMany(string[],address[])\":{\"details\":\"Input expected is the function signature as 'transfer(address,uint256)'\",\"params\":{\"_signatures\":\"Function signatures\",\"_targets\":\"Address of the destination contract to call\"}},\"setMasterCopy(address)\":{\"params\":{\"_masterCopy\":\"Address of contract bytecode to factory clone\"}},\"token()\":{\"returns\":{\"_0\":\"Token used for transfers and approvals\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"unsetAuthFunctionCall(string)\":{\"details\":\"Input expected is the function signature as 'transfer(address,uint256)'\",\"params\":{\"_signature\":\"Function signature\"}},\"withdraw(uint256)\":{\"details\":\"Escape hatch in case of mistakes or to recover remaining funds\",\"params\":{\"_amount\":\"Amount of tokens to withdraw\"}}},\"title\":\"GraphTokenLockManager\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"addTokenDestination(address)\":{\"notice\":\"Adds an address that can be allowed by a token lock to pull funds\"},\"constructor\":{\"notice\":\"Constructor.\"},\"createTokenLockWallet(address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)\":{\"notice\":\"Creates and fund a new token lock wallet using a minimum proxy\"},\"deposit(uint256)\":{\"notice\":\"Deposits tokens into the contract\"},\"getAuthFunctionCallTarget(bytes4)\":{\"notice\":\"Gets the target contract to call for a particular function signature\"},\"getDeploymentAddress(bytes32,address,address)\":{\"notice\":\"Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation\"},\"getTokenDestinations()\":{\"notice\":\"Returns an array of authorized destination addresses\"},\"isAuthFunctionCall(bytes4)\":{\"notice\":\"Returns true if the function call is authorized\"},\"isTokenDestination(address)\":{\"notice\":\"Returns True if the address is authorized to be a destination of tokens\"},\"removeTokenDestination(address)\":{\"notice\":\"Removes an address that can be allowed by a token lock to pull funds\"},\"setAuthFunctionCall(string,address)\":{\"notice\":\"Sets an authorized function call to target\"},\"setAuthFunctionCallMany(string[],address[])\":{\"notice\":\"Sets an authorized function call to target in bulk\"},\"setMasterCopy(address)\":{\"notice\":\"Sets the masterCopy bytecode to use to create clones of TokenLock contracts\"},\"token()\":{\"notice\":\"Gets the GRT token address\"},\"unsetAuthFunctionCall(string)\":{\"notice\":\"Unsets an authorized function call to target\"},\"withdraw(uint256)\":{\"notice\":\"Withdraws tokens from the contract\"}},\"notice\":\"This contract manages a list of authorized function calls and targets that can be called by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts. This contract receives funds to make the process of creating TokenLockWallet contracts easier by distributing them the initial tokens to be managed. The owner can setup a list of token destinations that will be used by TokenLock contracts to approve the pulling of funds, this way in can be guaranteed that only protocol contracts will manipulate users funds.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/GraphTokenLockManager.sol\":\"GraphTokenLockManager\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor () internal {\\n address msgSender = _msgSender();\\n _owner = msgSender;\\n emit OwnershipTransferred(address(0), msgSender);\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n emit OwnershipTransferred(_owner, address(0));\\n _owner = address(0);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n emit OwnershipTransferred(_owner, newOwner);\\n _owner = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0x15e2d5bd4c28a88548074c54d220e8086f638a71ed07e6b3ba5a70066fcf458d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/math/SafeMath.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Wrappers over Solidity's arithmetic operations with added overflow\\n * checks.\\n *\\n * Arithmetic operations in Solidity wrap on overflow. This can easily result\\n * in bugs, because programmers usually assume that an overflow raises an\\n * error, which is the standard behavior in high level programming languages.\\n * `SafeMath` restores this intuition by reverting the transaction when an\\n * operation overflows.\\n *\\n * Using this library instead of the unchecked operations eliminates an entire\\n * class of bugs, so it's recommended to use it always.\\n */\\nlibrary SafeMath {\\n /**\\n * @dev Returns the addition of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n uint256 c = a + b;\\n if (c < a) return (false, 0);\\n return (true, c);\\n }\\n\\n /**\\n * @dev Returns the substraction of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b > a) return (false, 0);\\n return (true, a - b);\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\\n if (a == 0) return (true, 0);\\n uint256 c = a * b;\\n if (c / a != b) return (false, 0);\\n return (true, c);\\n }\\n\\n /**\\n * @dev Returns the division of two unsigned integers, with a division by zero flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b == 0) return (false, 0);\\n return (true, a / b);\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b == 0) return (false, 0);\\n return (true, a % b);\\n }\\n\\n /**\\n * @dev Returns the addition of two unsigned integers, reverting on\\n * overflow.\\n *\\n * Counterpart to Solidity's `+` operator.\\n *\\n * Requirements:\\n *\\n * - Addition cannot overflow.\\n */\\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\\n uint256 c = a + b;\\n require(c >= a, \\\"SafeMath: addition overflow\\\");\\n return c;\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting on\\n * overflow (when the result is negative).\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n *\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b <= a, \\\"SafeMath: subtraction overflow\\\");\\n return a - b;\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, reverting on\\n * overflow.\\n *\\n * Counterpart to Solidity's `*` operator.\\n *\\n * Requirements:\\n *\\n * - Multiplication cannot overflow.\\n */\\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\\n if (a == 0) return 0;\\n uint256 c = a * b;\\n require(c / a == b, \\\"SafeMath: multiplication overflow\\\");\\n return c;\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers, reverting on\\n * division by zero. The result is rounded towards zero.\\n *\\n * Counterpart to Solidity's `/` operator. Note: this function uses a\\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\\n * uses an invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b > 0, \\\"SafeMath: division by zero\\\");\\n return a / b;\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * reverting when dividing by zero.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b > 0, \\\"SafeMath: modulo by zero\\\");\\n return a % b;\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\\n * overflow (when the result is negative).\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {trySub}.\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n *\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b <= a, errorMessage);\\n return a - b;\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers, reverting with custom message on\\n * division by zero. The result is rounded towards zero.\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {tryDiv}.\\n *\\n * Counterpart to Solidity's `/` operator. Note: this function uses a\\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\\n * uses an invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b > 0, errorMessage);\\n return a / b;\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * reverting with custom message when dividing by zero.\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {tryMod}.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b > 0, errorMessage);\\n return a % b;\\n }\\n}\\n\",\"keccak256\":\"0xcc78a17dd88fa5a2edc60c8489e2f405c0913b377216a5b26b35656b2d0dab52\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `recipient`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address recipient, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `sender` to `recipient` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n}\\n\",\"keccak256\":\"0x5f02220344881ce43204ae4a6281145a67bc52c2bb1290a791857df3d19d78f5\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\nimport \\\"./IERC20.sol\\\";\\nimport \\\"../../math/SafeMath.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @title SafeERC20\\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\\n * contract returns false). Tokens that return no value (and instead revert or\\n * throw on failure) are also supported, non-reverting calls are assumed to be\\n * successful.\\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\n */\\nlibrary SafeERC20 {\\n using SafeMath for uint256;\\n using Address for address;\\n\\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\\n }\\n\\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\\n }\\n\\n /**\\n * @dev Deprecated. This function has issues similar to the ones found in\\n * {IERC20-approve}, and its usage is discouraged.\\n *\\n * Whenever possible, use {safeIncreaseAllowance} and\\n * {safeDecreaseAllowance} instead.\\n */\\n function safeApprove(IERC20 token, address spender, uint256 value) internal {\\n // safeApprove should only be called when setting an initial allowance,\\n // or when resetting it to zero. To increase and decrease it, use\\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\\n // solhint-disable-next-line max-line-length\\n require((value == 0) || (token.allowance(address(this), spender) == 0),\\n \\\"SafeERC20: approve from non-zero to non-zero allowance\\\"\\n );\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\\n }\\n\\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n uint256 newAllowance = token.allowance(address(this), spender).add(value);\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n uint256 newAllowance = token.allowance(address(this), spender).sub(value, \\\"SafeERC20: decreased allowance below zero\\\");\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n */\\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that\\n // the target address contains contract code and also asserts for success in the low-level call.\\n\\n bytes memory returndata = address(token).functionCall(data, \\\"SafeERC20: low-level call failed\\\");\\n if (returndata.length > 0) { // Return data is optional\\n // solhint-disable-next-line max-line-length\\n require(abi.decode(returndata, (bool)), \\\"SafeERC20: ERC20 operation did not succeed\\\");\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf12dfbe97e6276980b83d2830bb0eb75e0cf4f3e626c2471137f82158ae6a0fc\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.2 <0.8.0;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize, which returns 0 for contracts in\\n // construction, since the code is only stored at the end of the\\n // constructor execution.\\n\\n uint256 size;\\n // solhint-disable-next-line no-inline-assembly\\n assembly { size := extcodesize(account) }\\n return size > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls, avoid-call-value\\n (bool success, ) = recipient.call{ value: amount }(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain`call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.call{ value: value }(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x28911e614500ae7c607a432a709d35da25f3bc5ddc8bd12b278b66358070c0ea\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/*\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with GSN meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address payable) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes memory) {\\n this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0x8d3cb350f04ff49cfb10aef08d87f19dcbaecc8027b0bed12f3275cd12f38cf0\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Create2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Helper to make usage of the `CREATE2` EVM opcode easier and safer.\\n * `CREATE2` can be used to compute in advance the address where a smart\\n * contract will be deployed, which allows for interesting new mechanisms known\\n * as 'counterfactual interactions'.\\n *\\n * See the https://eips.ethereum.org/EIPS/eip-1014#motivation[EIP] for more\\n * information.\\n */\\nlibrary Create2 {\\n /**\\n * @dev Deploys a contract using `CREATE2`. The address where the contract\\n * will be deployed can be known in advance via {computeAddress}.\\n *\\n * The bytecode for a contract can be obtained from Solidity with\\n * `type(contractName).creationCode`.\\n *\\n * Requirements:\\n *\\n * - `bytecode` must not be empty.\\n * - `salt` must have not been used for `bytecode` already.\\n * - the factory must have a balance of at least `amount`.\\n * - if `amount` is non-zero, `bytecode` must have a `payable` constructor.\\n */\\n function deploy(uint256 amount, bytes32 salt, bytes memory bytecode) internal returns (address) {\\n address addr;\\n require(address(this).balance >= amount, \\\"Create2: insufficient balance\\\");\\n require(bytecode.length != 0, \\\"Create2: bytecode length is zero\\\");\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n addr := create2(amount, add(bytecode, 0x20), mload(bytecode), salt)\\n }\\n require(addr != address(0), \\\"Create2: Failed on deploy\\\");\\n return addr;\\n }\\n\\n /**\\n * @dev Returns the address where a contract will be stored if deployed via {deploy}. Any change in the\\n * `bytecodeHash` or `salt` will result in a new destination address.\\n */\\n function computeAddress(bytes32 salt, bytes32 bytecodeHash) internal view returns (address) {\\n return computeAddress(salt, bytecodeHash, address(this));\\n }\\n\\n /**\\n * @dev Returns the address where a contract will be stored if deployed via {deploy} from a contract located at\\n * `deployer`. If `deployer` is this contract's address, returns the same value as {computeAddress}.\\n */\\n function computeAddress(bytes32 salt, bytes32 bytecodeHash, address deployer) internal pure returns (address) {\\n bytes32 _data = keccak256(\\n abi.encodePacked(bytes1(0xff), deployer, salt, bytecodeHash)\\n );\\n return address(uint160(uint256(_data)));\\n }\\n}\\n\",\"keccak256\":\"0x0a0b021149946014fe1cd04af11e7a937a29986c47e8b1b718c2d50d729472db\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/EnumerableSet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Library for managing\\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\\n * types.\\n *\\n * Sets have the following properties:\\n *\\n * - Elements are added, removed, and checked for existence in constant time\\n * (O(1)).\\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\\n *\\n * ```\\n * contract Example {\\n * // Add the library methods\\n * using EnumerableSet for EnumerableSet.AddressSet;\\n *\\n * // Declare a set state variable\\n * EnumerableSet.AddressSet private mySet;\\n * }\\n * ```\\n *\\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\\n * and `uint256` (`UintSet`) are supported.\\n */\\nlibrary EnumerableSet {\\n // To implement this library for multiple types with as little code\\n // repetition as possible, we write it in terms of a generic Set type with\\n // bytes32 values.\\n // The Set implementation uses private functions, and user-facing\\n // implementations (such as AddressSet) are just wrappers around the\\n // underlying Set.\\n // This means that we can only create new EnumerableSets for types that fit\\n // in bytes32.\\n\\n struct Set {\\n // Storage of set values\\n bytes32[] _values;\\n\\n // Position of the value in the `values` array, plus 1 because index 0\\n // means a value is not in the set.\\n mapping (bytes32 => uint256) _indexes;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function _add(Set storage set, bytes32 value) private returns (bool) {\\n if (!_contains(set, value)) {\\n set._values.push(value);\\n // The value is stored at length-1, but we add 1 to all indexes\\n // and use 0 as a sentinel value\\n set._indexes[value] = set._values.length;\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function _remove(Set storage set, bytes32 value) private returns (bool) {\\n // We read and store the value's index to prevent multiple reads from the same storage slot\\n uint256 valueIndex = set._indexes[value];\\n\\n if (valueIndex != 0) { // Equivalent to contains(set, value)\\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\\n // the array, and then remove the last element (sometimes called as 'swap and pop').\\n // This modifies the order of the array, as noted in {at}.\\n\\n uint256 toDeleteIndex = valueIndex - 1;\\n uint256 lastIndex = set._values.length - 1;\\n\\n // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs\\n // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.\\n\\n bytes32 lastvalue = set._values[lastIndex];\\n\\n // Move the last value to the index where the value to delete is\\n set._values[toDeleteIndex] = lastvalue;\\n // Update the index for the moved value\\n set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based\\n\\n // Delete the slot where the moved value was stored\\n set._values.pop();\\n\\n // Delete the index for the deleted slot\\n delete set._indexes[value];\\n\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\\n return set._indexes[value] != 0;\\n }\\n\\n /**\\n * @dev Returns the number of values on the set. O(1).\\n */\\n function _length(Set storage set) private view returns (uint256) {\\n return set._values.length;\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\\n require(set._values.length > index, \\\"EnumerableSet: index out of bounds\\\");\\n return set._values[index];\\n }\\n\\n // Bytes32Set\\n\\n struct Bytes32Set {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _add(set._inner, value);\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _remove(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\\n return _contains(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(Bytes32Set storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\\n return _at(set._inner, index);\\n }\\n\\n // AddressSet\\n\\n struct AddressSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(AddressSet storage set, address value) internal returns (bool) {\\n return _add(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(AddressSet storage set, address value) internal returns (bool) {\\n return _remove(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(AddressSet storage set, address value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(AddressSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\\n return address(uint160(uint256(_at(set._inner, index))));\\n }\\n\\n\\n // UintSet\\n\\n struct UintSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(UintSet storage set, uint256 value) internal returns (bool) {\\n return _add(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\\n return _remove(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns the number of values on the set. O(1).\\n */\\n function length(UintSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\\n return uint256(_at(set._inner, index));\\n }\\n}\\n\",\"keccak256\":\"0x1562cd9922fbf739edfb979f506809e2743789cbde3177515542161c3d04b164\",\"license\":\"MIT\"},\"contracts/GraphTokenLock.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nimport \\\"@openzeppelin/contracts/math/SafeMath.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\\\";\\n\\nimport { Ownable as OwnableInitializable } from \\\"./Ownable.sol\\\";\\nimport \\\"./MathUtils.sol\\\";\\nimport \\\"./IGraphTokenLock.sol\\\";\\n\\n/**\\n * @title GraphTokenLock\\n * @notice Contract that manages an unlocking schedule of tokens.\\n * @dev The contract lock manage a number of tokens deposited into the contract to ensure that\\n * they can only be released under certain time conditions.\\n *\\n * This contract implements a release scheduled based on periods and tokens are released in steps\\n * after each period ends. It can be configured with one period in which case it is like a plain TimeLock.\\n * It also supports revocation to be used for vesting schedules.\\n *\\n * The contract supports receiving extra funds than the managed tokens ones that can be\\n * withdrawn by the beneficiary at any time.\\n *\\n * A releaseStartTime parameter is included to override the default release schedule and\\n * perform the first release on the configured time. After that it will continue with the\\n * default schedule.\\n */\\nabstract contract GraphTokenLock is OwnableInitializable, IGraphTokenLock {\\n using SafeMath for uint256;\\n using SafeERC20 for IERC20;\\n\\n uint256 private constant MIN_PERIOD = 1;\\n\\n // -- State --\\n\\n IERC20 public token;\\n address public beneficiary;\\n\\n // Configuration\\n\\n // Amount of tokens managed by the contract schedule\\n uint256 public managedAmount;\\n\\n uint256 public startTime; // Start datetime (in unixtimestamp)\\n uint256 public endTime; // Datetime after all funds are fully vested/unlocked (in unixtimestamp)\\n uint256 public periods; // Number of vesting/release periods\\n\\n // First release date for tokens (in unixtimestamp)\\n // If set, no tokens will be released before releaseStartTime ignoring\\n // the amount to release each period\\n uint256 public releaseStartTime;\\n // A cliff set a date to which a beneficiary needs to get to vest\\n // all preceding periods\\n uint256 public vestingCliffTime;\\n Revocability public revocable; // Whether to use vesting for locked funds\\n\\n // State\\n\\n bool public isRevoked;\\n bool public isInitialized;\\n bool public isAccepted;\\n uint256 public releasedAmount;\\n uint256 public revokedAmount;\\n\\n // -- Events --\\n\\n event TokensReleased(address indexed beneficiary, uint256 amount);\\n event TokensWithdrawn(address indexed beneficiary, uint256 amount);\\n event TokensRevoked(address indexed beneficiary, uint256 amount);\\n event BeneficiaryChanged(address newBeneficiary);\\n event LockAccepted();\\n event LockCanceled();\\n\\n /**\\n * @dev Only allow calls from the beneficiary of the contract\\n */\\n modifier onlyBeneficiary() {\\n require(msg.sender == beneficiary, \\\"!auth\\\");\\n _;\\n }\\n\\n /**\\n * @notice Initializes the contract\\n * @param _owner Address of the contract owner\\n * @param _beneficiary Address of the beneficiary of locked tokens\\n * @param _managedAmount Amount of tokens to be managed by the lock contract\\n * @param _startTime Start time of the release schedule\\n * @param _endTime End time of the release schedule\\n * @param _periods Number of periods between start time and end time\\n * @param _releaseStartTime Override time for when the releases start\\n * @param _vestingCliffTime Override time for when the vesting start\\n * @param _revocable Whether the contract is revocable\\n */\\n function _initialize(\\n address _owner,\\n address _beneficiary,\\n address _token,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n Revocability _revocable\\n ) internal {\\n require(!isInitialized, \\\"Already initialized\\\");\\n require(_owner != address(0), \\\"Owner cannot be zero\\\");\\n require(_beneficiary != address(0), \\\"Beneficiary cannot be zero\\\");\\n require(_token != address(0), \\\"Token cannot be zero\\\");\\n require(_managedAmount > 0, \\\"Managed tokens cannot be zero\\\");\\n require(_startTime != 0, \\\"Start time must be set\\\");\\n require(_startTime < _endTime, \\\"Start time > end time\\\");\\n require(_periods >= MIN_PERIOD, \\\"Periods cannot be below minimum\\\");\\n require(_revocable != Revocability.NotSet, \\\"Must set a revocability option\\\");\\n require(_releaseStartTime < _endTime, \\\"Release start time must be before end time\\\");\\n require(_vestingCliffTime < _endTime, \\\"Cliff time must be before end time\\\");\\n\\n isInitialized = true;\\n\\n OwnableInitializable._initialize(_owner);\\n beneficiary = _beneficiary;\\n token = IERC20(_token);\\n\\n managedAmount = _managedAmount;\\n\\n startTime = _startTime;\\n endTime = _endTime;\\n periods = _periods;\\n\\n // Optionals\\n releaseStartTime = _releaseStartTime;\\n vestingCliffTime = _vestingCliffTime;\\n revocable = _revocable;\\n }\\n\\n /**\\n * @notice Change the beneficiary of funds managed by the contract\\n * @dev Can only be called by the beneficiary\\n * @param _newBeneficiary Address of the new beneficiary address\\n */\\n function changeBeneficiary(address _newBeneficiary) external onlyBeneficiary {\\n require(_newBeneficiary != address(0), \\\"Empty beneficiary\\\");\\n beneficiary = _newBeneficiary;\\n emit BeneficiaryChanged(_newBeneficiary);\\n }\\n\\n /**\\n * @notice Beneficiary accepts the lock, the owner cannot retrieve back the tokens\\n * @dev Can only be called by the beneficiary\\n */\\n function acceptLock() external onlyBeneficiary {\\n isAccepted = true;\\n emit LockAccepted();\\n }\\n\\n /**\\n * @notice Owner cancel the lock and return the balance in the contract\\n * @dev Can only be called by the owner\\n */\\n function cancelLock() external onlyOwner {\\n require(isAccepted == false, \\\"Cannot cancel accepted contract\\\");\\n\\n token.safeTransfer(owner(), currentBalance());\\n\\n emit LockCanceled();\\n }\\n\\n // -- Balances --\\n\\n /**\\n * @notice Returns the amount of tokens currently held by the contract\\n * @return Tokens held in the contract\\n */\\n function currentBalance() public view override returns (uint256) {\\n return token.balanceOf(address(this));\\n }\\n\\n // -- Time & Periods --\\n\\n /**\\n * @notice Returns the current block timestamp\\n * @return Current block timestamp\\n */\\n function currentTime() public view override returns (uint256) {\\n return block.timestamp;\\n }\\n\\n /**\\n * @notice Gets duration of contract from start to end in seconds\\n * @return Amount of seconds from contract startTime to endTime\\n */\\n function duration() public view override returns (uint256) {\\n return endTime.sub(startTime);\\n }\\n\\n /**\\n * @notice Gets time elapsed since the start of the contract\\n * @dev Returns zero if called before conctract starTime\\n * @return Seconds elapsed from contract startTime\\n */\\n function sinceStartTime() public view override returns (uint256) {\\n uint256 current = currentTime();\\n if (current <= startTime) {\\n return 0;\\n }\\n return current.sub(startTime);\\n }\\n\\n /**\\n * @notice Returns amount available to be released after each period according to schedule\\n * @return Amount of tokens available after each period\\n */\\n function amountPerPeriod() public view override returns (uint256) {\\n return managedAmount.div(periods);\\n }\\n\\n /**\\n * @notice Returns the duration of each period in seconds\\n * @return Duration of each period in seconds\\n */\\n function periodDuration() public view override returns (uint256) {\\n return duration().div(periods);\\n }\\n\\n /**\\n * @notice Gets the current period based on the schedule\\n * @return A number that represents the current period\\n */\\n function currentPeriod() public view override returns (uint256) {\\n return sinceStartTime().div(periodDuration()).add(MIN_PERIOD);\\n }\\n\\n /**\\n * @notice Gets the number of periods that passed since the first period\\n * @return A number of periods that passed since the schedule started\\n */\\n function passedPeriods() public view override returns (uint256) {\\n return currentPeriod().sub(MIN_PERIOD);\\n }\\n\\n // -- Locking & Release Schedule --\\n\\n /**\\n * @notice Gets the currently available token according to the schedule\\n * @dev Implements the step-by-step schedule based on periods for available tokens\\n * @return Amount of tokens available according to the schedule\\n */\\n function availableAmount() public view override returns (uint256) {\\n uint256 current = currentTime();\\n\\n // Before contract start no funds are available\\n if (current < startTime) {\\n return 0;\\n }\\n\\n // After contract ended all funds are available\\n if (current > endTime) {\\n return managedAmount;\\n }\\n\\n // Get available amount based on period\\n return passedPeriods().mul(amountPerPeriod());\\n }\\n\\n /**\\n * @notice Gets the amount of currently vested tokens\\n * @dev Similar to available amount, but is fully vested when contract is non-revocable\\n * @return Amount of tokens already vested\\n */\\n function vestedAmount() public view override returns (uint256) {\\n // If non-revocable it is fully vested\\n if (revocable == Revocability.Disabled) {\\n return managedAmount;\\n }\\n\\n // Vesting cliff is activated and it has not passed means nothing is vested yet\\n if (vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\\n return 0;\\n }\\n\\n return availableAmount();\\n }\\n\\n /**\\n * @notice Gets tokens currently available for release\\n * @dev Considers the schedule and takes into account already released tokens\\n * @return Amount of tokens ready to be released\\n */\\n function releasableAmount() public view virtual override returns (uint256) {\\n // If a release start time is set no tokens are available for release before this date\\n // If not set it follows the default schedule and tokens are available on\\n // the first period passed\\n if (releaseStartTime > 0 && currentTime() < releaseStartTime) {\\n return 0;\\n }\\n\\n // Vesting cliff is activated and it has not passed means nothing is vested yet\\n // so funds cannot be released\\n if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\\n return 0;\\n }\\n\\n // A beneficiary can never have more releasable tokens than the contract balance\\n uint256 releasable = availableAmount().sub(releasedAmount);\\n return MathUtils.min(currentBalance(), releasable);\\n }\\n\\n /**\\n * @notice Gets the outstanding amount yet to be released based on the whole contract lifetime\\n * @dev Does not consider schedule but just global amounts tracked\\n * @return Amount of outstanding tokens for the lifetime of the contract\\n */\\n function totalOutstandingAmount() public view override returns (uint256) {\\n return managedAmount.sub(releasedAmount).sub(revokedAmount);\\n }\\n\\n /**\\n * @notice Gets surplus amount in the contract based on outstanding amount to release\\n * @dev All funds over outstanding amount is considered surplus that can be withdrawn by beneficiary.\\n * Note this might not be the correct value for wallets transferred to L2 (i.e. an L2GraphTokenLockWallet), as the released amount will be\\n * skewed, so the beneficiary might have to bridge back to L1 to release the surplus.\\n * @return Amount of tokens considered as surplus\\n */\\n function surplusAmount() public view override returns (uint256) {\\n uint256 balance = currentBalance();\\n uint256 outstandingAmount = totalOutstandingAmount();\\n if (balance > outstandingAmount) {\\n return balance.sub(outstandingAmount);\\n }\\n return 0;\\n }\\n\\n // -- Value Transfer --\\n\\n /**\\n * @notice Releases tokens based on the configured schedule\\n * @dev All available releasable tokens are transferred to beneficiary\\n */\\n function release() external override onlyBeneficiary {\\n uint256 amountToRelease = releasableAmount();\\n require(amountToRelease > 0, \\\"No available releasable amount\\\");\\n\\n releasedAmount = releasedAmount.add(amountToRelease);\\n\\n token.safeTransfer(beneficiary, amountToRelease);\\n\\n emit TokensReleased(beneficiary, amountToRelease);\\n }\\n\\n /**\\n * @notice Withdraws surplus, unmanaged tokens from the contract\\n * @dev Tokens in the contract over outstanding amount are considered as surplus\\n * @param _amount Amount of tokens to withdraw\\n */\\n function withdrawSurplus(uint256 _amount) external override onlyBeneficiary {\\n require(_amount > 0, \\\"Amount cannot be zero\\\");\\n require(surplusAmount() >= _amount, \\\"Amount requested > surplus available\\\");\\n\\n token.safeTransfer(beneficiary, _amount);\\n\\n emit TokensWithdrawn(beneficiary, _amount);\\n }\\n\\n /**\\n * @notice Revokes a vesting schedule and return the unvested tokens to the owner\\n * @dev Vesting schedule is always calculated based on managed tokens\\n */\\n function revoke() external override onlyOwner {\\n require(revocable == Revocability.Enabled, \\\"Contract is non-revocable\\\");\\n require(isRevoked == false, \\\"Already revoked\\\");\\n\\n uint256 unvestedAmount = managedAmount.sub(vestedAmount());\\n require(unvestedAmount > 0, \\\"No available unvested amount\\\");\\n\\n revokedAmount = unvestedAmount;\\n isRevoked = true;\\n\\n token.safeTransfer(owner(), unvestedAmount);\\n\\n emit TokensRevoked(beneficiary, unvestedAmount);\\n }\\n}\\n\",\"keccak256\":\"0xd89470956a476c2fcf4a09625775573f95ba2c60a57fe866d90f65de1bcf5f2d\",\"license\":\"MIT\"},\"contracts/GraphTokenLockManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/EnumerableSet.sol\\\";\\nimport { Ownable } from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\n\\nimport \\\"./MinimalProxyFactory.sol\\\";\\nimport \\\"./IGraphTokenLockManager.sol\\\";\\nimport { GraphTokenLockWallet } from \\\"./GraphTokenLockWallet.sol\\\";\\n\\n/**\\n * @title GraphTokenLockManager\\n * @notice This contract manages a list of authorized function calls and targets that can be called\\n * by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts.\\n *\\n * This contract receives funds to make the process of creating TokenLockWallet contracts\\n * easier by distributing them the initial tokens to be managed.\\n *\\n * The owner can setup a list of token destinations that will be used by TokenLock contracts to\\n * approve the pulling of funds, this way in can be guaranteed that only protocol contracts\\n * will manipulate users funds.\\n */\\ncontract GraphTokenLockManager is Ownable, MinimalProxyFactory, IGraphTokenLockManager {\\n using SafeERC20 for IERC20;\\n using EnumerableSet for EnumerableSet.AddressSet;\\n\\n // -- State --\\n\\n mapping(bytes4 => address) public authFnCalls;\\n EnumerableSet.AddressSet private _tokenDestinations;\\n\\n address public masterCopy;\\n IERC20 internal _token;\\n\\n // -- Events --\\n\\n event MasterCopyUpdated(address indexed masterCopy);\\n event TokenLockCreated(\\n address indexed contractAddress,\\n bytes32 indexed initHash,\\n address indexed beneficiary,\\n address token,\\n uint256 managedAmount,\\n uint256 startTime,\\n uint256 endTime,\\n uint256 periods,\\n uint256 releaseStartTime,\\n uint256 vestingCliffTime,\\n IGraphTokenLock.Revocability revocable\\n );\\n\\n event TokensDeposited(address indexed sender, uint256 amount);\\n event TokensWithdrawn(address indexed sender, uint256 amount);\\n\\n event FunctionCallAuth(address indexed caller, bytes4 indexed sigHash, address indexed target, string signature);\\n event TokenDestinationAllowed(address indexed dst, bool allowed);\\n\\n /**\\n * Constructor.\\n * @param _graphToken Token to use for deposits and withdrawals\\n * @param _masterCopy Address of the master copy to use to clone proxies\\n */\\n constructor(IERC20 _graphToken, address _masterCopy) {\\n require(address(_graphToken) != address(0), \\\"Token cannot be zero\\\");\\n _token = _graphToken;\\n setMasterCopy(_masterCopy);\\n }\\n\\n // -- Factory --\\n\\n /**\\n * @notice Sets the masterCopy bytecode to use to create clones of TokenLock contracts\\n * @param _masterCopy Address of contract bytecode to factory clone\\n */\\n function setMasterCopy(address _masterCopy) public override onlyOwner {\\n require(_masterCopy != address(0), \\\"MasterCopy cannot be zero\\\");\\n masterCopy = _masterCopy;\\n emit MasterCopyUpdated(_masterCopy);\\n }\\n\\n /**\\n * @notice Creates and fund a new token lock wallet using a minimum proxy\\n * @param _owner Address of the contract owner\\n * @param _beneficiary Address of the beneficiary of locked tokens\\n * @param _managedAmount Amount of tokens to be managed by the lock contract\\n * @param _startTime Start time of the release schedule\\n * @param _endTime End time of the release schedule\\n * @param _periods Number of periods between start time and end time\\n * @param _releaseStartTime Override time for when the releases start\\n * @param _revocable Whether the contract is revocable\\n */\\n function createTokenLockWallet(\\n address _owner,\\n address _beneficiary,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n IGraphTokenLock.Revocability _revocable\\n ) external override onlyOwner {\\n require(_token.balanceOf(address(this)) >= _managedAmount, \\\"Not enough tokens to create lock\\\");\\n\\n // Create contract using a minimal proxy and call initializer\\n bytes memory initializer = abi.encodeWithSelector(\\n GraphTokenLockWallet.initialize.selector,\\n address(this),\\n _owner,\\n _beneficiary,\\n address(_token),\\n _managedAmount,\\n _startTime,\\n _endTime,\\n _periods,\\n _releaseStartTime,\\n _vestingCliffTime,\\n _revocable\\n );\\n address contractAddress = _deployProxy2(keccak256(initializer), masterCopy, initializer);\\n\\n // Send managed amount to the created contract\\n _token.safeTransfer(contractAddress, _managedAmount);\\n\\n emit TokenLockCreated(\\n contractAddress,\\n keccak256(initializer),\\n _beneficiary,\\n address(_token),\\n _managedAmount,\\n _startTime,\\n _endTime,\\n _periods,\\n _releaseStartTime,\\n _vestingCliffTime,\\n _revocable\\n );\\n }\\n\\n // -- Funds Management --\\n\\n /**\\n * @notice Gets the GRT token address\\n * @return Token used for transfers and approvals\\n */\\n function token() external view override returns (IERC20) {\\n return _token;\\n }\\n\\n /**\\n * @notice Deposits tokens into the contract\\n * @dev Even if the ERC20 token can be transferred directly to the contract\\n * this function provide a safe interface to do the transfer and avoid mistakes\\n * @param _amount Amount to deposit\\n */\\n function deposit(uint256 _amount) external override {\\n require(_amount > 0, \\\"Amount cannot be zero\\\");\\n _token.safeTransferFrom(msg.sender, address(this), _amount);\\n emit TokensDeposited(msg.sender, _amount);\\n }\\n\\n /**\\n * @notice Withdraws tokens from the contract\\n * @dev Escape hatch in case of mistakes or to recover remaining funds\\n * @param _amount Amount of tokens to withdraw\\n */\\n function withdraw(uint256 _amount) external override onlyOwner {\\n require(_amount > 0, \\\"Amount cannot be zero\\\");\\n _token.safeTransfer(msg.sender, _amount);\\n emit TokensWithdrawn(msg.sender, _amount);\\n }\\n\\n // -- Token Destinations --\\n\\n /**\\n * @notice Adds an address that can be allowed by a token lock to pull funds\\n * @param _dst Destination address\\n */\\n function addTokenDestination(address _dst) external override onlyOwner {\\n require(_dst != address(0), \\\"Destination cannot be zero\\\");\\n require(_tokenDestinations.add(_dst), \\\"Destination already added\\\");\\n emit TokenDestinationAllowed(_dst, true);\\n }\\n\\n /**\\n * @notice Removes an address that can be allowed by a token lock to pull funds\\n * @param _dst Destination address\\n */\\n function removeTokenDestination(address _dst) external override onlyOwner {\\n require(_tokenDestinations.remove(_dst), \\\"Destination already removed\\\");\\n emit TokenDestinationAllowed(_dst, false);\\n }\\n\\n /**\\n * @notice Returns True if the address is authorized to be a destination of tokens\\n * @param _dst Destination address\\n * @return True if authorized\\n */\\n function isTokenDestination(address _dst) external view override returns (bool) {\\n return _tokenDestinations.contains(_dst);\\n }\\n\\n /**\\n * @notice Returns an array of authorized destination addresses\\n * @return Array of addresses authorized to pull funds from a token lock\\n */\\n function getTokenDestinations() external view override returns (address[] memory) {\\n address[] memory dstList = new address[](_tokenDestinations.length());\\n for (uint256 i = 0; i < _tokenDestinations.length(); i++) {\\n dstList[i] = _tokenDestinations.at(i);\\n }\\n return dstList;\\n }\\n\\n // -- Function Call Authorization --\\n\\n /**\\n * @notice Sets an authorized function call to target\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @param _signature Function signature\\n * @param _target Address of the destination contract to call\\n */\\n function setAuthFunctionCall(string calldata _signature, address _target) external override onlyOwner {\\n _setAuthFunctionCall(_signature, _target);\\n }\\n\\n /**\\n * @notice Unsets an authorized function call to target\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @param _signature Function signature\\n */\\n function unsetAuthFunctionCall(string calldata _signature) external override onlyOwner {\\n bytes4 sigHash = _toFunctionSigHash(_signature);\\n authFnCalls[sigHash] = address(0);\\n\\n emit FunctionCallAuth(msg.sender, sigHash, address(0), _signature);\\n }\\n\\n /**\\n * @notice Sets an authorized function call to target in bulk\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @param _signatures Function signatures\\n * @param _targets Address of the destination contract to call\\n */\\n function setAuthFunctionCallMany(\\n string[] calldata _signatures,\\n address[] calldata _targets\\n ) external override onlyOwner {\\n require(_signatures.length == _targets.length, \\\"Array length mismatch\\\");\\n\\n for (uint256 i = 0; i < _signatures.length; i++) {\\n _setAuthFunctionCall(_signatures[i], _targets[i]);\\n }\\n }\\n\\n /**\\n * @notice Sets an authorized function call to target\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @dev Function signatures of Graph Protocol contracts to be used are known ahead of time\\n * @param _signature Function signature\\n * @param _target Address of the destination contract to call\\n */\\n function _setAuthFunctionCall(string calldata _signature, address _target) internal {\\n require(_target != address(this), \\\"Target must be other contract\\\");\\n require(Address.isContract(_target), \\\"Target must be a contract\\\");\\n\\n bytes4 sigHash = _toFunctionSigHash(_signature);\\n authFnCalls[sigHash] = _target;\\n\\n emit FunctionCallAuth(msg.sender, sigHash, _target, _signature);\\n }\\n\\n /**\\n * @notice Gets the target contract to call for a particular function signature\\n * @param _sigHash Function signature hash\\n * @return Address of the target contract where to send the call\\n */\\n function getAuthFunctionCallTarget(bytes4 _sigHash) public view override returns (address) {\\n return authFnCalls[_sigHash];\\n }\\n\\n /**\\n * @notice Returns true if the function call is authorized\\n * @param _sigHash Function signature hash\\n * @return True if authorized\\n */\\n function isAuthFunctionCall(bytes4 _sigHash) external view override returns (bool) {\\n return getAuthFunctionCallTarget(_sigHash) != address(0);\\n }\\n\\n /**\\n * @dev Converts a function signature string to 4-bytes hash\\n * @param _signature Function signature string\\n * @return Function signature hash\\n */\\n function _toFunctionSigHash(string calldata _signature) internal pure returns (bytes4) {\\n return _convertToBytes4(abi.encodeWithSignature(_signature));\\n }\\n\\n /**\\n * @dev Converts function signature bytes to function signature hash (bytes4)\\n * @param _signature Function signature\\n * @return Function signature in bytes4\\n */\\n function _convertToBytes4(bytes memory _signature) internal pure returns (bytes4) {\\n require(_signature.length == 4, \\\"Invalid method signature\\\");\\n bytes4 sigHash;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n sigHash := mload(add(_signature, 32))\\n }\\n return sigHash;\\n }\\n}\\n\",\"keccak256\":\"0x2bb51cc1a18bd88113fd6947067ad2fff33048c8904cb54adfda8e2ab86752f2\",\"license\":\"MIT\"},\"contracts/GraphTokenLockWallet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"@openzeppelin/contracts/math/SafeMath.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nimport \\\"./GraphTokenLock.sol\\\";\\nimport \\\"./IGraphTokenLockManager.sol\\\";\\n\\n/**\\n * @title GraphTokenLockWallet\\n * @notice This contract is built on top of the base GraphTokenLock functionality.\\n * It allows wallet beneficiaries to use the deposited funds to perform specific function calls\\n * on specific contracts.\\n *\\n * The idea is that supporters with locked tokens can participate in the protocol\\n * but disallow any release before the vesting/lock schedule.\\n * The beneficiary can issue authorized function calls to this contract that will\\n * get forwarded to a target contract. A target contract is any of our protocol contracts.\\n * The function calls allowed are queried to the GraphTokenLockManager, this way\\n * the same configuration can be shared for all the created lock wallet contracts.\\n *\\n * NOTE: Contracts used as target must have its function signatures checked to avoid collisions\\n * with any of this contract functions.\\n * Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience\\n * the maximum amount of tokens is authorized.\\n * Function calls do not forward ETH value so DO NOT SEND ETH TO THIS CONTRACT.\\n */\\ncontract GraphTokenLockWallet is GraphTokenLock {\\n using SafeMath for uint256;\\n\\n // -- State --\\n\\n IGraphTokenLockManager public manager;\\n uint256 public usedAmount;\\n\\n // -- Events --\\n\\n event ManagerUpdated(address indexed _oldManager, address indexed _newManager);\\n event TokenDestinationsApproved();\\n event TokenDestinationsRevoked();\\n\\n // Initializer\\n function initialize(\\n address _manager,\\n address _owner,\\n address _beneficiary,\\n address _token,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n Revocability _revocable\\n ) external {\\n _initialize(\\n _owner,\\n _beneficiary,\\n _token,\\n _managedAmount,\\n _startTime,\\n _endTime,\\n _periods,\\n _releaseStartTime,\\n _vestingCliffTime,\\n _revocable\\n );\\n _setManager(_manager);\\n }\\n\\n // -- Admin --\\n\\n /**\\n * @notice Sets a new manager for this contract\\n * @param _newManager Address of the new manager\\n */\\n function setManager(address _newManager) external onlyOwner {\\n _setManager(_newManager);\\n }\\n\\n /**\\n * @dev Sets a new manager for this contract\\n * @param _newManager Address of the new manager\\n */\\n function _setManager(address _newManager) internal {\\n require(_newManager != address(0), \\\"Manager cannot be empty\\\");\\n require(Address.isContract(_newManager), \\\"Manager must be a contract\\\");\\n\\n address oldManager = address(manager);\\n manager = IGraphTokenLockManager(_newManager);\\n\\n emit ManagerUpdated(oldManager, _newManager);\\n }\\n\\n // -- Beneficiary --\\n\\n /**\\n * @notice Approves protocol access of the tokens managed by this contract\\n * @dev Approves all token destinations registered in the manager to pull tokens\\n */\\n function approveProtocol() external onlyBeneficiary {\\n address[] memory dstList = manager.getTokenDestinations();\\n for (uint256 i = 0; i < dstList.length; i++) {\\n // Note this is only safe because we are using the max uint256 value\\n token.approve(dstList[i], type(uint256).max);\\n }\\n emit TokenDestinationsApproved();\\n }\\n\\n /**\\n * @notice Revokes protocol access of the tokens managed by this contract\\n * @dev Revokes approval to all token destinations in the manager to pull tokens\\n */\\n function revokeProtocol() external onlyBeneficiary {\\n address[] memory dstList = manager.getTokenDestinations();\\n for (uint256 i = 0; i < dstList.length; i++) {\\n // Note this is only safe cause we're using 0 as the amount\\n token.approve(dstList[i], 0);\\n }\\n emit TokenDestinationsRevoked();\\n }\\n\\n /**\\n * @notice Gets tokens currently available for release\\n * @dev Considers the schedule, takes into account already released tokens and used amount\\n * @return Amount of tokens ready to be released\\n */\\n function releasableAmount() public view override returns (uint256) {\\n if (revocable == Revocability.Disabled) {\\n return super.releasableAmount();\\n }\\n\\n // -- Revocability enabled logic\\n // This needs to deal with additional considerations for when tokens are used in the protocol\\n\\n // If a release start time is set no tokens are available for release before this date\\n // If not set it follows the default schedule and tokens are available on\\n // the first period passed\\n if (releaseStartTime > 0 && currentTime() < releaseStartTime) {\\n return 0;\\n }\\n\\n // Vesting cliff is activated and it has not passed means nothing is vested yet\\n // so funds cannot be released\\n if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\\n return 0;\\n }\\n\\n // A beneficiary can never have more releasable tokens than the contract balance\\n // We consider the `usedAmount` in the protocol as part of the calculations\\n // the beneficiary should not release funds that are used.\\n uint256 releasable = availableAmount().sub(releasedAmount).sub(usedAmount);\\n return MathUtils.min(currentBalance(), releasable);\\n }\\n\\n /**\\n * @notice Forward authorized contract calls to protocol contracts\\n * @dev Fallback function can be called by the beneficiary only if function call is allowed\\n */\\n // solhint-disable-next-line no-complex-fallback\\n fallback() external payable {\\n // Only beneficiary can forward calls\\n require(msg.sender == beneficiary, \\\"Unauthorized caller\\\");\\n require(msg.value == 0, \\\"ETH transfers not supported\\\");\\n\\n // Function call validation\\n address _target = manager.getAuthFunctionCallTarget(msg.sig);\\n require(_target != address(0), \\\"Unauthorized function\\\");\\n\\n uint256 oldBalance = currentBalance();\\n\\n // Call function with data\\n Address.functionCall(_target, msg.data);\\n\\n // Tracked used tokens in the protocol\\n // We do this check after balances were updated by the forwarded call\\n // Check is only enforced for revocable contracts to save some gas\\n if (revocable == Revocability.Enabled) {\\n // Track contract balance change\\n uint256 newBalance = currentBalance();\\n if (newBalance < oldBalance) {\\n // Outflow\\n uint256 diff = oldBalance.sub(newBalance);\\n usedAmount = usedAmount.add(diff);\\n } else {\\n // Inflow: We can receive profits from the protocol, that could make usedAmount to\\n // underflow. We set it to zero in that case.\\n uint256 diff = newBalance.sub(oldBalance);\\n usedAmount = (diff >= usedAmount) ? 0 : usedAmount.sub(diff);\\n }\\n require(usedAmount <= vestedAmount(), \\\"Cannot use more tokens than vested amount\\\");\\n }\\n }\\n\\n /**\\n * @notice Receive function that always reverts.\\n * @dev Only included to supress warnings, see https://github.com/ethereum/solidity/issues/10159\\n */\\n receive() external payable {\\n revert(\\\"Bad call\\\");\\n }\\n}\\n\",\"keccak256\":\"0x976c2ba4c1503a81ea02bd84539c516e99af611ff767968ee25456b50a6deb7b\",\"license\":\"MIT\"},\"contracts/IGraphTokenLock.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\ninterface IGraphTokenLock {\\n enum Revocability {\\n NotSet,\\n Enabled,\\n Disabled\\n }\\n\\n // -- Balances --\\n\\n function currentBalance() external view returns (uint256);\\n\\n // -- Time & Periods --\\n\\n function currentTime() external view returns (uint256);\\n\\n function duration() external view returns (uint256);\\n\\n function sinceStartTime() external view returns (uint256);\\n\\n function amountPerPeriod() external view returns (uint256);\\n\\n function periodDuration() external view returns (uint256);\\n\\n function currentPeriod() external view returns (uint256);\\n\\n function passedPeriods() external view returns (uint256);\\n\\n // -- Locking & Release Schedule --\\n\\n function availableAmount() external view returns (uint256);\\n\\n function vestedAmount() external view returns (uint256);\\n\\n function releasableAmount() external view returns (uint256);\\n\\n function totalOutstandingAmount() external view returns (uint256);\\n\\n function surplusAmount() external view returns (uint256);\\n\\n // -- Value Transfer --\\n\\n function release() external;\\n\\n function withdrawSurplus(uint256 _amount) external;\\n\\n function revoke() external;\\n}\\n\",\"keccak256\":\"0xceb9d258276fe25ec858191e1deae5778f1b2f612a669fb7b37bab1a064756ab\",\"license\":\"MIT\"},\"contracts/IGraphTokenLockManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nimport \\\"./IGraphTokenLock.sol\\\";\\n\\ninterface IGraphTokenLockManager {\\n // -- Factory --\\n\\n function setMasterCopy(address _masterCopy) external;\\n\\n function createTokenLockWallet(\\n address _owner,\\n address _beneficiary,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n IGraphTokenLock.Revocability _revocable\\n ) external;\\n\\n // -- Funds Management --\\n\\n function token() external returns (IERC20);\\n\\n function deposit(uint256 _amount) external;\\n\\n function withdraw(uint256 _amount) external;\\n\\n // -- Allowed Funds Destinations --\\n\\n function addTokenDestination(address _dst) external;\\n\\n function removeTokenDestination(address _dst) external;\\n\\n function isTokenDestination(address _dst) external view returns (bool);\\n\\n function getTokenDestinations() external view returns (address[] memory);\\n\\n // -- Function Call Authorization --\\n\\n function setAuthFunctionCall(string calldata _signature, address _target) external;\\n\\n function unsetAuthFunctionCall(string calldata _signature) external;\\n\\n function setAuthFunctionCallMany(string[] calldata _signatures, address[] calldata _targets) external;\\n\\n function getAuthFunctionCallTarget(bytes4 _sigHash) external view returns (address);\\n\\n function isAuthFunctionCall(bytes4 _sigHash) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x2d78d41909a6de5b316ac39b100ea087a8f317cf306379888a045523e15c4d9a\",\"license\":\"MIT\"},\"contracts/MathUtils.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nlibrary MathUtils {\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n}\\n\",\"keccak256\":\"0xe2512e1da48bc8363acd15f66229564b02d66706665d7da740604566913c1400\",\"license\":\"MIT\"},\"contracts/MinimalProxyFactory.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nimport { Address } from \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport { Create2 } from \\\"@openzeppelin/contracts/utils/Create2.sol\\\";\\n\\n/**\\n * @title MinimalProxyFactory: a factory contract for creating minimal proxies\\n * @notice Adapted from https://github.com/OpenZeppelin/openzeppelin-sdk/blob/v2.5.0/packages/lib/contracts/upgradeability/ProxyFactory.sol\\n * Based on https://eips.ethereum.org/EIPS/eip-1167\\n */\\ncontract MinimalProxyFactory {\\n /// @dev Emitted when a new proxy is created\\n event ProxyCreated(address indexed proxy);\\n\\n /**\\n * @notice Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation\\n * @param _salt Bytes32 salt to use for CREATE2\\n * @param _implementation Address of the proxy target implementation\\n * @param _deployer Address of the deployer that creates the contract\\n * @return Address of the counterfactual MinimalProxy\\n */\\n function getDeploymentAddress(\\n bytes32 _salt,\\n address _implementation,\\n address _deployer\\n ) public pure returns (address) {\\n return Create2.computeAddress(_salt, keccak256(_getContractCreationCode(_implementation)), _deployer);\\n }\\n\\n /**\\n * @dev Deploys a MinimalProxy with CREATE2\\n * @param _salt Bytes32 salt to use for CREATE2\\n * @param _implementation Address of the proxy target implementation\\n * @param _data Bytes with the initializer call\\n * @return Address of the deployed MinimalProxy\\n */\\n function _deployProxy2(bytes32 _salt, address _implementation, bytes memory _data) internal returns (address) {\\n address proxyAddress = Create2.deploy(0, _salt, _getContractCreationCode(_implementation));\\n\\n emit ProxyCreated(proxyAddress);\\n\\n // Call function with data\\n if (_data.length > 0) {\\n Address.functionCall(proxyAddress, _data);\\n }\\n\\n return proxyAddress;\\n }\\n\\n /**\\n * @dev Gets the MinimalProxy bytecode\\n * @param _implementation Address of the proxy target implementation\\n * @return MinimalProxy bytecode\\n */\\n function _getContractCreationCode(address _implementation) internal pure returns (bytes memory) {\\n bytes10 creation = 0x3d602d80600a3d3981f3;\\n bytes10 prefix = 0x363d3d373d3d3d363d73;\\n bytes20 targetBytes = bytes20(_implementation);\\n bytes15 suffix = 0x5af43d82803e903d91602b57fd5bf3;\\n return abi.encodePacked(creation, prefix, targetBytes, suffix);\\n }\\n}\\n\",\"keccak256\":\"0x67d67a567bceb363ddb199b1e4ab06e7a99f16e034e03086971a332c09ec5c0e\",\"license\":\"MIT\"},\"contracts/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * The owner account will be passed on initialization of the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\ncontract Ownable {\\n /// @dev Owner of the contract, can be retrieved with the public owner() function\\n address private _owner;\\n /// @dev Since upgradeable contracts might inherit this, we add a storage gap\\n /// to allow adding variables here without breaking the proxy storage layout\\n uint256[50] private __gap;\\n\\n /// @dev Emitted when ownership of the contract is transferred\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n function _initialize(address owner) internal {\\n _owner = owner;\\n emit OwnershipTransferred(address(0), owner);\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(_owner == msg.sender, \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() external virtual onlyOwner {\\n emit OwnershipTransferred(_owner, address(0));\\n _owner = address(0);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) external virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n emit OwnershipTransferred(_owner, newOwner);\\n _owner = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0xe8750687082e8e24b620dbf58c3a08eee591ed7b4d5a3e13cc93554ec647fd09\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60806040523480156200001157600080fd5b5060405162003c8f38038062003c8f83398181016040528101906200003791906200039c565b600062000049620001b460201b60201c565b9050806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a350600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156200015a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200015190620004e7565b60405180910390fd5b81600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550620001ac81620001bc60201b60201c565b505062000596565b600033905090565b620001cc620001b460201b60201c565b73ffffffffffffffffffffffffffffffffffffffff16620001f26200034560201b60201c565b73ffffffffffffffffffffffffffffffffffffffff16146200024b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200024290620004c5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415620002be576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620002b590620004a3565b60405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167f30909084afc859121ffc3a5aef7fe37c540a9a1ef60bd4d8dcdb76376fadf9de60405160405180910390a250565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000815190506200037f8162000562565b92915050565b60008151905062000396816200057c565b92915050565b60008060408385031215620003b057600080fd5b6000620003c08582860162000385565b9250506020620003d3858286016200036e565b9150509250929050565b6000620003ec60198362000509565b91507f4d6173746572436f70792063616e6e6f74206265207a65726f000000000000006000830152602082019050919050565b60006200042e60208362000509565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b60006200047060148362000509565b91507f546f6b656e2063616e6e6f74206265207a65726f0000000000000000000000006000830152602082019050919050565b60006020820190508181036000830152620004be81620003dd565b9050919050565b60006020820190508181036000830152620004e0816200041f565b9050919050565b60006020820190508181036000830152620005028162000461565b9050919050565b600082825260208201905092915050565b6000620005278262000542565b9050919050565b60006200053b826200051a565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6200056d816200051a565b81146200057957600080fd5b50565b62000587816200052e565b81146200059357600080fd5b50565b6136e980620005a66000396000f3fe608060405234801561001057600080fd5b506004361061012c5760003560e01c80638da5cb5b116100ad578063c1ab13db11610071578063c1ab13db14610319578063cf497e6c14610335578063f1d24c4514610351578063f2fde38b14610381578063fc0c546a1461039d5761012c565b80638da5cb5b146102875780639c05fc60146102a5578063a3457466146102c1578063a619486e146102df578063b6b55f25146102fd5761012c565b80635975e00c116100f45780635975e00c146101e557806368d30c2e146102015780636e03b8dc1461021d578063715018a61461024d57806379ee1bdf146102575761012c565b806303990a6c146101315780630602ba2b1461014d5780632e1a7d4d1461017d57806343fb93d914610199578063463013a2146101c9575b600080fd5b61014b6004803603810190610146919061253a565b6103bb565b005b61016760048036038101906101629190612511565b610563565b6040516101749190613029565b60405180910390f35b610197600480360381019061019291906125d7565b6105a4565b005b6101b360048036038101906101ae91906124c2565b610701565b6040516101c09190612e63565b60405180910390f35b6101e360048036038101906101de919061257f565b610726565b005b6101ff60048036038101906101fa9190612335565b6107b2565b005b61021b6004803603810190610216919061235e565b610943565b005b61023760048036038101906102329190612511565b610c8b565b6040516102449190612e63565b60405180910390f35b610255610cbe565b005b610271600480360381019061026c9190612335565b610df8565b60405161027e9190613029565b60405180910390f35b61028f610e15565b60405161029c9190612e63565b60405180910390f35b6102bf60048036038101906102ba9190612424565b610e3e565b005b6102c9610f6b565b6040516102d69190613007565b60405180910390f35b6102e7611043565b6040516102f49190612e63565b60405180910390f35b610317600480360381019061031291906125d7565b611069565b005b610333600480360381019061032e9190612335565b61114c565b005b61034f600480360381019061034a9190612335565b61126d565b005b61036b60048036038101906103669190612511565b6113e0565b6040516103789190612e63565b60405180910390f35b61039b60048036038101906103969190612335565b61145b565b005b6103a5611604565b6040516103b29190613044565b60405180910390f35b6103c361162e565b73ffffffffffffffffffffffffffffffffffffffff166103e1610e15565b73ffffffffffffffffffffffffffffffffffffffff1614610437576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042e90613225565b60405180910390fd5b60006104438383611636565b9050600060016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff16817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163373ffffffffffffffffffffffffffffffffffffffff167f450397a2db0e89eccfe664cc6cdfd274a88bc00d29aaec4d991754a42f19f8c9868660405161055692919061305f565b60405180910390a4505050565b60008073ffffffffffffffffffffffffffffffffffffffff16610585836113e0565b73ffffffffffffffffffffffffffffffffffffffff1614159050919050565b6105ac61162e565b73ffffffffffffffffffffffffffffffffffffffff166105ca610e15565b73ffffffffffffffffffffffffffffffffffffffff1614610620576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161061790613225565b60405180910390fd5b60008111610663576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161065a90613205565b60405180910390fd5b6106b03382600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166116c49092919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b826040516106f69190613305565b60405180910390a250565b600061071d846107108561174a565b80519060200120846117c0565b90509392505050565b61072e61162e565b73ffffffffffffffffffffffffffffffffffffffff1661074c610e15565b73ffffffffffffffffffffffffffffffffffffffff16146107a2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161079990613225565b60405180910390fd5b6107ad838383611804565b505050565b6107ba61162e565b73ffffffffffffffffffffffffffffffffffffffff166107d8610e15565b73ffffffffffffffffffffffffffffffffffffffff161461082e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161082590613225565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561089e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161089590613105565b60405180910390fd5b6108b28160026119e690919063ffffffff16565b6108f1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108e890613265565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f33442b8c13e72dd75a027f08f9bff4eed2dfd26e43cdea857365f5163b359a7960016040516109389190613029565b60405180910390a250565b61094b61162e565b73ffffffffffffffffffffffffffffffffffffffff16610969610e15565b73ffffffffffffffffffffffffffffffffffffffff16146109bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109b690613225565b60405180910390fd5b86600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610a1b9190612e63565b60206040518083038186803b158015610a3357600080fd5b505afa158015610a47573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a6b9190612600565b1015610aac576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aa390613145565b60405180910390fd5b606063bd896dcb60e01b308b8b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168c8c8c8c8c8c8c604051602401610afd9b9a99989796959493929190612e7e565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505090506000610b928280519060200120600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611a16565b9050610be1818a600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166116c49092919063ffffffff16565b8973ffffffffffffffffffffffffffffffffffffffff1682805190602001208273ffffffffffffffffffffffffffffffffffffffff167f3c7ff6acee351ed98200c285a04745858a107e16da2f13c3a81a43073c17d644600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168d8d8d8d8d8d8d604051610c76989796959493929190612f89565b60405180910390a45050505050505050505050565b60016020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610cc661162e565b73ffffffffffffffffffffffffffffffffffffffff16610ce4610e15565b73ffffffffffffffffffffffffffffffffffffffff1614610d3a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d3190613225565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000610e0e826002611a9290919063ffffffff16565b9050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610e4661162e565b73ffffffffffffffffffffffffffffffffffffffff16610e64610e15565b73ffffffffffffffffffffffffffffffffffffffff1614610eba576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eb190613225565b60405180910390fd5b818190508484905014610f02576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ef9906130e5565b60405180910390fd5b60005b84849050811015610f6457610f57858583818110610f1f57fe5b9050602002810190610f319190613320565b858585818110610f3d57fe5b9050602002016020810190610f529190612335565b611804565b8080600101915050610f05565b5050505050565b606080610f786002611ac2565b67ffffffffffffffff81118015610f8e57600080fd5b50604051908082528060200260200182016040528015610fbd5781602001602082028036833780820191505090505b50905060005b610fcd6002611ac2565b81101561103b57610fe8816002611ad790919063ffffffff16565b828281518110610ff457fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508080600101915050610fc3565b508091505090565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600081116110ac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110a390613205565b60405180910390fd5b6110fb333083600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611af1909392919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f59062170a285eb80e8c6b8ced60428442a51910635005233fc4ce084a475845e826040516111419190613305565b60405180910390a250565b61115461162e565b73ffffffffffffffffffffffffffffffffffffffff16611172610e15565b73ffffffffffffffffffffffffffffffffffffffff16146111c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111bf90613225565b60405180910390fd5b6111dc816002611b7a90919063ffffffff16565b61121b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161121290613185565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f33442b8c13e72dd75a027f08f9bff4eed2dfd26e43cdea857365f5163b359a7960006040516112629190613029565b60405180910390a250565b61127561162e565b73ffffffffffffffffffffffffffffffffffffffff16611293610e15565b73ffffffffffffffffffffffffffffffffffffffff16146112e9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112e090613225565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611359576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611350906131a5565b60405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167f30909084afc859121ffc3a5aef7fe37c540a9a1ef60bd4d8dcdb76376fadf9de60405160405180910390a250565b600060016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b61146361162e565b73ffffffffffffffffffffffffffffffffffffffff16611481610e15565b73ffffffffffffffffffffffffffffffffffffffff16146114d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114ce90613225565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611547576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161153e90613125565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600033905090565b60006116bc83836040516024016040516020818303038152906040529190604051611662929190612e4a565b60405180910390207bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611baa565b905092915050565b6117458363a9059cbb60e01b84846040516024016116e3929190612f60565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611c02565b505050565b60606000693d602d80600a3d3981f360b01b9050600069363d3d373d3d3d363d7360b01b905060008460601b905060006e5af43d82803e903d91602b57fd5bf360881b9050838383836040516020016117a69493929190612d97565b604051602081830303815290604052945050505050919050565b60008060ff60f81b8386866040516020016117de9493929190612de5565b6040516020818303038152906040528051906020012090508060001c9150509392505050565b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611873576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161186a906131c5565b60405180910390fd5b61187c81611cc9565b6118bb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118b2906132e5565b60405180910390fd5b60006118c78484611636565b90508160016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff16817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163373ffffffffffffffffffffffffffffffffffffffff167f450397a2db0e89eccfe664cc6cdfd274a88bc00d29aaec4d991754a42f19f8c987876040516119d892919061305f565b60405180910390a450505050565b6000611a0e836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611cdc565b905092915050565b600080611a2d600086611a288761174a565b611d4c565b90508073ffffffffffffffffffffffffffffffffffffffff167efffc2da0b561cae30d9826d37709e9421c4725faebc226cbbb7ef5fc5e734960405160405180910390a2600083511115611a8757611a858184611e5d565b505b809150509392505050565b6000611aba836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611ea7565b905092915050565b6000611ad082600001611eca565b9050919050565b6000611ae68360000183611edb565b60001c905092915050565b611b74846323b872dd60e01b858585604051602401611b1293929190612f29565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611c02565b50505050565b6000611ba2836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611f48565b905092915050565b60006004825114611bf0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611be790613245565b60405180910390fd5b60006020830151905080915050919050565b6060611c64826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166120309092919063ffffffff16565b9050600081511115611cc45780806020019051810190611c849190612499565b611cc3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cba906132a5565b60405180910390fd5b5b505050565b600080823b905060008111915050919050565b6000611ce88383611ea7565b611d41578260000182908060018154018082558091505060019003906000526020600020016000909190919091505582600001805490508360010160008481526020019081526020016000208190555060019050611d46565b600090505b92915050565b60008084471015611d92576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d89906132c5565b60405180910390fd5b600083511415611dd7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dce906130c5565b60405180910390fd5b8383516020850187f59050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611e52576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e49906131e5565b60405180910390fd5b809150509392505050565b6060611e9f83836040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c65640000815250612030565b905092915050565b600080836001016000848152602001908152602001600020541415905092915050565b600081600001805490509050919050565b600081836000018054905011611f26576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f1d906130a5565b60405180910390fd5b826000018281548110611f3557fe5b9060005260206000200154905092915050565b600080836001016000848152602001908152602001600020549050600081146120245760006001820390506000600186600001805490500390506000866000018281548110611f9357fe5b9060005260206000200154905080876000018481548110611fb057fe5b9060005260206000200181905550600183018760010160008381526020019081526020016000208190555086600001805480611fe857fe5b6001900381819060005260206000200160009055905586600101600087815260200190815260200160002060009055600194505050505061202a565b60009150505b92915050565b606061203f8484600085612048565b90509392505050565b60608247101561208d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161208490613165565b60405180910390fd5b61209685611cc9565b6120d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120cc90613285565b60405180910390fd5b600060608673ffffffffffffffffffffffffffffffffffffffff1685876040516120ff9190612e33565b60006040518083038185875af1925050503d806000811461213c576040519150601f19603f3d011682016040523d82523d6000602084013e612141565b606091505b509150915061215182828661215d565b92505050949350505050565b6060831561216d578290506121bd565b6000835111156121805782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121b49190613083565b60405180910390fd5b9392505050565b6000813590506121d381613630565b92915050565b60008083601f8401126121eb57600080fd5b8235905067ffffffffffffffff81111561220457600080fd5b60208301915083602082028301111561221c57600080fd5b9250929050565b60008083601f84011261223557600080fd5b8235905067ffffffffffffffff81111561224e57600080fd5b60208301915083602082028301111561226657600080fd5b9250929050565b60008151905061227c81613647565b92915050565b6000813590506122918161365e565b92915050565b6000813590506122a681613675565b92915050565b6000813590506122bb8161368c565b92915050565b60008083601f8401126122d357600080fd5b8235905067ffffffffffffffff8111156122ec57600080fd5b60208301915083600182028301111561230457600080fd5b9250929050565b60008135905061231a8161369c565b92915050565b60008151905061232f8161369c565b92915050565b60006020828403121561234757600080fd5b6000612355848285016121c4565b91505092915050565b60008060008060008060008060006101208a8c03121561237d57600080fd5b600061238b8c828d016121c4565b995050602061239c8c828d016121c4565b98505060406123ad8c828d0161230b565b97505060606123be8c828d0161230b565b96505060806123cf8c828d0161230b565b95505060a06123e08c828d0161230b565b94505060c06123f18c828d0161230b565b93505060e06124028c828d0161230b565b9250506101006124148c828d016122ac565b9150509295985092959850929598565b6000806000806040858703121561243a57600080fd5b600085013567ffffffffffffffff81111561245457600080fd5b61246087828801612223565b9450945050602085013567ffffffffffffffff81111561247f57600080fd5b61248b878288016121d9565b925092505092959194509250565b6000602082840312156124ab57600080fd5b60006124b98482850161226d565b91505092915050565b6000806000606084860312156124d757600080fd5b60006124e586828701612282565b93505060206124f6868287016121c4565b9250506040612507868287016121c4565b9150509250925092565b60006020828403121561252357600080fd5b600061253184828501612297565b91505092915050565b6000806020838503121561254d57600080fd5b600083013567ffffffffffffffff81111561256757600080fd5b612573858286016122c1565b92509250509250929050565b60008060006040848603121561259457600080fd5b600084013567ffffffffffffffff8111156125ae57600080fd5b6125ba868287016122c1565b935093505060206125cd868287016121c4565b9150509250925092565b6000602082840312156125e957600080fd5b60006125f78482850161230b565b91505092915050565b60006020828403121561261257600080fd5b600061262084828501612320565b91505092915050565b60006126358383612641565b60208301905092915050565b61264a816133ed565b82525050565b612659816133ed565b82525050565b61267061266b826133ed565b6135a6565b82525050565b600061268182613387565b61268b81856133b5565b935061269683613377565b8060005b838110156126c75781516126ae8882612629565b97506126b9836133a8565b92505060018101905061269a565b5085935050505092915050565b6126dd816133ff565b82525050565b6126f46126ef82613437565b6135c2565b82525050565b61270b61270682613463565b6135cc565b82525050565b61272261271d8261340b565b6135b8565b82525050565b6127396127348261348f565b6135d6565b82525050565b61275061274b826134bb565b6135e0565b82525050565b600061276182613392565b61276b81856133c6565b935061277b818560208601613573565b80840191505092915050565b6127908161352e565b82525050565b61279f81613552565b82525050565b60006127b183856133d1565b93506127be838584613564565b6127c7836135fe565b840190509392505050565b60006127de83856133e2565b93506127eb838584613564565b82840190509392505050565b60006128028261339d565b61280c81856133d1565b935061281c818560208601613573565b612825816135fe565b840191505092915050565b600061283d6022836133d1565b91507f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e60008301527f64730000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006128a36020836133d1565b91507f437265617465323a2062797465636f6465206c656e677468206973207a65726f6000830152602082019050919050565b60006128e36015836133d1565b91507f4172726179206c656e677468206d69736d6174636800000000000000000000006000830152602082019050919050565b6000612923601a836133d1565b91507f44657374696e6174696f6e2063616e6e6f74206265207a65726f0000000000006000830152602082019050919050565b60006129636026836133d1565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006129c96020836133d1565b91507f4e6f7420656e6f75676820746f6b656e7320746f20637265617465206c6f636b6000830152602082019050919050565b6000612a096026836133d1565b91507f416464726573733a20696e73756666696369656e742062616c616e636520666f60008301527f722063616c6c00000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000612a6f601b836133d1565b91507f44657374696e6174696f6e20616c72656164792072656d6f76656400000000006000830152602082019050919050565b6000612aaf6019836133d1565b91507f4d6173746572436f70792063616e6e6f74206265207a65726f000000000000006000830152602082019050919050565b6000612aef601d836133d1565b91507f546172676574206d757374206265206f7468657220636f6e74726163740000006000830152602082019050919050565b6000612b2f6019836133d1565b91507f437265617465323a204661696c6564206f6e206465706c6f79000000000000006000830152602082019050919050565b6000612b6f6015836133d1565b91507f416d6f756e742063616e6e6f74206265207a65726f00000000000000000000006000830152602082019050919050565b6000612baf6020836133d1565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b6000612bef6018836133d1565b91507f496e76616c6964206d6574686f64207369676e617475726500000000000000006000830152602082019050919050565b6000612c2f6019836133d1565b91507f44657374696e6174696f6e20616c7265616479206164646564000000000000006000830152602082019050919050565b6000612c6f601d836133d1565b91507f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006000830152602082019050919050565b6000612caf602a836133d1565b91507f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008301527f6f742073756363656564000000000000000000000000000000000000000000006020830152604082019050919050565b6000612d15601d836133d1565b91507f437265617465323a20696e73756666696369656e742062616c616e63650000006000830152602082019050919050565b6000612d556019836133d1565b91507f546172676574206d757374206265206120636f6e7472616374000000000000006000830152602082019050919050565b612d9181613524565b82525050565b6000612da382876126e3565b600a82019150612db382866126e3565b600a82019150612dc38285612728565b601482019150612dd382846126fa565b600f8201915081905095945050505050565b6000612df18287612711565b600182019150612e01828661265f565b601482019150612e11828561273f565b602082019150612e21828461273f565b60208201915081905095945050505050565b6000612e3f8284612756565b915081905092915050565b6000612e578284866127d2565b91508190509392505050565b6000602082019050612e786000830184612650565b92915050565b600061016082019050612e94600083018e612650565b612ea1602083018d612650565b612eae604083018c612650565b612ebb606083018b612650565b612ec8608083018a612d88565b612ed560a0830189612d88565b612ee260c0830188612d88565b612eef60e0830187612d88565b612efd610100830186612d88565b612f0b610120830185612d88565b612f19610140830184612796565b9c9b505050505050505050505050565b6000606082019050612f3e6000830186612650565b612f4b6020830185612650565b612f586040830184612d88565b949350505050565b6000604082019050612f756000830185612650565b612f826020830184612d88565b9392505050565b600061010082019050612f9f600083018b612650565b612fac602083018a612d88565b612fb96040830189612d88565b612fc66060830188612d88565b612fd36080830187612d88565b612fe060a0830186612d88565b612fed60c0830185612d88565b612ffa60e0830184612796565b9998505050505050505050565b600060208201905081810360008301526130218184612676565b905092915050565b600060208201905061303e60008301846126d4565b92915050565b60006020820190506130596000830184612787565b92915050565b6000602082019050818103600083015261307a8184866127a5565b90509392505050565b6000602082019050818103600083015261309d81846127f7565b905092915050565b600060208201905081810360008301526130be81612830565b9050919050565b600060208201905081810360008301526130de81612896565b9050919050565b600060208201905081810360008301526130fe816128d6565b9050919050565b6000602082019050818103600083015261311e81612916565b9050919050565b6000602082019050818103600083015261313e81612956565b9050919050565b6000602082019050818103600083015261315e816129bc565b9050919050565b6000602082019050818103600083015261317e816129fc565b9050919050565b6000602082019050818103600083015261319e81612a62565b9050919050565b600060208201905081810360008301526131be81612aa2565b9050919050565b600060208201905081810360008301526131de81612ae2565b9050919050565b600060208201905081810360008301526131fe81612b22565b9050919050565b6000602082019050818103600083015261321e81612b62565b9050919050565b6000602082019050818103600083015261323e81612ba2565b9050919050565b6000602082019050818103600083015261325e81612be2565b9050919050565b6000602082019050818103600083015261327e81612c22565b9050919050565b6000602082019050818103600083015261329e81612c62565b9050919050565b600060208201905081810360008301526132be81612ca2565b9050919050565b600060208201905081810360008301526132de81612d08565b9050919050565b600060208201905081810360008301526132fe81612d48565b9050919050565b600060208201905061331a6000830184612d88565b92915050565b6000808335600160200384360303811261333957600080fd5b80840192508235915067ffffffffffffffff82111561335757600080fd5b60208301925060018202360383131561336f57600080fd5b509250929050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b60006133f882613504565b9050919050565b60008115159050919050565b60007fff0000000000000000000000000000000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffff0000000000000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffffffffffffff000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffffffffffffffffffffffff00000000000000000000000082169050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b60008190506134ff8261361c565b919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600061353982613540565b9050919050565b600061354b82613504565b9050919050565b600061355d826134f1565b9050919050565b82818337600083830152505050565b60005b83811015613591578082015181840152602081019050613576565b838111156135a0576000848401525b50505050565b60006135b1826135ea565b9050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b60006135f58261360f565b9050919050565bfe5b6000601f19601f8301169050919050565b60008160601b9050919050565b6003811061362d5761362c6135fc565b5b50565b613639816133ed565b811461364457600080fd5b50565b613650816133ff565b811461365b57600080fd5b50565b613667816134bb565b811461367257600080fd5b50565b61367e816134c5565b811461368957600080fd5b50565b6003811061369957600080fd5b50565b6136a581613524565b81146136b057600080fd5b5056fea2646970667358221220d5c9f5b6d4e12c49170d8830f9459ebc2386434f550d65bae2bbc0fcfbacfb6264736f6c63430007030033", + "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061012c5760003560e01c80638da5cb5b116100ad578063c1ab13db11610071578063c1ab13db14610319578063cf497e6c14610335578063f1d24c4514610351578063f2fde38b14610381578063fc0c546a1461039d5761012c565b80638da5cb5b146102875780639c05fc60146102a5578063a3457466146102c1578063a619486e146102df578063b6b55f25146102fd5761012c565b80635975e00c116100f45780635975e00c146101e557806368d30c2e146102015780636e03b8dc1461021d578063715018a61461024d57806379ee1bdf146102575761012c565b806303990a6c146101315780630602ba2b1461014d5780632e1a7d4d1461017d57806343fb93d914610199578063463013a2146101c9575b600080fd5b61014b6004803603810190610146919061253a565b6103bb565b005b61016760048036038101906101629190612511565b610563565b6040516101749190613029565b60405180910390f35b610197600480360381019061019291906125d7565b6105a4565b005b6101b360048036038101906101ae91906124c2565b610701565b6040516101c09190612e63565b60405180910390f35b6101e360048036038101906101de919061257f565b610726565b005b6101ff60048036038101906101fa9190612335565b6107b2565b005b61021b6004803603810190610216919061235e565b610943565b005b61023760048036038101906102329190612511565b610c8b565b6040516102449190612e63565b60405180910390f35b610255610cbe565b005b610271600480360381019061026c9190612335565b610df8565b60405161027e9190613029565b60405180910390f35b61028f610e15565b60405161029c9190612e63565b60405180910390f35b6102bf60048036038101906102ba9190612424565b610e3e565b005b6102c9610f6b565b6040516102d69190613007565b60405180910390f35b6102e7611043565b6040516102f49190612e63565b60405180910390f35b610317600480360381019061031291906125d7565b611069565b005b610333600480360381019061032e9190612335565b61114c565b005b61034f600480360381019061034a9190612335565b61126d565b005b61036b60048036038101906103669190612511565b6113e0565b6040516103789190612e63565b60405180910390f35b61039b60048036038101906103969190612335565b61145b565b005b6103a5611604565b6040516103b29190613044565b60405180910390f35b6103c361162e565b73ffffffffffffffffffffffffffffffffffffffff166103e1610e15565b73ffffffffffffffffffffffffffffffffffffffff1614610437576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042e90613225565b60405180910390fd5b60006104438383611636565b9050600060016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff16817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163373ffffffffffffffffffffffffffffffffffffffff167f450397a2db0e89eccfe664cc6cdfd274a88bc00d29aaec4d991754a42f19f8c9868660405161055692919061305f565b60405180910390a4505050565b60008073ffffffffffffffffffffffffffffffffffffffff16610585836113e0565b73ffffffffffffffffffffffffffffffffffffffff1614159050919050565b6105ac61162e565b73ffffffffffffffffffffffffffffffffffffffff166105ca610e15565b73ffffffffffffffffffffffffffffffffffffffff1614610620576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161061790613225565b60405180910390fd5b60008111610663576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161065a90613205565b60405180910390fd5b6106b03382600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166116c49092919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b826040516106f69190613305565b60405180910390a250565b600061071d846107108561174a565b80519060200120846117c0565b90509392505050565b61072e61162e565b73ffffffffffffffffffffffffffffffffffffffff1661074c610e15565b73ffffffffffffffffffffffffffffffffffffffff16146107a2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161079990613225565b60405180910390fd5b6107ad838383611804565b505050565b6107ba61162e565b73ffffffffffffffffffffffffffffffffffffffff166107d8610e15565b73ffffffffffffffffffffffffffffffffffffffff161461082e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161082590613225565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561089e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161089590613105565b60405180910390fd5b6108b28160026119e690919063ffffffff16565b6108f1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108e890613265565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f33442b8c13e72dd75a027f08f9bff4eed2dfd26e43cdea857365f5163b359a7960016040516109389190613029565b60405180910390a250565b61094b61162e565b73ffffffffffffffffffffffffffffffffffffffff16610969610e15565b73ffffffffffffffffffffffffffffffffffffffff16146109bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109b690613225565b60405180910390fd5b86600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610a1b9190612e63565b60206040518083038186803b158015610a3357600080fd5b505afa158015610a47573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a6b9190612600565b1015610aac576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aa390613145565b60405180910390fd5b606063bd896dcb60e01b308b8b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168c8c8c8c8c8c8c604051602401610afd9b9a99989796959493929190612e7e565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505090506000610b928280519060200120600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611a16565b9050610be1818a600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166116c49092919063ffffffff16565b8973ffffffffffffffffffffffffffffffffffffffff1682805190602001208273ffffffffffffffffffffffffffffffffffffffff167f3c7ff6acee351ed98200c285a04745858a107e16da2f13c3a81a43073c17d644600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168d8d8d8d8d8d8d604051610c76989796959493929190612f89565b60405180910390a45050505050505050505050565b60016020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610cc661162e565b73ffffffffffffffffffffffffffffffffffffffff16610ce4610e15565b73ffffffffffffffffffffffffffffffffffffffff1614610d3a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d3190613225565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000610e0e826002611a9290919063ffffffff16565b9050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610e4661162e565b73ffffffffffffffffffffffffffffffffffffffff16610e64610e15565b73ffffffffffffffffffffffffffffffffffffffff1614610eba576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eb190613225565b60405180910390fd5b818190508484905014610f02576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ef9906130e5565b60405180910390fd5b60005b84849050811015610f6457610f57858583818110610f1f57fe5b9050602002810190610f319190613320565b858585818110610f3d57fe5b9050602002016020810190610f529190612335565b611804565b8080600101915050610f05565b5050505050565b606080610f786002611ac2565b67ffffffffffffffff81118015610f8e57600080fd5b50604051908082528060200260200182016040528015610fbd5781602001602082028036833780820191505090505b50905060005b610fcd6002611ac2565b81101561103b57610fe8816002611ad790919063ffffffff16565b828281518110610ff457fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508080600101915050610fc3565b508091505090565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600081116110ac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110a390613205565b60405180910390fd5b6110fb333083600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611af1909392919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f59062170a285eb80e8c6b8ced60428442a51910635005233fc4ce084a475845e826040516111419190613305565b60405180910390a250565b61115461162e565b73ffffffffffffffffffffffffffffffffffffffff16611172610e15565b73ffffffffffffffffffffffffffffffffffffffff16146111c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111bf90613225565b60405180910390fd5b6111dc816002611b7a90919063ffffffff16565b61121b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161121290613185565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f33442b8c13e72dd75a027f08f9bff4eed2dfd26e43cdea857365f5163b359a7960006040516112629190613029565b60405180910390a250565b61127561162e565b73ffffffffffffffffffffffffffffffffffffffff16611293610e15565b73ffffffffffffffffffffffffffffffffffffffff16146112e9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112e090613225565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611359576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611350906131a5565b60405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167f30909084afc859121ffc3a5aef7fe37c540a9a1ef60bd4d8dcdb76376fadf9de60405160405180910390a250565b600060016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b61146361162e565b73ffffffffffffffffffffffffffffffffffffffff16611481610e15565b73ffffffffffffffffffffffffffffffffffffffff16146114d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114ce90613225565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611547576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161153e90613125565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600033905090565b60006116bc83836040516024016040516020818303038152906040529190604051611662929190612e4a565b60405180910390207bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611baa565b905092915050565b6117458363a9059cbb60e01b84846040516024016116e3929190612f60565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611c02565b505050565b60606000693d602d80600a3d3981f360b01b9050600069363d3d373d3d3d363d7360b01b905060008460601b905060006e5af43d82803e903d91602b57fd5bf360881b9050838383836040516020016117a69493929190612d97565b604051602081830303815290604052945050505050919050565b60008060ff60f81b8386866040516020016117de9493929190612de5565b6040516020818303038152906040528051906020012090508060001c9150509392505050565b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611873576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161186a906131c5565b60405180910390fd5b61187c81611cc9565b6118bb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118b2906132e5565b60405180910390fd5b60006118c78484611636565b90508160016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff16817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163373ffffffffffffffffffffffffffffffffffffffff167f450397a2db0e89eccfe664cc6cdfd274a88bc00d29aaec4d991754a42f19f8c987876040516119d892919061305f565b60405180910390a450505050565b6000611a0e836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611cdc565b905092915050565b600080611a2d600086611a288761174a565b611d4c565b90508073ffffffffffffffffffffffffffffffffffffffff167efffc2da0b561cae30d9826d37709e9421c4725faebc226cbbb7ef5fc5e734960405160405180910390a2600083511115611a8757611a858184611e5d565b505b809150509392505050565b6000611aba836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611ea7565b905092915050565b6000611ad082600001611eca565b9050919050565b6000611ae68360000183611edb565b60001c905092915050565b611b74846323b872dd60e01b858585604051602401611b1293929190612f29565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611c02565b50505050565b6000611ba2836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611f48565b905092915050565b60006004825114611bf0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611be790613245565b60405180910390fd5b60006020830151905080915050919050565b6060611c64826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166120309092919063ffffffff16565b9050600081511115611cc45780806020019051810190611c849190612499565b611cc3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cba906132a5565b60405180910390fd5b5b505050565b600080823b905060008111915050919050565b6000611ce88383611ea7565b611d41578260000182908060018154018082558091505060019003906000526020600020016000909190919091505582600001805490508360010160008481526020019081526020016000208190555060019050611d46565b600090505b92915050565b60008084471015611d92576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d89906132c5565b60405180910390fd5b600083511415611dd7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dce906130c5565b60405180910390fd5b8383516020850187f59050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611e52576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e49906131e5565b60405180910390fd5b809150509392505050565b6060611e9f83836040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c65640000815250612030565b905092915050565b600080836001016000848152602001908152602001600020541415905092915050565b600081600001805490509050919050565b600081836000018054905011611f26576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f1d906130a5565b60405180910390fd5b826000018281548110611f3557fe5b9060005260206000200154905092915050565b600080836001016000848152602001908152602001600020549050600081146120245760006001820390506000600186600001805490500390506000866000018281548110611f9357fe5b9060005260206000200154905080876000018481548110611fb057fe5b9060005260206000200181905550600183018760010160008381526020019081526020016000208190555086600001805480611fe857fe5b6001900381819060005260206000200160009055905586600101600087815260200190815260200160002060009055600194505050505061202a565b60009150505b92915050565b606061203f8484600085612048565b90509392505050565b60608247101561208d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161208490613165565b60405180910390fd5b61209685611cc9565b6120d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120cc90613285565b60405180910390fd5b600060608673ffffffffffffffffffffffffffffffffffffffff1685876040516120ff9190612e33565b60006040518083038185875af1925050503d806000811461213c576040519150601f19603f3d011682016040523d82523d6000602084013e612141565b606091505b509150915061215182828661215d565b92505050949350505050565b6060831561216d578290506121bd565b6000835111156121805782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121b49190613083565b60405180910390fd5b9392505050565b6000813590506121d381613630565b92915050565b60008083601f8401126121eb57600080fd5b8235905067ffffffffffffffff81111561220457600080fd5b60208301915083602082028301111561221c57600080fd5b9250929050565b60008083601f84011261223557600080fd5b8235905067ffffffffffffffff81111561224e57600080fd5b60208301915083602082028301111561226657600080fd5b9250929050565b60008151905061227c81613647565b92915050565b6000813590506122918161365e565b92915050565b6000813590506122a681613675565b92915050565b6000813590506122bb8161368c565b92915050565b60008083601f8401126122d357600080fd5b8235905067ffffffffffffffff8111156122ec57600080fd5b60208301915083600182028301111561230457600080fd5b9250929050565b60008135905061231a8161369c565b92915050565b60008151905061232f8161369c565b92915050565b60006020828403121561234757600080fd5b6000612355848285016121c4565b91505092915050565b60008060008060008060008060006101208a8c03121561237d57600080fd5b600061238b8c828d016121c4565b995050602061239c8c828d016121c4565b98505060406123ad8c828d0161230b565b97505060606123be8c828d0161230b565b96505060806123cf8c828d0161230b565b95505060a06123e08c828d0161230b565b94505060c06123f18c828d0161230b565b93505060e06124028c828d0161230b565b9250506101006124148c828d016122ac565b9150509295985092959850929598565b6000806000806040858703121561243a57600080fd5b600085013567ffffffffffffffff81111561245457600080fd5b61246087828801612223565b9450945050602085013567ffffffffffffffff81111561247f57600080fd5b61248b878288016121d9565b925092505092959194509250565b6000602082840312156124ab57600080fd5b60006124b98482850161226d565b91505092915050565b6000806000606084860312156124d757600080fd5b60006124e586828701612282565b93505060206124f6868287016121c4565b9250506040612507868287016121c4565b9150509250925092565b60006020828403121561252357600080fd5b600061253184828501612297565b91505092915050565b6000806020838503121561254d57600080fd5b600083013567ffffffffffffffff81111561256757600080fd5b612573858286016122c1565b92509250509250929050565b60008060006040848603121561259457600080fd5b600084013567ffffffffffffffff8111156125ae57600080fd5b6125ba868287016122c1565b935093505060206125cd868287016121c4565b9150509250925092565b6000602082840312156125e957600080fd5b60006125f78482850161230b565b91505092915050565b60006020828403121561261257600080fd5b600061262084828501612320565b91505092915050565b60006126358383612641565b60208301905092915050565b61264a816133ed565b82525050565b612659816133ed565b82525050565b61267061266b826133ed565b6135a6565b82525050565b600061268182613387565b61268b81856133b5565b935061269683613377565b8060005b838110156126c75781516126ae8882612629565b97506126b9836133a8565b92505060018101905061269a565b5085935050505092915050565b6126dd816133ff565b82525050565b6126f46126ef82613437565b6135c2565b82525050565b61270b61270682613463565b6135cc565b82525050565b61272261271d8261340b565b6135b8565b82525050565b6127396127348261348f565b6135d6565b82525050565b61275061274b826134bb565b6135e0565b82525050565b600061276182613392565b61276b81856133c6565b935061277b818560208601613573565b80840191505092915050565b6127908161352e565b82525050565b61279f81613552565b82525050565b60006127b183856133d1565b93506127be838584613564565b6127c7836135fe565b840190509392505050565b60006127de83856133e2565b93506127eb838584613564565b82840190509392505050565b60006128028261339d565b61280c81856133d1565b935061281c818560208601613573565b612825816135fe565b840191505092915050565b600061283d6022836133d1565b91507f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e60008301527f64730000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006128a36020836133d1565b91507f437265617465323a2062797465636f6465206c656e677468206973207a65726f6000830152602082019050919050565b60006128e36015836133d1565b91507f4172726179206c656e677468206d69736d6174636800000000000000000000006000830152602082019050919050565b6000612923601a836133d1565b91507f44657374696e6174696f6e2063616e6e6f74206265207a65726f0000000000006000830152602082019050919050565b60006129636026836133d1565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006129c96020836133d1565b91507f4e6f7420656e6f75676820746f6b656e7320746f20637265617465206c6f636b6000830152602082019050919050565b6000612a096026836133d1565b91507f416464726573733a20696e73756666696369656e742062616c616e636520666f60008301527f722063616c6c00000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000612a6f601b836133d1565b91507f44657374696e6174696f6e20616c72656164792072656d6f76656400000000006000830152602082019050919050565b6000612aaf6019836133d1565b91507f4d6173746572436f70792063616e6e6f74206265207a65726f000000000000006000830152602082019050919050565b6000612aef601d836133d1565b91507f546172676574206d757374206265206f7468657220636f6e74726163740000006000830152602082019050919050565b6000612b2f6019836133d1565b91507f437265617465323a204661696c6564206f6e206465706c6f79000000000000006000830152602082019050919050565b6000612b6f6015836133d1565b91507f416d6f756e742063616e6e6f74206265207a65726f00000000000000000000006000830152602082019050919050565b6000612baf6020836133d1565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b6000612bef6018836133d1565b91507f496e76616c6964206d6574686f64207369676e617475726500000000000000006000830152602082019050919050565b6000612c2f6019836133d1565b91507f44657374696e6174696f6e20616c7265616479206164646564000000000000006000830152602082019050919050565b6000612c6f601d836133d1565b91507f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006000830152602082019050919050565b6000612caf602a836133d1565b91507f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008301527f6f742073756363656564000000000000000000000000000000000000000000006020830152604082019050919050565b6000612d15601d836133d1565b91507f437265617465323a20696e73756666696369656e742062616c616e63650000006000830152602082019050919050565b6000612d556019836133d1565b91507f546172676574206d757374206265206120636f6e7472616374000000000000006000830152602082019050919050565b612d9181613524565b82525050565b6000612da382876126e3565b600a82019150612db382866126e3565b600a82019150612dc38285612728565b601482019150612dd382846126fa565b600f8201915081905095945050505050565b6000612df18287612711565b600182019150612e01828661265f565b601482019150612e11828561273f565b602082019150612e21828461273f565b60208201915081905095945050505050565b6000612e3f8284612756565b915081905092915050565b6000612e578284866127d2565b91508190509392505050565b6000602082019050612e786000830184612650565b92915050565b600061016082019050612e94600083018e612650565b612ea1602083018d612650565b612eae604083018c612650565b612ebb606083018b612650565b612ec8608083018a612d88565b612ed560a0830189612d88565b612ee260c0830188612d88565b612eef60e0830187612d88565b612efd610100830186612d88565b612f0b610120830185612d88565b612f19610140830184612796565b9c9b505050505050505050505050565b6000606082019050612f3e6000830186612650565b612f4b6020830185612650565b612f586040830184612d88565b949350505050565b6000604082019050612f756000830185612650565b612f826020830184612d88565b9392505050565b600061010082019050612f9f600083018b612650565b612fac602083018a612d88565b612fb96040830189612d88565b612fc66060830188612d88565b612fd36080830187612d88565b612fe060a0830186612d88565b612fed60c0830185612d88565b612ffa60e0830184612796565b9998505050505050505050565b600060208201905081810360008301526130218184612676565b905092915050565b600060208201905061303e60008301846126d4565b92915050565b60006020820190506130596000830184612787565b92915050565b6000602082019050818103600083015261307a8184866127a5565b90509392505050565b6000602082019050818103600083015261309d81846127f7565b905092915050565b600060208201905081810360008301526130be81612830565b9050919050565b600060208201905081810360008301526130de81612896565b9050919050565b600060208201905081810360008301526130fe816128d6565b9050919050565b6000602082019050818103600083015261311e81612916565b9050919050565b6000602082019050818103600083015261313e81612956565b9050919050565b6000602082019050818103600083015261315e816129bc565b9050919050565b6000602082019050818103600083015261317e816129fc565b9050919050565b6000602082019050818103600083015261319e81612a62565b9050919050565b600060208201905081810360008301526131be81612aa2565b9050919050565b600060208201905081810360008301526131de81612ae2565b9050919050565b600060208201905081810360008301526131fe81612b22565b9050919050565b6000602082019050818103600083015261321e81612b62565b9050919050565b6000602082019050818103600083015261323e81612ba2565b9050919050565b6000602082019050818103600083015261325e81612be2565b9050919050565b6000602082019050818103600083015261327e81612c22565b9050919050565b6000602082019050818103600083015261329e81612c62565b9050919050565b600060208201905081810360008301526132be81612ca2565b9050919050565b600060208201905081810360008301526132de81612d08565b9050919050565b600060208201905081810360008301526132fe81612d48565b9050919050565b600060208201905061331a6000830184612d88565b92915050565b6000808335600160200384360303811261333957600080fd5b80840192508235915067ffffffffffffffff82111561335757600080fd5b60208301925060018202360383131561336f57600080fd5b509250929050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b60006133f882613504565b9050919050565b60008115159050919050565b60007fff0000000000000000000000000000000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffff0000000000000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffffffffffffff000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffffffffffffffffffffffff00000000000000000000000082169050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b60008190506134ff8261361c565b919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600061353982613540565b9050919050565b600061354b82613504565b9050919050565b600061355d826134f1565b9050919050565b82818337600083830152505050565b60005b83811015613591578082015181840152602081019050613576565b838111156135a0576000848401525b50505050565b60006135b1826135ea565b9050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b60006135f58261360f565b9050919050565bfe5b6000601f19601f8301169050919050565b60008160601b9050919050565b6003811061362d5761362c6135fc565b5b50565b613639816133ed565b811461364457600080fd5b50565b613650816133ff565b811461365b57600080fd5b50565b613667816134bb565b811461367257600080fd5b50565b61367e816134c5565b811461368957600080fd5b50565b6003811061369957600080fd5b50565b6136a581613524565b81146136b057600080fd5b5056fea2646970667358221220d5c9f5b6d4e12c49170d8830f9459ebc2386434f550d65bae2bbc0fcfbacfb6264736f6c63430007030033", + "devdoc": { + "kind": "dev", + "methods": { + "addTokenDestination(address)": { + "params": { + "_dst": "Destination address" + } + }, + "constructor": { + "params": { + "_graphToken": "Token to use for deposits and withdrawals", + "_masterCopy": "Address of the master copy to use to clone proxies" + } + }, + "createTokenLockWallet(address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)": { + "params": { + "_beneficiary": "Address of the beneficiary of locked tokens", + "_endTime": "End time of the release schedule", + "_managedAmount": "Amount of tokens to be managed by the lock contract", + "_owner": "Address of the contract owner", + "_periods": "Number of periods between start time and end time", + "_releaseStartTime": "Override time for when the releases start", + "_revocable": "Whether the contract is revocable", + "_startTime": "Start time of the release schedule" + } + }, + "deposit(uint256)": { + "details": "Even if the ERC20 token can be transferred directly to the contract this function provide a safe interface to do the transfer and avoid mistakes", + "params": { + "_amount": "Amount to deposit" + } + }, + "getAuthFunctionCallTarget(bytes4)": { + "params": { + "_sigHash": "Function signature hash" + }, + "returns": { + "_0": "Address of the target contract where to send the call" + } + }, + "getDeploymentAddress(bytes32,address,address)": { + "params": { + "_deployer": "Address of the deployer that creates the contract", + "_implementation": "Address of the proxy target implementation", + "_salt": "Bytes32 salt to use for CREATE2" + }, + "returns": { + "_0": "Address of the counterfactual MinimalProxy" + } + }, + "getTokenDestinations()": { + "returns": { + "_0": "Array of addresses authorized to pull funds from a token lock" + } + }, + "isAuthFunctionCall(bytes4)": { + "params": { + "_sigHash": "Function signature hash" + }, + "returns": { + "_0": "True if authorized" + } + }, + "isTokenDestination(address)": { + "params": { + "_dst": "Destination address" + }, + "returns": { + "_0": "True if authorized" + } + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "removeTokenDestination(address)": { + "params": { + "_dst": "Destination address" + } + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." + }, + "setAuthFunctionCall(string,address)": { + "details": "Input expected is the function signature as 'transfer(address,uint256)'", + "params": { + "_signature": "Function signature", + "_target": "Address of the destination contract to call" + } + }, + "setAuthFunctionCallMany(string[],address[])": { + "details": "Input expected is the function signature as 'transfer(address,uint256)'", + "params": { + "_signatures": "Function signatures", + "_targets": "Address of the destination contract to call" + } + }, + "setMasterCopy(address)": { + "params": { + "_masterCopy": "Address of contract bytecode to factory clone" + } + }, + "token()": { + "returns": { + "_0": "Token used for transfers and approvals" + } + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + }, + "unsetAuthFunctionCall(string)": { + "details": "Input expected is the function signature as 'transfer(address,uint256)'", + "params": { + "_signature": "Function signature" + } + }, + "withdraw(uint256)": { + "details": "Escape hatch in case of mistakes or to recover remaining funds", + "params": { + "_amount": "Amount of tokens to withdraw" + } + } + }, + "title": "GraphTokenLockManager", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "addTokenDestination(address)": { + "notice": "Adds an address that can be allowed by a token lock to pull funds" + }, + "constructor": { + "notice": "Constructor." + }, + "createTokenLockWallet(address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)": { + "notice": "Creates and fund a new token lock wallet using a minimum proxy" + }, + "deposit(uint256)": { + "notice": "Deposits tokens into the contract" + }, + "getAuthFunctionCallTarget(bytes4)": { + "notice": "Gets the target contract to call for a particular function signature" + }, + "getDeploymentAddress(bytes32,address,address)": { + "notice": "Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation" + }, + "getTokenDestinations()": { + "notice": "Returns an array of authorized destination addresses" + }, + "isAuthFunctionCall(bytes4)": { + "notice": "Returns true if the function call is authorized" + }, + "isTokenDestination(address)": { + "notice": "Returns True if the address is authorized to be a destination of tokens" + }, + "removeTokenDestination(address)": { + "notice": "Removes an address that can be allowed by a token lock to pull funds" + }, + "setAuthFunctionCall(string,address)": { + "notice": "Sets an authorized function call to target" + }, + "setAuthFunctionCallMany(string[],address[])": { + "notice": "Sets an authorized function call to target in bulk" + }, + "setMasterCopy(address)": { + "notice": "Sets the masterCopy bytecode to use to create clones of TokenLock contracts" + }, + "token()": { + "notice": "Gets the GRT token address" + }, + "unsetAuthFunctionCall(string)": { + "notice": "Unsets an authorized function call to target" + }, + "withdraw(uint256)": { + "notice": "Withdraws tokens from the contract" + } + }, + "notice": "This contract manages a list of authorized function calls and targets that can be called by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts. This contract receives funds to make the process of creating TokenLockWallet contracts easier by distributing them the initial tokens to be managed. The owner can setup a list of token destinations that will be used by TokenLock contracts to approve the pulling of funds, this way in can be guaranteed that only protocol contracts will manipulate users funds.", + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 672, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "_owner", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 3988, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "authFnCalls", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_bytes4,t_address)" + }, + { + "astId": 3990, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "_tokenDestinations", + "offset": 0, + "slot": "2", + "type": "t_struct(AddressSet)2629_storage" + }, + { + "astId": 3992, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "masterCopy", + "offset": 0, + "slot": "4", + "type": "t_address" + }, + { + "astId": 3994, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "_token", + "offset": 0, + "slot": "5", + "type": "t_contract(IERC20)1710" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_bytes32)dyn_storage": { + "base": "t_bytes32", + "encoding": "dynamic_array", + "label": "bytes32[]", + "numberOfBytes": "32" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_bytes4": { + "encoding": "inplace", + "label": "bytes4", + "numberOfBytes": "4" + }, + "t_contract(IERC20)1710": { + "encoding": "inplace", + "label": "contract IERC20", + "numberOfBytes": "20" + }, + "t_mapping(t_bytes32,t_uint256)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_mapping(t_bytes4,t_address)": { + "encoding": "mapping", + "key": "t_bytes4", + "label": "mapping(bytes4 => address)", + "numberOfBytes": "32", + "value": "t_address" + }, + "t_struct(AddressSet)2629_storage": { + "encoding": "inplace", + "label": "struct EnumerableSet.AddressSet", + "members": [ + { + "astId": 2628, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "_inner", + "offset": 0, + "slot": "0", + "type": "t_struct(Set)2364_storage" + } + ], + "numberOfBytes": "64" + }, + "t_struct(Set)2364_storage": { + "encoding": "inplace", + "label": "struct EnumerableSet.Set", + "members": [ + { + "astId": 2359, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "_values", + "offset": 0, + "slot": "0", + "type": "t_array(t_bytes32)dyn_storage" + }, + { + "astId": 2363, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "_indexes", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_bytes32,t_uint256)" + } + ], + "numberOfBytes": "64" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} \ No newline at end of file diff --git a/packages/token-distribution/deployments/goerli/GraphTokenLockManager.json b/packages/token-distribution/deployments/goerli/GraphTokenLockManager.json new file mode 100644 index 000000000..4bf8fa8a5 --- /dev/null +++ b/packages/token-distribution/deployments/goerli/GraphTokenLockManager.json @@ -0,0 +1,926 @@ +{ + "address": "0x9a7a54e86560f4304d8862Ea00F45D1090c59ac8", + "abi": [ + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_graphToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_masterCopy", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes4", + "name": "sigHash", + "type": "bytes4" + }, + { + "indexed": true, + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "indexed": false, + "internalType": "string", + "name": "signature", + "type": "string" + } + ], + "name": "FunctionCallAuth", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "masterCopy", + "type": "address" + } + ], + "name": "MasterCopyUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "proxy", + "type": "address" + } + ], + "name": "ProxyCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "dst", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "TokenDestinationAllowed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "contractAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "initHash", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "managedAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "startTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "endTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "periods", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "releaseStartTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "vestingCliffTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "enum IGraphTokenLock.Revocability", + "name": "revocable", + "type": "uint8" + } + ], + "name": "TokenLockCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensDeposited", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensWithdrawn", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_dst", + "type": "address" + } + ], + "name": "addTokenDestination", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "", + "type": "bytes4" + } + ], + "name": "authFnCalls", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_owner", + "type": "address" + }, + { + "internalType": "address", + "name": "_beneficiary", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_managedAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_startTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_endTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_periods", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_releaseStartTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_vestingCliffTime", + "type": "uint256" + }, + { + "internalType": "enum IGraphTokenLock.Revocability", + "name": "_revocable", + "type": "uint8" + } + ], + "name": "createTokenLockWallet", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "deposit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_sigHash", + "type": "bytes4" + } + ], + "name": "getAuthFunctionCallTarget", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_salt", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "_implementation", + "type": "address" + } + ], + "name": "getDeploymentAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getTokenDestinations", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_sigHash", + "type": "bytes4" + } + ], + "name": "isAuthFunctionCall", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_dst", + "type": "address" + } + ], + "name": "isTokenDestination", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "masterCopy", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_dst", + "type": "address" + } + ], + "name": "removeTokenDestination", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_signature", + "type": "string" + }, + { + "internalType": "address", + "name": "_target", + "type": "address" + } + ], + "name": "setAuthFunctionCall", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string[]", + "name": "_signatures", + "type": "string[]" + }, + { + "internalType": "address[]", + "name": "_targets", + "type": "address[]" + } + ], + "name": "setAuthFunctionCallMany", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_masterCopy", + "type": "address" + } + ], + "name": "setMasterCopy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "token", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_signature", + "type": "string" + } + ], + "name": "unsetAuthFunctionCall", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x8c4c0ac0ca63577d5313dd7d57378339f67a70794f321461c4ba76fcfffe08e7", + "receipt": { + "to": null, + "from": "0xEfc519BEd6a43a14f1BBBbA9e796C4931f7A5540", + "contractAddress": "0x9a7a54e86560f4304d8862Ea00F45D1090c59ac8", + "transactionIndex": 5, + "gasUsed": "3166280", + "logsBloom": "0x02000020000000800000000000000000000004000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000400000000000000000020000000000000400000800000000000000000101000000000000400000000010000000000000000000000000000000000000000000080000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000020000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x1ab85c22e1dcdc6aa782224b150da9f6ef4e0a259f51db36ca20689d67c9a6fe", + "transactionHash": "0x8c4c0ac0ca63577d5313dd7d57378339f67a70794f321461c4ba76fcfffe08e7", + "logs": [ + { + "transactionIndex": 5, + "blockNumber": 7370681, + "transactionHash": "0x8c4c0ac0ca63577d5313dd7d57378339f67a70794f321461c4ba76fcfffe08e7", + "address": "0x9a7a54e86560f4304d8862Ea00F45D1090c59ac8", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000efc519bed6a43a14f1bbbba9e796c4931f7a5540" + ], + "data": "0x", + "logIndex": 3, + "blockHash": "0x1ab85c22e1dcdc6aa782224b150da9f6ef4e0a259f51db36ca20689d67c9a6fe" + }, + { + "transactionIndex": 5, + "blockNumber": 7370681, + "transactionHash": "0x8c4c0ac0ca63577d5313dd7d57378339f67a70794f321461c4ba76fcfffe08e7", + "address": "0x9a7a54e86560f4304d8862Ea00F45D1090c59ac8", + "topics": [ + "0x30909084afc859121ffc3a5aef7fe37c540a9a1ef60bd4d8dcdb76376fadf9de", + "0x000000000000000000000000bbceb991e59a4e53dfdbd4a4b1843de1830017b3" + ], + "data": "0x", + "logIndex": 4, + "blockHash": "0x1ab85c22e1dcdc6aa782224b150da9f6ef4e0a259f51db36ca20689d67c9a6fe" + } + ], + "blockNumber": 7370681, + "cumulativeGasUsed": "3503839", + "status": 1, + "byzantium": true + }, + "args": [ + "0x5c946740441C12510a167B447B7dE565C20b9E3C", + "0xbBCeB991e59a4E53DfDbD4a4B1843de1830017B3" + ], + "solcInputHash": "3c1e469b4f9ba208577ab7c230900006", + "metadata": "{\"compiler\":{\"version\":\"0.7.3+commit.9bfce1f6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"_graphToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_masterCopy\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes4\",\"name\":\"sigHash\",\"type\":\"bytes4\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"signature\",\"type\":\"string\"}],\"name\":\"FunctionCallAuth\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"masterCopy\",\"type\":\"address\"}],\"name\":\"MasterCopyUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"proxy\",\"type\":\"address\"}],\"name\":\"ProxyCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dst\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"}],\"name\":\"TokenDestinationAllowed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"contractAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"initHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"managedAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"startTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"endTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"periods\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"releaseStartTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"vestingCliffTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"enum IGraphTokenLock.Revocability\",\"name\":\"revocable\",\"type\":\"uint8\"}],\"name\":\"TokenLockCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensWithdrawn\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_dst\",\"type\":\"address\"}],\"name\":\"addTokenDestination\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"name\":\"authFnCalls\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_beneficiary\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_managedAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_startTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_endTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_periods\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_releaseStartTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_vestingCliffTime\",\"type\":\"uint256\"},{\"internalType\":\"enum IGraphTokenLock.Revocability\",\"name\":\"_revocable\",\"type\":\"uint8\"}],\"name\":\"createTokenLockWallet\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"deposit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"_sigHash\",\"type\":\"bytes4\"}],\"name\":\"getAuthFunctionCallTarget\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_salt\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"}],\"name\":\"getDeploymentAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTokenDestinations\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"_sigHash\",\"type\":\"bytes4\"}],\"name\":\"isAuthFunctionCall\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_dst\",\"type\":\"address\"}],\"name\":\"isTokenDestination\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"masterCopy\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_dst\",\"type\":\"address\"}],\"name\":\"removeTokenDestination\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_signature\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"_target\",\"type\":\"address\"}],\"name\":\"setAuthFunctionCall\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string[]\",\"name\":\"_signatures\",\"type\":\"string[]\"},{\"internalType\":\"address[]\",\"name\":\"_targets\",\"type\":\"address[]\"}],\"name\":\"setAuthFunctionCallMany\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_masterCopy\",\"type\":\"address\"}],\"name\":\"setMasterCopy\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_signature\",\"type\":\"string\"}],\"name\":\"unsetAuthFunctionCall\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"addTokenDestination(address)\":{\"params\":{\"_dst\":\"Destination address\"}},\"constructor\":{\"params\":{\"_graphToken\":\"Token to use for deposits and withdrawals\",\"_masterCopy\":\"Address of the master copy to use to clone proxies\"}},\"createTokenLockWallet(address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)\":{\"params\":{\"_beneficiary\":\"Address of the beneficiary of locked tokens\",\"_endTime\":\"End time of the release schedule\",\"_managedAmount\":\"Amount of tokens to be managed by the lock contract\",\"_owner\":\"Address of the contract owner\",\"_periods\":\"Number of periods between start time and end time\",\"_releaseStartTime\":\"Override time for when the releases start\",\"_revocable\":\"Whether the contract is revocable\",\"_startTime\":\"Start time of the release schedule\"}},\"deposit(uint256)\":{\"details\":\"Even if the ERC20 token can be transferred directly to the contract this function provide a safe interface to do the transfer and avoid mistakes\",\"params\":{\"_amount\":\"Amount to deposit\"}},\"getAuthFunctionCallTarget(bytes4)\":{\"params\":{\"_sigHash\":\"Function signature hash\"},\"returns\":{\"_0\":\"Address of the target contract where to send the call\"}},\"getDeploymentAddress(bytes32,address)\":{\"params\":{\"_implementation\":\"Address of the proxy target implementation\",\"_salt\":\"Bytes32 salt to use for CREATE2\"},\"returns\":{\"_0\":\"Address of the counterfactual MinimalProxy\"}},\"getTokenDestinations()\":{\"returns\":{\"_0\":\"Array of addresses authorized to pull funds from a token lock\"}},\"isAuthFunctionCall(bytes4)\":{\"params\":{\"_sigHash\":\"Function signature hash\"},\"returns\":{\"_0\":\"True if authorized\"}},\"isTokenDestination(address)\":{\"params\":{\"_dst\":\"Destination address\"},\"returns\":{\"_0\":\"True if authorized\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"removeTokenDestination(address)\":{\"params\":{\"_dst\":\"Destination address\"}},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"setAuthFunctionCall(string,address)\":{\"details\":\"Input expected is the function signature as 'transfer(address,uint256)'\",\"params\":{\"_signature\":\"Function signature\",\"_target\":\"Address of the destination contract to call\"}},\"setAuthFunctionCallMany(string[],address[])\":{\"details\":\"Input expected is the function signature as 'transfer(address,uint256)'\",\"params\":{\"_signatures\":\"Function signatures\",\"_targets\":\"Address of the destination contract to call\"}},\"setMasterCopy(address)\":{\"params\":{\"_masterCopy\":\"Address of contract bytecode to factory clone\"}},\"token()\":{\"returns\":{\"_0\":\"Token used for transfers and approvals\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"unsetAuthFunctionCall(string)\":{\"details\":\"Input expected is the function signature as 'transfer(address,uint256)'\",\"params\":{\"_signature\":\"Function signature\"}},\"withdraw(uint256)\":{\"details\":\"Escape hatch in case of mistakes or to recover remaining funds\",\"params\":{\"_amount\":\"Amount of tokens to withdraw\"}}},\"title\":\"GraphTokenLockManager\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"addTokenDestination(address)\":{\"notice\":\"Adds an address that can be allowed by a token lock to pull funds\"},\"constructor\":{\"notice\":\"Constructor.\"},\"createTokenLockWallet(address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)\":{\"notice\":\"Creates and fund a new token lock wallet using a minimum proxy\"},\"deposit(uint256)\":{\"notice\":\"Deposits tokens into the contract\"},\"getAuthFunctionCallTarget(bytes4)\":{\"notice\":\"Gets the target contract to call for a particular function signature\"},\"getDeploymentAddress(bytes32,address)\":{\"notice\":\"Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation\"},\"getTokenDestinations()\":{\"notice\":\"Returns an array of authorized destination addresses\"},\"isAuthFunctionCall(bytes4)\":{\"notice\":\"Returns true if the function call is authorized\"},\"isTokenDestination(address)\":{\"notice\":\"Returns True if the address is authorized to be a destination of tokens\"},\"removeTokenDestination(address)\":{\"notice\":\"Removes an address that can be allowed by a token lock to pull funds\"},\"setAuthFunctionCall(string,address)\":{\"notice\":\"Sets an authorized function call to target\"},\"setAuthFunctionCallMany(string[],address[])\":{\"notice\":\"Sets an authorized function call to target in bulk\"},\"setMasterCopy(address)\":{\"notice\":\"Sets the masterCopy bytecode to use to create clones of TokenLock contracts\"},\"token()\":{\"notice\":\"Gets the GRT token address\"},\"unsetAuthFunctionCall(string)\":{\"notice\":\"Unsets an authorized function call to target\"},\"withdraw(uint256)\":{\"notice\":\"Withdraws tokens from the contract\"}},\"notice\":\"This contract manages a list of authorized function calls and targets that can be called by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts. This contract receives funds to make the process of creating TokenLockWallet contracts easier by distributing them the initial tokens to be managed. The owner can setup a list of token destinations that will be used by TokenLock contracts to approve the pulling of funds, this way in can be guaranteed that only protocol contracts will manipulate users funds.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/GraphTokenLockManager.sol\":\"GraphTokenLockManager\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor () internal {\\n address msgSender = _msgSender();\\n _owner = msgSender;\\n emit OwnershipTransferred(address(0), msgSender);\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n emit OwnershipTransferred(_owner, address(0));\\n _owner = address(0);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n emit OwnershipTransferred(_owner, newOwner);\\n _owner = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0x15e2d5bd4c28a88548074c54d220e8086f638a71ed07e6b3ba5a70066fcf458d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/math/SafeMath.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Wrappers over Solidity's arithmetic operations with added overflow\\n * checks.\\n *\\n * Arithmetic operations in Solidity wrap on overflow. This can easily result\\n * in bugs, because programmers usually assume that an overflow raises an\\n * error, which is the standard behavior in high level programming languages.\\n * `SafeMath` restores this intuition by reverting the transaction when an\\n * operation overflows.\\n *\\n * Using this library instead of the unchecked operations eliminates an entire\\n * class of bugs, so it's recommended to use it always.\\n */\\nlibrary SafeMath {\\n /**\\n * @dev Returns the addition of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n uint256 c = a + b;\\n if (c < a) return (false, 0);\\n return (true, c);\\n }\\n\\n /**\\n * @dev Returns the substraction of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b > a) return (false, 0);\\n return (true, a - b);\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\\n if (a == 0) return (true, 0);\\n uint256 c = a * b;\\n if (c / a != b) return (false, 0);\\n return (true, c);\\n }\\n\\n /**\\n * @dev Returns the division of two unsigned integers, with a division by zero flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b == 0) return (false, 0);\\n return (true, a / b);\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b == 0) return (false, 0);\\n return (true, a % b);\\n }\\n\\n /**\\n * @dev Returns the addition of two unsigned integers, reverting on\\n * overflow.\\n *\\n * Counterpart to Solidity's `+` operator.\\n *\\n * Requirements:\\n *\\n * - Addition cannot overflow.\\n */\\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\\n uint256 c = a + b;\\n require(c >= a, \\\"SafeMath: addition overflow\\\");\\n return c;\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting on\\n * overflow (when the result is negative).\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n *\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b <= a, \\\"SafeMath: subtraction overflow\\\");\\n return a - b;\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, reverting on\\n * overflow.\\n *\\n * Counterpart to Solidity's `*` operator.\\n *\\n * Requirements:\\n *\\n * - Multiplication cannot overflow.\\n */\\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\\n if (a == 0) return 0;\\n uint256 c = a * b;\\n require(c / a == b, \\\"SafeMath: multiplication overflow\\\");\\n return c;\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers, reverting on\\n * division by zero. The result is rounded towards zero.\\n *\\n * Counterpart to Solidity's `/` operator. Note: this function uses a\\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\\n * uses an invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b > 0, \\\"SafeMath: division by zero\\\");\\n return a / b;\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * reverting when dividing by zero.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b > 0, \\\"SafeMath: modulo by zero\\\");\\n return a % b;\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\\n * overflow (when the result is negative).\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {trySub}.\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n *\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b <= a, errorMessage);\\n return a - b;\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers, reverting with custom message on\\n * division by zero. The result is rounded towards zero.\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {tryDiv}.\\n *\\n * Counterpart to Solidity's `/` operator. Note: this function uses a\\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\\n * uses an invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b > 0, errorMessage);\\n return a / b;\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * reverting with custom message when dividing by zero.\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {tryMod}.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b > 0, errorMessage);\\n return a % b;\\n }\\n}\\n\",\"keccak256\":\"0xcc78a17dd88fa5a2edc60c8489e2f405c0913b377216a5b26b35656b2d0dab52\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `recipient`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address recipient, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `sender` to `recipient` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n}\\n\",\"keccak256\":\"0x5f02220344881ce43204ae4a6281145a67bc52c2bb1290a791857df3d19d78f5\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\nimport \\\"./IERC20.sol\\\";\\nimport \\\"../../math/SafeMath.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @title SafeERC20\\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\\n * contract returns false). Tokens that return no value (and instead revert or\\n * throw on failure) are also supported, non-reverting calls are assumed to be\\n * successful.\\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\n */\\nlibrary SafeERC20 {\\n using SafeMath for uint256;\\n using Address for address;\\n\\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\\n }\\n\\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\\n }\\n\\n /**\\n * @dev Deprecated. This function has issues similar to the ones found in\\n * {IERC20-approve}, and its usage is discouraged.\\n *\\n * Whenever possible, use {safeIncreaseAllowance} and\\n * {safeDecreaseAllowance} instead.\\n */\\n function safeApprove(IERC20 token, address spender, uint256 value) internal {\\n // safeApprove should only be called when setting an initial allowance,\\n // or when resetting it to zero. To increase and decrease it, use\\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\\n // solhint-disable-next-line max-line-length\\n require((value == 0) || (token.allowance(address(this), spender) == 0),\\n \\\"SafeERC20: approve from non-zero to non-zero allowance\\\"\\n );\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\\n }\\n\\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n uint256 newAllowance = token.allowance(address(this), spender).add(value);\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n uint256 newAllowance = token.allowance(address(this), spender).sub(value, \\\"SafeERC20: decreased allowance below zero\\\");\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n */\\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that\\n // the target address contains contract code and also asserts for success in the low-level call.\\n\\n bytes memory returndata = address(token).functionCall(data, \\\"SafeERC20: low-level call failed\\\");\\n if (returndata.length > 0) { // Return data is optional\\n // solhint-disable-next-line max-line-length\\n require(abi.decode(returndata, (bool)), \\\"SafeERC20: ERC20 operation did not succeed\\\");\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf12dfbe97e6276980b83d2830bb0eb75e0cf4f3e626c2471137f82158ae6a0fc\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.2 <0.8.0;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize, which returns 0 for contracts in\\n // construction, since the code is only stored at the end of the\\n // constructor execution.\\n\\n uint256 size;\\n // solhint-disable-next-line no-inline-assembly\\n assembly { size := extcodesize(account) }\\n return size > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls, avoid-call-value\\n (bool success, ) = recipient.call{ value: amount }(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain`call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.call{ value: value }(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x28911e614500ae7c607a432a709d35da25f3bc5ddc8bd12b278b66358070c0ea\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/*\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with GSN meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address payable) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes memory) {\\n this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0x8d3cb350f04ff49cfb10aef08d87f19dcbaecc8027b0bed12f3275cd12f38cf0\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Create2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Helper to make usage of the `CREATE2` EVM opcode easier and safer.\\n * `CREATE2` can be used to compute in advance the address where a smart\\n * contract will be deployed, which allows for interesting new mechanisms known\\n * as 'counterfactual interactions'.\\n *\\n * See the https://eips.ethereum.org/EIPS/eip-1014#motivation[EIP] for more\\n * information.\\n */\\nlibrary Create2 {\\n /**\\n * @dev Deploys a contract using `CREATE2`. The address where the contract\\n * will be deployed can be known in advance via {computeAddress}.\\n *\\n * The bytecode for a contract can be obtained from Solidity with\\n * `type(contractName).creationCode`.\\n *\\n * Requirements:\\n *\\n * - `bytecode` must not be empty.\\n * - `salt` must have not been used for `bytecode` already.\\n * - the factory must have a balance of at least `amount`.\\n * - if `amount` is non-zero, `bytecode` must have a `payable` constructor.\\n */\\n function deploy(uint256 amount, bytes32 salt, bytes memory bytecode) internal returns (address) {\\n address addr;\\n require(address(this).balance >= amount, \\\"Create2: insufficient balance\\\");\\n require(bytecode.length != 0, \\\"Create2: bytecode length is zero\\\");\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n addr := create2(amount, add(bytecode, 0x20), mload(bytecode), salt)\\n }\\n require(addr != address(0), \\\"Create2: Failed on deploy\\\");\\n return addr;\\n }\\n\\n /**\\n * @dev Returns the address where a contract will be stored if deployed via {deploy}. Any change in the\\n * `bytecodeHash` or `salt` will result in a new destination address.\\n */\\n function computeAddress(bytes32 salt, bytes32 bytecodeHash) internal view returns (address) {\\n return computeAddress(salt, bytecodeHash, address(this));\\n }\\n\\n /**\\n * @dev Returns the address where a contract will be stored if deployed via {deploy} from a contract located at\\n * `deployer`. If `deployer` is this contract's address, returns the same value as {computeAddress}.\\n */\\n function computeAddress(bytes32 salt, bytes32 bytecodeHash, address deployer) internal pure returns (address) {\\n bytes32 _data = keccak256(\\n abi.encodePacked(bytes1(0xff), deployer, salt, bytecodeHash)\\n );\\n return address(uint160(uint256(_data)));\\n }\\n}\\n\",\"keccak256\":\"0x0a0b021149946014fe1cd04af11e7a937a29986c47e8b1b718c2d50d729472db\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/EnumerableSet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Library for managing\\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\\n * types.\\n *\\n * Sets have the following properties:\\n *\\n * - Elements are added, removed, and checked for existence in constant time\\n * (O(1)).\\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\\n *\\n * ```\\n * contract Example {\\n * // Add the library methods\\n * using EnumerableSet for EnumerableSet.AddressSet;\\n *\\n * // Declare a set state variable\\n * EnumerableSet.AddressSet private mySet;\\n * }\\n * ```\\n *\\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\\n * and `uint256` (`UintSet`) are supported.\\n */\\nlibrary EnumerableSet {\\n // To implement this library for multiple types with as little code\\n // repetition as possible, we write it in terms of a generic Set type with\\n // bytes32 values.\\n // The Set implementation uses private functions, and user-facing\\n // implementations (such as AddressSet) are just wrappers around the\\n // underlying Set.\\n // This means that we can only create new EnumerableSets for types that fit\\n // in bytes32.\\n\\n struct Set {\\n // Storage of set values\\n bytes32[] _values;\\n\\n // Position of the value in the `values` array, plus 1 because index 0\\n // means a value is not in the set.\\n mapping (bytes32 => uint256) _indexes;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function _add(Set storage set, bytes32 value) private returns (bool) {\\n if (!_contains(set, value)) {\\n set._values.push(value);\\n // The value is stored at length-1, but we add 1 to all indexes\\n // and use 0 as a sentinel value\\n set._indexes[value] = set._values.length;\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function _remove(Set storage set, bytes32 value) private returns (bool) {\\n // We read and store the value's index to prevent multiple reads from the same storage slot\\n uint256 valueIndex = set._indexes[value];\\n\\n if (valueIndex != 0) { // Equivalent to contains(set, value)\\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\\n // the array, and then remove the last element (sometimes called as 'swap and pop').\\n // This modifies the order of the array, as noted in {at}.\\n\\n uint256 toDeleteIndex = valueIndex - 1;\\n uint256 lastIndex = set._values.length - 1;\\n\\n // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs\\n // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.\\n\\n bytes32 lastvalue = set._values[lastIndex];\\n\\n // Move the last value to the index where the value to delete is\\n set._values[toDeleteIndex] = lastvalue;\\n // Update the index for the moved value\\n set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based\\n\\n // Delete the slot where the moved value was stored\\n set._values.pop();\\n\\n // Delete the index for the deleted slot\\n delete set._indexes[value];\\n\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\\n return set._indexes[value] != 0;\\n }\\n\\n /**\\n * @dev Returns the number of values on the set. O(1).\\n */\\n function _length(Set storage set) private view returns (uint256) {\\n return set._values.length;\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\\n require(set._values.length > index, \\\"EnumerableSet: index out of bounds\\\");\\n return set._values[index];\\n }\\n\\n // Bytes32Set\\n\\n struct Bytes32Set {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _add(set._inner, value);\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _remove(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\\n return _contains(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(Bytes32Set storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\\n return _at(set._inner, index);\\n }\\n\\n // AddressSet\\n\\n struct AddressSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(AddressSet storage set, address value) internal returns (bool) {\\n return _add(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(AddressSet storage set, address value) internal returns (bool) {\\n return _remove(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(AddressSet storage set, address value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(AddressSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\\n return address(uint160(uint256(_at(set._inner, index))));\\n }\\n\\n\\n // UintSet\\n\\n struct UintSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(UintSet storage set, uint256 value) internal returns (bool) {\\n return _add(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\\n return _remove(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns the number of values on the set. O(1).\\n */\\n function length(UintSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\\n return uint256(_at(set._inner, index));\\n }\\n}\\n\",\"keccak256\":\"0x1562cd9922fbf739edfb979f506809e2743789cbde3177515542161c3d04b164\",\"license\":\"MIT\"},\"contracts/GraphTokenLockManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/EnumerableSet.sol\\\";\\n\\nimport \\\"./MinimalProxyFactory.sol\\\";\\nimport \\\"./IGraphTokenLockManager.sol\\\";\\n\\n/**\\n * @title GraphTokenLockManager\\n * @notice This contract manages a list of authorized function calls and targets that can be called\\n * by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts.\\n *\\n * This contract receives funds to make the process of creating TokenLockWallet contracts\\n * easier by distributing them the initial tokens to be managed.\\n *\\n * The owner can setup a list of token destinations that will be used by TokenLock contracts to\\n * approve the pulling of funds, this way in can be guaranteed that only protocol contracts\\n * will manipulate users funds.\\n */\\ncontract GraphTokenLockManager is MinimalProxyFactory, IGraphTokenLockManager {\\n using SafeERC20 for IERC20;\\n using EnumerableSet for EnumerableSet.AddressSet;\\n\\n // -- State --\\n\\n mapping(bytes4 => address) public authFnCalls;\\n EnumerableSet.AddressSet private _tokenDestinations;\\n\\n address public masterCopy;\\n IERC20 private _token;\\n\\n // -- Events --\\n\\n event MasterCopyUpdated(address indexed masterCopy);\\n event TokenLockCreated(\\n address indexed contractAddress,\\n bytes32 indexed initHash,\\n address indexed beneficiary,\\n address token,\\n uint256 managedAmount,\\n uint256 startTime,\\n uint256 endTime,\\n uint256 periods,\\n uint256 releaseStartTime,\\n uint256 vestingCliffTime,\\n IGraphTokenLock.Revocability revocable\\n );\\n\\n event TokensDeposited(address indexed sender, uint256 amount);\\n event TokensWithdrawn(address indexed sender, uint256 amount);\\n\\n event FunctionCallAuth(address indexed caller, bytes4 indexed sigHash, address indexed target, string signature);\\n event TokenDestinationAllowed(address indexed dst, bool allowed);\\n\\n /**\\n * Constructor.\\n * @param _graphToken Token to use for deposits and withdrawals\\n * @param _masterCopy Address of the master copy to use to clone proxies\\n */\\n constructor(IERC20 _graphToken, address _masterCopy) {\\n require(address(_graphToken) != address(0), \\\"Token cannot be zero\\\");\\n _token = _graphToken;\\n setMasterCopy(_masterCopy);\\n }\\n\\n // -- Factory --\\n\\n /**\\n * @notice Sets the masterCopy bytecode to use to create clones of TokenLock contracts\\n * @param _masterCopy Address of contract bytecode to factory clone\\n */\\n function setMasterCopy(address _masterCopy) public override onlyOwner {\\n require(_masterCopy != address(0), \\\"MasterCopy cannot be zero\\\");\\n masterCopy = _masterCopy;\\n emit MasterCopyUpdated(_masterCopy);\\n }\\n\\n /**\\n * @notice Creates and fund a new token lock wallet using a minimum proxy\\n * @param _owner Address of the contract owner\\n * @param _beneficiary Address of the beneficiary of locked tokens\\n * @param _managedAmount Amount of tokens to be managed by the lock contract\\n * @param _startTime Start time of the release schedule\\n * @param _endTime End time of the release schedule\\n * @param _periods Number of periods between start time and end time\\n * @param _releaseStartTime Override time for when the releases start\\n * @param _revocable Whether the contract is revocable\\n */\\n function createTokenLockWallet(\\n address _owner,\\n address _beneficiary,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n IGraphTokenLock.Revocability _revocable\\n ) external override onlyOwner {\\n require(_token.balanceOf(address(this)) >= _managedAmount, \\\"Not enough tokens to create lock\\\");\\n\\n // Create contract using a minimal proxy and call initializer\\n bytes memory initializer = abi.encodeWithSignature(\\n \\\"initialize(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)\\\",\\n address(this),\\n _owner,\\n _beneficiary,\\n address(_token),\\n _managedAmount,\\n _startTime,\\n _endTime,\\n _periods,\\n _releaseStartTime,\\n _vestingCliffTime,\\n _revocable\\n );\\n address contractAddress = _deployProxy2(keccak256(initializer), masterCopy, initializer);\\n\\n // Send managed amount to the created contract\\n _token.safeTransfer(contractAddress, _managedAmount);\\n\\n emit TokenLockCreated(\\n contractAddress,\\n keccak256(initializer),\\n _beneficiary,\\n address(_token),\\n _managedAmount,\\n _startTime,\\n _endTime,\\n _periods,\\n _releaseStartTime,\\n _vestingCliffTime,\\n _revocable\\n );\\n }\\n\\n // -- Funds Management --\\n\\n /**\\n * @notice Gets the GRT token address\\n * @return Token used for transfers and approvals\\n */\\n function token() external view override returns (IERC20) {\\n return _token;\\n }\\n\\n /**\\n * @notice Deposits tokens into the contract\\n * @dev Even if the ERC20 token can be transferred directly to the contract\\n * this function provide a safe interface to do the transfer and avoid mistakes\\n * @param _amount Amount to deposit\\n */\\n function deposit(uint256 _amount) external override {\\n require(_amount > 0, \\\"Amount cannot be zero\\\");\\n _token.safeTransferFrom(msg.sender, address(this), _amount);\\n emit TokensDeposited(msg.sender, _amount);\\n }\\n\\n /**\\n * @notice Withdraws tokens from the contract\\n * @dev Escape hatch in case of mistakes or to recover remaining funds\\n * @param _amount Amount of tokens to withdraw\\n */\\n function withdraw(uint256 _amount) external override onlyOwner {\\n require(_amount > 0, \\\"Amount cannot be zero\\\");\\n _token.safeTransfer(msg.sender, _amount);\\n emit TokensWithdrawn(msg.sender, _amount);\\n }\\n\\n // -- Token Destinations --\\n\\n /**\\n * @notice Adds an address that can be allowed by a token lock to pull funds\\n * @param _dst Destination address\\n */\\n function addTokenDestination(address _dst) external override onlyOwner {\\n require(_dst != address(0), \\\"Destination cannot be zero\\\");\\n require(_tokenDestinations.add(_dst), \\\"Destination already added\\\");\\n emit TokenDestinationAllowed(_dst, true);\\n }\\n\\n /**\\n * @notice Removes an address that can be allowed by a token lock to pull funds\\n * @param _dst Destination address\\n */\\n function removeTokenDestination(address _dst) external override onlyOwner {\\n require(_tokenDestinations.remove(_dst), \\\"Destination already removed\\\");\\n emit TokenDestinationAllowed(_dst, false);\\n }\\n\\n /**\\n * @notice Returns True if the address is authorized to be a destination of tokens\\n * @param _dst Destination address\\n * @return True if authorized\\n */\\n function isTokenDestination(address _dst) external view override returns (bool) {\\n return _tokenDestinations.contains(_dst);\\n }\\n\\n /**\\n * @notice Returns an array of authorized destination addresses\\n * @return Array of addresses authorized to pull funds from a token lock\\n */\\n function getTokenDestinations() external view override returns (address[] memory) {\\n address[] memory dstList = new address[](_tokenDestinations.length());\\n for (uint256 i = 0; i < _tokenDestinations.length(); i++) {\\n dstList[i] = _tokenDestinations.at(i);\\n }\\n return dstList;\\n }\\n\\n // -- Function Call Authorization --\\n\\n /**\\n * @notice Sets an authorized function call to target\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @param _signature Function signature\\n * @param _target Address of the destination contract to call\\n */\\n function setAuthFunctionCall(string calldata _signature, address _target) external override onlyOwner {\\n _setAuthFunctionCall(_signature, _target);\\n }\\n\\n /**\\n * @notice Unsets an authorized function call to target\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @param _signature Function signature\\n */\\n function unsetAuthFunctionCall(string calldata _signature) external override onlyOwner {\\n bytes4 sigHash = _toFunctionSigHash(_signature);\\n authFnCalls[sigHash] = address(0);\\n\\n emit FunctionCallAuth(msg.sender, sigHash, address(0), _signature);\\n }\\n\\n /**\\n * @notice Sets an authorized function call to target in bulk\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @param _signatures Function signatures\\n * @param _targets Address of the destination contract to call\\n */\\n function setAuthFunctionCallMany(string[] calldata _signatures, address[] calldata _targets)\\n external\\n override\\n onlyOwner\\n {\\n require(_signatures.length == _targets.length, \\\"Array length mismatch\\\");\\n\\n for (uint256 i = 0; i < _signatures.length; i++) {\\n _setAuthFunctionCall(_signatures[i], _targets[i]);\\n }\\n }\\n\\n /**\\n * @notice Sets an authorized function call to target\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @dev Function signatures of Graph Protocol contracts to be used are known ahead of time\\n * @param _signature Function signature\\n * @param _target Address of the destination contract to call\\n */\\n function _setAuthFunctionCall(string calldata _signature, address _target) internal {\\n require(_target != address(this), \\\"Target must be other contract\\\");\\n require(Address.isContract(_target), \\\"Target must be a contract\\\");\\n\\n bytes4 sigHash = _toFunctionSigHash(_signature);\\n authFnCalls[sigHash] = _target;\\n\\n emit FunctionCallAuth(msg.sender, sigHash, _target, _signature);\\n }\\n\\n /**\\n * @notice Gets the target contract to call for a particular function signature\\n * @param _sigHash Function signature hash\\n * @return Address of the target contract where to send the call\\n */\\n function getAuthFunctionCallTarget(bytes4 _sigHash) public view override returns (address) {\\n return authFnCalls[_sigHash];\\n }\\n\\n /**\\n * @notice Returns true if the function call is authorized\\n * @param _sigHash Function signature hash\\n * @return True if authorized\\n */\\n function isAuthFunctionCall(bytes4 _sigHash) external view override returns (bool) {\\n return getAuthFunctionCallTarget(_sigHash) != address(0);\\n }\\n\\n /**\\n * @dev Converts a function signature string to 4-bytes hash\\n * @param _signature Function signature string\\n * @return Function signature hash\\n */\\n function _toFunctionSigHash(string calldata _signature) internal pure returns (bytes4) {\\n return _convertToBytes4(abi.encodeWithSignature(_signature));\\n }\\n\\n /**\\n * @dev Converts function signature bytes to function signature hash (bytes4)\\n * @param _signature Function signature\\n * @return Function signature in bytes4\\n */\\n function _convertToBytes4(bytes memory _signature) internal pure returns (bytes4) {\\n require(_signature.length == 4, \\\"Invalid method signature\\\");\\n bytes4 sigHash;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n sigHash := mload(add(_signature, 32))\\n }\\n return sigHash;\\n }\\n}\\n\",\"keccak256\":\"0x0384d62cb600eb4128baacf5bca60ea2cb0b68d2d013479daef65ed5f15446ef\",\"license\":\"MIT\"},\"contracts/IGraphTokenLock.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\ninterface IGraphTokenLock {\\n enum Revocability {\\n NotSet,\\n Enabled,\\n Disabled\\n }\\n\\n // -- Balances --\\n\\n function currentBalance() external view returns (uint256);\\n\\n // -- Time & Periods --\\n\\n function currentTime() external view returns (uint256);\\n\\n function duration() external view returns (uint256);\\n\\n function sinceStartTime() external view returns (uint256);\\n\\n function amountPerPeriod() external view returns (uint256);\\n\\n function periodDuration() external view returns (uint256);\\n\\n function currentPeriod() external view returns (uint256);\\n\\n function passedPeriods() external view returns (uint256);\\n\\n // -- Locking & Release Schedule --\\n\\n function availableAmount() external view returns (uint256);\\n\\n function vestedAmount() external view returns (uint256);\\n\\n function releasableAmount() external view returns (uint256);\\n\\n function totalOutstandingAmount() external view returns (uint256);\\n\\n function surplusAmount() external view returns (uint256);\\n\\n // -- Value Transfer --\\n\\n function release() external;\\n\\n function withdrawSurplus(uint256 _amount) external;\\n\\n function revoke() external;\\n}\\n\",\"keccak256\":\"0xceb9d258276fe25ec858191e1deae5778f1b2f612a669fb7b37bab1a064756ab\",\"license\":\"MIT\"},\"contracts/IGraphTokenLockManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nimport \\\"./IGraphTokenLock.sol\\\";\\n\\ninterface IGraphTokenLockManager {\\n // -- Factory --\\n\\n function setMasterCopy(address _masterCopy) external;\\n\\n function createTokenLockWallet(\\n address _owner,\\n address _beneficiary,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n IGraphTokenLock.Revocability _revocable\\n ) external;\\n\\n // -- Funds Management --\\n\\n function token() external returns (IERC20);\\n\\n function deposit(uint256 _amount) external;\\n\\n function withdraw(uint256 _amount) external;\\n\\n // -- Allowed Funds Destinations --\\n\\n function addTokenDestination(address _dst) external;\\n\\n function removeTokenDestination(address _dst) external;\\n\\n function isTokenDestination(address _dst) external view returns (bool);\\n\\n function getTokenDestinations() external view returns (address[] memory);\\n\\n // -- Function Call Authorization --\\n\\n function setAuthFunctionCall(string calldata _signature, address _target) external;\\n\\n function unsetAuthFunctionCall(string calldata _signature) external;\\n\\n function setAuthFunctionCallMany(string[] calldata _signatures, address[] calldata _targets) external;\\n\\n function getAuthFunctionCallTarget(bytes4 _sigHash) external view returns (address);\\n\\n function isAuthFunctionCall(bytes4 _sigHash) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x2d78d41909a6de5b316ac39b100ea087a8f317cf306379888a045523e15c4d9a\",\"license\":\"MIT\"},\"contracts/MinimalProxyFactory.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Create2.sol\\\";\\n\\n// Adapted from https://github.com/OpenZeppelin/openzeppelin-sdk/blob/v2.5.0/packages/lib/contracts/upgradeability/ProxyFactory.sol\\n// Based on https://eips.ethereum.org/EIPS/eip-1167\\ncontract MinimalProxyFactory is Ownable {\\n // -- Events --\\n\\n event ProxyCreated(address indexed proxy);\\n\\n /**\\n * @notice Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation\\n * @param _salt Bytes32 salt to use for CREATE2\\n * @param _implementation Address of the proxy target implementation\\n * @return Address of the counterfactual MinimalProxy\\n */\\n function getDeploymentAddress(bytes32 _salt, address _implementation) external view returns (address) {\\n return Create2.computeAddress(_salt, keccak256(_getContractCreationCode(_implementation)), address(this));\\n }\\n\\n /**\\n * @notice Deploys a MinimalProxy with CREATE2\\n * @param _salt Bytes32 salt to use for CREATE2\\n * @param _implementation Address of the proxy target implementation\\n * @param _data Bytes with the initializer call\\n * @return Address of the deployed MinimalProxy\\n */\\n function _deployProxy2(\\n bytes32 _salt,\\n address _implementation,\\n bytes memory _data\\n ) internal returns (address) {\\n address proxyAddress = Create2.deploy(0, _salt, _getContractCreationCode(_implementation));\\n\\n emit ProxyCreated(proxyAddress);\\n\\n // Call function with data\\n if (_data.length > 0) {\\n Address.functionCall(proxyAddress, _data);\\n }\\n\\n return proxyAddress;\\n }\\n\\n /**\\n * @notice Gets the MinimalProxy bytecode\\n * @param _implementation Address of the proxy target implementation\\n * @return MinimalProxy bytecode\\n */\\n function _getContractCreationCode(address _implementation) internal pure returns (bytes memory) {\\n bytes10 creation = 0x3d602d80600a3d3981f3;\\n bytes10 prefix = 0x363d3d373d3d3d363d73;\\n bytes20 targetBytes = bytes20(_implementation);\\n bytes15 suffix = 0x5af43d82803e903d91602b57fd5bf3;\\n return abi.encodePacked(creation, prefix, targetBytes, suffix);\\n }\\n}\\n\",\"keccak256\":\"0x8aa3d50e714f92dc0ed6cc6d88fa8a18c948493103928f6092f98815b2c046ca\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60806040523480156200001157600080fd5b5060405162003c9338038062003c9383398181016040528101906200003791906200039c565b600062000049620001b460201b60201c565b9050806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a350600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156200015a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200015190620004e7565b60405180910390fd5b81600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550620001ac81620001bc60201b60201c565b505062000596565b600033905090565b620001cc620001b460201b60201c565b73ffffffffffffffffffffffffffffffffffffffff16620001f26200034560201b60201c565b73ffffffffffffffffffffffffffffffffffffffff16146200024b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200024290620004c5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415620002be576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620002b590620004a3565b60405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167f30909084afc859121ffc3a5aef7fe37c540a9a1ef60bd4d8dcdb76376fadf9de60405160405180910390a250565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000815190506200037f8162000562565b92915050565b60008151905062000396816200057c565b92915050565b60008060408385031215620003b057600080fd5b6000620003c08582860162000385565b9250506020620003d3858286016200036e565b9150509250929050565b6000620003ec60198362000509565b91507f4d6173746572436f70792063616e6e6f74206265207a65726f000000000000006000830152602082019050919050565b60006200042e60208362000509565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b60006200047060148362000509565b91507f546f6b656e2063616e6e6f74206265207a65726f0000000000000000000000006000830152602082019050919050565b60006020820190508181036000830152620004be81620003dd565b9050919050565b60006020820190508181036000830152620004e0816200041f565b9050919050565b60006020820190508181036000830152620005028162000461565b9050919050565b600082825260208201905092915050565b6000620005278262000542565b9050919050565b60006200053b826200051a565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6200056d816200051a565b81146200057957600080fd5b50565b62000587816200052e565b81146200059357600080fd5b50565b6136ed80620005a66000396000f3fe608060405234801561001057600080fd5b506004361061012c5760003560e01c80639c05fc60116100ad578063c1ab13db11610071578063c1ab13db14610319578063cf497e6c14610335578063f1d24c4514610351578063f2fde38b14610381578063fc0c546a1461039d5761012c565b80639c05fc6014610275578063a345746614610291578063a619486e146102af578063b6b55f25146102cd578063bdb62fbe146102e95761012c565b806368d30c2e116100f457806368d30c2e146101d15780636e03b8dc146101ed578063715018a61461021d57806379ee1bdf146102275780638da5cb5b146102575761012c565b806303990a6c146101315780630602ba2b1461014d5780632e1a7d4d1461017d578063463013a2146101995780635975e00c146101b5575b600080fd5b61014b6004803603810190610146919061253e565b6103bb565b005b61016760048036038101906101629190612515565b610563565b604051610174919061302d565b60405180910390f35b610197600480360381019061019291906125db565b6105a4565b005b6101b360048036038101906101ae9190612583565b610701565b005b6101cf60048036038101906101ca919061234c565b61078d565b005b6101eb60048036038101906101e69190612375565b61091e565b005b61020760048036038101906102029190612515565b610c7e565b6040516102149190612e67565b60405180910390f35b610225610cb1565b005b610241600480360381019061023c919061234c565b610deb565b60405161024e919061302d565b60405180910390f35b61025f610e08565b60405161026c9190612e67565b60405180910390f35b61028f600480360381019061028a919061243b565b610e31565b005b610299610f5e565b6040516102a6919061300b565b60405180910390f35b6102b7611036565b6040516102c49190612e67565b60405180910390f35b6102e760048036038101906102e291906125db565b61105c565b005b61030360048036038101906102fe91906124d9565b61113f565b6040516103109190612e67565b60405180910390f35b610333600480360381019061032e919061234c565b611163565b005b61034f600480360381019061034a919061234c565b611284565b005b61036b60048036038101906103669190612515565b6113f7565b6040516103789190612e67565b60405180910390f35b61039b6004803603810190610396919061234c565b611472565b005b6103a561161b565b6040516103b29190613048565b60405180910390f35b6103c3611645565b73ffffffffffffffffffffffffffffffffffffffff166103e1610e08565b73ffffffffffffffffffffffffffffffffffffffff1614610437576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042e90613229565b60405180910390fd5b6000610443838361164d565b9050600060016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff16817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163373ffffffffffffffffffffffffffffffffffffffff167f450397a2db0e89eccfe664cc6cdfd274a88bc00d29aaec4d991754a42f19f8c98686604051610556929190613063565b60405180910390a4505050565b60008073ffffffffffffffffffffffffffffffffffffffff16610585836113f7565b73ffffffffffffffffffffffffffffffffffffffff1614159050919050565b6105ac611645565b73ffffffffffffffffffffffffffffffffffffffff166105ca610e08565b73ffffffffffffffffffffffffffffffffffffffff1614610620576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161061790613229565b60405180910390fd5b60008111610663576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161065a90613209565b60405180910390fd5b6106b03382600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166116db9092919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b826040516106f69190613309565b60405180910390a250565b610709611645565b73ffffffffffffffffffffffffffffffffffffffff16610727610e08565b73ffffffffffffffffffffffffffffffffffffffff161461077d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077490613229565b60405180910390fd5b610788838383611761565b505050565b610795611645565b73ffffffffffffffffffffffffffffffffffffffff166107b3610e08565b73ffffffffffffffffffffffffffffffffffffffff1614610809576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080090613229565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610879576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161087090613109565b60405180910390fd5b61088d81600261194390919063ffffffff16565b6108cc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108c390613269565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f33442b8c13e72dd75a027f08f9bff4eed2dfd26e43cdea857365f5163b359a796001604051610913919061302d565b60405180910390a250565b610926611645565b73ffffffffffffffffffffffffffffffffffffffff16610944610e08565b73ffffffffffffffffffffffffffffffffffffffff161461099a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161099190613229565b60405180910390fd5b86600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016109f69190612e67565b60206040518083038186803b158015610a0e57600080fd5b505afa158015610a22573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a469190612604565b1015610a87576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7e90613149565b60405180910390fd5b6060308a8a600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168b8b8b8b8b8b8b604051602401610ad09b9a99989796959493929190612e82565b6040516020818303038152906040527fbd896dcb000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505090506000610b858280519060200120600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611973565b9050610bd4818a600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166116db9092919063ffffffff16565b8973ffffffffffffffffffffffffffffffffffffffff1682805190602001208273ffffffffffffffffffffffffffffffffffffffff167f3c7ff6acee351ed98200c285a04745858a107e16da2f13c3a81a43073c17d644600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168d8d8d8d8d8d8d604051610c69989796959493929190612f8d565b60405180910390a45050505050505050505050565b60016020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610cb9611645565b73ffffffffffffffffffffffffffffffffffffffff16610cd7610e08565b73ffffffffffffffffffffffffffffffffffffffff1614610d2d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d2490613229565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000610e018260026119ef90919063ffffffff16565b9050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610e39611645565b73ffffffffffffffffffffffffffffffffffffffff16610e57610e08565b73ffffffffffffffffffffffffffffffffffffffff1614610ead576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ea490613229565b60405180910390fd5b818190508484905014610ef5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eec906130e9565b60405180910390fd5b60005b84849050811015610f5757610f4a858583818110610f1257fe5b9050602002810190610f249190613324565b858585818110610f3057fe5b9050602002016020810190610f45919061234c565b611761565b8080600101915050610ef8565b5050505050565b606080610f6b6002611a1f565b67ffffffffffffffff81118015610f8157600080fd5b50604051908082528060200260200182016040528015610fb05781602001602082028036833780820191505090505b50905060005b610fc06002611a1f565b81101561102e57610fdb816002611a3490919063ffffffff16565b828281518110610fe757fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508080600101915050610fb6565b508091505090565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000811161109f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161109690613209565b60405180910390fd5b6110ee333083600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611a4e909392919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f59062170a285eb80e8c6b8ced60428442a51910635005233fc4ce084a475845e826040516111349190613309565b60405180910390a250565b600061115b8361114e84611ad7565b8051906020012030611b4d565b905092915050565b61116b611645565b73ffffffffffffffffffffffffffffffffffffffff16611189610e08565b73ffffffffffffffffffffffffffffffffffffffff16146111df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111d690613229565b60405180910390fd5b6111f3816002611b9190919063ffffffff16565b611232576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161122990613189565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f33442b8c13e72dd75a027f08f9bff4eed2dfd26e43cdea857365f5163b359a796000604051611279919061302d565b60405180910390a250565b61128c611645565b73ffffffffffffffffffffffffffffffffffffffff166112aa610e08565b73ffffffffffffffffffffffffffffffffffffffff1614611300576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112f790613229565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611370576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611367906131a9565b60405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167f30909084afc859121ffc3a5aef7fe37c540a9a1ef60bd4d8dcdb76376fadf9de60405160405180910390a250565b600060016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b61147a611645565b73ffffffffffffffffffffffffffffffffffffffff16611498610e08565b73ffffffffffffffffffffffffffffffffffffffff16146114ee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114e590613229565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561155e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155590613129565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600033905090565b60006116d383836040516024016040516020818303038152906040529190604051611679929190612e4e565b60405180910390207bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611bc1565b905092915050565b61175c8363a9059cbb60e01b84846040516024016116fa929190612f64565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611c19565b505050565b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156117d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117c7906131c9565b60405180910390fd5b6117d981611ce0565b611818576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161180f906132e9565b60405180910390fd5b6000611824848461164d565b90508160016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff16817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163373ffffffffffffffffffffffffffffffffffffffff167f450397a2db0e89eccfe664cc6cdfd274a88bc00d29aaec4d991754a42f19f8c98787604051611935929190613063565b60405180910390a450505050565b600061196b836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611cf3565b905092915050565b60008061198a60008661198587611ad7565b611d63565b90508073ffffffffffffffffffffffffffffffffffffffff167efffc2da0b561cae30d9826d37709e9421c4725faebc226cbbb7ef5fc5e734960405160405180910390a26000835111156119e4576119e28184611e74565b505b809150509392505050565b6000611a17836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611ebe565b905092915050565b6000611a2d82600001611ee1565b9050919050565b6000611a438360000183611ef2565b60001c905092915050565b611ad1846323b872dd60e01b858585604051602401611a6f93929190612f2d565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611c19565b50505050565b60606000693d602d80600a3d3981f360b01b9050600069363d3d373d3d3d363d7360b01b905060008460601b905060006e5af43d82803e903d91602b57fd5bf360881b905083838383604051602001611b339493929190612d9b565b604051602081830303815290604052945050505050919050565b60008060ff60f81b838686604051602001611b6b9493929190612de9565b6040516020818303038152906040528051906020012090508060001c9150509392505050565b6000611bb9836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611f5f565b905092915050565b60006004825114611c07576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bfe90613249565b60405180910390fd5b60006020830151905080915050919050565b6060611c7b826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166120479092919063ffffffff16565b9050600081511115611cdb5780806020019051810190611c9b91906124b0565b611cda576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cd1906132a9565b60405180910390fd5b5b505050565b600080823b905060008111915050919050565b6000611cff8383611ebe565b611d58578260000182908060018154018082558091505060019003906000526020600020016000909190919091505582600001805490508360010160008481526020019081526020016000208190555060019050611d5d565b600090505b92915050565b60008084471015611da9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611da0906132c9565b60405180910390fd5b600083511415611dee576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611de5906130c9565b60405180910390fd5b8383516020850187f59050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611e69576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e60906131e9565b60405180910390fd5b809150509392505050565b6060611eb683836040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c65640000815250612047565b905092915050565b600080836001016000848152602001908152602001600020541415905092915050565b600081600001805490509050919050565b600081836000018054905011611f3d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f34906130a9565b60405180910390fd5b826000018281548110611f4c57fe5b9060005260206000200154905092915050565b6000808360010160008481526020019081526020016000205490506000811461203b5760006001820390506000600186600001805490500390506000866000018281548110611faa57fe5b9060005260206000200154905080876000018481548110611fc757fe5b9060005260206000200181905550600183018760010160008381526020019081526020016000208190555086600001805480611fff57fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050612041565b60009150505b92915050565b6060612056848460008561205f565b90509392505050565b6060824710156120a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161209b90613169565b60405180910390fd5b6120ad85611ce0565b6120ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120e390613289565b60405180910390fd5b600060608673ffffffffffffffffffffffffffffffffffffffff1685876040516121169190612e37565b60006040518083038185875af1925050503d8060008114612153576040519150601f19603f3d011682016040523d82523d6000602084013e612158565b606091505b5091509150612168828286612174565b92505050949350505050565b60608315612184578290506121d4565b6000835111156121975782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121cb9190613087565b60405180910390fd5b9392505050565b6000813590506121ea81613634565b92915050565b60008083601f84011261220257600080fd5b8235905067ffffffffffffffff81111561221b57600080fd5b60208301915083602082028301111561223357600080fd5b9250929050565b60008083601f84011261224c57600080fd5b8235905067ffffffffffffffff81111561226557600080fd5b60208301915083602082028301111561227d57600080fd5b9250929050565b6000815190506122938161364b565b92915050565b6000813590506122a881613662565b92915050565b6000813590506122bd81613679565b92915050565b6000813590506122d281613690565b92915050565b60008083601f8401126122ea57600080fd5b8235905067ffffffffffffffff81111561230357600080fd5b60208301915083600182028301111561231b57600080fd5b9250929050565b600081359050612331816136a0565b92915050565b600081519050612346816136a0565b92915050565b60006020828403121561235e57600080fd5b600061236c848285016121db565b91505092915050565b60008060008060008060008060006101208a8c03121561239457600080fd5b60006123a28c828d016121db565b99505060206123b38c828d016121db565b98505060406123c48c828d01612322565b97505060606123d58c828d01612322565b96505060806123e68c828d01612322565b95505060a06123f78c828d01612322565b94505060c06124088c828d01612322565b93505060e06124198c828d01612322565b92505061010061242b8c828d016122c3565b9150509295985092959850929598565b6000806000806040858703121561245157600080fd5b600085013567ffffffffffffffff81111561246b57600080fd5b6124778782880161223a565b9450945050602085013567ffffffffffffffff81111561249657600080fd5b6124a2878288016121f0565b925092505092959194509250565b6000602082840312156124c257600080fd5b60006124d084828501612284565b91505092915050565b600080604083850312156124ec57600080fd5b60006124fa85828601612299565b925050602061250b858286016121db565b9150509250929050565b60006020828403121561252757600080fd5b6000612535848285016122ae565b91505092915050565b6000806020838503121561255157600080fd5b600083013567ffffffffffffffff81111561256b57600080fd5b612577858286016122d8565b92509250509250929050565b60008060006040848603121561259857600080fd5b600084013567ffffffffffffffff8111156125b257600080fd5b6125be868287016122d8565b935093505060206125d1868287016121db565b9150509250925092565b6000602082840312156125ed57600080fd5b60006125fb84828501612322565b91505092915050565b60006020828403121561261657600080fd5b600061262484828501612337565b91505092915050565b60006126398383612645565b60208301905092915050565b61264e816133f1565b82525050565b61265d816133f1565b82525050565b61267461266f826133f1565b6135aa565b82525050565b60006126858261338b565b61268f81856133b9565b935061269a8361337b565b8060005b838110156126cb5781516126b2888261262d565b97506126bd836133ac565b92505060018101905061269e565b5085935050505092915050565b6126e181613403565b82525050565b6126f86126f38261343b565b6135c6565b82525050565b61270f61270a82613467565b6135d0565b82525050565b6127266127218261340f565b6135bc565b82525050565b61273d61273882613493565b6135da565b82525050565b61275461274f826134bf565b6135e4565b82525050565b600061276582613396565b61276f81856133ca565b935061277f818560208601613577565b80840191505092915050565b61279481613532565b82525050565b6127a381613556565b82525050565b60006127b583856133d5565b93506127c2838584613568565b6127cb83613602565b840190509392505050565b60006127e283856133e6565b93506127ef838584613568565b82840190509392505050565b6000612806826133a1565b61281081856133d5565b9350612820818560208601613577565b61282981613602565b840191505092915050565b60006128416022836133d5565b91507f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e60008301527f64730000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006128a76020836133d5565b91507f437265617465323a2062797465636f6465206c656e677468206973207a65726f6000830152602082019050919050565b60006128e76015836133d5565b91507f4172726179206c656e677468206d69736d6174636800000000000000000000006000830152602082019050919050565b6000612927601a836133d5565b91507f44657374696e6174696f6e2063616e6e6f74206265207a65726f0000000000006000830152602082019050919050565b60006129676026836133d5565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006129cd6020836133d5565b91507f4e6f7420656e6f75676820746f6b656e7320746f20637265617465206c6f636b6000830152602082019050919050565b6000612a0d6026836133d5565b91507f416464726573733a20696e73756666696369656e742062616c616e636520666f60008301527f722063616c6c00000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000612a73601b836133d5565b91507f44657374696e6174696f6e20616c72656164792072656d6f76656400000000006000830152602082019050919050565b6000612ab36019836133d5565b91507f4d6173746572436f70792063616e6e6f74206265207a65726f000000000000006000830152602082019050919050565b6000612af3601d836133d5565b91507f546172676574206d757374206265206f7468657220636f6e74726163740000006000830152602082019050919050565b6000612b336019836133d5565b91507f437265617465323a204661696c6564206f6e206465706c6f79000000000000006000830152602082019050919050565b6000612b736015836133d5565b91507f416d6f756e742063616e6e6f74206265207a65726f00000000000000000000006000830152602082019050919050565b6000612bb36020836133d5565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b6000612bf36018836133d5565b91507f496e76616c6964206d6574686f64207369676e617475726500000000000000006000830152602082019050919050565b6000612c336019836133d5565b91507f44657374696e6174696f6e20616c7265616479206164646564000000000000006000830152602082019050919050565b6000612c73601d836133d5565b91507f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006000830152602082019050919050565b6000612cb3602a836133d5565b91507f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008301527f6f742073756363656564000000000000000000000000000000000000000000006020830152604082019050919050565b6000612d19601d836133d5565b91507f437265617465323a20696e73756666696369656e742062616c616e63650000006000830152602082019050919050565b6000612d596019836133d5565b91507f546172676574206d757374206265206120636f6e7472616374000000000000006000830152602082019050919050565b612d9581613528565b82525050565b6000612da782876126e7565b600a82019150612db782866126e7565b600a82019150612dc7828561272c565b601482019150612dd782846126fe565b600f8201915081905095945050505050565b6000612df58287612715565b600182019150612e058286612663565b601482019150612e158285612743565b602082019150612e258284612743565b60208201915081905095945050505050565b6000612e43828461275a565b915081905092915050565b6000612e5b8284866127d6565b91508190509392505050565b6000602082019050612e7c6000830184612654565b92915050565b600061016082019050612e98600083018e612654565b612ea5602083018d612654565b612eb2604083018c612654565b612ebf606083018b612654565b612ecc608083018a612d8c565b612ed960a0830189612d8c565b612ee660c0830188612d8c565b612ef360e0830187612d8c565b612f01610100830186612d8c565b612f0f610120830185612d8c565b612f1d61014083018461279a565b9c9b505050505050505050505050565b6000606082019050612f426000830186612654565b612f4f6020830185612654565b612f5c6040830184612d8c565b949350505050565b6000604082019050612f796000830185612654565b612f866020830184612d8c565b9392505050565b600061010082019050612fa3600083018b612654565b612fb0602083018a612d8c565b612fbd6040830189612d8c565b612fca6060830188612d8c565b612fd76080830187612d8c565b612fe460a0830186612d8c565b612ff160c0830185612d8c565b612ffe60e083018461279a565b9998505050505050505050565b60006020820190508181036000830152613025818461267a565b905092915050565b600060208201905061304260008301846126d8565b92915050565b600060208201905061305d600083018461278b565b92915050565b6000602082019050818103600083015261307e8184866127a9565b90509392505050565b600060208201905081810360008301526130a181846127fb565b905092915050565b600060208201905081810360008301526130c281612834565b9050919050565b600060208201905081810360008301526130e28161289a565b9050919050565b60006020820190508181036000830152613102816128da565b9050919050565b600060208201905081810360008301526131228161291a565b9050919050565b600060208201905081810360008301526131428161295a565b9050919050565b60006020820190508181036000830152613162816129c0565b9050919050565b6000602082019050818103600083015261318281612a00565b9050919050565b600060208201905081810360008301526131a281612a66565b9050919050565b600060208201905081810360008301526131c281612aa6565b9050919050565b600060208201905081810360008301526131e281612ae6565b9050919050565b6000602082019050818103600083015261320281612b26565b9050919050565b6000602082019050818103600083015261322281612b66565b9050919050565b6000602082019050818103600083015261324281612ba6565b9050919050565b6000602082019050818103600083015261326281612be6565b9050919050565b6000602082019050818103600083015261328281612c26565b9050919050565b600060208201905081810360008301526132a281612c66565b9050919050565b600060208201905081810360008301526132c281612ca6565b9050919050565b600060208201905081810360008301526132e281612d0c565b9050919050565b6000602082019050818103600083015261330281612d4c565b9050919050565b600060208201905061331e6000830184612d8c565b92915050565b6000808335600160200384360303811261333d57600080fd5b80840192508235915067ffffffffffffffff82111561335b57600080fd5b60208301925060018202360383131561337357600080fd5b509250929050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b60006133fc82613508565b9050919050565b60008115159050919050565b60007fff0000000000000000000000000000000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffff0000000000000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffffffffffffff000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffffffffffffffffffffffff00000000000000000000000082169050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600081905061350382613620565b919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600061353d82613544565b9050919050565b600061354f82613508565b9050919050565b6000613561826134f5565b9050919050565b82818337600083830152505050565b60005b8381101561359557808201518184015260208101905061357a565b838111156135a4576000848401525b50505050565b60006135b5826135ee565b9050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b60006135f982613613565b9050919050565bfe5b6000601f19601f8301169050919050565b60008160601b9050919050565b6003811061363157613630613600565b5b50565b61363d816133f1565b811461364857600080fd5b50565b61365481613403565b811461365f57600080fd5b50565b61366b816134bf565b811461367657600080fd5b50565b613682816134c9565b811461368d57600080fd5b50565b6003811061369d57600080fd5b50565b6136a981613528565b81146136b457600080fd5b5056fea26469706673582212202d3d549e01583bc5460844b73df152769c2a77e8b1ca88724d847dbd95e3af7964736f6c63430007030033", + "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061012c5760003560e01c80639c05fc60116100ad578063c1ab13db11610071578063c1ab13db14610319578063cf497e6c14610335578063f1d24c4514610351578063f2fde38b14610381578063fc0c546a1461039d5761012c565b80639c05fc6014610275578063a345746614610291578063a619486e146102af578063b6b55f25146102cd578063bdb62fbe146102e95761012c565b806368d30c2e116100f457806368d30c2e146101d15780636e03b8dc146101ed578063715018a61461021d57806379ee1bdf146102275780638da5cb5b146102575761012c565b806303990a6c146101315780630602ba2b1461014d5780632e1a7d4d1461017d578063463013a2146101995780635975e00c146101b5575b600080fd5b61014b6004803603810190610146919061253e565b6103bb565b005b61016760048036038101906101629190612515565b610563565b604051610174919061302d565b60405180910390f35b610197600480360381019061019291906125db565b6105a4565b005b6101b360048036038101906101ae9190612583565b610701565b005b6101cf60048036038101906101ca919061234c565b61078d565b005b6101eb60048036038101906101e69190612375565b61091e565b005b61020760048036038101906102029190612515565b610c7e565b6040516102149190612e67565b60405180910390f35b610225610cb1565b005b610241600480360381019061023c919061234c565b610deb565b60405161024e919061302d565b60405180910390f35b61025f610e08565b60405161026c9190612e67565b60405180910390f35b61028f600480360381019061028a919061243b565b610e31565b005b610299610f5e565b6040516102a6919061300b565b60405180910390f35b6102b7611036565b6040516102c49190612e67565b60405180910390f35b6102e760048036038101906102e291906125db565b61105c565b005b61030360048036038101906102fe91906124d9565b61113f565b6040516103109190612e67565b60405180910390f35b610333600480360381019061032e919061234c565b611163565b005b61034f600480360381019061034a919061234c565b611284565b005b61036b60048036038101906103669190612515565b6113f7565b6040516103789190612e67565b60405180910390f35b61039b6004803603810190610396919061234c565b611472565b005b6103a561161b565b6040516103b29190613048565b60405180910390f35b6103c3611645565b73ffffffffffffffffffffffffffffffffffffffff166103e1610e08565b73ffffffffffffffffffffffffffffffffffffffff1614610437576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042e90613229565b60405180910390fd5b6000610443838361164d565b9050600060016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff16817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163373ffffffffffffffffffffffffffffffffffffffff167f450397a2db0e89eccfe664cc6cdfd274a88bc00d29aaec4d991754a42f19f8c98686604051610556929190613063565b60405180910390a4505050565b60008073ffffffffffffffffffffffffffffffffffffffff16610585836113f7565b73ffffffffffffffffffffffffffffffffffffffff1614159050919050565b6105ac611645565b73ffffffffffffffffffffffffffffffffffffffff166105ca610e08565b73ffffffffffffffffffffffffffffffffffffffff1614610620576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161061790613229565b60405180910390fd5b60008111610663576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161065a90613209565b60405180910390fd5b6106b03382600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166116db9092919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b826040516106f69190613309565b60405180910390a250565b610709611645565b73ffffffffffffffffffffffffffffffffffffffff16610727610e08565b73ffffffffffffffffffffffffffffffffffffffff161461077d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077490613229565b60405180910390fd5b610788838383611761565b505050565b610795611645565b73ffffffffffffffffffffffffffffffffffffffff166107b3610e08565b73ffffffffffffffffffffffffffffffffffffffff1614610809576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080090613229565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610879576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161087090613109565b60405180910390fd5b61088d81600261194390919063ffffffff16565b6108cc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108c390613269565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f33442b8c13e72dd75a027f08f9bff4eed2dfd26e43cdea857365f5163b359a796001604051610913919061302d565b60405180910390a250565b610926611645565b73ffffffffffffffffffffffffffffffffffffffff16610944610e08565b73ffffffffffffffffffffffffffffffffffffffff161461099a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161099190613229565b60405180910390fd5b86600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016109f69190612e67565b60206040518083038186803b158015610a0e57600080fd5b505afa158015610a22573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a469190612604565b1015610a87576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7e90613149565b60405180910390fd5b6060308a8a600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168b8b8b8b8b8b8b604051602401610ad09b9a99989796959493929190612e82565b6040516020818303038152906040527fbd896dcb000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505090506000610b858280519060200120600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611973565b9050610bd4818a600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166116db9092919063ffffffff16565b8973ffffffffffffffffffffffffffffffffffffffff1682805190602001208273ffffffffffffffffffffffffffffffffffffffff167f3c7ff6acee351ed98200c285a04745858a107e16da2f13c3a81a43073c17d644600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168d8d8d8d8d8d8d604051610c69989796959493929190612f8d565b60405180910390a45050505050505050505050565b60016020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610cb9611645565b73ffffffffffffffffffffffffffffffffffffffff16610cd7610e08565b73ffffffffffffffffffffffffffffffffffffffff1614610d2d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d2490613229565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000610e018260026119ef90919063ffffffff16565b9050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610e39611645565b73ffffffffffffffffffffffffffffffffffffffff16610e57610e08565b73ffffffffffffffffffffffffffffffffffffffff1614610ead576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ea490613229565b60405180910390fd5b818190508484905014610ef5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eec906130e9565b60405180910390fd5b60005b84849050811015610f5757610f4a858583818110610f1257fe5b9050602002810190610f249190613324565b858585818110610f3057fe5b9050602002016020810190610f45919061234c565b611761565b8080600101915050610ef8565b5050505050565b606080610f6b6002611a1f565b67ffffffffffffffff81118015610f8157600080fd5b50604051908082528060200260200182016040528015610fb05781602001602082028036833780820191505090505b50905060005b610fc06002611a1f565b81101561102e57610fdb816002611a3490919063ffffffff16565b828281518110610fe757fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508080600101915050610fb6565b508091505090565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000811161109f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161109690613209565b60405180910390fd5b6110ee333083600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611a4e909392919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f59062170a285eb80e8c6b8ced60428442a51910635005233fc4ce084a475845e826040516111349190613309565b60405180910390a250565b600061115b8361114e84611ad7565b8051906020012030611b4d565b905092915050565b61116b611645565b73ffffffffffffffffffffffffffffffffffffffff16611189610e08565b73ffffffffffffffffffffffffffffffffffffffff16146111df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111d690613229565b60405180910390fd5b6111f3816002611b9190919063ffffffff16565b611232576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161122990613189565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f33442b8c13e72dd75a027f08f9bff4eed2dfd26e43cdea857365f5163b359a796000604051611279919061302d565b60405180910390a250565b61128c611645565b73ffffffffffffffffffffffffffffffffffffffff166112aa610e08565b73ffffffffffffffffffffffffffffffffffffffff1614611300576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112f790613229565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611370576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611367906131a9565b60405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167f30909084afc859121ffc3a5aef7fe37c540a9a1ef60bd4d8dcdb76376fadf9de60405160405180910390a250565b600060016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b61147a611645565b73ffffffffffffffffffffffffffffffffffffffff16611498610e08565b73ffffffffffffffffffffffffffffffffffffffff16146114ee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114e590613229565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561155e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155590613129565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600033905090565b60006116d383836040516024016040516020818303038152906040529190604051611679929190612e4e565b60405180910390207bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611bc1565b905092915050565b61175c8363a9059cbb60e01b84846040516024016116fa929190612f64565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611c19565b505050565b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156117d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117c7906131c9565b60405180910390fd5b6117d981611ce0565b611818576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161180f906132e9565b60405180910390fd5b6000611824848461164d565b90508160016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff16817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163373ffffffffffffffffffffffffffffffffffffffff167f450397a2db0e89eccfe664cc6cdfd274a88bc00d29aaec4d991754a42f19f8c98787604051611935929190613063565b60405180910390a450505050565b600061196b836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611cf3565b905092915050565b60008061198a60008661198587611ad7565b611d63565b90508073ffffffffffffffffffffffffffffffffffffffff167efffc2da0b561cae30d9826d37709e9421c4725faebc226cbbb7ef5fc5e734960405160405180910390a26000835111156119e4576119e28184611e74565b505b809150509392505050565b6000611a17836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611ebe565b905092915050565b6000611a2d82600001611ee1565b9050919050565b6000611a438360000183611ef2565b60001c905092915050565b611ad1846323b872dd60e01b858585604051602401611a6f93929190612f2d565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611c19565b50505050565b60606000693d602d80600a3d3981f360b01b9050600069363d3d373d3d3d363d7360b01b905060008460601b905060006e5af43d82803e903d91602b57fd5bf360881b905083838383604051602001611b339493929190612d9b565b604051602081830303815290604052945050505050919050565b60008060ff60f81b838686604051602001611b6b9493929190612de9565b6040516020818303038152906040528051906020012090508060001c9150509392505050565b6000611bb9836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611f5f565b905092915050565b60006004825114611c07576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bfe90613249565b60405180910390fd5b60006020830151905080915050919050565b6060611c7b826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166120479092919063ffffffff16565b9050600081511115611cdb5780806020019051810190611c9b91906124b0565b611cda576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cd1906132a9565b60405180910390fd5b5b505050565b600080823b905060008111915050919050565b6000611cff8383611ebe565b611d58578260000182908060018154018082558091505060019003906000526020600020016000909190919091505582600001805490508360010160008481526020019081526020016000208190555060019050611d5d565b600090505b92915050565b60008084471015611da9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611da0906132c9565b60405180910390fd5b600083511415611dee576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611de5906130c9565b60405180910390fd5b8383516020850187f59050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611e69576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e60906131e9565b60405180910390fd5b809150509392505050565b6060611eb683836040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c65640000815250612047565b905092915050565b600080836001016000848152602001908152602001600020541415905092915050565b600081600001805490509050919050565b600081836000018054905011611f3d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f34906130a9565b60405180910390fd5b826000018281548110611f4c57fe5b9060005260206000200154905092915050565b6000808360010160008481526020019081526020016000205490506000811461203b5760006001820390506000600186600001805490500390506000866000018281548110611faa57fe5b9060005260206000200154905080876000018481548110611fc757fe5b9060005260206000200181905550600183018760010160008381526020019081526020016000208190555086600001805480611fff57fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050612041565b60009150505b92915050565b6060612056848460008561205f565b90509392505050565b6060824710156120a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161209b90613169565b60405180910390fd5b6120ad85611ce0565b6120ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120e390613289565b60405180910390fd5b600060608673ffffffffffffffffffffffffffffffffffffffff1685876040516121169190612e37565b60006040518083038185875af1925050503d8060008114612153576040519150601f19603f3d011682016040523d82523d6000602084013e612158565b606091505b5091509150612168828286612174565b92505050949350505050565b60608315612184578290506121d4565b6000835111156121975782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121cb9190613087565b60405180910390fd5b9392505050565b6000813590506121ea81613634565b92915050565b60008083601f84011261220257600080fd5b8235905067ffffffffffffffff81111561221b57600080fd5b60208301915083602082028301111561223357600080fd5b9250929050565b60008083601f84011261224c57600080fd5b8235905067ffffffffffffffff81111561226557600080fd5b60208301915083602082028301111561227d57600080fd5b9250929050565b6000815190506122938161364b565b92915050565b6000813590506122a881613662565b92915050565b6000813590506122bd81613679565b92915050565b6000813590506122d281613690565b92915050565b60008083601f8401126122ea57600080fd5b8235905067ffffffffffffffff81111561230357600080fd5b60208301915083600182028301111561231b57600080fd5b9250929050565b600081359050612331816136a0565b92915050565b600081519050612346816136a0565b92915050565b60006020828403121561235e57600080fd5b600061236c848285016121db565b91505092915050565b60008060008060008060008060006101208a8c03121561239457600080fd5b60006123a28c828d016121db565b99505060206123b38c828d016121db565b98505060406123c48c828d01612322565b97505060606123d58c828d01612322565b96505060806123e68c828d01612322565b95505060a06123f78c828d01612322565b94505060c06124088c828d01612322565b93505060e06124198c828d01612322565b92505061010061242b8c828d016122c3565b9150509295985092959850929598565b6000806000806040858703121561245157600080fd5b600085013567ffffffffffffffff81111561246b57600080fd5b6124778782880161223a565b9450945050602085013567ffffffffffffffff81111561249657600080fd5b6124a2878288016121f0565b925092505092959194509250565b6000602082840312156124c257600080fd5b60006124d084828501612284565b91505092915050565b600080604083850312156124ec57600080fd5b60006124fa85828601612299565b925050602061250b858286016121db565b9150509250929050565b60006020828403121561252757600080fd5b6000612535848285016122ae565b91505092915050565b6000806020838503121561255157600080fd5b600083013567ffffffffffffffff81111561256b57600080fd5b612577858286016122d8565b92509250509250929050565b60008060006040848603121561259857600080fd5b600084013567ffffffffffffffff8111156125b257600080fd5b6125be868287016122d8565b935093505060206125d1868287016121db565b9150509250925092565b6000602082840312156125ed57600080fd5b60006125fb84828501612322565b91505092915050565b60006020828403121561261657600080fd5b600061262484828501612337565b91505092915050565b60006126398383612645565b60208301905092915050565b61264e816133f1565b82525050565b61265d816133f1565b82525050565b61267461266f826133f1565b6135aa565b82525050565b60006126858261338b565b61268f81856133b9565b935061269a8361337b565b8060005b838110156126cb5781516126b2888261262d565b97506126bd836133ac565b92505060018101905061269e565b5085935050505092915050565b6126e181613403565b82525050565b6126f86126f38261343b565b6135c6565b82525050565b61270f61270a82613467565b6135d0565b82525050565b6127266127218261340f565b6135bc565b82525050565b61273d61273882613493565b6135da565b82525050565b61275461274f826134bf565b6135e4565b82525050565b600061276582613396565b61276f81856133ca565b935061277f818560208601613577565b80840191505092915050565b61279481613532565b82525050565b6127a381613556565b82525050565b60006127b583856133d5565b93506127c2838584613568565b6127cb83613602565b840190509392505050565b60006127e283856133e6565b93506127ef838584613568565b82840190509392505050565b6000612806826133a1565b61281081856133d5565b9350612820818560208601613577565b61282981613602565b840191505092915050565b60006128416022836133d5565b91507f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e60008301527f64730000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006128a76020836133d5565b91507f437265617465323a2062797465636f6465206c656e677468206973207a65726f6000830152602082019050919050565b60006128e76015836133d5565b91507f4172726179206c656e677468206d69736d6174636800000000000000000000006000830152602082019050919050565b6000612927601a836133d5565b91507f44657374696e6174696f6e2063616e6e6f74206265207a65726f0000000000006000830152602082019050919050565b60006129676026836133d5565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006129cd6020836133d5565b91507f4e6f7420656e6f75676820746f6b656e7320746f20637265617465206c6f636b6000830152602082019050919050565b6000612a0d6026836133d5565b91507f416464726573733a20696e73756666696369656e742062616c616e636520666f60008301527f722063616c6c00000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000612a73601b836133d5565b91507f44657374696e6174696f6e20616c72656164792072656d6f76656400000000006000830152602082019050919050565b6000612ab36019836133d5565b91507f4d6173746572436f70792063616e6e6f74206265207a65726f000000000000006000830152602082019050919050565b6000612af3601d836133d5565b91507f546172676574206d757374206265206f7468657220636f6e74726163740000006000830152602082019050919050565b6000612b336019836133d5565b91507f437265617465323a204661696c6564206f6e206465706c6f79000000000000006000830152602082019050919050565b6000612b736015836133d5565b91507f416d6f756e742063616e6e6f74206265207a65726f00000000000000000000006000830152602082019050919050565b6000612bb36020836133d5565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b6000612bf36018836133d5565b91507f496e76616c6964206d6574686f64207369676e617475726500000000000000006000830152602082019050919050565b6000612c336019836133d5565b91507f44657374696e6174696f6e20616c7265616479206164646564000000000000006000830152602082019050919050565b6000612c73601d836133d5565b91507f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006000830152602082019050919050565b6000612cb3602a836133d5565b91507f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008301527f6f742073756363656564000000000000000000000000000000000000000000006020830152604082019050919050565b6000612d19601d836133d5565b91507f437265617465323a20696e73756666696369656e742062616c616e63650000006000830152602082019050919050565b6000612d596019836133d5565b91507f546172676574206d757374206265206120636f6e7472616374000000000000006000830152602082019050919050565b612d9581613528565b82525050565b6000612da782876126e7565b600a82019150612db782866126e7565b600a82019150612dc7828561272c565b601482019150612dd782846126fe565b600f8201915081905095945050505050565b6000612df58287612715565b600182019150612e058286612663565b601482019150612e158285612743565b602082019150612e258284612743565b60208201915081905095945050505050565b6000612e43828461275a565b915081905092915050565b6000612e5b8284866127d6565b91508190509392505050565b6000602082019050612e7c6000830184612654565b92915050565b600061016082019050612e98600083018e612654565b612ea5602083018d612654565b612eb2604083018c612654565b612ebf606083018b612654565b612ecc608083018a612d8c565b612ed960a0830189612d8c565b612ee660c0830188612d8c565b612ef360e0830187612d8c565b612f01610100830186612d8c565b612f0f610120830185612d8c565b612f1d61014083018461279a565b9c9b505050505050505050505050565b6000606082019050612f426000830186612654565b612f4f6020830185612654565b612f5c6040830184612d8c565b949350505050565b6000604082019050612f796000830185612654565b612f866020830184612d8c565b9392505050565b600061010082019050612fa3600083018b612654565b612fb0602083018a612d8c565b612fbd6040830189612d8c565b612fca6060830188612d8c565b612fd76080830187612d8c565b612fe460a0830186612d8c565b612ff160c0830185612d8c565b612ffe60e083018461279a565b9998505050505050505050565b60006020820190508181036000830152613025818461267a565b905092915050565b600060208201905061304260008301846126d8565b92915050565b600060208201905061305d600083018461278b565b92915050565b6000602082019050818103600083015261307e8184866127a9565b90509392505050565b600060208201905081810360008301526130a181846127fb565b905092915050565b600060208201905081810360008301526130c281612834565b9050919050565b600060208201905081810360008301526130e28161289a565b9050919050565b60006020820190508181036000830152613102816128da565b9050919050565b600060208201905081810360008301526131228161291a565b9050919050565b600060208201905081810360008301526131428161295a565b9050919050565b60006020820190508181036000830152613162816129c0565b9050919050565b6000602082019050818103600083015261318281612a00565b9050919050565b600060208201905081810360008301526131a281612a66565b9050919050565b600060208201905081810360008301526131c281612aa6565b9050919050565b600060208201905081810360008301526131e281612ae6565b9050919050565b6000602082019050818103600083015261320281612b26565b9050919050565b6000602082019050818103600083015261322281612b66565b9050919050565b6000602082019050818103600083015261324281612ba6565b9050919050565b6000602082019050818103600083015261326281612be6565b9050919050565b6000602082019050818103600083015261328281612c26565b9050919050565b600060208201905081810360008301526132a281612c66565b9050919050565b600060208201905081810360008301526132c281612ca6565b9050919050565b600060208201905081810360008301526132e281612d0c565b9050919050565b6000602082019050818103600083015261330281612d4c565b9050919050565b600060208201905061331e6000830184612d8c565b92915050565b6000808335600160200384360303811261333d57600080fd5b80840192508235915067ffffffffffffffff82111561335b57600080fd5b60208301925060018202360383131561337357600080fd5b509250929050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b60006133fc82613508565b9050919050565b60008115159050919050565b60007fff0000000000000000000000000000000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffff0000000000000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffffffffffffff000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffffffffffffffffffffffff00000000000000000000000082169050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600081905061350382613620565b919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600061353d82613544565b9050919050565b600061354f82613508565b9050919050565b6000613561826134f5565b9050919050565b82818337600083830152505050565b60005b8381101561359557808201518184015260208101905061357a565b838111156135a4576000848401525b50505050565b60006135b5826135ee565b9050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b60006135f982613613565b9050919050565bfe5b6000601f19601f8301169050919050565b60008160601b9050919050565b6003811061363157613630613600565b5b50565b61363d816133f1565b811461364857600080fd5b50565b61365481613403565b811461365f57600080fd5b50565b61366b816134bf565b811461367657600080fd5b50565b613682816134c9565b811461368d57600080fd5b50565b6003811061369d57600080fd5b50565b6136a981613528565b81146136b457600080fd5b5056fea26469706673582212202d3d549e01583bc5460844b73df152769c2a77e8b1ca88724d847dbd95e3af7964736f6c63430007030033", + "devdoc": { + "kind": "dev", + "methods": { + "addTokenDestination(address)": { + "params": { + "_dst": "Destination address" + } + }, + "constructor": { + "params": { + "_graphToken": "Token to use for deposits and withdrawals", + "_masterCopy": "Address of the master copy to use to clone proxies" + } + }, + "createTokenLockWallet(address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)": { + "params": { + "_beneficiary": "Address of the beneficiary of locked tokens", + "_endTime": "End time of the release schedule", + "_managedAmount": "Amount of tokens to be managed by the lock contract", + "_owner": "Address of the contract owner", + "_periods": "Number of periods between start time and end time", + "_releaseStartTime": "Override time for when the releases start", + "_revocable": "Whether the contract is revocable", + "_startTime": "Start time of the release schedule" + } + }, + "deposit(uint256)": { + "details": "Even if the ERC20 token can be transferred directly to the contract this function provide a safe interface to do the transfer and avoid mistakes", + "params": { + "_amount": "Amount to deposit" + } + }, + "getAuthFunctionCallTarget(bytes4)": { + "params": { + "_sigHash": "Function signature hash" + }, + "returns": { + "_0": "Address of the target contract where to send the call" + } + }, + "getDeploymentAddress(bytes32,address)": { + "params": { + "_implementation": "Address of the proxy target implementation", + "_salt": "Bytes32 salt to use for CREATE2" + }, + "returns": { + "_0": "Address of the counterfactual MinimalProxy" + } + }, + "getTokenDestinations()": { + "returns": { + "_0": "Array of addresses authorized to pull funds from a token lock" + } + }, + "isAuthFunctionCall(bytes4)": { + "params": { + "_sigHash": "Function signature hash" + }, + "returns": { + "_0": "True if authorized" + } + }, + "isTokenDestination(address)": { + "params": { + "_dst": "Destination address" + }, + "returns": { + "_0": "True if authorized" + } + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "removeTokenDestination(address)": { + "params": { + "_dst": "Destination address" + } + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." + }, + "setAuthFunctionCall(string,address)": { + "details": "Input expected is the function signature as 'transfer(address,uint256)'", + "params": { + "_signature": "Function signature", + "_target": "Address of the destination contract to call" + } + }, + "setAuthFunctionCallMany(string[],address[])": { + "details": "Input expected is the function signature as 'transfer(address,uint256)'", + "params": { + "_signatures": "Function signatures", + "_targets": "Address of the destination contract to call" + } + }, + "setMasterCopy(address)": { + "params": { + "_masterCopy": "Address of contract bytecode to factory clone" + } + }, + "token()": { + "returns": { + "_0": "Token used for transfers and approvals" + } + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + }, + "unsetAuthFunctionCall(string)": { + "details": "Input expected is the function signature as 'transfer(address,uint256)'", + "params": { + "_signature": "Function signature" + } + }, + "withdraw(uint256)": { + "details": "Escape hatch in case of mistakes or to recover remaining funds", + "params": { + "_amount": "Amount of tokens to withdraw" + } + } + }, + "title": "GraphTokenLockManager", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "addTokenDestination(address)": { + "notice": "Adds an address that can be allowed by a token lock to pull funds" + }, + "constructor": { + "notice": "Constructor." + }, + "createTokenLockWallet(address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)": { + "notice": "Creates and fund a new token lock wallet using a minimum proxy" + }, + "deposit(uint256)": { + "notice": "Deposits tokens into the contract" + }, + "getAuthFunctionCallTarget(bytes4)": { + "notice": "Gets the target contract to call for a particular function signature" + }, + "getDeploymentAddress(bytes32,address)": { + "notice": "Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation" + }, + "getTokenDestinations()": { + "notice": "Returns an array of authorized destination addresses" + }, + "isAuthFunctionCall(bytes4)": { + "notice": "Returns true if the function call is authorized" + }, + "isTokenDestination(address)": { + "notice": "Returns True if the address is authorized to be a destination of tokens" + }, + "removeTokenDestination(address)": { + "notice": "Removes an address that can be allowed by a token lock to pull funds" + }, + "setAuthFunctionCall(string,address)": { + "notice": "Sets an authorized function call to target" + }, + "setAuthFunctionCallMany(string[],address[])": { + "notice": "Sets an authorized function call to target in bulk" + }, + "setMasterCopy(address)": { + "notice": "Sets the masterCopy bytecode to use to create clones of TokenLock contracts" + }, + "token()": { + "notice": "Gets the GRT token address" + }, + "unsetAuthFunctionCall(string)": { + "notice": "Unsets an authorized function call to target" + }, + "withdraw(uint256)": { + "notice": "Withdraws tokens from the contract" + } + }, + "notice": "This contract manages a list of authorized function calls and targets that can be called by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts. This contract receives funds to make the process of creating TokenLockWallet contracts easier by distributing them the initial tokens to be managed. The owner can setup a list of token destinations that will be used by TokenLock contracts to approve the pulling of funds, this way in can be guaranteed that only protocol contracts will manipulate users funds.", + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 7, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "_owner", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 3316, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "authFnCalls", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_bytes4,t_address)" + }, + { + "astId": 3318, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "_tokenDestinations", + "offset": 0, + "slot": "2", + "type": "t_struct(AddressSet)1964_storage" + }, + { + "astId": 3320, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "masterCopy", + "offset": 0, + "slot": "4", + "type": "t_address" + }, + { + "astId": 3322, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "_token", + "offset": 0, + "slot": "5", + "type": "t_contract(IERC20)1045" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_bytes32)dyn_storage": { + "base": "t_bytes32", + "encoding": "dynamic_array", + "label": "bytes32[]", + "numberOfBytes": "32" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_bytes4": { + "encoding": "inplace", + "label": "bytes4", + "numberOfBytes": "4" + }, + "t_contract(IERC20)1045": { + "encoding": "inplace", + "label": "contract IERC20", + "numberOfBytes": "20" + }, + "t_mapping(t_bytes32,t_uint256)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_mapping(t_bytes4,t_address)": { + "encoding": "mapping", + "key": "t_bytes4", + "label": "mapping(bytes4 => address)", + "numberOfBytes": "32", + "value": "t_address" + }, + "t_struct(AddressSet)1964_storage": { + "encoding": "inplace", + "label": "struct EnumerableSet.AddressSet", + "members": [ + { + "astId": 1963, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "_inner", + "offset": 0, + "slot": "0", + "type": "t_struct(Set)1699_storage" + } + ], + "numberOfBytes": "64" + }, + "t_struct(Set)1699_storage": { + "encoding": "inplace", + "label": "struct EnumerableSet.Set", + "members": [ + { + "astId": 1694, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "_values", + "offset": 0, + "slot": "0", + "type": "t_array(t_bytes32)dyn_storage" + }, + { + "astId": 1698, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "_indexes", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_bytes32,t_uint256)" + } + ], + "numberOfBytes": "64" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} \ No newline at end of file diff --git a/packages/token-distribution/deployments/goerli/GraphTokenLockWallet-Testnet.json b/packages/token-distribution/deployments/goerli/GraphTokenLockWallet-Testnet.json new file mode 100644 index 000000000..0f088084b --- /dev/null +++ b/packages/token-distribution/deployments/goerli/GraphTokenLockWallet-Testnet.json @@ -0,0 +1,1101 @@ +{ + "address": "0xc93df24c3A1ebeCcd0e5D41198460081CFB38c49", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "newBeneficiary", + "type": "address" + } + ], + "name": "BeneficiaryChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "LockAccepted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "LockCanceled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_oldManager", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "_newManager", + "type": "address" + } + ], + "name": "ManagerUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "TokenDestinationsApproved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "TokenDestinationsRevoked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensReleased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensRevoked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensWithdrawn", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "acceptLock", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "amountPerPeriod", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "approveProtocol", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "availableAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "beneficiary", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "cancelLock", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newBeneficiary", + "type": "address" + } + ], + "name": "changeBeneficiary", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "currentBalance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "currentPeriod", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "currentTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "duration", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "endTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_manager", + "type": "address" + }, + { + "internalType": "address", + "name": "_owner", + "type": "address" + }, + { + "internalType": "address", + "name": "_beneficiary", + "type": "address" + }, + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_managedAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_startTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_endTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_periods", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_releaseStartTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_vestingCliffTime", + "type": "uint256" + }, + { + "internalType": "enum IGraphTokenLock.Revocability", + "name": "_revocable", + "type": "uint8" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "isAccepted", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isInitialized", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isRevoked", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "managedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "manager", + "outputs": [ + { + "internalType": "contract IGraphTokenLockManager", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "passedPeriods", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "periodDuration", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "periods", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "releasableAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "release", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "releaseStartTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "releasedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "revocable", + "outputs": [ + { + "internalType": "enum IGraphTokenLock.Revocability", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "revoke", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "revokeProtocol", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "revokedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newManager", + "type": "address" + } + ], + "name": "setManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "sinceStartTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "startTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "surplusAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "token", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalOutstandingAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "usedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "vestedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "vestingCliffTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "withdrawSurplus", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0xc82db94de89d7e695ffb90299b1501f199d5250c3b47bb755f5bb05c033632c0", + "receipt": { + "to": null, + "from": "0xB15599AC1261C4828Ac7E66383ae520655d3D300", + "contractAddress": "0xc93df24c3A1ebeCcd0e5D41198460081CFB38c49", + "transactionIndex": 19, + "gasUsed": "3942206", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x78bdbf41774296aeb2563b0fb9e2ed3985a50428bf22c22f7c92e289963f92f2", + "transactionHash": "0xc82db94de89d7e695ffb90299b1501f199d5250c3b47bb755f5bb05c033632c0", + "logs": [], + "blockNumber": 9345441, + "cumulativeGasUsed": "10310545", + "status": 1, + "byzantium": true + }, + "args": [], + "solcInputHash": "b5cdad58099d39cd1aed000b2fd864d8", + "metadata": "{\"compiler\":{\"version\":\"0.7.3+commit.9bfce1f6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newBeneficiary\",\"type\":\"address\"}],\"name\":\"BeneficiaryChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"LockAccepted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"LockCanceled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_oldManager\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_newManager\",\"type\":\"address\"}],\"name\":\"ManagerUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"TokenDestinationsApproved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"TokenDestinationsRevoked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensReleased\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensRevoked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensWithdrawn\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"acceptLock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"amountPerPeriod\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"approveProtocol\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"availableAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"beneficiary\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"cancelLock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_newBeneficiary\",\"type\":\"address\"}],\"name\":\"changeBeneficiary\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"currentBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"currentPeriod\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"currentTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"duration\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"endTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_manager\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_beneficiary\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_managedAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_startTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_endTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_periods\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_releaseStartTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_vestingCliffTime\",\"type\":\"uint256\"},{\"internalType\":\"enum IGraphTokenLock.Revocability\",\"name\":\"_revocable\",\"type\":\"uint8\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isAccepted\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isInitialized\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isRevoked\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"managedAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"manager\",\"outputs\":[{\"internalType\":\"contract IGraphTokenLockManager\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"passedPeriods\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"periodDuration\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"periods\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"releasableAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"release\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"releaseStartTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"releasedAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"revocable\",\"outputs\":[{\"internalType\":\"enum IGraphTokenLock.Revocability\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"revoke\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"revokeProtocol\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"revokedAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_newManager\",\"type\":\"address\"}],\"name\":\"setManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"sinceStartTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"startTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"surplusAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalOutstandingAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"usedAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"vestedAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"vestingCliffTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdrawSurplus\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"acceptLock()\":{\"details\":\"Can only be called by the beneficiary\"},\"amountPerPeriod()\":{\"returns\":{\"_0\":\"Amount of tokens available after each period\"}},\"approveProtocol()\":{\"details\":\"Approves all token destinations registered in the manager to pull tokens\"},\"availableAmount()\":{\"details\":\"Implements the step-by-step schedule based on periods for available tokens\",\"returns\":{\"_0\":\"Amount of tokens available according to the schedule\"}},\"cancelLock()\":{\"details\":\"Can only be called by the owner\"},\"changeBeneficiary(address)\":{\"details\":\"Can only be called by the beneficiary\",\"params\":{\"_newBeneficiary\":\"Address of the new beneficiary address\"}},\"currentBalance()\":{\"returns\":{\"_0\":\"Tokens held in the contract\"}},\"currentPeriod()\":{\"returns\":{\"_0\":\"A number that represents the current period\"}},\"currentTime()\":{\"returns\":{\"_0\":\"Current block timestamp\"}},\"duration()\":{\"returns\":{\"_0\":\"Amount of seconds from contract startTime to endTime\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"passedPeriods()\":{\"returns\":{\"_0\":\"A number of periods that passed since the schedule started\"}},\"periodDuration()\":{\"returns\":{\"_0\":\"Duration of each period in seconds\"}},\"releasableAmount()\":{\"details\":\"Considers the schedule, takes into account already released tokens and used amount\",\"returns\":{\"_0\":\"Amount of tokens ready to be released\"}},\"release()\":{\"details\":\"All available releasable tokens are transferred to beneficiary\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"revoke()\":{\"details\":\"Vesting schedule is always calculated based on managed tokens\"},\"revokeProtocol()\":{\"details\":\"Revokes approval to all token destinations in the manager to pull tokens\"},\"setManager(address)\":{\"params\":{\"_newManager\":\"Address of the new manager\"}},\"sinceStartTime()\":{\"details\":\"Returns zero if called before conctract starTime\",\"returns\":{\"_0\":\"Seconds elapsed from contract startTime\"}},\"surplusAmount()\":{\"details\":\"All funds over outstanding amount is considered surplus that can be withdrawn by beneficiary. Note this might not be the correct value for wallets transferred to L2 (i.e. an L2GraphTokenLockWallet), as the released amount will be skewed, so the beneficiary might have to bridge back to L1 to release the surplus.\",\"returns\":{\"_0\":\"Amount of tokens considered as surplus\"}},\"totalOutstandingAmount()\":{\"details\":\"Does not consider schedule but just global amounts tracked\",\"returns\":{\"_0\":\"Amount of outstanding tokens for the lifetime of the contract\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"vestedAmount()\":{\"details\":\"Similar to available amount, but is fully vested when contract is non-revocable\",\"returns\":{\"_0\":\"Amount of tokens already vested\"}},\"withdrawSurplus(uint256)\":{\"details\":\"Tokens in the contract over outstanding amount are considered as surplus\",\"params\":{\"_amount\":\"Amount of tokens to withdraw\"}}},\"title\":\"GraphTokenLockWallet\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"acceptLock()\":{\"notice\":\"Beneficiary accepts the lock, the owner cannot retrieve back the tokens\"},\"amountPerPeriod()\":{\"notice\":\"Returns amount available to be released after each period according to schedule\"},\"approveProtocol()\":{\"notice\":\"Approves protocol access of the tokens managed by this contract\"},\"availableAmount()\":{\"notice\":\"Gets the currently available token according to the schedule\"},\"cancelLock()\":{\"notice\":\"Owner cancel the lock and return the balance in the contract\"},\"changeBeneficiary(address)\":{\"notice\":\"Change the beneficiary of funds managed by the contract\"},\"currentBalance()\":{\"notice\":\"Returns the amount of tokens currently held by the contract\"},\"currentPeriod()\":{\"notice\":\"Gets the current period based on the schedule\"},\"currentTime()\":{\"notice\":\"Returns the current block timestamp\"},\"duration()\":{\"notice\":\"Gets duration of contract from start to end in seconds\"},\"passedPeriods()\":{\"notice\":\"Gets the number of periods that passed since the first period\"},\"periodDuration()\":{\"notice\":\"Returns the duration of each period in seconds\"},\"releasableAmount()\":{\"notice\":\"Gets tokens currently available for release\"},\"release()\":{\"notice\":\"Releases tokens based on the configured schedule\"},\"revoke()\":{\"notice\":\"Revokes a vesting schedule and return the unvested tokens to the owner\"},\"revokeProtocol()\":{\"notice\":\"Revokes protocol access of the tokens managed by this contract\"},\"setManager(address)\":{\"notice\":\"Sets a new manager for this contract\"},\"sinceStartTime()\":{\"notice\":\"Gets time elapsed since the start of the contract\"},\"surplusAmount()\":{\"notice\":\"Gets surplus amount in the contract based on outstanding amount to release\"},\"totalOutstandingAmount()\":{\"notice\":\"Gets the outstanding amount yet to be released based on the whole contract lifetime\"},\"vestedAmount()\":{\"notice\":\"Gets the amount of currently vested tokens\"},\"withdrawSurplus(uint256)\":{\"notice\":\"Withdraws surplus, unmanaged tokens from the contract\"}},\"notice\":\"This contract is built on top of the base GraphTokenLock functionality. It allows wallet beneficiaries to use the deposited funds to perform specific function calls on specific contracts. The idea is that supporters with locked tokens can participate in the protocol but disallow any release before the vesting/lock schedule. The beneficiary can issue authorized function calls to this contract that will get forwarded to a target contract. A target contract is any of our protocol contracts. The function calls allowed are queried to the GraphTokenLockManager, this way the same configuration can be shared for all the created lock wallet contracts. NOTE: Contracts used as target must have its function signatures checked to avoid collisions with any of this contract functions. Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience the maximum amount of tokens is authorized. Function calls do not forward ETH value so DO NOT SEND ETH TO THIS CONTRACT.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/GraphTokenLockWallet.sol\":\"GraphTokenLockWallet\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/math/SafeMath.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Wrappers over Solidity's arithmetic operations with added overflow\\n * checks.\\n *\\n * Arithmetic operations in Solidity wrap on overflow. This can easily result\\n * in bugs, because programmers usually assume that an overflow raises an\\n * error, which is the standard behavior in high level programming languages.\\n * `SafeMath` restores this intuition by reverting the transaction when an\\n * operation overflows.\\n *\\n * Using this library instead of the unchecked operations eliminates an entire\\n * class of bugs, so it's recommended to use it always.\\n */\\nlibrary SafeMath {\\n /**\\n * @dev Returns the addition of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n uint256 c = a + b;\\n if (c < a) return (false, 0);\\n return (true, c);\\n }\\n\\n /**\\n * @dev Returns the substraction of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b > a) return (false, 0);\\n return (true, a - b);\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\\n if (a == 0) return (true, 0);\\n uint256 c = a * b;\\n if (c / a != b) return (false, 0);\\n return (true, c);\\n }\\n\\n /**\\n * @dev Returns the division of two unsigned integers, with a division by zero flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b == 0) return (false, 0);\\n return (true, a / b);\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b == 0) return (false, 0);\\n return (true, a % b);\\n }\\n\\n /**\\n * @dev Returns the addition of two unsigned integers, reverting on\\n * overflow.\\n *\\n * Counterpart to Solidity's `+` operator.\\n *\\n * Requirements:\\n *\\n * - Addition cannot overflow.\\n */\\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\\n uint256 c = a + b;\\n require(c >= a, \\\"SafeMath: addition overflow\\\");\\n return c;\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting on\\n * overflow (when the result is negative).\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n *\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b <= a, \\\"SafeMath: subtraction overflow\\\");\\n return a - b;\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, reverting on\\n * overflow.\\n *\\n * Counterpart to Solidity's `*` operator.\\n *\\n * Requirements:\\n *\\n * - Multiplication cannot overflow.\\n */\\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\\n if (a == 0) return 0;\\n uint256 c = a * b;\\n require(c / a == b, \\\"SafeMath: multiplication overflow\\\");\\n return c;\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers, reverting on\\n * division by zero. The result is rounded towards zero.\\n *\\n * Counterpart to Solidity's `/` operator. Note: this function uses a\\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\\n * uses an invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b > 0, \\\"SafeMath: division by zero\\\");\\n return a / b;\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * reverting when dividing by zero.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b > 0, \\\"SafeMath: modulo by zero\\\");\\n return a % b;\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\\n * overflow (when the result is negative).\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {trySub}.\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n *\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b <= a, errorMessage);\\n return a - b;\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers, reverting with custom message on\\n * division by zero. The result is rounded towards zero.\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {tryDiv}.\\n *\\n * Counterpart to Solidity's `/` operator. Note: this function uses a\\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\\n * uses an invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b > 0, errorMessage);\\n return a / b;\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * reverting with custom message when dividing by zero.\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {tryMod}.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b > 0, errorMessage);\\n return a % b;\\n }\\n}\\n\",\"keccak256\":\"0xcc78a17dd88fa5a2edc60c8489e2f405c0913b377216a5b26b35656b2d0dab52\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `recipient`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address recipient, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `sender` to `recipient` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n}\\n\",\"keccak256\":\"0x5f02220344881ce43204ae4a6281145a67bc52c2bb1290a791857df3d19d78f5\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\nimport \\\"./IERC20.sol\\\";\\nimport \\\"../../math/SafeMath.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @title SafeERC20\\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\\n * contract returns false). Tokens that return no value (and instead revert or\\n * throw on failure) are also supported, non-reverting calls are assumed to be\\n * successful.\\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\n */\\nlibrary SafeERC20 {\\n using SafeMath for uint256;\\n using Address for address;\\n\\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\\n }\\n\\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\\n }\\n\\n /**\\n * @dev Deprecated. This function has issues similar to the ones found in\\n * {IERC20-approve}, and its usage is discouraged.\\n *\\n * Whenever possible, use {safeIncreaseAllowance} and\\n * {safeDecreaseAllowance} instead.\\n */\\n function safeApprove(IERC20 token, address spender, uint256 value) internal {\\n // safeApprove should only be called when setting an initial allowance,\\n // or when resetting it to zero. To increase and decrease it, use\\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\\n // solhint-disable-next-line max-line-length\\n require((value == 0) || (token.allowance(address(this), spender) == 0),\\n \\\"SafeERC20: approve from non-zero to non-zero allowance\\\"\\n );\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\\n }\\n\\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n uint256 newAllowance = token.allowance(address(this), spender).add(value);\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n uint256 newAllowance = token.allowance(address(this), spender).sub(value, \\\"SafeERC20: decreased allowance below zero\\\");\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n */\\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that\\n // the target address contains contract code and also asserts for success in the low-level call.\\n\\n bytes memory returndata = address(token).functionCall(data, \\\"SafeERC20: low-level call failed\\\");\\n if (returndata.length > 0) { // Return data is optional\\n // solhint-disable-next-line max-line-length\\n require(abi.decode(returndata, (bool)), \\\"SafeERC20: ERC20 operation did not succeed\\\");\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf12dfbe97e6276980b83d2830bb0eb75e0cf4f3e626c2471137f82158ae6a0fc\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.2 <0.8.0;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize, which returns 0 for contracts in\\n // construction, since the code is only stored at the end of the\\n // constructor execution.\\n\\n uint256 size;\\n // solhint-disable-next-line no-inline-assembly\\n assembly { size := extcodesize(account) }\\n return size > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls, avoid-call-value\\n (bool success, ) = recipient.call{ value: amount }(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain`call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.call{ value: value }(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x28911e614500ae7c607a432a709d35da25f3bc5ddc8bd12b278b66358070c0ea\",\"license\":\"MIT\"},\"contracts/GraphTokenLock.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nimport \\\"@openzeppelin/contracts/math/SafeMath.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\\\";\\n\\nimport { Ownable as OwnableInitializable } from \\\"./Ownable.sol\\\";\\nimport \\\"./MathUtils.sol\\\";\\nimport \\\"./IGraphTokenLock.sol\\\";\\n\\n/**\\n * @title GraphTokenLock\\n * @notice Contract that manages an unlocking schedule of tokens.\\n * @dev The contract lock manage a number of tokens deposited into the contract to ensure that\\n * they can only be released under certain time conditions.\\n *\\n * This contract implements a release scheduled based on periods and tokens are released in steps\\n * after each period ends. It can be configured with one period in which case it is like a plain TimeLock.\\n * It also supports revocation to be used for vesting schedules.\\n *\\n * The contract supports receiving extra funds than the managed tokens ones that can be\\n * withdrawn by the beneficiary at any time.\\n *\\n * A releaseStartTime parameter is included to override the default release schedule and\\n * perform the first release on the configured time. After that it will continue with the\\n * default schedule.\\n */\\nabstract contract GraphTokenLock is OwnableInitializable, IGraphTokenLock {\\n using SafeMath for uint256;\\n using SafeERC20 for IERC20;\\n\\n uint256 private constant MIN_PERIOD = 1;\\n\\n // -- State --\\n\\n IERC20 public token;\\n address public beneficiary;\\n\\n // Configuration\\n\\n // Amount of tokens managed by the contract schedule\\n uint256 public managedAmount;\\n\\n uint256 public startTime; // Start datetime (in unixtimestamp)\\n uint256 public endTime; // Datetime after all funds are fully vested/unlocked (in unixtimestamp)\\n uint256 public periods; // Number of vesting/release periods\\n\\n // First release date for tokens (in unixtimestamp)\\n // If set, no tokens will be released before releaseStartTime ignoring\\n // the amount to release each period\\n uint256 public releaseStartTime;\\n // A cliff set a date to which a beneficiary needs to get to vest\\n // all preceding periods\\n uint256 public vestingCliffTime;\\n Revocability public revocable; // Whether to use vesting for locked funds\\n\\n // State\\n\\n bool public isRevoked;\\n bool public isInitialized;\\n bool public isAccepted;\\n uint256 public releasedAmount;\\n uint256 public revokedAmount;\\n\\n // -- Events --\\n\\n event TokensReleased(address indexed beneficiary, uint256 amount);\\n event TokensWithdrawn(address indexed beneficiary, uint256 amount);\\n event TokensRevoked(address indexed beneficiary, uint256 amount);\\n event BeneficiaryChanged(address newBeneficiary);\\n event LockAccepted();\\n event LockCanceled();\\n\\n /**\\n * @dev Only allow calls from the beneficiary of the contract\\n */\\n modifier onlyBeneficiary() {\\n require(msg.sender == beneficiary, \\\"!auth\\\");\\n _;\\n }\\n\\n /**\\n * @notice Initializes the contract\\n * @param _owner Address of the contract owner\\n * @param _beneficiary Address of the beneficiary of locked tokens\\n * @param _managedAmount Amount of tokens to be managed by the lock contract\\n * @param _startTime Start time of the release schedule\\n * @param _endTime End time of the release schedule\\n * @param _periods Number of periods between start time and end time\\n * @param _releaseStartTime Override time for when the releases start\\n * @param _vestingCliffTime Override time for when the vesting start\\n * @param _revocable Whether the contract is revocable\\n */\\n function _initialize(\\n address _owner,\\n address _beneficiary,\\n address _token,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n Revocability _revocable\\n ) internal {\\n require(!isInitialized, \\\"Already initialized\\\");\\n require(_owner != address(0), \\\"Owner cannot be zero\\\");\\n require(_beneficiary != address(0), \\\"Beneficiary cannot be zero\\\");\\n require(_token != address(0), \\\"Token cannot be zero\\\");\\n require(_managedAmount > 0, \\\"Managed tokens cannot be zero\\\");\\n require(_startTime != 0, \\\"Start time must be set\\\");\\n require(_startTime < _endTime, \\\"Start time > end time\\\");\\n require(_periods >= MIN_PERIOD, \\\"Periods cannot be below minimum\\\");\\n require(_revocable != Revocability.NotSet, \\\"Must set a revocability option\\\");\\n require(_releaseStartTime < _endTime, \\\"Release start time must be before end time\\\");\\n require(_vestingCliffTime < _endTime, \\\"Cliff time must be before end time\\\");\\n\\n isInitialized = true;\\n\\n OwnableInitializable._initialize(_owner);\\n beneficiary = _beneficiary;\\n token = IERC20(_token);\\n\\n managedAmount = _managedAmount;\\n\\n startTime = _startTime;\\n endTime = _endTime;\\n periods = _periods;\\n\\n // Optionals\\n releaseStartTime = _releaseStartTime;\\n vestingCliffTime = _vestingCliffTime;\\n revocable = _revocable;\\n }\\n\\n /**\\n * @notice Change the beneficiary of funds managed by the contract\\n * @dev Can only be called by the beneficiary\\n * @param _newBeneficiary Address of the new beneficiary address\\n */\\n function changeBeneficiary(address _newBeneficiary) external onlyBeneficiary {\\n require(_newBeneficiary != address(0), \\\"Empty beneficiary\\\");\\n beneficiary = _newBeneficiary;\\n emit BeneficiaryChanged(_newBeneficiary);\\n }\\n\\n /**\\n * @notice Beneficiary accepts the lock, the owner cannot retrieve back the tokens\\n * @dev Can only be called by the beneficiary\\n */\\n function acceptLock() external onlyBeneficiary {\\n isAccepted = true;\\n emit LockAccepted();\\n }\\n\\n /**\\n * @notice Owner cancel the lock and return the balance in the contract\\n * @dev Can only be called by the owner\\n */\\n function cancelLock() external onlyOwner {\\n require(isAccepted == false, \\\"Cannot cancel accepted contract\\\");\\n\\n token.safeTransfer(owner(), currentBalance());\\n\\n emit LockCanceled();\\n }\\n\\n // -- Balances --\\n\\n /**\\n * @notice Returns the amount of tokens currently held by the contract\\n * @return Tokens held in the contract\\n */\\n function currentBalance() public view override returns (uint256) {\\n return token.balanceOf(address(this));\\n }\\n\\n // -- Time & Periods --\\n\\n /**\\n * @notice Returns the current block timestamp\\n * @return Current block timestamp\\n */\\n function currentTime() public view override returns (uint256) {\\n return block.timestamp;\\n }\\n\\n /**\\n * @notice Gets duration of contract from start to end in seconds\\n * @return Amount of seconds from contract startTime to endTime\\n */\\n function duration() public view override returns (uint256) {\\n return endTime.sub(startTime);\\n }\\n\\n /**\\n * @notice Gets time elapsed since the start of the contract\\n * @dev Returns zero if called before conctract starTime\\n * @return Seconds elapsed from contract startTime\\n */\\n function sinceStartTime() public view override returns (uint256) {\\n uint256 current = currentTime();\\n if (current <= startTime) {\\n return 0;\\n }\\n return current.sub(startTime);\\n }\\n\\n /**\\n * @notice Returns amount available to be released after each period according to schedule\\n * @return Amount of tokens available after each period\\n */\\n function amountPerPeriod() public view override returns (uint256) {\\n return managedAmount.div(periods);\\n }\\n\\n /**\\n * @notice Returns the duration of each period in seconds\\n * @return Duration of each period in seconds\\n */\\n function periodDuration() public view override returns (uint256) {\\n return duration().div(periods);\\n }\\n\\n /**\\n * @notice Gets the current period based on the schedule\\n * @return A number that represents the current period\\n */\\n function currentPeriod() public view override returns (uint256) {\\n return sinceStartTime().div(periodDuration()).add(MIN_PERIOD);\\n }\\n\\n /**\\n * @notice Gets the number of periods that passed since the first period\\n * @return A number of periods that passed since the schedule started\\n */\\n function passedPeriods() public view override returns (uint256) {\\n return currentPeriod().sub(MIN_PERIOD);\\n }\\n\\n // -- Locking & Release Schedule --\\n\\n /**\\n * @notice Gets the currently available token according to the schedule\\n * @dev Implements the step-by-step schedule based on periods for available tokens\\n * @return Amount of tokens available according to the schedule\\n */\\n function availableAmount() public view override returns (uint256) {\\n uint256 current = currentTime();\\n\\n // Before contract start no funds are available\\n if (current < startTime) {\\n return 0;\\n }\\n\\n // After contract ended all funds are available\\n if (current > endTime) {\\n return managedAmount;\\n }\\n\\n // Get available amount based on period\\n return passedPeriods().mul(amountPerPeriod());\\n }\\n\\n /**\\n * @notice Gets the amount of currently vested tokens\\n * @dev Similar to available amount, but is fully vested when contract is non-revocable\\n * @return Amount of tokens already vested\\n */\\n function vestedAmount() public view override returns (uint256) {\\n // If non-revocable it is fully vested\\n if (revocable == Revocability.Disabled) {\\n return managedAmount;\\n }\\n\\n // Vesting cliff is activated and it has not passed means nothing is vested yet\\n if (vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\\n return 0;\\n }\\n\\n return availableAmount();\\n }\\n\\n /**\\n * @notice Gets tokens currently available for release\\n * @dev Considers the schedule and takes into account already released tokens\\n * @return Amount of tokens ready to be released\\n */\\n function releasableAmount() public view virtual override returns (uint256) {\\n // If a release start time is set no tokens are available for release before this date\\n // If not set it follows the default schedule and tokens are available on\\n // the first period passed\\n if (releaseStartTime > 0 && currentTime() < releaseStartTime) {\\n return 0;\\n }\\n\\n // Vesting cliff is activated and it has not passed means nothing is vested yet\\n // so funds cannot be released\\n if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\\n return 0;\\n }\\n\\n // A beneficiary can never have more releasable tokens than the contract balance\\n uint256 releasable = availableAmount().sub(releasedAmount);\\n return MathUtils.min(currentBalance(), releasable);\\n }\\n\\n /**\\n * @notice Gets the outstanding amount yet to be released based on the whole contract lifetime\\n * @dev Does not consider schedule but just global amounts tracked\\n * @return Amount of outstanding tokens for the lifetime of the contract\\n */\\n function totalOutstandingAmount() public view override returns (uint256) {\\n return managedAmount.sub(releasedAmount).sub(revokedAmount);\\n }\\n\\n /**\\n * @notice Gets surplus amount in the contract based on outstanding amount to release\\n * @dev All funds over outstanding amount is considered surplus that can be withdrawn by beneficiary.\\n * Note this might not be the correct value for wallets transferred to L2 (i.e. an L2GraphTokenLockWallet), as the released amount will be\\n * skewed, so the beneficiary might have to bridge back to L1 to release the surplus.\\n * @return Amount of tokens considered as surplus\\n */\\n function surplusAmount() public view override returns (uint256) {\\n uint256 balance = currentBalance();\\n uint256 outstandingAmount = totalOutstandingAmount();\\n if (balance > outstandingAmount) {\\n return balance.sub(outstandingAmount);\\n }\\n return 0;\\n }\\n\\n // -- Value Transfer --\\n\\n /**\\n * @notice Releases tokens based on the configured schedule\\n * @dev All available releasable tokens are transferred to beneficiary\\n */\\n function release() external override onlyBeneficiary {\\n uint256 amountToRelease = releasableAmount();\\n require(amountToRelease > 0, \\\"No available releasable amount\\\");\\n\\n releasedAmount = releasedAmount.add(amountToRelease);\\n\\n token.safeTransfer(beneficiary, amountToRelease);\\n\\n emit TokensReleased(beneficiary, amountToRelease);\\n }\\n\\n /**\\n * @notice Withdraws surplus, unmanaged tokens from the contract\\n * @dev Tokens in the contract over outstanding amount are considered as surplus\\n * @param _amount Amount of tokens to withdraw\\n */\\n function withdrawSurplus(uint256 _amount) external override onlyBeneficiary {\\n require(_amount > 0, \\\"Amount cannot be zero\\\");\\n require(surplusAmount() >= _amount, \\\"Amount requested > surplus available\\\");\\n\\n token.safeTransfer(beneficiary, _amount);\\n\\n emit TokensWithdrawn(beneficiary, _amount);\\n }\\n\\n /**\\n * @notice Revokes a vesting schedule and return the unvested tokens to the owner\\n * @dev Vesting schedule is always calculated based on managed tokens\\n */\\n function revoke() external override onlyOwner {\\n require(revocable == Revocability.Enabled, \\\"Contract is non-revocable\\\");\\n require(isRevoked == false, \\\"Already revoked\\\");\\n\\n uint256 unvestedAmount = managedAmount.sub(vestedAmount());\\n require(unvestedAmount > 0, \\\"No available unvested amount\\\");\\n\\n revokedAmount = unvestedAmount;\\n isRevoked = true;\\n\\n token.safeTransfer(owner(), unvestedAmount);\\n\\n emit TokensRevoked(beneficiary, unvestedAmount);\\n }\\n}\\n\",\"keccak256\":\"0xd89470956a476c2fcf4a09625775573f95ba2c60a57fe866d90f65de1bcf5f2d\",\"license\":\"MIT\"},\"contracts/GraphTokenLockWallet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"@openzeppelin/contracts/math/SafeMath.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nimport \\\"./GraphTokenLock.sol\\\";\\nimport \\\"./IGraphTokenLockManager.sol\\\";\\n\\n/**\\n * @title GraphTokenLockWallet\\n * @notice This contract is built on top of the base GraphTokenLock functionality.\\n * It allows wallet beneficiaries to use the deposited funds to perform specific function calls\\n * on specific contracts.\\n *\\n * The idea is that supporters with locked tokens can participate in the protocol\\n * but disallow any release before the vesting/lock schedule.\\n * The beneficiary can issue authorized function calls to this contract that will\\n * get forwarded to a target contract. A target contract is any of our protocol contracts.\\n * The function calls allowed are queried to the GraphTokenLockManager, this way\\n * the same configuration can be shared for all the created lock wallet contracts.\\n *\\n * NOTE: Contracts used as target must have its function signatures checked to avoid collisions\\n * with any of this contract functions.\\n * Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience\\n * the maximum amount of tokens is authorized.\\n * Function calls do not forward ETH value so DO NOT SEND ETH TO THIS CONTRACT.\\n */\\ncontract GraphTokenLockWallet is GraphTokenLock {\\n using SafeMath for uint256;\\n\\n // -- State --\\n\\n IGraphTokenLockManager public manager;\\n uint256 public usedAmount;\\n\\n // -- Events --\\n\\n event ManagerUpdated(address indexed _oldManager, address indexed _newManager);\\n event TokenDestinationsApproved();\\n event TokenDestinationsRevoked();\\n\\n // Initializer\\n function initialize(\\n address _manager,\\n address _owner,\\n address _beneficiary,\\n address _token,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n Revocability _revocable\\n ) external {\\n _initialize(\\n _owner,\\n _beneficiary,\\n _token,\\n _managedAmount,\\n _startTime,\\n _endTime,\\n _periods,\\n _releaseStartTime,\\n _vestingCliffTime,\\n _revocable\\n );\\n _setManager(_manager);\\n }\\n\\n // -- Admin --\\n\\n /**\\n * @notice Sets a new manager for this contract\\n * @param _newManager Address of the new manager\\n */\\n function setManager(address _newManager) external onlyOwner {\\n _setManager(_newManager);\\n }\\n\\n /**\\n * @dev Sets a new manager for this contract\\n * @param _newManager Address of the new manager\\n */\\n function _setManager(address _newManager) internal {\\n require(_newManager != address(0), \\\"Manager cannot be empty\\\");\\n require(Address.isContract(_newManager), \\\"Manager must be a contract\\\");\\n\\n address oldManager = address(manager);\\n manager = IGraphTokenLockManager(_newManager);\\n\\n emit ManagerUpdated(oldManager, _newManager);\\n }\\n\\n // -- Beneficiary --\\n\\n /**\\n * @notice Approves protocol access of the tokens managed by this contract\\n * @dev Approves all token destinations registered in the manager to pull tokens\\n */\\n function approveProtocol() external onlyBeneficiary {\\n address[] memory dstList = manager.getTokenDestinations();\\n for (uint256 i = 0; i < dstList.length; i++) {\\n // Note this is only safe because we are using the max uint256 value\\n token.approve(dstList[i], type(uint256).max);\\n }\\n emit TokenDestinationsApproved();\\n }\\n\\n /**\\n * @notice Revokes protocol access of the tokens managed by this contract\\n * @dev Revokes approval to all token destinations in the manager to pull tokens\\n */\\n function revokeProtocol() external onlyBeneficiary {\\n address[] memory dstList = manager.getTokenDestinations();\\n for (uint256 i = 0; i < dstList.length; i++) {\\n // Note this is only safe cause we're using 0 as the amount\\n token.approve(dstList[i], 0);\\n }\\n emit TokenDestinationsRevoked();\\n }\\n\\n /**\\n * @notice Gets tokens currently available for release\\n * @dev Considers the schedule, takes into account already released tokens and used amount\\n * @return Amount of tokens ready to be released\\n */\\n function releasableAmount() public view override returns (uint256) {\\n if (revocable == Revocability.Disabled) {\\n return super.releasableAmount();\\n }\\n\\n // -- Revocability enabled logic\\n // This needs to deal with additional considerations for when tokens are used in the protocol\\n\\n // If a release start time is set no tokens are available for release before this date\\n // If not set it follows the default schedule and tokens are available on\\n // the first period passed\\n if (releaseStartTime > 0 && currentTime() < releaseStartTime) {\\n return 0;\\n }\\n\\n // Vesting cliff is activated and it has not passed means nothing is vested yet\\n // so funds cannot be released\\n if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\\n return 0;\\n }\\n\\n // A beneficiary can never have more releasable tokens than the contract balance\\n // We consider the `usedAmount` in the protocol as part of the calculations\\n // the beneficiary should not release funds that are used.\\n uint256 releasable = availableAmount().sub(releasedAmount).sub(usedAmount);\\n return MathUtils.min(currentBalance(), releasable);\\n }\\n\\n /**\\n * @notice Forward authorized contract calls to protocol contracts\\n * @dev Fallback function can be called by the beneficiary only if function call is allowed\\n */\\n // solhint-disable-next-line no-complex-fallback\\n fallback() external payable {\\n // Only beneficiary can forward calls\\n require(msg.sender == beneficiary, \\\"Unauthorized caller\\\");\\n require(msg.value == 0, \\\"ETH transfers not supported\\\");\\n\\n // Function call validation\\n address _target = manager.getAuthFunctionCallTarget(msg.sig);\\n require(_target != address(0), \\\"Unauthorized function\\\");\\n\\n uint256 oldBalance = currentBalance();\\n\\n // Call function with data\\n Address.functionCall(_target, msg.data);\\n\\n // Tracked used tokens in the protocol\\n // We do this check after balances were updated by the forwarded call\\n // Check is only enforced for revocable contracts to save some gas\\n if (revocable == Revocability.Enabled) {\\n // Track contract balance change\\n uint256 newBalance = currentBalance();\\n if (newBalance < oldBalance) {\\n // Outflow\\n uint256 diff = oldBalance.sub(newBalance);\\n usedAmount = usedAmount.add(diff);\\n } else {\\n // Inflow: We can receive profits from the protocol, that could make usedAmount to\\n // underflow. We set it to zero in that case.\\n uint256 diff = newBalance.sub(oldBalance);\\n usedAmount = (diff >= usedAmount) ? 0 : usedAmount.sub(diff);\\n }\\n require(usedAmount <= vestedAmount(), \\\"Cannot use more tokens than vested amount\\\");\\n }\\n }\\n\\n /**\\n * @notice Receive function that always reverts.\\n * @dev Only included to supress warnings, see https://github.com/ethereum/solidity/issues/10159\\n */\\n receive() external payable {\\n revert(\\\"Bad call\\\");\\n }\\n}\\n\",\"keccak256\":\"0x976c2ba4c1503a81ea02bd84539c516e99af611ff767968ee25456b50a6deb7b\",\"license\":\"MIT\"},\"contracts/IGraphTokenLock.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\ninterface IGraphTokenLock {\\n enum Revocability {\\n NotSet,\\n Enabled,\\n Disabled\\n }\\n\\n // -- Balances --\\n\\n function currentBalance() external view returns (uint256);\\n\\n // -- Time & Periods --\\n\\n function currentTime() external view returns (uint256);\\n\\n function duration() external view returns (uint256);\\n\\n function sinceStartTime() external view returns (uint256);\\n\\n function amountPerPeriod() external view returns (uint256);\\n\\n function periodDuration() external view returns (uint256);\\n\\n function currentPeriod() external view returns (uint256);\\n\\n function passedPeriods() external view returns (uint256);\\n\\n // -- Locking & Release Schedule --\\n\\n function availableAmount() external view returns (uint256);\\n\\n function vestedAmount() external view returns (uint256);\\n\\n function releasableAmount() external view returns (uint256);\\n\\n function totalOutstandingAmount() external view returns (uint256);\\n\\n function surplusAmount() external view returns (uint256);\\n\\n // -- Value Transfer --\\n\\n function release() external;\\n\\n function withdrawSurplus(uint256 _amount) external;\\n\\n function revoke() external;\\n}\\n\",\"keccak256\":\"0xceb9d258276fe25ec858191e1deae5778f1b2f612a669fb7b37bab1a064756ab\",\"license\":\"MIT\"},\"contracts/IGraphTokenLockManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nimport \\\"./IGraphTokenLock.sol\\\";\\n\\ninterface IGraphTokenLockManager {\\n // -- Factory --\\n\\n function setMasterCopy(address _masterCopy) external;\\n\\n function createTokenLockWallet(\\n address _owner,\\n address _beneficiary,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n IGraphTokenLock.Revocability _revocable\\n ) external;\\n\\n // -- Funds Management --\\n\\n function token() external returns (IERC20);\\n\\n function deposit(uint256 _amount) external;\\n\\n function withdraw(uint256 _amount) external;\\n\\n // -- Allowed Funds Destinations --\\n\\n function addTokenDestination(address _dst) external;\\n\\n function removeTokenDestination(address _dst) external;\\n\\n function isTokenDestination(address _dst) external view returns (bool);\\n\\n function getTokenDestinations() external view returns (address[] memory);\\n\\n // -- Function Call Authorization --\\n\\n function setAuthFunctionCall(string calldata _signature, address _target) external;\\n\\n function unsetAuthFunctionCall(string calldata _signature) external;\\n\\n function setAuthFunctionCallMany(string[] calldata _signatures, address[] calldata _targets) external;\\n\\n function getAuthFunctionCallTarget(bytes4 _sigHash) external view returns (address);\\n\\n function isAuthFunctionCall(bytes4 _sigHash) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x2d78d41909a6de5b316ac39b100ea087a8f317cf306379888a045523e15c4d9a\",\"license\":\"MIT\"},\"contracts/MathUtils.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nlibrary MathUtils {\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n}\\n\",\"keccak256\":\"0xe2512e1da48bc8363acd15f66229564b02d66706665d7da740604566913c1400\",\"license\":\"MIT\"},\"contracts/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * The owner account will be passed on initialization of the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\ncontract Ownable {\\n /// @dev Owner of the contract, can be retrieved with the public owner() function\\n address private _owner;\\n /// @dev Since upgradeable contracts might inherit this, we add a storage gap\\n /// to allow adding variables here without breaking the proxy storage layout\\n uint256[50] private __gap;\\n\\n /// @dev Emitted when ownership of the contract is transferred\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n function _initialize(address owner) internal {\\n _owner = owner;\\n emit OwnershipTransferred(address(0), owner);\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(_owner == msg.sender, \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() external virtual onlyOwner {\\n emit OwnershipTransferred(_owner, address(0));\\n _owner = address(0);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) external virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n emit OwnershipTransferred(_owner, newOwner);\\n _owner = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0xe8750687082e8e24b620dbf58c3a08eee591ed7b4d5a3e13cc93554ec647fd09\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b506146bb806100206000396000f3fe6080604052600436106102555760003560e01c806386d00e0211610139578063bc0163c1116100b6578063dc0706571161007a578063dc07065714610b93578063e8dda6f514610bbc578063e97d87d514610be7578063ebbab99214610c12578063f2fde38b14610c3d578063fc0c546a14610c6657610295565b8063bc0163c114610ac0578063bd896dcb14610aeb578063ce845d1d14610b14578063d0ebdbe714610b3f578063d18e81b314610b6857610295565b806391f7cfb9116100fd57806391f7cfb9146109ff578063a4caeb4214610a2a578063b0d1818c14610a55578063b470aade14610a7e578063b6549f7514610aa957610295565b806386d00e021461095057806386d1a69f1461097b578063872a7810146109925780638a5bdf5c146109bd5780638da5cb5b146109d457610295565b8063392e53cd116101d25780635051a5ec116101965780635051a5ec146108765780635b940081146108a157806360e79944146108cc578063715018a6146108e357806378e97925146108fa5780637bdf05af1461092557610295565b8063392e53cd1461079f578063398057a3146107ca57806344b1231f146107f557806345d30a1714610820578063481c6a751461084b57610295565b80632a627814116102195780632a627814146106dc5780632bc9ed02146106f35780633197cbb61461071e57806337aeb0861461074957806338af3eed1461077457610295565b8063029c6c9f1461061957806306040618146106445780630b80f7771461066f5780630dff24d5146106865780630fb5a6b4146106b157610295565b36610295576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161028c90613fb9565b60405180910390fd5b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610325576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161031c90614199565b60405180910390fd5b60003414610368576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161035f90613fd9565b60405180910390fd5b6000603e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f1d24c456000357fffffffff00000000000000000000000000000000000000000000000000000000166040518263ffffffff1660e01b81526004016103e99190613f2b565b60206040518083038186803b15801561040157600080fd5b505afa158015610415573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061043991906131a5565b9050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156104ab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104a290614299565b60405180910390fd5b60006104b5610c91565b9050610506826000368080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610d43565b506001600281111561051457fe5b603b60009054906101000a900460ff16600281111561052f57fe5b141561061557600061053f610c91565b90508181101561058157600061055e8284610d8d90919063ffffffff16565b905061057581603f54610ddd90919063ffffffff16565b603f81905550506105c7565b60006105968383610d8d90919063ffffffff16565b9050603f548110156105bc576105b781603f54610d8d90919063ffffffff16565b6105bf565b60005b603f81905550505b6105cf610e32565b603f541115610613576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161060a906141f9565b60405180910390fd5b505b5050005b34801561062557600080fd5b5061062e610ea1565b60405161063b9190614439565b60405180910390f35b34801561065057600080fd5b50610659610ebf565b6040516106669190614439565b60405180910390f35b34801561067b57600080fd5b50610684610efa565b005b34801561069257600080fd5b5061069b611067565b6040516106a89190614439565b60405180910390f35b3480156106bd57600080fd5b506106c66110ae565b6040516106d39190614439565b60405180910390f35b3480156106e857600080fd5b506106f16110cc565b005b3480156106ff57600080fd5b50610708611331565b6040516107159190613f10565b60405180910390f35b34801561072a57600080fd5b50610733611344565b6040516107409190614439565b60405180910390f35b34801561075557600080fd5b5061075e61134a565b60405161076b9190614439565b60405180910390f35b34801561078057600080fd5b50610789611350565b6040516107969190613ea3565b60405180910390f35b3480156107ab57600080fd5b506107b4611376565b6040516107c19190613f10565b60405180910390f35b3480156107d657600080fd5b506107df611389565b6040516107ec9190614439565b60405180910390f35b34801561080157600080fd5b5061080a610e32565b6040516108179190614439565b60405180910390f35b34801561082c57600080fd5b5061083561138f565b6040516108429190614439565b60405180910390f35b34801561085757600080fd5b50610860611395565b60405161086d9190613f61565b60405180910390f35b34801561088257600080fd5b5061088b6113bb565b6040516108989190613f10565b60405180910390f35b3480156108ad57600080fd5b506108b66113ce565b6040516108c39190614439565b60405180910390f35b3480156108d857600080fd5b506108e16114d9565b005b3480156108ef57600080fd5b506108f861171f565b005b34801561090657600080fd5b5061090f61186b565b60405161091c9190614439565b60405180910390f35b34801561093157600080fd5b5061093a611871565b6040516109479190614439565b60405180910390f35b34801561095c57600080fd5b506109656118ad565b6040516109729190614439565b60405180910390f35b34801561098757600080fd5b506109906118b3565b005b34801561099e57600080fd5b506109a7611a8f565b6040516109b49190613f7c565b60405180910390f35b3480156109c957600080fd5b506109d2611aa2565b005b3480156109e057600080fd5b506109e9611b7b565b6040516109f69190613ea3565b60405180910390f35b348015610a0b57600080fd5b50610a14611ba4565b604051610a219190614439565b60405180910390f35b348015610a3657600080fd5b50610a3f611c02565b604051610a4c9190614439565b60405180910390f35b348015610a6157600080fd5b50610a7c6004803603810190610a779190613328565b611c08565b005b348015610a8a57600080fd5b50610a93611e07565b604051610aa09190614439565b60405180910390f35b348015610ab557600080fd5b50610abe611e2a565b005b348015610acc57600080fd5b50610ad56120c2565b604051610ae29190614439565b60405180910390f35b348015610af757600080fd5b50610b126004803603810190610b0d91906131ce565b6120f4565b005b348015610b2057600080fd5b50610b29610c91565b604051610b369190614439565b60405180910390f35b348015610b4b57600080fd5b50610b666004803603810190610b61919061317c565b61211c565b005b348015610b7457600080fd5b50610b7d6121b6565b604051610b8a9190614439565b60405180910390f35b348015610b9f57600080fd5b50610bba6004803603810190610bb5919061317c565b6121be565b005b348015610bc857600080fd5b50610bd1612339565b604051610bde9190614439565b60405180910390f35b348015610bf357600080fd5b50610bfc61233f565b604051610c099190614439565b60405180910390f35b348015610c1e57600080fd5b50610c27612345565b604051610c349190614439565b60405180910390f35b348015610c4957600080fd5b50610c646004803603810190610c5f919061317c565b612367565b005b348015610c7257600080fd5b50610c7b612522565b604051610c889190613f46565b60405180910390f35b6000603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610cee9190613ea3565b60206040518083038186803b158015610d0657600080fd5b505afa158015610d1a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d3e9190613351565b905090565b6060610d8583836040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c65640000815250612548565b905092915050565b600082821115610dd2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dc9906140f9565b60405180910390fd5b818303905092915050565b600080828401905083811015610e28576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e1f90614079565b60405180910390fd5b8091505092915050565b6000600280811115610e4057fe5b603b60009054906101000a900460ff166002811115610e5b57fe5b1415610e6b576035549050610e9e565b6000603a54118015610e855750603a54610e836121b6565b105b15610e935760009050610e9e565b610e9b611ba4565b90505b90565b6000610eba60385460355461256090919063ffffffff16565b905090565b6000610ef56001610ee7610ed1611e07565b610ed9611871565b61256090919063ffffffff16565b610ddd90919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f88576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f7f90614259565b60405180910390fd5b60001515603b60039054906101000a900460ff16151514610fde576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fd5906140d9565b60405180910390fd5b611039610fe9611b7b565b610ff1610c91565b603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166125b69092919063ffffffff16565b7f171f0bcbda3370351cea17f3b164bee87d77c2503b94abdf2720a814ebe7e9df60405160405180910390a1565b600080611072610c91565b9050600061107e6120c2565b9050808211156110a45761109b8183610d8d90919063ffffffff16565b925050506110ab565b6000925050505b90565b60006110c7603654603754610d8d90919063ffffffff16565b905090565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461115c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115390614359565b60405180910390fd5b6060603e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a34574666040518163ffffffff1660e01b815260040160006040518083038186803b1580156111c657600080fd5b505afa1580156111da573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525081019061120391906132be565b905060005b815181101561130157603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b383838151811061125b57fe5b60200260200101517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016112a1929190613ee7565b602060405180830381600087803b1580156112bb57600080fd5b505af11580156112cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112f391906132ff565b508080600101915050611208565b507fb837fd51506ba3cc623a37c78ed22fd521f2f6e9f69a34d5c2a4a9474f27579360405160405180910390a150565b603b60019054906101000a900460ff1681565b60375481565b603d5481565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b603b60029054906101000a900460ff1681565b60355481565b603c5481565b603e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b603b60039054906101000a900460ff1681565b60006002808111156113dc57fe5b603b60009054906101000a900460ff1660028111156113f757fe5b141561140c5761140561263c565b90506114d6565b600060395411801561142657506039546114246121b6565b105b1561143457600090506114d6565b6001600281111561144157fe5b603b60009054906101000a900460ff16600281111561145c57fe5b14801561146b57506000603a54115b801561147f5750603a5461147d6121b6565b105b1561148d57600090506114d6565b60006114bf603f546114b1603c546114a3611ba4565b610d8d90919063ffffffff16565b610d8d90919063ffffffff16565b90506114d26114cc610c91565b826126f6565b9150505b90565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611569576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161156090614359565b60405180910390fd5b6060603e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a34574666040518163ffffffff1660e01b815260040160006040518083038186803b1580156115d357600080fd5b505afa1580156115e7573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525081019061161091906132be565b905060005b81518110156116ef57603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b383838151811061166857fe5b602002602001015160006040518363ffffffff1660e01b815260040161168f929190613ebe565b602060405180830381600087803b1580156116a957600080fd5b505af11580156116bd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116e191906132ff565b508080600101915050611615565b507f6d317a20ba9d790014284bef285283cd61fde92e0f2711050f563a9d2cf4171160405160405180910390a150565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146117ad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117a490614259565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60365481565b60008061187c6121b6565b905060365481116118915760009150506118aa565b6118a660365482610d8d90919063ffffffff16565b9150505b90565b603a5481565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611943576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161193a90614359565b60405180910390fd5b600061194d6113ce565b905060008111611992576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611989906143b9565b60405180910390fd5b6119a781603c54610ddd90919063ffffffff16565b603c81905550611a1c603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166125b69092919063ffffffff16565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fc7798891864187665ac6dd119286e44ec13f014527aeeb2b8eb3fd413df9317982604051611a849190614439565b60405180910390a250565b603b60009054906101000a900460ff1681565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611b32576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b2990614359565b60405180910390fd5b6001603b60036101000a81548160ff0219169083151502179055507fbeb3313724453131feb0a765a03e6715bb720e0f973a31fcbafa2d2f048c188b60405160405180910390a1565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600080611baf6121b6565b9050603654811015611bc5576000915050611bff565b603754811115611bda57603554915050611bff565b611bfb611be5610ea1565b611bed612345565b61270f90919063ffffffff16565b9150505b90565b60385481565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611c98576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c8f90614359565b60405180910390fd5b60008111611cdb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cd2906141d9565b60405180910390fd5b80611ce4611067565b1015611d25576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d1c906142d9565b60405180910390fd5b611d94603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166125b69092919063ffffffff16565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b82604051611dfc9190614439565b60405180910390a250565b6000611e25603854611e176110ae565b61256090919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611eb8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611eaf90614259565b60405180910390fd5b60016002811115611ec557fe5b603b60009054906101000a900460ff166002811115611ee057fe5b14611f20576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f1790614319565b60405180910390fd5b60001515603b60019054906101000a900460ff16151514611f76576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f6d90614419565b60405180910390fd5b6000611f94611f83610e32565b603554610d8d90919063ffffffff16565b905060008111611fd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fd090614099565b60405180910390fd5b80603d819055506001603b60016101000a81548160ff02191690831515021790555061204f612006611b7b565b82603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166125b69092919063ffffffff16565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fb73c49a3a37a7aca291ba0ceaa41657012def406106a7fc386888f0f66e941cf826040516120b79190614439565b60405180910390a250565b60006120ef603d546120e1603c54603554610d8d90919063ffffffff16565b610d8d90919063ffffffff16565b905090565b6121068a8a8a8a8a8a8a8a8a8a61277f565b61210f8b612c09565b5050505050505050505050565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146121aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121a190614259565b60405180910390fd5b6121b381612c09565b50565b600042905090565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461224e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161224590614359565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156122be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122b590614179565b60405180910390fd5b80603460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f373c72efabe4ef3e552ff77838be729f3bc3d8c586df0012902d1baa2377fa1d8160405161232e9190613ea3565b60405180910390a150565b603f5481565b60395481565b60006123626001612354610ebf565b610d8d90919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146123f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123ec90614259565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612465576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161245c90614059565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60606125578484600085612d87565b90509392505050565b60008082116125a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161259b90614159565b60405180910390fd5b8183816125ad57fe5b04905092915050565b6126378363a9059cbb60e01b84846040516024016125d5929190613ee7565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050612e9c565b505050565b60008060395411801561265757506039546126556121b6565b105b1561266557600090506126f3565b6001600281111561267257fe5b603b60009054906101000a900460ff16600281111561268d57fe5b14801561269c57506000603a54115b80156126b05750603a546126ae6121b6565b105b156126be57600090506126f3565b60006126dc603c546126ce611ba4565b610d8d90919063ffffffff16565b90506126ef6126e9610c91565b826126f6565b9150505b90565b60008183106127055781612707565b825b905092915050565b6000808314156127225760009050612779565b600082840290508284828161273357fe5b0414612774576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161276b90614239565b60405180910390fd5b809150505b92915050565b603b60029054906101000a900460ff16156127cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127c6906142f9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff16141561283f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612836906140b9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff1614156128af576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128a6906143f9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff16141561291f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612916906143d9565b60405180910390fd5b60008711612962576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161295990614139565b60405180910390fd5b60008614156129a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161299d90614279565b60405180910390fd5b8486106129e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129df90614019565b60405180910390fd5b6001841015612a2c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a2390614219565b60405180910390fd5b60006002811115612a3957fe5b816002811115612a4557fe5b1415612a86576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a7d90614039565b60405180910390fd5b848310612ac8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612abf90614379565b60405180910390fd5b848210612b0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b0190613ff9565b60405180910390fd5b6001603b60026101000a81548160ff021916908315150217905550612b2e8a612f63565b88603460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555087603360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550866035819055508560368190555084603781905550836038819055508260398190555081603a8190555080603b60006101000a81548160ff02191690836002811115612bf857fe5b021790555050505050505050505050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612c79576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c7090614339565b60405180910390fd5b612c8281613001565b612cc1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612cb8906141b9565b60405180910390fd5b6000603e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081603e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fdac3632743b879638fd2d51c4d3c1dd796615b4758a55b50b0c19b971ba9fbc760405160405180910390a35050565b606082471015612dcc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612dc390614119565b60405180910390fd5b612dd585613001565b612e14576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e0b906142b9565b60405180910390fd5b600060608673ffffffffffffffffffffffffffffffffffffffff168587604051612e3e9190613e8c565b60006040518083038185875af1925050503d8060008114612e7b576040519150601f19603f3d011682016040523d82523d6000602084013e612e80565b606091505b5091509150612e90828286613014565b92505050949350505050565b6060612efe826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166125489092919063ffffffff16565b9050600081511115612f5e5780806020019051810190612f1e91906132ff565b612f5d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612f5490614399565b60405180910390fd5b5b505050565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a350565b600080823b905060008111915050919050565b6060831561302457829050613074565b6000835111156130375782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161306b9190613f97565b60405180910390fd5b9392505050565b60008135905061308a81614630565b92915050565b60008151905061309f81614630565b92915050565b600082601f8301126130b657600080fd5b81516130c96130c482614485565b614454565b915081818352602084019350602081019050838560208402820111156130ee57600080fd5b60005b8381101561311e57816131048882613090565b8452602084019350602083019250506001810190506130f1565b5050505092915050565b60008151905061313781614647565b92915050565b60008135905061314c8161465e565b92915050565b6000813590506131618161466e565b92915050565b6000815190506131768161466e565b92915050565b60006020828403121561318e57600080fd5b600061319c8482850161307b565b91505092915050565b6000602082840312156131b757600080fd5b60006131c584828501613090565b91505092915050565b60008060008060008060008060008060006101608c8e0312156131f057600080fd5b60006131fe8e828f0161307b565b9b5050602061320f8e828f0161307b565b9a505060406132208e828f0161307b565b99505060606132318e828f0161307b565b98505060806132428e828f01613152565b97505060a06132538e828f01613152565b96505060c06132648e828f01613152565b95505060e06132758e828f01613152565b9450506101006132878e828f01613152565b9350506101206132998e828f01613152565b9250506101406132ab8e828f0161313d565b9150509295989b509295989b9093969950565b6000602082840312156132d057600080fd5b600082015167ffffffffffffffff8111156132ea57600080fd5b6132f6848285016130a5565b91505092915050565b60006020828403121561331157600080fd5b600061331f84828501613128565b91505092915050565b60006020828403121561333a57600080fd5b600061334884828501613152565b91505092915050565b60006020828403121561336357600080fd5b600061337184828501613167565b91505092915050565b613383816144e3565b82525050565b613392816144f5565b82525050565b6133a181614501565b82525050565b60006133b2826144b1565b6133bc81856144c7565b93506133cc8185602086016145d6565b80840191505092915050565b6133e18161456a565b82525050565b6133f08161458e565b82525050565b6133ff816145b2565b82525050565b61340e816145c4565b82525050565b600061341f826144bc565b61342981856144d2565b93506134398185602086016145d6565b6134428161460b565b840191505092915050565b600061345a6008836144d2565b91507f4261642063616c6c0000000000000000000000000000000000000000000000006000830152602082019050919050565b600061349a601b836144d2565b91507f455448207472616e7366657273206e6f7420737570706f7274656400000000006000830152602082019050919050565b60006134da6022836144d2565b91507f436c6966662074696d65206d757374206265206265666f726520656e6420746960008301527f6d650000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006135406015836144d2565b91507f53746172742074696d65203e20656e642074696d6500000000000000000000006000830152602082019050919050565b6000613580601e836144d2565b91507f4d757374207365742061207265766f636162696c697479206f7074696f6e00006000830152602082019050919050565b60006135c06026836144d2565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613626601b836144d2565b91507f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006000830152602082019050919050565b6000613666601c836144d2565b91507f4e6f20617661696c61626c6520756e76657374656420616d6f756e74000000006000830152602082019050919050565b60006136a66014836144d2565b91507f4f776e65722063616e6e6f74206265207a65726f0000000000000000000000006000830152602082019050919050565b60006136e6601f836144d2565b91507f43616e6e6f742063616e63656c20616363657074656420636f6e7472616374006000830152602082019050919050565b6000613726601e836144d2565b91507f536166654d6174683a207375627472616374696f6e206f766572666c6f7700006000830152602082019050919050565b60006137666026836144d2565b91507f416464726573733a20696e73756666696369656e742062616c616e636520666f60008301527f722063616c6c00000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006137cc601d836144d2565b91507f4d616e6167656420746f6b656e732063616e6e6f74206265207a65726f0000006000830152602082019050919050565b600061380c601a836144d2565b91507f536166654d6174683a206469766973696f6e206279207a65726f0000000000006000830152602082019050919050565b600061384c6011836144d2565b91507f456d7074792062656e65666963696172790000000000000000000000000000006000830152602082019050919050565b600061388c6013836144d2565b91507f556e617574686f72697a65642063616c6c6572000000000000000000000000006000830152602082019050919050565b60006138cc601a836144d2565b91507f4d616e61676572206d757374206265206120636f6e74726163740000000000006000830152602082019050919050565b600061390c6015836144d2565b91507f416d6f756e742063616e6e6f74206265207a65726f00000000000000000000006000830152602082019050919050565b600061394c6029836144d2565b91507f43616e6e6f7420757365206d6f726520746f6b656e73207468616e207665737460008301527f656420616d6f756e7400000000000000000000000000000000000000000000006020830152604082019050919050565b60006139b2601f836144d2565b91507f506572696f64732063616e6e6f742062652062656c6f77206d696e696d756d006000830152602082019050919050565b60006139f26021836144d2565b91507f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008301527f77000000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613a586020836144d2565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b6000613a986016836144d2565b91507f53746172742074696d65206d75737420626520736574000000000000000000006000830152602082019050919050565b6000613ad86015836144d2565b91507f556e617574686f72697a65642066756e6374696f6e00000000000000000000006000830152602082019050919050565b6000613b18601d836144d2565b91507f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006000830152602082019050919050565b6000613b586024836144d2565b91507f416d6f756e7420726571756573746564203e20737572706c757320617661696c60008301527f61626c65000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613bbe6013836144d2565b91507f416c726561647920696e697469616c697a6564000000000000000000000000006000830152602082019050919050565b6000613bfe6019836144d2565b91507f436f6e7472616374206973206e6f6e2d7265766f6361626c65000000000000006000830152602082019050919050565b6000613c3e6017836144d2565b91507f4d616e616765722063616e6e6f7420626520656d7074790000000000000000006000830152602082019050919050565b6000613c7e6005836144d2565b91507f21617574680000000000000000000000000000000000000000000000000000006000830152602082019050919050565b6000613cbe602a836144d2565b91507f52656c656173652073746172742074696d65206d757374206265206265666f7260008301527f6520656e642074696d65000000000000000000000000000000000000000000006020830152604082019050919050565b6000613d24602a836144d2565b91507f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008301527f6f742073756363656564000000000000000000000000000000000000000000006020830152604082019050919050565b6000613d8a601e836144d2565b91507f4e6f20617661696c61626c652072656c65617361626c6520616d6f756e7400006000830152602082019050919050565b6000613dca6014836144d2565b91507f546f6b656e2063616e6e6f74206265207a65726f0000000000000000000000006000830152602082019050919050565b6000613e0a601a836144d2565b91507f42656e65666963696172792063616e6e6f74206265207a65726f0000000000006000830152602082019050919050565b6000613e4a600f836144d2565b91507f416c7265616479207265766f6b656400000000000000000000000000000000006000830152602082019050919050565b613e8681614560565b82525050565b6000613e9882846133a7565b915081905092915050565b6000602082019050613eb8600083018461337a565b92915050565b6000604082019050613ed3600083018561337a565b613ee06020830184613405565b9392505050565b6000604082019050613efc600083018561337a565b613f096020830184613e7d565b9392505050565b6000602082019050613f256000830184613389565b92915050565b6000602082019050613f406000830184613398565b92915050565b6000602082019050613f5b60008301846133d8565b92915050565b6000602082019050613f7660008301846133e7565b92915050565b6000602082019050613f9160008301846133f6565b92915050565b60006020820190508181036000830152613fb18184613414565b905092915050565b60006020820190508181036000830152613fd28161344d565b9050919050565b60006020820190508181036000830152613ff28161348d565b9050919050565b60006020820190508181036000830152614012816134cd565b9050919050565b6000602082019050818103600083015261403281613533565b9050919050565b6000602082019050818103600083015261405281613573565b9050919050565b60006020820190508181036000830152614072816135b3565b9050919050565b6000602082019050818103600083015261409281613619565b9050919050565b600060208201905081810360008301526140b281613659565b9050919050565b600060208201905081810360008301526140d281613699565b9050919050565b600060208201905081810360008301526140f2816136d9565b9050919050565b6000602082019050818103600083015261411281613719565b9050919050565b6000602082019050818103600083015261413281613759565b9050919050565b60006020820190508181036000830152614152816137bf565b9050919050565b60006020820190508181036000830152614172816137ff565b9050919050565b600060208201905081810360008301526141928161383f565b9050919050565b600060208201905081810360008301526141b28161387f565b9050919050565b600060208201905081810360008301526141d2816138bf565b9050919050565b600060208201905081810360008301526141f2816138ff565b9050919050565b600060208201905081810360008301526142128161393f565b9050919050565b60006020820190508181036000830152614232816139a5565b9050919050565b60006020820190508181036000830152614252816139e5565b9050919050565b6000602082019050818103600083015261427281613a4b565b9050919050565b6000602082019050818103600083015261429281613a8b565b9050919050565b600060208201905081810360008301526142b281613acb565b9050919050565b600060208201905081810360008301526142d281613b0b565b9050919050565b600060208201905081810360008301526142f281613b4b565b9050919050565b6000602082019050818103600083015261431281613bb1565b9050919050565b6000602082019050818103600083015261433281613bf1565b9050919050565b6000602082019050818103600083015261435281613c31565b9050919050565b6000602082019050818103600083015261437281613c71565b9050919050565b6000602082019050818103600083015261439281613cb1565b9050919050565b600060208201905081810360008301526143b281613d17565b9050919050565b600060208201905081810360008301526143d281613d7d565b9050919050565b600060208201905081810360008301526143f281613dbd565b9050919050565b6000602082019050818103600083015261441281613dfd565b9050919050565b6000602082019050818103600083015261443281613e3d565b9050919050565b600060208201905061444e6000830184613e7d565b92915050565b6000604051905081810181811067ffffffffffffffff8211171561447b5761447a614609565b5b8060405250919050565b600067ffffffffffffffff8211156144a05761449f614609565b5b602082029050602081019050919050565b600081519050919050565b600081519050919050565b600081905092915050565b600082825260208201905092915050565b60006144ee82614540565b9050919050565b60008115159050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600081905061453b8261461c565b919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60006145758261457c565b9050919050565b600061458782614540565b9050919050565b6000614599826145a0565b9050919050565b60006145ab82614540565b9050919050565b60006145bd8261452d565b9050919050565b60006145cf82614560565b9050919050565b60005b838110156145f45780820151818401526020810190506145d9565b83811115614603576000848401525b50505050565bfe5b6000601f19601f8301169050919050565b6003811061462d5761462c614609565b5b50565b614639816144e3565b811461464457600080fd5b50565b614650816144f5565b811461465b57600080fd5b50565b6003811061466b57600080fd5b50565b61467781614560565b811461468257600080fd5b5056fea264697066735822122013f3b022e354ddf49f7a28727f309f858a5cbdf70833a2e54da3c1a482b7073164736f6c63430007030033", + "deployedBytecode": "0x6080604052600436106102555760003560e01c806386d00e0211610139578063bc0163c1116100b6578063dc0706571161007a578063dc07065714610b93578063e8dda6f514610bbc578063e97d87d514610be7578063ebbab99214610c12578063f2fde38b14610c3d578063fc0c546a14610c6657610295565b8063bc0163c114610ac0578063bd896dcb14610aeb578063ce845d1d14610b14578063d0ebdbe714610b3f578063d18e81b314610b6857610295565b806391f7cfb9116100fd57806391f7cfb9146109ff578063a4caeb4214610a2a578063b0d1818c14610a55578063b470aade14610a7e578063b6549f7514610aa957610295565b806386d00e021461095057806386d1a69f1461097b578063872a7810146109925780638a5bdf5c146109bd5780638da5cb5b146109d457610295565b8063392e53cd116101d25780635051a5ec116101965780635051a5ec146108765780635b940081146108a157806360e79944146108cc578063715018a6146108e357806378e97925146108fa5780637bdf05af1461092557610295565b8063392e53cd1461079f578063398057a3146107ca57806344b1231f146107f557806345d30a1714610820578063481c6a751461084b57610295565b80632a627814116102195780632a627814146106dc5780632bc9ed02146106f35780633197cbb61461071e57806337aeb0861461074957806338af3eed1461077457610295565b8063029c6c9f1461061957806306040618146106445780630b80f7771461066f5780630dff24d5146106865780630fb5a6b4146106b157610295565b36610295576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161028c90613fb9565b60405180910390fd5b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610325576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161031c90614199565b60405180910390fd5b60003414610368576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161035f90613fd9565b60405180910390fd5b6000603e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f1d24c456000357fffffffff00000000000000000000000000000000000000000000000000000000166040518263ffffffff1660e01b81526004016103e99190613f2b565b60206040518083038186803b15801561040157600080fd5b505afa158015610415573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061043991906131a5565b9050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156104ab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104a290614299565b60405180910390fd5b60006104b5610c91565b9050610506826000368080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610d43565b506001600281111561051457fe5b603b60009054906101000a900460ff16600281111561052f57fe5b141561061557600061053f610c91565b90508181101561058157600061055e8284610d8d90919063ffffffff16565b905061057581603f54610ddd90919063ffffffff16565b603f81905550506105c7565b60006105968383610d8d90919063ffffffff16565b9050603f548110156105bc576105b781603f54610d8d90919063ffffffff16565b6105bf565b60005b603f81905550505b6105cf610e32565b603f541115610613576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161060a906141f9565b60405180910390fd5b505b5050005b34801561062557600080fd5b5061062e610ea1565b60405161063b9190614439565b60405180910390f35b34801561065057600080fd5b50610659610ebf565b6040516106669190614439565b60405180910390f35b34801561067b57600080fd5b50610684610efa565b005b34801561069257600080fd5b5061069b611067565b6040516106a89190614439565b60405180910390f35b3480156106bd57600080fd5b506106c66110ae565b6040516106d39190614439565b60405180910390f35b3480156106e857600080fd5b506106f16110cc565b005b3480156106ff57600080fd5b50610708611331565b6040516107159190613f10565b60405180910390f35b34801561072a57600080fd5b50610733611344565b6040516107409190614439565b60405180910390f35b34801561075557600080fd5b5061075e61134a565b60405161076b9190614439565b60405180910390f35b34801561078057600080fd5b50610789611350565b6040516107969190613ea3565b60405180910390f35b3480156107ab57600080fd5b506107b4611376565b6040516107c19190613f10565b60405180910390f35b3480156107d657600080fd5b506107df611389565b6040516107ec9190614439565b60405180910390f35b34801561080157600080fd5b5061080a610e32565b6040516108179190614439565b60405180910390f35b34801561082c57600080fd5b5061083561138f565b6040516108429190614439565b60405180910390f35b34801561085757600080fd5b50610860611395565b60405161086d9190613f61565b60405180910390f35b34801561088257600080fd5b5061088b6113bb565b6040516108989190613f10565b60405180910390f35b3480156108ad57600080fd5b506108b66113ce565b6040516108c39190614439565b60405180910390f35b3480156108d857600080fd5b506108e16114d9565b005b3480156108ef57600080fd5b506108f861171f565b005b34801561090657600080fd5b5061090f61186b565b60405161091c9190614439565b60405180910390f35b34801561093157600080fd5b5061093a611871565b6040516109479190614439565b60405180910390f35b34801561095c57600080fd5b506109656118ad565b6040516109729190614439565b60405180910390f35b34801561098757600080fd5b506109906118b3565b005b34801561099e57600080fd5b506109a7611a8f565b6040516109b49190613f7c565b60405180910390f35b3480156109c957600080fd5b506109d2611aa2565b005b3480156109e057600080fd5b506109e9611b7b565b6040516109f69190613ea3565b60405180910390f35b348015610a0b57600080fd5b50610a14611ba4565b604051610a219190614439565b60405180910390f35b348015610a3657600080fd5b50610a3f611c02565b604051610a4c9190614439565b60405180910390f35b348015610a6157600080fd5b50610a7c6004803603810190610a779190613328565b611c08565b005b348015610a8a57600080fd5b50610a93611e07565b604051610aa09190614439565b60405180910390f35b348015610ab557600080fd5b50610abe611e2a565b005b348015610acc57600080fd5b50610ad56120c2565b604051610ae29190614439565b60405180910390f35b348015610af757600080fd5b50610b126004803603810190610b0d91906131ce565b6120f4565b005b348015610b2057600080fd5b50610b29610c91565b604051610b369190614439565b60405180910390f35b348015610b4b57600080fd5b50610b666004803603810190610b61919061317c565b61211c565b005b348015610b7457600080fd5b50610b7d6121b6565b604051610b8a9190614439565b60405180910390f35b348015610b9f57600080fd5b50610bba6004803603810190610bb5919061317c565b6121be565b005b348015610bc857600080fd5b50610bd1612339565b604051610bde9190614439565b60405180910390f35b348015610bf357600080fd5b50610bfc61233f565b604051610c099190614439565b60405180910390f35b348015610c1e57600080fd5b50610c27612345565b604051610c349190614439565b60405180910390f35b348015610c4957600080fd5b50610c646004803603810190610c5f919061317c565b612367565b005b348015610c7257600080fd5b50610c7b612522565b604051610c889190613f46565b60405180910390f35b6000603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610cee9190613ea3565b60206040518083038186803b158015610d0657600080fd5b505afa158015610d1a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d3e9190613351565b905090565b6060610d8583836040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c65640000815250612548565b905092915050565b600082821115610dd2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dc9906140f9565b60405180910390fd5b818303905092915050565b600080828401905083811015610e28576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e1f90614079565b60405180910390fd5b8091505092915050565b6000600280811115610e4057fe5b603b60009054906101000a900460ff166002811115610e5b57fe5b1415610e6b576035549050610e9e565b6000603a54118015610e855750603a54610e836121b6565b105b15610e935760009050610e9e565b610e9b611ba4565b90505b90565b6000610eba60385460355461256090919063ffffffff16565b905090565b6000610ef56001610ee7610ed1611e07565b610ed9611871565b61256090919063ffffffff16565b610ddd90919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f88576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f7f90614259565b60405180910390fd5b60001515603b60039054906101000a900460ff16151514610fde576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fd5906140d9565b60405180910390fd5b611039610fe9611b7b565b610ff1610c91565b603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166125b69092919063ffffffff16565b7f171f0bcbda3370351cea17f3b164bee87d77c2503b94abdf2720a814ebe7e9df60405160405180910390a1565b600080611072610c91565b9050600061107e6120c2565b9050808211156110a45761109b8183610d8d90919063ffffffff16565b925050506110ab565b6000925050505b90565b60006110c7603654603754610d8d90919063ffffffff16565b905090565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461115c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115390614359565b60405180910390fd5b6060603e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a34574666040518163ffffffff1660e01b815260040160006040518083038186803b1580156111c657600080fd5b505afa1580156111da573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525081019061120391906132be565b905060005b815181101561130157603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b383838151811061125b57fe5b60200260200101517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016112a1929190613ee7565b602060405180830381600087803b1580156112bb57600080fd5b505af11580156112cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112f391906132ff565b508080600101915050611208565b507fb837fd51506ba3cc623a37c78ed22fd521f2f6e9f69a34d5c2a4a9474f27579360405160405180910390a150565b603b60019054906101000a900460ff1681565b60375481565b603d5481565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b603b60029054906101000a900460ff1681565b60355481565b603c5481565b603e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b603b60039054906101000a900460ff1681565b60006002808111156113dc57fe5b603b60009054906101000a900460ff1660028111156113f757fe5b141561140c5761140561263c565b90506114d6565b600060395411801561142657506039546114246121b6565b105b1561143457600090506114d6565b6001600281111561144157fe5b603b60009054906101000a900460ff16600281111561145c57fe5b14801561146b57506000603a54115b801561147f5750603a5461147d6121b6565b105b1561148d57600090506114d6565b60006114bf603f546114b1603c546114a3611ba4565b610d8d90919063ffffffff16565b610d8d90919063ffffffff16565b90506114d26114cc610c91565b826126f6565b9150505b90565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611569576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161156090614359565b60405180910390fd5b6060603e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a34574666040518163ffffffff1660e01b815260040160006040518083038186803b1580156115d357600080fd5b505afa1580156115e7573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525081019061161091906132be565b905060005b81518110156116ef57603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b383838151811061166857fe5b602002602001015160006040518363ffffffff1660e01b815260040161168f929190613ebe565b602060405180830381600087803b1580156116a957600080fd5b505af11580156116bd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116e191906132ff565b508080600101915050611615565b507f6d317a20ba9d790014284bef285283cd61fde92e0f2711050f563a9d2cf4171160405160405180910390a150565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146117ad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117a490614259565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60365481565b60008061187c6121b6565b905060365481116118915760009150506118aa565b6118a660365482610d8d90919063ffffffff16565b9150505b90565b603a5481565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611943576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161193a90614359565b60405180910390fd5b600061194d6113ce565b905060008111611992576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611989906143b9565b60405180910390fd5b6119a781603c54610ddd90919063ffffffff16565b603c81905550611a1c603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166125b69092919063ffffffff16565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fc7798891864187665ac6dd119286e44ec13f014527aeeb2b8eb3fd413df9317982604051611a849190614439565b60405180910390a250565b603b60009054906101000a900460ff1681565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611b32576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b2990614359565b60405180910390fd5b6001603b60036101000a81548160ff0219169083151502179055507fbeb3313724453131feb0a765a03e6715bb720e0f973a31fcbafa2d2f048c188b60405160405180910390a1565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600080611baf6121b6565b9050603654811015611bc5576000915050611bff565b603754811115611bda57603554915050611bff565b611bfb611be5610ea1565b611bed612345565b61270f90919063ffffffff16565b9150505b90565b60385481565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611c98576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c8f90614359565b60405180910390fd5b60008111611cdb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cd2906141d9565b60405180910390fd5b80611ce4611067565b1015611d25576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d1c906142d9565b60405180910390fd5b611d94603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166125b69092919063ffffffff16565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b82604051611dfc9190614439565b60405180910390a250565b6000611e25603854611e176110ae565b61256090919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611eb8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611eaf90614259565b60405180910390fd5b60016002811115611ec557fe5b603b60009054906101000a900460ff166002811115611ee057fe5b14611f20576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f1790614319565b60405180910390fd5b60001515603b60019054906101000a900460ff16151514611f76576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f6d90614419565b60405180910390fd5b6000611f94611f83610e32565b603554610d8d90919063ffffffff16565b905060008111611fd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fd090614099565b60405180910390fd5b80603d819055506001603b60016101000a81548160ff02191690831515021790555061204f612006611b7b565b82603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166125b69092919063ffffffff16565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fb73c49a3a37a7aca291ba0ceaa41657012def406106a7fc386888f0f66e941cf826040516120b79190614439565b60405180910390a250565b60006120ef603d546120e1603c54603554610d8d90919063ffffffff16565b610d8d90919063ffffffff16565b905090565b6121068a8a8a8a8a8a8a8a8a8a61277f565b61210f8b612c09565b5050505050505050505050565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146121aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121a190614259565b60405180910390fd5b6121b381612c09565b50565b600042905090565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461224e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161224590614359565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156122be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122b590614179565b60405180910390fd5b80603460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f373c72efabe4ef3e552ff77838be729f3bc3d8c586df0012902d1baa2377fa1d8160405161232e9190613ea3565b60405180910390a150565b603f5481565b60395481565b60006123626001612354610ebf565b610d8d90919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146123f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123ec90614259565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612465576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161245c90614059565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60606125578484600085612d87565b90509392505050565b60008082116125a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161259b90614159565b60405180910390fd5b8183816125ad57fe5b04905092915050565b6126378363a9059cbb60e01b84846040516024016125d5929190613ee7565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050612e9c565b505050565b60008060395411801561265757506039546126556121b6565b105b1561266557600090506126f3565b6001600281111561267257fe5b603b60009054906101000a900460ff16600281111561268d57fe5b14801561269c57506000603a54115b80156126b05750603a546126ae6121b6565b105b156126be57600090506126f3565b60006126dc603c546126ce611ba4565b610d8d90919063ffffffff16565b90506126ef6126e9610c91565b826126f6565b9150505b90565b60008183106127055781612707565b825b905092915050565b6000808314156127225760009050612779565b600082840290508284828161273357fe5b0414612774576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161276b90614239565b60405180910390fd5b809150505b92915050565b603b60029054906101000a900460ff16156127cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127c6906142f9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff16141561283f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612836906140b9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff1614156128af576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128a6906143f9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff16141561291f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612916906143d9565b60405180910390fd5b60008711612962576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161295990614139565b60405180910390fd5b60008614156129a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161299d90614279565b60405180910390fd5b8486106129e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129df90614019565b60405180910390fd5b6001841015612a2c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a2390614219565b60405180910390fd5b60006002811115612a3957fe5b816002811115612a4557fe5b1415612a86576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a7d90614039565b60405180910390fd5b848310612ac8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612abf90614379565b60405180910390fd5b848210612b0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b0190613ff9565b60405180910390fd5b6001603b60026101000a81548160ff021916908315150217905550612b2e8a612f63565b88603460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555087603360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550866035819055508560368190555084603781905550836038819055508260398190555081603a8190555080603b60006101000a81548160ff02191690836002811115612bf857fe5b021790555050505050505050505050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612c79576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c7090614339565b60405180910390fd5b612c8281613001565b612cc1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612cb8906141b9565b60405180910390fd5b6000603e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081603e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fdac3632743b879638fd2d51c4d3c1dd796615b4758a55b50b0c19b971ba9fbc760405160405180910390a35050565b606082471015612dcc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612dc390614119565b60405180910390fd5b612dd585613001565b612e14576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e0b906142b9565b60405180910390fd5b600060608673ffffffffffffffffffffffffffffffffffffffff168587604051612e3e9190613e8c565b60006040518083038185875af1925050503d8060008114612e7b576040519150601f19603f3d011682016040523d82523d6000602084013e612e80565b606091505b5091509150612e90828286613014565b92505050949350505050565b6060612efe826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166125489092919063ffffffff16565b9050600081511115612f5e5780806020019051810190612f1e91906132ff565b612f5d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612f5490614399565b60405180910390fd5b5b505050565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a350565b600080823b905060008111915050919050565b6060831561302457829050613074565b6000835111156130375782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161306b9190613f97565b60405180910390fd5b9392505050565b60008135905061308a81614630565b92915050565b60008151905061309f81614630565b92915050565b600082601f8301126130b657600080fd5b81516130c96130c482614485565b614454565b915081818352602084019350602081019050838560208402820111156130ee57600080fd5b60005b8381101561311e57816131048882613090565b8452602084019350602083019250506001810190506130f1565b5050505092915050565b60008151905061313781614647565b92915050565b60008135905061314c8161465e565b92915050565b6000813590506131618161466e565b92915050565b6000815190506131768161466e565b92915050565b60006020828403121561318e57600080fd5b600061319c8482850161307b565b91505092915050565b6000602082840312156131b757600080fd5b60006131c584828501613090565b91505092915050565b60008060008060008060008060008060006101608c8e0312156131f057600080fd5b60006131fe8e828f0161307b565b9b5050602061320f8e828f0161307b565b9a505060406132208e828f0161307b565b99505060606132318e828f0161307b565b98505060806132428e828f01613152565b97505060a06132538e828f01613152565b96505060c06132648e828f01613152565b95505060e06132758e828f01613152565b9450506101006132878e828f01613152565b9350506101206132998e828f01613152565b9250506101406132ab8e828f0161313d565b9150509295989b509295989b9093969950565b6000602082840312156132d057600080fd5b600082015167ffffffffffffffff8111156132ea57600080fd5b6132f6848285016130a5565b91505092915050565b60006020828403121561331157600080fd5b600061331f84828501613128565b91505092915050565b60006020828403121561333a57600080fd5b600061334884828501613152565b91505092915050565b60006020828403121561336357600080fd5b600061337184828501613167565b91505092915050565b613383816144e3565b82525050565b613392816144f5565b82525050565b6133a181614501565b82525050565b60006133b2826144b1565b6133bc81856144c7565b93506133cc8185602086016145d6565b80840191505092915050565b6133e18161456a565b82525050565b6133f08161458e565b82525050565b6133ff816145b2565b82525050565b61340e816145c4565b82525050565b600061341f826144bc565b61342981856144d2565b93506134398185602086016145d6565b6134428161460b565b840191505092915050565b600061345a6008836144d2565b91507f4261642063616c6c0000000000000000000000000000000000000000000000006000830152602082019050919050565b600061349a601b836144d2565b91507f455448207472616e7366657273206e6f7420737570706f7274656400000000006000830152602082019050919050565b60006134da6022836144d2565b91507f436c6966662074696d65206d757374206265206265666f726520656e6420746960008301527f6d650000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006135406015836144d2565b91507f53746172742074696d65203e20656e642074696d6500000000000000000000006000830152602082019050919050565b6000613580601e836144d2565b91507f4d757374207365742061207265766f636162696c697479206f7074696f6e00006000830152602082019050919050565b60006135c06026836144d2565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613626601b836144d2565b91507f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006000830152602082019050919050565b6000613666601c836144d2565b91507f4e6f20617661696c61626c6520756e76657374656420616d6f756e74000000006000830152602082019050919050565b60006136a66014836144d2565b91507f4f776e65722063616e6e6f74206265207a65726f0000000000000000000000006000830152602082019050919050565b60006136e6601f836144d2565b91507f43616e6e6f742063616e63656c20616363657074656420636f6e7472616374006000830152602082019050919050565b6000613726601e836144d2565b91507f536166654d6174683a207375627472616374696f6e206f766572666c6f7700006000830152602082019050919050565b60006137666026836144d2565b91507f416464726573733a20696e73756666696369656e742062616c616e636520666f60008301527f722063616c6c00000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006137cc601d836144d2565b91507f4d616e6167656420746f6b656e732063616e6e6f74206265207a65726f0000006000830152602082019050919050565b600061380c601a836144d2565b91507f536166654d6174683a206469766973696f6e206279207a65726f0000000000006000830152602082019050919050565b600061384c6011836144d2565b91507f456d7074792062656e65666963696172790000000000000000000000000000006000830152602082019050919050565b600061388c6013836144d2565b91507f556e617574686f72697a65642063616c6c6572000000000000000000000000006000830152602082019050919050565b60006138cc601a836144d2565b91507f4d616e61676572206d757374206265206120636f6e74726163740000000000006000830152602082019050919050565b600061390c6015836144d2565b91507f416d6f756e742063616e6e6f74206265207a65726f00000000000000000000006000830152602082019050919050565b600061394c6029836144d2565b91507f43616e6e6f7420757365206d6f726520746f6b656e73207468616e207665737460008301527f656420616d6f756e7400000000000000000000000000000000000000000000006020830152604082019050919050565b60006139b2601f836144d2565b91507f506572696f64732063616e6e6f742062652062656c6f77206d696e696d756d006000830152602082019050919050565b60006139f26021836144d2565b91507f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008301527f77000000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613a586020836144d2565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b6000613a986016836144d2565b91507f53746172742074696d65206d75737420626520736574000000000000000000006000830152602082019050919050565b6000613ad86015836144d2565b91507f556e617574686f72697a65642066756e6374696f6e00000000000000000000006000830152602082019050919050565b6000613b18601d836144d2565b91507f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006000830152602082019050919050565b6000613b586024836144d2565b91507f416d6f756e7420726571756573746564203e20737572706c757320617661696c60008301527f61626c65000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613bbe6013836144d2565b91507f416c726561647920696e697469616c697a6564000000000000000000000000006000830152602082019050919050565b6000613bfe6019836144d2565b91507f436f6e7472616374206973206e6f6e2d7265766f6361626c65000000000000006000830152602082019050919050565b6000613c3e6017836144d2565b91507f4d616e616765722063616e6e6f7420626520656d7074790000000000000000006000830152602082019050919050565b6000613c7e6005836144d2565b91507f21617574680000000000000000000000000000000000000000000000000000006000830152602082019050919050565b6000613cbe602a836144d2565b91507f52656c656173652073746172742074696d65206d757374206265206265666f7260008301527f6520656e642074696d65000000000000000000000000000000000000000000006020830152604082019050919050565b6000613d24602a836144d2565b91507f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008301527f6f742073756363656564000000000000000000000000000000000000000000006020830152604082019050919050565b6000613d8a601e836144d2565b91507f4e6f20617661696c61626c652072656c65617361626c6520616d6f756e7400006000830152602082019050919050565b6000613dca6014836144d2565b91507f546f6b656e2063616e6e6f74206265207a65726f0000000000000000000000006000830152602082019050919050565b6000613e0a601a836144d2565b91507f42656e65666963696172792063616e6e6f74206265207a65726f0000000000006000830152602082019050919050565b6000613e4a600f836144d2565b91507f416c7265616479207265766f6b656400000000000000000000000000000000006000830152602082019050919050565b613e8681614560565b82525050565b6000613e9882846133a7565b915081905092915050565b6000602082019050613eb8600083018461337a565b92915050565b6000604082019050613ed3600083018561337a565b613ee06020830184613405565b9392505050565b6000604082019050613efc600083018561337a565b613f096020830184613e7d565b9392505050565b6000602082019050613f256000830184613389565b92915050565b6000602082019050613f406000830184613398565b92915050565b6000602082019050613f5b60008301846133d8565b92915050565b6000602082019050613f7660008301846133e7565b92915050565b6000602082019050613f9160008301846133f6565b92915050565b60006020820190508181036000830152613fb18184613414565b905092915050565b60006020820190508181036000830152613fd28161344d565b9050919050565b60006020820190508181036000830152613ff28161348d565b9050919050565b60006020820190508181036000830152614012816134cd565b9050919050565b6000602082019050818103600083015261403281613533565b9050919050565b6000602082019050818103600083015261405281613573565b9050919050565b60006020820190508181036000830152614072816135b3565b9050919050565b6000602082019050818103600083015261409281613619565b9050919050565b600060208201905081810360008301526140b281613659565b9050919050565b600060208201905081810360008301526140d281613699565b9050919050565b600060208201905081810360008301526140f2816136d9565b9050919050565b6000602082019050818103600083015261411281613719565b9050919050565b6000602082019050818103600083015261413281613759565b9050919050565b60006020820190508181036000830152614152816137bf565b9050919050565b60006020820190508181036000830152614172816137ff565b9050919050565b600060208201905081810360008301526141928161383f565b9050919050565b600060208201905081810360008301526141b28161387f565b9050919050565b600060208201905081810360008301526141d2816138bf565b9050919050565b600060208201905081810360008301526141f2816138ff565b9050919050565b600060208201905081810360008301526142128161393f565b9050919050565b60006020820190508181036000830152614232816139a5565b9050919050565b60006020820190508181036000830152614252816139e5565b9050919050565b6000602082019050818103600083015261427281613a4b565b9050919050565b6000602082019050818103600083015261429281613a8b565b9050919050565b600060208201905081810360008301526142b281613acb565b9050919050565b600060208201905081810360008301526142d281613b0b565b9050919050565b600060208201905081810360008301526142f281613b4b565b9050919050565b6000602082019050818103600083015261431281613bb1565b9050919050565b6000602082019050818103600083015261433281613bf1565b9050919050565b6000602082019050818103600083015261435281613c31565b9050919050565b6000602082019050818103600083015261437281613c71565b9050919050565b6000602082019050818103600083015261439281613cb1565b9050919050565b600060208201905081810360008301526143b281613d17565b9050919050565b600060208201905081810360008301526143d281613d7d565b9050919050565b600060208201905081810360008301526143f281613dbd565b9050919050565b6000602082019050818103600083015261441281613dfd565b9050919050565b6000602082019050818103600083015261443281613e3d565b9050919050565b600060208201905061444e6000830184613e7d565b92915050565b6000604051905081810181811067ffffffffffffffff8211171561447b5761447a614609565b5b8060405250919050565b600067ffffffffffffffff8211156144a05761449f614609565b5b602082029050602081019050919050565b600081519050919050565b600081519050919050565b600081905092915050565b600082825260208201905092915050565b60006144ee82614540565b9050919050565b60008115159050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600081905061453b8261461c565b919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60006145758261457c565b9050919050565b600061458782614540565b9050919050565b6000614599826145a0565b9050919050565b60006145ab82614540565b9050919050565b60006145bd8261452d565b9050919050565b60006145cf82614560565b9050919050565b60005b838110156145f45780820151818401526020810190506145d9565b83811115614603576000848401525b50505050565bfe5b6000601f19601f8301169050919050565b6003811061462d5761462c614609565b5b50565b614639816144e3565b811461464457600080fd5b50565b614650816144f5565b811461465b57600080fd5b50565b6003811061466b57600080fd5b50565b61467781614560565b811461468257600080fd5b5056fea264697066735822122013f3b022e354ddf49f7a28727f309f858a5cbdf70833a2e54da3c1a482b7073164736f6c63430007030033", + "devdoc": { + "kind": "dev", + "methods": { + "acceptLock()": { + "details": "Can only be called by the beneficiary" + }, + "amountPerPeriod()": { + "returns": { + "_0": "Amount of tokens available after each period" + } + }, + "approveProtocol()": { + "details": "Approves all token destinations registered in the manager to pull tokens" + }, + "availableAmount()": { + "details": "Implements the step-by-step schedule based on periods for available tokens", + "returns": { + "_0": "Amount of tokens available according to the schedule" + } + }, + "cancelLock()": { + "details": "Can only be called by the owner" + }, + "changeBeneficiary(address)": { + "details": "Can only be called by the beneficiary", + "params": { + "_newBeneficiary": "Address of the new beneficiary address" + } + }, + "currentBalance()": { + "returns": { + "_0": "Tokens held in the contract" + } + }, + "currentPeriod()": { + "returns": { + "_0": "A number that represents the current period" + } + }, + "currentTime()": { + "returns": { + "_0": "Current block timestamp" + } + }, + "duration()": { + "returns": { + "_0": "Amount of seconds from contract startTime to endTime" + } + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "passedPeriods()": { + "returns": { + "_0": "A number of periods that passed since the schedule started" + } + }, + "periodDuration()": { + "returns": { + "_0": "Duration of each period in seconds" + } + }, + "releasableAmount()": { + "details": "Considers the schedule, takes into account already released tokens and used amount", + "returns": { + "_0": "Amount of tokens ready to be released" + } + }, + "release()": { + "details": "All available releasable tokens are transferred to beneficiary" + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." + }, + "revoke()": { + "details": "Vesting schedule is always calculated based on managed tokens" + }, + "revokeProtocol()": { + "details": "Revokes approval to all token destinations in the manager to pull tokens" + }, + "setManager(address)": { + "params": { + "_newManager": "Address of the new manager" + } + }, + "sinceStartTime()": { + "details": "Returns zero if called before conctract starTime", + "returns": { + "_0": "Seconds elapsed from contract startTime" + } + }, + "surplusAmount()": { + "details": "All funds over outstanding amount is considered surplus that can be withdrawn by beneficiary. Note this might not be the correct value for wallets transferred to L2 (i.e. an L2GraphTokenLockWallet), as the released amount will be skewed, so the beneficiary might have to bridge back to L1 to release the surplus.", + "returns": { + "_0": "Amount of tokens considered as surplus" + } + }, + "totalOutstandingAmount()": { + "details": "Does not consider schedule but just global amounts tracked", + "returns": { + "_0": "Amount of outstanding tokens for the lifetime of the contract" + } + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + }, + "vestedAmount()": { + "details": "Similar to available amount, but is fully vested when contract is non-revocable", + "returns": { + "_0": "Amount of tokens already vested" + } + }, + "withdrawSurplus(uint256)": { + "details": "Tokens in the contract over outstanding amount are considered as surplus", + "params": { + "_amount": "Amount of tokens to withdraw" + } + } + }, + "title": "GraphTokenLockWallet", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "acceptLock()": { + "notice": "Beneficiary accepts the lock, the owner cannot retrieve back the tokens" + }, + "amountPerPeriod()": { + "notice": "Returns amount available to be released after each period according to schedule" + }, + "approveProtocol()": { + "notice": "Approves protocol access of the tokens managed by this contract" + }, + "availableAmount()": { + "notice": "Gets the currently available token according to the schedule" + }, + "cancelLock()": { + "notice": "Owner cancel the lock and return the balance in the contract" + }, + "changeBeneficiary(address)": { + "notice": "Change the beneficiary of funds managed by the contract" + }, + "currentBalance()": { + "notice": "Returns the amount of tokens currently held by the contract" + }, + "currentPeriod()": { + "notice": "Gets the current period based on the schedule" + }, + "currentTime()": { + "notice": "Returns the current block timestamp" + }, + "duration()": { + "notice": "Gets duration of contract from start to end in seconds" + }, + "passedPeriods()": { + "notice": "Gets the number of periods that passed since the first period" + }, + "periodDuration()": { + "notice": "Returns the duration of each period in seconds" + }, + "releasableAmount()": { + "notice": "Gets tokens currently available for release" + }, + "release()": { + "notice": "Releases tokens based on the configured schedule" + }, + "revoke()": { + "notice": "Revokes a vesting schedule and return the unvested tokens to the owner" + }, + "revokeProtocol()": { + "notice": "Revokes protocol access of the tokens managed by this contract" + }, + "setManager(address)": { + "notice": "Sets a new manager for this contract" + }, + "sinceStartTime()": { + "notice": "Gets time elapsed since the start of the contract" + }, + "surplusAmount()": { + "notice": "Gets surplus amount in the contract based on outstanding amount to release" + }, + "totalOutstandingAmount()": { + "notice": "Gets the outstanding amount yet to be released based on the whole contract lifetime" + }, + "vestedAmount()": { + "notice": "Gets the amount of currently vested tokens" + }, + "withdrawSurplus(uint256)": { + "notice": "Withdraws surplus, unmanaged tokens from the contract" + } + }, + "notice": "This contract is built on top of the base GraphTokenLock functionality. It allows wallet beneficiaries to use the deposited funds to perform specific function calls on specific contracts. The idea is that supporters with locked tokens can participate in the protocol but disallow any release before the vesting/lock schedule. The beneficiary can issue authorized function calls to this contract that will get forwarded to a target contract. A target contract is any of our protocol contracts. The function calls allowed are queried to the GraphTokenLockManager, this way the same configuration can be shared for all the created lock wallet contracts. NOTE: Contracts used as target must have its function signatures checked to avoid collisions with any of this contract functions. Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience the maximum amount of tokens is authorized. Function calls do not forward ETH value so DO NOT SEND ETH TO THIS CONTRACT.", + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 6797, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "_owner", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 6802, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 3244, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "token", + "offset": 0, + "slot": "51", + "type": "t_contract(IERC20)1710" + }, + { + "astId": 3246, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "beneficiary", + "offset": 0, + "slot": "52", + "type": "t_address" + }, + { + "astId": 3248, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "managedAmount", + "offset": 0, + "slot": "53", + "type": "t_uint256" + }, + { + "astId": 3250, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "startTime", + "offset": 0, + "slot": "54", + "type": "t_uint256" + }, + { + "astId": 3252, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "endTime", + "offset": 0, + "slot": "55", + "type": "t_uint256" + }, + { + "astId": 3254, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "periods", + "offset": 0, + "slot": "56", + "type": "t_uint256" + }, + { + "astId": 3256, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "releaseStartTime", + "offset": 0, + "slot": "57", + "type": "t_uint256" + }, + { + "astId": 3258, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "vestingCliffTime", + "offset": 0, + "slot": "58", + "type": "t_uint256" + }, + { + "astId": 3260, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "revocable", + "offset": 0, + "slot": "59", + "type": "t_enum(Revocability)5096" + }, + { + "astId": 3262, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "isRevoked", + "offset": 1, + "slot": "59", + "type": "t_bool" + }, + { + "astId": 3264, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "isInitialized", + "offset": 2, + "slot": "59", + "type": "t_bool" + }, + { + "astId": 3266, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "isAccepted", + "offset": 3, + "slot": "59", + "type": "t_bool" + }, + { + "astId": 3268, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "releasedAmount", + "offset": 0, + "slot": "60", + "type": "t_uint256" + }, + { + "astId": 3270, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "revokedAmount", + "offset": 0, + "slot": "61", + "type": "t_uint256" + }, + { + "astId": 4692, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "manager", + "offset": 0, + "slot": "62", + "type": "t_contract(IGraphTokenLockManager)5278" + }, + { + "astId": 4694, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "usedAmount", + "offset": 0, + "slot": "63", + "type": "t_uint256" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)50_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_contract(IERC20)1710": { + "encoding": "inplace", + "label": "contract IERC20", + "numberOfBytes": "20" + }, + "t_contract(IGraphTokenLockManager)5278": { + "encoding": "inplace", + "label": "contract IGraphTokenLockManager", + "numberOfBytes": "20" + }, + "t_enum(Revocability)5096": { + "encoding": "inplace", + "label": "enum IGraphTokenLock.Revocability", + "numberOfBytes": "1" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} \ No newline at end of file diff --git a/packages/token-distribution/deployments/goerli/GraphTokenLockWallet.json b/packages/token-distribution/deployments/goerli/GraphTokenLockWallet.json new file mode 100644 index 000000000..589c2c59a --- /dev/null +++ b/packages/token-distribution/deployments/goerli/GraphTokenLockWallet.json @@ -0,0 +1,1083 @@ +{ + "address": "0xbBCeB991e59a4E53DfDbD4a4B1843de1830017B3", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "newBeneficiary", + "type": "address" + } + ], + "name": "BeneficiaryChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "LockAccepted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "LockCanceled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_oldManager", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "_newManager", + "type": "address" + } + ], + "name": "ManagerUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "TokenDestinationsApproved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "TokenDestinationsRevoked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensReleased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensRevoked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensWithdrawn", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "acceptLock", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "amountPerPeriod", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "approveProtocol", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "availableAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "beneficiary", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "cancelLock", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newBeneficiary", + "type": "address" + } + ], + "name": "changeBeneficiary", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "currentBalance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "currentPeriod", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "currentTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "duration", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "endTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_manager", + "type": "address" + }, + { + "internalType": "address", + "name": "_owner", + "type": "address" + }, + { + "internalType": "address", + "name": "_beneficiary", + "type": "address" + }, + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_managedAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_startTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_endTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_periods", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_releaseStartTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_vestingCliffTime", + "type": "uint256" + }, + { + "internalType": "enum IGraphTokenLock.Revocability", + "name": "_revocable", + "type": "uint8" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "isAccepted", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isInitialized", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isRevoked", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "managedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "manager", + "outputs": [ + { + "internalType": "contract IGraphTokenLockManager", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "passedPeriods", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "periodDuration", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "periods", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "releasableAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "release", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "releaseStartTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "releasedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "revocable", + "outputs": [ + { + "internalType": "enum IGraphTokenLock.Revocability", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "revoke", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "revokeProtocol", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "revokedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newManager", + "type": "address" + } + ], + "name": "setManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "sinceStartTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "startTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "surplusAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "token", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalOutstandingAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "usedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "vestedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "vestingCliffTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "withdrawSurplus", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0xb079f74185692c4d4293de429f6ab2e9fcdcfe0914cd05f4b6e7b3971f9fde30", + "receipt": { + "to": null, + "from": "0xEfc519BEd6a43a14f1BBBbA9e796C4931f7A5540", + "contractAddress": "0xbBCeB991e59a4E53DfDbD4a4B1843de1830017B3", + "transactionIndex": 21, + "gasUsed": "3482943", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x9700265b7456a3d8c07977f2e2dbbcd14235ef873425f011d340bbb8be4b20a0", + "transactionHash": "0xb079f74185692c4d4293de429f6ab2e9fcdcfe0914cd05f4b6e7b3971f9fde30", + "logs": [], + "blockNumber": 7370680, + "cumulativeGasUsed": "11418126", + "status": 1, + "byzantium": true + }, + "args": [], + "solcInputHash": "3c1e469b4f9ba208577ab7c230900006", + "metadata": "{\"compiler\":{\"version\":\"0.7.3+commit.9bfce1f6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newBeneficiary\",\"type\":\"address\"}],\"name\":\"BeneficiaryChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"LockAccepted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"LockCanceled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_oldManager\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_newManager\",\"type\":\"address\"}],\"name\":\"ManagerUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"TokenDestinationsApproved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"TokenDestinationsRevoked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensReleased\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensRevoked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensWithdrawn\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"acceptLock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"amountPerPeriod\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"approveProtocol\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"availableAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"beneficiary\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"cancelLock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_newBeneficiary\",\"type\":\"address\"}],\"name\":\"changeBeneficiary\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"currentBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"currentPeriod\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"currentTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"duration\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"endTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_manager\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_beneficiary\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_managedAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_startTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_endTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_periods\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_releaseStartTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_vestingCliffTime\",\"type\":\"uint256\"},{\"internalType\":\"enum IGraphTokenLock.Revocability\",\"name\":\"_revocable\",\"type\":\"uint8\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isAccepted\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isInitialized\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isRevoked\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"managedAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"manager\",\"outputs\":[{\"internalType\":\"contract IGraphTokenLockManager\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"passedPeriods\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"periodDuration\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"periods\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"releasableAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"release\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"releaseStartTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"releasedAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"revocable\",\"outputs\":[{\"internalType\":\"enum IGraphTokenLock.Revocability\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"revoke\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"revokeProtocol\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"revokedAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_newManager\",\"type\":\"address\"}],\"name\":\"setManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"sinceStartTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"startTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"surplusAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalOutstandingAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"usedAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"vestedAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"vestingCliffTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdrawSurplus\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"acceptLock()\":{\"details\":\"Can only be called by the beneficiary\"},\"amountPerPeriod()\":{\"returns\":{\"_0\":\"Amount of tokens available after each period\"}},\"approveProtocol()\":{\"details\":\"Approves all token destinations registered in the manager to pull tokens\"},\"availableAmount()\":{\"details\":\"Implements the step-by-step schedule based on periods for available tokens\",\"returns\":{\"_0\":\"Amount of tokens available according to the schedule\"}},\"cancelLock()\":{\"details\":\"Can only be called by the owner\"},\"changeBeneficiary(address)\":{\"details\":\"Can only be called by the beneficiary\",\"params\":{\"_newBeneficiary\":\"Address of the new beneficiary address\"}},\"currentBalance()\":{\"returns\":{\"_0\":\"Tokens held in the contract\"}},\"currentPeriod()\":{\"returns\":{\"_0\":\"A number that represents the current period\"}},\"currentTime()\":{\"returns\":{\"_0\":\"Current block timestamp\"}},\"duration()\":{\"returns\":{\"_0\":\"Amount of seconds from contract startTime to endTime\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"passedPeriods()\":{\"returns\":{\"_0\":\"A number of periods that passed since the schedule started\"}},\"periodDuration()\":{\"returns\":{\"_0\":\"Duration of each period in seconds\"}},\"releasableAmount()\":{\"details\":\"Considers the schedule, takes into account already released tokens and used amount\",\"returns\":{\"_0\":\"Amount of tokens ready to be released\"}},\"release()\":{\"details\":\"All available releasable tokens are transferred to beneficiary\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"revoke()\":{\"details\":\"Vesting schedule is always calculated based on managed tokens\"},\"revokeProtocol()\":{\"details\":\"Revokes approval to all token destinations in the manager to pull tokens\"},\"setManager(address)\":{\"params\":{\"_newManager\":\"Address of the new manager\"}},\"sinceStartTime()\":{\"details\":\"Returns zero if called before conctract starTime\",\"returns\":{\"_0\":\"Seconds elapsed from contract startTime\"}},\"surplusAmount()\":{\"details\":\"All funds over outstanding amount is considered surplus that can be withdrawn by beneficiary\",\"returns\":{\"_0\":\"Amount of tokens considered as surplus\"}},\"totalOutstandingAmount()\":{\"details\":\"Does not consider schedule but just global amounts tracked\",\"returns\":{\"_0\":\"Amount of outstanding tokens for the lifetime of the contract\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"vestedAmount()\":{\"details\":\"Similar to available amount, but is fully vested when contract is non-revocable\",\"returns\":{\"_0\":\"Amount of tokens already vested\"}},\"withdrawSurplus(uint256)\":{\"details\":\"Tokens in the contract over outstanding amount are considered as surplus\",\"params\":{\"_amount\":\"Amount of tokens to withdraw\"}}},\"title\":\"GraphTokenLockWallet\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"acceptLock()\":{\"notice\":\"Beneficiary accepts the lock, the owner cannot retrieve back the tokens\"},\"amountPerPeriod()\":{\"notice\":\"Returns amount available to be released after each period according to schedule\"},\"approveProtocol()\":{\"notice\":\"Approves protocol access of the tokens managed by this contract\"},\"availableAmount()\":{\"notice\":\"Gets the currently available token according to the schedule\"},\"cancelLock()\":{\"notice\":\"Owner cancel the lock and return the balance in the contract\"},\"changeBeneficiary(address)\":{\"notice\":\"Change the beneficiary of funds managed by the contract\"},\"currentBalance()\":{\"notice\":\"Returns the amount of tokens currently held by the contract\"},\"currentPeriod()\":{\"notice\":\"Gets the current period based on the schedule\"},\"currentTime()\":{\"notice\":\"Returns the current block timestamp\"},\"duration()\":{\"notice\":\"Gets duration of contract from start to end in seconds\"},\"passedPeriods()\":{\"notice\":\"Gets the number of periods that passed since the first period\"},\"periodDuration()\":{\"notice\":\"Returns the duration of each period in seconds\"},\"releasableAmount()\":{\"notice\":\"Gets tokens currently available for release\"},\"release()\":{\"notice\":\"Releases tokens based on the configured schedule\"},\"revoke()\":{\"notice\":\"Revokes a vesting schedule and return the unvested tokens to the owner\"},\"revokeProtocol()\":{\"notice\":\"Revokes protocol access of the tokens managed by this contract\"},\"setManager(address)\":{\"notice\":\"Sets a new manager for this contract\"},\"sinceStartTime()\":{\"notice\":\"Gets time elapsed since the start of the contract\"},\"surplusAmount()\":{\"notice\":\"Gets surplus amount in the contract based on outstanding amount to release\"},\"totalOutstandingAmount()\":{\"notice\":\"Gets the outstanding amount yet to be released based on the whole contract lifetime\"},\"vestedAmount()\":{\"notice\":\"Gets the amount of currently vested tokens\"},\"withdrawSurplus(uint256)\":{\"notice\":\"Withdraws surplus, unmanaged tokens from the contract\"}},\"notice\":\"This contract is built on top of the base GraphTokenLock functionality. It allows wallet beneficiaries to use the deposited funds to perform specific function calls on specific contracts. The idea is that supporters with locked tokens can participate in the protocol but disallow any release before the vesting/lock schedule. The beneficiary can issue authorized function calls to this contract that will get forwarded to a target contract. A target contract is any of our protocol contracts. The function calls allowed are queried to the GraphTokenLockManager, this way the same configuration can be shared for all the created lock wallet contracts. NOTE: Contracts used as target must have its function signatures checked to avoid collisions with any of this contract functions. Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience the maximum amount of tokens is authorized.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/GraphTokenLockWallet.sol\":\"GraphTokenLockWallet\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/math/SafeMath.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Wrappers over Solidity's arithmetic operations with added overflow\\n * checks.\\n *\\n * Arithmetic operations in Solidity wrap on overflow. This can easily result\\n * in bugs, because programmers usually assume that an overflow raises an\\n * error, which is the standard behavior in high level programming languages.\\n * `SafeMath` restores this intuition by reverting the transaction when an\\n * operation overflows.\\n *\\n * Using this library instead of the unchecked operations eliminates an entire\\n * class of bugs, so it's recommended to use it always.\\n */\\nlibrary SafeMath {\\n /**\\n * @dev Returns the addition of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n uint256 c = a + b;\\n if (c < a) return (false, 0);\\n return (true, c);\\n }\\n\\n /**\\n * @dev Returns the substraction of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b > a) return (false, 0);\\n return (true, a - b);\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\\n if (a == 0) return (true, 0);\\n uint256 c = a * b;\\n if (c / a != b) return (false, 0);\\n return (true, c);\\n }\\n\\n /**\\n * @dev Returns the division of two unsigned integers, with a division by zero flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b == 0) return (false, 0);\\n return (true, a / b);\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b == 0) return (false, 0);\\n return (true, a % b);\\n }\\n\\n /**\\n * @dev Returns the addition of two unsigned integers, reverting on\\n * overflow.\\n *\\n * Counterpart to Solidity's `+` operator.\\n *\\n * Requirements:\\n *\\n * - Addition cannot overflow.\\n */\\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\\n uint256 c = a + b;\\n require(c >= a, \\\"SafeMath: addition overflow\\\");\\n return c;\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting on\\n * overflow (when the result is negative).\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n *\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b <= a, \\\"SafeMath: subtraction overflow\\\");\\n return a - b;\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, reverting on\\n * overflow.\\n *\\n * Counterpart to Solidity's `*` operator.\\n *\\n * Requirements:\\n *\\n * - Multiplication cannot overflow.\\n */\\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\\n if (a == 0) return 0;\\n uint256 c = a * b;\\n require(c / a == b, \\\"SafeMath: multiplication overflow\\\");\\n return c;\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers, reverting on\\n * division by zero. The result is rounded towards zero.\\n *\\n * Counterpart to Solidity's `/` operator. Note: this function uses a\\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\\n * uses an invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b > 0, \\\"SafeMath: division by zero\\\");\\n return a / b;\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * reverting when dividing by zero.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b > 0, \\\"SafeMath: modulo by zero\\\");\\n return a % b;\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\\n * overflow (when the result is negative).\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {trySub}.\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n *\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b <= a, errorMessage);\\n return a - b;\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers, reverting with custom message on\\n * division by zero. The result is rounded towards zero.\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {tryDiv}.\\n *\\n * Counterpart to Solidity's `/` operator. Note: this function uses a\\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\\n * uses an invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b > 0, errorMessage);\\n return a / b;\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * reverting with custom message when dividing by zero.\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {tryMod}.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b > 0, errorMessage);\\n return a % b;\\n }\\n}\\n\",\"keccak256\":\"0xcc78a17dd88fa5a2edc60c8489e2f405c0913b377216a5b26b35656b2d0dab52\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `recipient`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address recipient, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `sender` to `recipient` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n}\\n\",\"keccak256\":\"0x5f02220344881ce43204ae4a6281145a67bc52c2bb1290a791857df3d19d78f5\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\nimport \\\"./IERC20.sol\\\";\\nimport \\\"../../math/SafeMath.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @title SafeERC20\\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\\n * contract returns false). Tokens that return no value (and instead revert or\\n * throw on failure) are also supported, non-reverting calls are assumed to be\\n * successful.\\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\n */\\nlibrary SafeERC20 {\\n using SafeMath for uint256;\\n using Address for address;\\n\\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\\n }\\n\\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\\n }\\n\\n /**\\n * @dev Deprecated. This function has issues similar to the ones found in\\n * {IERC20-approve}, and its usage is discouraged.\\n *\\n * Whenever possible, use {safeIncreaseAllowance} and\\n * {safeDecreaseAllowance} instead.\\n */\\n function safeApprove(IERC20 token, address spender, uint256 value) internal {\\n // safeApprove should only be called when setting an initial allowance,\\n // or when resetting it to zero. To increase and decrease it, use\\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\\n // solhint-disable-next-line max-line-length\\n require((value == 0) || (token.allowance(address(this), spender) == 0),\\n \\\"SafeERC20: approve from non-zero to non-zero allowance\\\"\\n );\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\\n }\\n\\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n uint256 newAllowance = token.allowance(address(this), spender).add(value);\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n uint256 newAllowance = token.allowance(address(this), spender).sub(value, \\\"SafeERC20: decreased allowance below zero\\\");\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n */\\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that\\n // the target address contains contract code and also asserts for success in the low-level call.\\n\\n bytes memory returndata = address(token).functionCall(data, \\\"SafeERC20: low-level call failed\\\");\\n if (returndata.length > 0) { // Return data is optional\\n // solhint-disable-next-line max-line-length\\n require(abi.decode(returndata, (bool)), \\\"SafeERC20: ERC20 operation did not succeed\\\");\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf12dfbe97e6276980b83d2830bb0eb75e0cf4f3e626c2471137f82158ae6a0fc\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.2 <0.8.0;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize, which returns 0 for contracts in\\n // construction, since the code is only stored at the end of the\\n // constructor execution.\\n\\n uint256 size;\\n // solhint-disable-next-line no-inline-assembly\\n assembly { size := extcodesize(account) }\\n return size > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls, avoid-call-value\\n (bool success, ) = recipient.call{ value: amount }(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain`call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.call{ value: value }(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x28911e614500ae7c607a432a709d35da25f3bc5ddc8bd12b278b66358070c0ea\",\"license\":\"MIT\"},\"contracts/GraphTokenLock.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nimport \\\"@openzeppelin/contracts/math/SafeMath.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\\\";\\n\\nimport \\\"./Ownable.sol\\\";\\nimport \\\"./MathUtils.sol\\\";\\nimport \\\"./IGraphTokenLock.sol\\\";\\n\\n/**\\n * @title GraphTokenLock\\n * @notice Contract that manages an unlocking schedule of tokens.\\n * @dev The contract lock manage a number of tokens deposited into the contract to ensure that\\n * they can only be released under certain time conditions.\\n *\\n * This contract implements a release scheduled based on periods and tokens are released in steps\\n * after each period ends. It can be configured with one period in which case it is like a plain TimeLock.\\n * It also supports revocation to be used for vesting schedules.\\n *\\n * The contract supports receiving extra funds than the managed tokens ones that can be\\n * withdrawn by the beneficiary at any time.\\n *\\n * A releaseStartTime parameter is included to override the default release schedule and\\n * perform the first release on the configured time. After that it will continue with the\\n * default schedule.\\n */\\nabstract contract GraphTokenLock is Ownable, IGraphTokenLock {\\n using SafeMath for uint256;\\n using SafeERC20 for IERC20;\\n\\n uint256 private constant MIN_PERIOD = 1;\\n\\n // -- State --\\n\\n IERC20 public token;\\n address public beneficiary;\\n\\n // Configuration\\n\\n // Amount of tokens managed by the contract schedule\\n uint256 public managedAmount;\\n\\n uint256 public startTime; // Start datetime (in unixtimestamp)\\n uint256 public endTime; // Datetime after all funds are fully vested/unlocked (in unixtimestamp)\\n uint256 public periods; // Number of vesting/release periods\\n\\n // First release date for tokens (in unixtimestamp)\\n // If set, no tokens will be released before releaseStartTime ignoring\\n // the amount to release each period\\n uint256 public releaseStartTime;\\n // A cliff set a date to which a beneficiary needs to get to vest\\n // all preceding periods\\n uint256 public vestingCliffTime;\\n Revocability public revocable; // Whether to use vesting for locked funds\\n\\n // State\\n\\n bool public isRevoked;\\n bool public isInitialized;\\n bool public isAccepted;\\n uint256 public releasedAmount;\\n uint256 public revokedAmount;\\n\\n // -- Events --\\n\\n event TokensReleased(address indexed beneficiary, uint256 amount);\\n event TokensWithdrawn(address indexed beneficiary, uint256 amount);\\n event TokensRevoked(address indexed beneficiary, uint256 amount);\\n event BeneficiaryChanged(address newBeneficiary);\\n event LockAccepted();\\n event LockCanceled();\\n\\n /**\\n * @dev Only allow calls from the beneficiary of the contract\\n */\\n modifier onlyBeneficiary() {\\n require(msg.sender == beneficiary, \\\"!auth\\\");\\n _;\\n }\\n\\n /**\\n * @notice Initializes the contract\\n * @param _owner Address of the contract owner\\n * @param _beneficiary Address of the beneficiary of locked tokens\\n * @param _managedAmount Amount of tokens to be managed by the lock contract\\n * @param _startTime Start time of the release schedule\\n * @param _endTime End time of the release schedule\\n * @param _periods Number of periods between start time and end time\\n * @param _releaseStartTime Override time for when the releases start\\n * @param _vestingCliffTime Override time for when the vesting start\\n * @param _revocable Whether the contract is revocable\\n */\\n function _initialize(\\n address _owner,\\n address _beneficiary,\\n address _token,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n Revocability _revocable\\n ) internal {\\n require(!isInitialized, \\\"Already initialized\\\");\\n require(_owner != address(0), \\\"Owner cannot be zero\\\");\\n require(_beneficiary != address(0), \\\"Beneficiary cannot be zero\\\");\\n require(_token != address(0), \\\"Token cannot be zero\\\");\\n require(_managedAmount > 0, \\\"Managed tokens cannot be zero\\\");\\n require(_startTime != 0, \\\"Start time must be set\\\");\\n require(_startTime < _endTime, \\\"Start time > end time\\\");\\n require(_periods >= MIN_PERIOD, \\\"Periods cannot be below minimum\\\");\\n require(_revocable != Revocability.NotSet, \\\"Must set a revocability option\\\");\\n require(_releaseStartTime < _endTime, \\\"Release start time must be before end time\\\");\\n require(_vestingCliffTime < _endTime, \\\"Cliff time must be before end time\\\");\\n\\n isInitialized = true;\\n\\n Ownable.initialize(_owner);\\n beneficiary = _beneficiary;\\n token = IERC20(_token);\\n\\n managedAmount = _managedAmount;\\n\\n startTime = _startTime;\\n endTime = _endTime;\\n periods = _periods;\\n\\n // Optionals\\n releaseStartTime = _releaseStartTime;\\n vestingCliffTime = _vestingCliffTime;\\n revocable = _revocable;\\n }\\n\\n /**\\n * @notice Change the beneficiary of funds managed by the contract\\n * @dev Can only be called by the beneficiary\\n * @param _newBeneficiary Address of the new beneficiary address\\n */\\n function changeBeneficiary(address _newBeneficiary) external onlyBeneficiary {\\n require(_newBeneficiary != address(0), \\\"Empty beneficiary\\\");\\n beneficiary = _newBeneficiary;\\n emit BeneficiaryChanged(_newBeneficiary);\\n }\\n\\n /**\\n * @notice Beneficiary accepts the lock, the owner cannot retrieve back the tokens\\n * @dev Can only be called by the beneficiary\\n */\\n function acceptLock() external onlyBeneficiary {\\n isAccepted = true;\\n emit LockAccepted();\\n }\\n\\n /**\\n * @notice Owner cancel the lock and return the balance in the contract\\n * @dev Can only be called by the owner\\n */\\n function cancelLock() external onlyOwner {\\n require(isAccepted == false, \\\"Cannot cancel accepted contract\\\");\\n\\n token.safeTransfer(owner(), currentBalance());\\n\\n emit LockCanceled();\\n }\\n\\n // -- Balances --\\n\\n /**\\n * @notice Returns the amount of tokens currently held by the contract\\n * @return Tokens held in the contract\\n */\\n function currentBalance() public view override returns (uint256) {\\n return token.balanceOf(address(this));\\n }\\n\\n // -- Time & Periods --\\n\\n /**\\n * @notice Returns the current block timestamp\\n * @return Current block timestamp\\n */\\n function currentTime() public view override returns (uint256) {\\n return block.timestamp;\\n }\\n\\n /**\\n * @notice Gets duration of contract from start to end in seconds\\n * @return Amount of seconds from contract startTime to endTime\\n */\\n function duration() public view override returns (uint256) {\\n return endTime.sub(startTime);\\n }\\n\\n /**\\n * @notice Gets time elapsed since the start of the contract\\n * @dev Returns zero if called before conctract starTime\\n * @return Seconds elapsed from contract startTime\\n */\\n function sinceStartTime() public view override returns (uint256) {\\n uint256 current = currentTime();\\n if (current <= startTime) {\\n return 0;\\n }\\n return current.sub(startTime);\\n }\\n\\n /**\\n * @notice Returns amount available to be released after each period according to schedule\\n * @return Amount of tokens available after each period\\n */\\n function amountPerPeriod() public view override returns (uint256) {\\n return managedAmount.div(periods);\\n }\\n\\n /**\\n * @notice Returns the duration of each period in seconds\\n * @return Duration of each period in seconds\\n */\\n function periodDuration() public view override returns (uint256) {\\n return duration().div(periods);\\n }\\n\\n /**\\n * @notice Gets the current period based on the schedule\\n * @return A number that represents the current period\\n */\\n function currentPeriod() public view override returns (uint256) {\\n return sinceStartTime().div(periodDuration()).add(MIN_PERIOD);\\n }\\n\\n /**\\n * @notice Gets the number of periods that passed since the first period\\n * @return A number of periods that passed since the schedule started\\n */\\n function passedPeriods() public view override returns (uint256) {\\n return currentPeriod().sub(MIN_PERIOD);\\n }\\n\\n // -- Locking & Release Schedule --\\n\\n /**\\n * @notice Gets the currently available token according to the schedule\\n * @dev Implements the step-by-step schedule based on periods for available tokens\\n * @return Amount of tokens available according to the schedule\\n */\\n function availableAmount() public view override returns (uint256) {\\n uint256 current = currentTime();\\n\\n // Before contract start no funds are available\\n if (current < startTime) {\\n return 0;\\n }\\n\\n // After contract ended all funds are available\\n if (current > endTime) {\\n return managedAmount;\\n }\\n\\n // Get available amount based on period\\n return passedPeriods().mul(amountPerPeriod());\\n }\\n\\n /**\\n * @notice Gets the amount of currently vested tokens\\n * @dev Similar to available amount, but is fully vested when contract is non-revocable\\n * @return Amount of tokens already vested\\n */\\n function vestedAmount() public view override returns (uint256) {\\n // If non-revocable it is fully vested\\n if (revocable == Revocability.Disabled) {\\n return managedAmount;\\n }\\n\\n // Vesting cliff is activated and it has not passed means nothing is vested yet\\n if (vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\\n return 0;\\n }\\n\\n return availableAmount();\\n }\\n\\n /**\\n * @notice Gets tokens currently available for release\\n * @dev Considers the schedule and takes into account already released tokens\\n * @return Amount of tokens ready to be released\\n */\\n function releasableAmount() public view virtual override returns (uint256) {\\n // If a release start time is set no tokens are available for release before this date\\n // If not set it follows the default schedule and tokens are available on\\n // the first period passed\\n if (releaseStartTime > 0 && currentTime() < releaseStartTime) {\\n return 0;\\n }\\n\\n // Vesting cliff is activated and it has not passed means nothing is vested yet\\n // so funds cannot be released\\n if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\\n return 0;\\n }\\n\\n // A beneficiary can never have more releasable tokens than the contract balance\\n uint256 releasable = availableAmount().sub(releasedAmount);\\n return MathUtils.min(currentBalance(), releasable);\\n }\\n\\n /**\\n * @notice Gets the outstanding amount yet to be released based on the whole contract lifetime\\n * @dev Does not consider schedule but just global amounts tracked\\n * @return Amount of outstanding tokens for the lifetime of the contract\\n */\\n function totalOutstandingAmount() public view override returns (uint256) {\\n return managedAmount.sub(releasedAmount).sub(revokedAmount);\\n }\\n\\n /**\\n * @notice Gets surplus amount in the contract based on outstanding amount to release\\n * @dev All funds over outstanding amount is considered surplus that can be withdrawn by beneficiary\\n * @return Amount of tokens considered as surplus\\n */\\n function surplusAmount() public view override returns (uint256) {\\n uint256 balance = currentBalance();\\n uint256 outstandingAmount = totalOutstandingAmount();\\n if (balance > outstandingAmount) {\\n return balance.sub(outstandingAmount);\\n }\\n return 0;\\n }\\n\\n // -- Value Transfer --\\n\\n /**\\n * @notice Releases tokens based on the configured schedule\\n * @dev All available releasable tokens are transferred to beneficiary\\n */\\n function release() external override onlyBeneficiary {\\n uint256 amountToRelease = releasableAmount();\\n require(amountToRelease > 0, \\\"No available releasable amount\\\");\\n\\n releasedAmount = releasedAmount.add(amountToRelease);\\n\\n token.safeTransfer(beneficiary, amountToRelease);\\n\\n emit TokensReleased(beneficiary, amountToRelease);\\n }\\n\\n /**\\n * @notice Withdraws surplus, unmanaged tokens from the contract\\n * @dev Tokens in the contract over outstanding amount are considered as surplus\\n * @param _amount Amount of tokens to withdraw\\n */\\n function withdrawSurplus(uint256 _amount) external override onlyBeneficiary {\\n require(_amount > 0, \\\"Amount cannot be zero\\\");\\n require(surplusAmount() >= _amount, \\\"Amount requested > surplus available\\\");\\n\\n token.safeTransfer(beneficiary, _amount);\\n\\n emit TokensWithdrawn(beneficiary, _amount);\\n }\\n\\n /**\\n * @notice Revokes a vesting schedule and return the unvested tokens to the owner\\n * @dev Vesting schedule is always calculated based on managed tokens\\n */\\n function revoke() external override onlyOwner {\\n require(revocable == Revocability.Enabled, \\\"Contract is non-revocable\\\");\\n require(isRevoked == false, \\\"Already revoked\\\");\\n\\n uint256 unvestedAmount = managedAmount.sub(vestedAmount());\\n require(unvestedAmount > 0, \\\"No available unvested amount\\\");\\n\\n revokedAmount = unvestedAmount;\\n isRevoked = true;\\n\\n token.safeTransfer(owner(), unvestedAmount);\\n\\n emit TokensRevoked(beneficiary, unvestedAmount);\\n }\\n}\\n\",\"keccak256\":\"0x21a1dae4105ba9ff6d9bc38bf983ee853976346562fa284f4b67a3c7ca91a2bf\",\"license\":\"MIT\"},\"contracts/GraphTokenLockWallet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"@openzeppelin/contracts/math/SafeMath.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\\\";\\n\\nimport \\\"./GraphTokenLock.sol\\\";\\nimport \\\"./IGraphTokenLockManager.sol\\\";\\n\\n/**\\n * @title GraphTokenLockWallet\\n * @notice This contract is built on top of the base GraphTokenLock functionality.\\n * It allows wallet beneficiaries to use the deposited funds to perform specific function calls\\n * on specific contracts.\\n *\\n * The idea is that supporters with locked tokens can participate in the protocol\\n * but disallow any release before the vesting/lock schedule.\\n * The beneficiary can issue authorized function calls to this contract that will\\n * get forwarded to a target contract. A target contract is any of our protocol contracts.\\n * The function calls allowed are queried to the GraphTokenLockManager, this way\\n * the same configuration can be shared for all the created lock wallet contracts.\\n *\\n * NOTE: Contracts used as target must have its function signatures checked to avoid collisions\\n * with any of this contract functions.\\n * Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience\\n * the maximum amount of tokens is authorized.\\n */\\ncontract GraphTokenLockWallet is GraphTokenLock {\\n using SafeMath for uint256;\\n using SafeERC20 for IERC20;\\n\\n // -- State --\\n\\n IGraphTokenLockManager public manager;\\n uint256 public usedAmount;\\n\\n uint256 private constant MAX_UINT256 = 2**256 - 1;\\n\\n // -- Events --\\n\\n event ManagerUpdated(address indexed _oldManager, address indexed _newManager);\\n event TokenDestinationsApproved();\\n event TokenDestinationsRevoked();\\n\\n // Initializer\\n function initialize(\\n address _manager,\\n address _owner,\\n address _beneficiary,\\n address _token,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n Revocability _revocable\\n ) external {\\n _initialize(\\n _owner,\\n _beneficiary,\\n _token,\\n _managedAmount,\\n _startTime,\\n _endTime,\\n _periods,\\n _releaseStartTime,\\n _vestingCliffTime,\\n _revocable\\n );\\n _setManager(_manager);\\n }\\n\\n // -- Admin --\\n\\n /**\\n * @notice Sets a new manager for this contract\\n * @param _newManager Address of the new manager\\n */\\n function setManager(address _newManager) external onlyOwner {\\n _setManager(_newManager);\\n }\\n\\n /**\\n * @dev Sets a new manager for this contract\\n * @param _newManager Address of the new manager\\n */\\n function _setManager(address _newManager) private {\\n require(_newManager != address(0), \\\"Manager cannot be empty\\\");\\n require(Address.isContract(_newManager), \\\"Manager must be a contract\\\");\\n\\n address oldManager = address(manager);\\n manager = IGraphTokenLockManager(_newManager);\\n\\n emit ManagerUpdated(oldManager, _newManager);\\n }\\n\\n // -- Beneficiary --\\n\\n /**\\n * @notice Approves protocol access of the tokens managed by this contract\\n * @dev Approves all token destinations registered in the manager to pull tokens\\n */\\n function approveProtocol() external onlyBeneficiary {\\n address[] memory dstList = manager.getTokenDestinations();\\n for (uint256 i = 0; i < dstList.length; i++) {\\n token.safeApprove(dstList[i], MAX_UINT256);\\n }\\n emit TokenDestinationsApproved();\\n }\\n\\n /**\\n * @notice Revokes protocol access of the tokens managed by this contract\\n * @dev Revokes approval to all token destinations in the manager to pull tokens\\n */\\n function revokeProtocol() external onlyBeneficiary {\\n address[] memory dstList = manager.getTokenDestinations();\\n for (uint256 i = 0; i < dstList.length; i++) {\\n token.safeApprove(dstList[i], 0);\\n }\\n emit TokenDestinationsRevoked();\\n }\\n\\n /**\\n * @notice Gets tokens currently available for release\\n * @dev Considers the schedule, takes into account already released tokens and used amount\\n * @return Amount of tokens ready to be released\\n */\\n function releasableAmount() public view override returns (uint256) {\\n if (revocable == Revocability.Disabled) {\\n return super.releasableAmount();\\n }\\n\\n // -- Revocability enabled logic\\n // This needs to deal with additional considerations for when tokens are used in the protocol\\n\\n // If a release start time is set no tokens are available for release before this date\\n // If not set it follows the default schedule and tokens are available on\\n // the first period passed\\n if (releaseStartTime > 0 && currentTime() < releaseStartTime) {\\n return 0;\\n }\\n\\n // Vesting cliff is activated and it has not passed means nothing is vested yet\\n // so funds cannot be released\\n if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\\n return 0;\\n }\\n\\n // A beneficiary can never have more releasable tokens than the contract balance\\n // We consider the `usedAmount` in the protocol as part of the calculations\\n // the beneficiary should not release funds that are used.\\n uint256 releasable = availableAmount().sub(releasedAmount).sub(usedAmount);\\n return MathUtils.min(currentBalance(), releasable);\\n }\\n\\n /**\\n * @notice Forward authorized contract calls to protocol contracts\\n * @dev Fallback function can be called by the beneficiary only if function call is allowed\\n */\\n fallback() external payable {\\n // Only beneficiary can forward calls\\n require(msg.sender == beneficiary, \\\"Unauthorized caller\\\");\\n\\n // Function call validation\\n address _target = manager.getAuthFunctionCallTarget(msg.sig);\\n require(_target != address(0), \\\"Unauthorized function\\\");\\n\\n uint256 oldBalance = currentBalance();\\n\\n // Call function with data\\n Address.functionCall(_target, msg.data);\\n\\n // Tracked used tokens in the protocol\\n // We do this check after balances were updated by the forwarded call\\n // Check is only enforced for revocable contracts to save some gas\\n if (revocable == Revocability.Enabled) {\\n // Track contract balance change\\n uint256 newBalance = currentBalance();\\n if (newBalance < oldBalance) {\\n // Outflow\\n uint256 diff = oldBalance.sub(newBalance);\\n usedAmount = usedAmount.add(diff);\\n } else {\\n // Inflow: We can receive profits from the protocol, that could make usedAmount to\\n // underflow. We set it to zero in that case.\\n uint256 diff = newBalance.sub(oldBalance);\\n usedAmount = (diff >= usedAmount) ? 0 : usedAmount.sub(diff);\\n }\\n require(usedAmount <= vestedAmount(), \\\"Cannot use more tokens than vested amount\\\");\\n }\\n }\\n}\\n\",\"keccak256\":\"0x5efc82d408fe81193664e67d614ca6299eafb00163ecc7819fad77cf0d35a2eb\",\"license\":\"MIT\"},\"contracts/IGraphTokenLock.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\ninterface IGraphTokenLock {\\n enum Revocability {\\n NotSet,\\n Enabled,\\n Disabled\\n }\\n\\n // -- Balances --\\n\\n function currentBalance() external view returns (uint256);\\n\\n // -- Time & Periods --\\n\\n function currentTime() external view returns (uint256);\\n\\n function duration() external view returns (uint256);\\n\\n function sinceStartTime() external view returns (uint256);\\n\\n function amountPerPeriod() external view returns (uint256);\\n\\n function periodDuration() external view returns (uint256);\\n\\n function currentPeriod() external view returns (uint256);\\n\\n function passedPeriods() external view returns (uint256);\\n\\n // -- Locking & Release Schedule --\\n\\n function availableAmount() external view returns (uint256);\\n\\n function vestedAmount() external view returns (uint256);\\n\\n function releasableAmount() external view returns (uint256);\\n\\n function totalOutstandingAmount() external view returns (uint256);\\n\\n function surplusAmount() external view returns (uint256);\\n\\n // -- Value Transfer --\\n\\n function release() external;\\n\\n function withdrawSurplus(uint256 _amount) external;\\n\\n function revoke() external;\\n}\\n\",\"keccak256\":\"0xceb9d258276fe25ec858191e1deae5778f1b2f612a669fb7b37bab1a064756ab\",\"license\":\"MIT\"},\"contracts/IGraphTokenLockManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nimport \\\"./IGraphTokenLock.sol\\\";\\n\\ninterface IGraphTokenLockManager {\\n // -- Factory --\\n\\n function setMasterCopy(address _masterCopy) external;\\n\\n function createTokenLockWallet(\\n address _owner,\\n address _beneficiary,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n IGraphTokenLock.Revocability _revocable\\n ) external;\\n\\n // -- Funds Management --\\n\\n function token() external returns (IERC20);\\n\\n function deposit(uint256 _amount) external;\\n\\n function withdraw(uint256 _amount) external;\\n\\n // -- Allowed Funds Destinations --\\n\\n function addTokenDestination(address _dst) external;\\n\\n function removeTokenDestination(address _dst) external;\\n\\n function isTokenDestination(address _dst) external view returns (bool);\\n\\n function getTokenDestinations() external view returns (address[] memory);\\n\\n // -- Function Call Authorization --\\n\\n function setAuthFunctionCall(string calldata _signature, address _target) external;\\n\\n function unsetAuthFunctionCall(string calldata _signature) external;\\n\\n function setAuthFunctionCallMany(string[] calldata _signatures, address[] calldata _targets) external;\\n\\n function getAuthFunctionCallTarget(bytes4 _sigHash) external view returns (address);\\n\\n function isAuthFunctionCall(bytes4 _sigHash) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x2d78d41909a6de5b316ac39b100ea087a8f317cf306379888a045523e15c4d9a\",\"license\":\"MIT\"},\"contracts/MathUtils.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nlibrary MathUtils {\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n}\\n\",\"keccak256\":\"0xe2512e1da48bc8363acd15f66229564b02d66706665d7da740604566913c1400\",\"license\":\"MIT\"},\"contracts/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * The owner account will be passed on initialization of the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\ncontract Ownable {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n function initialize(address owner) internal {\\n _owner = owner;\\n emit OwnershipTransferred(address(0), owner);\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(_owner == msg.sender, \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() external virtual onlyOwner {\\n emit OwnershipTransferred(_owner, address(0));\\n _owner = address(0);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) external virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n emit OwnershipTransferred(_owner, newOwner);\\n _owner = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0xc93c7362ac4d74b624b48517985f92c277ce90ae6e5ccb706e70a61af5752077\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b50613e61806100206000396000f3fe6080604052600436106102555760003560e01c806386d00e0211610139578063bc0163c1116100b6578063dc0706571161007a578063dc07065714610d0e578063e8dda6f514610d5f578063e97d87d514610d8a578063ebbab99214610db5578063f2fde38b14610de0578063fc0c546a14610e3157610256565b8063bc0163c114610b41578063bd896dcb14610b6c578063ce845d1d14610c67578063d0ebdbe714610c92578063d18e81b314610ce357610256565b806391f7cfb9116100fd57806391f7cfb914610a6e578063a4caeb4214610a99578063b0d1818c14610ac4578063b470aade14610aff578063b6549f7514610b2a57610256565b806386d00e021461099e57806386d1a69f146109c9578063872a7810146109e05780638a5bdf5c14610a165780638da5cb5b14610a2d57610256565b8063392e53cd116101d25780635051a5ec116101965780635051a5ec146108c25780635b940081146108ef57806360e799441461091a578063715018a61461093157806378e97925146109485780637bdf05af1461097357610256565b8063392e53cd146107d3578063398057a31461080057806344b1231f1461082b57806345d30a1714610856578063481c6a751461088157610256565b80632a627814116102195780632a627814146106f85780632bc9ed021461070f5780633197cbb61461073c57806337aeb0861461076757806338af3eed1461079257610256565b8063029c6c9f1461063557806306040618146106605780630b80f7771461068b5780630dff24d5146106a25780630fb5a6b4146106cd57610256565b5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610319576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f556e617574686f72697a65642063616c6c65720000000000000000000000000081525060200191505060405180910390fd5b6000600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f1d24c456000357fffffffff00000000000000000000000000000000000000000000000000000000166040518263ffffffff1660e01b815260040180827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200191505060206040518083038186803b1580156103d157600080fd5b505afa1580156103e5573d6000803e3d6000fd5b505050506040513d60208110156103fb57600080fd5b81019080805190602001909291905050509050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156104b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f556e617574686f72697a65642066756e6374696f6e000000000000000000000081525060200191505060405180910390fd5b60006104bb610e72565b905061050c826000368080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610f3d565b506001600281111561051a57fe5b600960009054906101000a900460ff16600281111561053557fe5b1415610631576000610545610e72565b9050818110156105875760006105648284610f8790919063ffffffff16565b905061057b81600d5461100a90919063ffffffff16565b600d81905550506105cd565b600061059c8383610f8790919063ffffffff16565b9050600d548110156105c2576105bd81600d54610f8790919063ffffffff16565b6105c5565b60005b600d81905550505b6105d5611092565b600d54111561062f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613d346029913960400191505060405180910390fd5b505b5050005b34801561064157600080fd5b5061064a611101565b6040518082815260200191505060405180910390f35b34801561066c57600080fd5b5061067561111f565b6040518082815260200191505060405180910390f35b34801561069757600080fd5b506106a061115a565b005b3480156106ae57600080fd5b506106b761132d565b6040518082815260200191505060405180910390f35b3480156106d957600080fd5b506106e2611374565b6040518082815260200191505060405180910390f35b34801561070457600080fd5b5061070d611392565b005b34801561071b57600080fd5b5061072461165f565b60405180821515815260200191505060405180910390f35b34801561074857600080fd5b50610751611672565b6040518082815260200191505060405180910390f35b34801561077357600080fd5b5061077c611678565b6040518082815260200191505060405180910390f35b34801561079e57600080fd5b506107a761167e565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156107df57600080fd5b506107e86116a4565b60405180821515815260200191505060405180910390f35b34801561080c57600080fd5b506108156116b7565b6040518082815260200191505060405180910390f35b34801561083757600080fd5b50610840611092565b6040518082815260200191505060405180910390f35b34801561086257600080fd5b5061086b6116bd565b6040518082815260200191505060405180910390f35b34801561088d57600080fd5b506108966116c3565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156108ce57600080fd5b506108d76116e9565b60405180821515815260200191505060405180910390f35b3480156108fb57600080fd5b506109046116fc565b6040518082815260200191505060405180910390f35b34801561092657600080fd5b5061092f611807565b005b34801561093d57600080fd5b50610946611ab5565b005b34801561095457600080fd5b5061095d611c34565b6040518082815260200191505060405180910390f35b34801561097f57600080fd5b50610988611c3a565b6040518082815260200191505060405180910390f35b3480156109aa57600080fd5b506109b3611c76565b6040518082815260200191505060405180910390f35b3480156109d557600080fd5b506109de611c7c565b005b3480156109ec57600080fd5b506109f5611ebe565b60405180826002811115610a0557fe5b815260200191505060405180910390f35b348015610a2257600080fd5b50610a2b611ed1565b005b348015610a3957600080fd5b50610a42611fdd565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610a7a57600080fd5b50610a83612006565b6040518082815260200191505060405180910390f35b348015610aa557600080fd5b50610aae612064565b6040518082815260200191505060405180910390f35b348015610ad057600080fd5b50610afd60048036036020811015610ae757600080fd5b810190808035906020019092919050505061206a565b005b348015610b0b57600080fd5b50610b146122e5565b6040518082815260200191505060405180910390f35b348015610b3657600080fd5b50610b3f612308565b005b348015610b4d57600080fd5b50610b5661266c565b6040518082815260200191505060405180910390f35b348015610b7857600080fd5b50610c656004803603610160811015610b9057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190803560ff16906020019092919050505061269e565b005b348015610c7357600080fd5b50610c7c610e72565b6040518082815260200191505060405180910390f35b348015610c9e57600080fd5b50610ce160048036036020811015610cb557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506126c6565b005b348015610cef57600080fd5b50610cf8612793565b6040518082815260200191505060405180910390f35b348015610d1a57600080fd5b50610d5d60048036036020811015610d3157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061279b565b005b348015610d6b57600080fd5b50610d74612992565b6040518082815260200191505060405180910390f35b348015610d9657600080fd5b50610d9f612998565b6040518082815260200191505060405180910390f35b348015610dc157600080fd5b50610dca61299e565b6040518082815260200191505060405180910390f35b348015610dec57600080fd5b50610e2f60048036036020811015610e0357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506129c0565b005b348015610e3d57600080fd5b50610e46612bc4565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610efd57600080fd5b505afa158015610f11573d6000803e3d6000fd5b505050506040513d6020811015610f2757600080fd5b8101908080519060200190929190505050905090565b6060610f7f83836040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c65640000815250612bea565b905092915050565b600082821115610fff576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525060200191505060405180910390fd5b818303905092915050565b600080828401905083811015611088576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b60006002808111156110a057fe5b600960009054906101000a900460ff1660028111156110bb57fe5b14156110cb5760035490506110fe565b60006008541180156110e557506008546110e3612793565b105b156110f357600090506110fe565b6110fb612006565b90505b90565b600061111a600654600354612c0290919063ffffffff16565b905090565b600061115560016111476111316122e5565b611139611c3a565b612c0290919063ffffffff16565b61100a90919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461121b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60001515600960039054906101000a900460ff161515146112a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f43616e6e6f742063616e63656c20616363657074656420636f6e74726163740081525060200191505060405180910390fd5b6112ff6112af611fdd565b6112b7610e72565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612c8b9092919063ffffffff16565b7f171f0bcbda3370351cea17f3b164bee87d77c2503b94abdf2720a814ebe7e9df60405160405180910390a1565b600080611338610e72565b9050600061134461266c565b90508082111561136a576113618183610f8790919063ffffffff16565b92505050611371565b6000925050505b90565b600061138d600454600554610f8790919063ffffffff16565b905090565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611455576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6060600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a34574666040518163ffffffff1660e01b815260040160006040518083038186803b1580156114bf57600080fd5b505afa1580156114d3573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525060208110156114fd57600080fd5b810190808051604051939291908464010000000082111561151d57600080fd5b8382019150602082018581111561153357600080fd5b825186602082028301116401000000008211171561155057600080fd5b8083526020830192505050908051906020019060200280838360005b8381101561158757808201518184015260208101905061156c565b50505050905001604052505050905060005b815181101561162f576116228282815181106115b157fe5b60200260200101517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612d2d9092919063ffffffff16565b8080600101915050611599565b507fb837fd51506ba3cc623a37c78ed22fd521f2f6e9f69a34d5c2a4a9474f27579360405160405180910390a150565b600960019054906101000a900460ff1681565b60055481565b600b5481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600960029054906101000a900460ff1681565b60035481565b600a5481565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600960039054906101000a900460ff1681565b600060028081111561170a57fe5b600960009054906101000a900460ff16600281111561172557fe5b141561173a57611733612ef2565b9050611804565b60006007541180156117545750600754611752612793565b105b156117625760009050611804565b6001600281111561176f57fe5b600960009054906101000a900460ff16600281111561178a57fe5b14801561179957506000600854115b80156117ad57506008546117ab612793565b105b156117bb5760009050611804565b60006117ed600d546117df600a546117d1612006565b610f8790919063ffffffff16565b610f8790919063ffffffff16565b90506118006117fa610e72565b82612fac565b9150505b90565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146118ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6060600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a34574666040518163ffffffff1660e01b815260040160006040518083038186803b15801561193457600080fd5b505afa158015611948573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250602081101561197257600080fd5b810190808051604051939291908464010000000082111561199257600080fd5b838201915060208201858111156119a857600080fd5b82518660208202830111640100000000821117156119c557600080fd5b8083526020830192505050908051906020019060200280838360005b838110156119fc5780820151818401526020810190506119e1565b50505050905001604052505050905060005b8151811015611a8557611a78828281518110611a2657fe5b60200260200101516000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612d2d9092919063ffffffff16565b8080600101915050611a0e565b507f6d317a20ba9d790014284bef285283cd61fde92e0f2711050f563a9d2cf4171160405160405180910390a150565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611b76576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60045481565b600080611c45612793565b90506004548111611c5a576000915050611c73565b611c6f60045482610f8790919063ffffffff16565b9150505b90565b60085481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611d3f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000611d496116fc565b905060008111611dc1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f4e6f20617661696c61626c652072656c65617361626c6520616d6f756e74000081525060200191505060405180910390fd5b611dd681600a5461100a90919063ffffffff16565b600a81905550611e4b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612c8b9092919063ffffffff16565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fc7798891864187665ac6dd119286e44ec13f014527aeeb2b8eb3fd413df93179826040518082815260200191505060405180910390a250565b600960009054906101000a900460ff1681565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611f94576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6001600960036101000a81548160ff0219169083151502179055507fbeb3313724453131feb0a765a03e6715bb720e0f973a31fcbafa2d2f048c188b60405160405180910390a1565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600080612011612793565b9050600454811015612027576000915050612061565b60055481111561203c57600354915050612061565b61205d612047611101565b61204f61299e565b612fc590919063ffffffff16565b9150505b90565b60065481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461212d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600081116121a3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f416d6f756e742063616e6e6f74206265207a65726f000000000000000000000081525060200191505060405180910390fd5b806121ac61132d565b1015612203576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613d7e6024913960400191505060405180910390fd5b612272600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612c8b9092919063ffffffff16565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b826040518082815260200191505060405180910390a250565b60006123036006546122f5611374565b612c0290919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146123c9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600160028111156123d657fe5b600960009054906101000a900460ff1660028111156123f157fe5b14612464576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f436f6e7472616374206973206e6f6e2d7265766f6361626c650000000000000081525060200191505060405180910390fd5b60001515600960019054906101000a900460ff161515146124ed576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f416c7265616479207265766f6b6564000000000000000000000000000000000081525060200191505060405180910390fd5b600061250b6124fa611092565b600354610f8790919063ffffffff16565b905060008111612583576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f4e6f20617661696c61626c6520756e76657374656420616d6f756e740000000081525060200191505060405180910390fd5b80600b819055506001600960016101000a81548160ff0219169083151502179055506125f96125b0611fdd565b82600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612c8b9092919063ffffffff16565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fb73c49a3a37a7aca291ba0ceaa41657012def406106a7fc386888f0f66e941cf826040518082815260200191505060405180910390a250565b6000612699600b5461268b600a54600354610f8790919063ffffffff16565b610f8790919063ffffffff16565b905090565b6126b08a8a8a8a8a8a8a8a8a8a61304b565b6126b98b6136cc565b5050505050505050505050565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612787576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b612790816136cc565b50565b600042905090565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461285e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612901576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f456d7074792062656e656669636961727900000000000000000000000000000081525060200191505060405180910390fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f373c72efabe4ef3e552ff77838be729f3bc3d8c586df0012902d1baa2377fa1d81604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b600d5481565b60075481565b60006129bb60016129ad61111f565b610f8790919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612a81576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612b07576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180613ce86026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6060612bf984846000856138b0565b90509392505050565b6000808211612c79576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525060200191505060405180910390fd5b818381612c8257fe5b04905092915050565b612d288363a9059cbb60e01b8484604051602401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050613a59565b505050565b6000811480612dfb575060008373ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e30856040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b158015612dbe57600080fd5b505afa158015612dd2573d6000803e3d6000fd5b505050506040513d6020811015612de857600080fd5b8101908080519060200190929190505050145b612e50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526036815260200180613df66036913960400191505060405180910390fd5b612eed8363095ea7b360e01b8484604051602401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050613a59565b505050565b600080600754118015612f0d5750600754612f0b612793565b105b15612f1b5760009050612fa9565b60016002811115612f2857fe5b600960009054906101000a900460ff166002811115612f4357fe5b148015612f5257506000600854115b8015612f665750600854612f64612793565b105b15612f745760009050612fa9565b6000612f92600a54612f84612006565b610f8790919063ffffffff16565b9050612fa5612f9f610e72565b82612fac565b9150505b90565b6000818310612fbb5781612fbd565b825b905092915050565b600080831415612fd85760009050613045565b6000828402905082848281612fe957fe5b0414613040576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613d5d6021913960400191505060405180910390fd5b809150505b92915050565b600960029054906101000a900460ff16156130ce576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f416c726561647920696e697469616c697a65640000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff161415613171576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f4f776e65722063616e6e6f74206265207a65726f00000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff161415613214576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f42656e65666963696172792063616e6e6f74206265207a65726f00000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff1614156132b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f546f6b656e2063616e6e6f74206265207a65726f00000000000000000000000081525060200191505060405180910390fd5b6000871161332d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f4d616e6167656420746f6b656e732063616e6e6f74206265207a65726f00000081525060200191505060405180910390fd5b60008614156133a4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53746172742074696d65206d757374206265207365740000000000000000000081525060200191505060405180910390fd5b848610613419576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f53746172742074696d65203e20656e642074696d65000000000000000000000081525060200191505060405180910390fd5b6001841015613490576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f506572696f64732063616e6e6f742062652062656c6f77206d696e696d756d0081525060200191505060405180910390fd5b6000600281111561349d57fe5b8160028111156134a957fe5b141561351d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f4d757374207365742061207265766f636162696c697479206f7074696f6e000081525060200191505060405180910390fd5b848310613575576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613da2602a913960400191505060405180910390fd5b8482106135cd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613cc66022913960400191505060405180910390fd5b6001600960026101000a81548160ff0219169083151502179055506135f18a613b48565b88600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555087600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555086600381905550856004819055508460058190555083600681905550826007819055508160088190555080600960006101000a81548160ff021916908360028111156136bb57fe5b021790555050505050505050505050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561376f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4d616e616765722063616e6e6f7420626520656d70747900000000000000000081525060200191505060405180910390fd5b61377881613be6565b6137ea576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f4d616e61676572206d757374206265206120636f6e747261637400000000000081525060200191505060405180910390fd5b6000600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fdac3632743b879638fd2d51c4d3c1dd796615b4758a55b50b0c19b971ba9fbc760405160405180910390a35050565b60608247101561390b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180613d0e6026913960400191505060405180910390fd5b61391485613be6565b613986576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000081525060200191505060405180910390fd5b600060608673ffffffffffffffffffffffffffffffffffffffff1685876040518082805190602001908083835b602083106139d657805182526020820191506020810190506020830392506139b3565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114613a38576040519150601f19603f3d011682016040523d82523d6000602084013e613a3d565b606091505b5091509150613a4d828286613bf9565b92505050949350505050565b6060613abb826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16612bea9092919063ffffffff16565b9050600081511115613b4357808060200190516020811015613adc57600080fd5b8101908080519060200190929190505050613b42576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613dcc602a913960400191505060405180910390fd5b5b505050565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a350565b600080823b905060008111915050919050565b60608315613c0957829050613cbe565b600083511115613c1c5782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015613c83578082015181840152602081019050613c68565b50505050905090810190601f168015613cb05780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b939250505056fe436c6966662074696d65206d757374206265206265666f726520656e642074696d654f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c43616e6e6f7420757365206d6f726520746f6b656e73207468616e2076657374656420616d6f756e74536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77416d6f756e7420726571756573746564203e20737572706c757320617661696c61626c6552656c656173652073746172742074696d65206d757374206265206265666f726520656e642074696d655361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565645361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f20746f206e6f6e2d7a65726f20616c6c6f77616e6365a26469706673582212203c6b20b5a223b9b9c9f0008dfba22c9fb703c6524c0f0a76a2b156733f6d573464736f6c63430007030033", + "deployedBytecode": "0x6080604052600436106102555760003560e01c806386d00e0211610139578063bc0163c1116100b6578063dc0706571161007a578063dc07065714610d0e578063e8dda6f514610d5f578063e97d87d514610d8a578063ebbab99214610db5578063f2fde38b14610de0578063fc0c546a14610e3157610256565b8063bc0163c114610b41578063bd896dcb14610b6c578063ce845d1d14610c67578063d0ebdbe714610c92578063d18e81b314610ce357610256565b806391f7cfb9116100fd57806391f7cfb914610a6e578063a4caeb4214610a99578063b0d1818c14610ac4578063b470aade14610aff578063b6549f7514610b2a57610256565b806386d00e021461099e57806386d1a69f146109c9578063872a7810146109e05780638a5bdf5c14610a165780638da5cb5b14610a2d57610256565b8063392e53cd116101d25780635051a5ec116101965780635051a5ec146108c25780635b940081146108ef57806360e799441461091a578063715018a61461093157806378e97925146109485780637bdf05af1461097357610256565b8063392e53cd146107d3578063398057a31461080057806344b1231f1461082b57806345d30a1714610856578063481c6a751461088157610256565b80632a627814116102195780632a627814146106f85780632bc9ed021461070f5780633197cbb61461073c57806337aeb0861461076757806338af3eed1461079257610256565b8063029c6c9f1461063557806306040618146106605780630b80f7771461068b5780630dff24d5146106a25780630fb5a6b4146106cd57610256565b5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610319576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f556e617574686f72697a65642063616c6c65720000000000000000000000000081525060200191505060405180910390fd5b6000600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f1d24c456000357fffffffff00000000000000000000000000000000000000000000000000000000166040518263ffffffff1660e01b815260040180827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200191505060206040518083038186803b1580156103d157600080fd5b505afa1580156103e5573d6000803e3d6000fd5b505050506040513d60208110156103fb57600080fd5b81019080805190602001909291905050509050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156104b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f556e617574686f72697a65642066756e6374696f6e000000000000000000000081525060200191505060405180910390fd5b60006104bb610e72565b905061050c826000368080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610f3d565b506001600281111561051a57fe5b600960009054906101000a900460ff16600281111561053557fe5b1415610631576000610545610e72565b9050818110156105875760006105648284610f8790919063ffffffff16565b905061057b81600d5461100a90919063ffffffff16565b600d81905550506105cd565b600061059c8383610f8790919063ffffffff16565b9050600d548110156105c2576105bd81600d54610f8790919063ffffffff16565b6105c5565b60005b600d81905550505b6105d5611092565b600d54111561062f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613d346029913960400191505060405180910390fd5b505b5050005b34801561064157600080fd5b5061064a611101565b6040518082815260200191505060405180910390f35b34801561066c57600080fd5b5061067561111f565b6040518082815260200191505060405180910390f35b34801561069757600080fd5b506106a061115a565b005b3480156106ae57600080fd5b506106b761132d565b6040518082815260200191505060405180910390f35b3480156106d957600080fd5b506106e2611374565b6040518082815260200191505060405180910390f35b34801561070457600080fd5b5061070d611392565b005b34801561071b57600080fd5b5061072461165f565b60405180821515815260200191505060405180910390f35b34801561074857600080fd5b50610751611672565b6040518082815260200191505060405180910390f35b34801561077357600080fd5b5061077c611678565b6040518082815260200191505060405180910390f35b34801561079e57600080fd5b506107a761167e565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156107df57600080fd5b506107e86116a4565b60405180821515815260200191505060405180910390f35b34801561080c57600080fd5b506108156116b7565b6040518082815260200191505060405180910390f35b34801561083757600080fd5b50610840611092565b6040518082815260200191505060405180910390f35b34801561086257600080fd5b5061086b6116bd565b6040518082815260200191505060405180910390f35b34801561088d57600080fd5b506108966116c3565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156108ce57600080fd5b506108d76116e9565b60405180821515815260200191505060405180910390f35b3480156108fb57600080fd5b506109046116fc565b6040518082815260200191505060405180910390f35b34801561092657600080fd5b5061092f611807565b005b34801561093d57600080fd5b50610946611ab5565b005b34801561095457600080fd5b5061095d611c34565b6040518082815260200191505060405180910390f35b34801561097f57600080fd5b50610988611c3a565b6040518082815260200191505060405180910390f35b3480156109aa57600080fd5b506109b3611c76565b6040518082815260200191505060405180910390f35b3480156109d557600080fd5b506109de611c7c565b005b3480156109ec57600080fd5b506109f5611ebe565b60405180826002811115610a0557fe5b815260200191505060405180910390f35b348015610a2257600080fd5b50610a2b611ed1565b005b348015610a3957600080fd5b50610a42611fdd565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610a7a57600080fd5b50610a83612006565b6040518082815260200191505060405180910390f35b348015610aa557600080fd5b50610aae612064565b6040518082815260200191505060405180910390f35b348015610ad057600080fd5b50610afd60048036036020811015610ae757600080fd5b810190808035906020019092919050505061206a565b005b348015610b0b57600080fd5b50610b146122e5565b6040518082815260200191505060405180910390f35b348015610b3657600080fd5b50610b3f612308565b005b348015610b4d57600080fd5b50610b5661266c565b6040518082815260200191505060405180910390f35b348015610b7857600080fd5b50610c656004803603610160811015610b9057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190803560ff16906020019092919050505061269e565b005b348015610c7357600080fd5b50610c7c610e72565b6040518082815260200191505060405180910390f35b348015610c9e57600080fd5b50610ce160048036036020811015610cb557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506126c6565b005b348015610cef57600080fd5b50610cf8612793565b6040518082815260200191505060405180910390f35b348015610d1a57600080fd5b50610d5d60048036036020811015610d3157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061279b565b005b348015610d6b57600080fd5b50610d74612992565b6040518082815260200191505060405180910390f35b348015610d9657600080fd5b50610d9f612998565b6040518082815260200191505060405180910390f35b348015610dc157600080fd5b50610dca61299e565b6040518082815260200191505060405180910390f35b348015610dec57600080fd5b50610e2f60048036036020811015610e0357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506129c0565b005b348015610e3d57600080fd5b50610e46612bc4565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610efd57600080fd5b505afa158015610f11573d6000803e3d6000fd5b505050506040513d6020811015610f2757600080fd5b8101908080519060200190929190505050905090565b6060610f7f83836040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c65640000815250612bea565b905092915050565b600082821115610fff576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525060200191505060405180910390fd5b818303905092915050565b600080828401905083811015611088576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b60006002808111156110a057fe5b600960009054906101000a900460ff1660028111156110bb57fe5b14156110cb5760035490506110fe565b60006008541180156110e557506008546110e3612793565b105b156110f357600090506110fe565b6110fb612006565b90505b90565b600061111a600654600354612c0290919063ffffffff16565b905090565b600061115560016111476111316122e5565b611139611c3a565b612c0290919063ffffffff16565b61100a90919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461121b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60001515600960039054906101000a900460ff161515146112a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f43616e6e6f742063616e63656c20616363657074656420636f6e74726163740081525060200191505060405180910390fd5b6112ff6112af611fdd565b6112b7610e72565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612c8b9092919063ffffffff16565b7f171f0bcbda3370351cea17f3b164bee87d77c2503b94abdf2720a814ebe7e9df60405160405180910390a1565b600080611338610e72565b9050600061134461266c565b90508082111561136a576113618183610f8790919063ffffffff16565b92505050611371565b6000925050505b90565b600061138d600454600554610f8790919063ffffffff16565b905090565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611455576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6060600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a34574666040518163ffffffff1660e01b815260040160006040518083038186803b1580156114bf57600080fd5b505afa1580156114d3573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525060208110156114fd57600080fd5b810190808051604051939291908464010000000082111561151d57600080fd5b8382019150602082018581111561153357600080fd5b825186602082028301116401000000008211171561155057600080fd5b8083526020830192505050908051906020019060200280838360005b8381101561158757808201518184015260208101905061156c565b50505050905001604052505050905060005b815181101561162f576116228282815181106115b157fe5b60200260200101517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612d2d9092919063ffffffff16565b8080600101915050611599565b507fb837fd51506ba3cc623a37c78ed22fd521f2f6e9f69a34d5c2a4a9474f27579360405160405180910390a150565b600960019054906101000a900460ff1681565b60055481565b600b5481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600960029054906101000a900460ff1681565b60035481565b600a5481565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600960039054906101000a900460ff1681565b600060028081111561170a57fe5b600960009054906101000a900460ff16600281111561172557fe5b141561173a57611733612ef2565b9050611804565b60006007541180156117545750600754611752612793565b105b156117625760009050611804565b6001600281111561176f57fe5b600960009054906101000a900460ff16600281111561178a57fe5b14801561179957506000600854115b80156117ad57506008546117ab612793565b105b156117bb5760009050611804565b60006117ed600d546117df600a546117d1612006565b610f8790919063ffffffff16565b610f8790919063ffffffff16565b90506118006117fa610e72565b82612fac565b9150505b90565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146118ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6060600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a34574666040518163ffffffff1660e01b815260040160006040518083038186803b15801561193457600080fd5b505afa158015611948573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250602081101561197257600080fd5b810190808051604051939291908464010000000082111561199257600080fd5b838201915060208201858111156119a857600080fd5b82518660208202830111640100000000821117156119c557600080fd5b8083526020830192505050908051906020019060200280838360005b838110156119fc5780820151818401526020810190506119e1565b50505050905001604052505050905060005b8151811015611a8557611a78828281518110611a2657fe5b60200260200101516000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612d2d9092919063ffffffff16565b8080600101915050611a0e565b507f6d317a20ba9d790014284bef285283cd61fde92e0f2711050f563a9d2cf4171160405160405180910390a150565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611b76576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60045481565b600080611c45612793565b90506004548111611c5a576000915050611c73565b611c6f60045482610f8790919063ffffffff16565b9150505b90565b60085481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611d3f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000611d496116fc565b905060008111611dc1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f4e6f20617661696c61626c652072656c65617361626c6520616d6f756e74000081525060200191505060405180910390fd5b611dd681600a5461100a90919063ffffffff16565b600a81905550611e4b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612c8b9092919063ffffffff16565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fc7798891864187665ac6dd119286e44ec13f014527aeeb2b8eb3fd413df93179826040518082815260200191505060405180910390a250565b600960009054906101000a900460ff1681565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611f94576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6001600960036101000a81548160ff0219169083151502179055507fbeb3313724453131feb0a765a03e6715bb720e0f973a31fcbafa2d2f048c188b60405160405180910390a1565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600080612011612793565b9050600454811015612027576000915050612061565b60055481111561203c57600354915050612061565b61205d612047611101565b61204f61299e565b612fc590919063ffffffff16565b9150505b90565b60065481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461212d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600081116121a3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f416d6f756e742063616e6e6f74206265207a65726f000000000000000000000081525060200191505060405180910390fd5b806121ac61132d565b1015612203576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613d7e6024913960400191505060405180910390fd5b612272600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612c8b9092919063ffffffff16565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b826040518082815260200191505060405180910390a250565b60006123036006546122f5611374565b612c0290919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146123c9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600160028111156123d657fe5b600960009054906101000a900460ff1660028111156123f157fe5b14612464576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f436f6e7472616374206973206e6f6e2d7265766f6361626c650000000000000081525060200191505060405180910390fd5b60001515600960019054906101000a900460ff161515146124ed576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f416c7265616479207265766f6b6564000000000000000000000000000000000081525060200191505060405180910390fd5b600061250b6124fa611092565b600354610f8790919063ffffffff16565b905060008111612583576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f4e6f20617661696c61626c6520756e76657374656420616d6f756e740000000081525060200191505060405180910390fd5b80600b819055506001600960016101000a81548160ff0219169083151502179055506125f96125b0611fdd565b82600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612c8b9092919063ffffffff16565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fb73c49a3a37a7aca291ba0ceaa41657012def406106a7fc386888f0f66e941cf826040518082815260200191505060405180910390a250565b6000612699600b5461268b600a54600354610f8790919063ffffffff16565b610f8790919063ffffffff16565b905090565b6126b08a8a8a8a8a8a8a8a8a8a61304b565b6126b98b6136cc565b5050505050505050505050565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612787576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b612790816136cc565b50565b600042905090565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461285e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612901576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f456d7074792062656e656669636961727900000000000000000000000000000081525060200191505060405180910390fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f373c72efabe4ef3e552ff77838be729f3bc3d8c586df0012902d1baa2377fa1d81604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b600d5481565b60075481565b60006129bb60016129ad61111f565b610f8790919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612a81576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612b07576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180613ce86026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6060612bf984846000856138b0565b90509392505050565b6000808211612c79576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525060200191505060405180910390fd5b818381612c8257fe5b04905092915050565b612d288363a9059cbb60e01b8484604051602401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050613a59565b505050565b6000811480612dfb575060008373ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e30856040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b158015612dbe57600080fd5b505afa158015612dd2573d6000803e3d6000fd5b505050506040513d6020811015612de857600080fd5b8101908080519060200190929190505050145b612e50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526036815260200180613df66036913960400191505060405180910390fd5b612eed8363095ea7b360e01b8484604051602401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050613a59565b505050565b600080600754118015612f0d5750600754612f0b612793565b105b15612f1b5760009050612fa9565b60016002811115612f2857fe5b600960009054906101000a900460ff166002811115612f4357fe5b148015612f5257506000600854115b8015612f665750600854612f64612793565b105b15612f745760009050612fa9565b6000612f92600a54612f84612006565b610f8790919063ffffffff16565b9050612fa5612f9f610e72565b82612fac565b9150505b90565b6000818310612fbb5781612fbd565b825b905092915050565b600080831415612fd85760009050613045565b6000828402905082848281612fe957fe5b0414613040576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613d5d6021913960400191505060405180910390fd5b809150505b92915050565b600960029054906101000a900460ff16156130ce576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f416c726561647920696e697469616c697a65640000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff161415613171576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f4f776e65722063616e6e6f74206265207a65726f00000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff161415613214576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f42656e65666963696172792063616e6e6f74206265207a65726f00000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff1614156132b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f546f6b656e2063616e6e6f74206265207a65726f00000000000000000000000081525060200191505060405180910390fd5b6000871161332d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f4d616e6167656420746f6b656e732063616e6e6f74206265207a65726f00000081525060200191505060405180910390fd5b60008614156133a4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53746172742074696d65206d757374206265207365740000000000000000000081525060200191505060405180910390fd5b848610613419576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f53746172742074696d65203e20656e642074696d65000000000000000000000081525060200191505060405180910390fd5b6001841015613490576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f506572696f64732063616e6e6f742062652062656c6f77206d696e696d756d0081525060200191505060405180910390fd5b6000600281111561349d57fe5b8160028111156134a957fe5b141561351d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f4d757374207365742061207265766f636162696c697479206f7074696f6e000081525060200191505060405180910390fd5b848310613575576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613da2602a913960400191505060405180910390fd5b8482106135cd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613cc66022913960400191505060405180910390fd5b6001600960026101000a81548160ff0219169083151502179055506135f18a613b48565b88600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555087600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555086600381905550856004819055508460058190555083600681905550826007819055508160088190555080600960006101000a81548160ff021916908360028111156136bb57fe5b021790555050505050505050505050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561376f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4d616e616765722063616e6e6f7420626520656d70747900000000000000000081525060200191505060405180910390fd5b61377881613be6565b6137ea576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f4d616e61676572206d757374206265206120636f6e747261637400000000000081525060200191505060405180910390fd5b6000600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fdac3632743b879638fd2d51c4d3c1dd796615b4758a55b50b0c19b971ba9fbc760405160405180910390a35050565b60608247101561390b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180613d0e6026913960400191505060405180910390fd5b61391485613be6565b613986576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000081525060200191505060405180910390fd5b600060608673ffffffffffffffffffffffffffffffffffffffff1685876040518082805190602001908083835b602083106139d657805182526020820191506020810190506020830392506139b3565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114613a38576040519150601f19603f3d011682016040523d82523d6000602084013e613a3d565b606091505b5091509150613a4d828286613bf9565b92505050949350505050565b6060613abb826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16612bea9092919063ffffffff16565b9050600081511115613b4357808060200190516020811015613adc57600080fd5b8101908080519060200190929190505050613b42576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613dcc602a913960400191505060405180910390fd5b5b505050565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a350565b600080823b905060008111915050919050565b60608315613c0957829050613cbe565b600083511115613c1c5782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015613c83578082015181840152602081019050613c68565b50505050905090810190601f168015613cb05780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b939250505056fe436c6966662074696d65206d757374206265206265666f726520656e642074696d654f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c43616e6e6f7420757365206d6f726520746f6b656e73207468616e2076657374656420616d6f756e74536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77416d6f756e7420726571756573746564203e20737572706c757320617661696c61626c6552656c656173652073746172742074696d65206d757374206265206265666f726520656e642074696d655361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565645361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f20746f206e6f6e2d7a65726f20616c6c6f77616e6365a26469706673582212203c6b20b5a223b9b9c9f0008dfba22c9fb703c6524c0f0a76a2b156733f6d573464736f6c63430007030033", + "devdoc": { + "kind": "dev", + "methods": { + "acceptLock()": { + "details": "Can only be called by the beneficiary" + }, + "amountPerPeriod()": { + "returns": { + "_0": "Amount of tokens available after each period" + } + }, + "approveProtocol()": { + "details": "Approves all token destinations registered in the manager to pull tokens" + }, + "availableAmount()": { + "details": "Implements the step-by-step schedule based on periods for available tokens", + "returns": { + "_0": "Amount of tokens available according to the schedule" + } + }, + "cancelLock()": { + "details": "Can only be called by the owner" + }, + "changeBeneficiary(address)": { + "details": "Can only be called by the beneficiary", + "params": { + "_newBeneficiary": "Address of the new beneficiary address" + } + }, + "currentBalance()": { + "returns": { + "_0": "Tokens held in the contract" + } + }, + "currentPeriod()": { + "returns": { + "_0": "A number that represents the current period" + } + }, + "currentTime()": { + "returns": { + "_0": "Current block timestamp" + } + }, + "duration()": { + "returns": { + "_0": "Amount of seconds from contract startTime to endTime" + } + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "passedPeriods()": { + "returns": { + "_0": "A number of periods that passed since the schedule started" + } + }, + "periodDuration()": { + "returns": { + "_0": "Duration of each period in seconds" + } + }, + "releasableAmount()": { + "details": "Considers the schedule, takes into account already released tokens and used amount", + "returns": { + "_0": "Amount of tokens ready to be released" + } + }, + "release()": { + "details": "All available releasable tokens are transferred to beneficiary" + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." + }, + "revoke()": { + "details": "Vesting schedule is always calculated based on managed tokens" + }, + "revokeProtocol()": { + "details": "Revokes approval to all token destinations in the manager to pull tokens" + }, + "setManager(address)": { + "params": { + "_newManager": "Address of the new manager" + } + }, + "sinceStartTime()": { + "details": "Returns zero if called before conctract starTime", + "returns": { + "_0": "Seconds elapsed from contract startTime" + } + }, + "surplusAmount()": { + "details": "All funds over outstanding amount is considered surplus that can be withdrawn by beneficiary", + "returns": { + "_0": "Amount of tokens considered as surplus" + } + }, + "totalOutstandingAmount()": { + "details": "Does not consider schedule but just global amounts tracked", + "returns": { + "_0": "Amount of outstanding tokens for the lifetime of the contract" + } + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + }, + "vestedAmount()": { + "details": "Similar to available amount, but is fully vested when contract is non-revocable", + "returns": { + "_0": "Amount of tokens already vested" + } + }, + "withdrawSurplus(uint256)": { + "details": "Tokens in the contract over outstanding amount are considered as surplus", + "params": { + "_amount": "Amount of tokens to withdraw" + } + } + }, + "title": "GraphTokenLockWallet", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "acceptLock()": { + "notice": "Beneficiary accepts the lock, the owner cannot retrieve back the tokens" + }, + "amountPerPeriod()": { + "notice": "Returns amount available to be released after each period according to schedule" + }, + "approveProtocol()": { + "notice": "Approves protocol access of the tokens managed by this contract" + }, + "availableAmount()": { + "notice": "Gets the currently available token according to the schedule" + }, + "cancelLock()": { + "notice": "Owner cancel the lock and return the balance in the contract" + }, + "changeBeneficiary(address)": { + "notice": "Change the beneficiary of funds managed by the contract" + }, + "currentBalance()": { + "notice": "Returns the amount of tokens currently held by the contract" + }, + "currentPeriod()": { + "notice": "Gets the current period based on the schedule" + }, + "currentTime()": { + "notice": "Returns the current block timestamp" + }, + "duration()": { + "notice": "Gets duration of contract from start to end in seconds" + }, + "passedPeriods()": { + "notice": "Gets the number of periods that passed since the first period" + }, + "periodDuration()": { + "notice": "Returns the duration of each period in seconds" + }, + "releasableAmount()": { + "notice": "Gets tokens currently available for release" + }, + "release()": { + "notice": "Releases tokens based on the configured schedule" + }, + "revoke()": { + "notice": "Revokes a vesting schedule and return the unvested tokens to the owner" + }, + "revokeProtocol()": { + "notice": "Revokes protocol access of the tokens managed by this contract" + }, + "setManager(address)": { + "notice": "Sets a new manager for this contract" + }, + "sinceStartTime()": { + "notice": "Gets time elapsed since the start of the contract" + }, + "surplusAmount()": { + "notice": "Gets surplus amount in the contract based on outstanding amount to release" + }, + "totalOutstandingAmount()": { + "notice": "Gets the outstanding amount yet to be released based on the whole contract lifetime" + }, + "vestedAmount()": { + "notice": "Gets the amount of currently vested tokens" + }, + "withdrawSurplus(uint256)": { + "notice": "Withdraws surplus, unmanaged tokens from the contract" + } + }, + "notice": "This contract is built on top of the base GraphTokenLock functionality. It allows wallet beneficiaries to use the deposited funds to perform specific function calls on specific contracts. The idea is that supporters with locked tokens can participate in the protocol but disallow any release before the vesting/lock schedule. The beneficiary can issue authorized function calls to this contract that will get forwarded to a target contract. A target contract is any of our protocol contracts. The function calls allowed are queried to the GraphTokenLockManager, this way the same configuration can be shared for all the created lock wallet contracts. NOTE: Contracts used as target must have its function signatures checked to avoid collisions with any of this contract functions. Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience the maximum amount of tokens is authorized.", + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 4749, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "_owner", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 2578, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "token", + "offset": 0, + "slot": "1", + "type": "t_contract(IERC20)1045" + }, + { + "astId": 2580, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "beneficiary", + "offset": 0, + "slot": "2", + "type": "t_address" + }, + { + "astId": 2582, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "managedAmount", + "offset": 0, + "slot": "3", + "type": "t_uint256" + }, + { + "astId": 2584, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "startTime", + "offset": 0, + "slot": "4", + "type": "t_uint256" + }, + { + "astId": 2586, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "endTime", + "offset": 0, + "slot": "5", + "type": "t_uint256" + }, + { + "astId": 2588, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "periods", + "offset": 0, + "slot": "6", + "type": "t_uint256" + }, + { + "astId": 2590, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "releaseStartTime", + "offset": 0, + "slot": "7", + "type": "t_uint256" + }, + { + "astId": 2592, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "vestingCliffTime", + "offset": 0, + "slot": "8", + "type": "t_uint256" + }, + { + "astId": 2594, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "revocable", + "offset": 0, + "slot": "9", + "type": "t_enum(Revocability)4426" + }, + { + "astId": 2596, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "isRevoked", + "offset": 1, + "slot": "9", + "type": "t_bool" + }, + { + "astId": 2598, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "isInitialized", + "offset": 2, + "slot": "9", + "type": "t_bool" + }, + { + "astId": 2600, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "isAccepted", + "offset": 3, + "slot": "9", + "type": "t_bool" + }, + { + "astId": 2602, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "releasedAmount", + "offset": 0, + "slot": "10", + "type": "t_uint256" + }, + { + "astId": 2604, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "revokedAmount", + "offset": 0, + "slot": "11", + "type": "t_uint256" + }, + { + "astId": 4021, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "manager", + "offset": 0, + "slot": "12", + "type": "t_contract(IGraphTokenLockManager)4608" + }, + { + "astId": 4023, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "usedAmount", + "offset": 0, + "slot": "13", + "type": "t_uint256" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_contract(IERC20)1045": { + "encoding": "inplace", + "label": "contract IERC20", + "numberOfBytes": "20" + }, + "t_contract(IGraphTokenLockManager)4608": { + "encoding": "inplace", + "label": "contract IGraphTokenLockManager", + "numberOfBytes": "20" + }, + "t_enum(Revocability)4426": { + "encoding": "inplace", + "label": "enum IGraphTokenLock.Revocability", + "numberOfBytes": "1" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} \ No newline at end of file diff --git a/packages/token-distribution/deployments/goerli/L1GraphTokenLockTransferTool.json b/packages/token-distribution/deployments/goerli/L1GraphTokenLockTransferTool.json new file mode 100644 index 000000000..1af15ddf8 --- /dev/null +++ b/packages/token-distribution/deployments/goerli/L1GraphTokenLockTransferTool.json @@ -0,0 +1,612 @@ +{ + "address": "0xa725CF32c367778CFF2ba7089Ab4e941BDD88612", + "abi": [ + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_graphToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_l2Implementation", + "type": "address" + }, + { + "internalType": "contract ITokenGateway", + "name": "_l1Gateway", + "type": "address" + }, + { + "internalType": "address payable", + "name": "_staking", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "tokenLock", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "ETHDeposited", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "tokenLock", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "ETHPulled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "tokenLock", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "ETHWithdrawn", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "l1Wallet", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "l2Beneficiary", + "type": "address" + } + ], + "name": "L2BeneficiarySet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "l1LockManager", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "l2LockManager", + "type": "address" + } + ], + "name": "L2LockManagerSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "l1Wallet", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "l2Wallet", + "type": "address" + } + ], + "name": "L2WalletAddressSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "l1WalletOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "l2WalletOwner", + "type": "address" + } + ], + "name": "L2WalletOwnerSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "l1Wallet", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "l2Wallet", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "l1LockManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "l2LockManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "LockedFundsSentToL2", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "proxy", + "type": "address" + } + ], + "name": "ProxyCreated", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_tokenLock", + "type": "address" + } + ], + "name": "depositETH", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_l2Beneficiary", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_maxGas", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_gasPriceBid", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_maxSubmissionCost", + "type": "uint256" + } + ], + "name": "depositToL2Locked", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_salt", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "_implementation", + "type": "address" + }, + { + "internalType": "address", + "name": "_deployer", + "type": "address" + } + ], + "name": "getDeploymentAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "graphToken", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_owner", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "l1Gateway", + "outputs": [ + { + "internalType": "contract ITokenGateway", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "l2Beneficiary", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "l2Implementation", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "l2LockManager", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "l2WalletAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "l2WalletAddressSetManually", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "l2WalletOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_tokenLock", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "pullETH", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_l1LockManager", + "type": "address" + }, + { + "internalType": "address", + "name": "_l2LockManager", + "type": "address" + } + ], + "name": "setL2LockManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_l2Wallet", + "type": "address" + } + ], + "name": "setL2WalletAddressManually", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_l1WalletOwner", + "type": "address" + }, + { + "internalType": "address", + "name": "_l2WalletOwner", + "type": "address" + } + ], + "name": "setL2WalletOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "staking", + "outputs": [ + { + "internalType": "address payable", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "tokenLockETHBalances", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_destination", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "withdrawETH", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x7297670fbbf9f1c014aac93fa0219522c079bdd0ad4bb16c75a204ba97b1bc81" +} \ No newline at end of file diff --git a/packages/token-distribution/deployments/goerli/solcInputs/3c1e469b4f9ba208577ab7c230900006.json b/packages/token-distribution/deployments/goerli/solcInputs/3c1e469b4f9ba208577ab7c230900006.json new file mode 100644 index 000000000..276324157 --- /dev/null +++ b/packages/token-distribution/deployments/goerli/solcInputs/3c1e469b4f9ba208577ab7c230900006.json @@ -0,0 +1,98 @@ +{ + "language": "Solidity", + "sources": { + "contracts/GraphTokenDistributor.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\nimport \"@openzeppelin/contracts/math/SafeMath.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\";\n\n/**\n * @title GraphTokenDistributor\n * @dev Contract that allows distribution of tokens to multiple beneficiaries.\n * The contract accept deposits in the configured token by anyone.\n * The owner can setup the desired distribution by setting the amount of tokens\n * assigned to each beneficiary account.\n * Beneficiaries claim for their allocated tokens.\n * Only the owner can withdraw tokens from this contract without limitations.\n * For the distribution to work this contract must be unlocked by the owner.\n */\ncontract GraphTokenDistributor is Ownable {\n using SafeMath for uint256;\n using SafeERC20 for IERC20;\n\n // -- State --\n\n bool public locked;\n mapping(address => uint256) public beneficiaries;\n\n IERC20 public token;\n\n // -- Events --\n\n event BeneficiaryUpdated(address indexed beneficiary, uint256 amount);\n event TokensDeposited(address indexed sender, uint256 amount);\n event TokensWithdrawn(address indexed sender, uint256 amount);\n event TokensClaimed(address indexed beneficiary, address to, uint256 amount);\n event LockUpdated(bool locked);\n\n modifier whenNotLocked() {\n require(locked == false, \"Distributor: Claim is locked\");\n _;\n }\n\n /**\n * Constructor.\n * @param _token Token to use for deposits and withdrawals\n */\n constructor(IERC20 _token) {\n token = _token;\n locked = true;\n }\n\n /**\n * Deposit tokens into the contract.\n * Even if the ERC20 token can be transferred directly to the contract\n * this function provide a safe interface to do the transfer and avoid mistakes\n * @param _amount Amount to deposit\n */\n function deposit(uint256 _amount) external {\n token.safeTransferFrom(msg.sender, address(this), _amount);\n emit TokensDeposited(msg.sender, _amount);\n }\n\n // -- Admin functions --\n\n /**\n * Add token balance available for account.\n * @param _account Address to assign tokens to\n * @param _amount Amount of tokens to assign to beneficiary\n */\n function addBeneficiaryTokens(address _account, uint256 _amount) external onlyOwner {\n _setBeneficiaryTokens(_account, beneficiaries[_account].add(_amount));\n }\n\n /**\n * Add token balance available for multiple accounts.\n * @param _accounts Addresses to assign tokens to\n * @param _amounts Amounts of tokens to assign to beneficiary\n */\n function addBeneficiaryTokensMulti(address[] calldata _accounts, uint256[] calldata _amounts) external onlyOwner {\n require(_accounts.length == _amounts.length, \"Distributor: !length\");\n for (uint256 i = 0; i < _accounts.length; i++) {\n _setBeneficiaryTokens(_accounts[i], beneficiaries[_accounts[i]].add(_amounts[i]));\n }\n }\n\n /**\n * Remove token balance available for account.\n * @param _account Address to assign tokens to\n * @param _amount Amount of tokens to assign to beneficiary\n */\n function subBeneficiaryTokens(address _account, uint256 _amount) external onlyOwner {\n _setBeneficiaryTokens(_account, beneficiaries[_account].sub(_amount));\n }\n\n /**\n * Remove token balance available for multiple accounts.\n * @param _accounts Addresses to assign tokens to\n * @param _amounts Amounts of tokens to assign to beneficiary\n */\n function subBeneficiaryTokensMulti(address[] calldata _accounts, uint256[] calldata _amounts) external onlyOwner {\n require(_accounts.length == _amounts.length, \"Distributor: !length\");\n for (uint256 i = 0; i < _accounts.length; i++) {\n _setBeneficiaryTokens(_accounts[i], beneficiaries[_accounts[i]].sub(_amounts[i]));\n }\n }\n\n /**\n * Set amount of tokens available for beneficiary account.\n * @param _account Address to assign tokens to\n * @param _amount Amount of tokens to assign to beneficiary\n */\n function _setBeneficiaryTokens(address _account, uint256 _amount) private {\n require(_account != address(0), \"Distributor: !account\");\n\n beneficiaries[_account] = _amount;\n emit BeneficiaryUpdated(_account, _amount);\n }\n\n /**\n * Set locked withdrawals.\n * @param _locked True to lock withdrawals\n */\n function setLocked(bool _locked) external onlyOwner {\n locked = _locked;\n emit LockUpdated(_locked);\n }\n\n /**\n * Withdraw tokens from the contract. This function is included as\n * a escape hatch in case of mistakes or to recover remaining funds.\n * @param _amount Amount of tokens to withdraw\n */\n function withdraw(uint256 _amount) external onlyOwner {\n token.safeTransfer(msg.sender, _amount);\n emit TokensWithdrawn(msg.sender, _amount);\n }\n\n // -- Beneficiary functions --\n\n /**\n * Claim tokens and send to caller.\n */\n function claim() external whenNotLocked {\n claimTo(msg.sender);\n }\n\n /**\n * Claim tokens and send to address.\n * @param _to Address where to send tokens\n */\n function claimTo(address _to) public whenNotLocked {\n uint256 claimableTokens = beneficiaries[msg.sender];\n require(claimableTokens > 0, \"Distributor: Unavailable funds\");\n\n _setBeneficiaryTokens(msg.sender, 0);\n\n token.safeTransfer(_to, claimableTokens);\n emit TokensClaimed(msg.sender, _to, claimableTokens);\n }\n}\n" + }, + "@openzeppelin/contracts/access/Ownable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\nimport \"../utils/Context.sol\";\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor () internal {\n address msgSender = _msgSender();\n _owner = msgSender;\n emit OwnershipTransferred(address(0), msgSender);\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n _;\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n emit OwnershipTransferred(_owner, address(0));\n _owner = address(0);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n emit OwnershipTransferred(_owner, newOwner);\n _owner = newOwner;\n }\n}\n" + }, + "@openzeppelin/contracts/math/SafeMath.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/**\n * @dev Wrappers over Solidity's arithmetic operations with added overflow\n * checks.\n *\n * Arithmetic operations in Solidity wrap on overflow. This can easily result\n * in bugs, because programmers usually assume that an overflow raises an\n * error, which is the standard behavior in high level programming languages.\n * `SafeMath` restores this intuition by reverting the transaction when an\n * operation overflows.\n *\n * Using this library instead of the unchecked operations eliminates an entire\n * class of bugs, so it's recommended to use it always.\n */\nlibrary SafeMath {\n /**\n * @dev Returns the addition of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n uint256 c = a + b;\n if (c < a) return (false, 0);\n return (true, c);\n }\n\n /**\n * @dev Returns the substraction of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n if (b > a) return (false, 0);\n return (true, a - b);\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\n // benefit is lost if 'b' is also tested.\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\n if (a == 0) return (true, 0);\n uint256 c = a * b;\n if (c / a != b) return (false, 0);\n return (true, c);\n }\n\n /**\n * @dev Returns the division of two unsigned integers, with a division by zero flag.\n *\n * _Available since v3.4._\n */\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n if (b == 0) return (false, 0);\n return (true, a / b);\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\n *\n * _Available since v3.4._\n */\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n if (b == 0) return (false, 0);\n return (true, a % b);\n }\n\n /**\n * @dev Returns the addition of two unsigned integers, reverting on\n * overflow.\n *\n * Counterpart to Solidity's `+` operator.\n *\n * Requirements:\n *\n * - Addition cannot overflow.\n */\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\n uint256 c = a + b;\n require(c >= a, \"SafeMath: addition overflow\");\n return c;\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, reverting on\n * overflow (when the result is negative).\n *\n * Counterpart to Solidity's `-` operator.\n *\n * Requirements:\n *\n * - Subtraction cannot overflow.\n */\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b <= a, \"SafeMath: subtraction overflow\");\n return a - b;\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, reverting on\n * overflow.\n *\n * Counterpart to Solidity's `*` operator.\n *\n * Requirements:\n *\n * - Multiplication cannot overflow.\n */\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n if (a == 0) return 0;\n uint256 c = a * b;\n require(c / a == b, \"SafeMath: multiplication overflow\");\n return c;\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers, reverting on\n * division by zero. The result is rounded towards zero.\n *\n * Counterpart to Solidity's `/` operator. Note: this function uses a\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\n * uses an invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b > 0, \"SafeMath: division by zero\");\n return a / b;\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * reverting when dividing by zero.\n *\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\n * opcode (which leaves remaining gas untouched) while Solidity uses an\n * invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b > 0, \"SafeMath: modulo by zero\");\n return a % b;\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\n * overflow (when the result is negative).\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {trySub}.\n *\n * Counterpart to Solidity's `-` operator.\n *\n * Requirements:\n *\n * - Subtraction cannot overflow.\n */\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b <= a, errorMessage);\n return a - b;\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers, reverting with custom message on\n * division by zero. The result is rounded towards zero.\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {tryDiv}.\n *\n * Counterpart to Solidity's `/` operator. Note: this function uses a\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\n * uses an invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b > 0, errorMessage);\n return a / b;\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * reverting with custom message when dividing by zero.\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {tryMod}.\n *\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\n * opcode (which leaves remaining gas untouched) while Solidity uses an\n * invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b > 0, errorMessage);\n return a % b;\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `recipient`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address recipient, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `sender` to `recipient` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);\n\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/SafeERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"../../math/SafeMath.sol\";\nimport \"../../utils/Address.sol\";\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n using SafeMath for uint256;\n using Address for address;\n\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\n }\n\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\n }\n\n /**\n * @dev Deprecated. This function has issues similar to the ones found in\n * {IERC20-approve}, and its usage is discouraged.\n *\n * Whenever possible, use {safeIncreaseAllowance} and\n * {safeDecreaseAllowance} instead.\n */\n function safeApprove(IERC20 token, address spender, uint256 value) internal {\n // safeApprove should only be called when setting an initial allowance,\n // or when resetting it to zero. To increase and decrease it, use\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\n // solhint-disable-next-line max-line-length\n require((value == 0) || (token.allowance(address(this), spender) == 0),\n \"SafeERC20: approve from non-zero to non-zero allowance\"\n );\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\n }\n\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n uint256 newAllowance = token.allowance(address(this), spender).add(value);\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\n\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n uint256 newAllowance = token.allowance(address(this), spender).sub(value, \"SafeERC20: decreased allowance below zero\");\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n */\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that\n // the target address contains contract code and also asserts for success in the low-level call.\n\n bytes memory returndata = address(token).functionCall(data, \"SafeERC20: low-level call failed\");\n if (returndata.length > 0) { // Return data is optional\n // solhint-disable-next-line max-line-length\n require(abi.decode(returndata, (bool)), \"SafeERC20: ERC20 operation did not succeed\");\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/*\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with GSN meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address payable) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes memory) {\n this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\n return msg.data;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Address.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.2 <0.8.0;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize, which returns 0 for contracts in\n // construction, since the code is only stored at the end of the\n // constructor execution.\n\n uint256 size;\n // solhint-disable-next-line no-inline-assembly\n assembly { size := extcodesize(account) }\n return size > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n // solhint-disable-next-line avoid-low-level-calls, avoid-call-value\n (bool success, ) = recipient.call{ value: amount }(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain`call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCall(target, data, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n require(isContract(target), \"Address: call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.call{ value: value }(data);\n return _verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {\n require(isContract(target), \"Address: static call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.staticcall(data);\n return _verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\n require(isContract(target), \"Address: delegate call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return _verifyCallResult(success, returndata, errorMessage);\n }\n\n function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {\n if (success) {\n return returndata;\n } else {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n }\n}\n" + }, + "contracts/GraphTokenLockWallet.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"@openzeppelin/contracts/math/SafeMath.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\";\n\nimport \"./GraphTokenLock.sol\";\nimport \"./IGraphTokenLockManager.sol\";\n\n/**\n * @title GraphTokenLockWallet\n * @notice This contract is built on top of the base GraphTokenLock functionality.\n * It allows wallet beneficiaries to use the deposited funds to perform specific function calls\n * on specific contracts.\n *\n * The idea is that supporters with locked tokens can participate in the protocol\n * but disallow any release before the vesting/lock schedule.\n * The beneficiary can issue authorized function calls to this contract that will\n * get forwarded to a target contract. A target contract is any of our protocol contracts.\n * The function calls allowed are queried to the GraphTokenLockManager, this way\n * the same configuration can be shared for all the created lock wallet contracts.\n *\n * NOTE: Contracts used as target must have its function signatures checked to avoid collisions\n * with any of this contract functions.\n * Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience\n * the maximum amount of tokens is authorized.\n */\ncontract GraphTokenLockWallet is GraphTokenLock {\n using SafeMath for uint256;\n using SafeERC20 for IERC20;\n\n // -- State --\n\n IGraphTokenLockManager public manager;\n uint256 public usedAmount;\n\n uint256 private constant MAX_UINT256 = 2**256 - 1;\n\n // -- Events --\n\n event ManagerUpdated(address indexed _oldManager, address indexed _newManager);\n event TokenDestinationsApproved();\n event TokenDestinationsRevoked();\n\n // Initializer\n function initialize(\n address _manager,\n address _owner,\n address _beneficiary,\n address _token,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n Revocability _revocable\n ) external {\n _initialize(\n _owner,\n _beneficiary,\n _token,\n _managedAmount,\n _startTime,\n _endTime,\n _periods,\n _releaseStartTime,\n _vestingCliffTime,\n _revocable\n );\n _setManager(_manager);\n }\n\n // -- Admin --\n\n /**\n * @notice Sets a new manager for this contract\n * @param _newManager Address of the new manager\n */\n function setManager(address _newManager) external onlyOwner {\n _setManager(_newManager);\n }\n\n /**\n * @dev Sets a new manager for this contract\n * @param _newManager Address of the new manager\n */\n function _setManager(address _newManager) private {\n require(_newManager != address(0), \"Manager cannot be empty\");\n require(Address.isContract(_newManager), \"Manager must be a contract\");\n\n address oldManager = address(manager);\n manager = IGraphTokenLockManager(_newManager);\n\n emit ManagerUpdated(oldManager, _newManager);\n }\n\n // -- Beneficiary --\n\n /**\n * @notice Approves protocol access of the tokens managed by this contract\n * @dev Approves all token destinations registered in the manager to pull tokens\n */\n function approveProtocol() external onlyBeneficiary {\n address[] memory dstList = manager.getTokenDestinations();\n for (uint256 i = 0; i < dstList.length; i++) {\n token.safeApprove(dstList[i], MAX_UINT256);\n }\n emit TokenDestinationsApproved();\n }\n\n /**\n * @notice Revokes protocol access of the tokens managed by this contract\n * @dev Revokes approval to all token destinations in the manager to pull tokens\n */\n function revokeProtocol() external onlyBeneficiary {\n address[] memory dstList = manager.getTokenDestinations();\n for (uint256 i = 0; i < dstList.length; i++) {\n token.safeApprove(dstList[i], 0);\n }\n emit TokenDestinationsRevoked();\n }\n\n /**\n * @notice Gets tokens currently available for release\n * @dev Considers the schedule, takes into account already released tokens and used amount\n * @return Amount of tokens ready to be released\n */\n function releasableAmount() public view override returns (uint256) {\n if (revocable == Revocability.Disabled) {\n return super.releasableAmount();\n }\n\n // -- Revocability enabled logic\n // This needs to deal with additional considerations for when tokens are used in the protocol\n\n // If a release start time is set no tokens are available for release before this date\n // If not set it follows the default schedule and tokens are available on\n // the first period passed\n if (releaseStartTime > 0 && currentTime() < releaseStartTime) {\n return 0;\n }\n\n // Vesting cliff is activated and it has not passed means nothing is vested yet\n // so funds cannot be released\n if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\n return 0;\n }\n\n // A beneficiary can never have more releasable tokens than the contract balance\n // We consider the `usedAmount` in the protocol as part of the calculations\n // the beneficiary should not release funds that are used.\n uint256 releasable = availableAmount().sub(releasedAmount).sub(usedAmount);\n return MathUtils.min(currentBalance(), releasable);\n }\n\n /**\n * @notice Forward authorized contract calls to protocol contracts\n * @dev Fallback function can be called by the beneficiary only if function call is allowed\n */\n fallback() external payable {\n // Only beneficiary can forward calls\n require(msg.sender == beneficiary, \"Unauthorized caller\");\n\n // Function call validation\n address _target = manager.getAuthFunctionCallTarget(msg.sig);\n require(_target != address(0), \"Unauthorized function\");\n\n uint256 oldBalance = currentBalance();\n\n // Call function with data\n Address.functionCall(_target, msg.data);\n\n // Tracked used tokens in the protocol\n // We do this check after balances were updated by the forwarded call\n // Check is only enforced for revocable contracts to save some gas\n if (revocable == Revocability.Enabled) {\n // Track contract balance change\n uint256 newBalance = currentBalance();\n if (newBalance < oldBalance) {\n // Outflow\n uint256 diff = oldBalance.sub(newBalance);\n usedAmount = usedAmount.add(diff);\n } else {\n // Inflow: We can receive profits from the protocol, that could make usedAmount to\n // underflow. We set it to zero in that case.\n uint256 diff = newBalance.sub(oldBalance);\n usedAmount = (diff >= usedAmount) ? 0 : usedAmount.sub(diff);\n }\n require(usedAmount <= vestedAmount(), \"Cannot use more tokens than vested amount\");\n }\n }\n}\n" + }, + "contracts/GraphTokenLock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport \"@openzeppelin/contracts/math/SafeMath.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\";\n\nimport \"./Ownable.sol\";\nimport \"./MathUtils.sol\";\nimport \"./IGraphTokenLock.sol\";\n\n/**\n * @title GraphTokenLock\n * @notice Contract that manages an unlocking schedule of tokens.\n * @dev The contract lock manage a number of tokens deposited into the contract to ensure that\n * they can only be released under certain time conditions.\n *\n * This contract implements a release scheduled based on periods and tokens are released in steps\n * after each period ends. It can be configured with one period in which case it is like a plain TimeLock.\n * It also supports revocation to be used for vesting schedules.\n *\n * The contract supports receiving extra funds than the managed tokens ones that can be\n * withdrawn by the beneficiary at any time.\n *\n * A releaseStartTime parameter is included to override the default release schedule and\n * perform the first release on the configured time. After that it will continue with the\n * default schedule.\n */\nabstract contract GraphTokenLock is Ownable, IGraphTokenLock {\n using SafeMath for uint256;\n using SafeERC20 for IERC20;\n\n uint256 private constant MIN_PERIOD = 1;\n\n // -- State --\n\n IERC20 public token;\n address public beneficiary;\n\n // Configuration\n\n // Amount of tokens managed by the contract schedule\n uint256 public managedAmount;\n\n uint256 public startTime; // Start datetime (in unixtimestamp)\n uint256 public endTime; // Datetime after all funds are fully vested/unlocked (in unixtimestamp)\n uint256 public periods; // Number of vesting/release periods\n\n // First release date for tokens (in unixtimestamp)\n // If set, no tokens will be released before releaseStartTime ignoring\n // the amount to release each period\n uint256 public releaseStartTime;\n // A cliff set a date to which a beneficiary needs to get to vest\n // all preceding periods\n uint256 public vestingCliffTime;\n Revocability public revocable; // Whether to use vesting for locked funds\n\n // State\n\n bool public isRevoked;\n bool public isInitialized;\n bool public isAccepted;\n uint256 public releasedAmount;\n uint256 public revokedAmount;\n\n // -- Events --\n\n event TokensReleased(address indexed beneficiary, uint256 amount);\n event TokensWithdrawn(address indexed beneficiary, uint256 amount);\n event TokensRevoked(address indexed beneficiary, uint256 amount);\n event BeneficiaryChanged(address newBeneficiary);\n event LockAccepted();\n event LockCanceled();\n\n /**\n * @dev Only allow calls from the beneficiary of the contract\n */\n modifier onlyBeneficiary() {\n require(msg.sender == beneficiary, \"!auth\");\n _;\n }\n\n /**\n * @notice Initializes the contract\n * @param _owner Address of the contract owner\n * @param _beneficiary Address of the beneficiary of locked tokens\n * @param _managedAmount Amount of tokens to be managed by the lock contract\n * @param _startTime Start time of the release schedule\n * @param _endTime End time of the release schedule\n * @param _periods Number of periods between start time and end time\n * @param _releaseStartTime Override time for when the releases start\n * @param _vestingCliffTime Override time for when the vesting start\n * @param _revocable Whether the contract is revocable\n */\n function _initialize(\n address _owner,\n address _beneficiary,\n address _token,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n Revocability _revocable\n ) internal {\n require(!isInitialized, \"Already initialized\");\n require(_owner != address(0), \"Owner cannot be zero\");\n require(_beneficiary != address(0), \"Beneficiary cannot be zero\");\n require(_token != address(0), \"Token cannot be zero\");\n require(_managedAmount > 0, \"Managed tokens cannot be zero\");\n require(_startTime != 0, \"Start time must be set\");\n require(_startTime < _endTime, \"Start time > end time\");\n require(_periods >= MIN_PERIOD, \"Periods cannot be below minimum\");\n require(_revocable != Revocability.NotSet, \"Must set a revocability option\");\n require(_releaseStartTime < _endTime, \"Release start time must be before end time\");\n require(_vestingCliffTime < _endTime, \"Cliff time must be before end time\");\n\n isInitialized = true;\n\n Ownable.initialize(_owner);\n beneficiary = _beneficiary;\n token = IERC20(_token);\n\n managedAmount = _managedAmount;\n\n startTime = _startTime;\n endTime = _endTime;\n periods = _periods;\n\n // Optionals\n releaseStartTime = _releaseStartTime;\n vestingCliffTime = _vestingCliffTime;\n revocable = _revocable;\n }\n\n /**\n * @notice Change the beneficiary of funds managed by the contract\n * @dev Can only be called by the beneficiary\n * @param _newBeneficiary Address of the new beneficiary address\n */\n function changeBeneficiary(address _newBeneficiary) external onlyBeneficiary {\n require(_newBeneficiary != address(0), \"Empty beneficiary\");\n beneficiary = _newBeneficiary;\n emit BeneficiaryChanged(_newBeneficiary);\n }\n\n /**\n * @notice Beneficiary accepts the lock, the owner cannot retrieve back the tokens\n * @dev Can only be called by the beneficiary\n */\n function acceptLock() external onlyBeneficiary {\n isAccepted = true;\n emit LockAccepted();\n }\n\n /**\n * @notice Owner cancel the lock and return the balance in the contract\n * @dev Can only be called by the owner\n */\n function cancelLock() external onlyOwner {\n require(isAccepted == false, \"Cannot cancel accepted contract\");\n\n token.safeTransfer(owner(), currentBalance());\n\n emit LockCanceled();\n }\n\n // -- Balances --\n\n /**\n * @notice Returns the amount of tokens currently held by the contract\n * @return Tokens held in the contract\n */\n function currentBalance() public view override returns (uint256) {\n return token.balanceOf(address(this));\n }\n\n // -- Time & Periods --\n\n /**\n * @notice Returns the current block timestamp\n * @return Current block timestamp\n */\n function currentTime() public view override returns (uint256) {\n return block.timestamp;\n }\n\n /**\n * @notice Gets duration of contract from start to end in seconds\n * @return Amount of seconds from contract startTime to endTime\n */\n function duration() public view override returns (uint256) {\n return endTime.sub(startTime);\n }\n\n /**\n * @notice Gets time elapsed since the start of the contract\n * @dev Returns zero if called before conctract starTime\n * @return Seconds elapsed from contract startTime\n */\n function sinceStartTime() public view override returns (uint256) {\n uint256 current = currentTime();\n if (current <= startTime) {\n return 0;\n }\n return current.sub(startTime);\n }\n\n /**\n * @notice Returns amount available to be released after each period according to schedule\n * @return Amount of tokens available after each period\n */\n function amountPerPeriod() public view override returns (uint256) {\n return managedAmount.div(periods);\n }\n\n /**\n * @notice Returns the duration of each period in seconds\n * @return Duration of each period in seconds\n */\n function periodDuration() public view override returns (uint256) {\n return duration().div(periods);\n }\n\n /**\n * @notice Gets the current period based on the schedule\n * @return A number that represents the current period\n */\n function currentPeriod() public view override returns (uint256) {\n return sinceStartTime().div(periodDuration()).add(MIN_PERIOD);\n }\n\n /**\n * @notice Gets the number of periods that passed since the first period\n * @return A number of periods that passed since the schedule started\n */\n function passedPeriods() public view override returns (uint256) {\n return currentPeriod().sub(MIN_PERIOD);\n }\n\n // -- Locking & Release Schedule --\n\n /**\n * @notice Gets the currently available token according to the schedule\n * @dev Implements the step-by-step schedule based on periods for available tokens\n * @return Amount of tokens available according to the schedule\n */\n function availableAmount() public view override returns (uint256) {\n uint256 current = currentTime();\n\n // Before contract start no funds are available\n if (current < startTime) {\n return 0;\n }\n\n // After contract ended all funds are available\n if (current > endTime) {\n return managedAmount;\n }\n\n // Get available amount based on period\n return passedPeriods().mul(amountPerPeriod());\n }\n\n /**\n * @notice Gets the amount of currently vested tokens\n * @dev Similar to available amount, but is fully vested when contract is non-revocable\n * @return Amount of tokens already vested\n */\n function vestedAmount() public view override returns (uint256) {\n // If non-revocable it is fully vested\n if (revocable == Revocability.Disabled) {\n return managedAmount;\n }\n\n // Vesting cliff is activated and it has not passed means nothing is vested yet\n if (vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\n return 0;\n }\n\n return availableAmount();\n }\n\n /**\n * @notice Gets tokens currently available for release\n * @dev Considers the schedule and takes into account already released tokens\n * @return Amount of tokens ready to be released\n */\n function releasableAmount() public view virtual override returns (uint256) {\n // If a release start time is set no tokens are available for release before this date\n // If not set it follows the default schedule and tokens are available on\n // the first period passed\n if (releaseStartTime > 0 && currentTime() < releaseStartTime) {\n return 0;\n }\n\n // Vesting cliff is activated and it has not passed means nothing is vested yet\n // so funds cannot be released\n if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\n return 0;\n }\n\n // A beneficiary can never have more releasable tokens than the contract balance\n uint256 releasable = availableAmount().sub(releasedAmount);\n return MathUtils.min(currentBalance(), releasable);\n }\n\n /**\n * @notice Gets the outstanding amount yet to be released based on the whole contract lifetime\n * @dev Does not consider schedule but just global amounts tracked\n * @return Amount of outstanding tokens for the lifetime of the contract\n */\n function totalOutstandingAmount() public view override returns (uint256) {\n return managedAmount.sub(releasedAmount).sub(revokedAmount);\n }\n\n /**\n * @notice Gets surplus amount in the contract based on outstanding amount to release\n * @dev All funds over outstanding amount is considered surplus that can be withdrawn by beneficiary\n * @return Amount of tokens considered as surplus\n */\n function surplusAmount() public view override returns (uint256) {\n uint256 balance = currentBalance();\n uint256 outstandingAmount = totalOutstandingAmount();\n if (balance > outstandingAmount) {\n return balance.sub(outstandingAmount);\n }\n return 0;\n }\n\n // -- Value Transfer --\n\n /**\n * @notice Releases tokens based on the configured schedule\n * @dev All available releasable tokens are transferred to beneficiary\n */\n function release() external override onlyBeneficiary {\n uint256 amountToRelease = releasableAmount();\n require(amountToRelease > 0, \"No available releasable amount\");\n\n releasedAmount = releasedAmount.add(amountToRelease);\n\n token.safeTransfer(beneficiary, amountToRelease);\n\n emit TokensReleased(beneficiary, amountToRelease);\n }\n\n /**\n * @notice Withdraws surplus, unmanaged tokens from the contract\n * @dev Tokens in the contract over outstanding amount are considered as surplus\n * @param _amount Amount of tokens to withdraw\n */\n function withdrawSurplus(uint256 _amount) external override onlyBeneficiary {\n require(_amount > 0, \"Amount cannot be zero\");\n require(surplusAmount() >= _amount, \"Amount requested > surplus available\");\n\n token.safeTransfer(beneficiary, _amount);\n\n emit TokensWithdrawn(beneficiary, _amount);\n }\n\n /**\n * @notice Revokes a vesting schedule and return the unvested tokens to the owner\n * @dev Vesting schedule is always calculated based on managed tokens\n */\n function revoke() external override onlyOwner {\n require(revocable == Revocability.Enabled, \"Contract is non-revocable\");\n require(isRevoked == false, \"Already revoked\");\n\n uint256 unvestedAmount = managedAmount.sub(vestedAmount());\n require(unvestedAmount > 0, \"No available unvested amount\");\n\n revokedAmount = unvestedAmount;\n isRevoked = true;\n\n token.safeTransfer(owner(), unvestedAmount);\n\n emit TokensRevoked(beneficiary, unvestedAmount);\n }\n}\n" + }, + "contracts/IGraphTokenLockManager.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\nimport \"./IGraphTokenLock.sol\";\n\ninterface IGraphTokenLockManager {\n // -- Factory --\n\n function setMasterCopy(address _masterCopy) external;\n\n function createTokenLockWallet(\n address _owner,\n address _beneficiary,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n IGraphTokenLock.Revocability _revocable\n ) external;\n\n // -- Funds Management --\n\n function token() external returns (IERC20);\n\n function deposit(uint256 _amount) external;\n\n function withdraw(uint256 _amount) external;\n\n // -- Allowed Funds Destinations --\n\n function addTokenDestination(address _dst) external;\n\n function removeTokenDestination(address _dst) external;\n\n function isTokenDestination(address _dst) external view returns (bool);\n\n function getTokenDestinations() external view returns (address[] memory);\n\n // -- Function Call Authorization --\n\n function setAuthFunctionCall(string calldata _signature, address _target) external;\n\n function unsetAuthFunctionCall(string calldata _signature) external;\n\n function setAuthFunctionCallMany(string[] calldata _signatures, address[] calldata _targets) external;\n\n function getAuthFunctionCallTarget(bytes4 _sigHash) external view returns (address);\n\n function isAuthFunctionCall(bytes4 _sigHash) external view returns (bool);\n}\n" + }, + "contracts/Ownable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * The owner account will be passed on initialization of the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\ncontract Ownable {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n function initialize(address owner) internal {\n _owner = owner;\n emit OwnershipTransferred(address(0), owner);\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(_owner == msg.sender, \"Ownable: caller is not the owner\");\n _;\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() external virtual onlyOwner {\n emit OwnershipTransferred(_owner, address(0));\n _owner = address(0);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) external virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n emit OwnershipTransferred(_owner, newOwner);\n _owner = newOwner;\n }\n}\n" + }, + "contracts/MathUtils.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nlibrary MathUtils {\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n}\n" + }, + "contracts/IGraphTokenLock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\ninterface IGraphTokenLock {\n enum Revocability {\n NotSet,\n Enabled,\n Disabled\n }\n\n // -- Balances --\n\n function currentBalance() external view returns (uint256);\n\n // -- Time & Periods --\n\n function currentTime() external view returns (uint256);\n\n function duration() external view returns (uint256);\n\n function sinceStartTime() external view returns (uint256);\n\n function amountPerPeriod() external view returns (uint256);\n\n function periodDuration() external view returns (uint256);\n\n function currentPeriod() external view returns (uint256);\n\n function passedPeriods() external view returns (uint256);\n\n // -- Locking & Release Schedule --\n\n function availableAmount() external view returns (uint256);\n\n function vestedAmount() external view returns (uint256);\n\n function releasableAmount() external view returns (uint256);\n\n function totalOutstandingAmount() external view returns (uint256);\n\n function surplusAmount() external view returns (uint256);\n\n // -- Value Transfer --\n\n function release() external;\n\n function withdrawSurplus(uint256 _amount) external;\n\n function revoke() external;\n}\n" + }, + "contracts/StakingMock.sol": { + "content": "pragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\nimport \"./Stakes.sol\";\n\ncontract StakingMock {\n using SafeMath for uint256;\n using Stakes for Stakes.Indexer;\n\n // -- State --\n\n uint256 public minimumIndexerStake = 100e18;\n uint256 public thawingPeriod = 10; // 10 blocks\n IERC20 public token;\n\n // Indexer stakes : indexer => Stake\n mapping(address => Stakes.Indexer) public stakes;\n\n /**\n * @dev Emitted when `indexer` stake `tokens` amount.\n */\n event StakeDeposited(address indexed indexer, uint256 tokens);\n\n /**\n * @dev Emitted when `indexer` unstaked and locked `tokens` amount `until` block.\n */\n event StakeLocked(address indexed indexer, uint256 tokens, uint256 until);\n\n /**\n * @dev Emitted when `indexer` withdrew `tokens` staked.\n */\n event StakeWithdrawn(address indexed indexer, uint256 tokens);\n\n // Contract constructor.\n constructor(IERC20 _token) {\n require(address(_token) != address(0), \"!token\");\n token = _token;\n }\n\n /**\n * @dev Deposit tokens on the indexer stake.\n * @param _tokens Amount of tokens to stake\n */\n function stake(uint256 _tokens) external {\n stakeTo(msg.sender, _tokens);\n }\n\n /**\n * @dev Deposit tokens on the indexer stake.\n * @param _indexer Address of the indexer\n * @param _tokens Amount of tokens to stake\n */\n function stakeTo(address _indexer, uint256 _tokens) public {\n require(_tokens > 0, \"!tokens\");\n\n // Ensure minimum stake\n require(stakes[_indexer].tokensSecureStake().add(_tokens) >= minimumIndexerStake, \"!minimumIndexerStake\");\n\n // Transfer tokens to stake from caller to this contract\n require(token.transferFrom(msg.sender, address(this), _tokens), \"!transfer\");\n\n // Stake the transferred tokens\n _stake(_indexer, _tokens);\n }\n\n /**\n * @dev Unstake tokens from the indexer stake, lock them until thawing period expires.\n * @param _tokens Amount of tokens to unstake\n */\n function unstake(uint256 _tokens) external {\n address indexer = msg.sender;\n Stakes.Indexer storage indexerStake = stakes[indexer];\n\n require(_tokens > 0, \"!tokens\");\n require(indexerStake.hasTokens(), \"!stake\");\n require(indexerStake.tokensAvailable() >= _tokens, \"!stake-avail\");\n\n // Ensure minimum stake\n uint256 newStake = indexerStake.tokensSecureStake().sub(_tokens);\n require(newStake == 0 || newStake >= minimumIndexerStake, \"!minimumIndexerStake\");\n\n // Before locking more tokens, withdraw any unlocked ones\n uint256 tokensToWithdraw = indexerStake.tokensWithdrawable();\n if (tokensToWithdraw > 0) {\n _withdraw(indexer);\n }\n\n indexerStake.lockTokens(_tokens, thawingPeriod);\n\n emit StakeLocked(indexer, indexerStake.tokensLocked, indexerStake.tokensLockedUntil);\n }\n\n /**\n * @dev Withdraw indexer tokens once the thawing period has passed.\n */\n function withdraw() external {\n _withdraw(msg.sender);\n }\n\n function _stake(address _indexer, uint256 _tokens) internal {\n // Deposit tokens into the indexer stake\n Stakes.Indexer storage indexerStake = stakes[_indexer];\n indexerStake.deposit(_tokens);\n\n emit StakeDeposited(_indexer, _tokens);\n }\n\n /**\n * @dev Withdraw indexer tokens once the thawing period has passed.\n * @param _indexer Address of indexer to withdraw funds from\n */\n function _withdraw(address _indexer) private {\n // Get tokens available for withdraw and update balance\n uint256 tokensToWithdraw = stakes[_indexer].withdrawTokens();\n require(tokensToWithdraw > 0, \"!tokens\");\n\n // Return tokens to the indexer\n require(token.transfer(_indexer, tokensToWithdraw), \"!transfer\");\n\n emit StakeWithdrawn(_indexer, tokensToWithdraw);\n }\n}\n" + }, + "contracts/Stakes.sol": { + "content": "pragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/math/SafeMath.sol\";\n\n/**\n * @title A collection of data structures and functions to manage the Indexer Stake state.\n * Used for low-level state changes, require() conditions should be evaluated\n * at the caller function scope.\n */\nlibrary Stakes {\n using SafeMath for uint256;\n using Stakes for Stakes.Indexer;\n\n struct Indexer {\n uint256 tokensStaked; // Tokens on the indexer stake (staked by the indexer)\n uint256 tokensAllocated; // Tokens used in allocations\n uint256 tokensLocked; // Tokens locked for withdrawal subject to thawing period\n uint256 tokensLockedUntil; // Block when locked tokens can be withdrawn\n }\n\n /**\n * @dev Deposit tokens to the indexer stake.\n * @param stake Stake data\n * @param _tokens Amount of tokens to deposit\n */\n function deposit(Stakes.Indexer storage stake, uint256 _tokens) internal {\n stake.tokensStaked = stake.tokensStaked.add(_tokens);\n }\n\n /**\n * @dev Release tokens from the indexer stake.\n * @param stake Stake data\n * @param _tokens Amount of tokens to release\n */\n function release(Stakes.Indexer storage stake, uint256 _tokens) internal {\n stake.tokensStaked = stake.tokensStaked.sub(_tokens);\n }\n\n /**\n * @dev Allocate tokens from the main stack to a SubgraphDeployment.\n * @param stake Stake data\n * @param _tokens Amount of tokens to allocate\n */\n function allocate(Stakes.Indexer storage stake, uint256 _tokens) internal {\n stake.tokensAllocated = stake.tokensAllocated.add(_tokens);\n }\n\n /**\n * @dev Unallocate tokens from a SubgraphDeployment back to the main stack.\n * @param stake Stake data\n * @param _tokens Amount of tokens to unallocate\n */\n function unallocate(Stakes.Indexer storage stake, uint256 _tokens) internal {\n stake.tokensAllocated = stake.tokensAllocated.sub(_tokens);\n }\n\n /**\n * @dev Lock tokens until a thawing period pass.\n * @param stake Stake data\n * @param _tokens Amount of tokens to unstake\n * @param _period Period in blocks that need to pass before withdrawal\n */\n function lockTokens(\n Stakes.Indexer storage stake,\n uint256 _tokens,\n uint256 _period\n ) internal {\n // Take into account period averaging for multiple unstake requests\n uint256 lockingPeriod = _period;\n if (stake.tokensLocked > 0) {\n lockingPeriod = stake.getLockingPeriod(_tokens, _period);\n }\n\n // Update balances\n stake.tokensLocked = stake.tokensLocked.add(_tokens);\n stake.tokensLockedUntil = block.number.add(lockingPeriod);\n }\n\n /**\n * @dev Unlock tokens.\n * @param stake Stake data\n * @param _tokens Amount of tokens to unkock\n */\n function unlockTokens(Stakes.Indexer storage stake, uint256 _tokens) internal {\n stake.tokensLocked = stake.tokensLocked.sub(_tokens);\n if (stake.tokensLocked == 0) {\n stake.tokensLockedUntil = 0;\n }\n }\n\n /**\n * @dev Take all tokens out from the locked stake for withdrawal.\n * @param stake Stake data\n * @return Amount of tokens being withdrawn\n */\n function withdrawTokens(Stakes.Indexer storage stake) internal returns (uint256) {\n // Calculate tokens that can be released\n uint256 tokensToWithdraw = stake.tokensWithdrawable();\n\n if (tokensToWithdraw > 0) {\n // Reset locked tokens\n stake.unlockTokens(tokensToWithdraw);\n\n // Decrease indexer stake\n stake.release(tokensToWithdraw);\n }\n\n return tokensToWithdraw;\n }\n\n /**\n * @dev Get the locking period of the tokens to unstake.\n * If already unstaked before calculate the weighted average.\n * @param stake Stake data\n * @param _tokens Amount of tokens to unstake\n * @param _thawingPeriod Period in blocks that need to pass before withdrawal\n * @return True if staked\n */\n function getLockingPeriod(\n Stakes.Indexer memory stake,\n uint256 _tokens,\n uint256 _thawingPeriod\n ) internal view returns (uint256) {\n uint256 blockNum = block.number;\n uint256 periodA = (stake.tokensLockedUntil > blockNum) ? stake.tokensLockedUntil.sub(blockNum) : 0;\n uint256 periodB = _thawingPeriod;\n uint256 stakeA = stake.tokensLocked;\n uint256 stakeB = _tokens;\n return periodA.mul(stakeA).add(periodB.mul(stakeB)).div(stakeA.add(stakeB));\n }\n\n /**\n * @dev Return true if there are tokens staked by the Indexer.\n * @param stake Stake data\n * @return True if staked\n */\n function hasTokens(Stakes.Indexer memory stake) internal pure returns (bool) {\n return stake.tokensStaked > 0;\n }\n\n /**\n * @dev Return the amount of tokens used in allocations and locked for withdrawal.\n * @param stake Stake data\n * @return Token amount\n */\n function tokensUsed(Stakes.Indexer memory stake) internal pure returns (uint256) {\n return stake.tokensAllocated.add(stake.tokensLocked);\n }\n\n /**\n * @dev Return the amount of tokens staked not considering the ones that are already going\n * through the thawing period or are ready for withdrawal. We call it secure stake because\n * it is not subject to change by a withdraw call from the indexer.\n * @param stake Stake data\n * @return Token amount\n */\n function tokensSecureStake(Stakes.Indexer memory stake) internal pure returns (uint256) {\n return stake.tokensStaked.sub(stake.tokensLocked);\n }\n\n /**\n * @dev Tokens free balance on the indexer stake that can be used for any purpose.\n * Any token that is allocated cannot be used as well as tokens that are going through the\n * thawing period or are withdrawable\n * Calc: tokensStaked - tokensAllocated - tokensLocked\n * @param stake Stake data\n * @return Token amount\n */\n function tokensAvailable(Stakes.Indexer memory stake) internal pure returns (uint256) {\n return stake.tokensAvailableWithDelegation(0);\n }\n\n /**\n * @dev Tokens free balance on the indexer stake that can be used for allocations.\n * This function accepts a parameter for extra delegated capacity that takes into\n * account delegated tokens\n * @param stake Stake data\n * @param _delegatedCapacity Amount of tokens used from delegators to calculate availability\n * @return Token amount\n */\n function tokensAvailableWithDelegation(Stakes.Indexer memory stake, uint256 _delegatedCapacity)\n internal\n pure\n returns (uint256)\n {\n uint256 tokensCapacity = stake.tokensStaked.add(_delegatedCapacity);\n uint256 _tokensUsed = stake.tokensUsed();\n // If more tokens are used than the current capacity, the indexer is overallocated.\n // This means the indexer doesn't have available capacity to create new allocations.\n // We can reach this state when the indexer has funds allocated and then any\n // of these conditions happen:\n // - The delegationCapacity ratio is reduced.\n // - The indexer stake is slashed.\n // - A delegator removes enough stake.\n if (_tokensUsed > tokensCapacity) {\n // Indexer stake is over allocated: return 0 to avoid stake to be used until\n // the overallocation is restored by staking more tokens, unallocating tokens\n // or using more delegated funds\n return 0;\n }\n return tokensCapacity.sub(_tokensUsed);\n }\n\n /**\n * @dev Tokens available for withdrawal after thawing period.\n * @param stake Stake data\n * @return Token amount\n */\n function tokensWithdrawable(Stakes.Indexer memory stake) internal view returns (uint256) {\n // No tokens to withdraw before locking period\n if (stake.tokensLockedUntil == 0 || block.number < stake.tokensLockedUntil) {\n return 0;\n }\n return stake.tokensLocked;\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/ERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\nimport \"../../utils/Context.sol\";\nimport \"./IERC20.sol\";\nimport \"../../math/SafeMath.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin guidelines: functions revert instead\n * of returning `false` on failure. This behavior is nonetheless conventional\n * and does not conflict with the expectations of ERC20 applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20 {\n using SafeMath for uint256;\n\n mapping (address => uint256) private _balances;\n\n mapping (address => mapping (address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n uint8 private _decimals;\n\n /**\n * @dev Sets the values for {name} and {symbol}, initializes {decimals} with\n * a default value of 18.\n *\n * To select a different value for {decimals}, use {_setupDecimals}.\n *\n * All three of these values are immutable: they can only be set once during\n * construction.\n */\n constructor (string memory name_, string memory symbol_) public {\n _name = name_;\n _symbol = symbol_;\n _decimals = 18;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5,05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless {_setupDecimals} is\n * called.\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual returns (uint8) {\n return _decimals;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `recipient` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address recipient, uint256 amount) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * Requirements:\n *\n * - `sender` and `recipient` cannot be the zero address.\n * - `sender` must have a balance of at least `amount`.\n * - the caller must have allowance for ``sender``'s tokens of at least\n * `amount`.\n */\n function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, \"ERC20: transfer amount exceeds allowance\"));\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, \"ERC20: decreased allowance below zero\"));\n return true;\n }\n\n /**\n * @dev Moves tokens `amount` from `sender` to `recipient`.\n *\n * This is internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `sender` cannot be the zero address.\n * - `recipient` cannot be the zero address.\n * - `sender` must have a balance of at least `amount`.\n */\n function _transfer(address sender, address recipient, uint256 amount) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(sender, recipient, amount);\n\n _balances[sender] = _balances[sender].sub(amount, \"ERC20: transfer amount exceeds balance\");\n _balances[recipient] = _balances[recipient].add(amount);\n emit Transfer(sender, recipient, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply = _totalSupply.add(amount);\n _balances[account] = _balances[account].add(amount);\n emit Transfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n _balances[account] = _balances[account].sub(amount, \"ERC20: burn amount exceeds balance\");\n _totalSupply = _totalSupply.sub(amount);\n emit Transfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(address owner, address spender, uint256 amount) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Sets {decimals} to a value other than the default one of 18.\n *\n * WARNING: This function should only be called from the constructor. Most\n * applications that interact with token contracts will not expect\n * {decimals} to ever change, and may work incorrectly if it does.\n */\n function _setupDecimals(uint8 decimals_) internal virtual {\n _decimals = decimals_;\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be to transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }\n}\n" + }, + "contracts/GraphTokenMock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\n\n/**\n * @title Graph Token Mock\n */\ncontract GraphTokenMock is Ownable, ERC20 {\n /**\n * @dev Contract Constructor.\n * @param _initialSupply Initial supply\n */\n constructor(uint256 _initialSupply, address _mintTo) ERC20(\"Graph Token Mock\", \"GRT-Mock\") {\n // Deploy to mint address\n _mint(_mintTo, _initialSupply);\n }\n}\n" + }, + "contracts/MinimalProxyFactory.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\nimport \"@openzeppelin/contracts/utils/Create2.sol\";\n\n// Adapted from https://github.com/OpenZeppelin/openzeppelin-sdk/blob/v2.5.0/packages/lib/contracts/upgradeability/ProxyFactory.sol\n// Based on https://eips.ethereum.org/EIPS/eip-1167\ncontract MinimalProxyFactory is Ownable {\n // -- Events --\n\n event ProxyCreated(address indexed proxy);\n\n /**\n * @notice Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation\n * @param _salt Bytes32 salt to use for CREATE2\n * @param _implementation Address of the proxy target implementation\n * @return Address of the counterfactual MinimalProxy\n */\n function getDeploymentAddress(bytes32 _salt, address _implementation) external view returns (address) {\n return Create2.computeAddress(_salt, keccak256(_getContractCreationCode(_implementation)), address(this));\n }\n\n /**\n * @notice Deploys a MinimalProxy with CREATE2\n * @param _salt Bytes32 salt to use for CREATE2\n * @param _implementation Address of the proxy target implementation\n * @param _data Bytes with the initializer call\n * @return Address of the deployed MinimalProxy\n */\n function _deployProxy2(\n bytes32 _salt,\n address _implementation,\n bytes memory _data\n ) internal returns (address) {\n address proxyAddress = Create2.deploy(0, _salt, _getContractCreationCode(_implementation));\n\n emit ProxyCreated(proxyAddress);\n\n // Call function with data\n if (_data.length > 0) {\n Address.functionCall(proxyAddress, _data);\n }\n\n return proxyAddress;\n }\n\n /**\n * @notice Gets the MinimalProxy bytecode\n * @param _implementation Address of the proxy target implementation\n * @return MinimalProxy bytecode\n */\n function _getContractCreationCode(address _implementation) internal pure returns (bytes memory) {\n bytes10 creation = 0x3d602d80600a3d3981f3;\n bytes10 prefix = 0x363d3d373d3d3d363d73;\n bytes20 targetBytes = bytes20(_implementation);\n bytes15 suffix = 0x5af43d82803e903d91602b57fd5bf3;\n return abi.encodePacked(creation, prefix, targetBytes, suffix);\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Create2.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/**\n * @dev Helper to make usage of the `CREATE2` EVM opcode easier and safer.\n * `CREATE2` can be used to compute in advance the address where a smart\n * contract will be deployed, which allows for interesting new mechanisms known\n * as 'counterfactual interactions'.\n *\n * See the https://eips.ethereum.org/EIPS/eip-1014#motivation[EIP] for more\n * information.\n */\nlibrary Create2 {\n /**\n * @dev Deploys a contract using `CREATE2`. The address where the contract\n * will be deployed can be known in advance via {computeAddress}.\n *\n * The bytecode for a contract can be obtained from Solidity with\n * `type(contractName).creationCode`.\n *\n * Requirements:\n *\n * - `bytecode` must not be empty.\n * - `salt` must have not been used for `bytecode` already.\n * - the factory must have a balance of at least `amount`.\n * - if `amount` is non-zero, `bytecode` must have a `payable` constructor.\n */\n function deploy(uint256 amount, bytes32 salt, bytes memory bytecode) internal returns (address) {\n address addr;\n require(address(this).balance >= amount, \"Create2: insufficient balance\");\n require(bytecode.length != 0, \"Create2: bytecode length is zero\");\n // solhint-disable-next-line no-inline-assembly\n assembly {\n addr := create2(amount, add(bytecode, 0x20), mload(bytecode), salt)\n }\n require(addr != address(0), \"Create2: Failed on deploy\");\n return addr;\n }\n\n /**\n * @dev Returns the address where a contract will be stored if deployed via {deploy}. Any change in the\n * `bytecodeHash` or `salt` will result in a new destination address.\n */\n function computeAddress(bytes32 salt, bytes32 bytecodeHash) internal view returns (address) {\n return computeAddress(salt, bytecodeHash, address(this));\n }\n\n /**\n * @dev Returns the address where a contract will be stored if deployed via {deploy} from a contract located at\n * `deployer`. If `deployer` is this contract's address, returns the same value as {computeAddress}.\n */\n function computeAddress(bytes32 salt, bytes32 bytecodeHash, address deployer) internal pure returns (address) {\n bytes32 _data = keccak256(\n abi.encodePacked(bytes1(0xff), deployer, salt, bytecodeHash)\n );\n return address(uint160(uint256(_data)));\n }\n}\n" + }, + "contracts/GraphTokenLockManager.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\";\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"@openzeppelin/contracts/utils/EnumerableSet.sol\";\n\nimport \"./MinimalProxyFactory.sol\";\nimport \"./IGraphTokenLockManager.sol\";\n\n/**\n * @title GraphTokenLockManager\n * @notice This contract manages a list of authorized function calls and targets that can be called\n * by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts.\n *\n * This contract receives funds to make the process of creating TokenLockWallet contracts\n * easier by distributing them the initial tokens to be managed.\n *\n * The owner can setup a list of token destinations that will be used by TokenLock contracts to\n * approve the pulling of funds, this way in can be guaranteed that only protocol contracts\n * will manipulate users funds.\n */\ncontract GraphTokenLockManager is MinimalProxyFactory, IGraphTokenLockManager {\n using SafeERC20 for IERC20;\n using EnumerableSet for EnumerableSet.AddressSet;\n\n // -- State --\n\n mapping(bytes4 => address) public authFnCalls;\n EnumerableSet.AddressSet private _tokenDestinations;\n\n address public masterCopy;\n IERC20 private _token;\n\n // -- Events --\n\n event MasterCopyUpdated(address indexed masterCopy);\n event TokenLockCreated(\n address indexed contractAddress,\n bytes32 indexed initHash,\n address indexed beneficiary,\n address token,\n uint256 managedAmount,\n uint256 startTime,\n uint256 endTime,\n uint256 periods,\n uint256 releaseStartTime,\n uint256 vestingCliffTime,\n IGraphTokenLock.Revocability revocable\n );\n\n event TokensDeposited(address indexed sender, uint256 amount);\n event TokensWithdrawn(address indexed sender, uint256 amount);\n\n event FunctionCallAuth(address indexed caller, bytes4 indexed sigHash, address indexed target, string signature);\n event TokenDestinationAllowed(address indexed dst, bool allowed);\n\n /**\n * Constructor.\n * @param _graphToken Token to use for deposits and withdrawals\n * @param _masterCopy Address of the master copy to use to clone proxies\n */\n constructor(IERC20 _graphToken, address _masterCopy) {\n require(address(_graphToken) != address(0), \"Token cannot be zero\");\n _token = _graphToken;\n setMasterCopy(_masterCopy);\n }\n\n // -- Factory --\n\n /**\n * @notice Sets the masterCopy bytecode to use to create clones of TokenLock contracts\n * @param _masterCopy Address of contract bytecode to factory clone\n */\n function setMasterCopy(address _masterCopy) public override onlyOwner {\n require(_masterCopy != address(0), \"MasterCopy cannot be zero\");\n masterCopy = _masterCopy;\n emit MasterCopyUpdated(_masterCopy);\n }\n\n /**\n * @notice Creates and fund a new token lock wallet using a minimum proxy\n * @param _owner Address of the contract owner\n * @param _beneficiary Address of the beneficiary of locked tokens\n * @param _managedAmount Amount of tokens to be managed by the lock contract\n * @param _startTime Start time of the release schedule\n * @param _endTime End time of the release schedule\n * @param _periods Number of periods between start time and end time\n * @param _releaseStartTime Override time for when the releases start\n * @param _revocable Whether the contract is revocable\n */\n function createTokenLockWallet(\n address _owner,\n address _beneficiary,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n IGraphTokenLock.Revocability _revocable\n ) external override onlyOwner {\n require(_token.balanceOf(address(this)) >= _managedAmount, \"Not enough tokens to create lock\");\n\n // Create contract using a minimal proxy and call initializer\n bytes memory initializer = abi.encodeWithSignature(\n \"initialize(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)\",\n address(this),\n _owner,\n _beneficiary,\n address(_token),\n _managedAmount,\n _startTime,\n _endTime,\n _periods,\n _releaseStartTime,\n _vestingCliffTime,\n _revocable\n );\n address contractAddress = _deployProxy2(keccak256(initializer), masterCopy, initializer);\n\n // Send managed amount to the created contract\n _token.safeTransfer(contractAddress, _managedAmount);\n\n emit TokenLockCreated(\n contractAddress,\n keccak256(initializer),\n _beneficiary,\n address(_token),\n _managedAmount,\n _startTime,\n _endTime,\n _periods,\n _releaseStartTime,\n _vestingCliffTime,\n _revocable\n );\n }\n\n // -- Funds Management --\n\n /**\n * @notice Gets the GRT token address\n * @return Token used for transfers and approvals\n */\n function token() external view override returns (IERC20) {\n return _token;\n }\n\n /**\n * @notice Deposits tokens into the contract\n * @dev Even if the ERC20 token can be transferred directly to the contract\n * this function provide a safe interface to do the transfer and avoid mistakes\n * @param _amount Amount to deposit\n */\n function deposit(uint256 _amount) external override {\n require(_amount > 0, \"Amount cannot be zero\");\n _token.safeTransferFrom(msg.sender, address(this), _amount);\n emit TokensDeposited(msg.sender, _amount);\n }\n\n /**\n * @notice Withdraws tokens from the contract\n * @dev Escape hatch in case of mistakes or to recover remaining funds\n * @param _amount Amount of tokens to withdraw\n */\n function withdraw(uint256 _amount) external override onlyOwner {\n require(_amount > 0, \"Amount cannot be zero\");\n _token.safeTransfer(msg.sender, _amount);\n emit TokensWithdrawn(msg.sender, _amount);\n }\n\n // -- Token Destinations --\n\n /**\n * @notice Adds an address that can be allowed by a token lock to pull funds\n * @param _dst Destination address\n */\n function addTokenDestination(address _dst) external override onlyOwner {\n require(_dst != address(0), \"Destination cannot be zero\");\n require(_tokenDestinations.add(_dst), \"Destination already added\");\n emit TokenDestinationAllowed(_dst, true);\n }\n\n /**\n * @notice Removes an address that can be allowed by a token lock to pull funds\n * @param _dst Destination address\n */\n function removeTokenDestination(address _dst) external override onlyOwner {\n require(_tokenDestinations.remove(_dst), \"Destination already removed\");\n emit TokenDestinationAllowed(_dst, false);\n }\n\n /**\n * @notice Returns True if the address is authorized to be a destination of tokens\n * @param _dst Destination address\n * @return True if authorized\n */\n function isTokenDestination(address _dst) external view override returns (bool) {\n return _tokenDestinations.contains(_dst);\n }\n\n /**\n * @notice Returns an array of authorized destination addresses\n * @return Array of addresses authorized to pull funds from a token lock\n */\n function getTokenDestinations() external view override returns (address[] memory) {\n address[] memory dstList = new address[](_tokenDestinations.length());\n for (uint256 i = 0; i < _tokenDestinations.length(); i++) {\n dstList[i] = _tokenDestinations.at(i);\n }\n return dstList;\n }\n\n // -- Function Call Authorization --\n\n /**\n * @notice Sets an authorized function call to target\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\n * @param _signature Function signature\n * @param _target Address of the destination contract to call\n */\n function setAuthFunctionCall(string calldata _signature, address _target) external override onlyOwner {\n _setAuthFunctionCall(_signature, _target);\n }\n\n /**\n * @notice Unsets an authorized function call to target\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\n * @param _signature Function signature\n */\n function unsetAuthFunctionCall(string calldata _signature) external override onlyOwner {\n bytes4 sigHash = _toFunctionSigHash(_signature);\n authFnCalls[sigHash] = address(0);\n\n emit FunctionCallAuth(msg.sender, sigHash, address(0), _signature);\n }\n\n /**\n * @notice Sets an authorized function call to target in bulk\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\n * @param _signatures Function signatures\n * @param _targets Address of the destination contract to call\n */\n function setAuthFunctionCallMany(string[] calldata _signatures, address[] calldata _targets)\n external\n override\n onlyOwner\n {\n require(_signatures.length == _targets.length, \"Array length mismatch\");\n\n for (uint256 i = 0; i < _signatures.length; i++) {\n _setAuthFunctionCall(_signatures[i], _targets[i]);\n }\n }\n\n /**\n * @notice Sets an authorized function call to target\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\n * @dev Function signatures of Graph Protocol contracts to be used are known ahead of time\n * @param _signature Function signature\n * @param _target Address of the destination contract to call\n */\n function _setAuthFunctionCall(string calldata _signature, address _target) internal {\n require(_target != address(this), \"Target must be other contract\");\n require(Address.isContract(_target), \"Target must be a contract\");\n\n bytes4 sigHash = _toFunctionSigHash(_signature);\n authFnCalls[sigHash] = _target;\n\n emit FunctionCallAuth(msg.sender, sigHash, _target, _signature);\n }\n\n /**\n * @notice Gets the target contract to call for a particular function signature\n * @param _sigHash Function signature hash\n * @return Address of the target contract where to send the call\n */\n function getAuthFunctionCallTarget(bytes4 _sigHash) public view override returns (address) {\n return authFnCalls[_sigHash];\n }\n\n /**\n * @notice Returns true if the function call is authorized\n * @param _sigHash Function signature hash\n * @return True if authorized\n */\n function isAuthFunctionCall(bytes4 _sigHash) external view override returns (bool) {\n return getAuthFunctionCallTarget(_sigHash) != address(0);\n }\n\n /**\n * @dev Converts a function signature string to 4-bytes hash\n * @param _signature Function signature string\n * @return Function signature hash\n */\n function _toFunctionSigHash(string calldata _signature) internal pure returns (bytes4) {\n return _convertToBytes4(abi.encodeWithSignature(_signature));\n }\n\n /**\n * @dev Converts function signature bytes to function signature hash (bytes4)\n * @param _signature Function signature\n * @return Function signature in bytes4\n */\n function _convertToBytes4(bytes memory _signature) internal pure returns (bytes4) {\n require(_signature.length == 4, \"Invalid method signature\");\n bytes4 sigHash;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n sigHash := mload(add(_signature, 32))\n }\n return sigHash;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/EnumerableSet.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/**\n * @dev Library for managing\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\n * types.\n *\n * Sets have the following properties:\n *\n * - Elements are added, removed, and checked for existence in constant time\n * (O(1)).\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\n *\n * ```\n * contract Example {\n * // Add the library methods\n * using EnumerableSet for EnumerableSet.AddressSet;\n *\n * // Declare a set state variable\n * EnumerableSet.AddressSet private mySet;\n * }\n * ```\n *\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\n * and `uint256` (`UintSet`) are supported.\n */\nlibrary EnumerableSet {\n // To implement this library for multiple types with as little code\n // repetition as possible, we write it in terms of a generic Set type with\n // bytes32 values.\n // The Set implementation uses private functions, and user-facing\n // implementations (such as AddressSet) are just wrappers around the\n // underlying Set.\n // This means that we can only create new EnumerableSets for types that fit\n // in bytes32.\n\n struct Set {\n // Storage of set values\n bytes32[] _values;\n\n // Position of the value in the `values` array, plus 1 because index 0\n // means a value is not in the set.\n mapping (bytes32 => uint256) _indexes;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function _add(Set storage set, bytes32 value) private returns (bool) {\n if (!_contains(set, value)) {\n set._values.push(value);\n // The value is stored at length-1, but we add 1 to all indexes\n // and use 0 as a sentinel value\n set._indexes[value] = set._values.length;\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function _remove(Set storage set, bytes32 value) private returns (bool) {\n // We read and store the value's index to prevent multiple reads from the same storage slot\n uint256 valueIndex = set._indexes[value];\n\n if (valueIndex != 0) { // Equivalent to contains(set, value)\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\n // the array, and then remove the last element (sometimes called as 'swap and pop').\n // This modifies the order of the array, as noted in {at}.\n\n uint256 toDeleteIndex = valueIndex - 1;\n uint256 lastIndex = set._values.length - 1;\n\n // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs\n // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.\n\n bytes32 lastvalue = set._values[lastIndex];\n\n // Move the last value to the index where the value to delete is\n set._values[toDeleteIndex] = lastvalue;\n // Update the index for the moved value\n set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based\n\n // Delete the slot where the moved value was stored\n set._values.pop();\n\n // Delete the index for the deleted slot\n delete set._indexes[value];\n\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\n return set._indexes[value] != 0;\n }\n\n /**\n * @dev Returns the number of values on the set. O(1).\n */\n function _length(Set storage set) private view returns (uint256) {\n return set._values.length;\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\n require(set._values.length > index, \"EnumerableSet: index out of bounds\");\n return set._values[index];\n }\n\n // Bytes32Set\n\n struct Bytes32Set {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _add(set._inner, value);\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _remove(set._inner, value);\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\n return _contains(set._inner, value);\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(Bytes32Set storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\n return _at(set._inner, index);\n }\n\n // AddressSet\n\n struct AddressSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(AddressSet storage set, address value) internal returns (bool) {\n return _add(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(AddressSet storage set, address value) internal returns (bool) {\n return _remove(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(AddressSet storage set, address value) internal view returns (bool) {\n return _contains(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(AddressSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\n return address(uint160(uint256(_at(set._inner, index))));\n }\n\n\n // UintSet\n\n struct UintSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(UintSet storage set, uint256 value) internal returns (bool) {\n return _add(set._inner, bytes32(value));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\n return _remove(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\n return _contains(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns the number of values on the set. O(1).\n */\n function length(UintSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\n return uint256(_at(set._inner, index));\n }\n}\n" + }, + "contracts/GraphTokenLockSimple.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport \"./GraphTokenLock.sol\";\n\n/**\n * @title GraphTokenLockSimple\n * @notice This contract is the concrete simple implementation built on top of the base\n * GraphTokenLock functionality for use when we only need the token lock schedule\n * features but no interaction with the network.\n * \n * This contract is designed to be deployed without the use of a TokenManager.\n */\ncontract GraphTokenLockSimple is GraphTokenLock {\n // Constructor\n constructor() {\n Ownable.initialize(msg.sender);\n }\n\n // Initializer\n function initialize(\n address _owner,\n address _beneficiary,\n address _token,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n Revocability _revocable\n ) external onlyOwner {\n _initialize(\n _owner,\n _beneficiary,\n _token,\n _managedAmount,\n _startTime,\n _endTime,\n _periods,\n _releaseStartTime,\n _vestingCliffTime,\n _revocable\n );\n }\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": false, + "runs": 200 + }, + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file diff --git a/packages/token-distribution/deployments/goerli/solcInputs/b5cdad58099d39cd1aed000b2fd864d8.json b/packages/token-distribution/deployments/goerli/solcInputs/b5cdad58099d39cd1aed000b2fd864d8.json new file mode 100644 index 000000000..4eda754ae --- /dev/null +++ b/packages/token-distribution/deployments/goerli/solcInputs/b5cdad58099d39cd1aed000b2fd864d8.json @@ -0,0 +1,152 @@ +{ + "language": "Solidity", + "sources": { + "@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/**\n * @dev Wrappers over Solidity's arithmetic operations with added overflow\n * checks.\n *\n * Arithmetic operations in Solidity wrap on overflow. This can easily result\n * in bugs, because programmers usually assume that an overflow raises an\n * error, which is the standard behavior in high level programming languages.\n * `SafeMath` restores this intuition by reverting the transaction when an\n * operation overflows.\n *\n * Using this library instead of the unchecked operations eliminates an entire\n * class of bugs, so it's recommended to use it always.\n */\nlibrary SafeMathUpgradeable {\n /**\n * @dev Returns the addition of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n uint256 c = a + b;\n if (c < a) return (false, 0);\n return (true, c);\n }\n\n /**\n * @dev Returns the substraction of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n if (b > a) return (false, 0);\n return (true, a - b);\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\n // benefit is lost if 'b' is also tested.\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\n if (a == 0) return (true, 0);\n uint256 c = a * b;\n if (c / a != b) return (false, 0);\n return (true, c);\n }\n\n /**\n * @dev Returns the division of two unsigned integers, with a division by zero flag.\n *\n * _Available since v3.4._\n */\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n if (b == 0) return (false, 0);\n return (true, a / b);\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\n *\n * _Available since v3.4._\n */\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n if (b == 0) return (false, 0);\n return (true, a % b);\n }\n\n /**\n * @dev Returns the addition of two unsigned integers, reverting on\n * overflow.\n *\n * Counterpart to Solidity's `+` operator.\n *\n * Requirements:\n *\n * - Addition cannot overflow.\n */\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\n uint256 c = a + b;\n require(c >= a, \"SafeMath: addition overflow\");\n return c;\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, reverting on\n * overflow (when the result is negative).\n *\n * Counterpart to Solidity's `-` operator.\n *\n * Requirements:\n *\n * - Subtraction cannot overflow.\n */\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b <= a, \"SafeMath: subtraction overflow\");\n return a - b;\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, reverting on\n * overflow.\n *\n * Counterpart to Solidity's `*` operator.\n *\n * Requirements:\n *\n * - Multiplication cannot overflow.\n */\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n if (a == 0) return 0;\n uint256 c = a * b;\n require(c / a == b, \"SafeMath: multiplication overflow\");\n return c;\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers, reverting on\n * division by zero. The result is rounded towards zero.\n *\n * Counterpart to Solidity's `/` operator. Note: this function uses a\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\n * uses an invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b > 0, \"SafeMath: division by zero\");\n return a / b;\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * reverting when dividing by zero.\n *\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\n * opcode (which leaves remaining gas untouched) while Solidity uses an\n * invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b > 0, \"SafeMath: modulo by zero\");\n return a % b;\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\n * overflow (when the result is negative).\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {trySub}.\n *\n * Counterpart to Solidity's `-` operator.\n *\n * Requirements:\n *\n * - Subtraction cannot overflow.\n */\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b <= a, errorMessage);\n return a - b;\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers, reverting with custom message on\n * division by zero. The result is rounded towards zero.\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {tryDiv}.\n *\n * Counterpart to Solidity's `/` operator. Note: this function uses a\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\n * uses an invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b > 0, errorMessage);\n return a / b;\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * reverting with custom message when dividing by zero.\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {tryMod}.\n *\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\n * opcode (which leaves remaining gas untouched) while Solidity uses an\n * invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b > 0, errorMessage);\n return a % b;\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\n// solhint-disable-next-line compiler-version\npragma solidity >=0.4.24 <0.8.0;\n\nimport \"../utils/AddressUpgradeable.sol\";\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {UpgradeableProxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n */\nabstract contract Initializable {\n\n /**\n * @dev Indicates that the contract has been initialized.\n */\n bool private _initialized;\n\n /**\n * @dev Indicates that the contract is in the process of being initialized.\n */\n bool private _initializing;\n\n /**\n * @dev Modifier to protect an initializer function from being invoked twice.\n */\n modifier initializer() {\n require(_initializing || _isConstructor() || !_initialized, \"Initializable: contract is already initialized\");\n\n bool isTopLevelCall = !_initializing;\n if (isTopLevelCall) {\n _initializing = true;\n _initialized = true;\n }\n\n _;\n\n if (isTopLevelCall) {\n _initializing = false;\n }\n }\n\n /// @dev Returns true if and only if the function is running in the constructor\n function _isConstructor() private view returns (bool) {\n return !AddressUpgradeable.isContract(address(this));\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.2 <0.8.0;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary AddressUpgradeable {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize, which returns 0 for contracts in\n // construction, since the code is only stored at the end of the\n // constructor execution.\n\n uint256 size;\n // solhint-disable-next-line no-inline-assembly\n assembly { size := extcodesize(account) }\n return size > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n // solhint-disable-next-line avoid-low-level-calls, avoid-call-value\n (bool success, ) = recipient.call{ value: amount }(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain`call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCall(target, data, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n require(isContract(target), \"Address: call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.call{ value: value }(data);\n return _verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {\n require(isContract(target), \"Address: static call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.staticcall(data);\n return _verifyCallResult(success, returndata, errorMessage);\n }\n\n function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {\n if (success) {\n return returndata;\n } else {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n }\n}\n" + }, + "@openzeppelin/contracts/access/Ownable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\nimport \"../utils/Context.sol\";\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor () internal {\n address msgSender = _msgSender();\n _owner = msgSender;\n emit OwnershipTransferred(address(0), msgSender);\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n _;\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n emit OwnershipTransferred(_owner, address(0));\n _owner = address(0);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n emit OwnershipTransferred(_owner, newOwner);\n _owner = newOwner;\n }\n}\n" + }, + "@openzeppelin/contracts/math/SafeMath.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/**\n * @dev Wrappers over Solidity's arithmetic operations with added overflow\n * checks.\n *\n * Arithmetic operations in Solidity wrap on overflow. This can easily result\n * in bugs, because programmers usually assume that an overflow raises an\n * error, which is the standard behavior in high level programming languages.\n * `SafeMath` restores this intuition by reverting the transaction when an\n * operation overflows.\n *\n * Using this library instead of the unchecked operations eliminates an entire\n * class of bugs, so it's recommended to use it always.\n */\nlibrary SafeMath {\n /**\n * @dev Returns the addition of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n uint256 c = a + b;\n if (c < a) return (false, 0);\n return (true, c);\n }\n\n /**\n * @dev Returns the substraction of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n if (b > a) return (false, 0);\n return (true, a - b);\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\n // benefit is lost if 'b' is also tested.\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\n if (a == 0) return (true, 0);\n uint256 c = a * b;\n if (c / a != b) return (false, 0);\n return (true, c);\n }\n\n /**\n * @dev Returns the division of two unsigned integers, with a division by zero flag.\n *\n * _Available since v3.4._\n */\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n if (b == 0) return (false, 0);\n return (true, a / b);\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\n *\n * _Available since v3.4._\n */\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n if (b == 0) return (false, 0);\n return (true, a % b);\n }\n\n /**\n * @dev Returns the addition of two unsigned integers, reverting on\n * overflow.\n *\n * Counterpart to Solidity's `+` operator.\n *\n * Requirements:\n *\n * - Addition cannot overflow.\n */\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\n uint256 c = a + b;\n require(c >= a, \"SafeMath: addition overflow\");\n return c;\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, reverting on\n * overflow (when the result is negative).\n *\n * Counterpart to Solidity's `-` operator.\n *\n * Requirements:\n *\n * - Subtraction cannot overflow.\n */\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b <= a, \"SafeMath: subtraction overflow\");\n return a - b;\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, reverting on\n * overflow.\n *\n * Counterpart to Solidity's `*` operator.\n *\n * Requirements:\n *\n * - Multiplication cannot overflow.\n */\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n if (a == 0) return 0;\n uint256 c = a * b;\n require(c / a == b, \"SafeMath: multiplication overflow\");\n return c;\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers, reverting on\n * division by zero. The result is rounded towards zero.\n *\n * Counterpart to Solidity's `/` operator. Note: this function uses a\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\n * uses an invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b > 0, \"SafeMath: division by zero\");\n return a / b;\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * reverting when dividing by zero.\n *\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\n * opcode (which leaves remaining gas untouched) while Solidity uses an\n * invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b > 0, \"SafeMath: modulo by zero\");\n return a % b;\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\n * overflow (when the result is negative).\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {trySub}.\n *\n * Counterpart to Solidity's `-` operator.\n *\n * Requirements:\n *\n * - Subtraction cannot overflow.\n */\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b <= a, errorMessage);\n return a - b;\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers, reverting with custom message on\n * division by zero. The result is rounded towards zero.\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {tryDiv}.\n *\n * Counterpart to Solidity's `/` operator. Note: this function uses a\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\n * uses an invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b > 0, errorMessage);\n return a / b;\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * reverting with custom message when dividing by zero.\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {tryMod}.\n *\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\n * opcode (which leaves remaining gas untouched) while Solidity uses an\n * invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b > 0, errorMessage);\n return a % b;\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/ERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\nimport \"../../utils/Context.sol\";\nimport \"./IERC20.sol\";\nimport \"../../math/SafeMath.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin guidelines: functions revert instead\n * of returning `false` on failure. This behavior is nonetheless conventional\n * and does not conflict with the expectations of ERC20 applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20 {\n using SafeMath for uint256;\n\n mapping (address => uint256) private _balances;\n\n mapping (address => mapping (address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n uint8 private _decimals;\n\n /**\n * @dev Sets the values for {name} and {symbol}, initializes {decimals} with\n * a default value of 18.\n *\n * To select a different value for {decimals}, use {_setupDecimals}.\n *\n * All three of these values are immutable: they can only be set once during\n * construction.\n */\n constructor (string memory name_, string memory symbol_) public {\n _name = name_;\n _symbol = symbol_;\n _decimals = 18;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5,05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless {_setupDecimals} is\n * called.\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual returns (uint8) {\n return _decimals;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `recipient` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address recipient, uint256 amount) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * Requirements:\n *\n * - `sender` and `recipient` cannot be the zero address.\n * - `sender` must have a balance of at least `amount`.\n * - the caller must have allowance for ``sender``'s tokens of at least\n * `amount`.\n */\n function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, \"ERC20: transfer amount exceeds allowance\"));\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, \"ERC20: decreased allowance below zero\"));\n return true;\n }\n\n /**\n * @dev Moves tokens `amount` from `sender` to `recipient`.\n *\n * This is internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `sender` cannot be the zero address.\n * - `recipient` cannot be the zero address.\n * - `sender` must have a balance of at least `amount`.\n */\n function _transfer(address sender, address recipient, uint256 amount) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(sender, recipient, amount);\n\n _balances[sender] = _balances[sender].sub(amount, \"ERC20: transfer amount exceeds balance\");\n _balances[recipient] = _balances[recipient].add(amount);\n emit Transfer(sender, recipient, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply = _totalSupply.add(amount);\n _balances[account] = _balances[account].add(amount);\n emit Transfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n _balances[account] = _balances[account].sub(amount, \"ERC20: burn amount exceeds balance\");\n _totalSupply = _totalSupply.sub(amount);\n emit Transfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(address owner, address spender, uint256 amount) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Sets {decimals} to a value other than the default one of 18.\n *\n * WARNING: This function should only be called from the constructor. Most\n * applications that interact with token contracts will not expect\n * {decimals} to ever change, and may work incorrectly if it does.\n */\n function _setupDecimals(uint8 decimals_) internal virtual {\n _decimals = decimals_;\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be to transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `recipient`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address recipient, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `sender` to `recipient` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);\n\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/SafeERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"../../math/SafeMath.sol\";\nimport \"../../utils/Address.sol\";\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n using SafeMath for uint256;\n using Address for address;\n\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\n }\n\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\n }\n\n /**\n * @dev Deprecated. This function has issues similar to the ones found in\n * {IERC20-approve}, and its usage is discouraged.\n *\n * Whenever possible, use {safeIncreaseAllowance} and\n * {safeDecreaseAllowance} instead.\n */\n function safeApprove(IERC20 token, address spender, uint256 value) internal {\n // safeApprove should only be called when setting an initial allowance,\n // or when resetting it to zero. To increase and decrease it, use\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\n // solhint-disable-next-line max-line-length\n require((value == 0) || (token.allowance(address(this), spender) == 0),\n \"SafeERC20: approve from non-zero to non-zero allowance\"\n );\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\n }\n\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n uint256 newAllowance = token.allowance(address(this), spender).add(value);\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\n\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n uint256 newAllowance = token.allowance(address(this), spender).sub(value, \"SafeERC20: decreased allowance below zero\");\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n */\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that\n // the target address contains contract code and also asserts for success in the low-level call.\n\n bytes memory returndata = address(token).functionCall(data, \"SafeERC20: low-level call failed\");\n if (returndata.length > 0) { // Return data is optional\n // solhint-disable-next-line max-line-length\n require(abi.decode(returndata, (bool)), \"SafeERC20: ERC20 operation did not succeed\");\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Address.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.2 <0.8.0;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize, which returns 0 for contracts in\n // construction, since the code is only stored at the end of the\n // constructor execution.\n\n uint256 size;\n // solhint-disable-next-line no-inline-assembly\n assembly { size := extcodesize(account) }\n return size > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n // solhint-disable-next-line avoid-low-level-calls, avoid-call-value\n (bool success, ) = recipient.call{ value: amount }(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain`call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCall(target, data, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n require(isContract(target), \"Address: call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.call{ value: value }(data);\n return _verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {\n require(isContract(target), \"Address: static call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.staticcall(data);\n return _verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\n require(isContract(target), \"Address: delegate call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return _verifyCallResult(success, returndata, errorMessage);\n }\n\n function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {\n if (success) {\n return returndata;\n } else {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/*\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with GSN meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address payable) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes memory) {\n this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\n return msg.data;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Create2.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/**\n * @dev Helper to make usage of the `CREATE2` EVM opcode easier and safer.\n * `CREATE2` can be used to compute in advance the address where a smart\n * contract will be deployed, which allows for interesting new mechanisms known\n * as 'counterfactual interactions'.\n *\n * See the https://eips.ethereum.org/EIPS/eip-1014#motivation[EIP] for more\n * information.\n */\nlibrary Create2 {\n /**\n * @dev Deploys a contract using `CREATE2`. The address where the contract\n * will be deployed can be known in advance via {computeAddress}.\n *\n * The bytecode for a contract can be obtained from Solidity with\n * `type(contractName).creationCode`.\n *\n * Requirements:\n *\n * - `bytecode` must not be empty.\n * - `salt` must have not been used for `bytecode` already.\n * - the factory must have a balance of at least `amount`.\n * - if `amount` is non-zero, `bytecode` must have a `payable` constructor.\n */\n function deploy(uint256 amount, bytes32 salt, bytes memory bytecode) internal returns (address) {\n address addr;\n require(address(this).balance >= amount, \"Create2: insufficient balance\");\n require(bytecode.length != 0, \"Create2: bytecode length is zero\");\n // solhint-disable-next-line no-inline-assembly\n assembly {\n addr := create2(amount, add(bytecode, 0x20), mload(bytecode), salt)\n }\n require(addr != address(0), \"Create2: Failed on deploy\");\n return addr;\n }\n\n /**\n * @dev Returns the address where a contract will be stored if deployed via {deploy}. Any change in the\n * `bytecodeHash` or `salt` will result in a new destination address.\n */\n function computeAddress(bytes32 salt, bytes32 bytecodeHash) internal view returns (address) {\n return computeAddress(salt, bytecodeHash, address(this));\n }\n\n /**\n * @dev Returns the address where a contract will be stored if deployed via {deploy} from a contract located at\n * `deployer`. If `deployer` is this contract's address, returns the same value as {computeAddress}.\n */\n function computeAddress(bytes32 salt, bytes32 bytecodeHash, address deployer) internal pure returns (address) {\n bytes32 _data = keccak256(\n abi.encodePacked(bytes1(0xff), deployer, salt, bytecodeHash)\n );\n return address(uint160(uint256(_data)));\n }\n}\n" + }, + "@openzeppelin/contracts/utils/EnumerableSet.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/**\n * @dev Library for managing\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\n * types.\n *\n * Sets have the following properties:\n *\n * - Elements are added, removed, and checked for existence in constant time\n * (O(1)).\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\n *\n * ```\n * contract Example {\n * // Add the library methods\n * using EnumerableSet for EnumerableSet.AddressSet;\n *\n * // Declare a set state variable\n * EnumerableSet.AddressSet private mySet;\n * }\n * ```\n *\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\n * and `uint256` (`UintSet`) are supported.\n */\nlibrary EnumerableSet {\n // To implement this library for multiple types with as little code\n // repetition as possible, we write it in terms of a generic Set type with\n // bytes32 values.\n // The Set implementation uses private functions, and user-facing\n // implementations (such as AddressSet) are just wrappers around the\n // underlying Set.\n // This means that we can only create new EnumerableSets for types that fit\n // in bytes32.\n\n struct Set {\n // Storage of set values\n bytes32[] _values;\n\n // Position of the value in the `values` array, plus 1 because index 0\n // means a value is not in the set.\n mapping (bytes32 => uint256) _indexes;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function _add(Set storage set, bytes32 value) private returns (bool) {\n if (!_contains(set, value)) {\n set._values.push(value);\n // The value is stored at length-1, but we add 1 to all indexes\n // and use 0 as a sentinel value\n set._indexes[value] = set._values.length;\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function _remove(Set storage set, bytes32 value) private returns (bool) {\n // We read and store the value's index to prevent multiple reads from the same storage slot\n uint256 valueIndex = set._indexes[value];\n\n if (valueIndex != 0) { // Equivalent to contains(set, value)\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\n // the array, and then remove the last element (sometimes called as 'swap and pop').\n // This modifies the order of the array, as noted in {at}.\n\n uint256 toDeleteIndex = valueIndex - 1;\n uint256 lastIndex = set._values.length - 1;\n\n // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs\n // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.\n\n bytes32 lastvalue = set._values[lastIndex];\n\n // Move the last value to the index where the value to delete is\n set._values[toDeleteIndex] = lastvalue;\n // Update the index for the moved value\n set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based\n\n // Delete the slot where the moved value was stored\n set._values.pop();\n\n // Delete the index for the deleted slot\n delete set._indexes[value];\n\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\n return set._indexes[value] != 0;\n }\n\n /**\n * @dev Returns the number of values on the set. O(1).\n */\n function _length(Set storage set) private view returns (uint256) {\n return set._values.length;\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\n require(set._values.length > index, \"EnumerableSet: index out of bounds\");\n return set._values[index];\n }\n\n // Bytes32Set\n\n struct Bytes32Set {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _add(set._inner, value);\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _remove(set._inner, value);\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\n return _contains(set._inner, value);\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(Bytes32Set storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\n return _at(set._inner, index);\n }\n\n // AddressSet\n\n struct AddressSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(AddressSet storage set, address value) internal returns (bool) {\n return _add(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(AddressSet storage set, address value) internal returns (bool) {\n return _remove(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(AddressSet storage set, address value) internal view returns (bool) {\n return _contains(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(AddressSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\n return address(uint160(uint256(_at(set._inner, index))));\n }\n\n\n // UintSet\n\n struct UintSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(UintSet storage set, uint256 value) internal returns (bool) {\n return _add(set._inner, bytes32(value));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\n return _remove(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\n return _contains(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns the number of values on the set. O(1).\n */\n function length(UintSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\n return uint256(_at(set._inner, index));\n }\n}\n" + }, + "contracts/arbitrum/ITokenGateway.sol": { + "content": "// SPDX-License-Identifier: Apache-2.0\n\n/*\n * Copyright 2020, Offchain Labs, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * Originally copied from:\n * https://github.com/OffchainLabs/arbitrum/tree/e3a6307ad8a2dc2cad35728a2a9908cfd8dd8ef9/packages/arb-bridge-peripherals\n *\n * MODIFIED from Offchain Labs' implementation:\n * - Changed solidity version to 0.7.6 (pablo@edgeandnode.com)\n *\n */\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\ninterface ITokenGateway {\n /// @notice event deprecated in favor of DepositInitiated and WithdrawalInitiated\n // event OutboundTransferInitiated(\n // address token,\n // address indexed _from,\n // address indexed _to,\n // uint256 indexed _transferId,\n // uint256 _amount,\n // bytes _data\n // );\n\n /// @notice event deprecated in favor of DepositFinalized and WithdrawalFinalized\n // event InboundTransferFinalized(\n // address token,\n // address indexed _from,\n // address indexed _to,\n // uint256 indexed _transferId,\n // uint256 _amount,\n // bytes _data\n // );\n\n function outboundTransfer(\n address _token,\n address _to,\n uint256 _amount,\n uint256 _maxGas,\n uint256 _gasPriceBid,\n bytes calldata _data\n ) external payable returns (bytes memory);\n\n function finalizeInboundTransfer(\n address _token,\n address _from,\n address _to,\n uint256 _amount,\n bytes calldata _data\n ) external payable;\n\n /**\n * @notice Calculate the address used when bridging an ERC20 token\n * @dev the L1 and L2 address oracles may not always be in sync.\n * For example, a custom token may have been registered but not deployed or the contract self destructed.\n * @param l1ERC20 address of L1 token\n * @return L2 address of a bridged ERC20 token\n */\n function calculateL2TokenAddress(address l1ERC20) external view returns (address);\n}\n" + }, + "contracts/GraphTokenDistributor.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\nimport \"@openzeppelin/contracts/math/SafeMath.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\";\n\n/**\n * @title GraphTokenDistributor\n * @dev Contract that allows distribution of tokens to multiple beneficiaries.\n * The contract accept deposits in the configured token by anyone.\n * The owner can setup the desired distribution by setting the amount of tokens\n * assigned to each beneficiary account.\n * Beneficiaries claim for their allocated tokens.\n * Only the owner can withdraw tokens from this contract without limitations.\n * For the distribution to work this contract must be unlocked by the owner.\n */\ncontract GraphTokenDistributor is Ownable {\n using SafeMath for uint256;\n using SafeERC20 for IERC20;\n\n // -- State --\n\n bool public locked;\n mapping(address => uint256) public beneficiaries;\n\n IERC20 public token;\n\n // -- Events --\n\n event BeneficiaryUpdated(address indexed beneficiary, uint256 amount);\n event TokensDeposited(address indexed sender, uint256 amount);\n event TokensWithdrawn(address indexed sender, uint256 amount);\n event TokensClaimed(address indexed beneficiary, address to, uint256 amount);\n event LockUpdated(bool locked);\n\n modifier whenNotLocked() {\n require(locked == false, \"Distributor: Claim is locked\");\n _;\n }\n\n /**\n * Constructor.\n * @param _token Token to use for deposits and withdrawals\n */\n constructor(IERC20 _token) {\n token = _token;\n locked = true;\n }\n\n /**\n * Deposit tokens into the contract.\n * Even if the ERC20 token can be transferred directly to the contract\n * this function provide a safe interface to do the transfer and avoid mistakes\n * @param _amount Amount to deposit\n */\n function deposit(uint256 _amount) external {\n token.safeTransferFrom(msg.sender, address(this), _amount);\n emit TokensDeposited(msg.sender, _amount);\n }\n\n // -- Admin functions --\n\n /**\n * Add token balance available for account.\n * @param _account Address to assign tokens to\n * @param _amount Amount of tokens to assign to beneficiary\n */\n function addBeneficiaryTokens(address _account, uint256 _amount) external onlyOwner {\n _setBeneficiaryTokens(_account, beneficiaries[_account].add(_amount));\n }\n\n /**\n * Add token balance available for multiple accounts.\n * @param _accounts Addresses to assign tokens to\n * @param _amounts Amounts of tokens to assign to beneficiary\n */\n function addBeneficiaryTokensMulti(address[] calldata _accounts, uint256[] calldata _amounts) external onlyOwner {\n require(_accounts.length == _amounts.length, \"Distributor: !length\");\n for (uint256 i = 0; i < _accounts.length; i++) {\n _setBeneficiaryTokens(_accounts[i], beneficiaries[_accounts[i]].add(_amounts[i]));\n }\n }\n\n /**\n * Remove token balance available for account.\n * @param _account Address to assign tokens to\n * @param _amount Amount of tokens to assign to beneficiary\n */\n function subBeneficiaryTokens(address _account, uint256 _amount) external onlyOwner {\n _setBeneficiaryTokens(_account, beneficiaries[_account].sub(_amount));\n }\n\n /**\n * Remove token balance available for multiple accounts.\n * @param _accounts Addresses to assign tokens to\n * @param _amounts Amounts of tokens to assign to beneficiary\n */\n function subBeneficiaryTokensMulti(address[] calldata _accounts, uint256[] calldata _amounts) external onlyOwner {\n require(_accounts.length == _amounts.length, \"Distributor: !length\");\n for (uint256 i = 0; i < _accounts.length; i++) {\n _setBeneficiaryTokens(_accounts[i], beneficiaries[_accounts[i]].sub(_amounts[i]));\n }\n }\n\n /**\n * Set amount of tokens available for beneficiary account.\n * @param _account Address to assign tokens to\n * @param _amount Amount of tokens to assign to beneficiary\n */\n function _setBeneficiaryTokens(address _account, uint256 _amount) private {\n require(_account != address(0), \"Distributor: !account\");\n\n beneficiaries[_account] = _amount;\n emit BeneficiaryUpdated(_account, _amount);\n }\n\n /**\n * Set locked withdrawals.\n * @param _locked True to lock withdrawals\n */\n function setLocked(bool _locked) external onlyOwner {\n locked = _locked;\n emit LockUpdated(_locked);\n }\n\n /**\n * Withdraw tokens from the contract. This function is included as\n * a escape hatch in case of mistakes or to recover remaining funds.\n * @param _amount Amount of tokens to withdraw\n */\n function withdraw(uint256 _amount) external onlyOwner {\n token.safeTransfer(msg.sender, _amount);\n emit TokensWithdrawn(msg.sender, _amount);\n }\n\n // -- Beneficiary functions --\n\n /**\n * Claim tokens and send to caller.\n */\n function claim() external whenNotLocked {\n claimTo(msg.sender);\n }\n\n /**\n * Claim tokens and send to address.\n * @param _to Address where to send tokens\n */\n function claimTo(address _to) public whenNotLocked {\n uint256 claimableTokens = beneficiaries[msg.sender];\n require(claimableTokens > 0, \"Distributor: Unavailable funds\");\n\n _setBeneficiaryTokens(msg.sender, 0);\n\n token.safeTransfer(_to, claimableTokens);\n emit TokensClaimed(msg.sender, _to, claimableTokens);\n }\n}\n" + }, + "contracts/GraphTokenLock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport \"@openzeppelin/contracts/math/SafeMath.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\";\n\nimport { Ownable as OwnableInitializable } from \"./Ownable.sol\";\nimport \"./MathUtils.sol\";\nimport \"./IGraphTokenLock.sol\";\n\n/**\n * @title GraphTokenLock\n * @notice Contract that manages an unlocking schedule of tokens.\n * @dev The contract lock manage a number of tokens deposited into the contract to ensure that\n * they can only be released under certain time conditions.\n *\n * This contract implements a release scheduled based on periods and tokens are released in steps\n * after each period ends. It can be configured with one period in which case it is like a plain TimeLock.\n * It also supports revocation to be used for vesting schedules.\n *\n * The contract supports receiving extra funds than the managed tokens ones that can be\n * withdrawn by the beneficiary at any time.\n *\n * A releaseStartTime parameter is included to override the default release schedule and\n * perform the first release on the configured time. After that it will continue with the\n * default schedule.\n */\nabstract contract GraphTokenLock is OwnableInitializable, IGraphTokenLock {\n using SafeMath for uint256;\n using SafeERC20 for IERC20;\n\n uint256 private constant MIN_PERIOD = 1;\n\n // -- State --\n\n IERC20 public token;\n address public beneficiary;\n\n // Configuration\n\n // Amount of tokens managed by the contract schedule\n uint256 public managedAmount;\n\n uint256 public startTime; // Start datetime (in unixtimestamp)\n uint256 public endTime; // Datetime after all funds are fully vested/unlocked (in unixtimestamp)\n uint256 public periods; // Number of vesting/release periods\n\n // First release date for tokens (in unixtimestamp)\n // If set, no tokens will be released before releaseStartTime ignoring\n // the amount to release each period\n uint256 public releaseStartTime;\n // A cliff set a date to which a beneficiary needs to get to vest\n // all preceding periods\n uint256 public vestingCliffTime;\n Revocability public revocable; // Whether to use vesting for locked funds\n\n // State\n\n bool public isRevoked;\n bool public isInitialized;\n bool public isAccepted;\n uint256 public releasedAmount;\n uint256 public revokedAmount;\n\n // -- Events --\n\n event TokensReleased(address indexed beneficiary, uint256 amount);\n event TokensWithdrawn(address indexed beneficiary, uint256 amount);\n event TokensRevoked(address indexed beneficiary, uint256 amount);\n event BeneficiaryChanged(address newBeneficiary);\n event LockAccepted();\n event LockCanceled();\n\n /**\n * @dev Only allow calls from the beneficiary of the contract\n */\n modifier onlyBeneficiary() {\n require(msg.sender == beneficiary, \"!auth\");\n _;\n }\n\n /**\n * @notice Initializes the contract\n * @param _owner Address of the contract owner\n * @param _beneficiary Address of the beneficiary of locked tokens\n * @param _managedAmount Amount of tokens to be managed by the lock contract\n * @param _startTime Start time of the release schedule\n * @param _endTime End time of the release schedule\n * @param _periods Number of periods between start time and end time\n * @param _releaseStartTime Override time for when the releases start\n * @param _vestingCliffTime Override time for when the vesting start\n * @param _revocable Whether the contract is revocable\n */\n function _initialize(\n address _owner,\n address _beneficiary,\n address _token,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n Revocability _revocable\n ) internal {\n require(!isInitialized, \"Already initialized\");\n require(_owner != address(0), \"Owner cannot be zero\");\n require(_beneficiary != address(0), \"Beneficiary cannot be zero\");\n require(_token != address(0), \"Token cannot be zero\");\n require(_managedAmount > 0, \"Managed tokens cannot be zero\");\n require(_startTime != 0, \"Start time must be set\");\n require(_startTime < _endTime, \"Start time > end time\");\n require(_periods >= MIN_PERIOD, \"Periods cannot be below minimum\");\n require(_revocable != Revocability.NotSet, \"Must set a revocability option\");\n require(_releaseStartTime < _endTime, \"Release start time must be before end time\");\n require(_vestingCliffTime < _endTime, \"Cliff time must be before end time\");\n\n isInitialized = true;\n\n OwnableInitializable._initialize(_owner);\n beneficiary = _beneficiary;\n token = IERC20(_token);\n\n managedAmount = _managedAmount;\n\n startTime = _startTime;\n endTime = _endTime;\n periods = _periods;\n\n // Optionals\n releaseStartTime = _releaseStartTime;\n vestingCliffTime = _vestingCliffTime;\n revocable = _revocable;\n }\n\n /**\n * @notice Change the beneficiary of funds managed by the contract\n * @dev Can only be called by the beneficiary\n * @param _newBeneficiary Address of the new beneficiary address\n */\n function changeBeneficiary(address _newBeneficiary) external onlyBeneficiary {\n require(_newBeneficiary != address(0), \"Empty beneficiary\");\n beneficiary = _newBeneficiary;\n emit BeneficiaryChanged(_newBeneficiary);\n }\n\n /**\n * @notice Beneficiary accepts the lock, the owner cannot retrieve back the tokens\n * @dev Can only be called by the beneficiary\n */\n function acceptLock() external onlyBeneficiary {\n isAccepted = true;\n emit LockAccepted();\n }\n\n /**\n * @notice Owner cancel the lock and return the balance in the contract\n * @dev Can only be called by the owner\n */\n function cancelLock() external onlyOwner {\n require(isAccepted == false, \"Cannot cancel accepted contract\");\n\n token.safeTransfer(owner(), currentBalance());\n\n emit LockCanceled();\n }\n\n // -- Balances --\n\n /**\n * @notice Returns the amount of tokens currently held by the contract\n * @return Tokens held in the contract\n */\n function currentBalance() public view override returns (uint256) {\n return token.balanceOf(address(this));\n }\n\n // -- Time & Periods --\n\n /**\n * @notice Returns the current block timestamp\n * @return Current block timestamp\n */\n function currentTime() public view override returns (uint256) {\n return block.timestamp;\n }\n\n /**\n * @notice Gets duration of contract from start to end in seconds\n * @return Amount of seconds from contract startTime to endTime\n */\n function duration() public view override returns (uint256) {\n return endTime.sub(startTime);\n }\n\n /**\n * @notice Gets time elapsed since the start of the contract\n * @dev Returns zero if called before conctract starTime\n * @return Seconds elapsed from contract startTime\n */\n function sinceStartTime() public view override returns (uint256) {\n uint256 current = currentTime();\n if (current <= startTime) {\n return 0;\n }\n return current.sub(startTime);\n }\n\n /**\n * @notice Returns amount available to be released after each period according to schedule\n * @return Amount of tokens available after each period\n */\n function amountPerPeriod() public view override returns (uint256) {\n return managedAmount.div(periods);\n }\n\n /**\n * @notice Returns the duration of each period in seconds\n * @return Duration of each period in seconds\n */\n function periodDuration() public view override returns (uint256) {\n return duration().div(periods);\n }\n\n /**\n * @notice Gets the current period based on the schedule\n * @return A number that represents the current period\n */\n function currentPeriod() public view override returns (uint256) {\n return sinceStartTime().div(periodDuration()).add(MIN_PERIOD);\n }\n\n /**\n * @notice Gets the number of periods that passed since the first period\n * @return A number of periods that passed since the schedule started\n */\n function passedPeriods() public view override returns (uint256) {\n return currentPeriod().sub(MIN_PERIOD);\n }\n\n // -- Locking & Release Schedule --\n\n /**\n * @notice Gets the currently available token according to the schedule\n * @dev Implements the step-by-step schedule based on periods for available tokens\n * @return Amount of tokens available according to the schedule\n */\n function availableAmount() public view override returns (uint256) {\n uint256 current = currentTime();\n\n // Before contract start no funds are available\n if (current < startTime) {\n return 0;\n }\n\n // After contract ended all funds are available\n if (current > endTime) {\n return managedAmount;\n }\n\n // Get available amount based on period\n return passedPeriods().mul(amountPerPeriod());\n }\n\n /**\n * @notice Gets the amount of currently vested tokens\n * @dev Similar to available amount, but is fully vested when contract is non-revocable\n * @return Amount of tokens already vested\n */\n function vestedAmount() public view override returns (uint256) {\n // If non-revocable it is fully vested\n if (revocable == Revocability.Disabled) {\n return managedAmount;\n }\n\n // Vesting cliff is activated and it has not passed means nothing is vested yet\n if (vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\n return 0;\n }\n\n return availableAmount();\n }\n\n /**\n * @notice Gets tokens currently available for release\n * @dev Considers the schedule and takes into account already released tokens\n * @return Amount of tokens ready to be released\n */\n function releasableAmount() public view virtual override returns (uint256) {\n // If a release start time is set no tokens are available for release before this date\n // If not set it follows the default schedule and tokens are available on\n // the first period passed\n if (releaseStartTime > 0 && currentTime() < releaseStartTime) {\n return 0;\n }\n\n // Vesting cliff is activated and it has not passed means nothing is vested yet\n // so funds cannot be released\n if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\n return 0;\n }\n\n // A beneficiary can never have more releasable tokens than the contract balance\n uint256 releasable = availableAmount().sub(releasedAmount);\n return MathUtils.min(currentBalance(), releasable);\n }\n\n /**\n * @notice Gets the outstanding amount yet to be released based on the whole contract lifetime\n * @dev Does not consider schedule but just global amounts tracked\n * @return Amount of outstanding tokens for the lifetime of the contract\n */\n function totalOutstandingAmount() public view override returns (uint256) {\n return managedAmount.sub(releasedAmount).sub(revokedAmount);\n }\n\n /**\n * @notice Gets surplus amount in the contract based on outstanding amount to release\n * @dev All funds over outstanding amount is considered surplus that can be withdrawn by beneficiary.\n * Note this might not be the correct value for wallets transferred to L2 (i.e. an L2GraphTokenLockWallet), as the released amount will be\n * skewed, so the beneficiary might have to bridge back to L1 to release the surplus.\n * @return Amount of tokens considered as surplus\n */\n function surplusAmount() public view override returns (uint256) {\n uint256 balance = currentBalance();\n uint256 outstandingAmount = totalOutstandingAmount();\n if (balance > outstandingAmount) {\n return balance.sub(outstandingAmount);\n }\n return 0;\n }\n\n // -- Value Transfer --\n\n /**\n * @notice Releases tokens based on the configured schedule\n * @dev All available releasable tokens are transferred to beneficiary\n */\n function release() external override onlyBeneficiary {\n uint256 amountToRelease = releasableAmount();\n require(amountToRelease > 0, \"No available releasable amount\");\n\n releasedAmount = releasedAmount.add(amountToRelease);\n\n token.safeTransfer(beneficiary, amountToRelease);\n\n emit TokensReleased(beneficiary, amountToRelease);\n }\n\n /**\n * @notice Withdraws surplus, unmanaged tokens from the contract\n * @dev Tokens in the contract over outstanding amount are considered as surplus\n * @param _amount Amount of tokens to withdraw\n */\n function withdrawSurplus(uint256 _amount) external override onlyBeneficiary {\n require(_amount > 0, \"Amount cannot be zero\");\n require(surplusAmount() >= _amount, \"Amount requested > surplus available\");\n\n token.safeTransfer(beneficiary, _amount);\n\n emit TokensWithdrawn(beneficiary, _amount);\n }\n\n /**\n * @notice Revokes a vesting schedule and return the unvested tokens to the owner\n * @dev Vesting schedule is always calculated based on managed tokens\n */\n function revoke() external override onlyOwner {\n require(revocable == Revocability.Enabled, \"Contract is non-revocable\");\n require(isRevoked == false, \"Already revoked\");\n\n uint256 unvestedAmount = managedAmount.sub(vestedAmount());\n require(unvestedAmount > 0, \"No available unvested amount\");\n\n revokedAmount = unvestedAmount;\n isRevoked = true;\n\n token.safeTransfer(owner(), unvestedAmount);\n\n emit TokensRevoked(beneficiary, unvestedAmount);\n }\n}\n" + }, + "contracts/GraphTokenLockManager.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\";\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"@openzeppelin/contracts/utils/EnumerableSet.sol\";\nimport { Ownable } from \"@openzeppelin/contracts/access/Ownable.sol\";\n\nimport \"./MinimalProxyFactory.sol\";\nimport \"./IGraphTokenLockManager.sol\";\nimport { GraphTokenLockWallet } from \"./GraphTokenLockWallet.sol\";\n\n/**\n * @title GraphTokenLockManager\n * @notice This contract manages a list of authorized function calls and targets that can be called\n * by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts.\n *\n * This contract receives funds to make the process of creating TokenLockWallet contracts\n * easier by distributing them the initial tokens to be managed.\n *\n * The owner can setup a list of token destinations that will be used by TokenLock contracts to\n * approve the pulling of funds, this way in can be guaranteed that only protocol contracts\n * will manipulate users funds.\n */\ncontract GraphTokenLockManager is Ownable, MinimalProxyFactory, IGraphTokenLockManager {\n using SafeERC20 for IERC20;\n using EnumerableSet for EnumerableSet.AddressSet;\n\n // -- State --\n\n mapping(bytes4 => address) public authFnCalls;\n EnumerableSet.AddressSet private _tokenDestinations;\n\n address public masterCopy;\n IERC20 internal _token;\n\n // -- Events --\n\n event MasterCopyUpdated(address indexed masterCopy);\n event TokenLockCreated(\n address indexed contractAddress,\n bytes32 indexed initHash,\n address indexed beneficiary,\n address token,\n uint256 managedAmount,\n uint256 startTime,\n uint256 endTime,\n uint256 periods,\n uint256 releaseStartTime,\n uint256 vestingCliffTime,\n IGraphTokenLock.Revocability revocable\n );\n\n event TokensDeposited(address indexed sender, uint256 amount);\n event TokensWithdrawn(address indexed sender, uint256 amount);\n\n event FunctionCallAuth(address indexed caller, bytes4 indexed sigHash, address indexed target, string signature);\n event TokenDestinationAllowed(address indexed dst, bool allowed);\n\n /**\n * Constructor.\n * @param _graphToken Token to use for deposits and withdrawals\n * @param _masterCopy Address of the master copy to use to clone proxies\n */\n constructor(IERC20 _graphToken, address _masterCopy) {\n require(address(_graphToken) != address(0), \"Token cannot be zero\");\n _token = _graphToken;\n setMasterCopy(_masterCopy);\n }\n\n // -- Factory --\n\n /**\n * @notice Sets the masterCopy bytecode to use to create clones of TokenLock contracts\n * @param _masterCopy Address of contract bytecode to factory clone\n */\n function setMasterCopy(address _masterCopy) public override onlyOwner {\n require(_masterCopy != address(0), \"MasterCopy cannot be zero\");\n masterCopy = _masterCopy;\n emit MasterCopyUpdated(_masterCopy);\n }\n\n /**\n * @notice Creates and fund a new token lock wallet using a minimum proxy\n * @param _owner Address of the contract owner\n * @param _beneficiary Address of the beneficiary of locked tokens\n * @param _managedAmount Amount of tokens to be managed by the lock contract\n * @param _startTime Start time of the release schedule\n * @param _endTime End time of the release schedule\n * @param _periods Number of periods between start time and end time\n * @param _releaseStartTime Override time for when the releases start\n * @param _revocable Whether the contract is revocable\n */\n function createTokenLockWallet(\n address _owner,\n address _beneficiary,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n IGraphTokenLock.Revocability _revocable\n ) external override onlyOwner {\n require(_token.balanceOf(address(this)) >= _managedAmount, \"Not enough tokens to create lock\");\n\n // Create contract using a minimal proxy and call initializer\n bytes memory initializer = abi.encodeWithSelector(\n GraphTokenLockWallet.initialize.selector,\n address(this),\n _owner,\n _beneficiary,\n address(_token),\n _managedAmount,\n _startTime,\n _endTime,\n _periods,\n _releaseStartTime,\n _vestingCliffTime,\n _revocable\n );\n address contractAddress = _deployProxy2(keccak256(initializer), masterCopy, initializer);\n\n // Send managed amount to the created contract\n _token.safeTransfer(contractAddress, _managedAmount);\n\n emit TokenLockCreated(\n contractAddress,\n keccak256(initializer),\n _beneficiary,\n address(_token),\n _managedAmount,\n _startTime,\n _endTime,\n _periods,\n _releaseStartTime,\n _vestingCliffTime,\n _revocable\n );\n }\n\n // -- Funds Management --\n\n /**\n * @notice Gets the GRT token address\n * @return Token used for transfers and approvals\n */\n function token() external view override returns (IERC20) {\n return _token;\n }\n\n /**\n * @notice Deposits tokens into the contract\n * @dev Even if the ERC20 token can be transferred directly to the contract\n * this function provide a safe interface to do the transfer and avoid mistakes\n * @param _amount Amount to deposit\n */\n function deposit(uint256 _amount) external override {\n require(_amount > 0, \"Amount cannot be zero\");\n _token.safeTransferFrom(msg.sender, address(this), _amount);\n emit TokensDeposited(msg.sender, _amount);\n }\n\n /**\n * @notice Withdraws tokens from the contract\n * @dev Escape hatch in case of mistakes or to recover remaining funds\n * @param _amount Amount of tokens to withdraw\n */\n function withdraw(uint256 _amount) external override onlyOwner {\n require(_amount > 0, \"Amount cannot be zero\");\n _token.safeTransfer(msg.sender, _amount);\n emit TokensWithdrawn(msg.sender, _amount);\n }\n\n // -- Token Destinations --\n\n /**\n * @notice Adds an address that can be allowed by a token lock to pull funds\n * @param _dst Destination address\n */\n function addTokenDestination(address _dst) external override onlyOwner {\n require(_dst != address(0), \"Destination cannot be zero\");\n require(_tokenDestinations.add(_dst), \"Destination already added\");\n emit TokenDestinationAllowed(_dst, true);\n }\n\n /**\n * @notice Removes an address that can be allowed by a token lock to pull funds\n * @param _dst Destination address\n */\n function removeTokenDestination(address _dst) external override onlyOwner {\n require(_tokenDestinations.remove(_dst), \"Destination already removed\");\n emit TokenDestinationAllowed(_dst, false);\n }\n\n /**\n * @notice Returns True if the address is authorized to be a destination of tokens\n * @param _dst Destination address\n * @return True if authorized\n */\n function isTokenDestination(address _dst) external view override returns (bool) {\n return _tokenDestinations.contains(_dst);\n }\n\n /**\n * @notice Returns an array of authorized destination addresses\n * @return Array of addresses authorized to pull funds from a token lock\n */\n function getTokenDestinations() external view override returns (address[] memory) {\n address[] memory dstList = new address[](_tokenDestinations.length());\n for (uint256 i = 0; i < _tokenDestinations.length(); i++) {\n dstList[i] = _tokenDestinations.at(i);\n }\n return dstList;\n }\n\n // -- Function Call Authorization --\n\n /**\n * @notice Sets an authorized function call to target\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\n * @param _signature Function signature\n * @param _target Address of the destination contract to call\n */\n function setAuthFunctionCall(string calldata _signature, address _target) external override onlyOwner {\n _setAuthFunctionCall(_signature, _target);\n }\n\n /**\n * @notice Unsets an authorized function call to target\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\n * @param _signature Function signature\n */\n function unsetAuthFunctionCall(string calldata _signature) external override onlyOwner {\n bytes4 sigHash = _toFunctionSigHash(_signature);\n authFnCalls[sigHash] = address(0);\n\n emit FunctionCallAuth(msg.sender, sigHash, address(0), _signature);\n }\n\n /**\n * @notice Sets an authorized function call to target in bulk\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\n * @param _signatures Function signatures\n * @param _targets Address of the destination contract to call\n */\n function setAuthFunctionCallMany(\n string[] calldata _signatures,\n address[] calldata _targets\n ) external override onlyOwner {\n require(_signatures.length == _targets.length, \"Array length mismatch\");\n\n for (uint256 i = 0; i < _signatures.length; i++) {\n _setAuthFunctionCall(_signatures[i], _targets[i]);\n }\n }\n\n /**\n * @notice Sets an authorized function call to target\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\n * @dev Function signatures of Graph Protocol contracts to be used are known ahead of time\n * @param _signature Function signature\n * @param _target Address of the destination contract to call\n */\n function _setAuthFunctionCall(string calldata _signature, address _target) internal {\n require(_target != address(this), \"Target must be other contract\");\n require(Address.isContract(_target), \"Target must be a contract\");\n\n bytes4 sigHash = _toFunctionSigHash(_signature);\n authFnCalls[sigHash] = _target;\n\n emit FunctionCallAuth(msg.sender, sigHash, _target, _signature);\n }\n\n /**\n * @notice Gets the target contract to call for a particular function signature\n * @param _sigHash Function signature hash\n * @return Address of the target contract where to send the call\n */\n function getAuthFunctionCallTarget(bytes4 _sigHash) public view override returns (address) {\n return authFnCalls[_sigHash];\n }\n\n /**\n * @notice Returns true if the function call is authorized\n * @param _sigHash Function signature hash\n * @return True if authorized\n */\n function isAuthFunctionCall(bytes4 _sigHash) external view override returns (bool) {\n return getAuthFunctionCallTarget(_sigHash) != address(0);\n }\n\n /**\n * @dev Converts a function signature string to 4-bytes hash\n * @param _signature Function signature string\n * @return Function signature hash\n */\n function _toFunctionSigHash(string calldata _signature) internal pure returns (bytes4) {\n return _convertToBytes4(abi.encodeWithSignature(_signature));\n }\n\n /**\n * @dev Converts function signature bytes to function signature hash (bytes4)\n * @param _signature Function signature\n * @return Function signature in bytes4\n */\n function _convertToBytes4(bytes memory _signature) internal pure returns (bytes4) {\n require(_signature.length == 4, \"Invalid method signature\");\n bytes4 sigHash;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n sigHash := mload(add(_signature, 32))\n }\n return sigHash;\n }\n}\n" + }, + "contracts/GraphTokenLockSimple.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport \"./GraphTokenLock.sol\";\n\n/**\n * @title GraphTokenLockSimple\n * @notice This contract is the concrete simple implementation built on top of the base\n * GraphTokenLock functionality for use when we only need the token lock schedule\n * features but no interaction with the network.\n *\n * This contract is designed to be deployed without the use of a TokenManager.\n */\ncontract GraphTokenLockSimple is GraphTokenLock {\n // Constructor\n constructor() {\n OwnableInitializable._initialize(msg.sender);\n }\n\n // Initializer\n function initialize(\n address _owner,\n address _beneficiary,\n address _token,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n Revocability _revocable\n ) external onlyOwner {\n _initialize(\n _owner,\n _beneficiary,\n _token,\n _managedAmount,\n _startTime,\n _endTime,\n _periods,\n _releaseStartTime,\n _vestingCliffTime,\n _revocable\n );\n }\n}\n" + }, + "contracts/GraphTokenLockWallet.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"@openzeppelin/contracts/math/SafeMath.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\nimport \"./GraphTokenLock.sol\";\nimport \"./IGraphTokenLockManager.sol\";\n\n/**\n * @title GraphTokenLockWallet\n * @notice This contract is built on top of the base GraphTokenLock functionality.\n * It allows wallet beneficiaries to use the deposited funds to perform specific function calls\n * on specific contracts.\n *\n * The idea is that supporters with locked tokens can participate in the protocol\n * but disallow any release before the vesting/lock schedule.\n * The beneficiary can issue authorized function calls to this contract that will\n * get forwarded to a target contract. A target contract is any of our protocol contracts.\n * The function calls allowed are queried to the GraphTokenLockManager, this way\n * the same configuration can be shared for all the created lock wallet contracts.\n *\n * NOTE: Contracts used as target must have its function signatures checked to avoid collisions\n * with any of this contract functions.\n * Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience\n * the maximum amount of tokens is authorized.\n * Function calls do not forward ETH value so DO NOT SEND ETH TO THIS CONTRACT.\n */\ncontract GraphTokenLockWallet is GraphTokenLock {\n using SafeMath for uint256;\n\n // -- State --\n\n IGraphTokenLockManager public manager;\n uint256 public usedAmount;\n\n // -- Events --\n\n event ManagerUpdated(address indexed _oldManager, address indexed _newManager);\n event TokenDestinationsApproved();\n event TokenDestinationsRevoked();\n\n // Initializer\n function initialize(\n address _manager,\n address _owner,\n address _beneficiary,\n address _token,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n Revocability _revocable\n ) external {\n _initialize(\n _owner,\n _beneficiary,\n _token,\n _managedAmount,\n _startTime,\n _endTime,\n _periods,\n _releaseStartTime,\n _vestingCliffTime,\n _revocable\n );\n _setManager(_manager);\n }\n\n // -- Admin --\n\n /**\n * @notice Sets a new manager for this contract\n * @param _newManager Address of the new manager\n */\n function setManager(address _newManager) external onlyOwner {\n _setManager(_newManager);\n }\n\n /**\n * @dev Sets a new manager for this contract\n * @param _newManager Address of the new manager\n */\n function _setManager(address _newManager) internal {\n require(_newManager != address(0), \"Manager cannot be empty\");\n require(Address.isContract(_newManager), \"Manager must be a contract\");\n\n address oldManager = address(manager);\n manager = IGraphTokenLockManager(_newManager);\n\n emit ManagerUpdated(oldManager, _newManager);\n }\n\n // -- Beneficiary --\n\n /**\n * @notice Approves protocol access of the tokens managed by this contract\n * @dev Approves all token destinations registered in the manager to pull tokens\n */\n function approveProtocol() external onlyBeneficiary {\n address[] memory dstList = manager.getTokenDestinations();\n for (uint256 i = 0; i < dstList.length; i++) {\n // Note this is only safe because we are using the max uint256 value\n token.approve(dstList[i], type(uint256).max);\n }\n emit TokenDestinationsApproved();\n }\n\n /**\n * @notice Revokes protocol access of the tokens managed by this contract\n * @dev Revokes approval to all token destinations in the manager to pull tokens\n */\n function revokeProtocol() external onlyBeneficiary {\n address[] memory dstList = manager.getTokenDestinations();\n for (uint256 i = 0; i < dstList.length; i++) {\n // Note this is only safe cause we're using 0 as the amount\n token.approve(dstList[i], 0);\n }\n emit TokenDestinationsRevoked();\n }\n\n /**\n * @notice Gets tokens currently available for release\n * @dev Considers the schedule, takes into account already released tokens and used amount\n * @return Amount of tokens ready to be released\n */\n function releasableAmount() public view override returns (uint256) {\n if (revocable == Revocability.Disabled) {\n return super.releasableAmount();\n }\n\n // -- Revocability enabled logic\n // This needs to deal with additional considerations for when tokens are used in the protocol\n\n // If a release start time is set no tokens are available for release before this date\n // If not set it follows the default schedule and tokens are available on\n // the first period passed\n if (releaseStartTime > 0 && currentTime() < releaseStartTime) {\n return 0;\n }\n\n // Vesting cliff is activated and it has not passed means nothing is vested yet\n // so funds cannot be released\n if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\n return 0;\n }\n\n // A beneficiary can never have more releasable tokens than the contract balance\n // We consider the `usedAmount` in the protocol as part of the calculations\n // the beneficiary should not release funds that are used.\n uint256 releasable = availableAmount().sub(releasedAmount).sub(usedAmount);\n return MathUtils.min(currentBalance(), releasable);\n }\n\n /**\n * @notice Forward authorized contract calls to protocol contracts\n * @dev Fallback function can be called by the beneficiary only if function call is allowed\n */\n // solhint-disable-next-line no-complex-fallback\n fallback() external payable {\n // Only beneficiary can forward calls\n require(msg.sender == beneficiary, \"Unauthorized caller\");\n require(msg.value == 0, \"ETH transfers not supported\");\n\n // Function call validation\n address _target = manager.getAuthFunctionCallTarget(msg.sig);\n require(_target != address(0), \"Unauthorized function\");\n\n uint256 oldBalance = currentBalance();\n\n // Call function with data\n Address.functionCall(_target, msg.data);\n\n // Tracked used tokens in the protocol\n // We do this check after balances were updated by the forwarded call\n // Check is only enforced for revocable contracts to save some gas\n if (revocable == Revocability.Enabled) {\n // Track contract balance change\n uint256 newBalance = currentBalance();\n if (newBalance < oldBalance) {\n // Outflow\n uint256 diff = oldBalance.sub(newBalance);\n usedAmount = usedAmount.add(diff);\n } else {\n // Inflow: We can receive profits from the protocol, that could make usedAmount to\n // underflow. We set it to zero in that case.\n uint256 diff = newBalance.sub(oldBalance);\n usedAmount = (diff >= usedAmount) ? 0 : usedAmount.sub(diff);\n }\n require(usedAmount <= vestedAmount(), \"Cannot use more tokens than vested amount\");\n }\n }\n\n /**\n * @notice Receive function that always reverts.\n * @dev Only included to supress warnings, see https://github.com/ethereum/solidity/issues/10159\n */\n receive() external payable {\n revert(\"Bad call\");\n }\n}\n" + }, + "contracts/ICallhookReceiver.sol": { + "content": "// SPDX-License-Identifier: GPL-2.0-or-later\n\n// Copied from graphprotocol/contracts, changed solidity version to 0.7.3\n\n/**\n * @title Interface for contracts that can receive callhooks through the Arbitrum GRT bridge\n * @dev Any contract that can receive a callhook on L2, sent through the bridge from L1, must\n * be allowlisted by the governor, but also implement this interface that contains\n * the function that will actually be called by the L2GraphTokenGateway.\n */\npragma solidity ^0.7.3;\n\ninterface ICallhookReceiver {\n /**\n * @notice Receive tokens with a callhook from the bridge\n * @param _from Token sender in L1\n * @param _amount Amount of tokens that were transferred\n * @param _data ABI-encoded callhook data\n */\n function onTokenTransfer(address _from, uint256 _amount, bytes calldata _data) external;\n}\n" + }, + "contracts/IGraphTokenLock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\ninterface IGraphTokenLock {\n enum Revocability {\n NotSet,\n Enabled,\n Disabled\n }\n\n // -- Balances --\n\n function currentBalance() external view returns (uint256);\n\n // -- Time & Periods --\n\n function currentTime() external view returns (uint256);\n\n function duration() external view returns (uint256);\n\n function sinceStartTime() external view returns (uint256);\n\n function amountPerPeriod() external view returns (uint256);\n\n function periodDuration() external view returns (uint256);\n\n function currentPeriod() external view returns (uint256);\n\n function passedPeriods() external view returns (uint256);\n\n // -- Locking & Release Schedule --\n\n function availableAmount() external view returns (uint256);\n\n function vestedAmount() external view returns (uint256);\n\n function releasableAmount() external view returns (uint256);\n\n function totalOutstandingAmount() external view returns (uint256);\n\n function surplusAmount() external view returns (uint256);\n\n // -- Value Transfer --\n\n function release() external;\n\n function withdrawSurplus(uint256 _amount) external;\n\n function revoke() external;\n}\n" + }, + "contracts/IGraphTokenLockManager.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\nimport \"./IGraphTokenLock.sol\";\n\ninterface IGraphTokenLockManager {\n // -- Factory --\n\n function setMasterCopy(address _masterCopy) external;\n\n function createTokenLockWallet(\n address _owner,\n address _beneficiary,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n IGraphTokenLock.Revocability _revocable\n ) external;\n\n // -- Funds Management --\n\n function token() external returns (IERC20);\n\n function deposit(uint256 _amount) external;\n\n function withdraw(uint256 _amount) external;\n\n // -- Allowed Funds Destinations --\n\n function addTokenDestination(address _dst) external;\n\n function removeTokenDestination(address _dst) external;\n\n function isTokenDestination(address _dst) external view returns (bool);\n\n function getTokenDestinations() external view returns (address[] memory);\n\n // -- Function Call Authorization --\n\n function setAuthFunctionCall(string calldata _signature, address _target) external;\n\n function unsetAuthFunctionCall(string calldata _signature) external;\n\n function setAuthFunctionCallMany(string[] calldata _signatures, address[] calldata _targets) external;\n\n function getAuthFunctionCallTarget(bytes4 _sigHash) external view returns (address);\n\n function isAuthFunctionCall(bytes4 _sigHash) external view returns (bool);\n}\n" + }, + "contracts/L1GraphTokenLockTransferTool.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport { AddressUpgradeable } from \"@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol\";\nimport { ITokenGateway } from \"./arbitrum/ITokenGateway.sol\";\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport { L2GraphTokenLockManager } from \"./L2GraphTokenLockManager.sol\";\nimport { GraphTokenLockWallet } from \"./GraphTokenLockWallet.sol\";\nimport { MinimalProxyFactory } from \"./MinimalProxyFactory.sol\";\nimport { IGraphTokenLock } from \"./IGraphTokenLock.sol\";\nimport { Ownable as OwnableInitializable } from \"./Ownable.sol\";\nimport { SafeMathUpgradeable } from \"@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol\";\nimport { Initializable } from \"@openzeppelin/contracts-upgradeable/proxy/Initializable.sol\";\n\n/**\n * @title L1GraphTokenLockTransferTool contract\n * @notice This contract is used to transfer GRT from GraphTokenLockWallets\n * to a counterpart on L2. It is deployed on L1 and will send the GRT through\n * the L1GraphTokenGateway with a callhook to the L2GraphTokenLockManager, including\n * data to create a L2GraphTokenLockWallet on L2.\n *\n * Note that the L2GraphTokenLockWallet will not allow releasing any GRT until the end of\n * the vesting timeline, but will allow sending the GRT back to the L1 wallet.\n *\n * Beneficiaries for a GraphTokenLockWallet can perform the depositToL2Locked call\n * as many times as they want, and the GRT will be sent to the same L2GraphTokenLockWallet.\n *\n * Since all retryable tickets to send transactions to L2 require ETH for gas, this\n * contract also allows users to deposit ETH to be used for gas on L2, both for\n * the depositToL2Locked calls and for the transfer tools in the Staking contract for\n * The Graph.\n *\n * See GIP-0046 for more details: https://forum.thegraph.com/t/4023\n */\ncontract L1GraphTokenLockTransferTool is OwnableInitializable, Initializable, MinimalProxyFactory {\n using SafeMathUpgradeable for uint256;\n\n /// Address of the L1 GRT token contract\n IERC20 public immutable graphToken;\n /// Address of the L2GraphTokenLockWallet implementation in L2, used to compute L2 wallet addresses\n address public immutable l2Implementation;\n /// Address of the L1GraphTokenGateway contract\n ITokenGateway public immutable l1Gateway;\n /// Address of the Staking contract, used to pull ETH for L2 ticket gas\n address payable public immutable staking;\n /// L2 lock manager for each L1 lock manager.\n /// L1 GraphTokenLockManager => L2GraphTokenLockManager\n mapping(address => address) public l2LockManager;\n /// L2 wallet owner for each L1 wallet owner.\n /// L1 wallet owner => L2 wallet owner\n mapping(address => address) public l2WalletOwner;\n /// L2 wallet address for each L1 wallet address.\n /// L1 wallet => L2 wallet\n mapping(address => address) public l2WalletAddress;\n /// ETH balance from each token lock, used to pay for L2 gas:\n /// L1 wallet address => ETH balance\n mapping(address => uint256) public tokenLockETHBalances;\n /// L2 beneficiary corresponding to each L1 wallet address.\n /// L1 wallet => L2 beneficiary\n mapping(address => address) public l2Beneficiary;\n /// Indicates whether an L2 wallet address for a wallet\n /// has been set manually, in which case it can't call depositToL2Locked.\n /// L1 wallet => bool\n mapping(address => bool) public l2WalletAddressSetManually;\n\n /// @dev Emitted when the L2 lock manager for an L1 lock manager is set\n event L2LockManagerSet(address indexed l1LockManager, address indexed l2LockManager);\n /// @dev Emitted when the L2 wallet owner for an L1 wallet owner is set\n event L2WalletOwnerSet(address indexed l1WalletOwner, address indexed l2WalletOwner);\n /// @dev Emitted when GRT is sent to L2 from a token lock\n event LockedFundsSentToL2(\n address indexed l1Wallet,\n address indexed l2Wallet,\n address indexed l1LockManager,\n address l2LockManager,\n uint256 amount\n );\n /// @dev Emitted when an L2 wallet address is set for an L1 wallet\n event L2WalletAddressSet(address indexed l1Wallet, address indexed l2Wallet);\n /// @dev Emitted when ETH is deposited to a token lock's account\n event ETHDeposited(address indexed tokenLock, uint256 amount);\n /// @dev Emitted when ETH is withdrawn from a token lock's account\n event ETHWithdrawn(address indexed tokenLock, address indexed destination, uint256 amount);\n /// @dev Emitted when ETH is pulled from a token lock's account by Staking or this tool to pay for an L2 ticket\n event ETHPulled(address indexed tokenLock, uint256 amount);\n /// @dev Emitted when the L2 beneficiary for a partially vested L1 lock is set\n event L2BeneficiarySet(address indexed l1Wallet, address indexed l2Beneficiary);\n\n /**\n * @notice Construct a new L1GraphTokenLockTransferTool contract\n * @dev The deployer of the contract will become its owner.\n * Note this contract is meant to be deployed behind a transparent proxy,\n * so this will run at the implementation's storage context; it will set\n * immutable variables and make the implementation be owned by the deployer.\n * @param _graphToken Address of the L1 GRT token contract\n * @param _l2Implementation Address of the L2GraphTokenLockWallet implementation in L2\n * @param _l1Gateway Address of the L1GraphTokenGateway contract\n * @param _staking Address of the Staking contract\n */\n constructor(\n IERC20 _graphToken,\n address _l2Implementation,\n ITokenGateway _l1Gateway,\n address payable _staking\n ) initializer {\n OwnableInitializable._initialize(msg.sender);\n graphToken = _graphToken;\n l2Implementation = _l2Implementation;\n l1Gateway = _l1Gateway;\n staking = _staking;\n }\n\n /**\n * @notice Initialize the L1GraphTokenLockTransferTool contract\n * @dev This function will run in the proxy's storage context, so it will\n * set the owner of the proxy contract which can be different from the implementation owner.\n * @param _owner Address of the owner of the L1GraphTokenLockTransferTool contract\n */\n function initialize(address _owner) external initializer {\n OwnableInitializable._initialize(_owner);\n }\n\n /**\n * @notice Set the L2 lock manager that corresponds to an L1 lock manager\n * @param _l1LockManager Address of the L1 lock manager\n * @param _l2LockManager Address of the L2 lock manager (in L2)\n */\n function setL2LockManager(address _l1LockManager, address _l2LockManager) external onlyOwner {\n l2LockManager[_l1LockManager] = _l2LockManager;\n emit L2LockManagerSet(_l1LockManager, _l2LockManager);\n }\n\n /**\n * @notice Set the L2 wallet owner that corresponds to an L1 wallet owner\n * @param _l1WalletOwner Address of the L1 wallet owner\n * @param _l2WalletOwner Address of the L2 wallet owner (in L2)\n */\n function setL2WalletOwner(address _l1WalletOwner, address _l2WalletOwner) external onlyOwner {\n l2WalletOwner[_l1WalletOwner] = _l2WalletOwner;\n emit L2WalletOwnerSet(_l1WalletOwner, _l2WalletOwner);\n }\n\n /**\n * @notice Deposit ETH on a token lock's account, to be used for L2 retryable ticket gas.\n * This function can be called by anyone, but the ETH will be credited to the token lock.\n * DO NOT try to call this through the token lock, as locks do not forward ETH value (and the\n * function call should not be allowlisted).\n * @param _tokenLock Address of the L1 GraphTokenLockWallet that will own the ETH\n */\n function depositETH(address _tokenLock) external payable {\n tokenLockETHBalances[_tokenLock] = tokenLockETHBalances[_tokenLock].add(msg.value);\n emit ETHDeposited(_tokenLock, msg.value);\n }\n\n /**\n * @notice Withdraw ETH from a token lock's account.\n * This function must be called from the token lock contract, but the destination\n * _must_ be a different address, as any ETH sent to the token lock would otherwise be\n * lost.\n * @param _destination Address to send the ETH\n * @param _amount Amount of ETH to send\n */\n function withdrawETH(address _destination, uint256 _amount) external {\n require(_amount > 0, \"INVALID_AMOUNT\");\n // We can't send eth to a token lock or it will be stuck\n require(msg.sender != _destination, \"INVALID_DESTINATION\");\n require(tokenLockETHBalances[msg.sender] >= _amount, \"INSUFFICIENT_BALANCE\");\n tokenLockETHBalances[msg.sender] -= _amount;\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, ) = payable(_destination).call{ value: _amount }(\"\");\n require(success, \"TRANSFER_FAILED\");\n emit ETHWithdrawn(msg.sender, _destination, _amount);\n }\n\n /**\n * @notice Pull ETH from a token lock's account, to be used for L2 retryable ticket gas.\n * This can only be called by the Staking contract.\n * @param _tokenLock GraphTokenLockWallet that owns the ETH that will be debited\n * @param _amount Amount of ETH to pull\n */\n function pullETH(address _tokenLock, uint256 _amount) external {\n require(msg.sender == staking, \"ONLY_STAKING\");\n require(tokenLockETHBalances[_tokenLock] >= _amount, \"INSUFFICIENT_BALANCE\");\n tokenLockETHBalances[_tokenLock] -= _amount;\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, ) = staking.call{ value: _amount }(\"\");\n require(success, \"TRANSFER_FAILED\");\n emit ETHPulled(_tokenLock, _amount);\n }\n\n /**\n * @notice Deposit GRT to L2, from a token lock in L1 to a token lock in L2.\n * If the token lock in L2 does not exist, it will be created when the message is received\n * by the L2GraphTokenLockManager.\n * Before calling this (which must be done through the token lock wallet), make sure\n * there is enough ETH in the token lock's account to cover the L2 retryable ticket gas.\n * Note that L2 submission fee and gas refunds will be lost.\n * You can add ETH to the token lock's account by calling depositETH().\n * Note that after calling this, you will NOT be able to use setL2WalletAddressManually() to\n * set an L2 wallet address, as the L2 wallet address will be set automatically when the\n * message is received by the L2GraphTokenLockManager.\n * @dev The gas parameters for L2 can be estimated using the Arbitrum SDK.\n * @param _amount Amount of GRT to deposit\n * @param _l2Beneficiary Address of the beneficiary for the token lock in L2. Must be the same for subsequent calls of this function, and not an L1 contract.\n * @param _maxGas Maximum gas to use for the L2 retryable ticket\n * @param _gasPriceBid Gas price to use for the L2 retryable ticket\n * @param _maxSubmissionCost Max submission cost for the L2 retryable ticket\n */\n function depositToL2Locked(\n uint256 _amount,\n address _l2Beneficiary,\n uint256 _maxGas,\n uint256 _gasPriceBid,\n uint256 _maxSubmissionCost\n ) external {\n // Check that msg.sender is a GraphTokenLockWallet\n // That uses GRT and has a corresponding manager set in L2.\n GraphTokenLockWallet wallet = GraphTokenLockWallet(msg.sender);\n require(wallet.token() == graphToken, \"INVALID_TOKEN\");\n address l1Manager = address(wallet.manager());\n address l2Manager = l2LockManager[l1Manager];\n require(l2Manager != address(0), \"INVALID_MANAGER\");\n require(wallet.isInitialized(), \"!INITIALIZED\");\n require(wallet.revocable() != IGraphTokenLock.Revocability.Enabled, \"REVOCABLE\");\n require(_amount <= graphToken.balanceOf(msg.sender), \"INSUFFICIENT_BALANCE\");\n require(_amount != 0, \"ZERO_AMOUNT\");\n\n if (l2Beneficiary[msg.sender] == address(0)) {\n require(_l2Beneficiary != address(0), \"INVALID_BENEFICIARY_ZERO\");\n require(!AddressUpgradeable.isContract(_l2Beneficiary), \"INVALID_BENEFICIARY_CONTRACT\");\n l2Beneficiary[msg.sender] = _l2Beneficiary;\n emit L2BeneficiarySet(msg.sender, _l2Beneficiary);\n } else {\n require(l2Beneficiary[msg.sender] == _l2Beneficiary, \"INVALID_BENEFICIARY\");\n }\n\n uint256 expectedEth = _maxSubmissionCost.add(_maxGas.mul(_gasPriceBid));\n require(tokenLockETHBalances[msg.sender] >= expectedEth, \"INSUFFICIENT_ETH_BALANCE\");\n tokenLockETHBalances[msg.sender] -= expectedEth;\n\n bytes memory encodedData;\n {\n address l2Owner = l2WalletOwner[wallet.owner()];\n require(l2Owner != address(0), \"L2_OWNER_NOT_SET\");\n // Extract all the storage variables from the GraphTokenLockWallet\n L2GraphTokenLockManager.TransferredWalletData memory data = L2GraphTokenLockManager.TransferredWalletData({\n l1Address: msg.sender,\n owner: l2Owner,\n beneficiary: l2Beneficiary[msg.sender],\n managedAmount: wallet.managedAmount(),\n startTime: wallet.startTime(),\n endTime: wallet.endTime()\n });\n encodedData = abi.encode(data);\n }\n\n if (l2WalletAddress[msg.sender] == address(0)) {\n require(wallet.endTime() >= block.timestamp, \"FULLY_VESTED_USE_MANUAL_ADDRESS\");\n address newAddress = getDeploymentAddress(keccak256(encodedData), l2Implementation, l2Manager);\n l2WalletAddress[msg.sender] = newAddress;\n emit L2WalletAddressSet(msg.sender, newAddress);\n } else {\n require(!l2WalletAddressSetManually[msg.sender], \"CANT_DEPOSIT_TO_MANUAL_ADDRESS\");\n }\n\n graphToken.transferFrom(msg.sender, address(this), _amount);\n\n // Send the tokens with a message through the L1GraphTokenGateway to the L2GraphTokenLockManager\n graphToken.approve(address(l1Gateway), _amount);\n {\n bytes memory transferData = abi.encode(_maxSubmissionCost, encodedData);\n l1Gateway.outboundTransfer{ value: expectedEth }(\n address(graphToken),\n l2Manager,\n _amount,\n _maxGas,\n _gasPriceBid,\n transferData\n );\n }\n emit ETHPulled(msg.sender, expectedEth);\n emit LockedFundsSentToL2(msg.sender, l2WalletAddress[msg.sender], l1Manager, l2Manager, _amount);\n }\n\n /**\n * @notice Manually set the L2 wallet address for a token lock in L1.\n * This will only work for token locks that have not been initialized in L2 yet, and\n * that are fully vested (endTime < current timestamp).\n * This address can then be used to send stake or delegation to L2 on the Staking contract.\n * After calling this, the vesting lock will NOT be allowed to use depositToL2Locked\n * to send GRT to L2, the beneficiary must withdraw the tokens and bridge them manually.\n * @param _l2Wallet Address of the L2 wallet\n */\n function setL2WalletAddressManually(address _l2Wallet) external {\n // Check that msg.sender is a GraphTokenLockWallet\n // That uses GRT and has a corresponding manager set in L2.\n GraphTokenLockWallet wallet = GraphTokenLockWallet(msg.sender);\n require(wallet.token() == graphToken, \"INVALID_TOKEN\");\n address l1Manager = address(wallet.manager());\n address l2Manager = l2LockManager[l1Manager];\n require(l2Manager != address(0), \"INVALID_MANAGER\");\n require(wallet.isInitialized(), \"!INITIALIZED\");\n\n // Check that the wallet is fully vested\n require(wallet.endTime() < block.timestamp, \"NOT_FULLY_VESTED\");\n\n // Check that the wallet has not set an L2 wallet yet\n require(l2WalletAddress[msg.sender] == address(0), \"L2_WALLET_ALREADY_SET\");\n\n // Check that the L2 address is not zero\n require(_l2Wallet != address(0), \"ZERO_ADDRESS\");\n // Set the L2 wallet address\n l2WalletAddress[msg.sender] = _l2Wallet;\n l2WalletAddressSetManually[msg.sender] = true;\n emit L2WalletAddressSet(msg.sender, _l2Wallet);\n }\n}\n" + }, + "contracts/L2GraphTokenLockManager.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport { SafeERC20 } from \"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\";\n\nimport { ICallhookReceiver } from \"./ICallhookReceiver.sol\";\nimport { GraphTokenLockManager } from \"./GraphTokenLockManager.sol\";\nimport { L2GraphTokenLockWallet } from \"./L2GraphTokenLockWallet.sol\";\n\n/**\n * @title L2GraphTokenLockManager\n * @notice This contract manages a list of authorized function calls and targets that can be called\n * by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts.\n *\n * This contract receives funds to make the process of creating TokenLockWallet contracts\n * easier by distributing them the initial tokens to be managed.\n *\n * In particular, this L2 variant is designed to receive token lock wallets from L1,\n * through the GRT bridge. These transferred wallets will not allow releasing funds in L2 until\n * the end of the vesting timeline, but they can allow withdrawing funds back to L1 using\n * the L2GraphTokenLockTransferTool contract.\n *\n * The owner can setup a list of token destinations that will be used by TokenLock contracts to\n * approve the pulling of funds, this way in can be guaranteed that only protocol contracts\n * will manipulate users funds.\n */\ncontract L2GraphTokenLockManager is GraphTokenLockManager, ICallhookReceiver {\n using SafeERC20 for IERC20;\n\n /// @dev Struct to hold the data of a transferred wallet; this is\n /// the data that must be encoded in L1 to send a wallet to L2.\n struct TransferredWalletData {\n address l1Address;\n address owner;\n address beneficiary;\n uint256 managedAmount;\n uint256 startTime;\n uint256 endTime;\n }\n\n /// Address of the L2GraphTokenGateway\n address public immutable l2Gateway;\n /// Address of the L1 transfer tool contract (in L1, no aliasing)\n address public immutable l1TransferTool;\n /// Mapping of each L1 wallet to its L2 wallet counterpart (populated when each wallet is received)\n /// L1 address => L2 address\n mapping(address => address) public l1WalletToL2Wallet;\n /// Mapping of each L2 wallet to its L1 wallet counterpart (populated when each wallet is received)\n /// L2 address => L1 address\n mapping(address => address) public l2WalletToL1Wallet;\n\n /// @dev Event emitted when a wallet is received and created from L1\n event TokenLockCreatedFromL1(\n address indexed contractAddress,\n bytes32 initHash,\n address indexed beneficiary,\n uint256 managedAmount,\n uint256 startTime,\n uint256 endTime,\n address indexed l1Address\n );\n\n /// @dev Emitted when locked tokens are received from L1 (whether the wallet\n /// had already been received or not)\n event LockedTokensReceivedFromL1(address indexed l1Address, address indexed l2Address, uint256 amount);\n\n /**\n * @dev Checks that the sender is the L2GraphTokenGateway.\n */\n modifier onlyL2Gateway() {\n require(msg.sender == l2Gateway, \"ONLY_GATEWAY\");\n _;\n }\n\n /**\n * @notice Constructor for the L2GraphTokenLockManager contract.\n * @param _graphToken Address of the L2 GRT token contract\n * @param _masterCopy Address of the master copy of the L2GraphTokenLockWallet implementation\n * @param _l2Gateway Address of the L2GraphTokenGateway contract\n * @param _l1TransferTool Address of the L1 transfer tool contract (in L1, without aliasing)\n */\n constructor(\n IERC20 _graphToken,\n address _masterCopy,\n address _l2Gateway,\n address _l1TransferTool\n ) GraphTokenLockManager(_graphToken, _masterCopy) {\n l2Gateway = _l2Gateway;\n l1TransferTool = _l1TransferTool;\n }\n\n /**\n * @notice This function is called by the L2GraphTokenGateway when tokens are sent from L1.\n * @dev This function will create a new wallet if it doesn't exist yet, or send the tokens to\n * the existing wallet if it does.\n * @param _from Address of the sender in L1, which must be the L1GraphTokenLockTransferTool\n * @param _amount Amount of tokens received\n * @param _data Encoded data of the transferred wallet, which must be an ABI-encoded TransferredWalletData struct\n */\n function onTokenTransfer(address _from, uint256 _amount, bytes calldata _data) external override onlyL2Gateway {\n require(_from == l1TransferTool, \"ONLY_TRANSFER_TOOL\");\n TransferredWalletData memory walletData = abi.decode(_data, (TransferredWalletData));\n\n if (l1WalletToL2Wallet[walletData.l1Address] != address(0)) {\n // If the wallet was already received, just send the tokens to the L2 address\n _token.safeTransfer(l1WalletToL2Wallet[walletData.l1Address], _amount);\n } else {\n // Create contract using a minimal proxy and call initializer\n (bytes32 initHash, address contractAddress) = _deployFromL1(keccak256(_data), walletData);\n l1WalletToL2Wallet[walletData.l1Address] = contractAddress;\n l2WalletToL1Wallet[contractAddress] = walletData.l1Address;\n\n // Send managed amount to the created contract\n _token.safeTransfer(contractAddress, _amount);\n\n emit TokenLockCreatedFromL1(\n contractAddress,\n initHash,\n walletData.beneficiary,\n walletData.managedAmount,\n walletData.startTime,\n walletData.endTime,\n walletData.l1Address\n );\n }\n emit LockedTokensReceivedFromL1(walletData.l1Address, l1WalletToL2Wallet[walletData.l1Address], _amount);\n }\n\n /**\n * @dev Deploy a token lock wallet with data received from L1\n * @param _salt Salt for the CREATE2 call, which must be the hash of the wallet data\n * @param _walletData Data of the wallet to be created\n * @return Hash of the initialization calldata\n * @return Address of the created contract\n */\n function _deployFromL1(bytes32 _salt, TransferredWalletData memory _walletData) internal returns (bytes32, address) {\n bytes memory initializer = _encodeInitializer(_walletData);\n address contractAddress = _deployProxy2(_salt, masterCopy, initializer);\n return (keccak256(initializer), contractAddress);\n }\n\n /**\n * @dev Encode the initializer for the token lock wallet received from L1\n * @param _walletData Data of the wallet to be created\n * @return Encoded initializer calldata, including the function signature\n */\n function _encodeInitializer(TransferredWalletData memory _walletData) internal view returns (bytes memory) {\n return\n abi.encodeWithSelector(\n L2GraphTokenLockWallet.initializeFromL1.selector,\n address(this),\n address(_token),\n _walletData\n );\n }\n}\n" + }, + "contracts/L2GraphTokenLockTransferTool.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\nimport { L2GraphTokenLockManager } from \"./L2GraphTokenLockManager.sol\";\nimport { L2GraphTokenLockWallet } from \"./L2GraphTokenLockWallet.sol\";\nimport { ITokenGateway } from \"./arbitrum/ITokenGateway.sol\";\n\n/**\n * @title L2GraphTokenLockTransferTool contract\n * @notice This contract is used to transfer GRT from L2 token lock wallets\n * back to their L1 counterparts.\n */\ncontract L2GraphTokenLockTransferTool {\n /// Address of the L2 GRT token\n IERC20 public immutable graphToken;\n /// Address of the L2GraphTokenGateway\n ITokenGateway public immutable l2Gateway;\n /// Address of the L1 GRT token (in L1, no aliasing)\n address public immutable l1GraphToken;\n\n /// @dev Emitted when GRT is sent to L1 from a token lock\n event LockedFundsSentToL1(\n address indexed l1Wallet,\n address indexed l2Wallet,\n address indexed l2LockManager,\n uint256 amount\n );\n\n /**\n * @notice Constructor for the L2GraphTokenLockTransferTool contract\n * @dev Note the L2GraphTokenLockTransferTool can be deployed behind a proxy,\n * and the constructor for the implementation will only set some immutable\n * variables.\n * @param _graphToken Address of the L2 GRT token\n * @param _l2Gateway Address of the L2GraphTokenGateway\n * @param _l1GraphToken Address of the L1 GRT token (in L1, no aliasing)\n */\n constructor(IERC20 _graphToken, ITokenGateway _l2Gateway, address _l1GraphToken) {\n graphToken = _graphToken;\n l2Gateway = _l2Gateway;\n l1GraphToken = _l1GraphToken;\n }\n\n /**\n * @notice Withdraw GRT from an L2 token lock wallet to its L1 counterpart.\n * This function must be called from an L2GraphTokenLockWallet contract.\n * The GRT will be sent to L1 and must be claimed using the Arbitrum Outbox on L1\n * after the standard Arbitrum withdrawal period (7 days).\n * @param _amount Amount of GRT to withdraw\n */\n function withdrawToL1Locked(uint256 _amount) external {\n L2GraphTokenLockWallet wallet = L2GraphTokenLockWallet(msg.sender);\n L2GraphTokenLockManager manager = L2GraphTokenLockManager(address(wallet.manager()));\n require(address(manager) != address(0), \"INVALID_SENDER\");\n address l1Wallet = manager.l2WalletToL1Wallet(msg.sender);\n require(l1Wallet != address(0), \"NOT_L1_WALLET\");\n require(_amount <= graphToken.balanceOf(msg.sender), \"INSUFFICIENT_BALANCE\");\n require(_amount != 0, \"ZERO_AMOUNT\");\n\n graphToken.transferFrom(msg.sender, address(this), _amount);\n graphToken.approve(address(l2Gateway), _amount);\n\n // Send the tokens through the L2GraphTokenGateway to the L1 wallet counterpart\n l2Gateway.outboundTransfer(l1GraphToken, l1Wallet, _amount, 0, 0, \"\");\n emit LockedFundsSentToL1(l1Wallet, msg.sender, address(manager), _amount);\n }\n}\n" + }, + "contracts/L2GraphTokenLockWallet.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\nimport { GraphTokenLockWallet } from \"./GraphTokenLockWallet.sol\";\nimport { Ownable as OwnableInitializable } from \"./Ownable.sol\";\nimport { L2GraphTokenLockManager } from \"./L2GraphTokenLockManager.sol\";\n\n/**\n * @title L2GraphTokenLockWallet\n * @notice This contract is built on top of the base GraphTokenLock functionality.\n * It allows wallet beneficiaries to use the deposited funds to perform specific function calls\n * on specific contracts.\n *\n * The idea is that supporters with locked tokens can participate in the protocol\n * but disallow any release before the vesting/lock schedule.\n * The beneficiary can issue authorized function calls to this contract that will\n * get forwarded to a target contract. A target contract is any of our protocol contracts.\n * The function calls allowed are queried to the GraphTokenLockManager, this way\n * the same configuration can be shared for all the created lock wallet contracts.\n *\n * This L2 variant includes a special initializer so that it can be created from\n * a wallet's data received from L1. These transferred wallets will not allow releasing\n * funds in L2 until the end of the vesting timeline, but they can allow withdrawing\n * funds back to L1 using the L2GraphTokenLockTransferTool contract.\n *\n * Note that surplusAmount and releasedAmount in L2 will be skewed for wallets received from L1,\n * so releasing surplus tokens might also only be possible by bridging tokens back to L1.\n *\n * NOTE: Contracts used as target must have its function signatures checked to avoid collisions\n * with any of this contract functions.\n * Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience\n * the maximum amount of tokens is authorized.\n * Function calls do not forward ETH value so DO NOT SEND ETH TO THIS CONTRACT.\n */\ncontract L2GraphTokenLockWallet is GraphTokenLockWallet {\n // Initializer when created from a message from L1\n function initializeFromL1(\n address _manager,\n address _token,\n L2GraphTokenLockManager.TransferredWalletData calldata _walletData\n ) external {\n require(!isInitialized, \"Already initialized\");\n isInitialized = true;\n\n OwnableInitializable._initialize(_walletData.owner);\n beneficiary = _walletData.beneficiary;\n token = IERC20(_token);\n\n managedAmount = _walletData.managedAmount;\n\n startTime = _walletData.startTime;\n endTime = _walletData.endTime;\n periods = 1;\n isAccepted = true;\n\n // Optionals\n releaseStartTime = _walletData.endTime;\n revocable = Revocability.Disabled;\n\n _setManager(_manager);\n }\n}\n" + }, + "contracts/MathUtils.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nlibrary MathUtils {\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n}\n" + }, + "contracts/MinimalProxyFactory.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport { Address } from \"@openzeppelin/contracts/utils/Address.sol\";\nimport { Create2 } from \"@openzeppelin/contracts/utils/Create2.sol\";\n\n/**\n * @title MinimalProxyFactory: a factory contract for creating minimal proxies\n * @notice Adapted from https://github.com/OpenZeppelin/openzeppelin-sdk/blob/v2.5.0/packages/lib/contracts/upgradeability/ProxyFactory.sol\n * Based on https://eips.ethereum.org/EIPS/eip-1167\n */\ncontract MinimalProxyFactory {\n /// @dev Emitted when a new proxy is created\n event ProxyCreated(address indexed proxy);\n\n /**\n * @notice Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation\n * @param _salt Bytes32 salt to use for CREATE2\n * @param _implementation Address of the proxy target implementation\n * @param _deployer Address of the deployer that creates the contract\n * @return Address of the counterfactual MinimalProxy\n */\n function getDeploymentAddress(\n bytes32 _salt,\n address _implementation,\n address _deployer\n ) public pure returns (address) {\n return Create2.computeAddress(_salt, keccak256(_getContractCreationCode(_implementation)), _deployer);\n }\n\n /**\n * @dev Deploys a MinimalProxy with CREATE2\n * @param _salt Bytes32 salt to use for CREATE2\n * @param _implementation Address of the proxy target implementation\n * @param _data Bytes with the initializer call\n * @return Address of the deployed MinimalProxy\n */\n function _deployProxy2(bytes32 _salt, address _implementation, bytes memory _data) internal returns (address) {\n address proxyAddress = Create2.deploy(0, _salt, _getContractCreationCode(_implementation));\n\n emit ProxyCreated(proxyAddress);\n\n // Call function with data\n if (_data.length > 0) {\n Address.functionCall(proxyAddress, _data);\n }\n\n return proxyAddress;\n }\n\n /**\n * @dev Gets the MinimalProxy bytecode\n * @param _implementation Address of the proxy target implementation\n * @return MinimalProxy bytecode\n */\n function _getContractCreationCode(address _implementation) internal pure returns (bytes memory) {\n bytes10 creation = 0x3d602d80600a3d3981f3;\n bytes10 prefix = 0x363d3d373d3d3d363d73;\n bytes20 targetBytes = bytes20(_implementation);\n bytes15 suffix = 0x5af43d82803e903d91602b57fd5bf3;\n return abi.encodePacked(creation, prefix, targetBytes, suffix);\n }\n}\n" + }, + "contracts/Ownable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * The owner account will be passed on initialization of the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\ncontract Ownable {\n /// @dev Owner of the contract, can be retrieved with the public owner() function\n address private _owner;\n /// @dev Since upgradeable contracts might inherit this, we add a storage gap\n /// to allow adding variables here without breaking the proxy storage layout\n uint256[50] private __gap;\n\n /// @dev Emitted when ownership of the contract is transferred\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n function _initialize(address owner) internal {\n _owner = owner;\n emit OwnershipTransferred(address(0), owner);\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(_owner == msg.sender, \"Ownable: caller is not the owner\");\n _;\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() external virtual onlyOwner {\n emit OwnershipTransferred(_owner, address(0));\n _owner = address(0);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) external virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n emit OwnershipTransferred(_owner, newOwner);\n _owner = newOwner;\n }\n}\n" + }, + "contracts/tests/arbitrum/AddressAliasHelper.sol": { + "content": "// SPDX-License-Identifier: Apache-2.0\n\n/*\n * Copyright 2019-2021, Offchain Labs, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * Originally copied from:\n * https://github.com/OffchainLabs/arbitrum/tree/84e64dee6ee82adbf8ec34fd4b86c207a61d9007/packages/arb-bridge-eth\n *\n * MODIFIED from Offchain Labs' implementation:\n * - Changed solidity version to 0.7.3 (pablo@edgeandnode.com)\n *\n */\n\npragma solidity ^0.7.3;\n\nlibrary AddressAliasHelper {\n uint160 constant offset = uint160(0x1111000000000000000000000000000000001111);\n\n /// @notice Utility function that converts the address in the L1 that submitted a tx to\n /// the inbox to the msg.sender viewed in the L2\n /// @param l1Address the address in the L1 that triggered the tx to L2\n /// @return l2Address L2 address as viewed in msg.sender\n function applyL1ToL2Alias(address l1Address) internal pure returns (address l2Address) {\n l2Address = address(uint160(l1Address) + offset);\n }\n\n /// @notice Utility function that converts the msg.sender viewed in the L2 to the\n /// address in the L1 that submitted a tx to the inbox\n /// @param l2Address L2 address as viewed in msg.sender\n /// @return l1Address the address in the L1 that triggered the tx to L2\n function undoL1ToL2Alias(address l2Address) internal pure returns (address l1Address) {\n l1Address = address(uint160(l2Address) - offset);\n }\n}\n" + }, + "contracts/tests/arbitrum/IBridge.sol": { + "content": "// SPDX-License-Identifier: Apache-2.0\n\n/*\n * Copyright 2021, Offchain Labs, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * Originally copied from:\n * https://github.com/OffchainLabs/arbitrum/tree/e3a6307ad8a2dc2cad35728a2a9908cfd8dd8ef9/packages/arb-bridge-eth\n *\n * MODIFIED from Offchain Labs' implementation:\n * - Changed solidity version to 0.7.3 (pablo@edgeandnode.com)\n *\n */\n\npragma solidity ^0.7.3;\n\ninterface IBridge {\n event MessageDelivered(\n uint256 indexed messageIndex,\n bytes32 indexed beforeInboxAcc,\n address inbox,\n uint8 kind,\n address sender,\n bytes32 messageDataHash\n );\n\n event BridgeCallTriggered(address indexed outbox, address indexed destAddr, uint256 amount, bytes data);\n\n event InboxToggle(address indexed inbox, bool enabled);\n\n event OutboxToggle(address indexed outbox, bool enabled);\n\n function deliverMessageToInbox(\n uint8 kind,\n address sender,\n bytes32 messageDataHash\n ) external payable returns (uint256);\n\n function executeCall(\n address destAddr,\n uint256 amount,\n bytes calldata data\n ) external returns (bool success, bytes memory returnData);\n\n // These are only callable by the admin\n function setInbox(address inbox, bool enabled) external;\n\n function setOutbox(address inbox, bool enabled) external;\n\n // View functions\n\n function activeOutbox() external view returns (address);\n\n function allowedInboxes(address inbox) external view returns (bool);\n\n function allowedOutboxes(address outbox) external view returns (bool);\n\n function inboxAccs(uint256 index) external view returns (bytes32);\n\n function messageCount() external view returns (uint256);\n}\n" + }, + "contracts/tests/arbitrum/IInbox.sol": { + "content": "// SPDX-License-Identifier: Apache-2.0\n\n/*\n * Copyright 2021, Offchain Labs, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * Originally copied from:\n * https://github.com/OffchainLabs/arbitrum/tree/e3a6307ad8a2dc2cad35728a2a9908cfd8dd8ef9/packages/arb-bridge-eth\n *\n * MODIFIED from Offchain Labs' implementation:\n * - Changed solidity version to 0.7.3 (pablo@edgeandnode.com)\n *\n */\n\npragma solidity ^0.7.3;\n\nimport \"./IBridge.sol\";\nimport \"./IMessageProvider.sol\";\n\ninterface IInbox is IMessageProvider {\n function sendL2Message(bytes calldata messageData) external returns (uint256);\n\n function sendUnsignedTransaction(\n uint256 maxGas,\n uint256 gasPriceBid,\n uint256 nonce,\n address destAddr,\n uint256 amount,\n bytes calldata data\n ) external returns (uint256);\n\n function sendContractTransaction(\n uint256 maxGas,\n uint256 gasPriceBid,\n address destAddr,\n uint256 amount,\n bytes calldata data\n ) external returns (uint256);\n\n function sendL1FundedUnsignedTransaction(\n uint256 maxGas,\n uint256 gasPriceBid,\n uint256 nonce,\n address destAddr,\n bytes calldata data\n ) external payable returns (uint256);\n\n function sendL1FundedContractTransaction(\n uint256 maxGas,\n uint256 gasPriceBid,\n address destAddr,\n bytes calldata data\n ) external payable returns (uint256);\n\n function createRetryableTicket(\n address destAddr,\n uint256 arbTxCallValue,\n uint256 maxSubmissionCost,\n address submissionRefundAddress,\n address valueRefundAddress,\n uint256 maxGas,\n uint256 gasPriceBid,\n bytes calldata data\n ) external payable returns (uint256);\n\n function depositEth(uint256 maxSubmissionCost) external payable returns (uint256);\n\n function bridge() external view returns (IBridge);\n\n function pauseCreateRetryables() external;\n\n function unpauseCreateRetryables() external;\n\n function startRewriteAddress() external;\n\n function stopRewriteAddress() external;\n}\n" + }, + "contracts/tests/arbitrum/IMessageProvider.sol": { + "content": "// SPDX-License-Identifier: Apache-2.0\n\n/*\n * Copyright 2021, Offchain Labs, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * Originally copied from:\n * https://github.com/OffchainLabs/arbitrum/tree/e3a6307ad8a2dc2cad35728a2a9908cfd8dd8ef9/packages/arb-bridge-eth\n *\n * MODIFIED from Offchain Labs' implementation:\n * - Changed solidity version to 0.7.3 (pablo@edgeandnode.com)\n *\n */\n\npragma solidity ^0.7.3;\n\ninterface IMessageProvider {\n event InboxMessageDelivered(uint256 indexed messageNum, bytes data);\n\n event InboxMessageDeliveredFromOrigin(uint256 indexed messageNum);\n}\n" + }, + "contracts/tests/BridgeMock.sol": { + "content": "// SPDX-License-Identifier: GPL-2.0-or-later\n\npragma solidity ^0.7.3;\n\nimport \"./arbitrum/IBridge.sol\";\n\n/**\n * @title Arbitrum Bridge mock contract\n * @dev This contract implements Arbitrum's IBridge interface for testing purposes\n */\ncontract BridgeMock is IBridge {\n /// Address of the (mock) Arbitrum Inbox\n address public inbox;\n /// Address of the (mock) Arbitrum Outbox\n address public outbox;\n /// Index of the next message on the inbox messages array\n uint256 public messageIndex;\n /// Inbox messages array\n bytes32[] public override inboxAccs;\n\n /**\n * @notice Deliver a message to the inbox. The encoded message will be\n * added to the inbox array, and messageIndex will be incremented.\n * @param _kind Type of the message\n * @param _sender Address that is sending the message\n * @param _messageDataHash keccak256 hash of the message data\n * @return The next index for the inbox array\n */\n function deliverMessageToInbox(\n uint8 _kind,\n address _sender,\n bytes32 _messageDataHash\n ) external payable override returns (uint256) {\n messageIndex = messageIndex + 1;\n inboxAccs.push(keccak256(abi.encodePacked(inbox, _kind, _sender, _messageDataHash)));\n emit MessageDelivered(messageIndex, inboxAccs[messageIndex - 1], msg.sender, _kind, _sender, _messageDataHash);\n return messageIndex;\n }\n\n /**\n * @notice Executes an L1 function call incoing from L2. This can only be called\n * by the Outbox.\n * @param _destAddr Contract to call\n * @param _amount ETH value to send\n * @param _data Calldata for the function call\n * @return True if the call was successful, false otherwise\n * @return Return data from the call\n */\n function executeCall(\n address _destAddr,\n uint256 _amount,\n bytes calldata _data\n ) external override returns (bool, bytes memory) {\n require(outbox == msg.sender, \"NOT_FROM_OUTBOX\");\n bool success;\n bytes memory returnData;\n\n // solhint-disable-next-line avoid-low-level-calls\n (success, returnData) = _destAddr.call{ value: _amount }(_data);\n emit BridgeCallTriggered(msg.sender, _destAddr, _amount, _data);\n return (success, returnData);\n }\n\n /**\n * @notice Set the address of the inbox. Anyone can call this, because it's a mock.\n * @param _inbox Address of the inbox\n * @param _enabled Enable the inbox (ignored)\n */\n function setInbox(address _inbox, bool _enabled) external override {\n inbox = _inbox;\n emit InboxToggle(inbox, _enabled);\n }\n\n /**\n * @notice Set the address of the outbox. Anyone can call this, because it's a mock.\n * @param _outbox Address of the outbox\n * @param _enabled Enable the outbox (ignored)\n */\n function setOutbox(address _outbox, bool _enabled) external override {\n outbox = _outbox;\n emit OutboxToggle(outbox, _enabled);\n }\n\n // View functions\n\n /**\n * @notice Getter for the active outbox (in this case there's only one)\n */\n function activeOutbox() external view override returns (address) {\n return outbox;\n }\n\n /**\n * @notice Getter for whether an address is an allowed inbox (in this case there's only one)\n * @param _inbox Address to check\n * @return True if the address is the allowed inbox, false otherwise\n */\n function allowedInboxes(address _inbox) external view override returns (bool) {\n return _inbox == inbox;\n }\n\n /**\n * @notice Getter for whether an address is an allowed outbox (in this case there's only one)\n * @param _outbox Address to check\n * @return True if the address is the allowed outbox, false otherwise\n */\n function allowedOutboxes(address _outbox) external view override returns (bool) {\n return _outbox == outbox;\n }\n\n /**\n * @notice Getter for the count of messages in the inboxAccs\n * @return Number of messages in inboxAccs\n */\n function messageCount() external view override returns (uint256) {\n return inboxAccs.length;\n }\n}\n" + }, + "contracts/tests/GraphTokenMock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\n\n/**\n * @title Graph Token Mock contract.\n * @dev Used for testing purposes, DO NOT USE IN PRODUCTION\n */\ncontract GraphTokenMock is Ownable, ERC20 {\n /**\n * @notice Contract Constructor.\n * @param _initialSupply Initial supply\n * @param _mintTo Address to whitch to mint the initial supply\n */\n constructor(uint256 _initialSupply, address _mintTo) ERC20(\"Graph Token Mock\", \"GRT-Mock\") {\n // Deploy to mint address\n _mint(_mintTo, _initialSupply);\n }\n\n /**\n * @notice Mint tokens to an address from the bridge.\n * (The real one has an onlyGateway modifier)\n * @param _to Address to mint tokens to\n * @param _amount Amount of tokens to mint\n */\n function bridgeMint(address _to, uint256 _amount) external {\n _mint(_to, _amount);\n }\n\n /**\n * @notice Burn tokens from an address from the bridge.\n * (The real one has an onlyGateway modifier)\n * @param _from Address to burn tokens from\n * @param _amount Amount of tokens to burn\n */\n function bridgeBurn(address _from, uint256 _amount) external {\n _burn(_from, _amount);\n }\n}\n" + }, + "contracts/tests/InboxMock.sol": { + "content": "// SPDX-License-Identifier: GPL-2.0-or-later\n\npragma solidity ^0.7.3;\n\nimport \"./arbitrum/IInbox.sol\";\nimport \"./arbitrum/AddressAliasHelper.sol\";\n\n/**\n * @title Arbitrum Inbox mock contract\n * @dev This contract implements (a subset of) Arbitrum's IInbox interface for testing purposes\n */\ncontract InboxMock is IInbox {\n /// @dev Type indicator for a standard L2 message\n uint8 internal constant L2_MSG = 3;\n /// @dev Type indicator for a retryable ticket message\n // solhint-disable-next-line const-name-snakecase\n uint8 internal constant L1MessageType_submitRetryableTx = 9;\n /// Address of the Bridge (mock) contract\n IBridge public override bridge;\n\n /**\n * @notice Send a message to L2 (by delivering it to the Bridge)\n * @param _messageData Encoded data to send in the message\n * @return Message number returned by the inbox\n */\n function sendL2Message(bytes calldata _messageData) external override returns (uint256) {\n uint256 msgNum = deliverToBridge(L2_MSG, msg.sender, keccak256(_messageData));\n emit InboxMessageDelivered(msgNum, _messageData);\n return msgNum;\n }\n\n /**\n * @notice Set the address of the (mock) bridge\n * @param _bridge Address of the bridge\n */\n function setBridge(address _bridge) external {\n bridge = IBridge(_bridge);\n }\n\n /**\n * @notice Unimplemented in this mock\n */\n function sendUnsignedTransaction(\n uint256,\n uint256,\n uint256,\n address,\n uint256,\n bytes calldata\n ) external pure override returns (uint256) {\n revert(\"Unimplemented\");\n }\n\n /**\n * @notice Unimplemented in this mock\n */\n function sendContractTransaction(\n uint256,\n uint256,\n address,\n uint256,\n bytes calldata\n ) external pure override returns (uint256) {\n revert(\"Unimplemented\");\n }\n\n /**\n * @notice Unimplemented in this mock\n */\n function sendL1FundedUnsignedTransaction(\n uint256,\n uint256,\n uint256,\n address,\n bytes calldata\n ) external payable override returns (uint256) {\n revert(\"Unimplemented\");\n }\n\n /**\n * @notice Unimplemented in this mock\n */\n function sendL1FundedContractTransaction(\n uint256,\n uint256,\n address,\n bytes calldata\n ) external payable override returns (uint256) {\n revert(\"Unimplemented\");\n }\n\n /**\n * @notice Creates a retryable ticket for an L2 transaction\n * @param _destAddr Address of the contract to call in L2\n * @param _arbTxCallValue Callvalue to use in the L2 transaction\n * @param _maxSubmissionCost Max cost of submitting the ticket, in Wei\n * @param _submissionRefundAddress L2 address to refund for any remaining value from the submission cost\n * @param _valueRefundAddress L2 address to refund if the ticket times out or gets cancelled\n * @param _maxGas Max gas for the L2 transcation\n * @param _gasPriceBid Gas price bid on L2\n * @param _data Encoded calldata for the L2 transaction (including function selector)\n * @return Message number returned by the bridge\n */\n function createRetryableTicket(\n address _destAddr,\n uint256 _arbTxCallValue,\n uint256 _maxSubmissionCost,\n address _submissionRefundAddress,\n address _valueRefundAddress,\n uint256 _maxGas,\n uint256 _gasPriceBid,\n bytes calldata _data\n ) external payable override returns (uint256) {\n _submissionRefundAddress = AddressAliasHelper.applyL1ToL2Alias(_submissionRefundAddress);\n _valueRefundAddress = AddressAliasHelper.applyL1ToL2Alias(_valueRefundAddress);\n return\n _deliverMessage(\n L1MessageType_submitRetryableTx,\n msg.sender,\n abi.encodePacked(\n uint256(uint160(bytes20(_destAddr))),\n _arbTxCallValue,\n msg.value,\n _maxSubmissionCost,\n uint256(uint160(bytes20(_submissionRefundAddress))),\n uint256(uint160(bytes20(_valueRefundAddress))),\n _maxGas,\n _gasPriceBid,\n _data.length,\n _data\n )\n );\n }\n\n /**\n * @notice Unimplemented in this mock\n */\n function depositEth(uint256) external payable override returns (uint256) {\n revert(\"Unimplemented\");\n }\n\n /**\n * @notice Unimplemented in this mock\n */\n function pauseCreateRetryables() external pure override {\n revert(\"Unimplemented\");\n }\n\n /**\n * @notice Unimplemented in this mock\n */\n function unpauseCreateRetryables() external pure override {\n revert(\"Unimplemented\");\n }\n\n /**\n * @notice Unimplemented in this mock\n */\n function startRewriteAddress() external pure override {\n revert(\"Unimplemented\");\n }\n\n /**\n * @notice Unimplemented in this mock\n */\n function stopRewriteAddress() external pure override {\n revert(\"Unimplemented\");\n }\n\n /**\n * @dev Deliver a message to the bridge\n * @param _kind Type of the message\n * @param _sender Address that is sending the message\n * @param _messageData Encoded message data\n * @return Message number returned by the bridge\n */\n function _deliverMessage(uint8 _kind, address _sender, bytes memory _messageData) internal returns (uint256) {\n uint256 msgNum = deliverToBridge(_kind, _sender, keccak256(_messageData));\n emit InboxMessageDelivered(msgNum, _messageData);\n return msgNum;\n }\n\n /**\n * @dev Deliver a message to the bridge\n * @param _kind Type of the message\n * @param _sender Address that is sending the message\n * @param _messageDataHash keccak256 hash of the encoded message data\n * @return Message number returned by the bridge\n */\n function deliverToBridge(uint8 _kind, address _sender, bytes32 _messageDataHash) internal returns (uint256) {\n return bridge.deliverMessageToInbox{ value: msg.value }(_kind, _sender, _messageDataHash);\n }\n}\n" + }, + "contracts/tests/L1TokenGatewayMock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport { Ownable } from \"@openzeppelin/contracts/access/Ownable.sol\";\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport { SafeMath } from \"@openzeppelin/contracts/math/SafeMath.sol\";\nimport { ITokenGateway } from \"../arbitrum//ITokenGateway.sol\";\n\n/**\n * @title L1 Token Gateway mock contract\n * @dev Used for testing purposes, DO NOT USE IN PRODUCTION\n */\ncontract L1TokenGatewayMock is Ownable {\n using SafeMath for uint256;\n /// Next sequence number to return when outboundTransfer is called\n uint256 public nextSeqNum;\n\n /// @dev Emitted when a (fake) retryable ticket is created\n event FakeTxToL2(\n address from,\n uint256 value,\n uint256 maxGas,\n uint256 gasPriceBid,\n uint256 maxSubmissionCost,\n bytes outboundCalldata\n );\n\n /// @dev Emitted when an outbound transfer is initiated, i.e. tokens are deposited from L1 to L2\n event DepositInitiated(\n address l1Token,\n address indexed from,\n address indexed to,\n uint256 indexed sequenceNumber,\n uint256 amount\n );\n\n /**\n * @notice L1 Token Gateway Contract Constructor.\n */\n constructor() {}\n\n /**\n * @notice Creates and sends a fake retryable ticket to transfer GRT to L2.\n * This mock will actually just emit an event with parameters equivalent to what the real L1GraphTokenGateway\n * would send to L2.\n * @param _l1Token L1 Address of the GRT contract (needed for compatibility with Arbitrum Gateway Router)\n * @param _to Recipient address on L2\n * @param _amount Amount of tokens to tranfer\n * @param _maxGas Gas limit for L2 execution of the ticket\n * @param _gasPriceBid Price per gas on L2\n * @param _data Encoded maxSubmissionCost and sender address along with additional calldata\n * @return Sequence number of the retryable ticket created by Inbox (always )\n */\n function outboundTransfer(\n address _l1Token,\n address _to,\n uint256 _amount,\n uint256 _maxGas,\n uint256 _gasPriceBid,\n bytes calldata _data\n ) external payable returns (bytes memory) {\n require(_amount > 0, \"INVALID_ZERO_AMOUNT\");\n require(_to != address(0), \"INVALID_DESTINATION\");\n\n // nested scopes to avoid stack too deep errors\n address from;\n uint256 seqNum = nextSeqNum;\n nextSeqNum += 1;\n {\n uint256 maxSubmissionCost;\n bytes memory outboundCalldata;\n {\n bytes memory extraData;\n (from, maxSubmissionCost, extraData) = _parseOutboundData(_data);\n require(maxSubmissionCost > 0, \"NO_SUBMISSION_COST\");\n\n {\n // makes sure only sufficient ETH is supplied as required for successful redemption on L2\n // if a user does not desire immediate redemption they should provide\n // a msg.value of AT LEAST maxSubmissionCost\n uint256 expectedEth = maxSubmissionCost.add(_maxGas.mul(_gasPriceBid));\n require(msg.value >= expectedEth, \"WRONG_ETH_VALUE\");\n }\n outboundCalldata = getOutboundCalldata(_l1Token, from, _to, _amount, extraData);\n }\n {\n // transfer tokens to escrow\n IERC20(_l1Token).transferFrom(from, address(this), _amount);\n\n emit FakeTxToL2(from, msg.value, _maxGas, _gasPriceBid, maxSubmissionCost, outboundCalldata);\n }\n }\n emit DepositInitiated(_l1Token, from, _to, seqNum, _amount);\n\n return abi.encode(seqNum);\n }\n\n /**\n * @notice (Mock) Receives withdrawn tokens from L2\n * Actually does nothing, just keeping it here as its useful to define the expected\n * calldata for the outgoing transfer in tests.\n * @param _l1Token L1 Address of the GRT contract (needed for compatibility with Arbitrum Gateway Router)\n * @param _from Address of the sender\n * @param _to Recepient address on L1\n * @param _amount Amount of tokens transferred\n * @param _data Additional calldata\n */\n function finalizeInboundTransfer(\n address _l1Token,\n address _from,\n address _to,\n uint256 _amount,\n bytes calldata _data\n ) external payable {}\n\n /**\n * @notice Creates calldata required to create a retryable ticket\n * @dev encodes the target function with its params which\n * will be called on L2 when the retryable ticket is redeemed\n * @param _l1Token Address of the Graph token contract on L1\n * @param _from Address on L1 from which we're transferring tokens\n * @param _to Address on L2 to which we're transferring tokens\n * @param _amount Amount of GRT to transfer\n * @param _data Additional call data for the L2 transaction, which must be empty unless the caller is whitelisted\n * @return Encoded calldata (including function selector) for the L2 transaction\n */\n function getOutboundCalldata(\n address _l1Token,\n address _from,\n address _to,\n uint256 _amount,\n bytes memory _data\n ) public pure returns (bytes memory) {\n bytes memory emptyBytes;\n\n return\n abi.encodeWithSelector(\n ITokenGateway.finalizeInboundTransfer.selector,\n _l1Token,\n _from,\n _to,\n _amount,\n abi.encode(emptyBytes, _data)\n );\n }\n\n /**\n * @notice Decodes calldata required for transfer of tokens to L2\n * @dev Data must include maxSubmissionCost, extraData can be left empty. When the router\n * sends an outbound message, data also contains the from address, but this mock\n * doesn't consider this case\n * @param _data Encoded callhook data containing maxSubmissionCost and extraData\n * @return Sender of the tx\n * @return Max ether value used to submit the retryable ticket\n * @return Additional data sent to L2\n */\n function _parseOutboundData(bytes memory _data) private view returns (address, uint256, bytes memory) {\n address from;\n uint256 maxSubmissionCost;\n bytes memory extraData;\n from = msg.sender;\n // User-encoded data contains the max retryable ticket submission cost\n // and additional L2 calldata\n (maxSubmissionCost, extraData) = abi.decode(_data, (uint256, bytes));\n return (from, maxSubmissionCost, extraData);\n }\n}\n" + }, + "contracts/tests/L2TokenGatewayMock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport { Ownable } from \"@openzeppelin/contracts/access/Ownable.sol\";\nimport { ITokenGateway } from \"../arbitrum//ITokenGateway.sol\";\nimport { GraphTokenMock } from \"./GraphTokenMock.sol\";\nimport { ICallhookReceiver } from \"../ICallhookReceiver.sol\";\n\n/**\n * @title L2 Token Gateway mock contract\n * @dev Used for testing purposes, DO NOT USE IN PRODUCTION\n */\ncontract L2TokenGatewayMock is Ownable {\n /// Address of the L1 GRT contract\n address public immutable l1Token;\n /// Address of the L2 GRT contract\n address public immutable l2Token;\n /// Next ID to return when sending an outboundTransfer\n uint256 public nextId;\n\n /// @dev Emitted when a (fake) transaction to L1 is created\n event FakeTxToL1(address from, bytes outboundCalldata);\n /// @dev Emitted when a (fake) retryable ticket is received from L1\n event DepositFinalized(address token, address indexed from, address indexed to, uint256 amount);\n\n /// @dev Emitted when an outbound transfer is initiated, i.e. tokens are withdrawn to L1 from L2\n event WithdrawalInitiated(\n address l1Token,\n address indexed from,\n address indexed to,\n uint256 indexed sequenceNumber,\n uint256 amount\n );\n\n /**\n * @notice L2 Token Gateway Contract Constructor.\n * @param _l1Token Address of the L1 GRT contract\n * @param _l2Token Address of the L2 GRT contract\n */\n constructor(address _l1Token, address _l2Token) {\n l1Token = _l1Token;\n l2Token = _l2Token;\n }\n\n /**\n * @notice Creates and sends a (fake) transfer of GRT to L1.\n * This mock will actually just emit an event with parameters equivalent to what the real L2GraphTokenGateway\n * would send to L1.\n * @param _l1Token L1 Address of the GRT contract (needed for compatibility with Arbitrum Gateway Router)\n * @param _to Recipient address on L2\n * @param _amount Amount of tokens to tranfer\n * @param _data Encoded maxSubmissionCost and sender address along with additional calldata\n * @return ID of the L2-L1 message (incrementing on every call)\n */\n function outboundTransfer(\n address _l1Token,\n address _to,\n uint256 _amount,\n uint256,\n uint256,\n bytes calldata _data\n ) external payable returns (bytes memory) {\n require(_l1Token == l1Token, \"INVALID_L1_TOKEN\");\n require(_amount > 0, \"INVALID_ZERO_AMOUNT\");\n require(_to != address(0), \"INVALID_DESTINATION\");\n\n // nested scopes to avoid stack too deep errors\n address from;\n uint256 id = nextId;\n nextId += 1;\n {\n bytes memory outboundCalldata;\n {\n bytes memory extraData;\n (from, extraData) = _parseOutboundData(_data);\n\n require(msg.value == 0, \"!value\");\n require(extraData.length == 0, \"!extraData\");\n outboundCalldata = getOutboundCalldata(_l1Token, from, _to, _amount, extraData);\n }\n {\n // burn tokens from the sender, they will be released from escrow in L1\n GraphTokenMock(l2Token).bridgeBurn(from, _amount);\n\n emit FakeTxToL1(from, outboundCalldata);\n }\n }\n emit WithdrawalInitiated(_l1Token, from, _to, id, _amount);\n\n return abi.encode(id);\n }\n\n /**\n * @notice (Mock) Receives withdrawn tokens from L1\n * Implements calling callhooks if data is non-empty.\n * @param _l1Token L1 Address of the GRT contract (needed for compatibility with Arbitrum Gateway Router)\n * @param _from Address of the sender\n * @param _to Recipient address on L1\n * @param _amount Amount of tokens transferred\n * @param _data Additional calldata, will trigger an onTokenTransfer call if non-empty\n */\n function finalizeInboundTransfer(\n address _l1Token,\n address _from,\n address _to,\n uint256 _amount,\n bytes calldata _data\n ) external payable {\n require(_l1Token == l1Token, \"TOKEN_NOT_GRT\");\n require(msg.value == 0, \"INVALID_NONZERO_VALUE\");\n\n GraphTokenMock(l2Token).bridgeMint(_to, _amount);\n\n if (_data.length > 0) {\n ICallhookReceiver(_to).onTokenTransfer(_from, _amount, _data);\n }\n\n emit DepositFinalized(_l1Token, _from, _to, _amount);\n }\n\n /**\n * @notice Calculate the L2 address of a bridged token\n * @dev In our case, this would only work for GRT.\n * @param l1ERC20 address of L1 GRT contract\n * @return L2 address of the bridged GRT token\n */\n function calculateL2TokenAddress(address l1ERC20) public view returns (address) {\n if (l1ERC20 != l1Token) {\n return address(0);\n }\n return l2Token;\n }\n\n /**\n * @notice Creates calldata required to create a tx to L1\n * @param _l1Token Address of the Graph token contract on L1\n * @param _from Address on L2 from which we're transferring tokens\n * @param _to Address on L1 to which we're transferring tokens\n * @param _amount Amount of GRT to transfer\n * @param _data Additional call data for the L1 transaction, which must be empty\n * @return Encoded calldata (including function selector) for the L1 transaction\n */\n function getOutboundCalldata(\n address _l1Token,\n address _from,\n address _to,\n uint256 _amount,\n bytes memory _data\n ) public pure returns (bytes memory) {\n return\n abi.encodeWithSelector(\n ITokenGateway.finalizeInboundTransfer.selector,\n _l1Token,\n _from,\n _to,\n _amount,\n abi.encode(0, _data)\n );\n }\n\n /**\n * @dev Decodes calldata required for transfer of tokens to L1.\n * extraData can be left empty\n * @param _data Encoded callhook data\n * @return Sender of the tx\n * @return Any other data sent to L1\n */\n function _parseOutboundData(bytes calldata _data) private view returns (address, bytes memory) {\n address from;\n bytes memory extraData;\n // The mock doesn't take messages from the Router\n from = msg.sender;\n extraData = _data;\n return (from, extraData);\n }\n}\n" + }, + "contracts/tests/Stakes.sol": { + "content": "// SPDX-License-Identifier: GPL-2.0-or-later\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/math/SafeMath.sol\";\n\n/**\n * @title A collection of data structures and functions to manage the Indexer Stake state.\n * Used for low-level state changes, require() conditions should be evaluated\n * at the caller function scope.\n */\nlibrary Stakes {\n using SafeMath for uint256;\n using Stakes for Stakes.Indexer;\n\n struct Indexer {\n uint256 tokensStaked; // Tokens on the indexer stake (staked by the indexer)\n uint256 tokensAllocated; // Tokens used in allocations\n uint256 tokensLocked; // Tokens locked for withdrawal subject to thawing period\n uint256 tokensLockedUntil; // Block when locked tokens can be withdrawn\n }\n\n /**\n * @dev Deposit tokens to the indexer stake.\n * @param stake Stake data\n * @param _tokens Amount of tokens to deposit\n */\n function deposit(Stakes.Indexer storage stake, uint256 _tokens) internal {\n stake.tokensStaked = stake.tokensStaked.add(_tokens);\n }\n\n /**\n * @dev Release tokens from the indexer stake.\n * @param stake Stake data\n * @param _tokens Amount of tokens to release\n */\n function release(Stakes.Indexer storage stake, uint256 _tokens) internal {\n stake.tokensStaked = stake.tokensStaked.sub(_tokens);\n }\n\n /**\n * @dev Allocate tokens from the main stack to a SubgraphDeployment.\n * @param stake Stake data\n * @param _tokens Amount of tokens to allocate\n */\n function allocate(Stakes.Indexer storage stake, uint256 _tokens) internal {\n stake.tokensAllocated = stake.tokensAllocated.add(_tokens);\n }\n\n /**\n * @dev Unallocate tokens from a SubgraphDeployment back to the main stack.\n * @param stake Stake data\n * @param _tokens Amount of tokens to unallocate\n */\n function unallocate(Stakes.Indexer storage stake, uint256 _tokens) internal {\n stake.tokensAllocated = stake.tokensAllocated.sub(_tokens);\n }\n\n /**\n * @dev Lock tokens until a thawing period pass.\n * @param stake Stake data\n * @param _tokens Amount of tokens to unstake\n * @param _period Period in blocks that need to pass before withdrawal\n */\n function lockTokens(Stakes.Indexer storage stake, uint256 _tokens, uint256 _period) internal {\n // Take into account period averaging for multiple unstake requests\n uint256 lockingPeriod = _period;\n if (stake.tokensLocked > 0) {\n lockingPeriod = stake.getLockingPeriod(_tokens, _period);\n }\n\n // Update balances\n stake.tokensLocked = stake.tokensLocked.add(_tokens);\n stake.tokensLockedUntil = block.number.add(lockingPeriod);\n }\n\n /**\n * @dev Unlock tokens.\n * @param stake Stake data\n * @param _tokens Amount of tokens to unkock\n */\n function unlockTokens(Stakes.Indexer storage stake, uint256 _tokens) internal {\n stake.tokensLocked = stake.tokensLocked.sub(_tokens);\n if (stake.tokensLocked == 0) {\n stake.tokensLockedUntil = 0;\n }\n }\n\n /**\n * @dev Take all tokens out from the locked stake for withdrawal.\n * @param stake Stake data\n * @return Amount of tokens being withdrawn\n */\n function withdrawTokens(Stakes.Indexer storage stake) internal returns (uint256) {\n // Calculate tokens that can be released\n uint256 tokensToWithdraw = stake.tokensWithdrawable();\n\n if (tokensToWithdraw > 0) {\n // Reset locked tokens\n stake.unlockTokens(tokensToWithdraw);\n\n // Decrease indexer stake\n stake.release(tokensToWithdraw);\n }\n\n return tokensToWithdraw;\n }\n\n /**\n * @dev Get the locking period of the tokens to unstake.\n * If already unstaked before calculate the weighted average.\n * @param stake Stake data\n * @param _tokens Amount of tokens to unstake\n * @param _thawingPeriod Period in blocks that need to pass before withdrawal\n * @return True if staked\n */\n function getLockingPeriod(\n Stakes.Indexer memory stake,\n uint256 _tokens,\n uint256 _thawingPeriod\n ) internal view returns (uint256) {\n uint256 blockNum = block.number;\n uint256 periodA = (stake.tokensLockedUntil > blockNum) ? stake.tokensLockedUntil.sub(blockNum) : 0;\n uint256 periodB = _thawingPeriod;\n uint256 stakeA = stake.tokensLocked;\n uint256 stakeB = _tokens;\n return periodA.mul(stakeA).add(periodB.mul(stakeB)).div(stakeA.add(stakeB));\n }\n\n /**\n * @dev Return true if there are tokens staked by the Indexer.\n * @param stake Stake data\n * @return True if staked\n */\n function hasTokens(Stakes.Indexer memory stake) internal pure returns (bool) {\n return stake.tokensStaked > 0;\n }\n\n /**\n * @dev Return the amount of tokens used in allocations and locked for withdrawal.\n * @param stake Stake data\n * @return Token amount\n */\n function tokensUsed(Stakes.Indexer memory stake) internal pure returns (uint256) {\n return stake.tokensAllocated.add(stake.tokensLocked);\n }\n\n /**\n * @dev Return the amount of tokens staked not considering the ones that are already going\n * through the thawing period or are ready for withdrawal. We call it secure stake because\n * it is not subject to change by a withdraw call from the indexer.\n * @param stake Stake data\n * @return Token amount\n */\n function tokensSecureStake(Stakes.Indexer memory stake) internal pure returns (uint256) {\n return stake.tokensStaked.sub(stake.tokensLocked);\n }\n\n /**\n * @dev Tokens free balance on the indexer stake that can be used for any purpose.\n * Any token that is allocated cannot be used as well as tokens that are going through the\n * thawing period or are withdrawable\n * Calc: tokensStaked - tokensAllocated - tokensLocked\n * @param stake Stake data\n * @return Token amount\n */\n function tokensAvailable(Stakes.Indexer memory stake) internal pure returns (uint256) {\n return stake.tokensAvailableWithDelegation(0);\n }\n\n /**\n * @dev Tokens free balance on the indexer stake that can be used for allocations.\n * This function accepts a parameter for extra delegated capacity that takes into\n * account delegated tokens\n * @param stake Stake data\n * @param _delegatedCapacity Amount of tokens used from delegators to calculate availability\n * @return Token amount\n */\n function tokensAvailableWithDelegation(\n Stakes.Indexer memory stake,\n uint256 _delegatedCapacity\n ) internal pure returns (uint256) {\n uint256 tokensCapacity = stake.tokensStaked.add(_delegatedCapacity);\n uint256 _tokensUsed = stake.tokensUsed();\n // If more tokens are used than the current capacity, the indexer is overallocated.\n // This means the indexer doesn't have available capacity to create new allocations.\n // We can reach this state when the indexer has funds allocated and then any\n // of these conditions happen:\n // - The delegationCapacity ratio is reduced.\n // - The indexer stake is slashed.\n // - A delegator removes enough stake.\n if (_tokensUsed > tokensCapacity) {\n // Indexer stake is over allocated: return 0 to avoid stake to be used until\n // the overallocation is restored by staking more tokens, unallocating tokens\n // or using more delegated funds\n return 0;\n }\n return tokensCapacity.sub(_tokensUsed);\n }\n\n /**\n * @dev Tokens available for withdrawal after thawing period.\n * @param stake Stake data\n * @return Token amount\n */\n function tokensWithdrawable(Stakes.Indexer memory stake) internal view returns (uint256) {\n // No tokens to withdraw before locking period\n if (stake.tokensLockedUntil == 0 || block.number < stake.tokensLockedUntil) {\n return 0;\n }\n return stake.tokensLocked;\n }\n}\n" + }, + "contracts/tests/StakingMock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\nimport \"./Stakes.sol\";\n\ncontract StakingMock {\n using SafeMath for uint256;\n using Stakes for Stakes.Indexer;\n\n // -- State --\n\n uint256 public minimumIndexerStake = 100e18;\n uint256 public thawingPeriod = 10; // 10 blocks\n IERC20 public token;\n\n // Indexer stakes : indexer => Stake\n mapping(address => Stakes.Indexer) public stakes;\n\n /**\n * @dev Emitted when `indexer` stake `tokens` amount.\n */\n event StakeDeposited(address indexed indexer, uint256 tokens);\n\n /**\n * @dev Emitted when `indexer` unstaked and locked `tokens` amount `until` block.\n */\n event StakeLocked(address indexed indexer, uint256 tokens, uint256 until);\n\n /**\n * @dev Emitted when `indexer` withdrew `tokens` staked.\n */\n event StakeWithdrawn(address indexed indexer, uint256 tokens);\n\n // Contract constructor.\n constructor(IERC20 _token) {\n require(address(_token) != address(0), \"!token\");\n token = _token;\n }\n\n receive() external payable {}\n\n /**\n * @dev Deposit tokens on the indexer stake.\n * @param _tokens Amount of tokens to stake\n */\n function stake(uint256 _tokens) external {\n stakeTo(msg.sender, _tokens);\n }\n\n /**\n * @dev Deposit tokens on the indexer stake.\n * @param _indexer Address of the indexer\n * @param _tokens Amount of tokens to stake\n */\n function stakeTo(address _indexer, uint256 _tokens) public {\n require(_tokens > 0, \"!tokens\");\n\n // Ensure minimum stake\n require(stakes[_indexer].tokensSecureStake().add(_tokens) >= minimumIndexerStake, \"!minimumIndexerStake\");\n\n // Transfer tokens to stake from caller to this contract\n require(token.transferFrom(msg.sender, address(this), _tokens), \"!transfer\");\n\n // Stake the transferred tokens\n _stake(_indexer, _tokens);\n }\n\n /**\n * @dev Unstake tokens from the indexer stake, lock them until thawing period expires.\n * @param _tokens Amount of tokens to unstake\n */\n function unstake(uint256 _tokens) external {\n address indexer = msg.sender;\n Stakes.Indexer storage indexerStake = stakes[indexer];\n\n require(_tokens > 0, \"!tokens\");\n require(indexerStake.hasTokens(), \"!stake\");\n require(indexerStake.tokensAvailable() >= _tokens, \"!stake-avail\");\n\n // Ensure minimum stake\n uint256 newStake = indexerStake.tokensSecureStake().sub(_tokens);\n require(newStake == 0 || newStake >= minimumIndexerStake, \"!minimumIndexerStake\");\n\n // Before locking more tokens, withdraw any unlocked ones\n uint256 tokensToWithdraw = indexerStake.tokensWithdrawable();\n if (tokensToWithdraw > 0) {\n _withdraw(indexer);\n }\n\n indexerStake.lockTokens(_tokens, thawingPeriod);\n\n emit StakeLocked(indexer, indexerStake.tokensLocked, indexerStake.tokensLockedUntil);\n }\n\n /**\n * @dev Withdraw indexer tokens once the thawing period has passed.\n */\n function withdraw() external {\n _withdraw(msg.sender);\n }\n\n function _stake(address _indexer, uint256 _tokens) internal {\n // Deposit tokens into the indexer stake\n Stakes.Indexer storage indexerStake = stakes[_indexer];\n indexerStake.deposit(_tokens);\n\n emit StakeDeposited(_indexer, _tokens);\n }\n\n /**\n * @dev Withdraw indexer tokens once the thawing period has passed.\n * @param _indexer Address of indexer to withdraw funds from\n */\n function _withdraw(address _indexer) private {\n // Get tokens available for withdraw and update balance\n uint256 tokensToWithdraw = stakes[_indexer].withdrawTokens();\n require(tokensToWithdraw > 0, \"!tokens\");\n\n // Return tokens to the indexer\n require(token.transfer(_indexer, tokensToWithdraw), \"!transfer\");\n\n emit StakeWithdrawn(_indexer, tokensToWithdraw);\n }\n}\n" + }, + "contracts/tests/WalletMock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport { Address } from \"@openzeppelin/contracts/utils/Address.sol\";\n\n/**\n * @title WalletMock: a mock wallet contract for testing purposes\n * @dev For testing only, DO NOT USE IN PRODUCTION.\n * This is used to test L1-L2 transfer tools and to create scenarios\n * where an invalid wallet calls the transfer tool, e.g. a wallet that has an invalid\n * manager, or a wallet that has not been initialized.\n */\ncontract WalletMock {\n /// Target contract for the fallback function (usually a transfer tool contract)\n address public immutable target;\n /// Address of the GRT (mock) token\n address public immutable token;\n /// Address of the wallet's manager\n address public immutable manager;\n /// Whether the wallet has been initialized\n bool public immutable isInitialized;\n /// Whether the beneficiary has accepted the lock\n bool public immutable isAccepted;\n\n /**\n * @notice WalletMock constructor\n * @dev This constructor sets all the state variables so that\n * specific test scenarios can be created just by deploying this contract.\n * @param _target Target contract for the fallback function\n * @param _token Address of the GRT (mock) token\n * @param _manager Address of the wallet's manager\n * @param _isInitialized Whether the wallet has been initialized\n * @param _isAccepted Whether the beneficiary has accepted the lock\n */\n constructor(address _target, address _token, address _manager, bool _isInitialized, bool _isAccepted) {\n target = _target;\n token = _token;\n manager = _manager;\n isInitialized = _isInitialized;\n isAccepted = _isAccepted;\n }\n\n /**\n * @notice Fallback function\n * @dev This function calls the target contract with the data sent to this contract.\n * This is used to test the L1-L2 transfer tool.\n */\n fallback() external payable {\n // Call function with data\n Address.functionCall(target, msg.data);\n }\n\n /**\n * @notice Receive function\n * @dev This function is added to avoid compiler warnings, but just reverts.\n */\n receive() external payable {\n revert(\"Invalid call\");\n }\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": false, + "runs": 200 + }, + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file diff --git a/packages/token-distribution/deployments/mainnet/.chainId b/packages/token-distribution/deployments/mainnet/.chainId new file mode 100644 index 000000000..56a6051ca --- /dev/null +++ b/packages/token-distribution/deployments/mainnet/.chainId @@ -0,0 +1 @@ +1 \ No newline at end of file diff --git a/packages/token-distribution/deployments/mainnet/GraphTokenLockManager-Foundation.json b/packages/token-distribution/deployments/mainnet/GraphTokenLockManager-Foundation.json new file mode 100644 index 000000000..3f7e0e43a --- /dev/null +++ b/packages/token-distribution/deployments/mainnet/GraphTokenLockManager-Foundation.json @@ -0,0 +1,926 @@ +{ + "address": "0x455466E99033D1D33D6fA6EcA40F182e0A551847", + "abi": [ + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_graphToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_masterCopy", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes4", + "name": "sigHash", + "type": "bytes4" + }, + { + "indexed": true, + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "indexed": false, + "internalType": "string", + "name": "signature", + "type": "string" + } + ], + "name": "FunctionCallAuth", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "masterCopy", + "type": "address" + } + ], + "name": "MasterCopyUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "proxy", + "type": "address" + } + ], + "name": "ProxyCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "dst", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "TokenDestinationAllowed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "contractAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "initHash", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "managedAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "startTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "endTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "periods", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "releaseStartTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "vestingCliffTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "enum IGraphTokenLock.Revocability", + "name": "revocable", + "type": "uint8" + } + ], + "name": "TokenLockCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensDeposited", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensWithdrawn", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_dst", + "type": "address" + } + ], + "name": "addTokenDestination", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "", + "type": "bytes4" + } + ], + "name": "authFnCalls", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_owner", + "type": "address" + }, + { + "internalType": "address", + "name": "_beneficiary", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_managedAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_startTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_endTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_periods", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_releaseStartTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_vestingCliffTime", + "type": "uint256" + }, + { + "internalType": "enum IGraphTokenLock.Revocability", + "name": "_revocable", + "type": "uint8" + } + ], + "name": "createTokenLockWallet", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "deposit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_sigHash", + "type": "bytes4" + } + ], + "name": "getAuthFunctionCallTarget", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_salt", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "_implementation", + "type": "address" + } + ], + "name": "getDeploymentAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getTokenDestinations", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_sigHash", + "type": "bytes4" + } + ], + "name": "isAuthFunctionCall", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_dst", + "type": "address" + } + ], + "name": "isTokenDestination", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "masterCopy", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_dst", + "type": "address" + } + ], + "name": "removeTokenDestination", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_signature", + "type": "string" + }, + { + "internalType": "address", + "name": "_target", + "type": "address" + } + ], + "name": "setAuthFunctionCall", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string[]", + "name": "_signatures", + "type": "string[]" + }, + { + "internalType": "address[]", + "name": "_targets", + "type": "address[]" + } + ], + "name": "setAuthFunctionCallMany", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_masterCopy", + "type": "address" + } + ], + "name": "setMasterCopy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "token", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_signature", + "type": "string" + } + ], + "name": "unsetAuthFunctionCall", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x32d3db48be816776850bd2d4d2e64351cae31fca85e9118ea90dc6eb342593c1", + "receipt": { + "to": null, + "from": "0xE04FcE05E9B8d21521bd1B0f069982c03BD31F76", + "contractAddress": "0x455466E99033D1D33D6fA6EcA40F182e0A551847", + "transactionIndex": 82, + "gasUsed": "3166292", + "logsBloom": "0x00000000000000000000400000000000000004000000000000800000000000400042000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000001000000000000000000400000000000000000020000000000000000000800000000000000000000000000000000400002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000008000000000000000000000000000000000000000000000020000020000008000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x9523656a047822adc4d8c77b9a69035e06d05c8d7797ce4305cb36c1d8aa0bbd", + "transactionHash": "0x32d3db48be816776850bd2d4d2e64351cae31fca85e9118ea90dc6eb342593c1", + "logs": [ + { + "transactionIndex": 82, + "blockNumber": 15877688, + "transactionHash": "0x32d3db48be816776850bd2d4d2e64351cae31fca85e9118ea90dc6eb342593c1", + "address": "0x455466E99033D1D33D6fA6EcA40F182e0A551847", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000e04fce05e9b8d21521bd1b0f069982c03bd31f76" + ], + "data": "0x", + "logIndex": 170, + "blockHash": "0x9523656a047822adc4d8c77b9a69035e06d05c8d7797ce4305cb36c1d8aa0bbd" + }, + { + "transactionIndex": 82, + "blockNumber": 15877688, + "transactionHash": "0x32d3db48be816776850bd2d4d2e64351cae31fca85e9118ea90dc6eb342593c1", + "address": "0x455466E99033D1D33D6fA6EcA40F182e0A551847", + "topics": [ + "0x30909084afc859121ffc3a5aef7fe37c540a9a1ef60bd4d8dcdb76376fadf9de", + "0x000000000000000000000000624984fd288e28c0d24d7e0e4adfda130717720b" + ], + "data": "0x", + "logIndex": 171, + "blockHash": "0x9523656a047822adc4d8c77b9a69035e06d05c8d7797ce4305cb36c1d8aa0bbd" + } + ], + "blockNumber": 15877688, + "cumulativeGasUsed": "9035991", + "status": 1, + "byzantium": true + }, + "args": [ + "0xc944E90C64B2c07662A292be6244BDf05Cda44a7", + "0x624984fd288e28C0D24d7E0E4aDFDa130717720B" + ], + "solcInputHash": "6f5e8f450f52dd96ebb796aa6620fee9", + "metadata": "{\"compiler\":{\"version\":\"0.7.3+commit.9bfce1f6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"_graphToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_masterCopy\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes4\",\"name\":\"sigHash\",\"type\":\"bytes4\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"signature\",\"type\":\"string\"}],\"name\":\"FunctionCallAuth\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"masterCopy\",\"type\":\"address\"}],\"name\":\"MasterCopyUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"proxy\",\"type\":\"address\"}],\"name\":\"ProxyCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dst\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"}],\"name\":\"TokenDestinationAllowed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"contractAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"initHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"managedAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"startTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"endTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"periods\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"releaseStartTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"vestingCliffTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"enum IGraphTokenLock.Revocability\",\"name\":\"revocable\",\"type\":\"uint8\"}],\"name\":\"TokenLockCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensWithdrawn\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_dst\",\"type\":\"address\"}],\"name\":\"addTokenDestination\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"name\":\"authFnCalls\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_beneficiary\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_managedAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_startTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_endTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_periods\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_releaseStartTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_vestingCliffTime\",\"type\":\"uint256\"},{\"internalType\":\"enum IGraphTokenLock.Revocability\",\"name\":\"_revocable\",\"type\":\"uint8\"}],\"name\":\"createTokenLockWallet\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"deposit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"_sigHash\",\"type\":\"bytes4\"}],\"name\":\"getAuthFunctionCallTarget\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_salt\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"}],\"name\":\"getDeploymentAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTokenDestinations\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"_sigHash\",\"type\":\"bytes4\"}],\"name\":\"isAuthFunctionCall\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_dst\",\"type\":\"address\"}],\"name\":\"isTokenDestination\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"masterCopy\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_dst\",\"type\":\"address\"}],\"name\":\"removeTokenDestination\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_signature\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"_target\",\"type\":\"address\"}],\"name\":\"setAuthFunctionCall\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string[]\",\"name\":\"_signatures\",\"type\":\"string[]\"},{\"internalType\":\"address[]\",\"name\":\"_targets\",\"type\":\"address[]\"}],\"name\":\"setAuthFunctionCallMany\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_masterCopy\",\"type\":\"address\"}],\"name\":\"setMasterCopy\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_signature\",\"type\":\"string\"}],\"name\":\"unsetAuthFunctionCall\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"addTokenDestination(address)\":{\"params\":{\"_dst\":\"Destination address\"}},\"constructor\":{\"params\":{\"_graphToken\":\"Token to use for deposits and withdrawals\",\"_masterCopy\":\"Address of the master copy to use to clone proxies\"}},\"createTokenLockWallet(address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)\":{\"params\":{\"_beneficiary\":\"Address of the beneficiary of locked tokens\",\"_endTime\":\"End time of the release schedule\",\"_managedAmount\":\"Amount of tokens to be managed by the lock contract\",\"_owner\":\"Address of the contract owner\",\"_periods\":\"Number of periods between start time and end time\",\"_releaseStartTime\":\"Override time for when the releases start\",\"_revocable\":\"Whether the contract is revocable\",\"_startTime\":\"Start time of the release schedule\"}},\"deposit(uint256)\":{\"details\":\"Even if the ERC20 token can be transferred directly to the contract this function provide a safe interface to do the transfer and avoid mistakes\",\"params\":{\"_amount\":\"Amount to deposit\"}},\"getAuthFunctionCallTarget(bytes4)\":{\"params\":{\"_sigHash\":\"Function signature hash\"},\"returns\":{\"_0\":\"Address of the target contract where to send the call\"}},\"getDeploymentAddress(bytes32,address)\":{\"params\":{\"_implementation\":\"Address of the proxy target implementation\",\"_salt\":\"Bytes32 salt to use for CREATE2\"},\"returns\":{\"_0\":\"Address of the counterfactual MinimalProxy\"}},\"getTokenDestinations()\":{\"returns\":{\"_0\":\"Array of addresses authorized to pull funds from a token lock\"}},\"isAuthFunctionCall(bytes4)\":{\"params\":{\"_sigHash\":\"Function signature hash\"},\"returns\":{\"_0\":\"True if authorized\"}},\"isTokenDestination(address)\":{\"params\":{\"_dst\":\"Destination address\"},\"returns\":{\"_0\":\"True if authorized\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"removeTokenDestination(address)\":{\"params\":{\"_dst\":\"Destination address\"}},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"setAuthFunctionCall(string,address)\":{\"details\":\"Input expected is the function signature as 'transfer(address,uint256)'\",\"params\":{\"_signature\":\"Function signature\",\"_target\":\"Address of the destination contract to call\"}},\"setAuthFunctionCallMany(string[],address[])\":{\"details\":\"Input expected is the function signature as 'transfer(address,uint256)'\",\"params\":{\"_signatures\":\"Function signatures\",\"_targets\":\"Address of the destination contract to call\"}},\"setMasterCopy(address)\":{\"params\":{\"_masterCopy\":\"Address of contract bytecode to factory clone\"}},\"token()\":{\"returns\":{\"_0\":\"Token used for transfers and approvals\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"unsetAuthFunctionCall(string)\":{\"details\":\"Input expected is the function signature as 'transfer(address,uint256)'\",\"params\":{\"_signature\":\"Function signature\"}},\"withdraw(uint256)\":{\"details\":\"Escape hatch in case of mistakes or to recover remaining funds\",\"params\":{\"_amount\":\"Amount of tokens to withdraw\"}}},\"title\":\"GraphTokenLockManager\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"addTokenDestination(address)\":{\"notice\":\"Adds an address that can be allowed by a token lock to pull funds\"},\"constructor\":{\"notice\":\"Constructor.\"},\"createTokenLockWallet(address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)\":{\"notice\":\"Creates and fund a new token lock wallet using a minimum proxy\"},\"deposit(uint256)\":{\"notice\":\"Deposits tokens into the contract\"},\"getAuthFunctionCallTarget(bytes4)\":{\"notice\":\"Gets the target contract to call for a particular function signature\"},\"getDeploymentAddress(bytes32,address)\":{\"notice\":\"Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation\"},\"getTokenDestinations()\":{\"notice\":\"Returns an array of authorized destination addresses\"},\"isAuthFunctionCall(bytes4)\":{\"notice\":\"Returns true if the function call is authorized\"},\"isTokenDestination(address)\":{\"notice\":\"Returns True if the address is authorized to be a destination of tokens\"},\"removeTokenDestination(address)\":{\"notice\":\"Removes an address that can be allowed by a token lock to pull funds\"},\"setAuthFunctionCall(string,address)\":{\"notice\":\"Sets an authorized function call to target\"},\"setAuthFunctionCallMany(string[],address[])\":{\"notice\":\"Sets an authorized function call to target in bulk\"},\"setMasterCopy(address)\":{\"notice\":\"Sets the masterCopy bytecode to use to create clones of TokenLock contracts\"},\"token()\":{\"notice\":\"Gets the GRT token address\"},\"unsetAuthFunctionCall(string)\":{\"notice\":\"Unsets an authorized function call to target\"},\"withdraw(uint256)\":{\"notice\":\"Withdraws tokens from the contract\"}},\"notice\":\"This contract manages a list of authorized function calls and targets that can be called by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts. This contract receives funds to make the process of creating TokenLockWallet contracts easier by distributing them the initial tokens to be managed. The owner can setup a list of token destinations that will be used by TokenLock contracts to approve the pulling of funds, this way in can be guaranteed that only protocol contracts will manipulate users funds.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/GraphTokenLockManager.sol\":\"GraphTokenLockManager\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor () internal {\\n address msgSender = _msgSender();\\n _owner = msgSender;\\n emit OwnershipTransferred(address(0), msgSender);\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n emit OwnershipTransferred(_owner, address(0));\\n _owner = address(0);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n emit OwnershipTransferred(_owner, newOwner);\\n _owner = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0x15e2d5bd4c28a88548074c54d220e8086f638a71ed07e6b3ba5a70066fcf458d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/math/SafeMath.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Wrappers over Solidity's arithmetic operations with added overflow\\n * checks.\\n *\\n * Arithmetic operations in Solidity wrap on overflow. This can easily result\\n * in bugs, because programmers usually assume that an overflow raises an\\n * error, which is the standard behavior in high level programming languages.\\n * `SafeMath` restores this intuition by reverting the transaction when an\\n * operation overflows.\\n *\\n * Using this library instead of the unchecked operations eliminates an entire\\n * class of bugs, so it's recommended to use it always.\\n */\\nlibrary SafeMath {\\n /**\\n * @dev Returns the addition of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n uint256 c = a + b;\\n if (c < a) return (false, 0);\\n return (true, c);\\n }\\n\\n /**\\n * @dev Returns the substraction of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b > a) return (false, 0);\\n return (true, a - b);\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\\n if (a == 0) return (true, 0);\\n uint256 c = a * b;\\n if (c / a != b) return (false, 0);\\n return (true, c);\\n }\\n\\n /**\\n * @dev Returns the division of two unsigned integers, with a division by zero flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b == 0) return (false, 0);\\n return (true, a / b);\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b == 0) return (false, 0);\\n return (true, a % b);\\n }\\n\\n /**\\n * @dev Returns the addition of two unsigned integers, reverting on\\n * overflow.\\n *\\n * Counterpart to Solidity's `+` operator.\\n *\\n * Requirements:\\n *\\n * - Addition cannot overflow.\\n */\\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\\n uint256 c = a + b;\\n require(c >= a, \\\"SafeMath: addition overflow\\\");\\n return c;\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting on\\n * overflow (when the result is negative).\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n *\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b <= a, \\\"SafeMath: subtraction overflow\\\");\\n return a - b;\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, reverting on\\n * overflow.\\n *\\n * Counterpart to Solidity's `*` operator.\\n *\\n * Requirements:\\n *\\n * - Multiplication cannot overflow.\\n */\\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\\n if (a == 0) return 0;\\n uint256 c = a * b;\\n require(c / a == b, \\\"SafeMath: multiplication overflow\\\");\\n return c;\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers, reverting on\\n * division by zero. The result is rounded towards zero.\\n *\\n * Counterpart to Solidity's `/` operator. Note: this function uses a\\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\\n * uses an invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b > 0, \\\"SafeMath: division by zero\\\");\\n return a / b;\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * reverting when dividing by zero.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b > 0, \\\"SafeMath: modulo by zero\\\");\\n return a % b;\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\\n * overflow (when the result is negative).\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {trySub}.\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n *\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b <= a, errorMessage);\\n return a - b;\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers, reverting with custom message on\\n * division by zero. The result is rounded towards zero.\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {tryDiv}.\\n *\\n * Counterpart to Solidity's `/` operator. Note: this function uses a\\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\\n * uses an invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b > 0, errorMessage);\\n return a / b;\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * reverting with custom message when dividing by zero.\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {tryMod}.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b > 0, errorMessage);\\n return a % b;\\n }\\n}\\n\",\"keccak256\":\"0xcc78a17dd88fa5a2edc60c8489e2f405c0913b377216a5b26b35656b2d0dab52\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `recipient`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address recipient, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `sender` to `recipient` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n}\\n\",\"keccak256\":\"0x5f02220344881ce43204ae4a6281145a67bc52c2bb1290a791857df3d19d78f5\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\nimport \\\"./IERC20.sol\\\";\\nimport \\\"../../math/SafeMath.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @title SafeERC20\\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\\n * contract returns false). Tokens that return no value (and instead revert or\\n * throw on failure) are also supported, non-reverting calls are assumed to be\\n * successful.\\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\n */\\nlibrary SafeERC20 {\\n using SafeMath for uint256;\\n using Address for address;\\n\\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\\n }\\n\\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\\n }\\n\\n /**\\n * @dev Deprecated. This function has issues similar to the ones found in\\n * {IERC20-approve}, and its usage is discouraged.\\n *\\n * Whenever possible, use {safeIncreaseAllowance} and\\n * {safeDecreaseAllowance} instead.\\n */\\n function safeApprove(IERC20 token, address spender, uint256 value) internal {\\n // safeApprove should only be called when setting an initial allowance,\\n // or when resetting it to zero. To increase and decrease it, use\\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\\n // solhint-disable-next-line max-line-length\\n require((value == 0) || (token.allowance(address(this), spender) == 0),\\n \\\"SafeERC20: approve from non-zero to non-zero allowance\\\"\\n );\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\\n }\\n\\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n uint256 newAllowance = token.allowance(address(this), spender).add(value);\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n uint256 newAllowance = token.allowance(address(this), spender).sub(value, \\\"SafeERC20: decreased allowance below zero\\\");\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n */\\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that\\n // the target address contains contract code and also asserts for success in the low-level call.\\n\\n bytes memory returndata = address(token).functionCall(data, \\\"SafeERC20: low-level call failed\\\");\\n if (returndata.length > 0) { // Return data is optional\\n // solhint-disable-next-line max-line-length\\n require(abi.decode(returndata, (bool)), \\\"SafeERC20: ERC20 operation did not succeed\\\");\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf12dfbe97e6276980b83d2830bb0eb75e0cf4f3e626c2471137f82158ae6a0fc\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.2 <0.8.0;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize, which returns 0 for contracts in\\n // construction, since the code is only stored at the end of the\\n // constructor execution.\\n\\n uint256 size;\\n // solhint-disable-next-line no-inline-assembly\\n assembly { size := extcodesize(account) }\\n return size > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls, avoid-call-value\\n (bool success, ) = recipient.call{ value: amount }(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain`call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.call{ value: value }(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x28911e614500ae7c607a432a709d35da25f3bc5ddc8bd12b278b66358070c0ea\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/*\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with GSN meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address payable) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes memory) {\\n this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0x8d3cb350f04ff49cfb10aef08d87f19dcbaecc8027b0bed12f3275cd12f38cf0\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Create2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Helper to make usage of the `CREATE2` EVM opcode easier and safer.\\n * `CREATE2` can be used to compute in advance the address where a smart\\n * contract will be deployed, which allows for interesting new mechanisms known\\n * as 'counterfactual interactions'.\\n *\\n * See the https://eips.ethereum.org/EIPS/eip-1014#motivation[EIP] for more\\n * information.\\n */\\nlibrary Create2 {\\n /**\\n * @dev Deploys a contract using `CREATE2`. The address where the contract\\n * will be deployed can be known in advance via {computeAddress}.\\n *\\n * The bytecode for a contract can be obtained from Solidity with\\n * `type(contractName).creationCode`.\\n *\\n * Requirements:\\n *\\n * - `bytecode` must not be empty.\\n * - `salt` must have not been used for `bytecode` already.\\n * - the factory must have a balance of at least `amount`.\\n * - if `amount` is non-zero, `bytecode` must have a `payable` constructor.\\n */\\n function deploy(uint256 amount, bytes32 salt, bytes memory bytecode) internal returns (address) {\\n address addr;\\n require(address(this).balance >= amount, \\\"Create2: insufficient balance\\\");\\n require(bytecode.length != 0, \\\"Create2: bytecode length is zero\\\");\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n addr := create2(amount, add(bytecode, 0x20), mload(bytecode), salt)\\n }\\n require(addr != address(0), \\\"Create2: Failed on deploy\\\");\\n return addr;\\n }\\n\\n /**\\n * @dev Returns the address where a contract will be stored if deployed via {deploy}. Any change in the\\n * `bytecodeHash` or `salt` will result in a new destination address.\\n */\\n function computeAddress(bytes32 salt, bytes32 bytecodeHash) internal view returns (address) {\\n return computeAddress(salt, bytecodeHash, address(this));\\n }\\n\\n /**\\n * @dev Returns the address where a contract will be stored if deployed via {deploy} from a contract located at\\n * `deployer`. If `deployer` is this contract's address, returns the same value as {computeAddress}.\\n */\\n function computeAddress(bytes32 salt, bytes32 bytecodeHash, address deployer) internal pure returns (address) {\\n bytes32 _data = keccak256(\\n abi.encodePacked(bytes1(0xff), deployer, salt, bytecodeHash)\\n );\\n return address(uint160(uint256(_data)));\\n }\\n}\\n\",\"keccak256\":\"0x0a0b021149946014fe1cd04af11e7a937a29986c47e8b1b718c2d50d729472db\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/EnumerableSet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Library for managing\\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\\n * types.\\n *\\n * Sets have the following properties:\\n *\\n * - Elements are added, removed, and checked for existence in constant time\\n * (O(1)).\\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\\n *\\n * ```\\n * contract Example {\\n * // Add the library methods\\n * using EnumerableSet for EnumerableSet.AddressSet;\\n *\\n * // Declare a set state variable\\n * EnumerableSet.AddressSet private mySet;\\n * }\\n * ```\\n *\\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\\n * and `uint256` (`UintSet`) are supported.\\n */\\nlibrary EnumerableSet {\\n // To implement this library for multiple types with as little code\\n // repetition as possible, we write it in terms of a generic Set type with\\n // bytes32 values.\\n // The Set implementation uses private functions, and user-facing\\n // implementations (such as AddressSet) are just wrappers around the\\n // underlying Set.\\n // This means that we can only create new EnumerableSets for types that fit\\n // in bytes32.\\n\\n struct Set {\\n // Storage of set values\\n bytes32[] _values;\\n\\n // Position of the value in the `values` array, plus 1 because index 0\\n // means a value is not in the set.\\n mapping (bytes32 => uint256) _indexes;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function _add(Set storage set, bytes32 value) private returns (bool) {\\n if (!_contains(set, value)) {\\n set._values.push(value);\\n // The value is stored at length-1, but we add 1 to all indexes\\n // and use 0 as a sentinel value\\n set._indexes[value] = set._values.length;\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function _remove(Set storage set, bytes32 value) private returns (bool) {\\n // We read and store the value's index to prevent multiple reads from the same storage slot\\n uint256 valueIndex = set._indexes[value];\\n\\n if (valueIndex != 0) { // Equivalent to contains(set, value)\\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\\n // the array, and then remove the last element (sometimes called as 'swap and pop').\\n // This modifies the order of the array, as noted in {at}.\\n\\n uint256 toDeleteIndex = valueIndex - 1;\\n uint256 lastIndex = set._values.length - 1;\\n\\n // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs\\n // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.\\n\\n bytes32 lastvalue = set._values[lastIndex];\\n\\n // Move the last value to the index where the value to delete is\\n set._values[toDeleteIndex] = lastvalue;\\n // Update the index for the moved value\\n set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based\\n\\n // Delete the slot where the moved value was stored\\n set._values.pop();\\n\\n // Delete the index for the deleted slot\\n delete set._indexes[value];\\n\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\\n return set._indexes[value] != 0;\\n }\\n\\n /**\\n * @dev Returns the number of values on the set. O(1).\\n */\\n function _length(Set storage set) private view returns (uint256) {\\n return set._values.length;\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\\n require(set._values.length > index, \\\"EnumerableSet: index out of bounds\\\");\\n return set._values[index];\\n }\\n\\n // Bytes32Set\\n\\n struct Bytes32Set {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _add(set._inner, value);\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _remove(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\\n return _contains(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(Bytes32Set storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\\n return _at(set._inner, index);\\n }\\n\\n // AddressSet\\n\\n struct AddressSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(AddressSet storage set, address value) internal returns (bool) {\\n return _add(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(AddressSet storage set, address value) internal returns (bool) {\\n return _remove(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(AddressSet storage set, address value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(AddressSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\\n return address(uint160(uint256(_at(set._inner, index))));\\n }\\n\\n\\n // UintSet\\n\\n struct UintSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(UintSet storage set, uint256 value) internal returns (bool) {\\n return _add(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\\n return _remove(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns the number of values on the set. O(1).\\n */\\n function length(UintSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\\n return uint256(_at(set._inner, index));\\n }\\n}\\n\",\"keccak256\":\"0x1562cd9922fbf739edfb979f506809e2743789cbde3177515542161c3d04b164\",\"license\":\"MIT\"},\"contracts/GraphTokenLockManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/EnumerableSet.sol\\\";\\n\\nimport \\\"./MinimalProxyFactory.sol\\\";\\nimport \\\"./IGraphTokenLockManager.sol\\\";\\n\\n/**\\n * @title GraphTokenLockManager\\n * @notice This contract manages a list of authorized function calls and targets that can be called\\n * by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts.\\n *\\n * This contract receives funds to make the process of creating TokenLockWallet contracts\\n * easier by distributing them the initial tokens to be managed.\\n *\\n * The owner can setup a list of token destinations that will be used by TokenLock contracts to\\n * approve the pulling of funds, this way in can be guaranteed that only protocol contracts\\n * will manipulate users funds.\\n */\\ncontract GraphTokenLockManager is MinimalProxyFactory, IGraphTokenLockManager {\\n using SafeERC20 for IERC20;\\n using EnumerableSet for EnumerableSet.AddressSet;\\n\\n // -- State --\\n\\n mapping(bytes4 => address) public authFnCalls;\\n EnumerableSet.AddressSet private _tokenDestinations;\\n\\n address public masterCopy;\\n IERC20 private _token;\\n\\n // -- Events --\\n\\n event MasterCopyUpdated(address indexed masterCopy);\\n event TokenLockCreated(\\n address indexed contractAddress,\\n bytes32 indexed initHash,\\n address indexed beneficiary,\\n address token,\\n uint256 managedAmount,\\n uint256 startTime,\\n uint256 endTime,\\n uint256 periods,\\n uint256 releaseStartTime,\\n uint256 vestingCliffTime,\\n IGraphTokenLock.Revocability revocable\\n );\\n\\n event TokensDeposited(address indexed sender, uint256 amount);\\n event TokensWithdrawn(address indexed sender, uint256 amount);\\n\\n event FunctionCallAuth(address indexed caller, bytes4 indexed sigHash, address indexed target, string signature);\\n event TokenDestinationAllowed(address indexed dst, bool allowed);\\n\\n /**\\n * Constructor.\\n * @param _graphToken Token to use for deposits and withdrawals\\n * @param _masterCopy Address of the master copy to use to clone proxies\\n */\\n constructor(IERC20 _graphToken, address _masterCopy) {\\n require(address(_graphToken) != address(0), \\\"Token cannot be zero\\\");\\n _token = _graphToken;\\n setMasterCopy(_masterCopy);\\n }\\n\\n // -- Factory --\\n\\n /**\\n * @notice Sets the masterCopy bytecode to use to create clones of TokenLock contracts\\n * @param _masterCopy Address of contract bytecode to factory clone\\n */\\n function setMasterCopy(address _masterCopy) public override onlyOwner {\\n require(_masterCopy != address(0), \\\"MasterCopy cannot be zero\\\");\\n masterCopy = _masterCopy;\\n emit MasterCopyUpdated(_masterCopy);\\n }\\n\\n /**\\n * @notice Creates and fund a new token lock wallet using a minimum proxy\\n * @param _owner Address of the contract owner\\n * @param _beneficiary Address of the beneficiary of locked tokens\\n * @param _managedAmount Amount of tokens to be managed by the lock contract\\n * @param _startTime Start time of the release schedule\\n * @param _endTime End time of the release schedule\\n * @param _periods Number of periods between start time and end time\\n * @param _releaseStartTime Override time for when the releases start\\n * @param _revocable Whether the contract is revocable\\n */\\n function createTokenLockWallet(\\n address _owner,\\n address _beneficiary,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n IGraphTokenLock.Revocability _revocable\\n ) external override onlyOwner {\\n require(_token.balanceOf(address(this)) >= _managedAmount, \\\"Not enough tokens to create lock\\\");\\n\\n // Create contract using a minimal proxy and call initializer\\n bytes memory initializer = abi.encodeWithSignature(\\n \\\"initialize(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)\\\",\\n address(this),\\n _owner,\\n _beneficiary,\\n address(_token),\\n _managedAmount,\\n _startTime,\\n _endTime,\\n _periods,\\n _releaseStartTime,\\n _vestingCliffTime,\\n _revocable\\n );\\n address contractAddress = _deployProxy2(keccak256(initializer), masterCopy, initializer);\\n\\n // Send managed amount to the created contract\\n _token.safeTransfer(contractAddress, _managedAmount);\\n\\n emit TokenLockCreated(\\n contractAddress,\\n keccak256(initializer),\\n _beneficiary,\\n address(_token),\\n _managedAmount,\\n _startTime,\\n _endTime,\\n _periods,\\n _releaseStartTime,\\n _vestingCliffTime,\\n _revocable\\n );\\n }\\n\\n // -- Funds Management --\\n\\n /**\\n * @notice Gets the GRT token address\\n * @return Token used for transfers and approvals\\n */\\n function token() external view override returns (IERC20) {\\n return _token;\\n }\\n\\n /**\\n * @notice Deposits tokens into the contract\\n * @dev Even if the ERC20 token can be transferred directly to the contract\\n * this function provide a safe interface to do the transfer and avoid mistakes\\n * @param _amount Amount to deposit\\n */\\n function deposit(uint256 _amount) external override {\\n require(_amount > 0, \\\"Amount cannot be zero\\\");\\n _token.safeTransferFrom(msg.sender, address(this), _amount);\\n emit TokensDeposited(msg.sender, _amount);\\n }\\n\\n /**\\n * @notice Withdraws tokens from the contract\\n * @dev Escape hatch in case of mistakes or to recover remaining funds\\n * @param _amount Amount of tokens to withdraw\\n */\\n function withdraw(uint256 _amount) external override onlyOwner {\\n require(_amount > 0, \\\"Amount cannot be zero\\\");\\n _token.safeTransfer(msg.sender, _amount);\\n emit TokensWithdrawn(msg.sender, _amount);\\n }\\n\\n // -- Token Destinations --\\n\\n /**\\n * @notice Adds an address that can be allowed by a token lock to pull funds\\n * @param _dst Destination address\\n */\\n function addTokenDestination(address _dst) external override onlyOwner {\\n require(_dst != address(0), \\\"Destination cannot be zero\\\");\\n require(_tokenDestinations.add(_dst), \\\"Destination already added\\\");\\n emit TokenDestinationAllowed(_dst, true);\\n }\\n\\n /**\\n * @notice Removes an address that can be allowed by a token lock to pull funds\\n * @param _dst Destination address\\n */\\n function removeTokenDestination(address _dst) external override onlyOwner {\\n require(_tokenDestinations.remove(_dst), \\\"Destination already removed\\\");\\n emit TokenDestinationAllowed(_dst, false);\\n }\\n\\n /**\\n * @notice Returns True if the address is authorized to be a destination of tokens\\n * @param _dst Destination address\\n * @return True if authorized\\n */\\n function isTokenDestination(address _dst) external view override returns (bool) {\\n return _tokenDestinations.contains(_dst);\\n }\\n\\n /**\\n * @notice Returns an array of authorized destination addresses\\n * @return Array of addresses authorized to pull funds from a token lock\\n */\\n function getTokenDestinations() external view override returns (address[] memory) {\\n address[] memory dstList = new address[](_tokenDestinations.length());\\n for (uint256 i = 0; i < _tokenDestinations.length(); i++) {\\n dstList[i] = _tokenDestinations.at(i);\\n }\\n return dstList;\\n }\\n\\n // -- Function Call Authorization --\\n\\n /**\\n * @notice Sets an authorized function call to target\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @param _signature Function signature\\n * @param _target Address of the destination contract to call\\n */\\n function setAuthFunctionCall(string calldata _signature, address _target) external override onlyOwner {\\n _setAuthFunctionCall(_signature, _target);\\n }\\n\\n /**\\n * @notice Unsets an authorized function call to target\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @param _signature Function signature\\n */\\n function unsetAuthFunctionCall(string calldata _signature) external override onlyOwner {\\n bytes4 sigHash = _toFunctionSigHash(_signature);\\n authFnCalls[sigHash] = address(0);\\n\\n emit FunctionCallAuth(msg.sender, sigHash, address(0), _signature);\\n }\\n\\n /**\\n * @notice Sets an authorized function call to target in bulk\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @param _signatures Function signatures\\n * @param _targets Address of the destination contract to call\\n */\\n function setAuthFunctionCallMany(string[] calldata _signatures, address[] calldata _targets)\\n external\\n override\\n onlyOwner\\n {\\n require(_signatures.length == _targets.length, \\\"Array length mismatch\\\");\\n\\n for (uint256 i = 0; i < _signatures.length; i++) {\\n _setAuthFunctionCall(_signatures[i], _targets[i]);\\n }\\n }\\n\\n /**\\n * @notice Sets an authorized function call to target\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @dev Function signatures of Graph Protocol contracts to be used are known ahead of time\\n * @param _signature Function signature\\n * @param _target Address of the destination contract to call\\n */\\n function _setAuthFunctionCall(string calldata _signature, address _target) internal {\\n require(_target != address(this), \\\"Target must be other contract\\\");\\n require(Address.isContract(_target), \\\"Target must be a contract\\\");\\n\\n bytes4 sigHash = _toFunctionSigHash(_signature);\\n authFnCalls[sigHash] = _target;\\n\\n emit FunctionCallAuth(msg.sender, sigHash, _target, _signature);\\n }\\n\\n /**\\n * @notice Gets the target contract to call for a particular function signature\\n * @param _sigHash Function signature hash\\n * @return Address of the target contract where to send the call\\n */\\n function getAuthFunctionCallTarget(bytes4 _sigHash) public view override returns (address) {\\n return authFnCalls[_sigHash];\\n }\\n\\n /**\\n * @notice Returns true if the function call is authorized\\n * @param _sigHash Function signature hash\\n * @return True if authorized\\n */\\n function isAuthFunctionCall(bytes4 _sigHash) external view override returns (bool) {\\n return getAuthFunctionCallTarget(_sigHash) != address(0);\\n }\\n\\n /**\\n * @dev Converts a function signature string to 4-bytes hash\\n * @param _signature Function signature string\\n * @return Function signature hash\\n */\\n function _toFunctionSigHash(string calldata _signature) internal pure returns (bytes4) {\\n return _convertToBytes4(abi.encodeWithSignature(_signature));\\n }\\n\\n /**\\n * @dev Converts function signature bytes to function signature hash (bytes4)\\n * @param _signature Function signature\\n * @return Function signature in bytes4\\n */\\n function _convertToBytes4(bytes memory _signature) internal pure returns (bytes4) {\\n require(_signature.length == 4, \\\"Invalid method signature\\\");\\n bytes4 sigHash;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n sigHash := mload(add(_signature, 32))\\n }\\n return sigHash;\\n }\\n}\\n\",\"keccak256\":\"0x0384d62cb600eb4128baacf5bca60ea2cb0b68d2d013479daef65ed5f15446ef\",\"license\":\"MIT\"},\"contracts/IGraphTokenLock.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\ninterface IGraphTokenLock {\\n enum Revocability {\\n NotSet,\\n Enabled,\\n Disabled\\n }\\n\\n // -- Balances --\\n\\n function currentBalance() external view returns (uint256);\\n\\n // -- Time & Periods --\\n\\n function currentTime() external view returns (uint256);\\n\\n function duration() external view returns (uint256);\\n\\n function sinceStartTime() external view returns (uint256);\\n\\n function amountPerPeriod() external view returns (uint256);\\n\\n function periodDuration() external view returns (uint256);\\n\\n function currentPeriod() external view returns (uint256);\\n\\n function passedPeriods() external view returns (uint256);\\n\\n // -- Locking & Release Schedule --\\n\\n function availableAmount() external view returns (uint256);\\n\\n function vestedAmount() external view returns (uint256);\\n\\n function releasableAmount() external view returns (uint256);\\n\\n function totalOutstandingAmount() external view returns (uint256);\\n\\n function surplusAmount() external view returns (uint256);\\n\\n // -- Value Transfer --\\n\\n function release() external;\\n\\n function withdrawSurplus(uint256 _amount) external;\\n\\n function revoke() external;\\n}\\n\",\"keccak256\":\"0xceb9d258276fe25ec858191e1deae5778f1b2f612a669fb7b37bab1a064756ab\",\"license\":\"MIT\"},\"contracts/IGraphTokenLockManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nimport \\\"./IGraphTokenLock.sol\\\";\\n\\ninterface IGraphTokenLockManager {\\n // -- Factory --\\n\\n function setMasterCopy(address _masterCopy) external;\\n\\n function createTokenLockWallet(\\n address _owner,\\n address _beneficiary,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n IGraphTokenLock.Revocability _revocable\\n ) external;\\n\\n // -- Funds Management --\\n\\n function token() external returns (IERC20);\\n\\n function deposit(uint256 _amount) external;\\n\\n function withdraw(uint256 _amount) external;\\n\\n // -- Allowed Funds Destinations --\\n\\n function addTokenDestination(address _dst) external;\\n\\n function removeTokenDestination(address _dst) external;\\n\\n function isTokenDestination(address _dst) external view returns (bool);\\n\\n function getTokenDestinations() external view returns (address[] memory);\\n\\n // -- Function Call Authorization --\\n\\n function setAuthFunctionCall(string calldata _signature, address _target) external;\\n\\n function unsetAuthFunctionCall(string calldata _signature) external;\\n\\n function setAuthFunctionCallMany(string[] calldata _signatures, address[] calldata _targets) external;\\n\\n function getAuthFunctionCallTarget(bytes4 _sigHash) external view returns (address);\\n\\n function isAuthFunctionCall(bytes4 _sigHash) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x2d78d41909a6de5b316ac39b100ea087a8f317cf306379888a045523e15c4d9a\",\"license\":\"MIT\"},\"contracts/MinimalProxyFactory.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Create2.sol\\\";\\n\\n// Adapted from https://github.com/OpenZeppelin/openzeppelin-sdk/blob/v2.5.0/packages/lib/contracts/upgradeability/ProxyFactory.sol\\n// Based on https://eips.ethereum.org/EIPS/eip-1167\\ncontract MinimalProxyFactory is Ownable {\\n // -- Events --\\n\\n event ProxyCreated(address indexed proxy);\\n\\n /**\\n * @notice Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation\\n * @param _salt Bytes32 salt to use for CREATE2\\n * @param _implementation Address of the proxy target implementation\\n * @return Address of the counterfactual MinimalProxy\\n */\\n function getDeploymentAddress(bytes32 _salt, address _implementation) external view returns (address) {\\n return Create2.computeAddress(_salt, keccak256(_getContractCreationCode(_implementation)), address(this));\\n }\\n\\n /**\\n * @notice Deploys a MinimalProxy with CREATE2\\n * @param _salt Bytes32 salt to use for CREATE2\\n * @param _implementation Address of the proxy target implementation\\n * @param _data Bytes with the initializer call\\n * @return Address of the deployed MinimalProxy\\n */\\n function _deployProxy2(\\n bytes32 _salt,\\n address _implementation,\\n bytes memory _data\\n ) internal returns (address) {\\n address proxyAddress = Create2.deploy(0, _salt, _getContractCreationCode(_implementation));\\n\\n emit ProxyCreated(proxyAddress);\\n\\n // Call function with data\\n if (_data.length > 0) {\\n Address.functionCall(proxyAddress, _data);\\n }\\n\\n return proxyAddress;\\n }\\n\\n /**\\n * @notice Gets the MinimalProxy bytecode\\n * @param _implementation Address of the proxy target implementation\\n * @return MinimalProxy bytecode\\n */\\n function _getContractCreationCode(address _implementation) internal pure returns (bytes memory) {\\n bytes10 creation = 0x3d602d80600a3d3981f3;\\n bytes10 prefix = 0x363d3d373d3d3d363d73;\\n bytes20 targetBytes = bytes20(_implementation);\\n bytes15 suffix = 0x5af43d82803e903d91602b57fd5bf3;\\n return abi.encodePacked(creation, prefix, targetBytes, suffix);\\n }\\n}\\n\",\"keccak256\":\"0x8aa3d50e714f92dc0ed6cc6d88fa8a18c948493103928f6092f98815b2c046ca\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60806040523480156200001157600080fd5b5060405162003c9338038062003c9383398181016040528101906200003791906200039c565b600062000049620001b460201b60201c565b9050806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a350600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156200015a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200015190620004e7565b60405180910390fd5b81600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550620001ac81620001bc60201b60201c565b505062000596565b600033905090565b620001cc620001b460201b60201c565b73ffffffffffffffffffffffffffffffffffffffff16620001f26200034560201b60201c565b73ffffffffffffffffffffffffffffffffffffffff16146200024b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200024290620004c5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415620002be576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620002b590620004a3565b60405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167f30909084afc859121ffc3a5aef7fe37c540a9a1ef60bd4d8dcdb76376fadf9de60405160405180910390a250565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000815190506200037f8162000562565b92915050565b60008151905062000396816200057c565b92915050565b60008060408385031215620003b057600080fd5b6000620003c08582860162000385565b9250506020620003d3858286016200036e565b9150509250929050565b6000620003ec60198362000509565b91507f4d6173746572436f70792063616e6e6f74206265207a65726f000000000000006000830152602082019050919050565b60006200042e60208362000509565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b60006200047060148362000509565b91507f546f6b656e2063616e6e6f74206265207a65726f0000000000000000000000006000830152602082019050919050565b60006020820190508181036000830152620004be81620003dd565b9050919050565b60006020820190508181036000830152620004e0816200041f565b9050919050565b60006020820190508181036000830152620005028162000461565b9050919050565b600082825260208201905092915050565b6000620005278262000542565b9050919050565b60006200053b826200051a565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6200056d816200051a565b81146200057957600080fd5b50565b62000587816200052e565b81146200059357600080fd5b50565b6136ed80620005a66000396000f3fe608060405234801561001057600080fd5b506004361061012c5760003560e01c80639c05fc60116100ad578063c1ab13db11610071578063c1ab13db14610319578063cf497e6c14610335578063f1d24c4514610351578063f2fde38b14610381578063fc0c546a1461039d5761012c565b80639c05fc6014610275578063a345746614610291578063a619486e146102af578063b6b55f25146102cd578063bdb62fbe146102e95761012c565b806368d30c2e116100f457806368d30c2e146101d15780636e03b8dc146101ed578063715018a61461021d57806379ee1bdf146102275780638da5cb5b146102575761012c565b806303990a6c146101315780630602ba2b1461014d5780632e1a7d4d1461017d578063463013a2146101995780635975e00c146101b5575b600080fd5b61014b6004803603810190610146919061253e565b6103bb565b005b61016760048036038101906101629190612515565b610563565b604051610174919061302d565b60405180910390f35b610197600480360381019061019291906125db565b6105a4565b005b6101b360048036038101906101ae9190612583565b610701565b005b6101cf60048036038101906101ca919061234c565b61078d565b005b6101eb60048036038101906101e69190612375565b61091e565b005b61020760048036038101906102029190612515565b610c7e565b6040516102149190612e67565b60405180910390f35b610225610cb1565b005b610241600480360381019061023c919061234c565b610deb565b60405161024e919061302d565b60405180910390f35b61025f610e08565b60405161026c9190612e67565b60405180910390f35b61028f600480360381019061028a919061243b565b610e31565b005b610299610f5e565b6040516102a6919061300b565b60405180910390f35b6102b7611036565b6040516102c49190612e67565b60405180910390f35b6102e760048036038101906102e291906125db565b61105c565b005b61030360048036038101906102fe91906124d9565b61113f565b6040516103109190612e67565b60405180910390f35b610333600480360381019061032e919061234c565b611163565b005b61034f600480360381019061034a919061234c565b611284565b005b61036b60048036038101906103669190612515565b6113f7565b6040516103789190612e67565b60405180910390f35b61039b6004803603810190610396919061234c565b611472565b005b6103a561161b565b6040516103b29190613048565b60405180910390f35b6103c3611645565b73ffffffffffffffffffffffffffffffffffffffff166103e1610e08565b73ffffffffffffffffffffffffffffffffffffffff1614610437576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042e90613229565b60405180910390fd5b6000610443838361164d565b9050600060016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff16817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163373ffffffffffffffffffffffffffffffffffffffff167f450397a2db0e89eccfe664cc6cdfd274a88bc00d29aaec4d991754a42f19f8c98686604051610556929190613063565b60405180910390a4505050565b60008073ffffffffffffffffffffffffffffffffffffffff16610585836113f7565b73ffffffffffffffffffffffffffffffffffffffff1614159050919050565b6105ac611645565b73ffffffffffffffffffffffffffffffffffffffff166105ca610e08565b73ffffffffffffffffffffffffffffffffffffffff1614610620576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161061790613229565b60405180910390fd5b60008111610663576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161065a90613209565b60405180910390fd5b6106b03382600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166116db9092919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b826040516106f69190613309565b60405180910390a250565b610709611645565b73ffffffffffffffffffffffffffffffffffffffff16610727610e08565b73ffffffffffffffffffffffffffffffffffffffff161461077d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077490613229565b60405180910390fd5b610788838383611761565b505050565b610795611645565b73ffffffffffffffffffffffffffffffffffffffff166107b3610e08565b73ffffffffffffffffffffffffffffffffffffffff1614610809576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080090613229565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610879576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161087090613109565b60405180910390fd5b61088d81600261194390919063ffffffff16565b6108cc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108c390613269565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f33442b8c13e72dd75a027f08f9bff4eed2dfd26e43cdea857365f5163b359a796001604051610913919061302d565b60405180910390a250565b610926611645565b73ffffffffffffffffffffffffffffffffffffffff16610944610e08565b73ffffffffffffffffffffffffffffffffffffffff161461099a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161099190613229565b60405180910390fd5b86600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016109f69190612e67565b60206040518083038186803b158015610a0e57600080fd5b505afa158015610a22573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a469190612604565b1015610a87576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7e90613149565b60405180910390fd5b6060308a8a600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168b8b8b8b8b8b8b604051602401610ad09b9a99989796959493929190612e82565b6040516020818303038152906040527fbd896dcb000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505090506000610b858280519060200120600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611973565b9050610bd4818a600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166116db9092919063ffffffff16565b8973ffffffffffffffffffffffffffffffffffffffff1682805190602001208273ffffffffffffffffffffffffffffffffffffffff167f3c7ff6acee351ed98200c285a04745858a107e16da2f13c3a81a43073c17d644600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168d8d8d8d8d8d8d604051610c69989796959493929190612f8d565b60405180910390a45050505050505050505050565b60016020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610cb9611645565b73ffffffffffffffffffffffffffffffffffffffff16610cd7610e08565b73ffffffffffffffffffffffffffffffffffffffff1614610d2d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d2490613229565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000610e018260026119ef90919063ffffffff16565b9050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610e39611645565b73ffffffffffffffffffffffffffffffffffffffff16610e57610e08565b73ffffffffffffffffffffffffffffffffffffffff1614610ead576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ea490613229565b60405180910390fd5b818190508484905014610ef5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eec906130e9565b60405180910390fd5b60005b84849050811015610f5757610f4a858583818110610f1257fe5b9050602002810190610f249190613324565b858585818110610f3057fe5b9050602002016020810190610f45919061234c565b611761565b8080600101915050610ef8565b5050505050565b606080610f6b6002611a1f565b67ffffffffffffffff81118015610f8157600080fd5b50604051908082528060200260200182016040528015610fb05781602001602082028036833780820191505090505b50905060005b610fc06002611a1f565b81101561102e57610fdb816002611a3490919063ffffffff16565b828281518110610fe757fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508080600101915050610fb6565b508091505090565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000811161109f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161109690613209565b60405180910390fd5b6110ee333083600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611a4e909392919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f59062170a285eb80e8c6b8ced60428442a51910635005233fc4ce084a475845e826040516111349190613309565b60405180910390a250565b600061115b8361114e84611ad7565b8051906020012030611b4d565b905092915050565b61116b611645565b73ffffffffffffffffffffffffffffffffffffffff16611189610e08565b73ffffffffffffffffffffffffffffffffffffffff16146111df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111d690613229565b60405180910390fd5b6111f3816002611b9190919063ffffffff16565b611232576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161122990613189565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f33442b8c13e72dd75a027f08f9bff4eed2dfd26e43cdea857365f5163b359a796000604051611279919061302d565b60405180910390a250565b61128c611645565b73ffffffffffffffffffffffffffffffffffffffff166112aa610e08565b73ffffffffffffffffffffffffffffffffffffffff1614611300576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112f790613229565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611370576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611367906131a9565b60405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167f30909084afc859121ffc3a5aef7fe37c540a9a1ef60bd4d8dcdb76376fadf9de60405160405180910390a250565b600060016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b61147a611645565b73ffffffffffffffffffffffffffffffffffffffff16611498610e08565b73ffffffffffffffffffffffffffffffffffffffff16146114ee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114e590613229565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561155e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155590613129565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600033905090565b60006116d383836040516024016040516020818303038152906040529190604051611679929190612e4e565b60405180910390207bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611bc1565b905092915050565b61175c8363a9059cbb60e01b84846040516024016116fa929190612f64565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611c19565b505050565b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156117d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117c7906131c9565b60405180910390fd5b6117d981611ce0565b611818576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161180f906132e9565b60405180910390fd5b6000611824848461164d565b90508160016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff16817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163373ffffffffffffffffffffffffffffffffffffffff167f450397a2db0e89eccfe664cc6cdfd274a88bc00d29aaec4d991754a42f19f8c98787604051611935929190613063565b60405180910390a450505050565b600061196b836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611cf3565b905092915050565b60008061198a60008661198587611ad7565b611d63565b90508073ffffffffffffffffffffffffffffffffffffffff167efffc2da0b561cae30d9826d37709e9421c4725faebc226cbbb7ef5fc5e734960405160405180910390a26000835111156119e4576119e28184611e74565b505b809150509392505050565b6000611a17836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611ebe565b905092915050565b6000611a2d82600001611ee1565b9050919050565b6000611a438360000183611ef2565b60001c905092915050565b611ad1846323b872dd60e01b858585604051602401611a6f93929190612f2d565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611c19565b50505050565b60606000693d602d80600a3d3981f360b01b9050600069363d3d373d3d3d363d7360b01b905060008460601b905060006e5af43d82803e903d91602b57fd5bf360881b905083838383604051602001611b339493929190612d9b565b604051602081830303815290604052945050505050919050565b60008060ff60f81b838686604051602001611b6b9493929190612de9565b6040516020818303038152906040528051906020012090508060001c9150509392505050565b6000611bb9836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611f5f565b905092915050565b60006004825114611c07576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bfe90613249565b60405180910390fd5b60006020830151905080915050919050565b6060611c7b826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166120479092919063ffffffff16565b9050600081511115611cdb5780806020019051810190611c9b91906124b0565b611cda576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cd1906132a9565b60405180910390fd5b5b505050565b600080823b905060008111915050919050565b6000611cff8383611ebe565b611d58578260000182908060018154018082558091505060019003906000526020600020016000909190919091505582600001805490508360010160008481526020019081526020016000208190555060019050611d5d565b600090505b92915050565b60008084471015611da9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611da0906132c9565b60405180910390fd5b600083511415611dee576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611de5906130c9565b60405180910390fd5b8383516020850187f59050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611e69576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e60906131e9565b60405180910390fd5b809150509392505050565b6060611eb683836040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c65640000815250612047565b905092915050565b600080836001016000848152602001908152602001600020541415905092915050565b600081600001805490509050919050565b600081836000018054905011611f3d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f34906130a9565b60405180910390fd5b826000018281548110611f4c57fe5b9060005260206000200154905092915050565b6000808360010160008481526020019081526020016000205490506000811461203b5760006001820390506000600186600001805490500390506000866000018281548110611faa57fe5b9060005260206000200154905080876000018481548110611fc757fe5b9060005260206000200181905550600183018760010160008381526020019081526020016000208190555086600001805480611fff57fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050612041565b60009150505b92915050565b6060612056848460008561205f565b90509392505050565b6060824710156120a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161209b90613169565b60405180910390fd5b6120ad85611ce0565b6120ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120e390613289565b60405180910390fd5b600060608673ffffffffffffffffffffffffffffffffffffffff1685876040516121169190612e37565b60006040518083038185875af1925050503d8060008114612153576040519150601f19603f3d011682016040523d82523d6000602084013e612158565b606091505b5091509150612168828286612174565b92505050949350505050565b60608315612184578290506121d4565b6000835111156121975782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121cb9190613087565b60405180910390fd5b9392505050565b6000813590506121ea81613634565b92915050565b60008083601f84011261220257600080fd5b8235905067ffffffffffffffff81111561221b57600080fd5b60208301915083602082028301111561223357600080fd5b9250929050565b60008083601f84011261224c57600080fd5b8235905067ffffffffffffffff81111561226557600080fd5b60208301915083602082028301111561227d57600080fd5b9250929050565b6000815190506122938161364b565b92915050565b6000813590506122a881613662565b92915050565b6000813590506122bd81613679565b92915050565b6000813590506122d281613690565b92915050565b60008083601f8401126122ea57600080fd5b8235905067ffffffffffffffff81111561230357600080fd5b60208301915083600182028301111561231b57600080fd5b9250929050565b600081359050612331816136a0565b92915050565b600081519050612346816136a0565b92915050565b60006020828403121561235e57600080fd5b600061236c848285016121db565b91505092915050565b60008060008060008060008060006101208a8c03121561239457600080fd5b60006123a28c828d016121db565b99505060206123b38c828d016121db565b98505060406123c48c828d01612322565b97505060606123d58c828d01612322565b96505060806123e68c828d01612322565b95505060a06123f78c828d01612322565b94505060c06124088c828d01612322565b93505060e06124198c828d01612322565b92505061010061242b8c828d016122c3565b9150509295985092959850929598565b6000806000806040858703121561245157600080fd5b600085013567ffffffffffffffff81111561246b57600080fd5b6124778782880161223a565b9450945050602085013567ffffffffffffffff81111561249657600080fd5b6124a2878288016121f0565b925092505092959194509250565b6000602082840312156124c257600080fd5b60006124d084828501612284565b91505092915050565b600080604083850312156124ec57600080fd5b60006124fa85828601612299565b925050602061250b858286016121db565b9150509250929050565b60006020828403121561252757600080fd5b6000612535848285016122ae565b91505092915050565b6000806020838503121561255157600080fd5b600083013567ffffffffffffffff81111561256b57600080fd5b612577858286016122d8565b92509250509250929050565b60008060006040848603121561259857600080fd5b600084013567ffffffffffffffff8111156125b257600080fd5b6125be868287016122d8565b935093505060206125d1868287016121db565b9150509250925092565b6000602082840312156125ed57600080fd5b60006125fb84828501612322565b91505092915050565b60006020828403121561261657600080fd5b600061262484828501612337565b91505092915050565b60006126398383612645565b60208301905092915050565b61264e816133f1565b82525050565b61265d816133f1565b82525050565b61267461266f826133f1565b6135aa565b82525050565b60006126858261338b565b61268f81856133b9565b935061269a8361337b565b8060005b838110156126cb5781516126b2888261262d565b97506126bd836133ac565b92505060018101905061269e565b5085935050505092915050565b6126e181613403565b82525050565b6126f86126f38261343b565b6135c6565b82525050565b61270f61270a82613467565b6135d0565b82525050565b6127266127218261340f565b6135bc565b82525050565b61273d61273882613493565b6135da565b82525050565b61275461274f826134bf565b6135e4565b82525050565b600061276582613396565b61276f81856133ca565b935061277f818560208601613577565b80840191505092915050565b61279481613532565b82525050565b6127a381613556565b82525050565b60006127b583856133d5565b93506127c2838584613568565b6127cb83613602565b840190509392505050565b60006127e283856133e6565b93506127ef838584613568565b82840190509392505050565b6000612806826133a1565b61281081856133d5565b9350612820818560208601613577565b61282981613602565b840191505092915050565b60006128416022836133d5565b91507f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e60008301527f64730000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006128a76020836133d5565b91507f437265617465323a2062797465636f6465206c656e677468206973207a65726f6000830152602082019050919050565b60006128e76015836133d5565b91507f4172726179206c656e677468206d69736d6174636800000000000000000000006000830152602082019050919050565b6000612927601a836133d5565b91507f44657374696e6174696f6e2063616e6e6f74206265207a65726f0000000000006000830152602082019050919050565b60006129676026836133d5565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006129cd6020836133d5565b91507f4e6f7420656e6f75676820746f6b656e7320746f20637265617465206c6f636b6000830152602082019050919050565b6000612a0d6026836133d5565b91507f416464726573733a20696e73756666696369656e742062616c616e636520666f60008301527f722063616c6c00000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000612a73601b836133d5565b91507f44657374696e6174696f6e20616c72656164792072656d6f76656400000000006000830152602082019050919050565b6000612ab36019836133d5565b91507f4d6173746572436f70792063616e6e6f74206265207a65726f000000000000006000830152602082019050919050565b6000612af3601d836133d5565b91507f546172676574206d757374206265206f7468657220636f6e74726163740000006000830152602082019050919050565b6000612b336019836133d5565b91507f437265617465323a204661696c6564206f6e206465706c6f79000000000000006000830152602082019050919050565b6000612b736015836133d5565b91507f416d6f756e742063616e6e6f74206265207a65726f00000000000000000000006000830152602082019050919050565b6000612bb36020836133d5565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b6000612bf36018836133d5565b91507f496e76616c6964206d6574686f64207369676e617475726500000000000000006000830152602082019050919050565b6000612c336019836133d5565b91507f44657374696e6174696f6e20616c7265616479206164646564000000000000006000830152602082019050919050565b6000612c73601d836133d5565b91507f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006000830152602082019050919050565b6000612cb3602a836133d5565b91507f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008301527f6f742073756363656564000000000000000000000000000000000000000000006020830152604082019050919050565b6000612d19601d836133d5565b91507f437265617465323a20696e73756666696369656e742062616c616e63650000006000830152602082019050919050565b6000612d596019836133d5565b91507f546172676574206d757374206265206120636f6e7472616374000000000000006000830152602082019050919050565b612d9581613528565b82525050565b6000612da782876126e7565b600a82019150612db782866126e7565b600a82019150612dc7828561272c565b601482019150612dd782846126fe565b600f8201915081905095945050505050565b6000612df58287612715565b600182019150612e058286612663565b601482019150612e158285612743565b602082019150612e258284612743565b60208201915081905095945050505050565b6000612e43828461275a565b915081905092915050565b6000612e5b8284866127d6565b91508190509392505050565b6000602082019050612e7c6000830184612654565b92915050565b600061016082019050612e98600083018e612654565b612ea5602083018d612654565b612eb2604083018c612654565b612ebf606083018b612654565b612ecc608083018a612d8c565b612ed960a0830189612d8c565b612ee660c0830188612d8c565b612ef360e0830187612d8c565b612f01610100830186612d8c565b612f0f610120830185612d8c565b612f1d61014083018461279a565b9c9b505050505050505050505050565b6000606082019050612f426000830186612654565b612f4f6020830185612654565b612f5c6040830184612d8c565b949350505050565b6000604082019050612f796000830185612654565b612f866020830184612d8c565b9392505050565b600061010082019050612fa3600083018b612654565b612fb0602083018a612d8c565b612fbd6040830189612d8c565b612fca6060830188612d8c565b612fd76080830187612d8c565b612fe460a0830186612d8c565b612ff160c0830185612d8c565b612ffe60e083018461279a565b9998505050505050505050565b60006020820190508181036000830152613025818461267a565b905092915050565b600060208201905061304260008301846126d8565b92915050565b600060208201905061305d600083018461278b565b92915050565b6000602082019050818103600083015261307e8184866127a9565b90509392505050565b600060208201905081810360008301526130a181846127fb565b905092915050565b600060208201905081810360008301526130c281612834565b9050919050565b600060208201905081810360008301526130e28161289a565b9050919050565b60006020820190508181036000830152613102816128da565b9050919050565b600060208201905081810360008301526131228161291a565b9050919050565b600060208201905081810360008301526131428161295a565b9050919050565b60006020820190508181036000830152613162816129c0565b9050919050565b6000602082019050818103600083015261318281612a00565b9050919050565b600060208201905081810360008301526131a281612a66565b9050919050565b600060208201905081810360008301526131c281612aa6565b9050919050565b600060208201905081810360008301526131e281612ae6565b9050919050565b6000602082019050818103600083015261320281612b26565b9050919050565b6000602082019050818103600083015261322281612b66565b9050919050565b6000602082019050818103600083015261324281612ba6565b9050919050565b6000602082019050818103600083015261326281612be6565b9050919050565b6000602082019050818103600083015261328281612c26565b9050919050565b600060208201905081810360008301526132a281612c66565b9050919050565b600060208201905081810360008301526132c281612ca6565b9050919050565b600060208201905081810360008301526132e281612d0c565b9050919050565b6000602082019050818103600083015261330281612d4c565b9050919050565b600060208201905061331e6000830184612d8c565b92915050565b6000808335600160200384360303811261333d57600080fd5b80840192508235915067ffffffffffffffff82111561335b57600080fd5b60208301925060018202360383131561337357600080fd5b509250929050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b60006133fc82613508565b9050919050565b60008115159050919050565b60007fff0000000000000000000000000000000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffff0000000000000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffffffffffffff000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffffffffffffffffffffffff00000000000000000000000082169050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600081905061350382613620565b919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600061353d82613544565b9050919050565b600061354f82613508565b9050919050565b6000613561826134f5565b9050919050565b82818337600083830152505050565b60005b8381101561359557808201518184015260208101905061357a565b838111156135a4576000848401525b50505050565b60006135b5826135ee565b9050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b60006135f982613613565b9050919050565bfe5b6000601f19601f8301169050919050565b60008160601b9050919050565b6003811061363157613630613600565b5b50565b61363d816133f1565b811461364857600080fd5b50565b61365481613403565b811461365f57600080fd5b50565b61366b816134bf565b811461367657600080fd5b50565b613682816134c9565b811461368d57600080fd5b50565b6003811061369d57600080fd5b50565b6136a981613528565b81146136b457600080fd5b5056fea26469706673582212202d3d549e01583bc5460844b73df152769c2a77e8b1ca88724d847dbd95e3af7964736f6c63430007030033", + "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061012c5760003560e01c80639c05fc60116100ad578063c1ab13db11610071578063c1ab13db14610319578063cf497e6c14610335578063f1d24c4514610351578063f2fde38b14610381578063fc0c546a1461039d5761012c565b80639c05fc6014610275578063a345746614610291578063a619486e146102af578063b6b55f25146102cd578063bdb62fbe146102e95761012c565b806368d30c2e116100f457806368d30c2e146101d15780636e03b8dc146101ed578063715018a61461021d57806379ee1bdf146102275780638da5cb5b146102575761012c565b806303990a6c146101315780630602ba2b1461014d5780632e1a7d4d1461017d578063463013a2146101995780635975e00c146101b5575b600080fd5b61014b6004803603810190610146919061253e565b6103bb565b005b61016760048036038101906101629190612515565b610563565b604051610174919061302d565b60405180910390f35b610197600480360381019061019291906125db565b6105a4565b005b6101b360048036038101906101ae9190612583565b610701565b005b6101cf60048036038101906101ca919061234c565b61078d565b005b6101eb60048036038101906101e69190612375565b61091e565b005b61020760048036038101906102029190612515565b610c7e565b6040516102149190612e67565b60405180910390f35b610225610cb1565b005b610241600480360381019061023c919061234c565b610deb565b60405161024e919061302d565b60405180910390f35b61025f610e08565b60405161026c9190612e67565b60405180910390f35b61028f600480360381019061028a919061243b565b610e31565b005b610299610f5e565b6040516102a6919061300b565b60405180910390f35b6102b7611036565b6040516102c49190612e67565b60405180910390f35b6102e760048036038101906102e291906125db565b61105c565b005b61030360048036038101906102fe91906124d9565b61113f565b6040516103109190612e67565b60405180910390f35b610333600480360381019061032e919061234c565b611163565b005b61034f600480360381019061034a919061234c565b611284565b005b61036b60048036038101906103669190612515565b6113f7565b6040516103789190612e67565b60405180910390f35b61039b6004803603810190610396919061234c565b611472565b005b6103a561161b565b6040516103b29190613048565b60405180910390f35b6103c3611645565b73ffffffffffffffffffffffffffffffffffffffff166103e1610e08565b73ffffffffffffffffffffffffffffffffffffffff1614610437576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042e90613229565b60405180910390fd5b6000610443838361164d565b9050600060016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff16817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163373ffffffffffffffffffffffffffffffffffffffff167f450397a2db0e89eccfe664cc6cdfd274a88bc00d29aaec4d991754a42f19f8c98686604051610556929190613063565b60405180910390a4505050565b60008073ffffffffffffffffffffffffffffffffffffffff16610585836113f7565b73ffffffffffffffffffffffffffffffffffffffff1614159050919050565b6105ac611645565b73ffffffffffffffffffffffffffffffffffffffff166105ca610e08565b73ffffffffffffffffffffffffffffffffffffffff1614610620576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161061790613229565b60405180910390fd5b60008111610663576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161065a90613209565b60405180910390fd5b6106b03382600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166116db9092919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b826040516106f69190613309565b60405180910390a250565b610709611645565b73ffffffffffffffffffffffffffffffffffffffff16610727610e08565b73ffffffffffffffffffffffffffffffffffffffff161461077d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077490613229565b60405180910390fd5b610788838383611761565b505050565b610795611645565b73ffffffffffffffffffffffffffffffffffffffff166107b3610e08565b73ffffffffffffffffffffffffffffffffffffffff1614610809576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080090613229565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610879576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161087090613109565b60405180910390fd5b61088d81600261194390919063ffffffff16565b6108cc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108c390613269565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f33442b8c13e72dd75a027f08f9bff4eed2dfd26e43cdea857365f5163b359a796001604051610913919061302d565b60405180910390a250565b610926611645565b73ffffffffffffffffffffffffffffffffffffffff16610944610e08565b73ffffffffffffffffffffffffffffffffffffffff161461099a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161099190613229565b60405180910390fd5b86600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016109f69190612e67565b60206040518083038186803b158015610a0e57600080fd5b505afa158015610a22573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a469190612604565b1015610a87576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7e90613149565b60405180910390fd5b6060308a8a600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168b8b8b8b8b8b8b604051602401610ad09b9a99989796959493929190612e82565b6040516020818303038152906040527fbd896dcb000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505090506000610b858280519060200120600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611973565b9050610bd4818a600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166116db9092919063ffffffff16565b8973ffffffffffffffffffffffffffffffffffffffff1682805190602001208273ffffffffffffffffffffffffffffffffffffffff167f3c7ff6acee351ed98200c285a04745858a107e16da2f13c3a81a43073c17d644600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168d8d8d8d8d8d8d604051610c69989796959493929190612f8d565b60405180910390a45050505050505050505050565b60016020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610cb9611645565b73ffffffffffffffffffffffffffffffffffffffff16610cd7610e08565b73ffffffffffffffffffffffffffffffffffffffff1614610d2d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d2490613229565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000610e018260026119ef90919063ffffffff16565b9050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610e39611645565b73ffffffffffffffffffffffffffffffffffffffff16610e57610e08565b73ffffffffffffffffffffffffffffffffffffffff1614610ead576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ea490613229565b60405180910390fd5b818190508484905014610ef5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eec906130e9565b60405180910390fd5b60005b84849050811015610f5757610f4a858583818110610f1257fe5b9050602002810190610f249190613324565b858585818110610f3057fe5b9050602002016020810190610f45919061234c565b611761565b8080600101915050610ef8565b5050505050565b606080610f6b6002611a1f565b67ffffffffffffffff81118015610f8157600080fd5b50604051908082528060200260200182016040528015610fb05781602001602082028036833780820191505090505b50905060005b610fc06002611a1f565b81101561102e57610fdb816002611a3490919063ffffffff16565b828281518110610fe757fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508080600101915050610fb6565b508091505090565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000811161109f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161109690613209565b60405180910390fd5b6110ee333083600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611a4e909392919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f59062170a285eb80e8c6b8ced60428442a51910635005233fc4ce084a475845e826040516111349190613309565b60405180910390a250565b600061115b8361114e84611ad7565b8051906020012030611b4d565b905092915050565b61116b611645565b73ffffffffffffffffffffffffffffffffffffffff16611189610e08565b73ffffffffffffffffffffffffffffffffffffffff16146111df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111d690613229565b60405180910390fd5b6111f3816002611b9190919063ffffffff16565b611232576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161122990613189565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f33442b8c13e72dd75a027f08f9bff4eed2dfd26e43cdea857365f5163b359a796000604051611279919061302d565b60405180910390a250565b61128c611645565b73ffffffffffffffffffffffffffffffffffffffff166112aa610e08565b73ffffffffffffffffffffffffffffffffffffffff1614611300576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112f790613229565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611370576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611367906131a9565b60405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167f30909084afc859121ffc3a5aef7fe37c540a9a1ef60bd4d8dcdb76376fadf9de60405160405180910390a250565b600060016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b61147a611645565b73ffffffffffffffffffffffffffffffffffffffff16611498610e08565b73ffffffffffffffffffffffffffffffffffffffff16146114ee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114e590613229565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561155e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155590613129565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600033905090565b60006116d383836040516024016040516020818303038152906040529190604051611679929190612e4e565b60405180910390207bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611bc1565b905092915050565b61175c8363a9059cbb60e01b84846040516024016116fa929190612f64565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611c19565b505050565b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156117d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117c7906131c9565b60405180910390fd5b6117d981611ce0565b611818576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161180f906132e9565b60405180910390fd5b6000611824848461164d565b90508160016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff16817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163373ffffffffffffffffffffffffffffffffffffffff167f450397a2db0e89eccfe664cc6cdfd274a88bc00d29aaec4d991754a42f19f8c98787604051611935929190613063565b60405180910390a450505050565b600061196b836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611cf3565b905092915050565b60008061198a60008661198587611ad7565b611d63565b90508073ffffffffffffffffffffffffffffffffffffffff167efffc2da0b561cae30d9826d37709e9421c4725faebc226cbbb7ef5fc5e734960405160405180910390a26000835111156119e4576119e28184611e74565b505b809150509392505050565b6000611a17836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611ebe565b905092915050565b6000611a2d82600001611ee1565b9050919050565b6000611a438360000183611ef2565b60001c905092915050565b611ad1846323b872dd60e01b858585604051602401611a6f93929190612f2d565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611c19565b50505050565b60606000693d602d80600a3d3981f360b01b9050600069363d3d373d3d3d363d7360b01b905060008460601b905060006e5af43d82803e903d91602b57fd5bf360881b905083838383604051602001611b339493929190612d9b565b604051602081830303815290604052945050505050919050565b60008060ff60f81b838686604051602001611b6b9493929190612de9565b6040516020818303038152906040528051906020012090508060001c9150509392505050565b6000611bb9836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611f5f565b905092915050565b60006004825114611c07576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bfe90613249565b60405180910390fd5b60006020830151905080915050919050565b6060611c7b826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166120479092919063ffffffff16565b9050600081511115611cdb5780806020019051810190611c9b91906124b0565b611cda576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cd1906132a9565b60405180910390fd5b5b505050565b600080823b905060008111915050919050565b6000611cff8383611ebe565b611d58578260000182908060018154018082558091505060019003906000526020600020016000909190919091505582600001805490508360010160008481526020019081526020016000208190555060019050611d5d565b600090505b92915050565b60008084471015611da9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611da0906132c9565b60405180910390fd5b600083511415611dee576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611de5906130c9565b60405180910390fd5b8383516020850187f59050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611e69576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e60906131e9565b60405180910390fd5b809150509392505050565b6060611eb683836040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c65640000815250612047565b905092915050565b600080836001016000848152602001908152602001600020541415905092915050565b600081600001805490509050919050565b600081836000018054905011611f3d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f34906130a9565b60405180910390fd5b826000018281548110611f4c57fe5b9060005260206000200154905092915050565b6000808360010160008481526020019081526020016000205490506000811461203b5760006001820390506000600186600001805490500390506000866000018281548110611faa57fe5b9060005260206000200154905080876000018481548110611fc757fe5b9060005260206000200181905550600183018760010160008381526020019081526020016000208190555086600001805480611fff57fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050612041565b60009150505b92915050565b6060612056848460008561205f565b90509392505050565b6060824710156120a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161209b90613169565b60405180910390fd5b6120ad85611ce0565b6120ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120e390613289565b60405180910390fd5b600060608673ffffffffffffffffffffffffffffffffffffffff1685876040516121169190612e37565b60006040518083038185875af1925050503d8060008114612153576040519150601f19603f3d011682016040523d82523d6000602084013e612158565b606091505b5091509150612168828286612174565b92505050949350505050565b60608315612184578290506121d4565b6000835111156121975782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121cb9190613087565b60405180910390fd5b9392505050565b6000813590506121ea81613634565b92915050565b60008083601f84011261220257600080fd5b8235905067ffffffffffffffff81111561221b57600080fd5b60208301915083602082028301111561223357600080fd5b9250929050565b60008083601f84011261224c57600080fd5b8235905067ffffffffffffffff81111561226557600080fd5b60208301915083602082028301111561227d57600080fd5b9250929050565b6000815190506122938161364b565b92915050565b6000813590506122a881613662565b92915050565b6000813590506122bd81613679565b92915050565b6000813590506122d281613690565b92915050565b60008083601f8401126122ea57600080fd5b8235905067ffffffffffffffff81111561230357600080fd5b60208301915083600182028301111561231b57600080fd5b9250929050565b600081359050612331816136a0565b92915050565b600081519050612346816136a0565b92915050565b60006020828403121561235e57600080fd5b600061236c848285016121db565b91505092915050565b60008060008060008060008060006101208a8c03121561239457600080fd5b60006123a28c828d016121db565b99505060206123b38c828d016121db565b98505060406123c48c828d01612322565b97505060606123d58c828d01612322565b96505060806123e68c828d01612322565b95505060a06123f78c828d01612322565b94505060c06124088c828d01612322565b93505060e06124198c828d01612322565b92505061010061242b8c828d016122c3565b9150509295985092959850929598565b6000806000806040858703121561245157600080fd5b600085013567ffffffffffffffff81111561246b57600080fd5b6124778782880161223a565b9450945050602085013567ffffffffffffffff81111561249657600080fd5b6124a2878288016121f0565b925092505092959194509250565b6000602082840312156124c257600080fd5b60006124d084828501612284565b91505092915050565b600080604083850312156124ec57600080fd5b60006124fa85828601612299565b925050602061250b858286016121db565b9150509250929050565b60006020828403121561252757600080fd5b6000612535848285016122ae565b91505092915050565b6000806020838503121561255157600080fd5b600083013567ffffffffffffffff81111561256b57600080fd5b612577858286016122d8565b92509250509250929050565b60008060006040848603121561259857600080fd5b600084013567ffffffffffffffff8111156125b257600080fd5b6125be868287016122d8565b935093505060206125d1868287016121db565b9150509250925092565b6000602082840312156125ed57600080fd5b60006125fb84828501612322565b91505092915050565b60006020828403121561261657600080fd5b600061262484828501612337565b91505092915050565b60006126398383612645565b60208301905092915050565b61264e816133f1565b82525050565b61265d816133f1565b82525050565b61267461266f826133f1565b6135aa565b82525050565b60006126858261338b565b61268f81856133b9565b935061269a8361337b565b8060005b838110156126cb5781516126b2888261262d565b97506126bd836133ac565b92505060018101905061269e565b5085935050505092915050565b6126e181613403565b82525050565b6126f86126f38261343b565b6135c6565b82525050565b61270f61270a82613467565b6135d0565b82525050565b6127266127218261340f565b6135bc565b82525050565b61273d61273882613493565b6135da565b82525050565b61275461274f826134bf565b6135e4565b82525050565b600061276582613396565b61276f81856133ca565b935061277f818560208601613577565b80840191505092915050565b61279481613532565b82525050565b6127a381613556565b82525050565b60006127b583856133d5565b93506127c2838584613568565b6127cb83613602565b840190509392505050565b60006127e283856133e6565b93506127ef838584613568565b82840190509392505050565b6000612806826133a1565b61281081856133d5565b9350612820818560208601613577565b61282981613602565b840191505092915050565b60006128416022836133d5565b91507f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e60008301527f64730000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006128a76020836133d5565b91507f437265617465323a2062797465636f6465206c656e677468206973207a65726f6000830152602082019050919050565b60006128e76015836133d5565b91507f4172726179206c656e677468206d69736d6174636800000000000000000000006000830152602082019050919050565b6000612927601a836133d5565b91507f44657374696e6174696f6e2063616e6e6f74206265207a65726f0000000000006000830152602082019050919050565b60006129676026836133d5565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006129cd6020836133d5565b91507f4e6f7420656e6f75676820746f6b656e7320746f20637265617465206c6f636b6000830152602082019050919050565b6000612a0d6026836133d5565b91507f416464726573733a20696e73756666696369656e742062616c616e636520666f60008301527f722063616c6c00000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000612a73601b836133d5565b91507f44657374696e6174696f6e20616c72656164792072656d6f76656400000000006000830152602082019050919050565b6000612ab36019836133d5565b91507f4d6173746572436f70792063616e6e6f74206265207a65726f000000000000006000830152602082019050919050565b6000612af3601d836133d5565b91507f546172676574206d757374206265206f7468657220636f6e74726163740000006000830152602082019050919050565b6000612b336019836133d5565b91507f437265617465323a204661696c6564206f6e206465706c6f79000000000000006000830152602082019050919050565b6000612b736015836133d5565b91507f416d6f756e742063616e6e6f74206265207a65726f00000000000000000000006000830152602082019050919050565b6000612bb36020836133d5565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b6000612bf36018836133d5565b91507f496e76616c6964206d6574686f64207369676e617475726500000000000000006000830152602082019050919050565b6000612c336019836133d5565b91507f44657374696e6174696f6e20616c7265616479206164646564000000000000006000830152602082019050919050565b6000612c73601d836133d5565b91507f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006000830152602082019050919050565b6000612cb3602a836133d5565b91507f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008301527f6f742073756363656564000000000000000000000000000000000000000000006020830152604082019050919050565b6000612d19601d836133d5565b91507f437265617465323a20696e73756666696369656e742062616c616e63650000006000830152602082019050919050565b6000612d596019836133d5565b91507f546172676574206d757374206265206120636f6e7472616374000000000000006000830152602082019050919050565b612d9581613528565b82525050565b6000612da782876126e7565b600a82019150612db782866126e7565b600a82019150612dc7828561272c565b601482019150612dd782846126fe565b600f8201915081905095945050505050565b6000612df58287612715565b600182019150612e058286612663565b601482019150612e158285612743565b602082019150612e258284612743565b60208201915081905095945050505050565b6000612e43828461275a565b915081905092915050565b6000612e5b8284866127d6565b91508190509392505050565b6000602082019050612e7c6000830184612654565b92915050565b600061016082019050612e98600083018e612654565b612ea5602083018d612654565b612eb2604083018c612654565b612ebf606083018b612654565b612ecc608083018a612d8c565b612ed960a0830189612d8c565b612ee660c0830188612d8c565b612ef360e0830187612d8c565b612f01610100830186612d8c565b612f0f610120830185612d8c565b612f1d61014083018461279a565b9c9b505050505050505050505050565b6000606082019050612f426000830186612654565b612f4f6020830185612654565b612f5c6040830184612d8c565b949350505050565b6000604082019050612f796000830185612654565b612f866020830184612d8c565b9392505050565b600061010082019050612fa3600083018b612654565b612fb0602083018a612d8c565b612fbd6040830189612d8c565b612fca6060830188612d8c565b612fd76080830187612d8c565b612fe460a0830186612d8c565b612ff160c0830185612d8c565b612ffe60e083018461279a565b9998505050505050505050565b60006020820190508181036000830152613025818461267a565b905092915050565b600060208201905061304260008301846126d8565b92915050565b600060208201905061305d600083018461278b565b92915050565b6000602082019050818103600083015261307e8184866127a9565b90509392505050565b600060208201905081810360008301526130a181846127fb565b905092915050565b600060208201905081810360008301526130c281612834565b9050919050565b600060208201905081810360008301526130e28161289a565b9050919050565b60006020820190508181036000830152613102816128da565b9050919050565b600060208201905081810360008301526131228161291a565b9050919050565b600060208201905081810360008301526131428161295a565b9050919050565b60006020820190508181036000830152613162816129c0565b9050919050565b6000602082019050818103600083015261318281612a00565b9050919050565b600060208201905081810360008301526131a281612a66565b9050919050565b600060208201905081810360008301526131c281612aa6565b9050919050565b600060208201905081810360008301526131e281612ae6565b9050919050565b6000602082019050818103600083015261320281612b26565b9050919050565b6000602082019050818103600083015261322281612b66565b9050919050565b6000602082019050818103600083015261324281612ba6565b9050919050565b6000602082019050818103600083015261326281612be6565b9050919050565b6000602082019050818103600083015261328281612c26565b9050919050565b600060208201905081810360008301526132a281612c66565b9050919050565b600060208201905081810360008301526132c281612ca6565b9050919050565b600060208201905081810360008301526132e281612d0c565b9050919050565b6000602082019050818103600083015261330281612d4c565b9050919050565b600060208201905061331e6000830184612d8c565b92915050565b6000808335600160200384360303811261333d57600080fd5b80840192508235915067ffffffffffffffff82111561335b57600080fd5b60208301925060018202360383131561337357600080fd5b509250929050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b60006133fc82613508565b9050919050565b60008115159050919050565b60007fff0000000000000000000000000000000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffff0000000000000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffffffffffffff000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffffffffffffffffffffffff00000000000000000000000082169050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600081905061350382613620565b919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600061353d82613544565b9050919050565b600061354f82613508565b9050919050565b6000613561826134f5565b9050919050565b82818337600083830152505050565b60005b8381101561359557808201518184015260208101905061357a565b838111156135a4576000848401525b50505050565b60006135b5826135ee565b9050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b60006135f982613613565b9050919050565bfe5b6000601f19601f8301169050919050565b60008160601b9050919050565b6003811061363157613630613600565b5b50565b61363d816133f1565b811461364857600080fd5b50565b61365481613403565b811461365f57600080fd5b50565b61366b816134bf565b811461367657600080fd5b50565b613682816134c9565b811461368d57600080fd5b50565b6003811061369d57600080fd5b50565b6136a981613528565b81146136b457600080fd5b5056fea26469706673582212202d3d549e01583bc5460844b73df152769c2a77e8b1ca88724d847dbd95e3af7964736f6c63430007030033", + "devdoc": { + "kind": "dev", + "methods": { + "addTokenDestination(address)": { + "params": { + "_dst": "Destination address" + } + }, + "constructor": { + "params": { + "_graphToken": "Token to use for deposits and withdrawals", + "_masterCopy": "Address of the master copy to use to clone proxies" + } + }, + "createTokenLockWallet(address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)": { + "params": { + "_beneficiary": "Address of the beneficiary of locked tokens", + "_endTime": "End time of the release schedule", + "_managedAmount": "Amount of tokens to be managed by the lock contract", + "_owner": "Address of the contract owner", + "_periods": "Number of periods between start time and end time", + "_releaseStartTime": "Override time for when the releases start", + "_revocable": "Whether the contract is revocable", + "_startTime": "Start time of the release schedule" + } + }, + "deposit(uint256)": { + "details": "Even if the ERC20 token can be transferred directly to the contract this function provide a safe interface to do the transfer and avoid mistakes", + "params": { + "_amount": "Amount to deposit" + } + }, + "getAuthFunctionCallTarget(bytes4)": { + "params": { + "_sigHash": "Function signature hash" + }, + "returns": { + "_0": "Address of the target contract where to send the call" + } + }, + "getDeploymentAddress(bytes32,address)": { + "params": { + "_implementation": "Address of the proxy target implementation", + "_salt": "Bytes32 salt to use for CREATE2" + }, + "returns": { + "_0": "Address of the counterfactual MinimalProxy" + } + }, + "getTokenDestinations()": { + "returns": { + "_0": "Array of addresses authorized to pull funds from a token lock" + } + }, + "isAuthFunctionCall(bytes4)": { + "params": { + "_sigHash": "Function signature hash" + }, + "returns": { + "_0": "True if authorized" + } + }, + "isTokenDestination(address)": { + "params": { + "_dst": "Destination address" + }, + "returns": { + "_0": "True if authorized" + } + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "removeTokenDestination(address)": { + "params": { + "_dst": "Destination address" + } + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." + }, + "setAuthFunctionCall(string,address)": { + "details": "Input expected is the function signature as 'transfer(address,uint256)'", + "params": { + "_signature": "Function signature", + "_target": "Address of the destination contract to call" + } + }, + "setAuthFunctionCallMany(string[],address[])": { + "details": "Input expected is the function signature as 'transfer(address,uint256)'", + "params": { + "_signatures": "Function signatures", + "_targets": "Address of the destination contract to call" + } + }, + "setMasterCopy(address)": { + "params": { + "_masterCopy": "Address of contract bytecode to factory clone" + } + }, + "token()": { + "returns": { + "_0": "Token used for transfers and approvals" + } + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + }, + "unsetAuthFunctionCall(string)": { + "details": "Input expected is the function signature as 'transfer(address,uint256)'", + "params": { + "_signature": "Function signature" + } + }, + "withdraw(uint256)": { + "details": "Escape hatch in case of mistakes or to recover remaining funds", + "params": { + "_amount": "Amount of tokens to withdraw" + } + } + }, + "title": "GraphTokenLockManager", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "addTokenDestination(address)": { + "notice": "Adds an address that can be allowed by a token lock to pull funds" + }, + "constructor": { + "notice": "Constructor." + }, + "createTokenLockWallet(address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)": { + "notice": "Creates and fund a new token lock wallet using a minimum proxy" + }, + "deposit(uint256)": { + "notice": "Deposits tokens into the contract" + }, + "getAuthFunctionCallTarget(bytes4)": { + "notice": "Gets the target contract to call for a particular function signature" + }, + "getDeploymentAddress(bytes32,address)": { + "notice": "Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation" + }, + "getTokenDestinations()": { + "notice": "Returns an array of authorized destination addresses" + }, + "isAuthFunctionCall(bytes4)": { + "notice": "Returns true if the function call is authorized" + }, + "isTokenDestination(address)": { + "notice": "Returns True if the address is authorized to be a destination of tokens" + }, + "removeTokenDestination(address)": { + "notice": "Removes an address that can be allowed by a token lock to pull funds" + }, + "setAuthFunctionCall(string,address)": { + "notice": "Sets an authorized function call to target" + }, + "setAuthFunctionCallMany(string[],address[])": { + "notice": "Sets an authorized function call to target in bulk" + }, + "setMasterCopy(address)": { + "notice": "Sets the masterCopy bytecode to use to create clones of TokenLock contracts" + }, + "token()": { + "notice": "Gets the GRT token address" + }, + "unsetAuthFunctionCall(string)": { + "notice": "Unsets an authorized function call to target" + }, + "withdraw(uint256)": { + "notice": "Withdraws tokens from the contract" + } + }, + "notice": "This contract manages a list of authorized function calls and targets that can be called by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts. This contract receives funds to make the process of creating TokenLockWallet contracts easier by distributing them the initial tokens to be managed. The owner can setup a list of token destinations that will be used by TokenLock contracts to approve the pulling of funds, this way in can be guaranteed that only protocol contracts will manipulate users funds.", + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 7, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "_owner", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 3316, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "authFnCalls", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_bytes4,t_address)" + }, + { + "astId": 3318, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "_tokenDestinations", + "offset": 0, + "slot": "2", + "type": "t_struct(AddressSet)1964_storage" + }, + { + "astId": 3320, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "masterCopy", + "offset": 0, + "slot": "4", + "type": "t_address" + }, + { + "astId": 3322, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "_token", + "offset": 0, + "slot": "5", + "type": "t_contract(IERC20)1045" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_bytes32)dyn_storage": { + "base": "t_bytes32", + "encoding": "dynamic_array", + "label": "bytes32[]", + "numberOfBytes": "32" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_bytes4": { + "encoding": "inplace", + "label": "bytes4", + "numberOfBytes": "4" + }, + "t_contract(IERC20)1045": { + "encoding": "inplace", + "label": "contract IERC20", + "numberOfBytes": "20" + }, + "t_mapping(t_bytes32,t_uint256)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_mapping(t_bytes4,t_address)": { + "encoding": "mapping", + "key": "t_bytes4", + "label": "mapping(bytes4 => address)", + "numberOfBytes": "32", + "value": "t_address" + }, + "t_struct(AddressSet)1964_storage": { + "encoding": "inplace", + "label": "struct EnumerableSet.AddressSet", + "members": [ + { + "astId": 1963, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "_inner", + "offset": 0, + "slot": "0", + "type": "t_struct(Set)1699_storage" + } + ], + "numberOfBytes": "64" + }, + "t_struct(Set)1699_storage": { + "encoding": "inplace", + "label": "struct EnumerableSet.Set", + "members": [ + { + "astId": 1694, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "_values", + "offset": 0, + "slot": "0", + "type": "t_array(t_bytes32)dyn_storage" + }, + { + "astId": 1698, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "_indexes", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_bytes32,t_uint256)" + } + ], + "numberOfBytes": "64" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} \ No newline at end of file diff --git a/packages/token-distribution/deployments/mainnet/GraphTokenLockManager-MIPs.json b/packages/token-distribution/deployments/mainnet/GraphTokenLockManager-MIPs.json new file mode 100644 index 000000000..65386d2ee --- /dev/null +++ b/packages/token-distribution/deployments/mainnet/GraphTokenLockManager-MIPs.json @@ -0,0 +1,932 @@ +{ + "address": "0xDC55A8e2c592ced19D9Fd0f9f1083D4FD5a48031", + "abi": [ + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_graphToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_masterCopy", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes4", + "name": "sigHash", + "type": "bytes4" + }, + { + "indexed": true, + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "indexed": false, + "internalType": "string", + "name": "signature", + "type": "string" + } + ], + "name": "FunctionCallAuth", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "masterCopy", + "type": "address" + } + ], + "name": "MasterCopyUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "proxy", + "type": "address" + } + ], + "name": "ProxyCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "dst", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "TokenDestinationAllowed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "contractAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "initHash", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "managedAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "startTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "endTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "periods", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "releaseStartTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "vestingCliffTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "enum IGraphTokenLock.Revocability", + "name": "revocable", + "type": "uint8" + } + ], + "name": "TokenLockCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensDeposited", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensWithdrawn", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_dst", + "type": "address" + } + ], + "name": "addTokenDestination", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "", + "type": "bytes4" + } + ], + "name": "authFnCalls", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_owner", + "type": "address" + }, + { + "internalType": "address", + "name": "_beneficiary", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_managedAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_startTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_endTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_periods", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_releaseStartTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_vestingCliffTime", + "type": "uint256" + }, + { + "internalType": "enum IGraphTokenLock.Revocability", + "name": "_revocable", + "type": "uint8" + } + ], + "name": "createTokenLockWallet", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "deposit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_sigHash", + "type": "bytes4" + } + ], + "name": "getAuthFunctionCallTarget", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_salt", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "_implementation", + "type": "address" + }, + { + "internalType": "address", + "name": "_deployer", + "type": "address" + } + ], + "name": "getDeploymentAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "getTokenDestinations", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_sigHash", + "type": "bytes4" + } + ], + "name": "isAuthFunctionCall", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_dst", + "type": "address" + } + ], + "name": "isTokenDestination", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "masterCopy", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_dst", + "type": "address" + } + ], + "name": "removeTokenDestination", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_signature", + "type": "string" + }, + { + "internalType": "address", + "name": "_target", + "type": "address" + } + ], + "name": "setAuthFunctionCall", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string[]", + "name": "_signatures", + "type": "string[]" + }, + { + "internalType": "address[]", + "name": "_targets", + "type": "address[]" + } + ], + "name": "setAuthFunctionCallMany", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_masterCopy", + "type": "address" + } + ], + "name": "setMasterCopy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "token", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_signature", + "type": "string" + } + ], + "name": "unsetAuthFunctionCall", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0xa64e2e41c754b1098137b367ff1c83bf7b0de0d632d194ae82132b5b1fcc0a83", + "receipt": { + "to": null, + "from": "0x8e623680d81372926a5878f544ceFE30B35BD9a0", + "contractAddress": "0xDC55A8e2c592ced19D9Fd0f9f1083D4FD5a48031", + "transactionIndex": 10, + "gasUsed": "3166762", + "logsBloom": "0x00000000000000000000000000000000000004000000000000800000000000000000000000000000001000000000000000000000100000000000000000000000000000000000000000000002000000000001000000000000010000400000000000000040020000000000000000000800000000000000000000000000000000400000000000800000040000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000020000020000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x1803dacb914fcad724814b7ca2a85d08c6b6d389ea6dd9b0efc8777cea154379", + "transactionHash": "0xa64e2e41c754b1098137b367ff1c83bf7b0de0d632d194ae82132b5b1fcc0a83", + "logs": [ + { + "transactionIndex": 10, + "blockNumber": 17743222, + "transactionHash": "0xa64e2e41c754b1098137b367ff1c83bf7b0de0d632d194ae82132b5b1fcc0a83", + "address": "0xDC55A8e2c592ced19D9Fd0f9f1083D4FD5a48031", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000008e623680d81372926a5878f544cefe30b35bd9a0" + ], + "data": "0x", + "logIndex": 62, + "blockHash": "0x1803dacb914fcad724814b7ca2a85d08c6b6d389ea6dd9b0efc8777cea154379" + }, + { + "transactionIndex": 10, + "blockNumber": 17743222, + "transactionHash": "0xa64e2e41c754b1098137b367ff1c83bf7b0de0d632d194ae82132b5b1fcc0a83", + "address": "0xDC55A8e2c592ced19D9Fd0f9f1083D4FD5a48031", + "topics": [ + "0x30909084afc859121ffc3a5aef7fe37c540a9a1ef60bd4d8dcdb76376fadf9de", + "0x0000000000000000000000001231a8579ca4208f8ae6fecc6c96bf935b73487d" + ], + "data": "0x", + "logIndex": 63, + "blockHash": "0x1803dacb914fcad724814b7ca2a85d08c6b6d389ea6dd9b0efc8777cea154379" + } + ], + "blockNumber": 17743222, + "cumulativeGasUsed": "4803790", + "status": 1, + "byzantium": true + }, + "args": [ + "0xc944E90C64B2c07662A292be6244BDf05Cda44a7", + "0x1231A8579CA4208F8AE6fecC6c96bf935B73487D" + ], + "solcInputHash": "b5cdad58099d39cd1aed000b2fd864d8", + "metadata": "{\"compiler\":{\"version\":\"0.7.3+commit.9bfce1f6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"_graphToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_masterCopy\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes4\",\"name\":\"sigHash\",\"type\":\"bytes4\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"signature\",\"type\":\"string\"}],\"name\":\"FunctionCallAuth\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"masterCopy\",\"type\":\"address\"}],\"name\":\"MasterCopyUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"proxy\",\"type\":\"address\"}],\"name\":\"ProxyCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dst\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"}],\"name\":\"TokenDestinationAllowed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"contractAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"initHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"managedAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"startTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"endTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"periods\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"releaseStartTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"vestingCliffTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"enum IGraphTokenLock.Revocability\",\"name\":\"revocable\",\"type\":\"uint8\"}],\"name\":\"TokenLockCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensWithdrawn\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_dst\",\"type\":\"address\"}],\"name\":\"addTokenDestination\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"name\":\"authFnCalls\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_beneficiary\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_managedAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_startTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_endTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_periods\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_releaseStartTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_vestingCliffTime\",\"type\":\"uint256\"},{\"internalType\":\"enum IGraphTokenLock.Revocability\",\"name\":\"_revocable\",\"type\":\"uint8\"}],\"name\":\"createTokenLockWallet\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"deposit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"_sigHash\",\"type\":\"bytes4\"}],\"name\":\"getAuthFunctionCallTarget\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_salt\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_deployer\",\"type\":\"address\"}],\"name\":\"getDeploymentAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTokenDestinations\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"_sigHash\",\"type\":\"bytes4\"}],\"name\":\"isAuthFunctionCall\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_dst\",\"type\":\"address\"}],\"name\":\"isTokenDestination\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"masterCopy\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_dst\",\"type\":\"address\"}],\"name\":\"removeTokenDestination\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_signature\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"_target\",\"type\":\"address\"}],\"name\":\"setAuthFunctionCall\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string[]\",\"name\":\"_signatures\",\"type\":\"string[]\"},{\"internalType\":\"address[]\",\"name\":\"_targets\",\"type\":\"address[]\"}],\"name\":\"setAuthFunctionCallMany\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_masterCopy\",\"type\":\"address\"}],\"name\":\"setMasterCopy\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_signature\",\"type\":\"string\"}],\"name\":\"unsetAuthFunctionCall\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"addTokenDestination(address)\":{\"params\":{\"_dst\":\"Destination address\"}},\"constructor\":{\"params\":{\"_graphToken\":\"Token to use for deposits and withdrawals\",\"_masterCopy\":\"Address of the master copy to use to clone proxies\"}},\"createTokenLockWallet(address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)\":{\"params\":{\"_beneficiary\":\"Address of the beneficiary of locked tokens\",\"_endTime\":\"End time of the release schedule\",\"_managedAmount\":\"Amount of tokens to be managed by the lock contract\",\"_owner\":\"Address of the contract owner\",\"_periods\":\"Number of periods between start time and end time\",\"_releaseStartTime\":\"Override time for when the releases start\",\"_revocable\":\"Whether the contract is revocable\",\"_startTime\":\"Start time of the release schedule\"}},\"deposit(uint256)\":{\"details\":\"Even if the ERC20 token can be transferred directly to the contract this function provide a safe interface to do the transfer and avoid mistakes\",\"params\":{\"_amount\":\"Amount to deposit\"}},\"getAuthFunctionCallTarget(bytes4)\":{\"params\":{\"_sigHash\":\"Function signature hash\"},\"returns\":{\"_0\":\"Address of the target contract where to send the call\"}},\"getDeploymentAddress(bytes32,address,address)\":{\"params\":{\"_deployer\":\"Address of the deployer that creates the contract\",\"_implementation\":\"Address of the proxy target implementation\",\"_salt\":\"Bytes32 salt to use for CREATE2\"},\"returns\":{\"_0\":\"Address of the counterfactual MinimalProxy\"}},\"getTokenDestinations()\":{\"returns\":{\"_0\":\"Array of addresses authorized to pull funds from a token lock\"}},\"isAuthFunctionCall(bytes4)\":{\"params\":{\"_sigHash\":\"Function signature hash\"},\"returns\":{\"_0\":\"True if authorized\"}},\"isTokenDestination(address)\":{\"params\":{\"_dst\":\"Destination address\"},\"returns\":{\"_0\":\"True if authorized\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"removeTokenDestination(address)\":{\"params\":{\"_dst\":\"Destination address\"}},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"setAuthFunctionCall(string,address)\":{\"details\":\"Input expected is the function signature as 'transfer(address,uint256)'\",\"params\":{\"_signature\":\"Function signature\",\"_target\":\"Address of the destination contract to call\"}},\"setAuthFunctionCallMany(string[],address[])\":{\"details\":\"Input expected is the function signature as 'transfer(address,uint256)'\",\"params\":{\"_signatures\":\"Function signatures\",\"_targets\":\"Address of the destination contract to call\"}},\"setMasterCopy(address)\":{\"params\":{\"_masterCopy\":\"Address of contract bytecode to factory clone\"}},\"token()\":{\"returns\":{\"_0\":\"Token used for transfers and approvals\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"unsetAuthFunctionCall(string)\":{\"details\":\"Input expected is the function signature as 'transfer(address,uint256)'\",\"params\":{\"_signature\":\"Function signature\"}},\"withdraw(uint256)\":{\"details\":\"Escape hatch in case of mistakes or to recover remaining funds\",\"params\":{\"_amount\":\"Amount of tokens to withdraw\"}}},\"title\":\"GraphTokenLockManager\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"addTokenDestination(address)\":{\"notice\":\"Adds an address that can be allowed by a token lock to pull funds\"},\"constructor\":{\"notice\":\"Constructor.\"},\"createTokenLockWallet(address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)\":{\"notice\":\"Creates and fund a new token lock wallet using a minimum proxy\"},\"deposit(uint256)\":{\"notice\":\"Deposits tokens into the contract\"},\"getAuthFunctionCallTarget(bytes4)\":{\"notice\":\"Gets the target contract to call for a particular function signature\"},\"getDeploymentAddress(bytes32,address,address)\":{\"notice\":\"Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation\"},\"getTokenDestinations()\":{\"notice\":\"Returns an array of authorized destination addresses\"},\"isAuthFunctionCall(bytes4)\":{\"notice\":\"Returns true if the function call is authorized\"},\"isTokenDestination(address)\":{\"notice\":\"Returns True if the address is authorized to be a destination of tokens\"},\"removeTokenDestination(address)\":{\"notice\":\"Removes an address that can be allowed by a token lock to pull funds\"},\"setAuthFunctionCall(string,address)\":{\"notice\":\"Sets an authorized function call to target\"},\"setAuthFunctionCallMany(string[],address[])\":{\"notice\":\"Sets an authorized function call to target in bulk\"},\"setMasterCopy(address)\":{\"notice\":\"Sets the masterCopy bytecode to use to create clones of TokenLock contracts\"},\"token()\":{\"notice\":\"Gets the GRT token address\"},\"unsetAuthFunctionCall(string)\":{\"notice\":\"Unsets an authorized function call to target\"},\"withdraw(uint256)\":{\"notice\":\"Withdraws tokens from the contract\"}},\"notice\":\"This contract manages a list of authorized function calls and targets that can be called by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts. This contract receives funds to make the process of creating TokenLockWallet contracts easier by distributing them the initial tokens to be managed. The owner can setup a list of token destinations that will be used by TokenLock contracts to approve the pulling of funds, this way in can be guaranteed that only protocol contracts will manipulate users funds.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/GraphTokenLockManager.sol\":\"GraphTokenLockManager\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor () internal {\\n address msgSender = _msgSender();\\n _owner = msgSender;\\n emit OwnershipTransferred(address(0), msgSender);\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n emit OwnershipTransferred(_owner, address(0));\\n _owner = address(0);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n emit OwnershipTransferred(_owner, newOwner);\\n _owner = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0x15e2d5bd4c28a88548074c54d220e8086f638a71ed07e6b3ba5a70066fcf458d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/math/SafeMath.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Wrappers over Solidity's arithmetic operations with added overflow\\n * checks.\\n *\\n * Arithmetic operations in Solidity wrap on overflow. This can easily result\\n * in bugs, because programmers usually assume that an overflow raises an\\n * error, which is the standard behavior in high level programming languages.\\n * `SafeMath` restores this intuition by reverting the transaction when an\\n * operation overflows.\\n *\\n * Using this library instead of the unchecked operations eliminates an entire\\n * class of bugs, so it's recommended to use it always.\\n */\\nlibrary SafeMath {\\n /**\\n * @dev Returns the addition of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n uint256 c = a + b;\\n if (c < a) return (false, 0);\\n return (true, c);\\n }\\n\\n /**\\n * @dev Returns the substraction of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b > a) return (false, 0);\\n return (true, a - b);\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\\n if (a == 0) return (true, 0);\\n uint256 c = a * b;\\n if (c / a != b) return (false, 0);\\n return (true, c);\\n }\\n\\n /**\\n * @dev Returns the division of two unsigned integers, with a division by zero flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b == 0) return (false, 0);\\n return (true, a / b);\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b == 0) return (false, 0);\\n return (true, a % b);\\n }\\n\\n /**\\n * @dev Returns the addition of two unsigned integers, reverting on\\n * overflow.\\n *\\n * Counterpart to Solidity's `+` operator.\\n *\\n * Requirements:\\n *\\n * - Addition cannot overflow.\\n */\\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\\n uint256 c = a + b;\\n require(c >= a, \\\"SafeMath: addition overflow\\\");\\n return c;\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting on\\n * overflow (when the result is negative).\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n *\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b <= a, \\\"SafeMath: subtraction overflow\\\");\\n return a - b;\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, reverting on\\n * overflow.\\n *\\n * Counterpart to Solidity's `*` operator.\\n *\\n * Requirements:\\n *\\n * - Multiplication cannot overflow.\\n */\\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\\n if (a == 0) return 0;\\n uint256 c = a * b;\\n require(c / a == b, \\\"SafeMath: multiplication overflow\\\");\\n return c;\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers, reverting on\\n * division by zero. The result is rounded towards zero.\\n *\\n * Counterpart to Solidity's `/` operator. Note: this function uses a\\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\\n * uses an invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b > 0, \\\"SafeMath: division by zero\\\");\\n return a / b;\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * reverting when dividing by zero.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b > 0, \\\"SafeMath: modulo by zero\\\");\\n return a % b;\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\\n * overflow (when the result is negative).\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {trySub}.\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n *\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b <= a, errorMessage);\\n return a - b;\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers, reverting with custom message on\\n * division by zero. The result is rounded towards zero.\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {tryDiv}.\\n *\\n * Counterpart to Solidity's `/` operator. Note: this function uses a\\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\\n * uses an invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b > 0, errorMessage);\\n return a / b;\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * reverting with custom message when dividing by zero.\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {tryMod}.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b > 0, errorMessage);\\n return a % b;\\n }\\n}\\n\",\"keccak256\":\"0xcc78a17dd88fa5a2edc60c8489e2f405c0913b377216a5b26b35656b2d0dab52\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `recipient`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address recipient, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `sender` to `recipient` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n}\\n\",\"keccak256\":\"0x5f02220344881ce43204ae4a6281145a67bc52c2bb1290a791857df3d19d78f5\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\nimport \\\"./IERC20.sol\\\";\\nimport \\\"../../math/SafeMath.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @title SafeERC20\\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\\n * contract returns false). Tokens that return no value (and instead revert or\\n * throw on failure) are also supported, non-reverting calls are assumed to be\\n * successful.\\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\n */\\nlibrary SafeERC20 {\\n using SafeMath for uint256;\\n using Address for address;\\n\\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\\n }\\n\\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\\n }\\n\\n /**\\n * @dev Deprecated. This function has issues similar to the ones found in\\n * {IERC20-approve}, and its usage is discouraged.\\n *\\n * Whenever possible, use {safeIncreaseAllowance} and\\n * {safeDecreaseAllowance} instead.\\n */\\n function safeApprove(IERC20 token, address spender, uint256 value) internal {\\n // safeApprove should only be called when setting an initial allowance,\\n // or when resetting it to zero. To increase and decrease it, use\\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\\n // solhint-disable-next-line max-line-length\\n require((value == 0) || (token.allowance(address(this), spender) == 0),\\n \\\"SafeERC20: approve from non-zero to non-zero allowance\\\"\\n );\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\\n }\\n\\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n uint256 newAllowance = token.allowance(address(this), spender).add(value);\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n uint256 newAllowance = token.allowance(address(this), spender).sub(value, \\\"SafeERC20: decreased allowance below zero\\\");\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n */\\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that\\n // the target address contains contract code and also asserts for success in the low-level call.\\n\\n bytes memory returndata = address(token).functionCall(data, \\\"SafeERC20: low-level call failed\\\");\\n if (returndata.length > 0) { // Return data is optional\\n // solhint-disable-next-line max-line-length\\n require(abi.decode(returndata, (bool)), \\\"SafeERC20: ERC20 operation did not succeed\\\");\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf12dfbe97e6276980b83d2830bb0eb75e0cf4f3e626c2471137f82158ae6a0fc\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.2 <0.8.0;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize, which returns 0 for contracts in\\n // construction, since the code is only stored at the end of the\\n // constructor execution.\\n\\n uint256 size;\\n // solhint-disable-next-line no-inline-assembly\\n assembly { size := extcodesize(account) }\\n return size > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls, avoid-call-value\\n (bool success, ) = recipient.call{ value: amount }(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain`call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.call{ value: value }(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x28911e614500ae7c607a432a709d35da25f3bc5ddc8bd12b278b66358070c0ea\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/*\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with GSN meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address payable) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes memory) {\\n this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0x8d3cb350f04ff49cfb10aef08d87f19dcbaecc8027b0bed12f3275cd12f38cf0\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Create2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Helper to make usage of the `CREATE2` EVM opcode easier and safer.\\n * `CREATE2` can be used to compute in advance the address where a smart\\n * contract will be deployed, which allows for interesting new mechanisms known\\n * as 'counterfactual interactions'.\\n *\\n * See the https://eips.ethereum.org/EIPS/eip-1014#motivation[EIP] for more\\n * information.\\n */\\nlibrary Create2 {\\n /**\\n * @dev Deploys a contract using `CREATE2`. The address where the contract\\n * will be deployed can be known in advance via {computeAddress}.\\n *\\n * The bytecode for a contract can be obtained from Solidity with\\n * `type(contractName).creationCode`.\\n *\\n * Requirements:\\n *\\n * - `bytecode` must not be empty.\\n * - `salt` must have not been used for `bytecode` already.\\n * - the factory must have a balance of at least `amount`.\\n * - if `amount` is non-zero, `bytecode` must have a `payable` constructor.\\n */\\n function deploy(uint256 amount, bytes32 salt, bytes memory bytecode) internal returns (address) {\\n address addr;\\n require(address(this).balance >= amount, \\\"Create2: insufficient balance\\\");\\n require(bytecode.length != 0, \\\"Create2: bytecode length is zero\\\");\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n addr := create2(amount, add(bytecode, 0x20), mload(bytecode), salt)\\n }\\n require(addr != address(0), \\\"Create2: Failed on deploy\\\");\\n return addr;\\n }\\n\\n /**\\n * @dev Returns the address where a contract will be stored if deployed via {deploy}. Any change in the\\n * `bytecodeHash` or `salt` will result in a new destination address.\\n */\\n function computeAddress(bytes32 salt, bytes32 bytecodeHash) internal view returns (address) {\\n return computeAddress(salt, bytecodeHash, address(this));\\n }\\n\\n /**\\n * @dev Returns the address where a contract will be stored if deployed via {deploy} from a contract located at\\n * `deployer`. If `deployer` is this contract's address, returns the same value as {computeAddress}.\\n */\\n function computeAddress(bytes32 salt, bytes32 bytecodeHash, address deployer) internal pure returns (address) {\\n bytes32 _data = keccak256(\\n abi.encodePacked(bytes1(0xff), deployer, salt, bytecodeHash)\\n );\\n return address(uint160(uint256(_data)));\\n }\\n}\\n\",\"keccak256\":\"0x0a0b021149946014fe1cd04af11e7a937a29986c47e8b1b718c2d50d729472db\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/EnumerableSet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Library for managing\\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\\n * types.\\n *\\n * Sets have the following properties:\\n *\\n * - Elements are added, removed, and checked for existence in constant time\\n * (O(1)).\\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\\n *\\n * ```\\n * contract Example {\\n * // Add the library methods\\n * using EnumerableSet for EnumerableSet.AddressSet;\\n *\\n * // Declare a set state variable\\n * EnumerableSet.AddressSet private mySet;\\n * }\\n * ```\\n *\\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\\n * and `uint256` (`UintSet`) are supported.\\n */\\nlibrary EnumerableSet {\\n // To implement this library for multiple types with as little code\\n // repetition as possible, we write it in terms of a generic Set type with\\n // bytes32 values.\\n // The Set implementation uses private functions, and user-facing\\n // implementations (such as AddressSet) are just wrappers around the\\n // underlying Set.\\n // This means that we can only create new EnumerableSets for types that fit\\n // in bytes32.\\n\\n struct Set {\\n // Storage of set values\\n bytes32[] _values;\\n\\n // Position of the value in the `values` array, plus 1 because index 0\\n // means a value is not in the set.\\n mapping (bytes32 => uint256) _indexes;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function _add(Set storage set, bytes32 value) private returns (bool) {\\n if (!_contains(set, value)) {\\n set._values.push(value);\\n // The value is stored at length-1, but we add 1 to all indexes\\n // and use 0 as a sentinel value\\n set._indexes[value] = set._values.length;\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function _remove(Set storage set, bytes32 value) private returns (bool) {\\n // We read and store the value's index to prevent multiple reads from the same storage slot\\n uint256 valueIndex = set._indexes[value];\\n\\n if (valueIndex != 0) { // Equivalent to contains(set, value)\\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\\n // the array, and then remove the last element (sometimes called as 'swap and pop').\\n // This modifies the order of the array, as noted in {at}.\\n\\n uint256 toDeleteIndex = valueIndex - 1;\\n uint256 lastIndex = set._values.length - 1;\\n\\n // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs\\n // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.\\n\\n bytes32 lastvalue = set._values[lastIndex];\\n\\n // Move the last value to the index where the value to delete is\\n set._values[toDeleteIndex] = lastvalue;\\n // Update the index for the moved value\\n set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based\\n\\n // Delete the slot where the moved value was stored\\n set._values.pop();\\n\\n // Delete the index for the deleted slot\\n delete set._indexes[value];\\n\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\\n return set._indexes[value] != 0;\\n }\\n\\n /**\\n * @dev Returns the number of values on the set. O(1).\\n */\\n function _length(Set storage set) private view returns (uint256) {\\n return set._values.length;\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\\n require(set._values.length > index, \\\"EnumerableSet: index out of bounds\\\");\\n return set._values[index];\\n }\\n\\n // Bytes32Set\\n\\n struct Bytes32Set {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _add(set._inner, value);\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _remove(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\\n return _contains(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(Bytes32Set storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\\n return _at(set._inner, index);\\n }\\n\\n // AddressSet\\n\\n struct AddressSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(AddressSet storage set, address value) internal returns (bool) {\\n return _add(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(AddressSet storage set, address value) internal returns (bool) {\\n return _remove(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(AddressSet storage set, address value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(AddressSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\\n return address(uint160(uint256(_at(set._inner, index))));\\n }\\n\\n\\n // UintSet\\n\\n struct UintSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(UintSet storage set, uint256 value) internal returns (bool) {\\n return _add(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\\n return _remove(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns the number of values on the set. O(1).\\n */\\n function length(UintSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\\n return uint256(_at(set._inner, index));\\n }\\n}\\n\",\"keccak256\":\"0x1562cd9922fbf739edfb979f506809e2743789cbde3177515542161c3d04b164\",\"license\":\"MIT\"},\"contracts/GraphTokenLock.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nimport \\\"@openzeppelin/contracts/math/SafeMath.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\\\";\\n\\nimport { Ownable as OwnableInitializable } from \\\"./Ownable.sol\\\";\\nimport \\\"./MathUtils.sol\\\";\\nimport \\\"./IGraphTokenLock.sol\\\";\\n\\n/**\\n * @title GraphTokenLock\\n * @notice Contract that manages an unlocking schedule of tokens.\\n * @dev The contract lock manage a number of tokens deposited into the contract to ensure that\\n * they can only be released under certain time conditions.\\n *\\n * This contract implements a release scheduled based on periods and tokens are released in steps\\n * after each period ends. It can be configured with one period in which case it is like a plain TimeLock.\\n * It also supports revocation to be used for vesting schedules.\\n *\\n * The contract supports receiving extra funds than the managed tokens ones that can be\\n * withdrawn by the beneficiary at any time.\\n *\\n * A releaseStartTime parameter is included to override the default release schedule and\\n * perform the first release on the configured time. After that it will continue with the\\n * default schedule.\\n */\\nabstract contract GraphTokenLock is OwnableInitializable, IGraphTokenLock {\\n using SafeMath for uint256;\\n using SafeERC20 for IERC20;\\n\\n uint256 private constant MIN_PERIOD = 1;\\n\\n // -- State --\\n\\n IERC20 public token;\\n address public beneficiary;\\n\\n // Configuration\\n\\n // Amount of tokens managed by the contract schedule\\n uint256 public managedAmount;\\n\\n uint256 public startTime; // Start datetime (in unixtimestamp)\\n uint256 public endTime; // Datetime after all funds are fully vested/unlocked (in unixtimestamp)\\n uint256 public periods; // Number of vesting/release periods\\n\\n // First release date for tokens (in unixtimestamp)\\n // If set, no tokens will be released before releaseStartTime ignoring\\n // the amount to release each period\\n uint256 public releaseStartTime;\\n // A cliff set a date to which a beneficiary needs to get to vest\\n // all preceding periods\\n uint256 public vestingCliffTime;\\n Revocability public revocable; // Whether to use vesting for locked funds\\n\\n // State\\n\\n bool public isRevoked;\\n bool public isInitialized;\\n bool public isAccepted;\\n uint256 public releasedAmount;\\n uint256 public revokedAmount;\\n\\n // -- Events --\\n\\n event TokensReleased(address indexed beneficiary, uint256 amount);\\n event TokensWithdrawn(address indexed beneficiary, uint256 amount);\\n event TokensRevoked(address indexed beneficiary, uint256 amount);\\n event BeneficiaryChanged(address newBeneficiary);\\n event LockAccepted();\\n event LockCanceled();\\n\\n /**\\n * @dev Only allow calls from the beneficiary of the contract\\n */\\n modifier onlyBeneficiary() {\\n require(msg.sender == beneficiary, \\\"!auth\\\");\\n _;\\n }\\n\\n /**\\n * @notice Initializes the contract\\n * @param _owner Address of the contract owner\\n * @param _beneficiary Address of the beneficiary of locked tokens\\n * @param _managedAmount Amount of tokens to be managed by the lock contract\\n * @param _startTime Start time of the release schedule\\n * @param _endTime End time of the release schedule\\n * @param _periods Number of periods between start time and end time\\n * @param _releaseStartTime Override time for when the releases start\\n * @param _vestingCliffTime Override time for when the vesting start\\n * @param _revocable Whether the contract is revocable\\n */\\n function _initialize(\\n address _owner,\\n address _beneficiary,\\n address _token,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n Revocability _revocable\\n ) internal {\\n require(!isInitialized, \\\"Already initialized\\\");\\n require(_owner != address(0), \\\"Owner cannot be zero\\\");\\n require(_beneficiary != address(0), \\\"Beneficiary cannot be zero\\\");\\n require(_token != address(0), \\\"Token cannot be zero\\\");\\n require(_managedAmount > 0, \\\"Managed tokens cannot be zero\\\");\\n require(_startTime != 0, \\\"Start time must be set\\\");\\n require(_startTime < _endTime, \\\"Start time > end time\\\");\\n require(_periods >= MIN_PERIOD, \\\"Periods cannot be below minimum\\\");\\n require(_revocable != Revocability.NotSet, \\\"Must set a revocability option\\\");\\n require(_releaseStartTime < _endTime, \\\"Release start time must be before end time\\\");\\n require(_vestingCliffTime < _endTime, \\\"Cliff time must be before end time\\\");\\n\\n isInitialized = true;\\n\\n OwnableInitializable._initialize(_owner);\\n beneficiary = _beneficiary;\\n token = IERC20(_token);\\n\\n managedAmount = _managedAmount;\\n\\n startTime = _startTime;\\n endTime = _endTime;\\n periods = _periods;\\n\\n // Optionals\\n releaseStartTime = _releaseStartTime;\\n vestingCliffTime = _vestingCliffTime;\\n revocable = _revocable;\\n }\\n\\n /**\\n * @notice Change the beneficiary of funds managed by the contract\\n * @dev Can only be called by the beneficiary\\n * @param _newBeneficiary Address of the new beneficiary address\\n */\\n function changeBeneficiary(address _newBeneficiary) external onlyBeneficiary {\\n require(_newBeneficiary != address(0), \\\"Empty beneficiary\\\");\\n beneficiary = _newBeneficiary;\\n emit BeneficiaryChanged(_newBeneficiary);\\n }\\n\\n /**\\n * @notice Beneficiary accepts the lock, the owner cannot retrieve back the tokens\\n * @dev Can only be called by the beneficiary\\n */\\n function acceptLock() external onlyBeneficiary {\\n isAccepted = true;\\n emit LockAccepted();\\n }\\n\\n /**\\n * @notice Owner cancel the lock and return the balance in the contract\\n * @dev Can only be called by the owner\\n */\\n function cancelLock() external onlyOwner {\\n require(isAccepted == false, \\\"Cannot cancel accepted contract\\\");\\n\\n token.safeTransfer(owner(), currentBalance());\\n\\n emit LockCanceled();\\n }\\n\\n // -- Balances --\\n\\n /**\\n * @notice Returns the amount of tokens currently held by the contract\\n * @return Tokens held in the contract\\n */\\n function currentBalance() public view override returns (uint256) {\\n return token.balanceOf(address(this));\\n }\\n\\n // -- Time & Periods --\\n\\n /**\\n * @notice Returns the current block timestamp\\n * @return Current block timestamp\\n */\\n function currentTime() public view override returns (uint256) {\\n return block.timestamp;\\n }\\n\\n /**\\n * @notice Gets duration of contract from start to end in seconds\\n * @return Amount of seconds from contract startTime to endTime\\n */\\n function duration() public view override returns (uint256) {\\n return endTime.sub(startTime);\\n }\\n\\n /**\\n * @notice Gets time elapsed since the start of the contract\\n * @dev Returns zero if called before conctract starTime\\n * @return Seconds elapsed from contract startTime\\n */\\n function sinceStartTime() public view override returns (uint256) {\\n uint256 current = currentTime();\\n if (current <= startTime) {\\n return 0;\\n }\\n return current.sub(startTime);\\n }\\n\\n /**\\n * @notice Returns amount available to be released after each period according to schedule\\n * @return Amount of tokens available after each period\\n */\\n function amountPerPeriod() public view override returns (uint256) {\\n return managedAmount.div(periods);\\n }\\n\\n /**\\n * @notice Returns the duration of each period in seconds\\n * @return Duration of each period in seconds\\n */\\n function periodDuration() public view override returns (uint256) {\\n return duration().div(periods);\\n }\\n\\n /**\\n * @notice Gets the current period based on the schedule\\n * @return A number that represents the current period\\n */\\n function currentPeriod() public view override returns (uint256) {\\n return sinceStartTime().div(periodDuration()).add(MIN_PERIOD);\\n }\\n\\n /**\\n * @notice Gets the number of periods that passed since the first period\\n * @return A number of periods that passed since the schedule started\\n */\\n function passedPeriods() public view override returns (uint256) {\\n return currentPeriod().sub(MIN_PERIOD);\\n }\\n\\n // -- Locking & Release Schedule --\\n\\n /**\\n * @notice Gets the currently available token according to the schedule\\n * @dev Implements the step-by-step schedule based on periods for available tokens\\n * @return Amount of tokens available according to the schedule\\n */\\n function availableAmount() public view override returns (uint256) {\\n uint256 current = currentTime();\\n\\n // Before contract start no funds are available\\n if (current < startTime) {\\n return 0;\\n }\\n\\n // After contract ended all funds are available\\n if (current > endTime) {\\n return managedAmount;\\n }\\n\\n // Get available amount based on period\\n return passedPeriods().mul(amountPerPeriod());\\n }\\n\\n /**\\n * @notice Gets the amount of currently vested tokens\\n * @dev Similar to available amount, but is fully vested when contract is non-revocable\\n * @return Amount of tokens already vested\\n */\\n function vestedAmount() public view override returns (uint256) {\\n // If non-revocable it is fully vested\\n if (revocable == Revocability.Disabled) {\\n return managedAmount;\\n }\\n\\n // Vesting cliff is activated and it has not passed means nothing is vested yet\\n if (vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\\n return 0;\\n }\\n\\n return availableAmount();\\n }\\n\\n /**\\n * @notice Gets tokens currently available for release\\n * @dev Considers the schedule and takes into account already released tokens\\n * @return Amount of tokens ready to be released\\n */\\n function releasableAmount() public view virtual override returns (uint256) {\\n // If a release start time is set no tokens are available for release before this date\\n // If not set it follows the default schedule and tokens are available on\\n // the first period passed\\n if (releaseStartTime > 0 && currentTime() < releaseStartTime) {\\n return 0;\\n }\\n\\n // Vesting cliff is activated and it has not passed means nothing is vested yet\\n // so funds cannot be released\\n if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\\n return 0;\\n }\\n\\n // A beneficiary can never have more releasable tokens than the contract balance\\n uint256 releasable = availableAmount().sub(releasedAmount);\\n return MathUtils.min(currentBalance(), releasable);\\n }\\n\\n /**\\n * @notice Gets the outstanding amount yet to be released based on the whole contract lifetime\\n * @dev Does not consider schedule but just global amounts tracked\\n * @return Amount of outstanding tokens for the lifetime of the contract\\n */\\n function totalOutstandingAmount() public view override returns (uint256) {\\n return managedAmount.sub(releasedAmount).sub(revokedAmount);\\n }\\n\\n /**\\n * @notice Gets surplus amount in the contract based on outstanding amount to release\\n * @dev All funds over outstanding amount is considered surplus that can be withdrawn by beneficiary.\\n * Note this might not be the correct value for wallets transferred to L2 (i.e. an L2GraphTokenLockWallet), as the released amount will be\\n * skewed, so the beneficiary might have to bridge back to L1 to release the surplus.\\n * @return Amount of tokens considered as surplus\\n */\\n function surplusAmount() public view override returns (uint256) {\\n uint256 balance = currentBalance();\\n uint256 outstandingAmount = totalOutstandingAmount();\\n if (balance > outstandingAmount) {\\n return balance.sub(outstandingAmount);\\n }\\n return 0;\\n }\\n\\n // -- Value Transfer --\\n\\n /**\\n * @notice Releases tokens based on the configured schedule\\n * @dev All available releasable tokens are transferred to beneficiary\\n */\\n function release() external override onlyBeneficiary {\\n uint256 amountToRelease = releasableAmount();\\n require(amountToRelease > 0, \\\"No available releasable amount\\\");\\n\\n releasedAmount = releasedAmount.add(amountToRelease);\\n\\n token.safeTransfer(beneficiary, amountToRelease);\\n\\n emit TokensReleased(beneficiary, amountToRelease);\\n }\\n\\n /**\\n * @notice Withdraws surplus, unmanaged tokens from the contract\\n * @dev Tokens in the contract over outstanding amount are considered as surplus\\n * @param _amount Amount of tokens to withdraw\\n */\\n function withdrawSurplus(uint256 _amount) external override onlyBeneficiary {\\n require(_amount > 0, \\\"Amount cannot be zero\\\");\\n require(surplusAmount() >= _amount, \\\"Amount requested > surplus available\\\");\\n\\n token.safeTransfer(beneficiary, _amount);\\n\\n emit TokensWithdrawn(beneficiary, _amount);\\n }\\n\\n /**\\n * @notice Revokes a vesting schedule and return the unvested tokens to the owner\\n * @dev Vesting schedule is always calculated based on managed tokens\\n */\\n function revoke() external override onlyOwner {\\n require(revocable == Revocability.Enabled, \\\"Contract is non-revocable\\\");\\n require(isRevoked == false, \\\"Already revoked\\\");\\n\\n uint256 unvestedAmount = managedAmount.sub(vestedAmount());\\n require(unvestedAmount > 0, \\\"No available unvested amount\\\");\\n\\n revokedAmount = unvestedAmount;\\n isRevoked = true;\\n\\n token.safeTransfer(owner(), unvestedAmount);\\n\\n emit TokensRevoked(beneficiary, unvestedAmount);\\n }\\n}\\n\",\"keccak256\":\"0xd89470956a476c2fcf4a09625775573f95ba2c60a57fe866d90f65de1bcf5f2d\",\"license\":\"MIT\"},\"contracts/GraphTokenLockManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/EnumerableSet.sol\\\";\\nimport { Ownable } from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\n\\nimport \\\"./MinimalProxyFactory.sol\\\";\\nimport \\\"./IGraphTokenLockManager.sol\\\";\\nimport { GraphTokenLockWallet } from \\\"./GraphTokenLockWallet.sol\\\";\\n\\n/**\\n * @title GraphTokenLockManager\\n * @notice This contract manages a list of authorized function calls and targets that can be called\\n * by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts.\\n *\\n * This contract receives funds to make the process of creating TokenLockWallet contracts\\n * easier by distributing them the initial tokens to be managed.\\n *\\n * The owner can setup a list of token destinations that will be used by TokenLock contracts to\\n * approve the pulling of funds, this way in can be guaranteed that only protocol contracts\\n * will manipulate users funds.\\n */\\ncontract GraphTokenLockManager is Ownable, MinimalProxyFactory, IGraphTokenLockManager {\\n using SafeERC20 for IERC20;\\n using EnumerableSet for EnumerableSet.AddressSet;\\n\\n // -- State --\\n\\n mapping(bytes4 => address) public authFnCalls;\\n EnumerableSet.AddressSet private _tokenDestinations;\\n\\n address public masterCopy;\\n IERC20 internal _token;\\n\\n // -- Events --\\n\\n event MasterCopyUpdated(address indexed masterCopy);\\n event TokenLockCreated(\\n address indexed contractAddress,\\n bytes32 indexed initHash,\\n address indexed beneficiary,\\n address token,\\n uint256 managedAmount,\\n uint256 startTime,\\n uint256 endTime,\\n uint256 periods,\\n uint256 releaseStartTime,\\n uint256 vestingCliffTime,\\n IGraphTokenLock.Revocability revocable\\n );\\n\\n event TokensDeposited(address indexed sender, uint256 amount);\\n event TokensWithdrawn(address indexed sender, uint256 amount);\\n\\n event FunctionCallAuth(address indexed caller, bytes4 indexed sigHash, address indexed target, string signature);\\n event TokenDestinationAllowed(address indexed dst, bool allowed);\\n\\n /**\\n * Constructor.\\n * @param _graphToken Token to use for deposits and withdrawals\\n * @param _masterCopy Address of the master copy to use to clone proxies\\n */\\n constructor(IERC20 _graphToken, address _masterCopy) {\\n require(address(_graphToken) != address(0), \\\"Token cannot be zero\\\");\\n _token = _graphToken;\\n setMasterCopy(_masterCopy);\\n }\\n\\n // -- Factory --\\n\\n /**\\n * @notice Sets the masterCopy bytecode to use to create clones of TokenLock contracts\\n * @param _masterCopy Address of contract bytecode to factory clone\\n */\\n function setMasterCopy(address _masterCopy) public override onlyOwner {\\n require(_masterCopy != address(0), \\\"MasterCopy cannot be zero\\\");\\n masterCopy = _masterCopy;\\n emit MasterCopyUpdated(_masterCopy);\\n }\\n\\n /**\\n * @notice Creates and fund a new token lock wallet using a minimum proxy\\n * @param _owner Address of the contract owner\\n * @param _beneficiary Address of the beneficiary of locked tokens\\n * @param _managedAmount Amount of tokens to be managed by the lock contract\\n * @param _startTime Start time of the release schedule\\n * @param _endTime End time of the release schedule\\n * @param _periods Number of periods between start time and end time\\n * @param _releaseStartTime Override time for when the releases start\\n * @param _revocable Whether the contract is revocable\\n */\\n function createTokenLockWallet(\\n address _owner,\\n address _beneficiary,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n IGraphTokenLock.Revocability _revocable\\n ) external override onlyOwner {\\n require(_token.balanceOf(address(this)) >= _managedAmount, \\\"Not enough tokens to create lock\\\");\\n\\n // Create contract using a minimal proxy and call initializer\\n bytes memory initializer = abi.encodeWithSelector(\\n GraphTokenLockWallet.initialize.selector,\\n address(this),\\n _owner,\\n _beneficiary,\\n address(_token),\\n _managedAmount,\\n _startTime,\\n _endTime,\\n _periods,\\n _releaseStartTime,\\n _vestingCliffTime,\\n _revocable\\n );\\n address contractAddress = _deployProxy2(keccak256(initializer), masterCopy, initializer);\\n\\n // Send managed amount to the created contract\\n _token.safeTransfer(contractAddress, _managedAmount);\\n\\n emit TokenLockCreated(\\n contractAddress,\\n keccak256(initializer),\\n _beneficiary,\\n address(_token),\\n _managedAmount,\\n _startTime,\\n _endTime,\\n _periods,\\n _releaseStartTime,\\n _vestingCliffTime,\\n _revocable\\n );\\n }\\n\\n // -- Funds Management --\\n\\n /**\\n * @notice Gets the GRT token address\\n * @return Token used for transfers and approvals\\n */\\n function token() external view override returns (IERC20) {\\n return _token;\\n }\\n\\n /**\\n * @notice Deposits tokens into the contract\\n * @dev Even if the ERC20 token can be transferred directly to the contract\\n * this function provide a safe interface to do the transfer and avoid mistakes\\n * @param _amount Amount to deposit\\n */\\n function deposit(uint256 _amount) external override {\\n require(_amount > 0, \\\"Amount cannot be zero\\\");\\n _token.safeTransferFrom(msg.sender, address(this), _amount);\\n emit TokensDeposited(msg.sender, _amount);\\n }\\n\\n /**\\n * @notice Withdraws tokens from the contract\\n * @dev Escape hatch in case of mistakes or to recover remaining funds\\n * @param _amount Amount of tokens to withdraw\\n */\\n function withdraw(uint256 _amount) external override onlyOwner {\\n require(_amount > 0, \\\"Amount cannot be zero\\\");\\n _token.safeTransfer(msg.sender, _amount);\\n emit TokensWithdrawn(msg.sender, _amount);\\n }\\n\\n // -- Token Destinations --\\n\\n /**\\n * @notice Adds an address that can be allowed by a token lock to pull funds\\n * @param _dst Destination address\\n */\\n function addTokenDestination(address _dst) external override onlyOwner {\\n require(_dst != address(0), \\\"Destination cannot be zero\\\");\\n require(_tokenDestinations.add(_dst), \\\"Destination already added\\\");\\n emit TokenDestinationAllowed(_dst, true);\\n }\\n\\n /**\\n * @notice Removes an address that can be allowed by a token lock to pull funds\\n * @param _dst Destination address\\n */\\n function removeTokenDestination(address _dst) external override onlyOwner {\\n require(_tokenDestinations.remove(_dst), \\\"Destination already removed\\\");\\n emit TokenDestinationAllowed(_dst, false);\\n }\\n\\n /**\\n * @notice Returns True if the address is authorized to be a destination of tokens\\n * @param _dst Destination address\\n * @return True if authorized\\n */\\n function isTokenDestination(address _dst) external view override returns (bool) {\\n return _tokenDestinations.contains(_dst);\\n }\\n\\n /**\\n * @notice Returns an array of authorized destination addresses\\n * @return Array of addresses authorized to pull funds from a token lock\\n */\\n function getTokenDestinations() external view override returns (address[] memory) {\\n address[] memory dstList = new address[](_tokenDestinations.length());\\n for (uint256 i = 0; i < _tokenDestinations.length(); i++) {\\n dstList[i] = _tokenDestinations.at(i);\\n }\\n return dstList;\\n }\\n\\n // -- Function Call Authorization --\\n\\n /**\\n * @notice Sets an authorized function call to target\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @param _signature Function signature\\n * @param _target Address of the destination contract to call\\n */\\n function setAuthFunctionCall(string calldata _signature, address _target) external override onlyOwner {\\n _setAuthFunctionCall(_signature, _target);\\n }\\n\\n /**\\n * @notice Unsets an authorized function call to target\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @param _signature Function signature\\n */\\n function unsetAuthFunctionCall(string calldata _signature) external override onlyOwner {\\n bytes4 sigHash = _toFunctionSigHash(_signature);\\n authFnCalls[sigHash] = address(0);\\n\\n emit FunctionCallAuth(msg.sender, sigHash, address(0), _signature);\\n }\\n\\n /**\\n * @notice Sets an authorized function call to target in bulk\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @param _signatures Function signatures\\n * @param _targets Address of the destination contract to call\\n */\\n function setAuthFunctionCallMany(\\n string[] calldata _signatures,\\n address[] calldata _targets\\n ) external override onlyOwner {\\n require(_signatures.length == _targets.length, \\\"Array length mismatch\\\");\\n\\n for (uint256 i = 0; i < _signatures.length; i++) {\\n _setAuthFunctionCall(_signatures[i], _targets[i]);\\n }\\n }\\n\\n /**\\n * @notice Sets an authorized function call to target\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @dev Function signatures of Graph Protocol contracts to be used are known ahead of time\\n * @param _signature Function signature\\n * @param _target Address of the destination contract to call\\n */\\n function _setAuthFunctionCall(string calldata _signature, address _target) internal {\\n require(_target != address(this), \\\"Target must be other contract\\\");\\n require(Address.isContract(_target), \\\"Target must be a contract\\\");\\n\\n bytes4 sigHash = _toFunctionSigHash(_signature);\\n authFnCalls[sigHash] = _target;\\n\\n emit FunctionCallAuth(msg.sender, sigHash, _target, _signature);\\n }\\n\\n /**\\n * @notice Gets the target contract to call for a particular function signature\\n * @param _sigHash Function signature hash\\n * @return Address of the target contract where to send the call\\n */\\n function getAuthFunctionCallTarget(bytes4 _sigHash) public view override returns (address) {\\n return authFnCalls[_sigHash];\\n }\\n\\n /**\\n * @notice Returns true if the function call is authorized\\n * @param _sigHash Function signature hash\\n * @return True if authorized\\n */\\n function isAuthFunctionCall(bytes4 _sigHash) external view override returns (bool) {\\n return getAuthFunctionCallTarget(_sigHash) != address(0);\\n }\\n\\n /**\\n * @dev Converts a function signature string to 4-bytes hash\\n * @param _signature Function signature string\\n * @return Function signature hash\\n */\\n function _toFunctionSigHash(string calldata _signature) internal pure returns (bytes4) {\\n return _convertToBytes4(abi.encodeWithSignature(_signature));\\n }\\n\\n /**\\n * @dev Converts function signature bytes to function signature hash (bytes4)\\n * @param _signature Function signature\\n * @return Function signature in bytes4\\n */\\n function _convertToBytes4(bytes memory _signature) internal pure returns (bytes4) {\\n require(_signature.length == 4, \\\"Invalid method signature\\\");\\n bytes4 sigHash;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n sigHash := mload(add(_signature, 32))\\n }\\n return sigHash;\\n }\\n}\\n\",\"keccak256\":\"0x2bb51cc1a18bd88113fd6947067ad2fff33048c8904cb54adfda8e2ab86752f2\",\"license\":\"MIT\"},\"contracts/GraphTokenLockWallet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"@openzeppelin/contracts/math/SafeMath.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nimport \\\"./GraphTokenLock.sol\\\";\\nimport \\\"./IGraphTokenLockManager.sol\\\";\\n\\n/**\\n * @title GraphTokenLockWallet\\n * @notice This contract is built on top of the base GraphTokenLock functionality.\\n * It allows wallet beneficiaries to use the deposited funds to perform specific function calls\\n * on specific contracts.\\n *\\n * The idea is that supporters with locked tokens can participate in the protocol\\n * but disallow any release before the vesting/lock schedule.\\n * The beneficiary can issue authorized function calls to this contract that will\\n * get forwarded to a target contract. A target contract is any of our protocol contracts.\\n * The function calls allowed are queried to the GraphTokenLockManager, this way\\n * the same configuration can be shared for all the created lock wallet contracts.\\n *\\n * NOTE: Contracts used as target must have its function signatures checked to avoid collisions\\n * with any of this contract functions.\\n * Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience\\n * the maximum amount of tokens is authorized.\\n * Function calls do not forward ETH value so DO NOT SEND ETH TO THIS CONTRACT.\\n */\\ncontract GraphTokenLockWallet is GraphTokenLock {\\n using SafeMath for uint256;\\n\\n // -- State --\\n\\n IGraphTokenLockManager public manager;\\n uint256 public usedAmount;\\n\\n // -- Events --\\n\\n event ManagerUpdated(address indexed _oldManager, address indexed _newManager);\\n event TokenDestinationsApproved();\\n event TokenDestinationsRevoked();\\n\\n // Initializer\\n function initialize(\\n address _manager,\\n address _owner,\\n address _beneficiary,\\n address _token,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n Revocability _revocable\\n ) external {\\n _initialize(\\n _owner,\\n _beneficiary,\\n _token,\\n _managedAmount,\\n _startTime,\\n _endTime,\\n _periods,\\n _releaseStartTime,\\n _vestingCliffTime,\\n _revocable\\n );\\n _setManager(_manager);\\n }\\n\\n // -- Admin --\\n\\n /**\\n * @notice Sets a new manager for this contract\\n * @param _newManager Address of the new manager\\n */\\n function setManager(address _newManager) external onlyOwner {\\n _setManager(_newManager);\\n }\\n\\n /**\\n * @dev Sets a new manager for this contract\\n * @param _newManager Address of the new manager\\n */\\n function _setManager(address _newManager) internal {\\n require(_newManager != address(0), \\\"Manager cannot be empty\\\");\\n require(Address.isContract(_newManager), \\\"Manager must be a contract\\\");\\n\\n address oldManager = address(manager);\\n manager = IGraphTokenLockManager(_newManager);\\n\\n emit ManagerUpdated(oldManager, _newManager);\\n }\\n\\n // -- Beneficiary --\\n\\n /**\\n * @notice Approves protocol access of the tokens managed by this contract\\n * @dev Approves all token destinations registered in the manager to pull tokens\\n */\\n function approveProtocol() external onlyBeneficiary {\\n address[] memory dstList = manager.getTokenDestinations();\\n for (uint256 i = 0; i < dstList.length; i++) {\\n // Note this is only safe because we are using the max uint256 value\\n token.approve(dstList[i], type(uint256).max);\\n }\\n emit TokenDestinationsApproved();\\n }\\n\\n /**\\n * @notice Revokes protocol access of the tokens managed by this contract\\n * @dev Revokes approval to all token destinations in the manager to pull tokens\\n */\\n function revokeProtocol() external onlyBeneficiary {\\n address[] memory dstList = manager.getTokenDestinations();\\n for (uint256 i = 0; i < dstList.length; i++) {\\n // Note this is only safe cause we're using 0 as the amount\\n token.approve(dstList[i], 0);\\n }\\n emit TokenDestinationsRevoked();\\n }\\n\\n /**\\n * @notice Gets tokens currently available for release\\n * @dev Considers the schedule, takes into account already released tokens and used amount\\n * @return Amount of tokens ready to be released\\n */\\n function releasableAmount() public view override returns (uint256) {\\n if (revocable == Revocability.Disabled) {\\n return super.releasableAmount();\\n }\\n\\n // -- Revocability enabled logic\\n // This needs to deal with additional considerations for when tokens are used in the protocol\\n\\n // If a release start time is set no tokens are available for release before this date\\n // If not set it follows the default schedule and tokens are available on\\n // the first period passed\\n if (releaseStartTime > 0 && currentTime() < releaseStartTime) {\\n return 0;\\n }\\n\\n // Vesting cliff is activated and it has not passed means nothing is vested yet\\n // so funds cannot be released\\n if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\\n return 0;\\n }\\n\\n // A beneficiary can never have more releasable tokens than the contract balance\\n // We consider the `usedAmount` in the protocol as part of the calculations\\n // the beneficiary should not release funds that are used.\\n uint256 releasable = availableAmount().sub(releasedAmount).sub(usedAmount);\\n return MathUtils.min(currentBalance(), releasable);\\n }\\n\\n /**\\n * @notice Forward authorized contract calls to protocol contracts\\n * @dev Fallback function can be called by the beneficiary only if function call is allowed\\n */\\n // solhint-disable-next-line no-complex-fallback\\n fallback() external payable {\\n // Only beneficiary can forward calls\\n require(msg.sender == beneficiary, \\\"Unauthorized caller\\\");\\n require(msg.value == 0, \\\"ETH transfers not supported\\\");\\n\\n // Function call validation\\n address _target = manager.getAuthFunctionCallTarget(msg.sig);\\n require(_target != address(0), \\\"Unauthorized function\\\");\\n\\n uint256 oldBalance = currentBalance();\\n\\n // Call function with data\\n Address.functionCall(_target, msg.data);\\n\\n // Tracked used tokens in the protocol\\n // We do this check after balances were updated by the forwarded call\\n // Check is only enforced for revocable contracts to save some gas\\n if (revocable == Revocability.Enabled) {\\n // Track contract balance change\\n uint256 newBalance = currentBalance();\\n if (newBalance < oldBalance) {\\n // Outflow\\n uint256 diff = oldBalance.sub(newBalance);\\n usedAmount = usedAmount.add(diff);\\n } else {\\n // Inflow: We can receive profits from the protocol, that could make usedAmount to\\n // underflow. We set it to zero in that case.\\n uint256 diff = newBalance.sub(oldBalance);\\n usedAmount = (diff >= usedAmount) ? 0 : usedAmount.sub(diff);\\n }\\n require(usedAmount <= vestedAmount(), \\\"Cannot use more tokens than vested amount\\\");\\n }\\n }\\n\\n /**\\n * @notice Receive function that always reverts.\\n * @dev Only included to supress warnings, see https://github.com/ethereum/solidity/issues/10159\\n */\\n receive() external payable {\\n revert(\\\"Bad call\\\");\\n }\\n}\\n\",\"keccak256\":\"0x976c2ba4c1503a81ea02bd84539c516e99af611ff767968ee25456b50a6deb7b\",\"license\":\"MIT\"},\"contracts/IGraphTokenLock.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\ninterface IGraphTokenLock {\\n enum Revocability {\\n NotSet,\\n Enabled,\\n Disabled\\n }\\n\\n // -- Balances --\\n\\n function currentBalance() external view returns (uint256);\\n\\n // -- Time & Periods --\\n\\n function currentTime() external view returns (uint256);\\n\\n function duration() external view returns (uint256);\\n\\n function sinceStartTime() external view returns (uint256);\\n\\n function amountPerPeriod() external view returns (uint256);\\n\\n function periodDuration() external view returns (uint256);\\n\\n function currentPeriod() external view returns (uint256);\\n\\n function passedPeriods() external view returns (uint256);\\n\\n // -- Locking & Release Schedule --\\n\\n function availableAmount() external view returns (uint256);\\n\\n function vestedAmount() external view returns (uint256);\\n\\n function releasableAmount() external view returns (uint256);\\n\\n function totalOutstandingAmount() external view returns (uint256);\\n\\n function surplusAmount() external view returns (uint256);\\n\\n // -- Value Transfer --\\n\\n function release() external;\\n\\n function withdrawSurplus(uint256 _amount) external;\\n\\n function revoke() external;\\n}\\n\",\"keccak256\":\"0xceb9d258276fe25ec858191e1deae5778f1b2f612a669fb7b37bab1a064756ab\",\"license\":\"MIT\"},\"contracts/IGraphTokenLockManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nimport \\\"./IGraphTokenLock.sol\\\";\\n\\ninterface IGraphTokenLockManager {\\n // -- Factory --\\n\\n function setMasterCopy(address _masterCopy) external;\\n\\n function createTokenLockWallet(\\n address _owner,\\n address _beneficiary,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n IGraphTokenLock.Revocability _revocable\\n ) external;\\n\\n // -- Funds Management --\\n\\n function token() external returns (IERC20);\\n\\n function deposit(uint256 _amount) external;\\n\\n function withdraw(uint256 _amount) external;\\n\\n // -- Allowed Funds Destinations --\\n\\n function addTokenDestination(address _dst) external;\\n\\n function removeTokenDestination(address _dst) external;\\n\\n function isTokenDestination(address _dst) external view returns (bool);\\n\\n function getTokenDestinations() external view returns (address[] memory);\\n\\n // -- Function Call Authorization --\\n\\n function setAuthFunctionCall(string calldata _signature, address _target) external;\\n\\n function unsetAuthFunctionCall(string calldata _signature) external;\\n\\n function setAuthFunctionCallMany(string[] calldata _signatures, address[] calldata _targets) external;\\n\\n function getAuthFunctionCallTarget(bytes4 _sigHash) external view returns (address);\\n\\n function isAuthFunctionCall(bytes4 _sigHash) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x2d78d41909a6de5b316ac39b100ea087a8f317cf306379888a045523e15c4d9a\",\"license\":\"MIT\"},\"contracts/MathUtils.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nlibrary MathUtils {\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n}\\n\",\"keccak256\":\"0xe2512e1da48bc8363acd15f66229564b02d66706665d7da740604566913c1400\",\"license\":\"MIT\"},\"contracts/MinimalProxyFactory.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nimport { Address } from \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport { Create2 } from \\\"@openzeppelin/contracts/utils/Create2.sol\\\";\\n\\n/**\\n * @title MinimalProxyFactory: a factory contract for creating minimal proxies\\n * @notice Adapted from https://github.com/OpenZeppelin/openzeppelin-sdk/blob/v2.5.0/packages/lib/contracts/upgradeability/ProxyFactory.sol\\n * Based on https://eips.ethereum.org/EIPS/eip-1167\\n */\\ncontract MinimalProxyFactory {\\n /// @dev Emitted when a new proxy is created\\n event ProxyCreated(address indexed proxy);\\n\\n /**\\n * @notice Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation\\n * @param _salt Bytes32 salt to use for CREATE2\\n * @param _implementation Address of the proxy target implementation\\n * @param _deployer Address of the deployer that creates the contract\\n * @return Address of the counterfactual MinimalProxy\\n */\\n function getDeploymentAddress(\\n bytes32 _salt,\\n address _implementation,\\n address _deployer\\n ) public pure returns (address) {\\n return Create2.computeAddress(_salt, keccak256(_getContractCreationCode(_implementation)), _deployer);\\n }\\n\\n /**\\n * @dev Deploys a MinimalProxy with CREATE2\\n * @param _salt Bytes32 salt to use for CREATE2\\n * @param _implementation Address of the proxy target implementation\\n * @param _data Bytes with the initializer call\\n * @return Address of the deployed MinimalProxy\\n */\\n function _deployProxy2(bytes32 _salt, address _implementation, bytes memory _data) internal returns (address) {\\n address proxyAddress = Create2.deploy(0, _salt, _getContractCreationCode(_implementation));\\n\\n emit ProxyCreated(proxyAddress);\\n\\n // Call function with data\\n if (_data.length > 0) {\\n Address.functionCall(proxyAddress, _data);\\n }\\n\\n return proxyAddress;\\n }\\n\\n /**\\n * @dev Gets the MinimalProxy bytecode\\n * @param _implementation Address of the proxy target implementation\\n * @return MinimalProxy bytecode\\n */\\n function _getContractCreationCode(address _implementation) internal pure returns (bytes memory) {\\n bytes10 creation = 0x3d602d80600a3d3981f3;\\n bytes10 prefix = 0x363d3d373d3d3d363d73;\\n bytes20 targetBytes = bytes20(_implementation);\\n bytes15 suffix = 0x5af43d82803e903d91602b57fd5bf3;\\n return abi.encodePacked(creation, prefix, targetBytes, suffix);\\n }\\n}\\n\",\"keccak256\":\"0x67d67a567bceb363ddb199b1e4ab06e7a99f16e034e03086971a332c09ec5c0e\",\"license\":\"MIT\"},\"contracts/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * The owner account will be passed on initialization of the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\ncontract Ownable {\\n /// @dev Owner of the contract, can be retrieved with the public owner() function\\n address private _owner;\\n /// @dev Since upgradeable contracts might inherit this, we add a storage gap\\n /// to allow adding variables here without breaking the proxy storage layout\\n uint256[50] private __gap;\\n\\n /// @dev Emitted when ownership of the contract is transferred\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n function _initialize(address owner) internal {\\n _owner = owner;\\n emit OwnershipTransferred(address(0), owner);\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(_owner == msg.sender, \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() external virtual onlyOwner {\\n emit OwnershipTransferred(_owner, address(0));\\n _owner = address(0);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) external virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n emit OwnershipTransferred(_owner, newOwner);\\n _owner = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0xe8750687082e8e24b620dbf58c3a08eee591ed7b4d5a3e13cc93554ec647fd09\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60806040523480156200001157600080fd5b5060405162003c8f38038062003c8f83398181016040528101906200003791906200039c565b600062000049620001b460201b60201c565b9050806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a350600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156200015a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200015190620004e7565b60405180910390fd5b81600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550620001ac81620001bc60201b60201c565b505062000596565b600033905090565b620001cc620001b460201b60201c565b73ffffffffffffffffffffffffffffffffffffffff16620001f26200034560201b60201c565b73ffffffffffffffffffffffffffffffffffffffff16146200024b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200024290620004c5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415620002be576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620002b590620004a3565b60405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167f30909084afc859121ffc3a5aef7fe37c540a9a1ef60bd4d8dcdb76376fadf9de60405160405180910390a250565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000815190506200037f8162000562565b92915050565b60008151905062000396816200057c565b92915050565b60008060408385031215620003b057600080fd5b6000620003c08582860162000385565b9250506020620003d3858286016200036e565b9150509250929050565b6000620003ec60198362000509565b91507f4d6173746572436f70792063616e6e6f74206265207a65726f000000000000006000830152602082019050919050565b60006200042e60208362000509565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b60006200047060148362000509565b91507f546f6b656e2063616e6e6f74206265207a65726f0000000000000000000000006000830152602082019050919050565b60006020820190508181036000830152620004be81620003dd565b9050919050565b60006020820190508181036000830152620004e0816200041f565b9050919050565b60006020820190508181036000830152620005028162000461565b9050919050565b600082825260208201905092915050565b6000620005278262000542565b9050919050565b60006200053b826200051a565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6200056d816200051a565b81146200057957600080fd5b50565b62000587816200052e565b81146200059357600080fd5b50565b6136e980620005a66000396000f3fe608060405234801561001057600080fd5b506004361061012c5760003560e01c80638da5cb5b116100ad578063c1ab13db11610071578063c1ab13db14610319578063cf497e6c14610335578063f1d24c4514610351578063f2fde38b14610381578063fc0c546a1461039d5761012c565b80638da5cb5b146102875780639c05fc60146102a5578063a3457466146102c1578063a619486e146102df578063b6b55f25146102fd5761012c565b80635975e00c116100f45780635975e00c146101e557806368d30c2e146102015780636e03b8dc1461021d578063715018a61461024d57806379ee1bdf146102575761012c565b806303990a6c146101315780630602ba2b1461014d5780632e1a7d4d1461017d57806343fb93d914610199578063463013a2146101c9575b600080fd5b61014b6004803603810190610146919061253a565b6103bb565b005b61016760048036038101906101629190612511565b610563565b6040516101749190613029565b60405180910390f35b610197600480360381019061019291906125d7565b6105a4565b005b6101b360048036038101906101ae91906124c2565b610701565b6040516101c09190612e63565b60405180910390f35b6101e360048036038101906101de919061257f565b610726565b005b6101ff60048036038101906101fa9190612335565b6107b2565b005b61021b6004803603810190610216919061235e565b610943565b005b61023760048036038101906102329190612511565b610c8b565b6040516102449190612e63565b60405180910390f35b610255610cbe565b005b610271600480360381019061026c9190612335565b610df8565b60405161027e9190613029565b60405180910390f35b61028f610e15565b60405161029c9190612e63565b60405180910390f35b6102bf60048036038101906102ba9190612424565b610e3e565b005b6102c9610f6b565b6040516102d69190613007565b60405180910390f35b6102e7611043565b6040516102f49190612e63565b60405180910390f35b610317600480360381019061031291906125d7565b611069565b005b610333600480360381019061032e9190612335565b61114c565b005b61034f600480360381019061034a9190612335565b61126d565b005b61036b60048036038101906103669190612511565b6113e0565b6040516103789190612e63565b60405180910390f35b61039b60048036038101906103969190612335565b61145b565b005b6103a5611604565b6040516103b29190613044565b60405180910390f35b6103c361162e565b73ffffffffffffffffffffffffffffffffffffffff166103e1610e15565b73ffffffffffffffffffffffffffffffffffffffff1614610437576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042e90613225565b60405180910390fd5b60006104438383611636565b9050600060016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff16817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163373ffffffffffffffffffffffffffffffffffffffff167f450397a2db0e89eccfe664cc6cdfd274a88bc00d29aaec4d991754a42f19f8c9868660405161055692919061305f565b60405180910390a4505050565b60008073ffffffffffffffffffffffffffffffffffffffff16610585836113e0565b73ffffffffffffffffffffffffffffffffffffffff1614159050919050565b6105ac61162e565b73ffffffffffffffffffffffffffffffffffffffff166105ca610e15565b73ffffffffffffffffffffffffffffffffffffffff1614610620576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161061790613225565b60405180910390fd5b60008111610663576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161065a90613205565b60405180910390fd5b6106b03382600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166116c49092919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b826040516106f69190613305565b60405180910390a250565b600061071d846107108561174a565b80519060200120846117c0565b90509392505050565b61072e61162e565b73ffffffffffffffffffffffffffffffffffffffff1661074c610e15565b73ffffffffffffffffffffffffffffffffffffffff16146107a2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161079990613225565b60405180910390fd5b6107ad838383611804565b505050565b6107ba61162e565b73ffffffffffffffffffffffffffffffffffffffff166107d8610e15565b73ffffffffffffffffffffffffffffffffffffffff161461082e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161082590613225565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561089e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161089590613105565b60405180910390fd5b6108b28160026119e690919063ffffffff16565b6108f1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108e890613265565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f33442b8c13e72dd75a027f08f9bff4eed2dfd26e43cdea857365f5163b359a7960016040516109389190613029565b60405180910390a250565b61094b61162e565b73ffffffffffffffffffffffffffffffffffffffff16610969610e15565b73ffffffffffffffffffffffffffffffffffffffff16146109bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109b690613225565b60405180910390fd5b86600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610a1b9190612e63565b60206040518083038186803b158015610a3357600080fd5b505afa158015610a47573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a6b9190612600565b1015610aac576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aa390613145565b60405180910390fd5b606063bd896dcb60e01b308b8b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168c8c8c8c8c8c8c604051602401610afd9b9a99989796959493929190612e7e565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505090506000610b928280519060200120600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611a16565b9050610be1818a600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166116c49092919063ffffffff16565b8973ffffffffffffffffffffffffffffffffffffffff1682805190602001208273ffffffffffffffffffffffffffffffffffffffff167f3c7ff6acee351ed98200c285a04745858a107e16da2f13c3a81a43073c17d644600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168d8d8d8d8d8d8d604051610c76989796959493929190612f89565b60405180910390a45050505050505050505050565b60016020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610cc661162e565b73ffffffffffffffffffffffffffffffffffffffff16610ce4610e15565b73ffffffffffffffffffffffffffffffffffffffff1614610d3a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d3190613225565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000610e0e826002611a9290919063ffffffff16565b9050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610e4661162e565b73ffffffffffffffffffffffffffffffffffffffff16610e64610e15565b73ffffffffffffffffffffffffffffffffffffffff1614610eba576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eb190613225565b60405180910390fd5b818190508484905014610f02576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ef9906130e5565b60405180910390fd5b60005b84849050811015610f6457610f57858583818110610f1f57fe5b9050602002810190610f319190613320565b858585818110610f3d57fe5b9050602002016020810190610f529190612335565b611804565b8080600101915050610f05565b5050505050565b606080610f786002611ac2565b67ffffffffffffffff81118015610f8e57600080fd5b50604051908082528060200260200182016040528015610fbd5781602001602082028036833780820191505090505b50905060005b610fcd6002611ac2565b81101561103b57610fe8816002611ad790919063ffffffff16565b828281518110610ff457fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508080600101915050610fc3565b508091505090565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600081116110ac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110a390613205565b60405180910390fd5b6110fb333083600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611af1909392919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f59062170a285eb80e8c6b8ced60428442a51910635005233fc4ce084a475845e826040516111419190613305565b60405180910390a250565b61115461162e565b73ffffffffffffffffffffffffffffffffffffffff16611172610e15565b73ffffffffffffffffffffffffffffffffffffffff16146111c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111bf90613225565b60405180910390fd5b6111dc816002611b7a90919063ffffffff16565b61121b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161121290613185565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f33442b8c13e72dd75a027f08f9bff4eed2dfd26e43cdea857365f5163b359a7960006040516112629190613029565b60405180910390a250565b61127561162e565b73ffffffffffffffffffffffffffffffffffffffff16611293610e15565b73ffffffffffffffffffffffffffffffffffffffff16146112e9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112e090613225565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611359576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611350906131a5565b60405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167f30909084afc859121ffc3a5aef7fe37c540a9a1ef60bd4d8dcdb76376fadf9de60405160405180910390a250565b600060016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b61146361162e565b73ffffffffffffffffffffffffffffffffffffffff16611481610e15565b73ffffffffffffffffffffffffffffffffffffffff16146114d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114ce90613225565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611547576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161153e90613125565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600033905090565b60006116bc83836040516024016040516020818303038152906040529190604051611662929190612e4a565b60405180910390207bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611baa565b905092915050565b6117458363a9059cbb60e01b84846040516024016116e3929190612f60565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611c02565b505050565b60606000693d602d80600a3d3981f360b01b9050600069363d3d373d3d3d363d7360b01b905060008460601b905060006e5af43d82803e903d91602b57fd5bf360881b9050838383836040516020016117a69493929190612d97565b604051602081830303815290604052945050505050919050565b60008060ff60f81b8386866040516020016117de9493929190612de5565b6040516020818303038152906040528051906020012090508060001c9150509392505050565b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611873576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161186a906131c5565b60405180910390fd5b61187c81611cc9565b6118bb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118b2906132e5565b60405180910390fd5b60006118c78484611636565b90508160016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff16817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163373ffffffffffffffffffffffffffffffffffffffff167f450397a2db0e89eccfe664cc6cdfd274a88bc00d29aaec4d991754a42f19f8c987876040516119d892919061305f565b60405180910390a450505050565b6000611a0e836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611cdc565b905092915050565b600080611a2d600086611a288761174a565b611d4c565b90508073ffffffffffffffffffffffffffffffffffffffff167efffc2da0b561cae30d9826d37709e9421c4725faebc226cbbb7ef5fc5e734960405160405180910390a2600083511115611a8757611a858184611e5d565b505b809150509392505050565b6000611aba836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611ea7565b905092915050565b6000611ad082600001611eca565b9050919050565b6000611ae68360000183611edb565b60001c905092915050565b611b74846323b872dd60e01b858585604051602401611b1293929190612f29565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611c02565b50505050565b6000611ba2836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611f48565b905092915050565b60006004825114611bf0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611be790613245565b60405180910390fd5b60006020830151905080915050919050565b6060611c64826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166120309092919063ffffffff16565b9050600081511115611cc45780806020019051810190611c849190612499565b611cc3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cba906132a5565b60405180910390fd5b5b505050565b600080823b905060008111915050919050565b6000611ce88383611ea7565b611d41578260000182908060018154018082558091505060019003906000526020600020016000909190919091505582600001805490508360010160008481526020019081526020016000208190555060019050611d46565b600090505b92915050565b60008084471015611d92576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d89906132c5565b60405180910390fd5b600083511415611dd7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dce906130c5565b60405180910390fd5b8383516020850187f59050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611e52576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e49906131e5565b60405180910390fd5b809150509392505050565b6060611e9f83836040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c65640000815250612030565b905092915050565b600080836001016000848152602001908152602001600020541415905092915050565b600081600001805490509050919050565b600081836000018054905011611f26576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f1d906130a5565b60405180910390fd5b826000018281548110611f3557fe5b9060005260206000200154905092915050565b600080836001016000848152602001908152602001600020549050600081146120245760006001820390506000600186600001805490500390506000866000018281548110611f9357fe5b9060005260206000200154905080876000018481548110611fb057fe5b9060005260206000200181905550600183018760010160008381526020019081526020016000208190555086600001805480611fe857fe5b6001900381819060005260206000200160009055905586600101600087815260200190815260200160002060009055600194505050505061202a565b60009150505b92915050565b606061203f8484600085612048565b90509392505050565b60608247101561208d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161208490613165565b60405180910390fd5b61209685611cc9565b6120d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120cc90613285565b60405180910390fd5b600060608673ffffffffffffffffffffffffffffffffffffffff1685876040516120ff9190612e33565b60006040518083038185875af1925050503d806000811461213c576040519150601f19603f3d011682016040523d82523d6000602084013e612141565b606091505b509150915061215182828661215d565b92505050949350505050565b6060831561216d578290506121bd565b6000835111156121805782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121b49190613083565b60405180910390fd5b9392505050565b6000813590506121d381613630565b92915050565b60008083601f8401126121eb57600080fd5b8235905067ffffffffffffffff81111561220457600080fd5b60208301915083602082028301111561221c57600080fd5b9250929050565b60008083601f84011261223557600080fd5b8235905067ffffffffffffffff81111561224e57600080fd5b60208301915083602082028301111561226657600080fd5b9250929050565b60008151905061227c81613647565b92915050565b6000813590506122918161365e565b92915050565b6000813590506122a681613675565b92915050565b6000813590506122bb8161368c565b92915050565b60008083601f8401126122d357600080fd5b8235905067ffffffffffffffff8111156122ec57600080fd5b60208301915083600182028301111561230457600080fd5b9250929050565b60008135905061231a8161369c565b92915050565b60008151905061232f8161369c565b92915050565b60006020828403121561234757600080fd5b6000612355848285016121c4565b91505092915050565b60008060008060008060008060006101208a8c03121561237d57600080fd5b600061238b8c828d016121c4565b995050602061239c8c828d016121c4565b98505060406123ad8c828d0161230b565b97505060606123be8c828d0161230b565b96505060806123cf8c828d0161230b565b95505060a06123e08c828d0161230b565b94505060c06123f18c828d0161230b565b93505060e06124028c828d0161230b565b9250506101006124148c828d016122ac565b9150509295985092959850929598565b6000806000806040858703121561243a57600080fd5b600085013567ffffffffffffffff81111561245457600080fd5b61246087828801612223565b9450945050602085013567ffffffffffffffff81111561247f57600080fd5b61248b878288016121d9565b925092505092959194509250565b6000602082840312156124ab57600080fd5b60006124b98482850161226d565b91505092915050565b6000806000606084860312156124d757600080fd5b60006124e586828701612282565b93505060206124f6868287016121c4565b9250506040612507868287016121c4565b9150509250925092565b60006020828403121561252357600080fd5b600061253184828501612297565b91505092915050565b6000806020838503121561254d57600080fd5b600083013567ffffffffffffffff81111561256757600080fd5b612573858286016122c1565b92509250509250929050565b60008060006040848603121561259457600080fd5b600084013567ffffffffffffffff8111156125ae57600080fd5b6125ba868287016122c1565b935093505060206125cd868287016121c4565b9150509250925092565b6000602082840312156125e957600080fd5b60006125f78482850161230b565b91505092915050565b60006020828403121561261257600080fd5b600061262084828501612320565b91505092915050565b60006126358383612641565b60208301905092915050565b61264a816133ed565b82525050565b612659816133ed565b82525050565b61267061266b826133ed565b6135a6565b82525050565b600061268182613387565b61268b81856133b5565b935061269683613377565b8060005b838110156126c75781516126ae8882612629565b97506126b9836133a8565b92505060018101905061269a565b5085935050505092915050565b6126dd816133ff565b82525050565b6126f46126ef82613437565b6135c2565b82525050565b61270b61270682613463565b6135cc565b82525050565b61272261271d8261340b565b6135b8565b82525050565b6127396127348261348f565b6135d6565b82525050565b61275061274b826134bb565b6135e0565b82525050565b600061276182613392565b61276b81856133c6565b935061277b818560208601613573565b80840191505092915050565b6127908161352e565b82525050565b61279f81613552565b82525050565b60006127b183856133d1565b93506127be838584613564565b6127c7836135fe565b840190509392505050565b60006127de83856133e2565b93506127eb838584613564565b82840190509392505050565b60006128028261339d565b61280c81856133d1565b935061281c818560208601613573565b612825816135fe565b840191505092915050565b600061283d6022836133d1565b91507f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e60008301527f64730000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006128a36020836133d1565b91507f437265617465323a2062797465636f6465206c656e677468206973207a65726f6000830152602082019050919050565b60006128e36015836133d1565b91507f4172726179206c656e677468206d69736d6174636800000000000000000000006000830152602082019050919050565b6000612923601a836133d1565b91507f44657374696e6174696f6e2063616e6e6f74206265207a65726f0000000000006000830152602082019050919050565b60006129636026836133d1565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006129c96020836133d1565b91507f4e6f7420656e6f75676820746f6b656e7320746f20637265617465206c6f636b6000830152602082019050919050565b6000612a096026836133d1565b91507f416464726573733a20696e73756666696369656e742062616c616e636520666f60008301527f722063616c6c00000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000612a6f601b836133d1565b91507f44657374696e6174696f6e20616c72656164792072656d6f76656400000000006000830152602082019050919050565b6000612aaf6019836133d1565b91507f4d6173746572436f70792063616e6e6f74206265207a65726f000000000000006000830152602082019050919050565b6000612aef601d836133d1565b91507f546172676574206d757374206265206f7468657220636f6e74726163740000006000830152602082019050919050565b6000612b2f6019836133d1565b91507f437265617465323a204661696c6564206f6e206465706c6f79000000000000006000830152602082019050919050565b6000612b6f6015836133d1565b91507f416d6f756e742063616e6e6f74206265207a65726f00000000000000000000006000830152602082019050919050565b6000612baf6020836133d1565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b6000612bef6018836133d1565b91507f496e76616c6964206d6574686f64207369676e617475726500000000000000006000830152602082019050919050565b6000612c2f6019836133d1565b91507f44657374696e6174696f6e20616c7265616479206164646564000000000000006000830152602082019050919050565b6000612c6f601d836133d1565b91507f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006000830152602082019050919050565b6000612caf602a836133d1565b91507f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008301527f6f742073756363656564000000000000000000000000000000000000000000006020830152604082019050919050565b6000612d15601d836133d1565b91507f437265617465323a20696e73756666696369656e742062616c616e63650000006000830152602082019050919050565b6000612d556019836133d1565b91507f546172676574206d757374206265206120636f6e7472616374000000000000006000830152602082019050919050565b612d9181613524565b82525050565b6000612da382876126e3565b600a82019150612db382866126e3565b600a82019150612dc38285612728565b601482019150612dd382846126fa565b600f8201915081905095945050505050565b6000612df18287612711565b600182019150612e01828661265f565b601482019150612e11828561273f565b602082019150612e21828461273f565b60208201915081905095945050505050565b6000612e3f8284612756565b915081905092915050565b6000612e578284866127d2565b91508190509392505050565b6000602082019050612e786000830184612650565b92915050565b600061016082019050612e94600083018e612650565b612ea1602083018d612650565b612eae604083018c612650565b612ebb606083018b612650565b612ec8608083018a612d88565b612ed560a0830189612d88565b612ee260c0830188612d88565b612eef60e0830187612d88565b612efd610100830186612d88565b612f0b610120830185612d88565b612f19610140830184612796565b9c9b505050505050505050505050565b6000606082019050612f3e6000830186612650565b612f4b6020830185612650565b612f586040830184612d88565b949350505050565b6000604082019050612f756000830185612650565b612f826020830184612d88565b9392505050565b600061010082019050612f9f600083018b612650565b612fac602083018a612d88565b612fb96040830189612d88565b612fc66060830188612d88565b612fd36080830187612d88565b612fe060a0830186612d88565b612fed60c0830185612d88565b612ffa60e0830184612796565b9998505050505050505050565b600060208201905081810360008301526130218184612676565b905092915050565b600060208201905061303e60008301846126d4565b92915050565b60006020820190506130596000830184612787565b92915050565b6000602082019050818103600083015261307a8184866127a5565b90509392505050565b6000602082019050818103600083015261309d81846127f7565b905092915050565b600060208201905081810360008301526130be81612830565b9050919050565b600060208201905081810360008301526130de81612896565b9050919050565b600060208201905081810360008301526130fe816128d6565b9050919050565b6000602082019050818103600083015261311e81612916565b9050919050565b6000602082019050818103600083015261313e81612956565b9050919050565b6000602082019050818103600083015261315e816129bc565b9050919050565b6000602082019050818103600083015261317e816129fc565b9050919050565b6000602082019050818103600083015261319e81612a62565b9050919050565b600060208201905081810360008301526131be81612aa2565b9050919050565b600060208201905081810360008301526131de81612ae2565b9050919050565b600060208201905081810360008301526131fe81612b22565b9050919050565b6000602082019050818103600083015261321e81612b62565b9050919050565b6000602082019050818103600083015261323e81612ba2565b9050919050565b6000602082019050818103600083015261325e81612be2565b9050919050565b6000602082019050818103600083015261327e81612c22565b9050919050565b6000602082019050818103600083015261329e81612c62565b9050919050565b600060208201905081810360008301526132be81612ca2565b9050919050565b600060208201905081810360008301526132de81612d08565b9050919050565b600060208201905081810360008301526132fe81612d48565b9050919050565b600060208201905061331a6000830184612d88565b92915050565b6000808335600160200384360303811261333957600080fd5b80840192508235915067ffffffffffffffff82111561335757600080fd5b60208301925060018202360383131561336f57600080fd5b509250929050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b60006133f882613504565b9050919050565b60008115159050919050565b60007fff0000000000000000000000000000000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffff0000000000000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffffffffffffff000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffffffffffffffffffffffff00000000000000000000000082169050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b60008190506134ff8261361c565b919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600061353982613540565b9050919050565b600061354b82613504565b9050919050565b600061355d826134f1565b9050919050565b82818337600083830152505050565b60005b83811015613591578082015181840152602081019050613576565b838111156135a0576000848401525b50505050565b60006135b1826135ea565b9050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b60006135f58261360f565b9050919050565bfe5b6000601f19601f8301169050919050565b60008160601b9050919050565b6003811061362d5761362c6135fc565b5b50565b613639816133ed565b811461364457600080fd5b50565b613650816133ff565b811461365b57600080fd5b50565b613667816134bb565b811461367257600080fd5b50565b61367e816134c5565b811461368957600080fd5b50565b6003811061369957600080fd5b50565b6136a581613524565b81146136b057600080fd5b5056fea2646970667358221220d5c9f5b6d4e12c49170d8830f9459ebc2386434f550d65bae2bbc0fcfbacfb6264736f6c63430007030033", + "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061012c5760003560e01c80638da5cb5b116100ad578063c1ab13db11610071578063c1ab13db14610319578063cf497e6c14610335578063f1d24c4514610351578063f2fde38b14610381578063fc0c546a1461039d5761012c565b80638da5cb5b146102875780639c05fc60146102a5578063a3457466146102c1578063a619486e146102df578063b6b55f25146102fd5761012c565b80635975e00c116100f45780635975e00c146101e557806368d30c2e146102015780636e03b8dc1461021d578063715018a61461024d57806379ee1bdf146102575761012c565b806303990a6c146101315780630602ba2b1461014d5780632e1a7d4d1461017d57806343fb93d914610199578063463013a2146101c9575b600080fd5b61014b6004803603810190610146919061253a565b6103bb565b005b61016760048036038101906101629190612511565b610563565b6040516101749190613029565b60405180910390f35b610197600480360381019061019291906125d7565b6105a4565b005b6101b360048036038101906101ae91906124c2565b610701565b6040516101c09190612e63565b60405180910390f35b6101e360048036038101906101de919061257f565b610726565b005b6101ff60048036038101906101fa9190612335565b6107b2565b005b61021b6004803603810190610216919061235e565b610943565b005b61023760048036038101906102329190612511565b610c8b565b6040516102449190612e63565b60405180910390f35b610255610cbe565b005b610271600480360381019061026c9190612335565b610df8565b60405161027e9190613029565b60405180910390f35b61028f610e15565b60405161029c9190612e63565b60405180910390f35b6102bf60048036038101906102ba9190612424565b610e3e565b005b6102c9610f6b565b6040516102d69190613007565b60405180910390f35b6102e7611043565b6040516102f49190612e63565b60405180910390f35b610317600480360381019061031291906125d7565b611069565b005b610333600480360381019061032e9190612335565b61114c565b005b61034f600480360381019061034a9190612335565b61126d565b005b61036b60048036038101906103669190612511565b6113e0565b6040516103789190612e63565b60405180910390f35b61039b60048036038101906103969190612335565b61145b565b005b6103a5611604565b6040516103b29190613044565b60405180910390f35b6103c361162e565b73ffffffffffffffffffffffffffffffffffffffff166103e1610e15565b73ffffffffffffffffffffffffffffffffffffffff1614610437576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042e90613225565b60405180910390fd5b60006104438383611636565b9050600060016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff16817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163373ffffffffffffffffffffffffffffffffffffffff167f450397a2db0e89eccfe664cc6cdfd274a88bc00d29aaec4d991754a42f19f8c9868660405161055692919061305f565b60405180910390a4505050565b60008073ffffffffffffffffffffffffffffffffffffffff16610585836113e0565b73ffffffffffffffffffffffffffffffffffffffff1614159050919050565b6105ac61162e565b73ffffffffffffffffffffffffffffffffffffffff166105ca610e15565b73ffffffffffffffffffffffffffffffffffffffff1614610620576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161061790613225565b60405180910390fd5b60008111610663576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161065a90613205565b60405180910390fd5b6106b03382600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166116c49092919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b826040516106f69190613305565b60405180910390a250565b600061071d846107108561174a565b80519060200120846117c0565b90509392505050565b61072e61162e565b73ffffffffffffffffffffffffffffffffffffffff1661074c610e15565b73ffffffffffffffffffffffffffffffffffffffff16146107a2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161079990613225565b60405180910390fd5b6107ad838383611804565b505050565b6107ba61162e565b73ffffffffffffffffffffffffffffffffffffffff166107d8610e15565b73ffffffffffffffffffffffffffffffffffffffff161461082e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161082590613225565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561089e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161089590613105565b60405180910390fd5b6108b28160026119e690919063ffffffff16565b6108f1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108e890613265565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f33442b8c13e72dd75a027f08f9bff4eed2dfd26e43cdea857365f5163b359a7960016040516109389190613029565b60405180910390a250565b61094b61162e565b73ffffffffffffffffffffffffffffffffffffffff16610969610e15565b73ffffffffffffffffffffffffffffffffffffffff16146109bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109b690613225565b60405180910390fd5b86600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610a1b9190612e63565b60206040518083038186803b158015610a3357600080fd5b505afa158015610a47573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a6b9190612600565b1015610aac576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aa390613145565b60405180910390fd5b606063bd896dcb60e01b308b8b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168c8c8c8c8c8c8c604051602401610afd9b9a99989796959493929190612e7e565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505090506000610b928280519060200120600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611a16565b9050610be1818a600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166116c49092919063ffffffff16565b8973ffffffffffffffffffffffffffffffffffffffff1682805190602001208273ffffffffffffffffffffffffffffffffffffffff167f3c7ff6acee351ed98200c285a04745858a107e16da2f13c3a81a43073c17d644600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168d8d8d8d8d8d8d604051610c76989796959493929190612f89565b60405180910390a45050505050505050505050565b60016020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610cc661162e565b73ffffffffffffffffffffffffffffffffffffffff16610ce4610e15565b73ffffffffffffffffffffffffffffffffffffffff1614610d3a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d3190613225565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000610e0e826002611a9290919063ffffffff16565b9050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610e4661162e565b73ffffffffffffffffffffffffffffffffffffffff16610e64610e15565b73ffffffffffffffffffffffffffffffffffffffff1614610eba576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eb190613225565b60405180910390fd5b818190508484905014610f02576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ef9906130e5565b60405180910390fd5b60005b84849050811015610f6457610f57858583818110610f1f57fe5b9050602002810190610f319190613320565b858585818110610f3d57fe5b9050602002016020810190610f529190612335565b611804565b8080600101915050610f05565b5050505050565b606080610f786002611ac2565b67ffffffffffffffff81118015610f8e57600080fd5b50604051908082528060200260200182016040528015610fbd5781602001602082028036833780820191505090505b50905060005b610fcd6002611ac2565b81101561103b57610fe8816002611ad790919063ffffffff16565b828281518110610ff457fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508080600101915050610fc3565b508091505090565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600081116110ac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110a390613205565b60405180910390fd5b6110fb333083600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611af1909392919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f59062170a285eb80e8c6b8ced60428442a51910635005233fc4ce084a475845e826040516111419190613305565b60405180910390a250565b61115461162e565b73ffffffffffffffffffffffffffffffffffffffff16611172610e15565b73ffffffffffffffffffffffffffffffffffffffff16146111c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111bf90613225565b60405180910390fd5b6111dc816002611b7a90919063ffffffff16565b61121b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161121290613185565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f33442b8c13e72dd75a027f08f9bff4eed2dfd26e43cdea857365f5163b359a7960006040516112629190613029565b60405180910390a250565b61127561162e565b73ffffffffffffffffffffffffffffffffffffffff16611293610e15565b73ffffffffffffffffffffffffffffffffffffffff16146112e9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112e090613225565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611359576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611350906131a5565b60405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167f30909084afc859121ffc3a5aef7fe37c540a9a1ef60bd4d8dcdb76376fadf9de60405160405180910390a250565b600060016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b61146361162e565b73ffffffffffffffffffffffffffffffffffffffff16611481610e15565b73ffffffffffffffffffffffffffffffffffffffff16146114d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114ce90613225565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611547576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161153e90613125565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600033905090565b60006116bc83836040516024016040516020818303038152906040529190604051611662929190612e4a565b60405180910390207bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611baa565b905092915050565b6117458363a9059cbb60e01b84846040516024016116e3929190612f60565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611c02565b505050565b60606000693d602d80600a3d3981f360b01b9050600069363d3d373d3d3d363d7360b01b905060008460601b905060006e5af43d82803e903d91602b57fd5bf360881b9050838383836040516020016117a69493929190612d97565b604051602081830303815290604052945050505050919050565b60008060ff60f81b8386866040516020016117de9493929190612de5565b6040516020818303038152906040528051906020012090508060001c9150509392505050565b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611873576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161186a906131c5565b60405180910390fd5b61187c81611cc9565b6118bb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118b2906132e5565b60405180910390fd5b60006118c78484611636565b90508160016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff16817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163373ffffffffffffffffffffffffffffffffffffffff167f450397a2db0e89eccfe664cc6cdfd274a88bc00d29aaec4d991754a42f19f8c987876040516119d892919061305f565b60405180910390a450505050565b6000611a0e836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611cdc565b905092915050565b600080611a2d600086611a288761174a565b611d4c565b90508073ffffffffffffffffffffffffffffffffffffffff167efffc2da0b561cae30d9826d37709e9421c4725faebc226cbbb7ef5fc5e734960405160405180910390a2600083511115611a8757611a858184611e5d565b505b809150509392505050565b6000611aba836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611ea7565b905092915050565b6000611ad082600001611eca565b9050919050565b6000611ae68360000183611edb565b60001c905092915050565b611b74846323b872dd60e01b858585604051602401611b1293929190612f29565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611c02565b50505050565b6000611ba2836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611f48565b905092915050565b60006004825114611bf0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611be790613245565b60405180910390fd5b60006020830151905080915050919050565b6060611c64826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166120309092919063ffffffff16565b9050600081511115611cc45780806020019051810190611c849190612499565b611cc3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cba906132a5565b60405180910390fd5b5b505050565b600080823b905060008111915050919050565b6000611ce88383611ea7565b611d41578260000182908060018154018082558091505060019003906000526020600020016000909190919091505582600001805490508360010160008481526020019081526020016000208190555060019050611d46565b600090505b92915050565b60008084471015611d92576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d89906132c5565b60405180910390fd5b600083511415611dd7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dce906130c5565b60405180910390fd5b8383516020850187f59050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611e52576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e49906131e5565b60405180910390fd5b809150509392505050565b6060611e9f83836040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c65640000815250612030565b905092915050565b600080836001016000848152602001908152602001600020541415905092915050565b600081600001805490509050919050565b600081836000018054905011611f26576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f1d906130a5565b60405180910390fd5b826000018281548110611f3557fe5b9060005260206000200154905092915050565b600080836001016000848152602001908152602001600020549050600081146120245760006001820390506000600186600001805490500390506000866000018281548110611f9357fe5b9060005260206000200154905080876000018481548110611fb057fe5b9060005260206000200181905550600183018760010160008381526020019081526020016000208190555086600001805480611fe857fe5b6001900381819060005260206000200160009055905586600101600087815260200190815260200160002060009055600194505050505061202a565b60009150505b92915050565b606061203f8484600085612048565b90509392505050565b60608247101561208d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161208490613165565b60405180910390fd5b61209685611cc9565b6120d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120cc90613285565b60405180910390fd5b600060608673ffffffffffffffffffffffffffffffffffffffff1685876040516120ff9190612e33565b60006040518083038185875af1925050503d806000811461213c576040519150601f19603f3d011682016040523d82523d6000602084013e612141565b606091505b509150915061215182828661215d565b92505050949350505050565b6060831561216d578290506121bd565b6000835111156121805782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121b49190613083565b60405180910390fd5b9392505050565b6000813590506121d381613630565b92915050565b60008083601f8401126121eb57600080fd5b8235905067ffffffffffffffff81111561220457600080fd5b60208301915083602082028301111561221c57600080fd5b9250929050565b60008083601f84011261223557600080fd5b8235905067ffffffffffffffff81111561224e57600080fd5b60208301915083602082028301111561226657600080fd5b9250929050565b60008151905061227c81613647565b92915050565b6000813590506122918161365e565b92915050565b6000813590506122a681613675565b92915050565b6000813590506122bb8161368c565b92915050565b60008083601f8401126122d357600080fd5b8235905067ffffffffffffffff8111156122ec57600080fd5b60208301915083600182028301111561230457600080fd5b9250929050565b60008135905061231a8161369c565b92915050565b60008151905061232f8161369c565b92915050565b60006020828403121561234757600080fd5b6000612355848285016121c4565b91505092915050565b60008060008060008060008060006101208a8c03121561237d57600080fd5b600061238b8c828d016121c4565b995050602061239c8c828d016121c4565b98505060406123ad8c828d0161230b565b97505060606123be8c828d0161230b565b96505060806123cf8c828d0161230b565b95505060a06123e08c828d0161230b565b94505060c06123f18c828d0161230b565b93505060e06124028c828d0161230b565b9250506101006124148c828d016122ac565b9150509295985092959850929598565b6000806000806040858703121561243a57600080fd5b600085013567ffffffffffffffff81111561245457600080fd5b61246087828801612223565b9450945050602085013567ffffffffffffffff81111561247f57600080fd5b61248b878288016121d9565b925092505092959194509250565b6000602082840312156124ab57600080fd5b60006124b98482850161226d565b91505092915050565b6000806000606084860312156124d757600080fd5b60006124e586828701612282565b93505060206124f6868287016121c4565b9250506040612507868287016121c4565b9150509250925092565b60006020828403121561252357600080fd5b600061253184828501612297565b91505092915050565b6000806020838503121561254d57600080fd5b600083013567ffffffffffffffff81111561256757600080fd5b612573858286016122c1565b92509250509250929050565b60008060006040848603121561259457600080fd5b600084013567ffffffffffffffff8111156125ae57600080fd5b6125ba868287016122c1565b935093505060206125cd868287016121c4565b9150509250925092565b6000602082840312156125e957600080fd5b60006125f78482850161230b565b91505092915050565b60006020828403121561261257600080fd5b600061262084828501612320565b91505092915050565b60006126358383612641565b60208301905092915050565b61264a816133ed565b82525050565b612659816133ed565b82525050565b61267061266b826133ed565b6135a6565b82525050565b600061268182613387565b61268b81856133b5565b935061269683613377565b8060005b838110156126c75781516126ae8882612629565b97506126b9836133a8565b92505060018101905061269a565b5085935050505092915050565b6126dd816133ff565b82525050565b6126f46126ef82613437565b6135c2565b82525050565b61270b61270682613463565b6135cc565b82525050565b61272261271d8261340b565b6135b8565b82525050565b6127396127348261348f565b6135d6565b82525050565b61275061274b826134bb565b6135e0565b82525050565b600061276182613392565b61276b81856133c6565b935061277b818560208601613573565b80840191505092915050565b6127908161352e565b82525050565b61279f81613552565b82525050565b60006127b183856133d1565b93506127be838584613564565b6127c7836135fe565b840190509392505050565b60006127de83856133e2565b93506127eb838584613564565b82840190509392505050565b60006128028261339d565b61280c81856133d1565b935061281c818560208601613573565b612825816135fe565b840191505092915050565b600061283d6022836133d1565b91507f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e60008301527f64730000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006128a36020836133d1565b91507f437265617465323a2062797465636f6465206c656e677468206973207a65726f6000830152602082019050919050565b60006128e36015836133d1565b91507f4172726179206c656e677468206d69736d6174636800000000000000000000006000830152602082019050919050565b6000612923601a836133d1565b91507f44657374696e6174696f6e2063616e6e6f74206265207a65726f0000000000006000830152602082019050919050565b60006129636026836133d1565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006129c96020836133d1565b91507f4e6f7420656e6f75676820746f6b656e7320746f20637265617465206c6f636b6000830152602082019050919050565b6000612a096026836133d1565b91507f416464726573733a20696e73756666696369656e742062616c616e636520666f60008301527f722063616c6c00000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000612a6f601b836133d1565b91507f44657374696e6174696f6e20616c72656164792072656d6f76656400000000006000830152602082019050919050565b6000612aaf6019836133d1565b91507f4d6173746572436f70792063616e6e6f74206265207a65726f000000000000006000830152602082019050919050565b6000612aef601d836133d1565b91507f546172676574206d757374206265206f7468657220636f6e74726163740000006000830152602082019050919050565b6000612b2f6019836133d1565b91507f437265617465323a204661696c6564206f6e206465706c6f79000000000000006000830152602082019050919050565b6000612b6f6015836133d1565b91507f416d6f756e742063616e6e6f74206265207a65726f00000000000000000000006000830152602082019050919050565b6000612baf6020836133d1565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b6000612bef6018836133d1565b91507f496e76616c6964206d6574686f64207369676e617475726500000000000000006000830152602082019050919050565b6000612c2f6019836133d1565b91507f44657374696e6174696f6e20616c7265616479206164646564000000000000006000830152602082019050919050565b6000612c6f601d836133d1565b91507f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006000830152602082019050919050565b6000612caf602a836133d1565b91507f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008301527f6f742073756363656564000000000000000000000000000000000000000000006020830152604082019050919050565b6000612d15601d836133d1565b91507f437265617465323a20696e73756666696369656e742062616c616e63650000006000830152602082019050919050565b6000612d556019836133d1565b91507f546172676574206d757374206265206120636f6e7472616374000000000000006000830152602082019050919050565b612d9181613524565b82525050565b6000612da382876126e3565b600a82019150612db382866126e3565b600a82019150612dc38285612728565b601482019150612dd382846126fa565b600f8201915081905095945050505050565b6000612df18287612711565b600182019150612e01828661265f565b601482019150612e11828561273f565b602082019150612e21828461273f565b60208201915081905095945050505050565b6000612e3f8284612756565b915081905092915050565b6000612e578284866127d2565b91508190509392505050565b6000602082019050612e786000830184612650565b92915050565b600061016082019050612e94600083018e612650565b612ea1602083018d612650565b612eae604083018c612650565b612ebb606083018b612650565b612ec8608083018a612d88565b612ed560a0830189612d88565b612ee260c0830188612d88565b612eef60e0830187612d88565b612efd610100830186612d88565b612f0b610120830185612d88565b612f19610140830184612796565b9c9b505050505050505050505050565b6000606082019050612f3e6000830186612650565b612f4b6020830185612650565b612f586040830184612d88565b949350505050565b6000604082019050612f756000830185612650565b612f826020830184612d88565b9392505050565b600061010082019050612f9f600083018b612650565b612fac602083018a612d88565b612fb96040830189612d88565b612fc66060830188612d88565b612fd36080830187612d88565b612fe060a0830186612d88565b612fed60c0830185612d88565b612ffa60e0830184612796565b9998505050505050505050565b600060208201905081810360008301526130218184612676565b905092915050565b600060208201905061303e60008301846126d4565b92915050565b60006020820190506130596000830184612787565b92915050565b6000602082019050818103600083015261307a8184866127a5565b90509392505050565b6000602082019050818103600083015261309d81846127f7565b905092915050565b600060208201905081810360008301526130be81612830565b9050919050565b600060208201905081810360008301526130de81612896565b9050919050565b600060208201905081810360008301526130fe816128d6565b9050919050565b6000602082019050818103600083015261311e81612916565b9050919050565b6000602082019050818103600083015261313e81612956565b9050919050565b6000602082019050818103600083015261315e816129bc565b9050919050565b6000602082019050818103600083015261317e816129fc565b9050919050565b6000602082019050818103600083015261319e81612a62565b9050919050565b600060208201905081810360008301526131be81612aa2565b9050919050565b600060208201905081810360008301526131de81612ae2565b9050919050565b600060208201905081810360008301526131fe81612b22565b9050919050565b6000602082019050818103600083015261321e81612b62565b9050919050565b6000602082019050818103600083015261323e81612ba2565b9050919050565b6000602082019050818103600083015261325e81612be2565b9050919050565b6000602082019050818103600083015261327e81612c22565b9050919050565b6000602082019050818103600083015261329e81612c62565b9050919050565b600060208201905081810360008301526132be81612ca2565b9050919050565b600060208201905081810360008301526132de81612d08565b9050919050565b600060208201905081810360008301526132fe81612d48565b9050919050565b600060208201905061331a6000830184612d88565b92915050565b6000808335600160200384360303811261333957600080fd5b80840192508235915067ffffffffffffffff82111561335757600080fd5b60208301925060018202360383131561336f57600080fd5b509250929050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b60006133f882613504565b9050919050565b60008115159050919050565b60007fff0000000000000000000000000000000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffff0000000000000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffffffffffffff000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffffffffffffffffffffffff00000000000000000000000082169050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b60008190506134ff8261361c565b919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600061353982613540565b9050919050565b600061354b82613504565b9050919050565b600061355d826134f1565b9050919050565b82818337600083830152505050565b60005b83811015613591578082015181840152602081019050613576565b838111156135a0576000848401525b50505050565b60006135b1826135ea565b9050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b60006135f58261360f565b9050919050565bfe5b6000601f19601f8301169050919050565b60008160601b9050919050565b6003811061362d5761362c6135fc565b5b50565b613639816133ed565b811461364457600080fd5b50565b613650816133ff565b811461365b57600080fd5b50565b613667816134bb565b811461367257600080fd5b50565b61367e816134c5565b811461368957600080fd5b50565b6003811061369957600080fd5b50565b6136a581613524565b81146136b057600080fd5b5056fea2646970667358221220d5c9f5b6d4e12c49170d8830f9459ebc2386434f550d65bae2bbc0fcfbacfb6264736f6c63430007030033", + "devdoc": { + "kind": "dev", + "methods": { + "addTokenDestination(address)": { + "params": { + "_dst": "Destination address" + } + }, + "constructor": { + "params": { + "_graphToken": "Token to use for deposits and withdrawals", + "_masterCopy": "Address of the master copy to use to clone proxies" + } + }, + "createTokenLockWallet(address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)": { + "params": { + "_beneficiary": "Address of the beneficiary of locked tokens", + "_endTime": "End time of the release schedule", + "_managedAmount": "Amount of tokens to be managed by the lock contract", + "_owner": "Address of the contract owner", + "_periods": "Number of periods between start time and end time", + "_releaseStartTime": "Override time for when the releases start", + "_revocable": "Whether the contract is revocable", + "_startTime": "Start time of the release schedule" + } + }, + "deposit(uint256)": { + "details": "Even if the ERC20 token can be transferred directly to the contract this function provide a safe interface to do the transfer and avoid mistakes", + "params": { + "_amount": "Amount to deposit" + } + }, + "getAuthFunctionCallTarget(bytes4)": { + "params": { + "_sigHash": "Function signature hash" + }, + "returns": { + "_0": "Address of the target contract where to send the call" + } + }, + "getDeploymentAddress(bytes32,address,address)": { + "params": { + "_deployer": "Address of the deployer that creates the contract", + "_implementation": "Address of the proxy target implementation", + "_salt": "Bytes32 salt to use for CREATE2" + }, + "returns": { + "_0": "Address of the counterfactual MinimalProxy" + } + }, + "getTokenDestinations()": { + "returns": { + "_0": "Array of addresses authorized to pull funds from a token lock" + } + }, + "isAuthFunctionCall(bytes4)": { + "params": { + "_sigHash": "Function signature hash" + }, + "returns": { + "_0": "True if authorized" + } + }, + "isTokenDestination(address)": { + "params": { + "_dst": "Destination address" + }, + "returns": { + "_0": "True if authorized" + } + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "removeTokenDestination(address)": { + "params": { + "_dst": "Destination address" + } + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." + }, + "setAuthFunctionCall(string,address)": { + "details": "Input expected is the function signature as 'transfer(address,uint256)'", + "params": { + "_signature": "Function signature", + "_target": "Address of the destination contract to call" + } + }, + "setAuthFunctionCallMany(string[],address[])": { + "details": "Input expected is the function signature as 'transfer(address,uint256)'", + "params": { + "_signatures": "Function signatures", + "_targets": "Address of the destination contract to call" + } + }, + "setMasterCopy(address)": { + "params": { + "_masterCopy": "Address of contract bytecode to factory clone" + } + }, + "token()": { + "returns": { + "_0": "Token used for transfers and approvals" + } + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + }, + "unsetAuthFunctionCall(string)": { + "details": "Input expected is the function signature as 'transfer(address,uint256)'", + "params": { + "_signature": "Function signature" + } + }, + "withdraw(uint256)": { + "details": "Escape hatch in case of mistakes or to recover remaining funds", + "params": { + "_amount": "Amount of tokens to withdraw" + } + } + }, + "title": "GraphTokenLockManager", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "addTokenDestination(address)": { + "notice": "Adds an address that can be allowed by a token lock to pull funds" + }, + "constructor": { + "notice": "Constructor." + }, + "createTokenLockWallet(address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)": { + "notice": "Creates and fund a new token lock wallet using a minimum proxy" + }, + "deposit(uint256)": { + "notice": "Deposits tokens into the contract" + }, + "getAuthFunctionCallTarget(bytes4)": { + "notice": "Gets the target contract to call for a particular function signature" + }, + "getDeploymentAddress(bytes32,address,address)": { + "notice": "Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation" + }, + "getTokenDestinations()": { + "notice": "Returns an array of authorized destination addresses" + }, + "isAuthFunctionCall(bytes4)": { + "notice": "Returns true if the function call is authorized" + }, + "isTokenDestination(address)": { + "notice": "Returns True if the address is authorized to be a destination of tokens" + }, + "removeTokenDestination(address)": { + "notice": "Removes an address that can be allowed by a token lock to pull funds" + }, + "setAuthFunctionCall(string,address)": { + "notice": "Sets an authorized function call to target" + }, + "setAuthFunctionCallMany(string[],address[])": { + "notice": "Sets an authorized function call to target in bulk" + }, + "setMasterCopy(address)": { + "notice": "Sets the masterCopy bytecode to use to create clones of TokenLock contracts" + }, + "token()": { + "notice": "Gets the GRT token address" + }, + "unsetAuthFunctionCall(string)": { + "notice": "Unsets an authorized function call to target" + }, + "withdraw(uint256)": { + "notice": "Withdraws tokens from the contract" + } + }, + "notice": "This contract manages a list of authorized function calls and targets that can be called by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts. This contract receives funds to make the process of creating TokenLockWallet contracts easier by distributing them the initial tokens to be managed. The owner can setup a list of token destinations that will be used by TokenLock contracts to approve the pulling of funds, this way in can be guaranteed that only protocol contracts will manipulate users funds.", + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 672, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "_owner", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 3988, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "authFnCalls", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_bytes4,t_address)" + }, + { + "astId": 3990, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "_tokenDestinations", + "offset": 0, + "slot": "2", + "type": "t_struct(AddressSet)2629_storage" + }, + { + "astId": 3992, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "masterCopy", + "offset": 0, + "slot": "4", + "type": "t_address" + }, + { + "astId": 3994, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "_token", + "offset": 0, + "slot": "5", + "type": "t_contract(IERC20)1710" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_bytes32)dyn_storage": { + "base": "t_bytes32", + "encoding": "dynamic_array", + "label": "bytes32[]", + "numberOfBytes": "32" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_bytes4": { + "encoding": "inplace", + "label": "bytes4", + "numberOfBytes": "4" + }, + "t_contract(IERC20)1710": { + "encoding": "inplace", + "label": "contract IERC20", + "numberOfBytes": "20" + }, + "t_mapping(t_bytes32,t_uint256)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_mapping(t_bytes4,t_address)": { + "encoding": "mapping", + "key": "t_bytes4", + "label": "mapping(bytes4 => address)", + "numberOfBytes": "32", + "value": "t_address" + }, + "t_struct(AddressSet)2629_storage": { + "encoding": "inplace", + "label": "struct EnumerableSet.AddressSet", + "members": [ + { + "astId": 2628, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "_inner", + "offset": 0, + "slot": "0", + "type": "t_struct(Set)2364_storage" + } + ], + "numberOfBytes": "64" + }, + "t_struct(Set)2364_storage": { + "encoding": "inplace", + "label": "struct EnumerableSet.Set", + "members": [ + { + "astId": 2359, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "_values", + "offset": 0, + "slot": "0", + "type": "t_array(t_bytes32)dyn_storage" + }, + { + "astId": 2363, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "_indexes", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_bytes32,t_uint256)" + } + ], + "numberOfBytes": "64" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} \ No newline at end of file diff --git a/packages/token-distribution/deployments/mainnet/GraphTokenLockManager-Migrations.json b/packages/token-distribution/deployments/mainnet/GraphTokenLockManager-Migrations.json new file mode 100644 index 000000000..0d08ba652 --- /dev/null +++ b/packages/token-distribution/deployments/mainnet/GraphTokenLockManager-Migrations.json @@ -0,0 +1,926 @@ +{ + "address": "0xfe69D738344050F3b4351428Ddc18577d1e4D21A", + "abi": [ + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_graphToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_masterCopy", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes4", + "name": "sigHash", + "type": "bytes4" + }, + { + "indexed": true, + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "indexed": false, + "internalType": "string", + "name": "signature", + "type": "string" + } + ], + "name": "FunctionCallAuth", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "masterCopy", + "type": "address" + } + ], + "name": "MasterCopyUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "proxy", + "type": "address" + } + ], + "name": "ProxyCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "dst", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "TokenDestinationAllowed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "contractAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "initHash", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "managedAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "startTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "endTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "periods", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "releaseStartTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "vestingCliffTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "enum IGraphTokenLock.Revocability", + "name": "revocable", + "type": "uint8" + } + ], + "name": "TokenLockCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensDeposited", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensWithdrawn", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_dst", + "type": "address" + } + ], + "name": "addTokenDestination", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "", + "type": "bytes4" + } + ], + "name": "authFnCalls", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_owner", + "type": "address" + }, + { + "internalType": "address", + "name": "_beneficiary", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_managedAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_startTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_endTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_periods", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_releaseStartTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_vestingCliffTime", + "type": "uint256" + }, + { + "internalType": "enum IGraphTokenLock.Revocability", + "name": "_revocable", + "type": "uint8" + } + ], + "name": "createTokenLockWallet", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "deposit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_sigHash", + "type": "bytes4" + } + ], + "name": "getAuthFunctionCallTarget", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_salt", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "_implementation", + "type": "address" + } + ], + "name": "getDeploymentAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getTokenDestinations", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_sigHash", + "type": "bytes4" + } + ], + "name": "isAuthFunctionCall", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_dst", + "type": "address" + } + ], + "name": "isTokenDestination", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "masterCopy", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_dst", + "type": "address" + } + ], + "name": "removeTokenDestination", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_signature", + "type": "string" + }, + { + "internalType": "address", + "name": "_target", + "type": "address" + } + ], + "name": "setAuthFunctionCall", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string[]", + "name": "_signatures", + "type": "string[]" + }, + { + "internalType": "address[]", + "name": "_targets", + "type": "address[]" + } + ], + "name": "setAuthFunctionCallMany", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_masterCopy", + "type": "address" + } + ], + "name": "setMasterCopy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "token", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_signature", + "type": "string" + } + ], + "name": "unsetAuthFunctionCall", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0xbf444265f96c20ae89d8126a2ead6ba4a6c48a7d73e59a3a8e6a675ef121b742", + "receipt": { + "to": null, + "from": "0xE04FcE05E9B8d21521bd1B0f069982c03BD31F76", + "contractAddress": "0xfe69D738344050F3b4351428Ddc18577d1e4D21A", + "transactionIndex": 93, + "gasUsed": "3166292", + "logsBloom": "0x00000000000000000000000000000000004004020000000000800000000000000000000000000000000002000000000000000000000000000000000000000000000004000000000000000000000000000001000000000000000000400000000000000000020000000000000000000800000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000044000000000000000000000000000008000004000000000000000000000000000000000000000020000020000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x98555cef5de941d3d10d21c9a7db2c36fb76cc4bfd48376a5e61056b546c35a9", + "transactionHash": "0xbf444265f96c20ae89d8126a2ead6ba4a6c48a7d73e59a3a8e6a675ef121b742", + "logs": [ + { + "transactionIndex": 93, + "blockNumber": 16477321, + "transactionHash": "0xbf444265f96c20ae89d8126a2ead6ba4a6c48a7d73e59a3a8e6a675ef121b742", + "address": "0xfe69D738344050F3b4351428Ddc18577d1e4D21A", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000e04fce05e9b8d21521bd1b0f069982c03bd31f76" + ], + "data": "0x", + "logIndex": 141, + "blockHash": "0x98555cef5de941d3d10d21c9a7db2c36fb76cc4bfd48376a5e61056b546c35a9" + }, + { + "transactionIndex": 93, + "blockNumber": 16477321, + "transactionHash": "0xbf444265f96c20ae89d8126a2ead6ba4a6c48a7d73e59a3a8e6a675ef121b742", + "address": "0xfe69D738344050F3b4351428Ddc18577d1e4D21A", + "topics": [ + "0x30909084afc859121ffc3a5aef7fe37c540a9a1ef60bd4d8dcdb76376fadf9de", + "0x000000000000000000000000ec188a659fd9e3caad5b14011a18b9f214d54eab" + ], + "data": "0x", + "logIndex": 142, + "blockHash": "0x98555cef5de941d3d10d21c9a7db2c36fb76cc4bfd48376a5e61056b546c35a9" + } + ], + "blockNumber": 16477321, + "cumulativeGasUsed": "8726275", + "status": 1, + "byzantium": true + }, + "args": [ + "0xc944E90C64B2c07662A292be6244BDf05Cda44a7", + "0xec188A659fD9e3CAAD5b14011a18B9F214D54eab" + ], + "solcInputHash": "6f5e8f450f52dd96ebb796aa6620fee9", + "metadata": "{\"compiler\":{\"version\":\"0.7.3+commit.9bfce1f6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"_graphToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_masterCopy\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes4\",\"name\":\"sigHash\",\"type\":\"bytes4\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"signature\",\"type\":\"string\"}],\"name\":\"FunctionCallAuth\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"masterCopy\",\"type\":\"address\"}],\"name\":\"MasterCopyUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"proxy\",\"type\":\"address\"}],\"name\":\"ProxyCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dst\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"}],\"name\":\"TokenDestinationAllowed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"contractAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"initHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"managedAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"startTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"endTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"periods\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"releaseStartTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"vestingCliffTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"enum IGraphTokenLock.Revocability\",\"name\":\"revocable\",\"type\":\"uint8\"}],\"name\":\"TokenLockCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensWithdrawn\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_dst\",\"type\":\"address\"}],\"name\":\"addTokenDestination\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"name\":\"authFnCalls\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_beneficiary\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_managedAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_startTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_endTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_periods\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_releaseStartTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_vestingCliffTime\",\"type\":\"uint256\"},{\"internalType\":\"enum IGraphTokenLock.Revocability\",\"name\":\"_revocable\",\"type\":\"uint8\"}],\"name\":\"createTokenLockWallet\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"deposit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"_sigHash\",\"type\":\"bytes4\"}],\"name\":\"getAuthFunctionCallTarget\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_salt\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"}],\"name\":\"getDeploymentAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTokenDestinations\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"_sigHash\",\"type\":\"bytes4\"}],\"name\":\"isAuthFunctionCall\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_dst\",\"type\":\"address\"}],\"name\":\"isTokenDestination\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"masterCopy\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_dst\",\"type\":\"address\"}],\"name\":\"removeTokenDestination\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_signature\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"_target\",\"type\":\"address\"}],\"name\":\"setAuthFunctionCall\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string[]\",\"name\":\"_signatures\",\"type\":\"string[]\"},{\"internalType\":\"address[]\",\"name\":\"_targets\",\"type\":\"address[]\"}],\"name\":\"setAuthFunctionCallMany\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_masterCopy\",\"type\":\"address\"}],\"name\":\"setMasterCopy\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_signature\",\"type\":\"string\"}],\"name\":\"unsetAuthFunctionCall\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"addTokenDestination(address)\":{\"params\":{\"_dst\":\"Destination address\"}},\"constructor\":{\"params\":{\"_graphToken\":\"Token to use for deposits and withdrawals\",\"_masterCopy\":\"Address of the master copy to use to clone proxies\"}},\"createTokenLockWallet(address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)\":{\"params\":{\"_beneficiary\":\"Address of the beneficiary of locked tokens\",\"_endTime\":\"End time of the release schedule\",\"_managedAmount\":\"Amount of tokens to be managed by the lock contract\",\"_owner\":\"Address of the contract owner\",\"_periods\":\"Number of periods between start time and end time\",\"_releaseStartTime\":\"Override time for when the releases start\",\"_revocable\":\"Whether the contract is revocable\",\"_startTime\":\"Start time of the release schedule\"}},\"deposit(uint256)\":{\"details\":\"Even if the ERC20 token can be transferred directly to the contract this function provide a safe interface to do the transfer and avoid mistakes\",\"params\":{\"_amount\":\"Amount to deposit\"}},\"getAuthFunctionCallTarget(bytes4)\":{\"params\":{\"_sigHash\":\"Function signature hash\"},\"returns\":{\"_0\":\"Address of the target contract where to send the call\"}},\"getDeploymentAddress(bytes32,address)\":{\"params\":{\"_implementation\":\"Address of the proxy target implementation\",\"_salt\":\"Bytes32 salt to use for CREATE2\"},\"returns\":{\"_0\":\"Address of the counterfactual MinimalProxy\"}},\"getTokenDestinations()\":{\"returns\":{\"_0\":\"Array of addresses authorized to pull funds from a token lock\"}},\"isAuthFunctionCall(bytes4)\":{\"params\":{\"_sigHash\":\"Function signature hash\"},\"returns\":{\"_0\":\"True if authorized\"}},\"isTokenDestination(address)\":{\"params\":{\"_dst\":\"Destination address\"},\"returns\":{\"_0\":\"True if authorized\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"removeTokenDestination(address)\":{\"params\":{\"_dst\":\"Destination address\"}},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"setAuthFunctionCall(string,address)\":{\"details\":\"Input expected is the function signature as 'transfer(address,uint256)'\",\"params\":{\"_signature\":\"Function signature\",\"_target\":\"Address of the destination contract to call\"}},\"setAuthFunctionCallMany(string[],address[])\":{\"details\":\"Input expected is the function signature as 'transfer(address,uint256)'\",\"params\":{\"_signatures\":\"Function signatures\",\"_targets\":\"Address of the destination contract to call\"}},\"setMasterCopy(address)\":{\"params\":{\"_masterCopy\":\"Address of contract bytecode to factory clone\"}},\"token()\":{\"returns\":{\"_0\":\"Token used for transfers and approvals\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"unsetAuthFunctionCall(string)\":{\"details\":\"Input expected is the function signature as 'transfer(address,uint256)'\",\"params\":{\"_signature\":\"Function signature\"}},\"withdraw(uint256)\":{\"details\":\"Escape hatch in case of mistakes or to recover remaining funds\",\"params\":{\"_amount\":\"Amount of tokens to withdraw\"}}},\"title\":\"GraphTokenLockManager\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"addTokenDestination(address)\":{\"notice\":\"Adds an address that can be allowed by a token lock to pull funds\"},\"constructor\":{\"notice\":\"Constructor.\"},\"createTokenLockWallet(address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)\":{\"notice\":\"Creates and fund a new token lock wallet using a minimum proxy\"},\"deposit(uint256)\":{\"notice\":\"Deposits tokens into the contract\"},\"getAuthFunctionCallTarget(bytes4)\":{\"notice\":\"Gets the target contract to call for a particular function signature\"},\"getDeploymentAddress(bytes32,address)\":{\"notice\":\"Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation\"},\"getTokenDestinations()\":{\"notice\":\"Returns an array of authorized destination addresses\"},\"isAuthFunctionCall(bytes4)\":{\"notice\":\"Returns true if the function call is authorized\"},\"isTokenDestination(address)\":{\"notice\":\"Returns True if the address is authorized to be a destination of tokens\"},\"removeTokenDestination(address)\":{\"notice\":\"Removes an address that can be allowed by a token lock to pull funds\"},\"setAuthFunctionCall(string,address)\":{\"notice\":\"Sets an authorized function call to target\"},\"setAuthFunctionCallMany(string[],address[])\":{\"notice\":\"Sets an authorized function call to target in bulk\"},\"setMasterCopy(address)\":{\"notice\":\"Sets the masterCopy bytecode to use to create clones of TokenLock contracts\"},\"token()\":{\"notice\":\"Gets the GRT token address\"},\"unsetAuthFunctionCall(string)\":{\"notice\":\"Unsets an authorized function call to target\"},\"withdraw(uint256)\":{\"notice\":\"Withdraws tokens from the contract\"}},\"notice\":\"This contract manages a list of authorized function calls and targets that can be called by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts. This contract receives funds to make the process of creating TokenLockWallet contracts easier by distributing them the initial tokens to be managed. The owner can setup a list of token destinations that will be used by TokenLock contracts to approve the pulling of funds, this way in can be guaranteed that only protocol contracts will manipulate users funds.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/GraphTokenLockManager.sol\":\"GraphTokenLockManager\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor () internal {\\n address msgSender = _msgSender();\\n _owner = msgSender;\\n emit OwnershipTransferred(address(0), msgSender);\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n emit OwnershipTransferred(_owner, address(0));\\n _owner = address(0);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n emit OwnershipTransferred(_owner, newOwner);\\n _owner = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0x15e2d5bd4c28a88548074c54d220e8086f638a71ed07e6b3ba5a70066fcf458d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/math/SafeMath.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Wrappers over Solidity's arithmetic operations with added overflow\\n * checks.\\n *\\n * Arithmetic operations in Solidity wrap on overflow. This can easily result\\n * in bugs, because programmers usually assume that an overflow raises an\\n * error, which is the standard behavior in high level programming languages.\\n * `SafeMath` restores this intuition by reverting the transaction when an\\n * operation overflows.\\n *\\n * Using this library instead of the unchecked operations eliminates an entire\\n * class of bugs, so it's recommended to use it always.\\n */\\nlibrary SafeMath {\\n /**\\n * @dev Returns the addition of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n uint256 c = a + b;\\n if (c < a) return (false, 0);\\n return (true, c);\\n }\\n\\n /**\\n * @dev Returns the substraction of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b > a) return (false, 0);\\n return (true, a - b);\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\\n if (a == 0) return (true, 0);\\n uint256 c = a * b;\\n if (c / a != b) return (false, 0);\\n return (true, c);\\n }\\n\\n /**\\n * @dev Returns the division of two unsigned integers, with a division by zero flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b == 0) return (false, 0);\\n return (true, a / b);\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b == 0) return (false, 0);\\n return (true, a % b);\\n }\\n\\n /**\\n * @dev Returns the addition of two unsigned integers, reverting on\\n * overflow.\\n *\\n * Counterpart to Solidity's `+` operator.\\n *\\n * Requirements:\\n *\\n * - Addition cannot overflow.\\n */\\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\\n uint256 c = a + b;\\n require(c >= a, \\\"SafeMath: addition overflow\\\");\\n return c;\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting on\\n * overflow (when the result is negative).\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n *\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b <= a, \\\"SafeMath: subtraction overflow\\\");\\n return a - b;\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, reverting on\\n * overflow.\\n *\\n * Counterpart to Solidity's `*` operator.\\n *\\n * Requirements:\\n *\\n * - Multiplication cannot overflow.\\n */\\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\\n if (a == 0) return 0;\\n uint256 c = a * b;\\n require(c / a == b, \\\"SafeMath: multiplication overflow\\\");\\n return c;\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers, reverting on\\n * division by zero. The result is rounded towards zero.\\n *\\n * Counterpart to Solidity's `/` operator. Note: this function uses a\\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\\n * uses an invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b > 0, \\\"SafeMath: division by zero\\\");\\n return a / b;\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * reverting when dividing by zero.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b > 0, \\\"SafeMath: modulo by zero\\\");\\n return a % b;\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\\n * overflow (when the result is negative).\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {trySub}.\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n *\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b <= a, errorMessage);\\n return a - b;\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers, reverting with custom message on\\n * division by zero. The result is rounded towards zero.\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {tryDiv}.\\n *\\n * Counterpart to Solidity's `/` operator. Note: this function uses a\\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\\n * uses an invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b > 0, errorMessage);\\n return a / b;\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * reverting with custom message when dividing by zero.\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {tryMod}.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b > 0, errorMessage);\\n return a % b;\\n }\\n}\\n\",\"keccak256\":\"0xcc78a17dd88fa5a2edc60c8489e2f405c0913b377216a5b26b35656b2d0dab52\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `recipient`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address recipient, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `sender` to `recipient` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n}\\n\",\"keccak256\":\"0x5f02220344881ce43204ae4a6281145a67bc52c2bb1290a791857df3d19d78f5\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\nimport \\\"./IERC20.sol\\\";\\nimport \\\"../../math/SafeMath.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @title SafeERC20\\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\\n * contract returns false). Tokens that return no value (and instead revert or\\n * throw on failure) are also supported, non-reverting calls are assumed to be\\n * successful.\\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\n */\\nlibrary SafeERC20 {\\n using SafeMath for uint256;\\n using Address for address;\\n\\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\\n }\\n\\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\\n }\\n\\n /**\\n * @dev Deprecated. This function has issues similar to the ones found in\\n * {IERC20-approve}, and its usage is discouraged.\\n *\\n * Whenever possible, use {safeIncreaseAllowance} and\\n * {safeDecreaseAllowance} instead.\\n */\\n function safeApprove(IERC20 token, address spender, uint256 value) internal {\\n // safeApprove should only be called when setting an initial allowance,\\n // or when resetting it to zero. To increase and decrease it, use\\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\\n // solhint-disable-next-line max-line-length\\n require((value == 0) || (token.allowance(address(this), spender) == 0),\\n \\\"SafeERC20: approve from non-zero to non-zero allowance\\\"\\n );\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\\n }\\n\\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n uint256 newAllowance = token.allowance(address(this), spender).add(value);\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n uint256 newAllowance = token.allowance(address(this), spender).sub(value, \\\"SafeERC20: decreased allowance below zero\\\");\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n */\\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that\\n // the target address contains contract code and also asserts for success in the low-level call.\\n\\n bytes memory returndata = address(token).functionCall(data, \\\"SafeERC20: low-level call failed\\\");\\n if (returndata.length > 0) { // Return data is optional\\n // solhint-disable-next-line max-line-length\\n require(abi.decode(returndata, (bool)), \\\"SafeERC20: ERC20 operation did not succeed\\\");\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf12dfbe97e6276980b83d2830bb0eb75e0cf4f3e626c2471137f82158ae6a0fc\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.2 <0.8.0;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize, which returns 0 for contracts in\\n // construction, since the code is only stored at the end of the\\n // constructor execution.\\n\\n uint256 size;\\n // solhint-disable-next-line no-inline-assembly\\n assembly { size := extcodesize(account) }\\n return size > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls, avoid-call-value\\n (bool success, ) = recipient.call{ value: amount }(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain`call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.call{ value: value }(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x28911e614500ae7c607a432a709d35da25f3bc5ddc8bd12b278b66358070c0ea\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/*\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with GSN meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address payable) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes memory) {\\n this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0x8d3cb350f04ff49cfb10aef08d87f19dcbaecc8027b0bed12f3275cd12f38cf0\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Create2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Helper to make usage of the `CREATE2` EVM opcode easier and safer.\\n * `CREATE2` can be used to compute in advance the address where a smart\\n * contract will be deployed, which allows for interesting new mechanisms known\\n * as 'counterfactual interactions'.\\n *\\n * See the https://eips.ethereum.org/EIPS/eip-1014#motivation[EIP] for more\\n * information.\\n */\\nlibrary Create2 {\\n /**\\n * @dev Deploys a contract using `CREATE2`. The address where the contract\\n * will be deployed can be known in advance via {computeAddress}.\\n *\\n * The bytecode for a contract can be obtained from Solidity with\\n * `type(contractName).creationCode`.\\n *\\n * Requirements:\\n *\\n * - `bytecode` must not be empty.\\n * - `salt` must have not been used for `bytecode` already.\\n * - the factory must have a balance of at least `amount`.\\n * - if `amount` is non-zero, `bytecode` must have a `payable` constructor.\\n */\\n function deploy(uint256 amount, bytes32 salt, bytes memory bytecode) internal returns (address) {\\n address addr;\\n require(address(this).balance >= amount, \\\"Create2: insufficient balance\\\");\\n require(bytecode.length != 0, \\\"Create2: bytecode length is zero\\\");\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n addr := create2(amount, add(bytecode, 0x20), mload(bytecode), salt)\\n }\\n require(addr != address(0), \\\"Create2: Failed on deploy\\\");\\n return addr;\\n }\\n\\n /**\\n * @dev Returns the address where a contract will be stored if deployed via {deploy}. Any change in the\\n * `bytecodeHash` or `salt` will result in a new destination address.\\n */\\n function computeAddress(bytes32 salt, bytes32 bytecodeHash) internal view returns (address) {\\n return computeAddress(salt, bytecodeHash, address(this));\\n }\\n\\n /**\\n * @dev Returns the address where a contract will be stored if deployed via {deploy} from a contract located at\\n * `deployer`. If `deployer` is this contract's address, returns the same value as {computeAddress}.\\n */\\n function computeAddress(bytes32 salt, bytes32 bytecodeHash, address deployer) internal pure returns (address) {\\n bytes32 _data = keccak256(\\n abi.encodePacked(bytes1(0xff), deployer, salt, bytecodeHash)\\n );\\n return address(uint160(uint256(_data)));\\n }\\n}\\n\",\"keccak256\":\"0x0a0b021149946014fe1cd04af11e7a937a29986c47e8b1b718c2d50d729472db\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/EnumerableSet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Library for managing\\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\\n * types.\\n *\\n * Sets have the following properties:\\n *\\n * - Elements are added, removed, and checked for existence in constant time\\n * (O(1)).\\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\\n *\\n * ```\\n * contract Example {\\n * // Add the library methods\\n * using EnumerableSet for EnumerableSet.AddressSet;\\n *\\n * // Declare a set state variable\\n * EnumerableSet.AddressSet private mySet;\\n * }\\n * ```\\n *\\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\\n * and `uint256` (`UintSet`) are supported.\\n */\\nlibrary EnumerableSet {\\n // To implement this library for multiple types with as little code\\n // repetition as possible, we write it in terms of a generic Set type with\\n // bytes32 values.\\n // The Set implementation uses private functions, and user-facing\\n // implementations (such as AddressSet) are just wrappers around the\\n // underlying Set.\\n // This means that we can only create new EnumerableSets for types that fit\\n // in bytes32.\\n\\n struct Set {\\n // Storage of set values\\n bytes32[] _values;\\n\\n // Position of the value in the `values` array, plus 1 because index 0\\n // means a value is not in the set.\\n mapping (bytes32 => uint256) _indexes;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function _add(Set storage set, bytes32 value) private returns (bool) {\\n if (!_contains(set, value)) {\\n set._values.push(value);\\n // The value is stored at length-1, but we add 1 to all indexes\\n // and use 0 as a sentinel value\\n set._indexes[value] = set._values.length;\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function _remove(Set storage set, bytes32 value) private returns (bool) {\\n // We read and store the value's index to prevent multiple reads from the same storage slot\\n uint256 valueIndex = set._indexes[value];\\n\\n if (valueIndex != 0) { // Equivalent to contains(set, value)\\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\\n // the array, and then remove the last element (sometimes called as 'swap and pop').\\n // This modifies the order of the array, as noted in {at}.\\n\\n uint256 toDeleteIndex = valueIndex - 1;\\n uint256 lastIndex = set._values.length - 1;\\n\\n // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs\\n // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.\\n\\n bytes32 lastvalue = set._values[lastIndex];\\n\\n // Move the last value to the index where the value to delete is\\n set._values[toDeleteIndex] = lastvalue;\\n // Update the index for the moved value\\n set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based\\n\\n // Delete the slot where the moved value was stored\\n set._values.pop();\\n\\n // Delete the index for the deleted slot\\n delete set._indexes[value];\\n\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\\n return set._indexes[value] != 0;\\n }\\n\\n /**\\n * @dev Returns the number of values on the set. O(1).\\n */\\n function _length(Set storage set) private view returns (uint256) {\\n return set._values.length;\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\\n require(set._values.length > index, \\\"EnumerableSet: index out of bounds\\\");\\n return set._values[index];\\n }\\n\\n // Bytes32Set\\n\\n struct Bytes32Set {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _add(set._inner, value);\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _remove(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\\n return _contains(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(Bytes32Set storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\\n return _at(set._inner, index);\\n }\\n\\n // AddressSet\\n\\n struct AddressSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(AddressSet storage set, address value) internal returns (bool) {\\n return _add(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(AddressSet storage set, address value) internal returns (bool) {\\n return _remove(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(AddressSet storage set, address value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(AddressSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\\n return address(uint160(uint256(_at(set._inner, index))));\\n }\\n\\n\\n // UintSet\\n\\n struct UintSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(UintSet storage set, uint256 value) internal returns (bool) {\\n return _add(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\\n return _remove(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns the number of values on the set. O(1).\\n */\\n function length(UintSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\\n return uint256(_at(set._inner, index));\\n }\\n}\\n\",\"keccak256\":\"0x1562cd9922fbf739edfb979f506809e2743789cbde3177515542161c3d04b164\",\"license\":\"MIT\"},\"contracts/GraphTokenLockManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/EnumerableSet.sol\\\";\\n\\nimport \\\"./MinimalProxyFactory.sol\\\";\\nimport \\\"./IGraphTokenLockManager.sol\\\";\\n\\n/**\\n * @title GraphTokenLockManager\\n * @notice This contract manages a list of authorized function calls and targets that can be called\\n * by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts.\\n *\\n * This contract receives funds to make the process of creating TokenLockWallet contracts\\n * easier by distributing them the initial tokens to be managed.\\n *\\n * The owner can setup a list of token destinations that will be used by TokenLock contracts to\\n * approve the pulling of funds, this way in can be guaranteed that only protocol contracts\\n * will manipulate users funds.\\n */\\ncontract GraphTokenLockManager is MinimalProxyFactory, IGraphTokenLockManager {\\n using SafeERC20 for IERC20;\\n using EnumerableSet for EnumerableSet.AddressSet;\\n\\n // -- State --\\n\\n mapping(bytes4 => address) public authFnCalls;\\n EnumerableSet.AddressSet private _tokenDestinations;\\n\\n address public masterCopy;\\n IERC20 private _token;\\n\\n // -- Events --\\n\\n event MasterCopyUpdated(address indexed masterCopy);\\n event TokenLockCreated(\\n address indexed contractAddress,\\n bytes32 indexed initHash,\\n address indexed beneficiary,\\n address token,\\n uint256 managedAmount,\\n uint256 startTime,\\n uint256 endTime,\\n uint256 periods,\\n uint256 releaseStartTime,\\n uint256 vestingCliffTime,\\n IGraphTokenLock.Revocability revocable\\n );\\n\\n event TokensDeposited(address indexed sender, uint256 amount);\\n event TokensWithdrawn(address indexed sender, uint256 amount);\\n\\n event FunctionCallAuth(address indexed caller, bytes4 indexed sigHash, address indexed target, string signature);\\n event TokenDestinationAllowed(address indexed dst, bool allowed);\\n\\n /**\\n * Constructor.\\n * @param _graphToken Token to use for deposits and withdrawals\\n * @param _masterCopy Address of the master copy to use to clone proxies\\n */\\n constructor(IERC20 _graphToken, address _masterCopy) {\\n require(address(_graphToken) != address(0), \\\"Token cannot be zero\\\");\\n _token = _graphToken;\\n setMasterCopy(_masterCopy);\\n }\\n\\n // -- Factory --\\n\\n /**\\n * @notice Sets the masterCopy bytecode to use to create clones of TokenLock contracts\\n * @param _masterCopy Address of contract bytecode to factory clone\\n */\\n function setMasterCopy(address _masterCopy) public override onlyOwner {\\n require(_masterCopy != address(0), \\\"MasterCopy cannot be zero\\\");\\n masterCopy = _masterCopy;\\n emit MasterCopyUpdated(_masterCopy);\\n }\\n\\n /**\\n * @notice Creates and fund a new token lock wallet using a minimum proxy\\n * @param _owner Address of the contract owner\\n * @param _beneficiary Address of the beneficiary of locked tokens\\n * @param _managedAmount Amount of tokens to be managed by the lock contract\\n * @param _startTime Start time of the release schedule\\n * @param _endTime End time of the release schedule\\n * @param _periods Number of periods between start time and end time\\n * @param _releaseStartTime Override time for when the releases start\\n * @param _revocable Whether the contract is revocable\\n */\\n function createTokenLockWallet(\\n address _owner,\\n address _beneficiary,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n IGraphTokenLock.Revocability _revocable\\n ) external override onlyOwner {\\n require(_token.balanceOf(address(this)) >= _managedAmount, \\\"Not enough tokens to create lock\\\");\\n\\n // Create contract using a minimal proxy and call initializer\\n bytes memory initializer = abi.encodeWithSignature(\\n \\\"initialize(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)\\\",\\n address(this),\\n _owner,\\n _beneficiary,\\n address(_token),\\n _managedAmount,\\n _startTime,\\n _endTime,\\n _periods,\\n _releaseStartTime,\\n _vestingCliffTime,\\n _revocable\\n );\\n address contractAddress = _deployProxy2(keccak256(initializer), masterCopy, initializer);\\n\\n // Send managed amount to the created contract\\n _token.safeTransfer(contractAddress, _managedAmount);\\n\\n emit TokenLockCreated(\\n contractAddress,\\n keccak256(initializer),\\n _beneficiary,\\n address(_token),\\n _managedAmount,\\n _startTime,\\n _endTime,\\n _periods,\\n _releaseStartTime,\\n _vestingCliffTime,\\n _revocable\\n );\\n }\\n\\n // -- Funds Management --\\n\\n /**\\n * @notice Gets the GRT token address\\n * @return Token used for transfers and approvals\\n */\\n function token() external view override returns (IERC20) {\\n return _token;\\n }\\n\\n /**\\n * @notice Deposits tokens into the contract\\n * @dev Even if the ERC20 token can be transferred directly to the contract\\n * this function provide a safe interface to do the transfer and avoid mistakes\\n * @param _amount Amount to deposit\\n */\\n function deposit(uint256 _amount) external override {\\n require(_amount > 0, \\\"Amount cannot be zero\\\");\\n _token.safeTransferFrom(msg.sender, address(this), _amount);\\n emit TokensDeposited(msg.sender, _amount);\\n }\\n\\n /**\\n * @notice Withdraws tokens from the contract\\n * @dev Escape hatch in case of mistakes or to recover remaining funds\\n * @param _amount Amount of tokens to withdraw\\n */\\n function withdraw(uint256 _amount) external override onlyOwner {\\n require(_amount > 0, \\\"Amount cannot be zero\\\");\\n _token.safeTransfer(msg.sender, _amount);\\n emit TokensWithdrawn(msg.sender, _amount);\\n }\\n\\n // -- Token Destinations --\\n\\n /**\\n * @notice Adds an address that can be allowed by a token lock to pull funds\\n * @param _dst Destination address\\n */\\n function addTokenDestination(address _dst) external override onlyOwner {\\n require(_dst != address(0), \\\"Destination cannot be zero\\\");\\n require(_tokenDestinations.add(_dst), \\\"Destination already added\\\");\\n emit TokenDestinationAllowed(_dst, true);\\n }\\n\\n /**\\n * @notice Removes an address that can be allowed by a token lock to pull funds\\n * @param _dst Destination address\\n */\\n function removeTokenDestination(address _dst) external override onlyOwner {\\n require(_tokenDestinations.remove(_dst), \\\"Destination already removed\\\");\\n emit TokenDestinationAllowed(_dst, false);\\n }\\n\\n /**\\n * @notice Returns True if the address is authorized to be a destination of tokens\\n * @param _dst Destination address\\n * @return True if authorized\\n */\\n function isTokenDestination(address _dst) external view override returns (bool) {\\n return _tokenDestinations.contains(_dst);\\n }\\n\\n /**\\n * @notice Returns an array of authorized destination addresses\\n * @return Array of addresses authorized to pull funds from a token lock\\n */\\n function getTokenDestinations() external view override returns (address[] memory) {\\n address[] memory dstList = new address[](_tokenDestinations.length());\\n for (uint256 i = 0; i < _tokenDestinations.length(); i++) {\\n dstList[i] = _tokenDestinations.at(i);\\n }\\n return dstList;\\n }\\n\\n // -- Function Call Authorization --\\n\\n /**\\n * @notice Sets an authorized function call to target\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @param _signature Function signature\\n * @param _target Address of the destination contract to call\\n */\\n function setAuthFunctionCall(string calldata _signature, address _target) external override onlyOwner {\\n _setAuthFunctionCall(_signature, _target);\\n }\\n\\n /**\\n * @notice Unsets an authorized function call to target\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @param _signature Function signature\\n */\\n function unsetAuthFunctionCall(string calldata _signature) external override onlyOwner {\\n bytes4 sigHash = _toFunctionSigHash(_signature);\\n authFnCalls[sigHash] = address(0);\\n\\n emit FunctionCallAuth(msg.sender, sigHash, address(0), _signature);\\n }\\n\\n /**\\n * @notice Sets an authorized function call to target in bulk\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @param _signatures Function signatures\\n * @param _targets Address of the destination contract to call\\n */\\n function setAuthFunctionCallMany(string[] calldata _signatures, address[] calldata _targets)\\n external\\n override\\n onlyOwner\\n {\\n require(_signatures.length == _targets.length, \\\"Array length mismatch\\\");\\n\\n for (uint256 i = 0; i < _signatures.length; i++) {\\n _setAuthFunctionCall(_signatures[i], _targets[i]);\\n }\\n }\\n\\n /**\\n * @notice Sets an authorized function call to target\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @dev Function signatures of Graph Protocol contracts to be used are known ahead of time\\n * @param _signature Function signature\\n * @param _target Address of the destination contract to call\\n */\\n function _setAuthFunctionCall(string calldata _signature, address _target) internal {\\n require(_target != address(this), \\\"Target must be other contract\\\");\\n require(Address.isContract(_target), \\\"Target must be a contract\\\");\\n\\n bytes4 sigHash = _toFunctionSigHash(_signature);\\n authFnCalls[sigHash] = _target;\\n\\n emit FunctionCallAuth(msg.sender, sigHash, _target, _signature);\\n }\\n\\n /**\\n * @notice Gets the target contract to call for a particular function signature\\n * @param _sigHash Function signature hash\\n * @return Address of the target contract where to send the call\\n */\\n function getAuthFunctionCallTarget(bytes4 _sigHash) public view override returns (address) {\\n return authFnCalls[_sigHash];\\n }\\n\\n /**\\n * @notice Returns true if the function call is authorized\\n * @param _sigHash Function signature hash\\n * @return True if authorized\\n */\\n function isAuthFunctionCall(bytes4 _sigHash) external view override returns (bool) {\\n return getAuthFunctionCallTarget(_sigHash) != address(0);\\n }\\n\\n /**\\n * @dev Converts a function signature string to 4-bytes hash\\n * @param _signature Function signature string\\n * @return Function signature hash\\n */\\n function _toFunctionSigHash(string calldata _signature) internal pure returns (bytes4) {\\n return _convertToBytes4(abi.encodeWithSignature(_signature));\\n }\\n\\n /**\\n * @dev Converts function signature bytes to function signature hash (bytes4)\\n * @param _signature Function signature\\n * @return Function signature in bytes4\\n */\\n function _convertToBytes4(bytes memory _signature) internal pure returns (bytes4) {\\n require(_signature.length == 4, \\\"Invalid method signature\\\");\\n bytes4 sigHash;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n sigHash := mload(add(_signature, 32))\\n }\\n return sigHash;\\n }\\n}\\n\",\"keccak256\":\"0x0384d62cb600eb4128baacf5bca60ea2cb0b68d2d013479daef65ed5f15446ef\",\"license\":\"MIT\"},\"contracts/IGraphTokenLock.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\ninterface IGraphTokenLock {\\n enum Revocability {\\n NotSet,\\n Enabled,\\n Disabled\\n }\\n\\n // -- Balances --\\n\\n function currentBalance() external view returns (uint256);\\n\\n // -- Time & Periods --\\n\\n function currentTime() external view returns (uint256);\\n\\n function duration() external view returns (uint256);\\n\\n function sinceStartTime() external view returns (uint256);\\n\\n function amountPerPeriod() external view returns (uint256);\\n\\n function periodDuration() external view returns (uint256);\\n\\n function currentPeriod() external view returns (uint256);\\n\\n function passedPeriods() external view returns (uint256);\\n\\n // -- Locking & Release Schedule --\\n\\n function availableAmount() external view returns (uint256);\\n\\n function vestedAmount() external view returns (uint256);\\n\\n function releasableAmount() external view returns (uint256);\\n\\n function totalOutstandingAmount() external view returns (uint256);\\n\\n function surplusAmount() external view returns (uint256);\\n\\n // -- Value Transfer --\\n\\n function release() external;\\n\\n function withdrawSurplus(uint256 _amount) external;\\n\\n function revoke() external;\\n}\\n\",\"keccak256\":\"0xceb9d258276fe25ec858191e1deae5778f1b2f612a669fb7b37bab1a064756ab\",\"license\":\"MIT\"},\"contracts/IGraphTokenLockManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nimport \\\"./IGraphTokenLock.sol\\\";\\n\\ninterface IGraphTokenLockManager {\\n // -- Factory --\\n\\n function setMasterCopy(address _masterCopy) external;\\n\\n function createTokenLockWallet(\\n address _owner,\\n address _beneficiary,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n IGraphTokenLock.Revocability _revocable\\n ) external;\\n\\n // -- Funds Management --\\n\\n function token() external returns (IERC20);\\n\\n function deposit(uint256 _amount) external;\\n\\n function withdraw(uint256 _amount) external;\\n\\n // -- Allowed Funds Destinations --\\n\\n function addTokenDestination(address _dst) external;\\n\\n function removeTokenDestination(address _dst) external;\\n\\n function isTokenDestination(address _dst) external view returns (bool);\\n\\n function getTokenDestinations() external view returns (address[] memory);\\n\\n // -- Function Call Authorization --\\n\\n function setAuthFunctionCall(string calldata _signature, address _target) external;\\n\\n function unsetAuthFunctionCall(string calldata _signature) external;\\n\\n function setAuthFunctionCallMany(string[] calldata _signatures, address[] calldata _targets) external;\\n\\n function getAuthFunctionCallTarget(bytes4 _sigHash) external view returns (address);\\n\\n function isAuthFunctionCall(bytes4 _sigHash) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x2d78d41909a6de5b316ac39b100ea087a8f317cf306379888a045523e15c4d9a\",\"license\":\"MIT\"},\"contracts/MinimalProxyFactory.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Create2.sol\\\";\\n\\n// Adapted from https://github.com/OpenZeppelin/openzeppelin-sdk/blob/v2.5.0/packages/lib/contracts/upgradeability/ProxyFactory.sol\\n// Based on https://eips.ethereum.org/EIPS/eip-1167\\ncontract MinimalProxyFactory is Ownable {\\n // -- Events --\\n\\n event ProxyCreated(address indexed proxy);\\n\\n /**\\n * @notice Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation\\n * @param _salt Bytes32 salt to use for CREATE2\\n * @param _implementation Address of the proxy target implementation\\n * @return Address of the counterfactual MinimalProxy\\n */\\n function getDeploymentAddress(bytes32 _salt, address _implementation) external view returns (address) {\\n return Create2.computeAddress(_salt, keccak256(_getContractCreationCode(_implementation)), address(this));\\n }\\n\\n /**\\n * @notice Deploys a MinimalProxy with CREATE2\\n * @param _salt Bytes32 salt to use for CREATE2\\n * @param _implementation Address of the proxy target implementation\\n * @param _data Bytes with the initializer call\\n * @return Address of the deployed MinimalProxy\\n */\\n function _deployProxy2(\\n bytes32 _salt,\\n address _implementation,\\n bytes memory _data\\n ) internal returns (address) {\\n address proxyAddress = Create2.deploy(0, _salt, _getContractCreationCode(_implementation));\\n\\n emit ProxyCreated(proxyAddress);\\n\\n // Call function with data\\n if (_data.length > 0) {\\n Address.functionCall(proxyAddress, _data);\\n }\\n\\n return proxyAddress;\\n }\\n\\n /**\\n * @notice Gets the MinimalProxy bytecode\\n * @param _implementation Address of the proxy target implementation\\n * @return MinimalProxy bytecode\\n */\\n function _getContractCreationCode(address _implementation) internal pure returns (bytes memory) {\\n bytes10 creation = 0x3d602d80600a3d3981f3;\\n bytes10 prefix = 0x363d3d373d3d3d363d73;\\n bytes20 targetBytes = bytes20(_implementation);\\n bytes15 suffix = 0x5af43d82803e903d91602b57fd5bf3;\\n return abi.encodePacked(creation, prefix, targetBytes, suffix);\\n }\\n}\\n\",\"keccak256\":\"0x8aa3d50e714f92dc0ed6cc6d88fa8a18c948493103928f6092f98815b2c046ca\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60806040523480156200001157600080fd5b5060405162003c9338038062003c9383398181016040528101906200003791906200039c565b600062000049620001b460201b60201c565b9050806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a350600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156200015a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200015190620004e7565b60405180910390fd5b81600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550620001ac81620001bc60201b60201c565b505062000596565b600033905090565b620001cc620001b460201b60201c565b73ffffffffffffffffffffffffffffffffffffffff16620001f26200034560201b60201c565b73ffffffffffffffffffffffffffffffffffffffff16146200024b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200024290620004c5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415620002be576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620002b590620004a3565b60405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167f30909084afc859121ffc3a5aef7fe37c540a9a1ef60bd4d8dcdb76376fadf9de60405160405180910390a250565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000815190506200037f8162000562565b92915050565b60008151905062000396816200057c565b92915050565b60008060408385031215620003b057600080fd5b6000620003c08582860162000385565b9250506020620003d3858286016200036e565b9150509250929050565b6000620003ec60198362000509565b91507f4d6173746572436f70792063616e6e6f74206265207a65726f000000000000006000830152602082019050919050565b60006200042e60208362000509565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b60006200047060148362000509565b91507f546f6b656e2063616e6e6f74206265207a65726f0000000000000000000000006000830152602082019050919050565b60006020820190508181036000830152620004be81620003dd565b9050919050565b60006020820190508181036000830152620004e0816200041f565b9050919050565b60006020820190508181036000830152620005028162000461565b9050919050565b600082825260208201905092915050565b6000620005278262000542565b9050919050565b60006200053b826200051a565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6200056d816200051a565b81146200057957600080fd5b50565b62000587816200052e565b81146200059357600080fd5b50565b6136ed80620005a66000396000f3fe608060405234801561001057600080fd5b506004361061012c5760003560e01c80639c05fc60116100ad578063c1ab13db11610071578063c1ab13db14610319578063cf497e6c14610335578063f1d24c4514610351578063f2fde38b14610381578063fc0c546a1461039d5761012c565b80639c05fc6014610275578063a345746614610291578063a619486e146102af578063b6b55f25146102cd578063bdb62fbe146102e95761012c565b806368d30c2e116100f457806368d30c2e146101d15780636e03b8dc146101ed578063715018a61461021d57806379ee1bdf146102275780638da5cb5b146102575761012c565b806303990a6c146101315780630602ba2b1461014d5780632e1a7d4d1461017d578063463013a2146101995780635975e00c146101b5575b600080fd5b61014b6004803603810190610146919061253e565b6103bb565b005b61016760048036038101906101629190612515565b610563565b604051610174919061302d565b60405180910390f35b610197600480360381019061019291906125db565b6105a4565b005b6101b360048036038101906101ae9190612583565b610701565b005b6101cf60048036038101906101ca919061234c565b61078d565b005b6101eb60048036038101906101e69190612375565b61091e565b005b61020760048036038101906102029190612515565b610c7e565b6040516102149190612e67565b60405180910390f35b610225610cb1565b005b610241600480360381019061023c919061234c565b610deb565b60405161024e919061302d565b60405180910390f35b61025f610e08565b60405161026c9190612e67565b60405180910390f35b61028f600480360381019061028a919061243b565b610e31565b005b610299610f5e565b6040516102a6919061300b565b60405180910390f35b6102b7611036565b6040516102c49190612e67565b60405180910390f35b6102e760048036038101906102e291906125db565b61105c565b005b61030360048036038101906102fe91906124d9565b61113f565b6040516103109190612e67565b60405180910390f35b610333600480360381019061032e919061234c565b611163565b005b61034f600480360381019061034a919061234c565b611284565b005b61036b60048036038101906103669190612515565b6113f7565b6040516103789190612e67565b60405180910390f35b61039b6004803603810190610396919061234c565b611472565b005b6103a561161b565b6040516103b29190613048565b60405180910390f35b6103c3611645565b73ffffffffffffffffffffffffffffffffffffffff166103e1610e08565b73ffffffffffffffffffffffffffffffffffffffff1614610437576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042e90613229565b60405180910390fd5b6000610443838361164d565b9050600060016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff16817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163373ffffffffffffffffffffffffffffffffffffffff167f450397a2db0e89eccfe664cc6cdfd274a88bc00d29aaec4d991754a42f19f8c98686604051610556929190613063565b60405180910390a4505050565b60008073ffffffffffffffffffffffffffffffffffffffff16610585836113f7565b73ffffffffffffffffffffffffffffffffffffffff1614159050919050565b6105ac611645565b73ffffffffffffffffffffffffffffffffffffffff166105ca610e08565b73ffffffffffffffffffffffffffffffffffffffff1614610620576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161061790613229565b60405180910390fd5b60008111610663576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161065a90613209565b60405180910390fd5b6106b03382600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166116db9092919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b826040516106f69190613309565b60405180910390a250565b610709611645565b73ffffffffffffffffffffffffffffffffffffffff16610727610e08565b73ffffffffffffffffffffffffffffffffffffffff161461077d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077490613229565b60405180910390fd5b610788838383611761565b505050565b610795611645565b73ffffffffffffffffffffffffffffffffffffffff166107b3610e08565b73ffffffffffffffffffffffffffffffffffffffff1614610809576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080090613229565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610879576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161087090613109565b60405180910390fd5b61088d81600261194390919063ffffffff16565b6108cc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108c390613269565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f33442b8c13e72dd75a027f08f9bff4eed2dfd26e43cdea857365f5163b359a796001604051610913919061302d565b60405180910390a250565b610926611645565b73ffffffffffffffffffffffffffffffffffffffff16610944610e08565b73ffffffffffffffffffffffffffffffffffffffff161461099a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161099190613229565b60405180910390fd5b86600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016109f69190612e67565b60206040518083038186803b158015610a0e57600080fd5b505afa158015610a22573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a469190612604565b1015610a87576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7e90613149565b60405180910390fd5b6060308a8a600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168b8b8b8b8b8b8b604051602401610ad09b9a99989796959493929190612e82565b6040516020818303038152906040527fbd896dcb000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505090506000610b858280519060200120600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611973565b9050610bd4818a600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166116db9092919063ffffffff16565b8973ffffffffffffffffffffffffffffffffffffffff1682805190602001208273ffffffffffffffffffffffffffffffffffffffff167f3c7ff6acee351ed98200c285a04745858a107e16da2f13c3a81a43073c17d644600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168d8d8d8d8d8d8d604051610c69989796959493929190612f8d565b60405180910390a45050505050505050505050565b60016020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610cb9611645565b73ffffffffffffffffffffffffffffffffffffffff16610cd7610e08565b73ffffffffffffffffffffffffffffffffffffffff1614610d2d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d2490613229565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000610e018260026119ef90919063ffffffff16565b9050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610e39611645565b73ffffffffffffffffffffffffffffffffffffffff16610e57610e08565b73ffffffffffffffffffffffffffffffffffffffff1614610ead576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ea490613229565b60405180910390fd5b818190508484905014610ef5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eec906130e9565b60405180910390fd5b60005b84849050811015610f5757610f4a858583818110610f1257fe5b9050602002810190610f249190613324565b858585818110610f3057fe5b9050602002016020810190610f45919061234c565b611761565b8080600101915050610ef8565b5050505050565b606080610f6b6002611a1f565b67ffffffffffffffff81118015610f8157600080fd5b50604051908082528060200260200182016040528015610fb05781602001602082028036833780820191505090505b50905060005b610fc06002611a1f565b81101561102e57610fdb816002611a3490919063ffffffff16565b828281518110610fe757fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508080600101915050610fb6565b508091505090565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000811161109f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161109690613209565b60405180910390fd5b6110ee333083600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611a4e909392919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f59062170a285eb80e8c6b8ced60428442a51910635005233fc4ce084a475845e826040516111349190613309565b60405180910390a250565b600061115b8361114e84611ad7565b8051906020012030611b4d565b905092915050565b61116b611645565b73ffffffffffffffffffffffffffffffffffffffff16611189610e08565b73ffffffffffffffffffffffffffffffffffffffff16146111df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111d690613229565b60405180910390fd5b6111f3816002611b9190919063ffffffff16565b611232576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161122990613189565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f33442b8c13e72dd75a027f08f9bff4eed2dfd26e43cdea857365f5163b359a796000604051611279919061302d565b60405180910390a250565b61128c611645565b73ffffffffffffffffffffffffffffffffffffffff166112aa610e08565b73ffffffffffffffffffffffffffffffffffffffff1614611300576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112f790613229565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611370576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611367906131a9565b60405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167f30909084afc859121ffc3a5aef7fe37c540a9a1ef60bd4d8dcdb76376fadf9de60405160405180910390a250565b600060016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b61147a611645565b73ffffffffffffffffffffffffffffffffffffffff16611498610e08565b73ffffffffffffffffffffffffffffffffffffffff16146114ee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114e590613229565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561155e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155590613129565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600033905090565b60006116d383836040516024016040516020818303038152906040529190604051611679929190612e4e565b60405180910390207bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611bc1565b905092915050565b61175c8363a9059cbb60e01b84846040516024016116fa929190612f64565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611c19565b505050565b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156117d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117c7906131c9565b60405180910390fd5b6117d981611ce0565b611818576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161180f906132e9565b60405180910390fd5b6000611824848461164d565b90508160016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff16817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163373ffffffffffffffffffffffffffffffffffffffff167f450397a2db0e89eccfe664cc6cdfd274a88bc00d29aaec4d991754a42f19f8c98787604051611935929190613063565b60405180910390a450505050565b600061196b836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611cf3565b905092915050565b60008061198a60008661198587611ad7565b611d63565b90508073ffffffffffffffffffffffffffffffffffffffff167efffc2da0b561cae30d9826d37709e9421c4725faebc226cbbb7ef5fc5e734960405160405180910390a26000835111156119e4576119e28184611e74565b505b809150509392505050565b6000611a17836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611ebe565b905092915050565b6000611a2d82600001611ee1565b9050919050565b6000611a438360000183611ef2565b60001c905092915050565b611ad1846323b872dd60e01b858585604051602401611a6f93929190612f2d565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611c19565b50505050565b60606000693d602d80600a3d3981f360b01b9050600069363d3d373d3d3d363d7360b01b905060008460601b905060006e5af43d82803e903d91602b57fd5bf360881b905083838383604051602001611b339493929190612d9b565b604051602081830303815290604052945050505050919050565b60008060ff60f81b838686604051602001611b6b9493929190612de9565b6040516020818303038152906040528051906020012090508060001c9150509392505050565b6000611bb9836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611f5f565b905092915050565b60006004825114611c07576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bfe90613249565b60405180910390fd5b60006020830151905080915050919050565b6060611c7b826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166120479092919063ffffffff16565b9050600081511115611cdb5780806020019051810190611c9b91906124b0565b611cda576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cd1906132a9565b60405180910390fd5b5b505050565b600080823b905060008111915050919050565b6000611cff8383611ebe565b611d58578260000182908060018154018082558091505060019003906000526020600020016000909190919091505582600001805490508360010160008481526020019081526020016000208190555060019050611d5d565b600090505b92915050565b60008084471015611da9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611da0906132c9565b60405180910390fd5b600083511415611dee576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611de5906130c9565b60405180910390fd5b8383516020850187f59050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611e69576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e60906131e9565b60405180910390fd5b809150509392505050565b6060611eb683836040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c65640000815250612047565b905092915050565b600080836001016000848152602001908152602001600020541415905092915050565b600081600001805490509050919050565b600081836000018054905011611f3d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f34906130a9565b60405180910390fd5b826000018281548110611f4c57fe5b9060005260206000200154905092915050565b6000808360010160008481526020019081526020016000205490506000811461203b5760006001820390506000600186600001805490500390506000866000018281548110611faa57fe5b9060005260206000200154905080876000018481548110611fc757fe5b9060005260206000200181905550600183018760010160008381526020019081526020016000208190555086600001805480611fff57fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050612041565b60009150505b92915050565b6060612056848460008561205f565b90509392505050565b6060824710156120a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161209b90613169565b60405180910390fd5b6120ad85611ce0565b6120ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120e390613289565b60405180910390fd5b600060608673ffffffffffffffffffffffffffffffffffffffff1685876040516121169190612e37565b60006040518083038185875af1925050503d8060008114612153576040519150601f19603f3d011682016040523d82523d6000602084013e612158565b606091505b5091509150612168828286612174565b92505050949350505050565b60608315612184578290506121d4565b6000835111156121975782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121cb9190613087565b60405180910390fd5b9392505050565b6000813590506121ea81613634565b92915050565b60008083601f84011261220257600080fd5b8235905067ffffffffffffffff81111561221b57600080fd5b60208301915083602082028301111561223357600080fd5b9250929050565b60008083601f84011261224c57600080fd5b8235905067ffffffffffffffff81111561226557600080fd5b60208301915083602082028301111561227d57600080fd5b9250929050565b6000815190506122938161364b565b92915050565b6000813590506122a881613662565b92915050565b6000813590506122bd81613679565b92915050565b6000813590506122d281613690565b92915050565b60008083601f8401126122ea57600080fd5b8235905067ffffffffffffffff81111561230357600080fd5b60208301915083600182028301111561231b57600080fd5b9250929050565b600081359050612331816136a0565b92915050565b600081519050612346816136a0565b92915050565b60006020828403121561235e57600080fd5b600061236c848285016121db565b91505092915050565b60008060008060008060008060006101208a8c03121561239457600080fd5b60006123a28c828d016121db565b99505060206123b38c828d016121db565b98505060406123c48c828d01612322565b97505060606123d58c828d01612322565b96505060806123e68c828d01612322565b95505060a06123f78c828d01612322565b94505060c06124088c828d01612322565b93505060e06124198c828d01612322565b92505061010061242b8c828d016122c3565b9150509295985092959850929598565b6000806000806040858703121561245157600080fd5b600085013567ffffffffffffffff81111561246b57600080fd5b6124778782880161223a565b9450945050602085013567ffffffffffffffff81111561249657600080fd5b6124a2878288016121f0565b925092505092959194509250565b6000602082840312156124c257600080fd5b60006124d084828501612284565b91505092915050565b600080604083850312156124ec57600080fd5b60006124fa85828601612299565b925050602061250b858286016121db565b9150509250929050565b60006020828403121561252757600080fd5b6000612535848285016122ae565b91505092915050565b6000806020838503121561255157600080fd5b600083013567ffffffffffffffff81111561256b57600080fd5b612577858286016122d8565b92509250509250929050565b60008060006040848603121561259857600080fd5b600084013567ffffffffffffffff8111156125b257600080fd5b6125be868287016122d8565b935093505060206125d1868287016121db565b9150509250925092565b6000602082840312156125ed57600080fd5b60006125fb84828501612322565b91505092915050565b60006020828403121561261657600080fd5b600061262484828501612337565b91505092915050565b60006126398383612645565b60208301905092915050565b61264e816133f1565b82525050565b61265d816133f1565b82525050565b61267461266f826133f1565b6135aa565b82525050565b60006126858261338b565b61268f81856133b9565b935061269a8361337b565b8060005b838110156126cb5781516126b2888261262d565b97506126bd836133ac565b92505060018101905061269e565b5085935050505092915050565b6126e181613403565b82525050565b6126f86126f38261343b565b6135c6565b82525050565b61270f61270a82613467565b6135d0565b82525050565b6127266127218261340f565b6135bc565b82525050565b61273d61273882613493565b6135da565b82525050565b61275461274f826134bf565b6135e4565b82525050565b600061276582613396565b61276f81856133ca565b935061277f818560208601613577565b80840191505092915050565b61279481613532565b82525050565b6127a381613556565b82525050565b60006127b583856133d5565b93506127c2838584613568565b6127cb83613602565b840190509392505050565b60006127e283856133e6565b93506127ef838584613568565b82840190509392505050565b6000612806826133a1565b61281081856133d5565b9350612820818560208601613577565b61282981613602565b840191505092915050565b60006128416022836133d5565b91507f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e60008301527f64730000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006128a76020836133d5565b91507f437265617465323a2062797465636f6465206c656e677468206973207a65726f6000830152602082019050919050565b60006128e76015836133d5565b91507f4172726179206c656e677468206d69736d6174636800000000000000000000006000830152602082019050919050565b6000612927601a836133d5565b91507f44657374696e6174696f6e2063616e6e6f74206265207a65726f0000000000006000830152602082019050919050565b60006129676026836133d5565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006129cd6020836133d5565b91507f4e6f7420656e6f75676820746f6b656e7320746f20637265617465206c6f636b6000830152602082019050919050565b6000612a0d6026836133d5565b91507f416464726573733a20696e73756666696369656e742062616c616e636520666f60008301527f722063616c6c00000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000612a73601b836133d5565b91507f44657374696e6174696f6e20616c72656164792072656d6f76656400000000006000830152602082019050919050565b6000612ab36019836133d5565b91507f4d6173746572436f70792063616e6e6f74206265207a65726f000000000000006000830152602082019050919050565b6000612af3601d836133d5565b91507f546172676574206d757374206265206f7468657220636f6e74726163740000006000830152602082019050919050565b6000612b336019836133d5565b91507f437265617465323a204661696c6564206f6e206465706c6f79000000000000006000830152602082019050919050565b6000612b736015836133d5565b91507f416d6f756e742063616e6e6f74206265207a65726f00000000000000000000006000830152602082019050919050565b6000612bb36020836133d5565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b6000612bf36018836133d5565b91507f496e76616c6964206d6574686f64207369676e617475726500000000000000006000830152602082019050919050565b6000612c336019836133d5565b91507f44657374696e6174696f6e20616c7265616479206164646564000000000000006000830152602082019050919050565b6000612c73601d836133d5565b91507f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006000830152602082019050919050565b6000612cb3602a836133d5565b91507f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008301527f6f742073756363656564000000000000000000000000000000000000000000006020830152604082019050919050565b6000612d19601d836133d5565b91507f437265617465323a20696e73756666696369656e742062616c616e63650000006000830152602082019050919050565b6000612d596019836133d5565b91507f546172676574206d757374206265206120636f6e7472616374000000000000006000830152602082019050919050565b612d9581613528565b82525050565b6000612da782876126e7565b600a82019150612db782866126e7565b600a82019150612dc7828561272c565b601482019150612dd782846126fe565b600f8201915081905095945050505050565b6000612df58287612715565b600182019150612e058286612663565b601482019150612e158285612743565b602082019150612e258284612743565b60208201915081905095945050505050565b6000612e43828461275a565b915081905092915050565b6000612e5b8284866127d6565b91508190509392505050565b6000602082019050612e7c6000830184612654565b92915050565b600061016082019050612e98600083018e612654565b612ea5602083018d612654565b612eb2604083018c612654565b612ebf606083018b612654565b612ecc608083018a612d8c565b612ed960a0830189612d8c565b612ee660c0830188612d8c565b612ef360e0830187612d8c565b612f01610100830186612d8c565b612f0f610120830185612d8c565b612f1d61014083018461279a565b9c9b505050505050505050505050565b6000606082019050612f426000830186612654565b612f4f6020830185612654565b612f5c6040830184612d8c565b949350505050565b6000604082019050612f796000830185612654565b612f866020830184612d8c565b9392505050565b600061010082019050612fa3600083018b612654565b612fb0602083018a612d8c565b612fbd6040830189612d8c565b612fca6060830188612d8c565b612fd76080830187612d8c565b612fe460a0830186612d8c565b612ff160c0830185612d8c565b612ffe60e083018461279a565b9998505050505050505050565b60006020820190508181036000830152613025818461267a565b905092915050565b600060208201905061304260008301846126d8565b92915050565b600060208201905061305d600083018461278b565b92915050565b6000602082019050818103600083015261307e8184866127a9565b90509392505050565b600060208201905081810360008301526130a181846127fb565b905092915050565b600060208201905081810360008301526130c281612834565b9050919050565b600060208201905081810360008301526130e28161289a565b9050919050565b60006020820190508181036000830152613102816128da565b9050919050565b600060208201905081810360008301526131228161291a565b9050919050565b600060208201905081810360008301526131428161295a565b9050919050565b60006020820190508181036000830152613162816129c0565b9050919050565b6000602082019050818103600083015261318281612a00565b9050919050565b600060208201905081810360008301526131a281612a66565b9050919050565b600060208201905081810360008301526131c281612aa6565b9050919050565b600060208201905081810360008301526131e281612ae6565b9050919050565b6000602082019050818103600083015261320281612b26565b9050919050565b6000602082019050818103600083015261322281612b66565b9050919050565b6000602082019050818103600083015261324281612ba6565b9050919050565b6000602082019050818103600083015261326281612be6565b9050919050565b6000602082019050818103600083015261328281612c26565b9050919050565b600060208201905081810360008301526132a281612c66565b9050919050565b600060208201905081810360008301526132c281612ca6565b9050919050565b600060208201905081810360008301526132e281612d0c565b9050919050565b6000602082019050818103600083015261330281612d4c565b9050919050565b600060208201905061331e6000830184612d8c565b92915050565b6000808335600160200384360303811261333d57600080fd5b80840192508235915067ffffffffffffffff82111561335b57600080fd5b60208301925060018202360383131561337357600080fd5b509250929050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b60006133fc82613508565b9050919050565b60008115159050919050565b60007fff0000000000000000000000000000000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffff0000000000000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffffffffffffff000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffffffffffffffffffffffff00000000000000000000000082169050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600081905061350382613620565b919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600061353d82613544565b9050919050565b600061354f82613508565b9050919050565b6000613561826134f5565b9050919050565b82818337600083830152505050565b60005b8381101561359557808201518184015260208101905061357a565b838111156135a4576000848401525b50505050565b60006135b5826135ee565b9050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b60006135f982613613565b9050919050565bfe5b6000601f19601f8301169050919050565b60008160601b9050919050565b6003811061363157613630613600565b5b50565b61363d816133f1565b811461364857600080fd5b50565b61365481613403565b811461365f57600080fd5b50565b61366b816134bf565b811461367657600080fd5b50565b613682816134c9565b811461368d57600080fd5b50565b6003811061369d57600080fd5b50565b6136a981613528565b81146136b457600080fd5b5056fea26469706673582212202d3d549e01583bc5460844b73df152769c2a77e8b1ca88724d847dbd95e3af7964736f6c63430007030033", + "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061012c5760003560e01c80639c05fc60116100ad578063c1ab13db11610071578063c1ab13db14610319578063cf497e6c14610335578063f1d24c4514610351578063f2fde38b14610381578063fc0c546a1461039d5761012c565b80639c05fc6014610275578063a345746614610291578063a619486e146102af578063b6b55f25146102cd578063bdb62fbe146102e95761012c565b806368d30c2e116100f457806368d30c2e146101d15780636e03b8dc146101ed578063715018a61461021d57806379ee1bdf146102275780638da5cb5b146102575761012c565b806303990a6c146101315780630602ba2b1461014d5780632e1a7d4d1461017d578063463013a2146101995780635975e00c146101b5575b600080fd5b61014b6004803603810190610146919061253e565b6103bb565b005b61016760048036038101906101629190612515565b610563565b604051610174919061302d565b60405180910390f35b610197600480360381019061019291906125db565b6105a4565b005b6101b360048036038101906101ae9190612583565b610701565b005b6101cf60048036038101906101ca919061234c565b61078d565b005b6101eb60048036038101906101e69190612375565b61091e565b005b61020760048036038101906102029190612515565b610c7e565b6040516102149190612e67565b60405180910390f35b610225610cb1565b005b610241600480360381019061023c919061234c565b610deb565b60405161024e919061302d565b60405180910390f35b61025f610e08565b60405161026c9190612e67565b60405180910390f35b61028f600480360381019061028a919061243b565b610e31565b005b610299610f5e565b6040516102a6919061300b565b60405180910390f35b6102b7611036565b6040516102c49190612e67565b60405180910390f35b6102e760048036038101906102e291906125db565b61105c565b005b61030360048036038101906102fe91906124d9565b61113f565b6040516103109190612e67565b60405180910390f35b610333600480360381019061032e919061234c565b611163565b005b61034f600480360381019061034a919061234c565b611284565b005b61036b60048036038101906103669190612515565b6113f7565b6040516103789190612e67565b60405180910390f35b61039b6004803603810190610396919061234c565b611472565b005b6103a561161b565b6040516103b29190613048565b60405180910390f35b6103c3611645565b73ffffffffffffffffffffffffffffffffffffffff166103e1610e08565b73ffffffffffffffffffffffffffffffffffffffff1614610437576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042e90613229565b60405180910390fd5b6000610443838361164d565b9050600060016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff16817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163373ffffffffffffffffffffffffffffffffffffffff167f450397a2db0e89eccfe664cc6cdfd274a88bc00d29aaec4d991754a42f19f8c98686604051610556929190613063565b60405180910390a4505050565b60008073ffffffffffffffffffffffffffffffffffffffff16610585836113f7565b73ffffffffffffffffffffffffffffffffffffffff1614159050919050565b6105ac611645565b73ffffffffffffffffffffffffffffffffffffffff166105ca610e08565b73ffffffffffffffffffffffffffffffffffffffff1614610620576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161061790613229565b60405180910390fd5b60008111610663576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161065a90613209565b60405180910390fd5b6106b03382600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166116db9092919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b826040516106f69190613309565b60405180910390a250565b610709611645565b73ffffffffffffffffffffffffffffffffffffffff16610727610e08565b73ffffffffffffffffffffffffffffffffffffffff161461077d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077490613229565b60405180910390fd5b610788838383611761565b505050565b610795611645565b73ffffffffffffffffffffffffffffffffffffffff166107b3610e08565b73ffffffffffffffffffffffffffffffffffffffff1614610809576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080090613229565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610879576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161087090613109565b60405180910390fd5b61088d81600261194390919063ffffffff16565b6108cc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108c390613269565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f33442b8c13e72dd75a027f08f9bff4eed2dfd26e43cdea857365f5163b359a796001604051610913919061302d565b60405180910390a250565b610926611645565b73ffffffffffffffffffffffffffffffffffffffff16610944610e08565b73ffffffffffffffffffffffffffffffffffffffff161461099a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161099190613229565b60405180910390fd5b86600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016109f69190612e67565b60206040518083038186803b158015610a0e57600080fd5b505afa158015610a22573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a469190612604565b1015610a87576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7e90613149565b60405180910390fd5b6060308a8a600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168b8b8b8b8b8b8b604051602401610ad09b9a99989796959493929190612e82565b6040516020818303038152906040527fbd896dcb000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505090506000610b858280519060200120600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611973565b9050610bd4818a600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166116db9092919063ffffffff16565b8973ffffffffffffffffffffffffffffffffffffffff1682805190602001208273ffffffffffffffffffffffffffffffffffffffff167f3c7ff6acee351ed98200c285a04745858a107e16da2f13c3a81a43073c17d644600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168d8d8d8d8d8d8d604051610c69989796959493929190612f8d565b60405180910390a45050505050505050505050565b60016020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610cb9611645565b73ffffffffffffffffffffffffffffffffffffffff16610cd7610e08565b73ffffffffffffffffffffffffffffffffffffffff1614610d2d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d2490613229565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000610e018260026119ef90919063ffffffff16565b9050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610e39611645565b73ffffffffffffffffffffffffffffffffffffffff16610e57610e08565b73ffffffffffffffffffffffffffffffffffffffff1614610ead576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ea490613229565b60405180910390fd5b818190508484905014610ef5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eec906130e9565b60405180910390fd5b60005b84849050811015610f5757610f4a858583818110610f1257fe5b9050602002810190610f249190613324565b858585818110610f3057fe5b9050602002016020810190610f45919061234c565b611761565b8080600101915050610ef8565b5050505050565b606080610f6b6002611a1f565b67ffffffffffffffff81118015610f8157600080fd5b50604051908082528060200260200182016040528015610fb05781602001602082028036833780820191505090505b50905060005b610fc06002611a1f565b81101561102e57610fdb816002611a3490919063ffffffff16565b828281518110610fe757fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508080600101915050610fb6565b508091505090565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000811161109f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161109690613209565b60405180910390fd5b6110ee333083600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611a4e909392919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f59062170a285eb80e8c6b8ced60428442a51910635005233fc4ce084a475845e826040516111349190613309565b60405180910390a250565b600061115b8361114e84611ad7565b8051906020012030611b4d565b905092915050565b61116b611645565b73ffffffffffffffffffffffffffffffffffffffff16611189610e08565b73ffffffffffffffffffffffffffffffffffffffff16146111df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111d690613229565b60405180910390fd5b6111f3816002611b9190919063ffffffff16565b611232576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161122990613189565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f33442b8c13e72dd75a027f08f9bff4eed2dfd26e43cdea857365f5163b359a796000604051611279919061302d565b60405180910390a250565b61128c611645565b73ffffffffffffffffffffffffffffffffffffffff166112aa610e08565b73ffffffffffffffffffffffffffffffffffffffff1614611300576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112f790613229565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611370576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611367906131a9565b60405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167f30909084afc859121ffc3a5aef7fe37c540a9a1ef60bd4d8dcdb76376fadf9de60405160405180910390a250565b600060016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b61147a611645565b73ffffffffffffffffffffffffffffffffffffffff16611498610e08565b73ffffffffffffffffffffffffffffffffffffffff16146114ee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114e590613229565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561155e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155590613129565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600033905090565b60006116d383836040516024016040516020818303038152906040529190604051611679929190612e4e565b60405180910390207bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611bc1565b905092915050565b61175c8363a9059cbb60e01b84846040516024016116fa929190612f64565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611c19565b505050565b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156117d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117c7906131c9565b60405180910390fd5b6117d981611ce0565b611818576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161180f906132e9565b60405180910390fd5b6000611824848461164d565b90508160016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff16817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163373ffffffffffffffffffffffffffffffffffffffff167f450397a2db0e89eccfe664cc6cdfd274a88bc00d29aaec4d991754a42f19f8c98787604051611935929190613063565b60405180910390a450505050565b600061196b836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611cf3565b905092915050565b60008061198a60008661198587611ad7565b611d63565b90508073ffffffffffffffffffffffffffffffffffffffff167efffc2da0b561cae30d9826d37709e9421c4725faebc226cbbb7ef5fc5e734960405160405180910390a26000835111156119e4576119e28184611e74565b505b809150509392505050565b6000611a17836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611ebe565b905092915050565b6000611a2d82600001611ee1565b9050919050565b6000611a438360000183611ef2565b60001c905092915050565b611ad1846323b872dd60e01b858585604051602401611a6f93929190612f2d565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611c19565b50505050565b60606000693d602d80600a3d3981f360b01b9050600069363d3d373d3d3d363d7360b01b905060008460601b905060006e5af43d82803e903d91602b57fd5bf360881b905083838383604051602001611b339493929190612d9b565b604051602081830303815290604052945050505050919050565b60008060ff60f81b838686604051602001611b6b9493929190612de9565b6040516020818303038152906040528051906020012090508060001c9150509392505050565b6000611bb9836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611f5f565b905092915050565b60006004825114611c07576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bfe90613249565b60405180910390fd5b60006020830151905080915050919050565b6060611c7b826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166120479092919063ffffffff16565b9050600081511115611cdb5780806020019051810190611c9b91906124b0565b611cda576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cd1906132a9565b60405180910390fd5b5b505050565b600080823b905060008111915050919050565b6000611cff8383611ebe565b611d58578260000182908060018154018082558091505060019003906000526020600020016000909190919091505582600001805490508360010160008481526020019081526020016000208190555060019050611d5d565b600090505b92915050565b60008084471015611da9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611da0906132c9565b60405180910390fd5b600083511415611dee576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611de5906130c9565b60405180910390fd5b8383516020850187f59050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611e69576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e60906131e9565b60405180910390fd5b809150509392505050565b6060611eb683836040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c65640000815250612047565b905092915050565b600080836001016000848152602001908152602001600020541415905092915050565b600081600001805490509050919050565b600081836000018054905011611f3d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f34906130a9565b60405180910390fd5b826000018281548110611f4c57fe5b9060005260206000200154905092915050565b6000808360010160008481526020019081526020016000205490506000811461203b5760006001820390506000600186600001805490500390506000866000018281548110611faa57fe5b9060005260206000200154905080876000018481548110611fc757fe5b9060005260206000200181905550600183018760010160008381526020019081526020016000208190555086600001805480611fff57fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050612041565b60009150505b92915050565b6060612056848460008561205f565b90509392505050565b6060824710156120a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161209b90613169565b60405180910390fd5b6120ad85611ce0565b6120ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120e390613289565b60405180910390fd5b600060608673ffffffffffffffffffffffffffffffffffffffff1685876040516121169190612e37565b60006040518083038185875af1925050503d8060008114612153576040519150601f19603f3d011682016040523d82523d6000602084013e612158565b606091505b5091509150612168828286612174565b92505050949350505050565b60608315612184578290506121d4565b6000835111156121975782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121cb9190613087565b60405180910390fd5b9392505050565b6000813590506121ea81613634565b92915050565b60008083601f84011261220257600080fd5b8235905067ffffffffffffffff81111561221b57600080fd5b60208301915083602082028301111561223357600080fd5b9250929050565b60008083601f84011261224c57600080fd5b8235905067ffffffffffffffff81111561226557600080fd5b60208301915083602082028301111561227d57600080fd5b9250929050565b6000815190506122938161364b565b92915050565b6000813590506122a881613662565b92915050565b6000813590506122bd81613679565b92915050565b6000813590506122d281613690565b92915050565b60008083601f8401126122ea57600080fd5b8235905067ffffffffffffffff81111561230357600080fd5b60208301915083600182028301111561231b57600080fd5b9250929050565b600081359050612331816136a0565b92915050565b600081519050612346816136a0565b92915050565b60006020828403121561235e57600080fd5b600061236c848285016121db565b91505092915050565b60008060008060008060008060006101208a8c03121561239457600080fd5b60006123a28c828d016121db565b99505060206123b38c828d016121db565b98505060406123c48c828d01612322565b97505060606123d58c828d01612322565b96505060806123e68c828d01612322565b95505060a06123f78c828d01612322565b94505060c06124088c828d01612322565b93505060e06124198c828d01612322565b92505061010061242b8c828d016122c3565b9150509295985092959850929598565b6000806000806040858703121561245157600080fd5b600085013567ffffffffffffffff81111561246b57600080fd5b6124778782880161223a565b9450945050602085013567ffffffffffffffff81111561249657600080fd5b6124a2878288016121f0565b925092505092959194509250565b6000602082840312156124c257600080fd5b60006124d084828501612284565b91505092915050565b600080604083850312156124ec57600080fd5b60006124fa85828601612299565b925050602061250b858286016121db565b9150509250929050565b60006020828403121561252757600080fd5b6000612535848285016122ae565b91505092915050565b6000806020838503121561255157600080fd5b600083013567ffffffffffffffff81111561256b57600080fd5b612577858286016122d8565b92509250509250929050565b60008060006040848603121561259857600080fd5b600084013567ffffffffffffffff8111156125b257600080fd5b6125be868287016122d8565b935093505060206125d1868287016121db565b9150509250925092565b6000602082840312156125ed57600080fd5b60006125fb84828501612322565b91505092915050565b60006020828403121561261657600080fd5b600061262484828501612337565b91505092915050565b60006126398383612645565b60208301905092915050565b61264e816133f1565b82525050565b61265d816133f1565b82525050565b61267461266f826133f1565b6135aa565b82525050565b60006126858261338b565b61268f81856133b9565b935061269a8361337b565b8060005b838110156126cb5781516126b2888261262d565b97506126bd836133ac565b92505060018101905061269e565b5085935050505092915050565b6126e181613403565b82525050565b6126f86126f38261343b565b6135c6565b82525050565b61270f61270a82613467565b6135d0565b82525050565b6127266127218261340f565b6135bc565b82525050565b61273d61273882613493565b6135da565b82525050565b61275461274f826134bf565b6135e4565b82525050565b600061276582613396565b61276f81856133ca565b935061277f818560208601613577565b80840191505092915050565b61279481613532565b82525050565b6127a381613556565b82525050565b60006127b583856133d5565b93506127c2838584613568565b6127cb83613602565b840190509392505050565b60006127e283856133e6565b93506127ef838584613568565b82840190509392505050565b6000612806826133a1565b61281081856133d5565b9350612820818560208601613577565b61282981613602565b840191505092915050565b60006128416022836133d5565b91507f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e60008301527f64730000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006128a76020836133d5565b91507f437265617465323a2062797465636f6465206c656e677468206973207a65726f6000830152602082019050919050565b60006128e76015836133d5565b91507f4172726179206c656e677468206d69736d6174636800000000000000000000006000830152602082019050919050565b6000612927601a836133d5565b91507f44657374696e6174696f6e2063616e6e6f74206265207a65726f0000000000006000830152602082019050919050565b60006129676026836133d5565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006129cd6020836133d5565b91507f4e6f7420656e6f75676820746f6b656e7320746f20637265617465206c6f636b6000830152602082019050919050565b6000612a0d6026836133d5565b91507f416464726573733a20696e73756666696369656e742062616c616e636520666f60008301527f722063616c6c00000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000612a73601b836133d5565b91507f44657374696e6174696f6e20616c72656164792072656d6f76656400000000006000830152602082019050919050565b6000612ab36019836133d5565b91507f4d6173746572436f70792063616e6e6f74206265207a65726f000000000000006000830152602082019050919050565b6000612af3601d836133d5565b91507f546172676574206d757374206265206f7468657220636f6e74726163740000006000830152602082019050919050565b6000612b336019836133d5565b91507f437265617465323a204661696c6564206f6e206465706c6f79000000000000006000830152602082019050919050565b6000612b736015836133d5565b91507f416d6f756e742063616e6e6f74206265207a65726f00000000000000000000006000830152602082019050919050565b6000612bb36020836133d5565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b6000612bf36018836133d5565b91507f496e76616c6964206d6574686f64207369676e617475726500000000000000006000830152602082019050919050565b6000612c336019836133d5565b91507f44657374696e6174696f6e20616c7265616479206164646564000000000000006000830152602082019050919050565b6000612c73601d836133d5565b91507f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006000830152602082019050919050565b6000612cb3602a836133d5565b91507f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008301527f6f742073756363656564000000000000000000000000000000000000000000006020830152604082019050919050565b6000612d19601d836133d5565b91507f437265617465323a20696e73756666696369656e742062616c616e63650000006000830152602082019050919050565b6000612d596019836133d5565b91507f546172676574206d757374206265206120636f6e7472616374000000000000006000830152602082019050919050565b612d9581613528565b82525050565b6000612da782876126e7565b600a82019150612db782866126e7565b600a82019150612dc7828561272c565b601482019150612dd782846126fe565b600f8201915081905095945050505050565b6000612df58287612715565b600182019150612e058286612663565b601482019150612e158285612743565b602082019150612e258284612743565b60208201915081905095945050505050565b6000612e43828461275a565b915081905092915050565b6000612e5b8284866127d6565b91508190509392505050565b6000602082019050612e7c6000830184612654565b92915050565b600061016082019050612e98600083018e612654565b612ea5602083018d612654565b612eb2604083018c612654565b612ebf606083018b612654565b612ecc608083018a612d8c565b612ed960a0830189612d8c565b612ee660c0830188612d8c565b612ef360e0830187612d8c565b612f01610100830186612d8c565b612f0f610120830185612d8c565b612f1d61014083018461279a565b9c9b505050505050505050505050565b6000606082019050612f426000830186612654565b612f4f6020830185612654565b612f5c6040830184612d8c565b949350505050565b6000604082019050612f796000830185612654565b612f866020830184612d8c565b9392505050565b600061010082019050612fa3600083018b612654565b612fb0602083018a612d8c565b612fbd6040830189612d8c565b612fca6060830188612d8c565b612fd76080830187612d8c565b612fe460a0830186612d8c565b612ff160c0830185612d8c565b612ffe60e083018461279a565b9998505050505050505050565b60006020820190508181036000830152613025818461267a565b905092915050565b600060208201905061304260008301846126d8565b92915050565b600060208201905061305d600083018461278b565b92915050565b6000602082019050818103600083015261307e8184866127a9565b90509392505050565b600060208201905081810360008301526130a181846127fb565b905092915050565b600060208201905081810360008301526130c281612834565b9050919050565b600060208201905081810360008301526130e28161289a565b9050919050565b60006020820190508181036000830152613102816128da565b9050919050565b600060208201905081810360008301526131228161291a565b9050919050565b600060208201905081810360008301526131428161295a565b9050919050565b60006020820190508181036000830152613162816129c0565b9050919050565b6000602082019050818103600083015261318281612a00565b9050919050565b600060208201905081810360008301526131a281612a66565b9050919050565b600060208201905081810360008301526131c281612aa6565b9050919050565b600060208201905081810360008301526131e281612ae6565b9050919050565b6000602082019050818103600083015261320281612b26565b9050919050565b6000602082019050818103600083015261322281612b66565b9050919050565b6000602082019050818103600083015261324281612ba6565b9050919050565b6000602082019050818103600083015261326281612be6565b9050919050565b6000602082019050818103600083015261328281612c26565b9050919050565b600060208201905081810360008301526132a281612c66565b9050919050565b600060208201905081810360008301526132c281612ca6565b9050919050565b600060208201905081810360008301526132e281612d0c565b9050919050565b6000602082019050818103600083015261330281612d4c565b9050919050565b600060208201905061331e6000830184612d8c565b92915050565b6000808335600160200384360303811261333d57600080fd5b80840192508235915067ffffffffffffffff82111561335b57600080fd5b60208301925060018202360383131561337357600080fd5b509250929050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b60006133fc82613508565b9050919050565b60008115159050919050565b60007fff0000000000000000000000000000000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffff0000000000000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffffffffffffff000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffffffffffffffffffffffff00000000000000000000000082169050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600081905061350382613620565b919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600061353d82613544565b9050919050565b600061354f82613508565b9050919050565b6000613561826134f5565b9050919050565b82818337600083830152505050565b60005b8381101561359557808201518184015260208101905061357a565b838111156135a4576000848401525b50505050565b60006135b5826135ee565b9050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b60006135f982613613565b9050919050565bfe5b6000601f19601f8301169050919050565b60008160601b9050919050565b6003811061363157613630613600565b5b50565b61363d816133f1565b811461364857600080fd5b50565b61365481613403565b811461365f57600080fd5b50565b61366b816134bf565b811461367657600080fd5b50565b613682816134c9565b811461368d57600080fd5b50565b6003811061369d57600080fd5b50565b6136a981613528565b81146136b457600080fd5b5056fea26469706673582212202d3d549e01583bc5460844b73df152769c2a77e8b1ca88724d847dbd95e3af7964736f6c63430007030033", + "devdoc": { + "kind": "dev", + "methods": { + "addTokenDestination(address)": { + "params": { + "_dst": "Destination address" + } + }, + "constructor": { + "params": { + "_graphToken": "Token to use for deposits and withdrawals", + "_masterCopy": "Address of the master copy to use to clone proxies" + } + }, + "createTokenLockWallet(address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)": { + "params": { + "_beneficiary": "Address of the beneficiary of locked tokens", + "_endTime": "End time of the release schedule", + "_managedAmount": "Amount of tokens to be managed by the lock contract", + "_owner": "Address of the contract owner", + "_periods": "Number of periods between start time and end time", + "_releaseStartTime": "Override time for when the releases start", + "_revocable": "Whether the contract is revocable", + "_startTime": "Start time of the release schedule" + } + }, + "deposit(uint256)": { + "details": "Even if the ERC20 token can be transferred directly to the contract this function provide a safe interface to do the transfer and avoid mistakes", + "params": { + "_amount": "Amount to deposit" + } + }, + "getAuthFunctionCallTarget(bytes4)": { + "params": { + "_sigHash": "Function signature hash" + }, + "returns": { + "_0": "Address of the target contract where to send the call" + } + }, + "getDeploymentAddress(bytes32,address)": { + "params": { + "_implementation": "Address of the proxy target implementation", + "_salt": "Bytes32 salt to use for CREATE2" + }, + "returns": { + "_0": "Address of the counterfactual MinimalProxy" + } + }, + "getTokenDestinations()": { + "returns": { + "_0": "Array of addresses authorized to pull funds from a token lock" + } + }, + "isAuthFunctionCall(bytes4)": { + "params": { + "_sigHash": "Function signature hash" + }, + "returns": { + "_0": "True if authorized" + } + }, + "isTokenDestination(address)": { + "params": { + "_dst": "Destination address" + }, + "returns": { + "_0": "True if authorized" + } + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "removeTokenDestination(address)": { + "params": { + "_dst": "Destination address" + } + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." + }, + "setAuthFunctionCall(string,address)": { + "details": "Input expected is the function signature as 'transfer(address,uint256)'", + "params": { + "_signature": "Function signature", + "_target": "Address of the destination contract to call" + } + }, + "setAuthFunctionCallMany(string[],address[])": { + "details": "Input expected is the function signature as 'transfer(address,uint256)'", + "params": { + "_signatures": "Function signatures", + "_targets": "Address of the destination contract to call" + } + }, + "setMasterCopy(address)": { + "params": { + "_masterCopy": "Address of contract bytecode to factory clone" + } + }, + "token()": { + "returns": { + "_0": "Token used for transfers and approvals" + } + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + }, + "unsetAuthFunctionCall(string)": { + "details": "Input expected is the function signature as 'transfer(address,uint256)'", + "params": { + "_signature": "Function signature" + } + }, + "withdraw(uint256)": { + "details": "Escape hatch in case of mistakes or to recover remaining funds", + "params": { + "_amount": "Amount of tokens to withdraw" + } + } + }, + "title": "GraphTokenLockManager", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "addTokenDestination(address)": { + "notice": "Adds an address that can be allowed by a token lock to pull funds" + }, + "constructor": { + "notice": "Constructor." + }, + "createTokenLockWallet(address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)": { + "notice": "Creates and fund a new token lock wallet using a minimum proxy" + }, + "deposit(uint256)": { + "notice": "Deposits tokens into the contract" + }, + "getAuthFunctionCallTarget(bytes4)": { + "notice": "Gets the target contract to call for a particular function signature" + }, + "getDeploymentAddress(bytes32,address)": { + "notice": "Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation" + }, + "getTokenDestinations()": { + "notice": "Returns an array of authorized destination addresses" + }, + "isAuthFunctionCall(bytes4)": { + "notice": "Returns true if the function call is authorized" + }, + "isTokenDestination(address)": { + "notice": "Returns True if the address is authorized to be a destination of tokens" + }, + "removeTokenDestination(address)": { + "notice": "Removes an address that can be allowed by a token lock to pull funds" + }, + "setAuthFunctionCall(string,address)": { + "notice": "Sets an authorized function call to target" + }, + "setAuthFunctionCallMany(string[],address[])": { + "notice": "Sets an authorized function call to target in bulk" + }, + "setMasterCopy(address)": { + "notice": "Sets the masterCopy bytecode to use to create clones of TokenLock contracts" + }, + "token()": { + "notice": "Gets the GRT token address" + }, + "unsetAuthFunctionCall(string)": { + "notice": "Unsets an authorized function call to target" + }, + "withdraw(uint256)": { + "notice": "Withdraws tokens from the contract" + } + }, + "notice": "This contract manages a list of authorized function calls and targets that can be called by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts. This contract receives funds to make the process of creating TokenLockWallet contracts easier by distributing them the initial tokens to be managed. The owner can setup a list of token destinations that will be used by TokenLock contracts to approve the pulling of funds, this way in can be guaranteed that only protocol contracts will manipulate users funds.", + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 7, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "_owner", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 3316, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "authFnCalls", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_bytes4,t_address)" + }, + { + "astId": 3318, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "_tokenDestinations", + "offset": 0, + "slot": "2", + "type": "t_struct(AddressSet)1964_storage" + }, + { + "astId": 3320, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "masterCopy", + "offset": 0, + "slot": "4", + "type": "t_address" + }, + { + "astId": 3322, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "_token", + "offset": 0, + "slot": "5", + "type": "t_contract(IERC20)1045" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_bytes32)dyn_storage": { + "base": "t_bytes32", + "encoding": "dynamic_array", + "label": "bytes32[]", + "numberOfBytes": "32" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_bytes4": { + "encoding": "inplace", + "label": "bytes4", + "numberOfBytes": "4" + }, + "t_contract(IERC20)1045": { + "encoding": "inplace", + "label": "contract IERC20", + "numberOfBytes": "20" + }, + "t_mapping(t_bytes32,t_uint256)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_mapping(t_bytes4,t_address)": { + "encoding": "mapping", + "key": "t_bytes4", + "label": "mapping(bytes4 => address)", + "numberOfBytes": "32", + "value": "t_address" + }, + "t_struct(AddressSet)1964_storage": { + "encoding": "inplace", + "label": "struct EnumerableSet.AddressSet", + "members": [ + { + "astId": 1963, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "_inner", + "offset": 0, + "slot": "0", + "type": "t_struct(Set)1699_storage" + } + ], + "numberOfBytes": "64" + }, + "t_struct(Set)1699_storage": { + "encoding": "inplace", + "label": "struct EnumerableSet.Set", + "members": [ + { + "astId": 1694, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "_values", + "offset": 0, + "slot": "0", + "type": "t_array(t_bytes32)dyn_storage" + }, + { + "astId": 1698, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "_indexes", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_bytes32,t_uint256)" + } + ], + "numberOfBytes": "64" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} \ No newline at end of file diff --git a/packages/token-distribution/deployments/mainnet/GraphTokenLockManager.json b/packages/token-distribution/deployments/mainnet/GraphTokenLockManager.json new file mode 100644 index 000000000..2c8565f39 --- /dev/null +++ b/packages/token-distribution/deployments/mainnet/GraphTokenLockManager.json @@ -0,0 +1,926 @@ +{ + "address": "0xa242759664F68e20e8f5c690a70b6116256914bf", + "abi": [ + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_graphToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_masterCopy", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes4", + "name": "sigHash", + "type": "bytes4" + }, + { + "indexed": true, + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "indexed": false, + "internalType": "string", + "name": "signature", + "type": "string" + } + ], + "name": "FunctionCallAuth", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "masterCopy", + "type": "address" + } + ], + "name": "MasterCopyUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "proxy", + "type": "address" + } + ], + "name": "ProxyCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "dst", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "TokenDestinationAllowed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "contractAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "initHash", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "managedAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "startTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "endTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "periods", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "releaseStartTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "vestingCliffTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "enum IGraphTokenLock.Revocability", + "name": "revocable", + "type": "uint8" + } + ], + "name": "TokenLockCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensDeposited", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensWithdrawn", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_dst", + "type": "address" + } + ], + "name": "addTokenDestination", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "", + "type": "bytes4" + } + ], + "name": "authFnCalls", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_owner", + "type": "address" + }, + { + "internalType": "address", + "name": "_beneficiary", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_managedAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_startTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_endTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_periods", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_releaseStartTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_vestingCliffTime", + "type": "uint256" + }, + { + "internalType": "enum IGraphTokenLock.Revocability", + "name": "_revocable", + "type": "uint8" + } + ], + "name": "createTokenLockWallet", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "deposit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_sigHash", + "type": "bytes4" + } + ], + "name": "getAuthFunctionCallTarget", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_salt", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "_implementation", + "type": "address" + } + ], + "name": "getDeploymentAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getTokenDestinations", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_sigHash", + "type": "bytes4" + } + ], + "name": "isAuthFunctionCall", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_dst", + "type": "address" + } + ], + "name": "isTokenDestination", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "masterCopy", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_dst", + "type": "address" + } + ], + "name": "removeTokenDestination", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_signature", + "type": "string" + }, + { + "internalType": "address", + "name": "_target", + "type": "address" + } + ], + "name": "setAuthFunctionCall", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string[]", + "name": "_signatures", + "type": "string[]" + }, + { + "internalType": "address[]", + "name": "_targets", + "type": "address[]" + } + ], + "name": "setAuthFunctionCallMany", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_masterCopy", + "type": "address" + } + ], + "name": "setMasterCopy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "token", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_signature", + "type": "string" + } + ], + "name": "unsetAuthFunctionCall", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0xf345b60759680b954a7a713f5b33cc8e80f3f94fc011505676dd897020888820", + "receipt": { + "to": null, + "from": "0xE04FcE05E9B8d21521bd1B0f069982c03BD31F76", + "contractAddress": "0xa242759664F68e20e8f5c690a70b6116256914bf", + "transactionIndex": 229, + "gasUsed": "3166292", + "logsBloom": "0x00000000000000000000000000000000000004000000000000800000000000000000000000002000000000000000000000000000000000080000000000000000000004000000000000000000000000000001000000000000000000400000000000000000020000000000000000000800000000000000000000000000000000400000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000040000000000000000000000000000008000000000000000000200000000000000000000000080020000020000000000000000000000000000000200000000000000000000000000000000000", + "blockHash": "0x424888f28081c0ad803b1dd628e41726f440f892b5d27f2cf1516f0ebe684c87", + "transactionHash": "0xf345b60759680b954a7a713f5b33cc8e80f3f94fc011505676dd897020888820", + "logs": [ + { + "transactionIndex": 229, + "blockNumber": 13863822, + "transactionHash": "0xf345b60759680b954a7a713f5b33cc8e80f3f94fc011505676dd897020888820", + "address": "0xa242759664F68e20e8f5c690a70b6116256914bf", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000e04fce05e9b8d21521bd1b0f069982c03bd31f76" + ], + "data": "0x", + "logIndex": 164, + "blockHash": "0x424888f28081c0ad803b1dd628e41726f440f892b5d27f2cf1516f0ebe684c87" + }, + { + "transactionIndex": 229, + "blockNumber": 13863822, + "transactionHash": "0xf345b60759680b954a7a713f5b33cc8e80f3f94fc011505676dd897020888820", + "address": "0xa242759664F68e20e8f5c690a70b6116256914bf", + "topics": [ + "0x30909084afc859121ffc3a5aef7fe37c540a9a1ef60bd4d8dcdb76376fadf9de", + "0x000000000000000000000000ce18fe70d6331f1ac403562202b4dc6ac41a10db" + ], + "data": "0x", + "logIndex": 165, + "blockHash": "0x424888f28081c0ad803b1dd628e41726f440f892b5d27f2cf1516f0ebe684c87" + } + ], + "blockNumber": 13863822, + "cumulativeGasUsed": "14596085", + "status": 1, + "byzantium": true + }, + "args": [ + "0xc944E90C64B2c07662A292be6244BDf05Cda44a7", + "0xcE18fE70D6331f1Ac403562202B4dc6AC41A10Db" + ], + "solcInputHash": "5ad03e035f8e3c63878532d87a315ef8", + "metadata": "{\"compiler\":{\"version\":\"0.7.3+commit.9bfce1f6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"_graphToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_masterCopy\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes4\",\"name\":\"sigHash\",\"type\":\"bytes4\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"signature\",\"type\":\"string\"}],\"name\":\"FunctionCallAuth\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"masterCopy\",\"type\":\"address\"}],\"name\":\"MasterCopyUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"proxy\",\"type\":\"address\"}],\"name\":\"ProxyCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dst\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"}],\"name\":\"TokenDestinationAllowed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"contractAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"initHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"managedAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"startTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"endTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"periods\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"releaseStartTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"vestingCliffTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"enum IGraphTokenLock.Revocability\",\"name\":\"revocable\",\"type\":\"uint8\"}],\"name\":\"TokenLockCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensWithdrawn\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_dst\",\"type\":\"address\"}],\"name\":\"addTokenDestination\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"name\":\"authFnCalls\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_beneficiary\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_managedAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_startTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_endTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_periods\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_releaseStartTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_vestingCliffTime\",\"type\":\"uint256\"},{\"internalType\":\"enum IGraphTokenLock.Revocability\",\"name\":\"_revocable\",\"type\":\"uint8\"}],\"name\":\"createTokenLockWallet\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"deposit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"_sigHash\",\"type\":\"bytes4\"}],\"name\":\"getAuthFunctionCallTarget\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_salt\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"}],\"name\":\"getDeploymentAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTokenDestinations\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"_sigHash\",\"type\":\"bytes4\"}],\"name\":\"isAuthFunctionCall\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_dst\",\"type\":\"address\"}],\"name\":\"isTokenDestination\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"masterCopy\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_dst\",\"type\":\"address\"}],\"name\":\"removeTokenDestination\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_signature\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"_target\",\"type\":\"address\"}],\"name\":\"setAuthFunctionCall\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string[]\",\"name\":\"_signatures\",\"type\":\"string[]\"},{\"internalType\":\"address[]\",\"name\":\"_targets\",\"type\":\"address[]\"}],\"name\":\"setAuthFunctionCallMany\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_masterCopy\",\"type\":\"address\"}],\"name\":\"setMasterCopy\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_signature\",\"type\":\"string\"}],\"name\":\"unsetAuthFunctionCall\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"addTokenDestination(address)\":{\"params\":{\"_dst\":\"Destination address\"}},\"constructor\":{\"params\":{\"_graphToken\":\"Token to use for deposits and withdrawals\",\"_masterCopy\":\"Address of the master copy to use to clone proxies\"}},\"createTokenLockWallet(address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)\":{\"params\":{\"_beneficiary\":\"Address of the beneficiary of locked tokens\",\"_endTime\":\"End time of the release schedule\",\"_managedAmount\":\"Amount of tokens to be managed by the lock contract\",\"_owner\":\"Address of the contract owner\",\"_periods\":\"Number of periods between start time and end time\",\"_releaseStartTime\":\"Override time for when the releases start\",\"_revocable\":\"Whether the contract is revocable\",\"_startTime\":\"Start time of the release schedule\"}},\"deposit(uint256)\":{\"details\":\"Even if the ERC20 token can be transferred directly to the contract this function provide a safe interface to do the transfer and avoid mistakes\",\"params\":{\"_amount\":\"Amount to deposit\"}},\"getAuthFunctionCallTarget(bytes4)\":{\"params\":{\"_sigHash\":\"Function signature hash\"},\"returns\":{\"_0\":\"Address of the target contract where to send the call\"}},\"getDeploymentAddress(bytes32,address)\":{\"params\":{\"_implementation\":\"Address of the proxy target implementation\",\"_salt\":\"Bytes32 salt to use for CREATE2\"},\"returns\":{\"_0\":\"Address of the counterfactual MinimalProxy\"}},\"getTokenDestinations()\":{\"returns\":{\"_0\":\"Array of addresses authorized to pull funds from a token lock\"}},\"isAuthFunctionCall(bytes4)\":{\"params\":{\"_sigHash\":\"Function signature hash\"},\"returns\":{\"_0\":\"True if authorized\"}},\"isTokenDestination(address)\":{\"params\":{\"_dst\":\"Destination address\"},\"returns\":{\"_0\":\"True if authorized\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"removeTokenDestination(address)\":{\"params\":{\"_dst\":\"Destination address\"}},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"setAuthFunctionCall(string,address)\":{\"details\":\"Input expected is the function signature as 'transfer(address,uint256)'\",\"params\":{\"_signature\":\"Function signature\",\"_target\":\"Address of the destination contract to call\"}},\"setAuthFunctionCallMany(string[],address[])\":{\"details\":\"Input expected is the function signature as 'transfer(address,uint256)'\",\"params\":{\"_signatures\":\"Function signatures\",\"_targets\":\"Address of the destination contract to call\"}},\"setMasterCopy(address)\":{\"params\":{\"_masterCopy\":\"Address of contract bytecode to factory clone\"}},\"token()\":{\"returns\":{\"_0\":\"Token used for transfers and approvals\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"unsetAuthFunctionCall(string)\":{\"details\":\"Input expected is the function signature as 'transfer(address,uint256)'\",\"params\":{\"_signature\":\"Function signature\"}},\"withdraw(uint256)\":{\"details\":\"Escape hatch in case of mistakes or to recover remaining funds\",\"params\":{\"_amount\":\"Amount of tokens to withdraw\"}}},\"title\":\"GraphTokenLockManager\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"addTokenDestination(address)\":{\"notice\":\"Adds an address that can be allowed by a token lock to pull funds\"},\"constructor\":{\"notice\":\"Constructor.\"},\"createTokenLockWallet(address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)\":{\"notice\":\"Creates and fund a new token lock wallet using a minimum proxy\"},\"deposit(uint256)\":{\"notice\":\"Deposits tokens into the contract\"},\"getAuthFunctionCallTarget(bytes4)\":{\"notice\":\"Gets the target contract to call for a particular function signature\"},\"getDeploymentAddress(bytes32,address)\":{\"notice\":\"Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation\"},\"getTokenDestinations()\":{\"notice\":\"Returns an array of authorized destination addresses\"},\"isAuthFunctionCall(bytes4)\":{\"notice\":\"Returns true if the function call is authorized\"},\"isTokenDestination(address)\":{\"notice\":\"Returns True if the address is authorized to be a destination of tokens\"},\"removeTokenDestination(address)\":{\"notice\":\"Removes an address that can be allowed by a token lock to pull funds\"},\"setAuthFunctionCall(string,address)\":{\"notice\":\"Sets an authorized function call to target\"},\"setAuthFunctionCallMany(string[],address[])\":{\"notice\":\"Sets an authorized function call to target in bulk\"},\"setMasterCopy(address)\":{\"notice\":\"Sets the masterCopy bytecode to use to create clones of TokenLock contracts\"},\"token()\":{\"notice\":\"Gets the GRT token address\"},\"unsetAuthFunctionCall(string)\":{\"notice\":\"Unsets an authorized function call to target\"},\"withdraw(uint256)\":{\"notice\":\"Withdraws tokens from the contract\"}},\"notice\":\"This contract manages a list of authorized function calls and targets that can be called by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts. This contract receives funds to make the process of creating TokenLockWallet contracts easier by distributing them the initial tokens to be managed. The owner can setup a list of token destinations that will be used by TokenLock contracts to approve the pulling of funds, this way in can be guaranteed that only protocol contracts will manipulate users funds.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/GraphTokenLockManager.sol\":\"GraphTokenLockManager\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor () internal {\\n address msgSender = _msgSender();\\n _owner = msgSender;\\n emit OwnershipTransferred(address(0), msgSender);\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n emit OwnershipTransferred(_owner, address(0));\\n _owner = address(0);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n emit OwnershipTransferred(_owner, newOwner);\\n _owner = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0x15e2d5bd4c28a88548074c54d220e8086f638a71ed07e6b3ba5a70066fcf458d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/math/SafeMath.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Wrappers over Solidity's arithmetic operations with added overflow\\n * checks.\\n *\\n * Arithmetic operations in Solidity wrap on overflow. This can easily result\\n * in bugs, because programmers usually assume that an overflow raises an\\n * error, which is the standard behavior in high level programming languages.\\n * `SafeMath` restores this intuition by reverting the transaction when an\\n * operation overflows.\\n *\\n * Using this library instead of the unchecked operations eliminates an entire\\n * class of bugs, so it's recommended to use it always.\\n */\\nlibrary SafeMath {\\n /**\\n * @dev Returns the addition of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n uint256 c = a + b;\\n if (c < a) return (false, 0);\\n return (true, c);\\n }\\n\\n /**\\n * @dev Returns the substraction of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b > a) return (false, 0);\\n return (true, a - b);\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\\n if (a == 0) return (true, 0);\\n uint256 c = a * b;\\n if (c / a != b) return (false, 0);\\n return (true, c);\\n }\\n\\n /**\\n * @dev Returns the division of two unsigned integers, with a division by zero flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b == 0) return (false, 0);\\n return (true, a / b);\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b == 0) return (false, 0);\\n return (true, a % b);\\n }\\n\\n /**\\n * @dev Returns the addition of two unsigned integers, reverting on\\n * overflow.\\n *\\n * Counterpart to Solidity's `+` operator.\\n *\\n * Requirements:\\n *\\n * - Addition cannot overflow.\\n */\\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\\n uint256 c = a + b;\\n require(c >= a, \\\"SafeMath: addition overflow\\\");\\n return c;\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting on\\n * overflow (when the result is negative).\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n *\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b <= a, \\\"SafeMath: subtraction overflow\\\");\\n return a - b;\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, reverting on\\n * overflow.\\n *\\n * Counterpart to Solidity's `*` operator.\\n *\\n * Requirements:\\n *\\n * - Multiplication cannot overflow.\\n */\\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\\n if (a == 0) return 0;\\n uint256 c = a * b;\\n require(c / a == b, \\\"SafeMath: multiplication overflow\\\");\\n return c;\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers, reverting on\\n * division by zero. The result is rounded towards zero.\\n *\\n * Counterpart to Solidity's `/` operator. Note: this function uses a\\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\\n * uses an invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b > 0, \\\"SafeMath: division by zero\\\");\\n return a / b;\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * reverting when dividing by zero.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b > 0, \\\"SafeMath: modulo by zero\\\");\\n return a % b;\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\\n * overflow (when the result is negative).\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {trySub}.\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n *\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b <= a, errorMessage);\\n return a - b;\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers, reverting with custom message on\\n * division by zero. The result is rounded towards zero.\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {tryDiv}.\\n *\\n * Counterpart to Solidity's `/` operator. Note: this function uses a\\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\\n * uses an invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b > 0, errorMessage);\\n return a / b;\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * reverting with custom message when dividing by zero.\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {tryMod}.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b > 0, errorMessage);\\n return a % b;\\n }\\n}\\n\",\"keccak256\":\"0xcc78a17dd88fa5a2edc60c8489e2f405c0913b377216a5b26b35656b2d0dab52\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `recipient`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address recipient, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `sender` to `recipient` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n}\\n\",\"keccak256\":\"0x5f02220344881ce43204ae4a6281145a67bc52c2bb1290a791857df3d19d78f5\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\nimport \\\"./IERC20.sol\\\";\\nimport \\\"../../math/SafeMath.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @title SafeERC20\\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\\n * contract returns false). Tokens that return no value (and instead revert or\\n * throw on failure) are also supported, non-reverting calls are assumed to be\\n * successful.\\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\n */\\nlibrary SafeERC20 {\\n using SafeMath for uint256;\\n using Address for address;\\n\\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\\n }\\n\\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\\n }\\n\\n /**\\n * @dev Deprecated. This function has issues similar to the ones found in\\n * {IERC20-approve}, and its usage is discouraged.\\n *\\n * Whenever possible, use {safeIncreaseAllowance} and\\n * {safeDecreaseAllowance} instead.\\n */\\n function safeApprove(IERC20 token, address spender, uint256 value) internal {\\n // safeApprove should only be called when setting an initial allowance,\\n // or when resetting it to zero. To increase and decrease it, use\\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\\n // solhint-disable-next-line max-line-length\\n require((value == 0) || (token.allowance(address(this), spender) == 0),\\n \\\"SafeERC20: approve from non-zero to non-zero allowance\\\"\\n );\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\\n }\\n\\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n uint256 newAllowance = token.allowance(address(this), spender).add(value);\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n uint256 newAllowance = token.allowance(address(this), spender).sub(value, \\\"SafeERC20: decreased allowance below zero\\\");\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n */\\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that\\n // the target address contains contract code and also asserts for success in the low-level call.\\n\\n bytes memory returndata = address(token).functionCall(data, \\\"SafeERC20: low-level call failed\\\");\\n if (returndata.length > 0) { // Return data is optional\\n // solhint-disable-next-line max-line-length\\n require(abi.decode(returndata, (bool)), \\\"SafeERC20: ERC20 operation did not succeed\\\");\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf12dfbe97e6276980b83d2830bb0eb75e0cf4f3e626c2471137f82158ae6a0fc\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.2 <0.8.0;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize, which returns 0 for contracts in\\n // construction, since the code is only stored at the end of the\\n // constructor execution.\\n\\n uint256 size;\\n // solhint-disable-next-line no-inline-assembly\\n assembly { size := extcodesize(account) }\\n return size > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls, avoid-call-value\\n (bool success, ) = recipient.call{ value: amount }(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain`call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.call{ value: value }(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x28911e614500ae7c607a432a709d35da25f3bc5ddc8bd12b278b66358070c0ea\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/*\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with GSN meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address payable) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes memory) {\\n this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0x8d3cb350f04ff49cfb10aef08d87f19dcbaecc8027b0bed12f3275cd12f38cf0\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Create2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Helper to make usage of the `CREATE2` EVM opcode easier and safer.\\n * `CREATE2` can be used to compute in advance the address where a smart\\n * contract will be deployed, which allows for interesting new mechanisms known\\n * as 'counterfactual interactions'.\\n *\\n * See the https://eips.ethereum.org/EIPS/eip-1014#motivation[EIP] for more\\n * information.\\n */\\nlibrary Create2 {\\n /**\\n * @dev Deploys a contract using `CREATE2`. The address where the contract\\n * will be deployed can be known in advance via {computeAddress}.\\n *\\n * The bytecode for a contract can be obtained from Solidity with\\n * `type(contractName).creationCode`.\\n *\\n * Requirements:\\n *\\n * - `bytecode` must not be empty.\\n * - `salt` must have not been used for `bytecode` already.\\n * - the factory must have a balance of at least `amount`.\\n * - if `amount` is non-zero, `bytecode` must have a `payable` constructor.\\n */\\n function deploy(uint256 amount, bytes32 salt, bytes memory bytecode) internal returns (address) {\\n address addr;\\n require(address(this).balance >= amount, \\\"Create2: insufficient balance\\\");\\n require(bytecode.length != 0, \\\"Create2: bytecode length is zero\\\");\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n addr := create2(amount, add(bytecode, 0x20), mload(bytecode), salt)\\n }\\n require(addr != address(0), \\\"Create2: Failed on deploy\\\");\\n return addr;\\n }\\n\\n /**\\n * @dev Returns the address where a contract will be stored if deployed via {deploy}. Any change in the\\n * `bytecodeHash` or `salt` will result in a new destination address.\\n */\\n function computeAddress(bytes32 salt, bytes32 bytecodeHash) internal view returns (address) {\\n return computeAddress(salt, bytecodeHash, address(this));\\n }\\n\\n /**\\n * @dev Returns the address where a contract will be stored if deployed via {deploy} from a contract located at\\n * `deployer`. If `deployer` is this contract's address, returns the same value as {computeAddress}.\\n */\\n function computeAddress(bytes32 salt, bytes32 bytecodeHash, address deployer) internal pure returns (address) {\\n bytes32 _data = keccak256(\\n abi.encodePacked(bytes1(0xff), deployer, salt, bytecodeHash)\\n );\\n return address(uint160(uint256(_data)));\\n }\\n}\\n\",\"keccak256\":\"0x0a0b021149946014fe1cd04af11e7a937a29986c47e8b1b718c2d50d729472db\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/EnumerableSet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Library for managing\\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\\n * types.\\n *\\n * Sets have the following properties:\\n *\\n * - Elements are added, removed, and checked for existence in constant time\\n * (O(1)).\\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\\n *\\n * ```\\n * contract Example {\\n * // Add the library methods\\n * using EnumerableSet for EnumerableSet.AddressSet;\\n *\\n * // Declare a set state variable\\n * EnumerableSet.AddressSet private mySet;\\n * }\\n * ```\\n *\\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\\n * and `uint256` (`UintSet`) are supported.\\n */\\nlibrary EnumerableSet {\\n // To implement this library for multiple types with as little code\\n // repetition as possible, we write it in terms of a generic Set type with\\n // bytes32 values.\\n // The Set implementation uses private functions, and user-facing\\n // implementations (such as AddressSet) are just wrappers around the\\n // underlying Set.\\n // This means that we can only create new EnumerableSets for types that fit\\n // in bytes32.\\n\\n struct Set {\\n // Storage of set values\\n bytes32[] _values;\\n\\n // Position of the value in the `values` array, plus 1 because index 0\\n // means a value is not in the set.\\n mapping (bytes32 => uint256) _indexes;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function _add(Set storage set, bytes32 value) private returns (bool) {\\n if (!_contains(set, value)) {\\n set._values.push(value);\\n // The value is stored at length-1, but we add 1 to all indexes\\n // and use 0 as a sentinel value\\n set._indexes[value] = set._values.length;\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function _remove(Set storage set, bytes32 value) private returns (bool) {\\n // We read and store the value's index to prevent multiple reads from the same storage slot\\n uint256 valueIndex = set._indexes[value];\\n\\n if (valueIndex != 0) { // Equivalent to contains(set, value)\\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\\n // the array, and then remove the last element (sometimes called as 'swap and pop').\\n // This modifies the order of the array, as noted in {at}.\\n\\n uint256 toDeleteIndex = valueIndex - 1;\\n uint256 lastIndex = set._values.length - 1;\\n\\n // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs\\n // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.\\n\\n bytes32 lastvalue = set._values[lastIndex];\\n\\n // Move the last value to the index where the value to delete is\\n set._values[toDeleteIndex] = lastvalue;\\n // Update the index for the moved value\\n set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based\\n\\n // Delete the slot where the moved value was stored\\n set._values.pop();\\n\\n // Delete the index for the deleted slot\\n delete set._indexes[value];\\n\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\\n return set._indexes[value] != 0;\\n }\\n\\n /**\\n * @dev Returns the number of values on the set. O(1).\\n */\\n function _length(Set storage set) private view returns (uint256) {\\n return set._values.length;\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\\n require(set._values.length > index, \\\"EnumerableSet: index out of bounds\\\");\\n return set._values[index];\\n }\\n\\n // Bytes32Set\\n\\n struct Bytes32Set {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _add(set._inner, value);\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _remove(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\\n return _contains(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(Bytes32Set storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\\n return _at(set._inner, index);\\n }\\n\\n // AddressSet\\n\\n struct AddressSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(AddressSet storage set, address value) internal returns (bool) {\\n return _add(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(AddressSet storage set, address value) internal returns (bool) {\\n return _remove(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(AddressSet storage set, address value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(AddressSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\\n return address(uint160(uint256(_at(set._inner, index))));\\n }\\n\\n\\n // UintSet\\n\\n struct UintSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(UintSet storage set, uint256 value) internal returns (bool) {\\n return _add(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\\n return _remove(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns the number of values on the set. O(1).\\n */\\n function length(UintSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\\n return uint256(_at(set._inner, index));\\n }\\n}\\n\",\"keccak256\":\"0x1562cd9922fbf739edfb979f506809e2743789cbde3177515542161c3d04b164\",\"license\":\"MIT\"},\"contracts/GraphTokenLockManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/EnumerableSet.sol\\\";\\n\\nimport \\\"./MinimalProxyFactory.sol\\\";\\nimport \\\"./IGraphTokenLockManager.sol\\\";\\n\\n/**\\n * @title GraphTokenLockManager\\n * @notice This contract manages a list of authorized function calls and targets that can be called\\n * by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts.\\n *\\n * This contract receives funds to make the process of creating TokenLockWallet contracts\\n * easier by distributing them the initial tokens to be managed.\\n *\\n * The owner can setup a list of token destinations that will be used by TokenLock contracts to\\n * approve the pulling of funds, this way in can be guaranteed that only protocol contracts\\n * will manipulate users funds.\\n */\\ncontract GraphTokenLockManager is MinimalProxyFactory, IGraphTokenLockManager {\\n using SafeERC20 for IERC20;\\n using EnumerableSet for EnumerableSet.AddressSet;\\n\\n // -- State --\\n\\n mapping(bytes4 => address) public authFnCalls;\\n EnumerableSet.AddressSet private _tokenDestinations;\\n\\n address public masterCopy;\\n IERC20 private _token;\\n\\n // -- Events --\\n\\n event MasterCopyUpdated(address indexed masterCopy);\\n event TokenLockCreated(\\n address indexed contractAddress,\\n bytes32 indexed initHash,\\n address indexed beneficiary,\\n address token,\\n uint256 managedAmount,\\n uint256 startTime,\\n uint256 endTime,\\n uint256 periods,\\n uint256 releaseStartTime,\\n uint256 vestingCliffTime,\\n IGraphTokenLock.Revocability revocable\\n );\\n\\n event TokensDeposited(address indexed sender, uint256 amount);\\n event TokensWithdrawn(address indexed sender, uint256 amount);\\n\\n event FunctionCallAuth(address indexed caller, bytes4 indexed sigHash, address indexed target, string signature);\\n event TokenDestinationAllowed(address indexed dst, bool allowed);\\n\\n /**\\n * Constructor.\\n * @param _graphToken Token to use for deposits and withdrawals\\n * @param _masterCopy Address of the master copy to use to clone proxies\\n */\\n constructor(IERC20 _graphToken, address _masterCopy) {\\n require(address(_graphToken) != address(0), \\\"Token cannot be zero\\\");\\n _token = _graphToken;\\n setMasterCopy(_masterCopy);\\n }\\n\\n // -- Factory --\\n\\n /**\\n * @notice Sets the masterCopy bytecode to use to create clones of TokenLock contracts\\n * @param _masterCopy Address of contract bytecode to factory clone\\n */\\n function setMasterCopy(address _masterCopy) public override onlyOwner {\\n require(_masterCopy != address(0), \\\"MasterCopy cannot be zero\\\");\\n masterCopy = _masterCopy;\\n emit MasterCopyUpdated(_masterCopy);\\n }\\n\\n /**\\n * @notice Creates and fund a new token lock wallet using a minimum proxy\\n * @param _owner Address of the contract owner\\n * @param _beneficiary Address of the beneficiary of locked tokens\\n * @param _managedAmount Amount of tokens to be managed by the lock contract\\n * @param _startTime Start time of the release schedule\\n * @param _endTime End time of the release schedule\\n * @param _periods Number of periods between start time and end time\\n * @param _releaseStartTime Override time for when the releases start\\n * @param _revocable Whether the contract is revocable\\n */\\n function createTokenLockWallet(\\n address _owner,\\n address _beneficiary,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n IGraphTokenLock.Revocability _revocable\\n ) external override onlyOwner {\\n require(_token.balanceOf(address(this)) >= _managedAmount, \\\"Not enough tokens to create lock\\\");\\n\\n // Create contract using a minimal proxy and call initializer\\n bytes memory initializer = abi.encodeWithSignature(\\n \\\"initialize(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)\\\",\\n address(this),\\n _owner,\\n _beneficiary,\\n address(_token),\\n _managedAmount,\\n _startTime,\\n _endTime,\\n _periods,\\n _releaseStartTime,\\n _vestingCliffTime,\\n _revocable\\n );\\n address contractAddress = _deployProxy2(keccak256(initializer), masterCopy, initializer);\\n\\n // Send managed amount to the created contract\\n _token.safeTransfer(contractAddress, _managedAmount);\\n\\n emit TokenLockCreated(\\n contractAddress,\\n keccak256(initializer),\\n _beneficiary,\\n address(_token),\\n _managedAmount,\\n _startTime,\\n _endTime,\\n _periods,\\n _releaseStartTime,\\n _vestingCliffTime,\\n _revocable\\n );\\n }\\n\\n // -- Funds Management --\\n\\n /**\\n * @notice Gets the GRT token address\\n * @return Token used for transfers and approvals\\n */\\n function token() external view override returns (IERC20) {\\n return _token;\\n }\\n\\n /**\\n * @notice Deposits tokens into the contract\\n * @dev Even if the ERC20 token can be transferred directly to the contract\\n * this function provide a safe interface to do the transfer and avoid mistakes\\n * @param _amount Amount to deposit\\n */\\n function deposit(uint256 _amount) external override {\\n require(_amount > 0, \\\"Amount cannot be zero\\\");\\n _token.safeTransferFrom(msg.sender, address(this), _amount);\\n emit TokensDeposited(msg.sender, _amount);\\n }\\n\\n /**\\n * @notice Withdraws tokens from the contract\\n * @dev Escape hatch in case of mistakes or to recover remaining funds\\n * @param _amount Amount of tokens to withdraw\\n */\\n function withdraw(uint256 _amount) external override onlyOwner {\\n require(_amount > 0, \\\"Amount cannot be zero\\\");\\n _token.safeTransfer(msg.sender, _amount);\\n emit TokensWithdrawn(msg.sender, _amount);\\n }\\n\\n // -- Token Destinations --\\n\\n /**\\n * @notice Adds an address that can be allowed by a token lock to pull funds\\n * @param _dst Destination address\\n */\\n function addTokenDestination(address _dst) external override onlyOwner {\\n require(_dst != address(0), \\\"Destination cannot be zero\\\");\\n require(_tokenDestinations.add(_dst), \\\"Destination already added\\\");\\n emit TokenDestinationAllowed(_dst, true);\\n }\\n\\n /**\\n * @notice Removes an address that can be allowed by a token lock to pull funds\\n * @param _dst Destination address\\n */\\n function removeTokenDestination(address _dst) external override onlyOwner {\\n require(_tokenDestinations.remove(_dst), \\\"Destination already removed\\\");\\n emit TokenDestinationAllowed(_dst, false);\\n }\\n\\n /**\\n * @notice Returns True if the address is authorized to be a destination of tokens\\n * @param _dst Destination address\\n * @return True if authorized\\n */\\n function isTokenDestination(address _dst) external view override returns (bool) {\\n return _tokenDestinations.contains(_dst);\\n }\\n\\n /**\\n * @notice Returns an array of authorized destination addresses\\n * @return Array of addresses authorized to pull funds from a token lock\\n */\\n function getTokenDestinations() external view override returns (address[] memory) {\\n address[] memory dstList = new address[](_tokenDestinations.length());\\n for (uint256 i = 0; i < _tokenDestinations.length(); i++) {\\n dstList[i] = _tokenDestinations.at(i);\\n }\\n return dstList;\\n }\\n\\n // -- Function Call Authorization --\\n\\n /**\\n * @notice Sets an authorized function call to target\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @param _signature Function signature\\n * @param _target Address of the destination contract to call\\n */\\n function setAuthFunctionCall(string calldata _signature, address _target) external override onlyOwner {\\n _setAuthFunctionCall(_signature, _target);\\n }\\n\\n /**\\n * @notice Unsets an authorized function call to target\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @param _signature Function signature\\n */\\n function unsetAuthFunctionCall(string calldata _signature) external override onlyOwner {\\n bytes4 sigHash = _toFunctionSigHash(_signature);\\n authFnCalls[sigHash] = address(0);\\n\\n emit FunctionCallAuth(msg.sender, sigHash, address(0), _signature);\\n }\\n\\n /**\\n * @notice Sets an authorized function call to target in bulk\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @param _signatures Function signatures\\n * @param _targets Address of the destination contract to call\\n */\\n function setAuthFunctionCallMany(string[] calldata _signatures, address[] calldata _targets)\\n external\\n override\\n onlyOwner\\n {\\n require(_signatures.length == _targets.length, \\\"Array length mismatch\\\");\\n\\n for (uint256 i = 0; i < _signatures.length; i++) {\\n _setAuthFunctionCall(_signatures[i], _targets[i]);\\n }\\n }\\n\\n /**\\n * @notice Sets an authorized function call to target\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @dev Function signatures of Graph Protocol contracts to be used are known ahead of time\\n * @param _signature Function signature\\n * @param _target Address of the destination contract to call\\n */\\n function _setAuthFunctionCall(string calldata _signature, address _target) internal {\\n require(_target != address(this), \\\"Target must be other contract\\\");\\n require(Address.isContract(_target), \\\"Target must be a contract\\\");\\n\\n bytes4 sigHash = _toFunctionSigHash(_signature);\\n authFnCalls[sigHash] = _target;\\n\\n emit FunctionCallAuth(msg.sender, sigHash, _target, _signature);\\n }\\n\\n /**\\n * @notice Gets the target contract to call for a particular function signature\\n * @param _sigHash Function signature hash\\n * @return Address of the target contract where to send the call\\n */\\n function getAuthFunctionCallTarget(bytes4 _sigHash) public view override returns (address) {\\n return authFnCalls[_sigHash];\\n }\\n\\n /**\\n * @notice Returns true if the function call is authorized\\n * @param _sigHash Function signature hash\\n * @return True if authorized\\n */\\n function isAuthFunctionCall(bytes4 _sigHash) external view override returns (bool) {\\n return getAuthFunctionCallTarget(_sigHash) != address(0);\\n }\\n\\n /**\\n * @dev Converts a function signature string to 4-bytes hash\\n * @param _signature Function signature string\\n * @return Function signature hash\\n */\\n function _toFunctionSigHash(string calldata _signature) internal pure returns (bytes4) {\\n return _convertToBytes4(abi.encodeWithSignature(_signature));\\n }\\n\\n /**\\n * @dev Converts function signature bytes to function signature hash (bytes4)\\n * @param _signature Function signature\\n * @return Function signature in bytes4\\n */\\n function _convertToBytes4(bytes memory _signature) internal pure returns (bytes4) {\\n require(_signature.length == 4, \\\"Invalid method signature\\\");\\n bytes4 sigHash;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n sigHash := mload(add(_signature, 32))\\n }\\n return sigHash;\\n }\\n}\\n\",\"keccak256\":\"0x0384d62cb600eb4128baacf5bca60ea2cb0b68d2d013479daef65ed5f15446ef\",\"license\":\"MIT\"},\"contracts/IGraphTokenLock.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\ninterface IGraphTokenLock {\\n enum Revocability {\\n NotSet,\\n Enabled,\\n Disabled\\n }\\n\\n // -- Balances --\\n\\n function currentBalance() external view returns (uint256);\\n\\n // -- Time & Periods --\\n\\n function currentTime() external view returns (uint256);\\n\\n function duration() external view returns (uint256);\\n\\n function sinceStartTime() external view returns (uint256);\\n\\n function amountPerPeriod() external view returns (uint256);\\n\\n function periodDuration() external view returns (uint256);\\n\\n function currentPeriod() external view returns (uint256);\\n\\n function passedPeriods() external view returns (uint256);\\n\\n // -- Locking & Release Schedule --\\n\\n function availableAmount() external view returns (uint256);\\n\\n function vestedAmount() external view returns (uint256);\\n\\n function releasableAmount() external view returns (uint256);\\n\\n function totalOutstandingAmount() external view returns (uint256);\\n\\n function surplusAmount() external view returns (uint256);\\n\\n // -- Value Transfer --\\n\\n function release() external;\\n\\n function withdrawSurplus(uint256 _amount) external;\\n\\n function revoke() external;\\n}\\n\",\"keccak256\":\"0xceb9d258276fe25ec858191e1deae5778f1b2f612a669fb7b37bab1a064756ab\",\"license\":\"MIT\"},\"contracts/IGraphTokenLockManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nimport \\\"./IGraphTokenLock.sol\\\";\\n\\ninterface IGraphTokenLockManager {\\n // -- Factory --\\n\\n function setMasterCopy(address _masterCopy) external;\\n\\n function createTokenLockWallet(\\n address _owner,\\n address _beneficiary,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n IGraphTokenLock.Revocability _revocable\\n ) external;\\n\\n // -- Funds Management --\\n\\n function token() external returns (IERC20);\\n\\n function deposit(uint256 _amount) external;\\n\\n function withdraw(uint256 _amount) external;\\n\\n // -- Allowed Funds Destinations --\\n\\n function addTokenDestination(address _dst) external;\\n\\n function removeTokenDestination(address _dst) external;\\n\\n function isTokenDestination(address _dst) external view returns (bool);\\n\\n function getTokenDestinations() external view returns (address[] memory);\\n\\n // -- Function Call Authorization --\\n\\n function setAuthFunctionCall(string calldata _signature, address _target) external;\\n\\n function unsetAuthFunctionCall(string calldata _signature) external;\\n\\n function setAuthFunctionCallMany(string[] calldata _signatures, address[] calldata _targets) external;\\n\\n function getAuthFunctionCallTarget(bytes4 _sigHash) external view returns (address);\\n\\n function isAuthFunctionCall(bytes4 _sigHash) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x2d78d41909a6de5b316ac39b100ea087a8f317cf306379888a045523e15c4d9a\",\"license\":\"MIT\"},\"contracts/MinimalProxyFactory.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Create2.sol\\\";\\n\\n// Adapted from https://github.com/OpenZeppelin/openzeppelin-sdk/blob/v2.5.0/packages/lib/contracts/upgradeability/ProxyFactory.sol\\n// Based on https://eips.ethereum.org/EIPS/eip-1167\\ncontract MinimalProxyFactory is Ownable {\\n // -- Events --\\n\\n event ProxyCreated(address indexed proxy);\\n\\n /**\\n * @notice Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation\\n * @param _salt Bytes32 salt to use for CREATE2\\n * @param _implementation Address of the proxy target implementation\\n * @return Address of the counterfactual MinimalProxy\\n */\\n function getDeploymentAddress(bytes32 _salt, address _implementation) external view returns (address) {\\n return Create2.computeAddress(_salt, keccak256(_getContractCreationCode(_implementation)), address(this));\\n }\\n\\n /**\\n * @notice Deploys a MinimalProxy with CREATE2\\n * @param _salt Bytes32 salt to use for CREATE2\\n * @param _implementation Address of the proxy target implementation\\n * @param _data Bytes with the initializer call\\n * @return Address of the deployed MinimalProxy\\n */\\n function _deployProxy2(\\n bytes32 _salt,\\n address _implementation,\\n bytes memory _data\\n ) internal returns (address) {\\n address proxyAddress = Create2.deploy(0, _salt, _getContractCreationCode(_implementation));\\n\\n emit ProxyCreated(proxyAddress);\\n\\n // Call function with data\\n if (_data.length > 0) {\\n Address.functionCall(proxyAddress, _data);\\n }\\n\\n return proxyAddress;\\n }\\n\\n /**\\n * @notice Gets the MinimalProxy bytecode\\n * @param _implementation Address of the proxy target implementation\\n * @return MinimalProxy bytecode\\n */\\n function _getContractCreationCode(address _implementation) internal pure returns (bytes memory) {\\n bytes10 creation = 0x3d602d80600a3d3981f3;\\n bytes10 prefix = 0x363d3d373d3d3d363d73;\\n bytes20 targetBytes = bytes20(_implementation);\\n bytes15 suffix = 0x5af43d82803e903d91602b57fd5bf3;\\n return abi.encodePacked(creation, prefix, targetBytes, suffix);\\n }\\n}\\n\",\"keccak256\":\"0x8aa3d50e714f92dc0ed6cc6d88fa8a18c948493103928f6092f98815b2c046ca\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60806040523480156200001157600080fd5b5060405162003c9338038062003c9383398181016040528101906200003791906200039c565b600062000049620001b460201b60201c565b9050806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a350600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156200015a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200015190620004e7565b60405180910390fd5b81600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550620001ac81620001bc60201b60201c565b505062000596565b600033905090565b620001cc620001b460201b60201c565b73ffffffffffffffffffffffffffffffffffffffff16620001f26200034560201b60201c565b73ffffffffffffffffffffffffffffffffffffffff16146200024b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200024290620004c5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415620002be576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620002b590620004a3565b60405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167f30909084afc859121ffc3a5aef7fe37c540a9a1ef60bd4d8dcdb76376fadf9de60405160405180910390a250565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000815190506200037f8162000562565b92915050565b60008151905062000396816200057c565b92915050565b60008060408385031215620003b057600080fd5b6000620003c08582860162000385565b9250506020620003d3858286016200036e565b9150509250929050565b6000620003ec60198362000509565b91507f4d6173746572436f70792063616e6e6f74206265207a65726f000000000000006000830152602082019050919050565b60006200042e60208362000509565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b60006200047060148362000509565b91507f546f6b656e2063616e6e6f74206265207a65726f0000000000000000000000006000830152602082019050919050565b60006020820190508181036000830152620004be81620003dd565b9050919050565b60006020820190508181036000830152620004e0816200041f565b9050919050565b60006020820190508181036000830152620005028162000461565b9050919050565b600082825260208201905092915050565b6000620005278262000542565b9050919050565b60006200053b826200051a565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6200056d816200051a565b81146200057957600080fd5b50565b62000587816200052e565b81146200059357600080fd5b50565b6136ed80620005a66000396000f3fe608060405234801561001057600080fd5b506004361061012c5760003560e01c80639c05fc60116100ad578063c1ab13db11610071578063c1ab13db14610319578063cf497e6c14610335578063f1d24c4514610351578063f2fde38b14610381578063fc0c546a1461039d5761012c565b80639c05fc6014610275578063a345746614610291578063a619486e146102af578063b6b55f25146102cd578063bdb62fbe146102e95761012c565b806368d30c2e116100f457806368d30c2e146101d15780636e03b8dc146101ed578063715018a61461021d57806379ee1bdf146102275780638da5cb5b146102575761012c565b806303990a6c146101315780630602ba2b1461014d5780632e1a7d4d1461017d578063463013a2146101995780635975e00c146101b5575b600080fd5b61014b6004803603810190610146919061253e565b6103bb565b005b61016760048036038101906101629190612515565b610563565b604051610174919061302d565b60405180910390f35b610197600480360381019061019291906125db565b6105a4565b005b6101b360048036038101906101ae9190612583565b610701565b005b6101cf60048036038101906101ca919061234c565b61078d565b005b6101eb60048036038101906101e69190612375565b61091e565b005b61020760048036038101906102029190612515565b610c7e565b6040516102149190612e67565b60405180910390f35b610225610cb1565b005b610241600480360381019061023c919061234c565b610deb565b60405161024e919061302d565b60405180910390f35b61025f610e08565b60405161026c9190612e67565b60405180910390f35b61028f600480360381019061028a919061243b565b610e31565b005b610299610f5e565b6040516102a6919061300b565b60405180910390f35b6102b7611036565b6040516102c49190612e67565b60405180910390f35b6102e760048036038101906102e291906125db565b61105c565b005b61030360048036038101906102fe91906124d9565b61113f565b6040516103109190612e67565b60405180910390f35b610333600480360381019061032e919061234c565b611163565b005b61034f600480360381019061034a919061234c565b611284565b005b61036b60048036038101906103669190612515565b6113f7565b6040516103789190612e67565b60405180910390f35b61039b6004803603810190610396919061234c565b611472565b005b6103a561161b565b6040516103b29190613048565b60405180910390f35b6103c3611645565b73ffffffffffffffffffffffffffffffffffffffff166103e1610e08565b73ffffffffffffffffffffffffffffffffffffffff1614610437576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042e90613229565b60405180910390fd5b6000610443838361164d565b9050600060016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff16817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163373ffffffffffffffffffffffffffffffffffffffff167f450397a2db0e89eccfe664cc6cdfd274a88bc00d29aaec4d991754a42f19f8c98686604051610556929190613063565b60405180910390a4505050565b60008073ffffffffffffffffffffffffffffffffffffffff16610585836113f7565b73ffffffffffffffffffffffffffffffffffffffff1614159050919050565b6105ac611645565b73ffffffffffffffffffffffffffffffffffffffff166105ca610e08565b73ffffffffffffffffffffffffffffffffffffffff1614610620576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161061790613229565b60405180910390fd5b60008111610663576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161065a90613209565b60405180910390fd5b6106b03382600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166116db9092919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b826040516106f69190613309565b60405180910390a250565b610709611645565b73ffffffffffffffffffffffffffffffffffffffff16610727610e08565b73ffffffffffffffffffffffffffffffffffffffff161461077d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077490613229565b60405180910390fd5b610788838383611761565b505050565b610795611645565b73ffffffffffffffffffffffffffffffffffffffff166107b3610e08565b73ffffffffffffffffffffffffffffffffffffffff1614610809576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080090613229565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610879576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161087090613109565b60405180910390fd5b61088d81600261194390919063ffffffff16565b6108cc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108c390613269565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f33442b8c13e72dd75a027f08f9bff4eed2dfd26e43cdea857365f5163b359a796001604051610913919061302d565b60405180910390a250565b610926611645565b73ffffffffffffffffffffffffffffffffffffffff16610944610e08565b73ffffffffffffffffffffffffffffffffffffffff161461099a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161099190613229565b60405180910390fd5b86600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016109f69190612e67565b60206040518083038186803b158015610a0e57600080fd5b505afa158015610a22573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a469190612604565b1015610a87576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7e90613149565b60405180910390fd5b6060308a8a600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168b8b8b8b8b8b8b604051602401610ad09b9a99989796959493929190612e82565b6040516020818303038152906040527fbd896dcb000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505090506000610b858280519060200120600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611973565b9050610bd4818a600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166116db9092919063ffffffff16565b8973ffffffffffffffffffffffffffffffffffffffff1682805190602001208273ffffffffffffffffffffffffffffffffffffffff167f3c7ff6acee351ed98200c285a04745858a107e16da2f13c3a81a43073c17d644600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168d8d8d8d8d8d8d604051610c69989796959493929190612f8d565b60405180910390a45050505050505050505050565b60016020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610cb9611645565b73ffffffffffffffffffffffffffffffffffffffff16610cd7610e08565b73ffffffffffffffffffffffffffffffffffffffff1614610d2d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d2490613229565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000610e018260026119ef90919063ffffffff16565b9050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610e39611645565b73ffffffffffffffffffffffffffffffffffffffff16610e57610e08565b73ffffffffffffffffffffffffffffffffffffffff1614610ead576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ea490613229565b60405180910390fd5b818190508484905014610ef5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eec906130e9565b60405180910390fd5b60005b84849050811015610f5757610f4a858583818110610f1257fe5b9050602002810190610f249190613324565b858585818110610f3057fe5b9050602002016020810190610f45919061234c565b611761565b8080600101915050610ef8565b5050505050565b606080610f6b6002611a1f565b67ffffffffffffffff81118015610f8157600080fd5b50604051908082528060200260200182016040528015610fb05781602001602082028036833780820191505090505b50905060005b610fc06002611a1f565b81101561102e57610fdb816002611a3490919063ffffffff16565b828281518110610fe757fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508080600101915050610fb6565b508091505090565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000811161109f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161109690613209565b60405180910390fd5b6110ee333083600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611a4e909392919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f59062170a285eb80e8c6b8ced60428442a51910635005233fc4ce084a475845e826040516111349190613309565b60405180910390a250565b600061115b8361114e84611ad7565b8051906020012030611b4d565b905092915050565b61116b611645565b73ffffffffffffffffffffffffffffffffffffffff16611189610e08565b73ffffffffffffffffffffffffffffffffffffffff16146111df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111d690613229565b60405180910390fd5b6111f3816002611b9190919063ffffffff16565b611232576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161122990613189565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f33442b8c13e72dd75a027f08f9bff4eed2dfd26e43cdea857365f5163b359a796000604051611279919061302d565b60405180910390a250565b61128c611645565b73ffffffffffffffffffffffffffffffffffffffff166112aa610e08565b73ffffffffffffffffffffffffffffffffffffffff1614611300576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112f790613229565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611370576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611367906131a9565b60405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167f30909084afc859121ffc3a5aef7fe37c540a9a1ef60bd4d8dcdb76376fadf9de60405160405180910390a250565b600060016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b61147a611645565b73ffffffffffffffffffffffffffffffffffffffff16611498610e08565b73ffffffffffffffffffffffffffffffffffffffff16146114ee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114e590613229565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561155e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155590613129565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600033905090565b60006116d383836040516024016040516020818303038152906040529190604051611679929190612e4e565b60405180910390207bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611bc1565b905092915050565b61175c8363a9059cbb60e01b84846040516024016116fa929190612f64565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611c19565b505050565b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156117d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117c7906131c9565b60405180910390fd5b6117d981611ce0565b611818576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161180f906132e9565b60405180910390fd5b6000611824848461164d565b90508160016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff16817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163373ffffffffffffffffffffffffffffffffffffffff167f450397a2db0e89eccfe664cc6cdfd274a88bc00d29aaec4d991754a42f19f8c98787604051611935929190613063565b60405180910390a450505050565b600061196b836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611cf3565b905092915050565b60008061198a60008661198587611ad7565b611d63565b90508073ffffffffffffffffffffffffffffffffffffffff167efffc2da0b561cae30d9826d37709e9421c4725faebc226cbbb7ef5fc5e734960405160405180910390a26000835111156119e4576119e28184611e74565b505b809150509392505050565b6000611a17836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611ebe565b905092915050565b6000611a2d82600001611ee1565b9050919050565b6000611a438360000183611ef2565b60001c905092915050565b611ad1846323b872dd60e01b858585604051602401611a6f93929190612f2d565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611c19565b50505050565b60606000693d602d80600a3d3981f360b01b9050600069363d3d373d3d3d363d7360b01b905060008460601b905060006e5af43d82803e903d91602b57fd5bf360881b905083838383604051602001611b339493929190612d9b565b604051602081830303815290604052945050505050919050565b60008060ff60f81b838686604051602001611b6b9493929190612de9565b6040516020818303038152906040528051906020012090508060001c9150509392505050565b6000611bb9836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611f5f565b905092915050565b60006004825114611c07576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bfe90613249565b60405180910390fd5b60006020830151905080915050919050565b6060611c7b826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166120479092919063ffffffff16565b9050600081511115611cdb5780806020019051810190611c9b91906124b0565b611cda576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cd1906132a9565b60405180910390fd5b5b505050565b600080823b905060008111915050919050565b6000611cff8383611ebe565b611d58578260000182908060018154018082558091505060019003906000526020600020016000909190919091505582600001805490508360010160008481526020019081526020016000208190555060019050611d5d565b600090505b92915050565b60008084471015611da9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611da0906132c9565b60405180910390fd5b600083511415611dee576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611de5906130c9565b60405180910390fd5b8383516020850187f59050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611e69576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e60906131e9565b60405180910390fd5b809150509392505050565b6060611eb683836040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c65640000815250612047565b905092915050565b600080836001016000848152602001908152602001600020541415905092915050565b600081600001805490509050919050565b600081836000018054905011611f3d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f34906130a9565b60405180910390fd5b826000018281548110611f4c57fe5b9060005260206000200154905092915050565b6000808360010160008481526020019081526020016000205490506000811461203b5760006001820390506000600186600001805490500390506000866000018281548110611faa57fe5b9060005260206000200154905080876000018481548110611fc757fe5b9060005260206000200181905550600183018760010160008381526020019081526020016000208190555086600001805480611fff57fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050612041565b60009150505b92915050565b6060612056848460008561205f565b90509392505050565b6060824710156120a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161209b90613169565b60405180910390fd5b6120ad85611ce0565b6120ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120e390613289565b60405180910390fd5b600060608673ffffffffffffffffffffffffffffffffffffffff1685876040516121169190612e37565b60006040518083038185875af1925050503d8060008114612153576040519150601f19603f3d011682016040523d82523d6000602084013e612158565b606091505b5091509150612168828286612174565b92505050949350505050565b60608315612184578290506121d4565b6000835111156121975782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121cb9190613087565b60405180910390fd5b9392505050565b6000813590506121ea81613634565b92915050565b60008083601f84011261220257600080fd5b8235905067ffffffffffffffff81111561221b57600080fd5b60208301915083602082028301111561223357600080fd5b9250929050565b60008083601f84011261224c57600080fd5b8235905067ffffffffffffffff81111561226557600080fd5b60208301915083602082028301111561227d57600080fd5b9250929050565b6000815190506122938161364b565b92915050565b6000813590506122a881613662565b92915050565b6000813590506122bd81613679565b92915050565b6000813590506122d281613690565b92915050565b60008083601f8401126122ea57600080fd5b8235905067ffffffffffffffff81111561230357600080fd5b60208301915083600182028301111561231b57600080fd5b9250929050565b600081359050612331816136a0565b92915050565b600081519050612346816136a0565b92915050565b60006020828403121561235e57600080fd5b600061236c848285016121db565b91505092915050565b60008060008060008060008060006101208a8c03121561239457600080fd5b60006123a28c828d016121db565b99505060206123b38c828d016121db565b98505060406123c48c828d01612322565b97505060606123d58c828d01612322565b96505060806123e68c828d01612322565b95505060a06123f78c828d01612322565b94505060c06124088c828d01612322565b93505060e06124198c828d01612322565b92505061010061242b8c828d016122c3565b9150509295985092959850929598565b6000806000806040858703121561245157600080fd5b600085013567ffffffffffffffff81111561246b57600080fd5b6124778782880161223a565b9450945050602085013567ffffffffffffffff81111561249657600080fd5b6124a2878288016121f0565b925092505092959194509250565b6000602082840312156124c257600080fd5b60006124d084828501612284565b91505092915050565b600080604083850312156124ec57600080fd5b60006124fa85828601612299565b925050602061250b858286016121db565b9150509250929050565b60006020828403121561252757600080fd5b6000612535848285016122ae565b91505092915050565b6000806020838503121561255157600080fd5b600083013567ffffffffffffffff81111561256b57600080fd5b612577858286016122d8565b92509250509250929050565b60008060006040848603121561259857600080fd5b600084013567ffffffffffffffff8111156125b257600080fd5b6125be868287016122d8565b935093505060206125d1868287016121db565b9150509250925092565b6000602082840312156125ed57600080fd5b60006125fb84828501612322565b91505092915050565b60006020828403121561261657600080fd5b600061262484828501612337565b91505092915050565b60006126398383612645565b60208301905092915050565b61264e816133f1565b82525050565b61265d816133f1565b82525050565b61267461266f826133f1565b6135aa565b82525050565b60006126858261338b565b61268f81856133b9565b935061269a8361337b565b8060005b838110156126cb5781516126b2888261262d565b97506126bd836133ac565b92505060018101905061269e565b5085935050505092915050565b6126e181613403565b82525050565b6126f86126f38261343b565b6135c6565b82525050565b61270f61270a82613467565b6135d0565b82525050565b6127266127218261340f565b6135bc565b82525050565b61273d61273882613493565b6135da565b82525050565b61275461274f826134bf565b6135e4565b82525050565b600061276582613396565b61276f81856133ca565b935061277f818560208601613577565b80840191505092915050565b61279481613532565b82525050565b6127a381613556565b82525050565b60006127b583856133d5565b93506127c2838584613568565b6127cb83613602565b840190509392505050565b60006127e283856133e6565b93506127ef838584613568565b82840190509392505050565b6000612806826133a1565b61281081856133d5565b9350612820818560208601613577565b61282981613602565b840191505092915050565b60006128416022836133d5565b91507f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e60008301527f64730000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006128a76020836133d5565b91507f437265617465323a2062797465636f6465206c656e677468206973207a65726f6000830152602082019050919050565b60006128e76015836133d5565b91507f4172726179206c656e677468206d69736d6174636800000000000000000000006000830152602082019050919050565b6000612927601a836133d5565b91507f44657374696e6174696f6e2063616e6e6f74206265207a65726f0000000000006000830152602082019050919050565b60006129676026836133d5565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006129cd6020836133d5565b91507f4e6f7420656e6f75676820746f6b656e7320746f20637265617465206c6f636b6000830152602082019050919050565b6000612a0d6026836133d5565b91507f416464726573733a20696e73756666696369656e742062616c616e636520666f60008301527f722063616c6c00000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000612a73601b836133d5565b91507f44657374696e6174696f6e20616c72656164792072656d6f76656400000000006000830152602082019050919050565b6000612ab36019836133d5565b91507f4d6173746572436f70792063616e6e6f74206265207a65726f000000000000006000830152602082019050919050565b6000612af3601d836133d5565b91507f546172676574206d757374206265206f7468657220636f6e74726163740000006000830152602082019050919050565b6000612b336019836133d5565b91507f437265617465323a204661696c6564206f6e206465706c6f79000000000000006000830152602082019050919050565b6000612b736015836133d5565b91507f416d6f756e742063616e6e6f74206265207a65726f00000000000000000000006000830152602082019050919050565b6000612bb36020836133d5565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b6000612bf36018836133d5565b91507f496e76616c6964206d6574686f64207369676e617475726500000000000000006000830152602082019050919050565b6000612c336019836133d5565b91507f44657374696e6174696f6e20616c7265616479206164646564000000000000006000830152602082019050919050565b6000612c73601d836133d5565b91507f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006000830152602082019050919050565b6000612cb3602a836133d5565b91507f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008301527f6f742073756363656564000000000000000000000000000000000000000000006020830152604082019050919050565b6000612d19601d836133d5565b91507f437265617465323a20696e73756666696369656e742062616c616e63650000006000830152602082019050919050565b6000612d596019836133d5565b91507f546172676574206d757374206265206120636f6e7472616374000000000000006000830152602082019050919050565b612d9581613528565b82525050565b6000612da782876126e7565b600a82019150612db782866126e7565b600a82019150612dc7828561272c565b601482019150612dd782846126fe565b600f8201915081905095945050505050565b6000612df58287612715565b600182019150612e058286612663565b601482019150612e158285612743565b602082019150612e258284612743565b60208201915081905095945050505050565b6000612e43828461275a565b915081905092915050565b6000612e5b8284866127d6565b91508190509392505050565b6000602082019050612e7c6000830184612654565b92915050565b600061016082019050612e98600083018e612654565b612ea5602083018d612654565b612eb2604083018c612654565b612ebf606083018b612654565b612ecc608083018a612d8c565b612ed960a0830189612d8c565b612ee660c0830188612d8c565b612ef360e0830187612d8c565b612f01610100830186612d8c565b612f0f610120830185612d8c565b612f1d61014083018461279a565b9c9b505050505050505050505050565b6000606082019050612f426000830186612654565b612f4f6020830185612654565b612f5c6040830184612d8c565b949350505050565b6000604082019050612f796000830185612654565b612f866020830184612d8c565b9392505050565b600061010082019050612fa3600083018b612654565b612fb0602083018a612d8c565b612fbd6040830189612d8c565b612fca6060830188612d8c565b612fd76080830187612d8c565b612fe460a0830186612d8c565b612ff160c0830185612d8c565b612ffe60e083018461279a565b9998505050505050505050565b60006020820190508181036000830152613025818461267a565b905092915050565b600060208201905061304260008301846126d8565b92915050565b600060208201905061305d600083018461278b565b92915050565b6000602082019050818103600083015261307e8184866127a9565b90509392505050565b600060208201905081810360008301526130a181846127fb565b905092915050565b600060208201905081810360008301526130c281612834565b9050919050565b600060208201905081810360008301526130e28161289a565b9050919050565b60006020820190508181036000830152613102816128da565b9050919050565b600060208201905081810360008301526131228161291a565b9050919050565b600060208201905081810360008301526131428161295a565b9050919050565b60006020820190508181036000830152613162816129c0565b9050919050565b6000602082019050818103600083015261318281612a00565b9050919050565b600060208201905081810360008301526131a281612a66565b9050919050565b600060208201905081810360008301526131c281612aa6565b9050919050565b600060208201905081810360008301526131e281612ae6565b9050919050565b6000602082019050818103600083015261320281612b26565b9050919050565b6000602082019050818103600083015261322281612b66565b9050919050565b6000602082019050818103600083015261324281612ba6565b9050919050565b6000602082019050818103600083015261326281612be6565b9050919050565b6000602082019050818103600083015261328281612c26565b9050919050565b600060208201905081810360008301526132a281612c66565b9050919050565b600060208201905081810360008301526132c281612ca6565b9050919050565b600060208201905081810360008301526132e281612d0c565b9050919050565b6000602082019050818103600083015261330281612d4c565b9050919050565b600060208201905061331e6000830184612d8c565b92915050565b6000808335600160200384360303811261333d57600080fd5b80840192508235915067ffffffffffffffff82111561335b57600080fd5b60208301925060018202360383131561337357600080fd5b509250929050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b60006133fc82613508565b9050919050565b60008115159050919050565b60007fff0000000000000000000000000000000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffff0000000000000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffffffffffffff000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffffffffffffffffffffffff00000000000000000000000082169050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600081905061350382613620565b919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600061353d82613544565b9050919050565b600061354f82613508565b9050919050565b6000613561826134f5565b9050919050565b82818337600083830152505050565b60005b8381101561359557808201518184015260208101905061357a565b838111156135a4576000848401525b50505050565b60006135b5826135ee565b9050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b60006135f982613613565b9050919050565bfe5b6000601f19601f8301169050919050565b60008160601b9050919050565b6003811061363157613630613600565b5b50565b61363d816133f1565b811461364857600080fd5b50565b61365481613403565b811461365f57600080fd5b50565b61366b816134bf565b811461367657600080fd5b50565b613682816134c9565b811461368d57600080fd5b50565b6003811061369d57600080fd5b50565b6136a981613528565b81146136b457600080fd5b5056fea26469706673582212202d3d549e01583bc5460844b73df152769c2a77e8b1ca88724d847dbd95e3af7964736f6c63430007030033", + "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061012c5760003560e01c80639c05fc60116100ad578063c1ab13db11610071578063c1ab13db14610319578063cf497e6c14610335578063f1d24c4514610351578063f2fde38b14610381578063fc0c546a1461039d5761012c565b80639c05fc6014610275578063a345746614610291578063a619486e146102af578063b6b55f25146102cd578063bdb62fbe146102e95761012c565b806368d30c2e116100f457806368d30c2e146101d15780636e03b8dc146101ed578063715018a61461021d57806379ee1bdf146102275780638da5cb5b146102575761012c565b806303990a6c146101315780630602ba2b1461014d5780632e1a7d4d1461017d578063463013a2146101995780635975e00c146101b5575b600080fd5b61014b6004803603810190610146919061253e565b6103bb565b005b61016760048036038101906101629190612515565b610563565b604051610174919061302d565b60405180910390f35b610197600480360381019061019291906125db565b6105a4565b005b6101b360048036038101906101ae9190612583565b610701565b005b6101cf60048036038101906101ca919061234c565b61078d565b005b6101eb60048036038101906101e69190612375565b61091e565b005b61020760048036038101906102029190612515565b610c7e565b6040516102149190612e67565b60405180910390f35b610225610cb1565b005b610241600480360381019061023c919061234c565b610deb565b60405161024e919061302d565b60405180910390f35b61025f610e08565b60405161026c9190612e67565b60405180910390f35b61028f600480360381019061028a919061243b565b610e31565b005b610299610f5e565b6040516102a6919061300b565b60405180910390f35b6102b7611036565b6040516102c49190612e67565b60405180910390f35b6102e760048036038101906102e291906125db565b61105c565b005b61030360048036038101906102fe91906124d9565b61113f565b6040516103109190612e67565b60405180910390f35b610333600480360381019061032e919061234c565b611163565b005b61034f600480360381019061034a919061234c565b611284565b005b61036b60048036038101906103669190612515565b6113f7565b6040516103789190612e67565b60405180910390f35b61039b6004803603810190610396919061234c565b611472565b005b6103a561161b565b6040516103b29190613048565b60405180910390f35b6103c3611645565b73ffffffffffffffffffffffffffffffffffffffff166103e1610e08565b73ffffffffffffffffffffffffffffffffffffffff1614610437576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042e90613229565b60405180910390fd5b6000610443838361164d565b9050600060016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff16817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163373ffffffffffffffffffffffffffffffffffffffff167f450397a2db0e89eccfe664cc6cdfd274a88bc00d29aaec4d991754a42f19f8c98686604051610556929190613063565b60405180910390a4505050565b60008073ffffffffffffffffffffffffffffffffffffffff16610585836113f7565b73ffffffffffffffffffffffffffffffffffffffff1614159050919050565b6105ac611645565b73ffffffffffffffffffffffffffffffffffffffff166105ca610e08565b73ffffffffffffffffffffffffffffffffffffffff1614610620576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161061790613229565b60405180910390fd5b60008111610663576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161065a90613209565b60405180910390fd5b6106b03382600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166116db9092919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b826040516106f69190613309565b60405180910390a250565b610709611645565b73ffffffffffffffffffffffffffffffffffffffff16610727610e08565b73ffffffffffffffffffffffffffffffffffffffff161461077d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077490613229565b60405180910390fd5b610788838383611761565b505050565b610795611645565b73ffffffffffffffffffffffffffffffffffffffff166107b3610e08565b73ffffffffffffffffffffffffffffffffffffffff1614610809576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080090613229565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610879576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161087090613109565b60405180910390fd5b61088d81600261194390919063ffffffff16565b6108cc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108c390613269565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f33442b8c13e72dd75a027f08f9bff4eed2dfd26e43cdea857365f5163b359a796001604051610913919061302d565b60405180910390a250565b610926611645565b73ffffffffffffffffffffffffffffffffffffffff16610944610e08565b73ffffffffffffffffffffffffffffffffffffffff161461099a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161099190613229565b60405180910390fd5b86600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016109f69190612e67565b60206040518083038186803b158015610a0e57600080fd5b505afa158015610a22573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a469190612604565b1015610a87576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7e90613149565b60405180910390fd5b6060308a8a600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168b8b8b8b8b8b8b604051602401610ad09b9a99989796959493929190612e82565b6040516020818303038152906040527fbd896dcb000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505090506000610b858280519060200120600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611973565b9050610bd4818a600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166116db9092919063ffffffff16565b8973ffffffffffffffffffffffffffffffffffffffff1682805190602001208273ffffffffffffffffffffffffffffffffffffffff167f3c7ff6acee351ed98200c285a04745858a107e16da2f13c3a81a43073c17d644600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168d8d8d8d8d8d8d604051610c69989796959493929190612f8d565b60405180910390a45050505050505050505050565b60016020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610cb9611645565b73ffffffffffffffffffffffffffffffffffffffff16610cd7610e08565b73ffffffffffffffffffffffffffffffffffffffff1614610d2d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d2490613229565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000610e018260026119ef90919063ffffffff16565b9050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610e39611645565b73ffffffffffffffffffffffffffffffffffffffff16610e57610e08565b73ffffffffffffffffffffffffffffffffffffffff1614610ead576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ea490613229565b60405180910390fd5b818190508484905014610ef5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eec906130e9565b60405180910390fd5b60005b84849050811015610f5757610f4a858583818110610f1257fe5b9050602002810190610f249190613324565b858585818110610f3057fe5b9050602002016020810190610f45919061234c565b611761565b8080600101915050610ef8565b5050505050565b606080610f6b6002611a1f565b67ffffffffffffffff81118015610f8157600080fd5b50604051908082528060200260200182016040528015610fb05781602001602082028036833780820191505090505b50905060005b610fc06002611a1f565b81101561102e57610fdb816002611a3490919063ffffffff16565b828281518110610fe757fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508080600101915050610fb6565b508091505090565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000811161109f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161109690613209565b60405180910390fd5b6110ee333083600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611a4e909392919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f59062170a285eb80e8c6b8ced60428442a51910635005233fc4ce084a475845e826040516111349190613309565b60405180910390a250565b600061115b8361114e84611ad7565b8051906020012030611b4d565b905092915050565b61116b611645565b73ffffffffffffffffffffffffffffffffffffffff16611189610e08565b73ffffffffffffffffffffffffffffffffffffffff16146111df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111d690613229565b60405180910390fd5b6111f3816002611b9190919063ffffffff16565b611232576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161122990613189565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f33442b8c13e72dd75a027f08f9bff4eed2dfd26e43cdea857365f5163b359a796000604051611279919061302d565b60405180910390a250565b61128c611645565b73ffffffffffffffffffffffffffffffffffffffff166112aa610e08565b73ffffffffffffffffffffffffffffffffffffffff1614611300576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112f790613229565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611370576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611367906131a9565b60405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167f30909084afc859121ffc3a5aef7fe37c540a9a1ef60bd4d8dcdb76376fadf9de60405160405180910390a250565b600060016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b61147a611645565b73ffffffffffffffffffffffffffffffffffffffff16611498610e08565b73ffffffffffffffffffffffffffffffffffffffff16146114ee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114e590613229565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561155e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155590613129565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600033905090565b60006116d383836040516024016040516020818303038152906040529190604051611679929190612e4e565b60405180910390207bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611bc1565b905092915050565b61175c8363a9059cbb60e01b84846040516024016116fa929190612f64565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611c19565b505050565b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156117d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117c7906131c9565b60405180910390fd5b6117d981611ce0565b611818576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161180f906132e9565b60405180910390fd5b6000611824848461164d565b90508160016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff16817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163373ffffffffffffffffffffffffffffffffffffffff167f450397a2db0e89eccfe664cc6cdfd274a88bc00d29aaec4d991754a42f19f8c98787604051611935929190613063565b60405180910390a450505050565b600061196b836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611cf3565b905092915050565b60008061198a60008661198587611ad7565b611d63565b90508073ffffffffffffffffffffffffffffffffffffffff167efffc2da0b561cae30d9826d37709e9421c4725faebc226cbbb7ef5fc5e734960405160405180910390a26000835111156119e4576119e28184611e74565b505b809150509392505050565b6000611a17836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611ebe565b905092915050565b6000611a2d82600001611ee1565b9050919050565b6000611a438360000183611ef2565b60001c905092915050565b611ad1846323b872dd60e01b858585604051602401611a6f93929190612f2d565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611c19565b50505050565b60606000693d602d80600a3d3981f360b01b9050600069363d3d373d3d3d363d7360b01b905060008460601b905060006e5af43d82803e903d91602b57fd5bf360881b905083838383604051602001611b339493929190612d9b565b604051602081830303815290604052945050505050919050565b60008060ff60f81b838686604051602001611b6b9493929190612de9565b6040516020818303038152906040528051906020012090508060001c9150509392505050565b6000611bb9836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611f5f565b905092915050565b60006004825114611c07576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bfe90613249565b60405180910390fd5b60006020830151905080915050919050565b6060611c7b826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166120479092919063ffffffff16565b9050600081511115611cdb5780806020019051810190611c9b91906124b0565b611cda576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cd1906132a9565b60405180910390fd5b5b505050565b600080823b905060008111915050919050565b6000611cff8383611ebe565b611d58578260000182908060018154018082558091505060019003906000526020600020016000909190919091505582600001805490508360010160008481526020019081526020016000208190555060019050611d5d565b600090505b92915050565b60008084471015611da9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611da0906132c9565b60405180910390fd5b600083511415611dee576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611de5906130c9565b60405180910390fd5b8383516020850187f59050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611e69576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e60906131e9565b60405180910390fd5b809150509392505050565b6060611eb683836040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c65640000815250612047565b905092915050565b600080836001016000848152602001908152602001600020541415905092915050565b600081600001805490509050919050565b600081836000018054905011611f3d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f34906130a9565b60405180910390fd5b826000018281548110611f4c57fe5b9060005260206000200154905092915050565b6000808360010160008481526020019081526020016000205490506000811461203b5760006001820390506000600186600001805490500390506000866000018281548110611faa57fe5b9060005260206000200154905080876000018481548110611fc757fe5b9060005260206000200181905550600183018760010160008381526020019081526020016000208190555086600001805480611fff57fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050612041565b60009150505b92915050565b6060612056848460008561205f565b90509392505050565b6060824710156120a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161209b90613169565b60405180910390fd5b6120ad85611ce0565b6120ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120e390613289565b60405180910390fd5b600060608673ffffffffffffffffffffffffffffffffffffffff1685876040516121169190612e37565b60006040518083038185875af1925050503d8060008114612153576040519150601f19603f3d011682016040523d82523d6000602084013e612158565b606091505b5091509150612168828286612174565b92505050949350505050565b60608315612184578290506121d4565b6000835111156121975782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121cb9190613087565b60405180910390fd5b9392505050565b6000813590506121ea81613634565b92915050565b60008083601f84011261220257600080fd5b8235905067ffffffffffffffff81111561221b57600080fd5b60208301915083602082028301111561223357600080fd5b9250929050565b60008083601f84011261224c57600080fd5b8235905067ffffffffffffffff81111561226557600080fd5b60208301915083602082028301111561227d57600080fd5b9250929050565b6000815190506122938161364b565b92915050565b6000813590506122a881613662565b92915050565b6000813590506122bd81613679565b92915050565b6000813590506122d281613690565b92915050565b60008083601f8401126122ea57600080fd5b8235905067ffffffffffffffff81111561230357600080fd5b60208301915083600182028301111561231b57600080fd5b9250929050565b600081359050612331816136a0565b92915050565b600081519050612346816136a0565b92915050565b60006020828403121561235e57600080fd5b600061236c848285016121db565b91505092915050565b60008060008060008060008060006101208a8c03121561239457600080fd5b60006123a28c828d016121db565b99505060206123b38c828d016121db565b98505060406123c48c828d01612322565b97505060606123d58c828d01612322565b96505060806123e68c828d01612322565b95505060a06123f78c828d01612322565b94505060c06124088c828d01612322565b93505060e06124198c828d01612322565b92505061010061242b8c828d016122c3565b9150509295985092959850929598565b6000806000806040858703121561245157600080fd5b600085013567ffffffffffffffff81111561246b57600080fd5b6124778782880161223a565b9450945050602085013567ffffffffffffffff81111561249657600080fd5b6124a2878288016121f0565b925092505092959194509250565b6000602082840312156124c257600080fd5b60006124d084828501612284565b91505092915050565b600080604083850312156124ec57600080fd5b60006124fa85828601612299565b925050602061250b858286016121db565b9150509250929050565b60006020828403121561252757600080fd5b6000612535848285016122ae565b91505092915050565b6000806020838503121561255157600080fd5b600083013567ffffffffffffffff81111561256b57600080fd5b612577858286016122d8565b92509250509250929050565b60008060006040848603121561259857600080fd5b600084013567ffffffffffffffff8111156125b257600080fd5b6125be868287016122d8565b935093505060206125d1868287016121db565b9150509250925092565b6000602082840312156125ed57600080fd5b60006125fb84828501612322565b91505092915050565b60006020828403121561261657600080fd5b600061262484828501612337565b91505092915050565b60006126398383612645565b60208301905092915050565b61264e816133f1565b82525050565b61265d816133f1565b82525050565b61267461266f826133f1565b6135aa565b82525050565b60006126858261338b565b61268f81856133b9565b935061269a8361337b565b8060005b838110156126cb5781516126b2888261262d565b97506126bd836133ac565b92505060018101905061269e565b5085935050505092915050565b6126e181613403565b82525050565b6126f86126f38261343b565b6135c6565b82525050565b61270f61270a82613467565b6135d0565b82525050565b6127266127218261340f565b6135bc565b82525050565b61273d61273882613493565b6135da565b82525050565b61275461274f826134bf565b6135e4565b82525050565b600061276582613396565b61276f81856133ca565b935061277f818560208601613577565b80840191505092915050565b61279481613532565b82525050565b6127a381613556565b82525050565b60006127b583856133d5565b93506127c2838584613568565b6127cb83613602565b840190509392505050565b60006127e283856133e6565b93506127ef838584613568565b82840190509392505050565b6000612806826133a1565b61281081856133d5565b9350612820818560208601613577565b61282981613602565b840191505092915050565b60006128416022836133d5565b91507f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e60008301527f64730000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006128a76020836133d5565b91507f437265617465323a2062797465636f6465206c656e677468206973207a65726f6000830152602082019050919050565b60006128e76015836133d5565b91507f4172726179206c656e677468206d69736d6174636800000000000000000000006000830152602082019050919050565b6000612927601a836133d5565b91507f44657374696e6174696f6e2063616e6e6f74206265207a65726f0000000000006000830152602082019050919050565b60006129676026836133d5565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006129cd6020836133d5565b91507f4e6f7420656e6f75676820746f6b656e7320746f20637265617465206c6f636b6000830152602082019050919050565b6000612a0d6026836133d5565b91507f416464726573733a20696e73756666696369656e742062616c616e636520666f60008301527f722063616c6c00000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000612a73601b836133d5565b91507f44657374696e6174696f6e20616c72656164792072656d6f76656400000000006000830152602082019050919050565b6000612ab36019836133d5565b91507f4d6173746572436f70792063616e6e6f74206265207a65726f000000000000006000830152602082019050919050565b6000612af3601d836133d5565b91507f546172676574206d757374206265206f7468657220636f6e74726163740000006000830152602082019050919050565b6000612b336019836133d5565b91507f437265617465323a204661696c6564206f6e206465706c6f79000000000000006000830152602082019050919050565b6000612b736015836133d5565b91507f416d6f756e742063616e6e6f74206265207a65726f00000000000000000000006000830152602082019050919050565b6000612bb36020836133d5565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b6000612bf36018836133d5565b91507f496e76616c6964206d6574686f64207369676e617475726500000000000000006000830152602082019050919050565b6000612c336019836133d5565b91507f44657374696e6174696f6e20616c7265616479206164646564000000000000006000830152602082019050919050565b6000612c73601d836133d5565b91507f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006000830152602082019050919050565b6000612cb3602a836133d5565b91507f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008301527f6f742073756363656564000000000000000000000000000000000000000000006020830152604082019050919050565b6000612d19601d836133d5565b91507f437265617465323a20696e73756666696369656e742062616c616e63650000006000830152602082019050919050565b6000612d596019836133d5565b91507f546172676574206d757374206265206120636f6e7472616374000000000000006000830152602082019050919050565b612d9581613528565b82525050565b6000612da782876126e7565b600a82019150612db782866126e7565b600a82019150612dc7828561272c565b601482019150612dd782846126fe565b600f8201915081905095945050505050565b6000612df58287612715565b600182019150612e058286612663565b601482019150612e158285612743565b602082019150612e258284612743565b60208201915081905095945050505050565b6000612e43828461275a565b915081905092915050565b6000612e5b8284866127d6565b91508190509392505050565b6000602082019050612e7c6000830184612654565b92915050565b600061016082019050612e98600083018e612654565b612ea5602083018d612654565b612eb2604083018c612654565b612ebf606083018b612654565b612ecc608083018a612d8c565b612ed960a0830189612d8c565b612ee660c0830188612d8c565b612ef360e0830187612d8c565b612f01610100830186612d8c565b612f0f610120830185612d8c565b612f1d61014083018461279a565b9c9b505050505050505050505050565b6000606082019050612f426000830186612654565b612f4f6020830185612654565b612f5c6040830184612d8c565b949350505050565b6000604082019050612f796000830185612654565b612f866020830184612d8c565b9392505050565b600061010082019050612fa3600083018b612654565b612fb0602083018a612d8c565b612fbd6040830189612d8c565b612fca6060830188612d8c565b612fd76080830187612d8c565b612fe460a0830186612d8c565b612ff160c0830185612d8c565b612ffe60e083018461279a565b9998505050505050505050565b60006020820190508181036000830152613025818461267a565b905092915050565b600060208201905061304260008301846126d8565b92915050565b600060208201905061305d600083018461278b565b92915050565b6000602082019050818103600083015261307e8184866127a9565b90509392505050565b600060208201905081810360008301526130a181846127fb565b905092915050565b600060208201905081810360008301526130c281612834565b9050919050565b600060208201905081810360008301526130e28161289a565b9050919050565b60006020820190508181036000830152613102816128da565b9050919050565b600060208201905081810360008301526131228161291a565b9050919050565b600060208201905081810360008301526131428161295a565b9050919050565b60006020820190508181036000830152613162816129c0565b9050919050565b6000602082019050818103600083015261318281612a00565b9050919050565b600060208201905081810360008301526131a281612a66565b9050919050565b600060208201905081810360008301526131c281612aa6565b9050919050565b600060208201905081810360008301526131e281612ae6565b9050919050565b6000602082019050818103600083015261320281612b26565b9050919050565b6000602082019050818103600083015261322281612b66565b9050919050565b6000602082019050818103600083015261324281612ba6565b9050919050565b6000602082019050818103600083015261326281612be6565b9050919050565b6000602082019050818103600083015261328281612c26565b9050919050565b600060208201905081810360008301526132a281612c66565b9050919050565b600060208201905081810360008301526132c281612ca6565b9050919050565b600060208201905081810360008301526132e281612d0c565b9050919050565b6000602082019050818103600083015261330281612d4c565b9050919050565b600060208201905061331e6000830184612d8c565b92915050565b6000808335600160200384360303811261333d57600080fd5b80840192508235915067ffffffffffffffff82111561335b57600080fd5b60208301925060018202360383131561337357600080fd5b509250929050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b60006133fc82613508565b9050919050565b60008115159050919050565b60007fff0000000000000000000000000000000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffff0000000000000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffffffffffffff000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffffffffffffffffffffffff00000000000000000000000082169050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600081905061350382613620565b919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600061353d82613544565b9050919050565b600061354f82613508565b9050919050565b6000613561826134f5565b9050919050565b82818337600083830152505050565b60005b8381101561359557808201518184015260208101905061357a565b838111156135a4576000848401525b50505050565b60006135b5826135ee565b9050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b60006135f982613613565b9050919050565bfe5b6000601f19601f8301169050919050565b60008160601b9050919050565b6003811061363157613630613600565b5b50565b61363d816133f1565b811461364857600080fd5b50565b61365481613403565b811461365f57600080fd5b50565b61366b816134bf565b811461367657600080fd5b50565b613682816134c9565b811461368d57600080fd5b50565b6003811061369d57600080fd5b50565b6136a981613528565b81146136b457600080fd5b5056fea26469706673582212202d3d549e01583bc5460844b73df152769c2a77e8b1ca88724d847dbd95e3af7964736f6c63430007030033", + "devdoc": { + "kind": "dev", + "methods": { + "addTokenDestination(address)": { + "params": { + "_dst": "Destination address" + } + }, + "constructor": { + "params": { + "_graphToken": "Token to use for deposits and withdrawals", + "_masterCopy": "Address of the master copy to use to clone proxies" + } + }, + "createTokenLockWallet(address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)": { + "params": { + "_beneficiary": "Address of the beneficiary of locked tokens", + "_endTime": "End time of the release schedule", + "_managedAmount": "Amount of tokens to be managed by the lock contract", + "_owner": "Address of the contract owner", + "_periods": "Number of periods between start time and end time", + "_releaseStartTime": "Override time for when the releases start", + "_revocable": "Whether the contract is revocable", + "_startTime": "Start time of the release schedule" + } + }, + "deposit(uint256)": { + "details": "Even if the ERC20 token can be transferred directly to the contract this function provide a safe interface to do the transfer and avoid mistakes", + "params": { + "_amount": "Amount to deposit" + } + }, + "getAuthFunctionCallTarget(bytes4)": { + "params": { + "_sigHash": "Function signature hash" + }, + "returns": { + "_0": "Address of the target contract where to send the call" + } + }, + "getDeploymentAddress(bytes32,address)": { + "params": { + "_implementation": "Address of the proxy target implementation", + "_salt": "Bytes32 salt to use for CREATE2" + }, + "returns": { + "_0": "Address of the counterfactual MinimalProxy" + } + }, + "getTokenDestinations()": { + "returns": { + "_0": "Array of addresses authorized to pull funds from a token lock" + } + }, + "isAuthFunctionCall(bytes4)": { + "params": { + "_sigHash": "Function signature hash" + }, + "returns": { + "_0": "True if authorized" + } + }, + "isTokenDestination(address)": { + "params": { + "_dst": "Destination address" + }, + "returns": { + "_0": "True if authorized" + } + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "removeTokenDestination(address)": { + "params": { + "_dst": "Destination address" + } + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." + }, + "setAuthFunctionCall(string,address)": { + "details": "Input expected is the function signature as 'transfer(address,uint256)'", + "params": { + "_signature": "Function signature", + "_target": "Address of the destination contract to call" + } + }, + "setAuthFunctionCallMany(string[],address[])": { + "details": "Input expected is the function signature as 'transfer(address,uint256)'", + "params": { + "_signatures": "Function signatures", + "_targets": "Address of the destination contract to call" + } + }, + "setMasterCopy(address)": { + "params": { + "_masterCopy": "Address of contract bytecode to factory clone" + } + }, + "token()": { + "returns": { + "_0": "Token used for transfers and approvals" + } + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + }, + "unsetAuthFunctionCall(string)": { + "details": "Input expected is the function signature as 'transfer(address,uint256)'", + "params": { + "_signature": "Function signature" + } + }, + "withdraw(uint256)": { + "details": "Escape hatch in case of mistakes or to recover remaining funds", + "params": { + "_amount": "Amount of tokens to withdraw" + } + } + }, + "title": "GraphTokenLockManager", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "addTokenDestination(address)": { + "notice": "Adds an address that can be allowed by a token lock to pull funds" + }, + "constructor": { + "notice": "Constructor." + }, + "createTokenLockWallet(address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)": { + "notice": "Creates and fund a new token lock wallet using a minimum proxy" + }, + "deposit(uint256)": { + "notice": "Deposits tokens into the contract" + }, + "getAuthFunctionCallTarget(bytes4)": { + "notice": "Gets the target contract to call for a particular function signature" + }, + "getDeploymentAddress(bytes32,address)": { + "notice": "Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation" + }, + "getTokenDestinations()": { + "notice": "Returns an array of authorized destination addresses" + }, + "isAuthFunctionCall(bytes4)": { + "notice": "Returns true if the function call is authorized" + }, + "isTokenDestination(address)": { + "notice": "Returns True if the address is authorized to be a destination of tokens" + }, + "removeTokenDestination(address)": { + "notice": "Removes an address that can be allowed by a token lock to pull funds" + }, + "setAuthFunctionCall(string,address)": { + "notice": "Sets an authorized function call to target" + }, + "setAuthFunctionCallMany(string[],address[])": { + "notice": "Sets an authorized function call to target in bulk" + }, + "setMasterCopy(address)": { + "notice": "Sets the masterCopy bytecode to use to create clones of TokenLock contracts" + }, + "token()": { + "notice": "Gets the GRT token address" + }, + "unsetAuthFunctionCall(string)": { + "notice": "Unsets an authorized function call to target" + }, + "withdraw(uint256)": { + "notice": "Withdraws tokens from the contract" + } + }, + "notice": "This contract manages a list of authorized function calls and targets that can be called by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts. This contract receives funds to make the process of creating TokenLockWallet contracts easier by distributing them the initial tokens to be managed. The owner can setup a list of token destinations that will be used by TokenLock contracts to approve the pulling of funds, this way in can be guaranteed that only protocol contracts will manipulate users funds.", + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 7, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "_owner", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 2439, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "authFnCalls", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_bytes4,t_address)" + }, + { + "astId": 2441, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "_tokenDestinations", + "offset": 0, + "slot": "2", + "type": "t_struct(AddressSet)1461_storage" + }, + { + "astId": 2443, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "masterCopy", + "offset": 0, + "slot": "4", + "type": "t_address" + }, + { + "astId": 2445, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "_token", + "offset": 0, + "slot": "5", + "type": "t_contract(IERC20)542" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_bytes32)dyn_storage": { + "base": "t_bytes32", + "encoding": "dynamic_array", + "label": "bytes32[]", + "numberOfBytes": "32" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_bytes4": { + "encoding": "inplace", + "label": "bytes4", + "numberOfBytes": "4" + }, + "t_contract(IERC20)542": { + "encoding": "inplace", + "label": "contract IERC20", + "numberOfBytes": "20" + }, + "t_mapping(t_bytes32,t_uint256)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_mapping(t_bytes4,t_address)": { + "encoding": "mapping", + "key": "t_bytes4", + "label": "mapping(bytes4 => address)", + "numberOfBytes": "32", + "value": "t_address" + }, + "t_struct(AddressSet)1461_storage": { + "encoding": "inplace", + "label": "struct EnumerableSet.AddressSet", + "members": [ + { + "astId": 1460, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "_inner", + "offset": 0, + "slot": "0", + "type": "t_struct(Set)1196_storage" + } + ], + "numberOfBytes": "64" + }, + "t_struct(Set)1196_storage": { + "encoding": "inplace", + "label": "struct EnumerableSet.Set", + "members": [ + { + "astId": 1191, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "_values", + "offset": 0, + "slot": "0", + "type": "t_array(t_bytes32)dyn_storage" + }, + { + "astId": 1195, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "_indexes", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_bytes32,t_uint256)" + } + ], + "numberOfBytes": "64" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} \ No newline at end of file diff --git a/packages/token-distribution/deployments/mainnet/GraphTokenLockWallet-Foundation.json b/packages/token-distribution/deployments/mainnet/GraphTokenLockWallet-Foundation.json new file mode 100644 index 000000000..2bfc70eaf --- /dev/null +++ b/packages/token-distribution/deployments/mainnet/GraphTokenLockWallet-Foundation.json @@ -0,0 +1,1083 @@ +{ + "address": "0x624984fd288e28C0D24d7E0E4aDFDa130717720B", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "newBeneficiary", + "type": "address" + } + ], + "name": "BeneficiaryChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "LockAccepted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "LockCanceled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_oldManager", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "_newManager", + "type": "address" + } + ], + "name": "ManagerUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "TokenDestinationsApproved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "TokenDestinationsRevoked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensReleased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensRevoked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensWithdrawn", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "acceptLock", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "amountPerPeriod", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "approveProtocol", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "availableAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "beneficiary", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "cancelLock", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newBeneficiary", + "type": "address" + } + ], + "name": "changeBeneficiary", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "currentBalance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "currentPeriod", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "currentTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "duration", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "endTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_manager", + "type": "address" + }, + { + "internalType": "address", + "name": "_owner", + "type": "address" + }, + { + "internalType": "address", + "name": "_beneficiary", + "type": "address" + }, + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_managedAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_startTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_endTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_periods", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_releaseStartTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_vestingCliffTime", + "type": "uint256" + }, + { + "internalType": "enum IGraphTokenLock.Revocability", + "name": "_revocable", + "type": "uint8" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "isAccepted", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isInitialized", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isRevoked", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "managedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "manager", + "outputs": [ + { + "internalType": "contract IGraphTokenLockManager", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "passedPeriods", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "periodDuration", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "periods", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "releasableAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "release", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "releaseStartTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "releasedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "revocable", + "outputs": [ + { + "internalType": "enum IGraphTokenLock.Revocability", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "revoke", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "revokeProtocol", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "revokedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newManager", + "type": "address" + } + ], + "name": "setManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "sinceStartTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "startTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "surplusAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "token", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalOutstandingAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "usedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "vestedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "vestingCliffTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "withdrawSurplus", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x86a285707dd06466b0f7d7e9e6622d561013f6163865e82ee7fdab6253db5112", + "receipt": { + "to": null, + "from": "0xE04FcE05E9B8d21521bd1B0f069982c03BD31F76", + "contractAddress": "0x624984fd288e28C0D24d7E0E4aDFDa130717720B", + "transactionIndex": 85, + "gasUsed": "3482943", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x4c56d99203adc1acca5170c9f5b47bfe0559aab828956ae8978e6c5d72e204e3", + "transactionHash": "0x86a285707dd06466b0f7d7e9e6622d561013f6163865e82ee7fdab6253db5112", + "logs": [], + "blockNumber": 15877686, + "cumulativeGasUsed": "11372781", + "status": 1, + "byzantium": true + }, + "args": [], + "solcInputHash": "6f5e8f450f52dd96ebb796aa6620fee9", + "metadata": "{\"compiler\":{\"version\":\"0.7.3+commit.9bfce1f6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newBeneficiary\",\"type\":\"address\"}],\"name\":\"BeneficiaryChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"LockAccepted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"LockCanceled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_oldManager\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_newManager\",\"type\":\"address\"}],\"name\":\"ManagerUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"TokenDestinationsApproved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"TokenDestinationsRevoked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensReleased\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensRevoked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensWithdrawn\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"acceptLock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"amountPerPeriod\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"approveProtocol\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"availableAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"beneficiary\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"cancelLock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_newBeneficiary\",\"type\":\"address\"}],\"name\":\"changeBeneficiary\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"currentBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"currentPeriod\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"currentTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"duration\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"endTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_manager\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_beneficiary\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_managedAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_startTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_endTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_periods\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_releaseStartTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_vestingCliffTime\",\"type\":\"uint256\"},{\"internalType\":\"enum IGraphTokenLock.Revocability\",\"name\":\"_revocable\",\"type\":\"uint8\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isAccepted\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isInitialized\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isRevoked\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"managedAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"manager\",\"outputs\":[{\"internalType\":\"contract IGraphTokenLockManager\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"passedPeriods\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"periodDuration\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"periods\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"releasableAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"release\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"releaseStartTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"releasedAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"revocable\",\"outputs\":[{\"internalType\":\"enum IGraphTokenLock.Revocability\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"revoke\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"revokeProtocol\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"revokedAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_newManager\",\"type\":\"address\"}],\"name\":\"setManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"sinceStartTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"startTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"surplusAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalOutstandingAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"usedAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"vestedAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"vestingCliffTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdrawSurplus\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"acceptLock()\":{\"details\":\"Can only be called by the beneficiary\"},\"amountPerPeriod()\":{\"returns\":{\"_0\":\"Amount of tokens available after each period\"}},\"approveProtocol()\":{\"details\":\"Approves all token destinations registered in the manager to pull tokens\"},\"availableAmount()\":{\"details\":\"Implements the step-by-step schedule based on periods for available tokens\",\"returns\":{\"_0\":\"Amount of tokens available according to the schedule\"}},\"cancelLock()\":{\"details\":\"Can only be called by the owner\"},\"changeBeneficiary(address)\":{\"details\":\"Can only be called by the beneficiary\",\"params\":{\"_newBeneficiary\":\"Address of the new beneficiary address\"}},\"currentBalance()\":{\"returns\":{\"_0\":\"Tokens held in the contract\"}},\"currentPeriod()\":{\"returns\":{\"_0\":\"A number that represents the current period\"}},\"currentTime()\":{\"returns\":{\"_0\":\"Current block timestamp\"}},\"duration()\":{\"returns\":{\"_0\":\"Amount of seconds from contract startTime to endTime\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"passedPeriods()\":{\"returns\":{\"_0\":\"A number of periods that passed since the schedule started\"}},\"periodDuration()\":{\"returns\":{\"_0\":\"Duration of each period in seconds\"}},\"releasableAmount()\":{\"details\":\"Considers the schedule, takes into account already released tokens and used amount\",\"returns\":{\"_0\":\"Amount of tokens ready to be released\"}},\"release()\":{\"details\":\"All available releasable tokens are transferred to beneficiary\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"revoke()\":{\"details\":\"Vesting schedule is always calculated based on managed tokens\"},\"revokeProtocol()\":{\"details\":\"Revokes approval to all token destinations in the manager to pull tokens\"},\"setManager(address)\":{\"params\":{\"_newManager\":\"Address of the new manager\"}},\"sinceStartTime()\":{\"details\":\"Returns zero if called before conctract starTime\",\"returns\":{\"_0\":\"Seconds elapsed from contract startTime\"}},\"surplusAmount()\":{\"details\":\"All funds over outstanding amount is considered surplus that can be withdrawn by beneficiary\",\"returns\":{\"_0\":\"Amount of tokens considered as surplus\"}},\"totalOutstandingAmount()\":{\"details\":\"Does not consider schedule but just global amounts tracked\",\"returns\":{\"_0\":\"Amount of outstanding tokens for the lifetime of the contract\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"vestedAmount()\":{\"details\":\"Similar to available amount, but is fully vested when contract is non-revocable\",\"returns\":{\"_0\":\"Amount of tokens already vested\"}},\"withdrawSurplus(uint256)\":{\"details\":\"Tokens in the contract over outstanding amount are considered as surplus\",\"params\":{\"_amount\":\"Amount of tokens to withdraw\"}}},\"title\":\"GraphTokenLockWallet\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"acceptLock()\":{\"notice\":\"Beneficiary accepts the lock, the owner cannot retrieve back the tokens\"},\"amountPerPeriod()\":{\"notice\":\"Returns amount available to be released after each period according to schedule\"},\"approveProtocol()\":{\"notice\":\"Approves protocol access of the tokens managed by this contract\"},\"availableAmount()\":{\"notice\":\"Gets the currently available token according to the schedule\"},\"cancelLock()\":{\"notice\":\"Owner cancel the lock and return the balance in the contract\"},\"changeBeneficiary(address)\":{\"notice\":\"Change the beneficiary of funds managed by the contract\"},\"currentBalance()\":{\"notice\":\"Returns the amount of tokens currently held by the contract\"},\"currentPeriod()\":{\"notice\":\"Gets the current period based on the schedule\"},\"currentTime()\":{\"notice\":\"Returns the current block timestamp\"},\"duration()\":{\"notice\":\"Gets duration of contract from start to end in seconds\"},\"passedPeriods()\":{\"notice\":\"Gets the number of periods that passed since the first period\"},\"periodDuration()\":{\"notice\":\"Returns the duration of each period in seconds\"},\"releasableAmount()\":{\"notice\":\"Gets tokens currently available for release\"},\"release()\":{\"notice\":\"Releases tokens based on the configured schedule\"},\"revoke()\":{\"notice\":\"Revokes a vesting schedule and return the unvested tokens to the owner\"},\"revokeProtocol()\":{\"notice\":\"Revokes protocol access of the tokens managed by this contract\"},\"setManager(address)\":{\"notice\":\"Sets a new manager for this contract\"},\"sinceStartTime()\":{\"notice\":\"Gets time elapsed since the start of the contract\"},\"surplusAmount()\":{\"notice\":\"Gets surplus amount in the contract based on outstanding amount to release\"},\"totalOutstandingAmount()\":{\"notice\":\"Gets the outstanding amount yet to be released based on the whole contract lifetime\"},\"vestedAmount()\":{\"notice\":\"Gets the amount of currently vested tokens\"},\"withdrawSurplus(uint256)\":{\"notice\":\"Withdraws surplus, unmanaged tokens from the contract\"}},\"notice\":\"This contract is built on top of the base GraphTokenLock functionality. It allows wallet beneficiaries to use the deposited funds to perform specific function calls on specific contracts. The idea is that supporters with locked tokens can participate in the protocol but disallow any release before the vesting/lock schedule. The beneficiary can issue authorized function calls to this contract that will get forwarded to a target contract. A target contract is any of our protocol contracts. The function calls allowed are queried to the GraphTokenLockManager, this way the same configuration can be shared for all the created lock wallet contracts. NOTE: Contracts used as target must have its function signatures checked to avoid collisions with any of this contract functions. Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience the maximum amount of tokens is authorized.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/GraphTokenLockWallet.sol\":\"GraphTokenLockWallet\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/math/SafeMath.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Wrappers over Solidity's arithmetic operations with added overflow\\n * checks.\\n *\\n * Arithmetic operations in Solidity wrap on overflow. This can easily result\\n * in bugs, because programmers usually assume that an overflow raises an\\n * error, which is the standard behavior in high level programming languages.\\n * `SafeMath` restores this intuition by reverting the transaction when an\\n * operation overflows.\\n *\\n * Using this library instead of the unchecked operations eliminates an entire\\n * class of bugs, so it's recommended to use it always.\\n */\\nlibrary SafeMath {\\n /**\\n * @dev Returns the addition of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n uint256 c = a + b;\\n if (c < a) return (false, 0);\\n return (true, c);\\n }\\n\\n /**\\n * @dev Returns the substraction of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b > a) return (false, 0);\\n return (true, a - b);\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\\n if (a == 0) return (true, 0);\\n uint256 c = a * b;\\n if (c / a != b) return (false, 0);\\n return (true, c);\\n }\\n\\n /**\\n * @dev Returns the division of two unsigned integers, with a division by zero flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b == 0) return (false, 0);\\n return (true, a / b);\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b == 0) return (false, 0);\\n return (true, a % b);\\n }\\n\\n /**\\n * @dev Returns the addition of two unsigned integers, reverting on\\n * overflow.\\n *\\n * Counterpart to Solidity's `+` operator.\\n *\\n * Requirements:\\n *\\n * - Addition cannot overflow.\\n */\\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\\n uint256 c = a + b;\\n require(c >= a, \\\"SafeMath: addition overflow\\\");\\n return c;\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting on\\n * overflow (when the result is negative).\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n *\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b <= a, \\\"SafeMath: subtraction overflow\\\");\\n return a - b;\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, reverting on\\n * overflow.\\n *\\n * Counterpart to Solidity's `*` operator.\\n *\\n * Requirements:\\n *\\n * - Multiplication cannot overflow.\\n */\\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\\n if (a == 0) return 0;\\n uint256 c = a * b;\\n require(c / a == b, \\\"SafeMath: multiplication overflow\\\");\\n return c;\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers, reverting on\\n * division by zero. The result is rounded towards zero.\\n *\\n * Counterpart to Solidity's `/` operator. Note: this function uses a\\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\\n * uses an invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b > 0, \\\"SafeMath: division by zero\\\");\\n return a / b;\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * reverting when dividing by zero.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b > 0, \\\"SafeMath: modulo by zero\\\");\\n return a % b;\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\\n * overflow (when the result is negative).\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {trySub}.\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n *\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b <= a, errorMessage);\\n return a - b;\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers, reverting with custom message on\\n * division by zero. The result is rounded towards zero.\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {tryDiv}.\\n *\\n * Counterpart to Solidity's `/` operator. Note: this function uses a\\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\\n * uses an invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b > 0, errorMessage);\\n return a / b;\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * reverting with custom message when dividing by zero.\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {tryMod}.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b > 0, errorMessage);\\n return a % b;\\n }\\n}\\n\",\"keccak256\":\"0xcc78a17dd88fa5a2edc60c8489e2f405c0913b377216a5b26b35656b2d0dab52\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `recipient`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address recipient, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `sender` to `recipient` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n}\\n\",\"keccak256\":\"0x5f02220344881ce43204ae4a6281145a67bc52c2bb1290a791857df3d19d78f5\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\nimport \\\"./IERC20.sol\\\";\\nimport \\\"../../math/SafeMath.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @title SafeERC20\\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\\n * contract returns false). Tokens that return no value (and instead revert or\\n * throw on failure) are also supported, non-reverting calls are assumed to be\\n * successful.\\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\n */\\nlibrary SafeERC20 {\\n using SafeMath for uint256;\\n using Address for address;\\n\\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\\n }\\n\\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\\n }\\n\\n /**\\n * @dev Deprecated. This function has issues similar to the ones found in\\n * {IERC20-approve}, and its usage is discouraged.\\n *\\n * Whenever possible, use {safeIncreaseAllowance} and\\n * {safeDecreaseAllowance} instead.\\n */\\n function safeApprove(IERC20 token, address spender, uint256 value) internal {\\n // safeApprove should only be called when setting an initial allowance,\\n // or when resetting it to zero. To increase and decrease it, use\\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\\n // solhint-disable-next-line max-line-length\\n require((value == 0) || (token.allowance(address(this), spender) == 0),\\n \\\"SafeERC20: approve from non-zero to non-zero allowance\\\"\\n );\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\\n }\\n\\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n uint256 newAllowance = token.allowance(address(this), spender).add(value);\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n uint256 newAllowance = token.allowance(address(this), spender).sub(value, \\\"SafeERC20: decreased allowance below zero\\\");\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n */\\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that\\n // the target address contains contract code and also asserts for success in the low-level call.\\n\\n bytes memory returndata = address(token).functionCall(data, \\\"SafeERC20: low-level call failed\\\");\\n if (returndata.length > 0) { // Return data is optional\\n // solhint-disable-next-line max-line-length\\n require(abi.decode(returndata, (bool)), \\\"SafeERC20: ERC20 operation did not succeed\\\");\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf12dfbe97e6276980b83d2830bb0eb75e0cf4f3e626c2471137f82158ae6a0fc\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.2 <0.8.0;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize, which returns 0 for contracts in\\n // construction, since the code is only stored at the end of the\\n // constructor execution.\\n\\n uint256 size;\\n // solhint-disable-next-line no-inline-assembly\\n assembly { size := extcodesize(account) }\\n return size > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls, avoid-call-value\\n (bool success, ) = recipient.call{ value: amount }(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain`call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.call{ value: value }(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x28911e614500ae7c607a432a709d35da25f3bc5ddc8bd12b278b66358070c0ea\",\"license\":\"MIT\"},\"contracts/GraphTokenLock.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nimport \\\"@openzeppelin/contracts/math/SafeMath.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\\\";\\n\\nimport \\\"./Ownable.sol\\\";\\nimport \\\"./MathUtils.sol\\\";\\nimport \\\"./IGraphTokenLock.sol\\\";\\n\\n/**\\n * @title GraphTokenLock\\n * @notice Contract that manages an unlocking schedule of tokens.\\n * @dev The contract lock manage a number of tokens deposited into the contract to ensure that\\n * they can only be released under certain time conditions.\\n *\\n * This contract implements a release scheduled based on periods and tokens are released in steps\\n * after each period ends. It can be configured with one period in which case it is like a plain TimeLock.\\n * It also supports revocation to be used for vesting schedules.\\n *\\n * The contract supports receiving extra funds than the managed tokens ones that can be\\n * withdrawn by the beneficiary at any time.\\n *\\n * A releaseStartTime parameter is included to override the default release schedule and\\n * perform the first release on the configured time. After that it will continue with the\\n * default schedule.\\n */\\nabstract contract GraphTokenLock is Ownable, IGraphTokenLock {\\n using SafeMath for uint256;\\n using SafeERC20 for IERC20;\\n\\n uint256 private constant MIN_PERIOD = 1;\\n\\n // -- State --\\n\\n IERC20 public token;\\n address public beneficiary;\\n\\n // Configuration\\n\\n // Amount of tokens managed by the contract schedule\\n uint256 public managedAmount;\\n\\n uint256 public startTime; // Start datetime (in unixtimestamp)\\n uint256 public endTime; // Datetime after all funds are fully vested/unlocked (in unixtimestamp)\\n uint256 public periods; // Number of vesting/release periods\\n\\n // First release date for tokens (in unixtimestamp)\\n // If set, no tokens will be released before releaseStartTime ignoring\\n // the amount to release each period\\n uint256 public releaseStartTime;\\n // A cliff set a date to which a beneficiary needs to get to vest\\n // all preceding periods\\n uint256 public vestingCliffTime;\\n Revocability public revocable; // Whether to use vesting for locked funds\\n\\n // State\\n\\n bool public isRevoked;\\n bool public isInitialized;\\n bool public isAccepted;\\n uint256 public releasedAmount;\\n uint256 public revokedAmount;\\n\\n // -- Events --\\n\\n event TokensReleased(address indexed beneficiary, uint256 amount);\\n event TokensWithdrawn(address indexed beneficiary, uint256 amount);\\n event TokensRevoked(address indexed beneficiary, uint256 amount);\\n event BeneficiaryChanged(address newBeneficiary);\\n event LockAccepted();\\n event LockCanceled();\\n\\n /**\\n * @dev Only allow calls from the beneficiary of the contract\\n */\\n modifier onlyBeneficiary() {\\n require(msg.sender == beneficiary, \\\"!auth\\\");\\n _;\\n }\\n\\n /**\\n * @notice Initializes the contract\\n * @param _owner Address of the contract owner\\n * @param _beneficiary Address of the beneficiary of locked tokens\\n * @param _managedAmount Amount of tokens to be managed by the lock contract\\n * @param _startTime Start time of the release schedule\\n * @param _endTime End time of the release schedule\\n * @param _periods Number of periods between start time and end time\\n * @param _releaseStartTime Override time for when the releases start\\n * @param _vestingCliffTime Override time for when the vesting start\\n * @param _revocable Whether the contract is revocable\\n */\\n function _initialize(\\n address _owner,\\n address _beneficiary,\\n address _token,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n Revocability _revocable\\n ) internal {\\n require(!isInitialized, \\\"Already initialized\\\");\\n require(_owner != address(0), \\\"Owner cannot be zero\\\");\\n require(_beneficiary != address(0), \\\"Beneficiary cannot be zero\\\");\\n require(_token != address(0), \\\"Token cannot be zero\\\");\\n require(_managedAmount > 0, \\\"Managed tokens cannot be zero\\\");\\n require(_startTime != 0, \\\"Start time must be set\\\");\\n require(_startTime < _endTime, \\\"Start time > end time\\\");\\n require(_periods >= MIN_PERIOD, \\\"Periods cannot be below minimum\\\");\\n require(_revocable != Revocability.NotSet, \\\"Must set a revocability option\\\");\\n require(_releaseStartTime < _endTime, \\\"Release start time must be before end time\\\");\\n require(_vestingCliffTime < _endTime, \\\"Cliff time must be before end time\\\");\\n\\n isInitialized = true;\\n\\n Ownable.initialize(_owner);\\n beneficiary = _beneficiary;\\n token = IERC20(_token);\\n\\n managedAmount = _managedAmount;\\n\\n startTime = _startTime;\\n endTime = _endTime;\\n periods = _periods;\\n\\n // Optionals\\n releaseStartTime = _releaseStartTime;\\n vestingCliffTime = _vestingCliffTime;\\n revocable = _revocable;\\n }\\n\\n /**\\n * @notice Change the beneficiary of funds managed by the contract\\n * @dev Can only be called by the beneficiary\\n * @param _newBeneficiary Address of the new beneficiary address\\n */\\n function changeBeneficiary(address _newBeneficiary) external onlyBeneficiary {\\n require(_newBeneficiary != address(0), \\\"Empty beneficiary\\\");\\n beneficiary = _newBeneficiary;\\n emit BeneficiaryChanged(_newBeneficiary);\\n }\\n\\n /**\\n * @notice Beneficiary accepts the lock, the owner cannot retrieve back the tokens\\n * @dev Can only be called by the beneficiary\\n */\\n function acceptLock() external onlyBeneficiary {\\n isAccepted = true;\\n emit LockAccepted();\\n }\\n\\n /**\\n * @notice Owner cancel the lock and return the balance in the contract\\n * @dev Can only be called by the owner\\n */\\n function cancelLock() external onlyOwner {\\n require(isAccepted == false, \\\"Cannot cancel accepted contract\\\");\\n\\n token.safeTransfer(owner(), currentBalance());\\n\\n emit LockCanceled();\\n }\\n\\n // -- Balances --\\n\\n /**\\n * @notice Returns the amount of tokens currently held by the contract\\n * @return Tokens held in the contract\\n */\\n function currentBalance() public view override returns (uint256) {\\n return token.balanceOf(address(this));\\n }\\n\\n // -- Time & Periods --\\n\\n /**\\n * @notice Returns the current block timestamp\\n * @return Current block timestamp\\n */\\n function currentTime() public view override returns (uint256) {\\n return block.timestamp;\\n }\\n\\n /**\\n * @notice Gets duration of contract from start to end in seconds\\n * @return Amount of seconds from contract startTime to endTime\\n */\\n function duration() public view override returns (uint256) {\\n return endTime.sub(startTime);\\n }\\n\\n /**\\n * @notice Gets time elapsed since the start of the contract\\n * @dev Returns zero if called before conctract starTime\\n * @return Seconds elapsed from contract startTime\\n */\\n function sinceStartTime() public view override returns (uint256) {\\n uint256 current = currentTime();\\n if (current <= startTime) {\\n return 0;\\n }\\n return current.sub(startTime);\\n }\\n\\n /**\\n * @notice Returns amount available to be released after each period according to schedule\\n * @return Amount of tokens available after each period\\n */\\n function amountPerPeriod() public view override returns (uint256) {\\n return managedAmount.div(periods);\\n }\\n\\n /**\\n * @notice Returns the duration of each period in seconds\\n * @return Duration of each period in seconds\\n */\\n function periodDuration() public view override returns (uint256) {\\n return duration().div(periods);\\n }\\n\\n /**\\n * @notice Gets the current period based on the schedule\\n * @return A number that represents the current period\\n */\\n function currentPeriod() public view override returns (uint256) {\\n return sinceStartTime().div(periodDuration()).add(MIN_PERIOD);\\n }\\n\\n /**\\n * @notice Gets the number of periods that passed since the first period\\n * @return A number of periods that passed since the schedule started\\n */\\n function passedPeriods() public view override returns (uint256) {\\n return currentPeriod().sub(MIN_PERIOD);\\n }\\n\\n // -- Locking & Release Schedule --\\n\\n /**\\n * @notice Gets the currently available token according to the schedule\\n * @dev Implements the step-by-step schedule based on periods for available tokens\\n * @return Amount of tokens available according to the schedule\\n */\\n function availableAmount() public view override returns (uint256) {\\n uint256 current = currentTime();\\n\\n // Before contract start no funds are available\\n if (current < startTime) {\\n return 0;\\n }\\n\\n // After contract ended all funds are available\\n if (current > endTime) {\\n return managedAmount;\\n }\\n\\n // Get available amount based on period\\n return passedPeriods().mul(amountPerPeriod());\\n }\\n\\n /**\\n * @notice Gets the amount of currently vested tokens\\n * @dev Similar to available amount, but is fully vested when contract is non-revocable\\n * @return Amount of tokens already vested\\n */\\n function vestedAmount() public view override returns (uint256) {\\n // If non-revocable it is fully vested\\n if (revocable == Revocability.Disabled) {\\n return managedAmount;\\n }\\n\\n // Vesting cliff is activated and it has not passed means nothing is vested yet\\n if (vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\\n return 0;\\n }\\n\\n return availableAmount();\\n }\\n\\n /**\\n * @notice Gets tokens currently available for release\\n * @dev Considers the schedule and takes into account already released tokens\\n * @return Amount of tokens ready to be released\\n */\\n function releasableAmount() public view virtual override returns (uint256) {\\n // If a release start time is set no tokens are available for release before this date\\n // If not set it follows the default schedule and tokens are available on\\n // the first period passed\\n if (releaseStartTime > 0 && currentTime() < releaseStartTime) {\\n return 0;\\n }\\n\\n // Vesting cliff is activated and it has not passed means nothing is vested yet\\n // so funds cannot be released\\n if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\\n return 0;\\n }\\n\\n // A beneficiary can never have more releasable tokens than the contract balance\\n uint256 releasable = availableAmount().sub(releasedAmount);\\n return MathUtils.min(currentBalance(), releasable);\\n }\\n\\n /**\\n * @notice Gets the outstanding amount yet to be released based on the whole contract lifetime\\n * @dev Does not consider schedule but just global amounts tracked\\n * @return Amount of outstanding tokens for the lifetime of the contract\\n */\\n function totalOutstandingAmount() public view override returns (uint256) {\\n return managedAmount.sub(releasedAmount).sub(revokedAmount);\\n }\\n\\n /**\\n * @notice Gets surplus amount in the contract based on outstanding amount to release\\n * @dev All funds over outstanding amount is considered surplus that can be withdrawn by beneficiary\\n * @return Amount of tokens considered as surplus\\n */\\n function surplusAmount() public view override returns (uint256) {\\n uint256 balance = currentBalance();\\n uint256 outstandingAmount = totalOutstandingAmount();\\n if (balance > outstandingAmount) {\\n return balance.sub(outstandingAmount);\\n }\\n return 0;\\n }\\n\\n // -- Value Transfer --\\n\\n /**\\n * @notice Releases tokens based on the configured schedule\\n * @dev All available releasable tokens are transferred to beneficiary\\n */\\n function release() external override onlyBeneficiary {\\n uint256 amountToRelease = releasableAmount();\\n require(amountToRelease > 0, \\\"No available releasable amount\\\");\\n\\n releasedAmount = releasedAmount.add(amountToRelease);\\n\\n token.safeTransfer(beneficiary, amountToRelease);\\n\\n emit TokensReleased(beneficiary, amountToRelease);\\n }\\n\\n /**\\n * @notice Withdraws surplus, unmanaged tokens from the contract\\n * @dev Tokens in the contract over outstanding amount are considered as surplus\\n * @param _amount Amount of tokens to withdraw\\n */\\n function withdrawSurplus(uint256 _amount) external override onlyBeneficiary {\\n require(_amount > 0, \\\"Amount cannot be zero\\\");\\n require(surplusAmount() >= _amount, \\\"Amount requested > surplus available\\\");\\n\\n token.safeTransfer(beneficiary, _amount);\\n\\n emit TokensWithdrawn(beneficiary, _amount);\\n }\\n\\n /**\\n * @notice Revokes a vesting schedule and return the unvested tokens to the owner\\n * @dev Vesting schedule is always calculated based on managed tokens\\n */\\n function revoke() external override onlyOwner {\\n require(revocable == Revocability.Enabled, \\\"Contract is non-revocable\\\");\\n require(isRevoked == false, \\\"Already revoked\\\");\\n\\n uint256 unvestedAmount = managedAmount.sub(vestedAmount());\\n require(unvestedAmount > 0, \\\"No available unvested amount\\\");\\n\\n revokedAmount = unvestedAmount;\\n isRevoked = true;\\n\\n token.safeTransfer(owner(), unvestedAmount);\\n\\n emit TokensRevoked(beneficiary, unvestedAmount);\\n }\\n}\\n\",\"keccak256\":\"0x21a1dae4105ba9ff6d9bc38bf983ee853976346562fa284f4b67a3c7ca91a2bf\",\"license\":\"MIT\"},\"contracts/GraphTokenLockWallet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"@openzeppelin/contracts/math/SafeMath.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\\\";\\n\\nimport \\\"./GraphTokenLock.sol\\\";\\nimport \\\"./IGraphTokenLockManager.sol\\\";\\n\\n/**\\n * @title GraphTokenLockWallet\\n * @notice This contract is built on top of the base GraphTokenLock functionality.\\n * It allows wallet beneficiaries to use the deposited funds to perform specific function calls\\n * on specific contracts.\\n *\\n * The idea is that supporters with locked tokens can participate in the protocol\\n * but disallow any release before the vesting/lock schedule.\\n * The beneficiary can issue authorized function calls to this contract that will\\n * get forwarded to a target contract. A target contract is any of our protocol contracts.\\n * The function calls allowed are queried to the GraphTokenLockManager, this way\\n * the same configuration can be shared for all the created lock wallet contracts.\\n *\\n * NOTE: Contracts used as target must have its function signatures checked to avoid collisions\\n * with any of this contract functions.\\n * Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience\\n * the maximum amount of tokens is authorized.\\n */\\ncontract GraphTokenLockWallet is GraphTokenLock {\\n using SafeMath for uint256;\\n using SafeERC20 for IERC20;\\n\\n // -- State --\\n\\n IGraphTokenLockManager public manager;\\n uint256 public usedAmount;\\n\\n uint256 private constant MAX_UINT256 = 2**256 - 1;\\n\\n // -- Events --\\n\\n event ManagerUpdated(address indexed _oldManager, address indexed _newManager);\\n event TokenDestinationsApproved();\\n event TokenDestinationsRevoked();\\n\\n // Initializer\\n function initialize(\\n address _manager,\\n address _owner,\\n address _beneficiary,\\n address _token,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n Revocability _revocable\\n ) external {\\n _initialize(\\n _owner,\\n _beneficiary,\\n _token,\\n _managedAmount,\\n _startTime,\\n _endTime,\\n _periods,\\n _releaseStartTime,\\n _vestingCliffTime,\\n _revocable\\n );\\n _setManager(_manager);\\n }\\n\\n // -- Admin --\\n\\n /**\\n * @notice Sets a new manager for this contract\\n * @param _newManager Address of the new manager\\n */\\n function setManager(address _newManager) external onlyOwner {\\n _setManager(_newManager);\\n }\\n\\n /**\\n * @dev Sets a new manager for this contract\\n * @param _newManager Address of the new manager\\n */\\n function _setManager(address _newManager) private {\\n require(_newManager != address(0), \\\"Manager cannot be empty\\\");\\n require(Address.isContract(_newManager), \\\"Manager must be a contract\\\");\\n\\n address oldManager = address(manager);\\n manager = IGraphTokenLockManager(_newManager);\\n\\n emit ManagerUpdated(oldManager, _newManager);\\n }\\n\\n // -- Beneficiary --\\n\\n /**\\n * @notice Approves protocol access of the tokens managed by this contract\\n * @dev Approves all token destinations registered in the manager to pull tokens\\n */\\n function approveProtocol() external onlyBeneficiary {\\n address[] memory dstList = manager.getTokenDestinations();\\n for (uint256 i = 0; i < dstList.length; i++) {\\n token.safeApprove(dstList[i], MAX_UINT256);\\n }\\n emit TokenDestinationsApproved();\\n }\\n\\n /**\\n * @notice Revokes protocol access of the tokens managed by this contract\\n * @dev Revokes approval to all token destinations in the manager to pull tokens\\n */\\n function revokeProtocol() external onlyBeneficiary {\\n address[] memory dstList = manager.getTokenDestinations();\\n for (uint256 i = 0; i < dstList.length; i++) {\\n token.safeApprove(dstList[i], 0);\\n }\\n emit TokenDestinationsRevoked();\\n }\\n\\n /**\\n * @notice Gets tokens currently available for release\\n * @dev Considers the schedule, takes into account already released tokens and used amount\\n * @return Amount of tokens ready to be released\\n */\\n function releasableAmount() public view override returns (uint256) {\\n if (revocable == Revocability.Disabled) {\\n return super.releasableAmount();\\n }\\n\\n // -- Revocability enabled logic\\n // This needs to deal with additional considerations for when tokens are used in the protocol\\n\\n // If a release start time is set no tokens are available for release before this date\\n // If not set it follows the default schedule and tokens are available on\\n // the first period passed\\n if (releaseStartTime > 0 && currentTime() < releaseStartTime) {\\n return 0;\\n }\\n\\n // Vesting cliff is activated and it has not passed means nothing is vested yet\\n // so funds cannot be released\\n if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\\n return 0;\\n }\\n\\n // A beneficiary can never have more releasable tokens than the contract balance\\n // We consider the `usedAmount` in the protocol as part of the calculations\\n // the beneficiary should not release funds that are used.\\n uint256 releasable = availableAmount().sub(releasedAmount).sub(usedAmount);\\n return MathUtils.min(currentBalance(), releasable);\\n }\\n\\n /**\\n * @notice Forward authorized contract calls to protocol contracts\\n * @dev Fallback function can be called by the beneficiary only if function call is allowed\\n */\\n fallback() external payable {\\n // Only beneficiary can forward calls\\n require(msg.sender == beneficiary, \\\"Unauthorized caller\\\");\\n\\n // Function call validation\\n address _target = manager.getAuthFunctionCallTarget(msg.sig);\\n require(_target != address(0), \\\"Unauthorized function\\\");\\n\\n uint256 oldBalance = currentBalance();\\n\\n // Call function with data\\n Address.functionCall(_target, msg.data);\\n\\n // Tracked used tokens in the protocol\\n // We do this check after balances were updated by the forwarded call\\n // Check is only enforced for revocable contracts to save some gas\\n if (revocable == Revocability.Enabled) {\\n // Track contract balance change\\n uint256 newBalance = currentBalance();\\n if (newBalance < oldBalance) {\\n // Outflow\\n uint256 diff = oldBalance.sub(newBalance);\\n usedAmount = usedAmount.add(diff);\\n } else {\\n // Inflow: We can receive profits from the protocol, that could make usedAmount to\\n // underflow. We set it to zero in that case.\\n uint256 diff = newBalance.sub(oldBalance);\\n usedAmount = (diff >= usedAmount) ? 0 : usedAmount.sub(diff);\\n }\\n require(usedAmount <= vestedAmount(), \\\"Cannot use more tokens than vested amount\\\");\\n }\\n }\\n}\\n\",\"keccak256\":\"0x5efc82d408fe81193664e67d614ca6299eafb00163ecc7819fad77cf0d35a2eb\",\"license\":\"MIT\"},\"contracts/IGraphTokenLock.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\ninterface IGraphTokenLock {\\n enum Revocability {\\n NotSet,\\n Enabled,\\n Disabled\\n }\\n\\n // -- Balances --\\n\\n function currentBalance() external view returns (uint256);\\n\\n // -- Time & Periods --\\n\\n function currentTime() external view returns (uint256);\\n\\n function duration() external view returns (uint256);\\n\\n function sinceStartTime() external view returns (uint256);\\n\\n function amountPerPeriod() external view returns (uint256);\\n\\n function periodDuration() external view returns (uint256);\\n\\n function currentPeriod() external view returns (uint256);\\n\\n function passedPeriods() external view returns (uint256);\\n\\n // -- Locking & Release Schedule --\\n\\n function availableAmount() external view returns (uint256);\\n\\n function vestedAmount() external view returns (uint256);\\n\\n function releasableAmount() external view returns (uint256);\\n\\n function totalOutstandingAmount() external view returns (uint256);\\n\\n function surplusAmount() external view returns (uint256);\\n\\n // -- Value Transfer --\\n\\n function release() external;\\n\\n function withdrawSurplus(uint256 _amount) external;\\n\\n function revoke() external;\\n}\\n\",\"keccak256\":\"0xceb9d258276fe25ec858191e1deae5778f1b2f612a669fb7b37bab1a064756ab\",\"license\":\"MIT\"},\"contracts/IGraphTokenLockManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nimport \\\"./IGraphTokenLock.sol\\\";\\n\\ninterface IGraphTokenLockManager {\\n // -- Factory --\\n\\n function setMasterCopy(address _masterCopy) external;\\n\\n function createTokenLockWallet(\\n address _owner,\\n address _beneficiary,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n IGraphTokenLock.Revocability _revocable\\n ) external;\\n\\n // -- Funds Management --\\n\\n function token() external returns (IERC20);\\n\\n function deposit(uint256 _amount) external;\\n\\n function withdraw(uint256 _amount) external;\\n\\n // -- Allowed Funds Destinations --\\n\\n function addTokenDestination(address _dst) external;\\n\\n function removeTokenDestination(address _dst) external;\\n\\n function isTokenDestination(address _dst) external view returns (bool);\\n\\n function getTokenDestinations() external view returns (address[] memory);\\n\\n // -- Function Call Authorization --\\n\\n function setAuthFunctionCall(string calldata _signature, address _target) external;\\n\\n function unsetAuthFunctionCall(string calldata _signature) external;\\n\\n function setAuthFunctionCallMany(string[] calldata _signatures, address[] calldata _targets) external;\\n\\n function getAuthFunctionCallTarget(bytes4 _sigHash) external view returns (address);\\n\\n function isAuthFunctionCall(bytes4 _sigHash) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x2d78d41909a6de5b316ac39b100ea087a8f317cf306379888a045523e15c4d9a\",\"license\":\"MIT\"},\"contracts/MathUtils.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nlibrary MathUtils {\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n}\\n\",\"keccak256\":\"0xe2512e1da48bc8363acd15f66229564b02d66706665d7da740604566913c1400\",\"license\":\"MIT\"},\"contracts/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * The owner account will be passed on initialization of the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\ncontract Ownable {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n function initialize(address owner) internal {\\n _owner = owner;\\n emit OwnershipTransferred(address(0), owner);\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(_owner == msg.sender, \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() external virtual onlyOwner {\\n emit OwnershipTransferred(_owner, address(0));\\n _owner = address(0);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) external virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n emit OwnershipTransferred(_owner, newOwner);\\n _owner = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0xc93c7362ac4d74b624b48517985f92c277ce90ae6e5ccb706e70a61af5752077\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b50613e61806100206000396000f3fe6080604052600436106102555760003560e01c806386d00e0211610139578063bc0163c1116100b6578063dc0706571161007a578063dc07065714610d0e578063e8dda6f514610d5f578063e97d87d514610d8a578063ebbab99214610db5578063f2fde38b14610de0578063fc0c546a14610e3157610256565b8063bc0163c114610b41578063bd896dcb14610b6c578063ce845d1d14610c67578063d0ebdbe714610c92578063d18e81b314610ce357610256565b806391f7cfb9116100fd57806391f7cfb914610a6e578063a4caeb4214610a99578063b0d1818c14610ac4578063b470aade14610aff578063b6549f7514610b2a57610256565b806386d00e021461099e57806386d1a69f146109c9578063872a7810146109e05780638a5bdf5c14610a165780638da5cb5b14610a2d57610256565b8063392e53cd116101d25780635051a5ec116101965780635051a5ec146108c25780635b940081146108ef57806360e799441461091a578063715018a61461093157806378e97925146109485780637bdf05af1461097357610256565b8063392e53cd146107d3578063398057a31461080057806344b1231f1461082b57806345d30a1714610856578063481c6a751461088157610256565b80632a627814116102195780632a627814146106f85780632bc9ed021461070f5780633197cbb61461073c57806337aeb0861461076757806338af3eed1461079257610256565b8063029c6c9f1461063557806306040618146106605780630b80f7771461068b5780630dff24d5146106a25780630fb5a6b4146106cd57610256565b5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610319576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f556e617574686f72697a65642063616c6c65720000000000000000000000000081525060200191505060405180910390fd5b6000600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f1d24c456000357fffffffff00000000000000000000000000000000000000000000000000000000166040518263ffffffff1660e01b815260040180827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200191505060206040518083038186803b1580156103d157600080fd5b505afa1580156103e5573d6000803e3d6000fd5b505050506040513d60208110156103fb57600080fd5b81019080805190602001909291905050509050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156104b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f556e617574686f72697a65642066756e6374696f6e000000000000000000000081525060200191505060405180910390fd5b60006104bb610e72565b905061050c826000368080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610f3d565b506001600281111561051a57fe5b600960009054906101000a900460ff16600281111561053557fe5b1415610631576000610545610e72565b9050818110156105875760006105648284610f8790919063ffffffff16565b905061057b81600d5461100a90919063ffffffff16565b600d81905550506105cd565b600061059c8383610f8790919063ffffffff16565b9050600d548110156105c2576105bd81600d54610f8790919063ffffffff16565b6105c5565b60005b600d81905550505b6105d5611092565b600d54111561062f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613d346029913960400191505060405180910390fd5b505b5050005b34801561064157600080fd5b5061064a611101565b6040518082815260200191505060405180910390f35b34801561066c57600080fd5b5061067561111f565b6040518082815260200191505060405180910390f35b34801561069757600080fd5b506106a061115a565b005b3480156106ae57600080fd5b506106b761132d565b6040518082815260200191505060405180910390f35b3480156106d957600080fd5b506106e2611374565b6040518082815260200191505060405180910390f35b34801561070457600080fd5b5061070d611392565b005b34801561071b57600080fd5b5061072461165f565b60405180821515815260200191505060405180910390f35b34801561074857600080fd5b50610751611672565b6040518082815260200191505060405180910390f35b34801561077357600080fd5b5061077c611678565b6040518082815260200191505060405180910390f35b34801561079e57600080fd5b506107a761167e565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156107df57600080fd5b506107e86116a4565b60405180821515815260200191505060405180910390f35b34801561080c57600080fd5b506108156116b7565b6040518082815260200191505060405180910390f35b34801561083757600080fd5b50610840611092565b6040518082815260200191505060405180910390f35b34801561086257600080fd5b5061086b6116bd565b6040518082815260200191505060405180910390f35b34801561088d57600080fd5b506108966116c3565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156108ce57600080fd5b506108d76116e9565b60405180821515815260200191505060405180910390f35b3480156108fb57600080fd5b506109046116fc565b6040518082815260200191505060405180910390f35b34801561092657600080fd5b5061092f611807565b005b34801561093d57600080fd5b50610946611ab5565b005b34801561095457600080fd5b5061095d611c34565b6040518082815260200191505060405180910390f35b34801561097f57600080fd5b50610988611c3a565b6040518082815260200191505060405180910390f35b3480156109aa57600080fd5b506109b3611c76565b6040518082815260200191505060405180910390f35b3480156109d557600080fd5b506109de611c7c565b005b3480156109ec57600080fd5b506109f5611ebe565b60405180826002811115610a0557fe5b815260200191505060405180910390f35b348015610a2257600080fd5b50610a2b611ed1565b005b348015610a3957600080fd5b50610a42611fdd565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610a7a57600080fd5b50610a83612006565b6040518082815260200191505060405180910390f35b348015610aa557600080fd5b50610aae612064565b6040518082815260200191505060405180910390f35b348015610ad057600080fd5b50610afd60048036036020811015610ae757600080fd5b810190808035906020019092919050505061206a565b005b348015610b0b57600080fd5b50610b146122e5565b6040518082815260200191505060405180910390f35b348015610b3657600080fd5b50610b3f612308565b005b348015610b4d57600080fd5b50610b5661266c565b6040518082815260200191505060405180910390f35b348015610b7857600080fd5b50610c656004803603610160811015610b9057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190803560ff16906020019092919050505061269e565b005b348015610c7357600080fd5b50610c7c610e72565b6040518082815260200191505060405180910390f35b348015610c9e57600080fd5b50610ce160048036036020811015610cb557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506126c6565b005b348015610cef57600080fd5b50610cf8612793565b6040518082815260200191505060405180910390f35b348015610d1a57600080fd5b50610d5d60048036036020811015610d3157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061279b565b005b348015610d6b57600080fd5b50610d74612992565b6040518082815260200191505060405180910390f35b348015610d9657600080fd5b50610d9f612998565b6040518082815260200191505060405180910390f35b348015610dc157600080fd5b50610dca61299e565b6040518082815260200191505060405180910390f35b348015610dec57600080fd5b50610e2f60048036036020811015610e0357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506129c0565b005b348015610e3d57600080fd5b50610e46612bc4565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610efd57600080fd5b505afa158015610f11573d6000803e3d6000fd5b505050506040513d6020811015610f2757600080fd5b8101908080519060200190929190505050905090565b6060610f7f83836040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c65640000815250612bea565b905092915050565b600082821115610fff576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525060200191505060405180910390fd5b818303905092915050565b600080828401905083811015611088576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b60006002808111156110a057fe5b600960009054906101000a900460ff1660028111156110bb57fe5b14156110cb5760035490506110fe565b60006008541180156110e557506008546110e3612793565b105b156110f357600090506110fe565b6110fb612006565b90505b90565b600061111a600654600354612c0290919063ffffffff16565b905090565b600061115560016111476111316122e5565b611139611c3a565b612c0290919063ffffffff16565b61100a90919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461121b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60001515600960039054906101000a900460ff161515146112a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f43616e6e6f742063616e63656c20616363657074656420636f6e74726163740081525060200191505060405180910390fd5b6112ff6112af611fdd565b6112b7610e72565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612c8b9092919063ffffffff16565b7f171f0bcbda3370351cea17f3b164bee87d77c2503b94abdf2720a814ebe7e9df60405160405180910390a1565b600080611338610e72565b9050600061134461266c565b90508082111561136a576113618183610f8790919063ffffffff16565b92505050611371565b6000925050505b90565b600061138d600454600554610f8790919063ffffffff16565b905090565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611455576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6060600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a34574666040518163ffffffff1660e01b815260040160006040518083038186803b1580156114bf57600080fd5b505afa1580156114d3573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525060208110156114fd57600080fd5b810190808051604051939291908464010000000082111561151d57600080fd5b8382019150602082018581111561153357600080fd5b825186602082028301116401000000008211171561155057600080fd5b8083526020830192505050908051906020019060200280838360005b8381101561158757808201518184015260208101905061156c565b50505050905001604052505050905060005b815181101561162f576116228282815181106115b157fe5b60200260200101517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612d2d9092919063ffffffff16565b8080600101915050611599565b507fb837fd51506ba3cc623a37c78ed22fd521f2f6e9f69a34d5c2a4a9474f27579360405160405180910390a150565b600960019054906101000a900460ff1681565b60055481565b600b5481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600960029054906101000a900460ff1681565b60035481565b600a5481565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600960039054906101000a900460ff1681565b600060028081111561170a57fe5b600960009054906101000a900460ff16600281111561172557fe5b141561173a57611733612ef2565b9050611804565b60006007541180156117545750600754611752612793565b105b156117625760009050611804565b6001600281111561176f57fe5b600960009054906101000a900460ff16600281111561178a57fe5b14801561179957506000600854115b80156117ad57506008546117ab612793565b105b156117bb5760009050611804565b60006117ed600d546117df600a546117d1612006565b610f8790919063ffffffff16565b610f8790919063ffffffff16565b90506118006117fa610e72565b82612fac565b9150505b90565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146118ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6060600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a34574666040518163ffffffff1660e01b815260040160006040518083038186803b15801561193457600080fd5b505afa158015611948573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250602081101561197257600080fd5b810190808051604051939291908464010000000082111561199257600080fd5b838201915060208201858111156119a857600080fd5b82518660208202830111640100000000821117156119c557600080fd5b8083526020830192505050908051906020019060200280838360005b838110156119fc5780820151818401526020810190506119e1565b50505050905001604052505050905060005b8151811015611a8557611a78828281518110611a2657fe5b60200260200101516000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612d2d9092919063ffffffff16565b8080600101915050611a0e565b507f6d317a20ba9d790014284bef285283cd61fde92e0f2711050f563a9d2cf4171160405160405180910390a150565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611b76576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60045481565b600080611c45612793565b90506004548111611c5a576000915050611c73565b611c6f60045482610f8790919063ffffffff16565b9150505b90565b60085481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611d3f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000611d496116fc565b905060008111611dc1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f4e6f20617661696c61626c652072656c65617361626c6520616d6f756e74000081525060200191505060405180910390fd5b611dd681600a5461100a90919063ffffffff16565b600a81905550611e4b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612c8b9092919063ffffffff16565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fc7798891864187665ac6dd119286e44ec13f014527aeeb2b8eb3fd413df93179826040518082815260200191505060405180910390a250565b600960009054906101000a900460ff1681565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611f94576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6001600960036101000a81548160ff0219169083151502179055507fbeb3313724453131feb0a765a03e6715bb720e0f973a31fcbafa2d2f048c188b60405160405180910390a1565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600080612011612793565b9050600454811015612027576000915050612061565b60055481111561203c57600354915050612061565b61205d612047611101565b61204f61299e565b612fc590919063ffffffff16565b9150505b90565b60065481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461212d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600081116121a3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f416d6f756e742063616e6e6f74206265207a65726f000000000000000000000081525060200191505060405180910390fd5b806121ac61132d565b1015612203576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613d7e6024913960400191505060405180910390fd5b612272600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612c8b9092919063ffffffff16565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b826040518082815260200191505060405180910390a250565b60006123036006546122f5611374565b612c0290919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146123c9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600160028111156123d657fe5b600960009054906101000a900460ff1660028111156123f157fe5b14612464576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f436f6e7472616374206973206e6f6e2d7265766f6361626c650000000000000081525060200191505060405180910390fd5b60001515600960019054906101000a900460ff161515146124ed576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f416c7265616479207265766f6b6564000000000000000000000000000000000081525060200191505060405180910390fd5b600061250b6124fa611092565b600354610f8790919063ffffffff16565b905060008111612583576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f4e6f20617661696c61626c6520756e76657374656420616d6f756e740000000081525060200191505060405180910390fd5b80600b819055506001600960016101000a81548160ff0219169083151502179055506125f96125b0611fdd565b82600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612c8b9092919063ffffffff16565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fb73c49a3a37a7aca291ba0ceaa41657012def406106a7fc386888f0f66e941cf826040518082815260200191505060405180910390a250565b6000612699600b5461268b600a54600354610f8790919063ffffffff16565b610f8790919063ffffffff16565b905090565b6126b08a8a8a8a8a8a8a8a8a8a61304b565b6126b98b6136cc565b5050505050505050505050565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612787576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b612790816136cc565b50565b600042905090565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461285e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612901576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f456d7074792062656e656669636961727900000000000000000000000000000081525060200191505060405180910390fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f373c72efabe4ef3e552ff77838be729f3bc3d8c586df0012902d1baa2377fa1d81604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b600d5481565b60075481565b60006129bb60016129ad61111f565b610f8790919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612a81576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612b07576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180613ce86026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6060612bf984846000856138b0565b90509392505050565b6000808211612c79576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525060200191505060405180910390fd5b818381612c8257fe5b04905092915050565b612d288363a9059cbb60e01b8484604051602401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050613a59565b505050565b6000811480612dfb575060008373ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e30856040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b158015612dbe57600080fd5b505afa158015612dd2573d6000803e3d6000fd5b505050506040513d6020811015612de857600080fd5b8101908080519060200190929190505050145b612e50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526036815260200180613df66036913960400191505060405180910390fd5b612eed8363095ea7b360e01b8484604051602401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050613a59565b505050565b600080600754118015612f0d5750600754612f0b612793565b105b15612f1b5760009050612fa9565b60016002811115612f2857fe5b600960009054906101000a900460ff166002811115612f4357fe5b148015612f5257506000600854115b8015612f665750600854612f64612793565b105b15612f745760009050612fa9565b6000612f92600a54612f84612006565b610f8790919063ffffffff16565b9050612fa5612f9f610e72565b82612fac565b9150505b90565b6000818310612fbb5781612fbd565b825b905092915050565b600080831415612fd85760009050613045565b6000828402905082848281612fe957fe5b0414613040576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613d5d6021913960400191505060405180910390fd5b809150505b92915050565b600960029054906101000a900460ff16156130ce576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f416c726561647920696e697469616c697a65640000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff161415613171576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f4f776e65722063616e6e6f74206265207a65726f00000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff161415613214576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f42656e65666963696172792063616e6e6f74206265207a65726f00000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff1614156132b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f546f6b656e2063616e6e6f74206265207a65726f00000000000000000000000081525060200191505060405180910390fd5b6000871161332d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f4d616e6167656420746f6b656e732063616e6e6f74206265207a65726f00000081525060200191505060405180910390fd5b60008614156133a4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53746172742074696d65206d757374206265207365740000000000000000000081525060200191505060405180910390fd5b848610613419576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f53746172742074696d65203e20656e642074696d65000000000000000000000081525060200191505060405180910390fd5b6001841015613490576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f506572696f64732063616e6e6f742062652062656c6f77206d696e696d756d0081525060200191505060405180910390fd5b6000600281111561349d57fe5b8160028111156134a957fe5b141561351d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f4d757374207365742061207265766f636162696c697479206f7074696f6e000081525060200191505060405180910390fd5b848310613575576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613da2602a913960400191505060405180910390fd5b8482106135cd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613cc66022913960400191505060405180910390fd5b6001600960026101000a81548160ff0219169083151502179055506135f18a613b48565b88600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555087600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555086600381905550856004819055508460058190555083600681905550826007819055508160088190555080600960006101000a81548160ff021916908360028111156136bb57fe5b021790555050505050505050505050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561376f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4d616e616765722063616e6e6f7420626520656d70747900000000000000000081525060200191505060405180910390fd5b61377881613be6565b6137ea576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f4d616e61676572206d757374206265206120636f6e747261637400000000000081525060200191505060405180910390fd5b6000600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fdac3632743b879638fd2d51c4d3c1dd796615b4758a55b50b0c19b971ba9fbc760405160405180910390a35050565b60608247101561390b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180613d0e6026913960400191505060405180910390fd5b61391485613be6565b613986576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000081525060200191505060405180910390fd5b600060608673ffffffffffffffffffffffffffffffffffffffff1685876040518082805190602001908083835b602083106139d657805182526020820191506020810190506020830392506139b3565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114613a38576040519150601f19603f3d011682016040523d82523d6000602084013e613a3d565b606091505b5091509150613a4d828286613bf9565b92505050949350505050565b6060613abb826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16612bea9092919063ffffffff16565b9050600081511115613b4357808060200190516020811015613adc57600080fd5b8101908080519060200190929190505050613b42576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613dcc602a913960400191505060405180910390fd5b5b505050565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a350565b600080823b905060008111915050919050565b60608315613c0957829050613cbe565b600083511115613c1c5782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015613c83578082015181840152602081019050613c68565b50505050905090810190601f168015613cb05780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b939250505056fe436c6966662074696d65206d757374206265206265666f726520656e642074696d654f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c43616e6e6f7420757365206d6f726520746f6b656e73207468616e2076657374656420616d6f756e74536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77416d6f756e7420726571756573746564203e20737572706c757320617661696c61626c6552656c656173652073746172742074696d65206d757374206265206265666f726520656e642074696d655361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565645361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f20746f206e6f6e2d7a65726f20616c6c6f77616e6365a26469706673582212203c6b20b5a223b9b9c9f0008dfba22c9fb703c6524c0f0a76a2b156733f6d573464736f6c63430007030033", + "deployedBytecode": "0x6080604052600436106102555760003560e01c806386d00e0211610139578063bc0163c1116100b6578063dc0706571161007a578063dc07065714610d0e578063e8dda6f514610d5f578063e97d87d514610d8a578063ebbab99214610db5578063f2fde38b14610de0578063fc0c546a14610e3157610256565b8063bc0163c114610b41578063bd896dcb14610b6c578063ce845d1d14610c67578063d0ebdbe714610c92578063d18e81b314610ce357610256565b806391f7cfb9116100fd57806391f7cfb914610a6e578063a4caeb4214610a99578063b0d1818c14610ac4578063b470aade14610aff578063b6549f7514610b2a57610256565b806386d00e021461099e57806386d1a69f146109c9578063872a7810146109e05780638a5bdf5c14610a165780638da5cb5b14610a2d57610256565b8063392e53cd116101d25780635051a5ec116101965780635051a5ec146108c25780635b940081146108ef57806360e799441461091a578063715018a61461093157806378e97925146109485780637bdf05af1461097357610256565b8063392e53cd146107d3578063398057a31461080057806344b1231f1461082b57806345d30a1714610856578063481c6a751461088157610256565b80632a627814116102195780632a627814146106f85780632bc9ed021461070f5780633197cbb61461073c57806337aeb0861461076757806338af3eed1461079257610256565b8063029c6c9f1461063557806306040618146106605780630b80f7771461068b5780630dff24d5146106a25780630fb5a6b4146106cd57610256565b5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610319576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f556e617574686f72697a65642063616c6c65720000000000000000000000000081525060200191505060405180910390fd5b6000600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f1d24c456000357fffffffff00000000000000000000000000000000000000000000000000000000166040518263ffffffff1660e01b815260040180827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200191505060206040518083038186803b1580156103d157600080fd5b505afa1580156103e5573d6000803e3d6000fd5b505050506040513d60208110156103fb57600080fd5b81019080805190602001909291905050509050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156104b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f556e617574686f72697a65642066756e6374696f6e000000000000000000000081525060200191505060405180910390fd5b60006104bb610e72565b905061050c826000368080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610f3d565b506001600281111561051a57fe5b600960009054906101000a900460ff16600281111561053557fe5b1415610631576000610545610e72565b9050818110156105875760006105648284610f8790919063ffffffff16565b905061057b81600d5461100a90919063ffffffff16565b600d81905550506105cd565b600061059c8383610f8790919063ffffffff16565b9050600d548110156105c2576105bd81600d54610f8790919063ffffffff16565b6105c5565b60005b600d81905550505b6105d5611092565b600d54111561062f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613d346029913960400191505060405180910390fd5b505b5050005b34801561064157600080fd5b5061064a611101565b6040518082815260200191505060405180910390f35b34801561066c57600080fd5b5061067561111f565b6040518082815260200191505060405180910390f35b34801561069757600080fd5b506106a061115a565b005b3480156106ae57600080fd5b506106b761132d565b6040518082815260200191505060405180910390f35b3480156106d957600080fd5b506106e2611374565b6040518082815260200191505060405180910390f35b34801561070457600080fd5b5061070d611392565b005b34801561071b57600080fd5b5061072461165f565b60405180821515815260200191505060405180910390f35b34801561074857600080fd5b50610751611672565b6040518082815260200191505060405180910390f35b34801561077357600080fd5b5061077c611678565b6040518082815260200191505060405180910390f35b34801561079e57600080fd5b506107a761167e565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156107df57600080fd5b506107e86116a4565b60405180821515815260200191505060405180910390f35b34801561080c57600080fd5b506108156116b7565b6040518082815260200191505060405180910390f35b34801561083757600080fd5b50610840611092565b6040518082815260200191505060405180910390f35b34801561086257600080fd5b5061086b6116bd565b6040518082815260200191505060405180910390f35b34801561088d57600080fd5b506108966116c3565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156108ce57600080fd5b506108d76116e9565b60405180821515815260200191505060405180910390f35b3480156108fb57600080fd5b506109046116fc565b6040518082815260200191505060405180910390f35b34801561092657600080fd5b5061092f611807565b005b34801561093d57600080fd5b50610946611ab5565b005b34801561095457600080fd5b5061095d611c34565b6040518082815260200191505060405180910390f35b34801561097f57600080fd5b50610988611c3a565b6040518082815260200191505060405180910390f35b3480156109aa57600080fd5b506109b3611c76565b6040518082815260200191505060405180910390f35b3480156109d557600080fd5b506109de611c7c565b005b3480156109ec57600080fd5b506109f5611ebe565b60405180826002811115610a0557fe5b815260200191505060405180910390f35b348015610a2257600080fd5b50610a2b611ed1565b005b348015610a3957600080fd5b50610a42611fdd565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610a7a57600080fd5b50610a83612006565b6040518082815260200191505060405180910390f35b348015610aa557600080fd5b50610aae612064565b6040518082815260200191505060405180910390f35b348015610ad057600080fd5b50610afd60048036036020811015610ae757600080fd5b810190808035906020019092919050505061206a565b005b348015610b0b57600080fd5b50610b146122e5565b6040518082815260200191505060405180910390f35b348015610b3657600080fd5b50610b3f612308565b005b348015610b4d57600080fd5b50610b5661266c565b6040518082815260200191505060405180910390f35b348015610b7857600080fd5b50610c656004803603610160811015610b9057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190803560ff16906020019092919050505061269e565b005b348015610c7357600080fd5b50610c7c610e72565b6040518082815260200191505060405180910390f35b348015610c9e57600080fd5b50610ce160048036036020811015610cb557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506126c6565b005b348015610cef57600080fd5b50610cf8612793565b6040518082815260200191505060405180910390f35b348015610d1a57600080fd5b50610d5d60048036036020811015610d3157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061279b565b005b348015610d6b57600080fd5b50610d74612992565b6040518082815260200191505060405180910390f35b348015610d9657600080fd5b50610d9f612998565b6040518082815260200191505060405180910390f35b348015610dc157600080fd5b50610dca61299e565b6040518082815260200191505060405180910390f35b348015610dec57600080fd5b50610e2f60048036036020811015610e0357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506129c0565b005b348015610e3d57600080fd5b50610e46612bc4565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610efd57600080fd5b505afa158015610f11573d6000803e3d6000fd5b505050506040513d6020811015610f2757600080fd5b8101908080519060200190929190505050905090565b6060610f7f83836040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c65640000815250612bea565b905092915050565b600082821115610fff576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525060200191505060405180910390fd5b818303905092915050565b600080828401905083811015611088576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b60006002808111156110a057fe5b600960009054906101000a900460ff1660028111156110bb57fe5b14156110cb5760035490506110fe565b60006008541180156110e557506008546110e3612793565b105b156110f357600090506110fe565b6110fb612006565b90505b90565b600061111a600654600354612c0290919063ffffffff16565b905090565b600061115560016111476111316122e5565b611139611c3a565b612c0290919063ffffffff16565b61100a90919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461121b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60001515600960039054906101000a900460ff161515146112a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f43616e6e6f742063616e63656c20616363657074656420636f6e74726163740081525060200191505060405180910390fd5b6112ff6112af611fdd565b6112b7610e72565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612c8b9092919063ffffffff16565b7f171f0bcbda3370351cea17f3b164bee87d77c2503b94abdf2720a814ebe7e9df60405160405180910390a1565b600080611338610e72565b9050600061134461266c565b90508082111561136a576113618183610f8790919063ffffffff16565b92505050611371565b6000925050505b90565b600061138d600454600554610f8790919063ffffffff16565b905090565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611455576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6060600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a34574666040518163ffffffff1660e01b815260040160006040518083038186803b1580156114bf57600080fd5b505afa1580156114d3573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525060208110156114fd57600080fd5b810190808051604051939291908464010000000082111561151d57600080fd5b8382019150602082018581111561153357600080fd5b825186602082028301116401000000008211171561155057600080fd5b8083526020830192505050908051906020019060200280838360005b8381101561158757808201518184015260208101905061156c565b50505050905001604052505050905060005b815181101561162f576116228282815181106115b157fe5b60200260200101517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612d2d9092919063ffffffff16565b8080600101915050611599565b507fb837fd51506ba3cc623a37c78ed22fd521f2f6e9f69a34d5c2a4a9474f27579360405160405180910390a150565b600960019054906101000a900460ff1681565b60055481565b600b5481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600960029054906101000a900460ff1681565b60035481565b600a5481565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600960039054906101000a900460ff1681565b600060028081111561170a57fe5b600960009054906101000a900460ff16600281111561172557fe5b141561173a57611733612ef2565b9050611804565b60006007541180156117545750600754611752612793565b105b156117625760009050611804565b6001600281111561176f57fe5b600960009054906101000a900460ff16600281111561178a57fe5b14801561179957506000600854115b80156117ad57506008546117ab612793565b105b156117bb5760009050611804565b60006117ed600d546117df600a546117d1612006565b610f8790919063ffffffff16565b610f8790919063ffffffff16565b90506118006117fa610e72565b82612fac565b9150505b90565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146118ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6060600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a34574666040518163ffffffff1660e01b815260040160006040518083038186803b15801561193457600080fd5b505afa158015611948573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250602081101561197257600080fd5b810190808051604051939291908464010000000082111561199257600080fd5b838201915060208201858111156119a857600080fd5b82518660208202830111640100000000821117156119c557600080fd5b8083526020830192505050908051906020019060200280838360005b838110156119fc5780820151818401526020810190506119e1565b50505050905001604052505050905060005b8151811015611a8557611a78828281518110611a2657fe5b60200260200101516000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612d2d9092919063ffffffff16565b8080600101915050611a0e565b507f6d317a20ba9d790014284bef285283cd61fde92e0f2711050f563a9d2cf4171160405160405180910390a150565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611b76576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60045481565b600080611c45612793565b90506004548111611c5a576000915050611c73565b611c6f60045482610f8790919063ffffffff16565b9150505b90565b60085481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611d3f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000611d496116fc565b905060008111611dc1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f4e6f20617661696c61626c652072656c65617361626c6520616d6f756e74000081525060200191505060405180910390fd5b611dd681600a5461100a90919063ffffffff16565b600a81905550611e4b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612c8b9092919063ffffffff16565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fc7798891864187665ac6dd119286e44ec13f014527aeeb2b8eb3fd413df93179826040518082815260200191505060405180910390a250565b600960009054906101000a900460ff1681565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611f94576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6001600960036101000a81548160ff0219169083151502179055507fbeb3313724453131feb0a765a03e6715bb720e0f973a31fcbafa2d2f048c188b60405160405180910390a1565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600080612011612793565b9050600454811015612027576000915050612061565b60055481111561203c57600354915050612061565b61205d612047611101565b61204f61299e565b612fc590919063ffffffff16565b9150505b90565b60065481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461212d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600081116121a3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f416d6f756e742063616e6e6f74206265207a65726f000000000000000000000081525060200191505060405180910390fd5b806121ac61132d565b1015612203576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613d7e6024913960400191505060405180910390fd5b612272600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612c8b9092919063ffffffff16565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b826040518082815260200191505060405180910390a250565b60006123036006546122f5611374565b612c0290919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146123c9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600160028111156123d657fe5b600960009054906101000a900460ff1660028111156123f157fe5b14612464576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f436f6e7472616374206973206e6f6e2d7265766f6361626c650000000000000081525060200191505060405180910390fd5b60001515600960019054906101000a900460ff161515146124ed576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f416c7265616479207265766f6b6564000000000000000000000000000000000081525060200191505060405180910390fd5b600061250b6124fa611092565b600354610f8790919063ffffffff16565b905060008111612583576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f4e6f20617661696c61626c6520756e76657374656420616d6f756e740000000081525060200191505060405180910390fd5b80600b819055506001600960016101000a81548160ff0219169083151502179055506125f96125b0611fdd565b82600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612c8b9092919063ffffffff16565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fb73c49a3a37a7aca291ba0ceaa41657012def406106a7fc386888f0f66e941cf826040518082815260200191505060405180910390a250565b6000612699600b5461268b600a54600354610f8790919063ffffffff16565b610f8790919063ffffffff16565b905090565b6126b08a8a8a8a8a8a8a8a8a8a61304b565b6126b98b6136cc565b5050505050505050505050565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612787576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b612790816136cc565b50565b600042905090565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461285e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612901576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f456d7074792062656e656669636961727900000000000000000000000000000081525060200191505060405180910390fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f373c72efabe4ef3e552ff77838be729f3bc3d8c586df0012902d1baa2377fa1d81604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b600d5481565b60075481565b60006129bb60016129ad61111f565b610f8790919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612a81576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612b07576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180613ce86026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6060612bf984846000856138b0565b90509392505050565b6000808211612c79576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525060200191505060405180910390fd5b818381612c8257fe5b04905092915050565b612d288363a9059cbb60e01b8484604051602401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050613a59565b505050565b6000811480612dfb575060008373ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e30856040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b158015612dbe57600080fd5b505afa158015612dd2573d6000803e3d6000fd5b505050506040513d6020811015612de857600080fd5b8101908080519060200190929190505050145b612e50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526036815260200180613df66036913960400191505060405180910390fd5b612eed8363095ea7b360e01b8484604051602401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050613a59565b505050565b600080600754118015612f0d5750600754612f0b612793565b105b15612f1b5760009050612fa9565b60016002811115612f2857fe5b600960009054906101000a900460ff166002811115612f4357fe5b148015612f5257506000600854115b8015612f665750600854612f64612793565b105b15612f745760009050612fa9565b6000612f92600a54612f84612006565b610f8790919063ffffffff16565b9050612fa5612f9f610e72565b82612fac565b9150505b90565b6000818310612fbb5781612fbd565b825b905092915050565b600080831415612fd85760009050613045565b6000828402905082848281612fe957fe5b0414613040576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613d5d6021913960400191505060405180910390fd5b809150505b92915050565b600960029054906101000a900460ff16156130ce576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f416c726561647920696e697469616c697a65640000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff161415613171576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f4f776e65722063616e6e6f74206265207a65726f00000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff161415613214576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f42656e65666963696172792063616e6e6f74206265207a65726f00000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff1614156132b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f546f6b656e2063616e6e6f74206265207a65726f00000000000000000000000081525060200191505060405180910390fd5b6000871161332d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f4d616e6167656420746f6b656e732063616e6e6f74206265207a65726f00000081525060200191505060405180910390fd5b60008614156133a4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53746172742074696d65206d757374206265207365740000000000000000000081525060200191505060405180910390fd5b848610613419576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f53746172742074696d65203e20656e642074696d65000000000000000000000081525060200191505060405180910390fd5b6001841015613490576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f506572696f64732063616e6e6f742062652062656c6f77206d696e696d756d0081525060200191505060405180910390fd5b6000600281111561349d57fe5b8160028111156134a957fe5b141561351d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f4d757374207365742061207265766f636162696c697479206f7074696f6e000081525060200191505060405180910390fd5b848310613575576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613da2602a913960400191505060405180910390fd5b8482106135cd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613cc66022913960400191505060405180910390fd5b6001600960026101000a81548160ff0219169083151502179055506135f18a613b48565b88600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555087600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555086600381905550856004819055508460058190555083600681905550826007819055508160088190555080600960006101000a81548160ff021916908360028111156136bb57fe5b021790555050505050505050505050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561376f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4d616e616765722063616e6e6f7420626520656d70747900000000000000000081525060200191505060405180910390fd5b61377881613be6565b6137ea576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f4d616e61676572206d757374206265206120636f6e747261637400000000000081525060200191505060405180910390fd5b6000600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fdac3632743b879638fd2d51c4d3c1dd796615b4758a55b50b0c19b971ba9fbc760405160405180910390a35050565b60608247101561390b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180613d0e6026913960400191505060405180910390fd5b61391485613be6565b613986576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000081525060200191505060405180910390fd5b600060608673ffffffffffffffffffffffffffffffffffffffff1685876040518082805190602001908083835b602083106139d657805182526020820191506020810190506020830392506139b3565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114613a38576040519150601f19603f3d011682016040523d82523d6000602084013e613a3d565b606091505b5091509150613a4d828286613bf9565b92505050949350505050565b6060613abb826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16612bea9092919063ffffffff16565b9050600081511115613b4357808060200190516020811015613adc57600080fd5b8101908080519060200190929190505050613b42576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613dcc602a913960400191505060405180910390fd5b5b505050565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a350565b600080823b905060008111915050919050565b60608315613c0957829050613cbe565b600083511115613c1c5782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015613c83578082015181840152602081019050613c68565b50505050905090810190601f168015613cb05780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b939250505056fe436c6966662074696d65206d757374206265206265666f726520656e642074696d654f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c43616e6e6f7420757365206d6f726520746f6b656e73207468616e2076657374656420616d6f756e74536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77416d6f756e7420726571756573746564203e20737572706c757320617661696c61626c6552656c656173652073746172742074696d65206d757374206265206265666f726520656e642074696d655361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565645361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f20746f206e6f6e2d7a65726f20616c6c6f77616e6365a26469706673582212203c6b20b5a223b9b9c9f0008dfba22c9fb703c6524c0f0a76a2b156733f6d573464736f6c63430007030033", + "devdoc": { + "kind": "dev", + "methods": { + "acceptLock()": { + "details": "Can only be called by the beneficiary" + }, + "amountPerPeriod()": { + "returns": { + "_0": "Amount of tokens available after each period" + } + }, + "approveProtocol()": { + "details": "Approves all token destinations registered in the manager to pull tokens" + }, + "availableAmount()": { + "details": "Implements the step-by-step schedule based on periods for available tokens", + "returns": { + "_0": "Amount of tokens available according to the schedule" + } + }, + "cancelLock()": { + "details": "Can only be called by the owner" + }, + "changeBeneficiary(address)": { + "details": "Can only be called by the beneficiary", + "params": { + "_newBeneficiary": "Address of the new beneficiary address" + } + }, + "currentBalance()": { + "returns": { + "_0": "Tokens held in the contract" + } + }, + "currentPeriod()": { + "returns": { + "_0": "A number that represents the current period" + } + }, + "currentTime()": { + "returns": { + "_0": "Current block timestamp" + } + }, + "duration()": { + "returns": { + "_0": "Amount of seconds from contract startTime to endTime" + } + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "passedPeriods()": { + "returns": { + "_0": "A number of periods that passed since the schedule started" + } + }, + "periodDuration()": { + "returns": { + "_0": "Duration of each period in seconds" + } + }, + "releasableAmount()": { + "details": "Considers the schedule, takes into account already released tokens and used amount", + "returns": { + "_0": "Amount of tokens ready to be released" + } + }, + "release()": { + "details": "All available releasable tokens are transferred to beneficiary" + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." + }, + "revoke()": { + "details": "Vesting schedule is always calculated based on managed tokens" + }, + "revokeProtocol()": { + "details": "Revokes approval to all token destinations in the manager to pull tokens" + }, + "setManager(address)": { + "params": { + "_newManager": "Address of the new manager" + } + }, + "sinceStartTime()": { + "details": "Returns zero if called before conctract starTime", + "returns": { + "_0": "Seconds elapsed from contract startTime" + } + }, + "surplusAmount()": { + "details": "All funds over outstanding amount is considered surplus that can be withdrawn by beneficiary", + "returns": { + "_0": "Amount of tokens considered as surplus" + } + }, + "totalOutstandingAmount()": { + "details": "Does not consider schedule but just global amounts tracked", + "returns": { + "_0": "Amount of outstanding tokens for the lifetime of the contract" + } + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + }, + "vestedAmount()": { + "details": "Similar to available amount, but is fully vested when contract is non-revocable", + "returns": { + "_0": "Amount of tokens already vested" + } + }, + "withdrawSurplus(uint256)": { + "details": "Tokens in the contract over outstanding amount are considered as surplus", + "params": { + "_amount": "Amount of tokens to withdraw" + } + } + }, + "title": "GraphTokenLockWallet", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "acceptLock()": { + "notice": "Beneficiary accepts the lock, the owner cannot retrieve back the tokens" + }, + "amountPerPeriod()": { + "notice": "Returns amount available to be released after each period according to schedule" + }, + "approveProtocol()": { + "notice": "Approves protocol access of the tokens managed by this contract" + }, + "availableAmount()": { + "notice": "Gets the currently available token according to the schedule" + }, + "cancelLock()": { + "notice": "Owner cancel the lock and return the balance in the contract" + }, + "changeBeneficiary(address)": { + "notice": "Change the beneficiary of funds managed by the contract" + }, + "currentBalance()": { + "notice": "Returns the amount of tokens currently held by the contract" + }, + "currentPeriod()": { + "notice": "Gets the current period based on the schedule" + }, + "currentTime()": { + "notice": "Returns the current block timestamp" + }, + "duration()": { + "notice": "Gets duration of contract from start to end in seconds" + }, + "passedPeriods()": { + "notice": "Gets the number of periods that passed since the first period" + }, + "periodDuration()": { + "notice": "Returns the duration of each period in seconds" + }, + "releasableAmount()": { + "notice": "Gets tokens currently available for release" + }, + "release()": { + "notice": "Releases tokens based on the configured schedule" + }, + "revoke()": { + "notice": "Revokes a vesting schedule and return the unvested tokens to the owner" + }, + "revokeProtocol()": { + "notice": "Revokes protocol access of the tokens managed by this contract" + }, + "setManager(address)": { + "notice": "Sets a new manager for this contract" + }, + "sinceStartTime()": { + "notice": "Gets time elapsed since the start of the contract" + }, + "surplusAmount()": { + "notice": "Gets surplus amount in the contract based on outstanding amount to release" + }, + "totalOutstandingAmount()": { + "notice": "Gets the outstanding amount yet to be released based on the whole contract lifetime" + }, + "vestedAmount()": { + "notice": "Gets the amount of currently vested tokens" + }, + "withdrawSurplus(uint256)": { + "notice": "Withdraws surplus, unmanaged tokens from the contract" + } + }, + "notice": "This contract is built on top of the base GraphTokenLock functionality. It allows wallet beneficiaries to use the deposited funds to perform specific function calls on specific contracts. The idea is that supporters with locked tokens can participate in the protocol but disallow any release before the vesting/lock schedule. The beneficiary can issue authorized function calls to this contract that will get forwarded to a target contract. A target contract is any of our protocol contracts. The function calls allowed are queried to the GraphTokenLockManager, this way the same configuration can be shared for all the created lock wallet contracts. NOTE: Contracts used as target must have its function signatures checked to avoid collisions with any of this contract functions. Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience the maximum amount of tokens is authorized.", + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 4749, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "_owner", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 2578, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "token", + "offset": 0, + "slot": "1", + "type": "t_contract(IERC20)1045" + }, + { + "astId": 2580, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "beneficiary", + "offset": 0, + "slot": "2", + "type": "t_address" + }, + { + "astId": 2582, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "managedAmount", + "offset": 0, + "slot": "3", + "type": "t_uint256" + }, + { + "astId": 2584, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "startTime", + "offset": 0, + "slot": "4", + "type": "t_uint256" + }, + { + "astId": 2586, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "endTime", + "offset": 0, + "slot": "5", + "type": "t_uint256" + }, + { + "astId": 2588, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "periods", + "offset": 0, + "slot": "6", + "type": "t_uint256" + }, + { + "astId": 2590, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "releaseStartTime", + "offset": 0, + "slot": "7", + "type": "t_uint256" + }, + { + "astId": 2592, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "vestingCliffTime", + "offset": 0, + "slot": "8", + "type": "t_uint256" + }, + { + "astId": 2594, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "revocable", + "offset": 0, + "slot": "9", + "type": "t_enum(Revocability)4426" + }, + { + "astId": 2596, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "isRevoked", + "offset": 1, + "slot": "9", + "type": "t_bool" + }, + { + "astId": 2598, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "isInitialized", + "offset": 2, + "slot": "9", + "type": "t_bool" + }, + { + "astId": 2600, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "isAccepted", + "offset": 3, + "slot": "9", + "type": "t_bool" + }, + { + "astId": 2602, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "releasedAmount", + "offset": 0, + "slot": "10", + "type": "t_uint256" + }, + { + "astId": 2604, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "revokedAmount", + "offset": 0, + "slot": "11", + "type": "t_uint256" + }, + { + "astId": 4021, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "manager", + "offset": 0, + "slot": "12", + "type": "t_contract(IGraphTokenLockManager)4608" + }, + { + "astId": 4023, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "usedAmount", + "offset": 0, + "slot": "13", + "type": "t_uint256" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_contract(IERC20)1045": { + "encoding": "inplace", + "label": "contract IERC20", + "numberOfBytes": "20" + }, + "t_contract(IGraphTokenLockManager)4608": { + "encoding": "inplace", + "label": "contract IGraphTokenLockManager", + "numberOfBytes": "20" + }, + "t_enum(Revocability)4426": { + "encoding": "inplace", + "label": "enum IGraphTokenLock.Revocability", + "numberOfBytes": "1" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} \ No newline at end of file diff --git a/packages/token-distribution/deployments/mainnet/GraphTokenLockWallet-MIPs.json b/packages/token-distribution/deployments/mainnet/GraphTokenLockWallet-MIPs.json new file mode 100644 index 000000000..6fbe025a9 --- /dev/null +++ b/packages/token-distribution/deployments/mainnet/GraphTokenLockWallet-MIPs.json @@ -0,0 +1,1101 @@ +{ + "address": "0x1231A8579CA4208F8AE6fecC6c96bf935B73487D", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "newBeneficiary", + "type": "address" + } + ], + "name": "BeneficiaryChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "LockAccepted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "LockCanceled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_oldManager", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "_newManager", + "type": "address" + } + ], + "name": "ManagerUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "TokenDestinationsApproved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "TokenDestinationsRevoked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensReleased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensRevoked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensWithdrawn", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "acceptLock", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "amountPerPeriod", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "approveProtocol", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "availableAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "beneficiary", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "cancelLock", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newBeneficiary", + "type": "address" + } + ], + "name": "changeBeneficiary", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "currentBalance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "currentPeriod", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "currentTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "duration", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "endTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_manager", + "type": "address" + }, + { + "internalType": "address", + "name": "_owner", + "type": "address" + }, + { + "internalType": "address", + "name": "_beneficiary", + "type": "address" + }, + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_managedAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_startTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_endTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_periods", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_releaseStartTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_vestingCliffTime", + "type": "uint256" + }, + { + "internalType": "enum IGraphTokenLock.Revocability", + "name": "_revocable", + "type": "uint8" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "isAccepted", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isInitialized", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isRevoked", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "managedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "manager", + "outputs": [ + { + "internalType": "contract IGraphTokenLockManager", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "passedPeriods", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "periodDuration", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "periods", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "releasableAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "release", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "releaseStartTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "releasedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "revocable", + "outputs": [ + { + "internalType": "enum IGraphTokenLock.Revocability", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "revoke", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "revokeProtocol", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "revokedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newManager", + "type": "address" + } + ], + "name": "setManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "sinceStartTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "startTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "surplusAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "token", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalOutstandingAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "usedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "vestedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "vestingCliffTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "withdrawSurplus", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0xf052d2bb33feac3417a266260dbb3daf166f553e35d8d9e325e8c7b9eda1de2e", + "receipt": { + "to": null, + "from": "0x8e623680d81372926a5878f544ceFE30B35BD9a0", + "contractAddress": "0x1231A8579CA4208F8AE6fecC6c96bf935B73487D", + "transactionIndex": 91, + "gasUsed": "3942206", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x21aa0703c20edf99b2a36778730d21e457d3282a6686211883105c10fed02757", + "transactionHash": "0xf052d2bb33feac3417a266260dbb3daf166f553e35d8d9e325e8c7b9eda1de2e", + "logs": [], + "blockNumber": 17743220, + "cumulativeGasUsed": "12662113", + "status": 1, + "byzantium": true + }, + "args": [], + "solcInputHash": "b5cdad58099d39cd1aed000b2fd864d8", + "metadata": "{\"compiler\":{\"version\":\"0.7.3+commit.9bfce1f6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newBeneficiary\",\"type\":\"address\"}],\"name\":\"BeneficiaryChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"LockAccepted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"LockCanceled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_oldManager\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_newManager\",\"type\":\"address\"}],\"name\":\"ManagerUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"TokenDestinationsApproved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"TokenDestinationsRevoked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensReleased\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensRevoked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensWithdrawn\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"acceptLock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"amountPerPeriod\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"approveProtocol\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"availableAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"beneficiary\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"cancelLock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_newBeneficiary\",\"type\":\"address\"}],\"name\":\"changeBeneficiary\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"currentBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"currentPeriod\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"currentTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"duration\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"endTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_manager\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_beneficiary\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_managedAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_startTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_endTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_periods\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_releaseStartTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_vestingCliffTime\",\"type\":\"uint256\"},{\"internalType\":\"enum IGraphTokenLock.Revocability\",\"name\":\"_revocable\",\"type\":\"uint8\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isAccepted\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isInitialized\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isRevoked\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"managedAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"manager\",\"outputs\":[{\"internalType\":\"contract IGraphTokenLockManager\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"passedPeriods\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"periodDuration\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"periods\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"releasableAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"release\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"releaseStartTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"releasedAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"revocable\",\"outputs\":[{\"internalType\":\"enum IGraphTokenLock.Revocability\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"revoke\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"revokeProtocol\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"revokedAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_newManager\",\"type\":\"address\"}],\"name\":\"setManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"sinceStartTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"startTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"surplusAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalOutstandingAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"usedAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"vestedAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"vestingCliffTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdrawSurplus\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"acceptLock()\":{\"details\":\"Can only be called by the beneficiary\"},\"amountPerPeriod()\":{\"returns\":{\"_0\":\"Amount of tokens available after each period\"}},\"approveProtocol()\":{\"details\":\"Approves all token destinations registered in the manager to pull tokens\"},\"availableAmount()\":{\"details\":\"Implements the step-by-step schedule based on periods for available tokens\",\"returns\":{\"_0\":\"Amount of tokens available according to the schedule\"}},\"cancelLock()\":{\"details\":\"Can only be called by the owner\"},\"changeBeneficiary(address)\":{\"details\":\"Can only be called by the beneficiary\",\"params\":{\"_newBeneficiary\":\"Address of the new beneficiary address\"}},\"currentBalance()\":{\"returns\":{\"_0\":\"Tokens held in the contract\"}},\"currentPeriod()\":{\"returns\":{\"_0\":\"A number that represents the current period\"}},\"currentTime()\":{\"returns\":{\"_0\":\"Current block timestamp\"}},\"duration()\":{\"returns\":{\"_0\":\"Amount of seconds from contract startTime to endTime\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"passedPeriods()\":{\"returns\":{\"_0\":\"A number of periods that passed since the schedule started\"}},\"periodDuration()\":{\"returns\":{\"_0\":\"Duration of each period in seconds\"}},\"releasableAmount()\":{\"details\":\"Considers the schedule, takes into account already released tokens and used amount\",\"returns\":{\"_0\":\"Amount of tokens ready to be released\"}},\"release()\":{\"details\":\"All available releasable tokens are transferred to beneficiary\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"revoke()\":{\"details\":\"Vesting schedule is always calculated based on managed tokens\"},\"revokeProtocol()\":{\"details\":\"Revokes approval to all token destinations in the manager to pull tokens\"},\"setManager(address)\":{\"params\":{\"_newManager\":\"Address of the new manager\"}},\"sinceStartTime()\":{\"details\":\"Returns zero if called before conctract starTime\",\"returns\":{\"_0\":\"Seconds elapsed from contract startTime\"}},\"surplusAmount()\":{\"details\":\"All funds over outstanding amount is considered surplus that can be withdrawn by beneficiary. Note this might not be the correct value for wallets transferred to L2 (i.e. an L2GraphTokenLockWallet), as the released amount will be skewed, so the beneficiary might have to bridge back to L1 to release the surplus.\",\"returns\":{\"_0\":\"Amount of tokens considered as surplus\"}},\"totalOutstandingAmount()\":{\"details\":\"Does not consider schedule but just global amounts tracked\",\"returns\":{\"_0\":\"Amount of outstanding tokens for the lifetime of the contract\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"vestedAmount()\":{\"details\":\"Similar to available amount, but is fully vested when contract is non-revocable\",\"returns\":{\"_0\":\"Amount of tokens already vested\"}},\"withdrawSurplus(uint256)\":{\"details\":\"Tokens in the contract over outstanding amount are considered as surplus\",\"params\":{\"_amount\":\"Amount of tokens to withdraw\"}}},\"title\":\"GraphTokenLockWallet\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"acceptLock()\":{\"notice\":\"Beneficiary accepts the lock, the owner cannot retrieve back the tokens\"},\"amountPerPeriod()\":{\"notice\":\"Returns amount available to be released after each period according to schedule\"},\"approveProtocol()\":{\"notice\":\"Approves protocol access of the tokens managed by this contract\"},\"availableAmount()\":{\"notice\":\"Gets the currently available token according to the schedule\"},\"cancelLock()\":{\"notice\":\"Owner cancel the lock and return the balance in the contract\"},\"changeBeneficiary(address)\":{\"notice\":\"Change the beneficiary of funds managed by the contract\"},\"currentBalance()\":{\"notice\":\"Returns the amount of tokens currently held by the contract\"},\"currentPeriod()\":{\"notice\":\"Gets the current period based on the schedule\"},\"currentTime()\":{\"notice\":\"Returns the current block timestamp\"},\"duration()\":{\"notice\":\"Gets duration of contract from start to end in seconds\"},\"passedPeriods()\":{\"notice\":\"Gets the number of periods that passed since the first period\"},\"periodDuration()\":{\"notice\":\"Returns the duration of each period in seconds\"},\"releasableAmount()\":{\"notice\":\"Gets tokens currently available for release\"},\"release()\":{\"notice\":\"Releases tokens based on the configured schedule\"},\"revoke()\":{\"notice\":\"Revokes a vesting schedule and return the unvested tokens to the owner\"},\"revokeProtocol()\":{\"notice\":\"Revokes protocol access of the tokens managed by this contract\"},\"setManager(address)\":{\"notice\":\"Sets a new manager for this contract\"},\"sinceStartTime()\":{\"notice\":\"Gets time elapsed since the start of the contract\"},\"surplusAmount()\":{\"notice\":\"Gets surplus amount in the contract based on outstanding amount to release\"},\"totalOutstandingAmount()\":{\"notice\":\"Gets the outstanding amount yet to be released based on the whole contract lifetime\"},\"vestedAmount()\":{\"notice\":\"Gets the amount of currently vested tokens\"},\"withdrawSurplus(uint256)\":{\"notice\":\"Withdraws surplus, unmanaged tokens from the contract\"}},\"notice\":\"This contract is built on top of the base GraphTokenLock functionality. It allows wallet beneficiaries to use the deposited funds to perform specific function calls on specific contracts. The idea is that supporters with locked tokens can participate in the protocol but disallow any release before the vesting/lock schedule. The beneficiary can issue authorized function calls to this contract that will get forwarded to a target contract. A target contract is any of our protocol contracts. The function calls allowed are queried to the GraphTokenLockManager, this way the same configuration can be shared for all the created lock wallet contracts. NOTE: Contracts used as target must have its function signatures checked to avoid collisions with any of this contract functions. Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience the maximum amount of tokens is authorized. Function calls do not forward ETH value so DO NOT SEND ETH TO THIS CONTRACT.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/GraphTokenLockWallet.sol\":\"GraphTokenLockWallet\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/math/SafeMath.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Wrappers over Solidity's arithmetic operations with added overflow\\n * checks.\\n *\\n * Arithmetic operations in Solidity wrap on overflow. This can easily result\\n * in bugs, because programmers usually assume that an overflow raises an\\n * error, which is the standard behavior in high level programming languages.\\n * `SafeMath` restores this intuition by reverting the transaction when an\\n * operation overflows.\\n *\\n * Using this library instead of the unchecked operations eliminates an entire\\n * class of bugs, so it's recommended to use it always.\\n */\\nlibrary SafeMath {\\n /**\\n * @dev Returns the addition of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n uint256 c = a + b;\\n if (c < a) return (false, 0);\\n return (true, c);\\n }\\n\\n /**\\n * @dev Returns the substraction of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b > a) return (false, 0);\\n return (true, a - b);\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\\n if (a == 0) return (true, 0);\\n uint256 c = a * b;\\n if (c / a != b) return (false, 0);\\n return (true, c);\\n }\\n\\n /**\\n * @dev Returns the division of two unsigned integers, with a division by zero flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b == 0) return (false, 0);\\n return (true, a / b);\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b == 0) return (false, 0);\\n return (true, a % b);\\n }\\n\\n /**\\n * @dev Returns the addition of two unsigned integers, reverting on\\n * overflow.\\n *\\n * Counterpart to Solidity's `+` operator.\\n *\\n * Requirements:\\n *\\n * - Addition cannot overflow.\\n */\\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\\n uint256 c = a + b;\\n require(c >= a, \\\"SafeMath: addition overflow\\\");\\n return c;\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting on\\n * overflow (when the result is negative).\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n *\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b <= a, \\\"SafeMath: subtraction overflow\\\");\\n return a - b;\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, reverting on\\n * overflow.\\n *\\n * Counterpart to Solidity's `*` operator.\\n *\\n * Requirements:\\n *\\n * - Multiplication cannot overflow.\\n */\\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\\n if (a == 0) return 0;\\n uint256 c = a * b;\\n require(c / a == b, \\\"SafeMath: multiplication overflow\\\");\\n return c;\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers, reverting on\\n * division by zero. The result is rounded towards zero.\\n *\\n * Counterpart to Solidity's `/` operator. Note: this function uses a\\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\\n * uses an invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b > 0, \\\"SafeMath: division by zero\\\");\\n return a / b;\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * reverting when dividing by zero.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b > 0, \\\"SafeMath: modulo by zero\\\");\\n return a % b;\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\\n * overflow (when the result is negative).\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {trySub}.\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n *\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b <= a, errorMessage);\\n return a - b;\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers, reverting with custom message on\\n * division by zero. The result is rounded towards zero.\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {tryDiv}.\\n *\\n * Counterpart to Solidity's `/` operator. Note: this function uses a\\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\\n * uses an invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b > 0, errorMessage);\\n return a / b;\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * reverting with custom message when dividing by zero.\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {tryMod}.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b > 0, errorMessage);\\n return a % b;\\n }\\n}\\n\",\"keccak256\":\"0xcc78a17dd88fa5a2edc60c8489e2f405c0913b377216a5b26b35656b2d0dab52\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `recipient`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address recipient, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `sender` to `recipient` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n}\\n\",\"keccak256\":\"0x5f02220344881ce43204ae4a6281145a67bc52c2bb1290a791857df3d19d78f5\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\nimport \\\"./IERC20.sol\\\";\\nimport \\\"../../math/SafeMath.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @title SafeERC20\\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\\n * contract returns false). Tokens that return no value (and instead revert or\\n * throw on failure) are also supported, non-reverting calls are assumed to be\\n * successful.\\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\n */\\nlibrary SafeERC20 {\\n using SafeMath for uint256;\\n using Address for address;\\n\\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\\n }\\n\\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\\n }\\n\\n /**\\n * @dev Deprecated. This function has issues similar to the ones found in\\n * {IERC20-approve}, and its usage is discouraged.\\n *\\n * Whenever possible, use {safeIncreaseAllowance} and\\n * {safeDecreaseAllowance} instead.\\n */\\n function safeApprove(IERC20 token, address spender, uint256 value) internal {\\n // safeApprove should only be called when setting an initial allowance,\\n // or when resetting it to zero. To increase and decrease it, use\\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\\n // solhint-disable-next-line max-line-length\\n require((value == 0) || (token.allowance(address(this), spender) == 0),\\n \\\"SafeERC20: approve from non-zero to non-zero allowance\\\"\\n );\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\\n }\\n\\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n uint256 newAllowance = token.allowance(address(this), spender).add(value);\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n uint256 newAllowance = token.allowance(address(this), spender).sub(value, \\\"SafeERC20: decreased allowance below zero\\\");\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n */\\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that\\n // the target address contains contract code and also asserts for success in the low-level call.\\n\\n bytes memory returndata = address(token).functionCall(data, \\\"SafeERC20: low-level call failed\\\");\\n if (returndata.length > 0) { // Return data is optional\\n // solhint-disable-next-line max-line-length\\n require(abi.decode(returndata, (bool)), \\\"SafeERC20: ERC20 operation did not succeed\\\");\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf12dfbe97e6276980b83d2830bb0eb75e0cf4f3e626c2471137f82158ae6a0fc\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.2 <0.8.0;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize, which returns 0 for contracts in\\n // construction, since the code is only stored at the end of the\\n // constructor execution.\\n\\n uint256 size;\\n // solhint-disable-next-line no-inline-assembly\\n assembly { size := extcodesize(account) }\\n return size > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls, avoid-call-value\\n (bool success, ) = recipient.call{ value: amount }(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain`call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.call{ value: value }(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x28911e614500ae7c607a432a709d35da25f3bc5ddc8bd12b278b66358070c0ea\",\"license\":\"MIT\"},\"contracts/GraphTokenLock.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nimport \\\"@openzeppelin/contracts/math/SafeMath.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\\\";\\n\\nimport { Ownable as OwnableInitializable } from \\\"./Ownable.sol\\\";\\nimport \\\"./MathUtils.sol\\\";\\nimport \\\"./IGraphTokenLock.sol\\\";\\n\\n/**\\n * @title GraphTokenLock\\n * @notice Contract that manages an unlocking schedule of tokens.\\n * @dev The contract lock manage a number of tokens deposited into the contract to ensure that\\n * they can only be released under certain time conditions.\\n *\\n * This contract implements a release scheduled based on periods and tokens are released in steps\\n * after each period ends. It can be configured with one period in which case it is like a plain TimeLock.\\n * It also supports revocation to be used for vesting schedules.\\n *\\n * The contract supports receiving extra funds than the managed tokens ones that can be\\n * withdrawn by the beneficiary at any time.\\n *\\n * A releaseStartTime parameter is included to override the default release schedule and\\n * perform the first release on the configured time. After that it will continue with the\\n * default schedule.\\n */\\nabstract contract GraphTokenLock is OwnableInitializable, IGraphTokenLock {\\n using SafeMath for uint256;\\n using SafeERC20 for IERC20;\\n\\n uint256 private constant MIN_PERIOD = 1;\\n\\n // -- State --\\n\\n IERC20 public token;\\n address public beneficiary;\\n\\n // Configuration\\n\\n // Amount of tokens managed by the contract schedule\\n uint256 public managedAmount;\\n\\n uint256 public startTime; // Start datetime (in unixtimestamp)\\n uint256 public endTime; // Datetime after all funds are fully vested/unlocked (in unixtimestamp)\\n uint256 public periods; // Number of vesting/release periods\\n\\n // First release date for tokens (in unixtimestamp)\\n // If set, no tokens will be released before releaseStartTime ignoring\\n // the amount to release each period\\n uint256 public releaseStartTime;\\n // A cliff set a date to which a beneficiary needs to get to vest\\n // all preceding periods\\n uint256 public vestingCliffTime;\\n Revocability public revocable; // Whether to use vesting for locked funds\\n\\n // State\\n\\n bool public isRevoked;\\n bool public isInitialized;\\n bool public isAccepted;\\n uint256 public releasedAmount;\\n uint256 public revokedAmount;\\n\\n // -- Events --\\n\\n event TokensReleased(address indexed beneficiary, uint256 amount);\\n event TokensWithdrawn(address indexed beneficiary, uint256 amount);\\n event TokensRevoked(address indexed beneficiary, uint256 amount);\\n event BeneficiaryChanged(address newBeneficiary);\\n event LockAccepted();\\n event LockCanceled();\\n\\n /**\\n * @dev Only allow calls from the beneficiary of the contract\\n */\\n modifier onlyBeneficiary() {\\n require(msg.sender == beneficiary, \\\"!auth\\\");\\n _;\\n }\\n\\n /**\\n * @notice Initializes the contract\\n * @param _owner Address of the contract owner\\n * @param _beneficiary Address of the beneficiary of locked tokens\\n * @param _managedAmount Amount of tokens to be managed by the lock contract\\n * @param _startTime Start time of the release schedule\\n * @param _endTime End time of the release schedule\\n * @param _periods Number of periods between start time and end time\\n * @param _releaseStartTime Override time for when the releases start\\n * @param _vestingCliffTime Override time for when the vesting start\\n * @param _revocable Whether the contract is revocable\\n */\\n function _initialize(\\n address _owner,\\n address _beneficiary,\\n address _token,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n Revocability _revocable\\n ) internal {\\n require(!isInitialized, \\\"Already initialized\\\");\\n require(_owner != address(0), \\\"Owner cannot be zero\\\");\\n require(_beneficiary != address(0), \\\"Beneficiary cannot be zero\\\");\\n require(_token != address(0), \\\"Token cannot be zero\\\");\\n require(_managedAmount > 0, \\\"Managed tokens cannot be zero\\\");\\n require(_startTime != 0, \\\"Start time must be set\\\");\\n require(_startTime < _endTime, \\\"Start time > end time\\\");\\n require(_periods >= MIN_PERIOD, \\\"Periods cannot be below minimum\\\");\\n require(_revocable != Revocability.NotSet, \\\"Must set a revocability option\\\");\\n require(_releaseStartTime < _endTime, \\\"Release start time must be before end time\\\");\\n require(_vestingCliffTime < _endTime, \\\"Cliff time must be before end time\\\");\\n\\n isInitialized = true;\\n\\n OwnableInitializable._initialize(_owner);\\n beneficiary = _beneficiary;\\n token = IERC20(_token);\\n\\n managedAmount = _managedAmount;\\n\\n startTime = _startTime;\\n endTime = _endTime;\\n periods = _periods;\\n\\n // Optionals\\n releaseStartTime = _releaseStartTime;\\n vestingCliffTime = _vestingCliffTime;\\n revocable = _revocable;\\n }\\n\\n /**\\n * @notice Change the beneficiary of funds managed by the contract\\n * @dev Can only be called by the beneficiary\\n * @param _newBeneficiary Address of the new beneficiary address\\n */\\n function changeBeneficiary(address _newBeneficiary) external onlyBeneficiary {\\n require(_newBeneficiary != address(0), \\\"Empty beneficiary\\\");\\n beneficiary = _newBeneficiary;\\n emit BeneficiaryChanged(_newBeneficiary);\\n }\\n\\n /**\\n * @notice Beneficiary accepts the lock, the owner cannot retrieve back the tokens\\n * @dev Can only be called by the beneficiary\\n */\\n function acceptLock() external onlyBeneficiary {\\n isAccepted = true;\\n emit LockAccepted();\\n }\\n\\n /**\\n * @notice Owner cancel the lock and return the balance in the contract\\n * @dev Can only be called by the owner\\n */\\n function cancelLock() external onlyOwner {\\n require(isAccepted == false, \\\"Cannot cancel accepted contract\\\");\\n\\n token.safeTransfer(owner(), currentBalance());\\n\\n emit LockCanceled();\\n }\\n\\n // -- Balances --\\n\\n /**\\n * @notice Returns the amount of tokens currently held by the contract\\n * @return Tokens held in the contract\\n */\\n function currentBalance() public view override returns (uint256) {\\n return token.balanceOf(address(this));\\n }\\n\\n // -- Time & Periods --\\n\\n /**\\n * @notice Returns the current block timestamp\\n * @return Current block timestamp\\n */\\n function currentTime() public view override returns (uint256) {\\n return block.timestamp;\\n }\\n\\n /**\\n * @notice Gets duration of contract from start to end in seconds\\n * @return Amount of seconds from contract startTime to endTime\\n */\\n function duration() public view override returns (uint256) {\\n return endTime.sub(startTime);\\n }\\n\\n /**\\n * @notice Gets time elapsed since the start of the contract\\n * @dev Returns zero if called before conctract starTime\\n * @return Seconds elapsed from contract startTime\\n */\\n function sinceStartTime() public view override returns (uint256) {\\n uint256 current = currentTime();\\n if (current <= startTime) {\\n return 0;\\n }\\n return current.sub(startTime);\\n }\\n\\n /**\\n * @notice Returns amount available to be released after each period according to schedule\\n * @return Amount of tokens available after each period\\n */\\n function amountPerPeriod() public view override returns (uint256) {\\n return managedAmount.div(periods);\\n }\\n\\n /**\\n * @notice Returns the duration of each period in seconds\\n * @return Duration of each period in seconds\\n */\\n function periodDuration() public view override returns (uint256) {\\n return duration().div(periods);\\n }\\n\\n /**\\n * @notice Gets the current period based on the schedule\\n * @return A number that represents the current period\\n */\\n function currentPeriod() public view override returns (uint256) {\\n return sinceStartTime().div(periodDuration()).add(MIN_PERIOD);\\n }\\n\\n /**\\n * @notice Gets the number of periods that passed since the first period\\n * @return A number of periods that passed since the schedule started\\n */\\n function passedPeriods() public view override returns (uint256) {\\n return currentPeriod().sub(MIN_PERIOD);\\n }\\n\\n // -- Locking & Release Schedule --\\n\\n /**\\n * @notice Gets the currently available token according to the schedule\\n * @dev Implements the step-by-step schedule based on periods for available tokens\\n * @return Amount of tokens available according to the schedule\\n */\\n function availableAmount() public view override returns (uint256) {\\n uint256 current = currentTime();\\n\\n // Before contract start no funds are available\\n if (current < startTime) {\\n return 0;\\n }\\n\\n // After contract ended all funds are available\\n if (current > endTime) {\\n return managedAmount;\\n }\\n\\n // Get available amount based on period\\n return passedPeriods().mul(amountPerPeriod());\\n }\\n\\n /**\\n * @notice Gets the amount of currently vested tokens\\n * @dev Similar to available amount, but is fully vested when contract is non-revocable\\n * @return Amount of tokens already vested\\n */\\n function vestedAmount() public view override returns (uint256) {\\n // If non-revocable it is fully vested\\n if (revocable == Revocability.Disabled) {\\n return managedAmount;\\n }\\n\\n // Vesting cliff is activated and it has not passed means nothing is vested yet\\n if (vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\\n return 0;\\n }\\n\\n return availableAmount();\\n }\\n\\n /**\\n * @notice Gets tokens currently available for release\\n * @dev Considers the schedule and takes into account already released tokens\\n * @return Amount of tokens ready to be released\\n */\\n function releasableAmount() public view virtual override returns (uint256) {\\n // If a release start time is set no tokens are available for release before this date\\n // If not set it follows the default schedule and tokens are available on\\n // the first period passed\\n if (releaseStartTime > 0 && currentTime() < releaseStartTime) {\\n return 0;\\n }\\n\\n // Vesting cliff is activated and it has not passed means nothing is vested yet\\n // so funds cannot be released\\n if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\\n return 0;\\n }\\n\\n // A beneficiary can never have more releasable tokens than the contract balance\\n uint256 releasable = availableAmount().sub(releasedAmount);\\n return MathUtils.min(currentBalance(), releasable);\\n }\\n\\n /**\\n * @notice Gets the outstanding amount yet to be released based on the whole contract lifetime\\n * @dev Does not consider schedule but just global amounts tracked\\n * @return Amount of outstanding tokens for the lifetime of the contract\\n */\\n function totalOutstandingAmount() public view override returns (uint256) {\\n return managedAmount.sub(releasedAmount).sub(revokedAmount);\\n }\\n\\n /**\\n * @notice Gets surplus amount in the contract based on outstanding amount to release\\n * @dev All funds over outstanding amount is considered surplus that can be withdrawn by beneficiary.\\n * Note this might not be the correct value for wallets transferred to L2 (i.e. an L2GraphTokenLockWallet), as the released amount will be\\n * skewed, so the beneficiary might have to bridge back to L1 to release the surplus.\\n * @return Amount of tokens considered as surplus\\n */\\n function surplusAmount() public view override returns (uint256) {\\n uint256 balance = currentBalance();\\n uint256 outstandingAmount = totalOutstandingAmount();\\n if (balance > outstandingAmount) {\\n return balance.sub(outstandingAmount);\\n }\\n return 0;\\n }\\n\\n // -- Value Transfer --\\n\\n /**\\n * @notice Releases tokens based on the configured schedule\\n * @dev All available releasable tokens are transferred to beneficiary\\n */\\n function release() external override onlyBeneficiary {\\n uint256 amountToRelease = releasableAmount();\\n require(amountToRelease > 0, \\\"No available releasable amount\\\");\\n\\n releasedAmount = releasedAmount.add(amountToRelease);\\n\\n token.safeTransfer(beneficiary, amountToRelease);\\n\\n emit TokensReleased(beneficiary, amountToRelease);\\n }\\n\\n /**\\n * @notice Withdraws surplus, unmanaged tokens from the contract\\n * @dev Tokens in the contract over outstanding amount are considered as surplus\\n * @param _amount Amount of tokens to withdraw\\n */\\n function withdrawSurplus(uint256 _amount) external override onlyBeneficiary {\\n require(_amount > 0, \\\"Amount cannot be zero\\\");\\n require(surplusAmount() >= _amount, \\\"Amount requested > surplus available\\\");\\n\\n token.safeTransfer(beneficiary, _amount);\\n\\n emit TokensWithdrawn(beneficiary, _amount);\\n }\\n\\n /**\\n * @notice Revokes a vesting schedule and return the unvested tokens to the owner\\n * @dev Vesting schedule is always calculated based on managed tokens\\n */\\n function revoke() external override onlyOwner {\\n require(revocable == Revocability.Enabled, \\\"Contract is non-revocable\\\");\\n require(isRevoked == false, \\\"Already revoked\\\");\\n\\n uint256 unvestedAmount = managedAmount.sub(vestedAmount());\\n require(unvestedAmount > 0, \\\"No available unvested amount\\\");\\n\\n revokedAmount = unvestedAmount;\\n isRevoked = true;\\n\\n token.safeTransfer(owner(), unvestedAmount);\\n\\n emit TokensRevoked(beneficiary, unvestedAmount);\\n }\\n}\\n\",\"keccak256\":\"0xd89470956a476c2fcf4a09625775573f95ba2c60a57fe866d90f65de1bcf5f2d\",\"license\":\"MIT\"},\"contracts/GraphTokenLockWallet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"@openzeppelin/contracts/math/SafeMath.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nimport \\\"./GraphTokenLock.sol\\\";\\nimport \\\"./IGraphTokenLockManager.sol\\\";\\n\\n/**\\n * @title GraphTokenLockWallet\\n * @notice This contract is built on top of the base GraphTokenLock functionality.\\n * It allows wallet beneficiaries to use the deposited funds to perform specific function calls\\n * on specific contracts.\\n *\\n * The idea is that supporters with locked tokens can participate in the protocol\\n * but disallow any release before the vesting/lock schedule.\\n * The beneficiary can issue authorized function calls to this contract that will\\n * get forwarded to a target contract. A target contract is any of our protocol contracts.\\n * The function calls allowed are queried to the GraphTokenLockManager, this way\\n * the same configuration can be shared for all the created lock wallet contracts.\\n *\\n * NOTE: Contracts used as target must have its function signatures checked to avoid collisions\\n * with any of this contract functions.\\n * Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience\\n * the maximum amount of tokens is authorized.\\n * Function calls do not forward ETH value so DO NOT SEND ETH TO THIS CONTRACT.\\n */\\ncontract GraphTokenLockWallet is GraphTokenLock {\\n using SafeMath for uint256;\\n\\n // -- State --\\n\\n IGraphTokenLockManager public manager;\\n uint256 public usedAmount;\\n\\n // -- Events --\\n\\n event ManagerUpdated(address indexed _oldManager, address indexed _newManager);\\n event TokenDestinationsApproved();\\n event TokenDestinationsRevoked();\\n\\n // Initializer\\n function initialize(\\n address _manager,\\n address _owner,\\n address _beneficiary,\\n address _token,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n Revocability _revocable\\n ) external {\\n _initialize(\\n _owner,\\n _beneficiary,\\n _token,\\n _managedAmount,\\n _startTime,\\n _endTime,\\n _periods,\\n _releaseStartTime,\\n _vestingCliffTime,\\n _revocable\\n );\\n _setManager(_manager);\\n }\\n\\n // -- Admin --\\n\\n /**\\n * @notice Sets a new manager for this contract\\n * @param _newManager Address of the new manager\\n */\\n function setManager(address _newManager) external onlyOwner {\\n _setManager(_newManager);\\n }\\n\\n /**\\n * @dev Sets a new manager for this contract\\n * @param _newManager Address of the new manager\\n */\\n function _setManager(address _newManager) internal {\\n require(_newManager != address(0), \\\"Manager cannot be empty\\\");\\n require(Address.isContract(_newManager), \\\"Manager must be a contract\\\");\\n\\n address oldManager = address(manager);\\n manager = IGraphTokenLockManager(_newManager);\\n\\n emit ManagerUpdated(oldManager, _newManager);\\n }\\n\\n // -- Beneficiary --\\n\\n /**\\n * @notice Approves protocol access of the tokens managed by this contract\\n * @dev Approves all token destinations registered in the manager to pull tokens\\n */\\n function approveProtocol() external onlyBeneficiary {\\n address[] memory dstList = manager.getTokenDestinations();\\n for (uint256 i = 0; i < dstList.length; i++) {\\n // Note this is only safe because we are using the max uint256 value\\n token.approve(dstList[i], type(uint256).max);\\n }\\n emit TokenDestinationsApproved();\\n }\\n\\n /**\\n * @notice Revokes protocol access of the tokens managed by this contract\\n * @dev Revokes approval to all token destinations in the manager to pull tokens\\n */\\n function revokeProtocol() external onlyBeneficiary {\\n address[] memory dstList = manager.getTokenDestinations();\\n for (uint256 i = 0; i < dstList.length; i++) {\\n // Note this is only safe cause we're using 0 as the amount\\n token.approve(dstList[i], 0);\\n }\\n emit TokenDestinationsRevoked();\\n }\\n\\n /**\\n * @notice Gets tokens currently available for release\\n * @dev Considers the schedule, takes into account already released tokens and used amount\\n * @return Amount of tokens ready to be released\\n */\\n function releasableAmount() public view override returns (uint256) {\\n if (revocable == Revocability.Disabled) {\\n return super.releasableAmount();\\n }\\n\\n // -- Revocability enabled logic\\n // This needs to deal with additional considerations for when tokens are used in the protocol\\n\\n // If a release start time is set no tokens are available for release before this date\\n // If not set it follows the default schedule and tokens are available on\\n // the first period passed\\n if (releaseStartTime > 0 && currentTime() < releaseStartTime) {\\n return 0;\\n }\\n\\n // Vesting cliff is activated and it has not passed means nothing is vested yet\\n // so funds cannot be released\\n if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\\n return 0;\\n }\\n\\n // A beneficiary can never have more releasable tokens than the contract balance\\n // We consider the `usedAmount` in the protocol as part of the calculations\\n // the beneficiary should not release funds that are used.\\n uint256 releasable = availableAmount().sub(releasedAmount).sub(usedAmount);\\n return MathUtils.min(currentBalance(), releasable);\\n }\\n\\n /**\\n * @notice Forward authorized contract calls to protocol contracts\\n * @dev Fallback function can be called by the beneficiary only if function call is allowed\\n */\\n // solhint-disable-next-line no-complex-fallback\\n fallback() external payable {\\n // Only beneficiary can forward calls\\n require(msg.sender == beneficiary, \\\"Unauthorized caller\\\");\\n require(msg.value == 0, \\\"ETH transfers not supported\\\");\\n\\n // Function call validation\\n address _target = manager.getAuthFunctionCallTarget(msg.sig);\\n require(_target != address(0), \\\"Unauthorized function\\\");\\n\\n uint256 oldBalance = currentBalance();\\n\\n // Call function with data\\n Address.functionCall(_target, msg.data);\\n\\n // Tracked used tokens in the protocol\\n // We do this check after balances were updated by the forwarded call\\n // Check is only enforced for revocable contracts to save some gas\\n if (revocable == Revocability.Enabled) {\\n // Track contract balance change\\n uint256 newBalance = currentBalance();\\n if (newBalance < oldBalance) {\\n // Outflow\\n uint256 diff = oldBalance.sub(newBalance);\\n usedAmount = usedAmount.add(diff);\\n } else {\\n // Inflow: We can receive profits from the protocol, that could make usedAmount to\\n // underflow. We set it to zero in that case.\\n uint256 diff = newBalance.sub(oldBalance);\\n usedAmount = (diff >= usedAmount) ? 0 : usedAmount.sub(diff);\\n }\\n require(usedAmount <= vestedAmount(), \\\"Cannot use more tokens than vested amount\\\");\\n }\\n }\\n\\n /**\\n * @notice Receive function that always reverts.\\n * @dev Only included to supress warnings, see https://github.com/ethereum/solidity/issues/10159\\n */\\n receive() external payable {\\n revert(\\\"Bad call\\\");\\n }\\n}\\n\",\"keccak256\":\"0x976c2ba4c1503a81ea02bd84539c516e99af611ff767968ee25456b50a6deb7b\",\"license\":\"MIT\"},\"contracts/IGraphTokenLock.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\ninterface IGraphTokenLock {\\n enum Revocability {\\n NotSet,\\n Enabled,\\n Disabled\\n }\\n\\n // -- Balances --\\n\\n function currentBalance() external view returns (uint256);\\n\\n // -- Time & Periods --\\n\\n function currentTime() external view returns (uint256);\\n\\n function duration() external view returns (uint256);\\n\\n function sinceStartTime() external view returns (uint256);\\n\\n function amountPerPeriod() external view returns (uint256);\\n\\n function periodDuration() external view returns (uint256);\\n\\n function currentPeriod() external view returns (uint256);\\n\\n function passedPeriods() external view returns (uint256);\\n\\n // -- Locking & Release Schedule --\\n\\n function availableAmount() external view returns (uint256);\\n\\n function vestedAmount() external view returns (uint256);\\n\\n function releasableAmount() external view returns (uint256);\\n\\n function totalOutstandingAmount() external view returns (uint256);\\n\\n function surplusAmount() external view returns (uint256);\\n\\n // -- Value Transfer --\\n\\n function release() external;\\n\\n function withdrawSurplus(uint256 _amount) external;\\n\\n function revoke() external;\\n}\\n\",\"keccak256\":\"0xceb9d258276fe25ec858191e1deae5778f1b2f612a669fb7b37bab1a064756ab\",\"license\":\"MIT\"},\"contracts/IGraphTokenLockManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nimport \\\"./IGraphTokenLock.sol\\\";\\n\\ninterface IGraphTokenLockManager {\\n // -- Factory --\\n\\n function setMasterCopy(address _masterCopy) external;\\n\\n function createTokenLockWallet(\\n address _owner,\\n address _beneficiary,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n IGraphTokenLock.Revocability _revocable\\n ) external;\\n\\n // -- Funds Management --\\n\\n function token() external returns (IERC20);\\n\\n function deposit(uint256 _amount) external;\\n\\n function withdraw(uint256 _amount) external;\\n\\n // -- Allowed Funds Destinations --\\n\\n function addTokenDestination(address _dst) external;\\n\\n function removeTokenDestination(address _dst) external;\\n\\n function isTokenDestination(address _dst) external view returns (bool);\\n\\n function getTokenDestinations() external view returns (address[] memory);\\n\\n // -- Function Call Authorization --\\n\\n function setAuthFunctionCall(string calldata _signature, address _target) external;\\n\\n function unsetAuthFunctionCall(string calldata _signature) external;\\n\\n function setAuthFunctionCallMany(string[] calldata _signatures, address[] calldata _targets) external;\\n\\n function getAuthFunctionCallTarget(bytes4 _sigHash) external view returns (address);\\n\\n function isAuthFunctionCall(bytes4 _sigHash) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x2d78d41909a6de5b316ac39b100ea087a8f317cf306379888a045523e15c4d9a\",\"license\":\"MIT\"},\"contracts/MathUtils.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nlibrary MathUtils {\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n}\\n\",\"keccak256\":\"0xe2512e1da48bc8363acd15f66229564b02d66706665d7da740604566913c1400\",\"license\":\"MIT\"},\"contracts/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * The owner account will be passed on initialization of the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\ncontract Ownable {\\n /// @dev Owner of the contract, can be retrieved with the public owner() function\\n address private _owner;\\n /// @dev Since upgradeable contracts might inherit this, we add a storage gap\\n /// to allow adding variables here without breaking the proxy storage layout\\n uint256[50] private __gap;\\n\\n /// @dev Emitted when ownership of the contract is transferred\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n function _initialize(address owner) internal {\\n _owner = owner;\\n emit OwnershipTransferred(address(0), owner);\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(_owner == msg.sender, \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() external virtual onlyOwner {\\n emit OwnershipTransferred(_owner, address(0));\\n _owner = address(0);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) external virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n emit OwnershipTransferred(_owner, newOwner);\\n _owner = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0xe8750687082e8e24b620dbf58c3a08eee591ed7b4d5a3e13cc93554ec647fd09\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b506146bb806100206000396000f3fe6080604052600436106102555760003560e01c806386d00e0211610139578063bc0163c1116100b6578063dc0706571161007a578063dc07065714610b93578063e8dda6f514610bbc578063e97d87d514610be7578063ebbab99214610c12578063f2fde38b14610c3d578063fc0c546a14610c6657610295565b8063bc0163c114610ac0578063bd896dcb14610aeb578063ce845d1d14610b14578063d0ebdbe714610b3f578063d18e81b314610b6857610295565b806391f7cfb9116100fd57806391f7cfb9146109ff578063a4caeb4214610a2a578063b0d1818c14610a55578063b470aade14610a7e578063b6549f7514610aa957610295565b806386d00e021461095057806386d1a69f1461097b578063872a7810146109925780638a5bdf5c146109bd5780638da5cb5b146109d457610295565b8063392e53cd116101d25780635051a5ec116101965780635051a5ec146108765780635b940081146108a157806360e79944146108cc578063715018a6146108e357806378e97925146108fa5780637bdf05af1461092557610295565b8063392e53cd1461079f578063398057a3146107ca57806344b1231f146107f557806345d30a1714610820578063481c6a751461084b57610295565b80632a627814116102195780632a627814146106dc5780632bc9ed02146106f35780633197cbb61461071e57806337aeb0861461074957806338af3eed1461077457610295565b8063029c6c9f1461061957806306040618146106445780630b80f7771461066f5780630dff24d5146106865780630fb5a6b4146106b157610295565b36610295576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161028c90613fb9565b60405180910390fd5b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610325576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161031c90614199565b60405180910390fd5b60003414610368576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161035f90613fd9565b60405180910390fd5b6000603e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f1d24c456000357fffffffff00000000000000000000000000000000000000000000000000000000166040518263ffffffff1660e01b81526004016103e99190613f2b565b60206040518083038186803b15801561040157600080fd5b505afa158015610415573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061043991906131a5565b9050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156104ab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104a290614299565b60405180910390fd5b60006104b5610c91565b9050610506826000368080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610d43565b506001600281111561051457fe5b603b60009054906101000a900460ff16600281111561052f57fe5b141561061557600061053f610c91565b90508181101561058157600061055e8284610d8d90919063ffffffff16565b905061057581603f54610ddd90919063ffffffff16565b603f81905550506105c7565b60006105968383610d8d90919063ffffffff16565b9050603f548110156105bc576105b781603f54610d8d90919063ffffffff16565b6105bf565b60005b603f81905550505b6105cf610e32565b603f541115610613576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161060a906141f9565b60405180910390fd5b505b5050005b34801561062557600080fd5b5061062e610ea1565b60405161063b9190614439565b60405180910390f35b34801561065057600080fd5b50610659610ebf565b6040516106669190614439565b60405180910390f35b34801561067b57600080fd5b50610684610efa565b005b34801561069257600080fd5b5061069b611067565b6040516106a89190614439565b60405180910390f35b3480156106bd57600080fd5b506106c66110ae565b6040516106d39190614439565b60405180910390f35b3480156106e857600080fd5b506106f16110cc565b005b3480156106ff57600080fd5b50610708611331565b6040516107159190613f10565b60405180910390f35b34801561072a57600080fd5b50610733611344565b6040516107409190614439565b60405180910390f35b34801561075557600080fd5b5061075e61134a565b60405161076b9190614439565b60405180910390f35b34801561078057600080fd5b50610789611350565b6040516107969190613ea3565b60405180910390f35b3480156107ab57600080fd5b506107b4611376565b6040516107c19190613f10565b60405180910390f35b3480156107d657600080fd5b506107df611389565b6040516107ec9190614439565b60405180910390f35b34801561080157600080fd5b5061080a610e32565b6040516108179190614439565b60405180910390f35b34801561082c57600080fd5b5061083561138f565b6040516108429190614439565b60405180910390f35b34801561085757600080fd5b50610860611395565b60405161086d9190613f61565b60405180910390f35b34801561088257600080fd5b5061088b6113bb565b6040516108989190613f10565b60405180910390f35b3480156108ad57600080fd5b506108b66113ce565b6040516108c39190614439565b60405180910390f35b3480156108d857600080fd5b506108e16114d9565b005b3480156108ef57600080fd5b506108f861171f565b005b34801561090657600080fd5b5061090f61186b565b60405161091c9190614439565b60405180910390f35b34801561093157600080fd5b5061093a611871565b6040516109479190614439565b60405180910390f35b34801561095c57600080fd5b506109656118ad565b6040516109729190614439565b60405180910390f35b34801561098757600080fd5b506109906118b3565b005b34801561099e57600080fd5b506109a7611a8f565b6040516109b49190613f7c565b60405180910390f35b3480156109c957600080fd5b506109d2611aa2565b005b3480156109e057600080fd5b506109e9611b7b565b6040516109f69190613ea3565b60405180910390f35b348015610a0b57600080fd5b50610a14611ba4565b604051610a219190614439565b60405180910390f35b348015610a3657600080fd5b50610a3f611c02565b604051610a4c9190614439565b60405180910390f35b348015610a6157600080fd5b50610a7c6004803603810190610a779190613328565b611c08565b005b348015610a8a57600080fd5b50610a93611e07565b604051610aa09190614439565b60405180910390f35b348015610ab557600080fd5b50610abe611e2a565b005b348015610acc57600080fd5b50610ad56120c2565b604051610ae29190614439565b60405180910390f35b348015610af757600080fd5b50610b126004803603810190610b0d91906131ce565b6120f4565b005b348015610b2057600080fd5b50610b29610c91565b604051610b369190614439565b60405180910390f35b348015610b4b57600080fd5b50610b666004803603810190610b61919061317c565b61211c565b005b348015610b7457600080fd5b50610b7d6121b6565b604051610b8a9190614439565b60405180910390f35b348015610b9f57600080fd5b50610bba6004803603810190610bb5919061317c565b6121be565b005b348015610bc857600080fd5b50610bd1612339565b604051610bde9190614439565b60405180910390f35b348015610bf357600080fd5b50610bfc61233f565b604051610c099190614439565b60405180910390f35b348015610c1e57600080fd5b50610c27612345565b604051610c349190614439565b60405180910390f35b348015610c4957600080fd5b50610c646004803603810190610c5f919061317c565b612367565b005b348015610c7257600080fd5b50610c7b612522565b604051610c889190613f46565b60405180910390f35b6000603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610cee9190613ea3565b60206040518083038186803b158015610d0657600080fd5b505afa158015610d1a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d3e9190613351565b905090565b6060610d8583836040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c65640000815250612548565b905092915050565b600082821115610dd2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dc9906140f9565b60405180910390fd5b818303905092915050565b600080828401905083811015610e28576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e1f90614079565b60405180910390fd5b8091505092915050565b6000600280811115610e4057fe5b603b60009054906101000a900460ff166002811115610e5b57fe5b1415610e6b576035549050610e9e565b6000603a54118015610e855750603a54610e836121b6565b105b15610e935760009050610e9e565b610e9b611ba4565b90505b90565b6000610eba60385460355461256090919063ffffffff16565b905090565b6000610ef56001610ee7610ed1611e07565b610ed9611871565b61256090919063ffffffff16565b610ddd90919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f88576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f7f90614259565b60405180910390fd5b60001515603b60039054906101000a900460ff16151514610fde576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fd5906140d9565b60405180910390fd5b611039610fe9611b7b565b610ff1610c91565b603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166125b69092919063ffffffff16565b7f171f0bcbda3370351cea17f3b164bee87d77c2503b94abdf2720a814ebe7e9df60405160405180910390a1565b600080611072610c91565b9050600061107e6120c2565b9050808211156110a45761109b8183610d8d90919063ffffffff16565b925050506110ab565b6000925050505b90565b60006110c7603654603754610d8d90919063ffffffff16565b905090565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461115c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115390614359565b60405180910390fd5b6060603e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a34574666040518163ffffffff1660e01b815260040160006040518083038186803b1580156111c657600080fd5b505afa1580156111da573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525081019061120391906132be565b905060005b815181101561130157603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b383838151811061125b57fe5b60200260200101517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016112a1929190613ee7565b602060405180830381600087803b1580156112bb57600080fd5b505af11580156112cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112f391906132ff565b508080600101915050611208565b507fb837fd51506ba3cc623a37c78ed22fd521f2f6e9f69a34d5c2a4a9474f27579360405160405180910390a150565b603b60019054906101000a900460ff1681565b60375481565b603d5481565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b603b60029054906101000a900460ff1681565b60355481565b603c5481565b603e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b603b60039054906101000a900460ff1681565b60006002808111156113dc57fe5b603b60009054906101000a900460ff1660028111156113f757fe5b141561140c5761140561263c565b90506114d6565b600060395411801561142657506039546114246121b6565b105b1561143457600090506114d6565b6001600281111561144157fe5b603b60009054906101000a900460ff16600281111561145c57fe5b14801561146b57506000603a54115b801561147f5750603a5461147d6121b6565b105b1561148d57600090506114d6565b60006114bf603f546114b1603c546114a3611ba4565b610d8d90919063ffffffff16565b610d8d90919063ffffffff16565b90506114d26114cc610c91565b826126f6565b9150505b90565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611569576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161156090614359565b60405180910390fd5b6060603e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a34574666040518163ffffffff1660e01b815260040160006040518083038186803b1580156115d357600080fd5b505afa1580156115e7573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525081019061161091906132be565b905060005b81518110156116ef57603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b383838151811061166857fe5b602002602001015160006040518363ffffffff1660e01b815260040161168f929190613ebe565b602060405180830381600087803b1580156116a957600080fd5b505af11580156116bd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116e191906132ff565b508080600101915050611615565b507f6d317a20ba9d790014284bef285283cd61fde92e0f2711050f563a9d2cf4171160405160405180910390a150565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146117ad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117a490614259565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60365481565b60008061187c6121b6565b905060365481116118915760009150506118aa565b6118a660365482610d8d90919063ffffffff16565b9150505b90565b603a5481565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611943576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161193a90614359565b60405180910390fd5b600061194d6113ce565b905060008111611992576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611989906143b9565b60405180910390fd5b6119a781603c54610ddd90919063ffffffff16565b603c81905550611a1c603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166125b69092919063ffffffff16565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fc7798891864187665ac6dd119286e44ec13f014527aeeb2b8eb3fd413df9317982604051611a849190614439565b60405180910390a250565b603b60009054906101000a900460ff1681565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611b32576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b2990614359565b60405180910390fd5b6001603b60036101000a81548160ff0219169083151502179055507fbeb3313724453131feb0a765a03e6715bb720e0f973a31fcbafa2d2f048c188b60405160405180910390a1565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600080611baf6121b6565b9050603654811015611bc5576000915050611bff565b603754811115611bda57603554915050611bff565b611bfb611be5610ea1565b611bed612345565b61270f90919063ffffffff16565b9150505b90565b60385481565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611c98576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c8f90614359565b60405180910390fd5b60008111611cdb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cd2906141d9565b60405180910390fd5b80611ce4611067565b1015611d25576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d1c906142d9565b60405180910390fd5b611d94603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166125b69092919063ffffffff16565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b82604051611dfc9190614439565b60405180910390a250565b6000611e25603854611e176110ae565b61256090919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611eb8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611eaf90614259565b60405180910390fd5b60016002811115611ec557fe5b603b60009054906101000a900460ff166002811115611ee057fe5b14611f20576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f1790614319565b60405180910390fd5b60001515603b60019054906101000a900460ff16151514611f76576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f6d90614419565b60405180910390fd5b6000611f94611f83610e32565b603554610d8d90919063ffffffff16565b905060008111611fd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fd090614099565b60405180910390fd5b80603d819055506001603b60016101000a81548160ff02191690831515021790555061204f612006611b7b565b82603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166125b69092919063ffffffff16565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fb73c49a3a37a7aca291ba0ceaa41657012def406106a7fc386888f0f66e941cf826040516120b79190614439565b60405180910390a250565b60006120ef603d546120e1603c54603554610d8d90919063ffffffff16565b610d8d90919063ffffffff16565b905090565b6121068a8a8a8a8a8a8a8a8a8a61277f565b61210f8b612c09565b5050505050505050505050565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146121aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121a190614259565b60405180910390fd5b6121b381612c09565b50565b600042905090565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461224e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161224590614359565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156122be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122b590614179565b60405180910390fd5b80603460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f373c72efabe4ef3e552ff77838be729f3bc3d8c586df0012902d1baa2377fa1d8160405161232e9190613ea3565b60405180910390a150565b603f5481565b60395481565b60006123626001612354610ebf565b610d8d90919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146123f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123ec90614259565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612465576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161245c90614059565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60606125578484600085612d87565b90509392505050565b60008082116125a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161259b90614159565b60405180910390fd5b8183816125ad57fe5b04905092915050565b6126378363a9059cbb60e01b84846040516024016125d5929190613ee7565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050612e9c565b505050565b60008060395411801561265757506039546126556121b6565b105b1561266557600090506126f3565b6001600281111561267257fe5b603b60009054906101000a900460ff16600281111561268d57fe5b14801561269c57506000603a54115b80156126b05750603a546126ae6121b6565b105b156126be57600090506126f3565b60006126dc603c546126ce611ba4565b610d8d90919063ffffffff16565b90506126ef6126e9610c91565b826126f6565b9150505b90565b60008183106127055781612707565b825b905092915050565b6000808314156127225760009050612779565b600082840290508284828161273357fe5b0414612774576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161276b90614239565b60405180910390fd5b809150505b92915050565b603b60029054906101000a900460ff16156127cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127c6906142f9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff16141561283f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612836906140b9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff1614156128af576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128a6906143f9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff16141561291f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612916906143d9565b60405180910390fd5b60008711612962576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161295990614139565b60405180910390fd5b60008614156129a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161299d90614279565b60405180910390fd5b8486106129e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129df90614019565b60405180910390fd5b6001841015612a2c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a2390614219565b60405180910390fd5b60006002811115612a3957fe5b816002811115612a4557fe5b1415612a86576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a7d90614039565b60405180910390fd5b848310612ac8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612abf90614379565b60405180910390fd5b848210612b0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b0190613ff9565b60405180910390fd5b6001603b60026101000a81548160ff021916908315150217905550612b2e8a612f63565b88603460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555087603360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550866035819055508560368190555084603781905550836038819055508260398190555081603a8190555080603b60006101000a81548160ff02191690836002811115612bf857fe5b021790555050505050505050505050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612c79576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c7090614339565b60405180910390fd5b612c8281613001565b612cc1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612cb8906141b9565b60405180910390fd5b6000603e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081603e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fdac3632743b879638fd2d51c4d3c1dd796615b4758a55b50b0c19b971ba9fbc760405160405180910390a35050565b606082471015612dcc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612dc390614119565b60405180910390fd5b612dd585613001565b612e14576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e0b906142b9565b60405180910390fd5b600060608673ffffffffffffffffffffffffffffffffffffffff168587604051612e3e9190613e8c565b60006040518083038185875af1925050503d8060008114612e7b576040519150601f19603f3d011682016040523d82523d6000602084013e612e80565b606091505b5091509150612e90828286613014565b92505050949350505050565b6060612efe826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166125489092919063ffffffff16565b9050600081511115612f5e5780806020019051810190612f1e91906132ff565b612f5d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612f5490614399565b60405180910390fd5b5b505050565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a350565b600080823b905060008111915050919050565b6060831561302457829050613074565b6000835111156130375782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161306b9190613f97565b60405180910390fd5b9392505050565b60008135905061308a81614630565b92915050565b60008151905061309f81614630565b92915050565b600082601f8301126130b657600080fd5b81516130c96130c482614485565b614454565b915081818352602084019350602081019050838560208402820111156130ee57600080fd5b60005b8381101561311e57816131048882613090565b8452602084019350602083019250506001810190506130f1565b5050505092915050565b60008151905061313781614647565b92915050565b60008135905061314c8161465e565b92915050565b6000813590506131618161466e565b92915050565b6000815190506131768161466e565b92915050565b60006020828403121561318e57600080fd5b600061319c8482850161307b565b91505092915050565b6000602082840312156131b757600080fd5b60006131c584828501613090565b91505092915050565b60008060008060008060008060008060006101608c8e0312156131f057600080fd5b60006131fe8e828f0161307b565b9b5050602061320f8e828f0161307b565b9a505060406132208e828f0161307b565b99505060606132318e828f0161307b565b98505060806132428e828f01613152565b97505060a06132538e828f01613152565b96505060c06132648e828f01613152565b95505060e06132758e828f01613152565b9450506101006132878e828f01613152565b9350506101206132998e828f01613152565b9250506101406132ab8e828f0161313d565b9150509295989b509295989b9093969950565b6000602082840312156132d057600080fd5b600082015167ffffffffffffffff8111156132ea57600080fd5b6132f6848285016130a5565b91505092915050565b60006020828403121561331157600080fd5b600061331f84828501613128565b91505092915050565b60006020828403121561333a57600080fd5b600061334884828501613152565b91505092915050565b60006020828403121561336357600080fd5b600061337184828501613167565b91505092915050565b613383816144e3565b82525050565b613392816144f5565b82525050565b6133a181614501565b82525050565b60006133b2826144b1565b6133bc81856144c7565b93506133cc8185602086016145d6565b80840191505092915050565b6133e18161456a565b82525050565b6133f08161458e565b82525050565b6133ff816145b2565b82525050565b61340e816145c4565b82525050565b600061341f826144bc565b61342981856144d2565b93506134398185602086016145d6565b6134428161460b565b840191505092915050565b600061345a6008836144d2565b91507f4261642063616c6c0000000000000000000000000000000000000000000000006000830152602082019050919050565b600061349a601b836144d2565b91507f455448207472616e7366657273206e6f7420737570706f7274656400000000006000830152602082019050919050565b60006134da6022836144d2565b91507f436c6966662074696d65206d757374206265206265666f726520656e6420746960008301527f6d650000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006135406015836144d2565b91507f53746172742074696d65203e20656e642074696d6500000000000000000000006000830152602082019050919050565b6000613580601e836144d2565b91507f4d757374207365742061207265766f636162696c697479206f7074696f6e00006000830152602082019050919050565b60006135c06026836144d2565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613626601b836144d2565b91507f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006000830152602082019050919050565b6000613666601c836144d2565b91507f4e6f20617661696c61626c6520756e76657374656420616d6f756e74000000006000830152602082019050919050565b60006136a66014836144d2565b91507f4f776e65722063616e6e6f74206265207a65726f0000000000000000000000006000830152602082019050919050565b60006136e6601f836144d2565b91507f43616e6e6f742063616e63656c20616363657074656420636f6e7472616374006000830152602082019050919050565b6000613726601e836144d2565b91507f536166654d6174683a207375627472616374696f6e206f766572666c6f7700006000830152602082019050919050565b60006137666026836144d2565b91507f416464726573733a20696e73756666696369656e742062616c616e636520666f60008301527f722063616c6c00000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006137cc601d836144d2565b91507f4d616e6167656420746f6b656e732063616e6e6f74206265207a65726f0000006000830152602082019050919050565b600061380c601a836144d2565b91507f536166654d6174683a206469766973696f6e206279207a65726f0000000000006000830152602082019050919050565b600061384c6011836144d2565b91507f456d7074792062656e65666963696172790000000000000000000000000000006000830152602082019050919050565b600061388c6013836144d2565b91507f556e617574686f72697a65642063616c6c6572000000000000000000000000006000830152602082019050919050565b60006138cc601a836144d2565b91507f4d616e61676572206d757374206265206120636f6e74726163740000000000006000830152602082019050919050565b600061390c6015836144d2565b91507f416d6f756e742063616e6e6f74206265207a65726f00000000000000000000006000830152602082019050919050565b600061394c6029836144d2565b91507f43616e6e6f7420757365206d6f726520746f6b656e73207468616e207665737460008301527f656420616d6f756e7400000000000000000000000000000000000000000000006020830152604082019050919050565b60006139b2601f836144d2565b91507f506572696f64732063616e6e6f742062652062656c6f77206d696e696d756d006000830152602082019050919050565b60006139f26021836144d2565b91507f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008301527f77000000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613a586020836144d2565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b6000613a986016836144d2565b91507f53746172742074696d65206d75737420626520736574000000000000000000006000830152602082019050919050565b6000613ad86015836144d2565b91507f556e617574686f72697a65642066756e6374696f6e00000000000000000000006000830152602082019050919050565b6000613b18601d836144d2565b91507f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006000830152602082019050919050565b6000613b586024836144d2565b91507f416d6f756e7420726571756573746564203e20737572706c757320617661696c60008301527f61626c65000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613bbe6013836144d2565b91507f416c726561647920696e697469616c697a6564000000000000000000000000006000830152602082019050919050565b6000613bfe6019836144d2565b91507f436f6e7472616374206973206e6f6e2d7265766f6361626c65000000000000006000830152602082019050919050565b6000613c3e6017836144d2565b91507f4d616e616765722063616e6e6f7420626520656d7074790000000000000000006000830152602082019050919050565b6000613c7e6005836144d2565b91507f21617574680000000000000000000000000000000000000000000000000000006000830152602082019050919050565b6000613cbe602a836144d2565b91507f52656c656173652073746172742074696d65206d757374206265206265666f7260008301527f6520656e642074696d65000000000000000000000000000000000000000000006020830152604082019050919050565b6000613d24602a836144d2565b91507f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008301527f6f742073756363656564000000000000000000000000000000000000000000006020830152604082019050919050565b6000613d8a601e836144d2565b91507f4e6f20617661696c61626c652072656c65617361626c6520616d6f756e7400006000830152602082019050919050565b6000613dca6014836144d2565b91507f546f6b656e2063616e6e6f74206265207a65726f0000000000000000000000006000830152602082019050919050565b6000613e0a601a836144d2565b91507f42656e65666963696172792063616e6e6f74206265207a65726f0000000000006000830152602082019050919050565b6000613e4a600f836144d2565b91507f416c7265616479207265766f6b656400000000000000000000000000000000006000830152602082019050919050565b613e8681614560565b82525050565b6000613e9882846133a7565b915081905092915050565b6000602082019050613eb8600083018461337a565b92915050565b6000604082019050613ed3600083018561337a565b613ee06020830184613405565b9392505050565b6000604082019050613efc600083018561337a565b613f096020830184613e7d565b9392505050565b6000602082019050613f256000830184613389565b92915050565b6000602082019050613f406000830184613398565b92915050565b6000602082019050613f5b60008301846133d8565b92915050565b6000602082019050613f7660008301846133e7565b92915050565b6000602082019050613f9160008301846133f6565b92915050565b60006020820190508181036000830152613fb18184613414565b905092915050565b60006020820190508181036000830152613fd28161344d565b9050919050565b60006020820190508181036000830152613ff28161348d565b9050919050565b60006020820190508181036000830152614012816134cd565b9050919050565b6000602082019050818103600083015261403281613533565b9050919050565b6000602082019050818103600083015261405281613573565b9050919050565b60006020820190508181036000830152614072816135b3565b9050919050565b6000602082019050818103600083015261409281613619565b9050919050565b600060208201905081810360008301526140b281613659565b9050919050565b600060208201905081810360008301526140d281613699565b9050919050565b600060208201905081810360008301526140f2816136d9565b9050919050565b6000602082019050818103600083015261411281613719565b9050919050565b6000602082019050818103600083015261413281613759565b9050919050565b60006020820190508181036000830152614152816137bf565b9050919050565b60006020820190508181036000830152614172816137ff565b9050919050565b600060208201905081810360008301526141928161383f565b9050919050565b600060208201905081810360008301526141b28161387f565b9050919050565b600060208201905081810360008301526141d2816138bf565b9050919050565b600060208201905081810360008301526141f2816138ff565b9050919050565b600060208201905081810360008301526142128161393f565b9050919050565b60006020820190508181036000830152614232816139a5565b9050919050565b60006020820190508181036000830152614252816139e5565b9050919050565b6000602082019050818103600083015261427281613a4b565b9050919050565b6000602082019050818103600083015261429281613a8b565b9050919050565b600060208201905081810360008301526142b281613acb565b9050919050565b600060208201905081810360008301526142d281613b0b565b9050919050565b600060208201905081810360008301526142f281613b4b565b9050919050565b6000602082019050818103600083015261431281613bb1565b9050919050565b6000602082019050818103600083015261433281613bf1565b9050919050565b6000602082019050818103600083015261435281613c31565b9050919050565b6000602082019050818103600083015261437281613c71565b9050919050565b6000602082019050818103600083015261439281613cb1565b9050919050565b600060208201905081810360008301526143b281613d17565b9050919050565b600060208201905081810360008301526143d281613d7d565b9050919050565b600060208201905081810360008301526143f281613dbd565b9050919050565b6000602082019050818103600083015261441281613dfd565b9050919050565b6000602082019050818103600083015261443281613e3d565b9050919050565b600060208201905061444e6000830184613e7d565b92915050565b6000604051905081810181811067ffffffffffffffff8211171561447b5761447a614609565b5b8060405250919050565b600067ffffffffffffffff8211156144a05761449f614609565b5b602082029050602081019050919050565b600081519050919050565b600081519050919050565b600081905092915050565b600082825260208201905092915050565b60006144ee82614540565b9050919050565b60008115159050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600081905061453b8261461c565b919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60006145758261457c565b9050919050565b600061458782614540565b9050919050565b6000614599826145a0565b9050919050565b60006145ab82614540565b9050919050565b60006145bd8261452d565b9050919050565b60006145cf82614560565b9050919050565b60005b838110156145f45780820151818401526020810190506145d9565b83811115614603576000848401525b50505050565bfe5b6000601f19601f8301169050919050565b6003811061462d5761462c614609565b5b50565b614639816144e3565b811461464457600080fd5b50565b614650816144f5565b811461465b57600080fd5b50565b6003811061466b57600080fd5b50565b61467781614560565b811461468257600080fd5b5056fea264697066735822122013f3b022e354ddf49f7a28727f309f858a5cbdf70833a2e54da3c1a482b7073164736f6c63430007030033", + "deployedBytecode": "0x6080604052600436106102555760003560e01c806386d00e0211610139578063bc0163c1116100b6578063dc0706571161007a578063dc07065714610b93578063e8dda6f514610bbc578063e97d87d514610be7578063ebbab99214610c12578063f2fde38b14610c3d578063fc0c546a14610c6657610295565b8063bc0163c114610ac0578063bd896dcb14610aeb578063ce845d1d14610b14578063d0ebdbe714610b3f578063d18e81b314610b6857610295565b806391f7cfb9116100fd57806391f7cfb9146109ff578063a4caeb4214610a2a578063b0d1818c14610a55578063b470aade14610a7e578063b6549f7514610aa957610295565b806386d00e021461095057806386d1a69f1461097b578063872a7810146109925780638a5bdf5c146109bd5780638da5cb5b146109d457610295565b8063392e53cd116101d25780635051a5ec116101965780635051a5ec146108765780635b940081146108a157806360e79944146108cc578063715018a6146108e357806378e97925146108fa5780637bdf05af1461092557610295565b8063392e53cd1461079f578063398057a3146107ca57806344b1231f146107f557806345d30a1714610820578063481c6a751461084b57610295565b80632a627814116102195780632a627814146106dc5780632bc9ed02146106f35780633197cbb61461071e57806337aeb0861461074957806338af3eed1461077457610295565b8063029c6c9f1461061957806306040618146106445780630b80f7771461066f5780630dff24d5146106865780630fb5a6b4146106b157610295565b36610295576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161028c90613fb9565b60405180910390fd5b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610325576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161031c90614199565b60405180910390fd5b60003414610368576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161035f90613fd9565b60405180910390fd5b6000603e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f1d24c456000357fffffffff00000000000000000000000000000000000000000000000000000000166040518263ffffffff1660e01b81526004016103e99190613f2b565b60206040518083038186803b15801561040157600080fd5b505afa158015610415573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061043991906131a5565b9050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156104ab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104a290614299565b60405180910390fd5b60006104b5610c91565b9050610506826000368080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610d43565b506001600281111561051457fe5b603b60009054906101000a900460ff16600281111561052f57fe5b141561061557600061053f610c91565b90508181101561058157600061055e8284610d8d90919063ffffffff16565b905061057581603f54610ddd90919063ffffffff16565b603f81905550506105c7565b60006105968383610d8d90919063ffffffff16565b9050603f548110156105bc576105b781603f54610d8d90919063ffffffff16565b6105bf565b60005b603f81905550505b6105cf610e32565b603f541115610613576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161060a906141f9565b60405180910390fd5b505b5050005b34801561062557600080fd5b5061062e610ea1565b60405161063b9190614439565b60405180910390f35b34801561065057600080fd5b50610659610ebf565b6040516106669190614439565b60405180910390f35b34801561067b57600080fd5b50610684610efa565b005b34801561069257600080fd5b5061069b611067565b6040516106a89190614439565b60405180910390f35b3480156106bd57600080fd5b506106c66110ae565b6040516106d39190614439565b60405180910390f35b3480156106e857600080fd5b506106f16110cc565b005b3480156106ff57600080fd5b50610708611331565b6040516107159190613f10565b60405180910390f35b34801561072a57600080fd5b50610733611344565b6040516107409190614439565b60405180910390f35b34801561075557600080fd5b5061075e61134a565b60405161076b9190614439565b60405180910390f35b34801561078057600080fd5b50610789611350565b6040516107969190613ea3565b60405180910390f35b3480156107ab57600080fd5b506107b4611376565b6040516107c19190613f10565b60405180910390f35b3480156107d657600080fd5b506107df611389565b6040516107ec9190614439565b60405180910390f35b34801561080157600080fd5b5061080a610e32565b6040516108179190614439565b60405180910390f35b34801561082c57600080fd5b5061083561138f565b6040516108429190614439565b60405180910390f35b34801561085757600080fd5b50610860611395565b60405161086d9190613f61565b60405180910390f35b34801561088257600080fd5b5061088b6113bb565b6040516108989190613f10565b60405180910390f35b3480156108ad57600080fd5b506108b66113ce565b6040516108c39190614439565b60405180910390f35b3480156108d857600080fd5b506108e16114d9565b005b3480156108ef57600080fd5b506108f861171f565b005b34801561090657600080fd5b5061090f61186b565b60405161091c9190614439565b60405180910390f35b34801561093157600080fd5b5061093a611871565b6040516109479190614439565b60405180910390f35b34801561095c57600080fd5b506109656118ad565b6040516109729190614439565b60405180910390f35b34801561098757600080fd5b506109906118b3565b005b34801561099e57600080fd5b506109a7611a8f565b6040516109b49190613f7c565b60405180910390f35b3480156109c957600080fd5b506109d2611aa2565b005b3480156109e057600080fd5b506109e9611b7b565b6040516109f69190613ea3565b60405180910390f35b348015610a0b57600080fd5b50610a14611ba4565b604051610a219190614439565b60405180910390f35b348015610a3657600080fd5b50610a3f611c02565b604051610a4c9190614439565b60405180910390f35b348015610a6157600080fd5b50610a7c6004803603810190610a779190613328565b611c08565b005b348015610a8a57600080fd5b50610a93611e07565b604051610aa09190614439565b60405180910390f35b348015610ab557600080fd5b50610abe611e2a565b005b348015610acc57600080fd5b50610ad56120c2565b604051610ae29190614439565b60405180910390f35b348015610af757600080fd5b50610b126004803603810190610b0d91906131ce565b6120f4565b005b348015610b2057600080fd5b50610b29610c91565b604051610b369190614439565b60405180910390f35b348015610b4b57600080fd5b50610b666004803603810190610b61919061317c565b61211c565b005b348015610b7457600080fd5b50610b7d6121b6565b604051610b8a9190614439565b60405180910390f35b348015610b9f57600080fd5b50610bba6004803603810190610bb5919061317c565b6121be565b005b348015610bc857600080fd5b50610bd1612339565b604051610bde9190614439565b60405180910390f35b348015610bf357600080fd5b50610bfc61233f565b604051610c099190614439565b60405180910390f35b348015610c1e57600080fd5b50610c27612345565b604051610c349190614439565b60405180910390f35b348015610c4957600080fd5b50610c646004803603810190610c5f919061317c565b612367565b005b348015610c7257600080fd5b50610c7b612522565b604051610c889190613f46565b60405180910390f35b6000603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610cee9190613ea3565b60206040518083038186803b158015610d0657600080fd5b505afa158015610d1a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d3e9190613351565b905090565b6060610d8583836040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c65640000815250612548565b905092915050565b600082821115610dd2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dc9906140f9565b60405180910390fd5b818303905092915050565b600080828401905083811015610e28576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e1f90614079565b60405180910390fd5b8091505092915050565b6000600280811115610e4057fe5b603b60009054906101000a900460ff166002811115610e5b57fe5b1415610e6b576035549050610e9e565b6000603a54118015610e855750603a54610e836121b6565b105b15610e935760009050610e9e565b610e9b611ba4565b90505b90565b6000610eba60385460355461256090919063ffffffff16565b905090565b6000610ef56001610ee7610ed1611e07565b610ed9611871565b61256090919063ffffffff16565b610ddd90919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f88576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f7f90614259565b60405180910390fd5b60001515603b60039054906101000a900460ff16151514610fde576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fd5906140d9565b60405180910390fd5b611039610fe9611b7b565b610ff1610c91565b603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166125b69092919063ffffffff16565b7f171f0bcbda3370351cea17f3b164bee87d77c2503b94abdf2720a814ebe7e9df60405160405180910390a1565b600080611072610c91565b9050600061107e6120c2565b9050808211156110a45761109b8183610d8d90919063ffffffff16565b925050506110ab565b6000925050505b90565b60006110c7603654603754610d8d90919063ffffffff16565b905090565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461115c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115390614359565b60405180910390fd5b6060603e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a34574666040518163ffffffff1660e01b815260040160006040518083038186803b1580156111c657600080fd5b505afa1580156111da573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525081019061120391906132be565b905060005b815181101561130157603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b383838151811061125b57fe5b60200260200101517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016112a1929190613ee7565b602060405180830381600087803b1580156112bb57600080fd5b505af11580156112cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112f391906132ff565b508080600101915050611208565b507fb837fd51506ba3cc623a37c78ed22fd521f2f6e9f69a34d5c2a4a9474f27579360405160405180910390a150565b603b60019054906101000a900460ff1681565b60375481565b603d5481565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b603b60029054906101000a900460ff1681565b60355481565b603c5481565b603e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b603b60039054906101000a900460ff1681565b60006002808111156113dc57fe5b603b60009054906101000a900460ff1660028111156113f757fe5b141561140c5761140561263c565b90506114d6565b600060395411801561142657506039546114246121b6565b105b1561143457600090506114d6565b6001600281111561144157fe5b603b60009054906101000a900460ff16600281111561145c57fe5b14801561146b57506000603a54115b801561147f5750603a5461147d6121b6565b105b1561148d57600090506114d6565b60006114bf603f546114b1603c546114a3611ba4565b610d8d90919063ffffffff16565b610d8d90919063ffffffff16565b90506114d26114cc610c91565b826126f6565b9150505b90565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611569576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161156090614359565b60405180910390fd5b6060603e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a34574666040518163ffffffff1660e01b815260040160006040518083038186803b1580156115d357600080fd5b505afa1580156115e7573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525081019061161091906132be565b905060005b81518110156116ef57603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b383838151811061166857fe5b602002602001015160006040518363ffffffff1660e01b815260040161168f929190613ebe565b602060405180830381600087803b1580156116a957600080fd5b505af11580156116bd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116e191906132ff565b508080600101915050611615565b507f6d317a20ba9d790014284bef285283cd61fde92e0f2711050f563a9d2cf4171160405160405180910390a150565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146117ad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117a490614259565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60365481565b60008061187c6121b6565b905060365481116118915760009150506118aa565b6118a660365482610d8d90919063ffffffff16565b9150505b90565b603a5481565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611943576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161193a90614359565b60405180910390fd5b600061194d6113ce565b905060008111611992576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611989906143b9565b60405180910390fd5b6119a781603c54610ddd90919063ffffffff16565b603c81905550611a1c603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166125b69092919063ffffffff16565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fc7798891864187665ac6dd119286e44ec13f014527aeeb2b8eb3fd413df9317982604051611a849190614439565b60405180910390a250565b603b60009054906101000a900460ff1681565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611b32576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b2990614359565b60405180910390fd5b6001603b60036101000a81548160ff0219169083151502179055507fbeb3313724453131feb0a765a03e6715bb720e0f973a31fcbafa2d2f048c188b60405160405180910390a1565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600080611baf6121b6565b9050603654811015611bc5576000915050611bff565b603754811115611bda57603554915050611bff565b611bfb611be5610ea1565b611bed612345565b61270f90919063ffffffff16565b9150505b90565b60385481565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611c98576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c8f90614359565b60405180910390fd5b60008111611cdb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cd2906141d9565b60405180910390fd5b80611ce4611067565b1015611d25576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d1c906142d9565b60405180910390fd5b611d94603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166125b69092919063ffffffff16565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b82604051611dfc9190614439565b60405180910390a250565b6000611e25603854611e176110ae565b61256090919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611eb8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611eaf90614259565b60405180910390fd5b60016002811115611ec557fe5b603b60009054906101000a900460ff166002811115611ee057fe5b14611f20576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f1790614319565b60405180910390fd5b60001515603b60019054906101000a900460ff16151514611f76576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f6d90614419565b60405180910390fd5b6000611f94611f83610e32565b603554610d8d90919063ffffffff16565b905060008111611fd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fd090614099565b60405180910390fd5b80603d819055506001603b60016101000a81548160ff02191690831515021790555061204f612006611b7b565b82603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166125b69092919063ffffffff16565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fb73c49a3a37a7aca291ba0ceaa41657012def406106a7fc386888f0f66e941cf826040516120b79190614439565b60405180910390a250565b60006120ef603d546120e1603c54603554610d8d90919063ffffffff16565b610d8d90919063ffffffff16565b905090565b6121068a8a8a8a8a8a8a8a8a8a61277f565b61210f8b612c09565b5050505050505050505050565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146121aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121a190614259565b60405180910390fd5b6121b381612c09565b50565b600042905090565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461224e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161224590614359565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156122be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122b590614179565b60405180910390fd5b80603460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f373c72efabe4ef3e552ff77838be729f3bc3d8c586df0012902d1baa2377fa1d8160405161232e9190613ea3565b60405180910390a150565b603f5481565b60395481565b60006123626001612354610ebf565b610d8d90919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146123f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123ec90614259565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612465576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161245c90614059565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60606125578484600085612d87565b90509392505050565b60008082116125a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161259b90614159565b60405180910390fd5b8183816125ad57fe5b04905092915050565b6126378363a9059cbb60e01b84846040516024016125d5929190613ee7565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050612e9c565b505050565b60008060395411801561265757506039546126556121b6565b105b1561266557600090506126f3565b6001600281111561267257fe5b603b60009054906101000a900460ff16600281111561268d57fe5b14801561269c57506000603a54115b80156126b05750603a546126ae6121b6565b105b156126be57600090506126f3565b60006126dc603c546126ce611ba4565b610d8d90919063ffffffff16565b90506126ef6126e9610c91565b826126f6565b9150505b90565b60008183106127055781612707565b825b905092915050565b6000808314156127225760009050612779565b600082840290508284828161273357fe5b0414612774576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161276b90614239565b60405180910390fd5b809150505b92915050565b603b60029054906101000a900460ff16156127cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127c6906142f9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff16141561283f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612836906140b9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff1614156128af576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128a6906143f9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff16141561291f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612916906143d9565b60405180910390fd5b60008711612962576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161295990614139565b60405180910390fd5b60008614156129a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161299d90614279565b60405180910390fd5b8486106129e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129df90614019565b60405180910390fd5b6001841015612a2c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a2390614219565b60405180910390fd5b60006002811115612a3957fe5b816002811115612a4557fe5b1415612a86576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a7d90614039565b60405180910390fd5b848310612ac8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612abf90614379565b60405180910390fd5b848210612b0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b0190613ff9565b60405180910390fd5b6001603b60026101000a81548160ff021916908315150217905550612b2e8a612f63565b88603460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555087603360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550866035819055508560368190555084603781905550836038819055508260398190555081603a8190555080603b60006101000a81548160ff02191690836002811115612bf857fe5b021790555050505050505050505050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612c79576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c7090614339565b60405180910390fd5b612c8281613001565b612cc1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612cb8906141b9565b60405180910390fd5b6000603e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081603e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fdac3632743b879638fd2d51c4d3c1dd796615b4758a55b50b0c19b971ba9fbc760405160405180910390a35050565b606082471015612dcc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612dc390614119565b60405180910390fd5b612dd585613001565b612e14576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e0b906142b9565b60405180910390fd5b600060608673ffffffffffffffffffffffffffffffffffffffff168587604051612e3e9190613e8c565b60006040518083038185875af1925050503d8060008114612e7b576040519150601f19603f3d011682016040523d82523d6000602084013e612e80565b606091505b5091509150612e90828286613014565b92505050949350505050565b6060612efe826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166125489092919063ffffffff16565b9050600081511115612f5e5780806020019051810190612f1e91906132ff565b612f5d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612f5490614399565b60405180910390fd5b5b505050565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a350565b600080823b905060008111915050919050565b6060831561302457829050613074565b6000835111156130375782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161306b9190613f97565b60405180910390fd5b9392505050565b60008135905061308a81614630565b92915050565b60008151905061309f81614630565b92915050565b600082601f8301126130b657600080fd5b81516130c96130c482614485565b614454565b915081818352602084019350602081019050838560208402820111156130ee57600080fd5b60005b8381101561311e57816131048882613090565b8452602084019350602083019250506001810190506130f1565b5050505092915050565b60008151905061313781614647565b92915050565b60008135905061314c8161465e565b92915050565b6000813590506131618161466e565b92915050565b6000815190506131768161466e565b92915050565b60006020828403121561318e57600080fd5b600061319c8482850161307b565b91505092915050565b6000602082840312156131b757600080fd5b60006131c584828501613090565b91505092915050565b60008060008060008060008060008060006101608c8e0312156131f057600080fd5b60006131fe8e828f0161307b565b9b5050602061320f8e828f0161307b565b9a505060406132208e828f0161307b565b99505060606132318e828f0161307b565b98505060806132428e828f01613152565b97505060a06132538e828f01613152565b96505060c06132648e828f01613152565b95505060e06132758e828f01613152565b9450506101006132878e828f01613152565b9350506101206132998e828f01613152565b9250506101406132ab8e828f0161313d565b9150509295989b509295989b9093969950565b6000602082840312156132d057600080fd5b600082015167ffffffffffffffff8111156132ea57600080fd5b6132f6848285016130a5565b91505092915050565b60006020828403121561331157600080fd5b600061331f84828501613128565b91505092915050565b60006020828403121561333a57600080fd5b600061334884828501613152565b91505092915050565b60006020828403121561336357600080fd5b600061337184828501613167565b91505092915050565b613383816144e3565b82525050565b613392816144f5565b82525050565b6133a181614501565b82525050565b60006133b2826144b1565b6133bc81856144c7565b93506133cc8185602086016145d6565b80840191505092915050565b6133e18161456a565b82525050565b6133f08161458e565b82525050565b6133ff816145b2565b82525050565b61340e816145c4565b82525050565b600061341f826144bc565b61342981856144d2565b93506134398185602086016145d6565b6134428161460b565b840191505092915050565b600061345a6008836144d2565b91507f4261642063616c6c0000000000000000000000000000000000000000000000006000830152602082019050919050565b600061349a601b836144d2565b91507f455448207472616e7366657273206e6f7420737570706f7274656400000000006000830152602082019050919050565b60006134da6022836144d2565b91507f436c6966662074696d65206d757374206265206265666f726520656e6420746960008301527f6d650000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006135406015836144d2565b91507f53746172742074696d65203e20656e642074696d6500000000000000000000006000830152602082019050919050565b6000613580601e836144d2565b91507f4d757374207365742061207265766f636162696c697479206f7074696f6e00006000830152602082019050919050565b60006135c06026836144d2565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613626601b836144d2565b91507f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006000830152602082019050919050565b6000613666601c836144d2565b91507f4e6f20617661696c61626c6520756e76657374656420616d6f756e74000000006000830152602082019050919050565b60006136a66014836144d2565b91507f4f776e65722063616e6e6f74206265207a65726f0000000000000000000000006000830152602082019050919050565b60006136e6601f836144d2565b91507f43616e6e6f742063616e63656c20616363657074656420636f6e7472616374006000830152602082019050919050565b6000613726601e836144d2565b91507f536166654d6174683a207375627472616374696f6e206f766572666c6f7700006000830152602082019050919050565b60006137666026836144d2565b91507f416464726573733a20696e73756666696369656e742062616c616e636520666f60008301527f722063616c6c00000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006137cc601d836144d2565b91507f4d616e6167656420746f6b656e732063616e6e6f74206265207a65726f0000006000830152602082019050919050565b600061380c601a836144d2565b91507f536166654d6174683a206469766973696f6e206279207a65726f0000000000006000830152602082019050919050565b600061384c6011836144d2565b91507f456d7074792062656e65666963696172790000000000000000000000000000006000830152602082019050919050565b600061388c6013836144d2565b91507f556e617574686f72697a65642063616c6c6572000000000000000000000000006000830152602082019050919050565b60006138cc601a836144d2565b91507f4d616e61676572206d757374206265206120636f6e74726163740000000000006000830152602082019050919050565b600061390c6015836144d2565b91507f416d6f756e742063616e6e6f74206265207a65726f00000000000000000000006000830152602082019050919050565b600061394c6029836144d2565b91507f43616e6e6f7420757365206d6f726520746f6b656e73207468616e207665737460008301527f656420616d6f756e7400000000000000000000000000000000000000000000006020830152604082019050919050565b60006139b2601f836144d2565b91507f506572696f64732063616e6e6f742062652062656c6f77206d696e696d756d006000830152602082019050919050565b60006139f26021836144d2565b91507f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008301527f77000000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613a586020836144d2565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b6000613a986016836144d2565b91507f53746172742074696d65206d75737420626520736574000000000000000000006000830152602082019050919050565b6000613ad86015836144d2565b91507f556e617574686f72697a65642066756e6374696f6e00000000000000000000006000830152602082019050919050565b6000613b18601d836144d2565b91507f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006000830152602082019050919050565b6000613b586024836144d2565b91507f416d6f756e7420726571756573746564203e20737572706c757320617661696c60008301527f61626c65000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613bbe6013836144d2565b91507f416c726561647920696e697469616c697a6564000000000000000000000000006000830152602082019050919050565b6000613bfe6019836144d2565b91507f436f6e7472616374206973206e6f6e2d7265766f6361626c65000000000000006000830152602082019050919050565b6000613c3e6017836144d2565b91507f4d616e616765722063616e6e6f7420626520656d7074790000000000000000006000830152602082019050919050565b6000613c7e6005836144d2565b91507f21617574680000000000000000000000000000000000000000000000000000006000830152602082019050919050565b6000613cbe602a836144d2565b91507f52656c656173652073746172742074696d65206d757374206265206265666f7260008301527f6520656e642074696d65000000000000000000000000000000000000000000006020830152604082019050919050565b6000613d24602a836144d2565b91507f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008301527f6f742073756363656564000000000000000000000000000000000000000000006020830152604082019050919050565b6000613d8a601e836144d2565b91507f4e6f20617661696c61626c652072656c65617361626c6520616d6f756e7400006000830152602082019050919050565b6000613dca6014836144d2565b91507f546f6b656e2063616e6e6f74206265207a65726f0000000000000000000000006000830152602082019050919050565b6000613e0a601a836144d2565b91507f42656e65666963696172792063616e6e6f74206265207a65726f0000000000006000830152602082019050919050565b6000613e4a600f836144d2565b91507f416c7265616479207265766f6b656400000000000000000000000000000000006000830152602082019050919050565b613e8681614560565b82525050565b6000613e9882846133a7565b915081905092915050565b6000602082019050613eb8600083018461337a565b92915050565b6000604082019050613ed3600083018561337a565b613ee06020830184613405565b9392505050565b6000604082019050613efc600083018561337a565b613f096020830184613e7d565b9392505050565b6000602082019050613f256000830184613389565b92915050565b6000602082019050613f406000830184613398565b92915050565b6000602082019050613f5b60008301846133d8565b92915050565b6000602082019050613f7660008301846133e7565b92915050565b6000602082019050613f9160008301846133f6565b92915050565b60006020820190508181036000830152613fb18184613414565b905092915050565b60006020820190508181036000830152613fd28161344d565b9050919050565b60006020820190508181036000830152613ff28161348d565b9050919050565b60006020820190508181036000830152614012816134cd565b9050919050565b6000602082019050818103600083015261403281613533565b9050919050565b6000602082019050818103600083015261405281613573565b9050919050565b60006020820190508181036000830152614072816135b3565b9050919050565b6000602082019050818103600083015261409281613619565b9050919050565b600060208201905081810360008301526140b281613659565b9050919050565b600060208201905081810360008301526140d281613699565b9050919050565b600060208201905081810360008301526140f2816136d9565b9050919050565b6000602082019050818103600083015261411281613719565b9050919050565b6000602082019050818103600083015261413281613759565b9050919050565b60006020820190508181036000830152614152816137bf565b9050919050565b60006020820190508181036000830152614172816137ff565b9050919050565b600060208201905081810360008301526141928161383f565b9050919050565b600060208201905081810360008301526141b28161387f565b9050919050565b600060208201905081810360008301526141d2816138bf565b9050919050565b600060208201905081810360008301526141f2816138ff565b9050919050565b600060208201905081810360008301526142128161393f565b9050919050565b60006020820190508181036000830152614232816139a5565b9050919050565b60006020820190508181036000830152614252816139e5565b9050919050565b6000602082019050818103600083015261427281613a4b565b9050919050565b6000602082019050818103600083015261429281613a8b565b9050919050565b600060208201905081810360008301526142b281613acb565b9050919050565b600060208201905081810360008301526142d281613b0b565b9050919050565b600060208201905081810360008301526142f281613b4b565b9050919050565b6000602082019050818103600083015261431281613bb1565b9050919050565b6000602082019050818103600083015261433281613bf1565b9050919050565b6000602082019050818103600083015261435281613c31565b9050919050565b6000602082019050818103600083015261437281613c71565b9050919050565b6000602082019050818103600083015261439281613cb1565b9050919050565b600060208201905081810360008301526143b281613d17565b9050919050565b600060208201905081810360008301526143d281613d7d565b9050919050565b600060208201905081810360008301526143f281613dbd565b9050919050565b6000602082019050818103600083015261441281613dfd565b9050919050565b6000602082019050818103600083015261443281613e3d565b9050919050565b600060208201905061444e6000830184613e7d565b92915050565b6000604051905081810181811067ffffffffffffffff8211171561447b5761447a614609565b5b8060405250919050565b600067ffffffffffffffff8211156144a05761449f614609565b5b602082029050602081019050919050565b600081519050919050565b600081519050919050565b600081905092915050565b600082825260208201905092915050565b60006144ee82614540565b9050919050565b60008115159050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600081905061453b8261461c565b919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60006145758261457c565b9050919050565b600061458782614540565b9050919050565b6000614599826145a0565b9050919050565b60006145ab82614540565b9050919050565b60006145bd8261452d565b9050919050565b60006145cf82614560565b9050919050565b60005b838110156145f45780820151818401526020810190506145d9565b83811115614603576000848401525b50505050565bfe5b6000601f19601f8301169050919050565b6003811061462d5761462c614609565b5b50565b614639816144e3565b811461464457600080fd5b50565b614650816144f5565b811461465b57600080fd5b50565b6003811061466b57600080fd5b50565b61467781614560565b811461468257600080fd5b5056fea264697066735822122013f3b022e354ddf49f7a28727f309f858a5cbdf70833a2e54da3c1a482b7073164736f6c63430007030033", + "devdoc": { + "kind": "dev", + "methods": { + "acceptLock()": { + "details": "Can only be called by the beneficiary" + }, + "amountPerPeriod()": { + "returns": { + "_0": "Amount of tokens available after each period" + } + }, + "approveProtocol()": { + "details": "Approves all token destinations registered in the manager to pull tokens" + }, + "availableAmount()": { + "details": "Implements the step-by-step schedule based on periods for available tokens", + "returns": { + "_0": "Amount of tokens available according to the schedule" + } + }, + "cancelLock()": { + "details": "Can only be called by the owner" + }, + "changeBeneficiary(address)": { + "details": "Can only be called by the beneficiary", + "params": { + "_newBeneficiary": "Address of the new beneficiary address" + } + }, + "currentBalance()": { + "returns": { + "_0": "Tokens held in the contract" + } + }, + "currentPeriod()": { + "returns": { + "_0": "A number that represents the current period" + } + }, + "currentTime()": { + "returns": { + "_0": "Current block timestamp" + } + }, + "duration()": { + "returns": { + "_0": "Amount of seconds from contract startTime to endTime" + } + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "passedPeriods()": { + "returns": { + "_0": "A number of periods that passed since the schedule started" + } + }, + "periodDuration()": { + "returns": { + "_0": "Duration of each period in seconds" + } + }, + "releasableAmount()": { + "details": "Considers the schedule, takes into account already released tokens and used amount", + "returns": { + "_0": "Amount of tokens ready to be released" + } + }, + "release()": { + "details": "All available releasable tokens are transferred to beneficiary" + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." + }, + "revoke()": { + "details": "Vesting schedule is always calculated based on managed tokens" + }, + "revokeProtocol()": { + "details": "Revokes approval to all token destinations in the manager to pull tokens" + }, + "setManager(address)": { + "params": { + "_newManager": "Address of the new manager" + } + }, + "sinceStartTime()": { + "details": "Returns zero if called before conctract starTime", + "returns": { + "_0": "Seconds elapsed from contract startTime" + } + }, + "surplusAmount()": { + "details": "All funds over outstanding amount is considered surplus that can be withdrawn by beneficiary. Note this might not be the correct value for wallets transferred to L2 (i.e. an L2GraphTokenLockWallet), as the released amount will be skewed, so the beneficiary might have to bridge back to L1 to release the surplus.", + "returns": { + "_0": "Amount of tokens considered as surplus" + } + }, + "totalOutstandingAmount()": { + "details": "Does not consider schedule but just global amounts tracked", + "returns": { + "_0": "Amount of outstanding tokens for the lifetime of the contract" + } + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + }, + "vestedAmount()": { + "details": "Similar to available amount, but is fully vested when contract is non-revocable", + "returns": { + "_0": "Amount of tokens already vested" + } + }, + "withdrawSurplus(uint256)": { + "details": "Tokens in the contract over outstanding amount are considered as surplus", + "params": { + "_amount": "Amount of tokens to withdraw" + } + } + }, + "title": "GraphTokenLockWallet", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "acceptLock()": { + "notice": "Beneficiary accepts the lock, the owner cannot retrieve back the tokens" + }, + "amountPerPeriod()": { + "notice": "Returns amount available to be released after each period according to schedule" + }, + "approveProtocol()": { + "notice": "Approves protocol access of the tokens managed by this contract" + }, + "availableAmount()": { + "notice": "Gets the currently available token according to the schedule" + }, + "cancelLock()": { + "notice": "Owner cancel the lock and return the balance in the contract" + }, + "changeBeneficiary(address)": { + "notice": "Change the beneficiary of funds managed by the contract" + }, + "currentBalance()": { + "notice": "Returns the amount of tokens currently held by the contract" + }, + "currentPeriod()": { + "notice": "Gets the current period based on the schedule" + }, + "currentTime()": { + "notice": "Returns the current block timestamp" + }, + "duration()": { + "notice": "Gets duration of contract from start to end in seconds" + }, + "passedPeriods()": { + "notice": "Gets the number of periods that passed since the first period" + }, + "periodDuration()": { + "notice": "Returns the duration of each period in seconds" + }, + "releasableAmount()": { + "notice": "Gets tokens currently available for release" + }, + "release()": { + "notice": "Releases tokens based on the configured schedule" + }, + "revoke()": { + "notice": "Revokes a vesting schedule and return the unvested tokens to the owner" + }, + "revokeProtocol()": { + "notice": "Revokes protocol access of the tokens managed by this contract" + }, + "setManager(address)": { + "notice": "Sets a new manager for this contract" + }, + "sinceStartTime()": { + "notice": "Gets time elapsed since the start of the contract" + }, + "surplusAmount()": { + "notice": "Gets surplus amount in the contract based on outstanding amount to release" + }, + "totalOutstandingAmount()": { + "notice": "Gets the outstanding amount yet to be released based on the whole contract lifetime" + }, + "vestedAmount()": { + "notice": "Gets the amount of currently vested tokens" + }, + "withdrawSurplus(uint256)": { + "notice": "Withdraws surplus, unmanaged tokens from the contract" + } + }, + "notice": "This contract is built on top of the base GraphTokenLock functionality. It allows wallet beneficiaries to use the deposited funds to perform specific function calls on specific contracts. The idea is that supporters with locked tokens can participate in the protocol but disallow any release before the vesting/lock schedule. The beneficiary can issue authorized function calls to this contract that will get forwarded to a target contract. A target contract is any of our protocol contracts. The function calls allowed are queried to the GraphTokenLockManager, this way the same configuration can be shared for all the created lock wallet contracts. NOTE: Contracts used as target must have its function signatures checked to avoid collisions with any of this contract functions. Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience the maximum amount of tokens is authorized. Function calls do not forward ETH value so DO NOT SEND ETH TO THIS CONTRACT.", + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 6797, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "_owner", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 6802, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 3244, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "token", + "offset": 0, + "slot": "51", + "type": "t_contract(IERC20)1710" + }, + { + "astId": 3246, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "beneficiary", + "offset": 0, + "slot": "52", + "type": "t_address" + }, + { + "astId": 3248, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "managedAmount", + "offset": 0, + "slot": "53", + "type": "t_uint256" + }, + { + "astId": 3250, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "startTime", + "offset": 0, + "slot": "54", + "type": "t_uint256" + }, + { + "astId": 3252, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "endTime", + "offset": 0, + "slot": "55", + "type": "t_uint256" + }, + { + "astId": 3254, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "periods", + "offset": 0, + "slot": "56", + "type": "t_uint256" + }, + { + "astId": 3256, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "releaseStartTime", + "offset": 0, + "slot": "57", + "type": "t_uint256" + }, + { + "astId": 3258, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "vestingCliffTime", + "offset": 0, + "slot": "58", + "type": "t_uint256" + }, + { + "astId": 3260, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "revocable", + "offset": 0, + "slot": "59", + "type": "t_enum(Revocability)5096" + }, + { + "astId": 3262, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "isRevoked", + "offset": 1, + "slot": "59", + "type": "t_bool" + }, + { + "astId": 3264, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "isInitialized", + "offset": 2, + "slot": "59", + "type": "t_bool" + }, + { + "astId": 3266, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "isAccepted", + "offset": 3, + "slot": "59", + "type": "t_bool" + }, + { + "astId": 3268, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "releasedAmount", + "offset": 0, + "slot": "60", + "type": "t_uint256" + }, + { + "astId": 3270, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "revokedAmount", + "offset": 0, + "slot": "61", + "type": "t_uint256" + }, + { + "astId": 4692, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "manager", + "offset": 0, + "slot": "62", + "type": "t_contract(IGraphTokenLockManager)5278" + }, + { + "astId": 4694, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "usedAmount", + "offset": 0, + "slot": "63", + "type": "t_uint256" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)50_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_contract(IERC20)1710": { + "encoding": "inplace", + "label": "contract IERC20", + "numberOfBytes": "20" + }, + "t_contract(IGraphTokenLockManager)5278": { + "encoding": "inplace", + "label": "contract IGraphTokenLockManager", + "numberOfBytes": "20" + }, + "t_enum(Revocability)5096": { + "encoding": "inplace", + "label": "enum IGraphTokenLock.Revocability", + "numberOfBytes": "1" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} \ No newline at end of file diff --git a/packages/token-distribution/deployments/mainnet/GraphTokenLockWallet-Migrations.json b/packages/token-distribution/deployments/mainnet/GraphTokenLockWallet-Migrations.json new file mode 100644 index 000000000..04fbb9bc1 --- /dev/null +++ b/packages/token-distribution/deployments/mainnet/GraphTokenLockWallet-Migrations.json @@ -0,0 +1,1083 @@ +{ + "address": "0xec188A659fD9e3CAAD5b14011a18B9F214D54eab", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "newBeneficiary", + "type": "address" + } + ], + "name": "BeneficiaryChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "LockAccepted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "LockCanceled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_oldManager", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "_newManager", + "type": "address" + } + ], + "name": "ManagerUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "TokenDestinationsApproved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "TokenDestinationsRevoked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensReleased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensRevoked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensWithdrawn", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "acceptLock", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "amountPerPeriod", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "approveProtocol", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "availableAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "beneficiary", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "cancelLock", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newBeneficiary", + "type": "address" + } + ], + "name": "changeBeneficiary", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "currentBalance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "currentPeriod", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "currentTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "duration", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "endTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_manager", + "type": "address" + }, + { + "internalType": "address", + "name": "_owner", + "type": "address" + }, + { + "internalType": "address", + "name": "_beneficiary", + "type": "address" + }, + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_managedAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_startTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_endTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_periods", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_releaseStartTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_vestingCliffTime", + "type": "uint256" + }, + { + "internalType": "enum IGraphTokenLock.Revocability", + "name": "_revocable", + "type": "uint8" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "isAccepted", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isInitialized", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isRevoked", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "managedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "manager", + "outputs": [ + { + "internalType": "contract IGraphTokenLockManager", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "passedPeriods", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "periodDuration", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "periods", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "releasableAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "release", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "releaseStartTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "releasedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "revocable", + "outputs": [ + { + "internalType": "enum IGraphTokenLock.Revocability", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "revoke", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "revokeProtocol", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "revokedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newManager", + "type": "address" + } + ], + "name": "setManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "sinceStartTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "startTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "surplusAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "token", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalOutstandingAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "usedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "vestedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "vestingCliffTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "withdrawSurplus", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x50955fbf0ff322d6d02653de2eb1ad23c71c8dfb8a148d2722e6884d7e5d18ae", + "receipt": { + "to": null, + "from": "0xE04FcE05E9B8d21521bd1B0f069982c03BD31F76", + "contractAddress": "0xec188A659fD9e3CAAD5b14011a18B9F214D54eab", + "transactionIndex": 97, + "gasUsed": "3482943", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xa33bf934c87da2722bcccab74829772062b90b575ddc86acd3b0b0d00a32f439", + "transactionHash": "0x50955fbf0ff322d6d02653de2eb1ad23c71c8dfb8a148d2722e6884d7e5d18ae", + "logs": [], + "blockNumber": 16477319, + "cumulativeGasUsed": "10861131", + "status": 1, + "byzantium": true + }, + "args": [], + "solcInputHash": "6f5e8f450f52dd96ebb796aa6620fee9", + "metadata": "{\"compiler\":{\"version\":\"0.7.3+commit.9bfce1f6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newBeneficiary\",\"type\":\"address\"}],\"name\":\"BeneficiaryChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"LockAccepted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"LockCanceled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_oldManager\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_newManager\",\"type\":\"address\"}],\"name\":\"ManagerUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"TokenDestinationsApproved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"TokenDestinationsRevoked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensReleased\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensRevoked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensWithdrawn\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"acceptLock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"amountPerPeriod\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"approveProtocol\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"availableAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"beneficiary\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"cancelLock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_newBeneficiary\",\"type\":\"address\"}],\"name\":\"changeBeneficiary\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"currentBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"currentPeriod\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"currentTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"duration\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"endTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_manager\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_beneficiary\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_managedAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_startTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_endTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_periods\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_releaseStartTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_vestingCliffTime\",\"type\":\"uint256\"},{\"internalType\":\"enum IGraphTokenLock.Revocability\",\"name\":\"_revocable\",\"type\":\"uint8\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isAccepted\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isInitialized\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isRevoked\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"managedAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"manager\",\"outputs\":[{\"internalType\":\"contract IGraphTokenLockManager\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"passedPeriods\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"periodDuration\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"periods\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"releasableAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"release\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"releaseStartTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"releasedAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"revocable\",\"outputs\":[{\"internalType\":\"enum IGraphTokenLock.Revocability\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"revoke\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"revokeProtocol\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"revokedAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_newManager\",\"type\":\"address\"}],\"name\":\"setManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"sinceStartTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"startTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"surplusAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalOutstandingAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"usedAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"vestedAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"vestingCliffTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdrawSurplus\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"acceptLock()\":{\"details\":\"Can only be called by the beneficiary\"},\"amountPerPeriod()\":{\"returns\":{\"_0\":\"Amount of tokens available after each period\"}},\"approveProtocol()\":{\"details\":\"Approves all token destinations registered in the manager to pull tokens\"},\"availableAmount()\":{\"details\":\"Implements the step-by-step schedule based on periods for available tokens\",\"returns\":{\"_0\":\"Amount of tokens available according to the schedule\"}},\"cancelLock()\":{\"details\":\"Can only be called by the owner\"},\"changeBeneficiary(address)\":{\"details\":\"Can only be called by the beneficiary\",\"params\":{\"_newBeneficiary\":\"Address of the new beneficiary address\"}},\"currentBalance()\":{\"returns\":{\"_0\":\"Tokens held in the contract\"}},\"currentPeriod()\":{\"returns\":{\"_0\":\"A number that represents the current period\"}},\"currentTime()\":{\"returns\":{\"_0\":\"Current block timestamp\"}},\"duration()\":{\"returns\":{\"_0\":\"Amount of seconds from contract startTime to endTime\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"passedPeriods()\":{\"returns\":{\"_0\":\"A number of periods that passed since the schedule started\"}},\"periodDuration()\":{\"returns\":{\"_0\":\"Duration of each period in seconds\"}},\"releasableAmount()\":{\"details\":\"Considers the schedule, takes into account already released tokens and used amount\",\"returns\":{\"_0\":\"Amount of tokens ready to be released\"}},\"release()\":{\"details\":\"All available releasable tokens are transferred to beneficiary\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"revoke()\":{\"details\":\"Vesting schedule is always calculated based on managed tokens\"},\"revokeProtocol()\":{\"details\":\"Revokes approval to all token destinations in the manager to pull tokens\"},\"setManager(address)\":{\"params\":{\"_newManager\":\"Address of the new manager\"}},\"sinceStartTime()\":{\"details\":\"Returns zero if called before conctract starTime\",\"returns\":{\"_0\":\"Seconds elapsed from contract startTime\"}},\"surplusAmount()\":{\"details\":\"All funds over outstanding amount is considered surplus that can be withdrawn by beneficiary\",\"returns\":{\"_0\":\"Amount of tokens considered as surplus\"}},\"totalOutstandingAmount()\":{\"details\":\"Does not consider schedule but just global amounts tracked\",\"returns\":{\"_0\":\"Amount of outstanding tokens for the lifetime of the contract\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"vestedAmount()\":{\"details\":\"Similar to available amount, but is fully vested when contract is non-revocable\",\"returns\":{\"_0\":\"Amount of tokens already vested\"}},\"withdrawSurplus(uint256)\":{\"details\":\"Tokens in the contract over outstanding amount are considered as surplus\",\"params\":{\"_amount\":\"Amount of tokens to withdraw\"}}},\"title\":\"GraphTokenLockWallet\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"acceptLock()\":{\"notice\":\"Beneficiary accepts the lock, the owner cannot retrieve back the tokens\"},\"amountPerPeriod()\":{\"notice\":\"Returns amount available to be released after each period according to schedule\"},\"approveProtocol()\":{\"notice\":\"Approves protocol access of the tokens managed by this contract\"},\"availableAmount()\":{\"notice\":\"Gets the currently available token according to the schedule\"},\"cancelLock()\":{\"notice\":\"Owner cancel the lock and return the balance in the contract\"},\"changeBeneficiary(address)\":{\"notice\":\"Change the beneficiary of funds managed by the contract\"},\"currentBalance()\":{\"notice\":\"Returns the amount of tokens currently held by the contract\"},\"currentPeriod()\":{\"notice\":\"Gets the current period based on the schedule\"},\"currentTime()\":{\"notice\":\"Returns the current block timestamp\"},\"duration()\":{\"notice\":\"Gets duration of contract from start to end in seconds\"},\"passedPeriods()\":{\"notice\":\"Gets the number of periods that passed since the first period\"},\"periodDuration()\":{\"notice\":\"Returns the duration of each period in seconds\"},\"releasableAmount()\":{\"notice\":\"Gets tokens currently available for release\"},\"release()\":{\"notice\":\"Releases tokens based on the configured schedule\"},\"revoke()\":{\"notice\":\"Revokes a vesting schedule and return the unvested tokens to the owner\"},\"revokeProtocol()\":{\"notice\":\"Revokes protocol access of the tokens managed by this contract\"},\"setManager(address)\":{\"notice\":\"Sets a new manager for this contract\"},\"sinceStartTime()\":{\"notice\":\"Gets time elapsed since the start of the contract\"},\"surplusAmount()\":{\"notice\":\"Gets surplus amount in the contract based on outstanding amount to release\"},\"totalOutstandingAmount()\":{\"notice\":\"Gets the outstanding amount yet to be released based on the whole contract lifetime\"},\"vestedAmount()\":{\"notice\":\"Gets the amount of currently vested tokens\"},\"withdrawSurplus(uint256)\":{\"notice\":\"Withdraws surplus, unmanaged tokens from the contract\"}},\"notice\":\"This contract is built on top of the base GraphTokenLock functionality. It allows wallet beneficiaries to use the deposited funds to perform specific function calls on specific contracts. The idea is that supporters with locked tokens can participate in the protocol but disallow any release before the vesting/lock schedule. The beneficiary can issue authorized function calls to this contract that will get forwarded to a target contract. A target contract is any of our protocol contracts. The function calls allowed are queried to the GraphTokenLockManager, this way the same configuration can be shared for all the created lock wallet contracts. NOTE: Contracts used as target must have its function signatures checked to avoid collisions with any of this contract functions. Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience the maximum amount of tokens is authorized.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/GraphTokenLockWallet.sol\":\"GraphTokenLockWallet\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/math/SafeMath.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Wrappers over Solidity's arithmetic operations with added overflow\\n * checks.\\n *\\n * Arithmetic operations in Solidity wrap on overflow. This can easily result\\n * in bugs, because programmers usually assume that an overflow raises an\\n * error, which is the standard behavior in high level programming languages.\\n * `SafeMath` restores this intuition by reverting the transaction when an\\n * operation overflows.\\n *\\n * Using this library instead of the unchecked operations eliminates an entire\\n * class of bugs, so it's recommended to use it always.\\n */\\nlibrary SafeMath {\\n /**\\n * @dev Returns the addition of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n uint256 c = a + b;\\n if (c < a) return (false, 0);\\n return (true, c);\\n }\\n\\n /**\\n * @dev Returns the substraction of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b > a) return (false, 0);\\n return (true, a - b);\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\\n if (a == 0) return (true, 0);\\n uint256 c = a * b;\\n if (c / a != b) return (false, 0);\\n return (true, c);\\n }\\n\\n /**\\n * @dev Returns the division of two unsigned integers, with a division by zero flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b == 0) return (false, 0);\\n return (true, a / b);\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b == 0) return (false, 0);\\n return (true, a % b);\\n }\\n\\n /**\\n * @dev Returns the addition of two unsigned integers, reverting on\\n * overflow.\\n *\\n * Counterpart to Solidity's `+` operator.\\n *\\n * Requirements:\\n *\\n * - Addition cannot overflow.\\n */\\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\\n uint256 c = a + b;\\n require(c >= a, \\\"SafeMath: addition overflow\\\");\\n return c;\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting on\\n * overflow (when the result is negative).\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n *\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b <= a, \\\"SafeMath: subtraction overflow\\\");\\n return a - b;\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, reverting on\\n * overflow.\\n *\\n * Counterpart to Solidity's `*` operator.\\n *\\n * Requirements:\\n *\\n * - Multiplication cannot overflow.\\n */\\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\\n if (a == 0) return 0;\\n uint256 c = a * b;\\n require(c / a == b, \\\"SafeMath: multiplication overflow\\\");\\n return c;\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers, reverting on\\n * division by zero. The result is rounded towards zero.\\n *\\n * Counterpart to Solidity's `/` operator. Note: this function uses a\\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\\n * uses an invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b > 0, \\\"SafeMath: division by zero\\\");\\n return a / b;\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * reverting when dividing by zero.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b > 0, \\\"SafeMath: modulo by zero\\\");\\n return a % b;\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\\n * overflow (when the result is negative).\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {trySub}.\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n *\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b <= a, errorMessage);\\n return a - b;\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers, reverting with custom message on\\n * division by zero. The result is rounded towards zero.\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {tryDiv}.\\n *\\n * Counterpart to Solidity's `/` operator. Note: this function uses a\\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\\n * uses an invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b > 0, errorMessage);\\n return a / b;\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * reverting with custom message when dividing by zero.\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {tryMod}.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b > 0, errorMessage);\\n return a % b;\\n }\\n}\\n\",\"keccak256\":\"0xcc78a17dd88fa5a2edc60c8489e2f405c0913b377216a5b26b35656b2d0dab52\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `recipient`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address recipient, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `sender` to `recipient` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n}\\n\",\"keccak256\":\"0x5f02220344881ce43204ae4a6281145a67bc52c2bb1290a791857df3d19d78f5\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\nimport \\\"./IERC20.sol\\\";\\nimport \\\"../../math/SafeMath.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @title SafeERC20\\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\\n * contract returns false). Tokens that return no value (and instead revert or\\n * throw on failure) are also supported, non-reverting calls are assumed to be\\n * successful.\\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\n */\\nlibrary SafeERC20 {\\n using SafeMath for uint256;\\n using Address for address;\\n\\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\\n }\\n\\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\\n }\\n\\n /**\\n * @dev Deprecated. This function has issues similar to the ones found in\\n * {IERC20-approve}, and its usage is discouraged.\\n *\\n * Whenever possible, use {safeIncreaseAllowance} and\\n * {safeDecreaseAllowance} instead.\\n */\\n function safeApprove(IERC20 token, address spender, uint256 value) internal {\\n // safeApprove should only be called when setting an initial allowance,\\n // or when resetting it to zero. To increase and decrease it, use\\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\\n // solhint-disable-next-line max-line-length\\n require((value == 0) || (token.allowance(address(this), spender) == 0),\\n \\\"SafeERC20: approve from non-zero to non-zero allowance\\\"\\n );\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\\n }\\n\\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n uint256 newAllowance = token.allowance(address(this), spender).add(value);\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n uint256 newAllowance = token.allowance(address(this), spender).sub(value, \\\"SafeERC20: decreased allowance below zero\\\");\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n */\\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that\\n // the target address contains contract code and also asserts for success in the low-level call.\\n\\n bytes memory returndata = address(token).functionCall(data, \\\"SafeERC20: low-level call failed\\\");\\n if (returndata.length > 0) { // Return data is optional\\n // solhint-disable-next-line max-line-length\\n require(abi.decode(returndata, (bool)), \\\"SafeERC20: ERC20 operation did not succeed\\\");\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf12dfbe97e6276980b83d2830bb0eb75e0cf4f3e626c2471137f82158ae6a0fc\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.2 <0.8.0;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize, which returns 0 for contracts in\\n // construction, since the code is only stored at the end of the\\n // constructor execution.\\n\\n uint256 size;\\n // solhint-disable-next-line no-inline-assembly\\n assembly { size := extcodesize(account) }\\n return size > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls, avoid-call-value\\n (bool success, ) = recipient.call{ value: amount }(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain`call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.call{ value: value }(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x28911e614500ae7c607a432a709d35da25f3bc5ddc8bd12b278b66358070c0ea\",\"license\":\"MIT\"},\"contracts/GraphTokenLock.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nimport \\\"@openzeppelin/contracts/math/SafeMath.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\\\";\\n\\nimport \\\"./Ownable.sol\\\";\\nimport \\\"./MathUtils.sol\\\";\\nimport \\\"./IGraphTokenLock.sol\\\";\\n\\n/**\\n * @title GraphTokenLock\\n * @notice Contract that manages an unlocking schedule of tokens.\\n * @dev The contract lock manage a number of tokens deposited into the contract to ensure that\\n * they can only be released under certain time conditions.\\n *\\n * This contract implements a release scheduled based on periods and tokens are released in steps\\n * after each period ends. It can be configured with one period in which case it is like a plain TimeLock.\\n * It also supports revocation to be used for vesting schedules.\\n *\\n * The contract supports receiving extra funds than the managed tokens ones that can be\\n * withdrawn by the beneficiary at any time.\\n *\\n * A releaseStartTime parameter is included to override the default release schedule and\\n * perform the first release on the configured time. After that it will continue with the\\n * default schedule.\\n */\\nabstract contract GraphTokenLock is Ownable, IGraphTokenLock {\\n using SafeMath for uint256;\\n using SafeERC20 for IERC20;\\n\\n uint256 private constant MIN_PERIOD = 1;\\n\\n // -- State --\\n\\n IERC20 public token;\\n address public beneficiary;\\n\\n // Configuration\\n\\n // Amount of tokens managed by the contract schedule\\n uint256 public managedAmount;\\n\\n uint256 public startTime; // Start datetime (in unixtimestamp)\\n uint256 public endTime; // Datetime after all funds are fully vested/unlocked (in unixtimestamp)\\n uint256 public periods; // Number of vesting/release periods\\n\\n // First release date for tokens (in unixtimestamp)\\n // If set, no tokens will be released before releaseStartTime ignoring\\n // the amount to release each period\\n uint256 public releaseStartTime;\\n // A cliff set a date to which a beneficiary needs to get to vest\\n // all preceding periods\\n uint256 public vestingCliffTime;\\n Revocability public revocable; // Whether to use vesting for locked funds\\n\\n // State\\n\\n bool public isRevoked;\\n bool public isInitialized;\\n bool public isAccepted;\\n uint256 public releasedAmount;\\n uint256 public revokedAmount;\\n\\n // -- Events --\\n\\n event TokensReleased(address indexed beneficiary, uint256 amount);\\n event TokensWithdrawn(address indexed beneficiary, uint256 amount);\\n event TokensRevoked(address indexed beneficiary, uint256 amount);\\n event BeneficiaryChanged(address newBeneficiary);\\n event LockAccepted();\\n event LockCanceled();\\n\\n /**\\n * @dev Only allow calls from the beneficiary of the contract\\n */\\n modifier onlyBeneficiary() {\\n require(msg.sender == beneficiary, \\\"!auth\\\");\\n _;\\n }\\n\\n /**\\n * @notice Initializes the contract\\n * @param _owner Address of the contract owner\\n * @param _beneficiary Address of the beneficiary of locked tokens\\n * @param _managedAmount Amount of tokens to be managed by the lock contract\\n * @param _startTime Start time of the release schedule\\n * @param _endTime End time of the release schedule\\n * @param _periods Number of periods between start time and end time\\n * @param _releaseStartTime Override time for when the releases start\\n * @param _vestingCliffTime Override time for when the vesting start\\n * @param _revocable Whether the contract is revocable\\n */\\n function _initialize(\\n address _owner,\\n address _beneficiary,\\n address _token,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n Revocability _revocable\\n ) internal {\\n require(!isInitialized, \\\"Already initialized\\\");\\n require(_owner != address(0), \\\"Owner cannot be zero\\\");\\n require(_beneficiary != address(0), \\\"Beneficiary cannot be zero\\\");\\n require(_token != address(0), \\\"Token cannot be zero\\\");\\n require(_managedAmount > 0, \\\"Managed tokens cannot be zero\\\");\\n require(_startTime != 0, \\\"Start time must be set\\\");\\n require(_startTime < _endTime, \\\"Start time > end time\\\");\\n require(_periods >= MIN_PERIOD, \\\"Periods cannot be below minimum\\\");\\n require(_revocable != Revocability.NotSet, \\\"Must set a revocability option\\\");\\n require(_releaseStartTime < _endTime, \\\"Release start time must be before end time\\\");\\n require(_vestingCliffTime < _endTime, \\\"Cliff time must be before end time\\\");\\n\\n isInitialized = true;\\n\\n Ownable.initialize(_owner);\\n beneficiary = _beneficiary;\\n token = IERC20(_token);\\n\\n managedAmount = _managedAmount;\\n\\n startTime = _startTime;\\n endTime = _endTime;\\n periods = _periods;\\n\\n // Optionals\\n releaseStartTime = _releaseStartTime;\\n vestingCliffTime = _vestingCliffTime;\\n revocable = _revocable;\\n }\\n\\n /**\\n * @notice Change the beneficiary of funds managed by the contract\\n * @dev Can only be called by the beneficiary\\n * @param _newBeneficiary Address of the new beneficiary address\\n */\\n function changeBeneficiary(address _newBeneficiary) external onlyBeneficiary {\\n require(_newBeneficiary != address(0), \\\"Empty beneficiary\\\");\\n beneficiary = _newBeneficiary;\\n emit BeneficiaryChanged(_newBeneficiary);\\n }\\n\\n /**\\n * @notice Beneficiary accepts the lock, the owner cannot retrieve back the tokens\\n * @dev Can only be called by the beneficiary\\n */\\n function acceptLock() external onlyBeneficiary {\\n isAccepted = true;\\n emit LockAccepted();\\n }\\n\\n /**\\n * @notice Owner cancel the lock and return the balance in the contract\\n * @dev Can only be called by the owner\\n */\\n function cancelLock() external onlyOwner {\\n require(isAccepted == false, \\\"Cannot cancel accepted contract\\\");\\n\\n token.safeTransfer(owner(), currentBalance());\\n\\n emit LockCanceled();\\n }\\n\\n // -- Balances --\\n\\n /**\\n * @notice Returns the amount of tokens currently held by the contract\\n * @return Tokens held in the contract\\n */\\n function currentBalance() public view override returns (uint256) {\\n return token.balanceOf(address(this));\\n }\\n\\n // -- Time & Periods --\\n\\n /**\\n * @notice Returns the current block timestamp\\n * @return Current block timestamp\\n */\\n function currentTime() public view override returns (uint256) {\\n return block.timestamp;\\n }\\n\\n /**\\n * @notice Gets duration of contract from start to end in seconds\\n * @return Amount of seconds from contract startTime to endTime\\n */\\n function duration() public view override returns (uint256) {\\n return endTime.sub(startTime);\\n }\\n\\n /**\\n * @notice Gets time elapsed since the start of the contract\\n * @dev Returns zero if called before conctract starTime\\n * @return Seconds elapsed from contract startTime\\n */\\n function sinceStartTime() public view override returns (uint256) {\\n uint256 current = currentTime();\\n if (current <= startTime) {\\n return 0;\\n }\\n return current.sub(startTime);\\n }\\n\\n /**\\n * @notice Returns amount available to be released after each period according to schedule\\n * @return Amount of tokens available after each period\\n */\\n function amountPerPeriod() public view override returns (uint256) {\\n return managedAmount.div(periods);\\n }\\n\\n /**\\n * @notice Returns the duration of each period in seconds\\n * @return Duration of each period in seconds\\n */\\n function periodDuration() public view override returns (uint256) {\\n return duration().div(periods);\\n }\\n\\n /**\\n * @notice Gets the current period based on the schedule\\n * @return A number that represents the current period\\n */\\n function currentPeriod() public view override returns (uint256) {\\n return sinceStartTime().div(periodDuration()).add(MIN_PERIOD);\\n }\\n\\n /**\\n * @notice Gets the number of periods that passed since the first period\\n * @return A number of periods that passed since the schedule started\\n */\\n function passedPeriods() public view override returns (uint256) {\\n return currentPeriod().sub(MIN_PERIOD);\\n }\\n\\n // -- Locking & Release Schedule --\\n\\n /**\\n * @notice Gets the currently available token according to the schedule\\n * @dev Implements the step-by-step schedule based on periods for available tokens\\n * @return Amount of tokens available according to the schedule\\n */\\n function availableAmount() public view override returns (uint256) {\\n uint256 current = currentTime();\\n\\n // Before contract start no funds are available\\n if (current < startTime) {\\n return 0;\\n }\\n\\n // After contract ended all funds are available\\n if (current > endTime) {\\n return managedAmount;\\n }\\n\\n // Get available amount based on period\\n return passedPeriods().mul(amountPerPeriod());\\n }\\n\\n /**\\n * @notice Gets the amount of currently vested tokens\\n * @dev Similar to available amount, but is fully vested when contract is non-revocable\\n * @return Amount of tokens already vested\\n */\\n function vestedAmount() public view override returns (uint256) {\\n // If non-revocable it is fully vested\\n if (revocable == Revocability.Disabled) {\\n return managedAmount;\\n }\\n\\n // Vesting cliff is activated and it has not passed means nothing is vested yet\\n if (vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\\n return 0;\\n }\\n\\n return availableAmount();\\n }\\n\\n /**\\n * @notice Gets tokens currently available for release\\n * @dev Considers the schedule and takes into account already released tokens\\n * @return Amount of tokens ready to be released\\n */\\n function releasableAmount() public view virtual override returns (uint256) {\\n // If a release start time is set no tokens are available for release before this date\\n // If not set it follows the default schedule and tokens are available on\\n // the first period passed\\n if (releaseStartTime > 0 && currentTime() < releaseStartTime) {\\n return 0;\\n }\\n\\n // Vesting cliff is activated and it has not passed means nothing is vested yet\\n // so funds cannot be released\\n if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\\n return 0;\\n }\\n\\n // A beneficiary can never have more releasable tokens than the contract balance\\n uint256 releasable = availableAmount().sub(releasedAmount);\\n return MathUtils.min(currentBalance(), releasable);\\n }\\n\\n /**\\n * @notice Gets the outstanding amount yet to be released based on the whole contract lifetime\\n * @dev Does not consider schedule but just global amounts tracked\\n * @return Amount of outstanding tokens for the lifetime of the contract\\n */\\n function totalOutstandingAmount() public view override returns (uint256) {\\n return managedAmount.sub(releasedAmount).sub(revokedAmount);\\n }\\n\\n /**\\n * @notice Gets surplus amount in the contract based on outstanding amount to release\\n * @dev All funds over outstanding amount is considered surplus that can be withdrawn by beneficiary\\n * @return Amount of tokens considered as surplus\\n */\\n function surplusAmount() public view override returns (uint256) {\\n uint256 balance = currentBalance();\\n uint256 outstandingAmount = totalOutstandingAmount();\\n if (balance > outstandingAmount) {\\n return balance.sub(outstandingAmount);\\n }\\n return 0;\\n }\\n\\n // -- Value Transfer --\\n\\n /**\\n * @notice Releases tokens based on the configured schedule\\n * @dev All available releasable tokens are transferred to beneficiary\\n */\\n function release() external override onlyBeneficiary {\\n uint256 amountToRelease = releasableAmount();\\n require(amountToRelease > 0, \\\"No available releasable amount\\\");\\n\\n releasedAmount = releasedAmount.add(amountToRelease);\\n\\n token.safeTransfer(beneficiary, amountToRelease);\\n\\n emit TokensReleased(beneficiary, amountToRelease);\\n }\\n\\n /**\\n * @notice Withdraws surplus, unmanaged tokens from the contract\\n * @dev Tokens in the contract over outstanding amount are considered as surplus\\n * @param _amount Amount of tokens to withdraw\\n */\\n function withdrawSurplus(uint256 _amount) external override onlyBeneficiary {\\n require(_amount > 0, \\\"Amount cannot be zero\\\");\\n require(surplusAmount() >= _amount, \\\"Amount requested > surplus available\\\");\\n\\n token.safeTransfer(beneficiary, _amount);\\n\\n emit TokensWithdrawn(beneficiary, _amount);\\n }\\n\\n /**\\n * @notice Revokes a vesting schedule and return the unvested tokens to the owner\\n * @dev Vesting schedule is always calculated based on managed tokens\\n */\\n function revoke() external override onlyOwner {\\n require(revocable == Revocability.Enabled, \\\"Contract is non-revocable\\\");\\n require(isRevoked == false, \\\"Already revoked\\\");\\n\\n uint256 unvestedAmount = managedAmount.sub(vestedAmount());\\n require(unvestedAmount > 0, \\\"No available unvested amount\\\");\\n\\n revokedAmount = unvestedAmount;\\n isRevoked = true;\\n\\n token.safeTransfer(owner(), unvestedAmount);\\n\\n emit TokensRevoked(beneficiary, unvestedAmount);\\n }\\n}\\n\",\"keccak256\":\"0x21a1dae4105ba9ff6d9bc38bf983ee853976346562fa284f4b67a3c7ca91a2bf\",\"license\":\"MIT\"},\"contracts/GraphTokenLockWallet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"@openzeppelin/contracts/math/SafeMath.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\\\";\\n\\nimport \\\"./GraphTokenLock.sol\\\";\\nimport \\\"./IGraphTokenLockManager.sol\\\";\\n\\n/**\\n * @title GraphTokenLockWallet\\n * @notice This contract is built on top of the base GraphTokenLock functionality.\\n * It allows wallet beneficiaries to use the deposited funds to perform specific function calls\\n * on specific contracts.\\n *\\n * The idea is that supporters with locked tokens can participate in the protocol\\n * but disallow any release before the vesting/lock schedule.\\n * The beneficiary can issue authorized function calls to this contract that will\\n * get forwarded to a target contract. A target contract is any of our protocol contracts.\\n * The function calls allowed are queried to the GraphTokenLockManager, this way\\n * the same configuration can be shared for all the created lock wallet contracts.\\n *\\n * NOTE: Contracts used as target must have its function signatures checked to avoid collisions\\n * with any of this contract functions.\\n * Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience\\n * the maximum amount of tokens is authorized.\\n */\\ncontract GraphTokenLockWallet is GraphTokenLock {\\n using SafeMath for uint256;\\n using SafeERC20 for IERC20;\\n\\n // -- State --\\n\\n IGraphTokenLockManager public manager;\\n uint256 public usedAmount;\\n\\n uint256 private constant MAX_UINT256 = 2**256 - 1;\\n\\n // -- Events --\\n\\n event ManagerUpdated(address indexed _oldManager, address indexed _newManager);\\n event TokenDestinationsApproved();\\n event TokenDestinationsRevoked();\\n\\n // Initializer\\n function initialize(\\n address _manager,\\n address _owner,\\n address _beneficiary,\\n address _token,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n Revocability _revocable\\n ) external {\\n _initialize(\\n _owner,\\n _beneficiary,\\n _token,\\n _managedAmount,\\n _startTime,\\n _endTime,\\n _periods,\\n _releaseStartTime,\\n _vestingCliffTime,\\n _revocable\\n );\\n _setManager(_manager);\\n }\\n\\n // -- Admin --\\n\\n /**\\n * @notice Sets a new manager for this contract\\n * @param _newManager Address of the new manager\\n */\\n function setManager(address _newManager) external onlyOwner {\\n _setManager(_newManager);\\n }\\n\\n /**\\n * @dev Sets a new manager for this contract\\n * @param _newManager Address of the new manager\\n */\\n function _setManager(address _newManager) private {\\n require(_newManager != address(0), \\\"Manager cannot be empty\\\");\\n require(Address.isContract(_newManager), \\\"Manager must be a contract\\\");\\n\\n address oldManager = address(manager);\\n manager = IGraphTokenLockManager(_newManager);\\n\\n emit ManagerUpdated(oldManager, _newManager);\\n }\\n\\n // -- Beneficiary --\\n\\n /**\\n * @notice Approves protocol access of the tokens managed by this contract\\n * @dev Approves all token destinations registered in the manager to pull tokens\\n */\\n function approveProtocol() external onlyBeneficiary {\\n address[] memory dstList = manager.getTokenDestinations();\\n for (uint256 i = 0; i < dstList.length; i++) {\\n token.safeApprove(dstList[i], MAX_UINT256);\\n }\\n emit TokenDestinationsApproved();\\n }\\n\\n /**\\n * @notice Revokes protocol access of the tokens managed by this contract\\n * @dev Revokes approval to all token destinations in the manager to pull tokens\\n */\\n function revokeProtocol() external onlyBeneficiary {\\n address[] memory dstList = manager.getTokenDestinations();\\n for (uint256 i = 0; i < dstList.length; i++) {\\n token.safeApprove(dstList[i], 0);\\n }\\n emit TokenDestinationsRevoked();\\n }\\n\\n /**\\n * @notice Gets tokens currently available for release\\n * @dev Considers the schedule, takes into account already released tokens and used amount\\n * @return Amount of tokens ready to be released\\n */\\n function releasableAmount() public view override returns (uint256) {\\n if (revocable == Revocability.Disabled) {\\n return super.releasableAmount();\\n }\\n\\n // -- Revocability enabled logic\\n // This needs to deal with additional considerations for when tokens are used in the protocol\\n\\n // If a release start time is set no tokens are available for release before this date\\n // If not set it follows the default schedule and tokens are available on\\n // the first period passed\\n if (releaseStartTime > 0 && currentTime() < releaseStartTime) {\\n return 0;\\n }\\n\\n // Vesting cliff is activated and it has not passed means nothing is vested yet\\n // so funds cannot be released\\n if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\\n return 0;\\n }\\n\\n // A beneficiary can never have more releasable tokens than the contract balance\\n // We consider the `usedAmount` in the protocol as part of the calculations\\n // the beneficiary should not release funds that are used.\\n uint256 releasable = availableAmount().sub(releasedAmount).sub(usedAmount);\\n return MathUtils.min(currentBalance(), releasable);\\n }\\n\\n /**\\n * @notice Forward authorized contract calls to protocol contracts\\n * @dev Fallback function can be called by the beneficiary only if function call is allowed\\n */\\n fallback() external payable {\\n // Only beneficiary can forward calls\\n require(msg.sender == beneficiary, \\\"Unauthorized caller\\\");\\n\\n // Function call validation\\n address _target = manager.getAuthFunctionCallTarget(msg.sig);\\n require(_target != address(0), \\\"Unauthorized function\\\");\\n\\n uint256 oldBalance = currentBalance();\\n\\n // Call function with data\\n Address.functionCall(_target, msg.data);\\n\\n // Tracked used tokens in the protocol\\n // We do this check after balances were updated by the forwarded call\\n // Check is only enforced for revocable contracts to save some gas\\n if (revocable == Revocability.Enabled) {\\n // Track contract balance change\\n uint256 newBalance = currentBalance();\\n if (newBalance < oldBalance) {\\n // Outflow\\n uint256 diff = oldBalance.sub(newBalance);\\n usedAmount = usedAmount.add(diff);\\n } else {\\n // Inflow: We can receive profits from the protocol, that could make usedAmount to\\n // underflow. We set it to zero in that case.\\n uint256 diff = newBalance.sub(oldBalance);\\n usedAmount = (diff >= usedAmount) ? 0 : usedAmount.sub(diff);\\n }\\n require(usedAmount <= vestedAmount(), \\\"Cannot use more tokens than vested amount\\\");\\n }\\n }\\n}\\n\",\"keccak256\":\"0x5efc82d408fe81193664e67d614ca6299eafb00163ecc7819fad77cf0d35a2eb\",\"license\":\"MIT\"},\"contracts/IGraphTokenLock.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\ninterface IGraphTokenLock {\\n enum Revocability {\\n NotSet,\\n Enabled,\\n Disabled\\n }\\n\\n // -- Balances --\\n\\n function currentBalance() external view returns (uint256);\\n\\n // -- Time & Periods --\\n\\n function currentTime() external view returns (uint256);\\n\\n function duration() external view returns (uint256);\\n\\n function sinceStartTime() external view returns (uint256);\\n\\n function amountPerPeriod() external view returns (uint256);\\n\\n function periodDuration() external view returns (uint256);\\n\\n function currentPeriod() external view returns (uint256);\\n\\n function passedPeriods() external view returns (uint256);\\n\\n // -- Locking & Release Schedule --\\n\\n function availableAmount() external view returns (uint256);\\n\\n function vestedAmount() external view returns (uint256);\\n\\n function releasableAmount() external view returns (uint256);\\n\\n function totalOutstandingAmount() external view returns (uint256);\\n\\n function surplusAmount() external view returns (uint256);\\n\\n // -- Value Transfer --\\n\\n function release() external;\\n\\n function withdrawSurplus(uint256 _amount) external;\\n\\n function revoke() external;\\n}\\n\",\"keccak256\":\"0xceb9d258276fe25ec858191e1deae5778f1b2f612a669fb7b37bab1a064756ab\",\"license\":\"MIT\"},\"contracts/IGraphTokenLockManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nimport \\\"./IGraphTokenLock.sol\\\";\\n\\ninterface IGraphTokenLockManager {\\n // -- Factory --\\n\\n function setMasterCopy(address _masterCopy) external;\\n\\n function createTokenLockWallet(\\n address _owner,\\n address _beneficiary,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n IGraphTokenLock.Revocability _revocable\\n ) external;\\n\\n // -- Funds Management --\\n\\n function token() external returns (IERC20);\\n\\n function deposit(uint256 _amount) external;\\n\\n function withdraw(uint256 _amount) external;\\n\\n // -- Allowed Funds Destinations --\\n\\n function addTokenDestination(address _dst) external;\\n\\n function removeTokenDestination(address _dst) external;\\n\\n function isTokenDestination(address _dst) external view returns (bool);\\n\\n function getTokenDestinations() external view returns (address[] memory);\\n\\n // -- Function Call Authorization --\\n\\n function setAuthFunctionCall(string calldata _signature, address _target) external;\\n\\n function unsetAuthFunctionCall(string calldata _signature) external;\\n\\n function setAuthFunctionCallMany(string[] calldata _signatures, address[] calldata _targets) external;\\n\\n function getAuthFunctionCallTarget(bytes4 _sigHash) external view returns (address);\\n\\n function isAuthFunctionCall(bytes4 _sigHash) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x2d78d41909a6de5b316ac39b100ea087a8f317cf306379888a045523e15c4d9a\",\"license\":\"MIT\"},\"contracts/MathUtils.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nlibrary MathUtils {\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n}\\n\",\"keccak256\":\"0xe2512e1da48bc8363acd15f66229564b02d66706665d7da740604566913c1400\",\"license\":\"MIT\"},\"contracts/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * The owner account will be passed on initialization of the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\ncontract Ownable {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n function initialize(address owner) internal {\\n _owner = owner;\\n emit OwnershipTransferred(address(0), owner);\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(_owner == msg.sender, \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() external virtual onlyOwner {\\n emit OwnershipTransferred(_owner, address(0));\\n _owner = address(0);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) external virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n emit OwnershipTransferred(_owner, newOwner);\\n _owner = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0xc93c7362ac4d74b624b48517985f92c277ce90ae6e5ccb706e70a61af5752077\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b50613e61806100206000396000f3fe6080604052600436106102555760003560e01c806386d00e0211610139578063bc0163c1116100b6578063dc0706571161007a578063dc07065714610d0e578063e8dda6f514610d5f578063e97d87d514610d8a578063ebbab99214610db5578063f2fde38b14610de0578063fc0c546a14610e3157610256565b8063bc0163c114610b41578063bd896dcb14610b6c578063ce845d1d14610c67578063d0ebdbe714610c92578063d18e81b314610ce357610256565b806391f7cfb9116100fd57806391f7cfb914610a6e578063a4caeb4214610a99578063b0d1818c14610ac4578063b470aade14610aff578063b6549f7514610b2a57610256565b806386d00e021461099e57806386d1a69f146109c9578063872a7810146109e05780638a5bdf5c14610a165780638da5cb5b14610a2d57610256565b8063392e53cd116101d25780635051a5ec116101965780635051a5ec146108c25780635b940081146108ef57806360e799441461091a578063715018a61461093157806378e97925146109485780637bdf05af1461097357610256565b8063392e53cd146107d3578063398057a31461080057806344b1231f1461082b57806345d30a1714610856578063481c6a751461088157610256565b80632a627814116102195780632a627814146106f85780632bc9ed021461070f5780633197cbb61461073c57806337aeb0861461076757806338af3eed1461079257610256565b8063029c6c9f1461063557806306040618146106605780630b80f7771461068b5780630dff24d5146106a25780630fb5a6b4146106cd57610256565b5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610319576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f556e617574686f72697a65642063616c6c65720000000000000000000000000081525060200191505060405180910390fd5b6000600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f1d24c456000357fffffffff00000000000000000000000000000000000000000000000000000000166040518263ffffffff1660e01b815260040180827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200191505060206040518083038186803b1580156103d157600080fd5b505afa1580156103e5573d6000803e3d6000fd5b505050506040513d60208110156103fb57600080fd5b81019080805190602001909291905050509050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156104b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f556e617574686f72697a65642066756e6374696f6e000000000000000000000081525060200191505060405180910390fd5b60006104bb610e72565b905061050c826000368080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610f3d565b506001600281111561051a57fe5b600960009054906101000a900460ff16600281111561053557fe5b1415610631576000610545610e72565b9050818110156105875760006105648284610f8790919063ffffffff16565b905061057b81600d5461100a90919063ffffffff16565b600d81905550506105cd565b600061059c8383610f8790919063ffffffff16565b9050600d548110156105c2576105bd81600d54610f8790919063ffffffff16565b6105c5565b60005b600d81905550505b6105d5611092565b600d54111561062f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613d346029913960400191505060405180910390fd5b505b5050005b34801561064157600080fd5b5061064a611101565b6040518082815260200191505060405180910390f35b34801561066c57600080fd5b5061067561111f565b6040518082815260200191505060405180910390f35b34801561069757600080fd5b506106a061115a565b005b3480156106ae57600080fd5b506106b761132d565b6040518082815260200191505060405180910390f35b3480156106d957600080fd5b506106e2611374565b6040518082815260200191505060405180910390f35b34801561070457600080fd5b5061070d611392565b005b34801561071b57600080fd5b5061072461165f565b60405180821515815260200191505060405180910390f35b34801561074857600080fd5b50610751611672565b6040518082815260200191505060405180910390f35b34801561077357600080fd5b5061077c611678565b6040518082815260200191505060405180910390f35b34801561079e57600080fd5b506107a761167e565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156107df57600080fd5b506107e86116a4565b60405180821515815260200191505060405180910390f35b34801561080c57600080fd5b506108156116b7565b6040518082815260200191505060405180910390f35b34801561083757600080fd5b50610840611092565b6040518082815260200191505060405180910390f35b34801561086257600080fd5b5061086b6116bd565b6040518082815260200191505060405180910390f35b34801561088d57600080fd5b506108966116c3565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156108ce57600080fd5b506108d76116e9565b60405180821515815260200191505060405180910390f35b3480156108fb57600080fd5b506109046116fc565b6040518082815260200191505060405180910390f35b34801561092657600080fd5b5061092f611807565b005b34801561093d57600080fd5b50610946611ab5565b005b34801561095457600080fd5b5061095d611c34565b6040518082815260200191505060405180910390f35b34801561097f57600080fd5b50610988611c3a565b6040518082815260200191505060405180910390f35b3480156109aa57600080fd5b506109b3611c76565b6040518082815260200191505060405180910390f35b3480156109d557600080fd5b506109de611c7c565b005b3480156109ec57600080fd5b506109f5611ebe565b60405180826002811115610a0557fe5b815260200191505060405180910390f35b348015610a2257600080fd5b50610a2b611ed1565b005b348015610a3957600080fd5b50610a42611fdd565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610a7a57600080fd5b50610a83612006565b6040518082815260200191505060405180910390f35b348015610aa557600080fd5b50610aae612064565b6040518082815260200191505060405180910390f35b348015610ad057600080fd5b50610afd60048036036020811015610ae757600080fd5b810190808035906020019092919050505061206a565b005b348015610b0b57600080fd5b50610b146122e5565b6040518082815260200191505060405180910390f35b348015610b3657600080fd5b50610b3f612308565b005b348015610b4d57600080fd5b50610b5661266c565b6040518082815260200191505060405180910390f35b348015610b7857600080fd5b50610c656004803603610160811015610b9057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190803560ff16906020019092919050505061269e565b005b348015610c7357600080fd5b50610c7c610e72565b6040518082815260200191505060405180910390f35b348015610c9e57600080fd5b50610ce160048036036020811015610cb557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506126c6565b005b348015610cef57600080fd5b50610cf8612793565b6040518082815260200191505060405180910390f35b348015610d1a57600080fd5b50610d5d60048036036020811015610d3157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061279b565b005b348015610d6b57600080fd5b50610d74612992565b6040518082815260200191505060405180910390f35b348015610d9657600080fd5b50610d9f612998565b6040518082815260200191505060405180910390f35b348015610dc157600080fd5b50610dca61299e565b6040518082815260200191505060405180910390f35b348015610dec57600080fd5b50610e2f60048036036020811015610e0357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506129c0565b005b348015610e3d57600080fd5b50610e46612bc4565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610efd57600080fd5b505afa158015610f11573d6000803e3d6000fd5b505050506040513d6020811015610f2757600080fd5b8101908080519060200190929190505050905090565b6060610f7f83836040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c65640000815250612bea565b905092915050565b600082821115610fff576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525060200191505060405180910390fd5b818303905092915050565b600080828401905083811015611088576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b60006002808111156110a057fe5b600960009054906101000a900460ff1660028111156110bb57fe5b14156110cb5760035490506110fe565b60006008541180156110e557506008546110e3612793565b105b156110f357600090506110fe565b6110fb612006565b90505b90565b600061111a600654600354612c0290919063ffffffff16565b905090565b600061115560016111476111316122e5565b611139611c3a565b612c0290919063ffffffff16565b61100a90919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461121b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60001515600960039054906101000a900460ff161515146112a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f43616e6e6f742063616e63656c20616363657074656420636f6e74726163740081525060200191505060405180910390fd5b6112ff6112af611fdd565b6112b7610e72565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612c8b9092919063ffffffff16565b7f171f0bcbda3370351cea17f3b164bee87d77c2503b94abdf2720a814ebe7e9df60405160405180910390a1565b600080611338610e72565b9050600061134461266c565b90508082111561136a576113618183610f8790919063ffffffff16565b92505050611371565b6000925050505b90565b600061138d600454600554610f8790919063ffffffff16565b905090565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611455576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6060600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a34574666040518163ffffffff1660e01b815260040160006040518083038186803b1580156114bf57600080fd5b505afa1580156114d3573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525060208110156114fd57600080fd5b810190808051604051939291908464010000000082111561151d57600080fd5b8382019150602082018581111561153357600080fd5b825186602082028301116401000000008211171561155057600080fd5b8083526020830192505050908051906020019060200280838360005b8381101561158757808201518184015260208101905061156c565b50505050905001604052505050905060005b815181101561162f576116228282815181106115b157fe5b60200260200101517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612d2d9092919063ffffffff16565b8080600101915050611599565b507fb837fd51506ba3cc623a37c78ed22fd521f2f6e9f69a34d5c2a4a9474f27579360405160405180910390a150565b600960019054906101000a900460ff1681565b60055481565b600b5481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600960029054906101000a900460ff1681565b60035481565b600a5481565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600960039054906101000a900460ff1681565b600060028081111561170a57fe5b600960009054906101000a900460ff16600281111561172557fe5b141561173a57611733612ef2565b9050611804565b60006007541180156117545750600754611752612793565b105b156117625760009050611804565b6001600281111561176f57fe5b600960009054906101000a900460ff16600281111561178a57fe5b14801561179957506000600854115b80156117ad57506008546117ab612793565b105b156117bb5760009050611804565b60006117ed600d546117df600a546117d1612006565b610f8790919063ffffffff16565b610f8790919063ffffffff16565b90506118006117fa610e72565b82612fac565b9150505b90565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146118ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6060600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a34574666040518163ffffffff1660e01b815260040160006040518083038186803b15801561193457600080fd5b505afa158015611948573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250602081101561197257600080fd5b810190808051604051939291908464010000000082111561199257600080fd5b838201915060208201858111156119a857600080fd5b82518660208202830111640100000000821117156119c557600080fd5b8083526020830192505050908051906020019060200280838360005b838110156119fc5780820151818401526020810190506119e1565b50505050905001604052505050905060005b8151811015611a8557611a78828281518110611a2657fe5b60200260200101516000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612d2d9092919063ffffffff16565b8080600101915050611a0e565b507f6d317a20ba9d790014284bef285283cd61fde92e0f2711050f563a9d2cf4171160405160405180910390a150565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611b76576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60045481565b600080611c45612793565b90506004548111611c5a576000915050611c73565b611c6f60045482610f8790919063ffffffff16565b9150505b90565b60085481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611d3f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000611d496116fc565b905060008111611dc1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f4e6f20617661696c61626c652072656c65617361626c6520616d6f756e74000081525060200191505060405180910390fd5b611dd681600a5461100a90919063ffffffff16565b600a81905550611e4b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612c8b9092919063ffffffff16565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fc7798891864187665ac6dd119286e44ec13f014527aeeb2b8eb3fd413df93179826040518082815260200191505060405180910390a250565b600960009054906101000a900460ff1681565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611f94576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6001600960036101000a81548160ff0219169083151502179055507fbeb3313724453131feb0a765a03e6715bb720e0f973a31fcbafa2d2f048c188b60405160405180910390a1565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600080612011612793565b9050600454811015612027576000915050612061565b60055481111561203c57600354915050612061565b61205d612047611101565b61204f61299e565b612fc590919063ffffffff16565b9150505b90565b60065481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461212d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600081116121a3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f416d6f756e742063616e6e6f74206265207a65726f000000000000000000000081525060200191505060405180910390fd5b806121ac61132d565b1015612203576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613d7e6024913960400191505060405180910390fd5b612272600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612c8b9092919063ffffffff16565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b826040518082815260200191505060405180910390a250565b60006123036006546122f5611374565b612c0290919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146123c9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600160028111156123d657fe5b600960009054906101000a900460ff1660028111156123f157fe5b14612464576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f436f6e7472616374206973206e6f6e2d7265766f6361626c650000000000000081525060200191505060405180910390fd5b60001515600960019054906101000a900460ff161515146124ed576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f416c7265616479207265766f6b6564000000000000000000000000000000000081525060200191505060405180910390fd5b600061250b6124fa611092565b600354610f8790919063ffffffff16565b905060008111612583576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f4e6f20617661696c61626c6520756e76657374656420616d6f756e740000000081525060200191505060405180910390fd5b80600b819055506001600960016101000a81548160ff0219169083151502179055506125f96125b0611fdd565b82600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612c8b9092919063ffffffff16565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fb73c49a3a37a7aca291ba0ceaa41657012def406106a7fc386888f0f66e941cf826040518082815260200191505060405180910390a250565b6000612699600b5461268b600a54600354610f8790919063ffffffff16565b610f8790919063ffffffff16565b905090565b6126b08a8a8a8a8a8a8a8a8a8a61304b565b6126b98b6136cc565b5050505050505050505050565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612787576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b612790816136cc565b50565b600042905090565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461285e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612901576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f456d7074792062656e656669636961727900000000000000000000000000000081525060200191505060405180910390fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f373c72efabe4ef3e552ff77838be729f3bc3d8c586df0012902d1baa2377fa1d81604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b600d5481565b60075481565b60006129bb60016129ad61111f565b610f8790919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612a81576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612b07576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180613ce86026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6060612bf984846000856138b0565b90509392505050565b6000808211612c79576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525060200191505060405180910390fd5b818381612c8257fe5b04905092915050565b612d288363a9059cbb60e01b8484604051602401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050613a59565b505050565b6000811480612dfb575060008373ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e30856040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b158015612dbe57600080fd5b505afa158015612dd2573d6000803e3d6000fd5b505050506040513d6020811015612de857600080fd5b8101908080519060200190929190505050145b612e50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526036815260200180613df66036913960400191505060405180910390fd5b612eed8363095ea7b360e01b8484604051602401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050613a59565b505050565b600080600754118015612f0d5750600754612f0b612793565b105b15612f1b5760009050612fa9565b60016002811115612f2857fe5b600960009054906101000a900460ff166002811115612f4357fe5b148015612f5257506000600854115b8015612f665750600854612f64612793565b105b15612f745760009050612fa9565b6000612f92600a54612f84612006565b610f8790919063ffffffff16565b9050612fa5612f9f610e72565b82612fac565b9150505b90565b6000818310612fbb5781612fbd565b825b905092915050565b600080831415612fd85760009050613045565b6000828402905082848281612fe957fe5b0414613040576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613d5d6021913960400191505060405180910390fd5b809150505b92915050565b600960029054906101000a900460ff16156130ce576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f416c726561647920696e697469616c697a65640000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff161415613171576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f4f776e65722063616e6e6f74206265207a65726f00000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff161415613214576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f42656e65666963696172792063616e6e6f74206265207a65726f00000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff1614156132b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f546f6b656e2063616e6e6f74206265207a65726f00000000000000000000000081525060200191505060405180910390fd5b6000871161332d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f4d616e6167656420746f6b656e732063616e6e6f74206265207a65726f00000081525060200191505060405180910390fd5b60008614156133a4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53746172742074696d65206d757374206265207365740000000000000000000081525060200191505060405180910390fd5b848610613419576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f53746172742074696d65203e20656e642074696d65000000000000000000000081525060200191505060405180910390fd5b6001841015613490576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f506572696f64732063616e6e6f742062652062656c6f77206d696e696d756d0081525060200191505060405180910390fd5b6000600281111561349d57fe5b8160028111156134a957fe5b141561351d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f4d757374207365742061207265766f636162696c697479206f7074696f6e000081525060200191505060405180910390fd5b848310613575576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613da2602a913960400191505060405180910390fd5b8482106135cd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613cc66022913960400191505060405180910390fd5b6001600960026101000a81548160ff0219169083151502179055506135f18a613b48565b88600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555087600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555086600381905550856004819055508460058190555083600681905550826007819055508160088190555080600960006101000a81548160ff021916908360028111156136bb57fe5b021790555050505050505050505050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561376f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4d616e616765722063616e6e6f7420626520656d70747900000000000000000081525060200191505060405180910390fd5b61377881613be6565b6137ea576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f4d616e61676572206d757374206265206120636f6e747261637400000000000081525060200191505060405180910390fd5b6000600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fdac3632743b879638fd2d51c4d3c1dd796615b4758a55b50b0c19b971ba9fbc760405160405180910390a35050565b60608247101561390b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180613d0e6026913960400191505060405180910390fd5b61391485613be6565b613986576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000081525060200191505060405180910390fd5b600060608673ffffffffffffffffffffffffffffffffffffffff1685876040518082805190602001908083835b602083106139d657805182526020820191506020810190506020830392506139b3565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114613a38576040519150601f19603f3d011682016040523d82523d6000602084013e613a3d565b606091505b5091509150613a4d828286613bf9565b92505050949350505050565b6060613abb826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16612bea9092919063ffffffff16565b9050600081511115613b4357808060200190516020811015613adc57600080fd5b8101908080519060200190929190505050613b42576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613dcc602a913960400191505060405180910390fd5b5b505050565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a350565b600080823b905060008111915050919050565b60608315613c0957829050613cbe565b600083511115613c1c5782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015613c83578082015181840152602081019050613c68565b50505050905090810190601f168015613cb05780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b939250505056fe436c6966662074696d65206d757374206265206265666f726520656e642074696d654f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c43616e6e6f7420757365206d6f726520746f6b656e73207468616e2076657374656420616d6f756e74536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77416d6f756e7420726571756573746564203e20737572706c757320617661696c61626c6552656c656173652073746172742074696d65206d757374206265206265666f726520656e642074696d655361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565645361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f20746f206e6f6e2d7a65726f20616c6c6f77616e6365a26469706673582212203c6b20b5a223b9b9c9f0008dfba22c9fb703c6524c0f0a76a2b156733f6d573464736f6c63430007030033", + "deployedBytecode": "0x6080604052600436106102555760003560e01c806386d00e0211610139578063bc0163c1116100b6578063dc0706571161007a578063dc07065714610d0e578063e8dda6f514610d5f578063e97d87d514610d8a578063ebbab99214610db5578063f2fde38b14610de0578063fc0c546a14610e3157610256565b8063bc0163c114610b41578063bd896dcb14610b6c578063ce845d1d14610c67578063d0ebdbe714610c92578063d18e81b314610ce357610256565b806391f7cfb9116100fd57806391f7cfb914610a6e578063a4caeb4214610a99578063b0d1818c14610ac4578063b470aade14610aff578063b6549f7514610b2a57610256565b806386d00e021461099e57806386d1a69f146109c9578063872a7810146109e05780638a5bdf5c14610a165780638da5cb5b14610a2d57610256565b8063392e53cd116101d25780635051a5ec116101965780635051a5ec146108c25780635b940081146108ef57806360e799441461091a578063715018a61461093157806378e97925146109485780637bdf05af1461097357610256565b8063392e53cd146107d3578063398057a31461080057806344b1231f1461082b57806345d30a1714610856578063481c6a751461088157610256565b80632a627814116102195780632a627814146106f85780632bc9ed021461070f5780633197cbb61461073c57806337aeb0861461076757806338af3eed1461079257610256565b8063029c6c9f1461063557806306040618146106605780630b80f7771461068b5780630dff24d5146106a25780630fb5a6b4146106cd57610256565b5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610319576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f556e617574686f72697a65642063616c6c65720000000000000000000000000081525060200191505060405180910390fd5b6000600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f1d24c456000357fffffffff00000000000000000000000000000000000000000000000000000000166040518263ffffffff1660e01b815260040180827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200191505060206040518083038186803b1580156103d157600080fd5b505afa1580156103e5573d6000803e3d6000fd5b505050506040513d60208110156103fb57600080fd5b81019080805190602001909291905050509050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156104b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f556e617574686f72697a65642066756e6374696f6e000000000000000000000081525060200191505060405180910390fd5b60006104bb610e72565b905061050c826000368080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610f3d565b506001600281111561051a57fe5b600960009054906101000a900460ff16600281111561053557fe5b1415610631576000610545610e72565b9050818110156105875760006105648284610f8790919063ffffffff16565b905061057b81600d5461100a90919063ffffffff16565b600d81905550506105cd565b600061059c8383610f8790919063ffffffff16565b9050600d548110156105c2576105bd81600d54610f8790919063ffffffff16565b6105c5565b60005b600d81905550505b6105d5611092565b600d54111561062f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613d346029913960400191505060405180910390fd5b505b5050005b34801561064157600080fd5b5061064a611101565b6040518082815260200191505060405180910390f35b34801561066c57600080fd5b5061067561111f565b6040518082815260200191505060405180910390f35b34801561069757600080fd5b506106a061115a565b005b3480156106ae57600080fd5b506106b761132d565b6040518082815260200191505060405180910390f35b3480156106d957600080fd5b506106e2611374565b6040518082815260200191505060405180910390f35b34801561070457600080fd5b5061070d611392565b005b34801561071b57600080fd5b5061072461165f565b60405180821515815260200191505060405180910390f35b34801561074857600080fd5b50610751611672565b6040518082815260200191505060405180910390f35b34801561077357600080fd5b5061077c611678565b6040518082815260200191505060405180910390f35b34801561079e57600080fd5b506107a761167e565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156107df57600080fd5b506107e86116a4565b60405180821515815260200191505060405180910390f35b34801561080c57600080fd5b506108156116b7565b6040518082815260200191505060405180910390f35b34801561083757600080fd5b50610840611092565b6040518082815260200191505060405180910390f35b34801561086257600080fd5b5061086b6116bd565b6040518082815260200191505060405180910390f35b34801561088d57600080fd5b506108966116c3565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156108ce57600080fd5b506108d76116e9565b60405180821515815260200191505060405180910390f35b3480156108fb57600080fd5b506109046116fc565b6040518082815260200191505060405180910390f35b34801561092657600080fd5b5061092f611807565b005b34801561093d57600080fd5b50610946611ab5565b005b34801561095457600080fd5b5061095d611c34565b6040518082815260200191505060405180910390f35b34801561097f57600080fd5b50610988611c3a565b6040518082815260200191505060405180910390f35b3480156109aa57600080fd5b506109b3611c76565b6040518082815260200191505060405180910390f35b3480156109d557600080fd5b506109de611c7c565b005b3480156109ec57600080fd5b506109f5611ebe565b60405180826002811115610a0557fe5b815260200191505060405180910390f35b348015610a2257600080fd5b50610a2b611ed1565b005b348015610a3957600080fd5b50610a42611fdd565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610a7a57600080fd5b50610a83612006565b6040518082815260200191505060405180910390f35b348015610aa557600080fd5b50610aae612064565b6040518082815260200191505060405180910390f35b348015610ad057600080fd5b50610afd60048036036020811015610ae757600080fd5b810190808035906020019092919050505061206a565b005b348015610b0b57600080fd5b50610b146122e5565b6040518082815260200191505060405180910390f35b348015610b3657600080fd5b50610b3f612308565b005b348015610b4d57600080fd5b50610b5661266c565b6040518082815260200191505060405180910390f35b348015610b7857600080fd5b50610c656004803603610160811015610b9057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190803560ff16906020019092919050505061269e565b005b348015610c7357600080fd5b50610c7c610e72565b6040518082815260200191505060405180910390f35b348015610c9e57600080fd5b50610ce160048036036020811015610cb557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506126c6565b005b348015610cef57600080fd5b50610cf8612793565b6040518082815260200191505060405180910390f35b348015610d1a57600080fd5b50610d5d60048036036020811015610d3157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061279b565b005b348015610d6b57600080fd5b50610d74612992565b6040518082815260200191505060405180910390f35b348015610d9657600080fd5b50610d9f612998565b6040518082815260200191505060405180910390f35b348015610dc157600080fd5b50610dca61299e565b6040518082815260200191505060405180910390f35b348015610dec57600080fd5b50610e2f60048036036020811015610e0357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506129c0565b005b348015610e3d57600080fd5b50610e46612bc4565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610efd57600080fd5b505afa158015610f11573d6000803e3d6000fd5b505050506040513d6020811015610f2757600080fd5b8101908080519060200190929190505050905090565b6060610f7f83836040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c65640000815250612bea565b905092915050565b600082821115610fff576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525060200191505060405180910390fd5b818303905092915050565b600080828401905083811015611088576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b60006002808111156110a057fe5b600960009054906101000a900460ff1660028111156110bb57fe5b14156110cb5760035490506110fe565b60006008541180156110e557506008546110e3612793565b105b156110f357600090506110fe565b6110fb612006565b90505b90565b600061111a600654600354612c0290919063ffffffff16565b905090565b600061115560016111476111316122e5565b611139611c3a565b612c0290919063ffffffff16565b61100a90919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461121b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60001515600960039054906101000a900460ff161515146112a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f43616e6e6f742063616e63656c20616363657074656420636f6e74726163740081525060200191505060405180910390fd5b6112ff6112af611fdd565b6112b7610e72565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612c8b9092919063ffffffff16565b7f171f0bcbda3370351cea17f3b164bee87d77c2503b94abdf2720a814ebe7e9df60405160405180910390a1565b600080611338610e72565b9050600061134461266c565b90508082111561136a576113618183610f8790919063ffffffff16565b92505050611371565b6000925050505b90565b600061138d600454600554610f8790919063ffffffff16565b905090565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611455576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6060600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a34574666040518163ffffffff1660e01b815260040160006040518083038186803b1580156114bf57600080fd5b505afa1580156114d3573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525060208110156114fd57600080fd5b810190808051604051939291908464010000000082111561151d57600080fd5b8382019150602082018581111561153357600080fd5b825186602082028301116401000000008211171561155057600080fd5b8083526020830192505050908051906020019060200280838360005b8381101561158757808201518184015260208101905061156c565b50505050905001604052505050905060005b815181101561162f576116228282815181106115b157fe5b60200260200101517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612d2d9092919063ffffffff16565b8080600101915050611599565b507fb837fd51506ba3cc623a37c78ed22fd521f2f6e9f69a34d5c2a4a9474f27579360405160405180910390a150565b600960019054906101000a900460ff1681565b60055481565b600b5481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600960029054906101000a900460ff1681565b60035481565b600a5481565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600960039054906101000a900460ff1681565b600060028081111561170a57fe5b600960009054906101000a900460ff16600281111561172557fe5b141561173a57611733612ef2565b9050611804565b60006007541180156117545750600754611752612793565b105b156117625760009050611804565b6001600281111561176f57fe5b600960009054906101000a900460ff16600281111561178a57fe5b14801561179957506000600854115b80156117ad57506008546117ab612793565b105b156117bb5760009050611804565b60006117ed600d546117df600a546117d1612006565b610f8790919063ffffffff16565b610f8790919063ffffffff16565b90506118006117fa610e72565b82612fac565b9150505b90565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146118ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6060600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a34574666040518163ffffffff1660e01b815260040160006040518083038186803b15801561193457600080fd5b505afa158015611948573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250602081101561197257600080fd5b810190808051604051939291908464010000000082111561199257600080fd5b838201915060208201858111156119a857600080fd5b82518660208202830111640100000000821117156119c557600080fd5b8083526020830192505050908051906020019060200280838360005b838110156119fc5780820151818401526020810190506119e1565b50505050905001604052505050905060005b8151811015611a8557611a78828281518110611a2657fe5b60200260200101516000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612d2d9092919063ffffffff16565b8080600101915050611a0e565b507f6d317a20ba9d790014284bef285283cd61fde92e0f2711050f563a9d2cf4171160405160405180910390a150565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611b76576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60045481565b600080611c45612793565b90506004548111611c5a576000915050611c73565b611c6f60045482610f8790919063ffffffff16565b9150505b90565b60085481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611d3f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000611d496116fc565b905060008111611dc1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f4e6f20617661696c61626c652072656c65617361626c6520616d6f756e74000081525060200191505060405180910390fd5b611dd681600a5461100a90919063ffffffff16565b600a81905550611e4b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612c8b9092919063ffffffff16565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fc7798891864187665ac6dd119286e44ec13f014527aeeb2b8eb3fd413df93179826040518082815260200191505060405180910390a250565b600960009054906101000a900460ff1681565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611f94576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6001600960036101000a81548160ff0219169083151502179055507fbeb3313724453131feb0a765a03e6715bb720e0f973a31fcbafa2d2f048c188b60405160405180910390a1565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600080612011612793565b9050600454811015612027576000915050612061565b60055481111561203c57600354915050612061565b61205d612047611101565b61204f61299e565b612fc590919063ffffffff16565b9150505b90565b60065481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461212d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600081116121a3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f416d6f756e742063616e6e6f74206265207a65726f000000000000000000000081525060200191505060405180910390fd5b806121ac61132d565b1015612203576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613d7e6024913960400191505060405180910390fd5b612272600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612c8b9092919063ffffffff16565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b826040518082815260200191505060405180910390a250565b60006123036006546122f5611374565b612c0290919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146123c9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600160028111156123d657fe5b600960009054906101000a900460ff1660028111156123f157fe5b14612464576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f436f6e7472616374206973206e6f6e2d7265766f6361626c650000000000000081525060200191505060405180910390fd5b60001515600960019054906101000a900460ff161515146124ed576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f416c7265616479207265766f6b6564000000000000000000000000000000000081525060200191505060405180910390fd5b600061250b6124fa611092565b600354610f8790919063ffffffff16565b905060008111612583576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f4e6f20617661696c61626c6520756e76657374656420616d6f756e740000000081525060200191505060405180910390fd5b80600b819055506001600960016101000a81548160ff0219169083151502179055506125f96125b0611fdd565b82600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612c8b9092919063ffffffff16565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fb73c49a3a37a7aca291ba0ceaa41657012def406106a7fc386888f0f66e941cf826040518082815260200191505060405180910390a250565b6000612699600b5461268b600a54600354610f8790919063ffffffff16565b610f8790919063ffffffff16565b905090565b6126b08a8a8a8a8a8a8a8a8a8a61304b565b6126b98b6136cc565b5050505050505050505050565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612787576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b612790816136cc565b50565b600042905090565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461285e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612901576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f456d7074792062656e656669636961727900000000000000000000000000000081525060200191505060405180910390fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f373c72efabe4ef3e552ff77838be729f3bc3d8c586df0012902d1baa2377fa1d81604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b600d5481565b60075481565b60006129bb60016129ad61111f565b610f8790919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612a81576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612b07576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180613ce86026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6060612bf984846000856138b0565b90509392505050565b6000808211612c79576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525060200191505060405180910390fd5b818381612c8257fe5b04905092915050565b612d288363a9059cbb60e01b8484604051602401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050613a59565b505050565b6000811480612dfb575060008373ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e30856040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b158015612dbe57600080fd5b505afa158015612dd2573d6000803e3d6000fd5b505050506040513d6020811015612de857600080fd5b8101908080519060200190929190505050145b612e50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526036815260200180613df66036913960400191505060405180910390fd5b612eed8363095ea7b360e01b8484604051602401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050613a59565b505050565b600080600754118015612f0d5750600754612f0b612793565b105b15612f1b5760009050612fa9565b60016002811115612f2857fe5b600960009054906101000a900460ff166002811115612f4357fe5b148015612f5257506000600854115b8015612f665750600854612f64612793565b105b15612f745760009050612fa9565b6000612f92600a54612f84612006565b610f8790919063ffffffff16565b9050612fa5612f9f610e72565b82612fac565b9150505b90565b6000818310612fbb5781612fbd565b825b905092915050565b600080831415612fd85760009050613045565b6000828402905082848281612fe957fe5b0414613040576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613d5d6021913960400191505060405180910390fd5b809150505b92915050565b600960029054906101000a900460ff16156130ce576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f416c726561647920696e697469616c697a65640000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff161415613171576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f4f776e65722063616e6e6f74206265207a65726f00000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff161415613214576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f42656e65666963696172792063616e6e6f74206265207a65726f00000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff1614156132b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f546f6b656e2063616e6e6f74206265207a65726f00000000000000000000000081525060200191505060405180910390fd5b6000871161332d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f4d616e6167656420746f6b656e732063616e6e6f74206265207a65726f00000081525060200191505060405180910390fd5b60008614156133a4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53746172742074696d65206d757374206265207365740000000000000000000081525060200191505060405180910390fd5b848610613419576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f53746172742074696d65203e20656e642074696d65000000000000000000000081525060200191505060405180910390fd5b6001841015613490576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f506572696f64732063616e6e6f742062652062656c6f77206d696e696d756d0081525060200191505060405180910390fd5b6000600281111561349d57fe5b8160028111156134a957fe5b141561351d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f4d757374207365742061207265766f636162696c697479206f7074696f6e000081525060200191505060405180910390fd5b848310613575576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613da2602a913960400191505060405180910390fd5b8482106135cd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613cc66022913960400191505060405180910390fd5b6001600960026101000a81548160ff0219169083151502179055506135f18a613b48565b88600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555087600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555086600381905550856004819055508460058190555083600681905550826007819055508160088190555080600960006101000a81548160ff021916908360028111156136bb57fe5b021790555050505050505050505050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561376f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4d616e616765722063616e6e6f7420626520656d70747900000000000000000081525060200191505060405180910390fd5b61377881613be6565b6137ea576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f4d616e61676572206d757374206265206120636f6e747261637400000000000081525060200191505060405180910390fd5b6000600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fdac3632743b879638fd2d51c4d3c1dd796615b4758a55b50b0c19b971ba9fbc760405160405180910390a35050565b60608247101561390b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180613d0e6026913960400191505060405180910390fd5b61391485613be6565b613986576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000081525060200191505060405180910390fd5b600060608673ffffffffffffffffffffffffffffffffffffffff1685876040518082805190602001908083835b602083106139d657805182526020820191506020810190506020830392506139b3565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114613a38576040519150601f19603f3d011682016040523d82523d6000602084013e613a3d565b606091505b5091509150613a4d828286613bf9565b92505050949350505050565b6060613abb826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16612bea9092919063ffffffff16565b9050600081511115613b4357808060200190516020811015613adc57600080fd5b8101908080519060200190929190505050613b42576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613dcc602a913960400191505060405180910390fd5b5b505050565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a350565b600080823b905060008111915050919050565b60608315613c0957829050613cbe565b600083511115613c1c5782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015613c83578082015181840152602081019050613c68565b50505050905090810190601f168015613cb05780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b939250505056fe436c6966662074696d65206d757374206265206265666f726520656e642074696d654f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c43616e6e6f7420757365206d6f726520746f6b656e73207468616e2076657374656420616d6f756e74536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77416d6f756e7420726571756573746564203e20737572706c757320617661696c61626c6552656c656173652073746172742074696d65206d757374206265206265666f726520656e642074696d655361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565645361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f20746f206e6f6e2d7a65726f20616c6c6f77616e6365a26469706673582212203c6b20b5a223b9b9c9f0008dfba22c9fb703c6524c0f0a76a2b156733f6d573464736f6c63430007030033", + "devdoc": { + "kind": "dev", + "methods": { + "acceptLock()": { + "details": "Can only be called by the beneficiary" + }, + "amountPerPeriod()": { + "returns": { + "_0": "Amount of tokens available after each period" + } + }, + "approveProtocol()": { + "details": "Approves all token destinations registered in the manager to pull tokens" + }, + "availableAmount()": { + "details": "Implements the step-by-step schedule based on periods for available tokens", + "returns": { + "_0": "Amount of tokens available according to the schedule" + } + }, + "cancelLock()": { + "details": "Can only be called by the owner" + }, + "changeBeneficiary(address)": { + "details": "Can only be called by the beneficiary", + "params": { + "_newBeneficiary": "Address of the new beneficiary address" + } + }, + "currentBalance()": { + "returns": { + "_0": "Tokens held in the contract" + } + }, + "currentPeriod()": { + "returns": { + "_0": "A number that represents the current period" + } + }, + "currentTime()": { + "returns": { + "_0": "Current block timestamp" + } + }, + "duration()": { + "returns": { + "_0": "Amount of seconds from contract startTime to endTime" + } + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "passedPeriods()": { + "returns": { + "_0": "A number of periods that passed since the schedule started" + } + }, + "periodDuration()": { + "returns": { + "_0": "Duration of each period in seconds" + } + }, + "releasableAmount()": { + "details": "Considers the schedule, takes into account already released tokens and used amount", + "returns": { + "_0": "Amount of tokens ready to be released" + } + }, + "release()": { + "details": "All available releasable tokens are transferred to beneficiary" + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." + }, + "revoke()": { + "details": "Vesting schedule is always calculated based on managed tokens" + }, + "revokeProtocol()": { + "details": "Revokes approval to all token destinations in the manager to pull tokens" + }, + "setManager(address)": { + "params": { + "_newManager": "Address of the new manager" + } + }, + "sinceStartTime()": { + "details": "Returns zero if called before conctract starTime", + "returns": { + "_0": "Seconds elapsed from contract startTime" + } + }, + "surplusAmount()": { + "details": "All funds over outstanding amount is considered surplus that can be withdrawn by beneficiary", + "returns": { + "_0": "Amount of tokens considered as surplus" + } + }, + "totalOutstandingAmount()": { + "details": "Does not consider schedule but just global amounts tracked", + "returns": { + "_0": "Amount of outstanding tokens for the lifetime of the contract" + } + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + }, + "vestedAmount()": { + "details": "Similar to available amount, but is fully vested when contract is non-revocable", + "returns": { + "_0": "Amount of tokens already vested" + } + }, + "withdrawSurplus(uint256)": { + "details": "Tokens in the contract over outstanding amount are considered as surplus", + "params": { + "_amount": "Amount of tokens to withdraw" + } + } + }, + "title": "GraphTokenLockWallet", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "acceptLock()": { + "notice": "Beneficiary accepts the lock, the owner cannot retrieve back the tokens" + }, + "amountPerPeriod()": { + "notice": "Returns amount available to be released after each period according to schedule" + }, + "approveProtocol()": { + "notice": "Approves protocol access of the tokens managed by this contract" + }, + "availableAmount()": { + "notice": "Gets the currently available token according to the schedule" + }, + "cancelLock()": { + "notice": "Owner cancel the lock and return the balance in the contract" + }, + "changeBeneficiary(address)": { + "notice": "Change the beneficiary of funds managed by the contract" + }, + "currentBalance()": { + "notice": "Returns the amount of tokens currently held by the contract" + }, + "currentPeriod()": { + "notice": "Gets the current period based on the schedule" + }, + "currentTime()": { + "notice": "Returns the current block timestamp" + }, + "duration()": { + "notice": "Gets duration of contract from start to end in seconds" + }, + "passedPeriods()": { + "notice": "Gets the number of periods that passed since the first period" + }, + "periodDuration()": { + "notice": "Returns the duration of each period in seconds" + }, + "releasableAmount()": { + "notice": "Gets tokens currently available for release" + }, + "release()": { + "notice": "Releases tokens based on the configured schedule" + }, + "revoke()": { + "notice": "Revokes a vesting schedule and return the unvested tokens to the owner" + }, + "revokeProtocol()": { + "notice": "Revokes protocol access of the tokens managed by this contract" + }, + "setManager(address)": { + "notice": "Sets a new manager for this contract" + }, + "sinceStartTime()": { + "notice": "Gets time elapsed since the start of the contract" + }, + "surplusAmount()": { + "notice": "Gets surplus amount in the contract based on outstanding amount to release" + }, + "totalOutstandingAmount()": { + "notice": "Gets the outstanding amount yet to be released based on the whole contract lifetime" + }, + "vestedAmount()": { + "notice": "Gets the amount of currently vested tokens" + }, + "withdrawSurplus(uint256)": { + "notice": "Withdraws surplus, unmanaged tokens from the contract" + } + }, + "notice": "This contract is built on top of the base GraphTokenLock functionality. It allows wallet beneficiaries to use the deposited funds to perform specific function calls on specific contracts. The idea is that supporters with locked tokens can participate in the protocol but disallow any release before the vesting/lock schedule. The beneficiary can issue authorized function calls to this contract that will get forwarded to a target contract. A target contract is any of our protocol contracts. The function calls allowed are queried to the GraphTokenLockManager, this way the same configuration can be shared for all the created lock wallet contracts. NOTE: Contracts used as target must have its function signatures checked to avoid collisions with any of this contract functions. Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience the maximum amount of tokens is authorized.", + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 4749, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "_owner", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 2578, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "token", + "offset": 0, + "slot": "1", + "type": "t_contract(IERC20)1045" + }, + { + "astId": 2580, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "beneficiary", + "offset": 0, + "slot": "2", + "type": "t_address" + }, + { + "astId": 2582, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "managedAmount", + "offset": 0, + "slot": "3", + "type": "t_uint256" + }, + { + "astId": 2584, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "startTime", + "offset": 0, + "slot": "4", + "type": "t_uint256" + }, + { + "astId": 2586, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "endTime", + "offset": 0, + "slot": "5", + "type": "t_uint256" + }, + { + "astId": 2588, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "periods", + "offset": 0, + "slot": "6", + "type": "t_uint256" + }, + { + "astId": 2590, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "releaseStartTime", + "offset": 0, + "slot": "7", + "type": "t_uint256" + }, + { + "astId": 2592, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "vestingCliffTime", + "offset": 0, + "slot": "8", + "type": "t_uint256" + }, + { + "astId": 2594, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "revocable", + "offset": 0, + "slot": "9", + "type": "t_enum(Revocability)4426" + }, + { + "astId": 2596, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "isRevoked", + "offset": 1, + "slot": "9", + "type": "t_bool" + }, + { + "astId": 2598, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "isInitialized", + "offset": 2, + "slot": "9", + "type": "t_bool" + }, + { + "astId": 2600, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "isAccepted", + "offset": 3, + "slot": "9", + "type": "t_bool" + }, + { + "astId": 2602, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "releasedAmount", + "offset": 0, + "slot": "10", + "type": "t_uint256" + }, + { + "astId": 2604, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "revokedAmount", + "offset": 0, + "slot": "11", + "type": "t_uint256" + }, + { + "astId": 4021, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "manager", + "offset": 0, + "slot": "12", + "type": "t_contract(IGraphTokenLockManager)4608" + }, + { + "astId": 4023, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "usedAmount", + "offset": 0, + "slot": "13", + "type": "t_uint256" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_contract(IERC20)1045": { + "encoding": "inplace", + "label": "contract IERC20", + "numberOfBytes": "20" + }, + "t_contract(IGraphTokenLockManager)4608": { + "encoding": "inplace", + "label": "contract IGraphTokenLockManager", + "numberOfBytes": "20" + }, + "t_enum(Revocability)4426": { + "encoding": "inplace", + "label": "enum IGraphTokenLock.Revocability", + "numberOfBytes": "1" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} \ No newline at end of file diff --git a/packages/token-distribution/deployments/mainnet/GraphTokenLockWallet.json b/packages/token-distribution/deployments/mainnet/GraphTokenLockWallet.json new file mode 100644 index 000000000..eb2e70c01 --- /dev/null +++ b/packages/token-distribution/deployments/mainnet/GraphTokenLockWallet.json @@ -0,0 +1,1083 @@ +{ + "address": "0xcE18fE70D6331f1Ac403562202B4dc6AC41A10Db", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "newBeneficiary", + "type": "address" + } + ], + "name": "BeneficiaryChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "LockAccepted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "LockCanceled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_oldManager", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "_newManager", + "type": "address" + } + ], + "name": "ManagerUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "TokenDestinationsApproved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "TokenDestinationsRevoked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensReleased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensRevoked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensWithdrawn", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "acceptLock", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "amountPerPeriod", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "approveProtocol", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "availableAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "beneficiary", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "cancelLock", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newBeneficiary", + "type": "address" + } + ], + "name": "changeBeneficiary", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "currentBalance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "currentPeriod", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "currentTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "duration", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "endTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_manager", + "type": "address" + }, + { + "internalType": "address", + "name": "_owner", + "type": "address" + }, + { + "internalType": "address", + "name": "_beneficiary", + "type": "address" + }, + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_managedAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_startTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_endTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_periods", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_releaseStartTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_vestingCliffTime", + "type": "uint256" + }, + { + "internalType": "enum IGraphTokenLock.Revocability", + "name": "_revocable", + "type": "uint8" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "isAccepted", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isInitialized", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isRevoked", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "managedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "manager", + "outputs": [ + { + "internalType": "contract IGraphTokenLockManager", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "passedPeriods", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "periodDuration", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "periods", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "releasableAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "release", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "releaseStartTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "releasedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "revocable", + "outputs": [ + { + "internalType": "enum IGraphTokenLock.Revocability", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "revoke", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "revokeProtocol", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "revokedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newManager", + "type": "address" + } + ], + "name": "setManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "sinceStartTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "startTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "surplusAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "token", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalOutstandingAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "usedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "vestedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "vestingCliffTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "withdrawSurplus", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0xbe23d2afa548f1f65b856610ee08dee9d8dc17af9ae4739ddbc1943bd74e7c7e", + "receipt": { + "to": null, + "from": "0xE04FcE05E9B8d21521bd1B0f069982c03BD31F76", + "contractAddress": "0xcE18fE70D6331f1Ac403562202B4dc6AC41A10Db", + "transactionIndex": 114, + "gasUsed": "3482943", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x4cefd91091556f6e808eaea17c8c8a200dce5c8515feaf43c879df3663b73ba5", + "transactionHash": "0xbe23d2afa548f1f65b856610ee08dee9d8dc17af9ae4739ddbc1943bd74e7c7e", + "logs": [], + "blockNumber": 13863234, + "cumulativeGasUsed": "10106601", + "status": 1, + "byzantium": true + }, + "args": [], + "solcInputHash": "f0757d7c1c560a6ae9697525709a3f5b", + "metadata": "{\"compiler\":{\"version\":\"0.7.3+commit.9bfce1f6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newBeneficiary\",\"type\":\"address\"}],\"name\":\"BeneficiaryChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"LockAccepted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"LockCanceled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_oldManager\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_newManager\",\"type\":\"address\"}],\"name\":\"ManagerUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"TokenDestinationsApproved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"TokenDestinationsRevoked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensReleased\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensRevoked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensWithdrawn\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"acceptLock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"amountPerPeriod\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"approveProtocol\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"availableAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"beneficiary\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"cancelLock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_newBeneficiary\",\"type\":\"address\"}],\"name\":\"changeBeneficiary\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"currentBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"currentPeriod\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"currentTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"duration\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"endTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_manager\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_beneficiary\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_managedAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_startTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_endTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_periods\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_releaseStartTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_vestingCliffTime\",\"type\":\"uint256\"},{\"internalType\":\"enum IGraphTokenLock.Revocability\",\"name\":\"_revocable\",\"type\":\"uint8\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isAccepted\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isInitialized\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isRevoked\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"managedAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"manager\",\"outputs\":[{\"internalType\":\"contract IGraphTokenLockManager\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"passedPeriods\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"periodDuration\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"periods\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"releasableAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"release\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"releaseStartTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"releasedAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"revocable\",\"outputs\":[{\"internalType\":\"enum IGraphTokenLock.Revocability\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"revoke\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"revokeProtocol\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"revokedAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_newManager\",\"type\":\"address\"}],\"name\":\"setManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"sinceStartTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"startTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"surplusAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalOutstandingAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"usedAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"vestedAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"vestingCliffTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdrawSurplus\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"acceptLock()\":{\"details\":\"Can only be called by the beneficiary\"},\"amountPerPeriod()\":{\"returns\":{\"_0\":\"Amount of tokens available after each period\"}},\"approveProtocol()\":{\"details\":\"Approves all token destinations registered in the manager to pull tokens\"},\"availableAmount()\":{\"details\":\"Implements the step-by-step schedule based on periods for available tokens\",\"returns\":{\"_0\":\"Amount of tokens available according to the schedule\"}},\"cancelLock()\":{\"details\":\"Can only be called by the owner\"},\"changeBeneficiary(address)\":{\"details\":\"Can only be called by the beneficiary\",\"params\":{\"_newBeneficiary\":\"Address of the new beneficiary address\"}},\"currentBalance()\":{\"returns\":{\"_0\":\"Tokens held in the contract\"}},\"currentPeriod()\":{\"returns\":{\"_0\":\"A number that represents the current period\"}},\"currentTime()\":{\"returns\":{\"_0\":\"Current block timestamp\"}},\"duration()\":{\"returns\":{\"_0\":\"Amount of seconds from contract startTime to endTime\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"passedPeriods()\":{\"returns\":{\"_0\":\"A number of periods that passed since the schedule started\"}},\"periodDuration()\":{\"returns\":{\"_0\":\"Duration of each period in seconds\"}},\"releasableAmount()\":{\"details\":\"Considers the schedule, takes into account already released tokens and used amount\",\"returns\":{\"_0\":\"Amount of tokens ready to be released\"}},\"release()\":{\"details\":\"All available releasable tokens are transferred to beneficiary\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"revoke()\":{\"details\":\"Vesting schedule is always calculated based on managed tokens\"},\"revokeProtocol()\":{\"details\":\"Revokes approval to all token destinations in the manager to pull tokens\"},\"setManager(address)\":{\"params\":{\"_newManager\":\"Address of the new manager\"}},\"sinceStartTime()\":{\"details\":\"Returns zero if called before conctract starTime\",\"returns\":{\"_0\":\"Seconds elapsed from contract startTime\"}},\"surplusAmount()\":{\"details\":\"All funds over outstanding amount is considered surplus that can be withdrawn by beneficiary\",\"returns\":{\"_0\":\"Amount of tokens considered as surplus\"}},\"totalOutstandingAmount()\":{\"details\":\"Does not consider schedule but just global amounts tracked\",\"returns\":{\"_0\":\"Amount of outstanding tokens for the lifetime of the contract\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"vestedAmount()\":{\"details\":\"Similar to available amount, but is fully vested when contract is non-revocable\",\"returns\":{\"_0\":\"Amount of tokens already vested\"}},\"withdrawSurplus(uint256)\":{\"details\":\"Tokens in the contract over outstanding amount are considered as surplus\",\"params\":{\"_amount\":\"Amount of tokens to withdraw\"}}},\"title\":\"GraphTokenLockWallet\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"acceptLock()\":{\"notice\":\"Beneficiary accepts the lock, the owner cannot retrieve back the tokens\"},\"amountPerPeriod()\":{\"notice\":\"Returns amount available to be released after each period according to schedule\"},\"approveProtocol()\":{\"notice\":\"Approves protocol access of the tokens managed by this contract\"},\"availableAmount()\":{\"notice\":\"Gets the currently available token according to the schedule\"},\"cancelLock()\":{\"notice\":\"Owner cancel the lock and return the balance in the contract\"},\"changeBeneficiary(address)\":{\"notice\":\"Change the beneficiary of funds managed by the contract\"},\"currentBalance()\":{\"notice\":\"Returns the amount of tokens currently held by the contract\"},\"currentPeriod()\":{\"notice\":\"Gets the current period based on the schedule\"},\"currentTime()\":{\"notice\":\"Returns the current block timestamp\"},\"duration()\":{\"notice\":\"Gets duration of contract from start to end in seconds\"},\"passedPeriods()\":{\"notice\":\"Gets the number of periods that passed since the first period\"},\"periodDuration()\":{\"notice\":\"Returns the duration of each period in seconds\"},\"releasableAmount()\":{\"notice\":\"Gets tokens currently available for release\"},\"release()\":{\"notice\":\"Releases tokens based on the configured schedule\"},\"revoke()\":{\"notice\":\"Revokes a vesting schedule and return the unvested tokens to the owner\"},\"revokeProtocol()\":{\"notice\":\"Revokes protocol access of the tokens managed by this contract\"},\"setManager(address)\":{\"notice\":\"Sets a new manager for this contract\"},\"sinceStartTime()\":{\"notice\":\"Gets time elapsed since the start of the contract\"},\"surplusAmount()\":{\"notice\":\"Gets surplus amount in the contract based on outstanding amount to release\"},\"totalOutstandingAmount()\":{\"notice\":\"Gets the outstanding amount yet to be released based on the whole contract lifetime\"},\"vestedAmount()\":{\"notice\":\"Gets the amount of currently vested tokens\"},\"withdrawSurplus(uint256)\":{\"notice\":\"Withdraws surplus, unmanaged tokens from the contract\"}},\"notice\":\"This contract is built on top of the base GraphTokenLock functionality. It allows wallet beneficiaries to use the deposited funds to perform specific function calls on specific contracts. The idea is that supporters with locked tokens can participate in the protocol but disallow any release before the vesting/lock schedule. The beneficiary can issue authorized function calls to this contract that will get forwarded to a target contract. A target contract is any of our protocol contracts. The function calls allowed are queried to the GraphTokenLockManager, this way the same configuration can be shared for all the created lock wallet contracts. NOTE: Contracts used as target must have its function signatures checked to avoid collisions with any of this contract functions. Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience the maximum amount of tokens is authorized.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/GraphTokenLockWallet.sol\":\"GraphTokenLockWallet\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/math/SafeMath.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Wrappers over Solidity's arithmetic operations with added overflow\\n * checks.\\n *\\n * Arithmetic operations in Solidity wrap on overflow. This can easily result\\n * in bugs, because programmers usually assume that an overflow raises an\\n * error, which is the standard behavior in high level programming languages.\\n * `SafeMath` restores this intuition by reverting the transaction when an\\n * operation overflows.\\n *\\n * Using this library instead of the unchecked operations eliminates an entire\\n * class of bugs, so it's recommended to use it always.\\n */\\nlibrary SafeMath {\\n /**\\n * @dev Returns the addition of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n uint256 c = a + b;\\n if (c < a) return (false, 0);\\n return (true, c);\\n }\\n\\n /**\\n * @dev Returns the substraction of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b > a) return (false, 0);\\n return (true, a - b);\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\\n if (a == 0) return (true, 0);\\n uint256 c = a * b;\\n if (c / a != b) return (false, 0);\\n return (true, c);\\n }\\n\\n /**\\n * @dev Returns the division of two unsigned integers, with a division by zero flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b == 0) return (false, 0);\\n return (true, a / b);\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b == 0) return (false, 0);\\n return (true, a % b);\\n }\\n\\n /**\\n * @dev Returns the addition of two unsigned integers, reverting on\\n * overflow.\\n *\\n * Counterpart to Solidity's `+` operator.\\n *\\n * Requirements:\\n *\\n * - Addition cannot overflow.\\n */\\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\\n uint256 c = a + b;\\n require(c >= a, \\\"SafeMath: addition overflow\\\");\\n return c;\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting on\\n * overflow (when the result is negative).\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n *\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b <= a, \\\"SafeMath: subtraction overflow\\\");\\n return a - b;\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, reverting on\\n * overflow.\\n *\\n * Counterpart to Solidity's `*` operator.\\n *\\n * Requirements:\\n *\\n * - Multiplication cannot overflow.\\n */\\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\\n if (a == 0) return 0;\\n uint256 c = a * b;\\n require(c / a == b, \\\"SafeMath: multiplication overflow\\\");\\n return c;\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers, reverting on\\n * division by zero. The result is rounded towards zero.\\n *\\n * Counterpart to Solidity's `/` operator. Note: this function uses a\\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\\n * uses an invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b > 0, \\\"SafeMath: division by zero\\\");\\n return a / b;\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * reverting when dividing by zero.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b > 0, \\\"SafeMath: modulo by zero\\\");\\n return a % b;\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\\n * overflow (when the result is negative).\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {trySub}.\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n *\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b <= a, errorMessage);\\n return a - b;\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers, reverting with custom message on\\n * division by zero. The result is rounded towards zero.\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {tryDiv}.\\n *\\n * Counterpart to Solidity's `/` operator. Note: this function uses a\\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\\n * uses an invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b > 0, errorMessage);\\n return a / b;\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * reverting with custom message when dividing by zero.\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {tryMod}.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b > 0, errorMessage);\\n return a % b;\\n }\\n}\\n\",\"keccak256\":\"0xcc78a17dd88fa5a2edc60c8489e2f405c0913b377216a5b26b35656b2d0dab52\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `recipient`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address recipient, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `sender` to `recipient` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n}\\n\",\"keccak256\":\"0x5f02220344881ce43204ae4a6281145a67bc52c2bb1290a791857df3d19d78f5\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\nimport \\\"./IERC20.sol\\\";\\nimport \\\"../../math/SafeMath.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @title SafeERC20\\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\\n * contract returns false). Tokens that return no value (and instead revert or\\n * throw on failure) are also supported, non-reverting calls are assumed to be\\n * successful.\\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\n */\\nlibrary SafeERC20 {\\n using SafeMath for uint256;\\n using Address for address;\\n\\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\\n }\\n\\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\\n }\\n\\n /**\\n * @dev Deprecated. This function has issues similar to the ones found in\\n * {IERC20-approve}, and its usage is discouraged.\\n *\\n * Whenever possible, use {safeIncreaseAllowance} and\\n * {safeDecreaseAllowance} instead.\\n */\\n function safeApprove(IERC20 token, address spender, uint256 value) internal {\\n // safeApprove should only be called when setting an initial allowance,\\n // or when resetting it to zero. To increase and decrease it, use\\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\\n // solhint-disable-next-line max-line-length\\n require((value == 0) || (token.allowance(address(this), spender) == 0),\\n \\\"SafeERC20: approve from non-zero to non-zero allowance\\\"\\n );\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\\n }\\n\\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n uint256 newAllowance = token.allowance(address(this), spender).add(value);\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n uint256 newAllowance = token.allowance(address(this), spender).sub(value, \\\"SafeERC20: decreased allowance below zero\\\");\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n */\\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that\\n // the target address contains contract code and also asserts for success in the low-level call.\\n\\n bytes memory returndata = address(token).functionCall(data, \\\"SafeERC20: low-level call failed\\\");\\n if (returndata.length > 0) { // Return data is optional\\n // solhint-disable-next-line max-line-length\\n require(abi.decode(returndata, (bool)), \\\"SafeERC20: ERC20 operation did not succeed\\\");\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf12dfbe97e6276980b83d2830bb0eb75e0cf4f3e626c2471137f82158ae6a0fc\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.2 <0.8.0;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize, which returns 0 for contracts in\\n // construction, since the code is only stored at the end of the\\n // constructor execution.\\n\\n uint256 size;\\n // solhint-disable-next-line no-inline-assembly\\n assembly { size := extcodesize(account) }\\n return size > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls, avoid-call-value\\n (bool success, ) = recipient.call{ value: amount }(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain`call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.call{ value: value }(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x28911e614500ae7c607a432a709d35da25f3bc5ddc8bd12b278b66358070c0ea\",\"license\":\"MIT\"},\"contracts/GraphTokenLock.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nimport \\\"@openzeppelin/contracts/math/SafeMath.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\\\";\\n\\nimport \\\"./Ownable.sol\\\";\\nimport \\\"./MathUtils.sol\\\";\\nimport \\\"./IGraphTokenLock.sol\\\";\\n\\n/**\\n * @title GraphTokenLock\\n * @notice Contract that manages an unlocking schedule of tokens.\\n * @dev The contract lock manage a number of tokens deposited into the contract to ensure that\\n * they can only be released under certain time conditions.\\n *\\n * This contract implements a release scheduled based on periods and tokens are released in steps\\n * after each period ends. It can be configured with one period in which case it is like a plain TimeLock.\\n * It also supports revocation to be used for vesting schedules.\\n *\\n * The contract supports receiving extra funds than the managed tokens ones that can be\\n * withdrawn by the beneficiary at any time.\\n *\\n * A releaseStartTime parameter is included to override the default release schedule and\\n * perform the first release on the configured time. After that it will continue with the\\n * default schedule.\\n */\\nabstract contract GraphTokenLock is Ownable, IGraphTokenLock {\\n using SafeMath for uint256;\\n using SafeERC20 for IERC20;\\n\\n uint256 private constant MIN_PERIOD = 1;\\n\\n // -- State --\\n\\n IERC20 public token;\\n address public beneficiary;\\n\\n // Configuration\\n\\n // Amount of tokens managed by the contract schedule\\n uint256 public managedAmount;\\n\\n uint256 public startTime; // Start datetime (in unixtimestamp)\\n uint256 public endTime; // Datetime after all funds are fully vested/unlocked (in unixtimestamp)\\n uint256 public periods; // Number of vesting/release periods\\n\\n // First release date for tokens (in unixtimestamp)\\n // If set, no tokens will be released before releaseStartTime ignoring\\n // the amount to release each period\\n uint256 public releaseStartTime;\\n // A cliff set a date to which a beneficiary needs to get to vest\\n // all preceding periods\\n uint256 public vestingCliffTime;\\n Revocability public revocable; // Whether to use vesting for locked funds\\n\\n // State\\n\\n bool public isRevoked;\\n bool public isInitialized;\\n bool public isAccepted;\\n uint256 public releasedAmount;\\n uint256 public revokedAmount;\\n\\n // -- Events --\\n\\n event TokensReleased(address indexed beneficiary, uint256 amount);\\n event TokensWithdrawn(address indexed beneficiary, uint256 amount);\\n event TokensRevoked(address indexed beneficiary, uint256 amount);\\n event BeneficiaryChanged(address newBeneficiary);\\n event LockAccepted();\\n event LockCanceled();\\n\\n /**\\n * @dev Only allow calls from the beneficiary of the contract\\n */\\n modifier onlyBeneficiary() {\\n require(msg.sender == beneficiary, \\\"!auth\\\");\\n _;\\n }\\n\\n /**\\n * @notice Initializes the contract\\n * @param _owner Address of the contract owner\\n * @param _beneficiary Address of the beneficiary of locked tokens\\n * @param _managedAmount Amount of tokens to be managed by the lock contract\\n * @param _startTime Start time of the release schedule\\n * @param _endTime End time of the release schedule\\n * @param _periods Number of periods between start time and end time\\n * @param _releaseStartTime Override time for when the releases start\\n * @param _vestingCliffTime Override time for when the vesting start\\n * @param _revocable Whether the contract is revocable\\n */\\n function _initialize(\\n address _owner,\\n address _beneficiary,\\n address _token,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n Revocability _revocable\\n ) internal {\\n require(!isInitialized, \\\"Already initialized\\\");\\n require(_owner != address(0), \\\"Owner cannot be zero\\\");\\n require(_beneficiary != address(0), \\\"Beneficiary cannot be zero\\\");\\n require(_token != address(0), \\\"Token cannot be zero\\\");\\n require(_managedAmount > 0, \\\"Managed tokens cannot be zero\\\");\\n require(_startTime != 0, \\\"Start time must be set\\\");\\n require(_startTime < _endTime, \\\"Start time > end time\\\");\\n require(_periods >= MIN_PERIOD, \\\"Periods cannot be below minimum\\\");\\n require(_revocable != Revocability.NotSet, \\\"Must set a revocability option\\\");\\n require(_releaseStartTime < _endTime, \\\"Release start time must be before end time\\\");\\n require(_vestingCliffTime < _endTime, \\\"Cliff time must be before end time\\\");\\n\\n isInitialized = true;\\n\\n Ownable.initialize(_owner);\\n beneficiary = _beneficiary;\\n token = IERC20(_token);\\n\\n managedAmount = _managedAmount;\\n\\n startTime = _startTime;\\n endTime = _endTime;\\n periods = _periods;\\n\\n // Optionals\\n releaseStartTime = _releaseStartTime;\\n vestingCliffTime = _vestingCliffTime;\\n revocable = _revocable;\\n }\\n\\n /**\\n * @notice Change the beneficiary of funds managed by the contract\\n * @dev Can only be called by the beneficiary\\n * @param _newBeneficiary Address of the new beneficiary address\\n */\\n function changeBeneficiary(address _newBeneficiary) external onlyBeneficiary {\\n require(_newBeneficiary != address(0), \\\"Empty beneficiary\\\");\\n beneficiary = _newBeneficiary;\\n emit BeneficiaryChanged(_newBeneficiary);\\n }\\n\\n /**\\n * @notice Beneficiary accepts the lock, the owner cannot retrieve back the tokens\\n * @dev Can only be called by the beneficiary\\n */\\n function acceptLock() external onlyBeneficiary {\\n isAccepted = true;\\n emit LockAccepted();\\n }\\n\\n /**\\n * @notice Owner cancel the lock and return the balance in the contract\\n * @dev Can only be called by the owner\\n */\\n function cancelLock() external onlyOwner {\\n require(isAccepted == false, \\\"Cannot cancel accepted contract\\\");\\n\\n token.safeTransfer(owner(), currentBalance());\\n\\n emit LockCanceled();\\n }\\n\\n // -- Balances --\\n\\n /**\\n * @notice Returns the amount of tokens currently held by the contract\\n * @return Tokens held in the contract\\n */\\n function currentBalance() public view override returns (uint256) {\\n return token.balanceOf(address(this));\\n }\\n\\n // -- Time & Periods --\\n\\n /**\\n * @notice Returns the current block timestamp\\n * @return Current block timestamp\\n */\\n function currentTime() public view override returns (uint256) {\\n return block.timestamp;\\n }\\n\\n /**\\n * @notice Gets duration of contract from start to end in seconds\\n * @return Amount of seconds from contract startTime to endTime\\n */\\n function duration() public view override returns (uint256) {\\n return endTime.sub(startTime);\\n }\\n\\n /**\\n * @notice Gets time elapsed since the start of the contract\\n * @dev Returns zero if called before conctract starTime\\n * @return Seconds elapsed from contract startTime\\n */\\n function sinceStartTime() public view override returns (uint256) {\\n uint256 current = currentTime();\\n if (current <= startTime) {\\n return 0;\\n }\\n return current.sub(startTime);\\n }\\n\\n /**\\n * @notice Returns amount available to be released after each period according to schedule\\n * @return Amount of tokens available after each period\\n */\\n function amountPerPeriod() public view override returns (uint256) {\\n return managedAmount.div(periods);\\n }\\n\\n /**\\n * @notice Returns the duration of each period in seconds\\n * @return Duration of each period in seconds\\n */\\n function periodDuration() public view override returns (uint256) {\\n return duration().div(periods);\\n }\\n\\n /**\\n * @notice Gets the current period based on the schedule\\n * @return A number that represents the current period\\n */\\n function currentPeriod() public view override returns (uint256) {\\n return sinceStartTime().div(periodDuration()).add(MIN_PERIOD);\\n }\\n\\n /**\\n * @notice Gets the number of periods that passed since the first period\\n * @return A number of periods that passed since the schedule started\\n */\\n function passedPeriods() public view override returns (uint256) {\\n return currentPeriod().sub(MIN_PERIOD);\\n }\\n\\n // -- Locking & Release Schedule --\\n\\n /**\\n * @notice Gets the currently available token according to the schedule\\n * @dev Implements the step-by-step schedule based on periods for available tokens\\n * @return Amount of tokens available according to the schedule\\n */\\n function availableAmount() public view override returns (uint256) {\\n uint256 current = currentTime();\\n\\n // Before contract start no funds are available\\n if (current < startTime) {\\n return 0;\\n }\\n\\n // After contract ended all funds are available\\n if (current > endTime) {\\n return managedAmount;\\n }\\n\\n // Get available amount based on period\\n return passedPeriods().mul(amountPerPeriod());\\n }\\n\\n /**\\n * @notice Gets the amount of currently vested tokens\\n * @dev Similar to available amount, but is fully vested when contract is non-revocable\\n * @return Amount of tokens already vested\\n */\\n function vestedAmount() public view override returns (uint256) {\\n // If non-revocable it is fully vested\\n if (revocable == Revocability.Disabled) {\\n return managedAmount;\\n }\\n\\n // Vesting cliff is activated and it has not passed means nothing is vested yet\\n if (vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\\n return 0;\\n }\\n\\n return availableAmount();\\n }\\n\\n /**\\n * @notice Gets tokens currently available for release\\n * @dev Considers the schedule and takes into account already released tokens\\n * @return Amount of tokens ready to be released\\n */\\n function releasableAmount() public view virtual override returns (uint256) {\\n // If a release start time is set no tokens are available for release before this date\\n // If not set it follows the default schedule and tokens are available on\\n // the first period passed\\n if (releaseStartTime > 0 && currentTime() < releaseStartTime) {\\n return 0;\\n }\\n\\n // Vesting cliff is activated and it has not passed means nothing is vested yet\\n // so funds cannot be released\\n if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\\n return 0;\\n }\\n\\n // A beneficiary can never have more releasable tokens than the contract balance\\n uint256 releasable = availableAmount().sub(releasedAmount);\\n return MathUtils.min(currentBalance(), releasable);\\n }\\n\\n /**\\n * @notice Gets the outstanding amount yet to be released based on the whole contract lifetime\\n * @dev Does not consider schedule but just global amounts tracked\\n * @return Amount of outstanding tokens for the lifetime of the contract\\n */\\n function totalOutstandingAmount() public view override returns (uint256) {\\n return managedAmount.sub(releasedAmount).sub(revokedAmount);\\n }\\n\\n /**\\n * @notice Gets surplus amount in the contract based on outstanding amount to release\\n * @dev All funds over outstanding amount is considered surplus that can be withdrawn by beneficiary\\n * @return Amount of tokens considered as surplus\\n */\\n function surplusAmount() public view override returns (uint256) {\\n uint256 balance = currentBalance();\\n uint256 outstandingAmount = totalOutstandingAmount();\\n if (balance > outstandingAmount) {\\n return balance.sub(outstandingAmount);\\n }\\n return 0;\\n }\\n\\n // -- Value Transfer --\\n\\n /**\\n * @notice Releases tokens based on the configured schedule\\n * @dev All available releasable tokens are transferred to beneficiary\\n */\\n function release() external override onlyBeneficiary {\\n uint256 amountToRelease = releasableAmount();\\n require(amountToRelease > 0, \\\"No available releasable amount\\\");\\n\\n releasedAmount = releasedAmount.add(amountToRelease);\\n\\n token.safeTransfer(beneficiary, amountToRelease);\\n\\n emit TokensReleased(beneficiary, amountToRelease);\\n }\\n\\n /**\\n * @notice Withdraws surplus, unmanaged tokens from the contract\\n * @dev Tokens in the contract over outstanding amount are considered as surplus\\n * @param _amount Amount of tokens to withdraw\\n */\\n function withdrawSurplus(uint256 _amount) external override onlyBeneficiary {\\n require(_amount > 0, \\\"Amount cannot be zero\\\");\\n require(surplusAmount() >= _amount, \\\"Amount requested > surplus available\\\");\\n\\n token.safeTransfer(beneficiary, _amount);\\n\\n emit TokensWithdrawn(beneficiary, _amount);\\n }\\n\\n /**\\n * @notice Revokes a vesting schedule and return the unvested tokens to the owner\\n * @dev Vesting schedule is always calculated based on managed tokens\\n */\\n function revoke() external override onlyOwner {\\n require(revocable == Revocability.Enabled, \\\"Contract is non-revocable\\\");\\n require(isRevoked == false, \\\"Already revoked\\\");\\n\\n uint256 unvestedAmount = managedAmount.sub(vestedAmount());\\n require(unvestedAmount > 0, \\\"No available unvested amount\\\");\\n\\n revokedAmount = unvestedAmount;\\n isRevoked = true;\\n\\n token.safeTransfer(owner(), unvestedAmount);\\n\\n emit TokensRevoked(beneficiary, unvestedAmount);\\n }\\n}\\n\",\"keccak256\":\"0x21a1dae4105ba9ff6d9bc38bf983ee853976346562fa284f4b67a3c7ca91a2bf\",\"license\":\"MIT\"},\"contracts/GraphTokenLockWallet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"@openzeppelin/contracts/math/SafeMath.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\\\";\\n\\nimport \\\"./GraphTokenLock.sol\\\";\\nimport \\\"./IGraphTokenLockManager.sol\\\";\\n\\n/**\\n * @title GraphTokenLockWallet\\n * @notice This contract is built on top of the base GraphTokenLock functionality.\\n * It allows wallet beneficiaries to use the deposited funds to perform specific function calls\\n * on specific contracts.\\n *\\n * The idea is that supporters with locked tokens can participate in the protocol\\n * but disallow any release before the vesting/lock schedule.\\n * The beneficiary can issue authorized function calls to this contract that will\\n * get forwarded to a target contract. A target contract is any of our protocol contracts.\\n * The function calls allowed are queried to the GraphTokenLockManager, this way\\n * the same configuration can be shared for all the created lock wallet contracts.\\n *\\n * NOTE: Contracts used as target must have its function signatures checked to avoid collisions\\n * with any of this contract functions.\\n * Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience\\n * the maximum amount of tokens is authorized.\\n */\\ncontract GraphTokenLockWallet is GraphTokenLock {\\n using SafeMath for uint256;\\n using SafeERC20 for IERC20;\\n\\n // -- State --\\n\\n IGraphTokenLockManager public manager;\\n uint256 public usedAmount;\\n\\n uint256 private constant MAX_UINT256 = 2**256 - 1;\\n\\n // -- Events --\\n\\n event ManagerUpdated(address indexed _oldManager, address indexed _newManager);\\n event TokenDestinationsApproved();\\n event TokenDestinationsRevoked();\\n\\n // Initializer\\n function initialize(\\n address _manager,\\n address _owner,\\n address _beneficiary,\\n address _token,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n Revocability _revocable\\n ) external {\\n _initialize(\\n _owner,\\n _beneficiary,\\n _token,\\n _managedAmount,\\n _startTime,\\n _endTime,\\n _periods,\\n _releaseStartTime,\\n _vestingCliffTime,\\n _revocable\\n );\\n _setManager(_manager);\\n }\\n\\n // -- Admin --\\n\\n /**\\n * @notice Sets a new manager for this contract\\n * @param _newManager Address of the new manager\\n */\\n function setManager(address _newManager) external onlyOwner {\\n _setManager(_newManager);\\n }\\n\\n /**\\n * @dev Sets a new manager for this contract\\n * @param _newManager Address of the new manager\\n */\\n function _setManager(address _newManager) private {\\n require(_newManager != address(0), \\\"Manager cannot be empty\\\");\\n require(Address.isContract(_newManager), \\\"Manager must be a contract\\\");\\n\\n address oldManager = address(manager);\\n manager = IGraphTokenLockManager(_newManager);\\n\\n emit ManagerUpdated(oldManager, _newManager);\\n }\\n\\n // -- Beneficiary --\\n\\n /**\\n * @notice Approves protocol access of the tokens managed by this contract\\n * @dev Approves all token destinations registered in the manager to pull tokens\\n */\\n function approveProtocol() external onlyBeneficiary {\\n address[] memory dstList = manager.getTokenDestinations();\\n for (uint256 i = 0; i < dstList.length; i++) {\\n token.safeApprove(dstList[i], MAX_UINT256);\\n }\\n emit TokenDestinationsApproved();\\n }\\n\\n /**\\n * @notice Revokes protocol access of the tokens managed by this contract\\n * @dev Revokes approval to all token destinations in the manager to pull tokens\\n */\\n function revokeProtocol() external onlyBeneficiary {\\n address[] memory dstList = manager.getTokenDestinations();\\n for (uint256 i = 0; i < dstList.length; i++) {\\n token.safeApprove(dstList[i], 0);\\n }\\n emit TokenDestinationsRevoked();\\n }\\n\\n /**\\n * @notice Gets tokens currently available for release\\n * @dev Considers the schedule, takes into account already released tokens and used amount\\n * @return Amount of tokens ready to be released\\n */\\n function releasableAmount() public view override returns (uint256) {\\n if (revocable == Revocability.Disabled) {\\n return super.releasableAmount();\\n }\\n\\n // -- Revocability enabled logic\\n // This needs to deal with additional considerations for when tokens are used in the protocol\\n\\n // If a release start time is set no tokens are available for release before this date\\n // If not set it follows the default schedule and tokens are available on\\n // the first period passed\\n if (releaseStartTime > 0 && currentTime() < releaseStartTime) {\\n return 0;\\n }\\n\\n // Vesting cliff is activated and it has not passed means nothing is vested yet\\n // so funds cannot be released\\n if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\\n return 0;\\n }\\n\\n // A beneficiary can never have more releasable tokens than the contract balance\\n // We consider the `usedAmount` in the protocol as part of the calculations\\n // the beneficiary should not release funds that are used.\\n uint256 releasable = availableAmount().sub(releasedAmount).sub(usedAmount);\\n return MathUtils.min(currentBalance(), releasable);\\n }\\n\\n /**\\n * @notice Forward authorized contract calls to protocol contracts\\n * @dev Fallback function can be called by the beneficiary only if function call is allowed\\n */\\n fallback() external payable {\\n // Only beneficiary can forward calls\\n require(msg.sender == beneficiary, \\\"Unauthorized caller\\\");\\n\\n // Function call validation\\n address _target = manager.getAuthFunctionCallTarget(msg.sig);\\n require(_target != address(0), \\\"Unauthorized function\\\");\\n\\n uint256 oldBalance = currentBalance();\\n\\n // Call function with data\\n Address.functionCall(_target, msg.data);\\n\\n // Tracked used tokens in the protocol\\n // We do this check after balances were updated by the forwarded call\\n // Check is only enforced for revocable contracts to save some gas\\n if (revocable == Revocability.Enabled) {\\n // Track contract balance change\\n uint256 newBalance = currentBalance();\\n if (newBalance < oldBalance) {\\n // Outflow\\n uint256 diff = oldBalance.sub(newBalance);\\n usedAmount = usedAmount.add(diff);\\n } else {\\n // Inflow: We can receive profits from the protocol, that could make usedAmount to\\n // underflow. We set it to zero in that case.\\n uint256 diff = newBalance.sub(oldBalance);\\n usedAmount = (diff >= usedAmount) ? 0 : usedAmount.sub(diff);\\n }\\n require(usedAmount <= vestedAmount(), \\\"Cannot use more tokens than vested amount\\\");\\n }\\n }\\n}\\n\",\"keccak256\":\"0x5efc82d408fe81193664e67d614ca6299eafb00163ecc7819fad77cf0d35a2eb\",\"license\":\"MIT\"},\"contracts/IGraphTokenLock.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\ninterface IGraphTokenLock {\\n enum Revocability {\\n NotSet,\\n Enabled,\\n Disabled\\n }\\n\\n // -- Balances --\\n\\n function currentBalance() external view returns (uint256);\\n\\n // -- Time & Periods --\\n\\n function currentTime() external view returns (uint256);\\n\\n function duration() external view returns (uint256);\\n\\n function sinceStartTime() external view returns (uint256);\\n\\n function amountPerPeriod() external view returns (uint256);\\n\\n function periodDuration() external view returns (uint256);\\n\\n function currentPeriod() external view returns (uint256);\\n\\n function passedPeriods() external view returns (uint256);\\n\\n // -- Locking & Release Schedule --\\n\\n function availableAmount() external view returns (uint256);\\n\\n function vestedAmount() external view returns (uint256);\\n\\n function releasableAmount() external view returns (uint256);\\n\\n function totalOutstandingAmount() external view returns (uint256);\\n\\n function surplusAmount() external view returns (uint256);\\n\\n // -- Value Transfer --\\n\\n function release() external;\\n\\n function withdrawSurplus(uint256 _amount) external;\\n\\n function revoke() external;\\n}\\n\",\"keccak256\":\"0xceb9d258276fe25ec858191e1deae5778f1b2f612a669fb7b37bab1a064756ab\",\"license\":\"MIT\"},\"contracts/IGraphTokenLockManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nimport \\\"./IGraphTokenLock.sol\\\";\\n\\ninterface IGraphTokenLockManager {\\n // -- Factory --\\n\\n function setMasterCopy(address _masterCopy) external;\\n\\n function createTokenLockWallet(\\n address _owner,\\n address _beneficiary,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n IGraphTokenLock.Revocability _revocable\\n ) external;\\n\\n // -- Funds Management --\\n\\n function token() external returns (IERC20);\\n\\n function deposit(uint256 _amount) external;\\n\\n function withdraw(uint256 _amount) external;\\n\\n // -- Allowed Funds Destinations --\\n\\n function addTokenDestination(address _dst) external;\\n\\n function removeTokenDestination(address _dst) external;\\n\\n function isTokenDestination(address _dst) external view returns (bool);\\n\\n function getTokenDestinations() external view returns (address[] memory);\\n\\n // -- Function Call Authorization --\\n\\n function setAuthFunctionCall(string calldata _signature, address _target) external;\\n\\n function unsetAuthFunctionCall(string calldata _signature) external;\\n\\n function setAuthFunctionCallMany(string[] calldata _signatures, address[] calldata _targets) external;\\n\\n function getAuthFunctionCallTarget(bytes4 _sigHash) external view returns (address);\\n\\n function isAuthFunctionCall(bytes4 _sigHash) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x2d78d41909a6de5b316ac39b100ea087a8f317cf306379888a045523e15c4d9a\",\"license\":\"MIT\"},\"contracts/MathUtils.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nlibrary MathUtils {\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n}\\n\",\"keccak256\":\"0xe2512e1da48bc8363acd15f66229564b02d66706665d7da740604566913c1400\",\"license\":\"MIT\"},\"contracts/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * The owner account will be passed on initialization of the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\ncontract Ownable {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n function initialize(address owner) internal {\\n _owner = owner;\\n emit OwnershipTransferred(address(0), owner);\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(_owner == msg.sender, \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() external virtual onlyOwner {\\n emit OwnershipTransferred(_owner, address(0));\\n _owner = address(0);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) external virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n emit OwnershipTransferred(_owner, newOwner);\\n _owner = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0xc93c7362ac4d74b624b48517985f92c277ce90ae6e5ccb706e70a61af5752077\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b50613e61806100206000396000f3fe6080604052600436106102555760003560e01c806386d00e0211610139578063bc0163c1116100b6578063dc0706571161007a578063dc07065714610d0e578063e8dda6f514610d5f578063e97d87d514610d8a578063ebbab99214610db5578063f2fde38b14610de0578063fc0c546a14610e3157610256565b8063bc0163c114610b41578063bd896dcb14610b6c578063ce845d1d14610c67578063d0ebdbe714610c92578063d18e81b314610ce357610256565b806391f7cfb9116100fd57806391f7cfb914610a6e578063a4caeb4214610a99578063b0d1818c14610ac4578063b470aade14610aff578063b6549f7514610b2a57610256565b806386d00e021461099e57806386d1a69f146109c9578063872a7810146109e05780638a5bdf5c14610a165780638da5cb5b14610a2d57610256565b8063392e53cd116101d25780635051a5ec116101965780635051a5ec146108c25780635b940081146108ef57806360e799441461091a578063715018a61461093157806378e97925146109485780637bdf05af1461097357610256565b8063392e53cd146107d3578063398057a31461080057806344b1231f1461082b57806345d30a1714610856578063481c6a751461088157610256565b80632a627814116102195780632a627814146106f85780632bc9ed021461070f5780633197cbb61461073c57806337aeb0861461076757806338af3eed1461079257610256565b8063029c6c9f1461063557806306040618146106605780630b80f7771461068b5780630dff24d5146106a25780630fb5a6b4146106cd57610256565b5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610319576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f556e617574686f72697a65642063616c6c65720000000000000000000000000081525060200191505060405180910390fd5b6000600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f1d24c456000357fffffffff00000000000000000000000000000000000000000000000000000000166040518263ffffffff1660e01b815260040180827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200191505060206040518083038186803b1580156103d157600080fd5b505afa1580156103e5573d6000803e3d6000fd5b505050506040513d60208110156103fb57600080fd5b81019080805190602001909291905050509050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156104b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f556e617574686f72697a65642066756e6374696f6e000000000000000000000081525060200191505060405180910390fd5b60006104bb610e72565b905061050c826000368080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610f3d565b506001600281111561051a57fe5b600960009054906101000a900460ff16600281111561053557fe5b1415610631576000610545610e72565b9050818110156105875760006105648284610f8790919063ffffffff16565b905061057b81600d5461100a90919063ffffffff16565b600d81905550506105cd565b600061059c8383610f8790919063ffffffff16565b9050600d548110156105c2576105bd81600d54610f8790919063ffffffff16565b6105c5565b60005b600d81905550505b6105d5611092565b600d54111561062f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613d346029913960400191505060405180910390fd5b505b5050005b34801561064157600080fd5b5061064a611101565b6040518082815260200191505060405180910390f35b34801561066c57600080fd5b5061067561111f565b6040518082815260200191505060405180910390f35b34801561069757600080fd5b506106a061115a565b005b3480156106ae57600080fd5b506106b761132d565b6040518082815260200191505060405180910390f35b3480156106d957600080fd5b506106e2611374565b6040518082815260200191505060405180910390f35b34801561070457600080fd5b5061070d611392565b005b34801561071b57600080fd5b5061072461165f565b60405180821515815260200191505060405180910390f35b34801561074857600080fd5b50610751611672565b6040518082815260200191505060405180910390f35b34801561077357600080fd5b5061077c611678565b6040518082815260200191505060405180910390f35b34801561079e57600080fd5b506107a761167e565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156107df57600080fd5b506107e86116a4565b60405180821515815260200191505060405180910390f35b34801561080c57600080fd5b506108156116b7565b6040518082815260200191505060405180910390f35b34801561083757600080fd5b50610840611092565b6040518082815260200191505060405180910390f35b34801561086257600080fd5b5061086b6116bd565b6040518082815260200191505060405180910390f35b34801561088d57600080fd5b506108966116c3565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156108ce57600080fd5b506108d76116e9565b60405180821515815260200191505060405180910390f35b3480156108fb57600080fd5b506109046116fc565b6040518082815260200191505060405180910390f35b34801561092657600080fd5b5061092f611807565b005b34801561093d57600080fd5b50610946611ab5565b005b34801561095457600080fd5b5061095d611c34565b6040518082815260200191505060405180910390f35b34801561097f57600080fd5b50610988611c3a565b6040518082815260200191505060405180910390f35b3480156109aa57600080fd5b506109b3611c76565b6040518082815260200191505060405180910390f35b3480156109d557600080fd5b506109de611c7c565b005b3480156109ec57600080fd5b506109f5611ebe565b60405180826002811115610a0557fe5b815260200191505060405180910390f35b348015610a2257600080fd5b50610a2b611ed1565b005b348015610a3957600080fd5b50610a42611fdd565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610a7a57600080fd5b50610a83612006565b6040518082815260200191505060405180910390f35b348015610aa557600080fd5b50610aae612064565b6040518082815260200191505060405180910390f35b348015610ad057600080fd5b50610afd60048036036020811015610ae757600080fd5b810190808035906020019092919050505061206a565b005b348015610b0b57600080fd5b50610b146122e5565b6040518082815260200191505060405180910390f35b348015610b3657600080fd5b50610b3f612308565b005b348015610b4d57600080fd5b50610b5661266c565b6040518082815260200191505060405180910390f35b348015610b7857600080fd5b50610c656004803603610160811015610b9057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190803560ff16906020019092919050505061269e565b005b348015610c7357600080fd5b50610c7c610e72565b6040518082815260200191505060405180910390f35b348015610c9e57600080fd5b50610ce160048036036020811015610cb557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506126c6565b005b348015610cef57600080fd5b50610cf8612793565b6040518082815260200191505060405180910390f35b348015610d1a57600080fd5b50610d5d60048036036020811015610d3157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061279b565b005b348015610d6b57600080fd5b50610d74612992565b6040518082815260200191505060405180910390f35b348015610d9657600080fd5b50610d9f612998565b6040518082815260200191505060405180910390f35b348015610dc157600080fd5b50610dca61299e565b6040518082815260200191505060405180910390f35b348015610dec57600080fd5b50610e2f60048036036020811015610e0357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506129c0565b005b348015610e3d57600080fd5b50610e46612bc4565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610efd57600080fd5b505afa158015610f11573d6000803e3d6000fd5b505050506040513d6020811015610f2757600080fd5b8101908080519060200190929190505050905090565b6060610f7f83836040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c65640000815250612bea565b905092915050565b600082821115610fff576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525060200191505060405180910390fd5b818303905092915050565b600080828401905083811015611088576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b60006002808111156110a057fe5b600960009054906101000a900460ff1660028111156110bb57fe5b14156110cb5760035490506110fe565b60006008541180156110e557506008546110e3612793565b105b156110f357600090506110fe565b6110fb612006565b90505b90565b600061111a600654600354612c0290919063ffffffff16565b905090565b600061115560016111476111316122e5565b611139611c3a565b612c0290919063ffffffff16565b61100a90919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461121b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60001515600960039054906101000a900460ff161515146112a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f43616e6e6f742063616e63656c20616363657074656420636f6e74726163740081525060200191505060405180910390fd5b6112ff6112af611fdd565b6112b7610e72565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612c8b9092919063ffffffff16565b7f171f0bcbda3370351cea17f3b164bee87d77c2503b94abdf2720a814ebe7e9df60405160405180910390a1565b600080611338610e72565b9050600061134461266c565b90508082111561136a576113618183610f8790919063ffffffff16565b92505050611371565b6000925050505b90565b600061138d600454600554610f8790919063ffffffff16565b905090565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611455576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6060600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a34574666040518163ffffffff1660e01b815260040160006040518083038186803b1580156114bf57600080fd5b505afa1580156114d3573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525060208110156114fd57600080fd5b810190808051604051939291908464010000000082111561151d57600080fd5b8382019150602082018581111561153357600080fd5b825186602082028301116401000000008211171561155057600080fd5b8083526020830192505050908051906020019060200280838360005b8381101561158757808201518184015260208101905061156c565b50505050905001604052505050905060005b815181101561162f576116228282815181106115b157fe5b60200260200101517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612d2d9092919063ffffffff16565b8080600101915050611599565b507fb837fd51506ba3cc623a37c78ed22fd521f2f6e9f69a34d5c2a4a9474f27579360405160405180910390a150565b600960019054906101000a900460ff1681565b60055481565b600b5481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600960029054906101000a900460ff1681565b60035481565b600a5481565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600960039054906101000a900460ff1681565b600060028081111561170a57fe5b600960009054906101000a900460ff16600281111561172557fe5b141561173a57611733612ef2565b9050611804565b60006007541180156117545750600754611752612793565b105b156117625760009050611804565b6001600281111561176f57fe5b600960009054906101000a900460ff16600281111561178a57fe5b14801561179957506000600854115b80156117ad57506008546117ab612793565b105b156117bb5760009050611804565b60006117ed600d546117df600a546117d1612006565b610f8790919063ffffffff16565b610f8790919063ffffffff16565b90506118006117fa610e72565b82612fac565b9150505b90565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146118ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6060600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a34574666040518163ffffffff1660e01b815260040160006040518083038186803b15801561193457600080fd5b505afa158015611948573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250602081101561197257600080fd5b810190808051604051939291908464010000000082111561199257600080fd5b838201915060208201858111156119a857600080fd5b82518660208202830111640100000000821117156119c557600080fd5b8083526020830192505050908051906020019060200280838360005b838110156119fc5780820151818401526020810190506119e1565b50505050905001604052505050905060005b8151811015611a8557611a78828281518110611a2657fe5b60200260200101516000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612d2d9092919063ffffffff16565b8080600101915050611a0e565b507f6d317a20ba9d790014284bef285283cd61fde92e0f2711050f563a9d2cf4171160405160405180910390a150565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611b76576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60045481565b600080611c45612793565b90506004548111611c5a576000915050611c73565b611c6f60045482610f8790919063ffffffff16565b9150505b90565b60085481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611d3f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000611d496116fc565b905060008111611dc1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f4e6f20617661696c61626c652072656c65617361626c6520616d6f756e74000081525060200191505060405180910390fd5b611dd681600a5461100a90919063ffffffff16565b600a81905550611e4b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612c8b9092919063ffffffff16565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fc7798891864187665ac6dd119286e44ec13f014527aeeb2b8eb3fd413df93179826040518082815260200191505060405180910390a250565b600960009054906101000a900460ff1681565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611f94576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6001600960036101000a81548160ff0219169083151502179055507fbeb3313724453131feb0a765a03e6715bb720e0f973a31fcbafa2d2f048c188b60405160405180910390a1565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600080612011612793565b9050600454811015612027576000915050612061565b60055481111561203c57600354915050612061565b61205d612047611101565b61204f61299e565b612fc590919063ffffffff16565b9150505b90565b60065481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461212d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600081116121a3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f416d6f756e742063616e6e6f74206265207a65726f000000000000000000000081525060200191505060405180910390fd5b806121ac61132d565b1015612203576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613d7e6024913960400191505060405180910390fd5b612272600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612c8b9092919063ffffffff16565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b826040518082815260200191505060405180910390a250565b60006123036006546122f5611374565b612c0290919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146123c9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600160028111156123d657fe5b600960009054906101000a900460ff1660028111156123f157fe5b14612464576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f436f6e7472616374206973206e6f6e2d7265766f6361626c650000000000000081525060200191505060405180910390fd5b60001515600960019054906101000a900460ff161515146124ed576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f416c7265616479207265766f6b6564000000000000000000000000000000000081525060200191505060405180910390fd5b600061250b6124fa611092565b600354610f8790919063ffffffff16565b905060008111612583576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f4e6f20617661696c61626c6520756e76657374656420616d6f756e740000000081525060200191505060405180910390fd5b80600b819055506001600960016101000a81548160ff0219169083151502179055506125f96125b0611fdd565b82600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612c8b9092919063ffffffff16565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fb73c49a3a37a7aca291ba0ceaa41657012def406106a7fc386888f0f66e941cf826040518082815260200191505060405180910390a250565b6000612699600b5461268b600a54600354610f8790919063ffffffff16565b610f8790919063ffffffff16565b905090565b6126b08a8a8a8a8a8a8a8a8a8a61304b565b6126b98b6136cc565b5050505050505050505050565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612787576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b612790816136cc565b50565b600042905090565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461285e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612901576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f456d7074792062656e656669636961727900000000000000000000000000000081525060200191505060405180910390fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f373c72efabe4ef3e552ff77838be729f3bc3d8c586df0012902d1baa2377fa1d81604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b600d5481565b60075481565b60006129bb60016129ad61111f565b610f8790919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612a81576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612b07576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180613ce86026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6060612bf984846000856138b0565b90509392505050565b6000808211612c79576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525060200191505060405180910390fd5b818381612c8257fe5b04905092915050565b612d288363a9059cbb60e01b8484604051602401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050613a59565b505050565b6000811480612dfb575060008373ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e30856040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b158015612dbe57600080fd5b505afa158015612dd2573d6000803e3d6000fd5b505050506040513d6020811015612de857600080fd5b8101908080519060200190929190505050145b612e50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526036815260200180613df66036913960400191505060405180910390fd5b612eed8363095ea7b360e01b8484604051602401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050613a59565b505050565b600080600754118015612f0d5750600754612f0b612793565b105b15612f1b5760009050612fa9565b60016002811115612f2857fe5b600960009054906101000a900460ff166002811115612f4357fe5b148015612f5257506000600854115b8015612f665750600854612f64612793565b105b15612f745760009050612fa9565b6000612f92600a54612f84612006565b610f8790919063ffffffff16565b9050612fa5612f9f610e72565b82612fac565b9150505b90565b6000818310612fbb5781612fbd565b825b905092915050565b600080831415612fd85760009050613045565b6000828402905082848281612fe957fe5b0414613040576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613d5d6021913960400191505060405180910390fd5b809150505b92915050565b600960029054906101000a900460ff16156130ce576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f416c726561647920696e697469616c697a65640000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff161415613171576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f4f776e65722063616e6e6f74206265207a65726f00000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff161415613214576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f42656e65666963696172792063616e6e6f74206265207a65726f00000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff1614156132b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f546f6b656e2063616e6e6f74206265207a65726f00000000000000000000000081525060200191505060405180910390fd5b6000871161332d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f4d616e6167656420746f6b656e732063616e6e6f74206265207a65726f00000081525060200191505060405180910390fd5b60008614156133a4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53746172742074696d65206d757374206265207365740000000000000000000081525060200191505060405180910390fd5b848610613419576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f53746172742074696d65203e20656e642074696d65000000000000000000000081525060200191505060405180910390fd5b6001841015613490576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f506572696f64732063616e6e6f742062652062656c6f77206d696e696d756d0081525060200191505060405180910390fd5b6000600281111561349d57fe5b8160028111156134a957fe5b141561351d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f4d757374207365742061207265766f636162696c697479206f7074696f6e000081525060200191505060405180910390fd5b848310613575576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613da2602a913960400191505060405180910390fd5b8482106135cd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613cc66022913960400191505060405180910390fd5b6001600960026101000a81548160ff0219169083151502179055506135f18a613b48565b88600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555087600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555086600381905550856004819055508460058190555083600681905550826007819055508160088190555080600960006101000a81548160ff021916908360028111156136bb57fe5b021790555050505050505050505050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561376f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4d616e616765722063616e6e6f7420626520656d70747900000000000000000081525060200191505060405180910390fd5b61377881613be6565b6137ea576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f4d616e61676572206d757374206265206120636f6e747261637400000000000081525060200191505060405180910390fd5b6000600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fdac3632743b879638fd2d51c4d3c1dd796615b4758a55b50b0c19b971ba9fbc760405160405180910390a35050565b60608247101561390b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180613d0e6026913960400191505060405180910390fd5b61391485613be6565b613986576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000081525060200191505060405180910390fd5b600060608673ffffffffffffffffffffffffffffffffffffffff1685876040518082805190602001908083835b602083106139d657805182526020820191506020810190506020830392506139b3565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114613a38576040519150601f19603f3d011682016040523d82523d6000602084013e613a3d565b606091505b5091509150613a4d828286613bf9565b92505050949350505050565b6060613abb826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16612bea9092919063ffffffff16565b9050600081511115613b4357808060200190516020811015613adc57600080fd5b8101908080519060200190929190505050613b42576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613dcc602a913960400191505060405180910390fd5b5b505050565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a350565b600080823b905060008111915050919050565b60608315613c0957829050613cbe565b600083511115613c1c5782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015613c83578082015181840152602081019050613c68565b50505050905090810190601f168015613cb05780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b939250505056fe436c6966662074696d65206d757374206265206265666f726520656e642074696d654f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c43616e6e6f7420757365206d6f726520746f6b656e73207468616e2076657374656420616d6f756e74536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77416d6f756e7420726571756573746564203e20737572706c757320617661696c61626c6552656c656173652073746172742074696d65206d757374206265206265666f726520656e642074696d655361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565645361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f20746f206e6f6e2d7a65726f20616c6c6f77616e6365a26469706673582212203c6b20b5a223b9b9c9f0008dfba22c9fb703c6524c0f0a76a2b156733f6d573464736f6c63430007030033", + "deployedBytecode": "0x6080604052600436106102555760003560e01c806386d00e0211610139578063bc0163c1116100b6578063dc0706571161007a578063dc07065714610d0e578063e8dda6f514610d5f578063e97d87d514610d8a578063ebbab99214610db5578063f2fde38b14610de0578063fc0c546a14610e3157610256565b8063bc0163c114610b41578063bd896dcb14610b6c578063ce845d1d14610c67578063d0ebdbe714610c92578063d18e81b314610ce357610256565b806391f7cfb9116100fd57806391f7cfb914610a6e578063a4caeb4214610a99578063b0d1818c14610ac4578063b470aade14610aff578063b6549f7514610b2a57610256565b806386d00e021461099e57806386d1a69f146109c9578063872a7810146109e05780638a5bdf5c14610a165780638da5cb5b14610a2d57610256565b8063392e53cd116101d25780635051a5ec116101965780635051a5ec146108c25780635b940081146108ef57806360e799441461091a578063715018a61461093157806378e97925146109485780637bdf05af1461097357610256565b8063392e53cd146107d3578063398057a31461080057806344b1231f1461082b57806345d30a1714610856578063481c6a751461088157610256565b80632a627814116102195780632a627814146106f85780632bc9ed021461070f5780633197cbb61461073c57806337aeb0861461076757806338af3eed1461079257610256565b8063029c6c9f1461063557806306040618146106605780630b80f7771461068b5780630dff24d5146106a25780630fb5a6b4146106cd57610256565b5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610319576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f556e617574686f72697a65642063616c6c65720000000000000000000000000081525060200191505060405180910390fd5b6000600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f1d24c456000357fffffffff00000000000000000000000000000000000000000000000000000000166040518263ffffffff1660e01b815260040180827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200191505060206040518083038186803b1580156103d157600080fd5b505afa1580156103e5573d6000803e3d6000fd5b505050506040513d60208110156103fb57600080fd5b81019080805190602001909291905050509050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156104b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f556e617574686f72697a65642066756e6374696f6e000000000000000000000081525060200191505060405180910390fd5b60006104bb610e72565b905061050c826000368080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610f3d565b506001600281111561051a57fe5b600960009054906101000a900460ff16600281111561053557fe5b1415610631576000610545610e72565b9050818110156105875760006105648284610f8790919063ffffffff16565b905061057b81600d5461100a90919063ffffffff16565b600d81905550506105cd565b600061059c8383610f8790919063ffffffff16565b9050600d548110156105c2576105bd81600d54610f8790919063ffffffff16565b6105c5565b60005b600d81905550505b6105d5611092565b600d54111561062f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613d346029913960400191505060405180910390fd5b505b5050005b34801561064157600080fd5b5061064a611101565b6040518082815260200191505060405180910390f35b34801561066c57600080fd5b5061067561111f565b6040518082815260200191505060405180910390f35b34801561069757600080fd5b506106a061115a565b005b3480156106ae57600080fd5b506106b761132d565b6040518082815260200191505060405180910390f35b3480156106d957600080fd5b506106e2611374565b6040518082815260200191505060405180910390f35b34801561070457600080fd5b5061070d611392565b005b34801561071b57600080fd5b5061072461165f565b60405180821515815260200191505060405180910390f35b34801561074857600080fd5b50610751611672565b6040518082815260200191505060405180910390f35b34801561077357600080fd5b5061077c611678565b6040518082815260200191505060405180910390f35b34801561079e57600080fd5b506107a761167e565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156107df57600080fd5b506107e86116a4565b60405180821515815260200191505060405180910390f35b34801561080c57600080fd5b506108156116b7565b6040518082815260200191505060405180910390f35b34801561083757600080fd5b50610840611092565b6040518082815260200191505060405180910390f35b34801561086257600080fd5b5061086b6116bd565b6040518082815260200191505060405180910390f35b34801561088d57600080fd5b506108966116c3565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156108ce57600080fd5b506108d76116e9565b60405180821515815260200191505060405180910390f35b3480156108fb57600080fd5b506109046116fc565b6040518082815260200191505060405180910390f35b34801561092657600080fd5b5061092f611807565b005b34801561093d57600080fd5b50610946611ab5565b005b34801561095457600080fd5b5061095d611c34565b6040518082815260200191505060405180910390f35b34801561097f57600080fd5b50610988611c3a565b6040518082815260200191505060405180910390f35b3480156109aa57600080fd5b506109b3611c76565b6040518082815260200191505060405180910390f35b3480156109d557600080fd5b506109de611c7c565b005b3480156109ec57600080fd5b506109f5611ebe565b60405180826002811115610a0557fe5b815260200191505060405180910390f35b348015610a2257600080fd5b50610a2b611ed1565b005b348015610a3957600080fd5b50610a42611fdd565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610a7a57600080fd5b50610a83612006565b6040518082815260200191505060405180910390f35b348015610aa557600080fd5b50610aae612064565b6040518082815260200191505060405180910390f35b348015610ad057600080fd5b50610afd60048036036020811015610ae757600080fd5b810190808035906020019092919050505061206a565b005b348015610b0b57600080fd5b50610b146122e5565b6040518082815260200191505060405180910390f35b348015610b3657600080fd5b50610b3f612308565b005b348015610b4d57600080fd5b50610b5661266c565b6040518082815260200191505060405180910390f35b348015610b7857600080fd5b50610c656004803603610160811015610b9057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190803560ff16906020019092919050505061269e565b005b348015610c7357600080fd5b50610c7c610e72565b6040518082815260200191505060405180910390f35b348015610c9e57600080fd5b50610ce160048036036020811015610cb557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506126c6565b005b348015610cef57600080fd5b50610cf8612793565b6040518082815260200191505060405180910390f35b348015610d1a57600080fd5b50610d5d60048036036020811015610d3157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061279b565b005b348015610d6b57600080fd5b50610d74612992565b6040518082815260200191505060405180910390f35b348015610d9657600080fd5b50610d9f612998565b6040518082815260200191505060405180910390f35b348015610dc157600080fd5b50610dca61299e565b6040518082815260200191505060405180910390f35b348015610dec57600080fd5b50610e2f60048036036020811015610e0357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506129c0565b005b348015610e3d57600080fd5b50610e46612bc4565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610efd57600080fd5b505afa158015610f11573d6000803e3d6000fd5b505050506040513d6020811015610f2757600080fd5b8101908080519060200190929190505050905090565b6060610f7f83836040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c65640000815250612bea565b905092915050565b600082821115610fff576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525060200191505060405180910390fd5b818303905092915050565b600080828401905083811015611088576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b60006002808111156110a057fe5b600960009054906101000a900460ff1660028111156110bb57fe5b14156110cb5760035490506110fe565b60006008541180156110e557506008546110e3612793565b105b156110f357600090506110fe565b6110fb612006565b90505b90565b600061111a600654600354612c0290919063ffffffff16565b905090565b600061115560016111476111316122e5565b611139611c3a565b612c0290919063ffffffff16565b61100a90919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461121b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60001515600960039054906101000a900460ff161515146112a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f43616e6e6f742063616e63656c20616363657074656420636f6e74726163740081525060200191505060405180910390fd5b6112ff6112af611fdd565b6112b7610e72565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612c8b9092919063ffffffff16565b7f171f0bcbda3370351cea17f3b164bee87d77c2503b94abdf2720a814ebe7e9df60405160405180910390a1565b600080611338610e72565b9050600061134461266c565b90508082111561136a576113618183610f8790919063ffffffff16565b92505050611371565b6000925050505b90565b600061138d600454600554610f8790919063ffffffff16565b905090565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611455576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6060600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a34574666040518163ffffffff1660e01b815260040160006040518083038186803b1580156114bf57600080fd5b505afa1580156114d3573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525060208110156114fd57600080fd5b810190808051604051939291908464010000000082111561151d57600080fd5b8382019150602082018581111561153357600080fd5b825186602082028301116401000000008211171561155057600080fd5b8083526020830192505050908051906020019060200280838360005b8381101561158757808201518184015260208101905061156c565b50505050905001604052505050905060005b815181101561162f576116228282815181106115b157fe5b60200260200101517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612d2d9092919063ffffffff16565b8080600101915050611599565b507fb837fd51506ba3cc623a37c78ed22fd521f2f6e9f69a34d5c2a4a9474f27579360405160405180910390a150565b600960019054906101000a900460ff1681565b60055481565b600b5481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600960029054906101000a900460ff1681565b60035481565b600a5481565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600960039054906101000a900460ff1681565b600060028081111561170a57fe5b600960009054906101000a900460ff16600281111561172557fe5b141561173a57611733612ef2565b9050611804565b60006007541180156117545750600754611752612793565b105b156117625760009050611804565b6001600281111561176f57fe5b600960009054906101000a900460ff16600281111561178a57fe5b14801561179957506000600854115b80156117ad57506008546117ab612793565b105b156117bb5760009050611804565b60006117ed600d546117df600a546117d1612006565b610f8790919063ffffffff16565b610f8790919063ffffffff16565b90506118006117fa610e72565b82612fac565b9150505b90565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146118ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6060600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a34574666040518163ffffffff1660e01b815260040160006040518083038186803b15801561193457600080fd5b505afa158015611948573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250602081101561197257600080fd5b810190808051604051939291908464010000000082111561199257600080fd5b838201915060208201858111156119a857600080fd5b82518660208202830111640100000000821117156119c557600080fd5b8083526020830192505050908051906020019060200280838360005b838110156119fc5780820151818401526020810190506119e1565b50505050905001604052505050905060005b8151811015611a8557611a78828281518110611a2657fe5b60200260200101516000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612d2d9092919063ffffffff16565b8080600101915050611a0e565b507f6d317a20ba9d790014284bef285283cd61fde92e0f2711050f563a9d2cf4171160405160405180910390a150565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611b76576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60045481565b600080611c45612793565b90506004548111611c5a576000915050611c73565b611c6f60045482610f8790919063ffffffff16565b9150505b90565b60085481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611d3f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000611d496116fc565b905060008111611dc1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f4e6f20617661696c61626c652072656c65617361626c6520616d6f756e74000081525060200191505060405180910390fd5b611dd681600a5461100a90919063ffffffff16565b600a81905550611e4b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612c8b9092919063ffffffff16565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fc7798891864187665ac6dd119286e44ec13f014527aeeb2b8eb3fd413df93179826040518082815260200191505060405180910390a250565b600960009054906101000a900460ff1681565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611f94576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6001600960036101000a81548160ff0219169083151502179055507fbeb3313724453131feb0a765a03e6715bb720e0f973a31fcbafa2d2f048c188b60405160405180910390a1565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600080612011612793565b9050600454811015612027576000915050612061565b60055481111561203c57600354915050612061565b61205d612047611101565b61204f61299e565b612fc590919063ffffffff16565b9150505b90565b60065481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461212d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600081116121a3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f416d6f756e742063616e6e6f74206265207a65726f000000000000000000000081525060200191505060405180910390fd5b806121ac61132d565b1015612203576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613d7e6024913960400191505060405180910390fd5b612272600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612c8b9092919063ffffffff16565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b826040518082815260200191505060405180910390a250565b60006123036006546122f5611374565b612c0290919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146123c9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600160028111156123d657fe5b600960009054906101000a900460ff1660028111156123f157fe5b14612464576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f436f6e7472616374206973206e6f6e2d7265766f6361626c650000000000000081525060200191505060405180910390fd5b60001515600960019054906101000a900460ff161515146124ed576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f416c7265616479207265766f6b6564000000000000000000000000000000000081525060200191505060405180910390fd5b600061250b6124fa611092565b600354610f8790919063ffffffff16565b905060008111612583576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f4e6f20617661696c61626c6520756e76657374656420616d6f756e740000000081525060200191505060405180910390fd5b80600b819055506001600960016101000a81548160ff0219169083151502179055506125f96125b0611fdd565b82600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612c8b9092919063ffffffff16565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fb73c49a3a37a7aca291ba0ceaa41657012def406106a7fc386888f0f66e941cf826040518082815260200191505060405180910390a250565b6000612699600b5461268b600a54600354610f8790919063ffffffff16565b610f8790919063ffffffff16565b905090565b6126b08a8a8a8a8a8a8a8a8a8a61304b565b6126b98b6136cc565b5050505050505050505050565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612787576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b612790816136cc565b50565b600042905090565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461285e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612901576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f456d7074792062656e656669636961727900000000000000000000000000000081525060200191505060405180910390fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f373c72efabe4ef3e552ff77838be729f3bc3d8c586df0012902d1baa2377fa1d81604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b600d5481565b60075481565b60006129bb60016129ad61111f565b610f8790919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612a81576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612b07576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180613ce86026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6060612bf984846000856138b0565b90509392505050565b6000808211612c79576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525060200191505060405180910390fd5b818381612c8257fe5b04905092915050565b612d288363a9059cbb60e01b8484604051602401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050613a59565b505050565b6000811480612dfb575060008373ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e30856040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b158015612dbe57600080fd5b505afa158015612dd2573d6000803e3d6000fd5b505050506040513d6020811015612de857600080fd5b8101908080519060200190929190505050145b612e50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526036815260200180613df66036913960400191505060405180910390fd5b612eed8363095ea7b360e01b8484604051602401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050613a59565b505050565b600080600754118015612f0d5750600754612f0b612793565b105b15612f1b5760009050612fa9565b60016002811115612f2857fe5b600960009054906101000a900460ff166002811115612f4357fe5b148015612f5257506000600854115b8015612f665750600854612f64612793565b105b15612f745760009050612fa9565b6000612f92600a54612f84612006565b610f8790919063ffffffff16565b9050612fa5612f9f610e72565b82612fac565b9150505b90565b6000818310612fbb5781612fbd565b825b905092915050565b600080831415612fd85760009050613045565b6000828402905082848281612fe957fe5b0414613040576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613d5d6021913960400191505060405180910390fd5b809150505b92915050565b600960029054906101000a900460ff16156130ce576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f416c726561647920696e697469616c697a65640000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff161415613171576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f4f776e65722063616e6e6f74206265207a65726f00000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff161415613214576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f42656e65666963696172792063616e6e6f74206265207a65726f00000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff1614156132b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f546f6b656e2063616e6e6f74206265207a65726f00000000000000000000000081525060200191505060405180910390fd5b6000871161332d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f4d616e6167656420746f6b656e732063616e6e6f74206265207a65726f00000081525060200191505060405180910390fd5b60008614156133a4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53746172742074696d65206d757374206265207365740000000000000000000081525060200191505060405180910390fd5b848610613419576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f53746172742074696d65203e20656e642074696d65000000000000000000000081525060200191505060405180910390fd5b6001841015613490576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f506572696f64732063616e6e6f742062652062656c6f77206d696e696d756d0081525060200191505060405180910390fd5b6000600281111561349d57fe5b8160028111156134a957fe5b141561351d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f4d757374207365742061207265766f636162696c697479206f7074696f6e000081525060200191505060405180910390fd5b848310613575576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613da2602a913960400191505060405180910390fd5b8482106135cd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613cc66022913960400191505060405180910390fd5b6001600960026101000a81548160ff0219169083151502179055506135f18a613b48565b88600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555087600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555086600381905550856004819055508460058190555083600681905550826007819055508160088190555080600960006101000a81548160ff021916908360028111156136bb57fe5b021790555050505050505050505050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561376f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4d616e616765722063616e6e6f7420626520656d70747900000000000000000081525060200191505060405180910390fd5b61377881613be6565b6137ea576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f4d616e61676572206d757374206265206120636f6e747261637400000000000081525060200191505060405180910390fd5b6000600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fdac3632743b879638fd2d51c4d3c1dd796615b4758a55b50b0c19b971ba9fbc760405160405180910390a35050565b60608247101561390b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180613d0e6026913960400191505060405180910390fd5b61391485613be6565b613986576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000081525060200191505060405180910390fd5b600060608673ffffffffffffffffffffffffffffffffffffffff1685876040518082805190602001908083835b602083106139d657805182526020820191506020810190506020830392506139b3565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114613a38576040519150601f19603f3d011682016040523d82523d6000602084013e613a3d565b606091505b5091509150613a4d828286613bf9565b92505050949350505050565b6060613abb826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16612bea9092919063ffffffff16565b9050600081511115613b4357808060200190516020811015613adc57600080fd5b8101908080519060200190929190505050613b42576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613dcc602a913960400191505060405180910390fd5b5b505050565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a350565b600080823b905060008111915050919050565b60608315613c0957829050613cbe565b600083511115613c1c5782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015613c83578082015181840152602081019050613c68565b50505050905090810190601f168015613cb05780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b939250505056fe436c6966662074696d65206d757374206265206265666f726520656e642074696d654f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c43616e6e6f7420757365206d6f726520746f6b656e73207468616e2076657374656420616d6f756e74536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77416d6f756e7420726571756573746564203e20737572706c757320617661696c61626c6552656c656173652073746172742074696d65206d757374206265206265666f726520656e642074696d655361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565645361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f20746f206e6f6e2d7a65726f20616c6c6f77616e6365a26469706673582212203c6b20b5a223b9b9c9f0008dfba22c9fb703c6524c0f0a76a2b156733f6d573464736f6c63430007030033", + "devdoc": { + "kind": "dev", + "methods": { + "acceptLock()": { + "details": "Can only be called by the beneficiary" + }, + "amountPerPeriod()": { + "returns": { + "_0": "Amount of tokens available after each period" + } + }, + "approveProtocol()": { + "details": "Approves all token destinations registered in the manager to pull tokens" + }, + "availableAmount()": { + "details": "Implements the step-by-step schedule based on periods for available tokens", + "returns": { + "_0": "Amount of tokens available according to the schedule" + } + }, + "cancelLock()": { + "details": "Can only be called by the owner" + }, + "changeBeneficiary(address)": { + "details": "Can only be called by the beneficiary", + "params": { + "_newBeneficiary": "Address of the new beneficiary address" + } + }, + "currentBalance()": { + "returns": { + "_0": "Tokens held in the contract" + } + }, + "currentPeriod()": { + "returns": { + "_0": "A number that represents the current period" + } + }, + "currentTime()": { + "returns": { + "_0": "Current block timestamp" + } + }, + "duration()": { + "returns": { + "_0": "Amount of seconds from contract startTime to endTime" + } + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "passedPeriods()": { + "returns": { + "_0": "A number of periods that passed since the schedule started" + } + }, + "periodDuration()": { + "returns": { + "_0": "Duration of each period in seconds" + } + }, + "releasableAmount()": { + "details": "Considers the schedule, takes into account already released tokens and used amount", + "returns": { + "_0": "Amount of tokens ready to be released" + } + }, + "release()": { + "details": "All available releasable tokens are transferred to beneficiary" + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." + }, + "revoke()": { + "details": "Vesting schedule is always calculated based on managed tokens" + }, + "revokeProtocol()": { + "details": "Revokes approval to all token destinations in the manager to pull tokens" + }, + "setManager(address)": { + "params": { + "_newManager": "Address of the new manager" + } + }, + "sinceStartTime()": { + "details": "Returns zero if called before conctract starTime", + "returns": { + "_0": "Seconds elapsed from contract startTime" + } + }, + "surplusAmount()": { + "details": "All funds over outstanding amount is considered surplus that can be withdrawn by beneficiary", + "returns": { + "_0": "Amount of tokens considered as surplus" + } + }, + "totalOutstandingAmount()": { + "details": "Does not consider schedule but just global amounts tracked", + "returns": { + "_0": "Amount of outstanding tokens for the lifetime of the contract" + } + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + }, + "vestedAmount()": { + "details": "Similar to available amount, but is fully vested when contract is non-revocable", + "returns": { + "_0": "Amount of tokens already vested" + } + }, + "withdrawSurplus(uint256)": { + "details": "Tokens in the contract over outstanding amount are considered as surplus", + "params": { + "_amount": "Amount of tokens to withdraw" + } + } + }, + "title": "GraphTokenLockWallet", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "acceptLock()": { + "notice": "Beneficiary accepts the lock, the owner cannot retrieve back the tokens" + }, + "amountPerPeriod()": { + "notice": "Returns amount available to be released after each period according to schedule" + }, + "approveProtocol()": { + "notice": "Approves protocol access of the tokens managed by this contract" + }, + "availableAmount()": { + "notice": "Gets the currently available token according to the schedule" + }, + "cancelLock()": { + "notice": "Owner cancel the lock and return the balance in the contract" + }, + "changeBeneficiary(address)": { + "notice": "Change the beneficiary of funds managed by the contract" + }, + "currentBalance()": { + "notice": "Returns the amount of tokens currently held by the contract" + }, + "currentPeriod()": { + "notice": "Gets the current period based on the schedule" + }, + "currentTime()": { + "notice": "Returns the current block timestamp" + }, + "duration()": { + "notice": "Gets duration of contract from start to end in seconds" + }, + "passedPeriods()": { + "notice": "Gets the number of periods that passed since the first period" + }, + "periodDuration()": { + "notice": "Returns the duration of each period in seconds" + }, + "releasableAmount()": { + "notice": "Gets tokens currently available for release" + }, + "release()": { + "notice": "Releases tokens based on the configured schedule" + }, + "revoke()": { + "notice": "Revokes a vesting schedule and return the unvested tokens to the owner" + }, + "revokeProtocol()": { + "notice": "Revokes protocol access of the tokens managed by this contract" + }, + "setManager(address)": { + "notice": "Sets a new manager for this contract" + }, + "sinceStartTime()": { + "notice": "Gets time elapsed since the start of the contract" + }, + "surplusAmount()": { + "notice": "Gets surplus amount in the contract based on outstanding amount to release" + }, + "totalOutstandingAmount()": { + "notice": "Gets the outstanding amount yet to be released based on the whole contract lifetime" + }, + "vestedAmount()": { + "notice": "Gets the amount of currently vested tokens" + }, + "withdrawSurplus(uint256)": { + "notice": "Withdraws surplus, unmanaged tokens from the contract" + } + }, + "notice": "This contract is built on top of the base GraphTokenLock functionality. It allows wallet beneficiaries to use the deposited funds to perform specific function calls on specific contracts. The idea is that supporters with locked tokens can participate in the protocol but disallow any release before the vesting/lock schedule. The beneficiary can issue authorized function calls to this contract that will get forwarded to a target contract. A target contract is any of our protocol contracts. The function calls allowed are queried to the GraphTokenLockManager, this way the same configuration can be shared for all the created lock wallet contracts. NOTE: Contracts used as target must have its function signatures checked to avoid collisions with any of this contract functions. Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience the maximum amount of tokens is authorized.", + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 2339, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "_owner", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 965, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "token", + "offset": 0, + "slot": "1", + "type": "t_contract(IERC20)432" + }, + { + "astId": 967, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "beneficiary", + "offset": 0, + "slot": "2", + "type": "t_address" + }, + { + "astId": 969, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "managedAmount", + "offset": 0, + "slot": "3", + "type": "t_uint256" + }, + { + "astId": 971, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "startTime", + "offset": 0, + "slot": "4", + "type": "t_uint256" + }, + { + "astId": 973, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "endTime", + "offset": 0, + "slot": "5", + "type": "t_uint256" + }, + { + "astId": 975, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "periods", + "offset": 0, + "slot": "6", + "type": "t_uint256" + }, + { + "astId": 977, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "releaseStartTime", + "offset": 0, + "slot": "7", + "type": "t_uint256" + }, + { + "astId": 979, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "vestingCliffTime", + "offset": 0, + "slot": "8", + "type": "t_uint256" + }, + { + "astId": 981, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "revocable", + "offset": 0, + "slot": "9", + "type": "t_enum(Revocability)2132" + }, + { + "astId": 983, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "isRevoked", + "offset": 1, + "slot": "9", + "type": "t_bool" + }, + { + "astId": 985, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "isInitialized", + "offset": 2, + "slot": "9", + "type": "t_bool" + }, + { + "astId": 987, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "isAccepted", + "offset": 3, + "slot": "9", + "type": "t_bool" + }, + { + "astId": 989, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "releasedAmount", + "offset": 0, + "slot": "10", + "type": "t_uint256" + }, + { + "astId": 991, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "revokedAmount", + "offset": 0, + "slot": "11", + "type": "t_uint256" + }, + { + "astId": 1755, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "manager", + "offset": 0, + "slot": "12", + "type": "t_contract(IGraphTokenLockManager)2314" + }, + { + "astId": 1757, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "usedAmount", + "offset": 0, + "slot": "13", + "type": "t_uint256" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_contract(IERC20)432": { + "encoding": "inplace", + "label": "contract IERC20", + "numberOfBytes": "20" + }, + "t_contract(IGraphTokenLockManager)2314": { + "encoding": "inplace", + "label": "contract IGraphTokenLockManager", + "numberOfBytes": "20" + }, + "t_enum(Revocability)2132": { + "encoding": "inplace", + "label": "enum IGraphTokenLock.Revocability", + "numberOfBytes": "1" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} \ No newline at end of file diff --git a/packages/token-distribution/deployments/mainnet/L1GraphTokenLockTransferTool.json b/packages/token-distribution/deployments/mainnet/L1GraphTokenLockTransferTool.json new file mode 100644 index 000000000..f25fd6324 --- /dev/null +++ b/packages/token-distribution/deployments/mainnet/L1GraphTokenLockTransferTool.json @@ -0,0 +1,612 @@ +{ + "address": "0xCa82c7Ce3388b0B5d307574099aC57d7a00d509F", + "abi": [ + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_graphToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_l2Implementation", + "type": "address" + }, + { + "internalType": "contract ITokenGateway", + "name": "_l1Gateway", + "type": "address" + }, + { + "internalType": "address payable", + "name": "_staking", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "tokenLock", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "ETHDeposited", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "tokenLock", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "ETHPulled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "tokenLock", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "ETHWithdrawn", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "l1Wallet", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "l2Beneficiary", + "type": "address" + } + ], + "name": "L2BeneficiarySet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "l1LockManager", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "l2LockManager", + "type": "address" + } + ], + "name": "L2LockManagerSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "l1Wallet", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "l2Wallet", + "type": "address" + } + ], + "name": "L2WalletAddressSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "l1WalletOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "l2WalletOwner", + "type": "address" + } + ], + "name": "L2WalletOwnerSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "l1Wallet", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "l2Wallet", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "l1LockManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "l2LockManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "LockedFundsSentToL2", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "proxy", + "type": "address" + } + ], + "name": "ProxyCreated", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_tokenLock", + "type": "address" + } + ], + "name": "depositETH", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_l2Beneficiary", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_maxGas", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_gasPriceBid", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_maxSubmissionCost", + "type": "uint256" + } + ], + "name": "depositToL2Locked", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_salt", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "_implementation", + "type": "address" + }, + { + "internalType": "address", + "name": "_deployer", + "type": "address" + } + ], + "name": "getDeploymentAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "graphToken", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_owner", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "l1Gateway", + "outputs": [ + { + "internalType": "contract ITokenGateway", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "l2Beneficiary", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "l2Implementation", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "l2LockManager", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "l2WalletAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "l2WalletAddressSetManually", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "l2WalletOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_tokenLock", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "pullETH", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_l1LockManager", + "type": "address" + }, + { + "internalType": "address", + "name": "_l2LockManager", + "type": "address" + } + ], + "name": "setL2LockManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_l2Wallet", + "type": "address" + } + ], + "name": "setL2WalletAddressManually", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_l1WalletOwner", + "type": "address" + }, + { + "internalType": "address", + "name": "_l2WalletOwner", + "type": "address" + } + ], + "name": "setL2WalletOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "staking", + "outputs": [ + { + "internalType": "address payable", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "tokenLockETHBalances", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_destination", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "withdrawETH", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x8535f77828c04d09f10107dea149d9ad72b477a386fd482d109d456e487667e0" +} \ No newline at end of file diff --git a/packages/token-distribution/deployments/mainnet/solcInputs/5ad03e035f8e3c63878532d87a315ef8.json b/packages/token-distribution/deployments/mainnet/solcInputs/5ad03e035f8e3c63878532d87a315ef8.json new file mode 100644 index 000000000..f7d8663a5 --- /dev/null +++ b/packages/token-distribution/deployments/mainnet/solcInputs/5ad03e035f8e3c63878532d87a315ef8.json @@ -0,0 +1,83 @@ +{ + "language": "Solidity", + "sources": { + "contracts/GraphTokenLockWallet.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"@openzeppelin/contracts/math/SafeMath.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\";\n\nimport \"./GraphTokenLock.sol\";\nimport \"./IGraphTokenLockManager.sol\";\n\n/**\n * @title GraphTokenLockWallet\n * @notice This contract is built on top of the base GraphTokenLock functionality.\n * It allows wallet beneficiaries to use the deposited funds to perform specific function calls\n * on specific contracts.\n *\n * The idea is that supporters with locked tokens can participate in the protocol\n * but disallow any release before the vesting/lock schedule.\n * The beneficiary can issue authorized function calls to this contract that will\n * get forwarded to a target contract. A target contract is any of our protocol contracts.\n * The function calls allowed are queried to the GraphTokenLockManager, this way\n * the same configuration can be shared for all the created lock wallet contracts.\n *\n * NOTE: Contracts used as target must have its function signatures checked to avoid collisions\n * with any of this contract functions.\n * Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience\n * the maximum amount of tokens is authorized.\n */\ncontract GraphTokenLockWallet is GraphTokenLock {\n using SafeMath for uint256;\n using SafeERC20 for IERC20;\n\n // -- State --\n\n IGraphTokenLockManager public manager;\n uint256 public usedAmount;\n\n uint256 private constant MAX_UINT256 = 2**256 - 1;\n\n // -- Events --\n\n event ManagerUpdated(address indexed _oldManager, address indexed _newManager);\n event TokenDestinationsApproved();\n event TokenDestinationsRevoked();\n\n // Initializer\n function initialize(\n address _manager,\n address _owner,\n address _beneficiary,\n address _token,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n Revocability _revocable\n ) external {\n _initialize(\n _owner,\n _beneficiary,\n _token,\n _managedAmount,\n _startTime,\n _endTime,\n _periods,\n _releaseStartTime,\n _vestingCliffTime,\n _revocable\n );\n _setManager(_manager);\n }\n\n // -- Admin --\n\n /**\n * @notice Sets a new manager for this contract\n * @param _newManager Address of the new manager\n */\n function setManager(address _newManager) external onlyOwner {\n _setManager(_newManager);\n }\n\n /**\n * @dev Sets a new manager for this contract\n * @param _newManager Address of the new manager\n */\n function _setManager(address _newManager) private {\n require(_newManager != address(0), \"Manager cannot be empty\");\n require(Address.isContract(_newManager), \"Manager must be a contract\");\n\n address oldManager = address(manager);\n manager = IGraphTokenLockManager(_newManager);\n\n emit ManagerUpdated(oldManager, _newManager);\n }\n\n // -- Beneficiary --\n\n /**\n * @notice Approves protocol access of the tokens managed by this contract\n * @dev Approves all token destinations registered in the manager to pull tokens\n */\n function approveProtocol() external onlyBeneficiary {\n address[] memory dstList = manager.getTokenDestinations();\n for (uint256 i = 0; i < dstList.length; i++) {\n token.safeApprove(dstList[i], MAX_UINT256);\n }\n emit TokenDestinationsApproved();\n }\n\n /**\n * @notice Revokes protocol access of the tokens managed by this contract\n * @dev Revokes approval to all token destinations in the manager to pull tokens\n */\n function revokeProtocol() external onlyBeneficiary {\n address[] memory dstList = manager.getTokenDestinations();\n for (uint256 i = 0; i < dstList.length; i++) {\n token.safeApprove(dstList[i], 0);\n }\n emit TokenDestinationsRevoked();\n }\n\n /**\n * @notice Gets tokens currently available for release\n * @dev Considers the schedule, takes into account already released tokens and used amount\n * @return Amount of tokens ready to be released\n */\n function releasableAmount() public view override returns (uint256) {\n if (revocable == Revocability.Disabled) {\n return super.releasableAmount();\n }\n\n // -- Revocability enabled logic\n // This needs to deal with additional considerations for when tokens are used in the protocol\n\n // If a release start time is set no tokens are available for release before this date\n // If not set it follows the default schedule and tokens are available on\n // the first period passed\n if (releaseStartTime > 0 && currentTime() < releaseStartTime) {\n return 0;\n }\n\n // Vesting cliff is activated and it has not passed means nothing is vested yet\n // so funds cannot be released\n if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\n return 0;\n }\n\n // A beneficiary can never have more releasable tokens than the contract balance\n // We consider the `usedAmount` in the protocol as part of the calculations\n // the beneficiary should not release funds that are used.\n uint256 releasable = availableAmount().sub(releasedAmount).sub(usedAmount);\n return MathUtils.min(currentBalance(), releasable);\n }\n\n /**\n * @notice Forward authorized contract calls to protocol contracts\n * @dev Fallback function can be called by the beneficiary only if function call is allowed\n */\n fallback() external payable {\n // Only beneficiary can forward calls\n require(msg.sender == beneficiary, \"Unauthorized caller\");\n\n // Function call validation\n address _target = manager.getAuthFunctionCallTarget(msg.sig);\n require(_target != address(0), \"Unauthorized function\");\n\n uint256 oldBalance = currentBalance();\n\n // Call function with data\n Address.functionCall(_target, msg.data);\n\n // Tracked used tokens in the protocol\n // We do this check after balances were updated by the forwarded call\n // Check is only enforced for revocable contracts to save some gas\n if (revocable == Revocability.Enabled) {\n // Track contract balance change\n uint256 newBalance = currentBalance();\n if (newBalance < oldBalance) {\n // Outflow\n uint256 diff = oldBalance.sub(newBalance);\n usedAmount = usedAmount.add(diff);\n } else {\n // Inflow: We can receive profits from the protocol, that could make usedAmount to\n // underflow. We set it to zero in that case.\n uint256 diff = newBalance.sub(oldBalance);\n usedAmount = (diff >= usedAmount) ? 0 : usedAmount.sub(diff);\n }\n require(usedAmount <= vestedAmount(), \"Cannot use more tokens than vested amount\");\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Address.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.2 <0.8.0;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize, which returns 0 for contracts in\n // construction, since the code is only stored at the end of the\n // constructor execution.\n\n uint256 size;\n // solhint-disable-next-line no-inline-assembly\n assembly { size := extcodesize(account) }\n return size > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n // solhint-disable-next-line avoid-low-level-calls, avoid-call-value\n (bool success, ) = recipient.call{ value: amount }(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain`call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCall(target, data, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n require(isContract(target), \"Address: call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.call{ value: value }(data);\n return _verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {\n require(isContract(target), \"Address: static call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.staticcall(data);\n return _verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\n require(isContract(target), \"Address: delegate call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return _verifyCallResult(success, returndata, errorMessage);\n }\n\n function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {\n if (success) {\n return returndata;\n } else {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n }\n}\n" + }, + "@openzeppelin/contracts/math/SafeMath.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/**\n * @dev Wrappers over Solidity's arithmetic operations with added overflow\n * checks.\n *\n * Arithmetic operations in Solidity wrap on overflow. This can easily result\n * in bugs, because programmers usually assume that an overflow raises an\n * error, which is the standard behavior in high level programming languages.\n * `SafeMath` restores this intuition by reverting the transaction when an\n * operation overflows.\n *\n * Using this library instead of the unchecked operations eliminates an entire\n * class of bugs, so it's recommended to use it always.\n */\nlibrary SafeMath {\n /**\n * @dev Returns the addition of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n uint256 c = a + b;\n if (c < a) return (false, 0);\n return (true, c);\n }\n\n /**\n * @dev Returns the substraction of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n if (b > a) return (false, 0);\n return (true, a - b);\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\n // benefit is lost if 'b' is also tested.\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\n if (a == 0) return (true, 0);\n uint256 c = a * b;\n if (c / a != b) return (false, 0);\n return (true, c);\n }\n\n /**\n * @dev Returns the division of two unsigned integers, with a division by zero flag.\n *\n * _Available since v3.4._\n */\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n if (b == 0) return (false, 0);\n return (true, a / b);\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\n *\n * _Available since v3.4._\n */\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n if (b == 0) return (false, 0);\n return (true, a % b);\n }\n\n /**\n * @dev Returns the addition of two unsigned integers, reverting on\n * overflow.\n *\n * Counterpart to Solidity's `+` operator.\n *\n * Requirements:\n *\n * - Addition cannot overflow.\n */\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\n uint256 c = a + b;\n require(c >= a, \"SafeMath: addition overflow\");\n return c;\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, reverting on\n * overflow (when the result is negative).\n *\n * Counterpart to Solidity's `-` operator.\n *\n * Requirements:\n *\n * - Subtraction cannot overflow.\n */\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b <= a, \"SafeMath: subtraction overflow\");\n return a - b;\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, reverting on\n * overflow.\n *\n * Counterpart to Solidity's `*` operator.\n *\n * Requirements:\n *\n * - Multiplication cannot overflow.\n */\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n if (a == 0) return 0;\n uint256 c = a * b;\n require(c / a == b, \"SafeMath: multiplication overflow\");\n return c;\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers, reverting on\n * division by zero. The result is rounded towards zero.\n *\n * Counterpart to Solidity's `/` operator. Note: this function uses a\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\n * uses an invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b > 0, \"SafeMath: division by zero\");\n return a / b;\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * reverting when dividing by zero.\n *\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\n * opcode (which leaves remaining gas untouched) while Solidity uses an\n * invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b > 0, \"SafeMath: modulo by zero\");\n return a % b;\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\n * overflow (when the result is negative).\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {trySub}.\n *\n * Counterpart to Solidity's `-` operator.\n *\n * Requirements:\n *\n * - Subtraction cannot overflow.\n */\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b <= a, errorMessage);\n return a - b;\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers, reverting with custom message on\n * division by zero. The result is rounded towards zero.\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {tryDiv}.\n *\n * Counterpart to Solidity's `/` operator. Note: this function uses a\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\n * uses an invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b > 0, errorMessage);\n return a / b;\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * reverting with custom message when dividing by zero.\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {tryMod}.\n *\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\n * opcode (which leaves remaining gas untouched) while Solidity uses an\n * invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b > 0, errorMessage);\n return a % b;\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `recipient`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address recipient, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `sender` to `recipient` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);\n\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/SafeERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"../../math/SafeMath.sol\";\nimport \"../../utils/Address.sol\";\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n using SafeMath for uint256;\n using Address for address;\n\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\n }\n\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\n }\n\n /**\n * @dev Deprecated. This function has issues similar to the ones found in\n * {IERC20-approve}, and its usage is discouraged.\n *\n * Whenever possible, use {safeIncreaseAllowance} and\n * {safeDecreaseAllowance} instead.\n */\n function safeApprove(IERC20 token, address spender, uint256 value) internal {\n // safeApprove should only be called when setting an initial allowance,\n // or when resetting it to zero. To increase and decrease it, use\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\n // solhint-disable-next-line max-line-length\n require((value == 0) || (token.allowance(address(this), spender) == 0),\n \"SafeERC20: approve from non-zero to non-zero allowance\"\n );\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\n }\n\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n uint256 newAllowance = token.allowance(address(this), spender).add(value);\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\n\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n uint256 newAllowance = token.allowance(address(this), spender).sub(value, \"SafeERC20: decreased allowance below zero\");\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n */\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that\n // the target address contains contract code and also asserts for success in the low-level call.\n\n bytes memory returndata = address(token).functionCall(data, \"SafeERC20: low-level call failed\");\n if (returndata.length > 0) { // Return data is optional\n // solhint-disable-next-line max-line-length\n require(abi.decode(returndata, (bool)), \"SafeERC20: ERC20 operation did not succeed\");\n }\n }\n}\n" + }, + "contracts/GraphTokenLock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport \"@openzeppelin/contracts/math/SafeMath.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\";\n\nimport \"./Ownable.sol\";\nimport \"./MathUtils.sol\";\nimport \"./IGraphTokenLock.sol\";\n\n/**\n * @title GraphTokenLock\n * @notice Contract that manages an unlocking schedule of tokens.\n * @dev The contract lock manage a number of tokens deposited into the contract to ensure that\n * they can only be released under certain time conditions.\n *\n * This contract implements a release scheduled based on periods and tokens are released in steps\n * after each period ends. It can be configured with one period in which case it is like a plain TimeLock.\n * It also supports revocation to be used for vesting schedules.\n *\n * The contract supports receiving extra funds than the managed tokens ones that can be\n * withdrawn by the beneficiary at any time.\n *\n * A releaseStartTime parameter is included to override the default release schedule and\n * perform the first release on the configured time. After that it will continue with the\n * default schedule.\n */\nabstract contract GraphTokenLock is Ownable, IGraphTokenLock {\n using SafeMath for uint256;\n using SafeERC20 for IERC20;\n\n uint256 private constant MIN_PERIOD = 1;\n\n // -- State --\n\n IERC20 public token;\n address public beneficiary;\n\n // Configuration\n\n // Amount of tokens managed by the contract schedule\n uint256 public managedAmount;\n\n uint256 public startTime; // Start datetime (in unixtimestamp)\n uint256 public endTime; // Datetime after all funds are fully vested/unlocked (in unixtimestamp)\n uint256 public periods; // Number of vesting/release periods\n\n // First release date for tokens (in unixtimestamp)\n // If set, no tokens will be released before releaseStartTime ignoring\n // the amount to release each period\n uint256 public releaseStartTime;\n // A cliff set a date to which a beneficiary needs to get to vest\n // all preceding periods\n uint256 public vestingCliffTime;\n Revocability public revocable; // Whether to use vesting for locked funds\n\n // State\n\n bool public isRevoked;\n bool public isInitialized;\n bool public isAccepted;\n uint256 public releasedAmount;\n uint256 public revokedAmount;\n\n // -- Events --\n\n event TokensReleased(address indexed beneficiary, uint256 amount);\n event TokensWithdrawn(address indexed beneficiary, uint256 amount);\n event TokensRevoked(address indexed beneficiary, uint256 amount);\n event BeneficiaryChanged(address newBeneficiary);\n event LockAccepted();\n event LockCanceled();\n\n /**\n * @dev Only allow calls from the beneficiary of the contract\n */\n modifier onlyBeneficiary() {\n require(msg.sender == beneficiary, \"!auth\");\n _;\n }\n\n /**\n * @notice Initializes the contract\n * @param _owner Address of the contract owner\n * @param _beneficiary Address of the beneficiary of locked tokens\n * @param _managedAmount Amount of tokens to be managed by the lock contract\n * @param _startTime Start time of the release schedule\n * @param _endTime End time of the release schedule\n * @param _periods Number of periods between start time and end time\n * @param _releaseStartTime Override time for when the releases start\n * @param _vestingCliffTime Override time for when the vesting start\n * @param _revocable Whether the contract is revocable\n */\n function _initialize(\n address _owner,\n address _beneficiary,\n address _token,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n Revocability _revocable\n ) internal {\n require(!isInitialized, \"Already initialized\");\n require(_owner != address(0), \"Owner cannot be zero\");\n require(_beneficiary != address(0), \"Beneficiary cannot be zero\");\n require(_token != address(0), \"Token cannot be zero\");\n require(_managedAmount > 0, \"Managed tokens cannot be zero\");\n require(_startTime != 0, \"Start time must be set\");\n require(_startTime < _endTime, \"Start time > end time\");\n require(_periods >= MIN_PERIOD, \"Periods cannot be below minimum\");\n require(_revocable != Revocability.NotSet, \"Must set a revocability option\");\n require(_releaseStartTime < _endTime, \"Release start time must be before end time\");\n require(_vestingCliffTime < _endTime, \"Cliff time must be before end time\");\n\n isInitialized = true;\n\n Ownable.initialize(_owner);\n beneficiary = _beneficiary;\n token = IERC20(_token);\n\n managedAmount = _managedAmount;\n\n startTime = _startTime;\n endTime = _endTime;\n periods = _periods;\n\n // Optionals\n releaseStartTime = _releaseStartTime;\n vestingCliffTime = _vestingCliffTime;\n revocable = _revocable;\n }\n\n /**\n * @notice Change the beneficiary of funds managed by the contract\n * @dev Can only be called by the beneficiary\n * @param _newBeneficiary Address of the new beneficiary address\n */\n function changeBeneficiary(address _newBeneficiary) external onlyBeneficiary {\n require(_newBeneficiary != address(0), \"Empty beneficiary\");\n beneficiary = _newBeneficiary;\n emit BeneficiaryChanged(_newBeneficiary);\n }\n\n /**\n * @notice Beneficiary accepts the lock, the owner cannot retrieve back the tokens\n * @dev Can only be called by the beneficiary\n */\n function acceptLock() external onlyBeneficiary {\n isAccepted = true;\n emit LockAccepted();\n }\n\n /**\n * @notice Owner cancel the lock and return the balance in the contract\n * @dev Can only be called by the owner\n */\n function cancelLock() external onlyOwner {\n require(isAccepted == false, \"Cannot cancel accepted contract\");\n\n token.safeTransfer(owner(), currentBalance());\n\n emit LockCanceled();\n }\n\n // -- Balances --\n\n /**\n * @notice Returns the amount of tokens currently held by the contract\n * @return Tokens held in the contract\n */\n function currentBalance() public view override returns (uint256) {\n return token.balanceOf(address(this));\n }\n\n // -- Time & Periods --\n\n /**\n * @notice Returns the current block timestamp\n * @return Current block timestamp\n */\n function currentTime() public view override returns (uint256) {\n return block.timestamp;\n }\n\n /**\n * @notice Gets duration of contract from start to end in seconds\n * @return Amount of seconds from contract startTime to endTime\n */\n function duration() public view override returns (uint256) {\n return endTime.sub(startTime);\n }\n\n /**\n * @notice Gets time elapsed since the start of the contract\n * @dev Returns zero if called before conctract starTime\n * @return Seconds elapsed from contract startTime\n */\n function sinceStartTime() public view override returns (uint256) {\n uint256 current = currentTime();\n if (current <= startTime) {\n return 0;\n }\n return current.sub(startTime);\n }\n\n /**\n * @notice Returns amount available to be released after each period according to schedule\n * @return Amount of tokens available after each period\n */\n function amountPerPeriod() public view override returns (uint256) {\n return managedAmount.div(periods);\n }\n\n /**\n * @notice Returns the duration of each period in seconds\n * @return Duration of each period in seconds\n */\n function periodDuration() public view override returns (uint256) {\n return duration().div(periods);\n }\n\n /**\n * @notice Gets the current period based on the schedule\n * @return A number that represents the current period\n */\n function currentPeriod() public view override returns (uint256) {\n return sinceStartTime().div(periodDuration()).add(MIN_PERIOD);\n }\n\n /**\n * @notice Gets the number of periods that passed since the first period\n * @return A number of periods that passed since the schedule started\n */\n function passedPeriods() public view override returns (uint256) {\n return currentPeriod().sub(MIN_PERIOD);\n }\n\n // -- Locking & Release Schedule --\n\n /**\n * @notice Gets the currently available token according to the schedule\n * @dev Implements the step-by-step schedule based on periods for available tokens\n * @return Amount of tokens available according to the schedule\n */\n function availableAmount() public view override returns (uint256) {\n uint256 current = currentTime();\n\n // Before contract start no funds are available\n if (current < startTime) {\n return 0;\n }\n\n // After contract ended all funds are available\n if (current > endTime) {\n return managedAmount;\n }\n\n // Get available amount based on period\n return passedPeriods().mul(amountPerPeriod());\n }\n\n /**\n * @notice Gets the amount of currently vested tokens\n * @dev Similar to available amount, but is fully vested when contract is non-revocable\n * @return Amount of tokens already vested\n */\n function vestedAmount() public view override returns (uint256) {\n // If non-revocable it is fully vested\n if (revocable == Revocability.Disabled) {\n return managedAmount;\n }\n\n // Vesting cliff is activated and it has not passed means nothing is vested yet\n if (vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\n return 0;\n }\n\n return availableAmount();\n }\n\n /**\n * @notice Gets tokens currently available for release\n * @dev Considers the schedule and takes into account already released tokens\n * @return Amount of tokens ready to be released\n */\n function releasableAmount() public view virtual override returns (uint256) {\n // If a release start time is set no tokens are available for release before this date\n // If not set it follows the default schedule and tokens are available on\n // the first period passed\n if (releaseStartTime > 0 && currentTime() < releaseStartTime) {\n return 0;\n }\n\n // Vesting cliff is activated and it has not passed means nothing is vested yet\n // so funds cannot be released\n if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\n return 0;\n }\n\n // A beneficiary can never have more releasable tokens than the contract balance\n uint256 releasable = availableAmount().sub(releasedAmount);\n return MathUtils.min(currentBalance(), releasable);\n }\n\n /**\n * @notice Gets the outstanding amount yet to be released based on the whole contract lifetime\n * @dev Does not consider schedule but just global amounts tracked\n * @return Amount of outstanding tokens for the lifetime of the contract\n */\n function totalOutstandingAmount() public view override returns (uint256) {\n return managedAmount.sub(releasedAmount).sub(revokedAmount);\n }\n\n /**\n * @notice Gets surplus amount in the contract based on outstanding amount to release\n * @dev All funds over outstanding amount is considered surplus that can be withdrawn by beneficiary\n * @return Amount of tokens considered as surplus\n */\n function surplusAmount() public view override returns (uint256) {\n uint256 balance = currentBalance();\n uint256 outstandingAmount = totalOutstandingAmount();\n if (balance > outstandingAmount) {\n return balance.sub(outstandingAmount);\n }\n return 0;\n }\n\n // -- Value Transfer --\n\n /**\n * @notice Releases tokens based on the configured schedule\n * @dev All available releasable tokens are transferred to beneficiary\n */\n function release() external override onlyBeneficiary {\n uint256 amountToRelease = releasableAmount();\n require(amountToRelease > 0, \"No available releasable amount\");\n\n releasedAmount = releasedAmount.add(amountToRelease);\n\n token.safeTransfer(beneficiary, amountToRelease);\n\n emit TokensReleased(beneficiary, amountToRelease);\n }\n\n /**\n * @notice Withdraws surplus, unmanaged tokens from the contract\n * @dev Tokens in the contract over outstanding amount are considered as surplus\n * @param _amount Amount of tokens to withdraw\n */\n function withdrawSurplus(uint256 _amount) external override onlyBeneficiary {\n require(_amount > 0, \"Amount cannot be zero\");\n require(surplusAmount() >= _amount, \"Amount requested > surplus available\");\n\n token.safeTransfer(beneficiary, _amount);\n\n emit TokensWithdrawn(beneficiary, _amount);\n }\n\n /**\n * @notice Revokes a vesting schedule and return the unvested tokens to the owner\n * @dev Vesting schedule is always calculated based on managed tokens\n */\n function revoke() external override onlyOwner {\n require(revocable == Revocability.Enabled, \"Contract is non-revocable\");\n require(isRevoked == false, \"Already revoked\");\n\n uint256 unvestedAmount = managedAmount.sub(vestedAmount());\n require(unvestedAmount > 0, \"No available unvested amount\");\n\n revokedAmount = unvestedAmount;\n isRevoked = true;\n\n token.safeTransfer(owner(), unvestedAmount);\n\n emit TokensRevoked(beneficiary, unvestedAmount);\n }\n}\n" + }, + "contracts/IGraphTokenLockManager.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\nimport \"./IGraphTokenLock.sol\";\n\ninterface IGraphTokenLockManager {\n // -- Factory --\n\n function setMasterCopy(address _masterCopy) external;\n\n function createTokenLockWallet(\n address _owner,\n address _beneficiary,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n IGraphTokenLock.Revocability _revocable\n ) external;\n\n // -- Funds Management --\n\n function token() external returns (IERC20);\n\n function deposit(uint256 _amount) external;\n\n function withdraw(uint256 _amount) external;\n\n // -- Allowed Funds Destinations --\n\n function addTokenDestination(address _dst) external;\n\n function removeTokenDestination(address _dst) external;\n\n function isTokenDestination(address _dst) external view returns (bool);\n\n function getTokenDestinations() external view returns (address[] memory);\n\n // -- Function Call Authorization --\n\n function setAuthFunctionCall(string calldata _signature, address _target) external;\n\n function unsetAuthFunctionCall(string calldata _signature) external;\n\n function setAuthFunctionCallMany(string[] calldata _signatures, address[] calldata _targets) external;\n\n function getAuthFunctionCallTarget(bytes4 _sigHash) external view returns (address);\n\n function isAuthFunctionCall(bytes4 _sigHash) external view returns (bool);\n}\n" + }, + "contracts/Ownable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * The owner account will be passed on initialization of the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\ncontract Ownable {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n function initialize(address owner) internal {\n _owner = owner;\n emit OwnershipTransferred(address(0), owner);\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(_owner == msg.sender, \"Ownable: caller is not the owner\");\n _;\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() external virtual onlyOwner {\n emit OwnershipTransferred(_owner, address(0));\n _owner = address(0);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) external virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n emit OwnershipTransferred(_owner, newOwner);\n _owner = newOwner;\n }\n}\n" + }, + "contracts/MathUtils.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nlibrary MathUtils {\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n}\n" + }, + "contracts/IGraphTokenLock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\ninterface IGraphTokenLock {\n enum Revocability {\n NotSet,\n Enabled,\n Disabled\n }\n\n // -- Balances --\n\n function currentBalance() external view returns (uint256);\n\n // -- Time & Periods --\n\n function currentTime() external view returns (uint256);\n\n function duration() external view returns (uint256);\n\n function sinceStartTime() external view returns (uint256);\n\n function amountPerPeriod() external view returns (uint256);\n\n function periodDuration() external view returns (uint256);\n\n function currentPeriod() external view returns (uint256);\n\n function passedPeriods() external view returns (uint256);\n\n // -- Locking & Release Schedule --\n\n function availableAmount() external view returns (uint256);\n\n function vestedAmount() external view returns (uint256);\n\n function releasableAmount() external view returns (uint256);\n\n function totalOutstandingAmount() external view returns (uint256);\n\n function surplusAmount() external view returns (uint256);\n\n // -- Value Transfer --\n\n function release() external;\n\n function withdrawSurplus(uint256 _amount) external;\n\n function revoke() external;\n}\n" + }, + "contracts/GraphTokenLockManager.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\";\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"@openzeppelin/contracts/utils/EnumerableSet.sol\";\n\nimport \"./MinimalProxyFactory.sol\";\nimport \"./IGraphTokenLockManager.sol\";\n\n/**\n * @title GraphTokenLockManager\n * @notice This contract manages a list of authorized function calls and targets that can be called\n * by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts.\n *\n * This contract receives funds to make the process of creating TokenLockWallet contracts\n * easier by distributing them the initial tokens to be managed.\n *\n * The owner can setup a list of token destinations that will be used by TokenLock contracts to\n * approve the pulling of funds, this way in can be guaranteed that only protocol contracts\n * will manipulate users funds.\n */\ncontract GraphTokenLockManager is MinimalProxyFactory, IGraphTokenLockManager {\n using SafeERC20 for IERC20;\n using EnumerableSet for EnumerableSet.AddressSet;\n\n // -- State --\n\n mapping(bytes4 => address) public authFnCalls;\n EnumerableSet.AddressSet private _tokenDestinations;\n\n address public masterCopy;\n IERC20 private _token;\n\n // -- Events --\n\n event MasterCopyUpdated(address indexed masterCopy);\n event TokenLockCreated(\n address indexed contractAddress,\n bytes32 indexed initHash,\n address indexed beneficiary,\n address token,\n uint256 managedAmount,\n uint256 startTime,\n uint256 endTime,\n uint256 periods,\n uint256 releaseStartTime,\n uint256 vestingCliffTime,\n IGraphTokenLock.Revocability revocable\n );\n\n event TokensDeposited(address indexed sender, uint256 amount);\n event TokensWithdrawn(address indexed sender, uint256 amount);\n\n event FunctionCallAuth(address indexed caller, bytes4 indexed sigHash, address indexed target, string signature);\n event TokenDestinationAllowed(address indexed dst, bool allowed);\n\n /**\n * Constructor.\n * @param _graphToken Token to use for deposits and withdrawals\n * @param _masterCopy Address of the master copy to use to clone proxies\n */\n constructor(IERC20 _graphToken, address _masterCopy) {\n require(address(_graphToken) != address(0), \"Token cannot be zero\");\n _token = _graphToken;\n setMasterCopy(_masterCopy);\n }\n\n // -- Factory --\n\n /**\n * @notice Sets the masterCopy bytecode to use to create clones of TokenLock contracts\n * @param _masterCopy Address of contract bytecode to factory clone\n */\n function setMasterCopy(address _masterCopy) public override onlyOwner {\n require(_masterCopy != address(0), \"MasterCopy cannot be zero\");\n masterCopy = _masterCopy;\n emit MasterCopyUpdated(_masterCopy);\n }\n\n /**\n * @notice Creates and fund a new token lock wallet using a minimum proxy\n * @param _owner Address of the contract owner\n * @param _beneficiary Address of the beneficiary of locked tokens\n * @param _managedAmount Amount of tokens to be managed by the lock contract\n * @param _startTime Start time of the release schedule\n * @param _endTime End time of the release schedule\n * @param _periods Number of periods between start time and end time\n * @param _releaseStartTime Override time for when the releases start\n * @param _revocable Whether the contract is revocable\n */\n function createTokenLockWallet(\n address _owner,\n address _beneficiary,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n IGraphTokenLock.Revocability _revocable\n ) external override onlyOwner {\n require(_token.balanceOf(address(this)) >= _managedAmount, \"Not enough tokens to create lock\");\n\n // Create contract using a minimal proxy and call initializer\n bytes memory initializer = abi.encodeWithSignature(\n \"initialize(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)\",\n address(this),\n _owner,\n _beneficiary,\n address(_token),\n _managedAmount,\n _startTime,\n _endTime,\n _periods,\n _releaseStartTime,\n _vestingCliffTime,\n _revocable\n );\n address contractAddress = _deployProxy2(keccak256(initializer), masterCopy, initializer);\n\n // Send managed amount to the created contract\n _token.safeTransfer(contractAddress, _managedAmount);\n\n emit TokenLockCreated(\n contractAddress,\n keccak256(initializer),\n _beneficiary,\n address(_token),\n _managedAmount,\n _startTime,\n _endTime,\n _periods,\n _releaseStartTime,\n _vestingCliffTime,\n _revocable\n );\n }\n\n // -- Funds Management --\n\n /**\n * @notice Gets the GRT token address\n * @return Token used for transfers and approvals\n */\n function token() external view override returns (IERC20) {\n return _token;\n }\n\n /**\n * @notice Deposits tokens into the contract\n * @dev Even if the ERC20 token can be transferred directly to the contract\n * this function provide a safe interface to do the transfer and avoid mistakes\n * @param _amount Amount to deposit\n */\n function deposit(uint256 _amount) external override {\n require(_amount > 0, \"Amount cannot be zero\");\n _token.safeTransferFrom(msg.sender, address(this), _amount);\n emit TokensDeposited(msg.sender, _amount);\n }\n\n /**\n * @notice Withdraws tokens from the contract\n * @dev Escape hatch in case of mistakes or to recover remaining funds\n * @param _amount Amount of tokens to withdraw\n */\n function withdraw(uint256 _amount) external override onlyOwner {\n require(_amount > 0, \"Amount cannot be zero\");\n _token.safeTransfer(msg.sender, _amount);\n emit TokensWithdrawn(msg.sender, _amount);\n }\n\n // -- Token Destinations --\n\n /**\n * @notice Adds an address that can be allowed by a token lock to pull funds\n * @param _dst Destination address\n */\n function addTokenDestination(address _dst) external override onlyOwner {\n require(_dst != address(0), \"Destination cannot be zero\");\n require(_tokenDestinations.add(_dst), \"Destination already added\");\n emit TokenDestinationAllowed(_dst, true);\n }\n\n /**\n * @notice Removes an address that can be allowed by a token lock to pull funds\n * @param _dst Destination address\n */\n function removeTokenDestination(address _dst) external override onlyOwner {\n require(_tokenDestinations.remove(_dst), \"Destination already removed\");\n emit TokenDestinationAllowed(_dst, false);\n }\n\n /**\n * @notice Returns True if the address is authorized to be a destination of tokens\n * @param _dst Destination address\n * @return True if authorized\n */\n function isTokenDestination(address _dst) external view override returns (bool) {\n return _tokenDestinations.contains(_dst);\n }\n\n /**\n * @notice Returns an array of authorized destination addresses\n * @return Array of addresses authorized to pull funds from a token lock\n */\n function getTokenDestinations() external view override returns (address[] memory) {\n address[] memory dstList = new address[](_tokenDestinations.length());\n for (uint256 i = 0; i < _tokenDestinations.length(); i++) {\n dstList[i] = _tokenDestinations.at(i);\n }\n return dstList;\n }\n\n // -- Function Call Authorization --\n\n /**\n * @notice Sets an authorized function call to target\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\n * @param _signature Function signature\n * @param _target Address of the destination contract to call\n */\n function setAuthFunctionCall(string calldata _signature, address _target) external override onlyOwner {\n _setAuthFunctionCall(_signature, _target);\n }\n\n /**\n * @notice Unsets an authorized function call to target\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\n * @param _signature Function signature\n */\n function unsetAuthFunctionCall(string calldata _signature) external override onlyOwner {\n bytes4 sigHash = _toFunctionSigHash(_signature);\n authFnCalls[sigHash] = address(0);\n\n emit FunctionCallAuth(msg.sender, sigHash, address(0), _signature);\n }\n\n /**\n * @notice Sets an authorized function call to target in bulk\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\n * @param _signatures Function signatures\n * @param _targets Address of the destination contract to call\n */\n function setAuthFunctionCallMany(string[] calldata _signatures, address[] calldata _targets)\n external\n override\n onlyOwner\n {\n require(_signatures.length == _targets.length, \"Array length mismatch\");\n\n for (uint256 i = 0; i < _signatures.length; i++) {\n _setAuthFunctionCall(_signatures[i], _targets[i]);\n }\n }\n\n /**\n * @notice Sets an authorized function call to target\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\n * @dev Function signatures of Graph Protocol contracts to be used are known ahead of time\n * @param _signature Function signature\n * @param _target Address of the destination contract to call\n */\n function _setAuthFunctionCall(string calldata _signature, address _target) internal {\n require(_target != address(this), \"Target must be other contract\");\n require(Address.isContract(_target), \"Target must be a contract\");\n\n bytes4 sigHash = _toFunctionSigHash(_signature);\n authFnCalls[sigHash] = _target;\n\n emit FunctionCallAuth(msg.sender, sigHash, _target, _signature);\n }\n\n /**\n * @notice Gets the target contract to call for a particular function signature\n * @param _sigHash Function signature hash\n * @return Address of the target contract where to send the call\n */\n function getAuthFunctionCallTarget(bytes4 _sigHash) public view override returns (address) {\n return authFnCalls[_sigHash];\n }\n\n /**\n * @notice Returns true if the function call is authorized\n * @param _sigHash Function signature hash\n * @return True if authorized\n */\n function isAuthFunctionCall(bytes4 _sigHash) external view override returns (bool) {\n return getAuthFunctionCallTarget(_sigHash) != address(0);\n }\n\n /**\n * @dev Converts a function signature string to 4-bytes hash\n * @param _signature Function signature string\n * @return Function signature hash\n */\n function _toFunctionSigHash(string calldata _signature) internal pure returns (bytes4) {\n return _convertToBytes4(abi.encodeWithSignature(_signature));\n }\n\n /**\n * @dev Converts function signature bytes to function signature hash (bytes4)\n * @param _signature Function signature\n * @return Function signature in bytes4\n */\n function _convertToBytes4(bytes memory _signature) internal pure returns (bytes4) {\n require(_signature.length == 4, \"Invalid method signature\");\n bytes4 sigHash;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n sigHash := mload(add(_signature, 32))\n }\n return sigHash;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/EnumerableSet.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/**\n * @dev Library for managing\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\n * types.\n *\n * Sets have the following properties:\n *\n * - Elements are added, removed, and checked for existence in constant time\n * (O(1)).\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\n *\n * ```\n * contract Example {\n * // Add the library methods\n * using EnumerableSet for EnumerableSet.AddressSet;\n *\n * // Declare a set state variable\n * EnumerableSet.AddressSet private mySet;\n * }\n * ```\n *\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\n * and `uint256` (`UintSet`) are supported.\n */\nlibrary EnumerableSet {\n // To implement this library for multiple types with as little code\n // repetition as possible, we write it in terms of a generic Set type with\n // bytes32 values.\n // The Set implementation uses private functions, and user-facing\n // implementations (such as AddressSet) are just wrappers around the\n // underlying Set.\n // This means that we can only create new EnumerableSets for types that fit\n // in bytes32.\n\n struct Set {\n // Storage of set values\n bytes32[] _values;\n\n // Position of the value in the `values` array, plus 1 because index 0\n // means a value is not in the set.\n mapping (bytes32 => uint256) _indexes;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function _add(Set storage set, bytes32 value) private returns (bool) {\n if (!_contains(set, value)) {\n set._values.push(value);\n // The value is stored at length-1, but we add 1 to all indexes\n // and use 0 as a sentinel value\n set._indexes[value] = set._values.length;\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function _remove(Set storage set, bytes32 value) private returns (bool) {\n // We read and store the value's index to prevent multiple reads from the same storage slot\n uint256 valueIndex = set._indexes[value];\n\n if (valueIndex != 0) { // Equivalent to contains(set, value)\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\n // the array, and then remove the last element (sometimes called as 'swap and pop').\n // This modifies the order of the array, as noted in {at}.\n\n uint256 toDeleteIndex = valueIndex - 1;\n uint256 lastIndex = set._values.length - 1;\n\n // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs\n // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.\n\n bytes32 lastvalue = set._values[lastIndex];\n\n // Move the last value to the index where the value to delete is\n set._values[toDeleteIndex] = lastvalue;\n // Update the index for the moved value\n set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based\n\n // Delete the slot where the moved value was stored\n set._values.pop();\n\n // Delete the index for the deleted slot\n delete set._indexes[value];\n\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\n return set._indexes[value] != 0;\n }\n\n /**\n * @dev Returns the number of values on the set. O(1).\n */\n function _length(Set storage set) private view returns (uint256) {\n return set._values.length;\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\n require(set._values.length > index, \"EnumerableSet: index out of bounds\");\n return set._values[index];\n }\n\n // Bytes32Set\n\n struct Bytes32Set {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _add(set._inner, value);\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _remove(set._inner, value);\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\n return _contains(set._inner, value);\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(Bytes32Set storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\n return _at(set._inner, index);\n }\n\n // AddressSet\n\n struct AddressSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(AddressSet storage set, address value) internal returns (bool) {\n return _add(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(AddressSet storage set, address value) internal returns (bool) {\n return _remove(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(AddressSet storage set, address value) internal view returns (bool) {\n return _contains(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(AddressSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\n return address(uint160(uint256(_at(set._inner, index))));\n }\n\n\n // UintSet\n\n struct UintSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(UintSet storage set, uint256 value) internal returns (bool) {\n return _add(set._inner, bytes32(value));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\n return _remove(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\n return _contains(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns the number of values on the set. O(1).\n */\n function length(UintSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\n return uint256(_at(set._inner, index));\n }\n}\n" + }, + "contracts/MinimalProxyFactory.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\nimport \"@openzeppelin/contracts/utils/Create2.sol\";\n\n// Adapted from https://github.com/OpenZeppelin/openzeppelin-sdk/blob/v2.5.0/packages/lib/contracts/upgradeability/ProxyFactory.sol\n// Based on https://eips.ethereum.org/EIPS/eip-1167\ncontract MinimalProxyFactory is Ownable {\n // -- Events --\n\n event ProxyCreated(address indexed proxy);\n\n /**\n * @notice Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation\n * @param _salt Bytes32 salt to use for CREATE2\n * @param _implementation Address of the proxy target implementation\n * @return Address of the counterfactual MinimalProxy\n */\n function getDeploymentAddress(bytes32 _salt, address _implementation) external view returns (address) {\n return Create2.computeAddress(_salt, keccak256(_getContractCreationCode(_implementation)), address(this));\n }\n\n /**\n * @notice Deploys a MinimalProxy with CREATE2\n * @param _salt Bytes32 salt to use for CREATE2\n * @param _implementation Address of the proxy target implementation\n * @param _data Bytes with the initializer call\n * @return Address of the deployed MinimalProxy\n */\n function _deployProxy2(\n bytes32 _salt,\n address _implementation,\n bytes memory _data\n ) internal returns (address) {\n address proxyAddress = Create2.deploy(0, _salt, _getContractCreationCode(_implementation));\n\n emit ProxyCreated(proxyAddress);\n\n // Call function with data\n if (_data.length > 0) {\n Address.functionCall(proxyAddress, _data);\n }\n\n return proxyAddress;\n }\n\n /**\n * @notice Gets the MinimalProxy bytecode\n * @param _implementation Address of the proxy target implementation\n * @return MinimalProxy bytecode\n */\n function _getContractCreationCode(address _implementation) internal pure returns (bytes memory) {\n bytes10 creation = 0x3d602d80600a3d3981f3;\n bytes10 prefix = 0x363d3d373d3d3d363d73;\n bytes20 targetBytes = bytes20(_implementation);\n bytes15 suffix = 0x5af43d82803e903d91602b57fd5bf3;\n return abi.encodePacked(creation, prefix, targetBytes, suffix);\n }\n}\n" + }, + "@openzeppelin/contracts/access/Ownable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\nimport \"../utils/Context.sol\";\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor () internal {\n address msgSender = _msgSender();\n _owner = msgSender;\n emit OwnershipTransferred(address(0), msgSender);\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n _;\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n emit OwnershipTransferred(_owner, address(0));\n _owner = address(0);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n emit OwnershipTransferred(_owner, newOwner);\n _owner = newOwner;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Create2.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/**\n * @dev Helper to make usage of the `CREATE2` EVM opcode easier and safer.\n * `CREATE2` can be used to compute in advance the address where a smart\n * contract will be deployed, which allows for interesting new mechanisms known\n * as 'counterfactual interactions'.\n *\n * See the https://eips.ethereum.org/EIPS/eip-1014#motivation[EIP] for more\n * information.\n */\nlibrary Create2 {\n /**\n * @dev Deploys a contract using `CREATE2`. The address where the contract\n * will be deployed can be known in advance via {computeAddress}.\n *\n * The bytecode for a contract can be obtained from Solidity with\n * `type(contractName).creationCode`.\n *\n * Requirements:\n *\n * - `bytecode` must not be empty.\n * - `salt` must have not been used for `bytecode` already.\n * - the factory must have a balance of at least `amount`.\n * - if `amount` is non-zero, `bytecode` must have a `payable` constructor.\n */\n function deploy(uint256 amount, bytes32 salt, bytes memory bytecode) internal returns (address) {\n address addr;\n require(address(this).balance >= amount, \"Create2: insufficient balance\");\n require(bytecode.length != 0, \"Create2: bytecode length is zero\");\n // solhint-disable-next-line no-inline-assembly\n assembly {\n addr := create2(amount, add(bytecode, 0x20), mload(bytecode), salt)\n }\n require(addr != address(0), \"Create2: Failed on deploy\");\n return addr;\n }\n\n /**\n * @dev Returns the address where a contract will be stored if deployed via {deploy}. Any change in the\n * `bytecodeHash` or `salt` will result in a new destination address.\n */\n function computeAddress(bytes32 salt, bytes32 bytecodeHash) internal view returns (address) {\n return computeAddress(salt, bytecodeHash, address(this));\n }\n\n /**\n * @dev Returns the address where a contract will be stored if deployed via {deploy} from a contract located at\n * `deployer`. If `deployer` is this contract's address, returns the same value as {computeAddress}.\n */\n function computeAddress(bytes32 salt, bytes32 bytecodeHash, address deployer) internal pure returns (address) {\n bytes32 _data = keccak256(\n abi.encodePacked(bytes1(0xff), deployer, salt, bytecodeHash)\n );\n return address(uint160(uint256(_data)));\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/*\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with GSN meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address payable) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes memory) {\n this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\n return msg.data;\n }\n}\n" + }, + "contracts/GraphTokenLockSimple.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport \"./GraphTokenLock.sol\";\n\n/**\n * @title GraphTokenLockSimple\n * @notice This contract is the concrete simple implementation built on top of the base\n * GraphTokenLock functionality for use when we only need the token lock schedule\n * features but no interaction with the network.\n * \n * This contract is designed to be deployed without the use of a TokenManager.\n */\ncontract GraphTokenLockSimple is GraphTokenLock {\n // Constructor\n constructor() {\n Ownable.initialize(msg.sender);\n }\n\n // Initializer\n function initialize(\n address _owner,\n address _beneficiary,\n address _token,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n Revocability _revocable\n ) external onlyOwner {\n _initialize(\n _owner,\n _beneficiary,\n _token,\n _managedAmount,\n _startTime,\n _endTime,\n _periods,\n _releaseStartTime,\n _vestingCliffTime,\n _revocable\n );\n }\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": false, + "runs": 200 + }, + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file diff --git a/packages/token-distribution/deployments/mainnet/solcInputs/6f5e8f450f52dd96ebb796aa6620fee9.json b/packages/token-distribution/deployments/mainnet/solcInputs/6f5e8f450f52dd96ebb796aa6620fee9.json new file mode 100644 index 000000000..fafe342a8 --- /dev/null +++ b/packages/token-distribution/deployments/mainnet/solcInputs/6f5e8f450f52dd96ebb796aa6620fee9.json @@ -0,0 +1,98 @@ +{ + "language": "Solidity", + "sources": { + "contracts/GraphTokenDistributor.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\nimport \"@openzeppelin/contracts/math/SafeMath.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\";\n\n/**\n * @title GraphTokenDistributor\n * @dev Contract that allows distribution of tokens to multiple beneficiaries.\n * The contract accept deposits in the configured token by anyone.\n * The owner can setup the desired distribution by setting the amount of tokens\n * assigned to each beneficiary account.\n * Beneficiaries claim for their allocated tokens.\n * Only the owner can withdraw tokens from this contract without limitations.\n * For the distribution to work this contract must be unlocked by the owner.\n */\ncontract GraphTokenDistributor is Ownable {\n using SafeMath for uint256;\n using SafeERC20 for IERC20;\n\n // -- State --\n\n bool public locked;\n mapping(address => uint256) public beneficiaries;\n\n IERC20 public token;\n\n // -- Events --\n\n event BeneficiaryUpdated(address indexed beneficiary, uint256 amount);\n event TokensDeposited(address indexed sender, uint256 amount);\n event TokensWithdrawn(address indexed sender, uint256 amount);\n event TokensClaimed(address indexed beneficiary, address to, uint256 amount);\n event LockUpdated(bool locked);\n\n modifier whenNotLocked() {\n require(locked == false, \"Distributor: Claim is locked\");\n _;\n }\n\n /**\n * Constructor.\n * @param _token Token to use for deposits and withdrawals\n */\n constructor(IERC20 _token) {\n token = _token;\n locked = true;\n }\n\n /**\n * Deposit tokens into the contract.\n * Even if the ERC20 token can be transferred directly to the contract\n * this function provide a safe interface to do the transfer and avoid mistakes\n * @param _amount Amount to deposit\n */\n function deposit(uint256 _amount) external {\n token.safeTransferFrom(msg.sender, address(this), _amount);\n emit TokensDeposited(msg.sender, _amount);\n }\n\n // -- Admin functions --\n\n /**\n * Add token balance available for account.\n * @param _account Address to assign tokens to\n * @param _amount Amount of tokens to assign to beneficiary\n */\n function addBeneficiaryTokens(address _account, uint256 _amount) external onlyOwner {\n _setBeneficiaryTokens(_account, beneficiaries[_account].add(_amount));\n }\n\n /**\n * Add token balance available for multiple accounts.\n * @param _accounts Addresses to assign tokens to\n * @param _amounts Amounts of tokens to assign to beneficiary\n */\n function addBeneficiaryTokensMulti(address[] calldata _accounts, uint256[] calldata _amounts) external onlyOwner {\n require(_accounts.length == _amounts.length, \"Distributor: !length\");\n for (uint256 i = 0; i < _accounts.length; i++) {\n _setBeneficiaryTokens(_accounts[i], beneficiaries[_accounts[i]].add(_amounts[i]));\n }\n }\n\n /**\n * Remove token balance available for account.\n * @param _account Address to assign tokens to\n * @param _amount Amount of tokens to assign to beneficiary\n */\n function subBeneficiaryTokens(address _account, uint256 _amount) external onlyOwner {\n _setBeneficiaryTokens(_account, beneficiaries[_account].sub(_amount));\n }\n\n /**\n * Remove token balance available for multiple accounts.\n * @param _accounts Addresses to assign tokens to\n * @param _amounts Amounts of tokens to assign to beneficiary\n */\n function subBeneficiaryTokensMulti(address[] calldata _accounts, uint256[] calldata _amounts) external onlyOwner {\n require(_accounts.length == _amounts.length, \"Distributor: !length\");\n for (uint256 i = 0; i < _accounts.length; i++) {\n _setBeneficiaryTokens(_accounts[i], beneficiaries[_accounts[i]].sub(_amounts[i]));\n }\n }\n\n /**\n * Set amount of tokens available for beneficiary account.\n * @param _account Address to assign tokens to\n * @param _amount Amount of tokens to assign to beneficiary\n */\n function _setBeneficiaryTokens(address _account, uint256 _amount) private {\n require(_account != address(0), \"Distributor: !account\");\n\n beneficiaries[_account] = _amount;\n emit BeneficiaryUpdated(_account, _amount);\n }\n\n /**\n * Set locked withdrawals.\n * @param _locked True to lock withdrawals\n */\n function setLocked(bool _locked) external onlyOwner {\n locked = _locked;\n emit LockUpdated(_locked);\n }\n\n /**\n * Withdraw tokens from the contract. This function is included as\n * a escape hatch in case of mistakes or to recover remaining funds.\n * @param _amount Amount of tokens to withdraw\n */\n function withdraw(uint256 _amount) external onlyOwner {\n token.safeTransfer(msg.sender, _amount);\n emit TokensWithdrawn(msg.sender, _amount);\n }\n\n // -- Beneficiary functions --\n\n /**\n * Claim tokens and send to caller.\n */\n function claim() external whenNotLocked {\n claimTo(msg.sender);\n }\n\n /**\n * Claim tokens and send to address.\n * @param _to Address where to send tokens\n */\n function claimTo(address _to) public whenNotLocked {\n uint256 claimableTokens = beneficiaries[msg.sender];\n require(claimableTokens > 0, \"Distributor: Unavailable funds\");\n\n _setBeneficiaryTokens(msg.sender, 0);\n\n token.safeTransfer(_to, claimableTokens);\n emit TokensClaimed(msg.sender, _to, claimableTokens);\n }\n}\n" + }, + "@openzeppelin/contracts/access/Ownable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\nimport \"../utils/Context.sol\";\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor () internal {\n address msgSender = _msgSender();\n _owner = msgSender;\n emit OwnershipTransferred(address(0), msgSender);\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n _;\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n emit OwnershipTransferred(_owner, address(0));\n _owner = address(0);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n emit OwnershipTransferred(_owner, newOwner);\n _owner = newOwner;\n }\n}\n" + }, + "@openzeppelin/contracts/math/SafeMath.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/**\n * @dev Wrappers over Solidity's arithmetic operations with added overflow\n * checks.\n *\n * Arithmetic operations in Solidity wrap on overflow. This can easily result\n * in bugs, because programmers usually assume that an overflow raises an\n * error, which is the standard behavior in high level programming languages.\n * `SafeMath` restores this intuition by reverting the transaction when an\n * operation overflows.\n *\n * Using this library instead of the unchecked operations eliminates an entire\n * class of bugs, so it's recommended to use it always.\n */\nlibrary SafeMath {\n /**\n * @dev Returns the addition of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n uint256 c = a + b;\n if (c < a) return (false, 0);\n return (true, c);\n }\n\n /**\n * @dev Returns the substraction of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n if (b > a) return (false, 0);\n return (true, a - b);\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\n // benefit is lost if 'b' is also tested.\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\n if (a == 0) return (true, 0);\n uint256 c = a * b;\n if (c / a != b) return (false, 0);\n return (true, c);\n }\n\n /**\n * @dev Returns the division of two unsigned integers, with a division by zero flag.\n *\n * _Available since v3.4._\n */\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n if (b == 0) return (false, 0);\n return (true, a / b);\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\n *\n * _Available since v3.4._\n */\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n if (b == 0) return (false, 0);\n return (true, a % b);\n }\n\n /**\n * @dev Returns the addition of two unsigned integers, reverting on\n * overflow.\n *\n * Counterpart to Solidity's `+` operator.\n *\n * Requirements:\n *\n * - Addition cannot overflow.\n */\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\n uint256 c = a + b;\n require(c >= a, \"SafeMath: addition overflow\");\n return c;\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, reverting on\n * overflow (when the result is negative).\n *\n * Counterpart to Solidity's `-` operator.\n *\n * Requirements:\n *\n * - Subtraction cannot overflow.\n */\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b <= a, \"SafeMath: subtraction overflow\");\n return a - b;\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, reverting on\n * overflow.\n *\n * Counterpart to Solidity's `*` operator.\n *\n * Requirements:\n *\n * - Multiplication cannot overflow.\n */\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n if (a == 0) return 0;\n uint256 c = a * b;\n require(c / a == b, \"SafeMath: multiplication overflow\");\n return c;\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers, reverting on\n * division by zero. The result is rounded towards zero.\n *\n * Counterpart to Solidity's `/` operator. Note: this function uses a\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\n * uses an invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b > 0, \"SafeMath: division by zero\");\n return a / b;\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * reverting when dividing by zero.\n *\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\n * opcode (which leaves remaining gas untouched) while Solidity uses an\n * invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b > 0, \"SafeMath: modulo by zero\");\n return a % b;\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\n * overflow (when the result is negative).\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {trySub}.\n *\n * Counterpart to Solidity's `-` operator.\n *\n * Requirements:\n *\n * - Subtraction cannot overflow.\n */\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b <= a, errorMessage);\n return a - b;\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers, reverting with custom message on\n * division by zero. The result is rounded towards zero.\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {tryDiv}.\n *\n * Counterpart to Solidity's `/` operator. Note: this function uses a\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\n * uses an invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b > 0, errorMessage);\n return a / b;\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * reverting with custom message when dividing by zero.\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {tryMod}.\n *\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\n * opcode (which leaves remaining gas untouched) while Solidity uses an\n * invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b > 0, errorMessage);\n return a % b;\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `recipient`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address recipient, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `sender` to `recipient` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);\n\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/SafeERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"../../math/SafeMath.sol\";\nimport \"../../utils/Address.sol\";\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n using SafeMath for uint256;\n using Address for address;\n\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\n }\n\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\n }\n\n /**\n * @dev Deprecated. This function has issues similar to the ones found in\n * {IERC20-approve}, and its usage is discouraged.\n *\n * Whenever possible, use {safeIncreaseAllowance} and\n * {safeDecreaseAllowance} instead.\n */\n function safeApprove(IERC20 token, address spender, uint256 value) internal {\n // safeApprove should only be called when setting an initial allowance,\n // or when resetting it to zero. To increase and decrease it, use\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\n // solhint-disable-next-line max-line-length\n require((value == 0) || (token.allowance(address(this), spender) == 0),\n \"SafeERC20: approve from non-zero to non-zero allowance\"\n );\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\n }\n\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n uint256 newAllowance = token.allowance(address(this), spender).add(value);\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\n\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n uint256 newAllowance = token.allowance(address(this), spender).sub(value, \"SafeERC20: decreased allowance below zero\");\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n */\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that\n // the target address contains contract code and also asserts for success in the low-level call.\n\n bytes memory returndata = address(token).functionCall(data, \"SafeERC20: low-level call failed\");\n if (returndata.length > 0) { // Return data is optional\n // solhint-disable-next-line max-line-length\n require(abi.decode(returndata, (bool)), \"SafeERC20: ERC20 operation did not succeed\");\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/*\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with GSN meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address payable) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes memory) {\n this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\n return msg.data;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Address.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.2 <0.8.0;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize, which returns 0 for contracts in\n // construction, since the code is only stored at the end of the\n // constructor execution.\n\n uint256 size;\n // solhint-disable-next-line no-inline-assembly\n assembly { size := extcodesize(account) }\n return size > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n // solhint-disable-next-line avoid-low-level-calls, avoid-call-value\n (bool success, ) = recipient.call{ value: amount }(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain`call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCall(target, data, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n require(isContract(target), \"Address: call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.call{ value: value }(data);\n return _verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {\n require(isContract(target), \"Address: static call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.staticcall(data);\n return _verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\n require(isContract(target), \"Address: delegate call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return _verifyCallResult(success, returndata, errorMessage);\n }\n\n function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {\n if (success) {\n return returndata;\n } else {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n }\n}\n" + }, + "contracts/GraphTokenLockWallet.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"@openzeppelin/contracts/math/SafeMath.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\";\n\nimport \"./GraphTokenLock.sol\";\nimport \"./IGraphTokenLockManager.sol\";\n\n/**\n * @title GraphTokenLockWallet\n * @notice This contract is built on top of the base GraphTokenLock functionality.\n * It allows wallet beneficiaries to use the deposited funds to perform specific function calls\n * on specific contracts.\n *\n * The idea is that supporters with locked tokens can participate in the protocol\n * but disallow any release before the vesting/lock schedule.\n * The beneficiary can issue authorized function calls to this contract that will\n * get forwarded to a target contract. A target contract is any of our protocol contracts.\n * The function calls allowed are queried to the GraphTokenLockManager, this way\n * the same configuration can be shared for all the created lock wallet contracts.\n *\n * NOTE: Contracts used as target must have its function signatures checked to avoid collisions\n * with any of this contract functions.\n * Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience\n * the maximum amount of tokens is authorized.\n */\ncontract GraphTokenLockWallet is GraphTokenLock {\n using SafeMath for uint256;\n using SafeERC20 for IERC20;\n\n // -- State --\n\n IGraphTokenLockManager public manager;\n uint256 public usedAmount;\n\n uint256 private constant MAX_UINT256 = 2**256 - 1;\n\n // -- Events --\n\n event ManagerUpdated(address indexed _oldManager, address indexed _newManager);\n event TokenDestinationsApproved();\n event TokenDestinationsRevoked();\n\n // Initializer\n function initialize(\n address _manager,\n address _owner,\n address _beneficiary,\n address _token,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n Revocability _revocable\n ) external {\n _initialize(\n _owner,\n _beneficiary,\n _token,\n _managedAmount,\n _startTime,\n _endTime,\n _periods,\n _releaseStartTime,\n _vestingCliffTime,\n _revocable\n );\n _setManager(_manager);\n }\n\n // -- Admin --\n\n /**\n * @notice Sets a new manager for this contract\n * @param _newManager Address of the new manager\n */\n function setManager(address _newManager) external onlyOwner {\n _setManager(_newManager);\n }\n\n /**\n * @dev Sets a new manager for this contract\n * @param _newManager Address of the new manager\n */\n function _setManager(address _newManager) private {\n require(_newManager != address(0), \"Manager cannot be empty\");\n require(Address.isContract(_newManager), \"Manager must be a contract\");\n\n address oldManager = address(manager);\n manager = IGraphTokenLockManager(_newManager);\n\n emit ManagerUpdated(oldManager, _newManager);\n }\n\n // -- Beneficiary --\n\n /**\n * @notice Approves protocol access of the tokens managed by this contract\n * @dev Approves all token destinations registered in the manager to pull tokens\n */\n function approveProtocol() external onlyBeneficiary {\n address[] memory dstList = manager.getTokenDestinations();\n for (uint256 i = 0; i < dstList.length; i++) {\n token.safeApprove(dstList[i], MAX_UINT256);\n }\n emit TokenDestinationsApproved();\n }\n\n /**\n * @notice Revokes protocol access of the tokens managed by this contract\n * @dev Revokes approval to all token destinations in the manager to pull tokens\n */\n function revokeProtocol() external onlyBeneficiary {\n address[] memory dstList = manager.getTokenDestinations();\n for (uint256 i = 0; i < dstList.length; i++) {\n token.safeApprove(dstList[i], 0);\n }\n emit TokenDestinationsRevoked();\n }\n\n /**\n * @notice Gets tokens currently available for release\n * @dev Considers the schedule, takes into account already released tokens and used amount\n * @return Amount of tokens ready to be released\n */\n function releasableAmount() public view override returns (uint256) {\n if (revocable == Revocability.Disabled) {\n return super.releasableAmount();\n }\n\n // -- Revocability enabled logic\n // This needs to deal with additional considerations for when tokens are used in the protocol\n\n // If a release start time is set no tokens are available for release before this date\n // If not set it follows the default schedule and tokens are available on\n // the first period passed\n if (releaseStartTime > 0 && currentTime() < releaseStartTime) {\n return 0;\n }\n\n // Vesting cliff is activated and it has not passed means nothing is vested yet\n // so funds cannot be released\n if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\n return 0;\n }\n\n // A beneficiary can never have more releasable tokens than the contract balance\n // We consider the `usedAmount` in the protocol as part of the calculations\n // the beneficiary should not release funds that are used.\n uint256 releasable = availableAmount().sub(releasedAmount).sub(usedAmount);\n return MathUtils.min(currentBalance(), releasable);\n }\n\n /**\n * @notice Forward authorized contract calls to protocol contracts\n * @dev Fallback function can be called by the beneficiary only if function call is allowed\n */\n fallback() external payable {\n // Only beneficiary can forward calls\n require(msg.sender == beneficiary, \"Unauthorized caller\");\n\n // Function call validation\n address _target = manager.getAuthFunctionCallTarget(msg.sig);\n require(_target != address(0), \"Unauthorized function\");\n\n uint256 oldBalance = currentBalance();\n\n // Call function with data\n Address.functionCall(_target, msg.data);\n\n // Tracked used tokens in the protocol\n // We do this check after balances were updated by the forwarded call\n // Check is only enforced for revocable contracts to save some gas\n if (revocable == Revocability.Enabled) {\n // Track contract balance change\n uint256 newBalance = currentBalance();\n if (newBalance < oldBalance) {\n // Outflow\n uint256 diff = oldBalance.sub(newBalance);\n usedAmount = usedAmount.add(diff);\n } else {\n // Inflow: We can receive profits from the protocol, that could make usedAmount to\n // underflow. We set it to zero in that case.\n uint256 diff = newBalance.sub(oldBalance);\n usedAmount = (diff >= usedAmount) ? 0 : usedAmount.sub(diff);\n }\n require(usedAmount <= vestedAmount(), \"Cannot use more tokens than vested amount\");\n }\n }\n}\n" + }, + "contracts/GraphTokenLock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport \"@openzeppelin/contracts/math/SafeMath.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\";\n\nimport \"./Ownable.sol\";\nimport \"./MathUtils.sol\";\nimport \"./IGraphTokenLock.sol\";\n\n/**\n * @title GraphTokenLock\n * @notice Contract that manages an unlocking schedule of tokens.\n * @dev The contract lock manage a number of tokens deposited into the contract to ensure that\n * they can only be released under certain time conditions.\n *\n * This contract implements a release scheduled based on periods and tokens are released in steps\n * after each period ends. It can be configured with one period in which case it is like a plain TimeLock.\n * It also supports revocation to be used for vesting schedules.\n *\n * The contract supports receiving extra funds than the managed tokens ones that can be\n * withdrawn by the beneficiary at any time.\n *\n * A releaseStartTime parameter is included to override the default release schedule and\n * perform the first release on the configured time. After that it will continue with the\n * default schedule.\n */\nabstract contract GraphTokenLock is Ownable, IGraphTokenLock {\n using SafeMath for uint256;\n using SafeERC20 for IERC20;\n\n uint256 private constant MIN_PERIOD = 1;\n\n // -- State --\n\n IERC20 public token;\n address public beneficiary;\n\n // Configuration\n\n // Amount of tokens managed by the contract schedule\n uint256 public managedAmount;\n\n uint256 public startTime; // Start datetime (in unixtimestamp)\n uint256 public endTime; // Datetime after all funds are fully vested/unlocked (in unixtimestamp)\n uint256 public periods; // Number of vesting/release periods\n\n // First release date for tokens (in unixtimestamp)\n // If set, no tokens will be released before releaseStartTime ignoring\n // the amount to release each period\n uint256 public releaseStartTime;\n // A cliff set a date to which a beneficiary needs to get to vest\n // all preceding periods\n uint256 public vestingCliffTime;\n Revocability public revocable; // Whether to use vesting for locked funds\n\n // State\n\n bool public isRevoked;\n bool public isInitialized;\n bool public isAccepted;\n uint256 public releasedAmount;\n uint256 public revokedAmount;\n\n // -- Events --\n\n event TokensReleased(address indexed beneficiary, uint256 amount);\n event TokensWithdrawn(address indexed beneficiary, uint256 amount);\n event TokensRevoked(address indexed beneficiary, uint256 amount);\n event BeneficiaryChanged(address newBeneficiary);\n event LockAccepted();\n event LockCanceled();\n\n /**\n * @dev Only allow calls from the beneficiary of the contract\n */\n modifier onlyBeneficiary() {\n require(msg.sender == beneficiary, \"!auth\");\n _;\n }\n\n /**\n * @notice Initializes the contract\n * @param _owner Address of the contract owner\n * @param _beneficiary Address of the beneficiary of locked tokens\n * @param _managedAmount Amount of tokens to be managed by the lock contract\n * @param _startTime Start time of the release schedule\n * @param _endTime End time of the release schedule\n * @param _periods Number of periods between start time and end time\n * @param _releaseStartTime Override time for when the releases start\n * @param _vestingCliffTime Override time for when the vesting start\n * @param _revocable Whether the contract is revocable\n */\n function _initialize(\n address _owner,\n address _beneficiary,\n address _token,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n Revocability _revocable\n ) internal {\n require(!isInitialized, \"Already initialized\");\n require(_owner != address(0), \"Owner cannot be zero\");\n require(_beneficiary != address(0), \"Beneficiary cannot be zero\");\n require(_token != address(0), \"Token cannot be zero\");\n require(_managedAmount > 0, \"Managed tokens cannot be zero\");\n require(_startTime != 0, \"Start time must be set\");\n require(_startTime < _endTime, \"Start time > end time\");\n require(_periods >= MIN_PERIOD, \"Periods cannot be below minimum\");\n require(_revocable != Revocability.NotSet, \"Must set a revocability option\");\n require(_releaseStartTime < _endTime, \"Release start time must be before end time\");\n require(_vestingCliffTime < _endTime, \"Cliff time must be before end time\");\n\n isInitialized = true;\n\n Ownable.initialize(_owner);\n beneficiary = _beneficiary;\n token = IERC20(_token);\n\n managedAmount = _managedAmount;\n\n startTime = _startTime;\n endTime = _endTime;\n periods = _periods;\n\n // Optionals\n releaseStartTime = _releaseStartTime;\n vestingCliffTime = _vestingCliffTime;\n revocable = _revocable;\n }\n\n /**\n * @notice Change the beneficiary of funds managed by the contract\n * @dev Can only be called by the beneficiary\n * @param _newBeneficiary Address of the new beneficiary address\n */\n function changeBeneficiary(address _newBeneficiary) external onlyBeneficiary {\n require(_newBeneficiary != address(0), \"Empty beneficiary\");\n beneficiary = _newBeneficiary;\n emit BeneficiaryChanged(_newBeneficiary);\n }\n\n /**\n * @notice Beneficiary accepts the lock, the owner cannot retrieve back the tokens\n * @dev Can only be called by the beneficiary\n */\n function acceptLock() external onlyBeneficiary {\n isAccepted = true;\n emit LockAccepted();\n }\n\n /**\n * @notice Owner cancel the lock and return the balance in the contract\n * @dev Can only be called by the owner\n */\n function cancelLock() external onlyOwner {\n require(isAccepted == false, \"Cannot cancel accepted contract\");\n\n token.safeTransfer(owner(), currentBalance());\n\n emit LockCanceled();\n }\n\n // -- Balances --\n\n /**\n * @notice Returns the amount of tokens currently held by the contract\n * @return Tokens held in the contract\n */\n function currentBalance() public view override returns (uint256) {\n return token.balanceOf(address(this));\n }\n\n // -- Time & Periods --\n\n /**\n * @notice Returns the current block timestamp\n * @return Current block timestamp\n */\n function currentTime() public view override returns (uint256) {\n return block.timestamp;\n }\n\n /**\n * @notice Gets duration of contract from start to end in seconds\n * @return Amount of seconds from contract startTime to endTime\n */\n function duration() public view override returns (uint256) {\n return endTime.sub(startTime);\n }\n\n /**\n * @notice Gets time elapsed since the start of the contract\n * @dev Returns zero if called before conctract starTime\n * @return Seconds elapsed from contract startTime\n */\n function sinceStartTime() public view override returns (uint256) {\n uint256 current = currentTime();\n if (current <= startTime) {\n return 0;\n }\n return current.sub(startTime);\n }\n\n /**\n * @notice Returns amount available to be released after each period according to schedule\n * @return Amount of tokens available after each period\n */\n function amountPerPeriod() public view override returns (uint256) {\n return managedAmount.div(periods);\n }\n\n /**\n * @notice Returns the duration of each period in seconds\n * @return Duration of each period in seconds\n */\n function periodDuration() public view override returns (uint256) {\n return duration().div(periods);\n }\n\n /**\n * @notice Gets the current period based on the schedule\n * @return A number that represents the current period\n */\n function currentPeriod() public view override returns (uint256) {\n return sinceStartTime().div(periodDuration()).add(MIN_PERIOD);\n }\n\n /**\n * @notice Gets the number of periods that passed since the first period\n * @return A number of periods that passed since the schedule started\n */\n function passedPeriods() public view override returns (uint256) {\n return currentPeriod().sub(MIN_PERIOD);\n }\n\n // -- Locking & Release Schedule --\n\n /**\n * @notice Gets the currently available token according to the schedule\n * @dev Implements the step-by-step schedule based on periods for available tokens\n * @return Amount of tokens available according to the schedule\n */\n function availableAmount() public view override returns (uint256) {\n uint256 current = currentTime();\n\n // Before contract start no funds are available\n if (current < startTime) {\n return 0;\n }\n\n // After contract ended all funds are available\n if (current > endTime) {\n return managedAmount;\n }\n\n // Get available amount based on period\n return passedPeriods().mul(amountPerPeriod());\n }\n\n /**\n * @notice Gets the amount of currently vested tokens\n * @dev Similar to available amount, but is fully vested when contract is non-revocable\n * @return Amount of tokens already vested\n */\n function vestedAmount() public view override returns (uint256) {\n // If non-revocable it is fully vested\n if (revocable == Revocability.Disabled) {\n return managedAmount;\n }\n\n // Vesting cliff is activated and it has not passed means nothing is vested yet\n if (vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\n return 0;\n }\n\n return availableAmount();\n }\n\n /**\n * @notice Gets tokens currently available for release\n * @dev Considers the schedule and takes into account already released tokens\n * @return Amount of tokens ready to be released\n */\n function releasableAmount() public view virtual override returns (uint256) {\n // If a release start time is set no tokens are available for release before this date\n // If not set it follows the default schedule and tokens are available on\n // the first period passed\n if (releaseStartTime > 0 && currentTime() < releaseStartTime) {\n return 0;\n }\n\n // Vesting cliff is activated and it has not passed means nothing is vested yet\n // so funds cannot be released\n if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\n return 0;\n }\n\n // A beneficiary can never have more releasable tokens than the contract balance\n uint256 releasable = availableAmount().sub(releasedAmount);\n return MathUtils.min(currentBalance(), releasable);\n }\n\n /**\n * @notice Gets the outstanding amount yet to be released based on the whole contract lifetime\n * @dev Does not consider schedule but just global amounts tracked\n * @return Amount of outstanding tokens for the lifetime of the contract\n */\n function totalOutstandingAmount() public view override returns (uint256) {\n return managedAmount.sub(releasedAmount).sub(revokedAmount);\n }\n\n /**\n * @notice Gets surplus amount in the contract based on outstanding amount to release\n * @dev All funds over outstanding amount is considered surplus that can be withdrawn by beneficiary\n * @return Amount of tokens considered as surplus\n */\n function surplusAmount() public view override returns (uint256) {\n uint256 balance = currentBalance();\n uint256 outstandingAmount = totalOutstandingAmount();\n if (balance > outstandingAmount) {\n return balance.sub(outstandingAmount);\n }\n return 0;\n }\n\n // -- Value Transfer --\n\n /**\n * @notice Releases tokens based on the configured schedule\n * @dev All available releasable tokens are transferred to beneficiary\n */\n function release() external override onlyBeneficiary {\n uint256 amountToRelease = releasableAmount();\n require(amountToRelease > 0, \"No available releasable amount\");\n\n releasedAmount = releasedAmount.add(amountToRelease);\n\n token.safeTransfer(beneficiary, amountToRelease);\n\n emit TokensReleased(beneficiary, amountToRelease);\n }\n\n /**\n * @notice Withdraws surplus, unmanaged tokens from the contract\n * @dev Tokens in the contract over outstanding amount are considered as surplus\n * @param _amount Amount of tokens to withdraw\n */\n function withdrawSurplus(uint256 _amount) external override onlyBeneficiary {\n require(_amount > 0, \"Amount cannot be zero\");\n require(surplusAmount() >= _amount, \"Amount requested > surplus available\");\n\n token.safeTransfer(beneficiary, _amount);\n\n emit TokensWithdrawn(beneficiary, _amount);\n }\n\n /**\n * @notice Revokes a vesting schedule and return the unvested tokens to the owner\n * @dev Vesting schedule is always calculated based on managed tokens\n */\n function revoke() external override onlyOwner {\n require(revocable == Revocability.Enabled, \"Contract is non-revocable\");\n require(isRevoked == false, \"Already revoked\");\n\n uint256 unvestedAmount = managedAmount.sub(vestedAmount());\n require(unvestedAmount > 0, \"No available unvested amount\");\n\n revokedAmount = unvestedAmount;\n isRevoked = true;\n\n token.safeTransfer(owner(), unvestedAmount);\n\n emit TokensRevoked(beneficiary, unvestedAmount);\n }\n}\n" + }, + "contracts/IGraphTokenLockManager.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\nimport \"./IGraphTokenLock.sol\";\n\ninterface IGraphTokenLockManager {\n // -- Factory --\n\n function setMasterCopy(address _masterCopy) external;\n\n function createTokenLockWallet(\n address _owner,\n address _beneficiary,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n IGraphTokenLock.Revocability _revocable\n ) external;\n\n // -- Funds Management --\n\n function token() external returns (IERC20);\n\n function deposit(uint256 _amount) external;\n\n function withdraw(uint256 _amount) external;\n\n // -- Allowed Funds Destinations --\n\n function addTokenDestination(address _dst) external;\n\n function removeTokenDestination(address _dst) external;\n\n function isTokenDestination(address _dst) external view returns (bool);\n\n function getTokenDestinations() external view returns (address[] memory);\n\n // -- Function Call Authorization --\n\n function setAuthFunctionCall(string calldata _signature, address _target) external;\n\n function unsetAuthFunctionCall(string calldata _signature) external;\n\n function setAuthFunctionCallMany(string[] calldata _signatures, address[] calldata _targets) external;\n\n function getAuthFunctionCallTarget(bytes4 _sigHash) external view returns (address);\n\n function isAuthFunctionCall(bytes4 _sigHash) external view returns (bool);\n}\n" + }, + "contracts/Ownable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * The owner account will be passed on initialization of the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\ncontract Ownable {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n function initialize(address owner) internal {\n _owner = owner;\n emit OwnershipTransferred(address(0), owner);\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(_owner == msg.sender, \"Ownable: caller is not the owner\");\n _;\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() external virtual onlyOwner {\n emit OwnershipTransferred(_owner, address(0));\n _owner = address(0);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) external virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n emit OwnershipTransferred(_owner, newOwner);\n _owner = newOwner;\n }\n}\n" + }, + "contracts/MathUtils.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nlibrary MathUtils {\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n}\n" + }, + "contracts/IGraphTokenLock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\ninterface IGraphTokenLock {\n enum Revocability {\n NotSet,\n Enabled,\n Disabled\n }\n\n // -- Balances --\n\n function currentBalance() external view returns (uint256);\n\n // -- Time & Periods --\n\n function currentTime() external view returns (uint256);\n\n function duration() external view returns (uint256);\n\n function sinceStartTime() external view returns (uint256);\n\n function amountPerPeriod() external view returns (uint256);\n\n function periodDuration() external view returns (uint256);\n\n function currentPeriod() external view returns (uint256);\n\n function passedPeriods() external view returns (uint256);\n\n // -- Locking & Release Schedule --\n\n function availableAmount() external view returns (uint256);\n\n function vestedAmount() external view returns (uint256);\n\n function releasableAmount() external view returns (uint256);\n\n function totalOutstandingAmount() external view returns (uint256);\n\n function surplusAmount() external view returns (uint256);\n\n // -- Value Transfer --\n\n function release() external;\n\n function withdrawSurplus(uint256 _amount) external;\n\n function revoke() external;\n}\n" + }, + "contracts/StakingMock.sol": { + "content": "pragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\nimport \"./Stakes.sol\";\n\ncontract StakingMock {\n using SafeMath for uint256;\n using Stakes for Stakes.Indexer;\n\n // -- State --\n\n uint256 public minimumIndexerStake = 100e18;\n uint256 public thawingPeriod = 10; // 10 blocks\n IERC20 public token;\n\n // Indexer stakes : indexer => Stake\n mapping(address => Stakes.Indexer) public stakes;\n\n /**\n * @dev Emitted when `indexer` stake `tokens` amount.\n */\n event StakeDeposited(address indexed indexer, uint256 tokens);\n\n /**\n * @dev Emitted when `indexer` unstaked and locked `tokens` amount `until` block.\n */\n event StakeLocked(address indexed indexer, uint256 tokens, uint256 until);\n\n /**\n * @dev Emitted when `indexer` withdrew `tokens` staked.\n */\n event StakeWithdrawn(address indexed indexer, uint256 tokens);\n\n // Contract constructor.\n constructor(IERC20 _token) {\n require(address(_token) != address(0), \"!token\");\n token = _token;\n }\n\n /**\n * @dev Deposit tokens on the indexer stake.\n * @param _tokens Amount of tokens to stake\n */\n function stake(uint256 _tokens) external {\n stakeTo(msg.sender, _tokens);\n }\n\n /**\n * @dev Deposit tokens on the indexer stake.\n * @param _indexer Address of the indexer\n * @param _tokens Amount of tokens to stake\n */\n function stakeTo(address _indexer, uint256 _tokens) public {\n require(_tokens > 0, \"!tokens\");\n\n // Ensure minimum stake\n require(stakes[_indexer].tokensSecureStake().add(_tokens) >= minimumIndexerStake, \"!minimumIndexerStake\");\n\n // Transfer tokens to stake from caller to this contract\n require(token.transferFrom(msg.sender, address(this), _tokens), \"!transfer\");\n\n // Stake the transferred tokens\n _stake(_indexer, _tokens);\n }\n\n /**\n * @dev Unstake tokens from the indexer stake, lock them until thawing period expires.\n * @param _tokens Amount of tokens to unstake\n */\n function unstake(uint256 _tokens) external {\n address indexer = msg.sender;\n Stakes.Indexer storage indexerStake = stakes[indexer];\n\n require(_tokens > 0, \"!tokens\");\n require(indexerStake.hasTokens(), \"!stake\");\n require(indexerStake.tokensAvailable() >= _tokens, \"!stake-avail\");\n\n // Ensure minimum stake\n uint256 newStake = indexerStake.tokensSecureStake().sub(_tokens);\n require(newStake == 0 || newStake >= minimumIndexerStake, \"!minimumIndexerStake\");\n\n // Before locking more tokens, withdraw any unlocked ones\n uint256 tokensToWithdraw = indexerStake.tokensWithdrawable();\n if (tokensToWithdraw > 0) {\n _withdraw(indexer);\n }\n\n indexerStake.lockTokens(_tokens, thawingPeriod);\n\n emit StakeLocked(indexer, indexerStake.tokensLocked, indexerStake.tokensLockedUntil);\n }\n\n /**\n * @dev Withdraw indexer tokens once the thawing period has passed.\n */\n function withdraw() external {\n _withdraw(msg.sender);\n }\n\n function _stake(address _indexer, uint256 _tokens) internal {\n // Deposit tokens into the indexer stake\n Stakes.Indexer storage indexerStake = stakes[_indexer];\n indexerStake.deposit(_tokens);\n\n emit StakeDeposited(_indexer, _tokens);\n }\n\n /**\n * @dev Withdraw indexer tokens once the thawing period has passed.\n * @param _indexer Address of indexer to withdraw funds from\n */\n function _withdraw(address _indexer) private {\n // Get tokens available for withdraw and update balance\n uint256 tokensToWithdraw = stakes[_indexer].withdrawTokens();\n require(tokensToWithdraw > 0, \"!tokens\");\n\n // Return tokens to the indexer\n require(token.transfer(_indexer, tokensToWithdraw), \"!transfer\");\n\n emit StakeWithdrawn(_indexer, tokensToWithdraw);\n }\n}\n" + }, + "contracts/Stakes.sol": { + "content": "pragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/math/SafeMath.sol\";\n\n/**\n * @title A collection of data structures and functions to manage the Indexer Stake state.\n * Used for low-level state changes, require() conditions should be evaluated\n * at the caller function scope.\n */\nlibrary Stakes {\n using SafeMath for uint256;\n using Stakes for Stakes.Indexer;\n\n struct Indexer {\n uint256 tokensStaked; // Tokens on the indexer stake (staked by the indexer)\n uint256 tokensAllocated; // Tokens used in allocations\n uint256 tokensLocked; // Tokens locked for withdrawal subject to thawing period\n uint256 tokensLockedUntil; // Block when locked tokens can be withdrawn\n }\n\n /**\n * @dev Deposit tokens to the indexer stake.\n * @param stake Stake data\n * @param _tokens Amount of tokens to deposit\n */\n function deposit(Stakes.Indexer storage stake, uint256 _tokens) internal {\n stake.tokensStaked = stake.tokensStaked.add(_tokens);\n }\n\n /**\n * @dev Release tokens from the indexer stake.\n * @param stake Stake data\n * @param _tokens Amount of tokens to release\n */\n function release(Stakes.Indexer storage stake, uint256 _tokens) internal {\n stake.tokensStaked = stake.tokensStaked.sub(_tokens);\n }\n\n /**\n * @dev Allocate tokens from the main stack to a SubgraphDeployment.\n * @param stake Stake data\n * @param _tokens Amount of tokens to allocate\n */\n function allocate(Stakes.Indexer storage stake, uint256 _tokens) internal {\n stake.tokensAllocated = stake.tokensAllocated.add(_tokens);\n }\n\n /**\n * @dev Unallocate tokens from a SubgraphDeployment back to the main stack.\n * @param stake Stake data\n * @param _tokens Amount of tokens to unallocate\n */\n function unallocate(Stakes.Indexer storage stake, uint256 _tokens) internal {\n stake.tokensAllocated = stake.tokensAllocated.sub(_tokens);\n }\n\n /**\n * @dev Lock tokens until a thawing period pass.\n * @param stake Stake data\n * @param _tokens Amount of tokens to unstake\n * @param _period Period in blocks that need to pass before withdrawal\n */\n function lockTokens(\n Stakes.Indexer storage stake,\n uint256 _tokens,\n uint256 _period\n ) internal {\n // Take into account period averaging for multiple unstake requests\n uint256 lockingPeriod = _period;\n if (stake.tokensLocked > 0) {\n lockingPeriod = stake.getLockingPeriod(_tokens, _period);\n }\n\n // Update balances\n stake.tokensLocked = stake.tokensLocked.add(_tokens);\n stake.tokensLockedUntil = block.number.add(lockingPeriod);\n }\n\n /**\n * @dev Unlock tokens.\n * @param stake Stake data\n * @param _tokens Amount of tokens to unkock\n */\n function unlockTokens(Stakes.Indexer storage stake, uint256 _tokens) internal {\n stake.tokensLocked = stake.tokensLocked.sub(_tokens);\n if (stake.tokensLocked == 0) {\n stake.tokensLockedUntil = 0;\n }\n }\n\n /**\n * @dev Take all tokens out from the locked stake for withdrawal.\n * @param stake Stake data\n * @return Amount of tokens being withdrawn\n */\n function withdrawTokens(Stakes.Indexer storage stake) internal returns (uint256) {\n // Calculate tokens that can be released\n uint256 tokensToWithdraw = stake.tokensWithdrawable();\n\n if (tokensToWithdraw > 0) {\n // Reset locked tokens\n stake.unlockTokens(tokensToWithdraw);\n\n // Decrease indexer stake\n stake.release(tokensToWithdraw);\n }\n\n return tokensToWithdraw;\n }\n\n /**\n * @dev Get the locking period of the tokens to unstake.\n * If already unstaked before calculate the weighted average.\n * @param stake Stake data\n * @param _tokens Amount of tokens to unstake\n * @param _thawingPeriod Period in blocks that need to pass before withdrawal\n * @return True if staked\n */\n function getLockingPeriod(\n Stakes.Indexer memory stake,\n uint256 _tokens,\n uint256 _thawingPeriod\n ) internal view returns (uint256) {\n uint256 blockNum = block.number;\n uint256 periodA = (stake.tokensLockedUntil > blockNum) ? stake.tokensLockedUntil.sub(blockNum) : 0;\n uint256 periodB = _thawingPeriod;\n uint256 stakeA = stake.tokensLocked;\n uint256 stakeB = _tokens;\n return periodA.mul(stakeA).add(periodB.mul(stakeB)).div(stakeA.add(stakeB));\n }\n\n /**\n * @dev Return true if there are tokens staked by the Indexer.\n * @param stake Stake data\n * @return True if staked\n */\n function hasTokens(Stakes.Indexer memory stake) internal pure returns (bool) {\n return stake.tokensStaked > 0;\n }\n\n /**\n * @dev Return the amount of tokens used in allocations and locked for withdrawal.\n * @param stake Stake data\n * @return Token amount\n */\n function tokensUsed(Stakes.Indexer memory stake) internal pure returns (uint256) {\n return stake.tokensAllocated.add(stake.tokensLocked);\n }\n\n /**\n * @dev Return the amount of tokens staked not considering the ones that are already going\n * through the thawing period or are ready for withdrawal. We call it secure stake because\n * it is not subject to change by a withdraw call from the indexer.\n * @param stake Stake data\n * @return Token amount\n */\n function tokensSecureStake(Stakes.Indexer memory stake) internal pure returns (uint256) {\n return stake.tokensStaked.sub(stake.tokensLocked);\n }\n\n /**\n * @dev Tokens free balance on the indexer stake that can be used for any purpose.\n * Any token that is allocated cannot be used as well as tokens that are going through the\n * thawing period or are withdrawable\n * Calc: tokensStaked - tokensAllocated - tokensLocked\n * @param stake Stake data\n * @return Token amount\n */\n function tokensAvailable(Stakes.Indexer memory stake) internal pure returns (uint256) {\n return stake.tokensAvailableWithDelegation(0);\n }\n\n /**\n * @dev Tokens free balance on the indexer stake that can be used for allocations.\n * This function accepts a parameter for extra delegated capacity that takes into\n * account delegated tokens\n * @param stake Stake data\n * @param _delegatedCapacity Amount of tokens used from delegators to calculate availability\n * @return Token amount\n */\n function tokensAvailableWithDelegation(Stakes.Indexer memory stake, uint256 _delegatedCapacity)\n internal\n pure\n returns (uint256)\n {\n uint256 tokensCapacity = stake.tokensStaked.add(_delegatedCapacity);\n uint256 _tokensUsed = stake.tokensUsed();\n // If more tokens are used than the current capacity, the indexer is overallocated.\n // This means the indexer doesn't have available capacity to create new allocations.\n // We can reach this state when the indexer has funds allocated and then any\n // of these conditions happen:\n // - The delegationCapacity ratio is reduced.\n // - The indexer stake is slashed.\n // - A delegator removes enough stake.\n if (_tokensUsed > tokensCapacity) {\n // Indexer stake is over allocated: return 0 to avoid stake to be used until\n // the overallocation is restored by staking more tokens, unallocating tokens\n // or using more delegated funds\n return 0;\n }\n return tokensCapacity.sub(_tokensUsed);\n }\n\n /**\n * @dev Tokens available for withdrawal after thawing period.\n * @param stake Stake data\n * @return Token amount\n */\n function tokensWithdrawable(Stakes.Indexer memory stake) internal view returns (uint256) {\n // No tokens to withdraw before locking period\n if (stake.tokensLockedUntil == 0 || block.number < stake.tokensLockedUntil) {\n return 0;\n }\n return stake.tokensLocked;\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/ERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\nimport \"../../utils/Context.sol\";\nimport \"./IERC20.sol\";\nimport \"../../math/SafeMath.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin guidelines: functions revert instead\n * of returning `false` on failure. This behavior is nonetheless conventional\n * and does not conflict with the expectations of ERC20 applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20 {\n using SafeMath for uint256;\n\n mapping (address => uint256) private _balances;\n\n mapping (address => mapping (address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n uint8 private _decimals;\n\n /**\n * @dev Sets the values for {name} and {symbol}, initializes {decimals} with\n * a default value of 18.\n *\n * To select a different value for {decimals}, use {_setupDecimals}.\n *\n * All three of these values are immutable: they can only be set once during\n * construction.\n */\n constructor (string memory name_, string memory symbol_) public {\n _name = name_;\n _symbol = symbol_;\n _decimals = 18;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5,05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless {_setupDecimals} is\n * called.\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual returns (uint8) {\n return _decimals;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `recipient` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address recipient, uint256 amount) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * Requirements:\n *\n * - `sender` and `recipient` cannot be the zero address.\n * - `sender` must have a balance of at least `amount`.\n * - the caller must have allowance for ``sender``'s tokens of at least\n * `amount`.\n */\n function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, \"ERC20: transfer amount exceeds allowance\"));\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, \"ERC20: decreased allowance below zero\"));\n return true;\n }\n\n /**\n * @dev Moves tokens `amount` from `sender` to `recipient`.\n *\n * This is internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `sender` cannot be the zero address.\n * - `recipient` cannot be the zero address.\n * - `sender` must have a balance of at least `amount`.\n */\n function _transfer(address sender, address recipient, uint256 amount) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(sender, recipient, amount);\n\n _balances[sender] = _balances[sender].sub(amount, \"ERC20: transfer amount exceeds balance\");\n _balances[recipient] = _balances[recipient].add(amount);\n emit Transfer(sender, recipient, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply = _totalSupply.add(amount);\n _balances[account] = _balances[account].add(amount);\n emit Transfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n _balances[account] = _balances[account].sub(amount, \"ERC20: burn amount exceeds balance\");\n _totalSupply = _totalSupply.sub(amount);\n emit Transfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(address owner, address spender, uint256 amount) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Sets {decimals} to a value other than the default one of 18.\n *\n * WARNING: This function should only be called from the constructor. Most\n * applications that interact with token contracts will not expect\n * {decimals} to ever change, and may work incorrectly if it does.\n */\n function _setupDecimals(uint8 decimals_) internal virtual {\n _decimals = decimals_;\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be to transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }\n}\n" + }, + "contracts/GraphTokenMock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\n\n/**\n * @title Graph Token Mock\n */\ncontract GraphTokenMock is Ownable, ERC20 {\n /**\n * @dev Contract Constructor.\n * @param _initialSupply Initial supply\n */\n constructor(uint256 _initialSupply, address _mintTo) ERC20(\"Graph Token Mock\", \"GRT-Mock\") {\n // Deploy to mint address\n _mint(_mintTo, _initialSupply);\n }\n}\n" + }, + "contracts/MinimalProxyFactory.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\nimport \"@openzeppelin/contracts/utils/Create2.sol\";\n\n// Adapted from https://github.com/OpenZeppelin/openzeppelin-sdk/blob/v2.5.0/packages/lib/contracts/upgradeability/ProxyFactory.sol\n// Based on https://eips.ethereum.org/EIPS/eip-1167\ncontract MinimalProxyFactory is Ownable {\n // -- Events --\n\n event ProxyCreated(address indexed proxy);\n\n /**\n * @notice Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation\n * @param _salt Bytes32 salt to use for CREATE2\n * @param _implementation Address of the proxy target implementation\n * @return Address of the counterfactual MinimalProxy\n */\n function getDeploymentAddress(bytes32 _salt, address _implementation) external view returns (address) {\n return Create2.computeAddress(_salt, keccak256(_getContractCreationCode(_implementation)), address(this));\n }\n\n /**\n * @notice Deploys a MinimalProxy with CREATE2\n * @param _salt Bytes32 salt to use for CREATE2\n * @param _implementation Address of the proxy target implementation\n * @param _data Bytes with the initializer call\n * @return Address of the deployed MinimalProxy\n */\n function _deployProxy2(\n bytes32 _salt,\n address _implementation,\n bytes memory _data\n ) internal returns (address) {\n address proxyAddress = Create2.deploy(0, _salt, _getContractCreationCode(_implementation));\n\n emit ProxyCreated(proxyAddress);\n\n // Call function with data\n if (_data.length > 0) {\n Address.functionCall(proxyAddress, _data);\n }\n\n return proxyAddress;\n }\n\n /**\n * @notice Gets the MinimalProxy bytecode\n * @param _implementation Address of the proxy target implementation\n * @return MinimalProxy bytecode\n */\n function _getContractCreationCode(address _implementation) internal pure returns (bytes memory) {\n bytes10 creation = 0x3d602d80600a3d3981f3;\n bytes10 prefix = 0x363d3d373d3d3d363d73;\n bytes20 targetBytes = bytes20(_implementation);\n bytes15 suffix = 0x5af43d82803e903d91602b57fd5bf3;\n return abi.encodePacked(creation, prefix, targetBytes, suffix);\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Create2.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/**\n * @dev Helper to make usage of the `CREATE2` EVM opcode easier and safer.\n * `CREATE2` can be used to compute in advance the address where a smart\n * contract will be deployed, which allows for interesting new mechanisms known\n * as 'counterfactual interactions'.\n *\n * See the https://eips.ethereum.org/EIPS/eip-1014#motivation[EIP] for more\n * information.\n */\nlibrary Create2 {\n /**\n * @dev Deploys a contract using `CREATE2`. The address where the contract\n * will be deployed can be known in advance via {computeAddress}.\n *\n * The bytecode for a contract can be obtained from Solidity with\n * `type(contractName).creationCode`.\n *\n * Requirements:\n *\n * - `bytecode` must not be empty.\n * - `salt` must have not been used for `bytecode` already.\n * - the factory must have a balance of at least `amount`.\n * - if `amount` is non-zero, `bytecode` must have a `payable` constructor.\n */\n function deploy(uint256 amount, bytes32 salt, bytes memory bytecode) internal returns (address) {\n address addr;\n require(address(this).balance >= amount, \"Create2: insufficient balance\");\n require(bytecode.length != 0, \"Create2: bytecode length is zero\");\n // solhint-disable-next-line no-inline-assembly\n assembly {\n addr := create2(amount, add(bytecode, 0x20), mload(bytecode), salt)\n }\n require(addr != address(0), \"Create2: Failed on deploy\");\n return addr;\n }\n\n /**\n * @dev Returns the address where a contract will be stored if deployed via {deploy}. Any change in the\n * `bytecodeHash` or `salt` will result in a new destination address.\n */\n function computeAddress(bytes32 salt, bytes32 bytecodeHash) internal view returns (address) {\n return computeAddress(salt, bytecodeHash, address(this));\n }\n\n /**\n * @dev Returns the address where a contract will be stored if deployed via {deploy} from a contract located at\n * `deployer`. If `deployer` is this contract's address, returns the same value as {computeAddress}.\n */\n function computeAddress(bytes32 salt, bytes32 bytecodeHash, address deployer) internal pure returns (address) {\n bytes32 _data = keccak256(\n abi.encodePacked(bytes1(0xff), deployer, salt, bytecodeHash)\n );\n return address(uint160(uint256(_data)));\n }\n}\n" + }, + "contracts/GraphTokenLockManager.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\";\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"@openzeppelin/contracts/utils/EnumerableSet.sol\";\n\nimport \"./MinimalProxyFactory.sol\";\nimport \"./IGraphTokenLockManager.sol\";\n\n/**\n * @title GraphTokenLockManager\n * @notice This contract manages a list of authorized function calls and targets that can be called\n * by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts.\n *\n * This contract receives funds to make the process of creating TokenLockWallet contracts\n * easier by distributing them the initial tokens to be managed.\n *\n * The owner can setup a list of token destinations that will be used by TokenLock contracts to\n * approve the pulling of funds, this way in can be guaranteed that only protocol contracts\n * will manipulate users funds.\n */\ncontract GraphTokenLockManager is MinimalProxyFactory, IGraphTokenLockManager {\n using SafeERC20 for IERC20;\n using EnumerableSet for EnumerableSet.AddressSet;\n\n // -- State --\n\n mapping(bytes4 => address) public authFnCalls;\n EnumerableSet.AddressSet private _tokenDestinations;\n\n address public masterCopy;\n IERC20 private _token;\n\n // -- Events --\n\n event MasterCopyUpdated(address indexed masterCopy);\n event TokenLockCreated(\n address indexed contractAddress,\n bytes32 indexed initHash,\n address indexed beneficiary,\n address token,\n uint256 managedAmount,\n uint256 startTime,\n uint256 endTime,\n uint256 periods,\n uint256 releaseStartTime,\n uint256 vestingCliffTime,\n IGraphTokenLock.Revocability revocable\n );\n\n event TokensDeposited(address indexed sender, uint256 amount);\n event TokensWithdrawn(address indexed sender, uint256 amount);\n\n event FunctionCallAuth(address indexed caller, bytes4 indexed sigHash, address indexed target, string signature);\n event TokenDestinationAllowed(address indexed dst, bool allowed);\n\n /**\n * Constructor.\n * @param _graphToken Token to use for deposits and withdrawals\n * @param _masterCopy Address of the master copy to use to clone proxies\n */\n constructor(IERC20 _graphToken, address _masterCopy) {\n require(address(_graphToken) != address(0), \"Token cannot be zero\");\n _token = _graphToken;\n setMasterCopy(_masterCopy);\n }\n\n // -- Factory --\n\n /**\n * @notice Sets the masterCopy bytecode to use to create clones of TokenLock contracts\n * @param _masterCopy Address of contract bytecode to factory clone\n */\n function setMasterCopy(address _masterCopy) public override onlyOwner {\n require(_masterCopy != address(0), \"MasterCopy cannot be zero\");\n masterCopy = _masterCopy;\n emit MasterCopyUpdated(_masterCopy);\n }\n\n /**\n * @notice Creates and fund a new token lock wallet using a minimum proxy\n * @param _owner Address of the contract owner\n * @param _beneficiary Address of the beneficiary of locked tokens\n * @param _managedAmount Amount of tokens to be managed by the lock contract\n * @param _startTime Start time of the release schedule\n * @param _endTime End time of the release schedule\n * @param _periods Number of periods between start time and end time\n * @param _releaseStartTime Override time for when the releases start\n * @param _revocable Whether the contract is revocable\n */\n function createTokenLockWallet(\n address _owner,\n address _beneficiary,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n IGraphTokenLock.Revocability _revocable\n ) external override onlyOwner {\n require(_token.balanceOf(address(this)) >= _managedAmount, \"Not enough tokens to create lock\");\n\n // Create contract using a minimal proxy and call initializer\n bytes memory initializer = abi.encodeWithSignature(\n \"initialize(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)\",\n address(this),\n _owner,\n _beneficiary,\n address(_token),\n _managedAmount,\n _startTime,\n _endTime,\n _periods,\n _releaseStartTime,\n _vestingCliffTime,\n _revocable\n );\n address contractAddress = _deployProxy2(keccak256(initializer), masterCopy, initializer);\n\n // Send managed amount to the created contract\n _token.safeTransfer(contractAddress, _managedAmount);\n\n emit TokenLockCreated(\n contractAddress,\n keccak256(initializer),\n _beneficiary,\n address(_token),\n _managedAmount,\n _startTime,\n _endTime,\n _periods,\n _releaseStartTime,\n _vestingCliffTime,\n _revocable\n );\n }\n\n // -- Funds Management --\n\n /**\n * @notice Gets the GRT token address\n * @return Token used for transfers and approvals\n */\n function token() external view override returns (IERC20) {\n return _token;\n }\n\n /**\n * @notice Deposits tokens into the contract\n * @dev Even if the ERC20 token can be transferred directly to the contract\n * this function provide a safe interface to do the transfer and avoid mistakes\n * @param _amount Amount to deposit\n */\n function deposit(uint256 _amount) external override {\n require(_amount > 0, \"Amount cannot be zero\");\n _token.safeTransferFrom(msg.sender, address(this), _amount);\n emit TokensDeposited(msg.sender, _amount);\n }\n\n /**\n * @notice Withdraws tokens from the contract\n * @dev Escape hatch in case of mistakes or to recover remaining funds\n * @param _amount Amount of tokens to withdraw\n */\n function withdraw(uint256 _amount) external override onlyOwner {\n require(_amount > 0, \"Amount cannot be zero\");\n _token.safeTransfer(msg.sender, _amount);\n emit TokensWithdrawn(msg.sender, _amount);\n }\n\n // -- Token Destinations --\n\n /**\n * @notice Adds an address that can be allowed by a token lock to pull funds\n * @param _dst Destination address\n */\n function addTokenDestination(address _dst) external override onlyOwner {\n require(_dst != address(0), \"Destination cannot be zero\");\n require(_tokenDestinations.add(_dst), \"Destination already added\");\n emit TokenDestinationAllowed(_dst, true);\n }\n\n /**\n * @notice Removes an address that can be allowed by a token lock to pull funds\n * @param _dst Destination address\n */\n function removeTokenDestination(address _dst) external override onlyOwner {\n require(_tokenDestinations.remove(_dst), \"Destination already removed\");\n emit TokenDestinationAllowed(_dst, false);\n }\n\n /**\n * @notice Returns True if the address is authorized to be a destination of tokens\n * @param _dst Destination address\n * @return True if authorized\n */\n function isTokenDestination(address _dst) external view override returns (bool) {\n return _tokenDestinations.contains(_dst);\n }\n\n /**\n * @notice Returns an array of authorized destination addresses\n * @return Array of addresses authorized to pull funds from a token lock\n */\n function getTokenDestinations() external view override returns (address[] memory) {\n address[] memory dstList = new address[](_tokenDestinations.length());\n for (uint256 i = 0; i < _tokenDestinations.length(); i++) {\n dstList[i] = _tokenDestinations.at(i);\n }\n return dstList;\n }\n\n // -- Function Call Authorization --\n\n /**\n * @notice Sets an authorized function call to target\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\n * @param _signature Function signature\n * @param _target Address of the destination contract to call\n */\n function setAuthFunctionCall(string calldata _signature, address _target) external override onlyOwner {\n _setAuthFunctionCall(_signature, _target);\n }\n\n /**\n * @notice Unsets an authorized function call to target\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\n * @param _signature Function signature\n */\n function unsetAuthFunctionCall(string calldata _signature) external override onlyOwner {\n bytes4 sigHash = _toFunctionSigHash(_signature);\n authFnCalls[sigHash] = address(0);\n\n emit FunctionCallAuth(msg.sender, sigHash, address(0), _signature);\n }\n\n /**\n * @notice Sets an authorized function call to target in bulk\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\n * @param _signatures Function signatures\n * @param _targets Address of the destination contract to call\n */\n function setAuthFunctionCallMany(string[] calldata _signatures, address[] calldata _targets)\n external\n override\n onlyOwner\n {\n require(_signatures.length == _targets.length, \"Array length mismatch\");\n\n for (uint256 i = 0; i < _signatures.length; i++) {\n _setAuthFunctionCall(_signatures[i], _targets[i]);\n }\n }\n\n /**\n * @notice Sets an authorized function call to target\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\n * @dev Function signatures of Graph Protocol contracts to be used are known ahead of time\n * @param _signature Function signature\n * @param _target Address of the destination contract to call\n */\n function _setAuthFunctionCall(string calldata _signature, address _target) internal {\n require(_target != address(this), \"Target must be other contract\");\n require(Address.isContract(_target), \"Target must be a contract\");\n\n bytes4 sigHash = _toFunctionSigHash(_signature);\n authFnCalls[sigHash] = _target;\n\n emit FunctionCallAuth(msg.sender, sigHash, _target, _signature);\n }\n\n /**\n * @notice Gets the target contract to call for a particular function signature\n * @param _sigHash Function signature hash\n * @return Address of the target contract where to send the call\n */\n function getAuthFunctionCallTarget(bytes4 _sigHash) public view override returns (address) {\n return authFnCalls[_sigHash];\n }\n\n /**\n * @notice Returns true if the function call is authorized\n * @param _sigHash Function signature hash\n * @return True if authorized\n */\n function isAuthFunctionCall(bytes4 _sigHash) external view override returns (bool) {\n return getAuthFunctionCallTarget(_sigHash) != address(0);\n }\n\n /**\n * @dev Converts a function signature string to 4-bytes hash\n * @param _signature Function signature string\n * @return Function signature hash\n */\n function _toFunctionSigHash(string calldata _signature) internal pure returns (bytes4) {\n return _convertToBytes4(abi.encodeWithSignature(_signature));\n }\n\n /**\n * @dev Converts function signature bytes to function signature hash (bytes4)\n * @param _signature Function signature\n * @return Function signature in bytes4\n */\n function _convertToBytes4(bytes memory _signature) internal pure returns (bytes4) {\n require(_signature.length == 4, \"Invalid method signature\");\n bytes4 sigHash;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n sigHash := mload(add(_signature, 32))\n }\n return sigHash;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/EnumerableSet.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/**\n * @dev Library for managing\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\n * types.\n *\n * Sets have the following properties:\n *\n * - Elements are added, removed, and checked for existence in constant time\n * (O(1)).\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\n *\n * ```\n * contract Example {\n * // Add the library methods\n * using EnumerableSet for EnumerableSet.AddressSet;\n *\n * // Declare a set state variable\n * EnumerableSet.AddressSet private mySet;\n * }\n * ```\n *\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\n * and `uint256` (`UintSet`) are supported.\n */\nlibrary EnumerableSet {\n // To implement this library for multiple types with as little code\n // repetition as possible, we write it in terms of a generic Set type with\n // bytes32 values.\n // The Set implementation uses private functions, and user-facing\n // implementations (such as AddressSet) are just wrappers around the\n // underlying Set.\n // This means that we can only create new EnumerableSets for types that fit\n // in bytes32.\n\n struct Set {\n // Storage of set values\n bytes32[] _values;\n\n // Position of the value in the `values` array, plus 1 because index 0\n // means a value is not in the set.\n mapping (bytes32 => uint256) _indexes;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function _add(Set storage set, bytes32 value) private returns (bool) {\n if (!_contains(set, value)) {\n set._values.push(value);\n // The value is stored at length-1, but we add 1 to all indexes\n // and use 0 as a sentinel value\n set._indexes[value] = set._values.length;\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function _remove(Set storage set, bytes32 value) private returns (bool) {\n // We read and store the value's index to prevent multiple reads from the same storage slot\n uint256 valueIndex = set._indexes[value];\n\n if (valueIndex != 0) { // Equivalent to contains(set, value)\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\n // the array, and then remove the last element (sometimes called as 'swap and pop').\n // This modifies the order of the array, as noted in {at}.\n\n uint256 toDeleteIndex = valueIndex - 1;\n uint256 lastIndex = set._values.length - 1;\n\n // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs\n // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.\n\n bytes32 lastvalue = set._values[lastIndex];\n\n // Move the last value to the index where the value to delete is\n set._values[toDeleteIndex] = lastvalue;\n // Update the index for the moved value\n set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based\n\n // Delete the slot where the moved value was stored\n set._values.pop();\n\n // Delete the index for the deleted slot\n delete set._indexes[value];\n\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\n return set._indexes[value] != 0;\n }\n\n /**\n * @dev Returns the number of values on the set. O(1).\n */\n function _length(Set storage set) private view returns (uint256) {\n return set._values.length;\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\n require(set._values.length > index, \"EnumerableSet: index out of bounds\");\n return set._values[index];\n }\n\n // Bytes32Set\n\n struct Bytes32Set {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _add(set._inner, value);\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _remove(set._inner, value);\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\n return _contains(set._inner, value);\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(Bytes32Set storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\n return _at(set._inner, index);\n }\n\n // AddressSet\n\n struct AddressSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(AddressSet storage set, address value) internal returns (bool) {\n return _add(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(AddressSet storage set, address value) internal returns (bool) {\n return _remove(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(AddressSet storage set, address value) internal view returns (bool) {\n return _contains(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(AddressSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\n return address(uint160(uint256(_at(set._inner, index))));\n }\n\n\n // UintSet\n\n struct UintSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(UintSet storage set, uint256 value) internal returns (bool) {\n return _add(set._inner, bytes32(value));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\n return _remove(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\n return _contains(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns the number of values on the set. O(1).\n */\n function length(UintSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\n return uint256(_at(set._inner, index));\n }\n}\n" + }, + "contracts/GraphTokenLockSimple.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport \"./GraphTokenLock.sol\";\n\n/**\n * @title GraphTokenLockSimple\n * @notice This contract is the concrete simple implementation built on top of the base\n * GraphTokenLock functionality for use when we only need the token lock schedule\n * features but no interaction with the network.\n *\n * This contract is designed to be deployed without the use of a TokenManager.\n */\ncontract GraphTokenLockSimple is GraphTokenLock {\n // Constructor\n constructor() {\n Ownable.initialize(msg.sender);\n }\n\n // Initializer\n function initialize(\n address _owner,\n address _beneficiary,\n address _token,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n Revocability _revocable\n ) external onlyOwner {\n _initialize(\n _owner,\n _beneficiary,\n _token,\n _managedAmount,\n _startTime,\n _endTime,\n _periods,\n _releaseStartTime,\n _vestingCliffTime,\n _revocable\n );\n }\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": false, + "runs": 200 + }, + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file diff --git a/packages/token-distribution/deployments/mainnet/solcInputs/a72ab6278ade6c5c10115f7be2c555c9.json b/packages/token-distribution/deployments/mainnet/solcInputs/a72ab6278ade6c5c10115f7be2c555c9.json new file mode 100644 index 000000000..ee7330e86 --- /dev/null +++ b/packages/token-distribution/deployments/mainnet/solcInputs/a72ab6278ade6c5c10115f7be2c555c9.json @@ -0,0 +1,98 @@ +{ + "language": "Solidity", + "sources": { + "contracts/GraphTokenDistributor.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\nimport \"@openzeppelin/contracts/math/SafeMath.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\";\n\n/**\n * @title GraphTokenDistributor\n * @dev Contract that allows distribution of tokens to multiple beneficiaries.\n * The contract accept deposits in the configured token by anyone.\n * The owner can setup the desired distribution by setting the amount of tokens\n * assigned to each beneficiary account.\n * Beneficiaries claim for their allocated tokens.\n * Only the owner can withdraw tokens from this contract without limitations.\n * For the distribution to work this contract must be unlocked by the owner.\n */\ncontract GraphTokenDistributor is Ownable {\n using SafeMath for uint256;\n using SafeERC20 for IERC20;\n\n // -- State --\n\n bool public locked;\n mapping(address => uint256) public beneficiaries;\n\n IERC20 public token;\n\n // -- Events --\n\n event BeneficiaryUpdated(address indexed beneficiary, uint256 amount);\n event TokensDeposited(address indexed sender, uint256 amount);\n event TokensWithdrawn(address indexed sender, uint256 amount);\n event TokensClaimed(address indexed beneficiary, address to, uint256 amount);\n event LockUpdated(bool locked);\n\n modifier whenNotLocked() {\n require(locked == false, \"Distributor: Claim is locked\");\n _;\n }\n\n /**\n * Constructor.\n * @param _token Token to use for deposits and withdrawals\n */\n constructor(IERC20 _token) {\n token = _token;\n locked = true;\n }\n\n /**\n * Deposit tokens into the contract.\n * Even if the ERC20 token can be transferred directly to the contract\n * this function provide a safe interface to do the transfer and avoid mistakes\n * @param _amount Amount to deposit\n */\n function deposit(uint256 _amount) external {\n token.safeTransferFrom(msg.sender, address(this), _amount);\n emit TokensDeposited(msg.sender, _amount);\n }\n\n // -- Admin functions --\n\n /**\n * Add token balance available for account.\n * @param _account Address to assign tokens to\n * @param _amount Amount of tokens to assign to beneficiary\n */\n function addBeneficiaryTokens(address _account, uint256 _amount) external onlyOwner {\n _setBeneficiaryTokens(_account, beneficiaries[_account].add(_amount));\n }\n\n /**\n * Add token balance available for multiple accounts.\n * @param _accounts Addresses to assign tokens to\n * @param _amounts Amounts of tokens to assign to beneficiary\n */\n function addBeneficiaryTokensMulti(address[] calldata _accounts, uint256[] calldata _amounts) external onlyOwner {\n require(_accounts.length == _amounts.length, \"Distributor: !length\");\n for (uint256 i = 0; i < _accounts.length; i++) {\n _setBeneficiaryTokens(_accounts[i], beneficiaries[_accounts[i]].add(_amounts[i]));\n }\n }\n\n /**\n * Remove token balance available for account.\n * @param _account Address to assign tokens to\n * @param _amount Amount of tokens to assign to beneficiary\n */\n function subBeneficiaryTokens(address _account, uint256 _amount) external onlyOwner {\n _setBeneficiaryTokens(_account, beneficiaries[_account].sub(_amount));\n }\n\n /**\n * Remove token balance available for multiple accounts.\n * @param _accounts Addresses to assign tokens to\n * @param _amounts Amounts of tokens to assign to beneficiary\n */\n function subBeneficiaryTokensMulti(address[] calldata _accounts, uint256[] calldata _amounts) external onlyOwner {\n require(_accounts.length == _amounts.length, \"Distributor: !length\");\n for (uint256 i = 0; i < _accounts.length; i++) {\n _setBeneficiaryTokens(_accounts[i], beneficiaries[_accounts[i]].sub(_amounts[i]));\n }\n }\n\n /**\n * Set amount of tokens available for beneficiary account.\n * @param _account Address to assign tokens to\n * @param _amount Amount of tokens to assign to beneficiary\n */\n function _setBeneficiaryTokens(address _account, uint256 _amount) private {\n require(_account != address(0), \"Distributor: !account\");\n\n beneficiaries[_account] = _amount;\n emit BeneficiaryUpdated(_account, _amount);\n }\n\n /**\n * Set locked withdrawals.\n * @param _locked True to lock withdrawals\n */\n function setLocked(bool _locked) external onlyOwner {\n locked = _locked;\n emit LockUpdated(_locked);\n }\n\n /**\n * Withdraw tokens from the contract. This function is included as\n * a escape hatch in case of mistakes or to recover remaining funds.\n * @param _amount Amount of tokens to withdraw\n */\n function withdraw(uint256 _amount) external onlyOwner {\n token.safeTransfer(msg.sender, _amount);\n emit TokensWithdrawn(msg.sender, _amount);\n }\n\n // -- Beneficiary functions --\n\n /**\n * Claim tokens and send to caller.\n */\n function claim() external whenNotLocked {\n claimTo(msg.sender);\n }\n\n /**\n * Claim tokens and send to address.\n * @param _to Address where to send tokens\n */\n function claimTo(address _to) public whenNotLocked {\n uint256 claimableTokens = beneficiaries[msg.sender];\n require(claimableTokens > 0, \"Distributor: Unavailable funds\");\n\n _setBeneficiaryTokens(msg.sender, 0);\n\n token.safeTransfer(_to, claimableTokens);\n emit TokensClaimed(msg.sender, _to, claimableTokens);\n }\n}\n" + }, + "@openzeppelin/contracts/access/Ownable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\nimport \"../GSN/Context.sol\";\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor () internal {\n address msgSender = _msgSender();\n _owner = msgSender;\n emit OwnershipTransferred(address(0), msgSender);\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(_owner == _msgSender(), \"Ownable: caller is not the owner\");\n _;\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n emit OwnershipTransferred(_owner, address(0));\n _owner = address(0);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n emit OwnershipTransferred(_owner, newOwner);\n _owner = newOwner;\n }\n}\n" + }, + "@openzeppelin/contracts/math/SafeMath.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/**\n * @dev Wrappers over Solidity's arithmetic operations with added overflow\n * checks.\n *\n * Arithmetic operations in Solidity wrap on overflow. This can easily result\n * in bugs, because programmers usually assume that an overflow raises an\n * error, which is the standard behavior in high level programming languages.\n * `SafeMath` restores this intuition by reverting the transaction when an\n * operation overflows.\n *\n * Using this library instead of the unchecked operations eliminates an entire\n * class of bugs, so it's recommended to use it always.\n */\nlibrary SafeMath {\n /**\n * @dev Returns the addition of two unsigned integers, reverting on\n * overflow.\n *\n * Counterpart to Solidity's `+` operator.\n *\n * Requirements:\n *\n * - Addition cannot overflow.\n */\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\n uint256 c = a + b;\n require(c >= a, \"SafeMath: addition overflow\");\n\n return c;\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, reverting on\n * overflow (when the result is negative).\n *\n * Counterpart to Solidity's `-` operator.\n *\n * Requirements:\n *\n * - Subtraction cannot overflow.\n */\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n return sub(a, b, \"SafeMath: subtraction overflow\");\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\n * overflow (when the result is negative).\n *\n * Counterpart to Solidity's `-` operator.\n *\n * Requirements:\n *\n * - Subtraction cannot overflow.\n */\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b <= a, errorMessage);\n uint256 c = a - b;\n\n return c;\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, reverting on\n * overflow.\n *\n * Counterpart to Solidity's `*` operator.\n *\n * Requirements:\n *\n * - Multiplication cannot overflow.\n */\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\n // benefit is lost if 'b' is also tested.\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\n if (a == 0) {\n return 0;\n }\n\n uint256 c = a * b;\n require(c / a == b, \"SafeMath: multiplication overflow\");\n\n return c;\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers. Reverts on\n * division by zero. The result is rounded towards zero.\n *\n * Counterpart to Solidity's `/` operator. Note: this function uses a\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\n * uses an invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\n return div(a, b, \"SafeMath: division by zero\");\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers. Reverts with custom message on\n * division by zero. The result is rounded towards zero.\n *\n * Counterpart to Solidity's `/` operator. Note: this function uses a\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\n * uses an invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b > 0, errorMessage);\n uint256 c = a / b;\n // assert(a == b * c + a % b); // There is no case in which this doesn't hold\n\n return c;\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * Reverts when dividing by zero.\n *\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\n * opcode (which leaves remaining gas untouched) while Solidity uses an\n * invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\n return mod(a, b, \"SafeMath: modulo by zero\");\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * Reverts with custom message when dividing by zero.\n *\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\n * opcode (which leaves remaining gas untouched) while Solidity uses an\n * invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b != 0, errorMessage);\n return a % b;\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `recipient`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address recipient, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `sender` to `recipient` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);\n\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/SafeERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"../../math/SafeMath.sol\";\nimport \"../../utils/Address.sol\";\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n using SafeMath for uint256;\n using Address for address;\n\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\n }\n\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\n }\n\n /**\n * @dev Deprecated. This function has issues similar to the ones found in\n * {IERC20-approve}, and its usage is discouraged.\n *\n * Whenever possible, use {safeIncreaseAllowance} and\n * {safeDecreaseAllowance} instead.\n */\n function safeApprove(IERC20 token, address spender, uint256 value) internal {\n // safeApprove should only be called when setting an initial allowance,\n // or when resetting it to zero. To increase and decrease it, use\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\n // solhint-disable-next-line max-line-length\n require((value == 0) || (token.allowance(address(this), spender) == 0),\n \"SafeERC20: approve from non-zero to non-zero allowance\"\n );\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\n }\n\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n uint256 newAllowance = token.allowance(address(this), spender).add(value);\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\n\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n uint256 newAllowance = token.allowance(address(this), spender).sub(value, \"SafeERC20: decreased allowance below zero\");\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n */\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that\n // the target address contains contract code and also asserts for success in the low-level call.\n\n bytes memory returndata = address(token).functionCall(data, \"SafeERC20: low-level call failed\");\n if (returndata.length > 0) { // Return data is optional\n // solhint-disable-next-line max-line-length\n require(abi.decode(returndata, (bool)), \"SafeERC20: ERC20 operation did not succeed\");\n }\n }\n}\n" + }, + "@openzeppelin/contracts/GSN/Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/*\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with GSN meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address payable) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes memory) {\n this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\n return msg.data;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Address.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.2 <0.8.0;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize, which returns 0 for contracts in\n // construction, since the code is only stored at the end of the\n // constructor execution.\n\n uint256 size;\n // solhint-disable-next-line no-inline-assembly\n assembly { size := extcodesize(account) }\n return size > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n // solhint-disable-next-line avoid-low-level-calls, avoid-call-value\n (bool success, ) = recipient.call{ value: amount }(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain`call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCall(target, data, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n require(isContract(target), \"Address: call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.call{ value: value }(data);\n return _verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {\n require(isContract(target), \"Address: static call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.staticcall(data);\n return _verifyCallResult(success, returndata, errorMessage);\n }\n\n function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {\n if (success) {\n return returndata;\n } else {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n }\n}\n" + }, + "contracts/GraphTokenLockWallet.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"@openzeppelin/contracts/math/SafeMath.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\";\n\nimport \"./GraphTokenLock.sol\";\nimport \"./IGraphTokenLockManager.sol\";\n\n/**\n * @title GraphTokenLockWallet\n * @notice This contract is built on top of the base GraphTokenLock functionality.\n * It allows wallet beneficiaries to use the deposited funds to perform specific function calls\n * on specific contracts.\n *\n * The idea is that supporters with locked tokens can participate in the protocol\n * but disallow any release before the vesting/lock schedule.\n * The beneficiary can issue authorized function calls to this contract that will\n * get forwarded to a target contract. A target contract is any of our protocol contracts.\n * The function calls allowed are queried to the GraphTokenLockManager, this way\n * the same configuration can be shared for all the created lock wallet contracts.\n *\n * NOTE: Contracts used as target must have its function signatures checked to avoid collisions\n * with any of this contract functions.\n * Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience\n * the maximum amount of tokens is authorized.\n */\ncontract GraphTokenLockWallet is GraphTokenLock {\n using SafeMath for uint256;\n using SafeERC20 for IERC20;\n\n // -- State --\n\n IGraphTokenLockManager public manager;\n uint256 public usedAmount;\n\n uint256 private constant MAX_UINT256 = 2**256 - 1;\n\n // -- Events --\n\n event ManagerUpdated(address indexed _oldManager, address indexed _newManager);\n event TokenDestinationsApproved();\n event TokenDestinationsRevoked();\n\n // Initializer\n function initialize(\n address _manager,\n address _owner,\n address _beneficiary,\n address _token,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n Revocability _revocable\n ) external {\n _initialize(\n _owner,\n _beneficiary,\n _token,\n _managedAmount,\n _startTime,\n _endTime,\n _periods,\n _releaseStartTime,\n _vestingCliffTime,\n _revocable\n );\n _setManager(_manager);\n }\n\n // -- Admin --\n\n /**\n * @notice Sets a new manager for this contract\n * @param _newManager Address of the new manager\n */\n function setManager(address _newManager) external onlyOwner {\n _setManager(_newManager);\n }\n\n /**\n * @dev Sets a new manager for this contract\n * @param _newManager Address of the new manager\n */\n function _setManager(address _newManager) private {\n require(_newManager != address(0), \"Manager cannot be empty\");\n require(Address.isContract(_newManager), \"Manager must be a contract\");\n\n address oldManager = address(manager);\n manager = IGraphTokenLockManager(_newManager);\n\n emit ManagerUpdated(oldManager, _newManager);\n }\n\n // -- Beneficiary --\n\n /**\n * @notice Approves protocol access of the tokens managed by this contract\n * @dev Approves all token destinations registered in the manager to pull tokens\n */\n function approveProtocol() external onlyBeneficiary {\n address[] memory dstList = manager.getTokenDestinations();\n for (uint256 i = 0; i < dstList.length; i++) {\n token.safeApprove(dstList[i], MAX_UINT256);\n }\n emit TokenDestinationsApproved();\n }\n\n /**\n * @notice Revokes protocol access of the tokens managed by this contract\n * @dev Revokes approval to all token destinations in the manager to pull tokens\n */\n function revokeProtocol() external onlyBeneficiary {\n address[] memory dstList = manager.getTokenDestinations();\n for (uint256 i = 0; i < dstList.length; i++) {\n token.safeApprove(dstList[i], 0);\n }\n emit TokenDestinationsRevoked();\n }\n\n /**\n * @notice Forward authorized contract calls to protocol contracts\n * @dev Fallback function can be called by the beneficiary only if function call is allowed\n */\n fallback() external payable {\n // Only beneficiary can forward calls\n require(msg.sender == beneficiary, \"Unauthorized caller\");\n\n // Function call validation\n address _target = manager.getAuthFunctionCallTarget(msg.sig);\n require(_target != address(0), \"Unauthorized function\");\n\n uint256 oldBalance = currentBalance();\n\n // Call function with data\n Address.functionCall(_target, msg.data);\n\n // Tracked used tokens in the protocol\n // We do this check after balances were updated by the forwarded call\n // Check is only enforced for revocable contracts to save some gas\n if (revocable == Revocability.Enabled) {\n // Track contract balance change\n uint256 newBalance = currentBalance();\n if (newBalance < oldBalance) {\n // Outflow\n uint256 diff = oldBalance.sub(newBalance);\n usedAmount = usedAmount.add(diff);\n } else {\n // Inflow: We can receive profits from the protocol, that could make usedAmount to\n // underflow. We set it to zero in that case.\n uint256 diff = newBalance.sub(oldBalance);\n usedAmount = (diff >= usedAmount) ? 0 : usedAmount.sub(diff);\n }\n require(usedAmount <= vestedAmount(), \"Cannot use more tokens than vested amount\");\n }\n }\n}\n" + }, + "contracts/GraphTokenLock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport \"@openzeppelin/contracts/math/SafeMath.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\";\n\nimport \"./Ownable.sol\";\nimport \"./MathUtils.sol\";\nimport \"./IGraphTokenLock.sol\";\n\n/**\n * @title GraphTokenLock\n * @notice Contract that manages an unlocking schedule of tokens.\n * @dev The contract lock manage a number of tokens deposited into the contract to ensure that\n * they can only be released under certain time conditions.\n *\n * This contract implements a release scheduled based on periods and tokens are released in steps\n * after each period ends. It can be configured with one period in which case it is like a plain TimeLock.\n * It also supports revocation to be used for vesting schedules.\n *\n * The contract supports receiving extra funds than the managed tokens ones that can be\n * withdrawn by the beneficiary at any time.\n *\n * A releaseStartTime parameter is included to override the default release schedule and\n * perform the first release on the configured time. After that it will continue with the\n * default schedule.\n */\nabstract contract GraphTokenLock is Ownable, IGraphTokenLock {\n using SafeMath for uint256;\n using SafeERC20 for IERC20;\n\n uint256 private constant MIN_PERIOD = 1;\n\n // -- State --\n\n IERC20 public token;\n address public beneficiary;\n\n // Configuration\n\n // Amount of tokens managed by the contract schedule\n uint256 public managedAmount;\n\n uint256 public startTime; // Start datetime (in unixtimestamp)\n uint256 public endTime; // Datetime after all funds are fully vested/unlocked (in unixtimestamp)\n uint256 public periods; // Number of vesting/release periods\n\n // First release date for tokens (in unixtimestamp)\n // If set, no tokens will be released before releaseStartTime ignoring\n // the amount to release each period\n uint256 public releaseStartTime;\n // A cliff set a date to which a beneficiary needs to get to vest\n // all preceding periods\n uint256 public vestingCliffTime;\n Revocability public revocable; // Whether to use vesting for locked funds\n\n // State\n\n bool public isRevoked;\n bool public isInitialized;\n uint256 public releasedAmount;\n\n // -- Events --\n\n event TokensReleased(address indexed beneficiary, uint256 amount);\n event TokensWithdrawn(address indexed beneficiary, uint256 amount);\n event TokensRevoked(address indexed beneficiary, uint256 amount);\n\n /**\n * @dev Only allow calls from the beneficiary of the contract\n */\n modifier onlyBeneficiary() {\n require(msg.sender == beneficiary, \"!auth\");\n _;\n }\n\n /**\n * @notice Initializes the contract\n * @param _owner Address of the contract owner\n * @param _beneficiary Address of the beneficiary of locked tokens\n * @param _managedAmount Amount of tokens to be managed by the lock contract\n * @param _startTime Start time of the release schedule\n * @param _endTime End time of the release schedule\n * @param _periods Number of periods between start time and end time\n * @param _releaseStartTime Override time for when the releases start\n * @param _vestingCliffTime Override time for when the vesting start\n * @param _revocable Whether the contract is revocable\n */\n function _initialize(\n address _owner,\n address _beneficiary,\n address _token,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n Revocability _revocable\n ) internal {\n require(!isInitialized, \"Already initialized\");\n require(_owner != address(0), \"Owner cannot be zero\");\n require(_beneficiary != address(0), \"Beneficiary cannot be zero\");\n require(_token != address(0), \"Token cannot be zero\");\n require(_managedAmount > 0, \"Managed tokens cannot be zero\");\n require(_startTime != 0, \"Start time must be set\");\n require(_startTime < _endTime, \"Start time > end time\");\n require(_periods >= MIN_PERIOD, \"Periods cannot be below minimum\");\n require(_revocable != Revocability.NotSet, \"Must set a revocability option\");\n require(_releaseStartTime < _endTime, \"Release start time must be before end time\");\n require(_vestingCliffTime < _endTime, \"Cliff time must be before end time\");\n\n isInitialized = true;\n\n Ownable.initialize(_owner);\n beneficiary = _beneficiary;\n token = IERC20(_token);\n\n managedAmount = _managedAmount;\n\n startTime = _startTime;\n endTime = _endTime;\n periods = _periods;\n\n // Optionals\n releaseStartTime = _releaseStartTime;\n vestingCliffTime = _vestingCliffTime;\n revocable = _revocable;\n }\n\n // -- Balances --\n\n /**\n * @notice Returns the amount of tokens currently held by the contract\n * @return Tokens held in the contract\n */\n function currentBalance() public override view returns (uint256) {\n return token.balanceOf(address(this));\n }\n\n // -- Time & Periods --\n\n /**\n * @notice Returns the current block timestamp\n * @return Current block timestamp\n */\n function currentTime() public override view returns (uint256) {\n return block.timestamp;\n }\n\n /**\n * @notice Gets duration of contract from start to end in seconds\n * @return Amount of seconds from contract startTime to endTime\n */\n function duration() public override view returns (uint256) {\n return endTime.sub(startTime);\n }\n\n /**\n * @notice Gets time elapsed since the start of the contract\n * @dev Returns zero if called before conctract starTime\n * @return Seconds elapsed from contract startTime\n */\n function sinceStartTime() public override view returns (uint256) {\n uint256 current = currentTime();\n if (current <= startTime) {\n return 0;\n }\n return current.sub(startTime);\n }\n\n /**\n * @notice Returns amount available to be released after each period according to schedule\n * @return Amount of tokens available after each period\n */\n function amountPerPeriod() public override view returns (uint256) {\n return managedAmount.div(periods);\n }\n\n /**\n * @notice Returns the duration of each period in seconds\n * @return Duration of each period in seconds\n */\n function periodDuration() public override view returns (uint256) {\n return duration().div(periods);\n }\n\n /**\n * @notice Gets the current period based on the schedule\n * @return A number that represents the current period\n */\n function currentPeriod() public override view returns (uint256) {\n return sinceStartTime().div(periodDuration()).add(MIN_PERIOD);\n }\n\n /**\n * @notice Gets the number of periods that passed since the first period\n * @return A number of periods that passed since the schedule started\n */\n function passedPeriods() public override view returns (uint256) {\n return currentPeriod().sub(MIN_PERIOD);\n }\n\n // -- Locking & Release Schedule --\n\n /**\n * @notice Gets the currently available token according to the schedule\n * @dev Implements the step-by-step schedule based on periods for available tokens\n * @return Amount of tokens available according to the schedule\n */\n function availableAmount() public override view returns (uint256) {\n uint256 current = currentTime();\n\n // Before contract start no funds are available\n if (current < startTime) {\n return 0;\n }\n\n // After contract ended all funds are available\n if (current > endTime) {\n return managedAmount;\n }\n\n // Get available amount based on period\n return passedPeriods().mul(amountPerPeriod());\n }\n\n /**\n * @notice Gets the amount of currently vested tokens\n * @dev Similar to available amount, but is fully vested when contract is non-revocable\n * @return Amount of tokens already vested\n */\n function vestedAmount() public override view returns (uint256) {\n // If non-revocable it is fully vested\n if (revocable == Revocability.Disabled) {\n return managedAmount;\n }\n\n // Vesting cliff is activated and it has not passed means nothing is vested yet\n if (vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\n return 0;\n }\n\n return availableAmount();\n }\n\n /**\n * @notice Gets tokens currently available for release\n * @dev Considers the schedule and takes into account already released tokens\n * @return Amount of tokens ready to be released\n */\n function releasableAmount() public override view returns (uint256) {\n // If a release start time is set no tokens are available for release before this date\n // If not set it follows the default schedule and tokens are available on\n // the first period passed\n if (releaseStartTime > 0 && currentTime() < releaseStartTime) {\n return 0;\n }\n\n // Vesting cliff is activated and it has not passed means nothing is vested yet\n // so funds cannot be released\n if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\n return 0;\n }\n\n // A beneficiary can never have more releasable tokens than the contract balance\n uint256 releasable = availableAmount().sub(releasedAmount);\n return MathUtils.min(currentBalance(), releasable);\n }\n\n /**\n * @notice Gets the outstanding amount yet to be released based on the whole contract lifetime\n * @dev Does not consider schedule but just global amounts tracked\n * @return Amount of outstanding tokens for the lifetime of the contract\n */\n function totalOutstandingAmount() public override view returns (uint256) {\n return managedAmount.sub(releasedAmount);\n }\n\n /**\n * @notice Gets surplus amount in the contract based on outstanding amount to release\n * @dev All funds over outstanding amount is considered surplus that can be withdrawn by beneficiary\n * @return Amount of tokens considered as surplus\n */\n function surplusAmount() public override view returns (uint256) {\n uint256 balance = currentBalance();\n uint256 outstandingAmount = totalOutstandingAmount();\n if (balance > outstandingAmount) {\n return balance.sub(outstandingAmount);\n }\n return 0;\n }\n\n // -- Value Transfer --\n\n /**\n * @notice Releases tokens based on the configured schedule\n * @dev All available releasable tokens are transferred to beneficiary\n */\n function release() external override onlyBeneficiary {\n uint256 amountToRelease = releasableAmount();\n require(amountToRelease > 0, \"No available releasable amount\");\n\n releasedAmount = releasedAmount.add(amountToRelease);\n\n token.safeTransfer(beneficiary, amountToRelease);\n\n emit TokensReleased(beneficiary, amountToRelease);\n }\n\n /**\n * @notice Withdraws surplus, unmanaged tokens from the contract\n * @dev Tokens in the contract over outstanding amount are considered as surplus\n * @param _amount Amount of tokens to withdraw\n */\n function withdrawSurplus(uint256 _amount) external override onlyBeneficiary {\n require(_amount > 0, \"Amount cannot be zero\");\n require(surplusAmount() >= _amount, \"Amount requested > surplus available\");\n\n token.safeTransfer(beneficiary, _amount);\n\n emit TokensWithdrawn(beneficiary, _amount);\n }\n\n /**\n * @notice Revokes a vesting schedule and return the unvested tokens to the owner\n * @dev Vesting schedule is always calculated based on managed tokens\n */\n function revoke() external override onlyOwner {\n require(revocable == Revocability.Enabled, \"Contract is non-revocable\");\n require(isRevoked == false, \"Already revoked\");\n\n uint256 unvestedAmount = managedAmount.sub(vestedAmount());\n require(unvestedAmount > 0, \"No available unvested amount\");\n\n isRevoked = true;\n\n token.safeTransfer(owner(), unvestedAmount);\n\n emit TokensRevoked(beneficiary, unvestedAmount);\n }\n}\n" + }, + "contracts/IGraphTokenLockManager.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\nimport \"./IGraphTokenLock.sol\";\n\ninterface IGraphTokenLockManager {\n // -- Factory --\n\n function setMasterCopy(address _masterCopy) external;\n\n function createTokenLockWallet(\n address _owner,\n address _beneficiary,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n IGraphTokenLock.Revocability _revocable\n ) external;\n\n // -- Funds Management --\n\n function token() external returns (IERC20);\n\n function deposit(uint256 _amount) external;\n\n function withdraw(uint256 _amount) external;\n\n // -- Allowed Funds Destinations --\n\n function addTokenDestination(address _dst) external;\n\n function removeTokenDestination(address _dst) external;\n\n function isTokenDestination(address _dst) external view returns (bool);\n\n function getTokenDestinations() external view returns (address[] memory);\n\n // -- Function Call Authorization --\n\n function setAuthFunctionCall(string calldata _signature, address _target) external;\n\n function unsetAuthFunctionCall(string calldata _signature) external;\n\n function setAuthFunctionCallMany(string[] calldata _signatures, address[] calldata _targets) external;\n\n function getAuthFunctionCallTarget(bytes4 _sigHash) external view returns (address);\n\n function isAuthFunctionCall(bytes4 _sigHash) external view returns (bool);\n}\n" + }, + "contracts/Ownable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * The owner account will be passed on initialization of the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\ncontract Ownable {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n function initialize(address owner) internal {\n _owner = owner;\n emit OwnershipTransferred(address(0), owner);\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(_owner == msg.sender, \"Ownable: caller is not the owner\");\n _;\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() external virtual onlyOwner {\n emit OwnershipTransferred(_owner, address(0));\n _owner = address(0);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) external virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n emit OwnershipTransferred(_owner, newOwner);\n _owner = newOwner;\n }\n}\n" + }, + "contracts/MathUtils.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nlibrary MathUtils {\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n}\n" + }, + "contracts/IGraphTokenLock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\ninterface IGraphTokenLock {\n enum Revocability { NotSet, Enabled, Disabled }\n\n // -- Balances --\n\n function currentBalance() external view returns (uint256);\n\n // -- Time & Periods --\n\n function currentTime() external view returns (uint256);\n\n function duration() external view returns (uint256);\n\n function sinceStartTime() external view returns (uint256);\n\n function amountPerPeriod() external view returns (uint256);\n\n function periodDuration() external view returns (uint256);\n\n function currentPeriod() external view returns (uint256);\n\n function passedPeriods() external view returns (uint256);\n\n // -- Locking & Release Schedule --\n\n function availableAmount() external view returns (uint256);\n\n function vestedAmount() external view returns (uint256);\n\n function releasableAmount() external view returns (uint256);\n\n function totalOutstandingAmount() external view returns (uint256);\n\n function surplusAmount() external view returns (uint256);\n\n // -- Value Transfer --\n\n function release() external;\n\n function withdrawSurplus(uint256 _amount) external;\n\n function revoke() external;\n}\n" + }, + "contracts/StakingMock.sol": { + "content": "pragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\nimport \"./Stakes.sol\";\n\ncontract StakingMock {\n using SafeMath for uint256;\n using Stakes for Stakes.Indexer;\n\n // -- State --\n\n uint256 public minimumIndexerStake = 100e18;\n uint256 public thawingPeriod = 10; // 10 blocks\n IERC20 public token;\n\n // Indexer stakes : indexer => Stake\n mapping(address => Stakes.Indexer) public stakes;\n\n /**\n * @dev Emitted when `indexer` stake `tokens` amount.\n */\n event StakeDeposited(address indexed indexer, uint256 tokens);\n\n /**\n * @dev Emitted when `indexer` unstaked and locked `tokens` amount `until` block.\n */\n event StakeLocked(address indexed indexer, uint256 tokens, uint256 until);\n\n /**\n * @dev Emitted when `indexer` withdrew `tokens` staked.\n */\n event StakeWithdrawn(address indexed indexer, uint256 tokens);\n\n // Contract constructor.\n constructor(IERC20 _token) {\n require(address(_token) != address(0), \"!token\");\n token = _token;\n }\n\n /**\n * @dev Deposit tokens on the indexer stake.\n * @param _tokens Amount of tokens to stake\n */\n function stake(uint256 _tokens) external {\n stakeTo(msg.sender, _tokens);\n }\n\n /**\n * @dev Deposit tokens on the indexer stake.\n * @param _indexer Address of the indexer\n * @param _tokens Amount of tokens to stake\n */\n function stakeTo(address _indexer, uint256 _tokens) public {\n require(_tokens > 0, \"!tokens\");\n\n // Ensure minimum stake\n require(stakes[_indexer].tokensSecureStake().add(_tokens) >= minimumIndexerStake, \"!minimumIndexerStake\");\n\n // Transfer tokens to stake from caller to this contract\n require(token.transferFrom(msg.sender, address(this), _tokens), \"!transfer\");\n\n // Stake the transferred tokens\n _stake(_indexer, _tokens);\n }\n\n /**\n * @dev Unstake tokens from the indexer stake, lock them until thawing period expires.\n * @param _tokens Amount of tokens to unstake\n */\n function unstake(uint256 _tokens) external {\n address indexer = msg.sender;\n Stakes.Indexer storage indexerStake = stakes[indexer];\n\n require(_tokens > 0, \"!tokens\");\n require(indexerStake.hasTokens(), \"!stake\");\n require(indexerStake.tokensAvailable() >= _tokens, \"!stake-avail\");\n\n // Ensure minimum stake\n uint256 newStake = indexerStake.tokensSecureStake().sub(_tokens);\n require(newStake == 0 || newStake >= minimumIndexerStake, \"!minimumIndexerStake\");\n\n // Before locking more tokens, withdraw any unlocked ones\n uint256 tokensToWithdraw = indexerStake.tokensWithdrawable();\n if (tokensToWithdraw > 0) {\n _withdraw(indexer);\n }\n\n indexerStake.lockTokens(_tokens, thawingPeriod);\n\n emit StakeLocked(indexer, indexerStake.tokensLocked, indexerStake.tokensLockedUntil);\n }\n\n /**\n * @dev Withdraw indexer tokens once the thawing period has passed.\n */\n function withdraw() external {\n _withdraw(msg.sender);\n }\n\n function _stake(address _indexer, uint256 _tokens) internal {\n // Deposit tokens into the indexer stake\n Stakes.Indexer storage indexerStake = stakes[_indexer];\n indexerStake.deposit(_tokens);\n\n emit StakeDeposited(_indexer, _tokens);\n }\n\n /**\n * @dev Withdraw indexer tokens once the thawing period has passed.\n * @param _indexer Address of indexer to withdraw funds from\n */\n function _withdraw(address _indexer) private {\n // Get tokens available for withdraw and update balance\n uint256 tokensToWithdraw = stakes[_indexer].withdrawTokens();\n require(tokensToWithdraw > 0, \"!tokens\");\n\n // Return tokens to the indexer\n require(token.transfer(_indexer, tokensToWithdraw), \"!transfer\");\n\n emit StakeWithdrawn(_indexer, tokensToWithdraw);\n }\n}\n" + }, + "contracts/Stakes.sol": { + "content": "pragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/math/SafeMath.sol\";\n\n/**\n * @title A collection of data structures and functions to manage the Indexer Stake state.\n * Used for low-level state changes, require() conditions should be evaluated\n * at the caller function scope.\n */\nlibrary Stakes {\n using SafeMath for uint256;\n using Stakes for Stakes.Indexer;\n\n struct Indexer {\n uint256 tokensStaked; // Tokens on the indexer stake (staked by the indexer)\n uint256 tokensAllocated; // Tokens used in allocations\n uint256 tokensLocked; // Tokens locked for withdrawal subject to thawing period\n uint256 tokensLockedUntil; // Block when locked tokens can be withdrawn\n }\n\n /**\n * @dev Deposit tokens to the indexer stake.\n * @param stake Stake data\n * @param _tokens Amount of tokens to deposit\n */\n function deposit(Stakes.Indexer storage stake, uint256 _tokens) internal {\n stake.tokensStaked = stake.tokensStaked.add(_tokens);\n }\n\n /**\n * @dev Release tokens from the indexer stake.\n * @param stake Stake data\n * @param _tokens Amount of tokens to release\n */\n function release(Stakes.Indexer storage stake, uint256 _tokens) internal {\n stake.tokensStaked = stake.tokensStaked.sub(_tokens);\n }\n\n /**\n * @dev Allocate tokens from the main stack to a SubgraphDeployment.\n * @param stake Stake data\n * @param _tokens Amount of tokens to allocate\n */\n function allocate(Stakes.Indexer storage stake, uint256 _tokens) internal {\n stake.tokensAllocated = stake.tokensAllocated.add(_tokens);\n }\n\n /**\n * @dev Unallocate tokens from a SubgraphDeployment back to the main stack.\n * @param stake Stake data\n * @param _tokens Amount of tokens to unallocate\n */\n function unallocate(Stakes.Indexer storage stake, uint256 _tokens) internal {\n stake.tokensAllocated = stake.tokensAllocated.sub(_tokens);\n }\n\n /**\n * @dev Lock tokens until a thawing period pass.\n * @param stake Stake data\n * @param _tokens Amount of tokens to unstake\n * @param _period Period in blocks that need to pass before withdrawal\n */\n function lockTokens(\n Stakes.Indexer storage stake,\n uint256 _tokens,\n uint256 _period\n ) internal {\n // Take into account period averaging for multiple unstake requests\n uint256 lockingPeriod = _period;\n if (stake.tokensLocked > 0) {\n lockingPeriod = stake.getLockingPeriod(_tokens, _period);\n }\n\n // Update balances\n stake.tokensLocked = stake.tokensLocked.add(_tokens);\n stake.tokensLockedUntil = block.number.add(lockingPeriod);\n }\n\n /**\n * @dev Unlock tokens.\n * @param stake Stake data\n * @param _tokens Amount of tokens to unkock\n */\n function unlockTokens(Stakes.Indexer storage stake, uint256 _tokens) internal {\n stake.tokensLocked = stake.tokensLocked.sub(_tokens);\n if (stake.tokensLocked == 0) {\n stake.tokensLockedUntil = 0;\n }\n }\n\n /**\n * @dev Take all tokens out from the locked stake for withdrawal.\n * @param stake Stake data\n * @return Amount of tokens being withdrawn\n */\n function withdrawTokens(Stakes.Indexer storage stake) internal returns (uint256) {\n // Calculate tokens that can be released\n uint256 tokensToWithdraw = stake.tokensWithdrawable();\n\n if (tokensToWithdraw > 0) {\n // Reset locked tokens\n stake.unlockTokens(tokensToWithdraw);\n\n // Decrease indexer stake\n stake.release(tokensToWithdraw);\n }\n\n return tokensToWithdraw;\n }\n\n /**\n * @dev Get the locking period of the tokens to unstake.\n * If already unstaked before calculate the weighted average.\n * @param stake Stake data\n * @param _tokens Amount of tokens to unstake\n * @param _thawingPeriod Period in blocks that need to pass before withdrawal\n * @return True if staked\n */\n function getLockingPeriod(\n Stakes.Indexer memory stake,\n uint256 _tokens,\n uint256 _thawingPeriod\n ) internal view returns (uint256) {\n uint256 blockNum = block.number;\n uint256 periodA = (stake.tokensLockedUntil > blockNum) ? stake.tokensLockedUntil.sub(blockNum) : 0;\n uint256 periodB = _thawingPeriod;\n uint256 stakeA = stake.tokensLocked;\n uint256 stakeB = _tokens;\n return periodA.mul(stakeA).add(periodB.mul(stakeB)).div(stakeA.add(stakeB));\n }\n\n /**\n * @dev Return true if there are tokens staked by the Indexer.\n * @param stake Stake data\n * @return True if staked\n */\n function hasTokens(Stakes.Indexer memory stake) internal pure returns (bool) {\n return stake.tokensStaked > 0;\n }\n\n /**\n * @dev Return the amount of tokens used in allocations and locked for withdrawal.\n * @param stake Stake data\n * @return Token amount\n */\n function tokensUsed(Stakes.Indexer memory stake) internal pure returns (uint256) {\n return stake.tokensAllocated.add(stake.tokensLocked);\n }\n\n /**\n * @dev Return the amount of tokens staked not considering the ones that are already going\n * through the thawing period or are ready for withdrawal. We call it secure stake because\n * it is not subject to change by a withdraw call from the indexer.\n * @param stake Stake data\n * @return Token amount\n */\n function tokensSecureStake(Stakes.Indexer memory stake) internal pure returns (uint256) {\n return stake.tokensStaked.sub(stake.tokensLocked);\n }\n\n /**\n * @dev Tokens free balance on the indexer stake that can be used for any purpose.\n * Any token that is allocated cannot be used as well as tokens that are going through the\n * thawing period or are withdrawable\n * Calc: tokensStaked - tokensAllocated - tokensLocked\n * @param stake Stake data\n * @return Token amount\n */\n function tokensAvailable(Stakes.Indexer memory stake) internal pure returns (uint256) {\n return stake.tokensAvailableWithDelegation(0);\n }\n\n /**\n * @dev Tokens free balance on the indexer stake that can be used for allocations.\n * This function accepts a parameter for extra delegated capacity that takes into\n * account delegated tokens\n * @param stake Stake data\n * @param _delegatedCapacity Amount of tokens used from delegators to calculate availability\n * @return Token amount\n */\n function tokensAvailableWithDelegation(Stakes.Indexer memory stake, uint256 _delegatedCapacity)\n internal\n pure\n returns (uint256)\n {\n uint256 tokensCapacity = stake.tokensStaked.add(_delegatedCapacity);\n uint256 _tokensUsed = stake.tokensUsed();\n // If more tokens are used than the current capacity, the indexer is overallocated.\n // This means the indexer doesn't have available capacity to create new allocations.\n // We can reach this state when the indexer has funds allocated and then any\n // of these conditions happen:\n // - The delegationCapacity ratio is reduced.\n // - The indexer stake is slashed.\n // - A delegator removes enough stake.\n if (_tokensUsed > tokensCapacity) {\n // Indexer stake is over allocated: return 0 to avoid stake to be used until\n // the overallocation is restored by staking more tokens, unallocating tokens\n // or using more delegated funds\n return 0;\n }\n return tokensCapacity.sub(_tokensUsed);\n }\n\n /**\n * @dev Tokens available for withdrawal after thawing period.\n * @param stake Stake data\n * @return Token amount\n */\n function tokensWithdrawable(Stakes.Indexer memory stake) internal view returns (uint256) {\n // No tokens to withdraw before locking period\n if (stake.tokensLockedUntil == 0 || block.number < stake.tokensLockedUntil) {\n return 0;\n }\n return stake.tokensLocked;\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/ERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\nimport \"../../GSN/Context.sol\";\nimport \"./IERC20.sol\";\nimport \"../../math/SafeMath.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin guidelines: functions revert instead\n * of returning `false` on failure. This behavior is nonetheless conventional\n * and does not conflict with the expectations of ERC20 applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20 {\n using SafeMath for uint256;\n\n mapping (address => uint256) private _balances;\n\n mapping (address => mapping (address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n uint8 private _decimals;\n\n /**\n * @dev Sets the values for {name} and {symbol}, initializes {decimals} with\n * a default value of 18.\n *\n * To select a different value for {decimals}, use {_setupDecimals}.\n *\n * All three of these values are immutable: they can only be set once during\n * construction.\n */\n constructor (string memory name_, string memory symbol_) public {\n _name = name_;\n _symbol = symbol_;\n _decimals = 18;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5,05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless {_setupDecimals} is\n * called.\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `recipient` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address recipient, uint256 amount) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * Requirements:\n *\n * - `sender` and `recipient` cannot be the zero address.\n * - `sender` must have a balance of at least `amount`.\n * - the caller must have allowance for ``sender``'s tokens of at least\n * `amount`.\n */\n function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, \"ERC20: transfer amount exceeds allowance\"));\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, \"ERC20: decreased allowance below zero\"));\n return true;\n }\n\n /**\n * @dev Moves tokens `amount` from `sender` to `recipient`.\n *\n * This is internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `sender` cannot be the zero address.\n * - `recipient` cannot be the zero address.\n * - `sender` must have a balance of at least `amount`.\n */\n function _transfer(address sender, address recipient, uint256 amount) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(sender, recipient, amount);\n\n _balances[sender] = _balances[sender].sub(amount, \"ERC20: transfer amount exceeds balance\");\n _balances[recipient] = _balances[recipient].add(amount);\n emit Transfer(sender, recipient, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply = _totalSupply.add(amount);\n _balances[account] = _balances[account].add(amount);\n emit Transfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n _balances[account] = _balances[account].sub(amount, \"ERC20: burn amount exceeds balance\");\n _totalSupply = _totalSupply.sub(amount);\n emit Transfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(address owner, address spender, uint256 amount) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Sets {decimals} to a value other than the default one of 18.\n *\n * WARNING: This function should only be called from the constructor. Most\n * applications that interact with token contracts will not expect\n * {decimals} to ever change, and may work incorrectly if it does.\n */\n function _setupDecimals(uint8 decimals_) internal {\n _decimals = decimals_;\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be to transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }\n}\n" + }, + "contracts/GraphTokenMock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\n\n/**\n * @title Graph Token Mock\n */\ncontract GraphTokenMock is Ownable, ERC20 {\n /**\n * @dev Contract Constructor.\n * @param _initialSupply Initial supply\n */\n constructor(uint256 _initialSupply, address _mintTo) ERC20(\"Graph Token Mock\", \"GRT-Mock\") {\n // Deploy to mint address\n _mint(_mintTo, _initialSupply);\n }\n}\n" + }, + "contracts/MinimalProxyFactory.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\nimport \"@openzeppelin/contracts/utils/Create2.sol\";\n\n// Adapted from https://github.com/OpenZeppelin/openzeppelin-sdk/blob/v2.5.0/packages/lib/contracts/upgradeability/ProxyFactory.sol\n// Based on https://eips.ethereum.org/EIPS/eip-1167\ncontract MinimalProxyFactory is Ownable {\n // -- Events --\n\n event ProxyCreated(address indexed proxy);\n\n /**\n * @notice Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation\n * @param _salt Bytes32 salt to use for CREATE2\n * @param _implementation Address of the proxy target implementation\n * @return Address of the counterfactual MinimalProxy\n */\n function getDeploymentAddress(bytes32 _salt, address _implementation) external view returns (address) {\n return Create2.computeAddress(_salt, keccak256(_getContractCreationCode(_implementation)), address(this));\n }\n\n /**\n * @notice Deploys a MinimalProxy with CREATE2\n * @param _salt Bytes32 salt to use for CREATE2\n * @param _implementation Address of the proxy target implementation\n * @param _data Bytes with the initializer call\n * @return Address of the deployed MinimalProxy\n */\n function _deployProxy2(\n bytes32 _salt,\n address _implementation,\n bytes memory _data\n ) internal returns (address) {\n address proxyAddress = Create2.deploy(0, _salt, _getContractCreationCode(_implementation));\n\n emit ProxyCreated(proxyAddress);\n\n // Call function with data\n if (_data.length > 0) {\n Address.functionCall(proxyAddress, _data);\n }\n\n return proxyAddress;\n }\n\n /**\n * @notice Gets the MinimalProxy bytecode\n * @param _implementation Address of the proxy target implementation\n * @return MinimalProxy bytecode\n */\n function _getContractCreationCode(address _implementation) internal pure returns (bytes memory) {\n bytes10 creation = 0x3d602d80600a3d3981f3;\n bytes10 prefix = 0x363d3d373d3d3d363d73;\n bytes20 targetBytes = bytes20(_implementation);\n bytes15 suffix = 0x5af43d82803e903d91602b57fd5bf3;\n return abi.encodePacked(creation, prefix, targetBytes, suffix);\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Create2.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/**\n * @dev Helper to make usage of the `CREATE2` EVM opcode easier and safer.\n * `CREATE2` can be used to compute in advance the address where a smart\n * contract will be deployed, which allows for interesting new mechanisms known\n * as 'counterfactual interactions'.\n *\n * See the https://eips.ethereum.org/EIPS/eip-1014#motivation[EIP] for more\n * information.\n */\nlibrary Create2 {\n /**\n * @dev Deploys a contract using `CREATE2`. The address where the contract\n * will be deployed can be known in advance via {computeAddress}.\n *\n * The bytecode for a contract can be obtained from Solidity with\n * `type(contractName).creationCode`.\n *\n * Requirements:\n *\n * - `bytecode` must not be empty.\n * - `salt` must have not been used for `bytecode` already.\n * - the factory must have a balance of at least `amount`.\n * - if `amount` is non-zero, `bytecode` must have a `payable` constructor.\n */\n function deploy(uint256 amount, bytes32 salt, bytes memory bytecode) internal returns (address) {\n address addr;\n require(address(this).balance >= amount, \"Create2: insufficient balance\");\n require(bytecode.length != 0, \"Create2: bytecode length is zero\");\n // solhint-disable-next-line no-inline-assembly\n assembly {\n addr := create2(amount, add(bytecode, 0x20), mload(bytecode), salt)\n }\n require(addr != address(0), \"Create2: Failed on deploy\");\n return addr;\n }\n\n /**\n * @dev Returns the address where a contract will be stored if deployed via {deploy}. Any change in the\n * `bytecodeHash` or `salt` will result in a new destination address.\n */\n function computeAddress(bytes32 salt, bytes32 bytecodeHash) internal view returns (address) {\n return computeAddress(salt, bytecodeHash, address(this));\n }\n\n /**\n * @dev Returns the address where a contract will be stored if deployed via {deploy} from a contract located at\n * `deployer`. If `deployer` is this contract's address, returns the same value as {computeAddress}.\n */\n function computeAddress(bytes32 salt, bytes32 bytecodeHash, address deployer) internal pure returns (address) {\n bytes32 _data = keccak256(\n abi.encodePacked(bytes1(0xff), deployer, salt, bytecodeHash)\n );\n return address(uint256(_data));\n }\n}\n" + }, + "contracts/GraphTokenLockManager.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\";\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"@openzeppelin/contracts/utils/EnumerableSet.sol\";\n\nimport \"./MinimalProxyFactory.sol\";\nimport \"./IGraphTokenLockManager.sol\";\n\n/**\n * @title GraphTokenLockManager\n * @notice This contract manages a list of authorized function calls and targets that can be called\n * by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts.\n *\n * This contract receives funds to make the process of creating TokenLockWallet contracts\n * easier by distributing them the initial tokens to be managed.\n *\n * The owner can setup a list of token destinations that will be used by TokenLock contracts to\n * approve the pulling of funds, this way in can be guaranteed that only protocol contracts\n * will manipulate users funds.\n */\ncontract GraphTokenLockManager is MinimalProxyFactory, IGraphTokenLockManager {\n using SafeERC20 for IERC20;\n using EnumerableSet for EnumerableSet.AddressSet;\n\n // -- State --\n\n mapping(bytes4 => address) public authFnCalls;\n EnumerableSet.AddressSet private _tokenDestinations;\n\n address public masterCopy;\n IERC20 private _token;\n\n // -- Events --\n\n event MasterCopyUpdated(address indexed masterCopy);\n event TokenLockCreated(\n address indexed contractAddress,\n bytes32 indexed initHash,\n address indexed beneficiary,\n address token,\n uint256 managedAmount,\n uint256 startTime,\n uint256 endTime,\n uint256 periods,\n uint256 releaseStartTime,\n uint256 vestingCliffTime,\n IGraphTokenLock.Revocability revocable\n );\n\n event TokensDeposited(address indexed sender, uint256 amount);\n event TokensWithdrawn(address indexed sender, uint256 amount);\n\n event FunctionCallAuth(address indexed caller, bytes4 indexed sigHash, address indexed target, string signature);\n event TokenDestinationAllowed(address indexed dst, bool allowed);\n\n /**\n * Constructor.\n * @param _graphToken Token to use for deposits and withdrawals\n * @param _masterCopy Address of the master copy to use to clone proxies\n */\n constructor(IERC20 _graphToken, address _masterCopy) {\n require(address(_graphToken) != address(0), \"Token cannot be zero\");\n _token = _graphToken;\n setMasterCopy(_masterCopy);\n }\n\n // -- Factory --\n\n /**\n * @notice Sets the masterCopy bytecode to use to create clones of TokenLock contracts\n * @param _masterCopy Address of contract bytecode to factory clone\n */\n function setMasterCopy(address _masterCopy) public override onlyOwner {\n require(_masterCopy != address(0), \"MasterCopy cannot be zero\");\n masterCopy = _masterCopy;\n emit MasterCopyUpdated(_masterCopy);\n }\n\n /**\n * @notice Creates and fund a new token lock wallet using a minimum proxy\n * @param _owner Address of the contract owner\n * @param _beneficiary Address of the beneficiary of locked tokens\n * @param _managedAmount Amount of tokens to be managed by the lock contract\n * @param _startTime Start time of the release schedule\n * @param _endTime End time of the release schedule\n * @param _periods Number of periods between start time and end time\n * @param _releaseStartTime Override time for when the releases start\n * @param _revocable Whether the contract is revocable\n */\n function createTokenLockWallet(\n address _owner,\n address _beneficiary,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n IGraphTokenLock.Revocability _revocable\n ) external override onlyOwner {\n require(_token.balanceOf(address(this)) >= _managedAmount, \"Not enough tokens to create lock\");\n\n // Create contract using a minimal proxy and call initializer\n bytes memory initializer = abi.encodeWithSignature(\n \"initialize(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)\",\n address(this),\n _owner,\n _beneficiary,\n address(_token),\n _managedAmount,\n _startTime,\n _endTime,\n _periods,\n _releaseStartTime,\n _vestingCliffTime,\n _revocable\n );\n address contractAddress = _deployProxy2(keccak256(initializer), masterCopy, initializer);\n\n // Send managed amount to the created contract\n _token.safeTransfer(contractAddress, _managedAmount);\n\n emit TokenLockCreated(\n contractAddress,\n keccak256(initializer),\n _beneficiary,\n address(_token),\n _managedAmount,\n _startTime,\n _endTime,\n _periods,\n _releaseStartTime,\n _vestingCliffTime,\n _revocable\n );\n }\n\n // -- Funds Management --\n\n /**\n * @notice Gets the GRT token address\n * @return Token used for transfers and approvals\n */\n function token() external view override returns (IERC20) {\n return _token;\n }\n\n /**\n * @notice Deposits tokens into the contract\n * @dev Even if the ERC20 token can be transferred directly to the contract\n * this function provide a safe interface to do the transfer and avoid mistakes\n * @param _amount Amount to deposit\n */\n function deposit(uint256 _amount) external override {\n require(_amount > 0, \"Amount cannot be zero\");\n _token.safeTransferFrom(msg.sender, address(this), _amount);\n emit TokensDeposited(msg.sender, _amount);\n }\n\n /**\n * @notice Withdraws tokens from the contract\n * @dev Escape hatch in case of mistakes or to recover remaining funds\n * @param _amount Amount of tokens to withdraw\n */\n function withdraw(uint256 _amount) external override onlyOwner {\n require(_amount > 0, \"Amount cannot be zero\");\n _token.safeTransfer(msg.sender, _amount);\n emit TokensWithdrawn(msg.sender, _amount);\n }\n\n // -- Token Destinations --\n\n /**\n * @notice Adds an address that can be allowed by a token lock to pull funds\n * @param _dst Destination address\n */\n function addTokenDestination(address _dst) external override onlyOwner {\n require(_dst != address(0), \"Destination cannot be zero\");\n require(_tokenDestinations.add(_dst), \"Destination already added\");\n emit TokenDestinationAllowed(_dst, true);\n }\n\n /**\n * @notice Removes an address that can be allowed by a token lock to pull funds\n * @param _dst Destination address\n */\n function removeTokenDestination(address _dst) external override onlyOwner {\n require(_tokenDestinations.remove(_dst), \"Destination already removed\");\n emit TokenDestinationAllowed(_dst, false);\n }\n\n /**\n * @notice Returns True if the address is authorized to be a destination of tokens\n * @param _dst Destination address\n * @return True if authorized\n */\n function isTokenDestination(address _dst) external view override returns (bool) {\n return _tokenDestinations.contains(_dst);\n }\n\n /**\n * @notice Returns an array of authorized destination addresses\n * @return Array of addresses authorized to pull funds from a token lock\n */\n function getTokenDestinations() external view override returns (address[] memory) {\n address[] memory dstList = new address[](_tokenDestinations.length());\n for (uint256 i = 0; i < _tokenDestinations.length(); i++) {\n dstList[i] = _tokenDestinations.at(i);\n }\n return dstList;\n }\n\n // -- Function Call Authorization --\n\n /**\n * @notice Sets an authorized function call to target\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\n * @param _signature Function signature\n * @param _target Address of the destination contract to call\n */\n function setAuthFunctionCall(string calldata _signature, address _target) external override onlyOwner {\n _setAuthFunctionCall(_signature, _target);\n }\n\n /**\n * @notice Unsets an authorized function call to target\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\n * @param _signature Function signature\n */\n function unsetAuthFunctionCall(string calldata _signature) external override onlyOwner {\n bytes4 sigHash = _toFunctionSigHash(_signature);\n authFnCalls[sigHash] = address(0);\n\n emit FunctionCallAuth(msg.sender, sigHash, address(0), _signature);\n }\n\n /**\n * @notice Sets an authorized function call to target in bulk\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\n * @param _signatures Function signatures\n * @param _targets Address of the destination contract to call\n */\n function setAuthFunctionCallMany(string[] calldata _signatures, address[] calldata _targets)\n external\n override\n onlyOwner\n {\n require(_signatures.length == _targets.length, \"Array length mismatch\");\n\n for (uint256 i = 0; i < _signatures.length; i++) {\n _setAuthFunctionCall(_signatures[i], _targets[i]);\n }\n }\n\n /**\n * @notice Sets an authorized function call to target\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\n * @dev Function signatures of Graph Protocol contracts to be used are known ahead of time\n * @param _signature Function signature\n * @param _target Address of the destination contract to call\n */\n function _setAuthFunctionCall(string calldata _signature, address _target) internal {\n require(_target != address(this), \"Target must be other contract\");\n require(Address.isContract(_target), \"Target must be a contract\");\n\n bytes4 sigHash = _toFunctionSigHash(_signature);\n authFnCalls[sigHash] = _target;\n\n emit FunctionCallAuth(msg.sender, sigHash, _target, _signature);\n }\n\n /**\n * @notice Gets the target contract to call for a particular function signature\n * @param _sigHash Function signature hash\n * @return Address of the target contract where to send the call\n */\n function getAuthFunctionCallTarget(bytes4 _sigHash) public view override returns (address) {\n return authFnCalls[_sigHash];\n }\n\n /**\n * @notice Returns true if the function call is authorized\n * @param _sigHash Function signature hash\n * @return True if authorized\n */\n function isAuthFunctionCall(bytes4 _sigHash) external view override returns (bool) {\n return getAuthFunctionCallTarget(_sigHash) != address(0);\n }\n\n /**\n * @dev Converts a function signature string to 4-bytes hash\n * @param _signature Function signature string\n * @return Function signature hash\n */\n function _toFunctionSigHash(string calldata _signature) internal pure returns (bytes4) {\n return _convertToBytes4(abi.encodeWithSignature(_signature));\n }\n\n /**\n * @dev Converts function signature bytes to function signature hash (bytes4)\n * @param _signature Function signature\n * @return Function signature in bytes4\n */\n function _convertToBytes4(bytes memory _signature) internal pure returns (bytes4) {\n require(_signature.length == 4, \"Invalid method signature\");\n bytes4 sigHash;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n sigHash := mload(add(_signature, 32))\n }\n return sigHash;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/EnumerableSet.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/**\n * @dev Library for managing\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\n * types.\n *\n * Sets have the following properties:\n *\n * - Elements are added, removed, and checked for existence in constant time\n * (O(1)).\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\n *\n * ```\n * contract Example {\n * // Add the library methods\n * using EnumerableSet for EnumerableSet.AddressSet;\n *\n * // Declare a set state variable\n * EnumerableSet.AddressSet private mySet;\n * }\n * ```\n *\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\n * and `uint256` (`UintSet`) are supported.\n */\nlibrary EnumerableSet {\n // To implement this library for multiple types with as little code\n // repetition as possible, we write it in terms of a generic Set type with\n // bytes32 values.\n // The Set implementation uses private functions, and user-facing\n // implementations (such as AddressSet) are just wrappers around the\n // underlying Set.\n // This means that we can only create new EnumerableSets for types that fit\n // in bytes32.\n\n struct Set {\n // Storage of set values\n bytes32[] _values;\n\n // Position of the value in the `values` array, plus 1 because index 0\n // means a value is not in the set.\n mapping (bytes32 => uint256) _indexes;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function _add(Set storage set, bytes32 value) private returns (bool) {\n if (!_contains(set, value)) {\n set._values.push(value);\n // The value is stored at length-1, but we add 1 to all indexes\n // and use 0 as a sentinel value\n set._indexes[value] = set._values.length;\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function _remove(Set storage set, bytes32 value) private returns (bool) {\n // We read and store the value's index to prevent multiple reads from the same storage slot\n uint256 valueIndex = set._indexes[value];\n\n if (valueIndex != 0) { // Equivalent to contains(set, value)\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\n // the array, and then remove the last element (sometimes called as 'swap and pop').\n // This modifies the order of the array, as noted in {at}.\n\n uint256 toDeleteIndex = valueIndex - 1;\n uint256 lastIndex = set._values.length - 1;\n\n // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs\n // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.\n\n bytes32 lastvalue = set._values[lastIndex];\n\n // Move the last value to the index where the value to delete is\n set._values[toDeleteIndex] = lastvalue;\n // Update the index for the moved value\n set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based\n\n // Delete the slot where the moved value was stored\n set._values.pop();\n\n // Delete the index for the deleted slot\n delete set._indexes[value];\n\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\n return set._indexes[value] != 0;\n }\n\n /**\n * @dev Returns the number of values on the set. O(1).\n */\n function _length(Set storage set) private view returns (uint256) {\n return set._values.length;\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\n require(set._values.length > index, \"EnumerableSet: index out of bounds\");\n return set._values[index];\n }\n\n // Bytes32Set\n\n struct Bytes32Set {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _add(set._inner, value);\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _remove(set._inner, value);\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\n return _contains(set._inner, value);\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(Bytes32Set storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\n return _at(set._inner, index);\n }\n\n // AddressSet\n\n struct AddressSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(AddressSet storage set, address value) internal returns (bool) {\n return _add(set._inner, bytes32(uint256(value)));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(AddressSet storage set, address value) internal returns (bool) {\n return _remove(set._inner, bytes32(uint256(value)));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(AddressSet storage set, address value) internal view returns (bool) {\n return _contains(set._inner, bytes32(uint256(value)));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(AddressSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\n return address(uint256(_at(set._inner, index)));\n }\n\n\n // UintSet\n\n struct UintSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(UintSet storage set, uint256 value) internal returns (bool) {\n return _add(set._inner, bytes32(value));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\n return _remove(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\n return _contains(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns the number of values on the set. O(1).\n */\n function length(UintSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\n return uint256(_at(set._inner, index));\n }\n}\n" + }, + "contracts/GraphTokenLockSimple.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport \"./GraphTokenLock.sol\";\n\n/**\n * @title GraphTokenLockSimple\n * @notice This contract is the concrete simple implementation built on top of the base\n * GraphTokenLock functionality for use when we only need the token lock schedule\n * features but no interaction with the network.\n * \n * This contract is designed to be deployed without the use of a TokenManager.\n */\ncontract GraphTokenLockSimple is GraphTokenLock {\n // Constructor\n constructor() {\n Ownable.initialize(msg.sender);\n }\n\n // Initializer\n function initialize(\n address _owner,\n address _beneficiary,\n address _token,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n Revocability _revocable\n ) external onlyOwner {\n _initialize(\n _owner,\n _beneficiary,\n _token,\n _managedAmount,\n _startTime,\n _endTime,\n _periods,\n _releaseStartTime,\n _vestingCliffTime,\n _revocable\n );\n }\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": false, + "runs": 200 + }, + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file diff --git a/packages/token-distribution/deployments/mainnet/solcInputs/b5cdad58099d39cd1aed000b2fd864d8.json b/packages/token-distribution/deployments/mainnet/solcInputs/b5cdad58099d39cd1aed000b2fd864d8.json new file mode 100644 index 000000000..4eda754ae --- /dev/null +++ b/packages/token-distribution/deployments/mainnet/solcInputs/b5cdad58099d39cd1aed000b2fd864d8.json @@ -0,0 +1,152 @@ +{ + "language": "Solidity", + "sources": { + "@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/**\n * @dev Wrappers over Solidity's arithmetic operations with added overflow\n * checks.\n *\n * Arithmetic operations in Solidity wrap on overflow. This can easily result\n * in bugs, because programmers usually assume that an overflow raises an\n * error, which is the standard behavior in high level programming languages.\n * `SafeMath` restores this intuition by reverting the transaction when an\n * operation overflows.\n *\n * Using this library instead of the unchecked operations eliminates an entire\n * class of bugs, so it's recommended to use it always.\n */\nlibrary SafeMathUpgradeable {\n /**\n * @dev Returns the addition of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n uint256 c = a + b;\n if (c < a) return (false, 0);\n return (true, c);\n }\n\n /**\n * @dev Returns the substraction of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n if (b > a) return (false, 0);\n return (true, a - b);\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\n // benefit is lost if 'b' is also tested.\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\n if (a == 0) return (true, 0);\n uint256 c = a * b;\n if (c / a != b) return (false, 0);\n return (true, c);\n }\n\n /**\n * @dev Returns the division of two unsigned integers, with a division by zero flag.\n *\n * _Available since v3.4._\n */\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n if (b == 0) return (false, 0);\n return (true, a / b);\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\n *\n * _Available since v3.4._\n */\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n if (b == 0) return (false, 0);\n return (true, a % b);\n }\n\n /**\n * @dev Returns the addition of two unsigned integers, reverting on\n * overflow.\n *\n * Counterpart to Solidity's `+` operator.\n *\n * Requirements:\n *\n * - Addition cannot overflow.\n */\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\n uint256 c = a + b;\n require(c >= a, \"SafeMath: addition overflow\");\n return c;\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, reverting on\n * overflow (when the result is negative).\n *\n * Counterpart to Solidity's `-` operator.\n *\n * Requirements:\n *\n * - Subtraction cannot overflow.\n */\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b <= a, \"SafeMath: subtraction overflow\");\n return a - b;\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, reverting on\n * overflow.\n *\n * Counterpart to Solidity's `*` operator.\n *\n * Requirements:\n *\n * - Multiplication cannot overflow.\n */\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n if (a == 0) return 0;\n uint256 c = a * b;\n require(c / a == b, \"SafeMath: multiplication overflow\");\n return c;\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers, reverting on\n * division by zero. The result is rounded towards zero.\n *\n * Counterpart to Solidity's `/` operator. Note: this function uses a\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\n * uses an invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b > 0, \"SafeMath: division by zero\");\n return a / b;\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * reverting when dividing by zero.\n *\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\n * opcode (which leaves remaining gas untouched) while Solidity uses an\n * invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b > 0, \"SafeMath: modulo by zero\");\n return a % b;\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\n * overflow (when the result is negative).\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {trySub}.\n *\n * Counterpart to Solidity's `-` operator.\n *\n * Requirements:\n *\n * - Subtraction cannot overflow.\n */\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b <= a, errorMessage);\n return a - b;\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers, reverting with custom message on\n * division by zero. The result is rounded towards zero.\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {tryDiv}.\n *\n * Counterpart to Solidity's `/` operator. Note: this function uses a\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\n * uses an invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b > 0, errorMessage);\n return a / b;\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * reverting with custom message when dividing by zero.\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {tryMod}.\n *\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\n * opcode (which leaves remaining gas untouched) while Solidity uses an\n * invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b > 0, errorMessage);\n return a % b;\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\n// solhint-disable-next-line compiler-version\npragma solidity >=0.4.24 <0.8.0;\n\nimport \"../utils/AddressUpgradeable.sol\";\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {UpgradeableProxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n */\nabstract contract Initializable {\n\n /**\n * @dev Indicates that the contract has been initialized.\n */\n bool private _initialized;\n\n /**\n * @dev Indicates that the contract is in the process of being initialized.\n */\n bool private _initializing;\n\n /**\n * @dev Modifier to protect an initializer function from being invoked twice.\n */\n modifier initializer() {\n require(_initializing || _isConstructor() || !_initialized, \"Initializable: contract is already initialized\");\n\n bool isTopLevelCall = !_initializing;\n if (isTopLevelCall) {\n _initializing = true;\n _initialized = true;\n }\n\n _;\n\n if (isTopLevelCall) {\n _initializing = false;\n }\n }\n\n /// @dev Returns true if and only if the function is running in the constructor\n function _isConstructor() private view returns (bool) {\n return !AddressUpgradeable.isContract(address(this));\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.2 <0.8.0;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary AddressUpgradeable {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize, which returns 0 for contracts in\n // construction, since the code is only stored at the end of the\n // constructor execution.\n\n uint256 size;\n // solhint-disable-next-line no-inline-assembly\n assembly { size := extcodesize(account) }\n return size > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n // solhint-disable-next-line avoid-low-level-calls, avoid-call-value\n (bool success, ) = recipient.call{ value: amount }(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain`call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCall(target, data, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n require(isContract(target), \"Address: call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.call{ value: value }(data);\n return _verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {\n require(isContract(target), \"Address: static call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.staticcall(data);\n return _verifyCallResult(success, returndata, errorMessage);\n }\n\n function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {\n if (success) {\n return returndata;\n } else {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n }\n}\n" + }, + "@openzeppelin/contracts/access/Ownable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\nimport \"../utils/Context.sol\";\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor () internal {\n address msgSender = _msgSender();\n _owner = msgSender;\n emit OwnershipTransferred(address(0), msgSender);\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n _;\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n emit OwnershipTransferred(_owner, address(0));\n _owner = address(0);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n emit OwnershipTransferred(_owner, newOwner);\n _owner = newOwner;\n }\n}\n" + }, + "@openzeppelin/contracts/math/SafeMath.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/**\n * @dev Wrappers over Solidity's arithmetic operations with added overflow\n * checks.\n *\n * Arithmetic operations in Solidity wrap on overflow. This can easily result\n * in bugs, because programmers usually assume that an overflow raises an\n * error, which is the standard behavior in high level programming languages.\n * `SafeMath` restores this intuition by reverting the transaction when an\n * operation overflows.\n *\n * Using this library instead of the unchecked operations eliminates an entire\n * class of bugs, so it's recommended to use it always.\n */\nlibrary SafeMath {\n /**\n * @dev Returns the addition of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n uint256 c = a + b;\n if (c < a) return (false, 0);\n return (true, c);\n }\n\n /**\n * @dev Returns the substraction of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n if (b > a) return (false, 0);\n return (true, a - b);\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\n // benefit is lost if 'b' is also tested.\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\n if (a == 0) return (true, 0);\n uint256 c = a * b;\n if (c / a != b) return (false, 0);\n return (true, c);\n }\n\n /**\n * @dev Returns the division of two unsigned integers, with a division by zero flag.\n *\n * _Available since v3.4._\n */\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n if (b == 0) return (false, 0);\n return (true, a / b);\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\n *\n * _Available since v3.4._\n */\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n if (b == 0) return (false, 0);\n return (true, a % b);\n }\n\n /**\n * @dev Returns the addition of two unsigned integers, reverting on\n * overflow.\n *\n * Counterpart to Solidity's `+` operator.\n *\n * Requirements:\n *\n * - Addition cannot overflow.\n */\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\n uint256 c = a + b;\n require(c >= a, \"SafeMath: addition overflow\");\n return c;\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, reverting on\n * overflow (when the result is negative).\n *\n * Counterpart to Solidity's `-` operator.\n *\n * Requirements:\n *\n * - Subtraction cannot overflow.\n */\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b <= a, \"SafeMath: subtraction overflow\");\n return a - b;\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, reverting on\n * overflow.\n *\n * Counterpart to Solidity's `*` operator.\n *\n * Requirements:\n *\n * - Multiplication cannot overflow.\n */\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n if (a == 0) return 0;\n uint256 c = a * b;\n require(c / a == b, \"SafeMath: multiplication overflow\");\n return c;\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers, reverting on\n * division by zero. The result is rounded towards zero.\n *\n * Counterpart to Solidity's `/` operator. Note: this function uses a\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\n * uses an invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b > 0, \"SafeMath: division by zero\");\n return a / b;\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * reverting when dividing by zero.\n *\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\n * opcode (which leaves remaining gas untouched) while Solidity uses an\n * invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b > 0, \"SafeMath: modulo by zero\");\n return a % b;\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\n * overflow (when the result is negative).\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {trySub}.\n *\n * Counterpart to Solidity's `-` operator.\n *\n * Requirements:\n *\n * - Subtraction cannot overflow.\n */\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b <= a, errorMessage);\n return a - b;\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers, reverting with custom message on\n * division by zero. The result is rounded towards zero.\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {tryDiv}.\n *\n * Counterpart to Solidity's `/` operator. Note: this function uses a\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\n * uses an invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b > 0, errorMessage);\n return a / b;\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * reverting with custom message when dividing by zero.\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {tryMod}.\n *\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\n * opcode (which leaves remaining gas untouched) while Solidity uses an\n * invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b > 0, errorMessage);\n return a % b;\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/ERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\nimport \"../../utils/Context.sol\";\nimport \"./IERC20.sol\";\nimport \"../../math/SafeMath.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin guidelines: functions revert instead\n * of returning `false` on failure. This behavior is nonetheless conventional\n * and does not conflict with the expectations of ERC20 applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20 {\n using SafeMath for uint256;\n\n mapping (address => uint256) private _balances;\n\n mapping (address => mapping (address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n uint8 private _decimals;\n\n /**\n * @dev Sets the values for {name} and {symbol}, initializes {decimals} with\n * a default value of 18.\n *\n * To select a different value for {decimals}, use {_setupDecimals}.\n *\n * All three of these values are immutable: they can only be set once during\n * construction.\n */\n constructor (string memory name_, string memory symbol_) public {\n _name = name_;\n _symbol = symbol_;\n _decimals = 18;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5,05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless {_setupDecimals} is\n * called.\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual returns (uint8) {\n return _decimals;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `recipient` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address recipient, uint256 amount) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * Requirements:\n *\n * - `sender` and `recipient` cannot be the zero address.\n * - `sender` must have a balance of at least `amount`.\n * - the caller must have allowance for ``sender``'s tokens of at least\n * `amount`.\n */\n function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, \"ERC20: transfer amount exceeds allowance\"));\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, \"ERC20: decreased allowance below zero\"));\n return true;\n }\n\n /**\n * @dev Moves tokens `amount` from `sender` to `recipient`.\n *\n * This is internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `sender` cannot be the zero address.\n * - `recipient` cannot be the zero address.\n * - `sender` must have a balance of at least `amount`.\n */\n function _transfer(address sender, address recipient, uint256 amount) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(sender, recipient, amount);\n\n _balances[sender] = _balances[sender].sub(amount, \"ERC20: transfer amount exceeds balance\");\n _balances[recipient] = _balances[recipient].add(amount);\n emit Transfer(sender, recipient, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply = _totalSupply.add(amount);\n _balances[account] = _balances[account].add(amount);\n emit Transfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n _balances[account] = _balances[account].sub(amount, \"ERC20: burn amount exceeds balance\");\n _totalSupply = _totalSupply.sub(amount);\n emit Transfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(address owner, address spender, uint256 amount) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Sets {decimals} to a value other than the default one of 18.\n *\n * WARNING: This function should only be called from the constructor. Most\n * applications that interact with token contracts will not expect\n * {decimals} to ever change, and may work incorrectly if it does.\n */\n function _setupDecimals(uint8 decimals_) internal virtual {\n _decimals = decimals_;\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be to transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `recipient`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address recipient, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `sender` to `recipient` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);\n\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/SafeERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"../../math/SafeMath.sol\";\nimport \"../../utils/Address.sol\";\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n using SafeMath for uint256;\n using Address for address;\n\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\n }\n\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\n }\n\n /**\n * @dev Deprecated. This function has issues similar to the ones found in\n * {IERC20-approve}, and its usage is discouraged.\n *\n * Whenever possible, use {safeIncreaseAllowance} and\n * {safeDecreaseAllowance} instead.\n */\n function safeApprove(IERC20 token, address spender, uint256 value) internal {\n // safeApprove should only be called when setting an initial allowance,\n // or when resetting it to zero. To increase and decrease it, use\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\n // solhint-disable-next-line max-line-length\n require((value == 0) || (token.allowance(address(this), spender) == 0),\n \"SafeERC20: approve from non-zero to non-zero allowance\"\n );\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\n }\n\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n uint256 newAllowance = token.allowance(address(this), spender).add(value);\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\n\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n uint256 newAllowance = token.allowance(address(this), spender).sub(value, \"SafeERC20: decreased allowance below zero\");\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n */\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that\n // the target address contains contract code and also asserts for success in the low-level call.\n\n bytes memory returndata = address(token).functionCall(data, \"SafeERC20: low-level call failed\");\n if (returndata.length > 0) { // Return data is optional\n // solhint-disable-next-line max-line-length\n require(abi.decode(returndata, (bool)), \"SafeERC20: ERC20 operation did not succeed\");\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Address.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.2 <0.8.0;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize, which returns 0 for contracts in\n // construction, since the code is only stored at the end of the\n // constructor execution.\n\n uint256 size;\n // solhint-disable-next-line no-inline-assembly\n assembly { size := extcodesize(account) }\n return size > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n // solhint-disable-next-line avoid-low-level-calls, avoid-call-value\n (bool success, ) = recipient.call{ value: amount }(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain`call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCall(target, data, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n require(isContract(target), \"Address: call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.call{ value: value }(data);\n return _verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {\n require(isContract(target), \"Address: static call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.staticcall(data);\n return _verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\n require(isContract(target), \"Address: delegate call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return _verifyCallResult(success, returndata, errorMessage);\n }\n\n function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {\n if (success) {\n return returndata;\n } else {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/*\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with GSN meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address payable) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes memory) {\n this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\n return msg.data;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Create2.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/**\n * @dev Helper to make usage of the `CREATE2` EVM opcode easier and safer.\n * `CREATE2` can be used to compute in advance the address where a smart\n * contract will be deployed, which allows for interesting new mechanisms known\n * as 'counterfactual interactions'.\n *\n * See the https://eips.ethereum.org/EIPS/eip-1014#motivation[EIP] for more\n * information.\n */\nlibrary Create2 {\n /**\n * @dev Deploys a contract using `CREATE2`. The address where the contract\n * will be deployed can be known in advance via {computeAddress}.\n *\n * The bytecode for a contract can be obtained from Solidity with\n * `type(contractName).creationCode`.\n *\n * Requirements:\n *\n * - `bytecode` must not be empty.\n * - `salt` must have not been used for `bytecode` already.\n * - the factory must have a balance of at least `amount`.\n * - if `amount` is non-zero, `bytecode` must have a `payable` constructor.\n */\n function deploy(uint256 amount, bytes32 salt, bytes memory bytecode) internal returns (address) {\n address addr;\n require(address(this).balance >= amount, \"Create2: insufficient balance\");\n require(bytecode.length != 0, \"Create2: bytecode length is zero\");\n // solhint-disable-next-line no-inline-assembly\n assembly {\n addr := create2(amount, add(bytecode, 0x20), mload(bytecode), salt)\n }\n require(addr != address(0), \"Create2: Failed on deploy\");\n return addr;\n }\n\n /**\n * @dev Returns the address where a contract will be stored if deployed via {deploy}. Any change in the\n * `bytecodeHash` or `salt` will result in a new destination address.\n */\n function computeAddress(bytes32 salt, bytes32 bytecodeHash) internal view returns (address) {\n return computeAddress(salt, bytecodeHash, address(this));\n }\n\n /**\n * @dev Returns the address where a contract will be stored if deployed via {deploy} from a contract located at\n * `deployer`. If `deployer` is this contract's address, returns the same value as {computeAddress}.\n */\n function computeAddress(bytes32 salt, bytes32 bytecodeHash, address deployer) internal pure returns (address) {\n bytes32 _data = keccak256(\n abi.encodePacked(bytes1(0xff), deployer, salt, bytecodeHash)\n );\n return address(uint160(uint256(_data)));\n }\n}\n" + }, + "@openzeppelin/contracts/utils/EnumerableSet.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/**\n * @dev Library for managing\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\n * types.\n *\n * Sets have the following properties:\n *\n * - Elements are added, removed, and checked for existence in constant time\n * (O(1)).\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\n *\n * ```\n * contract Example {\n * // Add the library methods\n * using EnumerableSet for EnumerableSet.AddressSet;\n *\n * // Declare a set state variable\n * EnumerableSet.AddressSet private mySet;\n * }\n * ```\n *\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\n * and `uint256` (`UintSet`) are supported.\n */\nlibrary EnumerableSet {\n // To implement this library for multiple types with as little code\n // repetition as possible, we write it in terms of a generic Set type with\n // bytes32 values.\n // The Set implementation uses private functions, and user-facing\n // implementations (such as AddressSet) are just wrappers around the\n // underlying Set.\n // This means that we can only create new EnumerableSets for types that fit\n // in bytes32.\n\n struct Set {\n // Storage of set values\n bytes32[] _values;\n\n // Position of the value in the `values` array, plus 1 because index 0\n // means a value is not in the set.\n mapping (bytes32 => uint256) _indexes;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function _add(Set storage set, bytes32 value) private returns (bool) {\n if (!_contains(set, value)) {\n set._values.push(value);\n // The value is stored at length-1, but we add 1 to all indexes\n // and use 0 as a sentinel value\n set._indexes[value] = set._values.length;\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function _remove(Set storage set, bytes32 value) private returns (bool) {\n // We read and store the value's index to prevent multiple reads from the same storage slot\n uint256 valueIndex = set._indexes[value];\n\n if (valueIndex != 0) { // Equivalent to contains(set, value)\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\n // the array, and then remove the last element (sometimes called as 'swap and pop').\n // This modifies the order of the array, as noted in {at}.\n\n uint256 toDeleteIndex = valueIndex - 1;\n uint256 lastIndex = set._values.length - 1;\n\n // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs\n // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.\n\n bytes32 lastvalue = set._values[lastIndex];\n\n // Move the last value to the index where the value to delete is\n set._values[toDeleteIndex] = lastvalue;\n // Update the index for the moved value\n set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based\n\n // Delete the slot where the moved value was stored\n set._values.pop();\n\n // Delete the index for the deleted slot\n delete set._indexes[value];\n\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\n return set._indexes[value] != 0;\n }\n\n /**\n * @dev Returns the number of values on the set. O(1).\n */\n function _length(Set storage set) private view returns (uint256) {\n return set._values.length;\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\n require(set._values.length > index, \"EnumerableSet: index out of bounds\");\n return set._values[index];\n }\n\n // Bytes32Set\n\n struct Bytes32Set {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _add(set._inner, value);\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _remove(set._inner, value);\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\n return _contains(set._inner, value);\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(Bytes32Set storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\n return _at(set._inner, index);\n }\n\n // AddressSet\n\n struct AddressSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(AddressSet storage set, address value) internal returns (bool) {\n return _add(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(AddressSet storage set, address value) internal returns (bool) {\n return _remove(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(AddressSet storage set, address value) internal view returns (bool) {\n return _contains(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(AddressSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\n return address(uint160(uint256(_at(set._inner, index))));\n }\n\n\n // UintSet\n\n struct UintSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(UintSet storage set, uint256 value) internal returns (bool) {\n return _add(set._inner, bytes32(value));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\n return _remove(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\n return _contains(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns the number of values on the set. O(1).\n */\n function length(UintSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\n return uint256(_at(set._inner, index));\n }\n}\n" + }, + "contracts/arbitrum/ITokenGateway.sol": { + "content": "// SPDX-License-Identifier: Apache-2.0\n\n/*\n * Copyright 2020, Offchain Labs, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * Originally copied from:\n * https://github.com/OffchainLabs/arbitrum/tree/e3a6307ad8a2dc2cad35728a2a9908cfd8dd8ef9/packages/arb-bridge-peripherals\n *\n * MODIFIED from Offchain Labs' implementation:\n * - Changed solidity version to 0.7.6 (pablo@edgeandnode.com)\n *\n */\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\ninterface ITokenGateway {\n /// @notice event deprecated in favor of DepositInitiated and WithdrawalInitiated\n // event OutboundTransferInitiated(\n // address token,\n // address indexed _from,\n // address indexed _to,\n // uint256 indexed _transferId,\n // uint256 _amount,\n // bytes _data\n // );\n\n /// @notice event deprecated in favor of DepositFinalized and WithdrawalFinalized\n // event InboundTransferFinalized(\n // address token,\n // address indexed _from,\n // address indexed _to,\n // uint256 indexed _transferId,\n // uint256 _amount,\n // bytes _data\n // );\n\n function outboundTransfer(\n address _token,\n address _to,\n uint256 _amount,\n uint256 _maxGas,\n uint256 _gasPriceBid,\n bytes calldata _data\n ) external payable returns (bytes memory);\n\n function finalizeInboundTransfer(\n address _token,\n address _from,\n address _to,\n uint256 _amount,\n bytes calldata _data\n ) external payable;\n\n /**\n * @notice Calculate the address used when bridging an ERC20 token\n * @dev the L1 and L2 address oracles may not always be in sync.\n * For example, a custom token may have been registered but not deployed or the contract self destructed.\n * @param l1ERC20 address of L1 token\n * @return L2 address of a bridged ERC20 token\n */\n function calculateL2TokenAddress(address l1ERC20) external view returns (address);\n}\n" + }, + "contracts/GraphTokenDistributor.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\nimport \"@openzeppelin/contracts/math/SafeMath.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\";\n\n/**\n * @title GraphTokenDistributor\n * @dev Contract that allows distribution of tokens to multiple beneficiaries.\n * The contract accept deposits in the configured token by anyone.\n * The owner can setup the desired distribution by setting the amount of tokens\n * assigned to each beneficiary account.\n * Beneficiaries claim for their allocated tokens.\n * Only the owner can withdraw tokens from this contract without limitations.\n * For the distribution to work this contract must be unlocked by the owner.\n */\ncontract GraphTokenDistributor is Ownable {\n using SafeMath for uint256;\n using SafeERC20 for IERC20;\n\n // -- State --\n\n bool public locked;\n mapping(address => uint256) public beneficiaries;\n\n IERC20 public token;\n\n // -- Events --\n\n event BeneficiaryUpdated(address indexed beneficiary, uint256 amount);\n event TokensDeposited(address indexed sender, uint256 amount);\n event TokensWithdrawn(address indexed sender, uint256 amount);\n event TokensClaimed(address indexed beneficiary, address to, uint256 amount);\n event LockUpdated(bool locked);\n\n modifier whenNotLocked() {\n require(locked == false, \"Distributor: Claim is locked\");\n _;\n }\n\n /**\n * Constructor.\n * @param _token Token to use for deposits and withdrawals\n */\n constructor(IERC20 _token) {\n token = _token;\n locked = true;\n }\n\n /**\n * Deposit tokens into the contract.\n * Even if the ERC20 token can be transferred directly to the contract\n * this function provide a safe interface to do the transfer and avoid mistakes\n * @param _amount Amount to deposit\n */\n function deposit(uint256 _amount) external {\n token.safeTransferFrom(msg.sender, address(this), _amount);\n emit TokensDeposited(msg.sender, _amount);\n }\n\n // -- Admin functions --\n\n /**\n * Add token balance available for account.\n * @param _account Address to assign tokens to\n * @param _amount Amount of tokens to assign to beneficiary\n */\n function addBeneficiaryTokens(address _account, uint256 _amount) external onlyOwner {\n _setBeneficiaryTokens(_account, beneficiaries[_account].add(_amount));\n }\n\n /**\n * Add token balance available for multiple accounts.\n * @param _accounts Addresses to assign tokens to\n * @param _amounts Amounts of tokens to assign to beneficiary\n */\n function addBeneficiaryTokensMulti(address[] calldata _accounts, uint256[] calldata _amounts) external onlyOwner {\n require(_accounts.length == _amounts.length, \"Distributor: !length\");\n for (uint256 i = 0; i < _accounts.length; i++) {\n _setBeneficiaryTokens(_accounts[i], beneficiaries[_accounts[i]].add(_amounts[i]));\n }\n }\n\n /**\n * Remove token balance available for account.\n * @param _account Address to assign tokens to\n * @param _amount Amount of tokens to assign to beneficiary\n */\n function subBeneficiaryTokens(address _account, uint256 _amount) external onlyOwner {\n _setBeneficiaryTokens(_account, beneficiaries[_account].sub(_amount));\n }\n\n /**\n * Remove token balance available for multiple accounts.\n * @param _accounts Addresses to assign tokens to\n * @param _amounts Amounts of tokens to assign to beneficiary\n */\n function subBeneficiaryTokensMulti(address[] calldata _accounts, uint256[] calldata _amounts) external onlyOwner {\n require(_accounts.length == _amounts.length, \"Distributor: !length\");\n for (uint256 i = 0; i < _accounts.length; i++) {\n _setBeneficiaryTokens(_accounts[i], beneficiaries[_accounts[i]].sub(_amounts[i]));\n }\n }\n\n /**\n * Set amount of tokens available for beneficiary account.\n * @param _account Address to assign tokens to\n * @param _amount Amount of tokens to assign to beneficiary\n */\n function _setBeneficiaryTokens(address _account, uint256 _amount) private {\n require(_account != address(0), \"Distributor: !account\");\n\n beneficiaries[_account] = _amount;\n emit BeneficiaryUpdated(_account, _amount);\n }\n\n /**\n * Set locked withdrawals.\n * @param _locked True to lock withdrawals\n */\n function setLocked(bool _locked) external onlyOwner {\n locked = _locked;\n emit LockUpdated(_locked);\n }\n\n /**\n * Withdraw tokens from the contract. This function is included as\n * a escape hatch in case of mistakes or to recover remaining funds.\n * @param _amount Amount of tokens to withdraw\n */\n function withdraw(uint256 _amount) external onlyOwner {\n token.safeTransfer(msg.sender, _amount);\n emit TokensWithdrawn(msg.sender, _amount);\n }\n\n // -- Beneficiary functions --\n\n /**\n * Claim tokens and send to caller.\n */\n function claim() external whenNotLocked {\n claimTo(msg.sender);\n }\n\n /**\n * Claim tokens and send to address.\n * @param _to Address where to send tokens\n */\n function claimTo(address _to) public whenNotLocked {\n uint256 claimableTokens = beneficiaries[msg.sender];\n require(claimableTokens > 0, \"Distributor: Unavailable funds\");\n\n _setBeneficiaryTokens(msg.sender, 0);\n\n token.safeTransfer(_to, claimableTokens);\n emit TokensClaimed(msg.sender, _to, claimableTokens);\n }\n}\n" + }, + "contracts/GraphTokenLock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport \"@openzeppelin/contracts/math/SafeMath.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\";\n\nimport { Ownable as OwnableInitializable } from \"./Ownable.sol\";\nimport \"./MathUtils.sol\";\nimport \"./IGraphTokenLock.sol\";\n\n/**\n * @title GraphTokenLock\n * @notice Contract that manages an unlocking schedule of tokens.\n * @dev The contract lock manage a number of tokens deposited into the contract to ensure that\n * they can only be released under certain time conditions.\n *\n * This contract implements a release scheduled based on periods and tokens are released in steps\n * after each period ends. It can be configured with one period in which case it is like a plain TimeLock.\n * It also supports revocation to be used for vesting schedules.\n *\n * The contract supports receiving extra funds than the managed tokens ones that can be\n * withdrawn by the beneficiary at any time.\n *\n * A releaseStartTime parameter is included to override the default release schedule and\n * perform the first release on the configured time. After that it will continue with the\n * default schedule.\n */\nabstract contract GraphTokenLock is OwnableInitializable, IGraphTokenLock {\n using SafeMath for uint256;\n using SafeERC20 for IERC20;\n\n uint256 private constant MIN_PERIOD = 1;\n\n // -- State --\n\n IERC20 public token;\n address public beneficiary;\n\n // Configuration\n\n // Amount of tokens managed by the contract schedule\n uint256 public managedAmount;\n\n uint256 public startTime; // Start datetime (in unixtimestamp)\n uint256 public endTime; // Datetime after all funds are fully vested/unlocked (in unixtimestamp)\n uint256 public periods; // Number of vesting/release periods\n\n // First release date for tokens (in unixtimestamp)\n // If set, no tokens will be released before releaseStartTime ignoring\n // the amount to release each period\n uint256 public releaseStartTime;\n // A cliff set a date to which a beneficiary needs to get to vest\n // all preceding periods\n uint256 public vestingCliffTime;\n Revocability public revocable; // Whether to use vesting for locked funds\n\n // State\n\n bool public isRevoked;\n bool public isInitialized;\n bool public isAccepted;\n uint256 public releasedAmount;\n uint256 public revokedAmount;\n\n // -- Events --\n\n event TokensReleased(address indexed beneficiary, uint256 amount);\n event TokensWithdrawn(address indexed beneficiary, uint256 amount);\n event TokensRevoked(address indexed beneficiary, uint256 amount);\n event BeneficiaryChanged(address newBeneficiary);\n event LockAccepted();\n event LockCanceled();\n\n /**\n * @dev Only allow calls from the beneficiary of the contract\n */\n modifier onlyBeneficiary() {\n require(msg.sender == beneficiary, \"!auth\");\n _;\n }\n\n /**\n * @notice Initializes the contract\n * @param _owner Address of the contract owner\n * @param _beneficiary Address of the beneficiary of locked tokens\n * @param _managedAmount Amount of tokens to be managed by the lock contract\n * @param _startTime Start time of the release schedule\n * @param _endTime End time of the release schedule\n * @param _periods Number of periods between start time and end time\n * @param _releaseStartTime Override time for when the releases start\n * @param _vestingCliffTime Override time for when the vesting start\n * @param _revocable Whether the contract is revocable\n */\n function _initialize(\n address _owner,\n address _beneficiary,\n address _token,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n Revocability _revocable\n ) internal {\n require(!isInitialized, \"Already initialized\");\n require(_owner != address(0), \"Owner cannot be zero\");\n require(_beneficiary != address(0), \"Beneficiary cannot be zero\");\n require(_token != address(0), \"Token cannot be zero\");\n require(_managedAmount > 0, \"Managed tokens cannot be zero\");\n require(_startTime != 0, \"Start time must be set\");\n require(_startTime < _endTime, \"Start time > end time\");\n require(_periods >= MIN_PERIOD, \"Periods cannot be below minimum\");\n require(_revocable != Revocability.NotSet, \"Must set a revocability option\");\n require(_releaseStartTime < _endTime, \"Release start time must be before end time\");\n require(_vestingCliffTime < _endTime, \"Cliff time must be before end time\");\n\n isInitialized = true;\n\n OwnableInitializable._initialize(_owner);\n beneficiary = _beneficiary;\n token = IERC20(_token);\n\n managedAmount = _managedAmount;\n\n startTime = _startTime;\n endTime = _endTime;\n periods = _periods;\n\n // Optionals\n releaseStartTime = _releaseStartTime;\n vestingCliffTime = _vestingCliffTime;\n revocable = _revocable;\n }\n\n /**\n * @notice Change the beneficiary of funds managed by the contract\n * @dev Can only be called by the beneficiary\n * @param _newBeneficiary Address of the new beneficiary address\n */\n function changeBeneficiary(address _newBeneficiary) external onlyBeneficiary {\n require(_newBeneficiary != address(0), \"Empty beneficiary\");\n beneficiary = _newBeneficiary;\n emit BeneficiaryChanged(_newBeneficiary);\n }\n\n /**\n * @notice Beneficiary accepts the lock, the owner cannot retrieve back the tokens\n * @dev Can only be called by the beneficiary\n */\n function acceptLock() external onlyBeneficiary {\n isAccepted = true;\n emit LockAccepted();\n }\n\n /**\n * @notice Owner cancel the lock and return the balance in the contract\n * @dev Can only be called by the owner\n */\n function cancelLock() external onlyOwner {\n require(isAccepted == false, \"Cannot cancel accepted contract\");\n\n token.safeTransfer(owner(), currentBalance());\n\n emit LockCanceled();\n }\n\n // -- Balances --\n\n /**\n * @notice Returns the amount of tokens currently held by the contract\n * @return Tokens held in the contract\n */\n function currentBalance() public view override returns (uint256) {\n return token.balanceOf(address(this));\n }\n\n // -- Time & Periods --\n\n /**\n * @notice Returns the current block timestamp\n * @return Current block timestamp\n */\n function currentTime() public view override returns (uint256) {\n return block.timestamp;\n }\n\n /**\n * @notice Gets duration of contract from start to end in seconds\n * @return Amount of seconds from contract startTime to endTime\n */\n function duration() public view override returns (uint256) {\n return endTime.sub(startTime);\n }\n\n /**\n * @notice Gets time elapsed since the start of the contract\n * @dev Returns zero if called before conctract starTime\n * @return Seconds elapsed from contract startTime\n */\n function sinceStartTime() public view override returns (uint256) {\n uint256 current = currentTime();\n if (current <= startTime) {\n return 0;\n }\n return current.sub(startTime);\n }\n\n /**\n * @notice Returns amount available to be released after each period according to schedule\n * @return Amount of tokens available after each period\n */\n function amountPerPeriod() public view override returns (uint256) {\n return managedAmount.div(periods);\n }\n\n /**\n * @notice Returns the duration of each period in seconds\n * @return Duration of each period in seconds\n */\n function periodDuration() public view override returns (uint256) {\n return duration().div(periods);\n }\n\n /**\n * @notice Gets the current period based on the schedule\n * @return A number that represents the current period\n */\n function currentPeriod() public view override returns (uint256) {\n return sinceStartTime().div(periodDuration()).add(MIN_PERIOD);\n }\n\n /**\n * @notice Gets the number of periods that passed since the first period\n * @return A number of periods that passed since the schedule started\n */\n function passedPeriods() public view override returns (uint256) {\n return currentPeriod().sub(MIN_PERIOD);\n }\n\n // -- Locking & Release Schedule --\n\n /**\n * @notice Gets the currently available token according to the schedule\n * @dev Implements the step-by-step schedule based on periods for available tokens\n * @return Amount of tokens available according to the schedule\n */\n function availableAmount() public view override returns (uint256) {\n uint256 current = currentTime();\n\n // Before contract start no funds are available\n if (current < startTime) {\n return 0;\n }\n\n // After contract ended all funds are available\n if (current > endTime) {\n return managedAmount;\n }\n\n // Get available amount based on period\n return passedPeriods().mul(amountPerPeriod());\n }\n\n /**\n * @notice Gets the amount of currently vested tokens\n * @dev Similar to available amount, but is fully vested when contract is non-revocable\n * @return Amount of tokens already vested\n */\n function vestedAmount() public view override returns (uint256) {\n // If non-revocable it is fully vested\n if (revocable == Revocability.Disabled) {\n return managedAmount;\n }\n\n // Vesting cliff is activated and it has not passed means nothing is vested yet\n if (vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\n return 0;\n }\n\n return availableAmount();\n }\n\n /**\n * @notice Gets tokens currently available for release\n * @dev Considers the schedule and takes into account already released tokens\n * @return Amount of tokens ready to be released\n */\n function releasableAmount() public view virtual override returns (uint256) {\n // If a release start time is set no tokens are available for release before this date\n // If not set it follows the default schedule and tokens are available on\n // the first period passed\n if (releaseStartTime > 0 && currentTime() < releaseStartTime) {\n return 0;\n }\n\n // Vesting cliff is activated and it has not passed means nothing is vested yet\n // so funds cannot be released\n if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\n return 0;\n }\n\n // A beneficiary can never have more releasable tokens than the contract balance\n uint256 releasable = availableAmount().sub(releasedAmount);\n return MathUtils.min(currentBalance(), releasable);\n }\n\n /**\n * @notice Gets the outstanding amount yet to be released based on the whole contract lifetime\n * @dev Does not consider schedule but just global amounts tracked\n * @return Amount of outstanding tokens for the lifetime of the contract\n */\n function totalOutstandingAmount() public view override returns (uint256) {\n return managedAmount.sub(releasedAmount).sub(revokedAmount);\n }\n\n /**\n * @notice Gets surplus amount in the contract based on outstanding amount to release\n * @dev All funds over outstanding amount is considered surplus that can be withdrawn by beneficiary.\n * Note this might not be the correct value for wallets transferred to L2 (i.e. an L2GraphTokenLockWallet), as the released amount will be\n * skewed, so the beneficiary might have to bridge back to L1 to release the surplus.\n * @return Amount of tokens considered as surplus\n */\n function surplusAmount() public view override returns (uint256) {\n uint256 balance = currentBalance();\n uint256 outstandingAmount = totalOutstandingAmount();\n if (balance > outstandingAmount) {\n return balance.sub(outstandingAmount);\n }\n return 0;\n }\n\n // -- Value Transfer --\n\n /**\n * @notice Releases tokens based on the configured schedule\n * @dev All available releasable tokens are transferred to beneficiary\n */\n function release() external override onlyBeneficiary {\n uint256 amountToRelease = releasableAmount();\n require(amountToRelease > 0, \"No available releasable amount\");\n\n releasedAmount = releasedAmount.add(amountToRelease);\n\n token.safeTransfer(beneficiary, amountToRelease);\n\n emit TokensReleased(beneficiary, amountToRelease);\n }\n\n /**\n * @notice Withdraws surplus, unmanaged tokens from the contract\n * @dev Tokens in the contract over outstanding amount are considered as surplus\n * @param _amount Amount of tokens to withdraw\n */\n function withdrawSurplus(uint256 _amount) external override onlyBeneficiary {\n require(_amount > 0, \"Amount cannot be zero\");\n require(surplusAmount() >= _amount, \"Amount requested > surplus available\");\n\n token.safeTransfer(beneficiary, _amount);\n\n emit TokensWithdrawn(beneficiary, _amount);\n }\n\n /**\n * @notice Revokes a vesting schedule and return the unvested tokens to the owner\n * @dev Vesting schedule is always calculated based on managed tokens\n */\n function revoke() external override onlyOwner {\n require(revocable == Revocability.Enabled, \"Contract is non-revocable\");\n require(isRevoked == false, \"Already revoked\");\n\n uint256 unvestedAmount = managedAmount.sub(vestedAmount());\n require(unvestedAmount > 0, \"No available unvested amount\");\n\n revokedAmount = unvestedAmount;\n isRevoked = true;\n\n token.safeTransfer(owner(), unvestedAmount);\n\n emit TokensRevoked(beneficiary, unvestedAmount);\n }\n}\n" + }, + "contracts/GraphTokenLockManager.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\";\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"@openzeppelin/contracts/utils/EnumerableSet.sol\";\nimport { Ownable } from \"@openzeppelin/contracts/access/Ownable.sol\";\n\nimport \"./MinimalProxyFactory.sol\";\nimport \"./IGraphTokenLockManager.sol\";\nimport { GraphTokenLockWallet } from \"./GraphTokenLockWallet.sol\";\n\n/**\n * @title GraphTokenLockManager\n * @notice This contract manages a list of authorized function calls and targets that can be called\n * by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts.\n *\n * This contract receives funds to make the process of creating TokenLockWallet contracts\n * easier by distributing them the initial tokens to be managed.\n *\n * The owner can setup a list of token destinations that will be used by TokenLock contracts to\n * approve the pulling of funds, this way in can be guaranteed that only protocol contracts\n * will manipulate users funds.\n */\ncontract GraphTokenLockManager is Ownable, MinimalProxyFactory, IGraphTokenLockManager {\n using SafeERC20 for IERC20;\n using EnumerableSet for EnumerableSet.AddressSet;\n\n // -- State --\n\n mapping(bytes4 => address) public authFnCalls;\n EnumerableSet.AddressSet private _tokenDestinations;\n\n address public masterCopy;\n IERC20 internal _token;\n\n // -- Events --\n\n event MasterCopyUpdated(address indexed masterCopy);\n event TokenLockCreated(\n address indexed contractAddress,\n bytes32 indexed initHash,\n address indexed beneficiary,\n address token,\n uint256 managedAmount,\n uint256 startTime,\n uint256 endTime,\n uint256 periods,\n uint256 releaseStartTime,\n uint256 vestingCliffTime,\n IGraphTokenLock.Revocability revocable\n );\n\n event TokensDeposited(address indexed sender, uint256 amount);\n event TokensWithdrawn(address indexed sender, uint256 amount);\n\n event FunctionCallAuth(address indexed caller, bytes4 indexed sigHash, address indexed target, string signature);\n event TokenDestinationAllowed(address indexed dst, bool allowed);\n\n /**\n * Constructor.\n * @param _graphToken Token to use for deposits and withdrawals\n * @param _masterCopy Address of the master copy to use to clone proxies\n */\n constructor(IERC20 _graphToken, address _masterCopy) {\n require(address(_graphToken) != address(0), \"Token cannot be zero\");\n _token = _graphToken;\n setMasterCopy(_masterCopy);\n }\n\n // -- Factory --\n\n /**\n * @notice Sets the masterCopy bytecode to use to create clones of TokenLock contracts\n * @param _masterCopy Address of contract bytecode to factory clone\n */\n function setMasterCopy(address _masterCopy) public override onlyOwner {\n require(_masterCopy != address(0), \"MasterCopy cannot be zero\");\n masterCopy = _masterCopy;\n emit MasterCopyUpdated(_masterCopy);\n }\n\n /**\n * @notice Creates and fund a new token lock wallet using a minimum proxy\n * @param _owner Address of the contract owner\n * @param _beneficiary Address of the beneficiary of locked tokens\n * @param _managedAmount Amount of tokens to be managed by the lock contract\n * @param _startTime Start time of the release schedule\n * @param _endTime End time of the release schedule\n * @param _periods Number of periods between start time and end time\n * @param _releaseStartTime Override time for when the releases start\n * @param _revocable Whether the contract is revocable\n */\n function createTokenLockWallet(\n address _owner,\n address _beneficiary,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n IGraphTokenLock.Revocability _revocable\n ) external override onlyOwner {\n require(_token.balanceOf(address(this)) >= _managedAmount, \"Not enough tokens to create lock\");\n\n // Create contract using a minimal proxy and call initializer\n bytes memory initializer = abi.encodeWithSelector(\n GraphTokenLockWallet.initialize.selector,\n address(this),\n _owner,\n _beneficiary,\n address(_token),\n _managedAmount,\n _startTime,\n _endTime,\n _periods,\n _releaseStartTime,\n _vestingCliffTime,\n _revocable\n );\n address contractAddress = _deployProxy2(keccak256(initializer), masterCopy, initializer);\n\n // Send managed amount to the created contract\n _token.safeTransfer(contractAddress, _managedAmount);\n\n emit TokenLockCreated(\n contractAddress,\n keccak256(initializer),\n _beneficiary,\n address(_token),\n _managedAmount,\n _startTime,\n _endTime,\n _periods,\n _releaseStartTime,\n _vestingCliffTime,\n _revocable\n );\n }\n\n // -- Funds Management --\n\n /**\n * @notice Gets the GRT token address\n * @return Token used for transfers and approvals\n */\n function token() external view override returns (IERC20) {\n return _token;\n }\n\n /**\n * @notice Deposits tokens into the contract\n * @dev Even if the ERC20 token can be transferred directly to the contract\n * this function provide a safe interface to do the transfer and avoid mistakes\n * @param _amount Amount to deposit\n */\n function deposit(uint256 _amount) external override {\n require(_amount > 0, \"Amount cannot be zero\");\n _token.safeTransferFrom(msg.sender, address(this), _amount);\n emit TokensDeposited(msg.sender, _amount);\n }\n\n /**\n * @notice Withdraws tokens from the contract\n * @dev Escape hatch in case of mistakes or to recover remaining funds\n * @param _amount Amount of tokens to withdraw\n */\n function withdraw(uint256 _amount) external override onlyOwner {\n require(_amount > 0, \"Amount cannot be zero\");\n _token.safeTransfer(msg.sender, _amount);\n emit TokensWithdrawn(msg.sender, _amount);\n }\n\n // -- Token Destinations --\n\n /**\n * @notice Adds an address that can be allowed by a token lock to pull funds\n * @param _dst Destination address\n */\n function addTokenDestination(address _dst) external override onlyOwner {\n require(_dst != address(0), \"Destination cannot be zero\");\n require(_tokenDestinations.add(_dst), \"Destination already added\");\n emit TokenDestinationAllowed(_dst, true);\n }\n\n /**\n * @notice Removes an address that can be allowed by a token lock to pull funds\n * @param _dst Destination address\n */\n function removeTokenDestination(address _dst) external override onlyOwner {\n require(_tokenDestinations.remove(_dst), \"Destination already removed\");\n emit TokenDestinationAllowed(_dst, false);\n }\n\n /**\n * @notice Returns True if the address is authorized to be a destination of tokens\n * @param _dst Destination address\n * @return True if authorized\n */\n function isTokenDestination(address _dst) external view override returns (bool) {\n return _tokenDestinations.contains(_dst);\n }\n\n /**\n * @notice Returns an array of authorized destination addresses\n * @return Array of addresses authorized to pull funds from a token lock\n */\n function getTokenDestinations() external view override returns (address[] memory) {\n address[] memory dstList = new address[](_tokenDestinations.length());\n for (uint256 i = 0; i < _tokenDestinations.length(); i++) {\n dstList[i] = _tokenDestinations.at(i);\n }\n return dstList;\n }\n\n // -- Function Call Authorization --\n\n /**\n * @notice Sets an authorized function call to target\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\n * @param _signature Function signature\n * @param _target Address of the destination contract to call\n */\n function setAuthFunctionCall(string calldata _signature, address _target) external override onlyOwner {\n _setAuthFunctionCall(_signature, _target);\n }\n\n /**\n * @notice Unsets an authorized function call to target\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\n * @param _signature Function signature\n */\n function unsetAuthFunctionCall(string calldata _signature) external override onlyOwner {\n bytes4 sigHash = _toFunctionSigHash(_signature);\n authFnCalls[sigHash] = address(0);\n\n emit FunctionCallAuth(msg.sender, sigHash, address(0), _signature);\n }\n\n /**\n * @notice Sets an authorized function call to target in bulk\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\n * @param _signatures Function signatures\n * @param _targets Address of the destination contract to call\n */\n function setAuthFunctionCallMany(\n string[] calldata _signatures,\n address[] calldata _targets\n ) external override onlyOwner {\n require(_signatures.length == _targets.length, \"Array length mismatch\");\n\n for (uint256 i = 0; i < _signatures.length; i++) {\n _setAuthFunctionCall(_signatures[i], _targets[i]);\n }\n }\n\n /**\n * @notice Sets an authorized function call to target\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\n * @dev Function signatures of Graph Protocol contracts to be used are known ahead of time\n * @param _signature Function signature\n * @param _target Address of the destination contract to call\n */\n function _setAuthFunctionCall(string calldata _signature, address _target) internal {\n require(_target != address(this), \"Target must be other contract\");\n require(Address.isContract(_target), \"Target must be a contract\");\n\n bytes4 sigHash = _toFunctionSigHash(_signature);\n authFnCalls[sigHash] = _target;\n\n emit FunctionCallAuth(msg.sender, sigHash, _target, _signature);\n }\n\n /**\n * @notice Gets the target contract to call for a particular function signature\n * @param _sigHash Function signature hash\n * @return Address of the target contract where to send the call\n */\n function getAuthFunctionCallTarget(bytes4 _sigHash) public view override returns (address) {\n return authFnCalls[_sigHash];\n }\n\n /**\n * @notice Returns true if the function call is authorized\n * @param _sigHash Function signature hash\n * @return True if authorized\n */\n function isAuthFunctionCall(bytes4 _sigHash) external view override returns (bool) {\n return getAuthFunctionCallTarget(_sigHash) != address(0);\n }\n\n /**\n * @dev Converts a function signature string to 4-bytes hash\n * @param _signature Function signature string\n * @return Function signature hash\n */\n function _toFunctionSigHash(string calldata _signature) internal pure returns (bytes4) {\n return _convertToBytes4(abi.encodeWithSignature(_signature));\n }\n\n /**\n * @dev Converts function signature bytes to function signature hash (bytes4)\n * @param _signature Function signature\n * @return Function signature in bytes4\n */\n function _convertToBytes4(bytes memory _signature) internal pure returns (bytes4) {\n require(_signature.length == 4, \"Invalid method signature\");\n bytes4 sigHash;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n sigHash := mload(add(_signature, 32))\n }\n return sigHash;\n }\n}\n" + }, + "contracts/GraphTokenLockSimple.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport \"./GraphTokenLock.sol\";\n\n/**\n * @title GraphTokenLockSimple\n * @notice This contract is the concrete simple implementation built on top of the base\n * GraphTokenLock functionality for use when we only need the token lock schedule\n * features but no interaction with the network.\n *\n * This contract is designed to be deployed without the use of a TokenManager.\n */\ncontract GraphTokenLockSimple is GraphTokenLock {\n // Constructor\n constructor() {\n OwnableInitializable._initialize(msg.sender);\n }\n\n // Initializer\n function initialize(\n address _owner,\n address _beneficiary,\n address _token,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n Revocability _revocable\n ) external onlyOwner {\n _initialize(\n _owner,\n _beneficiary,\n _token,\n _managedAmount,\n _startTime,\n _endTime,\n _periods,\n _releaseStartTime,\n _vestingCliffTime,\n _revocable\n );\n }\n}\n" + }, + "contracts/GraphTokenLockWallet.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"@openzeppelin/contracts/math/SafeMath.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\nimport \"./GraphTokenLock.sol\";\nimport \"./IGraphTokenLockManager.sol\";\n\n/**\n * @title GraphTokenLockWallet\n * @notice This contract is built on top of the base GraphTokenLock functionality.\n * It allows wallet beneficiaries to use the deposited funds to perform specific function calls\n * on specific contracts.\n *\n * The idea is that supporters with locked tokens can participate in the protocol\n * but disallow any release before the vesting/lock schedule.\n * The beneficiary can issue authorized function calls to this contract that will\n * get forwarded to a target contract. A target contract is any of our protocol contracts.\n * The function calls allowed are queried to the GraphTokenLockManager, this way\n * the same configuration can be shared for all the created lock wallet contracts.\n *\n * NOTE: Contracts used as target must have its function signatures checked to avoid collisions\n * with any of this contract functions.\n * Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience\n * the maximum amount of tokens is authorized.\n * Function calls do not forward ETH value so DO NOT SEND ETH TO THIS CONTRACT.\n */\ncontract GraphTokenLockWallet is GraphTokenLock {\n using SafeMath for uint256;\n\n // -- State --\n\n IGraphTokenLockManager public manager;\n uint256 public usedAmount;\n\n // -- Events --\n\n event ManagerUpdated(address indexed _oldManager, address indexed _newManager);\n event TokenDestinationsApproved();\n event TokenDestinationsRevoked();\n\n // Initializer\n function initialize(\n address _manager,\n address _owner,\n address _beneficiary,\n address _token,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n Revocability _revocable\n ) external {\n _initialize(\n _owner,\n _beneficiary,\n _token,\n _managedAmount,\n _startTime,\n _endTime,\n _periods,\n _releaseStartTime,\n _vestingCliffTime,\n _revocable\n );\n _setManager(_manager);\n }\n\n // -- Admin --\n\n /**\n * @notice Sets a new manager for this contract\n * @param _newManager Address of the new manager\n */\n function setManager(address _newManager) external onlyOwner {\n _setManager(_newManager);\n }\n\n /**\n * @dev Sets a new manager for this contract\n * @param _newManager Address of the new manager\n */\n function _setManager(address _newManager) internal {\n require(_newManager != address(0), \"Manager cannot be empty\");\n require(Address.isContract(_newManager), \"Manager must be a contract\");\n\n address oldManager = address(manager);\n manager = IGraphTokenLockManager(_newManager);\n\n emit ManagerUpdated(oldManager, _newManager);\n }\n\n // -- Beneficiary --\n\n /**\n * @notice Approves protocol access of the tokens managed by this contract\n * @dev Approves all token destinations registered in the manager to pull tokens\n */\n function approveProtocol() external onlyBeneficiary {\n address[] memory dstList = manager.getTokenDestinations();\n for (uint256 i = 0; i < dstList.length; i++) {\n // Note this is only safe because we are using the max uint256 value\n token.approve(dstList[i], type(uint256).max);\n }\n emit TokenDestinationsApproved();\n }\n\n /**\n * @notice Revokes protocol access of the tokens managed by this contract\n * @dev Revokes approval to all token destinations in the manager to pull tokens\n */\n function revokeProtocol() external onlyBeneficiary {\n address[] memory dstList = manager.getTokenDestinations();\n for (uint256 i = 0; i < dstList.length; i++) {\n // Note this is only safe cause we're using 0 as the amount\n token.approve(dstList[i], 0);\n }\n emit TokenDestinationsRevoked();\n }\n\n /**\n * @notice Gets tokens currently available for release\n * @dev Considers the schedule, takes into account already released tokens and used amount\n * @return Amount of tokens ready to be released\n */\n function releasableAmount() public view override returns (uint256) {\n if (revocable == Revocability.Disabled) {\n return super.releasableAmount();\n }\n\n // -- Revocability enabled logic\n // This needs to deal with additional considerations for when tokens are used in the protocol\n\n // If a release start time is set no tokens are available for release before this date\n // If not set it follows the default schedule and tokens are available on\n // the first period passed\n if (releaseStartTime > 0 && currentTime() < releaseStartTime) {\n return 0;\n }\n\n // Vesting cliff is activated and it has not passed means nothing is vested yet\n // so funds cannot be released\n if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\n return 0;\n }\n\n // A beneficiary can never have more releasable tokens than the contract balance\n // We consider the `usedAmount` in the protocol as part of the calculations\n // the beneficiary should not release funds that are used.\n uint256 releasable = availableAmount().sub(releasedAmount).sub(usedAmount);\n return MathUtils.min(currentBalance(), releasable);\n }\n\n /**\n * @notice Forward authorized contract calls to protocol contracts\n * @dev Fallback function can be called by the beneficiary only if function call is allowed\n */\n // solhint-disable-next-line no-complex-fallback\n fallback() external payable {\n // Only beneficiary can forward calls\n require(msg.sender == beneficiary, \"Unauthorized caller\");\n require(msg.value == 0, \"ETH transfers not supported\");\n\n // Function call validation\n address _target = manager.getAuthFunctionCallTarget(msg.sig);\n require(_target != address(0), \"Unauthorized function\");\n\n uint256 oldBalance = currentBalance();\n\n // Call function with data\n Address.functionCall(_target, msg.data);\n\n // Tracked used tokens in the protocol\n // We do this check after balances were updated by the forwarded call\n // Check is only enforced for revocable contracts to save some gas\n if (revocable == Revocability.Enabled) {\n // Track contract balance change\n uint256 newBalance = currentBalance();\n if (newBalance < oldBalance) {\n // Outflow\n uint256 diff = oldBalance.sub(newBalance);\n usedAmount = usedAmount.add(diff);\n } else {\n // Inflow: We can receive profits from the protocol, that could make usedAmount to\n // underflow. We set it to zero in that case.\n uint256 diff = newBalance.sub(oldBalance);\n usedAmount = (diff >= usedAmount) ? 0 : usedAmount.sub(diff);\n }\n require(usedAmount <= vestedAmount(), \"Cannot use more tokens than vested amount\");\n }\n }\n\n /**\n * @notice Receive function that always reverts.\n * @dev Only included to supress warnings, see https://github.com/ethereum/solidity/issues/10159\n */\n receive() external payable {\n revert(\"Bad call\");\n }\n}\n" + }, + "contracts/ICallhookReceiver.sol": { + "content": "// SPDX-License-Identifier: GPL-2.0-or-later\n\n// Copied from graphprotocol/contracts, changed solidity version to 0.7.3\n\n/**\n * @title Interface for contracts that can receive callhooks through the Arbitrum GRT bridge\n * @dev Any contract that can receive a callhook on L2, sent through the bridge from L1, must\n * be allowlisted by the governor, but also implement this interface that contains\n * the function that will actually be called by the L2GraphTokenGateway.\n */\npragma solidity ^0.7.3;\n\ninterface ICallhookReceiver {\n /**\n * @notice Receive tokens with a callhook from the bridge\n * @param _from Token sender in L1\n * @param _amount Amount of tokens that were transferred\n * @param _data ABI-encoded callhook data\n */\n function onTokenTransfer(address _from, uint256 _amount, bytes calldata _data) external;\n}\n" + }, + "contracts/IGraphTokenLock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\ninterface IGraphTokenLock {\n enum Revocability {\n NotSet,\n Enabled,\n Disabled\n }\n\n // -- Balances --\n\n function currentBalance() external view returns (uint256);\n\n // -- Time & Periods --\n\n function currentTime() external view returns (uint256);\n\n function duration() external view returns (uint256);\n\n function sinceStartTime() external view returns (uint256);\n\n function amountPerPeriod() external view returns (uint256);\n\n function periodDuration() external view returns (uint256);\n\n function currentPeriod() external view returns (uint256);\n\n function passedPeriods() external view returns (uint256);\n\n // -- Locking & Release Schedule --\n\n function availableAmount() external view returns (uint256);\n\n function vestedAmount() external view returns (uint256);\n\n function releasableAmount() external view returns (uint256);\n\n function totalOutstandingAmount() external view returns (uint256);\n\n function surplusAmount() external view returns (uint256);\n\n // -- Value Transfer --\n\n function release() external;\n\n function withdrawSurplus(uint256 _amount) external;\n\n function revoke() external;\n}\n" + }, + "contracts/IGraphTokenLockManager.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\nimport \"./IGraphTokenLock.sol\";\n\ninterface IGraphTokenLockManager {\n // -- Factory --\n\n function setMasterCopy(address _masterCopy) external;\n\n function createTokenLockWallet(\n address _owner,\n address _beneficiary,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n IGraphTokenLock.Revocability _revocable\n ) external;\n\n // -- Funds Management --\n\n function token() external returns (IERC20);\n\n function deposit(uint256 _amount) external;\n\n function withdraw(uint256 _amount) external;\n\n // -- Allowed Funds Destinations --\n\n function addTokenDestination(address _dst) external;\n\n function removeTokenDestination(address _dst) external;\n\n function isTokenDestination(address _dst) external view returns (bool);\n\n function getTokenDestinations() external view returns (address[] memory);\n\n // -- Function Call Authorization --\n\n function setAuthFunctionCall(string calldata _signature, address _target) external;\n\n function unsetAuthFunctionCall(string calldata _signature) external;\n\n function setAuthFunctionCallMany(string[] calldata _signatures, address[] calldata _targets) external;\n\n function getAuthFunctionCallTarget(bytes4 _sigHash) external view returns (address);\n\n function isAuthFunctionCall(bytes4 _sigHash) external view returns (bool);\n}\n" + }, + "contracts/L1GraphTokenLockTransferTool.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport { AddressUpgradeable } from \"@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol\";\nimport { ITokenGateway } from \"./arbitrum/ITokenGateway.sol\";\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport { L2GraphTokenLockManager } from \"./L2GraphTokenLockManager.sol\";\nimport { GraphTokenLockWallet } from \"./GraphTokenLockWallet.sol\";\nimport { MinimalProxyFactory } from \"./MinimalProxyFactory.sol\";\nimport { IGraphTokenLock } from \"./IGraphTokenLock.sol\";\nimport { Ownable as OwnableInitializable } from \"./Ownable.sol\";\nimport { SafeMathUpgradeable } from \"@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol\";\nimport { Initializable } from \"@openzeppelin/contracts-upgradeable/proxy/Initializable.sol\";\n\n/**\n * @title L1GraphTokenLockTransferTool contract\n * @notice This contract is used to transfer GRT from GraphTokenLockWallets\n * to a counterpart on L2. It is deployed on L1 and will send the GRT through\n * the L1GraphTokenGateway with a callhook to the L2GraphTokenLockManager, including\n * data to create a L2GraphTokenLockWallet on L2.\n *\n * Note that the L2GraphTokenLockWallet will not allow releasing any GRT until the end of\n * the vesting timeline, but will allow sending the GRT back to the L1 wallet.\n *\n * Beneficiaries for a GraphTokenLockWallet can perform the depositToL2Locked call\n * as many times as they want, and the GRT will be sent to the same L2GraphTokenLockWallet.\n *\n * Since all retryable tickets to send transactions to L2 require ETH for gas, this\n * contract also allows users to deposit ETH to be used for gas on L2, both for\n * the depositToL2Locked calls and for the transfer tools in the Staking contract for\n * The Graph.\n *\n * See GIP-0046 for more details: https://forum.thegraph.com/t/4023\n */\ncontract L1GraphTokenLockTransferTool is OwnableInitializable, Initializable, MinimalProxyFactory {\n using SafeMathUpgradeable for uint256;\n\n /// Address of the L1 GRT token contract\n IERC20 public immutable graphToken;\n /// Address of the L2GraphTokenLockWallet implementation in L2, used to compute L2 wallet addresses\n address public immutable l2Implementation;\n /// Address of the L1GraphTokenGateway contract\n ITokenGateway public immutable l1Gateway;\n /// Address of the Staking contract, used to pull ETH for L2 ticket gas\n address payable public immutable staking;\n /// L2 lock manager for each L1 lock manager.\n /// L1 GraphTokenLockManager => L2GraphTokenLockManager\n mapping(address => address) public l2LockManager;\n /// L2 wallet owner for each L1 wallet owner.\n /// L1 wallet owner => L2 wallet owner\n mapping(address => address) public l2WalletOwner;\n /// L2 wallet address for each L1 wallet address.\n /// L1 wallet => L2 wallet\n mapping(address => address) public l2WalletAddress;\n /// ETH balance from each token lock, used to pay for L2 gas:\n /// L1 wallet address => ETH balance\n mapping(address => uint256) public tokenLockETHBalances;\n /// L2 beneficiary corresponding to each L1 wallet address.\n /// L1 wallet => L2 beneficiary\n mapping(address => address) public l2Beneficiary;\n /// Indicates whether an L2 wallet address for a wallet\n /// has been set manually, in which case it can't call depositToL2Locked.\n /// L1 wallet => bool\n mapping(address => bool) public l2WalletAddressSetManually;\n\n /// @dev Emitted when the L2 lock manager for an L1 lock manager is set\n event L2LockManagerSet(address indexed l1LockManager, address indexed l2LockManager);\n /// @dev Emitted when the L2 wallet owner for an L1 wallet owner is set\n event L2WalletOwnerSet(address indexed l1WalletOwner, address indexed l2WalletOwner);\n /// @dev Emitted when GRT is sent to L2 from a token lock\n event LockedFundsSentToL2(\n address indexed l1Wallet,\n address indexed l2Wallet,\n address indexed l1LockManager,\n address l2LockManager,\n uint256 amount\n );\n /// @dev Emitted when an L2 wallet address is set for an L1 wallet\n event L2WalletAddressSet(address indexed l1Wallet, address indexed l2Wallet);\n /// @dev Emitted when ETH is deposited to a token lock's account\n event ETHDeposited(address indexed tokenLock, uint256 amount);\n /// @dev Emitted when ETH is withdrawn from a token lock's account\n event ETHWithdrawn(address indexed tokenLock, address indexed destination, uint256 amount);\n /// @dev Emitted when ETH is pulled from a token lock's account by Staking or this tool to pay for an L2 ticket\n event ETHPulled(address indexed tokenLock, uint256 amount);\n /// @dev Emitted when the L2 beneficiary for a partially vested L1 lock is set\n event L2BeneficiarySet(address indexed l1Wallet, address indexed l2Beneficiary);\n\n /**\n * @notice Construct a new L1GraphTokenLockTransferTool contract\n * @dev The deployer of the contract will become its owner.\n * Note this contract is meant to be deployed behind a transparent proxy,\n * so this will run at the implementation's storage context; it will set\n * immutable variables and make the implementation be owned by the deployer.\n * @param _graphToken Address of the L1 GRT token contract\n * @param _l2Implementation Address of the L2GraphTokenLockWallet implementation in L2\n * @param _l1Gateway Address of the L1GraphTokenGateway contract\n * @param _staking Address of the Staking contract\n */\n constructor(\n IERC20 _graphToken,\n address _l2Implementation,\n ITokenGateway _l1Gateway,\n address payable _staking\n ) initializer {\n OwnableInitializable._initialize(msg.sender);\n graphToken = _graphToken;\n l2Implementation = _l2Implementation;\n l1Gateway = _l1Gateway;\n staking = _staking;\n }\n\n /**\n * @notice Initialize the L1GraphTokenLockTransferTool contract\n * @dev This function will run in the proxy's storage context, so it will\n * set the owner of the proxy contract which can be different from the implementation owner.\n * @param _owner Address of the owner of the L1GraphTokenLockTransferTool contract\n */\n function initialize(address _owner) external initializer {\n OwnableInitializable._initialize(_owner);\n }\n\n /**\n * @notice Set the L2 lock manager that corresponds to an L1 lock manager\n * @param _l1LockManager Address of the L1 lock manager\n * @param _l2LockManager Address of the L2 lock manager (in L2)\n */\n function setL2LockManager(address _l1LockManager, address _l2LockManager) external onlyOwner {\n l2LockManager[_l1LockManager] = _l2LockManager;\n emit L2LockManagerSet(_l1LockManager, _l2LockManager);\n }\n\n /**\n * @notice Set the L2 wallet owner that corresponds to an L1 wallet owner\n * @param _l1WalletOwner Address of the L1 wallet owner\n * @param _l2WalletOwner Address of the L2 wallet owner (in L2)\n */\n function setL2WalletOwner(address _l1WalletOwner, address _l2WalletOwner) external onlyOwner {\n l2WalletOwner[_l1WalletOwner] = _l2WalletOwner;\n emit L2WalletOwnerSet(_l1WalletOwner, _l2WalletOwner);\n }\n\n /**\n * @notice Deposit ETH on a token lock's account, to be used for L2 retryable ticket gas.\n * This function can be called by anyone, but the ETH will be credited to the token lock.\n * DO NOT try to call this through the token lock, as locks do not forward ETH value (and the\n * function call should not be allowlisted).\n * @param _tokenLock Address of the L1 GraphTokenLockWallet that will own the ETH\n */\n function depositETH(address _tokenLock) external payable {\n tokenLockETHBalances[_tokenLock] = tokenLockETHBalances[_tokenLock].add(msg.value);\n emit ETHDeposited(_tokenLock, msg.value);\n }\n\n /**\n * @notice Withdraw ETH from a token lock's account.\n * This function must be called from the token lock contract, but the destination\n * _must_ be a different address, as any ETH sent to the token lock would otherwise be\n * lost.\n * @param _destination Address to send the ETH\n * @param _amount Amount of ETH to send\n */\n function withdrawETH(address _destination, uint256 _amount) external {\n require(_amount > 0, \"INVALID_AMOUNT\");\n // We can't send eth to a token lock or it will be stuck\n require(msg.sender != _destination, \"INVALID_DESTINATION\");\n require(tokenLockETHBalances[msg.sender] >= _amount, \"INSUFFICIENT_BALANCE\");\n tokenLockETHBalances[msg.sender] -= _amount;\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, ) = payable(_destination).call{ value: _amount }(\"\");\n require(success, \"TRANSFER_FAILED\");\n emit ETHWithdrawn(msg.sender, _destination, _amount);\n }\n\n /**\n * @notice Pull ETH from a token lock's account, to be used for L2 retryable ticket gas.\n * This can only be called by the Staking contract.\n * @param _tokenLock GraphTokenLockWallet that owns the ETH that will be debited\n * @param _amount Amount of ETH to pull\n */\n function pullETH(address _tokenLock, uint256 _amount) external {\n require(msg.sender == staking, \"ONLY_STAKING\");\n require(tokenLockETHBalances[_tokenLock] >= _amount, \"INSUFFICIENT_BALANCE\");\n tokenLockETHBalances[_tokenLock] -= _amount;\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, ) = staking.call{ value: _amount }(\"\");\n require(success, \"TRANSFER_FAILED\");\n emit ETHPulled(_tokenLock, _amount);\n }\n\n /**\n * @notice Deposit GRT to L2, from a token lock in L1 to a token lock in L2.\n * If the token lock in L2 does not exist, it will be created when the message is received\n * by the L2GraphTokenLockManager.\n * Before calling this (which must be done through the token lock wallet), make sure\n * there is enough ETH in the token lock's account to cover the L2 retryable ticket gas.\n * Note that L2 submission fee and gas refunds will be lost.\n * You can add ETH to the token lock's account by calling depositETH().\n * Note that after calling this, you will NOT be able to use setL2WalletAddressManually() to\n * set an L2 wallet address, as the L2 wallet address will be set automatically when the\n * message is received by the L2GraphTokenLockManager.\n * @dev The gas parameters for L2 can be estimated using the Arbitrum SDK.\n * @param _amount Amount of GRT to deposit\n * @param _l2Beneficiary Address of the beneficiary for the token lock in L2. Must be the same for subsequent calls of this function, and not an L1 contract.\n * @param _maxGas Maximum gas to use for the L2 retryable ticket\n * @param _gasPriceBid Gas price to use for the L2 retryable ticket\n * @param _maxSubmissionCost Max submission cost for the L2 retryable ticket\n */\n function depositToL2Locked(\n uint256 _amount,\n address _l2Beneficiary,\n uint256 _maxGas,\n uint256 _gasPriceBid,\n uint256 _maxSubmissionCost\n ) external {\n // Check that msg.sender is a GraphTokenLockWallet\n // That uses GRT and has a corresponding manager set in L2.\n GraphTokenLockWallet wallet = GraphTokenLockWallet(msg.sender);\n require(wallet.token() == graphToken, \"INVALID_TOKEN\");\n address l1Manager = address(wallet.manager());\n address l2Manager = l2LockManager[l1Manager];\n require(l2Manager != address(0), \"INVALID_MANAGER\");\n require(wallet.isInitialized(), \"!INITIALIZED\");\n require(wallet.revocable() != IGraphTokenLock.Revocability.Enabled, \"REVOCABLE\");\n require(_amount <= graphToken.balanceOf(msg.sender), \"INSUFFICIENT_BALANCE\");\n require(_amount != 0, \"ZERO_AMOUNT\");\n\n if (l2Beneficiary[msg.sender] == address(0)) {\n require(_l2Beneficiary != address(0), \"INVALID_BENEFICIARY_ZERO\");\n require(!AddressUpgradeable.isContract(_l2Beneficiary), \"INVALID_BENEFICIARY_CONTRACT\");\n l2Beneficiary[msg.sender] = _l2Beneficiary;\n emit L2BeneficiarySet(msg.sender, _l2Beneficiary);\n } else {\n require(l2Beneficiary[msg.sender] == _l2Beneficiary, \"INVALID_BENEFICIARY\");\n }\n\n uint256 expectedEth = _maxSubmissionCost.add(_maxGas.mul(_gasPriceBid));\n require(tokenLockETHBalances[msg.sender] >= expectedEth, \"INSUFFICIENT_ETH_BALANCE\");\n tokenLockETHBalances[msg.sender] -= expectedEth;\n\n bytes memory encodedData;\n {\n address l2Owner = l2WalletOwner[wallet.owner()];\n require(l2Owner != address(0), \"L2_OWNER_NOT_SET\");\n // Extract all the storage variables from the GraphTokenLockWallet\n L2GraphTokenLockManager.TransferredWalletData memory data = L2GraphTokenLockManager.TransferredWalletData({\n l1Address: msg.sender,\n owner: l2Owner,\n beneficiary: l2Beneficiary[msg.sender],\n managedAmount: wallet.managedAmount(),\n startTime: wallet.startTime(),\n endTime: wallet.endTime()\n });\n encodedData = abi.encode(data);\n }\n\n if (l2WalletAddress[msg.sender] == address(0)) {\n require(wallet.endTime() >= block.timestamp, \"FULLY_VESTED_USE_MANUAL_ADDRESS\");\n address newAddress = getDeploymentAddress(keccak256(encodedData), l2Implementation, l2Manager);\n l2WalletAddress[msg.sender] = newAddress;\n emit L2WalletAddressSet(msg.sender, newAddress);\n } else {\n require(!l2WalletAddressSetManually[msg.sender], \"CANT_DEPOSIT_TO_MANUAL_ADDRESS\");\n }\n\n graphToken.transferFrom(msg.sender, address(this), _amount);\n\n // Send the tokens with a message through the L1GraphTokenGateway to the L2GraphTokenLockManager\n graphToken.approve(address(l1Gateway), _amount);\n {\n bytes memory transferData = abi.encode(_maxSubmissionCost, encodedData);\n l1Gateway.outboundTransfer{ value: expectedEth }(\n address(graphToken),\n l2Manager,\n _amount,\n _maxGas,\n _gasPriceBid,\n transferData\n );\n }\n emit ETHPulled(msg.sender, expectedEth);\n emit LockedFundsSentToL2(msg.sender, l2WalletAddress[msg.sender], l1Manager, l2Manager, _amount);\n }\n\n /**\n * @notice Manually set the L2 wallet address for a token lock in L1.\n * This will only work for token locks that have not been initialized in L2 yet, and\n * that are fully vested (endTime < current timestamp).\n * This address can then be used to send stake or delegation to L2 on the Staking contract.\n * After calling this, the vesting lock will NOT be allowed to use depositToL2Locked\n * to send GRT to L2, the beneficiary must withdraw the tokens and bridge them manually.\n * @param _l2Wallet Address of the L2 wallet\n */\n function setL2WalletAddressManually(address _l2Wallet) external {\n // Check that msg.sender is a GraphTokenLockWallet\n // That uses GRT and has a corresponding manager set in L2.\n GraphTokenLockWallet wallet = GraphTokenLockWallet(msg.sender);\n require(wallet.token() == graphToken, \"INVALID_TOKEN\");\n address l1Manager = address(wallet.manager());\n address l2Manager = l2LockManager[l1Manager];\n require(l2Manager != address(0), \"INVALID_MANAGER\");\n require(wallet.isInitialized(), \"!INITIALIZED\");\n\n // Check that the wallet is fully vested\n require(wallet.endTime() < block.timestamp, \"NOT_FULLY_VESTED\");\n\n // Check that the wallet has not set an L2 wallet yet\n require(l2WalletAddress[msg.sender] == address(0), \"L2_WALLET_ALREADY_SET\");\n\n // Check that the L2 address is not zero\n require(_l2Wallet != address(0), \"ZERO_ADDRESS\");\n // Set the L2 wallet address\n l2WalletAddress[msg.sender] = _l2Wallet;\n l2WalletAddressSetManually[msg.sender] = true;\n emit L2WalletAddressSet(msg.sender, _l2Wallet);\n }\n}\n" + }, + "contracts/L2GraphTokenLockManager.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport { SafeERC20 } from \"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\";\n\nimport { ICallhookReceiver } from \"./ICallhookReceiver.sol\";\nimport { GraphTokenLockManager } from \"./GraphTokenLockManager.sol\";\nimport { L2GraphTokenLockWallet } from \"./L2GraphTokenLockWallet.sol\";\n\n/**\n * @title L2GraphTokenLockManager\n * @notice This contract manages a list of authorized function calls and targets that can be called\n * by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts.\n *\n * This contract receives funds to make the process of creating TokenLockWallet contracts\n * easier by distributing them the initial tokens to be managed.\n *\n * In particular, this L2 variant is designed to receive token lock wallets from L1,\n * through the GRT bridge. These transferred wallets will not allow releasing funds in L2 until\n * the end of the vesting timeline, but they can allow withdrawing funds back to L1 using\n * the L2GraphTokenLockTransferTool contract.\n *\n * The owner can setup a list of token destinations that will be used by TokenLock contracts to\n * approve the pulling of funds, this way in can be guaranteed that only protocol contracts\n * will manipulate users funds.\n */\ncontract L2GraphTokenLockManager is GraphTokenLockManager, ICallhookReceiver {\n using SafeERC20 for IERC20;\n\n /// @dev Struct to hold the data of a transferred wallet; this is\n /// the data that must be encoded in L1 to send a wallet to L2.\n struct TransferredWalletData {\n address l1Address;\n address owner;\n address beneficiary;\n uint256 managedAmount;\n uint256 startTime;\n uint256 endTime;\n }\n\n /// Address of the L2GraphTokenGateway\n address public immutable l2Gateway;\n /// Address of the L1 transfer tool contract (in L1, no aliasing)\n address public immutable l1TransferTool;\n /// Mapping of each L1 wallet to its L2 wallet counterpart (populated when each wallet is received)\n /// L1 address => L2 address\n mapping(address => address) public l1WalletToL2Wallet;\n /// Mapping of each L2 wallet to its L1 wallet counterpart (populated when each wallet is received)\n /// L2 address => L1 address\n mapping(address => address) public l2WalletToL1Wallet;\n\n /// @dev Event emitted when a wallet is received and created from L1\n event TokenLockCreatedFromL1(\n address indexed contractAddress,\n bytes32 initHash,\n address indexed beneficiary,\n uint256 managedAmount,\n uint256 startTime,\n uint256 endTime,\n address indexed l1Address\n );\n\n /// @dev Emitted when locked tokens are received from L1 (whether the wallet\n /// had already been received or not)\n event LockedTokensReceivedFromL1(address indexed l1Address, address indexed l2Address, uint256 amount);\n\n /**\n * @dev Checks that the sender is the L2GraphTokenGateway.\n */\n modifier onlyL2Gateway() {\n require(msg.sender == l2Gateway, \"ONLY_GATEWAY\");\n _;\n }\n\n /**\n * @notice Constructor for the L2GraphTokenLockManager contract.\n * @param _graphToken Address of the L2 GRT token contract\n * @param _masterCopy Address of the master copy of the L2GraphTokenLockWallet implementation\n * @param _l2Gateway Address of the L2GraphTokenGateway contract\n * @param _l1TransferTool Address of the L1 transfer tool contract (in L1, without aliasing)\n */\n constructor(\n IERC20 _graphToken,\n address _masterCopy,\n address _l2Gateway,\n address _l1TransferTool\n ) GraphTokenLockManager(_graphToken, _masterCopy) {\n l2Gateway = _l2Gateway;\n l1TransferTool = _l1TransferTool;\n }\n\n /**\n * @notice This function is called by the L2GraphTokenGateway when tokens are sent from L1.\n * @dev This function will create a new wallet if it doesn't exist yet, or send the tokens to\n * the existing wallet if it does.\n * @param _from Address of the sender in L1, which must be the L1GraphTokenLockTransferTool\n * @param _amount Amount of tokens received\n * @param _data Encoded data of the transferred wallet, which must be an ABI-encoded TransferredWalletData struct\n */\n function onTokenTransfer(address _from, uint256 _amount, bytes calldata _data) external override onlyL2Gateway {\n require(_from == l1TransferTool, \"ONLY_TRANSFER_TOOL\");\n TransferredWalletData memory walletData = abi.decode(_data, (TransferredWalletData));\n\n if (l1WalletToL2Wallet[walletData.l1Address] != address(0)) {\n // If the wallet was already received, just send the tokens to the L2 address\n _token.safeTransfer(l1WalletToL2Wallet[walletData.l1Address], _amount);\n } else {\n // Create contract using a minimal proxy and call initializer\n (bytes32 initHash, address contractAddress) = _deployFromL1(keccak256(_data), walletData);\n l1WalletToL2Wallet[walletData.l1Address] = contractAddress;\n l2WalletToL1Wallet[contractAddress] = walletData.l1Address;\n\n // Send managed amount to the created contract\n _token.safeTransfer(contractAddress, _amount);\n\n emit TokenLockCreatedFromL1(\n contractAddress,\n initHash,\n walletData.beneficiary,\n walletData.managedAmount,\n walletData.startTime,\n walletData.endTime,\n walletData.l1Address\n );\n }\n emit LockedTokensReceivedFromL1(walletData.l1Address, l1WalletToL2Wallet[walletData.l1Address], _amount);\n }\n\n /**\n * @dev Deploy a token lock wallet with data received from L1\n * @param _salt Salt for the CREATE2 call, which must be the hash of the wallet data\n * @param _walletData Data of the wallet to be created\n * @return Hash of the initialization calldata\n * @return Address of the created contract\n */\n function _deployFromL1(bytes32 _salt, TransferredWalletData memory _walletData) internal returns (bytes32, address) {\n bytes memory initializer = _encodeInitializer(_walletData);\n address contractAddress = _deployProxy2(_salt, masterCopy, initializer);\n return (keccak256(initializer), contractAddress);\n }\n\n /**\n * @dev Encode the initializer for the token lock wallet received from L1\n * @param _walletData Data of the wallet to be created\n * @return Encoded initializer calldata, including the function signature\n */\n function _encodeInitializer(TransferredWalletData memory _walletData) internal view returns (bytes memory) {\n return\n abi.encodeWithSelector(\n L2GraphTokenLockWallet.initializeFromL1.selector,\n address(this),\n address(_token),\n _walletData\n );\n }\n}\n" + }, + "contracts/L2GraphTokenLockTransferTool.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\nimport { L2GraphTokenLockManager } from \"./L2GraphTokenLockManager.sol\";\nimport { L2GraphTokenLockWallet } from \"./L2GraphTokenLockWallet.sol\";\nimport { ITokenGateway } from \"./arbitrum/ITokenGateway.sol\";\n\n/**\n * @title L2GraphTokenLockTransferTool contract\n * @notice This contract is used to transfer GRT from L2 token lock wallets\n * back to their L1 counterparts.\n */\ncontract L2GraphTokenLockTransferTool {\n /// Address of the L2 GRT token\n IERC20 public immutable graphToken;\n /// Address of the L2GraphTokenGateway\n ITokenGateway public immutable l2Gateway;\n /// Address of the L1 GRT token (in L1, no aliasing)\n address public immutable l1GraphToken;\n\n /// @dev Emitted when GRT is sent to L1 from a token lock\n event LockedFundsSentToL1(\n address indexed l1Wallet,\n address indexed l2Wallet,\n address indexed l2LockManager,\n uint256 amount\n );\n\n /**\n * @notice Constructor for the L2GraphTokenLockTransferTool contract\n * @dev Note the L2GraphTokenLockTransferTool can be deployed behind a proxy,\n * and the constructor for the implementation will only set some immutable\n * variables.\n * @param _graphToken Address of the L2 GRT token\n * @param _l2Gateway Address of the L2GraphTokenGateway\n * @param _l1GraphToken Address of the L1 GRT token (in L1, no aliasing)\n */\n constructor(IERC20 _graphToken, ITokenGateway _l2Gateway, address _l1GraphToken) {\n graphToken = _graphToken;\n l2Gateway = _l2Gateway;\n l1GraphToken = _l1GraphToken;\n }\n\n /**\n * @notice Withdraw GRT from an L2 token lock wallet to its L1 counterpart.\n * This function must be called from an L2GraphTokenLockWallet contract.\n * The GRT will be sent to L1 and must be claimed using the Arbitrum Outbox on L1\n * after the standard Arbitrum withdrawal period (7 days).\n * @param _amount Amount of GRT to withdraw\n */\n function withdrawToL1Locked(uint256 _amount) external {\n L2GraphTokenLockWallet wallet = L2GraphTokenLockWallet(msg.sender);\n L2GraphTokenLockManager manager = L2GraphTokenLockManager(address(wallet.manager()));\n require(address(manager) != address(0), \"INVALID_SENDER\");\n address l1Wallet = manager.l2WalletToL1Wallet(msg.sender);\n require(l1Wallet != address(0), \"NOT_L1_WALLET\");\n require(_amount <= graphToken.balanceOf(msg.sender), \"INSUFFICIENT_BALANCE\");\n require(_amount != 0, \"ZERO_AMOUNT\");\n\n graphToken.transferFrom(msg.sender, address(this), _amount);\n graphToken.approve(address(l2Gateway), _amount);\n\n // Send the tokens through the L2GraphTokenGateway to the L1 wallet counterpart\n l2Gateway.outboundTransfer(l1GraphToken, l1Wallet, _amount, 0, 0, \"\");\n emit LockedFundsSentToL1(l1Wallet, msg.sender, address(manager), _amount);\n }\n}\n" + }, + "contracts/L2GraphTokenLockWallet.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\nimport { GraphTokenLockWallet } from \"./GraphTokenLockWallet.sol\";\nimport { Ownable as OwnableInitializable } from \"./Ownable.sol\";\nimport { L2GraphTokenLockManager } from \"./L2GraphTokenLockManager.sol\";\n\n/**\n * @title L2GraphTokenLockWallet\n * @notice This contract is built on top of the base GraphTokenLock functionality.\n * It allows wallet beneficiaries to use the deposited funds to perform specific function calls\n * on specific contracts.\n *\n * The idea is that supporters with locked tokens can participate in the protocol\n * but disallow any release before the vesting/lock schedule.\n * The beneficiary can issue authorized function calls to this contract that will\n * get forwarded to a target contract. A target contract is any of our protocol contracts.\n * The function calls allowed are queried to the GraphTokenLockManager, this way\n * the same configuration can be shared for all the created lock wallet contracts.\n *\n * This L2 variant includes a special initializer so that it can be created from\n * a wallet's data received from L1. These transferred wallets will not allow releasing\n * funds in L2 until the end of the vesting timeline, but they can allow withdrawing\n * funds back to L1 using the L2GraphTokenLockTransferTool contract.\n *\n * Note that surplusAmount and releasedAmount in L2 will be skewed for wallets received from L1,\n * so releasing surplus tokens might also only be possible by bridging tokens back to L1.\n *\n * NOTE: Contracts used as target must have its function signatures checked to avoid collisions\n * with any of this contract functions.\n * Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience\n * the maximum amount of tokens is authorized.\n * Function calls do not forward ETH value so DO NOT SEND ETH TO THIS CONTRACT.\n */\ncontract L2GraphTokenLockWallet is GraphTokenLockWallet {\n // Initializer when created from a message from L1\n function initializeFromL1(\n address _manager,\n address _token,\n L2GraphTokenLockManager.TransferredWalletData calldata _walletData\n ) external {\n require(!isInitialized, \"Already initialized\");\n isInitialized = true;\n\n OwnableInitializable._initialize(_walletData.owner);\n beneficiary = _walletData.beneficiary;\n token = IERC20(_token);\n\n managedAmount = _walletData.managedAmount;\n\n startTime = _walletData.startTime;\n endTime = _walletData.endTime;\n periods = 1;\n isAccepted = true;\n\n // Optionals\n releaseStartTime = _walletData.endTime;\n revocable = Revocability.Disabled;\n\n _setManager(_manager);\n }\n}\n" + }, + "contracts/MathUtils.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nlibrary MathUtils {\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n}\n" + }, + "contracts/MinimalProxyFactory.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport { Address } from \"@openzeppelin/contracts/utils/Address.sol\";\nimport { Create2 } from \"@openzeppelin/contracts/utils/Create2.sol\";\n\n/**\n * @title MinimalProxyFactory: a factory contract for creating minimal proxies\n * @notice Adapted from https://github.com/OpenZeppelin/openzeppelin-sdk/blob/v2.5.0/packages/lib/contracts/upgradeability/ProxyFactory.sol\n * Based on https://eips.ethereum.org/EIPS/eip-1167\n */\ncontract MinimalProxyFactory {\n /// @dev Emitted when a new proxy is created\n event ProxyCreated(address indexed proxy);\n\n /**\n * @notice Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation\n * @param _salt Bytes32 salt to use for CREATE2\n * @param _implementation Address of the proxy target implementation\n * @param _deployer Address of the deployer that creates the contract\n * @return Address of the counterfactual MinimalProxy\n */\n function getDeploymentAddress(\n bytes32 _salt,\n address _implementation,\n address _deployer\n ) public pure returns (address) {\n return Create2.computeAddress(_salt, keccak256(_getContractCreationCode(_implementation)), _deployer);\n }\n\n /**\n * @dev Deploys a MinimalProxy with CREATE2\n * @param _salt Bytes32 salt to use for CREATE2\n * @param _implementation Address of the proxy target implementation\n * @param _data Bytes with the initializer call\n * @return Address of the deployed MinimalProxy\n */\n function _deployProxy2(bytes32 _salt, address _implementation, bytes memory _data) internal returns (address) {\n address proxyAddress = Create2.deploy(0, _salt, _getContractCreationCode(_implementation));\n\n emit ProxyCreated(proxyAddress);\n\n // Call function with data\n if (_data.length > 0) {\n Address.functionCall(proxyAddress, _data);\n }\n\n return proxyAddress;\n }\n\n /**\n * @dev Gets the MinimalProxy bytecode\n * @param _implementation Address of the proxy target implementation\n * @return MinimalProxy bytecode\n */\n function _getContractCreationCode(address _implementation) internal pure returns (bytes memory) {\n bytes10 creation = 0x3d602d80600a3d3981f3;\n bytes10 prefix = 0x363d3d373d3d3d363d73;\n bytes20 targetBytes = bytes20(_implementation);\n bytes15 suffix = 0x5af43d82803e903d91602b57fd5bf3;\n return abi.encodePacked(creation, prefix, targetBytes, suffix);\n }\n}\n" + }, + "contracts/Ownable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * The owner account will be passed on initialization of the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\ncontract Ownable {\n /// @dev Owner of the contract, can be retrieved with the public owner() function\n address private _owner;\n /// @dev Since upgradeable contracts might inherit this, we add a storage gap\n /// to allow adding variables here without breaking the proxy storage layout\n uint256[50] private __gap;\n\n /// @dev Emitted when ownership of the contract is transferred\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n function _initialize(address owner) internal {\n _owner = owner;\n emit OwnershipTransferred(address(0), owner);\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(_owner == msg.sender, \"Ownable: caller is not the owner\");\n _;\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() external virtual onlyOwner {\n emit OwnershipTransferred(_owner, address(0));\n _owner = address(0);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) external virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n emit OwnershipTransferred(_owner, newOwner);\n _owner = newOwner;\n }\n}\n" + }, + "contracts/tests/arbitrum/AddressAliasHelper.sol": { + "content": "// SPDX-License-Identifier: Apache-2.0\n\n/*\n * Copyright 2019-2021, Offchain Labs, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * Originally copied from:\n * https://github.com/OffchainLabs/arbitrum/tree/84e64dee6ee82adbf8ec34fd4b86c207a61d9007/packages/arb-bridge-eth\n *\n * MODIFIED from Offchain Labs' implementation:\n * - Changed solidity version to 0.7.3 (pablo@edgeandnode.com)\n *\n */\n\npragma solidity ^0.7.3;\n\nlibrary AddressAliasHelper {\n uint160 constant offset = uint160(0x1111000000000000000000000000000000001111);\n\n /// @notice Utility function that converts the address in the L1 that submitted a tx to\n /// the inbox to the msg.sender viewed in the L2\n /// @param l1Address the address in the L1 that triggered the tx to L2\n /// @return l2Address L2 address as viewed in msg.sender\n function applyL1ToL2Alias(address l1Address) internal pure returns (address l2Address) {\n l2Address = address(uint160(l1Address) + offset);\n }\n\n /// @notice Utility function that converts the msg.sender viewed in the L2 to the\n /// address in the L1 that submitted a tx to the inbox\n /// @param l2Address L2 address as viewed in msg.sender\n /// @return l1Address the address in the L1 that triggered the tx to L2\n function undoL1ToL2Alias(address l2Address) internal pure returns (address l1Address) {\n l1Address = address(uint160(l2Address) - offset);\n }\n}\n" + }, + "contracts/tests/arbitrum/IBridge.sol": { + "content": "// SPDX-License-Identifier: Apache-2.0\n\n/*\n * Copyright 2021, Offchain Labs, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * Originally copied from:\n * https://github.com/OffchainLabs/arbitrum/tree/e3a6307ad8a2dc2cad35728a2a9908cfd8dd8ef9/packages/arb-bridge-eth\n *\n * MODIFIED from Offchain Labs' implementation:\n * - Changed solidity version to 0.7.3 (pablo@edgeandnode.com)\n *\n */\n\npragma solidity ^0.7.3;\n\ninterface IBridge {\n event MessageDelivered(\n uint256 indexed messageIndex,\n bytes32 indexed beforeInboxAcc,\n address inbox,\n uint8 kind,\n address sender,\n bytes32 messageDataHash\n );\n\n event BridgeCallTriggered(address indexed outbox, address indexed destAddr, uint256 amount, bytes data);\n\n event InboxToggle(address indexed inbox, bool enabled);\n\n event OutboxToggle(address indexed outbox, bool enabled);\n\n function deliverMessageToInbox(\n uint8 kind,\n address sender,\n bytes32 messageDataHash\n ) external payable returns (uint256);\n\n function executeCall(\n address destAddr,\n uint256 amount,\n bytes calldata data\n ) external returns (bool success, bytes memory returnData);\n\n // These are only callable by the admin\n function setInbox(address inbox, bool enabled) external;\n\n function setOutbox(address inbox, bool enabled) external;\n\n // View functions\n\n function activeOutbox() external view returns (address);\n\n function allowedInboxes(address inbox) external view returns (bool);\n\n function allowedOutboxes(address outbox) external view returns (bool);\n\n function inboxAccs(uint256 index) external view returns (bytes32);\n\n function messageCount() external view returns (uint256);\n}\n" + }, + "contracts/tests/arbitrum/IInbox.sol": { + "content": "// SPDX-License-Identifier: Apache-2.0\n\n/*\n * Copyright 2021, Offchain Labs, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * Originally copied from:\n * https://github.com/OffchainLabs/arbitrum/tree/e3a6307ad8a2dc2cad35728a2a9908cfd8dd8ef9/packages/arb-bridge-eth\n *\n * MODIFIED from Offchain Labs' implementation:\n * - Changed solidity version to 0.7.3 (pablo@edgeandnode.com)\n *\n */\n\npragma solidity ^0.7.3;\n\nimport \"./IBridge.sol\";\nimport \"./IMessageProvider.sol\";\n\ninterface IInbox is IMessageProvider {\n function sendL2Message(bytes calldata messageData) external returns (uint256);\n\n function sendUnsignedTransaction(\n uint256 maxGas,\n uint256 gasPriceBid,\n uint256 nonce,\n address destAddr,\n uint256 amount,\n bytes calldata data\n ) external returns (uint256);\n\n function sendContractTransaction(\n uint256 maxGas,\n uint256 gasPriceBid,\n address destAddr,\n uint256 amount,\n bytes calldata data\n ) external returns (uint256);\n\n function sendL1FundedUnsignedTransaction(\n uint256 maxGas,\n uint256 gasPriceBid,\n uint256 nonce,\n address destAddr,\n bytes calldata data\n ) external payable returns (uint256);\n\n function sendL1FundedContractTransaction(\n uint256 maxGas,\n uint256 gasPriceBid,\n address destAddr,\n bytes calldata data\n ) external payable returns (uint256);\n\n function createRetryableTicket(\n address destAddr,\n uint256 arbTxCallValue,\n uint256 maxSubmissionCost,\n address submissionRefundAddress,\n address valueRefundAddress,\n uint256 maxGas,\n uint256 gasPriceBid,\n bytes calldata data\n ) external payable returns (uint256);\n\n function depositEth(uint256 maxSubmissionCost) external payable returns (uint256);\n\n function bridge() external view returns (IBridge);\n\n function pauseCreateRetryables() external;\n\n function unpauseCreateRetryables() external;\n\n function startRewriteAddress() external;\n\n function stopRewriteAddress() external;\n}\n" + }, + "contracts/tests/arbitrum/IMessageProvider.sol": { + "content": "// SPDX-License-Identifier: Apache-2.0\n\n/*\n * Copyright 2021, Offchain Labs, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * Originally copied from:\n * https://github.com/OffchainLabs/arbitrum/tree/e3a6307ad8a2dc2cad35728a2a9908cfd8dd8ef9/packages/arb-bridge-eth\n *\n * MODIFIED from Offchain Labs' implementation:\n * - Changed solidity version to 0.7.3 (pablo@edgeandnode.com)\n *\n */\n\npragma solidity ^0.7.3;\n\ninterface IMessageProvider {\n event InboxMessageDelivered(uint256 indexed messageNum, bytes data);\n\n event InboxMessageDeliveredFromOrigin(uint256 indexed messageNum);\n}\n" + }, + "contracts/tests/BridgeMock.sol": { + "content": "// SPDX-License-Identifier: GPL-2.0-or-later\n\npragma solidity ^0.7.3;\n\nimport \"./arbitrum/IBridge.sol\";\n\n/**\n * @title Arbitrum Bridge mock contract\n * @dev This contract implements Arbitrum's IBridge interface for testing purposes\n */\ncontract BridgeMock is IBridge {\n /// Address of the (mock) Arbitrum Inbox\n address public inbox;\n /// Address of the (mock) Arbitrum Outbox\n address public outbox;\n /// Index of the next message on the inbox messages array\n uint256 public messageIndex;\n /// Inbox messages array\n bytes32[] public override inboxAccs;\n\n /**\n * @notice Deliver a message to the inbox. The encoded message will be\n * added to the inbox array, and messageIndex will be incremented.\n * @param _kind Type of the message\n * @param _sender Address that is sending the message\n * @param _messageDataHash keccak256 hash of the message data\n * @return The next index for the inbox array\n */\n function deliverMessageToInbox(\n uint8 _kind,\n address _sender,\n bytes32 _messageDataHash\n ) external payable override returns (uint256) {\n messageIndex = messageIndex + 1;\n inboxAccs.push(keccak256(abi.encodePacked(inbox, _kind, _sender, _messageDataHash)));\n emit MessageDelivered(messageIndex, inboxAccs[messageIndex - 1], msg.sender, _kind, _sender, _messageDataHash);\n return messageIndex;\n }\n\n /**\n * @notice Executes an L1 function call incoing from L2. This can only be called\n * by the Outbox.\n * @param _destAddr Contract to call\n * @param _amount ETH value to send\n * @param _data Calldata for the function call\n * @return True if the call was successful, false otherwise\n * @return Return data from the call\n */\n function executeCall(\n address _destAddr,\n uint256 _amount,\n bytes calldata _data\n ) external override returns (bool, bytes memory) {\n require(outbox == msg.sender, \"NOT_FROM_OUTBOX\");\n bool success;\n bytes memory returnData;\n\n // solhint-disable-next-line avoid-low-level-calls\n (success, returnData) = _destAddr.call{ value: _amount }(_data);\n emit BridgeCallTriggered(msg.sender, _destAddr, _amount, _data);\n return (success, returnData);\n }\n\n /**\n * @notice Set the address of the inbox. Anyone can call this, because it's a mock.\n * @param _inbox Address of the inbox\n * @param _enabled Enable the inbox (ignored)\n */\n function setInbox(address _inbox, bool _enabled) external override {\n inbox = _inbox;\n emit InboxToggle(inbox, _enabled);\n }\n\n /**\n * @notice Set the address of the outbox. Anyone can call this, because it's a mock.\n * @param _outbox Address of the outbox\n * @param _enabled Enable the outbox (ignored)\n */\n function setOutbox(address _outbox, bool _enabled) external override {\n outbox = _outbox;\n emit OutboxToggle(outbox, _enabled);\n }\n\n // View functions\n\n /**\n * @notice Getter for the active outbox (in this case there's only one)\n */\n function activeOutbox() external view override returns (address) {\n return outbox;\n }\n\n /**\n * @notice Getter for whether an address is an allowed inbox (in this case there's only one)\n * @param _inbox Address to check\n * @return True if the address is the allowed inbox, false otherwise\n */\n function allowedInboxes(address _inbox) external view override returns (bool) {\n return _inbox == inbox;\n }\n\n /**\n * @notice Getter for whether an address is an allowed outbox (in this case there's only one)\n * @param _outbox Address to check\n * @return True if the address is the allowed outbox, false otherwise\n */\n function allowedOutboxes(address _outbox) external view override returns (bool) {\n return _outbox == outbox;\n }\n\n /**\n * @notice Getter for the count of messages in the inboxAccs\n * @return Number of messages in inboxAccs\n */\n function messageCount() external view override returns (uint256) {\n return inboxAccs.length;\n }\n}\n" + }, + "contracts/tests/GraphTokenMock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\n\n/**\n * @title Graph Token Mock contract.\n * @dev Used for testing purposes, DO NOT USE IN PRODUCTION\n */\ncontract GraphTokenMock is Ownable, ERC20 {\n /**\n * @notice Contract Constructor.\n * @param _initialSupply Initial supply\n * @param _mintTo Address to whitch to mint the initial supply\n */\n constructor(uint256 _initialSupply, address _mintTo) ERC20(\"Graph Token Mock\", \"GRT-Mock\") {\n // Deploy to mint address\n _mint(_mintTo, _initialSupply);\n }\n\n /**\n * @notice Mint tokens to an address from the bridge.\n * (The real one has an onlyGateway modifier)\n * @param _to Address to mint tokens to\n * @param _amount Amount of tokens to mint\n */\n function bridgeMint(address _to, uint256 _amount) external {\n _mint(_to, _amount);\n }\n\n /**\n * @notice Burn tokens from an address from the bridge.\n * (The real one has an onlyGateway modifier)\n * @param _from Address to burn tokens from\n * @param _amount Amount of tokens to burn\n */\n function bridgeBurn(address _from, uint256 _amount) external {\n _burn(_from, _amount);\n }\n}\n" + }, + "contracts/tests/InboxMock.sol": { + "content": "// SPDX-License-Identifier: GPL-2.0-or-later\n\npragma solidity ^0.7.3;\n\nimport \"./arbitrum/IInbox.sol\";\nimport \"./arbitrum/AddressAliasHelper.sol\";\n\n/**\n * @title Arbitrum Inbox mock contract\n * @dev This contract implements (a subset of) Arbitrum's IInbox interface for testing purposes\n */\ncontract InboxMock is IInbox {\n /// @dev Type indicator for a standard L2 message\n uint8 internal constant L2_MSG = 3;\n /// @dev Type indicator for a retryable ticket message\n // solhint-disable-next-line const-name-snakecase\n uint8 internal constant L1MessageType_submitRetryableTx = 9;\n /// Address of the Bridge (mock) contract\n IBridge public override bridge;\n\n /**\n * @notice Send a message to L2 (by delivering it to the Bridge)\n * @param _messageData Encoded data to send in the message\n * @return Message number returned by the inbox\n */\n function sendL2Message(bytes calldata _messageData) external override returns (uint256) {\n uint256 msgNum = deliverToBridge(L2_MSG, msg.sender, keccak256(_messageData));\n emit InboxMessageDelivered(msgNum, _messageData);\n return msgNum;\n }\n\n /**\n * @notice Set the address of the (mock) bridge\n * @param _bridge Address of the bridge\n */\n function setBridge(address _bridge) external {\n bridge = IBridge(_bridge);\n }\n\n /**\n * @notice Unimplemented in this mock\n */\n function sendUnsignedTransaction(\n uint256,\n uint256,\n uint256,\n address,\n uint256,\n bytes calldata\n ) external pure override returns (uint256) {\n revert(\"Unimplemented\");\n }\n\n /**\n * @notice Unimplemented in this mock\n */\n function sendContractTransaction(\n uint256,\n uint256,\n address,\n uint256,\n bytes calldata\n ) external pure override returns (uint256) {\n revert(\"Unimplemented\");\n }\n\n /**\n * @notice Unimplemented in this mock\n */\n function sendL1FundedUnsignedTransaction(\n uint256,\n uint256,\n uint256,\n address,\n bytes calldata\n ) external payable override returns (uint256) {\n revert(\"Unimplemented\");\n }\n\n /**\n * @notice Unimplemented in this mock\n */\n function sendL1FundedContractTransaction(\n uint256,\n uint256,\n address,\n bytes calldata\n ) external payable override returns (uint256) {\n revert(\"Unimplemented\");\n }\n\n /**\n * @notice Creates a retryable ticket for an L2 transaction\n * @param _destAddr Address of the contract to call in L2\n * @param _arbTxCallValue Callvalue to use in the L2 transaction\n * @param _maxSubmissionCost Max cost of submitting the ticket, in Wei\n * @param _submissionRefundAddress L2 address to refund for any remaining value from the submission cost\n * @param _valueRefundAddress L2 address to refund if the ticket times out or gets cancelled\n * @param _maxGas Max gas for the L2 transcation\n * @param _gasPriceBid Gas price bid on L2\n * @param _data Encoded calldata for the L2 transaction (including function selector)\n * @return Message number returned by the bridge\n */\n function createRetryableTicket(\n address _destAddr,\n uint256 _arbTxCallValue,\n uint256 _maxSubmissionCost,\n address _submissionRefundAddress,\n address _valueRefundAddress,\n uint256 _maxGas,\n uint256 _gasPriceBid,\n bytes calldata _data\n ) external payable override returns (uint256) {\n _submissionRefundAddress = AddressAliasHelper.applyL1ToL2Alias(_submissionRefundAddress);\n _valueRefundAddress = AddressAliasHelper.applyL1ToL2Alias(_valueRefundAddress);\n return\n _deliverMessage(\n L1MessageType_submitRetryableTx,\n msg.sender,\n abi.encodePacked(\n uint256(uint160(bytes20(_destAddr))),\n _arbTxCallValue,\n msg.value,\n _maxSubmissionCost,\n uint256(uint160(bytes20(_submissionRefundAddress))),\n uint256(uint160(bytes20(_valueRefundAddress))),\n _maxGas,\n _gasPriceBid,\n _data.length,\n _data\n )\n );\n }\n\n /**\n * @notice Unimplemented in this mock\n */\n function depositEth(uint256) external payable override returns (uint256) {\n revert(\"Unimplemented\");\n }\n\n /**\n * @notice Unimplemented in this mock\n */\n function pauseCreateRetryables() external pure override {\n revert(\"Unimplemented\");\n }\n\n /**\n * @notice Unimplemented in this mock\n */\n function unpauseCreateRetryables() external pure override {\n revert(\"Unimplemented\");\n }\n\n /**\n * @notice Unimplemented in this mock\n */\n function startRewriteAddress() external pure override {\n revert(\"Unimplemented\");\n }\n\n /**\n * @notice Unimplemented in this mock\n */\n function stopRewriteAddress() external pure override {\n revert(\"Unimplemented\");\n }\n\n /**\n * @dev Deliver a message to the bridge\n * @param _kind Type of the message\n * @param _sender Address that is sending the message\n * @param _messageData Encoded message data\n * @return Message number returned by the bridge\n */\n function _deliverMessage(uint8 _kind, address _sender, bytes memory _messageData) internal returns (uint256) {\n uint256 msgNum = deliverToBridge(_kind, _sender, keccak256(_messageData));\n emit InboxMessageDelivered(msgNum, _messageData);\n return msgNum;\n }\n\n /**\n * @dev Deliver a message to the bridge\n * @param _kind Type of the message\n * @param _sender Address that is sending the message\n * @param _messageDataHash keccak256 hash of the encoded message data\n * @return Message number returned by the bridge\n */\n function deliverToBridge(uint8 _kind, address _sender, bytes32 _messageDataHash) internal returns (uint256) {\n return bridge.deliverMessageToInbox{ value: msg.value }(_kind, _sender, _messageDataHash);\n }\n}\n" + }, + "contracts/tests/L1TokenGatewayMock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport { Ownable } from \"@openzeppelin/contracts/access/Ownable.sol\";\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport { SafeMath } from \"@openzeppelin/contracts/math/SafeMath.sol\";\nimport { ITokenGateway } from \"../arbitrum//ITokenGateway.sol\";\n\n/**\n * @title L1 Token Gateway mock contract\n * @dev Used for testing purposes, DO NOT USE IN PRODUCTION\n */\ncontract L1TokenGatewayMock is Ownable {\n using SafeMath for uint256;\n /// Next sequence number to return when outboundTransfer is called\n uint256 public nextSeqNum;\n\n /// @dev Emitted when a (fake) retryable ticket is created\n event FakeTxToL2(\n address from,\n uint256 value,\n uint256 maxGas,\n uint256 gasPriceBid,\n uint256 maxSubmissionCost,\n bytes outboundCalldata\n );\n\n /// @dev Emitted when an outbound transfer is initiated, i.e. tokens are deposited from L1 to L2\n event DepositInitiated(\n address l1Token,\n address indexed from,\n address indexed to,\n uint256 indexed sequenceNumber,\n uint256 amount\n );\n\n /**\n * @notice L1 Token Gateway Contract Constructor.\n */\n constructor() {}\n\n /**\n * @notice Creates and sends a fake retryable ticket to transfer GRT to L2.\n * This mock will actually just emit an event with parameters equivalent to what the real L1GraphTokenGateway\n * would send to L2.\n * @param _l1Token L1 Address of the GRT contract (needed for compatibility with Arbitrum Gateway Router)\n * @param _to Recipient address on L2\n * @param _amount Amount of tokens to tranfer\n * @param _maxGas Gas limit for L2 execution of the ticket\n * @param _gasPriceBid Price per gas on L2\n * @param _data Encoded maxSubmissionCost and sender address along with additional calldata\n * @return Sequence number of the retryable ticket created by Inbox (always )\n */\n function outboundTransfer(\n address _l1Token,\n address _to,\n uint256 _amount,\n uint256 _maxGas,\n uint256 _gasPriceBid,\n bytes calldata _data\n ) external payable returns (bytes memory) {\n require(_amount > 0, \"INVALID_ZERO_AMOUNT\");\n require(_to != address(0), \"INVALID_DESTINATION\");\n\n // nested scopes to avoid stack too deep errors\n address from;\n uint256 seqNum = nextSeqNum;\n nextSeqNum += 1;\n {\n uint256 maxSubmissionCost;\n bytes memory outboundCalldata;\n {\n bytes memory extraData;\n (from, maxSubmissionCost, extraData) = _parseOutboundData(_data);\n require(maxSubmissionCost > 0, \"NO_SUBMISSION_COST\");\n\n {\n // makes sure only sufficient ETH is supplied as required for successful redemption on L2\n // if a user does not desire immediate redemption they should provide\n // a msg.value of AT LEAST maxSubmissionCost\n uint256 expectedEth = maxSubmissionCost.add(_maxGas.mul(_gasPriceBid));\n require(msg.value >= expectedEth, \"WRONG_ETH_VALUE\");\n }\n outboundCalldata = getOutboundCalldata(_l1Token, from, _to, _amount, extraData);\n }\n {\n // transfer tokens to escrow\n IERC20(_l1Token).transferFrom(from, address(this), _amount);\n\n emit FakeTxToL2(from, msg.value, _maxGas, _gasPriceBid, maxSubmissionCost, outboundCalldata);\n }\n }\n emit DepositInitiated(_l1Token, from, _to, seqNum, _amount);\n\n return abi.encode(seqNum);\n }\n\n /**\n * @notice (Mock) Receives withdrawn tokens from L2\n * Actually does nothing, just keeping it here as its useful to define the expected\n * calldata for the outgoing transfer in tests.\n * @param _l1Token L1 Address of the GRT contract (needed for compatibility with Arbitrum Gateway Router)\n * @param _from Address of the sender\n * @param _to Recepient address on L1\n * @param _amount Amount of tokens transferred\n * @param _data Additional calldata\n */\n function finalizeInboundTransfer(\n address _l1Token,\n address _from,\n address _to,\n uint256 _amount,\n bytes calldata _data\n ) external payable {}\n\n /**\n * @notice Creates calldata required to create a retryable ticket\n * @dev encodes the target function with its params which\n * will be called on L2 when the retryable ticket is redeemed\n * @param _l1Token Address of the Graph token contract on L1\n * @param _from Address on L1 from which we're transferring tokens\n * @param _to Address on L2 to which we're transferring tokens\n * @param _amount Amount of GRT to transfer\n * @param _data Additional call data for the L2 transaction, which must be empty unless the caller is whitelisted\n * @return Encoded calldata (including function selector) for the L2 transaction\n */\n function getOutboundCalldata(\n address _l1Token,\n address _from,\n address _to,\n uint256 _amount,\n bytes memory _data\n ) public pure returns (bytes memory) {\n bytes memory emptyBytes;\n\n return\n abi.encodeWithSelector(\n ITokenGateway.finalizeInboundTransfer.selector,\n _l1Token,\n _from,\n _to,\n _amount,\n abi.encode(emptyBytes, _data)\n );\n }\n\n /**\n * @notice Decodes calldata required for transfer of tokens to L2\n * @dev Data must include maxSubmissionCost, extraData can be left empty. When the router\n * sends an outbound message, data also contains the from address, but this mock\n * doesn't consider this case\n * @param _data Encoded callhook data containing maxSubmissionCost and extraData\n * @return Sender of the tx\n * @return Max ether value used to submit the retryable ticket\n * @return Additional data sent to L2\n */\n function _parseOutboundData(bytes memory _data) private view returns (address, uint256, bytes memory) {\n address from;\n uint256 maxSubmissionCost;\n bytes memory extraData;\n from = msg.sender;\n // User-encoded data contains the max retryable ticket submission cost\n // and additional L2 calldata\n (maxSubmissionCost, extraData) = abi.decode(_data, (uint256, bytes));\n return (from, maxSubmissionCost, extraData);\n }\n}\n" + }, + "contracts/tests/L2TokenGatewayMock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport { Ownable } from \"@openzeppelin/contracts/access/Ownable.sol\";\nimport { ITokenGateway } from \"../arbitrum//ITokenGateway.sol\";\nimport { GraphTokenMock } from \"./GraphTokenMock.sol\";\nimport { ICallhookReceiver } from \"../ICallhookReceiver.sol\";\n\n/**\n * @title L2 Token Gateway mock contract\n * @dev Used for testing purposes, DO NOT USE IN PRODUCTION\n */\ncontract L2TokenGatewayMock is Ownable {\n /// Address of the L1 GRT contract\n address public immutable l1Token;\n /// Address of the L2 GRT contract\n address public immutable l2Token;\n /// Next ID to return when sending an outboundTransfer\n uint256 public nextId;\n\n /// @dev Emitted when a (fake) transaction to L1 is created\n event FakeTxToL1(address from, bytes outboundCalldata);\n /// @dev Emitted when a (fake) retryable ticket is received from L1\n event DepositFinalized(address token, address indexed from, address indexed to, uint256 amount);\n\n /// @dev Emitted when an outbound transfer is initiated, i.e. tokens are withdrawn to L1 from L2\n event WithdrawalInitiated(\n address l1Token,\n address indexed from,\n address indexed to,\n uint256 indexed sequenceNumber,\n uint256 amount\n );\n\n /**\n * @notice L2 Token Gateway Contract Constructor.\n * @param _l1Token Address of the L1 GRT contract\n * @param _l2Token Address of the L2 GRT contract\n */\n constructor(address _l1Token, address _l2Token) {\n l1Token = _l1Token;\n l2Token = _l2Token;\n }\n\n /**\n * @notice Creates and sends a (fake) transfer of GRT to L1.\n * This mock will actually just emit an event with parameters equivalent to what the real L2GraphTokenGateway\n * would send to L1.\n * @param _l1Token L1 Address of the GRT contract (needed for compatibility with Arbitrum Gateway Router)\n * @param _to Recipient address on L2\n * @param _amount Amount of tokens to tranfer\n * @param _data Encoded maxSubmissionCost and sender address along with additional calldata\n * @return ID of the L2-L1 message (incrementing on every call)\n */\n function outboundTransfer(\n address _l1Token,\n address _to,\n uint256 _amount,\n uint256,\n uint256,\n bytes calldata _data\n ) external payable returns (bytes memory) {\n require(_l1Token == l1Token, \"INVALID_L1_TOKEN\");\n require(_amount > 0, \"INVALID_ZERO_AMOUNT\");\n require(_to != address(0), \"INVALID_DESTINATION\");\n\n // nested scopes to avoid stack too deep errors\n address from;\n uint256 id = nextId;\n nextId += 1;\n {\n bytes memory outboundCalldata;\n {\n bytes memory extraData;\n (from, extraData) = _parseOutboundData(_data);\n\n require(msg.value == 0, \"!value\");\n require(extraData.length == 0, \"!extraData\");\n outboundCalldata = getOutboundCalldata(_l1Token, from, _to, _amount, extraData);\n }\n {\n // burn tokens from the sender, they will be released from escrow in L1\n GraphTokenMock(l2Token).bridgeBurn(from, _amount);\n\n emit FakeTxToL1(from, outboundCalldata);\n }\n }\n emit WithdrawalInitiated(_l1Token, from, _to, id, _amount);\n\n return abi.encode(id);\n }\n\n /**\n * @notice (Mock) Receives withdrawn tokens from L1\n * Implements calling callhooks if data is non-empty.\n * @param _l1Token L1 Address of the GRT contract (needed for compatibility with Arbitrum Gateway Router)\n * @param _from Address of the sender\n * @param _to Recipient address on L1\n * @param _amount Amount of tokens transferred\n * @param _data Additional calldata, will trigger an onTokenTransfer call if non-empty\n */\n function finalizeInboundTransfer(\n address _l1Token,\n address _from,\n address _to,\n uint256 _amount,\n bytes calldata _data\n ) external payable {\n require(_l1Token == l1Token, \"TOKEN_NOT_GRT\");\n require(msg.value == 0, \"INVALID_NONZERO_VALUE\");\n\n GraphTokenMock(l2Token).bridgeMint(_to, _amount);\n\n if (_data.length > 0) {\n ICallhookReceiver(_to).onTokenTransfer(_from, _amount, _data);\n }\n\n emit DepositFinalized(_l1Token, _from, _to, _amount);\n }\n\n /**\n * @notice Calculate the L2 address of a bridged token\n * @dev In our case, this would only work for GRT.\n * @param l1ERC20 address of L1 GRT contract\n * @return L2 address of the bridged GRT token\n */\n function calculateL2TokenAddress(address l1ERC20) public view returns (address) {\n if (l1ERC20 != l1Token) {\n return address(0);\n }\n return l2Token;\n }\n\n /**\n * @notice Creates calldata required to create a tx to L1\n * @param _l1Token Address of the Graph token contract on L1\n * @param _from Address on L2 from which we're transferring tokens\n * @param _to Address on L1 to which we're transferring tokens\n * @param _amount Amount of GRT to transfer\n * @param _data Additional call data for the L1 transaction, which must be empty\n * @return Encoded calldata (including function selector) for the L1 transaction\n */\n function getOutboundCalldata(\n address _l1Token,\n address _from,\n address _to,\n uint256 _amount,\n bytes memory _data\n ) public pure returns (bytes memory) {\n return\n abi.encodeWithSelector(\n ITokenGateway.finalizeInboundTransfer.selector,\n _l1Token,\n _from,\n _to,\n _amount,\n abi.encode(0, _data)\n );\n }\n\n /**\n * @dev Decodes calldata required for transfer of tokens to L1.\n * extraData can be left empty\n * @param _data Encoded callhook data\n * @return Sender of the tx\n * @return Any other data sent to L1\n */\n function _parseOutboundData(bytes calldata _data) private view returns (address, bytes memory) {\n address from;\n bytes memory extraData;\n // The mock doesn't take messages from the Router\n from = msg.sender;\n extraData = _data;\n return (from, extraData);\n }\n}\n" + }, + "contracts/tests/Stakes.sol": { + "content": "// SPDX-License-Identifier: GPL-2.0-or-later\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/math/SafeMath.sol\";\n\n/**\n * @title A collection of data structures and functions to manage the Indexer Stake state.\n * Used for low-level state changes, require() conditions should be evaluated\n * at the caller function scope.\n */\nlibrary Stakes {\n using SafeMath for uint256;\n using Stakes for Stakes.Indexer;\n\n struct Indexer {\n uint256 tokensStaked; // Tokens on the indexer stake (staked by the indexer)\n uint256 tokensAllocated; // Tokens used in allocations\n uint256 tokensLocked; // Tokens locked for withdrawal subject to thawing period\n uint256 tokensLockedUntil; // Block when locked tokens can be withdrawn\n }\n\n /**\n * @dev Deposit tokens to the indexer stake.\n * @param stake Stake data\n * @param _tokens Amount of tokens to deposit\n */\n function deposit(Stakes.Indexer storage stake, uint256 _tokens) internal {\n stake.tokensStaked = stake.tokensStaked.add(_tokens);\n }\n\n /**\n * @dev Release tokens from the indexer stake.\n * @param stake Stake data\n * @param _tokens Amount of tokens to release\n */\n function release(Stakes.Indexer storage stake, uint256 _tokens) internal {\n stake.tokensStaked = stake.tokensStaked.sub(_tokens);\n }\n\n /**\n * @dev Allocate tokens from the main stack to a SubgraphDeployment.\n * @param stake Stake data\n * @param _tokens Amount of tokens to allocate\n */\n function allocate(Stakes.Indexer storage stake, uint256 _tokens) internal {\n stake.tokensAllocated = stake.tokensAllocated.add(_tokens);\n }\n\n /**\n * @dev Unallocate tokens from a SubgraphDeployment back to the main stack.\n * @param stake Stake data\n * @param _tokens Amount of tokens to unallocate\n */\n function unallocate(Stakes.Indexer storage stake, uint256 _tokens) internal {\n stake.tokensAllocated = stake.tokensAllocated.sub(_tokens);\n }\n\n /**\n * @dev Lock tokens until a thawing period pass.\n * @param stake Stake data\n * @param _tokens Amount of tokens to unstake\n * @param _period Period in blocks that need to pass before withdrawal\n */\n function lockTokens(Stakes.Indexer storage stake, uint256 _tokens, uint256 _period) internal {\n // Take into account period averaging for multiple unstake requests\n uint256 lockingPeriod = _period;\n if (stake.tokensLocked > 0) {\n lockingPeriod = stake.getLockingPeriod(_tokens, _period);\n }\n\n // Update balances\n stake.tokensLocked = stake.tokensLocked.add(_tokens);\n stake.tokensLockedUntil = block.number.add(lockingPeriod);\n }\n\n /**\n * @dev Unlock tokens.\n * @param stake Stake data\n * @param _tokens Amount of tokens to unkock\n */\n function unlockTokens(Stakes.Indexer storage stake, uint256 _tokens) internal {\n stake.tokensLocked = stake.tokensLocked.sub(_tokens);\n if (stake.tokensLocked == 0) {\n stake.tokensLockedUntil = 0;\n }\n }\n\n /**\n * @dev Take all tokens out from the locked stake for withdrawal.\n * @param stake Stake data\n * @return Amount of tokens being withdrawn\n */\n function withdrawTokens(Stakes.Indexer storage stake) internal returns (uint256) {\n // Calculate tokens that can be released\n uint256 tokensToWithdraw = stake.tokensWithdrawable();\n\n if (tokensToWithdraw > 0) {\n // Reset locked tokens\n stake.unlockTokens(tokensToWithdraw);\n\n // Decrease indexer stake\n stake.release(tokensToWithdraw);\n }\n\n return tokensToWithdraw;\n }\n\n /**\n * @dev Get the locking period of the tokens to unstake.\n * If already unstaked before calculate the weighted average.\n * @param stake Stake data\n * @param _tokens Amount of tokens to unstake\n * @param _thawingPeriod Period in blocks that need to pass before withdrawal\n * @return True if staked\n */\n function getLockingPeriod(\n Stakes.Indexer memory stake,\n uint256 _tokens,\n uint256 _thawingPeriod\n ) internal view returns (uint256) {\n uint256 blockNum = block.number;\n uint256 periodA = (stake.tokensLockedUntil > blockNum) ? stake.tokensLockedUntil.sub(blockNum) : 0;\n uint256 periodB = _thawingPeriod;\n uint256 stakeA = stake.tokensLocked;\n uint256 stakeB = _tokens;\n return periodA.mul(stakeA).add(periodB.mul(stakeB)).div(stakeA.add(stakeB));\n }\n\n /**\n * @dev Return true if there are tokens staked by the Indexer.\n * @param stake Stake data\n * @return True if staked\n */\n function hasTokens(Stakes.Indexer memory stake) internal pure returns (bool) {\n return stake.tokensStaked > 0;\n }\n\n /**\n * @dev Return the amount of tokens used in allocations and locked for withdrawal.\n * @param stake Stake data\n * @return Token amount\n */\n function tokensUsed(Stakes.Indexer memory stake) internal pure returns (uint256) {\n return stake.tokensAllocated.add(stake.tokensLocked);\n }\n\n /**\n * @dev Return the amount of tokens staked not considering the ones that are already going\n * through the thawing period or are ready for withdrawal. We call it secure stake because\n * it is not subject to change by a withdraw call from the indexer.\n * @param stake Stake data\n * @return Token amount\n */\n function tokensSecureStake(Stakes.Indexer memory stake) internal pure returns (uint256) {\n return stake.tokensStaked.sub(stake.tokensLocked);\n }\n\n /**\n * @dev Tokens free balance on the indexer stake that can be used for any purpose.\n * Any token that is allocated cannot be used as well as tokens that are going through the\n * thawing period or are withdrawable\n * Calc: tokensStaked - tokensAllocated - tokensLocked\n * @param stake Stake data\n * @return Token amount\n */\n function tokensAvailable(Stakes.Indexer memory stake) internal pure returns (uint256) {\n return stake.tokensAvailableWithDelegation(0);\n }\n\n /**\n * @dev Tokens free balance on the indexer stake that can be used for allocations.\n * This function accepts a parameter for extra delegated capacity that takes into\n * account delegated tokens\n * @param stake Stake data\n * @param _delegatedCapacity Amount of tokens used from delegators to calculate availability\n * @return Token amount\n */\n function tokensAvailableWithDelegation(\n Stakes.Indexer memory stake,\n uint256 _delegatedCapacity\n ) internal pure returns (uint256) {\n uint256 tokensCapacity = stake.tokensStaked.add(_delegatedCapacity);\n uint256 _tokensUsed = stake.tokensUsed();\n // If more tokens are used than the current capacity, the indexer is overallocated.\n // This means the indexer doesn't have available capacity to create new allocations.\n // We can reach this state when the indexer has funds allocated and then any\n // of these conditions happen:\n // - The delegationCapacity ratio is reduced.\n // - The indexer stake is slashed.\n // - A delegator removes enough stake.\n if (_tokensUsed > tokensCapacity) {\n // Indexer stake is over allocated: return 0 to avoid stake to be used until\n // the overallocation is restored by staking more tokens, unallocating tokens\n // or using more delegated funds\n return 0;\n }\n return tokensCapacity.sub(_tokensUsed);\n }\n\n /**\n * @dev Tokens available for withdrawal after thawing period.\n * @param stake Stake data\n * @return Token amount\n */\n function tokensWithdrawable(Stakes.Indexer memory stake) internal view returns (uint256) {\n // No tokens to withdraw before locking period\n if (stake.tokensLockedUntil == 0 || block.number < stake.tokensLockedUntil) {\n return 0;\n }\n return stake.tokensLocked;\n }\n}\n" + }, + "contracts/tests/StakingMock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\nimport \"./Stakes.sol\";\n\ncontract StakingMock {\n using SafeMath for uint256;\n using Stakes for Stakes.Indexer;\n\n // -- State --\n\n uint256 public minimumIndexerStake = 100e18;\n uint256 public thawingPeriod = 10; // 10 blocks\n IERC20 public token;\n\n // Indexer stakes : indexer => Stake\n mapping(address => Stakes.Indexer) public stakes;\n\n /**\n * @dev Emitted when `indexer` stake `tokens` amount.\n */\n event StakeDeposited(address indexed indexer, uint256 tokens);\n\n /**\n * @dev Emitted when `indexer` unstaked and locked `tokens` amount `until` block.\n */\n event StakeLocked(address indexed indexer, uint256 tokens, uint256 until);\n\n /**\n * @dev Emitted when `indexer` withdrew `tokens` staked.\n */\n event StakeWithdrawn(address indexed indexer, uint256 tokens);\n\n // Contract constructor.\n constructor(IERC20 _token) {\n require(address(_token) != address(0), \"!token\");\n token = _token;\n }\n\n receive() external payable {}\n\n /**\n * @dev Deposit tokens on the indexer stake.\n * @param _tokens Amount of tokens to stake\n */\n function stake(uint256 _tokens) external {\n stakeTo(msg.sender, _tokens);\n }\n\n /**\n * @dev Deposit tokens on the indexer stake.\n * @param _indexer Address of the indexer\n * @param _tokens Amount of tokens to stake\n */\n function stakeTo(address _indexer, uint256 _tokens) public {\n require(_tokens > 0, \"!tokens\");\n\n // Ensure minimum stake\n require(stakes[_indexer].tokensSecureStake().add(_tokens) >= minimumIndexerStake, \"!minimumIndexerStake\");\n\n // Transfer tokens to stake from caller to this contract\n require(token.transferFrom(msg.sender, address(this), _tokens), \"!transfer\");\n\n // Stake the transferred tokens\n _stake(_indexer, _tokens);\n }\n\n /**\n * @dev Unstake tokens from the indexer stake, lock them until thawing period expires.\n * @param _tokens Amount of tokens to unstake\n */\n function unstake(uint256 _tokens) external {\n address indexer = msg.sender;\n Stakes.Indexer storage indexerStake = stakes[indexer];\n\n require(_tokens > 0, \"!tokens\");\n require(indexerStake.hasTokens(), \"!stake\");\n require(indexerStake.tokensAvailable() >= _tokens, \"!stake-avail\");\n\n // Ensure minimum stake\n uint256 newStake = indexerStake.tokensSecureStake().sub(_tokens);\n require(newStake == 0 || newStake >= minimumIndexerStake, \"!minimumIndexerStake\");\n\n // Before locking more tokens, withdraw any unlocked ones\n uint256 tokensToWithdraw = indexerStake.tokensWithdrawable();\n if (tokensToWithdraw > 0) {\n _withdraw(indexer);\n }\n\n indexerStake.lockTokens(_tokens, thawingPeriod);\n\n emit StakeLocked(indexer, indexerStake.tokensLocked, indexerStake.tokensLockedUntil);\n }\n\n /**\n * @dev Withdraw indexer tokens once the thawing period has passed.\n */\n function withdraw() external {\n _withdraw(msg.sender);\n }\n\n function _stake(address _indexer, uint256 _tokens) internal {\n // Deposit tokens into the indexer stake\n Stakes.Indexer storage indexerStake = stakes[_indexer];\n indexerStake.deposit(_tokens);\n\n emit StakeDeposited(_indexer, _tokens);\n }\n\n /**\n * @dev Withdraw indexer tokens once the thawing period has passed.\n * @param _indexer Address of indexer to withdraw funds from\n */\n function _withdraw(address _indexer) private {\n // Get tokens available for withdraw and update balance\n uint256 tokensToWithdraw = stakes[_indexer].withdrawTokens();\n require(tokensToWithdraw > 0, \"!tokens\");\n\n // Return tokens to the indexer\n require(token.transfer(_indexer, tokensToWithdraw), \"!transfer\");\n\n emit StakeWithdrawn(_indexer, tokensToWithdraw);\n }\n}\n" + }, + "contracts/tests/WalletMock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport { Address } from \"@openzeppelin/contracts/utils/Address.sol\";\n\n/**\n * @title WalletMock: a mock wallet contract for testing purposes\n * @dev For testing only, DO NOT USE IN PRODUCTION.\n * This is used to test L1-L2 transfer tools and to create scenarios\n * where an invalid wallet calls the transfer tool, e.g. a wallet that has an invalid\n * manager, or a wallet that has not been initialized.\n */\ncontract WalletMock {\n /// Target contract for the fallback function (usually a transfer tool contract)\n address public immutable target;\n /// Address of the GRT (mock) token\n address public immutable token;\n /// Address of the wallet's manager\n address public immutable manager;\n /// Whether the wallet has been initialized\n bool public immutable isInitialized;\n /// Whether the beneficiary has accepted the lock\n bool public immutable isAccepted;\n\n /**\n * @notice WalletMock constructor\n * @dev This constructor sets all the state variables so that\n * specific test scenarios can be created just by deploying this contract.\n * @param _target Target contract for the fallback function\n * @param _token Address of the GRT (mock) token\n * @param _manager Address of the wallet's manager\n * @param _isInitialized Whether the wallet has been initialized\n * @param _isAccepted Whether the beneficiary has accepted the lock\n */\n constructor(address _target, address _token, address _manager, bool _isInitialized, bool _isAccepted) {\n target = _target;\n token = _token;\n manager = _manager;\n isInitialized = _isInitialized;\n isAccepted = _isAccepted;\n }\n\n /**\n * @notice Fallback function\n * @dev This function calls the target contract with the data sent to this contract.\n * This is used to test the L1-L2 transfer tool.\n */\n fallback() external payable {\n // Call function with data\n Address.functionCall(target, msg.data);\n }\n\n /**\n * @notice Receive function\n * @dev This function is added to avoid compiler warnings, but just reverts.\n */\n receive() external payable {\n revert(\"Invalid call\");\n }\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": false, + "runs": 200 + }, + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file diff --git a/packages/token-distribution/deployments/mainnet/solcInputs/f0757d7c1c560a6ae9697525709a3f5b.json b/packages/token-distribution/deployments/mainnet/solcInputs/f0757d7c1c560a6ae9697525709a3f5b.json new file mode 100644 index 000000000..004c76be7 --- /dev/null +++ b/packages/token-distribution/deployments/mainnet/solcInputs/f0757d7c1c560a6ae9697525709a3f5b.json @@ -0,0 +1,65 @@ +{ + "language": "Solidity", + "sources": { + "contracts/GraphTokenLockWallet.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"@openzeppelin/contracts/math/SafeMath.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\";\n\nimport \"./GraphTokenLock.sol\";\nimport \"./IGraphTokenLockManager.sol\";\n\n/**\n * @title GraphTokenLockWallet\n * @notice This contract is built on top of the base GraphTokenLock functionality.\n * It allows wallet beneficiaries to use the deposited funds to perform specific function calls\n * on specific contracts.\n *\n * The idea is that supporters with locked tokens can participate in the protocol\n * but disallow any release before the vesting/lock schedule.\n * The beneficiary can issue authorized function calls to this contract that will\n * get forwarded to a target contract. A target contract is any of our protocol contracts.\n * The function calls allowed are queried to the GraphTokenLockManager, this way\n * the same configuration can be shared for all the created lock wallet contracts.\n *\n * NOTE: Contracts used as target must have its function signatures checked to avoid collisions\n * with any of this contract functions.\n * Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience\n * the maximum amount of tokens is authorized.\n */\ncontract GraphTokenLockWallet is GraphTokenLock {\n using SafeMath for uint256;\n using SafeERC20 for IERC20;\n\n // -- State --\n\n IGraphTokenLockManager public manager;\n uint256 public usedAmount;\n\n uint256 private constant MAX_UINT256 = 2**256 - 1;\n\n // -- Events --\n\n event ManagerUpdated(address indexed _oldManager, address indexed _newManager);\n event TokenDestinationsApproved();\n event TokenDestinationsRevoked();\n\n // Initializer\n function initialize(\n address _manager,\n address _owner,\n address _beneficiary,\n address _token,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n Revocability _revocable\n ) external {\n _initialize(\n _owner,\n _beneficiary,\n _token,\n _managedAmount,\n _startTime,\n _endTime,\n _periods,\n _releaseStartTime,\n _vestingCliffTime,\n _revocable\n );\n _setManager(_manager);\n }\n\n // -- Admin --\n\n /**\n * @notice Sets a new manager for this contract\n * @param _newManager Address of the new manager\n */\n function setManager(address _newManager) external onlyOwner {\n _setManager(_newManager);\n }\n\n /**\n * @dev Sets a new manager for this contract\n * @param _newManager Address of the new manager\n */\n function _setManager(address _newManager) private {\n require(_newManager != address(0), \"Manager cannot be empty\");\n require(Address.isContract(_newManager), \"Manager must be a contract\");\n\n address oldManager = address(manager);\n manager = IGraphTokenLockManager(_newManager);\n\n emit ManagerUpdated(oldManager, _newManager);\n }\n\n // -- Beneficiary --\n\n /**\n * @notice Approves protocol access of the tokens managed by this contract\n * @dev Approves all token destinations registered in the manager to pull tokens\n */\n function approveProtocol() external onlyBeneficiary {\n address[] memory dstList = manager.getTokenDestinations();\n for (uint256 i = 0; i < dstList.length; i++) {\n token.safeApprove(dstList[i], MAX_UINT256);\n }\n emit TokenDestinationsApproved();\n }\n\n /**\n * @notice Revokes protocol access of the tokens managed by this contract\n * @dev Revokes approval to all token destinations in the manager to pull tokens\n */\n function revokeProtocol() external onlyBeneficiary {\n address[] memory dstList = manager.getTokenDestinations();\n for (uint256 i = 0; i < dstList.length; i++) {\n token.safeApprove(dstList[i], 0);\n }\n emit TokenDestinationsRevoked();\n }\n\n /**\n * @notice Gets tokens currently available for release\n * @dev Considers the schedule, takes into account already released tokens and used amount\n * @return Amount of tokens ready to be released\n */\n function releasableAmount() public view override returns (uint256) {\n if (revocable == Revocability.Disabled) {\n return super.releasableAmount();\n }\n\n // -- Revocability enabled logic\n // This needs to deal with additional considerations for when tokens are used in the protocol\n\n // If a release start time is set no tokens are available for release before this date\n // If not set it follows the default schedule and tokens are available on\n // the first period passed\n if (releaseStartTime > 0 && currentTime() < releaseStartTime) {\n return 0;\n }\n\n // Vesting cliff is activated and it has not passed means nothing is vested yet\n // so funds cannot be released\n if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\n return 0;\n }\n\n // A beneficiary can never have more releasable tokens than the contract balance\n // We consider the `usedAmount` in the protocol as part of the calculations\n // the beneficiary should not release funds that are used.\n uint256 releasable = availableAmount().sub(releasedAmount).sub(usedAmount);\n return MathUtils.min(currentBalance(), releasable);\n }\n\n /**\n * @notice Forward authorized contract calls to protocol contracts\n * @dev Fallback function can be called by the beneficiary only if function call is allowed\n */\n fallback() external payable {\n // Only beneficiary can forward calls\n require(msg.sender == beneficiary, \"Unauthorized caller\");\n\n // Function call validation\n address _target = manager.getAuthFunctionCallTarget(msg.sig);\n require(_target != address(0), \"Unauthorized function\");\n\n uint256 oldBalance = currentBalance();\n\n // Call function with data\n Address.functionCall(_target, msg.data);\n\n // Tracked used tokens in the protocol\n // We do this check after balances were updated by the forwarded call\n // Check is only enforced for revocable contracts to save some gas\n if (revocable == Revocability.Enabled) {\n // Track contract balance change\n uint256 newBalance = currentBalance();\n if (newBalance < oldBalance) {\n // Outflow\n uint256 diff = oldBalance.sub(newBalance);\n usedAmount = usedAmount.add(diff);\n } else {\n // Inflow: We can receive profits from the protocol, that could make usedAmount to\n // underflow. We set it to zero in that case.\n uint256 diff = newBalance.sub(oldBalance);\n usedAmount = (diff >= usedAmount) ? 0 : usedAmount.sub(diff);\n }\n require(usedAmount <= vestedAmount(), \"Cannot use more tokens than vested amount\");\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Address.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.2 <0.8.0;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize, which returns 0 for contracts in\n // construction, since the code is only stored at the end of the\n // constructor execution.\n\n uint256 size;\n // solhint-disable-next-line no-inline-assembly\n assembly { size := extcodesize(account) }\n return size > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n // solhint-disable-next-line avoid-low-level-calls, avoid-call-value\n (bool success, ) = recipient.call{ value: amount }(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain`call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCall(target, data, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n require(isContract(target), \"Address: call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.call{ value: value }(data);\n return _verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {\n require(isContract(target), \"Address: static call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.staticcall(data);\n return _verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\n require(isContract(target), \"Address: delegate call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return _verifyCallResult(success, returndata, errorMessage);\n }\n\n function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {\n if (success) {\n return returndata;\n } else {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n }\n}\n" + }, + "@openzeppelin/contracts/math/SafeMath.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/**\n * @dev Wrappers over Solidity's arithmetic operations with added overflow\n * checks.\n *\n * Arithmetic operations in Solidity wrap on overflow. This can easily result\n * in bugs, because programmers usually assume that an overflow raises an\n * error, which is the standard behavior in high level programming languages.\n * `SafeMath` restores this intuition by reverting the transaction when an\n * operation overflows.\n *\n * Using this library instead of the unchecked operations eliminates an entire\n * class of bugs, so it's recommended to use it always.\n */\nlibrary SafeMath {\n /**\n * @dev Returns the addition of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n uint256 c = a + b;\n if (c < a) return (false, 0);\n return (true, c);\n }\n\n /**\n * @dev Returns the substraction of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n if (b > a) return (false, 0);\n return (true, a - b);\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\n // benefit is lost if 'b' is also tested.\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\n if (a == 0) return (true, 0);\n uint256 c = a * b;\n if (c / a != b) return (false, 0);\n return (true, c);\n }\n\n /**\n * @dev Returns the division of two unsigned integers, with a division by zero flag.\n *\n * _Available since v3.4._\n */\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n if (b == 0) return (false, 0);\n return (true, a / b);\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\n *\n * _Available since v3.4._\n */\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n if (b == 0) return (false, 0);\n return (true, a % b);\n }\n\n /**\n * @dev Returns the addition of two unsigned integers, reverting on\n * overflow.\n *\n * Counterpart to Solidity's `+` operator.\n *\n * Requirements:\n *\n * - Addition cannot overflow.\n */\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\n uint256 c = a + b;\n require(c >= a, \"SafeMath: addition overflow\");\n return c;\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, reverting on\n * overflow (when the result is negative).\n *\n * Counterpart to Solidity's `-` operator.\n *\n * Requirements:\n *\n * - Subtraction cannot overflow.\n */\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b <= a, \"SafeMath: subtraction overflow\");\n return a - b;\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, reverting on\n * overflow.\n *\n * Counterpart to Solidity's `*` operator.\n *\n * Requirements:\n *\n * - Multiplication cannot overflow.\n */\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n if (a == 0) return 0;\n uint256 c = a * b;\n require(c / a == b, \"SafeMath: multiplication overflow\");\n return c;\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers, reverting on\n * division by zero. The result is rounded towards zero.\n *\n * Counterpart to Solidity's `/` operator. Note: this function uses a\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\n * uses an invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b > 0, \"SafeMath: division by zero\");\n return a / b;\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * reverting when dividing by zero.\n *\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\n * opcode (which leaves remaining gas untouched) while Solidity uses an\n * invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b > 0, \"SafeMath: modulo by zero\");\n return a % b;\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\n * overflow (when the result is negative).\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {trySub}.\n *\n * Counterpart to Solidity's `-` operator.\n *\n * Requirements:\n *\n * - Subtraction cannot overflow.\n */\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b <= a, errorMessage);\n return a - b;\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers, reverting with custom message on\n * division by zero. The result is rounded towards zero.\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {tryDiv}.\n *\n * Counterpart to Solidity's `/` operator. Note: this function uses a\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\n * uses an invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b > 0, errorMessage);\n return a / b;\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * reverting with custom message when dividing by zero.\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {tryMod}.\n *\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\n * opcode (which leaves remaining gas untouched) while Solidity uses an\n * invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b > 0, errorMessage);\n return a % b;\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `recipient`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address recipient, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `sender` to `recipient` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);\n\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/SafeERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"../../math/SafeMath.sol\";\nimport \"../../utils/Address.sol\";\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n using SafeMath for uint256;\n using Address for address;\n\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\n }\n\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\n }\n\n /**\n * @dev Deprecated. This function has issues similar to the ones found in\n * {IERC20-approve}, and its usage is discouraged.\n *\n * Whenever possible, use {safeIncreaseAllowance} and\n * {safeDecreaseAllowance} instead.\n */\n function safeApprove(IERC20 token, address spender, uint256 value) internal {\n // safeApprove should only be called when setting an initial allowance,\n // or when resetting it to zero. To increase and decrease it, use\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\n // solhint-disable-next-line max-line-length\n require((value == 0) || (token.allowance(address(this), spender) == 0),\n \"SafeERC20: approve from non-zero to non-zero allowance\"\n );\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\n }\n\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n uint256 newAllowance = token.allowance(address(this), spender).add(value);\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\n\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n uint256 newAllowance = token.allowance(address(this), spender).sub(value, \"SafeERC20: decreased allowance below zero\");\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n */\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that\n // the target address contains contract code and also asserts for success in the low-level call.\n\n bytes memory returndata = address(token).functionCall(data, \"SafeERC20: low-level call failed\");\n if (returndata.length > 0) { // Return data is optional\n // solhint-disable-next-line max-line-length\n require(abi.decode(returndata, (bool)), \"SafeERC20: ERC20 operation did not succeed\");\n }\n }\n}\n" + }, + "contracts/GraphTokenLock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport \"@openzeppelin/contracts/math/SafeMath.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\";\n\nimport \"./Ownable.sol\";\nimport \"./MathUtils.sol\";\nimport \"./IGraphTokenLock.sol\";\n\n/**\n * @title GraphTokenLock\n * @notice Contract that manages an unlocking schedule of tokens.\n * @dev The contract lock manage a number of tokens deposited into the contract to ensure that\n * they can only be released under certain time conditions.\n *\n * This contract implements a release scheduled based on periods and tokens are released in steps\n * after each period ends. It can be configured with one period in which case it is like a plain TimeLock.\n * It also supports revocation to be used for vesting schedules.\n *\n * The contract supports receiving extra funds than the managed tokens ones that can be\n * withdrawn by the beneficiary at any time.\n *\n * A releaseStartTime parameter is included to override the default release schedule and\n * perform the first release on the configured time. After that it will continue with the\n * default schedule.\n */\nabstract contract GraphTokenLock is Ownable, IGraphTokenLock {\n using SafeMath for uint256;\n using SafeERC20 for IERC20;\n\n uint256 private constant MIN_PERIOD = 1;\n\n // -- State --\n\n IERC20 public token;\n address public beneficiary;\n\n // Configuration\n\n // Amount of tokens managed by the contract schedule\n uint256 public managedAmount;\n\n uint256 public startTime; // Start datetime (in unixtimestamp)\n uint256 public endTime; // Datetime after all funds are fully vested/unlocked (in unixtimestamp)\n uint256 public periods; // Number of vesting/release periods\n\n // First release date for tokens (in unixtimestamp)\n // If set, no tokens will be released before releaseStartTime ignoring\n // the amount to release each period\n uint256 public releaseStartTime;\n // A cliff set a date to which a beneficiary needs to get to vest\n // all preceding periods\n uint256 public vestingCliffTime;\n Revocability public revocable; // Whether to use vesting for locked funds\n\n // State\n\n bool public isRevoked;\n bool public isInitialized;\n bool public isAccepted;\n uint256 public releasedAmount;\n uint256 public revokedAmount;\n\n // -- Events --\n\n event TokensReleased(address indexed beneficiary, uint256 amount);\n event TokensWithdrawn(address indexed beneficiary, uint256 amount);\n event TokensRevoked(address indexed beneficiary, uint256 amount);\n event BeneficiaryChanged(address newBeneficiary);\n event LockAccepted();\n event LockCanceled();\n\n /**\n * @dev Only allow calls from the beneficiary of the contract\n */\n modifier onlyBeneficiary() {\n require(msg.sender == beneficiary, \"!auth\");\n _;\n }\n\n /**\n * @notice Initializes the contract\n * @param _owner Address of the contract owner\n * @param _beneficiary Address of the beneficiary of locked tokens\n * @param _managedAmount Amount of tokens to be managed by the lock contract\n * @param _startTime Start time of the release schedule\n * @param _endTime End time of the release schedule\n * @param _periods Number of periods between start time and end time\n * @param _releaseStartTime Override time for when the releases start\n * @param _vestingCliffTime Override time for when the vesting start\n * @param _revocable Whether the contract is revocable\n */\n function _initialize(\n address _owner,\n address _beneficiary,\n address _token,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n Revocability _revocable\n ) internal {\n require(!isInitialized, \"Already initialized\");\n require(_owner != address(0), \"Owner cannot be zero\");\n require(_beneficiary != address(0), \"Beneficiary cannot be zero\");\n require(_token != address(0), \"Token cannot be zero\");\n require(_managedAmount > 0, \"Managed tokens cannot be zero\");\n require(_startTime != 0, \"Start time must be set\");\n require(_startTime < _endTime, \"Start time > end time\");\n require(_periods >= MIN_PERIOD, \"Periods cannot be below minimum\");\n require(_revocable != Revocability.NotSet, \"Must set a revocability option\");\n require(_releaseStartTime < _endTime, \"Release start time must be before end time\");\n require(_vestingCliffTime < _endTime, \"Cliff time must be before end time\");\n\n isInitialized = true;\n\n Ownable.initialize(_owner);\n beneficiary = _beneficiary;\n token = IERC20(_token);\n\n managedAmount = _managedAmount;\n\n startTime = _startTime;\n endTime = _endTime;\n periods = _periods;\n\n // Optionals\n releaseStartTime = _releaseStartTime;\n vestingCliffTime = _vestingCliffTime;\n revocable = _revocable;\n }\n\n /**\n * @notice Change the beneficiary of funds managed by the contract\n * @dev Can only be called by the beneficiary\n * @param _newBeneficiary Address of the new beneficiary address\n */\n function changeBeneficiary(address _newBeneficiary) external onlyBeneficiary {\n require(_newBeneficiary != address(0), \"Empty beneficiary\");\n beneficiary = _newBeneficiary;\n emit BeneficiaryChanged(_newBeneficiary);\n }\n\n /**\n * @notice Beneficiary accepts the lock, the owner cannot retrieve back the tokens\n * @dev Can only be called by the beneficiary\n */\n function acceptLock() external onlyBeneficiary {\n isAccepted = true;\n emit LockAccepted();\n }\n\n /**\n * @notice Owner cancel the lock and return the balance in the contract\n * @dev Can only be called by the owner\n */\n function cancelLock() external onlyOwner {\n require(isAccepted == false, \"Cannot cancel accepted contract\");\n\n token.safeTransfer(owner(), currentBalance());\n\n emit LockCanceled();\n }\n\n // -- Balances --\n\n /**\n * @notice Returns the amount of tokens currently held by the contract\n * @return Tokens held in the contract\n */\n function currentBalance() public view override returns (uint256) {\n return token.balanceOf(address(this));\n }\n\n // -- Time & Periods --\n\n /**\n * @notice Returns the current block timestamp\n * @return Current block timestamp\n */\n function currentTime() public view override returns (uint256) {\n return block.timestamp;\n }\n\n /**\n * @notice Gets duration of contract from start to end in seconds\n * @return Amount of seconds from contract startTime to endTime\n */\n function duration() public view override returns (uint256) {\n return endTime.sub(startTime);\n }\n\n /**\n * @notice Gets time elapsed since the start of the contract\n * @dev Returns zero if called before conctract starTime\n * @return Seconds elapsed from contract startTime\n */\n function sinceStartTime() public view override returns (uint256) {\n uint256 current = currentTime();\n if (current <= startTime) {\n return 0;\n }\n return current.sub(startTime);\n }\n\n /**\n * @notice Returns amount available to be released after each period according to schedule\n * @return Amount of tokens available after each period\n */\n function amountPerPeriod() public view override returns (uint256) {\n return managedAmount.div(periods);\n }\n\n /**\n * @notice Returns the duration of each period in seconds\n * @return Duration of each period in seconds\n */\n function periodDuration() public view override returns (uint256) {\n return duration().div(periods);\n }\n\n /**\n * @notice Gets the current period based on the schedule\n * @return A number that represents the current period\n */\n function currentPeriod() public view override returns (uint256) {\n return sinceStartTime().div(periodDuration()).add(MIN_PERIOD);\n }\n\n /**\n * @notice Gets the number of periods that passed since the first period\n * @return A number of periods that passed since the schedule started\n */\n function passedPeriods() public view override returns (uint256) {\n return currentPeriod().sub(MIN_PERIOD);\n }\n\n // -- Locking & Release Schedule --\n\n /**\n * @notice Gets the currently available token according to the schedule\n * @dev Implements the step-by-step schedule based on periods for available tokens\n * @return Amount of tokens available according to the schedule\n */\n function availableAmount() public view override returns (uint256) {\n uint256 current = currentTime();\n\n // Before contract start no funds are available\n if (current < startTime) {\n return 0;\n }\n\n // After contract ended all funds are available\n if (current > endTime) {\n return managedAmount;\n }\n\n // Get available amount based on period\n return passedPeriods().mul(amountPerPeriod());\n }\n\n /**\n * @notice Gets the amount of currently vested tokens\n * @dev Similar to available amount, but is fully vested when contract is non-revocable\n * @return Amount of tokens already vested\n */\n function vestedAmount() public view override returns (uint256) {\n // If non-revocable it is fully vested\n if (revocable == Revocability.Disabled) {\n return managedAmount;\n }\n\n // Vesting cliff is activated and it has not passed means nothing is vested yet\n if (vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\n return 0;\n }\n\n return availableAmount();\n }\n\n /**\n * @notice Gets tokens currently available for release\n * @dev Considers the schedule and takes into account already released tokens\n * @return Amount of tokens ready to be released\n */\n function releasableAmount() public view virtual override returns (uint256) {\n // If a release start time is set no tokens are available for release before this date\n // If not set it follows the default schedule and tokens are available on\n // the first period passed\n if (releaseStartTime > 0 && currentTime() < releaseStartTime) {\n return 0;\n }\n\n // Vesting cliff is activated and it has not passed means nothing is vested yet\n // so funds cannot be released\n if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\n return 0;\n }\n\n // A beneficiary can never have more releasable tokens than the contract balance\n uint256 releasable = availableAmount().sub(releasedAmount);\n return MathUtils.min(currentBalance(), releasable);\n }\n\n /**\n * @notice Gets the outstanding amount yet to be released based on the whole contract lifetime\n * @dev Does not consider schedule but just global amounts tracked\n * @return Amount of outstanding tokens for the lifetime of the contract\n */\n function totalOutstandingAmount() public view override returns (uint256) {\n return managedAmount.sub(releasedAmount).sub(revokedAmount);\n }\n\n /**\n * @notice Gets surplus amount in the contract based on outstanding amount to release\n * @dev All funds over outstanding amount is considered surplus that can be withdrawn by beneficiary\n * @return Amount of tokens considered as surplus\n */\n function surplusAmount() public view override returns (uint256) {\n uint256 balance = currentBalance();\n uint256 outstandingAmount = totalOutstandingAmount();\n if (balance > outstandingAmount) {\n return balance.sub(outstandingAmount);\n }\n return 0;\n }\n\n // -- Value Transfer --\n\n /**\n * @notice Releases tokens based on the configured schedule\n * @dev All available releasable tokens are transferred to beneficiary\n */\n function release() external override onlyBeneficiary {\n uint256 amountToRelease = releasableAmount();\n require(amountToRelease > 0, \"No available releasable amount\");\n\n releasedAmount = releasedAmount.add(amountToRelease);\n\n token.safeTransfer(beneficiary, amountToRelease);\n\n emit TokensReleased(beneficiary, amountToRelease);\n }\n\n /**\n * @notice Withdraws surplus, unmanaged tokens from the contract\n * @dev Tokens in the contract over outstanding amount are considered as surplus\n * @param _amount Amount of tokens to withdraw\n */\n function withdrawSurplus(uint256 _amount) external override onlyBeneficiary {\n require(_amount > 0, \"Amount cannot be zero\");\n require(surplusAmount() >= _amount, \"Amount requested > surplus available\");\n\n token.safeTransfer(beneficiary, _amount);\n\n emit TokensWithdrawn(beneficiary, _amount);\n }\n\n /**\n * @notice Revokes a vesting schedule and return the unvested tokens to the owner\n * @dev Vesting schedule is always calculated based on managed tokens\n */\n function revoke() external override onlyOwner {\n require(revocable == Revocability.Enabled, \"Contract is non-revocable\");\n require(isRevoked == false, \"Already revoked\");\n\n uint256 unvestedAmount = managedAmount.sub(vestedAmount());\n require(unvestedAmount > 0, \"No available unvested amount\");\n\n revokedAmount = unvestedAmount;\n isRevoked = true;\n\n token.safeTransfer(owner(), unvestedAmount);\n\n emit TokensRevoked(beneficiary, unvestedAmount);\n }\n}\n" + }, + "contracts/IGraphTokenLockManager.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\nimport \"./IGraphTokenLock.sol\";\n\ninterface IGraphTokenLockManager {\n // -- Factory --\n\n function setMasterCopy(address _masterCopy) external;\n\n function createTokenLockWallet(\n address _owner,\n address _beneficiary,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n IGraphTokenLock.Revocability _revocable\n ) external;\n\n // -- Funds Management --\n\n function token() external returns (IERC20);\n\n function deposit(uint256 _amount) external;\n\n function withdraw(uint256 _amount) external;\n\n // -- Allowed Funds Destinations --\n\n function addTokenDestination(address _dst) external;\n\n function removeTokenDestination(address _dst) external;\n\n function isTokenDestination(address _dst) external view returns (bool);\n\n function getTokenDestinations() external view returns (address[] memory);\n\n // -- Function Call Authorization --\n\n function setAuthFunctionCall(string calldata _signature, address _target) external;\n\n function unsetAuthFunctionCall(string calldata _signature) external;\n\n function setAuthFunctionCallMany(string[] calldata _signatures, address[] calldata _targets) external;\n\n function getAuthFunctionCallTarget(bytes4 _sigHash) external view returns (address);\n\n function isAuthFunctionCall(bytes4 _sigHash) external view returns (bool);\n}\n" + }, + "contracts/Ownable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * The owner account will be passed on initialization of the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\ncontract Ownable {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n function initialize(address owner) internal {\n _owner = owner;\n emit OwnershipTransferred(address(0), owner);\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(_owner == msg.sender, \"Ownable: caller is not the owner\");\n _;\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() external virtual onlyOwner {\n emit OwnershipTransferred(_owner, address(0));\n _owner = address(0);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) external virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n emit OwnershipTransferred(_owner, newOwner);\n _owner = newOwner;\n }\n}\n" + }, + "contracts/MathUtils.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nlibrary MathUtils {\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n}\n" + }, + "contracts/IGraphTokenLock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\ninterface IGraphTokenLock {\n enum Revocability {\n NotSet,\n Enabled,\n Disabled\n }\n\n // -- Balances --\n\n function currentBalance() external view returns (uint256);\n\n // -- Time & Periods --\n\n function currentTime() external view returns (uint256);\n\n function duration() external view returns (uint256);\n\n function sinceStartTime() external view returns (uint256);\n\n function amountPerPeriod() external view returns (uint256);\n\n function periodDuration() external view returns (uint256);\n\n function currentPeriod() external view returns (uint256);\n\n function passedPeriods() external view returns (uint256);\n\n // -- Locking & Release Schedule --\n\n function availableAmount() external view returns (uint256);\n\n function vestedAmount() external view returns (uint256);\n\n function releasableAmount() external view returns (uint256);\n\n function totalOutstandingAmount() external view returns (uint256);\n\n function surplusAmount() external view returns (uint256);\n\n // -- Value Transfer --\n\n function release() external;\n\n function withdrawSurplus(uint256 _amount) external;\n\n function revoke() external;\n}\n" + }, + "contracts/GraphTokenLockSimple.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport \"./GraphTokenLock.sol\";\n\n/**\n * @title GraphTokenLockSimple\n * @notice This contract is the concrete simple implementation built on top of the base\n * GraphTokenLock functionality for use when we only need the token lock schedule\n * features but no interaction with the network.\n * \n * This contract is designed to be deployed without the use of a TokenManager.\n */\ncontract GraphTokenLockSimple is GraphTokenLock {\n // Constructor\n constructor() {\n Ownable.initialize(msg.sender);\n }\n\n // Initializer\n function initialize(\n address _owner,\n address _beneficiary,\n address _token,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n Revocability _revocable\n ) external onlyOwner {\n _initialize(\n _owner,\n _beneficiary,\n _token,\n _managedAmount,\n _startTime,\n _endTime,\n _periods,\n _releaseStartTime,\n _vestingCliffTime,\n _revocable\n );\n }\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": false, + "runs": 200 + }, + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file diff --git a/packages/token-distribution/deployments/rinkeby/.chainId b/packages/token-distribution/deployments/rinkeby/.chainId new file mode 100644 index 000000000..bf0d87ab1 --- /dev/null +++ b/packages/token-distribution/deployments/rinkeby/.chainId @@ -0,0 +1 @@ +4 \ No newline at end of file diff --git a/packages/token-distribution/deployments/rinkeby/GraphTokenLockManager.json b/packages/token-distribution/deployments/rinkeby/GraphTokenLockManager.json new file mode 100644 index 000000000..b9d151640 --- /dev/null +++ b/packages/token-distribution/deployments/rinkeby/GraphTokenLockManager.json @@ -0,0 +1,926 @@ +{ + "address": "0x9fb2369f2034FD857340D8388395861f07083616", + "abi": [ + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_graphToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_masterCopy", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes4", + "name": "sigHash", + "type": "bytes4" + }, + { + "indexed": true, + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "indexed": false, + "internalType": "string", + "name": "signature", + "type": "string" + } + ], + "name": "FunctionCallAuth", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "masterCopy", + "type": "address" + } + ], + "name": "MasterCopyUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "proxy", + "type": "address" + } + ], + "name": "ProxyCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "dst", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "TokenDestinationAllowed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "contractAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "initHash", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "managedAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "startTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "endTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "periods", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "releaseStartTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "vestingCliffTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "enum IGraphTokenLock.Revocability", + "name": "revocable", + "type": "uint8" + } + ], + "name": "TokenLockCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensDeposited", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensWithdrawn", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_dst", + "type": "address" + } + ], + "name": "addTokenDestination", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "", + "type": "bytes4" + } + ], + "name": "authFnCalls", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_owner", + "type": "address" + }, + { + "internalType": "address", + "name": "_beneficiary", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_managedAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_startTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_endTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_periods", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_releaseStartTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_vestingCliffTime", + "type": "uint256" + }, + { + "internalType": "enum IGraphTokenLock.Revocability", + "name": "_revocable", + "type": "uint8" + } + ], + "name": "createTokenLockWallet", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "deposit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_sigHash", + "type": "bytes4" + } + ], + "name": "getAuthFunctionCallTarget", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_salt", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "_implementation", + "type": "address" + } + ], + "name": "getDeploymentAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getTokenDestinations", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_sigHash", + "type": "bytes4" + } + ], + "name": "isAuthFunctionCall", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_dst", + "type": "address" + } + ], + "name": "isTokenDestination", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "masterCopy", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_dst", + "type": "address" + } + ], + "name": "removeTokenDestination", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_signature", + "type": "string" + }, + { + "internalType": "address", + "name": "_target", + "type": "address" + } + ], + "name": "setAuthFunctionCall", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string[]", + "name": "_signatures", + "type": "string[]" + }, + { + "internalType": "address[]", + "name": "_targets", + "type": "address[]" + } + ], + "name": "setAuthFunctionCallMany", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_masterCopy", + "type": "address" + } + ], + "name": "setMasterCopy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "token", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_signature", + "type": "string" + } + ], + "name": "unsetAuthFunctionCall", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x45a0e8ebdc925f6eaeadd3e043bae0a8bd1b8c373641c90b6a341f1a40658906", + "receipt": { + "to": null, + "from": "0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9", + "contractAddress": "0x9fb2369f2034FD857340D8388395861f07083616", + "transactionIndex": 0, + "gasUsed": "3216552", + "logsBloom": "0x00000000000000000000000000000000000004000000000000800000000000000004000020000000000000000000000000000000000000008000000000000000000000000000000000000000000000000001000000000000000000400000000000000000020000000000000000000800000000000000000000000000000000400000000000020000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000080000000000000000000000000000000000000022000020000000000000000000000000000004000000000000000000000000000000000000", + "blockHash": "0xcff4d52fd60f740f879baa14b2acd6dda82825726cb3933cbfe713f6bd1e4ada", + "transactionHash": "0x45a0e8ebdc925f6eaeadd3e043bae0a8bd1b8c373641c90b6a341f1a40658906", + "logs": [ + { + "transactionIndex": 0, + "blockNumber": 7727644, + "transactionHash": "0x45a0e8ebdc925f6eaeadd3e043bae0a8bd1b8c373641c90b6a341f1a40658906", + "address": "0x9fb2369f2034FD857340D8388395861f07083616", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x00000000000000000000000023d1b1823e6cb5229137424f88c70fda1539f1f9" + ], + "data": "0x", + "logIndex": 0, + "blockHash": "0xcff4d52fd60f740f879baa14b2acd6dda82825726cb3933cbfe713f6bd1e4ada" + }, + { + "transactionIndex": 0, + "blockNumber": 7727644, + "transactionHash": "0x45a0e8ebdc925f6eaeadd3e043bae0a8bd1b8c373641c90b6a341f1a40658906", + "address": "0x9fb2369f2034FD857340D8388395861f07083616", + "topics": [ + "0x30909084afc859121ffc3a5aef7fe37c540a9a1ef60bd4d8dcdb76376fadf9de", + "0x0000000000000000000000006eb5538d1e805a503893cd23ae980320eb8358c8" + ], + "data": "0x", + "logIndex": 1, + "blockHash": "0xcff4d52fd60f740f879baa14b2acd6dda82825726cb3933cbfe713f6bd1e4ada" + } + ], + "blockNumber": 7727644, + "cumulativeGasUsed": "3216552", + "status": 1, + "byzantium": true + }, + "args": [ + "0xB0a7bC0e6b51db8Cfda3f80904c8E35259F1abDb", + "0x6Eb5538d1E805a503893Cd23AE980320Eb8358C8" + ], + "solcInputHash": "a72ab6278ade6c5c10115f7be2c555c9", + "metadata": "{\"compiler\":{\"version\":\"0.7.3+commit.9bfce1f6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"_graphToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_masterCopy\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes4\",\"name\":\"sigHash\",\"type\":\"bytes4\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"signature\",\"type\":\"string\"}],\"name\":\"FunctionCallAuth\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"masterCopy\",\"type\":\"address\"}],\"name\":\"MasterCopyUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"proxy\",\"type\":\"address\"}],\"name\":\"ProxyCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dst\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"}],\"name\":\"TokenDestinationAllowed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"contractAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"initHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"managedAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"startTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"endTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"periods\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"releaseStartTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"vestingCliffTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"enum IGraphTokenLock.Revocability\",\"name\":\"revocable\",\"type\":\"uint8\"}],\"name\":\"TokenLockCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensWithdrawn\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_dst\",\"type\":\"address\"}],\"name\":\"addTokenDestination\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"name\":\"authFnCalls\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_beneficiary\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_managedAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_startTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_endTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_periods\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_releaseStartTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_vestingCliffTime\",\"type\":\"uint256\"},{\"internalType\":\"enum IGraphTokenLock.Revocability\",\"name\":\"_revocable\",\"type\":\"uint8\"}],\"name\":\"createTokenLockWallet\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"deposit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"_sigHash\",\"type\":\"bytes4\"}],\"name\":\"getAuthFunctionCallTarget\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_salt\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"}],\"name\":\"getDeploymentAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTokenDestinations\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"_sigHash\",\"type\":\"bytes4\"}],\"name\":\"isAuthFunctionCall\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_dst\",\"type\":\"address\"}],\"name\":\"isTokenDestination\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"masterCopy\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_dst\",\"type\":\"address\"}],\"name\":\"removeTokenDestination\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_signature\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"_target\",\"type\":\"address\"}],\"name\":\"setAuthFunctionCall\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string[]\",\"name\":\"_signatures\",\"type\":\"string[]\"},{\"internalType\":\"address[]\",\"name\":\"_targets\",\"type\":\"address[]\"}],\"name\":\"setAuthFunctionCallMany\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_masterCopy\",\"type\":\"address\"}],\"name\":\"setMasterCopy\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_signature\",\"type\":\"string\"}],\"name\":\"unsetAuthFunctionCall\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"addTokenDestination(address)\":{\"params\":{\"_dst\":\"Destination address\"}},\"constructor\":{\"params\":{\"_graphToken\":\"Token to use for deposits and withdrawals\",\"_masterCopy\":\"Address of the master copy to use to clone proxies\"}},\"createTokenLockWallet(address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)\":{\"params\":{\"_beneficiary\":\"Address of the beneficiary of locked tokens\",\"_endTime\":\"End time of the release schedule\",\"_managedAmount\":\"Amount of tokens to be managed by the lock contract\",\"_owner\":\"Address of the contract owner\",\"_periods\":\"Number of periods between start time and end time\",\"_releaseStartTime\":\"Override time for when the releases start\",\"_revocable\":\"Whether the contract is revocable\",\"_startTime\":\"Start time of the release schedule\"}},\"deposit(uint256)\":{\"details\":\"Even if the ERC20 token can be transferred directly to the contract this function provide a safe interface to do the transfer and avoid mistakes\",\"params\":{\"_amount\":\"Amount to deposit\"}},\"getAuthFunctionCallTarget(bytes4)\":{\"params\":{\"_sigHash\":\"Function signature hash\"},\"returns\":{\"_0\":\"Address of the target contract where to send the call\"}},\"getDeploymentAddress(bytes32,address)\":{\"params\":{\"_implementation\":\"Address of the proxy target implementation\",\"_salt\":\"Bytes32 salt to use for CREATE2\"},\"returns\":{\"_0\":\"Address of the counterfactual MinimalProxy\"}},\"getTokenDestinations()\":{\"returns\":{\"_0\":\"Array of addresses authorized to pull funds from a token lock\"}},\"isAuthFunctionCall(bytes4)\":{\"params\":{\"_sigHash\":\"Function signature hash\"},\"returns\":{\"_0\":\"True if authorized\"}},\"isTokenDestination(address)\":{\"params\":{\"_dst\":\"Destination address\"},\"returns\":{\"_0\":\"True if authorized\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"removeTokenDestination(address)\":{\"params\":{\"_dst\":\"Destination address\"}},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"setAuthFunctionCall(string,address)\":{\"details\":\"Input expected is the function signature as 'transfer(address,uint256)'\",\"params\":{\"_signature\":\"Function signature\",\"_target\":\"Address of the destination contract to call\"}},\"setAuthFunctionCallMany(string[],address[])\":{\"details\":\"Input expected is the function signature as 'transfer(address,uint256)'\",\"params\":{\"_signatures\":\"Function signatures\",\"_targets\":\"Address of the destination contract to call\"}},\"setMasterCopy(address)\":{\"params\":{\"_masterCopy\":\"Address of contract bytecode to factory clone\"}},\"token()\":{\"returns\":{\"_0\":\"Token used for transfers and approvals\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"unsetAuthFunctionCall(string)\":{\"details\":\"Input expected is the function signature as 'transfer(address,uint256)'\",\"params\":{\"_signature\":\"Function signature\"}},\"withdraw(uint256)\":{\"details\":\"Escape hatch in case of mistakes or to recover remaining funds\",\"params\":{\"_amount\":\"Amount of tokens to withdraw\"}}},\"title\":\"GraphTokenLockManager\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"addTokenDestination(address)\":{\"notice\":\"Adds an address that can be allowed by a token lock to pull funds\"},\"constructor\":{\"notice\":\"Constructor.\"},\"createTokenLockWallet(address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)\":{\"notice\":\"Creates and fund a new token lock wallet using a minimum proxy\"},\"deposit(uint256)\":{\"notice\":\"Deposits tokens into the contract\"},\"getAuthFunctionCallTarget(bytes4)\":{\"notice\":\"Gets the target contract to call for a particular function signature\"},\"getDeploymentAddress(bytes32,address)\":{\"notice\":\"Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation\"},\"getTokenDestinations()\":{\"notice\":\"Returns an array of authorized destination addresses\"},\"isAuthFunctionCall(bytes4)\":{\"notice\":\"Returns true if the function call is authorized\"},\"isTokenDestination(address)\":{\"notice\":\"Returns True if the address is authorized to be a destination of tokens\"},\"removeTokenDestination(address)\":{\"notice\":\"Removes an address that can be allowed by a token lock to pull funds\"},\"setAuthFunctionCall(string,address)\":{\"notice\":\"Sets an authorized function call to target\"},\"setAuthFunctionCallMany(string[],address[])\":{\"notice\":\"Sets an authorized function call to target in bulk\"},\"setMasterCopy(address)\":{\"notice\":\"Sets the masterCopy bytecode to use to create clones of TokenLock contracts\"},\"token()\":{\"notice\":\"Gets the GRT token address\"},\"unsetAuthFunctionCall(string)\":{\"notice\":\"Unsets an authorized function call to target\"},\"withdraw(uint256)\":{\"notice\":\"Withdraws tokens from the contract\"}},\"notice\":\"This contract manages a list of authorized function calls and targets that can be called by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts. This contract receives funds to make the process of creating TokenLockWallet contracts easier by distributing them the initial tokens to be managed. The owner can setup a list of token destinations that will be used by TokenLock contracts to approve the pulling of funds, this way in can be guaranteed that only protocol contracts will manipulate users funds.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/GraphTokenLockManager.sol\":\"GraphTokenLockManager\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/GSN/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/*\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with GSN meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address payable) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes memory) {\\n this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0x8d3cb350f04ff49cfb10aef08d87f19dcbaecc8027b0bed12f3275cd12f38cf0\",\"license\":\"MIT\"},\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\nimport \\\"../GSN/Context.sol\\\";\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor () internal {\\n address msgSender = _msgSender();\\n _owner = msgSender;\\n emit OwnershipTransferred(address(0), msgSender);\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(_owner == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n emit OwnershipTransferred(_owner, address(0));\\n _owner = address(0);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n emit OwnershipTransferred(_owner, newOwner);\\n _owner = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0xf7c39c7e6d06ed3bda90cfefbcbf2ddc32c599c3d6721746546ad64946efccaa\",\"license\":\"MIT\"},\"@openzeppelin/contracts/math/SafeMath.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Wrappers over Solidity's arithmetic operations with added overflow\\n * checks.\\n *\\n * Arithmetic operations in Solidity wrap on overflow. This can easily result\\n * in bugs, because programmers usually assume that an overflow raises an\\n * error, which is the standard behavior in high level programming languages.\\n * `SafeMath` restores this intuition by reverting the transaction when an\\n * operation overflows.\\n *\\n * Using this library instead of the unchecked operations eliminates an entire\\n * class of bugs, so it's recommended to use it always.\\n */\\nlibrary SafeMath {\\n /**\\n * @dev Returns the addition of two unsigned integers, reverting on\\n * overflow.\\n *\\n * Counterpart to Solidity's `+` operator.\\n *\\n * Requirements:\\n *\\n * - Addition cannot overflow.\\n */\\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\\n uint256 c = a + b;\\n require(c >= a, \\\"SafeMath: addition overflow\\\");\\n\\n return c;\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting on\\n * overflow (when the result is negative).\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n *\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\\n return sub(a, b, \\\"SafeMath: subtraction overflow\\\");\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\\n * overflow (when the result is negative).\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n *\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b <= a, errorMessage);\\n uint256 c = a - b;\\n\\n return c;\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, reverting on\\n * overflow.\\n *\\n * Counterpart to Solidity's `*` operator.\\n *\\n * Requirements:\\n *\\n * - Multiplication cannot overflow.\\n */\\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\\n if (a == 0) {\\n return 0;\\n }\\n\\n uint256 c = a * b;\\n require(c / a == b, \\\"SafeMath: multiplication overflow\\\");\\n\\n return c;\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers. Reverts on\\n * division by zero. The result is rounded towards zero.\\n *\\n * Counterpart to Solidity's `/` operator. Note: this function uses a\\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\\n * uses an invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\\n return div(a, b, \\\"SafeMath: division by zero\\\");\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers. Reverts with custom message on\\n * division by zero. The result is rounded towards zero.\\n *\\n * Counterpart to Solidity's `/` operator. Note: this function uses a\\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\\n * uses an invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b > 0, errorMessage);\\n uint256 c = a / b;\\n // assert(a == b * c + a % b); // There is no case in which this doesn't hold\\n\\n return c;\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * Reverts when dividing by zero.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\\n return mod(a, b, \\\"SafeMath: modulo by zero\\\");\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * Reverts with custom message when dividing by zero.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b != 0, errorMessage);\\n return a % b;\\n }\\n}\\n\",\"keccak256\":\"0x3b21f2c8d626de3b9925ae33e972d8bf5c8b1bffb3f4ee94daeed7d0679036e6\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `recipient`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address recipient, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `sender` to `recipient` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n}\\n\",\"keccak256\":\"0x5f02220344881ce43204ae4a6281145a67bc52c2bb1290a791857df3d19d78f5\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\nimport \\\"./IERC20.sol\\\";\\nimport \\\"../../math/SafeMath.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @title SafeERC20\\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\\n * contract returns false). Tokens that return no value (and instead revert or\\n * throw on failure) are also supported, non-reverting calls are assumed to be\\n * successful.\\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\n */\\nlibrary SafeERC20 {\\n using SafeMath for uint256;\\n using Address for address;\\n\\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\\n }\\n\\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\\n }\\n\\n /**\\n * @dev Deprecated. This function has issues similar to the ones found in\\n * {IERC20-approve}, and its usage is discouraged.\\n *\\n * Whenever possible, use {safeIncreaseAllowance} and\\n * {safeDecreaseAllowance} instead.\\n */\\n function safeApprove(IERC20 token, address spender, uint256 value) internal {\\n // safeApprove should only be called when setting an initial allowance,\\n // or when resetting it to zero. To increase and decrease it, use\\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\\n // solhint-disable-next-line max-line-length\\n require((value == 0) || (token.allowance(address(this), spender) == 0),\\n \\\"SafeERC20: approve from non-zero to non-zero allowance\\\"\\n );\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\\n }\\n\\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n uint256 newAllowance = token.allowance(address(this), spender).add(value);\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n uint256 newAllowance = token.allowance(address(this), spender).sub(value, \\\"SafeERC20: decreased allowance below zero\\\");\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n */\\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that\\n // the target address contains contract code and also asserts for success in the low-level call.\\n\\n bytes memory returndata = address(token).functionCall(data, \\\"SafeERC20: low-level call failed\\\");\\n if (returndata.length > 0) { // Return data is optional\\n // solhint-disable-next-line max-line-length\\n require(abi.decode(returndata, (bool)), \\\"SafeERC20: ERC20 operation did not succeed\\\");\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf12dfbe97e6276980b83d2830bb0eb75e0cf4f3e626c2471137f82158ae6a0fc\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.2 <0.8.0;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize, which returns 0 for contracts in\\n // construction, since the code is only stored at the end of the\\n // constructor execution.\\n\\n uint256 size;\\n // solhint-disable-next-line no-inline-assembly\\n assembly { size := extcodesize(account) }\\n return size > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls, avoid-call-value\\n (bool success, ) = recipient.call{ value: amount }(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain`call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.call{ value: value }(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xa6a15ddddcbf29d2922a1e0d4151b5d2d33da24b93cc9ebc12390e0d855532f8\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Create2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Helper to make usage of the `CREATE2` EVM opcode easier and safer.\\n * `CREATE2` can be used to compute in advance the address where a smart\\n * contract will be deployed, which allows for interesting new mechanisms known\\n * as 'counterfactual interactions'.\\n *\\n * See the https://eips.ethereum.org/EIPS/eip-1014#motivation[EIP] for more\\n * information.\\n */\\nlibrary Create2 {\\n /**\\n * @dev Deploys a contract using `CREATE2`. The address where the contract\\n * will be deployed can be known in advance via {computeAddress}.\\n *\\n * The bytecode for a contract can be obtained from Solidity with\\n * `type(contractName).creationCode`.\\n *\\n * Requirements:\\n *\\n * - `bytecode` must not be empty.\\n * - `salt` must have not been used for `bytecode` already.\\n * - the factory must have a balance of at least `amount`.\\n * - if `amount` is non-zero, `bytecode` must have a `payable` constructor.\\n */\\n function deploy(uint256 amount, bytes32 salt, bytes memory bytecode) internal returns (address) {\\n address addr;\\n require(address(this).balance >= amount, \\\"Create2: insufficient balance\\\");\\n require(bytecode.length != 0, \\\"Create2: bytecode length is zero\\\");\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n addr := create2(amount, add(bytecode, 0x20), mload(bytecode), salt)\\n }\\n require(addr != address(0), \\\"Create2: Failed on deploy\\\");\\n return addr;\\n }\\n\\n /**\\n * @dev Returns the address where a contract will be stored if deployed via {deploy}. Any change in the\\n * `bytecodeHash` or `salt` will result in a new destination address.\\n */\\n function computeAddress(bytes32 salt, bytes32 bytecodeHash) internal view returns (address) {\\n return computeAddress(salt, bytecodeHash, address(this));\\n }\\n\\n /**\\n * @dev Returns the address where a contract will be stored if deployed via {deploy} from a contract located at\\n * `deployer`. If `deployer` is this contract's address, returns the same value as {computeAddress}.\\n */\\n function computeAddress(bytes32 salt, bytes32 bytecodeHash, address deployer) internal pure returns (address) {\\n bytes32 _data = keccak256(\\n abi.encodePacked(bytes1(0xff), deployer, salt, bytecodeHash)\\n );\\n return address(uint256(_data));\\n }\\n}\\n\",\"keccak256\":\"0x3545c88fb28fb3934362d06c8dd5ccdfa951378c3be319a20c53f285520cace3\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/EnumerableSet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Library for managing\\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\\n * types.\\n *\\n * Sets have the following properties:\\n *\\n * - Elements are added, removed, and checked for existence in constant time\\n * (O(1)).\\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\\n *\\n * ```\\n * contract Example {\\n * // Add the library methods\\n * using EnumerableSet for EnumerableSet.AddressSet;\\n *\\n * // Declare a set state variable\\n * EnumerableSet.AddressSet private mySet;\\n * }\\n * ```\\n *\\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\\n * and `uint256` (`UintSet`) are supported.\\n */\\nlibrary EnumerableSet {\\n // To implement this library for multiple types with as little code\\n // repetition as possible, we write it in terms of a generic Set type with\\n // bytes32 values.\\n // The Set implementation uses private functions, and user-facing\\n // implementations (such as AddressSet) are just wrappers around the\\n // underlying Set.\\n // This means that we can only create new EnumerableSets for types that fit\\n // in bytes32.\\n\\n struct Set {\\n // Storage of set values\\n bytes32[] _values;\\n\\n // Position of the value in the `values` array, plus 1 because index 0\\n // means a value is not in the set.\\n mapping (bytes32 => uint256) _indexes;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function _add(Set storage set, bytes32 value) private returns (bool) {\\n if (!_contains(set, value)) {\\n set._values.push(value);\\n // The value is stored at length-1, but we add 1 to all indexes\\n // and use 0 as a sentinel value\\n set._indexes[value] = set._values.length;\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function _remove(Set storage set, bytes32 value) private returns (bool) {\\n // We read and store the value's index to prevent multiple reads from the same storage slot\\n uint256 valueIndex = set._indexes[value];\\n\\n if (valueIndex != 0) { // Equivalent to contains(set, value)\\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\\n // the array, and then remove the last element (sometimes called as 'swap and pop').\\n // This modifies the order of the array, as noted in {at}.\\n\\n uint256 toDeleteIndex = valueIndex - 1;\\n uint256 lastIndex = set._values.length - 1;\\n\\n // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs\\n // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.\\n\\n bytes32 lastvalue = set._values[lastIndex];\\n\\n // Move the last value to the index where the value to delete is\\n set._values[toDeleteIndex] = lastvalue;\\n // Update the index for the moved value\\n set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based\\n\\n // Delete the slot where the moved value was stored\\n set._values.pop();\\n\\n // Delete the index for the deleted slot\\n delete set._indexes[value];\\n\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\\n return set._indexes[value] != 0;\\n }\\n\\n /**\\n * @dev Returns the number of values on the set. O(1).\\n */\\n function _length(Set storage set) private view returns (uint256) {\\n return set._values.length;\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\\n require(set._values.length > index, \\\"EnumerableSet: index out of bounds\\\");\\n return set._values[index];\\n }\\n\\n // Bytes32Set\\n\\n struct Bytes32Set {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _add(set._inner, value);\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _remove(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\\n return _contains(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(Bytes32Set storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\\n return _at(set._inner, index);\\n }\\n\\n // AddressSet\\n\\n struct AddressSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(AddressSet storage set, address value) internal returns (bool) {\\n return _add(set._inner, bytes32(uint256(value)));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(AddressSet storage set, address value) internal returns (bool) {\\n return _remove(set._inner, bytes32(uint256(value)));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(AddressSet storage set, address value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(uint256(value)));\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(AddressSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\\n return address(uint256(_at(set._inner, index)));\\n }\\n\\n\\n // UintSet\\n\\n struct UintSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(UintSet storage set, uint256 value) internal returns (bool) {\\n return _add(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\\n return _remove(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns the number of values on the set. O(1).\\n */\\n function length(UintSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\\n return uint256(_at(set._inner, index));\\n }\\n}\\n\",\"keccak256\":\"0xae0992eb1ec30fd1ecdf2e04a6036decfc9797bf11dc1ec84b546b74318d5ec2\",\"license\":\"MIT\"},\"contracts/GraphTokenLockManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/EnumerableSet.sol\\\";\\n\\nimport \\\"./MinimalProxyFactory.sol\\\";\\nimport \\\"./IGraphTokenLockManager.sol\\\";\\n\\n/**\\n * @title GraphTokenLockManager\\n * @notice This contract manages a list of authorized function calls and targets that can be called\\n * by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts.\\n *\\n * This contract receives funds to make the process of creating TokenLockWallet contracts\\n * easier by distributing them the initial tokens to be managed.\\n *\\n * The owner can setup a list of token destinations that will be used by TokenLock contracts to\\n * approve the pulling of funds, this way in can be guaranteed that only protocol contracts\\n * will manipulate users funds.\\n */\\ncontract GraphTokenLockManager is MinimalProxyFactory, IGraphTokenLockManager {\\n using SafeERC20 for IERC20;\\n using EnumerableSet for EnumerableSet.AddressSet;\\n\\n // -- State --\\n\\n mapping(bytes4 => address) public authFnCalls;\\n EnumerableSet.AddressSet private _tokenDestinations;\\n\\n address public masterCopy;\\n IERC20 private _token;\\n\\n // -- Events --\\n\\n event MasterCopyUpdated(address indexed masterCopy);\\n event TokenLockCreated(\\n address indexed contractAddress,\\n bytes32 indexed initHash,\\n address indexed beneficiary,\\n address token,\\n uint256 managedAmount,\\n uint256 startTime,\\n uint256 endTime,\\n uint256 periods,\\n uint256 releaseStartTime,\\n uint256 vestingCliffTime,\\n IGraphTokenLock.Revocability revocable\\n );\\n\\n event TokensDeposited(address indexed sender, uint256 amount);\\n event TokensWithdrawn(address indexed sender, uint256 amount);\\n\\n event FunctionCallAuth(address indexed caller, bytes4 indexed sigHash, address indexed target, string signature);\\n event TokenDestinationAllowed(address indexed dst, bool allowed);\\n\\n /**\\n * Constructor.\\n * @param _graphToken Token to use for deposits and withdrawals\\n * @param _masterCopy Address of the master copy to use to clone proxies\\n */\\n constructor(IERC20 _graphToken, address _masterCopy) {\\n require(address(_graphToken) != address(0), \\\"Token cannot be zero\\\");\\n _token = _graphToken;\\n setMasterCopy(_masterCopy);\\n }\\n\\n // -- Factory --\\n\\n /**\\n * @notice Sets the masterCopy bytecode to use to create clones of TokenLock contracts\\n * @param _masterCopy Address of contract bytecode to factory clone\\n */\\n function setMasterCopy(address _masterCopy) public override onlyOwner {\\n require(_masterCopy != address(0), \\\"MasterCopy cannot be zero\\\");\\n masterCopy = _masterCopy;\\n emit MasterCopyUpdated(_masterCopy);\\n }\\n\\n /**\\n * @notice Creates and fund a new token lock wallet using a minimum proxy\\n * @param _owner Address of the contract owner\\n * @param _beneficiary Address of the beneficiary of locked tokens\\n * @param _managedAmount Amount of tokens to be managed by the lock contract\\n * @param _startTime Start time of the release schedule\\n * @param _endTime End time of the release schedule\\n * @param _periods Number of periods between start time and end time\\n * @param _releaseStartTime Override time for when the releases start\\n * @param _revocable Whether the contract is revocable\\n */\\n function createTokenLockWallet(\\n address _owner,\\n address _beneficiary,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n IGraphTokenLock.Revocability _revocable\\n ) external override onlyOwner {\\n require(_token.balanceOf(address(this)) >= _managedAmount, \\\"Not enough tokens to create lock\\\");\\n\\n // Create contract using a minimal proxy and call initializer\\n bytes memory initializer = abi.encodeWithSignature(\\n \\\"initialize(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)\\\",\\n address(this),\\n _owner,\\n _beneficiary,\\n address(_token),\\n _managedAmount,\\n _startTime,\\n _endTime,\\n _periods,\\n _releaseStartTime,\\n _vestingCliffTime,\\n _revocable\\n );\\n address contractAddress = _deployProxy2(keccak256(initializer), masterCopy, initializer);\\n\\n // Send managed amount to the created contract\\n _token.safeTransfer(contractAddress, _managedAmount);\\n\\n emit TokenLockCreated(\\n contractAddress,\\n keccak256(initializer),\\n _beneficiary,\\n address(_token),\\n _managedAmount,\\n _startTime,\\n _endTime,\\n _periods,\\n _releaseStartTime,\\n _vestingCliffTime,\\n _revocable\\n );\\n }\\n\\n // -- Funds Management --\\n\\n /**\\n * @notice Gets the GRT token address\\n * @return Token used for transfers and approvals\\n */\\n function token() external view override returns (IERC20) {\\n return _token;\\n }\\n\\n /**\\n * @notice Deposits tokens into the contract\\n * @dev Even if the ERC20 token can be transferred directly to the contract\\n * this function provide a safe interface to do the transfer and avoid mistakes\\n * @param _amount Amount to deposit\\n */\\n function deposit(uint256 _amount) external override {\\n require(_amount > 0, \\\"Amount cannot be zero\\\");\\n _token.safeTransferFrom(msg.sender, address(this), _amount);\\n emit TokensDeposited(msg.sender, _amount);\\n }\\n\\n /**\\n * @notice Withdraws tokens from the contract\\n * @dev Escape hatch in case of mistakes or to recover remaining funds\\n * @param _amount Amount of tokens to withdraw\\n */\\n function withdraw(uint256 _amount) external override onlyOwner {\\n require(_amount > 0, \\\"Amount cannot be zero\\\");\\n _token.safeTransfer(msg.sender, _amount);\\n emit TokensWithdrawn(msg.sender, _amount);\\n }\\n\\n // -- Token Destinations --\\n\\n /**\\n * @notice Adds an address that can be allowed by a token lock to pull funds\\n * @param _dst Destination address\\n */\\n function addTokenDestination(address _dst) external override onlyOwner {\\n require(_dst != address(0), \\\"Destination cannot be zero\\\");\\n require(_tokenDestinations.add(_dst), \\\"Destination already added\\\");\\n emit TokenDestinationAllowed(_dst, true);\\n }\\n\\n /**\\n * @notice Removes an address that can be allowed by a token lock to pull funds\\n * @param _dst Destination address\\n */\\n function removeTokenDestination(address _dst) external override onlyOwner {\\n require(_tokenDestinations.remove(_dst), \\\"Destination already removed\\\");\\n emit TokenDestinationAllowed(_dst, false);\\n }\\n\\n /**\\n * @notice Returns True if the address is authorized to be a destination of tokens\\n * @param _dst Destination address\\n * @return True if authorized\\n */\\n function isTokenDestination(address _dst) external view override returns (bool) {\\n return _tokenDestinations.contains(_dst);\\n }\\n\\n /**\\n * @notice Returns an array of authorized destination addresses\\n * @return Array of addresses authorized to pull funds from a token lock\\n */\\n function getTokenDestinations() external view override returns (address[] memory) {\\n address[] memory dstList = new address[](_tokenDestinations.length());\\n for (uint256 i = 0; i < _tokenDestinations.length(); i++) {\\n dstList[i] = _tokenDestinations.at(i);\\n }\\n return dstList;\\n }\\n\\n // -- Function Call Authorization --\\n\\n /**\\n * @notice Sets an authorized function call to target\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @param _signature Function signature\\n * @param _target Address of the destination contract to call\\n */\\n function setAuthFunctionCall(string calldata _signature, address _target) external override onlyOwner {\\n _setAuthFunctionCall(_signature, _target);\\n }\\n\\n /**\\n * @notice Unsets an authorized function call to target\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @param _signature Function signature\\n */\\n function unsetAuthFunctionCall(string calldata _signature) external override onlyOwner {\\n bytes4 sigHash = _toFunctionSigHash(_signature);\\n authFnCalls[sigHash] = address(0);\\n\\n emit FunctionCallAuth(msg.sender, sigHash, address(0), _signature);\\n }\\n\\n /**\\n * @notice Sets an authorized function call to target in bulk\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @param _signatures Function signatures\\n * @param _targets Address of the destination contract to call\\n */\\n function setAuthFunctionCallMany(string[] calldata _signatures, address[] calldata _targets)\\n external\\n override\\n onlyOwner\\n {\\n require(_signatures.length == _targets.length, \\\"Array length mismatch\\\");\\n\\n for (uint256 i = 0; i < _signatures.length; i++) {\\n _setAuthFunctionCall(_signatures[i], _targets[i]);\\n }\\n }\\n\\n /**\\n * @notice Sets an authorized function call to target\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @dev Function signatures of Graph Protocol contracts to be used are known ahead of time\\n * @param _signature Function signature\\n * @param _target Address of the destination contract to call\\n */\\n function _setAuthFunctionCall(string calldata _signature, address _target) internal {\\n require(_target != address(this), \\\"Target must be other contract\\\");\\n require(Address.isContract(_target), \\\"Target must be a contract\\\");\\n\\n bytes4 sigHash = _toFunctionSigHash(_signature);\\n authFnCalls[sigHash] = _target;\\n\\n emit FunctionCallAuth(msg.sender, sigHash, _target, _signature);\\n }\\n\\n /**\\n * @notice Gets the target contract to call for a particular function signature\\n * @param _sigHash Function signature hash\\n * @return Address of the target contract where to send the call\\n */\\n function getAuthFunctionCallTarget(bytes4 _sigHash) public view override returns (address) {\\n return authFnCalls[_sigHash];\\n }\\n\\n /**\\n * @notice Returns true if the function call is authorized\\n * @param _sigHash Function signature hash\\n * @return True if authorized\\n */\\n function isAuthFunctionCall(bytes4 _sigHash) external view override returns (bool) {\\n return getAuthFunctionCallTarget(_sigHash) != address(0);\\n }\\n\\n /**\\n * @dev Converts a function signature string to 4-bytes hash\\n * @param _signature Function signature string\\n * @return Function signature hash\\n */\\n function _toFunctionSigHash(string calldata _signature) internal pure returns (bytes4) {\\n return _convertToBytes4(abi.encodeWithSignature(_signature));\\n }\\n\\n /**\\n * @dev Converts function signature bytes to function signature hash (bytes4)\\n * @param _signature Function signature\\n * @return Function signature in bytes4\\n */\\n function _convertToBytes4(bytes memory _signature) internal pure returns (bytes4) {\\n require(_signature.length == 4, \\\"Invalid method signature\\\");\\n bytes4 sigHash;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n sigHash := mload(add(_signature, 32))\\n }\\n return sigHash;\\n }\\n}\\n\",\"keccak256\":\"0x0384d62cb600eb4128baacf5bca60ea2cb0b68d2d013479daef65ed5f15446ef\",\"license\":\"MIT\"},\"contracts/IGraphTokenLock.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\ninterface IGraphTokenLock {\\n enum Revocability { NotSet, Enabled, Disabled }\\n\\n // -- Balances --\\n\\n function currentBalance() external view returns (uint256);\\n\\n // -- Time & Periods --\\n\\n function currentTime() external view returns (uint256);\\n\\n function duration() external view returns (uint256);\\n\\n function sinceStartTime() external view returns (uint256);\\n\\n function amountPerPeriod() external view returns (uint256);\\n\\n function periodDuration() external view returns (uint256);\\n\\n function currentPeriod() external view returns (uint256);\\n\\n function passedPeriods() external view returns (uint256);\\n\\n // -- Locking & Release Schedule --\\n\\n function availableAmount() external view returns (uint256);\\n\\n function vestedAmount() external view returns (uint256);\\n\\n function releasableAmount() external view returns (uint256);\\n\\n function totalOutstandingAmount() external view returns (uint256);\\n\\n function surplusAmount() external view returns (uint256);\\n\\n // -- Value Transfer --\\n\\n function release() external;\\n\\n function withdrawSurplus(uint256 _amount) external;\\n\\n function revoke() external;\\n}\\n\",\"keccak256\":\"0x396f8102fb03d884d599831989d9753a69f0d9b65538c8206c81e0067827c5a2\",\"license\":\"MIT\"},\"contracts/IGraphTokenLockManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nimport \\\"./IGraphTokenLock.sol\\\";\\n\\ninterface IGraphTokenLockManager {\\n // -- Factory --\\n\\n function setMasterCopy(address _masterCopy) external;\\n\\n function createTokenLockWallet(\\n address _owner,\\n address _beneficiary,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n IGraphTokenLock.Revocability _revocable\\n ) external;\\n\\n // -- Funds Management --\\n\\n function token() external returns (IERC20);\\n\\n function deposit(uint256 _amount) external;\\n\\n function withdraw(uint256 _amount) external;\\n\\n // -- Allowed Funds Destinations --\\n\\n function addTokenDestination(address _dst) external;\\n\\n function removeTokenDestination(address _dst) external;\\n\\n function isTokenDestination(address _dst) external view returns (bool);\\n\\n function getTokenDestinations() external view returns (address[] memory);\\n\\n // -- Function Call Authorization --\\n\\n function setAuthFunctionCall(string calldata _signature, address _target) external;\\n\\n function unsetAuthFunctionCall(string calldata _signature) external;\\n\\n function setAuthFunctionCallMany(string[] calldata _signatures, address[] calldata _targets) external;\\n\\n function getAuthFunctionCallTarget(bytes4 _sigHash) external view returns (address);\\n\\n function isAuthFunctionCall(bytes4 _sigHash) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x2d78d41909a6de5b316ac39b100ea087a8f317cf306379888a045523e15c4d9a\",\"license\":\"MIT\"},\"contracts/MinimalProxyFactory.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Create2.sol\\\";\\n\\n// Adapted from https://github.com/OpenZeppelin/openzeppelin-sdk/blob/v2.5.0/packages/lib/contracts/upgradeability/ProxyFactory.sol\\n// Based on https://eips.ethereum.org/EIPS/eip-1167\\ncontract MinimalProxyFactory is Ownable {\\n // -- Events --\\n\\n event ProxyCreated(address indexed proxy);\\n\\n /**\\n * @notice Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation\\n * @param _salt Bytes32 salt to use for CREATE2\\n * @param _implementation Address of the proxy target implementation\\n * @return Address of the counterfactual MinimalProxy\\n */\\n function getDeploymentAddress(bytes32 _salt, address _implementation) external view returns (address) {\\n return Create2.computeAddress(_salt, keccak256(_getContractCreationCode(_implementation)), address(this));\\n }\\n\\n /**\\n * @notice Deploys a MinimalProxy with CREATE2\\n * @param _salt Bytes32 salt to use for CREATE2\\n * @param _implementation Address of the proxy target implementation\\n * @param _data Bytes with the initializer call\\n * @return Address of the deployed MinimalProxy\\n */\\n function _deployProxy2(\\n bytes32 _salt,\\n address _implementation,\\n bytes memory _data\\n ) internal returns (address) {\\n address proxyAddress = Create2.deploy(0, _salt, _getContractCreationCode(_implementation));\\n\\n emit ProxyCreated(proxyAddress);\\n\\n // Call function with data\\n if (_data.length > 0) {\\n Address.functionCall(proxyAddress, _data);\\n }\\n\\n return proxyAddress;\\n }\\n\\n /**\\n * @notice Gets the MinimalProxy bytecode\\n * @param _implementation Address of the proxy target implementation\\n * @return MinimalProxy bytecode\\n */\\n function _getContractCreationCode(address _implementation) internal pure returns (bytes memory) {\\n bytes10 creation = 0x3d602d80600a3d3981f3;\\n bytes10 prefix = 0x363d3d373d3d3d363d73;\\n bytes20 targetBytes = bytes20(_implementation);\\n bytes15 suffix = 0x5af43d82803e903d91602b57fd5bf3;\\n return abi.encodePacked(creation, prefix, targetBytes, suffix);\\n }\\n}\\n\",\"keccak256\":\"0x8aa3d50e714f92dc0ed6cc6d88fa8a18c948493103928f6092f98815b2c046ca\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60806040523480156200001157600080fd5b5060405162003d7538038062003d75833981810160405281019062000037919062000384565b600062000049620001b460201b60201c565b9050806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a350600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156200015a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200015190620004cf565b60405180910390fd5b81600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550620001ac81620001bc60201b60201c565b50506200057e565b600033905090565b620001cc620001b460201b60201c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146200025c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200025390620004ad565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415620002cf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620002c6906200048b565b60405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167f30909084afc859121ffc3a5aef7fe37c540a9a1ef60bd4d8dcdb76376fadf9de60405160405180910390a250565b60008151905062000367816200054a565b92915050565b6000815190506200037e8162000564565b92915050565b600080604083850312156200039857600080fd5b6000620003a8858286016200036d565b9250506020620003bb8582860162000356565b9150509250929050565b6000620003d4601983620004f1565b91507f4d6173746572436f70792063616e6e6f74206265207a65726f000000000000006000830152602082019050919050565b600062000416602083620004f1565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b600062000458601483620004f1565b91507f546f6b656e2063616e6e6f74206265207a65726f0000000000000000000000006000830152602082019050919050565b60006020820190508181036000830152620004a681620003c5565b9050919050565b60006020820190508181036000830152620004c88162000407565b9050919050565b60006020820190508181036000830152620004ea8162000449565b9050919050565b600082825260208201905092915050565b60006200050f826200052a565b9050919050565b6000620005238262000502565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b620005558162000502565b81146200056157600080fd5b50565b6200056f8162000516565b81146200057b57600080fd5b50565b6137e7806200058e6000396000f3fe608060405234801561001057600080fd5b506004361061012c5760003560e01c80639c05fc60116100ad578063c1ab13db11610071578063c1ab13db14610319578063cf497e6c14610335578063f1d24c4514610351578063f2fde38b14610381578063fc0c546a1461039d5761012c565b80639c05fc6014610275578063a345746614610291578063a619486e146102af578063b6b55f25146102cd578063bdb62fbe146102e95761012c565b806368d30c2e116100f457806368d30c2e146101d15780636e03b8dc146101ed578063715018a61461021d57806379ee1bdf146102275780638da5cb5b146102575761012c565b806303990a6c146101315780630602ba2b1461014d5780632e1a7d4d1461017d578063463013a2146101995780635975e00c146101b5575b600080fd5b61014b60048036038101906101469190612638565b6103bb565b005b6101676004803603810190610162919061260f565b61057c565b6040516101749190613127565b60405180910390f35b610197600480360381019061019291906126d5565b6105bd565b005b6101b360048036038101906101ae919061267d565b610733565b005b6101cf60048036038101906101ca9190612446565b6107d8565b005b6101eb60048036038101906101e6919061246f565b610982565b005b6102076004803603810190610202919061260f565b610cfb565b6040516102149190612f61565b60405180910390f35b610225610d2e565b005b610241600480360381019061023c9190612446565b610e81565b60405161024e9190613127565b60405180910390f35b61025f610e9e565b60405161026c9190612f61565b60405180910390f35b61028f600480360381019061028a9190612535565b610ec7565b005b61029961100d565b6040516102a69190613105565b60405180910390f35b6102b76110e5565b6040516102c49190612f61565b60405180910390f35b6102e760048036038101906102e291906126d5565b61110b565b005b61030360048036038101906102fe91906125d3565b6111ee565b6040516103109190612f61565b60405180910390f35b610333600480360381019061032e9190612446565b611212565b005b61034f600480360381019061034a9190612446565b61134c565b005b61036b6004803603810190610366919061260f565b6114d8565b6040516103789190612f61565b60405180910390f35b61039b60048036038101906103969190612446565b611553565b005b6103a5611715565b6040516103b29190613142565b60405180910390f35b6103c361173f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610450576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044790613323565b60405180910390fd5b600061045c8383611747565b9050600060016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff16817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163373ffffffffffffffffffffffffffffffffffffffff167f450397a2db0e89eccfe664cc6cdfd274a88bc00d29aaec4d991754a42f19f8c9868660405161056f92919061315d565b60405180910390a4505050565b60008073ffffffffffffffffffffffffffffffffffffffff1661059e836114d8565b73ffffffffffffffffffffffffffffffffffffffff1614159050919050565b6105c561173f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610652576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161064990613323565b60405180910390fd5b60008111610695576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161068c90613303565b60405180910390fd5b6106e23382600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117d59092919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b826040516107289190613403565b60405180910390a250565b61073b61173f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107bf90613323565b60405180910390fd5b6107d383838361185b565b505050565b6107e061173f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461086d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086490613323565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156108dd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108d490613203565b60405180910390fd5b6108f1816002611a3d90919063ffffffff16565b610930576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161092790613363565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f33442b8c13e72dd75a027f08f9bff4eed2dfd26e43cdea857365f5163b359a7960016040516109779190613127565b60405180910390a250565b61098a61173f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a17576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a0e90613323565b60405180910390fd5b86600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610a739190612f61565b60206040518083038186803b158015610a8b57600080fd5b505afa158015610a9f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ac391906126fe565b1015610b04576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610afb90613243565b60405180910390fd5b6060308a8a600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168b8b8b8b8b8b8b604051602401610b4d9b9a99989796959493929190612f7c565b6040516020818303038152906040527fbd896dcb000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505090506000610c028280519060200120600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611a6d565b9050610c51818a600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117d59092919063ffffffff16565b8973ffffffffffffffffffffffffffffffffffffffff1682805190602001208273ffffffffffffffffffffffffffffffffffffffff167f3c7ff6acee351ed98200c285a04745858a107e16da2f13c3a81a43073c17d644600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168d8d8d8d8d8d8d604051610ce6989796959493929190613087565b60405180910390a45050505050505050505050565b60016020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610d3661173f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610dc3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dba90613323565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000610e97826002611ae990919063ffffffff16565b9050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610ecf61173f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f5c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f5390613323565b60405180910390fd5b818190508484905014610fa4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f9b906131e3565b60405180910390fd5b60005b8484905081101561100657610ff9858583818110610fc157fe5b9050602002810190610fd3919061341e565b858585818110610fdf57fe5b9050602002016020810190610ff49190612446565b61185b565b8080600101915050610fa7565b5050505050565b60608061101a6002611b19565b67ffffffffffffffff8111801561103057600080fd5b5060405190808252806020026020018201604052801561105f5781602001602082028036833780820191505090505b50905060005b61106f6002611b19565b8110156110dd5761108a816002611b2e90919063ffffffff16565b82828151811061109657fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508080600101915050611065565b508091505090565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000811161114e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161114590613303565b60405180910390fd5b61119d333083600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611b48909392919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f59062170a285eb80e8c6b8ced60428442a51910635005233fc4ce084a475845e826040516111e39190613403565b60405180910390a250565b600061120a836111fd84611bd1565b8051906020012030611c47565b905092915050565b61121a61173f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161129e90613323565b60405180910390fd5b6112bb816002611c8b90919063ffffffff16565b6112fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112f190613283565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f33442b8c13e72dd75a027f08f9bff4eed2dfd26e43cdea857365f5163b359a7960006040516113419190613127565b60405180910390a250565b61135461173f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146113e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113d890613323565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611451576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611448906132a3565b60405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167f30909084afc859121ffc3a5aef7fe37c540a9a1ef60bd4d8dcdb76376fadf9de60405160405180910390a250565b600060016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b61155b61173f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146115e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115df90613323565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611658576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161164f90613223565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600033905090565b60006117cd83836040516024016040516020818303038152906040529190604051611773929190612f48565b60405180910390207bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611cbb565b905092915050565b6118568363a9059cbb60e01b84846040516024016117f492919061305e565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611d13565b505050565b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156118ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118c1906132c3565b60405180910390fd5b6118d381611dda565b611912576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611909906133e3565b60405180910390fd5b600061191e8484611747565b90508160016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff16817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163373ffffffffffffffffffffffffffffffffffffffff167f450397a2db0e89eccfe664cc6cdfd274a88bc00d29aaec4d991754a42f19f8c98787604051611a2f92919061315d565b60405180910390a450505050565b6000611a65836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611ded565b905092915050565b600080611a84600086611a7f87611bd1565b611e5d565b90508073ffffffffffffffffffffffffffffffffffffffff167efffc2da0b561cae30d9826d37709e9421c4725faebc226cbbb7ef5fc5e734960405160405180910390a2600083511115611ade57611adc8184611f6e565b505b809150509392505050565b6000611b11836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611fb8565b905092915050565b6000611b2782600001611fdb565b9050919050565b6000611b3d8360000183611fec565b60001c905092915050565b611bcb846323b872dd60e01b858585604051602401611b6993929190613027565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611d13565b50505050565b60606000693d602d80600a3d3981f360b01b9050600069363d3d373d3d3d363d7360b01b905060008460601b905060006e5af43d82803e903d91602b57fd5bf360881b905083838383604051602001611c2d9493929190612e95565b604051602081830303815290604052945050505050919050565b60008060ff60f81b838686604051602001611c659493929190612ee3565b6040516020818303038152906040528051906020012090508060001c9150509392505050565b6000611cb3836000018373ffffffffffffffffffffffffffffffffffffffff1660001b612059565b905092915050565b60006004825114611d01576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cf890613343565b60405180910390fd5b60006020830151905080915050919050565b6060611d75826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166121419092919063ffffffff16565b9050600081511115611dd55780806020019051810190611d9591906125aa565b611dd4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dcb906133a3565b60405180910390fd5b5b505050565b600080823b905060008111915050919050565b6000611df98383611fb8565b611e52578260000182908060018154018082558091505060019003906000526020600020016000909190919091505582600001805490508360010160008481526020019081526020016000208190555060019050611e57565b600090505b92915050565b60008084471015611ea3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e9a906133c3565b60405180910390fd5b600083511415611ee8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611edf906131c3565b60405180910390fd5b8383516020850187f59050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611f63576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f5a906132e3565b60405180910390fd5b809150509392505050565b6060611fb083836040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c65640000815250612141565b905092915050565b600080836001016000848152602001908152602001600020541415905092915050565b600081600001805490509050919050565b600081836000018054905011612037576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161202e906131a3565b60405180910390fd5b82600001828154811061204657fe5b9060005260206000200154905092915050565b6000808360010160008481526020019081526020016000205490506000811461213557600060018203905060006001866000018054905003905060008660000182815481106120a457fe5b90600052602060002001549050808760000184815481106120c157fe5b90600052602060002001819055506001830187600101600083815260200190815260200160002081905550866000018054806120f957fe5b6001900381819060005260206000200160009055905586600101600087815260200190815260200160002060009055600194505050505061213b565b60009150505b92915050565b60606121508484600085612159565b90509392505050565b60608247101561219e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161219590613263565b60405180910390fd5b6121a785611dda565b6121e6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121dd90613383565b60405180910390fd5b600060608673ffffffffffffffffffffffffffffffffffffffff1685876040516122109190612f31565b60006040518083038185875af1925050503d806000811461224d576040519150601f19603f3d011682016040523d82523d6000602084013e612252565b606091505b509150915061226282828661226e565b92505050949350505050565b6060831561227e578290506122ce565b6000835111156122915782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122c59190613181565b60405180910390fd5b9392505050565b6000813590506122e48161372e565b92915050565b60008083601f8401126122fc57600080fd5b8235905067ffffffffffffffff81111561231557600080fd5b60208301915083602082028301111561232d57600080fd5b9250929050565b60008083601f84011261234657600080fd5b8235905067ffffffffffffffff81111561235f57600080fd5b60208301915083602082028301111561237757600080fd5b9250929050565b60008151905061238d81613745565b92915050565b6000813590506123a28161375c565b92915050565b6000813590506123b781613773565b92915050565b6000813590506123cc8161378a565b92915050565b60008083601f8401126123e457600080fd5b8235905067ffffffffffffffff8111156123fd57600080fd5b60208301915083600182028301111561241557600080fd5b9250929050565b60008135905061242b8161379a565b92915050565b6000815190506124408161379a565b92915050565b60006020828403121561245857600080fd5b6000612466848285016122d5565b91505092915050565b60008060008060008060008060006101208a8c03121561248e57600080fd5b600061249c8c828d016122d5565b99505060206124ad8c828d016122d5565b98505060406124be8c828d0161241c565b97505060606124cf8c828d0161241c565b96505060806124e08c828d0161241c565b95505060a06124f18c828d0161241c565b94505060c06125028c828d0161241c565b93505060e06125138c828d0161241c565b9250506101006125258c828d016123bd565b9150509295985092959850929598565b6000806000806040858703121561254b57600080fd5b600085013567ffffffffffffffff81111561256557600080fd5b61257187828801612334565b9450945050602085013567ffffffffffffffff81111561259057600080fd5b61259c878288016122ea565b925092505092959194509250565b6000602082840312156125bc57600080fd5b60006125ca8482850161237e565b91505092915050565b600080604083850312156125e657600080fd5b60006125f485828601612393565b9250506020612605858286016122d5565b9150509250929050565b60006020828403121561262157600080fd5b600061262f848285016123a8565b91505092915050565b6000806020838503121561264b57600080fd5b600083013567ffffffffffffffff81111561266557600080fd5b612671858286016123d2565b92509250509250929050565b60008060006040848603121561269257600080fd5b600084013567ffffffffffffffff8111156126ac57600080fd5b6126b8868287016123d2565b935093505060206126cb868287016122d5565b9150509250925092565b6000602082840312156126e757600080fd5b60006126f58482850161241c565b91505092915050565b60006020828403121561271057600080fd5b600061271e84828501612431565b91505092915050565b6000612733838361273f565b60208301905092915050565b612748816134eb565b82525050565b612757816134eb565b82525050565b61276e612769826134eb565b6136a4565b82525050565b600061277f82613485565b61278981856134b3565b935061279483613475565b8060005b838110156127c55781516127ac8882612727565b97506127b7836134a6565b925050600181019050612798565b5085935050505092915050565b6127db816134fd565b82525050565b6127f26127ed82613535565b6136c0565b82525050565b61280961280482613561565b6136ca565b82525050565b61282061281b82613509565b6136b6565b82525050565b6128376128328261358d565b6136d4565b82525050565b61284e612849826135b9565b6136de565b82525050565b600061285f82613490565b61286981856134c4565b9350612879818560208601613671565b80840191505092915050565b61288e8161362c565b82525050565b61289d81613650565b82525050565b60006128af83856134cf565b93506128bc838584613662565b6128c5836136fc565b840190509392505050565b60006128dc83856134e0565b93506128e9838584613662565b82840190509392505050565b60006129008261349b565b61290a81856134cf565b935061291a818560208601613671565b612923816136fc565b840191505092915050565b600061293b6022836134cf565b91507f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e60008301527f64730000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006129a16020836134cf565b91507f437265617465323a2062797465636f6465206c656e677468206973207a65726f6000830152602082019050919050565b60006129e16015836134cf565b91507f4172726179206c656e677468206d69736d6174636800000000000000000000006000830152602082019050919050565b6000612a21601a836134cf565b91507f44657374696e6174696f6e2063616e6e6f74206265207a65726f0000000000006000830152602082019050919050565b6000612a616026836134cf565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000612ac76020836134cf565b91507f4e6f7420656e6f75676820746f6b656e7320746f20637265617465206c6f636b6000830152602082019050919050565b6000612b076026836134cf565b91507f416464726573733a20696e73756666696369656e742062616c616e636520666f60008301527f722063616c6c00000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000612b6d601b836134cf565b91507f44657374696e6174696f6e20616c72656164792072656d6f76656400000000006000830152602082019050919050565b6000612bad6019836134cf565b91507f4d6173746572436f70792063616e6e6f74206265207a65726f000000000000006000830152602082019050919050565b6000612bed601d836134cf565b91507f546172676574206d757374206265206f7468657220636f6e74726163740000006000830152602082019050919050565b6000612c2d6019836134cf565b91507f437265617465323a204661696c6564206f6e206465706c6f79000000000000006000830152602082019050919050565b6000612c6d6015836134cf565b91507f416d6f756e742063616e6e6f74206265207a65726f00000000000000000000006000830152602082019050919050565b6000612cad6020836134cf565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b6000612ced6018836134cf565b91507f496e76616c6964206d6574686f64207369676e617475726500000000000000006000830152602082019050919050565b6000612d2d6019836134cf565b91507f44657374696e6174696f6e20616c7265616479206164646564000000000000006000830152602082019050919050565b6000612d6d601d836134cf565b91507f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006000830152602082019050919050565b6000612dad602a836134cf565b91507f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008301527f6f742073756363656564000000000000000000000000000000000000000000006020830152604082019050919050565b6000612e13601d836134cf565b91507f437265617465323a20696e73756666696369656e742062616c616e63650000006000830152602082019050919050565b6000612e536019836134cf565b91507f546172676574206d757374206265206120636f6e7472616374000000000000006000830152602082019050919050565b612e8f81613622565b82525050565b6000612ea182876127e1565b600a82019150612eb182866127e1565b600a82019150612ec18285612826565b601482019150612ed182846127f8565b600f8201915081905095945050505050565b6000612eef828761280f565b600182019150612eff828661275d565b601482019150612f0f828561283d565b602082019150612f1f828461283d565b60208201915081905095945050505050565b6000612f3d8284612854565b915081905092915050565b6000612f558284866128d0565b91508190509392505050565b6000602082019050612f76600083018461274e565b92915050565b600061016082019050612f92600083018e61274e565b612f9f602083018d61274e565b612fac604083018c61274e565b612fb9606083018b61274e565b612fc6608083018a612e86565b612fd360a0830189612e86565b612fe060c0830188612e86565b612fed60e0830187612e86565b612ffb610100830186612e86565b613009610120830185612e86565b613017610140830184612894565b9c9b505050505050505050505050565b600060608201905061303c600083018661274e565b613049602083018561274e565b6130566040830184612e86565b949350505050565b6000604082019050613073600083018561274e565b6130806020830184612e86565b9392505050565b60006101008201905061309d600083018b61274e565b6130aa602083018a612e86565b6130b76040830189612e86565b6130c46060830188612e86565b6130d16080830187612e86565b6130de60a0830186612e86565b6130eb60c0830185612e86565b6130f860e0830184612894565b9998505050505050505050565b6000602082019050818103600083015261311f8184612774565b905092915050565b600060208201905061313c60008301846127d2565b92915050565b60006020820190506131576000830184612885565b92915050565b600060208201905081810360008301526131788184866128a3565b90509392505050565b6000602082019050818103600083015261319b81846128f5565b905092915050565b600060208201905081810360008301526131bc8161292e565b9050919050565b600060208201905081810360008301526131dc81612994565b9050919050565b600060208201905081810360008301526131fc816129d4565b9050919050565b6000602082019050818103600083015261321c81612a14565b9050919050565b6000602082019050818103600083015261323c81612a54565b9050919050565b6000602082019050818103600083015261325c81612aba565b9050919050565b6000602082019050818103600083015261327c81612afa565b9050919050565b6000602082019050818103600083015261329c81612b60565b9050919050565b600060208201905081810360008301526132bc81612ba0565b9050919050565b600060208201905081810360008301526132dc81612be0565b9050919050565b600060208201905081810360008301526132fc81612c20565b9050919050565b6000602082019050818103600083015261331c81612c60565b9050919050565b6000602082019050818103600083015261333c81612ca0565b9050919050565b6000602082019050818103600083015261335c81612ce0565b9050919050565b6000602082019050818103600083015261337c81612d20565b9050919050565b6000602082019050818103600083015261339c81612d60565b9050919050565b600060208201905081810360008301526133bc81612da0565b9050919050565b600060208201905081810360008301526133dc81612e06565b9050919050565b600060208201905081810360008301526133fc81612e46565b9050919050565b60006020820190506134186000830184612e86565b92915050565b6000808335600160200384360303811261343757600080fd5b80840192508235915067ffffffffffffffff82111561345557600080fd5b60208301925060018202360383131561346d57600080fd5b509250929050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b60006134f682613602565b9050919050565b60008115159050919050565b60007fff0000000000000000000000000000000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffff0000000000000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffffffffffffff000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffffffffffffffffffffffff00000000000000000000000082169050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b60008190506135fd8261371a565b919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60006136378261363e565b9050919050565b600061364982613602565b9050919050565b600061365b826135ef565b9050919050565b82818337600083830152505050565b60005b8381101561368f578082015181840152602081019050613674565b8381111561369e576000848401525b50505050565b60006136af826136e8565b9050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b60006136f38261370d565b9050919050565bfe5b6000601f19601f8301169050919050565b60008160601b9050919050565b6003811061372b5761372a6136fa565b5b50565b613737816134eb565b811461374257600080fd5b50565b61374e816134fd565b811461375957600080fd5b50565b613765816135b9565b811461377057600080fd5b50565b61377c816135c3565b811461378757600080fd5b50565b6003811061379757600080fd5b50565b6137a381613622565b81146137ae57600080fd5b5056fea2646970667358221220ce8e84f89eb556f2f74739a29d42b007afeaac5ac92a1454d6c07fa4523a0a9564736f6c63430007030033", + "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061012c5760003560e01c80639c05fc60116100ad578063c1ab13db11610071578063c1ab13db14610319578063cf497e6c14610335578063f1d24c4514610351578063f2fde38b14610381578063fc0c546a1461039d5761012c565b80639c05fc6014610275578063a345746614610291578063a619486e146102af578063b6b55f25146102cd578063bdb62fbe146102e95761012c565b806368d30c2e116100f457806368d30c2e146101d15780636e03b8dc146101ed578063715018a61461021d57806379ee1bdf146102275780638da5cb5b146102575761012c565b806303990a6c146101315780630602ba2b1461014d5780632e1a7d4d1461017d578063463013a2146101995780635975e00c146101b5575b600080fd5b61014b60048036038101906101469190612638565b6103bb565b005b6101676004803603810190610162919061260f565b61057c565b6040516101749190613127565b60405180910390f35b610197600480360381019061019291906126d5565b6105bd565b005b6101b360048036038101906101ae919061267d565b610733565b005b6101cf60048036038101906101ca9190612446565b6107d8565b005b6101eb60048036038101906101e6919061246f565b610982565b005b6102076004803603810190610202919061260f565b610cfb565b6040516102149190612f61565b60405180910390f35b610225610d2e565b005b610241600480360381019061023c9190612446565b610e81565b60405161024e9190613127565b60405180910390f35b61025f610e9e565b60405161026c9190612f61565b60405180910390f35b61028f600480360381019061028a9190612535565b610ec7565b005b61029961100d565b6040516102a69190613105565b60405180910390f35b6102b76110e5565b6040516102c49190612f61565b60405180910390f35b6102e760048036038101906102e291906126d5565b61110b565b005b61030360048036038101906102fe91906125d3565b6111ee565b6040516103109190612f61565b60405180910390f35b610333600480360381019061032e9190612446565b611212565b005b61034f600480360381019061034a9190612446565b61134c565b005b61036b6004803603810190610366919061260f565b6114d8565b6040516103789190612f61565b60405180910390f35b61039b60048036038101906103969190612446565b611553565b005b6103a5611715565b6040516103b29190613142565b60405180910390f35b6103c361173f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610450576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044790613323565b60405180910390fd5b600061045c8383611747565b9050600060016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff16817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163373ffffffffffffffffffffffffffffffffffffffff167f450397a2db0e89eccfe664cc6cdfd274a88bc00d29aaec4d991754a42f19f8c9868660405161056f92919061315d565b60405180910390a4505050565b60008073ffffffffffffffffffffffffffffffffffffffff1661059e836114d8565b73ffffffffffffffffffffffffffffffffffffffff1614159050919050565b6105c561173f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610652576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161064990613323565b60405180910390fd5b60008111610695576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161068c90613303565b60405180910390fd5b6106e23382600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117d59092919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b826040516107289190613403565b60405180910390a250565b61073b61173f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107bf90613323565b60405180910390fd5b6107d383838361185b565b505050565b6107e061173f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461086d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086490613323565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156108dd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108d490613203565b60405180910390fd5b6108f1816002611a3d90919063ffffffff16565b610930576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161092790613363565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f33442b8c13e72dd75a027f08f9bff4eed2dfd26e43cdea857365f5163b359a7960016040516109779190613127565b60405180910390a250565b61098a61173f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a17576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a0e90613323565b60405180910390fd5b86600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610a739190612f61565b60206040518083038186803b158015610a8b57600080fd5b505afa158015610a9f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ac391906126fe565b1015610b04576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610afb90613243565b60405180910390fd5b6060308a8a600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168b8b8b8b8b8b8b604051602401610b4d9b9a99989796959493929190612f7c565b6040516020818303038152906040527fbd896dcb000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505090506000610c028280519060200120600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611a6d565b9050610c51818a600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117d59092919063ffffffff16565b8973ffffffffffffffffffffffffffffffffffffffff1682805190602001208273ffffffffffffffffffffffffffffffffffffffff167f3c7ff6acee351ed98200c285a04745858a107e16da2f13c3a81a43073c17d644600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168d8d8d8d8d8d8d604051610ce6989796959493929190613087565b60405180910390a45050505050505050505050565b60016020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610d3661173f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610dc3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dba90613323565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000610e97826002611ae990919063ffffffff16565b9050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610ecf61173f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f5c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f5390613323565b60405180910390fd5b818190508484905014610fa4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f9b906131e3565b60405180910390fd5b60005b8484905081101561100657610ff9858583818110610fc157fe5b9050602002810190610fd3919061341e565b858585818110610fdf57fe5b9050602002016020810190610ff49190612446565b61185b565b8080600101915050610fa7565b5050505050565b60608061101a6002611b19565b67ffffffffffffffff8111801561103057600080fd5b5060405190808252806020026020018201604052801561105f5781602001602082028036833780820191505090505b50905060005b61106f6002611b19565b8110156110dd5761108a816002611b2e90919063ffffffff16565b82828151811061109657fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508080600101915050611065565b508091505090565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000811161114e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161114590613303565b60405180910390fd5b61119d333083600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611b48909392919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f59062170a285eb80e8c6b8ced60428442a51910635005233fc4ce084a475845e826040516111e39190613403565b60405180910390a250565b600061120a836111fd84611bd1565b8051906020012030611c47565b905092915050565b61121a61173f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161129e90613323565b60405180910390fd5b6112bb816002611c8b90919063ffffffff16565b6112fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112f190613283565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f33442b8c13e72dd75a027f08f9bff4eed2dfd26e43cdea857365f5163b359a7960006040516113419190613127565b60405180910390a250565b61135461173f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146113e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113d890613323565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611451576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611448906132a3565b60405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167f30909084afc859121ffc3a5aef7fe37c540a9a1ef60bd4d8dcdb76376fadf9de60405160405180910390a250565b600060016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b61155b61173f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146115e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115df90613323565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611658576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161164f90613223565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600033905090565b60006117cd83836040516024016040516020818303038152906040529190604051611773929190612f48565b60405180910390207bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611cbb565b905092915050565b6118568363a9059cbb60e01b84846040516024016117f492919061305e565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611d13565b505050565b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156118ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118c1906132c3565b60405180910390fd5b6118d381611dda565b611912576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611909906133e3565b60405180910390fd5b600061191e8484611747565b90508160016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff16817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163373ffffffffffffffffffffffffffffffffffffffff167f450397a2db0e89eccfe664cc6cdfd274a88bc00d29aaec4d991754a42f19f8c98787604051611a2f92919061315d565b60405180910390a450505050565b6000611a65836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611ded565b905092915050565b600080611a84600086611a7f87611bd1565b611e5d565b90508073ffffffffffffffffffffffffffffffffffffffff167efffc2da0b561cae30d9826d37709e9421c4725faebc226cbbb7ef5fc5e734960405160405180910390a2600083511115611ade57611adc8184611f6e565b505b809150509392505050565b6000611b11836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611fb8565b905092915050565b6000611b2782600001611fdb565b9050919050565b6000611b3d8360000183611fec565b60001c905092915050565b611bcb846323b872dd60e01b858585604051602401611b6993929190613027565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611d13565b50505050565b60606000693d602d80600a3d3981f360b01b9050600069363d3d373d3d3d363d7360b01b905060008460601b905060006e5af43d82803e903d91602b57fd5bf360881b905083838383604051602001611c2d9493929190612e95565b604051602081830303815290604052945050505050919050565b60008060ff60f81b838686604051602001611c659493929190612ee3565b6040516020818303038152906040528051906020012090508060001c9150509392505050565b6000611cb3836000018373ffffffffffffffffffffffffffffffffffffffff1660001b612059565b905092915050565b60006004825114611d01576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cf890613343565b60405180910390fd5b60006020830151905080915050919050565b6060611d75826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166121419092919063ffffffff16565b9050600081511115611dd55780806020019051810190611d9591906125aa565b611dd4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dcb906133a3565b60405180910390fd5b5b505050565b600080823b905060008111915050919050565b6000611df98383611fb8565b611e52578260000182908060018154018082558091505060019003906000526020600020016000909190919091505582600001805490508360010160008481526020019081526020016000208190555060019050611e57565b600090505b92915050565b60008084471015611ea3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e9a906133c3565b60405180910390fd5b600083511415611ee8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611edf906131c3565b60405180910390fd5b8383516020850187f59050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611f63576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f5a906132e3565b60405180910390fd5b809150509392505050565b6060611fb083836040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c65640000815250612141565b905092915050565b600080836001016000848152602001908152602001600020541415905092915050565b600081600001805490509050919050565b600081836000018054905011612037576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161202e906131a3565b60405180910390fd5b82600001828154811061204657fe5b9060005260206000200154905092915050565b6000808360010160008481526020019081526020016000205490506000811461213557600060018203905060006001866000018054905003905060008660000182815481106120a457fe5b90600052602060002001549050808760000184815481106120c157fe5b90600052602060002001819055506001830187600101600083815260200190815260200160002081905550866000018054806120f957fe5b6001900381819060005260206000200160009055905586600101600087815260200190815260200160002060009055600194505050505061213b565b60009150505b92915050565b60606121508484600085612159565b90509392505050565b60608247101561219e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161219590613263565b60405180910390fd5b6121a785611dda565b6121e6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121dd90613383565b60405180910390fd5b600060608673ffffffffffffffffffffffffffffffffffffffff1685876040516122109190612f31565b60006040518083038185875af1925050503d806000811461224d576040519150601f19603f3d011682016040523d82523d6000602084013e612252565b606091505b509150915061226282828661226e565b92505050949350505050565b6060831561227e578290506122ce565b6000835111156122915782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122c59190613181565b60405180910390fd5b9392505050565b6000813590506122e48161372e565b92915050565b60008083601f8401126122fc57600080fd5b8235905067ffffffffffffffff81111561231557600080fd5b60208301915083602082028301111561232d57600080fd5b9250929050565b60008083601f84011261234657600080fd5b8235905067ffffffffffffffff81111561235f57600080fd5b60208301915083602082028301111561237757600080fd5b9250929050565b60008151905061238d81613745565b92915050565b6000813590506123a28161375c565b92915050565b6000813590506123b781613773565b92915050565b6000813590506123cc8161378a565b92915050565b60008083601f8401126123e457600080fd5b8235905067ffffffffffffffff8111156123fd57600080fd5b60208301915083600182028301111561241557600080fd5b9250929050565b60008135905061242b8161379a565b92915050565b6000815190506124408161379a565b92915050565b60006020828403121561245857600080fd5b6000612466848285016122d5565b91505092915050565b60008060008060008060008060006101208a8c03121561248e57600080fd5b600061249c8c828d016122d5565b99505060206124ad8c828d016122d5565b98505060406124be8c828d0161241c565b97505060606124cf8c828d0161241c565b96505060806124e08c828d0161241c565b95505060a06124f18c828d0161241c565b94505060c06125028c828d0161241c565b93505060e06125138c828d0161241c565b9250506101006125258c828d016123bd565b9150509295985092959850929598565b6000806000806040858703121561254b57600080fd5b600085013567ffffffffffffffff81111561256557600080fd5b61257187828801612334565b9450945050602085013567ffffffffffffffff81111561259057600080fd5b61259c878288016122ea565b925092505092959194509250565b6000602082840312156125bc57600080fd5b60006125ca8482850161237e565b91505092915050565b600080604083850312156125e657600080fd5b60006125f485828601612393565b9250506020612605858286016122d5565b9150509250929050565b60006020828403121561262157600080fd5b600061262f848285016123a8565b91505092915050565b6000806020838503121561264b57600080fd5b600083013567ffffffffffffffff81111561266557600080fd5b612671858286016123d2565b92509250509250929050565b60008060006040848603121561269257600080fd5b600084013567ffffffffffffffff8111156126ac57600080fd5b6126b8868287016123d2565b935093505060206126cb868287016122d5565b9150509250925092565b6000602082840312156126e757600080fd5b60006126f58482850161241c565b91505092915050565b60006020828403121561271057600080fd5b600061271e84828501612431565b91505092915050565b6000612733838361273f565b60208301905092915050565b612748816134eb565b82525050565b612757816134eb565b82525050565b61276e612769826134eb565b6136a4565b82525050565b600061277f82613485565b61278981856134b3565b935061279483613475565b8060005b838110156127c55781516127ac8882612727565b97506127b7836134a6565b925050600181019050612798565b5085935050505092915050565b6127db816134fd565b82525050565b6127f26127ed82613535565b6136c0565b82525050565b61280961280482613561565b6136ca565b82525050565b61282061281b82613509565b6136b6565b82525050565b6128376128328261358d565b6136d4565b82525050565b61284e612849826135b9565b6136de565b82525050565b600061285f82613490565b61286981856134c4565b9350612879818560208601613671565b80840191505092915050565b61288e8161362c565b82525050565b61289d81613650565b82525050565b60006128af83856134cf565b93506128bc838584613662565b6128c5836136fc565b840190509392505050565b60006128dc83856134e0565b93506128e9838584613662565b82840190509392505050565b60006129008261349b565b61290a81856134cf565b935061291a818560208601613671565b612923816136fc565b840191505092915050565b600061293b6022836134cf565b91507f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e60008301527f64730000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006129a16020836134cf565b91507f437265617465323a2062797465636f6465206c656e677468206973207a65726f6000830152602082019050919050565b60006129e16015836134cf565b91507f4172726179206c656e677468206d69736d6174636800000000000000000000006000830152602082019050919050565b6000612a21601a836134cf565b91507f44657374696e6174696f6e2063616e6e6f74206265207a65726f0000000000006000830152602082019050919050565b6000612a616026836134cf565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000612ac76020836134cf565b91507f4e6f7420656e6f75676820746f6b656e7320746f20637265617465206c6f636b6000830152602082019050919050565b6000612b076026836134cf565b91507f416464726573733a20696e73756666696369656e742062616c616e636520666f60008301527f722063616c6c00000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000612b6d601b836134cf565b91507f44657374696e6174696f6e20616c72656164792072656d6f76656400000000006000830152602082019050919050565b6000612bad6019836134cf565b91507f4d6173746572436f70792063616e6e6f74206265207a65726f000000000000006000830152602082019050919050565b6000612bed601d836134cf565b91507f546172676574206d757374206265206f7468657220636f6e74726163740000006000830152602082019050919050565b6000612c2d6019836134cf565b91507f437265617465323a204661696c6564206f6e206465706c6f79000000000000006000830152602082019050919050565b6000612c6d6015836134cf565b91507f416d6f756e742063616e6e6f74206265207a65726f00000000000000000000006000830152602082019050919050565b6000612cad6020836134cf565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b6000612ced6018836134cf565b91507f496e76616c6964206d6574686f64207369676e617475726500000000000000006000830152602082019050919050565b6000612d2d6019836134cf565b91507f44657374696e6174696f6e20616c7265616479206164646564000000000000006000830152602082019050919050565b6000612d6d601d836134cf565b91507f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006000830152602082019050919050565b6000612dad602a836134cf565b91507f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008301527f6f742073756363656564000000000000000000000000000000000000000000006020830152604082019050919050565b6000612e13601d836134cf565b91507f437265617465323a20696e73756666696369656e742062616c616e63650000006000830152602082019050919050565b6000612e536019836134cf565b91507f546172676574206d757374206265206120636f6e7472616374000000000000006000830152602082019050919050565b612e8f81613622565b82525050565b6000612ea182876127e1565b600a82019150612eb182866127e1565b600a82019150612ec18285612826565b601482019150612ed182846127f8565b600f8201915081905095945050505050565b6000612eef828761280f565b600182019150612eff828661275d565b601482019150612f0f828561283d565b602082019150612f1f828461283d565b60208201915081905095945050505050565b6000612f3d8284612854565b915081905092915050565b6000612f558284866128d0565b91508190509392505050565b6000602082019050612f76600083018461274e565b92915050565b600061016082019050612f92600083018e61274e565b612f9f602083018d61274e565b612fac604083018c61274e565b612fb9606083018b61274e565b612fc6608083018a612e86565b612fd360a0830189612e86565b612fe060c0830188612e86565b612fed60e0830187612e86565b612ffb610100830186612e86565b613009610120830185612e86565b613017610140830184612894565b9c9b505050505050505050505050565b600060608201905061303c600083018661274e565b613049602083018561274e565b6130566040830184612e86565b949350505050565b6000604082019050613073600083018561274e565b6130806020830184612e86565b9392505050565b60006101008201905061309d600083018b61274e565b6130aa602083018a612e86565b6130b76040830189612e86565b6130c46060830188612e86565b6130d16080830187612e86565b6130de60a0830186612e86565b6130eb60c0830185612e86565b6130f860e0830184612894565b9998505050505050505050565b6000602082019050818103600083015261311f8184612774565b905092915050565b600060208201905061313c60008301846127d2565b92915050565b60006020820190506131576000830184612885565b92915050565b600060208201905081810360008301526131788184866128a3565b90509392505050565b6000602082019050818103600083015261319b81846128f5565b905092915050565b600060208201905081810360008301526131bc8161292e565b9050919050565b600060208201905081810360008301526131dc81612994565b9050919050565b600060208201905081810360008301526131fc816129d4565b9050919050565b6000602082019050818103600083015261321c81612a14565b9050919050565b6000602082019050818103600083015261323c81612a54565b9050919050565b6000602082019050818103600083015261325c81612aba565b9050919050565b6000602082019050818103600083015261327c81612afa565b9050919050565b6000602082019050818103600083015261329c81612b60565b9050919050565b600060208201905081810360008301526132bc81612ba0565b9050919050565b600060208201905081810360008301526132dc81612be0565b9050919050565b600060208201905081810360008301526132fc81612c20565b9050919050565b6000602082019050818103600083015261331c81612c60565b9050919050565b6000602082019050818103600083015261333c81612ca0565b9050919050565b6000602082019050818103600083015261335c81612ce0565b9050919050565b6000602082019050818103600083015261337c81612d20565b9050919050565b6000602082019050818103600083015261339c81612d60565b9050919050565b600060208201905081810360008301526133bc81612da0565b9050919050565b600060208201905081810360008301526133dc81612e06565b9050919050565b600060208201905081810360008301526133fc81612e46565b9050919050565b60006020820190506134186000830184612e86565b92915050565b6000808335600160200384360303811261343757600080fd5b80840192508235915067ffffffffffffffff82111561345557600080fd5b60208301925060018202360383131561346d57600080fd5b509250929050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b60006134f682613602565b9050919050565b60008115159050919050565b60007fff0000000000000000000000000000000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffff0000000000000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffffffffffffff000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffffffffffffffffffffffff00000000000000000000000082169050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b60008190506135fd8261371a565b919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60006136378261363e565b9050919050565b600061364982613602565b9050919050565b600061365b826135ef565b9050919050565b82818337600083830152505050565b60005b8381101561368f578082015181840152602081019050613674565b8381111561369e576000848401525b50505050565b60006136af826136e8565b9050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b60006136f38261370d565b9050919050565bfe5b6000601f19601f8301169050919050565b60008160601b9050919050565b6003811061372b5761372a6136fa565b5b50565b613737816134eb565b811461374257600080fd5b50565b61374e816134fd565b811461375957600080fd5b50565b613765816135b9565b811461377057600080fd5b50565b61377c816135c3565b811461378757600080fd5b50565b6003811061379757600080fd5b50565b6137a381613622565b81146137ae57600080fd5b5056fea2646970667358221220ce8e84f89eb556f2f74739a29d42b007afeaac5ac92a1454d6c07fa4523a0a9564736f6c63430007030033", + "devdoc": { + "kind": "dev", + "methods": { + "addTokenDestination(address)": { + "params": { + "_dst": "Destination address" + } + }, + "constructor": { + "params": { + "_graphToken": "Token to use for deposits and withdrawals", + "_masterCopy": "Address of the master copy to use to clone proxies" + } + }, + "createTokenLockWallet(address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)": { + "params": { + "_beneficiary": "Address of the beneficiary of locked tokens", + "_endTime": "End time of the release schedule", + "_managedAmount": "Amount of tokens to be managed by the lock contract", + "_owner": "Address of the contract owner", + "_periods": "Number of periods between start time and end time", + "_releaseStartTime": "Override time for when the releases start", + "_revocable": "Whether the contract is revocable", + "_startTime": "Start time of the release schedule" + } + }, + "deposit(uint256)": { + "details": "Even if the ERC20 token can be transferred directly to the contract this function provide a safe interface to do the transfer and avoid mistakes", + "params": { + "_amount": "Amount to deposit" + } + }, + "getAuthFunctionCallTarget(bytes4)": { + "params": { + "_sigHash": "Function signature hash" + }, + "returns": { + "_0": "Address of the target contract where to send the call" + } + }, + "getDeploymentAddress(bytes32,address)": { + "params": { + "_implementation": "Address of the proxy target implementation", + "_salt": "Bytes32 salt to use for CREATE2" + }, + "returns": { + "_0": "Address of the counterfactual MinimalProxy" + } + }, + "getTokenDestinations()": { + "returns": { + "_0": "Array of addresses authorized to pull funds from a token lock" + } + }, + "isAuthFunctionCall(bytes4)": { + "params": { + "_sigHash": "Function signature hash" + }, + "returns": { + "_0": "True if authorized" + } + }, + "isTokenDestination(address)": { + "params": { + "_dst": "Destination address" + }, + "returns": { + "_0": "True if authorized" + } + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "removeTokenDestination(address)": { + "params": { + "_dst": "Destination address" + } + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." + }, + "setAuthFunctionCall(string,address)": { + "details": "Input expected is the function signature as 'transfer(address,uint256)'", + "params": { + "_signature": "Function signature", + "_target": "Address of the destination contract to call" + } + }, + "setAuthFunctionCallMany(string[],address[])": { + "details": "Input expected is the function signature as 'transfer(address,uint256)'", + "params": { + "_signatures": "Function signatures", + "_targets": "Address of the destination contract to call" + } + }, + "setMasterCopy(address)": { + "params": { + "_masterCopy": "Address of contract bytecode to factory clone" + } + }, + "token()": { + "returns": { + "_0": "Token used for transfers and approvals" + } + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + }, + "unsetAuthFunctionCall(string)": { + "details": "Input expected is the function signature as 'transfer(address,uint256)'", + "params": { + "_signature": "Function signature" + } + }, + "withdraw(uint256)": { + "details": "Escape hatch in case of mistakes or to recover remaining funds", + "params": { + "_amount": "Amount of tokens to withdraw" + } + } + }, + "title": "GraphTokenLockManager", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "addTokenDestination(address)": { + "notice": "Adds an address that can be allowed by a token lock to pull funds" + }, + "constructor": { + "notice": "Constructor." + }, + "createTokenLockWallet(address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)": { + "notice": "Creates and fund a new token lock wallet using a minimum proxy" + }, + "deposit(uint256)": { + "notice": "Deposits tokens into the contract" + }, + "getAuthFunctionCallTarget(bytes4)": { + "notice": "Gets the target contract to call for a particular function signature" + }, + "getDeploymentAddress(bytes32,address)": { + "notice": "Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation" + }, + "getTokenDestinations()": { + "notice": "Returns an array of authorized destination addresses" + }, + "isAuthFunctionCall(bytes4)": { + "notice": "Returns true if the function call is authorized" + }, + "isTokenDestination(address)": { + "notice": "Returns True if the address is authorized to be a destination of tokens" + }, + "removeTokenDestination(address)": { + "notice": "Removes an address that can be allowed by a token lock to pull funds" + }, + "setAuthFunctionCall(string,address)": { + "notice": "Sets an authorized function call to target" + }, + "setAuthFunctionCallMany(string[],address[])": { + "notice": "Sets an authorized function call to target in bulk" + }, + "setMasterCopy(address)": { + "notice": "Sets the masterCopy bytecode to use to create clones of TokenLock contracts" + }, + "token()": { + "notice": "Gets the GRT token address" + }, + "unsetAuthFunctionCall(string)": { + "notice": "Unsets an authorized function call to target" + }, + "withdraw(uint256)": { + "notice": "Withdraws tokens from the contract" + } + }, + "notice": "This contract manages a list of authorized function calls and targets that can be called by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts. This contract receives funds to make the process of creating TokenLockWallet contracts easier by distributing them the initial tokens to be managed. The owner can setup a list of token destinations that will be used by TokenLock contracts to approve the pulling of funds, this way in can be guaranteed that only protocol contracts will manipulate users funds.", + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 30, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "_owner", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 3003, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "authFnCalls", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_bytes4,t_address)" + }, + { + "astId": 3005, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "_tokenDestinations", + "offset": 0, + "slot": "2", + "type": "t_struct(AddressSet)1749_storage" + }, + { + "astId": 3007, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "masterCopy", + "offset": 0, + "slot": "4", + "type": "t_address" + }, + { + "astId": 3009, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "_token", + "offset": 0, + "slot": "5", + "type": "t_contract(IERC20)908" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_bytes32)dyn_storage": { + "base": "t_bytes32", + "encoding": "dynamic_array", + "label": "bytes32[]", + "numberOfBytes": "32" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_bytes4": { + "encoding": "inplace", + "label": "bytes4", + "numberOfBytes": "4" + }, + "t_contract(IERC20)908": { + "encoding": "inplace", + "label": "contract IERC20", + "numberOfBytes": "20" + }, + "t_mapping(t_bytes32,t_uint256)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_mapping(t_bytes4,t_address)": { + "encoding": "mapping", + "key": "t_bytes4", + "label": "mapping(bytes4 => address)", + "numberOfBytes": "32", + "value": "t_address" + }, + "t_struct(AddressSet)1749_storage": { + "encoding": "inplace", + "label": "struct EnumerableSet.AddressSet", + "members": [ + { + "astId": 1748, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "_inner", + "offset": 0, + "slot": "0", + "type": "t_struct(Set)1484_storage" + } + ], + "numberOfBytes": "64" + }, + "t_struct(Set)1484_storage": { + "encoding": "inplace", + "label": "struct EnumerableSet.Set", + "members": [ + { + "astId": 1479, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "_values", + "offset": 0, + "slot": "0", + "type": "t_array(t_bytes32)dyn_storage" + }, + { + "astId": 1483, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "_indexes", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_bytes32,t_uint256)" + } + ], + "numberOfBytes": "64" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} \ No newline at end of file diff --git a/packages/token-distribution/deployments/rinkeby/GraphTokenLockWallet.json b/packages/token-distribution/deployments/rinkeby/GraphTokenLockWallet.json new file mode 100644 index 000000000..0f70b7d37 --- /dev/null +++ b/packages/token-distribution/deployments/rinkeby/GraphTokenLockWallet.json @@ -0,0 +1,968 @@ +{ + "address": "0x6Eb5538d1E805a503893Cd23AE980320Eb8358C8", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_oldManager", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "_newManager", + "type": "address" + } + ], + "name": "ManagerUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "TokenDestinationsApproved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "TokenDestinationsRevoked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensReleased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensRevoked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensWithdrawn", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "amountPerPeriod", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "approveProtocol", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "availableAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "beneficiary", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "currentBalance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "currentPeriod", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "currentTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "duration", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "endTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_manager", + "type": "address" + }, + { + "internalType": "address", + "name": "_owner", + "type": "address" + }, + { + "internalType": "address", + "name": "_beneficiary", + "type": "address" + }, + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_managedAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_startTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_endTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_periods", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_releaseStartTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_vestingCliffTime", + "type": "uint256" + }, + { + "internalType": "enum IGraphTokenLock.Revocability", + "name": "_revocable", + "type": "uint8" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "isInitialized", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isRevoked", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "managedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "manager", + "outputs": [ + { + "internalType": "contract IGraphTokenLockManager", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "passedPeriods", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "periodDuration", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "periods", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "releasableAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "release", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "releaseStartTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "releasedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "revocable", + "outputs": [ + { + "internalType": "enum IGraphTokenLock.Revocability", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "revoke", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "revokeProtocol", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newManager", + "type": "address" + } + ], + "name": "setManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "sinceStartTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "startTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "surplusAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "token", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalOutstandingAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "usedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "vestedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "vestingCliffTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "withdrawSurplus", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x071fb2ebafb0e8fb68ee80f73f0ed0ee557a238e216cfb247fb6ac64544c0c75", + "receipt": { + "to": null, + "from": "0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9", + "contractAddress": "0x6Eb5538d1E805a503893Cd23AE980320Eb8358C8", + "transactionIndex": 0, + "gasUsed": "3149102", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xf3b421de1dd45e116c84fd76b143c22cece825ff96bac9291cb25a9104e982e8", + "transactionHash": "0x071fb2ebafb0e8fb68ee80f73f0ed0ee557a238e216cfb247fb6ac64544c0c75", + "logs": [], + "blockNumber": 7727643, + "cumulativeGasUsed": "3149102", + "status": 1, + "byzantium": true + }, + "args": [], + "solcInputHash": "a72ab6278ade6c5c10115f7be2c555c9", + "metadata": "{\"compiler\":{\"version\":\"0.7.3+commit.9bfce1f6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_oldManager\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_newManager\",\"type\":\"address\"}],\"name\":\"ManagerUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"TokenDestinationsApproved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"TokenDestinationsRevoked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensReleased\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensRevoked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensWithdrawn\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"amountPerPeriod\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"approveProtocol\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"availableAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"beneficiary\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"currentBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"currentPeriod\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"currentTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"duration\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"endTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_manager\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_beneficiary\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_managedAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_startTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_endTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_periods\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_releaseStartTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_vestingCliffTime\",\"type\":\"uint256\"},{\"internalType\":\"enum IGraphTokenLock.Revocability\",\"name\":\"_revocable\",\"type\":\"uint8\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isInitialized\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isRevoked\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"managedAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"manager\",\"outputs\":[{\"internalType\":\"contract IGraphTokenLockManager\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"passedPeriods\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"periodDuration\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"periods\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"releasableAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"release\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"releaseStartTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"releasedAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"revocable\",\"outputs\":[{\"internalType\":\"enum IGraphTokenLock.Revocability\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"revoke\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"revokeProtocol\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_newManager\",\"type\":\"address\"}],\"name\":\"setManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"sinceStartTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"startTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"surplusAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalOutstandingAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"usedAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"vestedAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"vestingCliffTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdrawSurplus\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"amountPerPeriod()\":{\"returns\":{\"_0\":\"Amount of tokens available after each period\"}},\"approveProtocol()\":{\"details\":\"Approves all token destinations registered in the manager to pull tokens\"},\"availableAmount()\":{\"details\":\"Implements the step-by-step schedule based on periods for available tokens\",\"returns\":{\"_0\":\"Amount of tokens available according to the schedule\"}},\"currentBalance()\":{\"returns\":{\"_0\":\"Tokens held in the contract\"}},\"currentPeriod()\":{\"returns\":{\"_0\":\"A number that represents the current period\"}},\"currentTime()\":{\"returns\":{\"_0\":\"Current block timestamp\"}},\"duration()\":{\"returns\":{\"_0\":\"Amount of seconds from contract startTime to endTime\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"passedPeriods()\":{\"returns\":{\"_0\":\"A number of periods that passed since the schedule started\"}},\"periodDuration()\":{\"returns\":{\"_0\":\"Duration of each period in seconds\"}},\"releasableAmount()\":{\"details\":\"Considers the schedule and takes into account already released tokens\",\"returns\":{\"_0\":\"Amount of tokens ready to be released\"}},\"release()\":{\"details\":\"All available releasable tokens are transferred to beneficiary\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"revoke()\":{\"details\":\"Vesting schedule is always calculated based on managed tokens\"},\"revokeProtocol()\":{\"details\":\"Revokes approval to all token destinations in the manager to pull tokens\"},\"setManager(address)\":{\"params\":{\"_newManager\":\"Address of the new manager\"}},\"sinceStartTime()\":{\"details\":\"Returns zero if called before conctract starTime\",\"returns\":{\"_0\":\"Seconds elapsed from contract startTime\"}},\"surplusAmount()\":{\"details\":\"All funds over outstanding amount is considered surplus that can be withdrawn by beneficiary\",\"returns\":{\"_0\":\"Amount of tokens considered as surplus\"}},\"totalOutstandingAmount()\":{\"details\":\"Does not consider schedule but just global amounts tracked\",\"returns\":{\"_0\":\"Amount of outstanding tokens for the lifetime of the contract\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"vestedAmount()\":{\"details\":\"Similar to available amount, but is fully vested when contract is non-revocable\",\"returns\":{\"_0\":\"Amount of tokens already vested\"}},\"withdrawSurplus(uint256)\":{\"details\":\"Tokens in the contract over outstanding amount are considered as surplus\",\"params\":{\"_amount\":\"Amount of tokens to withdraw\"}}},\"title\":\"GraphTokenLockWallet\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"amountPerPeriod()\":{\"notice\":\"Returns amount available to be released after each period according to schedule\"},\"approveProtocol()\":{\"notice\":\"Approves protocol access of the tokens managed by this contract\"},\"availableAmount()\":{\"notice\":\"Gets the currently available token according to the schedule\"},\"currentBalance()\":{\"notice\":\"Returns the amount of tokens currently held by the contract\"},\"currentPeriod()\":{\"notice\":\"Gets the current period based on the schedule\"},\"currentTime()\":{\"notice\":\"Returns the current block timestamp\"},\"duration()\":{\"notice\":\"Gets duration of contract from start to end in seconds\"},\"passedPeriods()\":{\"notice\":\"Gets the number of periods that passed since the first period\"},\"periodDuration()\":{\"notice\":\"Returns the duration of each period in seconds\"},\"releasableAmount()\":{\"notice\":\"Gets tokens currently available for release\"},\"release()\":{\"notice\":\"Releases tokens based on the configured schedule\"},\"revoke()\":{\"notice\":\"Revokes a vesting schedule and return the unvested tokens to the owner\"},\"revokeProtocol()\":{\"notice\":\"Revokes protocol access of the tokens managed by this contract\"},\"setManager(address)\":{\"notice\":\"Sets a new manager for this contract\"},\"sinceStartTime()\":{\"notice\":\"Gets time elapsed since the start of the contract\"},\"surplusAmount()\":{\"notice\":\"Gets surplus amount in the contract based on outstanding amount to release\"},\"totalOutstandingAmount()\":{\"notice\":\"Gets the outstanding amount yet to be released based on the whole contract lifetime\"},\"vestedAmount()\":{\"notice\":\"Gets the amount of currently vested tokens\"},\"withdrawSurplus(uint256)\":{\"notice\":\"Withdraws surplus, unmanaged tokens from the contract\"}},\"notice\":\"This contract is built on top of the base GraphTokenLock functionality. It allows wallet beneficiaries to use the deposited funds to perform specific function calls on specific contracts. The idea is that supporters with locked tokens can participate in the protocol but disallow any release before the vesting/lock schedule. The beneficiary can issue authorized function calls to this contract that will get forwarded to a target contract. A target contract is any of our protocol contracts. The function calls allowed are queried to the GraphTokenLockManager, this way the same configuration can be shared for all the created lock wallet contracts. NOTE: Contracts used as target must have its function signatures checked to avoid collisions with any of this contract functions. Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience the maximum amount of tokens is authorized.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/GraphTokenLockWallet.sol\":\"GraphTokenLockWallet\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/math/SafeMath.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Wrappers over Solidity's arithmetic operations with added overflow\\n * checks.\\n *\\n * Arithmetic operations in Solidity wrap on overflow. This can easily result\\n * in bugs, because programmers usually assume that an overflow raises an\\n * error, which is the standard behavior in high level programming languages.\\n * `SafeMath` restores this intuition by reverting the transaction when an\\n * operation overflows.\\n *\\n * Using this library instead of the unchecked operations eliminates an entire\\n * class of bugs, so it's recommended to use it always.\\n */\\nlibrary SafeMath {\\n /**\\n * @dev Returns the addition of two unsigned integers, reverting on\\n * overflow.\\n *\\n * Counterpart to Solidity's `+` operator.\\n *\\n * Requirements:\\n *\\n * - Addition cannot overflow.\\n */\\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\\n uint256 c = a + b;\\n require(c >= a, \\\"SafeMath: addition overflow\\\");\\n\\n return c;\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting on\\n * overflow (when the result is negative).\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n *\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\\n return sub(a, b, \\\"SafeMath: subtraction overflow\\\");\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\\n * overflow (when the result is negative).\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n *\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b <= a, errorMessage);\\n uint256 c = a - b;\\n\\n return c;\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, reverting on\\n * overflow.\\n *\\n * Counterpart to Solidity's `*` operator.\\n *\\n * Requirements:\\n *\\n * - Multiplication cannot overflow.\\n */\\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\\n if (a == 0) {\\n return 0;\\n }\\n\\n uint256 c = a * b;\\n require(c / a == b, \\\"SafeMath: multiplication overflow\\\");\\n\\n return c;\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers. Reverts on\\n * division by zero. The result is rounded towards zero.\\n *\\n * Counterpart to Solidity's `/` operator. Note: this function uses a\\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\\n * uses an invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\\n return div(a, b, \\\"SafeMath: division by zero\\\");\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers. Reverts with custom message on\\n * division by zero. The result is rounded towards zero.\\n *\\n * Counterpart to Solidity's `/` operator. Note: this function uses a\\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\\n * uses an invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b > 0, errorMessage);\\n uint256 c = a / b;\\n // assert(a == b * c + a % b); // There is no case in which this doesn't hold\\n\\n return c;\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * Reverts when dividing by zero.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\\n return mod(a, b, \\\"SafeMath: modulo by zero\\\");\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * Reverts with custom message when dividing by zero.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b != 0, errorMessage);\\n return a % b;\\n }\\n}\\n\",\"keccak256\":\"0x3b21f2c8d626de3b9925ae33e972d8bf5c8b1bffb3f4ee94daeed7d0679036e6\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `recipient`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address recipient, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `sender` to `recipient` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n}\\n\",\"keccak256\":\"0x5f02220344881ce43204ae4a6281145a67bc52c2bb1290a791857df3d19d78f5\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\nimport \\\"./IERC20.sol\\\";\\nimport \\\"../../math/SafeMath.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @title SafeERC20\\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\\n * contract returns false). Tokens that return no value (and instead revert or\\n * throw on failure) are also supported, non-reverting calls are assumed to be\\n * successful.\\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\n */\\nlibrary SafeERC20 {\\n using SafeMath for uint256;\\n using Address for address;\\n\\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\\n }\\n\\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\\n }\\n\\n /**\\n * @dev Deprecated. This function has issues similar to the ones found in\\n * {IERC20-approve}, and its usage is discouraged.\\n *\\n * Whenever possible, use {safeIncreaseAllowance} and\\n * {safeDecreaseAllowance} instead.\\n */\\n function safeApprove(IERC20 token, address spender, uint256 value) internal {\\n // safeApprove should only be called when setting an initial allowance,\\n // or when resetting it to zero. To increase and decrease it, use\\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\\n // solhint-disable-next-line max-line-length\\n require((value == 0) || (token.allowance(address(this), spender) == 0),\\n \\\"SafeERC20: approve from non-zero to non-zero allowance\\\"\\n );\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\\n }\\n\\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n uint256 newAllowance = token.allowance(address(this), spender).add(value);\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n uint256 newAllowance = token.allowance(address(this), spender).sub(value, \\\"SafeERC20: decreased allowance below zero\\\");\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n */\\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that\\n // the target address contains contract code and also asserts for success in the low-level call.\\n\\n bytes memory returndata = address(token).functionCall(data, \\\"SafeERC20: low-level call failed\\\");\\n if (returndata.length > 0) { // Return data is optional\\n // solhint-disable-next-line max-line-length\\n require(abi.decode(returndata, (bool)), \\\"SafeERC20: ERC20 operation did not succeed\\\");\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf12dfbe97e6276980b83d2830bb0eb75e0cf4f3e626c2471137f82158ae6a0fc\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.2 <0.8.0;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize, which returns 0 for contracts in\\n // construction, since the code is only stored at the end of the\\n // constructor execution.\\n\\n uint256 size;\\n // solhint-disable-next-line no-inline-assembly\\n assembly { size := extcodesize(account) }\\n return size > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls, avoid-call-value\\n (bool success, ) = recipient.call{ value: amount }(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain`call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.call{ value: value }(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xa6a15ddddcbf29d2922a1e0d4151b5d2d33da24b93cc9ebc12390e0d855532f8\",\"license\":\"MIT\"},\"contracts/GraphTokenLock.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nimport \\\"@openzeppelin/contracts/math/SafeMath.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\\\";\\n\\nimport \\\"./Ownable.sol\\\";\\nimport \\\"./MathUtils.sol\\\";\\nimport \\\"./IGraphTokenLock.sol\\\";\\n\\n/**\\n * @title GraphTokenLock\\n * @notice Contract that manages an unlocking schedule of tokens.\\n * @dev The contract lock manage a number of tokens deposited into the contract to ensure that\\n * they can only be released under certain time conditions.\\n *\\n * This contract implements a release scheduled based on periods and tokens are released in steps\\n * after each period ends. It can be configured with one period in which case it is like a plain TimeLock.\\n * It also supports revocation to be used for vesting schedules.\\n *\\n * The contract supports receiving extra funds than the managed tokens ones that can be\\n * withdrawn by the beneficiary at any time.\\n *\\n * A releaseStartTime parameter is included to override the default release schedule and\\n * perform the first release on the configured time. After that it will continue with the\\n * default schedule.\\n */\\nabstract contract GraphTokenLock is Ownable, IGraphTokenLock {\\n using SafeMath for uint256;\\n using SafeERC20 for IERC20;\\n\\n uint256 private constant MIN_PERIOD = 1;\\n\\n // -- State --\\n\\n IERC20 public token;\\n address public beneficiary;\\n\\n // Configuration\\n\\n // Amount of tokens managed by the contract schedule\\n uint256 public managedAmount;\\n\\n uint256 public startTime; // Start datetime (in unixtimestamp)\\n uint256 public endTime; // Datetime after all funds are fully vested/unlocked (in unixtimestamp)\\n uint256 public periods; // Number of vesting/release periods\\n\\n // First release date for tokens (in unixtimestamp)\\n // If set, no tokens will be released before releaseStartTime ignoring\\n // the amount to release each period\\n uint256 public releaseStartTime;\\n // A cliff set a date to which a beneficiary needs to get to vest\\n // all preceding periods\\n uint256 public vestingCliffTime;\\n Revocability public revocable; // Whether to use vesting for locked funds\\n\\n // State\\n\\n bool public isRevoked;\\n bool public isInitialized;\\n uint256 public releasedAmount;\\n\\n // -- Events --\\n\\n event TokensReleased(address indexed beneficiary, uint256 amount);\\n event TokensWithdrawn(address indexed beneficiary, uint256 amount);\\n event TokensRevoked(address indexed beneficiary, uint256 amount);\\n\\n /**\\n * @dev Only allow calls from the beneficiary of the contract\\n */\\n modifier onlyBeneficiary() {\\n require(msg.sender == beneficiary, \\\"!auth\\\");\\n _;\\n }\\n\\n /**\\n * @notice Initializes the contract\\n * @param _owner Address of the contract owner\\n * @param _beneficiary Address of the beneficiary of locked tokens\\n * @param _managedAmount Amount of tokens to be managed by the lock contract\\n * @param _startTime Start time of the release schedule\\n * @param _endTime End time of the release schedule\\n * @param _periods Number of periods between start time and end time\\n * @param _releaseStartTime Override time for when the releases start\\n * @param _vestingCliffTime Override time for when the vesting start\\n * @param _revocable Whether the contract is revocable\\n */\\n function _initialize(\\n address _owner,\\n address _beneficiary,\\n address _token,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n Revocability _revocable\\n ) internal {\\n require(!isInitialized, \\\"Already initialized\\\");\\n require(_owner != address(0), \\\"Owner cannot be zero\\\");\\n require(_beneficiary != address(0), \\\"Beneficiary cannot be zero\\\");\\n require(_token != address(0), \\\"Token cannot be zero\\\");\\n require(_managedAmount > 0, \\\"Managed tokens cannot be zero\\\");\\n require(_startTime != 0, \\\"Start time must be set\\\");\\n require(_startTime < _endTime, \\\"Start time > end time\\\");\\n require(_periods >= MIN_PERIOD, \\\"Periods cannot be below minimum\\\");\\n require(_revocable != Revocability.NotSet, \\\"Must set a revocability option\\\");\\n require(_releaseStartTime < _endTime, \\\"Release start time must be before end time\\\");\\n require(_vestingCliffTime < _endTime, \\\"Cliff time must be before end time\\\");\\n\\n isInitialized = true;\\n\\n Ownable.initialize(_owner);\\n beneficiary = _beneficiary;\\n token = IERC20(_token);\\n\\n managedAmount = _managedAmount;\\n\\n startTime = _startTime;\\n endTime = _endTime;\\n periods = _periods;\\n\\n // Optionals\\n releaseStartTime = _releaseStartTime;\\n vestingCliffTime = _vestingCliffTime;\\n revocable = _revocable;\\n }\\n\\n // -- Balances --\\n\\n /**\\n * @notice Returns the amount of tokens currently held by the contract\\n * @return Tokens held in the contract\\n */\\n function currentBalance() public override view returns (uint256) {\\n return token.balanceOf(address(this));\\n }\\n\\n // -- Time & Periods --\\n\\n /**\\n * @notice Returns the current block timestamp\\n * @return Current block timestamp\\n */\\n function currentTime() public override view returns (uint256) {\\n return block.timestamp;\\n }\\n\\n /**\\n * @notice Gets duration of contract from start to end in seconds\\n * @return Amount of seconds from contract startTime to endTime\\n */\\n function duration() public override view returns (uint256) {\\n return endTime.sub(startTime);\\n }\\n\\n /**\\n * @notice Gets time elapsed since the start of the contract\\n * @dev Returns zero if called before conctract starTime\\n * @return Seconds elapsed from contract startTime\\n */\\n function sinceStartTime() public override view returns (uint256) {\\n uint256 current = currentTime();\\n if (current <= startTime) {\\n return 0;\\n }\\n return current.sub(startTime);\\n }\\n\\n /**\\n * @notice Returns amount available to be released after each period according to schedule\\n * @return Amount of tokens available after each period\\n */\\n function amountPerPeriod() public override view returns (uint256) {\\n return managedAmount.div(periods);\\n }\\n\\n /**\\n * @notice Returns the duration of each period in seconds\\n * @return Duration of each period in seconds\\n */\\n function periodDuration() public override view returns (uint256) {\\n return duration().div(periods);\\n }\\n\\n /**\\n * @notice Gets the current period based on the schedule\\n * @return A number that represents the current period\\n */\\n function currentPeriod() public override view returns (uint256) {\\n return sinceStartTime().div(periodDuration()).add(MIN_PERIOD);\\n }\\n\\n /**\\n * @notice Gets the number of periods that passed since the first period\\n * @return A number of periods that passed since the schedule started\\n */\\n function passedPeriods() public override view returns (uint256) {\\n return currentPeriod().sub(MIN_PERIOD);\\n }\\n\\n // -- Locking & Release Schedule --\\n\\n /**\\n * @notice Gets the currently available token according to the schedule\\n * @dev Implements the step-by-step schedule based on periods for available tokens\\n * @return Amount of tokens available according to the schedule\\n */\\n function availableAmount() public override view returns (uint256) {\\n uint256 current = currentTime();\\n\\n // Before contract start no funds are available\\n if (current < startTime) {\\n return 0;\\n }\\n\\n // After contract ended all funds are available\\n if (current > endTime) {\\n return managedAmount;\\n }\\n\\n // Get available amount based on period\\n return passedPeriods().mul(amountPerPeriod());\\n }\\n\\n /**\\n * @notice Gets the amount of currently vested tokens\\n * @dev Similar to available amount, but is fully vested when contract is non-revocable\\n * @return Amount of tokens already vested\\n */\\n function vestedAmount() public override view returns (uint256) {\\n // If non-revocable it is fully vested\\n if (revocable == Revocability.Disabled) {\\n return managedAmount;\\n }\\n\\n // Vesting cliff is activated and it has not passed means nothing is vested yet\\n if (vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\\n return 0;\\n }\\n\\n return availableAmount();\\n }\\n\\n /**\\n * @notice Gets tokens currently available for release\\n * @dev Considers the schedule and takes into account already released tokens\\n * @return Amount of tokens ready to be released\\n */\\n function releasableAmount() public override view returns (uint256) {\\n // If a release start time is set no tokens are available for release before this date\\n // If not set it follows the default schedule and tokens are available on\\n // the first period passed\\n if (releaseStartTime > 0 && currentTime() < releaseStartTime) {\\n return 0;\\n }\\n\\n // Vesting cliff is activated and it has not passed means nothing is vested yet\\n // so funds cannot be released\\n if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\\n return 0;\\n }\\n\\n // A beneficiary can never have more releasable tokens than the contract balance\\n uint256 releasable = availableAmount().sub(releasedAmount);\\n return MathUtils.min(currentBalance(), releasable);\\n }\\n\\n /**\\n * @notice Gets the outstanding amount yet to be released based on the whole contract lifetime\\n * @dev Does not consider schedule but just global amounts tracked\\n * @return Amount of outstanding tokens for the lifetime of the contract\\n */\\n function totalOutstandingAmount() public override view returns (uint256) {\\n return managedAmount.sub(releasedAmount);\\n }\\n\\n /**\\n * @notice Gets surplus amount in the contract based on outstanding amount to release\\n * @dev All funds over outstanding amount is considered surplus that can be withdrawn by beneficiary\\n * @return Amount of tokens considered as surplus\\n */\\n function surplusAmount() public override view returns (uint256) {\\n uint256 balance = currentBalance();\\n uint256 outstandingAmount = totalOutstandingAmount();\\n if (balance > outstandingAmount) {\\n return balance.sub(outstandingAmount);\\n }\\n return 0;\\n }\\n\\n // -- Value Transfer --\\n\\n /**\\n * @notice Releases tokens based on the configured schedule\\n * @dev All available releasable tokens are transferred to beneficiary\\n */\\n function release() external override onlyBeneficiary {\\n uint256 amountToRelease = releasableAmount();\\n require(amountToRelease > 0, \\\"No available releasable amount\\\");\\n\\n releasedAmount = releasedAmount.add(amountToRelease);\\n\\n token.safeTransfer(beneficiary, amountToRelease);\\n\\n emit TokensReleased(beneficiary, amountToRelease);\\n }\\n\\n /**\\n * @notice Withdraws surplus, unmanaged tokens from the contract\\n * @dev Tokens in the contract over outstanding amount are considered as surplus\\n * @param _amount Amount of tokens to withdraw\\n */\\n function withdrawSurplus(uint256 _amount) external override onlyBeneficiary {\\n require(_amount > 0, \\\"Amount cannot be zero\\\");\\n require(surplusAmount() >= _amount, \\\"Amount requested > surplus available\\\");\\n\\n token.safeTransfer(beneficiary, _amount);\\n\\n emit TokensWithdrawn(beneficiary, _amount);\\n }\\n\\n /**\\n * @notice Revokes a vesting schedule and return the unvested tokens to the owner\\n * @dev Vesting schedule is always calculated based on managed tokens\\n */\\n function revoke() external override onlyOwner {\\n require(revocable == Revocability.Enabled, \\\"Contract is non-revocable\\\");\\n require(isRevoked == false, \\\"Already revoked\\\");\\n\\n uint256 unvestedAmount = managedAmount.sub(vestedAmount());\\n require(unvestedAmount > 0, \\\"No available unvested amount\\\");\\n\\n isRevoked = true;\\n\\n token.safeTransfer(owner(), unvestedAmount);\\n\\n emit TokensRevoked(beneficiary, unvestedAmount);\\n }\\n}\\n\",\"keccak256\":\"0x4bb186cde23ff896ec75e825b3944e480bd56ec6055cf68b704ba9e44e3aa495\",\"license\":\"MIT\"},\"contracts/GraphTokenLockWallet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"@openzeppelin/contracts/math/SafeMath.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\\\";\\n\\nimport \\\"./GraphTokenLock.sol\\\";\\nimport \\\"./IGraphTokenLockManager.sol\\\";\\n\\n/**\\n * @title GraphTokenLockWallet\\n * @notice This contract is built on top of the base GraphTokenLock functionality.\\n * It allows wallet beneficiaries to use the deposited funds to perform specific function calls\\n * on specific contracts.\\n *\\n * The idea is that supporters with locked tokens can participate in the protocol\\n * but disallow any release before the vesting/lock schedule.\\n * The beneficiary can issue authorized function calls to this contract that will\\n * get forwarded to a target contract. A target contract is any of our protocol contracts.\\n * The function calls allowed are queried to the GraphTokenLockManager, this way\\n * the same configuration can be shared for all the created lock wallet contracts.\\n *\\n * NOTE: Contracts used as target must have its function signatures checked to avoid collisions\\n * with any of this contract functions.\\n * Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience\\n * the maximum amount of tokens is authorized.\\n */\\ncontract GraphTokenLockWallet is GraphTokenLock {\\n using SafeMath for uint256;\\n using SafeERC20 for IERC20;\\n\\n // -- State --\\n\\n IGraphTokenLockManager public manager;\\n uint256 public usedAmount;\\n\\n uint256 private constant MAX_UINT256 = 2**256 - 1;\\n\\n // -- Events --\\n\\n event ManagerUpdated(address indexed _oldManager, address indexed _newManager);\\n event TokenDestinationsApproved();\\n event TokenDestinationsRevoked();\\n\\n // Initializer\\n function initialize(\\n address _manager,\\n address _owner,\\n address _beneficiary,\\n address _token,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n Revocability _revocable\\n ) external {\\n _initialize(\\n _owner,\\n _beneficiary,\\n _token,\\n _managedAmount,\\n _startTime,\\n _endTime,\\n _periods,\\n _releaseStartTime,\\n _vestingCliffTime,\\n _revocable\\n );\\n _setManager(_manager);\\n }\\n\\n // -- Admin --\\n\\n /**\\n * @notice Sets a new manager for this contract\\n * @param _newManager Address of the new manager\\n */\\n function setManager(address _newManager) external onlyOwner {\\n _setManager(_newManager);\\n }\\n\\n /**\\n * @dev Sets a new manager for this contract\\n * @param _newManager Address of the new manager\\n */\\n function _setManager(address _newManager) private {\\n require(_newManager != address(0), \\\"Manager cannot be empty\\\");\\n require(Address.isContract(_newManager), \\\"Manager must be a contract\\\");\\n\\n address oldManager = address(manager);\\n manager = IGraphTokenLockManager(_newManager);\\n\\n emit ManagerUpdated(oldManager, _newManager);\\n }\\n\\n // -- Beneficiary --\\n\\n /**\\n * @notice Approves protocol access of the tokens managed by this contract\\n * @dev Approves all token destinations registered in the manager to pull tokens\\n */\\n function approveProtocol() external onlyBeneficiary {\\n address[] memory dstList = manager.getTokenDestinations();\\n for (uint256 i = 0; i < dstList.length; i++) {\\n token.safeApprove(dstList[i], MAX_UINT256);\\n }\\n emit TokenDestinationsApproved();\\n }\\n\\n /**\\n * @notice Revokes protocol access of the tokens managed by this contract\\n * @dev Revokes approval to all token destinations in the manager to pull tokens\\n */\\n function revokeProtocol() external onlyBeneficiary {\\n address[] memory dstList = manager.getTokenDestinations();\\n for (uint256 i = 0; i < dstList.length; i++) {\\n token.safeApprove(dstList[i], 0);\\n }\\n emit TokenDestinationsRevoked();\\n }\\n\\n /**\\n * @notice Forward authorized contract calls to protocol contracts\\n * @dev Fallback function can be called by the beneficiary only if function call is allowed\\n */\\n fallback() external payable {\\n // Only beneficiary can forward calls\\n require(msg.sender == beneficiary, \\\"Unauthorized caller\\\");\\n\\n // Function call validation\\n address _target = manager.getAuthFunctionCallTarget(msg.sig);\\n require(_target != address(0), \\\"Unauthorized function\\\");\\n\\n uint256 oldBalance = currentBalance();\\n\\n // Call function with data\\n Address.functionCall(_target, msg.data);\\n\\n // Tracked used tokens in the protocol\\n // We do this check after balances were updated by the forwarded call\\n // Check is only enforced for revocable contracts to save some gas\\n if (revocable == Revocability.Enabled) {\\n // Track contract balance change\\n uint256 newBalance = currentBalance();\\n if (newBalance < oldBalance) {\\n // Outflow\\n uint256 diff = oldBalance.sub(newBalance);\\n usedAmount = usedAmount.add(diff);\\n } else {\\n // Inflow: We can receive profits from the protocol, that could make usedAmount to\\n // underflow. We set it to zero in that case.\\n uint256 diff = newBalance.sub(oldBalance);\\n usedAmount = (diff >= usedAmount) ? 0 : usedAmount.sub(diff);\\n }\\n require(usedAmount <= vestedAmount(), \\\"Cannot use more tokens than vested amount\\\");\\n }\\n }\\n}\\n\",\"keccak256\":\"0xc9615104e2bb94e163e6db227089b950e33de804ad811b5d45242f2beca192b4\",\"license\":\"MIT\"},\"contracts/IGraphTokenLock.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\ninterface IGraphTokenLock {\\n enum Revocability { NotSet, Enabled, Disabled }\\n\\n // -- Balances --\\n\\n function currentBalance() external view returns (uint256);\\n\\n // -- Time & Periods --\\n\\n function currentTime() external view returns (uint256);\\n\\n function duration() external view returns (uint256);\\n\\n function sinceStartTime() external view returns (uint256);\\n\\n function amountPerPeriod() external view returns (uint256);\\n\\n function periodDuration() external view returns (uint256);\\n\\n function currentPeriod() external view returns (uint256);\\n\\n function passedPeriods() external view returns (uint256);\\n\\n // -- Locking & Release Schedule --\\n\\n function availableAmount() external view returns (uint256);\\n\\n function vestedAmount() external view returns (uint256);\\n\\n function releasableAmount() external view returns (uint256);\\n\\n function totalOutstandingAmount() external view returns (uint256);\\n\\n function surplusAmount() external view returns (uint256);\\n\\n // -- Value Transfer --\\n\\n function release() external;\\n\\n function withdrawSurplus(uint256 _amount) external;\\n\\n function revoke() external;\\n}\\n\",\"keccak256\":\"0x396f8102fb03d884d599831989d9753a69f0d9b65538c8206c81e0067827c5a2\",\"license\":\"MIT\"},\"contracts/IGraphTokenLockManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nimport \\\"./IGraphTokenLock.sol\\\";\\n\\ninterface IGraphTokenLockManager {\\n // -- Factory --\\n\\n function setMasterCopy(address _masterCopy) external;\\n\\n function createTokenLockWallet(\\n address _owner,\\n address _beneficiary,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n IGraphTokenLock.Revocability _revocable\\n ) external;\\n\\n // -- Funds Management --\\n\\n function token() external returns (IERC20);\\n\\n function deposit(uint256 _amount) external;\\n\\n function withdraw(uint256 _amount) external;\\n\\n // -- Allowed Funds Destinations --\\n\\n function addTokenDestination(address _dst) external;\\n\\n function removeTokenDestination(address _dst) external;\\n\\n function isTokenDestination(address _dst) external view returns (bool);\\n\\n function getTokenDestinations() external view returns (address[] memory);\\n\\n // -- Function Call Authorization --\\n\\n function setAuthFunctionCall(string calldata _signature, address _target) external;\\n\\n function unsetAuthFunctionCall(string calldata _signature) external;\\n\\n function setAuthFunctionCallMany(string[] calldata _signatures, address[] calldata _targets) external;\\n\\n function getAuthFunctionCallTarget(bytes4 _sigHash) external view returns (address);\\n\\n function isAuthFunctionCall(bytes4 _sigHash) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x2d78d41909a6de5b316ac39b100ea087a8f317cf306379888a045523e15c4d9a\",\"license\":\"MIT\"},\"contracts/MathUtils.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nlibrary MathUtils {\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n}\\n\",\"keccak256\":\"0xe2512e1da48bc8363acd15f66229564b02d66706665d7da740604566913c1400\",\"license\":\"MIT\"},\"contracts/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * The owner account will be passed on initialization of the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\ncontract Ownable {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n function initialize(address owner) internal {\\n _owner = owner;\\n emit OwnershipTransferred(address(0), owner);\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(_owner == msg.sender, \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() external virtual onlyOwner {\\n emit OwnershipTransferred(_owner, address(0));\\n _owner = address(0);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) external virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n emit OwnershipTransferred(_owner, newOwner);\\n _owner = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0xc93c7362ac4d74b624b48517985f92c277ce90ae6e5ccb706e70a61af5752077\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b5061384c806100206000396000f3fe60806040526004361061021e5760003560e01c806386d00e0211610123578063bc0163c1116100ab578063e8dda6f51161006f578063e8dda6f514610c51578063e97d87d514610c7c578063ebbab99214610ca7578063f2fde38b14610cd2578063fc0c546a14610d235761021f565b8063bc0163c114610a84578063bd896dcb14610aaf578063ce845d1d14610baa578063d0ebdbe714610bd5578063d18e81b314610c265761021f565b806391f7cfb9116100f257806391f7cfb9146109b1578063a4caeb42146109dc578063b0d1818c14610a07578063b470aade14610a42578063b6549f7514610a6d5761021f565b806386d00e02146108f857806386d1a69f14610923578063872a78101461093a5780638da5cb5b146109705761021f565b8063398057a3116101a65780635b940081116101755780635b9400811461084957806360e7994414610874578063715018a61461088b57806378e97925146108a25780637bdf05af146108cd5761021f565b8063398057a31461078757806344b1231f146107b257806345d30a17146107dd578063481c6a75146108085761021f565b80632a627814116101ed5780632a627814146106aa5780632bc9ed02146106c15780633197cbb6146106ee57806338af3eed14610719578063392e53cd1461075a5761021f565b8063029c6c9f146105fe57806306040618146106295780630dff24d5146106545780630fb5a6b41461067f5761021f565b5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146102e2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f556e617574686f72697a65642063616c6c65720000000000000000000000000081525060200191505060405180910390fd5b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f1d24c456000357fffffffff00000000000000000000000000000000000000000000000000000000166040518263ffffffff1660e01b815260040180827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200191505060206040518083038186803b15801561039a57600080fd5b505afa1580156103ae573d6000803e3d6000fd5b505050506040513d60208110156103c457600080fd5b81019080805190602001909291905050509050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561047a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f556e617574686f72697a65642066756e6374696f6e000000000000000000000081525060200191505060405180910390fd5b6000610484610d64565b90506104d5826000368080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610e2f565b50600160028111156104e357fe5b600960009054906101000a900460ff1660028111156104fe57fe5b14156105fa57600061050e610d64565b90508181101561055057600061052d8284610e7990919063ffffffff16565b905061054481600c54610ec390919063ffffffff16565b600c8190555050610596565b60006105658383610e7990919063ffffffff16565b9050600c5481101561058b5761058681600c54610e7990919063ffffffff16565b61058e565b60005b600c81905550505b61059e610f4b565b600c5411156105f8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602981526020018061371f6029913960400191505060405180910390fd5b505b5050005b34801561060a57600080fd5b50610613610fba565b6040518082815260200191505060405180910390f35b34801561063557600080fd5b5061063e610fd8565b6040518082815260200191505060405180910390f35b34801561066057600080fd5b50610669611013565b6040518082815260200191505060405180910390f35b34801561068b57600080fd5b5061069461105a565b6040518082815260200191505060405180910390f35b3480156106b657600080fd5b506106bf611078565b005b3480156106cd57600080fd5b506106d6611345565b60405180821515815260200191505060405180910390f35b3480156106fa57600080fd5b50610703611358565b6040518082815260200191505060405180910390f35b34801561072557600080fd5b5061072e61135e565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561076657600080fd5b5061076f611384565b60405180821515815260200191505060405180910390f35b34801561079357600080fd5b5061079c611397565b6040518082815260200191505060405180910390f35b3480156107be57600080fd5b506107c7610f4b565b6040518082815260200191505060405180910390f35b3480156107e957600080fd5b506107f261139d565b6040518082815260200191505060405180910390f35b34801561081457600080fd5b5061081d6113a3565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561085557600080fd5b5061085e6113c9565b6040518082815260200191505060405180910390f35b34801561088057600080fd5b50610889611483565b005b34801561089757600080fd5b506108a0611731565b005b3480156108ae57600080fd5b506108b76118b0565b6040518082815260200191505060405180910390f35b3480156108d957600080fd5b506108e26118b6565b6040518082815260200191505060405180910390f35b34801561090457600080fd5b5061090d6118f2565b6040518082815260200191505060405180910390f35b34801561092f57600080fd5b506109386118f8565b005b34801561094657600080fd5b5061094f611b3a565b6040518082600281111561095f57fe5b815260200191505060405180910390f35b34801561097c57600080fd5b50610985611b4d565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156109bd57600080fd5b506109c6611b76565b6040518082815260200191505060405180910390f35b3480156109e857600080fd5b506109f1611bd4565b6040518082815260200191505060405180910390f35b348015610a1357600080fd5b50610a4060048036036020811015610a2a57600080fd5b8101908080359060200190929190505050611bda565b005b348015610a4e57600080fd5b50610a57611e55565b6040518082815260200191505060405180910390f35b348015610a7957600080fd5b50610a82611e78565b005b348015610a9057600080fd5b50610a996121d5565b6040518082815260200191505060405180910390f35b348015610abb57600080fd5b50610ba86004803603610160811015610ad357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190803560ff1690602001909291905050506121f3565b005b348015610bb657600080fd5b50610bbf610d64565b6040518082815260200191505060405180910390f35b348015610be157600080fd5b50610c2460048036036020811015610bf857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061221b565b005b348015610c3257600080fd5b50610c3b6122e8565b6040518082815260200191505060405180910390f35b348015610c5d57600080fd5b50610c666122f0565b6040518082815260200191505060405180910390f35b348015610c8857600080fd5b50610c916122f6565b6040518082815260200191505060405180910390f35b348015610cb357600080fd5b50610cbc6122fc565b6040518082815260200191505060405180910390f35b348015610cde57600080fd5b50610d2160048036036020811015610cf557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061231e565b005b348015610d2f57600080fd5b50610d38612522565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610def57600080fd5b505afa158015610e03573d6000803e3d6000fd5b505050506040513d6020811015610e1957600080fd5b8101908080519060200190929190505050905090565b6060610e7183836040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c65640000815250612548565b905092915050565b6000610ebb83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612560565b905092915050565b600080828401905083811015610f41576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000600280811115610f5957fe5b600960009054906101000a900460ff166002811115610f7457fe5b1415610f84576003549050610fb7565b6000600854118015610f9e5750600854610f9c6122e8565b105b15610fac5760009050610fb7565b610fb4611b76565b90505b90565b6000610fd360065460035461262090919063ffffffff16565b905090565b600061100e6001611000610fea611e55565b610ff26118b6565b61262090919063ffffffff16565b610ec390919063ffffffff16565b905090565b60008061101e610d64565b9050600061102a6121d5565b905080821115611050576110478183610e7990919063ffffffff16565b92505050611057565b6000925050505b90565b6000611073600454600554610e7990919063ffffffff16565b905090565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461113b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6060600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a34574666040518163ffffffff1660e01b815260040160006040518083038186803b1580156111a557600080fd5b505afa1580156111b9573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525060208110156111e357600080fd5b810190808051604051939291908464010000000082111561120357600080fd5b8382019150602082018581111561121957600080fd5b825186602082028301116401000000008211171561123657600080fd5b8083526020830192505050908051906020019060200280838360005b8381101561126d578082015181840152602081019050611252565b50505050905001604052505050905060005b81518110156113155761130882828151811061129757fe5b60200260200101517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661266a9092919063ffffffff16565b808060010191505061127f565b507fb837fd51506ba3cc623a37c78ed22fd521f2f6e9f69a34d5c2a4a9474f27579360405160405180910390a150565b600960019054906101000a900460ff1681565b60055481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600960029054906101000a900460ff1681565b60035481565b600a5481565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000806007541180156113e457506007546113e26122e8565b105b156113f25760009050611480565b600160028111156113ff57fe5b600960009054906101000a900460ff16600281111561141a57fe5b14801561142957506000600854115b801561143d575060085461143b6122e8565b105b1561144b5760009050611480565b6000611469600a5461145b611b76565b610e7990919063ffffffff16565b905061147c611476610d64565b8261282f565b9150505b90565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611546576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6060600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a34574666040518163ffffffff1660e01b815260040160006040518083038186803b1580156115b057600080fd5b505afa1580156115c4573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525060208110156115ee57600080fd5b810190808051604051939291908464010000000082111561160e57600080fd5b8382019150602082018581111561162457600080fd5b825186602082028301116401000000008211171561164157600080fd5b8083526020830192505050908051906020019060200280838360005b8381101561167857808201518184015260208101905061165d565b50505050905001604052505050905060005b8151811015611701576116f48282815181106116a257fe5b60200260200101516000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661266a9092919063ffffffff16565b808060010191505061168a565b507f6d317a20ba9d790014284bef285283cd61fde92e0f2711050f563a9d2cf4171160405160405180910390a150565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146117f2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60045481565b6000806118c16122e8565b905060045481116118d65760009150506118ef565b6118eb60045482610e7990919063ffffffff16565b9150505b90565b60085481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146119bb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60006119c56113c9565b905060008111611a3d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f4e6f20617661696c61626c652072656c65617361626c6520616d6f756e74000081525060200191505060405180910390fd5b611a5281600a54610ec390919063ffffffff16565b600a81905550611ac7600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166128489092919063ffffffff16565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fc7798891864187665ac6dd119286e44ec13f014527aeeb2b8eb3fd413df93179826040518082815260200191505060405180910390a250565b600960009054906101000a900460ff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600080611b816122e8565b9050600454811015611b97576000915050611bd1565b600554811115611bac57600354915050611bd1565b611bcd611bb7610fba565b611bbf6122fc565b6128ea90919063ffffffff16565b9150505b90565b60065481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611c9d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008111611d13576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f416d6f756e742063616e6e6f74206265207a65726f000000000000000000000081525060200191505060405180910390fd5b80611d1c611013565b1015611d73576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806137696024913960400191505060405180910390fd5b611de2600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166128489092919063ffffffff16565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b826040518082815260200191505060405180910390a250565b6000611e73600654611e6561105a565b61262090919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611f39576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60016002811115611f4657fe5b600960009054906101000a900460ff166002811115611f6157fe5b14611fd4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f436f6e7472616374206973206e6f6e2d7265766f6361626c650000000000000081525060200191505060405180910390fd5b60001515600960019054906101000a900460ff1615151461205d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f416c7265616479207265766f6b6564000000000000000000000000000000000081525060200191505060405180910390fd5b600061207b61206a610f4b565b600354610e7990919063ffffffff16565b9050600081116120f3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f4e6f20617661696c61626c6520756e76657374656420616d6f756e740000000081525060200191505060405180910390fd5b6001600960016101000a81548160ff021916908315150217905550612162612119611b4d565b82600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166128489092919063ffffffff16565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fb73c49a3a37a7aca291ba0ceaa41657012def406106a7fc386888f0f66e941cf826040518082815260200191505060405180910390a250565b60006121ee600a54600354610e7990919063ffffffff16565b905090565b6122058a8a8a8a8a8a8a8a8a8a612970565b61220e8b612ff1565b5050505050505050505050565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146122dc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6122e581612ff1565b50565b600042905090565b600c5481565b60075481565b6000612319600161230b610fd8565b610e7990919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146123df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612465576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806136d36026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b606061255784846000856131d5565b90509392505050565b600083831115829061260d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156125d25780820151818401526020810190506125b7565b50505050905090810190601f1680156125ff5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600061266283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061337e565b905092915050565b6000811480612738575060008373ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e30856040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b1580156126fb57600080fd5b505afa15801561270f573d6000803e3d6000fd5b505050506040513d602081101561272557600080fd5b8101908080519060200190929190505050145b61278d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260368152602001806137e16036913960400191505060405180910390fd5b61282a8363095ea7b360e01b8484604051602401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050613444565b505050565b600081831061283e5781612840565b825b905092915050565b6128e58363a9059cbb60e01b8484604051602401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050613444565b505050565b6000808314156128fd576000905061296a565b600082840290508284828161290e57fe5b0414612965576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806137486021913960400191505060405180910390fd5b809150505b92915050565b600960029054906101000a900460ff16156129f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f416c726561647920696e697469616c697a65640000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff161415612a96576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f4f776e65722063616e6e6f74206265207a65726f00000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff161415612b39576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f42656e65666963696172792063616e6e6f74206265207a65726f00000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff161415612bdc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f546f6b656e2063616e6e6f74206265207a65726f00000000000000000000000081525060200191505060405180910390fd5b60008711612c52576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f4d616e6167656420746f6b656e732063616e6e6f74206265207a65726f00000081525060200191505060405180910390fd5b6000861415612cc9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53746172742074696d65206d757374206265207365740000000000000000000081525060200191505060405180910390fd5b848610612d3e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f53746172742074696d65203e20656e642074696d65000000000000000000000081525060200191505060405180910390fd5b6001841015612db5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f506572696f64732063616e6e6f742062652062656c6f77206d696e696d756d0081525060200191505060405180910390fd5b60006002811115612dc257fe5b816002811115612dce57fe5b1415612e42576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f4d757374207365742061207265766f636162696c697479206f7074696f6e000081525060200191505060405180910390fd5b848310612e9a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a81526020018061378d602a913960400191505060405180910390fd5b848210612ef2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806136b16022913960400191505060405180910390fd5b6001600960026101000a81548160ff021916908315150217905550612f168a613533565b88600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555087600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555086600381905550856004819055508460058190555083600681905550826007819055508160088190555080600960006101000a81548160ff02191690836002811115612fe057fe5b021790555050505050505050505050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415613094576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4d616e616765722063616e6e6f7420626520656d70747900000000000000000081525060200191505060405180910390fd5b61309d816135d1565b61310f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f4d616e61676572206d757374206265206120636f6e747261637400000000000081525060200191505060405180910390fd5b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fdac3632743b879638fd2d51c4d3c1dd796615b4758a55b50b0c19b971ba9fbc760405160405180910390a35050565b606082471015613230576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806136f96026913960400191505060405180910390fd5b613239856135d1565b6132ab576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000081525060200191505060405180910390fd5b600060608673ffffffffffffffffffffffffffffffffffffffff1685876040518082805190602001908083835b602083106132fb57805182526020820191506020810190506020830392506132d8565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d806000811461335d576040519150601f19603f3d011682016040523d82523d6000602084013e613362565b606091505b50915091506133728282866135e4565b92505050949350505050565b6000808311829061342a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156133ef5780820151818401526020810190506133d4565b50505050905090810190601f16801561341c5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600083858161343657fe5b049050809150509392505050565b60606134a6826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166125489092919063ffffffff16565b905060008151111561352e578080602001905160208110156134c757600080fd5b810190808051906020019092919050505061352d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a8152602001806137b7602a913960400191505060405180910390fd5b5b505050565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a350565b600080823b905060008111915050919050565b606083156135f4578290506136a9565b6000835111156136075782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561366e578082015181840152602081019050613653565b50505050905090810190601f16801561369b5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b939250505056fe436c6966662074696d65206d757374206265206265666f726520656e642074696d654f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c43616e6e6f7420757365206d6f726520746f6b656e73207468616e2076657374656420616d6f756e74536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77416d6f756e7420726571756573746564203e20737572706c757320617661696c61626c6552656c656173652073746172742074696d65206d757374206265206265666f726520656e642074696d655361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565645361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f20746f206e6f6e2d7a65726f20616c6c6f77616e6365a2646970667358221220568a2fe9dc70706737374723ca77697bf133d14dda9ad40e2b8f6f167a7ec56264736f6c63430007030033", + "deployedBytecode": "0x60806040526004361061021e5760003560e01c806386d00e0211610123578063bc0163c1116100ab578063e8dda6f51161006f578063e8dda6f514610c51578063e97d87d514610c7c578063ebbab99214610ca7578063f2fde38b14610cd2578063fc0c546a14610d235761021f565b8063bc0163c114610a84578063bd896dcb14610aaf578063ce845d1d14610baa578063d0ebdbe714610bd5578063d18e81b314610c265761021f565b806391f7cfb9116100f257806391f7cfb9146109b1578063a4caeb42146109dc578063b0d1818c14610a07578063b470aade14610a42578063b6549f7514610a6d5761021f565b806386d00e02146108f857806386d1a69f14610923578063872a78101461093a5780638da5cb5b146109705761021f565b8063398057a3116101a65780635b940081116101755780635b9400811461084957806360e7994414610874578063715018a61461088b57806378e97925146108a25780637bdf05af146108cd5761021f565b8063398057a31461078757806344b1231f146107b257806345d30a17146107dd578063481c6a75146108085761021f565b80632a627814116101ed5780632a627814146106aa5780632bc9ed02146106c15780633197cbb6146106ee57806338af3eed14610719578063392e53cd1461075a5761021f565b8063029c6c9f146105fe57806306040618146106295780630dff24d5146106545780630fb5a6b41461067f5761021f565b5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146102e2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f556e617574686f72697a65642063616c6c65720000000000000000000000000081525060200191505060405180910390fd5b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f1d24c456000357fffffffff00000000000000000000000000000000000000000000000000000000166040518263ffffffff1660e01b815260040180827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200191505060206040518083038186803b15801561039a57600080fd5b505afa1580156103ae573d6000803e3d6000fd5b505050506040513d60208110156103c457600080fd5b81019080805190602001909291905050509050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561047a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f556e617574686f72697a65642066756e6374696f6e000000000000000000000081525060200191505060405180910390fd5b6000610484610d64565b90506104d5826000368080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610e2f565b50600160028111156104e357fe5b600960009054906101000a900460ff1660028111156104fe57fe5b14156105fa57600061050e610d64565b90508181101561055057600061052d8284610e7990919063ffffffff16565b905061054481600c54610ec390919063ffffffff16565b600c8190555050610596565b60006105658383610e7990919063ffffffff16565b9050600c5481101561058b5761058681600c54610e7990919063ffffffff16565b61058e565b60005b600c81905550505b61059e610f4b565b600c5411156105f8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602981526020018061371f6029913960400191505060405180910390fd5b505b5050005b34801561060a57600080fd5b50610613610fba565b6040518082815260200191505060405180910390f35b34801561063557600080fd5b5061063e610fd8565b6040518082815260200191505060405180910390f35b34801561066057600080fd5b50610669611013565b6040518082815260200191505060405180910390f35b34801561068b57600080fd5b5061069461105a565b6040518082815260200191505060405180910390f35b3480156106b657600080fd5b506106bf611078565b005b3480156106cd57600080fd5b506106d6611345565b60405180821515815260200191505060405180910390f35b3480156106fa57600080fd5b50610703611358565b6040518082815260200191505060405180910390f35b34801561072557600080fd5b5061072e61135e565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561076657600080fd5b5061076f611384565b60405180821515815260200191505060405180910390f35b34801561079357600080fd5b5061079c611397565b6040518082815260200191505060405180910390f35b3480156107be57600080fd5b506107c7610f4b565b6040518082815260200191505060405180910390f35b3480156107e957600080fd5b506107f261139d565b6040518082815260200191505060405180910390f35b34801561081457600080fd5b5061081d6113a3565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561085557600080fd5b5061085e6113c9565b6040518082815260200191505060405180910390f35b34801561088057600080fd5b50610889611483565b005b34801561089757600080fd5b506108a0611731565b005b3480156108ae57600080fd5b506108b76118b0565b6040518082815260200191505060405180910390f35b3480156108d957600080fd5b506108e26118b6565b6040518082815260200191505060405180910390f35b34801561090457600080fd5b5061090d6118f2565b6040518082815260200191505060405180910390f35b34801561092f57600080fd5b506109386118f8565b005b34801561094657600080fd5b5061094f611b3a565b6040518082600281111561095f57fe5b815260200191505060405180910390f35b34801561097c57600080fd5b50610985611b4d565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156109bd57600080fd5b506109c6611b76565b6040518082815260200191505060405180910390f35b3480156109e857600080fd5b506109f1611bd4565b6040518082815260200191505060405180910390f35b348015610a1357600080fd5b50610a4060048036036020811015610a2a57600080fd5b8101908080359060200190929190505050611bda565b005b348015610a4e57600080fd5b50610a57611e55565b6040518082815260200191505060405180910390f35b348015610a7957600080fd5b50610a82611e78565b005b348015610a9057600080fd5b50610a996121d5565b6040518082815260200191505060405180910390f35b348015610abb57600080fd5b50610ba86004803603610160811015610ad357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190803560ff1690602001909291905050506121f3565b005b348015610bb657600080fd5b50610bbf610d64565b6040518082815260200191505060405180910390f35b348015610be157600080fd5b50610c2460048036036020811015610bf857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061221b565b005b348015610c3257600080fd5b50610c3b6122e8565b6040518082815260200191505060405180910390f35b348015610c5d57600080fd5b50610c666122f0565b6040518082815260200191505060405180910390f35b348015610c8857600080fd5b50610c916122f6565b6040518082815260200191505060405180910390f35b348015610cb357600080fd5b50610cbc6122fc565b6040518082815260200191505060405180910390f35b348015610cde57600080fd5b50610d2160048036036020811015610cf557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061231e565b005b348015610d2f57600080fd5b50610d38612522565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610def57600080fd5b505afa158015610e03573d6000803e3d6000fd5b505050506040513d6020811015610e1957600080fd5b8101908080519060200190929190505050905090565b6060610e7183836040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c65640000815250612548565b905092915050565b6000610ebb83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612560565b905092915050565b600080828401905083811015610f41576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000600280811115610f5957fe5b600960009054906101000a900460ff166002811115610f7457fe5b1415610f84576003549050610fb7565b6000600854118015610f9e5750600854610f9c6122e8565b105b15610fac5760009050610fb7565b610fb4611b76565b90505b90565b6000610fd360065460035461262090919063ffffffff16565b905090565b600061100e6001611000610fea611e55565b610ff26118b6565b61262090919063ffffffff16565b610ec390919063ffffffff16565b905090565b60008061101e610d64565b9050600061102a6121d5565b905080821115611050576110478183610e7990919063ffffffff16565b92505050611057565b6000925050505b90565b6000611073600454600554610e7990919063ffffffff16565b905090565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461113b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6060600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a34574666040518163ffffffff1660e01b815260040160006040518083038186803b1580156111a557600080fd5b505afa1580156111b9573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525060208110156111e357600080fd5b810190808051604051939291908464010000000082111561120357600080fd5b8382019150602082018581111561121957600080fd5b825186602082028301116401000000008211171561123657600080fd5b8083526020830192505050908051906020019060200280838360005b8381101561126d578082015181840152602081019050611252565b50505050905001604052505050905060005b81518110156113155761130882828151811061129757fe5b60200260200101517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661266a9092919063ffffffff16565b808060010191505061127f565b507fb837fd51506ba3cc623a37c78ed22fd521f2f6e9f69a34d5c2a4a9474f27579360405160405180910390a150565b600960019054906101000a900460ff1681565b60055481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600960029054906101000a900460ff1681565b60035481565b600a5481565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000806007541180156113e457506007546113e26122e8565b105b156113f25760009050611480565b600160028111156113ff57fe5b600960009054906101000a900460ff16600281111561141a57fe5b14801561142957506000600854115b801561143d575060085461143b6122e8565b105b1561144b5760009050611480565b6000611469600a5461145b611b76565b610e7990919063ffffffff16565b905061147c611476610d64565b8261282f565b9150505b90565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611546576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6060600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a34574666040518163ffffffff1660e01b815260040160006040518083038186803b1580156115b057600080fd5b505afa1580156115c4573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525060208110156115ee57600080fd5b810190808051604051939291908464010000000082111561160e57600080fd5b8382019150602082018581111561162457600080fd5b825186602082028301116401000000008211171561164157600080fd5b8083526020830192505050908051906020019060200280838360005b8381101561167857808201518184015260208101905061165d565b50505050905001604052505050905060005b8151811015611701576116f48282815181106116a257fe5b60200260200101516000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661266a9092919063ffffffff16565b808060010191505061168a565b507f6d317a20ba9d790014284bef285283cd61fde92e0f2711050f563a9d2cf4171160405160405180910390a150565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146117f2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60045481565b6000806118c16122e8565b905060045481116118d65760009150506118ef565b6118eb60045482610e7990919063ffffffff16565b9150505b90565b60085481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146119bb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60006119c56113c9565b905060008111611a3d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f4e6f20617661696c61626c652072656c65617361626c6520616d6f756e74000081525060200191505060405180910390fd5b611a5281600a54610ec390919063ffffffff16565b600a81905550611ac7600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166128489092919063ffffffff16565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fc7798891864187665ac6dd119286e44ec13f014527aeeb2b8eb3fd413df93179826040518082815260200191505060405180910390a250565b600960009054906101000a900460ff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600080611b816122e8565b9050600454811015611b97576000915050611bd1565b600554811115611bac57600354915050611bd1565b611bcd611bb7610fba565b611bbf6122fc565b6128ea90919063ffffffff16565b9150505b90565b60065481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611c9d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008111611d13576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f416d6f756e742063616e6e6f74206265207a65726f000000000000000000000081525060200191505060405180910390fd5b80611d1c611013565b1015611d73576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806137696024913960400191505060405180910390fd5b611de2600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166128489092919063ffffffff16565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b826040518082815260200191505060405180910390a250565b6000611e73600654611e6561105a565b61262090919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611f39576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60016002811115611f4657fe5b600960009054906101000a900460ff166002811115611f6157fe5b14611fd4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f436f6e7472616374206973206e6f6e2d7265766f6361626c650000000000000081525060200191505060405180910390fd5b60001515600960019054906101000a900460ff1615151461205d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f416c7265616479207265766f6b6564000000000000000000000000000000000081525060200191505060405180910390fd5b600061207b61206a610f4b565b600354610e7990919063ffffffff16565b9050600081116120f3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f4e6f20617661696c61626c6520756e76657374656420616d6f756e740000000081525060200191505060405180910390fd5b6001600960016101000a81548160ff021916908315150217905550612162612119611b4d565b82600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166128489092919063ffffffff16565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fb73c49a3a37a7aca291ba0ceaa41657012def406106a7fc386888f0f66e941cf826040518082815260200191505060405180910390a250565b60006121ee600a54600354610e7990919063ffffffff16565b905090565b6122058a8a8a8a8a8a8a8a8a8a612970565b61220e8b612ff1565b5050505050505050505050565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146122dc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6122e581612ff1565b50565b600042905090565b600c5481565b60075481565b6000612319600161230b610fd8565b610e7990919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146123df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612465576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806136d36026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b606061255784846000856131d5565b90509392505050565b600083831115829061260d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156125d25780820151818401526020810190506125b7565b50505050905090810190601f1680156125ff5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600061266283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061337e565b905092915050565b6000811480612738575060008373ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e30856040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b1580156126fb57600080fd5b505afa15801561270f573d6000803e3d6000fd5b505050506040513d602081101561272557600080fd5b8101908080519060200190929190505050145b61278d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260368152602001806137e16036913960400191505060405180910390fd5b61282a8363095ea7b360e01b8484604051602401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050613444565b505050565b600081831061283e5781612840565b825b905092915050565b6128e58363a9059cbb60e01b8484604051602401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050613444565b505050565b6000808314156128fd576000905061296a565b600082840290508284828161290e57fe5b0414612965576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806137486021913960400191505060405180910390fd5b809150505b92915050565b600960029054906101000a900460ff16156129f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f416c726561647920696e697469616c697a65640000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff161415612a96576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f4f776e65722063616e6e6f74206265207a65726f00000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff161415612b39576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f42656e65666963696172792063616e6e6f74206265207a65726f00000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff161415612bdc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f546f6b656e2063616e6e6f74206265207a65726f00000000000000000000000081525060200191505060405180910390fd5b60008711612c52576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f4d616e6167656420746f6b656e732063616e6e6f74206265207a65726f00000081525060200191505060405180910390fd5b6000861415612cc9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53746172742074696d65206d757374206265207365740000000000000000000081525060200191505060405180910390fd5b848610612d3e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f53746172742074696d65203e20656e642074696d65000000000000000000000081525060200191505060405180910390fd5b6001841015612db5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f506572696f64732063616e6e6f742062652062656c6f77206d696e696d756d0081525060200191505060405180910390fd5b60006002811115612dc257fe5b816002811115612dce57fe5b1415612e42576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f4d757374207365742061207265766f636162696c697479206f7074696f6e000081525060200191505060405180910390fd5b848310612e9a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a81526020018061378d602a913960400191505060405180910390fd5b848210612ef2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806136b16022913960400191505060405180910390fd5b6001600960026101000a81548160ff021916908315150217905550612f168a613533565b88600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555087600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555086600381905550856004819055508460058190555083600681905550826007819055508160088190555080600960006101000a81548160ff02191690836002811115612fe057fe5b021790555050505050505050505050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415613094576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4d616e616765722063616e6e6f7420626520656d70747900000000000000000081525060200191505060405180910390fd5b61309d816135d1565b61310f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f4d616e61676572206d757374206265206120636f6e747261637400000000000081525060200191505060405180910390fd5b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fdac3632743b879638fd2d51c4d3c1dd796615b4758a55b50b0c19b971ba9fbc760405160405180910390a35050565b606082471015613230576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806136f96026913960400191505060405180910390fd5b613239856135d1565b6132ab576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000081525060200191505060405180910390fd5b600060608673ffffffffffffffffffffffffffffffffffffffff1685876040518082805190602001908083835b602083106132fb57805182526020820191506020810190506020830392506132d8565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d806000811461335d576040519150601f19603f3d011682016040523d82523d6000602084013e613362565b606091505b50915091506133728282866135e4565b92505050949350505050565b6000808311829061342a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156133ef5780820151818401526020810190506133d4565b50505050905090810190601f16801561341c5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600083858161343657fe5b049050809150509392505050565b60606134a6826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166125489092919063ffffffff16565b905060008151111561352e578080602001905160208110156134c757600080fd5b810190808051906020019092919050505061352d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a8152602001806137b7602a913960400191505060405180910390fd5b5b505050565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a350565b600080823b905060008111915050919050565b606083156135f4578290506136a9565b6000835111156136075782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561366e578082015181840152602081019050613653565b50505050905090810190601f16801561369b5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b939250505056fe436c6966662074696d65206d757374206265206265666f726520656e642074696d654f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c43616e6e6f7420757365206d6f726520746f6b656e73207468616e2076657374656420616d6f756e74536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77416d6f756e7420726571756573746564203e20737572706c757320617661696c61626c6552656c656173652073746172742074696d65206d757374206265206265666f726520656e642074696d655361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565645361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f20746f206e6f6e2d7a65726f20616c6c6f77616e6365a2646970667358221220568a2fe9dc70706737374723ca77697bf133d14dda9ad40e2b8f6f167a7ec56264736f6c63430007030033", + "devdoc": { + "kind": "dev", + "methods": { + "amountPerPeriod()": { + "returns": { + "_0": "Amount of tokens available after each period" + } + }, + "approveProtocol()": { + "details": "Approves all token destinations registered in the manager to pull tokens" + }, + "availableAmount()": { + "details": "Implements the step-by-step schedule based on periods for available tokens", + "returns": { + "_0": "Amount of tokens available according to the schedule" + } + }, + "currentBalance()": { + "returns": { + "_0": "Tokens held in the contract" + } + }, + "currentPeriod()": { + "returns": { + "_0": "A number that represents the current period" + } + }, + "currentTime()": { + "returns": { + "_0": "Current block timestamp" + } + }, + "duration()": { + "returns": { + "_0": "Amount of seconds from contract startTime to endTime" + } + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "passedPeriods()": { + "returns": { + "_0": "A number of periods that passed since the schedule started" + } + }, + "periodDuration()": { + "returns": { + "_0": "Duration of each period in seconds" + } + }, + "releasableAmount()": { + "details": "Considers the schedule and takes into account already released tokens", + "returns": { + "_0": "Amount of tokens ready to be released" + } + }, + "release()": { + "details": "All available releasable tokens are transferred to beneficiary" + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." + }, + "revoke()": { + "details": "Vesting schedule is always calculated based on managed tokens" + }, + "revokeProtocol()": { + "details": "Revokes approval to all token destinations in the manager to pull tokens" + }, + "setManager(address)": { + "params": { + "_newManager": "Address of the new manager" + } + }, + "sinceStartTime()": { + "details": "Returns zero if called before conctract starTime", + "returns": { + "_0": "Seconds elapsed from contract startTime" + } + }, + "surplusAmount()": { + "details": "All funds over outstanding amount is considered surplus that can be withdrawn by beneficiary", + "returns": { + "_0": "Amount of tokens considered as surplus" + } + }, + "totalOutstandingAmount()": { + "details": "Does not consider schedule but just global amounts tracked", + "returns": { + "_0": "Amount of outstanding tokens for the lifetime of the contract" + } + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + }, + "vestedAmount()": { + "details": "Similar to available amount, but is fully vested when contract is non-revocable", + "returns": { + "_0": "Amount of tokens already vested" + } + }, + "withdrawSurplus(uint256)": { + "details": "Tokens in the contract over outstanding amount are considered as surplus", + "params": { + "_amount": "Amount of tokens to withdraw" + } + } + }, + "title": "GraphTokenLockWallet", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "amountPerPeriod()": { + "notice": "Returns amount available to be released after each period according to schedule" + }, + "approveProtocol()": { + "notice": "Approves protocol access of the tokens managed by this contract" + }, + "availableAmount()": { + "notice": "Gets the currently available token according to the schedule" + }, + "currentBalance()": { + "notice": "Returns the amount of tokens currently held by the contract" + }, + "currentPeriod()": { + "notice": "Gets the current period based on the schedule" + }, + "currentTime()": { + "notice": "Returns the current block timestamp" + }, + "duration()": { + "notice": "Gets duration of contract from start to end in seconds" + }, + "passedPeriods()": { + "notice": "Gets the number of periods that passed since the first period" + }, + "periodDuration()": { + "notice": "Returns the duration of each period in seconds" + }, + "releasableAmount()": { + "notice": "Gets tokens currently available for release" + }, + "release()": { + "notice": "Releases tokens based on the configured schedule" + }, + "revoke()": { + "notice": "Revokes a vesting schedule and return the unvested tokens to the owner" + }, + "revokeProtocol()": { + "notice": "Revokes protocol access of the tokens managed by this contract" + }, + "setManager(address)": { + "notice": "Sets a new manager for this contract" + }, + "sinceStartTime()": { + "notice": "Gets time elapsed since the start of the contract" + }, + "surplusAmount()": { + "notice": "Gets surplus amount in the contract based on outstanding amount to release" + }, + "totalOutstandingAmount()": { + "notice": "Gets the outstanding amount yet to be released based on the whole contract lifetime" + }, + "vestedAmount()": { + "notice": "Gets the amount of currently vested tokens" + }, + "withdrawSurplus(uint256)": { + "notice": "Withdraws surplus, unmanaged tokens from the contract" + } + }, + "notice": "This contract is built on top of the base GraphTokenLock functionality. It allows wallet beneficiaries to use the deposited funds to perform specific function calls on specific contracts. The idea is that supporters with locked tokens can participate in the protocol but disallow any release before the vesting/lock schedule. The beneficiary can issue authorized function calls to this contract that will get forwarded to a target contract. A target contract is any of our protocol contracts. The function calls allowed are queried to the GraphTokenLockManager, this way the same configuration can be shared for all the created lock wallet contracts. NOTE: Contracts used as target must have its function signatures checked to avoid collisions with any of this contract functions. Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience the maximum amount of tokens is authorized.", + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 4371, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "_owner", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 2351, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "token", + "offset": 0, + "slot": "1", + "type": "t_contract(IERC20)908" + }, + { + "astId": 2353, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "beneficiary", + "offset": 0, + "slot": "2", + "type": "t_address" + }, + { + "astId": 2355, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "managedAmount", + "offset": 0, + "slot": "3", + "type": "t_uint256" + }, + { + "astId": 2357, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "startTime", + "offset": 0, + "slot": "4", + "type": "t_uint256" + }, + { + "astId": 2359, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "endTime", + "offset": 0, + "slot": "5", + "type": "t_uint256" + }, + { + "astId": 2361, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "periods", + "offset": 0, + "slot": "6", + "type": "t_uint256" + }, + { + "astId": 2363, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "releaseStartTime", + "offset": 0, + "slot": "7", + "type": "t_uint256" + }, + { + "astId": 2365, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "vestingCliffTime", + "offset": 0, + "slot": "8", + "type": "t_uint256" + }, + { + "astId": 2367, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "revocable", + "offset": 0, + "slot": "9", + "type": "t_enum(Revocability)4048" + }, + { + "astId": 2369, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "isRevoked", + "offset": 1, + "slot": "9", + "type": "t_bool" + }, + { + "astId": 2371, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "isInitialized", + "offset": 2, + "slot": "9", + "type": "t_bool" + }, + { + "astId": 2373, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "releasedAmount", + "offset": 0, + "slot": "10", + "type": "t_uint256" + }, + { + "astId": 3708, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "manager", + "offset": 0, + "slot": "11", + "type": "t_contract(IGraphTokenLockManager)4230" + }, + { + "astId": 3710, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "usedAmount", + "offset": 0, + "slot": "12", + "type": "t_uint256" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_contract(IERC20)908": { + "encoding": "inplace", + "label": "contract IERC20", + "numberOfBytes": "20" + }, + "t_contract(IGraphTokenLockManager)4230": { + "encoding": "inplace", + "label": "contract IGraphTokenLockManager", + "numberOfBytes": "20" + }, + "t_enum(Revocability)4048": { + "encoding": "inplace", + "label": "enum IGraphTokenLock.Revocability", + "numberOfBytes": "1" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} \ No newline at end of file diff --git a/packages/token-distribution/deployments/rinkeby/GraphTokenMock.json b/packages/token-distribution/deployments/rinkeby/GraphTokenMock.json new file mode 100644 index 000000000..b65e67b21 --- /dev/null +++ b/packages/token-distribution/deployments/rinkeby/GraphTokenMock.json @@ -0,0 +1,552 @@ +{ + "address": "0xB0a7bC0e6b51db8Cfda3f80904c8E35259F1abDb", + "abi": [ + { + "inputs": [ + { + "internalType": "uint256", + "name": "_initialSupply", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_mintTo", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0xc6ebb0d9652e8f9cdccc558c1769897a4b6974c44c45edfce41eea79d38d96cd", + "receipt": { + "to": null, + "from": "0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9", + "contractAddress": "0xB0a7bC0e6b51db8Cfda3f80904c8E35259F1abDb", + "transactionIndex": 0, + "gasUsed": "1390294", + "logsBloom": "0x00000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000040000000000000008000000000000000000000000000000000000008000000000001000000000000080000000000000000000000020000000000000000000800000000000000000000000010000000400000000000020000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000020000000000000000000000000000004000000000000000000000000000000000000", + "blockHash": "0xd6c552379d4aa84f79f52045e15b53498e903da2a2f2a85b72e10e3dd633a6be", + "transactionHash": "0xc6ebb0d9652e8f9cdccc558c1769897a4b6974c44c45edfce41eea79d38d96cd", + "logs": [ + { + "transactionIndex": 0, + "blockNumber": 7727637, + "transactionHash": "0xc6ebb0d9652e8f9cdccc558c1769897a4b6974c44c45edfce41eea79d38d96cd", + "address": "0xB0a7bC0e6b51db8Cfda3f80904c8E35259F1abDb", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x00000000000000000000000023d1b1823e6cb5229137424f88c70fda1539f1f9" + ], + "data": "0x", + "logIndex": 0, + "blockHash": "0xd6c552379d4aa84f79f52045e15b53498e903da2a2f2a85b72e10e3dd633a6be" + }, + { + "transactionIndex": 0, + "blockNumber": 7727637, + "transactionHash": "0xc6ebb0d9652e8f9cdccc558c1769897a4b6974c44c45edfce41eea79d38d96cd", + "address": "0xB0a7bC0e6b51db8Cfda3f80904c8E35259F1abDb", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x00000000000000000000000023d1b1823e6cb5229137424f88c70fda1539f1f9" + ], + "data": "0x0000000000000000000000000000000000000000204fce5e3e25026110000000", + "logIndex": 1, + "blockHash": "0xd6c552379d4aa84f79f52045e15b53498e903da2a2f2a85b72e10e3dd633a6be" + } + ], + "blockNumber": 7727637, + "cumulativeGasUsed": "1390294", + "status": 1, + "byzantium": true + }, + "args": [ + "10000000000000000000000000000", + "0x23D1B1823e6Cb5229137424f88C70fdA1539F1F9" + ], + "solcInputHash": "a72ab6278ade6c5c10115f7be2c555c9", + "metadata": "{\"compiler\":{\"version\":\"0.7.3+commit.9bfce1f6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_initialSupply\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"_mintTo\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"subtractedValue\",\"type\":\"uint256\"}],\"name\":\"decreaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"addedValue\",\"type\":\"uint256\"}],\"name\":\"increaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"allowance(address,address)\":{\"details\":\"See {IERC20-allowance}.\"},\"approve(address,uint256)\":{\"details\":\"See {IERC20-approve}. Requirements: - `spender` cannot be the zero address.\"},\"balanceOf(address)\":{\"details\":\"See {IERC20-balanceOf}.\"},\"constructor\":{\"details\":\"Contract Constructor.\",\"params\":{\"_initialSupply\":\"Initial supply\"}},\"decimals()\":{\"details\":\"Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5,05` (`505 / 10 ** 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the value {ERC20} uses, unless {_setupDecimals} is called. NOTE: This information is only used for _display_ purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}.\"},\"decreaseAllowance(address,uint256)\":{\"details\":\"Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have allowance for the caller of at least `subtractedValue`.\"},\"increaseAllowance(address,uint256)\":{\"details\":\"Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address.\"},\"name()\":{\"details\":\"Returns the name of the token.\"},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"symbol()\":{\"details\":\"Returns the symbol of the token, usually a shorter version of the name.\"},\"totalSupply()\":{\"details\":\"See {IERC20-totalSupply}.\"},\"transfer(address,uint256)\":{\"details\":\"See {IERC20-transfer}. Requirements: - `recipient` cannot be the zero address. - the caller must have a balance of at least `amount`.\"},\"transferFrom(address,address,uint256)\":{\"details\":\"See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. Requirements: - `sender` and `recipient` cannot be the zero address. - `sender` must have a balance of at least `amount`. - the caller must have allowance for ``sender``'s tokens of at least `amount`.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"title\":\"Graph Token Mock\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/GraphTokenMock.sol\":\"GraphTokenMock\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/GSN/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/*\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with GSN meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address payable) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes memory) {\\n this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0x8d3cb350f04ff49cfb10aef08d87f19dcbaecc8027b0bed12f3275cd12f38cf0\",\"license\":\"MIT\"},\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\nimport \\\"../GSN/Context.sol\\\";\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor () internal {\\n address msgSender = _msgSender();\\n _owner = msgSender;\\n emit OwnershipTransferred(address(0), msgSender);\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(_owner == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n emit OwnershipTransferred(_owner, address(0));\\n _owner = address(0);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n emit OwnershipTransferred(_owner, newOwner);\\n _owner = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0xf7c39c7e6d06ed3bda90cfefbcbf2ddc32c599c3d6721746546ad64946efccaa\",\"license\":\"MIT\"},\"@openzeppelin/contracts/math/SafeMath.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Wrappers over Solidity's arithmetic operations with added overflow\\n * checks.\\n *\\n * Arithmetic operations in Solidity wrap on overflow. This can easily result\\n * in bugs, because programmers usually assume that an overflow raises an\\n * error, which is the standard behavior in high level programming languages.\\n * `SafeMath` restores this intuition by reverting the transaction when an\\n * operation overflows.\\n *\\n * Using this library instead of the unchecked operations eliminates an entire\\n * class of bugs, so it's recommended to use it always.\\n */\\nlibrary SafeMath {\\n /**\\n * @dev Returns the addition of two unsigned integers, reverting on\\n * overflow.\\n *\\n * Counterpart to Solidity's `+` operator.\\n *\\n * Requirements:\\n *\\n * - Addition cannot overflow.\\n */\\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\\n uint256 c = a + b;\\n require(c >= a, \\\"SafeMath: addition overflow\\\");\\n\\n return c;\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting on\\n * overflow (when the result is negative).\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n *\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\\n return sub(a, b, \\\"SafeMath: subtraction overflow\\\");\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\\n * overflow (when the result is negative).\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n *\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b <= a, errorMessage);\\n uint256 c = a - b;\\n\\n return c;\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, reverting on\\n * overflow.\\n *\\n * Counterpart to Solidity's `*` operator.\\n *\\n * Requirements:\\n *\\n * - Multiplication cannot overflow.\\n */\\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\\n if (a == 0) {\\n return 0;\\n }\\n\\n uint256 c = a * b;\\n require(c / a == b, \\\"SafeMath: multiplication overflow\\\");\\n\\n return c;\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers. Reverts on\\n * division by zero. The result is rounded towards zero.\\n *\\n * Counterpart to Solidity's `/` operator. Note: this function uses a\\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\\n * uses an invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\\n return div(a, b, \\\"SafeMath: division by zero\\\");\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers. Reverts with custom message on\\n * division by zero. The result is rounded towards zero.\\n *\\n * Counterpart to Solidity's `/` operator. Note: this function uses a\\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\\n * uses an invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b > 0, errorMessage);\\n uint256 c = a / b;\\n // assert(a == b * c + a % b); // There is no case in which this doesn't hold\\n\\n return c;\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * Reverts when dividing by zero.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\\n return mod(a, b, \\\"SafeMath: modulo by zero\\\");\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * Reverts with custom message when dividing by zero.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b != 0, errorMessage);\\n return a % b;\\n }\\n}\\n\",\"keccak256\":\"0x3b21f2c8d626de3b9925ae33e972d8bf5c8b1bffb3f4ee94daeed7d0679036e6\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/ERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\nimport \\\"../../GSN/Context.sol\\\";\\nimport \\\"./IERC20.sol\\\";\\nimport \\\"../../math/SafeMath.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC20} interface.\\n *\\n * This implementation is agnostic to the way tokens are created. This means\\n * that a supply mechanism has to be added in a derived contract using {_mint}.\\n * For a generic mechanism see {ERC20PresetMinterPauser}.\\n *\\n * TIP: For a detailed writeup see our guide\\n * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How\\n * to implement supply mechanisms].\\n *\\n * We have followed general OpenZeppelin guidelines: functions revert instead\\n * of returning `false` on failure. This behavior is nonetheless conventional\\n * and does not conflict with the expectations of ERC20 applications.\\n *\\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\\n * This allows applications to reconstruct the allowance for all accounts just\\n * by listening to said events. Other implementations of the EIP may not emit\\n * these events, as it isn't required by the specification.\\n *\\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\\n * functions have been added to mitigate the well-known issues around setting\\n * allowances. See {IERC20-approve}.\\n */\\ncontract ERC20 is Context, IERC20 {\\n using SafeMath for uint256;\\n\\n mapping (address => uint256) private _balances;\\n\\n mapping (address => mapping (address => uint256)) private _allowances;\\n\\n uint256 private _totalSupply;\\n\\n string private _name;\\n string private _symbol;\\n uint8 private _decimals;\\n\\n /**\\n * @dev Sets the values for {name} and {symbol}, initializes {decimals} with\\n * a default value of 18.\\n *\\n * To select a different value for {decimals}, use {_setupDecimals}.\\n *\\n * All three of these values are immutable: they can only be set once during\\n * construction.\\n */\\n constructor (string memory name_, string memory symbol_) public {\\n _name = name_;\\n _symbol = symbol_;\\n _decimals = 18;\\n }\\n\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() public view returns (string memory) {\\n return _name;\\n }\\n\\n /**\\n * @dev Returns the symbol of the token, usually a shorter version of the\\n * name.\\n */\\n function symbol() public view returns (string memory) {\\n return _symbol;\\n }\\n\\n /**\\n * @dev Returns the number of decimals used to get its user representation.\\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\\n * be displayed to a user as `5,05` (`505 / 10 ** 2`).\\n *\\n * Tokens usually opt for a value of 18, imitating the relationship between\\n * Ether and Wei. This is the value {ERC20} uses, unless {_setupDecimals} is\\n * called.\\n *\\n * NOTE: This information is only used for _display_ purposes: it in\\n * no way affects any of the arithmetic of the contract, including\\n * {IERC20-balanceOf} and {IERC20-transfer}.\\n */\\n function decimals() public view returns (uint8) {\\n return _decimals;\\n }\\n\\n /**\\n * @dev See {IERC20-totalSupply}.\\n */\\n function totalSupply() public view override returns (uint256) {\\n return _totalSupply;\\n }\\n\\n /**\\n * @dev See {IERC20-balanceOf}.\\n */\\n function balanceOf(address account) public view override returns (uint256) {\\n return _balances[account];\\n }\\n\\n /**\\n * @dev See {IERC20-transfer}.\\n *\\n * Requirements:\\n *\\n * - `recipient` cannot be the zero address.\\n * - the caller must have a balance of at least `amount`.\\n */\\n function transfer(address recipient, uint256 amount) public virtual override returns (bool) {\\n _transfer(_msgSender(), recipient, amount);\\n return true;\\n }\\n\\n /**\\n * @dev See {IERC20-allowance}.\\n */\\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\\n return _allowances[owner][spender];\\n }\\n\\n /**\\n * @dev See {IERC20-approve}.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n */\\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\\n _approve(_msgSender(), spender, amount);\\n return true;\\n }\\n\\n /**\\n * @dev See {IERC20-transferFrom}.\\n *\\n * Emits an {Approval} event indicating the updated allowance. This is not\\n * required by the EIP. See the note at the beginning of {ERC20}.\\n *\\n * Requirements:\\n *\\n * - `sender` and `recipient` cannot be the zero address.\\n * - `sender` must have a balance of at least `amount`.\\n * - the caller must have allowance for ``sender``'s tokens of at least\\n * `amount`.\\n */\\n function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {\\n _transfer(sender, recipient, amount);\\n _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, \\\"ERC20: transfer amount exceeds allowance\\\"));\\n return true;\\n }\\n\\n /**\\n * @dev Atomically increases the allowance granted to `spender` by the caller.\\n *\\n * This is an alternative to {approve} that can be used as a mitigation for\\n * problems described in {IERC20-approve}.\\n *\\n * Emits an {Approval} event indicating the updated allowance.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n */\\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\\n _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));\\n return true;\\n }\\n\\n /**\\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\\n *\\n * This is an alternative to {approve} that can be used as a mitigation for\\n * problems described in {IERC20-approve}.\\n *\\n * Emits an {Approval} event indicating the updated allowance.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n * - `spender` must have allowance for the caller of at least\\n * `subtractedValue`.\\n */\\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\\n _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, \\\"ERC20: decreased allowance below zero\\\"));\\n return true;\\n }\\n\\n /**\\n * @dev Moves tokens `amount` from `sender` to `recipient`.\\n *\\n * This is internal function is equivalent to {transfer}, and can be used to\\n * e.g. implement automatic token fees, slashing mechanisms, etc.\\n *\\n * Emits a {Transfer} event.\\n *\\n * Requirements:\\n *\\n * - `sender` cannot be the zero address.\\n * - `recipient` cannot be the zero address.\\n * - `sender` must have a balance of at least `amount`.\\n */\\n function _transfer(address sender, address recipient, uint256 amount) internal virtual {\\n require(sender != address(0), \\\"ERC20: transfer from the zero address\\\");\\n require(recipient != address(0), \\\"ERC20: transfer to the zero address\\\");\\n\\n _beforeTokenTransfer(sender, recipient, amount);\\n\\n _balances[sender] = _balances[sender].sub(amount, \\\"ERC20: transfer amount exceeds balance\\\");\\n _balances[recipient] = _balances[recipient].add(amount);\\n emit Transfer(sender, recipient, amount);\\n }\\n\\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\\n * the total supply.\\n *\\n * Emits a {Transfer} event with `from` set to the zero address.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n */\\n function _mint(address account, uint256 amount) internal virtual {\\n require(account != address(0), \\\"ERC20: mint to the zero address\\\");\\n\\n _beforeTokenTransfer(address(0), account, amount);\\n\\n _totalSupply = _totalSupply.add(amount);\\n _balances[account] = _balances[account].add(amount);\\n emit Transfer(address(0), account, amount);\\n }\\n\\n /**\\n * @dev Destroys `amount` tokens from `account`, reducing the\\n * total supply.\\n *\\n * Emits a {Transfer} event with `to` set to the zero address.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n * - `account` must have at least `amount` tokens.\\n */\\n function _burn(address account, uint256 amount) internal virtual {\\n require(account != address(0), \\\"ERC20: burn from the zero address\\\");\\n\\n _beforeTokenTransfer(account, address(0), amount);\\n\\n _balances[account] = _balances[account].sub(amount, \\\"ERC20: burn amount exceeds balance\\\");\\n _totalSupply = _totalSupply.sub(amount);\\n emit Transfer(account, address(0), amount);\\n }\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\\n *\\n * This internal function is equivalent to `approve`, and can be used to\\n * e.g. set automatic allowances for certain subsystems, etc.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `owner` cannot be the zero address.\\n * - `spender` cannot be the zero address.\\n */\\n function _approve(address owner, address spender, uint256 amount) internal virtual {\\n require(owner != address(0), \\\"ERC20: approve from the zero address\\\");\\n require(spender != address(0), \\\"ERC20: approve to the zero address\\\");\\n\\n _allowances[owner][spender] = amount;\\n emit Approval(owner, spender, amount);\\n }\\n\\n /**\\n * @dev Sets {decimals} to a value other than the default one of 18.\\n *\\n * WARNING: This function should only be called from the constructor. Most\\n * applications that interact with token contracts will not expect\\n * {decimals} to ever change, and may work incorrectly if it does.\\n */\\n function _setupDecimals(uint8 decimals_) internal {\\n _decimals = decimals_;\\n }\\n\\n /**\\n * @dev Hook that is called before any transfer of tokens. This includes\\n * minting and burning.\\n *\\n * Calling conditions:\\n *\\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n * will be to transferred to `to`.\\n * - when `from` is zero, `amount` tokens will be minted for `to`.\\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\\n * - `from` and `to` are never both zero.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }\\n}\\n\",\"keccak256\":\"0xcbd85c86627a47fd939f1f4ee3ba626575ff2a182e1804b29f5136394449b538\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `recipient`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address recipient, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `sender` to `recipient` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n}\\n\",\"keccak256\":\"0x5f02220344881ce43204ae4a6281145a67bc52c2bb1290a791857df3d19d78f5\",\"license\":\"MIT\"},\"contracts/GraphTokenMock.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/ERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\n\\n/**\\n * @title Graph Token Mock\\n */\\ncontract GraphTokenMock is Ownable, ERC20 {\\n /**\\n * @dev Contract Constructor.\\n * @param _initialSupply Initial supply\\n */\\n constructor(uint256 _initialSupply, address _mintTo) ERC20(\\\"Graph Token Mock\\\", \\\"GRT-Mock\\\") {\\n // Deploy to mint address\\n _mint(_mintTo, _initialSupply);\\n }\\n}\\n\",\"keccak256\":\"0x23c200e0c4d7169a51aed2e1571fd0d7954b24fa93faa662d02b535ddbf5b3bf\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60806040523480156200001157600080fd5b5060405162001a9038038062001a90833981810160405260408110156200003757600080fd5b8101908080519060200190929190805190602001909291905050506040518060400160405280601081526020017f477261706820546f6b656e204d6f636b000000000000000000000000000000008152506040518060400160405280600881526020017f4752542d4d6f636b0000000000000000000000000000000000000000000000008152506000620000d0620001d860201b60201c565b9050806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3508160049080519060200190620001869291906200044e565b5080600590805190602001906200019f9291906200044e565b506012600660006101000a81548160ff021916908360ff1602179055505050620001d08183620001e060201b60201c565b5050620004f4565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141562000284576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f45524332303a206d696e7420746f20746865207a65726f20616464726573730081525060200191505060405180910390fd5b6200029860008383620003c060201b60201c565b620002b481600354620003c560201b62000e1e1790919060201c565b6003819055506200031381600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054620003c560201b62000e1e1790919060201c565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b505050565b60008082840190508381101562000444576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106200049157805160ff1916838001178555620004c2565b82800160010185558215620004c2579182015b82811115620004c1578251825591602001919060010190620004a4565b5b509050620004d19190620004d5565b5090565b5b80821115620004f0576000816000905550600101620004d6565b5090565b61158c80620005046000396000f3fe608060405234801561001057600080fd5b50600436106100ea5760003560e01c8063715018a61161008c578063a457c2d711610066578063a457c2d714610416578063a9059cbb1461047a578063dd62ed3e146104de578063f2fde38b14610556576100ea565b8063715018a6146103555780638da5cb5b1461035f57806395d89b4114610393576100ea565b806323b872dd116100c857806323b872dd146101f4578063313ce56714610278578063395093511461029957806370a08231146102fd576100ea565b806306fdde03146100ef578063095ea7b31461017257806318160ddd146101d6575b600080fd5b6100f761059a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561013757808201518184015260208101905061011c565b50505050905090810190601f1680156101645780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101be6004803603604081101561018857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061063c565b60405180821515815260200191505060405180910390f35b6101de61065a565b6040518082815260200191505060405180910390f35b6102606004803603606081101561020a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610664565b60405180821515815260200191505060405180910390f35b61028061073d565b604051808260ff16815260200191505060405180910390f35b6102e5600480360360408110156102af57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610754565b60405180821515815260200191505060405180910390f35b61033f6004803603602081101561031357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610807565b6040518082815260200191505060405180910390f35b61035d610850565b005b6103676109d6565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61039b6109ff565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103db5780820151818401526020810190506103c0565b50505050905090810190601f1680156104085780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104626004803603604081101561042c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610aa1565b60405180821515815260200191505060405180910390f35b6104c66004803603604081101561049057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b6e565b60405180821515815260200191505060405180910390f35b610540600480360360408110156104f457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b8c565b6040518082815260200191505060405180910390f35b6105986004803603602081101561056c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c13565b005b606060048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106325780601f1061060757610100808354040283529160200191610632565b820191906000526020600020905b81548152906001019060200180831161061557829003601f168201915b5050505050905090565b6000610650610649610ea6565b8484610eae565b6001905092915050565b6000600354905090565b60006106718484846110a5565b6107328461067d610ea6565b61072d856040518060600160405280602881526020016114c160289139600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006106e3610ea6565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461136a9092919063ffffffff16565b610eae565b600190509392505050565b6000600660009054906101000a900460ff16905090565b60006107fd610761610ea6565b846107f88560026000610772610ea6565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610e1e90919063ffffffff16565b610eae565b6001905092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610858610ea6565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610918576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610a975780601f10610a6c57610100808354040283529160200191610a97565b820191906000526020600020905b815481529060010190602001808311610a7a57829003601f168201915b5050505050905090565b6000610b64610aae610ea6565b84610b5f856040518060600160405280602581526020016115326025913960026000610ad8610ea6565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461136a9092919063ffffffff16565b610eae565b6001905092915050565b6000610b82610b7b610ea6565b84846110a5565b6001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610c1b610ea6565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cdb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610d61576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806114536026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080828401905083811015610e9c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610f34576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061150e6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610fba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806114796022913960400191505060405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561112b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806114e96025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156111b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806114306023913960400191505060405180910390fd5b6111bc83838361142a565b6112288160405180606001604052806026815260200161149b60269139600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461136a9092919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506112bd81600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610e1e90919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290611417576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156113dc5780820151818401526020810190506113c1565b50505050905090810190601f1680156114095780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f20616464726573734f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220f69e6542f5ac170217d7f1aaeaf175ae967c01348ec113f5c49cd2dacad8eec264736f6c63430007030033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100ea5760003560e01c8063715018a61161008c578063a457c2d711610066578063a457c2d714610416578063a9059cbb1461047a578063dd62ed3e146104de578063f2fde38b14610556576100ea565b8063715018a6146103555780638da5cb5b1461035f57806395d89b4114610393576100ea565b806323b872dd116100c857806323b872dd146101f4578063313ce56714610278578063395093511461029957806370a08231146102fd576100ea565b806306fdde03146100ef578063095ea7b31461017257806318160ddd146101d6575b600080fd5b6100f761059a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561013757808201518184015260208101905061011c565b50505050905090810190601f1680156101645780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101be6004803603604081101561018857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061063c565b60405180821515815260200191505060405180910390f35b6101de61065a565b6040518082815260200191505060405180910390f35b6102606004803603606081101561020a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610664565b60405180821515815260200191505060405180910390f35b61028061073d565b604051808260ff16815260200191505060405180910390f35b6102e5600480360360408110156102af57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610754565b60405180821515815260200191505060405180910390f35b61033f6004803603602081101561031357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610807565b6040518082815260200191505060405180910390f35b61035d610850565b005b6103676109d6565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61039b6109ff565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103db5780820151818401526020810190506103c0565b50505050905090810190601f1680156104085780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104626004803603604081101561042c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610aa1565b60405180821515815260200191505060405180910390f35b6104c66004803603604081101561049057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b6e565b60405180821515815260200191505060405180910390f35b610540600480360360408110156104f457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b8c565b6040518082815260200191505060405180910390f35b6105986004803603602081101561056c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c13565b005b606060048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106325780601f1061060757610100808354040283529160200191610632565b820191906000526020600020905b81548152906001019060200180831161061557829003601f168201915b5050505050905090565b6000610650610649610ea6565b8484610eae565b6001905092915050565b6000600354905090565b60006106718484846110a5565b6107328461067d610ea6565b61072d856040518060600160405280602881526020016114c160289139600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006106e3610ea6565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461136a9092919063ffffffff16565b610eae565b600190509392505050565b6000600660009054906101000a900460ff16905090565b60006107fd610761610ea6565b846107f88560026000610772610ea6565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610e1e90919063ffffffff16565b610eae565b6001905092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610858610ea6565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610918576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610a975780601f10610a6c57610100808354040283529160200191610a97565b820191906000526020600020905b815481529060010190602001808311610a7a57829003601f168201915b5050505050905090565b6000610b64610aae610ea6565b84610b5f856040518060600160405280602581526020016115326025913960026000610ad8610ea6565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461136a9092919063ffffffff16565b610eae565b6001905092915050565b6000610b82610b7b610ea6565b84846110a5565b6001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610c1b610ea6565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cdb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610d61576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806114536026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080828401905083811015610e9c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610f34576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061150e6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610fba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806114796022913960400191505060405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561112b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806114e96025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156111b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806114306023913960400191505060405180910390fd5b6111bc83838361142a565b6112288160405180606001604052806026815260200161149b60269139600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461136a9092919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506112bd81600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610e1e90919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290611417576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156113dc5780820151818401526020810190506113c1565b50505050905090810190601f1680156114095780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f20616464726573734f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220f69e6542f5ac170217d7f1aaeaf175ae967c01348ec113f5c49cd2dacad8eec264736f6c63430007030033", + "devdoc": { + "kind": "dev", + "methods": { + "allowance(address,address)": { + "details": "See {IERC20-allowance}." + }, + "approve(address,uint256)": { + "details": "See {IERC20-approve}. Requirements: - `spender` cannot be the zero address." + }, + "balanceOf(address)": { + "details": "See {IERC20-balanceOf}." + }, + "constructor": { + "details": "Contract Constructor.", + "params": { + "_initialSupply": "Initial supply" + } + }, + "decimals()": { + "details": "Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5,05` (`505 / 10 ** 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the value {ERC20} uses, unless {_setupDecimals} is called. NOTE: This information is only used for _display_ purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}." + }, + "decreaseAllowance(address,uint256)": { + "details": "Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have allowance for the caller of at least `subtractedValue`." + }, + "increaseAllowance(address,uint256)": { + "details": "Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address." + }, + "name()": { + "details": "Returns the name of the token." + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." + }, + "symbol()": { + "details": "Returns the symbol of the token, usually a shorter version of the name." + }, + "totalSupply()": { + "details": "See {IERC20-totalSupply}." + }, + "transfer(address,uint256)": { + "details": "See {IERC20-transfer}. Requirements: - `recipient` cannot be the zero address. - the caller must have a balance of at least `amount`." + }, + "transferFrom(address,address,uint256)": { + "details": "See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. Requirements: - `sender` and `recipient` cannot be the zero address. - `sender` must have a balance of at least `amount`. - the caller must have allowance for ``sender``'s tokens of at least `amount`." + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + } + }, + "title": "Graph Token Mock", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 30, + "contract": "contracts/GraphTokenMock.sol:GraphTokenMock", + "label": "_owner", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 344, + "contract": "contracts/GraphTokenMock.sol:GraphTokenMock", + "label": "_balances", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_address,t_uint256)" + }, + { + "astId": 350, + "contract": "contracts/GraphTokenMock.sol:GraphTokenMock", + "label": "_allowances", + "offset": 0, + "slot": "2", + "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))" + }, + { + "astId": 352, + "contract": "contracts/GraphTokenMock.sol:GraphTokenMock", + "label": "_totalSupply", + "offset": 0, + "slot": "3", + "type": "t_uint256" + }, + { + "astId": 354, + "contract": "contracts/GraphTokenMock.sol:GraphTokenMock", + "label": "_name", + "offset": 0, + "slot": "4", + "type": "t_string_storage" + }, + { + "astId": 356, + "contract": "contracts/GraphTokenMock.sol:GraphTokenMock", + "label": "_symbol", + "offset": 0, + "slot": "5", + "type": "t_string_storage" + }, + { + "astId": 358, + "contract": "contracts/GraphTokenMock.sol:GraphTokenMock", + "label": "_decimals", + "offset": 0, + "slot": "6", + "type": "t_uint8" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_mapping(t_address,t_uint256))": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => mapping(address => uint256))", + "numberOfBytes": "32", + "value": "t_mapping(t_address,t_uint256)" + }, + "t_mapping(t_address,t_uint256)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_string_storage": { + "encoding": "bytes", + "label": "string", + "numberOfBytes": "32" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "encoding": "inplace", + "label": "uint8", + "numberOfBytes": "1" + } + } + } +} \ No newline at end of file diff --git a/packages/token-distribution/deployments/rinkeby/solcInputs/a72ab6278ade6c5c10115f7be2c555c9.json b/packages/token-distribution/deployments/rinkeby/solcInputs/a72ab6278ade6c5c10115f7be2c555c9.json new file mode 100644 index 000000000..ee7330e86 --- /dev/null +++ b/packages/token-distribution/deployments/rinkeby/solcInputs/a72ab6278ade6c5c10115f7be2c555c9.json @@ -0,0 +1,98 @@ +{ + "language": "Solidity", + "sources": { + "contracts/GraphTokenDistributor.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\nimport \"@openzeppelin/contracts/math/SafeMath.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\";\n\n/**\n * @title GraphTokenDistributor\n * @dev Contract that allows distribution of tokens to multiple beneficiaries.\n * The contract accept deposits in the configured token by anyone.\n * The owner can setup the desired distribution by setting the amount of tokens\n * assigned to each beneficiary account.\n * Beneficiaries claim for their allocated tokens.\n * Only the owner can withdraw tokens from this contract without limitations.\n * For the distribution to work this contract must be unlocked by the owner.\n */\ncontract GraphTokenDistributor is Ownable {\n using SafeMath for uint256;\n using SafeERC20 for IERC20;\n\n // -- State --\n\n bool public locked;\n mapping(address => uint256) public beneficiaries;\n\n IERC20 public token;\n\n // -- Events --\n\n event BeneficiaryUpdated(address indexed beneficiary, uint256 amount);\n event TokensDeposited(address indexed sender, uint256 amount);\n event TokensWithdrawn(address indexed sender, uint256 amount);\n event TokensClaimed(address indexed beneficiary, address to, uint256 amount);\n event LockUpdated(bool locked);\n\n modifier whenNotLocked() {\n require(locked == false, \"Distributor: Claim is locked\");\n _;\n }\n\n /**\n * Constructor.\n * @param _token Token to use for deposits and withdrawals\n */\n constructor(IERC20 _token) {\n token = _token;\n locked = true;\n }\n\n /**\n * Deposit tokens into the contract.\n * Even if the ERC20 token can be transferred directly to the contract\n * this function provide a safe interface to do the transfer and avoid mistakes\n * @param _amount Amount to deposit\n */\n function deposit(uint256 _amount) external {\n token.safeTransferFrom(msg.sender, address(this), _amount);\n emit TokensDeposited(msg.sender, _amount);\n }\n\n // -- Admin functions --\n\n /**\n * Add token balance available for account.\n * @param _account Address to assign tokens to\n * @param _amount Amount of tokens to assign to beneficiary\n */\n function addBeneficiaryTokens(address _account, uint256 _amount) external onlyOwner {\n _setBeneficiaryTokens(_account, beneficiaries[_account].add(_amount));\n }\n\n /**\n * Add token balance available for multiple accounts.\n * @param _accounts Addresses to assign tokens to\n * @param _amounts Amounts of tokens to assign to beneficiary\n */\n function addBeneficiaryTokensMulti(address[] calldata _accounts, uint256[] calldata _amounts) external onlyOwner {\n require(_accounts.length == _amounts.length, \"Distributor: !length\");\n for (uint256 i = 0; i < _accounts.length; i++) {\n _setBeneficiaryTokens(_accounts[i], beneficiaries[_accounts[i]].add(_amounts[i]));\n }\n }\n\n /**\n * Remove token balance available for account.\n * @param _account Address to assign tokens to\n * @param _amount Amount of tokens to assign to beneficiary\n */\n function subBeneficiaryTokens(address _account, uint256 _amount) external onlyOwner {\n _setBeneficiaryTokens(_account, beneficiaries[_account].sub(_amount));\n }\n\n /**\n * Remove token balance available for multiple accounts.\n * @param _accounts Addresses to assign tokens to\n * @param _amounts Amounts of tokens to assign to beneficiary\n */\n function subBeneficiaryTokensMulti(address[] calldata _accounts, uint256[] calldata _amounts) external onlyOwner {\n require(_accounts.length == _amounts.length, \"Distributor: !length\");\n for (uint256 i = 0; i < _accounts.length; i++) {\n _setBeneficiaryTokens(_accounts[i], beneficiaries[_accounts[i]].sub(_amounts[i]));\n }\n }\n\n /**\n * Set amount of tokens available for beneficiary account.\n * @param _account Address to assign tokens to\n * @param _amount Amount of tokens to assign to beneficiary\n */\n function _setBeneficiaryTokens(address _account, uint256 _amount) private {\n require(_account != address(0), \"Distributor: !account\");\n\n beneficiaries[_account] = _amount;\n emit BeneficiaryUpdated(_account, _amount);\n }\n\n /**\n * Set locked withdrawals.\n * @param _locked True to lock withdrawals\n */\n function setLocked(bool _locked) external onlyOwner {\n locked = _locked;\n emit LockUpdated(_locked);\n }\n\n /**\n * Withdraw tokens from the contract. This function is included as\n * a escape hatch in case of mistakes or to recover remaining funds.\n * @param _amount Amount of tokens to withdraw\n */\n function withdraw(uint256 _amount) external onlyOwner {\n token.safeTransfer(msg.sender, _amount);\n emit TokensWithdrawn(msg.sender, _amount);\n }\n\n // -- Beneficiary functions --\n\n /**\n * Claim tokens and send to caller.\n */\n function claim() external whenNotLocked {\n claimTo(msg.sender);\n }\n\n /**\n * Claim tokens and send to address.\n * @param _to Address where to send tokens\n */\n function claimTo(address _to) public whenNotLocked {\n uint256 claimableTokens = beneficiaries[msg.sender];\n require(claimableTokens > 0, \"Distributor: Unavailable funds\");\n\n _setBeneficiaryTokens(msg.sender, 0);\n\n token.safeTransfer(_to, claimableTokens);\n emit TokensClaimed(msg.sender, _to, claimableTokens);\n }\n}\n" + }, + "@openzeppelin/contracts/access/Ownable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\nimport \"../GSN/Context.sol\";\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor () internal {\n address msgSender = _msgSender();\n _owner = msgSender;\n emit OwnershipTransferred(address(0), msgSender);\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(_owner == _msgSender(), \"Ownable: caller is not the owner\");\n _;\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n emit OwnershipTransferred(_owner, address(0));\n _owner = address(0);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n emit OwnershipTransferred(_owner, newOwner);\n _owner = newOwner;\n }\n}\n" + }, + "@openzeppelin/contracts/math/SafeMath.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/**\n * @dev Wrappers over Solidity's arithmetic operations with added overflow\n * checks.\n *\n * Arithmetic operations in Solidity wrap on overflow. This can easily result\n * in bugs, because programmers usually assume that an overflow raises an\n * error, which is the standard behavior in high level programming languages.\n * `SafeMath` restores this intuition by reverting the transaction when an\n * operation overflows.\n *\n * Using this library instead of the unchecked operations eliminates an entire\n * class of bugs, so it's recommended to use it always.\n */\nlibrary SafeMath {\n /**\n * @dev Returns the addition of two unsigned integers, reverting on\n * overflow.\n *\n * Counterpart to Solidity's `+` operator.\n *\n * Requirements:\n *\n * - Addition cannot overflow.\n */\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\n uint256 c = a + b;\n require(c >= a, \"SafeMath: addition overflow\");\n\n return c;\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, reverting on\n * overflow (when the result is negative).\n *\n * Counterpart to Solidity's `-` operator.\n *\n * Requirements:\n *\n * - Subtraction cannot overflow.\n */\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n return sub(a, b, \"SafeMath: subtraction overflow\");\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\n * overflow (when the result is negative).\n *\n * Counterpart to Solidity's `-` operator.\n *\n * Requirements:\n *\n * - Subtraction cannot overflow.\n */\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b <= a, errorMessage);\n uint256 c = a - b;\n\n return c;\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, reverting on\n * overflow.\n *\n * Counterpart to Solidity's `*` operator.\n *\n * Requirements:\n *\n * - Multiplication cannot overflow.\n */\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\n // benefit is lost if 'b' is also tested.\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\n if (a == 0) {\n return 0;\n }\n\n uint256 c = a * b;\n require(c / a == b, \"SafeMath: multiplication overflow\");\n\n return c;\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers. Reverts on\n * division by zero. The result is rounded towards zero.\n *\n * Counterpart to Solidity's `/` operator. Note: this function uses a\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\n * uses an invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\n return div(a, b, \"SafeMath: division by zero\");\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers. Reverts with custom message on\n * division by zero. The result is rounded towards zero.\n *\n * Counterpart to Solidity's `/` operator. Note: this function uses a\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\n * uses an invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b > 0, errorMessage);\n uint256 c = a / b;\n // assert(a == b * c + a % b); // There is no case in which this doesn't hold\n\n return c;\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * Reverts when dividing by zero.\n *\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\n * opcode (which leaves remaining gas untouched) while Solidity uses an\n * invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\n return mod(a, b, \"SafeMath: modulo by zero\");\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * Reverts with custom message when dividing by zero.\n *\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\n * opcode (which leaves remaining gas untouched) while Solidity uses an\n * invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b != 0, errorMessage);\n return a % b;\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `recipient`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address recipient, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `sender` to `recipient` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);\n\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/SafeERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"../../math/SafeMath.sol\";\nimport \"../../utils/Address.sol\";\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n using SafeMath for uint256;\n using Address for address;\n\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\n }\n\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\n }\n\n /**\n * @dev Deprecated. This function has issues similar to the ones found in\n * {IERC20-approve}, and its usage is discouraged.\n *\n * Whenever possible, use {safeIncreaseAllowance} and\n * {safeDecreaseAllowance} instead.\n */\n function safeApprove(IERC20 token, address spender, uint256 value) internal {\n // safeApprove should only be called when setting an initial allowance,\n // or when resetting it to zero. To increase and decrease it, use\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\n // solhint-disable-next-line max-line-length\n require((value == 0) || (token.allowance(address(this), spender) == 0),\n \"SafeERC20: approve from non-zero to non-zero allowance\"\n );\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\n }\n\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n uint256 newAllowance = token.allowance(address(this), spender).add(value);\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\n\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n uint256 newAllowance = token.allowance(address(this), spender).sub(value, \"SafeERC20: decreased allowance below zero\");\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n */\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that\n // the target address contains contract code and also asserts for success in the low-level call.\n\n bytes memory returndata = address(token).functionCall(data, \"SafeERC20: low-level call failed\");\n if (returndata.length > 0) { // Return data is optional\n // solhint-disable-next-line max-line-length\n require(abi.decode(returndata, (bool)), \"SafeERC20: ERC20 operation did not succeed\");\n }\n }\n}\n" + }, + "@openzeppelin/contracts/GSN/Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/*\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with GSN meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address payable) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes memory) {\n this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\n return msg.data;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Address.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.2 <0.8.0;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize, which returns 0 for contracts in\n // construction, since the code is only stored at the end of the\n // constructor execution.\n\n uint256 size;\n // solhint-disable-next-line no-inline-assembly\n assembly { size := extcodesize(account) }\n return size > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n // solhint-disable-next-line avoid-low-level-calls, avoid-call-value\n (bool success, ) = recipient.call{ value: amount }(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain`call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCall(target, data, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n require(isContract(target), \"Address: call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.call{ value: value }(data);\n return _verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {\n require(isContract(target), \"Address: static call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.staticcall(data);\n return _verifyCallResult(success, returndata, errorMessage);\n }\n\n function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {\n if (success) {\n return returndata;\n } else {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n }\n}\n" + }, + "contracts/GraphTokenLockWallet.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"@openzeppelin/contracts/math/SafeMath.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\";\n\nimport \"./GraphTokenLock.sol\";\nimport \"./IGraphTokenLockManager.sol\";\n\n/**\n * @title GraphTokenLockWallet\n * @notice This contract is built on top of the base GraphTokenLock functionality.\n * It allows wallet beneficiaries to use the deposited funds to perform specific function calls\n * on specific contracts.\n *\n * The idea is that supporters with locked tokens can participate in the protocol\n * but disallow any release before the vesting/lock schedule.\n * The beneficiary can issue authorized function calls to this contract that will\n * get forwarded to a target contract. A target contract is any of our protocol contracts.\n * The function calls allowed are queried to the GraphTokenLockManager, this way\n * the same configuration can be shared for all the created lock wallet contracts.\n *\n * NOTE: Contracts used as target must have its function signatures checked to avoid collisions\n * with any of this contract functions.\n * Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience\n * the maximum amount of tokens is authorized.\n */\ncontract GraphTokenLockWallet is GraphTokenLock {\n using SafeMath for uint256;\n using SafeERC20 for IERC20;\n\n // -- State --\n\n IGraphTokenLockManager public manager;\n uint256 public usedAmount;\n\n uint256 private constant MAX_UINT256 = 2**256 - 1;\n\n // -- Events --\n\n event ManagerUpdated(address indexed _oldManager, address indexed _newManager);\n event TokenDestinationsApproved();\n event TokenDestinationsRevoked();\n\n // Initializer\n function initialize(\n address _manager,\n address _owner,\n address _beneficiary,\n address _token,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n Revocability _revocable\n ) external {\n _initialize(\n _owner,\n _beneficiary,\n _token,\n _managedAmount,\n _startTime,\n _endTime,\n _periods,\n _releaseStartTime,\n _vestingCliffTime,\n _revocable\n );\n _setManager(_manager);\n }\n\n // -- Admin --\n\n /**\n * @notice Sets a new manager for this contract\n * @param _newManager Address of the new manager\n */\n function setManager(address _newManager) external onlyOwner {\n _setManager(_newManager);\n }\n\n /**\n * @dev Sets a new manager for this contract\n * @param _newManager Address of the new manager\n */\n function _setManager(address _newManager) private {\n require(_newManager != address(0), \"Manager cannot be empty\");\n require(Address.isContract(_newManager), \"Manager must be a contract\");\n\n address oldManager = address(manager);\n manager = IGraphTokenLockManager(_newManager);\n\n emit ManagerUpdated(oldManager, _newManager);\n }\n\n // -- Beneficiary --\n\n /**\n * @notice Approves protocol access of the tokens managed by this contract\n * @dev Approves all token destinations registered in the manager to pull tokens\n */\n function approveProtocol() external onlyBeneficiary {\n address[] memory dstList = manager.getTokenDestinations();\n for (uint256 i = 0; i < dstList.length; i++) {\n token.safeApprove(dstList[i], MAX_UINT256);\n }\n emit TokenDestinationsApproved();\n }\n\n /**\n * @notice Revokes protocol access of the tokens managed by this contract\n * @dev Revokes approval to all token destinations in the manager to pull tokens\n */\n function revokeProtocol() external onlyBeneficiary {\n address[] memory dstList = manager.getTokenDestinations();\n for (uint256 i = 0; i < dstList.length; i++) {\n token.safeApprove(dstList[i], 0);\n }\n emit TokenDestinationsRevoked();\n }\n\n /**\n * @notice Forward authorized contract calls to protocol contracts\n * @dev Fallback function can be called by the beneficiary only if function call is allowed\n */\n fallback() external payable {\n // Only beneficiary can forward calls\n require(msg.sender == beneficiary, \"Unauthorized caller\");\n\n // Function call validation\n address _target = manager.getAuthFunctionCallTarget(msg.sig);\n require(_target != address(0), \"Unauthorized function\");\n\n uint256 oldBalance = currentBalance();\n\n // Call function with data\n Address.functionCall(_target, msg.data);\n\n // Tracked used tokens in the protocol\n // We do this check after balances were updated by the forwarded call\n // Check is only enforced for revocable contracts to save some gas\n if (revocable == Revocability.Enabled) {\n // Track contract balance change\n uint256 newBalance = currentBalance();\n if (newBalance < oldBalance) {\n // Outflow\n uint256 diff = oldBalance.sub(newBalance);\n usedAmount = usedAmount.add(diff);\n } else {\n // Inflow: We can receive profits from the protocol, that could make usedAmount to\n // underflow. We set it to zero in that case.\n uint256 diff = newBalance.sub(oldBalance);\n usedAmount = (diff >= usedAmount) ? 0 : usedAmount.sub(diff);\n }\n require(usedAmount <= vestedAmount(), \"Cannot use more tokens than vested amount\");\n }\n }\n}\n" + }, + "contracts/GraphTokenLock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport \"@openzeppelin/contracts/math/SafeMath.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\";\n\nimport \"./Ownable.sol\";\nimport \"./MathUtils.sol\";\nimport \"./IGraphTokenLock.sol\";\n\n/**\n * @title GraphTokenLock\n * @notice Contract that manages an unlocking schedule of tokens.\n * @dev The contract lock manage a number of tokens deposited into the contract to ensure that\n * they can only be released under certain time conditions.\n *\n * This contract implements a release scheduled based on periods and tokens are released in steps\n * after each period ends. It can be configured with one period in which case it is like a plain TimeLock.\n * It also supports revocation to be used for vesting schedules.\n *\n * The contract supports receiving extra funds than the managed tokens ones that can be\n * withdrawn by the beneficiary at any time.\n *\n * A releaseStartTime parameter is included to override the default release schedule and\n * perform the first release on the configured time. After that it will continue with the\n * default schedule.\n */\nabstract contract GraphTokenLock is Ownable, IGraphTokenLock {\n using SafeMath for uint256;\n using SafeERC20 for IERC20;\n\n uint256 private constant MIN_PERIOD = 1;\n\n // -- State --\n\n IERC20 public token;\n address public beneficiary;\n\n // Configuration\n\n // Amount of tokens managed by the contract schedule\n uint256 public managedAmount;\n\n uint256 public startTime; // Start datetime (in unixtimestamp)\n uint256 public endTime; // Datetime after all funds are fully vested/unlocked (in unixtimestamp)\n uint256 public periods; // Number of vesting/release periods\n\n // First release date for tokens (in unixtimestamp)\n // If set, no tokens will be released before releaseStartTime ignoring\n // the amount to release each period\n uint256 public releaseStartTime;\n // A cliff set a date to which a beneficiary needs to get to vest\n // all preceding periods\n uint256 public vestingCliffTime;\n Revocability public revocable; // Whether to use vesting for locked funds\n\n // State\n\n bool public isRevoked;\n bool public isInitialized;\n uint256 public releasedAmount;\n\n // -- Events --\n\n event TokensReleased(address indexed beneficiary, uint256 amount);\n event TokensWithdrawn(address indexed beneficiary, uint256 amount);\n event TokensRevoked(address indexed beneficiary, uint256 amount);\n\n /**\n * @dev Only allow calls from the beneficiary of the contract\n */\n modifier onlyBeneficiary() {\n require(msg.sender == beneficiary, \"!auth\");\n _;\n }\n\n /**\n * @notice Initializes the contract\n * @param _owner Address of the contract owner\n * @param _beneficiary Address of the beneficiary of locked tokens\n * @param _managedAmount Amount of tokens to be managed by the lock contract\n * @param _startTime Start time of the release schedule\n * @param _endTime End time of the release schedule\n * @param _periods Number of periods between start time and end time\n * @param _releaseStartTime Override time for when the releases start\n * @param _vestingCliffTime Override time for when the vesting start\n * @param _revocable Whether the contract is revocable\n */\n function _initialize(\n address _owner,\n address _beneficiary,\n address _token,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n Revocability _revocable\n ) internal {\n require(!isInitialized, \"Already initialized\");\n require(_owner != address(0), \"Owner cannot be zero\");\n require(_beneficiary != address(0), \"Beneficiary cannot be zero\");\n require(_token != address(0), \"Token cannot be zero\");\n require(_managedAmount > 0, \"Managed tokens cannot be zero\");\n require(_startTime != 0, \"Start time must be set\");\n require(_startTime < _endTime, \"Start time > end time\");\n require(_periods >= MIN_PERIOD, \"Periods cannot be below minimum\");\n require(_revocable != Revocability.NotSet, \"Must set a revocability option\");\n require(_releaseStartTime < _endTime, \"Release start time must be before end time\");\n require(_vestingCliffTime < _endTime, \"Cliff time must be before end time\");\n\n isInitialized = true;\n\n Ownable.initialize(_owner);\n beneficiary = _beneficiary;\n token = IERC20(_token);\n\n managedAmount = _managedAmount;\n\n startTime = _startTime;\n endTime = _endTime;\n periods = _periods;\n\n // Optionals\n releaseStartTime = _releaseStartTime;\n vestingCliffTime = _vestingCliffTime;\n revocable = _revocable;\n }\n\n // -- Balances --\n\n /**\n * @notice Returns the amount of tokens currently held by the contract\n * @return Tokens held in the contract\n */\n function currentBalance() public override view returns (uint256) {\n return token.balanceOf(address(this));\n }\n\n // -- Time & Periods --\n\n /**\n * @notice Returns the current block timestamp\n * @return Current block timestamp\n */\n function currentTime() public override view returns (uint256) {\n return block.timestamp;\n }\n\n /**\n * @notice Gets duration of contract from start to end in seconds\n * @return Amount of seconds from contract startTime to endTime\n */\n function duration() public override view returns (uint256) {\n return endTime.sub(startTime);\n }\n\n /**\n * @notice Gets time elapsed since the start of the contract\n * @dev Returns zero if called before conctract starTime\n * @return Seconds elapsed from contract startTime\n */\n function sinceStartTime() public override view returns (uint256) {\n uint256 current = currentTime();\n if (current <= startTime) {\n return 0;\n }\n return current.sub(startTime);\n }\n\n /**\n * @notice Returns amount available to be released after each period according to schedule\n * @return Amount of tokens available after each period\n */\n function amountPerPeriod() public override view returns (uint256) {\n return managedAmount.div(periods);\n }\n\n /**\n * @notice Returns the duration of each period in seconds\n * @return Duration of each period in seconds\n */\n function periodDuration() public override view returns (uint256) {\n return duration().div(periods);\n }\n\n /**\n * @notice Gets the current period based on the schedule\n * @return A number that represents the current period\n */\n function currentPeriod() public override view returns (uint256) {\n return sinceStartTime().div(periodDuration()).add(MIN_PERIOD);\n }\n\n /**\n * @notice Gets the number of periods that passed since the first period\n * @return A number of periods that passed since the schedule started\n */\n function passedPeriods() public override view returns (uint256) {\n return currentPeriod().sub(MIN_PERIOD);\n }\n\n // -- Locking & Release Schedule --\n\n /**\n * @notice Gets the currently available token according to the schedule\n * @dev Implements the step-by-step schedule based on periods for available tokens\n * @return Amount of tokens available according to the schedule\n */\n function availableAmount() public override view returns (uint256) {\n uint256 current = currentTime();\n\n // Before contract start no funds are available\n if (current < startTime) {\n return 0;\n }\n\n // After contract ended all funds are available\n if (current > endTime) {\n return managedAmount;\n }\n\n // Get available amount based on period\n return passedPeriods().mul(amountPerPeriod());\n }\n\n /**\n * @notice Gets the amount of currently vested tokens\n * @dev Similar to available amount, but is fully vested when contract is non-revocable\n * @return Amount of tokens already vested\n */\n function vestedAmount() public override view returns (uint256) {\n // If non-revocable it is fully vested\n if (revocable == Revocability.Disabled) {\n return managedAmount;\n }\n\n // Vesting cliff is activated and it has not passed means nothing is vested yet\n if (vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\n return 0;\n }\n\n return availableAmount();\n }\n\n /**\n * @notice Gets tokens currently available for release\n * @dev Considers the schedule and takes into account already released tokens\n * @return Amount of tokens ready to be released\n */\n function releasableAmount() public override view returns (uint256) {\n // If a release start time is set no tokens are available for release before this date\n // If not set it follows the default schedule and tokens are available on\n // the first period passed\n if (releaseStartTime > 0 && currentTime() < releaseStartTime) {\n return 0;\n }\n\n // Vesting cliff is activated and it has not passed means nothing is vested yet\n // so funds cannot be released\n if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\n return 0;\n }\n\n // A beneficiary can never have more releasable tokens than the contract balance\n uint256 releasable = availableAmount().sub(releasedAmount);\n return MathUtils.min(currentBalance(), releasable);\n }\n\n /**\n * @notice Gets the outstanding amount yet to be released based on the whole contract lifetime\n * @dev Does not consider schedule but just global amounts tracked\n * @return Amount of outstanding tokens for the lifetime of the contract\n */\n function totalOutstandingAmount() public override view returns (uint256) {\n return managedAmount.sub(releasedAmount);\n }\n\n /**\n * @notice Gets surplus amount in the contract based on outstanding amount to release\n * @dev All funds over outstanding amount is considered surplus that can be withdrawn by beneficiary\n * @return Amount of tokens considered as surplus\n */\n function surplusAmount() public override view returns (uint256) {\n uint256 balance = currentBalance();\n uint256 outstandingAmount = totalOutstandingAmount();\n if (balance > outstandingAmount) {\n return balance.sub(outstandingAmount);\n }\n return 0;\n }\n\n // -- Value Transfer --\n\n /**\n * @notice Releases tokens based on the configured schedule\n * @dev All available releasable tokens are transferred to beneficiary\n */\n function release() external override onlyBeneficiary {\n uint256 amountToRelease = releasableAmount();\n require(amountToRelease > 0, \"No available releasable amount\");\n\n releasedAmount = releasedAmount.add(amountToRelease);\n\n token.safeTransfer(beneficiary, amountToRelease);\n\n emit TokensReleased(beneficiary, amountToRelease);\n }\n\n /**\n * @notice Withdraws surplus, unmanaged tokens from the contract\n * @dev Tokens in the contract over outstanding amount are considered as surplus\n * @param _amount Amount of tokens to withdraw\n */\n function withdrawSurplus(uint256 _amount) external override onlyBeneficiary {\n require(_amount > 0, \"Amount cannot be zero\");\n require(surplusAmount() >= _amount, \"Amount requested > surplus available\");\n\n token.safeTransfer(beneficiary, _amount);\n\n emit TokensWithdrawn(beneficiary, _amount);\n }\n\n /**\n * @notice Revokes a vesting schedule and return the unvested tokens to the owner\n * @dev Vesting schedule is always calculated based on managed tokens\n */\n function revoke() external override onlyOwner {\n require(revocable == Revocability.Enabled, \"Contract is non-revocable\");\n require(isRevoked == false, \"Already revoked\");\n\n uint256 unvestedAmount = managedAmount.sub(vestedAmount());\n require(unvestedAmount > 0, \"No available unvested amount\");\n\n isRevoked = true;\n\n token.safeTransfer(owner(), unvestedAmount);\n\n emit TokensRevoked(beneficiary, unvestedAmount);\n }\n}\n" + }, + "contracts/IGraphTokenLockManager.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\nimport \"./IGraphTokenLock.sol\";\n\ninterface IGraphTokenLockManager {\n // -- Factory --\n\n function setMasterCopy(address _masterCopy) external;\n\n function createTokenLockWallet(\n address _owner,\n address _beneficiary,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n IGraphTokenLock.Revocability _revocable\n ) external;\n\n // -- Funds Management --\n\n function token() external returns (IERC20);\n\n function deposit(uint256 _amount) external;\n\n function withdraw(uint256 _amount) external;\n\n // -- Allowed Funds Destinations --\n\n function addTokenDestination(address _dst) external;\n\n function removeTokenDestination(address _dst) external;\n\n function isTokenDestination(address _dst) external view returns (bool);\n\n function getTokenDestinations() external view returns (address[] memory);\n\n // -- Function Call Authorization --\n\n function setAuthFunctionCall(string calldata _signature, address _target) external;\n\n function unsetAuthFunctionCall(string calldata _signature) external;\n\n function setAuthFunctionCallMany(string[] calldata _signatures, address[] calldata _targets) external;\n\n function getAuthFunctionCallTarget(bytes4 _sigHash) external view returns (address);\n\n function isAuthFunctionCall(bytes4 _sigHash) external view returns (bool);\n}\n" + }, + "contracts/Ownable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * The owner account will be passed on initialization of the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\ncontract Ownable {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n function initialize(address owner) internal {\n _owner = owner;\n emit OwnershipTransferred(address(0), owner);\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(_owner == msg.sender, \"Ownable: caller is not the owner\");\n _;\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() external virtual onlyOwner {\n emit OwnershipTransferred(_owner, address(0));\n _owner = address(0);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) external virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n emit OwnershipTransferred(_owner, newOwner);\n _owner = newOwner;\n }\n}\n" + }, + "contracts/MathUtils.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nlibrary MathUtils {\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n}\n" + }, + "contracts/IGraphTokenLock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\ninterface IGraphTokenLock {\n enum Revocability { NotSet, Enabled, Disabled }\n\n // -- Balances --\n\n function currentBalance() external view returns (uint256);\n\n // -- Time & Periods --\n\n function currentTime() external view returns (uint256);\n\n function duration() external view returns (uint256);\n\n function sinceStartTime() external view returns (uint256);\n\n function amountPerPeriod() external view returns (uint256);\n\n function periodDuration() external view returns (uint256);\n\n function currentPeriod() external view returns (uint256);\n\n function passedPeriods() external view returns (uint256);\n\n // -- Locking & Release Schedule --\n\n function availableAmount() external view returns (uint256);\n\n function vestedAmount() external view returns (uint256);\n\n function releasableAmount() external view returns (uint256);\n\n function totalOutstandingAmount() external view returns (uint256);\n\n function surplusAmount() external view returns (uint256);\n\n // -- Value Transfer --\n\n function release() external;\n\n function withdrawSurplus(uint256 _amount) external;\n\n function revoke() external;\n}\n" + }, + "contracts/StakingMock.sol": { + "content": "pragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\nimport \"./Stakes.sol\";\n\ncontract StakingMock {\n using SafeMath for uint256;\n using Stakes for Stakes.Indexer;\n\n // -- State --\n\n uint256 public minimumIndexerStake = 100e18;\n uint256 public thawingPeriod = 10; // 10 blocks\n IERC20 public token;\n\n // Indexer stakes : indexer => Stake\n mapping(address => Stakes.Indexer) public stakes;\n\n /**\n * @dev Emitted when `indexer` stake `tokens` amount.\n */\n event StakeDeposited(address indexed indexer, uint256 tokens);\n\n /**\n * @dev Emitted when `indexer` unstaked and locked `tokens` amount `until` block.\n */\n event StakeLocked(address indexed indexer, uint256 tokens, uint256 until);\n\n /**\n * @dev Emitted when `indexer` withdrew `tokens` staked.\n */\n event StakeWithdrawn(address indexed indexer, uint256 tokens);\n\n // Contract constructor.\n constructor(IERC20 _token) {\n require(address(_token) != address(0), \"!token\");\n token = _token;\n }\n\n /**\n * @dev Deposit tokens on the indexer stake.\n * @param _tokens Amount of tokens to stake\n */\n function stake(uint256 _tokens) external {\n stakeTo(msg.sender, _tokens);\n }\n\n /**\n * @dev Deposit tokens on the indexer stake.\n * @param _indexer Address of the indexer\n * @param _tokens Amount of tokens to stake\n */\n function stakeTo(address _indexer, uint256 _tokens) public {\n require(_tokens > 0, \"!tokens\");\n\n // Ensure minimum stake\n require(stakes[_indexer].tokensSecureStake().add(_tokens) >= minimumIndexerStake, \"!minimumIndexerStake\");\n\n // Transfer tokens to stake from caller to this contract\n require(token.transferFrom(msg.sender, address(this), _tokens), \"!transfer\");\n\n // Stake the transferred tokens\n _stake(_indexer, _tokens);\n }\n\n /**\n * @dev Unstake tokens from the indexer stake, lock them until thawing period expires.\n * @param _tokens Amount of tokens to unstake\n */\n function unstake(uint256 _tokens) external {\n address indexer = msg.sender;\n Stakes.Indexer storage indexerStake = stakes[indexer];\n\n require(_tokens > 0, \"!tokens\");\n require(indexerStake.hasTokens(), \"!stake\");\n require(indexerStake.tokensAvailable() >= _tokens, \"!stake-avail\");\n\n // Ensure minimum stake\n uint256 newStake = indexerStake.tokensSecureStake().sub(_tokens);\n require(newStake == 0 || newStake >= minimumIndexerStake, \"!minimumIndexerStake\");\n\n // Before locking more tokens, withdraw any unlocked ones\n uint256 tokensToWithdraw = indexerStake.tokensWithdrawable();\n if (tokensToWithdraw > 0) {\n _withdraw(indexer);\n }\n\n indexerStake.lockTokens(_tokens, thawingPeriod);\n\n emit StakeLocked(indexer, indexerStake.tokensLocked, indexerStake.tokensLockedUntil);\n }\n\n /**\n * @dev Withdraw indexer tokens once the thawing period has passed.\n */\n function withdraw() external {\n _withdraw(msg.sender);\n }\n\n function _stake(address _indexer, uint256 _tokens) internal {\n // Deposit tokens into the indexer stake\n Stakes.Indexer storage indexerStake = stakes[_indexer];\n indexerStake.deposit(_tokens);\n\n emit StakeDeposited(_indexer, _tokens);\n }\n\n /**\n * @dev Withdraw indexer tokens once the thawing period has passed.\n * @param _indexer Address of indexer to withdraw funds from\n */\n function _withdraw(address _indexer) private {\n // Get tokens available for withdraw and update balance\n uint256 tokensToWithdraw = stakes[_indexer].withdrawTokens();\n require(tokensToWithdraw > 0, \"!tokens\");\n\n // Return tokens to the indexer\n require(token.transfer(_indexer, tokensToWithdraw), \"!transfer\");\n\n emit StakeWithdrawn(_indexer, tokensToWithdraw);\n }\n}\n" + }, + "contracts/Stakes.sol": { + "content": "pragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/math/SafeMath.sol\";\n\n/**\n * @title A collection of data structures and functions to manage the Indexer Stake state.\n * Used for low-level state changes, require() conditions should be evaluated\n * at the caller function scope.\n */\nlibrary Stakes {\n using SafeMath for uint256;\n using Stakes for Stakes.Indexer;\n\n struct Indexer {\n uint256 tokensStaked; // Tokens on the indexer stake (staked by the indexer)\n uint256 tokensAllocated; // Tokens used in allocations\n uint256 tokensLocked; // Tokens locked for withdrawal subject to thawing period\n uint256 tokensLockedUntil; // Block when locked tokens can be withdrawn\n }\n\n /**\n * @dev Deposit tokens to the indexer stake.\n * @param stake Stake data\n * @param _tokens Amount of tokens to deposit\n */\n function deposit(Stakes.Indexer storage stake, uint256 _tokens) internal {\n stake.tokensStaked = stake.tokensStaked.add(_tokens);\n }\n\n /**\n * @dev Release tokens from the indexer stake.\n * @param stake Stake data\n * @param _tokens Amount of tokens to release\n */\n function release(Stakes.Indexer storage stake, uint256 _tokens) internal {\n stake.tokensStaked = stake.tokensStaked.sub(_tokens);\n }\n\n /**\n * @dev Allocate tokens from the main stack to a SubgraphDeployment.\n * @param stake Stake data\n * @param _tokens Amount of tokens to allocate\n */\n function allocate(Stakes.Indexer storage stake, uint256 _tokens) internal {\n stake.tokensAllocated = stake.tokensAllocated.add(_tokens);\n }\n\n /**\n * @dev Unallocate tokens from a SubgraphDeployment back to the main stack.\n * @param stake Stake data\n * @param _tokens Amount of tokens to unallocate\n */\n function unallocate(Stakes.Indexer storage stake, uint256 _tokens) internal {\n stake.tokensAllocated = stake.tokensAllocated.sub(_tokens);\n }\n\n /**\n * @dev Lock tokens until a thawing period pass.\n * @param stake Stake data\n * @param _tokens Amount of tokens to unstake\n * @param _period Period in blocks that need to pass before withdrawal\n */\n function lockTokens(\n Stakes.Indexer storage stake,\n uint256 _tokens,\n uint256 _period\n ) internal {\n // Take into account period averaging for multiple unstake requests\n uint256 lockingPeriod = _period;\n if (stake.tokensLocked > 0) {\n lockingPeriod = stake.getLockingPeriod(_tokens, _period);\n }\n\n // Update balances\n stake.tokensLocked = stake.tokensLocked.add(_tokens);\n stake.tokensLockedUntil = block.number.add(lockingPeriod);\n }\n\n /**\n * @dev Unlock tokens.\n * @param stake Stake data\n * @param _tokens Amount of tokens to unkock\n */\n function unlockTokens(Stakes.Indexer storage stake, uint256 _tokens) internal {\n stake.tokensLocked = stake.tokensLocked.sub(_tokens);\n if (stake.tokensLocked == 0) {\n stake.tokensLockedUntil = 0;\n }\n }\n\n /**\n * @dev Take all tokens out from the locked stake for withdrawal.\n * @param stake Stake data\n * @return Amount of tokens being withdrawn\n */\n function withdrawTokens(Stakes.Indexer storage stake) internal returns (uint256) {\n // Calculate tokens that can be released\n uint256 tokensToWithdraw = stake.tokensWithdrawable();\n\n if (tokensToWithdraw > 0) {\n // Reset locked tokens\n stake.unlockTokens(tokensToWithdraw);\n\n // Decrease indexer stake\n stake.release(tokensToWithdraw);\n }\n\n return tokensToWithdraw;\n }\n\n /**\n * @dev Get the locking period of the tokens to unstake.\n * If already unstaked before calculate the weighted average.\n * @param stake Stake data\n * @param _tokens Amount of tokens to unstake\n * @param _thawingPeriod Period in blocks that need to pass before withdrawal\n * @return True if staked\n */\n function getLockingPeriod(\n Stakes.Indexer memory stake,\n uint256 _tokens,\n uint256 _thawingPeriod\n ) internal view returns (uint256) {\n uint256 blockNum = block.number;\n uint256 periodA = (stake.tokensLockedUntil > blockNum) ? stake.tokensLockedUntil.sub(blockNum) : 0;\n uint256 periodB = _thawingPeriod;\n uint256 stakeA = stake.tokensLocked;\n uint256 stakeB = _tokens;\n return periodA.mul(stakeA).add(periodB.mul(stakeB)).div(stakeA.add(stakeB));\n }\n\n /**\n * @dev Return true if there are tokens staked by the Indexer.\n * @param stake Stake data\n * @return True if staked\n */\n function hasTokens(Stakes.Indexer memory stake) internal pure returns (bool) {\n return stake.tokensStaked > 0;\n }\n\n /**\n * @dev Return the amount of tokens used in allocations and locked for withdrawal.\n * @param stake Stake data\n * @return Token amount\n */\n function tokensUsed(Stakes.Indexer memory stake) internal pure returns (uint256) {\n return stake.tokensAllocated.add(stake.tokensLocked);\n }\n\n /**\n * @dev Return the amount of tokens staked not considering the ones that are already going\n * through the thawing period or are ready for withdrawal. We call it secure stake because\n * it is not subject to change by a withdraw call from the indexer.\n * @param stake Stake data\n * @return Token amount\n */\n function tokensSecureStake(Stakes.Indexer memory stake) internal pure returns (uint256) {\n return stake.tokensStaked.sub(stake.tokensLocked);\n }\n\n /**\n * @dev Tokens free balance on the indexer stake that can be used for any purpose.\n * Any token that is allocated cannot be used as well as tokens that are going through the\n * thawing period or are withdrawable\n * Calc: tokensStaked - tokensAllocated - tokensLocked\n * @param stake Stake data\n * @return Token amount\n */\n function tokensAvailable(Stakes.Indexer memory stake) internal pure returns (uint256) {\n return stake.tokensAvailableWithDelegation(0);\n }\n\n /**\n * @dev Tokens free balance on the indexer stake that can be used for allocations.\n * This function accepts a parameter for extra delegated capacity that takes into\n * account delegated tokens\n * @param stake Stake data\n * @param _delegatedCapacity Amount of tokens used from delegators to calculate availability\n * @return Token amount\n */\n function tokensAvailableWithDelegation(Stakes.Indexer memory stake, uint256 _delegatedCapacity)\n internal\n pure\n returns (uint256)\n {\n uint256 tokensCapacity = stake.tokensStaked.add(_delegatedCapacity);\n uint256 _tokensUsed = stake.tokensUsed();\n // If more tokens are used than the current capacity, the indexer is overallocated.\n // This means the indexer doesn't have available capacity to create new allocations.\n // We can reach this state when the indexer has funds allocated and then any\n // of these conditions happen:\n // - The delegationCapacity ratio is reduced.\n // - The indexer stake is slashed.\n // - A delegator removes enough stake.\n if (_tokensUsed > tokensCapacity) {\n // Indexer stake is over allocated: return 0 to avoid stake to be used until\n // the overallocation is restored by staking more tokens, unallocating tokens\n // or using more delegated funds\n return 0;\n }\n return tokensCapacity.sub(_tokensUsed);\n }\n\n /**\n * @dev Tokens available for withdrawal after thawing period.\n * @param stake Stake data\n * @return Token amount\n */\n function tokensWithdrawable(Stakes.Indexer memory stake) internal view returns (uint256) {\n // No tokens to withdraw before locking period\n if (stake.tokensLockedUntil == 0 || block.number < stake.tokensLockedUntil) {\n return 0;\n }\n return stake.tokensLocked;\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/ERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\nimport \"../../GSN/Context.sol\";\nimport \"./IERC20.sol\";\nimport \"../../math/SafeMath.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin guidelines: functions revert instead\n * of returning `false` on failure. This behavior is nonetheless conventional\n * and does not conflict with the expectations of ERC20 applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20 {\n using SafeMath for uint256;\n\n mapping (address => uint256) private _balances;\n\n mapping (address => mapping (address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n uint8 private _decimals;\n\n /**\n * @dev Sets the values for {name} and {symbol}, initializes {decimals} with\n * a default value of 18.\n *\n * To select a different value for {decimals}, use {_setupDecimals}.\n *\n * All three of these values are immutable: they can only be set once during\n * construction.\n */\n constructor (string memory name_, string memory symbol_) public {\n _name = name_;\n _symbol = symbol_;\n _decimals = 18;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5,05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless {_setupDecimals} is\n * called.\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `recipient` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address recipient, uint256 amount) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * Requirements:\n *\n * - `sender` and `recipient` cannot be the zero address.\n * - `sender` must have a balance of at least `amount`.\n * - the caller must have allowance for ``sender``'s tokens of at least\n * `amount`.\n */\n function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, \"ERC20: transfer amount exceeds allowance\"));\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, \"ERC20: decreased allowance below zero\"));\n return true;\n }\n\n /**\n * @dev Moves tokens `amount` from `sender` to `recipient`.\n *\n * This is internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `sender` cannot be the zero address.\n * - `recipient` cannot be the zero address.\n * - `sender` must have a balance of at least `amount`.\n */\n function _transfer(address sender, address recipient, uint256 amount) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(sender, recipient, amount);\n\n _balances[sender] = _balances[sender].sub(amount, \"ERC20: transfer amount exceeds balance\");\n _balances[recipient] = _balances[recipient].add(amount);\n emit Transfer(sender, recipient, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply = _totalSupply.add(amount);\n _balances[account] = _balances[account].add(amount);\n emit Transfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n _balances[account] = _balances[account].sub(amount, \"ERC20: burn amount exceeds balance\");\n _totalSupply = _totalSupply.sub(amount);\n emit Transfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(address owner, address spender, uint256 amount) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Sets {decimals} to a value other than the default one of 18.\n *\n * WARNING: This function should only be called from the constructor. Most\n * applications that interact with token contracts will not expect\n * {decimals} to ever change, and may work incorrectly if it does.\n */\n function _setupDecimals(uint8 decimals_) internal {\n _decimals = decimals_;\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be to transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }\n}\n" + }, + "contracts/GraphTokenMock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\n\n/**\n * @title Graph Token Mock\n */\ncontract GraphTokenMock is Ownable, ERC20 {\n /**\n * @dev Contract Constructor.\n * @param _initialSupply Initial supply\n */\n constructor(uint256 _initialSupply, address _mintTo) ERC20(\"Graph Token Mock\", \"GRT-Mock\") {\n // Deploy to mint address\n _mint(_mintTo, _initialSupply);\n }\n}\n" + }, + "contracts/MinimalProxyFactory.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\nimport \"@openzeppelin/contracts/utils/Create2.sol\";\n\n// Adapted from https://github.com/OpenZeppelin/openzeppelin-sdk/blob/v2.5.0/packages/lib/contracts/upgradeability/ProxyFactory.sol\n// Based on https://eips.ethereum.org/EIPS/eip-1167\ncontract MinimalProxyFactory is Ownable {\n // -- Events --\n\n event ProxyCreated(address indexed proxy);\n\n /**\n * @notice Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation\n * @param _salt Bytes32 salt to use for CREATE2\n * @param _implementation Address of the proxy target implementation\n * @return Address of the counterfactual MinimalProxy\n */\n function getDeploymentAddress(bytes32 _salt, address _implementation) external view returns (address) {\n return Create2.computeAddress(_salt, keccak256(_getContractCreationCode(_implementation)), address(this));\n }\n\n /**\n * @notice Deploys a MinimalProxy with CREATE2\n * @param _salt Bytes32 salt to use for CREATE2\n * @param _implementation Address of the proxy target implementation\n * @param _data Bytes with the initializer call\n * @return Address of the deployed MinimalProxy\n */\n function _deployProxy2(\n bytes32 _salt,\n address _implementation,\n bytes memory _data\n ) internal returns (address) {\n address proxyAddress = Create2.deploy(0, _salt, _getContractCreationCode(_implementation));\n\n emit ProxyCreated(proxyAddress);\n\n // Call function with data\n if (_data.length > 0) {\n Address.functionCall(proxyAddress, _data);\n }\n\n return proxyAddress;\n }\n\n /**\n * @notice Gets the MinimalProxy bytecode\n * @param _implementation Address of the proxy target implementation\n * @return MinimalProxy bytecode\n */\n function _getContractCreationCode(address _implementation) internal pure returns (bytes memory) {\n bytes10 creation = 0x3d602d80600a3d3981f3;\n bytes10 prefix = 0x363d3d373d3d3d363d73;\n bytes20 targetBytes = bytes20(_implementation);\n bytes15 suffix = 0x5af43d82803e903d91602b57fd5bf3;\n return abi.encodePacked(creation, prefix, targetBytes, suffix);\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Create2.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/**\n * @dev Helper to make usage of the `CREATE2` EVM opcode easier and safer.\n * `CREATE2` can be used to compute in advance the address where a smart\n * contract will be deployed, which allows for interesting new mechanisms known\n * as 'counterfactual interactions'.\n *\n * See the https://eips.ethereum.org/EIPS/eip-1014#motivation[EIP] for more\n * information.\n */\nlibrary Create2 {\n /**\n * @dev Deploys a contract using `CREATE2`. The address where the contract\n * will be deployed can be known in advance via {computeAddress}.\n *\n * The bytecode for a contract can be obtained from Solidity with\n * `type(contractName).creationCode`.\n *\n * Requirements:\n *\n * - `bytecode` must not be empty.\n * - `salt` must have not been used for `bytecode` already.\n * - the factory must have a balance of at least `amount`.\n * - if `amount` is non-zero, `bytecode` must have a `payable` constructor.\n */\n function deploy(uint256 amount, bytes32 salt, bytes memory bytecode) internal returns (address) {\n address addr;\n require(address(this).balance >= amount, \"Create2: insufficient balance\");\n require(bytecode.length != 0, \"Create2: bytecode length is zero\");\n // solhint-disable-next-line no-inline-assembly\n assembly {\n addr := create2(amount, add(bytecode, 0x20), mload(bytecode), salt)\n }\n require(addr != address(0), \"Create2: Failed on deploy\");\n return addr;\n }\n\n /**\n * @dev Returns the address where a contract will be stored if deployed via {deploy}. Any change in the\n * `bytecodeHash` or `salt` will result in a new destination address.\n */\n function computeAddress(bytes32 salt, bytes32 bytecodeHash) internal view returns (address) {\n return computeAddress(salt, bytecodeHash, address(this));\n }\n\n /**\n * @dev Returns the address where a contract will be stored if deployed via {deploy} from a contract located at\n * `deployer`. If `deployer` is this contract's address, returns the same value as {computeAddress}.\n */\n function computeAddress(bytes32 salt, bytes32 bytecodeHash, address deployer) internal pure returns (address) {\n bytes32 _data = keccak256(\n abi.encodePacked(bytes1(0xff), deployer, salt, bytecodeHash)\n );\n return address(uint256(_data));\n }\n}\n" + }, + "contracts/GraphTokenLockManager.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\";\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"@openzeppelin/contracts/utils/EnumerableSet.sol\";\n\nimport \"./MinimalProxyFactory.sol\";\nimport \"./IGraphTokenLockManager.sol\";\n\n/**\n * @title GraphTokenLockManager\n * @notice This contract manages a list of authorized function calls and targets that can be called\n * by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts.\n *\n * This contract receives funds to make the process of creating TokenLockWallet contracts\n * easier by distributing them the initial tokens to be managed.\n *\n * The owner can setup a list of token destinations that will be used by TokenLock contracts to\n * approve the pulling of funds, this way in can be guaranteed that only protocol contracts\n * will manipulate users funds.\n */\ncontract GraphTokenLockManager is MinimalProxyFactory, IGraphTokenLockManager {\n using SafeERC20 for IERC20;\n using EnumerableSet for EnumerableSet.AddressSet;\n\n // -- State --\n\n mapping(bytes4 => address) public authFnCalls;\n EnumerableSet.AddressSet private _tokenDestinations;\n\n address public masterCopy;\n IERC20 private _token;\n\n // -- Events --\n\n event MasterCopyUpdated(address indexed masterCopy);\n event TokenLockCreated(\n address indexed contractAddress,\n bytes32 indexed initHash,\n address indexed beneficiary,\n address token,\n uint256 managedAmount,\n uint256 startTime,\n uint256 endTime,\n uint256 periods,\n uint256 releaseStartTime,\n uint256 vestingCliffTime,\n IGraphTokenLock.Revocability revocable\n );\n\n event TokensDeposited(address indexed sender, uint256 amount);\n event TokensWithdrawn(address indexed sender, uint256 amount);\n\n event FunctionCallAuth(address indexed caller, bytes4 indexed sigHash, address indexed target, string signature);\n event TokenDestinationAllowed(address indexed dst, bool allowed);\n\n /**\n * Constructor.\n * @param _graphToken Token to use for deposits and withdrawals\n * @param _masterCopy Address of the master copy to use to clone proxies\n */\n constructor(IERC20 _graphToken, address _masterCopy) {\n require(address(_graphToken) != address(0), \"Token cannot be zero\");\n _token = _graphToken;\n setMasterCopy(_masterCopy);\n }\n\n // -- Factory --\n\n /**\n * @notice Sets the masterCopy bytecode to use to create clones of TokenLock contracts\n * @param _masterCopy Address of contract bytecode to factory clone\n */\n function setMasterCopy(address _masterCopy) public override onlyOwner {\n require(_masterCopy != address(0), \"MasterCopy cannot be zero\");\n masterCopy = _masterCopy;\n emit MasterCopyUpdated(_masterCopy);\n }\n\n /**\n * @notice Creates and fund a new token lock wallet using a minimum proxy\n * @param _owner Address of the contract owner\n * @param _beneficiary Address of the beneficiary of locked tokens\n * @param _managedAmount Amount of tokens to be managed by the lock contract\n * @param _startTime Start time of the release schedule\n * @param _endTime End time of the release schedule\n * @param _periods Number of periods between start time and end time\n * @param _releaseStartTime Override time for when the releases start\n * @param _revocable Whether the contract is revocable\n */\n function createTokenLockWallet(\n address _owner,\n address _beneficiary,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n IGraphTokenLock.Revocability _revocable\n ) external override onlyOwner {\n require(_token.balanceOf(address(this)) >= _managedAmount, \"Not enough tokens to create lock\");\n\n // Create contract using a minimal proxy and call initializer\n bytes memory initializer = abi.encodeWithSignature(\n \"initialize(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)\",\n address(this),\n _owner,\n _beneficiary,\n address(_token),\n _managedAmount,\n _startTime,\n _endTime,\n _periods,\n _releaseStartTime,\n _vestingCliffTime,\n _revocable\n );\n address contractAddress = _deployProxy2(keccak256(initializer), masterCopy, initializer);\n\n // Send managed amount to the created contract\n _token.safeTransfer(contractAddress, _managedAmount);\n\n emit TokenLockCreated(\n contractAddress,\n keccak256(initializer),\n _beneficiary,\n address(_token),\n _managedAmount,\n _startTime,\n _endTime,\n _periods,\n _releaseStartTime,\n _vestingCliffTime,\n _revocable\n );\n }\n\n // -- Funds Management --\n\n /**\n * @notice Gets the GRT token address\n * @return Token used for transfers and approvals\n */\n function token() external view override returns (IERC20) {\n return _token;\n }\n\n /**\n * @notice Deposits tokens into the contract\n * @dev Even if the ERC20 token can be transferred directly to the contract\n * this function provide a safe interface to do the transfer and avoid mistakes\n * @param _amount Amount to deposit\n */\n function deposit(uint256 _amount) external override {\n require(_amount > 0, \"Amount cannot be zero\");\n _token.safeTransferFrom(msg.sender, address(this), _amount);\n emit TokensDeposited(msg.sender, _amount);\n }\n\n /**\n * @notice Withdraws tokens from the contract\n * @dev Escape hatch in case of mistakes or to recover remaining funds\n * @param _amount Amount of tokens to withdraw\n */\n function withdraw(uint256 _amount) external override onlyOwner {\n require(_amount > 0, \"Amount cannot be zero\");\n _token.safeTransfer(msg.sender, _amount);\n emit TokensWithdrawn(msg.sender, _amount);\n }\n\n // -- Token Destinations --\n\n /**\n * @notice Adds an address that can be allowed by a token lock to pull funds\n * @param _dst Destination address\n */\n function addTokenDestination(address _dst) external override onlyOwner {\n require(_dst != address(0), \"Destination cannot be zero\");\n require(_tokenDestinations.add(_dst), \"Destination already added\");\n emit TokenDestinationAllowed(_dst, true);\n }\n\n /**\n * @notice Removes an address that can be allowed by a token lock to pull funds\n * @param _dst Destination address\n */\n function removeTokenDestination(address _dst) external override onlyOwner {\n require(_tokenDestinations.remove(_dst), \"Destination already removed\");\n emit TokenDestinationAllowed(_dst, false);\n }\n\n /**\n * @notice Returns True if the address is authorized to be a destination of tokens\n * @param _dst Destination address\n * @return True if authorized\n */\n function isTokenDestination(address _dst) external view override returns (bool) {\n return _tokenDestinations.contains(_dst);\n }\n\n /**\n * @notice Returns an array of authorized destination addresses\n * @return Array of addresses authorized to pull funds from a token lock\n */\n function getTokenDestinations() external view override returns (address[] memory) {\n address[] memory dstList = new address[](_tokenDestinations.length());\n for (uint256 i = 0; i < _tokenDestinations.length(); i++) {\n dstList[i] = _tokenDestinations.at(i);\n }\n return dstList;\n }\n\n // -- Function Call Authorization --\n\n /**\n * @notice Sets an authorized function call to target\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\n * @param _signature Function signature\n * @param _target Address of the destination contract to call\n */\n function setAuthFunctionCall(string calldata _signature, address _target) external override onlyOwner {\n _setAuthFunctionCall(_signature, _target);\n }\n\n /**\n * @notice Unsets an authorized function call to target\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\n * @param _signature Function signature\n */\n function unsetAuthFunctionCall(string calldata _signature) external override onlyOwner {\n bytes4 sigHash = _toFunctionSigHash(_signature);\n authFnCalls[sigHash] = address(0);\n\n emit FunctionCallAuth(msg.sender, sigHash, address(0), _signature);\n }\n\n /**\n * @notice Sets an authorized function call to target in bulk\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\n * @param _signatures Function signatures\n * @param _targets Address of the destination contract to call\n */\n function setAuthFunctionCallMany(string[] calldata _signatures, address[] calldata _targets)\n external\n override\n onlyOwner\n {\n require(_signatures.length == _targets.length, \"Array length mismatch\");\n\n for (uint256 i = 0; i < _signatures.length; i++) {\n _setAuthFunctionCall(_signatures[i], _targets[i]);\n }\n }\n\n /**\n * @notice Sets an authorized function call to target\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\n * @dev Function signatures of Graph Protocol contracts to be used are known ahead of time\n * @param _signature Function signature\n * @param _target Address of the destination contract to call\n */\n function _setAuthFunctionCall(string calldata _signature, address _target) internal {\n require(_target != address(this), \"Target must be other contract\");\n require(Address.isContract(_target), \"Target must be a contract\");\n\n bytes4 sigHash = _toFunctionSigHash(_signature);\n authFnCalls[sigHash] = _target;\n\n emit FunctionCallAuth(msg.sender, sigHash, _target, _signature);\n }\n\n /**\n * @notice Gets the target contract to call for a particular function signature\n * @param _sigHash Function signature hash\n * @return Address of the target contract where to send the call\n */\n function getAuthFunctionCallTarget(bytes4 _sigHash) public view override returns (address) {\n return authFnCalls[_sigHash];\n }\n\n /**\n * @notice Returns true if the function call is authorized\n * @param _sigHash Function signature hash\n * @return True if authorized\n */\n function isAuthFunctionCall(bytes4 _sigHash) external view override returns (bool) {\n return getAuthFunctionCallTarget(_sigHash) != address(0);\n }\n\n /**\n * @dev Converts a function signature string to 4-bytes hash\n * @param _signature Function signature string\n * @return Function signature hash\n */\n function _toFunctionSigHash(string calldata _signature) internal pure returns (bytes4) {\n return _convertToBytes4(abi.encodeWithSignature(_signature));\n }\n\n /**\n * @dev Converts function signature bytes to function signature hash (bytes4)\n * @param _signature Function signature\n * @return Function signature in bytes4\n */\n function _convertToBytes4(bytes memory _signature) internal pure returns (bytes4) {\n require(_signature.length == 4, \"Invalid method signature\");\n bytes4 sigHash;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n sigHash := mload(add(_signature, 32))\n }\n return sigHash;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/EnumerableSet.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/**\n * @dev Library for managing\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\n * types.\n *\n * Sets have the following properties:\n *\n * - Elements are added, removed, and checked for existence in constant time\n * (O(1)).\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\n *\n * ```\n * contract Example {\n * // Add the library methods\n * using EnumerableSet for EnumerableSet.AddressSet;\n *\n * // Declare a set state variable\n * EnumerableSet.AddressSet private mySet;\n * }\n * ```\n *\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\n * and `uint256` (`UintSet`) are supported.\n */\nlibrary EnumerableSet {\n // To implement this library for multiple types with as little code\n // repetition as possible, we write it in terms of a generic Set type with\n // bytes32 values.\n // The Set implementation uses private functions, and user-facing\n // implementations (such as AddressSet) are just wrappers around the\n // underlying Set.\n // This means that we can only create new EnumerableSets for types that fit\n // in bytes32.\n\n struct Set {\n // Storage of set values\n bytes32[] _values;\n\n // Position of the value in the `values` array, plus 1 because index 0\n // means a value is not in the set.\n mapping (bytes32 => uint256) _indexes;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function _add(Set storage set, bytes32 value) private returns (bool) {\n if (!_contains(set, value)) {\n set._values.push(value);\n // The value is stored at length-1, but we add 1 to all indexes\n // and use 0 as a sentinel value\n set._indexes[value] = set._values.length;\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function _remove(Set storage set, bytes32 value) private returns (bool) {\n // We read and store the value's index to prevent multiple reads from the same storage slot\n uint256 valueIndex = set._indexes[value];\n\n if (valueIndex != 0) { // Equivalent to contains(set, value)\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\n // the array, and then remove the last element (sometimes called as 'swap and pop').\n // This modifies the order of the array, as noted in {at}.\n\n uint256 toDeleteIndex = valueIndex - 1;\n uint256 lastIndex = set._values.length - 1;\n\n // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs\n // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.\n\n bytes32 lastvalue = set._values[lastIndex];\n\n // Move the last value to the index where the value to delete is\n set._values[toDeleteIndex] = lastvalue;\n // Update the index for the moved value\n set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based\n\n // Delete the slot where the moved value was stored\n set._values.pop();\n\n // Delete the index for the deleted slot\n delete set._indexes[value];\n\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\n return set._indexes[value] != 0;\n }\n\n /**\n * @dev Returns the number of values on the set. O(1).\n */\n function _length(Set storage set) private view returns (uint256) {\n return set._values.length;\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\n require(set._values.length > index, \"EnumerableSet: index out of bounds\");\n return set._values[index];\n }\n\n // Bytes32Set\n\n struct Bytes32Set {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _add(set._inner, value);\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _remove(set._inner, value);\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\n return _contains(set._inner, value);\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(Bytes32Set storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\n return _at(set._inner, index);\n }\n\n // AddressSet\n\n struct AddressSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(AddressSet storage set, address value) internal returns (bool) {\n return _add(set._inner, bytes32(uint256(value)));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(AddressSet storage set, address value) internal returns (bool) {\n return _remove(set._inner, bytes32(uint256(value)));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(AddressSet storage set, address value) internal view returns (bool) {\n return _contains(set._inner, bytes32(uint256(value)));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(AddressSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\n return address(uint256(_at(set._inner, index)));\n }\n\n\n // UintSet\n\n struct UintSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(UintSet storage set, uint256 value) internal returns (bool) {\n return _add(set._inner, bytes32(value));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\n return _remove(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\n return _contains(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns the number of values on the set. O(1).\n */\n function length(UintSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\n return uint256(_at(set._inner, index));\n }\n}\n" + }, + "contracts/GraphTokenLockSimple.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport \"./GraphTokenLock.sol\";\n\n/**\n * @title GraphTokenLockSimple\n * @notice This contract is the concrete simple implementation built on top of the base\n * GraphTokenLock functionality for use when we only need the token lock schedule\n * features but no interaction with the network.\n * \n * This contract is designed to be deployed without the use of a TokenManager.\n */\ncontract GraphTokenLockSimple is GraphTokenLock {\n // Constructor\n constructor() {\n Ownable.initialize(msg.sender);\n }\n\n // Initializer\n function initialize(\n address _owner,\n address _beneficiary,\n address _token,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n Revocability _revocable\n ) external onlyOwner {\n _initialize(\n _owner,\n _beneficiary,\n _token,\n _managedAmount,\n _startTime,\n _endTime,\n _periods,\n _releaseStartTime,\n _vestingCliffTime,\n _revocable\n );\n }\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": false, + "runs": 200 + }, + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file diff --git a/packages/token-distribution/deployments/sepolia/.chainId b/packages/token-distribution/deployments/sepolia/.chainId new file mode 100644 index 000000000..bd8d1cd44 --- /dev/null +++ b/packages/token-distribution/deployments/sepolia/.chainId @@ -0,0 +1 @@ +11155111 \ No newline at end of file diff --git a/packages/token-distribution/deployments/sepolia/GraphTokenLockManager.json b/packages/token-distribution/deployments/sepolia/GraphTokenLockManager.json new file mode 100644 index 000000000..929ab3ff5 --- /dev/null +++ b/packages/token-distribution/deployments/sepolia/GraphTokenLockManager.json @@ -0,0 +1,969 @@ +{ + "address": "0x11682Df78472B8c533160E898f8D1b134AE1CE0D", + "abi": [ + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_graphToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_masterCopy", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes4", + "name": "sigHash", + "type": "bytes4" + }, + { + "indexed": true, + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "indexed": false, + "internalType": "string", + "name": "signature", + "type": "string" + } + ], + "name": "FunctionCallAuth", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "masterCopy", + "type": "address" + } + ], + "name": "MasterCopyUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "proxy", + "type": "address" + } + ], + "name": "ProxyCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "dst", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "TokenDestinationAllowed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "contractAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "initHash", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "managedAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "startTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "endTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "periods", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "releaseStartTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "vestingCliffTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "enum IGraphTokenLock.Revocability", + "name": "revocable", + "type": "uint8" + } + ], + "name": "TokenLockCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensDeposited", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensWithdrawn", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_dst", + "type": "address" + } + ], + "name": "addTokenDestination", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "", + "type": "bytes4" + } + ], + "name": "authFnCalls", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_owner", + "type": "address" + }, + { + "internalType": "address", + "name": "_beneficiary", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_managedAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_startTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_endTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_periods", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_releaseStartTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_vestingCliffTime", + "type": "uint256" + }, + { + "internalType": "enum IGraphTokenLock.Revocability", + "name": "_revocable", + "type": "uint8" + } + ], + "name": "createTokenLockWallet", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "deposit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_sigHash", + "type": "bytes4" + } + ], + "name": "getAuthFunctionCallTarget", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_salt", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "_implementation", + "type": "address" + }, + { + "internalType": "address", + "name": "_deployer", + "type": "address" + } + ], + "name": "getDeploymentAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_salt", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "_implementation", + "type": "address" + } + ], + "name": "getDeploymentAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getTokenDestinations", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_sigHash", + "type": "bytes4" + } + ], + "name": "isAuthFunctionCall", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_dst", + "type": "address" + } + ], + "name": "isTokenDestination", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "masterCopy", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_dst", + "type": "address" + } + ], + "name": "removeTokenDestination", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_signature", + "type": "string" + }, + { + "internalType": "address", + "name": "_target", + "type": "address" + } + ], + "name": "setAuthFunctionCall", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string[]", + "name": "_signatures", + "type": "string[]" + }, + { + "internalType": "address[]", + "name": "_targets", + "type": "address[]" + } + ], + "name": "setAuthFunctionCallMany", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_masterCopy", + "type": "address" + } + ], + "name": "setMasterCopy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "token", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_signature", + "type": "string" + } + ], + "name": "unsetAuthFunctionCall", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x789ed81816498d4826ba8ef43a8f9396030694029fb331243388b1be4876e15a", + "receipt": { + "to": null, + "from": "0x559081D91F5Ff43dfE51A07C216F8E6893805B35", + "contractAddress": "0x11682Df78472B8c533160E898f8D1b134AE1CE0D", + "transactionIndex": 47, + "gasUsed": "3196993", + "logsBloom": "0x00000000000000000000000000000000000004000000000000801000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000400000000000000000020000000000000000000800000000000000000000000040000000400000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000200000000000000000000000000000000000000000010000000000020000020000000000000000000000000000000040000000000000000000000001000000000", + "blockHash": "0xe5a1b4cd80a8d1d3a9c3412055f36cc2b4c1a72d39ca9167eb5f0fbf3d6a5ae6", + "transactionHash": "0x789ed81816498d4826ba8ef43a8f9396030694029fb331243388b1be4876e15a", + "logs": [ + { + "transactionIndex": 47, + "blockNumber": 4570364, + "transactionHash": "0x789ed81816498d4826ba8ef43a8f9396030694029fb331243388b1be4876e15a", + "address": "0x11682Df78472B8c533160E898f8D1b134AE1CE0D", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000559081d91f5ff43dfe51a07c216f8e6893805b35" + ], + "data": "0x", + "logIndex": 134, + "blockHash": "0xe5a1b4cd80a8d1d3a9c3412055f36cc2b4c1a72d39ca9167eb5f0fbf3d6a5ae6" + }, + { + "transactionIndex": 47, + "blockNumber": 4570364, + "transactionHash": "0x789ed81816498d4826ba8ef43a8f9396030694029fb331243388b1be4876e15a", + "address": "0x11682Df78472B8c533160E898f8D1b134AE1CE0D", + "topics": [ + "0x30909084afc859121ffc3a5aef7fe37c540a9a1ef60bd4d8dcdb76376fadf9de", + "0x000000000000000000000000d8a03c88984d5669d467ae72fbb21cd7ce6e08d4" + ], + "data": "0x", + "logIndex": 135, + "blockHash": "0xe5a1b4cd80a8d1d3a9c3412055f36cc2b4c1a72d39ca9167eb5f0fbf3d6a5ae6" + } + ], + "blockNumber": 4570364, + "cumulativeGasUsed": "14371490", + "status": 1, + "byzantium": true + }, + "args": [ + "0xCA59cCeb39bE1808d7aA607153f4A5062daF3a83", + "0xd8a03C88984d5669d467aE72Fbb21cD7Ce6E08D4" + ], + "solcInputHash": "095bd30babc75057be19228ca1fd7aa4", + "metadata": "{\"compiler\":{\"version\":\"0.7.3+commit.9bfce1f6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"_graphToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_masterCopy\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes4\",\"name\":\"sigHash\",\"type\":\"bytes4\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"signature\",\"type\":\"string\"}],\"name\":\"FunctionCallAuth\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"masterCopy\",\"type\":\"address\"}],\"name\":\"MasterCopyUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"proxy\",\"type\":\"address\"}],\"name\":\"ProxyCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dst\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"}],\"name\":\"TokenDestinationAllowed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"contractAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"initHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"managedAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"startTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"endTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"periods\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"releaseStartTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"vestingCliffTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"enum IGraphTokenLock.Revocability\",\"name\":\"revocable\",\"type\":\"uint8\"}],\"name\":\"TokenLockCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensWithdrawn\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_dst\",\"type\":\"address\"}],\"name\":\"addTokenDestination\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"name\":\"authFnCalls\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_beneficiary\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_managedAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_startTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_endTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_periods\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_releaseStartTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_vestingCliffTime\",\"type\":\"uint256\"},{\"internalType\":\"enum IGraphTokenLock.Revocability\",\"name\":\"_revocable\",\"type\":\"uint8\"}],\"name\":\"createTokenLockWallet\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"deposit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"_sigHash\",\"type\":\"bytes4\"}],\"name\":\"getAuthFunctionCallTarget\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_salt\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_deployer\",\"type\":\"address\"}],\"name\":\"getDeploymentAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_salt\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"}],\"name\":\"getDeploymentAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTokenDestinations\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"_sigHash\",\"type\":\"bytes4\"}],\"name\":\"isAuthFunctionCall\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_dst\",\"type\":\"address\"}],\"name\":\"isTokenDestination\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"masterCopy\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_dst\",\"type\":\"address\"}],\"name\":\"removeTokenDestination\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_signature\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"_target\",\"type\":\"address\"}],\"name\":\"setAuthFunctionCall\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string[]\",\"name\":\"_signatures\",\"type\":\"string[]\"},{\"internalType\":\"address[]\",\"name\":\"_targets\",\"type\":\"address[]\"}],\"name\":\"setAuthFunctionCallMany\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_masterCopy\",\"type\":\"address\"}],\"name\":\"setMasterCopy\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_signature\",\"type\":\"string\"}],\"name\":\"unsetAuthFunctionCall\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"addTokenDestination(address)\":{\"params\":{\"_dst\":\"Destination address\"}},\"constructor\":{\"params\":{\"_graphToken\":\"Token to use for deposits and withdrawals\",\"_masterCopy\":\"Address of the master copy to use to clone proxies\"}},\"createTokenLockWallet(address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)\":{\"params\":{\"_beneficiary\":\"Address of the beneficiary of locked tokens\",\"_endTime\":\"End time of the release schedule\",\"_managedAmount\":\"Amount of tokens to be managed by the lock contract\",\"_owner\":\"Address of the contract owner\",\"_periods\":\"Number of periods between start time and end time\",\"_releaseStartTime\":\"Override time for when the releases start\",\"_revocable\":\"Whether the contract is revocable\",\"_startTime\":\"Start time of the release schedule\"}},\"deposit(uint256)\":{\"details\":\"Even if the ERC20 token can be transferred directly to the contract this function provide a safe interface to do the transfer and avoid mistakes\",\"params\":{\"_amount\":\"Amount to deposit\"}},\"getAuthFunctionCallTarget(bytes4)\":{\"params\":{\"_sigHash\":\"Function signature hash\"},\"returns\":{\"_0\":\"Address of the target contract where to send the call\"}},\"getDeploymentAddress(bytes32,address)\":{\"details\":\"Uses address(this) as deployer to compute the address. Only for backwards compatibility.\",\"params\":{\"_implementation\":\"Address of the proxy target implementation\",\"_salt\":\"Bytes32 salt to use for CREATE2\"},\"returns\":{\"_0\":\"Address of the counterfactual MinimalProxy\"}},\"getDeploymentAddress(bytes32,address,address)\":{\"params\":{\"_deployer\":\"Address of the deployer that creates the contract\",\"_implementation\":\"Address of the proxy target implementation\",\"_salt\":\"Bytes32 salt to use for CREATE2\"},\"returns\":{\"_0\":\"Address of the counterfactual MinimalProxy\"}},\"getTokenDestinations()\":{\"returns\":{\"_0\":\"Array of addresses authorized to pull funds from a token lock\"}},\"isAuthFunctionCall(bytes4)\":{\"params\":{\"_sigHash\":\"Function signature hash\"},\"returns\":{\"_0\":\"True if authorized\"}},\"isTokenDestination(address)\":{\"params\":{\"_dst\":\"Destination address\"},\"returns\":{\"_0\":\"True if authorized\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"removeTokenDestination(address)\":{\"params\":{\"_dst\":\"Destination address\"}},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"setAuthFunctionCall(string,address)\":{\"details\":\"Input expected is the function signature as 'transfer(address,uint256)'\",\"params\":{\"_signature\":\"Function signature\",\"_target\":\"Address of the destination contract to call\"}},\"setAuthFunctionCallMany(string[],address[])\":{\"details\":\"Input expected is the function signature as 'transfer(address,uint256)'\",\"params\":{\"_signatures\":\"Function signatures\",\"_targets\":\"Address of the destination contract to call\"}},\"setMasterCopy(address)\":{\"params\":{\"_masterCopy\":\"Address of contract bytecode to factory clone\"}},\"token()\":{\"returns\":{\"_0\":\"Token used for transfers and approvals\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"unsetAuthFunctionCall(string)\":{\"details\":\"Input expected is the function signature as 'transfer(address,uint256)'\",\"params\":{\"_signature\":\"Function signature\"}},\"withdraw(uint256)\":{\"details\":\"Escape hatch in case of mistakes or to recover remaining funds\",\"params\":{\"_amount\":\"Amount of tokens to withdraw\"}}},\"title\":\"GraphTokenLockManager\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"addTokenDestination(address)\":{\"notice\":\"Adds an address that can be allowed by a token lock to pull funds\"},\"constructor\":{\"notice\":\"Constructor.\"},\"createTokenLockWallet(address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)\":{\"notice\":\"Creates and fund a new token lock wallet using a minimum proxy\"},\"deposit(uint256)\":{\"notice\":\"Deposits tokens into the contract\"},\"getAuthFunctionCallTarget(bytes4)\":{\"notice\":\"Gets the target contract to call for a particular function signature\"},\"getDeploymentAddress(bytes32,address)\":{\"notice\":\"Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation\"},\"getDeploymentAddress(bytes32,address,address)\":{\"notice\":\"Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation\"},\"getTokenDestinations()\":{\"notice\":\"Returns an array of authorized destination addresses\"},\"isAuthFunctionCall(bytes4)\":{\"notice\":\"Returns true if the function call is authorized\"},\"isTokenDestination(address)\":{\"notice\":\"Returns True if the address is authorized to be a destination of tokens\"},\"removeTokenDestination(address)\":{\"notice\":\"Removes an address that can be allowed by a token lock to pull funds\"},\"setAuthFunctionCall(string,address)\":{\"notice\":\"Sets an authorized function call to target\"},\"setAuthFunctionCallMany(string[],address[])\":{\"notice\":\"Sets an authorized function call to target in bulk\"},\"setMasterCopy(address)\":{\"notice\":\"Sets the masterCopy bytecode to use to create clones of TokenLock contracts\"},\"token()\":{\"notice\":\"Gets the GRT token address\"},\"unsetAuthFunctionCall(string)\":{\"notice\":\"Unsets an authorized function call to target\"},\"withdraw(uint256)\":{\"notice\":\"Withdraws tokens from the contract\"}},\"notice\":\"This contract manages a list of authorized function calls and targets that can be called by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts. This contract receives funds to make the process of creating TokenLockWallet contracts easier by distributing them the initial tokens to be managed. The owner can setup a list of token destinations that will be used by TokenLock contracts to approve the pulling of funds, this way in can be guaranteed that only protocol contracts will manipulate users funds.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/GraphTokenLockManager.sol\":\"GraphTokenLockManager\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor () internal {\\n address msgSender = _msgSender();\\n _owner = msgSender;\\n emit OwnershipTransferred(address(0), msgSender);\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n emit OwnershipTransferred(_owner, address(0));\\n _owner = address(0);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n emit OwnershipTransferred(_owner, newOwner);\\n _owner = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0x15e2d5bd4c28a88548074c54d220e8086f638a71ed07e6b3ba5a70066fcf458d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/math/SafeMath.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Wrappers over Solidity's arithmetic operations with added overflow\\n * checks.\\n *\\n * Arithmetic operations in Solidity wrap on overflow. This can easily result\\n * in bugs, because programmers usually assume that an overflow raises an\\n * error, which is the standard behavior in high level programming languages.\\n * `SafeMath` restores this intuition by reverting the transaction when an\\n * operation overflows.\\n *\\n * Using this library instead of the unchecked operations eliminates an entire\\n * class of bugs, so it's recommended to use it always.\\n */\\nlibrary SafeMath {\\n /**\\n * @dev Returns the addition of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n uint256 c = a + b;\\n if (c < a) return (false, 0);\\n return (true, c);\\n }\\n\\n /**\\n * @dev Returns the substraction of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b > a) return (false, 0);\\n return (true, a - b);\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\\n if (a == 0) return (true, 0);\\n uint256 c = a * b;\\n if (c / a != b) return (false, 0);\\n return (true, c);\\n }\\n\\n /**\\n * @dev Returns the division of two unsigned integers, with a division by zero flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b == 0) return (false, 0);\\n return (true, a / b);\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b == 0) return (false, 0);\\n return (true, a % b);\\n }\\n\\n /**\\n * @dev Returns the addition of two unsigned integers, reverting on\\n * overflow.\\n *\\n * Counterpart to Solidity's `+` operator.\\n *\\n * Requirements:\\n *\\n * - Addition cannot overflow.\\n */\\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\\n uint256 c = a + b;\\n require(c >= a, \\\"SafeMath: addition overflow\\\");\\n return c;\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting on\\n * overflow (when the result is negative).\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n *\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b <= a, \\\"SafeMath: subtraction overflow\\\");\\n return a - b;\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, reverting on\\n * overflow.\\n *\\n * Counterpart to Solidity's `*` operator.\\n *\\n * Requirements:\\n *\\n * - Multiplication cannot overflow.\\n */\\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\\n if (a == 0) return 0;\\n uint256 c = a * b;\\n require(c / a == b, \\\"SafeMath: multiplication overflow\\\");\\n return c;\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers, reverting on\\n * division by zero. The result is rounded towards zero.\\n *\\n * Counterpart to Solidity's `/` operator. Note: this function uses a\\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\\n * uses an invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b > 0, \\\"SafeMath: division by zero\\\");\\n return a / b;\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * reverting when dividing by zero.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b > 0, \\\"SafeMath: modulo by zero\\\");\\n return a % b;\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\\n * overflow (when the result is negative).\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {trySub}.\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n *\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b <= a, errorMessage);\\n return a - b;\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers, reverting with custom message on\\n * division by zero. The result is rounded towards zero.\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {tryDiv}.\\n *\\n * Counterpart to Solidity's `/` operator. Note: this function uses a\\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\\n * uses an invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b > 0, errorMessage);\\n return a / b;\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * reverting with custom message when dividing by zero.\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {tryMod}.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b > 0, errorMessage);\\n return a % b;\\n }\\n}\\n\",\"keccak256\":\"0xcc78a17dd88fa5a2edc60c8489e2f405c0913b377216a5b26b35656b2d0dab52\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `recipient`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address recipient, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `sender` to `recipient` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n}\\n\",\"keccak256\":\"0x5f02220344881ce43204ae4a6281145a67bc52c2bb1290a791857df3d19d78f5\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\nimport \\\"./IERC20.sol\\\";\\nimport \\\"../../math/SafeMath.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @title SafeERC20\\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\\n * contract returns false). Tokens that return no value (and instead revert or\\n * throw on failure) are also supported, non-reverting calls are assumed to be\\n * successful.\\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\n */\\nlibrary SafeERC20 {\\n using SafeMath for uint256;\\n using Address for address;\\n\\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\\n }\\n\\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\\n }\\n\\n /**\\n * @dev Deprecated. This function has issues similar to the ones found in\\n * {IERC20-approve}, and its usage is discouraged.\\n *\\n * Whenever possible, use {safeIncreaseAllowance} and\\n * {safeDecreaseAllowance} instead.\\n */\\n function safeApprove(IERC20 token, address spender, uint256 value) internal {\\n // safeApprove should only be called when setting an initial allowance,\\n // or when resetting it to zero. To increase and decrease it, use\\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\\n // solhint-disable-next-line max-line-length\\n require((value == 0) || (token.allowance(address(this), spender) == 0),\\n \\\"SafeERC20: approve from non-zero to non-zero allowance\\\"\\n );\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\\n }\\n\\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n uint256 newAllowance = token.allowance(address(this), spender).add(value);\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n uint256 newAllowance = token.allowance(address(this), spender).sub(value, \\\"SafeERC20: decreased allowance below zero\\\");\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n */\\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that\\n // the target address contains contract code and also asserts for success in the low-level call.\\n\\n bytes memory returndata = address(token).functionCall(data, \\\"SafeERC20: low-level call failed\\\");\\n if (returndata.length > 0) { // Return data is optional\\n // solhint-disable-next-line max-line-length\\n require(abi.decode(returndata, (bool)), \\\"SafeERC20: ERC20 operation did not succeed\\\");\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf12dfbe97e6276980b83d2830bb0eb75e0cf4f3e626c2471137f82158ae6a0fc\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.2 <0.8.0;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize, which returns 0 for contracts in\\n // construction, since the code is only stored at the end of the\\n // constructor execution.\\n\\n uint256 size;\\n // solhint-disable-next-line no-inline-assembly\\n assembly { size := extcodesize(account) }\\n return size > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls, avoid-call-value\\n (bool success, ) = recipient.call{ value: amount }(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain`call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.call{ value: value }(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x28911e614500ae7c607a432a709d35da25f3bc5ddc8bd12b278b66358070c0ea\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/*\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with GSN meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address payable) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes memory) {\\n this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0x8d3cb350f04ff49cfb10aef08d87f19dcbaecc8027b0bed12f3275cd12f38cf0\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Create2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Helper to make usage of the `CREATE2` EVM opcode easier and safer.\\n * `CREATE2` can be used to compute in advance the address where a smart\\n * contract will be deployed, which allows for interesting new mechanisms known\\n * as 'counterfactual interactions'.\\n *\\n * See the https://eips.ethereum.org/EIPS/eip-1014#motivation[EIP] for more\\n * information.\\n */\\nlibrary Create2 {\\n /**\\n * @dev Deploys a contract using `CREATE2`. The address where the contract\\n * will be deployed can be known in advance via {computeAddress}.\\n *\\n * The bytecode for a contract can be obtained from Solidity with\\n * `type(contractName).creationCode`.\\n *\\n * Requirements:\\n *\\n * - `bytecode` must not be empty.\\n * - `salt` must have not been used for `bytecode` already.\\n * - the factory must have a balance of at least `amount`.\\n * - if `amount` is non-zero, `bytecode` must have a `payable` constructor.\\n */\\n function deploy(uint256 amount, bytes32 salt, bytes memory bytecode) internal returns (address) {\\n address addr;\\n require(address(this).balance >= amount, \\\"Create2: insufficient balance\\\");\\n require(bytecode.length != 0, \\\"Create2: bytecode length is zero\\\");\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n addr := create2(amount, add(bytecode, 0x20), mload(bytecode), salt)\\n }\\n require(addr != address(0), \\\"Create2: Failed on deploy\\\");\\n return addr;\\n }\\n\\n /**\\n * @dev Returns the address where a contract will be stored if deployed via {deploy}. Any change in the\\n * `bytecodeHash` or `salt` will result in a new destination address.\\n */\\n function computeAddress(bytes32 salt, bytes32 bytecodeHash) internal view returns (address) {\\n return computeAddress(salt, bytecodeHash, address(this));\\n }\\n\\n /**\\n * @dev Returns the address where a contract will be stored if deployed via {deploy} from a contract located at\\n * `deployer`. If `deployer` is this contract's address, returns the same value as {computeAddress}.\\n */\\n function computeAddress(bytes32 salt, bytes32 bytecodeHash, address deployer) internal pure returns (address) {\\n bytes32 _data = keccak256(\\n abi.encodePacked(bytes1(0xff), deployer, salt, bytecodeHash)\\n );\\n return address(uint160(uint256(_data)));\\n }\\n}\\n\",\"keccak256\":\"0x0a0b021149946014fe1cd04af11e7a937a29986c47e8b1b718c2d50d729472db\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/EnumerableSet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Library for managing\\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\\n * types.\\n *\\n * Sets have the following properties:\\n *\\n * - Elements are added, removed, and checked for existence in constant time\\n * (O(1)).\\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\\n *\\n * ```\\n * contract Example {\\n * // Add the library methods\\n * using EnumerableSet for EnumerableSet.AddressSet;\\n *\\n * // Declare a set state variable\\n * EnumerableSet.AddressSet private mySet;\\n * }\\n * ```\\n *\\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\\n * and `uint256` (`UintSet`) are supported.\\n */\\nlibrary EnumerableSet {\\n // To implement this library for multiple types with as little code\\n // repetition as possible, we write it in terms of a generic Set type with\\n // bytes32 values.\\n // The Set implementation uses private functions, and user-facing\\n // implementations (such as AddressSet) are just wrappers around the\\n // underlying Set.\\n // This means that we can only create new EnumerableSets for types that fit\\n // in bytes32.\\n\\n struct Set {\\n // Storage of set values\\n bytes32[] _values;\\n\\n // Position of the value in the `values` array, plus 1 because index 0\\n // means a value is not in the set.\\n mapping (bytes32 => uint256) _indexes;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function _add(Set storage set, bytes32 value) private returns (bool) {\\n if (!_contains(set, value)) {\\n set._values.push(value);\\n // The value is stored at length-1, but we add 1 to all indexes\\n // and use 0 as a sentinel value\\n set._indexes[value] = set._values.length;\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function _remove(Set storage set, bytes32 value) private returns (bool) {\\n // We read and store the value's index to prevent multiple reads from the same storage slot\\n uint256 valueIndex = set._indexes[value];\\n\\n if (valueIndex != 0) { // Equivalent to contains(set, value)\\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\\n // the array, and then remove the last element (sometimes called as 'swap and pop').\\n // This modifies the order of the array, as noted in {at}.\\n\\n uint256 toDeleteIndex = valueIndex - 1;\\n uint256 lastIndex = set._values.length - 1;\\n\\n // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs\\n // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.\\n\\n bytes32 lastvalue = set._values[lastIndex];\\n\\n // Move the last value to the index where the value to delete is\\n set._values[toDeleteIndex] = lastvalue;\\n // Update the index for the moved value\\n set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based\\n\\n // Delete the slot where the moved value was stored\\n set._values.pop();\\n\\n // Delete the index for the deleted slot\\n delete set._indexes[value];\\n\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\\n return set._indexes[value] != 0;\\n }\\n\\n /**\\n * @dev Returns the number of values on the set. O(1).\\n */\\n function _length(Set storage set) private view returns (uint256) {\\n return set._values.length;\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\\n require(set._values.length > index, \\\"EnumerableSet: index out of bounds\\\");\\n return set._values[index];\\n }\\n\\n // Bytes32Set\\n\\n struct Bytes32Set {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _add(set._inner, value);\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _remove(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\\n return _contains(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(Bytes32Set storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\\n return _at(set._inner, index);\\n }\\n\\n // AddressSet\\n\\n struct AddressSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(AddressSet storage set, address value) internal returns (bool) {\\n return _add(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(AddressSet storage set, address value) internal returns (bool) {\\n return _remove(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(AddressSet storage set, address value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(AddressSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\\n return address(uint160(uint256(_at(set._inner, index))));\\n }\\n\\n\\n // UintSet\\n\\n struct UintSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(UintSet storage set, uint256 value) internal returns (bool) {\\n return _add(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\\n return _remove(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns the number of values on the set. O(1).\\n */\\n function length(UintSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\\n return uint256(_at(set._inner, index));\\n }\\n}\\n\",\"keccak256\":\"0x1562cd9922fbf739edfb979f506809e2743789cbde3177515542161c3d04b164\",\"license\":\"MIT\"},\"contracts/GraphTokenLock.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nimport \\\"@openzeppelin/contracts/math/SafeMath.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\\\";\\n\\nimport { Ownable as OwnableInitializable } from \\\"./Ownable.sol\\\";\\nimport \\\"./MathUtils.sol\\\";\\nimport \\\"./IGraphTokenLock.sol\\\";\\n\\n/**\\n * @title GraphTokenLock\\n * @notice Contract that manages an unlocking schedule of tokens.\\n * @dev The contract lock manage a number of tokens deposited into the contract to ensure that\\n * they can only be released under certain time conditions.\\n *\\n * This contract implements a release scheduled based on periods and tokens are released in steps\\n * after each period ends. It can be configured with one period in which case it is like a plain TimeLock.\\n * It also supports revocation to be used for vesting schedules.\\n *\\n * The contract supports receiving extra funds than the managed tokens ones that can be\\n * withdrawn by the beneficiary at any time.\\n *\\n * A releaseStartTime parameter is included to override the default release schedule and\\n * perform the first release on the configured time. After that it will continue with the\\n * default schedule.\\n */\\nabstract contract GraphTokenLock is OwnableInitializable, IGraphTokenLock {\\n using SafeMath for uint256;\\n using SafeERC20 for IERC20;\\n\\n uint256 private constant MIN_PERIOD = 1;\\n\\n // -- State --\\n\\n IERC20 public token;\\n address public beneficiary;\\n\\n // Configuration\\n\\n // Amount of tokens managed by the contract schedule\\n uint256 public managedAmount;\\n\\n uint256 public startTime; // Start datetime (in unixtimestamp)\\n uint256 public endTime; // Datetime after all funds are fully vested/unlocked (in unixtimestamp)\\n uint256 public periods; // Number of vesting/release periods\\n\\n // First release date for tokens (in unixtimestamp)\\n // If set, no tokens will be released before releaseStartTime ignoring\\n // the amount to release each period\\n uint256 public releaseStartTime;\\n // A cliff set a date to which a beneficiary needs to get to vest\\n // all preceding periods\\n uint256 public vestingCliffTime;\\n Revocability public revocable; // Whether to use vesting for locked funds\\n\\n // State\\n\\n bool public isRevoked;\\n bool public isInitialized;\\n bool public isAccepted;\\n uint256 public releasedAmount;\\n uint256 public revokedAmount;\\n\\n // -- Events --\\n\\n event TokensReleased(address indexed beneficiary, uint256 amount);\\n event TokensWithdrawn(address indexed beneficiary, uint256 amount);\\n event TokensRevoked(address indexed beneficiary, uint256 amount);\\n event BeneficiaryChanged(address newBeneficiary);\\n event LockAccepted();\\n event LockCanceled();\\n\\n /**\\n * @dev Only allow calls from the beneficiary of the contract\\n */\\n modifier onlyBeneficiary() {\\n require(msg.sender == beneficiary, \\\"!auth\\\");\\n _;\\n }\\n\\n /**\\n * @notice Initializes the contract\\n * @param _owner Address of the contract owner\\n * @param _beneficiary Address of the beneficiary of locked tokens\\n * @param _managedAmount Amount of tokens to be managed by the lock contract\\n * @param _startTime Start time of the release schedule\\n * @param _endTime End time of the release schedule\\n * @param _periods Number of periods between start time and end time\\n * @param _releaseStartTime Override time for when the releases start\\n * @param _vestingCliffTime Override time for when the vesting start\\n * @param _revocable Whether the contract is revocable\\n */\\n function _initialize(\\n address _owner,\\n address _beneficiary,\\n address _token,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n Revocability _revocable\\n ) internal {\\n require(!isInitialized, \\\"Already initialized\\\");\\n require(_owner != address(0), \\\"Owner cannot be zero\\\");\\n require(_beneficiary != address(0), \\\"Beneficiary cannot be zero\\\");\\n require(_token != address(0), \\\"Token cannot be zero\\\");\\n require(_managedAmount > 0, \\\"Managed tokens cannot be zero\\\");\\n require(_startTime != 0, \\\"Start time must be set\\\");\\n require(_startTime < _endTime, \\\"Start time > end time\\\");\\n require(_periods >= MIN_PERIOD, \\\"Periods cannot be below minimum\\\");\\n require(_revocable != Revocability.NotSet, \\\"Must set a revocability option\\\");\\n require(_releaseStartTime < _endTime, \\\"Release start time must be before end time\\\");\\n require(_vestingCliffTime < _endTime, \\\"Cliff time must be before end time\\\");\\n\\n isInitialized = true;\\n\\n OwnableInitializable._initialize(_owner);\\n beneficiary = _beneficiary;\\n token = IERC20(_token);\\n\\n managedAmount = _managedAmount;\\n\\n startTime = _startTime;\\n endTime = _endTime;\\n periods = _periods;\\n\\n // Optionals\\n releaseStartTime = _releaseStartTime;\\n vestingCliffTime = _vestingCliffTime;\\n revocable = _revocable;\\n }\\n\\n /**\\n * @notice Change the beneficiary of funds managed by the contract\\n * @dev Can only be called by the beneficiary\\n * @param _newBeneficiary Address of the new beneficiary address\\n */\\n function changeBeneficiary(address _newBeneficiary) external onlyBeneficiary {\\n require(_newBeneficiary != address(0), \\\"Empty beneficiary\\\");\\n beneficiary = _newBeneficiary;\\n emit BeneficiaryChanged(_newBeneficiary);\\n }\\n\\n /**\\n * @notice Beneficiary accepts the lock, the owner cannot retrieve back the tokens\\n * @dev Can only be called by the beneficiary\\n */\\n function acceptLock() external onlyBeneficiary {\\n isAccepted = true;\\n emit LockAccepted();\\n }\\n\\n /**\\n * @notice Owner cancel the lock and return the balance in the contract\\n * @dev Can only be called by the owner\\n */\\n function cancelLock() external onlyOwner {\\n require(isAccepted == false, \\\"Cannot cancel accepted contract\\\");\\n\\n token.safeTransfer(owner(), currentBalance());\\n\\n emit LockCanceled();\\n }\\n\\n // -- Balances --\\n\\n /**\\n * @notice Returns the amount of tokens currently held by the contract\\n * @return Tokens held in the contract\\n */\\n function currentBalance() public view override returns (uint256) {\\n return token.balanceOf(address(this));\\n }\\n\\n // -- Time & Periods --\\n\\n /**\\n * @notice Returns the current block timestamp\\n * @return Current block timestamp\\n */\\n function currentTime() public view override returns (uint256) {\\n return block.timestamp;\\n }\\n\\n /**\\n * @notice Gets duration of contract from start to end in seconds\\n * @return Amount of seconds from contract startTime to endTime\\n */\\n function duration() public view override returns (uint256) {\\n return endTime.sub(startTime);\\n }\\n\\n /**\\n * @notice Gets time elapsed since the start of the contract\\n * @dev Returns zero if called before conctract starTime\\n * @return Seconds elapsed from contract startTime\\n */\\n function sinceStartTime() public view override returns (uint256) {\\n uint256 current = currentTime();\\n if (current <= startTime) {\\n return 0;\\n }\\n return current.sub(startTime);\\n }\\n\\n /**\\n * @notice Returns amount available to be released after each period according to schedule\\n * @return Amount of tokens available after each period\\n */\\n function amountPerPeriod() public view override returns (uint256) {\\n return managedAmount.div(periods);\\n }\\n\\n /**\\n * @notice Returns the duration of each period in seconds\\n * @return Duration of each period in seconds\\n */\\n function periodDuration() public view override returns (uint256) {\\n return duration().div(periods);\\n }\\n\\n /**\\n * @notice Gets the current period based on the schedule\\n * @return A number that represents the current period\\n */\\n function currentPeriod() public view override returns (uint256) {\\n return sinceStartTime().div(periodDuration()).add(MIN_PERIOD);\\n }\\n\\n /**\\n * @notice Gets the number of periods that passed since the first period\\n * @return A number of periods that passed since the schedule started\\n */\\n function passedPeriods() public view override returns (uint256) {\\n return currentPeriod().sub(MIN_PERIOD);\\n }\\n\\n // -- Locking & Release Schedule --\\n\\n /**\\n * @notice Gets the currently available token according to the schedule\\n * @dev Implements the step-by-step schedule based on periods for available tokens\\n * @return Amount of tokens available according to the schedule\\n */\\n function availableAmount() public view override returns (uint256) {\\n uint256 current = currentTime();\\n\\n // Before contract start no funds are available\\n if (current < startTime) {\\n return 0;\\n }\\n\\n // After contract ended all funds are available\\n if (current > endTime) {\\n return managedAmount;\\n }\\n\\n // Get available amount based on period\\n return passedPeriods().mul(amountPerPeriod());\\n }\\n\\n /**\\n * @notice Gets the amount of currently vested tokens\\n * @dev Similar to available amount, but is fully vested when contract is non-revocable\\n * @return Amount of tokens already vested\\n */\\n function vestedAmount() public view override returns (uint256) {\\n // If non-revocable it is fully vested\\n if (revocable == Revocability.Disabled) {\\n return managedAmount;\\n }\\n\\n // Vesting cliff is activated and it has not passed means nothing is vested yet\\n if (vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\\n return 0;\\n }\\n\\n return availableAmount();\\n }\\n\\n /**\\n * @notice Gets tokens currently available for release\\n * @dev Considers the schedule and takes into account already released tokens\\n * @return Amount of tokens ready to be released\\n */\\n function releasableAmount() public view virtual override returns (uint256) {\\n // If a release start time is set no tokens are available for release before this date\\n // If not set it follows the default schedule and tokens are available on\\n // the first period passed\\n if (releaseStartTime > 0 && currentTime() < releaseStartTime) {\\n return 0;\\n }\\n\\n // Vesting cliff is activated and it has not passed means nothing is vested yet\\n // so funds cannot be released\\n if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\\n return 0;\\n }\\n\\n // A beneficiary can never have more releasable tokens than the contract balance\\n uint256 releasable = availableAmount().sub(releasedAmount);\\n return MathUtils.min(currentBalance(), releasable);\\n }\\n\\n /**\\n * @notice Gets the outstanding amount yet to be released based on the whole contract lifetime\\n * @dev Does not consider schedule but just global amounts tracked\\n * @return Amount of outstanding tokens for the lifetime of the contract\\n */\\n function totalOutstandingAmount() public view override returns (uint256) {\\n return managedAmount.sub(releasedAmount).sub(revokedAmount);\\n }\\n\\n /**\\n * @notice Gets surplus amount in the contract based on outstanding amount to release\\n * @dev All funds over outstanding amount is considered surplus that can be withdrawn by beneficiary.\\n * Note this might not be the correct value for wallets transferred to L2 (i.e. an L2GraphTokenLockWallet), as the released amount will be\\n * skewed, so the beneficiary might have to bridge back to L1 to release the surplus.\\n * @return Amount of tokens considered as surplus\\n */\\n function surplusAmount() public view override returns (uint256) {\\n uint256 balance = currentBalance();\\n uint256 outstandingAmount = totalOutstandingAmount();\\n if (balance > outstandingAmount) {\\n return balance.sub(outstandingAmount);\\n }\\n return 0;\\n }\\n\\n // -- Value Transfer --\\n\\n /**\\n * @notice Releases tokens based on the configured schedule\\n * @dev All available releasable tokens are transferred to beneficiary\\n */\\n function release() external override onlyBeneficiary {\\n uint256 amountToRelease = releasableAmount();\\n require(amountToRelease > 0, \\\"No available releasable amount\\\");\\n\\n releasedAmount = releasedAmount.add(amountToRelease);\\n\\n token.safeTransfer(beneficiary, amountToRelease);\\n\\n emit TokensReleased(beneficiary, amountToRelease);\\n }\\n\\n /**\\n * @notice Withdraws surplus, unmanaged tokens from the contract\\n * @dev Tokens in the contract over outstanding amount are considered as surplus\\n * @param _amount Amount of tokens to withdraw\\n */\\n function withdrawSurplus(uint256 _amount) external override onlyBeneficiary {\\n require(_amount > 0, \\\"Amount cannot be zero\\\");\\n require(surplusAmount() >= _amount, \\\"Amount requested > surplus available\\\");\\n\\n token.safeTransfer(beneficiary, _amount);\\n\\n emit TokensWithdrawn(beneficiary, _amount);\\n }\\n\\n /**\\n * @notice Revokes a vesting schedule and return the unvested tokens to the owner\\n * @dev Vesting schedule is always calculated based on managed tokens\\n */\\n function revoke() external override onlyOwner {\\n require(revocable == Revocability.Enabled, \\\"Contract is non-revocable\\\");\\n require(isRevoked == false, \\\"Already revoked\\\");\\n\\n uint256 unvestedAmount = managedAmount.sub(vestedAmount());\\n require(unvestedAmount > 0, \\\"No available unvested amount\\\");\\n\\n revokedAmount = unvestedAmount;\\n isRevoked = true;\\n\\n token.safeTransfer(owner(), unvestedAmount);\\n\\n emit TokensRevoked(beneficiary, unvestedAmount);\\n }\\n}\\n\",\"keccak256\":\"0xd89470956a476c2fcf4a09625775573f95ba2c60a57fe866d90f65de1bcf5f2d\",\"license\":\"MIT\"},\"contracts/GraphTokenLockManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/EnumerableSet.sol\\\";\\nimport { Ownable } from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\n\\nimport \\\"./MinimalProxyFactory.sol\\\";\\nimport \\\"./IGraphTokenLockManager.sol\\\";\\nimport { GraphTokenLockWallet } from \\\"./GraphTokenLockWallet.sol\\\";\\n\\n/**\\n * @title GraphTokenLockManager\\n * @notice This contract manages a list of authorized function calls and targets that can be called\\n * by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts.\\n *\\n * This contract receives funds to make the process of creating TokenLockWallet contracts\\n * easier by distributing them the initial tokens to be managed.\\n *\\n * The owner can setup a list of token destinations that will be used by TokenLock contracts to\\n * approve the pulling of funds, this way in can be guaranteed that only protocol contracts\\n * will manipulate users funds.\\n */\\ncontract GraphTokenLockManager is Ownable, MinimalProxyFactory, IGraphTokenLockManager {\\n using SafeERC20 for IERC20;\\n using EnumerableSet for EnumerableSet.AddressSet;\\n\\n // -- State --\\n\\n mapping(bytes4 => address) public authFnCalls;\\n EnumerableSet.AddressSet private _tokenDestinations;\\n\\n address public masterCopy;\\n IERC20 internal _token;\\n\\n // -- Events --\\n\\n event MasterCopyUpdated(address indexed masterCopy);\\n event TokenLockCreated(\\n address indexed contractAddress,\\n bytes32 indexed initHash,\\n address indexed beneficiary,\\n address token,\\n uint256 managedAmount,\\n uint256 startTime,\\n uint256 endTime,\\n uint256 periods,\\n uint256 releaseStartTime,\\n uint256 vestingCliffTime,\\n IGraphTokenLock.Revocability revocable\\n );\\n\\n event TokensDeposited(address indexed sender, uint256 amount);\\n event TokensWithdrawn(address indexed sender, uint256 amount);\\n\\n event FunctionCallAuth(address indexed caller, bytes4 indexed sigHash, address indexed target, string signature);\\n event TokenDestinationAllowed(address indexed dst, bool allowed);\\n\\n /**\\n * Constructor.\\n * @param _graphToken Token to use for deposits and withdrawals\\n * @param _masterCopy Address of the master copy to use to clone proxies\\n */\\n constructor(IERC20 _graphToken, address _masterCopy) {\\n require(address(_graphToken) != address(0), \\\"Token cannot be zero\\\");\\n _token = _graphToken;\\n setMasterCopy(_masterCopy);\\n }\\n\\n // -- Factory --\\n\\n /**\\n * @notice Sets the masterCopy bytecode to use to create clones of TokenLock contracts\\n * @param _masterCopy Address of contract bytecode to factory clone\\n */\\n function setMasterCopy(address _masterCopy) public override onlyOwner {\\n require(_masterCopy != address(0), \\\"MasterCopy cannot be zero\\\");\\n masterCopy = _masterCopy;\\n emit MasterCopyUpdated(_masterCopy);\\n }\\n\\n /**\\n * @notice Creates and fund a new token lock wallet using a minimum proxy\\n * @param _owner Address of the contract owner\\n * @param _beneficiary Address of the beneficiary of locked tokens\\n * @param _managedAmount Amount of tokens to be managed by the lock contract\\n * @param _startTime Start time of the release schedule\\n * @param _endTime End time of the release schedule\\n * @param _periods Number of periods between start time and end time\\n * @param _releaseStartTime Override time for when the releases start\\n * @param _revocable Whether the contract is revocable\\n */\\n function createTokenLockWallet(\\n address _owner,\\n address _beneficiary,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n IGraphTokenLock.Revocability _revocable\\n ) external override onlyOwner {\\n require(_token.balanceOf(address(this)) >= _managedAmount, \\\"Not enough tokens to create lock\\\");\\n\\n // Create contract using a minimal proxy and call initializer\\n bytes memory initializer = abi.encodeWithSelector(\\n GraphTokenLockWallet.initialize.selector,\\n address(this),\\n _owner,\\n _beneficiary,\\n address(_token),\\n _managedAmount,\\n _startTime,\\n _endTime,\\n _periods,\\n _releaseStartTime,\\n _vestingCliffTime,\\n _revocable\\n );\\n address contractAddress = _deployProxy2(keccak256(initializer), masterCopy, initializer);\\n\\n // Send managed amount to the created contract\\n _token.safeTransfer(contractAddress, _managedAmount);\\n\\n emit TokenLockCreated(\\n contractAddress,\\n keccak256(initializer),\\n _beneficiary,\\n address(_token),\\n _managedAmount,\\n _startTime,\\n _endTime,\\n _periods,\\n _releaseStartTime,\\n _vestingCliffTime,\\n _revocable\\n );\\n }\\n\\n // -- Funds Management --\\n\\n /**\\n * @notice Gets the GRT token address\\n * @return Token used for transfers and approvals\\n */\\n function token() external view override returns (IERC20) {\\n return _token;\\n }\\n\\n /**\\n * @notice Deposits tokens into the contract\\n * @dev Even if the ERC20 token can be transferred directly to the contract\\n * this function provide a safe interface to do the transfer and avoid mistakes\\n * @param _amount Amount to deposit\\n */\\n function deposit(uint256 _amount) external override {\\n require(_amount > 0, \\\"Amount cannot be zero\\\");\\n _token.safeTransferFrom(msg.sender, address(this), _amount);\\n emit TokensDeposited(msg.sender, _amount);\\n }\\n\\n /**\\n * @notice Withdraws tokens from the contract\\n * @dev Escape hatch in case of mistakes or to recover remaining funds\\n * @param _amount Amount of tokens to withdraw\\n */\\n function withdraw(uint256 _amount) external override onlyOwner {\\n require(_amount > 0, \\\"Amount cannot be zero\\\");\\n _token.safeTransfer(msg.sender, _amount);\\n emit TokensWithdrawn(msg.sender, _amount);\\n }\\n\\n // -- Token Destinations --\\n\\n /**\\n * @notice Adds an address that can be allowed by a token lock to pull funds\\n * @param _dst Destination address\\n */\\n function addTokenDestination(address _dst) external override onlyOwner {\\n require(_dst != address(0), \\\"Destination cannot be zero\\\");\\n require(_tokenDestinations.add(_dst), \\\"Destination already added\\\");\\n emit TokenDestinationAllowed(_dst, true);\\n }\\n\\n /**\\n * @notice Removes an address that can be allowed by a token lock to pull funds\\n * @param _dst Destination address\\n */\\n function removeTokenDestination(address _dst) external override onlyOwner {\\n require(_tokenDestinations.remove(_dst), \\\"Destination already removed\\\");\\n emit TokenDestinationAllowed(_dst, false);\\n }\\n\\n /**\\n * @notice Returns True if the address is authorized to be a destination of tokens\\n * @param _dst Destination address\\n * @return True if authorized\\n */\\n function isTokenDestination(address _dst) external view override returns (bool) {\\n return _tokenDestinations.contains(_dst);\\n }\\n\\n /**\\n * @notice Returns an array of authorized destination addresses\\n * @return Array of addresses authorized to pull funds from a token lock\\n */\\n function getTokenDestinations() external view override returns (address[] memory) {\\n address[] memory dstList = new address[](_tokenDestinations.length());\\n for (uint256 i = 0; i < _tokenDestinations.length(); i++) {\\n dstList[i] = _tokenDestinations.at(i);\\n }\\n return dstList;\\n }\\n\\n // -- Function Call Authorization --\\n\\n /**\\n * @notice Sets an authorized function call to target\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @param _signature Function signature\\n * @param _target Address of the destination contract to call\\n */\\n function setAuthFunctionCall(string calldata _signature, address _target) external override onlyOwner {\\n _setAuthFunctionCall(_signature, _target);\\n }\\n\\n /**\\n * @notice Unsets an authorized function call to target\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @param _signature Function signature\\n */\\n function unsetAuthFunctionCall(string calldata _signature) external override onlyOwner {\\n bytes4 sigHash = _toFunctionSigHash(_signature);\\n authFnCalls[sigHash] = address(0);\\n\\n emit FunctionCallAuth(msg.sender, sigHash, address(0), _signature);\\n }\\n\\n /**\\n * @notice Sets an authorized function call to target in bulk\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @param _signatures Function signatures\\n * @param _targets Address of the destination contract to call\\n */\\n function setAuthFunctionCallMany(\\n string[] calldata _signatures,\\n address[] calldata _targets\\n ) external override onlyOwner {\\n require(_signatures.length == _targets.length, \\\"Array length mismatch\\\");\\n\\n for (uint256 i = 0; i < _signatures.length; i++) {\\n _setAuthFunctionCall(_signatures[i], _targets[i]);\\n }\\n }\\n\\n /**\\n * @notice Sets an authorized function call to target\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @dev Function signatures of Graph Protocol contracts to be used are known ahead of time\\n * @param _signature Function signature\\n * @param _target Address of the destination contract to call\\n */\\n function _setAuthFunctionCall(string calldata _signature, address _target) internal {\\n require(_target != address(this), \\\"Target must be other contract\\\");\\n require(Address.isContract(_target), \\\"Target must be a contract\\\");\\n\\n bytes4 sigHash = _toFunctionSigHash(_signature);\\n authFnCalls[sigHash] = _target;\\n\\n emit FunctionCallAuth(msg.sender, sigHash, _target, _signature);\\n }\\n\\n /**\\n * @notice Gets the target contract to call for a particular function signature\\n * @param _sigHash Function signature hash\\n * @return Address of the target contract where to send the call\\n */\\n function getAuthFunctionCallTarget(bytes4 _sigHash) public view override returns (address) {\\n return authFnCalls[_sigHash];\\n }\\n\\n /**\\n * @notice Returns true if the function call is authorized\\n * @param _sigHash Function signature hash\\n * @return True if authorized\\n */\\n function isAuthFunctionCall(bytes4 _sigHash) external view override returns (bool) {\\n return getAuthFunctionCallTarget(_sigHash) != address(0);\\n }\\n\\n /**\\n * @dev Converts a function signature string to 4-bytes hash\\n * @param _signature Function signature string\\n * @return Function signature hash\\n */\\n function _toFunctionSigHash(string calldata _signature) internal pure returns (bytes4) {\\n return _convertToBytes4(abi.encodeWithSignature(_signature));\\n }\\n\\n /**\\n * @dev Converts function signature bytes to function signature hash (bytes4)\\n * @param _signature Function signature\\n * @return Function signature in bytes4\\n */\\n function _convertToBytes4(bytes memory _signature) internal pure returns (bytes4) {\\n require(_signature.length == 4, \\\"Invalid method signature\\\");\\n bytes4 sigHash;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n sigHash := mload(add(_signature, 32))\\n }\\n return sigHash;\\n }\\n}\\n\",\"keccak256\":\"0x2bb51cc1a18bd88113fd6947067ad2fff33048c8904cb54adfda8e2ab86752f2\",\"license\":\"MIT\"},\"contracts/GraphTokenLockWallet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"@openzeppelin/contracts/math/SafeMath.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nimport \\\"./GraphTokenLock.sol\\\";\\nimport \\\"./IGraphTokenLockManager.sol\\\";\\n\\n/**\\n * @title GraphTokenLockWallet\\n * @notice This contract is built on top of the base GraphTokenLock functionality.\\n * It allows wallet beneficiaries to use the deposited funds to perform specific function calls\\n * on specific contracts.\\n *\\n * The idea is that supporters with locked tokens can participate in the protocol\\n * but disallow any release before the vesting/lock schedule.\\n * The beneficiary can issue authorized function calls to this contract that will\\n * get forwarded to a target contract. A target contract is any of our protocol contracts.\\n * The function calls allowed are queried to the GraphTokenLockManager, this way\\n * the same configuration can be shared for all the created lock wallet contracts.\\n *\\n * NOTE: Contracts used as target must have its function signatures checked to avoid collisions\\n * with any of this contract functions.\\n * Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience\\n * the maximum amount of tokens is authorized.\\n * Function calls do not forward ETH value so DO NOT SEND ETH TO THIS CONTRACT.\\n */\\ncontract GraphTokenLockWallet is GraphTokenLock {\\n using SafeMath for uint256;\\n\\n // -- State --\\n\\n IGraphTokenLockManager public manager;\\n uint256 public usedAmount;\\n\\n // -- Events --\\n\\n event ManagerUpdated(address indexed _oldManager, address indexed _newManager);\\n event TokenDestinationsApproved();\\n event TokenDestinationsRevoked();\\n\\n // Initializer\\n function initialize(\\n address _manager,\\n address _owner,\\n address _beneficiary,\\n address _token,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n Revocability _revocable\\n ) external {\\n _initialize(\\n _owner,\\n _beneficiary,\\n _token,\\n _managedAmount,\\n _startTime,\\n _endTime,\\n _periods,\\n _releaseStartTime,\\n _vestingCliffTime,\\n _revocable\\n );\\n _setManager(_manager);\\n }\\n\\n // -- Admin --\\n\\n /**\\n * @notice Sets a new manager for this contract\\n * @param _newManager Address of the new manager\\n */\\n function setManager(address _newManager) external onlyOwner {\\n _setManager(_newManager);\\n }\\n\\n /**\\n * @dev Sets a new manager for this contract\\n * @param _newManager Address of the new manager\\n */\\n function _setManager(address _newManager) internal {\\n require(_newManager != address(0), \\\"Manager cannot be empty\\\");\\n require(Address.isContract(_newManager), \\\"Manager must be a contract\\\");\\n\\n address oldManager = address(manager);\\n manager = IGraphTokenLockManager(_newManager);\\n\\n emit ManagerUpdated(oldManager, _newManager);\\n }\\n\\n // -- Beneficiary --\\n\\n /**\\n * @notice Approves protocol access of the tokens managed by this contract\\n * @dev Approves all token destinations registered in the manager to pull tokens\\n */\\n function approveProtocol() external onlyBeneficiary {\\n address[] memory dstList = manager.getTokenDestinations();\\n for (uint256 i = 0; i < dstList.length; i++) {\\n // Note this is only safe because we are using the max uint256 value\\n token.approve(dstList[i], type(uint256).max);\\n }\\n emit TokenDestinationsApproved();\\n }\\n\\n /**\\n * @notice Revokes protocol access of the tokens managed by this contract\\n * @dev Revokes approval to all token destinations in the manager to pull tokens\\n */\\n function revokeProtocol() external onlyBeneficiary {\\n address[] memory dstList = manager.getTokenDestinations();\\n for (uint256 i = 0; i < dstList.length; i++) {\\n // Note this is only safe cause we're using 0 as the amount\\n token.approve(dstList[i], 0);\\n }\\n emit TokenDestinationsRevoked();\\n }\\n\\n /**\\n * @notice Gets tokens currently available for release\\n * @dev Considers the schedule, takes into account already released tokens and used amount\\n * @return Amount of tokens ready to be released\\n */\\n function releasableAmount() public view override returns (uint256) {\\n if (revocable == Revocability.Disabled) {\\n return super.releasableAmount();\\n }\\n\\n // -- Revocability enabled logic\\n // This needs to deal with additional considerations for when tokens are used in the protocol\\n\\n // If a release start time is set no tokens are available for release before this date\\n // If not set it follows the default schedule and tokens are available on\\n // the first period passed\\n if (releaseStartTime > 0 && currentTime() < releaseStartTime) {\\n return 0;\\n }\\n\\n // Vesting cliff is activated and it has not passed means nothing is vested yet\\n // so funds cannot be released\\n if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\\n return 0;\\n }\\n\\n // A beneficiary can never have more releasable tokens than the contract balance\\n // We consider the `usedAmount` in the protocol as part of the calculations\\n // the beneficiary should not release funds that are used.\\n uint256 releasable = availableAmount().sub(releasedAmount).sub(usedAmount);\\n return MathUtils.min(currentBalance(), releasable);\\n }\\n\\n /**\\n * @notice Forward authorized contract calls to protocol contracts\\n * @dev Fallback function can be called by the beneficiary only if function call is allowed\\n */\\n // solhint-disable-next-line no-complex-fallback\\n fallback() external payable {\\n // Only beneficiary can forward calls\\n require(msg.sender == beneficiary, \\\"Unauthorized caller\\\");\\n require(msg.value == 0, \\\"ETH transfers not supported\\\");\\n\\n // Function call validation\\n address _target = manager.getAuthFunctionCallTarget(msg.sig);\\n require(_target != address(0), \\\"Unauthorized function\\\");\\n\\n uint256 oldBalance = currentBalance();\\n\\n // Call function with data\\n Address.functionCall(_target, msg.data);\\n\\n // Tracked used tokens in the protocol\\n // We do this check after balances were updated by the forwarded call\\n // Check is only enforced for revocable contracts to save some gas\\n if (revocable == Revocability.Enabled) {\\n // Track contract balance change\\n uint256 newBalance = currentBalance();\\n if (newBalance < oldBalance) {\\n // Outflow\\n uint256 diff = oldBalance.sub(newBalance);\\n usedAmount = usedAmount.add(diff);\\n } else {\\n // Inflow: We can receive profits from the protocol, that could make usedAmount to\\n // underflow. We set it to zero in that case.\\n uint256 diff = newBalance.sub(oldBalance);\\n usedAmount = (diff >= usedAmount) ? 0 : usedAmount.sub(diff);\\n }\\n require(usedAmount <= vestedAmount(), \\\"Cannot use more tokens than vested amount\\\");\\n }\\n }\\n\\n /**\\n * @notice Receive function that always reverts.\\n * @dev Only included to supress warnings, see https://github.com/ethereum/solidity/issues/10159\\n */\\n receive() external payable {\\n revert(\\\"Bad call\\\");\\n }\\n}\\n\",\"keccak256\":\"0x976c2ba4c1503a81ea02bd84539c516e99af611ff767968ee25456b50a6deb7b\",\"license\":\"MIT\"},\"contracts/IGraphTokenLock.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\ninterface IGraphTokenLock {\\n enum Revocability {\\n NotSet,\\n Enabled,\\n Disabled\\n }\\n\\n // -- Balances --\\n\\n function currentBalance() external view returns (uint256);\\n\\n // -- Time & Periods --\\n\\n function currentTime() external view returns (uint256);\\n\\n function duration() external view returns (uint256);\\n\\n function sinceStartTime() external view returns (uint256);\\n\\n function amountPerPeriod() external view returns (uint256);\\n\\n function periodDuration() external view returns (uint256);\\n\\n function currentPeriod() external view returns (uint256);\\n\\n function passedPeriods() external view returns (uint256);\\n\\n // -- Locking & Release Schedule --\\n\\n function availableAmount() external view returns (uint256);\\n\\n function vestedAmount() external view returns (uint256);\\n\\n function releasableAmount() external view returns (uint256);\\n\\n function totalOutstandingAmount() external view returns (uint256);\\n\\n function surplusAmount() external view returns (uint256);\\n\\n // -- Value Transfer --\\n\\n function release() external;\\n\\n function withdrawSurplus(uint256 _amount) external;\\n\\n function revoke() external;\\n}\\n\",\"keccak256\":\"0xceb9d258276fe25ec858191e1deae5778f1b2f612a669fb7b37bab1a064756ab\",\"license\":\"MIT\"},\"contracts/IGraphTokenLockManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nimport \\\"./IGraphTokenLock.sol\\\";\\n\\ninterface IGraphTokenLockManager {\\n // -- Factory --\\n\\n function setMasterCopy(address _masterCopy) external;\\n\\n function createTokenLockWallet(\\n address _owner,\\n address _beneficiary,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n IGraphTokenLock.Revocability _revocable\\n ) external;\\n\\n // -- Funds Management --\\n\\n function token() external returns (IERC20);\\n\\n function deposit(uint256 _amount) external;\\n\\n function withdraw(uint256 _amount) external;\\n\\n // -- Allowed Funds Destinations --\\n\\n function addTokenDestination(address _dst) external;\\n\\n function removeTokenDestination(address _dst) external;\\n\\n function isTokenDestination(address _dst) external view returns (bool);\\n\\n function getTokenDestinations() external view returns (address[] memory);\\n\\n // -- Function Call Authorization --\\n\\n function setAuthFunctionCall(string calldata _signature, address _target) external;\\n\\n function unsetAuthFunctionCall(string calldata _signature) external;\\n\\n function setAuthFunctionCallMany(string[] calldata _signatures, address[] calldata _targets) external;\\n\\n function getAuthFunctionCallTarget(bytes4 _sigHash) external view returns (address);\\n\\n function isAuthFunctionCall(bytes4 _sigHash) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x2d78d41909a6de5b316ac39b100ea087a8f317cf306379888a045523e15c4d9a\",\"license\":\"MIT\"},\"contracts/MathUtils.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nlibrary MathUtils {\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n}\\n\",\"keccak256\":\"0xe2512e1da48bc8363acd15f66229564b02d66706665d7da740604566913c1400\",\"license\":\"MIT\"},\"contracts/MinimalProxyFactory.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nimport { Address } from \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport { Create2 } from \\\"@openzeppelin/contracts/utils/Create2.sol\\\";\\n\\n/**\\n * @title MinimalProxyFactory: a factory contract for creating minimal proxies\\n * @notice Adapted from https://github.com/OpenZeppelin/openzeppelin-sdk/blob/v2.5.0/packages/lib/contracts/upgradeability/ProxyFactory.sol\\n * Based on https://eips.ethereum.org/EIPS/eip-1167\\n */\\ncontract MinimalProxyFactory {\\n /// @dev Emitted when a new proxy is created\\n event ProxyCreated(address indexed proxy);\\n\\n\\n /**\\n * @notice Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation\\n * @dev Uses address(this) as deployer to compute the address. Only for backwards compatibility.\\n * @param _salt Bytes32 salt to use for CREATE2\\n * @param _implementation Address of the proxy target implementation\\n * @return Address of the counterfactual MinimalProxy\\n */\\n function getDeploymentAddress(\\n bytes32 _salt,\\n address _implementation\\n ) public view returns (address) {\\n return getDeploymentAddress(_salt, _implementation, address(this));\\n }\\n\\n /**\\n * @notice Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation\\n * @param _salt Bytes32 salt to use for CREATE2\\n * @param _implementation Address of the proxy target implementation\\n * @param _deployer Address of the deployer that creates the contract\\n * @return Address of the counterfactual MinimalProxy\\n */\\n function getDeploymentAddress(\\n bytes32 _salt,\\n address _implementation,\\n address _deployer\\n ) public pure returns (address) {\\n return Create2.computeAddress(_salt, keccak256(_getContractCreationCode(_implementation)), _deployer);\\n }\\n\\n /**\\n * @dev Deploys a MinimalProxy with CREATE2\\n * @param _salt Bytes32 salt to use for CREATE2\\n * @param _implementation Address of the proxy target implementation\\n * @param _data Bytes with the initializer call\\n * @return Address of the deployed MinimalProxy\\n */\\n function _deployProxy2(bytes32 _salt, address _implementation, bytes memory _data) internal returns (address) {\\n address proxyAddress = Create2.deploy(0, _salt, _getContractCreationCode(_implementation));\\n\\n emit ProxyCreated(proxyAddress);\\n\\n // Call function with data\\n if (_data.length > 0) {\\n Address.functionCall(proxyAddress, _data);\\n }\\n\\n return proxyAddress;\\n }\\n\\n /**\\n * @dev Gets the MinimalProxy bytecode\\n * @param _implementation Address of the proxy target implementation\\n * @return MinimalProxy bytecode\\n */\\n function _getContractCreationCode(address _implementation) internal pure returns (bytes memory) {\\n bytes10 creation = 0x3d602d80600a3d3981f3;\\n bytes10 prefix = 0x363d3d373d3d3d363d73;\\n bytes20 targetBytes = bytes20(_implementation);\\n bytes15 suffix = 0x5af43d82803e903d91602b57fd5bf3;\\n return abi.encodePacked(creation, prefix, targetBytes, suffix);\\n }\\n}\\n\",\"keccak256\":\"0xc0ad119f676fe82b234fd5c830d9bc443e9038c0cfe5dc4de3a3bf621d3f69df\",\"license\":\"MIT\"},\"contracts/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * The owner account will be passed on initialization of the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\ncontract Ownable {\\n /// @dev Owner of the contract, can be retrieved with the public owner() function\\n address private _owner;\\n /// @dev Since upgradeable contracts might inherit this, we add a storage gap\\n /// to allow adding variables here without breaking the proxy storage layout\\n uint256[50] private __gap;\\n\\n /// @dev Emitted when ownership of the contract is transferred\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n function _initialize(address owner) internal {\\n _owner = owner;\\n emit OwnershipTransferred(address(0), owner);\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(_owner == msg.sender, \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() external virtual onlyOwner {\\n emit OwnershipTransferred(_owner, address(0));\\n _owner = address(0);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) external virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n emit OwnershipTransferred(_owner, newOwner);\\n _owner = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0xe8750687082e8e24b620dbf58c3a08eee591ed7b4d5a3e13cc93554ec647fd09\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60806040523480156200001157600080fd5b5060405162003d1b38038062003d1b83398181016040528101906200003791906200039c565b600062000049620001b460201b60201c565b9050806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a350600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156200015a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200015190620004e7565b60405180910390fd5b81600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550620001ac81620001bc60201b60201c565b505062000596565b600033905090565b620001cc620001b460201b60201c565b73ffffffffffffffffffffffffffffffffffffffff16620001f26200034560201b60201c565b73ffffffffffffffffffffffffffffffffffffffff16146200024b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200024290620004c5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415620002be576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620002b590620004a3565b60405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167f30909084afc859121ffc3a5aef7fe37c540a9a1ef60bd4d8dcdb76376fadf9de60405160405180910390a250565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000815190506200037f8162000562565b92915050565b60008151905062000396816200057c565b92915050565b60008060408385031215620003b057600080fd5b6000620003c08582860162000385565b9250506020620003d3858286016200036e565b9150509250929050565b6000620003ec60198362000509565b91507f4d6173746572436f70792063616e6e6f74206265207a65726f000000000000006000830152602082019050919050565b60006200042e60208362000509565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b60006200047060148362000509565b91507f546f6b656e2063616e6e6f74206265207a65726f0000000000000000000000006000830152602082019050919050565b60006020820190508181036000830152620004be81620003dd565b9050919050565b60006020820190508181036000830152620004e0816200041f565b9050919050565b60006020820190508181036000830152620005028162000461565b9050919050565b600082825260208201905092915050565b6000620005278262000542565b9050919050565b60006200053b826200051a565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6200056d816200051a565b81146200057957600080fd5b50565b62000587816200052e565b81146200059357600080fd5b50565b61377580620005a66000396000f3fe608060405234801561001057600080fd5b50600436106101375760003560e01c80638da5cb5b116100b8578063bdb62fbe1161007c578063bdb62fbe14610324578063c1ab13db14610354578063cf497e6c14610370578063f1d24c451461038c578063f2fde38b146103bc578063fc0c546a146103d857610137565b80638da5cb5b146102925780639c05fc60146102b0578063a3457466146102cc578063a619486e146102ea578063b6b55f251461030857610137565b80635975e00c116100ff5780635975e00c146101f057806368d30c2e1461020c5780636e03b8dc14610228578063715018a61461025857806379ee1bdf1461026257610137565b806303990a6c1461013c5780630602ba2b146101585780632e1a7d4d1461018857806343fb93d9146101a4578063463013a2146101d4575b600080fd5b610156600480360381019061015191906125c6565b6103f6565b005b610172600480360381019061016d919061259d565b61059e565b60405161017f91906130b5565b60405180910390f35b6101a2600480360381019061019d9190612663565b6105df565b005b6101be60048036038101906101b9919061254e565b61073c565b6040516101cb9190612eef565b60405180910390f35b6101ee60048036038101906101e9919061260b565b610761565b005b61020a60048036038101906102059190612385565b6107ed565b005b610226600480360381019061022191906123ae565b61097e565b005b610242600480360381019061023d919061259d565b610cc6565b60405161024f9190612eef565b60405180910390f35b610260610cf9565b005b61027c60048036038101906102779190612385565b610e33565b60405161028991906130b5565b60405180910390f35b61029a610e50565b6040516102a79190612eef565b60405180910390f35b6102ca60048036038101906102c59190612474565b610e79565b005b6102d4610fa6565b6040516102e19190613093565b60405180910390f35b6102f261107e565b6040516102ff9190612eef565b60405180910390f35b610322600480360381019061031d9190612663565b6110a4565b005b61033e60048036038101906103399190612512565b611187565b60405161034b9190612eef565b60405180910390f35b61036e60048036038101906103699190612385565b61119c565b005b61038a60048036038101906103859190612385565b6112bd565b005b6103a660048036038101906103a1919061259d565b611430565b6040516103b39190612eef565b60405180910390f35b6103d660048036038101906103d19190612385565b6114ab565b005b6103e0611654565b6040516103ed91906130d0565b60405180910390f35b6103fe61167e565b73ffffffffffffffffffffffffffffffffffffffff1661041c610e50565b73ffffffffffffffffffffffffffffffffffffffff1614610472576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610469906132b1565b60405180910390fd5b600061047e8383611686565b9050600060016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff16817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163373ffffffffffffffffffffffffffffffffffffffff167f450397a2db0e89eccfe664cc6cdfd274a88bc00d29aaec4d991754a42f19f8c986866040516105919291906130eb565b60405180910390a4505050565b60008073ffffffffffffffffffffffffffffffffffffffff166105c083611430565b73ffffffffffffffffffffffffffffffffffffffff1614159050919050565b6105e761167e565b73ffffffffffffffffffffffffffffffffffffffff16610605610e50565b73ffffffffffffffffffffffffffffffffffffffff161461065b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610652906132b1565b60405180910390fd5b6000811161069e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161069590613291565b60405180910390fd5b6106eb3382600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117149092919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b826040516107319190613391565b60405180910390a250565b60006107588461074b8561179a565b8051906020012084611810565b90509392505050565b61076961167e565b73ffffffffffffffffffffffffffffffffffffffff16610787610e50565b73ffffffffffffffffffffffffffffffffffffffff16146107dd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107d4906132b1565b60405180910390fd5b6107e8838383611854565b505050565b6107f561167e565b73ffffffffffffffffffffffffffffffffffffffff16610813610e50565b73ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610860906132b1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156108d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108d090613191565b60405180910390fd5b6108ed816002611a3690919063ffffffff16565b61092c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610923906132f1565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f33442b8c13e72dd75a027f08f9bff4eed2dfd26e43cdea857365f5163b359a79600160405161097391906130b5565b60405180910390a250565b61098661167e565b73ffffffffffffffffffffffffffffffffffffffff166109a4610e50565b73ffffffffffffffffffffffffffffffffffffffff16146109fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109f1906132b1565b60405180910390fd5b86600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610a569190612eef565b60206040518083038186803b158015610a6e57600080fd5b505afa158015610a82573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aa6919061268c565b1015610ae7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ade906131d1565b60405180910390fd5b606063bd896dcb60e01b308b8b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168c8c8c8c8c8c8c604051602401610b389b9a99989796959493929190612f0a565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505090506000610bcd8280519060200120600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611a66565b9050610c1c818a600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117149092919063ffffffff16565b8973ffffffffffffffffffffffffffffffffffffffff1682805190602001208273ffffffffffffffffffffffffffffffffffffffff167f3c7ff6acee351ed98200c285a04745858a107e16da2f13c3a81a43073c17d644600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168d8d8d8d8d8d8d604051610cb1989796959493929190613015565b60405180910390a45050505050505050505050565b60016020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610d0161167e565b73ffffffffffffffffffffffffffffffffffffffff16610d1f610e50565b73ffffffffffffffffffffffffffffffffffffffff1614610d75576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d6c906132b1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000610e49826002611ae290919063ffffffff16565b9050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610e8161167e565b73ffffffffffffffffffffffffffffffffffffffff16610e9f610e50565b73ffffffffffffffffffffffffffffffffffffffff1614610ef5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eec906132b1565b60405180910390fd5b818190508484905014610f3d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f3490613171565b60405180910390fd5b60005b84849050811015610f9f57610f92858583818110610f5a57fe5b9050602002810190610f6c91906133ac565b858585818110610f7857fe5b9050602002016020810190610f8d9190612385565b611854565b8080600101915050610f40565b5050505050565b606080610fb36002611b12565b67ffffffffffffffff81118015610fc957600080fd5b50604051908082528060200260200182016040528015610ff85781602001602082028036833780820191505090505b50905060005b6110086002611b12565b81101561107657611023816002611b2790919063ffffffff16565b82828151811061102f57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508080600101915050610ffe565b508091505090565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600081116110e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110de90613291565b60405180910390fd5b611136333083600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611b41909392919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f59062170a285eb80e8c6b8ced60428442a51910635005233fc4ce084a475845e8260405161117c9190613391565b60405180910390a250565b600061119483833061073c565b905092915050565b6111a461167e565b73ffffffffffffffffffffffffffffffffffffffff166111c2610e50565b73ffffffffffffffffffffffffffffffffffffffff1614611218576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161120f906132b1565b60405180910390fd5b61122c816002611bca90919063ffffffff16565b61126b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161126290613211565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f33442b8c13e72dd75a027f08f9bff4eed2dfd26e43cdea857365f5163b359a7960006040516112b291906130b5565b60405180910390a250565b6112c561167e565b73ffffffffffffffffffffffffffffffffffffffff166112e3610e50565b73ffffffffffffffffffffffffffffffffffffffff1614611339576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611330906132b1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156113a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113a090613231565b60405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167f30909084afc859121ffc3a5aef7fe37c540a9a1ef60bd4d8dcdb76376fadf9de60405160405180910390a250565b600060016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6114b361167e565b73ffffffffffffffffffffffffffffffffffffffff166114d1610e50565b73ffffffffffffffffffffffffffffffffffffffff1614611527576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161151e906132b1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e906131b1565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600033905090565b600061170c838360405160240160405160208183030381529060405291906040516116b2929190612ed6565b60405180910390207bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611bfa565b905092915050565b6117958363a9059cbb60e01b8484604051602401611733929190612fec565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611c52565b505050565b60606000693d602d80600a3d3981f360b01b9050600069363d3d373d3d3d363d7360b01b905060008460601b905060006e5af43d82803e903d91602b57fd5bf360881b9050838383836040516020016117f69493929190612e23565b604051602081830303815290604052945050505050919050565b60008060ff60f81b83868660405160200161182e9493929190612e71565b6040516020818303038152906040528051906020012090508060001c9150509392505050565b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156118c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118ba90613251565b60405180910390fd5b6118cc81611d19565b61190b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161190290613371565b60405180910390fd5b60006119178484611686565b90508160016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff16817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163373ffffffffffffffffffffffffffffffffffffffff167f450397a2db0e89eccfe664cc6cdfd274a88bc00d29aaec4d991754a42f19f8c98787604051611a289291906130eb565b60405180910390a450505050565b6000611a5e836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611d2c565b905092915050565b600080611a7d600086611a788761179a565b611d9c565b90508073ffffffffffffffffffffffffffffffffffffffff167efffc2da0b561cae30d9826d37709e9421c4725faebc226cbbb7ef5fc5e734960405160405180910390a2600083511115611ad757611ad58184611ead565b505b809150509392505050565b6000611b0a836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611ef7565b905092915050565b6000611b2082600001611f1a565b9050919050565b6000611b368360000183611f2b565b60001c905092915050565b611bc4846323b872dd60e01b858585604051602401611b6293929190612fb5565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611c52565b50505050565b6000611bf2836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611f98565b905092915050565b60006004825114611c40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c37906132d1565b60405180910390fd5b60006020830151905080915050919050565b6060611cb4826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166120809092919063ffffffff16565b9050600081511115611d145780806020019051810190611cd491906124e9565b611d13576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d0a90613331565b60405180910390fd5b5b505050565b600080823b905060008111915050919050565b6000611d388383611ef7565b611d91578260000182908060018154018082558091505060019003906000526020600020016000909190919091505582600001805490508360010160008481526020019081526020016000208190555060019050611d96565b600090505b92915050565b60008084471015611de2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd990613351565b60405180910390fd5b600083511415611e27576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e1e90613151565b60405180910390fd5b8383516020850187f59050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611ea2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e9990613271565b60405180910390fd5b809150509392505050565b6060611eef83836040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c65640000815250612080565b905092915050565b600080836001016000848152602001908152602001600020541415905092915050565b600081600001805490509050919050565b600081836000018054905011611f76576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f6d90613131565b60405180910390fd5b826000018281548110611f8557fe5b9060005260206000200154905092915050565b600080836001016000848152602001908152602001600020549050600081146120745760006001820390506000600186600001805490500390506000866000018281548110611fe357fe5b906000526020600020015490508087600001848154811061200057fe5b906000526020600020018190555060018301876001016000838152602001908152602001600020819055508660000180548061203857fe5b6001900381819060005260206000200160009055905586600101600087815260200190815260200160002060009055600194505050505061207a565b60009150505b92915050565b606061208f8484600085612098565b90509392505050565b6060824710156120dd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120d4906131f1565b60405180910390fd5b6120e685611d19565b612125576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161211c90613311565b60405180910390fd5b600060608673ffffffffffffffffffffffffffffffffffffffff16858760405161214f9190612ebf565b60006040518083038185875af1925050503d806000811461218c576040519150601f19603f3d011682016040523d82523d6000602084013e612191565b606091505b50915091506121a18282866121ad565b92505050949350505050565b606083156121bd5782905061220d565b6000835111156121d05782518084602001fd5b816040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612204919061310f565b60405180910390fd5b9392505050565b600081359050612223816136bc565b92915050565b60008083601f84011261223b57600080fd5b8235905067ffffffffffffffff81111561225457600080fd5b60208301915083602082028301111561226c57600080fd5b9250929050565b60008083601f84011261228557600080fd5b8235905067ffffffffffffffff81111561229e57600080fd5b6020830191508360208202830111156122b657600080fd5b9250929050565b6000815190506122cc816136d3565b92915050565b6000813590506122e1816136ea565b92915050565b6000813590506122f681613701565b92915050565b60008135905061230b81613718565b92915050565b60008083601f84011261232357600080fd5b8235905067ffffffffffffffff81111561233c57600080fd5b60208301915083600182028301111561235457600080fd5b9250929050565b60008135905061236a81613728565b92915050565b60008151905061237f81613728565b92915050565b60006020828403121561239757600080fd5b60006123a584828501612214565b91505092915050565b60008060008060008060008060006101208a8c0312156123cd57600080fd5b60006123db8c828d01612214565b99505060206123ec8c828d01612214565b98505060406123fd8c828d0161235b565b975050606061240e8c828d0161235b565b965050608061241f8c828d0161235b565b95505060a06124308c828d0161235b565b94505060c06124418c828d0161235b565b93505060e06124528c828d0161235b565b9250506101006124648c828d016122fc565b9150509295985092959850929598565b6000806000806040858703121561248a57600080fd5b600085013567ffffffffffffffff8111156124a457600080fd5b6124b087828801612273565b9450945050602085013567ffffffffffffffff8111156124cf57600080fd5b6124db87828801612229565b925092505092959194509250565b6000602082840312156124fb57600080fd5b6000612509848285016122bd565b91505092915050565b6000806040838503121561252557600080fd5b6000612533858286016122d2565b925050602061254485828601612214565b9150509250929050565b60008060006060848603121561256357600080fd5b6000612571868287016122d2565b935050602061258286828701612214565b925050604061259386828701612214565b9150509250925092565b6000602082840312156125af57600080fd5b60006125bd848285016122e7565b91505092915050565b600080602083850312156125d957600080fd5b600083013567ffffffffffffffff8111156125f357600080fd5b6125ff85828601612311565b92509250509250929050565b60008060006040848603121561262057600080fd5b600084013567ffffffffffffffff81111561263a57600080fd5b61264686828701612311565b9350935050602061265986828701612214565b9150509250925092565b60006020828403121561267557600080fd5b60006126838482850161235b565b91505092915050565b60006020828403121561269e57600080fd5b60006126ac84828501612370565b91505092915050565b60006126c183836126cd565b60208301905092915050565b6126d681613479565b82525050565b6126e581613479565b82525050565b6126fc6126f782613479565b613632565b82525050565b600061270d82613413565b6127178185613441565b935061272283613403565b8060005b8381101561275357815161273a88826126b5565b975061274583613434565b925050600181019050612726565b5085935050505092915050565b6127698161348b565b82525050565b61278061277b826134c3565b61364e565b82525050565b612797612792826134ef565b613658565b82525050565b6127ae6127a982613497565b613644565b82525050565b6127c56127c08261351b565b613662565b82525050565b6127dc6127d782613547565b61366c565b82525050565b60006127ed8261341e565b6127f78185613452565b93506128078185602086016135ff565b80840191505092915050565b61281c816135ba565b82525050565b61282b816135de565b82525050565b600061283d838561345d565b935061284a8385846135f0565b6128538361368a565b840190509392505050565b600061286a838561346e565b93506128778385846135f0565b82840190509392505050565b600061288e82613429565b612898818561345d565b93506128a88185602086016135ff565b6128b18161368a565b840191505092915050565b60006128c960228361345d565b91507f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e60008301527f64730000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b600061292f60208361345d565b91507f437265617465323a2062797465636f6465206c656e677468206973207a65726f6000830152602082019050919050565b600061296f60158361345d565b91507f4172726179206c656e677468206d69736d6174636800000000000000000000006000830152602082019050919050565b60006129af601a8361345d565b91507f44657374696e6174696f6e2063616e6e6f74206265207a65726f0000000000006000830152602082019050919050565b60006129ef60268361345d565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000612a5560208361345d565b91507f4e6f7420656e6f75676820746f6b656e7320746f20637265617465206c6f636b6000830152602082019050919050565b6000612a9560268361345d565b91507f416464726573733a20696e73756666696369656e742062616c616e636520666f60008301527f722063616c6c00000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000612afb601b8361345d565b91507f44657374696e6174696f6e20616c72656164792072656d6f76656400000000006000830152602082019050919050565b6000612b3b60198361345d565b91507f4d6173746572436f70792063616e6e6f74206265207a65726f000000000000006000830152602082019050919050565b6000612b7b601d8361345d565b91507f546172676574206d757374206265206f7468657220636f6e74726163740000006000830152602082019050919050565b6000612bbb60198361345d565b91507f437265617465323a204661696c6564206f6e206465706c6f79000000000000006000830152602082019050919050565b6000612bfb60158361345d565b91507f416d6f756e742063616e6e6f74206265207a65726f00000000000000000000006000830152602082019050919050565b6000612c3b60208361345d565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b6000612c7b60188361345d565b91507f496e76616c6964206d6574686f64207369676e617475726500000000000000006000830152602082019050919050565b6000612cbb60198361345d565b91507f44657374696e6174696f6e20616c7265616479206164646564000000000000006000830152602082019050919050565b6000612cfb601d8361345d565b91507f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006000830152602082019050919050565b6000612d3b602a8361345d565b91507f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008301527f6f742073756363656564000000000000000000000000000000000000000000006020830152604082019050919050565b6000612da1601d8361345d565b91507f437265617465323a20696e73756666696369656e742062616c616e63650000006000830152602082019050919050565b6000612de160198361345d565b91507f546172676574206d757374206265206120636f6e7472616374000000000000006000830152602082019050919050565b612e1d816135b0565b82525050565b6000612e2f828761276f565b600a82019150612e3f828661276f565b600a82019150612e4f82856127b4565b601482019150612e5f8284612786565b600f8201915081905095945050505050565b6000612e7d828761279d565b600182019150612e8d82866126eb565b601482019150612e9d82856127cb565b602082019150612ead82846127cb565b60208201915081905095945050505050565b6000612ecb82846127e2565b915081905092915050565b6000612ee382848661285e565b91508190509392505050565b6000602082019050612f0460008301846126dc565b92915050565b600061016082019050612f20600083018e6126dc565b612f2d602083018d6126dc565b612f3a604083018c6126dc565b612f47606083018b6126dc565b612f54608083018a612e14565b612f6160a0830189612e14565b612f6e60c0830188612e14565b612f7b60e0830187612e14565b612f89610100830186612e14565b612f97610120830185612e14565b612fa5610140830184612822565b9c9b505050505050505050505050565b6000606082019050612fca60008301866126dc565b612fd760208301856126dc565b612fe46040830184612e14565b949350505050565b600060408201905061300160008301856126dc565b61300e6020830184612e14565b9392505050565b60006101008201905061302b600083018b6126dc565b613038602083018a612e14565b6130456040830189612e14565b6130526060830188612e14565b61305f6080830187612e14565b61306c60a0830186612e14565b61307960c0830185612e14565b61308660e0830184612822565b9998505050505050505050565b600060208201905081810360008301526130ad8184612702565b905092915050565b60006020820190506130ca6000830184612760565b92915050565b60006020820190506130e56000830184612813565b92915050565b60006020820190508181036000830152613106818486612831565b90509392505050565b600060208201905081810360008301526131298184612883565b905092915050565b6000602082019050818103600083015261314a816128bc565b9050919050565b6000602082019050818103600083015261316a81612922565b9050919050565b6000602082019050818103600083015261318a81612962565b9050919050565b600060208201905081810360008301526131aa816129a2565b9050919050565b600060208201905081810360008301526131ca816129e2565b9050919050565b600060208201905081810360008301526131ea81612a48565b9050919050565b6000602082019050818103600083015261320a81612a88565b9050919050565b6000602082019050818103600083015261322a81612aee565b9050919050565b6000602082019050818103600083015261324a81612b2e565b9050919050565b6000602082019050818103600083015261326a81612b6e565b9050919050565b6000602082019050818103600083015261328a81612bae565b9050919050565b600060208201905081810360008301526132aa81612bee565b9050919050565b600060208201905081810360008301526132ca81612c2e565b9050919050565b600060208201905081810360008301526132ea81612c6e565b9050919050565b6000602082019050818103600083015261330a81612cae565b9050919050565b6000602082019050818103600083015261332a81612cee565b9050919050565b6000602082019050818103600083015261334a81612d2e565b9050919050565b6000602082019050818103600083015261336a81612d94565b9050919050565b6000602082019050818103600083015261338a81612dd4565b9050919050565b60006020820190506133a66000830184612e14565b92915050565b600080833560016020038436030381126133c557600080fd5b80840192508235915067ffffffffffffffff8211156133e357600080fd5b6020830192506001820236038313156133fb57600080fd5b509250929050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b600061348482613590565b9050919050565b60008115159050919050565b60007fff0000000000000000000000000000000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffff0000000000000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffffffffffffff000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffffffffffffffffffffffff00000000000000000000000082169050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600081905061358b826136a8565b919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60006135c5826135cc565b9050919050565b60006135d782613590565b9050919050565b60006135e98261357d565b9050919050565b82818337600083830152505050565b60005b8381101561361d578082015181840152602081019050613602565b8381111561362c576000848401525b50505050565b600061363d82613676565b9050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b60006136818261369b565b9050919050565bfe5b6000601f19601f8301169050919050565b60008160601b9050919050565b600381106136b9576136b8613688565b5b50565b6136c581613479565b81146136d057600080fd5b50565b6136dc8161348b565b81146136e757600080fd5b50565b6136f381613547565b81146136fe57600080fd5b50565b61370a81613551565b811461371557600080fd5b50565b6003811061372557600080fd5b50565b613731816135b0565b811461373c57600080fd5b5056fea2646970667358221220581ad1bb71f757e3f7e84aec2c69a43e2d33acbd90669e872c9dd5a180a59a6764736f6c63430007030033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101375760003560e01c80638da5cb5b116100b8578063bdb62fbe1161007c578063bdb62fbe14610324578063c1ab13db14610354578063cf497e6c14610370578063f1d24c451461038c578063f2fde38b146103bc578063fc0c546a146103d857610137565b80638da5cb5b146102925780639c05fc60146102b0578063a3457466146102cc578063a619486e146102ea578063b6b55f251461030857610137565b80635975e00c116100ff5780635975e00c146101f057806368d30c2e1461020c5780636e03b8dc14610228578063715018a61461025857806379ee1bdf1461026257610137565b806303990a6c1461013c5780630602ba2b146101585780632e1a7d4d1461018857806343fb93d9146101a4578063463013a2146101d4575b600080fd5b610156600480360381019061015191906125c6565b6103f6565b005b610172600480360381019061016d919061259d565b61059e565b60405161017f91906130b5565b60405180910390f35b6101a2600480360381019061019d9190612663565b6105df565b005b6101be60048036038101906101b9919061254e565b61073c565b6040516101cb9190612eef565b60405180910390f35b6101ee60048036038101906101e9919061260b565b610761565b005b61020a60048036038101906102059190612385565b6107ed565b005b610226600480360381019061022191906123ae565b61097e565b005b610242600480360381019061023d919061259d565b610cc6565b60405161024f9190612eef565b60405180910390f35b610260610cf9565b005b61027c60048036038101906102779190612385565b610e33565b60405161028991906130b5565b60405180910390f35b61029a610e50565b6040516102a79190612eef565b60405180910390f35b6102ca60048036038101906102c59190612474565b610e79565b005b6102d4610fa6565b6040516102e19190613093565b60405180910390f35b6102f261107e565b6040516102ff9190612eef565b60405180910390f35b610322600480360381019061031d9190612663565b6110a4565b005b61033e60048036038101906103399190612512565b611187565b60405161034b9190612eef565b60405180910390f35b61036e60048036038101906103699190612385565b61119c565b005b61038a60048036038101906103859190612385565b6112bd565b005b6103a660048036038101906103a1919061259d565b611430565b6040516103b39190612eef565b60405180910390f35b6103d660048036038101906103d19190612385565b6114ab565b005b6103e0611654565b6040516103ed91906130d0565b60405180910390f35b6103fe61167e565b73ffffffffffffffffffffffffffffffffffffffff1661041c610e50565b73ffffffffffffffffffffffffffffffffffffffff1614610472576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610469906132b1565b60405180910390fd5b600061047e8383611686565b9050600060016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff16817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163373ffffffffffffffffffffffffffffffffffffffff167f450397a2db0e89eccfe664cc6cdfd274a88bc00d29aaec4d991754a42f19f8c986866040516105919291906130eb565b60405180910390a4505050565b60008073ffffffffffffffffffffffffffffffffffffffff166105c083611430565b73ffffffffffffffffffffffffffffffffffffffff1614159050919050565b6105e761167e565b73ffffffffffffffffffffffffffffffffffffffff16610605610e50565b73ffffffffffffffffffffffffffffffffffffffff161461065b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610652906132b1565b60405180910390fd5b6000811161069e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161069590613291565b60405180910390fd5b6106eb3382600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117149092919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b826040516107319190613391565b60405180910390a250565b60006107588461074b8561179a565b8051906020012084611810565b90509392505050565b61076961167e565b73ffffffffffffffffffffffffffffffffffffffff16610787610e50565b73ffffffffffffffffffffffffffffffffffffffff16146107dd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107d4906132b1565b60405180910390fd5b6107e8838383611854565b505050565b6107f561167e565b73ffffffffffffffffffffffffffffffffffffffff16610813610e50565b73ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610860906132b1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156108d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108d090613191565b60405180910390fd5b6108ed816002611a3690919063ffffffff16565b61092c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610923906132f1565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f33442b8c13e72dd75a027f08f9bff4eed2dfd26e43cdea857365f5163b359a79600160405161097391906130b5565b60405180910390a250565b61098661167e565b73ffffffffffffffffffffffffffffffffffffffff166109a4610e50565b73ffffffffffffffffffffffffffffffffffffffff16146109fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109f1906132b1565b60405180910390fd5b86600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610a569190612eef565b60206040518083038186803b158015610a6e57600080fd5b505afa158015610a82573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aa6919061268c565b1015610ae7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ade906131d1565b60405180910390fd5b606063bd896dcb60e01b308b8b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168c8c8c8c8c8c8c604051602401610b389b9a99989796959493929190612f0a565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505090506000610bcd8280519060200120600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611a66565b9050610c1c818a600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117149092919063ffffffff16565b8973ffffffffffffffffffffffffffffffffffffffff1682805190602001208273ffffffffffffffffffffffffffffffffffffffff167f3c7ff6acee351ed98200c285a04745858a107e16da2f13c3a81a43073c17d644600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168d8d8d8d8d8d8d604051610cb1989796959493929190613015565b60405180910390a45050505050505050505050565b60016020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610d0161167e565b73ffffffffffffffffffffffffffffffffffffffff16610d1f610e50565b73ffffffffffffffffffffffffffffffffffffffff1614610d75576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d6c906132b1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000610e49826002611ae290919063ffffffff16565b9050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610e8161167e565b73ffffffffffffffffffffffffffffffffffffffff16610e9f610e50565b73ffffffffffffffffffffffffffffffffffffffff1614610ef5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eec906132b1565b60405180910390fd5b818190508484905014610f3d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f3490613171565b60405180910390fd5b60005b84849050811015610f9f57610f92858583818110610f5a57fe5b9050602002810190610f6c91906133ac565b858585818110610f7857fe5b9050602002016020810190610f8d9190612385565b611854565b8080600101915050610f40565b5050505050565b606080610fb36002611b12565b67ffffffffffffffff81118015610fc957600080fd5b50604051908082528060200260200182016040528015610ff85781602001602082028036833780820191505090505b50905060005b6110086002611b12565b81101561107657611023816002611b2790919063ffffffff16565b82828151811061102f57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508080600101915050610ffe565b508091505090565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600081116110e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110de90613291565b60405180910390fd5b611136333083600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611b41909392919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f59062170a285eb80e8c6b8ced60428442a51910635005233fc4ce084a475845e8260405161117c9190613391565b60405180910390a250565b600061119483833061073c565b905092915050565b6111a461167e565b73ffffffffffffffffffffffffffffffffffffffff166111c2610e50565b73ffffffffffffffffffffffffffffffffffffffff1614611218576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161120f906132b1565b60405180910390fd5b61122c816002611bca90919063ffffffff16565b61126b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161126290613211565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f33442b8c13e72dd75a027f08f9bff4eed2dfd26e43cdea857365f5163b359a7960006040516112b291906130b5565b60405180910390a250565b6112c561167e565b73ffffffffffffffffffffffffffffffffffffffff166112e3610e50565b73ffffffffffffffffffffffffffffffffffffffff1614611339576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611330906132b1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156113a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113a090613231565b60405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167f30909084afc859121ffc3a5aef7fe37c540a9a1ef60bd4d8dcdb76376fadf9de60405160405180910390a250565b600060016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6114b361167e565b73ffffffffffffffffffffffffffffffffffffffff166114d1610e50565b73ffffffffffffffffffffffffffffffffffffffff1614611527576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161151e906132b1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e906131b1565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600033905090565b600061170c838360405160240160405160208183030381529060405291906040516116b2929190612ed6565b60405180910390207bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611bfa565b905092915050565b6117958363a9059cbb60e01b8484604051602401611733929190612fec565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611c52565b505050565b60606000693d602d80600a3d3981f360b01b9050600069363d3d373d3d3d363d7360b01b905060008460601b905060006e5af43d82803e903d91602b57fd5bf360881b9050838383836040516020016117f69493929190612e23565b604051602081830303815290604052945050505050919050565b60008060ff60f81b83868660405160200161182e9493929190612e71565b6040516020818303038152906040528051906020012090508060001c9150509392505050565b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156118c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118ba90613251565b60405180910390fd5b6118cc81611d19565b61190b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161190290613371565b60405180910390fd5b60006119178484611686565b90508160016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff16817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163373ffffffffffffffffffffffffffffffffffffffff167f450397a2db0e89eccfe664cc6cdfd274a88bc00d29aaec4d991754a42f19f8c98787604051611a289291906130eb565b60405180910390a450505050565b6000611a5e836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611d2c565b905092915050565b600080611a7d600086611a788761179a565b611d9c565b90508073ffffffffffffffffffffffffffffffffffffffff167efffc2da0b561cae30d9826d37709e9421c4725faebc226cbbb7ef5fc5e734960405160405180910390a2600083511115611ad757611ad58184611ead565b505b809150509392505050565b6000611b0a836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611ef7565b905092915050565b6000611b2082600001611f1a565b9050919050565b6000611b368360000183611f2b565b60001c905092915050565b611bc4846323b872dd60e01b858585604051602401611b6293929190612fb5565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611c52565b50505050565b6000611bf2836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611f98565b905092915050565b60006004825114611c40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c37906132d1565b60405180910390fd5b60006020830151905080915050919050565b6060611cb4826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166120809092919063ffffffff16565b9050600081511115611d145780806020019051810190611cd491906124e9565b611d13576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d0a90613331565b60405180910390fd5b5b505050565b600080823b905060008111915050919050565b6000611d388383611ef7565b611d91578260000182908060018154018082558091505060019003906000526020600020016000909190919091505582600001805490508360010160008481526020019081526020016000208190555060019050611d96565b600090505b92915050565b60008084471015611de2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd990613351565b60405180910390fd5b600083511415611e27576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e1e90613151565b60405180910390fd5b8383516020850187f59050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611ea2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e9990613271565b60405180910390fd5b809150509392505050565b6060611eef83836040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c65640000815250612080565b905092915050565b600080836001016000848152602001908152602001600020541415905092915050565b600081600001805490509050919050565b600081836000018054905011611f76576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f6d90613131565b60405180910390fd5b826000018281548110611f8557fe5b9060005260206000200154905092915050565b600080836001016000848152602001908152602001600020549050600081146120745760006001820390506000600186600001805490500390506000866000018281548110611fe357fe5b906000526020600020015490508087600001848154811061200057fe5b906000526020600020018190555060018301876001016000838152602001908152602001600020819055508660000180548061203857fe5b6001900381819060005260206000200160009055905586600101600087815260200190815260200160002060009055600194505050505061207a565b60009150505b92915050565b606061208f8484600085612098565b90509392505050565b6060824710156120dd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120d4906131f1565b60405180910390fd5b6120e685611d19565b612125576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161211c90613311565b60405180910390fd5b600060608673ffffffffffffffffffffffffffffffffffffffff16858760405161214f9190612ebf565b60006040518083038185875af1925050503d806000811461218c576040519150601f19603f3d011682016040523d82523d6000602084013e612191565b606091505b50915091506121a18282866121ad565b92505050949350505050565b606083156121bd5782905061220d565b6000835111156121d05782518084602001fd5b816040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612204919061310f565b60405180910390fd5b9392505050565b600081359050612223816136bc565b92915050565b60008083601f84011261223b57600080fd5b8235905067ffffffffffffffff81111561225457600080fd5b60208301915083602082028301111561226c57600080fd5b9250929050565b60008083601f84011261228557600080fd5b8235905067ffffffffffffffff81111561229e57600080fd5b6020830191508360208202830111156122b657600080fd5b9250929050565b6000815190506122cc816136d3565b92915050565b6000813590506122e1816136ea565b92915050565b6000813590506122f681613701565b92915050565b60008135905061230b81613718565b92915050565b60008083601f84011261232357600080fd5b8235905067ffffffffffffffff81111561233c57600080fd5b60208301915083600182028301111561235457600080fd5b9250929050565b60008135905061236a81613728565b92915050565b60008151905061237f81613728565b92915050565b60006020828403121561239757600080fd5b60006123a584828501612214565b91505092915050565b60008060008060008060008060006101208a8c0312156123cd57600080fd5b60006123db8c828d01612214565b99505060206123ec8c828d01612214565b98505060406123fd8c828d0161235b565b975050606061240e8c828d0161235b565b965050608061241f8c828d0161235b565b95505060a06124308c828d0161235b565b94505060c06124418c828d0161235b565b93505060e06124528c828d0161235b565b9250506101006124648c828d016122fc565b9150509295985092959850929598565b6000806000806040858703121561248a57600080fd5b600085013567ffffffffffffffff8111156124a457600080fd5b6124b087828801612273565b9450945050602085013567ffffffffffffffff8111156124cf57600080fd5b6124db87828801612229565b925092505092959194509250565b6000602082840312156124fb57600080fd5b6000612509848285016122bd565b91505092915050565b6000806040838503121561252557600080fd5b6000612533858286016122d2565b925050602061254485828601612214565b9150509250929050565b60008060006060848603121561256357600080fd5b6000612571868287016122d2565b935050602061258286828701612214565b925050604061259386828701612214565b9150509250925092565b6000602082840312156125af57600080fd5b60006125bd848285016122e7565b91505092915050565b600080602083850312156125d957600080fd5b600083013567ffffffffffffffff8111156125f357600080fd5b6125ff85828601612311565b92509250509250929050565b60008060006040848603121561262057600080fd5b600084013567ffffffffffffffff81111561263a57600080fd5b61264686828701612311565b9350935050602061265986828701612214565b9150509250925092565b60006020828403121561267557600080fd5b60006126838482850161235b565b91505092915050565b60006020828403121561269e57600080fd5b60006126ac84828501612370565b91505092915050565b60006126c183836126cd565b60208301905092915050565b6126d681613479565b82525050565b6126e581613479565b82525050565b6126fc6126f782613479565b613632565b82525050565b600061270d82613413565b6127178185613441565b935061272283613403565b8060005b8381101561275357815161273a88826126b5565b975061274583613434565b925050600181019050612726565b5085935050505092915050565b6127698161348b565b82525050565b61278061277b826134c3565b61364e565b82525050565b612797612792826134ef565b613658565b82525050565b6127ae6127a982613497565b613644565b82525050565b6127c56127c08261351b565b613662565b82525050565b6127dc6127d782613547565b61366c565b82525050565b60006127ed8261341e565b6127f78185613452565b93506128078185602086016135ff565b80840191505092915050565b61281c816135ba565b82525050565b61282b816135de565b82525050565b600061283d838561345d565b935061284a8385846135f0565b6128538361368a565b840190509392505050565b600061286a838561346e565b93506128778385846135f0565b82840190509392505050565b600061288e82613429565b612898818561345d565b93506128a88185602086016135ff565b6128b18161368a565b840191505092915050565b60006128c960228361345d565b91507f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e60008301527f64730000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b600061292f60208361345d565b91507f437265617465323a2062797465636f6465206c656e677468206973207a65726f6000830152602082019050919050565b600061296f60158361345d565b91507f4172726179206c656e677468206d69736d6174636800000000000000000000006000830152602082019050919050565b60006129af601a8361345d565b91507f44657374696e6174696f6e2063616e6e6f74206265207a65726f0000000000006000830152602082019050919050565b60006129ef60268361345d565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000612a5560208361345d565b91507f4e6f7420656e6f75676820746f6b656e7320746f20637265617465206c6f636b6000830152602082019050919050565b6000612a9560268361345d565b91507f416464726573733a20696e73756666696369656e742062616c616e636520666f60008301527f722063616c6c00000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000612afb601b8361345d565b91507f44657374696e6174696f6e20616c72656164792072656d6f76656400000000006000830152602082019050919050565b6000612b3b60198361345d565b91507f4d6173746572436f70792063616e6e6f74206265207a65726f000000000000006000830152602082019050919050565b6000612b7b601d8361345d565b91507f546172676574206d757374206265206f7468657220636f6e74726163740000006000830152602082019050919050565b6000612bbb60198361345d565b91507f437265617465323a204661696c6564206f6e206465706c6f79000000000000006000830152602082019050919050565b6000612bfb60158361345d565b91507f416d6f756e742063616e6e6f74206265207a65726f00000000000000000000006000830152602082019050919050565b6000612c3b60208361345d565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b6000612c7b60188361345d565b91507f496e76616c6964206d6574686f64207369676e617475726500000000000000006000830152602082019050919050565b6000612cbb60198361345d565b91507f44657374696e6174696f6e20616c7265616479206164646564000000000000006000830152602082019050919050565b6000612cfb601d8361345d565b91507f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006000830152602082019050919050565b6000612d3b602a8361345d565b91507f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008301527f6f742073756363656564000000000000000000000000000000000000000000006020830152604082019050919050565b6000612da1601d8361345d565b91507f437265617465323a20696e73756666696369656e742062616c616e63650000006000830152602082019050919050565b6000612de160198361345d565b91507f546172676574206d757374206265206120636f6e7472616374000000000000006000830152602082019050919050565b612e1d816135b0565b82525050565b6000612e2f828761276f565b600a82019150612e3f828661276f565b600a82019150612e4f82856127b4565b601482019150612e5f8284612786565b600f8201915081905095945050505050565b6000612e7d828761279d565b600182019150612e8d82866126eb565b601482019150612e9d82856127cb565b602082019150612ead82846127cb565b60208201915081905095945050505050565b6000612ecb82846127e2565b915081905092915050565b6000612ee382848661285e565b91508190509392505050565b6000602082019050612f0460008301846126dc565b92915050565b600061016082019050612f20600083018e6126dc565b612f2d602083018d6126dc565b612f3a604083018c6126dc565b612f47606083018b6126dc565b612f54608083018a612e14565b612f6160a0830189612e14565b612f6e60c0830188612e14565b612f7b60e0830187612e14565b612f89610100830186612e14565b612f97610120830185612e14565b612fa5610140830184612822565b9c9b505050505050505050505050565b6000606082019050612fca60008301866126dc565b612fd760208301856126dc565b612fe46040830184612e14565b949350505050565b600060408201905061300160008301856126dc565b61300e6020830184612e14565b9392505050565b60006101008201905061302b600083018b6126dc565b613038602083018a612e14565b6130456040830189612e14565b6130526060830188612e14565b61305f6080830187612e14565b61306c60a0830186612e14565b61307960c0830185612e14565b61308660e0830184612822565b9998505050505050505050565b600060208201905081810360008301526130ad8184612702565b905092915050565b60006020820190506130ca6000830184612760565b92915050565b60006020820190506130e56000830184612813565b92915050565b60006020820190508181036000830152613106818486612831565b90509392505050565b600060208201905081810360008301526131298184612883565b905092915050565b6000602082019050818103600083015261314a816128bc565b9050919050565b6000602082019050818103600083015261316a81612922565b9050919050565b6000602082019050818103600083015261318a81612962565b9050919050565b600060208201905081810360008301526131aa816129a2565b9050919050565b600060208201905081810360008301526131ca816129e2565b9050919050565b600060208201905081810360008301526131ea81612a48565b9050919050565b6000602082019050818103600083015261320a81612a88565b9050919050565b6000602082019050818103600083015261322a81612aee565b9050919050565b6000602082019050818103600083015261324a81612b2e565b9050919050565b6000602082019050818103600083015261326a81612b6e565b9050919050565b6000602082019050818103600083015261328a81612bae565b9050919050565b600060208201905081810360008301526132aa81612bee565b9050919050565b600060208201905081810360008301526132ca81612c2e565b9050919050565b600060208201905081810360008301526132ea81612c6e565b9050919050565b6000602082019050818103600083015261330a81612cae565b9050919050565b6000602082019050818103600083015261332a81612cee565b9050919050565b6000602082019050818103600083015261334a81612d2e565b9050919050565b6000602082019050818103600083015261336a81612d94565b9050919050565b6000602082019050818103600083015261338a81612dd4565b9050919050565b60006020820190506133a66000830184612e14565b92915050565b600080833560016020038436030381126133c557600080fd5b80840192508235915067ffffffffffffffff8211156133e357600080fd5b6020830192506001820236038313156133fb57600080fd5b509250929050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b600061348482613590565b9050919050565b60008115159050919050565b60007fff0000000000000000000000000000000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffff0000000000000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffffffffffffff000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffffffffffffffffffffffff00000000000000000000000082169050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600081905061358b826136a8565b919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60006135c5826135cc565b9050919050565b60006135d782613590565b9050919050565b60006135e98261357d565b9050919050565b82818337600083830152505050565b60005b8381101561361d578082015181840152602081019050613602565b8381111561362c576000848401525b50505050565b600061363d82613676565b9050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b60006136818261369b565b9050919050565bfe5b6000601f19601f8301169050919050565b60008160601b9050919050565b600381106136b9576136b8613688565b5b50565b6136c581613479565b81146136d057600080fd5b50565b6136dc8161348b565b81146136e757600080fd5b50565b6136f381613547565b81146136fe57600080fd5b50565b61370a81613551565b811461371557600080fd5b50565b6003811061372557600080fd5b50565b613731816135b0565b811461373c57600080fd5b5056fea2646970667358221220581ad1bb71f757e3f7e84aec2c69a43e2d33acbd90669e872c9dd5a180a59a6764736f6c63430007030033", + "devdoc": { + "kind": "dev", + "methods": { + "addTokenDestination(address)": { + "params": { + "_dst": "Destination address" + } + }, + "constructor": { + "params": { + "_graphToken": "Token to use for deposits and withdrawals", + "_masterCopy": "Address of the master copy to use to clone proxies" + } + }, + "createTokenLockWallet(address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)": { + "params": { + "_beneficiary": "Address of the beneficiary of locked tokens", + "_endTime": "End time of the release schedule", + "_managedAmount": "Amount of tokens to be managed by the lock contract", + "_owner": "Address of the contract owner", + "_periods": "Number of periods between start time and end time", + "_releaseStartTime": "Override time for when the releases start", + "_revocable": "Whether the contract is revocable", + "_startTime": "Start time of the release schedule" + } + }, + "deposit(uint256)": { + "details": "Even if the ERC20 token can be transferred directly to the contract this function provide a safe interface to do the transfer and avoid mistakes", + "params": { + "_amount": "Amount to deposit" + } + }, + "getAuthFunctionCallTarget(bytes4)": { + "params": { + "_sigHash": "Function signature hash" + }, + "returns": { + "_0": "Address of the target contract where to send the call" + } + }, + "getDeploymentAddress(bytes32,address)": { + "details": "Uses address(this) as deployer to compute the address. Only for backwards compatibility.", + "params": { + "_implementation": "Address of the proxy target implementation", + "_salt": "Bytes32 salt to use for CREATE2" + }, + "returns": { + "_0": "Address of the counterfactual MinimalProxy" + } + }, + "getDeploymentAddress(bytes32,address,address)": { + "params": { + "_deployer": "Address of the deployer that creates the contract", + "_implementation": "Address of the proxy target implementation", + "_salt": "Bytes32 salt to use for CREATE2" + }, + "returns": { + "_0": "Address of the counterfactual MinimalProxy" + } + }, + "getTokenDestinations()": { + "returns": { + "_0": "Array of addresses authorized to pull funds from a token lock" + } + }, + "isAuthFunctionCall(bytes4)": { + "params": { + "_sigHash": "Function signature hash" + }, + "returns": { + "_0": "True if authorized" + } + }, + "isTokenDestination(address)": { + "params": { + "_dst": "Destination address" + }, + "returns": { + "_0": "True if authorized" + } + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "removeTokenDestination(address)": { + "params": { + "_dst": "Destination address" + } + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." + }, + "setAuthFunctionCall(string,address)": { + "details": "Input expected is the function signature as 'transfer(address,uint256)'", + "params": { + "_signature": "Function signature", + "_target": "Address of the destination contract to call" + } + }, + "setAuthFunctionCallMany(string[],address[])": { + "details": "Input expected is the function signature as 'transfer(address,uint256)'", + "params": { + "_signatures": "Function signatures", + "_targets": "Address of the destination contract to call" + } + }, + "setMasterCopy(address)": { + "params": { + "_masterCopy": "Address of contract bytecode to factory clone" + } + }, + "token()": { + "returns": { + "_0": "Token used for transfers and approvals" + } + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + }, + "unsetAuthFunctionCall(string)": { + "details": "Input expected is the function signature as 'transfer(address,uint256)'", + "params": { + "_signature": "Function signature" + } + }, + "withdraw(uint256)": { + "details": "Escape hatch in case of mistakes or to recover remaining funds", + "params": { + "_amount": "Amount of tokens to withdraw" + } + } + }, + "title": "GraphTokenLockManager", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "addTokenDestination(address)": { + "notice": "Adds an address that can be allowed by a token lock to pull funds" + }, + "constructor": { + "notice": "Constructor." + }, + "createTokenLockWallet(address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)": { + "notice": "Creates and fund a new token lock wallet using a minimum proxy" + }, + "deposit(uint256)": { + "notice": "Deposits tokens into the contract" + }, + "getAuthFunctionCallTarget(bytes4)": { + "notice": "Gets the target contract to call for a particular function signature" + }, + "getDeploymentAddress(bytes32,address)": { + "notice": "Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation" + }, + "getDeploymentAddress(bytes32,address,address)": { + "notice": "Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation" + }, + "getTokenDestinations()": { + "notice": "Returns an array of authorized destination addresses" + }, + "isAuthFunctionCall(bytes4)": { + "notice": "Returns true if the function call is authorized" + }, + "isTokenDestination(address)": { + "notice": "Returns True if the address is authorized to be a destination of tokens" + }, + "removeTokenDestination(address)": { + "notice": "Removes an address that can be allowed by a token lock to pull funds" + }, + "setAuthFunctionCall(string,address)": { + "notice": "Sets an authorized function call to target" + }, + "setAuthFunctionCallMany(string[],address[])": { + "notice": "Sets an authorized function call to target in bulk" + }, + "setMasterCopy(address)": { + "notice": "Sets the masterCopy bytecode to use to create clones of TokenLock contracts" + }, + "token()": { + "notice": "Gets the GRT token address" + }, + "unsetAuthFunctionCall(string)": { + "notice": "Unsets an authorized function call to target" + }, + "withdraw(uint256)": { + "notice": "Withdraws tokens from the contract" + } + }, + "notice": "This contract manages a list of authorized function calls and targets that can be called by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts. This contract receives funds to make the process of creating TokenLockWallet contracts easier by distributing them the initial tokens to be managed. The owner can setup a list of token destinations that will be used by TokenLock contracts to approve the pulling of funds, this way in can be guaranteed that only protocol contracts will manipulate users funds.", + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 672, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "_owner", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 3988, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "authFnCalls", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_bytes4,t_address)" + }, + { + "astId": 3990, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "_tokenDestinations", + "offset": 0, + "slot": "2", + "type": "t_struct(AddressSet)2629_storage" + }, + { + "astId": 3992, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "masterCopy", + "offset": 0, + "slot": "4", + "type": "t_address" + }, + { + "astId": 3994, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "_token", + "offset": 0, + "slot": "5", + "type": "t_contract(IERC20)1710" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_bytes32)dyn_storage": { + "base": "t_bytes32", + "encoding": "dynamic_array", + "label": "bytes32[]", + "numberOfBytes": "32" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_bytes4": { + "encoding": "inplace", + "label": "bytes4", + "numberOfBytes": "4" + }, + "t_contract(IERC20)1710": { + "encoding": "inplace", + "label": "contract IERC20", + "numberOfBytes": "20" + }, + "t_mapping(t_bytes32,t_uint256)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_mapping(t_bytes4,t_address)": { + "encoding": "mapping", + "key": "t_bytes4", + "label": "mapping(bytes4 => address)", + "numberOfBytes": "32", + "value": "t_address" + }, + "t_struct(AddressSet)2629_storage": { + "encoding": "inplace", + "label": "struct EnumerableSet.AddressSet", + "members": [ + { + "astId": 2628, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "_inner", + "offset": 0, + "slot": "0", + "type": "t_struct(Set)2364_storage" + } + ], + "numberOfBytes": "64" + }, + "t_struct(Set)2364_storage": { + "encoding": "inplace", + "label": "struct EnumerableSet.Set", + "members": [ + { + "astId": 2359, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "_values", + "offset": 0, + "slot": "0", + "type": "t_array(t_bytes32)dyn_storage" + }, + { + "astId": 2363, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "_indexes", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_bytes32,t_uint256)" + } + ], + "numberOfBytes": "64" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} \ No newline at end of file diff --git a/packages/token-distribution/deployments/sepolia/GraphTokenLockWallet.json b/packages/token-distribution/deployments/sepolia/GraphTokenLockWallet.json new file mode 100644 index 000000000..312836e89 --- /dev/null +++ b/packages/token-distribution/deployments/sepolia/GraphTokenLockWallet.json @@ -0,0 +1,1101 @@ +{ + "address": "0xd8a03C88984d5669d467aE72Fbb21cD7Ce6E08D4", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "newBeneficiary", + "type": "address" + } + ], + "name": "BeneficiaryChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "LockAccepted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "LockCanceled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_oldManager", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "_newManager", + "type": "address" + } + ], + "name": "ManagerUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "TokenDestinationsApproved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "TokenDestinationsRevoked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensReleased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensRevoked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensWithdrawn", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "acceptLock", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "amountPerPeriod", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "approveProtocol", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "availableAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "beneficiary", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "cancelLock", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newBeneficiary", + "type": "address" + } + ], + "name": "changeBeneficiary", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "currentBalance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "currentPeriod", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "currentTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "duration", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "endTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_manager", + "type": "address" + }, + { + "internalType": "address", + "name": "_owner", + "type": "address" + }, + { + "internalType": "address", + "name": "_beneficiary", + "type": "address" + }, + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_managedAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_startTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_endTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_periods", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_releaseStartTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_vestingCliffTime", + "type": "uint256" + }, + { + "internalType": "enum IGraphTokenLock.Revocability", + "name": "_revocable", + "type": "uint8" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "isAccepted", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isInitialized", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isRevoked", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "managedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "manager", + "outputs": [ + { + "internalType": "contract IGraphTokenLockManager", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "passedPeriods", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "periodDuration", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "periods", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "releasableAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "release", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "releaseStartTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "releasedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "revocable", + "outputs": [ + { + "internalType": "enum IGraphTokenLock.Revocability", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "revoke", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "revokeProtocol", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "revokedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newManager", + "type": "address" + } + ], + "name": "setManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "sinceStartTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "startTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "surplusAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "token", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalOutstandingAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "usedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "vestedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "vestingCliffTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "withdrawSurplus", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0x416a693b6489bb703b6b3e28d8fbb81d1e245a050e93bb4d671dccb18292eeb3", + "receipt": { + "to": null, + "from": "0x559081D91F5Ff43dfE51A07C216F8E6893805B35", + "contractAddress": "0xd8a03C88984d5669d467aE72Fbb21cD7Ce6E08D4", + "transactionIndex": 26, + "gasUsed": "3942206", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xf9b41b792a46f3c8b342c85356b0268526c92dfd758d66ada4c5f2382f0120a5", + "transactionHash": "0x416a693b6489bb703b6b3e28d8fbb81d1e245a050e93bb4d671dccb18292eeb3", + "logs": [], + "blockNumber": 4570363, + "cumulativeGasUsed": "10254368", + "status": 1, + "byzantium": true + }, + "args": [], + "solcInputHash": "095bd30babc75057be19228ca1fd7aa4", + "metadata": "{\"compiler\":{\"version\":\"0.7.3+commit.9bfce1f6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newBeneficiary\",\"type\":\"address\"}],\"name\":\"BeneficiaryChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"LockAccepted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"LockCanceled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_oldManager\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_newManager\",\"type\":\"address\"}],\"name\":\"ManagerUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"TokenDestinationsApproved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"TokenDestinationsRevoked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensReleased\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensRevoked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensWithdrawn\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"acceptLock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"amountPerPeriod\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"approveProtocol\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"availableAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"beneficiary\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"cancelLock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_newBeneficiary\",\"type\":\"address\"}],\"name\":\"changeBeneficiary\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"currentBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"currentPeriod\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"currentTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"duration\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"endTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_manager\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_beneficiary\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_managedAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_startTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_endTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_periods\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_releaseStartTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_vestingCliffTime\",\"type\":\"uint256\"},{\"internalType\":\"enum IGraphTokenLock.Revocability\",\"name\":\"_revocable\",\"type\":\"uint8\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isAccepted\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isInitialized\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isRevoked\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"managedAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"manager\",\"outputs\":[{\"internalType\":\"contract IGraphTokenLockManager\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"passedPeriods\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"periodDuration\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"periods\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"releasableAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"release\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"releaseStartTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"releasedAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"revocable\",\"outputs\":[{\"internalType\":\"enum IGraphTokenLock.Revocability\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"revoke\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"revokeProtocol\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"revokedAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_newManager\",\"type\":\"address\"}],\"name\":\"setManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"sinceStartTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"startTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"surplusAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalOutstandingAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"usedAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"vestedAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"vestingCliffTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdrawSurplus\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"acceptLock()\":{\"details\":\"Can only be called by the beneficiary\"},\"amountPerPeriod()\":{\"returns\":{\"_0\":\"Amount of tokens available after each period\"}},\"approveProtocol()\":{\"details\":\"Approves all token destinations registered in the manager to pull tokens\"},\"availableAmount()\":{\"details\":\"Implements the step-by-step schedule based on periods for available tokens\",\"returns\":{\"_0\":\"Amount of tokens available according to the schedule\"}},\"cancelLock()\":{\"details\":\"Can only be called by the owner\"},\"changeBeneficiary(address)\":{\"details\":\"Can only be called by the beneficiary\",\"params\":{\"_newBeneficiary\":\"Address of the new beneficiary address\"}},\"currentBalance()\":{\"returns\":{\"_0\":\"Tokens held in the contract\"}},\"currentPeriod()\":{\"returns\":{\"_0\":\"A number that represents the current period\"}},\"currentTime()\":{\"returns\":{\"_0\":\"Current block timestamp\"}},\"duration()\":{\"returns\":{\"_0\":\"Amount of seconds from contract startTime to endTime\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"passedPeriods()\":{\"returns\":{\"_0\":\"A number of periods that passed since the schedule started\"}},\"periodDuration()\":{\"returns\":{\"_0\":\"Duration of each period in seconds\"}},\"releasableAmount()\":{\"details\":\"Considers the schedule, takes into account already released tokens and used amount\",\"returns\":{\"_0\":\"Amount of tokens ready to be released\"}},\"release()\":{\"details\":\"All available releasable tokens are transferred to beneficiary\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"revoke()\":{\"details\":\"Vesting schedule is always calculated based on managed tokens\"},\"revokeProtocol()\":{\"details\":\"Revokes approval to all token destinations in the manager to pull tokens\"},\"setManager(address)\":{\"params\":{\"_newManager\":\"Address of the new manager\"}},\"sinceStartTime()\":{\"details\":\"Returns zero if called before conctract starTime\",\"returns\":{\"_0\":\"Seconds elapsed from contract startTime\"}},\"surplusAmount()\":{\"details\":\"All funds over outstanding amount is considered surplus that can be withdrawn by beneficiary. Note this might not be the correct value for wallets transferred to L2 (i.e. an L2GraphTokenLockWallet), as the released amount will be skewed, so the beneficiary might have to bridge back to L1 to release the surplus.\",\"returns\":{\"_0\":\"Amount of tokens considered as surplus\"}},\"totalOutstandingAmount()\":{\"details\":\"Does not consider schedule but just global amounts tracked\",\"returns\":{\"_0\":\"Amount of outstanding tokens for the lifetime of the contract\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"vestedAmount()\":{\"details\":\"Similar to available amount, but is fully vested when contract is non-revocable\",\"returns\":{\"_0\":\"Amount of tokens already vested\"}},\"withdrawSurplus(uint256)\":{\"details\":\"Tokens in the contract over outstanding amount are considered as surplus\",\"params\":{\"_amount\":\"Amount of tokens to withdraw\"}}},\"title\":\"GraphTokenLockWallet\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"acceptLock()\":{\"notice\":\"Beneficiary accepts the lock, the owner cannot retrieve back the tokens\"},\"amountPerPeriod()\":{\"notice\":\"Returns amount available to be released after each period according to schedule\"},\"approveProtocol()\":{\"notice\":\"Approves protocol access of the tokens managed by this contract\"},\"availableAmount()\":{\"notice\":\"Gets the currently available token according to the schedule\"},\"cancelLock()\":{\"notice\":\"Owner cancel the lock and return the balance in the contract\"},\"changeBeneficiary(address)\":{\"notice\":\"Change the beneficiary of funds managed by the contract\"},\"currentBalance()\":{\"notice\":\"Returns the amount of tokens currently held by the contract\"},\"currentPeriod()\":{\"notice\":\"Gets the current period based on the schedule\"},\"currentTime()\":{\"notice\":\"Returns the current block timestamp\"},\"duration()\":{\"notice\":\"Gets duration of contract from start to end in seconds\"},\"passedPeriods()\":{\"notice\":\"Gets the number of periods that passed since the first period\"},\"periodDuration()\":{\"notice\":\"Returns the duration of each period in seconds\"},\"releasableAmount()\":{\"notice\":\"Gets tokens currently available for release\"},\"release()\":{\"notice\":\"Releases tokens based on the configured schedule\"},\"revoke()\":{\"notice\":\"Revokes a vesting schedule and return the unvested tokens to the owner\"},\"revokeProtocol()\":{\"notice\":\"Revokes protocol access of the tokens managed by this contract\"},\"setManager(address)\":{\"notice\":\"Sets a new manager for this contract\"},\"sinceStartTime()\":{\"notice\":\"Gets time elapsed since the start of the contract\"},\"surplusAmount()\":{\"notice\":\"Gets surplus amount in the contract based on outstanding amount to release\"},\"totalOutstandingAmount()\":{\"notice\":\"Gets the outstanding amount yet to be released based on the whole contract lifetime\"},\"vestedAmount()\":{\"notice\":\"Gets the amount of currently vested tokens\"},\"withdrawSurplus(uint256)\":{\"notice\":\"Withdraws surplus, unmanaged tokens from the contract\"}},\"notice\":\"This contract is built on top of the base GraphTokenLock functionality. It allows wallet beneficiaries to use the deposited funds to perform specific function calls on specific contracts. The idea is that supporters with locked tokens can participate in the protocol but disallow any release before the vesting/lock schedule. The beneficiary can issue authorized function calls to this contract that will get forwarded to a target contract. A target contract is any of our protocol contracts. The function calls allowed are queried to the GraphTokenLockManager, this way the same configuration can be shared for all the created lock wallet contracts. NOTE: Contracts used as target must have its function signatures checked to avoid collisions with any of this contract functions. Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience the maximum amount of tokens is authorized. Function calls do not forward ETH value so DO NOT SEND ETH TO THIS CONTRACT.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/GraphTokenLockWallet.sol\":\"GraphTokenLockWallet\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/math/SafeMath.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Wrappers over Solidity's arithmetic operations with added overflow\\n * checks.\\n *\\n * Arithmetic operations in Solidity wrap on overflow. This can easily result\\n * in bugs, because programmers usually assume that an overflow raises an\\n * error, which is the standard behavior in high level programming languages.\\n * `SafeMath` restores this intuition by reverting the transaction when an\\n * operation overflows.\\n *\\n * Using this library instead of the unchecked operations eliminates an entire\\n * class of bugs, so it's recommended to use it always.\\n */\\nlibrary SafeMath {\\n /**\\n * @dev Returns the addition of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n uint256 c = a + b;\\n if (c < a) return (false, 0);\\n return (true, c);\\n }\\n\\n /**\\n * @dev Returns the substraction of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b > a) return (false, 0);\\n return (true, a - b);\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\\n if (a == 0) return (true, 0);\\n uint256 c = a * b;\\n if (c / a != b) return (false, 0);\\n return (true, c);\\n }\\n\\n /**\\n * @dev Returns the division of two unsigned integers, with a division by zero flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b == 0) return (false, 0);\\n return (true, a / b);\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b == 0) return (false, 0);\\n return (true, a % b);\\n }\\n\\n /**\\n * @dev Returns the addition of two unsigned integers, reverting on\\n * overflow.\\n *\\n * Counterpart to Solidity's `+` operator.\\n *\\n * Requirements:\\n *\\n * - Addition cannot overflow.\\n */\\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\\n uint256 c = a + b;\\n require(c >= a, \\\"SafeMath: addition overflow\\\");\\n return c;\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting on\\n * overflow (when the result is negative).\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n *\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b <= a, \\\"SafeMath: subtraction overflow\\\");\\n return a - b;\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, reverting on\\n * overflow.\\n *\\n * Counterpart to Solidity's `*` operator.\\n *\\n * Requirements:\\n *\\n * - Multiplication cannot overflow.\\n */\\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\\n if (a == 0) return 0;\\n uint256 c = a * b;\\n require(c / a == b, \\\"SafeMath: multiplication overflow\\\");\\n return c;\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers, reverting on\\n * division by zero. The result is rounded towards zero.\\n *\\n * Counterpart to Solidity's `/` operator. Note: this function uses a\\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\\n * uses an invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b > 0, \\\"SafeMath: division by zero\\\");\\n return a / b;\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * reverting when dividing by zero.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b > 0, \\\"SafeMath: modulo by zero\\\");\\n return a % b;\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\\n * overflow (when the result is negative).\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {trySub}.\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n *\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b <= a, errorMessage);\\n return a - b;\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers, reverting with custom message on\\n * division by zero. The result is rounded towards zero.\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {tryDiv}.\\n *\\n * Counterpart to Solidity's `/` operator. Note: this function uses a\\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\\n * uses an invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b > 0, errorMessage);\\n return a / b;\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * reverting with custom message when dividing by zero.\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {tryMod}.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b > 0, errorMessage);\\n return a % b;\\n }\\n}\\n\",\"keccak256\":\"0xcc78a17dd88fa5a2edc60c8489e2f405c0913b377216a5b26b35656b2d0dab52\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `recipient`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address recipient, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `sender` to `recipient` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n}\\n\",\"keccak256\":\"0x5f02220344881ce43204ae4a6281145a67bc52c2bb1290a791857df3d19d78f5\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\nimport \\\"./IERC20.sol\\\";\\nimport \\\"../../math/SafeMath.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @title SafeERC20\\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\\n * contract returns false). Tokens that return no value (and instead revert or\\n * throw on failure) are also supported, non-reverting calls are assumed to be\\n * successful.\\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\n */\\nlibrary SafeERC20 {\\n using SafeMath for uint256;\\n using Address for address;\\n\\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\\n }\\n\\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\\n }\\n\\n /**\\n * @dev Deprecated. This function has issues similar to the ones found in\\n * {IERC20-approve}, and its usage is discouraged.\\n *\\n * Whenever possible, use {safeIncreaseAllowance} and\\n * {safeDecreaseAllowance} instead.\\n */\\n function safeApprove(IERC20 token, address spender, uint256 value) internal {\\n // safeApprove should only be called when setting an initial allowance,\\n // or when resetting it to zero. To increase and decrease it, use\\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\\n // solhint-disable-next-line max-line-length\\n require((value == 0) || (token.allowance(address(this), spender) == 0),\\n \\\"SafeERC20: approve from non-zero to non-zero allowance\\\"\\n );\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\\n }\\n\\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n uint256 newAllowance = token.allowance(address(this), spender).add(value);\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n uint256 newAllowance = token.allowance(address(this), spender).sub(value, \\\"SafeERC20: decreased allowance below zero\\\");\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n */\\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that\\n // the target address contains contract code and also asserts for success in the low-level call.\\n\\n bytes memory returndata = address(token).functionCall(data, \\\"SafeERC20: low-level call failed\\\");\\n if (returndata.length > 0) { // Return data is optional\\n // solhint-disable-next-line max-line-length\\n require(abi.decode(returndata, (bool)), \\\"SafeERC20: ERC20 operation did not succeed\\\");\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf12dfbe97e6276980b83d2830bb0eb75e0cf4f3e626c2471137f82158ae6a0fc\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.2 <0.8.0;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize, which returns 0 for contracts in\\n // construction, since the code is only stored at the end of the\\n // constructor execution.\\n\\n uint256 size;\\n // solhint-disable-next-line no-inline-assembly\\n assembly { size := extcodesize(account) }\\n return size > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls, avoid-call-value\\n (bool success, ) = recipient.call{ value: amount }(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain`call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.call{ value: value }(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x28911e614500ae7c607a432a709d35da25f3bc5ddc8bd12b278b66358070c0ea\",\"license\":\"MIT\"},\"contracts/GraphTokenLock.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nimport \\\"@openzeppelin/contracts/math/SafeMath.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\\\";\\n\\nimport { Ownable as OwnableInitializable } from \\\"./Ownable.sol\\\";\\nimport \\\"./MathUtils.sol\\\";\\nimport \\\"./IGraphTokenLock.sol\\\";\\n\\n/**\\n * @title GraphTokenLock\\n * @notice Contract that manages an unlocking schedule of tokens.\\n * @dev The contract lock manage a number of tokens deposited into the contract to ensure that\\n * they can only be released under certain time conditions.\\n *\\n * This contract implements a release scheduled based on periods and tokens are released in steps\\n * after each period ends. It can be configured with one period in which case it is like a plain TimeLock.\\n * It also supports revocation to be used for vesting schedules.\\n *\\n * The contract supports receiving extra funds than the managed tokens ones that can be\\n * withdrawn by the beneficiary at any time.\\n *\\n * A releaseStartTime parameter is included to override the default release schedule and\\n * perform the first release on the configured time. After that it will continue with the\\n * default schedule.\\n */\\nabstract contract GraphTokenLock is OwnableInitializable, IGraphTokenLock {\\n using SafeMath for uint256;\\n using SafeERC20 for IERC20;\\n\\n uint256 private constant MIN_PERIOD = 1;\\n\\n // -- State --\\n\\n IERC20 public token;\\n address public beneficiary;\\n\\n // Configuration\\n\\n // Amount of tokens managed by the contract schedule\\n uint256 public managedAmount;\\n\\n uint256 public startTime; // Start datetime (in unixtimestamp)\\n uint256 public endTime; // Datetime after all funds are fully vested/unlocked (in unixtimestamp)\\n uint256 public periods; // Number of vesting/release periods\\n\\n // First release date for tokens (in unixtimestamp)\\n // If set, no tokens will be released before releaseStartTime ignoring\\n // the amount to release each period\\n uint256 public releaseStartTime;\\n // A cliff set a date to which a beneficiary needs to get to vest\\n // all preceding periods\\n uint256 public vestingCliffTime;\\n Revocability public revocable; // Whether to use vesting for locked funds\\n\\n // State\\n\\n bool public isRevoked;\\n bool public isInitialized;\\n bool public isAccepted;\\n uint256 public releasedAmount;\\n uint256 public revokedAmount;\\n\\n // -- Events --\\n\\n event TokensReleased(address indexed beneficiary, uint256 amount);\\n event TokensWithdrawn(address indexed beneficiary, uint256 amount);\\n event TokensRevoked(address indexed beneficiary, uint256 amount);\\n event BeneficiaryChanged(address newBeneficiary);\\n event LockAccepted();\\n event LockCanceled();\\n\\n /**\\n * @dev Only allow calls from the beneficiary of the contract\\n */\\n modifier onlyBeneficiary() {\\n require(msg.sender == beneficiary, \\\"!auth\\\");\\n _;\\n }\\n\\n /**\\n * @notice Initializes the contract\\n * @param _owner Address of the contract owner\\n * @param _beneficiary Address of the beneficiary of locked tokens\\n * @param _managedAmount Amount of tokens to be managed by the lock contract\\n * @param _startTime Start time of the release schedule\\n * @param _endTime End time of the release schedule\\n * @param _periods Number of periods between start time and end time\\n * @param _releaseStartTime Override time for when the releases start\\n * @param _vestingCliffTime Override time for when the vesting start\\n * @param _revocable Whether the contract is revocable\\n */\\n function _initialize(\\n address _owner,\\n address _beneficiary,\\n address _token,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n Revocability _revocable\\n ) internal {\\n require(!isInitialized, \\\"Already initialized\\\");\\n require(_owner != address(0), \\\"Owner cannot be zero\\\");\\n require(_beneficiary != address(0), \\\"Beneficiary cannot be zero\\\");\\n require(_token != address(0), \\\"Token cannot be zero\\\");\\n require(_managedAmount > 0, \\\"Managed tokens cannot be zero\\\");\\n require(_startTime != 0, \\\"Start time must be set\\\");\\n require(_startTime < _endTime, \\\"Start time > end time\\\");\\n require(_periods >= MIN_PERIOD, \\\"Periods cannot be below minimum\\\");\\n require(_revocable != Revocability.NotSet, \\\"Must set a revocability option\\\");\\n require(_releaseStartTime < _endTime, \\\"Release start time must be before end time\\\");\\n require(_vestingCliffTime < _endTime, \\\"Cliff time must be before end time\\\");\\n\\n isInitialized = true;\\n\\n OwnableInitializable._initialize(_owner);\\n beneficiary = _beneficiary;\\n token = IERC20(_token);\\n\\n managedAmount = _managedAmount;\\n\\n startTime = _startTime;\\n endTime = _endTime;\\n periods = _periods;\\n\\n // Optionals\\n releaseStartTime = _releaseStartTime;\\n vestingCliffTime = _vestingCliffTime;\\n revocable = _revocable;\\n }\\n\\n /**\\n * @notice Change the beneficiary of funds managed by the contract\\n * @dev Can only be called by the beneficiary\\n * @param _newBeneficiary Address of the new beneficiary address\\n */\\n function changeBeneficiary(address _newBeneficiary) external onlyBeneficiary {\\n require(_newBeneficiary != address(0), \\\"Empty beneficiary\\\");\\n beneficiary = _newBeneficiary;\\n emit BeneficiaryChanged(_newBeneficiary);\\n }\\n\\n /**\\n * @notice Beneficiary accepts the lock, the owner cannot retrieve back the tokens\\n * @dev Can only be called by the beneficiary\\n */\\n function acceptLock() external onlyBeneficiary {\\n isAccepted = true;\\n emit LockAccepted();\\n }\\n\\n /**\\n * @notice Owner cancel the lock and return the balance in the contract\\n * @dev Can only be called by the owner\\n */\\n function cancelLock() external onlyOwner {\\n require(isAccepted == false, \\\"Cannot cancel accepted contract\\\");\\n\\n token.safeTransfer(owner(), currentBalance());\\n\\n emit LockCanceled();\\n }\\n\\n // -- Balances --\\n\\n /**\\n * @notice Returns the amount of tokens currently held by the contract\\n * @return Tokens held in the contract\\n */\\n function currentBalance() public view override returns (uint256) {\\n return token.balanceOf(address(this));\\n }\\n\\n // -- Time & Periods --\\n\\n /**\\n * @notice Returns the current block timestamp\\n * @return Current block timestamp\\n */\\n function currentTime() public view override returns (uint256) {\\n return block.timestamp;\\n }\\n\\n /**\\n * @notice Gets duration of contract from start to end in seconds\\n * @return Amount of seconds from contract startTime to endTime\\n */\\n function duration() public view override returns (uint256) {\\n return endTime.sub(startTime);\\n }\\n\\n /**\\n * @notice Gets time elapsed since the start of the contract\\n * @dev Returns zero if called before conctract starTime\\n * @return Seconds elapsed from contract startTime\\n */\\n function sinceStartTime() public view override returns (uint256) {\\n uint256 current = currentTime();\\n if (current <= startTime) {\\n return 0;\\n }\\n return current.sub(startTime);\\n }\\n\\n /**\\n * @notice Returns amount available to be released after each period according to schedule\\n * @return Amount of tokens available after each period\\n */\\n function amountPerPeriod() public view override returns (uint256) {\\n return managedAmount.div(periods);\\n }\\n\\n /**\\n * @notice Returns the duration of each period in seconds\\n * @return Duration of each period in seconds\\n */\\n function periodDuration() public view override returns (uint256) {\\n return duration().div(periods);\\n }\\n\\n /**\\n * @notice Gets the current period based on the schedule\\n * @return A number that represents the current period\\n */\\n function currentPeriod() public view override returns (uint256) {\\n return sinceStartTime().div(periodDuration()).add(MIN_PERIOD);\\n }\\n\\n /**\\n * @notice Gets the number of periods that passed since the first period\\n * @return A number of periods that passed since the schedule started\\n */\\n function passedPeriods() public view override returns (uint256) {\\n return currentPeriod().sub(MIN_PERIOD);\\n }\\n\\n // -- Locking & Release Schedule --\\n\\n /**\\n * @notice Gets the currently available token according to the schedule\\n * @dev Implements the step-by-step schedule based on periods for available tokens\\n * @return Amount of tokens available according to the schedule\\n */\\n function availableAmount() public view override returns (uint256) {\\n uint256 current = currentTime();\\n\\n // Before contract start no funds are available\\n if (current < startTime) {\\n return 0;\\n }\\n\\n // After contract ended all funds are available\\n if (current > endTime) {\\n return managedAmount;\\n }\\n\\n // Get available amount based on period\\n return passedPeriods().mul(amountPerPeriod());\\n }\\n\\n /**\\n * @notice Gets the amount of currently vested tokens\\n * @dev Similar to available amount, but is fully vested when contract is non-revocable\\n * @return Amount of tokens already vested\\n */\\n function vestedAmount() public view override returns (uint256) {\\n // If non-revocable it is fully vested\\n if (revocable == Revocability.Disabled) {\\n return managedAmount;\\n }\\n\\n // Vesting cliff is activated and it has not passed means nothing is vested yet\\n if (vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\\n return 0;\\n }\\n\\n return availableAmount();\\n }\\n\\n /**\\n * @notice Gets tokens currently available for release\\n * @dev Considers the schedule and takes into account already released tokens\\n * @return Amount of tokens ready to be released\\n */\\n function releasableAmount() public view virtual override returns (uint256) {\\n // If a release start time is set no tokens are available for release before this date\\n // If not set it follows the default schedule and tokens are available on\\n // the first period passed\\n if (releaseStartTime > 0 && currentTime() < releaseStartTime) {\\n return 0;\\n }\\n\\n // Vesting cliff is activated and it has not passed means nothing is vested yet\\n // so funds cannot be released\\n if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\\n return 0;\\n }\\n\\n // A beneficiary can never have more releasable tokens than the contract balance\\n uint256 releasable = availableAmount().sub(releasedAmount);\\n return MathUtils.min(currentBalance(), releasable);\\n }\\n\\n /**\\n * @notice Gets the outstanding amount yet to be released based on the whole contract lifetime\\n * @dev Does not consider schedule but just global amounts tracked\\n * @return Amount of outstanding tokens for the lifetime of the contract\\n */\\n function totalOutstandingAmount() public view override returns (uint256) {\\n return managedAmount.sub(releasedAmount).sub(revokedAmount);\\n }\\n\\n /**\\n * @notice Gets surplus amount in the contract based on outstanding amount to release\\n * @dev All funds over outstanding amount is considered surplus that can be withdrawn by beneficiary.\\n * Note this might not be the correct value for wallets transferred to L2 (i.e. an L2GraphTokenLockWallet), as the released amount will be\\n * skewed, so the beneficiary might have to bridge back to L1 to release the surplus.\\n * @return Amount of tokens considered as surplus\\n */\\n function surplusAmount() public view override returns (uint256) {\\n uint256 balance = currentBalance();\\n uint256 outstandingAmount = totalOutstandingAmount();\\n if (balance > outstandingAmount) {\\n return balance.sub(outstandingAmount);\\n }\\n return 0;\\n }\\n\\n // -- Value Transfer --\\n\\n /**\\n * @notice Releases tokens based on the configured schedule\\n * @dev All available releasable tokens are transferred to beneficiary\\n */\\n function release() external override onlyBeneficiary {\\n uint256 amountToRelease = releasableAmount();\\n require(amountToRelease > 0, \\\"No available releasable amount\\\");\\n\\n releasedAmount = releasedAmount.add(amountToRelease);\\n\\n token.safeTransfer(beneficiary, amountToRelease);\\n\\n emit TokensReleased(beneficiary, amountToRelease);\\n }\\n\\n /**\\n * @notice Withdraws surplus, unmanaged tokens from the contract\\n * @dev Tokens in the contract over outstanding amount are considered as surplus\\n * @param _amount Amount of tokens to withdraw\\n */\\n function withdrawSurplus(uint256 _amount) external override onlyBeneficiary {\\n require(_amount > 0, \\\"Amount cannot be zero\\\");\\n require(surplusAmount() >= _amount, \\\"Amount requested > surplus available\\\");\\n\\n token.safeTransfer(beneficiary, _amount);\\n\\n emit TokensWithdrawn(beneficiary, _amount);\\n }\\n\\n /**\\n * @notice Revokes a vesting schedule and return the unvested tokens to the owner\\n * @dev Vesting schedule is always calculated based on managed tokens\\n */\\n function revoke() external override onlyOwner {\\n require(revocable == Revocability.Enabled, \\\"Contract is non-revocable\\\");\\n require(isRevoked == false, \\\"Already revoked\\\");\\n\\n uint256 unvestedAmount = managedAmount.sub(vestedAmount());\\n require(unvestedAmount > 0, \\\"No available unvested amount\\\");\\n\\n revokedAmount = unvestedAmount;\\n isRevoked = true;\\n\\n token.safeTransfer(owner(), unvestedAmount);\\n\\n emit TokensRevoked(beneficiary, unvestedAmount);\\n }\\n}\\n\",\"keccak256\":\"0xd89470956a476c2fcf4a09625775573f95ba2c60a57fe866d90f65de1bcf5f2d\",\"license\":\"MIT\"},\"contracts/GraphTokenLockWallet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"@openzeppelin/contracts/math/SafeMath.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nimport \\\"./GraphTokenLock.sol\\\";\\nimport \\\"./IGraphTokenLockManager.sol\\\";\\n\\n/**\\n * @title GraphTokenLockWallet\\n * @notice This contract is built on top of the base GraphTokenLock functionality.\\n * It allows wallet beneficiaries to use the deposited funds to perform specific function calls\\n * on specific contracts.\\n *\\n * The idea is that supporters with locked tokens can participate in the protocol\\n * but disallow any release before the vesting/lock schedule.\\n * The beneficiary can issue authorized function calls to this contract that will\\n * get forwarded to a target contract. A target contract is any of our protocol contracts.\\n * The function calls allowed are queried to the GraphTokenLockManager, this way\\n * the same configuration can be shared for all the created lock wallet contracts.\\n *\\n * NOTE: Contracts used as target must have its function signatures checked to avoid collisions\\n * with any of this contract functions.\\n * Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience\\n * the maximum amount of tokens is authorized.\\n * Function calls do not forward ETH value so DO NOT SEND ETH TO THIS CONTRACT.\\n */\\ncontract GraphTokenLockWallet is GraphTokenLock {\\n using SafeMath for uint256;\\n\\n // -- State --\\n\\n IGraphTokenLockManager public manager;\\n uint256 public usedAmount;\\n\\n // -- Events --\\n\\n event ManagerUpdated(address indexed _oldManager, address indexed _newManager);\\n event TokenDestinationsApproved();\\n event TokenDestinationsRevoked();\\n\\n // Initializer\\n function initialize(\\n address _manager,\\n address _owner,\\n address _beneficiary,\\n address _token,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n Revocability _revocable\\n ) external {\\n _initialize(\\n _owner,\\n _beneficiary,\\n _token,\\n _managedAmount,\\n _startTime,\\n _endTime,\\n _periods,\\n _releaseStartTime,\\n _vestingCliffTime,\\n _revocable\\n );\\n _setManager(_manager);\\n }\\n\\n // -- Admin --\\n\\n /**\\n * @notice Sets a new manager for this contract\\n * @param _newManager Address of the new manager\\n */\\n function setManager(address _newManager) external onlyOwner {\\n _setManager(_newManager);\\n }\\n\\n /**\\n * @dev Sets a new manager for this contract\\n * @param _newManager Address of the new manager\\n */\\n function _setManager(address _newManager) internal {\\n require(_newManager != address(0), \\\"Manager cannot be empty\\\");\\n require(Address.isContract(_newManager), \\\"Manager must be a contract\\\");\\n\\n address oldManager = address(manager);\\n manager = IGraphTokenLockManager(_newManager);\\n\\n emit ManagerUpdated(oldManager, _newManager);\\n }\\n\\n // -- Beneficiary --\\n\\n /**\\n * @notice Approves protocol access of the tokens managed by this contract\\n * @dev Approves all token destinations registered in the manager to pull tokens\\n */\\n function approveProtocol() external onlyBeneficiary {\\n address[] memory dstList = manager.getTokenDestinations();\\n for (uint256 i = 0; i < dstList.length; i++) {\\n // Note this is only safe because we are using the max uint256 value\\n token.approve(dstList[i], type(uint256).max);\\n }\\n emit TokenDestinationsApproved();\\n }\\n\\n /**\\n * @notice Revokes protocol access of the tokens managed by this contract\\n * @dev Revokes approval to all token destinations in the manager to pull tokens\\n */\\n function revokeProtocol() external onlyBeneficiary {\\n address[] memory dstList = manager.getTokenDestinations();\\n for (uint256 i = 0; i < dstList.length; i++) {\\n // Note this is only safe cause we're using 0 as the amount\\n token.approve(dstList[i], 0);\\n }\\n emit TokenDestinationsRevoked();\\n }\\n\\n /**\\n * @notice Gets tokens currently available for release\\n * @dev Considers the schedule, takes into account already released tokens and used amount\\n * @return Amount of tokens ready to be released\\n */\\n function releasableAmount() public view override returns (uint256) {\\n if (revocable == Revocability.Disabled) {\\n return super.releasableAmount();\\n }\\n\\n // -- Revocability enabled logic\\n // This needs to deal with additional considerations for when tokens are used in the protocol\\n\\n // If a release start time is set no tokens are available for release before this date\\n // If not set it follows the default schedule and tokens are available on\\n // the first period passed\\n if (releaseStartTime > 0 && currentTime() < releaseStartTime) {\\n return 0;\\n }\\n\\n // Vesting cliff is activated and it has not passed means nothing is vested yet\\n // so funds cannot be released\\n if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\\n return 0;\\n }\\n\\n // A beneficiary can never have more releasable tokens than the contract balance\\n // We consider the `usedAmount` in the protocol as part of the calculations\\n // the beneficiary should not release funds that are used.\\n uint256 releasable = availableAmount().sub(releasedAmount).sub(usedAmount);\\n return MathUtils.min(currentBalance(), releasable);\\n }\\n\\n /**\\n * @notice Forward authorized contract calls to protocol contracts\\n * @dev Fallback function can be called by the beneficiary only if function call is allowed\\n */\\n // solhint-disable-next-line no-complex-fallback\\n fallback() external payable {\\n // Only beneficiary can forward calls\\n require(msg.sender == beneficiary, \\\"Unauthorized caller\\\");\\n require(msg.value == 0, \\\"ETH transfers not supported\\\");\\n\\n // Function call validation\\n address _target = manager.getAuthFunctionCallTarget(msg.sig);\\n require(_target != address(0), \\\"Unauthorized function\\\");\\n\\n uint256 oldBalance = currentBalance();\\n\\n // Call function with data\\n Address.functionCall(_target, msg.data);\\n\\n // Tracked used tokens in the protocol\\n // We do this check after balances were updated by the forwarded call\\n // Check is only enforced for revocable contracts to save some gas\\n if (revocable == Revocability.Enabled) {\\n // Track contract balance change\\n uint256 newBalance = currentBalance();\\n if (newBalance < oldBalance) {\\n // Outflow\\n uint256 diff = oldBalance.sub(newBalance);\\n usedAmount = usedAmount.add(diff);\\n } else {\\n // Inflow: We can receive profits from the protocol, that could make usedAmount to\\n // underflow. We set it to zero in that case.\\n uint256 diff = newBalance.sub(oldBalance);\\n usedAmount = (diff >= usedAmount) ? 0 : usedAmount.sub(diff);\\n }\\n require(usedAmount <= vestedAmount(), \\\"Cannot use more tokens than vested amount\\\");\\n }\\n }\\n\\n /**\\n * @notice Receive function that always reverts.\\n * @dev Only included to supress warnings, see https://github.com/ethereum/solidity/issues/10159\\n */\\n receive() external payable {\\n revert(\\\"Bad call\\\");\\n }\\n}\\n\",\"keccak256\":\"0x976c2ba4c1503a81ea02bd84539c516e99af611ff767968ee25456b50a6deb7b\",\"license\":\"MIT\"},\"contracts/IGraphTokenLock.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\ninterface IGraphTokenLock {\\n enum Revocability {\\n NotSet,\\n Enabled,\\n Disabled\\n }\\n\\n // -- Balances --\\n\\n function currentBalance() external view returns (uint256);\\n\\n // -- Time & Periods --\\n\\n function currentTime() external view returns (uint256);\\n\\n function duration() external view returns (uint256);\\n\\n function sinceStartTime() external view returns (uint256);\\n\\n function amountPerPeriod() external view returns (uint256);\\n\\n function periodDuration() external view returns (uint256);\\n\\n function currentPeriod() external view returns (uint256);\\n\\n function passedPeriods() external view returns (uint256);\\n\\n // -- Locking & Release Schedule --\\n\\n function availableAmount() external view returns (uint256);\\n\\n function vestedAmount() external view returns (uint256);\\n\\n function releasableAmount() external view returns (uint256);\\n\\n function totalOutstandingAmount() external view returns (uint256);\\n\\n function surplusAmount() external view returns (uint256);\\n\\n // -- Value Transfer --\\n\\n function release() external;\\n\\n function withdrawSurplus(uint256 _amount) external;\\n\\n function revoke() external;\\n}\\n\",\"keccak256\":\"0xceb9d258276fe25ec858191e1deae5778f1b2f612a669fb7b37bab1a064756ab\",\"license\":\"MIT\"},\"contracts/IGraphTokenLockManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nimport \\\"./IGraphTokenLock.sol\\\";\\n\\ninterface IGraphTokenLockManager {\\n // -- Factory --\\n\\n function setMasterCopy(address _masterCopy) external;\\n\\n function createTokenLockWallet(\\n address _owner,\\n address _beneficiary,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n IGraphTokenLock.Revocability _revocable\\n ) external;\\n\\n // -- Funds Management --\\n\\n function token() external returns (IERC20);\\n\\n function deposit(uint256 _amount) external;\\n\\n function withdraw(uint256 _amount) external;\\n\\n // -- Allowed Funds Destinations --\\n\\n function addTokenDestination(address _dst) external;\\n\\n function removeTokenDestination(address _dst) external;\\n\\n function isTokenDestination(address _dst) external view returns (bool);\\n\\n function getTokenDestinations() external view returns (address[] memory);\\n\\n // -- Function Call Authorization --\\n\\n function setAuthFunctionCall(string calldata _signature, address _target) external;\\n\\n function unsetAuthFunctionCall(string calldata _signature) external;\\n\\n function setAuthFunctionCallMany(string[] calldata _signatures, address[] calldata _targets) external;\\n\\n function getAuthFunctionCallTarget(bytes4 _sigHash) external view returns (address);\\n\\n function isAuthFunctionCall(bytes4 _sigHash) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x2d78d41909a6de5b316ac39b100ea087a8f317cf306379888a045523e15c4d9a\",\"license\":\"MIT\"},\"contracts/MathUtils.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nlibrary MathUtils {\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n}\\n\",\"keccak256\":\"0xe2512e1da48bc8363acd15f66229564b02d66706665d7da740604566913c1400\",\"license\":\"MIT\"},\"contracts/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * The owner account will be passed on initialization of the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\ncontract Ownable {\\n /// @dev Owner of the contract, can be retrieved with the public owner() function\\n address private _owner;\\n /// @dev Since upgradeable contracts might inherit this, we add a storage gap\\n /// to allow adding variables here without breaking the proxy storage layout\\n uint256[50] private __gap;\\n\\n /// @dev Emitted when ownership of the contract is transferred\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n function _initialize(address owner) internal {\\n _owner = owner;\\n emit OwnershipTransferred(address(0), owner);\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(_owner == msg.sender, \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() external virtual onlyOwner {\\n emit OwnershipTransferred(_owner, address(0));\\n _owner = address(0);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) external virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n emit OwnershipTransferred(_owner, newOwner);\\n _owner = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0xe8750687082e8e24b620dbf58c3a08eee591ed7b4d5a3e13cc93554ec647fd09\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b506146bb806100206000396000f3fe6080604052600436106102555760003560e01c806386d00e0211610139578063bc0163c1116100b6578063dc0706571161007a578063dc07065714610b93578063e8dda6f514610bbc578063e97d87d514610be7578063ebbab99214610c12578063f2fde38b14610c3d578063fc0c546a14610c6657610295565b8063bc0163c114610ac0578063bd896dcb14610aeb578063ce845d1d14610b14578063d0ebdbe714610b3f578063d18e81b314610b6857610295565b806391f7cfb9116100fd57806391f7cfb9146109ff578063a4caeb4214610a2a578063b0d1818c14610a55578063b470aade14610a7e578063b6549f7514610aa957610295565b806386d00e021461095057806386d1a69f1461097b578063872a7810146109925780638a5bdf5c146109bd5780638da5cb5b146109d457610295565b8063392e53cd116101d25780635051a5ec116101965780635051a5ec146108765780635b940081146108a157806360e79944146108cc578063715018a6146108e357806378e97925146108fa5780637bdf05af1461092557610295565b8063392e53cd1461079f578063398057a3146107ca57806344b1231f146107f557806345d30a1714610820578063481c6a751461084b57610295565b80632a627814116102195780632a627814146106dc5780632bc9ed02146106f35780633197cbb61461071e57806337aeb0861461074957806338af3eed1461077457610295565b8063029c6c9f1461061957806306040618146106445780630b80f7771461066f5780630dff24d5146106865780630fb5a6b4146106b157610295565b36610295576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161028c90613fb9565b60405180910390fd5b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610325576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161031c90614199565b60405180910390fd5b60003414610368576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161035f90613fd9565b60405180910390fd5b6000603e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f1d24c456000357fffffffff00000000000000000000000000000000000000000000000000000000166040518263ffffffff1660e01b81526004016103e99190613f2b565b60206040518083038186803b15801561040157600080fd5b505afa158015610415573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061043991906131a5565b9050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156104ab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104a290614299565b60405180910390fd5b60006104b5610c91565b9050610506826000368080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610d43565b506001600281111561051457fe5b603b60009054906101000a900460ff16600281111561052f57fe5b141561061557600061053f610c91565b90508181101561058157600061055e8284610d8d90919063ffffffff16565b905061057581603f54610ddd90919063ffffffff16565b603f81905550506105c7565b60006105968383610d8d90919063ffffffff16565b9050603f548110156105bc576105b781603f54610d8d90919063ffffffff16565b6105bf565b60005b603f81905550505b6105cf610e32565b603f541115610613576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161060a906141f9565b60405180910390fd5b505b5050005b34801561062557600080fd5b5061062e610ea1565b60405161063b9190614439565b60405180910390f35b34801561065057600080fd5b50610659610ebf565b6040516106669190614439565b60405180910390f35b34801561067b57600080fd5b50610684610efa565b005b34801561069257600080fd5b5061069b611067565b6040516106a89190614439565b60405180910390f35b3480156106bd57600080fd5b506106c66110ae565b6040516106d39190614439565b60405180910390f35b3480156106e857600080fd5b506106f16110cc565b005b3480156106ff57600080fd5b50610708611331565b6040516107159190613f10565b60405180910390f35b34801561072a57600080fd5b50610733611344565b6040516107409190614439565b60405180910390f35b34801561075557600080fd5b5061075e61134a565b60405161076b9190614439565b60405180910390f35b34801561078057600080fd5b50610789611350565b6040516107969190613ea3565b60405180910390f35b3480156107ab57600080fd5b506107b4611376565b6040516107c19190613f10565b60405180910390f35b3480156107d657600080fd5b506107df611389565b6040516107ec9190614439565b60405180910390f35b34801561080157600080fd5b5061080a610e32565b6040516108179190614439565b60405180910390f35b34801561082c57600080fd5b5061083561138f565b6040516108429190614439565b60405180910390f35b34801561085757600080fd5b50610860611395565b60405161086d9190613f61565b60405180910390f35b34801561088257600080fd5b5061088b6113bb565b6040516108989190613f10565b60405180910390f35b3480156108ad57600080fd5b506108b66113ce565b6040516108c39190614439565b60405180910390f35b3480156108d857600080fd5b506108e16114d9565b005b3480156108ef57600080fd5b506108f861171f565b005b34801561090657600080fd5b5061090f61186b565b60405161091c9190614439565b60405180910390f35b34801561093157600080fd5b5061093a611871565b6040516109479190614439565b60405180910390f35b34801561095c57600080fd5b506109656118ad565b6040516109729190614439565b60405180910390f35b34801561098757600080fd5b506109906118b3565b005b34801561099e57600080fd5b506109a7611a8f565b6040516109b49190613f7c565b60405180910390f35b3480156109c957600080fd5b506109d2611aa2565b005b3480156109e057600080fd5b506109e9611b7b565b6040516109f69190613ea3565b60405180910390f35b348015610a0b57600080fd5b50610a14611ba4565b604051610a219190614439565b60405180910390f35b348015610a3657600080fd5b50610a3f611c02565b604051610a4c9190614439565b60405180910390f35b348015610a6157600080fd5b50610a7c6004803603810190610a779190613328565b611c08565b005b348015610a8a57600080fd5b50610a93611e07565b604051610aa09190614439565b60405180910390f35b348015610ab557600080fd5b50610abe611e2a565b005b348015610acc57600080fd5b50610ad56120c2565b604051610ae29190614439565b60405180910390f35b348015610af757600080fd5b50610b126004803603810190610b0d91906131ce565b6120f4565b005b348015610b2057600080fd5b50610b29610c91565b604051610b369190614439565b60405180910390f35b348015610b4b57600080fd5b50610b666004803603810190610b61919061317c565b61211c565b005b348015610b7457600080fd5b50610b7d6121b6565b604051610b8a9190614439565b60405180910390f35b348015610b9f57600080fd5b50610bba6004803603810190610bb5919061317c565b6121be565b005b348015610bc857600080fd5b50610bd1612339565b604051610bde9190614439565b60405180910390f35b348015610bf357600080fd5b50610bfc61233f565b604051610c099190614439565b60405180910390f35b348015610c1e57600080fd5b50610c27612345565b604051610c349190614439565b60405180910390f35b348015610c4957600080fd5b50610c646004803603810190610c5f919061317c565b612367565b005b348015610c7257600080fd5b50610c7b612522565b604051610c889190613f46565b60405180910390f35b6000603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610cee9190613ea3565b60206040518083038186803b158015610d0657600080fd5b505afa158015610d1a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d3e9190613351565b905090565b6060610d8583836040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c65640000815250612548565b905092915050565b600082821115610dd2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dc9906140f9565b60405180910390fd5b818303905092915050565b600080828401905083811015610e28576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e1f90614079565b60405180910390fd5b8091505092915050565b6000600280811115610e4057fe5b603b60009054906101000a900460ff166002811115610e5b57fe5b1415610e6b576035549050610e9e565b6000603a54118015610e855750603a54610e836121b6565b105b15610e935760009050610e9e565b610e9b611ba4565b90505b90565b6000610eba60385460355461256090919063ffffffff16565b905090565b6000610ef56001610ee7610ed1611e07565b610ed9611871565b61256090919063ffffffff16565b610ddd90919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f88576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f7f90614259565b60405180910390fd5b60001515603b60039054906101000a900460ff16151514610fde576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fd5906140d9565b60405180910390fd5b611039610fe9611b7b565b610ff1610c91565b603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166125b69092919063ffffffff16565b7f171f0bcbda3370351cea17f3b164bee87d77c2503b94abdf2720a814ebe7e9df60405160405180910390a1565b600080611072610c91565b9050600061107e6120c2565b9050808211156110a45761109b8183610d8d90919063ffffffff16565b925050506110ab565b6000925050505b90565b60006110c7603654603754610d8d90919063ffffffff16565b905090565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461115c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115390614359565b60405180910390fd5b6060603e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a34574666040518163ffffffff1660e01b815260040160006040518083038186803b1580156111c657600080fd5b505afa1580156111da573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525081019061120391906132be565b905060005b815181101561130157603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b383838151811061125b57fe5b60200260200101517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016112a1929190613ee7565b602060405180830381600087803b1580156112bb57600080fd5b505af11580156112cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112f391906132ff565b508080600101915050611208565b507fb837fd51506ba3cc623a37c78ed22fd521f2f6e9f69a34d5c2a4a9474f27579360405160405180910390a150565b603b60019054906101000a900460ff1681565b60375481565b603d5481565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b603b60029054906101000a900460ff1681565b60355481565b603c5481565b603e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b603b60039054906101000a900460ff1681565b60006002808111156113dc57fe5b603b60009054906101000a900460ff1660028111156113f757fe5b141561140c5761140561263c565b90506114d6565b600060395411801561142657506039546114246121b6565b105b1561143457600090506114d6565b6001600281111561144157fe5b603b60009054906101000a900460ff16600281111561145c57fe5b14801561146b57506000603a54115b801561147f5750603a5461147d6121b6565b105b1561148d57600090506114d6565b60006114bf603f546114b1603c546114a3611ba4565b610d8d90919063ffffffff16565b610d8d90919063ffffffff16565b90506114d26114cc610c91565b826126f6565b9150505b90565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611569576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161156090614359565b60405180910390fd5b6060603e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a34574666040518163ffffffff1660e01b815260040160006040518083038186803b1580156115d357600080fd5b505afa1580156115e7573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525081019061161091906132be565b905060005b81518110156116ef57603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b383838151811061166857fe5b602002602001015160006040518363ffffffff1660e01b815260040161168f929190613ebe565b602060405180830381600087803b1580156116a957600080fd5b505af11580156116bd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116e191906132ff565b508080600101915050611615565b507f6d317a20ba9d790014284bef285283cd61fde92e0f2711050f563a9d2cf4171160405160405180910390a150565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146117ad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117a490614259565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60365481565b60008061187c6121b6565b905060365481116118915760009150506118aa565b6118a660365482610d8d90919063ffffffff16565b9150505b90565b603a5481565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611943576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161193a90614359565b60405180910390fd5b600061194d6113ce565b905060008111611992576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611989906143b9565b60405180910390fd5b6119a781603c54610ddd90919063ffffffff16565b603c81905550611a1c603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166125b69092919063ffffffff16565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fc7798891864187665ac6dd119286e44ec13f014527aeeb2b8eb3fd413df9317982604051611a849190614439565b60405180910390a250565b603b60009054906101000a900460ff1681565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611b32576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b2990614359565b60405180910390fd5b6001603b60036101000a81548160ff0219169083151502179055507fbeb3313724453131feb0a765a03e6715bb720e0f973a31fcbafa2d2f048c188b60405160405180910390a1565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600080611baf6121b6565b9050603654811015611bc5576000915050611bff565b603754811115611bda57603554915050611bff565b611bfb611be5610ea1565b611bed612345565b61270f90919063ffffffff16565b9150505b90565b60385481565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611c98576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c8f90614359565b60405180910390fd5b60008111611cdb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cd2906141d9565b60405180910390fd5b80611ce4611067565b1015611d25576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d1c906142d9565b60405180910390fd5b611d94603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166125b69092919063ffffffff16565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b82604051611dfc9190614439565b60405180910390a250565b6000611e25603854611e176110ae565b61256090919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611eb8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611eaf90614259565b60405180910390fd5b60016002811115611ec557fe5b603b60009054906101000a900460ff166002811115611ee057fe5b14611f20576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f1790614319565b60405180910390fd5b60001515603b60019054906101000a900460ff16151514611f76576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f6d90614419565b60405180910390fd5b6000611f94611f83610e32565b603554610d8d90919063ffffffff16565b905060008111611fd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fd090614099565b60405180910390fd5b80603d819055506001603b60016101000a81548160ff02191690831515021790555061204f612006611b7b565b82603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166125b69092919063ffffffff16565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fb73c49a3a37a7aca291ba0ceaa41657012def406106a7fc386888f0f66e941cf826040516120b79190614439565b60405180910390a250565b60006120ef603d546120e1603c54603554610d8d90919063ffffffff16565b610d8d90919063ffffffff16565b905090565b6121068a8a8a8a8a8a8a8a8a8a61277f565b61210f8b612c09565b5050505050505050505050565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146121aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121a190614259565b60405180910390fd5b6121b381612c09565b50565b600042905090565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461224e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161224590614359565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156122be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122b590614179565b60405180910390fd5b80603460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f373c72efabe4ef3e552ff77838be729f3bc3d8c586df0012902d1baa2377fa1d8160405161232e9190613ea3565b60405180910390a150565b603f5481565b60395481565b60006123626001612354610ebf565b610d8d90919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146123f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123ec90614259565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612465576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161245c90614059565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60606125578484600085612d87565b90509392505050565b60008082116125a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161259b90614159565b60405180910390fd5b8183816125ad57fe5b04905092915050565b6126378363a9059cbb60e01b84846040516024016125d5929190613ee7565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050612e9c565b505050565b60008060395411801561265757506039546126556121b6565b105b1561266557600090506126f3565b6001600281111561267257fe5b603b60009054906101000a900460ff16600281111561268d57fe5b14801561269c57506000603a54115b80156126b05750603a546126ae6121b6565b105b156126be57600090506126f3565b60006126dc603c546126ce611ba4565b610d8d90919063ffffffff16565b90506126ef6126e9610c91565b826126f6565b9150505b90565b60008183106127055781612707565b825b905092915050565b6000808314156127225760009050612779565b600082840290508284828161273357fe5b0414612774576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161276b90614239565b60405180910390fd5b809150505b92915050565b603b60029054906101000a900460ff16156127cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127c6906142f9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff16141561283f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612836906140b9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff1614156128af576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128a6906143f9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff16141561291f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612916906143d9565b60405180910390fd5b60008711612962576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161295990614139565b60405180910390fd5b60008614156129a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161299d90614279565b60405180910390fd5b8486106129e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129df90614019565b60405180910390fd5b6001841015612a2c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a2390614219565b60405180910390fd5b60006002811115612a3957fe5b816002811115612a4557fe5b1415612a86576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a7d90614039565b60405180910390fd5b848310612ac8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612abf90614379565b60405180910390fd5b848210612b0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b0190613ff9565b60405180910390fd5b6001603b60026101000a81548160ff021916908315150217905550612b2e8a612f63565b88603460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555087603360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550866035819055508560368190555084603781905550836038819055508260398190555081603a8190555080603b60006101000a81548160ff02191690836002811115612bf857fe5b021790555050505050505050505050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612c79576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c7090614339565b60405180910390fd5b612c8281613001565b612cc1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612cb8906141b9565b60405180910390fd5b6000603e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081603e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fdac3632743b879638fd2d51c4d3c1dd796615b4758a55b50b0c19b971ba9fbc760405160405180910390a35050565b606082471015612dcc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612dc390614119565b60405180910390fd5b612dd585613001565b612e14576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e0b906142b9565b60405180910390fd5b600060608673ffffffffffffffffffffffffffffffffffffffff168587604051612e3e9190613e8c565b60006040518083038185875af1925050503d8060008114612e7b576040519150601f19603f3d011682016040523d82523d6000602084013e612e80565b606091505b5091509150612e90828286613014565b92505050949350505050565b6060612efe826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166125489092919063ffffffff16565b9050600081511115612f5e5780806020019051810190612f1e91906132ff565b612f5d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612f5490614399565b60405180910390fd5b5b505050565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a350565b600080823b905060008111915050919050565b6060831561302457829050613074565b6000835111156130375782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161306b9190613f97565b60405180910390fd5b9392505050565b60008135905061308a81614630565b92915050565b60008151905061309f81614630565b92915050565b600082601f8301126130b657600080fd5b81516130c96130c482614485565b614454565b915081818352602084019350602081019050838560208402820111156130ee57600080fd5b60005b8381101561311e57816131048882613090565b8452602084019350602083019250506001810190506130f1565b5050505092915050565b60008151905061313781614647565b92915050565b60008135905061314c8161465e565b92915050565b6000813590506131618161466e565b92915050565b6000815190506131768161466e565b92915050565b60006020828403121561318e57600080fd5b600061319c8482850161307b565b91505092915050565b6000602082840312156131b757600080fd5b60006131c584828501613090565b91505092915050565b60008060008060008060008060008060006101608c8e0312156131f057600080fd5b60006131fe8e828f0161307b565b9b5050602061320f8e828f0161307b565b9a505060406132208e828f0161307b565b99505060606132318e828f0161307b565b98505060806132428e828f01613152565b97505060a06132538e828f01613152565b96505060c06132648e828f01613152565b95505060e06132758e828f01613152565b9450506101006132878e828f01613152565b9350506101206132998e828f01613152565b9250506101406132ab8e828f0161313d565b9150509295989b509295989b9093969950565b6000602082840312156132d057600080fd5b600082015167ffffffffffffffff8111156132ea57600080fd5b6132f6848285016130a5565b91505092915050565b60006020828403121561331157600080fd5b600061331f84828501613128565b91505092915050565b60006020828403121561333a57600080fd5b600061334884828501613152565b91505092915050565b60006020828403121561336357600080fd5b600061337184828501613167565b91505092915050565b613383816144e3565b82525050565b613392816144f5565b82525050565b6133a181614501565b82525050565b60006133b2826144b1565b6133bc81856144c7565b93506133cc8185602086016145d6565b80840191505092915050565b6133e18161456a565b82525050565b6133f08161458e565b82525050565b6133ff816145b2565b82525050565b61340e816145c4565b82525050565b600061341f826144bc565b61342981856144d2565b93506134398185602086016145d6565b6134428161460b565b840191505092915050565b600061345a6008836144d2565b91507f4261642063616c6c0000000000000000000000000000000000000000000000006000830152602082019050919050565b600061349a601b836144d2565b91507f455448207472616e7366657273206e6f7420737570706f7274656400000000006000830152602082019050919050565b60006134da6022836144d2565b91507f436c6966662074696d65206d757374206265206265666f726520656e6420746960008301527f6d650000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006135406015836144d2565b91507f53746172742074696d65203e20656e642074696d6500000000000000000000006000830152602082019050919050565b6000613580601e836144d2565b91507f4d757374207365742061207265766f636162696c697479206f7074696f6e00006000830152602082019050919050565b60006135c06026836144d2565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613626601b836144d2565b91507f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006000830152602082019050919050565b6000613666601c836144d2565b91507f4e6f20617661696c61626c6520756e76657374656420616d6f756e74000000006000830152602082019050919050565b60006136a66014836144d2565b91507f4f776e65722063616e6e6f74206265207a65726f0000000000000000000000006000830152602082019050919050565b60006136e6601f836144d2565b91507f43616e6e6f742063616e63656c20616363657074656420636f6e7472616374006000830152602082019050919050565b6000613726601e836144d2565b91507f536166654d6174683a207375627472616374696f6e206f766572666c6f7700006000830152602082019050919050565b60006137666026836144d2565b91507f416464726573733a20696e73756666696369656e742062616c616e636520666f60008301527f722063616c6c00000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006137cc601d836144d2565b91507f4d616e6167656420746f6b656e732063616e6e6f74206265207a65726f0000006000830152602082019050919050565b600061380c601a836144d2565b91507f536166654d6174683a206469766973696f6e206279207a65726f0000000000006000830152602082019050919050565b600061384c6011836144d2565b91507f456d7074792062656e65666963696172790000000000000000000000000000006000830152602082019050919050565b600061388c6013836144d2565b91507f556e617574686f72697a65642063616c6c6572000000000000000000000000006000830152602082019050919050565b60006138cc601a836144d2565b91507f4d616e61676572206d757374206265206120636f6e74726163740000000000006000830152602082019050919050565b600061390c6015836144d2565b91507f416d6f756e742063616e6e6f74206265207a65726f00000000000000000000006000830152602082019050919050565b600061394c6029836144d2565b91507f43616e6e6f7420757365206d6f726520746f6b656e73207468616e207665737460008301527f656420616d6f756e7400000000000000000000000000000000000000000000006020830152604082019050919050565b60006139b2601f836144d2565b91507f506572696f64732063616e6e6f742062652062656c6f77206d696e696d756d006000830152602082019050919050565b60006139f26021836144d2565b91507f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008301527f77000000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613a586020836144d2565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b6000613a986016836144d2565b91507f53746172742074696d65206d75737420626520736574000000000000000000006000830152602082019050919050565b6000613ad86015836144d2565b91507f556e617574686f72697a65642066756e6374696f6e00000000000000000000006000830152602082019050919050565b6000613b18601d836144d2565b91507f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006000830152602082019050919050565b6000613b586024836144d2565b91507f416d6f756e7420726571756573746564203e20737572706c757320617661696c60008301527f61626c65000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613bbe6013836144d2565b91507f416c726561647920696e697469616c697a6564000000000000000000000000006000830152602082019050919050565b6000613bfe6019836144d2565b91507f436f6e7472616374206973206e6f6e2d7265766f6361626c65000000000000006000830152602082019050919050565b6000613c3e6017836144d2565b91507f4d616e616765722063616e6e6f7420626520656d7074790000000000000000006000830152602082019050919050565b6000613c7e6005836144d2565b91507f21617574680000000000000000000000000000000000000000000000000000006000830152602082019050919050565b6000613cbe602a836144d2565b91507f52656c656173652073746172742074696d65206d757374206265206265666f7260008301527f6520656e642074696d65000000000000000000000000000000000000000000006020830152604082019050919050565b6000613d24602a836144d2565b91507f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008301527f6f742073756363656564000000000000000000000000000000000000000000006020830152604082019050919050565b6000613d8a601e836144d2565b91507f4e6f20617661696c61626c652072656c65617361626c6520616d6f756e7400006000830152602082019050919050565b6000613dca6014836144d2565b91507f546f6b656e2063616e6e6f74206265207a65726f0000000000000000000000006000830152602082019050919050565b6000613e0a601a836144d2565b91507f42656e65666963696172792063616e6e6f74206265207a65726f0000000000006000830152602082019050919050565b6000613e4a600f836144d2565b91507f416c7265616479207265766f6b656400000000000000000000000000000000006000830152602082019050919050565b613e8681614560565b82525050565b6000613e9882846133a7565b915081905092915050565b6000602082019050613eb8600083018461337a565b92915050565b6000604082019050613ed3600083018561337a565b613ee06020830184613405565b9392505050565b6000604082019050613efc600083018561337a565b613f096020830184613e7d565b9392505050565b6000602082019050613f256000830184613389565b92915050565b6000602082019050613f406000830184613398565b92915050565b6000602082019050613f5b60008301846133d8565b92915050565b6000602082019050613f7660008301846133e7565b92915050565b6000602082019050613f9160008301846133f6565b92915050565b60006020820190508181036000830152613fb18184613414565b905092915050565b60006020820190508181036000830152613fd28161344d565b9050919050565b60006020820190508181036000830152613ff28161348d565b9050919050565b60006020820190508181036000830152614012816134cd565b9050919050565b6000602082019050818103600083015261403281613533565b9050919050565b6000602082019050818103600083015261405281613573565b9050919050565b60006020820190508181036000830152614072816135b3565b9050919050565b6000602082019050818103600083015261409281613619565b9050919050565b600060208201905081810360008301526140b281613659565b9050919050565b600060208201905081810360008301526140d281613699565b9050919050565b600060208201905081810360008301526140f2816136d9565b9050919050565b6000602082019050818103600083015261411281613719565b9050919050565b6000602082019050818103600083015261413281613759565b9050919050565b60006020820190508181036000830152614152816137bf565b9050919050565b60006020820190508181036000830152614172816137ff565b9050919050565b600060208201905081810360008301526141928161383f565b9050919050565b600060208201905081810360008301526141b28161387f565b9050919050565b600060208201905081810360008301526141d2816138bf565b9050919050565b600060208201905081810360008301526141f2816138ff565b9050919050565b600060208201905081810360008301526142128161393f565b9050919050565b60006020820190508181036000830152614232816139a5565b9050919050565b60006020820190508181036000830152614252816139e5565b9050919050565b6000602082019050818103600083015261427281613a4b565b9050919050565b6000602082019050818103600083015261429281613a8b565b9050919050565b600060208201905081810360008301526142b281613acb565b9050919050565b600060208201905081810360008301526142d281613b0b565b9050919050565b600060208201905081810360008301526142f281613b4b565b9050919050565b6000602082019050818103600083015261431281613bb1565b9050919050565b6000602082019050818103600083015261433281613bf1565b9050919050565b6000602082019050818103600083015261435281613c31565b9050919050565b6000602082019050818103600083015261437281613c71565b9050919050565b6000602082019050818103600083015261439281613cb1565b9050919050565b600060208201905081810360008301526143b281613d17565b9050919050565b600060208201905081810360008301526143d281613d7d565b9050919050565b600060208201905081810360008301526143f281613dbd565b9050919050565b6000602082019050818103600083015261441281613dfd565b9050919050565b6000602082019050818103600083015261443281613e3d565b9050919050565b600060208201905061444e6000830184613e7d565b92915050565b6000604051905081810181811067ffffffffffffffff8211171561447b5761447a614609565b5b8060405250919050565b600067ffffffffffffffff8211156144a05761449f614609565b5b602082029050602081019050919050565b600081519050919050565b600081519050919050565b600081905092915050565b600082825260208201905092915050565b60006144ee82614540565b9050919050565b60008115159050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600081905061453b8261461c565b919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60006145758261457c565b9050919050565b600061458782614540565b9050919050565b6000614599826145a0565b9050919050565b60006145ab82614540565b9050919050565b60006145bd8261452d565b9050919050565b60006145cf82614560565b9050919050565b60005b838110156145f45780820151818401526020810190506145d9565b83811115614603576000848401525b50505050565bfe5b6000601f19601f8301169050919050565b6003811061462d5761462c614609565b5b50565b614639816144e3565b811461464457600080fd5b50565b614650816144f5565b811461465b57600080fd5b50565b6003811061466b57600080fd5b50565b61467781614560565b811461468257600080fd5b5056fea264697066735822122013f3b022e354ddf49f7a28727f309f858a5cbdf70833a2e54da3c1a482b7073164736f6c63430007030033", + "deployedBytecode": "0x6080604052600436106102555760003560e01c806386d00e0211610139578063bc0163c1116100b6578063dc0706571161007a578063dc07065714610b93578063e8dda6f514610bbc578063e97d87d514610be7578063ebbab99214610c12578063f2fde38b14610c3d578063fc0c546a14610c6657610295565b8063bc0163c114610ac0578063bd896dcb14610aeb578063ce845d1d14610b14578063d0ebdbe714610b3f578063d18e81b314610b6857610295565b806391f7cfb9116100fd57806391f7cfb9146109ff578063a4caeb4214610a2a578063b0d1818c14610a55578063b470aade14610a7e578063b6549f7514610aa957610295565b806386d00e021461095057806386d1a69f1461097b578063872a7810146109925780638a5bdf5c146109bd5780638da5cb5b146109d457610295565b8063392e53cd116101d25780635051a5ec116101965780635051a5ec146108765780635b940081146108a157806360e79944146108cc578063715018a6146108e357806378e97925146108fa5780637bdf05af1461092557610295565b8063392e53cd1461079f578063398057a3146107ca57806344b1231f146107f557806345d30a1714610820578063481c6a751461084b57610295565b80632a627814116102195780632a627814146106dc5780632bc9ed02146106f35780633197cbb61461071e57806337aeb0861461074957806338af3eed1461077457610295565b8063029c6c9f1461061957806306040618146106445780630b80f7771461066f5780630dff24d5146106865780630fb5a6b4146106b157610295565b36610295576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161028c90613fb9565b60405180910390fd5b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610325576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161031c90614199565b60405180910390fd5b60003414610368576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161035f90613fd9565b60405180910390fd5b6000603e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f1d24c456000357fffffffff00000000000000000000000000000000000000000000000000000000166040518263ffffffff1660e01b81526004016103e99190613f2b565b60206040518083038186803b15801561040157600080fd5b505afa158015610415573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061043991906131a5565b9050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156104ab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104a290614299565b60405180910390fd5b60006104b5610c91565b9050610506826000368080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610d43565b506001600281111561051457fe5b603b60009054906101000a900460ff16600281111561052f57fe5b141561061557600061053f610c91565b90508181101561058157600061055e8284610d8d90919063ffffffff16565b905061057581603f54610ddd90919063ffffffff16565b603f81905550506105c7565b60006105968383610d8d90919063ffffffff16565b9050603f548110156105bc576105b781603f54610d8d90919063ffffffff16565b6105bf565b60005b603f81905550505b6105cf610e32565b603f541115610613576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161060a906141f9565b60405180910390fd5b505b5050005b34801561062557600080fd5b5061062e610ea1565b60405161063b9190614439565b60405180910390f35b34801561065057600080fd5b50610659610ebf565b6040516106669190614439565b60405180910390f35b34801561067b57600080fd5b50610684610efa565b005b34801561069257600080fd5b5061069b611067565b6040516106a89190614439565b60405180910390f35b3480156106bd57600080fd5b506106c66110ae565b6040516106d39190614439565b60405180910390f35b3480156106e857600080fd5b506106f16110cc565b005b3480156106ff57600080fd5b50610708611331565b6040516107159190613f10565b60405180910390f35b34801561072a57600080fd5b50610733611344565b6040516107409190614439565b60405180910390f35b34801561075557600080fd5b5061075e61134a565b60405161076b9190614439565b60405180910390f35b34801561078057600080fd5b50610789611350565b6040516107969190613ea3565b60405180910390f35b3480156107ab57600080fd5b506107b4611376565b6040516107c19190613f10565b60405180910390f35b3480156107d657600080fd5b506107df611389565b6040516107ec9190614439565b60405180910390f35b34801561080157600080fd5b5061080a610e32565b6040516108179190614439565b60405180910390f35b34801561082c57600080fd5b5061083561138f565b6040516108429190614439565b60405180910390f35b34801561085757600080fd5b50610860611395565b60405161086d9190613f61565b60405180910390f35b34801561088257600080fd5b5061088b6113bb565b6040516108989190613f10565b60405180910390f35b3480156108ad57600080fd5b506108b66113ce565b6040516108c39190614439565b60405180910390f35b3480156108d857600080fd5b506108e16114d9565b005b3480156108ef57600080fd5b506108f861171f565b005b34801561090657600080fd5b5061090f61186b565b60405161091c9190614439565b60405180910390f35b34801561093157600080fd5b5061093a611871565b6040516109479190614439565b60405180910390f35b34801561095c57600080fd5b506109656118ad565b6040516109729190614439565b60405180910390f35b34801561098757600080fd5b506109906118b3565b005b34801561099e57600080fd5b506109a7611a8f565b6040516109b49190613f7c565b60405180910390f35b3480156109c957600080fd5b506109d2611aa2565b005b3480156109e057600080fd5b506109e9611b7b565b6040516109f69190613ea3565b60405180910390f35b348015610a0b57600080fd5b50610a14611ba4565b604051610a219190614439565b60405180910390f35b348015610a3657600080fd5b50610a3f611c02565b604051610a4c9190614439565b60405180910390f35b348015610a6157600080fd5b50610a7c6004803603810190610a779190613328565b611c08565b005b348015610a8a57600080fd5b50610a93611e07565b604051610aa09190614439565b60405180910390f35b348015610ab557600080fd5b50610abe611e2a565b005b348015610acc57600080fd5b50610ad56120c2565b604051610ae29190614439565b60405180910390f35b348015610af757600080fd5b50610b126004803603810190610b0d91906131ce565b6120f4565b005b348015610b2057600080fd5b50610b29610c91565b604051610b369190614439565b60405180910390f35b348015610b4b57600080fd5b50610b666004803603810190610b61919061317c565b61211c565b005b348015610b7457600080fd5b50610b7d6121b6565b604051610b8a9190614439565b60405180910390f35b348015610b9f57600080fd5b50610bba6004803603810190610bb5919061317c565b6121be565b005b348015610bc857600080fd5b50610bd1612339565b604051610bde9190614439565b60405180910390f35b348015610bf357600080fd5b50610bfc61233f565b604051610c099190614439565b60405180910390f35b348015610c1e57600080fd5b50610c27612345565b604051610c349190614439565b60405180910390f35b348015610c4957600080fd5b50610c646004803603810190610c5f919061317c565b612367565b005b348015610c7257600080fd5b50610c7b612522565b604051610c889190613f46565b60405180910390f35b6000603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610cee9190613ea3565b60206040518083038186803b158015610d0657600080fd5b505afa158015610d1a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d3e9190613351565b905090565b6060610d8583836040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c65640000815250612548565b905092915050565b600082821115610dd2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dc9906140f9565b60405180910390fd5b818303905092915050565b600080828401905083811015610e28576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e1f90614079565b60405180910390fd5b8091505092915050565b6000600280811115610e4057fe5b603b60009054906101000a900460ff166002811115610e5b57fe5b1415610e6b576035549050610e9e565b6000603a54118015610e855750603a54610e836121b6565b105b15610e935760009050610e9e565b610e9b611ba4565b90505b90565b6000610eba60385460355461256090919063ffffffff16565b905090565b6000610ef56001610ee7610ed1611e07565b610ed9611871565b61256090919063ffffffff16565b610ddd90919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f88576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f7f90614259565b60405180910390fd5b60001515603b60039054906101000a900460ff16151514610fde576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fd5906140d9565b60405180910390fd5b611039610fe9611b7b565b610ff1610c91565b603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166125b69092919063ffffffff16565b7f171f0bcbda3370351cea17f3b164bee87d77c2503b94abdf2720a814ebe7e9df60405160405180910390a1565b600080611072610c91565b9050600061107e6120c2565b9050808211156110a45761109b8183610d8d90919063ffffffff16565b925050506110ab565b6000925050505b90565b60006110c7603654603754610d8d90919063ffffffff16565b905090565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461115c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115390614359565b60405180910390fd5b6060603e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a34574666040518163ffffffff1660e01b815260040160006040518083038186803b1580156111c657600080fd5b505afa1580156111da573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525081019061120391906132be565b905060005b815181101561130157603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b383838151811061125b57fe5b60200260200101517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016112a1929190613ee7565b602060405180830381600087803b1580156112bb57600080fd5b505af11580156112cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112f391906132ff565b508080600101915050611208565b507fb837fd51506ba3cc623a37c78ed22fd521f2f6e9f69a34d5c2a4a9474f27579360405160405180910390a150565b603b60019054906101000a900460ff1681565b60375481565b603d5481565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b603b60029054906101000a900460ff1681565b60355481565b603c5481565b603e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b603b60039054906101000a900460ff1681565b60006002808111156113dc57fe5b603b60009054906101000a900460ff1660028111156113f757fe5b141561140c5761140561263c565b90506114d6565b600060395411801561142657506039546114246121b6565b105b1561143457600090506114d6565b6001600281111561144157fe5b603b60009054906101000a900460ff16600281111561145c57fe5b14801561146b57506000603a54115b801561147f5750603a5461147d6121b6565b105b1561148d57600090506114d6565b60006114bf603f546114b1603c546114a3611ba4565b610d8d90919063ffffffff16565b610d8d90919063ffffffff16565b90506114d26114cc610c91565b826126f6565b9150505b90565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611569576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161156090614359565b60405180910390fd5b6060603e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a34574666040518163ffffffff1660e01b815260040160006040518083038186803b1580156115d357600080fd5b505afa1580156115e7573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525081019061161091906132be565b905060005b81518110156116ef57603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b383838151811061166857fe5b602002602001015160006040518363ffffffff1660e01b815260040161168f929190613ebe565b602060405180830381600087803b1580156116a957600080fd5b505af11580156116bd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116e191906132ff565b508080600101915050611615565b507f6d317a20ba9d790014284bef285283cd61fde92e0f2711050f563a9d2cf4171160405160405180910390a150565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146117ad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117a490614259565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60365481565b60008061187c6121b6565b905060365481116118915760009150506118aa565b6118a660365482610d8d90919063ffffffff16565b9150505b90565b603a5481565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611943576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161193a90614359565b60405180910390fd5b600061194d6113ce565b905060008111611992576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611989906143b9565b60405180910390fd5b6119a781603c54610ddd90919063ffffffff16565b603c81905550611a1c603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166125b69092919063ffffffff16565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fc7798891864187665ac6dd119286e44ec13f014527aeeb2b8eb3fd413df9317982604051611a849190614439565b60405180910390a250565b603b60009054906101000a900460ff1681565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611b32576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b2990614359565b60405180910390fd5b6001603b60036101000a81548160ff0219169083151502179055507fbeb3313724453131feb0a765a03e6715bb720e0f973a31fcbafa2d2f048c188b60405160405180910390a1565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600080611baf6121b6565b9050603654811015611bc5576000915050611bff565b603754811115611bda57603554915050611bff565b611bfb611be5610ea1565b611bed612345565b61270f90919063ffffffff16565b9150505b90565b60385481565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611c98576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c8f90614359565b60405180910390fd5b60008111611cdb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cd2906141d9565b60405180910390fd5b80611ce4611067565b1015611d25576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d1c906142d9565b60405180910390fd5b611d94603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166125b69092919063ffffffff16565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b82604051611dfc9190614439565b60405180910390a250565b6000611e25603854611e176110ae565b61256090919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611eb8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611eaf90614259565b60405180910390fd5b60016002811115611ec557fe5b603b60009054906101000a900460ff166002811115611ee057fe5b14611f20576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f1790614319565b60405180910390fd5b60001515603b60019054906101000a900460ff16151514611f76576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f6d90614419565b60405180910390fd5b6000611f94611f83610e32565b603554610d8d90919063ffffffff16565b905060008111611fd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fd090614099565b60405180910390fd5b80603d819055506001603b60016101000a81548160ff02191690831515021790555061204f612006611b7b565b82603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166125b69092919063ffffffff16565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fb73c49a3a37a7aca291ba0ceaa41657012def406106a7fc386888f0f66e941cf826040516120b79190614439565b60405180910390a250565b60006120ef603d546120e1603c54603554610d8d90919063ffffffff16565b610d8d90919063ffffffff16565b905090565b6121068a8a8a8a8a8a8a8a8a8a61277f565b61210f8b612c09565b5050505050505050505050565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146121aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121a190614259565b60405180910390fd5b6121b381612c09565b50565b600042905090565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461224e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161224590614359565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156122be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122b590614179565b60405180910390fd5b80603460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f373c72efabe4ef3e552ff77838be729f3bc3d8c586df0012902d1baa2377fa1d8160405161232e9190613ea3565b60405180910390a150565b603f5481565b60395481565b60006123626001612354610ebf565b610d8d90919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146123f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123ec90614259565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612465576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161245c90614059565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60606125578484600085612d87565b90509392505050565b60008082116125a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161259b90614159565b60405180910390fd5b8183816125ad57fe5b04905092915050565b6126378363a9059cbb60e01b84846040516024016125d5929190613ee7565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050612e9c565b505050565b60008060395411801561265757506039546126556121b6565b105b1561266557600090506126f3565b6001600281111561267257fe5b603b60009054906101000a900460ff16600281111561268d57fe5b14801561269c57506000603a54115b80156126b05750603a546126ae6121b6565b105b156126be57600090506126f3565b60006126dc603c546126ce611ba4565b610d8d90919063ffffffff16565b90506126ef6126e9610c91565b826126f6565b9150505b90565b60008183106127055781612707565b825b905092915050565b6000808314156127225760009050612779565b600082840290508284828161273357fe5b0414612774576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161276b90614239565b60405180910390fd5b809150505b92915050565b603b60029054906101000a900460ff16156127cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127c6906142f9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff16141561283f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612836906140b9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff1614156128af576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128a6906143f9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff16141561291f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612916906143d9565b60405180910390fd5b60008711612962576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161295990614139565b60405180910390fd5b60008614156129a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161299d90614279565b60405180910390fd5b8486106129e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129df90614019565b60405180910390fd5b6001841015612a2c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a2390614219565b60405180910390fd5b60006002811115612a3957fe5b816002811115612a4557fe5b1415612a86576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a7d90614039565b60405180910390fd5b848310612ac8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612abf90614379565b60405180910390fd5b848210612b0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b0190613ff9565b60405180910390fd5b6001603b60026101000a81548160ff021916908315150217905550612b2e8a612f63565b88603460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555087603360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550866035819055508560368190555084603781905550836038819055508260398190555081603a8190555080603b60006101000a81548160ff02191690836002811115612bf857fe5b021790555050505050505050505050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612c79576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c7090614339565b60405180910390fd5b612c8281613001565b612cc1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612cb8906141b9565b60405180910390fd5b6000603e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081603e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fdac3632743b879638fd2d51c4d3c1dd796615b4758a55b50b0c19b971ba9fbc760405160405180910390a35050565b606082471015612dcc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612dc390614119565b60405180910390fd5b612dd585613001565b612e14576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e0b906142b9565b60405180910390fd5b600060608673ffffffffffffffffffffffffffffffffffffffff168587604051612e3e9190613e8c565b60006040518083038185875af1925050503d8060008114612e7b576040519150601f19603f3d011682016040523d82523d6000602084013e612e80565b606091505b5091509150612e90828286613014565b92505050949350505050565b6060612efe826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166125489092919063ffffffff16565b9050600081511115612f5e5780806020019051810190612f1e91906132ff565b612f5d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612f5490614399565b60405180910390fd5b5b505050565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a350565b600080823b905060008111915050919050565b6060831561302457829050613074565b6000835111156130375782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161306b9190613f97565b60405180910390fd5b9392505050565b60008135905061308a81614630565b92915050565b60008151905061309f81614630565b92915050565b600082601f8301126130b657600080fd5b81516130c96130c482614485565b614454565b915081818352602084019350602081019050838560208402820111156130ee57600080fd5b60005b8381101561311e57816131048882613090565b8452602084019350602083019250506001810190506130f1565b5050505092915050565b60008151905061313781614647565b92915050565b60008135905061314c8161465e565b92915050565b6000813590506131618161466e565b92915050565b6000815190506131768161466e565b92915050565b60006020828403121561318e57600080fd5b600061319c8482850161307b565b91505092915050565b6000602082840312156131b757600080fd5b60006131c584828501613090565b91505092915050565b60008060008060008060008060008060006101608c8e0312156131f057600080fd5b60006131fe8e828f0161307b565b9b5050602061320f8e828f0161307b565b9a505060406132208e828f0161307b565b99505060606132318e828f0161307b565b98505060806132428e828f01613152565b97505060a06132538e828f01613152565b96505060c06132648e828f01613152565b95505060e06132758e828f01613152565b9450506101006132878e828f01613152565b9350506101206132998e828f01613152565b9250506101406132ab8e828f0161313d565b9150509295989b509295989b9093969950565b6000602082840312156132d057600080fd5b600082015167ffffffffffffffff8111156132ea57600080fd5b6132f6848285016130a5565b91505092915050565b60006020828403121561331157600080fd5b600061331f84828501613128565b91505092915050565b60006020828403121561333a57600080fd5b600061334884828501613152565b91505092915050565b60006020828403121561336357600080fd5b600061337184828501613167565b91505092915050565b613383816144e3565b82525050565b613392816144f5565b82525050565b6133a181614501565b82525050565b60006133b2826144b1565b6133bc81856144c7565b93506133cc8185602086016145d6565b80840191505092915050565b6133e18161456a565b82525050565b6133f08161458e565b82525050565b6133ff816145b2565b82525050565b61340e816145c4565b82525050565b600061341f826144bc565b61342981856144d2565b93506134398185602086016145d6565b6134428161460b565b840191505092915050565b600061345a6008836144d2565b91507f4261642063616c6c0000000000000000000000000000000000000000000000006000830152602082019050919050565b600061349a601b836144d2565b91507f455448207472616e7366657273206e6f7420737570706f7274656400000000006000830152602082019050919050565b60006134da6022836144d2565b91507f436c6966662074696d65206d757374206265206265666f726520656e6420746960008301527f6d650000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006135406015836144d2565b91507f53746172742074696d65203e20656e642074696d6500000000000000000000006000830152602082019050919050565b6000613580601e836144d2565b91507f4d757374207365742061207265766f636162696c697479206f7074696f6e00006000830152602082019050919050565b60006135c06026836144d2565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613626601b836144d2565b91507f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006000830152602082019050919050565b6000613666601c836144d2565b91507f4e6f20617661696c61626c6520756e76657374656420616d6f756e74000000006000830152602082019050919050565b60006136a66014836144d2565b91507f4f776e65722063616e6e6f74206265207a65726f0000000000000000000000006000830152602082019050919050565b60006136e6601f836144d2565b91507f43616e6e6f742063616e63656c20616363657074656420636f6e7472616374006000830152602082019050919050565b6000613726601e836144d2565b91507f536166654d6174683a207375627472616374696f6e206f766572666c6f7700006000830152602082019050919050565b60006137666026836144d2565b91507f416464726573733a20696e73756666696369656e742062616c616e636520666f60008301527f722063616c6c00000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006137cc601d836144d2565b91507f4d616e6167656420746f6b656e732063616e6e6f74206265207a65726f0000006000830152602082019050919050565b600061380c601a836144d2565b91507f536166654d6174683a206469766973696f6e206279207a65726f0000000000006000830152602082019050919050565b600061384c6011836144d2565b91507f456d7074792062656e65666963696172790000000000000000000000000000006000830152602082019050919050565b600061388c6013836144d2565b91507f556e617574686f72697a65642063616c6c6572000000000000000000000000006000830152602082019050919050565b60006138cc601a836144d2565b91507f4d616e61676572206d757374206265206120636f6e74726163740000000000006000830152602082019050919050565b600061390c6015836144d2565b91507f416d6f756e742063616e6e6f74206265207a65726f00000000000000000000006000830152602082019050919050565b600061394c6029836144d2565b91507f43616e6e6f7420757365206d6f726520746f6b656e73207468616e207665737460008301527f656420616d6f756e7400000000000000000000000000000000000000000000006020830152604082019050919050565b60006139b2601f836144d2565b91507f506572696f64732063616e6e6f742062652062656c6f77206d696e696d756d006000830152602082019050919050565b60006139f26021836144d2565b91507f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008301527f77000000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613a586020836144d2565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b6000613a986016836144d2565b91507f53746172742074696d65206d75737420626520736574000000000000000000006000830152602082019050919050565b6000613ad86015836144d2565b91507f556e617574686f72697a65642066756e6374696f6e00000000000000000000006000830152602082019050919050565b6000613b18601d836144d2565b91507f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006000830152602082019050919050565b6000613b586024836144d2565b91507f416d6f756e7420726571756573746564203e20737572706c757320617661696c60008301527f61626c65000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613bbe6013836144d2565b91507f416c726561647920696e697469616c697a6564000000000000000000000000006000830152602082019050919050565b6000613bfe6019836144d2565b91507f436f6e7472616374206973206e6f6e2d7265766f6361626c65000000000000006000830152602082019050919050565b6000613c3e6017836144d2565b91507f4d616e616765722063616e6e6f7420626520656d7074790000000000000000006000830152602082019050919050565b6000613c7e6005836144d2565b91507f21617574680000000000000000000000000000000000000000000000000000006000830152602082019050919050565b6000613cbe602a836144d2565b91507f52656c656173652073746172742074696d65206d757374206265206265666f7260008301527f6520656e642074696d65000000000000000000000000000000000000000000006020830152604082019050919050565b6000613d24602a836144d2565b91507f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008301527f6f742073756363656564000000000000000000000000000000000000000000006020830152604082019050919050565b6000613d8a601e836144d2565b91507f4e6f20617661696c61626c652072656c65617361626c6520616d6f756e7400006000830152602082019050919050565b6000613dca6014836144d2565b91507f546f6b656e2063616e6e6f74206265207a65726f0000000000000000000000006000830152602082019050919050565b6000613e0a601a836144d2565b91507f42656e65666963696172792063616e6e6f74206265207a65726f0000000000006000830152602082019050919050565b6000613e4a600f836144d2565b91507f416c7265616479207265766f6b656400000000000000000000000000000000006000830152602082019050919050565b613e8681614560565b82525050565b6000613e9882846133a7565b915081905092915050565b6000602082019050613eb8600083018461337a565b92915050565b6000604082019050613ed3600083018561337a565b613ee06020830184613405565b9392505050565b6000604082019050613efc600083018561337a565b613f096020830184613e7d565b9392505050565b6000602082019050613f256000830184613389565b92915050565b6000602082019050613f406000830184613398565b92915050565b6000602082019050613f5b60008301846133d8565b92915050565b6000602082019050613f7660008301846133e7565b92915050565b6000602082019050613f9160008301846133f6565b92915050565b60006020820190508181036000830152613fb18184613414565b905092915050565b60006020820190508181036000830152613fd28161344d565b9050919050565b60006020820190508181036000830152613ff28161348d565b9050919050565b60006020820190508181036000830152614012816134cd565b9050919050565b6000602082019050818103600083015261403281613533565b9050919050565b6000602082019050818103600083015261405281613573565b9050919050565b60006020820190508181036000830152614072816135b3565b9050919050565b6000602082019050818103600083015261409281613619565b9050919050565b600060208201905081810360008301526140b281613659565b9050919050565b600060208201905081810360008301526140d281613699565b9050919050565b600060208201905081810360008301526140f2816136d9565b9050919050565b6000602082019050818103600083015261411281613719565b9050919050565b6000602082019050818103600083015261413281613759565b9050919050565b60006020820190508181036000830152614152816137bf565b9050919050565b60006020820190508181036000830152614172816137ff565b9050919050565b600060208201905081810360008301526141928161383f565b9050919050565b600060208201905081810360008301526141b28161387f565b9050919050565b600060208201905081810360008301526141d2816138bf565b9050919050565b600060208201905081810360008301526141f2816138ff565b9050919050565b600060208201905081810360008301526142128161393f565b9050919050565b60006020820190508181036000830152614232816139a5565b9050919050565b60006020820190508181036000830152614252816139e5565b9050919050565b6000602082019050818103600083015261427281613a4b565b9050919050565b6000602082019050818103600083015261429281613a8b565b9050919050565b600060208201905081810360008301526142b281613acb565b9050919050565b600060208201905081810360008301526142d281613b0b565b9050919050565b600060208201905081810360008301526142f281613b4b565b9050919050565b6000602082019050818103600083015261431281613bb1565b9050919050565b6000602082019050818103600083015261433281613bf1565b9050919050565b6000602082019050818103600083015261435281613c31565b9050919050565b6000602082019050818103600083015261437281613c71565b9050919050565b6000602082019050818103600083015261439281613cb1565b9050919050565b600060208201905081810360008301526143b281613d17565b9050919050565b600060208201905081810360008301526143d281613d7d565b9050919050565b600060208201905081810360008301526143f281613dbd565b9050919050565b6000602082019050818103600083015261441281613dfd565b9050919050565b6000602082019050818103600083015261443281613e3d565b9050919050565b600060208201905061444e6000830184613e7d565b92915050565b6000604051905081810181811067ffffffffffffffff8211171561447b5761447a614609565b5b8060405250919050565b600067ffffffffffffffff8211156144a05761449f614609565b5b602082029050602081019050919050565b600081519050919050565b600081519050919050565b600081905092915050565b600082825260208201905092915050565b60006144ee82614540565b9050919050565b60008115159050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600081905061453b8261461c565b919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60006145758261457c565b9050919050565b600061458782614540565b9050919050565b6000614599826145a0565b9050919050565b60006145ab82614540565b9050919050565b60006145bd8261452d565b9050919050565b60006145cf82614560565b9050919050565b60005b838110156145f45780820151818401526020810190506145d9565b83811115614603576000848401525b50505050565bfe5b6000601f19601f8301169050919050565b6003811061462d5761462c614609565b5b50565b614639816144e3565b811461464457600080fd5b50565b614650816144f5565b811461465b57600080fd5b50565b6003811061466b57600080fd5b50565b61467781614560565b811461468257600080fd5b5056fea264697066735822122013f3b022e354ddf49f7a28727f309f858a5cbdf70833a2e54da3c1a482b7073164736f6c63430007030033", + "devdoc": { + "kind": "dev", + "methods": { + "acceptLock()": { + "details": "Can only be called by the beneficiary" + }, + "amountPerPeriod()": { + "returns": { + "_0": "Amount of tokens available after each period" + } + }, + "approveProtocol()": { + "details": "Approves all token destinations registered in the manager to pull tokens" + }, + "availableAmount()": { + "details": "Implements the step-by-step schedule based on periods for available tokens", + "returns": { + "_0": "Amount of tokens available according to the schedule" + } + }, + "cancelLock()": { + "details": "Can only be called by the owner" + }, + "changeBeneficiary(address)": { + "details": "Can only be called by the beneficiary", + "params": { + "_newBeneficiary": "Address of the new beneficiary address" + } + }, + "currentBalance()": { + "returns": { + "_0": "Tokens held in the contract" + } + }, + "currentPeriod()": { + "returns": { + "_0": "A number that represents the current period" + } + }, + "currentTime()": { + "returns": { + "_0": "Current block timestamp" + } + }, + "duration()": { + "returns": { + "_0": "Amount of seconds from contract startTime to endTime" + } + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "passedPeriods()": { + "returns": { + "_0": "A number of periods that passed since the schedule started" + } + }, + "periodDuration()": { + "returns": { + "_0": "Duration of each period in seconds" + } + }, + "releasableAmount()": { + "details": "Considers the schedule, takes into account already released tokens and used amount", + "returns": { + "_0": "Amount of tokens ready to be released" + } + }, + "release()": { + "details": "All available releasable tokens are transferred to beneficiary" + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." + }, + "revoke()": { + "details": "Vesting schedule is always calculated based on managed tokens" + }, + "revokeProtocol()": { + "details": "Revokes approval to all token destinations in the manager to pull tokens" + }, + "setManager(address)": { + "params": { + "_newManager": "Address of the new manager" + } + }, + "sinceStartTime()": { + "details": "Returns zero if called before conctract starTime", + "returns": { + "_0": "Seconds elapsed from contract startTime" + } + }, + "surplusAmount()": { + "details": "All funds over outstanding amount is considered surplus that can be withdrawn by beneficiary. Note this might not be the correct value for wallets transferred to L2 (i.e. an L2GraphTokenLockWallet), as the released amount will be skewed, so the beneficiary might have to bridge back to L1 to release the surplus.", + "returns": { + "_0": "Amount of tokens considered as surplus" + } + }, + "totalOutstandingAmount()": { + "details": "Does not consider schedule but just global amounts tracked", + "returns": { + "_0": "Amount of outstanding tokens for the lifetime of the contract" + } + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + }, + "vestedAmount()": { + "details": "Similar to available amount, but is fully vested when contract is non-revocable", + "returns": { + "_0": "Amount of tokens already vested" + } + }, + "withdrawSurplus(uint256)": { + "details": "Tokens in the contract over outstanding amount are considered as surplus", + "params": { + "_amount": "Amount of tokens to withdraw" + } + } + }, + "title": "GraphTokenLockWallet", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "acceptLock()": { + "notice": "Beneficiary accepts the lock, the owner cannot retrieve back the tokens" + }, + "amountPerPeriod()": { + "notice": "Returns amount available to be released after each period according to schedule" + }, + "approveProtocol()": { + "notice": "Approves protocol access of the tokens managed by this contract" + }, + "availableAmount()": { + "notice": "Gets the currently available token according to the schedule" + }, + "cancelLock()": { + "notice": "Owner cancel the lock and return the balance in the contract" + }, + "changeBeneficiary(address)": { + "notice": "Change the beneficiary of funds managed by the contract" + }, + "currentBalance()": { + "notice": "Returns the amount of tokens currently held by the contract" + }, + "currentPeriod()": { + "notice": "Gets the current period based on the schedule" + }, + "currentTime()": { + "notice": "Returns the current block timestamp" + }, + "duration()": { + "notice": "Gets duration of contract from start to end in seconds" + }, + "passedPeriods()": { + "notice": "Gets the number of periods that passed since the first period" + }, + "periodDuration()": { + "notice": "Returns the duration of each period in seconds" + }, + "releasableAmount()": { + "notice": "Gets tokens currently available for release" + }, + "release()": { + "notice": "Releases tokens based on the configured schedule" + }, + "revoke()": { + "notice": "Revokes a vesting schedule and return the unvested tokens to the owner" + }, + "revokeProtocol()": { + "notice": "Revokes protocol access of the tokens managed by this contract" + }, + "setManager(address)": { + "notice": "Sets a new manager for this contract" + }, + "sinceStartTime()": { + "notice": "Gets time elapsed since the start of the contract" + }, + "surplusAmount()": { + "notice": "Gets surplus amount in the contract based on outstanding amount to release" + }, + "totalOutstandingAmount()": { + "notice": "Gets the outstanding amount yet to be released based on the whole contract lifetime" + }, + "vestedAmount()": { + "notice": "Gets the amount of currently vested tokens" + }, + "withdrawSurplus(uint256)": { + "notice": "Withdraws surplus, unmanaged tokens from the contract" + } + }, + "notice": "This contract is built on top of the base GraphTokenLock functionality. It allows wallet beneficiaries to use the deposited funds to perform specific function calls on specific contracts. The idea is that supporters with locked tokens can participate in the protocol but disallow any release before the vesting/lock schedule. The beneficiary can issue authorized function calls to this contract that will get forwarded to a target contract. A target contract is any of our protocol contracts. The function calls allowed are queried to the GraphTokenLockManager, this way the same configuration can be shared for all the created lock wallet contracts. NOTE: Contracts used as target must have its function signatures checked to avoid collisions with any of this contract functions. Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience the maximum amount of tokens is authorized. Function calls do not forward ETH value so DO NOT SEND ETH TO THIS CONTRACT.", + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 6817, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "_owner", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 6822, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 3244, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "token", + "offset": 0, + "slot": "51", + "type": "t_contract(IERC20)1710" + }, + { + "astId": 3246, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "beneficiary", + "offset": 0, + "slot": "52", + "type": "t_address" + }, + { + "astId": 3248, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "managedAmount", + "offset": 0, + "slot": "53", + "type": "t_uint256" + }, + { + "astId": 3250, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "startTime", + "offset": 0, + "slot": "54", + "type": "t_uint256" + }, + { + "astId": 3252, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "endTime", + "offset": 0, + "slot": "55", + "type": "t_uint256" + }, + { + "astId": 3254, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "periods", + "offset": 0, + "slot": "56", + "type": "t_uint256" + }, + { + "astId": 3256, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "releaseStartTime", + "offset": 0, + "slot": "57", + "type": "t_uint256" + }, + { + "astId": 3258, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "vestingCliffTime", + "offset": 0, + "slot": "58", + "type": "t_uint256" + }, + { + "astId": 3260, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "revocable", + "offset": 0, + "slot": "59", + "type": "t_enum(Revocability)5096" + }, + { + "astId": 3262, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "isRevoked", + "offset": 1, + "slot": "59", + "type": "t_bool" + }, + { + "astId": 3264, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "isInitialized", + "offset": 2, + "slot": "59", + "type": "t_bool" + }, + { + "astId": 3266, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "isAccepted", + "offset": 3, + "slot": "59", + "type": "t_bool" + }, + { + "astId": 3268, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "releasedAmount", + "offset": 0, + "slot": "60", + "type": "t_uint256" + }, + { + "astId": 3270, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "revokedAmount", + "offset": 0, + "slot": "61", + "type": "t_uint256" + }, + { + "astId": 4692, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "manager", + "offset": 0, + "slot": "62", + "type": "t_contract(IGraphTokenLockManager)5278" + }, + { + "astId": 4694, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "usedAmount", + "offset": 0, + "slot": "63", + "type": "t_uint256" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)50_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_contract(IERC20)1710": { + "encoding": "inplace", + "label": "contract IERC20", + "numberOfBytes": "20" + }, + "t_contract(IGraphTokenLockManager)5278": { + "encoding": "inplace", + "label": "contract IGraphTokenLockManager", + "numberOfBytes": "20" + }, + "t_enum(Revocability)5096": { + "encoding": "inplace", + "label": "enum IGraphTokenLock.Revocability", + "numberOfBytes": "1" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} \ No newline at end of file diff --git a/packages/token-distribution/deployments/sepolia/L1GraphTokenLockTransferTool.json b/packages/token-distribution/deployments/sepolia/L1GraphTokenLockTransferTool.json new file mode 100644 index 000000000..458bd5585 --- /dev/null +++ b/packages/token-distribution/deployments/sepolia/L1GraphTokenLockTransferTool.json @@ -0,0 +1,636 @@ +{ + "address": "0x543F8BFFb65c46091B4eEF4b1c394dFa43C4b065", + "abi": [ + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_graphToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_l2Implementation", + "type": "address" + }, + { + "internalType": "contract ITokenGateway", + "name": "_l1Gateway", + "type": "address" + }, + { + "internalType": "address payable", + "name": "_staking", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "tokenLock", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "ETHDeposited", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "tokenLock", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "ETHPulled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "tokenLock", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "ETHWithdrawn", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "l1Wallet", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "l2Beneficiary", + "type": "address" + } + ], + "name": "L2BeneficiarySet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "l1LockManager", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "l2LockManager", + "type": "address" + } + ], + "name": "L2LockManagerSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "l1Wallet", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "l2Wallet", + "type": "address" + } + ], + "name": "L2WalletAddressSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "l1WalletOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "l2WalletOwner", + "type": "address" + } + ], + "name": "L2WalletOwnerSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "l1Wallet", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "l2Wallet", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "l1LockManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "l2LockManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "LockedFundsSentToL2", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "proxy", + "type": "address" + } + ], + "name": "ProxyCreated", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_tokenLock", + "type": "address" + } + ], + "name": "depositETH", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_l2Beneficiary", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_maxGas", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_gasPriceBid", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_maxSubmissionCost", + "type": "uint256" + } + ], + "name": "depositToL2Locked", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_salt", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "_implementation", + "type": "address" + }, + { + "internalType": "address", + "name": "_deployer", + "type": "address" + } + ], + "name": "getDeploymentAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_salt", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "_implementation", + "type": "address" + } + ], + "name": "getDeploymentAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "graphToken", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_owner", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "l1Gateway", + "outputs": [ + { + "internalType": "contract ITokenGateway", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "l2Beneficiary", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "l2Implementation", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "l2LockManager", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "l2WalletAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "l2WalletAddressSetManually", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "l2WalletOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_tokenLock", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "pullETH", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_l1LockManager", + "type": "address" + }, + { + "internalType": "address", + "name": "_l2LockManager", + "type": "address" + } + ], + "name": "setL2LockManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_l2Wallet", + "type": "address" + } + ], + "name": "setL2WalletAddressManually", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_l1WalletOwner", + "type": "address" + }, + { + "internalType": "address", + "name": "_l2WalletOwner", + "type": "address" + } + ], + "name": "setL2WalletOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "staking", + "outputs": [ + { + "internalType": "address payable", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "tokenLockETHBalances", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_destination", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "withdrawETH", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x73d09cc6f92b3c97de26d3049db72a41249e0772d45c24c3818bce3344de8070" +} \ No newline at end of file diff --git a/packages/token-distribution/deployments/sepolia/solcInputs/095bd30babc75057be19228ca1fd7aa4.json b/packages/token-distribution/deployments/sepolia/solcInputs/095bd30babc75057be19228ca1fd7aa4.json new file mode 100644 index 000000000..e7a4b87c0 --- /dev/null +++ b/packages/token-distribution/deployments/sepolia/solcInputs/095bd30babc75057be19228ca1fd7aa4.json @@ -0,0 +1,152 @@ +{ + "language": "Solidity", + "sources": { + "@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/**\n * @dev Wrappers over Solidity's arithmetic operations with added overflow\n * checks.\n *\n * Arithmetic operations in Solidity wrap on overflow. This can easily result\n * in bugs, because programmers usually assume that an overflow raises an\n * error, which is the standard behavior in high level programming languages.\n * `SafeMath` restores this intuition by reverting the transaction when an\n * operation overflows.\n *\n * Using this library instead of the unchecked operations eliminates an entire\n * class of bugs, so it's recommended to use it always.\n */\nlibrary SafeMathUpgradeable {\n /**\n * @dev Returns the addition of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n uint256 c = a + b;\n if (c < a) return (false, 0);\n return (true, c);\n }\n\n /**\n * @dev Returns the substraction of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n if (b > a) return (false, 0);\n return (true, a - b);\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\n // benefit is lost if 'b' is also tested.\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\n if (a == 0) return (true, 0);\n uint256 c = a * b;\n if (c / a != b) return (false, 0);\n return (true, c);\n }\n\n /**\n * @dev Returns the division of two unsigned integers, with a division by zero flag.\n *\n * _Available since v3.4._\n */\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n if (b == 0) return (false, 0);\n return (true, a / b);\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\n *\n * _Available since v3.4._\n */\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n if (b == 0) return (false, 0);\n return (true, a % b);\n }\n\n /**\n * @dev Returns the addition of two unsigned integers, reverting on\n * overflow.\n *\n * Counterpart to Solidity's `+` operator.\n *\n * Requirements:\n *\n * - Addition cannot overflow.\n */\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\n uint256 c = a + b;\n require(c >= a, \"SafeMath: addition overflow\");\n return c;\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, reverting on\n * overflow (when the result is negative).\n *\n * Counterpart to Solidity's `-` operator.\n *\n * Requirements:\n *\n * - Subtraction cannot overflow.\n */\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b <= a, \"SafeMath: subtraction overflow\");\n return a - b;\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, reverting on\n * overflow.\n *\n * Counterpart to Solidity's `*` operator.\n *\n * Requirements:\n *\n * - Multiplication cannot overflow.\n */\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n if (a == 0) return 0;\n uint256 c = a * b;\n require(c / a == b, \"SafeMath: multiplication overflow\");\n return c;\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers, reverting on\n * division by zero. The result is rounded towards zero.\n *\n * Counterpart to Solidity's `/` operator. Note: this function uses a\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\n * uses an invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b > 0, \"SafeMath: division by zero\");\n return a / b;\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * reverting when dividing by zero.\n *\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\n * opcode (which leaves remaining gas untouched) while Solidity uses an\n * invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b > 0, \"SafeMath: modulo by zero\");\n return a % b;\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\n * overflow (when the result is negative).\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {trySub}.\n *\n * Counterpart to Solidity's `-` operator.\n *\n * Requirements:\n *\n * - Subtraction cannot overflow.\n */\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b <= a, errorMessage);\n return a - b;\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers, reverting with custom message on\n * division by zero. The result is rounded towards zero.\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {tryDiv}.\n *\n * Counterpart to Solidity's `/` operator. Note: this function uses a\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\n * uses an invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b > 0, errorMessage);\n return a / b;\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * reverting with custom message when dividing by zero.\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {tryMod}.\n *\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\n * opcode (which leaves remaining gas untouched) while Solidity uses an\n * invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b > 0, errorMessage);\n return a % b;\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\n// solhint-disable-next-line compiler-version\npragma solidity >=0.4.24 <0.8.0;\n\nimport \"../utils/AddressUpgradeable.sol\";\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {UpgradeableProxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n */\nabstract contract Initializable {\n\n /**\n * @dev Indicates that the contract has been initialized.\n */\n bool private _initialized;\n\n /**\n * @dev Indicates that the contract is in the process of being initialized.\n */\n bool private _initializing;\n\n /**\n * @dev Modifier to protect an initializer function from being invoked twice.\n */\n modifier initializer() {\n require(_initializing || _isConstructor() || !_initialized, \"Initializable: contract is already initialized\");\n\n bool isTopLevelCall = !_initializing;\n if (isTopLevelCall) {\n _initializing = true;\n _initialized = true;\n }\n\n _;\n\n if (isTopLevelCall) {\n _initializing = false;\n }\n }\n\n /// @dev Returns true if and only if the function is running in the constructor\n function _isConstructor() private view returns (bool) {\n return !AddressUpgradeable.isContract(address(this));\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.2 <0.8.0;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary AddressUpgradeable {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize, which returns 0 for contracts in\n // construction, since the code is only stored at the end of the\n // constructor execution.\n\n uint256 size;\n // solhint-disable-next-line no-inline-assembly\n assembly { size := extcodesize(account) }\n return size > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n // solhint-disable-next-line avoid-low-level-calls, avoid-call-value\n (bool success, ) = recipient.call{ value: amount }(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain`call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCall(target, data, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n require(isContract(target), \"Address: call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.call{ value: value }(data);\n return _verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {\n require(isContract(target), \"Address: static call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.staticcall(data);\n return _verifyCallResult(success, returndata, errorMessage);\n }\n\n function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {\n if (success) {\n return returndata;\n } else {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n }\n}\n" + }, + "@openzeppelin/contracts/access/Ownable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\nimport \"../utils/Context.sol\";\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor () internal {\n address msgSender = _msgSender();\n _owner = msgSender;\n emit OwnershipTransferred(address(0), msgSender);\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n _;\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n emit OwnershipTransferred(_owner, address(0));\n _owner = address(0);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n emit OwnershipTransferred(_owner, newOwner);\n _owner = newOwner;\n }\n}\n" + }, + "@openzeppelin/contracts/math/SafeMath.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/**\n * @dev Wrappers over Solidity's arithmetic operations with added overflow\n * checks.\n *\n * Arithmetic operations in Solidity wrap on overflow. This can easily result\n * in bugs, because programmers usually assume that an overflow raises an\n * error, which is the standard behavior in high level programming languages.\n * `SafeMath` restores this intuition by reverting the transaction when an\n * operation overflows.\n *\n * Using this library instead of the unchecked operations eliminates an entire\n * class of bugs, so it's recommended to use it always.\n */\nlibrary SafeMath {\n /**\n * @dev Returns the addition of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n uint256 c = a + b;\n if (c < a) return (false, 0);\n return (true, c);\n }\n\n /**\n * @dev Returns the substraction of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n if (b > a) return (false, 0);\n return (true, a - b);\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\n // benefit is lost if 'b' is also tested.\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\n if (a == 0) return (true, 0);\n uint256 c = a * b;\n if (c / a != b) return (false, 0);\n return (true, c);\n }\n\n /**\n * @dev Returns the division of two unsigned integers, with a division by zero flag.\n *\n * _Available since v3.4._\n */\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n if (b == 0) return (false, 0);\n return (true, a / b);\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\n *\n * _Available since v3.4._\n */\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n if (b == 0) return (false, 0);\n return (true, a % b);\n }\n\n /**\n * @dev Returns the addition of two unsigned integers, reverting on\n * overflow.\n *\n * Counterpart to Solidity's `+` operator.\n *\n * Requirements:\n *\n * - Addition cannot overflow.\n */\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\n uint256 c = a + b;\n require(c >= a, \"SafeMath: addition overflow\");\n return c;\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, reverting on\n * overflow (when the result is negative).\n *\n * Counterpart to Solidity's `-` operator.\n *\n * Requirements:\n *\n * - Subtraction cannot overflow.\n */\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b <= a, \"SafeMath: subtraction overflow\");\n return a - b;\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, reverting on\n * overflow.\n *\n * Counterpart to Solidity's `*` operator.\n *\n * Requirements:\n *\n * - Multiplication cannot overflow.\n */\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n if (a == 0) return 0;\n uint256 c = a * b;\n require(c / a == b, \"SafeMath: multiplication overflow\");\n return c;\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers, reverting on\n * division by zero. The result is rounded towards zero.\n *\n * Counterpart to Solidity's `/` operator. Note: this function uses a\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\n * uses an invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b > 0, \"SafeMath: division by zero\");\n return a / b;\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * reverting when dividing by zero.\n *\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\n * opcode (which leaves remaining gas untouched) while Solidity uses an\n * invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b > 0, \"SafeMath: modulo by zero\");\n return a % b;\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\n * overflow (when the result is negative).\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {trySub}.\n *\n * Counterpart to Solidity's `-` operator.\n *\n * Requirements:\n *\n * - Subtraction cannot overflow.\n */\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b <= a, errorMessage);\n return a - b;\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers, reverting with custom message on\n * division by zero. The result is rounded towards zero.\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {tryDiv}.\n *\n * Counterpart to Solidity's `/` operator. Note: this function uses a\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\n * uses an invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b > 0, errorMessage);\n return a / b;\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * reverting with custom message when dividing by zero.\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {tryMod}.\n *\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\n * opcode (which leaves remaining gas untouched) while Solidity uses an\n * invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b > 0, errorMessage);\n return a % b;\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/ERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\nimport \"../../utils/Context.sol\";\nimport \"./IERC20.sol\";\nimport \"../../math/SafeMath.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin guidelines: functions revert instead\n * of returning `false` on failure. This behavior is nonetheless conventional\n * and does not conflict with the expectations of ERC20 applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20 {\n using SafeMath for uint256;\n\n mapping (address => uint256) private _balances;\n\n mapping (address => mapping (address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n uint8 private _decimals;\n\n /**\n * @dev Sets the values for {name} and {symbol}, initializes {decimals} with\n * a default value of 18.\n *\n * To select a different value for {decimals}, use {_setupDecimals}.\n *\n * All three of these values are immutable: they can only be set once during\n * construction.\n */\n constructor (string memory name_, string memory symbol_) public {\n _name = name_;\n _symbol = symbol_;\n _decimals = 18;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5,05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless {_setupDecimals} is\n * called.\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual returns (uint8) {\n return _decimals;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `recipient` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address recipient, uint256 amount) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * Requirements:\n *\n * - `sender` and `recipient` cannot be the zero address.\n * - `sender` must have a balance of at least `amount`.\n * - the caller must have allowance for ``sender``'s tokens of at least\n * `amount`.\n */\n function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, \"ERC20: transfer amount exceeds allowance\"));\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, \"ERC20: decreased allowance below zero\"));\n return true;\n }\n\n /**\n * @dev Moves tokens `amount` from `sender` to `recipient`.\n *\n * This is internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `sender` cannot be the zero address.\n * - `recipient` cannot be the zero address.\n * - `sender` must have a balance of at least `amount`.\n */\n function _transfer(address sender, address recipient, uint256 amount) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(sender, recipient, amount);\n\n _balances[sender] = _balances[sender].sub(amount, \"ERC20: transfer amount exceeds balance\");\n _balances[recipient] = _balances[recipient].add(amount);\n emit Transfer(sender, recipient, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply = _totalSupply.add(amount);\n _balances[account] = _balances[account].add(amount);\n emit Transfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n _balances[account] = _balances[account].sub(amount, \"ERC20: burn amount exceeds balance\");\n _totalSupply = _totalSupply.sub(amount);\n emit Transfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(address owner, address spender, uint256 amount) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Sets {decimals} to a value other than the default one of 18.\n *\n * WARNING: This function should only be called from the constructor. Most\n * applications that interact with token contracts will not expect\n * {decimals} to ever change, and may work incorrectly if it does.\n */\n function _setupDecimals(uint8 decimals_) internal virtual {\n _decimals = decimals_;\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be to transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `recipient`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address recipient, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `sender` to `recipient` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);\n\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/SafeERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"../../math/SafeMath.sol\";\nimport \"../../utils/Address.sol\";\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n using SafeMath for uint256;\n using Address for address;\n\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\n }\n\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\n }\n\n /**\n * @dev Deprecated. This function has issues similar to the ones found in\n * {IERC20-approve}, and its usage is discouraged.\n *\n * Whenever possible, use {safeIncreaseAllowance} and\n * {safeDecreaseAllowance} instead.\n */\n function safeApprove(IERC20 token, address spender, uint256 value) internal {\n // safeApprove should only be called when setting an initial allowance,\n // or when resetting it to zero. To increase and decrease it, use\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\n // solhint-disable-next-line max-line-length\n require((value == 0) || (token.allowance(address(this), spender) == 0),\n \"SafeERC20: approve from non-zero to non-zero allowance\"\n );\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\n }\n\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n uint256 newAllowance = token.allowance(address(this), spender).add(value);\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\n\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n uint256 newAllowance = token.allowance(address(this), spender).sub(value, \"SafeERC20: decreased allowance below zero\");\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n */\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that\n // the target address contains contract code and also asserts for success in the low-level call.\n\n bytes memory returndata = address(token).functionCall(data, \"SafeERC20: low-level call failed\");\n if (returndata.length > 0) { // Return data is optional\n // solhint-disable-next-line max-line-length\n require(abi.decode(returndata, (bool)), \"SafeERC20: ERC20 operation did not succeed\");\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Address.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.2 <0.8.0;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize, which returns 0 for contracts in\n // construction, since the code is only stored at the end of the\n // constructor execution.\n\n uint256 size;\n // solhint-disable-next-line no-inline-assembly\n assembly { size := extcodesize(account) }\n return size > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n // solhint-disable-next-line avoid-low-level-calls, avoid-call-value\n (bool success, ) = recipient.call{ value: amount }(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain`call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCall(target, data, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n require(isContract(target), \"Address: call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.call{ value: value }(data);\n return _verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {\n require(isContract(target), \"Address: static call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.staticcall(data);\n return _verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\n require(isContract(target), \"Address: delegate call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return _verifyCallResult(success, returndata, errorMessage);\n }\n\n function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {\n if (success) {\n return returndata;\n } else {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/*\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with GSN meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address payable) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes memory) {\n this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\n return msg.data;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Create2.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/**\n * @dev Helper to make usage of the `CREATE2` EVM opcode easier and safer.\n * `CREATE2` can be used to compute in advance the address where a smart\n * contract will be deployed, which allows for interesting new mechanisms known\n * as 'counterfactual interactions'.\n *\n * See the https://eips.ethereum.org/EIPS/eip-1014#motivation[EIP] for more\n * information.\n */\nlibrary Create2 {\n /**\n * @dev Deploys a contract using `CREATE2`. The address where the contract\n * will be deployed can be known in advance via {computeAddress}.\n *\n * The bytecode for a contract can be obtained from Solidity with\n * `type(contractName).creationCode`.\n *\n * Requirements:\n *\n * - `bytecode` must not be empty.\n * - `salt` must have not been used for `bytecode` already.\n * - the factory must have a balance of at least `amount`.\n * - if `amount` is non-zero, `bytecode` must have a `payable` constructor.\n */\n function deploy(uint256 amount, bytes32 salt, bytes memory bytecode) internal returns (address) {\n address addr;\n require(address(this).balance >= amount, \"Create2: insufficient balance\");\n require(bytecode.length != 0, \"Create2: bytecode length is zero\");\n // solhint-disable-next-line no-inline-assembly\n assembly {\n addr := create2(amount, add(bytecode, 0x20), mload(bytecode), salt)\n }\n require(addr != address(0), \"Create2: Failed on deploy\");\n return addr;\n }\n\n /**\n * @dev Returns the address where a contract will be stored if deployed via {deploy}. Any change in the\n * `bytecodeHash` or `salt` will result in a new destination address.\n */\n function computeAddress(bytes32 salt, bytes32 bytecodeHash) internal view returns (address) {\n return computeAddress(salt, bytecodeHash, address(this));\n }\n\n /**\n * @dev Returns the address where a contract will be stored if deployed via {deploy} from a contract located at\n * `deployer`. If `deployer` is this contract's address, returns the same value as {computeAddress}.\n */\n function computeAddress(bytes32 salt, bytes32 bytecodeHash, address deployer) internal pure returns (address) {\n bytes32 _data = keccak256(\n abi.encodePacked(bytes1(0xff), deployer, salt, bytecodeHash)\n );\n return address(uint160(uint256(_data)));\n }\n}\n" + }, + "@openzeppelin/contracts/utils/EnumerableSet.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/**\n * @dev Library for managing\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\n * types.\n *\n * Sets have the following properties:\n *\n * - Elements are added, removed, and checked for existence in constant time\n * (O(1)).\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\n *\n * ```\n * contract Example {\n * // Add the library methods\n * using EnumerableSet for EnumerableSet.AddressSet;\n *\n * // Declare a set state variable\n * EnumerableSet.AddressSet private mySet;\n * }\n * ```\n *\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\n * and `uint256` (`UintSet`) are supported.\n */\nlibrary EnumerableSet {\n // To implement this library for multiple types with as little code\n // repetition as possible, we write it in terms of a generic Set type with\n // bytes32 values.\n // The Set implementation uses private functions, and user-facing\n // implementations (such as AddressSet) are just wrappers around the\n // underlying Set.\n // This means that we can only create new EnumerableSets for types that fit\n // in bytes32.\n\n struct Set {\n // Storage of set values\n bytes32[] _values;\n\n // Position of the value in the `values` array, plus 1 because index 0\n // means a value is not in the set.\n mapping (bytes32 => uint256) _indexes;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function _add(Set storage set, bytes32 value) private returns (bool) {\n if (!_contains(set, value)) {\n set._values.push(value);\n // The value is stored at length-1, but we add 1 to all indexes\n // and use 0 as a sentinel value\n set._indexes[value] = set._values.length;\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function _remove(Set storage set, bytes32 value) private returns (bool) {\n // We read and store the value's index to prevent multiple reads from the same storage slot\n uint256 valueIndex = set._indexes[value];\n\n if (valueIndex != 0) { // Equivalent to contains(set, value)\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\n // the array, and then remove the last element (sometimes called as 'swap and pop').\n // This modifies the order of the array, as noted in {at}.\n\n uint256 toDeleteIndex = valueIndex - 1;\n uint256 lastIndex = set._values.length - 1;\n\n // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs\n // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.\n\n bytes32 lastvalue = set._values[lastIndex];\n\n // Move the last value to the index where the value to delete is\n set._values[toDeleteIndex] = lastvalue;\n // Update the index for the moved value\n set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based\n\n // Delete the slot where the moved value was stored\n set._values.pop();\n\n // Delete the index for the deleted slot\n delete set._indexes[value];\n\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\n return set._indexes[value] != 0;\n }\n\n /**\n * @dev Returns the number of values on the set. O(1).\n */\n function _length(Set storage set) private view returns (uint256) {\n return set._values.length;\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\n require(set._values.length > index, \"EnumerableSet: index out of bounds\");\n return set._values[index];\n }\n\n // Bytes32Set\n\n struct Bytes32Set {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _add(set._inner, value);\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _remove(set._inner, value);\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\n return _contains(set._inner, value);\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(Bytes32Set storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\n return _at(set._inner, index);\n }\n\n // AddressSet\n\n struct AddressSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(AddressSet storage set, address value) internal returns (bool) {\n return _add(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(AddressSet storage set, address value) internal returns (bool) {\n return _remove(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(AddressSet storage set, address value) internal view returns (bool) {\n return _contains(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(AddressSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\n return address(uint160(uint256(_at(set._inner, index))));\n }\n\n\n // UintSet\n\n struct UintSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(UintSet storage set, uint256 value) internal returns (bool) {\n return _add(set._inner, bytes32(value));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\n return _remove(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\n return _contains(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns the number of values on the set. O(1).\n */\n function length(UintSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\n return uint256(_at(set._inner, index));\n }\n}\n" + }, + "contracts/arbitrum/ITokenGateway.sol": { + "content": "// SPDX-License-Identifier: Apache-2.0\n\n/*\n * Copyright 2020, Offchain Labs, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * Originally copied from:\n * https://github.com/OffchainLabs/arbitrum/tree/e3a6307ad8a2dc2cad35728a2a9908cfd8dd8ef9/packages/arb-bridge-peripherals\n *\n * MODIFIED from Offchain Labs' implementation:\n * - Changed solidity version to 0.7.6 (pablo@edgeandnode.com)\n *\n */\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\ninterface ITokenGateway {\n /// @notice event deprecated in favor of DepositInitiated and WithdrawalInitiated\n // event OutboundTransferInitiated(\n // address token,\n // address indexed _from,\n // address indexed _to,\n // uint256 indexed _transferId,\n // uint256 _amount,\n // bytes _data\n // );\n\n /// @notice event deprecated in favor of DepositFinalized and WithdrawalFinalized\n // event InboundTransferFinalized(\n // address token,\n // address indexed _from,\n // address indexed _to,\n // uint256 indexed _transferId,\n // uint256 _amount,\n // bytes _data\n // );\n\n function outboundTransfer(\n address _token,\n address _to,\n uint256 _amount,\n uint256 _maxGas,\n uint256 _gasPriceBid,\n bytes calldata _data\n ) external payable returns (bytes memory);\n\n function finalizeInboundTransfer(\n address _token,\n address _from,\n address _to,\n uint256 _amount,\n bytes calldata _data\n ) external payable;\n\n /**\n * @notice Calculate the address used when bridging an ERC20 token\n * @dev the L1 and L2 address oracles may not always be in sync.\n * For example, a custom token may have been registered but not deployed or the contract self destructed.\n * @param l1ERC20 address of L1 token\n * @return L2 address of a bridged ERC20 token\n */\n function calculateL2TokenAddress(address l1ERC20) external view returns (address);\n}\n" + }, + "contracts/GraphTokenDistributor.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\nimport \"@openzeppelin/contracts/math/SafeMath.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\";\n\n/**\n * @title GraphTokenDistributor\n * @dev Contract that allows distribution of tokens to multiple beneficiaries.\n * The contract accept deposits in the configured token by anyone.\n * The owner can setup the desired distribution by setting the amount of tokens\n * assigned to each beneficiary account.\n * Beneficiaries claim for their allocated tokens.\n * Only the owner can withdraw tokens from this contract without limitations.\n * For the distribution to work this contract must be unlocked by the owner.\n */\ncontract GraphTokenDistributor is Ownable {\n using SafeMath for uint256;\n using SafeERC20 for IERC20;\n\n // -- State --\n\n bool public locked;\n mapping(address => uint256) public beneficiaries;\n\n IERC20 public token;\n\n // -- Events --\n\n event BeneficiaryUpdated(address indexed beneficiary, uint256 amount);\n event TokensDeposited(address indexed sender, uint256 amount);\n event TokensWithdrawn(address indexed sender, uint256 amount);\n event TokensClaimed(address indexed beneficiary, address to, uint256 amount);\n event LockUpdated(bool locked);\n\n modifier whenNotLocked() {\n require(locked == false, \"Distributor: Claim is locked\");\n _;\n }\n\n /**\n * Constructor.\n * @param _token Token to use for deposits and withdrawals\n */\n constructor(IERC20 _token) {\n token = _token;\n locked = true;\n }\n\n /**\n * Deposit tokens into the contract.\n * Even if the ERC20 token can be transferred directly to the contract\n * this function provide a safe interface to do the transfer and avoid mistakes\n * @param _amount Amount to deposit\n */\n function deposit(uint256 _amount) external {\n token.safeTransferFrom(msg.sender, address(this), _amount);\n emit TokensDeposited(msg.sender, _amount);\n }\n\n // -- Admin functions --\n\n /**\n * Add token balance available for account.\n * @param _account Address to assign tokens to\n * @param _amount Amount of tokens to assign to beneficiary\n */\n function addBeneficiaryTokens(address _account, uint256 _amount) external onlyOwner {\n _setBeneficiaryTokens(_account, beneficiaries[_account].add(_amount));\n }\n\n /**\n * Add token balance available for multiple accounts.\n * @param _accounts Addresses to assign tokens to\n * @param _amounts Amounts of tokens to assign to beneficiary\n */\n function addBeneficiaryTokensMulti(address[] calldata _accounts, uint256[] calldata _amounts) external onlyOwner {\n require(_accounts.length == _amounts.length, \"Distributor: !length\");\n for (uint256 i = 0; i < _accounts.length; i++) {\n _setBeneficiaryTokens(_accounts[i], beneficiaries[_accounts[i]].add(_amounts[i]));\n }\n }\n\n /**\n * Remove token balance available for account.\n * @param _account Address to assign tokens to\n * @param _amount Amount of tokens to assign to beneficiary\n */\n function subBeneficiaryTokens(address _account, uint256 _amount) external onlyOwner {\n _setBeneficiaryTokens(_account, beneficiaries[_account].sub(_amount));\n }\n\n /**\n * Remove token balance available for multiple accounts.\n * @param _accounts Addresses to assign tokens to\n * @param _amounts Amounts of tokens to assign to beneficiary\n */\n function subBeneficiaryTokensMulti(address[] calldata _accounts, uint256[] calldata _amounts) external onlyOwner {\n require(_accounts.length == _amounts.length, \"Distributor: !length\");\n for (uint256 i = 0; i < _accounts.length; i++) {\n _setBeneficiaryTokens(_accounts[i], beneficiaries[_accounts[i]].sub(_amounts[i]));\n }\n }\n\n /**\n * Set amount of tokens available for beneficiary account.\n * @param _account Address to assign tokens to\n * @param _amount Amount of tokens to assign to beneficiary\n */\n function _setBeneficiaryTokens(address _account, uint256 _amount) private {\n require(_account != address(0), \"Distributor: !account\");\n\n beneficiaries[_account] = _amount;\n emit BeneficiaryUpdated(_account, _amount);\n }\n\n /**\n * Set locked withdrawals.\n * @param _locked True to lock withdrawals\n */\n function setLocked(bool _locked) external onlyOwner {\n locked = _locked;\n emit LockUpdated(_locked);\n }\n\n /**\n * Withdraw tokens from the contract. This function is included as\n * a escape hatch in case of mistakes or to recover remaining funds.\n * @param _amount Amount of tokens to withdraw\n */\n function withdraw(uint256 _amount) external onlyOwner {\n token.safeTransfer(msg.sender, _amount);\n emit TokensWithdrawn(msg.sender, _amount);\n }\n\n // -- Beneficiary functions --\n\n /**\n * Claim tokens and send to caller.\n */\n function claim() external whenNotLocked {\n claimTo(msg.sender);\n }\n\n /**\n * Claim tokens and send to address.\n * @param _to Address where to send tokens\n */\n function claimTo(address _to) public whenNotLocked {\n uint256 claimableTokens = beneficiaries[msg.sender];\n require(claimableTokens > 0, \"Distributor: Unavailable funds\");\n\n _setBeneficiaryTokens(msg.sender, 0);\n\n token.safeTransfer(_to, claimableTokens);\n emit TokensClaimed(msg.sender, _to, claimableTokens);\n }\n}\n" + }, + "contracts/GraphTokenLock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport \"@openzeppelin/contracts/math/SafeMath.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\";\n\nimport { Ownable as OwnableInitializable } from \"./Ownable.sol\";\nimport \"./MathUtils.sol\";\nimport \"./IGraphTokenLock.sol\";\n\n/**\n * @title GraphTokenLock\n * @notice Contract that manages an unlocking schedule of tokens.\n * @dev The contract lock manage a number of tokens deposited into the contract to ensure that\n * they can only be released under certain time conditions.\n *\n * This contract implements a release scheduled based on periods and tokens are released in steps\n * after each period ends. It can be configured with one period in which case it is like a plain TimeLock.\n * It also supports revocation to be used for vesting schedules.\n *\n * The contract supports receiving extra funds than the managed tokens ones that can be\n * withdrawn by the beneficiary at any time.\n *\n * A releaseStartTime parameter is included to override the default release schedule and\n * perform the first release on the configured time. After that it will continue with the\n * default schedule.\n */\nabstract contract GraphTokenLock is OwnableInitializable, IGraphTokenLock {\n using SafeMath for uint256;\n using SafeERC20 for IERC20;\n\n uint256 private constant MIN_PERIOD = 1;\n\n // -- State --\n\n IERC20 public token;\n address public beneficiary;\n\n // Configuration\n\n // Amount of tokens managed by the contract schedule\n uint256 public managedAmount;\n\n uint256 public startTime; // Start datetime (in unixtimestamp)\n uint256 public endTime; // Datetime after all funds are fully vested/unlocked (in unixtimestamp)\n uint256 public periods; // Number of vesting/release periods\n\n // First release date for tokens (in unixtimestamp)\n // If set, no tokens will be released before releaseStartTime ignoring\n // the amount to release each period\n uint256 public releaseStartTime;\n // A cliff set a date to which a beneficiary needs to get to vest\n // all preceding periods\n uint256 public vestingCliffTime;\n Revocability public revocable; // Whether to use vesting for locked funds\n\n // State\n\n bool public isRevoked;\n bool public isInitialized;\n bool public isAccepted;\n uint256 public releasedAmount;\n uint256 public revokedAmount;\n\n // -- Events --\n\n event TokensReleased(address indexed beneficiary, uint256 amount);\n event TokensWithdrawn(address indexed beneficiary, uint256 amount);\n event TokensRevoked(address indexed beneficiary, uint256 amount);\n event BeneficiaryChanged(address newBeneficiary);\n event LockAccepted();\n event LockCanceled();\n\n /**\n * @dev Only allow calls from the beneficiary of the contract\n */\n modifier onlyBeneficiary() {\n require(msg.sender == beneficiary, \"!auth\");\n _;\n }\n\n /**\n * @notice Initializes the contract\n * @param _owner Address of the contract owner\n * @param _beneficiary Address of the beneficiary of locked tokens\n * @param _managedAmount Amount of tokens to be managed by the lock contract\n * @param _startTime Start time of the release schedule\n * @param _endTime End time of the release schedule\n * @param _periods Number of periods between start time and end time\n * @param _releaseStartTime Override time for when the releases start\n * @param _vestingCliffTime Override time for when the vesting start\n * @param _revocable Whether the contract is revocable\n */\n function _initialize(\n address _owner,\n address _beneficiary,\n address _token,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n Revocability _revocable\n ) internal {\n require(!isInitialized, \"Already initialized\");\n require(_owner != address(0), \"Owner cannot be zero\");\n require(_beneficiary != address(0), \"Beneficiary cannot be zero\");\n require(_token != address(0), \"Token cannot be zero\");\n require(_managedAmount > 0, \"Managed tokens cannot be zero\");\n require(_startTime != 0, \"Start time must be set\");\n require(_startTime < _endTime, \"Start time > end time\");\n require(_periods >= MIN_PERIOD, \"Periods cannot be below minimum\");\n require(_revocable != Revocability.NotSet, \"Must set a revocability option\");\n require(_releaseStartTime < _endTime, \"Release start time must be before end time\");\n require(_vestingCliffTime < _endTime, \"Cliff time must be before end time\");\n\n isInitialized = true;\n\n OwnableInitializable._initialize(_owner);\n beneficiary = _beneficiary;\n token = IERC20(_token);\n\n managedAmount = _managedAmount;\n\n startTime = _startTime;\n endTime = _endTime;\n periods = _periods;\n\n // Optionals\n releaseStartTime = _releaseStartTime;\n vestingCliffTime = _vestingCliffTime;\n revocable = _revocable;\n }\n\n /**\n * @notice Change the beneficiary of funds managed by the contract\n * @dev Can only be called by the beneficiary\n * @param _newBeneficiary Address of the new beneficiary address\n */\n function changeBeneficiary(address _newBeneficiary) external onlyBeneficiary {\n require(_newBeneficiary != address(0), \"Empty beneficiary\");\n beneficiary = _newBeneficiary;\n emit BeneficiaryChanged(_newBeneficiary);\n }\n\n /**\n * @notice Beneficiary accepts the lock, the owner cannot retrieve back the tokens\n * @dev Can only be called by the beneficiary\n */\n function acceptLock() external onlyBeneficiary {\n isAccepted = true;\n emit LockAccepted();\n }\n\n /**\n * @notice Owner cancel the lock and return the balance in the contract\n * @dev Can only be called by the owner\n */\n function cancelLock() external onlyOwner {\n require(isAccepted == false, \"Cannot cancel accepted contract\");\n\n token.safeTransfer(owner(), currentBalance());\n\n emit LockCanceled();\n }\n\n // -- Balances --\n\n /**\n * @notice Returns the amount of tokens currently held by the contract\n * @return Tokens held in the contract\n */\n function currentBalance() public view override returns (uint256) {\n return token.balanceOf(address(this));\n }\n\n // -- Time & Periods --\n\n /**\n * @notice Returns the current block timestamp\n * @return Current block timestamp\n */\n function currentTime() public view override returns (uint256) {\n return block.timestamp;\n }\n\n /**\n * @notice Gets duration of contract from start to end in seconds\n * @return Amount of seconds from contract startTime to endTime\n */\n function duration() public view override returns (uint256) {\n return endTime.sub(startTime);\n }\n\n /**\n * @notice Gets time elapsed since the start of the contract\n * @dev Returns zero if called before conctract starTime\n * @return Seconds elapsed from contract startTime\n */\n function sinceStartTime() public view override returns (uint256) {\n uint256 current = currentTime();\n if (current <= startTime) {\n return 0;\n }\n return current.sub(startTime);\n }\n\n /**\n * @notice Returns amount available to be released after each period according to schedule\n * @return Amount of tokens available after each period\n */\n function amountPerPeriod() public view override returns (uint256) {\n return managedAmount.div(periods);\n }\n\n /**\n * @notice Returns the duration of each period in seconds\n * @return Duration of each period in seconds\n */\n function periodDuration() public view override returns (uint256) {\n return duration().div(periods);\n }\n\n /**\n * @notice Gets the current period based on the schedule\n * @return A number that represents the current period\n */\n function currentPeriod() public view override returns (uint256) {\n return sinceStartTime().div(periodDuration()).add(MIN_PERIOD);\n }\n\n /**\n * @notice Gets the number of periods that passed since the first period\n * @return A number of periods that passed since the schedule started\n */\n function passedPeriods() public view override returns (uint256) {\n return currentPeriod().sub(MIN_PERIOD);\n }\n\n // -- Locking & Release Schedule --\n\n /**\n * @notice Gets the currently available token according to the schedule\n * @dev Implements the step-by-step schedule based on periods for available tokens\n * @return Amount of tokens available according to the schedule\n */\n function availableAmount() public view override returns (uint256) {\n uint256 current = currentTime();\n\n // Before contract start no funds are available\n if (current < startTime) {\n return 0;\n }\n\n // After contract ended all funds are available\n if (current > endTime) {\n return managedAmount;\n }\n\n // Get available amount based on period\n return passedPeriods().mul(amountPerPeriod());\n }\n\n /**\n * @notice Gets the amount of currently vested tokens\n * @dev Similar to available amount, but is fully vested when contract is non-revocable\n * @return Amount of tokens already vested\n */\n function vestedAmount() public view override returns (uint256) {\n // If non-revocable it is fully vested\n if (revocable == Revocability.Disabled) {\n return managedAmount;\n }\n\n // Vesting cliff is activated and it has not passed means nothing is vested yet\n if (vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\n return 0;\n }\n\n return availableAmount();\n }\n\n /**\n * @notice Gets tokens currently available for release\n * @dev Considers the schedule and takes into account already released tokens\n * @return Amount of tokens ready to be released\n */\n function releasableAmount() public view virtual override returns (uint256) {\n // If a release start time is set no tokens are available for release before this date\n // If not set it follows the default schedule and tokens are available on\n // the first period passed\n if (releaseStartTime > 0 && currentTime() < releaseStartTime) {\n return 0;\n }\n\n // Vesting cliff is activated and it has not passed means nothing is vested yet\n // so funds cannot be released\n if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\n return 0;\n }\n\n // A beneficiary can never have more releasable tokens than the contract balance\n uint256 releasable = availableAmount().sub(releasedAmount);\n return MathUtils.min(currentBalance(), releasable);\n }\n\n /**\n * @notice Gets the outstanding amount yet to be released based on the whole contract lifetime\n * @dev Does not consider schedule but just global amounts tracked\n * @return Amount of outstanding tokens for the lifetime of the contract\n */\n function totalOutstandingAmount() public view override returns (uint256) {\n return managedAmount.sub(releasedAmount).sub(revokedAmount);\n }\n\n /**\n * @notice Gets surplus amount in the contract based on outstanding amount to release\n * @dev All funds over outstanding amount is considered surplus that can be withdrawn by beneficiary.\n * Note this might not be the correct value for wallets transferred to L2 (i.e. an L2GraphTokenLockWallet), as the released amount will be\n * skewed, so the beneficiary might have to bridge back to L1 to release the surplus.\n * @return Amount of tokens considered as surplus\n */\n function surplusAmount() public view override returns (uint256) {\n uint256 balance = currentBalance();\n uint256 outstandingAmount = totalOutstandingAmount();\n if (balance > outstandingAmount) {\n return balance.sub(outstandingAmount);\n }\n return 0;\n }\n\n // -- Value Transfer --\n\n /**\n * @notice Releases tokens based on the configured schedule\n * @dev All available releasable tokens are transferred to beneficiary\n */\n function release() external override onlyBeneficiary {\n uint256 amountToRelease = releasableAmount();\n require(amountToRelease > 0, \"No available releasable amount\");\n\n releasedAmount = releasedAmount.add(amountToRelease);\n\n token.safeTransfer(beneficiary, amountToRelease);\n\n emit TokensReleased(beneficiary, amountToRelease);\n }\n\n /**\n * @notice Withdraws surplus, unmanaged tokens from the contract\n * @dev Tokens in the contract over outstanding amount are considered as surplus\n * @param _amount Amount of tokens to withdraw\n */\n function withdrawSurplus(uint256 _amount) external override onlyBeneficiary {\n require(_amount > 0, \"Amount cannot be zero\");\n require(surplusAmount() >= _amount, \"Amount requested > surplus available\");\n\n token.safeTransfer(beneficiary, _amount);\n\n emit TokensWithdrawn(beneficiary, _amount);\n }\n\n /**\n * @notice Revokes a vesting schedule and return the unvested tokens to the owner\n * @dev Vesting schedule is always calculated based on managed tokens\n */\n function revoke() external override onlyOwner {\n require(revocable == Revocability.Enabled, \"Contract is non-revocable\");\n require(isRevoked == false, \"Already revoked\");\n\n uint256 unvestedAmount = managedAmount.sub(vestedAmount());\n require(unvestedAmount > 0, \"No available unvested amount\");\n\n revokedAmount = unvestedAmount;\n isRevoked = true;\n\n token.safeTransfer(owner(), unvestedAmount);\n\n emit TokensRevoked(beneficiary, unvestedAmount);\n }\n}\n" + }, + "contracts/GraphTokenLockManager.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\";\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"@openzeppelin/contracts/utils/EnumerableSet.sol\";\nimport { Ownable } from \"@openzeppelin/contracts/access/Ownable.sol\";\n\nimport \"./MinimalProxyFactory.sol\";\nimport \"./IGraphTokenLockManager.sol\";\nimport { GraphTokenLockWallet } from \"./GraphTokenLockWallet.sol\";\n\n/**\n * @title GraphTokenLockManager\n * @notice This contract manages a list of authorized function calls and targets that can be called\n * by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts.\n *\n * This contract receives funds to make the process of creating TokenLockWallet contracts\n * easier by distributing them the initial tokens to be managed.\n *\n * The owner can setup a list of token destinations that will be used by TokenLock contracts to\n * approve the pulling of funds, this way in can be guaranteed that only protocol contracts\n * will manipulate users funds.\n */\ncontract GraphTokenLockManager is Ownable, MinimalProxyFactory, IGraphTokenLockManager {\n using SafeERC20 for IERC20;\n using EnumerableSet for EnumerableSet.AddressSet;\n\n // -- State --\n\n mapping(bytes4 => address) public authFnCalls;\n EnumerableSet.AddressSet private _tokenDestinations;\n\n address public masterCopy;\n IERC20 internal _token;\n\n // -- Events --\n\n event MasterCopyUpdated(address indexed masterCopy);\n event TokenLockCreated(\n address indexed contractAddress,\n bytes32 indexed initHash,\n address indexed beneficiary,\n address token,\n uint256 managedAmount,\n uint256 startTime,\n uint256 endTime,\n uint256 periods,\n uint256 releaseStartTime,\n uint256 vestingCliffTime,\n IGraphTokenLock.Revocability revocable\n );\n\n event TokensDeposited(address indexed sender, uint256 amount);\n event TokensWithdrawn(address indexed sender, uint256 amount);\n\n event FunctionCallAuth(address indexed caller, bytes4 indexed sigHash, address indexed target, string signature);\n event TokenDestinationAllowed(address indexed dst, bool allowed);\n\n /**\n * Constructor.\n * @param _graphToken Token to use for deposits and withdrawals\n * @param _masterCopy Address of the master copy to use to clone proxies\n */\n constructor(IERC20 _graphToken, address _masterCopy) {\n require(address(_graphToken) != address(0), \"Token cannot be zero\");\n _token = _graphToken;\n setMasterCopy(_masterCopy);\n }\n\n // -- Factory --\n\n /**\n * @notice Sets the masterCopy bytecode to use to create clones of TokenLock contracts\n * @param _masterCopy Address of contract bytecode to factory clone\n */\n function setMasterCopy(address _masterCopy) public override onlyOwner {\n require(_masterCopy != address(0), \"MasterCopy cannot be zero\");\n masterCopy = _masterCopy;\n emit MasterCopyUpdated(_masterCopy);\n }\n\n /**\n * @notice Creates and fund a new token lock wallet using a minimum proxy\n * @param _owner Address of the contract owner\n * @param _beneficiary Address of the beneficiary of locked tokens\n * @param _managedAmount Amount of tokens to be managed by the lock contract\n * @param _startTime Start time of the release schedule\n * @param _endTime End time of the release schedule\n * @param _periods Number of periods between start time and end time\n * @param _releaseStartTime Override time for when the releases start\n * @param _revocable Whether the contract is revocable\n */\n function createTokenLockWallet(\n address _owner,\n address _beneficiary,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n IGraphTokenLock.Revocability _revocable\n ) external override onlyOwner {\n require(_token.balanceOf(address(this)) >= _managedAmount, \"Not enough tokens to create lock\");\n\n // Create contract using a minimal proxy and call initializer\n bytes memory initializer = abi.encodeWithSelector(\n GraphTokenLockWallet.initialize.selector,\n address(this),\n _owner,\n _beneficiary,\n address(_token),\n _managedAmount,\n _startTime,\n _endTime,\n _periods,\n _releaseStartTime,\n _vestingCliffTime,\n _revocable\n );\n address contractAddress = _deployProxy2(keccak256(initializer), masterCopy, initializer);\n\n // Send managed amount to the created contract\n _token.safeTransfer(contractAddress, _managedAmount);\n\n emit TokenLockCreated(\n contractAddress,\n keccak256(initializer),\n _beneficiary,\n address(_token),\n _managedAmount,\n _startTime,\n _endTime,\n _periods,\n _releaseStartTime,\n _vestingCliffTime,\n _revocable\n );\n }\n\n // -- Funds Management --\n\n /**\n * @notice Gets the GRT token address\n * @return Token used for transfers and approvals\n */\n function token() external view override returns (IERC20) {\n return _token;\n }\n\n /**\n * @notice Deposits tokens into the contract\n * @dev Even if the ERC20 token can be transferred directly to the contract\n * this function provide a safe interface to do the transfer and avoid mistakes\n * @param _amount Amount to deposit\n */\n function deposit(uint256 _amount) external override {\n require(_amount > 0, \"Amount cannot be zero\");\n _token.safeTransferFrom(msg.sender, address(this), _amount);\n emit TokensDeposited(msg.sender, _amount);\n }\n\n /**\n * @notice Withdraws tokens from the contract\n * @dev Escape hatch in case of mistakes or to recover remaining funds\n * @param _amount Amount of tokens to withdraw\n */\n function withdraw(uint256 _amount) external override onlyOwner {\n require(_amount > 0, \"Amount cannot be zero\");\n _token.safeTransfer(msg.sender, _amount);\n emit TokensWithdrawn(msg.sender, _amount);\n }\n\n // -- Token Destinations --\n\n /**\n * @notice Adds an address that can be allowed by a token lock to pull funds\n * @param _dst Destination address\n */\n function addTokenDestination(address _dst) external override onlyOwner {\n require(_dst != address(0), \"Destination cannot be zero\");\n require(_tokenDestinations.add(_dst), \"Destination already added\");\n emit TokenDestinationAllowed(_dst, true);\n }\n\n /**\n * @notice Removes an address that can be allowed by a token lock to pull funds\n * @param _dst Destination address\n */\n function removeTokenDestination(address _dst) external override onlyOwner {\n require(_tokenDestinations.remove(_dst), \"Destination already removed\");\n emit TokenDestinationAllowed(_dst, false);\n }\n\n /**\n * @notice Returns True if the address is authorized to be a destination of tokens\n * @param _dst Destination address\n * @return True if authorized\n */\n function isTokenDestination(address _dst) external view override returns (bool) {\n return _tokenDestinations.contains(_dst);\n }\n\n /**\n * @notice Returns an array of authorized destination addresses\n * @return Array of addresses authorized to pull funds from a token lock\n */\n function getTokenDestinations() external view override returns (address[] memory) {\n address[] memory dstList = new address[](_tokenDestinations.length());\n for (uint256 i = 0; i < _tokenDestinations.length(); i++) {\n dstList[i] = _tokenDestinations.at(i);\n }\n return dstList;\n }\n\n // -- Function Call Authorization --\n\n /**\n * @notice Sets an authorized function call to target\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\n * @param _signature Function signature\n * @param _target Address of the destination contract to call\n */\n function setAuthFunctionCall(string calldata _signature, address _target) external override onlyOwner {\n _setAuthFunctionCall(_signature, _target);\n }\n\n /**\n * @notice Unsets an authorized function call to target\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\n * @param _signature Function signature\n */\n function unsetAuthFunctionCall(string calldata _signature) external override onlyOwner {\n bytes4 sigHash = _toFunctionSigHash(_signature);\n authFnCalls[sigHash] = address(0);\n\n emit FunctionCallAuth(msg.sender, sigHash, address(0), _signature);\n }\n\n /**\n * @notice Sets an authorized function call to target in bulk\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\n * @param _signatures Function signatures\n * @param _targets Address of the destination contract to call\n */\n function setAuthFunctionCallMany(\n string[] calldata _signatures,\n address[] calldata _targets\n ) external override onlyOwner {\n require(_signatures.length == _targets.length, \"Array length mismatch\");\n\n for (uint256 i = 0; i < _signatures.length; i++) {\n _setAuthFunctionCall(_signatures[i], _targets[i]);\n }\n }\n\n /**\n * @notice Sets an authorized function call to target\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\n * @dev Function signatures of Graph Protocol contracts to be used are known ahead of time\n * @param _signature Function signature\n * @param _target Address of the destination contract to call\n */\n function _setAuthFunctionCall(string calldata _signature, address _target) internal {\n require(_target != address(this), \"Target must be other contract\");\n require(Address.isContract(_target), \"Target must be a contract\");\n\n bytes4 sigHash = _toFunctionSigHash(_signature);\n authFnCalls[sigHash] = _target;\n\n emit FunctionCallAuth(msg.sender, sigHash, _target, _signature);\n }\n\n /**\n * @notice Gets the target contract to call for a particular function signature\n * @param _sigHash Function signature hash\n * @return Address of the target contract where to send the call\n */\n function getAuthFunctionCallTarget(bytes4 _sigHash) public view override returns (address) {\n return authFnCalls[_sigHash];\n }\n\n /**\n * @notice Returns true if the function call is authorized\n * @param _sigHash Function signature hash\n * @return True if authorized\n */\n function isAuthFunctionCall(bytes4 _sigHash) external view override returns (bool) {\n return getAuthFunctionCallTarget(_sigHash) != address(0);\n }\n\n /**\n * @dev Converts a function signature string to 4-bytes hash\n * @param _signature Function signature string\n * @return Function signature hash\n */\n function _toFunctionSigHash(string calldata _signature) internal pure returns (bytes4) {\n return _convertToBytes4(abi.encodeWithSignature(_signature));\n }\n\n /**\n * @dev Converts function signature bytes to function signature hash (bytes4)\n * @param _signature Function signature\n * @return Function signature in bytes4\n */\n function _convertToBytes4(bytes memory _signature) internal pure returns (bytes4) {\n require(_signature.length == 4, \"Invalid method signature\");\n bytes4 sigHash;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n sigHash := mload(add(_signature, 32))\n }\n return sigHash;\n }\n}\n" + }, + "contracts/GraphTokenLockSimple.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport \"./GraphTokenLock.sol\";\n\n/**\n * @title GraphTokenLockSimple\n * @notice This contract is the concrete simple implementation built on top of the base\n * GraphTokenLock functionality for use when we only need the token lock schedule\n * features but no interaction with the network.\n *\n * This contract is designed to be deployed without the use of a TokenManager.\n */\ncontract GraphTokenLockSimple is GraphTokenLock {\n // Constructor\n constructor() {\n OwnableInitializable._initialize(msg.sender);\n }\n\n // Initializer\n function initialize(\n address _owner,\n address _beneficiary,\n address _token,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n Revocability _revocable\n ) external onlyOwner {\n _initialize(\n _owner,\n _beneficiary,\n _token,\n _managedAmount,\n _startTime,\n _endTime,\n _periods,\n _releaseStartTime,\n _vestingCliffTime,\n _revocable\n );\n }\n}\n" + }, + "contracts/GraphTokenLockWallet.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"@openzeppelin/contracts/math/SafeMath.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\nimport \"./GraphTokenLock.sol\";\nimport \"./IGraphTokenLockManager.sol\";\n\n/**\n * @title GraphTokenLockWallet\n * @notice This contract is built on top of the base GraphTokenLock functionality.\n * It allows wallet beneficiaries to use the deposited funds to perform specific function calls\n * on specific contracts.\n *\n * The idea is that supporters with locked tokens can participate in the protocol\n * but disallow any release before the vesting/lock schedule.\n * The beneficiary can issue authorized function calls to this contract that will\n * get forwarded to a target contract. A target contract is any of our protocol contracts.\n * The function calls allowed are queried to the GraphTokenLockManager, this way\n * the same configuration can be shared for all the created lock wallet contracts.\n *\n * NOTE: Contracts used as target must have its function signatures checked to avoid collisions\n * with any of this contract functions.\n * Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience\n * the maximum amount of tokens is authorized.\n * Function calls do not forward ETH value so DO NOT SEND ETH TO THIS CONTRACT.\n */\ncontract GraphTokenLockWallet is GraphTokenLock {\n using SafeMath for uint256;\n\n // -- State --\n\n IGraphTokenLockManager public manager;\n uint256 public usedAmount;\n\n // -- Events --\n\n event ManagerUpdated(address indexed _oldManager, address indexed _newManager);\n event TokenDestinationsApproved();\n event TokenDestinationsRevoked();\n\n // Initializer\n function initialize(\n address _manager,\n address _owner,\n address _beneficiary,\n address _token,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n Revocability _revocable\n ) external {\n _initialize(\n _owner,\n _beneficiary,\n _token,\n _managedAmount,\n _startTime,\n _endTime,\n _periods,\n _releaseStartTime,\n _vestingCliffTime,\n _revocable\n );\n _setManager(_manager);\n }\n\n // -- Admin --\n\n /**\n * @notice Sets a new manager for this contract\n * @param _newManager Address of the new manager\n */\n function setManager(address _newManager) external onlyOwner {\n _setManager(_newManager);\n }\n\n /**\n * @dev Sets a new manager for this contract\n * @param _newManager Address of the new manager\n */\n function _setManager(address _newManager) internal {\n require(_newManager != address(0), \"Manager cannot be empty\");\n require(Address.isContract(_newManager), \"Manager must be a contract\");\n\n address oldManager = address(manager);\n manager = IGraphTokenLockManager(_newManager);\n\n emit ManagerUpdated(oldManager, _newManager);\n }\n\n // -- Beneficiary --\n\n /**\n * @notice Approves protocol access of the tokens managed by this contract\n * @dev Approves all token destinations registered in the manager to pull tokens\n */\n function approveProtocol() external onlyBeneficiary {\n address[] memory dstList = manager.getTokenDestinations();\n for (uint256 i = 0; i < dstList.length; i++) {\n // Note this is only safe because we are using the max uint256 value\n token.approve(dstList[i], type(uint256).max);\n }\n emit TokenDestinationsApproved();\n }\n\n /**\n * @notice Revokes protocol access of the tokens managed by this contract\n * @dev Revokes approval to all token destinations in the manager to pull tokens\n */\n function revokeProtocol() external onlyBeneficiary {\n address[] memory dstList = manager.getTokenDestinations();\n for (uint256 i = 0; i < dstList.length; i++) {\n // Note this is only safe cause we're using 0 as the amount\n token.approve(dstList[i], 0);\n }\n emit TokenDestinationsRevoked();\n }\n\n /**\n * @notice Gets tokens currently available for release\n * @dev Considers the schedule, takes into account already released tokens and used amount\n * @return Amount of tokens ready to be released\n */\n function releasableAmount() public view override returns (uint256) {\n if (revocable == Revocability.Disabled) {\n return super.releasableAmount();\n }\n\n // -- Revocability enabled logic\n // This needs to deal with additional considerations for when tokens are used in the protocol\n\n // If a release start time is set no tokens are available for release before this date\n // If not set it follows the default schedule and tokens are available on\n // the first period passed\n if (releaseStartTime > 0 && currentTime() < releaseStartTime) {\n return 0;\n }\n\n // Vesting cliff is activated and it has not passed means nothing is vested yet\n // so funds cannot be released\n if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\n return 0;\n }\n\n // A beneficiary can never have more releasable tokens than the contract balance\n // We consider the `usedAmount` in the protocol as part of the calculations\n // the beneficiary should not release funds that are used.\n uint256 releasable = availableAmount().sub(releasedAmount).sub(usedAmount);\n return MathUtils.min(currentBalance(), releasable);\n }\n\n /**\n * @notice Forward authorized contract calls to protocol contracts\n * @dev Fallback function can be called by the beneficiary only if function call is allowed\n */\n // solhint-disable-next-line no-complex-fallback\n fallback() external payable {\n // Only beneficiary can forward calls\n require(msg.sender == beneficiary, \"Unauthorized caller\");\n require(msg.value == 0, \"ETH transfers not supported\");\n\n // Function call validation\n address _target = manager.getAuthFunctionCallTarget(msg.sig);\n require(_target != address(0), \"Unauthorized function\");\n\n uint256 oldBalance = currentBalance();\n\n // Call function with data\n Address.functionCall(_target, msg.data);\n\n // Tracked used tokens in the protocol\n // We do this check after balances were updated by the forwarded call\n // Check is only enforced for revocable contracts to save some gas\n if (revocable == Revocability.Enabled) {\n // Track contract balance change\n uint256 newBalance = currentBalance();\n if (newBalance < oldBalance) {\n // Outflow\n uint256 diff = oldBalance.sub(newBalance);\n usedAmount = usedAmount.add(diff);\n } else {\n // Inflow: We can receive profits from the protocol, that could make usedAmount to\n // underflow. We set it to zero in that case.\n uint256 diff = newBalance.sub(oldBalance);\n usedAmount = (diff >= usedAmount) ? 0 : usedAmount.sub(diff);\n }\n require(usedAmount <= vestedAmount(), \"Cannot use more tokens than vested amount\");\n }\n }\n\n /**\n * @notice Receive function that always reverts.\n * @dev Only included to supress warnings, see https://github.com/ethereum/solidity/issues/10159\n */\n receive() external payable {\n revert(\"Bad call\");\n }\n}\n" + }, + "contracts/ICallhookReceiver.sol": { + "content": "// SPDX-License-Identifier: GPL-2.0-or-later\n\n// Copied from graphprotocol/contracts, changed solidity version to 0.7.3\n\n/**\n * @title Interface for contracts that can receive callhooks through the Arbitrum GRT bridge\n * @dev Any contract that can receive a callhook on L2, sent through the bridge from L1, must\n * be allowlisted by the governor, but also implement this interface that contains\n * the function that will actually be called by the L2GraphTokenGateway.\n */\npragma solidity ^0.7.3;\n\ninterface ICallhookReceiver {\n /**\n * @notice Receive tokens with a callhook from the bridge\n * @param _from Token sender in L1\n * @param _amount Amount of tokens that were transferred\n * @param _data ABI-encoded callhook data\n */\n function onTokenTransfer(address _from, uint256 _amount, bytes calldata _data) external;\n}\n" + }, + "contracts/IGraphTokenLock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\ninterface IGraphTokenLock {\n enum Revocability {\n NotSet,\n Enabled,\n Disabled\n }\n\n // -- Balances --\n\n function currentBalance() external view returns (uint256);\n\n // -- Time & Periods --\n\n function currentTime() external view returns (uint256);\n\n function duration() external view returns (uint256);\n\n function sinceStartTime() external view returns (uint256);\n\n function amountPerPeriod() external view returns (uint256);\n\n function periodDuration() external view returns (uint256);\n\n function currentPeriod() external view returns (uint256);\n\n function passedPeriods() external view returns (uint256);\n\n // -- Locking & Release Schedule --\n\n function availableAmount() external view returns (uint256);\n\n function vestedAmount() external view returns (uint256);\n\n function releasableAmount() external view returns (uint256);\n\n function totalOutstandingAmount() external view returns (uint256);\n\n function surplusAmount() external view returns (uint256);\n\n // -- Value Transfer --\n\n function release() external;\n\n function withdrawSurplus(uint256 _amount) external;\n\n function revoke() external;\n}\n" + }, + "contracts/IGraphTokenLockManager.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\nimport \"./IGraphTokenLock.sol\";\n\ninterface IGraphTokenLockManager {\n // -- Factory --\n\n function setMasterCopy(address _masterCopy) external;\n\n function createTokenLockWallet(\n address _owner,\n address _beneficiary,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n IGraphTokenLock.Revocability _revocable\n ) external;\n\n // -- Funds Management --\n\n function token() external returns (IERC20);\n\n function deposit(uint256 _amount) external;\n\n function withdraw(uint256 _amount) external;\n\n // -- Allowed Funds Destinations --\n\n function addTokenDestination(address _dst) external;\n\n function removeTokenDestination(address _dst) external;\n\n function isTokenDestination(address _dst) external view returns (bool);\n\n function getTokenDestinations() external view returns (address[] memory);\n\n // -- Function Call Authorization --\n\n function setAuthFunctionCall(string calldata _signature, address _target) external;\n\n function unsetAuthFunctionCall(string calldata _signature) external;\n\n function setAuthFunctionCallMany(string[] calldata _signatures, address[] calldata _targets) external;\n\n function getAuthFunctionCallTarget(bytes4 _sigHash) external view returns (address);\n\n function isAuthFunctionCall(bytes4 _sigHash) external view returns (bool);\n}\n" + }, + "contracts/L1GraphTokenLockTransferTool.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport { AddressUpgradeable } from \"@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol\";\nimport { ITokenGateway } from \"./arbitrum/ITokenGateway.sol\";\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport { L2GraphTokenLockManager } from \"./L2GraphTokenLockManager.sol\";\nimport { GraphTokenLockWallet } from \"./GraphTokenLockWallet.sol\";\nimport { MinimalProxyFactory } from \"./MinimalProxyFactory.sol\";\nimport { IGraphTokenLock } from \"./IGraphTokenLock.sol\";\nimport { Ownable as OwnableInitializable } from \"./Ownable.sol\";\nimport { SafeMathUpgradeable } from \"@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol\";\nimport { Initializable } from \"@openzeppelin/contracts-upgradeable/proxy/Initializable.sol\";\n\n/**\n * @title L1GraphTokenLockTransferTool contract\n * @notice This contract is used to transfer GRT from GraphTokenLockWallets\n * to a counterpart on L2. It is deployed on L1 and will send the GRT through\n * the L1GraphTokenGateway with a callhook to the L2GraphTokenLockManager, including\n * data to create a L2GraphTokenLockWallet on L2.\n *\n * Note that the L2GraphTokenLockWallet will not allow releasing any GRT until the end of\n * the vesting timeline, but will allow sending the GRT back to the L1 wallet.\n *\n * Beneficiaries for a GraphTokenLockWallet can perform the depositToL2Locked call\n * as many times as they want, and the GRT will be sent to the same L2GraphTokenLockWallet.\n *\n * Since all retryable tickets to send transactions to L2 require ETH for gas, this\n * contract also allows users to deposit ETH to be used for gas on L2, both for\n * the depositToL2Locked calls and for the transfer tools in the Staking contract for\n * The Graph.\n *\n * See GIP-0046 for more details: https://forum.thegraph.com/t/4023\n */\ncontract L1GraphTokenLockTransferTool is OwnableInitializable, Initializable, MinimalProxyFactory {\n using SafeMathUpgradeable for uint256;\n\n /// Address of the L1 GRT token contract\n IERC20 public immutable graphToken;\n /// Address of the L2GraphTokenLockWallet implementation in L2, used to compute L2 wallet addresses\n address public immutable l2Implementation;\n /// Address of the L1GraphTokenGateway contract\n ITokenGateway public immutable l1Gateway;\n /// Address of the Staking contract, used to pull ETH for L2 ticket gas\n address payable public immutable staking;\n /// L2 lock manager for each L1 lock manager.\n /// L1 GraphTokenLockManager => L2GraphTokenLockManager\n mapping(address => address) public l2LockManager;\n /// L2 wallet owner for each L1 wallet owner.\n /// L1 wallet owner => L2 wallet owner\n mapping(address => address) public l2WalletOwner;\n /// L2 wallet address for each L1 wallet address.\n /// L1 wallet => L2 wallet\n mapping(address => address) public l2WalletAddress;\n /// ETH balance from each token lock, used to pay for L2 gas:\n /// L1 wallet address => ETH balance\n mapping(address => uint256) public tokenLockETHBalances;\n /// L2 beneficiary corresponding to each L1 wallet address.\n /// L1 wallet => L2 beneficiary\n mapping(address => address) public l2Beneficiary;\n /// Indicates whether an L2 wallet address for a wallet\n /// has been set manually, in which case it can't call depositToL2Locked.\n /// L1 wallet => bool\n mapping(address => bool) public l2WalletAddressSetManually;\n\n /// @dev Emitted when the L2 lock manager for an L1 lock manager is set\n event L2LockManagerSet(address indexed l1LockManager, address indexed l2LockManager);\n /// @dev Emitted when the L2 wallet owner for an L1 wallet owner is set\n event L2WalletOwnerSet(address indexed l1WalletOwner, address indexed l2WalletOwner);\n /// @dev Emitted when GRT is sent to L2 from a token lock\n event LockedFundsSentToL2(\n address indexed l1Wallet,\n address indexed l2Wallet,\n address indexed l1LockManager,\n address l2LockManager,\n uint256 amount\n );\n /// @dev Emitted when an L2 wallet address is set for an L1 wallet\n event L2WalletAddressSet(address indexed l1Wallet, address indexed l2Wallet);\n /// @dev Emitted when ETH is deposited to a token lock's account\n event ETHDeposited(address indexed tokenLock, uint256 amount);\n /// @dev Emitted when ETH is withdrawn from a token lock's account\n event ETHWithdrawn(address indexed tokenLock, address indexed destination, uint256 amount);\n /// @dev Emitted when ETH is pulled from a token lock's account by Staking or this tool to pay for an L2 ticket\n event ETHPulled(address indexed tokenLock, uint256 amount);\n /// @dev Emitted when the L2 beneficiary for a partially vested L1 lock is set\n event L2BeneficiarySet(address indexed l1Wallet, address indexed l2Beneficiary);\n\n /**\n * @notice Construct a new L1GraphTokenLockTransferTool contract\n * @dev The deployer of the contract will become its owner.\n * Note this contract is meant to be deployed behind a transparent proxy,\n * so this will run at the implementation's storage context; it will set\n * immutable variables and make the implementation be owned by the deployer.\n * @param _graphToken Address of the L1 GRT token contract\n * @param _l2Implementation Address of the L2GraphTokenLockWallet implementation in L2\n * @param _l1Gateway Address of the L1GraphTokenGateway contract\n * @param _staking Address of the Staking contract\n */\n constructor(\n IERC20 _graphToken,\n address _l2Implementation,\n ITokenGateway _l1Gateway,\n address payable _staking\n ) initializer {\n OwnableInitializable._initialize(msg.sender);\n graphToken = _graphToken;\n l2Implementation = _l2Implementation;\n l1Gateway = _l1Gateway;\n staking = _staking;\n }\n\n /**\n * @notice Initialize the L1GraphTokenLockTransferTool contract\n * @dev This function will run in the proxy's storage context, so it will\n * set the owner of the proxy contract which can be different from the implementation owner.\n * @param _owner Address of the owner of the L1GraphTokenLockTransferTool contract\n */\n function initialize(address _owner) external initializer {\n OwnableInitializable._initialize(_owner);\n }\n\n /**\n * @notice Set the L2 lock manager that corresponds to an L1 lock manager\n * @param _l1LockManager Address of the L1 lock manager\n * @param _l2LockManager Address of the L2 lock manager (in L2)\n */\n function setL2LockManager(address _l1LockManager, address _l2LockManager) external onlyOwner {\n l2LockManager[_l1LockManager] = _l2LockManager;\n emit L2LockManagerSet(_l1LockManager, _l2LockManager);\n }\n\n /**\n * @notice Set the L2 wallet owner that corresponds to an L1 wallet owner\n * @param _l1WalletOwner Address of the L1 wallet owner\n * @param _l2WalletOwner Address of the L2 wallet owner (in L2)\n */\n function setL2WalletOwner(address _l1WalletOwner, address _l2WalletOwner) external onlyOwner {\n l2WalletOwner[_l1WalletOwner] = _l2WalletOwner;\n emit L2WalletOwnerSet(_l1WalletOwner, _l2WalletOwner);\n }\n\n /**\n * @notice Deposit ETH on a token lock's account, to be used for L2 retryable ticket gas.\n * This function can be called by anyone, but the ETH will be credited to the token lock.\n * DO NOT try to call this through the token lock, as locks do not forward ETH value (and the\n * function call should not be allowlisted).\n * @param _tokenLock Address of the L1 GraphTokenLockWallet that will own the ETH\n */\n function depositETH(address _tokenLock) external payable {\n tokenLockETHBalances[_tokenLock] = tokenLockETHBalances[_tokenLock].add(msg.value);\n emit ETHDeposited(_tokenLock, msg.value);\n }\n\n /**\n * @notice Withdraw ETH from a token lock's account.\n * This function must be called from the token lock contract, but the destination\n * _must_ be a different address, as any ETH sent to the token lock would otherwise be\n * lost.\n * @param _destination Address to send the ETH\n * @param _amount Amount of ETH to send\n */\n function withdrawETH(address _destination, uint256 _amount) external {\n require(_amount > 0, \"INVALID_AMOUNT\");\n // We can't send eth to a token lock or it will be stuck\n require(msg.sender != _destination, \"INVALID_DESTINATION\");\n require(tokenLockETHBalances[msg.sender] >= _amount, \"INSUFFICIENT_BALANCE\");\n tokenLockETHBalances[msg.sender] -= _amount;\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, ) = payable(_destination).call{ value: _amount }(\"\");\n require(success, \"TRANSFER_FAILED\");\n emit ETHWithdrawn(msg.sender, _destination, _amount);\n }\n\n /**\n * @notice Pull ETH from a token lock's account, to be used for L2 retryable ticket gas.\n * This can only be called by the Staking contract.\n * @param _tokenLock GraphTokenLockWallet that owns the ETH that will be debited\n * @param _amount Amount of ETH to pull\n */\n function pullETH(address _tokenLock, uint256 _amount) external {\n require(msg.sender == staking, \"ONLY_STAKING\");\n require(tokenLockETHBalances[_tokenLock] >= _amount, \"INSUFFICIENT_BALANCE\");\n tokenLockETHBalances[_tokenLock] -= _amount;\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, ) = staking.call{ value: _amount }(\"\");\n require(success, \"TRANSFER_FAILED\");\n emit ETHPulled(_tokenLock, _amount);\n }\n\n /**\n * @notice Deposit GRT to L2, from a token lock in L1 to a token lock in L2.\n * If the token lock in L2 does not exist, it will be created when the message is received\n * by the L2GraphTokenLockManager.\n * Before calling this (which must be done through the token lock wallet), make sure\n * there is enough ETH in the token lock's account to cover the L2 retryable ticket gas.\n * Note that L2 submission fee and gas refunds will be lost.\n * You can add ETH to the token lock's account by calling depositETH().\n * Note that after calling this, you will NOT be able to use setL2WalletAddressManually() to\n * set an L2 wallet address, as the L2 wallet address will be set automatically when the\n * message is received by the L2GraphTokenLockManager.\n * @dev The gas parameters for L2 can be estimated using the Arbitrum SDK.\n * @param _amount Amount of GRT to deposit\n * @param _l2Beneficiary Address of the beneficiary for the token lock in L2. Must be the same for subsequent calls of this function, and not an L1 contract.\n * @param _maxGas Maximum gas to use for the L2 retryable ticket\n * @param _gasPriceBid Gas price to use for the L2 retryable ticket\n * @param _maxSubmissionCost Max submission cost for the L2 retryable ticket\n */\n function depositToL2Locked(\n uint256 _amount,\n address _l2Beneficiary,\n uint256 _maxGas,\n uint256 _gasPriceBid,\n uint256 _maxSubmissionCost\n ) external {\n // Check that msg.sender is a GraphTokenLockWallet\n // That uses GRT and has a corresponding manager set in L2.\n GraphTokenLockWallet wallet = GraphTokenLockWallet(msg.sender);\n require(wallet.token() == graphToken, \"INVALID_TOKEN\");\n address l1Manager = address(wallet.manager());\n address l2Manager = l2LockManager[l1Manager];\n require(l2Manager != address(0), \"INVALID_MANAGER\");\n require(wallet.isInitialized(), \"!INITIALIZED\");\n require(wallet.revocable() != IGraphTokenLock.Revocability.Enabled, \"REVOCABLE\");\n require(_amount <= graphToken.balanceOf(msg.sender), \"INSUFFICIENT_BALANCE\");\n require(_amount != 0, \"ZERO_AMOUNT\");\n\n if (l2Beneficiary[msg.sender] == address(0)) {\n require(_l2Beneficiary != address(0), \"INVALID_BENEFICIARY_ZERO\");\n require(!AddressUpgradeable.isContract(_l2Beneficiary), \"INVALID_BENEFICIARY_CONTRACT\");\n l2Beneficiary[msg.sender] = _l2Beneficiary;\n emit L2BeneficiarySet(msg.sender, _l2Beneficiary);\n } else {\n require(l2Beneficiary[msg.sender] == _l2Beneficiary, \"INVALID_BENEFICIARY\");\n }\n\n uint256 expectedEth = _maxSubmissionCost.add(_maxGas.mul(_gasPriceBid));\n require(tokenLockETHBalances[msg.sender] >= expectedEth, \"INSUFFICIENT_ETH_BALANCE\");\n tokenLockETHBalances[msg.sender] -= expectedEth;\n\n bytes memory encodedData;\n {\n address l2Owner = l2WalletOwner[wallet.owner()];\n require(l2Owner != address(0), \"L2_OWNER_NOT_SET\");\n // Extract all the storage variables from the GraphTokenLockWallet\n L2GraphTokenLockManager.TransferredWalletData memory data = L2GraphTokenLockManager.TransferredWalletData({\n l1Address: msg.sender,\n owner: l2Owner,\n beneficiary: l2Beneficiary[msg.sender],\n managedAmount: wallet.managedAmount(),\n startTime: wallet.startTime(),\n endTime: wallet.endTime()\n });\n encodedData = abi.encode(data);\n }\n\n if (l2WalletAddress[msg.sender] == address(0)) {\n require(wallet.endTime() >= block.timestamp, \"FULLY_VESTED_USE_MANUAL_ADDRESS\");\n address newAddress = getDeploymentAddress(keccak256(encodedData), l2Implementation, l2Manager);\n l2WalletAddress[msg.sender] = newAddress;\n emit L2WalletAddressSet(msg.sender, newAddress);\n } else {\n require(!l2WalletAddressSetManually[msg.sender], \"CANT_DEPOSIT_TO_MANUAL_ADDRESS\");\n }\n\n graphToken.transferFrom(msg.sender, address(this), _amount);\n\n // Send the tokens with a message through the L1GraphTokenGateway to the L2GraphTokenLockManager\n graphToken.approve(address(l1Gateway), _amount);\n {\n bytes memory transferData = abi.encode(_maxSubmissionCost, encodedData);\n l1Gateway.outboundTransfer{ value: expectedEth }(\n address(graphToken),\n l2Manager,\n _amount,\n _maxGas,\n _gasPriceBid,\n transferData\n );\n }\n emit ETHPulled(msg.sender, expectedEth);\n emit LockedFundsSentToL2(msg.sender, l2WalletAddress[msg.sender], l1Manager, l2Manager, _amount);\n }\n\n /**\n * @notice Manually set the L2 wallet address for a token lock in L1.\n * This will only work for token locks that have not been initialized in L2 yet, and\n * that are fully vested (endTime < current timestamp).\n * This address can then be used to send stake or delegation to L2 on the Staking contract.\n * After calling this, the vesting lock will NOT be allowed to use depositToL2Locked\n * to send GRT to L2, the beneficiary must withdraw the tokens and bridge them manually.\n * @param _l2Wallet Address of the L2 wallet\n */\n function setL2WalletAddressManually(address _l2Wallet) external {\n // Check that msg.sender is a GraphTokenLockWallet\n // That uses GRT and has a corresponding manager set in L2.\n GraphTokenLockWallet wallet = GraphTokenLockWallet(msg.sender);\n require(wallet.token() == graphToken, \"INVALID_TOKEN\");\n address l1Manager = address(wallet.manager());\n address l2Manager = l2LockManager[l1Manager];\n require(l2Manager != address(0), \"INVALID_MANAGER\");\n require(wallet.isInitialized(), \"!INITIALIZED\");\n\n // Check that the wallet is fully vested\n require(wallet.endTime() < block.timestamp, \"NOT_FULLY_VESTED\");\n\n // Check that the wallet has not set an L2 wallet yet\n require(l2WalletAddress[msg.sender] == address(0), \"L2_WALLET_ALREADY_SET\");\n\n // Check that the L2 address is not zero\n require(_l2Wallet != address(0), \"ZERO_ADDRESS\");\n // Set the L2 wallet address\n l2WalletAddress[msg.sender] = _l2Wallet;\n l2WalletAddressSetManually[msg.sender] = true;\n emit L2WalletAddressSet(msg.sender, _l2Wallet);\n }\n}\n" + }, + "contracts/L2GraphTokenLockManager.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport { SafeERC20 } from \"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\";\n\nimport { ICallhookReceiver } from \"./ICallhookReceiver.sol\";\nimport { GraphTokenLockManager } from \"./GraphTokenLockManager.sol\";\nimport { L2GraphTokenLockWallet } from \"./L2GraphTokenLockWallet.sol\";\n\n/**\n * @title L2GraphTokenLockManager\n * @notice This contract manages a list of authorized function calls and targets that can be called\n * by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts.\n *\n * This contract receives funds to make the process of creating TokenLockWallet contracts\n * easier by distributing them the initial tokens to be managed.\n *\n * In particular, this L2 variant is designed to receive token lock wallets from L1,\n * through the GRT bridge. These transferred wallets will not allow releasing funds in L2 until\n * the end of the vesting timeline, but they can allow withdrawing funds back to L1 using\n * the L2GraphTokenLockTransferTool contract.\n *\n * The owner can setup a list of token destinations that will be used by TokenLock contracts to\n * approve the pulling of funds, this way in can be guaranteed that only protocol contracts\n * will manipulate users funds.\n */\ncontract L2GraphTokenLockManager is GraphTokenLockManager, ICallhookReceiver {\n using SafeERC20 for IERC20;\n\n /// @dev Struct to hold the data of a transferred wallet; this is\n /// the data that must be encoded in L1 to send a wallet to L2.\n struct TransferredWalletData {\n address l1Address;\n address owner;\n address beneficiary;\n uint256 managedAmount;\n uint256 startTime;\n uint256 endTime;\n }\n\n /// Address of the L2GraphTokenGateway\n address public immutable l2Gateway;\n /// Address of the L1 transfer tool contract (in L1, no aliasing)\n address public immutable l1TransferTool;\n /// Mapping of each L1 wallet to its L2 wallet counterpart (populated when each wallet is received)\n /// L1 address => L2 address\n mapping(address => address) public l1WalletToL2Wallet;\n /// Mapping of each L2 wallet to its L1 wallet counterpart (populated when each wallet is received)\n /// L2 address => L1 address\n mapping(address => address) public l2WalletToL1Wallet;\n\n /// @dev Event emitted when a wallet is received and created from L1\n event TokenLockCreatedFromL1(\n address indexed contractAddress,\n bytes32 initHash,\n address indexed beneficiary,\n uint256 managedAmount,\n uint256 startTime,\n uint256 endTime,\n address indexed l1Address\n );\n\n /// @dev Emitted when locked tokens are received from L1 (whether the wallet\n /// had already been received or not)\n event LockedTokensReceivedFromL1(address indexed l1Address, address indexed l2Address, uint256 amount);\n\n /**\n * @dev Checks that the sender is the L2GraphTokenGateway.\n */\n modifier onlyL2Gateway() {\n require(msg.sender == l2Gateway, \"ONLY_GATEWAY\");\n _;\n }\n\n /**\n * @notice Constructor for the L2GraphTokenLockManager contract.\n * @param _graphToken Address of the L2 GRT token contract\n * @param _masterCopy Address of the master copy of the L2GraphTokenLockWallet implementation\n * @param _l2Gateway Address of the L2GraphTokenGateway contract\n * @param _l1TransferTool Address of the L1 transfer tool contract (in L1, without aliasing)\n */\n constructor(\n IERC20 _graphToken,\n address _masterCopy,\n address _l2Gateway,\n address _l1TransferTool\n ) GraphTokenLockManager(_graphToken, _masterCopy) {\n l2Gateway = _l2Gateway;\n l1TransferTool = _l1TransferTool;\n }\n\n /**\n * @notice This function is called by the L2GraphTokenGateway when tokens are sent from L1.\n * @dev This function will create a new wallet if it doesn't exist yet, or send the tokens to\n * the existing wallet if it does.\n * @param _from Address of the sender in L1, which must be the L1GraphTokenLockTransferTool\n * @param _amount Amount of tokens received\n * @param _data Encoded data of the transferred wallet, which must be an ABI-encoded TransferredWalletData struct\n */\n function onTokenTransfer(address _from, uint256 _amount, bytes calldata _data) external override onlyL2Gateway {\n require(_from == l1TransferTool, \"ONLY_TRANSFER_TOOL\");\n TransferredWalletData memory walletData = abi.decode(_data, (TransferredWalletData));\n\n if (l1WalletToL2Wallet[walletData.l1Address] != address(0)) {\n // If the wallet was already received, just send the tokens to the L2 address\n _token.safeTransfer(l1WalletToL2Wallet[walletData.l1Address], _amount);\n } else {\n // Create contract using a minimal proxy and call initializer\n (bytes32 initHash, address contractAddress) = _deployFromL1(keccak256(_data), walletData);\n l1WalletToL2Wallet[walletData.l1Address] = contractAddress;\n l2WalletToL1Wallet[contractAddress] = walletData.l1Address;\n\n // Send managed amount to the created contract\n _token.safeTransfer(contractAddress, _amount);\n\n emit TokenLockCreatedFromL1(\n contractAddress,\n initHash,\n walletData.beneficiary,\n walletData.managedAmount,\n walletData.startTime,\n walletData.endTime,\n walletData.l1Address\n );\n }\n emit LockedTokensReceivedFromL1(walletData.l1Address, l1WalletToL2Wallet[walletData.l1Address], _amount);\n }\n\n /**\n * @dev Deploy a token lock wallet with data received from L1\n * @param _salt Salt for the CREATE2 call, which must be the hash of the wallet data\n * @param _walletData Data of the wallet to be created\n * @return Hash of the initialization calldata\n * @return Address of the created contract\n */\n function _deployFromL1(bytes32 _salt, TransferredWalletData memory _walletData) internal returns (bytes32, address) {\n bytes memory initializer = _encodeInitializer(_walletData);\n address contractAddress = _deployProxy2(_salt, masterCopy, initializer);\n return (keccak256(initializer), contractAddress);\n }\n\n /**\n * @dev Encode the initializer for the token lock wallet received from L1\n * @param _walletData Data of the wallet to be created\n * @return Encoded initializer calldata, including the function signature\n */\n function _encodeInitializer(TransferredWalletData memory _walletData) internal view returns (bytes memory) {\n return\n abi.encodeWithSelector(\n L2GraphTokenLockWallet.initializeFromL1.selector,\n address(this),\n address(_token),\n _walletData\n );\n }\n}\n" + }, + "contracts/L2GraphTokenLockTransferTool.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\nimport { L2GraphTokenLockManager } from \"./L2GraphTokenLockManager.sol\";\nimport { L2GraphTokenLockWallet } from \"./L2GraphTokenLockWallet.sol\";\nimport { ITokenGateway } from \"./arbitrum/ITokenGateway.sol\";\n\n/**\n * @title L2GraphTokenLockTransferTool contract\n * @notice This contract is used to transfer GRT from L2 token lock wallets\n * back to their L1 counterparts.\n */\ncontract L2GraphTokenLockTransferTool {\n /// Address of the L2 GRT token\n IERC20 public immutable graphToken;\n /// Address of the L2GraphTokenGateway\n ITokenGateway public immutable l2Gateway;\n /// Address of the L1 GRT token (in L1, no aliasing)\n address public immutable l1GraphToken;\n\n /// @dev Emitted when GRT is sent to L1 from a token lock\n event LockedFundsSentToL1(\n address indexed l1Wallet,\n address indexed l2Wallet,\n address indexed l2LockManager,\n uint256 amount\n );\n\n /**\n * @notice Constructor for the L2GraphTokenLockTransferTool contract\n * @dev Note the L2GraphTokenLockTransferTool can be deployed behind a proxy,\n * and the constructor for the implementation will only set some immutable\n * variables.\n * @param _graphToken Address of the L2 GRT token\n * @param _l2Gateway Address of the L2GraphTokenGateway\n * @param _l1GraphToken Address of the L1 GRT token (in L1, no aliasing)\n */\n constructor(IERC20 _graphToken, ITokenGateway _l2Gateway, address _l1GraphToken) {\n graphToken = _graphToken;\n l2Gateway = _l2Gateway;\n l1GraphToken = _l1GraphToken;\n }\n\n /**\n * @notice Withdraw GRT from an L2 token lock wallet to its L1 counterpart.\n * This function must be called from an L2GraphTokenLockWallet contract.\n * The GRT will be sent to L1 and must be claimed using the Arbitrum Outbox on L1\n * after the standard Arbitrum withdrawal period (7 days).\n * @param _amount Amount of GRT to withdraw\n */\n function withdrawToL1Locked(uint256 _amount) external {\n L2GraphTokenLockWallet wallet = L2GraphTokenLockWallet(msg.sender);\n L2GraphTokenLockManager manager = L2GraphTokenLockManager(address(wallet.manager()));\n require(address(manager) != address(0), \"INVALID_SENDER\");\n address l1Wallet = manager.l2WalletToL1Wallet(msg.sender);\n require(l1Wallet != address(0), \"NOT_L1_WALLET\");\n require(_amount <= graphToken.balanceOf(msg.sender), \"INSUFFICIENT_BALANCE\");\n require(_amount != 0, \"ZERO_AMOUNT\");\n\n graphToken.transferFrom(msg.sender, address(this), _amount);\n graphToken.approve(address(l2Gateway), _amount);\n\n // Send the tokens through the L2GraphTokenGateway to the L1 wallet counterpart\n l2Gateway.outboundTransfer(l1GraphToken, l1Wallet, _amount, 0, 0, \"\");\n emit LockedFundsSentToL1(l1Wallet, msg.sender, address(manager), _amount);\n }\n}\n" + }, + "contracts/L2GraphTokenLockWallet.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\nimport { GraphTokenLockWallet } from \"./GraphTokenLockWallet.sol\";\nimport { Ownable as OwnableInitializable } from \"./Ownable.sol\";\nimport { L2GraphTokenLockManager } from \"./L2GraphTokenLockManager.sol\";\n\n/**\n * @title L2GraphTokenLockWallet\n * @notice This contract is built on top of the base GraphTokenLock functionality.\n * It allows wallet beneficiaries to use the deposited funds to perform specific function calls\n * on specific contracts.\n *\n * The idea is that supporters with locked tokens can participate in the protocol\n * but disallow any release before the vesting/lock schedule.\n * The beneficiary can issue authorized function calls to this contract that will\n * get forwarded to a target contract. A target contract is any of our protocol contracts.\n * The function calls allowed are queried to the GraphTokenLockManager, this way\n * the same configuration can be shared for all the created lock wallet contracts.\n *\n * This L2 variant includes a special initializer so that it can be created from\n * a wallet's data received from L1. These transferred wallets will not allow releasing\n * funds in L2 until the end of the vesting timeline, but they can allow withdrawing\n * funds back to L1 using the L2GraphTokenLockTransferTool contract.\n *\n * Note that surplusAmount and releasedAmount in L2 will be skewed for wallets received from L1,\n * so releasing surplus tokens might also only be possible by bridging tokens back to L1.\n *\n * NOTE: Contracts used as target must have its function signatures checked to avoid collisions\n * with any of this contract functions.\n * Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience\n * the maximum amount of tokens is authorized.\n * Function calls do not forward ETH value so DO NOT SEND ETH TO THIS CONTRACT.\n */\ncontract L2GraphTokenLockWallet is GraphTokenLockWallet {\n // Initializer when created from a message from L1\n function initializeFromL1(\n address _manager,\n address _token,\n L2GraphTokenLockManager.TransferredWalletData calldata _walletData\n ) external {\n require(!isInitialized, \"Already initialized\");\n isInitialized = true;\n\n OwnableInitializable._initialize(_walletData.owner);\n beneficiary = _walletData.beneficiary;\n token = IERC20(_token);\n\n managedAmount = _walletData.managedAmount;\n\n startTime = _walletData.startTime;\n endTime = _walletData.endTime;\n periods = 1;\n isAccepted = true;\n\n // Optionals\n releaseStartTime = _walletData.endTime;\n revocable = Revocability.Disabled;\n\n _setManager(_manager);\n }\n}\n" + }, + "contracts/MathUtils.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nlibrary MathUtils {\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n}\n" + }, + "contracts/MinimalProxyFactory.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport { Address } from \"@openzeppelin/contracts/utils/Address.sol\";\nimport { Create2 } from \"@openzeppelin/contracts/utils/Create2.sol\";\n\n/**\n * @title MinimalProxyFactory: a factory contract for creating minimal proxies\n * @notice Adapted from https://github.com/OpenZeppelin/openzeppelin-sdk/blob/v2.5.0/packages/lib/contracts/upgradeability/ProxyFactory.sol\n * Based on https://eips.ethereum.org/EIPS/eip-1167\n */\ncontract MinimalProxyFactory {\n /// @dev Emitted when a new proxy is created\n event ProxyCreated(address indexed proxy);\n\n\n /**\n * @notice Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation\n * @dev Uses address(this) as deployer to compute the address. Only for backwards compatibility.\n * @param _salt Bytes32 salt to use for CREATE2\n * @param _implementation Address of the proxy target implementation\n * @return Address of the counterfactual MinimalProxy\n */\n function getDeploymentAddress(\n bytes32 _salt,\n address _implementation\n ) public view returns (address) {\n return getDeploymentAddress(_salt, _implementation, address(this));\n }\n\n /**\n * @notice Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation\n * @param _salt Bytes32 salt to use for CREATE2\n * @param _implementation Address of the proxy target implementation\n * @param _deployer Address of the deployer that creates the contract\n * @return Address of the counterfactual MinimalProxy\n */\n function getDeploymentAddress(\n bytes32 _salt,\n address _implementation,\n address _deployer\n ) public pure returns (address) {\n return Create2.computeAddress(_salt, keccak256(_getContractCreationCode(_implementation)), _deployer);\n }\n\n /**\n * @dev Deploys a MinimalProxy with CREATE2\n * @param _salt Bytes32 salt to use for CREATE2\n * @param _implementation Address of the proxy target implementation\n * @param _data Bytes with the initializer call\n * @return Address of the deployed MinimalProxy\n */\n function _deployProxy2(bytes32 _salt, address _implementation, bytes memory _data) internal returns (address) {\n address proxyAddress = Create2.deploy(0, _salt, _getContractCreationCode(_implementation));\n\n emit ProxyCreated(proxyAddress);\n\n // Call function with data\n if (_data.length > 0) {\n Address.functionCall(proxyAddress, _data);\n }\n\n return proxyAddress;\n }\n\n /**\n * @dev Gets the MinimalProxy bytecode\n * @param _implementation Address of the proxy target implementation\n * @return MinimalProxy bytecode\n */\n function _getContractCreationCode(address _implementation) internal pure returns (bytes memory) {\n bytes10 creation = 0x3d602d80600a3d3981f3;\n bytes10 prefix = 0x363d3d373d3d3d363d73;\n bytes20 targetBytes = bytes20(_implementation);\n bytes15 suffix = 0x5af43d82803e903d91602b57fd5bf3;\n return abi.encodePacked(creation, prefix, targetBytes, suffix);\n }\n}\n" + }, + "contracts/Ownable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * The owner account will be passed on initialization of the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\ncontract Ownable {\n /// @dev Owner of the contract, can be retrieved with the public owner() function\n address private _owner;\n /// @dev Since upgradeable contracts might inherit this, we add a storage gap\n /// to allow adding variables here without breaking the proxy storage layout\n uint256[50] private __gap;\n\n /// @dev Emitted when ownership of the contract is transferred\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n function _initialize(address owner) internal {\n _owner = owner;\n emit OwnershipTransferred(address(0), owner);\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(_owner == msg.sender, \"Ownable: caller is not the owner\");\n _;\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() external virtual onlyOwner {\n emit OwnershipTransferred(_owner, address(0));\n _owner = address(0);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) external virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n emit OwnershipTransferred(_owner, newOwner);\n _owner = newOwner;\n }\n}\n" + }, + "contracts/tests/arbitrum/AddressAliasHelper.sol": { + "content": "// SPDX-License-Identifier: Apache-2.0\n\n/*\n * Copyright 2019-2021, Offchain Labs, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * Originally copied from:\n * https://github.com/OffchainLabs/arbitrum/tree/84e64dee6ee82adbf8ec34fd4b86c207a61d9007/packages/arb-bridge-eth\n *\n * MODIFIED from Offchain Labs' implementation:\n * - Changed solidity version to 0.7.3 (pablo@edgeandnode.com)\n *\n */\n\npragma solidity ^0.7.3;\n\nlibrary AddressAliasHelper {\n uint160 constant offset = uint160(0x1111000000000000000000000000000000001111);\n\n /// @notice Utility function that converts the address in the L1 that submitted a tx to\n /// the inbox to the msg.sender viewed in the L2\n /// @param l1Address the address in the L1 that triggered the tx to L2\n /// @return l2Address L2 address as viewed in msg.sender\n function applyL1ToL2Alias(address l1Address) internal pure returns (address l2Address) {\n l2Address = address(uint160(l1Address) + offset);\n }\n\n /// @notice Utility function that converts the msg.sender viewed in the L2 to the\n /// address in the L1 that submitted a tx to the inbox\n /// @param l2Address L2 address as viewed in msg.sender\n /// @return l1Address the address in the L1 that triggered the tx to L2\n function undoL1ToL2Alias(address l2Address) internal pure returns (address l1Address) {\n l1Address = address(uint160(l2Address) - offset);\n }\n}\n" + }, + "contracts/tests/arbitrum/IBridge.sol": { + "content": "// SPDX-License-Identifier: Apache-2.0\n\n/*\n * Copyright 2021, Offchain Labs, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * Originally copied from:\n * https://github.com/OffchainLabs/arbitrum/tree/e3a6307ad8a2dc2cad35728a2a9908cfd8dd8ef9/packages/arb-bridge-eth\n *\n * MODIFIED from Offchain Labs' implementation:\n * - Changed solidity version to 0.7.3 (pablo@edgeandnode.com)\n *\n */\n\npragma solidity ^0.7.3;\n\ninterface IBridge {\n event MessageDelivered(\n uint256 indexed messageIndex,\n bytes32 indexed beforeInboxAcc,\n address inbox,\n uint8 kind,\n address sender,\n bytes32 messageDataHash\n );\n\n event BridgeCallTriggered(address indexed outbox, address indexed destAddr, uint256 amount, bytes data);\n\n event InboxToggle(address indexed inbox, bool enabled);\n\n event OutboxToggle(address indexed outbox, bool enabled);\n\n function deliverMessageToInbox(\n uint8 kind,\n address sender,\n bytes32 messageDataHash\n ) external payable returns (uint256);\n\n function executeCall(\n address destAddr,\n uint256 amount,\n bytes calldata data\n ) external returns (bool success, bytes memory returnData);\n\n // These are only callable by the admin\n function setInbox(address inbox, bool enabled) external;\n\n function setOutbox(address inbox, bool enabled) external;\n\n // View functions\n\n function activeOutbox() external view returns (address);\n\n function allowedInboxes(address inbox) external view returns (bool);\n\n function allowedOutboxes(address outbox) external view returns (bool);\n\n function inboxAccs(uint256 index) external view returns (bytes32);\n\n function messageCount() external view returns (uint256);\n}\n" + }, + "contracts/tests/arbitrum/IInbox.sol": { + "content": "// SPDX-License-Identifier: Apache-2.0\n\n/*\n * Copyright 2021, Offchain Labs, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * Originally copied from:\n * https://github.com/OffchainLabs/arbitrum/tree/e3a6307ad8a2dc2cad35728a2a9908cfd8dd8ef9/packages/arb-bridge-eth\n *\n * MODIFIED from Offchain Labs' implementation:\n * - Changed solidity version to 0.7.3 (pablo@edgeandnode.com)\n *\n */\n\npragma solidity ^0.7.3;\n\nimport \"./IBridge.sol\";\nimport \"./IMessageProvider.sol\";\n\ninterface IInbox is IMessageProvider {\n function sendL2Message(bytes calldata messageData) external returns (uint256);\n\n function sendUnsignedTransaction(\n uint256 maxGas,\n uint256 gasPriceBid,\n uint256 nonce,\n address destAddr,\n uint256 amount,\n bytes calldata data\n ) external returns (uint256);\n\n function sendContractTransaction(\n uint256 maxGas,\n uint256 gasPriceBid,\n address destAddr,\n uint256 amount,\n bytes calldata data\n ) external returns (uint256);\n\n function sendL1FundedUnsignedTransaction(\n uint256 maxGas,\n uint256 gasPriceBid,\n uint256 nonce,\n address destAddr,\n bytes calldata data\n ) external payable returns (uint256);\n\n function sendL1FundedContractTransaction(\n uint256 maxGas,\n uint256 gasPriceBid,\n address destAddr,\n bytes calldata data\n ) external payable returns (uint256);\n\n function createRetryableTicket(\n address destAddr,\n uint256 arbTxCallValue,\n uint256 maxSubmissionCost,\n address submissionRefundAddress,\n address valueRefundAddress,\n uint256 maxGas,\n uint256 gasPriceBid,\n bytes calldata data\n ) external payable returns (uint256);\n\n function depositEth(uint256 maxSubmissionCost) external payable returns (uint256);\n\n function bridge() external view returns (IBridge);\n\n function pauseCreateRetryables() external;\n\n function unpauseCreateRetryables() external;\n\n function startRewriteAddress() external;\n\n function stopRewriteAddress() external;\n}\n" + }, + "contracts/tests/arbitrum/IMessageProvider.sol": { + "content": "// SPDX-License-Identifier: Apache-2.0\n\n/*\n * Copyright 2021, Offchain Labs, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * Originally copied from:\n * https://github.com/OffchainLabs/arbitrum/tree/e3a6307ad8a2dc2cad35728a2a9908cfd8dd8ef9/packages/arb-bridge-eth\n *\n * MODIFIED from Offchain Labs' implementation:\n * - Changed solidity version to 0.7.3 (pablo@edgeandnode.com)\n *\n */\n\npragma solidity ^0.7.3;\n\ninterface IMessageProvider {\n event InboxMessageDelivered(uint256 indexed messageNum, bytes data);\n\n event InboxMessageDeliveredFromOrigin(uint256 indexed messageNum);\n}\n" + }, + "contracts/tests/BridgeMock.sol": { + "content": "// SPDX-License-Identifier: GPL-2.0-or-later\n\npragma solidity ^0.7.3;\n\nimport \"./arbitrum/IBridge.sol\";\n\n/**\n * @title Arbitrum Bridge mock contract\n * @dev This contract implements Arbitrum's IBridge interface for testing purposes\n */\ncontract BridgeMock is IBridge {\n /// Address of the (mock) Arbitrum Inbox\n address public inbox;\n /// Address of the (mock) Arbitrum Outbox\n address public outbox;\n /// Index of the next message on the inbox messages array\n uint256 public messageIndex;\n /// Inbox messages array\n bytes32[] public override inboxAccs;\n\n /**\n * @notice Deliver a message to the inbox. The encoded message will be\n * added to the inbox array, and messageIndex will be incremented.\n * @param _kind Type of the message\n * @param _sender Address that is sending the message\n * @param _messageDataHash keccak256 hash of the message data\n * @return The next index for the inbox array\n */\n function deliverMessageToInbox(\n uint8 _kind,\n address _sender,\n bytes32 _messageDataHash\n ) external payable override returns (uint256) {\n messageIndex = messageIndex + 1;\n inboxAccs.push(keccak256(abi.encodePacked(inbox, _kind, _sender, _messageDataHash)));\n emit MessageDelivered(messageIndex, inboxAccs[messageIndex - 1], msg.sender, _kind, _sender, _messageDataHash);\n return messageIndex;\n }\n\n /**\n * @notice Executes an L1 function call incoing from L2. This can only be called\n * by the Outbox.\n * @param _destAddr Contract to call\n * @param _amount ETH value to send\n * @param _data Calldata for the function call\n * @return True if the call was successful, false otherwise\n * @return Return data from the call\n */\n function executeCall(\n address _destAddr,\n uint256 _amount,\n bytes calldata _data\n ) external override returns (bool, bytes memory) {\n require(outbox == msg.sender, \"NOT_FROM_OUTBOX\");\n bool success;\n bytes memory returnData;\n\n // solhint-disable-next-line avoid-low-level-calls\n (success, returnData) = _destAddr.call{ value: _amount }(_data);\n emit BridgeCallTriggered(msg.sender, _destAddr, _amount, _data);\n return (success, returnData);\n }\n\n /**\n * @notice Set the address of the inbox. Anyone can call this, because it's a mock.\n * @param _inbox Address of the inbox\n * @param _enabled Enable the inbox (ignored)\n */\n function setInbox(address _inbox, bool _enabled) external override {\n inbox = _inbox;\n emit InboxToggle(inbox, _enabled);\n }\n\n /**\n * @notice Set the address of the outbox. Anyone can call this, because it's a mock.\n * @param _outbox Address of the outbox\n * @param _enabled Enable the outbox (ignored)\n */\n function setOutbox(address _outbox, bool _enabled) external override {\n outbox = _outbox;\n emit OutboxToggle(outbox, _enabled);\n }\n\n // View functions\n\n /**\n * @notice Getter for the active outbox (in this case there's only one)\n */\n function activeOutbox() external view override returns (address) {\n return outbox;\n }\n\n /**\n * @notice Getter for whether an address is an allowed inbox (in this case there's only one)\n * @param _inbox Address to check\n * @return True if the address is the allowed inbox, false otherwise\n */\n function allowedInboxes(address _inbox) external view override returns (bool) {\n return _inbox == inbox;\n }\n\n /**\n * @notice Getter for whether an address is an allowed outbox (in this case there's only one)\n * @param _outbox Address to check\n * @return True if the address is the allowed outbox, false otherwise\n */\n function allowedOutboxes(address _outbox) external view override returns (bool) {\n return _outbox == outbox;\n }\n\n /**\n * @notice Getter for the count of messages in the inboxAccs\n * @return Number of messages in inboxAccs\n */\n function messageCount() external view override returns (uint256) {\n return inboxAccs.length;\n }\n}\n" + }, + "contracts/tests/GraphTokenMock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\n\n/**\n * @title Graph Token Mock contract.\n * @dev Used for testing purposes, DO NOT USE IN PRODUCTION\n */\ncontract GraphTokenMock is Ownable, ERC20 {\n /**\n * @notice Contract Constructor.\n * @param _initialSupply Initial supply\n * @param _mintTo Address to whitch to mint the initial supply\n */\n constructor(uint256 _initialSupply, address _mintTo) ERC20(\"Graph Token Mock\", \"GRT-Mock\") {\n // Deploy to mint address\n _mint(_mintTo, _initialSupply);\n }\n\n /**\n * @notice Mint tokens to an address from the bridge.\n * (The real one has an onlyGateway modifier)\n * @param _to Address to mint tokens to\n * @param _amount Amount of tokens to mint\n */\n function bridgeMint(address _to, uint256 _amount) external {\n _mint(_to, _amount);\n }\n\n /**\n * @notice Burn tokens from an address from the bridge.\n * (The real one has an onlyGateway modifier)\n * @param _from Address to burn tokens from\n * @param _amount Amount of tokens to burn\n */\n function bridgeBurn(address _from, uint256 _amount) external {\n _burn(_from, _amount);\n }\n}\n" + }, + "contracts/tests/InboxMock.sol": { + "content": "// SPDX-License-Identifier: GPL-2.0-or-later\n\npragma solidity ^0.7.3;\n\nimport \"./arbitrum/IInbox.sol\";\nimport \"./arbitrum/AddressAliasHelper.sol\";\n\n/**\n * @title Arbitrum Inbox mock contract\n * @dev This contract implements (a subset of) Arbitrum's IInbox interface for testing purposes\n */\ncontract InboxMock is IInbox {\n /// @dev Type indicator for a standard L2 message\n uint8 internal constant L2_MSG = 3;\n /// @dev Type indicator for a retryable ticket message\n // solhint-disable-next-line const-name-snakecase\n uint8 internal constant L1MessageType_submitRetryableTx = 9;\n /// Address of the Bridge (mock) contract\n IBridge public override bridge;\n\n /**\n * @notice Send a message to L2 (by delivering it to the Bridge)\n * @param _messageData Encoded data to send in the message\n * @return Message number returned by the inbox\n */\n function sendL2Message(bytes calldata _messageData) external override returns (uint256) {\n uint256 msgNum = deliverToBridge(L2_MSG, msg.sender, keccak256(_messageData));\n emit InboxMessageDelivered(msgNum, _messageData);\n return msgNum;\n }\n\n /**\n * @notice Set the address of the (mock) bridge\n * @param _bridge Address of the bridge\n */\n function setBridge(address _bridge) external {\n bridge = IBridge(_bridge);\n }\n\n /**\n * @notice Unimplemented in this mock\n */\n function sendUnsignedTransaction(\n uint256,\n uint256,\n uint256,\n address,\n uint256,\n bytes calldata\n ) external pure override returns (uint256) {\n revert(\"Unimplemented\");\n }\n\n /**\n * @notice Unimplemented in this mock\n */\n function sendContractTransaction(\n uint256,\n uint256,\n address,\n uint256,\n bytes calldata\n ) external pure override returns (uint256) {\n revert(\"Unimplemented\");\n }\n\n /**\n * @notice Unimplemented in this mock\n */\n function sendL1FundedUnsignedTransaction(\n uint256,\n uint256,\n uint256,\n address,\n bytes calldata\n ) external payable override returns (uint256) {\n revert(\"Unimplemented\");\n }\n\n /**\n * @notice Unimplemented in this mock\n */\n function sendL1FundedContractTransaction(\n uint256,\n uint256,\n address,\n bytes calldata\n ) external payable override returns (uint256) {\n revert(\"Unimplemented\");\n }\n\n /**\n * @notice Creates a retryable ticket for an L2 transaction\n * @param _destAddr Address of the contract to call in L2\n * @param _arbTxCallValue Callvalue to use in the L2 transaction\n * @param _maxSubmissionCost Max cost of submitting the ticket, in Wei\n * @param _submissionRefundAddress L2 address to refund for any remaining value from the submission cost\n * @param _valueRefundAddress L2 address to refund if the ticket times out or gets cancelled\n * @param _maxGas Max gas for the L2 transcation\n * @param _gasPriceBid Gas price bid on L2\n * @param _data Encoded calldata for the L2 transaction (including function selector)\n * @return Message number returned by the bridge\n */\n function createRetryableTicket(\n address _destAddr,\n uint256 _arbTxCallValue,\n uint256 _maxSubmissionCost,\n address _submissionRefundAddress,\n address _valueRefundAddress,\n uint256 _maxGas,\n uint256 _gasPriceBid,\n bytes calldata _data\n ) external payable override returns (uint256) {\n _submissionRefundAddress = AddressAliasHelper.applyL1ToL2Alias(_submissionRefundAddress);\n _valueRefundAddress = AddressAliasHelper.applyL1ToL2Alias(_valueRefundAddress);\n return\n _deliverMessage(\n L1MessageType_submitRetryableTx,\n msg.sender,\n abi.encodePacked(\n uint256(uint160(bytes20(_destAddr))),\n _arbTxCallValue,\n msg.value,\n _maxSubmissionCost,\n uint256(uint160(bytes20(_submissionRefundAddress))),\n uint256(uint160(bytes20(_valueRefundAddress))),\n _maxGas,\n _gasPriceBid,\n _data.length,\n _data\n )\n );\n }\n\n /**\n * @notice Unimplemented in this mock\n */\n function depositEth(uint256) external payable override returns (uint256) {\n revert(\"Unimplemented\");\n }\n\n /**\n * @notice Unimplemented in this mock\n */\n function pauseCreateRetryables() external pure override {\n revert(\"Unimplemented\");\n }\n\n /**\n * @notice Unimplemented in this mock\n */\n function unpauseCreateRetryables() external pure override {\n revert(\"Unimplemented\");\n }\n\n /**\n * @notice Unimplemented in this mock\n */\n function startRewriteAddress() external pure override {\n revert(\"Unimplemented\");\n }\n\n /**\n * @notice Unimplemented in this mock\n */\n function stopRewriteAddress() external pure override {\n revert(\"Unimplemented\");\n }\n\n /**\n * @dev Deliver a message to the bridge\n * @param _kind Type of the message\n * @param _sender Address that is sending the message\n * @param _messageData Encoded message data\n * @return Message number returned by the bridge\n */\n function _deliverMessage(uint8 _kind, address _sender, bytes memory _messageData) internal returns (uint256) {\n uint256 msgNum = deliverToBridge(_kind, _sender, keccak256(_messageData));\n emit InboxMessageDelivered(msgNum, _messageData);\n return msgNum;\n }\n\n /**\n * @dev Deliver a message to the bridge\n * @param _kind Type of the message\n * @param _sender Address that is sending the message\n * @param _messageDataHash keccak256 hash of the encoded message data\n * @return Message number returned by the bridge\n */\n function deliverToBridge(uint8 _kind, address _sender, bytes32 _messageDataHash) internal returns (uint256) {\n return bridge.deliverMessageToInbox{ value: msg.value }(_kind, _sender, _messageDataHash);\n }\n}\n" + }, + "contracts/tests/L1TokenGatewayMock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport { Ownable } from \"@openzeppelin/contracts/access/Ownable.sol\";\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport { SafeMath } from \"@openzeppelin/contracts/math/SafeMath.sol\";\nimport { ITokenGateway } from \"../arbitrum//ITokenGateway.sol\";\n\n/**\n * @title L1 Token Gateway mock contract\n * @dev Used for testing purposes, DO NOT USE IN PRODUCTION\n */\ncontract L1TokenGatewayMock is Ownable {\n using SafeMath for uint256;\n /// Next sequence number to return when outboundTransfer is called\n uint256 public nextSeqNum;\n\n /// @dev Emitted when a (fake) retryable ticket is created\n event FakeTxToL2(\n address from,\n uint256 value,\n uint256 maxGas,\n uint256 gasPriceBid,\n uint256 maxSubmissionCost,\n bytes outboundCalldata\n );\n\n /// @dev Emitted when an outbound transfer is initiated, i.e. tokens are deposited from L1 to L2\n event DepositInitiated(\n address l1Token,\n address indexed from,\n address indexed to,\n uint256 indexed sequenceNumber,\n uint256 amount\n );\n\n /**\n * @notice L1 Token Gateway Contract Constructor.\n */\n constructor() {}\n\n /**\n * @notice Creates and sends a fake retryable ticket to transfer GRT to L2.\n * This mock will actually just emit an event with parameters equivalent to what the real L1GraphTokenGateway\n * would send to L2.\n * @param _l1Token L1 Address of the GRT contract (needed for compatibility with Arbitrum Gateway Router)\n * @param _to Recipient address on L2\n * @param _amount Amount of tokens to tranfer\n * @param _maxGas Gas limit for L2 execution of the ticket\n * @param _gasPriceBid Price per gas on L2\n * @param _data Encoded maxSubmissionCost and sender address along with additional calldata\n * @return Sequence number of the retryable ticket created by Inbox (always )\n */\n function outboundTransfer(\n address _l1Token,\n address _to,\n uint256 _amount,\n uint256 _maxGas,\n uint256 _gasPriceBid,\n bytes calldata _data\n ) external payable returns (bytes memory) {\n require(_amount > 0, \"INVALID_ZERO_AMOUNT\");\n require(_to != address(0), \"INVALID_DESTINATION\");\n\n // nested scopes to avoid stack too deep errors\n address from;\n uint256 seqNum = nextSeqNum;\n nextSeqNum += 1;\n {\n uint256 maxSubmissionCost;\n bytes memory outboundCalldata;\n {\n bytes memory extraData;\n (from, maxSubmissionCost, extraData) = _parseOutboundData(_data);\n require(maxSubmissionCost > 0, \"NO_SUBMISSION_COST\");\n\n {\n // makes sure only sufficient ETH is supplied as required for successful redemption on L2\n // if a user does not desire immediate redemption they should provide\n // a msg.value of AT LEAST maxSubmissionCost\n uint256 expectedEth = maxSubmissionCost.add(_maxGas.mul(_gasPriceBid));\n require(msg.value >= expectedEth, \"WRONG_ETH_VALUE\");\n }\n outboundCalldata = getOutboundCalldata(_l1Token, from, _to, _amount, extraData);\n }\n {\n // transfer tokens to escrow\n IERC20(_l1Token).transferFrom(from, address(this), _amount);\n\n emit FakeTxToL2(from, msg.value, _maxGas, _gasPriceBid, maxSubmissionCost, outboundCalldata);\n }\n }\n emit DepositInitiated(_l1Token, from, _to, seqNum, _amount);\n\n return abi.encode(seqNum);\n }\n\n /**\n * @notice (Mock) Receives withdrawn tokens from L2\n * Actually does nothing, just keeping it here as its useful to define the expected\n * calldata for the outgoing transfer in tests.\n * @param _l1Token L1 Address of the GRT contract (needed for compatibility with Arbitrum Gateway Router)\n * @param _from Address of the sender\n * @param _to Recepient address on L1\n * @param _amount Amount of tokens transferred\n * @param _data Additional calldata\n */\n function finalizeInboundTransfer(\n address _l1Token,\n address _from,\n address _to,\n uint256 _amount,\n bytes calldata _data\n ) external payable {}\n\n /**\n * @notice Creates calldata required to create a retryable ticket\n * @dev encodes the target function with its params which\n * will be called on L2 when the retryable ticket is redeemed\n * @param _l1Token Address of the Graph token contract on L1\n * @param _from Address on L1 from which we're transferring tokens\n * @param _to Address on L2 to which we're transferring tokens\n * @param _amount Amount of GRT to transfer\n * @param _data Additional call data for the L2 transaction, which must be empty unless the caller is whitelisted\n * @return Encoded calldata (including function selector) for the L2 transaction\n */\n function getOutboundCalldata(\n address _l1Token,\n address _from,\n address _to,\n uint256 _amount,\n bytes memory _data\n ) public pure returns (bytes memory) {\n bytes memory emptyBytes;\n\n return\n abi.encodeWithSelector(\n ITokenGateway.finalizeInboundTransfer.selector,\n _l1Token,\n _from,\n _to,\n _amount,\n abi.encode(emptyBytes, _data)\n );\n }\n\n /**\n * @notice Decodes calldata required for transfer of tokens to L2\n * @dev Data must include maxSubmissionCost, extraData can be left empty. When the router\n * sends an outbound message, data also contains the from address, but this mock\n * doesn't consider this case\n * @param _data Encoded callhook data containing maxSubmissionCost and extraData\n * @return Sender of the tx\n * @return Max ether value used to submit the retryable ticket\n * @return Additional data sent to L2\n */\n function _parseOutboundData(bytes memory _data) private view returns (address, uint256, bytes memory) {\n address from;\n uint256 maxSubmissionCost;\n bytes memory extraData;\n from = msg.sender;\n // User-encoded data contains the max retryable ticket submission cost\n // and additional L2 calldata\n (maxSubmissionCost, extraData) = abi.decode(_data, (uint256, bytes));\n return (from, maxSubmissionCost, extraData);\n }\n}\n" + }, + "contracts/tests/L2TokenGatewayMock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport { Ownable } from \"@openzeppelin/contracts/access/Ownable.sol\";\nimport { ITokenGateway } from \"../arbitrum//ITokenGateway.sol\";\nimport { GraphTokenMock } from \"./GraphTokenMock.sol\";\nimport { ICallhookReceiver } from \"../ICallhookReceiver.sol\";\n\n/**\n * @title L2 Token Gateway mock contract\n * @dev Used for testing purposes, DO NOT USE IN PRODUCTION\n */\ncontract L2TokenGatewayMock is Ownable {\n /// Address of the L1 GRT contract\n address public immutable l1Token;\n /// Address of the L2 GRT contract\n address public immutable l2Token;\n /// Next ID to return when sending an outboundTransfer\n uint256 public nextId;\n\n /// @dev Emitted when a (fake) transaction to L1 is created\n event FakeTxToL1(address from, bytes outboundCalldata);\n /// @dev Emitted when a (fake) retryable ticket is received from L1\n event DepositFinalized(address token, address indexed from, address indexed to, uint256 amount);\n\n /// @dev Emitted when an outbound transfer is initiated, i.e. tokens are withdrawn to L1 from L2\n event WithdrawalInitiated(\n address l1Token,\n address indexed from,\n address indexed to,\n uint256 indexed sequenceNumber,\n uint256 amount\n );\n\n /**\n * @notice L2 Token Gateway Contract Constructor.\n * @param _l1Token Address of the L1 GRT contract\n * @param _l2Token Address of the L2 GRT contract\n */\n constructor(address _l1Token, address _l2Token) {\n l1Token = _l1Token;\n l2Token = _l2Token;\n }\n\n /**\n * @notice Creates and sends a (fake) transfer of GRT to L1.\n * This mock will actually just emit an event with parameters equivalent to what the real L2GraphTokenGateway\n * would send to L1.\n * @param _l1Token L1 Address of the GRT contract (needed for compatibility with Arbitrum Gateway Router)\n * @param _to Recipient address on L2\n * @param _amount Amount of tokens to tranfer\n * @param _data Encoded maxSubmissionCost and sender address along with additional calldata\n * @return ID of the L2-L1 message (incrementing on every call)\n */\n function outboundTransfer(\n address _l1Token,\n address _to,\n uint256 _amount,\n uint256,\n uint256,\n bytes calldata _data\n ) external payable returns (bytes memory) {\n require(_l1Token == l1Token, \"INVALID_L1_TOKEN\");\n require(_amount > 0, \"INVALID_ZERO_AMOUNT\");\n require(_to != address(0), \"INVALID_DESTINATION\");\n\n // nested scopes to avoid stack too deep errors\n address from;\n uint256 id = nextId;\n nextId += 1;\n {\n bytes memory outboundCalldata;\n {\n bytes memory extraData;\n (from, extraData) = _parseOutboundData(_data);\n\n require(msg.value == 0, \"!value\");\n require(extraData.length == 0, \"!extraData\");\n outboundCalldata = getOutboundCalldata(_l1Token, from, _to, _amount, extraData);\n }\n {\n // burn tokens from the sender, they will be released from escrow in L1\n GraphTokenMock(l2Token).bridgeBurn(from, _amount);\n\n emit FakeTxToL1(from, outboundCalldata);\n }\n }\n emit WithdrawalInitiated(_l1Token, from, _to, id, _amount);\n\n return abi.encode(id);\n }\n\n /**\n * @notice (Mock) Receives withdrawn tokens from L1\n * Implements calling callhooks if data is non-empty.\n * @param _l1Token L1 Address of the GRT contract (needed for compatibility with Arbitrum Gateway Router)\n * @param _from Address of the sender\n * @param _to Recipient address on L1\n * @param _amount Amount of tokens transferred\n * @param _data Additional calldata, will trigger an onTokenTransfer call if non-empty\n */\n function finalizeInboundTransfer(\n address _l1Token,\n address _from,\n address _to,\n uint256 _amount,\n bytes calldata _data\n ) external payable {\n require(_l1Token == l1Token, \"TOKEN_NOT_GRT\");\n require(msg.value == 0, \"INVALID_NONZERO_VALUE\");\n\n GraphTokenMock(l2Token).bridgeMint(_to, _amount);\n\n if (_data.length > 0) {\n ICallhookReceiver(_to).onTokenTransfer(_from, _amount, _data);\n }\n\n emit DepositFinalized(_l1Token, _from, _to, _amount);\n }\n\n /**\n * @notice Calculate the L2 address of a bridged token\n * @dev In our case, this would only work for GRT.\n * @param l1ERC20 address of L1 GRT contract\n * @return L2 address of the bridged GRT token\n */\n function calculateL2TokenAddress(address l1ERC20) public view returns (address) {\n if (l1ERC20 != l1Token) {\n return address(0);\n }\n return l2Token;\n }\n\n /**\n * @notice Creates calldata required to create a tx to L1\n * @param _l1Token Address of the Graph token contract on L1\n * @param _from Address on L2 from which we're transferring tokens\n * @param _to Address on L1 to which we're transferring tokens\n * @param _amount Amount of GRT to transfer\n * @param _data Additional call data for the L1 transaction, which must be empty\n * @return Encoded calldata (including function selector) for the L1 transaction\n */\n function getOutboundCalldata(\n address _l1Token,\n address _from,\n address _to,\n uint256 _amount,\n bytes memory _data\n ) public pure returns (bytes memory) {\n return\n abi.encodeWithSelector(\n ITokenGateway.finalizeInboundTransfer.selector,\n _l1Token,\n _from,\n _to,\n _amount,\n abi.encode(0, _data)\n );\n }\n\n /**\n * @dev Decodes calldata required for transfer of tokens to L1.\n * extraData can be left empty\n * @param _data Encoded callhook data\n * @return Sender of the tx\n * @return Any other data sent to L1\n */\n function _parseOutboundData(bytes calldata _data) private view returns (address, bytes memory) {\n address from;\n bytes memory extraData;\n // The mock doesn't take messages from the Router\n from = msg.sender;\n extraData = _data;\n return (from, extraData);\n }\n}\n" + }, + "contracts/tests/Stakes.sol": { + "content": "// SPDX-License-Identifier: GPL-2.0-or-later\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/math/SafeMath.sol\";\n\n/**\n * @title A collection of data structures and functions to manage the Indexer Stake state.\n * Used for low-level state changes, require() conditions should be evaluated\n * at the caller function scope.\n */\nlibrary Stakes {\n using SafeMath for uint256;\n using Stakes for Stakes.Indexer;\n\n struct Indexer {\n uint256 tokensStaked; // Tokens on the indexer stake (staked by the indexer)\n uint256 tokensAllocated; // Tokens used in allocations\n uint256 tokensLocked; // Tokens locked for withdrawal subject to thawing period\n uint256 tokensLockedUntil; // Block when locked tokens can be withdrawn\n }\n\n /**\n * @dev Deposit tokens to the indexer stake.\n * @param stake Stake data\n * @param _tokens Amount of tokens to deposit\n */\n function deposit(Stakes.Indexer storage stake, uint256 _tokens) internal {\n stake.tokensStaked = stake.tokensStaked.add(_tokens);\n }\n\n /**\n * @dev Release tokens from the indexer stake.\n * @param stake Stake data\n * @param _tokens Amount of tokens to release\n */\n function release(Stakes.Indexer storage stake, uint256 _tokens) internal {\n stake.tokensStaked = stake.tokensStaked.sub(_tokens);\n }\n\n /**\n * @dev Allocate tokens from the main stack to a SubgraphDeployment.\n * @param stake Stake data\n * @param _tokens Amount of tokens to allocate\n */\n function allocate(Stakes.Indexer storage stake, uint256 _tokens) internal {\n stake.tokensAllocated = stake.tokensAllocated.add(_tokens);\n }\n\n /**\n * @dev Unallocate tokens from a SubgraphDeployment back to the main stack.\n * @param stake Stake data\n * @param _tokens Amount of tokens to unallocate\n */\n function unallocate(Stakes.Indexer storage stake, uint256 _tokens) internal {\n stake.tokensAllocated = stake.tokensAllocated.sub(_tokens);\n }\n\n /**\n * @dev Lock tokens until a thawing period pass.\n * @param stake Stake data\n * @param _tokens Amount of tokens to unstake\n * @param _period Period in blocks that need to pass before withdrawal\n */\n function lockTokens(Stakes.Indexer storage stake, uint256 _tokens, uint256 _period) internal {\n // Take into account period averaging for multiple unstake requests\n uint256 lockingPeriod = _period;\n if (stake.tokensLocked > 0) {\n lockingPeriod = stake.getLockingPeriod(_tokens, _period);\n }\n\n // Update balances\n stake.tokensLocked = stake.tokensLocked.add(_tokens);\n stake.tokensLockedUntil = block.number.add(lockingPeriod);\n }\n\n /**\n * @dev Unlock tokens.\n * @param stake Stake data\n * @param _tokens Amount of tokens to unkock\n */\n function unlockTokens(Stakes.Indexer storage stake, uint256 _tokens) internal {\n stake.tokensLocked = stake.tokensLocked.sub(_tokens);\n if (stake.tokensLocked == 0) {\n stake.tokensLockedUntil = 0;\n }\n }\n\n /**\n * @dev Take all tokens out from the locked stake for withdrawal.\n * @param stake Stake data\n * @return Amount of tokens being withdrawn\n */\n function withdrawTokens(Stakes.Indexer storage stake) internal returns (uint256) {\n // Calculate tokens that can be released\n uint256 tokensToWithdraw = stake.tokensWithdrawable();\n\n if (tokensToWithdraw > 0) {\n // Reset locked tokens\n stake.unlockTokens(tokensToWithdraw);\n\n // Decrease indexer stake\n stake.release(tokensToWithdraw);\n }\n\n return tokensToWithdraw;\n }\n\n /**\n * @dev Get the locking period of the tokens to unstake.\n * If already unstaked before calculate the weighted average.\n * @param stake Stake data\n * @param _tokens Amount of tokens to unstake\n * @param _thawingPeriod Period in blocks that need to pass before withdrawal\n * @return True if staked\n */\n function getLockingPeriod(\n Stakes.Indexer memory stake,\n uint256 _tokens,\n uint256 _thawingPeriod\n ) internal view returns (uint256) {\n uint256 blockNum = block.number;\n uint256 periodA = (stake.tokensLockedUntil > blockNum) ? stake.tokensLockedUntil.sub(blockNum) : 0;\n uint256 periodB = _thawingPeriod;\n uint256 stakeA = stake.tokensLocked;\n uint256 stakeB = _tokens;\n return periodA.mul(stakeA).add(periodB.mul(stakeB)).div(stakeA.add(stakeB));\n }\n\n /**\n * @dev Return true if there are tokens staked by the Indexer.\n * @param stake Stake data\n * @return True if staked\n */\n function hasTokens(Stakes.Indexer memory stake) internal pure returns (bool) {\n return stake.tokensStaked > 0;\n }\n\n /**\n * @dev Return the amount of tokens used in allocations and locked for withdrawal.\n * @param stake Stake data\n * @return Token amount\n */\n function tokensUsed(Stakes.Indexer memory stake) internal pure returns (uint256) {\n return stake.tokensAllocated.add(stake.tokensLocked);\n }\n\n /**\n * @dev Return the amount of tokens staked not considering the ones that are already going\n * through the thawing period or are ready for withdrawal. We call it secure stake because\n * it is not subject to change by a withdraw call from the indexer.\n * @param stake Stake data\n * @return Token amount\n */\n function tokensSecureStake(Stakes.Indexer memory stake) internal pure returns (uint256) {\n return stake.tokensStaked.sub(stake.tokensLocked);\n }\n\n /**\n * @dev Tokens free balance on the indexer stake that can be used for any purpose.\n * Any token that is allocated cannot be used as well as tokens that are going through the\n * thawing period or are withdrawable\n * Calc: tokensStaked - tokensAllocated - tokensLocked\n * @param stake Stake data\n * @return Token amount\n */\n function tokensAvailable(Stakes.Indexer memory stake) internal pure returns (uint256) {\n return stake.tokensAvailableWithDelegation(0);\n }\n\n /**\n * @dev Tokens free balance on the indexer stake that can be used for allocations.\n * This function accepts a parameter for extra delegated capacity that takes into\n * account delegated tokens\n * @param stake Stake data\n * @param _delegatedCapacity Amount of tokens used from delegators to calculate availability\n * @return Token amount\n */\n function tokensAvailableWithDelegation(\n Stakes.Indexer memory stake,\n uint256 _delegatedCapacity\n ) internal pure returns (uint256) {\n uint256 tokensCapacity = stake.tokensStaked.add(_delegatedCapacity);\n uint256 _tokensUsed = stake.tokensUsed();\n // If more tokens are used than the current capacity, the indexer is overallocated.\n // This means the indexer doesn't have available capacity to create new allocations.\n // We can reach this state when the indexer has funds allocated and then any\n // of these conditions happen:\n // - The delegationCapacity ratio is reduced.\n // - The indexer stake is slashed.\n // - A delegator removes enough stake.\n if (_tokensUsed > tokensCapacity) {\n // Indexer stake is over allocated: return 0 to avoid stake to be used until\n // the overallocation is restored by staking more tokens, unallocating tokens\n // or using more delegated funds\n return 0;\n }\n return tokensCapacity.sub(_tokensUsed);\n }\n\n /**\n * @dev Tokens available for withdrawal after thawing period.\n * @param stake Stake data\n * @return Token amount\n */\n function tokensWithdrawable(Stakes.Indexer memory stake) internal view returns (uint256) {\n // No tokens to withdraw before locking period\n if (stake.tokensLockedUntil == 0 || block.number < stake.tokensLockedUntil) {\n return 0;\n }\n return stake.tokensLocked;\n }\n}\n" + }, + "contracts/tests/StakingMock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\nimport \"./Stakes.sol\";\n\ncontract StakingMock {\n using SafeMath for uint256;\n using Stakes for Stakes.Indexer;\n\n // -- State --\n\n uint256 public minimumIndexerStake = 100e18;\n uint256 public thawingPeriod = 10; // 10 blocks\n IERC20 public token;\n\n // Indexer stakes : indexer => Stake\n mapping(address => Stakes.Indexer) public stakes;\n\n /**\n * @dev Emitted when `indexer` stake `tokens` amount.\n */\n event StakeDeposited(address indexed indexer, uint256 tokens);\n\n /**\n * @dev Emitted when `indexer` unstaked and locked `tokens` amount `until` block.\n */\n event StakeLocked(address indexed indexer, uint256 tokens, uint256 until);\n\n /**\n * @dev Emitted when `indexer` withdrew `tokens` staked.\n */\n event StakeWithdrawn(address indexed indexer, uint256 tokens);\n\n // Contract constructor.\n constructor(IERC20 _token) {\n require(address(_token) != address(0), \"!token\");\n token = _token;\n }\n\n receive() external payable {}\n\n /**\n * @dev Deposit tokens on the indexer stake.\n * @param _tokens Amount of tokens to stake\n */\n function stake(uint256 _tokens) external {\n stakeTo(msg.sender, _tokens);\n }\n\n /**\n * @dev Deposit tokens on the indexer stake.\n * @param _indexer Address of the indexer\n * @param _tokens Amount of tokens to stake\n */\n function stakeTo(address _indexer, uint256 _tokens) public {\n require(_tokens > 0, \"!tokens\");\n\n // Ensure minimum stake\n require(stakes[_indexer].tokensSecureStake().add(_tokens) >= minimumIndexerStake, \"!minimumIndexerStake\");\n\n // Transfer tokens to stake from caller to this contract\n require(token.transferFrom(msg.sender, address(this), _tokens), \"!transfer\");\n\n // Stake the transferred tokens\n _stake(_indexer, _tokens);\n }\n\n /**\n * @dev Unstake tokens from the indexer stake, lock them until thawing period expires.\n * @param _tokens Amount of tokens to unstake\n */\n function unstake(uint256 _tokens) external {\n address indexer = msg.sender;\n Stakes.Indexer storage indexerStake = stakes[indexer];\n\n require(_tokens > 0, \"!tokens\");\n require(indexerStake.hasTokens(), \"!stake\");\n require(indexerStake.tokensAvailable() >= _tokens, \"!stake-avail\");\n\n // Ensure minimum stake\n uint256 newStake = indexerStake.tokensSecureStake().sub(_tokens);\n require(newStake == 0 || newStake >= minimumIndexerStake, \"!minimumIndexerStake\");\n\n // Before locking more tokens, withdraw any unlocked ones\n uint256 tokensToWithdraw = indexerStake.tokensWithdrawable();\n if (tokensToWithdraw > 0) {\n _withdraw(indexer);\n }\n\n indexerStake.lockTokens(_tokens, thawingPeriod);\n\n emit StakeLocked(indexer, indexerStake.tokensLocked, indexerStake.tokensLockedUntil);\n }\n\n /**\n * @dev Withdraw indexer tokens once the thawing period has passed.\n */\n function withdraw() external {\n _withdraw(msg.sender);\n }\n\n function _stake(address _indexer, uint256 _tokens) internal {\n // Deposit tokens into the indexer stake\n Stakes.Indexer storage indexerStake = stakes[_indexer];\n indexerStake.deposit(_tokens);\n\n emit StakeDeposited(_indexer, _tokens);\n }\n\n /**\n * @dev Withdraw indexer tokens once the thawing period has passed.\n * @param _indexer Address of indexer to withdraw funds from\n */\n function _withdraw(address _indexer) private {\n // Get tokens available for withdraw and update balance\n uint256 tokensToWithdraw = stakes[_indexer].withdrawTokens();\n require(tokensToWithdraw > 0, \"!tokens\");\n\n // Return tokens to the indexer\n require(token.transfer(_indexer, tokensToWithdraw), \"!transfer\");\n\n emit StakeWithdrawn(_indexer, tokensToWithdraw);\n }\n}\n" + }, + "contracts/tests/WalletMock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport { Address } from \"@openzeppelin/contracts/utils/Address.sol\";\n\n/**\n * @title WalletMock: a mock wallet contract for testing purposes\n * @dev For testing only, DO NOT USE IN PRODUCTION.\n * This is used to test L1-L2 transfer tools and to create scenarios\n * where an invalid wallet calls the transfer tool, e.g. a wallet that has an invalid\n * manager, or a wallet that has not been initialized.\n */\ncontract WalletMock {\n /// Target contract for the fallback function (usually a transfer tool contract)\n address public immutable target;\n /// Address of the GRT (mock) token\n address public immutable token;\n /// Address of the wallet's manager\n address public immutable manager;\n /// Whether the wallet has been initialized\n bool public immutable isInitialized;\n /// Whether the beneficiary has accepted the lock\n bool public immutable isAccepted;\n\n /**\n * @notice WalletMock constructor\n * @dev This constructor sets all the state variables so that\n * specific test scenarios can be created just by deploying this contract.\n * @param _target Target contract for the fallback function\n * @param _token Address of the GRT (mock) token\n * @param _manager Address of the wallet's manager\n * @param _isInitialized Whether the wallet has been initialized\n * @param _isAccepted Whether the beneficiary has accepted the lock\n */\n constructor(address _target, address _token, address _manager, bool _isInitialized, bool _isAccepted) {\n target = _target;\n token = _token;\n manager = _manager;\n isInitialized = _isInitialized;\n isAccepted = _isAccepted;\n }\n\n /**\n * @notice Fallback function\n * @dev This function calls the target contract with the data sent to this contract.\n * This is used to test the L1-L2 transfer tool.\n */\n fallback() external payable {\n // Call function with data\n Address.functionCall(target, msg.data);\n }\n\n /**\n * @notice Receive function\n * @dev This function is added to avoid compiler warnings, but just reverts.\n */\n receive() external payable {\n revert(\"Invalid call\");\n }\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": false, + "runs": 200 + }, + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file diff --git a/packages/token-distribution/eslint.config.js b/packages/token-distribution/eslint.config.js new file mode 100644 index 000000000..ed2d51271 --- /dev/null +++ b/packages/token-distribution/eslint.config.js @@ -0,0 +1,14 @@ +const config = require('eslint-graph-config') + +module.exports = [ + ...config.default, + { + rules: { + '@typescript-eslint/no-unsafe-assignment': 'off', + '@typescript-eslint/no-var-requires': 'off', + '@typescript-eslint/no-unsafe-call': 'off', + '@typescript-eslint/no-unsafe-member-access': 'off', + '@typescript-eslint/no-unsafe-argument': 'off', + }, + }, +] diff --git a/packages/token-distribution/hardhat.config.ts b/packages/token-distribution/hardhat.config.ts new file mode 100644 index 000000000..eaa994346 --- /dev/null +++ b/packages/token-distribution/hardhat.config.ts @@ -0,0 +1,192 @@ +import * as dotenv from 'dotenv' +import { extendEnvironment, task } from 'hardhat/config' + +dotenv.config() + +// Plugins + +import '@nomiclabs/hardhat-ethers' +import '@nomiclabs/hardhat-etherscan' +import '@nomiclabs/hardhat-waffle' +import 'hardhat-deploy' +import 'hardhat-abi-exporter' +import '@typechain/hardhat' +import 'hardhat-gas-reporter' +import '@openzeppelin/hardhat-upgrades' + +// Tasks + +import './ops/create' +import './ops/delete' +import './ops/info' +import './ops/manager' +import './ops/beneficiary' + +// Networks + +interface NetworkConfig { + network: string + chainId: number + url?: string + gas?: number | 'auto' + gasPrice?: number | 'auto' +} + +const networkConfigs: NetworkConfig[] = [ + { network: 'mainnet', chainId: 1 }, + { network: 'ropsten', chainId: 3 }, + { network: 'rinkeby', chainId: 4 }, + { network: 'goerli', chainId: 5 }, + { network: 'kovan', chainId: 42 }, + { network: 'sepolia', chainId: 11155111 }, + { + network: 'arbitrum-one', + chainId: 42161, + url: 'https://arb1.arbitrum.io/rpc', + }, + { + network: 'arbitrum-goerli', + chainId: 421613, + url: 'https://goerli-rollup.arbitrum.io/rpc', + }, + { + network: 'arbitrum-sepolia', + chainId: 421614, + url: 'https://sepolia-rollup.arbitrum.io/rpcblock', + }, +] + +function getAccountMnemonic() { + return process.env.MNEMONIC || '' +} + +function getDefaultProviderURL(network: string) { + return `https://${network}.infura.io/v3/${process.env.INFURA_KEY}` +} + +function setupNetworkConfig(config) { + for (const netConfig of networkConfigs) { + config.networks[netConfig.network] = { + chainId: netConfig.chainId, + url: netConfig.url ? netConfig.url : getDefaultProviderURL(netConfig.network), + gas: netConfig.gas || 'auto', + gasPrice: netConfig.gasPrice || 'auto', + accounts: { + mnemonic: getAccountMnemonic(), + }, + } + } +} + +// Env + +// eslint-disable-next-line @typescript-eslint/no-misused-promises +extendEnvironment(async (hre) => { + const accounts = await hre.ethers.getSigners() + try { + const deployment = await hre.deployments.get('GraphTokenLockManager') + const contract = await hre.ethers.getContractAt('GraphTokenLockManager', deployment.address) + await contract.deployed() // test if deployed + + hre['c'] = { + GraphTokenLockManager: contract.connect(accounts[0]), + } + } catch (err) { + // do not load the contract + } +}) + +// Tasks + +task('accounts', 'Prints the list of accounts', async (taskArgs, hre) => { + const accounts = await hre.ethers.getSigners() + for (const account of accounts) { + console.log(await account.getAddress()) + } +}) + +// Config + +const config = { + paths: { + sources: './contracts', + tests: './test', + cache: './cache', + artifacts: './build/artifacts', + }, + settings: { + optimizer: { + enabled: true, + runs: 200, + }, + }, + solidity: { + compilers: [ + { + version: '0.7.3', + settings: { + optimizer: { + enabled: false, + runs: 200, + }, + }, + }, + ], + }, + defaultNetwork: 'hardhat', + networks: { + hardhat: { + chainId: 1337, + loggingEnabled: false, + gas: 12000000, + gasPrice: 'auto', + blockGasLimit: 12000000, + }, + ganache: { + chainId: 1337, + url: 'http://localhost:8545', + }, + }, + namedAccounts: { + deployer: { + default: 0, + }, + }, + etherscan: { + apiKey: process.env.ETHERSCAN_API_KEY, + customChains: [ + { + network: 'arbitrum-sepolia', + chainId: 421614, + urls: { + apiURL: 'https://api-sepolia.arbiscan.io/api', + browserURL: 'https://sepolia.arbiscan.io', + }, + }, + ], + }, + typechain: { + outDir: 'build/typechain/contracts', + target: 'ethers-v5', + }, + abiExporter: { + path: './build/abis', + clear: false, + flat: true, + runOnCompile: true, + }, + contractSizer: { + alphaSort: true, + runOnCompile: false, + }, + gasReporter: { + enabled: process.env.REPORT_GAS ? true : false, + showTimeSpent: true, + currency: 'USD', + outputFile: 'reports/gas-report.log', + }, +} + +setupNetworkConfig(config) + +export default config diff --git a/packages/token-distribution/ops/beneficiary.ts b/packages/token-distribution/ops/beneficiary.ts new file mode 100644 index 000000000..547c5db7a --- /dev/null +++ b/packages/token-distribution/ops/beneficiary.ts @@ -0,0 +1,78 @@ +import { task } from 'hardhat/config' +import { HardhatRuntimeEnvironment } from 'hardhat/types' +import { askConfirm, waitTransaction } from './create' +import consola from 'consola' + +const logger = consola.create({}) + +task('beneficiary-accept-lock', 'Accept token lock. Only callable by beneficiary') + .addParam('contract', 'Address of the vesting contract') + .setAction(async (taskArgs, hre: HardhatRuntimeEnvironment) => { + const { deployer } = await hre.getNamedAccounts() + + const vestingContract = await hre.ethers.getContractAt('GraphTokenLockWallet', taskArgs.contract) + const beneficiary = await vestingContract.beneficiary() + let isAccepted = await vestingContract.isAccepted() + + logger.info(`Vesting contract address: ${vestingContract.address}}`) + logger.info(`Beneficiary: ${beneficiary}`) + logger.info(`Connected account: ${deployer}`) + logger.info(`Lock accepted: ${isAccepted}`) + + // Check lock status + if (isAccepted) { + logger.warn('Lock already accepted, exiting...') + process.exit(0) + } + + // Check beneficiary + if (beneficiary !== deployer) { + logger.error('Only the beneficiary can accept the vesting contract lock!') + process.exit(1) + } + + // Confirm + logger.info('Preparing transaction to accept token lock...') + if (!(await askConfirm())) { + logger.log('Cancelled') + process.exit(1) + } + + // Accept lock + const tx = await vestingContract.acceptLock() + await waitTransaction(tx) + + // Verify lock state + isAccepted = await vestingContract.isAccepted() + if (isAccepted) { + logger.info(`Lock accepted successfully!`) + } else { + logger.error(`Lock not accepted! Unknown error, please try again`) + } + }) + +task('beneficiary-vesting-info', 'Print vesting contract info') + .addParam('contract', 'Address of the vesting contract') + .setAction(async (taskArgs, hre: HardhatRuntimeEnvironment) => { + const vestingContract = await hre.ethers.getContractAt('GraphTokenLockWallet', taskArgs.contract) + const beneficiary = await vestingContract.beneficiary() + const isAccepted = await vestingContract.isAccepted() + const startTime = await vestingContract.startTime() + const endTime = await vestingContract.endTime() + const periods = await vestingContract.periods() + const releaseStartTime = await vestingContract.releaseStartTime() + const vestingCliffTime = await vestingContract.vestingCliffTime() + const managedAmount = await vestingContract.managedAmount() + const revocable = await vestingContract.revocable() + + logger.info(`Vesting contract address: ${vestingContract.address}}`) + logger.info(`Beneficiary: ${beneficiary}`) + logger.info(`Managed amount: ${managedAmount}`) + logger.info(`Lock accepted: ${isAccepted}`) + logger.info(`Revocable: ${revocable}`) + logger.info(`Start time: ${startTime}`) + logger.info(`End time: ${endTime}`) + logger.info(`Periods: ${periods}`) + logger.info(`Release start time: ${releaseStartTime}`) + logger.info(`Vesting cliff time: ${vestingCliffTime}`) + }) diff --git a/packages/token-distribution/ops/create.ts b/packages/token-distribution/ops/create.ts new file mode 100644 index 000000000..0dce2d253 --- /dev/null +++ b/packages/token-distribution/ops/create.ts @@ -0,0 +1,580 @@ +import PQueue from 'p-queue' +import fs from 'fs' +import consola from 'consola' +import inquirer from 'inquirer' +import { BigNumber, Contract, ContractFactory, ContractReceipt, ContractTransaction, Event, utils } from 'ethers' + +import { NonceManager } from '@ethersproject/experimental' +import { task } from 'hardhat/config' +import { HardhatRuntimeEnvironment } from 'hardhat/types' +import { boolean } from 'hardhat/internal/core/params/argumentTypes' +import { TxBuilder } from './tx-builder' + +const { getAddress, keccak256, formatEther, parseEther } = utils + +const logger = consola.create({}) + +enum Revocability { + NotSet, + Enabled, + Disabled, +} + +interface TokenLockConfigEntry { + owner?: string + beneficiary: string + managedAmount: BigNumber + startTime: string + endTime: string + periods: string + revocable: Revocability + releaseStartTime: string + vestingCliffTime: string + salt?: string + txHash?: string + contractAddress?: string +} + +interface TokenLockDeployEntry extends TokenLockConfigEntry { + contractAddress: string + salt: string + txHash: string +} + +export const askConfirm = async () => { + const res = await inquirer.prompt({ + name: 'confirm', + type: 'confirm', + message: `Are you sure you want to proceed?`, + }) + return res.confirm ? res.confirm as boolean : false +} + +const isValidAddress = (address: string) => { + try { + getAddress(address) + return true + } catch (err) { + logger.error(`Invalid address ${address}`) + return false + } +} + +export const isValidAddressOrFail = (address: string) => { + if (!isValidAddress(address)) { + process.exit(1) + } +} + +const loadDeployData = (filepath: string): TokenLockConfigEntry[] => { + const data = fs.readFileSync(filepath, 'utf8') + const entries = data.split('\n').map(e => e.trim()) + entries.shift() // remove the title from the csv + return entries + .filter(entryData => !!entryData) + .map((entryData) => { + const entry = entryData.split(',') + return { + beneficiary: entry[0], + managedAmount: parseEther(entry[1]), + startTime: entry[2], + endTime: entry[3], + periods: entry[4], + revocable: parseInt(entry[5]), + releaseStartTime: entry[6], + vestingCliffTime: entry[7], + } + }) +} + +const loadResultData = (filepath: string): TokenLockConfigEntry[] => { + const data = fs.readFileSync(filepath, 'utf8') + const entries = data.split('\n').map(e => e.trim()) + return entries + .filter(entryData => !!entryData) + .map((entryData) => { + const entry = entryData.split(',') + return { + beneficiary: entry[0], + managedAmount: parseEther(entry[1]), + startTime: entry[2], + endTime: entry[3], + periods: entry[4], + revocable: parseInt(entry[5]), + releaseStartTime: entry[6], + vestingCliffTime: entry[7], + contractAddress: entry[8], + salt: entry[9], + txHash: entry[10], + } + }) +} + +const deployEntryToCSV = (entry: TokenLockDeployEntry) => { + return [ + entry.beneficiary, + formatEther(entry.managedAmount), + entry.startTime, + entry.endTime, + entry.periods, + entry.revocable, + entry.releaseStartTime, + entry.vestingCliffTime, + entry.contractAddress, + entry.salt, + entry.txHash, + ].join(',') +} + +const saveDeployResult = (filepath: string, entry: TokenLockDeployEntry) => { + const line = deployEntryToCSV(entry) + '\n' + fs.writeFileSync(filepath, line, { + flag: 'a+', + }) +} + +const checkAddresses = (entries: TokenLockConfigEntry[]): boolean => { + for (const entry of entries) { + if (!isValidAddress(entry.beneficiary)) { + return false + } + } + return true +} + +const getTotalAmount = (entries: TokenLockConfigEntry[]): BigNumber => { + return entries.reduce((total, entry) => total.add(entry.managedAmount), BigNumber.from(0)) +} + +const prettyDate = (date: string) => { + const n = parseInt(date) + if (n === 0) return '0' + const d = new Date(n * 1000) + return d.toLocaleString() +} + +const prettyConfigEntry = (config: TokenLockConfigEntry) => { + return ` + Beneficiary: ${config.beneficiary} + Amount: ${formatEther(config.managedAmount)} GRT + Starts: ${config.startTime} (${prettyDate(config.startTime)}) + Ends: ${config.endTime} (${prettyDate(config.endTime)}) + Periods: ${config.periods} + Revocable: ${config.revocable} + ReleaseCliff: ${config.releaseStartTime} (${prettyDate(config.releaseStartTime)}) + VestingCliff: ${config.vestingCliffTime} (${prettyDate(config.vestingCliffTime)}) + Owner: ${config.owner} + -> ContractAddress: ${config.contractAddress} + ` +} + +export const prettyEnv = async (hre: HardhatRuntimeEnvironment) => { + const { deployer } = await hre.getNamedAccounts() + + const provider = hre.ethers.provider + + const balance = await provider.getBalance(deployer) + const chainId = (await provider.getNetwork()).chainId + const nonce = await provider.getTransactionCount(deployer) + + const gas = hre.network.config.gas + const gasPrice = hre.network.config.gasPrice + + return ` + Wallet: address=${deployer} chain=${chainId} nonce=${nonce} balance=${formatEther(balance)} + Gas settings: gas=${gas} gasPrice=${gasPrice} + ` +} + +const calculateSalt = async ( + hre: HardhatRuntimeEnvironment, + entry: TokenLockConfigEntry, + managerAddress: string, + tokenAddress: string, +) => { + const factory = await getContractFactory(hre, 'GraphTokenLockWallet') + + return keccak256( + factory.interface.encodeFunctionData( + 'initialize(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)', + [ + managerAddress, + entry.owner, + entry.beneficiary, + tokenAddress, + entry.managedAmount, + entry.startTime, + entry.endTime, + entry.periods, + entry.releaseStartTime, + entry.vestingCliffTime, + entry.revocable, + ], + ), + ) +} + +const getContractFactory = async (hre: HardhatRuntimeEnvironment, name: string) => { + const artifact = await hre.deployments.getArtifact(name) + return new ContractFactory(artifact.abi, artifact.bytecode) +} + +const getDeployContractAddresses = async (entries: TokenLockConfigEntry[], manager: Contract) => { + const masterCopy = await manager.masterCopy() + for (const entry of entries) { + // There are two type of managers + let contractAddress = '' + try { + contractAddress = await manager['getDeploymentAddress(bytes32,address,address)']( + entry.salt, + masterCopy, + manager.address, + ) + } catch (error) { + contractAddress = await manager['getDeploymentAddress(bytes32,address)'](entry.salt, masterCopy) + } + + const deployEntry = { ...entry, salt: entry.salt, txHash: '', contractAddress } + logger.log(prettyConfigEntry(deployEntry)) + } +} + +const populateEntries = async ( + hre: HardhatRuntimeEnvironment, + entries: TokenLockConfigEntry[], + managerAddress: string, + tokenAddress: string, + ownerAddress: string, +) => { + const results: TokenLockConfigEntry[] = [] + for (const entry of entries) { + entry.owner = ownerAddress + entry.salt = await calculateSalt(hre, entry, managerAddress, tokenAddress) + results.push(entry) + } + return results +} + +export const getTokenLockManagerOrFail = async (hre: HardhatRuntimeEnvironment, name: string) => { + const deployment = await hre.deployments.get(name) + if (!deployment.address) { + logger.error('GraphTokenLockManager address not found') + process.exit(1) + } + + const manager = await hre.ethers.getContractAt('GraphTokenLockManager', deployment.address) + try { + await manager.deployed() + } catch (err) { + logger.error('GraphTokenLockManager not deployed at', manager.address) + process.exit(1) + } + + return manager +} + +export const waitTransaction = async (tx: ContractTransaction, confirmations = 1): Promise => { + logger.log(`> Transaction sent: ${tx.hash}`) + const receipt = await tx.wait(confirmations) + receipt.status ? logger.success(`Transaction succeeded: ${tx.hash}`) : logger.warn(`Transaction failed: ${tx.hash}`) + return receipt +} + +// -- Tasks -- + +task('create-token-locks', 'Create token lock contracts from file') + .addParam('deployFile', 'File from where to read the deploy config') + .addParam('resultFile', 'File where to save results') + .addParam('ownerAddress', 'Owner address of token lock contracts') + .addParam('managerName', 'Name of the token lock manager deployment', 'GraphTokenLockManager') + .addFlag('dryRun', 'Get the deterministic contract addresses but do not deploy') + .addFlag( + 'txBuilder', + 'Output transaction batch in JSON format, compatible with Gnosis Safe transaction builder. Does not deploy contracts', + ) + .addOptionalParam('txBuilderTemplate', 'File to use as a template for the transaction builder') + .setAction(async (taskArgs, hre: HardhatRuntimeEnvironment) => { + // Get contracts + const manager = await getTokenLockManagerOrFail(hre, taskArgs.managerName) + + // Prepare + logger.log(await prettyEnv(hre)) + + const tokenAddress = await manager.token() + + logger.info('Deploying token lock contracts...') + logger.log(`> GraphToken: ${tokenAddress}`) + logger.log(`> GraphTokenLockMasterCopy: ${await manager.masterCopy()}`) + logger.log(`> GraphTokenLockManager: ${manager.address}`) + + // Load config entries + logger.log('') + logger.info('Verifying deployment data...') + let entries = loadDeployData(taskArgs.deployFile) + if (!checkAddresses(entries)) { + process.exit(1) + } + logger.success(`Total of ${entries.length} entries. All good!`) + + // Load deployed entries + const deployedEntries = loadResultData(taskArgs.resultFile) + + // Populate entries + entries = await populateEntries(hre, entries, manager.address, tokenAddress, taskArgs.ownerAddress) + + // Filter out already deployed ones + entries = entries.filter(entry => !deployedEntries.find(deployedEntry => deployedEntry.salt === entry.salt)) + logger.success(`Total of ${entries.length} entries after removing already deployed. All good!`) + if (entries.length === 0) { + logger.warn('Nothing new to deploy') + process.exit(1) + } + + // Dry running + if (taskArgs.dryRun) { + logger.info('Running in dry run mode!') + await getDeployContractAddresses(entries, manager) + process.exit(0) + } + + // If deploying contracts, check + // - deployer is the manager owner + // - deployer is well funded + if (!taskArgs.txBuilder) { + // Ensure deployer is the manager owner + const tokenLockManagerOwner = await manager.owner() + const { deployer } = await hre.getNamedAccounts() + if (tokenLockManagerOwner !== deployer) { + logger.error('Only the owner can deploy token locks') + process.exit(1) + } + + // Check if Manager is funded + logger.log('') + logger.info('Verifying balances...') + const grt = await hre.ethers.getContractAt('ERC20', tokenAddress) + const totalAmount = getTotalAmount(entries) + const currentBalance = await grt.balanceOf(manager.address) + logger.log(`> Amount to distribute: ${formatEther(totalAmount)} GRT`) + logger.log(`> Amount in the Manager: ${formatEther(currentBalance)} GRT`) + if (currentBalance.lt(totalAmount)) { + logger.error(`GraphTokenLockManager is underfunded. Deposit more funds into ${manager.address}`) + process.exit(1) + } + logger.success('Manager has enough tokens to fund contracts') + } + + // Summary + if (!(await askConfirm())) { + logger.log('Cancelled') + process.exit(1) + } + + if (!taskArgs.txBuilder) { + // Deploy contracts + const accounts = await hre.ethers.getSigners() + const nonceManager = new NonceManager(accounts[0]) // Use NonceManager to send concurrent txs + + const queue = new PQueue({ concurrency: 6 }) + + for (const entry of entries) { + await queue.add(async () => { + logger.log('') + logger.info(`Creating contract...`) + logger.log(prettyConfigEntry(entry)) + + try { + // Deploy + const tx = await manager + .connect(nonceManager) + .createTokenLockWallet( + entry.owner, + entry.beneficiary, + entry.managedAmount, + entry.startTime, + entry.endTime, + entry.periods, + entry.releaseStartTime, + entry.vestingCliffTime, + entry.revocable, + ) + const receipt = await waitTransaction(tx) + const event: Event = receipt.events[0] + const contractAddress = event.args['proxy'] + logger.success(`Deployed: ${contractAddress} (${entry.salt})`) + + // Save result + const deployResult = { ...entry, salt: entry.salt, txHash: tx.hash, contractAddress } + saveDeployResult(taskArgs.resultFile, deployResult) + } catch (err) { + logger.error(err) + } + }) + } + await queue.onIdle() + } else { + // Output tx builder json + logger.info(`Creating transaction builder JSON file...`) + const chainId = (await hre.ethers.provider.getNetwork()).chainId.toString() + const txBuilder = new TxBuilder(chainId, taskArgs.txBuilderTemplate) + + // Send funds to the manager + const grt = await hre.ethers.getContractAt('ERC20', tokenAddress) + const totalAmount = getTotalAmount(entries) + const currentBalance = await grt.balanceOf(manager.address) + if (currentBalance.lt(totalAmount)) { + logger.log('Building manager funding transactions...') + const remainingBalance = totalAmount.sub(currentBalance) + // Use GRT.approve + the manager deposit function instead of GRT.transfer to be super safe + const approveTx = await grt.populateTransaction.approve(manager.address, remainingBalance) + txBuilder.addTx({ + to: tokenAddress, + value: '0', + data: approveTx.data, + }) + const depositTx = await manager.populateTransaction.deposit(remainingBalance) + txBuilder.addTx({ + to: manager.address, + value: '0', + data: depositTx.data, + }) + } + + for (const entry of entries) { + logger.log('Building tx...') + logger.log(prettyConfigEntry(entry)) + const tx = await manager.populateTransaction.createTokenLockWallet( + entry.owner, + entry.beneficiary, + entry.managedAmount, + entry.startTime, + entry.endTime, + entry.periods, + entry.releaseStartTime, + entry.vestingCliffTime, + entry.revocable, + ) + txBuilder.addTx({ + to: manager.address, + value: '0', + data: tx.data, + }) + } + + // Save result into json file + const outputFile = txBuilder.saveToFile() + logger.success(`Transaction batch saved to ${outputFile}`) + } + }) + +task('create-token-locks-simple', 'Create token lock contracts from file') + .addParam('deployFile', 'File from where to read the deploy config') + .addParam('resultFile', 'File where to save results') + .addParam('tokenAddress', 'Token address to use in the contracts') + .addParam('ownerAddress', 'Owner address of token lock contracts') + .addOptionalParam('dryRun', 'Get the deterministic contract addresses but do not deploy', false, boolean) + .setAction(async (taskArgs, hre: HardhatRuntimeEnvironment) => { + // Prepare + logger.log(await prettyEnv(hre)) + + // Validations + const tokenAddress = taskArgs.tokenAddress + const ownerAddress = taskArgs.ownerAddress + isValidAddressOrFail(tokenAddress) + isValidAddressOrFail(ownerAddress) + + logger.info('Deploying token lock simple contracts...') + logger.log(`> GraphToken: ${tokenAddress}`) + + // Load config entries + logger.log('') + logger.info('Verifying deployment data...') + const entries = loadDeployData(taskArgs.deployFile) + if (!checkAddresses(entries)) { + process.exit(1) + } + logger.success(`Total of ${entries.length} entries. All good!`) + + // Check if Manager is funded + logger.log('') + logger.info('Verifying balances...') + const totalAmount = getTotalAmount(entries) + logger.log(`> Amount to distribute: ${formatEther(totalAmount)} GRT`) + + // Summary + if (!(await askConfirm())) { + logger.log('Cancelled') + process.exit(1) + } + + // Get accounts + const accounts = await hre.ethers.getSigners() + const deployer = accounts[0] + + // Deploy contracts + for (const entry of entries) { + logger.log('') + logger.info(`Creating contract...`) + logger.log(prettyConfigEntry(entry)) + + try { + const tokenLockSimpleFactory = await getContractFactory(hre, 'GraphTokenLockSimple') + const tokenLockSimpleDeployment = await tokenLockSimpleFactory.connect(deployer).deploy() + const tokenLockSimple = await tokenLockSimpleDeployment.deployed() + logger.success(`Deployed: ${tokenLockSimple.address}`) + + logger.log('Setting up...') + const tx = await tokenLockSimple.initialize( + ownerAddress, + entry.beneficiary, + tokenAddress, + entry.managedAmount, + entry.startTime, + entry.endTime, + entry.periods, + entry.releaseStartTime, + entry.vestingCliffTime, + entry.revocable, + ) + await waitTransaction(tx) + + // Save result + const deployResult = { ...entry, txHash: tx.hash, salt: '', contractAddress: tokenLockSimple.address } + saveDeployResult(taskArgs.resultFile, deployResult) + } catch (err) { + logger.log(err) + } + } + }) + +task('scan-token-locks-balances', 'Check current balances of deployed contracts') + .addParam('resultFile', 'File where to load deployed contracts') + .addParam('managerName', 'Name of the token lock manager deployment', 'GraphTokenLockManager') + .setAction(async (taskArgs, hre: HardhatRuntimeEnvironment) => { + // Get contracts + const manager = await getTokenLockManagerOrFail(hre, taskArgs.managerName) + + // Prepare + logger.log(await prettyEnv(hre)) + + const tokenAddress = await manager.token() + + logger.info('Using:') + logger.log(`> GraphToken: ${tokenAddress}`) + logger.log(`> GraphTokenLockMasterCopy: ${await manager.masterCopy()}`) + logger.log(`> GraphTokenLockManager: ${manager.address}`) + + const grt = await hre.ethers.getContractAt('ERC20', tokenAddress) + const balance = await grt.balanceOf(manager.address) + logger.log('Current Manager balance is ', formatEther(balance)) + + // Load deployed entries + const deployedEntries = loadResultData('/' + taskArgs.resultFile) + + let balances = BigNumber.from(0) + for (const entry of deployedEntries) { + balances = balances.add(await grt.balanceOf(entry.contractAddress)) + } + logger.log(deployedEntries.length) + logger.log(formatEther(balances)) + }) diff --git a/packages/token-distribution/ops/delete.ts b/packages/token-distribution/ops/delete.ts new file mode 100644 index 000000000..1cb84c755 --- /dev/null +++ b/packages/token-distribution/ops/delete.ts @@ -0,0 +1,88 @@ +import { task } from 'hardhat/config' +import { HardhatRuntimeEnvironment } from 'hardhat/types' +import { askConfirm, prettyEnv, waitTransaction } from './create' +import consola from 'consola' +import { TxBuilder } from './tx-builder' + +const logger = consola.create({}) + +const getTokenLockWalletOrFail = async (hre: HardhatRuntimeEnvironment, address: string) => { + const wallet = await hre.ethers.getContractAt('GraphTokenLockWallet', address) + try { + await wallet.deployed() + } catch (err) { + logger.error('GraphTokenLockWallet not deployed at', wallet.address) + process.exit(1) + } + + return wallet +} + +task('cancel-token-lock', 'Cancel token lock contract') + .addParam('contract', 'Address of the vesting contract to be cancelled') + .addFlag('dryRun', 'Get the deterministic contract addresses but do not deploy') + .addFlag( + 'txBuilder', + 'Output transaction batch in JSON format, compatible with Gnosis Safe transaction builder. Does not deploy contracts', + ) + .addOptionalParam('txBuilderTemplate', 'File to use as a template for the transaction builder') + .setAction(async (taskArgs, hre: HardhatRuntimeEnvironment) => { + // Get contracts + const lockWallet = await getTokenLockWalletOrFail(hre, taskArgs.contract) + + // Prepare + logger.log(await prettyEnv(hre)) + + logger.info('Cancelling token lock contract...') + logger.log(`> GraphTokenLockWallet: ${lockWallet.address}`) + + // Check lock status + logger.log('Veryfing lock status...') + const lockAccepted = await lockWallet.isAccepted() + if (lockAccepted) { + logger.error('Lock was already accepted, use revoke() to revoke the vesting schedule') + process.exit(1) + } else { + logger.success(`Lock not accepted yet, preparing to cancel!`) + } + + // Nothing else to do, exit if dry run + if (taskArgs.dryRun) { + logger.info('Running in dry run mode!') + process.exit(0) + } + + if (!(await askConfirm())) { + logger.log('Cancelled') + process.exit(1) + } + + if (!taskArgs.txBuilder) { + const { deployer } = await hre.getNamedAccounts() + const lockOwner = await lockWallet.owner() + if (lockOwner !== deployer) { + logger.error('Only the owner can cancell the token lock') + process.exit(1) + } + + logger.info(`Cancelling contract...`) + const tx = await lockWallet.cancelLock() + await waitTransaction(tx) + logger.success(`Token lock at ${lockWallet.address} was cancelled`) + } else { + logger.info(`Creating transaction builder JSON file...`) + const chainId = (await hre.ethers.provider.getNetwork()).chainId.toString() + const txBuilder = new TxBuilder(chainId, taskArgs.txBuilderTemplate) + + const tx = await lockWallet.populateTransaction.cancelLock() + txBuilder.addTx({ + to: lockWallet.address, + data: tx.data, + value: 0, + }) + + // Save result into json file + const outputFile = txBuilder.saveToFile() + logger.success(`Transaction saved to ${outputFile}`) + } + }) diff --git a/packages/token-distribution/ops/deploy-data.csv b/packages/token-distribution/ops/deploy-data.csv new file mode 100644 index 000000000..3c56d705b --- /dev/null +++ b/packages/token-distribution/ops/deploy-data.csv @@ -0,0 +1,5 @@ +beneficiary,managedAmount,startTime,endTime,periods,revocable,releaseStartTime,vestingCliffTime +0xCF143e9dd5D64dE5ef096b291BAc195968A06D0d,250000.00,1627776000,1754006400,48,1,1659312000,0 +0x525ee071454cf9b6d750720bce8d8697ef82f02f,125000.00,1682899200,1777593600,36,1,1714435200,0 +0xBe243A5907071185d1bAeBa85C9E426DA797e4dD,909090.91,1696809600,1823040000,48,1,0,0 +0xD8068FEc14b3dd0223E21acfe978906556dAba99,500000.00,1697414400,1823644800,48,1,1728950400,0 \ No newline at end of file diff --git a/packages/token-distribution/ops/info.ts b/packages/token-distribution/ops/info.ts new file mode 100644 index 000000000..4906293df --- /dev/null +++ b/packages/token-distribution/ops/info.ts @@ -0,0 +1,758 @@ +import PQueue from 'p-queue' +import { task } from 'hardhat/config' +import '@nomiclabs/hardhat-ethers' +import { BigNumber, Contract, utils } from 'ethers' +import { HardhatRuntimeEnvironment } from 'hardhat/types' +import CoinGecko from 'coingecko-api' +import { Block } from '@ethersproject/abstract-provider' +import * as GraphClient from '../.graphclient' +import { + CuratorWalletsDocument, + CuratorWalletsQuery, + execute, + GraphAccountDocument, + GraphAccountQuery, + GraphNetworkDocument, + GraphNetworkQuery, + TokenLockWalletsDocument, + TokenLockWalletsQuery, +} from '../.graphclient' +import { ExecutionResult } from 'graphql' + +const CoinGeckoClient = new CoinGecko() +const RPC_CONCURRENCY = 10 +const BLOCK_DRIFT = 10 + +// Types + +interface ContractTokenData { + address: string + tokenAmount: BigNumber +} + +type TokenLockWallet = Pick< + GraphClient.TokenLockWallet, + | 'id' + | 'beneficiary' + | 'managedAmount' + | 'periods' + | 'startTime' + | 'endTime' + | 'revocable' + | 'releaseStartTime' + | 'vestingCliffTime' + | 'initHash' + | 'txHash' + | 'manager' + | 'tokensReleased' + | 'tokensWithdrawn' + | 'tokensRevoked' + | 'blockNumberCreated' +> & { tokensUsed?: BigNumber } +type GraphNetwork = Pick +type GraphAccount = Pick & { + indexer?: Pick + curator?: Pick + delegator?: Pick +} + +// Helpers + +const toInt = s => parseInt(s) / 1e18 +const toBN = (s: string): BigNumber => BigNumber.from(s) +const formatGRT = (n: BigNumber): string => utils.formatEther(n) +const formatRoundGRT = (n: BigNumber): string => formatGRT(n).split('.')[0] +const parseGRT = (n: string): BigNumber => utils.parseEther(n) +const toWei = (n: string): string => parseGRT(n).toString() +const prettyDate = (date: string) => { + const n = parseInt(date) + if (n === 0) return '0' + const d = new Date(n * 1000) + return d.toISOString().replace(/T/, ' ').replace(/\..+/, '') +} +const now = () => +new Date() / 1000 + +// Fixed data + +const vestingListExchanges: TokenLockWallet[] = [ + { + beneficiary: '0x0000000000000000000000000000000000000000', + managedAmount: toWei('50000000'), + periods: 48, + startTime: '1522602000', + endTime: '1648832400', + revocable: 'Enabled', + releaseStartTime: '1627146000', + vestingCliffTime: '0', + id: '0x0000000000000000000000000000000000000000', + initHash: '0x0000000000000000000000000000000000000000000000000000000000000000', + txHash: '0x0000000000000000000000000000000000000000000000000000000000000000', + manager: '0x0000000000000000000000000000000000000000', + tokensReleased: '0', + tokensWithdrawn: '0', + tokensRevoked: '0', + blockNumberCreated: '0', + }, + { + beneficiary: '0x0000000000000000000000000000000000000000', + managedAmount: toWei('8000000'), + periods: 1, + startTime: '1608224400', + endTime: '1627146000', + revocable: 'Disabled', + releaseStartTime: '0', + vestingCliffTime: '0', + id: '0x0000000000000000000000000000000000000000', + initHash: '0x0000000000000000000000000000000000000000000000000000000000000000', + txHash: '0x0000000000000000000000000000000000000000000000000000000000000000', + manager: '0x0000000000000000000000000000000000000000', + tokensReleased: '0', + tokensWithdrawn: '0', + tokensRevoked: '0', + blockNumberCreated: '0', + }, + { + beneficiary: '0x0000000000000000000000000000000000000000', + managedAmount: toWei('59000000'), + periods: 48, + startTime: '1543683600', + endTime: '1669914000', + revocable: 'Enabled', + releaseStartTime: '1627146000', + vestingCliffTime: '0', + id: '0x0000000000000000000000000000000000000000', + initHash: '0x0000000000000000000000000000000000000000000000000000000000000000', + txHash: '0x0000000000000000000000000000000000000000000000000000000000000000', + manager: '0x0000000000000000000000000000000000000000', + tokensReleased: '0', + tokensWithdrawn: '0', + tokensRevoked: '0', + blockNumberCreated: '0', + }, + { + beneficiary: '0x0000000000000000000000000000000000000000', + managedAmount: toWei('4000000'), + periods: 1, + startTime: '1608224400', + endTime: '1627146000', + revocable: 'Disabled', + releaseStartTime: '0', + vestingCliffTime: '0', + id: '0x0000000000000000000000000000000000000000', + initHash: '0x0000000000000000000000000000000000000000000000000000000000000000', + txHash: '0x0000000000000000000000000000000000000000000000000000000000000000', + manager: '0x0000000000000000000000000000000000000000', + tokensReleased: '0', + tokensWithdrawn: '0', + tokensRevoked: '0', + blockNumberCreated: '0', + }, + { + beneficiary: '0x0000000000000000000000000000000000000000', + managedAmount: toWei('50000000'), + periods: 48, + startTime: '1527872400', + endTime: '1654102800', + revocable: 'Enabled', + releaseStartTime: '1627146000', + vestingCliffTime: '0', + id: '0x0000000000000000000000000000000000000000', + initHash: '0x0000000000000000000000000000000000000000000000000000000000000000', + txHash: '0x0000000000000000000000000000000000000000000000000000000000000000', + manager: '0x0000000000000000000000000000000000000000', + tokensReleased: '0', + tokensWithdrawn: '0', + tokensRevoked: '0', + blockNumberCreated: '0', + }, +] + +// Network + +async function getNetworkData(blockNumber: number): Promise { + const result: ExecutionResult = await execute(GraphNetworkDocument, { blockNumber }) + return result.data.graphNetwork +} + +async function getWallets(blockNumber: number): Promise { + const result: ExecutionResult = await execute(TokenLockWalletsDocument, { + blockNumber, + first: 3_000, + }) + return result.data ? result.data.tokenLockWallets : [] +} + +async function getCuratorWallets(blockNumber: number): Promise { + const result: ExecutionResult = await execute(CuratorWalletsDocument, { + blockNumber, + first: 3_000, + }) + return result.data ? result.data.tokenLockWallets : [] +} + +async function getGraphAccount(accountId: string, blockNumber: number): Promise { + const result: ExecutionResult = await execute(GraphAccountDocument, { accountId, blockNumber }) + return result.data.graphAccount +} + +// Calculations + +function getAvailableAmount(wallet: TokenLockWallet, blockTimestamp: number): BigNumber { + const current = blockTimestamp + const startTime = parseInt(wallet.startTime) + const endTime = parseInt(wallet.endTime) + const managedAmount = toBN(wallet.managedAmount) + + if (current < startTime) { + return toBN('0') + } + if (current > parseInt(wallet.endTime)) { + return managedAmount + } + + const sinceStartTime = current > startTime ? current - startTime : 0 + const periodDuration = (endTime - startTime) / wallet.periods + const currentPeriod = Math.floor(sinceStartTime / periodDuration + 1) + const passedPeriods = currentPeriod - 1 + const amountPerPeriod = managedAmount.div(wallet.periods) + + return amountPerPeriod.mul(passedPeriods) +} + +// Returns the amount of tokens that are free to be withdrawn +// Note that this is different than availableAmount() and releasableAmount() +function getFreeAmount(wallet: TokenLockWallet, blockTimestamp: number): BigNumber { + const current = blockTimestamp + const releaseStartTime = parseInt(wallet.releaseStartTime) + const vestingCliffTime = parseInt(wallet.vestingCliffTime) + + if (releaseStartTime > 0 && releaseStartTime > current) { + return toBN('0') + } + + if (wallet.revocable === 'Enabled' && vestingCliffTime > 0 && vestingCliffTime > current) { + return toBN('0') + } + + return getAvailableAmount(wallet, blockTimestamp) +} + +type WalletInfo = { + tokensUsed: BigNumber + tokensBalance: BigNumber + graphAccount: GraphAccount + owner: string +} + +async function getExtendedWalletInfo( + contracts: Contract[], + blockNumber: number, +): Promise<{ [key: string]: WalletInfo }> { + const walletInfoEntries: { [key: string]: WalletInfo } = {} + const queue = new PQueue({ concurrency: RPC_CONCURRENCY }) + + void contracts.map(async (contract) => { + await queue.add(async () => { + // Get subgraph data + const graphAccount = await getGraphAccount(contract.address, blockNumber) + + // Get on-chain data + const tokensUsed = await contract.usedAmount({ blockTag: blockNumber }) + const tokensBalance = await contract.currentBalance({ blockTag: blockNumber }) + const owner = await contract.owner({ blockTag: blockNumber }) + + // Populate extra data + walletInfoEntries[contract.address] = { + tokensUsed, + tokensBalance, + graphAccount, + owner, + } + }) + }) + await queue.onIdle() + + return walletInfoEntries +} + +// Summaries + +class TokenSummary { + totalManaged: BigNumber + totalReleased: BigNumber + totalAvailable: BigNumber + totalFree: BigNumber + totalUsed: BigNumber + totalCount: number + contractsReleased: ContractTokenData[] + contractsInProtocol: ContractTokenData[] + block: Block + + constructor(block: Block) { + this.totalManaged = BigNumber.from(0) + this.totalReleased = BigNumber.from(0) + this.totalAvailable = BigNumber.from(0) + this.totalFree = BigNumber.from(0) + this.totalUsed = BigNumber.from(0) + this.totalCount = 0 + this.contractsReleased = [] + this.contractsInProtocol = [] + this.block = block + } + + public async addWallet(wallet: TokenLockWallet, contract?: Contract) { + const availableAmount = getAvailableAmount(wallet, this.block.timestamp) + const freeAmount = getFreeAmount(wallet, this.block.timestamp) + const tokensReleased = toBN(wallet.tokensReleased) + + this.totalManaged = this.totalManaged.add(toBN(wallet.managedAmount)) + this.totalAvailable = this.totalAvailable.add(availableAmount) + this.totalFree = this.totalFree.add(freeAmount) + this.totalReleased = this.totalReleased.add(tokensReleased) + this.totalCount++ + + if (tokensReleased.gt(0)) { + this.contractsReleased.push({ address: wallet.id, tokenAmount: tokensReleased }) + } + + if (contract) { + const [usedAmount] = await Promise.all([contract.usedAmount({ blockTag: this.block.number })]) + if (usedAmount.gt(0)) { + this.totalUsed = this.totalUsed.add(usedAmount) + this.contractsInProtocol.push({ address: contract.address, tokenAmount: usedAmount }) + } + } + } + + private showContracts(contracts: ContractTokenData[]) { + for (const contractTokenData of contracts) { + console.log(` ${contractTokenData.address}: ${formatRoundGRT(contractTokenData.tokenAmount)}`) + } + } + + public show(detail = false) { + console.log(`= Managed: ${formatRoundGRT(this.totalManaged)} [n:${this.totalCount}]`) + console.log( + `- Available (${this.totalAvailable.mul(100).div(this.totalManaged).toString()}%):`, + formatRoundGRT(this.totalAvailable), + ) + console.log(`- Free (${this.totalFree.mul(100).div(this.totalManaged).toString()}%):`, formatRoundGRT(this.totalFree)) + console.log( + `-- Released (${this.totalFree.gt(0) ? this.totalReleased.mul(100).div(this.totalFree).toString() : 0}%): ${formatRoundGRT( + this.totalReleased, + )} [n:${this.contractsReleased.length}]`, + ) + if (detail) { + this.showContracts(this.contractsReleased) + } + if (this.totalUsed.gt(0)) { + console.log(`- Used ${formatRoundGRT(this.totalUsed)} [n:${this.contractsInProtocol.length}]`) + if (detail) { + this.showContracts(this.contractsInProtocol) + } + } + } +} + +// -- Tasks -- + +task('contracts:list', 'List all token lock contracts') + .addOptionalParam('blocknumber', 'Block number to list contracts on') + .setAction(async (taskArgs, hre: HardhatRuntimeEnvironment) => { + // fetch block + const targetBlockNumber = taskArgs.blocknumber ? parseInt(taskArgs.blocknumber) : 'latest' + const block = await hre.ethers.provider.getBlock(targetBlockNumber) + const blockNumber = block.number - BLOCK_DRIFT + console.log('Block:', block.number, '/', new Date(block.timestamp * 1000).toDateString(), '\n') + + // fetch wallets + console.log('Fetching wallets...') + const allWallets = await getWallets(blockNumber) + console.log(`${allWallets.length} wallets found`) + + // populate token amounts used in the protocol + console.log('Populating used amounts...') + const extendedWalletInfo = await getExtendedWalletInfo( + await Promise.all( + allWallets.map(async (wallet) => { + return hre.ethers.getContractAt('GraphTokenLockWallet', wallet.id) + }), + ), + blockNumber, + ) + + const headers = [ + 'beneficiary', + 'managedAmount', + 'startTime', + 'endTime', + 'periods', + 'revocable', + 'releaseStartTime', + 'vestingCliffTime', + 'contractAddress', + 'initHash', + 'txHash', + 'manager', + 'owner', + 'tokensReleased', + 'tokensWithdrawn', + 'tokensAvailable', + 'tokensRevoked', + 'tokensUsed', + 'tokensBalance', + 'blockNumberCreated', + 'tokensUsedStaked', + 'tokensUsedDelegated', + ].join(',') + console.log(headers) + + for (const wallet of allWallets) { + // get used tokens in the protocol + const extendedWallet = extendedWalletInfo[wallet.id] + const { graphAccount, tokensUsed, tokensBalance, owner } = extendedWallet + const tokensUsedStaked = BigNumber.from(graphAccount.indexer?.stakedTokens || 0) + const tokensUsedDelegated = graphAccount.delegator + ? BigNumber.from(graphAccount.delegator.totalStakedTokens).sub( + BigNumber.from(graphAccount.delegator.totalUnstakedTokens), + ) + : BigNumber.from(0) + + // print wallet entries + const csv = [ + wallet.beneficiary, + toInt(wallet.managedAmount), + wallet.startTime, + wallet.endTime, + wallet.periods, + wallet.revocable, + wallet.releaseStartTime, + wallet.vestingCliffTime, + wallet.id, + wallet.initHash, + wallet.txHash, + wallet.manager, + owner, + toInt(wallet.tokensReleased), + toInt(wallet.tokensWithdrawn), + formatGRT(getAvailableAmount(wallet, block.timestamp)), + toInt(wallet.tokensRevoked), + formatGRT(tokensUsed), + formatGRT(tokensBalance), + wallet.blockNumberCreated, + formatGRT(tokensUsedStaked), + formatGRT(tokensUsedDelegated), + ].join(',') + console.log(csv) + } + }) + +task('contracts:curators', 'Show overview of curator vesting contracts') + .addOptionalParam('blocknumber', 'Block number to list contracts on') + .setAction(async (taskArgs, hre: HardhatRuntimeEnvironment) => { + const blockNumber = taskArgs.blocknumber ? parseInt(taskArgs.blocknumber) : 'latest' + const block = await hre.ethers.provider.getBlock(blockNumber) + console.log('Block:', block.number, '/', new Date(block.timestamp * 1000).toDateString(), '\n') + + const allWallets = await getCuratorWallets(block.number) + const managedAmount = allWallets.reduce((acc, wallet) => acc.add(toBN(wallet.managedAmount)), BigNumber.from(0)) + + console.log(`Found ${allWallets.length} curator wallets.`) + console.log(`Total managed amount: ${formatRoundGRT(managedAmount)}`) + console.log(`First curator contract deployed at block ${allWallets[0].blockNumberCreated}`) + console.log(`Last curator contract deployed at block ${allWallets[allWallets.length - 1].blockNumberCreated}`) + }) + +task('contracts:summary', 'Show summary of balances') + .addOptionalParam('blocknumber', 'Block number to calculate balances on') + .setAction(async (taskArgs, hre: HardhatRuntimeEnvironment) => { + // Fetch contracts + const blockNumber = taskArgs.blocknumber ? parseInt(taskArgs.blocknumber) : 'latest' + const block = await hre.ethers.provider.getBlock(blockNumber) + console.log('Block:', block.number, '/', new Date(block.timestamp * 1000).toDateString(), '\n') + const allWallets = await getWallets(block.number) + const revocableWallets = allWallets.filter(wallet => wallet.revocable === 'Enabled') + + // Calculate summaries (for all vestings) + const summary: TokenSummary = new TokenSummary(block) + for (const wallet of allWallets) { + await summary.addWallet(wallet) + } + + // Calculate summaries (for revocable vestings) + const queue = new PQueue({ concurrency: RPC_CONCURRENCY }) + const revocableSummary: TokenSummary = new TokenSummary(block) + void revocableWallets.map(async (wallet) => { + await queue.add(async () => { + const contract = await hre.ethers.getContractAt('GraphTokenLockWallet', wallet.id) + await revocableSummary.addWallet(wallet, contract) + }) + }) + await queue.onIdle() + + // Network data + const graphNetwork = await getNetworkData(block.number) + + // Foundation and Edge & Node contracts + const vestingEAN = await hre.ethers.getContractAt( + 'GraphTokenLockSimple', + '0x5785176048BEB00DcB6eC84A604d76E30E0666db', + ) + const vestingGRT = await hre.ethers.getContractAt( + 'GraphTokenLockSimple', + '0x32Ec7A59549b9F114c9D7d8b21891d91Ae7F2ca1', + ) + + // EAN and GRT vesting contracts have releaseStartTime = 0 and vestingCliffTime = 0 + // so we can consider that availableAmount == freeAmount + const [managedAmountEAN, managedAmountGRT, availableAmountEAN, availableAmountGRT] = await Promise.all([ + await vestingEAN.managedAmount({ blockTag: block.number }), + await vestingGRT.managedAmount({ blockTag: block.number }), + await vestingEAN.availableAmount({ blockTag: block.number }), + await vestingGRT.availableAmount({ blockTag: block.number }), + ]) + + // Exchange locked + let managedAmountExchanges = vestingListExchanges + .map(vesting => toBN(vesting.managedAmount)) + .reduce((a, b) => a.add(b), toBN('0')) + let freeAmountExchanges = vestingListExchanges + .map(vesting => getFreeAmount(vesting, block.timestamp)) + .reduce((a, b) => a.add(b), toBN('0')) + managedAmountExchanges = managedAmountExchanges.add(toWei('283333334')) + freeAmountExchanges = freeAmountExchanges.add(toWei('150000000')) + + // General summary + const totalSupply = toBN(graphNetwork.totalSupply) + const totalLockedAll = summary.totalManaged.sub(summary.totalFree) + const totalLockedEAN = managedAmountEAN.sub(availableAmountEAN) + const totalLockedGRT = managedAmountGRT.sub(availableAmountGRT) + const totalLockedExchanges = managedAmountExchanges.sub(freeAmountExchanges) + const totalLocked = totalLockedAll.add(totalLockedEAN).add(totalLockedGRT).add(totalLockedExchanges) + + console.log('General Summary') + console.log('---------------') + console.log('= Total Supply:\t', formatRoundGRT(totalSupply)) + console.log('- Total Locked:\t', formatRoundGRT(totalLocked)) + console.log('-- General:\t', formatRoundGRT(totalLockedAll), '/', formatRoundGRT(summary.totalManaged)) + console.log('-- Edge & Node:\t', formatRoundGRT(totalLockedEAN), '/', formatRoundGRT(managedAmountEAN)) + console.log('-- Foundation:\t', formatRoundGRT(totalLockedGRT), '/', formatRoundGRT(managedAmountGRT)) + console.log('-- Exchanges:\t', formatRoundGRT(totalLockedExchanges), '/', formatRoundGRT(managedAmountExchanges)) + console.log('- Total Free:\t', formatRoundGRT(totalSupply.sub(totalLocked))) + console.log('') + summary.show() + + // Summary of revocable contracts + console.log('\nRevocable Summary') + console.log('-----------------') + revocableSummary.show(false) + }) + +task('contracts:show', 'Show info about an specific contract') + .addPositionalParam('address', 'Contract address to show') + .setAction(async (taskArgs, hre: HardhatRuntimeEnvironment) => { + const contractAddress = taskArgs.address + const contract = await hre.ethers.getContractAt('GraphTokenLockWallet', contractAddress) + + const [ + managedAmount, + availableAmount, + releasableAmount, + releasedAmount, + usedAmount, + currentBalance, + amountPerPeriod, + surplusAmount, + vestedAmount, + ] = await Promise.all([ + await contract.managedAmount(), + await contract.availableAmount(), + await contract.releasableAmount(), + await contract.releasedAmount(), + await contract.usedAmount(), + await contract.currentBalance(), + await contract.amountPerPeriod(), + await contract.surplusAmount(), + await contract.vestedAmount(), + ]).then(results => results.map(e => formatRoundGRT(e))) + + const [startTime, endTime, periods, currentPeriod, periodDuration, revocable, owner, manager] = await Promise.all([ + contract.startTime(), + contract.endTime(), + contract.periods(), + contract.currentPeriod(), + contract.periodDuration(), + contract.revocable(), + contract.owner(), + contract.manager(), + ]) + const nextTime = startTime.add(currentPeriod.mul(periodDuration)) + + console.log(`# Contract at ${contractAddress}`) + console.log('\n## Control') + console.log(` Owner: ${owner}`) + console.log(` Manager: ${manager}`) + console.log('\n## Schedule') + console.log(` ${prettyDate(startTime)} -> ${prettyDate(endTime)} <@${periods} periods>`) + console.log(` Next: ${prettyDate(nextTime)} >> ${amountPerPeriod}`) + console.log(` Revocable: ${revocable}`) + console.log(' (=) Managed:', managedAmount) + console.log(' - Available: ', availableAmount) + console.log(' - Unvested: ', formatRoundGRT(parseGRT(managedAmount).sub(parseGRT(vestedAmount)))) + console.log(' - Releaseable: ', releasableAmount) + console.log('\n## Position') + console.log(' (*) Managed:', managedAmount) + console.log(' (=) Balance:', currentBalance) + console.log(' (<) Released: ', releasedAmount) + console.log(' (>) Used: ', usedAmount) + console.log(' (+) Surplus: ', surplusAmount) + }) + +interface CoinPrice { + date: number + price: number +} + +async function getCoinPrice(timeIndex: number): Promise { + // Scan for a price close to the desired datetime + const buffer = 1800 + const params = { + from: timeIndex - buffer, + to: timeIndex + buffer, + } + const coin = await CoinGeckoClient.coins.fetchMarketChartRange('the-graph', params) + const priceInstance = coin.data.prices[0] + return { + date: priceInstance[0] / 1000, + price: priceInstance[1], + } +} + +task('contracts:schedule', 'Show schedule of a set of contracts').setAction( + async (_, hre: HardhatRuntimeEnvironment) => { + const contractAddresses = [ + '0xc2525d1326c0d38c9fae42a663b9ec32a6338948', + '0xc4307eb08c3fd10c1f7de94e6db34371df18f06f', + '0x4c57e626f38a95220eefa8fc2f44ef5e4bbc7b9e', + '0x56f256fdd8899fd3f08b731431c61e2df8f99625', + '0x60abb93f12ebbbfd84c8cb52df8c7b3c26aea170', + '0x1d535b18ee9b8453cfef723ecd96720c3322de8c', + '0x27c26eed0a9e09d9662eb154f52b55153d2ed705', + ] + + // Print release schedule for every contract + for (const contractAddress of contractAddresses) { + // Read contract data + const contract = await hre.ethers.getContractAt('GraphTokenLockWallet', contractAddress) + const [startTime, endTime, periods, amountPerPeriod] = await Promise.all([ + contract.startTime(), + contract.endTime(), + contract.periods(), + contract.amountPerPeriod(), + ]) + + // Scan every period + const duration = endTime.sub(startTime) + const durationPerPeriod = duration.div(periods) + for (let i = 1; i <= periods; i++) { + const timeIndex = startTime.add(durationPerPeriod.mul(i)) + const output = [contractAddress, i, prettyDate(timeIndex.toString()), formatGRT(amountPerPeriod)] + if (timeIndex < now()) { + try { + const coinPrice = await getCoinPrice(timeIndex.toNumber()) + output.push(coinPrice.price) + output.push(prettyDate(coinPrice.date.toString())) + console.log(output.join(',')) + } catch (e) { + console.log(e) + console.log('Error while fetching coin price') + console.log(output) + break + } + } else { + output.push('') + output.push('') + } + } + } + }, +) + +task('contracts:list-pending-lock', 'List all token lock contracts that have not accepted the lock') + .addOptionalParam('blocknumber', 'Block number to list contracts on') + .setAction(async (taskArgs, hre: HardhatRuntimeEnvironment) => { + const blockNumber = taskArgs.blocknumber ? parseInt(taskArgs.blocknumber) : 'latest' + const block = await hre.ethers.provider.getBlock(blockNumber) + console.log('Block:', block.number, '/', new Date(block.timestamp * 1000).toDateString(), '\n') + + // Get all wallets + const allWallets = await getWallets(block.number) + console.log(`Found ${allWallets.length} wallets total`) + + // get isAccepted from chain, not part of the subgraph + console.log(`Checking lock status...`) + const queue = new PQueue({ concurrency: RPC_CONCURRENCY }) + const pendingLocks: TokenLockWallet[] = [] + void allWallets.map(async (wallet) => { + await queue.add(async () => { + // Original contract didn't support accepting/cancelling lock, we can safely ignore those + // so we wrap isAccepted() call in try/catch and keep going if it fails + try { + const contract = await hre.ethers.getContractAt('GraphTokenLockWallet', wallet.id) + const isAccepted = await contract.isAccepted() + if (!isAccepted) { + pendingLocks.push(wallet) + } + } catch (error) { + console.log(`Could not call isAccepted() on ${wallet.id}.`) + } + }) + }) + await queue.onIdle() + + console.log(`Found ${pendingLocks.length} wallets pending lock acceptance!`) + + const headers = [ + 'beneficiary', + 'managedAmount', + 'startTime', + 'endTime', + 'periods', + 'revocable', + 'releaseStartTime', + 'vestingCliffTime', + 'contractAddress', + 'initHash', + 'txHash', + 'manager', + 'tokensReleased', + 'tokensWithdrawn', + 'tokensAvailable', + 'tokensRevoked', + 'blockNumberCreated', + ].join(',') + console.log(headers) + + for (const wallet of pendingLocks) { + const csv = [ + wallet.beneficiary, + toInt(wallet.managedAmount), + wallet.startTime, + wallet.endTime, + wallet.periods, + wallet.revocable, + wallet.releaseStartTime, + wallet.vestingCliffTime, + wallet.id, + wallet.initHash, + wallet.txHash, + wallet.manager, + toInt(wallet.tokensReleased), + toInt(wallet.tokensWithdrawn), + formatRoundGRT(getAvailableAmount(wallet, block.timestamp)), + toInt(wallet.tokensRevoked), + wallet.blockNumberCreated, + ].join(',') + console.log(csv) + } + }) diff --git a/packages/token-distribution/ops/manager.ts b/packages/token-distribution/ops/manager.ts new file mode 100644 index 000000000..ea92bc615 --- /dev/null +++ b/packages/token-distribution/ops/manager.ts @@ -0,0 +1,164 @@ +import { task } from 'hardhat/config' +import { HardhatRuntimeEnvironment } from 'hardhat/types' +import { askConfirm, getTokenLockManagerOrFail, isValidAddressOrFail, prettyEnv, waitTransaction } from './create' +import consola from 'consola' +import { formatEther, parseEther } from 'ethers/lib/utils' + +const logger = consola.create({}) + +task('manager-setup-auth', 'Setup default authorized functions in the manager') + .addParam('targetAddress', 'Target address for function calls') + .addParam('managerName', 'Name of the token lock manager deployment', 'GraphTokenLockManager') + .setAction(async (taskArgs, hre: HardhatRuntimeEnvironment) => { + // Get contracts + const manager = await getTokenLockManagerOrFail(hre, taskArgs.managerName) + + logger.info('Setting up authorized functions...') + logger.log(`> GraphTokenLockManager: ${manager.address}`) + logger.log(`> Staking: ${taskArgs.targetAddress}`) + + // Prepare + logger.log(await prettyEnv(hre)) + + // Validations + isValidAddressOrFail(taskArgs.targetAddress) + + // Setup authorized functions + const signatures = [ + 'stake(uint256)', + 'unstake(uint256)', + 'withdraw()', + 'delegate(address,uint256)', + 'undelegate(address,uint256)', + 'withdrawDelegated(address,address)', + 'setDelegationParameters(uint32,uint32,uint32)', + 'setOperator(address,bool)', + ] + + logger.info('The following signatures will be authorized:') + logger.info(signatures) + + if (await askConfirm()) { + // Setup authorized functions + logger.info('Setup authorized functions...') + const targets = Array(signatures.length).fill(taskArgs.targetAddress) + const tx1 = await manager.setAuthFunctionCallMany(signatures, targets) + await waitTransaction(tx1) + logger.success('Done!\n') + + // Setup authorized token destinations + logger.info('Setup authorized destinations...') + const tx2 = await manager.addTokenDestination(taskArgs.targetAddress) + await waitTransaction(tx2) + } + }) + +task('manager-deposit', 'Deposit fund into the manager') + .addParam('amount', 'Amount to deposit in GRT') + .addParam('managerName', 'Name of the token lock manager deployment', 'GraphTokenLockManager') + .setAction(async (taskArgs, hre: HardhatRuntimeEnvironment) => { + // Get contracts + const manager = await getTokenLockManagerOrFail(hre, taskArgs.managerName) + + // Prepare + logger.log(await prettyEnv(hre)) + + const tokenAddress = await manager.token() + + logger.info('Using:') + logger.log(`> GraphToken: ${tokenAddress}`) + logger.log(`> GraphTokenLockMasterCopy: ${await manager.masterCopy()}`) + logger.log(`> GraphTokenLockManager: ${manager.address}`) + + // Deposit funds + logger.log(`You are depositing ${taskArgs.amount} into ${manager.address}...`) + if (await askConfirm()) { + const weiAmount = parseEther(taskArgs.amount) + + logger.log('Approve...') + const grt = await hre.ethers.getContractAt('ERC20', tokenAddress) + const tx1 = await grt.approve(manager.address, weiAmount) + await waitTransaction(tx1) + + logger.log('Deposit...') + const tx2 = await manager.deposit(weiAmount) + await waitTransaction(tx2) + } + }) + +task('manager-withdraw', 'Withdraw fund from the manager') + .addParam('amount', 'Amount to deposit in GRT') + .addParam('managerName', 'Name of the token lock manager deployment', 'GraphTokenLockManager') + .setAction(async (taskArgs, hre: HardhatRuntimeEnvironment) => { + // Get contracts + const manager = await getTokenLockManagerOrFail(hre, taskArgs.managerName) + + // Prepare + logger.log(await prettyEnv(hre)) + + const tokenAddress = await manager.token() + + logger.info('Using:') + logger.log(`> GraphToken: ${tokenAddress}`) + logger.log(`> GraphTokenLockMasterCopy: ${await manager.masterCopy()}`) + logger.log(`> GraphTokenLockManager: ${manager.address}`) + + // Withdraw funds + logger.log(`You are withdrawing ${taskArgs.amount} from ${manager.address}...`) + if (await askConfirm()) { + const weiAmount = parseEther(taskArgs.amount) + + logger.log('Deposit...') + const tx = await manager.withdraw(weiAmount) + await waitTransaction(tx) + } + }) + +task('manager-balance', 'Get current manager balance') + .addParam('managerName', 'Name of the token lock manager deployment', 'GraphTokenLockManager') + .setAction(async (taskArgs, hre: HardhatRuntimeEnvironment) => { + // Get contracts + const manager = await getTokenLockManagerOrFail(hre, taskArgs.managerName) + + // Prepare + logger.log(await prettyEnv(hre)) + + const tokenAddress = await manager.token() + const managerOwnerAddress = await manager.owner() + + logger.info('Using:') + logger.log(`> GraphToken: ${tokenAddress}`) + logger.log(`> GraphTokenLockMasterCopy: ${await manager.masterCopy()}`) + logger.log(`> GraphTokenLockManager: ${manager.address} owner: ${managerOwnerAddress}`) + + const grt = await hre.ethers.getContractAt('ERC20', tokenAddress) + const balance = await grt.balanceOf(manager.address) + logger.log('Current Manager balance is ', formatEther(balance)) + }) + +task('manager-transfer-ownership', 'Transfer ownership of the manager') + .addParam('owner', 'Address of the new owner') + .addParam('managerName', 'Name of the token lock manager deployment', 'GraphTokenLockManager') + .setAction(async (taskArgs, hre: HardhatRuntimeEnvironment) => { + const manager = await getTokenLockManagerOrFail(hre, taskArgs.managerName) + + // Validate current owner + const tokenLockManagerOwner = await manager.owner() + const { deployer } = await hre.getNamedAccounts() + if (tokenLockManagerOwner !== deployer) { + logger.error('Only the owner can transfer ownership') + process.exit(1) + } + + logger.info(`Manager address: ${manager.address}}`) + logger.info(`Current owner: ${tokenLockManagerOwner}`) + logger.info(`New owner: ${taskArgs.owner}`) + + if (!(await askConfirm())) { + logger.log('Cancelled') + process.exit(1) + } + + // Transfer ownership + await manager.transferOwnership(taskArgs.owner) + }) diff --git a/packages/token-distribution/ops/queries/account.graphql b/packages/token-distribution/ops/queries/account.graphql new file mode 100644 index 000000000..d97f4b388 --- /dev/null +++ b/packages/token-distribution/ops/queries/account.graphql @@ -0,0 +1,17 @@ +query GraphAccount($accountId: ID!, $blockNumber: Int) { + graphAccount(id: $accountId, block: { number: $blockNumber }) { + id + indexer { + stakedTokens + } + curator { + totalSignalledTokens + totalUnsignalledTokens + } + delegator { + totalStakedTokens + totalUnstakedTokens + totalRealizedRewards + } + } +} diff --git a/packages/token-distribution/ops/queries/curators.graphql b/packages/token-distribution/ops/queries/curators.graphql new file mode 100644 index 000000000..586a00b2c --- /dev/null +++ b/packages/token-distribution/ops/queries/curators.graphql @@ -0,0 +1,25 @@ +query CuratorWallets($blockNumber: Int, $first: Int) { + tokenLockWallets( + block: { number: $blockNumber } + where: { periods: 16, startTime: 1608224400, endTime: 1734454800, revocable: Disabled } + first: $first + orderBy: blockNumberCreated + ) { + id + beneficiary + managedAmount + periods + startTime + endTime + revocable + releaseStartTime + vestingCliffTime + initHash + txHash + manager + tokensReleased + tokensWithdrawn + tokensRevoked + blockNumberCreated + } +} \ No newline at end of file diff --git a/packages/token-distribution/ops/queries/network.graphql b/packages/token-distribution/ops/queries/network.graphql new file mode 100644 index 000000000..f305a3278 --- /dev/null +++ b/packages/token-distribution/ops/queries/network.graphql @@ -0,0 +1,6 @@ +query GraphNetwork($blockNumber: Int) { + graphNetwork(id: 1, block: { number: $blockNumber }) { + id + totalSupply + } +} \ No newline at end of file diff --git a/packages/token-distribution/ops/queries/tokenLockWallets.graphql b/packages/token-distribution/ops/queries/tokenLockWallets.graphql new file mode 100644 index 000000000..4ab3d5ba7 --- /dev/null +++ b/packages/token-distribution/ops/queries/tokenLockWallets.graphql @@ -0,0 +1,20 @@ +query TokenLockWallets($blockNumber: Int, $first: Int) { + tokenLockWallets(block: { number: $blockNumber }, first: $first, orderBy: id) { + id + beneficiary + managedAmount + periods + startTime + endTime + revocable + releaseStartTime + vestingCliffTime + initHash + txHash + manager + tokensReleased + tokensWithdrawn + tokensRevoked + blockNumberCreated + } +} diff --git a/packages/token-distribution/ops/results.csv b/packages/token-distribution/ops/results.csv new file mode 100644 index 000000000..e69de29bb diff --git a/packages/token-distribution/ops/tx-builder-template.json b/packages/token-distribution/ops/tx-builder-template.json new file mode 100644 index 000000000..0dbac0044 --- /dev/null +++ b/packages/token-distribution/ops/tx-builder-template.json @@ -0,0 +1,15 @@ +{ + "version": "1.0", + "chainId": "5", + "createdAt": 1664999924896, + "meta": { + "name": "Vesting Contracts", + "description": "", + "txBuilderVersion": "1.11.1", + "createdFromSafeAddress": "", + "createdFromOwnerAddress": "", + "checksum": "0xaa4f6084a39579ddecb1224904d703183c5086d1e3d7e63ba94a8b6819dd2122" + }, + "transactions": [ + ] +} diff --git a/packages/token-distribution/ops/tx-builder.ts b/packages/token-distribution/ops/tx-builder.ts new file mode 100644 index 000000000..6a6f200d7 --- /dev/null +++ b/packages/token-distribution/ops/tx-builder.ts @@ -0,0 +1,45 @@ +import fs from 'fs' +import path from 'path' + +export interface BuilderTx { + to: string + data: string + value: number | string + contractMethod?: null + contractInputsValues?: null +} + +interface TxBuilderContents { + createdAt: number + chainId: string + transactions: BuilderTx[] +} + +export class TxBuilder { + contents: TxBuilderContents + outputFile: string + + constructor(chainId: string, _template?: string) { + // Template file + const template = _template ?? 'tx-builder-template.json' + const templateFilename = path.join(__dirname, template) + + // Output file + const dateTime = new Date().getTime() + this.outputFile = path.join(__dirname, `tx-builder-${dateTime}.json`) + + // Load template + this.contents = JSON.parse(fs.readFileSync(templateFilename, 'utf8')) + this.contents.createdAt = dateTime + this.contents.chainId = chainId + } + + addTx(tx: BuilderTx) { + this.contents.transactions.push({ ...tx, contractMethod: null, contractInputsValues: null }) + } + + saveToFile() { + fs.writeFileSync(this.outputFile, JSON.stringify(this.contents, null, 2)) + return this.outputFile + } +} diff --git a/packages/token-distribution/package.json b/packages/token-distribution/package.json new file mode 100644 index 000000000..a814a55e5 --- /dev/null +++ b/packages/token-distribution/package.json @@ -0,0 +1,71 @@ +{ + "name": "@graphprotocol/token-distribution", + "private": true, + "version": "1.2.1", + "description": "Graph Token Distribution", + "main": "index.js", + "scripts": { + "prepublishOnly": "scripts/prepublish", + "build": "scripts/build", + "clean": "rm -rf build/ cache/ dist/", + "compile": "hardhat compile --show-stack-traces", + "deploy": "pnpm run build && hardhat deploy", + "test": "scripts/test", + "test:gas": "RUN_EVM=true REPORT_GAS=true scripts/test", + "test:coverage": "scripts/coverage", + "lint": "pnpm run lint:ts && pnpm run lint:sol", + "lint:ts": "eslint '**/*.{js,ts}' --fix", + "lint:sol": "prettier --write contracts/**/*.sol && solhint --fix contracts/**/*.sol --config node_modules/solhint-graph-config/index.js", + "security": "scripts/security", + "flatten": "scripts/flatten", + "typechain": "hardhat typechain", + "verify": "hardhat verify", + "size": "hardhat size-contracts" + }, + "files": [ + "dist/**/*", + "README.md", + "LICENSE" + ], + "author": "The Graph Team", + "license": "MIT", + "devDependencies": { + "@ethersproject/experimental": "^5.0.7", + "@graphprotocol/client-cli": "^2.0.2", + "@graphprotocol/contracts": "workspace:^7.0.0", + "@nomiclabs/hardhat-ethers": "^2.0.0", + "@nomiclabs/hardhat-etherscan": "^3.1.7", + "@nomiclabs/hardhat-waffle": "^2.0.0", + "@openzeppelin/contracts": "^3.3.0-solc-0.7", + "@openzeppelin/contracts-upgradeable": "3.4.2", + "@openzeppelin/hardhat-upgrades": "^1.22.1", + "@typechain/ethers-v5": "^7.0.0", + "@typechain/hardhat": "^2.0.0", + "@types/mocha": "^9.1.0", + "@types/node": "^20.4.2", + "chai": "^4.2.0", + "coingecko-api": "^1.0.10", + "consola": "^2.15.0", + "dotenv": "^16.0.0", + "eslint": "^8.56.0", + "eslint-graph-config": "workspace:^", + "ethereum-waffle": "^3.1.1", + "ethers": "^5.0.18", + "graphql": "^16.5.0", + "hardhat": "^2.6.1", + "hardhat-abi-exporter": "^2.0.1", + "hardhat-contract-sizer": "^2.0.1", + "hardhat-deploy": "^0.7.0-beta.9", + "hardhat-gas-reporter": "^1.0.1", + "inquirer": "8.0.0", + "p-queue": "^6.6.2", + "prettier": "^3.2.5", + "prettier-plugin-solidity": "^1.3.1", + "solhint-community": "^3.7.0", + "solhint-graph-config": "workspace:^0.0.1", + "solhint-plugin-prettier": "^0.1.0", + "ts-node": "^10.9.1", + "typechain": "^5.0.0", + "typescript": "^5.2.2" + } +} diff --git a/packages/token-distribution/prettier.config.js b/packages/token-distribution/prettier.config.js new file mode 100644 index 000000000..5b8e866f2 --- /dev/null +++ b/packages/token-distribution/prettier.config.js @@ -0,0 +1,2 @@ +const prettierGraphConfig = require('solhint-graph-config/prettier') +module.exports = prettierGraphConfig diff --git a/packages/token-distribution/scripts/build b/packages/token-distribution/scripts/build new file mode 100755 index 000000000..404e8b5f7 --- /dev/null +++ b/packages/token-distribution/scripts/build @@ -0,0 +1,12 @@ +#!/bin/bash + +set -eo pipefail + + +if [ -z "${STUDIO_API_KEY}" ]; then + echo "Warning: STUDIO_API_KEY is not set. Skipping build steps. Some functionality may be limited." + exit 0 +fi + +pnpm graphclient build +pnpm run compile diff --git a/packages/token-distribution/scripts/coverage b/packages/token-distribution/scripts/coverage new file mode 100755 index 000000000..ebc33e4a5 --- /dev/null +++ b/packages/token-distribution/scripts/coverage @@ -0,0 +1,6 @@ +#!/bin/bash + +set -eo pipefail + +pnpm run compile +npx hardhat coverage $@ diff --git a/packages/token-distribution/scripts/flatten b/packages/token-distribution/scripts/flatten new file mode 100755 index 000000000..763384ff3 --- /dev/null +++ b/packages/token-distribution/scripts/flatten @@ -0,0 +1,24 @@ +#!/bin/bash + +OUT_DIR="build/flatten" + +mkdir -p ${OUT_DIR} + +echo "Flattening contracts..." + +FILES=( + "contracts/GraphTokenDistributor.sol" + "contracts/GraphTokenLockSimple.sol" + "contracts/GraphTokenLockWallet.sol" + "contracts/GraphTokenLockManager.sol" +) + +for path in ${FILES[@]}; do + IFS='/' + parts=( $path ) + name=${parts[${#parts[@]}-1]} + echo "Flatten > ${name}" + hardhat flatten "${path}" > "${OUT_DIR}/${name}" +done + +echo "Done!" diff --git a/packages/token-distribution/scripts/prepublish b/packages/token-distribution/scripts/prepublish new file mode 100755 index 000000000..75779693d --- /dev/null +++ b/packages/token-distribution/scripts/prepublish @@ -0,0 +1,26 @@ +#!/bin/bash + +TYPECHAIN_DIR=dist/types + +set -eo pipefail + +# Build contracts +pnpm run clean +pnpm run build + +# Refresh distribution folder +rm -rf dist && mkdir -p dist +mkdir -p ${TYPECHAIN_DIR}/_src +cp -R build/abis/ dist/abis +cp -R build/typechain/contracts/ ${TYPECHAIN_DIR}/_src +cp -R deployments/ dist/deployments +cp -R .openzeppelin/ dist/.openzeppelin + +### Build Typechain bindings + +# Build and create TS declarations +tsc -d ${TYPECHAIN_DIR}/_src/*.ts --outdir ${TYPECHAIN_DIR}/contracts --esModuleInterop +# Copy back sources +cp ${TYPECHAIN_DIR}/_src/*.ts ${TYPECHAIN_DIR}/contracts +# Delete temporary src dir +rm -rf ${TYPECHAIN_DIR}/_src diff --git a/packages/token-distribution/scripts/security b/packages/token-distribution/scripts/security new file mode 100755 index 000000000..9d91f39f2 --- /dev/null +++ b/packages/token-distribution/scripts/security @@ -0,0 +1,17 @@ +#!/bin/bash + +## Before running: +# This tool requires to have solc installed. +# Ensure that you have the binaries installed by pip3 in your path. +# Install: https://github.com/crytic/slither#how-to-install +# Usage: https://github.com/crytic/slither/wiki/Usage + +mkdir -p reports + +pip3 install --user slither-analyzer && \ +pnpm run build && \ + +echo "Analyzing contracts..." +slither . &> reports/analyzer-report.log && \ + +echo "Done!" diff --git a/packages/token-distribution/scripts/test b/packages/token-distribution/scripts/test new file mode 100755 index 000000000..865f4a371 --- /dev/null +++ b/packages/token-distribution/scripts/test @@ -0,0 +1,62 @@ +#!/bin/bash + +set -eo pipefail + +MNEMONIC="myth like bonus scare over problem client lizard pioneer submit female collect" +TESTRPC_PORT=8545 + +### Functions + +evm_running() { + nc -z localhost "$TESTRPC_PORT" +} + +evm_start() { + echo "Starting our own evm instance at port $TESTRPC_PORT" + npx ganache-cli -m "$MNEMONIC" -i 1337 --gasLimit 8000000 --port "$TESTRPC_PORT" > /dev/null & + evm_pid=$! +} + +evm_kill() { + if evm_running; then + echo "Killing evm instance at port $TESTRPC_PORT" + kill -9 $(lsof -i:$TESTRPC_PORT -t) + fi +} + +### Setup evm + +# Gas reporter needs to run in its own evm instance +if [ "$RUN_EVM" = true ]; then + evm_kill + evm_start + sleep 5 +fi + +### Main + +mkdir -p reports + +pnpm run compile + +if [ "$RUN_EVM" = true ]; then + # Run using the standalone evm instance + npx hardhat test --network ganache + result=$? +else + # Run using the default evm + npx hardhat test "$@" + result=$? +fi + +### Cleanup + +# Exit error mode so the evm instance always gets killed +set +e +result=0 + +if [ "$RUN_EVM" = true ]; then + evm_kill +fi + +exit $result diff --git a/packages/token-distribution/test/config.ts b/packages/token-distribution/test/config.ts new file mode 100644 index 000000000..fe23b1517 --- /dev/null +++ b/packages/token-distribution/test/config.ts @@ -0,0 +1,101 @@ +import { BigNumber, Contract } from 'ethers' + +import { Account } from './network' + +export enum Revocability { + NotSet, + Enabled, + Disabled, +} + +export interface TokenLockSchedule { + startTime: number + endTime: number + periods: number + revocable: Revocability + releaseStartTime: number + vestingCliffTime: number +} +export interface TokenLockParameters { + owner: string + beneficiary: string + token: string + managedAmount: BigNumber + startTime: number + endTime: number + periods: number + revocable: Revocability + releaseStartTime: number + vestingCliffTime: number +} + +export interface DateRange { + startTime: number + endTime: number +} + +const dateRange = (months: number): DateRange => { + const date = new Date(+new Date() - 120) // set start time for a few seconds before + const newDate = new Date().setMonth(date.getMonth() + months) + return { startTime: Math.round(+date / 1000), endTime: Math.round(+newDate / 1000) } +} + +const moveTime = (time: number, months: number) => { + const date = new Date(time * 1000) + return Math.round(+date.setMonth(date.getMonth() + months) / 1000) +} + +const moveDateRange = (dateRange: DateRange, months: number) => { + return { + startTime: moveTime(dateRange.startTime, months), + endTime: moveTime(dateRange.endTime, months), + } +} + +const createSchedule = ( + startMonths: number, + durationMonths: number, + periods: number, + revocable: Revocability, + releaseStartMonths = 0, + vestingCliffMonths = 0, +) => { + const range = dateRange(durationMonths) + return { + ...moveDateRange(range, startMonths), + periods, + revocable, + releaseStartTime: releaseStartMonths > 0 ? moveTime(range.startTime, releaseStartMonths) : 0, + vestingCliffTime: vestingCliffMonths > 0 ? moveTime(range.startTime, vestingCliffMonths) : 0, + } +} + +export const createScheduleScenarios = (): Array => { + return [ + createSchedule(0, 6, 1, Revocability.Disabled), // 6m lock-up + full release + fully vested + createSchedule(0, 12, 1, Revocability.Disabled), // 12m lock-up + full release + fully vested + createSchedule(12, 12, 12, Revocability.Disabled), // 12m lock-up + 1/12 releases + fully vested + createSchedule(0, 12, 12, Revocability.Disabled), // no-lockup + 1/12 releases + fully vested + createSchedule(-12, 48, 48, Revocability.Enabled, 0), // 1/48 releases + vested + past start + start time override + createSchedule(-12, 48, 48, Revocability.Enabled, 0, 12), // 1/48 releases + vested + past start + start time override + cliff + ] +} + +export const defaultInitArgs = ( + deployer: Account, + beneficiary: Account, + token: Contract, + managedAmount: BigNumber, +): TokenLockParameters => { + const constantData = { + owner: deployer.address, + beneficiary: beneficiary.address, + token: token.address, + managedAmount, + } + + return { + ...createSchedule(0, 6, 1, Revocability.Disabled), + ...constantData, + } +} diff --git a/packages/token-distribution/test/distributor.test.ts b/packages/token-distribution/test/distributor.test.ts new file mode 100644 index 000000000..c9e0b6ac5 --- /dev/null +++ b/packages/token-distribution/test/distributor.test.ts @@ -0,0 +1,201 @@ +import 'hardhat-deploy' +import { deployments } from 'hardhat' +import { expect } from 'chai' +import { GraphTokenDistributor } from '../build/typechain/contracts/GraphTokenDistributor' +import { GraphTokenMock } from '../build/typechain/contracts/GraphTokenMock' + +import { Account, getAccounts, getContract, toGRT } from './network' +import { DeployOptions } from 'hardhat-deploy/types' + +// Fixture +const setupTest = deployments.createFixture(async ({ deployments }) => { + const deploy = (name: string, options: DeployOptions) => deployments.deploy(name, options) + const [deployer] = await getAccounts() + + // Start from a fresh snapshot + await deployments.fixture([]) + + // Deploy token + await deploy('GraphTokenMock', { + from: deployer.address, + args: [toGRT('400000000'), deployer.address], + }) + const grt = await getContract('GraphTokenMock') + + // Deploy distributor + await deploy('GraphTokenDistributor', { + from: deployer.address, + args: [grt.address], + }) + const distributor = await getContract('GraphTokenDistributor') + + return { + grt: grt as GraphTokenMock, + distributor: distributor as GraphTokenDistributor, + } +}) + +describe('GraphTokenDistributor', () => { + let deployer: Account + let beneficiary1: Account + let beneficiary2: Account + + let grt: GraphTokenMock + let distributor: GraphTokenDistributor + + before(async function () { + [deployer, beneficiary1, beneficiary2] = await getAccounts() + }) + + beforeEach(async () => { + ({ grt, distributor } = await setupTest()) + }) + + describe('init', function () { + it('should deploy locked', async function () { + const isLocked = await distributor.locked() + expect(isLocked).eq(true) + }) + }) + + describe('setup beneficiary', function () { + const amount = toGRT('100') + + describe('add', function () { + it('should add tokens to beneficiary', async function () { + const tx = distributor.connect(deployer.signer).addBeneficiaryTokens(beneficiary1.address, amount) + await expect(tx).emit(distributor, 'BeneficiaryUpdated').withArgs(beneficiary1.address, amount) + }) + + it('reject add tokens to beneficiary if not allowed', async function () { + const tx = distributor.connect(beneficiary1.signer).addBeneficiaryTokens(beneficiary1.address, amount) + await expect(tx).revertedWith('Ownable: caller is not the owner') + }) + + it('should add tokens to multiple beneficiaries', async function () { + const accounts = [beneficiary1.address, beneficiary2.address] + const amounts = [amount, amount] + + await distributor.connect(deployer.signer).addBeneficiaryTokensMulti(accounts, amounts) + }) + + it('reject add token to multiple beneficiaries if not allowed', async function () { + const accounts = [beneficiary1.address, beneficiary2.address] + const amounts = [amount, amount] + + const tx = distributor.connect(beneficiary1.signer).addBeneficiaryTokensMulti(accounts, amounts) + await expect(tx).revertedWith('Ownable: caller is not the owner') + }) + }) + + describe('sub', function () { + it('should remove tokens from beneficiary', async function () { + await distributor.addBeneficiaryTokens(beneficiary1.address, amount) + + const tx = distributor.subBeneficiaryTokens(beneficiary1.address, amount) + await expect(tx).emit(distributor, 'BeneficiaryUpdated').withArgs(beneficiary1.address, toGRT('0')) + }) + + it('reject remove more tokens than available ', async function () { + const tx = distributor.subBeneficiaryTokens(beneficiary1.address, toGRT('1000')) + await expect(tx).revertedWith('SafeMath: subtraction overflow') + }) + }) + }) + + describe('unlocking', function () { + it('should lock', async function () { + const tx = distributor.connect(deployer.signer).setLocked(true) + await expect(tx).emit(distributor, 'LockUpdated').withArgs(true) + expect(await distributor.locked()).eq(true) + }) + + it('should unlock', async function () { + const tx = distributor.connect(deployer.signer).setLocked(false) + await expect(tx).emit(distributor, 'LockUpdated').withArgs(false) + expect(await distributor.locked()).eq(false) + }) + + it('reject unlock if not allowed', async function () { + const tx = distributor.connect(beneficiary1.signer).setLocked(false) + await expect(tx).revertedWith('Ownable: caller is not the owner') + }) + }) + + describe('claim', function () { + const totalAmount = toGRT('1000000') + const amount = toGRT('10000') + + beforeEach(async function () { + // Setup + await grt.transfer(distributor.address, totalAmount) + await distributor.connect(deployer.signer).addBeneficiaryTokens(beneficiary1.address, amount) + }) + + it('should claim outstanding token amount', async function () { + await distributor.connect(deployer.signer).setLocked(false) + + const tx = distributor.connect(beneficiary1.signer).claim() + await expect(tx).emit(distributor, 'TokensClaimed').withArgs(beneficiary1.address, beneficiary1.address, amount) + }) + + it('reject claim if locked', async function () { + const tx = distributor.connect(beneficiary1.signer).claim() + await expect(tx).revertedWith('Distributor: Claim is locked') + }) + + it('reject claim if no available tokens', async function () { + await distributor.connect(deployer.signer).setLocked(false) + + const tx = distributor.connect(beneficiary2.signer).claim() + await expect(tx).revertedWith('Distributor: Unavailable funds') + }) + + it('reject claim if beneficiary already claimed all tokens', async function () { + await distributor.connect(deployer.signer).setLocked(false) + + await distributor.connect(beneficiary1.signer).claim() + const tx = distributor.connect(beneficiary1.signer).claim() + await expect(tx).revertedWith('Distributor: Unavailable funds') + }) + }) + + describe('deposit & withdraw', function () { + it('should deposit funds into the distributor', async function () { + const beforeBalance = await grt.balanceOf(distributor.address) + + const amount = toGRT('1000') + await grt.approve(distributor.address, amount) + const tx = distributor.connect(distributor.signer).deposit(amount) + await expect(tx).emit(distributor, 'TokensDeposited').withArgs(deployer.address, amount) + + const afterBalance = await grt.balanceOf(distributor.address) + expect(afterBalance).eq(beforeBalance.add(amount)) + }) + + it('should withdraw tokens from the contract if owner', async function () { + // Setup + const amount = toGRT('1000') + await grt.approve(distributor.address, amount) + await distributor.connect(distributor.signer).deposit(amount) + + const tx = distributor.connect(deployer.signer).withdraw(amount) + await expect(tx).emit(distributor, 'TokensWithdrawn').withArgs(deployer.address, amount) + + const afterBalance = await grt.balanceOf(distributor.address) + expect(afterBalance).eq(0) + }) + + it('reject withdraw tokens from the contract if no balance', async function () { + const amount = toGRT('1000') + const tx = distributor.connect(deployer.signer).withdraw(amount) + await expect(tx).revertedWith('ERC20: transfer amount exceeds balance') + }) + + it('reject withdraw tokens from the contract if not allowed', async function () { + const amount = toGRT('1000') + const tx = distributor.connect(beneficiary1.signer).withdraw(amount) + await expect(tx).revertedWith('Ownable: caller is not the owner') + }) + }) +}) diff --git a/packages/token-distribution/test/l1TokenLockTransferTool.test.ts b/packages/token-distribution/test/l1TokenLockTransferTool.test.ts new file mode 100644 index 000000000..75bd26ab8 --- /dev/null +++ b/packages/token-distribution/test/l1TokenLockTransferTool.test.ts @@ -0,0 +1,675 @@ +import { BigNumber, constants, Signer } from 'ethers' +import { deployments, ethers, upgrades } from 'hardhat' +import { expect } from 'chai' + +import '@nomiclabs/hardhat-ethers' +import 'hardhat-deploy' + +import { GraphTokenLockManager } from '../build/typechain/contracts/GraphTokenLockManager' +import { GraphTokenLockWallet } from '../build/typechain/contracts/GraphTokenLockWallet' +import { GraphTokenMock } from '../build/typechain/contracts/GraphTokenMock' +import { L1GraphTokenLockTransferTool } from '../build/typechain/contracts/L1GraphTokenLockTransferTool' +import { L1TokenGatewayMock } from '../build/typechain/contracts/L1TokenGatewayMock' +import { StakingMock } from '../build/typechain/contracts/StakingMock' + +import { L1GraphTokenLockTransferTool__factory } from '../build/typechain/contracts/factories/L1GraphTokenLockTransferTool__factory' +import { Staking__factory } from '@graphprotocol/contracts/dist/types/factories/Staking__factory' + +import { Account, getAccounts, getContract, toBN, toGRT } from './network' +import { defaultAbiCoder, hexValue, keccak256, parseEther } from 'ethers/lib/utils' +import { defaultInitArgs, Revocability, TokenLockParameters } from './config' +import { advanceTimeAndBlock } from './network' +import { DeployOptions } from 'hardhat-deploy/types' + +const { AddressZero } = constants + +async function impersonateAccount(address: string): Promise { + await ethers.provider.send('hardhat_impersonateAccount', [address]) + return ethers.getSigner(address) +} + +// Fixture +const setupTest = deployments.createFixture(async ({ deployments }) => { + const deploy = (name: string, options: DeployOptions) => deployments.deploy(name, options) + const [deployer, , , , l2LockImplementationMock] = await getAccounts() + + // Start from a fresh snapshot + await deployments.fixture([]) + + // Deploy token + await deploy('GraphTokenMock', { + from: deployer.address, + args: [toGRT('1000000000'), deployer.address], + }) + const grt = await getContract('GraphTokenMock') + + // Deploy token lock masterCopy + await deploy('GraphTokenLockWallet', { + from: deployer.address, + }) + const tokenLockWallet = await getContract('GraphTokenLockWallet') + + // Deploy token lock manager + await deploy('GraphTokenLockManager', { + from: deployer.address, + args: [grt.address, tokenLockWallet.address], + }) + const tokenLockManager = await getContract('GraphTokenLockManager') + + // Protocol contracts + await deploy('StakingMock', { from: deployer.address, args: [grt.address] }) + const staking = await getContract('StakingMock') + + await deploy('L1TokenGatewayMock', { from: deployer.address, args: [] }) + const gateway = await getContract('L1TokenGatewayMock') + + // Deploy transfer tool using a proxy + const transferToolFactory = await ethers.getContractFactory('L1GraphTokenLockTransferTool') + const transferTool = (await upgrades.deployProxy(transferToolFactory, [deployer.address], { + kind: 'transparent', + unsafeAllow: ['state-variable-immutable', 'constructor'], + constructorArgs: [grt.address, l2LockImplementationMock.address, gateway.address, staking.address], + })) as L1GraphTokenLockTransferTool + + // Fund the manager contract + await grt.connect(deployer.signer).transfer(tokenLockManager.address, toGRT('100000000')) + + return { + grt: grt as GraphTokenMock, + staking: staking as StakingMock, + // tokenLock: tokenLockWallet as GraphTokenLockWallet, + tokenLockManager: tokenLockManager as GraphTokenLockManager, + gateway: gateway as L1TokenGatewayMock, + transferTool: transferTool, + } +}) + +async function authProtocolFunctions( + tokenLockManager: GraphTokenLockManager, + stakingAddress: string, + transferToolAddress: string, +) { + await tokenLockManager.setAuthFunctionCall('stake(uint256)', stakingAddress) + await tokenLockManager.setAuthFunctionCall('unstake(uint256)', stakingAddress) + await tokenLockManager.setAuthFunctionCall('withdraw()', stakingAddress) + await tokenLockManager.setAuthFunctionCall( + 'depositToL2Locked(uint256,address,uint256,uint256,uint256)', + transferToolAddress, + ) + await tokenLockManager.setAuthFunctionCall('withdrawETH(address,uint256)', transferToolAddress) + await tokenLockManager.setAuthFunctionCall('setL2WalletAddressManually(address)', transferToolAddress) +} + +// -- Tests -- + +const maxSubmissionCost = toBN('10000') +const maxGas = toBN('1000000') +const gasPrice = toBN('10') +const ticketValue = maxSubmissionCost.add(maxGas.mul(gasPrice)) + +describe('L1GraphTokenLockTransferTool', () => { + let deployer: Account + let beneficiary: Account + let hacker: Account + let l2ManagerMock: Account + let l2LockImplementationMock: Account + let l2Owner: Account + let l2Beneficiary: Account + + let grt: GraphTokenMock + let tokenLock: GraphTokenLockWallet + let tokenLockManager: GraphTokenLockManager + let staking: StakingMock + let gateway: L1TokenGatewayMock + let transferTool: L1GraphTokenLockTransferTool + let lockAsTransferTool: L1GraphTokenLockTransferTool + + let initArgs: TokenLockParameters + + const initWithArgs = async (args: TokenLockParameters): Promise => { + const tx = await tokenLockManager.createTokenLockWallet( + args.owner, + args.beneficiary, + args.managedAmount, + args.startTime, + args.endTime, + args.periods, + args.releaseStartTime, + args.vestingCliffTime, + args.revocable, + ) + const receipt = await tx.wait() + const contractAddress = receipt.events[0].args['proxy'] + return ethers.getContractAt('GraphTokenLockWallet', contractAddress) as Promise + } + + before(async function () { + [deployer, beneficiary, hacker, l2ManagerMock, l2LockImplementationMock, l2Owner, l2Beneficiary] + = await getAccounts() + }) + + beforeEach(async () => { + ({ grt, tokenLockManager, staking, gateway, transferTool } = await setupTest()) + + // Setup authorized functions in Manager + await authProtocolFunctions(tokenLockManager, staking.address, transferTool.address) + + initArgs = defaultInitArgs(deployer, beneficiary, grt, toGRT('35000000')) + tokenLock = await initWithArgs(initArgs) + + // Use the tokenLock contract as if it were the L1GraphTokenLockTransferTool contract + lockAsTransferTool = L1GraphTokenLockTransferTool__factory.connect(tokenLock.address, deployer.signer) + + // Add the transfer tool and staking contracts as token destinations + await tokenLockManager.addTokenDestination(transferTool.address) + await tokenLockManager.addTokenDestination(staking.address) + + // Approve contracts to pull tokens from the token lock + await tokenLock.connect(beneficiary.signer).approveProtocol() + await transferTool.setL2LockManager(tokenLockManager.address, l2ManagerMock.address) + await transferTool.setL2WalletOwner(deployer.address, l2Owner.address) + }) + + describe('Upgrades', function () { + it('should be upgradeable', async function () { + const transferToolFactory = await ethers.getContractFactory('L1GraphTokenLockTransferTool') + transferTool = (await upgrades.upgradeProxy(transferTool.address, transferToolFactory, { + kind: 'transparent', + unsafeAllow: ['state-variable-immutable', 'constructor'], + constructorArgs: [beneficiary.address, l2LockImplementationMock.address, gateway.address, staking.address], + })) as L1GraphTokenLockTransferTool + expect(await transferTool.graphToken()).to.eq(beneficiary.address) + transferTool = (await upgrades.upgradeProxy(transferTool.address, transferToolFactory, { + kind: 'transparent', + unsafeAllow: ['state-variable-immutable', 'constructor'], + constructorArgs: [grt.address, l2LockImplementationMock.address, gateway.address, staking.address], + })) as L1GraphTokenLockTransferTool + expect(await transferTool.graphToken()).to.eq(grt.address) + }) + }) + describe('Registering L2 managers', function () { + it('rejects calls from non-owners', async function () { + const tx = transferTool.connect(beneficiary.signer).setL2LockManager(beneficiary.address, hacker.address) + await expect(tx).revertedWith('Ownable: caller is not the owner') + }) + it('sets the L2 manager for an L1 manager', async function () { + await transferTool.setL2LockManager(tokenLockManager.address, l2ManagerMock.address) + expect(await transferTool.l2LockManager(tokenLockManager.address)).to.eq(l2ManagerMock.address) + }) + }) + describe('Registering L2 wallet owners', function () { + it('rejects calls from non-owners', async function () { + const tx = transferTool.connect(beneficiary.signer).setL2WalletOwner(beneficiary.address, hacker.address) + await expect(tx).revertedWith('Ownable: caller is not the owner') + }) + it('sets the L2 wallet owner for an L1 wallet owner', async function () { + await transferTool.setL2WalletOwner(hacker.address, l2Owner.address) + expect(await transferTool.l2WalletOwner(hacker.address)).to.eq(l2Owner.address) + }) + }) + describe('Depositing, withdrawing and pulling ETH', function () { + it('allows someone to deposit eth into their token lock account', async function () { + const tx = transferTool.connect(beneficiary.signer).depositETH(tokenLock.address, { value: ticketValue }) + await expect(tx).emit(transferTool, 'ETHDeposited').withArgs(tokenLock.address, ticketValue) + expect(await ethers.provider.getBalance(transferTool.address)).to.eq(ticketValue) + expect(await transferTool.tokenLockETHBalances(tokenLock.address)).to.eq(ticketValue) + }) + it('adds to the token lock ETH balance when called a second time', async function () { + await transferTool.connect(beneficiary.signer).depositETH(tokenLock.address, { value: ticketValue }) + expect(await transferTool.tokenLockETHBalances(tokenLock.address)).to.eq(ticketValue) + await transferTool.connect(beneficiary.signer).depositETH(tokenLock.address, { value: ticketValue }) + expect(await transferTool.tokenLockETHBalances(tokenLock.address)).to.eq(ticketValue.mul(2)) + }) + it('allows someone to withdraw eth from their token lock account', async function () { + // We'll withdraw to the "hacker" account so that we don't need to subtract gas + await transferTool.connect(beneficiary.signer).depositETH(tokenLock.address, { value: ticketValue }) + const prevBalance = await ethers.provider.getBalance(hacker.address) + const tx = lockAsTransferTool.connect(beneficiary.signer).withdrawETH(hacker.address, ticketValue) + await expect(tx).emit(transferTool, 'ETHWithdrawn').withArgs(tokenLock.address, hacker.address, ticketValue) + expect(await ethers.provider.getBalance(transferTool.address)).to.eq(0) + expect(await transferTool.tokenLockETHBalances(tokenLock.address)).to.eq(0) + expect(await ethers.provider.getBalance(hacker.address)).to.eq(prevBalance.add(ticketValue)) + }) + it('fails when trying to withdraw 0 eth from a token lock account', async function () { + // We'll withdraw to the "hacker" account so that we don't need to subtract gas + const tx = lockAsTransferTool.connect(beneficiary.signer).withdrawETH(hacker.address, BigNumber.from(0)) + await expect(tx).revertedWith('INVALID_AMOUNT') + }) + it('allows the Staking contract to pull ETH from the token lock account', async function () { + await transferTool.connect(beneficiary.signer).depositETH(tokenLock.address, { value: ticketValue }) + const prevBalance = parseEther('1') + await ethers.provider.send('hardhat_setBalance', [staking.address, hexValue(prevBalance)]) + const stakingSigner = await impersonateAccount(staking.address) + const tx = transferTool.connect(stakingSigner).pullETH(tokenLock.address, ticketValue) + const receipt = await (await tx).wait() + await expect(tx).emit(transferTool, 'ETHPulled').withArgs(tokenLock.address, ticketValue) + expect(await ethers.provider.getBalance(transferTool.address)).to.eq(0) + expect(await transferTool.tokenLockETHBalances(tokenLock.address)).to.eq(0) + expect(await ethers.provider.getBalance(staking.address)).to.eq( + prevBalance.add(ticketValue).sub(receipt.gasUsed.mul(receipt.effectiveGasPrice)), + ) + }) + it('does not allow someone else to pull ETH from the token lock account', async function () { + await transferTool.connect(beneficiary.signer).depositETH(tokenLock.address, { value: ticketValue }) + const tx = transferTool.connect(hacker.signer).pullETH(tokenLock.address, ticketValue) + await expect(tx).revertedWith('ONLY_STAKING') + }) + }) + describe('Depositing to L2', function () { + it('rejects calls if the manager is not registered', async function () { + await transferTool.setL2LockManager(tokenLockManager.address, AddressZero) + const tx = lockAsTransferTool + .connect(beneficiary.signer) + .depositToL2Locked(toGRT('10000000'), l2Beneficiary.address, maxGas, gasPrice, maxSubmissionCost) + await expect(tx).revertedWith('INVALID_MANAGER') + }) + it('rejects calls if the L2 owner for the wallet is not set', async function () { + const amountToSend = toGRT('1000') + // "hacker" will be the owner here, and it does not have an L2 owner set + initArgs = defaultInitArgs(hacker, beneficiary, grt, toGRT('2000000')) + tokenLock = await initWithArgs(initArgs) + lockAsTransferTool = L1GraphTokenLockTransferTool__factory.connect(tokenLock.address, deployer.signer) + await tokenLock.connect(beneficiary.signer).acceptLock() + + // Good hacker pays for the gas + await transferTool.connect(hacker.signer).depositETH(tokenLock.address, { value: ticketValue }) + const tx = lockAsTransferTool + .connect(beneficiary.signer) + .depositToL2Locked(amountToSend, l2Beneficiary.address, maxGas, gasPrice, maxSubmissionCost) + await expect(tx).revertedWith('L2_OWNER_NOT_SET') + }) + + it('rejects calls from wallets that have the wrong token address', async function () { + // WalletMock constructor args are: target, token, manager, isInitialized, isAccepted + await deployments.deploy('WalletMock', { + from: deployer.address, + args: [ + transferTool.address, + '0x5c946740441C12510a167B447B7dE565C20b9E3C', + tokenLockManager.address, + true, + true, + ], + }) + const wrongTokenWallet = await getContract('WalletMock') + const walletAsTransferTool = L1GraphTokenLockTransferTool__factory.connect( + wrongTokenWallet.address, + deployer.signer, + ) + + const tx = walletAsTransferTool + .connect(beneficiary.signer) + .depositToL2Locked(toGRT('10000000'), l2Beneficiary.address, maxGas, gasPrice, maxSubmissionCost) + await expect(tx).revertedWith('INVALID_TOKEN') + }) + + it('rejects calls from a wallet that is not initialized', async function () { + // WalletMock constructor args are: target, token, manager, isInitialized, isAccepted + await deployments.deploy('WalletMock', { + from: deployer.address, + args: [transferTool.address, grt.address, tokenLockManager.address, false, true], + }) + const uninitWallet = await getContract('WalletMock') + const walletAsTransferTool = L1GraphTokenLockTransferTool__factory.connect(uninitWallet.address, deployer.signer) + + const tx = walletAsTransferTool + .connect(beneficiary.signer) + .depositToL2Locked(toGRT('10000000'), l2Beneficiary.address, maxGas, gasPrice, maxSubmissionCost) + await expect(tx).revertedWith('!INITIALIZED') + }) + it('rejects calls from a revocable wallet', async function () { + initArgs.revocable = Revocability.Enabled + tokenLock = await initWithArgs(initArgs) + + await tokenLock.connect(beneficiary.signer).acceptLock() + lockAsTransferTool = L1GraphTokenLockTransferTool__factory.connect(tokenLock.address, deployer.signer) + await tokenLock.connect(beneficiary.signer).approveProtocol() + const tx = lockAsTransferTool + .connect(beneficiary.signer) + .depositToL2Locked(toGRT('10000000'), l2Beneficiary.address, maxGas, gasPrice, maxSubmissionCost) + await expect(tx).revertedWith('REVOCABLE') + }) + it('rejects calls if the wallet does not have enough tokens', async function () { + await tokenLock.connect(beneficiary.signer).acceptLock() + + const tx = lockAsTransferTool + .connect(beneficiary.signer) + .depositToL2Locked(toGRT('35000001'), l2Beneficiary.address, maxGas, gasPrice, maxSubmissionCost) + await expect(tx).revertedWith('INSUFFICIENT_BALANCE') + }) + it('rejects calls if the amount is zero', async function () { + await tokenLock.connect(beneficiary.signer).acceptLock() + + const tx = lockAsTransferTool + .connect(beneficiary.signer) + .depositToL2Locked(toGRT('0'), l2Beneficiary.address, maxGas, gasPrice, maxSubmissionCost) + await expect(tx).revertedWith('ZERO_AMOUNT') + }) + it('rejects calls if the wallet does not have a sufficient ETH balance previously deposited', async function () { + await tokenLock.connect(beneficiary.signer).acceptLock() + + const tx = lockAsTransferTool + .connect(beneficiary.signer) + .depositToL2Locked(toGRT('35000000'), l2Beneficiary.address, maxGas, gasPrice, maxSubmissionCost) + await expect(tx).revertedWith('INSUFFICIENT_ETH_BALANCE') + + // Try again but with an ETH balance that is insufficient by 1 wei + await transferTool.connect(hacker.signer).depositETH(tokenLock.address, { value: ticketValue.sub(1) }) + const tx2 = lockAsTransferTool + .connect(beneficiary.signer) + .depositToL2Locked(toGRT('35000000'), l2Beneficiary.address, maxGas, gasPrice, maxSubmissionCost) + await expect(tx2).revertedWith('INSUFFICIENT_ETH_BALANCE') + }) + it('rejects calls if the L2 beneficiary is zero', async function () { + await tokenLock.connect(beneficiary.signer).acceptLock() + + const tx = lockAsTransferTool + .connect(beneficiary.signer) + .depositToL2Locked(toGRT('10000000'), AddressZero, maxGas, gasPrice, maxSubmissionCost) + await expect(tx).revertedWith('INVALID_BENEFICIARY_ZERO') + }) + it('rejects calls if the L2 beneficiary is a contract', async function () { + await tokenLock.connect(beneficiary.signer).acceptLock() + + const tx = lockAsTransferTool + .connect(beneficiary.signer) + .depositToL2Locked(toGRT('10000000'), staking.address, maxGas, gasPrice, maxSubmissionCost) + await expect(tx).revertedWith('INVALID_BENEFICIARY_CONTRACT') + }) + it('sends tokens and a callhook to the L2 manager registered for the wallet', async function () { + await tokenLock.connect(beneficiary.signer).acceptLock() + const amountToSend = toGRT('1000') + + const expectedWalletData = defaultAbiCoder.encode( + ['tuple(address,address,address,uint256,uint256,uint256)'], + [ + [ + tokenLock.address, + l2Owner.address, + l2Beneficiary.address, + initArgs.managedAmount, + initArgs.startTime, + initArgs.endTime, + ], + ], + ) + const expectedL2Address = await transferTool['getDeploymentAddress(bytes32,address,address)']( + keccak256(expectedWalletData), + l2LockImplementationMock.address, + l2ManagerMock.address, + ) + + const expectedOutboundCalldata = await gateway.getOutboundCalldata( + grt.address, + transferTool.address, + l2ManagerMock.address, + amountToSend, + expectedWalletData, + ) + + // Good hacker pays for the gas + await transferTool.connect(hacker.signer).depositETH(tokenLock.address, { value: ticketValue }) + const tx = lockAsTransferTool + .connect(beneficiary.signer) + .depositToL2Locked(amountToSend, l2Beneficiary.address, maxGas, gasPrice, maxSubmissionCost) + await expect(tx) + .emit(transferTool, 'LockedFundsSentToL2') + .withArgs( + lockAsTransferTool.address, + expectedL2Address, + tokenLockManager.address, + l2ManagerMock.address, + amountToSend, + ) + // Check that the right amount of ETH has been pulled from the token lock's account + await expect(tx) + .emit(transferTool, 'ETHPulled') + .withArgs(tokenLock.address, maxGas.mul(gasPrice).add(maxSubmissionCost)) + await expect(tx).emit(transferTool, 'L2BeneficiarySet').withArgs(tokenLock.address, l2Beneficiary.address) + // Check the events emitted from the mock gateway + await expect(tx) + .emit(gateway, 'FakeTxToL2') + .withArgs(transferTool.address, ticketValue, maxGas, gasPrice, maxSubmissionCost, expectedOutboundCalldata) + // and check that the right amount of funds have been pulled from the token lock + expect(await grt.balanceOf(tokenLock.address)).to.equal(initArgs.managedAmount.sub(amountToSend)) + }) + it('uses the previous L2 wallet address if called for a second time', async function () { + await tokenLock.connect(beneficiary.signer).acceptLock() + const amountToSend = toGRT('1000') + + const expectedWalletData = defaultAbiCoder.encode( + ['tuple(address,address,address,uint256,uint256,uint256)'], + [ + [ + tokenLock.address, + l2Owner.address, + l2Beneficiary.address, + initArgs.managedAmount, + initArgs.startTime, + initArgs.endTime, + ], + ], + ) + const expectedL2Address = await transferTool['getDeploymentAddress(bytes32,address,address)']( + keccak256(expectedWalletData), + l2LockImplementationMock.address, + l2ManagerMock.address, + ) + + const expectedOutboundCalldata = await gateway.getOutboundCalldata( + grt.address, + transferTool.address, + l2ManagerMock.address, + amountToSend, + expectedWalletData, + ) + + // Good hacker pays for the gas + await transferTool.connect(hacker.signer).depositETH(tokenLock.address, { value: ticketValue.mul(2) }) + await lockAsTransferTool + .connect(beneficiary.signer) + .depositToL2Locked(amountToSend, l2Beneficiary.address, maxGas, gasPrice, maxSubmissionCost) + // Call again + const tx = lockAsTransferTool + .connect(beneficiary.signer) + .depositToL2Locked(amountToSend, l2Beneficiary.address, maxGas, gasPrice, maxSubmissionCost) + await expect(tx) + .emit(transferTool, 'LockedFundsSentToL2') + .withArgs( + lockAsTransferTool.address, + expectedL2Address, + tokenLockManager.address, + l2ManagerMock.address, + amountToSend, + ) + await expect(tx).not.emit(transferTool, 'L2BeneficiarySet') + // Check the events emitted from the mock gateway + await expect(tx) + .emit(gateway, 'FakeTxToL2') + .withArgs(transferTool.address, ticketValue, maxGas, gasPrice, maxSubmissionCost, expectedOutboundCalldata) + // and check that the right amount of funds have been pulled from the token lock + expect(await grt.balanceOf(tokenLock.address)).to.equal(initArgs.managedAmount.sub(amountToSend.mul(2))) + }) + it('accepts calls from a wallet that has funds staked in the protocol', async function () { + // Use the tokenLock contract as if it were the Staking contract + const lockAsStaking = Staking__factory.connect(tokenLock.address, deployer.signer) + const stakeAmount = toGRT('1000') + // Stake some funds + await lockAsStaking.connect(beneficiary.signer).stake(stakeAmount) + + await tokenLock.connect(beneficiary.signer).acceptLock() + const amountToSend = toGRT('1000') + + const expectedWalletData = defaultAbiCoder.encode( + ['tuple(address,address,address,uint256,uint256,uint256)'], + [ + [ + tokenLock.address, + l2Owner.address, + l2Beneficiary.address, + initArgs.managedAmount, + initArgs.startTime, + initArgs.endTime, + ], + ], + ) + const expectedL2Address = await transferTool['getDeploymentAddress(bytes32,address,address)']( + keccak256(expectedWalletData), + l2LockImplementationMock.address, + l2ManagerMock.address, + ) + + const expectedOutboundCalldata = await gateway.getOutboundCalldata( + grt.address, + transferTool.address, + l2ManagerMock.address, + amountToSend, + expectedWalletData, + ) + + // Good hacker pays for the gas + await transferTool.connect(hacker.signer).depositETH(tokenLock.address, { value: ticketValue }) + const tx = lockAsTransferTool + .connect(beneficiary.signer) + .depositToL2Locked(amountToSend, l2Beneficiary.address, maxGas, gasPrice, maxSubmissionCost) + await expect(tx) + .emit(transferTool, 'LockedFundsSentToL2') + .withArgs( + lockAsTransferTool.address, + expectedL2Address, + tokenLockManager.address, + l2ManagerMock.address, + amountToSend, + ) + // Check the events emitted from the mock gateway + await expect(tx) + .emit(gateway, 'FakeTxToL2') + .withArgs(transferTool.address, ticketValue, maxGas, gasPrice, maxSubmissionCost, expectedOutboundCalldata) + // and check that the right amount of funds have been pulled from the token lock + expect(await grt.balanceOf(tokenLock.address)).to.equal(initArgs.managedAmount.sub(amountToSend).sub(stakeAmount)) + }) + it('rejects calling a second time if the l2 beneficiary is different', async function () { + await tokenLock.connect(beneficiary.signer).acceptLock() + const amountToSend = toGRT('1000') + + // Good hacker pays for the gas + await transferTool.connect(hacker.signer).depositETH(tokenLock.address, { value: ticketValue }) + await lockAsTransferTool + .connect(beneficiary.signer) + .depositToL2Locked(amountToSend, l2Beneficiary.address, maxGas, gasPrice, maxSubmissionCost) + // Call again + await expect( + lockAsTransferTool + .connect(beneficiary.signer) + .depositToL2Locked(amountToSend, l2Owner.address, maxGas, gasPrice, maxSubmissionCost), + ).to.be.revertedWith('INVALID_BENEFICIARY') + }) + it('rejects first calls from a token lock that is fully-vested', async function () { + initArgs.endTime = Math.round(+new Date(+new Date() - 120) / 1000) + initArgs.startTime = initArgs.endTime - 1000 + + tokenLock = await initWithArgs(initArgs) + lockAsTransferTool = L1GraphTokenLockTransferTool__factory.connect(tokenLock.address, deployer.signer) + await tokenLock.connect(beneficiary.signer).acceptLock() + await tokenLock.connect(beneficiary.signer).approveProtocol() + await transferTool.connect(hacker.signer).depositETH(tokenLock.address, { value: ticketValue }) + const amountToSend = toGRT('1000') + const tx = lockAsTransferTool + .connect(beneficiary.signer) + .depositToL2Locked(amountToSend, l2Beneficiary.address, maxGas, gasPrice, maxSubmissionCost) + await expect(tx).to.be.revertedWith('FULLY_VESTED_USE_MANUAL_ADDRESS') + }) + it('accepts calls from a fully-vested wallet if it had been called before', async function () { + // End time two minutes in the future + initArgs.endTime = Math.round(+new Date(+new Date() + 120000) / 1000) + initArgs.startTime = initArgs.endTime - 1000 + + tokenLock = await initWithArgs(initArgs) + lockAsTransferTool = L1GraphTokenLockTransferTool__factory.connect(tokenLock.address, deployer.signer) + await tokenLock.connect(beneficiary.signer).acceptLock() + await tokenLock.connect(beneficiary.signer).approveProtocol() + await transferTool.connect(hacker.signer).depositETH(tokenLock.address, { value: ticketValue.mul(2) }) + const amountToSend = toGRT('1000') + await lockAsTransferTool + .connect(beneficiary.signer) + .depositToL2Locked(amountToSend, l2Beneficiary.address, maxGas, gasPrice, maxSubmissionCost) + + await advanceTimeAndBlock(200) + const tx = lockAsTransferTool + .connect(beneficiary.signer) + .depositToL2Locked(amountToSend, l2Beneficiary.address, maxGas, gasPrice, maxSubmissionCost) + await expect(tx).emit(transferTool, 'LockedFundsSentToL2') + }) + }) + describe('Setting an L2 wallet address manually', function () { + it('sets the l2WalletAddress for a token lock that is fully-vested', async function () { + initArgs.endTime = Math.round(+new Date(+new Date() - 120) / 1000) + initArgs.startTime = initArgs.endTime - 1000 + + tokenLock = await initWithArgs(initArgs) + lockAsTransferTool = L1GraphTokenLockTransferTool__factory.connect(tokenLock.address, deployer.signer) + await tokenLock.connect(beneficiary.signer).acceptLock() + + const tx = await lockAsTransferTool.connect(beneficiary.signer).setL2WalletAddressManually(l2Beneficiary.address) + await expect(tx).emit(transferTool, 'L2WalletAddressSet').withArgs(tokenLock.address, l2Beneficiary.address) + expect(await transferTool.l2WalletAddress(tokenLock.address)).to.equal(l2Beneficiary.address) + }) + it('reverts for a wallet that is not fully-vested', async function () { + await expect( + lockAsTransferTool.connect(beneficiary.signer).setL2WalletAddressManually(l2Beneficiary.address), + ).to.be.revertedWith('NOT_FULLY_VESTED') + }) + it('reverts for a wallet that has already had the address set', async function () { + initArgs.endTime = Math.round(+new Date(+new Date() - 120) / 1000) + initArgs.startTime = initArgs.endTime - 1000 + + tokenLock = await initWithArgs(initArgs) + lockAsTransferTool = L1GraphTokenLockTransferTool__factory.connect(tokenLock.address, deployer.signer) + await tokenLock.connect(beneficiary.signer).acceptLock() + await lockAsTransferTool.connect(beneficiary.signer).setL2WalletAddressManually(l2Beneficiary.address) + + await expect( + lockAsTransferTool.connect(beneficiary.signer).setL2WalletAddressManually(l2Beneficiary.address), + ).to.be.revertedWith('L2_WALLET_ALREADY_SET') + }) + it('reverts for a wallet that has previously called depositToL2Locked', async function () { + // End time two minutes in the future + initArgs.endTime = Math.round(+new Date(+new Date() + 120000) / 1000) + initArgs.startTime = initArgs.endTime - 1000 + + tokenLock = await initWithArgs(initArgs) + lockAsTransferTool = L1GraphTokenLockTransferTool__factory.connect(tokenLock.address, deployer.signer) + await tokenLock.connect(beneficiary.signer).acceptLock() + await tokenLock.connect(beneficiary.signer).approveProtocol() + const amountToSend = toGRT('1000') + await transferTool.connect(hacker.signer).depositETH(tokenLock.address, { value: ticketValue }) + await lockAsTransferTool + .connect(beneficiary.signer) + .depositToL2Locked(amountToSend, l2Beneficiary.address, maxGas, gasPrice, maxSubmissionCost) + + await advanceTimeAndBlock(200) + await expect( + lockAsTransferTool.connect(beneficiary.signer).setL2WalletAddressManually(l2Beneficiary.address), + ).to.be.revertedWith('L2_WALLET_ALREADY_SET') + }) + it('prevents subsequent calls to depositToL2Locked from working', async function () { + initArgs.endTime = Math.round(+new Date(+new Date() - 120) / 1000) + initArgs.startTime = initArgs.endTime - 1000 + + tokenLock = await initWithArgs(initArgs) + lockAsTransferTool = L1GraphTokenLockTransferTool__factory.connect(tokenLock.address, deployer.signer) + await tokenLock.connect(beneficiary.signer).acceptLock() + await tokenLock.connect(beneficiary.signer).approveProtocol() + const amountToSend = toGRT('1000') + await transferTool.connect(hacker.signer).depositETH(tokenLock.address, { value: ticketValue }) + + await lockAsTransferTool.connect(beneficiary.signer).setL2WalletAddressManually(l2Beneficiary.address) + + await expect( + lockAsTransferTool + .connect(beneficiary.signer) + .depositToL2Locked(amountToSend, l2Beneficiary.address, maxGas, gasPrice, maxSubmissionCost), + ).to.be.revertedWith('CANT_DEPOSIT_TO_MANUAL_ADDRESS') + }) + }) +}) diff --git a/packages/token-distribution/test/l2TokenLockManager.test.ts b/packages/token-distribution/test/l2TokenLockManager.test.ts new file mode 100644 index 000000000..b093773b9 --- /dev/null +++ b/packages/token-distribution/test/l2TokenLockManager.test.ts @@ -0,0 +1,460 @@ +import { constants, Wallet } from 'ethers' +import { deployments, ethers } from 'hardhat' +import { expect } from 'chai' + +import '@nomiclabs/hardhat-ethers' +import 'hardhat-deploy' + +import { GraphTokenMock } from '../build/typechain/contracts/GraphTokenMock' +import { L2GraphTokenLockManager } from '../build/typechain/contracts/L2GraphTokenLockManager' +import { L2GraphTokenLockWallet } from '../build/typechain/contracts/L2GraphTokenLockWallet' +import { Staking__factory } from '@graphprotocol/contracts/dist/types/factories/Staking__factory' +import { StakingMock } from '../build/typechain/contracts/StakingMock' + +import { Account, advanceTimeAndBlock, getAccounts, getContract, toGRT } from './network' +import { defaultAbiCoder, keccak256 } from 'ethers/lib/utils' +import { defaultInitArgs, Revocability, TokenLockParameters } from './config' +import { DeployOptions } from 'hardhat-deploy/types' +import { Staking } from '@graphprotocol/contracts' + +const { AddressZero } = constants + +// Fixture +const setupTest = deployments.createFixture(async ({ deployments }) => { + const deploy = (name: string, options: DeployOptions) => deployments.deploy(name, options) + const [deployer, , l1TransferToolMock, gateway] = await getAccounts() + + // Start from a fresh snapshot + await deployments.fixture([]) + + // Deploy token + await deploy('GraphTokenMock', { + from: deployer.address, + args: [toGRT('1000000000'), deployer.address], + }) + const grt = await getContract('GraphTokenMock') + + // Deploy token lock masterCopy + await deploy('L2GraphTokenLockWallet', { + from: deployer.address, + }) + const tokenLockWallet = await getContract('L2GraphTokenLockWallet') + + // Deploy token lock manager + await deploy('L2GraphTokenLockManager', { + from: deployer.address, + args: [grt.address, tokenLockWallet.address, gateway.address, l1TransferToolMock.address], + }) + const tokenLockManager = await getContract('L2GraphTokenLockManager') + + // Protocol contracts + await deploy('StakingMock', { from: deployer.address, args: [grt.address] }) + const staking = await getContract('StakingMock') + + // Fund the manager contract + await grt.connect(deployer.signer).transfer(tokenLockManager.address, toGRT('100000000')) + + return { + grt: grt as GraphTokenMock, + staking: staking as StakingMock, + tokenLockImplementation: tokenLockWallet as L2GraphTokenLockWallet, + tokenLockManager: tokenLockManager as L2GraphTokenLockManager, + } +}) + +async function authProtocolFunctions(tokenLockManager: L2GraphTokenLockManager, stakingAddress: string) { + await tokenLockManager.setAuthFunctionCall('stake(uint256)', stakingAddress) + await tokenLockManager.setAuthFunctionCall('unstake(uint256)', stakingAddress) + await tokenLockManager.setAuthFunctionCall('withdraw()', stakingAddress) +} + +describe('L2GraphTokenLockManager', () => { + let deployer: Account + let beneficiary: Account + let l1TransferToolMock: Account + let gateway: Account + let l1TokenLock: Account + + let grt: GraphTokenMock + let tokenLock: L2GraphTokenLockWallet + let tokenLockImplementation: L2GraphTokenLockWallet + let tokenLockManager: L2GraphTokenLockManager + let staking: StakingMock + let lockAsStaking: Staking + + let initArgs: TokenLockParameters + + const initWithArgs = async (args: TokenLockParameters): Promise => { + const tx = await tokenLockManager.createTokenLockWallet( + args.owner, + args.beneficiary, + args.managedAmount, + args.startTime, + args.endTime, + args.periods, + args.releaseStartTime, + args.vestingCliffTime, + args.revocable, + ) + const receipt = await tx.wait() + const contractAddress = receipt.events[0].args['proxy'] + return ethers.getContractAt('L2GraphTokenLockWallet', contractAddress) as Promise + } + + before(async function () { + [deployer, beneficiary, l1TransferToolMock, gateway, l1TokenLock] = await getAccounts() + }) + + beforeEach(async () => { + ({ grt, tokenLockManager, staking, tokenLockImplementation } = await setupTest()) + + // Setup authorized functions in Manager + await authProtocolFunctions(tokenLockManager, staking.address) + + // Add the staking contract as token destination + await tokenLockManager.addTokenDestination(staking.address) + }) + + describe('TokenLockManager standard behavior', function () { + it('reverts if initialized with empty token', async function () { + const deploy = (name: string, options: DeployOptions) => deployments.deploy(name, options) + + const d = deploy('L2GraphTokenLockManager', { + from: deployer.address, + args: [ + AddressZero, + Wallet.createRandom().address, + Wallet.createRandom().address, + Wallet.createRandom().address, + ], + }) + await expect(d).revertedWith('Token cannot be zero') + }) + + it('should set the master copy', async function () { + const address = Wallet.createRandom().address + const tx = tokenLockManager.setMasterCopy(address) + await expect(tx).emit(tokenLockManager, 'MasterCopyUpdated').withArgs(address) + }) + + it('reverts if setting the master copy to zero address', async function () { + const tx = tokenLockManager.setMasterCopy(AddressZero) + await expect(tx).revertedWith('MasterCopy cannot be zero') + }) + + it('should add a token destination', async function () { + const address = Wallet.createRandom().address + + expect(await tokenLockManager.isTokenDestination(address)).eq(false) + const tx = tokenLockManager.addTokenDestination(address) + await expect(tx).emit(tokenLockManager, 'TokenDestinationAllowed').withArgs(address, true) + expect(await tokenLockManager.isTokenDestination(address)).eq(true) + }) + + it('reverts when adding a token destination with zero address', async function () { + const tx = tokenLockManager.addTokenDestination(AddressZero) + await expect(tx).revertedWith('Destination cannot be zero') + }) + + it('creates a token lock wallet that can participate in the protocol', async function () { + initArgs = defaultInitArgs(deployer, beneficiary, grt, toGRT('35000000')) + tokenLock = await initWithArgs(initArgs) + + // Approve contracts to pull tokens from the token lock + await tokenLock.connect(beneficiary.signer).approveProtocol() + + // Check that the token lock wallet was created with the correct parameters + expect(await tokenLock.owner()).eq(initArgs.owner) + expect(await tokenLock.beneficiary()).eq(initArgs.beneficiary) + expect(await tokenLock.managedAmount()).eq(initArgs.managedAmount) + expect(await tokenLock.startTime()).eq(initArgs.startTime) + expect(await tokenLock.endTime()).eq(initArgs.endTime) + expect(await tokenLock.periods()).eq(initArgs.periods) + expect(await tokenLock.releaseStartTime()).eq(initArgs.releaseStartTime) + expect(await tokenLock.vestingCliffTime()).eq(initArgs.vestingCliffTime) + expect(await tokenLock.revocable()).eq(initArgs.revocable) + expect(await tokenLock.isAccepted()).eq(false) + + expect(await grt.balanceOf(tokenLock.address)).eq(initArgs.managedAmount) + + // Stake in the protocol using the lock as a Staking contract + const amount = toGRT('10000000') + + lockAsStaking = Staking__factory.connect(tokenLock.address, deployer.signer) + await lockAsStaking.connect(beneficiary.signer).stake(amount) + + // Check that the staking contract received the tokens + expect(await grt.balanceOf(staking.address)).eq(amount) + // Check the token lock wallet balance + expect(await grt.balanceOf(tokenLock.address)).eq(initArgs.managedAmount.sub(amount)) + }) + }) + describe('onTokenTransfer', function () { + it('receives tokens and creates a new token lock with the received parameters', async function () { + // ABI-encoded callhook data + initArgs = defaultInitArgs(deployer, beneficiary, grt, toGRT('35000000')) + const walletDataType = 'tuple(address,address,address,uint256,uint256,uint256)' + const data = defaultAbiCoder.encode( + [walletDataType], + [ + [ + l1TokenLock.address, + initArgs.owner, + initArgs.beneficiary, + initArgs.managedAmount, + initArgs.startTime, + initArgs.endTime, + ], + ], + ) + const walletData = { + l1Address: l1TokenLock.address, + owner: initArgs.owner, + beneficiary: initArgs.beneficiary, + managedAmount: initArgs.managedAmount, + startTime: initArgs.startTime, + endTime: initArgs.endTime, + } + + const expectedL2Address = await tokenLockManager['getDeploymentAddress(bytes32,address,address)']( + keccak256(data), + tokenLockImplementation.address, + tokenLockManager.address, + ) + + // Assume part of the managed amount were used in L1, so we don't get all of it + const transferredAmount = initArgs.managedAmount.sub(toGRT('100000')) + + const expectedInitData = tokenLockImplementation.interface.encodeFunctionData('initializeFromL1', [ + tokenLockManager.address, + grt.address, + walletData, + ]) + const expectedInitHash = keccak256(expectedInitData) + + // Call onTokenTransfer from the gateway: + const tx = tokenLockManager + .connect(gateway.signer) + .onTokenTransfer(l1TransferToolMock.address, transferredAmount, data) + + await expect(tx) + .emit(tokenLockManager, 'TokenLockCreatedFromL1') + .withArgs( + expectedL2Address, + expectedInitHash, + walletData.beneficiary, + walletData.managedAmount, + walletData.startTime, + walletData.endTime, + walletData.l1Address, + ) + + // Check that the token lock wallet was created with the correct parameters + const tokenLock = (await ethers.getContractAt( + 'L2GraphTokenLockWallet', + expectedL2Address, + deployer.signer, + )) as L2GraphTokenLockWallet + expect(await tokenLock.owner()).eq(initArgs.owner) + expect(await tokenLock.beneficiary()).eq(initArgs.beneficiary) + expect(await tokenLock.managedAmount()).eq(initArgs.managedAmount) + expect(await tokenLock.startTime()).eq(initArgs.startTime) + expect(await tokenLock.endTime()).eq(initArgs.endTime) + expect(await tokenLock.periods()).eq(1) + expect(await tokenLock.releaseStartTime()).eq(initArgs.endTime) + expect(await tokenLock.vestingCliffTime()).eq(0) + expect(await tokenLock.revocable()).eq(Revocability.Disabled) + expect(await grt.balanceOf(tokenLock.address)).eq(transferredAmount) + expect(await tokenLock.isAccepted()).eq(true) + + // The mapping for L1 address to L2 address should be set correctly + expect(await tokenLockManager.l1WalletToL2Wallet(l1TokenLock.address)).eq(expectedL2Address) + // And same for L2 address to L1 address + expect(await tokenLockManager.l2WalletToL1Wallet(expectedL2Address)).eq(l1TokenLock.address) + }) + it('sends the tokens to an already created wallet', async function () { + // ABI-encoded callhook data + initArgs = defaultInitArgs(deployer, beneficiary, grt, toGRT('35000000')) + const walletDataType = 'tuple(address,address,address,uint256,uint256,uint256)' + const data = defaultAbiCoder.encode( + [walletDataType], + [ + [ + l1TokenLock.address, + initArgs.owner, + initArgs.beneficiary, + initArgs.managedAmount, + initArgs.startTime, + initArgs.endTime, + ], + ], + ) + const walletData = { + l1Address: l1TokenLock.address, + owner: initArgs.owner, + beneficiary: initArgs.beneficiary, + managedAmount: initArgs.managedAmount, + startTime: initArgs.startTime, + endTime: initArgs.endTime, + } + + const expectedL2Address = await tokenLockManager['getDeploymentAddress(bytes32,address,address)']( + keccak256(data), + tokenLockImplementation.address, + tokenLockManager.address, + ) + + // Assume part of the managed amount were used in L1, so we don't get all of it + const transferredAmount = initArgs.managedAmount.sub(toGRT('100000')) + + const expectedInitData = tokenLockImplementation.interface.encodeFunctionData('initializeFromL1', [ + tokenLockManager.address, + grt.address, + walletData, + ]) + const expectedInitHash = keccak256(expectedInitData) + + // Call onTokenTransfer from the gateway: + const tx = tokenLockManager + .connect(gateway.signer) + .onTokenTransfer(l1TransferToolMock.address, transferredAmount, data) + + await expect(tx) + .emit(tokenLockManager, 'TokenLockCreatedFromL1') + .withArgs( + expectedL2Address, + expectedInitHash, + walletData.beneficiary, + walletData.managedAmount, + walletData.startTime, + walletData.endTime, + walletData.l1Address, + ) + + // Check that the token lock wallet was created with the correct parameters + const tokenLock = (await ethers.getContractAt( + 'L2GraphTokenLockWallet', + expectedL2Address, + deployer.signer, + )) as L2GraphTokenLockWallet + expect(await grt.balanceOf(tokenLock.address)).eq(transferredAmount) + + // Call onTokenTransfer from the gateway again: + const tx2 = tokenLockManager + .connect(gateway.signer) + .onTokenTransfer(l1TransferToolMock.address, transferredAmount, data) + // This tx should not emit a TokenLockCreatedFromL1 event + await expect(tx2).to.not.emit(tokenLockManager, 'TokenLockCreatedFromL1') + // But it should transfer the tokens to the token lock wallet + expect(await grt.balanceOf(tokenLock.address)).eq(transferredAmount.mul(2)) + }) + it('creates a wallet that can participate in the protocol', async function () { + // ABI-encoded callhook data + initArgs = defaultInitArgs(deployer, beneficiary, grt, toGRT('35000000')) + const walletDataType = 'tuple(address,address,address,uint256,uint256,uint256)' + const data = defaultAbiCoder.encode( + [walletDataType], + [ + [ + l1TokenLock.address, + initArgs.owner, + initArgs.beneficiary, + initArgs.managedAmount, + initArgs.startTime, + initArgs.endTime, + ], + ], + ) + + const expectedL2Address = await tokenLockManager['getDeploymentAddress(bytes32,address,address)']( + keccak256(data), + tokenLockImplementation.address, + tokenLockManager.address, + ) + + // Assume part of the managed amount were used in L1, so we don't get all of it + const transferredAmount = initArgs.managedAmount.sub(toGRT('100000')) + + // Call onTokenTransfer from the gateway: + await tokenLockManager + .connect(gateway.signer) + .onTokenTransfer(l1TransferToolMock.address, transferredAmount, data) + + // Check that the token lock wallet was created with the correct parameters + const tokenLock = (await ethers.getContractAt( + 'L2GraphTokenLockWallet', + expectedL2Address, + deployer.signer, + )) as L2GraphTokenLockWallet + + // Approve the protocol + await tokenLock.connect(beneficiary.signer).approveProtocol() + + // And the created wallet should be able to participate in the protocol + // Stake in the protocol using the lock as a Staking contract + const amount = toGRT('100000') + + const lockAsStaking = Staking__factory.connect(tokenLock.address, deployer.signer) + await lockAsStaking.connect(beneficiary.signer).stake(amount) + + // Check that the staking contract received the tokens + expect(await grt.balanceOf(staking.address)).eq(amount) + // Check the token lock wallet balance + expect(await grt.balanceOf(tokenLock.address)).eq(transferredAmount.sub(amount)) + }) + it('creates a wallet that has zero releasable amount until the end of the vesting period', async function () { + // ABI-encoded callhook data + initArgs = defaultInitArgs(deployer, beneficiary, grt, toGRT('35000000')) + const walletDataType = 'tuple(address,address,address,uint256,uint256,uint256)' + const data = defaultAbiCoder.encode( + [walletDataType], + [ + [ + l1TokenLock.address, + initArgs.owner, + initArgs.beneficiary, + initArgs.managedAmount, + initArgs.startTime, + initArgs.endTime, + ], + ], + ) + + const expectedL2Address = await tokenLockManager['getDeploymentAddress(bytes32,address,address)']( + keccak256(data), + tokenLockImplementation.address, + tokenLockManager.address, + ) + + // Assume part of the managed amount were used in L1, so we don't get all of it + const transferredAmount = initArgs.managedAmount.sub(toGRT('100000')) + + // Call onTokenTransfer from the gateway: + await tokenLockManager + .connect(gateway.signer) + .onTokenTransfer(l1TransferToolMock.address, transferredAmount, data) + + // Check that the token lock wallet was created with the correct parameters + const tokenLock = (await ethers.getContractAt( + 'L2GraphTokenLockWallet', + expectedL2Address, + deployer.signer, + )) as L2GraphTokenLockWallet + + // Check that the releasable amount is zero + expect(await tokenLock.releasableAmount()).eq(0) + // After a few blocks, check that the releasable amount is still zero + await advanceTimeAndBlock(3600 * 24 * 90) + expect(await tokenLock.releasableAmount()).eq(0) + // And available amount should also be zero + expect(await tokenLock.availableAmount()).eq(0) + + // Advance time to the end of the vesting period + await advanceTimeAndBlock(3600 * 24 * 181) + // Check that the releasable amount is the full amount transferred + expect(await tokenLock.releasableAmount()).eq(transferredAmount) + // And available amount should also be the full managed amount + expect(await tokenLock.availableAmount()).eq(initArgs.managedAmount) + }) + }) +}) diff --git a/packages/token-distribution/test/l2TokenLockTransferTool.test.ts b/packages/token-distribution/test/l2TokenLockTransferTool.test.ts new file mode 100644 index 000000000..8f762cc63 --- /dev/null +++ b/packages/token-distribution/test/l2TokenLockTransferTool.test.ts @@ -0,0 +1,263 @@ +import { deployments, ethers, upgrades } from 'hardhat' +import { constants } from 'ethers' +import { expect } from 'chai' + +import '@nomiclabs/hardhat-ethers' +import 'hardhat-deploy' + +import { GraphTokenMock } from '../build/typechain/contracts/GraphTokenMock' +import { L2GraphTokenLockManager } from '../build/typechain/contracts/L2GraphTokenLockManager' +import { L2GraphTokenLockTransferTool } from '../build/typechain/contracts/L2GraphTokenLockTransferTool' +import { L2GraphTokenLockTransferTool__factory } from '../build/typechain/contracts/factories/L2GraphTokenLockTransferTool__factory' +import { L2GraphTokenLockWallet } from '../build/typechain/contracts/L2GraphTokenLockWallet' +import { L2TokenGatewayMock } from '../build/typechain/contracts/L2TokenGatewayMock' + +import { Account, getAccounts, getContract, toBN, toGRT } from './network' +import { defaultAbiCoder, keccak256 } from 'ethers/lib/utils' +import { defaultInitArgs, TokenLockParameters } from './config' +import { DeployOptions } from 'hardhat-deploy/types' + +const { AddressZero } = constants + +// Fixture +const setupTest = deployments.createFixture(async ({ deployments }) => { + const deploy = (name: string, options: DeployOptions) => deployments.deploy(name, options) + const [deployer, , l1TransferToolMock, l1GRTMock] = await getAccounts() + + // Start from a fresh snapshot + await deployments.fixture([]) + + // Deploy token + await deploy('GraphTokenMock', { + from: deployer.address, + args: [toGRT('1000000000'), deployer.address], + }) + const grt = await getContract('GraphTokenMock') + + // Deploy token lock masterCopy + await deploy('L2GraphTokenLockWallet', { + from: deployer.address, + }) + const tokenLockWallet = await getContract('L2GraphTokenLockWallet') + + // Deploy the gateway mock + await deploy('L2TokenGatewayMock', { + from: deployer.address, + args: [l1GRTMock.address, grt.address], + }) + const gateway = await getContract('L2TokenGatewayMock') + + // Deploy token lock manager + await deploy('L2GraphTokenLockManager', { + from: deployer.address, + args: [grt.address, tokenLockWallet.address, gateway.address, l1TransferToolMock.address], + }) + const tokenLockManager = await getContract('L2GraphTokenLockManager') + + // Deploy the L2GraphTokenLockTransferTool using a proxy + + // Deploy transfer tool using a proxy + const transferToolFactory = await ethers.getContractFactory('L2GraphTokenLockTransferTool') + const tokenLockTransferTool = (await upgrades.deployProxy(transferToolFactory, [], { + kind: 'transparent', + unsafeAllow: ['state-variable-immutable', 'constructor'], + constructorArgs: [grt.address, gateway.address, l1GRTMock.address], + })) as L2GraphTokenLockTransferTool + + // Fund the manager contract + await grt.connect(deployer.signer).transfer(tokenLockManager.address, toGRT('100000000')) + + return { + grt: grt as GraphTokenMock, + gateway: gateway as L2TokenGatewayMock, + tokenLockTransferTool: tokenLockTransferTool, + tokenLockImplementation: tokenLockWallet as L2GraphTokenLockWallet, + tokenLockManager: tokenLockManager as L2GraphTokenLockManager, + } +}) + +async function authProtocolFunctions(tokenLockManager: L2GraphTokenLockManager, tokenLockTransferToolAddress: string) { + await tokenLockManager.setAuthFunctionCall('withdrawToL1Locked(uint256)', tokenLockTransferToolAddress) +} + +describe('L2GraphTokenLockTransferTool', () => { + let deployer: Account + let beneficiary: Account + let l1TransferToolMock: Account + let l1GRTMock: Account + let l1TokenLock: Account + + let grt: GraphTokenMock + let tokenLock: L2GraphTokenLockWallet + let tokenLockImplementation: L2GraphTokenLockWallet + let tokenLockManager: L2GraphTokenLockManager + let tokenLockTransferTool: L2GraphTokenLockTransferTool + let gateway: L2TokenGatewayMock + let lockAsTransferTool: L2GraphTokenLockTransferTool + + let initArgs: TokenLockParameters + + const initWithArgs = async (args: TokenLockParameters): Promise => { + const tx = await tokenLockManager.createTokenLockWallet( + args.owner, + args.beneficiary, + args.managedAmount, + args.startTime, + args.endTime, + args.periods, + args.releaseStartTime, + args.vestingCliffTime, + args.revocable, + ) + const receipt = await tx.wait() + const contractAddress = receipt.events[0].args['proxy'] + return ethers.getContractAt('L2GraphTokenLockWallet', contractAddress) as Promise + } + + const initFromL1 = async (): Promise => { + // First we mock creating a token lock wallet through the gateway + // ABI-encoded callhook data + initArgs = defaultInitArgs(deployer, beneficiary, grt, toGRT('35000000')) + const walletDataType = 'tuple(address,address,address,uint256,uint256,uint256)' + const data = defaultAbiCoder.encode( + [walletDataType], + [ + [ + l1TokenLock.address, + initArgs.owner, + initArgs.beneficiary, + initArgs.managedAmount, + initArgs.startTime, + initArgs.endTime, + ], + ], + ) + + // Mock the gateway call + const tx = gateway.finalizeInboundTransfer( + l1GRTMock.address, + l1TransferToolMock.address, + tokenLockManager.address, + toGRT('35000000'), + data, + ) + + await expect(tx).emit(tokenLockManager, 'TokenLockCreatedFromL1') + + const expectedL2Address = await tokenLockManager['getDeploymentAddress(bytes32,address,address)']( + keccak256(data), + tokenLockImplementation.address, + tokenLockManager.address, + ) + + return ethers.getContractAt('L2GraphTokenLockWallet', expectedL2Address) as Promise + } + + before(async function () { + [deployer, beneficiary, l1TransferToolMock, l1GRTMock, l1TokenLock] = await getAccounts() + }) + + beforeEach(async () => { + ({ grt, gateway, tokenLockTransferTool, tokenLockImplementation, tokenLockManager } = await setupTest()) + + // Setup authorized functions in Manager + await authProtocolFunctions(tokenLockManager, tokenLockTransferTool.address) + + // Add the transfer tool contract as token destination + await tokenLockManager.addTokenDestination(tokenLockTransferTool.address) + }) + + describe('Upgrades', function () { + it('should be upgradeable', async function () { + const transferToolFactory = await ethers.getContractFactory('L2GraphTokenLockTransferTool') + tokenLockTransferTool = (await upgrades.upgradeProxy(tokenLockTransferTool.address, transferToolFactory, { + kind: 'transparent', + unsafeAllow: ['state-variable-immutable', 'constructor'], + constructorArgs: [beneficiary.address, gateway.address, l1GRTMock.address], + })) as L2GraphTokenLockTransferTool + expect(await tokenLockTransferTool.graphToken()).to.eq(beneficiary.address) + tokenLockTransferTool = (await upgrades.upgradeProxy(tokenLockTransferTool.address, transferToolFactory, { + kind: 'transparent', + unsafeAllow: ['state-variable-immutable', 'constructor'], + constructorArgs: [grt.address, gateway.address, l1GRTMock.address], + })) as L2GraphTokenLockTransferTool + expect(await tokenLockTransferTool.graphToken()).to.eq(grt.address) + }) + }) + describe('withdrawToL1Locked', function () { + it('allows a token lock wallet to send GRT to L1 through the gateway', async function () { + tokenLock = await initFromL1() + // Approve contracts to pull tokens from the token lock + await tokenLock.connect(beneficiary.signer).approveProtocol() + + lockAsTransferTool = L2GraphTokenLockTransferTool__factory.connect(tokenLock.address, deployer.signer) + + const amountToSend = toGRT('1000000') + const tx = await lockAsTransferTool.connect(beneficiary.signer).withdrawToL1Locked(amountToSend) + + await expect(tx).emit(gateway, 'WithdrawalInitiated').withArgs( + l1GRTMock.address, + tokenLockTransferTool.address, + l1TokenLock.address, + toBN('0'), // sequence number + amountToSend, + ) + await expect(tx) + .emit(tokenLockTransferTool, 'LockedFundsSentToL1') + .withArgs(l1TokenLock.address, tokenLock.address, tokenLockManager.address, amountToSend) + }) + it('rejects calls from a lock that was not transferred from L1', async function () { + tokenLock = await initWithArgs(defaultInitArgs(deployer, beneficiary, grt, toGRT('35000000'))) + // Approve contracts to pull tokens from the token lock + await tokenLock.connect(beneficiary.signer).approveProtocol() + + lockAsTransferTool = L2GraphTokenLockTransferTool__factory.connect(tokenLock.address, deployer.signer) + + const amountToSend = toGRT('1000000') + const tx = lockAsTransferTool.connect(beneficiary.signer).withdrawToL1Locked(amountToSend) + + await expect(tx).to.be.revertedWith('NOT_L1_WALLET') + }) + it('rejects calls from an address that is not a lock (has no manager)', async function () { + const tx = tokenLockTransferTool.connect(beneficiary.signer).withdrawToL1Locked(toGRT('1000000')) + await expect(tx).to.be.reverted // Function call to a non-contract account + }) + it('rejects calls from an address that has a manager() function that returns zero', async function () { + // Use WalletMock to simulate an invalid wallet with no manager + // WalletMock constructor args are: target, token, manager, isInitialized, isAccepted + await deployments.deploy('WalletMock', { + from: deployer.address, + args: [tokenLockTransferTool.address, grt.address, AddressZero, true, true], + }) + const invalidWallet = await getContract('WalletMock') + const walletAsTransferTool = L2GraphTokenLockTransferTool__factory.connect(invalidWallet.address, deployer.signer) + + const tx = walletAsTransferTool.connect(beneficiary.signer).withdrawToL1Locked(toGRT('1000000')) + await expect(tx).to.be.revertedWith('INVALID_SENDER') + }) + it('rejects calls from a lock that has insufficient GRT balance', async function () { + tokenLock = await initFromL1() + // Approve contracts to pull tokens from the token lock + await tokenLock.connect(beneficiary.signer).approveProtocol() + + lockAsTransferTool = L2GraphTokenLockTransferTool__factory.connect(tokenLock.address, deployer.signer) + + const amountToSend = toGRT('35000001') + const tx = lockAsTransferTool.connect(beneficiary.signer).withdrawToL1Locked(amountToSend) + + await expect(tx).to.be.revertedWith('INSUFFICIENT_BALANCE') + }) + it('rejects calls trying to send a zero amount', async function () { + tokenLock = await initFromL1() + // Approve contracts to pull tokens from the token lock + await tokenLock.connect(beneficiary.signer).approveProtocol() + + lockAsTransferTool = L2GraphTokenLockTransferTool__factory.connect(tokenLock.address, deployer.signer) + + const amountToSend = toGRT('0') + const tx = lockAsTransferTool.connect(beneficiary.signer).withdrawToL1Locked(amountToSend) + + await expect(tx).to.be.revertedWith('ZERO_AMOUNT') + }) + }) +}) diff --git a/packages/token-distribution/test/network.ts b/packages/token-distribution/test/network.ts new file mode 100644 index 000000000..2f92cbc19 --- /dev/null +++ b/packages/token-distribution/test/network.ts @@ -0,0 +1,95 @@ +import { BigNumber, Contract, providers, Signer, utils } from 'ethers' +import { deployments, ethers, network, waffle } from 'hardhat' + +// Plugins + +import '@nomiclabs/hardhat-ethers' +import '@nomiclabs/hardhat-waffle' +import 'hardhat-deploy' + +const { hexlify, parseUnits, formatUnits, randomBytes } = utils + +// Utils + +export const toBN = (value: string | number): BigNumber => BigNumber.from(value) +export const toGRT = (value: string): BigNumber => parseUnits(value, '18') +export const formatGRT = (value: BigNumber): string => formatUnits(value, '18') +export const randomHexBytes = (n = 32): string => hexlify(randomBytes(n)) + +// Contracts + +export const getContract = async (contractName: string): Promise => { + const deployment = await deployments.get(contractName) + return ethers.getContractAt(contractName, deployment.address) +} + +// Network + +export interface Account { + readonly signer: Signer + readonly address: string +} + +export const provider = (): providers.JsonRpcProvider => waffle.provider + +export const getAccounts = async (): Promise => { + const accounts: Account[] = [] + const signers: Signer[] = await ethers.getSigners() + for (const signer of signers) { + accounts.push({ signer, address: await signer.getAddress() }) + } + return accounts +} + +export const getChainID = (): Promise => { + // HACK: this fixes ganache returning always 1 when a contract calls the chainid() opcode + if (network.name == 'ganache') { + return Promise.resolve(1) + } + return provider() + .getNetwork() + .then(r => r.chainId) +} + +export const latestBlockNum = (): Promise => provider().getBlockNumber().then(toBN) +export const latestBlock = async (): Promise => provider().getBlock(await provider().getBlockNumber()) +export const latestBlockTime = async (): Promise => latestBlock().then(block => block.timestamp) + +export const advanceBlock = (): Promise => { + return provider().send('evm_mine', []) as Promise +} + +export const advanceBlockTo = async (blockNumber: string | number | BigNumber): Promise => { + const target = typeof blockNumber === 'number' || typeof blockNumber === 'string' ? toBN(blockNumber) : blockNumber + const currentBlock = await latestBlockNum() + const start = Date.now() + let notified: boolean + if (target.lt(currentBlock)) throw Error(`Target block #(${target.toString()}) is lower than current block #(${currentBlock.toString()})`) + while ((await latestBlockNum()).lt(target)) { + if (!notified && Date.now() - start >= 5000) { + notified = true + console.log(`advanceBlockTo: Advancing too ` + 'many blocks is causing this test to be slow.') + } + await advanceBlock() + } +} + +export const advanceBlocks = async (blocks: string | number | BigNumber): Promise => { + const steps = typeof blocks === 'number' || typeof blocks === 'string' ? toBN(blocks) : blocks + const currentBlock = await latestBlockNum() + const toBlock = currentBlock.add(steps) + await advanceBlockTo(toBlock) +} + +export const advanceTime = async (time: number): Promise => { + return provider().send('evm_increaseTime', [time]) as Promise +} + +export const advanceTimeAndBlock = async (time: number): Promise => { + await advanceTime(time) + await advanceBlock() + return latestBlockNum() +} + +export const evmSnapshot = async (): Promise => provider().send('evm_snapshot', []) as Promise +export const evmRevert = async (id: number): Promise => provider().send('evm_revert', [id]) as Promise diff --git a/packages/token-distribution/test/tokenLock.test.ts b/packages/token-distribution/test/tokenLock.test.ts new file mode 100644 index 000000000..5c8be9a75 --- /dev/null +++ b/packages/token-distribution/test/tokenLock.test.ts @@ -0,0 +1,771 @@ +import 'hardhat-deploy' +import { BigNumber, constants } from 'ethers' +import { deployments } from 'hardhat' +import { expect } from 'chai' + +import { GraphTokenLockSimple } from '../build/typechain/contracts/GraphTokenLockSimple' +import { GraphTokenMock } from '../build/typechain/contracts/GraphTokenMock' + +import { Account, advanceTimeAndBlock, getAccounts, getContract, toBN, toGRT } from './network' +import { createScheduleScenarios, defaultInitArgs, Revocability, TokenLockParameters } from './config' +import { DeployOptions } from 'hardhat-deploy/types' + +const { AddressZero } = constants + +// Fixture +const setupTest = deployments.createFixture(async ({ deployments }) => { + const deploy = (name: string, options: DeployOptions) => deployments.deploy(name, options) + const [deployer] = await getAccounts() + + // Start from a fresh snapshot + await deployments.fixture([]) + + // Deploy token + await deploy('GraphTokenMock', { + from: deployer.address, + args: [toGRT('1000000000'), deployer.address], + }) + const grt = await getContract('GraphTokenMock') + + // Deploy token lock + await deploy('GraphTokenLockSimple', { + from: deployer.address, + args: [], + }) + const tokenLock = await getContract('GraphTokenLockSimple') + + return { + grt: grt as GraphTokenMock, + tokenLock: tokenLock as GraphTokenLockSimple, + } +}) + +// -- Time utils -- + +const advancePeriods = async (tokenLock: GraphTokenLockSimple, n = 1) => { + const periodDuration = await tokenLock.periodDuration() + return advanceTimeAndBlock(periodDuration.mul(n).toNumber()) // advance N period +} + +const moveToTime = async (tokenLock: GraphTokenLockSimple, target: BigNumber, buffer: number) => { + const ts = await tokenLock.currentTime() + const delta = target.sub(ts).add(buffer) + return advanceTimeAndBlock(delta.toNumber()) +} + +const advanceToStart = async (tokenLock: GraphTokenLockSimple) => moveToTime(tokenLock, await tokenLock.startTime(), 60) +const advanceToEnd = async (tokenLock: GraphTokenLockSimple) => moveToTime(tokenLock, await tokenLock.endTime(), 60) +const advanceToAboutStart = async (tokenLock: GraphTokenLockSimple) => + moveToTime(tokenLock, await tokenLock.startTime(), -60) +const advanceToReleasable = async (tokenLock: GraphTokenLockSimple) => { + const values = await Promise.all([ + tokenLock.vestingCliffTime(), + tokenLock.releaseStartTime(), + tokenLock.startTime(), + ]).then(values => values.map(e => e.toNumber())) + const time = Math.max(...values) + await moveToTime(tokenLock, BigNumber.from(time), 60) +} + +const forEachPeriod = async (tokenLock: GraphTokenLockSimple, fn) => { + const periods = (await tokenLock.periods()).toNumber() + for (let currentPeriod = 1; currentPeriod <= periods + 1; currentPeriod++) { + const currentPeriod = await tokenLock.currentPeriod() + // console.log('\t ✓ period ->', currentPeriod.toString()) + await fn(currentPeriod.sub(1), currentPeriod) + await advancePeriods(tokenLock, 1) + } +} + +const shouldMatchSchedule = async (tokenLock: GraphTokenLockSimple, fnName: string, initArgs: TokenLockParameters) => { + await forEachPeriod(tokenLock, async function (passedPeriods: BigNumber) { + const amount = (await tokenLock.functions[fnName]())[0] + const amountPerPeriod = await tokenLock.amountPerPeriod() + const managedAmount = await tokenLock.managedAmount() + + // console.log(`\t - amount: ${formatGRT(amount)}/${formatGRT(managedAmount)}`) + + // After last period we expect to have all managed tokens available + const expectedAmount = passedPeriods.lt(initArgs.periods) ? passedPeriods.mul(amountPerPeriod) : managedAmount + expect(amount).eq(expectedAmount) + }) +} + +// -- Tests -- + +describe('GraphTokenLockSimple', () => { + let deployer: Account + let beneficiary1: Account + let beneficiary2: Account + + let grt: GraphTokenMock + let tokenLock: GraphTokenLockSimple + + let initArgs: TokenLockParameters + + const initWithArgs = (args: TokenLockParameters) => { + return tokenLock + .connect(deployer.signer) + .initialize( + args.owner, + args.beneficiary, + args.token, + args.managedAmount, + args.startTime, + args.endTime, + args.periods, + args.releaseStartTime, + args.vestingCliffTime, + args.revocable, + ) + } + + const fundContract = async (contract: GraphTokenLockSimple) => { + const managedAmount = await contract.managedAmount() + await grt.connect(deployer.signer).transfer(contract.address, managedAmount) + } + + before(async function () { + [deployer, beneficiary1, beneficiary2] = await getAccounts() + }) + + describe('Init', function () { + it('Reject initialize with non-set revocability option', async function () { + ({ grt, tokenLock } = await setupTest()) + + const args = defaultInitArgs(deployer, beneficiary1, grt, toGRT('1000')) + const tx = tokenLock + .connect(deployer.signer) + .initialize( + args.owner, + args.beneficiary, + args.token, + args.managedAmount, + args.startTime, + args.endTime, + args.periods, + 0, + 0, + Revocability.NotSet, + ) + await expect(tx).revertedWith('Must set a revocability option') + }) + }) + + createScheduleScenarios().forEach(function (schedule) { + describe('> Test scenario', function () { + beforeEach(async function () { + ({ grt, tokenLock } = await setupTest()) + + const staticArgs = { + owner: deployer.address, + beneficiary: beneficiary1.address, + token: grt.address, + managedAmount: toGRT('35000000'), + } + initArgs = { ...staticArgs, ...schedule } + await initWithArgs(initArgs) + + // Move time to just before the contract starts + await advanceToAboutStart(tokenLock) + }) + + describe('Init', function () { + it('reject re-initialization', async function () { + const tx = initWithArgs(initArgs) + await expect(tx).revertedWith('Already initialized') + }) + + it('should be each parameter initialized properly', async function () { + console.log('\t>> Scenario ', JSON.stringify(schedule)) + + expect(await tokenLock.beneficiary()).eq(initArgs.beneficiary) + expect(await tokenLock.managedAmount()).eq(initArgs.managedAmount) + expect(await tokenLock.startTime()).eq(initArgs.startTime) + expect(await tokenLock.endTime()).eq(initArgs.endTime) + expect(await tokenLock.periods()).eq(initArgs.periods) + expect(await tokenLock.token()).eq(initArgs.token) + expect(await tokenLock.releaseStartTime()).eq(initArgs.releaseStartTime) + expect(await tokenLock.vestingCliffTime()).eq(initArgs.vestingCliffTime) + expect(await tokenLock.revocable()).eq(initArgs.revocable) + }) + }) + + describe('Balance', function () { + describe('currentBalance()', function () { + it('should match to deposited balance', async function () { + // Before + expect(await tokenLock.currentBalance()).eq(0) + + // Transfer + const totalAmount = toGRT('100') + await grt.connect(deployer.signer).transfer(tokenLock.address, totalAmount) + + // After + expect(await tokenLock.currentBalance()).eq(totalAmount) + }) + }) + }) + + describe('Time & periods', function () { + // describe('currentTime()', function () { + // it('should return current block time', async function () { + // expect(await tokenLock.currentTime()).eq(await latestBlockTime()) + // }) + // }) + + describe('duration()', function () { + it('should match init parameters', async function () { + const duration = initArgs.endTime - initArgs.startTime + expect(await tokenLock.duration()).eq(toBN(duration)) + }) + }) + + describe('sinceStartTime()', function () { + it('should be zero if currentTime < startTime', async function () { + const now = +new Date() / 1000 + if (now < initArgs.startTime) { + expect(await tokenLock.sinceStartTime()).eq(0) + } + }) + + it('should be right amount of time elapsed', async function () { + await advanceTimeAndBlock(initArgs.startTime + 60) + + const elapsedTime = (await tokenLock.currentTime()).sub(initArgs.startTime) + expect(await tokenLock.sinceStartTime()).eq(elapsedTime) + }) + }) + + describe('amountPerPeriod()', function () { + it('should match init parameters', async function () { + const amountPerPeriod = initArgs.managedAmount.div(initArgs.periods) + expect(await tokenLock.amountPerPeriod()).eq(amountPerPeriod) + }) + }) + + describe('periodDuration()', function () { + it('should match init parameters', async function () { + const periodDuration = toBN(initArgs.endTime - initArgs.startTime).div(initArgs.periods) + expect(await tokenLock.periodDuration()).eq(periodDuration) + }) + }) + + describe('currentPeriod()', function () { + it('should be one (1) before start time', async function () { + expect(await tokenLock.currentPeriod()).eq(1) + }) + + it('should return correct amount for each period', async function () { + await advanceToStart(tokenLock) + + for (let currentPeriod = 1; currentPeriod <= initArgs.periods; currentPeriod++) { + expect(await tokenLock.currentPeriod()).eq(currentPeriod) + // console.log('\t ✓ period ->', currentPeriod) + await advancePeriods(tokenLock, 1) + } + }) + }) + + describe('passedPeriods()', function () { + it('should return correct amount for each period', async function () { + await advanceToStart(tokenLock) + + for (let currentPeriod = 1; currentPeriod <= initArgs.periods; currentPeriod++) { + expect(await tokenLock.passedPeriods()).eq(currentPeriod - 1) + // console.log('\t ✓ period ->', currentPeriod) + await advancePeriods(tokenLock, 1) + } + }) + }) + }) + + describe('Locking & release', function () { + describe('availableAmount()', function () { + it('should return zero before start time', async function () { + expect(await tokenLock.availableAmount()).eq(0) + }) + + it('should return correct amount for each period', async function () { + await advanceToStart(tokenLock) + await shouldMatchSchedule(tokenLock, 'availableAmount', initArgs) + }) + + it('should return full managed amount after end time', async function () { + await advanceToEnd(tokenLock) + + const managedAmount = await tokenLock.managedAmount() + expect(await tokenLock.availableAmount()).eq(managedAmount) + }) + }) + + describe('vestedAmount()', function () { + it('should be fully vested if non-revocable', async function () { + const revocable: Revocability = await tokenLock.revocable() + const vestedAmount = await tokenLock.vestedAmount() + if (revocable === Revocability.Disabled) { + expect(vestedAmount).eq(await tokenLock.managedAmount()) + } + }) + + it('should match the vesting schedule if revocable', async function () { + if (initArgs.revocable === Revocability.Disabled) return + + const cliffTime = await tokenLock.vestingCliffTime() + + await forEachPeriod(tokenLock, async function (passedPeriods: BigNumber) { + const amount = (await tokenLock.functions['vestedAmount']())[0] + const amountPerPeriod = await tokenLock.amountPerPeriod() + const managedAmount = await tokenLock.managedAmount() + const currentTime = await tokenLock.currentTime() + + // console.log(`\t - amount: ${formatGRT(amount)}/${formatGRT(managedAmount)}`) + + let expectedAmount = managedAmount + // Before cliff no vested tokens + if (cliffTime.gt(0) && currentTime.lt(cliffTime)) { + expectedAmount = BigNumber.from(0) + } else { + // After last period we expect to have all managed tokens available + if (passedPeriods.lt(initArgs.periods)) { + expectedAmount = passedPeriods.mul(amountPerPeriod) + } + } + expect(amount).eq(expectedAmount) + }) + }) + }) + + describe('releasableAmount()', function () { + it('should always return zero if there is no balance in the contract', async function () { + await forEachPeriod(tokenLock, async function () { + const releasableAmount = await tokenLock.releasableAmount() + expect(releasableAmount).eq(0) + }) + }) + + context('> when funded', function () { + beforeEach(async function () { + await fundContract(tokenLock) + }) + + it('should match the release schedule', async function () { + await advanceToReleasable(tokenLock) + await shouldMatchSchedule(tokenLock, 'releasableAmount', initArgs) + }) + + it('should subtract already released amount', async function () { + await advanceToReleasable(tokenLock) + + // After one period release + await advancePeriods(tokenLock, 1) + const releasableAmountPeriod1 = await tokenLock.releasableAmount() + await tokenLock.connect(beneficiary1.signer).release() + + // Next periods test that we are not counting released amount on previous period + await advancePeriods(tokenLock, 2) + const availableAmount = await tokenLock.availableAmount() + const releasableAmountPeriod2 = await tokenLock.releasableAmount() + expect(releasableAmountPeriod2).eq(availableAmount.sub(releasableAmountPeriod1)) + }) + }) + }) + + describe('totalOutstandingAmount()', function () { + it('should be the total managed amount when have not released yet', async function () { + const managedAmount = await tokenLock.managedAmount() + const totalOutstandingAmount = await tokenLock.totalOutstandingAmount() + expect(totalOutstandingAmount).eq(managedAmount) + }) + + context('when funded', function () { + beforeEach(async function () { + await fundContract(tokenLock) + }) + + it('should be the total managed when have not started', async function () { + const managedAmount = await tokenLock.managedAmount() + const totalOutstandingAmount = await tokenLock.totalOutstandingAmount() + expect(totalOutstandingAmount).eq(managedAmount) + }) + + it('should be the total managed less the already released amount', async function () { + // Setup + await advanceToReleasable(tokenLock) + await advancePeriods(tokenLock, 1) + + // Release + const amountToRelease = await tokenLock.releasableAmount() + await tokenLock.connect(beneficiary1.signer).release() + + const managedAmount = await tokenLock.managedAmount() + const totalOutstandingAmount = await tokenLock.totalOutstandingAmount() + expect(totalOutstandingAmount).eq(managedAmount.sub(amountToRelease)) + }) + + it('should be zero when all funds have been released', async function () { + // Setup + await advanceToEnd(tokenLock) + + // Release + await tokenLock.connect(beneficiary1.signer).release() + + // Test + const totalOutstandingAmount = await tokenLock.totalOutstandingAmount() + expect(totalOutstandingAmount).eq(0) + }) + }) + }) + + describe('surplusAmount()', function () { + it('should be zero when balance under outstanding amount', async function () { + // Setup + await fundContract(tokenLock) + await advanceToStart(tokenLock) + + // Test + const surplusAmount = await tokenLock.surplusAmount() + expect(surplusAmount).eq(0) + }) + + it('should return any balance over outstanding amount', async function () { + // Setup + await fundContract(tokenLock) + await advanceToReleasable(tokenLock) + await advancePeriods(tokenLock, 1) + await tokenLock.connect(beneficiary1.signer).release() + + // Send extra amount + await grt.connect(deployer.signer).transfer(tokenLock.address, toGRT('1000')) + + // Test + const surplusAmount = await tokenLock.surplusAmount() + expect(surplusAmount).eq(toGRT('1000')) + }) + }) + }) + + describe('Beneficiary admin', function () { + describe('changeBeneficiary()', function () { + it('should change beneficiary', async function () { + const tx = tokenLock.connect(beneficiary1.signer).changeBeneficiary(beneficiary2.address) + await expect(tx).emit(tokenLock, 'BeneficiaryChanged').withArgs(beneficiary2.address) + + const afterBeneficiary = await tokenLock.beneficiary() + expect(afterBeneficiary).eq(beneficiary2.address) + }) + + it('reject if beneficiary is zero', async function () { + const tx = tokenLock.connect(beneficiary1.signer).changeBeneficiary(AddressZero) + await expect(tx).revertedWith('Empty beneficiary') + }) + + it('reject if not authorized', async function () { + const tx = tokenLock.connect(deployer.signer).changeBeneficiary(beneficiary2.address) + await expect(tx).revertedWith('!auth') + }) + }) + }) + + describe('Recovery', function () { + beforeEach(async function () { + await fundContract(tokenLock) + }) + + it('should cancel lock and return funds to owner', async function () { + const beforeBalance = await grt.balanceOf(deployer.address) + const contractBalance = await grt.balanceOf(tokenLock.address) + const tx = tokenLock.connect(deployer.signer).cancelLock() + await expect(tx).emit(tokenLock, 'LockCanceled') + + const afterBalance = await grt.balanceOf(deployer.address) + const diff = afterBalance.sub(beforeBalance) + expect(diff).eq(contractBalance) + }) + + it('reject cancel lock from non-owner', async function () { + const tx = tokenLock.connect(beneficiary1.signer).cancelLock() + await expect(tx).revertedWith('Ownable: caller is not the owner') + }) + + it('should accept lock', async function () { + expect(await tokenLock.isAccepted()).eq(false) + const tx = tokenLock.connect(beneficiary1.signer).acceptLock() + await expect(tx).emit(tokenLock, 'LockAccepted') + expect(await tokenLock.isAccepted()).eq(true) + }) + + it('reject accept lock from non-beneficiary', async function () { + expect(await tokenLock.isAccepted()).eq(false) + const tx = tokenLock.connect(deployer.signer).acceptLock() + await expect(tx).revertedWith('!auth') + }) + + it('reject cancel after contract accepted', async function () { + await tokenLock.connect(beneficiary1.signer).acceptLock() + + const tx = tokenLock.connect(deployer.signer).cancelLock() + await expect(tx).revertedWith('Cannot cancel accepted contract') + }) + }) + + describe('Value transfer', function () { + async function getState(tokenLock: GraphTokenLockSimple) { + const beneficiaryAddress = await tokenLock.beneficiary() + const ownerAddress = await tokenLock.owner() + return { + beneficiaryBalance: await grt.balanceOf(beneficiaryAddress), + contractBalance: await grt.balanceOf(tokenLock.address), + ownerBalance: await grt.balanceOf(ownerAddress), + } + } + + describe('release()', function () { + it('should release the scheduled amount', async function () { + // Setup + await fundContract(tokenLock) + await advanceToReleasable(tokenLock) + await advancePeriods(tokenLock, 1) + + // Before state + const before = await getState(tokenLock) + + // Release + const amountToRelease = await tokenLock.releasableAmount() + const tx = tokenLock.connect(beneficiary1.signer).release() + await expect(tx).emit(tokenLock, 'TokensReleased').withArgs(beneficiary1.address, amountToRelease) + + // After state + const after = await getState(tokenLock) + expect(after.beneficiaryBalance).eq(before.beneficiaryBalance.add(amountToRelease)) + expect(after.contractBalance).eq(before.contractBalance.sub(amountToRelease)) + expect(await tokenLock.releasableAmount()).eq(0) + }) + + it('should release only vested amount after being revoked', async function () { + if (initArgs.revocable === Revocability.Disabled) return + + // Setup + await fundContract(tokenLock) + await advanceToStart(tokenLock) + + // Move to cliff if any + if (initArgs.vestingCliffTime) { + await moveToTime(tokenLock, await tokenLock.vestingCliffTime(), 60) + } + + // Vest some amount + await advancePeriods(tokenLock, 2) // fwd two periods + + // Owner revokes the contract + await tokenLock.connect(deployer.signer).revoke() + const vestedAmount = await tokenLock.vestedAmount() + + // Some more periods passed + await advancePeriods(tokenLock, 2) // fwd two periods + + // Release + const tx = tokenLock.connect(beneficiary1.signer).release() + await expect(tx).emit(tokenLock, 'TokensReleased').withArgs(beneficiary1.address, vestedAmount) + }) + + it('reject release vested amount before cliff', async function () { + if (initArgs.revocable === Revocability.Disabled) return + if (!initArgs.vestingCliffTime) return + + // Setup + await fundContract(tokenLock) + await advanceToStart(tokenLock) + await advancePeriods(tokenLock, 2) // fwd two periods + + // Release before cliff + const tx1 = tokenLock.connect(beneficiary1.signer).release() + await expect(tx1).revertedWith('No available releasable amount') + + // Release after cliff + await moveToTime(tokenLock, await tokenLock.vestingCliffTime(), 60) + await tokenLock.connect(beneficiary1.signer).release() + }) + + it('reject release if no funds available', async function () { + // Setup + await fundContract(tokenLock) + + // Release + const tx = tokenLock.connect(beneficiary1.signer).release() + await expect(tx).revertedWith('No available releasable amount') + }) + + it('reject release if not the beneficiary', async function () { + const tx = tokenLock.connect(beneficiary2.signer).release() + await expect(tx).revertedWith('!auth') + }) + }) + + describe('withdrawSurplus()', function () { + it('should withdraw surplus balance that is over managed amount', async function () { + // Setup + const managedAmount = await tokenLock.managedAmount() + const amountToWithdraw = toGRT('100') + const totalAmount = managedAmount.add(amountToWithdraw) + await grt.connect(deployer.signer).transfer(tokenLock.address, totalAmount) + + // Revert if trying to withdraw more than managed amount + const tx1 = tokenLock.connect(beneficiary1.signer).withdrawSurplus(amountToWithdraw.add(1)) + await expect(tx1).revertedWith('Amount requested > surplus available') + + // Before state + const before = await getState(tokenLock) + + // Should withdraw + const tx2 = tokenLock.connect(beneficiary1.signer).withdrawSurplus(amountToWithdraw) + await expect(tx2).emit(tokenLock, 'TokensWithdrawn').withArgs(beneficiary1.address, amountToWithdraw) + + // After state + const after = await getState(tokenLock) + expect(after.beneficiaryBalance).eq(before.beneficiaryBalance.add(amountToWithdraw)) + expect(after.contractBalance).eq(before.contractBalance.sub(amountToWithdraw)) + }) + + it('should withdraw surplus balance that is over managed amount (less than total available)', async function () { + // Setup + const managedAmount = await tokenLock.managedAmount() + const surplusAmount = toGRT('100') + const totalAmount = managedAmount.add(surplusAmount) + await grt.connect(deployer.signer).transfer(tokenLock.address, totalAmount) + + // Should withdraw + const tx2 = tokenLock.connect(beneficiary1.signer).withdrawSurplus(surplusAmount.sub(1)) + await expect(tx2).emit(tokenLock, 'TokensWithdrawn').withArgs(beneficiary1.address, surplusAmount.sub(1)) + }) + + it('should withdraw surplus balance even after the contract was released->revoked', async function () { + if (initArgs.revocable === Revocability.Enabled) { + // Setup + const managedAmount = await tokenLock.managedAmount() + const surplusAmount = toGRT('100') + const totalAmount = managedAmount.add(surplusAmount) + await grt.connect(deployer.signer).transfer(tokenLock.address, totalAmount) + + // Vest some amount + await advanceToReleasable(tokenLock) + await advancePeriods(tokenLock, 2) // fwd two periods + + // Release / Revoke + await tokenLock.connect(beneficiary1.signer).release() + await tokenLock.connect(deployer.signer).revoke() + + // Should withdraw + const tx2 = tokenLock.connect(beneficiary1.signer).withdrawSurplus(surplusAmount) + await expect(tx2).emit(tokenLock, 'TokensWithdrawn').withArgs(beneficiary1.address, surplusAmount) + + // Contract must have no balance after all actions + const balance = await grt.balanceOf(tokenLock.address) + expect(balance).eq(0) + } + }) + + it('should withdraw surplus balance even after the contract was revoked->released', async function () { + if (initArgs.revocable === Revocability.Enabled) { + // Setup + const managedAmount = await tokenLock.managedAmount() + const surplusAmount = toGRT('100') + const totalAmount = managedAmount.add(surplusAmount) + await grt.connect(deployer.signer).transfer(tokenLock.address, totalAmount) + + // Vest some amount + await advanceToReleasable(tokenLock) + await advancePeriods(tokenLock, 2) // fwd two periods + + // Release / Revoke + await tokenLock.connect(deployer.signer).revoke() + await tokenLock.connect(beneficiary1.signer).release() + + // Should withdraw + const tx2 = tokenLock.connect(beneficiary1.signer).withdrawSurplus(surplusAmount) + await expect(tx2).emit(tokenLock, 'TokensWithdrawn').withArgs(beneficiary1.address, surplusAmount) + + // Contract must have no balance after all actions + const balance = await grt.balanceOf(tokenLock.address) + expect(balance).eq(0) + } + }) + + it('reject withdraw if not the beneficiary', async function () { + await grt.connect(deployer.signer).transfer(tokenLock.address, toGRT('100')) + + const tx = tokenLock.connect(beneficiary2.signer).withdrawSurplus(toGRT('100')) + await expect(tx).revertedWith('!auth') + }) + + it('reject withdraw zero tokens', async function () { + const tx = tokenLock.connect(beneficiary1.signer).withdrawSurplus(toGRT('0')) + await expect(tx).revertedWith('Amount cannot be zero') + }) + + it('reject withdraw more than available funds', async function () { + const tx = tokenLock.connect(beneficiary1.signer).withdrawSurplus(toGRT('100')) + await expect(tx).revertedWith('Amount requested > surplus available') + }) + }) + + describe('revoke()', function () { + beforeEach(async function () { + await fundContract(tokenLock) + await advanceToStart(tokenLock) + }) + + it('should revoke and get funds back to owner', async function () { + if (initArgs.revocable === Revocability.Enabled) { + // Before state + const before = await getState(tokenLock) + + // Revoke + const beneficiaryAddress = await tokenLock.beneficiary() + const vestedAmount = await tokenLock.vestedAmount() + const managedAmount = await tokenLock.managedAmount() + const unvestedAmount = managedAmount.sub(vestedAmount) + const tx = tokenLock.connect(deployer.signer).revoke() + await expect(tx).emit(tokenLock, 'TokensRevoked').withArgs(beneficiaryAddress, unvestedAmount) + + // After state + const after = await getState(tokenLock) + expect(after.ownerBalance).eq(before.ownerBalance.add(unvestedAmount)) + } + }) + + it('reject revoke multiple times', async function () { + if (initArgs.revocable === Revocability.Enabled) { + await tokenLock.connect(deployer.signer).revoke() + const tx = tokenLock.connect(deployer.signer).revoke() + await expect(tx).revertedWith('Already revoked') + } + }) + + it('reject revoke if not authorized', async function () { + const tx = tokenLock.connect(beneficiary1.signer).revoke() + await expect(tx).revertedWith('Ownable: caller is not the owner') + }) + + it('reject revoke if not revocable', async function () { + if (initArgs.revocable === Revocability.Disabled) { + const tx = tokenLock.connect(deployer.signer).revoke() + await expect(tx).revertedWith('Contract is non-revocable') + } + }) + + it('reject revoke if no available unvested amount', async function () { + if (initArgs.revocable === Revocability.Enabled) { + // Setup + await advanceToEnd(tokenLock) + + // Try to revoke after all tokens have been vested + const tx = tokenLock.connect(deployer.signer).revoke() + await expect(tx).revertedWith('No available unvested amount') + } + }) + }) + }) + }) + }) +}) diff --git a/packages/token-distribution/test/tokenLockWallet.test.ts b/packages/token-distribution/test/tokenLockWallet.test.ts new file mode 100644 index 000000000..d2b64afdb --- /dev/null +++ b/packages/token-distribution/test/tokenLockWallet.test.ts @@ -0,0 +1,362 @@ +import { BigNumber, constants, Wallet } from 'ethers' +import { deployments, ethers } from 'hardhat' +import { expect } from 'chai' + +import '@nomiclabs/hardhat-ethers' +import 'hardhat-deploy' + +import { GraphTokenLockManager } from '../build/typechain/contracts/GraphTokenLockManager' +import { GraphTokenLockWallet } from '../build/typechain/contracts/GraphTokenLockWallet' +import { GraphTokenMock } from '../build/typechain/contracts/GraphTokenMock' +import { StakingMock } from '../build/typechain/contracts/StakingMock' + +import { Staking__factory } from '@graphprotocol/contracts/dist/types/factories/Staking__factory' + +import { Account, advanceBlocks, advanceTimeAndBlock, getAccounts, getContract, randomHexBytes, toGRT } from './network' +import { defaultInitArgs, Revocability, TokenLockParameters } from './config' +import { DeployOptions } from 'hardhat-deploy/types' + +const { AddressZero, MaxUint256 } = constants + +// -- Time utils -- + +const advancePeriods = async (tokenLock: GraphTokenLockWallet, n = 1) => { + const periodDuration = await tokenLock.periodDuration() + return advanceTimeAndBlock(periodDuration.mul(n).toNumber()) // advance N period +} +const advanceToStart = async (tokenLock: GraphTokenLockWallet) => moveToTime(tokenLock, await tokenLock.startTime(), 60) +const moveToTime = async (tokenLock: GraphTokenLockWallet, target: BigNumber, buffer: number) => { + const ts = await tokenLock.currentTime() + const delta = target.sub(ts).add(buffer) + return advanceTimeAndBlock(delta.toNumber()) +} + +// Fixture +const setupTest = deployments.createFixture(async ({ deployments }) => { + const deploy = (name: string, options: DeployOptions) => deployments.deploy(name, options) + const [deployer] = await getAccounts() + + // Start from a fresh snapshot + await deployments.fixture([]) + + // Deploy token + await deploy('GraphTokenMock', { + from: deployer.address, + args: [toGRT('1000000000'), deployer.address], + }) + const grt = await getContract('GraphTokenMock') + + // Deploy token lock masterCopy + await deploy('GraphTokenLockWallet', { + from: deployer.address, + }) + const tokenLockWallet = await getContract('GraphTokenLockWallet') + + // Deploy token lock manager + await deploy('GraphTokenLockManager', { + from: deployer.address, + args: [grt.address, tokenLockWallet.address], + }) + const tokenLockManager = await getContract('GraphTokenLockManager') + + // Protocol contracts + await deployments.deploy('StakingMock', { from: deployer.address, args: [grt.address] }) + const staking = await getContract('StakingMock') + + // Fund the manager contract + await grt.connect(deployer.signer).transfer(tokenLockManager.address, toGRT('100000000')) + + return { + grt: grt as GraphTokenMock, + staking: staking as StakingMock, + // tokenLock: tokenLockWallet as GraphTokenLockWallet, + tokenLockManager: tokenLockManager as GraphTokenLockManager, + } +}) + +async function authProtocolFunctions(tokenLockManager: GraphTokenLockManager, stakingAddress: string) { + await tokenLockManager.setAuthFunctionCall('stake(uint256)', stakingAddress) + await tokenLockManager.setAuthFunctionCall('unstake(uint256)', stakingAddress) + await tokenLockManager.setAuthFunctionCall('withdraw()', stakingAddress) +} + +// -- Tests -- + +describe('GraphTokenLockWallet', () => { + let deployer: Account + let beneficiary: Account + let hacker: Account + + let grt: GraphTokenMock + let tokenLock: GraphTokenLockWallet + let tokenLockManager: GraphTokenLockManager + let staking: StakingMock + + let initArgs: TokenLockParameters + + const initWithArgs = async (args: TokenLockParameters): Promise => { + const tx = await tokenLockManager.createTokenLockWallet( + args.owner, + args.beneficiary, + args.managedAmount, + args.startTime, + args.endTime, + args.periods, + args.releaseStartTime, + args.vestingCliffTime, + args.revocable, + ) + const receipt = await tx.wait() + const contractAddress = receipt.events[0].args['proxy'] + return ethers.getContractAt('GraphTokenLockWallet', contractAddress) as Promise + } + + before(async function () { + [deployer, beneficiary, hacker] = await getAccounts() + }) + + beforeEach(async () => { + ({ grt, tokenLockManager, staking } = await setupTest()) + + // Setup authorized functions in Manager + await authProtocolFunctions(tokenLockManager, staking.address) + + initArgs = defaultInitArgs(deployer, beneficiary, grt, toGRT('35000000')) + tokenLock = await initWithArgs(initArgs) + }) + + describe('Init', function () { + it('should bubble up revert reasons on create', async function () { + initArgs = defaultInitArgs(deployer, beneficiary, grt, toGRT('35000000')) + const tx = initWithArgs({ ...initArgs, endTime: 0 }) + await expect(tx).revertedWith('Start time > end time') + }) + + // it('reject re-initialization', async function () { + // const tx = initWithArgs(initArgs) + // await expect(tx).revertedWith('Already initialized') + // }) + }) + + describe('TokenLockManager', function () { + it('revert if init with empty token', async function () { + const deploy = (name: string, options: DeployOptions) => deployments.deploy(name, options) + + const d = deploy('GraphTokenLockManager', { + from: deployer.address, + args: [AddressZero, Wallet.createRandom().address], + }) + await expect(d).revertedWith('Token cannot be zero') + }) + + it('should set the master copy', async function () { + const address = Wallet.createRandom().address + const tx = tokenLockManager.setMasterCopy(address) + await expect(tx).emit(tokenLockManager, 'MasterCopyUpdated').withArgs(address) + }) + + it('revert set the master copy to zero address', async function () { + const tx = tokenLockManager.setMasterCopy(AddressZero) + await expect(tx).revertedWith('MasterCopy cannot be zero') + }) + + it('should add a token destination', async function () { + const address = Wallet.createRandom().address + + expect(await tokenLockManager.isTokenDestination(address)).eq(false) + const tx = tokenLockManager.addTokenDestination(address) + await expect(tx).emit(tokenLockManager, 'TokenDestinationAllowed').withArgs(address, true) + expect(await tokenLockManager.isTokenDestination(address)).eq(true) + }) + + it('revert add a token destination with zero address', async function () { + const tx = tokenLockManager.addTokenDestination(AddressZero) + await expect(tx).revertedWith('Destination cannot be zero') + }) + }) + + describe('Admin wallet', function () { + it('should set manager', async function () { + // Note: we use GRT contract here just to provide a different contract + const oldManager = await tokenLock.manager() + const tx = tokenLock.connect(deployer.signer).setManager(grt.address) + await expect(tx).emit(tokenLock, 'ManagerUpdated').withArgs(oldManager, grt.address) + expect(await tokenLock.manager()).eq(grt.address) + }) + + it('reject set manager to a non-contract', async function () { + const newAddress = randomHexBytes(20) + const tx = tokenLock.connect(deployer.signer).setManager(newAddress) + await expect(tx).revertedWith('Manager must be a contract') + }) + + it('reject set manager to empty address', async function () { + const tx = tokenLock.connect(deployer.signer).setManager(AddressZero) + await expect(tx).revertedWith('Manager cannot be empty') + }) + }) + + describe('Enabling protocol', function () { + beforeEach(async function () { + await tokenLockManager.addTokenDestination(staking.address) + }) + + it('should approve protocol contracts', async function () { + const tx = tokenLock.connect(beneficiary.signer).approveProtocol() + await expect(tx).emit(grt, 'Approval').withArgs(tokenLock.address, staking.address, MaxUint256) + }) + + it('should revoke protocol contracts', async function () { + const tx = tokenLock.connect(beneficiary.signer).revokeProtocol() + await expect(tx).emit(grt, 'Approval').withArgs(tokenLock.address, staking.address, 0) + }) + + it('reject approve and revoke if not the beneficiary', async function () { + const tx1 = tokenLock.connect(deployer.signer).approveProtocol() + await expect(tx1).revertedWith('!auth') + + const tx2 = tokenLock.connect(deployer.signer).revokeProtocol() + await expect(tx2).revertedWith('!auth') + }) + }) + + describe('Function call forwarding', function () { + let lockAsStaking + + beforeEach(async () => { + // Use the tokenLock contract as if it were the Staking contract + lockAsStaking = Staking__factory.connect(tokenLock.address, deployer.signer) + + // Add the staking contract as token destination + await tokenLockManager.addTokenDestination(staking.address) + + // Approve contracts to pull tokens from the token lock + await tokenLock.connect(beneficiary.signer).approveProtocol() + }) + + it('should call an authorized function (stake)', async function () { + // Before state + const beforeLockBalance = await grt.balanceOf(lockAsStaking.address) + + // Stake must work and the deposit address must be the one of the lock contract + const stakeAmount = toGRT('100') + const tx = lockAsStaking.connect(beneficiary.signer).stake(stakeAmount) + await expect(tx).emit(staking, 'StakeDeposited').withArgs(tokenLock.address, stakeAmount) + + // After state + const afterLockBalance = await grt.balanceOf(lockAsStaking.address) + expect(afterLockBalance).eq(beforeLockBalance.sub(stakeAmount)) + }) + + it('should bubble up revert reasons for forwarded calls', async function () { + // Force a failing call + const tx = lockAsStaking.connect(beneficiary.signer).stake(toGRT('0')) + await expect(tx).revertedWith('!tokens') + }) + + it('reject a function call from other than the beneficiary', async function () { + // Send a function call from an unauthorized caller + const stakeAmount = toGRT('100') + const tx = lockAsStaking.connect(hacker.signer).stake(stakeAmount) + await expect(tx).revertedWith('Unauthorized caller') + }) + + it('reject a function call that is not authorized', async function () { + // Send a function call that is not authorized in the TokenLockManager + const tx = lockAsStaking.connect(beneficiary.signer).setController(randomHexBytes(20)) + await expect(tx).revertedWith('Unauthorized function') + }) + }) + + describe('Revokability, Call Forwarding and Used Tokens', function () { + let lockAsStaking + + beforeEach(async () => { + // Deploy a revocable contract with 6 periods, 1 per month + initArgs = defaultInitArgs(deployer, beneficiary, grt, toGRT('10000000')) + tokenLock = await initWithArgs({ ...initArgs, periods: 6, revocable: Revocability.Enabled }) + + // Use the tokenLock contract as if it were the Staking contract + lockAsStaking = Staking__factory.connect(tokenLock.address, deployer.signer) + + // Add the staking contract as token destination + await tokenLockManager.addTokenDestination(staking.address) + + // Approve contracts to pull tokens from the token lock + await tokenLock.connect(beneficiary.signer).approveProtocol() + }) + + it('reject using more than vested amount in the protocol', async function () { + await advanceToStart(tokenLock) + + // At this point no period has passed so we haven't vested any token + // Try to stake funds into the protocol should fail + const stakeAmount = toGRT('100') + const tx = lockAsStaking.connect(beneficiary.signer).stake(stakeAmount) + await expect(tx).revertedWith('Cannot use more tokens than vested amount') + }) + + it('should release considering what is used in the protocol', async function () { + // Move to have some vested periods + await advanceToStart(tokenLock) + await advancePeriods(tokenLock, 2) + + // Get amount that can be released with no used tokens yet + const releasableAmount = await tokenLock.releasableAmount() + + // Use tokens in the protocol + const stakeAmount = toGRT('100') + await lockAsStaking.connect(beneficiary.signer).stake(stakeAmount) + + // Release - should take into account used tokens + const tx = await tokenLock.connect(beneficiary.signer).release() + await expect(tx) + .emit(tokenLock, 'TokensReleased') + .withArgs(beneficiary.address, releasableAmount.sub(stakeAmount)) + + // Revoke should work + await tokenLock.connect(deployer.signer).revoke() + }) + + it('should release considering what is used in the protocol (even if most is used)', async function () { + // Move to have some vested periods + await advanceToStart(tokenLock) + await advancePeriods(tokenLock, 2) + + // Get amount that can be released with no used tokens yet + const releasableAmount = await tokenLock.releasableAmount() + + // Use tokens in the protocol + const stakeAmount = (await tokenLock.availableAmount()).sub(toGRT('1')) + await lockAsStaking.connect(beneficiary.signer).stake(stakeAmount) + + // Release - should take into account used tokens + const tx = await tokenLock.connect(beneficiary.signer).release() + await expect(tx) + .emit(tokenLock, 'TokensReleased') + .withArgs(beneficiary.address, releasableAmount.sub(stakeAmount)) + + // Revoke should work + await tokenLock.connect(deployer.signer).revoke() + }) + + it('should allow to get profit from the protocol', async function () { + await advanceToStart(tokenLock) + await advancePeriods(tokenLock, 1) + + // At this point we vested one period, we have tokens + // Stake funds into the protocol + const stakeAmount = toGRT('100') + await lockAsStaking.connect(beneficiary.signer).stake(stakeAmount) + + // Simulate having a profit + await grt.approve(staking.address, toGRT('1000000')) + await staking.stakeTo(lockAsStaking.address, toGRT('1000000')) + + // Unstake more than we used in the protocol, this should work! + await lockAsStaking.connect(beneficiary.signer).unstake(toGRT('1000000')) + await advanceBlocks(20) + await lockAsStaking.connect(beneficiary.signer).withdraw() + }) + }) +}) diff --git a/packages/token-distribution/tsconfig.json b/packages/token-distribution/tsconfig.json new file mode 100644 index 000000000..ba8d0153c --- /dev/null +++ b/packages/token-distribution/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "lib": ["ES2020", "dom"], + "module": "commonjs", + "moduleResolution": "node", + "target": "ES2020", + "outDir": "dist", + "resolveJsonModule": true, + "esModuleInterop": true + }, + "exclude": ["dist", "node_modules"], + "include": [ + ".solcover.js", + "eslint.config.js", + "prettier.config.js", + "./hardhat.config.ts", + "./scripts/**/*.ts", + "./deploy/**/*.ts", + "./test/**/*.ts", + "node_modules/@nomiclabs/hardhat-ethers/src/type-extensions.d.ts", + "node_modules/@nomiclabs/hardhat-etherscan/src/type-extensions.d.ts", + "node_modules/@nomiclabs/hardhat-waffle/src/type-extensions.d.ts", + "node_modules/hardhat-typechain/src/type-extensions.d.ts" + ] +} diff --git a/packages/toolshed/CHANGELOG.md b/packages/toolshed/CHANGELOG.md new file mode 100644 index 000000000..4402687c3 --- /dev/null +++ b/packages/toolshed/CHANGELOG.md @@ -0,0 +1,187 @@ +# @graphprotocol/toolshed + +## 0.5.4 + +### Patch Changes + +- Fix type issue with GNS + - @graphprotocol/horizon@0.3.3 + - @graphprotocol/subgraph-service@0.3.5 + +## 0.5.3 + +### Patch Changes + +- Add encodeStopServiceData helper + - @graphprotocol/horizon@0.3.3 + - @graphprotocol/subgraph-service@0.3.5 + +## 0.5.1 + +### Patch Changes + +- Add GNS to deployments +- Updated dependencies + - @graphprotocol/subgraph-service@0.3.5 + - @graphprotocol/horizon@0.3.3 + +## 0.5.0 + +### Minor Changes + +- Ensure toolshed core components dont import hardhat runtime + +### Patch Changes + +- @graphprotocol/horizon@0.3.2 +- @graphprotocol/subgraph-service@0.3.4 + +## 0.4.2 + +### Patch Changes + +- Ensure all contracts are not wrapped when using connect shortcuts + - @graphprotocol/horizon@0.3.2 + - @graphprotocol/subgraph-service@0.3.4 + +## 0.4.1 + +### Patch Changes + +- Build before publishing + - @graphprotocol/horizon@0.3.2 + - @graphprotocol/subgraph-service@0.3.4 + +## 0.4.0 + +### Minor Changes + +- Make transaction logging optional, default to false for connect methods + +### Patch Changes + +- @graphprotocol/horizon@0.3.2 +- @graphprotocol/subgraph-service@0.3.4 + +## 0.3.2 + +### Patch Changes + +- Fix package exports + - @graphprotocol/horizon@0.3.2 + - @graphprotocol/subgraph-service@0.3.4 + +## 0.3.1 + +### Patch Changes + +- chore: fix package visibility +- Updated dependencies + - @graphprotocol/subgraph-service@0.3.4 + - @graphprotocol/contracts@7.1.2 + - @graphprotocol/horizon@0.3.2 + +## 0.3.0 + +### Minor Changes + +- Proper path resolution for contract artifacts + +### Patch Changes + +- @graphprotocol/horizon@0.3.1 +- @graphprotocol/subgraph-service@0.3.3 + +## 0.2.6 + +### Patch Changes + +- Updated dependencies + - @graphprotocol/subgraph-service@0.3.3 + - @graphprotocol/horizon@0.3.1 + +## 0.2.5 + +### Patch Changes + +- Fix IServiceRegistry import in subgraph service toolshed deployment +- Updated dependencies + - @graphprotocol/subgraph-service@0.3.2 + - @graphprotocol/contracts@7.1.1 + - @graphprotocol/horizon@0.3.1 + +## 0.2.4 + +### Patch Changes + +- Updated dependencies + - @graphprotocol/contracts@7.1.0 + - @graphprotocol/horizon@0.3.1 + - @graphprotocol/subgraph-service@0.3.1 + +## 0.2.3 + +### Patch Changes + +- Use proper types for Curation contract, add epochLength to EpochManager import in Horizon. +- Updated dependencies + - @graphprotocol/subgraph-service@0.3.1 + - @graphprotocol/horizon@0.3.1 + +## 0.2.2 + +### Patch Changes + +- Updated dependencies + - @graphprotocol/subgraph-service@0.3.0 + - @graphprotocol/horizon@0.3.0 + +## 0.2.1 + +### Patch Changes + +- Pin ethers version +- Updated dependencies + - @graphprotocol/subgraph-service@0.2.1 + - @graphprotocol/horizon@0.2.1 + +## 0.2.0 + +### Minor Changes + +- Add connectContracts utility functions to deployments + +### Patch Changes + +- @graphprotocol/horizon@0.2.0 +- @graphprotocol/subgraph-service@0.2.0 + +## 0.1.2 + +### Patch Changes + +- 585cf27: Allow loading empty address books for subgraph service +- Updated dependencies + - @graphprotocol/subgraph-service@0.2.0 + - @graphprotocol/horizon@0.2.0 + +## 0.1.1 + +### Patch Changes + +- Publish fork 1 deployment +- Updated dependencies + - @graphprotocol/subgraph-service@0.1.1 + - @graphprotocol/horizon@0.1.1 + +## 0.1.0 + +### Minor Changes + +- Publish initial dev versions + +### Patch Changes + +- Updated dependencies + - @graphprotocol/subgraph-service@0.1.0 + - @graphprotocol/horizon@0.1.0 diff --git a/packages/toolshed/README.md b/packages/toolshed/README.md new file mode 100644 index 000000000..c4a0eaabb --- /dev/null +++ b/packages/toolshed/README.md @@ -0,0 +1,34 @@ +# @graphprotocol/toolshed + +A collection of tools and utilities for The Graph Protocol's TypeScript components. This package provides essential functionality for working with The Graph Protocol's smart contracts, deployments, and development tools. + +## Features + +- **Core**: Essential tools and functions for working with The Graph Protocol +- **Deployment Tools**: Utilities for interacting with protocol deployments +- **Hardhat Integration**: Tools and plugins for Hardhat development +- **Utility Functions**: Helper functions for common operations + +## Installation + +```bash +pnpm add @graphprotocol/toolshed +``` + +## Usage + +The package is organized into several modules that can be imported separately: + +```typescript +// Import core functionality +import { generateAllocationProof } from '@graphprotocol/toolshed'; + +// Import deployment +import { loadGraphHorizon } from '@graphprotocol/toolshed/deployments/horizon'; + +// Import Hardhat utilities +import { hardhatBaseConfig } from '@graphprotocol/toolshed/hardhat'; + +// Import utility functions +import { printBanner } from '@graphprotocol/toolshed/utils'; +``` \ No newline at end of file diff --git a/packages/toolshed/eslint.config.js b/packages/toolshed/eslint.config.js new file mode 100644 index 000000000..cf12d9860 --- /dev/null +++ b/packages/toolshed/eslint.config.js @@ -0,0 +1,3 @@ +// eslint-disable-next-line @typescript-eslint/no-var-requires +const config = require('eslint-graph-config') +module.exports = config.default diff --git a/packages/toolshed/package.json b/packages/toolshed/package.json new file mode 100644 index 000000000..f76dbc79c --- /dev/null +++ b/packages/toolshed/package.json @@ -0,0 +1,64 @@ +{ + "name": "@graphprotocol/toolshed", + "version": "0.5.4", + "publishConfig": { + "access": "public" + }, + "description": "A collection of tools and utilities for the Graph Protocol Typescript components", + "author": "Tomás Migone ", + "license": "MIT", + "main": "./dist/core/index.js", + "types": "./dist/core/index.d.ts", + "exports": { + ".": { + "types": "./dist/core/index.d.ts", + "default": "./dist/core/index.js" + }, + "./deployments": { + "types": "./dist/deployments/index.d.ts", + "default": "./dist/deployments/index.js" + }, + "./hardhat": { + "types": "./src/hardhat/index.ts", + "default": "./src/hardhat/index.ts" + }, + "./utils": { + "types": "./dist/utils/index.d.ts", + "default": "./dist/utils/index.js" + } + }, + "scripts": { + "build": "tsc", + "watch": "tsc --watch", + "prepublishOnly": "tsc", + "lint": "eslint '**/*.{js,ts}' --fix", + "clean": "rm -rf dist" + }, + "keywords": [ + "ethereum", + "smart-contracts", + "hardhat", + "hardhat-plugin", + "graph", + "graph-protocol", + "horizon" + ], + "dependencies": { + "@graphprotocol/contracts": "workspace:^", + "@graphprotocol/horizon": "workspace:^", + "@graphprotocol/subgraph-service": "workspace:^", + "@nomicfoundation/hardhat-ethers": "3.0.8", + "debug": "^4.4.0", + "ethers": "6.13.7", + "glob": "^11.0.1", + "hardhat": "^2.22.16", + "json5": "^2.2.3" + }, + "devDependencies": { + "@types/debug": "^4.1.12", + "@types/json5": "^2.2.0", + "eslint": "^8.56.0", + "eslint-graph-config": "workspace:^", + "typescript": "^5.0.0" + } +} \ No newline at end of file diff --git a/packages/toolshed/src/core/abi.ts b/packages/toolshed/src/core/abi.ts new file mode 100644 index 000000000..f90664ee7 --- /dev/null +++ b/packages/toolshed/src/core/abi.ts @@ -0,0 +1,12 @@ +/* eslint-disable @typescript-eslint/no-unsafe-member-access */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +export function mergeABIs(abi1: any[], abi2: any[]) { + for (const item of abi2) { + if (abi1.find(v => v.name === item.name) === undefined) { + abi1.push(item) + } + } + + // eslint-disable-next-line @typescript-eslint/no-unsafe-return + return abi1 +} diff --git a/packages/toolshed/src/core/accounts.ts b/packages/toolshed/src/core/accounts.ts new file mode 100644 index 000000000..ab6b0b3e6 --- /dev/null +++ b/packages/toolshed/src/core/accounts.ts @@ -0,0 +1,83 @@ +import type { HardhatEthersProvider } from '@nomicfoundation/hardhat-ethers/internal/hardhat-ethers-provider' +import type { HardhatEthersSigner } from '@nomicfoundation/hardhat-ethers/signers' + +// The Graph convention for account derivation is: +// 0: Deployer +// 1: Governor +// 2: Arbitrator +// 3: Pause guardian +// 4: Subgraph Availability Oracle +// 5: Gateway/payer +// 6+: Test accounts + +enum GraphAccountIndex { + Deployer = 0, + Governor = 1, + Arbitrator = 2, + PauseGuardian = 3, + SubgraphAvailabilityOracle = 4, + Gateway = 5, +} + +export type GraphAccounts = { + deployer: HardhatEthersSigner + governor: HardhatEthersSigner + arbitrator: HardhatEthersSigner + pauseGuardian: HardhatEthersSigner + subgraphAvailabilityOracle: HardhatEthersSigner + gateway: HardhatEthersSigner + test: HardhatEthersSigner[] +} + +export async function getAccounts(provider: HardhatEthersProvider): Promise { + return { + deployer: await getDeployer(provider, GraphAccountIndex.Deployer), + governor: await getGovernor(provider, GraphAccountIndex.Governor), + arbitrator: await getArbitrator(provider, GraphAccountIndex.Arbitrator), + pauseGuardian: await getPauseGuardian(provider, GraphAccountIndex.PauseGuardian), + subgraphAvailabilityOracle: await getSubgraphAvailabilityOracle(provider, GraphAccountIndex.SubgraphAvailabilityOracle), + gateway: await getGateway(provider, GraphAccountIndex.Gateway), + test: await getTestAccounts(provider), + } +} + +export async function getDeployer(provider: HardhatEthersProvider, accountIndex = GraphAccountIndex.Deployer) { + return _getAccount(provider, accountIndex) +} + +export async function getGovernor(provider: HardhatEthersProvider, accountIndex = GraphAccountIndex.Governor) { + return _getAccount(provider, accountIndex) +} + +export async function getArbitrator(provider: HardhatEthersProvider, accountIndex = GraphAccountIndex.Arbitrator) { + return _getAccount(provider, accountIndex) +} + +export async function getPauseGuardian(provider: HardhatEthersProvider, accountIndex = GraphAccountIndex.PauseGuardian) { + return _getAccount(provider, accountIndex) +} + +export async function getSubgraphAvailabilityOracle(provider: HardhatEthersProvider, accountIndex = GraphAccountIndex.SubgraphAvailabilityOracle) { + return _getAccount(provider, accountIndex) +} + +export async function getGateway(provider: HardhatEthersProvider, accountIndex = GraphAccountIndex.Gateway) { + return _getAccount(provider, accountIndex) +} + +export async function getTestAccounts(provider: HardhatEthersProvider) { + const accounts = await provider.send('eth_accounts', []) as string[] + const numReservedAccounts = Object.values(GraphAccountIndex).filter(v => typeof v === 'number').length + if (accounts.length < numReservedAccounts) { + return [] + } + return await Promise.all( + accounts + .slice(numReservedAccounts) + .map(async account => await _getAccount(provider, account)), + ) +} + +async function _getAccount(provider: HardhatEthersProvider, accountIndex: number | string) { + return await provider.getSigner(accountIndex) +} diff --git a/packages/toolshed/src/core/allocation.ts b/packages/toolshed/src/core/allocation.ts new file mode 100644 index 000000000..28bb45e4e --- /dev/null +++ b/packages/toolshed/src/core/allocation.ts @@ -0,0 +1,48 @@ +import { ethers, id } from 'ethers' +import { randomHexBytes } from '../lib/bytes' + +// For legacy allocations in the staking contract +export async function generateLegacyAllocationProof(indexerAddress: string, allocationPrivateKey: string) { + const wallet = new ethers.Wallet(allocationPrivateKey) + const messageHash = ethers.solidityPackedKeccak256( + ['address', 'address'], + [indexerAddress, wallet.address], + ) + const messageHashBytes = ethers.getBytes(messageHash) + return wallet.signMessage(messageHashBytes) +} + +export const EIP712_ALLOCATION_PROOF_TYPEHASH = id('AllocationIdProof(address indexer,address allocationId)') + +export const EIP712_ALLOCATION_ID_PROOF_TYPES = { + AllocationIdProof: [ + { name: 'indexer', type: 'address' }, + { name: 'allocationId', type: 'address' }, + ], +} + +// For new allocations in the subgraph service +export async function generateAllocationProof( + indexerAddress: string, + allocationPrivateKey: string, + subgraphServiceAddress: string, + chainId: number, +) { + const wallet = new ethers.Wallet(allocationPrivateKey) + + const domain = { + name: 'SubgraphService', + version: '1.0', + chainId: chainId, + verifyingContract: subgraphServiceAddress, + } + + return wallet.signTypedData(domain, EIP712_ALLOCATION_ID_PROOF_TYPES, { + indexer: indexerAddress, + allocationId: wallet.address, + }) +} + +export function randomAllocationMetadata() { + return randomHexBytes(32) +} diff --git a/packages/toolshed/src/core/attestations.ts b/packages/toolshed/src/core/attestations.ts new file mode 100644 index 000000000..7f50c8846 --- /dev/null +++ b/packages/toolshed/src/core/attestations.ts @@ -0,0 +1,62 @@ +import { ethers, id, Wallet } from 'ethers' + +export const EIP712_DISPUTE_MANAGER_DOMAIN_SALT = ethers.getBytes('0xa070ffb1cd7409649bf77822cce74495468e06dbfaef09556838bf188679b9c2') + +export const EIP712_ATTESTATION_PROOF_TYPEHASH = id('Receipt(bytes32 requestCID,bytes32 responseCID,bytes32 subgraphDeploymentID)') +export const EIP712_ATTESTATION_PROOF_TYPES = { + Receipt: [ + { name: 'requestCID', type: 'bytes32' }, + { name: 'responseCID', type: 'bytes32' }, + { name: 'subgraphDeploymentID', type: 'bytes32' }, + ], +} + +/** + * Creates an attestation data for a given request and response CIDs. + * @param requestCID The request CID. + * @param responseCID The response CID. + * @param signerPrivateKey The private key of the signer. + * @param subgraphDeploymentId The subgraph deployment ID. + * @param disputeManagerAddress The address of the dispute manager contract. + * @param chainId The chain ID. + * @returns The attestation data. + */ +export async function generateAttestationData( + requestCID: string, + responseCID: string, + subgraphDeploymentId: string, + signerPrivateKey: string, + disputeManagerAddress: string, + chainId: number, +): Promise { + // Create the domain for the EIP712 signature + const domain = { + name: 'Graph Protocol', + version: '0', + chainId: chainId, + verifyingContract: disputeManagerAddress, + salt: EIP712_DISPUTE_MANAGER_DOMAIN_SALT, + } + + // Create receipt struct + const receipt = { + requestCID: ethers.hexlify(ethers.getBytes(requestCID)), + responseCID: ethers.hexlify(ethers.getBytes(responseCID)), + subgraphDeploymentID: ethers.hexlify(ethers.getBytes(subgraphDeploymentId)), + } + + // Sign the receipt hash with the allocation private key + const signer = new Wallet(signerPrivateKey) + const signature = await signer.signTypedData(domain, EIP712_ATTESTATION_PROOF_TYPES, receipt) + const sig = ethers.Signature.from(signature) + + // Concatenate the bytes directly + return ethers.concat([ + ethers.getBytes(requestCID), + ethers.getBytes(responseCID), + ethers.getBytes(subgraphDeploymentId), + ethers.getBytes(sig.r), + ethers.getBytes(sig.s), + new Uint8Array([sig.v]), + ]) +} diff --git a/packages/toolshed/src/core/constants.ts b/packages/toolshed/src/core/constants.ts new file mode 100644 index 000000000..7bfe2cf5f --- /dev/null +++ b/packages/toolshed/src/core/constants.ts @@ -0,0 +1,9 @@ +import { ethers } from 'ethers' + +export const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000' + +export const ONE_THOUSAND = ethers.parseEther('1000') +export const TEN_THOUSAND = ethers.parseEther('10000') +export const ONE_HUNDRED_THOUSAND = ethers.parseEther('100000') +export const ONE_MILLION = ethers.parseEther('1000000') +export const TEN_MILLION = ethers.parseEther('10000000') diff --git a/packages/toolshed/src/core/disputes.ts b/packages/toolshed/src/core/disputes.ts new file mode 100644 index 000000000..498f60acb --- /dev/null +++ b/packages/toolshed/src/core/disputes.ts @@ -0,0 +1,27 @@ +import { ethers } from 'ethers' + +// For disputes in the legacy dispute manager contract +export function generateLegacyIndexingDisputeId(allocationId: string) { + return ethers.solidityPackedKeccak256(['address'], [allocationId]) +} + +export function generateLegacyQueryDisputeId( + queryHash: string, + responseHash: string, + subgraphDeploymentId: string, + indexer: string, + fisherman: string, +) { + return ethers.solidityPackedKeccak256( + ['bytes32', 'bytes32', 'bytes32', 'address', 'address'], + [queryHash, responseHash, subgraphDeploymentId, indexer, fisherman], + ) +} + +// For legacy dispute type in dispute manager contract +export function generateLegacyTypeDisputeId(allocationId: string) { + return ethers.solidityPackedKeccak256( + ['address', 'string'], + [allocationId, 'legacy'], + ) +} diff --git a/packages/toolshed/src/core/graph-tally.ts b/packages/toolshed/src/core/graph-tally.ts new file mode 100644 index 000000000..f71b58ee1 --- /dev/null +++ b/packages/toolshed/src/core/graph-tally.ts @@ -0,0 +1,106 @@ +import { BytesLike, ethers, id, Signature, Wallet } from 'ethers' + +import type { RAV } from './types' +export const EIP712_RAV_PROOF_TYPEHASH = id('ReceiptAggregateVoucher(bytes32 collectionId,address payer,address serviceProvider,address dataService,uint64 timestampNs,uint128 valueAggregate,bytes metadata)') +export const EIP712_RAV_PROOF_TYPES = { + ReceiptAggregateVoucher: [ + { name: 'collectionId', type: 'bytes32' }, + { name: 'payer', type: 'address' }, + { name: 'serviceProvider', type: 'address' }, + { name: 'dataService', type: 'address' }, + { name: 'timestampNs', type: 'uint64' }, + { name: 'valueAggregate', type: 'uint128' }, + { name: 'metadata', type: 'bytes' }, + ], +} + +/** + * Generates a signed RAV + * @param allocationId The allocation ID + * @param payer The payer + * @param serviceProvider The service provider + * @param dataService The data service + * @param timestampNs The timestamp in nanoseconds + * @param valueAggregate The value aggregate + * @param metadata The metadata + * @param signerPrivateKey The private key of the signer + * @param graphTallyCollectorAddress The address of the Graph Tally Collector contract + * @param chainId The chain ID + * @returns The encoded signed RAV calldata + */ +export async function generateSignedRAV( + allocationId: string, + payer: string, + serviceProvider: string, + dataService: string, + timestampNs: number, + valueAggregate: bigint, + metadata: BytesLike, + signerPrivateKey: string, + graphTallyCollectorAddress: string, + chainId: number, +): Promise<{ rav: RAV, signature: string }> { + // Create the domain for the EIP712 signature + const domain = { + name: 'GraphTallyCollector', + version: '1', + chainId, + verifyingContract: graphTallyCollectorAddress, + } + + // Create the RAV data + const ravData = { + collectionId: ethers.zeroPadValue(allocationId, 32), + payer: payer, + serviceProvider: serviceProvider, + dataService: dataService, + timestampNs: timestampNs, + valueAggregate: valueAggregate, + metadata: metadata, + } + + // Sign the RAV data + const signer = new Wallet(signerPrivateKey) + const signature = await signer.signTypedData(domain, EIP712_RAV_PROOF_TYPES, ravData) + + // Return the signed RAV + return { rav: ravData, signature: signature } +} + +/** + * Generates a signer proof for authorizing a signer in the Graph Tally Collector + * @param graphTallyCollector The Graph Tally Collector contract + * @param signer The signer + * @param chainId The chain ID + * @param proofDeadline The deadline for the proof + * @param signerPrivateKey The private key of the signer + * @returns The encoded signer proof + */ +export function generateSignerProof( + proofDeadline: bigint, + payer: string, + signerPrivateKey: string, + graphTallyCollectorAddress: string, + chainId: number, +): string { + // Create the message hash + const messageHash = ethers.keccak256( + ethers.solidityPacked( + ['uint256', 'address', 'string', 'uint256', 'address'], + [ + chainId, + graphTallyCollectorAddress, + 'authorizeSignerProof', + proofDeadline, + payer, + ], + ), + ) + + // Convert to EIP-191 signed message hash (this is the proofToDigest) + const proofToDigest = ethers.hashMessage(ethers.getBytes(messageHash)) + + // Sign the message + const signer = new Wallet(signerPrivateKey) + return Signature.from(signer.signingKey.sign(proofToDigest)).serialized +} diff --git a/packages/toolshed/src/core/index.ts b/packages/toolshed/src/core/index.ts new file mode 100644 index 000000000..e1bf04633 --- /dev/null +++ b/packages/toolshed/src/core/index.ts @@ -0,0 +1,10 @@ +export * from './poi' +export * from './abi' +export * from './constants' +export * from './allocation' +export * from './types' +export * from './accounts' +export * from './graph-tally' +export * from './attestations' +export * from './subgraph-service' +export * from './disputes' diff --git a/packages/toolshed/src/core/poi.ts b/packages/toolshed/src/core/poi.ts new file mode 100644 index 000000000..08cbf2356 --- /dev/null +++ b/packages/toolshed/src/core/poi.ts @@ -0,0 +1,12 @@ +import { BytesLike, ethers, keccak256, toUtf8Bytes } from 'ethers' + +export function generatePOI(message = 'poi') { + return ethers.getBytes(keccak256(toUtf8Bytes(message))) +} + +export function encodePOIMetadata(blockNumber: number, publicPOI: BytesLike, indexingStatus: number, errorCode: number, errorBlockNumber: number) { + return ethers.AbiCoder.defaultAbiCoder().encode( + ['uint256', 'bytes32', 'uint8', 'uint8', 'uint256'], + [blockNumber, publicPOI, indexingStatus, errorCode, errorBlockNumber], + ) +} diff --git a/packages/toolshed/src/core/subgraph-service.ts b/packages/toolshed/src/core/subgraph-service.ts new file mode 100644 index 000000000..743c2ae25 --- /dev/null +++ b/packages/toolshed/src/core/subgraph-service.ts @@ -0,0 +1,42 @@ +import { BytesLike, ethers } from 'ethers' +import { RAV } from './types' + +export function encodeRegistrationData(url: string, geoHash: string, rewardsDestination: string) { + return ethers.AbiCoder.defaultAbiCoder().encode( + ['string', 'string', 'address'], + [url, geoHash, rewardsDestination], + ) +} + +export function encodeStartServiceData( + subgraphDeploymentId: string, + allocationTokens: bigint, + allocationId: string, + signature: string, +) { + return ethers.AbiCoder.defaultAbiCoder().encode( + ['bytes32', 'uint256', 'address', 'bytes'], + [subgraphDeploymentId, allocationTokens, allocationId, signature], + ) +} + +export function encodeCollectIndexingRewardsData(allocationId: string, poi: BytesLike, poiMetadata: BytesLike) { + return ethers.AbiCoder.defaultAbiCoder().encode( + ['address', 'bytes32', 'bytes'], + [allocationId, poi, poiMetadata], + ) +} + +export function encodeCollectQueryFeesData(rav: RAV, signature: string, tokensToCollect: bigint) { + return ethers.AbiCoder.defaultAbiCoder().encode( + ['tuple(tuple(bytes32 collectionId, address payer, address serviceProvider, address dataService, uint256 timestampNs, uint128 valueAggregate, bytes metadata) rav, bytes signature)', 'uint256'], + [{ rav, signature }, tokensToCollect], + ) +} + +export function encodeStopServiceData(allocationId: string) { + return ethers.AbiCoder.defaultAbiCoder().encode( + ['address'], + [allocationId], + ) +} \ No newline at end of file diff --git a/packages/toolshed/src/core/types.ts b/packages/toolshed/src/core/types.ts new file mode 100644 index 000000000..8552bf104 --- /dev/null +++ b/packages/toolshed/src/core/types.ts @@ -0,0 +1,22 @@ +import type { BytesLike } from 'ethers' + +export enum PaymentTypes { + QueryFee = 0, + IndexingFee = 1, + IndexingRewards = 2, +} + +export enum ThawRequestType { + Provision = 0, + Delegation = 1, +} + +export type RAV = { + collectionId: string + payer: string + serviceProvider: string + dataService: string + timestampNs: number + valueAggregate: bigint + metadata: BytesLike +} diff --git a/packages/toolshed/src/deployments/address-book.ts b/packages/toolshed/src/deployments/address-book.ts new file mode 100644 index 000000000..9f003bc06 --- /dev/null +++ b/packages/toolshed/src/deployments/address-book.ts @@ -0,0 +1,255 @@ +import fs from 'fs' + +import { logDebug, logError, logWarn } from '../lib/logger' +import { assertObject } from '../lib/assert' + +import { ContractList, loadContract } from './contract' +import { Provider, Signer } from 'ethers' + +export type AddressBookJson< + ChainId extends number = number, + ContractName extends string = string, +> = Record> + +export type AddressBookEntry = { + address: string + proxy?: 'graph' | 'transparent' + proxyAdmin?: string + implementation?: string +} + +/** + * An abstract class to manage an address book + * The address book must be a JSON file with the following structure: + * { + * "": { + * "": { + * "address": "
", + * "proxy": "", // optional + * "proxyAdmin": "
", // optional + * "implementation": "
", // optional + * ... + * } + * } + * Uses generics to allow specifying a ContractName type to indicate which contracts should be loaded from the address book + * Implementation should provide: + * - `isContractName(name: string): name is ContractName`, a type predicate to check if a given string is a ContractName + * - `loadContracts(signerOrProvider?: Signer | Provider): ContractList` to load contracts from the address book + */ +export abstract class AddressBook< + ChainId extends number = number, + ContractName extends string = string, +> { + // The path to the address book file + public file: string + + // The chain id of the network the address book should be loaded for + public chainId: ChainId + + // The raw contents of the address book file + public addressBook: AddressBookJson + + // Contracts in the address book of type ContractName + private validContracts: ContractName[] = [] + + // Contracts in the address book that are not of type ContractName, these are ignored + private invalidContracts: string[] = [] + + // Type predicate to check if a given string is a ContractName + abstract isContractName(name: string): name is ContractName + + // Method to load valid contracts from the address book + abstract loadContracts(signerOrProvider?: Signer | Provider): ContractList + + /** + * Constructor for the `AddressBook` class + * + * @param _file the path to the address book file + * @param _chainId the chain id of the network the address book should be loaded for + * @param _strictAssert + * + * @throws AssertionError if the target file is not a valid address book + * @throws Error if the target file does not exist + */ + constructor(_file: string, _chainId: ChainId, _strictAssert = false) { + this.file = _file + this.chainId = _chainId + + logDebug(`Loading address book from ${this.file}.`) + + // Create empty address book if file doesn't exist + if (!fs.existsSync(this.file)) { + const emptyAddressBook = { [this.chainId]: {} } + fs.writeFileSync(this.file, JSON.stringify(emptyAddressBook, null, 2)) + logDebug(`Created new address book at ${this.file}`) + } + + // Load address book and validate its shape + const fileContents = JSON.parse(fs.readFileSync(this.file, 'utf8')) as Record + if (typeof fileContents !== 'object' || fileContents === null) { + throw new Error('Address book is not an object') + } + if (!fileContents[this.chainId]) { + fileContents[this.chainId] = {} + } + this.assertAddressBookJson(fileContents) + this.addressBook = fileContents + this._parseAddressBook() + } + + /** + * List entry names in the address book + * + * @returns a list with all the names of the entries in the address book + */ + listEntries(): ContractName[] { + return this.validContracts + } + + entryExists(name: string): boolean { + if (!this.isContractName(name)) { + throw new Error(`Contract name ${name} is not a valid contract name`) + } + return this.addressBook[this.chainId][name] !== undefined + } + + /** + * Get an entry from the address book + * + * @param name the name of the contract to get + * @param strict if true it will throw an error if the contract is not found + * @returns the address book entry for the contract + * Returns an empty address book entry if the contract is not found + */ + getEntry(name: string): AddressBookEntry { + if (!this.isContractName(name)) { + throw new Error(`Contract name ${name} is not a valid contract name`) + } + const entry = this.addressBook[this.chainId][name] + this._assertAddressBookEntry(entry) + return entry + } + + /** + * Save an entry to the address book + * Allows partial address book entries to be saved + * @param name the name of the contract to save + * @param entry the address book entry for the contract + */ + setEntry(name: ContractName, entry: Partial): void { + if (entry.address === undefined) { + entry.address = '0x0000000000000000000000000000000000000000' + } + this._assertAddressBookEntry(entry) + this.addressBook[this.chainId][name] = entry + try { + fs.writeFileSync(this.file, JSON.stringify(this.addressBook, null, 2)) + } catch (e: unknown) { + if (e instanceof Error) logError(`Error saving entry: ${e.message}`) + else logError(`Error saving entry`) + } + } + + /** + * Parse address book and separate valid and invalid contracts + */ + _parseAddressBook() { + const contractList = this.addressBook[this.chainId] + + const contractNames = contractList ? Object.keys(contractList) : [] + for (const contract of contractNames) { + if (!this.isContractName(contract)) { + this.invalidContracts.push(contract) + } else { + this.validContracts.push(contract) + } + } + + if (this.invalidContracts.length > 0) { + logWarn(`Detected invalid contracts in address book - these will not be loaded: ${this.invalidContracts.join(', ')}`) + } + } + + /** + * Loads all valid contracts from an address book + * + * @param addressBook Address book to use + * @param signerOrProvider Signer or provider to use + * @param enableTxLogging Enable transaction logging to console and output file. Defaults to false. + * @returns the loaded contracts + */ + _loadContracts( + artifactsPath: string | string[] | Record, + signerOrProvider?: Signer | Provider, + enableTxLogging?: boolean, + ): ContractList { + const contracts = {} as ContractList + if (this.listEntries().length == 0) { + logError('No valid contracts found in address book') + return contracts + } + for (const contractName of this.listEntries()) { + const artifactPath = typeof artifactsPath === 'object' && !Array.isArray(artifactsPath) + ? artifactsPath[contractName] + : artifactsPath + + if (Array.isArray(artifactPath) + ? !artifactPath.some(fs.existsSync) + : !fs.existsSync(artifactPath)) { + logWarn(`Could not load contract ${contractName} - artifact not found`) + logWarn(artifactPath) + continue + } + logDebug(`Loading contract ${contractName}`) + + const contract = loadContract( + contractName, + this.getEntry(contractName).address, + artifactPath, + signerOrProvider, + enableTxLogging, + ) + contracts[contractName] = contract + } + + return contracts + } + + // Asserts the provided object has the correct JSON format shape for an address book + // This method can be overridden by subclasses to provide custom validation + assertAddressBookJson( + json: unknown, + ): asserts json is AddressBookJson { + this._assertAddressBookJson(json) + } + + // Asserts the provided object is a valid address book + _assertAddressBookJson(json: unknown): asserts json is AddressBookJson { + assertObject(json, 'Assertion failed: address book is not an object') + + const contractList = json[this.chainId] + assertObject(contractList, 'Assertion failed: chain contract list is not an object') + + const contractNames = Object.keys(contractList) + for (const contractName of contractNames) { + this._assertAddressBookEntry(contractList[contractName]) + } + } + + // Asserts the provided object is a valid address book entry + _assertAddressBookEntry( + entry: unknown, + ): asserts entry is AddressBookEntry { + assertObject(entry) + if (!('address' in entry)) { + throw new Error('Address book entry must have an address field') + } + + const allowedFields = ['address', 'implementation', 'proxyAdmin', 'proxy'] + const entryFields = Object.keys(entry) + const invalidFields = entryFields.filter(field => !allowedFields.includes(field)) + if (invalidFields.length > 0) { + throw new Error(`Address book entry contains invalid fields: ${invalidFields.join(', ')}`) + } + } +} diff --git a/packages/toolshed/src/deployments/artifact.ts b/packages/toolshed/src/deployments/artifact.ts new file mode 100644 index 000000000..becca0be9 --- /dev/null +++ b/packages/toolshed/src/deployments/artifact.ts @@ -0,0 +1,40 @@ +import { Artifacts } from 'hardhat/internal/artifacts' + +import type { Artifact } from 'hardhat/types' + +/** + * Load a contract's artifact from the build output folder + * If multiple build output folders are provided, they will be searched in order + * @param name Name of the contract + * @param buildDir Path to the build output folder(s). Defaults to `build/contracts`. + * @returns The artifact corresponding to the contract name + */ +export const loadArtifact = (name: string, buildDir?: string[] | string): Artifact => { + let artifacts: Artifacts + let artifact: Artifact | undefined + buildDir = buildDir ?? ['build/contracts'] + + if (typeof buildDir === 'string') { + buildDir = [buildDir] + } + + for (const dir of buildDir) { + try { + artifacts = new Artifacts(dir) + artifact = artifacts.readArtifactSync(name) + break + } catch (error) { + if (error instanceof Error) { + throw new Error(`Could not load artifact ${name} from ${dir} - ${error.message}`) + } else { + throw new Error(`Could not load artifact ${name} from ${dir}`) + } + } + } + + if (artifact === undefined) { + throw new Error(`Could not load artifact ${name}`) + } + + return artifact +} diff --git a/packages/toolshed/src/deployments/contract.ts b/packages/toolshed/src/deployments/contract.ts new file mode 100644 index 000000000..665b14fa3 --- /dev/null +++ b/packages/toolshed/src/deployments/contract.ts @@ -0,0 +1,45 @@ +import { Contract, Provider, Signer } from 'ethers' +import { loadArtifact } from './artifact' +import { wrapTransactionCalls } from './tx-logging' + +export type ContractList = Partial> + +/** + * Loads a contract from an address book + * + * @param name Name of the contract + * @param addressBook Address book to use + * @param signerOrProvider Signer or provider to use + * @param enableTxLogging Enable transaction logging to console and output file. Defaults to false. + * @param optional If true, the contract is optional and will not throw if it cannot be loaded + * @returns the loaded contract + * + * @throws Error if the contract could not be loaded + */ +export function loadContract( + name: ContractName, + address: string, + artifactsPath: string | string[], + signerOrProvider?: Signer | Provider, + enableTxLogging?: boolean, +): Contract { + try { + let contract = new Contract(address, loadArtifact(name, artifactsPath).abi, signerOrProvider) + + if (signerOrProvider) { + contract = contract.connect(signerOrProvider) as Contract + } + + if (enableTxLogging) { + contract = wrapTransactionCalls(contract, name) + } + + return contract + } catch (err: unknown) { + if (err instanceof Error) { + throw new Error(`Could not load contract ${name} - ${err.message}`) + } else { + throw new Error(`Could not load contract ${name}`) + } + } +} diff --git a/packages/toolshed/src/deployments/horizon/actions.ts b/packages/toolshed/src/deployments/horizon/actions.ts new file mode 100644 index 000000000..23538fb04 --- /dev/null +++ b/packages/toolshed/src/deployments/horizon/actions.ts @@ -0,0 +1,179 @@ +import type { GraphHorizonContracts, HorizonStakingExtension } from '.' +import type { HardhatEthersSigner } from '@nomicfoundation/hardhat-ethers/signers' + +/** + * It's important to use JSDoc in the return functions here for good developer experience as + * intellisense does not expand the args type aliases. + */ +export function loadActions( + contracts: GraphHorizonContracts, +) { + return { + /** + * Stakes GRT tokens in the Horizon staking contract + * Note that it will approve HorizonStaking to spend the tokens + * + * @param signer - The signer that will execute the transactions + * @param args Parameters: + * - [tokens] - Amount of GRT tokens to stake + */ + stake: (signer: HardhatEthersSigner, args: Parameters) => stake(contracts, signer, args), + /** + * Stakes GRT tokens in the Horizon staking contract to a service provider + * Note that it will approve HorizonStaking to spend the tokens + * + * @param signer - The signer that will execute the transactions + * @param args Parameters: + * - [serviceProvider, tokens] - The provision parameters + */ + stakeTo: (signer: HardhatEthersSigner, args: Parameters) => stakeTo(contracts, signer, args), + /** + * Stakes GRT tokens in the Horizon staking contract to a provision + * Note that it will approve HorizonStaking to spend the tokens + * + * @param signer - The signer that will execute the transactions + * @param args Parameters: + * - [serviceProvider, verifier, tokens] - The provision parameters + */ + stakeToProvision: (signer: HardhatEthersSigner, args: Parameters) => stakeToProvision(contracts, signer, args), + /** + * Adds tokens to a provision + * Note that it will approve HorizonStaking to spend the tokens + * + * @param signer - The signer that will execute the transactions + * @param args Parameters: + * - [serviceProvider, verifier, tokens] - The provision parameters + */ + addToProvision: (signer: HardhatEthersSigner, args: Parameters) => addToProvision(contracts, signer, args), + /** + * Provisions tokens in the Horizon staking contract + * Note that it will approve HorizonStaking to spend the tokens and stake them + * + * @param signer - The signer that will execute the provision transaction + * @param args Parameters: + * - `[serviceProvider, verifier, tokens, maxVerifierCut, thawingPeriod]` - The provision parameters + */ + provision: (signer: HardhatEthersSigner, args: Parameters) => provision(contracts, signer, args), + /** + * [Legacy] Collects query fees from the Horizon staking contract + * Note that it will approve HorizonStaking to spend the tokens + * @param signer - The signer that will execute the collect transaction + * @param args Parameters: + * - `[tokens, allocationID]` - The collect parameters + */ + collect: (signer: HardhatEthersSigner, args: Parameters) => collect(contracts, signer, args), + /** + * Delegates tokens in the Horizon staking contract + * Note that it will approve HorizonStaking to spend the tokens + * @param signer - The signer that will execute the delegate transaction + * @param args Parameters: + * - `[serviceProvider, verifier, tokens, minSharesOut]` - The delegate parameters + */ + delegate: (signer: HardhatEthersSigner, args: Parameters) => delegate(contracts, signer, args), + /** + * Adds tokens to a delegation pool + * Note that it will approve HorizonStaking to spend the tokens + * @param signer - The signer that will execute the addToDelegationPool transaction + * @param args Parameters: + * - `[serviceProvider, verifier, tokens]` - The addToDelegationPool parameters + */ + addToDelegationPool: (signer: HardhatEthersSigner, args: Parameters) => addToDelegationPool(contracts, signer, args), + } +} + +async function stake( + contracts: GraphHorizonContracts, + signer: HardhatEthersSigner, + args: Parameters, +) { + const { GraphToken, HorizonStaking } = contracts + const [tokens] = args + + await GraphToken.connect(signer).approve(HorizonStaking.target, tokens) + await HorizonStaking.connect(signer).stake(tokens) +} + +async function stakeTo( + contracts: GraphHorizonContracts, + signer: HardhatEthersSigner, + args: Parameters, +) { + const { GraphToken, HorizonStaking } = contracts + const [serviceProvider, tokens] = args + + await GraphToken.connect(signer).approve(HorizonStaking.target, tokens) + await HorizonStaking.connect(signer).stakeTo(serviceProvider, tokens) +} + +async function stakeToProvision( + contracts: GraphHorizonContracts, + signer: HardhatEthersSigner, + args: Parameters, +) { + const { GraphToken, HorizonStaking } = contracts + const [serviceProvider, verifier, tokens] = args + + await GraphToken.connect(signer).approve(HorizonStaking.target, tokens) + await HorizonStaking.connect(signer).stakeToProvision(serviceProvider, verifier, tokens) +} + +async function addToProvision( + contracts: GraphHorizonContracts, + signer: HardhatEthersSigner, + args: Parameters, +) { + const { GraphToken, HorizonStaking } = contracts + const [serviceProvider, verifier, tokens] = args + + await GraphToken.connect(signer).approve(HorizonStaking.target, tokens) + await HorizonStaking.connect(signer).addToProvision(serviceProvider, verifier, tokens) +} + +async function provision( + contracts: GraphHorizonContracts, + signer: HardhatEthersSigner, + args: Parameters, +) { + const { GraphToken, HorizonStaking } = contracts + const [serviceProvider, verifier, tokens, maxVerifierCut, thawingPeriod] = args + + await GraphToken.connect(signer).approve(HorizonStaking.target, tokens) + await HorizonStaking.connect(signer).stake(tokens) + await HorizonStaking.connect(signer).provision(serviceProvider, verifier, tokens, maxVerifierCut, thawingPeriod) +} + +async function collect( + contracts: GraphHorizonContracts, + signer: HardhatEthersSigner, + args: Parameters, +) { + const { GraphToken, HorizonStaking } = contracts + const [tokens, allocationID] = args + + await GraphToken.connect(signer).approve(HorizonStaking.target, tokens) + await (HorizonStaking as HorizonStakingExtension).connect(signer).collect(tokens, allocationID) +} + +async function delegate( + contracts: GraphHorizonContracts, + signer: HardhatEthersSigner, + args: Parameters, +) { + const { GraphToken, HorizonStaking } = contracts + const [serviceProvider, verifier, tokens, minSharesOut] = args + + await GraphToken.connect(signer).approve(HorizonStaking.target, tokens) + await HorizonStaking.connect(signer)['delegate(address,address,uint256,uint256)'](serviceProvider, verifier, tokens, minSharesOut) +} + +async function addToDelegationPool( + contracts: GraphHorizonContracts, + signer: HardhatEthersSigner, + args: Parameters, +) { + const { GraphToken, HorizonStaking } = contracts + const [serviceProvider, verifier, tokens] = args + + await GraphToken.connect(signer).approve(HorizonStaking.target, tokens) + await HorizonStaking.connect(signer).addToDelegationPool(serviceProvider, verifier, tokens) +} diff --git a/packages/toolshed/src/deployments/horizon/address-book.ts b/packages/toolshed/src/deployments/horizon/address-book.ts new file mode 100644 index 000000000..af27eabfa --- /dev/null +++ b/packages/toolshed/src/deployments/horizon/address-book.ts @@ -0,0 +1,86 @@ +import { GraphHorizonArtifactsMap, GraphHorizonContractNameList } from './contracts' +import { logDebug, logError } from '../../lib/logger' +import { Provider, Signer } from 'ethers' +import { AddressBook } from '../address-book' +import { assertObject } from '../../lib/assert' +import { Contract } from 'ethers' +import { loadArtifact } from '../artifact' +import { mergeABIs } from '../../core/abi' +import { wrapTransactionCalls } from '../tx-logging' + +import type { GraphHorizonContractName, GraphHorizonContracts } from './contracts' +import type { LegacyStaking } from './types' + +export class GraphHorizonAddressBook extends AddressBook { + isContractName(name: unknown): name is GraphHorizonContractName { + return ( + typeof name === 'string' + && GraphHorizonContractNameList.includes(name as GraphHorizonContractName) + ) + } + + loadContracts( + signerOrProvider?: Signer | Provider, + enableTxLogging?: boolean, + ): GraphHorizonContracts { + logDebug('Loading Graph Horizon contracts...') + + const contracts = this._loadContracts( + GraphHorizonArtifactsMap, + signerOrProvider, + enableTxLogging, + ) + + // rewire HorizonStaking to include HorizonStakingExtension abi + if (contracts.HorizonStaking) { + const stakingOverride = new Contract( + this.getEntry('HorizonStaking').address, + mergeABIs( + loadArtifact('HorizonStaking', GraphHorizonArtifactsMap.HorizonStaking).abi, + loadArtifact('HorizonStakingExtension', GraphHorizonArtifactsMap.HorizonStaking).abi, + ), + signerOrProvider, + ) + contracts.HorizonStaking = enableTxLogging + ? wrapTransactionCalls(stakingOverride, 'HorizonStaking') + : stakingOverride + } + + this._assertGraphHorizonContracts(contracts) + + // Aliases + contracts.GraphToken = contracts.L2GraphToken + contracts.Curation = contracts.L2Curation + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment + contracts.GNS = contracts.L2GNS + + if (contracts.HorizonStaking) { + // add LegacyStaking alias using old IL2Staking abi + const contract = new Contract( + contracts.HorizonStaking.target, + loadArtifact('IL2Staking', GraphHorizonArtifactsMap.LegacyStaking).abi, + signerOrProvider, + ) + contracts.LegacyStaking = ( + enableTxLogging + ? wrapTransactionCalls(contract, 'LegacyStaking') + : contract + ) as unknown as LegacyStaking + } + + return contracts + } + + _assertGraphHorizonContracts( + contracts: unknown, + ): asserts contracts is GraphHorizonContracts { + assertObject(contracts) + + // Assert that all GraphHorizonContracts were loaded + for (const contractName of GraphHorizonContractNameList) { + if (!contracts[contractName]) { + logError(`Missing GraphHorizon contract: ${contractName}`) + } + } + } +} diff --git a/packages/toolshed/src/deployments/horizon/contracts.ts b/packages/toolshed/src/deployments/horizon/contracts.ts new file mode 100644 index 000000000..78ccdf548 --- /dev/null +++ b/packages/toolshed/src/deployments/horizon/contracts.ts @@ -0,0 +1,97 @@ +import { resolvePackagePath } from '../../lib/path' + +import type { + Controller, + GraphPayments, + GraphProxyAdmin, + GraphTallyCollector, + HorizonStaking, + HorizonStakingExtension, + PaymentsEscrow, +} from '@graphprotocol/horizon' +import type { + EpochManager, + L2Curation, + L2GNS, + L2GraphToken, + LegacyStaking, + RewardsManager, + SubgraphNFT, +} from './types' +import type { ContractList } from '../contract' + +export const GraphHorizonContractNameList = [ + // @graphprotocol/contracts + 'GraphProxyAdmin', + 'Controller', + 'EpochManager', + 'RewardsManager', + 'L2GraphToken', + 'L2GraphTokenGateway', + + // @graphprotocol/contracts - subgraph-service compatibility + 'L2Curation', + 'L2GNS', + 'SubgraphNFT', + + // @graphprotocol/horizon + 'HorizonStaking', + 'GraphPayments', + 'PaymentsEscrow', + 'GraphTallyCollector', +] as const + +export const CONTRACTS_ARTIFACTS_PATH = resolvePackagePath('@graphprotocol/contracts', 'build/contracts') +export const HORIZON_ARTIFACTS_PATH = resolvePackagePath('@graphprotocol/horizon', 'build/contracts') + +export const GraphHorizonArtifactsMap = { + // @graphprotocol/contracts + GraphProxyAdmin: CONTRACTS_ARTIFACTS_PATH, + Controller: CONTRACTS_ARTIFACTS_PATH, + EpochManager: CONTRACTS_ARTIFACTS_PATH, + RewardsManager: CONTRACTS_ARTIFACTS_PATH, + L2GraphToken: CONTRACTS_ARTIFACTS_PATH, + L2GraphTokenGateway: CONTRACTS_ARTIFACTS_PATH, + + // @graphprotocol/contracts - subgraph-service compatibility + L2Curation: CONTRACTS_ARTIFACTS_PATH, + L2GNS: CONTRACTS_ARTIFACTS_PATH, + SubgraphNFT: CONTRACTS_ARTIFACTS_PATH, + + // @graphprotocol/contracts - legacy + LegacyStaking: CONTRACTS_ARTIFACTS_PATH, + + // @graphprotocol/horizon + HorizonStaking: HORIZON_ARTIFACTS_PATH, + GraphPayments: HORIZON_ARTIFACTS_PATH, + PaymentsEscrow: HORIZON_ARTIFACTS_PATH, + GraphTallyCollector: HORIZON_ARTIFACTS_PATH, +} as const + +export interface GraphHorizonContracts extends ContractList { + // @graphprotocol/contracts + EpochManager: EpochManager + RewardsManager: RewardsManager + GraphProxyAdmin: GraphProxyAdmin + Controller: Controller + L2GraphToken: L2GraphToken + + // @graphprotocol/contracts - subgraph-service compatibility + L2Curation: L2Curation + L2GNS: L2GNS + SubgraphNFT: SubgraphNFT + + // @graphprotocol/horizon + HorizonStaking: HorizonStaking & HorizonStakingExtension + GraphPayments: GraphPayments + PaymentsEscrow: PaymentsEscrow + GraphTallyCollector: GraphTallyCollector + + // Aliases + GraphToken: L2GraphToken + Curation: L2Curation + GNS: L2GNS + LegacyStaking: LegacyStaking +} + +export type GraphHorizonContractName = (typeof GraphHorizonContractNameList)[number] diff --git a/packages/toolshed/src/deployments/horizon/index.ts b/packages/toolshed/src/deployments/horizon/index.ts new file mode 100644 index 000000000..316b80b5b --- /dev/null +++ b/packages/toolshed/src/deployments/horizon/index.ts @@ -0,0 +1,44 @@ +import { GraphHorizonAddressBook } from './address-book' +import { loadActions } from './actions' + +import type { Provider, Signer } from 'ethers' +import type { HardhatEthersProvider } from '@nomicfoundation/hardhat-ethers/internal/hardhat-ethers-provider' + +export type { + HorizonStaking, + EpochManager, + L2GraphToken, + L2Curation, + RewardsManager, + L2GNS, + SubgraphNFT, +} from './types' +export type { + Controller, + GraphPayments, + GraphTallyCollector, + GraphProxyAdmin, + HorizonStakingExtension, + PaymentsEscrow, +} from '@graphprotocol/horizon' + +export { GraphHorizonAddressBook } from './address-book' +export type { GraphHorizonContractName, GraphHorizonContracts } from './contracts' + +export function loadGraphHorizon(addressBookPath: string, chainId: number, provider: HardhatEthersProvider) { + const addressBook = new GraphHorizonAddressBook(addressBookPath, chainId) + const contracts = addressBook.loadContracts(provider, true) + return { + addressBook: addressBook, + contracts: contracts, + actions: loadActions(contracts), + } +} + +export function connectGraphHorizon(chainId: number, signerOrProvider: Signer | Provider, addressBookPath?: string) { + const addressBook = new GraphHorizonAddressBook( + addressBookPath ?? require.resolve('@graphprotocol/horizon/addresses.json'), + chainId, + ) + return addressBook.loadContracts(signerOrProvider, false) +} diff --git a/packages/toolshed/src/deployments/horizon/types.ts b/packages/toolshed/src/deployments/horizon/types.ts new file mode 100644 index 000000000..31ffefa78 --- /dev/null +++ b/packages/toolshed/src/deployments/horizon/types.ts @@ -0,0 +1,24 @@ +import type { + HorizonStakingExtension, + HorizonStaking as HorizonStakingMain, + IEpochManagerToolshed, + IGNSToolshed, + IGraphToken, + IL2CurationToolshed, + IRewardsManagerToolshed, + IStaking, + ISubgraphNFT, +} from '@graphprotocol/horizon' + +// These are just type re-declarations to keep naming conventions consistent +export { + IGraphToken as L2GraphToken, + IEpochManagerToolshed as EpochManager, + IRewardsManagerToolshed as RewardsManager, + IL2CurationToolshed as L2Curation, + IStaking as LegacyStaking, + IGNSToolshed as L2GNS, + ISubgraphNFT as SubgraphNFT, +} + +export type HorizonStaking = HorizonStakingMain & HorizonStakingExtension diff --git a/packages/toolshed/src/deployments/index.ts b/packages/toolshed/src/deployments/index.ts new file mode 100644 index 000000000..afa0a4c44 --- /dev/null +++ b/packages/toolshed/src/deployments/index.ts @@ -0,0 +1,7 @@ +export { AddressBook, AddressBookEntry } from './address-book' +export { GraphDeploymentsList } from './types' + +export type { GraphDeploymentName, GraphDeployments } from './types' + +export * from './horizon' +export * from './subgraph-service' diff --git a/packages/toolshed/src/deployments/subgraph-service/actions.ts b/packages/toolshed/src/deployments/subgraph-service/actions.ts new file mode 100644 index 000000000..b185ea535 --- /dev/null +++ b/packages/toolshed/src/deployments/subgraph-service/actions.ts @@ -0,0 +1,37 @@ +import { Interface } from 'ethers' + +import type { HardhatEthersSigner } from '@nomicfoundation/hardhat-ethers/signers' +import type { ISubgraphService } from '@graphprotocol/subgraph-service' + +export function loadActions(contracts: { SubgraphService: ISubgraphService }) { + return { + /** + * Collects the allocated funds for a subgraph deployment + * @param signer - The signer that will execute the collect transaction + * @param args Parameters: + * - `[indexer, paymentType, data]` - The collect parameters + * @returns The payment collected + */ + collect: (signer: HardhatEthersSigner, args: Parameters): Promise => collect(contracts, signer, args), + } +} + +// Collects payment from the subgraph service +async function collect( + contracts: { SubgraphService: ISubgraphService }, + signer: HardhatEthersSigner, + args: Parameters, +): Promise { + const { SubgraphService } = contracts + const [indexer, paymentType, data] = args + + const tx = await SubgraphService.connect(signer).collect(indexer, paymentType, data) + const receipt = await tx.wait() + if (!receipt) throw new Error('Transaction failed') + + const iface = new Interface(['event ServicePaymentCollected(address indexed serviceProvider, uint8 indexed feeType, uint256 tokens)']) + const event = receipt.logs.find(log => log.topics[0] === iface.getEvent('ServicePaymentCollected')?.topicHash) + if (!event) throw new Error('ServicePaymentCollected event not found') + + return BigInt(event.data) +} diff --git a/packages/toolshed/src/deployments/subgraph-service/address-book.ts b/packages/toolshed/src/deployments/subgraph-service/address-book.ts new file mode 100644 index 000000000..ffcf4987c --- /dev/null +++ b/packages/toolshed/src/deployments/subgraph-service/address-book.ts @@ -0,0 +1,90 @@ +import { logDebug, logError } from '../../lib/logger' +import { Provider, Signer } from 'ethers' +import { SubgraphServiceArtifactsMap, SubgraphServiceContractNameList } from './contracts' +import { AddressBook } from '../address-book' +import { assertObject } from '../../lib/assert' +import { Contract } from 'ethers' +import { loadArtifact } from '../artifact' +import { wrapTransactionCalls } from '../tx-logging' + +import type { LegacyDisputeManager, LegacyServiceRegistry } from './types' +import type { SubgraphServiceContractName, SubgraphServiceContracts } from './contracts' + +export class SubgraphServiceAddressBook extends AddressBook { + isContractName(name: unknown): name is SubgraphServiceContractName { + return ( + typeof name === 'string' + && SubgraphServiceContractNameList.includes(name as SubgraphServiceContractName) + ) + } + + loadContracts( + signerOrProvider?: Signer | Provider, + enableTxLogging?: boolean, + ): SubgraphServiceContracts { + logDebug('Loading Subgraph Service contracts...') + + // Filter out LegacyDisputeManager from the artifacts map + const { LegacyDisputeManager: _, LegacyServiceRegistry: __, ...filteredArtifactsMap } = SubgraphServiceArtifactsMap + + const contracts = this._loadContracts( + filteredArtifactsMap as typeof SubgraphServiceArtifactsMap, + signerOrProvider, + enableTxLogging, + ) + + // Aliases + const contractsWithAliases = { + ...contracts, + Curation: contracts.L2Curation, + GNS: contracts.L2GNS, + + } as SubgraphServiceContracts + + // Load LegacyDisputeManager manually + if (this.entryExists('LegacyDisputeManager')) { + const entry = this.getEntry('LegacyDisputeManager') + const contract = new Contract( + entry.address, + loadArtifact('IDisputeManager', SubgraphServiceArtifactsMap.LegacyDisputeManager).abi, + signerOrProvider, + ) + contractsWithAliases.LegacyDisputeManager = ( + enableTxLogging + ? wrapTransactionCalls(contract, 'LegacyDisputeManager') + : contract + ) as unknown as LegacyDisputeManager + } + + // Load ServiceRegistry manually + if (this.entryExists('LegacyServiceRegistry')) { + const entry = this.getEntry('LegacyServiceRegistry') + const contract = new Contract( + entry.address, + loadArtifact('IServiceRegistry', SubgraphServiceArtifactsMap.LegacyServiceRegistry).abi, + signerOrProvider, + ) + contractsWithAliases.LegacyServiceRegistry = ( + enableTxLogging + ? wrapTransactionCalls(contract, 'LegacyServiceRegistry') + : contract + ) as unknown as LegacyServiceRegistry + } + + this._assertSubgraphServiceContracts(contractsWithAliases) + return contractsWithAliases + } + + _assertSubgraphServiceContracts( + contracts: unknown, + ): asserts contracts is SubgraphServiceContracts { + assertObject(contracts) + + // Assert that all SubgraphServiceContracts were loaded + for (const contractName of SubgraphServiceContractNameList) { + if (!contracts[contractName]) { + logError(`Missing SubgraphService contract: ${contractName}`) + } + } + } +} diff --git a/packages/toolshed/src/deployments/subgraph-service/contracts.ts b/packages/toolshed/src/deployments/subgraph-service/contracts.ts new file mode 100644 index 000000000..f55dc8519 --- /dev/null +++ b/packages/toolshed/src/deployments/subgraph-service/contracts.ts @@ -0,0 +1,67 @@ +import { resolvePackagePath } from '../../lib/path' + +import type { + DisputeManager, + SubgraphService, +} from '@graphprotocol/subgraph-service' +import type { + L2Curation, + L2GNS, + LegacyDisputeManager, + LegacyServiceRegistry, +} from './types' +import type { ContractList } from '../contract' + +export const SubgraphServiceContractNameList = [ + // @graphprotocol/contracts + 'L2Curation', + 'L2GNS', + 'SubgraphNFT', + + // @graphprotocol/subgraph-service + 'SubgraphService', + 'DisputeManager', + + // @graphprotocol/contracts - legacy + 'LegacyDisputeManager', + 'LegacyServiceRegistry', +] as const + +export const CONTRACTS_ARTIFACTS_PATH = resolvePackagePath('@graphprotocol/contracts', 'build/contracts') +export const SUBGRAPH_SERVICE_ARTIFACTS_PATH = resolvePackagePath('@graphprotocol/subgraph-service', 'build/contracts') + +export const SubgraphServiceArtifactsMap = { + // @graphprotocol/contracts + L2Curation: CONTRACTS_ARTIFACTS_PATH, + L2GNS: CONTRACTS_ARTIFACTS_PATH, + SubgraphNFT: CONTRACTS_ARTIFACTS_PATH, + + // @graphprotocol/subgraph-service + SubgraphService: SUBGRAPH_SERVICE_ARTIFACTS_PATH, + DisputeManager: SUBGRAPH_SERVICE_ARTIFACTS_PATH, + + // @graphprotocol/contracts - legacy + LegacyDisputeManager: CONTRACTS_ARTIFACTS_PATH, + LegacyServiceRegistry: CONTRACTS_ARTIFACTS_PATH, +} as const + +export interface SubgraphServiceContracts extends ContractList { + // @graphprotocol/contracts + L2Curation: L2Curation + L2GNS: L2GNS + // SubgraphNFT: SubgraphNFT + + // @graphprotocol/subgraph-service + SubgraphService: SubgraphService + DisputeManager: DisputeManager + + // Aliases + Curation: L2Curation + GNS: L2GNS + + // @graphprotocol/contracts - legacy + LegacyDisputeManager: LegacyDisputeManager + LegacyServiceRegistry: LegacyServiceRegistry +} + +export type SubgraphServiceContractName = (typeof SubgraphServiceContractNameList)[number] diff --git a/packages/toolshed/src/deployments/subgraph-service/index.ts b/packages/toolshed/src/deployments/subgraph-service/index.ts new file mode 100644 index 000000000..dde97a017 --- /dev/null +++ b/packages/toolshed/src/deployments/subgraph-service/index.ts @@ -0,0 +1,27 @@ +import { HardhatEthersProvider } from '@nomicfoundation/hardhat-ethers/internal/hardhat-ethers-provider' +import { loadActions } from './actions' +import { SubgraphServiceAddressBook } from './address-book' + +import type { Provider, Signer } from 'ethers' + +export { SubgraphServiceAddressBook } +export type { SubgraphServiceContractName, SubgraphServiceContracts } from './contracts' +export type { LegacyDisputeManager } from './types' + +export function loadSubgraphService(addressBookPath: string, chainId: number, provider: HardhatEthersProvider) { + const addressBook = new SubgraphServiceAddressBook(addressBookPath, chainId) + const contracts = addressBook.loadContracts(provider, true) + return { + addressBook: addressBook, + contracts: contracts, + actions: loadActions(contracts), + } +} + +export function connectSubgraphService(chainId: number, signerOrProvider: Signer | Provider, addressBookPath?: string) { + const addressBook = new SubgraphServiceAddressBook( + addressBookPath ?? require.resolve('@graphprotocol/subgraph-service/addresses.json'), + chainId, + ) + return addressBook.loadContracts(signerOrProvider, false) +} diff --git a/packages/toolshed/src/deployments/subgraph-service/types.ts b/packages/toolshed/src/deployments/subgraph-service/types.ts new file mode 100644 index 000000000..d0294a857 --- /dev/null +++ b/packages/toolshed/src/deployments/subgraph-service/types.ts @@ -0,0 +1,17 @@ +import type { + IDisputeManager, + IL2CurationToolshed, + IServiceRegistryToolshed, +} from '@graphprotocol/subgraph-service' + +import { + L2GNS, +} from '../horizon' + +// These are just type re-declarations to keep naming conventions consistent +export { + IL2CurationToolshed as L2Curation, + L2GNS, + IDisputeManager as LegacyDisputeManager, + IServiceRegistryToolshed as LegacyServiceRegistry, +} diff --git a/packages/toolshed/src/deployments/tx-logging.ts b/packages/toolshed/src/deployments/tx-logging.ts new file mode 100644 index 000000000..68f6502b6 --- /dev/null +++ b/packages/toolshed/src/deployments/tx-logging.ts @@ -0,0 +1,109 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ +import fs from 'fs' + +import { logTxLogging } from '../lib/logger' + +import type { + Contract, + ContractMethod, + ContractMethodArgs, + ContractRunner, + ContractTransactionReceipt, + ContractTransactionResponse, +} from 'ethers' + +/** + * Wraps contract calls with a modified call function that logs the tx details + * Also intercepts connect calls and wraps the returned contract with this function + * + * @remarks + * The overriden functions will: + * 1. Make the contract call + * 2. Wait for tx confirmation + * 3. Log the tx details and the receipt details, both to the console and to a file + * + * @param contract Contract to be wrapped + * @param contractName Name of the contract + * @returns the wrapped contract + */ +export function wrapTransactionCalls(contract: T, contractName: string): T { + return new Proxy(contract, { + get(target, prop) { + const orig = Reflect.get(target, prop) + + // Intercept connect calls + if (prop === 'connect') { + return (runner: ContractRunner) => { + const connected = orig.call(target, runner) as unknown as Contract + return wrapTransactionCalls(connected, contractName) + } + } + + // Only intercept function calls + if (typeof orig !== 'function') { + return orig + } + + // Only intercept function calls from the ABI + let fn: ContractMethod | undefined + try { + fn = contract.getFunction(String(prop)) + } catch (_) { + return orig + } + + // Only intercept state changing calls - aka transactions + const fragment = fn.fragment + if (['view', 'pure'].includes(fragment.stateMutability)) { + return orig + } + + // Finally, this is a transaction call so intercept it :D + return async (...args: unknown[]) => { + // Make the call + const response = await orig.apply(target, args) as ContractTransactionResponse + logContractTransaction(response, contractName, String(prop), args) + + // And wait for confirmation + const receipt = await response.wait() + if (receipt) { + logContractTransactionReceipt(receipt) + } + + return response + } + }, + }) +} + +function logContractTransaction( + tx: ContractTransactionResponse, + contractName: string, + fn: string, + args: ContractMethodArgs, +) { + const msg: string[] = [] + msg.push(`> Sending transaction: ${contractName}.${fn}`) + msg.push(` = Sender: ${tx.from}`) + msg.push(` = Contract: ${tx.to}`) + msg.push(` = Params: [ ${args.join(', ')} ]`) + msg.push(` = TxHash: ${tx.hash}`) + + logToConsoleAndFile(msg) +} + +function logContractTransactionReceipt(receipt: ContractTransactionReceipt) { + const msg: string[] = [] + msg.push(receipt.status ? ` ✔ Transaction succeeded!` : ` ✖ Transaction failed!`) + logToConsoleAndFile(msg) +} + +function logToConsoleAndFile(msg: string[]) { + const isoDate = new Date().toISOString() + const fileName = `tx-${isoDate.substring(0, 10)}.log` + + msg.map((line) => { + logTxLogging(line) + fs.appendFileSync(fileName, `[${isoDate}] ${line}\n`) + }) +} diff --git a/packages/toolshed/src/deployments/types.ts b/packages/toolshed/src/deployments/types.ts new file mode 100644 index 000000000..3ae96a884 --- /dev/null +++ b/packages/toolshed/src/deployments/types.ts @@ -0,0 +1,20 @@ +import type { GraphHorizonAddressBook, GraphHorizonContracts } from './horizon' +import type { SubgraphServiceAddressBook, SubgraphServiceContracts } from './subgraph-service' +import type { loadActions } from './horizon/actions' +import type { loadActions as loadSubgraphServiceActions } from './subgraph-service/actions' +export const GraphDeploymentsList = ['horizon', 'subgraphService'] as const + +export type GraphDeploymentName = (typeof GraphDeploymentsList)[number] + +export type GraphDeployments = { + horizon: { + contracts: GraphHorizonContracts + addressBook: GraphHorizonAddressBook + actions: ReturnType + } + subgraphService: { + contracts: SubgraphServiceContracts + addressBook: SubgraphServiceAddressBook + actions: ReturnType + } +} diff --git a/packages/toolshed/src/hardhat/config.ts b/packages/toolshed/src/hardhat/config.ts new file mode 100644 index 000000000..0b903c4ae --- /dev/null +++ b/packages/toolshed/src/hardhat/config.ts @@ -0,0 +1,16 @@ +/* eslint-disable @typescript-eslint/no-unsafe-assignment */ +/* eslint-disable @typescript-eslint/no-unsafe-call */ +import { existsSync } from 'fs' +import { globSync } from 'glob' +import { join } from 'path' + +export function loadTasks(rootPath: string) { + const tasksPath = join(rootPath, 'tasks') + const files: string[] = globSync('**/*.ts', { cwd: tasksPath, absolute: true }) + files.forEach(require) +} + +// This is going to fail if the project is using a different build directory +export function isProjectBuilt(rootPath: string) { + return existsSync(join(rootPath, 'build/contracts')) +} diff --git a/packages/toolshed/src/hardhat/erc20.ts b/packages/toolshed/src/hardhat/erc20.ts new file mode 100644 index 000000000..a071ae610 --- /dev/null +++ b/packages/toolshed/src/hardhat/erc20.ts @@ -0,0 +1,43 @@ +import { toBeHex, zeroPadValue } from 'ethers/utils' +import { keccak256 } from 'ethers/crypto' + +import type { Addressable } from 'ethers' +import type { HardhatEthersProvider } from '@nomicfoundation/hardhat-ethers/internal/hardhat-ethers-provider' + +export async function setGRTBalance( + provider: HardhatEthersProvider, + tokenAddress: string | Addressable, + userAddress: string | Addressable, + balance: bigint | string | number, +): Promise { + await setERC20Balance(provider, tokenAddress, userAddress, balance, 52) +} + +export async function setERC20Balance( + provider: HardhatEthersProvider, + tokenAddress: string | Addressable, + userAddress: string | Addressable, + balance: bigint | string | number, + slot = 0, +): Promise { + if (typeof tokenAddress !== 'string') { + tokenAddress = await tokenAddress.getAddress() + } + if (typeof userAddress !== 'string') { + userAddress = await userAddress.getAddress() + } + const paddedAddress = zeroPadValue(userAddress, 32) // 32-byte padded user address + const paddedSlot = zeroPadValue(toBeHex(slot), 32) // 32-byte padded slot index + + // Compute the storage key for the mapping: keccak256(paddedAddress ++ paddedSlot) + const storageKey = keccak256(paddedAddress + paddedSlot.slice(2)) + + // Pad the balance to 32 bytes + const paddedValue = toBeHex(balance, 32) + + await provider.send('hardhat_setStorageAt', [ + tokenAddress, + storageKey, + paddedValue, + ]) +} diff --git a/packages/toolshed/src/hardhat/event.ts b/packages/toolshed/src/hardhat/event.ts new file mode 100644 index 000000000..152c57918 --- /dev/null +++ b/packages/toolshed/src/hardhat/event.ts @@ -0,0 +1,23 @@ +import { ethers } from 'ethers' + +import type { TransactionResponse } from 'ethers' + +export async function getEventData(tx: TransactionResponse, eventAbi: string) { + const receipt = await tx.wait() + const abi = [ + eventAbi, + ] + const iface = new ethers.Interface(abi) + if (receipt?.logs === undefined) { + return [] + } + + for (const log of receipt.logs) { + const event = iface.parseLog(log) + if (event !== null) { + return event.args + } + } + + return [] +} diff --git a/packages/toolshed/src/hardhat/hardhat.base.config.ts b/packages/toolshed/src/hardhat/hardhat.base.config.ts new file mode 100644 index 000000000..60960e028 --- /dev/null +++ b/packages/toolshed/src/hardhat/hardhat.base.config.ts @@ -0,0 +1,146 @@ +import { resolveNodeModulesPath } from '../lib/path' +import { vars } from 'hardhat/config' + +import type { HardhatUserConfig, NetworksUserConfig, ProjectPathsUserConfig, SolidityUserConfig } from 'hardhat/types' + +// This base config file assumes the project is using the following hardhat plugins: +// - hardhat-graph-protocol +// - hardhat-secure-accounts +// - hardhat-verify +// To avoid adding those dependencies on toolshed we re-declare some types here +interface SecureAccountsOptions { + enabled?: boolean +} + +type GraphRuntimeEnvironmentOptions = { + deployments?: { + [deployment in ('horizon' | 'subgraphService')]?: string | { + addressBook: string + } + } +} + +interface EtherscanConfig { + apiKey: string | Record + customChains: { + network: string + chainId: number + urls: { + apiURL: string + browserURL: string + } + }[] + enabled: boolean +} + +// Hardhat variables +const ARBITRUM_ONE_RPC = vars.get('ARBITRUM_ONE_RPC', 'https://arb1.arbitrum.io/rpc') +const ARBITRUM_SEPOLIA_RPC = vars.get('ARBITRUM_SEPOLIA_RPC', 'https://sepolia-rollup.arbitrum.io/rpc') +const LOCAL_NETWORK_RPC = vars.get('LOCAL_NETWORK_RPC', 'http://chain:8545') +const LOCALHOST_RPC = vars.get('LOCALHOST_RPC', 'http://localhost:8545') + +export const solidityUserConfig: SolidityUserConfig = { + version: '0.8.27', + settings: { + optimizer: { + enabled: true, + runs: 100, + }, + }, +} + +export const projectPathsUserConfig: ProjectPathsUserConfig = { + artifacts: './build/contracts', + sources: './contracts', +} + +export const etherscanUserConfig: Partial = { + apiKey: { + ...(vars.has('ARBISCAN_API_KEY') && { + arbitrumSepolia: vars.get('ARBISCAN_API_KEY'), + }), + }, +} + +// In general: +// - "hardhat" is used for unit tests +// - "localhost" is used for local development on a hardhat network or fork +// - "localNetwork" is used for testing in the local network environment +type EnhancedNetworkConfig = T & { + secureAccounts?: SecureAccountsOptions + deployments?: { + horizon: string + subgraphService: string + } +} + +type BaseNetworksUserConfig = { + [K in keyof NetworksUserConfig]: EnhancedNetworkConfig +} +export const networksUserConfig: BaseNetworksUserConfig = { + hardhat: { + chainId: 31337, + accounts: { + mnemonic: 'myth like bonus scare over problem client lizard pioneer submit female collect', + }, + deployments: { + horizon: resolveNodeModulesPath('@graphprotocol/horizon/addresses-hardhat.json'), + subgraphService: resolveNodeModulesPath('@graphprotocol/subgraph-service/addresses-hardhat.json'), + }, + }, + localNetwork: { + chainId: 1337, + url: LOCAL_NETWORK_RPC, + deployments: { + horizon: resolveNodeModulesPath('@graphprotocol/horizon/addresses-local-network.json'), + subgraphService: resolveNodeModulesPath('@graphprotocol/subgraph-service/addresses-local-network.json'), + }, + }, + localhost: { + chainId: 31337, + url: LOCALHOST_RPC, + secureAccounts: { + enabled: true, + }, + deployments: { + horizon: resolveNodeModulesPath('@graphprotocol/horizon/addresses-localhost.json'), + subgraphService: resolveNodeModulesPath('@graphprotocol/subgraph-service/addresses-localhost.json'), + }, + }, + arbitrumOne: { + chainId: 42161, + url: ARBITRUM_ONE_RPC, + secureAccounts: { + enabled: true, + }, + }, + arbitrumSepolia: { + chainId: 421614, + url: ARBITRUM_SEPOLIA_RPC, + secureAccounts: { + enabled: true, + }, + }, +} + +type BaseHardhatConfig = HardhatUserConfig & + { etherscan: Partial } & + { graph: GraphRuntimeEnvironmentOptions } & + { secureAccounts: SecureAccountsOptions } +export const hardhatBaseConfig: BaseHardhatConfig = { + solidity: solidityUserConfig, + paths: projectPathsUserConfig, + secureAccounts: { + enabled: false, + }, + networks: networksUserConfig, + graph: { + deployments: { + horizon: resolveNodeModulesPath('@graphprotocol/horizon/addresses.json'), + subgraphService: resolveNodeModulesPath('@graphprotocol/subgraph-service/addresses.json'), + }, + }, + etherscan: etherscanUserConfig, +} + +export default hardhatBaseConfig diff --git a/packages/toolshed/src/hardhat/ignition.ts b/packages/toolshed/src/hardhat/ignition.ts new file mode 100644 index 000000000..d287dc440 --- /dev/null +++ b/packages/toolshed/src/hardhat/ignition.ts @@ -0,0 +1,124 @@ +import fs from 'fs' +import { parse } from 'json5' +import path from 'path' + +import type { AddressBook } from '../deployments/address-book' + +type IgnitionConfigValue = string | number +type IgnitionConfig = { + [key: string]: Record +} + +export function loadConfig(configPath: string, prefix: string, configName: string): { + config: IgnitionConfig + file: string +} { + prefix = process.env.IGNITION_DEPLOYMENT_TYPE ?? prefix + + const configFileCandidates = [ + path.resolve(process.cwd(), configPath, `${prefix}.${configName}.json5`), + path.resolve(process.cwd(), configPath, `${prefix}.default.json5`), + ] + + const configFile = configFileCandidates.find(file => fs.existsSync(file)) + if (!configFile) { + throw new Error( + `Config file not found. Tried:\n${configFileCandidates.map(f => `- ${f}`).join('\n')}`, + ) + } + + const config = parse(fs.readFileSync(configFile, 'utf8')) + + return { + config: removeNFromBigInts(config), + file: configFile, + } +} + +export function patchConfig(jsonData: IgnitionConfig, patches: IgnitionConfig): IgnitionConfig { + const result: IgnitionConfig = { ...jsonData } + for (const [key, patchValue] of Object.entries(patches)) { + const existingValue = result[key] + if (existingValue) { + result[key] = { ...existingValue, ...patchValue } + } else { + result[key] = patchValue + } + } + return result +} + +type IgnitionModuleResult = { + [key: string]: { + target: string + } +} + +export function saveToAddressBook( + ignitionModuleResult: unknown, + addressBook: AddressBook, +): AddressBook { + const contracts = ignitionModuleResult as IgnitionModuleResult + for (const [ignitionContractName, contract] of Object.entries(contracts)) { + // Proxy contracts + if (ignitionContractName.includes('_Proxy_')) { + const contractName = ignitionContractName.replace(/(Transparent_Proxy_|Graph_Proxy_)/, '') as ContractName + const proxy = ignitionContractName.includes('Transparent_Proxy_') ? 'transparent' : 'graph' + const entry = addressBook.entryExists(contractName) ? addressBook.getEntry(contractName) : {} + addressBook.setEntry(contractName, { + ...entry, + address: contract.target, + proxy, + }) + } + + // Proxy admin contracts + if (ignitionContractName.includes('_ProxyAdmin_')) { + const contractName = ignitionContractName.replace(/(Transparent_ProxyAdmin_|Graph_ProxyAdmin_)/, '') as ContractName + const proxy = ignitionContractName.includes('Transparent_ProxyAdmin_') ? 'transparent' : 'graph' + const entry = addressBook.entryExists(contractName) ? addressBook.getEntry(contractName) : {} + addressBook.setEntry(contractName, { + ...entry, + proxy, + proxyAdmin: contract.target, + }) + } + + // Implementation contracts + if (ignitionContractName.startsWith('Implementation_')) { + const contractName = ignitionContractName.replace('Implementation_', '') as ContractName + const entry = addressBook.entryExists(contractName) ? addressBook.getEntry(contractName) : {} + addressBook.setEntry(contractName, { + ...entry, + implementation: contract.target, + }) + } + + // Non proxied contracts + if (addressBook.isContractName(ignitionContractName)) { + const entry = addressBook.entryExists(ignitionContractName) ? addressBook.getEntry(ignitionContractName) : {} + addressBook.setEntry(ignitionContractName, { + ...entry, + address: contract.target, + }) + } + } + + return addressBook +} + +// Ignition requires "n" suffix for bigints, but not in js runtime +function removeNFromBigInts(config: IgnitionConfig): IgnitionConfig { + const result: IgnitionConfig = {} + for (const [key, value] of Object.entries(config)) { + if (typeof value === 'object') { + result[key] = Object.fromEntries( + Object.entries(value).map(([k, v]) => [ + k, + typeof v === 'string' && /^\d+n$/.test(v) ? v.slice(0, -1) : v, + ]), + ) + } + } + return result +} diff --git a/packages/toolshed/src/hardhat/index.ts b/packages/toolshed/src/hardhat/index.ts new file mode 100644 index 000000000..a92e9776d --- /dev/null +++ b/packages/toolshed/src/hardhat/index.ts @@ -0,0 +1,6 @@ +export { hardhatBaseConfig } from './hardhat.base.config' +export { isProjectBuilt, loadTasks } from './config' +export { loadConfig, patchConfig, saveToAddressBook } from './ignition' +export { requireLocalNetwork } from './local' +export { setERC20Balance, setGRTBalance } from './erc20' +export { getEventData } from './event' diff --git a/packages/toolshed/src/hardhat/local.ts b/packages/toolshed/src/hardhat/local.ts new file mode 100644 index 000000000..1258b08b6 --- /dev/null +++ b/packages/toolshed/src/hardhat/local.ts @@ -0,0 +1,21 @@ +import type { HardhatEthersProvider } from '@nomicfoundation/hardhat-ethers/internal/hardhat-ethers-provider' +import type { HardhatRuntimeEnvironment } from 'hardhat/types' + +const localNetworks = ['localhost', 'hardhat', 'localNetwork'] + +export function requireLocalNetwork(hre: HardhatRuntimeEnvironment) { + if (!localNetworks.includes(hre.network.name)) { + throw new Error(`Network ${hre.network.name} is not a local network.`) + } +} + +export async function warp(provider: HardhatEthersProvider, seconds: number) { + await provider.send('evm_increaseTime', [seconds]) + await provider.send('evm_mine', []) +} + +export async function mine(provider: HardhatEthersProvider, blocks: number) { + for (let i = 0; i < blocks; i++) { + await provider.send('evm_mine', []) + } +} diff --git a/packages/toolshed/src/lib/assert.ts b/packages/toolshed/src/lib/assert.ts new file mode 100644 index 000000000..f215a9497 --- /dev/null +++ b/packages/toolshed/src/lib/assert.ts @@ -0,0 +1,11 @@ +import { AssertionError } from 'assert' + +export function assertObject( + value: unknown, + errorMessage?: string, +): asserts value is Record { + if (typeof value !== 'object' || value == null) + throw new AssertionError({ + message: errorMessage ?? 'Not an object', + }) +} diff --git a/packages/toolshed/src/lib/bytes.ts b/packages/toolshed/src/lib/bytes.ts new file mode 100644 index 000000000..e688fc72f --- /dev/null +++ b/packages/toolshed/src/lib/bytes.ts @@ -0,0 +1,3 @@ +import { ethers } from 'ethers' + +export const randomHexBytes = (n = 32): string => ethers.hexlify(ethers.randomBytes(n)) diff --git a/packages/toolshed/src/lib/logger.ts b/packages/toolshed/src/lib/logger.ts new file mode 100644 index 000000000..c8aa2dd6a --- /dev/null +++ b/packages/toolshed/src/lib/logger.ts @@ -0,0 +1,9 @@ +import debug from 'debug' + +const LOG_BASE = 'toolshed' + +export const logDebug = debug(`${LOG_BASE}:debug`) +export const logWarn = debug(`${LOG_BASE}:warn`) +export const logError = debug(`${LOG_BASE}:error`) + +export const logTxLogging = debug(`${LOG_BASE}:tx`) diff --git a/packages/toolshed/src/lib/path.ts b/packages/toolshed/src/lib/path.ts new file mode 100644 index 000000000..bab48884e --- /dev/null +++ b/packages/toolshed/src/lib/path.ts @@ -0,0 +1,38 @@ +import fs from 'fs' +import path from 'path' + +export function findPathUp(startPath: string, pathToFind: string): string | null { + let currentDir = path.resolve(startPath) + + while (currentDir !== path.dirname(currentDir)) { + const candidate = path.join(currentDir, pathToFind) + if (fs.existsSync(candidate) && fs.statSync(candidate).isDirectory()) { + return candidate + } + + const parentDir = path.dirname(currentDir) + if (parentDir === currentDir) { + return null + } + + currentDir = parentDir + } + + return null +} + +// Useful if you need to resolve a path to a file that might not exist but you +// know it will eventually exist in the node_modules directory +export function resolveNodeModulesPath(fileName: string): string { + const basePath = findPathUp(__dirname, 'node_modules') + if (!basePath) { + throw new Error('Could not find node_modules directory') + } + return path.resolve(basePath, fileName) +} + +// Useful if you need to resolve a path to a file that exists in a package +export function resolvePackagePath(packageName: string, relativePath: string): string { + const packageRoot = path.dirname(require.resolve(`${packageName}/package.json`)) + return path.join(packageRoot, relativePath) +} diff --git a/packages/toolshed/src/utils/banner.ts b/packages/toolshed/src/utils/banner.ts new file mode 100644 index 000000000..50aa4ff77 --- /dev/null +++ b/packages/toolshed/src/utils/banner.ts @@ -0,0 +1,58 @@ +/** + * Creates and prints a box-style banner with centered text to the console + * @param title The main title text to display + * @param prefix Optional prefix text that appears before the title (default: '') + * @param minWidth Minimum width of the banner (default: 47) + */ +export function printBanner(title: string, prefix = '', minWidth = 47): void { + // Format title with capitalized words if it contains hyphens + const formattedTitle = title.includes('-') + ? title + .split('-') + .map(word => word.charAt(0).toUpperCase() + word.slice(1)) + .join(' ') + : title + + const fullText = prefix + formattedTitle + + // Calculate minimum banner width needed for the text + const contentWidth = fullText.length + const bannerWidth = Math.max(minWidth, contentWidth + 10) // Add padding + + // Create the centered text line + const paddingLeft = Math.floor((bannerWidth - contentWidth) / 2) + const paddingRight = bannerWidth - contentWidth - paddingLeft + const centeredLine = '|' + ' '.repeat(paddingLeft) + fullText + ' '.repeat(paddingRight) + '|' + + // Create empty line with correct width + const emptyLine = '|' + ' '.repeat(bannerWidth) + '|' + + // Create border with correct width + const border = '+' + '-'.repeat(bannerWidth) + '+' + + console.log(` +${border} +${emptyLine} +${centeredLine} +${emptyLine} +${border} +`) +} + +export function printHorizonBanner() { + console.log(` + ██╗ ██╗ ██████╗ ██████╗ ██╗███████╗ ██████╗ ███╗ ██╗ + ██║ ██║██╔═══██╗██╔══██╗██║╚══███╔╝██╔═══██╗████╗ ██║ + ███████║██║ ██║██████╔╝██║ ███╔╝ ██║ ██║██╔██╗ ██║ + ██╔══██║██║ ██║██╔══██╗██║ ███╔╝ ██║ ██║██║╚██╗██║ + ██║ ██║╚██████╔╝██║ ██║██║███████╗╚██████╔╝██║ ╚████║ + ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝╚══════╝ ╚═════╝ ╚═╝ ╚═══╝ + + ██╗ ██╗██████╗ ██████╗ ██████╗ █████╗ ██████╗ ███████╗ + ██║ ██║██╔══██╗██╔════╝ ██╔══██╗██╔══██╗██╔══██╗██╔════╝ + ██║ ██║██████╔╝██║ ███╗██████╔╝███████║██║ ██║█████╗ + ██║ ██║██╔═══╝ ██║ ██║██╔══██╗██╔══██║██║ ██║██╔══╝ + ╚██████╔╝██║ ╚██████╔╝██║ ██║██║ ██║██████╔╝███████╗ + ╚═════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═════╝ ╚══════╝ + `) +} diff --git a/packages/toolshed/src/utils/bigint.ts b/packages/toolshed/src/utils/bigint.ts new file mode 100644 index 000000000..544375eae --- /dev/null +++ b/packages/toolshed/src/utils/bigint.ts @@ -0,0 +1,18 @@ +import { hexlify } from 'ethers' + +import { randomBytes } from 'ethers' + +export function randomBigInt(min: bigint, max: bigint): bigint { + if (min > max) throw new Error('min must be <= max') + const range = max - min + 1n + const bits = range.toString(2).length + const byteLen = Math.ceil(bits / 8) + + let rand: bigint + do { + const bytes = randomBytes(byteLen) + rand = BigInt('0x' + hexlify(bytes).slice(2)) + } while (rand >= range) + + return min + rand +} diff --git a/packages/toolshed/src/utils/index.ts b/packages/toolshed/src/utils/index.ts new file mode 100644 index 000000000..ecfc5c9c0 --- /dev/null +++ b/packages/toolshed/src/utils/index.ts @@ -0,0 +1,2 @@ +export * from './banner' +export * from './bigint' diff --git a/packages/toolshed/tsconfig.json b/packages/toolshed/tsconfig.json new file mode 100644 index 000000000..e5a013f47 --- /dev/null +++ b/packages/toolshed/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "target": "es2020", + "module": "node16", + "declaration": true, + "declarationMap": true, + "sourceMap": true, + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "strict": true, + "skipLibCheck": true, + "resolveJsonModule": true, + "outDir": "dist", + }, + "include": ["eslint.config.js", "src/**/*.ts", "test/**/*.ts"], +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml new file mode 100644 index 000000000..218bf7461 --- /dev/null +++ b/pnpm-lock.yaml @@ -0,0 +1,26432 @@ +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + + .: + devDependencies: + '@changesets/cli': + specifier: ^2.27.1 + version: 2.29.3 + '@commitlint/cli': + specifier: ^18.4.3 + version: 18.6.1(@types/node@22.7.5)(typescript@5.8.3) + '@commitlint/config-conventional': + specifier: ^18.4.3 + version: 18.6.3 + husky: + specifier: ^8.0.3 + version: 8.0.3 + + packages/contracts: + devDependencies: + '@arbitrum/sdk': + specifier: ~3.1.13 + version: 3.1.13(bufferutil@4.0.9)(utf-8-validate@5.0.10) + '@defi-wonderland/smock': + specifier: ~2.3.0 + version: 2.3.5(@ethersproject/abi@5.8.0)(@ethersproject/abstract-provider@5.8.0)(@ethersproject/abstract-signer@5.8.0)(@nomiclabs/hardhat-ethers@2.2.3(ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)))(ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)) + '@ethersproject/abi': + specifier: ^5.8.0 + version: 5.8.0 + '@ethersproject/abstract-provider': + specifier: ^5.8.0 + version: 5.8.0 + '@ethersproject/bytes': + specifier: ^5.8.0 + version: 5.8.0 + '@ethersproject/experimental': + specifier: ^5.6.0 + version: 5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + '@ethersproject/providers': + specifier: ^5.8.0 + version: 5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + '@graphprotocol/common-ts': + specifier: ^1.8.3 + version: 1.8.7(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10) + '@graphprotocol/sdk': + specifier: 0.5.4 + version: 0.5.4(bufferutil@4.0.9)(encoding@0.1.13)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10) + '@nomicfoundation/hardhat-network-helpers': + specifier: ^1.0.0 + version: 1.0.12(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)) + '@nomiclabs/hardhat-ethers': + specifier: ^2.2.3 + version: 2.2.3(ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)) + '@nomiclabs/hardhat-etherscan': + specifier: ^3.1.7 + version: 3.1.8(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)) + '@nomiclabs/hardhat-waffle': + specifier: 2.0.3 + version: 2.0.3(@nomiclabs/hardhat-ethers@2.2.3(ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)))(ethereum-waffle@3.4.4(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.8.3)(utf-8-validate@5.0.10))(ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)) + '@openzeppelin/contracts': + specifier: ^3.4.1 + version: 3.4.2 + '@openzeppelin/contracts-upgradeable': + specifier: 3.4.2 + version: 3.4.2 + '@openzeppelin/hardhat-defender': + specifier: ^1.8.1 + version: 1.9.0(@nomiclabs/hardhat-ethers@2.2.3(ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)))(@nomiclabs/hardhat-etherscan@3.1.8(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)))(bufferutil@4.0.9)(encoding@0.1.13)(ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10))(utf-8-validate@5.0.10) + '@openzeppelin/hardhat-upgrades': + specifier: ^1.6.0 + version: 1.28.0(@nomiclabs/hardhat-ethers@2.2.3(ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)))(@nomiclabs/hardhat-etherscan@3.1.8(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)))(encoding@0.1.13)(ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)) + '@tenderly/hardhat-tenderly': + specifier: 1.0.13 + version: 1.0.13(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)) + '@typechain/ethers-v5': + specifier: ^7.0.0 + version: 7.2.0(@ethersproject/abi@5.8.0)(@ethersproject/bytes@5.8.0)(@ethersproject/providers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(typechain@5.2.0(typescript@5.8.3))(typescript@5.8.3) + '@typechain/hardhat': + specifier: ^2.0.0 + version: 2.3.1(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10))(lodash@4.17.21)(typechain@5.2.0(typescript@5.8.3)) + '@types/bs58': + specifier: ^4.0.1 + version: 4.0.4 + '@types/chai': + specifier: 4.3.4 + version: 4.3.4 + '@types/chai-as-promised': + specifier: ^7.1.5 + version: 7.1.8 + '@types/glob': + specifier: ^7.2.0 + version: 7.2.0 + '@types/inquirer': + specifier: ^7.3.1 + version: 7.3.3 + '@types/minimist': + specifier: ^1.2.1 + version: 1.2.5 + '@types/mocha': + specifier: ^8.2.2 + version: 8.2.3 + '@types/node': + specifier: ^20.9.0 + version: 20.17.32 + '@types/sinon-chai': + specifier: ^3.2.12 + version: 3.2.12 + '@types/winston': + specifier: ^2.4.4 + version: 2.4.4 + '@types/yargs': + specifier: ^16.0.0 + version: 16.0.9 + '@urql/core': + specifier: ^2.1.3 + version: 2.6.1(graphql@16.8.0) + arbos-precompiles: + specifier: ^1.0.2 + version: 1.0.2(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10) + axios: + specifier: ^1.8.4 + version: 1.9.0(debug@4.4.0) + bignumber.js: + specifier: 9.1.2 + version: 9.1.2 + chai: + specifier: 4.3.4 + version: 4.3.4 + chai-as-promised: + specifier: ^7.1.1 + version: 7.1.2(chai@4.3.4) + cli-table: + specifier: ^0.3.6 + version: 0.3.11 + console-table-printer: + specifier: ^2.11.1 + version: 2.12.1 + dotenv: + specifier: ^9.0.0 + version: 9.0.2 + eslint: + specifier: ^8.57.0 + version: 8.57.1 + eslint-graph-config: + specifier: workspace:^0.0.1 + version: link:../eslint-graph-config + ethereum-waffle: + specifier: ^3.2.0 + version: 3.4.4(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.8.3)(utf-8-validate@5.0.10) + ethers: + specifier: ^5.7.2 + version: 5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + form-data: + specifier: ^4.0.0 + version: 4.0.2 + glob: + specifier: ^8.0.3 + version: 8.1.0 + graphql-tag: + specifier: ^2.12.4 + version: 2.12.6(graphql@16.8.0) + hardhat: + specifier: ~2.14.0 + version: 2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10) + hardhat-abi-exporter: + specifier: ^2.2.0 + version: 2.11.0(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)) + hardhat-contract-sizer: + specifier: ^2.0.3 + version: 2.10.0(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)) + hardhat-gas-reporter: + specifier: ^1.0.4 + version: 1.0.10(bufferutil@4.0.9)(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10))(utf-8-validate@5.0.10) + hardhat-secure-accounts: + specifier: 0.0.5 + version: 0.0.5(@nomiclabs/hardhat-ethers@2.2.3(ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)))(ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)) + hardhat-storage-layout: + specifier: 0.1.6 + version: 0.1.6(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)) + hardhat-tracer: + specifier: ^1.0.0-alpha.6 + version: 1.3.0(chalk@5.4.1)(ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)) + inquirer: + specifier: ^8.0.0 + version: 8.0.0 + ipfs-http-client: + specifier: 47.0.1 + version: 47.0.1(encoding@0.1.13) + isomorphic-fetch: + specifier: ^3.0.0 + version: 3.0.0(encoding@0.1.13) + lint-staged: + specifier: ^10.5.4 + version: 10.5.4 + p-queue: + specifier: ^6.6.1 + version: 6.6.2 + prettier: + specifier: ^3.2.5 + version: 3.5.3 + prettier-plugin-solidity: + specifier: ^1.3.1 + version: 1.4.3(prettier@3.5.3) + solhint: + specifier: ^4.1.1 + version: 4.5.4(typescript@5.8.3) + solhint-graph-config: + specifier: workspace:^0.0.1 + version: link:../solhint-graph-config + solhint-plugin-graph: + specifier: workspace:^0.0.1 + version: link:../solhint-plugin-graph + solidity-coverage: + specifier: ^0.7.16 + version: 0.7.22(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10) + ts-node: + specifier: ^10.9.1 + version: 10.9.2(@types/node@20.17.32)(typescript@5.8.3) + typechain: + specifier: ^5.0.0 + version: 5.2.0(typescript@5.8.3) + typescript: + specifier: ^5.2.2 + version: 5.8.3 + winston: + specifier: ^3.3.3 + version: 3.17.0 + yaml: + specifier: ^1.10.2 + version: 1.10.2 + yargs: + specifier: ^17.0.0 + version: 17.7.2 + + packages/data-edge: + devDependencies: + '@commitlint/cli': + specifier: ^16.2.1 + version: 16.3.0 + '@commitlint/config-conventional': + specifier: ^16.2.1 + version: 16.2.4 + '@nomiclabs/hardhat-ethers': + specifier: ^2.0.2 + version: 2.2.3(ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@17.0.45)(typescript@4.9.5))(typescript@4.9.5)(utf-8-validate@5.0.10)) + '@nomiclabs/hardhat-etherscan': + specifier: ^3.1.2 + version: 3.1.8(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@17.0.45)(typescript@4.9.5))(typescript@4.9.5)(utf-8-validate@5.0.10)) + '@nomiclabs/hardhat-waffle': + specifier: ^2.0.1 + version: 2.0.3(@nomiclabs/hardhat-ethers@2.2.3(ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@17.0.45)(typescript@4.9.5))(typescript@4.9.5)(utf-8-validate@5.0.10)))(ethereum-waffle@3.4.4(bufferutil@4.0.9)(encoding@0.1.13)(typescript@4.9.5)(utf-8-validate@5.0.10))(ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@17.0.45)(typescript@4.9.5))(typescript@4.9.5)(utf-8-validate@5.0.10)) + '@openzeppelin/contracts': + specifier: ^4.5.0 + version: 4.9.6 + '@openzeppelin/hardhat-upgrades': + specifier: ^1.8.2 + version: 1.28.0(@nomiclabs/hardhat-ethers@2.2.3(ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@17.0.45)(typescript@4.9.5))(typescript@4.9.5)(utf-8-validate@5.0.10)))(@nomiclabs/hardhat-etherscan@3.1.8(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@17.0.45)(typescript@4.9.5))(typescript@4.9.5)(utf-8-validate@5.0.10)))(encoding@0.1.13)(ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@17.0.45)(typescript@4.9.5))(typescript@4.9.5)(utf-8-validate@5.0.10)) + '@tenderly/api-client': + specifier: ^1.0.13 + version: 1.1.0(ts-node@10.9.2(@types/node@17.0.45)(typescript@4.9.5))(typescript@4.9.5) + '@tenderly/hardhat-tenderly': + specifier: ^1.0.13 + version: 1.0.13(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@17.0.45)(typescript@4.9.5))(typescript@4.9.5)(utf-8-validate@5.0.10)) + '@typechain/ethers-v5': + specifier: ^9.0.0 + version: 9.0.0(@ethersproject/abi@5.8.0)(@ethersproject/bytes@5.8.0)(@ethersproject/providers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(typechain@7.0.1(typescript@4.9.5))(typescript@4.9.5) + '@typechain/hardhat': + specifier: ^4.0.0 + version: 4.0.0(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@17.0.45)(typescript@4.9.5))(typescript@4.9.5)(utf-8-validate@5.0.10))(lodash@4.17.21)(typechain@7.0.1(typescript@4.9.5)) + '@types/mocha': + specifier: ^9.0.0 + version: 9.1.1 + '@types/node': + specifier: ^17.0.0 + version: 17.0.45 + chai: + specifier: ^4.2.0 + version: 4.5.0 + dotenv: + specifier: ^16.0.0 + version: 16.5.0 + eslint: + specifier: ^8.57.0 + version: 8.57.1 + eslint-graph-config: + specifier: workspace:^0.0.1 + version: link:../eslint-graph-config + ethereum-waffle: + specifier: ^3.0.2 + version: 3.4.4(bufferutil@4.0.9)(encoding@0.1.13)(typescript@4.9.5)(utf-8-validate@5.0.10) + ethers: + specifier: ^5.1.3 + version: 5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + ethlint: + specifier: ^1.2.5 + version: 1.2.5(solium@1.2.5) + hardhat: + specifier: ~2.14.0 + version: 2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@17.0.45)(typescript@4.9.5))(typescript@4.9.5)(utf-8-validate@5.0.10) + hardhat-abi-exporter: + specifier: ^2.2.0 + version: 2.11.0(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@17.0.45)(typescript@4.9.5))(typescript@4.9.5)(utf-8-validate@5.0.10)) + hardhat-contract-sizer: + specifier: ^2.0.3 + version: 2.10.0(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@17.0.45)(typescript@4.9.5))(typescript@4.9.5)(utf-8-validate@5.0.10)) + hardhat-gas-reporter: + specifier: ^1.0.4 + version: 1.0.10(bufferutil@4.0.9)(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@17.0.45)(typescript@4.9.5))(typescript@4.9.5)(utf-8-validate@5.0.10))(utf-8-validate@5.0.10) + husky: + specifier: ^7.0.4 + version: 7.0.4 + lint-staged: + specifier: ^12.3.5 + version: 12.5.0(enquirer@2.4.1) + prettier: + specifier: ^2.1.1 + version: 2.8.8 + prettier-plugin-solidity: + specifier: ^1.0.0-alpha.56 + version: 1.4.3(prettier@2.8.8) + solhint: + specifier: ^4.5.2 + version: 4.5.4(typescript@4.9.5) + solhint-graph-config: + specifier: workspace:^0.0.1 + version: link:../solhint-graph-config + solidity-coverage: + specifier: ^0.7.10 + version: 0.7.22(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10) + truffle-flattener: + specifier: ^1.4.4 + version: 1.6.0 + ts-node: + specifier: ^10.5.0 + version: 10.9.2(@types/node@17.0.45)(typescript@4.9.5) + typechain: + specifier: ^7.0.0 + version: 7.0.1(typescript@4.9.5) + typescript: + specifier: ^4.0.2 + version: 4.9.5 + + packages/eslint-graph-config: + dependencies: + '@stylistic/eslint-plugin': + specifier: ^1.6.2 + version: 1.8.1(eslint@8.57.1)(typescript@5.8.3) + eslint: + specifier: ^8.56.0 + version: 8.57.1 + eslint-plugin-no-only-tests: + specifier: ^3.1.0 + version: 3.3.0 + eslint-plugin-no-secrets: + specifier: ^0.8.9 + version: 0.8.9(eslint@8.57.1) + typescript-eslint: + specifier: ^7.0.2 + version: 7.18.0(eslint@8.57.1)(typescript@5.8.3) + devDependencies: + '@types/eslint__js': + specifier: ^8.42.3 + version: 8.42.3 + '@types/node': + specifier: ^20.11.19 + version: 20.17.32 + globals: + specifier: ^16.0.0 + version: 16.0.0 + typescript: + specifier: ^5.3.3 + version: 5.8.3 + + packages/hardhat-graph-protocol: + dependencies: + '@graphprotocol/toolshed': + specifier: workspace:^ + version: link:../toolshed + '@nomicfoundation/hardhat-ethers': + specifier: 3.0.8 + version: 3.0.8(ethers@6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@8.10.2(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)) + debug: + specifier: ^4.3.7 + version: 4.4.0(supports-color@9.4.0) + json5: + specifier: ^2.2.3 + version: 2.2.3 + devDependencies: + '@nomicfoundation/hardhat-verify': + specifier: ^2.0.12 + version: 2.0.13(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@8.10.2(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)) + '@types/chai': + specifier: ^4.0.0 + version: 4.3.20 + '@types/debug': + specifier: ^4.1.12 + version: 4.1.12 + '@types/mocha': + specifier: ^10.0.9 + version: 10.0.10 + chai: + specifier: ^4.0.0 + version: 4.5.0 + eslint: + specifier: ^8.56.0 + version: 8.57.1 + eslint-graph-config: + specifier: workspace:^0.0.1 + version: link:../eslint-graph-config + ethers: + specifier: 6.13.7 + version: 6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10) + hardhat: + specifier: ^2.22.16 + version: 2.23.0(bufferutil@4.0.9)(ts-node@8.10.2(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10) + hardhat-secure-accounts: + specifier: ^1.0.4 + version: 1.0.5(@nomicfoundation/hardhat-ethers@3.0.8(ethers@6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@8.10.2(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)))(ethers@6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@8.10.2(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)) + mocha: + specifier: ^10.8.2 + version: 10.8.2 + ts-node: + specifier: ^8.0.0 + version: 8.10.2(typescript@5.8.3) + typescript: + specifier: ^5.6.3 + version: 5.8.3 + + packages/horizon: + devDependencies: + '@defi-wonderland/natspec-smells': + specifier: ^1.1.6 + version: 1.1.6(typescript@5.8.3)(zod@3.24.4) + '@graphprotocol/contracts': + specifier: workspace:^7.1.2 + version: link:../contracts + '@graphprotocol/toolshed': + specifier: workspace:^ + version: link:../toolshed + '@nomicfoundation/hardhat-chai-matchers': + specifier: ^2.0.0 + version: 2.0.8(@nomicfoundation/hardhat-ethers@3.0.8(ethers@6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)))(chai@4.5.0)(ethers@6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)) + '@nomicfoundation/hardhat-ethers': + specifier: 3.0.8 + version: 3.0.8(ethers@6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)) + '@nomicfoundation/hardhat-foundry': + specifier: ^1.1.1 + version: 1.1.3(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)) + '@nomicfoundation/hardhat-ignition': + specifier: ^0.15.9 + version: 0.15.11(@nomicfoundation/hardhat-verify@2.0.13(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)))(bufferutil@4.0.9)(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10))(utf-8-validate@5.0.10) + '@nomicfoundation/hardhat-ignition-ethers': + specifier: ^0.15.9 + version: 0.15.11(@nomicfoundation/hardhat-ethers@3.0.8(ethers@6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)))(@nomicfoundation/hardhat-ignition@0.15.11(@nomicfoundation/hardhat-verify@2.0.13(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)))(bufferutil@4.0.9)(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10))(utf-8-validate@5.0.10))(@nomicfoundation/ignition-core@0.15.11(bufferutil@4.0.9)(utf-8-validate@5.0.10))(ethers@6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)) + '@nomicfoundation/hardhat-network-helpers': + specifier: ^1.0.0 + version: 1.0.12(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)) + '@nomicfoundation/hardhat-toolbox': + specifier: ^4.0.0 + version: 4.0.0(@nomicfoundation/hardhat-chai-matchers@2.0.8(@nomicfoundation/hardhat-ethers@3.0.8(ethers@6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)))(chai@4.5.0)(ethers@6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)))(@nomicfoundation/hardhat-ethers@3.0.8(ethers@6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)))(@nomicfoundation/hardhat-network-helpers@1.0.12(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)))(@nomicfoundation/hardhat-verify@2.0.13(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)))(@typechain/ethers-v6@0.5.1(ethers@6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10))(typechain@8.3.2(typescript@5.8.3))(typescript@5.8.3))(@typechain/hardhat@9.1.0(@typechain/ethers-v6@0.5.1(ethers@6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10))(typechain@8.3.2(typescript@5.8.3))(typescript@5.8.3))(ethers@6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10))(typechain@8.3.2(typescript@5.8.3)))(@types/chai@4.3.20)(@types/mocha@10.0.10)(@types/node@20.17.32)(chai@4.5.0)(ethers@6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat-gas-reporter@1.0.10(bufferutil@4.0.9)(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10))(utf-8-validate@5.0.10))(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10))(solidity-coverage@0.8.15(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)))(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typechain@8.3.2(typescript@5.8.3))(typescript@5.8.3) + '@nomicfoundation/hardhat-verify': + specifier: ^2.0.10 + version: 2.0.13(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)) + '@nomicfoundation/ignition-core': + specifier: ^0.15.9 + version: 0.15.11(bufferutil@4.0.9)(utf-8-validate@5.0.10) + '@openzeppelin/contracts': + specifier: ^5.0.2 + version: 5.3.0 + '@openzeppelin/contracts-upgradeable': + specifier: ^5.0.2 + version: 5.3.0(@openzeppelin/contracts@5.3.0) + '@typechain/ethers-v6': + specifier: ^0.5.0 + version: 0.5.1(ethers@6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10))(typechain@8.3.2(typescript@5.8.3))(typescript@5.8.3) + '@typechain/hardhat': + specifier: ^9.0.0 + version: 9.1.0(@typechain/ethers-v6@0.5.1(ethers@6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10))(typechain@8.3.2(typescript@5.8.3))(typescript@5.8.3))(ethers@6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10))(typechain@8.3.2(typescript@5.8.3)) + '@types/chai': + specifier: ^4.2.0 + version: 4.3.20 + '@types/mocha': + specifier: '>=9.1.0' + version: 10.0.10 + '@types/node': + specifier: '>=16.0.0' + version: 20.17.32 + chai: + specifier: ^4.2.0 + version: 4.5.0 + eslint: + specifier: ^8.56.0 + version: 8.57.1 + eslint-graph-config: + specifier: workspace:^0.0.1 + version: link:../eslint-graph-config + ethers: + specifier: 6.13.7 + version: 6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10) + glob: + specifier: ^11.0.1 + version: 11.0.2 + hardhat: + specifier: ^2.22.18 + version: 2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10) + hardhat-contract-sizer: + specifier: ^2.10.0 + version: 2.10.0(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)) + hardhat-gas-reporter: + specifier: ^1.0.8 + version: 1.0.10(bufferutil@4.0.9)(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10))(utf-8-validate@5.0.10) + hardhat-graph-protocol: + specifier: workspace:^0.1.21 + version: link:../hardhat-graph-protocol + hardhat-secure-accounts: + specifier: ^1.0.5 + version: 1.0.5(@nomicfoundation/hardhat-ethers@3.0.8(ethers@6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)))(ethers@6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)) + lint-staged: + specifier: ^15.2.2 + version: 15.5.1 + prettier: + specifier: ^3.2.5 + version: 3.5.3 + prettier-plugin-solidity: + specifier: ^1.3.1 + version: 1.4.3(prettier@3.5.3) + solhint: + specifier: ^4.5.2 + version: 4.5.4(typescript@5.8.3) + solhint-graph-config: + specifier: workspace:^0.0.1 + version: link:../solhint-graph-config + solhint-plugin-graph: + specifier: workspace:^0.0.1 + version: link:../solhint-plugin-graph + solidity-coverage: + specifier: ^0.8.0 + version: 0.8.15(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)) + ts-node: + specifier: '>=8.0.0' + version: 10.9.2(@types/node@20.17.32)(typescript@5.8.3) + typechain: + specifier: ^8.3.0 + version: 8.3.2(typescript@5.8.3) + typescript: + specifier: ^5.6.3 + version: 5.8.3 + + packages/solhint-graph-config: + dependencies: + prettier: + specifier: ^3.2.5 + version: 3.5.3 + prettier-plugin-solidity: + specifier: ^1.3.1 + version: 1.4.3(prettier@3.5.3) + solhint: + specifier: ^4.5.4 + version: 4.5.4(typescript@5.8.3) + solhint-plugin-graph: + specifier: workspace:* + version: link:../solhint-plugin-graph + + packages/solhint-plugin-graph: {} + + packages/subgraph-service: + devDependencies: + '@defi-wonderland/natspec-smells': + specifier: ^1.1.6 + version: 1.1.6(typescript@5.8.3)(zod@3.24.4) + '@graphprotocol/contracts': + specifier: workspace:^7.1.2 + version: link:../contracts + '@graphprotocol/horizon': + specifier: workspace:^0.3.3 + version: link:../horizon + '@graphprotocol/toolshed': + specifier: workspace:^ + version: link:../toolshed + '@nomicfoundation/hardhat-chai-matchers': + specifier: ^2.0.0 + version: 2.0.8(@nomicfoundation/hardhat-ethers@3.0.8(ethers@6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)))(chai@4.5.0)(ethers@6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)) + '@nomicfoundation/hardhat-ethers': + specifier: 3.0.8 + version: 3.0.8(ethers@6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)) + '@nomicfoundation/hardhat-foundry': + specifier: ^1.1.1 + version: 1.1.3(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)) + '@nomicfoundation/hardhat-ignition': + specifier: ^0.15.9 + version: 0.15.11(@nomicfoundation/hardhat-verify@2.0.13(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)))(bufferutil@4.0.9)(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10))(utf-8-validate@5.0.10) + '@nomicfoundation/hardhat-ignition-ethers': + specifier: ^0.15.9 + version: 0.15.11(@nomicfoundation/hardhat-ethers@3.0.8(ethers@6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)))(@nomicfoundation/hardhat-ignition@0.15.11(@nomicfoundation/hardhat-verify@2.0.13(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)))(bufferutil@4.0.9)(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10))(utf-8-validate@5.0.10))(@nomicfoundation/ignition-core@0.15.11(bufferutil@4.0.9)(utf-8-validate@5.0.10))(ethers@6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)) + '@nomicfoundation/hardhat-network-helpers': + specifier: ^1.0.0 + version: 1.0.12(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)) + '@nomicfoundation/hardhat-toolbox': + specifier: ^4.0.0 + version: 4.0.0(@nomicfoundation/hardhat-chai-matchers@2.0.8(@nomicfoundation/hardhat-ethers@3.0.8(ethers@6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)))(chai@4.5.0)(ethers@6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)))(@nomicfoundation/hardhat-ethers@3.0.8(ethers@6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)))(@nomicfoundation/hardhat-network-helpers@1.0.12(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)))(@nomicfoundation/hardhat-verify@2.0.13(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)))(@typechain/ethers-v6@0.5.1(ethers@6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10))(typechain@8.3.2(typescript@5.8.3))(typescript@5.8.3))(@typechain/hardhat@9.1.0(@typechain/ethers-v6@0.5.1(ethers@6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10))(typechain@8.3.2(typescript@5.8.3))(typescript@5.8.3))(ethers@6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10))(typechain@8.3.2(typescript@5.8.3)))(@types/chai@4.3.20)(@types/mocha@10.0.10)(@types/node@20.17.32)(chai@4.5.0)(ethers@6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat-gas-reporter@1.0.10(bufferutil@4.0.9)(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10))(utf-8-validate@5.0.10))(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10))(solidity-coverage@0.8.15(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)))(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typechain@8.3.2(typescript@5.8.3))(typescript@5.8.3) + '@nomicfoundation/hardhat-verify': + specifier: ^2.0.10 + version: 2.0.13(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)) + '@nomicfoundation/ignition-core': + specifier: ^0.15.9 + version: 0.15.11(bufferutil@4.0.9)(utf-8-validate@5.0.10) + '@openzeppelin/contracts': + specifier: ^5.0.2 + version: 5.3.0 + '@openzeppelin/contracts-upgradeable': + specifier: ^5.0.2 + version: 5.3.0(@openzeppelin/contracts@5.3.0) + '@typechain/ethers-v6': + specifier: ^0.5.0 + version: 0.5.1(ethers@6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10))(typechain@8.3.2(typescript@5.8.3))(typescript@5.8.3) + '@typechain/hardhat': + specifier: ^9.0.0 + version: 9.1.0(@typechain/ethers-v6@0.5.1(ethers@6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10))(typechain@8.3.2(typescript@5.8.3))(typescript@5.8.3))(ethers@6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10))(typechain@8.3.2(typescript@5.8.3)) + '@types/chai': + specifier: ^4.2.0 + version: 4.3.20 + '@types/mocha': + specifier: '>=9.1.0' + version: 10.0.10 + '@types/node': + specifier: '>=16.0.0' + version: 20.17.32 + chai: + specifier: ^4.2.0 + version: 4.5.0 + eslint: + specifier: ^8.56.0 + version: 8.57.1 + eslint-graph-config: + specifier: workspace:^0.0.1 + version: link:../eslint-graph-config + ethers: + specifier: 6.13.7 + version: 6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10) + glob: + specifier: ^11.0.1 + version: 11.0.2 + hardhat: + specifier: ^2.22.18 + version: 2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10) + hardhat-contract-sizer: + specifier: ^2.10.0 + version: 2.10.0(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)) + hardhat-gas-reporter: + specifier: ^1.0.8 + version: 1.0.10(bufferutil@4.0.9)(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10))(utf-8-validate@5.0.10) + hardhat-graph-protocol: + specifier: workspace:^0.1.21 + version: link:../hardhat-graph-protocol + hardhat-secure-accounts: + specifier: ^1.0.5 + version: 1.0.5(@nomicfoundation/hardhat-ethers@3.0.8(ethers@6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)))(ethers@6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)) + json5: + specifier: ^2.2.3 + version: 2.2.3 + lint-staged: + specifier: ^15.2.2 + version: 15.5.1 + prettier: + specifier: ^3.2.5 + version: 3.5.3 + prettier-plugin-solidity: + specifier: ^1.3.1 + version: 1.4.3(prettier@3.5.3) + solhint: + specifier: ^4.5.4 + version: 4.5.4(typescript@5.8.3) + solhint-graph-config: + specifier: workspace:^0.0.1 + version: link:../solhint-graph-config + solhint-plugin-graph: + specifier: workspace:^0.0.1 + version: link:../solhint-plugin-graph + solidity-coverage: + specifier: ^0.8.0 + version: 0.8.15(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)) + solidity-docgen: + specifier: ^0.6.0-beta.36 + version: 0.6.0-beta.36(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)) + ts-node: + specifier: '>=8.0.0' + version: 10.9.2(@types/node@20.17.32)(typescript@5.8.3) + typechain: + specifier: ^8.3.0 + version: 8.3.2(typescript@5.8.3) + typescript: + specifier: ^5.3.3 + version: 5.8.3 + + packages/token-distribution: + devDependencies: + '@ethersproject/experimental': + specifier: ^5.0.7 + version: 5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + '@graphprotocol/client-cli': + specifier: ^2.0.2 + version: 2.2.22(@babel/core@7.27.1)(@envelop/core@3.0.6)(@graphql-mesh/cross-helpers@0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)))(@graphql-mesh/store@0.93.1(@graphql-mesh/cross-helpers@0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)))(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.93.2)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1))(@graphql-mesh/types@0.93.2(@graphql-mesh/store@0.93.1)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1))(@graphql-mesh/utils@0.93.2(@graphql-mesh/cross-helpers@0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)))(@graphql-mesh/types@0.93.2)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1))(@graphql-tools/delegate@9.0.35(graphql@16.11.0))(@graphql-tools/merge@8.4.2(graphql@16.11.0))(@graphql-tools/utils@9.2.1(graphql@16.11.0))(@graphql-tools/wrap@9.4.2(graphql@16.11.0))(@types/node@20.17.32)(bufferutil@4.0.9)(encoding@0.1.13)(graphql-tag@2.12.6(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10))(utf-8-validate@5.0.10) + '@graphprotocol/contracts': + specifier: workspace:^7.0.0 + version: link:../contracts + '@nomiclabs/hardhat-ethers': + specifier: ^2.0.0 + version: 2.2.3(ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)) + '@nomiclabs/hardhat-etherscan': + specifier: ^3.1.7 + version: 3.1.8(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)) + '@nomiclabs/hardhat-waffle': + specifier: ^2.0.0 + version: 2.0.3(@nomiclabs/hardhat-ethers@2.2.3(ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)))(ethereum-waffle@3.4.4(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.8.3)(utf-8-validate@5.0.10))(ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)) + '@openzeppelin/contracts': + specifier: ^3.3.0-solc-0.7 + version: 3.4.2 + '@openzeppelin/contracts-upgradeable': + specifier: 3.4.2 + version: 3.4.2 + '@openzeppelin/hardhat-upgrades': + specifier: ^1.22.1 + version: 1.28.0(@nomiclabs/hardhat-ethers@2.2.3(ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)))(@nomiclabs/hardhat-etherscan@3.1.8(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)))(encoding@0.1.13)(ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)) + '@typechain/ethers-v5': + specifier: ^7.0.0 + version: 7.2.0(@ethersproject/abi@5.8.0)(@ethersproject/bytes@5.8.0)(@ethersproject/providers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(typechain@5.2.0(typescript@5.8.3))(typescript@5.8.3) + '@typechain/hardhat': + specifier: ^2.0.0 + version: 2.3.1(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10))(lodash@4.17.21)(typechain@5.2.0(typescript@5.8.3)) + '@types/mocha': + specifier: ^9.1.0 + version: 9.1.1 + '@types/node': + specifier: ^20.4.2 + version: 20.17.32 + chai: + specifier: ^4.2.0 + version: 4.5.0 + coingecko-api: + specifier: ^1.0.10 + version: 1.0.10 + consola: + specifier: ^2.15.0 + version: 2.15.3 + dotenv: + specifier: ^16.0.0 + version: 16.5.0 + eslint: + specifier: ^8.56.0 + version: 8.57.1 + eslint-graph-config: + specifier: workspace:^ + version: link:../eslint-graph-config + ethereum-waffle: + specifier: ^3.1.1 + version: 3.4.4(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.8.3)(utf-8-validate@5.0.10) + ethers: + specifier: ^5.0.18 + version: 5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + graphql: + specifier: ^16.5.0 + version: 16.11.0 + hardhat: + specifier: ^2.6.1 + version: 2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10) + hardhat-abi-exporter: + specifier: ^2.0.1 + version: 2.11.0(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)) + hardhat-contract-sizer: + specifier: ^2.0.1 + version: 2.10.0(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)) + hardhat-deploy: + specifier: ^0.7.0-beta.9 + version: 0.7.11(@ethersproject/hardware-wallets@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(bufferutil@4.0.9)(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10))(utf-8-validate@5.0.10) + hardhat-gas-reporter: + specifier: ^1.0.1 + version: 1.0.10(bufferutil@4.0.9)(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10))(utf-8-validate@5.0.10) + inquirer: + specifier: 8.0.0 + version: 8.0.0 + p-queue: + specifier: ^6.6.2 + version: 6.6.2 + prettier: + specifier: ^3.2.5 + version: 3.5.3 + prettier-plugin-solidity: + specifier: ^1.3.1 + version: 1.4.3(prettier@3.5.3) + solhint-community: + specifier: ^3.7.0 + version: 3.7.0(typescript@5.8.3) + solhint-graph-config: + specifier: workspace:^0.0.1 + version: link:../solhint-graph-config + solhint-plugin-prettier: + specifier: ^0.1.0 + version: 0.1.0(prettier-plugin-solidity@1.4.3(prettier@3.5.3))(prettier@3.5.3) + ts-node: + specifier: ^10.9.1 + version: 10.9.2(@types/node@20.17.32)(typescript@5.8.3) + typechain: + specifier: ^5.0.0 + version: 5.2.0(typescript@5.8.3) + typescript: + specifier: ^5.2.2 + version: 5.8.3 + + packages/toolshed: + dependencies: + '@graphprotocol/contracts': + specifier: workspace:^ + version: link:../contracts + '@graphprotocol/horizon': + specifier: workspace:^ + version: link:../horizon + '@graphprotocol/subgraph-service': + specifier: workspace:^ + version: link:../subgraph-service + '@nomicfoundation/hardhat-ethers': + specifier: 3.0.8 + version: 3.0.8(ethers@6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)) + debug: + specifier: ^4.4.0 + version: 4.4.0(supports-color@9.4.0) + ethers: + specifier: 6.13.7 + version: 6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10) + glob: + specifier: ^11.0.1 + version: 11.0.2 + hardhat: + specifier: ^2.22.16 + version: 2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10) + json5: + specifier: ^2.2.3 + version: 2.2.3 + devDependencies: + '@types/debug': + specifier: ^4.1.12 + version: 4.1.12 + '@types/json5': + specifier: ^2.2.0 + version: 2.2.0 + eslint: + specifier: ^8.56.0 + version: 8.57.1 + eslint-graph-config: + specifier: workspace:^ + version: link:../eslint-graph-config + typescript: + specifier: ^5.0.0 + version: 5.8.3 + +packages: + + '@adraffy/ens-normalize@1.10.1': + resolution: {integrity: sha512-96Z2IP3mYmF1Xg2cDm8f1gWGf/HUVedQ3FMifV4kG/PQ4yEP51xDtRAEfhVNt5f/uzpNkZHwWQuUcu6D6K+Ekw==} + + '@ampproject/remapping@2.3.0': + resolution: {integrity: sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==} + engines: {node: '>=6.0.0'} + + '@arbitrum/sdk@3.1.13': + resolution: {integrity: sha512-oE/j8ThWWEdFfV0helmR8lD0T67/CY1zMCt6RVslaCLrytFdbg3QsrHs/sQE3yiCXgisQlsx3qomCgh8PfBo8Q==} + engines: {node: '>=v11', npm: please-use-yarn, yarn: '>= 1.0.0'} + + '@ardatan/fast-json-stringify@0.0.6': + resolution: {integrity: sha512-//BefMIP6U1ptNeBf44Le4vqThejTwZndtYLtAuFBwA/DmbVbbYTCLNIMhZ96WZnhI92EvTXneT5tKJrgINE9A==} + peerDependencies: + ajv: ^8.10.0 + ajv-formats: ^2.1.1 + + '@ardatan/relay-compiler@12.0.0': + resolution: {integrity: sha512-9anThAaj1dQr6IGmzBMcfzOQKTa5artjuPmw8NYK/fiGEMjADbSguBY2FMDykt+QhilR3wc9VA/3yVju7JHg7Q==} + hasBin: true + peerDependencies: + graphql: '*' + + '@ardatan/sync-fetch@0.0.1': + resolution: {integrity: sha512-xhlTqH0m31mnsG0tIP4ETgfSB6gXDaYYsUWTrlUV93fFQPI9dd8hE0Ot6MHLCtqgB32hwJAC3YZMWlXZw7AleA==} + engines: {node: '>=14'} + + '@aws-crypto/sha256-js@1.2.2': + resolution: {integrity: sha512-Nr1QJIbW/afYYGzYvrF70LtaHrIRtd4TNAglX8BvlfxJLZ45SAmueIKYl5tWoNBPzp65ymXGFK0Bb1vZUpuc9g==} + + '@aws-crypto/util@1.2.2': + resolution: {integrity: sha512-H8PjG5WJ4wz0UXAFXeJjWCW1vkvIJ3qUUD+rGRwJ2/hj+xT58Qle2MTql/2MGzkU+1JLAFuR6aJpLAjHwhmwwg==} + + '@aws-sdk/types@3.775.0': + resolution: {integrity: sha512-ZoGKwa4C9fC9Av6bdfqcW6Ix5ot05F/S4VxWR2nHuMv7hzfmAjTOcUiWT7UR4hM/U0whf84VhDtXN/DWAk52KA==} + engines: {node: '>=18.0.0'} + + '@aws-sdk/util-utf8-browser@3.259.0': + resolution: {integrity: sha512-UvFa/vR+e19XookZF8RzFZBrw2EUkQWxiBW0yYQAhvk3C+QVGl0H3ouca8LDBlBfQKXwmW3huo/59H8rwb1wJw==} + + '@babel/code-frame@7.27.1': + resolution: {integrity: sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==} + engines: {node: '>=6.9.0'} + + '@babel/compat-data@7.27.1': + resolution: {integrity: sha512-Q+E+rd/yBzNQhXkG+zQnF58e4zoZfBedaxwzPmicKsiK3nt8iJYrSrDbjwFFDGC4f+rPafqRaPH6TsDoSvMf7A==} + engines: {node: '>=6.9.0'} + + '@babel/core@7.27.1': + resolution: {integrity: sha512-IaaGWsQqfsQWVLqMn9OB92MNN7zukfVA4s7KKAI0KfrrDsZ0yhi5uV4baBuLuN7n3vsZpwP8asPPcVwApxvjBQ==} + engines: {node: '>=6.9.0'} + + '@babel/generator@7.27.1': + resolution: {integrity: sha512-UnJfnIpc/+JO0/+KRVQNGU+y5taA5vCbwN8+azkX6beii/ZF+enZJSOKo11ZSzGJjlNfJHfQtmQT8H+9TXPG2w==} + engines: {node: '>=6.9.0'} + + '@babel/helper-annotate-as-pure@7.27.1': + resolution: {integrity: sha512-WnuuDILl9oOBbKnb4L+DyODx7iC47XfzmNCpTttFsSp6hTG7XZxu60+4IO+2/hPfcGOoKbFiwoI/+zwARbNQow==} + engines: {node: '>=6.9.0'} + + '@babel/helper-compilation-targets@7.27.1': + resolution: {integrity: sha512-2YaDd/Rd9E598B5+WIc8wJPmWETiiJXFYVE60oX8FDohv7rAUU3CQj+A1MgeEmcsk2+dQuEjIe/GDvig0SqL4g==} + engines: {node: '>=6.9.0'} + + '@babel/helper-create-class-features-plugin@7.27.1': + resolution: {integrity: sha512-QwGAmuvM17btKU5VqXfb+Giw4JcN0hjuufz3DYnpeVDvZLAObloM77bhMXiqry3Iio+Ai4phVRDwl6WU10+r5A==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + + '@babel/helper-member-expression-to-functions@7.27.1': + resolution: {integrity: sha512-E5chM8eWjTp/aNoVpcbfM7mLxu9XGLWYise2eBKGQomAk/Mb4XoxyqXTZbuTohbsl8EKqdlMhnDI2CCLfcs9wA==} + engines: {node: '>=6.9.0'} + + '@babel/helper-module-imports@7.27.1': + resolution: {integrity: sha512-0gSFWUPNXNopqtIPQvlD5WgXYI5GY2kP2cCvoT8kczjbfcfuIljTbcWrulD1CIPIX2gt1wghbDy08yE1p+/r3w==} + engines: {node: '>=6.9.0'} + + '@babel/helper-module-transforms@7.27.1': + resolution: {integrity: sha512-9yHn519/8KvTU5BjTVEEeIM3w9/2yXNKoD82JifINImhpKkARMJKPP59kLo+BafpdN5zgNeIcS4jsGDmd3l58g==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + + '@babel/helper-optimise-call-expression@7.27.1': + resolution: {integrity: sha512-URMGH08NzYFhubNSGJrpUEphGKQwMQYBySzat5cAByY1/YgIRkULnIy3tAMeszlL/so2HbeilYloUmSpd7GdVw==} + engines: {node: '>=6.9.0'} + + '@babel/helper-plugin-utils@7.27.1': + resolution: {integrity: sha512-1gn1Up5YXka3YYAHGKpbideQ5Yjf1tDa9qYcgysz+cNCXukyLl6DjPXhD3VRwSb8c0J9tA4b2+rHEZtc6R0tlw==} + engines: {node: '>=6.9.0'} + + '@babel/helper-replace-supers@7.27.1': + resolution: {integrity: sha512-7EHz6qDZc8RYS5ElPoShMheWvEgERonFCs7IAonWLLUTXW59DP14bCZt89/GKyreYn8g3S83m21FelHKbeDCKA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + + '@babel/helper-skip-transparent-expression-wrappers@7.27.1': + resolution: {integrity: sha512-Tub4ZKEXqbPjXgWLl2+3JpQAYBJ8+ikpQ2Ocj/q/r0LwE3UhENh7EUabyHjz2kCEsrRY83ew2DQdHluuiDQFzg==} + engines: {node: '>=6.9.0'} + + '@babel/helper-string-parser@7.27.1': + resolution: {integrity: sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==} + engines: {node: '>=6.9.0'} + + '@babel/helper-validator-identifier@7.27.1': + resolution: {integrity: sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow==} + engines: {node: '>=6.9.0'} + + '@babel/helper-validator-option@7.27.1': + resolution: {integrity: sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg==} + engines: {node: '>=6.9.0'} + + '@babel/helpers@7.27.1': + resolution: {integrity: sha512-FCvFTm0sWV8Fxhpp2McP5/W53GPllQ9QeQ7SiqGWjMf/LVG07lFa5+pgK05IRhVwtvafT22KF+ZSnM9I545CvQ==} + engines: {node: '>=6.9.0'} + + '@babel/parser@7.27.1': + resolution: {integrity: sha512-I0dZ3ZpCrJ1c04OqlNsQcKiZlsrXf/kkE4FXzID9rIOYICsAbA8mMDzhW/luRNAHdCNt7os/u8wenklZDlUVUQ==} + engines: {node: '>=6.0.0'} + hasBin: true + + '@babel/plugin-proposal-class-properties@7.18.6': + resolution: {integrity: sha512-cumfXOF0+nzZrrN8Rf0t7M+tF6sZc7vhQwYQck9q1/5w2OExlD+b4v4RpMJFaV1Z7WcDRgO6FqvxqxGlwo+RHQ==} + engines: {node: '>=6.9.0'} + deprecated: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead. + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-proposal-object-rest-spread@7.20.7': + resolution: {integrity: sha512-d2S98yCiLxDVmBmE8UjGcfPvNEUbA1U5q5WxaWFUGRzJSVAZqm5W6MbPct0jxnegUZ0niLeNX+IOzEs7wYg9Dg==} + engines: {node: '>=6.9.0'} + deprecated: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-object-rest-spread instead. + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-async-generators@7.8.4': + resolution: {integrity: sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-bigint@7.8.3': + resolution: {integrity: sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-class-properties@7.12.13': + resolution: {integrity: sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-class-static-block@7.14.5': + resolution: {integrity: sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-flow@7.27.1': + resolution: {integrity: sha512-p9OkPbZ5G7UT1MofwYFigGebnrzGJacoBSQM0/6bi/PUMVE+qlWDD/OalvQKbwgQzU6dl0xAv6r4X7Jme0RYxA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-import-assertions@7.27.1': + resolution: {integrity: sha512-UT/Jrhw57xg4ILHLFnzFpPDlMbcdEicaAtjPQpbj9wa8T4r5KVWCimHcL/460g8Ht0DMxDyjsLgiWSkVjnwPFg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-import-attributes@7.27.1': + resolution: {integrity: sha512-oFT0FrKHgF53f4vOsZGi2Hh3I35PfSmVs4IBFLFj4dnafP+hIWDLg3VyKmUHfLoLHlyxY4C7DGtmHuJgn+IGww==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-import-meta@7.10.4': + resolution: {integrity: sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-json-strings@7.8.3': + resolution: {integrity: sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-jsx@7.27.1': + resolution: {integrity: sha512-y8YTNIeKoyhGd9O0Jiyzyyqk8gdjnumGTQPsz0xOZOQ2RmkVJeZ1vmmfIvFEKqucBG6axJGBZDE/7iI5suUI/w==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-logical-assignment-operators@7.10.4': + resolution: {integrity: sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-nullish-coalescing-operator@7.8.3': + resolution: {integrity: sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-numeric-separator@7.10.4': + resolution: {integrity: sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-object-rest-spread@7.8.3': + resolution: {integrity: sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-optional-catch-binding@7.8.3': + resolution: {integrity: sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-optional-chaining@7.8.3': + resolution: {integrity: sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-private-property-in-object@7.14.5': + resolution: {integrity: sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-top-level-await@7.14.5': + resolution: {integrity: sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-arrow-functions@7.27.1': + resolution: {integrity: sha512-8Z4TGic6xW70FKThA5HYEKKyBpOOsucTOD1DjU3fZxDg+K3zBJcXMFnt/4yQiZnf5+MiOMSXQ9PaEK/Ilh1DeA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-block-scoped-functions@7.27.1': + resolution: {integrity: sha512-cnqkuOtZLapWYZUYM5rVIdv1nXYuFVIltZ6ZJ7nIj585QsjKM5dhL2Fu/lICXZ1OyIAFc7Qy+bvDAtTXqGrlhg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-block-scoping@7.27.1': + resolution: {integrity: sha512-QEcFlMl9nGTgh1rn2nIeU5bkfb9BAjaQcWbiP4LvKxUot52ABcTkpcyJ7f2Q2U2RuQ84BNLgts3jRme2dTx6Fw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-classes@7.27.1': + resolution: {integrity: sha512-7iLhfFAubmpeJe/Wo2TVuDrykh/zlWXLzPNdL0Jqn/Xu8R3QQ8h9ff8FQoISZOsw74/HFqFI7NX63HN7QFIHKA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-computed-properties@7.27.1': + resolution: {integrity: sha512-lj9PGWvMTVksbWiDT2tW68zGS/cyo4AkZ/QTp0sQT0mjPopCmrSkzxeXkznjqBxzDI6TclZhOJbBmbBLjuOZUw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-destructuring@7.27.1': + resolution: {integrity: sha512-ttDCqhfvpE9emVkXbPD8vyxxh4TWYACVybGkDj+oReOGwnp066ITEivDlLwe0b1R0+evJ13IXQuLNB5w1fhC5Q==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-flow-strip-types@7.27.1': + resolution: {integrity: sha512-G5eDKsu50udECw7DL2AcsysXiQyB7Nfg521t2OAJ4tbfTJ27doHLeF/vlI1NZGlLdbb/v+ibvtL1YBQqYOwJGg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-for-of@7.27.1': + resolution: {integrity: sha512-BfbWFFEJFQzLCQ5N8VocnCtA8J1CLkNTe2Ms2wocj75dd6VpiqS5Z5quTYcUoo4Yq+DN0rtikODccuv7RU81sw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-function-name@7.27.1': + resolution: {integrity: sha512-1bQeydJF9Nr1eBCMMbC+hdwmRlsv5XYOMu03YSWFwNs0HsAmtSxxF1fyuYPqemVldVyFmlCU7w8UE14LupUSZQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-literals@7.27.1': + resolution: {integrity: sha512-0HCFSepIpLTkLcsi86GG3mTUzxV5jpmbv97hTETW3yzrAij8aqlD36toB1D0daVFJM8NK6GvKO0gslVQmm+zZA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-member-expression-literals@7.27.1': + resolution: {integrity: sha512-hqoBX4dcZ1I33jCSWcXrP+1Ku7kdqXf1oeah7ooKOIiAdKQ+uqftgCFNOSzA5AMS2XIHEYeGFg4cKRCdpxzVOQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-modules-commonjs@7.27.1': + resolution: {integrity: sha512-OJguuwlTYlN0gBZFRPqwOGNWssZjfIUdS7HMYtN8c1KmwpwHFBwTeFZrg9XZa+DFTitWOW5iTAG7tyCUPsCCyw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-object-super@7.27.1': + resolution: {integrity: sha512-SFy8S9plRPbIcxlJ8A6mT/CxFdJx/c04JEctz4jf8YZaVS2px34j7NXRrlGlHkN/M2gnpL37ZpGRGVFLd3l8Ng==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-parameters@7.27.1': + resolution: {integrity: sha512-018KRk76HWKeZ5l4oTj2zPpSh+NbGdt0st5S6x0pga6HgrjBOJb24mMDHorFopOOd6YHkLgOZ+zaCjZGPO4aKg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-property-literals@7.27.1': + resolution: {integrity: sha512-oThy3BCuCha8kDZ8ZkgOg2exvPYUlprMukKQXI1r1pJ47NCvxfkEy8vK+r/hT9nF0Aa4H1WUPZZjHTFtAhGfmQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-react-display-name@7.27.1': + resolution: {integrity: sha512-p9+Vl3yuHPmkirRrg021XiP+EETmPMQTLr6Ayjj85RLNEbb3Eya/4VI0vAdzQG9SEAl2Lnt7fy5lZyMzjYoZQQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-react-jsx@7.27.1': + resolution: {integrity: sha512-2KH4LWGSrJIkVf5tSiBFYuXDAoWRq2MMwgivCf+93dd0GQi8RXLjKA/0EvRnVV5G0hrHczsquXuD01L8s6dmBw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-shorthand-properties@7.27.1': + resolution: {integrity: sha512-N/wH1vcn4oYawbJ13Y/FxcQrWk63jhfNa7jef0ih7PHSIHX2LB7GWE1rkPrOnka9kwMxb6hMl19p7lidA+EHmQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-spread@7.27.1': + resolution: {integrity: sha512-kpb3HUqaILBJcRFVhFUs6Trdd4mkrzcGXss+6/mxUd273PfbWqSDHRzMT2234gIg2QYfAjvXLSquP1xECSg09Q==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-template-literals@7.27.1': + resolution: {integrity: sha512-fBJKiV7F2DxZUkg5EtHKXQdbsbURW3DZKQUWphDum0uRP6eHGGa/He9mc0mypL680pb+e/lDIthRohlv8NCHkg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/runtime@7.27.1': + resolution: {integrity: sha512-1x3D2xEk2fRo3PAhwQwu5UubzgiVWSXTBfWpVd2Mx2AzRqJuDJCsgaDVZ7HB5iGzDW1Hl1sWN2mFyKjmR9uAog==} + engines: {node: '>=6.9.0'} + + '@babel/template@7.27.1': + resolution: {integrity: sha512-Fyo3ghWMqkHHpHQCoBs2VnYjR4iWFFjguTDEqA5WgZDOrFesVjMhMM2FSqTKSoUSDO1VQtavj8NFpdRBEvJTtg==} + engines: {node: '>=6.9.0'} + + '@babel/traverse@7.27.1': + resolution: {integrity: sha512-ZCYtZciz1IWJB4U61UPu4KEaqyfj+r5T1Q5mqPo+IBpcG9kHv30Z0aD8LXPgC1trYa6rK0orRyAhqUgk4MjmEg==} + engines: {node: '>=6.9.0'} + + '@babel/types@7.27.1': + resolution: {integrity: sha512-+EzkxvLNfiUeKMgy/3luqfsCWFRXLb7U6wNQTk60tovuckwB15B191tJWvpp4HjiQWdJkCxO3Wbvc6jlk3Xb2Q==} + engines: {node: '>=6.9.0'} + + '@bytecodealliance/preview2-shim@0.17.0': + resolution: {integrity: sha512-JorcEwe4ud0x5BS/Ar2aQWOQoFzjq/7jcnxYXCvSMh0oRm0dQXzOA+hqLDBnOMks1LLBA7dmiLLsEBl09Yd6iQ==} + + '@chainsafe/as-sha256@0.3.1': + resolution: {integrity: sha512-hldFFYuf49ed7DAakWVXSJODuq3pzJEguD8tQ7h+sGkM18vja+OFoJI9krnGmgzyuZC2ETX0NOIcCTy31v2Mtg==} + + '@chainsafe/persistent-merkle-tree@0.4.2': + resolution: {integrity: sha512-lLO3ihKPngXLTus/L7WHKaw9PnNJWizlOF1H9NNzHP6Xvh82vzg9F2bzkXhYIFshMZ2gTCEz8tq6STe7r5NDfQ==} + + '@chainsafe/persistent-merkle-tree@0.5.0': + resolution: {integrity: sha512-l0V1b5clxA3iwQLXP40zYjyZYospQLZXzBVIhhr9kDg/1qHZfzzHw0jj4VPBijfYCArZDlPkRi1wZaV2POKeuw==} + + '@chainsafe/ssz@0.10.2': + resolution: {integrity: sha512-/NL3Lh8K+0q7A3LsiFq09YXS9fPE+ead2rr7vM2QK8PLzrNsw3uqrif9bpRX5UxgeRjM+vYi+boCM3+GM4ovXg==} + + '@chainsafe/ssz@0.9.4': + resolution: {integrity: sha512-77Qtg2N1ayqs4Bg/wvnWfg5Bta7iy7IRh8XqXh7oNMeP2HBbBwx8m6yTpA8p0EHItWPEBkgZd5S5/LSlp3GXuQ==} + + '@changesets/apply-release-plan@7.0.12': + resolution: {integrity: sha512-EaET7As5CeuhTzvXTQCRZeBUcisoYPDDcXvgTE/2jmmypKp0RC7LxKj/yzqeh/1qFTZI7oDGFcL1PHRuQuketQ==} + + '@changesets/assemble-release-plan@6.0.7': + resolution: {integrity: sha512-vS5J92Rm7ZUcrvtu6WvggGWIdohv8s1/3ypRYQX8FsPO+KPDx6JaNC3YwSfh2umY/faGGfNnq42A7PRT0aZPFw==} + + '@changesets/changelog-git@0.2.1': + resolution: {integrity: sha512-x/xEleCFLH28c3bQeQIyeZf8lFXyDFVn1SgcBiR2Tw/r4IAWlk1fzxCEZ6NxQAjF2Nwtczoen3OA2qR+UawQ8Q==} + + '@changesets/cli@2.29.3': + resolution: {integrity: sha512-TNhKr6Loc7I0CSD9LpAyVNSxWBHElXVmmvQYIZQvaMan5jddmL7geo3+08Wi7ImgHFVNB0Nhju/LzXqlrkoOxg==} + hasBin: true + + '@changesets/config@3.1.1': + resolution: {integrity: sha512-bd+3Ap2TKXxljCggI0mKPfzCQKeV/TU4yO2h2C6vAihIo8tzseAn2e7klSuiyYYXvgu53zMN1OeYMIQkaQoWnA==} + + '@changesets/errors@0.2.0': + resolution: {integrity: sha512-6BLOQUscTpZeGljvyQXlWOItQyU71kCdGz7Pi8H8zdw6BI0g3m43iL4xKUVPWtG+qrrL9DTjpdn8eYuCQSRpow==} + + '@changesets/get-dependents-graph@2.1.3': + resolution: {integrity: sha512-gphr+v0mv2I3Oxt19VdWRRUxq3sseyUpX9DaHpTUmLj92Y10AGy+XOtV+kbM6L/fDcpx7/ISDFK6T8A/P3lOdQ==} + + '@changesets/get-release-plan@4.0.11': + resolution: {integrity: sha512-4DZpsewsc/1m5TArVg5h1c0U94am+cJBnu3izAM3yYIZr8+zZwa3AXYdEyCNURzjx0wWr80u/TWoxshbwdZXOA==} + + '@changesets/get-version-range-type@0.4.0': + resolution: {integrity: sha512-hwawtob9DryoGTpixy1D3ZXbGgJu1Rhr+ySH2PvTLHvkZuQ7sRT4oQwMh0hbqZH1weAooedEjRsbrWcGLCeyVQ==} + + '@changesets/git@3.0.4': + resolution: {integrity: sha512-BXANzRFkX+XcC1q/d27NKvlJ1yf7PSAgi8JG6dt8EfbHFHi4neau7mufcSca5zRhwOL8j9s6EqsxmT+s+/E6Sw==} + + '@changesets/logger@0.1.1': + resolution: {integrity: sha512-OQtR36ZlnuTxKqoW4Sv6x5YIhOmClRd5pWsjZsddYxpWs517R0HkyiefQPIytCVh4ZcC5x9XaG8KTdd5iRQUfg==} + + '@changesets/parse@0.4.1': + resolution: {integrity: sha512-iwksMs5Bf/wUItfcg+OXrEpravm5rEd9Bf4oyIPL4kVTmJQ7PNDSd6MDYkpSJR1pn7tz/k8Zf2DhTCqX08Ou+Q==} + + '@changesets/pre@2.0.2': + resolution: {integrity: sha512-HaL/gEyFVvkf9KFg6484wR9s0qjAXlZ8qWPDkTyKF6+zqjBe/I2mygg3MbpZ++hdi0ToqNUF8cjj7fBy0dg8Ug==} + + '@changesets/read@0.6.5': + resolution: {integrity: sha512-UPzNGhsSjHD3Veb0xO/MwvasGe8eMyNrR/sT9gR8Q3DhOQZirgKhhXv/8hVsI0QpPjR004Z9iFxoJU6in3uGMg==} + + '@changesets/should-skip-package@0.1.2': + resolution: {integrity: sha512-qAK/WrqWLNCP22UDdBTMPH5f41elVDlsNyat180A33dWxuUDyNpg6fPi/FyTZwRriVjg0L8gnjJn2F9XAoF0qw==} + + '@changesets/types@4.1.0': + resolution: {integrity: sha512-LDQvVDv5Kb50ny2s25Fhm3d9QSZimsoUGBsUioj6MC3qbMUCuC8GPIvk/M6IvXx3lYhAs0lwWUQLb+VIEUCECw==} + + '@changesets/types@6.1.0': + resolution: {integrity: sha512-rKQcJ+o1nKNgeoYRHKOS07tAMNd3YSN0uHaJOZYjBAgxfV7TUE7JE+z4BzZdQwb5hKaYbayKN5KrYV7ODb2rAA==} + + '@changesets/write@0.4.0': + resolution: {integrity: sha512-CdTLvIOPiCNuH71pyDu3rA+Q0n65cmAbXnwWH84rKGiFumFzkmHNT8KHTMEchcxN+Kl8I54xGUhJ7l3E7X396Q==} + + '@colors/colors@1.5.0': + resolution: {integrity: sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==} + engines: {node: '>=0.1.90'} + + '@colors/colors@1.6.0': + resolution: {integrity: sha512-Ir+AOibqzrIsL6ajt3Rz3LskB7OiMVHqltZmspbW/TJuTVuyOMirVqAkjfY6JISiLHgyNqicAC8AyHHGzNd/dA==} + engines: {node: '>=0.1.90'} + + '@commitlint/cli@16.3.0': + resolution: {integrity: sha512-P+kvONlfsuTMnxSwWE1H+ZcPMY3STFaHb2kAacsqoIkNx66O0T7sTpBxpxkMrFPyhkJiLJnJWMhk4bbvYD3BMA==} + engines: {node: '>=v12'} + hasBin: true + + '@commitlint/cli@18.6.1': + resolution: {integrity: sha512-5IDE0a+lWGdkOvKH892HHAZgbAjcj1mT5QrfA/SVbLJV/BbBMGyKN0W5mhgjekPJJwEQdVNvhl9PwUacY58Usw==} + engines: {node: '>=v18'} + hasBin: true + + '@commitlint/config-conventional@16.2.4': + resolution: {integrity: sha512-av2UQJa3CuE5P0dzxj/o/B9XVALqYzEViHrMXtDrW9iuflrqCStWBAioijppj9URyz6ONpohJKAtSdgAOE0gkA==} + engines: {node: '>=v12'} + + '@commitlint/config-conventional@18.6.3': + resolution: {integrity: sha512-8ZrRHqF6je+TRaFoJVwszwnOXb/VeYrPmTwPhf0WxpzpGTcYy1p0SPyZ2eRn/sRi/obnWAcobtDAq6+gJQQNhQ==} + engines: {node: '>=v18'} + + '@commitlint/config-validator@16.2.1': + resolution: {integrity: sha512-hogSe0WGg7CKmp4IfNbdNES3Rq3UEI4XRPB8JL4EPgo/ORq5nrGTVzxJh78omibNuB8Ho4501Czb1Er1MoDWpw==} + engines: {node: '>=v12'} + + '@commitlint/config-validator@18.6.1': + resolution: {integrity: sha512-05uiToBVfPhepcQWE1ZQBR/Io3+tb3gEotZjnI4tTzzPk16NffN6YABgwFQCLmzZefbDcmwWqJWc2XT47q7Znw==} + engines: {node: '>=v18'} + + '@commitlint/ensure@16.2.1': + resolution: {integrity: sha512-/h+lBTgf1r5fhbDNHOViLuej38i3rZqTQnBTk+xEg+ehOwQDXUuissQ5GsYXXqI5uGy+261ew++sT4EA3uBJ+A==} + engines: {node: '>=v12'} + + '@commitlint/ensure@18.6.1': + resolution: {integrity: sha512-BPm6+SspyxQ7ZTsZwXc7TRQL5kh5YWt3euKmEIBZnocMFkJevqs3fbLRb8+8I/cfbVcAo4mxRlpTPfz8zX7SnQ==} + engines: {node: '>=v18'} + + '@commitlint/execute-rule@16.2.1': + resolution: {integrity: sha512-oSls82fmUTLM6cl5V3epdVo4gHhbmBFvCvQGHBRdQ50H/690Uq1Dyd7hXMuKITCIdcnr9umyDkr8r5C6HZDF3g==} + engines: {node: '>=v12'} + + '@commitlint/execute-rule@18.6.1': + resolution: {integrity: sha512-7s37a+iWyJiGUeMFF6qBlyZciUkF8odSAnHijbD36YDctLhGKoYltdvuJ/AFfRm6cBLRtRk9cCVPdsEFtt/2rg==} + engines: {node: '>=v18'} + + '@commitlint/format@16.2.1': + resolution: {integrity: sha512-Yyio9bdHWmNDRlEJrxHKglamIk3d6hC0NkEUW6Ti6ipEh2g0BAhy8Od6t4vLhdZRa1I2n+gY13foy+tUgk0i1Q==} + engines: {node: '>=v12'} + + '@commitlint/format@18.6.1': + resolution: {integrity: sha512-K8mNcfU/JEFCharj2xVjxGSF+My+FbUHoqR+4GqPGrHNqXOGNio47ziiR4HQUPKtiNs05o8/WyLBoIpMVOP7wg==} + engines: {node: '>=v18'} + + '@commitlint/is-ignored@16.2.4': + resolution: {integrity: sha512-Lxdq9aOAYCOOOjKi58ulbwK/oBiiKz+7Sq0+/SpFIEFwhHkIVugvDvWjh2VRBXmRC/x5lNcjDcYEwS/uYUvlYQ==} + engines: {node: '>=v12'} + + '@commitlint/is-ignored@18.6.1': + resolution: {integrity: sha512-MOfJjkEJj/wOaPBw5jFjTtfnx72RGwqYIROABudOtJKW7isVjFe9j0t8xhceA02QebtYf4P/zea4HIwnXg8rvA==} + engines: {node: '>=v18'} + + '@commitlint/lint@16.2.4': + resolution: {integrity: sha512-AUDuwOxb2eGqsXbTMON3imUGkc1jRdtXrbbohiLSCSk3jFVXgJLTMaEcr39pR00N8nE9uZ+V2sYaiILByZVmxQ==} + engines: {node: '>=v12'} + + '@commitlint/lint@18.6.1': + resolution: {integrity: sha512-8WwIFo3jAuU+h1PkYe5SfnIOzp+TtBHpFr4S8oJWhu44IWKuVx6GOPux3+9H1iHOan/rGBaiacicZkMZuluhfQ==} + engines: {node: '>=v18'} + + '@commitlint/load@16.3.0': + resolution: {integrity: sha512-3tykjV/iwbkv2FU9DG+NZ/JqmP0Nm3b7aDwgCNQhhKV5P74JAuByULkafnhn+zsFGypG1qMtI5u+BZoa9APm0A==} + engines: {node: '>=v12'} + + '@commitlint/load@18.6.1': + resolution: {integrity: sha512-p26x8734tSXUHoAw0ERIiHyW4RaI4Bj99D8YgUlVV9SedLf8hlWAfyIFhHRIhfPngLlCe0QYOdRKYFt8gy56TA==} + engines: {node: '>=v18'} + + '@commitlint/message@16.2.1': + resolution: {integrity: sha512-2eWX/47rftViYg7a3axYDdrgwKv32mxbycBJT6OQY/MJM7SUfYNYYvbMFOQFaA4xIVZt7t2Alyqslbl6blVwWw==} + engines: {node: '>=v12'} + + '@commitlint/message@18.6.1': + resolution: {integrity: sha512-VKC10UTMLcpVjMIaHHsY1KwhuTQtdIKPkIdVEwWV+YuzKkzhlI3aNy6oo1eAN6b/D2LTtZkJe2enHmX0corYRw==} + engines: {node: '>=v18'} + + '@commitlint/parse@16.2.1': + resolution: {integrity: sha512-2NP2dDQNL378VZYioLrgGVZhWdnJO4nAxQl5LXwYb08nEcN+cgxHN1dJV8OLJ5uxlGJtDeR8UZZ1mnQ1gSAD/g==} + engines: {node: '>=v12'} + + '@commitlint/parse@18.6.1': + resolution: {integrity: sha512-eS/3GREtvVJqGZrwAGRwR9Gdno3YcZ6Xvuaa+vUF8j++wsmxrA2En3n0ccfVO2qVOLJC41ni7jSZhQiJpMPGOQ==} + engines: {node: '>=v18'} + + '@commitlint/read@16.2.1': + resolution: {integrity: sha512-tViXGuaxLTrw2r7PiYMQOFA2fueZxnnt0lkOWqKyxT+n2XdEMGYcI9ID5ndJKXnfPGPppD0w/IItKsIXlZ+alw==} + engines: {node: '>=v12'} + + '@commitlint/read@18.6.1': + resolution: {integrity: sha512-ia6ODaQFzXrVul07ffSgbZGFajpe8xhnDeLIprLeyfz3ivQU1dIoHp7yz0QIorZ6yuf4nlzg4ZUkluDrGN/J/w==} + engines: {node: '>=v18'} + + '@commitlint/resolve-extends@16.2.1': + resolution: {integrity: sha512-NbbCMPKTFf2J805kwfP9EO+vV+XvnaHRcBy6ud5dF35dxMsvdJqke54W3XazXF1ZAxC4a3LBy4i/GNVBAthsEg==} + engines: {node: '>=v12'} + + '@commitlint/resolve-extends@18.6.1': + resolution: {integrity: sha512-ifRAQtHwK+Gj3Bxj/5chhc4L2LIc3s30lpsyW67yyjsETR6ctHAHRu1FSpt0KqahK5xESqoJ92v6XxoDRtjwEQ==} + engines: {node: '>=v18'} + + '@commitlint/rules@16.2.4': + resolution: {integrity: sha512-rK5rNBIN2ZQNQK+I6trRPK3dWa0MtaTN4xnwOma1qxa4d5wQMQJtScwTZjTJeallFxhOgbNOgr48AMHkdounVg==} + engines: {node: '>=v12'} + + '@commitlint/rules@18.6.1': + resolution: {integrity: sha512-kguM6HxZDtz60v/zQYOe0voAtTdGybWXefA1iidjWYmyUUspO1zBPQEmJZ05/plIAqCVyNUTAiRPWIBKLCrGew==} + engines: {node: '>=v18'} + + '@commitlint/to-lines@16.2.1': + resolution: {integrity: sha512-9/VjpYj5j1QeY3eiog1zQWY6axsdWAc0AonUUfyZ7B0MVcRI0R56YsHAfzF6uK/g/WwPZaoe4Lb1QCyDVnpVaQ==} + engines: {node: '>=v12'} + + '@commitlint/to-lines@18.6.1': + resolution: {integrity: sha512-Gl+orGBxYSNphx1+83GYeNy5N0dQsHBQ9PJMriaLQDB51UQHCVLBT/HBdOx5VaYksivSf5Os55TLePbRLlW50Q==} + engines: {node: '>=v18'} + + '@commitlint/top-level@16.2.1': + resolution: {integrity: sha512-lS6GSieHW9y6ePL73ied71Z9bOKyK+Ib9hTkRsB8oZFAyQZcyRwq2w6nIa6Fngir1QW51oKzzaXfJL94qwImyw==} + engines: {node: '>=v12'} + + '@commitlint/top-level@18.6.1': + resolution: {integrity: sha512-HyiHQZUTf0+r0goTCDs/bbVv/LiiQ7AVtz6KIar+8ZrseB9+YJAIo8HQ2IC2QT1y3N1lbW6OqVEsTHjbT6hGSw==} + engines: {node: '>=v18'} + + '@commitlint/types@16.2.1': + resolution: {integrity: sha512-7/z7pA7BM0i8XvMSBynO7xsB3mVQPUZbVn6zMIlp/a091XJ3qAXRXc+HwLYhiIdzzS5fuxxNIHZMGHVD4HJxdA==} + engines: {node: '>=v12'} + + '@commitlint/types@18.6.1': + resolution: {integrity: sha512-gwRLBLra/Dozj2OywopeuHj2ac26gjGkz2cZ+86cTJOdtWfiRRr4+e77ZDAGc6MDWxaWheI+mAV5TLWWRwqrFg==} + engines: {node: '>=v18'} + + '@cspotcode/source-map-support@0.8.1': + resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==} + engines: {node: '>=12'} + + '@dabh/diagnostics@2.0.3': + resolution: {integrity: sha512-hrlQOIi7hAfzsMqlGSFyVucrx38O+j6wiGOf//H2ecvIEqYN4ADBSS2iLMh5UFyDunCNniUIPk/q3riFv45xRA==} + + '@defi-wonderland/natspec-smells@1.1.6': + resolution: {integrity: sha512-HTdZLEdBs3UakW0JQZ7vO8pb6YCoU3CPQNfLxa0Z9PWAwmgKhSZJbF8dm/okkJEJGRa0dCoOxviJw5jeK+kDiQ==} + hasBin: true + + '@defi-wonderland/smock@2.3.5': + resolution: {integrity: sha512-klANj1hUpc3cd2ShXdVH/bEGwxJd+LxOngkF5gLcIbg6b37RCgMPMmR/94/hgL62F8bfWtuNKsQD7K+c6M5fWQ==} + peerDependencies: + '@ethersproject/abi': ^5 + '@ethersproject/abstract-provider': ^5 + '@ethersproject/abstract-signer': ^5 + '@nomiclabs/hardhat-ethers': ^2 + ethers: ^5 + hardhat: ^2 + + '@ensdomains/ens@0.4.5': + resolution: {integrity: sha512-JSvpj1iNMFjK6K+uVl4unqMoa9rf5jopb8cya5UGBWz23Nw8hSNT7efgUx4BTlAPAgpNlEioUfeTyQ6J9ZvTVw==} + deprecated: Please use @ensdomains/ens-contracts + + '@ensdomains/resolver@0.2.4': + resolution: {integrity: sha512-bvaTH34PMCbv6anRa9I/0zjLJgY4EuznbEMgbV77JBCQ9KNC46rzi0avuxpOfu+xDjPEtSFGqVEOr5GlUSGudA==} + deprecated: Please use @ensdomains/ens-contracts + + '@envelop/core@3.0.6': + resolution: {integrity: sha512-06t1xCPXq6QFN7W1JUEf68aCwYN0OUDNAIoJe7bAqhaoa2vn7NCcuX1VHkJ/OWpmElUgCsRO6RiBbIru1in0Ig==} + + '@envelop/extended-validation@2.0.6': + resolution: {integrity: sha512-aXAf1bg5Z71YfEKLCZ8OMUZAOYPGHV/a+7avd5TIMFNDxl5wJTmIonep3T+kdMpwRInDphfNPGFD0GcGdGxpHg==} + peerDependencies: + '@envelop/core': ^3.0.6 + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 + + '@envelop/types@3.0.2': + resolution: {integrity: sha512-pOFea9ha0EkURWxJ/35axoH9fDGP5S2cUu/5Mmo9pb8zUf+TaEot8vB670XXihFEn/92759BMjLJNWBKmNhyng==} + + '@envelop/validation-cache@5.1.3': + resolution: {integrity: sha512-MkzcScQHJJQ/9YCAPdWShEi3xZv4F4neTs+NszzSrZOdlU8z/THuRt7gZ0sO0y2be+sx+SKjHQP8Gq3VXXcTTg==} + peerDependencies: + '@envelop/core': ^3.0.6 + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 + + '@eslint-community/eslint-utils@4.7.0': + resolution: {integrity: sha512-dyybb3AcajC7uha6CvhdVRJqaKyn7w2YKqKyAN37NKYgZT36w+iRb0Dymmc5qEJ549c/S31cMMSFd75bteCpCw==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 + + '@eslint-community/regexpp@4.12.1': + resolution: {integrity: sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==} + engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} + + '@eslint/eslintrc@2.1.4': + resolution: {integrity: sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + + '@eslint/js@8.57.1': + resolution: {integrity: sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + + '@ethereum-waffle/chai@3.4.4': + resolution: {integrity: sha512-/K8czydBtXXkcM9X6q29EqEkc5dN3oYenyH2a9hF7rGAApAJUpH8QBtojxOY/xQ2up5W332jqgxwp0yPiYug1g==} + engines: {node: '>=10.0'} + + '@ethereum-waffle/compiler@3.4.4': + resolution: {integrity: sha512-RUK3axJ8IkD5xpWjWoJgyHclOeEzDLQFga6gKpeGxiS/zBu+HB0W2FvsrrLalTFIaPw/CGYACRBSIxqiCqwqTQ==} + engines: {node: '>=10.0'} + + '@ethereum-waffle/ens@3.4.4': + resolution: {integrity: sha512-0m4NdwWxliy3heBYva1Wr4WbJKLnwXizmy5FfSSr5PMbjI7SIGCdCB59U7/ZzY773/hY3bLnzLwvG5mggVjJWg==} + engines: {node: '>=10.0'} + + '@ethereum-waffle/mock-contract@3.4.4': + resolution: {integrity: sha512-Mp0iB2YNWYGUV+VMl5tjPsaXKbKo8MDH9wSJ702l9EBjdxFf/vBvnMBAC1Fub1lLtmD0JHtp1pq+mWzg/xlLnA==} + engines: {node: '>=10.0'} + + '@ethereum-waffle/provider@3.4.4': + resolution: {integrity: sha512-GK8oKJAM8+PKy2nK08yDgl4A80mFuI8zBkE0C9GqTRYQqvuxIyXoLmJ5NZU9lIwyWVv5/KsoA11BgAv2jXE82g==} + engines: {node: '>=10.0'} + + '@ethereumjs/common@2.5.0': + resolution: {integrity: sha512-DEHjW6e38o+JmB/NO3GZBpW4lpaiBpkFgXF6jLcJ6gETBYpEyaA5nTimsWBUJR3Vmtm/didUEbNjajskugZORg==} + + '@ethereumjs/common@2.6.5': + resolution: {integrity: sha512-lRyVQOeCDaIVtgfbowla32pzeDv2Obr8oR8Put5RdUBNRGr1VGPGQNGP6elWIpgK3YdpzqTOh4GyUGOureVeeA==} + + '@ethereumjs/rlp@4.0.1': + resolution: {integrity: sha512-tqsQiBQDQdmPWE1xkkBq4rlSW5QZpLOUJ5RJh2/9fug+q9tnUhuZoVLk7s0scUIKTOzEtR72DFBXI4WiZcMpvw==} + engines: {node: '>=14'} + hasBin: true + + '@ethereumjs/rlp@5.0.2': + resolution: {integrity: sha512-DziebCdg4JpGlEqEdGgXmjqcFoJi+JGulUXwEjsZGAscAQ7MyD/7LE/GVCP29vEQxKc7AAwjT3A2ywHp2xfoCA==} + engines: {node: '>=18'} + hasBin: true + + '@ethereumjs/tx@3.3.2': + resolution: {integrity: sha512-6AaJhwg4ucmwTvw/1qLaZUX5miWrwZ4nLOUsKyb/HtzS3BMw/CasKhdi1ims9mBKeK9sOJCH4qGKOBGyJCeeog==} + + '@ethereumjs/tx@3.5.2': + resolution: {integrity: sha512-gQDNJWKrSDGu2w7w0PzVXVBNMzb7wwdDOmOqczmhNjqFxFuIbhVJDwiGEnxFNC2/b8ifcZzY7MLcluizohRzNw==} + + '@ethereumjs/util@8.1.0': + resolution: {integrity: sha512-zQ0IqbdX8FZ9aw11vP+dZkKDkS+kgIvQPHnSAXzP9pLu+Rfu3D3XEeLbicvoXJTYnhZiPmsZUxgdzXwNKxRPbA==} + engines: {node: '>=14'} + + '@ethereumjs/util@9.1.0': + resolution: {integrity: sha512-XBEKsYqLGXLah9PNJbgdkigthkG7TAGvlD/sH12beMXEyHDyigfcbdvHhmLyDWgDyOJn4QwiQUaF7yeuhnjdog==} + engines: {node: '>=18'} + + '@ethersproject/abi@5.0.0-beta.153': + resolution: {integrity: sha512-aXweZ1Z7vMNzJdLpR1CZUAIgnwjrZeUSvN9syCwlBaEBUFJmFY+HHnfuTI5vIhVs/mRkfJVrbEyl51JZQqyjAg==} + + '@ethersproject/abi@5.6.0': + resolution: {integrity: sha512-AhVByTwdXCc2YQ20v300w6KVHle9g2OFc28ZAFCPnJyEpkv1xKXjZcSTgWOlv1i+0dqlgF8RCF2Rn2KC1t+1Vg==} + + '@ethersproject/abi@5.7.0': + resolution: {integrity: sha512-351ktp42TiRcYB3H1OP8yajPeAQstMW/yCFokj/AthP9bLHzQFPlOrxOcwYEDkUAICmOHljvN4K39OMTMUa9RA==} + + '@ethersproject/abi@5.8.0': + resolution: {integrity: sha512-b9YS/43ObplgyV6SlyQsG53/vkSal0MNA1fskSC4mbnCMi8R+NkcH8K9FPYNESf6jUefBUniE4SOKms0E/KK1Q==} + + '@ethersproject/abstract-provider@5.6.0': + resolution: {integrity: sha512-oPMFlKLN+g+y7a79cLK3WiLcjWFnZQtXWgnLAbHZcN3s7L4v90UHpTOrLk+m3yr0gt+/h9STTM6zrr7PM8uoRw==} + + '@ethersproject/abstract-provider@5.7.0': + resolution: {integrity: sha512-R41c9UkchKCpAqStMYUpdunjo3pkEvZC3FAwZn5S5MGbXoMQOHIdHItezTETxAO5bevtMApSyEhn9+CHcDsWBw==} + + '@ethersproject/abstract-provider@5.8.0': + resolution: {integrity: sha512-wC9SFcmh4UK0oKuLJQItoQdzS/qZ51EJegK6EmAWlh+OptpQ/npECOR3QqECd8iGHC0RJb4WKbVdSfif4ammrg==} + + '@ethersproject/abstract-signer@5.6.0': + resolution: {integrity: sha512-WOqnG0NJKtI8n0wWZPReHtaLkDByPL67tn4nBaDAhmVq8sjHTPbCdz4DRhVu/cfTOvfy9w3iq5QZ7BX7zw56BQ==} + + '@ethersproject/abstract-signer@5.7.0': + resolution: {integrity: sha512-a16V8bq1/Cz+TGCkE2OPMTOUDLS3grCpdjoJCYNnVBbdYEMSgKrU0+B90s8b6H+ByYTBZN7a3g76jdIJi7UfKQ==} + + '@ethersproject/abstract-signer@5.8.0': + resolution: {integrity: sha512-N0XhZTswXcmIZQdYtUnd79VJzvEwXQw6PK0dTl9VoYrEBxxCPXqS0Eod7q5TNKRxe1/5WUMuR0u0nqTF/avdCA==} + + '@ethersproject/address@5.6.0': + resolution: {integrity: sha512-6nvhYXjbXsHPS+30sHZ+U4VMagFC/9zAk6Gd/h3S21YW4+yfb0WfRtaAIZ4kfM4rrVwqiy284LP0GtL5HXGLxQ==} + + '@ethersproject/address@5.6.1': + resolution: {integrity: sha512-uOgF0kS5MJv9ZvCz7x6T2EXJSzotiybApn4XlOgoTX0xdtyVIJ7pF+6cGPxiEq/dpBiTfMiw7Yc81JcwhSYA0Q==} + + '@ethersproject/address@5.7.0': + resolution: {integrity: sha512-9wYhYt7aghVGo758POM5nqcOMaE168Q6aRLJZwUmiqSrAungkG74gSSeKEIR7ukixesdRZGPgVqme6vmxs1fkA==} + + '@ethersproject/address@5.8.0': + resolution: {integrity: sha512-GhH/abcC46LJwshoN+uBNoKVFPxUuZm6dA257z0vZkKmU1+t8xTn8oK7B9qrj8W2rFRMch4gbJl6PmVxjxBEBA==} + + '@ethersproject/base64@5.6.0': + resolution: {integrity: sha512-2Neq8wxJ9xHxCF9TUgmKeSh9BXJ6OAxWfeGWvbauPh8FuHEjamgHilllx8KkSd5ErxyHIX7Xv3Fkcud2kY9ezw==} + + '@ethersproject/base64@5.7.0': + resolution: {integrity: sha512-Dr8tcHt2mEbsZr/mwTPIQAf3Ai0Bks/7gTw9dSqk1mQvhW3XvRlmDJr/4n+wg1JmCl16NZue17CDh8xb/vZ0sQ==} + + '@ethersproject/base64@5.8.0': + resolution: {integrity: sha512-lN0oIwfkYj9LbPx4xEkie6rAMJtySbpOAFXSDVQaBnAzYfB4X2Qr+FXJGxMoc3Bxp2Sm8OwvzMrywxyw0gLjIQ==} + + '@ethersproject/basex@5.6.0': + resolution: {integrity: sha512-qN4T+hQd/Md32MoJpc69rOwLYRUXwjTlhHDIeUkUmiN/JyWkkLLMoG0TqvSQKNqZOMgN5stbUYN6ILC+eD7MEQ==} + + '@ethersproject/basex@5.7.0': + resolution: {integrity: sha512-ywlh43GwZLv2Voc2gQVTKBoVQ1mti3d8HK5aMxsfu/nRDnMmNqaSJ3r3n85HBByT8OpoY96SXM1FogC533T4zw==} + + '@ethersproject/basex@5.8.0': + resolution: {integrity: sha512-PIgTszMlDRmNwW9nhS6iqtVfdTAKosA7llYXNmGPw4YAI1PUyMv28988wAb41/gHF/WqGdoLv0erHaRcHRKW2Q==} + + '@ethersproject/bignumber@5.6.0': + resolution: {integrity: sha512-VziMaXIUHQlHJmkv1dlcd6GY2PmT0khtAqaMctCIDogxkrarMzA9L94KN1NeXqqOfFD6r0sJT3vCTOFSmZ07DA==} + + '@ethersproject/bignumber@5.7.0': + resolution: {integrity: sha512-n1CAdIHRWjSucQO3MC1zPSVgV/6dy/fjL9pMrPP9peL+QxEg9wOsVqwD4+818B6LUEtaXzVHQiuivzRoxPxUGw==} + + '@ethersproject/bignumber@5.8.0': + resolution: {integrity: sha512-ZyaT24bHaSeJon2tGPKIiHszWjD/54Sz8t57Toch475lCLljC6MgPmxk7Gtzz+ddNN5LuHea9qhAe0x3D+uYPA==} + + '@ethersproject/bytes@5.6.1': + resolution: {integrity: sha512-NwQt7cKn5+ZE4uDn+X5RAXLp46E1chXoaMmrxAyA0rblpxz8t58lVkrHXoRIn0lz1joQElQ8410GqhTqMOwc6g==} + + '@ethersproject/bytes@5.7.0': + resolution: {integrity: sha512-nsbxwgFXWh9NyYWo+U8atvmMsSdKJprTcICAkvbBffT75qDocbuggBU0SJiVK2MuTrp0q+xvLkTnGMPK1+uA9A==} + + '@ethersproject/bytes@5.8.0': + resolution: {integrity: sha512-vTkeohgJVCPVHu5c25XWaWQOZ4v+DkGoC42/TS2ond+PARCxTJvgTFUNDZovyQ/uAQ4EcpqqowKydcdmRKjg7A==} + + '@ethersproject/constants@5.6.0': + resolution: {integrity: sha512-SrdaJx2bK0WQl23nSpV/b1aq293Lh0sUaZT/yYKPDKn4tlAbkH96SPJwIhwSwTsoQQZxuh1jnqsKwyymoiBdWA==} + + '@ethersproject/constants@5.7.0': + resolution: {integrity: sha512-DHI+y5dBNvkpYUMiRQyxRBYBefZkJfo70VUkUAsRjcPs47muV9evftfZ0PJVCXYbAiCgght0DtcF9srFQmIgWA==} + + '@ethersproject/constants@5.8.0': + resolution: {integrity: sha512-wigX4lrf5Vu+axVTIvNsuL6YrV4O5AXl5ubcURKMEME5TnWBouUh0CDTWxZ2GpnRn1kcCgE7l8O5+VbV9QTTcg==} + + '@ethersproject/contracts@5.6.0': + resolution: {integrity: sha512-74Ge7iqTDom0NX+mux8KbRUeJgu1eHZ3iv6utv++sLJG80FVuU9HnHeKVPfjd9s3woFhaFoQGf3B3iH/FrQmgw==} + + '@ethersproject/contracts@5.7.0': + resolution: {integrity: sha512-5GJbzEU3X+d33CdfPhcyS+z8MzsTrBGk/sc+G+59+tPa9yFkl6HQ9D6L0QMgNTA9q8dT0XKxxkyp883XsQvbbg==} + + '@ethersproject/contracts@5.8.0': + resolution: {integrity: sha512-0eFjGz9GtuAi6MZwhb4uvUM216F38xiuR0yYCjKJpNfSEy4HUM8hvqqBj9Jmm0IUz8l0xKEhWwLIhPgxNY0yvQ==} + + '@ethersproject/experimental@5.8.0': + resolution: {integrity: sha512-Oa5LNrm0jk0xQwbwd///ptex4Y62VRYIBzLfRtPpS5CGE+4RbAvETWc7bp/I0cXHqvXjvdvPNcZNc40qB8B5Mw==} + + '@ethersproject/hardware-wallets@5.8.0': + resolution: {integrity: sha512-bsGrIs3CnsphjB+0/8bcoBm3ttJInUTSC1f2bA5Gjf8KPyA1DlIAr3x/RKQdg0a0EWygtY9HNRJgosec5mvZ7Q==} + + '@ethersproject/hash@5.6.0': + resolution: {integrity: sha512-fFd+k9gtczqlr0/BruWLAu7UAOas1uRRJvOR84uDf4lNZ+bTkGl366qvniUZHKtlqxBRU65MkOobkmvmpHU+jA==} + + '@ethersproject/hash@5.7.0': + resolution: {integrity: sha512-qX5WrQfnah1EFnO5zJv1v46a8HW0+E5xuBBDTwMFZLuVTx0tbU2kkx15NqdjxecrLGatQN9FGQKpb1FKdHCt+g==} + + '@ethersproject/hash@5.8.0': + resolution: {integrity: sha512-ac/lBcTbEWW/VGJij0CNSw/wPcw9bSRgCB0AIBz8CvED/jfvDoV9hsIIiWfvWmFEi8RcXtlNwp2jv6ozWOsooA==} + + '@ethersproject/hdnode@5.6.0': + resolution: {integrity: sha512-61g3Jp3nwDqJcL/p4nugSyLrpl/+ChXIOtCEM8UDmWeB3JCAt5FoLdOMXQc3WWkc0oM2C0aAn6GFqqMcS/mHTw==} + + '@ethersproject/hdnode@5.7.0': + resolution: {integrity: sha512-OmyYo9EENBPPf4ERhR7oj6uAtUAhYGqOnIS+jE5pTXvdKBS99ikzq1E7Iv0ZQZ5V36Lqx1qZLeak0Ra16qpeOg==} + + '@ethersproject/hdnode@5.8.0': + resolution: {integrity: sha512-4bK1VF6E83/3/Im0ERnnUeWOY3P1BZml4ZD3wcH8Ys0/d1h1xaFt6Zc+Dh9zXf9TapGro0T4wvO71UTCp3/uoA==} + + '@ethersproject/json-wallets@5.6.0': + resolution: {integrity: sha512-fmh86jViB9r0ibWXTQipxpAGMiuxoqUf78oqJDlCAJXgnJF024hOOX7qVgqsjtbeoxmcLwpPsXNU0WEe/16qPQ==} + + '@ethersproject/json-wallets@5.7.0': + resolution: {integrity: sha512-8oee5Xgu6+RKgJTkvEMl2wDgSPSAQ9MB/3JYjFV9jlKvcYHUXZC+cQp0njgmxdHkYWn8s6/IqIZYm0YWCjO/0g==} + + '@ethersproject/json-wallets@5.8.0': + resolution: {integrity: sha512-HxblNck8FVUtNxS3VTEYJAcwiKYsBIF77W15HufqlBF9gGfhmYOJtYZp8fSDZtn9y5EaXTE87zDwzxRoTFk11w==} + + '@ethersproject/keccak256@5.6.0': + resolution: {integrity: sha512-tk56BJ96mdj/ksi7HWZVWGjCq0WVl/QvfhFQNeL8fxhBlGoP+L80uDCiQcpJPd+2XxkivS3lwRm3E0CXTfol0w==} + + '@ethersproject/keccak256@5.7.0': + resolution: {integrity: sha512-2UcPboeL/iW+pSg6vZ6ydF8tCnv3Iu/8tUmLLzWWGzxWKFFqOBQFLo6uLUv6BDrLgCDfN28RJ/wtByx+jZ4KBg==} + + '@ethersproject/keccak256@5.8.0': + resolution: {integrity: sha512-A1pkKLZSz8pDaQ1ftutZoaN46I6+jvuqugx5KYNeQOPqq+JZ0Txm7dlWesCHB5cndJSu5vP2VKptKf7cksERng==} + + '@ethersproject/logger@5.6.0': + resolution: {integrity: sha512-BiBWllUROH9w+P21RzoxJKzqoqpkyM1pRnEKG69bulE9TSQD8SAIvTQqIMZmmCO8pUNkgLP1wndX1gKghSpBmg==} + + '@ethersproject/logger@5.7.0': + resolution: {integrity: sha512-0odtFdXu/XHtjQXJYA3u9G0G8btm0ND5Cu8M7i5vhEcE8/HmF4Lbdqanwyv4uQTr2tx6b7fQRmgLrsnpQlmnig==} + + '@ethersproject/logger@5.8.0': + resolution: {integrity: sha512-Qe6knGmY+zPPWTC+wQrpitodgBfH7XoceCGL5bJVejmH+yCS3R8jJm8iiWuvWbG76RUmyEG53oqv6GMVWqunjA==} + + '@ethersproject/networks@5.6.1': + resolution: {integrity: sha512-b2rrupf3kCTcc3jr9xOWBuHylSFtbpJf79Ga7QR98ienU2UqGimPGEsYMgbI29KHJfA5Us89XwGVmxrlxmSrMg==} + + '@ethersproject/networks@5.7.0': + resolution: {integrity: sha512-MG6oHSQHd4ebvJrleEQQ4HhVu8Ichr0RDYEfHzsVAVjHNM+w36x9wp9r+hf1JstMXtseXDtkiVoARAG6M959AA==} + + '@ethersproject/networks@5.8.0': + resolution: {integrity: sha512-egPJh3aPVAzbHwq8DD7Po53J4OUSsA1MjQp8Vf/OZPav5rlmWUaFLiq8cvQiGK0Z5K6LYzm29+VA/p4RL1FzNg==} + + '@ethersproject/pbkdf2@5.6.0': + resolution: {integrity: sha512-Wu1AxTgJo3T3H6MIu/eejLFok9TYoSdgwRr5oGY1LTLfmGesDoSx05pemsbrPT2gG4cQME+baTSCp5sEo2erZQ==} + + '@ethersproject/pbkdf2@5.7.0': + resolution: {integrity: sha512-oR/dBRZR6GTyaofd86DehG72hY6NpAjhabkhxgr3X2FpJtJuodEl2auADWBZfhDHgVCbu3/H/Ocq2uC6dpNjjw==} + + '@ethersproject/pbkdf2@5.8.0': + resolution: {integrity: sha512-wuHiv97BrzCmfEaPbUFpMjlVg/IDkZThp9Ri88BpjRleg4iePJaj2SW8AIyE8cXn5V1tuAaMj6lzvsGJkGWskg==} + + '@ethersproject/properties@5.6.0': + resolution: {integrity: sha512-szoOkHskajKePTJSZ46uHUWWkbv7TzP2ypdEK6jGMqJaEt2sb0jCgfBo0gH0m2HBpRixMuJ6TBRaQCF7a9DoCg==} + + '@ethersproject/properties@5.7.0': + resolution: {integrity: sha512-J87jy8suntrAkIZtecpxEPxY//szqr1mlBaYlQ0r4RCaiD2hjheqF9s1LVE8vVuJCXisjIP+JgtK/Do54ej4Sw==} + + '@ethersproject/properties@5.8.0': + resolution: {integrity: sha512-PYuiEoQ+FMaZZNGrStmN7+lWjlsoufGIHdww7454FIaGdbe/p5rnaCXTr5MtBYl3NkeoVhHZuyzChPeGeKIpQw==} + + '@ethersproject/providers@5.6.2': + resolution: {integrity: sha512-6/EaFW/hNWz+224FXwl8+HdMRzVHt8DpPmu5MZaIQqx/K/ELnC9eY236SMV7mleCM3NnEArFwcAAxH5kUUgaRg==} + + '@ethersproject/providers@5.7.0': + resolution: {integrity: sha512-+TTrrINMzZ0aXtlwO/95uhAggKm4USLm1PbeCBR/3XZ7+Oey+3pMyddzZEyRhizHpy1HXV0FRWRMI1O3EGYibA==} + + '@ethersproject/providers@5.8.0': + resolution: {integrity: sha512-3Il3oTzEx3o6kzcg9ZzbE+oCZYyY+3Zh83sKkn4s1DZfTUjIegHnN2Cm0kbn9YFy45FDVcuCLLONhU7ny0SsCw==} + + '@ethersproject/random@5.6.0': + resolution: {integrity: sha512-si0PLcLjq+NG/XHSZz90asNf+YfKEqJGVdxoEkSukzbnBgC8rydbgbUgBbBGLeHN4kAJwUFEKsu3sCXT93YMsw==} + + '@ethersproject/random@5.7.0': + resolution: {integrity: sha512-19WjScqRA8IIeWclFme75VMXSBvi4e6InrUNuaR4s5pTF2qNhcGdCUwdxUVGtDDqC00sDLCO93jPQoDUH4HVmQ==} + + '@ethersproject/random@5.8.0': + resolution: {integrity: sha512-E4I5TDl7SVqyg4/kkA/qTfuLWAQGXmSOgYyO01So8hLfwgKvYK5snIlzxJMk72IFdG/7oh8yuSqY2KX7MMwg+A==} + + '@ethersproject/rlp@5.6.0': + resolution: {integrity: sha512-dz9WR1xpcTL+9DtOT/aDO+YyxSSdO8YIS0jyZwHHSlAmnxA6cKU3TrTd4Xc/bHayctxTgGLYNuVVoiXE4tTq1g==} + + '@ethersproject/rlp@5.7.0': + resolution: {integrity: sha512-rBxzX2vK8mVF7b0Tol44t5Tb8gomOHkj5guL+HhzQ1yBh/ydjGnpw6at+X6Iw0Kp3OzzzkcKp8N9r0W4kYSs9w==} + + '@ethersproject/rlp@5.8.0': + resolution: {integrity: sha512-LqZgAznqDbiEunaUvykH2JAoXTT9NV0Atqk8rQN9nx9SEgThA/WMx5DnW8a9FOufo//6FZOCHZ+XiClzgbqV9Q==} + + '@ethersproject/sha2@5.6.0': + resolution: {integrity: sha512-1tNWCPFLu1n3JM9t4/kytz35DkuF9MxqkGGEHNauEbaARdm2fafnOyw1s0tIQDPKF/7bkP1u3dbrmjpn5CelyA==} + + '@ethersproject/sha2@5.7.0': + resolution: {integrity: sha512-gKlH42riwb3KYp0reLsFTokByAKoJdgFCwI+CCiX/k+Jm2mbNs6oOaCjYQSlI1+XBVejwH2KrmCbMAT/GnRDQw==} + + '@ethersproject/sha2@5.8.0': + resolution: {integrity: sha512-dDOUrXr9wF/YFltgTBYS0tKslPEKr6AekjqDW2dbn1L1xmjGR+9GiKu4ajxovnrDbwxAKdHjW8jNcwfz8PAz4A==} + + '@ethersproject/signing-key@5.6.0': + resolution: {integrity: sha512-S+njkhowmLeUu/r7ir8n78OUKx63kBdMCPssePS89So1TH4hZqnWFsThEd/GiXYp9qMxVrydf7KdM9MTGPFukA==} + + '@ethersproject/signing-key@5.7.0': + resolution: {integrity: sha512-MZdy2nL3wO0u7gkB4nA/pEf8lu1TlFswPNmy8AiYkfKTdO6eXBJyUdmHO/ehm/htHw9K/qF8ujnTyUAD+Ry54Q==} + + '@ethersproject/signing-key@5.8.0': + resolution: {integrity: sha512-LrPW2ZxoigFi6U6aVkFN/fa9Yx/+4AtIUe4/HACTvKJdhm0eeb107EVCIQcrLZkxaSIgc/eCrX8Q1GtbH+9n3w==} + + '@ethersproject/solidity@5.6.0': + resolution: {integrity: sha512-YwF52vTNd50kjDzqKaoNNbC/r9kMDPq3YzDWmsjFTRBcIF1y4JCQJ8gB30wsTfHbaxgxelI5BfxQSxD/PbJOww==} + + '@ethersproject/solidity@5.7.0': + resolution: {integrity: sha512-HmabMd2Dt/raavyaGukF4XxizWKhKQ24DoLtdNbBmNKUOPqwjsKQSdV9GQtj9CBEea9DlzETlVER1gYeXXBGaA==} + + '@ethersproject/solidity@5.8.0': + resolution: {integrity: sha512-4CxFeCgmIWamOHwYN9d+QWGxye9qQLilpgTU0XhYs1OahkclF+ewO+3V1U0mvpiuQxm5EHHmv8f7ClVII8EHsA==} + + '@ethersproject/strings@5.6.0': + resolution: {integrity: sha512-uv10vTtLTZqrJuqBZR862ZQjTIa724wGPWQqZrofaPI/kUsf53TBG0I0D+hQ1qyNtllbNzaW+PDPHHUI6/65Mg==} + + '@ethersproject/strings@5.7.0': + resolution: {integrity: sha512-/9nu+lj0YswRNSH0NXYqrh8775XNyEdUQAuf3f+SmOrnVewcJ5SBNAjF7lpgehKi4abvNNXyf+HX86czCdJ8Mg==} + + '@ethersproject/strings@5.8.0': + resolution: {integrity: sha512-qWEAk0MAvl0LszjdfnZ2uC8xbR2wdv4cDabyHiBh3Cldq/T8dPH3V4BbBsAYJUeonwD+8afVXld274Ls+Y1xXg==} + + '@ethersproject/transactions@5.6.0': + resolution: {integrity: sha512-4HX+VOhNjXHZyGzER6E/LVI2i6lf9ejYeWD6l4g50AdmimyuStKc39kvKf1bXWQMg7QNVh+uC7dYwtaZ02IXeg==} + + '@ethersproject/transactions@5.7.0': + resolution: {integrity: sha512-kmcNicCp1lp8qanMTC3RIikGgoJ80ztTyvtsFvCYpSCfkjhD0jZ2LOrnbcuxuToLIUYYf+4XwD1rP+B/erDIhQ==} + + '@ethersproject/transactions@5.8.0': + resolution: {integrity: sha512-UglxSDjByHG0TuU17bDfCemZ3AnKO2vYrL5/2n2oXvKzvb7Cz+W9gOWXKARjp2URVwcWlQlPOEQyAviKwT4AHg==} + + '@ethersproject/units@5.6.0': + resolution: {integrity: sha512-tig9x0Qmh8qbo1w8/6tmtyrm/QQRviBh389EQ+d8fP4wDsBrJBf08oZfoiz1/uenKK9M78yAP4PoR7SsVoTjsw==} + + '@ethersproject/units@5.7.0': + resolution: {integrity: sha512-pD3xLMy3SJu9kG5xDGI7+xhTEmGXlEqXU4OfNapmfnxLVY4EMSSRp7j1k7eezutBPH7RBN/7QPnwR7hzNlEFeg==} + + '@ethersproject/units@5.8.0': + resolution: {integrity: sha512-lxq0CAnc5kMGIiWW4Mr041VT8IhNM+Pn5T3haO74XZWFulk7wH1Gv64HqE96hT4a7iiNMdOCFEBgaxWuk8ETKQ==} + + '@ethersproject/wallet@5.6.0': + resolution: {integrity: sha512-qMlSdOSTyp0MBeE+r7SUhr1jjDlC1zAXB8VD84hCnpijPQiSNbxr6GdiLXxpUs8UKzkDiNYYC5DRI3MZr+n+tg==} + + '@ethersproject/wallet@5.7.0': + resolution: {integrity: sha512-MhmXlJXEJFBFVKrDLB4ZdDzxcBxQ3rLyCkhNqVu3CDYvR97E+8r01UgrI+TI99Le+aYm/in/0vp86guJuM7FCA==} + + '@ethersproject/wallet@5.8.0': + resolution: {integrity: sha512-G+jnzmgg6UxurVKRKvw27h0kvG75YKXZKdlLYmAHeF32TGUzHkOFd7Zn6QHOTYRFWnfjtSSFjBowKo7vfrXzPA==} + + '@ethersproject/web@5.6.0': + resolution: {integrity: sha512-G/XHj0hV1FxI2teHRfCGvfBUHFmU+YOSbCxlAMqJklxSa7QMiHFQfAxvwY2PFqgvdkxEKwRNr/eCjfAPEm2Ctg==} + + '@ethersproject/web@5.7.0': + resolution: {integrity: sha512-ApHcbbj+muRASVDSCl/tgxaH2LBkRMEYfLOLVa0COipx0+nlu0QKet7U2lEg0vdkh8XRSLf2nd1f1Uk9SrVSGA==} + + '@ethersproject/web@5.8.0': + resolution: {integrity: sha512-j7+Ksi/9KfGviws6Qtf9Q7KCqRhpwrYKQPs+JBA/rKVFF/yaWLHJEH3zfVP2plVu+eys0d2DlFmhoQJayFewcw==} + + '@ethersproject/wordlists@5.6.0': + resolution: {integrity: sha512-q0bxNBfIX3fUuAo9OmjlEYxP40IB8ABgb7HjEZCL5IKubzV3j30CWi2rqQbjTS2HfoyQbfINoKcTVWP4ejwR7Q==} + + '@ethersproject/wordlists@5.7.0': + resolution: {integrity: sha512-S2TFNJNfHWVHNE6cNDjbVlZ6MgE17MIxMbMg2zv3wn+3XSJGosL1m9ZVv3GXCf/2ymSsQ+hRI5IzoMJTG6aoVA==} + + '@ethersproject/wordlists@5.8.0': + resolution: {integrity: sha512-2df9bbXicZws2Sb5S6ET493uJ0Z84Fjr3pC4tu/qlnZERibZCeUVuqdtt+7Tv9xxhUxHoIekIA7avrKUWHrezg==} + + '@fastify/busboy@2.1.1': + resolution: {integrity: sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==} + engines: {node: '>=14'} + + '@fastify/deepmerge@1.3.0': + resolution: {integrity: sha512-J8TOSBq3SoZbDhM9+R/u77hP93gz/rajSA+K2kGyijPpORPWUXHUpTaleoj+92As0S9uPRP7Oi8IqMf0u+ro6A==} + + '@graphprotocol/client-add-source-name@1.0.20': + resolution: {integrity: sha512-JJ++BVg4fhNCbLej105uHpabZesLsCSo9p43ZKSTT1VUdbuZtarzyIHC3uUmbvCfWQMVTCJEBZGx4l41oooOiw==} + peerDependencies: + '@graphql-mesh/types': ^0.78.0 || ^0.79.0 || ^0.80.0 || ^0.81.0 || ^0.82.0 || ^0.83.0 || ^0.84.0 || ^0.85.0 || ^0.89.0 || ^0.90.0 || ^0.91.0 || ^0.93.0 + '@graphql-tools/delegate': ^9.0.32 + '@graphql-tools/utils': ^9.2.1 + '@graphql-tools/wrap': ^9.4.2 + graphql: ^15.2.0 || ^16.0.0 + + '@graphprotocol/client-auto-pagination@1.1.18': + resolution: {integrity: sha512-p8eEyeBcqxCXLxC7CNgIhLSCd7bjiKToKnrwYPShVb26gIG2JdAmD3/mpjuR+QaMA4chN/EO5t+TGvq6KnFx9g==} + peerDependencies: + '@graphql-mesh/types': ^0.78.0 || ^0.79.0 || ^0.80.0 || ^0.81.0 || ^0.82.0 || ^0.83.0 || ^0.84.0 || ^0.85.0 || ^0.89.0 || ^0.90.0 || ^0.91.0 || ^0.93.0 + '@graphql-tools/delegate': ^9.0.32 + '@graphql-tools/utils': ^9.2.1 + '@graphql-tools/wrap': ^9.4.2 + graphql: ^15.2.0 || ^16.0.0 + + '@graphprotocol/client-auto-type-merging@1.0.25': + resolution: {integrity: sha512-kpiX2s804mpP3EVL0EdJfxeHWBTdg6SglIyEvSZ5T1OWyGDeMhr19D+gVIAlo22/PiBUkBDd0JfqppLsliPZ1A==} + peerDependencies: + '@graphql-mesh/types': ^0.78.0 || ^0.79.0 || ^0.80.0 || ^0.81.0 || ^0.82.0 || ^0.83.0 || ^0.84.0 || ^0.85.0 || ^0.89.0 || ^0.90.0 || ^0.91.0 || ^0.93.0 + '@graphql-tools/delegate': ^9.0.32 + graphql: ^15.2.0 || ^16.0.0 + + '@graphprotocol/client-block-tracking@1.0.14': + resolution: {integrity: sha512-Eim0fZ0AgukHt5770j/UYDxfrqJroOhDe8FfNKKN7mDVRoMBoCsNknH47i03fh4A/kE8R+J6Job/zEJZPTtKnQ==} + peerDependencies: + '@graphql-tools/delegate': ^9.0.32 + graphql: ^15.2.0 || ^16.0.0 + + '@graphprotocol/client-cli@2.2.22': + resolution: {integrity: sha512-PIi8rFibYZVup+0jb08399RmbGF1ZrqUe6RXzLtKZBT57OWIMWwsFvdJyUAdr8Y8f0rrMn6A+Oy4nP1lf3hc1g==} + hasBin: true + peerDependencies: + graphql: ^15.2.0 || ^16.0.0 + + '@graphprotocol/client-polling-live@1.1.1': + resolution: {integrity: sha512-/XKnXNTts1VCUqwN2TCuPzQBfMGusL8vtamACKUeX65WxVy/H/Wjpcxq+w/XbyqNsQdG5QOoxY+AS/vKMhUcDQ==} + peerDependencies: + '@envelop/core': ^2.4.2 || ^3.0.0 + '@graphql-tools/merge': ^8.3.14 + graphql: ^15.2.0 || ^16.0.0 + + '@graphprotocol/common-ts@1.8.7': + resolution: {integrity: sha512-B1LZHbWnP7HOjkycN/y0dB47yZ8PuhOrZHGLsRo+4qhpMJx55NzJBfPOPnivnrfbM7wL69l158NpSHhpr9Mgug==} + + '@graphprotocol/common-ts@2.0.11': + resolution: {integrity: sha512-WtQGYMGVwaXDIli+OCAZUSqh8+ql9THzjztqvLGeSbAIPKxysvej9vua0voMguqEkI/RyEEMBajelodMzzZlEw==} + + '@graphprotocol/contracts@2.1.0': + resolution: {integrity: sha512-SeymJCUxBp488K/KNi77EKvrkPT0t/7rERGp8zFkmf5KByerjihhE9Ty9oXJAU9RzbUpxsU0JkPBSmiw9/2DYQ==} + + '@graphprotocol/contracts@5.3.3': + resolution: {integrity: sha512-fmFSKr+VDinWWotj2q/Ztn92PppcRrYXeO/62gLgkLos/DcYa7bGWKbcOWyMUw0vsUvXxk6QAtr5o/LG3yQ1WQ==} + + '@graphprotocol/pino-sentry-simple@0.7.1': + resolution: {integrity: sha512-iccKFdFBjarSp8/liXuK1EtGq8Vwn118tqymbOJBxblecRsi4rOebk63qnL+dK/a0IvxH6h2+RjjWDbRt7UsUA==} + engines: {node: '>=10'} + + '@graphprotocol/sdk@0.5.4': + resolution: {integrity: sha512-iVmzFBT/SjeNrtt+6BUEf9zqrX4ojSlZBY5A4FLbJUbOEMLWvlCIN/psTSeX4sRY7mn1X7G/RX3b/AsEtSBakA==} + + '@graphql-codegen/core@3.1.0': + resolution: {integrity: sha512-DH1/yaR7oJE6/B+c6ZF2Tbdh7LixF1K8L+8BoSubjNyQ8pNwR4a70mvc1sv6H7qgp6y1bPQ9tKE+aazRRshysw==} + peerDependencies: + graphql: ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 + + '@graphql-codegen/plugin-helpers@2.7.2': + resolution: {integrity: sha512-kln2AZ12uii6U59OQXdjLk5nOlh1pHis1R98cDZGFnfaiAbX9V3fxcZ1MMJkB7qFUymTALzyjZoXXdyVmPMfRg==} + peerDependencies: + graphql: ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 + + '@graphql-codegen/plugin-helpers@3.1.2': + resolution: {integrity: sha512-emOQiHyIliVOIjKVKdsI5MXj312zmRDwmHpyUTZMjfpvxq/UVAHUJIVdVf+lnjjrI+LXBTgMlTWTgHQfmICxjg==} + peerDependencies: + graphql: ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 + + '@graphql-codegen/plugin-helpers@4.2.0': + resolution: {integrity: sha512-THFTCfg+46PXlXobYJ/OoCX6pzjI+9woQqCjdyKtgoI0tn3Xq2HUUCiidndxUpEYVrXb5pRiRXb7b/ZbMQqD0A==} + peerDependencies: + graphql: ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 + + '@graphql-codegen/schema-ast@3.0.1': + resolution: {integrity: sha512-rTKTi4XiW4QFZnrEqetpiYEWVsOFNoiR/v3rY9mFSttXFbIwNXPme32EspTiGWmEEdHY8UuTDtZN3vEcs/31zw==} + peerDependencies: + graphql: ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 + + '@graphql-codegen/typed-document-node@4.0.1': + resolution: {integrity: sha512-mQNYCd12JsFSaK6xLry4olY9TdYG7GxQPexU6qU4Om++eKhseGwk2eGmQDRG4Qp8jEDFLMXuHMVUKqMQ1M+F/A==} + peerDependencies: + graphql: ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 + + '@graphql-codegen/typescript-generic-sdk@3.1.0': + resolution: {integrity: sha512-nQZi/YGRI1+qCZZsh0V5nz6+hCHSN4OU9tKyOTDsEPyDFnGEukDuRdCH2IZasGn22a3Iu5TUDkgp5w9wEQwGmg==} + peerDependencies: + graphql: ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 + graphql-tag: ^2.0.0 + + '@graphql-codegen/typescript-operations@3.0.4': + resolution: {integrity: sha512-6yE2OL2+WJ1vd5MwFEGXpaxsFGzjAGUytPVHDML3Bi3TwP1F3lnQlIko4untwvHW0JhZEGQ7Ck30H9HjcxpdKA==} + peerDependencies: + graphql: ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 + + '@graphql-codegen/typescript-resolvers@3.2.1': + resolution: {integrity: sha512-2ZIHk5J6HTuylse5ZIxw+aega54prHxvj7vM8hiKJ6vejZ94kvVPAq4aWmSFOkZ5lqU3YnM/ZyWfnhT5CUDj1g==} + peerDependencies: + graphql: ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 + + '@graphql-codegen/typescript@3.0.4': + resolution: {integrity: sha512-x4O47447DZrWNtE/l5CU9QzzW4m1RbmCEdijlA3s2flG/y1Ckqdemob4CWfilSm5/tZ3w1junVDY616RDTSvZw==} + peerDependencies: + graphql: ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 + + '@graphql-codegen/visitor-plugin-common@2.13.1': + resolution: {integrity: sha512-mD9ufZhDGhyrSaWQGrU1Q1c5f01TeWtSWy/cDwXYjJcHIj1Y/DG2x0tOflEfCvh5WcnmHNIw4lzDsg1W7iFJEg==} + peerDependencies: + graphql: ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 + + '@graphql-codegen/visitor-plugin-common@3.1.1': + resolution: {integrity: sha512-uAfp+zu/009R3HUAuTK2AamR1bxIltM6rrYYI6EXSmkM3rFtFsLTuJhjUDj98HcUCszJZrADppz8KKLGRUVlNg==} + peerDependencies: + graphql: ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 + + '@graphql-inspector/core@3.3.0': + resolution: {integrity: sha512-LRtk9sHgj9qqVPIkkThAVq3iZ7QxgHCx6elEwd0eesZBCmaIYQxD/BFu+VT8jr10YfOURBZuAnVdyGu64vYpBg==} + peerDependencies: + graphql: ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 + + '@graphql-mesh/cache-localforage@0.93.1': + resolution: {integrity: sha512-cY/LJ+XC8kiyPoLxqPAMlOAvaeB81CZafdadLNyNDFuu66qDiZqWTYPw/lnhp2nyeukC8o/P69oP7d2OqVaCZA==} + peerDependencies: + '@graphql-mesh/types': ^0.93.1 + '@graphql-mesh/utils': ^0.93.1 + graphql: '*' + tslib: ^2.4.0 + + '@graphql-mesh/cli@0.82.35': + resolution: {integrity: sha512-5IuXpk+Zpg05u6qNPX19VzC5/HCiLdDRF6EPZ3ze57FIRgGA3YsB1CUGga6Ky3inalURYwx0kWqmdjbdKZYx1w==} + hasBin: true + peerDependencies: + graphql: '*' + + '@graphql-mesh/config@0.93.1': + resolution: {integrity: sha512-g4omjuBBVPtyhEDeEa6uwfSSvUehV3zcwZVNbk+UJuFJEYPO4yBLsxfEZBpoeO6EriiPX2WnQyn5kiHbC3YTRA==} + peerDependencies: + '@graphql-mesh/cross-helpers': ^0.3.4 + '@graphql-mesh/runtime': ^0.93.1 + '@graphql-mesh/store': ^0.93.1 + '@graphql-mesh/types': ^0.93.1 + '@graphql-mesh/utils': ^0.93.1 + '@graphql-tools/utils': ^9.2.1 + graphql: '*' + tslib: ^2.4.0 + + '@graphql-mesh/cross-helpers@0.3.4': + resolution: {integrity: sha512-jseNppSNEwNWjcjDDwsxmRBK+ub8tz2qc/ca2ZfCTebuCk/+D3dI3LJ95ceNFOIhInK0g2HVq8BO8lMMX1pQtg==} + peerDependencies: + '@graphql-tools/utils': ^9.2.1 + graphql: '*' + + '@graphql-mesh/graphql@0.93.1': + resolution: {integrity: sha512-1G2/1jkl1VPWhsZsUBwFQI5d9OxxEc+CMxy5ef0qI2WEXqIocOxMhEY53cc+tCSbuXR99rxos+KD/8Z6ZasaOQ==} + peerDependencies: + '@graphql-mesh/cross-helpers': ^0.3.4 + '@graphql-mesh/store': ^0.93.1 + '@graphql-mesh/types': ^0.93.1 + '@graphql-mesh/utils': ^0.93.1 + '@graphql-tools/utils': ^9.2.1 + graphql: '*' + tslib: ^2.4.0 + + '@graphql-mesh/http@0.93.2': + resolution: {integrity: sha512-tdGEvijb3w2YJsncoh59ZobWLWpYPDmTd07XOYroJTg3m95zloFRJr/IzklKOsAa57zVIuRLCOfDju5m1m47CQ==} + peerDependencies: + '@graphql-mesh/cross-helpers': ^0.3.4 + '@graphql-mesh/runtime': ^0.93.2 + '@graphql-mesh/types': ^0.93.1 + '@graphql-mesh/utils': ^0.93.1 + graphql: '*' + tslib: ^2.4.0 + + '@graphql-mesh/merger-bare@0.93.1': + resolution: {integrity: sha512-S/G3WSSa4+9YT320iRL/tODK4hTvepkQNUSzmddf3oz10xeyQD7hPJyOAnB6D+2dGVhaOTwmXJIueqevcAcP6Q==} + peerDependencies: + '@graphql-mesh/types': ^0.93.1 + '@graphql-mesh/utils': ^0.93.1 + '@graphql-tools/utils': ^9.2.1 + graphql: '*' + tslib: ^2.4.0 + + '@graphql-mesh/merger-stitching@0.93.1': + resolution: {integrity: sha512-8km5UFhKQGd0XY8bTBpHoBhVx/7qCkflPHLoTAguIWN8nJrcXJoqPamodci/U+2hudLAtRqhWosHu/8z7ctZpg==} + peerDependencies: + '@graphql-mesh/store': ^0.93.1 + '@graphql-mesh/types': ^0.93.1 + '@graphql-mesh/utils': ^0.93.1 + '@graphql-tools/utils': ^9.2.1 + graphql: '*' + tslib: ^2.4.0 + + '@graphql-mesh/runtime@0.93.2': + resolution: {integrity: sha512-8z9ag3jZLmkzawMzF6+i/+P1nQai+HmSZzNeJJen6fRkwprSM1Z7B4lfYBYhdiCbK11HHubDfw4LYwRuBcISMQ==} + peerDependencies: + '@graphql-mesh/cross-helpers': ^0.3.4 + '@graphql-mesh/types': ^0.93.1 + '@graphql-mesh/utils': ^0.93.1 + '@graphql-tools/utils': ^9.2.1 + graphql: '*' + tslib: ^2.4.0 + + '@graphql-mesh/store@0.93.1': + resolution: {integrity: sha512-OEljVuaZn2htU1rt4Yll/aJmynw3/Kvhd6eE8V0/del0u9iuLJqiKkzFJl8HUSMh0IkO10OnficJnTM0tCmxRw==} + peerDependencies: + '@graphql-mesh/cross-helpers': ^0.3.4 + '@graphql-mesh/types': ^0.93.1 + '@graphql-mesh/utils': ^0.93.1 + '@graphql-tools/utils': ^9.2.1 + graphql: '*' + tslib: ^2.4.0 + + '@graphql-mesh/string-interpolation@0.4.4': + resolution: {integrity: sha512-IotswBYZRaPswOebcr2wuOFuzD3dHIJxVEkPiiQubqjUIR8HhQI22XHJv0WNiQZ65z8NR9+GYWwEDIc2JRCNfQ==} + peerDependencies: + graphql: '*' + tslib: ^2.4.0 + + '@graphql-mesh/transform-type-merging@0.93.1': + resolution: {integrity: sha512-CUrqCMaEqO1LDusv59UPqmQju3f+LpEGxFu7CydMiIvbfKDDDrf8+dF3OVU7d/ZOMRxB6hR80JsQF0SVeXPCOQ==} + peerDependencies: + '@graphql-mesh/types': ^0.93.1 + '@graphql-mesh/utils': ^0.93.1 + graphql: '*' + tslib: ^2.4.0 + + '@graphql-mesh/types@0.93.2': + resolution: {integrity: sha512-113DuJzmR7aj2EMnLPu33ktCe5k7+Mk0BxFfmQViUH+mkr6i4JMsWvPKs9dTODSYuSuwvAZ90Vw2l3QyMrbFVA==} + peerDependencies: + '@graphql-mesh/store': ^0.93.1 + '@graphql-tools/utils': ^9.2.1 + graphql: '*' + tslib: ^2.4.0 + + '@graphql-mesh/utils@0.93.2': + resolution: {integrity: sha512-U+VytfSoqPofH/pmYZHFY10SkIFtHKrvE7Isxv1d0DiweVjdH3Qtojw13DWFpu/EKtgJY5bqoVnlcsZJYlKQoA==} + peerDependencies: + '@graphql-mesh/cross-helpers': ^0.3.4 + '@graphql-mesh/types': ^0.93.2 + '@graphql-tools/utils': ^9.2.1 + graphql: '*' + tslib: ^2.4.0 + + '@graphql-tools/batch-delegate@8.4.27': + resolution: {integrity: sha512-efgDDJhljma9d3Ky/LswIu1xm/if2oS27XA1sOcxcShW+Ze+Qxi0hZZ6iyI4eQxVDX5Lyy/n+NvQEZAK1riqnQ==} + peerDependencies: + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 + + '@graphql-tools/batch-execute@8.5.22': + resolution: {integrity: sha512-hcV1JaY6NJQFQEwCKrYhpfLK8frSXDbtNMoTur98u10Cmecy1zrqNKSqhEyGetpgHxaJRqszGzKeI3RuroDN6A==} + peerDependencies: + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 + + '@graphql-tools/code-file-loader@7.3.23': + resolution: {integrity: sha512-8Wt1rTtyTEs0p47uzsPJ1vAtfAx0jmxPifiNdmo9EOCuUPyQGEbMaik/YkqZ7QUFIEYEQu+Vgfo8tElwOPtx5Q==} + peerDependencies: + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 + + '@graphql-tools/delegate@9.0.35': + resolution: {integrity: sha512-jwPu8NJbzRRMqi4Vp/5QX1vIUeUPpWmlQpOkXQD2r1X45YsVceyUUBnktCrlJlDB4jPRVy7JQGwmYo3KFiOBMA==} + peerDependencies: + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 + + '@graphql-tools/executor-graphql-ws@0.0.14': + resolution: {integrity: sha512-P2nlkAsPZKLIXImFhj0YTtny5NQVGSsKnhi7PzXiaHSXc6KkzqbWZHKvikD4PObanqg+7IO58rKFpGXP7eeO+w==} + peerDependencies: + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 + + '@graphql-tools/executor-http@0.1.10': + resolution: {integrity: sha512-hnAfbKv0/lb9s31LhWzawQ5hghBfHS+gYWtqxME6Rl0Aufq9GltiiLBcl7OVVOnkLF0KhwgbYP1mB5VKmgTGpg==} + peerDependencies: + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 + + '@graphql-tools/executor-legacy-ws@0.0.11': + resolution: {integrity: sha512-4ai+NnxlNfvIQ4c70hWFvOZlSUN8lt7yc+ZsrwtNFbFPH/EroIzFMapAxM9zwyv9bH38AdO3TQxZ5zNxgBdvUw==} + peerDependencies: + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 + + '@graphql-tools/executor@0.0.18': + resolution: {integrity: sha512-xZC0C+/npXoSHBB5bsJdwxDLgtl1Gu4fL9J2TPQmXoZC3L2N506KJoppf9LgWdHU/xK04luJrhP6WjhfkIN0pQ==} + peerDependencies: + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 + + '@graphql-tools/executor@0.0.20': + resolution: {integrity: sha512-GdvNc4vszmfeGvUqlcaH1FjBoguvMYzxAfT6tDd4/LgwymepHhinqLNA5otqwVLW+JETcDaK7xGENzFomuE6TA==} + peerDependencies: + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 + + '@graphql-tools/graphql-file-loader@7.5.17': + resolution: {integrity: sha512-hVwwxPf41zOYgm4gdaZILCYnKB9Zap7Ys9OhY1hbwuAuC4MMNY9GpUjoTU3CQc3zUiPoYStyRtUGkHSJZ3HxBw==} + peerDependencies: + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 + + '@graphql-tools/graphql-tag-pluck@7.5.2': + resolution: {integrity: sha512-RW+H8FqOOLQw0BPXaahYepVSRjuOHw+7IL8Opaa5G5uYGOBxoXR7DceyQ7BcpMgktAOOmpDNQ2WtcboChOJSRA==} + peerDependencies: + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 + + '@graphql-tools/import@6.7.18': + resolution: {integrity: sha512-XQDdyZTp+FYmT7as3xRWH/x8dx0QZA2WZqfMF5EWb36a0PiH7WwlRQYIdyYXj8YCLpiWkeBXgBRHmMnwEYR8iQ==} + peerDependencies: + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 + + '@graphql-tools/load@7.8.14': + resolution: {integrity: sha512-ASQvP+snHMYm+FhIaLxxFgVdRaM0vrN9wW2BKInQpktwWTXVyk+yP5nQUCEGmn0RTdlPKrffBaigxepkEAJPrg==} + peerDependencies: + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 + + '@graphql-tools/merge@8.4.2': + resolution: {integrity: sha512-XbrHAaj8yDuINph+sAfuq3QCZ/tKblrTLOpirK0+CAgNlZUCHs0Fa+xtMUURgwCVThLle1AF7svJCxFizygLsw==} + peerDependencies: + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 + + '@graphql-tools/optimize@1.4.0': + resolution: {integrity: sha512-dJs/2XvZp+wgHH8T5J2TqptT9/6uVzIYvA6uFACha+ufvdMBedkfR4b4GbT8jAKLRARiqRTxy3dctnwkTM2tdw==} + peerDependencies: + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 + + '@graphql-tools/relay-operation-optimizer@6.5.18': + resolution: {integrity: sha512-mc5VPyTeV+LwiM+DNvoDQfPqwQYhPV/cl5jOBjTgSniyaq8/86aODfMkrE2OduhQ5E00hqrkuL2Fdrgk0w1QJg==} + peerDependencies: + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 + + '@graphql-tools/schema@9.0.19': + resolution: {integrity: sha512-oBRPoNBtCkk0zbUsyP4GaIzCt8C0aCI4ycIRUL67KK5pOHljKLBBtGT+Jr6hkzA74C8Gco8bpZPe7aWFjiaK2w==} + peerDependencies: + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 + + '@graphql-tools/stitch@8.7.50': + resolution: {integrity: sha512-VB1/uZyXjj1P5Wj0c4EKX3q8Q1Maj4dy6uNwodEPaO3EHMpaJU/DqyN0Bvnhxu0ol7RzdY3kgsvsdUjU2QMImw==} + peerDependencies: + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 + + '@graphql-tools/stitching-directives@2.3.34': + resolution: {integrity: sha512-DVlo1/SW9jN6jN1IL279c7voEJiEHsLbYRD7tYsAW472zrHqn0rpB6jRzZDzLOlCpm7JRWPsegXVlkqf0qvqFQ==} + peerDependencies: + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 + + '@graphql-tools/url-loader@7.17.18': + resolution: {integrity: sha512-ear0CiyTj04jCVAxi7TvgbnGDIN2HgqzXzwsfcqiVg9cvjT40NcMlZ2P1lZDgqMkZ9oyLTV8Bw6j+SyG6A+xPw==} + peerDependencies: + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 + + '@graphql-tools/utils@8.13.1': + resolution: {integrity: sha512-qIh9yYpdUFmctVqovwMdheVNJqFh+DQNWIhX87FJStfXYnmweBUDATok9fWPleKeFwxnW8IapKmY8m8toJEkAw==} + peerDependencies: + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 + + '@graphql-tools/utils@9.2.1': + resolution: {integrity: sha512-WUw506Ql6xzmOORlriNrD6Ugx+HjVgYxt9KCXD9mHAak+eaXSwuGGPyE60hy9xaDEoXKBsG7SkG69ybitaVl6A==} + peerDependencies: + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 + + '@graphql-tools/wrap@9.4.2': + resolution: {integrity: sha512-DFcd9r51lmcEKn0JW43CWkkI2D6T9XI1juW/Yo86i04v43O9w2/k4/nx2XTJv4Yv+iXwUw7Ok81PGltwGJSDSA==} + peerDependencies: + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 + + '@graphql-typed-document-node/core@3.2.0': + resolution: {integrity: sha512-mB9oAsNCm9aM3/SOv4YtBMqZbYj10R7dkq8byBqxGY/ncFwhf2oQzMV+LCRlWoDSEBJ3COiR1yeDvMtsoOsuFQ==} + peerDependencies: + graphql: ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 + + '@graphql-yoga/logger@0.0.1': + resolution: {integrity: sha512-6npFz7eZz33mXgSm1waBLMjUNG0D5hTc/p5Hcs1mojkT3KsLpCOFokzTEKboNsBhKevYcaVa/xeA7WBj4UYMLg==} + + '@graphql-yoga/subscription@3.1.0': + resolution: {integrity: sha512-Vc9lh8KzIHyS3n4jBlCbz7zCjcbtQnOBpsymcRvHhFr2cuH+knmRn0EmzimMQ58jQ8kxoRXXC3KJS3RIxSdPIg==} + + '@graphql-yoga/typed-event-target@1.0.0': + resolution: {integrity: sha512-Mqni6AEvl3VbpMtKw+TIjc9qS9a8hKhiAjFtqX488yq5oJtj9TkNlFTIacAVS3vnPiswNsmDiQqvwUOcJgi1DA==} + + '@humanwhocodes/config-array@0.13.0': + resolution: {integrity: sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw==} + engines: {node: '>=10.10.0'} + deprecated: Use @eslint/config-array instead + + '@humanwhocodes/module-importer@1.0.1': + resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} + engines: {node: '>=12.22'} + + '@humanwhocodes/object-schema@2.0.3': + resolution: {integrity: sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==} + deprecated: Use @eslint/object-schema instead + + '@isaacs/cliui@8.0.2': + resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==} + engines: {node: '>=12'} + + '@isaacs/ttlcache@1.4.1': + resolution: {integrity: sha512-RQgQ4uQ+pLbqXfOmieB91ejmLwvSgv9nLx6sT6sD83s7umBypgg+OIBOBbEUiJXrfpnp9j0mRhYYdzp9uqq3lA==} + engines: {node: '>=12'} + + '@istanbuljs/load-nyc-config@1.1.0': + resolution: {integrity: sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==} + engines: {node: '>=8'} + + '@istanbuljs/schema@0.1.3': + resolution: {integrity: sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==} + engines: {node: '>=8'} + + '@jest/create-cache-key-function@29.7.0': + resolution: {integrity: sha512-4QqS3LY5PBmTRHj9sAg1HLoPzqAI0uOX6wI/TRqHIcOxlFidy6YEmCQJk6FSZjNLGCeubDMfmkWL+qaLKhSGQA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + '@jest/environment@29.7.0': + resolution: {integrity: sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + '@jest/fake-timers@29.7.0': + resolution: {integrity: sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + '@jest/schemas@29.6.3': + resolution: {integrity: sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + '@jest/transform@29.7.0': + resolution: {integrity: sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + '@jest/types@29.6.3': + resolution: {integrity: sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + '@jridgewell/gen-mapping@0.3.8': + resolution: {integrity: sha512-imAbBGkb+ebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA==} + engines: {node: '>=6.0.0'} + + '@jridgewell/resolve-uri@3.1.2': + resolution: {integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==} + engines: {node: '>=6.0.0'} + + '@jridgewell/set-array@1.2.1': + resolution: {integrity: sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==} + engines: {node: '>=6.0.0'} + + '@jridgewell/source-map@0.3.6': + resolution: {integrity: sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ==} + + '@jridgewell/sourcemap-codec@1.5.0': + resolution: {integrity: sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==} + + '@jridgewell/trace-mapping@0.3.25': + resolution: {integrity: sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==} + + '@jridgewell/trace-mapping@0.3.9': + resolution: {integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==} + + '@ledgerhq/cryptoassets@5.53.0': + resolution: {integrity: sha512-M3ibc3LRuHid5UtL7FI3IC6nMEppvly98QHFoSa7lJU0HDzQxY6zHec/SPM4uuJUC8sXoGVAiRJDkgny54damw==} + + '@ledgerhq/devices@5.51.1': + resolution: {integrity: sha512-4w+P0VkbjzEXC7kv8T1GJ/9AVaP9I6uasMZ/JcdwZBS3qwvKo5A5z9uGhP5c7TvItzcmPb44b5Mw2kT+WjUuAA==} + + '@ledgerhq/errors@5.50.0': + resolution: {integrity: sha512-gu6aJ/BHuRlpU7kgVpy2vcYk6atjB4iauP2ymF7Gk0ez0Y/6VSMVSJvubeEQN+IV60+OBK0JgeIZG7OiHaw8ow==} + + '@ledgerhq/hw-app-eth@5.27.2': + resolution: {integrity: sha512-llNdrE894cCN8j6yxJEUniciyLVcLmu5N0UmIJLOObztG+5rOF4bX54h4SreTWK+E10Z0CzHSeyE5Lz/tVcqqQ==} + + '@ledgerhq/hw-transport-node-hid-noevents@5.51.1': + resolution: {integrity: sha512-9wFf1L8ZQplF7XOY2sQGEeOhpmBRzrn+4X43kghZ7FBDoltrcK+s/D7S+7ffg3j2OySyP6vIIIgloXylao5Scg==} + + '@ledgerhq/hw-transport-node-hid@5.26.0': + resolution: {integrity: sha512-qhaefZVZatJ6UuK8Wb6WSFNOLWc2mxcv/xgsfKi5HJCIr4bPF/ecIeN+7fRcEaycxj4XykY6Z4A7zDVulfFH4w==} + + '@ledgerhq/hw-transport-u2f@5.26.0': + resolution: {integrity: sha512-QTxP1Rsh+WZ184LUOelYVLeaQl3++V3I2jFik+l9JZtakwEHjD0XqOT750xpYNL/vfHsy31Wlz+oicdxGzFk+w==} + deprecated: '@ledgerhq/hw-transport-u2f is deprecated. Please use @ledgerhq/hw-transport-webusb or @ledgerhq/hw-transport-webhid. https://github.com/LedgerHQ/ledgerjs/blob/master/docs/migrate_webusb.md' + + '@ledgerhq/hw-transport@5.26.0': + resolution: {integrity: sha512-NFeJOJmyEfAX8uuIBTpocWHcz630sqPcXbu864Q+OCBm4EK5UOKV1h/pX7e0xgNIKY8zhJ/O4p4cIZp9tnXLHQ==} + + '@ledgerhq/hw-transport@5.51.1': + resolution: {integrity: sha512-6wDYdbWrw9VwHIcoDnqWBaDFyviyjZWv6H9vz9Vyhe4Qd7TIFmbTl/eWs6hZvtZBza9K8y7zD8ChHwRI4s9tSw==} + + '@ledgerhq/logs@5.50.0': + resolution: {integrity: sha512-swKHYCOZUGyVt4ge0u8a7AwNcA//h4nx5wIi0sruGye1IJ5Cva0GyK9L2/WdX+kWVTKp92ZiEo1df31lrWGPgA==} + + '@ljharb/resumer@0.0.1': + resolution: {integrity: sha512-skQiAOrCfO7vRTq53cxznMpks7wS1va95UCidALlOVWqvBAzwPVErwizDwoMqNVMEn1mDq0utxZd02eIrvF1lw==} + engines: {node: '>= 0.4'} + + '@ljharb/through@2.3.14': + resolution: {integrity: sha512-ajBvlKpWucBB17FuQYUShqpqy8GRgYEpJW0vWJbUu1CV9lWyrDCapy0lScU8T8Z6qn49sSwJB3+M+evYIdGg+A==} + engines: {node: '>= 0.4'} + + '@manypkg/find-root@1.1.0': + resolution: {integrity: sha512-mki5uBvhHzO8kYYix/WRy2WX8S3B5wdVSc9D6KcU5lQNglP2yt58/VfLuAK49glRXChosY8ap2oJ1qgma3GUVA==} + + '@manypkg/get-packages@1.1.3': + resolution: {integrity: sha512-fo+QhuU3qE/2TQMQmbVMqaQ6EWbMhi4ABWP+O4AM1NqPBuy0OrApV5LO6BrrgnhtAHS2NH6RrVk9OL181tTi8A==} + + '@metamask/eth-sig-util@4.0.1': + resolution: {integrity: sha512-tghyZKLHZjcdlDqCA3gNZmLeR0XvOE9U1qoQO9ohyAZT6Pya+H9vkBPcsyXytmYLNgVoin7CKCmweo/R43V+tQ==} + engines: {node: '>=12.0.0'} + + '@multiformats/base-x@4.0.1': + resolution: {integrity: sha512-eMk0b9ReBbV23xXU693TAIrLyeO5iTgBZGSJfpqriG8UkYvr/hC9u9pyMlAakDNHWmbhMZCDs6KQO0jzKD8OTw==} + + '@noble/curves@1.2.0': + resolution: {integrity: sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw==} + + '@noble/curves@1.4.2': + resolution: {integrity: sha512-TavHr8qycMChk8UwMld0ZDRvatedkzWfH8IiaeGCfymOP5i0hSCozz9vHOL0nkwk7HRMlFnAiKpS2jrUmSybcw==} + + '@noble/curves@1.8.2': + resolution: {integrity: sha512-vnI7V6lFNe0tLAuJMu+2sX+FcL14TaCWy1qiczg1VwRmPrpQCdq5ESXQMqUc2tluRNf6irBXrWbl1mGN8uaU/g==} + engines: {node: ^14.21.3 || >=16} + + '@noble/hashes@1.2.0': + resolution: {integrity: sha512-FZfhjEDbT5GRswV3C6uvLPHMiVD6lQBmpoX5+eSiPaMTXte/IKqI5dykDxzZB/WBeK/CDuQRBWarPdi3FNY2zQ==} + + '@noble/hashes@1.3.2': + resolution: {integrity: sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==} + engines: {node: '>= 16'} + + '@noble/hashes@1.4.0': + resolution: {integrity: sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==} + engines: {node: '>= 16'} + + '@noble/hashes@1.7.2': + resolution: {integrity: sha512-biZ0NUSxyjLLqo6KxEJ1b+C2NAx0wtDoFvCaXHGgUkeHzf3Xc1xKumFKREuT7f7DARNZ/slvYUwFG6B0f2b6hQ==} + engines: {node: ^14.21.3 || >=16} + + '@noble/hashes@1.8.0': + resolution: {integrity: sha512-jCs9ldd7NwzpgXDIf6P3+NrHh9/sD6CQdxHyjQI+h/6rDNo88ypBxxz45UDuZHz9r3tNz7N/VInSVoVdtXEI4A==} + engines: {node: ^14.21.3 || >=16} + + '@noble/secp256k1@1.7.1': + resolution: {integrity: sha512-hOUk6AyBFmqVrv7k5WAw/LpszxVbj9gGN4JRkIX52fdFAj1UA61KXmZDvqVEm+pOyec3+fIeZB02LYa/pWOArw==} + + '@nodelib/fs.scandir@2.1.5': + resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} + engines: {node: '>= 8'} + + '@nodelib/fs.stat@2.0.5': + resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} + engines: {node: '>= 8'} + + '@nodelib/fs.walk@1.2.8': + resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} + engines: {node: '>= 8'} + + '@nomicfoundation/edr-darwin-arm64@0.10.0': + resolution: {integrity: sha512-n0N+CVM4LKN9QeGZ5irr94Q4vwSs4u7W6jfuhNLmx1cpUxwE9RpeW+ym93JXDv62iVsbekeI5VsUEBHy0hymtA==} + engines: {node: '>= 18'} + + '@nomicfoundation/edr-darwin-x64@0.10.0': + resolution: {integrity: sha512-nmImWM/3qWopYzOmicMzK/MF3rFKpm2Biuc8GpQYTLjdXhmItpP9JwEPyjbAWv/1HI09C2pRzgNzKfTxoIgJ6w==} + engines: {node: '>= 18'} + + '@nomicfoundation/edr-linux-arm64-gnu@0.10.0': + resolution: {integrity: sha512-B/N1IyrCU7J6H4QckkQ1cSWAq1jSrJcXpO8GzRaQD1bgOOvg8wrUOrCD+Mfw7MLa6+X9vdZoXtPZOaaOQ9LmhA==} + engines: {node: '>= 18'} + + '@nomicfoundation/edr-linux-arm64-musl@0.10.0': + resolution: {integrity: sha512-NA9DFLB0LzcKy9mTCUzgnRDbmmSfW0CdO22ySwOy+MKt4Cr9eJi+XR5ZH933Rxpi6BWNkSPeS2ECETE25sJT3w==} + engines: {node: '>= 18'} + + '@nomicfoundation/edr-linux-x64-gnu@0.10.0': + resolution: {integrity: sha512-bDrbRTA9qZ9wSw5mqa8VpLFbf6ue2Z4qmRd08404eKm8RyBEFxjdHflFzCx46gz/Td0e+GLXy6KTVDj5D29r8w==} + engines: {node: '>= 18'} + + '@nomicfoundation/edr-linux-x64-musl@0.10.0': + resolution: {integrity: sha512-wx7yOlC/hx4N1xuIeh5cAebpzCTx8ZH8/z0IyYMf2t4v52KHERz4IyzBz5OLfd+0IqTRg8ZU5EnFBacIoPeP/g==} + engines: {node: '>= 18'} + + '@nomicfoundation/edr-win32-x64-msvc@0.10.0': + resolution: {integrity: sha512-DpBdVMimb+BUEs0E+nLGQ5JFHdGHyxQQNA+nh9V1eKtgarsV21S6br/d1vlQBMLQqkIzwmc6n+/O9Zjk2KfB3g==} + engines: {node: '>= 18'} + + '@nomicfoundation/edr@0.10.0': + resolution: {integrity: sha512-ed9qHSNssgh+0hYUx4ilDoMxxgf/sNT8SjnzgmA5A/LSXHaq2ax68bkdQ8otLYTlxHCO9BS5Nhb8bfajV4FZeA==} + engines: {node: '>= 18'} + + '@nomicfoundation/ethereumjs-block@4.2.2': + resolution: {integrity: sha512-atjpt4gc6ZGZUPHBAQaUJsm1l/VCo7FmyQ780tMGO8QStjLdhz09dXynmhwVTy5YbRr0FOh/uX3QaEM0yIB2Zg==} + engines: {node: '>=14'} + + '@nomicfoundation/ethereumjs-block@5.0.1': + resolution: {integrity: sha512-u1Yioemi6Ckj3xspygu/SfFvm8vZEO8/Yx5a1QLzi6nVU0jz3Pg2OmHKJ5w+D9Ogk1vhwRiqEBAqcb0GVhCyHw==} + engines: {node: '>=14'} + + '@nomicfoundation/ethereumjs-blockchain@6.2.2': + resolution: {integrity: sha512-6AIB2MoTEPZJLl6IRKcbd8mUmaBAQ/NMe3O7OsAOIiDjMNPPH5KaUQiLfbVlegT4wKIg/GOsFH7XlH2KDVoJNg==} + engines: {node: '>=14'} + + '@nomicfoundation/ethereumjs-blockchain@7.0.1': + resolution: {integrity: sha512-NhzndlGg829XXbqJEYrF1VeZhAwSPgsK/OB7TVrdzft3y918hW5KNd7gIZ85sn6peDZOdjBsAXIpXZ38oBYE5A==} + engines: {node: '>=14'} + + '@nomicfoundation/ethereumjs-common@3.1.2': + resolution: {integrity: sha512-JAEBpIua62dyObHM9KI2b4wHZcRQYYge9gxiygTWa3lNCr2zo+K0TbypDpgiNij5MCGNWP1eboNfNfx1a3vkvA==} + + '@nomicfoundation/ethereumjs-common@4.0.1': + resolution: {integrity: sha512-OBErlkfp54GpeiE06brBW/TTbtbuBJV5YI5Nz/aB2evTDo+KawyEzPjBlSr84z/8MFfj8wS2wxzQX1o32cev5g==} + + '@nomicfoundation/ethereumjs-ethash@2.0.5': + resolution: {integrity: sha512-xlLdcICGgAYyYmnI3r1t0R5fKGBJNDQSOQxXNjVO99JmxJIdXR5MgPo5CSJO1RpyzKOgzi3uIFn8agv564dZEQ==} + engines: {node: '>=14'} + + '@nomicfoundation/ethereumjs-ethash@3.0.1': + resolution: {integrity: sha512-KDjGIB5igzWOp8Ik5I6QiRH5DH+XgILlplsHR7TEuWANZA759G6krQ6o8bvj+tRUz08YygMQu/sGd9mJ1DYT8w==} + engines: {node: '>=14'} + + '@nomicfoundation/ethereumjs-evm@1.3.2': + resolution: {integrity: sha512-I00d4MwXuobyoqdPe/12dxUQxTYzX8OckSaWsMcWAfQhgVDvBx6ffPyP/w1aL0NW7MjyerySPcSVfDJAMHjilw==} + engines: {node: '>=14'} + + '@nomicfoundation/ethereumjs-evm@2.0.1': + resolution: {integrity: sha512-oL8vJcnk0Bx/onl+TgQOQ1t/534GKFaEG17fZmwtPFeH8S5soiBYPCLUrvANOl4sCp9elYxIMzIiTtMtNNN8EQ==} + engines: {node: '>=14'} + + '@nomicfoundation/ethereumjs-rlp@4.0.3': + resolution: {integrity: sha512-DZMzB/lqPK78T6MluyXqtlRmOMcsZbTTbbEyAjo0ncaff2mqu/k8a79PBcyvpgAhWD/R59Fjq/x3ro5Lof0AtA==} + engines: {node: '>=14'} + hasBin: true + + '@nomicfoundation/ethereumjs-rlp@5.0.1': + resolution: {integrity: sha512-xtxrMGa8kP4zF5ApBQBtjlSbN5E2HI8m8FYgVSYAnO6ssUoY5pVPGy2H8+xdf/bmMa22Ce8nWMH3aEW8CcqMeQ==} + engines: {node: '>=14'} + hasBin: true + + '@nomicfoundation/ethereumjs-statemanager@1.0.5': + resolution: {integrity: sha512-CAhzpzTR5toh/qOJIZUUOnWekUXuRqkkzaGAQrVcF457VhtCmr+ddZjjK50KNZ524c1XP8cISguEVNqJ6ij1sA==} + + '@nomicfoundation/ethereumjs-statemanager@2.0.1': + resolution: {integrity: sha512-B5ApMOnlruVOR7gisBaYwFX+L/AP7i/2oAahatssjPIBVDF6wTX1K7Qpa39E/nzsH8iYuL3krkYeUFIdO3EMUQ==} + + '@nomicfoundation/ethereumjs-trie@5.0.5': + resolution: {integrity: sha512-+8sNZrXkzvA1NH5F4kz5RSYl1I6iaRz7mAZRsyxOm0IVY4UaP43Ofvfp/TwOalFunurQrYB5pRO40+8FBcxFMA==} + engines: {node: '>=14'} + + '@nomicfoundation/ethereumjs-trie@6.0.1': + resolution: {integrity: sha512-A64It/IMpDVODzCgxDgAAla8jNjNtsoQZIzZUfIV5AY6Coi4nvn7+VReBn5itlxMiL2yaTlQr9TRWp3CSI6VoA==} + engines: {node: '>=14'} + + '@nomicfoundation/ethereumjs-tx@4.1.2': + resolution: {integrity: sha512-emJBJZpmTdUa09cqxQqHaysbBI9Od353ZazeH7WgPb35miMgNY6mb7/3vBA98N5lUW/rgkiItjX0KZfIzihSoQ==} + engines: {node: '>=14'} + + '@nomicfoundation/ethereumjs-tx@5.0.1': + resolution: {integrity: sha512-0HwxUF2u2hrsIM1fsasjXvlbDOq1ZHFV2dd1yGq8CA+MEYhaxZr8OTScpVkkxqMwBcc5y83FyPl0J9MZn3kY0w==} + engines: {node: '>=14'} + + '@nomicfoundation/ethereumjs-util@8.0.6': + resolution: {integrity: sha512-jOQfF44laa7xRfbfLXojdlcpkvxeHrE2Xu7tSeITsWFgoII163MzjOwFEzSNozHYieFysyoEMhCdP+NY5ikstw==} + engines: {node: '>=14'} + + '@nomicfoundation/ethereumjs-util@9.0.1': + resolution: {integrity: sha512-TwbhOWQ8QoSCFhV/DDfSmyfFIHjPjFBj957219+V3jTZYZ2rf9PmDtNOeZWAE3p3vlp8xb02XGpd0v6nTUPbsA==} + engines: {node: '>=14'} + + '@nomicfoundation/ethereumjs-vm@6.4.2': + resolution: {integrity: sha512-PRTyxZMP6kx+OdAzBhuH1LD2Yw+hrSpaytftvaK//thDy2OI07S0nrTdbrdk7b8ZVPAc9H9oTwFBl3/wJ3w15g==} + engines: {node: '>=14'} + + '@nomicfoundation/ethereumjs-vm@7.0.1': + resolution: {integrity: sha512-rArhyn0jPsS/D+ApFsz3yVJMQ29+pVzNZ0VJgkzAZ+7FqXSRtThl1C1prhmlVr3YNUlfpZ69Ak+RUT4g7VoOuQ==} + engines: {node: '>=14'} + + '@nomicfoundation/hardhat-chai-matchers@2.0.8': + resolution: {integrity: sha512-Z5PiCXH4xhNLASROlSUOADfhfpfhYO6D7Hn9xp8PddmHey0jq704cr6kfU8TRrQ4PUZbpfsZadPj+pCfZdjPIg==} + peerDependencies: + '@nomicfoundation/hardhat-ethers': ^3.0.0 + chai: ^4.2.0 + ethers: ^6.1.0 + hardhat: ^2.9.4 + + '@nomicfoundation/hardhat-ethers@3.0.8': + resolution: {integrity: sha512-zhOZ4hdRORls31DTOqg+GmEZM0ujly8GGIuRY7t7szEk2zW/arY1qDug/py8AEktT00v5K+b6RvbVog+va51IA==} + peerDependencies: + ethers: ^6.1.0 + hardhat: ^2.0.0 + + '@nomicfoundation/hardhat-foundry@1.1.3': + resolution: {integrity: sha512-30Ezc3hlZ4pC5Z/9W9euW5uoPKKQQKaecLETHJH8BPpd30zYOooy6HfjmcTY1/taOQjlwirOdNO7tHlje8Qcgw==} + peerDependencies: + hardhat: ^2.17.2 + + '@nomicfoundation/hardhat-ignition-ethers@0.15.11': + resolution: {integrity: sha512-srXzvf7qCDHLrnvQWtpVA9gWpcbp4BcnsOqJt6ISet9OlUnxk4GgRMbdFq4YpM48bHQTX397jS9yk1AtJCjt/g==} + peerDependencies: + '@nomicfoundation/hardhat-ethers': ^3.0.4 + '@nomicfoundation/hardhat-ignition': ^0.15.11 + '@nomicfoundation/ignition-core': ^0.15.11 + ethers: ^6.7.0 + hardhat: ^2.18.0 + + '@nomicfoundation/hardhat-ignition@0.15.11': + resolution: {integrity: sha512-OXebmK9FCMwwbb4mIeHBbVFFicAGgyGKJT2zrONrpixrROxrVs6KEi1gzsiN25qtQhCQePt8BTjjYrgy86Dfxg==} + peerDependencies: + '@nomicfoundation/hardhat-verify': ^2.0.1 + hardhat: ^2.18.0 + + '@nomicfoundation/hardhat-network-helpers@1.0.12': + resolution: {integrity: sha512-xTNQNI/9xkHvjmCJnJOTyqDSl8uq1rKb2WOVmixQxFtRd7Oa3ecO8zM0cyC2YmOK+jHB9WPZ+F/ijkHg1CoORA==} + peerDependencies: + hardhat: ^2.9.5 + + '@nomicfoundation/hardhat-toolbox@4.0.0': + resolution: {integrity: sha512-jhcWHp0aHaL0aDYj8IJl80v4SZXWMS1A2XxXa1CA6pBiFfJKuZinCkO6wb+POAt0LIfXB3gA3AgdcOccrcwBwA==} + peerDependencies: + '@nomicfoundation/hardhat-chai-matchers': ^2.0.0 + '@nomicfoundation/hardhat-ethers': ^3.0.0 + '@nomicfoundation/hardhat-network-helpers': ^1.0.0 + '@nomicfoundation/hardhat-verify': ^2.0.0 + '@typechain/ethers-v6': ^0.5.0 + '@typechain/hardhat': ^9.0.0 + '@types/chai': ^4.2.0 + '@types/mocha': '>=9.1.0' + '@types/node': '>=16.0.0' + chai: ^4.2.0 + ethers: ^6.4.0 + hardhat: ^2.11.0 + hardhat-gas-reporter: ^1.0.8 + solidity-coverage: ^0.8.1 + ts-node: '>=8.0.0' + typechain: ^8.3.0 + typescript: '>=4.5.0' + + '@nomicfoundation/hardhat-verify@2.0.13': + resolution: {integrity: sha512-i57GX1sC0kYGyRVnbQrjjyBTpWTKgrvKC+jH8CMKV6gHp959Upb8lKaZ58WRHIU0espkulTxLnacYeUDirwJ2g==} + peerDependencies: + hardhat: ^2.0.4 + + '@nomicfoundation/ignition-core@0.15.11': + resolution: {integrity: sha512-PeYKRlrQ0koT72yRnlyyG66cXMFiv5X/cIB8hBFPl3ekeg5tPXcHAgs/VZhOsgwEox4ejphTtItLESb1IDBw0w==} + + '@nomicfoundation/ignition-ui@0.15.11': + resolution: {integrity: sha512-VPOVl5xqCKhYCyPOQlposx+stjCwqXQ+BCs5lnw/f2YUfgII+G5Ye0JfHiJOfCJGmqyS03WertBslcj9zQg50A==} + + '@nomicfoundation/slang@0.18.3': + resolution: {integrity: sha512-YqAWgckqbHM0/CZxi9Nlf4hjk9wUNLC9ngWCWBiqMxPIZmzsVKYuChdlrfeBPQyvQQBoOhbx+7C1005kLVQDZQ==} + + '@nomicfoundation/solidity-analyzer-darwin-arm64@0.1.2': + resolution: {integrity: sha512-JaqcWPDZENCvm++lFFGjrDd8mxtf+CtLd2MiXvMNTBD33dContTZ9TWETwNFwg7JTJT5Q9HEecH7FA+HTSsIUw==} + engines: {node: '>= 12'} + + '@nomicfoundation/solidity-analyzer-darwin-x64@0.1.2': + resolution: {integrity: sha512-fZNmVztrSXC03e9RONBT+CiksSeYcxI1wlzqyr0L7hsQlK1fzV+f04g2JtQ1c/Fe74ZwdV6aQBdd6Uwl1052sw==} + engines: {node: '>= 12'} + + '@nomicfoundation/solidity-analyzer-linux-arm64-gnu@0.1.2': + resolution: {integrity: sha512-3d54oc+9ZVBuB6nbp8wHylk4xh0N0Gc+bk+/uJae+rUgbOBwQSfuGIbAZt1wBXs5REkSmynEGcqx6DutoK0tPA==} + engines: {node: '>= 12'} + + '@nomicfoundation/solidity-analyzer-linux-arm64-musl@0.1.2': + resolution: {integrity: sha512-iDJfR2qf55vgsg7BtJa7iPiFAsYf2d0Tv/0B+vhtnI16+wfQeTbP7teookbGvAo0eJo7aLLm0xfS/GTkvHIucA==} + engines: {node: '>= 12'} + + '@nomicfoundation/solidity-analyzer-linux-x64-gnu@0.1.2': + resolution: {integrity: sha512-9dlHMAt5/2cpWyuJ9fQNOUXFB/vgSFORg1jpjX1Mh9hJ/MfZXlDdHQ+DpFCs32Zk5pxRBb07yGvSHk9/fezL+g==} + engines: {node: '>= 12'} + + '@nomicfoundation/solidity-analyzer-linux-x64-musl@0.1.2': + resolution: {integrity: sha512-GzzVeeJob3lfrSlDKQw2bRJ8rBf6mEYaWY+gW0JnTDHINA0s2gPR4km5RLIj1xeZZOYz4zRw+AEeYgLRqB2NXg==} + engines: {node: '>= 12'} + + '@nomicfoundation/solidity-analyzer-win32-x64-msvc@0.1.2': + resolution: {integrity: sha512-Fdjli4DCcFHb4Zgsz0uEJXZ2K7VEO+w5KVv7HmT7WO10iODdU9csC2az4jrhEsRtiR9Gfd74FlG0NYlw1BMdyA==} + engines: {node: '>= 12'} + + '@nomicfoundation/solidity-analyzer@0.1.2': + resolution: {integrity: sha512-q4n32/FNKIhQ3zQGGw5CvPF6GTvDCpYwIf7bEY/dZTZbgfDsHyjJwURxUJf3VQuuJj+fDIFl4+KkBVbw4Ef6jA==} + engines: {node: '>= 12'} + + '@nomiclabs/hardhat-ethers@2.2.3': + resolution: {integrity: sha512-YhzPdzb612X591FOe68q+qXVXGG2ANZRvDo0RRUtimev85rCrAlv/TLMEZw5c+kq9AbzocLTVX/h2jVIFPL9Xg==} + peerDependencies: + ethers: ^5.0.0 + hardhat: ^2.0.0 + + '@nomiclabs/hardhat-etherscan@3.1.8': + resolution: {integrity: sha512-v5F6IzQhrsjHh6kQz4uNrym49brK9K5bYCq2zQZ729RYRaifI9hHbtmK+KkIVevfhut7huQFEQ77JLRMAzWYjQ==} + deprecated: The @nomiclabs/hardhat-etherscan package is deprecated, please use @nomicfoundation/hardhat-verify instead + peerDependencies: + hardhat: ^2.0.4 + + '@nomiclabs/hardhat-waffle@2.0.3': + resolution: {integrity: sha512-049PHSnI1CZq6+XTbrMbMv5NaL7cednTfPenx02k3cEh8wBMLa6ys++dBETJa6JjfwgA9nBhhHQ173LJv6k2Pg==} + peerDependencies: + '@nomiclabs/hardhat-ethers': ^2.0.0 + ethereum-waffle: ^3.2.0 + ethers: ^5.0.0 + hardhat: ^2.0.0 + + '@openzeppelin/contracts-upgradeable@3.4.2': + resolution: {integrity: sha512-mDlBS17ymb2wpaLcrqRYdnBAmP1EwqhOXMvqWk2c5Q1N1pm5TkiCtXM9Xzznh4bYsQBq0aIWEkFFE2+iLSN1Tw==} + + '@openzeppelin/contracts-upgradeable@5.3.0': + resolution: {integrity: sha512-yVzSSyTMWO6rapGI5tuqkcLpcGGXA0UA1vScyV5EhE5yw8By3Ewex9rDUw8lfVw0iTkvR/egjfcW5vpk03lqZg==} + peerDependencies: + '@openzeppelin/contracts': 5.3.0 + + '@openzeppelin/contracts@3.4.2': + resolution: {integrity: sha512-z0zMCjyhhp4y7XKAcDAi3Vgms4T2PstwBdahiO0+9NaGICQKjynK3wduSRplTgk4LXmoO1yfDGO5RbjKYxtuxA==} + + '@openzeppelin/contracts@4.9.6': + resolution: {integrity: sha512-xSmezSupL+y9VkHZJGDoCBpmnB2ogM13ccaYDWqJTfS3dbuHkgjuwDFUmaFauBCboQMGB/S5UqUl2y54X99BmA==} + + '@openzeppelin/contracts@5.3.0': + resolution: {integrity: sha512-zj/KGoW7zxWUE8qOI++rUM18v+VeLTTzKs/DJFkSzHpQFPD/jKKF0TrMxBfGLl3kpdELCNccvB3zmofSzm4nlA==} + + '@openzeppelin/defender-admin-client@1.54.6': + resolution: {integrity: sha512-P4lxJDySrekWNuPa7FeyW/UmuxnuIXIAGYr5gZnmnMHRsYNaw+XfgkiCDfoGtjEyJbXYxXttYF6iAZhWQPdf1g==} + deprecated: This package has been deprecated and will no longer be maintained, please use @openzeppelin/defender-sdk package instead. + + '@openzeppelin/defender-base-client@1.54.6': + resolution: {integrity: sha512-PTef+rMxkM5VQ7sLwLKSjp2DBakYQd661ZJiSRywx+q/nIpm3B/HYGcz5wPZCA5O/QcEP6TatXXDoeMwimbcnw==} + deprecated: This package has been deprecated and will no longer be maintained, please use @openzeppelin/defender-sdk package instead. + + '@openzeppelin/hardhat-defender@1.9.0': + resolution: {integrity: sha512-dl2pQyBvwEZVq1sgw/i+mLQiu4ZD7iKn2/ghD9RbAGHIM8hZQ4ou8cXl1S6wCA92prpeO1rPGQ+NcJajbY4MCw==} + deprecated: '@openzeppelin/hardhat-defender is deprecated. This functionality is now included as part of @openzeppelin/hardhat-upgrades' + + '@openzeppelin/hardhat-upgrades@1.28.0': + resolution: {integrity: sha512-7sb/Jf+X+uIufOBnmHR0FJVWuxEs2lpxjJnLNN6eCJCP8nD0v+Ot5lTOW2Qb/GFnh+fLvJtEkhkowz4ZQ57+zQ==} + hasBin: true + peerDependencies: + '@nomiclabs/hardhat-ethers': ^2.0.0 + '@nomiclabs/hardhat-etherscan': ^3.1.0 + '@nomiclabs/harhdat-etherscan': '*' + ethers: ^5.0.5 + hardhat: ^2.0.2 + peerDependenciesMeta: + '@nomiclabs/harhdat-etherscan': + optional: true + + '@openzeppelin/platform-deploy-client@0.8.0': + resolution: {integrity: sha512-POx3AsnKwKSV/ZLOU/gheksj0Lq7Is1q2F3pKmcFjGZiibf+4kjGxr4eSMrT+2qgKYZQH1ZLQZ+SkbguD8fTvA==} + deprecated: '@openzeppelin/platform-deploy-client is deprecated. Please use @openzeppelin/defender-sdk-deploy-client' + + '@openzeppelin/upgrades-core@1.44.0': + resolution: {integrity: sha512-AUnQW7cbh2ntFuQdHi5C0vKB+QfkTQtzXgCmzazXLJDX7slFTF676lw+x97ZKfzwQw5unO1+ALZMx+s+2yQUew==} + hasBin: true + + '@peculiar/asn1-schema@2.3.15': + resolution: {integrity: sha512-QPeD8UA8axQREpgR5UTAfu2mqQmm97oUqahDtNdBcfj3qAnoXzFdQW+aNf/tD2WVXF8Fhmftxoj0eMIT++gX2w==} + + '@peculiar/json-schema@1.1.12': + resolution: {integrity: sha512-coUfuoMeIB7B8/NMekxaDzLhaYmp0HZNPEjYRm9goRou8UZIC3z21s0sL9AWoCw4EG876QyO3kYrc61WNF9B/w==} + engines: {node: '>=8.0.0'} + + '@peculiar/webcrypto@1.5.0': + resolution: {integrity: sha512-BRs5XUAwiyCDQMsVA9IDvDa7UBR9gAvPHgugOeGng3YN6vJ9JYonyDc0lNczErgtCWtucjR5N7VtaonboD/ezg==} + engines: {node: '>=10.12.0'} + + '@pkgjs/parseargs@0.11.0': + resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} + engines: {node: '>=14'} + + '@pnpm/config.env-replace@1.1.0': + resolution: {integrity: sha512-htyl8TWnKL7K/ESFa1oW2UB5lVDxuF5DpM7tBi6Hu2LNL3mWkIzNLG6N4zoCUP1lCKNxWy/3iu8mS8MvToGd6w==} + engines: {node: '>=12.22.0'} + + '@pnpm/network.ca-file@1.0.2': + resolution: {integrity: sha512-YcPQ8a0jwYU9bTdJDpXjMi7Brhkr1mXsXrUJvjqM2mQDgkRiz8jFaQGOdaLxgjtUfQgZhKy/O3cG/YwmgKaxLA==} + engines: {node: '>=12.22.0'} + + '@pnpm/npm-conf@2.3.1': + resolution: {integrity: sha512-c83qWb22rNRuB0UaVCI0uRPNRr8Z0FWnEIvT47jiHAmOIUHbBOg5XvV7pM5x+rKn9HRpjxquDbXYSXr3fAKFcw==} + engines: {node: '>=12'} + + '@prettier/sync@0.3.0': + resolution: {integrity: sha512-3dcmCyAxIcxy036h1I7MQU/uEEBq8oLwf1CE3xeze+MPlgkdlb/+w6rGR/1dhp6Hqi17fRS6nvwnOzkESxEkOw==} + peerDependencies: + prettier: ^3.0.0 + + '@react-native/assets-registry@0.79.2': + resolution: {integrity: sha512-5h2Z7/+/HL/0h88s0JHOdRCW4CXMCJoROxqzHqxdrjGL6EBD1DdaB4ZqkCOEVSW4Vjhir5Qb97C8i/MPWEYPtg==} + engines: {node: '>=18'} + + '@react-native/codegen@0.79.2': + resolution: {integrity: sha512-8JTlGLuLi1p8Jx2N/enwwEd7/2CfrqJpv90Cp77QLRX3VHF2hdyavRIxAmXMwN95k+Me7CUuPtqn2X3IBXOWYg==} + engines: {node: '>=18'} + peerDependencies: + '@babel/core': '*' + + '@react-native/community-cli-plugin@0.79.2': + resolution: {integrity: sha512-E+YEY2dL+68HyR2iahsZdyBKBUi9QyPyaN9vsnda1jNgCjNpSPk2yAF5cXsho+zKK5ZQna3JSeE1Kbi2IfGJbw==} + engines: {node: '>=18'} + peerDependencies: + '@react-native-community/cli': '*' + peerDependenciesMeta: + '@react-native-community/cli': + optional: true + + '@react-native/debugger-frontend@0.79.2': + resolution: {integrity: sha512-cGmC7X6kju76DopSBNc+PRAEetbd7TWF9J9o84hOp/xL3ahxR2kuxJy0oJX8Eg8oehhGGEXTuMKHzNa3rDBeSg==} + engines: {node: '>=18'} + + '@react-native/dev-middleware@0.79.2': + resolution: {integrity: sha512-9q4CpkklsAs1L0Bw8XYCoqqyBSrfRALGEw4/r0EkR38Y/6fVfNfdsjSns0pTLO6h0VpxswK34L/hm4uK3MoLHw==} + engines: {node: '>=18'} + + '@react-native/gradle-plugin@0.79.2': + resolution: {integrity: sha512-6MJFemrwR0bOT0QM+2BxX9k3/pvZQNmJ3Js5pF/6owsA0cUDiCO57otiEU8Fz+UywWEzn1FoQfOfQ8vt2GYmoA==} + engines: {node: '>=18'} + + '@react-native/js-polyfills@0.79.2': + resolution: {integrity: sha512-IaY87Ckd4GTPMkO1/Fe8fC1IgIx3vc3q9Tyt/6qS3Mtk9nC0x9q4kSR5t+HHq0/MuvGtu8HpdxXGy5wLaM+zUw==} + engines: {node: '>=18'} + + '@react-native/normalize-colors@0.79.2': + resolution: {integrity: sha512-+b+GNrupWrWw1okHnEENz63j7NSMqhKeFMOyzYLBwKcprG8fqJQhDIGXfizKdxeIa5NnGSAevKL1Ev1zJ56X8w==} + + '@react-native/virtualized-lists@0.79.2': + resolution: {integrity: sha512-9G6ROJeP+rdw9Bvr5ruOlag11ET7j1z/En1riFFNo6W3xZvJY+alCuH1ttm12y9+zBm4n8jwCk4lGhjYaV4dKw==} + engines: {node: '>=18'} + peerDependencies: + '@types/react': ^19.0.0 + react: '*' + react-native: '*' + peerDependenciesMeta: + '@types/react': + optional: true + + '@repeaterjs/repeater@3.0.4': + resolution: {integrity: sha512-AW8PKd6iX3vAZ0vA43nOUOnbq/X5ihgU+mSXXqunMkeQADGiqw/PY0JNeYtD5sr0PAy51YPgAPbDoeapv9r8WA==} + + '@repeaterjs/repeater@3.0.6': + resolution: {integrity: sha512-Javneu5lsuhwNCryN+pXH93VPQ8g0dBX7wItHFgYiwQmzE1sVdg5tWHiOgHywzL2W21XQopa7IwIEnNbmeUJYA==} + + '@resolver-engine/core@0.2.1': + resolution: {integrity: sha512-nsLQHmPJ77QuifqsIvqjaF5B9aHnDzJjp73Q1z6apY3e9nqYrx4Dtowhpsf7Jwftg/XzVDEMQC+OzUBNTS+S1A==} + + '@resolver-engine/core@0.3.3': + resolution: {integrity: sha512-eB8nEbKDJJBi5p5SrvrvILn4a0h42bKtbCTri3ZxCGt6UvoQyp7HnGOfki944bUjBSHKK3RvgfViHn+kqdXtnQ==} + + '@resolver-engine/fs@0.2.1': + resolution: {integrity: sha512-7kJInM1Qo2LJcKyDhuYzh9ZWd+mal/fynfL9BNjWOiTcOpX+jNfqb/UmGUqros5pceBITlWGqS4lU709yHFUbg==} + + '@resolver-engine/fs@0.3.3': + resolution: {integrity: sha512-wQ9RhPUcny02Wm0IuJwYMyAG8fXVeKdmhm8xizNByD4ryZlx6PP6kRen+t/haF43cMfmaV7T3Cx6ChOdHEhFUQ==} + + '@resolver-engine/imports-fs@0.2.2': + resolution: {integrity: sha512-gFCgMvCwyppjwq0UzIjde/WI+yDs3oatJhozG9xdjJdewwtd7LiF0T5i9lrHAUtqrQbqoFE4E+ZMRVHWpWHpKQ==} + + '@resolver-engine/imports-fs@0.3.3': + resolution: {integrity: sha512-7Pjg/ZAZtxpeyCFlZR5zqYkz+Wdo84ugB5LApwriT8XFeQoLwGUj4tZFFvvCuxaNCcqZzCYbonJgmGObYBzyCA==} + + '@resolver-engine/imports@0.2.2': + resolution: {integrity: sha512-u5/HUkvo8q34AA+hnxxqqXGfby5swnH0Myw91o3Sm2TETJlNKXibFGSKBavAH+wvWdBi4Z5gS2Odu0PowgVOUg==} + + '@resolver-engine/imports@0.3.3': + resolution: {integrity: sha512-anHpS4wN4sRMwsAbMXhMfOD/y4a4Oo0Cw/5+rue7hSwGWsDOQaAU1ClK1OxjUC35/peazxEl8JaSRRS+Xb8t3Q==} + + '@scure/base@1.1.9': + resolution: {integrity: sha512-8YKhl8GHiNI/pU2VMaofa2Tor7PJRAjwQLBBuilkJ9L5+13yVbC7JO/wS7piioAvPSwR3JKM1IJ/u4xQzbcXKg==} + + '@scure/base@1.2.5': + resolution: {integrity: sha512-9rE6EOVeIQzt5TSu4v+K523F8u6DhBsoZWPGKlnCshhlDhy0kJzUX4V+tr2dWmzF1GdekvThABoEQBGBQI7xZw==} + + '@scure/bip32@1.1.5': + resolution: {integrity: sha512-XyNh1rB0SkEqd3tXcXMi+Xe1fvg+kUIcoRIEujP1Jgv7DqW2r9lg3Ah0NkFaCs9sTkQAQA8kw7xiRXzENi9Rtw==} + + '@scure/bip32@1.4.0': + resolution: {integrity: sha512-sVUpc0Vq3tXCkDGYVWGIZTRfnvu8LoTDaev7vbwh0omSvVORONr960MQWdKqJDCReIEmTj3PAr73O3aoxz7OPg==} + + '@scure/bip39@1.1.1': + resolution: {integrity: sha512-t+wDck2rVkh65Hmv280fYdVdY25J9YeEUIgn2LG1WM6gxFkGzcksoDiUkWVpVp3Oex9xGC68JU2dSbUfwZ2jPg==} + + '@scure/bip39@1.3.0': + resolution: {integrity: sha512-disdg7gHuTDZtY+ZdkmLpPCk7fxZSu3gBiEGuoC1XYxv9cGx3Z6cpTggCgW6odSOOIXCiDjuGejW+aJKCY/pIQ==} + + '@sentry/core@5.30.0': + resolution: {integrity: sha512-TmfrII8w1PQZSZgPpUESqjB+jC6MvZJZdLtE/0hZ+SrnKhW3x5WlYLvTXZpcWePYBku7rl2wn1RZu6uT0qCTeg==} + engines: {node: '>=6'} + + '@sentry/hub@5.30.0': + resolution: {integrity: sha512-2tYrGnzb1gKz2EkMDQcfLrDTvmGcQPuWxLnJKXJvYTQDGLlEvi2tWz1VIHjunmOvJrB5aIQLhm+dcMRwFZDCqQ==} + engines: {node: '>=6'} + + '@sentry/minimal@5.30.0': + resolution: {integrity: sha512-BwWb/owZKtkDX+Sc4zCSTNcvZUq7YcH3uAVlmh/gtR9rmUvbzAA3ewLuB3myi4wWRAMEtny6+J/FN/x+2wn9Xw==} + engines: {node: '>=6'} + + '@sentry/node@5.30.0': + resolution: {integrity: sha512-Br5oyVBF0fZo6ZS9bxbJZG4ApAjRqAnqFFurMVJJdunNb80brh7a5Qva2kjhm+U6r9NJAB5OmDyPkA1Qnt+QVg==} + engines: {node: '>=6'} + + '@sentry/tracing@5.30.0': + resolution: {integrity: sha512-dUFowCr0AIMwiLD7Fs314Mdzcug+gBVo/+NCMyDw8tFxJkwWAKl7Qa2OZxLQ0ZHjakcj1hNKfCQJ9rhyfOl4Aw==} + engines: {node: '>=6'} + + '@sentry/types@5.30.0': + resolution: {integrity: sha512-R8xOqlSTZ+htqrfteCWU5Nk0CDN5ApUTvrlvBuiH1DyP6czDZ4ktbZB0hAgBlVcK0U+qpD3ag3Tqqpa5Q67rPw==} + engines: {node: '>=6'} + + '@sentry/utils@5.30.0': + resolution: {integrity: sha512-zaYmoH0NWWtvnJjC9/CBseXMtKHm/tm40sz3YfJRxeQjyzRqNQPgivpd9R/oDJCYj999mzdW382p/qi2ypjLww==} + engines: {node: '>=6'} + + '@sinclair/typebox@0.27.8': + resolution: {integrity: sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==} + + '@sindresorhus/is@0.14.0': + resolution: {integrity: sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ==} + engines: {node: '>=6'} + + '@sindresorhus/is@4.6.0': + resolution: {integrity: sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==} + engines: {node: '>=10'} + + '@sindresorhus/is@5.6.0': + resolution: {integrity: sha512-TV7t8GKYaJWsn00tFDqBw8+Uqmr8A0fRU1tvTQhyZzGv0sJCGRQL3JGMI3ucuKo3XIZdUP+Lx7/gh2t3lewy7g==} + engines: {node: '>=14.16'} + + '@sinonjs/commons@3.0.1': + resolution: {integrity: sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==} + + '@sinonjs/fake-timers@10.3.0': + resolution: {integrity: sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==} + + '@smithy/types@4.2.0': + resolution: {integrity: sha512-7eMk09zQKCO+E/ivsjQv+fDlOupcFUCSC/L2YUPgwhvowVGWbPQHjEFcmjt7QQ4ra5lyowS92SV53Zc6XD4+fg==} + engines: {node: '>=18.0.0'} + + '@solidity-parser/parser@0.14.5': + resolution: {integrity: sha512-6dKnHZn7fg/iQATVEzqyUOyEidbn05q7YA2mQ9hC0MMXhhV3/JrsxmFSYZAcr7j1yUP700LLhTruvJ3MiQmjJg==} + + '@solidity-parser/parser@0.16.2': + resolution: {integrity: sha512-PI9NfoA3P8XK2VBkK5oIfRgKDsicwDZfkVq9ZTBCQYGOP1N2owgY2dyLGyU5/J/hQs8KRk55kdmvTLjy3Mu3vg==} + + '@solidity-parser/parser@0.18.0': + resolution: {integrity: sha512-yfORGUIPgLck41qyN7nbwJRAx17/jAIXCTanHOJZhB6PJ1iAk/84b/xlsVKFSyNyLXIj0dhppoE0+CRws7wlzA==} + + '@solidity-parser/parser@0.19.0': + resolution: {integrity: sha512-RV16k/qIxW/wWc+mLzV3ARyKUaMUTBy9tOLMzFhtNSKYeTAanQ3a5MudJKf/8arIFnA2L27SNjarQKmFg0w/jA==} + + '@solidity-parser/parser@0.20.1': + resolution: {integrity: sha512-58I2sRpzaQUN+jJmWbHfbWf9AKfzqCI8JAdFB0vbyY+u8tBRcuTt9LxzasvR0LGQpcRv97eyV7l61FQ3Ib7zVw==} + + '@stylistic/eslint-plugin-js@1.8.1': + resolution: {integrity: sha512-c5c2C8Mos5tTQd+NWpqwEu7VT6SSRooAguFPMj1cp2RkTYl1ynKoXo8MWy3k4rkbzoeYHrqC2UlUzsroAN7wtQ==} + engines: {node: ^16.0.0 || >=18.0.0} + peerDependencies: + eslint: '>=8.40.0' + + '@stylistic/eslint-plugin-jsx@1.8.1': + resolution: {integrity: sha512-k1Eb6rcjMP+mmjvj+vd9y5KUdWn1OBkkPLHXhsrHt5lCDFZxJEs0aVQzE5lpYrtVZVkpc5esTtss/cPJux0lfA==} + engines: {node: ^16.0.0 || >=18.0.0} + peerDependencies: + eslint: '>=8.40.0' + + '@stylistic/eslint-plugin-plus@1.8.1': + resolution: {integrity: sha512-4+40H3lHYTN8OWz+US8CamVkO+2hxNLp9+CAjorI7top/lHqemhpJvKA1LD9Uh+WMY9DYWiWpL2+SZ2wAXY9fQ==} + peerDependencies: + eslint: '*' + + '@stylistic/eslint-plugin-ts@1.8.1': + resolution: {integrity: sha512-/q1m+ZuO1JHfiSF16EATFzv7XSJkc5W6DocfvH5o9oB6WWYFMF77fVoBWnKT3wGptPOc2hkRupRKhmeFROdfWA==} + engines: {node: ^16.0.0 || >=18.0.0} + peerDependencies: + eslint: '>=8.40.0' + + '@stylistic/eslint-plugin@1.8.1': + resolution: {integrity: sha512-64My6I7uCcmSQ//427Pfg2vjSf9SDzfsGIWohNFgISMLYdC5BzJqDo647iDDJzSxINh3WTC0Ql46ifiKuOoTyA==} + engines: {node: ^16.0.0 || >=18.0.0} + peerDependencies: + eslint: '>=8.40.0' + + '@szmarczak/http-timer@1.1.2': + resolution: {integrity: sha512-XIB2XbzHTN6ieIjfIMV9hlVcfPU26s2vafYWQcZHWXHOxiaRZYEDKEwdl129Zyg50+foYV2jCgtrqSA6qNuNSA==} + engines: {node: '>=6'} + + '@szmarczak/http-timer@4.0.6': + resolution: {integrity: sha512-4BAffykYOgO+5nzBWYwE3W90sBgLJoUPRWWcL8wlyiM8IB8ipJz3UMJ9KXQd1RKQXpKp8Tutn80HZtWsu2u76w==} + engines: {node: '>=10'} + + '@szmarczak/http-timer@5.0.1': + resolution: {integrity: sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw==} + engines: {node: '>=14.16'} + + '@tenderly/api-client@1.1.0': + resolution: {integrity: sha512-kyye7TQ+RbDbJ7bSUjNf/O9fTtRYNUDIEUZQSrmNonowMw5/EpNi664eWaOoC00NEzxgttVrtme/GHvIOu7rNg==} + peerDependencies: + ts-node: '*' + typescript: '*' + peerDependenciesMeta: + ts-node: + optional: true + typescript: + optional: true + + '@tenderly/hardhat-tenderly@1.0.13': + resolution: {integrity: sha512-XsrF2QIUh8YmzCcWHmPnSNQjZNBQkyrHER8bcrWsFIgL7ub49hmPbpGVB2Isb6gUV/IGBpBm7R69jpmoTvJ17g==} + peerDependencies: + hardhat: ^2.0.3 + + '@truffle/error@0.1.1': + resolution: {integrity: sha512-sE7c9IHIGdbK4YayH4BC8i8qMjoAOeg6nUXUDZZp8wlU21/EMpaG+CLx+KqcIPyR+GSWIW3Dm0PXkr2nlggFDA==} + deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. + + '@truffle/interface-adapter@0.5.37': + resolution: {integrity: sha512-lPH9MDgU+7sNDlJSClwyOwPCfuOimqsCx0HfGkznL3mcFRymc1pukAR1k17zn7ErHqBwJjiKAZ6Ri72KkS+IWw==} + engines: {node: ^16.20 || ^18.16 || >=20} + deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. + + '@truffle/provider@0.2.64': + resolution: {integrity: sha512-ZwPsofw4EsCq/2h0t73SPnnFezu4YQWBmK4FxFaOUX0F+o8NsZuHKyfJzuZwyZbiktYmefM3yD9rM0Dj4BhNbw==} + deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. + + '@tsconfig/node10@1.0.11': + resolution: {integrity: sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw==} + + '@tsconfig/node12@1.0.11': + resolution: {integrity: sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==} + + '@tsconfig/node14@1.0.3': + resolution: {integrity: sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==} + + '@tsconfig/node16@1.0.4': + resolution: {integrity: sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==} + + '@typechain/ethers-v5@2.0.0': + resolution: {integrity: sha512-0xdCkyGOzdqh4h5JSf+zoWx85IusEjDcPIwNEHP8mrWSnCae4rvrqB+/gtpdNfX7zjlFlZiMeePn2r63EI3Lrw==} + peerDependencies: + ethers: ^5.0.0 + typechain: ^3.0.0 + + '@typechain/ethers-v5@7.2.0': + resolution: {integrity: sha512-jfcmlTvaaJjng63QsT49MT6R1HFhtO/TBMWbyzPFSzMmVIqb2tL6prnKBs4ZJrSvmgIXWy+ttSjpaxCTq8D/Tw==} + peerDependencies: + '@ethersproject/abi': ^5.0.0 + '@ethersproject/bytes': ^5.0.0 + '@ethersproject/providers': ^5.0.0 + ethers: ^5.1.3 + typechain: ^5.0.0 + typescript: '>=4.0.0' + + '@typechain/ethers-v5@9.0.0': + resolution: {integrity: sha512-bAanuPl1L2itaUdMvor/QvwnIH+TM/CmG00q17Ilv3ZZMeJ2j8HcarhgJUZ9pBY1teBb85P8cC03dz3mSSx+tQ==} + peerDependencies: + '@ethersproject/abi': ^5.0.0 + '@ethersproject/bytes': ^5.0.0 + '@ethersproject/providers': ^5.0.0 + ethers: ^5.1.3 + typechain: ^7.0.0 + typescript: '>=4.0.0' + + '@typechain/ethers-v6@0.5.1': + resolution: {integrity: sha512-F+GklO8jBWlsaVV+9oHaPh5NJdd6rAKN4tklGfInX1Q7h0xPgVLP39Jl3eCulPB5qexI71ZFHwbljx4ZXNfouA==} + peerDependencies: + ethers: 6.x + typechain: ^8.3.2 + typescript: '>=4.7.0' + + '@typechain/hardhat@2.3.1': + resolution: {integrity: sha512-BQV8OKQi0KAzLXCdsPO0pZBNQQ6ra8A2ucC26uFX/kquRBtJu1yEyWnVSmtr07b5hyRoJRpzUeINLnyqz4/MAw==} + peerDependencies: + hardhat: ^2.0.10 + lodash: ^4.17.15 + typechain: ^5.1.2 + + '@typechain/hardhat@4.0.0': + resolution: {integrity: sha512-SeEKtiHu4Io3LHhE8VV3orJbsj7dwJZX8pzSTv7WQR38P18vOLm2M52GrykVinMpkLK0uVc88ICT58emvfn74w==} + peerDependencies: + hardhat: ^2.0.10 + lodash: ^4.17.15 + typechain: ^7.0.0 + + '@typechain/hardhat@9.1.0': + resolution: {integrity: sha512-mtaUlzLlkqTlfPwB3FORdejqBskSnh+Jl8AIJGjXNAQfRQ4ofHADPl1+oU7Z3pAJzmZbUXII8MhOLQltcHgKnA==} + peerDependencies: + '@typechain/ethers-v6': ^0.5.1 + ethers: ^6.1.0 + hardhat: ^2.9.9 + typechain: ^8.3.2 + + '@types/async-eventemitter@0.2.4': + resolution: {integrity: sha512-2Bq61VD01kgLf1XkK2xPtoBcu7fgn/km5JyEX9v0BlG5VQBzA+BlF9umFk+8gR8S4+eK7MgDY2oyVZCu6ar3Jw==} + + '@types/babel__core@7.20.5': + resolution: {integrity: sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==} + + '@types/babel__generator@7.27.0': + resolution: {integrity: sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg==} + + '@types/babel__template@7.4.4': + resolution: {integrity: sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==} + + '@types/babel__traverse@7.20.7': + resolution: {integrity: sha512-dkO5fhS7+/oos4ciWxyEyjWe48zmG6wbCheo/G2ZnHx4fs3EU6YC6UM8rk56gAjNJ9P3MTH2jo5jb92/K6wbng==} + + '@types/bn.js@4.11.6': + resolution: {integrity: sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg==} + + '@types/bn.js@5.1.6': + resolution: {integrity: sha512-Xh8vSwUeMKeYYrj3cX4lGQgFSF/N03r+tv4AiLl1SucqV+uTQpxRcnM8AkXKHwYP9ZPXOYXRr2KPXpVlIvqh9w==} + + '@types/bs58@4.0.4': + resolution: {integrity: sha512-0IEpMFXXQi2zXaXl9GJ3sRwQo0uEkD+yFOv+FnAU5lkPtcu6h61xb7jc2CFPEZ5BUOaiP13ThuGc9HD4R8lR5g==} + + '@types/cacheable-request@6.0.3': + resolution: {integrity: sha512-IQ3EbTzGxIigb1I3qPZc1rWJnH0BmSKv5QYTalEwweFvyBDLSAe24zP0le/hyi7ecGfZVlIVAg4BZqb8WBwKqw==} + + '@types/chai-as-promised@7.1.8': + resolution: {integrity: sha512-ThlRVIJhr69FLlh6IctTXFkmhtP3NpMZ2QGq69StYLyKZFp/HOp1VdKZj7RvfNWYYcJ1xlbLGLLWj1UvP5u/Gw==} + + '@types/chai@4.3.20': + resolution: {integrity: sha512-/pC9HAB5I/xMlc5FP77qjCnI16ChlJfW0tGa0IUcFn38VJrTV6DeZ60NU5KZBtaOZqjdpwTWohz5HU1RrhiYxQ==} + + '@types/chai@4.3.4': + resolution: {integrity: sha512-KnRanxnpfpjUTqTCXslZSEdLfXExwgNxYPdiO2WGUj8+HDjFi8R3k5RVKPeSCzLjCcshCAtVO2QBbVuAV4kTnw==} + + '@types/concat-stream@1.6.1': + resolution: {integrity: sha512-eHE4cQPoj6ngxBZMvVf6Hw7Mh4jMW4U9lpGmS5GBPB9RYxlFg+CHaVN7ErNY4W9XfLIEn20b4VDYaIrbq0q4uA==} + + '@types/debug@4.1.12': + resolution: {integrity: sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==} + + '@types/eslint@8.56.12': + resolution: {integrity: sha512-03ruubjWyOHlmljCVoxSuNDdmfZDzsrrz0P2LeJsOXr+ZwFQ+0yQIwNCwt/GYhV7Z31fgtXJTAEs+FYlEL851g==} + + '@types/eslint@9.6.1': + resolution: {integrity: sha512-FXx2pKgId/WyYo2jXw63kk7/+TY7u7AziEJxJAnSFzHlqTAS3Ync6SvgYAN/k4/PQpnnVuzoMuVnByKK2qp0ag==} + + '@types/eslint__js@8.42.3': + resolution: {integrity: sha512-alfG737uhmPdnvkrLdZLcEKJ/B8s9Y4hrZ+YAdzUeoArBlSUERA2E87ROfOaS4jd/C45fzOoZzidLc1IPwLqOw==} + + '@types/estree@1.0.7': + resolution: {integrity: sha512-w28IoSUCJpidD/TGviZwwMJckNESJZXFu7NBZ5YJ4mEUnNraUn9Pm8HSZm/jDF1pDWYKspWE7oVphigUPRakIQ==} + + '@types/events@3.0.3': + resolution: {integrity: sha512-trOc4AAUThEz9hapPtSd7wf5tiQKvTtu5b371UxXdTuqzIh0ArcRspRP0i0Viu+LXstIQ1z96t1nsPxT9ol01g==} + + '@types/form-data@0.0.33': + resolution: {integrity: sha512-8BSvG1kGm83cyJITQMZSulnl6QV8jqAGreJsc5tPu1Jq0vTSOiY/k24Wx82JRpWwZSqrala6sd5rWi6aNXvqcw==} + + '@types/glob@7.2.0': + resolution: {integrity: sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==} + + '@types/graceful-fs@4.1.9': + resolution: {integrity: sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ==} + + '@types/http-cache-semantics@4.0.4': + resolution: {integrity: sha512-1m0bIFVc7eJWyve9S0RnuRgcQqF/Xd5QsUZAZeQFr1Q3/p9JWoQQEqmVy+DPTNpGXwhgIetAoYF8JSc33q29QA==} + + '@types/inquirer@7.3.3': + resolution: {integrity: sha512-HhxyLejTHMfohAuhRun4csWigAMjXTmRyiJTU1Y/I1xmggikFMkOUoMQRlFm+zQcPEGHSs3io/0FAmNZf8EymQ==} + + '@types/istanbul-lib-coverage@2.0.6': + resolution: {integrity: sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==} + + '@types/istanbul-lib-report@3.0.3': + resolution: {integrity: sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA==} + + '@types/istanbul-reports@3.0.4': + resolution: {integrity: sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ==} + + '@types/json-schema@7.0.15': + resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} + + '@types/json5@2.2.0': + resolution: {integrity: sha512-NrVug5woqbvNZ0WX+Gv4R+L4TGddtmFek2u8RtccAgFZWtS9QXF2xCXY22/M4nzkaKF0q9Fc6M/5rxLDhfwc/A==} + deprecated: This is a stub types definition. json5 provides its own type definitions, so you do not need this installed. + + '@types/keyv@3.1.4': + resolution: {integrity: sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg==} + + '@types/lru-cache@5.1.1': + resolution: {integrity: sha512-ssE3Vlrys7sdIzs5LOxCzTVMsU7i9oa/IaW92wF32JFb3CVczqOkru2xspuKczHEbG3nvmPY7IFqVmGGHdNbYw==} + + '@types/minimatch@5.1.2': + resolution: {integrity: sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==} + + '@types/minimist@1.2.5': + resolution: {integrity: sha512-hov8bUuiLiyFPGyFPE1lwWhmzYbirOXQNNo40+y3zow8aFVTeyn3VWL0VFFfdNddA8S4Vf0Tc062rzyNr7Paag==} + + '@types/mkdirp@0.5.2': + resolution: {integrity: sha512-U5icWpv7YnZYGsN4/cmh3WD2onMY0aJIiTE6+51TwJCttdHvtCYmkBNOobHlXwrJRL0nkH9jH4kD+1FAdMN4Tg==} + + '@types/mocha@10.0.10': + resolution: {integrity: sha512-xPyYSz1cMPnJQhl0CLMH68j3gprKZaTjG3s5Vi+fDgx+uhG9NOXwbVt52eFS8ECyXhyKcjDLCBEqBExKuiZb7Q==} + + '@types/mocha@8.2.3': + resolution: {integrity: sha512-ekGvFhFgrc2zYQoX4JeZPmVzZxw6Dtllga7iGHzfbYIYkAMUx/sAFP2GdFpLff+vdHXu5fl7WX9AT+TtqYcsyw==} + + '@types/mocha@9.1.1': + resolution: {integrity: sha512-Z61JK7DKDtdKTWwLeElSEBcWGRLY8g95ic5FoQqI9CMx0ns/Ghep3B4DfcEimiKMvtamNVULVNKEsiwV3aQmXw==} + + '@types/ms@2.1.0': + resolution: {integrity: sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==} + + '@types/node-fetch@2.6.12': + resolution: {integrity: sha512-8nneRWKCg3rMtF69nLQJnOYUcbafYeFSjqkw3jCRLsqkWFlHaoQrr5mXmofFGOx3DKn7UfmBMyov8ySvLRVldA==} + + '@types/node@10.17.60': + resolution: {integrity: sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw==} + + '@types/node@12.20.55': + resolution: {integrity: sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==} + + '@types/node@17.0.45': + resolution: {integrity: sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw==} + + '@types/node@20.17.32': + resolution: {integrity: sha512-zeMXFn8zQ+UkjK4ws0RiOC9EWByyW1CcVmLe+2rQocXRsGEDxUCwPEIVgpsGcLHS/P8JkT0oa3839BRABS0oPw==} + + '@types/node@22.7.5': + resolution: {integrity: sha512-jML7s2NAzMWc//QSJ1a3prpk78cOPchGvXJsC3C6R6PSMoooztvRVQEz89gmBTBY1SPMaqo5teB4uNHPdetShQ==} + + '@types/node@8.10.66': + resolution: {integrity: sha512-tktOkFUA4kXx2hhhrB8bIFb5TbwzS4uOhKEmwiD+NoiL0qtP2OQ9mFldbgD4dV1djrlBYP6eBuQZiWjuHUpqFw==} + + '@types/normalize-package-data@2.4.4': + resolution: {integrity: sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==} + + '@types/parse-json@4.0.2': + resolution: {integrity: sha512-dISoDXWWQwUquiKsyZ4Ng+HX2KsPL7LyHKHQwgGFEA3IaKac4Obd+h2a/a6waisAoepJlBcx9paWqjA8/HVjCw==} + + '@types/pbkdf2@3.1.2': + resolution: {integrity: sha512-uRwJqmiXmh9++aSu1VNEn3iIxWOhd8AHXNSdlaLfdAAdSTY9jYVeGWnzejM3dvrkbqE3/hyQkQQ29IFATEGlew==} + + '@types/prettier@2.7.3': + resolution: {integrity: sha512-+68kP9yzs4LMp7VNh8gdzMSPZFL44MLGqiHWvttYJe+6qnuVr4Ek9wSBQoveqY/r+LwjCcU29kNVkidwim+kYA==} + + '@types/qs@6.9.18': + resolution: {integrity: sha512-kK7dgTYDyGqS+e2Q4aK9X3D7q234CIZ1Bv0q/7Z5IwRDoADNU81xXJK/YVyLbLTZCoIwUoDoffFeF+p/eIklAA==} + + '@types/readable-stream@2.3.15': + resolution: {integrity: sha512-oM5JSKQCcICF1wvGgmecmHldZ48OZamtMxcGGVICOJA8o8cahXC1zEVAif8iwoc5j8etxFaRFnf095+CDsuoFQ==} + + '@types/resolve@0.0.8': + resolution: {integrity: sha512-auApPaJf3NPfe18hSoJkp8EbZzer2ISk7o8mCC3M9he/a04+gbMF97NkpD2S8riMGvm4BMRI59/SZQSaLTKpsQ==} + + '@types/responselike@1.0.3': + resolution: {integrity: sha512-H/+L+UkTV33uf49PH5pCAUBVPNj2nDBXTN+qS1dOwyyg24l3CcicicCA7ca+HMvJBZcFgl5r8e+RR6elsb4Lyw==} + + '@types/secp256k1@4.0.6': + resolution: {integrity: sha512-hHxJU6PAEUn0TP4S/ZOzuTUvJWuZ6eIKeNKb5RBpODvSl6hp1Wrw4s7ATY50rklRCScUDpHzVA/DQdSjJ3UoYQ==} + + '@types/semver@7.7.0': + resolution: {integrity: sha512-k107IF4+Xr7UHjwDc7Cfd6PRQfbdkiRabXGRjo07b4WyPahFBZCZ1sE+BNxYIJPPg73UkfOsVOLwqVc/6ETrIA==} + + '@types/sinon-chai@3.2.12': + resolution: {integrity: sha512-9y0Gflk3b0+NhQZ/oxGtaAJDvRywCa5sIyaVnounqLvmf93yBF4EgIRspePtkMs3Tr844nCclYMlcCNmLCvjuQ==} + + '@types/sinon@17.0.4': + resolution: {integrity: sha512-RHnIrhfPO3+tJT0s7cFaXGZvsL4bbR3/k7z3P312qMS4JaS2Tk+KiwiLx1S0rQ56ERj00u1/BtdyVd0FY+Pdew==} + + '@types/sinonjs__fake-timers@8.1.5': + resolution: {integrity: sha512-mQkU2jY8jJEF7YHjHvsQO8+3ughTL1mcnn96igfhONmR+fUPSKIkefQYpSe8bsly2Ep7oQbn/6VG5/9/0qcArQ==} + + '@types/stack-utils@2.0.3': + resolution: {integrity: sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==} + + '@types/through@0.0.33': + resolution: {integrity: sha512-HsJ+z3QuETzP3cswwtzt2vEIiHBk/dCcHGhbmG5X3ecnwFD/lPrMpliGXxSCg03L9AhrdwA4Oz/qfspkDW+xGQ==} + + '@types/triple-beam@1.3.5': + resolution: {integrity: sha512-6WaYesThRMCl19iryMYP7/x2OVgCtbIVflDGFpWnb9irXI3UjYE4AzmYuiUKY1AJstGijoY+MgUszMgRxIYTYw==} + + '@types/underscore@1.13.0': + resolution: {integrity: sha512-L6LBgy1f0EFQZ+7uSA57+n2g/s4Qs5r06Vwrwn0/nuK1de+adz00NWaztRQ30aEqw5qOaWbPI8u2cGQ52lj6VA==} + + '@types/validator@13.15.0': + resolution: {integrity: sha512-nh7nrWhLr6CBq9ldtw0wx+z9wKnnv/uTVLA9g/3/TcOYxbpOSZE+MhKPmWqU+K0NvThjhv12uD8MuqijB0WzEA==} + + '@types/web3@1.0.19': + resolution: {integrity: sha512-fhZ9DyvDYDwHZUp5/STa9XW2re0E8GxoioYJ4pEUZ13YHpApSagixj7IAdoYH5uAK+UalGq6Ml8LYzmgRA/q+A==} + + '@types/winston@2.4.4': + resolution: {integrity: sha512-BVGCztsypW8EYwJ+Hq+QNYiT/MUyCif0ouBH+flrY66O5W+KIXAMML6E/0fJpm7VjIzgangahl5S03bJJQGrZw==} + deprecated: This is a stub types definition. winston provides its own type definitions, so you do not need this installed. + + '@types/ws@8.18.1': + resolution: {integrity: sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg==} + + '@types/yargs-parser@21.0.3': + resolution: {integrity: sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==} + + '@types/yargs@16.0.9': + resolution: {integrity: sha512-tHhzvkFXZQeTECenFoRljLBYPZJ7jAVxqqtEI0qTLOmuultnFp4I9yKE17vTuhf7BkhCu7I4XuemPgikDVuYqA==} + + '@types/yargs@17.0.33': + resolution: {integrity: sha512-WpxBCKWPLr4xSsHgz511rFJAM+wS28w2zEO1QDNY5zM/S8ok70NNfztH0xwhqKyaK0OHCbN98LDAZuy1ctxDkA==} + + '@typescript-eslint/eslint-plugin@7.18.0': + resolution: {integrity: sha512-94EQTWZ40mzBc42ATNIBimBEDltSJ9RQHCC8vc/PDbxi4k8dVwUAv4o98dk50M1zB+JGFxp43FP7f8+FP8R6Sw==} + engines: {node: ^18.18.0 || >=20.0.0} + peerDependencies: + '@typescript-eslint/parser': ^7.0.0 + eslint: ^8.56.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + + '@typescript-eslint/parser@7.18.0': + resolution: {integrity: sha512-4Z+L8I2OqhZV8qA132M4wNL30ypZGYOQVBfMgxDH/K5UX0PNqTu1c6za9ST5r9+tavvHiTWmBnKzpCJ/GlVFtg==} + engines: {node: ^18.18.0 || >=20.0.0} + peerDependencies: + eslint: ^8.56.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + + '@typescript-eslint/scope-manager@6.21.0': + resolution: {integrity: sha512-OwLUIWZJry80O99zvqXVEioyniJMa+d2GrqpUTqi5/v5D5rOrppJVBPa0yKCblcigC0/aYAzxxqQ1B+DS2RYsg==} + engines: {node: ^16.0.0 || >=18.0.0} + + '@typescript-eslint/scope-manager@7.18.0': + resolution: {integrity: sha512-jjhdIE/FPF2B7Z1uzc6i3oWKbGcHb87Qw7AWj6jmEqNOfDFbJWtjt/XfwCpvNkpGWlcJaog5vTR+VV8+w9JflA==} + engines: {node: ^18.18.0 || >=20.0.0} + + '@typescript-eslint/type-utils@7.18.0': + resolution: {integrity: sha512-XL0FJXuCLaDuX2sYqZUUSOJ2sG5/i1AAze+axqmLnSkNEVMVYLF+cbwlB2w8D1tinFuSikHmFta+P+HOofrLeA==} + engines: {node: ^18.18.0 || >=20.0.0} + peerDependencies: + eslint: ^8.56.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + + '@typescript-eslint/types@6.21.0': + resolution: {integrity: sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg==} + engines: {node: ^16.0.0 || >=18.0.0} + + '@typescript-eslint/types@7.18.0': + resolution: {integrity: sha512-iZqi+Ds1y4EDYUtlOOC+aUmxnE9xS/yCigkjA7XpTKV6nCBd3Hp/PRGGmdwnfkV2ThMyYldP1wRpm/id99spTQ==} + engines: {node: ^18.18.0 || >=20.0.0} + + '@typescript-eslint/typescript-estree@6.21.0': + resolution: {integrity: sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ==} + engines: {node: ^16.0.0 || >=18.0.0} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + + '@typescript-eslint/typescript-estree@7.18.0': + resolution: {integrity: sha512-aP1v/BSPnnyhMHts8cf1qQ6Q1IFwwRvAQGRvBFkWlo3/lH29OXA3Pts+c10nxRxIBrDnoMqzhgdwVe5f2D6OzA==} + engines: {node: ^18.18.0 || >=20.0.0} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + + '@typescript-eslint/utils@6.21.0': + resolution: {integrity: sha512-NfWVaC8HP9T8cbKQxHcsJBY5YE1O33+jpMwN45qzWWaPDZgLIbo12toGMWnmhvCpd3sIxkpDw3Wv1B3dYrbDQQ==} + engines: {node: ^16.0.0 || >=18.0.0} + peerDependencies: + eslint: ^7.0.0 || ^8.0.0 + + '@typescript-eslint/utils@7.18.0': + resolution: {integrity: sha512-kK0/rNa2j74XuHVcoCZxdFBMF+aq/vH83CXAOHieC+2Gis4mF8jJXT5eAfyD3K0sAxtPuwxaIOIOvhwzVDt/kw==} + engines: {node: ^18.18.0 || >=20.0.0} + peerDependencies: + eslint: ^8.56.0 + + '@typescript-eslint/visitor-keys@6.21.0': + resolution: {integrity: sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A==} + engines: {node: ^16.0.0 || >=18.0.0} + + '@typescript-eslint/visitor-keys@7.18.0': + resolution: {integrity: sha512-cDF0/Gf81QpY3xYyJKDV14Zwdmid5+uuENhjH2EqFaF0ni+yAyq/LzMaIJdhNJXZI7uLzwIlA+V7oWoyn6Curg==} + engines: {node: ^18.18.0 || >=20.0.0} + + '@ungap/structured-clone@1.3.0': + resolution: {integrity: sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==} + + '@urql/core@2.4.4': + resolution: {integrity: sha512-TD+OS7jG1Ts6QkpU0TZ85i/vu40r71GF0QQFDhnWFtgkHcNwnpkIwWBMa72AR3j2imBTPpk61e/xb39uM/t37A==} + peerDependencies: + graphql: ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 + + '@urql/core@2.6.1': + resolution: {integrity: sha512-gYrEHy3tViJhwIhauK6MIf2Qp09QTsgNHZRd0n71rS+hF6gdwjspf1oKljl4m25+272cJF7fPjBUGmjaiEr7Kg==} + peerDependencies: + graphql: ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 + + '@urql/core@3.1.0': + resolution: {integrity: sha512-6pYB4/WGZmuCxCc+h8AX9h+g1o75cPgMrcan+G/pYEDGAd6+PXoEuDumhEXpwu4vnkqCvVnFELEYcqkaM8ddPg==} + peerDependencies: + graphql: ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 + + '@urql/exchange-execute@1.2.2': + resolution: {integrity: sha512-KebdnKWMKI1NkRtIxp8YIouynOaFnhcdaMNCcJEtp+kmY4vGZUgdxT/SIzTPXXYJvk5G2aiQ/JMr97I+wM/EHA==} + peerDependencies: + graphql: ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 + + '@urql/exchange-execute@2.1.0': + resolution: {integrity: sha512-b84hq5EPgbERmg+98SqmMZqD5W3YrFkFii/6ZWVm5zsVdb+c0ZhRpUrpOCSemh5Jl5X291PG0WUUy2hdMtjraQ==} + peerDependencies: + graphql: ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 + + '@whatwg-node/cookie-store@0.0.1': + resolution: {integrity: sha512-uoti8QU5xd+X+9PULOGpPpOqPDdwkz+ukMc4kyQG1GwXeKVGktr4FSllr6dBotjOjNVPSBPpmj5V6zrUdDcLaw==} + + '@whatwg-node/events@0.0.2': + resolution: {integrity: sha512-WKj/lI4QjnLuPrim0cfO7i+HsDSXHxNv1y0CrJhdntuO3hxWZmnXCwNDnwOvry11OjRin6cgWNF+j/9Pn8TN4w==} + + '@whatwg-node/events@0.0.3': + resolution: {integrity: sha512-IqnKIDWfXBJkvy/k6tzskWTc2NK3LcqHlb+KHGCrjOCH4jfQckRX0NAiIcC/vIqQkzLYw2r2CTSwAxcrtcD6lA==} + + '@whatwg-node/fetch@0.8.8': + resolution: {integrity: sha512-CdcjGC2vdKhc13KKxgsc6/616BQ7ooDIgPeTuAiE8qfCnS0mGzcfCOoZXypQSz73nxI+GWc7ZReIAVhxoE1KCg==} + + '@whatwg-node/node-fetch@0.3.6': + resolution: {integrity: sha512-w9wKgDO4C95qnXZRwZTfCmLWqyRnooGjcIwG0wADWjw9/HN0p7dtvtgSvItZtUyNteEvgTrd8QojNEqV6DAGTA==} + + '@whatwg-node/server@0.7.7': + resolution: {integrity: sha512-aHURgNDFm/48WVV3vhTMfnEKCYwYgdaRdRhZsQZx4UVFjGGkGay7Ys0+AYu9QT/jpoImv2oONkstoTMUprDofg==} + + '@yarnpkg/lockfile@1.1.0': + resolution: {integrity: sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ==} + + '@zxing/text-encoding@0.9.0': + resolution: {integrity: sha512-U/4aVJ2mxI0aDNI8Uq0wEhMgY+u4CNtEb0om3+y3+niDAsoTCOB33UF0sxpzqzdqXLqmvc+vZyAt4O8pPdfkwA==} + + JSONStream@1.3.5: + resolution: {integrity: sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==} + hasBin: true + + abbrev@1.0.9: + resolution: {integrity: sha512-LEyx4aLEC3x6T0UguF6YILf+ntvmOaWsVfENmIW0E9H09vKlLDGelMjjSm0jkDHALj8A8quZ/HapKNigzwge+Q==} + + abitype@0.7.1: + resolution: {integrity: sha512-VBkRHTDZf9Myaek/dO3yMmOzB/y2s3Zo6nVU7yaw1G+TvCHAjwaJzNGN9yo4K5D8bU/VZXKP1EJpRhFr862PlQ==} + peerDependencies: + typescript: '>=4.9.4' + zod: ^3 >=3.19.1 + peerDependenciesMeta: + zod: + optional: true + + abort-controller@3.0.0: + resolution: {integrity: sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==} + engines: {node: '>=6.5'} + + abortcontroller-polyfill@1.7.8: + resolution: {integrity: sha512-9f1iZ2uWh92VcrU9Y8x+LdM4DLj75VE0MJB8zuF1iUnroEptStw+DQ8EQPMUdfe5k+PkB1uUfDQfWbhstH8LrQ==} + + abstract-level@1.0.4: + resolution: {integrity: sha512-eUP/6pbXBkMbXFdx4IH2fVgvB7M0JvR7/lIL33zcs0IBcwjdzSSl31TOJsaCzmKSSDF9h8QYSOJux4Nd4YJqFg==} + engines: {node: '>=12'} + + abstract-leveldown@2.6.3: + resolution: {integrity: sha512-2++wDf/DYqkPR3o5tbfdhF96EfMApo1GpPfzOsR/ZYXdkSmELlvOOEAl9iKkRsktMPHdGjO4rtkBpf2I7TiTeA==} + deprecated: Superseded by abstract-level (https://github.com/Level/community#faq) + + abstract-leveldown@2.7.2: + resolution: {integrity: sha512-+OVvxH2rHVEhWLdbudP6p0+dNMXu8JA1CbhP19T8paTYAcX7oJ4OVjT+ZUVpv7mITxXHqDMej+GdqXBmXkw09w==} + deprecated: Superseded by abstract-level (https://github.com/Level/community#faq) + + abstract-leveldown@3.0.0: + resolution: {integrity: sha512-KUWx9UWGQD12zsmLNj64/pndaz4iJh/Pj7nopgkfDG6RlCcbMZvT6+9l7dchK4idog2Is8VdC/PvNbFuFmalIQ==} + engines: {node: '>=4'} + deprecated: Superseded by abstract-level (https://github.com/Level/community#faq) + + abstract-leveldown@5.0.0: + resolution: {integrity: sha512-5mU5P1gXtsMIXg65/rsYGsi93+MlogXZ9FA8JnwKurHQg64bfXwGYVdVdijNTVNOlAsuIiOwHdvFFD5JqCJQ7A==} + engines: {node: '>=6'} + deprecated: Superseded by abstract-level (https://github.com/Level/community#faq) + + accepts@1.3.8: + resolution: {integrity: sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==} + engines: {node: '>= 0.6'} + + acorn-jsx@5.3.2: + resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} + peerDependencies: + acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 + + acorn-walk@8.3.4: + resolution: {integrity: sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g==} + engines: {node: '>=0.4.0'} + + acorn@8.14.1: + resolution: {integrity: sha512-OvQ/2pUDKmgfCg++xsTX1wGxfTaszcHVcTctW4UJB4hibJx2HXxxO5UmVgyjMa+ZDsiaf5wWLXYpRWMmBI0QHg==} + engines: {node: '>=0.4.0'} + hasBin: true + + address@1.2.2: + resolution: {integrity: sha512-4B/qKCfeE/ODUaAUpSwfzazo5x29WD4r3vXiWsB7I2mSDAihwEqKO+g8GELZUQSSAo5e1XTYh3ZVfLyxBc12nA==} + engines: {node: '>= 10.0.0'} + + adm-zip@0.4.16: + resolution: {integrity: sha512-TFi4HBKSGfIKsK5YCkKaaFG2m4PEDyViZmEwof3MTIgzimHLto6muaHVpbrljdIvIrFZzEq/p4nafOeLcYegrg==} + engines: {node: '>=0.3.0'} + + aes-js@3.0.0: + resolution: {integrity: sha512-H7wUZRn8WpTq9jocdxQ2c8x2sKo9ZVmzfRE13GiNJXfp7NcKYEdvl3vspKjXox6RIG2VtaRe4JFvxG4rqp2Zuw==} + + aes-js@3.1.2: + resolution: {integrity: sha512-e5pEa2kBnBOgR4Y/p20pskXI74UEz7de8ZGVo58asOtvSVG5YAbJeELPZxOmt+Bnz3rX753YKhfIn4X4l1PPRQ==} + + aes-js@4.0.0-beta.5: + resolution: {integrity: sha512-G965FqalsNyrPqgEGON7nIx1e/OVENSgiEIzyC63haUMuvNnwIgIjMs52hlTCKhkBny7A2ORNlfY9Zu+jmGk1Q==} + + agent-base@6.0.2: + resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} + engines: {node: '>= 6.0.0'} + + agent-base@7.1.3: + resolution: {integrity: sha512-jRR5wdylq8CkOe6hei19GGZnxM6rBGwFl3Bg0YItGDimvjGtAvdZk4Pu6Cl4u4Igsws4a1fd1Vq3ezrhn4KmFw==} + engines: {node: '>= 14'} + + aggregate-error@3.1.0: + resolution: {integrity: sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==} + engines: {node: '>=8'} + + ajv-formats@2.1.1: + resolution: {integrity: sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==} + peerDependencies: + ajv: ^8.0.0 + peerDependenciesMeta: + ajv: + optional: true + + ajv@5.5.2: + resolution: {integrity: sha512-Ajr4IcMXq/2QmMkEmSvxqfLN5zGmJ92gHXAeOXq1OekoH2rfDNsgdDoL2f7QaRCy7G/E6TpxBVdRuNraMztGHw==} + + ajv@6.12.6: + resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==} + + ajv@8.17.1: + resolution: {integrity: sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==} + + amazon-cognito-identity-js@6.3.15: + resolution: {integrity: sha512-G2mzTlGYHKYh9oZDO0Gk94xVQ4iY9GYWBaYScbDYvz05ps6dqi0IvdNx1Lxi7oA3tjS5X+mUN7/svFJJdOB9YA==} + + amdefine@1.0.1: + resolution: {integrity: sha512-S2Hw0TtNkMJhIabBwIojKL9YHO5T0n5eNqWJ7Lrlel/zDbftQpxpapi8tZs3X1HWa+u+QeydGmzzNU0m09+Rcg==} + engines: {node: '>=0.4.2'} + + anser@1.4.10: + resolution: {integrity: sha512-hCv9AqTQ8ycjpSd3upOJd7vFwW1JaoYQ7tpham03GJ1ca8/65rqn0RpaWpItOAd6ylW9wAw6luXYPJIyPFVOww==} + + ansi-align@3.0.1: + resolution: {integrity: sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w==} + + ansi-colors@4.1.3: + resolution: {integrity: sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==} + engines: {node: '>=6'} + + ansi-escapes@4.3.2: + resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} + engines: {node: '>=8'} + + ansi-escapes@7.0.0: + resolution: {integrity: sha512-GdYO7a61mR0fOlAsvC9/rIHf7L96sBc6dEWzeOu+KAea5bZyQRPIpojrVoI4AXGJS/ycu/fBTdLrUkA4ODrvjw==} + engines: {node: '>=18'} + + ansi-regex@2.1.1: + resolution: {integrity: sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==} + engines: {node: '>=0.10.0'} + + ansi-regex@3.0.1: + resolution: {integrity: sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==} + engines: {node: '>=4'} + + ansi-regex@4.1.1: + resolution: {integrity: sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==} + engines: {node: '>=6'} + + ansi-regex@5.0.1: + resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} + engines: {node: '>=8'} + + ansi-regex@6.1.0: + resolution: {integrity: sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==} + engines: {node: '>=12'} + + ansi-styles@2.2.1: + resolution: {integrity: sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA==} + engines: {node: '>=0.10.0'} + + ansi-styles@3.2.1: + resolution: {integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==} + engines: {node: '>=4'} + + ansi-styles@4.3.0: + resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} + engines: {node: '>=8'} + + ansi-styles@5.2.0: + resolution: {integrity: sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==} + engines: {node: '>=10'} + + ansi-styles@6.2.1: + resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} + engines: {node: '>=12'} + + antlr4@4.13.2: + resolution: {integrity: sha512-QiVbZhyy4xAZ17UPEuG3YTOt8ZaoeOR1CvEAqrEsDBsOqINslaB147i9xqljZqoyf5S+EUlGStaj+t22LT9MOg==} + engines: {node: '>=16'} + + antlr4ts@0.5.0-alpha.4: + resolution: {integrity: sha512-WPQDt1B74OfPv/IMS2ekXAKkTZIHl88uMetg6q3OTqgFxZ/dxDXI0EWLyZid/1Pe6hTftyg5N7gel5wNAGxXyQ==} + + any-signal@1.2.0: + resolution: {integrity: sha512-Cl08k4xItix3jvu4cxO/dt2rQ6iUAjO66pTyRMub+WL1VXeAyZydCpD8GqWTPKfdL28U0R0UucmQVsUsBnvCmQ==} + + anymatch@1.3.2: + resolution: {integrity: sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA==} + + anymatch@3.1.3: + resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} + engines: {node: '>= 8'} + + aproba@1.2.0: + resolution: {integrity: sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==} + + arbos-precompiles@1.0.2: + resolution: {integrity: sha512-1dOFYFJUN0kKoofh6buZJ8qCqTs+oLGSsGzHI0trA/Pka/TCERflCRsNVxez2lihOvK7MT/a2RA8AepKtBXdPQ==} + deprecated: This package is no longer maintained, instead look into @arbitrum/nitro-contracts + + are-we-there-yet@1.1.7: + resolution: {integrity: sha512-nxwy40TuMiUGqMyRHgCSWZ9FM4VAoRP4xUYSTv5ImRog+h9yISPbVH7H8fASCIzYn9wlEv4zvFL7uKDMCFQm3g==} + deprecated: This package is no longer supported. + + arg@4.1.3: + resolution: {integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==} + + argparse@1.0.10: + resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} + + argparse@2.0.1: + resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} + + arr-diff@2.0.0: + resolution: {integrity: sha512-dtXTVMkh6VkEEA7OhXnN1Ecb8aAGFdZ1LFxtOCoqj4qkyOJMt7+qs6Ahdy6p/NQCPYsRSXXivhSB/J5E9jmYKA==} + engines: {node: '>=0.10.0'} + + arr-diff@4.0.0: + resolution: {integrity: sha512-YVIQ82gZPGBebQV/a8dar4AitzCQs0jjXwMPZllpXMaGjXPYVUawSxQrRsjhjupyVxEvbHgUmIhKVlND+j02kA==} + engines: {node: '>=0.10.0'} + + arr-flatten@1.1.0: + resolution: {integrity: sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==} + engines: {node: '>=0.10.0'} + + arr-union@3.1.0: + resolution: {integrity: sha512-sKpyeERZ02v1FeCZT8lrfJq5u6goHCtpTAzPwJYe7c8SPFOboNjNg1vz2L4VTn9T4PQxEx13TbXLmYUcS6Ug7Q==} + engines: {node: '>=0.10.0'} + + array-back@1.0.4: + resolution: {integrity: sha512-1WxbZvrmyhkNoeYcizokbmh5oiOCIfyvGtcqbK3Ls1v1fKcquzxnQSceOx6tzq7jmai2kFLWIpGND2cLhH6TPw==} + engines: {node: '>=0.12.0'} + + array-back@2.0.0: + resolution: {integrity: sha512-eJv4pLLufP3g5kcZry0j6WXpIbzYw9GUB4mVJZno9wfwiBxbizTnHCw3VJb07cBihbFX48Y7oSrW9y+gt4glyw==} + engines: {node: '>=4'} + + array-back@3.1.0: + resolution: {integrity: sha512-TkuxA4UCOvxuDK6NZYXCalszEzj+TLszyASooky+i742l9TqsOdYCMJJupxRic61hwquNtppB3hgcuq9SVSH1Q==} + engines: {node: '>=6'} + + array-back@4.0.2: + resolution: {integrity: sha512-NbdMezxqf94cnNfWLL7V/im0Ub+Anbb0IoZhvzie8+4HJ4nMQuzHuy49FkGYCJK2yAloZ3meiB6AVMClbrI1vg==} + engines: {node: '>=8'} + + array-buffer-byte-length@1.0.2: + resolution: {integrity: sha512-LHE+8BuR7RYGDKvnrmcuSq3tDcKv9OFEXQt/HpbZhY7V6h0zlUXutnAD82GiFx9rdieCMjkvtcsPqBwgUl1Iiw==} + engines: {node: '>= 0.4'} + + array-flatten@1.1.1: + resolution: {integrity: sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==} + + array-ify@1.0.0: + resolution: {integrity: sha512-c5AMf34bKdvPhQ7tBGhqkgKNUzMr4WUs+WDtC2ZUGOUncbxKMTvqxYctiseW3+L4bA8ec+GcZ6/A/FW4m8ukng==} + + array-union@2.1.0: + resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==} + engines: {node: '>=8'} + + array-uniq@1.0.3: + resolution: {integrity: sha512-MNha4BWQ6JbwhFhj03YK552f7cb3AzoE8SzeljgChvL1dl3IcvggXVz1DilzySZkCja+CXuZbdW7yATchWn8/Q==} + engines: {node: '>=0.10.0'} + + array-unique@0.2.1: + resolution: {integrity: sha512-G2n5bG5fSUCpnsXz4+8FUkYsGPkNfLn9YvS66U5qbTIXI2Ynnlo4Bi42bWv+omKUCqz+ejzfClwne0alJWJPhg==} + engines: {node: '>=0.10.0'} + + array-unique@0.3.2: + resolution: {integrity: sha512-SleRWjh9JUud2wH1hPs9rZBZ33H6T9HOiL0uwGnGx9FpE6wKGyfWugmbkEOIs6qWrZhg0LWeLziLrEwQJhs5mQ==} + engines: {node: '>=0.10.0'} + + array.prototype.reduce@1.0.8: + resolution: {integrity: sha512-DwuEqgXFBwbmZSRqt3BpQigWNUoqw9Ml2dTWdF3B2zQlQX4OeUE0zyuzX0fX0IbTvjdkZbcBTU3idgpO78qkTw==} + engines: {node: '>= 0.4'} + + arraybuffer.prototype.slice@1.0.4: + resolution: {integrity: sha512-BNoCY6SXXPQ7gF2opIP4GBE+Xw7U+pHMYKuzjgCN3GwiaIR09UUeKfheyIry77QtrCBlC0KK0q5/TER/tYh3PQ==} + engines: {node: '>= 0.4'} + + arrify@1.0.1: + resolution: {integrity: sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA==} + engines: {node: '>=0.10.0'} + + asap@2.0.6: + resolution: {integrity: sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==} + + asn1.js@4.10.1: + resolution: {integrity: sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==} + + asn1@0.2.6: + resolution: {integrity: sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==} + + asn1js@3.0.6: + resolution: {integrity: sha512-UOCGPYbl0tv8+006qks/dTgV9ajs97X2p0FAbyS2iyCRrmLSRolDaHdp+v/CLgnzHc3fVB+CwYiUmei7ndFcgA==} + engines: {node: '>=12.0.0'} + + assert-plus@1.0.0: + resolution: {integrity: sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==} + engines: {node: '>=0.8'} + + assertion-error@1.1.0: + resolution: {integrity: sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==} + + assign-symbols@1.0.0: + resolution: {integrity: sha512-Q+JC7Whu8HhmTdBph/Tq59IoRtoy6KAm5zzPv00WdujX82lbAL8K7WVjne7vdCsAmbF4AYaDOPyO3k0kl8qIrw==} + engines: {node: '>=0.10.0'} + + ast-parents@0.0.1: + resolution: {integrity: sha512-XHusKxKz3zoYk1ic8Un640joHbFMhbqneyoZfoKnEGtf2ey9Uh/IdpcQplODdO/kENaMIWsD0nJm4+wX3UNLHA==} + + astral-regex@2.0.0: + resolution: {integrity: sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==} + engines: {node: '>=8'} + + async-each@1.0.6: + resolution: {integrity: sha512-c646jH1avxr+aVpndVMeAfYw7wAa6idufrlN3LPA4PmKS0QEGp6PIC9nwz0WQkkvBGAMEki3pFdtxaF39J9vvg==} + + async-eventemitter@0.2.4: + resolution: {integrity: sha512-pd20BwL7Yt1zwDFy+8MX8F1+WCT8aQeKj0kQnTrH9WaeRETlRamVhD0JtRPmrV4GfOJ2F9CvdQkZeZhnh2TuHw==} + + async-function@1.0.0: + resolution: {integrity: sha512-hsU18Ae8CDTR6Kgu9DYf0EbCr/a5iGL0rytQDobUcdpYOKokk8LEjVphnXkDkgpi0wYVsqrXuP0bZxJaTqdgoA==} + engines: {node: '>= 0.4'} + + async-limiter@1.0.1: + resolution: {integrity: sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==} + + async-mutex@0.4.1: + resolution: {integrity: sha512-WfoBo4E/TbCX1G95XTjbWTE3X2XLG0m1Xbv2cwOtuPdyH9CZvnaA5nCt1ucjaKEgW2A5IF71hxrRhr83Je5xjA==} + + async-retry@1.3.3: + resolution: {integrity: sha512-wfr/jstw9xNi/0teMHrRW7dsz3Lt5ARhYNZ2ewpadnhaIp5mbALhOAP+EAdsC7t4Z6wqsDVv9+W6gm1Dk9mEyw==} + + async@1.5.2: + resolution: {integrity: sha512-nSVgobk4rv61R9PUSDtYt7mPVB2olxNR5RWJcAsH676/ef11bUZwvu7+RGYrYauVdDPcO519v68wRhXQtxsV9w==} + + async@2.6.2: + resolution: {integrity: sha512-H1qVYh1MYhEEFLsP97cVKqCGo7KfCyTt6uEWqsTBr9SO84oK9Uwbyd/yCW+6rKJLHksBNUVWZDAjfS+Ccx0Bbg==} + + async@2.6.4: + resolution: {integrity: sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA==} + + async@3.2.6: + resolution: {integrity: sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==} + + asynckit@0.4.0: + resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} + + at-least-node@1.0.0: + resolution: {integrity: sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==} + engines: {node: '>= 4.0.0'} + + atob@2.1.2: + resolution: {integrity: sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==} + engines: {node: '>= 4.5.0'} + hasBin: true + + atomic-sleep@1.0.0: + resolution: {integrity: sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ==} + engines: {node: '>=8.0.0'} + + auto-bind@4.0.0: + resolution: {integrity: sha512-Hdw8qdNiqdJ8LqT0iK0sVzkFbzg6fhnQqqfWhBDxcHZvU75+B+ayzTy8x+k5Ix0Y92XOhOUlx74ps+bA6BeYMQ==} + engines: {node: '>=8'} + + available-typed-arrays@1.0.7: + resolution: {integrity: sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==} + engines: {node: '>= 0.4'} + + aws-sign2@0.7.0: + resolution: {integrity: sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA==} + + aws4@1.13.2: + resolution: {integrity: sha512-lHe62zvbTB5eEABUVi/AwVh0ZKY9rMMDhmm+eeyuuUQbQ3+J+fONVQOZyj+DdrvD4BY33uYniyRJ4UJIaSKAfw==} + + axios@0.21.4: + resolution: {integrity: sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==} + + axios@0.27.2: + resolution: {integrity: sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==} + + axios@1.9.0: + resolution: {integrity: sha512-re4CqKTJaURpzbLHtIi6XpDv20/CnpXOtjRY5/CU32L8gU8ek9UIivcfvSWvmKEngmVbrUtPpdDwWDWL7DNHvg==} + + babel-code-frame@6.26.0: + resolution: {integrity: sha512-XqYMR2dfdGMW+hd0IUZ2PwK+fGeFkOxZJ0wY+JaQAHzt1Zx8LcvpiZD2NiGkEG8qx0CfkAOr5xt76d1e8vG90g==} + + babel-core@6.26.3: + resolution: {integrity: sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA==} + + babel-generator@6.26.1: + resolution: {integrity: sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA==} + + babel-helper-builder-binary-assignment-operator-visitor@6.24.1: + resolution: {integrity: sha512-gCtfYORSG1fUMX4kKraymq607FWgMWg+j42IFPc18kFQEsmtaibP4UrqsXt8FlEJle25HUd4tsoDR7H2wDhe9Q==} + + babel-helper-call-delegate@6.24.1: + resolution: {integrity: sha512-RL8n2NiEj+kKztlrVJM9JT1cXzzAdvWFh76xh/H1I4nKwunzE4INBXn8ieCZ+wh4zWszZk7NBS1s/8HR5jDkzQ==} + + babel-helper-define-map@6.26.0: + resolution: {integrity: sha512-bHkmjcC9lM1kmZcVpA5t2om2nzT/xiZpo6TJq7UlZ3wqKfzia4veeXbIhKvJXAMzhhEBd3cR1IElL5AenWEUpA==} + + babel-helper-explode-assignable-expression@6.24.1: + resolution: {integrity: sha512-qe5csbhbvq6ccry9G7tkXbzNtcDiH4r51rrPUbwwoTzZ18AqxWYRZT6AOmxrpxKnQBW0pYlBI/8vh73Z//78nQ==} + + babel-helper-function-name@6.24.1: + resolution: {integrity: sha512-Oo6+e2iX+o9eVvJ9Y5eKL5iryeRdsIkwRYheCuhYdVHsdEQysbc2z2QkqCLIYnNxkT5Ss3ggrHdXiDI7Dhrn4Q==} + + babel-helper-get-function-arity@6.24.1: + resolution: {integrity: sha512-WfgKFX6swFB1jS2vo+DwivRN4NB8XUdM3ij0Y1gnC21y1tdBoe6xjVnd7NSI6alv+gZXCtJqvrTeMW3fR/c0ng==} + + babel-helper-hoist-variables@6.24.1: + resolution: {integrity: sha512-zAYl3tqerLItvG5cKYw7f1SpvIxS9zi7ohyGHaI9cgDUjAT6YcY9jIEH5CstetP5wHIVSceXwNS7Z5BpJg+rOw==} + + babel-helper-optimise-call-expression@6.24.1: + resolution: {integrity: sha512-Op9IhEaxhbRT8MDXx2iNuMgciu2V8lDvYCNQbDGjdBNCjaMvyLf4wl4A3b8IgndCyQF8TwfgsQ8T3VD8aX1/pA==} + + babel-helper-regex@6.26.0: + resolution: {integrity: sha512-VlPiWmqmGJp0x0oK27Out1D+71nVVCTSdlbhIVoaBAj2lUgrNjBCRR9+llO4lTSb2O4r7PJg+RobRkhBrf6ofg==} + + babel-helper-remap-async-to-generator@6.24.1: + resolution: {integrity: sha512-RYqaPD0mQyQIFRu7Ho5wE2yvA/5jxqCIj/Lv4BXNq23mHYu/vxikOy2JueLiBxQknwapwrJeNCesvY0ZcfnlHg==} + + babel-helper-replace-supers@6.24.1: + resolution: {integrity: sha512-sLI+u7sXJh6+ToqDr57Bv973kCepItDhMou0xCP2YPVmR1jkHSCY+p1no8xErbV1Siz5QE8qKT1WIwybSWlqjw==} + + babel-helpers@6.24.1: + resolution: {integrity: sha512-n7pFrqQm44TCYvrCDb0MqabAF+JUBq+ijBvNMUxpkLjJaAu32faIexewMumrH5KLLJ1HDyT0PTEqRyAe/GwwuQ==} + + babel-jest@29.7.0: + resolution: {integrity: sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + peerDependencies: + '@babel/core': ^7.8.0 + + babel-messages@6.23.0: + resolution: {integrity: sha512-Bl3ZiA+LjqaMtNYopA9TYE9HP1tQ+E5dLxE0XrAzcIJeK2UqF0/EaqXwBn9esd4UmTfEab+P+UYQ1GnioFIb/w==} + + babel-plugin-check-es2015-constants@6.22.0: + resolution: {integrity: sha512-B1M5KBP29248dViEo1owyY32lk1ZSH2DaNNrXLGt8lyjjHm7pBqAdQ7VKUPR6EEDO323+OvT3MQXbCin8ooWdA==} + + babel-plugin-istanbul@6.1.1: + resolution: {integrity: sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==} + engines: {node: '>=8'} + + babel-plugin-jest-hoist@29.6.3: + resolution: {integrity: sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + babel-plugin-syntax-async-functions@6.13.0: + resolution: {integrity: sha512-4Zp4unmHgw30A1eWI5EpACji2qMocisdXhAftfhXoSV9j0Tvj6nRFE3tOmRY912E0FMRm/L5xWE7MGVT2FoLnw==} + + babel-plugin-syntax-exponentiation-operator@6.13.0: + resolution: {integrity: sha512-Z/flU+T9ta0aIEKl1tGEmN/pZiI1uXmCiGFRegKacQfEJzp7iNsKloZmyJlQr+75FCJtiFfGIK03SiCvCt9cPQ==} + + babel-plugin-syntax-hermes-parser@0.25.1: + resolution: {integrity: sha512-IVNpGzboFLfXZUAwkLFcI/bnqVbwky0jP3eBno4HKtqvQJAHBLdgxiG6lQ4to0+Q/YCN3PO0od5NZwIKyY4REQ==} + + babel-plugin-syntax-trailing-function-commas@6.22.0: + resolution: {integrity: sha512-Gx9CH3Q/3GKbhs07Bszw5fPTlU+ygrOGfAhEt7W2JICwufpC4SuO0mG0+4NykPBSYPMJhqvVlDBU17qB1D+hMQ==} + + babel-plugin-syntax-trailing-function-commas@7.0.0-beta.0: + resolution: {integrity: sha512-Xj9XuRuz3nTSbaTXWv3itLOcxyF4oPD8douBBmj7U9BBC6nEBYfyOJYQMf/8PJAFotC62UY5dFfIGEPr7WswzQ==} + + babel-plugin-transform-async-to-generator@6.24.1: + resolution: {integrity: sha512-7BgYJujNCg0Ti3x0c/DL3tStvnKS6ktIYOmo9wginv/dfZOrbSZ+qG4IRRHMBOzZ5Awb1skTiAsQXg/+IWkZYw==} + + babel-plugin-transform-es2015-arrow-functions@6.22.0: + resolution: {integrity: sha512-PCqwwzODXW7JMrzu+yZIaYbPQSKjDTAsNNlK2l5Gg9g4rz2VzLnZsStvp/3c46GfXpwkyufb3NCyG9+50FF1Vg==} + + babel-plugin-transform-es2015-block-scoped-functions@6.22.0: + resolution: {integrity: sha512-2+ujAT2UMBzYFm7tidUsYh+ZoIutxJ3pN9IYrF1/H6dCKtECfhmB8UkHVpyxDwkj0CYbQG35ykoz925TUnBc3A==} + + babel-plugin-transform-es2015-block-scoping@6.26.0: + resolution: {integrity: sha512-YiN6sFAQ5lML8JjCmr7uerS5Yc/EMbgg9G8ZNmk2E3nYX4ckHR01wrkeeMijEf5WHNK5TW0Sl0Uu3pv3EdOJWw==} + + babel-plugin-transform-es2015-classes@6.24.1: + resolution: {integrity: sha512-5Dy7ZbRinGrNtmWpquZKZ3EGY8sDgIVB4CU8Om8q8tnMLrD/m94cKglVcHps0BCTdZ0TJeeAWOq2TK9MIY6cag==} + + babel-plugin-transform-es2015-computed-properties@6.24.1: + resolution: {integrity: sha512-C/uAv4ktFP/Hmh01gMTvYvICrKze0XVX9f2PdIXuriCSvUmV9j+u+BB9f5fJK3+878yMK6dkdcq+Ymr9mrcLzw==} + + babel-plugin-transform-es2015-destructuring@6.23.0: + resolution: {integrity: sha512-aNv/GDAW0j/f4Uy1OEPZn1mqD+Nfy9viFGBfQ5bZyT35YqOiqx7/tXdyfZkJ1sC21NyEsBdfDY6PYmLHF4r5iA==} + + babel-plugin-transform-es2015-duplicate-keys@6.24.1: + resolution: {integrity: sha512-ossocTuPOssfxO2h+Z3/Ea1Vo1wWx31Uqy9vIiJusOP4TbF7tPs9U0sJ9pX9OJPf4lXRGj5+6Gkl/HHKiAP5ug==} + + babel-plugin-transform-es2015-for-of@6.23.0: + resolution: {integrity: sha512-DLuRwoygCoXx+YfxHLkVx5/NpeSbVwfoTeBykpJK7JhYWlL/O8hgAK/reforUnZDlxasOrVPPJVI/guE3dCwkw==} + + babel-plugin-transform-es2015-function-name@6.24.1: + resolution: {integrity: sha512-iFp5KIcorf11iBqu/y/a7DK3MN5di3pNCzto61FqCNnUX4qeBwcV1SLqe10oXNnCaxBUImX3SckX2/o1nsrTcg==} + + babel-plugin-transform-es2015-literals@6.22.0: + resolution: {integrity: sha512-tjFl0cwMPpDYyoqYA9li1/7mGFit39XiNX5DKC/uCNjBctMxyL1/PT/l4rSlbvBG1pOKI88STRdUsWXB3/Q9hQ==} + + babel-plugin-transform-es2015-modules-amd@6.24.1: + resolution: {integrity: sha512-LnIIdGWIKdw7zwckqx+eGjcS8/cl8D74A3BpJbGjKTFFNJSMrjN4bIh22HY1AlkUbeLG6X6OZj56BDvWD+OeFA==} + + babel-plugin-transform-es2015-modules-commonjs@6.26.2: + resolution: {integrity: sha512-CV9ROOHEdrjcwhIaJNBGMBCodN+1cfkwtM1SbUHmvyy35KGT7fohbpOxkE2uLz1o6odKK2Ck/tz47z+VqQfi9Q==} + + babel-plugin-transform-es2015-modules-systemjs@6.24.1: + resolution: {integrity: sha512-ONFIPsq8y4bls5PPsAWYXH/21Hqv64TBxdje0FvU3MhIV6QM2j5YS7KvAzg/nTIVLot2D2fmFQrFWCbgHlFEjg==} + + babel-plugin-transform-es2015-modules-umd@6.24.1: + resolution: {integrity: sha512-LpVbiT9CLsuAIp3IG0tfbVo81QIhn6pE8xBJ7XSeCtFlMltuar5VuBV6y6Q45tpui9QWcy5i0vLQfCfrnF7Kiw==} + + babel-plugin-transform-es2015-object-super@6.24.1: + resolution: {integrity: sha512-8G5hpZMecb53vpD3mjs64NhI1au24TAmokQ4B+TBFBjN9cVoGoOvotdrMMRmHvVZUEvqGUPWL514woru1ChZMA==} + + babel-plugin-transform-es2015-parameters@6.24.1: + resolution: {integrity: sha512-8HxlW+BB5HqniD+nLkQ4xSAVq3bR/pcYW9IigY+2y0dI+Y7INFeTbfAQr+63T3E4UDsZGjyb+l9txUnABWxlOQ==} + + babel-plugin-transform-es2015-shorthand-properties@6.24.1: + resolution: {integrity: sha512-mDdocSfUVm1/7Jw/FIRNw9vPrBQNePy6wZJlR8HAUBLybNp1w/6lr6zZ2pjMShee65t/ybR5pT8ulkLzD1xwiw==} + + babel-plugin-transform-es2015-spread@6.22.0: + resolution: {integrity: sha512-3Ghhi26r4l3d0Js933E5+IhHwk0A1yiutj9gwvzmFbVV0sPMYk2lekhOufHBswX7NCoSeF4Xrl3sCIuSIa+zOg==} + + babel-plugin-transform-es2015-sticky-regex@6.24.1: + resolution: {integrity: sha512-CYP359ADryTo3pCsH0oxRo/0yn6UsEZLqYohHmvLQdfS9xkf+MbCzE3/Kolw9OYIY4ZMilH25z/5CbQbwDD+lQ==} + + babel-plugin-transform-es2015-template-literals@6.22.0: + resolution: {integrity: sha512-x8b9W0ngnKzDMHimVtTfn5ryimars1ByTqsfBDwAqLibmuuQY6pgBQi5z1ErIsUOWBdw1bW9FSz5RZUojM4apg==} + + babel-plugin-transform-es2015-typeof-symbol@6.23.0: + resolution: {integrity: sha512-fz6J2Sf4gYN6gWgRZaoFXmq93X+Li/8vf+fb0sGDVtdeWvxC9y5/bTD7bvfWMEq6zetGEHpWjtzRGSugt5kNqw==} + + babel-plugin-transform-es2015-unicode-regex@6.24.1: + resolution: {integrity: sha512-v61Dbbihf5XxnYjtBN04B/JBvsScY37R1cZT5r9permN1cp+b70DY3Ib3fIkgn1DI9U3tGgBJZVD8p/mE/4JbQ==} + + babel-plugin-transform-exponentiation-operator@6.24.1: + resolution: {integrity: sha512-LzXDmbMkklvNhprr20//RStKVcT8Cu+SQtX18eMHLhjHf2yFzwtQ0S2f0jQ+89rokoNdmwoSqYzAhq86FxlLSQ==} + + babel-plugin-transform-regenerator@6.26.0: + resolution: {integrity: sha512-LS+dBkUGlNR15/5WHKe/8Neawx663qttS6AGqoOUhICc9d1KciBvtrQSuc0PI+CxQ2Q/S1aKuJ+u64GtLdcEZg==} + + babel-plugin-transform-strict-mode@6.24.1: + resolution: {integrity: sha512-j3KtSpjyLSJxNoCDrhwiJad8kw0gJ9REGj8/CqL0HeRyLnvUNYV9zcqluL6QJSXh3nfsLEmSLvwRfGzrgR96Pw==} + + babel-preset-current-node-syntax@1.1.0: + resolution: {integrity: sha512-ldYss8SbBlWva1bs28q78Ju5Zq1F+8BrqBZZ0VFhLBvhh6lCpC2o3gDJi/5DRLs9FgYZCnmPYIVFU4lRXCkyUw==} + peerDependencies: + '@babel/core': ^7.0.0 + + babel-preset-env@1.7.0: + resolution: {integrity: sha512-9OR2afuKDneX2/q2EurSftUYM0xGu4O2D9adAhVfADDhrYDaxXV0rBbevVYoY9n6nyX1PmQW/0jtpJvUNr9CHg==} + + babel-preset-fbjs@3.4.0: + resolution: {integrity: sha512-9ywCsCvo1ojrw0b+XYk7aFvTH6D9064t0RIL1rtMf3nsa02Xw41MS7sZw216Im35xj/UY0PDBQsa1brUDDF1Ow==} + peerDependencies: + '@babel/core': ^7.0.0 + + babel-preset-jest@29.6.3: + resolution: {integrity: sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + peerDependencies: + '@babel/core': ^7.0.0 + + babel-register@6.26.0: + resolution: {integrity: sha512-veliHlHX06wjaeY8xNITbveXSiI+ASFnOqvne/LaIJIqOWi2Ogmj91KOugEz/hoh/fwMhXNBJPCv8Xaz5CyM4A==} + + babel-runtime@6.26.0: + resolution: {integrity: sha512-ITKNuq2wKlW1fJg9sSW52eepoYgZBggvOAHC0u/CYu/qxQ9EVzThCgR69BnSXLHjy2f7SY5zaQ4yt7H9ZVxY2g==} + + babel-template@6.26.0: + resolution: {integrity: sha512-PCOcLFW7/eazGUKIoqH97sO9A2UYMahsn/yRQ7uOk37iutwjq7ODtcTNF+iFDSHNfkctqsLRjLP7URnOx0T1fg==} + + babel-traverse@6.26.0: + resolution: {integrity: sha512-iSxeXx7apsjCHe9c7n8VtRXGzI2Bk1rBSOJgCCjfyXb6v1aCqE1KSEpq/8SXuVN8Ka/Rh1WDTF0MDzkvTA4MIA==} + + babel-types@6.26.0: + resolution: {integrity: sha512-zhe3V/26rCWsEZK8kZN+HaQj5yQ1CilTObixFzKW1UWjqG7618Twz6YEsCnjfg5gBcJh02DrpCkS9h98ZqDY+g==} + + babelify@7.3.0: + resolution: {integrity: sha512-vID8Fz6pPN5pJMdlUnNFSfrlcx5MUule4k9aKs/zbZPyXxMTcRrB0M4Tarw22L8afr8eYSWxDPYCob3TdrqtlA==} + + babylon@6.18.0: + resolution: {integrity: sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==} + hasBin: true + + backoff@2.5.0: + resolution: {integrity: sha512-wC5ihrnUXmR2douXmXLCe5O3zg3GKIyvRi/hi58a/XyRxVI+3/yM0PYueQOZXPXQ9pxBislYkw+sF9b7C/RuMA==} + engines: {node: '>= 0.6'} + + balanced-match@1.0.2: + resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} + + base-64@0.1.0: + resolution: {integrity: sha512-Y5gU45svrR5tI2Vt/X9GPd3L0HNIKzGu202EjxrXMpuc2V2CiKgemAbUUsqYmZJvPtCXoUKjNZwBJzsNScUbXA==} + + base-x@3.0.11: + resolution: {integrity: sha512-xz7wQ8xDhdyP7tQxwdteLYeFfS68tSMNCZ/Y37WJ4bhGfKPpqEIlmIyueQHqOyoPhE6xNUqjzRr8ra0eF9VRvA==} + + base-x@4.0.1: + resolution: {integrity: sha512-uAZ8x6r6S3aUM9rbHGVOIsR15U/ZSc82b3ymnCPsT45Gk1DDvhDPdIgB5MrhirZWt+5K0EEPQH985kNqZgNPFw==} + + base64-js@1.5.1: + resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} + + base@0.11.2: + resolution: {integrity: sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==} + engines: {node: '>=0.10.0'} + + basic-auth@2.0.1: + resolution: {integrity: sha512-NF+epuEdnUYVlGuhaxbbq+dvJttwLnGY+YixlXlME5KpQ5W3CnXA5cVTneY3SPbPDRkcjMbifrwmFYcClgOZeg==} + engines: {node: '>= 0.8'} + + bcrypt-pbkdf@1.0.2: + resolution: {integrity: sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==} + + bech32@1.1.4: + resolution: {integrity: sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ==} + + better-path-resolve@1.0.0: + resolution: {integrity: sha512-pbnl5XzGBdrFU/wT4jqmJVPn2B6UHPBOhzMQkY/SPUPB6QtUXtmBHBIwCbXJol93mOpGMnQyP/+BB19q04xj7g==} + engines: {node: '>=4'} + + bigint-crypto-utils@3.3.0: + resolution: {integrity: sha512-jOTSb+drvEDxEq6OuUybOAv/xxoh3cuYRUIPyu8sSHQNKM303UQ2R1DAo45o1AkcIXw6fzbaFI1+xGGdaXs2lg==} + engines: {node: '>=14.0.0'} + + bignumber.js@9.1.2: + resolution: {integrity: sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug==} + + binary-extensions@1.13.1: + resolution: {integrity: sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==} + engines: {node: '>=0.10.0'} + + binary-extensions@2.3.0: + resolution: {integrity: sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==} + engines: {node: '>=8'} + + bindings@1.5.0: + resolution: {integrity: sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==} + + bintrees@1.0.2: + resolution: {integrity: sha512-VOMgTMwjAaUG580SXn3LacVgjurrbMme7ZZNYGSSV7mmtY6QQRh0Eg3pwIcntQ77DErK1L0NxkbetjcoXzVwKw==} + + bip39@2.5.0: + resolution: {integrity: sha512-xwIx/8JKoT2+IPJpFEfXoWdYwP7UVAoUxxLNfGCfVowaJE7yg1Y5B1BVPqlUNsBq5/nGwmFkwRJ8xDW4sX8OdA==} + + bl@4.1.0: + resolution: {integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==} + + blakejs@1.2.1: + resolution: {integrity: sha512-QXUSXI3QVc/gJME0dBpXrag1kbzOqCjCX8/b54ntNyW6sjtoqxqRk3LTmXzaJoh71zMsDCjM+47jS7XiwN/+fQ==} + + blob-to-it@0.0.2: + resolution: {integrity: sha512-3/NRr0mUWQTkS71MYEC1teLbT5BTs7RZ6VMPXDV6qApjw3B4TAZspQuvDkYfHuD/XzL5p/RO91x5XRPeJvcCqg==} + + bluebird@3.7.2: + resolution: {integrity: sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==} + + bn.js@4.11.6: + resolution: {integrity: sha512-XWwnNNFCuuSQ0m3r3C4LE3EiORltHd9M05pq6FOlVeiophzRbMo50Sbz1ehl8K3Z+jw9+vmgnXefY1hz8X+2wA==} + + bn.js@4.12.2: + resolution: {integrity: sha512-n4DSx829VRTRByMRGdjQ9iqsN0Bh4OolPsFnaZBLcbi8iXcB+kJ9s7EnRt4wILZNV3kPLHkRVfOc/HvhC3ovDw==} + + bn.js@5.2.2: + resolution: {integrity: sha512-v2YAxEmKaBLahNwE1mjp4WON6huMNeuDvagFZW+ASCuA/ku0bXR9hSMw0XpiqMoA3+rmnyck/tPRSFQkoC9Cuw==} + + body-parser@1.19.1: + resolution: {integrity: sha512-8ljfQi5eBk8EJfECMrgqNGWPEY5jWP+1IzkzkGdFFEwFQZZyaZ21UqdaHktgiMlH0xLHqIFtE/u2OYE5dOtViA==} + engines: {node: '>= 0.8'} + + body-parser@1.19.2: + resolution: {integrity: sha512-SAAwOxgoCKMGs9uUAUFHygfLAyaniaoun6I8mFY9pRAJL9+Kec34aU+oIjDhTycub1jozEfEwx1W1IuOYxVSFw==} + engines: {node: '>= 0.8'} + + body-parser@1.20.1: + resolution: {integrity: sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==} + engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16} + + body-parser@1.20.2: + resolution: {integrity: sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==} + engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16} + + body-parser@1.20.3: + resolution: {integrity: sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==} + engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16} + + borc@2.1.2: + resolution: {integrity: sha512-Sy9eoUi4OiKzq7VovMn246iTo17kzuyHJKomCfpWMlI6RpfN1gk95w7d7gH264nApVLg0HZfcpz62/g4VH1Y4w==} + engines: {node: '>=4'} + + boxen@5.1.2: + resolution: {integrity: sha512-9gYgQKXx+1nP8mP7CzFyaUARhg7D3n1dF/FnErWmu9l6JvGpNUN278h0aSb+QjoiKSWG+iZ3uHrcqk0qrY9RQQ==} + engines: {node: '>=10'} + + brace-expansion@1.1.11: + resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} + + brace-expansion@2.0.1: + resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==} + + braces@1.8.5: + resolution: {integrity: sha512-xU7bpz2ytJl1bH9cgIurjpg/n8Gohy9GTw81heDYLJQ4RU60dlyJsa+atVF2pI0yMMvKxI9HkKwjePCj5XI1hw==} + engines: {node: '>=0.10.0'} + + braces@2.3.2: + resolution: {integrity: sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==} + engines: {node: '>=0.10.0'} + + braces@3.0.3: + resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} + engines: {node: '>=8'} + + brorand@1.1.0: + resolution: {integrity: sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==} + + browser-level@1.0.1: + resolution: {integrity: sha512-XECYKJ+Dbzw0lbydyQuJzwNXtOpbMSq737qxJN11sIRTErOMShvDpbzTlgju7orJKvx4epULolZAuJGLzCmWRQ==} + + browser-readablestream-to-it@0.0.2: + resolution: {integrity: sha512-bbiTccngeAbPmpTUJcUyr6JhivADKV9xkNJVLdA91vjdzXyFBZ6fgrzElQsV3k1UNGQACRTl3p4y+cEGG9U48A==} + + browser-stdout@1.3.0: + resolution: {integrity: sha512-7Rfk377tpSM9TWBEeHs0FlDZGoAIei2V/4MdZJoFMBFAK6BqLpxAIUepGRHGdPFgGsLb02PXovC4qddyHvQqTg==} + + browser-stdout@1.3.1: + resolution: {integrity: sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==} + + browserify-aes@1.2.0: + resolution: {integrity: sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==} + + browserify-cipher@1.0.1: + resolution: {integrity: sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==} + + browserify-des@1.0.2: + resolution: {integrity: sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==} + + browserify-rsa@4.1.1: + resolution: {integrity: sha512-YBjSAiTqM04ZVei6sXighu679a3SqWORA3qZTEqZImnlkDIFtKc6pNutpjyZ8RJTjQtuYfeetkxM11GwoYXMIQ==} + engines: {node: '>= 0.10'} + + browserify-sign@4.2.3: + resolution: {integrity: sha512-JWCZW6SKhfhjJxO8Tyiiy+XYB7cqd2S5/+WeYHsKdNKFlCBhKbblba1A/HN/90YwtxKc8tCErjffZl++UNmGiw==} + engines: {node: '>= 0.12'} + + browserslist@3.2.8: + resolution: {integrity: sha512-WHVocJYavUwVgVViC0ORikPHQquXwVh939TaelZ4WDqpWgTX/FsGhl/+P4qBUAGcRvtOgDgC+xftNWWp2RUTAQ==} + hasBin: true + + browserslist@4.24.5: + resolution: {integrity: sha512-FDToo4Wo82hIdgc1CQ+NQD0hEhmpPjrZ3hiUgwgOG6IuTdlpr8jdjyG24P6cNP1yJpTLzS5OcGgSw0xmDU1/Tw==} + engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} + hasBin: true + + bs58@4.0.1: + resolution: {integrity: sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==} + + bs58@5.0.0: + resolution: {integrity: sha512-r+ihvQJvahgYT50JD05dyJNKlmmSlMoOGwn1lCcEzanPglg7TxYjioQUYehQ9mAR/+hOSd2jRc/Z2y5UxBymvQ==} + + bs58check@2.1.2: + resolution: {integrity: sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA==} + + bser@2.1.1: + resolution: {integrity: sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==} + + buffer-from@1.1.2: + resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} + + buffer-to-arraybuffer@0.0.5: + resolution: {integrity: sha512-3dthu5CYiVB1DEJp61FtApNnNndTckcqe4pFcLdvHtrpG+kcyekCJKg4MRiDcFW7A6AODnXB9U4dwQiCW5kzJQ==} + + buffer-writer@2.0.0: + resolution: {integrity: sha512-a7ZpuTZU1TRtnwyCNW3I5dc0wWNC3VR9S++Ewyk2HHZdrO3CQJqSpd+95Us590V6AL7JqUAH2IwZ/398PmNFgw==} + engines: {node: '>=4'} + + buffer-xor@1.0.3: + resolution: {integrity: sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ==} + + buffer-xor@2.0.2: + resolution: {integrity: sha512-eHslX0bin3GB+Lx2p7lEYRShRewuNZL3fUl4qlVJGGiwoPGftmt8JQgk2Y9Ji5/01TnVDo33E5b5O3vUB1HdqQ==} + + buffer@4.9.2: + resolution: {integrity: sha512-xq+q3SRMOxGivLhBNaUdC64hDTQwejJ+H0T/NB1XMtTVEwNTrfFF3gAxiyW0Bu/xWEGhjVKgUcMhCrUy2+uCWg==} + + buffer@5.7.1: + resolution: {integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==} + + buffer@6.0.3: + resolution: {integrity: sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==} + + bufferutil@4.0.9: + resolution: {integrity: sha512-WDtdLmJvAuNNPzByAYpRo2rF1Mmradw6gvWsQKf63476DDXmomT9zUiGypLcG4ibIM67vhAj8jJRdbmEws2Aqw==} + engines: {node: '>=6.14.2'} + + busboy@1.6.0: + resolution: {integrity: sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==} + engines: {node: '>=10.16.0'} + + bytes@3.1.1: + resolution: {integrity: sha512-dWe4nWO/ruEOY7HkUJ5gFt1DCFV9zPRoJr8pV0/ASQermOZjtq8jMjOprC0Kd10GLN+l7xaUPvxzJFWtxGu8Fg==} + engines: {node: '>= 0.8'} + + bytes@3.1.2: + resolution: {integrity: sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==} + engines: {node: '>= 0.8'} + + bytewise-core@1.2.3: + resolution: {integrity: sha512-nZD//kc78OOxeYtRlVk8/zXqTB4gf/nlguL1ggWA8FuchMyOxcyHR4QPQZMUmA7czC+YnaBrPUCubqAWe50DaA==} + + bytewise@1.1.0: + resolution: {integrity: sha512-rHuuseJ9iQ0na6UDhnrRVDh8YnWVlU6xM3VH6q/+yHDeUH2zIhUzP+2/h3LIrhLDBtTqzWpE3p3tP/boefskKQ==} + + cache-base@1.0.1: + resolution: {integrity: sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==} + engines: {node: '>=0.10.0'} + + cacheable-lookup@5.0.4: + resolution: {integrity: sha512-2/kNscPhpcxrOigMZzbiWF7dz8ilhb/nIHU3EyZiXWXpeq/au8qJ8VhdftMkty3n7Gj6HIGalQG8oiBNB3AJgA==} + engines: {node: '>=10.6.0'} + + cacheable-lookup@6.1.0: + resolution: {integrity: sha512-KJ/Dmo1lDDhmW2XDPMo+9oiy/CeqosPguPCrgcVzKyZrL6pM1gU2GmPY/xo6OQPTUaA/c0kwHuywB4E6nmT9ww==} + engines: {node: '>=10.6.0'} + + cacheable-lookup@7.0.0: + resolution: {integrity: sha512-+qJyx4xiKra8mZrcwhjMRMUhD5NR1R8esPkzIYxX96JiecFoxAXFuz/GpR3+ev4PE1WamHip78wV0vcmPQtp8w==} + engines: {node: '>=14.16'} + + cacheable-request@10.2.14: + resolution: {integrity: sha512-zkDT5WAF4hSSoUgyfg5tFIxz8XQK+25W/TLVojJTMKBaxevLBBtLxgqguAuVQB8PVW79FVjHcU+GJ9tVbDZ9mQ==} + engines: {node: '>=14.16'} + + cacheable-request@6.1.0: + resolution: {integrity: sha512-Oj3cAGPCqOZX7Rz64Uny2GYAZNliQSqfbePrgAQ1wKAihYmCUnraBtJtKcGR4xz7wF+LoJC+ssFZvv5BgF9Igg==} + engines: {node: '>=8'} + + cacheable-request@7.0.4: + resolution: {integrity: sha512-v+p6ongsrp0yTGbJXjgxPow2+DL93DASP4kXCDKb8/bwRtt9OEF3whggkkDkGNzgcWy2XaF4a8nZglC7uElscg==} + engines: {node: '>=8'} + + cachedown@1.0.0: + resolution: {integrity: sha512-t+yVk82vQWCJF3PsWHMld+jhhjkkWjcAzz8NbFx1iULOXWl8Tm/FdM4smZNVw3MRr0X+lVTx9PKzvEn4Ng19RQ==} + + call-bind-apply-helpers@1.0.2: + resolution: {integrity: sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==} + engines: {node: '>= 0.4'} + + call-bind@1.0.8: + resolution: {integrity: sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==} + engines: {node: '>= 0.4'} + + call-bound@1.0.4: + resolution: {integrity: sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==} + engines: {node: '>= 0.4'} + + caller-callsite@2.0.0: + resolution: {integrity: sha512-JuG3qI4QOftFsZyOn1qq87fq5grLIyk1JYd5lJmdA+fG7aQ9pA/i3JIJGcO3q0MrRcHlOt1U+ZeHW8Dq9axALQ==} + engines: {node: '>=4'} + + caller-path@2.0.0: + resolution: {integrity: sha512-MCL3sf6nCSXOwCTzvPKhN18TU7AHTvdtam8DAogxcrJ8Rjfbbg7Lgng64H9Iy+vUV6VGFClN/TyxBkAebLRR4A==} + engines: {node: '>=4'} + + callsites@2.0.0: + resolution: {integrity: sha512-ksWePWBloaWPxJYQ8TL0JHvtci6G5QTKwQ95RcWAa/lzoAKuAOflGdAK92hpHXjkwb8zLxoLNUoNYZgVsaJzvQ==} + engines: {node: '>=4'} + + callsites@3.1.0: + resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} + engines: {node: '>=6'} + + camel-case@4.1.2: + resolution: {integrity: sha512-gxGWBrTT1JuMx6R+o5PTXMmUnhnVzLQ9SNutD4YqKtI6ap897t3tKECYla6gCWEkplXnlNybEkZg9GEGxKFCgw==} + + camelcase-keys@6.2.2: + resolution: {integrity: sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==} + engines: {node: '>=8'} + + camelcase@3.0.0: + resolution: {integrity: sha512-4nhGqUkc4BqbBBB4Q6zLuD7lzzrHYrjKGeYaEji/3tFR5VdJu9v+LilhGIVe8wxEJPPOeWo7eg8dwY13TZ1BNg==} + engines: {node: '>=0.10.0'} + + camelcase@4.1.0: + resolution: {integrity: sha512-FxAv7HpHrXbh3aPo4o2qxHay2lkLY3x5Mw3KeE4KQE8ysVfziWeRZDwcjauvwBSGEC/nXUPzZy8zeh4HokqOnw==} + engines: {node: '>=4'} + + camelcase@5.3.1: + resolution: {integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==} + engines: {node: '>=6'} + + camelcase@6.3.0: + resolution: {integrity: sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==} + engines: {node: '>=10'} + + caniuse-lite@1.0.30001717: + resolution: {integrity: sha512-auPpttCq6BDEG8ZAuHJIplGw6GODhjw+/11e7IjpnYCxZcW/ONgPs0KVBJ0d1bY3e2+7PRe5RCLyP+PfwVgkYw==} + + capital-case@1.0.4: + resolution: {integrity: sha512-ds37W8CytHgwnhGGTi88pcPyR15qoNkOpYwmMMfnWqqWgESapLqvDx6huFjQ5vqWSn2Z06173XNA7LtMOeUh1A==} + + case@1.6.3: + resolution: {integrity: sha512-mzDSXIPaFwVDvZAHqZ9VlbyF4yyXRuX6IvB06WvPYkqJVO24kX1PPhv9bfpKNFZyxYFmmgo03HUiD8iklmJYRQ==} + engines: {node: '>= 0.8.0'} + + caseless@0.12.0: + resolution: {integrity: sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==} + + catering@2.1.1: + resolution: {integrity: sha512-K7Qy8O9p76sL3/3m7/zLKbRkyOlSZAgzEaLhyj2mXS8PsCud2Eo4hAb8aLtZqHh0QGqLcb9dlJSu6lHRVENm1w==} + engines: {node: '>=6'} + + cbor@10.0.3: + resolution: {integrity: sha512-72Jnj81xMsqepqdcSdf2+fflz/UDsThOHy5hj2MW5F5xzHL8Oa0KQ6I6V9CwVUPxg5pf+W9xp6W2KilaRXWWtw==} + engines: {node: '>=18'} + + cbor@8.1.0: + resolution: {integrity: sha512-DwGjNW9omn6EwP70aXsn7FQJx5kO12tX0bZkaTjzdVFM6/7nhA4t0EENocKGx6D2Bch9PE2KzCUf5SceBdeijg==} + engines: {node: '>=12.19'} + + cbor@9.0.2: + resolution: {integrity: sha512-JPypkxsB10s9QOWwa6zwPzqE1Md3vqpPc+cai4sAecuCsRyAtAl/pMyhPlMbT/xtPnm2dznJZYRLui57qiRhaQ==} + engines: {node: '>=16'} + + chai-as-promised@7.1.2: + resolution: {integrity: sha512-aBDHZxRzYnUYuIAIPBH2s511DjlKPzXNlXSGFC8CwmroWQLfrW0LtE1nK3MAwwNhJPa9raEjNCmRoFpG0Hurdw==} + peerDependencies: + chai: '>= 2.1.2 < 6' + + chai@4.3.4: + resolution: {integrity: sha512-yS5H68VYOCtN1cjfwumDSuzn/9c+yza4f3reKXlE5rUg7SFcCEy90gJvydNgOYtblyf4Zi6jIWRnXOgErta0KA==} + engines: {node: '>=4'} + + chai@4.5.0: + resolution: {integrity: sha512-RITGBfijLkBddZvnn8jdqoTypxvqbOLYQkGGxXzeFjVHvudaPw0HNFD9x928/eUwYWd2dPCugVqspGALTZZQKw==} + engines: {node: '>=4'} + + chalk@1.1.3: + resolution: {integrity: sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==} + engines: {node: '>=0.10.0'} + + chalk@2.4.2: + resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==} + engines: {node: '>=4'} + + chalk@4.1.2: + resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} + engines: {node: '>=10'} + + chalk@5.4.1: + resolution: {integrity: sha512-zgVZuo2WcZgfUEmsn6eO3kINexW8RAE4maiQ8QNs8CtpPCSyMiYsULR3HQYkm3w8FIA3SberyMJMSldGsW+U3w==} + engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} + + change-case-all@1.0.14: + resolution: {integrity: sha512-CWVm2uT7dmSHdO/z1CXT/n47mWonyypzBbuCy5tN7uMg22BsfkhwT6oHmFCAk+gL1LOOxhdbB9SZz3J1KTY3gA==} + + change-case-all@1.0.15: + resolution: {integrity: sha512-3+GIFhk3sNuvFAJKU46o26OdzudQlPNBCu1ZQi3cMeMHhty1bhDxu2WrEilVNYaGvqUtR1VSigFcJOiS13dRhQ==} + + change-case@4.1.2: + resolution: {integrity: sha512-bSxY2ws9OtviILG1EiY5K7NNxkqg/JnRnFxLtKQ96JaviiIxi7djMrSd0ECT9AC+lttClmYwKw53BWpOMblo7A==} + + chardet@0.7.0: + resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==} + + charenc@0.0.2: + resolution: {integrity: sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA==} + + check-error@1.0.3: + resolution: {integrity: sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==} + + checkpoint-store@1.1.0: + resolution: {integrity: sha512-J/NdY2WvIx654cc6LWSq/IYFFCUf75fFTgwzFnmbqyORH4MwgiQCgswLLKBGzmsyTI5V7i5bp/So6sMbDWhedg==} + + chokidar@1.7.0: + resolution: {integrity: sha512-mk8fAWcRUOxY7btlLtitj3A45jOwSAxH4tOFOoEGbVsl6cL6pPMWUy7dwZ/canfj3QEdP6FHSnf/l1c6/WkzVg==} + + chokidar@3.6.0: + resolution: {integrity: sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==} + engines: {node: '>= 8.10.0'} + + chokidar@4.0.3: + resolution: {integrity: sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==} + engines: {node: '>= 14.16.0'} + + chownr@1.1.4: + resolution: {integrity: sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==} + + chrome-launcher@0.15.2: + resolution: {integrity: sha512-zdLEwNo3aUVzIhKhTtXfxhdvZhUghrnmkvcAq2NoDd+LeOHKf03H5jwZ8T/STsAlzyALkBVK552iaG1fGf1xVQ==} + engines: {node: '>=12.13.0'} + hasBin: true + + chromium-edge-launcher@0.2.0: + resolution: {integrity: sha512-JfJjUnq25y9yg4FABRRVPmBGWPZZi+AQXT4mxupb67766/0UlhG8PAZCz6xzEMXTbW3CsSoE8PcCWA49n35mKg==} + + ci-info@2.0.0: + resolution: {integrity: sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==} + + ci-info@3.9.0: + resolution: {integrity: sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==} + engines: {node: '>=8'} + + cids@0.7.5: + resolution: {integrity: sha512-zT7mPeghoWAu+ppn8+BS1tQ5qGmbMfB4AregnQjA/qHY3GC1m1ptI9GkWNlgeu38r7CuRdXB47uY2XgAYt6QVA==} + engines: {node: '>=4.0.0', npm: '>=3.0.0'} + deprecated: This module has been superseded by the multiformats module + + cids@1.1.9: + resolution: {integrity: sha512-l11hWRfugIcbGuTZwAM5PwpjPPjyb6UZOGwlHSnOBV5o07XhQ4gNpBN67FbODvpjyHtd+0Xs6KNvUcGBiDRsdg==} + engines: {node: '>=4.0.0', npm: '>=3.0.0'} + deprecated: This module has been superseded by the multiformats module + + cipher-base@1.0.6: + resolution: {integrity: sha512-3Ek9H3X6pj5TgenXYtNWdaBon1tgYCaebd+XPg0keyjEbEfkD4KkmAxkQ/i1vYvxdcT5nscLBfq9VJRmCBcFSw==} + engines: {node: '>= 0.10'} + + class-is@1.1.0: + resolution: {integrity: sha512-rhjH9AG1fvabIDoGRVH587413LPjTZgmDF9fOFCbFJQV4yuocX1mHxxvXI4g3cGwbVY9wAYIoKlg1N79frJKQw==} + + class-utils@0.3.6: + resolution: {integrity: sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==} + engines: {node: '>=0.10.0'} + + classic-level@1.4.1: + resolution: {integrity: sha512-qGx/KJl3bvtOHrGau2WklEZuXhS3zme+jf+fsu6Ej7W7IP/C49v7KNlWIsT1jZu0YnfzSIYDGcEWpCa1wKGWXQ==} + engines: {node: '>=12'} + + clean-stack@2.2.0: + resolution: {integrity: sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==} + engines: {node: '>=6'} + + cli-boxes@2.2.1: + resolution: {integrity: sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw==} + engines: {node: '>=6'} + + cli-cursor@3.1.0: + resolution: {integrity: sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==} + engines: {node: '>=8'} + + cli-cursor@5.0.0: + resolution: {integrity: sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==} + engines: {node: '>=18'} + + cli-table3@0.5.1: + resolution: {integrity: sha512-7Qg2Jrep1S/+Q3EceiZtQcDPWxhAvBw+ERf1162v4sikJrvojMHFqXt8QIVha8UlH9rgU0BeWPytZ9/TzYqlUw==} + engines: {node: '>=6'} + + cli-table3@0.6.5: + resolution: {integrity: sha512-+W/5efTR7y5HRD7gACw9yQjqMVvEMLBHmboM/kPWam+H+Hmyrgjh6YncVKK122YZkXrLudzTuAukUw9FnMf7IQ==} + engines: {node: 10.* || >= 12.*} + + cli-table@0.3.11: + resolution: {integrity: sha512-IqLQi4lO0nIB4tcdTpN4LCB9FI3uqrJZK7RC515EnhZ6qBaglkIgICb1wjeAqpdoOabm1+SuQtkXIPdYC93jhQ==} + engines: {node: '>= 0.2.0'} + + cli-truncate@2.1.0: + resolution: {integrity: sha512-n8fOixwDD6b/ObinzTrp1ZKFzbgvKZvuz/TvejnLn1aQfC6r52XEx85FmuC+3HI+JM7coBRXUvNqEU2PHVrHpg==} + engines: {node: '>=8'} + + cli-truncate@3.1.0: + resolution: {integrity: sha512-wfOBkjXteqSnI59oPcJkcPl/ZmwvMMOj340qUIY1SKZCv0B9Cf4D4fAucRkIKQmsIuYK3x1rrgU7MeGRruiuiA==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + + cli-truncate@4.0.0: + resolution: {integrity: sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==} + engines: {node: '>=18'} + + cli-width@3.0.0: + resolution: {integrity: sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==} + engines: {node: '>= 10'} + + cliui@3.2.0: + resolution: {integrity: sha512-0yayqDxWQbqk3ojkYqUKqaAQ6AfNKeKWRNA8kR0WXzAsdHpP4BIaOmMAG87JGuO6qcobyW4GjxHd9PmhEd+T9w==} + + cliui@4.1.0: + resolution: {integrity: sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==} + + cliui@6.0.0: + resolution: {integrity: sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==} + + cliui@7.0.4: + resolution: {integrity: sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==} + + cliui@8.0.1: + resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} + engines: {node: '>=12'} + + clone-response@1.0.3: + resolution: {integrity: sha512-ROoL94jJH2dUVML2Y/5PEDNaSHgeOdSDicUyS7izcF63G6sTc/FTjLub4b8Il9S8S0beOfYt0TaA5qvFK+w0wA==} + + clone@2.1.2: + resolution: {integrity: sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w==} + engines: {node: '>=0.8'} + + co@4.6.0: + resolution: {integrity: sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==} + engines: {iojs: '>= 1.0.0', node: '>= 0.12.0'} + + code-point-at@1.1.0: + resolution: {integrity: sha512-RpAVKQA5T63xEj6/giIbUEtZwJ4UFIc3ZtvEkiaUERylqe8xb5IvqcgOurZLahv93CLKfxcw5YI+DZcUBRyLXA==} + engines: {node: '>=0.10.0'} + + coingecko-api@1.0.10: + resolution: {integrity: sha512-7YLLC85+daxAw5QlBWoHVBVpJRwoPr4HtwanCr8V/WRjoyHTa1Lb9DQAvv4MDJZHiz4no6HGnDQnddtjV35oRA==} + + collection-visit@1.0.0: + resolution: {integrity: sha512-lNkKvzEeMBBjUGHZ+q6z9pSJla0KWAQPvtzhEV9+iGyQYG+pBpl7xKDhxoNSOZH2hhv0v5k0y2yAM4o4SjoSkw==} + engines: {node: '>=0.10.0'} + + color-convert@1.9.3: + resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==} + + color-convert@2.0.1: + resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} + engines: {node: '>=7.0.0'} + + color-name@1.1.3: + resolution: {integrity: sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==} + + color-name@1.1.4: + resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} + + color-string@1.9.1: + resolution: {integrity: sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==} + + color@3.2.1: + resolution: {integrity: sha512-aBl7dZI9ENN6fUGC7mWpMTPNHmWUSNan9tuWN6ahh5ZLNk9baLJOnSMlrQkHcrfFgz2/RigjUVAjdx36VcemKA==} + + colorette@2.0.20: + resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} + + colors@1.0.3: + resolution: {integrity: sha512-pFGrxThWcWQ2MsAz6RtgeWe4NK2kUE1WfsrvvlctdII745EW9I0yflqhe7++M5LEc7bV2c/9/5zc8sFcpL0Drw==} + engines: {node: '>=0.1.90'} + + colors@1.4.0: + resolution: {integrity: sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==} + engines: {node: '>=0.1.90'} + + colorspace@1.1.4: + resolution: {integrity: sha512-BgvKJiuVu1igBUF2kEjRCZXol6wiiGbY5ipL/oVPwm0BL9sIpMIzM8IK7vwuxIIzOXMV3Ey5w+vxhm0rR/TN8w==} + + combined-stream@1.0.8: + resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} + engines: {node: '>= 0.8'} + + command-exists@1.2.9: + resolution: {integrity: sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w==} + + command-line-args@4.0.7: + resolution: {integrity: sha512-aUdPvQRAyBvQd2n7jXcsMDz68ckBJELXNzBybCHOibUWEg0mWTnaYCSRU8h9R+aNRSvDihJtssSRCiDRpLaezA==} + hasBin: true + + command-line-args@5.2.1: + resolution: {integrity: sha512-H4UfQhZyakIjC74I9d34fGYDwk3XpSr17QhEd0Q3I9Xq1CETHo4Hcuo87WyWHpAF1aSLjLRf5lD9ZGX2qStUvg==} + engines: {node: '>=4.0.0'} + + command-line-usage@6.1.3: + resolution: {integrity: sha512-sH5ZSPr+7UStsloltmDh7Ce5fb8XPlHyoPzTpyyMuYCtervL65+ubVZ6Q61cFtFl62UyJlc8/JwERRbAFPUqgw==} + engines: {node: '>=8.0.0'} + + commander@10.0.1: + resolution: {integrity: sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==} + engines: {node: '>=14'} + + commander@11.1.0: + resolution: {integrity: sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==} + engines: {node: '>=16'} + + commander@12.1.0: + resolution: {integrity: sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==} + engines: {node: '>=18'} + + commander@13.1.0: + resolution: {integrity: sha512-/rFeCpNJQbhSZjGVwO9RFV3xPqbnERS8MmIQzCtD/zl6gpJuV/bMLuN92oG3F7d8oDEHHRrujSXNUr8fpjntKw==} + engines: {node: '>=18'} + + commander@2.11.0: + resolution: {integrity: sha512-b0553uYA5YAEGgyYIGYROzKQ7X5RAqedkfjiZxwi0kL1g3bOaBNNZfYkzt/CL0umgD5wc9Jec2FbB98CjkMRvQ==} + + commander@2.20.3: + resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==} + + commander@3.0.2: + resolution: {integrity: sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow==} + + commander@6.2.1: + resolution: {integrity: sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==} + engines: {node: '>= 6'} + + commander@8.3.0: + resolution: {integrity: sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==} + engines: {node: '>= 12'} + + commander@9.5.0: + resolution: {integrity: sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==} + engines: {node: ^12.20.0 || >=14} + + common-tags@1.8.2: + resolution: {integrity: sha512-gk/Z852D2Wtb//0I+kRFNKKE9dIIVirjoqPoA1wJU+XePVXZfGeBpk45+A1rKO4Q43prqWBNY/MiIeRLbPWUaA==} + engines: {node: '>=4.0.0'} + + compare-func@2.0.0: + resolution: {integrity: sha512-zHig5N+tPWARooBnb0Zx1MFcdfpyJrfTJ3Y5L+IFvUm8rM74hHz66z0gw0x4tijh5CorKkKUCnW82R2vmpeCRA==} + + compare-versions@6.1.1: + resolution: {integrity: sha512-4hm4VPpIecmlg59CHXnRDnqGplJFrbLG4aFEl5vl6cK1u76ws3LLvX7ikFnTDl5vo39sjWD6AaDPYodJp/NNHg==} + + component-emitter@1.3.1: + resolution: {integrity: sha512-T0+barUSQRTUQASh8bx02dl+DhF54GtIDY13Y3m9oWTklKbb3Wv974meRpeZ3lp1JpLVECWWNHC4vaG2XHXouQ==} + + concat-map@0.0.1: + resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} + + concat-stream@1.6.2: + resolution: {integrity: sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==} + engines: {'0': node >= 0.8} + + config-chain@1.1.13: + resolution: {integrity: sha512-qj+f8APARXHrM0hraqXYb2/bOVSV4PvJQlNZ/DVj0QrmNM2q2euizkeuVckQ57J+W0mRH6Hvi+k50M4Jul2VRQ==} + + connect@3.7.0: + resolution: {integrity: sha512-ZqRXc+tZukToSNmh5C2iWMSoV3X1YUcPbqEM4DkEG5tNQXrQUZCNVGGv3IuicnkMtPfGf3Xtp8WCXs295iQ1pQ==} + engines: {node: '>= 0.10.0'} + + consola@2.15.3: + resolution: {integrity: sha512-9vAdYbHj6x2fLKC4+oPH0kFzY/orMZyG2Aj+kNylHxKGJ/Ed4dpNyAQYwJOdqO4zdM7XpVHmyejQDcQHrnuXbw==} + + console-control-strings@1.1.0: + resolution: {integrity: sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==} + + console-table-printer@2.12.1: + resolution: {integrity: sha512-wKGOQRRvdnd89pCeH96e2Fn4wkbenSP6LMHfjfyNLMbGuHEFbMqQNuxXqd0oXG9caIOQ1FTvc5Uijp9/4jujnQ==} + + constant-case@3.0.4: + resolution: {integrity: sha512-I2hSBi7Vvs7BEuJDr5dDHfzb/Ruj3FyvFyh7KLilAjNQw3Be+xgqUBA2W6scVEcL0hL1dwPRtIqEPVUCKkSsyQ==} + + content-disposition@0.5.4: + resolution: {integrity: sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==} + engines: {node: '>= 0.6'} + + content-hash@2.5.2: + resolution: {integrity: sha512-FvIQKy0S1JaWV10sMsA7TRx8bpU+pqPkhbsfvOJAdjRXvYxEckAwQWGwtRjiaJfh+E0DvcWUGqcdjwMGFjsSdw==} + + content-type@1.0.5: + resolution: {integrity: sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==} + engines: {node: '>= 0.6'} + + conventional-changelog-angular@5.0.13: + resolution: {integrity: sha512-i/gipMxs7s8L/QeuavPF2hLnJgH6pEZAttySB6aiQLWcX3puWDL3ACVmvBhJGxnAy52Qc15ua26BufY6KpmrVA==} + engines: {node: '>=10'} + + conventional-changelog-angular@7.0.0: + resolution: {integrity: sha512-ROjNchA9LgfNMTTFSIWPzebCwOGFdgkEq45EnvvrmSLvCtAw0HSmrCs7/ty+wAeYUZyNay0YMUNYFTRL72PkBQ==} + engines: {node: '>=16'} + + conventional-changelog-conventionalcommits@4.6.3: + resolution: {integrity: sha512-LTTQV4fwOM4oLPad317V/QNQ1FY4Hju5qeBIM1uTHbrnCE+Eg4CdRZ3gO2pUeR+tzWdp80M2j3qFFEDWVqOV4g==} + engines: {node: '>=10'} + + conventional-changelog-conventionalcommits@7.0.2: + resolution: {integrity: sha512-NKXYmMR/Hr1DevQegFB4MwfM5Vv0m4UIxKZTTYuD98lpTknaZlSRrDOG4X7wIXpGkfsYxZTghUN+Qq+T0YQI7w==} + engines: {node: '>=16'} + + conventional-commits-parser@3.2.4: + resolution: {integrity: sha512-nK7sAtfi+QXbxHCYfhpZsfRtaitZLIA6889kFIouLvz6repszQDgxBu7wf2WbU+Dco7sAnNCJYERCwt54WPC2Q==} + engines: {node: '>=10'} + hasBin: true + + conventional-commits-parser@5.0.0: + resolution: {integrity: sha512-ZPMl0ZJbw74iS9LuX9YIAiW8pfM5p3yh2o/NbXHbkFuZzY5jvdi5jFycEOkmBW5H5I7nA+D6f3UcsCLP2vvSEA==} + engines: {node: '>=16'} + hasBin: true + + convert-source-map@1.9.0: + resolution: {integrity: sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==} + + convert-source-map@2.0.0: + resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} + + cookie-signature@1.0.6: + resolution: {integrity: sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==} + + cookie@0.4.2: + resolution: {integrity: sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==} + engines: {node: '>= 0.6'} + + cookie@0.5.0: + resolution: {integrity: sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==} + engines: {node: '>= 0.6'} + + cookie@0.7.1: + resolution: {integrity: sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==} + engines: {node: '>= 0.6'} + + cookiejar@2.1.4: + resolution: {integrity: sha512-LDx6oHrK+PhzLKJU9j5S7/Y3jM/mUHvD/DeI1WQmJn652iPC5Y4TBzC9l+5OMOXlyTTA+SmVUPm0HQUwpD5Jqw==} + + copy-descriptor@0.1.1: + resolution: {integrity: sha512-XgZ0pFcakEUlbwQEVNg3+QAis1FyTL3Qel9FYy8pSkQqoG3PNoT0bOCQtOXcOkur21r2Eq2kI+IE+gsmAEVlYw==} + engines: {node: '>=0.10.0'} + + core-js-pure@3.42.0: + resolution: {integrity: sha512-007bM04u91fF4kMgwom2I5cQxAFIy8jVulgr9eozILl/SZE53QOqnW/+vviC+wQWLv+AunBG+8Q0TLoeSsSxRQ==} + + core-js@2.6.12: + resolution: {integrity: sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==} + deprecated: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js. + + core-util-is@1.0.2: + resolution: {integrity: sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==} + + core-util-is@1.0.3: + resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==} + + cors@2.8.5: + resolution: {integrity: sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==} + engines: {node: '>= 0.10'} + + cosmiconfig-typescript-loader@2.0.2: + resolution: {integrity: sha512-KmE+bMjWMXJbkWCeY4FJX/npHuZPNr9XF9q9CIQ/bpFwi1qHfCmSiKarrCcRa0LO4fWjk93pVoeRtJAkTGcYNw==} + engines: {node: '>=12', npm: '>=6'} + peerDependencies: + '@types/node': '*' + cosmiconfig: '>=7' + typescript: '>=3' + + cosmiconfig-typescript-loader@5.1.0: + resolution: {integrity: sha512-7PtBB+6FdsOvZyJtlF3hEPpACq7RQX6BVGsgC7/lfVXnKMvNCu/XY3ykreqG5w/rBNdu2z8LCIKoF3kpHHdHlA==} + engines: {node: '>=v16'} + peerDependencies: + '@types/node': '*' + cosmiconfig: '>=8.2' + typescript: '>=4' + + cosmiconfig@5.2.1: + resolution: {integrity: sha512-H65gsXo1SKjf8zmrJ67eJk8aIRKV5ff2D4uKZIBZShbhGSpEmsQOPW/SKMKYhSTrqR7ufy6RP69rPogdaPh/kA==} + engines: {node: '>=4'} + + cosmiconfig@7.1.0: + resolution: {integrity: sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA==} + engines: {node: '>=10'} + + cosmiconfig@8.3.6: + resolution: {integrity: sha512-kcZ6+W5QzcJ3P1Mt+83OUv/oHFqZHIx8DuxG6eZ5RGMERoLqp4BuGjhHLYGK+Kf5XVkQvqBSmAy/nGWN3qDgEA==} + engines: {node: '>=14'} + peerDependencies: + typescript: '>=4.9.5' + peerDependenciesMeta: + typescript: + optional: true + + crc-32@1.2.2: + resolution: {integrity: sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==} + engines: {node: '>=0.8'} + hasBin: true + + create-ecdh@4.0.4: + resolution: {integrity: sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A==} + + create-hash@1.2.0: + resolution: {integrity: sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==} + + create-hmac@1.1.7: + resolution: {integrity: sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==} + + create-require@1.1.1: + resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==} + + cross-fetch@2.2.6: + resolution: {integrity: sha512-9JZz+vXCmfKUZ68zAptS7k4Nu8e2qcibe7WVZYps7sAgk5R8GYTc+T1WR0v1rlP9HxgARmOX1UTIJZFytajpNA==} + + cross-fetch@3.1.5: + resolution: {integrity: sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw==} + + cross-fetch@3.2.0: + resolution: {integrity: sha512-Q+xVJLoGOeIMXZmbUK4HYk+69cQH6LudR0Vu/pRm2YlU/hDV9CiS0gKUMaWY5f2NeUH9C1nV3bsTlCo0FsTV1Q==} + + cross-fetch@4.0.0: + resolution: {integrity: sha512-e4a5N8lVvuLgAWgnCrLr2PP0YyDOTHa9H/Rj54dirp61qXnNq46m82bRhNqIA5VccJtWBvPTFRV3TtvHUKPB1g==} + + cross-spawn@5.1.0: + resolution: {integrity: sha512-pTgQJ5KC0d2hcY8eyL1IzlBPYjTkyH72XRZPnLyKus2mBfNjQs3klqbJU2VILqZryAZUt9JOb3h/mWMy23/f5A==} + + cross-spawn@6.0.6: + resolution: {integrity: sha512-VqCUuhcd1iB+dsv8gxPttb5iZh/D0iubSP21g36KXdEuf6I5JiioesUVjpCdHV9MZRUfVFlvwtIUyPfxo5trtw==} + engines: {node: '>=4.8'} + + cross-spawn@7.0.6: + resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==} + engines: {node: '>= 8'} + + crypt@0.0.2: + resolution: {integrity: sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow==} + + crypto-browserify@3.12.0: + resolution: {integrity: sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==} + + d@1.0.2: + resolution: {integrity: sha512-MOqHvMWF9/9MX6nza0KgvFH4HpMU0EF5uUDXqX/BtxtU8NfB0QzRtJ8Oe/6SuS4kbhyzVJwjd97EA4PKrzJ8bw==} + engines: {node: '>=0.12'} + + dargs@7.0.0: + resolution: {integrity: sha512-2iy1EkLdlBzQGvbweYRFxmFath8+K7+AKB0TlhHWkNuH+TmovaMH/Wp7V7R4u7f4SnX3OgLsU9t1NI9ioDnUpg==} + engines: {node: '>=8'} + + dashdash@1.14.1: + resolution: {integrity: sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g==} + engines: {node: '>=0.10'} + + data-view-buffer@1.0.2: + resolution: {integrity: sha512-EmKO5V3OLXh1rtK2wgXRansaK1/mtVdTUEiEI0W8RkvgT05kfxaH29PliLnpLP73yYO6142Q72QNa8Wx/A5CqQ==} + engines: {node: '>= 0.4'} + + data-view-byte-length@1.0.2: + resolution: {integrity: sha512-tuhGbE6CfTM9+5ANGf+oQb72Ky/0+s3xKUpHvShfiz2RxMFgFPjsXuRLBVMtvMs15awe45SRb83D6wH4ew6wlQ==} + engines: {node: '>= 0.4'} + + data-view-byte-offset@1.0.1: + resolution: {integrity: sha512-BS8PfmtDGnrgYdOonGZQdLZslWIeCGFP9tpan0hi1Co2Zr2NKADsvGYA8XxuG/4UWgJ6Cjtv+YJnB6MM69QGlQ==} + engines: {node: '>= 0.4'} + + dataloader@2.2.2: + resolution: {integrity: sha512-8YnDaaf7N3k/q5HnTJVuzSyLETjoZjVmHc4AeKAzOvKHEFQKcn64OKBfzHYtE9zGjctNM7V9I0MfnUVLpi7M5g==} + + dataloader@2.2.3: + resolution: {integrity: sha512-y2krtASINtPFS1rSDjacrFgn1dcUuoREVabwlOGOe4SdxenREqwjwjElAdwvbGM7kgZz9a3KVicWR7vcz8rnzA==} + + dayjs@1.11.7: + resolution: {integrity: sha512-+Yw9U6YO5TQohxLcIkrXBeY73WP3ejHWVvx8XCk3gxvQDCTEmS48ZrSZCKciI7Bhl/uCMyxYtE9UqRILmFphkQ==} + + death@1.1.0: + resolution: {integrity: sha512-vsV6S4KVHvTGxbEcij7hkWRv0It+sGGWVOM67dQde/o5Xjnr+KmLjxWJii2uEObIrt1CcM9w0Yaovx+iOlIL+w==} + + debug@2.6.9: + resolution: {integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + + debug@3.1.0: + resolution: {integrity: sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + + debug@3.2.6: + resolution: {integrity: sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==} + deprecated: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797) + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + + debug@3.2.7: + resolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + + debug@4.4.0: + resolution: {integrity: sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + + decamelize-keys@1.1.1: + resolution: {integrity: sha512-WiPxgEirIV0/eIOMcnFBA3/IJZAZqKnwAwWyvvdi4lsr1WCN22nhdf/3db3DoZcUjTV2SqfzIwNyp6y2xs3nmg==} + engines: {node: '>=0.10.0'} + + decamelize@1.2.0: + resolution: {integrity: sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==} + engines: {node: '>=0.10.0'} + + decamelize@4.0.0: + resolution: {integrity: sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==} + engines: {node: '>=10'} + + decimal.js@10.5.0: + resolution: {integrity: sha512-8vDa8Qxvr/+d94hSh5P3IJwI5t8/c0KsMp+g8bNw9cY2icONa5aPfvKeieW1WlG0WQYwwhJ7mjui2xtiePQSXw==} + + decode-uri-component@0.2.2: + resolution: {integrity: sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==} + engines: {node: '>=0.10'} + + decompress-response@3.3.0: + resolution: {integrity: sha512-BzRPQuY1ip+qDonAOz42gRm/pg9F768C+npV/4JOsxRC2sq+Rlk+Q4ZCAsOhnIaMrgarILY+RMUIvMmmX1qAEA==} + engines: {node: '>=4'} + + decompress-response@4.2.1: + resolution: {integrity: sha512-jOSne2qbyE+/r8G1VU+G/82LBs2Fs4LAsTiLSHOCOMZQl2OKZ6i8i4IyHemTe+/yIXOtTcRQMzPcgyhoFlqPkw==} + engines: {node: '>=8'} + + decompress-response@6.0.0: + resolution: {integrity: sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==} + engines: {node: '>=10'} + + dedent@0.7.0: + resolution: {integrity: sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA==} + + deep-eql@3.0.1: + resolution: {integrity: sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==} + engines: {node: '>=0.12'} + + deep-eql@4.1.4: + resolution: {integrity: sha512-SUwdGfqdKOwxCPeVYjwSyRpJ7Z+fhpwIAtmCUdZIWZ/YP5R9WAsyuSgpLVDi9bjWoN2LXHNss/dk3urXtdQxGg==} + engines: {node: '>=6'} + + deep-equal@1.1.2: + resolution: {integrity: sha512-5tdhKF6DbU7iIzrIOa1AOUt39ZRm13cmL1cGEh//aqR8x9+tNfbywRf0n5FD/18OKMdo7DNEtrX2t22ZAkI+eg==} + engines: {node: '>= 0.4'} + + deep-extend@0.6.0: + resolution: {integrity: sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==} + engines: {node: '>=4.0.0'} + + deep-is@0.1.4: + resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} + + defer-to-connect@1.1.3: + resolution: {integrity: sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ==} + + defer-to-connect@2.0.1: + resolution: {integrity: sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg==} + engines: {node: '>=10'} + + deferred-leveldown@1.2.2: + resolution: {integrity: sha512-uukrWD2bguRtXilKt6cAWKyoXrTSMo5m7crUdLfWQmu8kIm88w3QZoUL+6nhpfKVmhHANER6Re3sKoNoZ3IKMA==} + deprecated: Superseded by abstract-level (https://github.com/Level/community#faq) + + deferred-leveldown@4.0.2: + resolution: {integrity: sha512-5fMC8ek8alH16QiV0lTCis610D1Zt1+LA4MS4d63JgS32lrCjTFDUFz2ao09/j2I4Bqb5jL4FZYwu7Jz0XO1ww==} + engines: {node: '>=6'} + deprecated: Superseded by abstract-level (https://github.com/Level/community#faq) + + define-data-property@1.1.4: + resolution: {integrity: sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==} + engines: {node: '>= 0.4'} + + define-lazy-prop@2.0.0: + resolution: {integrity: sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==} + engines: {node: '>=8'} + + define-properties@1.2.1: + resolution: {integrity: sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==} + engines: {node: '>= 0.4'} + + define-property@0.2.5: + resolution: {integrity: sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==} + engines: {node: '>=0.10.0'} + + define-property@1.0.0: + resolution: {integrity: sha512-cZTYKFWspt9jZsMscWo8sc/5lbPC9Q0N5nBLgb+Yd915iL3udB1uFgS3B8YCx66UVHq018DAVFoee7x+gxggeA==} + engines: {node: '>=0.10.0'} + + define-property@2.0.2: + resolution: {integrity: sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==} + engines: {node: '>=0.10.0'} + + defined@1.0.1: + resolution: {integrity: sha512-hsBd2qSVCRE+5PmNdHt1uzyrFu5d3RwmFDKzyNZMFq/EwDNJF7Ee5+D5oEKF0hU6LhtoUF1macFvOe4AskQC1Q==} + + delayed-stream@1.0.0: + resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} + engines: {node: '>=0.4.0'} + + delegates@1.0.0: + resolution: {integrity: sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==} + + delete-empty@3.0.0: + resolution: {integrity: sha512-ZUyiwo76W+DYnKsL3Kim6M/UOavPdBJgDYWOmuQhYaZvJH0AXAHbUNyEDtRbBra8wqqr686+63/0azfEk1ebUQ==} + engines: {node: '>=10'} + hasBin: true + + delimit-stream@0.1.0: + resolution: {integrity: sha512-a02fiQ7poS5CnjiJBAsjGLPp5EwVoGHNeu9sziBd9huppRfsAFIpv5zNLv0V1gbop53ilngAf5Kf331AwcoRBQ==} + + depd@1.1.2: + resolution: {integrity: sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==} + engines: {node: '>= 0.6'} + + depd@2.0.0: + resolution: {integrity: sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==} + engines: {node: '>= 0.8'} + + dependency-graph@0.11.0: + resolution: {integrity: sha512-JeMq7fEshyepOWDfcfHK06N3MhyPhz++vtqWhMT5O9A3K42rdsEDpfdVqjaqaAhsw6a+ZqeDvQVtD0hFHQWrzg==} + engines: {node: '>= 0.6.0'} + + des.js@1.1.0: + resolution: {integrity: sha512-r17GxjhUCjSRy8aiJpr8/UadFIzMzJGexI3Nmz4ADi9LYSFx4gTBp80+NaX/YsXWWLhpZ7v/v/ubEc/bCNfKwg==} + + destroy@1.0.4: + resolution: {integrity: sha512-3NdhDuEXnfun/z7x9GOElY49LoqVHoGScmOKwmxhsS8N5Y+Z8KyPPDnaSzqWgYt/ji4mqwfTS34Htrk0zPIXVg==} + + destroy@1.2.0: + resolution: {integrity: sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==} + engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16} + + detect-file@1.0.0: + resolution: {integrity: sha512-DtCOLG98P007x7wiiOmfI0fi3eIKyWiLTGJ2MDnVi/E04lWGbf+JzrRHMm0rgIIZJGtHpKpbVgLWHrv8xXpc3Q==} + engines: {node: '>=0.10.0'} + + detect-indent@4.0.0: + resolution: {integrity: sha512-BDKtmHlOzwI7iRuEkhzsnPoi5ypEhWAJB5RvHWe1kMr06js3uK5B3734i3ui5Yd+wOJV1cpE4JnivPD283GU/A==} + engines: {node: '>=0.10.0'} + + detect-indent@6.1.0: + resolution: {integrity: sha512-reYkTUJAZb9gUuZ2RvVCNhVHdg62RHnJ7WJl8ftMi4diZ6NWlciOzQN88pUhSELEwflJht4oQDv0F0BMlwaYtA==} + engines: {node: '>=8'} + + detect-libc@1.0.3: + resolution: {integrity: sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg==} + engines: {node: '>=0.10'} + hasBin: true + + detect-port@1.6.1: + resolution: {integrity: sha512-CmnVc+Hek2egPx1PeTFVta2W78xy2K/9Rkf6cC4T59S50tVnzKj+tnx5mmx5lwvCkujZ4uRrpRSuV+IVs3f90Q==} + engines: {node: '>= 4.0.0'} + hasBin: true + + diff@3.3.1: + resolution: {integrity: sha512-MKPHZDMB0o6yHyDryUOScqZibp914ksXwAMYMTHj6KO8UeKsRYNJD3oNCKjTqZon+V488P7N/HzXF8t7ZR95ww==} + engines: {node: '>=0.3.1'} + + diff@3.5.0: + resolution: {integrity: sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==} + engines: {node: '>=0.3.1'} + + diff@4.0.2: + resolution: {integrity: sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==} + engines: {node: '>=0.3.1'} + + diff@5.2.0: + resolution: {integrity: sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==} + engines: {node: '>=0.3.1'} + + diffie-hellman@5.0.3: + resolution: {integrity: sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==} + + difflib@0.2.4: + resolution: {integrity: sha512-9YVwmMb0wQHQNr5J9m6BSj6fk4pfGITGQOOs+D9Fl+INODWFOfvhIU1hNv6GgR1RBoC/9NJcwu77zShxV0kT7w==} + + dir-glob@3.0.1: + resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} + engines: {node: '>=8'} + + dns-over-http-resolver@1.2.3: + resolution: {integrity: sha512-miDiVSI6KSNbi4SVifzO/reD8rMnxgrlnkrlkugOLQpWQTe2qMdHsZp5DmfKjxNE+/T3VAAYLQUZMv9SMr6+AA==} + + dnscache@1.0.2: + resolution: {integrity: sha512-2FFKzmLGOnD+Y378bRKH+gTjRMuSpH7OKgPy31KjjfCoKZx7tU8Dmqfd/3fhG2d/4bppuN8/KtWMUZBAcUCRnQ==} + + doctrine@3.0.0: + resolution: {integrity: sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==} + engines: {node: '>=6.0.0'} + + dom-walk@0.1.2: + resolution: {integrity: sha512-6QvTW9mrGeIegrFXdtQi9pk7O/nSK6lSdXW2eqUspN5LWD7UTji2Fqw5V2YLjBpHEoU9Xl/eUWNpDeZvoyOv2w==} + + dot-case@3.0.4: + resolution: {integrity: sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w==} + + dot-prop@5.3.0: + resolution: {integrity: sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==} + engines: {node: '>=8'} + + dotenv@16.5.0: + resolution: {integrity: sha512-m/C+AwOAr9/W1UOIZUo232ejMNnJAJtYQjUbHoNTBNTJSvqzzDh7vnrei3o3r3m9blf6ZoDkvcw0VmozNRFJxg==} + engines: {node: '>=12'} + + dotenv@9.0.2: + resolution: {integrity: sha512-I9OvvrHp4pIARv4+x9iuewrWycX6CcZtoAu1XrzPxc5UygMJXJZYmBsynku8IkrJwgypE5DGNjDPmPRhDCptUg==} + engines: {node: '>=10'} + + dotignore@0.1.2: + resolution: {integrity: sha512-UGGGWfSauusaVJC+8fgV+NVvBXkCTmVv7sk6nojDZZvuOUNGUy0Zk4UpHQD6EDjS0jpBwcACvH4eofvyzBcRDw==} + hasBin: true + + dottie@2.0.6: + resolution: {integrity: sha512-iGCHkfUc5kFekGiqhe8B/mdaurD+lakO9txNnTvKtA6PISrw86LgqHvRzWYPyoE2Ph5aMIrCw9/uko6XHTKCwA==} + + dset@3.1.4: + resolution: {integrity: sha512-2QF/g9/zTaPDc3BjNcVTGoBbXBgYfMTTceLaYcFJ/W9kggFUkhxD/hMEeuLKbugyef9SqAx8cpgwlIP/jinUTA==} + engines: {node: '>=4'} + + dunder-proto@1.0.1: + resolution: {integrity: sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==} + engines: {node: '>= 0.4'} + + duplexer3@0.1.5: + resolution: {integrity: sha512-1A8za6ws41LQgv9HrE/66jyC5yuSjQ3L/KOpFtoBilsAK2iA2wuS5rTt1OCzIvtS2V7nVmedsUU+DGRcjBmOYA==} + + duplexify@4.1.3: + resolution: {integrity: sha512-M3BmBhwJRZsSx38lZyhE53Csddgzl5R7xGJNk7CVddZD6CcmwMCH8J+7AprIrQKH7TonKxaCjcv27Qmf+sQ+oA==} + + eastasianwidth@0.2.0: + resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} + + ecc-jsbn@0.1.2: + resolution: {integrity: sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw==} + + ee-first@1.1.1: + resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} + + electron-to-chromium@1.5.150: + resolution: {integrity: sha512-rOOkP2ZUMx1yL4fCxXQKDHQ8ZXwisb2OycOQVKHgvB3ZI4CvehOd4y2tfnnLDieJ3Zs1RL1Dlp3cMkyIn7nnXA==} + + elliptic@6.5.4: + resolution: {integrity: sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==} + + elliptic@6.6.1: + resolution: {integrity: sha512-RaddvvMatK2LJHqFJ+YA4WysVN5Ita9E35botqIYspQ4TkRAlCicdzKOjlyv/1Za5RyTNn7di//eEV0uTAfe3g==} + + emoji-regex@10.4.0: + resolution: {integrity: sha512-EC+0oUMY1Rqm4O6LLrgjtYDvcVYTy7chDnM4Q7030tP4Kwj3u/pR6gP9ygnp2CJMK5Gq+9Q2oqmrFJAz01DXjw==} + + emoji-regex@8.0.0: + resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} + + emoji-regex@9.2.2: + resolution: {integrity: sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==} + + enabled@2.0.0: + resolution: {integrity: sha512-AKrN98kuwOzMIdAizXGI86UFBoo26CL21UM763y1h/GMSJ4/OHU9k2YlsmBpyScFo/wbLzWQJBMCW4+IO3/+OQ==} + + encode-utf8@1.0.3: + resolution: {integrity: sha512-ucAnuBEhUK4boH2HjVYG5Q2mQyPorvv0u/ocS+zhdw0S8AlHYY+GOFhP1Gio5z4icpP2ivFSvhtFjQi8+T9ppw==} + + encodeurl@1.0.2: + resolution: {integrity: sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==} + engines: {node: '>= 0.8'} + + encodeurl@2.0.0: + resolution: {integrity: sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==} + engines: {node: '>= 0.8'} + + encoding-down@5.0.4: + resolution: {integrity: sha512-8CIZLDcSKxgzT+zX8ZVfgNbu8Md2wq/iqa1Y7zyVR18QBEAc0Nmzuvj/N5ykSKpfGzjM8qxbaFntLPwnVoUhZw==} + engines: {node: '>=6'} + deprecated: Superseded by abstract-level (https://github.com/Level/community#faq) + + encoding@0.1.13: + resolution: {integrity: sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==} + + end-of-stream@1.4.4: + resolution: {integrity: sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==} + + enquirer@2.4.1: + resolution: {integrity: sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ==} + engines: {node: '>=8.6'} + + env-paths@2.2.1: + resolution: {integrity: sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==} + engines: {node: '>=6'} + + environment@1.1.0: + resolution: {integrity: sha512-xUtoPkMggbz0MPyPiIWr1Kp4aeWJjDZ6SMvURhimjdZgsRuDplF5/s9hcgGhyXMhs+6vpnuoiZ2kFiu3FMnS8Q==} + engines: {node: '>=18'} + + eol@0.9.1: + resolution: {integrity: sha512-Ds/TEoZjwggRoz/Q2O7SE3i4Jm66mqTDfmdHdq/7DKVk3bro9Q8h6WdXKdPqFLMoqxrDK5SVRzHVPOS6uuGtrg==} + + err-code@2.0.3: + resolution: {integrity: sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==} + + err-code@3.0.1: + resolution: {integrity: sha512-GiaH0KJUewYok+eeY05IIgjtAe4Yltygk9Wqp1V5yVWLdhf0hYZchRjNIT9bb0mSwRcIusT3cx7PJUf3zEIfUA==} + + errno@0.1.8: + resolution: {integrity: sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A==} + hasBin: true + + error-ex@1.3.2: + resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==} + + error-stack-parser@2.1.4: + resolution: {integrity: sha512-Sk5V6wVazPhq5MhpO+AUxJn5x7XSXGl1R93Vn7i+zS15KDVxQijejNCrz8340/2bgLBjR9GtEG8ZVKONDjcqGQ==} + + es-abstract@1.23.9: + resolution: {integrity: sha512-py07lI0wjxAC/DcfK1S6G7iANonniZwTISvdPzk9hzeH0IZIshbuuFxLIU96OyF89Yb9hiqWn8M/bY83KY5vzA==} + engines: {node: '>= 0.4'} + + es-array-method-boxes-properly@1.0.0: + resolution: {integrity: sha512-wd6JXUmyHmt8T5a2xreUwKcGPq6f1f+WwIJkijUqiGcJz1qqnZgP6XIK+QyIWU5lT7imeNxUll48bziG+TSYcA==} + + es-define-property@1.0.1: + resolution: {integrity: sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==} + engines: {node: '>= 0.4'} + + es-errors@1.3.0: + resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} + engines: {node: '>= 0.4'} + + es-object-atoms@1.1.1: + resolution: {integrity: sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==} + engines: {node: '>= 0.4'} + + es-set-tostringtag@2.1.0: + resolution: {integrity: sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==} + engines: {node: '>= 0.4'} + + es-to-primitive@1.3.0: + resolution: {integrity: sha512-w+5mJ3GuFL+NjVtJlvydShqE1eN3h3PbI7/5LAsYJP/2qtuMXjfL2LpHSRqo4b4eSF5K/DH1JXKUAHSB2UW50g==} + engines: {node: '>= 0.4'} + + es5-ext@0.10.64: + resolution: {integrity: sha512-p2snDhiLaXe6dahss1LddxqEm+SkuDvV8dnIQG0MWjyHpcMNfXKPE+/Cc0y+PhxJX3A4xGNeFCj5oc0BUh6deg==} + engines: {node: '>=0.10'} + + es6-iterator@2.0.3: + resolution: {integrity: sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g==} + + es6-promise@4.2.8: + resolution: {integrity: sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==} + + es6-symbol@3.1.4: + resolution: {integrity: sha512-U9bFFjX8tFiATgtkJ1zg25+KviIXpgRvRHS8sau3GfhVzThRQrOeksPeT0BWW2MNZs1OEWJ1DPXOQMn0KKRkvg==} + engines: {node: '>=0.12'} + + escalade@3.2.0: + resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==} + engines: {node: '>=6'} + + escape-html@1.0.3: + resolution: {integrity: sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==} + + escape-string-regexp@1.0.5: + resolution: {integrity: sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==} + engines: {node: '>=0.8.0'} + + escape-string-regexp@2.0.0: + resolution: {integrity: sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==} + engines: {node: '>=8'} + + escape-string-regexp@4.0.0: + resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} + engines: {node: '>=10'} + + escodegen@1.8.1: + resolution: {integrity: sha512-yhi5S+mNTOuRvyW4gWlg5W1byMaQGWWSYHXsuFZ7GBo7tpyOwi2EdzMP/QWxh9hwkD2m+wDVHJsxhRIj+v/b/A==} + engines: {node: '>=0.12.0'} + hasBin: true + + eslint-plugin-no-only-tests@3.3.0: + resolution: {integrity: sha512-brcKcxGnISN2CcVhXJ/kEQlNa0MEfGRtwKtWA16SkqXHKitaKIMrfemJKLKX1YqDU5C/5JY3PvZXd5jEW04e0Q==} + engines: {node: '>=5.0.0'} + + eslint-plugin-no-secrets@0.8.9: + resolution: {integrity: sha512-CqaBxXrImABCtxMWspAnm8d5UKkpNylC7zqVveb+fJHEvsSiNGJlSWzdSIvBUnW1XhJXkzifNIZQC08rEII5Ng==} + engines: {node: '>=10.0.0', npm: '>=6.9.0'} + peerDependencies: + eslint: '>=3.0.0' + + eslint-scope@7.2.2: + resolution: {integrity: sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + + eslint-visitor-keys@3.4.3: + resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + + eslint@8.57.1: + resolution: {integrity: sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + deprecated: This version is no longer supported. Please see https://eslint.org/version-support for other options. + hasBin: true + + esniff@2.0.1: + resolution: {integrity: sha512-kTUIGKQ/mDPFoJ0oVfcmyJn4iBDRptjNVIzwIFR7tqWXdVI9xfA2RMwY/gbSpJG3lkdWNEjLap/NqVHZiJsdfg==} + engines: {node: '>=0.10'} + + espree@9.6.1: + resolution: {integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + + esprima@2.7.3: + resolution: {integrity: sha512-OarPfz0lFCiW4/AV2Oy1Rp9qu0iusTKqykwTspGCZtPxmF81JR4MmIebvF1F9+UOKth2ZubLQ4XGGaU+hSn99A==} + engines: {node: '>=0.10.0'} + hasBin: true + + esprima@4.0.1: + resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} + engines: {node: '>=4'} + hasBin: true + + esquery@1.6.0: + resolution: {integrity: sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==} + engines: {node: '>=0.10'} + + esrecurse@4.3.0: + resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==} + engines: {node: '>=4.0'} + + estraverse@1.9.3: + resolution: {integrity: sha512-25w1fMXQrGdoquWnScXZGckOv+Wes+JDnuN/+7ex3SauFRS72r2lFDec0EKPt2YD1wUJ/IrfEex+9yp4hfSOJA==} + engines: {node: '>=0.10.0'} + + estraverse@5.3.0: + resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} + engines: {node: '>=4.0'} + + esutils@2.0.3: + resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} + engines: {node: '>=0.10.0'} + + etag@1.8.1: + resolution: {integrity: sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==} + engines: {node: '>= 0.6'} + + eth-block-tracker@3.0.1: + resolution: {integrity: sha512-WUVxWLuhMmsfenfZvFO5sbl1qFY2IqUlw/FPVmjjdElpqLsZtSG+wPe9Dz7W/sB6e80HgFKknOmKk2eNlznHug==} + + eth-ens-namehash@2.0.8: + resolution: {integrity: sha512-VWEI1+KJfz4Km//dadyvBBoBeSQ0MHTXPvr8UIXiLW6IanxvAV+DmlZAijZwAyggqGUfwQBeHf7tc9wzc1piSw==} + + eth-gas-reporter@0.2.27: + resolution: {integrity: sha512-femhvoAM7wL0GcI8ozTdxfuBtBFJ9qsyIAsmKVjlWAHUbdnnXHt+lKzz/kmldM5lA9jLuNHGwuIxorNpLbR1Zw==} + peerDependencies: + '@codechecks/client': ^0.1.0 + peerDependenciesMeta: + '@codechecks/client': + optional: true + + eth-json-rpc-infura@3.2.1: + resolution: {integrity: sha512-W7zR4DZvyTn23Bxc0EWsq4XGDdD63+XPUCEhV2zQvQGavDVC4ZpFDK4k99qN7bd7/fjj37+rxmuBOBeIqCA5Mw==} + deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. + + eth-json-rpc-middleware@1.6.0: + resolution: {integrity: sha512-tDVCTlrUvdqHKqivYMjtFZsdD7TtpNLBCfKAcOpaVs7orBMS/A8HWro6dIzNtTZIR05FAbJ3bioFOnZpuCew9Q==} + + eth-lib@0.1.29: + resolution: {integrity: sha512-bfttrr3/7gG4E02HoWTDUcDDslN003OlOoBxk9virpAZQ1ja/jDgwkWB8QfJF7ojuEowrqy+lzp9VcJG7/k5bQ==} + + eth-lib@0.2.8: + resolution: {integrity: sha512-ArJ7x1WcWOlSpzdoTBX8vkwlkSQ85CjjifSZtV4co64vWxSV8geWfPI9x4SVYu3DSxnX4yWFVTtGL+j9DUFLNw==} + + eth-query@2.1.2: + resolution: {integrity: sha512-srES0ZcvwkR/wd5OQBRA1bIJMww1skfGS0s8wlwK3/oNP4+wnds60krvu5R1QbpRQjMmpG5OMIWro5s7gvDPsA==} + + eth-sig-util@1.4.2: + resolution: {integrity: sha512-iNZ576iTOGcfllftB73cPB5AN+XUQAT/T8xzsILsghXC1o8gJUqe3RHlcDqagu+biFpYQ61KQrZZJza8eRSYqw==} + deprecated: Deprecated in favor of '@metamask/eth-sig-util' + + eth-sig-util@3.0.0: + resolution: {integrity: sha512-4eFkMOhpGbTxBQ3AMzVf0haUX2uTur7DpWiHzWyTURa28BVJJtOkcb9Ok5TV0YvEPG61DODPW7ZUATbJTslioQ==} + deprecated: Deprecated in favor of '@metamask/eth-sig-util' + + eth-tx-summary@3.2.4: + resolution: {integrity: sha512-NtlDnaVZah146Rm8HMRUNMgIwG/ED4jiqk0TME9zFheMl1jOp6jL1m0NKGjJwehXQ6ZKCPr16MTr+qspKpEXNg==} + + ethashjs@0.0.8: + resolution: {integrity: sha512-/MSbf/r2/Ld8o0l15AymjOTlPqpN8Cr4ByUEA9GtR4x0yAh3TdtDzEg29zMjXCNPI7u6E5fOQdj/Cf9Tc7oVNw==} + deprecated: 'New package name format for new versions: @ethereumjs/ethash. Please update.' + + ethereum-bloom-filters@1.2.0: + resolution: {integrity: sha512-28hyiE7HVsWubqhpVLVmZXFd4ITeHi+BUu05o9isf0GUpMtzBUi+8/gFrGaGYzvGAJQmJ3JKj77Mk9G98T84rA==} + + ethereum-common@0.0.18: + resolution: {integrity: sha512-EoltVQTRNg2Uy4o84qpa2aXymXDJhxm7eos/ACOg0DG4baAbMjhbdAEsx9GeE8sC3XCxnYvrrzZDH8D8MtA2iQ==} + + ethereum-common@0.2.0: + resolution: {integrity: sha512-XOnAR/3rntJgbCdGhqdaLIxDLWKLmsZOGhHdBKadEr6gEnJLH52k93Ou+TUdFaPN3hJc3isBZBal3U/XZ15abA==} + + ethereum-cryptography@0.1.3: + resolution: {integrity: sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==} + + ethereum-cryptography@1.2.0: + resolution: {integrity: sha512-6yFQC9b5ug6/17CQpCyE3k9eKBMdhyVjzUy1WkiuY/E4vj/SXDBbCw8QEIaXqf0Mf2SnY6RmpDcwlUmBSS0EJw==} + + ethereum-cryptography@2.2.1: + resolution: {integrity: sha512-r/W8lkHSiTLxUxW8Rf3u4HGB0xQweG2RyETjywylKZSzLWoWAijRz8WCuOtJ6wah+avllXBqZuk29HCCvhEIRg==} + + ethereum-waffle@3.4.4: + resolution: {integrity: sha512-PA9+jCjw4WC3Oc5ocSMBj5sXvueWQeAbvCA+hUlb6oFgwwKyq5ka3bWQ7QZcjzIX+TdFkxP4IbFmoY2D8Dkj9Q==} + engines: {node: '>=10.0'} + hasBin: true + + ethereumjs-abi@0.6.5: + resolution: {integrity: sha512-rCjJZ/AE96c/AAZc6O3kaog4FhOsAViaysBxqJNy2+LHP0ttH0zkZ7nXdVHOAyt6lFwLO0nlCwWszysG/ao1+g==} + deprecated: This library has been deprecated and usage is discouraged. + + ethereumjs-abi@0.6.8: + resolution: {integrity: sha512-Tx0r/iXI6r+lRsdvkFDlut0N08jWMnKRZ6Gkq+Nmw75lZe4e6o3EkSnkaBP5NF6+m5PTGAr9JP43N3LyeoglsA==} + deprecated: This library has been deprecated and usage is discouraged. + + ethereumjs-abi@https://codeload.github.com/ethereumjs/ethereumjs-abi/tar.gz/ee3994657fa7a427238e6ba92a84d0b529bbcde0: + resolution: {tarball: https://codeload.github.com/ethereumjs/ethereumjs-abi/tar.gz/ee3994657fa7a427238e6ba92a84d0b529bbcde0} + version: 0.6.8 + + ethereumjs-account@2.0.5: + resolution: {integrity: sha512-bgDojnXGjhMwo6eXQC0bY6UK2liSFUSMwwylOmQvZbSl/D7NXQ3+vrGO46ZeOgjGfxXmgIeVNDIiHw7fNZM4VA==} + + ethereumjs-account@3.0.0: + resolution: {integrity: sha512-WP6BdscjiiPkQfF9PVfMcwx/rDvfZTjFKY0Uwc09zSQr9JfIVH87dYIJu0gNhBhpmovV4yq295fdllS925fnBA==} + deprecated: Please use Util.Account class found on package ethereumjs-util@^7.0.6 https://github.com/ethereumjs/ethereumjs-util/releases/tag/v7.0.6 + + ethereumjs-block@1.7.1: + resolution: {integrity: sha512-B+sSdtqm78fmKkBq78/QLKJbu/4Ts4P2KFISdgcuZUPDm9x+N7qgBPIIFUGbaakQh8bzuquiRVbdmvPKqbILRg==} + deprecated: 'New package name format for new versions: @ethereumjs/block. Please update.' + + ethereumjs-block@2.2.2: + resolution: {integrity: sha512-2p49ifhek3h2zeg/+da6XpdFR3GlqY3BIEiqxGF8j9aSRIgkb7M1Ky+yULBKJOu8PAZxfhsYA+HxUk2aCQp3vg==} + deprecated: 'New package name format for new versions: @ethereumjs/block. Please update.' + + ethereumjs-blockchain@4.0.4: + resolution: {integrity: sha512-zCxaRMUOzzjvX78DTGiKjA+4h2/sF0OYL1QuPux0DHpyq8XiNoF5GYHtb++GUxVlMsMfZV7AVyzbtgcRdIcEPQ==} + deprecated: 'New package name format for new versions: @ethereumjs/blockchain. Please update.' + + ethereumjs-common@1.5.0: + resolution: {integrity: sha512-SZOjgK1356hIY7MRj3/ma5qtfr/4B5BL+G4rP/XSMYr2z1H5el4RX5GReYCKmQmYI/nSBmRnwrZ17IfHuG0viQ==} + deprecated: 'New package name format for new versions: @ethereumjs/common. Please update.' + + ethereumjs-tx@1.3.7: + resolution: {integrity: sha512-wvLMxzt1RPhAQ9Yi3/HKZTn0FZYpnsmQdbKYfUUpi4j1SEIcbkd9tndVjcPrufY3V7j2IebOpC00Zp2P/Ay2kA==} + deprecated: 'New package name format for new versions: @ethereumjs/tx. Please update.' + + ethereumjs-tx@2.1.2: + resolution: {integrity: sha512-zZEK1onCeiORb0wyCXUvg94Ve5It/K6GD1K+26KfFKodiBiS6d9lfCXlUKGBBdQ+bv7Day+JK0tj1K+BeNFRAw==} + deprecated: 'New package name format for new versions: @ethereumjs/tx. Please update.' + + ethereumjs-util@4.5.1: + resolution: {integrity: sha512-WrckOZ7uBnei4+AKimpuF1B3Fv25OmoRgmYCpGsP7u8PFxXAmAgiJSYT2kRWnt6fVIlKaQlZvuwXp7PIrmn3/w==} + + ethereumjs-util@5.2.1: + resolution: {integrity: sha512-v3kT+7zdyCm1HIqWlLNrHGqHGLpGYIhjeHxQjnDXjLT2FyGJDsd3LWMYUo7pAFRrk86CR3nUJfhC81CCoJNNGQ==} + + ethereumjs-util@6.2.1: + resolution: {integrity: sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==} + + ethereumjs-util@7.1.5: + resolution: {integrity: sha512-SDl5kKrQAudFBUe5OJM9Ac6WmMyYmXX/6sTmLZ3ffG2eY6ZIGBes3pEDxNN6V72WyOw4CPD5RomKdsa8DAAwLg==} + engines: {node: '>=10.0.0'} + + ethereumjs-vm@2.6.0: + resolution: {integrity: sha512-r/XIUik/ynGbxS3y+mvGnbOKnuLo40V5Mj1J25+HEO63aWYREIqvWeRO/hnROlMBE5WoniQmPmhiaN0ctiHaXw==} + deprecated: 'New package name format for new versions: @ethereumjs/vm. Please update.' + + ethereumjs-vm@4.2.0: + resolution: {integrity: sha512-X6qqZbsY33p5FTuZqCnQ4+lo957iUJMM6Mpa6bL4UW0dxM6WmDSHuI4j/zOp1E2TDKImBGCJA9QPfc08PaNubA==} + deprecated: 'New package name format for new versions: @ethereumjs/vm. Please update.' + + ethereumjs-wallet@0.6.5: + resolution: {integrity: sha512-MDwjwB9VQVnpp/Dc1XzA6J1a3wgHQ4hSvA1uWNatdpOrtCbPVuQSKSyRnjLvS0a+KKMw2pvQ9Ybqpb3+eW8oNA==} + deprecated: 'New package name format for new versions: @ethereumjs/wallet. Please update.' + + ethers@4.0.49: + resolution: {integrity: sha512-kPltTvWiyu+OktYy1IStSO16i2e7cS9D9OxZ81q2UUaiNPVrm/RTcbxamCXF9VUSKzJIdJV68EAIhTEVBalRWg==} + + ethers@5.6.2: + resolution: {integrity: sha512-EzGCbns24/Yluu7+ToWnMca3SXJ1Jk1BvWB7CCmVNxyOeM4LLvw2OLuIHhlkhQk1dtOcj9UMsdkxUh8RiG1dxQ==} + + ethers@5.7.0: + resolution: {integrity: sha512-5Xhzp2ZQRi0Em+0OkOcRHxPzCfoBfgtOQA+RUylSkuHbhTEaQklnYi2hsWbRgs3ztJsXVXd9VKBcO1ScWL8YfA==} + + ethers@5.8.0: + resolution: {integrity: sha512-DUq+7fHrCg1aPDFCHx6UIPb3nmt2XMpM7Y/g2gLhsl3lIBqeAfOJIl1qEvRf2uq3BiKxmh6Fh5pfp2ieyek7Kg==} + + ethers@6.13.7: + resolution: {integrity: sha512-qbaJ0uIrjh+huP1Lad2f2QtzW5dcqSVjIzVH6yWB4dKoMuj2WqYz5aMeeQTCNpAKgTJBM5J9vcc2cYJ23UAimQ==} + engines: {node: '>=14.0.0'} + + ethjs-unit@0.1.6: + resolution: {integrity: sha512-/Sn9Y0oKl0uqQuvgFk/zQgR7aw1g36qX/jzSQ5lSwlO0GigPymk4eGQfeNTD03w1dPOqfz8V77Cy43jH56pagw==} + engines: {node: '>=6.5.0', npm: '>=3'} + + ethjs-util@0.1.6: + resolution: {integrity: sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w==} + engines: {node: '>=6.5.0', npm: '>=3'} + + ethlint@1.2.5: + resolution: {integrity: sha512-x2nKK98zmd72SFWL3Ul1S6scWYf5QqG221N6/mFNMO661g7ASvTRINGIWVvHzsvflW6y4tvgMSjnTN5RCTuZug==} + hasBin: true + + event-emitter@0.3.5: + resolution: {integrity: sha512-D9rRn9y7kLPnJ+hMq7S/nhvoKwwvVJahBi2BPmx3bvbsEdK3W9ii8cBSGjP+72/LnM4n6fo3+dkCX5FeTQruXA==} + + event-target-shim@5.0.1: + resolution: {integrity: sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==} + engines: {node: '>=6'} + + eventemitter3@4.0.4: + resolution: {integrity: sha512-rlaVLnVxtxvoyLsQQFBx53YmXHDxRIzzTLbdfxqi4yocpSjAxXwkU0cScM5JgSKMqEhrZpnvQ2D9gjylR0AimQ==} + + eventemitter3@4.0.7: + resolution: {integrity: sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==} + + eventemitter3@5.0.1: + resolution: {integrity: sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==} + + events@3.3.0: + resolution: {integrity: sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==} + engines: {node: '>=0.8.x'} + + evp_bytestokey@1.0.3: + resolution: {integrity: sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==} + + execa@0.7.0: + resolution: {integrity: sha512-RztN09XglpYI7aBBrJCPW95jEH7YF1UEPOoX9yDhUTPdp7mK+CQvnLTuD10BNXZ3byLTu2uehZ8EcKT/4CGiFw==} + engines: {node: '>=4'} + + execa@4.1.0: + resolution: {integrity: sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA==} + engines: {node: '>=10'} + + execa@5.1.1: + resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==} + engines: {node: '>=10'} + + execa@8.0.1: + resolution: {integrity: sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==} + engines: {node: '>=16.17'} + + expand-brackets@0.1.5: + resolution: {integrity: sha512-hxx03P2dJxss6ceIeri9cmYOT4SRs3Zk3afZwWpOsRqLqprhTR8u++SlC+sFGsQr7WGFPdMF7Gjc1njDLDK6UA==} + engines: {node: '>=0.10.0'} + + expand-brackets@2.1.4: + resolution: {integrity: sha512-w/ozOKR9Obk3qoWeY/WDi6MFta9AoMR+zud60mdnbniMcBxRuFJyDt2LdX/14A1UABeqk+Uk+LDfUpvoGKppZA==} + engines: {node: '>=0.10.0'} + + expand-range@1.8.2: + resolution: {integrity: sha512-AFASGfIlnIbkKPQwX1yHaDjFvh/1gyKJODme52V6IORh69uEYgZp0o9C+qsIGNVEiuuhQU0CSSl++Rlegg1qvA==} + engines: {node: '>=0.10.0'} + + expand-template@2.0.3: + resolution: {integrity: sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==} + engines: {node: '>=6'} + + expand-tilde@2.0.2: + resolution: {integrity: sha512-A5EmesHW6rfnZ9ysHQjPdJRni0SRar0tjtG5MNtm9n5TUvsYU8oozprtRD4AqHxcZWWlVuAmQo2nWKfN9oyjTw==} + engines: {node: '>=0.10.0'} + + exponential-backoff@3.1.2: + resolution: {integrity: sha512-8QxYTVXUkuy7fIIoitQkPwGonB8F3Zj8eEO8Sqg9Zv/bkI7RJAzowee4gr81Hak/dUTpA2Z7VfQgoijjPNlUZA==} + + express@4.17.3: + resolution: {integrity: sha512-yuSQpz5I+Ch7gFrPCk4/c+dIBKlQUxtgwqzph132bsT6qhuzss6I8cLJQz7B3rFblzd6wtcI0ZbGltH/C4LjUg==} + engines: {node: '>= 0.10.0'} + + express@4.18.2: + resolution: {integrity: sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==} + engines: {node: '>= 0.10.0'} + + express@4.21.2: + resolution: {integrity: sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA==} + engines: {node: '>= 0.10.0'} + + ext@1.7.0: + resolution: {integrity: sha512-6hxeJYaL110a9b5TEJSj0gojyHQAmA2ch5Os+ySCiA1QGdS697XWY1pzsrSjqA9LDEEgdB/KypIlR59RcLuHYw==} + + extend-shallow@2.0.1: + resolution: {integrity: sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==} + engines: {node: '>=0.10.0'} + + extend-shallow@3.0.2: + resolution: {integrity: sha512-BwY5b5Ql4+qZoefgMj2NUmx+tehVTH/Kf4k1ZEtOHNFcm2wSxMRo992l6X3TIgni2eZVTZ85xMOjF31fwZAj6Q==} + engines: {node: '>=0.10.0'} + + extend@3.0.2: + resolution: {integrity: sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==} + + extendable-error@0.1.7: + resolution: {integrity: sha512-UOiS2in6/Q0FK0R0q6UY9vYpQ21mr/Qn1KOnte7vsACuNJf514WvCCUHSRCPcgjPT2bAhNIJdlE6bVap1GKmeg==} + + external-editor@3.1.0: + resolution: {integrity: sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==} + engines: {node: '>=4'} + + extglob@0.3.2: + resolution: {integrity: sha512-1FOj1LOwn42TMrruOHGt18HemVnbwAmAak7krWk+wa93KXxGbK+2jpezm+ytJYDaBX0/SPLZFHKM7m+tKobWGg==} + engines: {node: '>=0.10.0'} + + extglob@2.0.4: + resolution: {integrity: sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==} + engines: {node: '>=0.10.0'} + + extract-files@11.0.0: + resolution: {integrity: sha512-FuoE1qtbJ4bBVvv94CC7s0oTnKUGvQs+Rjf1L2SJFfS+HTVVjhPFtehPdQ0JiGPqVNfSSZvL5yzHHQq2Z4WNhQ==} + engines: {node: ^12.20 || >= 14.13} + + extsprintf@1.3.0: + resolution: {integrity: sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g==} + engines: {'0': node >=0.6.0} + + fake-merkle-patricia-tree@1.0.1: + resolution: {integrity: sha512-Tgq37lkc9pUIgIKw5uitNUKcgcYL3R6JvXtKQbOf/ZSavXbidsksgp/pAY6p//uhw0I4yoMsvTSovvVIsk/qxA==} + + fast-base64-decode@1.0.0: + resolution: {integrity: sha512-qwaScUgUGBYeDNRnbc/KyllVU88Jk1pRHPStuF/lO7B0/RTRLj7U0lkdTAutlBblY08rwZDff6tNU9cjv6j//Q==} + + fast-decode-uri-component@1.0.1: + resolution: {integrity: sha512-WKgKWg5eUxvRZGwW8FvfbaH7AXSh2cL+3j5fMGzUMCxWBJ3dV3a7Wz8y2f/uQ0e3B6WmodD3oS54jTQ9HVTIIg==} + + fast-deep-equal@1.1.0: + resolution: {integrity: sha512-fueX787WZKCV0Is4/T2cyAdM4+x1S3MXXOAhavE1ys/W42SHAPacLTQhucja22QBYrfGw50M2sRiXPtTGv9Ymw==} + + fast-deep-equal@3.1.3: + resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} + + fast-diff@1.3.0: + resolution: {integrity: sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==} + + fast-fifo@1.3.2: + resolution: {integrity: sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ==} + + fast-glob@3.3.2: + resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} + engines: {node: '>=8.6.0'} + + fast-glob@3.3.3: + resolution: {integrity: sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==} + engines: {node: '>=8.6.0'} + + fast-json-stable-stringify@2.1.0: + resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} + + fast-levenshtein@2.0.6: + resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} + + fast-querystring@1.1.2: + resolution: {integrity: sha512-g6KuKWmFXc0fID8WWH0jit4g0AGBoJhCkJMb1RmbsSEUNvQ+ZC8D6CUZ+GtF8nMzSPXnhiePyyqqipzNNEnHjg==} + + fast-redact@3.5.0: + resolution: {integrity: sha512-dwsoQlS7h9hMeYUq1W++23NDcBLV4KqONnITDV9DjfS3q1SgDGVrBdvvTLUotWtPSD7asWDV9/CmsZPy8Hf70A==} + engines: {node: '>=6'} + + fast-uri@3.0.6: + resolution: {integrity: sha512-Atfo14OibSv5wAp4VWNsFYE1AchQRTv9cBGWET4pZWHzYshFSS9NQI6I57rdKn9croWVMbYFbLhJ+yJvmZIIHw==} + + fast-url-parser@1.1.3: + resolution: {integrity: sha512-5jOCVXADYNuRkKFzNJ0dCCewsZiYo0dz8QNYljkOpFC6r2U4OBmKtvm/Tsuh4w1YYdDqDb31a8TVhBJ2OJKdqQ==} + + fastify-warning@0.2.0: + resolution: {integrity: sha512-s1EQguBw/9qtc1p/WTY4eq9WMRIACkj+HTcOIK1in4MV5aFaQC9ZCIt0dJ7pr5bIf4lPpHvAtP2ywpTNgs7hqw==} + deprecated: This module renamed to process-warning + + fastq@1.19.1: + resolution: {integrity: sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==} + + fb-watchman@2.0.2: + resolution: {integrity: sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==} + + fbjs-css-vars@1.0.2: + resolution: {integrity: sha512-b2XGFAFdWZWg0phtAWLHCk836A1Xann+I+Dgd3Gk64MHKZO44FfoD1KxyvbSh0qZsIoXQGGlVztIY+oitJPpRQ==} + + fbjs@3.0.5: + resolution: {integrity: sha512-ztsSx77JBtkuMrEypfhgc3cI0+0h+svqeie7xHbh1k/IKdcydnvadp/mUaGgjAOXQmQSxsqgaRhS3q9fy+1kxg==} + + fdir@6.4.4: + resolution: {integrity: sha512-1NZP+GK4GfuAv3PqKvxQRDMjdSRZjnkq7KfhlNrCNNlZ0ygQFpebfrnfnq/W7fpUnAv9aGWmY1zKx7FYL3gwhg==} + peerDependencies: + picomatch: ^3 || ^4 + peerDependenciesMeta: + picomatch: + optional: true + + fecha@4.2.3: + resolution: {integrity: sha512-OP2IUU6HeYKJi3i0z4A19kHMQoLVs4Hc+DPqqxI2h/DPZHTm/vjsfC6P0b4jCMy14XizLBqvndQ+UilD7707Jw==} + + fetch-ponyfill@4.1.0: + resolution: {integrity: sha512-knK9sGskIg2T7OnYLdZ2hZXn0CtDrAIBxYQLpmEf0BqfdWnwmM1weccUl5+4EdA44tzNSFAuxITPbXtPehUB3g==} + + fets@0.1.5: + resolution: {integrity: sha512-mL/ya591WOgCP1yBBPbp8E37nynj8QQF6iQCUVl0aHDL80BZ9SOL4BcKBy0dnKdC+clnnAkMm05KB9hsj4m4jQ==} + + figures@3.2.0: + resolution: {integrity: sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==} + engines: {node: '>=8'} + + file-entry-cache@6.0.1: + resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==} + engines: {node: ^10.12.0 || >=12.0.0} + + file-uri-to-path@1.0.0: + resolution: {integrity: sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==} + + filename-regex@2.0.1: + resolution: {integrity: sha512-BTCqyBaWBTsauvnHiE8i562+EdJj+oUpkqWp2R1iCoR8f6oo8STRu3of7WJJ0TqWtxN50a5YFpzYK4Jj9esYfQ==} + engines: {node: '>=0.10.0'} + + fill-range@2.2.4: + resolution: {integrity: sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q==} + engines: {node: '>=0.10.0'} + + fill-range@4.0.0: + resolution: {integrity: sha512-VcpLTWqWDiTerugjj8e3+esbg+skS3M9e54UuR3iCeIDMXCLTsAH8hTSzDQU/X6/6t3eYkOKoZSef2PlU6U1XQ==} + engines: {node: '>=0.10.0'} + + fill-range@7.1.1: + resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} + engines: {node: '>=8'} + + finalhandler@1.1.2: + resolution: {integrity: sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==} + engines: {node: '>= 0.8'} + + finalhandler@1.2.0: + resolution: {integrity: sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==} + engines: {node: '>= 0.8'} + + finalhandler@1.3.1: + resolution: {integrity: sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==} + engines: {node: '>= 0.8'} + + find-replace@1.0.3: + resolution: {integrity: sha512-KrUnjzDCD9426YnCP56zGYy/eieTnhtK6Vn++j+JJzmlsWWwEkDnsyVF575spT6HJ6Ow9tlbT3TQTDsa+O4UWA==} + engines: {node: '>=4.0.0'} + + find-replace@3.0.0: + resolution: {integrity: sha512-6Tb2myMioCAgv5kfvP5/PkZZ/ntTpVK39fHY7WkWBgvbeE+VHd/tZuZ4mrC+bxh4cfOZeYKVPaJIZtZXV7GNCQ==} + engines: {node: '>=4.0.0'} + + find-up@1.1.2: + resolution: {integrity: sha512-jvElSjyuo4EMQGoTwo1uJU5pQMwTW5lS1x05zzfJuTIyLR3zwO27LYrxNg+dlvKpGOuGy/MzBdXh80g0ve5+HA==} + engines: {node: '>=0.10.0'} + + find-up@2.1.0: + resolution: {integrity: sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ==} + engines: {node: '>=4'} + + find-up@4.1.0: + resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==} + engines: {node: '>=8'} + + find-up@5.0.0: + resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==} + engines: {node: '>=10'} + + find-yarn-workspace-root@1.2.1: + resolution: {integrity: sha512-dVtfb0WuQG+8Ag2uWkbG79hOUzEsRrhBzgfn86g2sJPkzmcpGdghbNTfUKGTxymFrY/tLIodDzLoW9nOJ4FY8Q==} + + find-yarn-workspace-root@2.0.0: + resolution: {integrity: sha512-1IMnbjt4KzsQfnhnzNd8wUEgXZ44IzZaZmnLYx7D5FZlaHt2gW20Cri8Q+E/t5tIj4+epTBub+2Zxu/vNILzqQ==} + + findup-sync@5.0.0: + resolution: {integrity: sha512-MzwXju70AuyflbgeOhzvQWAvvQdo1XL0A9bVvlXsYcFEBM87WR4OakL4OfZq+QRmr+duJubio+UtNQCPsVESzQ==} + engines: {node: '>= 10.13.0'} + + flat-cache@3.2.0: + resolution: {integrity: sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==} + engines: {node: ^10.12.0 || >=12.0.0} + + flat@5.0.2: + resolution: {integrity: sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==} + hasBin: true + + flatted@3.3.3: + resolution: {integrity: sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==} + + flow-enums-runtime@0.0.6: + resolution: {integrity: sha512-3PYnM29RFXwvAN6Pc/scUfkI7RwhQ/xqyLUyPNlXUp9S40zI8nup9tUSrTLSVnWGBN38FNiGWbwZOB6uR4OGdw==} + + flow-stoplight@1.0.0: + resolution: {integrity: sha512-rDjbZUKpN8OYhB0IE/vY/I8UWO/602IIJEU/76Tv4LvYnwHCk0BCsvz4eRr9n+FQcri7L5cyaXOo0+/Kh4HisA==} + + fmix@0.1.0: + resolution: {integrity: sha512-Y6hyofImk9JdzU8k5INtTXX1cu8LDlePWDFU5sftm9H+zKCr5SGrVjdhkvsim646cw5zD0nADj8oHyXMZmCZ9w==} + + fn.name@1.1.0: + resolution: {integrity: sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw==} + + follow-redirects@1.15.9: + resolution: {integrity: sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==} + engines: {node: '>=4.0'} + peerDependencies: + debug: '*' + peerDependenciesMeta: + debug: + optional: true + + for-each@0.3.5: + resolution: {integrity: sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg==} + engines: {node: '>= 0.4'} + + for-in@1.0.2: + resolution: {integrity: sha512-7EwmXrOjyL+ChxMhmG5lnW9MPt1aIeZEwKhQzoBUdTV0N3zuwWDZYVJatDvZ2OyzPUvdIAZDsCetk3coyMfcnQ==} + engines: {node: '>=0.10.0'} + + for-own@0.1.5: + resolution: {integrity: sha512-SKmowqGTJoPzLO1T0BBJpkfp3EMacCMOuH40hOUbrbzElVktk4DioXVM99QkLCyKoiuOmyjgcWMpVz2xjE7LZw==} + engines: {node: '>=0.10.0'} + + foreach@2.0.6: + resolution: {integrity: sha512-k6GAGDyqLe9JaebCsFCoudPPWfihKu8pylYXRlqP1J7ms39iPoTtk2fviNglIeQEwdh0bQeKJ01ZPyuyQvKzwg==} + + foreground-child@3.3.1: + resolution: {integrity: sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==} + engines: {node: '>=14'} + + forever-agent@0.6.1: + resolution: {integrity: sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==} + + form-data-encoder@1.7.1: + resolution: {integrity: sha512-EFRDrsMm/kyqbTQocNvRXMLjc7Es2Vk+IQFx/YW7hkUH1eBl4J1fqiP34l74Yt0pFLCNpc06fkbVk00008mzjg==} + + form-data-encoder@2.1.4: + resolution: {integrity: sha512-yDYSgNMraqvnxiEXO4hi88+YZxaHC6QKzb5N84iRCTDeRO7ZALpir/lVmf/uXUhnwUr2O4HU8s/n6x+yNjQkHw==} + engines: {node: '>= 14.17'} + + form-data@2.3.3: + resolution: {integrity: sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==} + engines: {node: '>= 0.12'} + + form-data@2.5.3: + resolution: {integrity: sha512-XHIrMD0NpDrNM/Ckf7XJiBbLl57KEhT3+i3yY+eWm+cqYZJQTZrKo8Y8AWKnuV5GT4scfuUGt9LzNoIx3dU1nQ==} + engines: {node: '>= 0.12'} + + form-data@3.0.3: + resolution: {integrity: sha512-q5YBMeWy6E2Un0nMGWMgI65MAKtaylxfNJGJxpGh45YDciZB4epbWpaAfImil6CPAPTYB4sh0URQNDRIZG5F2w==} + engines: {node: '>= 6'} + + form-data@4.0.2: + resolution: {integrity: sha512-hGfm/slu0ZabnNt4oaRZ6uREyfCj6P4fT/n6A1rGV+Z0VdGXjfOhVUpkn6qVQONHGIFwmveGXyDs75+nr6FM8w==} + engines: {node: '>= 6'} + + forwarded@0.2.0: + resolution: {integrity: sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==} + engines: {node: '>= 0.6'} + + fp-ts@1.19.3: + resolution: {integrity: sha512-H5KQDspykdHuztLTg+ajGN0Z2qUjcEf3Ybxc6hLt0k7/zPkn29XnKnxlBPyW2XIddWrGaJBzBl4VLYOtk39yZg==} + + fragment-cache@0.2.1: + resolution: {integrity: sha512-GMBAbW9antB8iZRHLoGw0b3HANt57diZYFO/HL1JGIC1MjKrdmhxvrJbupnVvpys0zsz7yBApXdQyfepKly2kA==} + engines: {node: '>=0.10.0'} + + fresh@0.5.2: + resolution: {integrity: sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==} + engines: {node: '>= 0.6'} + + fs-constants@1.0.0: + resolution: {integrity: sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==} + + fs-extra@0.30.0: + resolution: {integrity: sha512-UvSPKyhMn6LEd/WpUaV9C9t3zATuqoqfWc3QdPhPLb58prN9tqYPlPWi8Krxi44loBoUzlobqZ3+8tGpxxSzwA==} + + fs-extra@10.1.0: + resolution: {integrity: sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==} + engines: {node: '>=12'} + + fs-extra@11.3.0: + resolution: {integrity: sha512-Z4XaCL6dUDHfP/jT25jJKMmtxvuwbkrD1vNSMFlo9lNLY2c5FHYSQgHPRZUjAB26TpDEoW9HCOgplrdbaPV/ew==} + engines: {node: '>=14.14'} + + fs-extra@4.0.3: + resolution: {integrity: sha512-q6rbdDd1o2mAnQreO7YADIxf/Whx4AHBiRf6d+/cVT8h44ss+lHgxf1FemcqDnQt9X3ct4McHr+JMGlYSsK7Cg==} + + fs-extra@7.0.1: + resolution: {integrity: sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==} + engines: {node: '>=6 <7 || >=8'} + + fs-extra@8.1.0: + resolution: {integrity: sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==} + engines: {node: '>=6 <7 || >=8'} + + fs-extra@9.1.0: + resolution: {integrity: sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==} + engines: {node: '>=10'} + + fs-minipass@1.2.7: + resolution: {integrity: sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA==} + + fs-readdir-recursive@1.1.0: + resolution: {integrity: sha512-GNanXlVr2pf02+sPN40XN8HG+ePaNcvM0q5mZBd668Obwb0yD5GiUbZOFgwn8kGMY6I3mdyDJzieUy3PTYyTRA==} + + fs.realpath@1.0.0: + resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} + + fsevents@1.2.13: + resolution: {integrity: sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==} + engines: {node: '>= 4.0'} + os: [darwin] + deprecated: Upgrade to fsevents v2 to mitigate potential security issues + + fsevents@2.3.3: + resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} + engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} + os: [darwin] + + function-bind@1.1.2: + resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} + + function.prototype.name@1.1.8: + resolution: {integrity: sha512-e5iwyodOHhbMr/yNrc7fDYG4qlbIvI5gajyzPnb5TCwyhjApznQh1BMFou9b30SevY43gCJKXycoCBjMbsuW0Q==} + engines: {node: '>= 0.4'} + + functional-red-black-tree@1.0.1: + resolution: {integrity: sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==} + + functions-have-names@1.2.3: + resolution: {integrity: sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==} + + ganache-core@2.13.2: + resolution: {integrity: sha512-tIF5cR+ANQz0+3pHWxHjIwHqFXcVo0Mb+kcsNhglNFALcYo49aQpnS9dqHartqPfMFjiHh/qFoD3mYK0d/qGgw==} + engines: {node: '>=8.9.0'} + deprecated: ganache-core is now ganache; visit https://trfl.io/g7 for details + bundledDependencies: + - keccak + + gauge@2.7.4: + resolution: {integrity: sha512-14x4kjc6lkD3ltw589k0NrPD6cCNTD6CWoVUNpB85+DrtONoZn+Rug6xZU5RvSC4+TZPxA5AnBibQYAvZn41Hg==} + deprecated: This package is no longer supported. + + gensync@1.0.0-beta.2: + resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==} + engines: {node: '>=6.9.0'} + + get-caller-file@1.0.3: + resolution: {integrity: sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==} + + get-caller-file@2.0.5: + resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} + engines: {node: 6.* || 8.* || >= 10.*} + + get-east-asian-width@1.3.0: + resolution: {integrity: sha512-vpeMIQKxczTD/0s2CdEWHcb0eeJe6TFjxb+J5xgX7hScxqrGuyjmv4c1D4A/gelKfyox0gJJwIHF+fLjeaM8kQ==} + engines: {node: '>=18'} + + get-func-name@2.0.2: + resolution: {integrity: sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==} + + get-intrinsic@1.3.0: + resolution: {integrity: sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==} + engines: {node: '>= 0.4'} + + get-iterator@1.0.2: + resolution: {integrity: sha512-v+dm9bNVfOYsY1OrhaCrmyOcYoSeVvbt+hHZ0Au+T+p1y+0Uyj9aMaGIeUTT6xdpRbWzDeYKvfOslPhggQMcsg==} + + get-own-enumerable-property-symbols@3.0.2: + resolution: {integrity: sha512-I0UBV/XOz1XkIJHEUDMZAbzCThU/H8DxmSfmdGcKPnVhu2VfFqr34jr9777IyaTYvxjedWhqVIilEDsCdP5G6g==} + + get-package-type@0.1.0: + resolution: {integrity: sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==} + engines: {node: '>=8.0.0'} + + get-port@3.2.0: + resolution: {integrity: sha512-x5UJKlgeUiNT8nyo/AcnwLnZuZNcSjSw0kogRB+Whd1fjjFq4B1hySFxSFWWSn4mIBzg3sRNUDFYc4g5gjPoLg==} + engines: {node: '>=4'} + + get-proto@1.0.1: + resolution: {integrity: sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==} + engines: {node: '>= 0.4'} + + get-stream@3.0.0: + resolution: {integrity: sha512-GlhdIUuVakc8SJ6kK0zAFbiGzRFzNnY4jUuEbV9UROo4Y+0Ny4fjvcZFVTeDA4odpFyOQzaw6hXukJSq/f28sQ==} + engines: {node: '>=4'} + + get-stream@4.1.0: + resolution: {integrity: sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==} + engines: {node: '>=6'} + + get-stream@5.2.0: + resolution: {integrity: sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==} + engines: {node: '>=8'} + + get-stream@6.0.1: + resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} + engines: {node: '>=10'} + + get-stream@8.0.1: + resolution: {integrity: sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==} + engines: {node: '>=16'} + + get-symbol-description@1.1.0: + resolution: {integrity: sha512-w9UMqWwJxHNOvoNzSJ2oPF5wvYcvP7jUvYzhp67yEhTi17ZDBBC1z9pTdGuzjD+EFIqLSYRweZjqfiPzQ06Ebg==} + engines: {node: '>= 0.4'} + + get-value@2.0.6: + resolution: {integrity: sha512-Ln0UQDlxH1BapMu3GPtf7CuYNwRZf2gwCuPqbyG6pB8WfmFpzqcy4xtAaAMUhnNqjMKTiCPZG2oMT3YSx8U2NA==} + engines: {node: '>=0.10.0'} + + getpass@0.1.7: + resolution: {integrity: sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng==} + + ghost-testrpc@0.0.2: + resolution: {integrity: sha512-i08dAEgJ2g8z5buJIrCTduwPIhih3DP+hOCTyyryikfV8T0bNvHnGXO67i0DD1H4GBDETTclPy9njZbfluQYrQ==} + hasBin: true + + git-raw-commits@2.0.11: + resolution: {integrity: sha512-VnctFhw+xfj8Va1xtfEqCUD2XDrbAPSJx+hSrE5K7fGdjZruW7XV+QOrN7LF/RJyvspRiD2I0asWsxFp0ya26A==} + engines: {node: '>=10'} + hasBin: true + + github-from-package@0.0.0: + resolution: {integrity: sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==} + + glob-base@0.3.0: + resolution: {integrity: sha512-ab1S1g1EbO7YzauaJLkgLp7DZVAqj9M/dvKlTt8DkXA2tiOIcSMrlVI2J1RZyB5iJVccEscjGn+kpOG9788MHA==} + engines: {node: '>=0.10.0'} + + glob-parent@2.0.0: + resolution: {integrity: sha512-JDYOvfxio/t42HKdxkAYaCiBN7oYiuxykOxKxdaUW5Qn0zaYN3gRQWolrwdnf0shM9/EP0ebuuTmyoXNr1cC5w==} + + glob-parent@5.1.2: + resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} + engines: {node: '>= 6'} + + glob-parent@6.0.2: + resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==} + engines: {node: '>=10.13.0'} + + glob@10.4.5: + resolution: {integrity: sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==} + hasBin: true + + glob@11.0.2: + resolution: {integrity: sha512-YT7U7Vye+t5fZ/QMkBFrTJ7ZQxInIUjwyAjVj84CYXqgBdv30MFUPGnBR6sQaVq6Is15wYJUsnzTuWaGRBhBAQ==} + engines: {node: 20 || >=22} + hasBin: true + + glob@5.0.15: + resolution: {integrity: sha512-c9IPMazfRITpmAAKi22dK1VKxGDX9ehhqfABDriL/lzO92xcUKEJPQHrVA/2YHSNFB4iFlykVmWvwo48nr3OxA==} + deprecated: Glob versions prior to v9 are no longer supported + + glob@7.1.2: + resolution: {integrity: sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==} + deprecated: Glob versions prior to v9 are no longer supported + + glob@7.1.7: + resolution: {integrity: sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==} + deprecated: Glob versions prior to v9 are no longer supported + + glob@7.2.0: + resolution: {integrity: sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==} + deprecated: Glob versions prior to v9 are no longer supported + + glob@7.2.3: + resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} + deprecated: Glob versions prior to v9 are no longer supported + + glob@8.1.0: + resolution: {integrity: sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==} + engines: {node: '>=12'} + deprecated: Glob versions prior to v9 are no longer supported + + global-dirs@0.1.1: + resolution: {integrity: sha512-NknMLn7F2J7aflwFOlGdNIuCDpN3VGoSoB+aap3KABFWbHVn1TCgFC+np23J8W2BiZbjfEw3BFBycSMv1AFblg==} + engines: {node: '>=4'} + + global-modules@1.0.0: + resolution: {integrity: sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==} + engines: {node: '>=0.10.0'} + + global-modules@2.0.0: + resolution: {integrity: sha512-NGbfmJBp9x8IxyJSd1P+otYK8vonoJactOogrVfFRIAEY1ukil8RSKDz2Yo7wh1oihl51l/r6W4epkeKJHqL8A==} + engines: {node: '>=6'} + + global-prefix@1.0.2: + resolution: {integrity: sha512-5lsx1NUDHtSjfg0eHlmYvZKv8/nVqX4ckFbM+FrGcQ+04KWcWFo9P5MxPZYSzUvyzmdTbI7Eix8Q4IbELDqzKg==} + engines: {node: '>=0.10.0'} + + global-prefix@3.0.0: + resolution: {integrity: sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg==} + engines: {node: '>=6'} + + global@4.4.0: + resolution: {integrity: sha512-wv/LAoHdRE3BeTGz53FAamhGlPLhlssK45usmGFThIi4XqnBmjKQ16u+RNbP7WvigRZDxUsM0J3gcQ5yicaL0w==} + + globals@11.12.0: + resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==} + engines: {node: '>=4'} + + globals@13.24.0: + resolution: {integrity: sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==} + engines: {node: '>=8'} + + globals@16.0.0: + resolution: {integrity: sha512-iInW14XItCXET01CQFqudPOWP2jYMl7T+QRQT+UNcR/iQncN/F0UNpgd76iFkBPgNQb4+X3LV9tLJYzwh+Gl3A==} + engines: {node: '>=18'} + + globals@9.18.0: + resolution: {integrity: sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==} + engines: {node: '>=0.10.0'} + + globalthis@1.0.4: + resolution: {integrity: sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==} + engines: {node: '>= 0.4'} + + globby@10.0.2: + resolution: {integrity: sha512-7dUi7RvCoT/xast/o/dLN53oqND4yk0nsHkhRgn9w65C4PofCLOoJ39iSOg+qVDdWQPIEj+eszMHQ+aLVwwQSg==} + engines: {node: '>=8'} + + globby@11.1.0: + resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==} + engines: {node: '>=10'} + + gopd@1.2.0: + resolution: {integrity: sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==} + engines: {node: '>= 0.4'} + + got@11.8.6: + resolution: {integrity: sha512-6tfZ91bOr7bOXnK7PRDCGBLa1H4U080YHNaAQ2KsMGlLEzRbk44nsZF2E1IeRc3vtJHPVbKCYgdFbaGO2ljd8g==} + engines: {node: '>=10.19.0'} + + got@12.1.0: + resolution: {integrity: sha512-hBv2ty9QN2RdbJJMK3hesmSkFTjVIHyIDDbssCKnSmq62edGgImJWD10Eb1k77TiV1bxloxqcFAVK8+9pkhOig==} + engines: {node: '>=14.16'} + + got@12.6.1: + resolution: {integrity: sha512-mThBblvlAF1d4O5oqyvN+ZxLAYwIJK7bpMxgYqPD9okW0C3qm5FFn7k811QrcuEBwaogR3ngOFoCfs6mRv7teQ==} + engines: {node: '>=14.16'} + + got@9.6.0: + resolution: {integrity: sha512-R7eWptXuGYxwijs0eV+v3o6+XH1IqVK8dJOEecQfTmkncw9AV4dcw/Dhxi8MdlqPthxxpZyizMzyg8RTmEsG+Q==} + engines: {node: '>=8.6'} + + graceful-fs@4.2.10: + resolution: {integrity: sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==} + + graceful-fs@4.2.11: + resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} + + graphemer@1.4.0: + resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} + + graphql-import-node@0.0.5: + resolution: {integrity: sha512-OXbou9fqh9/Lm7vwXT0XoRN9J5+WCYKnbiTalgFDvkQERITRmcfncZs6aVABedd5B85yQU5EULS4a5pnbpuI0Q==} + peerDependencies: + graphql: '*' + + graphql-tag@2.12.6: + resolution: {integrity: sha512-FdSNcu2QQcWnM2VNvSCCDCVS5PpPqpzgFT8+GXzqJuoDd0CBncxCY278u4mhRO7tMgo2JjgJA5aZ+nWSQ/Z+xg==} + engines: {node: '>=10'} + peerDependencies: + graphql: ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 + + graphql-ws@5.12.1: + resolution: {integrity: sha512-umt4f5NnMK46ChM2coO36PTFhHouBrK9stWWBczERguwYrGnPNxJ9dimU6IyOBfOkC6Izhkg4H8+F51W/8CYDg==} + engines: {node: '>=10'} + peerDependencies: + graphql: '>=0.11 <=16' + + graphql-ws@5.16.2: + resolution: {integrity: sha512-E1uccsZxt/96jH/OwmLPuXMACILs76pKF2i3W861LpKBCYtGIyPQGtWLuBLkND4ox1KHns70e83PS4te50nvPQ==} + engines: {node: '>=10'} + peerDependencies: + graphql: '>=0.11 <=16' + + graphql-yoga@3.9.1: + resolution: {integrity: sha512-BB6EkN64VBTXWmf9Kym2OsVZFzBC0mAsQNo9eNB5xIr3t+x7qepQ34xW5A353NWol3Js3xpzxwIKFVF6l9VsPg==} + peerDependencies: + graphql: ^15.2.0 || ^16.0.0 + + graphql@16.11.0: + resolution: {integrity: sha512-mS1lbMsxgQj6hge1XZ6p7GPhbrtFwUFYi3wRzXAC/FmYnyXMTvvI3td3rjmQ2u8ewXueaSvRPWaEcgVVOT9Jnw==} + engines: {node: ^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0} + + graphql@16.3.0: + resolution: {integrity: sha512-xm+ANmA16BzCT5pLjuXySbQVFwH3oJctUVdy81w1sV0vBU0KgDdBGtxQOUd5zqOBk/JayAFeG8Dlmeq74rjm/A==} + engines: {node: ^12.22.0 || ^14.16.0 || >=16.0.0} + + graphql@16.8.0: + resolution: {integrity: sha512-0oKGaR+y3qcS5mCu1vb7KG+a89vjn06C7Ihq/dDl3jA+A8B3TKomvi3CiEcVLJQGalbu8F52LxkOym7U5sSfbg==} + engines: {node: ^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0} + + growl@1.10.3: + resolution: {integrity: sha512-hKlsbA5Vu3xsh1Cg3J7jSmX/WaW6A5oBeqzM88oNbCRQFz+zUaXm6yxS4RVytp1scBoJzSYl4YAEOQIt6O8V1Q==} + engines: {node: '>=4.x'} + + handlebars@4.7.8: + resolution: {integrity: sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==} + engines: {node: '>=0.4.7'} + hasBin: true + + har-schema@2.0.0: + resolution: {integrity: sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q==} + engines: {node: '>=4'} + + har-validator@5.1.5: + resolution: {integrity: sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==} + engines: {node: '>=6'} + deprecated: this library is no longer supported + + hard-rejection@2.1.0: + resolution: {integrity: sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==} + engines: {node: '>=6'} + + hardhat-abi-exporter@2.11.0: + resolution: {integrity: sha512-hBC4Xzncew9pdqVpzWoEEBJUthp99TCH39cHlMehVxBBQ6EIsIFyj3N0yd0hkVDfM8/s/FMRAuO5jntZBpwCZQ==} + engines: {node: '>=14.14.0'} + peerDependencies: + hardhat: ^2.0.0 + + hardhat-contract-sizer@2.10.0: + resolution: {integrity: sha512-QiinUgBD5MqJZJh1hl1jc9dNnpJg7eE/w4/4GEnrcmZJJTDbVFNe3+/3Ep24XqISSkYxRz36czcPHKHd/a0dwA==} + peerDependencies: + hardhat: ^2.0.0 + + hardhat-deploy@0.7.11: + resolution: {integrity: sha512-ONLH3NH8Biuhky44KRFyaINVHM8JI4Ihy1TpntIRZUpIFHlz9h3gieq46H7iwdp6z3CqMsOCChF0riUF3CFpmQ==} + peerDependencies: + '@ethersproject/hardware-wallets': ^5.0.14 + hardhat: ^2.0.0 + + hardhat-gas-reporter@1.0.10: + resolution: {integrity: sha512-02N4+So/fZrzJ88ci54GqwVA3Zrf0C9duuTyGt0CFRIh/CdNwbnTgkXkRfojOMLBQ+6t+lBIkgbsOtqMvNwikA==} + peerDependencies: + hardhat: ^2.0.2 + + hardhat-secure-accounts@0.0.5: + resolution: {integrity: sha512-ma/UOYV8fROMucLifflUEvYdtchcK4JB2tCV6etAg8PB66OlBo7MwmofnWnN4ABMR8Qt7zGgedFBkGdmBrmxRA==} + peerDependencies: + '@nomiclabs/hardhat-ethers': ^2.1.1 + ethers: ^5.0.0 + hardhat: ^2.0.0 + + hardhat-secure-accounts@0.0.6: + resolution: {integrity: sha512-KnSLrjdNdxg5YJ4/FZ0Ogf1S4nR0YdlIWG9DLMyUurF0S345yzKt0IMPDqcG5/MNDI/hMNfSv6/AQuBWZ4i21w==} + peerDependencies: + '@nomiclabs/hardhat-ethers': ^2.1.1 + ethers: ^5.0.0 + hardhat: ^2.0.0 + + hardhat-secure-accounts@1.0.5: + resolution: {integrity: sha512-gr0bV1eh1sOOSy2CgQ0BMFwQ8QPLBLBB7mJIT4VYNkEf6+fPjO8r70lNapoX53zMhfy9kQe7F0ko6yKpkcBqBg==} + peerDependencies: + '@nomicfoundation/hardhat-ethers': ^3.0.0 + ethers: ^6.13.0 + hardhat: ^2.22.0 + + hardhat-storage-layout@0.1.6: + resolution: {integrity: sha512-urp9PUDJmRrFaTnMkyYGAlU0OF7Q+inWMWKHvuGRyvBDwVQKXfj5WoerTax4bBpXukJ4fBYyUTjAr0x+j2LcKQ==} + peerDependencies: + hardhat: ^2.0.3 + + hardhat-tracer@1.3.0: + resolution: {integrity: sha512-mUYuRJWlxCwY4R2urCpNM4ecVSq/iMLiVP9YZKlfXyv4R8T+4HAcTfumilUOXHGe6wHI+8Ki2EaTon3KgzATDA==} + peerDependencies: + chalk: 4.x + ethers: 5.x + hardhat: 2.x + + hardhat@2.14.1: + resolution: {integrity: sha512-H3Qp/UKyQGmPDDBSfMoSyH18rRnac90rsb0LNer+sKe6at6rxLe4D5j+M+1icqZQF02iLPjNRwc/PA8OPf757A==} + engines: {node: '>=14.0.0'} + hasBin: true + peerDependencies: + ts-node: '*' + typescript: '*' + peerDependenciesMeta: + ts-node: + optional: true + typescript: + optional: true + + hardhat@2.23.0: + resolution: {integrity: sha512-xnORx1LgX46TxylOFme96JmSAIjXuHUVpOlUnaCt8MKMGsgy0NGsfPo5rJI/ncCBPLFLURGfZUQ2Uc6ZYN4kYg==} + hasBin: true + peerDependencies: + ts-node: '*' + typescript: '*' + peerDependenciesMeta: + ts-node: + optional: true + typescript: + optional: true + + has-ansi@2.0.0: + resolution: {integrity: sha512-C8vBJ8DwUCx19vhm7urhTuUsr4/IyP6l4VzNQDv+ryHQObW3TTTp9yB68WpYgRe2bbaGuZ/se74IqFeVnMnLZg==} + engines: {node: '>=0.10.0'} + + has-bigints@1.1.0: + resolution: {integrity: sha512-R3pbpkcIqv2Pm3dUwgjclDRVmWpTJW2DcMzcIhEXEx1oh/CEMObMm3KLmRJOdvhM7o4uQBnwr8pzRK2sJWIqfg==} + engines: {node: '>= 0.4'} + + has-flag@1.0.0: + resolution: {integrity: sha512-DyYHfIYwAJmjAjSSPKANxI8bFY9YtFrgkAfinBojQ8YJTOuOuav64tMUJv584SES4xl74PmuaevIyaLESHdTAA==} + engines: {node: '>=0.10.0'} + + has-flag@2.0.0: + resolution: {integrity: sha512-P+1n3MnwjR/Epg9BBo1KT8qbye2g2Ou4sFumihwt6I4tsUX7jnLcX4BTOSKg/B1ZrIYMN9FcEnG4x5a7NB8Eng==} + engines: {node: '>=0.10.0'} + + has-flag@3.0.0: + resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==} + engines: {node: '>=4'} + + has-flag@4.0.0: + resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} + engines: {node: '>=8'} + + has-property-descriptors@1.0.2: + resolution: {integrity: sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==} + + has-proto@1.2.0: + resolution: {integrity: sha512-KIL7eQPfHQRC8+XluaIw7BHUwwqL19bQn4hzNgdr+1wXoU0KKj6rufu47lhY7KbJR2C6T6+PfyN0Ea7wkSS+qQ==} + engines: {node: '>= 0.4'} + + has-symbols@1.1.0: + resolution: {integrity: sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==} + engines: {node: '>= 0.4'} + + has-tostringtag@1.0.2: + resolution: {integrity: sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==} + engines: {node: '>= 0.4'} + + has-unicode@2.0.1: + resolution: {integrity: sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==} + + has-value@0.3.1: + resolution: {integrity: sha512-gpG936j8/MzaeID5Yif+577c17TxaDmhuyVgSwtnL/q8UUTySg8Mecb+8Cf1otgLoD7DDH75axp86ER7LFsf3Q==} + engines: {node: '>=0.10.0'} + + has-value@1.0.0: + resolution: {integrity: sha512-IBXk4GTsLYdQ7Rvt+GRBrFSVEkmuOUy4re0Xjd9kJSUQpnTrWR4/y9RpfexN9vkAPMFuQoeWKwqzPozRTlasGw==} + engines: {node: '>=0.10.0'} + + has-values@0.1.4: + resolution: {integrity: sha512-J8S0cEdWuQbqD9//tlZxiMuMNmxB8PlEwvYwuxsTmR1G5RXUePEX/SJn7aD0GMLieuZYSwNH0cQuJGwnYunXRQ==} + engines: {node: '>=0.10.0'} + + has-values@1.0.0: + resolution: {integrity: sha512-ODYZC64uqzmtfGMEAX/FvZiRyWLpAC3vYnNunURUnkGVTS+mI0smVsWaPydRBsE3g+ok7h960jChO8mFcWlHaQ==} + engines: {node: '>=0.10.0'} + + has@1.0.4: + resolution: {integrity: sha512-qdSAmqLF6209RFj4VVItywPMbm3vWylknmB3nvNiUIs72xAimcM8nVYxYr7ncvZq5qzk9MKIZR8ijqD/1QuYjQ==} + engines: {node: '>= 0.4.0'} + + hash-base@3.0.5: + resolution: {integrity: sha512-vXm0l45VbcHEVlTCzs8M+s0VeYsB2lnlAaThoLKGXr3bE/VWDOelNUnycUPEhKEaXARL2TEFjBOyUiM6+55KBg==} + engines: {node: '>= 0.10'} + + hash-base@3.1.0: + resolution: {integrity: sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==} + engines: {node: '>=4'} + + hash-it@6.0.0: + resolution: {integrity: sha512-KHzmSFx1KwyMPw0kXeeUD752q/Kfbzhy6dAZrjXV9kAIXGqzGvv8vhkUqj+2MGZldTo0IBpw6v7iWE7uxsvH0w==} + + hash.js@1.1.3: + resolution: {integrity: sha512-/UETyP0W22QILqS+6HowevwhEFJ3MBJnwTf75Qob9Wz9t0DPuisL8kW8YZMK62dHAKE1c1p+gY1TtOLY+USEHA==} + + hash.js@1.1.7: + resolution: {integrity: sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==} + + hasown@2.0.2: + resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} + engines: {node: '>= 0.4'} + + he@1.1.1: + resolution: {integrity: sha512-z/GDPjlRMNOa2XJiB4em8wJpuuBfrFOlYKTZxtpkdr1uPdibHI8rYA3MY0KDObpVyaes0e/aunid/t88ZI2EKA==} + hasBin: true + + he@1.2.0: + resolution: {integrity: sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==} + hasBin: true + + header-case@2.0.4: + resolution: {integrity: sha512-H/vuk5TEEVZwrR0lp2zed9OCo1uAILMlx0JEMgC26rzyJJ3N1v6XkwHHXJQdR2doSjcGPM6OKPYoJgf0plJ11Q==} + + heap@0.2.6: + resolution: {integrity: sha512-MzzWcnfB1e4EG2vHi3dXHoBupmuXNZzx6pY6HldVS55JKKBoq3xOyzfSaZRkJp37HIhEYC78knabHff3zc4dQQ==} + + heap@0.2.7: + resolution: {integrity: sha512-2bsegYkkHO+h/9MGbn6KWcE45cHZgPANo5LXF7EvWdT0yT2EguSVO1nDgU5c8+ZOPwp2vMNa7YFsJhVcDR9Sdg==} + + helmet@5.0.2: + resolution: {integrity: sha512-QWlwUZZ8BtlvwYVTSDTBChGf8EOcQ2LkGMnQJxSzD1mUu8CCjXJZq/BXP8eWw4kikRnzlhtYo3lCk0ucmYA3Vg==} + engines: {node: '>=12.0.0'} + + helmet@7.0.0: + resolution: {integrity: sha512-MsIgYmdBh460ZZ8cJC81q4XJknjG567wzEmv46WOBblDb6TUd3z8/GhgmsM9pn8g2B80tAJ4m5/d3Bi1KrSUBQ==} + engines: {node: '>=16.0.0'} + + hermes-estree@0.25.1: + resolution: {integrity: sha512-0wUoCcLp+5Ev5pDW2OriHC2MJCbwLwuRx+gAqMTOkGKJJiBCLjtrvy4PWUGn6MIVefecRpzoOZ/UV6iGdOr+Cw==} + + hermes-estree@0.28.1: + resolution: {integrity: sha512-w3nxl/RGM7LBae0v8LH2o36+8VqwOZGv9rX1wyoWT6YaKZLqpJZ0YQ5P0LVr3tuRpf7vCx0iIG4i/VmBJejxTQ==} + + hermes-parser@0.25.1: + resolution: {integrity: sha512-6pEjquH3rqaI6cYAXYPcz9MS4rY6R4ngRgrgfDshRptUZIc3lw0MCIJIGDj9++mfySOuPTHB4nrSW99BCvOPIA==} + + hermes-parser@0.28.1: + resolution: {integrity: sha512-nf8o+hE8g7UJWParnccljHumE9Vlq8F7MqIdeahl+4x0tvCUJYRrT0L7h0MMg/X9YJmkNwsfbaNNrzPtFXOscg==} + + hmac-drbg@1.0.1: + resolution: {integrity: sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==} + + home-or-tmp@2.0.0: + resolution: {integrity: sha512-ycURW7oUxE2sNiPVw1HVEFsW+ecOpJ5zaj7eC0RlwhibhRBod20muUN8qu/gzx956YrLolVvs1MTXwKgC2rVEg==} + engines: {node: '>=0.10.0'} + + homedir-polyfill@1.0.3: + resolution: {integrity: sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==} + engines: {node: '>=0.10.0'} + + hosted-git-info@2.8.9: + resolution: {integrity: sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==} + + hosted-git-info@4.1.0: + resolution: {integrity: sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==} + engines: {node: '>=10'} + + hotscript@1.0.13: + resolution: {integrity: sha512-C++tTF1GqkGYecL+2S1wJTfoH6APGAsbb7PAWQ3iVIwgG/EFseAfEVOKFgAFq4yK3+6j1EjUD4UQ9dRJHX/sSQ==} + + http-basic@8.1.3: + resolution: {integrity: sha512-/EcDMwJZh3mABI2NhGfHOGOeOZITqfkEO4p/xK+l3NpyncIHUQBoMvCSF/b5GqvKtySC2srL/GGG3+EtlqlmCw==} + engines: {node: '>=6.0.0'} + + http-cache-semantics@4.1.1: + resolution: {integrity: sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==} + + http-errors@1.8.1: + resolution: {integrity: sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==} + engines: {node: '>= 0.6'} + + http-errors@2.0.0: + resolution: {integrity: sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==} + engines: {node: '>= 0.8'} + + http-https@1.0.0: + resolution: {integrity: sha512-o0PWwVCSp3O0wS6FvNr6xfBCHgt0m1tvPLFOCc2iFDKTRAXhB7m8klDf7ErowFH8POa6dVdGatKU5I1YYwzUyg==} + + http-response-object@3.0.2: + resolution: {integrity: sha512-bqX0XTF6fnXSQcEJ2Iuyr75yVakyjIDCqroJQ/aHfSdlM743Cwqoi2nDYMzLGWUcuTWGWy8AAvOKXTfiv6q9RA==} + + http-signature@1.2.0: + resolution: {integrity: sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ==} + engines: {node: '>=0.8', npm: '>=1.3.7'} + + http2-wrapper@1.0.3: + resolution: {integrity: sha512-V+23sDMr12Wnz7iTcDeJr3O6AIxlnvT/bmaAAAP/Xda35C90p9599p0F1eHR/N1KILWSoWVAiOMFjBBXaXSMxg==} + engines: {node: '>=10.19.0'} + + http2-wrapper@2.2.1: + resolution: {integrity: sha512-V5nVw1PAOgfI3Lmeaj2Exmeg7fenjhRUgz1lPSezy1CuhPYbgQtbQj4jZfEAEMlaL+vupsvhjqCyjzob0yxsmQ==} + engines: {node: '>=10.19.0'} + + https-proxy-agent@5.0.1: + resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==} + engines: {node: '>= 6'} + + https-proxy-agent@7.0.6: + resolution: {integrity: sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==} + engines: {node: '>= 14'} + + human-id@4.1.1: + resolution: {integrity: sha512-3gKm/gCSUipeLsRYZbbdA1BD83lBoWUkZ7G9VFrhWPAU76KwYo5KR8V28bpoPm/ygy0x5/GCbpRQdY7VLYCoIg==} + hasBin: true + + human-signals@1.1.1: + resolution: {integrity: sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==} + engines: {node: '>=8.12.0'} + + human-signals@2.1.0: + resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==} + engines: {node: '>=10.17.0'} + + human-signals@5.0.0: + resolution: {integrity: sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==} + engines: {node: '>=16.17.0'} + + husky@7.0.4: + resolution: {integrity: sha512-vbaCKN2QLtP/vD4yvs6iz6hBEo6wkSzs8HpRah1Z6aGmF2KW5PdYuAd7uX5a+OyBZHBhd+TFLqgjUgytQr4RvQ==} + engines: {node: '>=12'} + hasBin: true + + husky@8.0.3: + resolution: {integrity: sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg==} + engines: {node: '>=14'} + hasBin: true + + iconv-lite@0.4.24: + resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} + engines: {node: '>=0.10.0'} + + iconv-lite@0.6.3: + resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==} + engines: {node: '>=0.10.0'} + + idna-uts46-hx@2.3.1: + resolution: {integrity: sha512-PWoF9Keq6laYdIRwwCdhTPl60xRqAloYNMQLiyUnG42VjT53oW07BXIRM+NK7eQjzXjAk2gUvX9caRxlnF9TAA==} + engines: {node: '>=4.0.0'} + + ieee754@1.2.1: + resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} + + ignore@5.3.2: + resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==} + engines: {node: '>= 4'} + + image-size@1.2.1: + resolution: {integrity: sha512-rH+46sQJ2dlwfjfhCyNx5thzrv+dtmBIhPHk0zgRUukHzZ/kRueTJXoYYsclBaKcSMBWuGbOFXtioLpzTb5euw==} + engines: {node: '>=16.x'} + hasBin: true + + immediate@3.0.6: + resolution: {integrity: sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==} + + immediate@3.2.3: + resolution: {integrity: sha512-RrGCXRm/fRVqMIhqXrGEX9rRADavPiDFSoMb/k64i9XMk8uH4r/Omi5Ctierj6XzNecwDbO4WuFbDD1zmpl3Tg==} + + immediate@3.3.0: + resolution: {integrity: sha512-HR7EVodfFUdQCTIeySw+WDRFJlPcLOJbXfwwZ7Oom6tjsvZ3bOkCDJHehQC3nxJrv7+f9XecwazynjU8e4Vw3Q==} + + immer@10.0.2: + resolution: {integrity: sha512-Rx3CqeqQ19sxUtYV9CU911Vhy8/721wRFnJv3REVGWUmoAcIwzifTsdmJte/MV+0/XpM35LZdQMBGkRIoLPwQA==} + + immutable@3.7.6: + resolution: {integrity: sha512-AizQPcaofEtO11RZhPPHBOJRdo/20MKQF9mBLnVkBoyHi1/zXK8fzVdnEpSV9gxqtnh6Qomfp3F0xT5qP/vThw==} + engines: {node: '>=0.8.0'} + + immutable@4.3.7: + resolution: {integrity: sha512-1hqclzwYwjRDFLjcFxOM5AYkkG0rpFPpr1RLPMEuGczoS7YA8gLhy8SWXYRAA/XwfEHpfo3cw5JGioS32fnMRw==} + + import-fresh@2.0.0: + resolution: {integrity: sha512-eZ5H8rcgYazHbKC3PG4ClHNykCSxtAhxSSEM+2mb+7evD2CKF5V7c0dNum7AdpDh0ZdICwZY9sRSn8f+KH96sg==} + engines: {node: '>=4'} + + import-fresh@3.3.1: + resolution: {integrity: sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==} + engines: {node: '>=6'} + + import-from@4.0.0: + resolution: {integrity: sha512-P9J71vT5nLlDeV8FHs5nNxaLbrpfAV5cF5srvbZfpwpcJoM/xZR3hiv+q+SAnuSmuGbXMWud063iIMx/V/EWZQ==} + engines: {node: '>=12.2'} + + imul@1.0.1: + resolution: {integrity: sha512-WFAgfwPLAjU66EKt6vRdTlKj4nAgIDQzh29JonLa4Bqtl6D8JrIMvWjCnx7xEjVNmP3U0fM5o8ZObk7d0f62bA==} + engines: {node: '>=0.10.0'} + + imurmurhash@0.1.4: + resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} + engines: {node: '>=0.8.19'} + + indent-string@4.0.0: + resolution: {integrity: sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==} + engines: {node: '>=8'} + + inflection@1.13.4: + resolution: {integrity: sha512-6I/HUDeYFfuNCVS3td055BaXBwKYuzw7K3ExVMStBowKo9oOAMJIXIHvdyR3iboTCp1b+1i5DSkIZTcwIktuDw==} + engines: {'0': node >= 0.4.0} + + inflight@1.0.6: + resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} + deprecated: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. + + inherits@2.0.4: + resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} + + ini@1.3.8: + resolution: {integrity: sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==} + + inquirer@8.0.0: + resolution: {integrity: sha512-ON8pEJPPCdyjxj+cxsYRe6XfCJepTxANdNnTebsTuQgXpRyZRRT9t4dJwjRubgmvn20CLSEnozRUayXyM9VTXA==} + engines: {node: '>=8.0.0'} + + internal-slot@1.1.0: + resolution: {integrity: sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw==} + engines: {node: '>= 0.4'} + + interpret@1.4.0: + resolution: {integrity: sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==} + engines: {node: '>= 0.10'} + + invariant@2.2.4: + resolution: {integrity: sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==} + + invert-kv@1.0.0: + resolution: {integrity: sha512-xgs2NH9AE66ucSq4cNG1nhSFghr5l6tdL15Pk+jl46bmmBapgoaY/AacXyaDznAqmGL99TiLSQgO/XazFSKYeQ==} + engines: {node: '>=0.10.0'} + + io-ts@1.10.4: + resolution: {integrity: sha512-b23PteSnYXSONJ6JQXRAlvJhuw8KOtkqa87W4wDtvMrud/DTJd5X+NpOOI+O/zZwVq6v0VLAaJ+1EDViKEuN9g==} + + ip-regex@4.3.0: + resolution: {integrity: sha512-B9ZWJxHHOHUhUjCPrMpLD4xEq35bUTClHM1S6CBU5ixQnkZmwipwgc96vAd7AAGM9TGHvJR+Uss+/Ak6UphK+Q==} + engines: {node: '>=8'} + + ipaddr.js@1.9.1: + resolution: {integrity: sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==} + engines: {node: '>= 0.10'} + + ipfs-core-utils@0.4.0: + resolution: {integrity: sha512-IBPFvYjWPfVFpCeYUL/0gCUOabdBhh7aO5i4tU//UlF2gVCXPH4PRYlbBH9WM83zE2+o4vDi+dBXsdAI6nLPAg==} + deprecated: js-IPFS has been deprecated in favour of Helia - please see https://github.com/ipfs/js-ipfs/issues/4336 for details + + ipfs-http-client@47.0.1: + resolution: {integrity: sha512-IAQf+uTLvXw5QFOzbyhu/5lH3rn7jEwwwdCGaNKVhoPI7yfyOV0wRse3hVWejjP1Id0P9mKuMKG8rhcY7pVAdQ==} + engines: {node: '>=10.3.0', npm: '>=3.0.0'} + deprecated: js-IPFS has been deprecated in favour of Helia - please see https://github.com/ipfs/js-ipfs/issues/4336 for details + + ipfs-utils@3.0.0: + resolution: {integrity: sha512-qahDc+fghrM57sbySr2TeWjaVR/RH/YEB/hvdAjiTbjESeD87qZawrXwj+19Q2LtGmFGusKNLo5wExeuI5ZfDQ==} + + ipld-block@0.10.1: + resolution: {integrity: sha512-lPMfW9tA2hVZw9hdO/YSppTxFmA0+5zxcefBOlCTOn+12RLyy+pdepKMbQw8u0KESFu3pYVmabNRWuFGcgHLLw==} + engines: {node: '>=6.0.0', npm: '>=3.0.0'} + + ipld-dag-cbor@0.17.1: + resolution: {integrity: sha512-Bakj/cnxQBdscORyf4LRHxQJQfoaY8KWc7PWROQgX+aw5FCzBt8ga0VM/59K+ABOznsqNvyLR/wz/oYImOpXJw==} + engines: {node: '>=6.0.0', npm: '>=3.0.0'} + deprecated: This module has been superseded by @ipld/dag-cbor and multiformats + + ipld-dag-pb@0.20.0: + resolution: {integrity: sha512-zfM0EdaolqNjAxIrtpuGKvXxWk5YtH9jKinBuQGTcngOsWFQhyybGCTJHGNGGtRjHNJi2hz5Udy/8pzv4kcKyg==} + engines: {node: '>=6.0.0', npm: '>=3.0.0'} + deprecated: This module has been superseded by @ipld/dag-pb and multiformats + + ipld-raw@6.0.0: + resolution: {integrity: sha512-UK7fjncAzs59iu/o2kwYtb8jgTtW6B+cNWIiNpAJkfRwqoMk1xD/6i25ktzwe4qO8gQgoR9RxA5ibC23nq8BLg==} + deprecated: This module has been superseded by the multiformats module + + is-absolute@1.0.0: + resolution: {integrity: sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==} + engines: {node: '>=0.10.0'} + + is-accessor-descriptor@1.0.1: + resolution: {integrity: sha512-YBUanLI8Yoihw923YeFUS5fs0fF2f5TSFTNiYAAzhhDscDa3lEqYuz1pDOEP5KvX94I9ey3vsqjJcLVFVU+3QA==} + engines: {node: '>= 0.10'} + + is-arguments@1.2.0: + resolution: {integrity: sha512-7bVbi0huj/wrIAOzb8U1aszg9kdi3KN/CyU19CTI7tAoZYEZoL9yCDXpbXN+uPsuWnP02cyug1gleqq+TU+YCA==} + engines: {node: '>= 0.4'} + + is-array-buffer@3.0.5: + resolution: {integrity: sha512-DDfANUiiG2wC1qawP66qlTugJeL5HyzMpfr8lLK+jMQirGzNod0B12cFB/9q838Ru27sBwfw78/rdoU7RERz6A==} + engines: {node: '>= 0.4'} + + is-arrayish@0.2.1: + resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==} + + is-arrayish@0.3.2: + resolution: {integrity: sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==} + + is-async-function@2.1.1: + resolution: {integrity: sha512-9dgM/cZBnNvjzaMYHVoxxfPj2QXt22Ev7SuuPrs+xav0ukGB0S6d4ydZdEiM48kLx5kDV+QBPrpVnFyefL8kkQ==} + engines: {node: '>= 0.4'} + + is-bigint@1.1.0: + resolution: {integrity: sha512-n4ZT37wG78iz03xPRKJrHTdZbe3IicyucEtdRsV5yglwc3GyUfbAfpSeD0FJ41NbUNSt5wbhqfp1fS+BgnvDFQ==} + engines: {node: '>= 0.4'} + + is-binary-path@1.0.1: + resolution: {integrity: sha512-9fRVlXc0uCxEDj1nQzaWONSpbTfx0FmJfzHF7pwlI8DkWGoHBBea4Pg5Ky0ojwwxQmnSifgbKkI06Qv0Ljgj+Q==} + engines: {node: '>=0.10.0'} + + is-binary-path@2.1.0: + resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==} + engines: {node: '>=8'} + + is-boolean-object@1.2.2: + resolution: {integrity: sha512-wa56o2/ElJMYqjCjGkXri7it5FbebW5usLw/nPmCMs5DeZ7eziSYZhSmPRn0txqeW4LnAmQQU7FgqLpsEFKM4A==} + engines: {node: '>= 0.4'} + + is-buffer@1.1.6: + resolution: {integrity: sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==} + + is-buffer@2.0.5: + resolution: {integrity: sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==} + engines: {node: '>=4'} + + is-callable@1.2.7: + resolution: {integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==} + engines: {node: '>= 0.4'} + + is-ci@2.0.0: + resolution: {integrity: sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==} + hasBin: true + + is-circular@1.0.2: + resolution: {integrity: sha512-YttjnrswnUYRVJvxCvu8z+PGMUSzC2JttP0OEXezlAEdp3EXzhf7IZ3j0gRAybJBQupedIZFhY61Tga6E0qASA==} + + is-core-module@2.16.1: + resolution: {integrity: sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==} + engines: {node: '>= 0.4'} + + is-data-descriptor@1.0.1: + resolution: {integrity: sha512-bc4NlCDiCr28U4aEsQ3Qs2491gVq4V8G7MQyws968ImqjKuYtTJXrl7Vq7jsN7Ly/C3xj5KWFrY7sHNeDkAzXw==} + engines: {node: '>= 0.4'} + + is-data-view@1.0.2: + resolution: {integrity: sha512-RKtWF8pGmS87i2D6gqQu/l7EYRlVdfzemCJN/P3UOs//x1QE7mfhvzHIApBTRf7axvT6DMGwSwBXYCT0nfB9xw==} + engines: {node: '>= 0.4'} + + is-date-object@1.1.0: + resolution: {integrity: sha512-PwwhEakHVKTdRNVOw+/Gyh0+MzlCl4R6qKvkhuvLtPMggI1WAHt9sOwZxQLSGpUaDnrdyDsomoRgNnCfKNSXXg==} + engines: {node: '>= 0.4'} + + is-descriptor@0.1.7: + resolution: {integrity: sha512-C3grZTvObeN1xud4cRWl366OMXZTj0+HGyk4hvfpx4ZHt1Pb60ANSXqCK7pdOTeUQpRzECBSTphqvD7U+l22Eg==} + engines: {node: '>= 0.4'} + + is-descriptor@1.0.3: + resolution: {integrity: sha512-JCNNGbwWZEVaSPtS45mdtrneRWJFp07LLmykxeFV5F6oBvNF8vHSfJuJgoT472pSfk+Mf8VnlrspaFBHWM8JAw==} + engines: {node: '>= 0.4'} + + is-directory@0.3.1: + resolution: {integrity: sha512-yVChGzahRFvbkscn2MlwGismPO12i9+znNruC5gVEntG3qu0xQMzsGg/JFbrsqDOHtHFPci+V5aP5T9I+yeKqw==} + engines: {node: '>=0.10.0'} + + is-docker@2.2.1: + resolution: {integrity: sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==} + engines: {node: '>=8'} + hasBin: true + + is-dotfile@1.0.3: + resolution: {integrity: sha512-9YclgOGtN/f8zx0Pr4FQYMdibBiTaH3sn52vjYip4ZSf6C4/6RfTEZ+MR4GvKhCxdPh21Bg42/WL55f6KSnKpg==} + engines: {node: '>=0.10.0'} + + is-electron@2.2.2: + resolution: {integrity: sha512-FO/Rhvz5tuw4MCWkpMzHFKWD2LsfHzIb7i6MdPYZ/KW7AlxawyLkqdy+jPZP1WubqEADE3O4FUENlJHDfQASRg==} + + is-equal-shallow@0.1.3: + resolution: {integrity: sha512-0EygVC5qPvIyb+gSz7zdD5/AAoS6Qrx1e//6N4yv4oNm30kqvdmG66oZFWVlQHUWe5OjP08FuTw2IdT0EOTcYA==} + engines: {node: '>=0.10.0'} + + is-extendable@0.1.1: + resolution: {integrity: sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==} + engines: {node: '>=0.10.0'} + + is-extendable@1.0.1: + resolution: {integrity: sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==} + engines: {node: '>=0.10.0'} + + is-extglob@1.0.0: + resolution: {integrity: sha512-7Q+VbVafe6x2T+Tu6NcOf6sRklazEPmBoB3IWk3WdGZM2iGUwU/Oe3Wtq5lSEkDTTlpp8yx+5t4pzO/i9Ty1ww==} + engines: {node: '>=0.10.0'} + + is-extglob@2.1.1: + resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} + engines: {node: '>=0.10.0'} + + is-finalizationregistry@1.1.1: + resolution: {integrity: sha512-1pC6N8qWJbWoPtEjgcL2xyhQOP491EQjeUo3qTKcmV8YSDDJrOepfG8pcC7h/QgnQHYSv0mJ3Z/ZWxmatVrysg==} + engines: {node: '>= 0.4'} + + is-finite@1.1.0: + resolution: {integrity: sha512-cdyMtqX/BOqqNBBiKlIVkytNHm49MtMlYyn1zxzvJKWmFMlGzm+ry5BBfYyeY9YmNKbRSo/o7OX9w9ale0wg3w==} + engines: {node: '>=0.10.0'} + + is-fn@1.0.0: + resolution: {integrity: sha512-XoFPJQmsAShb3jEQRfzf2rqXavq7fIqF/jOekp308JlThqrODnMpweVSGilKTCXELfLhltGP2AGgbQGVP8F1dg==} + engines: {node: '>=0.10.0'} + + is-fullwidth-code-point@1.0.0: + resolution: {integrity: sha512-1pqUqRjkhPJ9miNq9SwMfdvi6lBJcd6eFxvfaivQhaH3SgisfiuudvFntdKOmxuee/77l+FPjKrQjWvmPjWrRw==} + engines: {node: '>=0.10.0'} + + is-fullwidth-code-point@2.0.0: + resolution: {integrity: sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==} + engines: {node: '>=4'} + + is-fullwidth-code-point@3.0.0: + resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} + engines: {node: '>=8'} + + is-fullwidth-code-point@4.0.0: + resolution: {integrity: sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==} + engines: {node: '>=12'} + + is-fullwidth-code-point@5.0.0: + resolution: {integrity: sha512-OVa3u9kkBbw7b8Xw5F9P+D/T9X+Z4+JruYVNapTjPYZYUznQ5YfWeFkOj606XYYW8yugTfC8Pj0hYqvi4ryAhA==} + engines: {node: '>=18'} + + is-function@1.0.2: + resolution: {integrity: sha512-lw7DUp0aWXYg+CBCN+JKkcE0Q2RayZnSvnZBlwgxHBQhqt5pZNVy4Ri7H9GmmXkdu7LUthszM+Tor1u/2iBcpQ==} + + is-generator-function@1.1.0: + resolution: {integrity: sha512-nPUB5km40q9e8UfN/Zc24eLlzdSf9OfKByBw9CIdw4H1giPMeA0OIJvbchsCu4npfI2QcMVBsGEBHKZ7wLTWmQ==} + engines: {node: '>= 0.4'} + + is-glob@2.0.1: + resolution: {integrity: sha512-a1dBeB19NXsf/E0+FHqkagizel/LQw2DjSQpvQrj3zT+jYPpaUCryPnrQajXKFLCMuf4I6FhRpaGtw4lPrG6Eg==} + engines: {node: '>=0.10.0'} + + is-glob@4.0.3: + resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} + engines: {node: '>=0.10.0'} + + is-hex-prefixed@1.0.0: + resolution: {integrity: sha512-WvtOiug1VFrE9v1Cydwm+FnXd3+w9GaeVUss5W4v/SLy3UW00vP+6iNF2SdnfiBoLy4bTqVdkftNGTUeOFVsbA==} + engines: {node: '>=6.5.0', npm: '>=3'} + + is-ip@3.1.0: + resolution: {integrity: sha512-35vd5necO7IitFPjd/YBeqwWnyDWbuLH9ZXQdMfDA8TEo7pv5X8yfrvVO3xbJbLUlERCMvf6X0hTUamQxCYJ9Q==} + engines: {node: '>=8'} + + is-lower-case@2.0.2: + resolution: {integrity: sha512-bVcMJy4X5Og6VZfdOZstSexlEy20Sr0k/p/b2IlQJlfdKAQuMpiv5w2Ccxb8sKdRUNAG1PnHVHjFSdRDVS6NlQ==} + + is-map@2.0.3: + resolution: {integrity: sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw==} + engines: {node: '>= 0.4'} + + is-number-object@1.1.1: + resolution: {integrity: sha512-lZhclumE1G6VYD8VHe35wFaIif+CTy5SJIi5+3y4psDgWu4wPDoBhF8NxUOinEc7pHgiTsT6MaBb92rKhhD+Xw==} + engines: {node: '>= 0.4'} + + is-number@2.1.0: + resolution: {integrity: sha512-QUzH43Gfb9+5yckcrSA0VBDwEtDUchrk4F6tfJZQuNzDJbEDB9cZNzSfXGQ1jqmdDY/kl41lUOWM9syA8z8jlg==} + engines: {node: '>=0.10.0'} + + is-number@3.0.0: + resolution: {integrity: sha512-4cboCqIpliH+mAvFNegjZQ4kgKc3ZUhQVr3HvWbSh5q3WH2v82ct+T2Y1hdU5Gdtorx/cLifQjqCbL7bpznLTg==} + engines: {node: '>=0.10.0'} + + is-number@4.0.0: + resolution: {integrity: sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==} + engines: {node: '>=0.10.0'} + + is-number@7.0.0: + resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} + engines: {node: '>=0.12.0'} + + is-obj@1.0.1: + resolution: {integrity: sha512-l4RyHgRqGN4Y3+9JHVrNqO+tN0rV5My76uW5/nuO4K1b6vw5G8d/cmFjP9tRfEsdhZNt0IFdZuK/c2Vr4Nb+Qg==} + engines: {node: '>=0.10.0'} + + is-obj@2.0.0: + resolution: {integrity: sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==} + engines: {node: '>=8'} + + is-path-inside@3.0.3: + resolution: {integrity: sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==} + engines: {node: '>=8'} + + is-plain-obj@1.1.0: + resolution: {integrity: sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==} + engines: {node: '>=0.10.0'} + + is-plain-obj@2.1.0: + resolution: {integrity: sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==} + engines: {node: '>=8'} + + is-plain-object@2.0.4: + resolution: {integrity: sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==} + engines: {node: '>=0.10.0'} + + is-posix-bracket@0.1.1: + resolution: {integrity: sha512-Yu68oeXJ7LeWNmZ3Zov/xg/oDBnBK2RNxwYY1ilNJX+tKKZqgPK+qOn/Gs9jEu66KDY9Netf5XLKNGzas/vPfQ==} + engines: {node: '>=0.10.0'} + + is-primitive@2.0.0: + resolution: {integrity: sha512-N3w1tFaRfk3UrPfqeRyD+GYDASU3W5VinKhlORy8EWVf/sIdDL9GAcew85XmktCfH+ngG7SRXEVDoO18WMdB/Q==} + engines: {node: '>=0.10.0'} + + is-regex@1.1.4: + resolution: {integrity: sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==} + engines: {node: '>= 0.4'} + + is-regex@1.2.1: + resolution: {integrity: sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==} + engines: {node: '>= 0.4'} + + is-regexp@1.0.0: + resolution: {integrity: sha512-7zjFAPO4/gwyQAAgRRmqeEeyIICSdmCqa3tsVHMdBzaXXRiqopZL4Cyghg/XulGWrtABTpbnYYzzIRffLkP4oA==} + engines: {node: '>=0.10.0'} + + is-relative@1.0.0: + resolution: {integrity: sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==} + engines: {node: '>=0.10.0'} + + is-set@2.0.3: + resolution: {integrity: sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg==} + engines: {node: '>= 0.4'} + + is-shared-array-buffer@1.0.4: + resolution: {integrity: sha512-ISWac8drv4ZGfwKl5slpHG9OwPNty4jOWPRIhBpxOoD+hqITiwuipOQ2bNthAzwA3B4fIjO4Nln74N0S9byq8A==} + engines: {node: '>= 0.4'} + + is-stream@1.1.0: + resolution: {integrity: sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ==} + engines: {node: '>=0.10.0'} + + is-stream@2.0.1: + resolution: {integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==} + engines: {node: '>=8'} + + is-stream@3.0.0: + resolution: {integrity: sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + + is-string@1.1.1: + resolution: {integrity: sha512-BtEeSsoaQjlSPBemMQIrY1MY0uM6vnS1g5fmufYOtnxLGUZM2178PKbhsk7Ffv58IX+ZtcvoGwccYsh0PglkAA==} + engines: {node: '>= 0.4'} + + is-subdir@1.2.0: + resolution: {integrity: sha512-2AT6j+gXe/1ueqbW6fLZJiIw3F8iXGJtt0yDrZaBhAZEG1raiTxKWU+IPqMCzQAXOUCKdA4UDMgacKH25XG2Cw==} + engines: {node: '>=4'} + + is-symbol@1.1.1: + resolution: {integrity: sha512-9gGx6GTtCQM73BgmHQXfDmLtfjjTUDSyoxTCbp5WtoixAhfgsDirWIcVQ/IHpvI5Vgd5i/J5F7B9cN/WlVbC/w==} + engines: {node: '>= 0.4'} + + is-text-path@1.0.1: + resolution: {integrity: sha512-xFuJpne9oFz5qDaodwmmG08e3CawH/2ZV8Qqza1Ko7Sk8POWbkRdwIoAWVhqvq0XeUzANEhKo2n0IXUGBm7A/w==} + engines: {node: '>=0.10.0'} + + is-text-path@2.0.0: + resolution: {integrity: sha512-+oDTluR6WEjdXEJMnC2z6A4FRwFoYuvShVVEGsS7ewc0UTi2QtAKMDJuL4BDEVt+5T7MjFo12RP8ghOM75oKJw==} + engines: {node: '>=8'} + + is-typed-array@1.1.15: + resolution: {integrity: sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ==} + engines: {node: '>= 0.4'} + + is-typedarray@1.0.0: + resolution: {integrity: sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==} + + is-unc-path@1.0.0: + resolution: {integrity: sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==} + engines: {node: '>=0.10.0'} + + is-unicode-supported@0.1.0: + resolution: {integrity: sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==} + engines: {node: '>=10'} + + is-upper-case@2.0.2: + resolution: {integrity: sha512-44pxmxAvnnAOwBg4tHPnkfvgjPwbc5QIsSstNU+YcJ1ovxVzCWpSGosPJOZh/a1tdl81fbgnLc9LLv+x2ywbPQ==} + + is-url@1.2.4: + resolution: {integrity: sha512-ITvGim8FhRiYe4IQ5uHSkj7pVaPDrCTkNd3yq3cV7iZAcJdHTUMPMEHcqSOy9xZ9qFenQCvi+2wjH9a1nXqHww==} + + is-utf8@0.2.1: + resolution: {integrity: sha512-rMYPYvCzsXywIsldgLaSoPlw5PfoB/ssr7hY4pLfcodrA5M/eArza1a9VmTiNIBNMjOGr1Ow9mTyU2o69U6U9Q==} + + is-weakmap@2.0.2: + resolution: {integrity: sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w==} + engines: {node: '>= 0.4'} + + is-weakref@1.1.1: + resolution: {integrity: sha512-6i9mGWSlqzNMEqpCp93KwRS1uUOodk2OJ6b+sq7ZPDSy2WuI5NFIxp/254TytR8ftefexkWn5xNiHUNpPOfSew==} + engines: {node: '>= 0.4'} + + is-weakset@2.0.4: + resolution: {integrity: sha512-mfcwb6IzQyOKTs84CQMrOwW4gQcaTOAWJ0zzJCl2WSPDrWk/OzDaImWFH3djXhb24g4eudZfLRozAvPGw4d9hQ==} + engines: {node: '>= 0.4'} + + is-windows@1.0.2: + resolution: {integrity: sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==} + engines: {node: '>=0.10.0'} + + is-wsl@2.2.0: + resolution: {integrity: sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==} + engines: {node: '>=8'} + + isarray@0.0.1: + resolution: {integrity: sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==} + + isarray@1.0.0: + resolution: {integrity: sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==} + + isarray@2.0.5: + resolution: {integrity: sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==} + + isexe@2.0.0: + resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} + + iso-constants@0.1.2: + resolution: {integrity: sha512-OTCM5ZCQsHBCI4Wdu4tSxvDIkmDHd5EwJDps5mKqnQnWJSKlnwMs3EDZ4n3Fh1tmkWkDlyd2vCDbEYuPbyrUNQ==} + engines: {node: '>=10'} + + iso-url@0.4.7: + resolution: {integrity: sha512-27fFRDnPAMnHGLq36bWTpKET+eiXct3ENlCcdcMdk+mjXrb2kw3mhBUg1B7ewAC0kVzlOPhADzQgz1SE6Tglog==} + engines: {node: '>=10'} + + isobject@2.1.0: + resolution: {integrity: sha512-+OUdGJlgjOBZDfxnDjYYG6zp487z0JGNQq3cYQYg5f5hKR+syHMsaztzGeml/4kGG55CSpKSpWTY+jYGgsHLgA==} + engines: {node: '>=0.10.0'} + + isobject@3.0.1: + resolution: {integrity: sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==} + engines: {node: '>=0.10.0'} + + isomorphic-fetch@3.0.0: + resolution: {integrity: sha512-qvUtwJ3j6qwsF3jLxkZ72qCgjMysPzDfeV240JHiGZsANBYd+EEuu35v7dfrJ9Up0Ak07D7GGSkGhCHTqg/5wA==} + + isomorphic-unfetch@3.1.0: + resolution: {integrity: sha512-geDJjpoZ8N0kWexiwkX8F9NkTsXhetLPVbZFQ+JTW239QNOwvB0gniuR1Wc6f0AMTn7/mFGyXvHTifrCp/GH8Q==} + + isomorphic-ws@5.0.0: + resolution: {integrity: sha512-muId7Zzn9ywDsyXgTIafTry2sV3nySZeUDe6YedVd1Hvuuep5AsIlqK+XefWpYTyJG5e503F2xIuT2lcU6rCSw==} + peerDependencies: + ws: '*' + + isstream@0.1.2: + resolution: {integrity: sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==} + + istanbul-lib-coverage@3.2.2: + resolution: {integrity: sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==} + engines: {node: '>=8'} + + istanbul-lib-instrument@5.2.1: + resolution: {integrity: sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==} + engines: {node: '>=8'} + + it-all@1.0.6: + resolution: {integrity: sha512-3cmCc6Heqe3uWi3CVM/k51fa/XbMFpQVzFoDsV0IZNHSQDyAXl3c4MjHkFX5kF3922OGj7Myv1nSEUgRtcuM1A==} + + it-concat@1.0.3: + resolution: {integrity: sha512-sjeZQ1BWQ9U/W2oI09kZgUyvSWzQahTkOkLIsnEPgyqZFaF9ME5gV6An4nMjlyhXKWQMKEakQU8oRHs2SdmeyA==} + + it-glob@0.0.8: + resolution: {integrity: sha512-PmIAgb64aJPM6wwT1UTlNDAJnNgdGrvr0vRr3AYCngcUuq1KaAovuz0dQAmUkaXudDG3EQzc7OttuLW9DaL3YQ==} + + it-last@1.0.6: + resolution: {integrity: sha512-aFGeibeiX/lM4bX3JY0OkVCFkAw8+n9lkukkLNivbJRvNz8lI3YXv5xcqhFUV2lDJiraEK3OXRDbGuevnnR67Q==} + + it-map@1.0.6: + resolution: {integrity: sha512-XT4/RM6UHIFG9IobGlQPFQUrlEKkU4eBUFG3qhWhfAdh1JfF2x11ShCrKCdmZ0OiZppPfoLuzcfA4cey6q3UAQ==} + + it-peekable@0.0.1: + resolution: {integrity: sha512-fd0JzbNldseeq+FFWthbqYB991UpKNyjPG6LqFhIOmJviCxSompMyoopKIXvLPLY+fBhhv2CT5PT31O/lEnTHw==} + + it-reader@2.1.0: + resolution: {integrity: sha512-hSysqWTO9Tlwc5EGjVf8JYZzw0D2FsxD/g+eNNWrez9zODxWt6QlN6JAMmycK72Mv4jHEKEXoyzUN4FYGmJaZw==} + + it-tar@1.2.2: + resolution: {integrity: sha512-M8V4a9I+x/vwXTjqvixcEZbQZHjwDIb8iUQ+D4M2QbhAdNs3WKVSl+45u5/F2XFx6jYMFOGzMVlKNK/uONgNIA==} + + it-to-buffer@1.0.5: + resolution: {integrity: sha512-dczvg0VeXkfr2i2IQ3GGWEATBbk4Uggr+YnvBz76/Yp0zFJZTIOeDCz2KyFDxSDHNI62OlldbJXWmDPb5nFQeg==} + + it-to-stream@0.1.2: + resolution: {integrity: sha512-DTB5TJRZG3untmZehcaFN0kGWl2bNv7tnJRgQHAO9QEt8jfvVRrebZtnD5NZd4SCj4WVPjl0LSrugNWE/UaZRQ==} + + jackspeak@3.4.3: + resolution: {integrity: sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==} + + jackspeak@4.1.0: + resolution: {integrity: sha512-9DDdhb5j6cpeitCbvLO7n7J4IxnbM6hoF6O1g4HQ5TfhvvKN8ywDM7668ZhMHRqVmxqhps/F6syWK2KcPxYlkw==} + engines: {node: 20 || >=22} + + jest-environment-node@29.7.0: + resolution: {integrity: sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest-get-type@29.6.3: + resolution: {integrity: sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest-haste-map@29.7.0: + resolution: {integrity: sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest-message-util@29.7.0: + resolution: {integrity: sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest-mock@29.7.0: + resolution: {integrity: sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest-regex-util@29.6.3: + resolution: {integrity: sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest-util@29.7.0: + resolution: {integrity: sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest-validate@29.7.0: + resolution: {integrity: sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest-worker@29.7.0: + resolution: {integrity: sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jiti@1.21.7: + resolution: {integrity: sha512-/imKNG4EbWNrVjoNC/1H5/9GFy+tqjGBHCaSsN+P2RnPqjsLmv6UD3Ej+Kj8nBWaRAwyk7kK5ZUc+OEatnTR3A==} + hasBin: true + + js-cookie@2.2.1: + resolution: {integrity: sha512-HvdH2LzI/EAZcUwA8+0nKNtWHqS+ZmijLA30RwZA0bo7ToCckjK5MkGhjED9KoRcXO6BaGI3I9UIzSA1FKFPOQ==} + + js-sdsl@4.4.2: + resolution: {integrity: sha512-dwXFwByc/ajSV6m5bcKAPwe4yDDF6D614pxmIi5odytzxRlwqF6nwoiCek80Ixc7Cvma5awClxrzFtxCQvcM8w==} + + js-sha3@0.5.7: + resolution: {integrity: sha512-GII20kjaPX0zJ8wzkTbNDYMY7msuZcTWk8S5UOh6806Jq/wz1J8/bnr8uGU0DAUmYDjj2Mr4X1cW8v/GLYnR+g==} + + js-sha3@0.8.0: + resolution: {integrity: sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==} + + js-string-escape@1.0.1: + resolution: {integrity: sha512-Smw4xcfIQ5LVjAOuJCvN/zIodzA/BBSsluuoSykP+lUvScIi4U6RJLfwHet5cxFnCswUjISV8oAXaqaJDY3chg==} + engines: {node: '>= 0.8'} + + js-tokens@3.0.2: + resolution: {integrity: sha512-RjTcuD4xjtthQkaWH7dFlH85L+QaVtSoOyGdZ3g6HFhS9dFNDfLyqgm2NFe2X6cQpeFmt0452FJjFG5UameExg==} + + js-tokens@4.0.0: + resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} + + js-yaml@3.14.1: + resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==} + hasBin: true + + js-yaml@4.1.0: + resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} + hasBin: true + + jsbn@0.1.1: + resolution: {integrity: sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==} + + jsc-safe-url@0.2.4: + resolution: {integrity: sha512-0wM3YBWtYePOjfyXQH5MWQ8H7sdk5EXSwZvmSLKk2RboVQ2Bu239jycHDz5J/8Blf3K0Qnoy2b6xD+z10MFB+Q==} + + jsel@1.1.6: + resolution: {integrity: sha512-7E6r8kVzjmKhwXR/82Z+43edfOJGRvLvx6cJZ+SS2MGAPPtYZGnaIsFHpQMA1IbIPA9twDProkob4IIAJ0ZqSw==} + engines: {node: '>=0.10.0'} + + jsesc@0.5.0: + resolution: {integrity: sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA==} + hasBin: true + + jsesc@1.3.0: + resolution: {integrity: sha512-Mke0DA0QjUWuJlhsE0ZPPhYiJkRap642SmI/4ztCFaUs6V2AiH1sfecc+57NgaryfAA2VR3v6O+CSjC1jZJKOA==} + hasBin: true + + jsesc@3.1.0: + resolution: {integrity: sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==} + engines: {node: '>=6'} + hasBin: true + + json-bigint-patch@0.0.8: + resolution: {integrity: sha512-xa0LTQsyaq8awYyZyuUsporWisZFiyqzxGW8CKM3t7oouf0GFAKYJnqAm6e9NLNBQOCtOLvy614DEiRX/rPbnA==} + + json-buffer@3.0.0: + resolution: {integrity: sha512-CuUqjv0FUZIdXkHPI8MezCnFCdaTAacej1TZYulLoAg1h/PhwkdXFN4V/gzY4g+fMBCOV2xF+rp7t2XD2ns/NQ==} + + json-buffer@3.0.1: + resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==} + + json-parse-better-errors@1.0.2: + resolution: {integrity: sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==} + + json-parse-even-better-errors@2.3.1: + resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==} + + json-pointer@0.6.2: + resolution: {integrity: sha512-vLWcKbOaXlO+jvRy4qNd+TI1QUPZzfJj1tpJ3vAXDych5XJf93ftpUKe5pKCrzyIIwgBJcOcCVRUfqQP25afBw==} + + json-rpc-engine@3.8.0: + resolution: {integrity: sha512-6QNcvm2gFuuK4TKU1uwfH0Qd/cOSb9c1lls0gbnIhciktIUQJwz6NQNAW4B1KiGPenv7IKu97V222Yo1bNhGuA==} + + json-rpc-error@2.0.0: + resolution: {integrity: sha512-EwUeWP+KgAZ/xqFpaP6YDAXMtCJi+o/QQpCQFIYyxr01AdADi2y413eM8hSqJcoQym9WMePAJWoaODEJufC4Ug==} + + json-rpc-random-id@1.0.1: + resolution: {integrity: sha512-RJ9YYNCkhVDBuP4zN5BBtYAzEl03yq/jIIsyif0JY9qyJuQQZNeDK7anAPKKlyEtLSj2s8h6hNh2F8zO5q7ScA==} + + json-schema-to-ts@2.12.0: + resolution: {integrity: sha512-uTde38yBm5lzJSRPWRaasxZo72pb+JGE4iUksNdNfAkFaLhV4N9akeBxPPUpZy5onINt9Zo0oTLrAoEXyZESiQ==} + engines: {node: '>=16'} + + json-schema-traverse@0.3.1: + resolution: {integrity: sha512-4JD/Ivzg7PoW8NzdrBSr3UFwC9mHgvI7Z6z3QGBsSHgKaRTUDmyZAAKJo2UbG1kUVfS9WS8bi36N49U1xw43DA==} + + json-schema-traverse@0.4.1: + resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} + + json-schema-traverse@1.0.0: + resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==} + + json-schema@0.4.0: + resolution: {integrity: sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==} + + json-stable-stringify-without-jsonify@1.0.1: + resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} + + json-stable-stringify@1.3.0: + resolution: {integrity: sha512-qtYiSSFlwot9XHtF9bD9c7rwKjr+RecWT//ZnPvSmEjpV5mmPOCN4j8UjY5hbjNkOwZ/jQv3J6R1/pL7RwgMsg==} + engines: {node: '>= 0.4'} + + json-stream-stringify@3.1.6: + resolution: {integrity: sha512-x7fpwxOkbhFCaJDJ8vb1fBY3DdSa4AlITaz+HHILQJzdPMnHEFjxPwVUi1ALIbcIxDE0PNe/0i7frnY8QnBQog==} + engines: {node: '>=7.10.1'} + + json-stringify-safe@5.0.1: + resolution: {integrity: sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==} + + json-text-sequence@0.1.1: + resolution: {integrity: sha512-L3mEegEWHRekSHjc7+sc8eJhba9Clq1PZ8kMkzf8OxElhXc8O4TS5MwcVlj9aEbm5dr81N90WHC5nAz3UO971w==} + + json5@0.5.1: + resolution: {integrity: sha512-4xrs1aW+6N5DalkqSVA8fxh458CXvR99WU8WLKmq4v8eWAL86Xo3BVqyd3SkA9wEVjCMqyvvRRkshAdOnBp5rw==} + hasBin: true + + json5@2.2.3: + resolution: {integrity: sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==} + engines: {node: '>=6'} + hasBin: true + + jsonfile@2.4.0: + resolution: {integrity: sha512-PKllAqbgLgxHaj8TElYymKCAgrASebJrWpTnEkOaTowt23VKXXN0sUeriJ+eh7y6ufb/CC5ap11pz71/cM0hUw==} + + jsonfile@4.0.0: + resolution: {integrity: sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==} + + jsonfile@6.1.0: + resolution: {integrity: sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==} + + jsonify@0.0.1: + resolution: {integrity: sha512-2/Ki0GcmuqSrgFyelQq9M05y7PS0mEwuIzrf3f1fPqkVDVRvZrPZtVSMHxdgo8Aq0sxAOb/cr2aqqA3LeWHVPg==} + + jsonparse@1.3.1: + resolution: {integrity: sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg==} + engines: {'0': node >= 0.2.0} + + jsonschema@1.5.0: + resolution: {integrity: sha512-K+A9hhqbn0f3pJX17Q/7H6yQfD/5OXgdrR5UE12gMXCiN9D5Xq2o5mddV2QEcX/bjla99ASsAAQUyMCCRWAEhw==} + + jsprim@1.4.2: + resolution: {integrity: sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==} + engines: {node: '>=0.6.0'} + + keccak@3.0.4: + resolution: {integrity: sha512-3vKuW0jV8J3XNTzvfyicFR5qvxrSAGl7KIhvgOu5cmWwM7tZRj3fMbj/pfIf4be7aznbc+prBWGjywox/g2Y6Q==} + engines: {node: '>=10.0.0'} + + keyv@3.1.0: + resolution: {integrity: sha512-9ykJ/46SN/9KPM/sichzQ7OvXyGDYKGTaDlKMGCAlg2UK8KRy4jb0d8sFc+0Tt0YYnThq8X2RZgCg74RPxgcVA==} + + keyv@4.5.4: + resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==} + + kind-of@3.2.2: + resolution: {integrity: sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==} + engines: {node: '>=0.10.0'} + + kind-of@4.0.0: + resolution: {integrity: sha512-24XsCxmEbRwEDbz/qz3stgin8TTzZ1ESR56OMCN0ujYg+vRutNSiOj9bHH9u85DKgXguraugV5sFuvbD4FW/hw==} + engines: {node: '>=0.10.0'} + + kind-of@6.0.3: + resolution: {integrity: sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==} + engines: {node: '>=0.10.0'} + + klaw-sync@6.0.0: + resolution: {integrity: sha512-nIeuVSzdCCs6TDPTqI8w1Yre34sSq7AkZ4B3sfOBbI2CgVSB4Du4aLQijFU2+lhAFCwt9+42Hel6lQNIv6AntQ==} + + klaw@1.3.1: + resolution: {integrity: sha512-TED5xi9gGQjGpNnvRWknrwAB1eL5GciPfVFOt3Vk1OJCVDQbzuSfrF3hkUQKlsgKrG1F+0t5W0m+Fje1jIt8rw==} + + kleur@3.0.3: + resolution: {integrity: sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==} + engines: {node: '>=6'} + + kuler@2.0.0: + resolution: {integrity: sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A==} + + latest-version@7.0.0: + resolution: {integrity: sha512-KvNT4XqAMzdcL6ka6Tl3i2lYeFDgXNCuIX+xNx6ZMVR1dFq+idXd9FLKNMOIx0t9mJ9/HudyX4oZWXZQ0UJHeg==} + engines: {node: '>=14.16'} + + lcid@1.0.0: + resolution: {integrity: sha512-YiGkH6EnGrDGqLMITnGjXtGmNtjoXw9SVUzcaos8RBi7Ps0VBylkq+vOcY9QE5poLasPCR849ucFUkl0UzUyOw==} + engines: {node: '>=0.10.0'} + + level-codec@7.0.1: + resolution: {integrity: sha512-Ua/R9B9r3RasXdRmOtd+t9TCOEIIlts+TN/7XTT2unhDaL6sJn83S3rUyljbr6lVtw49N3/yA0HHjpV6Kzb2aQ==} + deprecated: Superseded by level-transcoder (https://github.com/Level/community#faq) + + level-codec@9.0.2: + resolution: {integrity: sha512-UyIwNb1lJBChJnGfjmO0OR+ezh2iVu1Kas3nvBS/BzGnx79dv6g7unpKIDNPMhfdTEGoc7mC8uAu51XEtX+FHQ==} + engines: {node: '>=6'} + deprecated: Superseded by level-transcoder (https://github.com/Level/community#faq) + + level-errors@1.0.5: + resolution: {integrity: sha512-/cLUpQduF6bNrWuAC4pwtUKA5t669pCsCi2XbmojG2tFeOr9j6ShtdDCtFFQO1DRt+EVZhx9gPzP9G2bUaG4ig==} + deprecated: Superseded by abstract-level (https://github.com/Level/community#faq) + + level-errors@2.0.1: + resolution: {integrity: sha512-UVprBJXite4gPS+3VznfgDSU8PTRuVX0NXwoWW50KLxd2yw4Y1t2JUR5In1itQnudZqRMT9DlAM3Q//9NCjCFw==} + engines: {node: '>=6'} + deprecated: Superseded by abstract-level (https://github.com/Level/community#faq) + + level-iterator-stream@1.3.1: + resolution: {integrity: sha512-1qua0RHNtr4nrZBgYlpV0qHHeHpcRRWTxEZJ8xsemoHAXNL5tbooh4tPEEqIqsbWCAJBmUmkwYK/sW5OrFjWWw==} + + level-iterator-stream@2.0.3: + resolution: {integrity: sha512-I6Heg70nfF+e5Y3/qfthJFexhRw/Gi3bIymCoXAlijZdAcLaPuWSJs3KXyTYf23ID6g0o2QF62Yh+grOXY3Rig==} + engines: {node: '>=4'} + + level-iterator-stream@3.0.1: + resolution: {integrity: sha512-nEIQvxEED9yRThxvOrq8Aqziy4EGzrxSZK+QzEFAVuJvQ8glfyZ96GB6BoI4sBbLfjMXm2w4vu3Tkcm9obcY0g==} + engines: {node: '>=6'} + + level-mem@3.0.1: + resolution: {integrity: sha512-LbtfK9+3Ug1UmvvhR2DqLqXiPW1OJ5jEh0a3m9ZgAipiwpSxGj/qaVVy54RG5vAQN1nCuXqjvprCuKSCxcJHBg==} + engines: {node: '>=6'} + deprecated: Superseded by memory-level (https://github.com/Level/community#faq) + + level-packager@4.0.1: + resolution: {integrity: sha512-svCRKfYLn9/4CoFfi+d8krOtrp6RoX8+xm0Na5cgXMqSyRru0AnDYdLl+YI8u1FyS6gGZ94ILLZDE5dh2but3Q==} + engines: {node: '>=6'} + deprecated: Superseded by abstract-level (https://github.com/Level/community#faq) + + level-post@1.0.7: + resolution: {integrity: sha512-PWYqG4Q00asOrLhX7BejSajByB4EmG2GaKHfj3h5UmmZ2duciXLPGYWIjBzLECFWUGOZWlm5B20h/n3Gs3HKew==} + + level-sublevel@6.6.4: + resolution: {integrity: sha512-pcCrTUOiO48+Kp6F1+UAzF/OtWqLcQVTVF39HLdZ3RO8XBoXt+XVPKZO1vVr1aUoxHZA9OtD2e1v7G+3S5KFDA==} + + level-supports@4.0.1: + resolution: {integrity: sha512-PbXpve8rKeNcZ9C1mUicC9auIYFyGpkV9/i6g76tLgANwWhtG2v7I4xNBUlkn3lE2/dZF3Pi0ygYGtLc4RXXdA==} + engines: {node: '>=12'} + + level-transcoder@1.0.1: + resolution: {integrity: sha512-t7bFwFtsQeD8cl8NIoQ2iwxA0CL/9IFw7/9gAjOonH0PWTTiRfY7Hq+Ejbsxh86tXobDQ6IOiddjNYIfOBs06w==} + engines: {node: '>=12'} + + level-ws@0.0.0: + resolution: {integrity: sha512-XUTaO/+Db51Uiyp/t7fCMGVFOTdtLS/NIACxE/GHsij15mKzxksZifKVjlXDF41JMUP/oM1Oc4YNGdKnc3dVLw==} + + level-ws@1.0.0: + resolution: {integrity: sha512-RXEfCmkd6WWFlArh3X8ONvQPm8jNpfA0s/36M4QzLqrLEIt1iJE9WBHLZ5vZJK6haMjJPJGJCQWfjMNnRcq/9Q==} + engines: {node: '>=6'} + + level@8.0.1: + resolution: {integrity: sha512-oPBGkheysuw7DmzFQYyFe8NAia5jFLAgEnkgWnK3OXAuJr8qFT+xBQIwokAZPME2bhPFzS8hlYcL16m8UZrtwQ==} + engines: {node: '>=12'} + + levelup@1.3.9: + resolution: {integrity: sha512-VVGHfKIlmw8w1XqpGOAGwq6sZm2WwWLmlDcULkKWQXEA5EopA8OBNJ2Ck2v6bdk8HeEZSbCSEgzXadyQFm76sQ==} + deprecated: Superseded by abstract-level (https://github.com/Level/community#faq) + + levelup@3.1.1: + resolution: {integrity: sha512-9N10xRkUU4dShSRRFTBdNaBxofz+PGaIZO962ckboJZiNmLuhVT6FZ6ZKAsICKfUBO76ySaYU6fJWX/jnj3Lcg==} + engines: {node: '>=6'} + deprecated: Superseded by abstract-level (https://github.com/Level/community#faq) + + leven@3.1.0: + resolution: {integrity: sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==} + engines: {node: '>=6'} + + levn@0.3.0: + resolution: {integrity: sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==} + engines: {node: '>= 0.8.0'} + + levn@0.4.1: + resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==} + engines: {node: '>= 0.8.0'} + + lie@3.1.1: + resolution: {integrity: sha512-RiNhHysUjhrDQntfYSfY4MU24coXXdEOgw9WGcKHNeEwffDYbF//u87M1EWaMGzuFoSbqW0C9C6lEEhDOAswfw==} + + lighthouse-logger@1.4.2: + resolution: {integrity: sha512-gPWxznF6TKmUHrOQjlVo2UbaL2EJ71mb2CCeRs/2qBpi4L/g4LUVc9+3lKQ6DTUZwJswfM7ainGrLO1+fOqa2g==} + + lilconfig@2.0.5: + resolution: {integrity: sha512-xaYmXZtTHPAw5m+xLN8ab9C+3a8YmV3asNSPOATITbtwrfbwaLJj8h66H1WMIpALCkqsIzK3h7oQ+PdX+LQ9Eg==} + engines: {node: '>=10'} + + lilconfig@3.1.3: + resolution: {integrity: sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==} + engines: {node: '>=14'} + + lines-and-columns@1.2.4: + resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} + + lint-staged@10.5.4: + resolution: {integrity: sha512-EechC3DdFic/TdOPgj/RB3FicqE6932LTHCUm0Y2fsD9KGlLB+RwJl2q1IYBIvEsKzDOgn0D4gll+YxG5RsrKg==} + hasBin: true + + lint-staged@12.5.0: + resolution: {integrity: sha512-BKLUjWDsKquV/JuIcoQW4MSAI3ggwEImF1+sB4zaKvyVx1wBk3FsG7UK9bpnmBTN1pm7EH2BBcMwINJzCRv12g==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + hasBin: true + + lint-staged@15.5.1: + resolution: {integrity: sha512-6m7u8mue4Xn6wK6gZvSCQwBvMBR36xfY24nF5bMTf2MHDYG6S3yhJuOgdYVw99hsjyDt2d4z168b3naI8+NWtQ==} + engines: {node: '>=18.12.0'} + hasBin: true + + listr2@3.14.0: + resolution: {integrity: sha512-TyWI8G99GX9GjE54cJ+RrNMcIFBfwMPxc3XTFiAYGN4s10hWROGtOg7+O6u6LE3mNkyld7RSLE6nrKBvTfcs3g==} + engines: {node: '>=10.0.0'} + peerDependencies: + enquirer: '>= 2.3.0 < 3' + peerDependenciesMeta: + enquirer: + optional: true + + listr2@4.0.5: + resolution: {integrity: sha512-juGHV1doQdpNT3GSTs9IUN43QJb7KHdF9uqg7Vufs/tG9VTzpFphqF4pm/ICdAABGQxsyNn9CiYA3StkI6jpwA==} + engines: {node: '>=12'} + peerDependencies: + enquirer: '>= 2.3.0 < 3' + peerDependenciesMeta: + enquirer: + optional: true + + listr2@8.3.2: + resolution: {integrity: sha512-vsBzcU4oE+v0lj4FhVLzr9dBTv4/fHIa57l+GCwovP8MoFNZJTOhGU8PXd4v2VJCbECAaijBiHntiekFMLvo0g==} + engines: {node: '>=18.0.0'} + + load-json-file@1.1.0: + resolution: {integrity: sha512-cy7ZdNRXdablkXYNI049pthVeXFurRyb9+hA/dZzerZ0pGTx42z+y+ssxBaVV2l70t1muq5IdKhn4UtcoGUY9A==} + engines: {node: '>=0.10.0'} + + localforage@1.10.0: + resolution: {integrity: sha512-14/H1aX7hzBBmmh7sGPd+AOMkkIrHM3Z1PAyGgZigA1H1p5O5ANnMyWzvpAETtG68/dC4pC0ncy3+PPGzXZHPg==} + + locate-path@2.0.0: + resolution: {integrity: sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA==} + engines: {node: '>=4'} + + locate-path@5.0.0: + resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==} + engines: {node: '>=8'} + + locate-path@6.0.0: + resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} + engines: {node: '>=10'} + + lodash.assign@4.2.0: + resolution: {integrity: sha512-hFuH8TY+Yji7Eja3mGiuAxBqLagejScbG8GbG0j6o9vzn0YL14My+ktnqtZgFTosKymC9/44wP6s7xyuLfnClw==} + + lodash.camelcase@4.3.0: + resolution: {integrity: sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==} + + lodash.clone@4.5.0: + resolution: {integrity: sha512-GhrVeweiTD6uTmmn5hV/lzgCQhccwReIVRLHp7LT4SopOjqEZ5BbX8b5WWEtAKasjmy8hR7ZPwsYlxRCku5odg==} + deprecated: This package is deprecated. Use structuredClone instead. + + lodash.clonedeep@4.5.0: + resolution: {integrity: sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ==} + + lodash.get@4.4.2: + resolution: {integrity: sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==} + deprecated: This package is deprecated. Use the optional chaining (?.) operator instead. + + lodash.isequal@4.5.0: + resolution: {integrity: sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==} + deprecated: This package is deprecated. Use require('node:util').isDeepStrictEqual instead. + + lodash.isequalwith@4.4.0: + resolution: {integrity: sha512-dcZON0IalGBpRmJBmMkaoV7d3I80R2O+FrzsZyHdNSFrANq/cgDqKQNmAHE8UEj4+QYWwwhkQOVdLHiAopzlsQ==} + + lodash.isfunction@3.0.9: + resolution: {integrity: sha512-AirXNj15uRIMMPihnkInB4i3NHeb4iBtNg9WRWuK2o31S+ePwwNmDPaTL3o7dTJ+VXNZim7rFs4rxN4YU1oUJw==} + + lodash.isplainobject@4.0.6: + resolution: {integrity: sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==} + + lodash.kebabcase@4.1.1: + resolution: {integrity: sha512-N8XRTIMMqqDgSy4VLKPnJ/+hpGZN+PHQiJnSenYqPaVV/NCqEogTnAdZLQiGKhxX+JCs8waWq2t1XHWKOmlY8g==} + + lodash.merge@4.6.2: + resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==} + + lodash.mergewith@4.6.2: + resolution: {integrity: sha512-GK3g5RPZWTRSeLSpgP8Xhra+pnjBC56q9FZYe1d5RN3TJ35dbkGy3YqBSMbyCrlbi+CM9Z3Jk5yTL7RCsqboyQ==} + + lodash.snakecase@4.1.1: + resolution: {integrity: sha512-QZ1d4xoBHYUeuouhEq3lk3Uq7ldgyFXGBhg04+oRLnIz8o9T65Eh+8YdroUwn846zchkA9yDsDl5CVVaV2nqYw==} + + lodash.startcase@4.4.0: + resolution: {integrity: sha512-+WKqsK294HMSc2jEbNgpHpd0JfIBhp7rEV4aqXWqFr6AlXov+SlcgB1Fv01y2kGe3Gc8nMW7VA0SrGuSkRfIEg==} + + lodash.throttle@4.1.1: + resolution: {integrity: sha512-wIkUCfVKpVsWo3JSZlc+8MB5it+2AN5W8J7YVMST30UrvcQNZ1Okbj+rbVniijTWE6FGYy4XJq/rHkas8qJMLQ==} + + lodash.topath@4.5.2: + resolution: {integrity: sha512-1/W4dM+35DwvE/iEd1M9ekewOSTlpFekhw9mhAtrwjVqUr83/ilQiyAvmg4tVX7Unkcfl1KC+i9WdaT4B6aQcg==} + + lodash.truncate@4.4.2: + resolution: {integrity: sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw==} + + lodash.uniq@4.5.0: + resolution: {integrity: sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ==} + + lodash.upperfirst@4.3.1: + resolution: {integrity: sha512-sReKOYJIJf74dhJONhU4e0/shzi1trVbSWDOhKYE5XV2O+H7Sb2Dihwuc7xWxVl+DgFPyTqIN3zMfT9cq5iWDg==} + + lodash@4.17.20: + resolution: {integrity: sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==} + + lodash@4.17.21: + resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} + + log-symbols@4.1.0: + resolution: {integrity: sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==} + engines: {node: '>=10'} + + log-update@4.0.0: + resolution: {integrity: sha512-9fkkDevMefjg0mmzWFBW8YkFP91OrizzkW3diF7CpG+S2EYdy4+TVfGwz1zeF8x7hCx1ovSPTOE9Ngib74qqUg==} + engines: {node: '>=10'} + + log-update@6.1.0: + resolution: {integrity: sha512-9ie8ItPR6tjY5uYJh8K/Zrv/RMZ5VOlOWvtZdEHYSTFKZfIBPQa9tOAEeAWhd+AnIneLJ22w5fjOYtoutpWq5w==} + engines: {node: '>=18'} + + logform@2.7.0: + resolution: {integrity: sha512-TFYA4jnP7PVbmlBIfhlSe+WKxs9dklXMTEGcBCIvLhE/Tn3H6Gk1norupVW7m5Cnd4bLcr08AytbyV/xj7f/kQ==} + engines: {node: '>= 12.0.0'} + + looper@2.0.0: + resolution: {integrity: sha512-6DzMHJcjbQX/UPHc1rRCBfKlLwDkvuGZ715cIR36wSdYqWXFT35uLXq5P/2orl3tz+t+VOVPxw4yPinQlUDGDQ==} + + looper@3.0.0: + resolution: {integrity: sha512-LJ9wplN/uSn72oJRsXTx+snxPet5c8XiZmOKCm906NVYu+ag6SB6vUcnJcWxgnl2NfbIyeobAn7Bwv6xRj2XJg==} + + loose-envify@1.4.0: + resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} + hasBin: true + + loupe@2.3.7: + resolution: {integrity: sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==} + + lower-case-first@2.0.2: + resolution: {integrity: sha512-EVm/rR94FJTZi3zefZ82fLWab+GX14LJN4HrWBcuo6Evmsl9hEfnqxgcHCKb9q+mNf6EVdsjx/qucYFIIB84pg==} + + lower-case@2.0.2: + resolution: {integrity: sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==} + + lowercase-keys@1.0.1: + resolution: {integrity: sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==} + engines: {node: '>=0.10.0'} + + lowercase-keys@2.0.0: + resolution: {integrity: sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==} + engines: {node: '>=8'} + + lowercase-keys@3.0.0: + resolution: {integrity: sha512-ozCC6gdQ+glXOQsveKD0YsDy8DSQFjDTz4zyzEHNV5+JP5D62LmfDZ6o1cycFx9ouG940M5dE8C8CTewdj2YWQ==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + + lru-cache@10.4.3: + resolution: {integrity: sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==} + + lru-cache@11.1.0: + resolution: {integrity: sha512-QIXZUBJUx+2zHUdQujWejBkcD9+cs94tLn0+YL8UrCh+D5sCXZ4c7LaEH48pNwRY3MLDgqUFyhlCyjJPf1WP0A==} + engines: {node: 20 || >=22} + + lru-cache@3.2.0: + resolution: {integrity: sha512-91gyOKTc2k66UG6kHiH4h3S2eltcPwE1STVfMYC/NG+nZwf8IIuiamfmpGZjpbbxzSyEJaLC0tNSmhjlQUTJow==} + + lru-cache@4.1.5: + resolution: {integrity: sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==} + + lru-cache@5.1.1: + resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==} + + lru-cache@6.0.0: + resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==} + engines: {node: '>=10'} + + lru-cache@7.18.3: + resolution: {integrity: sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==} + engines: {node: '>=12'} + + lru_map@0.3.3: + resolution: {integrity: sha512-Pn9cox5CsMYngeDbmChANltQl+5pi6XmTrraMSzhPmMBbmgcxmqWry0U3PGapCU1yB4/LqCcom7qhHZiF/jGfQ==} + + ltgt@2.1.3: + resolution: {integrity: sha512-5VjHC5GsENtIi5rbJd+feEpDKhfr7j0odoUR2Uh978g+2p93nd5o34cTjQWohXsPsCZeqoDnIqEf88mPCe0Pfw==} + + ltgt@2.2.1: + resolution: {integrity: sha512-AI2r85+4MquTw9ZYqabu4nMwy9Oftlfa/e/52t9IjtfG+mGBbTNdAoZ3RQKLHR6r0wQnwZnPIEh/Ya6XTWAKNA==} + + make-error@1.3.6: + resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==} + + makeerror@1.0.12: + resolution: {integrity: sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==} + + map-cache@0.2.2: + resolution: {integrity: sha512-8y/eV9QQZCiyn1SprXSrCmqJN0yNRATe+PO8ztwqrvrbdRLA3eYJF0yaR0YayLWkMbsQSKWS9N2gPcGEc4UsZg==} + engines: {node: '>=0.10.0'} + + map-obj@1.0.1: + resolution: {integrity: sha512-7N/q3lyZ+LVCp7PzuxrJr4KMbBE2hW7BT7YNia330OFxIf4d3r5zVpicP2650l7CPN6RM9zOJRl3NGpqSiw3Eg==} + engines: {node: '>=0.10.0'} + + map-obj@4.3.0: + resolution: {integrity: sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ==} + engines: {node: '>=8'} + + map-visit@1.0.0: + resolution: {integrity: sha512-4y7uGv8bd2WdM9vpQsiQNo41Ln1NvhvDRuVt0k2JZQ+ezN2uaQes7lZeZ+QQUHOLQAtDaBJ+7wCbi+ab/KFs+w==} + engines: {node: '>=0.10.0'} + + markdown-table@1.1.3: + resolution: {integrity: sha512-1RUZVgQlpJSPWYbFSpmudq5nHY1doEIv89gBtF0s4gW1GF2XorxcA/70M5vq7rLv0a6mhOUccRsqkwhwLCIQ2Q==} + + marky@1.3.0: + resolution: {integrity: sha512-ocnPZQLNpvbedwTy9kNrQEsknEfgvcLMvOtz3sFeWApDq1MXH1TqkCIx58xlpESsfwQOnuBO9beyQuNGzVvuhQ==} + + match-all@1.2.7: + resolution: {integrity: sha512-qSpsBKarh55r9KyXzFC3xBLRf2GlGasba2em9kbpRsSlGvdTAqjx3QD0r3FKSARiW+OE4iMHYsolM3aX9n5djw==} + + math-intrinsics@1.1.0: + resolution: {integrity: sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==} + engines: {node: '>= 0.4'} + + math-random@1.0.4: + resolution: {integrity: sha512-rUxjysqif/BZQH2yhd5Aaq7vXMSx9NdEsQcyA07uEzIvxgI7zIr33gGsh+RU0/XjmQpCW7RsVof1vlkvQVCK5A==} + + mcl-wasm@0.7.9: + resolution: {integrity: sha512-iJIUcQWA88IJB/5L15GnJVnSQJmf/YaxxV6zRavv83HILHaJQb6y0iFyDMdDO0gN8X37tdxmAOrH/P8B6RB8sQ==} + engines: {node: '>=8.9.0'} + + md5.js@1.3.5: + resolution: {integrity: sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==} + + media-typer@0.3.0: + resolution: {integrity: sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==} + engines: {node: '>= 0.6'} + + mem@1.1.0: + resolution: {integrity: sha512-nOBDrc/wgpkd3X/JOhMqYR+/eLqlfLP4oQfoBA6QExIxEl+GU01oyEkwWyueyO8110pUKijtiHGhEmYoOn88oQ==} + engines: {node: '>=4'} + + memdown@1.4.1: + resolution: {integrity: sha512-iVrGHZB8i4OQfM155xx8akvG9FIj+ht14DX5CQkCTG4EHzZ3d3sgckIf/Lm9ivZalEsFuEVnWv2B2WZvbrro2w==} + deprecated: Superseded by memory-level (https://github.com/Level/community#faq) + + memdown@3.0.0: + resolution: {integrity: sha512-tbV02LfZMWLcHcq4tw++NuqMO+FZX8tNJEiD2aNRm48ZZusVg5N8NART+dmBkepJVye986oixErf7jfXboMGMA==} + engines: {node: '>=6'} + deprecated: Superseded by memory-level (https://github.com/Level/community#faq) + + memoize-one@5.2.1: + resolution: {integrity: sha512-zYiwtZUcYyXKo/np96AGZAckk+FWWsUdJ3cHGGmld7+AhvcWmQyGCYUh1hc4Q/pkOhb65dQR/pqCyK0cOaHz4Q==} + + memory-level@1.0.0: + resolution: {integrity: sha512-UXzwewuWeHBz5krr7EvehKcmLFNoXxGcvuYhC41tRnkrTbJohtS7kVn9akmgirtRygg+f7Yjsfi8Uu5SGSQ4Og==} + engines: {node: '>=12'} + + memorystream@0.3.1: + resolution: {integrity: sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw==} + engines: {node: '>= 0.10.0'} + + meow@12.1.1: + resolution: {integrity: sha512-BhXM0Au22RwUneMPwSCnyhTOizdWoIEPU9sp0Aqa1PnDMR5Wv2FGXYDjuzJEIX+Eo2Rb8xuYe5jrnm5QowQFkw==} + engines: {node: '>=16.10'} + + meow@8.1.2: + resolution: {integrity: sha512-r85E3NdZ+mpYk1C6RjPFEMSE+s1iZMuHtsHAqY0DT3jZczl0diWUZ8g6oU7h0M9cD2EL+PzaYghhCLzR0ZNn5Q==} + engines: {node: '>=10'} + + merge-descriptors@1.0.1: + resolution: {integrity: sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==} + + merge-descriptors@1.0.3: + resolution: {integrity: sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==} + + merge-options@2.0.0: + resolution: {integrity: sha512-S7xYIeWHl2ZUKF7SDeBhGg6rfv5bKxVBdk95s/I7wVF8d+hjLSztJ/B271cnUiF6CAFduEQ5Zn3HYwAjT16DlQ==} + engines: {node: '>=8'} + + merge-stream@2.0.0: + resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==} + + merge2@1.4.1: + resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} + engines: {node: '>= 8'} + + merkle-patricia-tree@2.3.2: + resolution: {integrity: sha512-81PW5m8oz/pz3GvsAwbauj7Y00rqm81Tzad77tHBwU7pIAtN+TJnMSOJhxBKflSVYhptMMb9RskhqHqrSm1V+g==} + + merkle-patricia-tree@3.0.0: + resolution: {integrity: sha512-soRaMuNf/ILmw3KWbybaCjhx86EYeBbD8ph0edQCTed0JN/rxDt1EBN52Ajre3VyGo+91f8+/rfPIRQnnGMqmQ==} + + meros@1.3.0: + resolution: {integrity: sha512-2BNGOimxEz5hmjUG2FwoxCt5HN7BXdaWyFqEwxPTrJzVdABtrL4TiHTcsWSFAxPQ/tOnEaQEJh3qWq71QRMY+w==} + engines: {node: '>=13'} + peerDependencies: + '@types/node': '>=13' + peerDependenciesMeta: + '@types/node': + optional: true + + methods@1.1.2: + resolution: {integrity: sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==} + engines: {node: '>= 0.6'} + + metro-babel-transformer@0.82.2: + resolution: {integrity: sha512-c2gesA7/B4dovPmmYC2HziNXb4XFG3YkQ9FjEzwRnR6KH2hT7nJn6mkcri1h85r3sMttpnmoBuZ8WDz980Zhlw==} + engines: {node: '>=18.18'} + + metro-cache-key@0.82.2: + resolution: {integrity: sha512-lfjC9zzSri+rS7lkoCh04LniFga8JQVUqSuscD9KraIm9zRzwIwvaMx8V6Oogiezs+FAJUOSnVNhHcHc9l8H2Q==} + engines: {node: '>=18.18'} + + metro-cache@0.82.2: + resolution: {integrity: sha512-MxY4xvPKuE68NYpKJjH8YvVVugDL2QcuTracHsV5/30ZIaRr0v1QuAX5vt45OCQDQQWeh1rDv3E4JB6AbIvnZQ==} + engines: {node: '>=18.18'} + + metro-config@0.82.2: + resolution: {integrity: sha512-0dG3qCFLoE3ddNexAxSLJ7FbGjEbwUjDNOgYeCLoPSkKB01k5itvvr2HFfl2HisOCfLcpjpVzF5NtB/O71lxfA==} + engines: {node: '>=18.18'} + + metro-core@0.82.2: + resolution: {integrity: sha512-d2XMkWbRh6PdPV1OZ8OyUyDWrtEbQ1m5ASpKtemLPbujfoE4RlwFZdl4ljfBNVVZ1s0z7tgsSFwKMyTeXgjtSg==} + engines: {node: '>=18.18'} + + metro-file-map@0.82.2: + resolution: {integrity: sha512-pax0WA80eRH096YO0kwox+ZD5im3V0Vswr2x1YqdMcZVWlr6uwXgQdo9q+mpcvJ1k77J+hmY5HIg71bqrUptVg==} + engines: {node: '>=18.18'} + + metro-minify-terser@0.82.2: + resolution: {integrity: sha512-+nveaEdQUvsoi0OSr4Cp+btevZsg2DKsu8kUJsvyLIcRRFPUw9CwzF3V2cA5b55DY5LcIJyAcZf4D9ARKfoilQ==} + engines: {node: '>=18.18'} + + metro-resolver@0.82.2: + resolution: {integrity: sha512-Who2hGzq2aCGSsBaQBU0L3SADiy/kj/gv0coujNWziRY4SKq7ECKzWqtVk1JlEF7IGXDDRDxEgFuLmPV6mZGVQ==} + engines: {node: '>=18.18'} + + metro-runtime@0.82.2: + resolution: {integrity: sha512-gEcb2AfDs3GRs2SFjtEmG0k61B/cZEVCbh6cSmkjJpyHr+VRjw77MnDpX9AUcJYa4bCT63E7IEySOMM0Z8p87g==} + engines: {node: '>=18.18'} + + metro-source-map@0.82.2: + resolution: {integrity: sha512-S26xPdz1/EeAY0HqaPXfny8CeiY0Dvl4sBLQiXGXhoES4gUDAuMhA1tioKrv5F+x68Sod8cp8Js6EGqbMXeqMA==} + engines: {node: '>=18.18'} + + metro-symbolicate@0.82.2: + resolution: {integrity: sha512-iheanMnOMned6gjt6sKSfU5AoNyV6pJyQAWydwuHcjhGpa/kiAM0kKmw23qHejELK89Yw8HDZ3Fd/5l1jxpFVA==} + engines: {node: '>=18.18'} + hasBin: true + + metro-transform-plugins@0.82.2: + resolution: {integrity: sha512-kEveuEVxghTEXkDiyY0MT5QRqei092KJG46nduo0VghFgI6QFodbAjFit1ULyWsn2VOTGSUDJ3VgHBMy7MaccA==} + engines: {node: '>=18.18'} + + metro-transform-worker@0.82.2: + resolution: {integrity: sha512-MJQNz6cGjqewCRqFmPrsHu6Oe93v2B6zgHkrNxQ6XdPMJz5VHD33m8q+8UsNJOH8wUMoRu5JmYtuUTIVIFxh2A==} + engines: {node: '>=18.18'} + + metro@0.82.2: + resolution: {integrity: sha512-hOBd4O4Cn/tLf3jz7IjSgD/A66MqMzgZuyF1I/pmNwYcY3q3j2vbh7Fa09KIbvUq5Yz7BewU356XboaEtEXPgA==} + engines: {node: '>=18.18'} + hasBin: true + + micro-eth-signer@0.14.0: + resolution: {integrity: sha512-5PLLzHiVYPWClEvZIXXFu5yutzpadb73rnQCpUqIHu3No3coFuWQNfE5tkBQJ7djuLYl6aRLaS0MgWJYGoqiBw==} + + micro-ftch@0.3.1: + resolution: {integrity: sha512-/0LLxhzP0tfiR5hcQebtudP56gUurs2CLkGarnCiB/OqEyUFQ6U3paQi/tgLv0hBJYt2rnr9MNpxz4fiiugstg==} + + micro-packed@0.7.3: + resolution: {integrity: sha512-2Milxs+WNC00TRlem41oRswvw31146GiSaoCT7s3Xi2gMUglW5QBeqlQaZeHr5tJx9nm3i57LNXPqxOOaWtTYg==} + + micromatch@2.3.11: + resolution: {integrity: sha512-LnU2XFEk9xxSJ6rfgAry/ty5qwUTyHYOBU0g4R6tIw5ljwgGIBmiKhRWLw5NpMOnrgUNcDJ4WMp8rl3sYVHLNA==} + engines: {node: '>=0.10.0'} + + micromatch@3.1.10: + resolution: {integrity: sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==} + engines: {node: '>=0.10.0'} + + micromatch@4.0.8: + resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==} + engines: {node: '>=8.6'} + + miller-rabin@4.0.1: + resolution: {integrity: sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==} + hasBin: true + + mime-db@1.52.0: + resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} + engines: {node: '>= 0.6'} + + mime-types@2.1.35: + resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} + engines: {node: '>= 0.6'} + + mime@1.6.0: + resolution: {integrity: sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==} + engines: {node: '>=4'} + hasBin: true + + mimic-fn@1.2.0: + resolution: {integrity: sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==} + engines: {node: '>=4'} + + mimic-fn@2.1.0: + resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} + engines: {node: '>=6'} + + mimic-fn@4.0.0: + resolution: {integrity: sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==} + engines: {node: '>=12'} + + mimic-function@5.0.1: + resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==} + engines: {node: '>=18'} + + mimic-response@1.0.1: + resolution: {integrity: sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==} + engines: {node: '>=4'} + + mimic-response@2.1.0: + resolution: {integrity: sha512-wXqjST+SLt7R009ySCglWBCFpjUygmCIfD790/kVbiGmUgfYGuB14PiTd5DwVxSV4NcYHjzMkoj5LjQZwTQLEA==} + engines: {node: '>=8'} + + mimic-response@3.1.0: + resolution: {integrity: sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==} + engines: {node: '>=10'} + + mimic-response@4.0.0: + resolution: {integrity: sha512-e5ISH9xMYU0DzrT+jl8q2ze9D6eWBto+I8CNpe+VI+K2J/F/k3PdkdTdz4wvGVH4NTpo+NRYTVIuMQEMMcsLqg==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + + min-document@2.19.0: + resolution: {integrity: sha512-9Wy1B3m3f66bPPmU5hdA4DR4PB2OfDU/+GS3yAB7IQozE3tqXaVv2zOjgla7MEGSRv95+ILmOuvhLkOK6wJtCQ==} + + min-indent@1.0.1: + resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==} + engines: {node: '>=4'} + + minimalistic-assert@1.0.1: + resolution: {integrity: sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==} + + minimalistic-crypto-utils@1.0.1: + resolution: {integrity: sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==} + + minimatch@10.0.1: + resolution: {integrity: sha512-ethXTt3SGGR+95gudmqJ1eNhRO7eGEGIgYA9vnPatK4/etz2MEVDno5GMCibdMTuBMyElzIlgxMna3K94XDIDQ==} + engines: {node: 20 || >=22} + + minimatch@3.1.2: + resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} + + minimatch@5.1.6: + resolution: {integrity: sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==} + engines: {node: '>=10'} + + minimatch@9.0.3: + resolution: {integrity: sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==} + engines: {node: '>=16 || 14 >=14.17'} + + minimatch@9.0.5: + resolution: {integrity: sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==} + engines: {node: '>=16 || 14 >=14.17'} + + minimist-options@4.1.0: + resolution: {integrity: sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==} + engines: {node: '>= 6'} + + minimist@0.0.8: + resolution: {integrity: sha512-miQKw5Hv4NS1Psg2517mV4e4dYNaO3++hjAvLOAzKqZ61rH8NS1SK+vbfBWZ5PY/Me/bEWhUwqMghEW5Fb9T7Q==} + + minimist@1.2.8: + resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} + + minipass@2.9.0: + resolution: {integrity: sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==} + + minipass@7.1.2: + resolution: {integrity: sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==} + engines: {node: '>=16 || 14 >=14.17'} + + minizlib@1.3.3: + resolution: {integrity: sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q==} + + mixin-deep@1.3.2: + resolution: {integrity: sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==} + engines: {node: '>=0.10.0'} + + mkdirp-classic@0.5.3: + resolution: {integrity: sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==} + + mkdirp-promise@5.0.1: + resolution: {integrity: sha512-Hepn5kb1lJPtVW84RFT40YG1OddBNTOVUZR2bzQUHc+Z03en8/3uX0+060JDhcEzyO08HmipsN9DcnFMxhIL9w==} + engines: {node: '>=4'} + deprecated: This package is broken and no longer maintained. 'mkdirp' itself supports promises now, please switch to that. + + mkdirp@0.5.1: + resolution: {integrity: sha512-SknJC52obPfGQPnjIkXbmA6+5H15E+fR+E4iR2oQ3zzCLbd7/ONua69R/Gw7AgkTLsRG+r5fzksYwWe1AgTyWA==} + deprecated: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.) + hasBin: true + + mkdirp@0.5.6: + resolution: {integrity: sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==} + hasBin: true + + mkdirp@1.0.4: + resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==} + engines: {node: '>=10'} + hasBin: true + + mkdirp@3.0.1: + resolution: {integrity: sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg==} + engines: {node: '>=10'} + hasBin: true + + mnemonist@0.38.5: + resolution: {integrity: sha512-bZTFT5rrPKtPJxj8KSV0WkPyNxl72vQepqqVUAW2ARUpUSF2qXMB6jZj7hW5/k7C1rtpzqbD/IIbJwLXUjCHeg==} + + mocha@10.8.2: + resolution: {integrity: sha512-VZlYo/WE8t1tstuRmqgeyBgCbJc/lEdopaa+axcKzTBJ+UIdlAB9XnmvTCAH4pwR4ElNInaedhEBmZD8iCSVEg==} + engines: {node: '>= 14.0.0'} + hasBin: true + + mocha@4.1.0: + resolution: {integrity: sha512-0RVnjg1HJsXY2YFDoTNzcc1NKhYuXKRrBAG2gDygmJJA136Cs2QlRliZG1mA0ap7cuaT30mw16luAeln+4RiNA==} + engines: {node: '>= 4.0.0'} + hasBin: true + + mock-fs@4.14.0: + resolution: {integrity: sha512-qYvlv/exQ4+svI3UOvPUpLDF0OMX5euvUH0Ny4N5QyRyhNdgAgUrVH3iUINSzEPLvx0kbo/Bp28GJKIqvE7URw==} + + mock-property@1.0.3: + resolution: {integrity: sha512-2emPTb1reeLLYwHxyVx993iYyCHEiRRO+y8NFXFPL5kl5q14sgTK76cXyEKkeKCHeRw35SfdkUJ10Q1KfHuiIQ==} + engines: {node: '>= 0.4'} + + module-error@1.0.2: + resolution: {integrity: sha512-0yuvsqSCv8LbaOKhnsQ/T5JhyFlCYLPXK3U2sgV10zoKQwzs/MyfuQUOZQ1V/6OCOJsK/TRgNVrPuPDqtdMFtA==} + engines: {node: '>=10'} + + moment-timezone@0.5.48: + resolution: {integrity: sha512-f22b8LV1gbTO2ms2j2z13MuPogNoh5UzxL3nzNAYKGraILnbGc9NEE6dyiiiLv46DGRb8A4kg8UKWLjPthxBHw==} + + moment@2.30.1: + resolution: {integrity: sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==} + + morgan@1.10.0: + resolution: {integrity: sha512-AbegBVI4sh6El+1gNwvD5YIck7nSA36weD7xvIxG4in80j/UoK8AEGaWnnz8v1GxonMCltmlNs5ZKbGvl9b1XQ==} + engines: {node: '>= 0.8.0'} + + mri@1.2.0: + resolution: {integrity: sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==} + engines: {node: '>=4'} + + ms@2.0.0: + resolution: {integrity: sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==} + + ms@2.1.3: + resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} + + multiaddr-to-uri@6.0.0: + resolution: {integrity: sha512-OjpkVHOXEmIKMO8WChzzQ7aZQcSQX8squxmvtDbRpy7/QNmJ3Z7jv6qyD74C28QtaeNie8O8ngW2AkeiMmKP7A==} + deprecated: This module is deprecated, please upgrade to @multiformats/multiaddr-to-uri + + multiaddr@8.1.2: + resolution: {integrity: sha512-r13IzW8+Sv9zab9Gt8RPMIN2WkptIPq99EpAzg4IbJ/zTELhiEwXWr9bAmEatSCI4j/LSA6ESJzvz95JZ+ZYXQ==} + deprecated: This module is deprecated, please upgrade to @multiformats/multiaddr + + multibase@0.6.1: + resolution: {integrity: sha512-pFfAwyTjbbQgNc3G7D48JkJxWtoJoBMaR4xQUOuB8RnCgRqaYmWNFeJTTvrJ2w51bjLq2zTby6Rqj9TQ9elSUw==} + deprecated: This module has been superseded by the multiformats module + + multibase@0.7.0: + resolution: {integrity: sha512-TW8q03O0f6PNFTQDvh3xxH03c8CjGaaYrjkl9UQPG6rz53TQzzxJVCIWVjzcbN/Q5Y53Zd0IBQBMVktVgNx4Fg==} + deprecated: This module has been superseded by the multiformats module + + multibase@3.1.2: + resolution: {integrity: sha512-bpklWHs70LO3smJUHOjcnzGceJJvn9ui0Vau6Za0B/GBepaXswmW8Ufea0uD9pROf/qCQ4N4lZ3sf3U+SNf0tw==} + engines: {node: '>=10.0.0', npm: '>=6.0.0'} + deprecated: This module has been superseded by the multiformats module + + multibase@4.0.6: + resolution: {integrity: sha512-x23pDe5+svdLz/k5JPGCVdfn7Q5mZVMBETiC+ORfO+sor9Sgs0smJzAjfTbM5tckeCqnaUuMYoz+k3RXMmJClQ==} + engines: {node: '>=12.0.0', npm: '>=6.0.0'} + deprecated: This module has been superseded by the multiformats module + + multicodec@0.5.7: + resolution: {integrity: sha512-PscoRxm3f+88fAtELwUnZxGDkduE2HD9Q6GHUOywQLjOGT/HAdhjLDYNZ1e7VR0s0TP0EwZ16LNUTFpoBGivOA==} + deprecated: This module has been superseded by the multiformats module + + multicodec@1.0.4: + resolution: {integrity: sha512-NDd7FeS3QamVtbgfvu5h7fd1IlbaC4EQ0/pgU4zqE2vdHCmBGsUa0TiM8/TdSeG6BMPC92OOCf8F1ocE/Wkrrg==} + deprecated: This module has been superseded by the multiformats module + + multicodec@2.1.3: + resolution: {integrity: sha512-0tOH2Gtio39uO41o+2xl9UhRkCWxU5ZmZSbFCh/OjGzkWJI8e6lkN/s4Mj1YfyWoBod+2+S3W+6wO6nhkwN8pA==} + deprecated: This module has been superseded by the multiformats module + + multicodec@3.2.1: + resolution: {integrity: sha512-+expTPftro8VAW8kfvcuNNNBgb9gPeNYV9dn+z1kJRWF2vih+/S79f2RVeIwmrJBUJ6NT9IUPWnZDQvegEh5pw==} + deprecated: This module has been superseded by the multiformats module + + multiformats@9.9.0: + resolution: {integrity: sha512-HoMUjhH9T8DDBNT+6xzkrd9ga/XiBI4xLr58LJACwK6G3HTOPeMz4nB4KJs33L2BelrIJa7P0VuNaVF3hMYfjg==} + + multihashes@0.4.21: + resolution: {integrity: sha512-uVSvmeCWf36pU2nB4/1kzYZjsXD9vofZKpgudqkceYY5g2aZZXJ5r9lxuzoRLl1OAp28XljXsEJ/X/85ZsKmKw==} + + multihashes@3.1.2: + resolution: {integrity: sha512-AP4IoV/YzkNrfbQKZE3OMPibrmy350OmCd6cJkwyM8oExaXIlOY4UnOOVSQtAEuq/LR01XfXKCESidzZvSwHCQ==} + engines: {node: '>=10.0.0', npm: '>=6.0.0'} + + multihashes@4.0.3: + resolution: {integrity: sha512-0AhMH7Iu95XjDLxIeuCOOE4t9+vQZsACyKZ9Fxw2pcsRmlX4iCn1mby0hS0bb+nQOVpdQYWPpnyusw4da5RPhA==} + engines: {node: '>=12.0.0', npm: '>=6.0.0'} + + multihashing-async@2.1.4: + resolution: {integrity: sha512-sB1MiQXPSBTNRVSJc2zM157PXgDtud2nMFUEIvBrsq5Wv96sUclMRK/ecjoP1T/W61UJBqt4tCTwMkUpt2Gbzg==} + engines: {node: '>=12.0.0', npm: '>=6.0.0'} + + murmur-128@0.2.1: + resolution: {integrity: sha512-WseEgiRkI6aMFBbj8Cg9yBj/y+OdipwVC7zUo3W2W1JAJITwouUOtpqsmGSg67EQmwwSyod7hsVsWY5LsrfQVg==} + + murmurhash3js-revisited@3.0.0: + resolution: {integrity: sha512-/sF3ee6zvScXMb1XFJ8gDsSnY+X8PbOyjIuBhtgis10W2Jx4ZjIhikUCIF9c4gpJxVnQIsPAFrSwTCuAjicP6g==} + engines: {node: '>=8.0.0'} + + mute-stream@0.0.8: + resolution: {integrity: sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==} + + nan@2.22.2: + resolution: {integrity: sha512-DANghxFkS1plDdRsX0X9pm0Z6SJNN6gBdtXfanwoZ8hooC5gosGFSBGRYHUVPz1asKA/kMRqDRdHrluZ61SpBQ==} + + nano-json-stream-parser@0.1.2: + resolution: {integrity: sha512-9MqxMH/BSJC7dnLsEMPyfN5Dvoo49IsPFYMcHw3Bcfc2kN0lpHRBSzlMSVx4HGyJ7s9B31CyBTVehWJoQ8Ctew==} + + nanoid@3.3.11: + resolution: {integrity: sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==} + engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} + hasBin: true + + nanomatch@1.2.13: + resolution: {integrity: sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==} + engines: {node: '>=0.10.0'} + + napi-build-utils@1.0.2: + resolution: {integrity: sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==} + + napi-macros@2.2.2: + resolution: {integrity: sha512-hmEVtAGYzVQpCKdbQea4skABsdXW4RUh5t5mJ2zzqowJS2OyXZTU1KhDVFhx+NlWZ4ap9mqR9TcDO3LTTttd+g==} + + native-fetch@3.0.0: + resolution: {integrity: sha512-G3Z7vx0IFb/FQ4JxvtqGABsOTIqRWvgQz6e+erkB+JJD6LrszQtMozEHI4EkmgZQvnGHrpLVzUWk7t4sJCIkVw==} + peerDependencies: + node-fetch: '*' + + natural-compare@1.4.0: + resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} + + ndjson@2.0.0: + resolution: {integrity: sha512-nGl7LRGrzugTtaFcJMhLbpzJM6XdivmbkdlaGcrk/LXg2KL/YBC6z1g70xh0/al+oFuVFP8N8kiWRucmeEH/qQ==} + engines: {node: '>=10'} + hasBin: true + + negotiator@0.6.3: + resolution: {integrity: sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==} + engines: {node: '>= 0.6'} + + neo-async@2.6.2: + resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==} + + next-tick@1.1.0: + resolution: {integrity: sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==} + + ngeohash@0.6.3: + resolution: {integrity: sha512-kltF0cOxgx1AbmVzKxYZaoB0aj7mOxZeHaerEtQV0YaqnkXNq26WWqMmJ6lTqShYxVRWZ/mwvvTrNeOwdslWiw==} + engines: {node: '>=v0.2.0'} + + nice-try@1.0.5: + resolution: {integrity: sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==} + + no-case@3.0.4: + resolution: {integrity: sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==} + + node-abi@2.30.1: + resolution: {integrity: sha512-/2D0wOQPgaUWzVSVgRMx+trKJRC2UG4SUc4oCJoXx9Uxjtp0Vy3/kt7zcbxHF8+Z/pK3UloLWzBISg72brfy1w==} + + node-addon-api@2.0.2: + resolution: {integrity: sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA==} + + node-addon-api@3.2.1: + resolution: {integrity: sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A==} + + node-addon-api@4.3.0: + resolution: {integrity: sha512-73sE9+3UaLYYFmDsFZnqCInzPyh3MqIwZO9cw58yIqAZhONrrabrYyYe3TuIqtIiOuTXVhsGau8hcrhhwSsDIQ==} + + node-addon-api@5.1.0: + resolution: {integrity: sha512-eh0GgfEkpnoWDq+VY8OyvYhFEzBk6jIYbRKdIlyTiAXIVJ8PyBaKb0rp7oDtoddbdoHWhq8wwr+XZ81F1rpNdA==} + + node-emoji@1.11.0: + resolution: {integrity: sha512-wo2DpQkQp7Sjm2A0cq+sN7EHKO6Sl0ctXeBdFZrL9T9+UywORbufTcTZxom8YqpLQt/FqNMUkOpkZrJVYSKD3A==} + + node-fetch@1.7.3: + resolution: {integrity: sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ==} + + node-fetch@2.6.7: + resolution: {integrity: sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==} + engines: {node: 4.x || >=6.0.0} + peerDependencies: + encoding: ^0.1.0 + peerDependenciesMeta: + encoding: + optional: true + + node-fetch@2.7.0: + resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} + engines: {node: 4.x || >=6.0.0} + peerDependencies: + encoding: ^0.1.0 + peerDependenciesMeta: + encoding: + optional: true + + node-gyp-build@4.8.4: + resolution: {integrity: sha512-LA4ZjwlnUblHVgq0oBF3Jl/6h/Nvs5fzBLwdEF4nuxnFdsfajde4WfxtJr3CaiH+F6ewcIB/q4jQ4UzPyid+CQ==} + hasBin: true + + node-hid@1.3.0: + resolution: {integrity: sha512-BA6G4V84kiNd1uAChub/Z/5s/xS3EHBCxotQ0nyYrUG65mXewUDHE1tWOSqA2dp3N+mV0Ffq9wo2AW9t4p/G7g==} + engines: {node: '>=6.0.0'} + hasBin: true + + node-hid@2.1.1: + resolution: {integrity: sha512-Skzhqow7hyLZU93eIPthM9yjot9lszg9xrKxESleEs05V2NcbUptZc5HFqzjOkSmL0sFlZFr3kmvaYebx06wrw==} + engines: {node: '>=10'} + hasBin: true + + node-int64@0.4.0: + resolution: {integrity: sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==} + + node-releases@2.0.19: + resolution: {integrity: sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==} + + nofilter@3.1.0: + resolution: {integrity: sha512-l2NNj07e9afPnhAhvgVrCD/oy2Ai1yfLpuo3EpiO1jFTsB4sFz6oIfAfSZyQzVpkZQ9xS8ZS5g1jCBgq4Hwo0g==} + engines: {node: '>=12.19'} + + noop-logger@0.1.1: + resolution: {integrity: sha512-6kM8CLXvuW5crTxsAtva2YLrRrDaiTIkIePWs9moLHqbFWT94WpNFjwS/5dfLfECg5i/lkmw3aoqVidxt23TEQ==} + + nopt@3.0.6: + resolution: {integrity: sha512-4GUt3kSEYmk4ITxzB/b9vaIDfUVWN/Ml1Fwl11IlnIG2iaJ9O6WXZ9SrYM9NLI8OCBieN2Y8SWC2oJV0RQ7qYg==} + hasBin: true + + normalize-package-data@2.5.0: + resolution: {integrity: sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==} + + normalize-package-data@3.0.3: + resolution: {integrity: sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA==} + engines: {node: '>=10'} + + normalize-path@2.1.1: + resolution: {integrity: sha512-3pKJwH184Xo/lnH6oyP1q2pMd7HcypqqmRs91/6/i2CGtWwIKGCkOOMTm/zXbgTEWHw1uNpNi/igc3ePOYHb6w==} + engines: {node: '>=0.10.0'} + + normalize-path@3.0.0: + resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} + engines: {node: '>=0.10.0'} + + normalize-url@4.5.1: + resolution: {integrity: sha512-9UZCFRHQdNrfTpGg8+1INIg93B6zE0aXMVFkw1WFwvO4SlZywU6aLg5Of0Ap/PgcbSw4LNxvMWXMeugwMCX0AA==} + engines: {node: '>=8'} + + normalize-url@6.1.0: + resolution: {integrity: sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A==} + engines: {node: '>=10'} + + normalize-url@8.0.1: + resolution: {integrity: sha512-IO9QvjUMWxPQQhs60oOu10CRkWCiZzSUkzbXGGV9pviYl1fXYcvkzQ5jV9z8Y6un8ARoVRl4EtC6v6jNqbaJ/w==} + engines: {node: '>=14.16'} + + npm-run-path@2.0.2: + resolution: {integrity: sha512-lJxZYlT4DW/bRUtFh1MQIWqmLwQfAxnqWG4HhEdjMlkrJYnJn0Jrr2u3mgxqaWsdiBc76TYkTG/mhrnYTuzfHw==} + engines: {node: '>=4'} + + npm-run-path@4.0.1: + resolution: {integrity: sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==} + engines: {node: '>=8'} + + npm-run-path@5.3.0: + resolution: {integrity: sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + + npmlog@4.1.2: + resolution: {integrity: sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==} + deprecated: This package is no longer supported. + + nullthrows@1.1.1: + resolution: {integrity: sha512-2vPPEi+Z7WqML2jZYddDIfy5Dqb0r2fze2zTxNNknZaFpVHU3mFB3R+DWeJWGVx0ecvttSGlJTI+WG+8Z4cDWw==} + + number-is-nan@1.0.1: + resolution: {integrity: sha512-4jbtZXNAsfZbAHiiqjLPBiCl16dES1zI4Hpzzxw61Tk+loF+sBDBKx1ICKKKwIqQ7M0mFn1TmkN7euSncWgHiQ==} + engines: {node: '>=0.10.0'} + + number-to-bn@1.7.0: + resolution: {integrity: sha512-wsJ9gfSz1/s4ZsJN01lyonwuxA1tml6X1yBDnfpMglypcBRFZZkus26EdPSlqS5GJfYddVZa22p3VNb3z5m5Ig==} + engines: {node: '>=6.5.0', npm: '>=3'} + + oauth-sign@0.9.0: + resolution: {integrity: sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==} + + ob1@0.82.2: + resolution: {integrity: sha512-sfUaYpjkAdHgu8cXLAyWXO98jW1EUOStTDNslfC9eb3tBLExe67PRqh09J0xdD6AlFKHFGTvXPbuHGvlrZNJNA==} + engines: {node: '>=18.18'} + + object-assign@4.1.1: + resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} + engines: {node: '>=0.10.0'} + + object-copy@0.1.0: + resolution: {integrity: sha512-79LYn6VAb63zgtmAteVOWo9Vdj71ZVBy3Pbse+VqxDpEP83XuujMrGqHIwAXJ5I/aM0zU7dIyIAhifVTPrNItQ==} + engines: {node: '>=0.10.0'} + + object-inspect@1.10.3: + resolution: {integrity: sha512-e5mCJlSH7poANfC8z8S9s9S2IN5/4Zb3aZ33f5s8YqoazCFzNLloLU8r5VCG+G7WoqLvAAZoVMcy3tp/3X0Plw==} + + object-inspect@1.12.3: + resolution: {integrity: sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==} + + object-inspect@1.13.4: + resolution: {integrity: sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==} + engines: {node: '>= 0.4'} + + object-is@1.1.6: + resolution: {integrity: sha512-F8cZ+KfGlSGi09lJT7/Nd6KJZ9ygtvYC0/UYYLI9nmQKLMnydpB9yvbv9K1uSkEu7FU9vYPmVwLg328tX+ot3Q==} + engines: {node: '>= 0.4'} + + object-keys@0.4.0: + resolution: {integrity: sha512-ncrLw+X55z7bkl5PnUvHwFK9FcGuFYo9gtjws2XtSzL+aZ8tm830P60WJ0dSmFVaSalWieW5MD7kEdnXda9yJw==} + + object-keys@1.1.1: + resolution: {integrity: sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==} + engines: {node: '>= 0.4'} + + object-visit@1.0.1: + resolution: {integrity: sha512-GBaMwwAVK9qbQN3Scdo0OyvgPW7l3lnaVMj84uTOZlswkX0KpF6fyDBJhtTthf7pymztoN36/KEr1DyhF96zEA==} + engines: {node: '>=0.10.0'} + + object.assign@4.1.7: + resolution: {integrity: sha512-nK28WOo+QIjBkDduTINE4JkF/UJJKyf2EJxvJKfblDpyg0Q+pkOHNTL0Qwy6NP6FhE/EnzV73BxxqcJaXY9anw==} + engines: {node: '>= 0.4'} + + object.getownpropertydescriptors@2.1.8: + resolution: {integrity: sha512-qkHIGe4q0lSYMv0XI4SsBTJz3WaURhLvd0lKSgtVuOsJ2krg4SgMw3PIRQFMp07yi++UR3se2mkcLqsBNpBb/A==} + engines: {node: '>= 0.8'} + + object.omit@2.0.1: + resolution: {integrity: sha512-UiAM5mhmIuKLsOvrL+B0U2d1hXHF3bFYWIuH1LMpuV2EJEHG1Ntz06PgLEHjm6VFd87NpH8rastvPoyv6UW2fA==} + engines: {node: '>=0.10.0'} + + object.pick@1.3.0: + resolution: {integrity: sha512-tqa/UMy/CCoYmj+H5qc07qvSL9dqcs/WZENZ1JbtWBlATP+iVOe778gE6MSijnyCnORzDuX6hU+LA4SZ09YjFQ==} + engines: {node: '>=0.10.0'} + + obliterator@2.0.5: + resolution: {integrity: sha512-42CPE9AhahZRsMNslczq0ctAEtqk8Eka26QofnqC346BZdHDySk3LWka23LI7ULIw11NmltpiLagIq8gBozxTw==} + + oboe@2.1.4: + resolution: {integrity: sha512-ymBJ4xSC6GBXLT9Y7lirj+xbqBLa+jADGJldGEYG7u8sZbS9GyG+u1Xk9c5cbriKwSpCg41qUhPjvU5xOpvIyQ==} + + oboe@2.1.5: + resolution: {integrity: sha512-zRFWiF+FoicxEs3jNI/WYUrVEgA7DeET/InK0XQuudGHRg8iIob3cNPrJTKaz4004uaA9Pbe+Dwa8iluhjLZWA==} + + on-exit-leak-free@0.2.0: + resolution: {integrity: sha512-dqaz3u44QbRXQooZLTUKU41ZrzYrcvLISVgbrzbyCMxpmSLJvZ3ZamIJIZ29P6OhZIkNIQKosdeM6t1LYbA9hg==} + + on-finished@2.3.0: + resolution: {integrity: sha512-ikqdkGAAyf/X/gPhXGvfgAytDZtDbr+bkNUJ0N9h5MI/dmdgCs3l6hoHrcUv41sRKew3jIwrp4qQDXiK99Utww==} + engines: {node: '>= 0.8'} + + on-finished@2.4.1: + resolution: {integrity: sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==} + engines: {node: '>= 0.8'} + + on-headers@1.0.2: + resolution: {integrity: sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==} + engines: {node: '>= 0.8'} + + once@1.4.0: + resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} + + one-time@1.0.0: + resolution: {integrity: sha512-5DXOiRKwuSEcQ/l0kGCF6Q3jcADFv5tSmRaJck/OqkVFcOzutB134KRSfF0xDrL39MNnqxbHBbUUcjZIhTgb2g==} + + onetime@5.1.2: + resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} + engines: {node: '>=6'} + + onetime@6.0.0: + resolution: {integrity: sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==} + engines: {node: '>=12'} + + onetime@7.0.0: + resolution: {integrity: sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==} + engines: {node: '>=18'} + + open@7.4.2: + resolution: {integrity: sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q==} + engines: {node: '>=8'} + + open@8.4.2: + resolution: {integrity: sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==} + engines: {node: '>=12'} + + openapi-types@12.1.3: + resolution: {integrity: sha512-N4YtSYJqghVu4iek2ZUvcN/0aqH1kRDuNqzcycDxhOUpg7GdvLa2F3DgS6yBNhInhv2r/6I0Flkn7CqL8+nIcw==} + + optionator@0.8.3: + resolution: {integrity: sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==} + engines: {node: '>= 0.8.0'} + + optionator@0.9.4: + resolution: {integrity: sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==} + engines: {node: '>= 0.8.0'} + + ordinal@1.0.3: + resolution: {integrity: sha512-cMddMgb2QElm8G7vdaa02jhUNbTSrhsgAGUz1OokD83uJTwSUn+nKoNoKVVaRa08yF6sgfO7Maou1+bgLd9rdQ==} + + os-homedir@1.0.2: + resolution: {integrity: sha512-B5JU3cabzk8c67mRRd3ECmROafjYMXbuzlwtqdM8IbS8ktlTix8aFGb2bAGKrSRIlnfKwovGUUr72JUPyOb6kQ==} + engines: {node: '>=0.10.0'} + + os-locale@1.4.0: + resolution: {integrity: sha512-PRT7ZORmwu2MEFt4/fv3Q+mEfN4zetKxufQrkShY2oGvUms9r8otu5HfdyIFHkYXjO7laNsoVGmM2MANfuTA8g==} + engines: {node: '>=0.10.0'} + + os-locale@2.1.0: + resolution: {integrity: sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA==} + engines: {node: '>=4'} + + os-tmpdir@1.0.2: + resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} + engines: {node: '>=0.10.0'} + + outdent@0.5.0: + resolution: {integrity: sha512-/jHxFIzoMXdqPzTaCpFzAAWhpkSjZPF4Vsn6jAfNpmbH/ymsmd7Qc6VE9BGn0L6YMj6uwpQLxCECpus4ukKS9Q==} + + own-keys@1.0.1: + resolution: {integrity: sha512-qFOyK5PjiWZd+QQIh+1jhdb9LpxTF0qs7Pm8o5QHYZ0M3vKqSqzsZaEB6oWlxZ+q2sJBMI/Ktgd2N5ZwQoRHfg==} + engines: {node: '>= 0.4'} + + p-cancelable@1.1.0: + resolution: {integrity: sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw==} + engines: {node: '>=6'} + + p-cancelable@2.1.1: + resolution: {integrity: sha512-BZOr3nRQHOntUjTrH8+Lh54smKHoHyur8We1V8DSMVrl5A2malOOwuJRnKRDjSnkoeBh4at6BwEnb5I7Jl31wg==} + engines: {node: '>=8'} + + p-cancelable@3.0.0: + resolution: {integrity: sha512-mlVgR3PGuzlo0MmTdk4cXqXWlwQDLnONTAg6sm62XkMJEiRxN3GL3SffkYvqwonbkJBcrI7Uvv5Zh9yjvn2iUw==} + engines: {node: '>=12.20'} + + p-defer@3.0.0: + resolution: {integrity: sha512-ugZxsxmtTln604yeYd29EGrNhazN2lywetzpKhfmQjW/VJmhpDmWbiX+h0zL8V91R0UXkhb3KtPmyq9PZw3aYw==} + engines: {node: '>=8'} + + p-fifo@1.0.0: + resolution: {integrity: sha512-IjoCxXW48tqdtDFz6fqo5q1UfFVjjVZe8TC1QRflvNUJtNfCUhxOUw6MOVZhDPjqhSzc26xKdugsO17gmzd5+A==} + + p-filter@2.1.0: + resolution: {integrity: sha512-ZBxxZ5sL2HghephhpGAQdoskxplTwr7ICaehZwLIlfL6acuVgZPm8yBNuRAFBGEqtD/hmUeq9eqLg2ys9Xr/yw==} + engines: {node: '>=8'} + + p-finally@1.0.0: + resolution: {integrity: sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow==} + engines: {node: '>=4'} + + p-limit@1.3.0: + resolution: {integrity: sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==} + engines: {node: '>=4'} + + p-limit@2.3.0: + resolution: {integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==} + engines: {node: '>=6'} + + p-limit@3.1.0: + resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==} + engines: {node: '>=10'} + + p-locate@2.0.0: + resolution: {integrity: sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg==} + engines: {node: '>=4'} + + p-locate@4.1.0: + resolution: {integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==} + engines: {node: '>=8'} + + p-locate@5.0.0: + resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==} + engines: {node: '>=10'} + + p-map@2.1.0: + resolution: {integrity: sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==} + engines: {node: '>=6'} + + p-map@4.0.0: + resolution: {integrity: sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==} + engines: {node: '>=10'} + + p-queue@6.6.2: + resolution: {integrity: sha512-RwFpb72c/BhQLEXIZ5K2e+AhgNVmIejGlTgiB9MzZ0e93GRvqZ7uSi0dvRF7/XIXDeNkra2fNHBxTyPDGySpjQ==} + engines: {node: '>=8'} + + p-timeout@3.2.0: + resolution: {integrity: sha512-rhIwUycgwwKcP9yTOOFK/AKsAopjjCakVqLHePO3CC6Mir1Z99xT+R63jZxAT5lFZLa2inS5h+ZS2GvR99/FBg==} + engines: {node: '>=8'} + + p-try@1.0.0: + resolution: {integrity: sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww==} + engines: {node: '>=4'} + + p-try@2.2.0: + resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==} + engines: {node: '>=6'} + + package-json-from-dist@1.0.1: + resolution: {integrity: sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==} + + package-json@8.1.1: + resolution: {integrity: sha512-cbH9IAIJHNj9uXi196JVsRlt7cHKak6u/e6AkL/bkRelZ7rlL3X1YKxsZwa36xipOEKAsdtmaG6aAJoM1fx2zA==} + engines: {node: '>=14.16'} + + package-manager-detector@0.2.11: + resolution: {integrity: sha512-BEnLolu+yuz22S56CU1SUKq3XC3PkwD5wv4ikR4MfGvnRVcmzXR9DwSlW2fEamyTPyXHomBJRzgapeuBvRNzJQ==} + + packet-reader@1.0.0: + resolution: {integrity: sha512-HAKu/fG3HpHFO0AA8WE8q2g+gBJaZ9MG7fcKk+IJPLTGAD6Psw4443l+9DGRbOIh3/aXr7Phy0TjilYivJo5XQ==} + + param-case@3.0.4: + resolution: {integrity: sha512-RXlj7zCYokReqWpOPH9oYivUzLYZ5vAPIfEmCTNViosC78F8F0H9y7T7gG2M39ymgutxF5gcFEsyZQSph9Bp3A==} + + parent-module@1.0.1: + resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} + engines: {node: '>=6'} + + parse-asn1@5.1.7: + resolution: {integrity: sha512-CTM5kuWR3sx9IFamcl5ErfPl6ea/N8IYwiJ+vpeB2g+1iknv7zBl5uPwbMbRVznRVbrNY6lGuDoE5b30grmbqg==} + engines: {node: '>= 0.10'} + + parse-cache-control@1.0.1: + resolution: {integrity: sha512-60zvsJReQPX5/QP0Kzfd/VrpjScIQ7SHBW6bFCYfEP+fp0Eppr1SHhIO5nd1PjZtvclzSzES9D/p5nFJurwfWg==} + + parse-duration@0.4.4: + resolution: {integrity: sha512-KbAJuYGUhZkB9gotDiKLnZ7Z3VTacK3fgwmDdB6ZVDtJbMBT6MfLga0WJaYpPDu0mzqT0NgHtHDt5PY4l0nidg==} + + parse-filepath@1.0.2: + resolution: {integrity: sha512-FwdRXKCohSVeXqwtYonZTXtbGJKrn+HNyWDYVcp5yuJlesTwNH4rsmRZ+GrKAPJ5bLpRxESMeS+Rl0VCHRvB2Q==} + engines: {node: '>=0.8'} + + parse-glob@3.0.4: + resolution: {integrity: sha512-FC5TeK0AwXzq3tUBFtH74naWkPQCEWs4K+xMxWZBlKDWu0bVHXGZa+KKqxKidd7xwhdZ19ZNuF2uO1M/r196HA==} + engines: {node: '>=0.10.0'} + + parse-headers@2.0.6: + resolution: {integrity: sha512-Tz11t3uKztEW5FEVZnj1ox8GKblWn+PvHY9TmJV5Mll2uHEwRdR/5Li1OlXoECjLYkApdhWy44ocONwXLiKO5A==} + + parse-json@2.2.0: + resolution: {integrity: sha512-QR/GGaKCkhwk1ePQNYDRKYZ3mwU9ypsKhB0XyFnLQdomyEqk3e8wpW3V5Jp88zbxK4n5ST1nqo+g9juTpownhQ==} + engines: {node: '>=0.10.0'} + + parse-json@4.0.0: + resolution: {integrity: sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw==} + engines: {node: '>=4'} + + parse-json@5.2.0: + resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} + engines: {node: '>=8'} + + parse-passwd@1.0.0: + resolution: {integrity: sha512-1Y1A//QUXEZK7YKz+rD9WydcE1+EuPr6ZBgKecAB8tmoW6UFv0NREVJe1p+jRxtThkcbbKkfwIbWJe/IeE6m2Q==} + engines: {node: '>=0.10.0'} + + parseurl@1.3.3: + resolution: {integrity: sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==} + engines: {node: '>= 0.8'} + + pascal-case@3.1.2: + resolution: {integrity: sha512-uWlGT3YSnK9x3BQJaOdcZwrnV6hPpd8jFH1/ucpiLRPh/2zCVJKS19E4GvYHvaCcACn3foXZ0cLB9Wrx1KGe5g==} + + pascalcase@0.1.1: + resolution: {integrity: sha512-XHXfu/yOQRy9vYOtUDVMN60OEJjW013GoObG1o+xwQTpB9eYJX/BjXMsdW13ZDPruFhYYn0AG22w0xgQMwl3Nw==} + engines: {node: '>=0.10.0'} + + patch-package@6.2.2: + resolution: {integrity: sha512-YqScVYkVcClUY0v8fF0kWOjDYopzIM8e3bj/RU1DPeEF14+dCGm6UeOYm4jvCyxqIEQ5/eJzmbWfDWnUleFNMg==} + engines: {npm: '>5'} + hasBin: true + + patch-package@6.5.1: + resolution: {integrity: sha512-I/4Zsalfhc6bphmJTlrLoOcAF87jcxko4q0qsv4bGcurbr8IskEOtdnt9iCmsQVGL1B+iUhSQqweyTLJfCF9rA==} + engines: {node: '>=10', npm: '>5'} + hasBin: true + + path-browserify@1.0.1: + resolution: {integrity: sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==} + + path-case@3.0.4: + resolution: {integrity: sha512-qO4qCFjXqVTrcbPt/hQfhTQ+VhFsqNKOPtytgNKkKxSoEp3XPUQ8ObFuePylOIok5gjn69ry8XiULxCwot3Wfg==} + + path-exists@2.1.0: + resolution: {integrity: sha512-yTltuKuhtNeFJKa1PiRzfLAU5182q1y4Eb4XCJ3PBqyzEDkAZRzBrKKBct682ls9reBVHf9udYLN5Nd+K1B9BQ==} + engines: {node: '>=0.10.0'} + + path-exists@3.0.0: + resolution: {integrity: sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==} + engines: {node: '>=4'} + + path-exists@4.0.0: + resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} + engines: {node: '>=8'} + + path-is-absolute@1.0.1: + resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} + engines: {node: '>=0.10.0'} + + path-key@2.0.1: + resolution: {integrity: sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==} + engines: {node: '>=4'} + + path-key@3.1.1: + resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} + engines: {node: '>=8'} + + path-key@4.0.0: + resolution: {integrity: sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==} + engines: {node: '>=12'} + + path-parse@1.0.7: + resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} + + path-root-regex@0.1.2: + resolution: {integrity: sha512-4GlJ6rZDhQZFE0DPVKh0e9jmZ5egZfxTkp7bcRDuPlJXbAwhxcl2dINPUAsjLdejqaLsCeg8axcLjIbvBjN4pQ==} + engines: {node: '>=0.10.0'} + + path-root@0.1.1: + resolution: {integrity: sha512-QLcPegTHF11axjfojBIoDygmS2E3Lf+8+jI6wOVmNVenrKSo3mFdSGiIgdSHenczw3wPtlVMQaFVwGmM7BJdtg==} + engines: {node: '>=0.10.0'} + + path-scurry@1.11.1: + resolution: {integrity: sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==} + engines: {node: '>=16 || 14 >=14.18'} + + path-scurry@2.0.0: + resolution: {integrity: sha512-ypGJsmGtdXUOeM5u93TyeIEfEhM6s+ljAhrk5vAvSx8uyY/02OvrZnA0YNGUrPXfpJMgI1ODd3nwz8Npx4O4cg==} + engines: {node: 20 || >=22} + + path-starts-with@2.0.1: + resolution: {integrity: sha512-wZ3AeiRBRlNwkdUxvBANh0+esnt38DLffHDujZyRHkqkaKHTglnY2EP5UX3b8rdeiSutgO4y9NEJwXezNP5vHg==} + engines: {node: '>=8'} + + path-to-regexp@0.1.12: + resolution: {integrity: sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==} + + path-to-regexp@0.1.7: + resolution: {integrity: sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==} + + path-type@1.1.0: + resolution: {integrity: sha512-S4eENJz1pkiQn9Znv33Q+deTOKmbl+jj1Fl+qiP/vYezj+S8x+J3Uo0ISrx/QoEvIlOaDWJhPaRd1flJ9HXZqg==} + engines: {node: '>=0.10.0'} + + path-type@4.0.0: + resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} + engines: {node: '>=8'} + + pathval@1.1.1: + resolution: {integrity: sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==} + + pbkdf2@3.1.2: + resolution: {integrity: sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA==} + engines: {node: '>=0.12'} + + pegjs@0.10.0: + resolution: {integrity: sha512-qI5+oFNEGi3L5HAxDwN2LA4Gg7irF70Zs25edhjld9QemOgp0CbvMtbFcMvFtEo1OityPrcCzkQFB8JP/hxgow==} + engines: {node: '>=0.10'} + hasBin: true + + performance-now@2.1.0: + resolution: {integrity: sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==} + + pg-cloudflare@1.2.5: + resolution: {integrity: sha512-OOX22Vt0vOSRrdoUPKJ8Wi2OpE/o/h9T8X1s4qSkCedbNah9ei2W2765be8iMVxQUsvgT7zIAT2eIa9fs5+vtg==} + + pg-connection-string@2.8.5: + resolution: {integrity: sha512-Ni8FuZ8yAF+sWZzojvtLE2b03cqjO5jNULcHFfM9ZZ0/JXrgom5pBREbtnAw7oxsxJqHw9Nz/XWORUEL3/IFow==} + + pg-hstore@2.3.4: + resolution: {integrity: sha512-N3SGs/Rf+xA1M2/n0JBiXFDVMzdekwLZLAO0g7mpDY9ouX+fDI7jS6kTq3JujmYbtNSJ53TJ0q4G98KVZSM4EA==} + engines: {node: '>= 0.8.x'} + + pg-int8@1.0.1: + resolution: {integrity: sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==} + engines: {node: '>=4.0.0'} + + pg-pool@3.9.6: + resolution: {integrity: sha512-rFen0G7adh1YmgvrmE5IPIqbb+IgEzENUm+tzm6MLLDSlPRoZVhzU1WdML9PV2W5GOdRA9qBKURlbt1OsXOsPw==} + peerDependencies: + pg: '>=8.0' + + pg-protocol@1.9.5: + resolution: {integrity: sha512-DYTWtWpfd5FOro3UnAfwvhD8jh59r2ig8bPtc9H8Ds7MscE/9NYruUQWFAOuraRl29jwcT2kyMFQ3MxeaVjUhg==} + + pg-types@2.2.0: + resolution: {integrity: sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==} + engines: {node: '>=4'} + + pg@8.11.3: + resolution: {integrity: sha512-+9iuvG8QfaaUrrph+kpF24cXkH1YOOUeArRNYIxq1viYHZagBxrTno7cecY1Fa44tJeZvaoG+Djpkc3JwehN5g==} + engines: {node: '>= 8.0.0'} + peerDependencies: + pg-native: '>=3.0.1' + peerDependenciesMeta: + pg-native: + optional: true + + pg@8.7.3: + resolution: {integrity: sha512-HPmH4GH4H3AOprDJOazoIcpI49XFsHCe8xlrjHkWiapdbHK+HLtbm/GQzXYAZwmPju/kzKhjaSfMACG+8cgJcw==} + engines: {node: '>= 8.0.0'} + peerDependencies: + pg-native: '>=2.0.0' + peerDependenciesMeta: + pg-native: + optional: true + + pgpass@1.0.5: + resolution: {integrity: sha512-FdW9r/jQZhSeohs1Z3sI1yxFQNFvMcnmfuj4WBMUTxOrAyLMaTcE1aAMBiTlbMNaXvBCQuVi0R7hd8udDSP7ug==} + + picocolors@1.1.1: + resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} + + picomatch@2.3.1: + resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} + engines: {node: '>=8.6'} + + picomatch@4.0.2: + resolution: {integrity: sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==} + engines: {node: '>=12'} + + pidtree@0.5.0: + resolution: {integrity: sha512-9nxspIM7OpZuhBxPg73Zvyq7j1QMPMPsGKTqRc2XOaFQauDvoNz9fM1Wdkjmeo7l9GXOZiRs97sPkuayl39wjA==} + engines: {node: '>=0.10'} + hasBin: true + + pidtree@0.6.0: + resolution: {integrity: sha512-eG2dWTVw5bzqGRztnHExczNxt5VGsE6OwTeCG3fdUf9KBsZzO3R5OIIIzWR+iZA0NtZ+RDVdaoE2dK1cn6jH4g==} + engines: {node: '>=0.10'} + hasBin: true + + pify@2.3.0: + resolution: {integrity: sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==} + engines: {node: '>=0.10.0'} + + pify@4.0.1: + resolution: {integrity: sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==} + engines: {node: '>=6'} + + pinkie-promise@2.0.1: + resolution: {integrity: sha512-0Gni6D4UcLTbv9c57DfxDGdr41XfgUjqWZu492f0cIGr16zDU06BWP/RAEvOuo7CQ0CNjHaLlM59YJJFm3NWlw==} + engines: {node: '>=0.10.0'} + + pinkie@2.0.4: + resolution: {integrity: sha512-MnUuEycAemtSaeFSjXKW/aroV7akBbY+Sv+RkyqFjgAe73F+MR0TBWKBRDkmfWq/HiFmdavfZ1G7h4SPZXaCSg==} + engines: {node: '>=0.10.0'} + + pino-abstract-transport@0.5.0: + resolution: {integrity: sha512-+KAgmVeqXYbTtU2FScx1XS3kNyfZ5TrXY07V96QnUSFqo2gAqlvmaxH67Lj7SWazqsMabf+58ctdTcBgnOLUOQ==} + + pino-multi-stream@6.0.0: + resolution: {integrity: sha512-oCuTtaDSUB5xK1S45r9oWE0Dj8RWdHVvaGTft5pO/rmzgIqQRkilf5Ooilz3uRm0IYj8sPRho3lVx48LCmXjvQ==} + deprecated: No longer supported. Use the multi-stream support in the latest core Pino + + pino-std-serializers@4.0.0: + resolution: {integrity: sha512-cK0pekc1Kjy5w9V2/n+8MkZwusa6EyyxfeQCB799CQRhRt/CqYKiWs5adeu8Shve2ZNffvfC/7J64A2PJo1W/Q==} + + pino@7.6.0: + resolution: {integrity: sha512-CCCdryvM/chT0CDt9jQ1//z62RpSXPrzUFUpY4b8eKCVq3T2T3UF6DomoczkPze9d6VFiTyVF6Y8A6F9iAyAxg==} + hasBin: true + + pirates@4.0.7: + resolution: {integrity: sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA==} + engines: {node: '>= 6'} + + please-upgrade-node@3.2.0: + resolution: {integrity: sha512-gQR3WpIgNIKwBMVLkpMUeR3e1/E1y42bqDQZfql+kDeXd8COYfM8PQA4X6y7a8u9Ua9FHmsrrmirW2vHs45hWg==} + + pluralize@8.0.0: + resolution: {integrity: sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==} + engines: {node: '>=4'} + + posix-character-classes@0.1.1: + resolution: {integrity: sha512-xTgYBc3fuo7Yt7JbiuFxSYGToMoz8fLoE6TC9Wx1P/u+LfeThMOAqmuyECnlBaaJb+u1m9hHiXUEtwW4OzfUJg==} + engines: {node: '>=0.10.0'} + + possible-typed-array-names@1.1.0: + resolution: {integrity: sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==} + engines: {node: '>= 0.4'} + + postgres-array@2.0.0: + resolution: {integrity: sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==} + engines: {node: '>=4'} + + postgres-bytea@1.0.0: + resolution: {integrity: sha512-xy3pmLuQqRBZBXDULy7KbaitYqLcmxigw14Q5sj8QBVLqEwXfeybIKVWiqAXTlcvdvb0+xkOtDbfQMOf4lST1w==} + engines: {node: '>=0.10.0'} + + postgres-date@1.0.7: + resolution: {integrity: sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==} + engines: {node: '>=0.10.0'} + + postgres-interval@1.2.0: + resolution: {integrity: sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==} + engines: {node: '>=0.10.0'} + + postinstall-postinstall@2.1.0: + resolution: {integrity: sha512-7hQX6ZlZXIoRiWNrbMQaLzUUfH+sSx39u8EJ9HYuDc1kLo9IXKWjM5RSquZN1ad5GnH8CGFM78fsAAQi3OKEEQ==} + + prebuild-install@5.3.6: + resolution: {integrity: sha512-s8Aai8++QQGi4sSbs/M1Qku62PFK49Jm1CbgXklGz4nmHveDq0wzJkg7Na5QbnO1uNH8K7iqx2EQ/mV0MZEmOg==} + engines: {node: '>=6'} + hasBin: true + + prebuild-install@6.1.4: + resolution: {integrity: sha512-Z4vpywnK1lBg+zdPCVCsKq0xO66eEV9rWo2zrROGGiRS4JtueBOdlB1FnY8lcy7JsUud/Q3ijUxyWN26Ika0vQ==} + engines: {node: '>=6'} + hasBin: true + + precond@0.2.3: + resolution: {integrity: sha512-QCYG84SgGyGzqJ/vlMsxeXd/pgL/I94ixdNFyh1PusWmTCyVfPJjZ1K1jvHtsbfnXQs2TSkEP2fR7QiMZAnKFQ==} + engines: {node: '>= 0.6'} + + prelude-ls@1.1.2: + resolution: {integrity: sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==} + engines: {node: '>= 0.8.0'} + + prelude-ls@1.2.1: + resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} + engines: {node: '>= 0.8.0'} + + prepend-http@2.0.0: + resolution: {integrity: sha512-ravE6m9Atw9Z/jjttRUZ+clIXogdghyZAuWJ3qEzjT+jI/dL1ifAqhZeC5VHzQp1MSt1+jxKkFNemj/iO7tVUA==} + engines: {node: '>=4'} + + preserve@0.2.0: + resolution: {integrity: sha512-s/46sYeylUfHNjI+sA/78FAHlmIuKqI9wNnzEOGehAlUUYeObv5C2mOinXBjyUyWmJ2SfcS2/ydApH4hTF4WXQ==} + engines: {node: '>=0.10.0'} + + prettier-linter-helpers@1.0.0: + resolution: {integrity: sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==} + engines: {node: '>=6.0.0'} + + prettier-plugin-solidity@1.4.3: + resolution: {integrity: sha512-Mrr/iiR9f9IaeGRMZY2ApumXcn/C5Gs3S7B7hWB3gigBFML06C0yEyW86oLp0eqiA0qg+46FaChgLPJCj/pIlg==} + engines: {node: '>=18'} + peerDependencies: + prettier: '>=2.3.0' + + prettier@2.8.8: + resolution: {integrity: sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==} + engines: {node: '>=10.13.0'} + hasBin: true + + prettier@3.5.3: + resolution: {integrity: sha512-QQtaxnoDJeAkDvDKWCLiwIXkTgRhwYDEQCghU9Z6q03iyek/rxRh/2lC3HB7P8sWT2xC/y5JDctPLBIGzHKbhw==} + engines: {node: '>=14'} + hasBin: true + + pretty-format@29.7.0: + resolution: {integrity: sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + private@0.1.8: + resolution: {integrity: sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==} + engines: {node: '>= 0.6'} + + process-nextick-args@2.0.1: + resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==} + + process@0.11.10: + resolution: {integrity: sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==} + engines: {node: '>= 0.6.0'} + + prom-client@14.0.1: + resolution: {integrity: sha512-HxTArb6fkOntQHoRGvv4qd/BkorjliiuO2uSWC2KC17MUTKYttWdDoXX/vxOhQdkoECEM9BBH0pj2l8G8kev6w==} + engines: {node: '>=10'} + + prom-client@14.2.0: + resolution: {integrity: sha512-sF308EhTenb/pDRPakm+WgiN+VdM/T1RaHj1x+MvAuT8UiQP8JmOEbxVqtkbfR4LrvOg5n7ic01kRBDGXjYikA==} + engines: {node: '>=10'} + + promise-to-callback@1.0.0: + resolution: {integrity: sha512-uhMIZmKM5ZteDMfLgJnoSq9GCwsNKrYau73Awf1jIy6/eUcuuZ3P+CD9zUv0kJsIUbU+x6uLNIhXhLHDs1pNPA==} + engines: {node: '>=0.10.0'} + + promise@7.3.1: + resolution: {integrity: sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg==} + + promise@8.3.0: + resolution: {integrity: sha512-rZPNPKTOYVNEEKFaq1HqTgOwZD+4/YHS5ukLzQCypkj+OkYx7iv0mA91lJlpPPZ8vMau3IIGj5Qlwrx+8iiSmg==} + + prompt-sync@4.2.0: + resolution: {integrity: sha512-BuEzzc5zptP5LsgV5MZETjDaKSWfchl5U9Luiu8SKp7iZWD5tZalOxvNcZRwv+d2phNFr8xlbxmFNcRKfJOzJw==} + + prompts@2.4.2: + resolution: {integrity: sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==} + engines: {node: '>= 6'} + + proper-lockfile@4.1.2: + resolution: {integrity: sha512-TjNPblN4BwAWMXU8s9AEz4JmQxnD1NNL7bNOY/AKUzyamc379FWASUhc/K1pL2noVb+XmZKLL68cjzLsiOAMaA==} + + proto-list@1.2.4: + resolution: {integrity: sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==} + + protocol-buffers-schema@3.6.0: + resolution: {integrity: sha512-TdDRD+/QNdrCGCE7v8340QyuXd4kIWIgapsE2+n/SaGiSSbomYl4TjHlvIoCWRpE7wFt02EpB35VVA2ImcBVqw==} + + protons@2.0.3: + resolution: {integrity: sha512-j6JikP/H7gNybNinZhAHMN07Vjr1i4lVupg598l4I9gSTjJqOvKnwjzYX2PzvBTSVf2eZ2nWv4vG+mtW8L6tpA==} + + proxy-addr@2.0.7: + resolution: {integrity: sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==} + engines: {node: '>= 0.10'} + + proxy-from-env@1.1.0: + resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} + + prr@1.0.1: + resolution: {integrity: sha512-yPw4Sng1gWghHQWj0B3ZggWUm4qVbPwPFcRG8KyxiU7J2OHFSoEHKS+EZ3fv5l1t9CyCiop6l/ZYeWbrgoQejw==} + + pseudomap@1.0.2: + resolution: {integrity: sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==} + + psl@1.15.0: + resolution: {integrity: sha512-JZd3gMVBAVQkSs6HdNZo9Sdo0LNcQeMNP3CozBJb3JYC/QUYZTnKxP+f8oWRX4rHP5EurWxqAHTSwUCjlNKa1w==} + + public-encrypt@4.0.3: + resolution: {integrity: sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==} + + pull-cat@1.1.11: + resolution: {integrity: sha512-i3w+xZ3DCtTVz8S62hBOuNLRHqVDsHMNZmgrZsjPnsxXUgbWtXEee84lo1XswE7W2a3WHyqsNuDJTjVLAQR8xg==} + + pull-defer@0.2.3: + resolution: {integrity: sha512-/An3KE7mVjZCqNhZsr22k1Tx8MACnUnHZZNPSJ0S62td8JtYr/AiRG42Vz7Syu31SoTLUzVIe61jtT/pNdjVYA==} + + pull-level@2.0.4: + resolution: {integrity: sha512-fW6pljDeUThpq5KXwKbRG3X7Ogk3vc75d5OQU/TvXXui65ykm+Bn+fiktg+MOx2jJ85cd+sheufPL+rw9QSVZg==} + + pull-live@1.0.1: + resolution: {integrity: sha512-tkNz1QT5gId8aPhV5+dmwoIiA1nmfDOzJDlOOUpU5DNusj6neNd3EePybJ5+sITr2FwyCs/FVpx74YMCfc8YeA==} + + pull-pushable@2.2.0: + resolution: {integrity: sha512-M7dp95enQ2kaHvfCt2+DJfyzgCSpWVR2h2kWYnVsW6ZpxQBx5wOu0QWOvQPVoPnBLUZYitYP2y7HyHkLQNeGXg==} + + pull-stream@3.7.0: + resolution: {integrity: sha512-Eco+/R004UaCK2qEDE8vGklcTG2OeZSVm1kTUQNrykEjDwcFXDZhygFDsW49DbXyJMEhHeRL3z5cRVqPAhXlIw==} + + pull-window@2.1.4: + resolution: {integrity: sha512-cbDzN76BMlcGG46OImrgpkMf/VkCnupj8JhsrpBw3aWBM9ye345aYnqitmZCgauBkc0HbbRRn9hCnsa3k2FNUg==} + + pump@3.0.2: + resolution: {integrity: sha512-tUPXtzlGM8FE3P0ZL6DVs/3P58k9nk8/jZeQCurTJylQA8qFYzHFfhBJkuqyE0FifOsQ0uKWekiZ5g8wtr28cw==} + + pumpify@2.0.1: + resolution: {integrity: sha512-m7KOje7jZxrmutanlkS1daj1dS6z6BgslzOXmcSEpIlCxM3VJH7lG5QLeck/6hgF6F4crFf01UtQmNsJfweTAw==} + + punycode@1.4.1: + resolution: {integrity: sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ==} + + punycode@2.1.0: + resolution: {integrity: sha512-Yxz2kRwT90aPiWEMHVYnEf4+rhwF1tBmmZ4KepCP+Wkium9JxtWnUm1nqGwpiAHr/tnTSeHqr3wb++jgSkXjhA==} + engines: {node: '>=6'} + + punycode@2.3.1: + resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} + engines: {node: '>=6'} + + pvtsutils@1.3.6: + resolution: {integrity: sha512-PLgQXQ6H2FWCaeRak8vvk1GW462lMxB5s3Jm673N82zI4vqtVUPuZdffdZbPDFRoU8kAhItWFtPCWiPpp4/EDg==} + + pvutils@1.1.3: + resolution: {integrity: sha512-pMpnA0qRdFp32b1sJl1wOJNxZLQ2cbQx+k6tjNtZ8CpvVhNqEPRgivZ2WOUev2YMajecdH7ctUPDvEe87nariQ==} + engines: {node: '>=6.0.0'} + + q@1.5.1: + resolution: {integrity: sha512-kV/CThkXo6xyFEZUugw/+pIOywXcDbFYgSct5cT3gqlbkBE1SJdwy6UQoZvodiWF/ckQLZyDE/Bu1M6gVu5lVw==} + engines: {node: '>=0.6.0', teleport: '>=0.2.0'} + deprecated: |- + You or someone you depend on is using Q, the JavaScript Promise library that gave JavaScript developers strong feelings about promises. They can almost certainly migrate to the native JavaScript promise now. Thank you literally everyone for joining me in this bet against the odds. Be excellent to each other. + + (For a CapTP with native promises, see @endo/eventual-send and @endo/captp) + + qs@6.11.0: + resolution: {integrity: sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==} + engines: {node: '>=0.6'} + + qs@6.13.0: + resolution: {integrity: sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==} + engines: {node: '>=0.6'} + + qs@6.14.0: + resolution: {integrity: sha512-YWWTjgABSKcvs/nWBi9PycY/JiPJqOD4JA6o9Sej2AtvSGarXxKC3OQSk4pAarbdQlKAh5D4FCQkJNkW+GAn3w==} + engines: {node: '>=0.6'} + + qs@6.5.3: + resolution: {integrity: sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==} + engines: {node: '>=0.6'} + + qs@6.9.6: + resolution: {integrity: sha512-TIRk4aqYLNoJUbd+g2lEdz5kLWIuTMRagAXxl78Q0RiVjAOugHmeKNGdd3cwo/ktpf9aL9epCfFqWDEKysUlLQ==} + engines: {node: '>=0.6'} + + qs@6.9.7: + resolution: {integrity: sha512-IhMFgUmuNpyRfxA90umL7ByLlgRXu6tIfKPpF5TmcfRLlLCckfP/g3IQmju6jjpu+Hh8rA+2p6A27ZSPOOHdKw==} + engines: {node: '>=0.6'} + + quansync@0.2.10: + resolution: {integrity: sha512-t41VRkMYbkHyCYmOvx/6URnN80H7k4X0lLdBMGsz+maAwrJQYB1djpV6vHrQIBE0WBSGqhtEHrK9U3DWWH8v7A==} + + query-string@5.1.1: + resolution: {integrity: sha512-gjWOsm2SoGlgLEdAGt7a6slVOk9mGiXmPFMqrEhLQ68rhQuBnpfs3+EmlvqKyxnCo9/PPlF+9MtY02S1aFg+Jw==} + engines: {node: '>=0.10.0'} + + queue-microtask@1.2.3: + resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} + + queue@6.0.2: + resolution: {integrity: sha512-iHZWu+q3IdFZFX36ro/lKBkSvfkztY5Y7HMiPlOUjhupPcG2JMfst2KKEpu5XndviX/3UhFbRngUPNKtgvtZiA==} + + quick-format-unescaped@4.0.4: + resolution: {integrity: sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg==} + + quick-lru@4.0.1: + resolution: {integrity: sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==} + engines: {node: '>=8'} + + quick-lru@5.1.1: + resolution: {integrity: sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==} + engines: {node: '>=10'} + + randomatic@3.1.1: + resolution: {integrity: sha512-TuDE5KxZ0J461RVjrJZCJc+J+zCkTb1MbH9AQUq68sMhOMcy9jLcb3BrZKgp9q9Ncltdg4QVqWrH02W2EFFVYw==} + engines: {node: '>= 0.10.0'} + + randombytes@2.1.0: + resolution: {integrity: sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==} + + randomfill@1.0.4: + resolution: {integrity: sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==} + + range-parser@1.2.1: + resolution: {integrity: sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==} + engines: {node: '>= 0.6'} + + raw-body@2.4.2: + resolution: {integrity: sha512-RPMAFUJP19WIet/99ngh6Iv8fzAbqum4Li7AD6DtGaW2RpMB/11xDoalPiJMTbu6I3hkbMVkATvZrqb9EEqeeQ==} + engines: {node: '>= 0.8'} + + raw-body@2.4.3: + resolution: {integrity: sha512-UlTNLIcu0uzb4D2f4WltY6cVjLi+/jEN4lgEUj3E04tpMDpUlkBo/eSn6zou9hum2VMNpCCUone0O0WeJim07g==} + engines: {node: '>= 0.8'} + + raw-body@2.5.1: + resolution: {integrity: sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==} + engines: {node: '>= 0.8'} + + raw-body@2.5.2: + resolution: {integrity: sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==} + engines: {node: '>= 0.8'} + + rc@1.2.8: + resolution: {integrity: sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==} + hasBin: true + + react-devtools-core@6.1.1: + resolution: {integrity: sha512-TFo1MEnkqE6hzAbaztnyR5uLTMoz6wnEWwWBsCUzNt+sVXJycuRJdDqvL078M4/h65BI/YO5XWTaxZDWVsW0fw==} + + react-is@18.3.1: + resolution: {integrity: sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==} + + react-native-fs@2.20.0: + resolution: {integrity: sha512-VkTBzs7fIDUiy/XajOSNk0XazFE9l+QlMAce7lGuebZcag5CnjszB+u4BdqzwaQOdcYb5wsJIsqq4kxInIRpJQ==} + peerDependencies: + react-native: '*' + react-native-windows: '*' + peerDependenciesMeta: + react-native-windows: + optional: true + + react-native-path@0.0.5: + resolution: {integrity: sha512-WJr256xBquk7X2O83QYWKqgLg43Zg3SrgjPc/kr0gCD2LoXA+2L72BW4cmstH12GbGeutqs/eXk3jgDQ2iCSvQ==} + + react-native@0.79.2: + resolution: {integrity: sha512-AnGzb56JvU5YCL7cAwg10+ewDquzvmgrMddiBM0GAWLwQM/6DJfGd2ZKrMuKKehHerpDDZgG+EY64gk3x3dEkw==} + engines: {node: '>=18'} + hasBin: true + peerDependencies: + '@types/react': ^19.0.0 + react: ^19.0.0 + peerDependenciesMeta: + '@types/react': + optional: true + + react-refresh@0.14.2: + resolution: {integrity: sha512-jCvmsr+1IUSMUyzOkRcvnVbX3ZYC6g9TDrDbFuFmRDq7PD4yaGbLKNQL6k2jnArV8hjYxh7hVhAZB6s9HDGpZA==} + engines: {node: '>=0.10.0'} + + react@19.1.0: + resolution: {integrity: sha512-FS+XFBNvn3GTAWq26joslQgWNoFu08F4kl0J4CgdNKADkdSGXQyTCnKteIAJy96Br6YbpEU1LSzV5dYtjMkMDg==} + engines: {node: '>=0.10.0'} + + read-pkg-up@1.0.1: + resolution: {integrity: sha512-WD9MTlNtI55IwYUS27iHh9tK3YoIVhxis8yKhLpTqWtml739uXc9NWTpxoHkfZf3+DkCCsXox94/VWZniuZm6A==} + engines: {node: '>=0.10.0'} + + read-pkg-up@7.0.1: + resolution: {integrity: sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==} + engines: {node: '>=8'} + + read-pkg@1.1.0: + resolution: {integrity: sha512-7BGwRHqt4s/uVbuyoeejRn4YmFnYZiFl4AuaeXHlgZf3sONF0SOGlxs2Pw8g6hCKupo08RafIO5YXFNOKTfwsQ==} + engines: {node: '>=0.10.0'} + + read-pkg@5.2.0: + resolution: {integrity: sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==} + engines: {node: '>=8'} + + read-yaml-file@1.1.0: + resolution: {integrity: sha512-VIMnQi/Z4HT2Fxuwg5KrY174U1VdUIASQVWXXyqtNRtxSr9IYkn1rsI6Tb6HsrHCmB7gVpNwX6JxPTHcH6IoTA==} + engines: {node: '>=6'} + + readable-stream@1.0.34: + resolution: {integrity: sha512-ok1qVCJuRkNmvebYikljxJA/UEsKwLl2nI1OmaqAu4/UE+h0wKCHok4XkL/gvi39OacXvw59RJUOFUkDib2rHg==} + + readable-stream@1.1.14: + resolution: {integrity: sha512-+MeVjFf4L44XUkhM1eYbD8fyEsxcV81pqMSR5gblfcLCHfZvbrqy4/qYHE+/R5HoBUT11WV5O08Cr1n3YXkWVQ==} + + readable-stream@2.3.8: + resolution: {integrity: sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==} + + readable-stream@3.6.2: + resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} + engines: {node: '>= 6'} + + readdirp@2.2.1: + resolution: {integrity: sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==} + engines: {node: '>=0.10'} + + readdirp@3.6.0: + resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} + engines: {node: '>=8.10.0'} + + readdirp@4.1.2: + resolution: {integrity: sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==} + engines: {node: '>= 14.18.0'} + + real-require@0.1.0: + resolution: {integrity: sha512-r/H9MzAWtrv8aSVjPCMFpDMl5q66GqtmmRkRjpHTsp4zBAa+snZyiQNlMONiUmEJcsnaw0wCauJ2GWODr/aFkg==} + engines: {node: '>= 12.13.0'} + + receptacle@1.3.2: + resolution: {integrity: sha512-HrsFvqZZheusncQRiEE7GatOAETrARKV/lnfYicIm8lbvp/JQOdADOfhjBd2DajvoszEyxSM6RlAAIZgEoeu/A==} + + rechoir@0.6.2: + resolution: {integrity: sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw==} + engines: {node: '>= 0.10'} + + recursive-readdir@2.2.3: + resolution: {integrity: sha512-8HrF5ZsXk5FAH9dgsx3BlUer73nIhuj+9OrQwEbLTPOBzGkL1lsFCR01am+v+0m2Cmbs1nP12hLDl5FA7EszKA==} + engines: {node: '>=6.0.0'} + + redent@3.0.0: + resolution: {integrity: sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==} + engines: {node: '>=8'} + + reduce-flatten@2.0.0: + resolution: {integrity: sha512-EJ4UNY/U1t2P/2k6oqotuX2Cc3T6nxJwsM0N0asT7dhrtH1ltUxDn4NalSYmPE2rCkVpcf/X6R0wDwcFpzhd4w==} + engines: {node: '>=6'} + + reflect.getprototypeof@1.0.10: + resolution: {integrity: sha512-00o4I+DVrefhv+nX0ulyi3biSHCPDe+yLv5o/p6d/UVlirijB8E16FtfwSAi4g3tcqrQ4lRAqQSoFEZJehYEcw==} + engines: {node: '>= 0.4'} + + regenerate@1.4.2: + resolution: {integrity: sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==} + + regenerator-runtime@0.11.1: + resolution: {integrity: sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==} + + regenerator-runtime@0.13.11: + resolution: {integrity: sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==} + + regenerator-transform@0.10.1: + resolution: {integrity: sha512-PJepbvDbuK1xgIgnau7Y90cwaAmO/LCLMI2mPvaXq2heGMR3aWW5/BQvYrhJ8jgmQjXewXvBjzfqKcVOmhjZ6Q==} + + regex-cache@0.4.4: + resolution: {integrity: sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==} + engines: {node: '>=0.10.0'} + + regex-not@1.0.2: + resolution: {integrity: sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==} + engines: {node: '>=0.10.0'} + + regexp.prototype.flags@1.5.4: + resolution: {integrity: sha512-dYqgNSZbDwkaJ2ceRd9ojCGjBq+mOm9LmtXnAnEGyHhN/5R7iDW2TRw3h+o/jCFxus3P2LfWIIiwowAjANm7IA==} + engines: {node: '>= 0.4'} + + regexpu-core@2.0.0: + resolution: {integrity: sha512-tJ9+S4oKjxY8IZ9jmjnp/mtytu1u3iyIQAfmI51IKWH6bFf7XR1ybtaO6j7INhZKXOTYADk7V5qxaqLkmNxiZQ==} + + registry-auth-token@5.1.0: + resolution: {integrity: sha512-GdekYuwLXLxMuFTwAPg5UKGLW/UXzQrZvH/Zj791BQif5T05T0RsaLfHc9q3ZOKi7n+BoprPD9mJ0O0k4xzUlw==} + engines: {node: '>=14'} + + registry-url@6.0.1: + resolution: {integrity: sha512-+crtS5QjFRqFCoQmvGduwYWEBng99ZvmFvF+cUJkGYF1L1BfU8C6Zp9T7f5vPAwyLkUExpvK+ANVZmGU49qi4Q==} + engines: {node: '>=12'} + + regjsgen@0.2.0: + resolution: {integrity: sha512-x+Y3yA24uF68m5GA+tBjbGYo64xXVJpbToBaWCoSNSc1hdk6dfctaRWrNFTVJZIIhL5GxW8zwjoixbnifnK59g==} + + regjsparser@0.1.5: + resolution: {integrity: sha512-jlQ9gYLfk2p3V5Ag5fYhA7fv7OHzd1KUH0PRP46xc3TgwjwgROIW572AfYg/X9kaNq/LJnu6oJcFRXlIrGoTRw==} + hasBin: true + + relay-runtime@12.0.0: + resolution: {integrity: sha512-QU6JKr1tMsry22DXNy9Whsq5rmvwr3LSZiiWV/9+DFpuTWvp+WFhobWMc8TC4OjKFfNhEZy7mOiqUAn5atQtug==} + + remove-trailing-separator@1.1.0: + resolution: {integrity: sha512-/hS+Y0u3aOfIETiaiirUFwDBDzmXPvO+jAfKTitUngIPzdKc6Z0LoFjM/CK5PL4C+eKwHohlHAb6H0VFfmmUsw==} + + repeat-element@1.1.4: + resolution: {integrity: sha512-LFiNfRcSu7KK3evMyYOuCzv3L10TW7yC1G2/+StMjK8Y6Vqd2MG7r/Qjw4ghtuCOjFvlnms/iMmLqpvW/ES/WQ==} + engines: {node: '>=0.10.0'} + + repeat-string@1.6.1: + resolution: {integrity: sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w==} + engines: {node: '>=0.10'} + + repeating@2.0.1: + resolution: {integrity: sha512-ZqtSMuVybkISo2OWvqvm7iHSWngvdaW3IpsT9/uP8v4gMi591LY6h35wdOfvQdWCKFWZWm2Y1Opp4kV7vQKT6A==} + engines: {node: '>=0.10.0'} + + req-cwd@2.0.0: + resolution: {integrity: sha512-ueoIoLo1OfB6b05COxAA9UpeoscNpYyM+BqYlA7H6LVF4hKGPXQQSSaD2YmvDVJMkk4UDpAHIeU1zG53IqjvlQ==} + engines: {node: '>=4'} + + req-from@2.0.0: + resolution: {integrity: sha512-LzTfEVDVQHBRfjOUMgNBA+V6DWsSnoeKzf42J7l0xa/B4jyPOuuF5MlNSmomLNGemWTnV2TIdjSSLnEn95fOQA==} + engines: {node: '>=4'} + + request@2.88.2: + resolution: {integrity: sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==} + engines: {node: '>= 6'} + deprecated: request has been deprecated, see https://github.com/request/request/issues/3142 + + require-directory@2.1.1: + resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} + engines: {node: '>=0.10.0'} + + require-from-string@1.2.1: + resolution: {integrity: sha512-H7AkJWMobeskkttHyhTVtS0fxpFLjxhbfMa6Bk3wimP7sdPRGL3EyCg3sAQenFfAe+xQ+oAc85Nmtvq0ROM83Q==} + engines: {node: '>=0.10.0'} + + require-from-string@2.0.2: + resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==} + engines: {node: '>=0.10.0'} + + require-main-filename@1.0.1: + resolution: {integrity: sha512-IqSUtOVP4ksd1C/ej5zeEh/BIP2ajqpn8c5x+q99gvcIG/Qf0cud5raVnE/Dwd0ua9TXYDoDc0RE5hBSdz22Ug==} + + require-main-filename@2.0.0: + resolution: {integrity: sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==} + + reset@0.1.0: + resolution: {integrity: sha512-RF7bp2P2ODreUPA71FZ4DSK52gNLJJ8dSwA1nhOCoC0mI4KZ4D/W6zhd2nfBqX/JlR+QZ/iUqAYPjq1UQU8l0Q==} + engines: {node: '>= 0.8.0'} + + resolve-alpn@1.2.1: + resolution: {integrity: sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g==} + + resolve-dir@1.0.1: + resolution: {integrity: sha512-R7uiTjECzvOsWSfdM0QKFNBVFcK27aHOUwdvK53BcW8zqnGdYp0Fbj82cy54+2A4P2tFM22J5kRfe1R+lM/1yg==} + engines: {node: '>=0.10.0'} + + resolve-from@3.0.0: + resolution: {integrity: sha512-GnlH6vxLymXJNMBo7XP1fJIzBFbdYt49CuTwmB/6N53t+kMPRMFKz783LlQ4tv28XoQfMWinAJX6WCGf2IlaIw==} + engines: {node: '>=4'} + + resolve-from@4.0.0: + resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} + engines: {node: '>=4'} + + resolve-from@5.0.0: + resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} + engines: {node: '>=8'} + + resolve-global@1.0.0: + resolution: {integrity: sha512-zFa12V4OLtT5XUX/Q4VLvTfBf+Ok0SPc1FNGM/z9ctUdiU618qwKpWnd0CHs3+RqROfyEg/DhuHbMWYqcgljEw==} + engines: {node: '>=8'} + + resolve-url@0.2.1: + resolution: {integrity: sha512-ZuF55hVUQaaczgOIwqWzkEcEidmlD/xl44x1UZnhOXcYuFN2S6+rcxpG+C1N3So0wvNI3DmJICUFfu2SxhBmvg==} + deprecated: https://github.com/lydell/resolve-url#deprecated + + resolve@1.1.7: + resolution: {integrity: sha512-9znBF0vBcaSN3W2j7wKvdERPwqTxSpCq+if5C0WoTCyV9n24rua28jeuQ2pL/HOf+yUe/Mef+H/5p60K0Id3bg==} + + resolve@1.17.0: + resolution: {integrity: sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==} + + resolve@1.22.10: + resolution: {integrity: sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w==} + engines: {node: '>= 0.4'} + hasBin: true + + responselike@1.0.2: + resolution: {integrity: sha512-/Fpe5guzJk1gPqdJLJR5u7eG/gNY4nImjbRDaVWVMRhne55TCmj2i9Q+54PBRfatRC8v/rIiv9BN0pMd9OV5EQ==} + + responselike@2.0.1: + resolution: {integrity: sha512-4gl03wn3hj1HP3yzgdI7d3lCkF95F21Pz4BPGvKHinyQzALR5CapwC8yIi0Rh58DEMQ/SguC03wFj2k0M/mHhw==} + + responselike@3.0.0: + resolution: {integrity: sha512-40yHxbNcl2+rzXvZuVkrYohathsSJlMTXKryG5y8uciHv1+xDLHQpgjG64JUO9nrEq2jGLH6IZ8BcZyw3wrweg==} + engines: {node: '>=14.16'} + + restore-cursor@3.1.0: + resolution: {integrity: sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==} + engines: {node: '>=8'} + + restore-cursor@5.1.0: + resolution: {integrity: sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==} + engines: {node: '>=18'} + + ret@0.1.15: + resolution: {integrity: sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==} + engines: {node: '>=0.12'} + + retry-as-promised@5.0.0: + resolution: {integrity: sha512-6S+5LvtTl2ggBumk04hBo/4Uf6fRJUwIgunGZ7CYEBCeufGFW1Pu6ucUf/UskHeWOIsUcLOGLFXPig5tR5V1nA==} + + retry-as-promised@7.1.1: + resolution: {integrity: sha512-hMD7odLOt3LkTjcif8aRZqi/hybjpLNgSk5oF5FCowfCjok6LukpN2bDX7R5wDmbgBQFn7YoBxSagmtXHaJYJw==} + + retry@0.12.0: + resolution: {integrity: sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==} + engines: {node: '>= 4'} + + retry@0.13.1: + resolution: {integrity: sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg==} + engines: {node: '>= 4'} + + reusify@1.1.0: + resolution: {integrity: sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==} + engines: {iojs: '>=1.0.0', node: '>=0.10.0'} + + rfdc@1.4.1: + resolution: {integrity: sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==} + + rimraf@2.7.1: + resolution: {integrity: sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==} + deprecated: Rimraf versions prior to v4 are no longer supported + hasBin: true + + rimraf@3.0.2: + resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} + deprecated: Rimraf versions prior to v4 are no longer supported + hasBin: true + + rimraf@5.0.10: + resolution: {integrity: sha512-l0OE8wL34P4nJH/H2ffoaniAokM2qSmrtXHmlpvYr5AVVX8msAyW0l8NVJFDxlSK4u3Uh/f41cQheDVdnYijwQ==} + hasBin: true + + ripemd160@2.0.2: + resolution: {integrity: sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==} + + rlp@2.2.7: + resolution: {integrity: sha512-d5gdPmgQ0Z+AklL2NVXr/IoSjNZFfTVvQWzL/AM2AOcSzYP2xjlb0AC8YyCLc41MSNf6P6QVtjgPdmVtzb+4lQ==} + hasBin: true + + run-async@2.4.1: + resolution: {integrity: sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==} + engines: {node: '>=0.12.0'} + + run-parallel-limit@1.1.0: + resolution: {integrity: sha512-jJA7irRNM91jaKc3Hcl1npHsFLOXOoTkPCUL1JEa1R82O2miplXXRaGdjW/KM/98YQWDhJLiSs793CnXfblJUw==} + + run-parallel@1.2.0: + resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} + + run@1.5.0: + resolution: {integrity: sha512-CBPzeX6JQZUdhZpSFyNt2vUk44ivKMWZYCNBYoZYEE46mL9nf6WyMP3320WnzIrJuo89+njiUvlo83jUEXjXLg==} + engines: {node: '>=v0.9.0'} + hasBin: true + + rustbn.js@0.2.0: + resolution: {integrity: sha512-4VlvkRUuCJvr2J6Y0ImW7NvTCriMi7ErOAqWk1y69vAdoNIzCF3yPmgeNzx+RQTLEDFq5sHfscn1MwHxP9hNfA==} + + rxjs@6.6.7: + resolution: {integrity: sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==} + engines: {npm: '>=2.0.0'} + + rxjs@7.8.2: + resolution: {integrity: sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==} + + safe-array-concat@1.1.3: + resolution: {integrity: sha512-AURm5f0jYEOydBj7VQlVvDrjeFgthDdEF5H1dP+6mNpoXOMo1quQqJ4wvJDyRZ9+pO3kGWoOdmV08cSv2aJV6Q==} + engines: {node: '>=0.4'} + + safe-buffer@5.1.2: + resolution: {integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==} + + safe-buffer@5.2.1: + resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} + + safe-event-emitter@1.0.1: + resolution: {integrity: sha512-e1wFe99A91XYYxoQbcq2ZJUWurxEyP8vfz7A7vuUe1s95q8r5ebraVaA1BukYJcpM6V16ugWoD9vngi8Ccu5fg==} + deprecated: Renamed to @metamask/safe-event-emitter + + safe-push-apply@1.0.0: + resolution: {integrity: sha512-iKE9w/Z7xCzUMIZqdBsp6pEQvwuEebH4vdpjcDWnyzaI6yl6O9FHvVpmGelvEHNsoY6wGblkxR6Zty/h00WiSA==} + engines: {node: '>= 0.4'} + + safe-regex-test@1.1.0: + resolution: {integrity: sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==} + engines: {node: '>= 0.4'} + + safe-regex@1.1.0: + resolution: {integrity: sha512-aJXcif4xnaNUzvUuC5gcb46oTS7zvg4jpMTnuqtrEPlR3vFr4pxtdTwaF1Qs3Enjn9HK+ZlwQui+a7z0SywIzg==} + + safe-stable-stringify@2.5.0: + resolution: {integrity: sha512-b3rppTKm9T+PsVCBEOUR46GWI7fdOs00VKZ1+9c1EWDaDMvjQc6tUwuFyIprgGgTcWoVHSKrU8H31ZHA2e0RHA==} + engines: {node: '>=10'} + + safer-buffer@2.1.2: + resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} + + sc-istanbul@0.4.6: + resolution: {integrity: sha512-qJFF/8tW/zJsbyfh/iT/ZM5QNHE3CXxtLJbZsL+CzdJLBsPD7SedJZoUA4d8iAcN2IoMp/Dx80shOOd2x96X/g==} + hasBin: true + + scheduler@0.25.0: + resolution: {integrity: sha512-xFVuu11jh+xcO7JOAGJNOXld8/TcEHK/4CituBUeUb5hqxJLj9YuemAEuvm9gQ/+pgXYfbQuqAkiYu+u7YEsNA==} + + scrypt-js@2.0.4: + resolution: {integrity: sha512-4KsaGcPnuhtCZQCxFxN3GVYIhKFPTdLd8PLC552XwbMndtD0cjRFAhDuuydXQ0h08ZfPgzqe6EKHozpuH74iDw==} + + scrypt-js@3.0.1: + resolution: {integrity: sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==} + + scryptsy@1.2.1: + resolution: {integrity: sha512-aldIRgMozSJ/Gl6K6qmJZysRP82lz83Wb42vl4PWN8SaLFHIaOzLPc9nUUW2jQN88CuGm5q5HefJ9jZ3nWSmTw==} + + secp256k1@4.0.4: + resolution: {integrity: sha512-6JfvwvjUOn8F/jUoBY2Q1v5WY5XS+rj8qSe0v8Y4ezH4InLgTEeOOPQsRll9OV429Pvo6BCHGavIyJfr3TAhsw==} + engines: {node: '>=18.0.0'} + + seedrandom@3.0.1: + resolution: {integrity: sha512-1/02Y/rUeU1CJBAGLebiC5Lbo5FnB22gQbIFFYTLkwvp1xdABZJH1sn4ZT1MzXmPpzv+Rf/Lu2NcsLJiK4rcDg==} + + semaphore@1.1.0: + resolution: {integrity: sha512-O4OZEaNtkMd/K0i6js9SL+gqy0ZCBMgUvlSqHKi4IBdjhe7wB8pwztUk1BbZ1fmrvpwFrPbHzqd2w5pTcJH6LA==} + engines: {node: '>=0.8.0'} + + semver-compare@1.0.0: + resolution: {integrity: sha512-YM3/ITh2MJ5MtzaM429anh+x2jiLVjqILF4m4oyQB18W7Ggea7BfqdH/wGMK7dDiMghv/6WG7znWMwUDzJiXow==} + + semver@5.4.1: + resolution: {integrity: sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==} + hasBin: true + + semver@5.7.2: + resolution: {integrity: sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==} + hasBin: true + + semver@6.3.1: + resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} + hasBin: true + + semver@7.3.7: + resolution: {integrity: sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==} + engines: {node: '>=10'} + hasBin: true + + semver@7.6.0: + resolution: {integrity: sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==} + engines: {node: '>=10'} + hasBin: true + + semver@7.7.1: + resolution: {integrity: sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==} + engines: {node: '>=10'} + hasBin: true + + send@0.17.2: + resolution: {integrity: sha512-UJYB6wFSJE3G00nEivR5rgWp8c2xXvJ3OPWPhmuteU0IKj8nKbG3DrjiOmLwpnHGYWAVwA69zmTm++YG0Hmwww==} + engines: {node: '>= 0.8.0'} + + send@0.18.0: + resolution: {integrity: sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==} + engines: {node: '>= 0.8.0'} + + send@0.19.0: + resolution: {integrity: sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==} + engines: {node: '>= 0.8.0'} + + sentence-case@3.0.4: + resolution: {integrity: sha512-8LS0JInaQMCRoQ7YUytAo/xUu5W2XnQxV2HI/6uM6U7CITS1RqPElr30V6uIqyMKM9lJGRVFy5/4CuzcixNYSg==} + + sequelize-pool@7.1.0: + resolution: {integrity: sha512-G9c0qlIWQSK29pR/5U2JF5dDQeqqHRragoyahj/Nx4KOOQ3CPPfzxnfqFPCSB7x5UgjOgnZ61nSxz+fjDpRlJg==} + engines: {node: '>= 10.0.0'} + + sequelize@6.19.0: + resolution: {integrity: sha512-B3oGIdpYBERDjRDm74h7Ky67f6ZLcmBXOA7HscYObiOSo4pD7VBc9mtm44wNV7unc0uk8I1d30nbZBTQCE377A==} + engines: {node: '>=10.0.0'} + peerDependencies: + ibm_db: '*' + mariadb: '*' + mysql2: '*' + pg: '*' + pg-hstore: '*' + snowflake-sdk: '*' + sqlite3: '*' + tedious: '*' + peerDependenciesMeta: + ibm_db: + optional: true + mariadb: + optional: true + mysql2: + optional: true + pg: + optional: true + pg-hstore: + optional: true + snowflake-sdk: + optional: true + sqlite3: + optional: true + tedious: + optional: true + + sequelize@6.33.0: + resolution: {integrity: sha512-GkeCbqgaIcpyZ1EyXrDNIwktbfMldHAGOVXHGM4x8bxGSRAOql5htDWofPvwpfL/FoZ59CaFmfO3Mosv1lDbQw==} + engines: {node: '>=10.0.0'} + peerDependencies: + ibm_db: '*' + mariadb: '*' + mysql2: '*' + oracledb: '*' + pg: '*' + pg-hstore: '*' + snowflake-sdk: '*' + sqlite3: '*' + tedious: '*' + peerDependenciesMeta: + ibm_db: + optional: true + mariadb: + optional: true + mysql2: + optional: true + oracledb: + optional: true + pg: + optional: true + pg-hstore: + optional: true + snowflake-sdk: + optional: true + sqlite3: + optional: true + tedious: + optional: true + + serialize-error@2.1.0: + resolution: {integrity: sha512-ghgmKt5o4Tly5yEG/UJp8qTd0AN7Xalw4XBtDEKP655B699qMEtra1WlXeE6WIvdEG481JvRxULKsInq/iNysw==} + engines: {node: '>=0.10.0'} + + serialize-javascript@6.0.2: + resolution: {integrity: sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==} + + serve-static@1.14.2: + resolution: {integrity: sha512-+TMNA9AFxUEGuC0z2mevogSnn9MXKb4fa7ngeRMJaaGv8vTwnIEkKi+QGvPt33HSnf8pRS+WGM0EbMtCJLKMBQ==} + engines: {node: '>= 0.8.0'} + + serve-static@1.15.0: + resolution: {integrity: sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==} + engines: {node: '>= 0.8.0'} + + serve-static@1.16.2: + resolution: {integrity: sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==} + engines: {node: '>= 0.8.0'} + + servify@0.1.12: + resolution: {integrity: sha512-/xE6GvsKKqyo1BAY+KxOWXcLpPsUUyji7Qg3bVD7hh1eRze5bR1uYiuDA/k3Gof1s9BTzQZEJK8sNcNGFIzeWw==} + engines: {node: '>=6'} + + set-blocking@2.0.0: + resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} + + set-function-length@1.2.2: + resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==} + engines: {node: '>= 0.4'} + + set-function-name@2.0.2: + resolution: {integrity: sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==} + engines: {node: '>= 0.4'} + + set-immediate-shim@1.0.1: + resolution: {integrity: sha512-Li5AOqrZWCVA2n5kryzEmqai6bKSIvpz5oUJHPVj6+dsbD3X1ixtsY5tEnsaNpH3pFAHmG8eIHUrtEtohrg+UQ==} + engines: {node: '>=0.10.0'} + + set-proto@1.0.0: + resolution: {integrity: sha512-RJRdvCo6IAnPdsvP/7m6bsQqNnn1FCBX5ZNtFL98MmFF/4xAIJTIg1YbHW5DC2W5SKZanrC6i4HsJqlajw/dZw==} + engines: {node: '>= 0.4'} + + set-value@2.0.1: + resolution: {integrity: sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==} + engines: {node: '>=0.10.0'} + + setimmediate@1.0.4: + resolution: {integrity: sha512-/TjEmXQVEzdod/FFskf3o7oOAsGhHf2j1dZqRFbDzq4F3mvvxflIIi4Hd3bLQE9y/CpwqfSQam5JakI/mi3Pog==} + + setimmediate@1.0.5: + resolution: {integrity: sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==} + + setprototypeof@1.2.0: + resolution: {integrity: sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==} + + sha.js@2.4.11: + resolution: {integrity: sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==} + hasBin: true + + sha1@1.1.1: + resolution: {integrity: sha512-dZBS6OrMjtgVkopB1Gmo4RQCDKiZsqcpAQpkV/aaj+FCrCg8r4I4qMkDPQjBgLIxlmu9k4nUbWq6ohXahOneYA==} + + shebang-command@1.2.0: + resolution: {integrity: sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==} + engines: {node: '>=0.10.0'} + + shebang-command@2.0.0: + resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} + engines: {node: '>=8'} + + shebang-regex@1.0.0: + resolution: {integrity: sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==} + engines: {node: '>=0.10.0'} + + shebang-regex@3.0.0: + resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} + engines: {node: '>=8'} + + shell-quote@1.8.2: + resolution: {integrity: sha512-AzqKpGKjrj7EM6rKVQEPpB288oCfnrEIuyoT9cyF4nmGa7V8Zk6f7RRqYisX8X9m+Q7bd632aZW4ky7EhbQztA==} + engines: {node: '>= 0.4'} + + shelljs@0.8.5: + resolution: {integrity: sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow==} + engines: {node: '>=4'} + hasBin: true + + side-channel-list@1.0.0: + resolution: {integrity: sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==} + engines: {node: '>= 0.4'} + + side-channel-map@1.0.1: + resolution: {integrity: sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==} + engines: {node: '>= 0.4'} + + side-channel-weakmap@1.0.2: + resolution: {integrity: sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==} + engines: {node: '>= 0.4'} + + side-channel@1.1.0: + resolution: {integrity: sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==} + engines: {node: '>= 0.4'} + + signal-exit@3.0.7: + resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} + + signal-exit@4.1.0: + resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} + engines: {node: '>=14'} + + signed-varint@2.0.1: + resolution: {integrity: sha512-abgDPg1106vuZZOvw7cFwdCABddfJRz5akcCcchzTbhyhYnsG31y4AlZEgp315T7W3nQq5P4xeOm186ZiPVFzw==} + + signedsource@1.0.0: + resolution: {integrity: sha512-6+eerH9fEnNmi/hyM1DXcRK3pWdoMQtlkQ+ns0ntzunjKqp5i3sKCc80ym8Fib3iaYhdJUOPdhlJWj1tvge2Ww==} + + simple-concat@1.0.1: + resolution: {integrity: sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==} + + simple-get@2.8.2: + resolution: {integrity: sha512-Ijd/rV5o+mSBBs4F/x9oDPtTx9Zb6X9brmnXvMW4J7IR15ngi9q5xxqWBKU744jTZiaXtxaPL7uHG6vtN8kUkw==} + + simple-get@3.1.1: + resolution: {integrity: sha512-CQ5LTKGfCpvE1K0n2us+kuMPbk/q0EKl82s4aheV9oXjFEz6W/Y7oQFVJuU6QG77hRT4Ghb5RURteF5vnWjupA==} + + simple-swizzle@0.2.2: + resolution: {integrity: sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==} + + simple-wcswidth@1.0.1: + resolution: {integrity: sha512-xMO/8eNREtaROt7tJvWJqHBDTMFN4eiQ5I4JRMuilwfnFcV5W9u7RUkueNkdw0jPqGMX36iCywelS5yilTuOxg==} + + sisteransi@1.0.5: + resolution: {integrity: sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==} + + slash@1.0.0: + resolution: {integrity: sha512-3TYDR7xWt4dIqV2JauJr+EJeW356RXijHeUlO+8djJ+uBXPn8/2dpzBc8yQhh583sVvc9CvFAeQVgijsH+PNNg==} + engines: {node: '>=0.10.0'} + + slash@2.0.0: + resolution: {integrity: sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==} + engines: {node: '>=6'} + + slash@3.0.0: + resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} + engines: {node: '>=8'} + + slice-ansi@3.0.0: + resolution: {integrity: sha512-pSyv7bSTC7ig9Dcgbw9AuRNUb5k5V6oDudjZoMBSr13qpLBG7tB+zgCkARjq7xIUgdz5P1Qe8u+rSGdouOOIyQ==} + engines: {node: '>=8'} + + slice-ansi@4.0.0: + resolution: {integrity: sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==} + engines: {node: '>=10'} + + slice-ansi@5.0.0: + resolution: {integrity: sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==} + engines: {node: '>=12'} + + slice-ansi@7.1.0: + resolution: {integrity: sha512-bSiSngZ/jWeX93BqeIAbImyTbEihizcwNjFoRUIY/T1wWQsfsm2Vw1agPKylXvQTU7iASGdHhyqRlqQzfz+Htg==} + engines: {node: '>=18'} + + snake-case@3.0.4: + resolution: {integrity: sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg==} + + snapdragon-node@2.1.1: + resolution: {integrity: sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==} + engines: {node: '>=0.10.0'} + + snapdragon-util@3.0.1: + resolution: {integrity: sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==} + engines: {node: '>=0.10.0'} + + snapdragon@0.8.2: + resolution: {integrity: sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==} + engines: {node: '>=0.10.0'} + + sol-digger@0.0.2: + resolution: {integrity: sha512-oqrw1E/X2WWYUYCzKDM5INDDH2nWOWos4p2Cw2OF52qoZcTDzlKMJQ5pJFXKOCADCg6KggBO5WYE/vNb+kJ0Hg==} + + sol-explore@1.6.1: + resolution: {integrity: sha512-cmwg7l+QLj2LE3Qvwrdo4aPYcNYY425+bN5VPkgCjkO0CiSz33G5vM5BmMZNrfd/6yNGwcm0KtwDJmh5lUElEQ==} + + solc-typed-ast@18.2.4: + resolution: {integrity: sha512-HTkr6b2WMSJ3pgVRf5us/UWjCvfSlvE1yUcHna+miSPerkyppGnZQaJWqrcECa7ZjxmSV7H2buUDKux9hR4ivg==} + hasBin: true + + solc@0.4.26: + resolution: {integrity: sha512-o+c6FpkiHd+HPjmjEVpQgH7fqZ14tJpXhho+/bQXlXbliLIS/xjXb42Vxh+qQY1WCSTMQ0+a5vR9vi0MfhU6mA==} + hasBin: true + + solc@0.6.12: + resolution: {integrity: sha512-Lm0Ql2G9Qc7yPP2Ba+WNmzw2jwsrd3u4PobHYlSOxaut3TtUbj9+5ZrT6f4DUpNPEoBaFUOEg9Op9C0mk7ge9g==} + engines: {node: '>=8.0.0'} + hasBin: true + + solc@0.7.3: + resolution: {integrity: sha512-GAsWNAjGzIDg7VxzP6mPjdurby3IkGCjQcM8GFYZT6RyaoUZKmMU6Y7YwG+tFGhv7dwZ8rmR4iwFDrrD99JwqA==} + engines: {node: '>=8.0.0'} + hasBin: true + + solc@0.8.25: + resolution: {integrity: sha512-7P0TF8gPeudl1Ko3RGkyY6XVCxe2SdD/qQhtns1vl3yAbK/PDifKDLHGtx1t7mX3LgR7ojV7Fg/Kc6Q9D2T8UQ==} + engines: {node: '>=10.0.0'} + hasBin: true + + solc@0.8.26: + resolution: {integrity: sha512-yiPQNVf5rBFHwN6SIf3TUUvVAFKcQqmSUFeq+fb6pNRCo0ZCgpYOZDi3BVoezCPIAcKrVYd/qXlBLUP9wVrZ9g==} + engines: {node: '>=10.0.0'} + hasBin: true + + solhint-community@3.7.0: + resolution: {integrity: sha512-8nfdaxVll+IIaEBHFz3CzagIZNNTGp4Mrr+6O4m7c9Bs/L8OcgR/xzZJFwROkGAhV8Nbiv4gqJ42nEXZPYl3Qw==} + hasBin: true + + solhint-plugin-prettier@0.1.0: + resolution: {integrity: sha512-SDOTSM6tZxZ6hamrzl3GUgzF77FM6jZplgL2plFBclj/OjKP8Z3eIPojKU73gRr0MvOS8ACZILn8a5g0VTz/Gw==} + peerDependencies: + prettier: ^3.0.0 + prettier-plugin-solidity: ^1.0.0 + + solhint@4.5.4: + resolution: {integrity: sha512-Cu1XiJXub2q1eCr9kkJ9VPv1sGcmj3V7Zb76B0CoezDOB9bu3DxKIFFH7ggCl9fWpEPD6xBmRLfZrYijkVmujQ==} + hasBin: true + + solidity-ast@0.4.60: + resolution: {integrity: sha512-UwhasmQ37ji1ul8cIp0XlrQ/+SVQhy09gGqJH4jnwdo2TgI6YIByzi0PI5QvIGcIdFOs1pbSmJW1pnWB7AVh2w==} + + solidity-coverage@0.7.22: + resolution: {integrity: sha512-I6Zd5tsFY+gmj1FDIp6w7OrUePx6ZpMgKQZg7dWgPaQHePLi3Jk+iJ8lwZxsWEoNy2Lcv91rMxATWHqRaFdQpw==} + hasBin: true + + solidity-coverage@0.8.15: + resolution: {integrity: sha512-qH7290NKww4/t/qFvnSEePEzON0k025IGVlwc8wo8Q6p+h1Tt6fV2M0k3yfsps3TomZYTROsfPXjx7MSnwD5uA==} + hasBin: true + peerDependencies: + hardhat: ^2.11.0 + + solidity-docgen@0.6.0-beta.36: + resolution: {integrity: sha512-f/I5G2iJgU1h0XrrjRD0hHMr7C10u276vYvm//rw1TzFcYQ4xTOyAoi9oNAHRU0JU4mY9eTuxdVc2zahdMuhaQ==} + peerDependencies: + hardhat: ^2.8.0 + + solium-plugin-security@0.1.1: + resolution: {integrity: sha512-kpLirBwIq4mhxk0Y/nn5cQ6qdJTI+U1LO3gpoNIcqNaW+sI058moXBe2UiHs+9wvF9IzYD49jcKhFTxcR9u9SQ==} + peerDependencies: + solium: ^1.0.0 + + solium@1.2.5: + resolution: {integrity: sha512-NuNrm7fp8JcDN/P+SAdM5TVa4wYDtwVtLY/rG4eBOZrC5qItsUhmQKR/YhjszaEW4c8tNUYhkhQcwOsS25znpw==} + hasBin: true + + solparse@2.2.8: + resolution: {integrity: sha512-Tm6hdfG72DOxD40SD+T5ddbekWglNWjzDRSNq7ZDIOHVsyaJSeeunUuWNj4DE7uDrJK3tGQuX0ZTDZWNYsGPMA==} + hasBin: true + + sonic-boom@2.8.0: + resolution: {integrity: sha512-kuonw1YOYYNOve5iHdSahXPOK49GqwA+LZhI6Wz/l0rP57iKyXXIHaRagOBHAPmGwJC6od2Z9zgvZ5loSgMlVg==} + + source-map-resolve@0.5.3: + resolution: {integrity: sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==} + deprecated: See https://github.com/lydell/source-map-resolve#deprecated + + source-map-support@0.4.18: + resolution: {integrity: sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==} + + source-map-support@0.5.12: + resolution: {integrity: sha512-4h2Pbvyy15EE02G+JOZpUCmqWJuqrs+sEkzewTm++BPi7Hvn/HwcqLAcNxYAyI0x13CpPPn+kMjl+hplXMHITQ==} + + source-map-support@0.5.21: + resolution: {integrity: sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==} + + source-map-url@0.4.1: + resolution: {integrity: sha512-cPiFOTLUKvJFIg4SKVScy4ilPPW6rFgMgfuZJPNoDuMs3nC1HbMUycBoJw77xFIp6z1UJQJOfx6C9GMH80DiTw==} + deprecated: See https://github.com/lydell/source-map-url#deprecated + + source-map@0.2.0: + resolution: {integrity: sha512-CBdZ2oa/BHhS4xj5DlhjWNHcan57/5YuvfdLf17iVmIpd9KRm+DFLmC6nBNj+6Ua7Kt3TmOjDpQT1aTYOQtoUA==} + engines: {node: '>=0.8.0'} + + source-map@0.5.7: + resolution: {integrity: sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==} + engines: {node: '>=0.10.0'} + + source-map@0.6.1: + resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} + engines: {node: '>=0.10.0'} + + spawndamnit@3.0.1: + resolution: {integrity: sha512-MmnduQUuHCoFckZoWnXsTg7JaiLBJrKFj9UI2MbRPGaJeVpsLcVBu6P/IGZovziM/YBsellCmsprgNA+w0CzVg==} + + spdx-correct@3.2.0: + resolution: {integrity: sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==} + + spdx-exceptions@2.5.0: + resolution: {integrity: sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==} + + spdx-expression-parse@3.0.1: + resolution: {integrity: sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==} + + spdx-license-ids@3.0.21: + resolution: {integrity: sha512-Bvg/8F5XephndSK3JffaRqdT+gyhfqIPwDHpX80tJrF8QQRYMo8sNMeaZ2Dp5+jhwKnUmIOyFFQfHRkjJm5nXg==} + + split-string@3.1.0: + resolution: {integrity: sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==} + engines: {node: '>=0.10.0'} + + split2@3.2.2: + resolution: {integrity: sha512-9NThjpgZnifTkJpzTZ7Eue85S49QwpNhZTq6GRJwObb6jnLFNGB7Qm73V5HewTROPyxD0C29xqmaI68bQtV+hg==} + + split2@4.2.0: + resolution: {integrity: sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==} + engines: {node: '>= 10.x'} + + sponge-case@1.0.1: + resolution: {integrity: sha512-dblb9Et4DAtiZ5YSUZHLl4XhH4uK80GhAZrVXdN4O2P4gQ40Wa5UIOPUHlA/nFd2PLblBZWUioLMMAVrgpoYcA==} + + sprintf-js@1.0.3: + resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} + + src-location@1.1.0: + resolution: {integrity: sha512-idBVZgLZGzB3B2Et317AFDQto7yRgp1tOuFd+VKIH2dw1jO1b6p07zNjtQoVhkW+CY6oGTp9Y5UIfbJoZRsoFQ==} + + sshpk@1.18.0: + resolution: {integrity: sha512-2p2KJZTSqQ/I3+HX42EpYOa2l3f8Erv8MWKsy2I9uf4wA7yFIkXRffYdsx86y6z4vHtV8u7g+pPlr8/4ouAxsQ==} + engines: {node: '>=0.10.0'} + hasBin: true + + stable@0.1.8: + resolution: {integrity: sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w==} + deprecated: 'Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility' + + stack-trace@0.0.10: + resolution: {integrity: sha512-KGzahc7puUKkzyMt+IqAep+TVNbKP+k2Lmwhub39m1AsTSkaDutx56aDCo+HLDzf/D26BIHTJWNiTG1KAJiQCg==} + + stack-utils@2.0.6: + resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==} + engines: {node: '>=10'} + + stackframe@1.3.4: + resolution: {integrity: sha512-oeVtt7eWQS+Na6F//S4kJ2K2VbRlS9D43mAlMyVpVWovy9o+jfgH8O9agzANzaiLjclA0oYzUXEM4PurhSUChw==} + + stacktrace-parser@0.1.11: + resolution: {integrity: sha512-WjlahMgHmCJpqzU8bIBy4qtsZdU9lRlcZE3Lvyej6t4tuOuv1vk57OW3MBrj6hXBFx/nNoC9MPMTcr5YA7NQbg==} + engines: {node: '>=6'} + + static-extend@0.1.2: + resolution: {integrity: sha512-72E9+uLc27Mt718pMHt9VMNiAL4LMsmDbBva8mxWUCkT07fSzEGMYUCk0XWY6lp0j6RBAG4cJ3mWuZv2OE3s0g==} + engines: {node: '>=0.10.0'} + + statuses@1.5.0: + resolution: {integrity: sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==} + engines: {node: '>= 0.6'} + + statuses@2.0.1: + resolution: {integrity: sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==} + engines: {node: '>= 0.8'} + + stream-shift@1.0.3: + resolution: {integrity: sha512-76ORR0DO1o1hlKwTbi/DM3EXWGf3ZJYO8cXX5RJwnul2DEg2oyoZyjLNoQM8WsvZiFKCRfC1O0J7iCvie3RZmQ==} + + stream-to-it@0.2.4: + resolution: {integrity: sha512-4vEbkSs83OahpmBybNJXlJd7d6/RxzkkSdT3I0mnGt79Xd2Kk+e1JqbvAvsQfCeKj3aKb0QIWkyK3/n0j506vQ==} + + stream-to-pull-stream@1.7.3: + resolution: {integrity: sha512-6sNyqJpr5dIOQdgNy/xcDWwDuzAsAwVzhzrWlAPAQ7Lkjx/rv0wgvxEyKwTq6FmNd5rjTrELt/CLmaSw7crMGg==} + + streamsearch@1.1.0: + resolution: {integrity: sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==} + engines: {node: '>=10.0.0'} + + strict-uri-encode@1.1.0: + resolution: {integrity: sha512-R3f198pcvnB+5IpnBlRkphuE9n46WyVl8I39W/ZUTZLz4nqSP/oLYUrcnJrw462Ds8he4YKMov2efsTIw1BDGQ==} + engines: {node: '>=0.10.0'} + + string-argv@0.3.1: + resolution: {integrity: sha512-a1uQGz7IyVy9YwhqjZIZu1c8JO8dNIe20xBmSS6qu9kv++k3JGzCVmprbNN5Kn+BgzD5E7YYwg1CcjuJMRNsvg==} + engines: {node: '>=0.6.19'} + + string-argv@0.3.2: + resolution: {integrity: sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q==} + engines: {node: '>=0.6.19'} + + string-format@2.0.0: + resolution: {integrity: sha512-bbEs3scLeYNXLecRRuk6uJxdXUSj6le/8rNPHChIJTn2V79aXVTR1EH2OH5zLKKoz0V02fOUKZZcw01pLUShZA==} + + string-width@1.0.2: + resolution: {integrity: sha512-0XsVpQLnVCXHJfyEs8tC0zpTVIr5PKKsQtkT29IwupnPTjtPmQ3xT/4yCREF9hYkV/3M3kzcUTSAZT6a6h81tw==} + engines: {node: '>=0.10.0'} + + string-width@2.1.1: + resolution: {integrity: sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==} + engines: {node: '>=4'} + + string-width@4.2.3: + resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} + engines: {node: '>=8'} + + string-width@5.1.2: + resolution: {integrity: sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==} + engines: {node: '>=12'} + + string-width@7.2.0: + resolution: {integrity: sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==} + engines: {node: '>=18'} + + string.prototype.trim@1.2.10: + resolution: {integrity: sha512-Rs66F0P/1kedk5lyYyH9uBzuiI/kNRmwJAR9quK6VOtIpZ2G+hMZd+HQbbv25MgCA6gEffoMZYxlTod4WcdrKA==} + engines: {node: '>= 0.4'} + + string.prototype.trimend@1.0.9: + resolution: {integrity: sha512-G7Ok5C6E/j4SGfyLCloXTrngQIQU3PWtXGst3yM7Bea9FRURf1S42ZHlZZtsNque2FN2PoUhfZXYLNWwEr4dLQ==} + engines: {node: '>= 0.4'} + + string.prototype.trimstart@1.0.8: + resolution: {integrity: sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==} + engines: {node: '>= 0.4'} + + string_decoder@0.10.31: + resolution: {integrity: sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==} + + string_decoder@1.1.1: + resolution: {integrity: sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==} + + string_decoder@1.3.0: + resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} + + stringify-object@3.3.0: + resolution: {integrity: sha512-rHqiFh1elqCQ9WPLIC8I0Q/g/wj5J1eMkyoiD6eoQApWHP0FtlK7rqnhmabL5VUY9JQCcqwwvlOaSuutekgyrw==} + engines: {node: '>=4'} + + strip-ansi@3.0.1: + resolution: {integrity: sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==} + engines: {node: '>=0.10.0'} + + strip-ansi@4.0.0: + resolution: {integrity: sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow==} + engines: {node: '>=4'} + + strip-ansi@5.2.0: + resolution: {integrity: sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==} + engines: {node: '>=6'} + + strip-ansi@6.0.1: + resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} + engines: {node: '>=8'} + + strip-ansi@7.1.0: + resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==} + engines: {node: '>=12'} + + strip-bom@2.0.0: + resolution: {integrity: sha512-kwrX1y7czp1E69n2ajbG65mIo9dqvJ+8aBQXOGVxqwvNbsXdFM6Lq37dLAY3mknUwru8CfcCbfOLL/gMo+fi3g==} + engines: {node: '>=0.10.0'} + + strip-bom@3.0.0: + resolution: {integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==} + engines: {node: '>=4'} + + strip-eof@1.0.0: + resolution: {integrity: sha512-7FCwGGmx8mD5xQd3RPUvnSpUXHM3BWuzjtpD4TXsfcZ9EL4azvVVUscFYwD9nx8Kh+uCBC00XBtAykoMHwTh8Q==} + engines: {node: '>=0.10.0'} + + strip-final-newline@2.0.0: + resolution: {integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==} + engines: {node: '>=6'} + + strip-final-newline@3.0.0: + resolution: {integrity: sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==} + engines: {node: '>=12'} + + strip-hex-prefix@1.0.0: + resolution: {integrity: sha512-q8d4ue7JGEiVcypji1bALTos+0pWtyGlivAWyPuTkHzuTCJqrK9sWxYQZUq6Nq3cuyv3bm734IhHvHtGGURU6A==} + engines: {node: '>=6.5.0', npm: '>=3'} + + strip-indent@3.0.0: + resolution: {integrity: sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==} + engines: {node: '>=8'} + + strip-json-comments@2.0.1: + resolution: {integrity: sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==} + engines: {node: '>=0.10.0'} + + strip-json-comments@3.1.1: + resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} + engines: {node: '>=8'} + + supports-color@2.0.0: + resolution: {integrity: sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==} + engines: {node: '>=0.8.0'} + + supports-color@3.2.3: + resolution: {integrity: sha512-Jds2VIYDrlp5ui7t8abHN2bjAu4LV/q4N2KivFPpGH0lrka0BMq/33AmECUXlKPcHigkNaqfXRENFju+rlcy+A==} + engines: {node: '>=0.8.0'} + + supports-color@4.4.0: + resolution: {integrity: sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==} + engines: {node: '>=4'} + + supports-color@5.5.0: + resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} + engines: {node: '>=4'} + + supports-color@7.2.0: + resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} + engines: {node: '>=8'} + + supports-color@8.1.1: + resolution: {integrity: sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==} + engines: {node: '>=10'} + + supports-color@9.4.0: + resolution: {integrity: sha512-VL+lNrEoIXww1coLPOmiEmK/0sGigko5COxI09KzHc2VJXJsQ37UaQ+8quuxjDeA7+KnLGTWRyOXSLLR2Wb4jw==} + engines: {node: '>=12'} + + supports-preserve-symlinks-flag@1.0.0: + resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} + engines: {node: '>= 0.4'} + + swap-case@2.0.2: + resolution: {integrity: sha512-kc6S2YS/2yXbtkSMunBtKdah4VFETZ8Oh6ONSmSd9bRxhqTrtARUCBUiWXH3xVPpvR7tz2CSnkuXVE42EcGnMw==} + + swarm-js@0.1.42: + resolution: {integrity: sha512-BV7c/dVlA3R6ya1lMlSSNPLYrntt0LUq4YMgy3iwpCIc6rZnS5W2wUoctarZ5pXlpKtxDDf9hNziEkcfrxdhqQ==} + + sync-request@6.1.0: + resolution: {integrity: sha512-8fjNkrNlNCrVc/av+Jn+xxqfCjYaBoHqCsDz6mt030UMxJGr+GSfCV1dQt2gRtlL63+VPidwDVLr7V2OcTSdRw==} + engines: {node: '>=8.0.0'} + + sync-rpc@1.3.6: + resolution: {integrity: sha512-J8jTXuZzRlvU7HemDgHi3pGnh/rkoqR/OZSjhTyyZrEkkYQbk7Z33AXp37mkPfPpfdOuj7Ex3H/TJM1z48uPQw==} + + table-layout@1.0.2: + resolution: {integrity: sha512-qd/R7n5rQTRFi+Zf2sk5XVVd9UQl6ZkduPFC3S7WEGJAmetDTjY3qPN50eSKzwuzEyQKy5TN2TiZdkIjos2L6A==} + engines: {node: '>=8.0.0'} + + table@6.9.0: + resolution: {integrity: sha512-9kY+CygyYM6j02t5YFHbNz2FN5QmYGv9zAjVp4lCDjlCw7amdckXlEt/bjMhUIfj4ThGRE4gCUH5+yGnNuPo5A==} + engines: {node: '>=10.0.0'} + + tape@4.17.0: + resolution: {integrity: sha512-KCuXjYxCZ3ru40dmND+oCLsXyuA8hoseu2SS404Px5ouyS0A99v8X/mdiLqsR5MTAyamMBN7PRwt2Dv3+xGIxw==} + hasBin: true + + tar-fs@2.1.2: + resolution: {integrity: sha512-EsaAXwxmx8UB7FRKqeozqEPop69DXcmYwTQwXvyAPF352HJsPdkVhvTaDPYqfNgruveJIJy3TA2l+2zj8LJIJA==} + + tar-stream@2.2.0: + resolution: {integrity: sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==} + engines: {node: '>=6'} + + tar@4.4.19: + resolution: {integrity: sha512-a20gEsvHnWe0ygBY8JbxoM4w3SJdhc7ZAuxkLqh+nvNQN2IOt0B5lLgM490X5Hl8FF0dl0tOf2ewFYAlIFgzVA==} + engines: {node: '>=4.5'} + + tdigest@0.1.2: + resolution: {integrity: sha512-+G0LLgjjo9BZX2MfdvPfH+MKLCrxlXSYec5DaPYP1fe6Iyhf0/fSmJ0bFiZ1F8BT6cGXl2LpltQptzjXKWEkKA==} + + term-size@2.2.1: + resolution: {integrity: sha512-wK0Ri4fOGjv/XPy8SBHZChl8CM7uMc5VML7SqiQ0zG7+J5Vr+RMQDoHa2CNT6KHUnTGIXH34UDMkPzAUyapBZg==} + engines: {node: '>=8'} + + terser@5.39.0: + resolution: {integrity: sha512-LBAhFyLho16harJoWMg/nZsQYgTrg5jXOn2nCYjRUcZZEdE3qa2zb8QEDRUGVZBW4rlazf2fxkg8tztybTaqWw==} + engines: {node: '>=10'} + hasBin: true + + test-exclude@6.0.0: + resolution: {integrity: sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==} + engines: {node: '>=8'} + + test-value@2.1.0: + resolution: {integrity: sha512-+1epbAxtKeXttkGFMTX9H42oqzOTufR1ceCF+GYA5aOmvaPq9wd4PUS8329fn2RRLGNeUkgRLnVpycjx8DsO2w==} + engines: {node: '>=0.10.0'} + + testrpc@0.0.1: + resolution: {integrity: sha512-afH1hO+SQ/VPlmaLUFj2636QMeDvPCeQMc/9RBMW0IfjNe9gFD9Ra3ShqYkB7py0do1ZcCna/9acHyzTJ+GcNA==} + deprecated: testrpc has been renamed to ganache-cli, please use this package from now on. + + text-extensions@1.9.0: + resolution: {integrity: sha512-wiBrwC1EhBelW12Zy26JeOUkQ5mRu+5o8rpsJk5+2t+Y5vE7e842qtZDQ2g1NpX/29HdyFeJ4nSIhI47ENSxlQ==} + engines: {node: '>=0.10'} + + text-extensions@2.4.0: + resolution: {integrity: sha512-te/NtwBwfiNRLf9Ijqx3T0nlqZiQ2XrrtBvu+cLL8ZRrGkO0NHTug8MYFKyoSrv/sHTaSKfilUkizV6XhxMJ3g==} + engines: {node: '>=8'} + + text-hex@1.0.0: + resolution: {integrity: sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg==} + + text-table@0.2.0: + resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} + + then-request@6.0.2: + resolution: {integrity: sha512-3ZBiG7JvP3wbDzA9iNY5zJQcHL4jn/0BWtXIkagfz7QgOL/LqjCEOBQuJNZfu0XYnv5JhKh+cDxCPM4ILrqruA==} + engines: {node: '>=6.0.0'} + + thread-stream@0.13.2: + resolution: {integrity: sha512-woZFt0cLFkPdhsa+IGpRo1jiSouaHxMIljzTgt30CMjBWoUYbbcHqnunW5Yv+BXko9H05MVIcxMipI3Jblallw==} + + throat@5.0.0: + resolution: {integrity: sha512-fcwX4mndzpLQKBS1DVYhGAcYaYt7vsHNIvQV+WXMvnow5cgjPphq5CaayLaGsjRdSCKZFNGt7/GYAuXaNOiYCA==} + + through2@2.0.5: + resolution: {integrity: sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==} + + through2@3.0.2: + resolution: {integrity: sha512-enaDQ4MUyP2W6ZyT6EsMzqBPZaM/avg8iuo+l2d3QCs0J+6RaqkHV/2/lOwDTueBHeJ/2LG9lrLW3d5rWPucuQ==} + + through2@4.0.2: + resolution: {integrity: sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw==} + + through@2.3.8: + resolution: {integrity: sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==} + + timed-out@4.0.1: + resolution: {integrity: sha512-G7r3AhovYtr5YKOWQkta8RKAPb+J9IsO4uVmzjl8AZwfhs8UcUwTiD6gcJYSgOtzyjvQKrKYn41syHbUWMkafA==} + engines: {node: '>=0.10.0'} + + tiny-lru@8.0.2: + resolution: {integrity: sha512-ApGvZ6vVvTNdsmt676grvCkUCGwzG9IqXma5Z07xJgiC5L7akUMof5U8G2JTI9Rz/ovtVhJBlY6mNhEvtjzOIg==} + engines: {node: '>=6'} + + tinyglobby@0.2.13: + resolution: {integrity: sha512-mEwzpUgrLySlveBwEVDMKk5B57bhLPYovRfPAXD5gA/98Opn0rCDj3GtLwFvCvH5RK9uPCExUROW5NjDwvqkxw==} + engines: {node: '>=12.0.0'} + + title-case@3.0.3: + resolution: {integrity: sha512-e1zGYRvbffpcHIrnuqT0Dh+gEJtDaxDSoG4JAIpq4oDFyooziLBIiYQv0GBT4FUAnUop5uZ1hiIAj7oAF6sOCA==} + + tmp@0.0.33: + resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==} + engines: {node: '>=0.6.0'} + + tmp@0.1.0: + resolution: {integrity: sha512-J7Z2K08jbGcdA1kkQpJSqLF6T0tdQqpR2pnSUXsIchbPdTI9v3e85cLW0d6WDhwuAleOV71j2xWs8qMPfK7nKw==} + engines: {node: '>=6'} + + tmpl@1.0.5: + resolution: {integrity: sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==} + + to-fast-properties@1.0.3: + resolution: {integrity: sha512-lxrWP8ejsq+7E3nNjwYmUBMAgjMTZoTI+sdBOpvNyijeDLa29LUn9QaoXAHv4+Z578hbmHHJKZknzxVtvo77og==} + engines: {node: '>=0.10.0'} + + to-object-path@0.3.0: + resolution: {integrity: sha512-9mWHdnGRuh3onocaHzukyvCZhzvr6tiflAy/JRFXcJX0TjgfWA9pk9t8CMbzmBE4Jfw58pXbkngtBtqYxzNEyg==} + engines: {node: '>=0.10.0'} + + to-readable-stream@1.0.0: + resolution: {integrity: sha512-Iq25XBt6zD5npPhlLVXGFN3/gyR2/qODcKNNyTMd4vbm39HUaOiAM4PMq0eMVC/Tkxz+Zjdsc55g9yyz+Yq00Q==} + engines: {node: '>=6'} + + to-regex-range@2.1.1: + resolution: {integrity: sha512-ZZWNfCjUokXXDGXFpZehJIkZqq91BcULFq/Pi7M5i4JnxXdhMKAK682z8bCW3o8Hj1wuuzoKcW3DfVzaP6VuNg==} + engines: {node: '>=0.10.0'} + + to-regex-range@5.0.1: + resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} + engines: {node: '>=8.0'} + + to-regex@3.0.2: + resolution: {integrity: sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==} + engines: {node: '>=0.10.0'} + + toidentifier@1.0.1: + resolution: {integrity: sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==} + engines: {node: '>=0.6'} + + toposort-class@1.0.1: + resolution: {integrity: sha512-OsLcGGbYF3rMjPUf8oKktyvCiUxSbqMMS39m33MAjLTC1DVIH6x3WSt63/M77ihI09+Sdfk1AXvfhCEeUmC7mg==} + + tough-cookie@2.5.0: + resolution: {integrity: sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==} + engines: {node: '>=0.8'} + + tr46@0.0.3: + resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} + + trim-newlines@3.0.1: + resolution: {integrity: sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw==} + engines: {node: '>=8'} + + trim-right@1.0.1: + resolution: {integrity: sha512-WZGXGstmCWgeevgTL54hrCuw1dyMQIzWy7ZfqRJfSmJZBwklI15egmQytFP6bPidmw3M8d5yEowl1niq4vmqZw==} + engines: {node: '>=0.10.0'} + + triple-beam@1.4.1: + resolution: {integrity: sha512-aZbgViZrg1QNcG+LULa7nhZpJTZSLm/mXnHXnbAbjmN5aSa0y7V+wvv6+4WaBtpISJzThKy+PIPxc1Nq1EJ9mg==} + engines: {node: '>= 14.0.0'} + + truffle-flattener@1.6.0: + resolution: {integrity: sha512-scS5Bsi4CZyvlrmD4iQcLHTiG2RQFUXVheTgWeH6PuafmI+Lk5U87Es98loM3w3ImqC9/fPHq+3QIXbcPuoJ1Q==} + hasBin: true + + ts-algebra@1.2.2: + resolution: {integrity: sha512-kloPhf1hq3JbCPOTYoOWDKxebWjNb2o/LKnNfkWhxVVisFFmMJPPdJeGoGmM+iRLyoXAR61e08Pb+vUXINg8aA==} + + ts-api-utils@1.4.3: + resolution: {integrity: sha512-i3eMG77UTMD0hZhgRS562pv83RC6ukSAC2GMNWc+9dieh/+jDM5u5YG+NHX6VNDRHQcHwmsTHctP9LhbC3WxVw==} + engines: {node: '>=16'} + peerDependencies: + typescript: '>=4.2.0' + + ts-command-line-args@2.5.1: + resolution: {integrity: sha512-H69ZwTw3rFHb5WYpQya40YAX2/w7Ut75uUECbgBIsLmM+BNuYnxsltfyyLMxy6sEeKxgijLTnQtLd0nKd6+IYw==} + hasBin: true + + ts-essentials@1.0.4: + resolution: {integrity: sha512-q3N1xS4vZpRouhYHDPwO0bDW3EZ6SK9CrrDHxi/D6BPReSjpVgWIOpLS2o0gSBZm+7q/wyKp6RVM1AeeW7uyfQ==} + + ts-essentials@6.0.7: + resolution: {integrity: sha512-2E4HIIj4tQJlIHuATRHayv0EfMGK3ris/GRk1E3CFnsZzeNV+hUmelbaTZHLtXaZppM5oLhHRtO04gINC4Jusw==} + peerDependencies: + typescript: '>=3.7.0' + + ts-essentials@7.0.3: + resolution: {integrity: sha512-8+gr5+lqO3G84KdiTSMRLtuyJ+nTBVRKuCrK4lidMPdVeEp0uqC875uE5NMcaA7YYMN7XsNiFQuMvasF8HT/xQ==} + peerDependencies: + typescript: '>=3.7.0' + + ts-generator@0.1.1: + resolution: {integrity: sha512-N+ahhZxTLYu1HNTQetwWcx3so8hcYbkKBHTr4b4/YgObFTIKkOSSsaa+nal12w8mfrJAyzJfETXawbNjSfP2gQ==} + hasBin: true + + ts-node@10.9.2: + resolution: {integrity: sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==} + hasBin: true + peerDependencies: + '@swc/core': '>=1.2.50' + '@swc/wasm': '>=1.2.50' + '@types/node': '*' + typescript: '>=2.7' + peerDependenciesMeta: + '@swc/core': + optional: true + '@swc/wasm': + optional: true + + ts-node@8.10.2: + resolution: {integrity: sha512-ISJJGgkIpDdBhWVu3jufsWpK3Rzo7bdiIXJjQc0ynKxVOVcg2oIrf2H2cejminGrptVc6q6/uynAHNCuWGbpVA==} + engines: {node: '>=6.0.0'} + hasBin: true + peerDependencies: + typescript: '>=2.7' + + tsconfig-paths@4.2.0: + resolution: {integrity: sha512-NoZ4roiN7LnbKn9QqE1amc9DJfzvZXxF4xDavcOWt1BPkdx+m+0gJuPM+S0vCe7zTJMYUP0R8pO2XMr+Y8oLIg==} + engines: {node: '>=6'} + + tslib@1.14.1: + resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} + + tslib@2.4.1: + resolution: {integrity: sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==} + + tslib@2.5.3: + resolution: {integrity: sha512-mSxlJJwl3BMEQCUNnxXBU9jP4JBktcEGhURcPR6VQVlnP0FdDEsIaz0C35dXNGLyRfrATNofF0F5p2KPxQgB+w==} + + tslib@2.7.0: + resolution: {integrity: sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==} + + tslib@2.8.1: + resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==} + + tslog@4.9.3: + resolution: {integrity: sha512-oDWuGVONxhVEBtschLf2cs/Jy8i7h1T+CpdkTNWQgdAF7DhRo2G8vMCgILKe7ojdEkLhICWgI1LYSSKaJsRgcw==} + engines: {node: '>=16'} + + tsort@0.0.1: + resolution: {integrity: sha512-Tyrf5mxF8Ofs1tNoxA13lFeZ2Zrbd6cKbuH3V+MQ5sb6DtBj5FjrXVsRWT8YvNAQTqNoz66dz1WsbigI22aEnw==} + + tunnel-agent@0.6.0: + resolution: {integrity: sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==} + + tweetnacl-util@0.15.1: + resolution: {integrity: sha512-RKJBIj8lySrShN4w6i/BonWp2Z/uxwC3h4y7xsRrpP59ZboCd0GpEVsOnMDYLMmKBpYhb5TgHzZXy7wTfYFBRw==} + + tweetnacl@0.14.5: + resolution: {integrity: sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==} + + tweetnacl@1.0.3: + resolution: {integrity: sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==} + + type-check@0.3.2: + resolution: {integrity: sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==} + engines: {node: '>= 0.8.0'} + + type-check@0.4.0: + resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} + engines: {node: '>= 0.8.0'} + + type-detect@4.0.8: + resolution: {integrity: sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==} + engines: {node: '>=4'} + + type-detect@4.1.0: + resolution: {integrity: sha512-Acylog8/luQ8L7il+geoSxhEkazvkslg7PSNKOX59mbB9cOveP5aq9h74Y7YU8yDpJwetzQQrfIwtf4Wp4LKcw==} + engines: {node: '>=4'} + + type-fest@0.18.1: + resolution: {integrity: sha512-OIAYXk8+ISY+qTOwkHtKqzAuxchoMiD9Udx+FSGQDuiRR+PJKJHc2NJAXlbhkGwTt/4/nKZxELY1w3ReWOL8mw==} + engines: {node: '>=10'} + + type-fest@0.20.2: + resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==} + engines: {node: '>=10'} + + type-fest@0.21.3: + resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} + engines: {node: '>=10'} + + type-fest@0.6.0: + resolution: {integrity: sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==} + engines: {node: '>=8'} + + type-fest@0.7.1: + resolution: {integrity: sha512-Ne2YiiGN8bmrmJJEuTWTLJR32nh/JdL1+PSicowtNb0WFpn59GK8/lfD61bVtzguz7b3PBt74nxpv/Pw5po5Rg==} + engines: {node: '>=8'} + + type-fest@0.8.1: + resolution: {integrity: sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==} + engines: {node: '>=8'} + + type-is@1.6.18: + resolution: {integrity: sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==} + engines: {node: '>= 0.6'} + + type@2.7.3: + resolution: {integrity: sha512-8j+1QmAbPvLZow5Qpi6NCaN8FB60p/6x8/vfNqOk/hC+HuvFZhL4+WfekuhQLiqFZXOgQdrs3B+XxEmCc6b3FQ==} + + typechain@3.0.0: + resolution: {integrity: sha512-ft4KVmiN3zH4JUFu2WJBrwfHeDf772Tt2d8bssDTo/YcckKW2D+OwFrHXRC6hJvO3mHjFQTihoMV6fJOi0Hngg==} + hasBin: true + + typechain@5.2.0: + resolution: {integrity: sha512-0INirvQ+P+MwJOeMct+WLkUE4zov06QxC96D+i3uGFEHoiSkZN70MKDQsaj8zkL86wQwByJReI2e7fOUwECFuw==} + hasBin: true + peerDependencies: + typescript: '>=4.1.0' + + typechain@7.0.1: + resolution: {integrity: sha512-4c+ecLW4mTiKwTDdofiN8ToDp7TkFC2Bzp2Pt/+qeKzkmELWzy2eDjCiv0IWHswAZhE2y9KXBhTmShzhIzD+LQ==} + hasBin: true + peerDependencies: + typescript: '>=4.1.0' + + typechain@8.3.2: + resolution: {integrity: sha512-x/sQYr5w9K7yv3es7jo4KTX05CLxOf7TRWwoHlrjRh8H82G64g+k7VuWPJlgMo6qrjfCulOdfBjiaDtmhFYD/Q==} + hasBin: true + peerDependencies: + typescript: '>=4.3.0' + + typed-array-buffer@1.0.3: + resolution: {integrity: sha512-nAYYwfY3qnzX30IkA6AQZjVbtK6duGontcQm1WSG1MD94YLqK0515GNApXkoxKOWMusVssAHWLh9SeaoefYFGw==} + engines: {node: '>= 0.4'} + + typed-array-byte-length@1.0.3: + resolution: {integrity: sha512-BaXgOuIxz8n8pIq3e7Atg/7s+DpiYrxn4vdot3w9KbnBhcRQq6o3xemQdIfynqSeXeDrF32x+WvfzmOjPiY9lg==} + engines: {node: '>= 0.4'} + + typed-array-byte-offset@1.0.4: + resolution: {integrity: sha512-bTlAFB/FBYMcuX81gbL4OcpH5PmlFHqlCCpAl8AlEzMz5k53oNDvN8p1PNOWLEmI2x4orp3raOFB51tv9X+MFQ==} + engines: {node: '>= 0.4'} + + typed-array-length@1.0.7: + resolution: {integrity: sha512-3KS2b+kL7fsuk/eJZ7EQdnEmQoaho/r6KUef7hxvltNA5DR8NAUM+8wJMbJyZ4G9/7i3v5zPBIMN5aybAh2/Jg==} + engines: {node: '>= 0.4'} + + typedarray-to-buffer@3.1.5: + resolution: {integrity: sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==} + + typedarray@0.0.6: + resolution: {integrity: sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==} + + typescript-eslint@7.18.0: + resolution: {integrity: sha512-PonBkP603E3tt05lDkbOMyaxJjvKqQrXsnow72sVeOFINDE/qNmnnd+f9b4N+U7W6MXnnYyrhtmF2t08QWwUbA==} + engines: {node: ^18.18.0 || >=20.0.0} + peerDependencies: + eslint: ^8.56.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + + typescript@4.9.5: + resolution: {integrity: sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==} + engines: {node: '>=4.2.0'} + hasBin: true + + typescript@5.8.3: + resolution: {integrity: sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==} + engines: {node: '>=14.17'} + hasBin: true + + typewise-core@1.2.0: + resolution: {integrity: sha512-2SCC/WLzj2SbUwzFOzqMCkz5amXLlxtJqDKTICqg30x+2DZxcfZN2MvQZmGfXWKNWaKK9pBPsvkcwv8bF/gxKg==} + + typewise@1.0.3: + resolution: {integrity: sha512-aXofE06xGhaQSPzt8hlTY+/YWQhm9P0jYUp1f2XtmW/3Bk0qzXcyFWAtPoo2uTGQj1ZwbDuSyuxicq+aDo8lCQ==} + + typewiselite@1.0.0: + resolution: {integrity: sha512-J9alhjVHupW3Wfz6qFRGgQw0N3gr8hOkw6zm7FZ6UR1Cse/oD9/JVok7DNE9TT9IbciDHX2Ex9+ksE6cRmtymw==} + + typical@2.6.1: + resolution: {integrity: sha512-ofhi8kjIje6npGozTip9Fr8iecmYfEbS06i0JnIg+rh51KakryWF4+jX8lLKZVhy6N+ID45WYSFCxPOdTWCzNg==} + + typical@4.0.0: + resolution: {integrity: sha512-VAH4IvQ7BDFYglMd7BPRDfLgxZZX4O4TFcRDA6EN5X7erNJJq+McIEp8np9aVtxrCJ6qx4GTYVfOWNjcqwZgRw==} + engines: {node: '>=8'} + + typical@5.2.0: + resolution: {integrity: sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==} + engines: {node: '>=8'} + + u2f-api@0.2.7: + resolution: {integrity: sha512-fqLNg8vpvLOD5J/z4B6wpPg4Lvowz1nJ9xdHcCzdUPKcFE/qNCceV2gNZxSJd5vhAZemHr/K/hbzVA0zxB5mkg==} + + ua-parser-js@1.0.40: + resolution: {integrity: sha512-z6PJ8Lml+v3ichVojCiB8toQJBuwR42ySM4ezjXIqXK3M0HczmKQ3LF4rhU55PfD99KEEXQG6yb7iOMyvYuHew==} + hasBin: true + + uglify-js@3.19.3: + resolution: {integrity: sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ==} + engines: {node: '>=0.8.0'} + hasBin: true + + uint8arrays@1.1.0: + resolution: {integrity: sha512-cLdlZ6jnFczsKf5IH1gPHTtcHtPGho5r4CvctohmQjw8K7Q3gFdfIGHxSTdTaCKrL4w09SsPRJTqRS0drYeszA==} + + uint8arrays@2.1.10: + resolution: {integrity: sha512-Q9/hhJa2836nQfEJSZTmr+pg9+cDJS9XEAp7N2Vg5MzL3bK/mkMVfjscRGYruP9jNda6MAdf4QD/y78gSzkp6A==} + + uint8arrays@3.1.1: + resolution: {integrity: sha512-+QJa8QRnbdXVpHYjLoTpJIdCTiw9Ir62nocClWuXIq2JIh4Uta0cQsTSpFL678p2CN8B+XSApwcU+pQEqVpKWg==} + + ultron@1.1.1: + resolution: {integrity: sha512-UIEXBNeYmKptWH6z8ZnqTeS8fV74zG0/eRU9VGkpzz+LIJNs8W/zM/L+7ctCkRrgbNnnR0xxw4bKOr0cW0N0Og==} + + unbox-primitive@1.1.0: + resolution: {integrity: sha512-nWJ91DjeOkej/TA8pXQ3myruKpKEYgqvpw9lz4OPHj/NWFNluYrjbz9j01CJ8yKQd2g4jFoOkINCTW2I5LEEyw==} + engines: {node: '>= 0.4'} + + unc-path-regex@0.1.2: + resolution: {integrity: sha512-eXL4nmJT7oCpkZsHZUOJo8hcX3GbsiDOa0Qu9F646fi8dT3XuSVopVqAcEiVzSKKH7UoDti23wNX3qGFxcW5Qg==} + engines: {node: '>=0.10.0'} + + underscore@1.13.7: + resolution: {integrity: sha512-GMXzWtsc57XAtguZgaQViUOzs0KTkk8ojr3/xAxXLITqf/3EMwxC0inyETfDFjH/Krbhuep0HNbbjI9i/q3F3g==} + + underscore@1.9.1: + resolution: {integrity: sha512-5/4etnCkd9c8gwgowi5/om/mYO5ajCaOgdzj/oW+0eQV9WxKBDZw5+ycmKmeaTXjInS/W0BzpGLo2xR2aBwZdg==} + + undici-types@6.19.8: + resolution: {integrity: sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==} + + undici@5.29.0: + resolution: {integrity: sha512-raqeBD6NQK4SkWhQzeYKd1KmIG6dllBOTt55Rmkt4HtI9mwdWtJljnrXjAFUBLTSN67HWrOIZ3EPF4kjUw80Bg==} + engines: {node: '>=14.0'} + + unfetch@4.2.0: + resolution: {integrity: sha512-F9p7yYCn6cIW9El1zi0HI6vqpeIvBsr3dSuRO6Xuppb1u5rXpCPmMvLSyECLhybr9isec8Ohl0hPekMVrEinDA==} + + union-value@1.0.1: + resolution: {integrity: sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==} + engines: {node: '>=0.10.0'} + + universalify@0.1.2: + resolution: {integrity: sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==} + engines: {node: '>= 4.0.0'} + + universalify@2.0.1: + resolution: {integrity: sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==} + engines: {node: '>= 10.0.0'} + + unixify@1.0.0: + resolution: {integrity: sha512-6bc58dPYhCMHHuwxldQxO3RRNZ4eCogZ/st++0+fcC1nr0jiGUtAdBJ2qzmLQWSxbtz42pWt4QQMiZ9HvZf5cg==} + engines: {node: '>=0.10.0'} + + unorm@1.6.0: + resolution: {integrity: sha512-b2/KCUlYZUeA7JFUuRJZPUtr4gZvBh7tavtv4fvk4+KV9pfGiR6CQAQAWl49ZpR3ts2dk4FYkP7EIgDJoiOLDA==} + engines: {node: '>= 0.4.0'} + + unpipe@1.0.0: + resolution: {integrity: sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==} + engines: {node: '>= 0.8'} + + unset-value@1.0.0: + resolution: {integrity: sha512-PcA2tsuGSF9cnySLHTLSh2qrQiJ70mn+r+Glzxv2TWZblxsxCC52BDlZoPCsz7STd9pN7EZetkWZBAvk4cgZdQ==} + engines: {node: '>=0.10.0'} + + update-browserslist-db@1.1.3: + resolution: {integrity: sha512-UxhIZQ+QInVdunkDAaiazvvT/+fXL5Osr0JZlJulepYu6Jd7qJtDZjlur0emRlT71EN3ScPoE7gvsuIKKNavKw==} + hasBin: true + peerDependencies: + browserslist: '>= 4.21.0' + + upper-case-first@2.0.2: + resolution: {integrity: sha512-514ppYHBaKwfJRK/pNC6c/OxfGa0obSnAl106u97Ed0I625Nin96KAjttZF6ZL3e1XLtphxnqrOi9iWgm+u+bg==} + + upper-case@2.0.2: + resolution: {integrity: sha512-KgdgDGJt2TpuwBUIjgG6lzw2GWFRCW9Qkfkiv0DxqHHLYJHmtmdUIKcZd8rHgFSjopVTlw6ggzCm1b8MFQwikg==} + + uri-js@4.4.1: + resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} + + urix@0.1.0: + resolution: {integrity: sha512-Am1ousAhSLBeB9cG/7k7r2R0zj50uDRlZHPGbazid5s9rlF1F/QKYObEKSIunSjIOkJZqwRRLpvewjEkM7pSqg==} + deprecated: Please see https://github.com/lydell/urix#deprecated + + url-parse-lax@3.0.0: + resolution: {integrity: sha512-NjFKA0DidqPa5ciFcSrXnAltTtzz84ogy+NebPvfEgAck0+TNg4UJ4IN+fB7zRZfbgUf0syOo9MDxFkDSMuFaQ==} + engines: {node: '>=4'} + + url-set-query@1.0.0: + resolution: {integrity: sha512-3AChu4NiXquPfeckE5R5cGdiHCMWJx1dwCWOmWIL4KHAziJNOFIYJlpGFeKDvwLPHovZRCxK3cYlwzqI9Vp+Gg==} + + url@0.11.4: + resolution: {integrity: sha512-oCwdVC7mTuWiPyjLUz/COz5TLk6wgp0RCsN+wHZ2Ekneac9w8uuV0njcbbie2ME+Vs+d6duwmYuR3HgQXs1fOg==} + engines: {node: '>= 0.4'} + + urlpattern-polyfill@8.0.2: + resolution: {integrity: sha512-Qp95D4TPJl1kC9SKigDcqgyM2VDVO4RiJc2d4qe5GrYm+zbIQCWWKAFaJNQ4BhdFeDGwBmAxqJBwWSJDb9T3BQ==} + + usb@1.9.2: + resolution: {integrity: sha512-dryNz030LWBPAf6gj8vyq0Iev3vPbCLHCT8dBw3gQRXRzVNsIdeuU+VjPp3ksmSPkeMAl1k+kQ14Ij0QHyeiAg==} + engines: {node: '>=10.16.0'} + + use@3.1.1: + resolution: {integrity: sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==} + engines: {node: '>=0.10.0'} + + utf-8-validate@5.0.10: + resolution: {integrity: sha512-Z6czzLq4u8fPOyx7TU6X3dvUZVvoJmxSQ+IcrlmagKhilxlhZgxPK6C5Jqbkw1IDUmFTM+cz9QDnnLTwDz/2gQ==} + engines: {node: '>=6.14.2'} + + utf8@3.0.0: + resolution: {integrity: sha512-E8VjFIQ/TyQgp+TZfS6l8yp/xWppSAHzidGiRrqe4bK4XP9pTRyKFgGJpO3SN7zdX4DeomTrwaseCHovfpFcqQ==} + + util-deprecate@1.0.2: + resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} + + util.promisify@1.1.3: + resolution: {integrity: sha512-GIEaZ6o86fj09Wtf0VfZ5XP7tmd4t3jM5aZCgmBi231D0DB1AEBa3Aa6MP48DMsAIi96WkpWLimIWVwOjbDMOw==} + engines: {node: '>= 0.8'} + + util@0.12.5: + resolution: {integrity: sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA==} + + utils-merge@1.0.1: + resolution: {integrity: sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==} + engines: {node: '>= 0.4.0'} + + uuid@2.0.1: + resolution: {integrity: sha512-nWg9+Oa3qD2CQzHIP4qKUqwNfzKn8P0LtFhotaCTFchsV7ZfDhAybeip/HZVeMIpZi9JgY1E3nUlwaCmZT1sEg==} + deprecated: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. + + uuid@3.3.2: + resolution: {integrity: sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==} + deprecated: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. + hasBin: true + + uuid@3.4.0: + resolution: {integrity: sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==} + deprecated: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. + hasBin: true + + uuid@8.3.2: + resolution: {integrity: sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==} + hasBin: true + + uuid@9.0.1: + resolution: {integrity: sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==} + hasBin: true + + v8-compile-cache-lib@3.0.1: + resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==} + + validate-npm-package-license@3.0.4: + resolution: {integrity: sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==} + + validator@13.15.0: + resolution: {integrity: sha512-36B2ryl4+oL5QxZ3AzD0t5SsMNGvTtQHpjgFO5tbNxfXbMFkY822ktCDe1MnlqV3301QQI9SLHDNJokDI+Z9pA==} + engines: {node: '>= 0.10'} + + value-or-promise@1.0.12: + resolution: {integrity: sha512-Z6Uz+TYwEqE7ZN50gwn+1LCVo9ZVrpxRPOhOLnncYkY1ZzOYtrX8Fwf/rFktZ8R5mJms6EZf5TqNOMeZmnPq9Q==} + engines: {node: '>=12'} + + varint@5.0.2: + resolution: {integrity: sha512-lKxKYG6H03yCZUpAGOPOsMcGxd1RHCu1iKvEHYDPmTyq2HueGhD73ssNBqqQWfvYs04G9iUFRvmAVLW20Jw6ow==} + + varint@6.0.0: + resolution: {integrity: sha512-cXEIW6cfr15lFv563k4GuVuW/fiwjknytD37jIOLSdSWuOI6WnO/oKwmP2FQTU2l01LP8/M5TSAJpzUaGe3uWg==} + + vary@1.1.2: + resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==} + engines: {node: '>= 0.8'} + + verror@1.10.0: + resolution: {integrity: sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw==} + engines: {'0': node >=0.6.0} + + vlq@1.0.1: + resolution: {integrity: sha512-gQpnTgkubC6hQgdIcRdYGDSDc+SaujOdyesZQMv6JlfQee/9Mp0Qhnys6WxDWvQnL5WZdT7o2Ul187aSt0Rq+w==} + + walker@1.0.8: + resolution: {integrity: sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==} + + web-encoding@1.1.5: + resolution: {integrity: sha512-HYLeVCdJ0+lBYV2FvNZmv3HJ2Nt0QYXqZojk3d9FJOLkwnuhzM9tmamh8d7HPM8QqjKH8DeHkFTx+CFlWpZZDA==} + + web-streams-polyfill@3.3.3: + resolution: {integrity: sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==} + engines: {node: '>= 8'} + + web3-bzz@1.10.0: + resolution: {integrity: sha512-o9IR59io3pDUsXTsps5pO5hW1D5zBmg46iNc2t4j2DkaYHNdDLwk2IP9ukoM2wg47QILfPEJYzhTfkS/CcX0KA==} + engines: {node: '>=8.0.0'} + + web3-bzz@1.2.11: + resolution: {integrity: sha512-XGpWUEElGypBjeFyUhTkiPXFbDVD6Nr/S5jznE3t8cWUA0FxRf1n3n/NuIZeb0H9RkN2Ctd/jNma/k8XGa3YKg==} + engines: {node: '>=8.0.0'} + + web3-bzz@1.7.4: + resolution: {integrity: sha512-w9zRhyEqTK/yi0LGRHjZMcPCfP24LBjYXI/9YxFw9VqsIZ9/G0CRCnUt12lUx0A56LRAMpF7iQ8eA73aBcO29Q==} + engines: {node: '>=8.0.0'} + + web3-core-helpers@1.10.0: + resolution: {integrity: sha512-pIxAzFDS5vnbXvfvLSpaA1tfRykAe9adw43YCKsEYQwH0gCLL0kMLkaCX3q+Q8EVmAh+e1jWL/nl9U0de1+++g==} + engines: {node: '>=8.0.0'} + + web3-core-helpers@1.2.11: + resolution: {integrity: sha512-PEPoAoZd5ME7UfbnCZBdzIerpe74GEvlwT4AjOmHeCVZoIFk7EqvOZDejJHt+feJA6kMVTdd0xzRNN295UhC1A==} + engines: {node: '>=8.0.0'} + + web3-core-helpers@1.7.4: + resolution: {integrity: sha512-F8PH11qIkE/LpK4/h1fF/lGYgt4B6doeMi8rukeV/s4ivseZHHslv1L6aaijLX/g/j4PsFmR42byynBI/MIzFg==} + engines: {node: '>=8.0.0'} + + web3-core-method@1.10.0: + resolution: {integrity: sha512-4R700jTLAMKDMhQ+nsVfIXvH6IGJlJzGisIfMKWAIswH31h5AZz7uDUW2YctI+HrYd+5uOAlS4OJeeT9bIpvkA==} + engines: {node: '>=8.0.0'} + + web3-core-method@1.2.11: + resolution: {integrity: sha512-ff0q76Cde94HAxLDZ6DbdmKniYCQVtvuaYh+rtOUMB6kssa5FX0q3vPmixi7NPooFnbKmmZCM6NvXg4IreTPIw==} + engines: {node: '>=8.0.0'} + + web3-core-method@1.7.4: + resolution: {integrity: sha512-56K7pq+8lZRkxJyzf5MHQPI9/VL3IJLoy4L/+q8HRdZJ3CkB1DkXYaXGU2PeylG1GosGiSzgIfu1ljqS7CP9xQ==} + engines: {node: '>=8.0.0'} + + web3-core-promievent@1.10.0: + resolution: {integrity: sha512-68N7k5LWL5R38xRaKFrTFT2pm2jBNFaM4GioS00YjAKXRQ3KjmhijOMG3TICz6Aa5+6GDWYelDNx21YAeZ4YTg==} + engines: {node: '>=8.0.0'} + + web3-core-promievent@1.2.11: + resolution: {integrity: sha512-il4McoDa/Ox9Agh4kyfQ8Ak/9ABYpnF8poBLL33R/EnxLsJOGQG2nZhkJa3I067hocrPSjEdlPt/0bHXsln4qA==} + engines: {node: '>=8.0.0'} + + web3-core-promievent@1.7.4: + resolution: {integrity: sha512-o4uxwXKDldN7ER7VUvDfWsqTx9nQSP1aDssi1XYXeYC2xJbVo0n+z6ryKtmcoWoRdRj7uSpVzal3nEmlr480mA==} + engines: {node: '>=8.0.0'} + + web3-core-requestmanager@1.10.0: + resolution: {integrity: sha512-3z/JKE++Os62APml4dvBM+GAuId4h3L9ckUrj7ebEtS2AR0ixyQPbrBodgL91Sv7j7cQ3Y+hllaluqjguxvSaQ==} + engines: {node: '>=8.0.0'} + + web3-core-requestmanager@1.2.11: + resolution: {integrity: sha512-oFhBtLfOiIbmfl6T6gYjjj9igOvtyxJ+fjS+byRxiwFJyJ5BQOz4/9/17gWR1Cq74paTlI7vDGxYfuvfE/mKvA==} + engines: {node: '>=8.0.0'} + + web3-core-requestmanager@1.7.4: + resolution: {integrity: sha512-IuXdAm65BQtPL4aI6LZJJOrKAs0SM5IK2Cqo2/lMNvVMT9Kssq6qOk68Uf7EBDH0rPuINi+ReLP+uH+0g3AnPA==} + engines: {node: '>=8.0.0'} + + web3-core-subscriptions@1.10.0: + resolution: {integrity: sha512-HGm1PbDqsxejI075gxBc5OSkwymilRWZufIy9zEpnWKNmfbuv5FfHgW1/chtJP6aP3Uq2vHkvTDl3smQBb8l+g==} + engines: {node: '>=8.0.0'} + + web3-core-subscriptions@1.2.11: + resolution: {integrity: sha512-qEF/OVqkCvQ7MPs1JylIZCZkin0aKK9lDxpAtQ1F8niEDGFqn7DT8E/vzbIa0GsOjL2fZjDhWJsaW+BSoAW1gg==} + engines: {node: '>=8.0.0'} + + web3-core-subscriptions@1.7.4: + resolution: {integrity: sha512-VJvKWaXRyxk2nFWumOR94ut9xvjzMrRtS38c4qj8WBIRSsugrZr5lqUwgndtj0qx4F+50JhnU++QEqUEAtKm3g==} + engines: {node: '>=8.0.0'} + + web3-core@1.10.0: + resolution: {integrity: sha512-fWySwqy2hn3TL89w5TM8wXF1Z2Q6frQTKHWmP0ppRQorEK8NcHJRfeMiv/mQlSKoTS1F6n/nv2uyZsixFycjYQ==} + engines: {node: '>=8.0.0'} + + web3-core@1.2.11: + resolution: {integrity: sha512-CN7MEYOY5ryo5iVleIWRE3a3cZqVaLlIbIzDPsvQRUfzYnvzZQRZBm9Mq+ttDi2STOOzc1MKylspz/o3yq/LjQ==} + engines: {node: '>=8.0.0'} + + web3-core@1.7.4: + resolution: {integrity: sha512-L0DCPlIh9bgIED37tYbe7bsWrddoXYc897ANGvTJ6MFkSNGiMwDkTLWSgYd9Mf8qu8b4iuPqXZHMwIo4atoh7Q==} + engines: {node: '>=8.0.0'} + + web3-errors@1.3.1: + resolution: {integrity: sha512-w3NMJujH+ZSW4ltIZZKtdbkbyQEvBzyp3JRn59Ckli0Nz4VMsVq8aF1bLWM7A2kuQ+yVEm3ySeNU+7mSRwx7RQ==} + engines: {node: '>=14', npm: '>=6.12.0'} + + web3-eth-abi@1.10.0: + resolution: {integrity: sha512-cwS+qRBWpJ43aI9L3JS88QYPfFcSJJ3XapxOQ4j40v6mk7ATpA8CVK1vGTzpihNlOfMVRBkR95oAj7oL6aiDOg==} + engines: {node: '>=8.0.0'} + + web3-eth-abi@1.2.11: + resolution: {integrity: sha512-PkRYc0+MjuLSgg03QVWqWlQivJqRwKItKtEpRUaxUAeLE7i/uU39gmzm2keHGcQXo3POXAbOnMqkDvOep89Crg==} + engines: {node: '>=8.0.0'} + + web3-eth-abi@1.7.4: + resolution: {integrity: sha512-eMZr8zgTbqyL9MCTCAvb67RbVyN5ZX7DvA0jbLOqRWCiw+KlJKTGnymKO6jPE8n5yjk4w01e165Qb11hTDwHgg==} + engines: {node: '>=8.0.0'} + + web3-eth-abi@4.4.1: + resolution: {integrity: sha512-60ecEkF6kQ9zAfbTY04Nc9q4eEYM0++BySpGi8wZ2PD1tw/c0SDvsKhV6IKURxLJhsDlb08dATc3iD6IbtWJmg==} + engines: {node: '>=14', npm: '>=6.12.0'} + + web3-eth-accounts@1.10.0: + resolution: {integrity: sha512-wiq39Uc3mOI8rw24wE2n15hboLE0E9BsQLdlmsL4Zua9diDS6B5abXG0XhFcoNsXIGMWXVZz4TOq3u4EdpXF/Q==} + engines: {node: '>=8.0.0'} + + web3-eth-accounts@1.2.11: + resolution: {integrity: sha512-6FwPqEpCfKIh3nSSGeo3uBm2iFSnFJDfwL3oS9pyegRBXNsGRVpgiW63yhNzL0796StsvjHWwQnQHsZNxWAkGw==} + engines: {node: '>=8.0.0'} + + web3-eth-accounts@1.7.4: + resolution: {integrity: sha512-Y9vYLRKP7VU7Cgq6wG1jFaG2k3/eIuiTKAG8RAuQnb6Cd9k5BRqTm5uPIiSo0AP/u11jDomZ8j7+WEgkU9+Btw==} + engines: {node: '>=8.0.0'} + + web3-eth-contract@1.10.0: + resolution: {integrity: sha512-MIC5FOzP/+2evDksQQ/dpcXhSqa/2hFNytdl/x61IeWxhh6vlFeSjq0YVTAyIzdjwnL7nEmZpjfI6y6/Ufhy7w==} + engines: {node: '>=8.0.0'} + + web3-eth-contract@1.2.11: + resolution: {integrity: sha512-MzYuI/Rq2o6gn7vCGcnQgco63isPNK5lMAan2E51AJLknjSLnOxwNY3gM8BcKoy4Z+v5Dv00a03Xuk78JowFow==} + engines: {node: '>=8.0.0'} + + web3-eth-contract@1.7.4: + resolution: {integrity: sha512-ZgSZMDVI1pE9uMQpK0T0HDT2oewHcfTCv0osEqf5qyn5KrcQDg1GT96/+S0dfqZ4HKj4lzS5O0rFyQiLPQ8LzQ==} + engines: {node: '>=8.0.0'} + + web3-eth-ens@1.10.0: + resolution: {integrity: sha512-3hpGgzX3qjgxNAmqdrC2YUQMTfnZbs4GeLEmy8aCWziVwogbuqQZ+Gzdfrym45eOZodk+lmXyLuAdqkNlvkc1g==} + engines: {node: '>=8.0.0'} + + web3-eth-ens@1.2.11: + resolution: {integrity: sha512-dbW7dXP6HqT1EAPvnniZVnmw6TmQEKF6/1KgAxbo8iBBYrVTMDGFQUUnZ+C4VETGrwwaqtX4L9d/FrQhZ6SUiA==} + engines: {node: '>=8.0.0'} + + web3-eth-ens@1.7.4: + resolution: {integrity: sha512-Gw5CVU1+bFXP5RVXTCqJOmHn71X2ghNk9VcEH+9PchLr0PrKbHTA3hySpsPco1WJAyK4t8SNQVlNr3+bJ6/WZA==} + engines: {node: '>=8.0.0'} + + web3-eth-iban@1.10.0: + resolution: {integrity: sha512-0l+SP3IGhInw7Q20LY3IVafYEuufo4Dn75jAHT7c2aDJsIolvf2Lc6ugHkBajlwUneGfbRQs/ccYPQ9JeMUbrg==} + engines: {node: '>=8.0.0'} + + web3-eth-iban@1.2.11: + resolution: {integrity: sha512-ozuVlZ5jwFC2hJY4+fH9pIcuH1xP0HEFhtWsR69u9uDIANHLPQQtWYmdj7xQ3p2YT4bQLq/axKhZi7EZVetmxQ==} + engines: {node: '>=8.0.0'} + + web3-eth-iban@1.7.4: + resolution: {integrity: sha512-XyrsgWlZQMv5gRcjXMsNvAoCRvV5wN7YCfFV5+tHUCqN8g9T/o4XUS20vDWD0k4HNiAcWGFqT1nrls02MGZ08w==} + engines: {node: '>=8.0.0'} + + web3-eth-personal@1.10.0: + resolution: {integrity: sha512-anseKn98w/d703eWq52uNuZi7GhQeVjTC5/svrBWEKob0WZ5kPdo+EZoFN0sp5a5ubbrk/E0xSl1/M5yORMtpg==} + engines: {node: '>=8.0.0'} + + web3-eth-personal@1.2.11: + resolution: {integrity: sha512-42IzUtKq9iHZ8K9VN0vAI50iSU9tOA1V7XU2BhF/tb7We2iKBVdkley2fg26TxlOcKNEHm7o6HRtiiFsVK4Ifw==} + engines: {node: '>=8.0.0'} + + web3-eth-personal@1.7.4: + resolution: {integrity: sha512-O10C1Hln5wvLQsDhlhmV58RhXo+GPZ5+W76frSsyIrkJWLtYQTCr5WxHtRC9sMD1idXLqODKKgI2DL+7xeZ0/g==} + engines: {node: '>=8.0.0'} + + web3-eth@1.10.0: + resolution: {integrity: sha512-Z5vT6slNMLPKuwRyKGbqeGYC87OAy8bOblaqRTgg94CXcn/mmqU7iPIlG4506YdcdK3x6cfEDG7B6w+jRxypKA==} + engines: {node: '>=8.0.0'} + + web3-eth@1.2.11: + resolution: {integrity: sha512-REvxW1wJ58AgHPcXPJOL49d1K/dPmuw4LjPLBPStOVkQjzDTVmJEIsiLwn2YeuNDd4pfakBwT8L3bz1G1/wVsQ==} + engines: {node: '>=8.0.0'} + + web3-eth@1.7.4: + resolution: {integrity: sha512-JG0tTMv0Ijj039emXNHi07jLb0OiWSA9O24MRSk5vToTQyDNXihdF2oyq85LfHuF690lXZaAXrjhtLNlYqb7Ug==} + engines: {node: '>=8.0.0'} + + web3-net@1.10.0: + resolution: {integrity: sha512-NLH/N3IshYWASpxk4/18Ge6n60GEvWBVeM8inx2dmZJVmRI6SJIlUxbL8jySgiTn3MMZlhbdvrGo8fpUW7a1GA==} + engines: {node: '>=8.0.0'} + + web3-net@1.2.11: + resolution: {integrity: sha512-sjrSDj0pTfZouR5BSTItCuZ5K/oZPVdVciPQ6981PPPIwJJkCMeVjD7I4zO3qDPCnBjBSbWvVnLdwqUBPtHxyg==} + engines: {node: '>=8.0.0'} + + web3-net@1.7.4: + resolution: {integrity: sha512-d2Gj+DIARHvwIdmxFQ4PwAAXZVxYCR2lET0cxz4KXbE5Og3DNjJi+MoPkX+WqoUXqimu/EOd4Cd+7gefqVAFDg==} + engines: {node: '>=8.0.0'} + + web3-provider-engine@14.2.1: + resolution: {integrity: sha512-iSv31h2qXkr9vrL6UZDm4leZMc32SjWJFGOp/D92JXfcEboCqraZyuExDkpxKw8ziTufXieNM7LSXNHzszYdJw==} + deprecated: 'This package has been deprecated, see the README for details: https://github.com/MetaMask/web3-provider-engine' + + web3-providers-http@1.10.0: + resolution: {integrity: sha512-eNr965YB8a9mLiNrkjAWNAPXgmQWfpBfkkn7tpEFlghfww0u3I0tktMZiaToJVcL2+Xq+81cxbkpeWJ5XQDwOA==} + engines: {node: '>=8.0.0'} + + web3-providers-http@1.2.11: + resolution: {integrity: sha512-psh4hYGb1+ijWywfwpB2cvvOIMISlR44F/rJtYkRmQ5jMvG4FOCPlQJPiHQZo+2cc3HbktvvSJzIhkWQJdmvrA==} + engines: {node: '>=8.0.0'} + + web3-providers-http@1.7.4: + resolution: {integrity: sha512-AU+/S+49rcogUER99TlhW+UBMk0N2DxvN54CJ2pK7alc2TQ7+cprNPLHJu4KREe8ndV0fT6JtWUfOMyTvl+FRA==} + engines: {node: '>=8.0.0'} + + web3-providers-ipc@1.10.0: + resolution: {integrity: sha512-OfXG1aWN8L1OUqppshzq8YISkWrYHaATW9H8eh0p89TlWMc1KZOL9vttBuaBEi96D/n0eYDn2trzt22bqHWfXA==} + engines: {node: '>=8.0.0'} + + web3-providers-ipc@1.2.11: + resolution: {integrity: sha512-yhc7Y/k8hBV/KlELxynWjJDzmgDEDjIjBzXK+e0rHBsYEhdCNdIH5Psa456c+l0qTEU2YzycF8VAjYpWfPnBpQ==} + engines: {node: '>=8.0.0'} + + web3-providers-ipc@1.7.4: + resolution: {integrity: sha512-jhArOZ235dZy8fS8090t60nTxbd1ap92ibQw5xIrAQ9m7LcZKNfmLAQUVsD+3dTFvadRMi6z1vCO7zRi84gWHw==} + engines: {node: '>=8.0.0'} + + web3-providers-ws@1.10.0: + resolution: {integrity: sha512-sK0fNcglW36yD5xjnjtSGBnEtf59cbw4vZzJ+CmOWIKGIR96mP5l684g0WD0Eo+f4NQc2anWWXG74lRc9OVMCQ==} + engines: {node: '>=8.0.0'} + + web3-providers-ws@1.2.11: + resolution: {integrity: sha512-ZxnjIY1Er8Ty+cE4migzr43zA/+72AF1myzsLaU5eVgdsfV7Jqx7Dix1hbevNZDKFlSoEyq/3j/jYalh3So1Zg==} + engines: {node: '>=8.0.0'} + + web3-providers-ws@1.7.4: + resolution: {integrity: sha512-g72X77nrcHMFU8hRzQJzfgi/072n8dHwRCoTw+WQrGp+XCQ71fsk2qIu3Tp+nlp5BPn8bRudQbPblVm2uT4myQ==} + engines: {node: '>=8.0.0'} + + web3-shh@1.10.0: + resolution: {integrity: sha512-uNUUuNsO2AjX41GJARV9zJibs11eq6HtOe6Wr0FtRUcj8SN6nHeYIzwstAvJ4fXA53gRqFMTxdntHEt9aXVjpg==} + engines: {node: '>=8.0.0'} + + web3-shh@1.2.11: + resolution: {integrity: sha512-B3OrO3oG1L+bv3E1sTwCx66injW1A8hhwpknDUbV+sw3fehFazA06z9SGXUefuFI1kVs4q2vRi0n4oCcI4dZDg==} + engines: {node: '>=8.0.0'} + + web3-shh@1.7.4: + resolution: {integrity: sha512-mlSZxSYcMkuMCxqhTYnZkUdahZ11h+bBv/8TlkXp/IHpEe4/Gg+KAbmfudakq3EzG/04z70XQmPgWcUPrsEJ+A==} + engines: {node: '>=8.0.0'} + + web3-types@1.10.0: + resolution: {integrity: sha512-0IXoaAFtFc8Yin7cCdQfB9ZmjafrbP6BO0f0KT/khMhXKUpoJ6yShrVhiNpyRBo8QQjuOagsWzwSK2H49I7sbw==} + engines: {node: '>=14', npm: '>=6.12.0'} + + web3-utils@1.10.0: + resolution: {integrity: sha512-kSaCM0uMcZTNUSmn5vMEhlo02RObGNRRCkdX0V9UTAU0+lrvn0HSaudyCo6CQzuXUsnuY2ERJGCGPfeWmv19Rg==} + engines: {node: '>=8.0.0'} + + web3-utils@1.10.4: + resolution: {integrity: sha512-tsu8FiKJLk2PzhDl9fXbGUWTkkVXYhtTA+SmEFkKft+9BgwLxfCRpU96sWv7ICC8zixBNd3JURVoiR3dUXgP8A==} + engines: {node: '>=8.0.0'} + + web3-utils@1.2.11: + resolution: {integrity: sha512-3Tq09izhD+ThqHEaWYX4VOT7dNPdZiO+c/1QMA0s5X2lDFKK/xHJb7cyTRRVzN2LvlHbR7baS1tmQhSua51TcQ==} + engines: {node: '>=8.0.0'} + + web3-utils@1.7.4: + resolution: {integrity: sha512-acBdm6Evd0TEZRnChM/MCvGsMwYKmSh7OaUfNf5OKG0CIeGWD/6gqLOWIwmwSnre/2WrA1nKGId5uW2e5EfluA==} + engines: {node: '>=8.0.0'} + + web3-utils@4.3.3: + resolution: {integrity: sha512-kZUeCwaQm+RNc2Bf1V3BYbF29lQQKz28L0y+FA4G0lS8IxtJVGi5SeDTUkpwqqkdHHC7JcapPDnyyzJ1lfWlOw==} + engines: {node: '>=14', npm: '>=6.12.0'} + + web3-validator@2.0.6: + resolution: {integrity: sha512-qn9id0/l1bWmvH4XfnG/JtGKKwut2Vokl6YXP5Kfg424npysmtRLe9DgiNBM9Op7QL/aSiaA0TVXibuIuWcizg==} + engines: {node: '>=14', npm: '>=6.12.0'} + + web3@1.10.0: + resolution: {integrity: sha512-YfKY9wSkGcM8seO+daR89oVTcbu18NsVfvOngzqMYGUU0pPSQmE57qQDvQzUeoIOHAnXEBNzrhjQJmm8ER0rng==} + engines: {node: '>=8.0.0'} + + web3@1.2.11: + resolution: {integrity: sha512-mjQ8HeU41G6hgOYm1pmeH0mRAeNKJGnJEUzDMoerkpw7QUQT4exVREgF1MYPvL/z6vAshOXei25LE/t/Bxl8yQ==} + engines: {node: '>=8.0.0'} + + web3@1.7.4: + resolution: {integrity: sha512-iFGK5jO32vnXM/ASaJBaI0+gVR6uHozvYdxkdhaeOCD6HIQ4iIXadbO2atVpE9oc/H8l2MovJ4LtPhG7lIBN8A==} + engines: {node: '>=8.0.0'} + + webcrypto-core@1.8.1: + resolution: {integrity: sha512-P+x1MvlNCXlKbLSOY4cYrdreqPG5hbzkmawbcXLKN/mf6DZW0SdNNkZ+sjwsqVkI4A4Ko2sPZmkZtCKY58w83A==} + + webidl-conversions@3.0.1: + resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} + + websocket@1.0.32: + resolution: {integrity: sha512-i4yhcllSP4wrpoPMU2N0TQ/q0O94LRG/eUQjEAamRltjQ1oT1PFFKOG4i877OlJgCG8rw6LrrowJp+TYCEWF7Q==} + engines: {node: '>=4.0.0'} + + websocket@1.0.35: + resolution: {integrity: sha512-/REy6amwPZl44DDzvRCkaI1q1bIiQB0mEFQLUrhz3z2EK91cp3n72rAjUlrTP0zV22HJIUOVHQGPxhFRjxjt+Q==} + engines: {node: '>=4.0.0'} + + whatwg-fetch@2.0.4: + resolution: {integrity: sha512-dcQ1GWpOD/eEQ97k66aiEVpNnapVj90/+R+SXTPYGHpYBBypfKJEQjLrvMZ7YXbKm21gXd4NcuxUTjiv1YtLng==} + + whatwg-fetch@3.6.20: + resolution: {integrity: sha512-EqhiFU6daOA8kpjOWTL0olhVOF3i7OrFzSYiGsEMB8GcXS+RrzauAERX65xMeNWVqxA6HXH2m69Z9LaKKdisfg==} + + whatwg-url@5.0.0: + resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} + + which-boxed-primitive@1.1.1: + resolution: {integrity: sha512-TbX3mj8n0odCBFVlY8AxkqcHASw3L60jIuF8jFP78az3C2YhmGvqbHBpAjTRH2/xqYunrJ9g1jSyjCjpoWzIAA==} + engines: {node: '>= 0.4'} + + which-builtin-type@1.2.1: + resolution: {integrity: sha512-6iBczoX+kDQ7a3+YJBnh3T+KZRxM/iYNPXicqk66/Qfm1b93iu+yOImkg0zHbj5LNOcNv1TEADiZ0xa34B4q6Q==} + engines: {node: '>= 0.4'} + + which-collection@1.0.2: + resolution: {integrity: sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw==} + engines: {node: '>= 0.4'} + + which-module@1.0.0: + resolution: {integrity: sha512-F6+WgncZi/mJDrammbTuHe1q0R5hOXv/mBaiNA2TCNT/LTHusX0V+CJnj9XT8ki5ln2UZyyddDgHfCzyrOH7MQ==} + + which-module@2.0.1: + resolution: {integrity: sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==} + + which-pm-runs@1.1.0: + resolution: {integrity: sha512-n1brCuqClxfFfq/Rb0ICg9giSZqCS+pLtccdag6C2HyufBrh3fBOiy9nb6ggRMvWOVH5GrdJskj5iGTZNxd7SA==} + engines: {node: '>=4'} + + which-typed-array@1.1.19: + resolution: {integrity: sha512-rEvr90Bck4WZt9HHFC4DJMsjvu7x+r6bImz0/BrbWb7A2djJ8hnZMrWnHo9F8ssv0OMErasDhftrfROTyqSDrw==} + engines: {node: '>= 0.4'} + + which@1.3.1: + resolution: {integrity: sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==} + hasBin: true + + which@2.0.2: + resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} + engines: {node: '>= 8'} + hasBin: true + + wide-align@1.1.5: + resolution: {integrity: sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==} + + widest-line@3.1.0: + resolution: {integrity: sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg==} + engines: {node: '>=8'} + + window-size@0.2.0: + resolution: {integrity: sha512-UD7d8HFA2+PZsbKyaOCEy8gMh1oDtHgJh1LfgjQ4zVXmYjAT/kvz3PueITKuqDiIXQe7yzpPnxX3lNc+AhQMyw==} + engines: {node: '>= 0.10.0'} + hasBin: true + + winston-transport@4.9.0: + resolution: {integrity: sha512-8drMJ4rkgaPo1Me4zD/3WLfI/zPdA9o2IipKODunnGDcuqbHwjsbB79ylv04LCGGzU0xQ6vTznOMpQGaLhhm6A==} + engines: {node: '>= 12.0.0'} + + winston@3.17.0: + resolution: {integrity: sha512-DLiFIXYC5fMPxaRg832S6F5mJYvePtmO5G9v9IgUFPhXm9/GkXarH/TUrBAVzhTCzAj9anE/+GjrgXp/54nOgw==} + engines: {node: '>= 12.0.0'} + + wkx@0.5.0: + resolution: {integrity: sha512-Xng/d4Ichh8uN4l0FToV/258EjMGU9MGcA0HV2d9B/ZpZB3lqQm7nkOdZdm5GhKtLLhAE7PiVQwN4eN+2YJJUg==} + + wonka@4.0.15: + resolution: {integrity: sha512-U0IUQHKXXn6PFo9nqsHphVCE5m3IntqZNB9Jjn7EB1lrR7YTDY3YWgFvEvwniTzXSvOH/XMzAZaIfJF/LvHYXg==} + + wonka@6.3.5: + resolution: {integrity: sha512-SSil+ecw6B4/Dm7Pf2sAshKQ5hWFvfyGlfPbEd6A14dOH6VDjrmbY86u6nZvy9omGwwIPFR8V41+of1EezgoUw==} + + word-wrap@1.2.5: + resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==} + engines: {node: '>=0.10.0'} + + wordwrap@1.0.0: + resolution: {integrity: sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==} + + wordwrapjs@4.0.1: + resolution: {integrity: sha512-kKlNACbvHrkpIw6oPeYDSmdCTu2hdMHoyXLTcUKala++lx5Y+wjJ/e474Jqv5abnVmwxw08DiTuHmw69lJGksA==} + engines: {node: '>=8.0.0'} + + workerpool@6.5.1: + resolution: {integrity: sha512-Fs4dNYcsdpYSAfVxhnl1L5zTksjvOJxtC5hzMNl+1t9B8hTJTdKDyZ5ju7ztgPy+ft9tBFXoOlDNiOT9WUXZlA==} + + wrap-ansi@2.1.0: + resolution: {integrity: sha512-vAaEaDM946gbNpH5pLVNR+vX2ht6n0Bt3GXwVB1AuAqZosOvHNF3P7wDnh8KLkSqgUh0uh77le7Owgoz+Z9XBw==} + engines: {node: '>=0.10.0'} + + wrap-ansi@6.2.0: + resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} + engines: {node: '>=8'} + + wrap-ansi@7.0.0: + resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} + engines: {node: '>=10'} + + wrap-ansi@8.1.0: + resolution: {integrity: sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==} + engines: {node: '>=12'} + + wrap-ansi@9.0.0: + resolution: {integrity: sha512-G8ura3S+3Z2G+mkgNRq8dqaFZAuxfsxpBB8OCTGRTCtp+l/v9nbFNmCUP1BZMts3G1142MsZfn6eeUKrr4PD1Q==} + engines: {node: '>=18'} + + wrappy@1.0.2: + resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} + + write-file-atomic@4.0.2: + resolution: {integrity: sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==} + engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} + + ws@3.3.3: + resolution: {integrity: sha512-nnWLa/NwZSt4KQJu51MYlCcSQ5g7INpOrOMt4XV8j4dqTXdmlUmSHQ8/oLC069ckre0fRsgfvsKwbTdtKLCDkA==} + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: ^5.0.2 + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + + ws@5.2.4: + resolution: {integrity: sha512-fFCejsuC8f9kOSu9FYaOw8CdO68O3h5v0lg4p74o8JqWpwTf9tniOD+nOB78aWoVSS6WptVUmDrp/KPsMVBWFQ==} + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: ^5.0.2 + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + + ws@6.2.3: + resolution: {integrity: sha512-jmTjYU0j60B+vHey6TfR3Z7RD61z/hmxBS3VMSGIrroOWXQEneK1zNuotOUrGyBHQj0yrpsLHPWtigEFd13ndA==} + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: ^5.0.2 + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + + ws@7.4.6: + resolution: {integrity: sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==} + engines: {node: '>=8.3.0'} + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: ^5.0.2 + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + + ws@7.5.10: + resolution: {integrity: sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==} + engines: {node: '>=8.3.0'} + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: ^5.0.2 + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + + ws@8.13.0: + resolution: {integrity: sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==} + engines: {node: '>=10.0.0'} + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: '>=5.0.2' + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + + ws@8.17.1: + resolution: {integrity: sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==} + engines: {node: '>=10.0.0'} + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: '>=5.0.2' + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + + ws@8.18.0: + resolution: {integrity: sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==} + engines: {node: '>=10.0.0'} + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: '>=5.0.2' + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + + ws@8.18.2: + resolution: {integrity: sha512-DMricUmwGZUVr++AEAe2uiVM7UoO9MAVZMDu05UQOaUII0lp+zOzLLU4Xqh/JvTqklB1T4uELaaPBKyjE1r4fQ==} + engines: {node: '>=10.0.0'} + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: '>=5.0.2' + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + + xhr-request-promise@0.1.3: + resolution: {integrity: sha512-YUBytBsuwgitWtdRzXDDkWAXzhdGB8bYm0sSzMPZT7Z2MBjMSTHFsyCT1yCRATY+XC69DUrQraRAEgcoCRaIPg==} + + xhr-request@1.1.0: + resolution: {integrity: sha512-Y7qzEaR3FDtL3fP30k9wO/e+FBnBByZeybKOhASsGP30NIkRAAkKD/sCnLvgEfAIEC1rcmK7YG8f4oEnIrrWzA==} + + xhr2-cookies@1.1.0: + resolution: {integrity: sha512-hjXUA6q+jl/bd8ADHcVfFsSPIf+tyLIjuO9TwJC9WI6JP2zKcS7C+p56I9kCLLsaCiNT035iYvEUUzdEFj/8+g==} + + xhr@2.6.0: + resolution: {integrity: sha512-/eCGLb5rxjx5e3mF1A7s+pLlR6CGyqWN91fv1JgER5mVWg1MZmlhBvy9kjcsOdRk8RrIujotWyJamfyrp+WIcA==} + + xmlhttprequest@1.8.0: + resolution: {integrity: sha512-58Im/U0mlVBLM38NdZjHyhuMtCqa61469k2YP/AaPbvCoV9aQGUpbJBj1QRm2ytRiVQBD/fsw7L2bJGDVQswBA==} + engines: {node: '>=0.4.0'} + + xtend@2.1.2: + resolution: {integrity: sha512-vMNKzr2rHP9Dp/e1NQFnLQlwlhp9L/LfvnsVdHxN1f+uggyVI3i08uD14GPvCToPkdsRfyPqIyYGmIk58V98ZQ==} + engines: {node: '>=0.4'} + + xtend@4.0.2: + resolution: {integrity: sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==} + engines: {node: '>=0.4'} + + y18n@3.2.2: + resolution: {integrity: sha512-uGZHXkHnhF0XeeAPgnKfPv1bgKAYyVvmNL1xlKsPYZPaIHxGti2hHqvOCQv71XMsLxu1QjergkqogUnms5D3YQ==} + + y18n@4.0.3: + resolution: {integrity: sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==} + + y18n@5.0.8: + resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} + engines: {node: '>=10'} + + yaeti@0.0.6: + resolution: {integrity: sha512-MvQa//+KcZCUkBTIC9blM+CU9J2GzuTytsOUwf2lidtvkx/6gnEp1QvJv34t9vdjhFmha/mUiNDbN0D0mJWdug==} + engines: {node: '>=0.10.32'} + deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. + + yallist@2.1.2: + resolution: {integrity: sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A==} + + yallist@3.1.1: + resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==} + + yallist@4.0.0: + resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} + + yaml@1.10.2: + resolution: {integrity: sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==} + engines: {node: '>= 6'} + + yaml@2.7.1: + resolution: {integrity: sha512-10ULxpnOCQXxJvBgxsn9ptjq6uviG/htZKk9veJGhlqn3w/DxQ631zFF+nlQXLwmImeS5amR2dl2U8sg6U9jsQ==} + engines: {node: '>= 14'} + hasBin: true + + yargs-parser@18.1.3: + resolution: {integrity: sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==} + engines: {node: '>=6'} + + yargs-parser@2.4.1: + resolution: {integrity: sha512-9pIKIJhnI5tonzG6OnCFlz/yln8xHYcGl+pn3xR0Vzff0vzN1PbNRaelgfgRUwZ3s4i3jvxT9WhmUGL4whnasA==} + + yargs-parser@20.2.9: + resolution: {integrity: sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==} + engines: {node: '>=10'} + + yargs-parser@21.1.1: + resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} + engines: {node: '>=12'} + + yargs-parser@8.1.0: + resolution: {integrity: sha512-yP+6QqN8BmrgW2ggLtTbdrOyBNSI7zBa4IykmiV5R1wl1JWNxQvWhMfMdmzIYtKU7oP3OOInY/tl2ov3BDjnJQ==} + + yargs-unparser@2.0.0: + resolution: {integrity: sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==} + engines: {node: '>=10'} + + yargs@10.1.2: + resolution: {integrity: sha512-ivSoxqBGYOqQVruxD35+EyCFDYNEFL/Uo6FcOnz+9xZdZzK0Zzw4r4KhbrME1Oo2gOggwJod2MnsdamSG7H9ig==} + + yargs@15.4.1: + resolution: {integrity: sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==} + engines: {node: '>=8'} + + yargs@16.2.0: + resolution: {integrity: sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==} + engines: {node: '>=10'} + + yargs@17.7.2: + resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} + engines: {node: '>=12'} + + yargs@4.8.1: + resolution: {integrity: sha512-LqodLrnIDM3IFT+Hf/5sxBnEGECrfdC1uIbgZeJmESCSo4HoCAaKEus8MylXHAkdacGc0ye+Qa+dpkuom8uVYA==} + + yn@3.1.1: + resolution: {integrity: sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==} + engines: {node: '>=6'} + + yocto-queue@0.1.0: + resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} + engines: {node: '>=10'} + + zod-to-json-schema@3.24.5: + resolution: {integrity: sha512-/AuWwMP+YqiPbsJx5D6TfgRTc4kTLjsh5SOcd4bLsfUg2RcEXrFMJl1DGgdHy2aCfsIA/cr/1JM0xcB2GZji8g==} + peerDependencies: + zod: ^3.24.1 + + zod@3.24.4: + resolution: {integrity: sha512-OdqJE9UDRPwWsrHjLN2F8bPxvwJBK22EHLWtanu0LSYr5YqzsaaW3RMgmjwr8Rypg5k+meEJdSPXJZXE/yqOMg==} + +snapshots: + + '@adraffy/ens-normalize@1.10.1': {} + + '@ampproject/remapping@2.3.0': + dependencies: + '@jridgewell/gen-mapping': 0.3.8 + '@jridgewell/trace-mapping': 0.3.25 + + '@arbitrum/sdk@3.1.13(bufferutil@4.0.9)(utf-8-validate@5.0.10)': + dependencies: + '@ethersproject/address': 5.8.0 + '@ethersproject/bignumber': 5.8.0 + '@ethersproject/bytes': 5.8.0 + async-mutex: 0.4.1 + ethers: 5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + transitivePeerDependencies: + - bufferutil + - utf-8-validate + + '@ardatan/fast-json-stringify@0.0.6(ajv-formats@2.1.1(ajv@8.17.1))(ajv@8.17.1)': + dependencies: + '@fastify/deepmerge': 1.3.0 + ajv: 8.17.1 + ajv-formats: 2.1.1(ajv@8.17.1) + fast-deep-equal: 3.1.3 + rfdc: 1.4.1 + + '@ardatan/relay-compiler@12.0.0(encoding@0.1.13)(graphql@16.11.0)': + dependencies: + '@babel/core': 7.27.1 + '@babel/generator': 7.27.1 + '@babel/parser': 7.27.1 + '@babel/runtime': 7.27.1 + '@babel/traverse': 7.27.1 + '@babel/types': 7.27.1 + babel-preset-fbjs: 3.4.0(@babel/core@7.27.1) + chalk: 4.1.2 + fb-watchman: 2.0.2 + fbjs: 3.0.5(encoding@0.1.13) + glob: 7.2.3 + graphql: 16.11.0 + immutable: 3.7.6 + invariant: 2.2.4 + nullthrows: 1.1.1 + relay-runtime: 12.0.0(encoding@0.1.13) + signedsource: 1.0.0 + yargs: 15.4.1 + transitivePeerDependencies: + - encoding + - supports-color + + '@ardatan/sync-fetch@0.0.1(encoding@0.1.13)': + dependencies: + node-fetch: 2.7.0(encoding@0.1.13) + transitivePeerDependencies: + - encoding + + '@aws-crypto/sha256-js@1.2.2': + dependencies: + '@aws-crypto/util': 1.2.2 + '@aws-sdk/types': 3.775.0 + tslib: 1.14.1 + + '@aws-crypto/util@1.2.2': + dependencies: + '@aws-sdk/types': 3.775.0 + '@aws-sdk/util-utf8-browser': 3.259.0 + tslib: 1.14.1 + + '@aws-sdk/types@3.775.0': + dependencies: + '@smithy/types': 4.2.0 + tslib: 2.8.1 + + '@aws-sdk/util-utf8-browser@3.259.0': + dependencies: + tslib: 2.8.1 + + '@babel/code-frame@7.27.1': + dependencies: + '@babel/helper-validator-identifier': 7.27.1 + js-tokens: 4.0.0 + picocolors: 1.1.1 + + '@babel/compat-data@7.27.1': {} + + '@babel/core@7.27.1': + dependencies: + '@ampproject/remapping': 2.3.0 + '@babel/code-frame': 7.27.1 + '@babel/generator': 7.27.1 + '@babel/helper-compilation-targets': 7.27.1 + '@babel/helper-module-transforms': 7.27.1(@babel/core@7.27.1) + '@babel/helpers': 7.27.1 + '@babel/parser': 7.27.1 + '@babel/template': 7.27.1 + '@babel/traverse': 7.27.1 + '@babel/types': 7.27.1 + convert-source-map: 2.0.0 + debug: 4.4.0(supports-color@9.4.0) + gensync: 1.0.0-beta.2 + json5: 2.2.3 + semver: 6.3.1 + transitivePeerDependencies: + - supports-color + + '@babel/generator@7.27.1': + dependencies: + '@babel/parser': 7.27.1 + '@babel/types': 7.27.1 + '@jridgewell/gen-mapping': 0.3.8 + '@jridgewell/trace-mapping': 0.3.25 + jsesc: 3.1.0 + + '@babel/helper-annotate-as-pure@7.27.1': + dependencies: + '@babel/types': 7.27.1 + + '@babel/helper-compilation-targets@7.27.1': + dependencies: + '@babel/compat-data': 7.27.1 + '@babel/helper-validator-option': 7.27.1 + browserslist: 4.24.5 + lru-cache: 5.1.1 + semver: 6.3.1 + + '@babel/helper-create-class-features-plugin@7.27.1(@babel/core@7.27.1)': + dependencies: + '@babel/core': 7.27.1 + '@babel/helper-annotate-as-pure': 7.27.1 + '@babel/helper-member-expression-to-functions': 7.27.1 + '@babel/helper-optimise-call-expression': 7.27.1 + '@babel/helper-replace-supers': 7.27.1(@babel/core@7.27.1) + '@babel/helper-skip-transparent-expression-wrappers': 7.27.1 + '@babel/traverse': 7.27.1 + semver: 6.3.1 + transitivePeerDependencies: + - supports-color + + '@babel/helper-member-expression-to-functions@7.27.1': + dependencies: + '@babel/traverse': 7.27.1 + '@babel/types': 7.27.1 + transitivePeerDependencies: + - supports-color + + '@babel/helper-module-imports@7.27.1': + dependencies: + '@babel/traverse': 7.27.1 + '@babel/types': 7.27.1 + transitivePeerDependencies: + - supports-color + + '@babel/helper-module-transforms@7.27.1(@babel/core@7.27.1)': + dependencies: + '@babel/core': 7.27.1 + '@babel/helper-module-imports': 7.27.1 + '@babel/helper-validator-identifier': 7.27.1 + '@babel/traverse': 7.27.1 + transitivePeerDependencies: + - supports-color + + '@babel/helper-optimise-call-expression@7.27.1': + dependencies: + '@babel/types': 7.27.1 + + '@babel/helper-plugin-utils@7.27.1': {} + + '@babel/helper-replace-supers@7.27.1(@babel/core@7.27.1)': + dependencies: + '@babel/core': 7.27.1 + '@babel/helper-member-expression-to-functions': 7.27.1 + '@babel/helper-optimise-call-expression': 7.27.1 + '@babel/traverse': 7.27.1 + transitivePeerDependencies: + - supports-color + + '@babel/helper-skip-transparent-expression-wrappers@7.27.1': + dependencies: + '@babel/traverse': 7.27.1 + '@babel/types': 7.27.1 + transitivePeerDependencies: + - supports-color + + '@babel/helper-string-parser@7.27.1': {} + + '@babel/helper-validator-identifier@7.27.1': {} + + '@babel/helper-validator-option@7.27.1': {} + + '@babel/helpers@7.27.1': + dependencies: + '@babel/template': 7.27.1 + '@babel/types': 7.27.1 + + '@babel/parser@7.27.1': + dependencies: + '@babel/types': 7.27.1 + + '@babel/plugin-proposal-class-properties@7.18.6(@babel/core@7.27.1)': + dependencies: + '@babel/core': 7.27.1 + '@babel/helper-create-class-features-plugin': 7.27.1(@babel/core@7.27.1) + '@babel/helper-plugin-utils': 7.27.1 + transitivePeerDependencies: + - supports-color + + '@babel/plugin-proposal-object-rest-spread@7.20.7(@babel/core@7.27.1)': + dependencies: + '@babel/compat-data': 7.27.1 + '@babel/core': 7.27.1 + '@babel/helper-compilation-targets': 7.27.1 + '@babel/helper-plugin-utils': 7.27.1 + '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.27.1) + '@babel/plugin-transform-parameters': 7.27.1(@babel/core@7.27.1) + + '@babel/plugin-syntax-async-generators@7.8.4(@babel/core@7.27.1)': + dependencies: + '@babel/core': 7.27.1 + '@babel/helper-plugin-utils': 7.27.1 + + '@babel/plugin-syntax-bigint@7.8.3(@babel/core@7.27.1)': + dependencies: + '@babel/core': 7.27.1 + '@babel/helper-plugin-utils': 7.27.1 + + '@babel/plugin-syntax-class-properties@7.12.13(@babel/core@7.27.1)': + dependencies: + '@babel/core': 7.27.1 + '@babel/helper-plugin-utils': 7.27.1 + + '@babel/plugin-syntax-class-static-block@7.14.5(@babel/core@7.27.1)': + dependencies: + '@babel/core': 7.27.1 + '@babel/helper-plugin-utils': 7.27.1 + + '@babel/plugin-syntax-flow@7.27.1(@babel/core@7.27.1)': + dependencies: + '@babel/core': 7.27.1 + '@babel/helper-plugin-utils': 7.27.1 + + '@babel/plugin-syntax-import-assertions@7.27.1(@babel/core@7.27.1)': + dependencies: + '@babel/core': 7.27.1 + '@babel/helper-plugin-utils': 7.27.1 + + '@babel/plugin-syntax-import-attributes@7.27.1(@babel/core@7.27.1)': + dependencies: + '@babel/core': 7.27.1 + '@babel/helper-plugin-utils': 7.27.1 + + '@babel/plugin-syntax-import-meta@7.10.4(@babel/core@7.27.1)': + dependencies: + '@babel/core': 7.27.1 + '@babel/helper-plugin-utils': 7.27.1 + + '@babel/plugin-syntax-json-strings@7.8.3(@babel/core@7.27.1)': + dependencies: + '@babel/core': 7.27.1 + '@babel/helper-plugin-utils': 7.27.1 + + '@babel/plugin-syntax-jsx@7.27.1(@babel/core@7.27.1)': + dependencies: + '@babel/core': 7.27.1 + '@babel/helper-plugin-utils': 7.27.1 + + '@babel/plugin-syntax-logical-assignment-operators@7.10.4(@babel/core@7.27.1)': + dependencies: + '@babel/core': 7.27.1 + '@babel/helper-plugin-utils': 7.27.1 + + '@babel/plugin-syntax-nullish-coalescing-operator@7.8.3(@babel/core@7.27.1)': + dependencies: + '@babel/core': 7.27.1 + '@babel/helper-plugin-utils': 7.27.1 + + '@babel/plugin-syntax-numeric-separator@7.10.4(@babel/core@7.27.1)': + dependencies: + '@babel/core': 7.27.1 + '@babel/helper-plugin-utils': 7.27.1 + + '@babel/plugin-syntax-object-rest-spread@7.8.3(@babel/core@7.27.1)': + dependencies: + '@babel/core': 7.27.1 + '@babel/helper-plugin-utils': 7.27.1 + + '@babel/plugin-syntax-optional-catch-binding@7.8.3(@babel/core@7.27.1)': + dependencies: + '@babel/core': 7.27.1 + '@babel/helper-plugin-utils': 7.27.1 + + '@babel/plugin-syntax-optional-chaining@7.8.3(@babel/core@7.27.1)': + dependencies: + '@babel/core': 7.27.1 + '@babel/helper-plugin-utils': 7.27.1 + + '@babel/plugin-syntax-private-property-in-object@7.14.5(@babel/core@7.27.1)': + dependencies: + '@babel/core': 7.27.1 + '@babel/helper-plugin-utils': 7.27.1 + + '@babel/plugin-syntax-top-level-await@7.14.5(@babel/core@7.27.1)': + dependencies: + '@babel/core': 7.27.1 + '@babel/helper-plugin-utils': 7.27.1 + + '@babel/plugin-transform-arrow-functions@7.27.1(@babel/core@7.27.1)': + dependencies: + '@babel/core': 7.27.1 + '@babel/helper-plugin-utils': 7.27.1 + + '@babel/plugin-transform-block-scoped-functions@7.27.1(@babel/core@7.27.1)': + dependencies: + '@babel/core': 7.27.1 + '@babel/helper-plugin-utils': 7.27.1 + + '@babel/plugin-transform-block-scoping@7.27.1(@babel/core@7.27.1)': + dependencies: + '@babel/core': 7.27.1 + '@babel/helper-plugin-utils': 7.27.1 + + '@babel/plugin-transform-classes@7.27.1(@babel/core@7.27.1)': + dependencies: + '@babel/core': 7.27.1 + '@babel/helper-annotate-as-pure': 7.27.1 + '@babel/helper-compilation-targets': 7.27.1 + '@babel/helper-plugin-utils': 7.27.1 + '@babel/helper-replace-supers': 7.27.1(@babel/core@7.27.1) + '@babel/traverse': 7.27.1 + globals: 11.12.0 + transitivePeerDependencies: + - supports-color + + '@babel/plugin-transform-computed-properties@7.27.1(@babel/core@7.27.1)': + dependencies: + '@babel/core': 7.27.1 + '@babel/helper-plugin-utils': 7.27.1 + '@babel/template': 7.27.1 + + '@babel/plugin-transform-destructuring@7.27.1(@babel/core@7.27.1)': + dependencies: + '@babel/core': 7.27.1 + '@babel/helper-plugin-utils': 7.27.1 + + '@babel/plugin-transform-flow-strip-types@7.27.1(@babel/core@7.27.1)': + dependencies: + '@babel/core': 7.27.1 + '@babel/helper-plugin-utils': 7.27.1 + '@babel/plugin-syntax-flow': 7.27.1(@babel/core@7.27.1) + + '@babel/plugin-transform-for-of@7.27.1(@babel/core@7.27.1)': + dependencies: + '@babel/core': 7.27.1 + '@babel/helper-plugin-utils': 7.27.1 + '@babel/helper-skip-transparent-expression-wrappers': 7.27.1 + transitivePeerDependencies: + - supports-color + + '@babel/plugin-transform-function-name@7.27.1(@babel/core@7.27.1)': + dependencies: + '@babel/core': 7.27.1 + '@babel/helper-compilation-targets': 7.27.1 + '@babel/helper-plugin-utils': 7.27.1 + '@babel/traverse': 7.27.1 + transitivePeerDependencies: + - supports-color + + '@babel/plugin-transform-literals@7.27.1(@babel/core@7.27.1)': + dependencies: + '@babel/core': 7.27.1 + '@babel/helper-plugin-utils': 7.27.1 + + '@babel/plugin-transform-member-expression-literals@7.27.1(@babel/core@7.27.1)': + dependencies: + '@babel/core': 7.27.1 + '@babel/helper-plugin-utils': 7.27.1 + + '@babel/plugin-transform-modules-commonjs@7.27.1(@babel/core@7.27.1)': + dependencies: + '@babel/core': 7.27.1 + '@babel/helper-module-transforms': 7.27.1(@babel/core@7.27.1) + '@babel/helper-plugin-utils': 7.27.1 + transitivePeerDependencies: + - supports-color + + '@babel/plugin-transform-object-super@7.27.1(@babel/core@7.27.1)': + dependencies: + '@babel/core': 7.27.1 + '@babel/helper-plugin-utils': 7.27.1 + '@babel/helper-replace-supers': 7.27.1(@babel/core@7.27.1) + transitivePeerDependencies: + - supports-color + + '@babel/plugin-transform-parameters@7.27.1(@babel/core@7.27.1)': + dependencies: + '@babel/core': 7.27.1 + '@babel/helper-plugin-utils': 7.27.1 + + '@babel/plugin-transform-property-literals@7.27.1(@babel/core@7.27.1)': + dependencies: + '@babel/core': 7.27.1 + '@babel/helper-plugin-utils': 7.27.1 + + '@babel/plugin-transform-react-display-name@7.27.1(@babel/core@7.27.1)': + dependencies: + '@babel/core': 7.27.1 + '@babel/helper-plugin-utils': 7.27.1 + + '@babel/plugin-transform-react-jsx@7.27.1(@babel/core@7.27.1)': + dependencies: + '@babel/core': 7.27.1 + '@babel/helper-annotate-as-pure': 7.27.1 + '@babel/helper-module-imports': 7.27.1 + '@babel/helper-plugin-utils': 7.27.1 + '@babel/plugin-syntax-jsx': 7.27.1(@babel/core@7.27.1) + '@babel/types': 7.27.1 + transitivePeerDependencies: + - supports-color + + '@babel/plugin-transform-shorthand-properties@7.27.1(@babel/core@7.27.1)': + dependencies: + '@babel/core': 7.27.1 + '@babel/helper-plugin-utils': 7.27.1 + + '@babel/plugin-transform-spread@7.27.1(@babel/core@7.27.1)': + dependencies: + '@babel/core': 7.27.1 + '@babel/helper-plugin-utils': 7.27.1 + '@babel/helper-skip-transparent-expression-wrappers': 7.27.1 + transitivePeerDependencies: + - supports-color + + '@babel/plugin-transform-template-literals@7.27.1(@babel/core@7.27.1)': + dependencies: + '@babel/core': 7.27.1 + '@babel/helper-plugin-utils': 7.27.1 + + '@babel/runtime@7.27.1': {} + + '@babel/template@7.27.1': + dependencies: + '@babel/code-frame': 7.27.1 + '@babel/parser': 7.27.1 + '@babel/types': 7.27.1 + + '@babel/traverse@7.27.1': + dependencies: + '@babel/code-frame': 7.27.1 + '@babel/generator': 7.27.1 + '@babel/parser': 7.27.1 + '@babel/template': 7.27.1 + '@babel/types': 7.27.1 + debug: 4.4.0(supports-color@9.4.0) + globals: 11.12.0 + transitivePeerDependencies: + - supports-color + + '@babel/types@7.27.1': + dependencies: + '@babel/helper-string-parser': 7.27.1 + '@babel/helper-validator-identifier': 7.27.1 + + '@bytecodealliance/preview2-shim@0.17.0': {} + + '@chainsafe/as-sha256@0.3.1': {} + + '@chainsafe/persistent-merkle-tree@0.4.2': + dependencies: + '@chainsafe/as-sha256': 0.3.1 + + '@chainsafe/persistent-merkle-tree@0.5.0': + dependencies: + '@chainsafe/as-sha256': 0.3.1 + + '@chainsafe/ssz@0.10.2': + dependencies: + '@chainsafe/as-sha256': 0.3.1 + '@chainsafe/persistent-merkle-tree': 0.5.0 + + '@chainsafe/ssz@0.9.4': + dependencies: + '@chainsafe/as-sha256': 0.3.1 + '@chainsafe/persistent-merkle-tree': 0.4.2 + case: 1.6.3 + + '@changesets/apply-release-plan@7.0.12': + dependencies: + '@changesets/config': 3.1.1 + '@changesets/get-version-range-type': 0.4.0 + '@changesets/git': 3.0.4 + '@changesets/should-skip-package': 0.1.2 + '@changesets/types': 6.1.0 + '@manypkg/get-packages': 1.1.3 + detect-indent: 6.1.0 + fs-extra: 7.0.1 + lodash.startcase: 4.4.0 + outdent: 0.5.0 + prettier: 2.8.8 + resolve-from: 5.0.0 + semver: 7.7.1 + + '@changesets/assemble-release-plan@6.0.7': + dependencies: + '@changesets/errors': 0.2.0 + '@changesets/get-dependents-graph': 2.1.3 + '@changesets/should-skip-package': 0.1.2 + '@changesets/types': 6.1.0 + '@manypkg/get-packages': 1.1.3 + semver: 7.7.1 + + '@changesets/changelog-git@0.2.1': + dependencies: + '@changesets/types': 6.1.0 + + '@changesets/cli@2.29.3': + dependencies: + '@changesets/apply-release-plan': 7.0.12 + '@changesets/assemble-release-plan': 6.0.7 + '@changesets/changelog-git': 0.2.1 + '@changesets/config': 3.1.1 + '@changesets/errors': 0.2.0 + '@changesets/get-dependents-graph': 2.1.3 + '@changesets/get-release-plan': 4.0.11 + '@changesets/git': 3.0.4 + '@changesets/logger': 0.1.1 + '@changesets/pre': 2.0.2 + '@changesets/read': 0.6.5 + '@changesets/should-skip-package': 0.1.2 + '@changesets/types': 6.1.0 + '@changesets/write': 0.4.0 + '@manypkg/get-packages': 1.1.3 + ansi-colors: 4.1.3 + ci-info: 3.9.0 + enquirer: 2.4.1 + external-editor: 3.1.0 + fs-extra: 7.0.1 + mri: 1.2.0 + p-limit: 2.3.0 + package-manager-detector: 0.2.11 + picocolors: 1.1.1 + resolve-from: 5.0.0 + semver: 7.7.1 + spawndamnit: 3.0.1 + term-size: 2.2.1 + + '@changesets/config@3.1.1': + dependencies: + '@changesets/errors': 0.2.0 + '@changesets/get-dependents-graph': 2.1.3 + '@changesets/logger': 0.1.1 + '@changesets/types': 6.1.0 + '@manypkg/get-packages': 1.1.3 + fs-extra: 7.0.1 + micromatch: 4.0.8 + + '@changesets/errors@0.2.0': + dependencies: + extendable-error: 0.1.7 + + '@changesets/get-dependents-graph@2.1.3': + dependencies: + '@changesets/types': 6.1.0 + '@manypkg/get-packages': 1.1.3 + picocolors: 1.1.1 + semver: 7.7.1 + + '@changesets/get-release-plan@4.0.11': + dependencies: + '@changesets/assemble-release-plan': 6.0.7 + '@changesets/config': 3.1.1 + '@changesets/pre': 2.0.2 + '@changesets/read': 0.6.5 + '@changesets/types': 6.1.0 + '@manypkg/get-packages': 1.1.3 + + '@changesets/get-version-range-type@0.4.0': {} + + '@changesets/git@3.0.4': + dependencies: + '@changesets/errors': 0.2.0 + '@manypkg/get-packages': 1.1.3 + is-subdir: 1.2.0 + micromatch: 4.0.8 + spawndamnit: 3.0.1 + + '@changesets/logger@0.1.1': + dependencies: + picocolors: 1.1.1 + + '@changesets/parse@0.4.1': + dependencies: + '@changesets/types': 6.1.0 + js-yaml: 3.14.1 + + '@changesets/pre@2.0.2': + dependencies: + '@changesets/errors': 0.2.0 + '@changesets/types': 6.1.0 + '@manypkg/get-packages': 1.1.3 + fs-extra: 7.0.1 + + '@changesets/read@0.6.5': + dependencies: + '@changesets/git': 3.0.4 + '@changesets/logger': 0.1.1 + '@changesets/parse': 0.4.1 + '@changesets/types': 6.1.0 + fs-extra: 7.0.1 + p-filter: 2.1.0 + picocolors: 1.1.1 + + '@changesets/should-skip-package@0.1.2': + dependencies: + '@changesets/types': 6.1.0 + '@manypkg/get-packages': 1.1.3 + + '@changesets/types@4.1.0': {} + + '@changesets/types@6.1.0': {} + + '@changesets/write@0.4.0': + dependencies: + '@changesets/types': 6.1.0 + fs-extra: 7.0.1 + human-id: 4.1.1 + prettier: 2.8.8 + + '@colors/colors@1.5.0': + optional: true + + '@colors/colors@1.6.0': {} + + '@commitlint/cli@16.3.0': + dependencies: + '@commitlint/format': 16.2.1 + '@commitlint/lint': 16.2.4 + '@commitlint/load': 16.3.0 + '@commitlint/read': 16.2.1 + '@commitlint/types': 16.2.1 + lodash: 4.17.21 + resolve-from: 5.0.0 + resolve-global: 1.0.0 + yargs: 17.7.2 + transitivePeerDependencies: + - '@swc/core' + - '@swc/wasm' + + '@commitlint/cli@18.6.1(@types/node@22.7.5)(typescript@5.8.3)': + dependencies: + '@commitlint/format': 18.6.1 + '@commitlint/lint': 18.6.1 + '@commitlint/load': 18.6.1(@types/node@22.7.5)(typescript@5.8.3) + '@commitlint/read': 18.6.1 + '@commitlint/types': 18.6.1 + execa: 5.1.1 + lodash.isfunction: 3.0.9 + resolve-from: 5.0.0 + resolve-global: 1.0.0 + yargs: 17.7.2 + transitivePeerDependencies: + - '@types/node' + - typescript + + '@commitlint/config-conventional@16.2.4': + dependencies: + conventional-changelog-conventionalcommits: 4.6.3 + + '@commitlint/config-conventional@18.6.3': + dependencies: + '@commitlint/types': 18.6.1 + conventional-changelog-conventionalcommits: 7.0.2 + + '@commitlint/config-validator@16.2.1': + dependencies: + '@commitlint/types': 16.2.1 + ajv: 6.12.6 + + '@commitlint/config-validator@18.6.1': + dependencies: + '@commitlint/types': 18.6.1 + ajv: 8.17.1 + + '@commitlint/ensure@16.2.1': + dependencies: + '@commitlint/types': 16.2.1 + lodash: 4.17.21 + + '@commitlint/ensure@18.6.1': + dependencies: + '@commitlint/types': 18.6.1 + lodash.camelcase: 4.3.0 + lodash.kebabcase: 4.1.1 + lodash.snakecase: 4.1.1 + lodash.startcase: 4.4.0 + lodash.upperfirst: 4.3.1 + + '@commitlint/execute-rule@16.2.1': {} + + '@commitlint/execute-rule@18.6.1': {} + + '@commitlint/format@16.2.1': + dependencies: + '@commitlint/types': 16.2.1 + chalk: 4.1.2 + + '@commitlint/format@18.6.1': + dependencies: + '@commitlint/types': 18.6.1 + chalk: 4.1.2 + + '@commitlint/is-ignored@16.2.4': + dependencies: + '@commitlint/types': 16.2.1 + semver: 7.3.7 + + '@commitlint/is-ignored@18.6.1': + dependencies: + '@commitlint/types': 18.6.1 + semver: 7.6.0 + + '@commitlint/lint@16.2.4': + dependencies: + '@commitlint/is-ignored': 16.2.4 + '@commitlint/parse': 16.2.1 + '@commitlint/rules': 16.2.4 + '@commitlint/types': 16.2.1 + + '@commitlint/lint@18.6.1': + dependencies: + '@commitlint/is-ignored': 18.6.1 + '@commitlint/parse': 18.6.1 + '@commitlint/rules': 18.6.1 + '@commitlint/types': 18.6.1 + + '@commitlint/load@16.3.0': + dependencies: + '@commitlint/config-validator': 16.2.1 + '@commitlint/execute-rule': 16.2.1 + '@commitlint/resolve-extends': 16.2.1 + '@commitlint/types': 16.2.1 + '@types/node': 20.17.32 + chalk: 4.1.2 + cosmiconfig: 7.1.0 + cosmiconfig-typescript-loader: 2.0.2(@types/node@20.17.32)(cosmiconfig@7.1.0)(typescript@4.9.5) + lodash: 4.17.21 + resolve-from: 5.0.0 + typescript: 4.9.5 + transitivePeerDependencies: + - '@swc/core' + - '@swc/wasm' + + '@commitlint/load@18.6.1(@types/node@22.7.5)(typescript@5.8.3)': + dependencies: + '@commitlint/config-validator': 18.6.1 + '@commitlint/execute-rule': 18.6.1 + '@commitlint/resolve-extends': 18.6.1 + '@commitlint/types': 18.6.1 + chalk: 4.1.2 + cosmiconfig: 8.3.6(typescript@5.8.3) + cosmiconfig-typescript-loader: 5.1.0(@types/node@22.7.5)(cosmiconfig@8.3.6(typescript@5.8.3))(typescript@5.8.3) + lodash.isplainobject: 4.0.6 + lodash.merge: 4.6.2 + lodash.uniq: 4.5.0 + resolve-from: 5.0.0 + transitivePeerDependencies: + - '@types/node' + - typescript + + '@commitlint/message@16.2.1': {} + + '@commitlint/message@18.6.1': {} + + '@commitlint/parse@16.2.1': + dependencies: + '@commitlint/types': 16.2.1 + conventional-changelog-angular: 5.0.13 + conventional-commits-parser: 3.2.4 + + '@commitlint/parse@18.6.1': + dependencies: + '@commitlint/types': 18.6.1 + conventional-changelog-angular: 7.0.0 + conventional-commits-parser: 5.0.0 + + '@commitlint/read@16.2.1': + dependencies: + '@commitlint/top-level': 16.2.1 + '@commitlint/types': 16.2.1 + fs-extra: 10.1.0 + git-raw-commits: 2.0.11 + + '@commitlint/read@18.6.1': + dependencies: + '@commitlint/top-level': 18.6.1 + '@commitlint/types': 18.6.1 + git-raw-commits: 2.0.11 + minimist: 1.2.8 + + '@commitlint/resolve-extends@16.2.1': + dependencies: + '@commitlint/config-validator': 16.2.1 + '@commitlint/types': 16.2.1 + import-fresh: 3.3.1 + lodash: 4.17.21 + resolve-from: 5.0.0 + resolve-global: 1.0.0 + + '@commitlint/resolve-extends@18.6.1': + dependencies: + '@commitlint/config-validator': 18.6.1 + '@commitlint/types': 18.6.1 + import-fresh: 3.3.1 + lodash.mergewith: 4.6.2 + resolve-from: 5.0.0 + resolve-global: 1.0.0 + + '@commitlint/rules@16.2.4': + dependencies: + '@commitlint/ensure': 16.2.1 + '@commitlint/message': 16.2.1 + '@commitlint/to-lines': 16.2.1 + '@commitlint/types': 16.2.1 + execa: 5.1.1 + + '@commitlint/rules@18.6.1': + dependencies: + '@commitlint/ensure': 18.6.1 + '@commitlint/message': 18.6.1 + '@commitlint/to-lines': 18.6.1 + '@commitlint/types': 18.6.1 + execa: 5.1.1 + + '@commitlint/to-lines@16.2.1': {} + + '@commitlint/to-lines@18.6.1': {} + + '@commitlint/top-level@16.2.1': + dependencies: + find-up: 5.0.0 + + '@commitlint/top-level@18.6.1': + dependencies: + find-up: 5.0.0 + + '@commitlint/types@16.2.1': + dependencies: + chalk: 4.1.2 + + '@commitlint/types@18.6.1': + dependencies: + chalk: 4.1.2 + + '@cspotcode/source-map-support@0.8.1': + dependencies: + '@jridgewell/trace-mapping': 0.3.9 + + '@dabh/diagnostics@2.0.3': + dependencies: + colorspace: 1.1.4 + enabled: 2.0.0 + kuler: 2.0.0 + + '@defi-wonderland/natspec-smells@1.1.6(typescript@5.8.3)(zod@3.24.4)': + dependencies: + fast-glob: 3.3.2 + solc-typed-ast: 18.2.4(typescript@5.8.3)(zod@3.24.4) + yargs: 17.7.2 + transitivePeerDependencies: + - debug + - typescript + - zod + + '@defi-wonderland/smock@2.3.5(@ethersproject/abi@5.8.0)(@ethersproject/abstract-provider@5.8.0)(@ethersproject/abstract-signer@5.8.0)(@nomiclabs/hardhat-ethers@2.2.3(ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)))(ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10))': + dependencies: + '@ethersproject/abi': 5.8.0 + '@ethersproject/abstract-provider': 5.8.0 + '@ethersproject/abstract-signer': 5.8.0 + '@nomicfoundation/ethereumjs-evm': 1.3.2 + '@nomicfoundation/ethereumjs-util': 8.0.6 + '@nomicfoundation/ethereumjs-vm': 6.4.2 + '@nomiclabs/hardhat-ethers': 2.2.3(ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)) + diff: 5.2.0 + ethers: 5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + hardhat: 2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10) + lodash.isequal: 4.5.0 + lodash.isequalwith: 4.4.0 + rxjs: 7.8.2 + semver: 7.7.1 + transitivePeerDependencies: + - supports-color + + '@ensdomains/ens@0.4.5': + dependencies: + bluebird: 3.7.2 + eth-ens-namehash: 2.0.8 + solc: 0.4.26 + testrpc: 0.0.1 + web3-utils: 1.10.4 + + '@ensdomains/resolver@0.2.4': {} + + '@envelop/core@3.0.6': + dependencies: + '@envelop/types': 3.0.2 + tslib: 2.8.1 + + '@envelop/extended-validation@2.0.6(@envelop/core@3.0.6)(graphql@16.11.0)': + dependencies: + '@envelop/core': 3.0.6 + '@graphql-tools/utils': 8.13.1(graphql@16.11.0) + graphql: 16.11.0 + tslib: 2.8.1 + + '@envelop/types@3.0.2': + dependencies: + tslib: 2.8.1 + + '@envelop/validation-cache@5.1.3(@envelop/core@3.0.6)(graphql@16.11.0)': + dependencies: + '@envelop/core': 3.0.6 + graphql: 16.11.0 + hash-it: 6.0.0 + lru-cache: 6.0.0 + tslib: 2.8.1 + + '@eslint-community/eslint-utils@4.7.0(eslint@8.57.1)': + dependencies: + eslint: 8.57.1 + eslint-visitor-keys: 3.4.3 + + '@eslint-community/regexpp@4.12.1': {} + + '@eslint/eslintrc@2.1.4': + dependencies: + ajv: 6.12.6 + debug: 4.4.0(supports-color@9.4.0) + espree: 9.6.1 + globals: 13.24.0 + ignore: 5.3.2 + import-fresh: 3.3.1 + js-yaml: 4.1.0 + minimatch: 3.1.2 + strip-json-comments: 3.1.1 + transitivePeerDependencies: + - supports-color + + '@eslint/js@8.57.1': {} + + '@ethereum-waffle/chai@3.4.4(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10)': + dependencies: + '@ethereum-waffle/provider': 3.4.4(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10) + ethers: 5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + transitivePeerDependencies: + - bufferutil + - encoding + - supports-color + - utf-8-validate + + '@ethereum-waffle/compiler@3.4.4(bufferutil@4.0.9)(encoding@0.1.13)(typescript@4.9.5)(utf-8-validate@5.0.10)': + dependencies: + '@resolver-engine/imports': 0.3.3 + '@resolver-engine/imports-fs': 0.3.3 + '@typechain/ethers-v5': 2.0.0(ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(typechain@3.0.0(typescript@4.9.5)) + '@types/mkdirp': 0.5.2 + '@types/node-fetch': 2.6.12 + ethers: 5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + mkdirp: 0.5.6 + node-fetch: 2.7.0(encoding@0.1.13) + solc: 0.6.12 + ts-generator: 0.1.1 + typechain: 3.0.0(typescript@4.9.5) + transitivePeerDependencies: + - bufferutil + - encoding + - supports-color + - typescript + - utf-8-validate + + '@ethereum-waffle/compiler@3.4.4(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.8.3)(utf-8-validate@5.0.10)': + dependencies: + '@resolver-engine/imports': 0.3.3 + '@resolver-engine/imports-fs': 0.3.3 + '@typechain/ethers-v5': 2.0.0(ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(typechain@3.0.0(typescript@5.8.3)) + '@types/mkdirp': 0.5.2 + '@types/node-fetch': 2.6.12 + ethers: 5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + mkdirp: 0.5.6 + node-fetch: 2.7.0(encoding@0.1.13) + solc: 0.6.12 + ts-generator: 0.1.1 + typechain: 3.0.0(typescript@5.8.3) + transitivePeerDependencies: + - bufferutil + - encoding + - supports-color + - typescript + - utf-8-validate + + '@ethereum-waffle/ens@3.4.4(bufferutil@4.0.9)(utf-8-validate@5.0.10)': + dependencies: + '@ensdomains/ens': 0.4.5 + '@ensdomains/resolver': 0.2.4 + ethers: 5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + transitivePeerDependencies: + - bufferutil + - utf-8-validate + + '@ethereum-waffle/mock-contract@3.4.4(bufferutil@4.0.9)(utf-8-validate@5.0.10)': + dependencies: + '@ethersproject/abi': 5.8.0 + ethers: 5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + transitivePeerDependencies: + - bufferutil + - utf-8-validate + + '@ethereum-waffle/provider@3.4.4(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10)': + dependencies: + '@ethereum-waffle/ens': 3.4.4(bufferutil@4.0.9)(utf-8-validate@5.0.10) + ethers: 5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + ganache-core: 2.13.2(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10) + patch-package: 6.5.1 + postinstall-postinstall: 2.1.0 + transitivePeerDependencies: + - bufferutil + - encoding + - supports-color + - utf-8-validate + + '@ethereumjs/common@2.5.0': + dependencies: + crc-32: 1.2.2 + ethereumjs-util: 7.1.5 + + '@ethereumjs/common@2.6.5': + dependencies: + crc-32: 1.2.2 + ethereumjs-util: 7.1.5 + + '@ethereumjs/rlp@4.0.1': {} + + '@ethereumjs/rlp@5.0.2': {} + + '@ethereumjs/tx@3.3.2': + dependencies: + '@ethereumjs/common': 2.5.0 + ethereumjs-util: 7.1.5 + + '@ethereumjs/tx@3.5.2': + dependencies: + '@ethereumjs/common': 2.6.5 + ethereumjs-util: 7.1.5 + + '@ethereumjs/util@8.1.0': + dependencies: + '@ethereumjs/rlp': 4.0.1 + ethereum-cryptography: 2.2.1 + micro-ftch: 0.3.1 + + '@ethereumjs/util@9.1.0': + dependencies: + '@ethereumjs/rlp': 5.0.2 + ethereum-cryptography: 2.2.1 + + '@ethersproject/abi@5.0.0-beta.153': + dependencies: + '@ethersproject/address': 5.8.0 + '@ethersproject/bignumber': 5.8.0 + '@ethersproject/bytes': 5.8.0 + '@ethersproject/constants': 5.8.0 + '@ethersproject/hash': 5.8.0 + '@ethersproject/keccak256': 5.8.0 + '@ethersproject/logger': 5.8.0 + '@ethersproject/properties': 5.8.0 + '@ethersproject/strings': 5.8.0 + optional: true + + '@ethersproject/abi@5.6.0': + dependencies: + '@ethersproject/address': 5.6.0 + '@ethersproject/bignumber': 5.6.0 + '@ethersproject/bytes': 5.8.0 + '@ethersproject/constants': 5.6.0 + '@ethersproject/hash': 5.6.0 + '@ethersproject/keccak256': 5.6.0 + '@ethersproject/logger': 5.6.0 + '@ethersproject/properties': 5.6.0 + '@ethersproject/strings': 5.6.0 + + '@ethersproject/abi@5.7.0': + dependencies: + '@ethersproject/address': 5.7.0 + '@ethersproject/bignumber': 5.7.0 + '@ethersproject/bytes': 5.8.0 + '@ethersproject/constants': 5.7.0 + '@ethersproject/hash': 5.7.0 + '@ethersproject/keccak256': 5.7.0 + '@ethersproject/logger': 5.7.0 + '@ethersproject/properties': 5.7.0 + '@ethersproject/strings': 5.7.0 + + '@ethersproject/abi@5.8.0': + dependencies: + '@ethersproject/address': 5.8.0 + '@ethersproject/bignumber': 5.8.0 + '@ethersproject/bytes': 5.8.0 + '@ethersproject/constants': 5.8.0 + '@ethersproject/hash': 5.8.0 + '@ethersproject/keccak256': 5.8.0 + '@ethersproject/logger': 5.8.0 + '@ethersproject/properties': 5.8.0 + '@ethersproject/strings': 5.8.0 + + '@ethersproject/abstract-provider@5.6.0': + dependencies: + '@ethersproject/bignumber': 5.6.0 + '@ethersproject/bytes': 5.8.0 + '@ethersproject/logger': 5.6.0 + '@ethersproject/networks': 5.6.1 + '@ethersproject/properties': 5.6.0 + '@ethersproject/transactions': 5.6.0 + '@ethersproject/web': 5.6.0 + + '@ethersproject/abstract-provider@5.7.0': + dependencies: + '@ethersproject/bignumber': 5.7.0 + '@ethersproject/bytes': 5.8.0 + '@ethersproject/logger': 5.7.0 + '@ethersproject/networks': 5.7.0 + '@ethersproject/properties': 5.7.0 + '@ethersproject/transactions': 5.7.0 + '@ethersproject/web': 5.7.0 + + '@ethersproject/abstract-provider@5.8.0': + dependencies: + '@ethersproject/bignumber': 5.8.0 + '@ethersproject/bytes': 5.8.0 + '@ethersproject/logger': 5.8.0 + '@ethersproject/networks': 5.8.0 + '@ethersproject/properties': 5.8.0 + '@ethersproject/transactions': 5.8.0 + '@ethersproject/web': 5.8.0 + + '@ethersproject/abstract-signer@5.6.0': + dependencies: + '@ethersproject/abstract-provider': 5.8.0 + '@ethersproject/bignumber': 5.6.0 + '@ethersproject/bytes': 5.8.0 + '@ethersproject/logger': 5.6.0 + '@ethersproject/properties': 5.6.0 + + '@ethersproject/abstract-signer@5.7.0': + dependencies: + '@ethersproject/abstract-provider': 5.8.0 + '@ethersproject/bignumber': 5.7.0 + '@ethersproject/bytes': 5.8.0 + '@ethersproject/logger': 5.7.0 + '@ethersproject/properties': 5.7.0 + + '@ethersproject/abstract-signer@5.8.0': + dependencies: + '@ethersproject/abstract-provider': 5.8.0 + '@ethersproject/bignumber': 5.8.0 + '@ethersproject/bytes': 5.8.0 + '@ethersproject/logger': 5.8.0 + '@ethersproject/properties': 5.8.0 + + '@ethersproject/address@5.6.0': + dependencies: + '@ethersproject/bignumber': 5.6.0 + '@ethersproject/bytes': 5.8.0 + '@ethersproject/keccak256': 5.6.0 + '@ethersproject/logger': 5.6.0 + '@ethersproject/rlp': 5.6.0 + + '@ethersproject/address@5.6.1': + dependencies: + '@ethersproject/bignumber': 5.8.0 + '@ethersproject/bytes': 5.8.0 + '@ethersproject/keccak256': 5.8.0 + '@ethersproject/logger': 5.8.0 + '@ethersproject/rlp': 5.8.0 + + '@ethersproject/address@5.7.0': + dependencies: + '@ethersproject/bignumber': 5.7.0 + '@ethersproject/bytes': 5.8.0 + '@ethersproject/keccak256': 5.7.0 + '@ethersproject/logger': 5.7.0 + '@ethersproject/rlp': 5.7.0 + + '@ethersproject/address@5.8.0': + dependencies: + '@ethersproject/bignumber': 5.8.0 + '@ethersproject/bytes': 5.8.0 + '@ethersproject/keccak256': 5.8.0 + '@ethersproject/logger': 5.8.0 + '@ethersproject/rlp': 5.8.0 + + '@ethersproject/base64@5.6.0': + dependencies: + '@ethersproject/bytes': 5.8.0 + + '@ethersproject/base64@5.7.0': + dependencies: + '@ethersproject/bytes': 5.8.0 + + '@ethersproject/base64@5.8.0': + dependencies: + '@ethersproject/bytes': 5.8.0 + + '@ethersproject/basex@5.6.0': + dependencies: + '@ethersproject/bytes': 5.8.0 + '@ethersproject/properties': 5.6.0 + + '@ethersproject/basex@5.7.0': + dependencies: + '@ethersproject/bytes': 5.8.0 + '@ethersproject/properties': 5.7.0 + + '@ethersproject/basex@5.8.0': + dependencies: + '@ethersproject/bytes': 5.8.0 + '@ethersproject/properties': 5.8.0 + + '@ethersproject/bignumber@5.6.0': + dependencies: + '@ethersproject/bytes': 5.8.0 + '@ethersproject/logger': 5.6.0 + bn.js: 4.12.2 + + '@ethersproject/bignumber@5.7.0': + dependencies: + '@ethersproject/bytes': 5.8.0 + '@ethersproject/logger': 5.7.0 + bn.js: 5.2.2 + + '@ethersproject/bignumber@5.8.0': + dependencies: + '@ethersproject/bytes': 5.8.0 + '@ethersproject/logger': 5.8.0 + bn.js: 5.2.2 + + '@ethersproject/bytes@5.6.1': + dependencies: + '@ethersproject/logger': 5.6.0 + + '@ethersproject/bytes@5.7.0': + dependencies: + '@ethersproject/logger': 5.7.0 + + '@ethersproject/bytes@5.8.0': + dependencies: + '@ethersproject/logger': 5.8.0 + + '@ethersproject/constants@5.6.0': + dependencies: + '@ethersproject/bignumber': 5.6.0 + + '@ethersproject/constants@5.7.0': + dependencies: + '@ethersproject/bignumber': 5.7.0 + + '@ethersproject/constants@5.8.0': + dependencies: + '@ethersproject/bignumber': 5.8.0 + + '@ethersproject/contracts@5.6.0': + dependencies: + '@ethersproject/abi': 5.8.0 + '@ethersproject/abstract-provider': 5.8.0 + '@ethersproject/abstract-signer': 5.6.0 + '@ethersproject/address': 5.6.0 + '@ethersproject/bignumber': 5.6.0 + '@ethersproject/bytes': 5.8.0 + '@ethersproject/constants': 5.6.0 + '@ethersproject/logger': 5.6.0 + '@ethersproject/properties': 5.6.0 + '@ethersproject/transactions': 5.6.0 + + '@ethersproject/contracts@5.7.0': + dependencies: + '@ethersproject/abi': 5.8.0 + '@ethersproject/abstract-provider': 5.8.0 + '@ethersproject/abstract-signer': 5.7.0 + '@ethersproject/address': 5.7.0 + '@ethersproject/bignumber': 5.7.0 + '@ethersproject/bytes': 5.8.0 + '@ethersproject/constants': 5.7.0 + '@ethersproject/logger': 5.7.0 + '@ethersproject/properties': 5.7.0 + '@ethersproject/transactions': 5.7.0 + + '@ethersproject/contracts@5.8.0': + dependencies: + '@ethersproject/abi': 5.8.0 + '@ethersproject/abstract-provider': 5.8.0 + '@ethersproject/abstract-signer': 5.8.0 + '@ethersproject/address': 5.8.0 + '@ethersproject/bignumber': 5.8.0 + '@ethersproject/bytes': 5.8.0 + '@ethersproject/constants': 5.8.0 + '@ethersproject/logger': 5.8.0 + '@ethersproject/properties': 5.8.0 + '@ethersproject/transactions': 5.8.0 + + '@ethersproject/experimental@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)': + dependencies: + '@ethersproject/web': 5.8.0 + ethers: 5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + scrypt-js: 3.0.1 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + + '@ethersproject/hardware-wallets@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)': + dependencies: + '@ledgerhq/hw-app-eth': 5.27.2 + '@ledgerhq/hw-transport': 5.26.0 + '@ledgerhq/hw-transport-u2f': 5.26.0 + ethers: 5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + optionalDependencies: + '@ledgerhq/hw-transport-node-hid': 5.26.0 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + + '@ethersproject/hash@5.6.0': + dependencies: + '@ethersproject/abstract-signer': 5.6.0 + '@ethersproject/address': 5.6.0 + '@ethersproject/bignumber': 5.6.0 + '@ethersproject/bytes': 5.8.0 + '@ethersproject/keccak256': 5.6.0 + '@ethersproject/logger': 5.6.0 + '@ethersproject/properties': 5.6.0 + '@ethersproject/strings': 5.6.0 + + '@ethersproject/hash@5.7.0': + dependencies: + '@ethersproject/abstract-signer': 5.7.0 + '@ethersproject/address': 5.7.0 + '@ethersproject/base64': 5.7.0 + '@ethersproject/bignumber': 5.7.0 + '@ethersproject/bytes': 5.8.0 + '@ethersproject/keccak256': 5.7.0 + '@ethersproject/logger': 5.7.0 + '@ethersproject/properties': 5.7.0 + '@ethersproject/strings': 5.7.0 + + '@ethersproject/hash@5.8.0': + dependencies: + '@ethersproject/abstract-signer': 5.8.0 + '@ethersproject/address': 5.8.0 + '@ethersproject/base64': 5.8.0 + '@ethersproject/bignumber': 5.8.0 + '@ethersproject/bytes': 5.8.0 + '@ethersproject/keccak256': 5.8.0 + '@ethersproject/logger': 5.8.0 + '@ethersproject/properties': 5.8.0 + '@ethersproject/strings': 5.8.0 + + '@ethersproject/hdnode@5.6.0': + dependencies: + '@ethersproject/abstract-signer': 5.6.0 + '@ethersproject/basex': 5.6.0 + '@ethersproject/bignumber': 5.6.0 + '@ethersproject/bytes': 5.8.0 + '@ethersproject/logger': 5.6.0 + '@ethersproject/pbkdf2': 5.6.0 + '@ethersproject/properties': 5.6.0 + '@ethersproject/sha2': 5.6.0 + '@ethersproject/signing-key': 5.6.0 + '@ethersproject/strings': 5.6.0 + '@ethersproject/transactions': 5.6.0 + '@ethersproject/wordlists': 5.6.0 + + '@ethersproject/hdnode@5.7.0': + dependencies: + '@ethersproject/abstract-signer': 5.7.0 + '@ethersproject/basex': 5.7.0 + '@ethersproject/bignumber': 5.7.0 + '@ethersproject/bytes': 5.8.0 + '@ethersproject/logger': 5.7.0 + '@ethersproject/pbkdf2': 5.7.0 + '@ethersproject/properties': 5.7.0 + '@ethersproject/sha2': 5.7.0 + '@ethersproject/signing-key': 5.7.0 + '@ethersproject/strings': 5.7.0 + '@ethersproject/transactions': 5.7.0 + '@ethersproject/wordlists': 5.7.0 + + '@ethersproject/hdnode@5.8.0': + dependencies: + '@ethersproject/abstract-signer': 5.8.0 + '@ethersproject/basex': 5.8.0 + '@ethersproject/bignumber': 5.8.0 + '@ethersproject/bytes': 5.8.0 + '@ethersproject/logger': 5.8.0 + '@ethersproject/pbkdf2': 5.8.0 + '@ethersproject/properties': 5.8.0 + '@ethersproject/sha2': 5.8.0 + '@ethersproject/signing-key': 5.8.0 + '@ethersproject/strings': 5.8.0 + '@ethersproject/transactions': 5.8.0 + '@ethersproject/wordlists': 5.8.0 + + '@ethersproject/json-wallets@5.6.0': + dependencies: + '@ethersproject/abstract-signer': 5.6.0 + '@ethersproject/address': 5.6.0 + '@ethersproject/bytes': 5.8.0 + '@ethersproject/hdnode': 5.6.0 + '@ethersproject/keccak256': 5.6.0 + '@ethersproject/logger': 5.6.0 + '@ethersproject/pbkdf2': 5.6.0 + '@ethersproject/properties': 5.6.0 + '@ethersproject/random': 5.6.0 + '@ethersproject/strings': 5.6.0 + '@ethersproject/transactions': 5.6.0 + aes-js: 3.0.0 + scrypt-js: 3.0.1 + + '@ethersproject/json-wallets@5.7.0': + dependencies: + '@ethersproject/abstract-signer': 5.7.0 + '@ethersproject/address': 5.7.0 + '@ethersproject/bytes': 5.8.0 + '@ethersproject/hdnode': 5.7.0 + '@ethersproject/keccak256': 5.7.0 + '@ethersproject/logger': 5.7.0 + '@ethersproject/pbkdf2': 5.7.0 + '@ethersproject/properties': 5.7.0 + '@ethersproject/random': 5.7.0 + '@ethersproject/strings': 5.7.0 + '@ethersproject/transactions': 5.7.0 + aes-js: 3.0.0 + scrypt-js: 3.0.1 + + '@ethersproject/json-wallets@5.8.0': + dependencies: + '@ethersproject/abstract-signer': 5.8.0 + '@ethersproject/address': 5.8.0 + '@ethersproject/bytes': 5.8.0 + '@ethersproject/hdnode': 5.8.0 + '@ethersproject/keccak256': 5.8.0 + '@ethersproject/logger': 5.8.0 + '@ethersproject/pbkdf2': 5.8.0 + '@ethersproject/properties': 5.8.0 + '@ethersproject/random': 5.8.0 + '@ethersproject/strings': 5.8.0 + '@ethersproject/transactions': 5.8.0 + aes-js: 3.0.0 + scrypt-js: 3.0.1 + + '@ethersproject/keccak256@5.6.0': + dependencies: + '@ethersproject/bytes': 5.8.0 + js-sha3: 0.8.0 + + '@ethersproject/keccak256@5.7.0': + dependencies: + '@ethersproject/bytes': 5.8.0 + js-sha3: 0.8.0 + + '@ethersproject/keccak256@5.8.0': + dependencies: + '@ethersproject/bytes': 5.8.0 + js-sha3: 0.8.0 + + '@ethersproject/logger@5.6.0': {} + + '@ethersproject/logger@5.7.0': {} + + '@ethersproject/logger@5.8.0': {} + + '@ethersproject/networks@5.6.1': + dependencies: + '@ethersproject/logger': 5.6.0 + + '@ethersproject/networks@5.7.0': + dependencies: + '@ethersproject/logger': 5.7.0 + + '@ethersproject/networks@5.8.0': + dependencies: + '@ethersproject/logger': 5.8.0 + + '@ethersproject/pbkdf2@5.6.0': + dependencies: + '@ethersproject/bytes': 5.8.0 + '@ethersproject/sha2': 5.6.0 + + '@ethersproject/pbkdf2@5.7.0': + dependencies: + '@ethersproject/bytes': 5.8.0 + '@ethersproject/sha2': 5.7.0 + + '@ethersproject/pbkdf2@5.8.0': + dependencies: + '@ethersproject/bytes': 5.8.0 + '@ethersproject/sha2': 5.8.0 + + '@ethersproject/properties@5.6.0': + dependencies: + '@ethersproject/logger': 5.6.0 + + '@ethersproject/properties@5.7.0': + dependencies: + '@ethersproject/logger': 5.7.0 + + '@ethersproject/properties@5.8.0': + dependencies: + '@ethersproject/logger': 5.8.0 + + '@ethersproject/providers@5.6.2(bufferutil@4.0.9)(utf-8-validate@5.0.10)': + dependencies: + '@ethersproject/abstract-provider': 5.8.0 + '@ethersproject/abstract-signer': 5.6.0 + '@ethersproject/address': 5.6.0 + '@ethersproject/basex': 5.6.0 + '@ethersproject/bignumber': 5.6.0 + '@ethersproject/bytes': 5.8.0 + '@ethersproject/constants': 5.6.0 + '@ethersproject/hash': 5.6.0 + '@ethersproject/logger': 5.6.0 + '@ethersproject/networks': 5.6.1 + '@ethersproject/properties': 5.6.0 + '@ethersproject/random': 5.6.0 + '@ethersproject/rlp': 5.6.0 + '@ethersproject/sha2': 5.6.0 + '@ethersproject/strings': 5.6.0 + '@ethersproject/transactions': 5.6.0 + '@ethersproject/web': 5.6.0 + bech32: 1.1.4 + ws: 7.4.6(bufferutil@4.0.9)(utf-8-validate@5.0.10) + transitivePeerDependencies: + - bufferutil + - utf-8-validate + + '@ethersproject/providers@5.7.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)': + dependencies: + '@ethersproject/abstract-provider': 5.8.0 + '@ethersproject/abstract-signer': 5.7.0 + '@ethersproject/address': 5.7.0 + '@ethersproject/base64': 5.7.0 + '@ethersproject/basex': 5.7.0 + '@ethersproject/bignumber': 5.7.0 + '@ethersproject/bytes': 5.8.0 + '@ethersproject/constants': 5.7.0 + '@ethersproject/hash': 5.7.0 + '@ethersproject/logger': 5.7.0 + '@ethersproject/networks': 5.7.0 + '@ethersproject/properties': 5.7.0 + '@ethersproject/random': 5.7.0 + '@ethersproject/rlp': 5.7.0 + '@ethersproject/sha2': 5.7.0 + '@ethersproject/strings': 5.7.0 + '@ethersproject/transactions': 5.7.0 + '@ethersproject/web': 5.7.0 + bech32: 1.1.4 + ws: 7.4.6(bufferutil@4.0.9)(utf-8-validate@5.0.10) + transitivePeerDependencies: + - bufferutil + - utf-8-validate + + '@ethersproject/providers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)': + dependencies: + '@ethersproject/abstract-provider': 5.8.0 + '@ethersproject/abstract-signer': 5.8.0 + '@ethersproject/address': 5.8.0 + '@ethersproject/base64': 5.8.0 + '@ethersproject/basex': 5.8.0 + '@ethersproject/bignumber': 5.8.0 + '@ethersproject/bytes': 5.8.0 + '@ethersproject/constants': 5.8.0 + '@ethersproject/hash': 5.8.0 + '@ethersproject/logger': 5.8.0 + '@ethersproject/networks': 5.8.0 + '@ethersproject/properties': 5.8.0 + '@ethersproject/random': 5.8.0 + '@ethersproject/rlp': 5.8.0 + '@ethersproject/sha2': 5.8.0 + '@ethersproject/strings': 5.8.0 + '@ethersproject/transactions': 5.8.0 + '@ethersproject/web': 5.8.0 + bech32: 1.1.4 + ws: 8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + transitivePeerDependencies: + - bufferutil + - utf-8-validate + + '@ethersproject/random@5.6.0': + dependencies: + '@ethersproject/bytes': 5.8.0 + '@ethersproject/logger': 5.6.0 + + '@ethersproject/random@5.7.0': + dependencies: + '@ethersproject/bytes': 5.8.0 + '@ethersproject/logger': 5.7.0 + + '@ethersproject/random@5.8.0': + dependencies: + '@ethersproject/bytes': 5.8.0 + '@ethersproject/logger': 5.8.0 + + '@ethersproject/rlp@5.6.0': + dependencies: + '@ethersproject/bytes': 5.8.0 + '@ethersproject/logger': 5.6.0 + + '@ethersproject/rlp@5.7.0': + dependencies: + '@ethersproject/bytes': 5.8.0 + '@ethersproject/logger': 5.7.0 + + '@ethersproject/rlp@5.8.0': + dependencies: + '@ethersproject/bytes': 5.8.0 + '@ethersproject/logger': 5.8.0 + + '@ethersproject/sha2@5.6.0': + dependencies: + '@ethersproject/bytes': 5.8.0 + '@ethersproject/logger': 5.6.0 + hash.js: 1.1.7 + + '@ethersproject/sha2@5.7.0': + dependencies: + '@ethersproject/bytes': 5.8.0 + '@ethersproject/logger': 5.7.0 + hash.js: 1.1.7 + + '@ethersproject/sha2@5.8.0': + dependencies: + '@ethersproject/bytes': 5.8.0 + '@ethersproject/logger': 5.8.0 + hash.js: 1.1.7 + + '@ethersproject/signing-key@5.6.0': + dependencies: + '@ethersproject/bytes': 5.8.0 + '@ethersproject/logger': 5.6.0 + '@ethersproject/properties': 5.6.0 + bn.js: 4.12.2 + elliptic: 6.5.4 + hash.js: 1.1.7 + + '@ethersproject/signing-key@5.7.0': + dependencies: + '@ethersproject/bytes': 5.8.0 + '@ethersproject/logger': 5.7.0 + '@ethersproject/properties': 5.7.0 + bn.js: 5.2.2 + elliptic: 6.5.4 + hash.js: 1.1.7 + + '@ethersproject/signing-key@5.8.0': + dependencies: + '@ethersproject/bytes': 5.8.0 + '@ethersproject/logger': 5.8.0 + '@ethersproject/properties': 5.8.0 + bn.js: 5.2.2 + elliptic: 6.6.1 + hash.js: 1.1.7 + + '@ethersproject/solidity@5.6.0': + dependencies: + '@ethersproject/bignumber': 5.6.0 + '@ethersproject/bytes': 5.8.0 + '@ethersproject/keccak256': 5.6.0 + '@ethersproject/logger': 5.6.0 + '@ethersproject/sha2': 5.6.0 + '@ethersproject/strings': 5.6.0 + + '@ethersproject/solidity@5.7.0': + dependencies: + '@ethersproject/bignumber': 5.7.0 + '@ethersproject/bytes': 5.8.0 + '@ethersproject/keccak256': 5.7.0 + '@ethersproject/logger': 5.7.0 + '@ethersproject/sha2': 5.7.0 + '@ethersproject/strings': 5.7.0 + + '@ethersproject/solidity@5.8.0': + dependencies: + '@ethersproject/bignumber': 5.8.0 + '@ethersproject/bytes': 5.8.0 + '@ethersproject/keccak256': 5.8.0 + '@ethersproject/logger': 5.8.0 + '@ethersproject/sha2': 5.8.0 + '@ethersproject/strings': 5.8.0 + + '@ethersproject/strings@5.6.0': + dependencies: + '@ethersproject/bytes': 5.8.0 + '@ethersproject/constants': 5.6.0 + '@ethersproject/logger': 5.6.0 + + '@ethersproject/strings@5.7.0': + dependencies: + '@ethersproject/bytes': 5.8.0 + '@ethersproject/constants': 5.7.0 + '@ethersproject/logger': 5.7.0 + + '@ethersproject/strings@5.8.0': + dependencies: + '@ethersproject/bytes': 5.8.0 + '@ethersproject/constants': 5.8.0 + '@ethersproject/logger': 5.8.0 + + '@ethersproject/transactions@5.6.0': + dependencies: + '@ethersproject/address': 5.6.0 + '@ethersproject/bignumber': 5.6.0 + '@ethersproject/bytes': 5.8.0 + '@ethersproject/constants': 5.6.0 + '@ethersproject/keccak256': 5.6.0 + '@ethersproject/logger': 5.6.0 + '@ethersproject/properties': 5.6.0 + '@ethersproject/rlp': 5.6.0 + '@ethersproject/signing-key': 5.6.0 + + '@ethersproject/transactions@5.7.0': + dependencies: + '@ethersproject/address': 5.7.0 + '@ethersproject/bignumber': 5.7.0 + '@ethersproject/bytes': 5.8.0 + '@ethersproject/constants': 5.7.0 + '@ethersproject/keccak256': 5.7.0 + '@ethersproject/logger': 5.7.0 + '@ethersproject/properties': 5.7.0 + '@ethersproject/rlp': 5.7.0 + '@ethersproject/signing-key': 5.7.0 + + '@ethersproject/transactions@5.8.0': + dependencies: + '@ethersproject/address': 5.8.0 + '@ethersproject/bignumber': 5.8.0 + '@ethersproject/bytes': 5.8.0 + '@ethersproject/constants': 5.8.0 + '@ethersproject/keccak256': 5.8.0 + '@ethersproject/logger': 5.8.0 + '@ethersproject/properties': 5.8.0 + '@ethersproject/rlp': 5.8.0 + '@ethersproject/signing-key': 5.8.0 + + '@ethersproject/units@5.6.0': + dependencies: + '@ethersproject/bignumber': 5.6.0 + '@ethersproject/constants': 5.6.0 + '@ethersproject/logger': 5.6.0 + + '@ethersproject/units@5.7.0': + dependencies: + '@ethersproject/bignumber': 5.7.0 + '@ethersproject/constants': 5.7.0 + '@ethersproject/logger': 5.7.0 + + '@ethersproject/units@5.8.0': + dependencies: + '@ethersproject/bignumber': 5.8.0 + '@ethersproject/constants': 5.8.0 + '@ethersproject/logger': 5.8.0 + + '@ethersproject/wallet@5.6.0': + dependencies: + '@ethersproject/abstract-provider': 5.8.0 + '@ethersproject/abstract-signer': 5.6.0 + '@ethersproject/address': 5.6.0 + '@ethersproject/bignumber': 5.6.0 + '@ethersproject/bytes': 5.8.0 + '@ethersproject/hash': 5.6.0 + '@ethersproject/hdnode': 5.6.0 + '@ethersproject/json-wallets': 5.6.0 + '@ethersproject/keccak256': 5.6.0 + '@ethersproject/logger': 5.6.0 + '@ethersproject/properties': 5.6.0 + '@ethersproject/random': 5.6.0 + '@ethersproject/signing-key': 5.6.0 + '@ethersproject/transactions': 5.6.0 + '@ethersproject/wordlists': 5.6.0 + + '@ethersproject/wallet@5.7.0': + dependencies: + '@ethersproject/abstract-provider': 5.8.0 + '@ethersproject/abstract-signer': 5.7.0 + '@ethersproject/address': 5.7.0 + '@ethersproject/bignumber': 5.7.0 + '@ethersproject/bytes': 5.8.0 + '@ethersproject/hash': 5.7.0 + '@ethersproject/hdnode': 5.7.0 + '@ethersproject/json-wallets': 5.7.0 + '@ethersproject/keccak256': 5.7.0 + '@ethersproject/logger': 5.7.0 + '@ethersproject/properties': 5.7.0 + '@ethersproject/random': 5.7.0 + '@ethersproject/signing-key': 5.7.0 + '@ethersproject/transactions': 5.7.0 + '@ethersproject/wordlists': 5.7.0 + + '@ethersproject/wallet@5.8.0': + dependencies: + '@ethersproject/abstract-provider': 5.8.0 + '@ethersproject/abstract-signer': 5.8.0 + '@ethersproject/address': 5.8.0 + '@ethersproject/bignumber': 5.8.0 + '@ethersproject/bytes': 5.8.0 + '@ethersproject/hash': 5.8.0 + '@ethersproject/hdnode': 5.8.0 + '@ethersproject/json-wallets': 5.8.0 + '@ethersproject/keccak256': 5.8.0 + '@ethersproject/logger': 5.8.0 + '@ethersproject/properties': 5.8.0 + '@ethersproject/random': 5.8.0 + '@ethersproject/signing-key': 5.8.0 + '@ethersproject/transactions': 5.8.0 + '@ethersproject/wordlists': 5.8.0 + + '@ethersproject/web@5.6.0': + dependencies: + '@ethersproject/base64': 5.6.0 + '@ethersproject/bytes': 5.8.0 + '@ethersproject/logger': 5.6.0 + '@ethersproject/properties': 5.6.0 + '@ethersproject/strings': 5.6.0 + + '@ethersproject/web@5.7.0': + dependencies: + '@ethersproject/base64': 5.7.0 + '@ethersproject/bytes': 5.8.0 + '@ethersproject/logger': 5.7.0 + '@ethersproject/properties': 5.7.0 + '@ethersproject/strings': 5.7.0 + + '@ethersproject/web@5.8.0': + dependencies: + '@ethersproject/base64': 5.8.0 + '@ethersproject/bytes': 5.8.0 + '@ethersproject/logger': 5.8.0 + '@ethersproject/properties': 5.8.0 + '@ethersproject/strings': 5.8.0 + + '@ethersproject/wordlists@5.6.0': + dependencies: + '@ethersproject/bytes': 5.8.0 + '@ethersproject/hash': 5.6.0 + '@ethersproject/logger': 5.6.0 + '@ethersproject/properties': 5.6.0 + '@ethersproject/strings': 5.6.0 + + '@ethersproject/wordlists@5.7.0': + dependencies: + '@ethersproject/bytes': 5.8.0 + '@ethersproject/hash': 5.7.0 + '@ethersproject/logger': 5.7.0 + '@ethersproject/properties': 5.7.0 + '@ethersproject/strings': 5.7.0 + + '@ethersproject/wordlists@5.8.0': + dependencies: + '@ethersproject/bytes': 5.8.0 + '@ethersproject/hash': 5.8.0 + '@ethersproject/logger': 5.8.0 + '@ethersproject/properties': 5.8.0 + '@ethersproject/strings': 5.8.0 + + '@fastify/busboy@2.1.1': {} + + '@fastify/deepmerge@1.3.0': {} + + '@graphprotocol/client-add-source-name@1.0.20(@graphql-mesh/types@0.93.2(@graphql-mesh/store@0.93.1)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1))(@graphql-tools/delegate@9.0.35(graphql@16.11.0))(@graphql-tools/utils@9.2.1(graphql@16.11.0))(@graphql-tools/wrap@9.4.2(graphql@16.11.0))(graphql@16.11.0)': + dependencies: + '@graphql-mesh/types': 0.93.2(@graphql-mesh/store@0.93.1)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1) + '@graphql-tools/delegate': 9.0.35(graphql@16.11.0) + '@graphql-tools/utils': 9.2.1(graphql@16.11.0) + '@graphql-tools/wrap': 9.4.2(graphql@16.11.0) + graphql: 16.11.0 + lodash: 4.17.21 + tslib: 2.8.1 + + '@graphprotocol/client-auto-pagination@1.1.18(@graphql-mesh/types@0.93.2(@graphql-mesh/store@0.93.1)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1))(@graphql-tools/delegate@9.0.35(graphql@16.11.0))(@graphql-tools/utils@9.2.1(graphql@16.11.0))(@graphql-tools/wrap@9.4.2(graphql@16.11.0))(graphql@16.11.0)': + dependencies: + '@graphql-mesh/types': 0.93.2(@graphql-mesh/store@0.93.1)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1) + '@graphql-tools/delegate': 9.0.35(graphql@16.11.0) + '@graphql-tools/utils': 9.2.1(graphql@16.11.0) + '@graphql-tools/wrap': 9.4.2(graphql@16.11.0) + graphql: 16.11.0 + lodash: 4.17.21 + tslib: 2.8.1 + + '@graphprotocol/client-auto-type-merging@1.0.25(@graphql-mesh/types@0.93.2(@graphql-mesh/store@0.93.1)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1))(@graphql-mesh/utils@0.93.2(@graphql-mesh/cross-helpers@0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)))(@graphql-mesh/types@0.93.2)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1))(@graphql-tools/delegate@9.0.35(graphql@16.11.0))(graphql@16.11.0)': + dependencies: + '@graphql-mesh/transform-type-merging': 0.93.1(@graphql-mesh/types@0.93.2(@graphql-mesh/store@0.93.1)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1))(@graphql-mesh/utils@0.93.2(@graphql-mesh/cross-helpers@0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)))(@graphql-mesh/types@0.93.2)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1))(graphql@16.11.0)(tslib@2.8.1) + '@graphql-mesh/types': 0.93.2(@graphql-mesh/store@0.93.1)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1) + '@graphql-tools/delegate': 9.0.35(graphql@16.11.0) + graphql: 16.11.0 + tslib: 2.8.1 + transitivePeerDependencies: + - '@graphql-mesh/utils' + + '@graphprotocol/client-block-tracking@1.0.14(@graphql-tools/delegate@9.0.35(graphql@16.11.0))(graphql@16.11.0)': + dependencies: + '@graphql-tools/delegate': 9.0.35(graphql@16.11.0) + '@graphql-tools/utils': 9.2.1(graphql@16.11.0) + graphql: 16.11.0 + tslib: 2.8.1 + + ? '@graphprotocol/client-cli@2.2.22(@babel/core@7.27.1)(@envelop/core@3.0.6)(@graphql-mesh/cross-helpers@0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)))(@graphql-mesh/store@0.93.1(@graphql-mesh/cross-helpers@0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)))(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.93.2)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1))(@graphql-mesh/types@0.93.2(@graphql-mesh/store@0.93.1)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1))(@graphql-mesh/utils@0.93.2(@graphql-mesh/cross-helpers@0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)))(@graphql-mesh/types@0.93.2)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1))(@graphql-tools/delegate@9.0.35(graphql@16.11.0))(@graphql-tools/merge@8.4.2(graphql@16.11.0))(@graphql-tools/utils@9.2.1(graphql@16.11.0))(@graphql-tools/wrap@9.4.2(graphql@16.11.0))(@types/node@20.17.32)(bufferutil@4.0.9)(encoding@0.1.13)(graphql-tag@2.12.6(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10))(utf-8-validate@5.0.10)' + : dependencies: + '@graphprotocol/client-add-source-name': 1.0.20(@graphql-mesh/types@0.93.2(@graphql-mesh/store@0.93.1)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1))(@graphql-tools/delegate@9.0.35(graphql@16.11.0))(@graphql-tools/utils@9.2.1(graphql@16.11.0))(@graphql-tools/wrap@9.4.2(graphql@16.11.0))(graphql@16.11.0) + '@graphprotocol/client-auto-pagination': 1.1.18(@graphql-mesh/types@0.93.2(@graphql-mesh/store@0.93.1)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1))(@graphql-tools/delegate@9.0.35(graphql@16.11.0))(@graphql-tools/utils@9.2.1(graphql@16.11.0))(@graphql-tools/wrap@9.4.2(graphql@16.11.0))(graphql@16.11.0) + '@graphprotocol/client-auto-type-merging': 1.0.25(@graphql-mesh/types@0.93.2(@graphql-mesh/store@0.93.1)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1))(@graphql-mesh/utils@0.93.2(@graphql-mesh/cross-helpers@0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)))(@graphql-mesh/types@0.93.2)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1))(@graphql-tools/delegate@9.0.35(graphql@16.11.0))(graphql@16.11.0) + '@graphprotocol/client-block-tracking': 1.0.14(@graphql-tools/delegate@9.0.35(graphql@16.11.0))(graphql@16.11.0) + '@graphprotocol/client-polling-live': 1.1.1(@envelop/core@3.0.6)(@graphql-tools/merge@8.4.2(graphql@16.11.0))(graphql@16.11.0) + '@graphql-mesh/cli': 0.82.35(@babel/core@7.27.1)(@types/node@20.17.32)(bufferutil@4.0.9)(encoding@0.1.13)(graphql-tag@2.12.6(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10))(utf-8-validate@5.0.10) + '@graphql-mesh/graphql': 0.93.1(@graphql-mesh/cross-helpers@0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)))(@graphql-mesh/store@0.93.1(@graphql-mesh/cross-helpers@0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)))(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.93.2)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1))(@graphql-mesh/types@0.93.2(@graphql-mesh/store@0.93.1)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1))(@graphql-mesh/utils@0.93.2(@graphql-mesh/cross-helpers@0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)))(@graphql-mesh/types@0.93.2)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1))(@graphql-tools/utils@9.2.1(graphql@16.11.0))(@types/node@20.17.32)(bufferutil@4.0.9)(encoding@0.1.13)(graphql@16.11.0)(tslib@2.8.1)(utf-8-validate@5.0.10) + graphql: 16.11.0 + tslib: 2.8.1 + transitivePeerDependencies: + - '@babel/core' + - '@envelop/core' + - '@graphql-mesh/cross-helpers' + - '@graphql-mesh/store' + - '@graphql-mesh/types' + - '@graphql-mesh/utils' + - '@graphql-tools/delegate' + - '@graphql-tools/merge' + - '@graphql-tools/utils' + - '@graphql-tools/wrap' + - '@swc/core' + - '@swc/wasm' + - '@types/node' + - bufferutil + - encoding + - graphql-tag + - react-native + - react-native-windows + - supports-color + - utf-8-validate + + '@graphprotocol/client-polling-live@1.1.1(@envelop/core@3.0.6)(@graphql-tools/merge@8.4.2(graphql@16.11.0))(graphql@16.11.0)': + dependencies: + '@envelop/core': 3.0.6 + '@graphql-tools/merge': 8.4.2(graphql@16.11.0) + '@repeaterjs/repeater': 3.0.6 + graphql: 16.11.0 + tslib: 2.8.1 + + '@graphprotocol/common-ts@1.8.7(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10)': + dependencies: + '@graphprotocol/contracts': 2.1.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + '@graphprotocol/pino-sentry-simple': 0.7.1 + '@urql/core': 2.4.4(graphql@16.3.0) + '@urql/exchange-execute': 1.2.2(graphql@16.3.0) + body-parser: 1.19.1 + bs58: 4.0.1 + cors: 2.8.5 + cross-fetch: 3.1.5(encoding@0.1.13) + ethers: 5.6.2(bufferutil@4.0.9)(utf-8-validate@5.0.10) + express: 4.17.3 + graphql: 16.3.0 + graphql-tag: 2.12.6(graphql@16.3.0) + helmet: 5.0.2 + morgan: 1.10.0 + ngeohash: 0.6.3 + pg: 8.7.3 + pg-hstore: 2.3.4 + pino: 7.6.0 + pino-multi-stream: 6.0.0 + prom-client: 14.0.1 + sequelize: 6.19.0(pg-hstore@2.3.4)(pg@8.7.3) + transitivePeerDependencies: + - bufferutil + - encoding + - ibm_db + - mariadb + - mysql2 + - pg-native + - snowflake-sdk + - sqlite3 + - supports-color + - tedious + - utf-8-validate + + '@graphprotocol/common-ts@2.0.11(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10)': + dependencies: + '@graphprotocol/contracts': 5.3.3(bufferutil@4.0.9)(utf-8-validate@5.0.10) + '@graphprotocol/pino-sentry-simple': 0.7.1 + '@urql/core': 3.1.0(graphql@16.8.0) + '@urql/exchange-execute': 2.1.0(graphql@16.8.0) + body-parser: 1.20.2 + bs58: 5.0.0 + cors: 2.8.5 + cross-fetch: 4.0.0(encoding@0.1.13) + ethers: 5.7.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + express: 4.18.2 + graphql: 16.8.0 + graphql-tag: 2.12.6(graphql@16.8.0) + helmet: 7.0.0 + morgan: 1.10.0 + ngeohash: 0.6.3 + pg: 8.11.3 + pg-hstore: 2.3.4 + pino: 7.6.0 + pino-multi-stream: 6.0.0 + prom-client: 14.2.0 + sequelize: 6.33.0(pg-hstore@2.3.4)(pg@8.11.3) + transitivePeerDependencies: + - bufferutil + - encoding + - ibm_db + - mariadb + - mysql2 + - oracledb + - pg-native + - snowflake-sdk + - sqlite3 + - supports-color + - tedious + - utf-8-validate + + '@graphprotocol/contracts@2.1.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)': + dependencies: + console-table-printer: 2.12.1 + ethers: 5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + transitivePeerDependencies: + - bufferutil + - utf-8-validate + + '@graphprotocol/contracts@5.3.3(bufferutil@4.0.9)(utf-8-validate@5.0.10)': + dependencies: + console-table-printer: 2.12.1 + ethers: 5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + transitivePeerDependencies: + - bufferutil + - utf-8-validate + + '@graphprotocol/pino-sentry-simple@0.7.1': + dependencies: + '@sentry/node': 5.30.0 + pumpify: 2.0.1 + split2: 3.2.2 + through2: 3.0.2 + transitivePeerDependencies: + - supports-color + + '@graphprotocol/sdk@0.5.4(bufferutil@4.0.9)(encoding@0.1.13)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)': + dependencies: + '@arbitrum/sdk': 3.1.13(bufferutil@4.0.9)(utf-8-validate@5.0.10) + '@ethersproject/experimental': 5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + '@graphprotocol/common-ts': 2.0.11(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10) + '@nomicfoundation/hardhat-network-helpers': 1.0.12(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)) + '@nomiclabs/hardhat-ethers': 2.2.3(ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)) + debug: 4.4.0(supports-color@9.4.0) + ethers: 5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + hardhat: 2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10) + hardhat-secure-accounts: 0.0.6(@nomiclabs/hardhat-ethers@2.2.3(ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)))(ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)) + inquirer: 8.0.0 + lodash: 4.17.21 + yaml: 1.10.2 + transitivePeerDependencies: + - bufferutil + - encoding + - ibm_db + - mariadb + - mysql2 + - oracledb + - pg-native + - snowflake-sdk + - sqlite3 + - supports-color + - tedious + - ts-node + - typescript + - utf-8-validate + + '@graphql-codegen/core@3.1.0(graphql@16.11.0)': + dependencies: + '@graphql-codegen/plugin-helpers': 4.2.0(graphql@16.11.0) + '@graphql-tools/schema': 9.0.19(graphql@16.11.0) + '@graphql-tools/utils': 9.2.1(graphql@16.11.0) + graphql: 16.11.0 + tslib: 2.5.3 + + '@graphql-codegen/plugin-helpers@2.7.2(graphql@16.11.0)': + dependencies: + '@graphql-tools/utils': 8.13.1(graphql@16.11.0) + change-case-all: 1.0.14 + common-tags: 1.8.2 + graphql: 16.11.0 + import-from: 4.0.0 + lodash: 4.17.21 + tslib: 2.4.1 + + '@graphql-codegen/plugin-helpers@3.1.2(graphql@16.11.0)': + dependencies: + '@graphql-tools/utils': 9.2.1(graphql@16.11.0) + change-case-all: 1.0.15 + common-tags: 1.8.2 + graphql: 16.11.0 + import-from: 4.0.0 + lodash: 4.17.21 + tslib: 2.4.1 + + '@graphql-codegen/plugin-helpers@4.2.0(graphql@16.11.0)': + dependencies: + '@graphql-tools/utils': 9.2.1(graphql@16.11.0) + change-case-all: 1.0.15 + common-tags: 1.8.2 + graphql: 16.11.0 + import-from: 4.0.0 + lodash: 4.17.21 + tslib: 2.5.3 + + '@graphql-codegen/schema-ast@3.0.1(graphql@16.11.0)': + dependencies: + '@graphql-codegen/plugin-helpers': 4.2.0(graphql@16.11.0) + '@graphql-tools/utils': 9.2.1(graphql@16.11.0) + graphql: 16.11.0 + tslib: 2.5.3 + + '@graphql-codegen/typed-document-node@4.0.1(encoding@0.1.13)(graphql@16.11.0)': + dependencies: + '@graphql-codegen/plugin-helpers': 4.2.0(graphql@16.11.0) + '@graphql-codegen/visitor-plugin-common': 3.1.1(encoding@0.1.13)(graphql@16.11.0) + auto-bind: 4.0.0 + change-case-all: 1.0.15 + graphql: 16.11.0 + tslib: 2.5.3 + transitivePeerDependencies: + - encoding + - supports-color + + '@graphql-codegen/typescript-generic-sdk@3.1.0(encoding@0.1.13)(graphql-tag@2.12.6(graphql@16.11.0))(graphql@16.11.0)': + dependencies: + '@graphql-codegen/plugin-helpers': 3.1.2(graphql@16.11.0) + '@graphql-codegen/visitor-plugin-common': 2.13.1(encoding@0.1.13)(graphql@16.11.0) + auto-bind: 4.0.0 + graphql: 16.11.0 + graphql-tag: 2.12.6(graphql@16.11.0) + tslib: 2.4.1 + transitivePeerDependencies: + - encoding + - supports-color + + '@graphql-codegen/typescript-operations@3.0.4(encoding@0.1.13)(graphql@16.11.0)': + dependencies: + '@graphql-codegen/plugin-helpers': 4.2.0(graphql@16.11.0) + '@graphql-codegen/typescript': 3.0.4(encoding@0.1.13)(graphql@16.11.0) + '@graphql-codegen/visitor-plugin-common': 3.1.1(encoding@0.1.13)(graphql@16.11.0) + auto-bind: 4.0.0 + graphql: 16.11.0 + tslib: 2.5.3 + transitivePeerDependencies: + - encoding + - supports-color + + '@graphql-codegen/typescript-resolvers@3.2.1(encoding@0.1.13)(graphql@16.11.0)': + dependencies: + '@graphql-codegen/plugin-helpers': 4.2.0(graphql@16.11.0) + '@graphql-codegen/typescript': 3.0.4(encoding@0.1.13)(graphql@16.11.0) + '@graphql-codegen/visitor-plugin-common': 3.1.1(encoding@0.1.13)(graphql@16.11.0) + '@graphql-tools/utils': 9.2.1(graphql@16.11.0) + auto-bind: 4.0.0 + graphql: 16.11.0 + tslib: 2.5.3 + transitivePeerDependencies: + - encoding + - supports-color + + '@graphql-codegen/typescript@3.0.4(encoding@0.1.13)(graphql@16.11.0)': + dependencies: + '@graphql-codegen/plugin-helpers': 4.2.0(graphql@16.11.0) + '@graphql-codegen/schema-ast': 3.0.1(graphql@16.11.0) + '@graphql-codegen/visitor-plugin-common': 3.1.1(encoding@0.1.13)(graphql@16.11.0) + auto-bind: 4.0.0 + graphql: 16.11.0 + tslib: 2.5.3 + transitivePeerDependencies: + - encoding + - supports-color + + '@graphql-codegen/visitor-plugin-common@2.13.1(encoding@0.1.13)(graphql@16.11.0)': + dependencies: + '@graphql-codegen/plugin-helpers': 2.7.2(graphql@16.11.0) + '@graphql-tools/optimize': 1.4.0(graphql@16.11.0) + '@graphql-tools/relay-operation-optimizer': 6.5.18(encoding@0.1.13)(graphql@16.11.0) + '@graphql-tools/utils': 8.13.1(graphql@16.11.0) + auto-bind: 4.0.0 + change-case-all: 1.0.14 + dependency-graph: 0.11.0 + graphql: 16.11.0 + graphql-tag: 2.12.6(graphql@16.11.0) + parse-filepath: 1.0.2 + tslib: 2.4.1 + transitivePeerDependencies: + - encoding + - supports-color + + '@graphql-codegen/visitor-plugin-common@3.1.1(encoding@0.1.13)(graphql@16.11.0)': + dependencies: + '@graphql-codegen/plugin-helpers': 4.2.0(graphql@16.11.0) + '@graphql-tools/optimize': 1.4.0(graphql@16.11.0) + '@graphql-tools/relay-operation-optimizer': 6.5.18(encoding@0.1.13)(graphql@16.11.0) + '@graphql-tools/utils': 9.2.1(graphql@16.11.0) + auto-bind: 4.0.0 + change-case-all: 1.0.15 + dependency-graph: 0.11.0 + graphql: 16.11.0 + graphql-tag: 2.12.6(graphql@16.11.0) + parse-filepath: 1.0.2 + tslib: 2.5.3 + transitivePeerDependencies: + - encoding + - supports-color + + '@graphql-inspector/core@3.3.0(graphql@16.11.0)': + dependencies: + dependency-graph: 0.11.0 + graphql: 16.11.0 + object-inspect: 1.10.3 + tslib: 2.8.1 + + '@graphql-mesh/cache-localforage@0.93.1(@graphql-mesh/types@0.93.2(@graphql-mesh/store@0.93.1)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1))(@graphql-mesh/utils@0.93.2(@graphql-mesh/cross-helpers@0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)))(@graphql-mesh/types@0.93.2)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1))(graphql@16.11.0)(tslib@2.8.1)': + dependencies: + '@graphql-mesh/types': 0.93.2(@graphql-mesh/store@0.93.1)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1) + '@graphql-mesh/utils': 0.93.2(@graphql-mesh/cross-helpers@0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)))(@graphql-mesh/types@0.93.2)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1) + graphql: 16.11.0 + localforage: 1.10.0 + tslib: 2.8.1 + + '@graphql-mesh/cli@0.82.35(@babel/core@7.27.1)(@types/node@20.17.32)(bufferutil@4.0.9)(encoding@0.1.13)(graphql-tag@2.12.6(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10))(utf-8-validate@5.0.10)': + dependencies: + '@graphql-codegen/core': 3.1.0(graphql@16.11.0) + '@graphql-codegen/typed-document-node': 4.0.1(encoding@0.1.13)(graphql@16.11.0) + '@graphql-codegen/typescript': 3.0.4(encoding@0.1.13)(graphql@16.11.0) + '@graphql-codegen/typescript-generic-sdk': 3.1.0(encoding@0.1.13)(graphql-tag@2.12.6(graphql@16.11.0))(graphql@16.11.0) + '@graphql-codegen/typescript-operations': 3.0.4(encoding@0.1.13)(graphql@16.11.0) + '@graphql-codegen/typescript-resolvers': 3.2.1(encoding@0.1.13)(graphql@16.11.0) + '@graphql-mesh/config': 0.93.1(@babel/core@7.27.1)(@graphql-mesh/cross-helpers@0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)))(@graphql-mesh/runtime@0.93.2(@graphql-mesh/cross-helpers@0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)))(@graphql-mesh/types@0.93.2(@graphql-mesh/store@0.93.1)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1))(@graphql-mesh/utils@0.93.2(@graphql-mesh/cross-helpers@0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)))(@graphql-mesh/types@0.93.2)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1))(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1))(@graphql-mesh/store@0.93.1(@graphql-mesh/cross-helpers@0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)))(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.93.2)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1))(@graphql-mesh/types@0.93.2(@graphql-mesh/store@0.93.1)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1))(@graphql-mesh/utils@0.93.2(@graphql-mesh/cross-helpers@0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)))(@graphql-mesh/types@0.93.2)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1))(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1) + '@graphql-mesh/cross-helpers': 0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)) + '@graphql-mesh/http': 0.93.2(@graphql-mesh/cross-helpers@0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)))(@graphql-mesh/runtime@0.93.2(@graphql-mesh/cross-helpers@0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)))(@graphql-mesh/types@0.93.2(@graphql-mesh/store@0.93.1)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1))(@graphql-mesh/utils@0.93.2(@graphql-mesh/cross-helpers@0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)))(@graphql-mesh/types@0.93.2)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1))(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1))(@graphql-mesh/types@0.93.2(@graphql-mesh/store@0.93.1)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1))(@graphql-mesh/utils@0.93.2(@graphql-mesh/cross-helpers@0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)))(@graphql-mesh/types@0.93.2)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1))(graphql@16.11.0)(tslib@2.8.1) + '@graphql-mesh/runtime': 0.93.2(@graphql-mesh/cross-helpers@0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)))(@graphql-mesh/types@0.93.2(@graphql-mesh/store@0.93.1)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1))(@graphql-mesh/utils@0.93.2(@graphql-mesh/cross-helpers@0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)))(@graphql-mesh/types@0.93.2)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1))(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1) + '@graphql-mesh/store': 0.93.1(@graphql-mesh/cross-helpers@0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)))(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.93.2)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1) + '@graphql-mesh/types': 0.93.2(@graphql-mesh/store@0.93.1)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1) + '@graphql-mesh/utils': 0.93.2(@graphql-mesh/cross-helpers@0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)))(@graphql-mesh/types@0.93.2)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1) + '@graphql-tools/utils': 9.2.1(graphql@16.11.0) + ajv: 8.17.1 + change-case: 4.1.2 + cosmiconfig: 8.3.6(typescript@5.8.3) + dnscache: 1.0.2 + dotenv: 16.5.0 + graphql: 16.11.0 + graphql-import-node: 0.0.5(graphql@16.11.0) + graphql-ws: 5.16.2(graphql@16.11.0) + json-bigint-patch: 0.0.8 + json5: 2.2.3 + mkdirp: 3.0.1 + open: 7.4.2 + pascal-case: 3.1.2 + rimraf: 5.0.10 + ts-node: 10.9.2(@types/node@20.17.32)(typescript@5.8.3) + tsconfig-paths: 4.2.0 + tslib: 2.8.1 + typescript: 5.8.3 + ws: 8.18.2(bufferutil@4.0.9)(utf-8-validate@5.0.10) + yargs: 17.7.2 + transitivePeerDependencies: + - '@babel/core' + - '@swc/core' + - '@swc/wasm' + - '@types/node' + - bufferutil + - encoding + - graphql-tag + - react-native + - react-native-windows + - supports-color + - utf-8-validate + + ? '@graphql-mesh/config@0.93.1(@babel/core@7.27.1)(@graphql-mesh/cross-helpers@0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)))(@graphql-mesh/runtime@0.93.2(@graphql-mesh/cross-helpers@0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)))(@graphql-mesh/types@0.93.2(@graphql-mesh/store@0.93.1)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1))(@graphql-mesh/utils@0.93.2(@graphql-mesh/cross-helpers@0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)))(@graphql-mesh/types@0.93.2)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1))(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1))(@graphql-mesh/store@0.93.1(@graphql-mesh/cross-helpers@0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)))(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.93.2)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1))(@graphql-mesh/types@0.93.2(@graphql-mesh/store@0.93.1)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1))(@graphql-mesh/utils@0.93.2(@graphql-mesh/cross-helpers@0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)))(@graphql-mesh/types@0.93.2)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1))(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1)' + : dependencies: + '@envelop/core': 3.0.6 + '@graphql-mesh/cache-localforage': 0.93.1(@graphql-mesh/types@0.93.2(@graphql-mesh/store@0.93.1)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1))(@graphql-mesh/utils@0.93.2(@graphql-mesh/cross-helpers@0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)))(@graphql-mesh/types@0.93.2)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1))(graphql@16.11.0)(tslib@2.8.1) + '@graphql-mesh/cross-helpers': 0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)) + '@graphql-mesh/merger-bare': 0.93.1(@graphql-mesh/store@0.93.1(@graphql-mesh/cross-helpers@0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)))(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.93.2)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1))(@graphql-mesh/types@0.93.2(@graphql-mesh/store@0.93.1)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1))(@graphql-mesh/utils@0.93.2(@graphql-mesh/cross-helpers@0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)))(@graphql-mesh/types@0.93.2)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1))(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1) + '@graphql-mesh/merger-stitching': 0.93.1(@graphql-mesh/store@0.93.1(@graphql-mesh/cross-helpers@0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)))(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.93.2)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1))(@graphql-mesh/types@0.93.2(@graphql-mesh/store@0.93.1)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1))(@graphql-mesh/utils@0.93.2(@graphql-mesh/cross-helpers@0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)))(@graphql-mesh/types@0.93.2)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1))(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1) + '@graphql-mesh/runtime': 0.93.2(@graphql-mesh/cross-helpers@0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)))(@graphql-mesh/types@0.93.2(@graphql-mesh/store@0.93.1)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1))(@graphql-mesh/utils@0.93.2(@graphql-mesh/cross-helpers@0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)))(@graphql-mesh/types@0.93.2)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1))(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1) + '@graphql-mesh/store': 0.93.1(@graphql-mesh/cross-helpers@0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)))(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.93.2)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1) + '@graphql-mesh/types': 0.93.2(@graphql-mesh/store@0.93.1)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1) + '@graphql-mesh/utils': 0.93.2(@graphql-mesh/cross-helpers@0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)))(@graphql-mesh/types@0.93.2)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1) + '@graphql-tools/code-file-loader': 7.3.23(@babel/core@7.27.1)(graphql@16.11.0) + '@graphql-tools/graphql-file-loader': 7.5.17(graphql@16.11.0) + '@graphql-tools/load': 7.8.14(graphql@16.11.0) + '@graphql-tools/utils': 9.2.1(graphql@16.11.0) + '@whatwg-node/fetch': 0.8.8 + camel-case: 4.1.2 + graphql: 16.11.0 + param-case: 3.0.4 + pascal-case: 3.1.2 + tslib: 2.8.1 + transitivePeerDependencies: + - '@babel/core' + - supports-color + + '@graphql-mesh/cross-helpers@0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10))': + dependencies: + '@graphql-tools/utils': 9.2.1(graphql@16.11.0) + graphql: 16.11.0 + path-browserify: 1.0.1 + react-native-fs: 2.20.0(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)) + react-native-path: 0.0.5 + transitivePeerDependencies: + - react-native + - react-native-windows + + ? '@graphql-mesh/graphql@0.93.1(@graphql-mesh/cross-helpers@0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)))(@graphql-mesh/store@0.93.1(@graphql-mesh/cross-helpers@0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)))(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.93.2)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1))(@graphql-mesh/types@0.93.2(@graphql-mesh/store@0.93.1)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1))(@graphql-mesh/utils@0.93.2(@graphql-mesh/cross-helpers@0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)))(@graphql-mesh/types@0.93.2)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1))(@graphql-tools/utils@9.2.1(graphql@16.11.0))(@types/node@20.17.32)(bufferutil@4.0.9)(encoding@0.1.13)(graphql@16.11.0)(tslib@2.8.1)(utf-8-validate@5.0.10)' + : dependencies: + '@graphql-mesh/cross-helpers': 0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)) + '@graphql-mesh/store': 0.93.1(@graphql-mesh/cross-helpers@0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)))(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.93.2)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1) + '@graphql-mesh/string-interpolation': 0.4.4(graphql@16.11.0)(tslib@2.8.1) + '@graphql-mesh/types': 0.93.2(@graphql-mesh/store@0.93.1)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1) + '@graphql-mesh/utils': 0.93.2(@graphql-mesh/cross-helpers@0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)))(@graphql-mesh/types@0.93.2)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1) + '@graphql-tools/delegate': 9.0.35(graphql@16.11.0) + '@graphql-tools/url-loader': 7.17.18(@types/node@20.17.32)(bufferutil@4.0.9)(encoding@0.1.13)(graphql@16.11.0)(utf-8-validate@5.0.10) + '@graphql-tools/utils': 9.2.1(graphql@16.11.0) + '@graphql-tools/wrap': 9.4.2(graphql@16.11.0) + graphql: 16.11.0 + lodash.get: 4.4.2 + tslib: 2.8.1 + transitivePeerDependencies: + - '@types/node' + - bufferutil + - encoding + - utf-8-validate + + ? '@graphql-mesh/http@0.93.2(@graphql-mesh/cross-helpers@0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)))(@graphql-mesh/runtime@0.93.2(@graphql-mesh/cross-helpers@0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)))(@graphql-mesh/types@0.93.2(@graphql-mesh/store@0.93.1)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1))(@graphql-mesh/utils@0.93.2(@graphql-mesh/cross-helpers@0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)))(@graphql-mesh/types@0.93.2)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1))(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1))(@graphql-mesh/types@0.93.2(@graphql-mesh/store@0.93.1)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1))(@graphql-mesh/utils@0.93.2(@graphql-mesh/cross-helpers@0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)))(@graphql-mesh/types@0.93.2)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1))(graphql@16.11.0)(tslib@2.8.1)' + : dependencies: + '@graphql-mesh/cross-helpers': 0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)) + '@graphql-mesh/runtime': 0.93.2(@graphql-mesh/cross-helpers@0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)))(@graphql-mesh/types@0.93.2(@graphql-mesh/store@0.93.1)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1))(@graphql-mesh/utils@0.93.2(@graphql-mesh/cross-helpers@0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)))(@graphql-mesh/types@0.93.2)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1))(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1) + '@graphql-mesh/types': 0.93.2(@graphql-mesh/store@0.93.1)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1) + '@graphql-mesh/utils': 0.93.2(@graphql-mesh/cross-helpers@0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)))(@graphql-mesh/types@0.93.2)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1) + fets: 0.1.5 + graphql: 16.11.0 + graphql-yoga: 3.9.1(graphql@16.11.0) + tslib: 2.8.1 + + '@graphql-mesh/merger-bare@0.93.1(@graphql-mesh/store@0.93.1(@graphql-mesh/cross-helpers@0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)))(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.93.2)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1))(@graphql-mesh/types@0.93.2(@graphql-mesh/store@0.93.1)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1))(@graphql-mesh/utils@0.93.2(@graphql-mesh/cross-helpers@0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)))(@graphql-mesh/types@0.93.2)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1))(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1)': + dependencies: + '@graphql-mesh/merger-stitching': 0.93.1(@graphql-mesh/store@0.93.1(@graphql-mesh/cross-helpers@0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)))(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.93.2)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1))(@graphql-mesh/types@0.93.2(@graphql-mesh/store@0.93.1)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1))(@graphql-mesh/utils@0.93.2(@graphql-mesh/cross-helpers@0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)))(@graphql-mesh/types@0.93.2)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1))(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1) + '@graphql-mesh/types': 0.93.2(@graphql-mesh/store@0.93.1)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1) + '@graphql-mesh/utils': 0.93.2(@graphql-mesh/cross-helpers@0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)))(@graphql-mesh/types@0.93.2)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1) + '@graphql-tools/schema': 9.0.19(graphql@16.11.0) + '@graphql-tools/utils': 9.2.1(graphql@16.11.0) + graphql: 16.11.0 + tslib: 2.8.1 + transitivePeerDependencies: + - '@graphql-mesh/store' + + '@graphql-mesh/merger-stitching@0.93.1(@graphql-mesh/store@0.93.1(@graphql-mesh/cross-helpers@0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)))(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.93.2)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1))(@graphql-mesh/types@0.93.2(@graphql-mesh/store@0.93.1)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1))(@graphql-mesh/utils@0.93.2(@graphql-mesh/cross-helpers@0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)))(@graphql-mesh/types@0.93.2)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1))(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1)': + dependencies: + '@graphql-mesh/store': 0.93.1(@graphql-mesh/cross-helpers@0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)))(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.93.2)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1) + '@graphql-mesh/types': 0.93.2(@graphql-mesh/store@0.93.1)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1) + '@graphql-mesh/utils': 0.93.2(@graphql-mesh/cross-helpers@0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)))(@graphql-mesh/types@0.93.2)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1) + '@graphql-tools/delegate': 9.0.35(graphql@16.11.0) + '@graphql-tools/schema': 9.0.19(graphql@16.11.0) + '@graphql-tools/stitch': 8.7.50(graphql@16.11.0) + '@graphql-tools/stitching-directives': 2.3.34(graphql@16.11.0) + '@graphql-tools/utils': 9.2.1(graphql@16.11.0) + graphql: 16.11.0 + tslib: 2.8.1 + + '@graphql-mesh/runtime@0.93.2(@graphql-mesh/cross-helpers@0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)))(@graphql-mesh/types@0.93.2(@graphql-mesh/store@0.93.1)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1))(@graphql-mesh/utils@0.93.2(@graphql-mesh/cross-helpers@0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)))(@graphql-mesh/types@0.93.2)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1))(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1)': + dependencies: + '@envelop/core': 3.0.6 + '@envelop/extended-validation': 2.0.6(@envelop/core@3.0.6)(graphql@16.11.0) + '@graphql-mesh/cross-helpers': 0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)) + '@graphql-mesh/string-interpolation': 0.4.4(graphql@16.11.0)(tslib@2.8.1) + '@graphql-mesh/types': 0.93.2(@graphql-mesh/store@0.93.1)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1) + '@graphql-mesh/utils': 0.93.2(@graphql-mesh/cross-helpers@0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)))(@graphql-mesh/types@0.93.2)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1) + '@graphql-tools/batch-delegate': 8.4.27(graphql@16.11.0) + '@graphql-tools/batch-execute': 8.5.22(graphql@16.11.0) + '@graphql-tools/delegate': 9.0.35(graphql@16.11.0) + '@graphql-tools/utils': 9.2.1(graphql@16.11.0) + '@graphql-tools/wrap': 9.4.2(graphql@16.11.0) + '@whatwg-node/fetch': 0.8.8 + graphql: 16.11.0 + tslib: 2.8.1 + + '@graphql-mesh/store@0.93.1(@graphql-mesh/cross-helpers@0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)))(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.93.2)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1)': + dependencies: + '@graphql-inspector/core': 3.3.0(graphql@16.11.0) + '@graphql-mesh/cross-helpers': 0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)) + '@graphql-mesh/types': 0.93.2(@graphql-mesh/store@0.93.1)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1) + '@graphql-mesh/utils': 0.93.2(@graphql-mesh/cross-helpers@0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)))(@graphql-mesh/types@0.93.2)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1) + '@graphql-tools/utils': 9.2.1(graphql@16.11.0) + graphql: 16.11.0 + tslib: 2.8.1 + + '@graphql-mesh/string-interpolation@0.4.4(graphql@16.11.0)(tslib@2.8.1)': + dependencies: + dayjs: 1.11.7 + graphql: 16.11.0 + json-pointer: 0.6.2 + lodash.get: 4.4.2 + tslib: 2.8.1 + + '@graphql-mesh/transform-type-merging@0.93.1(@graphql-mesh/types@0.93.2(@graphql-mesh/store@0.93.1)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1))(@graphql-mesh/utils@0.93.2(@graphql-mesh/cross-helpers@0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)))(@graphql-mesh/types@0.93.2)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1))(graphql@16.11.0)(tslib@2.8.1)': + dependencies: + '@graphql-mesh/types': 0.93.2(@graphql-mesh/store@0.93.1)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1) + '@graphql-mesh/utils': 0.93.2(@graphql-mesh/cross-helpers@0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)))(@graphql-mesh/types@0.93.2)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1) + '@graphql-tools/delegate': 9.0.35(graphql@16.11.0) + '@graphql-tools/stitching-directives': 2.3.34(graphql@16.11.0) + graphql: 16.11.0 + tslib: 2.8.1 + + '@graphql-mesh/types@0.93.2(@graphql-mesh/store@0.93.1)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1)': + dependencies: + '@graphql-mesh/store': 0.93.1(@graphql-mesh/cross-helpers@0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)))(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.93.2)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1) + '@graphql-tools/batch-delegate': 8.4.27(graphql@16.11.0) + '@graphql-tools/delegate': 9.0.35(graphql@16.11.0) + '@graphql-tools/utils': 9.2.1(graphql@16.11.0) + '@graphql-typed-document-node/core': 3.2.0(graphql@16.11.0) + graphql: 16.11.0 + tslib: 2.8.1 + + '@graphql-mesh/utils@0.93.2(@graphql-mesh/cross-helpers@0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)))(@graphql-mesh/types@0.93.2)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1)': + dependencies: + '@graphql-mesh/cross-helpers': 0.3.4(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)) + '@graphql-mesh/string-interpolation': 0.4.4(graphql@16.11.0)(tslib@2.8.1) + '@graphql-mesh/types': 0.93.2(@graphql-mesh/store@0.93.1)(@graphql-tools/utils@9.2.1(graphql@16.11.0))(graphql@16.11.0)(tslib@2.8.1) + '@graphql-tools/delegate': 9.0.35(graphql@16.11.0) + '@graphql-tools/utils': 9.2.1(graphql@16.11.0) + dset: 3.1.4 + graphql: 16.11.0 + js-yaml: 4.1.0 + lodash.get: 4.4.2 + lodash.topath: 4.5.2 + tiny-lru: 8.0.2 + tslib: 2.8.1 + + '@graphql-tools/batch-delegate@8.4.27(graphql@16.11.0)': + dependencies: + '@graphql-tools/delegate': 9.0.35(graphql@16.11.0) + '@graphql-tools/utils': 9.2.1(graphql@16.11.0) + dataloader: 2.2.2 + graphql: 16.11.0 + tslib: 2.8.1 + value-or-promise: 1.0.12 + + '@graphql-tools/batch-execute@8.5.22(graphql@16.11.0)': + dependencies: + '@graphql-tools/utils': 9.2.1(graphql@16.11.0) + dataloader: 2.2.3 + graphql: 16.11.0 + tslib: 2.8.1 + value-or-promise: 1.0.12 + + '@graphql-tools/code-file-loader@7.3.23(@babel/core@7.27.1)(graphql@16.11.0)': + dependencies: + '@graphql-tools/graphql-tag-pluck': 7.5.2(@babel/core@7.27.1)(graphql@16.11.0) + '@graphql-tools/utils': 9.2.1(graphql@16.11.0) + globby: 11.1.0 + graphql: 16.11.0 + tslib: 2.8.1 + unixify: 1.0.0 + transitivePeerDependencies: + - '@babel/core' + - supports-color + + '@graphql-tools/delegate@9.0.35(graphql@16.11.0)': + dependencies: + '@graphql-tools/batch-execute': 8.5.22(graphql@16.11.0) + '@graphql-tools/executor': 0.0.20(graphql@16.11.0) + '@graphql-tools/schema': 9.0.19(graphql@16.11.0) + '@graphql-tools/utils': 9.2.1(graphql@16.11.0) + dataloader: 2.2.3 + graphql: 16.11.0 + tslib: 2.8.1 + value-or-promise: 1.0.12 + + '@graphql-tools/executor-graphql-ws@0.0.14(bufferutil@4.0.9)(graphql@16.11.0)(utf-8-validate@5.0.10)': + dependencies: + '@graphql-tools/utils': 9.2.1(graphql@16.11.0) + '@repeaterjs/repeater': 3.0.4 + '@types/ws': 8.18.1 + graphql: 16.11.0 + graphql-ws: 5.12.1(graphql@16.11.0) + isomorphic-ws: 5.0.0(ws@8.13.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)) + tslib: 2.8.1 + ws: 8.13.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + transitivePeerDependencies: + - bufferutil + - utf-8-validate + + '@graphql-tools/executor-http@0.1.10(@types/node@20.17.32)(graphql@16.11.0)': + dependencies: + '@graphql-tools/utils': 9.2.1(graphql@16.11.0) + '@repeaterjs/repeater': 3.0.6 + '@whatwg-node/fetch': 0.8.8 + dset: 3.1.4 + extract-files: 11.0.0 + graphql: 16.11.0 + meros: 1.3.0(@types/node@20.17.32) + tslib: 2.8.1 + value-or-promise: 1.0.12 + transitivePeerDependencies: + - '@types/node' + + '@graphql-tools/executor-legacy-ws@0.0.11(bufferutil@4.0.9)(graphql@16.11.0)(utf-8-validate@5.0.10)': + dependencies: + '@graphql-tools/utils': 9.2.1(graphql@16.11.0) + '@types/ws': 8.18.1 + graphql: 16.11.0 + isomorphic-ws: 5.0.0(ws@8.13.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)) + tslib: 2.8.1 + ws: 8.13.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + transitivePeerDependencies: + - bufferutil + - utf-8-validate + + '@graphql-tools/executor@0.0.18(graphql@16.11.0)': + dependencies: + '@graphql-tools/utils': 9.2.1(graphql@16.11.0) + '@graphql-typed-document-node/core': 3.2.0(graphql@16.11.0) + '@repeaterjs/repeater': 3.0.4 + graphql: 16.11.0 + tslib: 2.8.1 + value-or-promise: 1.0.12 + + '@graphql-tools/executor@0.0.20(graphql@16.11.0)': + dependencies: + '@graphql-tools/utils': 9.2.1(graphql@16.11.0) + '@graphql-typed-document-node/core': 3.2.0(graphql@16.11.0) + '@repeaterjs/repeater': 3.0.6 + graphql: 16.11.0 + tslib: 2.8.1 + value-or-promise: 1.0.12 + + '@graphql-tools/graphql-file-loader@7.5.17(graphql@16.11.0)': + dependencies: + '@graphql-tools/import': 6.7.18(graphql@16.11.0) + '@graphql-tools/utils': 9.2.1(graphql@16.11.0) + globby: 11.1.0 + graphql: 16.11.0 + tslib: 2.8.1 + unixify: 1.0.0 + + '@graphql-tools/graphql-tag-pluck@7.5.2(@babel/core@7.27.1)(graphql@16.11.0)': + dependencies: + '@babel/parser': 7.27.1 + '@babel/plugin-syntax-import-assertions': 7.27.1(@babel/core@7.27.1) + '@babel/traverse': 7.27.1 + '@babel/types': 7.27.1 + '@graphql-tools/utils': 9.2.1(graphql@16.11.0) + graphql: 16.11.0 + tslib: 2.8.1 + transitivePeerDependencies: + - '@babel/core' + - supports-color + + '@graphql-tools/import@6.7.18(graphql@16.11.0)': + dependencies: + '@graphql-tools/utils': 9.2.1(graphql@16.11.0) + graphql: 16.11.0 + resolve-from: 5.0.0 + tslib: 2.8.1 + + '@graphql-tools/load@7.8.14(graphql@16.11.0)': + dependencies: + '@graphql-tools/schema': 9.0.19(graphql@16.11.0) + '@graphql-tools/utils': 9.2.1(graphql@16.11.0) + graphql: 16.11.0 + p-limit: 3.1.0 + tslib: 2.8.1 + + '@graphql-tools/merge@8.4.2(graphql@16.11.0)': + dependencies: + '@graphql-tools/utils': 9.2.1(graphql@16.11.0) + graphql: 16.11.0 + tslib: 2.8.1 + + '@graphql-tools/optimize@1.4.0(graphql@16.11.0)': + dependencies: + graphql: 16.11.0 + tslib: 2.8.1 + + '@graphql-tools/relay-operation-optimizer@6.5.18(encoding@0.1.13)(graphql@16.11.0)': + dependencies: + '@ardatan/relay-compiler': 12.0.0(encoding@0.1.13)(graphql@16.11.0) + '@graphql-tools/utils': 9.2.1(graphql@16.11.0) + graphql: 16.11.0 + tslib: 2.8.1 + transitivePeerDependencies: + - encoding + - supports-color + + '@graphql-tools/schema@9.0.19(graphql@16.11.0)': + dependencies: + '@graphql-tools/merge': 8.4.2(graphql@16.11.0) + '@graphql-tools/utils': 9.2.1(graphql@16.11.0) + graphql: 16.11.0 + tslib: 2.8.1 + value-or-promise: 1.0.12 + + '@graphql-tools/stitch@8.7.50(graphql@16.11.0)': + dependencies: + '@graphql-tools/batch-delegate': 8.4.27(graphql@16.11.0) + '@graphql-tools/delegate': 9.0.35(graphql@16.11.0) + '@graphql-tools/executor': 0.0.20(graphql@16.11.0) + '@graphql-tools/merge': 8.4.2(graphql@16.11.0) + '@graphql-tools/schema': 9.0.19(graphql@16.11.0) + '@graphql-tools/utils': 9.2.1(graphql@16.11.0) + '@graphql-tools/wrap': 9.4.2(graphql@16.11.0) + graphql: 16.11.0 + tslib: 2.8.1 + value-or-promise: 1.0.12 + + '@graphql-tools/stitching-directives@2.3.34(graphql@16.11.0)': + dependencies: + '@graphql-tools/delegate': 9.0.35(graphql@16.11.0) + '@graphql-tools/utils': 9.2.1(graphql@16.11.0) + graphql: 16.11.0 + tslib: 2.8.1 + + '@graphql-tools/url-loader@7.17.18(@types/node@20.17.32)(bufferutil@4.0.9)(encoding@0.1.13)(graphql@16.11.0)(utf-8-validate@5.0.10)': + dependencies: + '@ardatan/sync-fetch': 0.0.1(encoding@0.1.13) + '@graphql-tools/delegate': 9.0.35(graphql@16.11.0) + '@graphql-tools/executor-graphql-ws': 0.0.14(bufferutil@4.0.9)(graphql@16.11.0)(utf-8-validate@5.0.10) + '@graphql-tools/executor-http': 0.1.10(@types/node@20.17.32)(graphql@16.11.0) + '@graphql-tools/executor-legacy-ws': 0.0.11(bufferutil@4.0.9)(graphql@16.11.0)(utf-8-validate@5.0.10) + '@graphql-tools/utils': 9.2.1(graphql@16.11.0) + '@graphql-tools/wrap': 9.4.2(graphql@16.11.0) + '@types/ws': 8.18.1 + '@whatwg-node/fetch': 0.8.8 + graphql: 16.11.0 + isomorphic-ws: 5.0.0(ws@8.18.2(bufferutil@4.0.9)(utf-8-validate@5.0.10)) + tslib: 2.8.1 + value-or-promise: 1.0.12 + ws: 8.18.2(bufferutil@4.0.9)(utf-8-validate@5.0.10) + transitivePeerDependencies: + - '@types/node' + - bufferutil + - encoding + - utf-8-validate + + '@graphql-tools/utils@8.13.1(graphql@16.11.0)': + dependencies: + graphql: 16.11.0 + tslib: 2.8.1 + + '@graphql-tools/utils@9.2.1(graphql@16.11.0)': + dependencies: + '@graphql-typed-document-node/core': 3.2.0(graphql@16.11.0) + graphql: 16.11.0 + tslib: 2.8.1 + + '@graphql-tools/wrap@9.4.2(graphql@16.11.0)': + dependencies: + '@graphql-tools/delegate': 9.0.35(graphql@16.11.0) + '@graphql-tools/schema': 9.0.19(graphql@16.11.0) + '@graphql-tools/utils': 9.2.1(graphql@16.11.0) + graphql: 16.11.0 + tslib: 2.8.1 + value-or-promise: 1.0.12 + + '@graphql-typed-document-node/core@3.2.0(graphql@16.11.0)': + dependencies: + graphql: 16.11.0 + + '@graphql-typed-document-node/core@3.2.0(graphql@16.3.0)': + dependencies: + graphql: 16.3.0 + + '@graphql-typed-document-node/core@3.2.0(graphql@16.8.0)': + dependencies: + graphql: 16.8.0 + + '@graphql-yoga/logger@0.0.1': + dependencies: + tslib: 2.8.1 + + '@graphql-yoga/subscription@3.1.0': + dependencies: + '@graphql-yoga/typed-event-target': 1.0.0 + '@repeaterjs/repeater': 3.0.6 + '@whatwg-node/events': 0.0.2 + tslib: 2.8.1 + + '@graphql-yoga/typed-event-target@1.0.0': + dependencies: + '@repeaterjs/repeater': 3.0.6 + tslib: 2.8.1 + + '@humanwhocodes/config-array@0.13.0': + dependencies: + '@humanwhocodes/object-schema': 2.0.3 + debug: 4.4.0(supports-color@9.4.0) + minimatch: 3.1.2 + transitivePeerDependencies: + - supports-color + + '@humanwhocodes/module-importer@1.0.1': {} + + '@humanwhocodes/object-schema@2.0.3': {} + + '@isaacs/cliui@8.0.2': + dependencies: + string-width: 5.1.2 + string-width-cjs: string-width@4.2.3 + strip-ansi: 7.1.0 + strip-ansi-cjs: strip-ansi@6.0.1 + wrap-ansi: 8.1.0 + wrap-ansi-cjs: wrap-ansi@7.0.0 + + '@isaacs/ttlcache@1.4.1': {} + + '@istanbuljs/load-nyc-config@1.1.0': + dependencies: + camelcase: 5.3.1 + find-up: 4.1.0 + get-package-type: 0.1.0 + js-yaml: 3.14.1 + resolve-from: 5.0.0 + + '@istanbuljs/schema@0.1.3': {} + + '@jest/create-cache-key-function@29.7.0': + dependencies: + '@jest/types': 29.6.3 + + '@jest/environment@29.7.0': + dependencies: + '@jest/fake-timers': 29.7.0 + '@jest/types': 29.6.3 + '@types/node': 20.17.32 + jest-mock: 29.7.0 + + '@jest/fake-timers@29.7.0': + dependencies: + '@jest/types': 29.6.3 + '@sinonjs/fake-timers': 10.3.0 + '@types/node': 20.17.32 + jest-message-util: 29.7.0 + jest-mock: 29.7.0 + jest-util: 29.7.0 + + '@jest/schemas@29.6.3': + dependencies: + '@sinclair/typebox': 0.27.8 + + '@jest/transform@29.7.0': + dependencies: + '@babel/core': 7.27.1 + '@jest/types': 29.6.3 + '@jridgewell/trace-mapping': 0.3.25 + babel-plugin-istanbul: 6.1.1 + chalk: 4.1.2 + convert-source-map: 2.0.0 + fast-json-stable-stringify: 2.1.0 + graceful-fs: 4.2.11 + jest-haste-map: 29.7.0 + jest-regex-util: 29.6.3 + jest-util: 29.7.0 + micromatch: 4.0.8 + pirates: 4.0.7 + slash: 3.0.0 + write-file-atomic: 4.0.2 + transitivePeerDependencies: + - supports-color + + '@jest/types@29.6.3': + dependencies: + '@jest/schemas': 29.6.3 + '@types/istanbul-lib-coverage': 2.0.6 + '@types/istanbul-reports': 3.0.4 + '@types/node': 20.17.32 + '@types/yargs': 17.0.33 + chalk: 4.1.2 + + '@jridgewell/gen-mapping@0.3.8': + dependencies: + '@jridgewell/set-array': 1.2.1 + '@jridgewell/sourcemap-codec': 1.5.0 + '@jridgewell/trace-mapping': 0.3.25 + + '@jridgewell/resolve-uri@3.1.2': {} + + '@jridgewell/set-array@1.2.1': {} + + '@jridgewell/source-map@0.3.6': + dependencies: + '@jridgewell/gen-mapping': 0.3.8 + '@jridgewell/trace-mapping': 0.3.25 + + '@jridgewell/sourcemap-codec@1.5.0': {} + + '@jridgewell/trace-mapping@0.3.25': + dependencies: + '@jridgewell/resolve-uri': 3.1.2 + '@jridgewell/sourcemap-codec': 1.5.0 + + '@jridgewell/trace-mapping@0.3.9': + dependencies: + '@jridgewell/resolve-uri': 3.1.2 + '@jridgewell/sourcemap-codec': 1.5.0 + + '@ledgerhq/cryptoassets@5.53.0': + dependencies: + invariant: 2.2.4 + + '@ledgerhq/devices@5.51.1': + dependencies: + '@ledgerhq/errors': 5.50.0 + '@ledgerhq/logs': 5.50.0 + rxjs: 6.6.7 + semver: 7.7.1 + + '@ledgerhq/errors@5.50.0': {} + + '@ledgerhq/hw-app-eth@5.27.2': + dependencies: + '@ledgerhq/cryptoassets': 5.53.0 + '@ledgerhq/errors': 5.50.0 + '@ledgerhq/hw-transport': 5.51.1 + bignumber.js: 9.1.2 + rlp: 2.2.7 + + '@ledgerhq/hw-transport-node-hid-noevents@5.51.1': + dependencies: + '@ledgerhq/devices': 5.51.1 + '@ledgerhq/errors': 5.50.0 + '@ledgerhq/hw-transport': 5.51.1 + '@ledgerhq/logs': 5.50.0 + node-hid: 2.1.1 + optional: true + + '@ledgerhq/hw-transport-node-hid@5.26.0': + dependencies: + '@ledgerhq/devices': 5.51.1 + '@ledgerhq/errors': 5.50.0 + '@ledgerhq/hw-transport': 5.51.1 + '@ledgerhq/hw-transport-node-hid-noevents': 5.51.1 + '@ledgerhq/logs': 5.50.0 + lodash: 4.17.21 + node-hid: 1.3.0 + usb: 1.9.2 + optional: true + + '@ledgerhq/hw-transport-u2f@5.26.0': + dependencies: + '@ledgerhq/errors': 5.50.0 + '@ledgerhq/hw-transport': 5.51.1 + '@ledgerhq/logs': 5.50.0 + u2f-api: 0.2.7 + + '@ledgerhq/hw-transport@5.26.0': + dependencies: + '@ledgerhq/devices': 5.51.1 + '@ledgerhq/errors': 5.50.0 + events: 3.3.0 + + '@ledgerhq/hw-transport@5.51.1': + dependencies: + '@ledgerhq/devices': 5.51.1 + '@ledgerhq/errors': 5.50.0 + events: 3.3.0 + + '@ledgerhq/logs@5.50.0': {} + + '@ljharb/resumer@0.0.1': + dependencies: + '@ljharb/through': 2.3.14 + + '@ljharb/through@2.3.14': + dependencies: + call-bind: 1.0.8 + + '@manypkg/find-root@1.1.0': + dependencies: + '@babel/runtime': 7.27.1 + '@types/node': 12.20.55 + find-up: 4.1.0 + fs-extra: 8.1.0 + + '@manypkg/get-packages@1.1.3': + dependencies: + '@babel/runtime': 7.27.1 + '@changesets/types': 4.1.0 + '@manypkg/find-root': 1.1.0 + fs-extra: 8.1.0 + globby: 11.1.0 + read-yaml-file: 1.1.0 + + '@metamask/eth-sig-util@4.0.1': + dependencies: + ethereumjs-abi: 0.6.8 + ethereumjs-util: 6.2.1 + ethjs-util: 0.1.6 + tweetnacl: 1.0.3 + tweetnacl-util: 0.15.1 + + '@multiformats/base-x@4.0.1': {} + + '@noble/curves@1.2.0': + dependencies: + '@noble/hashes': 1.3.2 + + '@noble/curves@1.4.2': + dependencies: + '@noble/hashes': 1.4.0 + + '@noble/curves@1.8.2': + dependencies: + '@noble/hashes': 1.7.2 + + '@noble/hashes@1.2.0': {} + + '@noble/hashes@1.3.2': {} + + '@noble/hashes@1.4.0': {} + + '@noble/hashes@1.7.2': {} + + '@noble/hashes@1.8.0': {} + + '@noble/secp256k1@1.7.1': {} + + '@nodelib/fs.scandir@2.1.5': + dependencies: + '@nodelib/fs.stat': 2.0.5 + run-parallel: 1.2.0 + + '@nodelib/fs.stat@2.0.5': {} + + '@nodelib/fs.walk@1.2.8': + dependencies: + '@nodelib/fs.scandir': 2.1.5 + fastq: 1.19.1 + + '@nomicfoundation/edr-darwin-arm64@0.10.0': {} + + '@nomicfoundation/edr-darwin-x64@0.10.0': {} + + '@nomicfoundation/edr-linux-arm64-gnu@0.10.0': {} + + '@nomicfoundation/edr-linux-arm64-musl@0.10.0': {} + + '@nomicfoundation/edr-linux-x64-gnu@0.10.0': {} + + '@nomicfoundation/edr-linux-x64-musl@0.10.0': {} + + '@nomicfoundation/edr-win32-x64-msvc@0.10.0': {} + + '@nomicfoundation/edr@0.10.0': + dependencies: + '@nomicfoundation/edr-darwin-arm64': 0.10.0 + '@nomicfoundation/edr-darwin-x64': 0.10.0 + '@nomicfoundation/edr-linux-arm64-gnu': 0.10.0 + '@nomicfoundation/edr-linux-arm64-musl': 0.10.0 + '@nomicfoundation/edr-linux-x64-gnu': 0.10.0 + '@nomicfoundation/edr-linux-x64-musl': 0.10.0 + '@nomicfoundation/edr-win32-x64-msvc': 0.10.0 + + '@nomicfoundation/ethereumjs-block@4.2.2': + dependencies: + '@nomicfoundation/ethereumjs-common': 3.1.2 + '@nomicfoundation/ethereumjs-rlp': 4.0.3 + '@nomicfoundation/ethereumjs-trie': 5.0.5 + '@nomicfoundation/ethereumjs-tx': 4.1.2 + '@nomicfoundation/ethereumjs-util': 8.0.6 + ethereum-cryptography: 0.1.3 + + '@nomicfoundation/ethereumjs-block@5.0.1(bufferutil@4.0.9)(utf-8-validate@5.0.10)': + dependencies: + '@nomicfoundation/ethereumjs-common': 4.0.1 + '@nomicfoundation/ethereumjs-rlp': 5.0.1 + '@nomicfoundation/ethereumjs-trie': 6.0.1 + '@nomicfoundation/ethereumjs-tx': 5.0.1(bufferutil@4.0.9)(utf-8-validate@5.0.10) + '@nomicfoundation/ethereumjs-util': 9.0.1 + ethereum-cryptography: 0.1.3 + ethers: 5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + transitivePeerDependencies: + - bufferutil + - utf-8-validate + + '@nomicfoundation/ethereumjs-blockchain@6.2.2': + dependencies: + '@nomicfoundation/ethereumjs-block': 4.2.2 + '@nomicfoundation/ethereumjs-common': 3.1.2 + '@nomicfoundation/ethereumjs-ethash': 2.0.5 + '@nomicfoundation/ethereumjs-rlp': 4.0.3 + '@nomicfoundation/ethereumjs-trie': 5.0.5 + '@nomicfoundation/ethereumjs-util': 8.0.6 + abstract-level: 1.0.4 + debug: 4.4.0(supports-color@9.4.0) + ethereum-cryptography: 0.1.3 + level: 8.0.1 + lru-cache: 5.1.1 + memory-level: 1.0.0 + transitivePeerDependencies: + - supports-color + + '@nomicfoundation/ethereumjs-blockchain@7.0.1(bufferutil@4.0.9)(utf-8-validate@5.0.10)': + dependencies: + '@nomicfoundation/ethereumjs-block': 5.0.1(bufferutil@4.0.9)(utf-8-validate@5.0.10) + '@nomicfoundation/ethereumjs-common': 4.0.1 + '@nomicfoundation/ethereumjs-ethash': 3.0.1(bufferutil@4.0.9)(utf-8-validate@5.0.10) + '@nomicfoundation/ethereumjs-rlp': 5.0.1 + '@nomicfoundation/ethereumjs-trie': 6.0.1 + '@nomicfoundation/ethereumjs-tx': 5.0.1(bufferutil@4.0.9)(utf-8-validate@5.0.10) + '@nomicfoundation/ethereumjs-util': 9.0.1 + abstract-level: 1.0.4 + debug: 4.4.0(supports-color@9.4.0) + ethereum-cryptography: 0.1.3 + level: 8.0.1 + lru-cache: 5.1.1 + memory-level: 1.0.0 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + + '@nomicfoundation/ethereumjs-common@3.1.2': + dependencies: + '@nomicfoundation/ethereumjs-util': 8.0.6 + crc-32: 1.2.2 + + '@nomicfoundation/ethereumjs-common@4.0.1': + dependencies: + '@nomicfoundation/ethereumjs-util': 9.0.1 + crc-32: 1.2.2 + + '@nomicfoundation/ethereumjs-ethash@2.0.5': + dependencies: + '@nomicfoundation/ethereumjs-block': 4.2.2 + '@nomicfoundation/ethereumjs-rlp': 4.0.3 + '@nomicfoundation/ethereumjs-util': 8.0.6 + abstract-level: 1.0.4 + bigint-crypto-utils: 3.3.0 + ethereum-cryptography: 0.1.3 + + '@nomicfoundation/ethereumjs-ethash@3.0.1(bufferutil@4.0.9)(utf-8-validate@5.0.10)': + dependencies: + '@nomicfoundation/ethereumjs-block': 5.0.1(bufferutil@4.0.9)(utf-8-validate@5.0.10) + '@nomicfoundation/ethereumjs-rlp': 5.0.1 + '@nomicfoundation/ethereumjs-util': 9.0.1 + abstract-level: 1.0.4 + bigint-crypto-utils: 3.3.0 + ethereum-cryptography: 0.1.3 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + + '@nomicfoundation/ethereumjs-evm@1.3.2': + dependencies: + '@nomicfoundation/ethereumjs-common': 3.1.2 + '@nomicfoundation/ethereumjs-util': 8.0.6 + '@types/async-eventemitter': 0.2.4 + async-eventemitter: 0.2.4 + debug: 4.4.0(supports-color@9.4.0) + ethereum-cryptography: 0.1.3 + mcl-wasm: 0.7.9 + rustbn.js: 0.2.0 + transitivePeerDependencies: + - supports-color + + '@nomicfoundation/ethereumjs-evm@2.0.1(bufferutil@4.0.9)(utf-8-validate@5.0.10)': + dependencies: + '@ethersproject/providers': 5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + '@nomicfoundation/ethereumjs-common': 4.0.1 + '@nomicfoundation/ethereumjs-tx': 5.0.1(bufferutil@4.0.9)(utf-8-validate@5.0.10) + '@nomicfoundation/ethereumjs-util': 9.0.1 + debug: 4.4.0(supports-color@9.4.0) + ethereum-cryptography: 0.1.3 + mcl-wasm: 0.7.9 + rustbn.js: 0.2.0 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + + '@nomicfoundation/ethereumjs-rlp@4.0.3': {} + + '@nomicfoundation/ethereumjs-rlp@5.0.1': {} + + '@nomicfoundation/ethereumjs-statemanager@1.0.5': + dependencies: + '@nomicfoundation/ethereumjs-common': 3.1.2 + '@nomicfoundation/ethereumjs-rlp': 4.0.3 + '@nomicfoundation/ethereumjs-trie': 5.0.5 + '@nomicfoundation/ethereumjs-util': 8.0.6 + debug: 4.4.0(supports-color@9.4.0) + ethereum-cryptography: 0.1.3 + functional-red-black-tree: 1.0.1 + transitivePeerDependencies: + - supports-color + + '@nomicfoundation/ethereumjs-statemanager@2.0.1(bufferutil@4.0.9)(utf-8-validate@5.0.10)': + dependencies: + '@nomicfoundation/ethereumjs-common': 4.0.1 + '@nomicfoundation/ethereumjs-rlp': 5.0.1 + debug: 4.4.0(supports-color@9.4.0) + ethereum-cryptography: 0.1.3 + ethers: 5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + js-sdsl: 4.4.2 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + + '@nomicfoundation/ethereumjs-trie@5.0.5': + dependencies: + '@nomicfoundation/ethereumjs-rlp': 4.0.3 + '@nomicfoundation/ethereumjs-util': 8.0.6 + ethereum-cryptography: 0.1.3 + readable-stream: 3.6.2 + + '@nomicfoundation/ethereumjs-trie@6.0.1': + dependencies: + '@nomicfoundation/ethereumjs-rlp': 5.0.1 + '@nomicfoundation/ethereumjs-util': 9.0.1 + '@types/readable-stream': 2.3.15 + ethereum-cryptography: 0.1.3 + readable-stream: 3.6.2 + + '@nomicfoundation/ethereumjs-tx@4.1.2': + dependencies: + '@nomicfoundation/ethereumjs-common': 3.1.2 + '@nomicfoundation/ethereumjs-rlp': 4.0.3 + '@nomicfoundation/ethereumjs-util': 8.0.6 + ethereum-cryptography: 0.1.3 + + '@nomicfoundation/ethereumjs-tx@5.0.1(bufferutil@4.0.9)(utf-8-validate@5.0.10)': + dependencies: + '@chainsafe/ssz': 0.9.4 + '@ethersproject/providers': 5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + '@nomicfoundation/ethereumjs-common': 4.0.1 + '@nomicfoundation/ethereumjs-rlp': 5.0.1 + '@nomicfoundation/ethereumjs-util': 9.0.1 + ethereum-cryptography: 0.1.3 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + + '@nomicfoundation/ethereumjs-util@8.0.6': + dependencies: + '@nomicfoundation/ethereumjs-rlp': 4.0.3 + ethereum-cryptography: 0.1.3 + + '@nomicfoundation/ethereumjs-util@9.0.1': + dependencies: + '@chainsafe/ssz': 0.10.2 + '@nomicfoundation/ethereumjs-rlp': 5.0.1 + ethereum-cryptography: 0.1.3 + + '@nomicfoundation/ethereumjs-vm@6.4.2': + dependencies: + '@nomicfoundation/ethereumjs-block': 4.2.2 + '@nomicfoundation/ethereumjs-blockchain': 6.2.2 + '@nomicfoundation/ethereumjs-common': 3.1.2 + '@nomicfoundation/ethereumjs-evm': 1.3.2 + '@nomicfoundation/ethereumjs-rlp': 4.0.3 + '@nomicfoundation/ethereumjs-statemanager': 1.0.5 + '@nomicfoundation/ethereumjs-trie': 5.0.5 + '@nomicfoundation/ethereumjs-tx': 4.1.2 + '@nomicfoundation/ethereumjs-util': 8.0.6 + '@types/async-eventemitter': 0.2.4 + async-eventemitter: 0.2.4 + debug: 4.4.0(supports-color@9.4.0) + ethereum-cryptography: 0.1.3 + functional-red-black-tree: 1.0.1 + mcl-wasm: 0.7.9 + rustbn.js: 0.2.0 + transitivePeerDependencies: + - supports-color + + '@nomicfoundation/ethereumjs-vm@7.0.1(bufferutil@4.0.9)(utf-8-validate@5.0.10)': + dependencies: + '@nomicfoundation/ethereumjs-block': 5.0.1(bufferutil@4.0.9)(utf-8-validate@5.0.10) + '@nomicfoundation/ethereumjs-blockchain': 7.0.1(bufferutil@4.0.9)(utf-8-validate@5.0.10) + '@nomicfoundation/ethereumjs-common': 4.0.1 + '@nomicfoundation/ethereumjs-evm': 2.0.1(bufferutil@4.0.9)(utf-8-validate@5.0.10) + '@nomicfoundation/ethereumjs-rlp': 5.0.1 + '@nomicfoundation/ethereumjs-statemanager': 2.0.1(bufferutil@4.0.9)(utf-8-validate@5.0.10) + '@nomicfoundation/ethereumjs-trie': 6.0.1 + '@nomicfoundation/ethereumjs-tx': 5.0.1(bufferutil@4.0.9)(utf-8-validate@5.0.10) + '@nomicfoundation/ethereumjs-util': 9.0.1 + debug: 4.4.0(supports-color@9.4.0) + ethereum-cryptography: 0.1.3 + mcl-wasm: 0.7.9 + rustbn.js: 0.2.0 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + + '@nomicfoundation/hardhat-chai-matchers@2.0.8(@nomicfoundation/hardhat-ethers@3.0.8(ethers@6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)))(chai@4.5.0)(ethers@6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10))': + dependencies: + '@nomicfoundation/hardhat-ethers': 3.0.8(ethers@6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)) + '@types/chai-as-promised': 7.1.8 + chai: 4.5.0 + chai-as-promised: 7.1.2(chai@4.5.0) + deep-eql: 4.1.4 + ethers: 6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10) + hardhat: 2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10) + ordinal: 1.0.3 + + '@nomicfoundation/hardhat-ethers@3.0.8(ethers@6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10))': + dependencies: + debug: 4.4.0(supports-color@9.4.0) + ethers: 6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10) + hardhat: 2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10) + lodash.isequal: 4.5.0 + transitivePeerDependencies: + - supports-color + + '@nomicfoundation/hardhat-ethers@3.0.8(ethers@6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10))': + dependencies: + debug: 4.4.0(supports-color@9.4.0) + ethers: 6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10) + hardhat: 2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10) + lodash.isequal: 4.5.0 + transitivePeerDependencies: + - supports-color + + '@nomicfoundation/hardhat-ethers@3.0.8(ethers@6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@8.10.2(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10))': + dependencies: + debug: 4.4.0(supports-color@9.4.0) + ethers: 6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10) + hardhat: 2.23.0(bufferutil@4.0.9)(ts-node@8.10.2(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10) + lodash.isequal: 4.5.0 + transitivePeerDependencies: + - supports-color + + '@nomicfoundation/hardhat-foundry@1.1.3(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10))': + dependencies: + hardhat: 2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10) + picocolors: 1.1.1 + + '@nomicfoundation/hardhat-ignition-ethers@0.15.11(@nomicfoundation/hardhat-ethers@3.0.8(ethers@6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)))(@nomicfoundation/hardhat-ignition@0.15.11(@nomicfoundation/hardhat-verify@2.0.13(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)))(bufferutil@4.0.9)(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10))(utf-8-validate@5.0.10))(@nomicfoundation/ignition-core@0.15.11(bufferutil@4.0.9)(utf-8-validate@5.0.10))(ethers@6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10))': + dependencies: + '@nomicfoundation/hardhat-ethers': 3.0.8(ethers@6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)) + '@nomicfoundation/hardhat-ignition': 0.15.11(@nomicfoundation/hardhat-verify@2.0.13(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)))(bufferutil@4.0.9)(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10))(utf-8-validate@5.0.10) + '@nomicfoundation/ignition-core': 0.15.11(bufferutil@4.0.9)(utf-8-validate@5.0.10) + ethers: 6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10) + hardhat: 2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10) + + '@nomicfoundation/hardhat-ignition@0.15.11(@nomicfoundation/hardhat-verify@2.0.13(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)))(bufferutil@4.0.9)(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10))(utf-8-validate@5.0.10)': + dependencies: + '@nomicfoundation/hardhat-verify': 2.0.13(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)) + '@nomicfoundation/ignition-core': 0.15.11(bufferutil@4.0.9)(utf-8-validate@5.0.10) + '@nomicfoundation/ignition-ui': 0.15.11 + chalk: 4.1.2 + debug: 4.4.0(supports-color@9.4.0) + fs-extra: 10.1.0 + hardhat: 2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10) + json5: 2.2.3 + prompts: 2.4.2 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + + '@nomicfoundation/hardhat-network-helpers@1.0.12(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10))': + dependencies: + ethereumjs-util: 7.1.5 + hardhat: 2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10) + + '@nomicfoundation/hardhat-network-helpers@1.0.12(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10))': + dependencies: + ethereumjs-util: 7.1.5 + hardhat: 2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10) + + ? '@nomicfoundation/hardhat-toolbox@4.0.0(@nomicfoundation/hardhat-chai-matchers@2.0.8(@nomicfoundation/hardhat-ethers@3.0.8(ethers@6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)))(chai@4.5.0)(ethers@6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)))(@nomicfoundation/hardhat-ethers@3.0.8(ethers@6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)))(@nomicfoundation/hardhat-network-helpers@1.0.12(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)))(@nomicfoundation/hardhat-verify@2.0.13(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)))(@typechain/ethers-v6@0.5.1(ethers@6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10))(typechain@8.3.2(typescript@5.8.3))(typescript@5.8.3))(@typechain/hardhat@9.1.0(@typechain/ethers-v6@0.5.1(ethers@6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10))(typechain@8.3.2(typescript@5.8.3))(typescript@5.8.3))(ethers@6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10))(typechain@8.3.2(typescript@5.8.3)))(@types/chai@4.3.20)(@types/mocha@10.0.10)(@types/node@20.17.32)(chai@4.5.0)(ethers@6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat-gas-reporter@1.0.10(bufferutil@4.0.9)(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10))(utf-8-validate@5.0.10))(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10))(solidity-coverage@0.8.15(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)))(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typechain@8.3.2(typescript@5.8.3))(typescript@5.8.3)' + : dependencies: + '@nomicfoundation/hardhat-chai-matchers': 2.0.8(@nomicfoundation/hardhat-ethers@3.0.8(ethers@6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)))(chai@4.5.0)(ethers@6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)) + '@nomicfoundation/hardhat-ethers': 3.0.8(ethers@6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)) + '@nomicfoundation/hardhat-network-helpers': 1.0.12(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)) + '@nomicfoundation/hardhat-verify': 2.0.13(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)) + '@typechain/ethers-v6': 0.5.1(ethers@6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10))(typechain@8.3.2(typescript@5.8.3))(typescript@5.8.3) + '@typechain/hardhat': 9.1.0(@typechain/ethers-v6@0.5.1(ethers@6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10))(typechain@8.3.2(typescript@5.8.3))(typescript@5.8.3))(ethers@6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10))(typechain@8.3.2(typescript@5.8.3)) + '@types/chai': 4.3.20 + '@types/mocha': 10.0.10 + '@types/node': 20.17.32 + chai: 4.5.0 + ethers: 6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10) + hardhat: 2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10) + hardhat-gas-reporter: 1.0.10(bufferutil@4.0.9)(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10))(utf-8-validate@5.0.10) + solidity-coverage: 0.8.15(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)) + ts-node: 10.9.2(@types/node@20.17.32)(typescript@5.8.3) + typechain: 8.3.2(typescript@5.8.3) + typescript: 5.8.3 + + '@nomicfoundation/hardhat-verify@2.0.13(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10))': + dependencies: + '@ethersproject/abi': 5.8.0 + '@ethersproject/address': 5.8.0 + cbor: 8.1.0 + debug: 4.4.0(supports-color@9.4.0) + hardhat: 2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10) + lodash.clonedeep: 4.5.0 + picocolors: 1.1.1 + semver: 6.3.1 + table: 6.9.0 + undici: 5.29.0 + transitivePeerDependencies: + - supports-color + + '@nomicfoundation/hardhat-verify@2.0.13(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@8.10.2(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10))': + dependencies: + '@ethersproject/abi': 5.8.0 + '@ethersproject/address': 5.8.0 + cbor: 8.1.0 + debug: 4.4.0(supports-color@9.4.0) + hardhat: 2.23.0(bufferutil@4.0.9)(ts-node@8.10.2(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10) + lodash.clonedeep: 4.5.0 + picocolors: 1.1.1 + semver: 6.3.1 + table: 6.9.0 + undici: 5.29.0 + transitivePeerDependencies: + - supports-color + + '@nomicfoundation/ignition-core@0.15.11(bufferutil@4.0.9)(utf-8-validate@5.0.10)': + dependencies: + '@ethersproject/address': 5.6.1 + '@nomicfoundation/solidity-analyzer': 0.1.2 + cbor: 9.0.2 + debug: 4.4.0(supports-color@9.4.0) + ethers: 6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10) + fs-extra: 10.1.0 + immer: 10.0.2 + lodash: 4.17.21 + ndjson: 2.0.0 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + + '@nomicfoundation/ignition-ui@0.15.11': {} + + '@nomicfoundation/slang@0.18.3': + dependencies: + '@bytecodealliance/preview2-shim': 0.17.0 + + '@nomicfoundation/solidity-analyzer-darwin-arm64@0.1.2': + optional: true + + '@nomicfoundation/solidity-analyzer-darwin-x64@0.1.2': + optional: true + + '@nomicfoundation/solidity-analyzer-linux-arm64-gnu@0.1.2': + optional: true + + '@nomicfoundation/solidity-analyzer-linux-arm64-musl@0.1.2': + optional: true + + '@nomicfoundation/solidity-analyzer-linux-x64-gnu@0.1.2': + optional: true + + '@nomicfoundation/solidity-analyzer-linux-x64-musl@0.1.2': + optional: true + + '@nomicfoundation/solidity-analyzer-win32-x64-msvc@0.1.2': + optional: true + + '@nomicfoundation/solidity-analyzer@0.1.2': + optionalDependencies: + '@nomicfoundation/solidity-analyzer-darwin-arm64': 0.1.2 + '@nomicfoundation/solidity-analyzer-darwin-x64': 0.1.2 + '@nomicfoundation/solidity-analyzer-linux-arm64-gnu': 0.1.2 + '@nomicfoundation/solidity-analyzer-linux-arm64-musl': 0.1.2 + '@nomicfoundation/solidity-analyzer-linux-x64-gnu': 0.1.2 + '@nomicfoundation/solidity-analyzer-linux-x64-musl': 0.1.2 + '@nomicfoundation/solidity-analyzer-win32-x64-msvc': 0.1.2 + + '@nomiclabs/hardhat-ethers@2.2.3(ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@17.0.45)(typescript@4.9.5))(typescript@4.9.5)(utf-8-validate@5.0.10))': + dependencies: + ethers: 5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + hardhat: 2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@17.0.45)(typescript@4.9.5))(typescript@4.9.5)(utf-8-validate@5.0.10) + + '@nomiclabs/hardhat-ethers@2.2.3(ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10))': + dependencies: + ethers: 5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + hardhat: 2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10) + + '@nomiclabs/hardhat-ethers@2.2.3(ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10))': + dependencies: + ethers: 5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + hardhat: 2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10) + + '@nomiclabs/hardhat-etherscan@3.1.8(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@17.0.45)(typescript@4.9.5))(typescript@4.9.5)(utf-8-validate@5.0.10))': + dependencies: + '@ethersproject/abi': 5.8.0 + '@ethersproject/address': 5.8.0 + cbor: 8.1.0 + chalk: 2.4.2 + debug: 4.4.0(supports-color@9.4.0) + fs-extra: 7.0.1 + hardhat: 2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@17.0.45)(typescript@4.9.5))(typescript@4.9.5)(utf-8-validate@5.0.10) + lodash: 4.17.21 + semver: 6.3.1 + table: 6.9.0 + undici: 5.29.0 + transitivePeerDependencies: + - supports-color + + '@nomiclabs/hardhat-etherscan@3.1.8(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10))': + dependencies: + '@ethersproject/abi': 5.8.0 + '@ethersproject/address': 5.8.0 + cbor: 8.1.0 + chalk: 2.4.2 + debug: 4.4.0(supports-color@9.4.0) + fs-extra: 7.0.1 + hardhat: 2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10) + lodash: 4.17.21 + semver: 6.3.1 + table: 6.9.0 + undici: 5.29.0 + transitivePeerDependencies: + - supports-color + + '@nomiclabs/hardhat-etherscan@3.1.8(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10))': + dependencies: + '@ethersproject/abi': 5.8.0 + '@ethersproject/address': 5.8.0 + cbor: 8.1.0 + chalk: 2.4.2 + debug: 4.4.0(supports-color@9.4.0) + fs-extra: 7.0.1 + hardhat: 2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10) + lodash: 4.17.21 + semver: 6.3.1 + table: 6.9.0 + undici: 5.29.0 + transitivePeerDependencies: + - supports-color + + '@nomiclabs/hardhat-waffle@2.0.3(@nomiclabs/hardhat-ethers@2.2.3(ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@17.0.45)(typescript@4.9.5))(typescript@4.9.5)(utf-8-validate@5.0.10)))(ethereum-waffle@3.4.4(bufferutil@4.0.9)(encoding@0.1.13)(typescript@4.9.5)(utf-8-validate@5.0.10))(ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@17.0.45)(typescript@4.9.5))(typescript@4.9.5)(utf-8-validate@5.0.10))': + dependencies: + '@nomiclabs/hardhat-ethers': 2.2.3(ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@17.0.45)(typescript@4.9.5))(typescript@4.9.5)(utf-8-validate@5.0.10)) + '@types/sinon-chai': 3.2.12 + '@types/web3': 1.0.19 + ethereum-waffle: 3.4.4(bufferutil@4.0.9)(encoding@0.1.13)(typescript@4.9.5)(utf-8-validate@5.0.10) + ethers: 5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + hardhat: 2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@17.0.45)(typescript@4.9.5))(typescript@4.9.5)(utf-8-validate@5.0.10) + + '@nomiclabs/hardhat-waffle@2.0.3(@nomiclabs/hardhat-ethers@2.2.3(ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)))(ethereum-waffle@3.4.4(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.8.3)(utf-8-validate@5.0.10))(ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10))': + dependencies: + '@nomiclabs/hardhat-ethers': 2.2.3(ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)) + '@types/sinon-chai': 3.2.12 + '@types/web3': 1.0.19 + ethereum-waffle: 3.4.4(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.8.3)(utf-8-validate@5.0.10) + ethers: 5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + hardhat: 2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10) + + '@nomiclabs/hardhat-waffle@2.0.3(@nomiclabs/hardhat-ethers@2.2.3(ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)))(ethereum-waffle@3.4.4(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.8.3)(utf-8-validate@5.0.10))(ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10))': + dependencies: + '@nomiclabs/hardhat-ethers': 2.2.3(ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)) + '@types/sinon-chai': 3.2.12 + '@types/web3': 1.0.19 + ethereum-waffle: 3.4.4(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.8.3)(utf-8-validate@5.0.10) + ethers: 5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + hardhat: 2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10) + + '@openzeppelin/contracts-upgradeable@3.4.2': {} + + '@openzeppelin/contracts-upgradeable@5.3.0(@openzeppelin/contracts@5.3.0)': + dependencies: + '@openzeppelin/contracts': 5.3.0 + + '@openzeppelin/contracts@3.4.2': {} + + '@openzeppelin/contracts@4.9.6': {} + + '@openzeppelin/contracts@5.3.0': {} + + '@openzeppelin/defender-admin-client@1.54.6(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10)': + dependencies: + '@openzeppelin/defender-base-client': 1.54.6(debug@4.4.0)(encoding@0.1.13) + axios: 1.9.0(debug@4.4.0) + ethers: 5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + lodash: 4.17.21 + node-fetch: 2.7.0(encoding@0.1.13) + transitivePeerDependencies: + - bufferutil + - debug + - encoding + - utf-8-validate + + '@openzeppelin/defender-base-client@1.54.6(debug@4.4.0)(encoding@0.1.13)': + dependencies: + amazon-cognito-identity-js: 6.3.15(encoding@0.1.13) + async-retry: 1.3.3 + axios: 1.9.0(debug@4.4.0) + lodash: 4.17.21 + node-fetch: 2.7.0(encoding@0.1.13) + transitivePeerDependencies: + - debug + - encoding + + '@openzeppelin/hardhat-defender@1.9.0(@nomiclabs/hardhat-ethers@2.2.3(ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)))(@nomiclabs/hardhat-etherscan@3.1.8(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)))(bufferutil@4.0.9)(encoding@0.1.13)(ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10))(utf-8-validate@5.0.10)': + dependencies: + '@openzeppelin/defender-admin-client': 1.54.6(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10) + '@openzeppelin/defender-base-client': 1.54.6(debug@4.4.0)(encoding@0.1.13) + '@openzeppelin/hardhat-upgrades': 1.28.0(@nomiclabs/hardhat-ethers@2.2.3(ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)))(@nomiclabs/hardhat-etherscan@3.1.8(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)))(encoding@0.1.13)(ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)) + ethereumjs-util: 7.1.5 + transitivePeerDependencies: + - '@nomiclabs/hardhat-ethers' + - '@nomiclabs/hardhat-etherscan' + - '@nomiclabs/harhdat-etherscan' + - bufferutil + - debug + - encoding + - ethers + - hardhat + - supports-color + - utf-8-validate + + '@openzeppelin/hardhat-upgrades@1.28.0(@nomiclabs/hardhat-ethers@2.2.3(ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@17.0.45)(typescript@4.9.5))(typescript@4.9.5)(utf-8-validate@5.0.10)))(@nomiclabs/hardhat-etherscan@3.1.8(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@17.0.45)(typescript@4.9.5))(typescript@4.9.5)(utf-8-validate@5.0.10)))(encoding@0.1.13)(ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@17.0.45)(typescript@4.9.5))(typescript@4.9.5)(utf-8-validate@5.0.10))': + dependencies: + '@nomiclabs/hardhat-ethers': 2.2.3(ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@17.0.45)(typescript@4.9.5))(typescript@4.9.5)(utf-8-validate@5.0.10)) + '@nomiclabs/hardhat-etherscan': 3.1.8(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@17.0.45)(typescript@4.9.5))(typescript@4.9.5)(utf-8-validate@5.0.10)) + '@openzeppelin/defender-base-client': 1.54.6(debug@4.4.0)(encoding@0.1.13) + '@openzeppelin/platform-deploy-client': 0.8.0(debug@4.4.0)(encoding@0.1.13) + '@openzeppelin/upgrades-core': 1.44.0 + chalk: 4.1.2 + debug: 4.4.0(supports-color@9.4.0) + ethers: 5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + hardhat: 2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@17.0.45)(typescript@4.9.5))(typescript@4.9.5)(utf-8-validate@5.0.10) + proper-lockfile: 4.1.2 + transitivePeerDependencies: + - encoding + - supports-color + + '@openzeppelin/hardhat-upgrades@1.28.0(@nomiclabs/hardhat-ethers@2.2.3(ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)))(@nomiclabs/hardhat-etherscan@3.1.8(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)))(encoding@0.1.13)(ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10))': + dependencies: + '@nomiclabs/hardhat-ethers': 2.2.3(ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)) + '@nomiclabs/hardhat-etherscan': 3.1.8(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)) + '@openzeppelin/defender-base-client': 1.54.6(debug@4.4.0)(encoding@0.1.13) + '@openzeppelin/platform-deploy-client': 0.8.0(debug@4.4.0)(encoding@0.1.13) + '@openzeppelin/upgrades-core': 1.44.0 + chalk: 4.1.2 + debug: 4.4.0(supports-color@9.4.0) + ethers: 5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + hardhat: 2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10) + proper-lockfile: 4.1.2 + transitivePeerDependencies: + - encoding + - supports-color + + '@openzeppelin/hardhat-upgrades@1.28.0(@nomiclabs/hardhat-ethers@2.2.3(ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)))(@nomiclabs/hardhat-etherscan@3.1.8(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)))(encoding@0.1.13)(ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10))': + dependencies: + '@nomiclabs/hardhat-ethers': 2.2.3(ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)) + '@nomiclabs/hardhat-etherscan': 3.1.8(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)) + '@openzeppelin/defender-base-client': 1.54.6(debug@4.4.0)(encoding@0.1.13) + '@openzeppelin/platform-deploy-client': 0.8.0(debug@4.4.0)(encoding@0.1.13) + '@openzeppelin/upgrades-core': 1.44.0 + chalk: 4.1.2 + debug: 4.4.0(supports-color@9.4.0) + ethers: 5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + hardhat: 2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10) + proper-lockfile: 4.1.2 + transitivePeerDependencies: + - encoding + - supports-color + + '@openzeppelin/platform-deploy-client@0.8.0(debug@4.4.0)(encoding@0.1.13)': + dependencies: + '@ethersproject/abi': 5.8.0 + '@openzeppelin/defender-base-client': 1.54.6(debug@4.4.0)(encoding@0.1.13) + axios: 0.21.4(debug@4.4.0) + lodash: 4.17.21 + node-fetch: 2.7.0(encoding@0.1.13) + transitivePeerDependencies: + - debug + - encoding + + '@openzeppelin/upgrades-core@1.44.0': + dependencies: + '@nomicfoundation/slang': 0.18.3 + bignumber.js: 9.1.2 + cbor: 10.0.3 + chalk: 4.1.2 + compare-versions: 6.1.1 + debug: 4.4.0(supports-color@9.4.0) + ethereumjs-util: 7.1.5 + minimatch: 9.0.5 + minimist: 1.2.8 + proper-lockfile: 4.1.2 + solidity-ast: 0.4.60 + transitivePeerDependencies: + - supports-color + + '@peculiar/asn1-schema@2.3.15': + dependencies: + asn1js: 3.0.6 + pvtsutils: 1.3.6 + tslib: 2.8.1 + + '@peculiar/json-schema@1.1.12': + dependencies: + tslib: 2.8.1 + + '@peculiar/webcrypto@1.5.0': + dependencies: + '@peculiar/asn1-schema': 2.3.15 + '@peculiar/json-schema': 1.1.12 + pvtsutils: 1.3.6 + tslib: 2.8.1 + webcrypto-core: 1.8.1 + + '@pkgjs/parseargs@0.11.0': + optional: true + + '@pnpm/config.env-replace@1.1.0': {} + + '@pnpm/network.ca-file@1.0.2': + dependencies: + graceful-fs: 4.2.10 + + '@pnpm/npm-conf@2.3.1': + dependencies: + '@pnpm/config.env-replace': 1.1.0 + '@pnpm/network.ca-file': 1.0.2 + config-chain: 1.1.13 + + '@prettier/sync@0.3.0(prettier@3.5.3)': + dependencies: + prettier: 3.5.3 + + '@react-native/assets-registry@0.79.2': {} + + '@react-native/codegen@0.79.2(@babel/core@7.27.1)': + dependencies: + '@babel/core': 7.27.1 + glob: 7.2.3 + hermes-parser: 0.25.1 + invariant: 2.2.4 + nullthrows: 1.1.1 + yargs: 17.7.2 + + '@react-native/community-cli-plugin@0.79.2(bufferutil@4.0.9)(utf-8-validate@5.0.10)': + dependencies: + '@react-native/dev-middleware': 0.79.2(bufferutil@4.0.9)(utf-8-validate@5.0.10) + chalk: 4.1.2 + debug: 2.6.9 + invariant: 2.2.4 + metro: 0.82.2(bufferutil@4.0.9)(utf-8-validate@5.0.10) + metro-config: 0.82.2(bufferutil@4.0.9)(utf-8-validate@5.0.10) + metro-core: 0.82.2 + semver: 7.7.1 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + + '@react-native/debugger-frontend@0.79.2': {} + + '@react-native/dev-middleware@0.79.2(bufferutil@4.0.9)(utf-8-validate@5.0.10)': + dependencies: + '@isaacs/ttlcache': 1.4.1 + '@react-native/debugger-frontend': 0.79.2 + chrome-launcher: 0.15.2 + chromium-edge-launcher: 0.2.0 + connect: 3.7.0 + debug: 2.6.9 + invariant: 2.2.4 + nullthrows: 1.1.1 + open: 7.4.2 + serve-static: 1.16.2 + ws: 6.2.3(bufferutil@4.0.9)(utf-8-validate@5.0.10) + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + + '@react-native/gradle-plugin@0.79.2': {} + + '@react-native/js-polyfills@0.79.2': {} + + '@react-native/normalize-colors@0.79.2': {} + + '@react-native/virtualized-lists@0.79.2(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10))(react@19.1.0)': + dependencies: + invariant: 2.2.4 + nullthrows: 1.1.1 + react: 19.1.0 + react-native: 0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10) + + '@repeaterjs/repeater@3.0.4': {} + + '@repeaterjs/repeater@3.0.6': {} + + '@resolver-engine/core@0.2.1': + dependencies: + debug: 3.2.7 + request: 2.88.2 + transitivePeerDependencies: + - supports-color + + '@resolver-engine/core@0.3.3': + dependencies: + debug: 3.2.7 + is-url: 1.2.4 + request: 2.88.2 + transitivePeerDependencies: + - supports-color + + '@resolver-engine/fs@0.2.1': + dependencies: + '@resolver-engine/core': 0.2.1 + debug: 3.2.7 + transitivePeerDependencies: + - supports-color + + '@resolver-engine/fs@0.3.3': + dependencies: + '@resolver-engine/core': 0.3.3 + debug: 3.2.7 + transitivePeerDependencies: + - supports-color + + '@resolver-engine/imports-fs@0.2.2': + dependencies: + '@resolver-engine/fs': 0.2.1 + '@resolver-engine/imports': 0.2.2 + debug: 3.2.7 + transitivePeerDependencies: + - supports-color + + '@resolver-engine/imports-fs@0.3.3': + dependencies: + '@resolver-engine/fs': 0.3.3 + '@resolver-engine/imports': 0.3.3 + debug: 3.2.7 + transitivePeerDependencies: + - supports-color + + '@resolver-engine/imports@0.2.2': + dependencies: + '@resolver-engine/core': 0.2.1 + debug: 3.2.7 + hosted-git-info: 2.8.9 + transitivePeerDependencies: + - supports-color + + '@resolver-engine/imports@0.3.3': + dependencies: + '@resolver-engine/core': 0.3.3 + debug: 3.2.7 + hosted-git-info: 2.8.9 + path-browserify: 1.0.1 + url: 0.11.4 + transitivePeerDependencies: + - supports-color + + '@scure/base@1.1.9': {} + + '@scure/base@1.2.5': {} + + '@scure/bip32@1.1.5': + dependencies: + '@noble/hashes': 1.2.0 + '@noble/secp256k1': 1.7.1 + '@scure/base': 1.1.9 + + '@scure/bip32@1.4.0': + dependencies: + '@noble/curves': 1.4.2 + '@noble/hashes': 1.4.0 + '@scure/base': 1.1.9 + + '@scure/bip39@1.1.1': + dependencies: + '@noble/hashes': 1.2.0 + '@scure/base': 1.1.9 + + '@scure/bip39@1.3.0': + dependencies: + '@noble/hashes': 1.4.0 + '@scure/base': 1.1.9 + + '@sentry/core@5.30.0': + dependencies: + '@sentry/hub': 5.30.0 + '@sentry/minimal': 5.30.0 + '@sentry/types': 5.30.0 + '@sentry/utils': 5.30.0 + tslib: 1.14.1 + + '@sentry/hub@5.30.0': + dependencies: + '@sentry/types': 5.30.0 + '@sentry/utils': 5.30.0 + tslib: 1.14.1 + + '@sentry/minimal@5.30.0': + dependencies: + '@sentry/hub': 5.30.0 + '@sentry/types': 5.30.0 + tslib: 1.14.1 + + '@sentry/node@5.30.0': + dependencies: + '@sentry/core': 5.30.0 + '@sentry/hub': 5.30.0 + '@sentry/tracing': 5.30.0 + '@sentry/types': 5.30.0 + '@sentry/utils': 5.30.0 + cookie: 0.4.2 + https-proxy-agent: 5.0.1 + lru_map: 0.3.3 + tslib: 1.14.1 + transitivePeerDependencies: + - supports-color + + '@sentry/tracing@5.30.0': + dependencies: + '@sentry/hub': 5.30.0 + '@sentry/minimal': 5.30.0 + '@sentry/types': 5.30.0 + '@sentry/utils': 5.30.0 + tslib: 1.14.1 + + '@sentry/types@5.30.0': {} + + '@sentry/utils@5.30.0': + dependencies: + '@sentry/types': 5.30.0 + tslib: 1.14.1 + + '@sinclair/typebox@0.27.8': {} + + '@sindresorhus/is@0.14.0': {} + + '@sindresorhus/is@4.6.0': {} + + '@sindresorhus/is@5.6.0': {} + + '@sinonjs/commons@3.0.1': + dependencies: + type-detect: 4.0.8 + + '@sinonjs/fake-timers@10.3.0': + dependencies: + '@sinonjs/commons': 3.0.1 + + '@smithy/types@4.2.0': + dependencies: + tslib: 2.8.1 + + '@solidity-parser/parser@0.14.5': + dependencies: + antlr4ts: 0.5.0-alpha.4 + + '@solidity-parser/parser@0.16.2': + dependencies: + antlr4ts: 0.5.0-alpha.4 + + '@solidity-parser/parser@0.18.0': {} + + '@solidity-parser/parser@0.19.0': {} + + '@solidity-parser/parser@0.20.1': {} + + '@stylistic/eslint-plugin-js@1.8.1(eslint@8.57.1)': + dependencies: + '@types/eslint': 8.56.12 + acorn: 8.14.1 + escape-string-regexp: 4.0.0 + eslint: 8.57.1 + eslint-visitor-keys: 3.4.3 + espree: 9.6.1 + + '@stylistic/eslint-plugin-jsx@1.8.1(eslint@8.57.1)': + dependencies: + '@stylistic/eslint-plugin-js': 1.8.1(eslint@8.57.1) + '@types/eslint': 8.56.12 + eslint: 8.57.1 + estraverse: 5.3.0 + picomatch: 4.0.2 + + '@stylistic/eslint-plugin-plus@1.8.1(eslint@8.57.1)(typescript@5.8.3)': + dependencies: + '@types/eslint': 8.56.12 + '@typescript-eslint/utils': 6.21.0(eslint@8.57.1)(typescript@5.8.3) + eslint: 8.57.1 + transitivePeerDependencies: + - supports-color + - typescript + + '@stylistic/eslint-plugin-ts@1.8.1(eslint@8.57.1)(typescript@5.8.3)': + dependencies: + '@stylistic/eslint-plugin-js': 1.8.1(eslint@8.57.1) + '@types/eslint': 8.56.12 + '@typescript-eslint/utils': 6.21.0(eslint@8.57.1)(typescript@5.8.3) + eslint: 8.57.1 + transitivePeerDependencies: + - supports-color + - typescript + + '@stylistic/eslint-plugin@1.8.1(eslint@8.57.1)(typescript@5.8.3)': + dependencies: + '@stylistic/eslint-plugin-js': 1.8.1(eslint@8.57.1) + '@stylistic/eslint-plugin-jsx': 1.8.1(eslint@8.57.1) + '@stylistic/eslint-plugin-plus': 1.8.1(eslint@8.57.1)(typescript@5.8.3) + '@stylistic/eslint-plugin-ts': 1.8.1(eslint@8.57.1)(typescript@5.8.3) + '@types/eslint': 8.56.12 + eslint: 8.57.1 + transitivePeerDependencies: + - supports-color + - typescript + + '@szmarczak/http-timer@1.1.2': + dependencies: + defer-to-connect: 1.1.3 + + '@szmarczak/http-timer@4.0.6': + dependencies: + defer-to-connect: 2.0.1 + + '@szmarczak/http-timer@5.0.1': + dependencies: + defer-to-connect: 2.0.1 + + '@tenderly/api-client@1.1.0(ts-node@10.9.2(@types/node@17.0.45)(typescript@4.9.5))(typescript@4.9.5)': + dependencies: + axios: 0.27.2 + cli-table3: 0.6.5 + commander: 9.5.0 + dotenv: 16.5.0 + js-yaml: 4.1.0 + open: 8.4.2 + prompts: 2.4.2 + tslog: 4.9.3 + optionalDependencies: + ts-node: 10.9.2(@types/node@17.0.45)(typescript@4.9.5) + typescript: 4.9.5 + transitivePeerDependencies: + - debug + + '@tenderly/hardhat-tenderly@1.0.13(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@17.0.45)(typescript@4.9.5))(typescript@4.9.5)(utf-8-validate@5.0.10))': + dependencies: + axios: 0.21.4(debug@4.4.0) + fs-extra: 9.1.0 + hardhat: 2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@17.0.45)(typescript@4.9.5))(typescript@4.9.5)(utf-8-validate@5.0.10) + js-yaml: 3.14.1 + transitivePeerDependencies: + - debug + + '@tenderly/hardhat-tenderly@1.0.13(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10))': + dependencies: + axios: 0.21.4(debug@4.4.0) + fs-extra: 9.1.0 + hardhat: 2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10) + js-yaml: 3.14.1 + transitivePeerDependencies: + - debug + + '@truffle/error@0.1.1': {} + + '@truffle/interface-adapter@0.5.37(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10)': + dependencies: + bn.js: 5.2.2 + ethers: 4.0.49 + web3: 1.10.0(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10) + transitivePeerDependencies: + - bufferutil + - encoding + - supports-color + - utf-8-validate + + '@truffle/provider@0.2.64(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10)': + dependencies: + '@truffle/error': 0.1.1 + '@truffle/interface-adapter': 0.5.37(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10) + debug: 4.4.0(supports-color@9.4.0) + web3: 1.7.4(bufferutil@4.0.9)(utf-8-validate@5.0.10) + transitivePeerDependencies: + - bufferutil + - encoding + - supports-color + - utf-8-validate + + '@tsconfig/node10@1.0.11': {} + + '@tsconfig/node12@1.0.11': {} + + '@tsconfig/node14@1.0.3': {} + + '@tsconfig/node16@1.0.4': {} + + '@typechain/ethers-v5@2.0.0(ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(typechain@3.0.0(typescript@4.9.5))': + dependencies: + ethers: 5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + typechain: 3.0.0(typescript@4.9.5) + + '@typechain/ethers-v5@2.0.0(ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(typechain@3.0.0(typescript@5.8.3))': + dependencies: + ethers: 5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + typechain: 3.0.0(typescript@5.8.3) + + '@typechain/ethers-v5@7.2.0(@ethersproject/abi@5.8.0)(@ethersproject/bytes@5.8.0)(@ethersproject/providers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(typechain@5.2.0(typescript@5.8.3))(typescript@5.8.3)': + dependencies: + '@ethersproject/abi': 5.8.0 + '@ethersproject/bytes': 5.8.0 + '@ethersproject/providers': 5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + ethers: 5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + lodash: 4.17.21 + ts-essentials: 7.0.3(typescript@5.8.3) + typechain: 5.2.0(typescript@5.8.3) + typescript: 5.8.3 + + '@typechain/ethers-v5@9.0.0(@ethersproject/abi@5.8.0)(@ethersproject/bytes@5.8.0)(@ethersproject/providers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(typechain@7.0.1(typescript@4.9.5))(typescript@4.9.5)': + dependencies: + '@ethersproject/abi': 5.8.0 + '@ethersproject/bytes': 5.8.0 + '@ethersproject/providers': 5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + ethers: 5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + lodash: 4.17.21 + ts-essentials: 7.0.3(typescript@4.9.5) + typechain: 7.0.1(typescript@4.9.5) + typescript: 4.9.5 + + '@typechain/ethers-v6@0.5.1(ethers@6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10))(typechain@8.3.2(typescript@5.8.3))(typescript@5.8.3)': + dependencies: + ethers: 6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10) + lodash: 4.17.21 + ts-essentials: 7.0.3(typescript@5.8.3) + typechain: 8.3.2(typescript@5.8.3) + typescript: 5.8.3 + + '@typechain/hardhat@2.3.1(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10))(lodash@4.17.21)(typechain@5.2.0(typescript@5.8.3))': + dependencies: + fs-extra: 9.1.0 + hardhat: 2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10) + lodash: 4.17.21 + typechain: 5.2.0(typescript@5.8.3) + + '@typechain/hardhat@2.3.1(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10))(lodash@4.17.21)(typechain@5.2.0(typescript@5.8.3))': + dependencies: + fs-extra: 9.1.0 + hardhat: 2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10) + lodash: 4.17.21 + typechain: 5.2.0(typescript@5.8.3) + + '@typechain/hardhat@4.0.0(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@17.0.45)(typescript@4.9.5))(typescript@4.9.5)(utf-8-validate@5.0.10))(lodash@4.17.21)(typechain@7.0.1(typescript@4.9.5))': + dependencies: + fs-extra: 9.1.0 + hardhat: 2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@17.0.45)(typescript@4.9.5))(typescript@4.9.5)(utf-8-validate@5.0.10) + lodash: 4.17.21 + typechain: 7.0.1(typescript@4.9.5) + + '@typechain/hardhat@9.1.0(@typechain/ethers-v6@0.5.1(ethers@6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10))(typechain@8.3.2(typescript@5.8.3))(typescript@5.8.3))(ethers@6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10))(typechain@8.3.2(typescript@5.8.3))': + dependencies: + '@typechain/ethers-v6': 0.5.1(ethers@6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10))(typechain@8.3.2(typescript@5.8.3))(typescript@5.8.3) + ethers: 6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10) + fs-extra: 9.1.0 + hardhat: 2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10) + typechain: 8.3.2(typescript@5.8.3) + + '@types/async-eventemitter@0.2.4': + dependencies: + '@types/events': 3.0.3 + + '@types/babel__core@7.20.5': + dependencies: + '@babel/parser': 7.27.1 + '@babel/types': 7.27.1 + '@types/babel__generator': 7.27.0 + '@types/babel__template': 7.4.4 + '@types/babel__traverse': 7.20.7 + + '@types/babel__generator@7.27.0': + dependencies: + '@babel/types': 7.27.1 + + '@types/babel__template@7.4.4': + dependencies: + '@babel/parser': 7.27.1 + '@babel/types': 7.27.1 + + '@types/babel__traverse@7.20.7': + dependencies: + '@babel/types': 7.27.1 + + '@types/bn.js@4.11.6': + dependencies: + '@types/node': 20.17.32 + + '@types/bn.js@5.1.6': + dependencies: + '@types/node': 20.17.32 + + '@types/bs58@4.0.4': + dependencies: + '@types/node': 20.17.32 + base-x: 3.0.11 + + '@types/cacheable-request@6.0.3': + dependencies: + '@types/http-cache-semantics': 4.0.4 + '@types/keyv': 3.1.4 + '@types/node': 20.17.32 + '@types/responselike': 1.0.3 + + '@types/chai-as-promised@7.1.8': + dependencies: + '@types/chai': 4.3.20 + + '@types/chai@4.3.20': {} + + '@types/chai@4.3.4': {} + + '@types/concat-stream@1.6.1': + dependencies: + '@types/node': 20.17.32 + + '@types/debug@4.1.12': + dependencies: + '@types/ms': 2.1.0 + + '@types/eslint@8.56.12': + dependencies: + '@types/estree': 1.0.7 + '@types/json-schema': 7.0.15 + + '@types/eslint@9.6.1': + dependencies: + '@types/estree': 1.0.7 + '@types/json-schema': 7.0.15 + + '@types/eslint__js@8.42.3': + dependencies: + '@types/eslint': 9.6.1 + + '@types/estree@1.0.7': {} + + '@types/events@3.0.3': {} + + '@types/form-data@0.0.33': + dependencies: + '@types/node': 20.17.32 + + '@types/glob@7.2.0': + dependencies: + '@types/minimatch': 5.1.2 + '@types/node': 20.17.32 + + '@types/graceful-fs@4.1.9': + dependencies: + '@types/node': 20.17.32 + + '@types/http-cache-semantics@4.0.4': {} + + '@types/inquirer@7.3.3': + dependencies: + '@types/through': 0.0.33 + rxjs: 6.6.7 + + '@types/istanbul-lib-coverage@2.0.6': {} + + '@types/istanbul-lib-report@3.0.3': + dependencies: + '@types/istanbul-lib-coverage': 2.0.6 + + '@types/istanbul-reports@3.0.4': + dependencies: + '@types/istanbul-lib-report': 3.0.3 + + '@types/json-schema@7.0.15': {} + + '@types/json5@2.2.0': + dependencies: + json5: 2.2.3 + + '@types/keyv@3.1.4': + dependencies: + '@types/node': 20.17.32 + + '@types/lru-cache@5.1.1': {} + + '@types/minimatch@5.1.2': {} + + '@types/minimist@1.2.5': {} + + '@types/mkdirp@0.5.2': + dependencies: + '@types/node': 20.17.32 + + '@types/mocha@10.0.10': {} + + '@types/mocha@8.2.3': {} + + '@types/mocha@9.1.1': {} + + '@types/ms@2.1.0': {} + + '@types/node-fetch@2.6.12': + dependencies: + '@types/node': 20.17.32 + form-data: 4.0.2 + + '@types/node@10.17.60': {} + + '@types/node@12.20.55': {} + + '@types/node@17.0.45': {} + + '@types/node@20.17.32': + dependencies: + undici-types: 6.19.8 + + '@types/node@22.7.5': + dependencies: + undici-types: 6.19.8 + + '@types/node@8.10.66': {} + + '@types/normalize-package-data@2.4.4': {} + + '@types/parse-json@4.0.2': {} + + '@types/pbkdf2@3.1.2': + dependencies: + '@types/node': 20.17.32 + + '@types/prettier@2.7.3': {} + + '@types/qs@6.9.18': {} + + '@types/readable-stream@2.3.15': + dependencies: + '@types/node': 20.17.32 + safe-buffer: 5.1.2 + + '@types/resolve@0.0.8': + dependencies: + '@types/node': 20.17.32 + + '@types/responselike@1.0.3': + dependencies: + '@types/node': 20.17.32 + + '@types/secp256k1@4.0.6': + dependencies: + '@types/node': 20.17.32 + + '@types/semver@7.7.0': {} + + '@types/sinon-chai@3.2.12': + dependencies: + '@types/chai': 4.3.20 + '@types/sinon': 17.0.4 + + '@types/sinon@17.0.4': + dependencies: + '@types/sinonjs__fake-timers': 8.1.5 + + '@types/sinonjs__fake-timers@8.1.5': {} + + '@types/stack-utils@2.0.3': {} + + '@types/through@0.0.33': + dependencies: + '@types/node': 20.17.32 + + '@types/triple-beam@1.3.5': {} + + '@types/underscore@1.13.0': {} + + '@types/validator@13.15.0': {} + + '@types/web3@1.0.19': + dependencies: + '@types/bn.js': 5.1.6 + '@types/underscore': 1.13.0 + + '@types/winston@2.4.4': + dependencies: + winston: 3.17.0 + + '@types/ws@8.18.1': + dependencies: + '@types/node': 20.17.32 + + '@types/yargs-parser@21.0.3': {} + + '@types/yargs@16.0.9': + dependencies: + '@types/yargs-parser': 21.0.3 + + '@types/yargs@17.0.33': + dependencies: + '@types/yargs-parser': 21.0.3 + + '@typescript-eslint/eslint-plugin@7.18.0(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.8.3))(eslint@8.57.1)(typescript@5.8.3)': + dependencies: + '@eslint-community/regexpp': 4.12.1 + '@typescript-eslint/parser': 7.18.0(eslint@8.57.1)(typescript@5.8.3) + '@typescript-eslint/scope-manager': 7.18.0 + '@typescript-eslint/type-utils': 7.18.0(eslint@8.57.1)(typescript@5.8.3) + '@typescript-eslint/utils': 7.18.0(eslint@8.57.1)(typescript@5.8.3) + '@typescript-eslint/visitor-keys': 7.18.0 + eslint: 8.57.1 + graphemer: 1.4.0 + ignore: 5.3.2 + natural-compare: 1.4.0 + ts-api-utils: 1.4.3(typescript@5.8.3) + optionalDependencies: + typescript: 5.8.3 + transitivePeerDependencies: + - supports-color + + '@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.8.3)': + dependencies: + '@typescript-eslint/scope-manager': 7.18.0 + '@typescript-eslint/types': 7.18.0 + '@typescript-eslint/typescript-estree': 7.18.0(typescript@5.8.3) + '@typescript-eslint/visitor-keys': 7.18.0 + debug: 4.4.0(supports-color@9.4.0) + eslint: 8.57.1 + optionalDependencies: + typescript: 5.8.3 + transitivePeerDependencies: + - supports-color + + '@typescript-eslint/scope-manager@6.21.0': + dependencies: + '@typescript-eslint/types': 6.21.0 + '@typescript-eslint/visitor-keys': 6.21.0 + + '@typescript-eslint/scope-manager@7.18.0': + dependencies: + '@typescript-eslint/types': 7.18.0 + '@typescript-eslint/visitor-keys': 7.18.0 + + '@typescript-eslint/type-utils@7.18.0(eslint@8.57.1)(typescript@5.8.3)': + dependencies: + '@typescript-eslint/typescript-estree': 7.18.0(typescript@5.8.3) + '@typescript-eslint/utils': 7.18.0(eslint@8.57.1)(typescript@5.8.3) + debug: 4.4.0(supports-color@9.4.0) + eslint: 8.57.1 + ts-api-utils: 1.4.3(typescript@5.8.3) + optionalDependencies: + typescript: 5.8.3 + transitivePeerDependencies: + - supports-color + + '@typescript-eslint/types@6.21.0': {} + + '@typescript-eslint/types@7.18.0': {} + + '@typescript-eslint/typescript-estree@6.21.0(typescript@5.8.3)': + dependencies: + '@typescript-eslint/types': 6.21.0 + '@typescript-eslint/visitor-keys': 6.21.0 + debug: 4.4.0(supports-color@9.4.0) + globby: 11.1.0 + is-glob: 4.0.3 + minimatch: 9.0.3 + semver: 7.7.1 + ts-api-utils: 1.4.3(typescript@5.8.3) + optionalDependencies: + typescript: 5.8.3 + transitivePeerDependencies: + - supports-color + + '@typescript-eslint/typescript-estree@7.18.0(typescript@5.8.3)': + dependencies: + '@typescript-eslint/types': 7.18.0 + '@typescript-eslint/visitor-keys': 7.18.0 + debug: 4.4.0(supports-color@9.4.0) + globby: 11.1.0 + is-glob: 4.0.3 + minimatch: 9.0.5 + semver: 7.7.1 + ts-api-utils: 1.4.3(typescript@5.8.3) + optionalDependencies: + typescript: 5.8.3 + transitivePeerDependencies: + - supports-color + + '@typescript-eslint/utils@6.21.0(eslint@8.57.1)(typescript@5.8.3)': + dependencies: + '@eslint-community/eslint-utils': 4.7.0(eslint@8.57.1) + '@types/json-schema': 7.0.15 + '@types/semver': 7.7.0 + '@typescript-eslint/scope-manager': 6.21.0 + '@typescript-eslint/types': 6.21.0 + '@typescript-eslint/typescript-estree': 6.21.0(typescript@5.8.3) + eslint: 8.57.1 + semver: 7.7.1 + transitivePeerDependencies: + - supports-color + - typescript + + '@typescript-eslint/utils@7.18.0(eslint@8.57.1)(typescript@5.8.3)': + dependencies: + '@eslint-community/eslint-utils': 4.7.0(eslint@8.57.1) + '@typescript-eslint/scope-manager': 7.18.0 + '@typescript-eslint/types': 7.18.0 + '@typescript-eslint/typescript-estree': 7.18.0(typescript@5.8.3) + eslint: 8.57.1 + transitivePeerDependencies: + - supports-color + - typescript + + '@typescript-eslint/visitor-keys@6.21.0': + dependencies: + '@typescript-eslint/types': 6.21.0 + eslint-visitor-keys: 3.4.3 + + '@typescript-eslint/visitor-keys@7.18.0': + dependencies: + '@typescript-eslint/types': 7.18.0 + eslint-visitor-keys: 3.4.3 + + '@ungap/structured-clone@1.3.0': {} + + '@urql/core@2.4.4(graphql@16.3.0)': + dependencies: + '@graphql-typed-document-node/core': 3.2.0(graphql@16.3.0) + graphql: 16.3.0 + wonka: 4.0.15 + + '@urql/core@2.6.1(graphql@16.3.0)': + dependencies: + '@graphql-typed-document-node/core': 3.2.0(graphql@16.3.0) + graphql: 16.3.0 + wonka: 4.0.15 + + '@urql/core@2.6.1(graphql@16.8.0)': + dependencies: + '@graphql-typed-document-node/core': 3.2.0(graphql@16.8.0) + graphql: 16.8.0 + wonka: 4.0.15 + + '@urql/core@3.1.0(graphql@16.8.0)': + dependencies: + graphql: 16.8.0 + wonka: 6.3.5 + + '@urql/exchange-execute@1.2.2(graphql@16.3.0)': + dependencies: + '@urql/core': 2.6.1(graphql@16.3.0) + graphql: 16.3.0 + wonka: 4.0.15 + + '@urql/exchange-execute@2.1.0(graphql@16.8.0)': + dependencies: + '@urql/core': 3.1.0(graphql@16.8.0) + graphql: 16.8.0 + wonka: 6.3.5 + + '@whatwg-node/cookie-store@0.0.1': + dependencies: + '@whatwg-node/events': 0.0.3 + tslib: 2.8.1 + + '@whatwg-node/events@0.0.2': {} + + '@whatwg-node/events@0.0.3': {} + + '@whatwg-node/fetch@0.8.8': + dependencies: + '@peculiar/webcrypto': 1.5.0 + '@whatwg-node/node-fetch': 0.3.6 + busboy: 1.6.0 + urlpattern-polyfill: 8.0.2 + web-streams-polyfill: 3.3.3 + + '@whatwg-node/node-fetch@0.3.6': + dependencies: + '@whatwg-node/events': 0.0.3 + busboy: 1.6.0 + fast-querystring: 1.1.2 + fast-url-parser: 1.1.3 + tslib: 2.8.1 + + '@whatwg-node/server@0.7.7': + dependencies: + '@whatwg-node/fetch': 0.8.8 + tslib: 2.8.1 + + '@yarnpkg/lockfile@1.1.0': {} + + '@zxing/text-encoding@0.9.0': + optional: true + + JSONStream@1.3.5: + dependencies: + jsonparse: 1.3.1 + through: 2.3.8 + + abbrev@1.0.9: {} + + abitype@0.7.1(typescript@5.8.3)(zod@3.24.4): + dependencies: + typescript: 5.8.3 + optionalDependencies: + zod: 3.24.4 + + abort-controller@3.0.0: + dependencies: + event-target-shim: 5.0.1 + + abortcontroller-polyfill@1.7.8: {} + + abstract-level@1.0.4: + dependencies: + buffer: 6.0.3 + catering: 2.1.1 + is-buffer: 2.0.5 + level-supports: 4.0.1 + level-transcoder: 1.0.1 + module-error: 1.0.2 + queue-microtask: 1.2.3 + + abstract-leveldown@2.6.3: + dependencies: + xtend: 4.0.2 + + abstract-leveldown@2.7.2: + dependencies: + xtend: 4.0.2 + + abstract-leveldown@3.0.0: + dependencies: + xtend: 4.0.2 + + abstract-leveldown@5.0.0: + dependencies: + xtend: 4.0.2 + + accepts@1.3.8: + dependencies: + mime-types: 2.1.35 + negotiator: 0.6.3 + + acorn-jsx@5.3.2(acorn@8.14.1): + dependencies: + acorn: 8.14.1 + + acorn-walk@8.3.4: + dependencies: + acorn: 8.14.1 + + acorn@8.14.1: {} + + address@1.2.2: {} + + adm-zip@0.4.16: {} + + aes-js@3.0.0: {} + + aes-js@3.1.2: + optional: true + + aes-js@4.0.0-beta.5: {} + + agent-base@6.0.2: + dependencies: + debug: 4.4.0(supports-color@9.4.0) + transitivePeerDependencies: + - supports-color + + agent-base@7.1.3: {} + + aggregate-error@3.1.0: + dependencies: + clean-stack: 2.2.0 + indent-string: 4.0.0 + + ajv-formats@2.1.1(ajv@8.17.1): + optionalDependencies: + ajv: 8.17.1 + + ajv@5.5.2: + dependencies: + co: 4.6.0 + fast-deep-equal: 1.1.0 + fast-json-stable-stringify: 2.1.0 + json-schema-traverse: 0.3.1 + + ajv@6.12.6: + dependencies: + fast-deep-equal: 3.1.3 + fast-json-stable-stringify: 2.1.0 + json-schema-traverse: 0.4.1 + uri-js: 4.4.1 + + ajv@8.17.1: + dependencies: + fast-deep-equal: 3.1.3 + fast-uri: 3.0.6 + json-schema-traverse: 1.0.0 + require-from-string: 2.0.2 + + amazon-cognito-identity-js@6.3.15(encoding@0.1.13): + dependencies: + '@aws-crypto/sha256-js': 1.2.2 + buffer: 4.9.2 + fast-base64-decode: 1.0.0 + isomorphic-unfetch: 3.1.0(encoding@0.1.13) + js-cookie: 2.2.1 + transitivePeerDependencies: + - encoding + + amdefine@1.0.1: + optional: true + + anser@1.4.10: {} + + ansi-align@3.0.1: + dependencies: + string-width: 4.2.3 + + ansi-colors@4.1.3: {} + + ansi-escapes@4.3.2: + dependencies: + type-fest: 0.21.3 + + ansi-escapes@7.0.0: + dependencies: + environment: 1.1.0 + + ansi-regex@2.1.1: {} + + ansi-regex@3.0.1: {} + + ansi-regex@4.1.1: {} + + ansi-regex@5.0.1: {} + + ansi-regex@6.1.0: {} + + ansi-styles@2.2.1: {} + + ansi-styles@3.2.1: + dependencies: + color-convert: 1.9.3 + + ansi-styles@4.3.0: + dependencies: + color-convert: 2.0.1 + + ansi-styles@5.2.0: {} + + ansi-styles@6.2.1: {} + + antlr4@4.13.2: {} + + antlr4ts@0.5.0-alpha.4: {} + + any-signal@1.2.0: + dependencies: + abort-controller: 3.0.0 + + anymatch@1.3.2: + dependencies: + micromatch: 2.3.11 + normalize-path: 2.1.1 + + anymatch@3.1.3: + dependencies: + normalize-path: 3.0.0 + picomatch: 2.3.1 + + aproba@1.2.0: + optional: true + + arbos-precompiles@1.0.2(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10): + dependencies: + hardhat: 2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10) + transitivePeerDependencies: + - bufferutil + - supports-color + - ts-node + - typescript + - utf-8-validate + + are-we-there-yet@1.1.7: + dependencies: + delegates: 1.0.0 + readable-stream: 2.3.8 + optional: true + + arg@4.1.3: {} + + argparse@1.0.10: + dependencies: + sprintf-js: 1.0.3 + + argparse@2.0.1: {} + + arr-diff@2.0.0: + dependencies: + arr-flatten: 1.1.0 + + arr-diff@4.0.0: {} + + arr-flatten@1.1.0: {} + + arr-union@3.1.0: {} + + array-back@1.0.4: + dependencies: + typical: 2.6.1 + + array-back@2.0.0: + dependencies: + typical: 2.6.1 + + array-back@3.1.0: {} + + array-back@4.0.2: {} + + array-buffer-byte-length@1.0.2: + dependencies: + call-bound: 1.0.4 + is-array-buffer: 3.0.5 + + array-flatten@1.1.1: {} + + array-ify@1.0.0: {} + + array-union@2.1.0: {} + + array-uniq@1.0.3: {} + + array-unique@0.2.1: {} + + array-unique@0.3.2: {} + + array.prototype.reduce@1.0.8: + dependencies: + call-bind: 1.0.8 + call-bound: 1.0.4 + define-properties: 1.2.1 + es-abstract: 1.23.9 + es-array-method-boxes-properly: 1.0.0 + es-errors: 1.3.0 + es-object-atoms: 1.1.1 + is-string: 1.1.1 + + arraybuffer.prototype.slice@1.0.4: + dependencies: + array-buffer-byte-length: 1.0.2 + call-bind: 1.0.8 + define-properties: 1.2.1 + es-abstract: 1.23.9 + es-errors: 1.3.0 + get-intrinsic: 1.3.0 + is-array-buffer: 3.0.5 + + arrify@1.0.1: {} + + asap@2.0.6: {} + + asn1.js@4.10.1: + dependencies: + bn.js: 4.12.2 + inherits: 2.0.4 + minimalistic-assert: 1.0.1 + + asn1@0.2.6: + dependencies: + safer-buffer: 2.1.2 + + asn1js@3.0.6: + dependencies: + pvtsutils: 1.3.6 + pvutils: 1.1.3 + tslib: 2.8.1 + + assert-plus@1.0.0: {} + + assertion-error@1.1.0: {} + + assign-symbols@1.0.0: {} + + ast-parents@0.0.1: {} + + astral-regex@2.0.0: {} + + async-each@1.0.6: {} + + async-eventemitter@0.2.4: + dependencies: + async: 2.6.4 + + async-function@1.0.0: {} + + async-limiter@1.0.1: {} + + async-mutex@0.4.1: + dependencies: + tslib: 2.8.1 + + async-retry@1.3.3: + dependencies: + retry: 0.13.1 + + async@1.5.2: {} + + async@2.6.2: + dependencies: + lodash: 4.17.21 + + async@2.6.4: + dependencies: + lodash: 4.17.21 + + async@3.2.6: {} + + asynckit@0.4.0: {} + + at-least-node@1.0.0: {} + + atob@2.1.2: {} + + atomic-sleep@1.0.0: {} + + auto-bind@4.0.0: {} + + available-typed-arrays@1.0.7: + dependencies: + possible-typed-array-names: 1.1.0 + + aws-sign2@0.7.0: {} + + aws4@1.13.2: {} + + axios@0.21.4(debug@4.4.0): + dependencies: + follow-redirects: 1.15.9(debug@4.4.0) + transitivePeerDependencies: + - debug + + axios@0.27.2: + dependencies: + follow-redirects: 1.15.9(debug@4.4.0) + form-data: 4.0.2 + transitivePeerDependencies: + - debug + + axios@1.9.0(debug@4.4.0): + dependencies: + follow-redirects: 1.15.9(debug@4.4.0) + form-data: 4.0.2 + proxy-from-env: 1.1.0 + transitivePeerDependencies: + - debug + + babel-code-frame@6.26.0: + dependencies: + chalk: 1.1.3 + esutils: 2.0.3 + js-tokens: 3.0.2 + + babel-core@6.26.3: + dependencies: + babel-code-frame: 6.26.0 + babel-generator: 6.26.1 + babel-helpers: 6.24.1 + babel-messages: 6.23.0 + babel-register: 6.26.0 + babel-runtime: 6.26.0 + babel-template: 6.26.0 + babel-traverse: 6.26.0 + babel-types: 6.26.0 + babylon: 6.18.0 + convert-source-map: 1.9.0 + debug: 2.6.9 + json5: 0.5.1 + lodash: 4.17.21 + minimatch: 3.1.2 + path-is-absolute: 1.0.1 + private: 0.1.8 + slash: 1.0.0 + source-map: 0.5.7 + transitivePeerDependencies: + - supports-color + + babel-generator@6.26.1: + dependencies: + babel-messages: 6.23.0 + babel-runtime: 6.26.0 + babel-types: 6.26.0 + detect-indent: 4.0.0 + jsesc: 1.3.0 + lodash: 4.17.21 + source-map: 0.5.7 + trim-right: 1.0.1 + + babel-helper-builder-binary-assignment-operator-visitor@6.24.1: + dependencies: + babel-helper-explode-assignable-expression: 6.24.1 + babel-runtime: 6.26.0 + babel-types: 6.26.0 + transitivePeerDependencies: + - supports-color + + babel-helper-call-delegate@6.24.1: + dependencies: + babel-helper-hoist-variables: 6.24.1 + babel-runtime: 6.26.0 + babel-traverse: 6.26.0 + babel-types: 6.26.0 + transitivePeerDependencies: + - supports-color + + babel-helper-define-map@6.26.0: + dependencies: + babel-helper-function-name: 6.24.1 + babel-runtime: 6.26.0 + babel-types: 6.26.0 + lodash: 4.17.21 + transitivePeerDependencies: + - supports-color + + babel-helper-explode-assignable-expression@6.24.1: + dependencies: + babel-runtime: 6.26.0 + babel-traverse: 6.26.0 + babel-types: 6.26.0 + transitivePeerDependencies: + - supports-color + + babel-helper-function-name@6.24.1: + dependencies: + babel-helper-get-function-arity: 6.24.1 + babel-runtime: 6.26.0 + babel-template: 6.26.0 + babel-traverse: 6.26.0 + babel-types: 6.26.0 + transitivePeerDependencies: + - supports-color + + babel-helper-get-function-arity@6.24.1: + dependencies: + babel-runtime: 6.26.0 + babel-types: 6.26.0 + + babel-helper-hoist-variables@6.24.1: + dependencies: + babel-runtime: 6.26.0 + babel-types: 6.26.0 + + babel-helper-optimise-call-expression@6.24.1: + dependencies: + babel-runtime: 6.26.0 + babel-types: 6.26.0 + + babel-helper-regex@6.26.0: + dependencies: + babel-runtime: 6.26.0 + babel-types: 6.26.0 + lodash: 4.17.21 + + babel-helper-remap-async-to-generator@6.24.1: + dependencies: + babel-helper-function-name: 6.24.1 + babel-runtime: 6.26.0 + babel-template: 6.26.0 + babel-traverse: 6.26.0 + babel-types: 6.26.0 + transitivePeerDependencies: + - supports-color + + babel-helper-replace-supers@6.24.1: + dependencies: + babel-helper-optimise-call-expression: 6.24.1 + babel-messages: 6.23.0 + babel-runtime: 6.26.0 + babel-template: 6.26.0 + babel-traverse: 6.26.0 + babel-types: 6.26.0 + transitivePeerDependencies: + - supports-color + + babel-helpers@6.24.1: + dependencies: + babel-runtime: 6.26.0 + babel-template: 6.26.0 + transitivePeerDependencies: + - supports-color + + babel-jest@29.7.0(@babel/core@7.27.1): + dependencies: + '@babel/core': 7.27.1 + '@jest/transform': 29.7.0 + '@types/babel__core': 7.20.5 + babel-plugin-istanbul: 6.1.1 + babel-preset-jest: 29.6.3(@babel/core@7.27.1) + chalk: 4.1.2 + graceful-fs: 4.2.11 + slash: 3.0.0 + transitivePeerDependencies: + - supports-color + + babel-messages@6.23.0: + dependencies: + babel-runtime: 6.26.0 + + babel-plugin-check-es2015-constants@6.22.0: + dependencies: + babel-runtime: 6.26.0 + + babel-plugin-istanbul@6.1.1: + dependencies: + '@babel/helper-plugin-utils': 7.27.1 + '@istanbuljs/load-nyc-config': 1.1.0 + '@istanbuljs/schema': 0.1.3 + istanbul-lib-instrument: 5.2.1 + test-exclude: 6.0.0 + transitivePeerDependencies: + - supports-color + + babel-plugin-jest-hoist@29.6.3: + dependencies: + '@babel/template': 7.27.1 + '@babel/types': 7.27.1 + '@types/babel__core': 7.20.5 + '@types/babel__traverse': 7.20.7 + + babel-plugin-syntax-async-functions@6.13.0: {} + + babel-plugin-syntax-exponentiation-operator@6.13.0: {} + + babel-plugin-syntax-hermes-parser@0.25.1: + dependencies: + hermes-parser: 0.25.1 + + babel-plugin-syntax-trailing-function-commas@6.22.0: {} + + babel-plugin-syntax-trailing-function-commas@7.0.0-beta.0: {} + + babel-plugin-transform-async-to-generator@6.24.1: + dependencies: + babel-helper-remap-async-to-generator: 6.24.1 + babel-plugin-syntax-async-functions: 6.13.0 + babel-runtime: 6.26.0 + transitivePeerDependencies: + - supports-color + + babel-plugin-transform-es2015-arrow-functions@6.22.0: + dependencies: + babel-runtime: 6.26.0 + + babel-plugin-transform-es2015-block-scoped-functions@6.22.0: + dependencies: + babel-runtime: 6.26.0 + + babel-plugin-transform-es2015-block-scoping@6.26.0: + dependencies: + babel-runtime: 6.26.0 + babel-template: 6.26.0 + babel-traverse: 6.26.0 + babel-types: 6.26.0 + lodash: 4.17.21 + transitivePeerDependencies: + - supports-color + + babel-plugin-transform-es2015-classes@6.24.1: + dependencies: + babel-helper-define-map: 6.26.0 + babel-helper-function-name: 6.24.1 + babel-helper-optimise-call-expression: 6.24.1 + babel-helper-replace-supers: 6.24.1 + babel-messages: 6.23.0 + babel-runtime: 6.26.0 + babel-template: 6.26.0 + babel-traverse: 6.26.0 + babel-types: 6.26.0 + transitivePeerDependencies: + - supports-color + + babel-plugin-transform-es2015-computed-properties@6.24.1: + dependencies: + babel-runtime: 6.26.0 + babel-template: 6.26.0 + transitivePeerDependencies: + - supports-color + + babel-plugin-transform-es2015-destructuring@6.23.0: + dependencies: + babel-runtime: 6.26.0 + + babel-plugin-transform-es2015-duplicate-keys@6.24.1: + dependencies: + babel-runtime: 6.26.0 + babel-types: 6.26.0 + + babel-plugin-transform-es2015-for-of@6.23.0: + dependencies: + babel-runtime: 6.26.0 + + babel-plugin-transform-es2015-function-name@6.24.1: + dependencies: + babel-helper-function-name: 6.24.1 + babel-runtime: 6.26.0 + babel-types: 6.26.0 + transitivePeerDependencies: + - supports-color + + babel-plugin-transform-es2015-literals@6.22.0: + dependencies: + babel-runtime: 6.26.0 + + babel-plugin-transform-es2015-modules-amd@6.24.1: + dependencies: + babel-plugin-transform-es2015-modules-commonjs: 6.26.2 + babel-runtime: 6.26.0 + babel-template: 6.26.0 + transitivePeerDependencies: + - supports-color + + babel-plugin-transform-es2015-modules-commonjs@6.26.2: + dependencies: + babel-plugin-transform-strict-mode: 6.24.1 + babel-runtime: 6.26.0 + babel-template: 6.26.0 + babel-types: 6.26.0 + transitivePeerDependencies: + - supports-color + + babel-plugin-transform-es2015-modules-systemjs@6.24.1: + dependencies: + babel-helper-hoist-variables: 6.24.1 + babel-runtime: 6.26.0 + babel-template: 6.26.0 + transitivePeerDependencies: + - supports-color + + babel-plugin-transform-es2015-modules-umd@6.24.1: + dependencies: + babel-plugin-transform-es2015-modules-amd: 6.24.1 + babel-runtime: 6.26.0 + babel-template: 6.26.0 + transitivePeerDependencies: + - supports-color + + babel-plugin-transform-es2015-object-super@6.24.1: + dependencies: + babel-helper-replace-supers: 6.24.1 + babel-runtime: 6.26.0 + transitivePeerDependencies: + - supports-color + + babel-plugin-transform-es2015-parameters@6.24.1: + dependencies: + babel-helper-call-delegate: 6.24.1 + babel-helper-get-function-arity: 6.24.1 + babel-runtime: 6.26.0 + babel-template: 6.26.0 + babel-traverse: 6.26.0 + babel-types: 6.26.0 + transitivePeerDependencies: + - supports-color + + babel-plugin-transform-es2015-shorthand-properties@6.24.1: + dependencies: + babel-runtime: 6.26.0 + babel-types: 6.26.0 + + babel-plugin-transform-es2015-spread@6.22.0: + dependencies: + babel-runtime: 6.26.0 + + babel-plugin-transform-es2015-sticky-regex@6.24.1: + dependencies: + babel-helper-regex: 6.26.0 + babel-runtime: 6.26.0 + babel-types: 6.26.0 + + babel-plugin-transform-es2015-template-literals@6.22.0: + dependencies: + babel-runtime: 6.26.0 + + babel-plugin-transform-es2015-typeof-symbol@6.23.0: + dependencies: + babel-runtime: 6.26.0 + + babel-plugin-transform-es2015-unicode-regex@6.24.1: + dependencies: + babel-helper-regex: 6.26.0 + babel-runtime: 6.26.0 + regexpu-core: 2.0.0 + + babel-plugin-transform-exponentiation-operator@6.24.1: + dependencies: + babel-helper-builder-binary-assignment-operator-visitor: 6.24.1 + babel-plugin-syntax-exponentiation-operator: 6.13.0 + babel-runtime: 6.26.0 + transitivePeerDependencies: + - supports-color + + babel-plugin-transform-regenerator@6.26.0: + dependencies: + regenerator-transform: 0.10.1 + + babel-plugin-transform-strict-mode@6.24.1: + dependencies: + babel-runtime: 6.26.0 + babel-types: 6.26.0 + + babel-preset-current-node-syntax@1.1.0(@babel/core@7.27.1): + dependencies: + '@babel/core': 7.27.1 + '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.27.1) + '@babel/plugin-syntax-bigint': 7.8.3(@babel/core@7.27.1) + '@babel/plugin-syntax-class-properties': 7.12.13(@babel/core@7.27.1) + '@babel/plugin-syntax-class-static-block': 7.14.5(@babel/core@7.27.1) + '@babel/plugin-syntax-import-attributes': 7.27.1(@babel/core@7.27.1) + '@babel/plugin-syntax-import-meta': 7.10.4(@babel/core@7.27.1) + '@babel/plugin-syntax-json-strings': 7.8.3(@babel/core@7.27.1) + '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@7.27.1) + '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.27.1) + '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.27.1) + '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.27.1) + '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.27.1) + '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.27.1) + '@babel/plugin-syntax-private-property-in-object': 7.14.5(@babel/core@7.27.1) + '@babel/plugin-syntax-top-level-await': 7.14.5(@babel/core@7.27.1) + + babel-preset-env@1.7.0: + dependencies: + babel-plugin-check-es2015-constants: 6.22.0 + babel-plugin-syntax-trailing-function-commas: 6.22.0 + babel-plugin-transform-async-to-generator: 6.24.1 + babel-plugin-transform-es2015-arrow-functions: 6.22.0 + babel-plugin-transform-es2015-block-scoped-functions: 6.22.0 + babel-plugin-transform-es2015-block-scoping: 6.26.0 + babel-plugin-transform-es2015-classes: 6.24.1 + babel-plugin-transform-es2015-computed-properties: 6.24.1 + babel-plugin-transform-es2015-destructuring: 6.23.0 + babel-plugin-transform-es2015-duplicate-keys: 6.24.1 + babel-plugin-transform-es2015-for-of: 6.23.0 + babel-plugin-transform-es2015-function-name: 6.24.1 + babel-plugin-transform-es2015-literals: 6.22.0 + babel-plugin-transform-es2015-modules-amd: 6.24.1 + babel-plugin-transform-es2015-modules-commonjs: 6.26.2 + babel-plugin-transform-es2015-modules-systemjs: 6.24.1 + babel-plugin-transform-es2015-modules-umd: 6.24.1 + babel-plugin-transform-es2015-object-super: 6.24.1 + babel-plugin-transform-es2015-parameters: 6.24.1 + babel-plugin-transform-es2015-shorthand-properties: 6.24.1 + babel-plugin-transform-es2015-spread: 6.22.0 + babel-plugin-transform-es2015-sticky-regex: 6.24.1 + babel-plugin-transform-es2015-template-literals: 6.22.0 + babel-plugin-transform-es2015-typeof-symbol: 6.23.0 + babel-plugin-transform-es2015-unicode-regex: 6.24.1 + babel-plugin-transform-exponentiation-operator: 6.24.1 + babel-plugin-transform-regenerator: 6.26.0 + browserslist: 3.2.8 + invariant: 2.2.4 + semver: 5.7.2 + transitivePeerDependencies: + - supports-color + + babel-preset-fbjs@3.4.0(@babel/core@7.27.1): + dependencies: + '@babel/core': 7.27.1 + '@babel/plugin-proposal-class-properties': 7.18.6(@babel/core@7.27.1) + '@babel/plugin-proposal-object-rest-spread': 7.20.7(@babel/core@7.27.1) + '@babel/plugin-syntax-class-properties': 7.12.13(@babel/core@7.27.1) + '@babel/plugin-syntax-flow': 7.27.1(@babel/core@7.27.1) + '@babel/plugin-syntax-jsx': 7.27.1(@babel/core@7.27.1) + '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.27.1) + '@babel/plugin-transform-arrow-functions': 7.27.1(@babel/core@7.27.1) + '@babel/plugin-transform-block-scoped-functions': 7.27.1(@babel/core@7.27.1) + '@babel/plugin-transform-block-scoping': 7.27.1(@babel/core@7.27.1) + '@babel/plugin-transform-classes': 7.27.1(@babel/core@7.27.1) + '@babel/plugin-transform-computed-properties': 7.27.1(@babel/core@7.27.1) + '@babel/plugin-transform-destructuring': 7.27.1(@babel/core@7.27.1) + '@babel/plugin-transform-flow-strip-types': 7.27.1(@babel/core@7.27.1) + '@babel/plugin-transform-for-of': 7.27.1(@babel/core@7.27.1) + '@babel/plugin-transform-function-name': 7.27.1(@babel/core@7.27.1) + '@babel/plugin-transform-literals': 7.27.1(@babel/core@7.27.1) + '@babel/plugin-transform-member-expression-literals': 7.27.1(@babel/core@7.27.1) + '@babel/plugin-transform-modules-commonjs': 7.27.1(@babel/core@7.27.1) + '@babel/plugin-transform-object-super': 7.27.1(@babel/core@7.27.1) + '@babel/plugin-transform-parameters': 7.27.1(@babel/core@7.27.1) + '@babel/plugin-transform-property-literals': 7.27.1(@babel/core@7.27.1) + '@babel/plugin-transform-react-display-name': 7.27.1(@babel/core@7.27.1) + '@babel/plugin-transform-react-jsx': 7.27.1(@babel/core@7.27.1) + '@babel/plugin-transform-shorthand-properties': 7.27.1(@babel/core@7.27.1) + '@babel/plugin-transform-spread': 7.27.1(@babel/core@7.27.1) + '@babel/plugin-transform-template-literals': 7.27.1(@babel/core@7.27.1) + babel-plugin-syntax-trailing-function-commas: 7.0.0-beta.0 + transitivePeerDependencies: + - supports-color + + babel-preset-jest@29.6.3(@babel/core@7.27.1): + dependencies: + '@babel/core': 7.27.1 + babel-plugin-jest-hoist: 29.6.3 + babel-preset-current-node-syntax: 1.1.0(@babel/core@7.27.1) + + babel-register@6.26.0: + dependencies: + babel-core: 6.26.3 + babel-runtime: 6.26.0 + core-js: 2.6.12 + home-or-tmp: 2.0.0 + lodash: 4.17.21 + mkdirp: 0.5.6 + source-map-support: 0.4.18 + transitivePeerDependencies: + - supports-color + + babel-runtime@6.26.0: + dependencies: + core-js: 2.6.12 + regenerator-runtime: 0.11.1 + + babel-template@6.26.0: + dependencies: + babel-runtime: 6.26.0 + babel-traverse: 6.26.0 + babel-types: 6.26.0 + babylon: 6.18.0 + lodash: 4.17.21 + transitivePeerDependencies: + - supports-color + + babel-traverse@6.26.0: + dependencies: + babel-code-frame: 6.26.0 + babel-messages: 6.23.0 + babel-runtime: 6.26.0 + babel-types: 6.26.0 + babylon: 6.18.0 + debug: 2.6.9 + globals: 9.18.0 + invariant: 2.2.4 + lodash: 4.17.21 + transitivePeerDependencies: + - supports-color + + babel-types@6.26.0: + dependencies: + babel-runtime: 6.26.0 + esutils: 2.0.3 + lodash: 4.17.21 + to-fast-properties: 1.0.3 + + babelify@7.3.0: + dependencies: + babel-core: 6.26.3 + object-assign: 4.1.1 + transitivePeerDependencies: + - supports-color + + babylon@6.18.0: {} + + backoff@2.5.0: + dependencies: + precond: 0.2.3 + + balanced-match@1.0.2: {} + + base-64@0.1.0: {} + + base-x@3.0.11: + dependencies: + safe-buffer: 5.2.1 + + base-x@4.0.1: {} + + base64-js@1.5.1: {} + + base@0.11.2: + dependencies: + cache-base: 1.0.1 + class-utils: 0.3.6 + component-emitter: 1.3.1 + define-property: 1.0.0 + isobject: 3.0.1 + mixin-deep: 1.3.2 + pascalcase: 0.1.1 + + basic-auth@2.0.1: + dependencies: + safe-buffer: 5.1.2 + + bcrypt-pbkdf@1.0.2: + dependencies: + tweetnacl: 0.14.5 + + bech32@1.1.4: {} + + better-path-resolve@1.0.0: + dependencies: + is-windows: 1.0.2 + + bigint-crypto-utils@3.3.0: {} + + bignumber.js@9.1.2: {} + + binary-extensions@1.13.1: {} + + binary-extensions@2.3.0: {} + + bindings@1.5.0: + dependencies: + file-uri-to-path: 1.0.0 + optional: true + + bintrees@1.0.2: {} + + bip39@2.5.0: + dependencies: + create-hash: 1.2.0 + pbkdf2: 3.1.2 + randombytes: 2.1.0 + safe-buffer: 5.2.1 + unorm: 1.6.0 + + bl@4.1.0: + dependencies: + buffer: 5.7.1 + inherits: 2.0.4 + readable-stream: 3.6.2 + + blakejs@1.2.1: {} + + blob-to-it@0.0.2: + dependencies: + browser-readablestream-to-it: 0.0.2 + + bluebird@3.7.2: {} + + bn.js@4.11.6: {} + + bn.js@4.12.2: {} + + bn.js@5.2.2: {} + + body-parser@1.19.1: + dependencies: + bytes: 3.1.1 + content-type: 1.0.5 + debug: 2.6.9 + depd: 1.1.2 + http-errors: 1.8.1 + iconv-lite: 0.4.24 + on-finished: 2.3.0 + qs: 6.9.6 + raw-body: 2.4.2 + type-is: 1.6.18 + transitivePeerDependencies: + - supports-color + + body-parser@1.19.2: + dependencies: + bytes: 3.1.2 + content-type: 1.0.5 + debug: 2.6.9 + depd: 1.1.2 + http-errors: 1.8.1 + iconv-lite: 0.4.24 + on-finished: 2.3.0 + qs: 6.9.7 + raw-body: 2.4.3 + type-is: 1.6.18 + transitivePeerDependencies: + - supports-color + + body-parser@1.20.1: + dependencies: + bytes: 3.1.2 + content-type: 1.0.5 + debug: 2.6.9 + depd: 2.0.0 + destroy: 1.2.0 + http-errors: 2.0.0 + iconv-lite: 0.4.24 + on-finished: 2.4.1 + qs: 6.11.0 + raw-body: 2.5.1 + type-is: 1.6.18 + unpipe: 1.0.0 + transitivePeerDependencies: + - supports-color + + body-parser@1.20.2: + dependencies: + bytes: 3.1.2 + content-type: 1.0.5 + debug: 2.6.9 + depd: 2.0.0 + destroy: 1.2.0 + http-errors: 2.0.0 + iconv-lite: 0.4.24 + on-finished: 2.4.1 + qs: 6.11.0 + raw-body: 2.5.2 + type-is: 1.6.18 + unpipe: 1.0.0 + transitivePeerDependencies: + - supports-color + + body-parser@1.20.3: + dependencies: + bytes: 3.1.2 + content-type: 1.0.5 + debug: 2.6.9 + depd: 2.0.0 + destroy: 1.2.0 + http-errors: 2.0.0 + iconv-lite: 0.4.24 + on-finished: 2.4.1 + qs: 6.13.0 + raw-body: 2.5.2 + type-is: 1.6.18 + unpipe: 1.0.0 + transitivePeerDependencies: + - supports-color + + borc@2.1.2: + dependencies: + bignumber.js: 9.1.2 + buffer: 5.7.1 + commander: 2.20.3 + ieee754: 1.2.1 + iso-url: 0.4.7 + json-text-sequence: 0.1.1 + readable-stream: 3.6.2 + + boxen@5.1.2: + dependencies: + ansi-align: 3.0.1 + camelcase: 6.3.0 + chalk: 4.1.2 + cli-boxes: 2.2.1 + string-width: 4.2.3 + type-fest: 0.20.2 + widest-line: 3.1.0 + wrap-ansi: 7.0.0 + + brace-expansion@1.1.11: + dependencies: + balanced-match: 1.0.2 + concat-map: 0.0.1 + + brace-expansion@2.0.1: + dependencies: + balanced-match: 1.0.2 + + braces@1.8.5: + dependencies: + expand-range: 1.8.2 + preserve: 0.2.0 + repeat-element: 1.1.4 + + braces@2.3.2: + dependencies: + arr-flatten: 1.1.0 + array-unique: 0.3.2 + extend-shallow: 2.0.1 + fill-range: 4.0.0 + isobject: 3.0.1 + repeat-element: 1.1.4 + snapdragon: 0.8.2 + snapdragon-node: 2.1.1 + split-string: 3.1.0 + to-regex: 3.0.2 + transitivePeerDependencies: + - supports-color + + braces@3.0.3: + dependencies: + fill-range: 7.1.1 + + brorand@1.1.0: {} + + browser-level@1.0.1: + dependencies: + abstract-level: 1.0.4 + catering: 2.1.1 + module-error: 1.0.2 + run-parallel-limit: 1.1.0 + + browser-readablestream-to-it@0.0.2: {} + + browser-stdout@1.3.0: {} + + browser-stdout@1.3.1: {} + + browserify-aes@1.2.0: + dependencies: + buffer-xor: 1.0.3 + cipher-base: 1.0.6 + create-hash: 1.2.0 + evp_bytestokey: 1.0.3 + inherits: 2.0.4 + safe-buffer: 5.2.1 + + browserify-cipher@1.0.1: + dependencies: + browserify-aes: 1.2.0 + browserify-des: 1.0.2 + evp_bytestokey: 1.0.3 + + browserify-des@1.0.2: + dependencies: + cipher-base: 1.0.6 + des.js: 1.1.0 + inherits: 2.0.4 + safe-buffer: 5.2.1 + + browserify-rsa@4.1.1: + dependencies: + bn.js: 5.2.2 + randombytes: 2.1.0 + safe-buffer: 5.2.1 + + browserify-sign@4.2.3: + dependencies: + bn.js: 5.2.2 + browserify-rsa: 4.1.1 + create-hash: 1.2.0 + create-hmac: 1.1.7 + elliptic: 6.6.1 + hash-base: 3.0.5 + inherits: 2.0.4 + parse-asn1: 5.1.7 + readable-stream: 2.3.8 + safe-buffer: 5.2.1 + + browserslist@3.2.8: + dependencies: + caniuse-lite: 1.0.30001717 + electron-to-chromium: 1.5.150 + + browserslist@4.24.5: + dependencies: + caniuse-lite: 1.0.30001717 + electron-to-chromium: 1.5.150 + node-releases: 2.0.19 + update-browserslist-db: 1.1.3(browserslist@4.24.5) + + bs58@4.0.1: + dependencies: + base-x: 3.0.11 + + bs58@5.0.0: + dependencies: + base-x: 4.0.1 + + bs58check@2.1.2: + dependencies: + bs58: 4.0.1 + create-hash: 1.2.0 + safe-buffer: 5.2.1 + + bser@2.1.1: + dependencies: + node-int64: 0.4.0 + + buffer-from@1.1.2: {} + + buffer-to-arraybuffer@0.0.5: {} + + buffer-writer@2.0.0: {} + + buffer-xor@1.0.3: {} + + buffer-xor@2.0.2: + dependencies: + safe-buffer: 5.2.1 + + buffer@4.9.2: + dependencies: + base64-js: 1.5.1 + ieee754: 1.2.1 + isarray: 1.0.0 + + buffer@5.7.1: + dependencies: + base64-js: 1.5.1 + ieee754: 1.2.1 + + buffer@6.0.3: + dependencies: + base64-js: 1.5.1 + ieee754: 1.2.1 + + bufferutil@4.0.9: + dependencies: + node-gyp-build: 4.8.4 + + busboy@1.6.0: + dependencies: + streamsearch: 1.1.0 + + bytes@3.1.1: {} + + bytes@3.1.2: {} + + bytewise-core@1.2.3: + dependencies: + typewise-core: 1.2.0 + + bytewise@1.1.0: + dependencies: + bytewise-core: 1.2.3 + typewise: 1.0.3 + + cache-base@1.0.1: + dependencies: + collection-visit: 1.0.0 + component-emitter: 1.3.1 + get-value: 2.0.6 + has-value: 1.0.0 + isobject: 3.0.1 + set-value: 2.0.1 + to-object-path: 0.3.0 + union-value: 1.0.1 + unset-value: 1.0.0 + + cacheable-lookup@5.0.4: {} + + cacheable-lookup@6.1.0: {} + + cacheable-lookup@7.0.0: {} + + cacheable-request@10.2.14: + dependencies: + '@types/http-cache-semantics': 4.0.4 + get-stream: 6.0.1 + http-cache-semantics: 4.1.1 + keyv: 4.5.4 + mimic-response: 4.0.0 + normalize-url: 8.0.1 + responselike: 3.0.0 + + cacheable-request@6.1.0: + dependencies: + clone-response: 1.0.3 + get-stream: 5.2.0 + http-cache-semantics: 4.1.1 + keyv: 3.1.0 + lowercase-keys: 2.0.0 + normalize-url: 4.5.1 + responselike: 1.0.2 + + cacheable-request@7.0.4: + dependencies: + clone-response: 1.0.3 + get-stream: 5.2.0 + http-cache-semantics: 4.1.1 + keyv: 4.5.4 + lowercase-keys: 2.0.0 + normalize-url: 6.1.0 + responselike: 2.0.1 + + cachedown@1.0.0: + dependencies: + abstract-leveldown: 2.7.2 + lru-cache: 3.2.0 + + call-bind-apply-helpers@1.0.2: + dependencies: + es-errors: 1.3.0 + function-bind: 1.1.2 + + call-bind@1.0.8: + dependencies: + call-bind-apply-helpers: 1.0.2 + es-define-property: 1.0.1 + get-intrinsic: 1.3.0 + set-function-length: 1.2.2 + + call-bound@1.0.4: + dependencies: + call-bind-apply-helpers: 1.0.2 + get-intrinsic: 1.3.0 + + caller-callsite@2.0.0: + dependencies: + callsites: 2.0.0 + + caller-path@2.0.0: + dependencies: + caller-callsite: 2.0.0 + + callsites@2.0.0: {} + + callsites@3.1.0: {} + + camel-case@4.1.2: + dependencies: + pascal-case: 3.1.2 + tslib: 2.8.1 + + camelcase-keys@6.2.2: + dependencies: + camelcase: 5.3.1 + map-obj: 4.3.0 + quick-lru: 4.0.1 + + camelcase@3.0.0: {} + + camelcase@4.1.0: {} + + camelcase@5.3.1: {} + + camelcase@6.3.0: {} + + caniuse-lite@1.0.30001717: {} + + capital-case@1.0.4: + dependencies: + no-case: 3.0.4 + tslib: 2.8.1 + upper-case-first: 2.0.2 + + case@1.6.3: {} + + caseless@0.12.0: {} + + catering@2.1.1: {} + + cbor@10.0.3: + dependencies: + nofilter: 3.1.0 + + cbor@8.1.0: + dependencies: + nofilter: 3.1.0 + + cbor@9.0.2: + dependencies: + nofilter: 3.1.0 + + chai-as-promised@7.1.2(chai@4.3.4): + dependencies: + chai: 4.3.4 + check-error: 1.0.3 + + chai-as-promised@7.1.2(chai@4.5.0): + dependencies: + chai: 4.5.0 + check-error: 1.0.3 + + chai@4.3.4: + dependencies: + assertion-error: 1.1.0 + check-error: 1.0.3 + deep-eql: 3.0.1 + get-func-name: 2.0.2 + pathval: 1.1.1 + type-detect: 4.1.0 + + chai@4.5.0: + dependencies: + assertion-error: 1.1.0 + check-error: 1.0.3 + deep-eql: 4.1.4 + get-func-name: 2.0.2 + loupe: 2.3.7 + pathval: 1.1.1 + type-detect: 4.1.0 + + chalk@1.1.3: + dependencies: + ansi-styles: 2.2.1 + escape-string-regexp: 1.0.5 + has-ansi: 2.0.0 + strip-ansi: 3.0.1 + supports-color: 2.0.0 + + chalk@2.4.2: + dependencies: + ansi-styles: 3.2.1 + escape-string-regexp: 1.0.5 + supports-color: 5.5.0 + + chalk@4.1.2: + dependencies: + ansi-styles: 4.3.0 + supports-color: 7.2.0 + + chalk@5.4.1: {} + + change-case-all@1.0.14: + dependencies: + change-case: 4.1.2 + is-lower-case: 2.0.2 + is-upper-case: 2.0.2 + lower-case: 2.0.2 + lower-case-first: 2.0.2 + sponge-case: 1.0.1 + swap-case: 2.0.2 + title-case: 3.0.3 + upper-case: 2.0.2 + upper-case-first: 2.0.2 + + change-case-all@1.0.15: + dependencies: + change-case: 4.1.2 + is-lower-case: 2.0.2 + is-upper-case: 2.0.2 + lower-case: 2.0.2 + lower-case-first: 2.0.2 + sponge-case: 1.0.1 + swap-case: 2.0.2 + title-case: 3.0.3 + upper-case: 2.0.2 + upper-case-first: 2.0.2 + + change-case@4.1.2: + dependencies: + camel-case: 4.1.2 + capital-case: 1.0.4 + constant-case: 3.0.4 + dot-case: 3.0.4 + header-case: 2.0.4 + no-case: 3.0.4 + param-case: 3.0.4 + pascal-case: 3.1.2 + path-case: 3.0.4 + sentence-case: 3.0.4 + snake-case: 3.0.4 + tslib: 2.8.1 + + chardet@0.7.0: {} + + charenc@0.0.2: {} + + check-error@1.0.3: + dependencies: + get-func-name: 2.0.2 + + checkpoint-store@1.1.0: + dependencies: + functional-red-black-tree: 1.0.1 + + chokidar@1.7.0: + dependencies: + anymatch: 1.3.2 + async-each: 1.0.6 + glob-parent: 2.0.0 + inherits: 2.0.4 + is-binary-path: 1.0.1 + is-glob: 2.0.1 + path-is-absolute: 1.0.1 + readdirp: 2.2.1 + optionalDependencies: + fsevents: 1.2.13 + transitivePeerDependencies: + - supports-color + + chokidar@3.6.0: + dependencies: + anymatch: 3.1.3 + braces: 3.0.3 + glob-parent: 5.1.2 + is-binary-path: 2.1.0 + is-glob: 4.0.3 + normalize-path: 3.0.0 + readdirp: 3.6.0 + optionalDependencies: + fsevents: 2.3.3 + + chokidar@4.0.3: + dependencies: + readdirp: 4.1.2 + + chownr@1.1.4: {} + + chrome-launcher@0.15.2: + dependencies: + '@types/node': 20.17.32 + escape-string-regexp: 4.0.0 + is-wsl: 2.2.0 + lighthouse-logger: 1.4.2 + transitivePeerDependencies: + - supports-color + + chromium-edge-launcher@0.2.0: + dependencies: + '@types/node': 20.17.32 + escape-string-regexp: 4.0.0 + is-wsl: 2.2.0 + lighthouse-logger: 1.4.2 + mkdirp: 1.0.4 + rimraf: 3.0.2 + transitivePeerDependencies: + - supports-color + + ci-info@2.0.0: {} + + ci-info@3.9.0: {} + + cids@0.7.5: + dependencies: + buffer: 5.7.1 + class-is: 1.1.0 + multibase: 0.6.1 + multicodec: 1.0.4 + multihashes: 0.4.21 + + cids@1.1.9: + dependencies: + multibase: 4.0.6 + multicodec: 3.2.1 + multihashes: 4.0.3 + uint8arrays: 3.1.1 + + cipher-base@1.0.6: + dependencies: + inherits: 2.0.4 + safe-buffer: 5.2.1 + + class-is@1.1.0: {} + + class-utils@0.3.6: + dependencies: + arr-union: 3.1.0 + define-property: 0.2.5 + isobject: 3.0.1 + static-extend: 0.1.2 + + classic-level@1.4.1: + dependencies: + abstract-level: 1.0.4 + catering: 2.1.1 + module-error: 1.0.2 + napi-macros: 2.2.2 + node-gyp-build: 4.8.4 + + clean-stack@2.2.0: {} + + cli-boxes@2.2.1: {} + + cli-cursor@3.1.0: + dependencies: + restore-cursor: 3.1.0 + + cli-cursor@5.0.0: + dependencies: + restore-cursor: 5.1.0 + + cli-table3@0.5.1: + dependencies: + object-assign: 4.1.1 + string-width: 2.1.1 + optionalDependencies: + colors: 1.4.0 + + cli-table3@0.6.5: + dependencies: + string-width: 4.2.3 + optionalDependencies: + '@colors/colors': 1.5.0 + + cli-table@0.3.11: + dependencies: + colors: 1.0.3 + + cli-truncate@2.1.0: + dependencies: + slice-ansi: 3.0.0 + string-width: 4.2.3 + + cli-truncate@3.1.0: + dependencies: + slice-ansi: 5.0.0 + string-width: 5.1.2 + + cli-truncate@4.0.0: + dependencies: + slice-ansi: 5.0.0 + string-width: 7.2.0 + + cli-width@3.0.0: {} + + cliui@3.2.0: + dependencies: + string-width: 1.0.2 + strip-ansi: 3.0.1 + wrap-ansi: 2.1.0 + + cliui@4.1.0: + dependencies: + string-width: 2.1.1 + strip-ansi: 4.0.0 + wrap-ansi: 2.1.0 + + cliui@6.0.0: + dependencies: + string-width: 4.2.3 + strip-ansi: 6.0.1 + wrap-ansi: 6.2.0 + + cliui@7.0.4: + dependencies: + string-width: 4.2.3 + strip-ansi: 6.0.1 + wrap-ansi: 7.0.0 + + cliui@8.0.1: + dependencies: + string-width: 4.2.3 + strip-ansi: 6.0.1 + wrap-ansi: 7.0.0 + + clone-response@1.0.3: + dependencies: + mimic-response: 1.0.1 + + clone@2.1.2: {} + + co@4.6.0: {} + + code-point-at@1.1.0: {} + + coingecko-api@1.0.10: {} + + collection-visit@1.0.0: + dependencies: + map-visit: 1.0.0 + object-visit: 1.0.1 + + color-convert@1.9.3: + dependencies: + color-name: 1.1.3 + + color-convert@2.0.1: + dependencies: + color-name: 1.1.4 + + color-name@1.1.3: {} + + color-name@1.1.4: {} + + color-string@1.9.1: + dependencies: + color-name: 1.1.4 + simple-swizzle: 0.2.2 + + color@3.2.1: + dependencies: + color-convert: 1.9.3 + color-string: 1.9.1 + + colorette@2.0.20: {} + + colors@1.0.3: {} + + colors@1.4.0: {} + + colorspace@1.1.4: + dependencies: + color: 3.2.1 + text-hex: 1.0.0 + + combined-stream@1.0.8: + dependencies: + delayed-stream: 1.0.0 + + command-exists@1.2.9: {} + + command-line-args@4.0.7: + dependencies: + array-back: 2.0.0 + find-replace: 1.0.3 + typical: 2.6.1 + + command-line-args@5.2.1: + dependencies: + array-back: 3.1.0 + find-replace: 3.0.0 + lodash.camelcase: 4.3.0 + typical: 4.0.0 + + command-line-usage@6.1.3: + dependencies: + array-back: 4.0.2 + chalk: 2.4.2 + table-layout: 1.0.2 + typical: 5.2.0 + + commander@10.0.1: {} + + commander@11.1.0: {} + + commander@12.1.0: {} + + commander@13.1.0: {} + + commander@2.11.0: {} + + commander@2.20.3: {} + + commander@3.0.2: {} + + commander@6.2.1: {} + + commander@8.3.0: {} + + commander@9.5.0: {} + + common-tags@1.8.2: {} + + compare-func@2.0.0: + dependencies: + array-ify: 1.0.0 + dot-prop: 5.3.0 + + compare-versions@6.1.1: {} + + component-emitter@1.3.1: {} + + concat-map@0.0.1: {} + + concat-stream@1.6.2: + dependencies: + buffer-from: 1.1.2 + inherits: 2.0.4 + readable-stream: 2.3.8 + typedarray: 0.0.6 + + config-chain@1.1.13: + dependencies: + ini: 1.3.8 + proto-list: 1.2.4 + + connect@3.7.0: + dependencies: + debug: 2.6.9 + finalhandler: 1.1.2 + parseurl: 1.3.3 + utils-merge: 1.0.1 + transitivePeerDependencies: + - supports-color + + consola@2.15.3: {} + + console-control-strings@1.1.0: + optional: true + + console-table-printer@2.12.1: + dependencies: + simple-wcswidth: 1.0.1 + + constant-case@3.0.4: + dependencies: + no-case: 3.0.4 + tslib: 2.8.1 + upper-case: 2.0.2 + + content-disposition@0.5.4: + dependencies: + safe-buffer: 5.2.1 + + content-hash@2.5.2: + dependencies: + cids: 0.7.5 + multicodec: 0.5.7 + multihashes: 0.4.21 + + content-type@1.0.5: {} + + conventional-changelog-angular@5.0.13: + dependencies: + compare-func: 2.0.0 + q: 1.5.1 + + conventional-changelog-angular@7.0.0: + dependencies: + compare-func: 2.0.0 + + conventional-changelog-conventionalcommits@4.6.3: + dependencies: + compare-func: 2.0.0 + lodash: 4.17.21 + q: 1.5.1 + + conventional-changelog-conventionalcommits@7.0.2: + dependencies: + compare-func: 2.0.0 + + conventional-commits-parser@3.2.4: + dependencies: + JSONStream: 1.3.5 + is-text-path: 1.0.1 + lodash: 4.17.21 + meow: 8.1.2 + split2: 3.2.2 + through2: 4.0.2 + + conventional-commits-parser@5.0.0: + dependencies: + JSONStream: 1.3.5 + is-text-path: 2.0.0 + meow: 12.1.1 + split2: 4.2.0 + + convert-source-map@1.9.0: {} + + convert-source-map@2.0.0: {} + + cookie-signature@1.0.6: {} + + cookie@0.4.2: {} + + cookie@0.5.0: {} + + cookie@0.7.1: {} + + cookiejar@2.1.4: {} + + copy-descriptor@0.1.1: {} + + core-js-pure@3.42.0: {} + + core-js@2.6.12: {} + + core-util-is@1.0.2: {} + + core-util-is@1.0.3: {} + + cors@2.8.5: + dependencies: + object-assign: 4.1.1 + vary: 1.1.2 + + cosmiconfig-typescript-loader@2.0.2(@types/node@20.17.32)(cosmiconfig@7.1.0)(typescript@4.9.5): + dependencies: + '@types/node': 20.17.32 + cosmiconfig: 7.1.0 + ts-node: 10.9.2(@types/node@20.17.32)(typescript@4.9.5) + typescript: 4.9.5 + transitivePeerDependencies: + - '@swc/core' + - '@swc/wasm' + + cosmiconfig-typescript-loader@5.1.0(@types/node@22.7.5)(cosmiconfig@8.3.6(typescript@5.8.3))(typescript@5.8.3): + dependencies: + '@types/node': 22.7.5 + cosmiconfig: 8.3.6(typescript@5.8.3) + jiti: 1.21.7 + typescript: 5.8.3 + + cosmiconfig@5.2.1: + dependencies: + import-fresh: 2.0.0 + is-directory: 0.3.1 + js-yaml: 3.14.1 + parse-json: 4.0.0 + + cosmiconfig@7.1.0: + dependencies: + '@types/parse-json': 4.0.2 + import-fresh: 3.3.1 + parse-json: 5.2.0 + path-type: 4.0.0 + yaml: 1.10.2 + + cosmiconfig@8.3.6(typescript@4.9.5): + dependencies: + import-fresh: 3.3.1 + js-yaml: 4.1.0 + parse-json: 5.2.0 + path-type: 4.0.0 + optionalDependencies: + typescript: 4.9.5 + + cosmiconfig@8.3.6(typescript@5.8.3): + dependencies: + import-fresh: 3.3.1 + js-yaml: 4.1.0 + parse-json: 5.2.0 + path-type: 4.0.0 + optionalDependencies: + typescript: 5.8.3 + + crc-32@1.2.2: {} + + create-ecdh@4.0.4: + dependencies: + bn.js: 4.12.2 + elliptic: 6.6.1 + + create-hash@1.2.0: + dependencies: + cipher-base: 1.0.6 + inherits: 2.0.4 + md5.js: 1.3.5 + ripemd160: 2.0.2 + sha.js: 2.4.11 + + create-hmac@1.1.7: + dependencies: + cipher-base: 1.0.6 + create-hash: 1.2.0 + inherits: 2.0.4 + ripemd160: 2.0.2 + safe-buffer: 5.2.1 + sha.js: 2.4.11 + + create-require@1.1.1: {} + + cross-fetch@2.2.6(encoding@0.1.13): + dependencies: + node-fetch: 2.7.0(encoding@0.1.13) + whatwg-fetch: 2.0.4 + transitivePeerDependencies: + - encoding + + cross-fetch@3.1.5(encoding@0.1.13): + dependencies: + node-fetch: 2.6.7(encoding@0.1.13) + transitivePeerDependencies: + - encoding + + cross-fetch@3.2.0(encoding@0.1.13): + dependencies: + node-fetch: 2.7.0(encoding@0.1.13) + transitivePeerDependencies: + - encoding + + cross-fetch@4.0.0(encoding@0.1.13): + dependencies: + node-fetch: 2.7.0(encoding@0.1.13) + transitivePeerDependencies: + - encoding + + cross-spawn@5.1.0: + dependencies: + lru-cache: 4.1.5 + shebang-command: 1.2.0 + which: 1.3.1 + + cross-spawn@6.0.6: + dependencies: + nice-try: 1.0.5 + path-key: 2.0.1 + semver: 5.7.2 + shebang-command: 1.2.0 + which: 1.3.1 + + cross-spawn@7.0.6: + dependencies: + path-key: 3.1.1 + shebang-command: 2.0.0 + which: 2.0.2 + + crypt@0.0.2: {} + + crypto-browserify@3.12.0: + dependencies: + browserify-cipher: 1.0.1 + browserify-sign: 4.2.3 + create-ecdh: 4.0.4 + create-hash: 1.2.0 + create-hmac: 1.1.7 + diffie-hellman: 5.0.3 + inherits: 2.0.4 + pbkdf2: 3.1.2 + public-encrypt: 4.0.3 + randombytes: 2.1.0 + randomfill: 1.0.4 + + d@1.0.2: + dependencies: + es5-ext: 0.10.64 + type: 2.7.3 + + dargs@7.0.0: {} + + dashdash@1.14.1: + dependencies: + assert-plus: 1.0.0 + + data-view-buffer@1.0.2: + dependencies: + call-bound: 1.0.4 + es-errors: 1.3.0 + is-data-view: 1.0.2 + + data-view-byte-length@1.0.2: + dependencies: + call-bound: 1.0.4 + es-errors: 1.3.0 + is-data-view: 1.0.2 + + data-view-byte-offset@1.0.1: + dependencies: + call-bound: 1.0.4 + es-errors: 1.3.0 + is-data-view: 1.0.2 + + dataloader@2.2.2: {} + + dataloader@2.2.3: {} + + dayjs@1.11.7: {} + + death@1.1.0: {} + + debug@2.6.9: + dependencies: + ms: 2.0.0 + + debug@3.1.0(supports-color@4.4.0): + dependencies: + ms: 2.0.0 + optionalDependencies: + supports-color: 4.4.0 + + debug@3.2.6: + dependencies: + ms: 2.1.3 + + debug@3.2.7: + dependencies: + ms: 2.1.3 + + debug@4.4.0(supports-color@8.1.1): + dependencies: + ms: 2.1.3 + optionalDependencies: + supports-color: 8.1.1 + + debug@4.4.0(supports-color@9.4.0): + dependencies: + ms: 2.1.3 + optionalDependencies: + supports-color: 9.4.0 + + decamelize-keys@1.1.1: + dependencies: + decamelize: 1.2.0 + map-obj: 1.0.1 + + decamelize@1.2.0: {} + + decamelize@4.0.0: {} + + decimal.js@10.5.0: {} + + decode-uri-component@0.2.2: {} + + decompress-response@3.3.0: + dependencies: + mimic-response: 1.0.1 + + decompress-response@4.2.1: + dependencies: + mimic-response: 2.1.0 + optional: true + + decompress-response@6.0.0: + dependencies: + mimic-response: 3.1.0 + + dedent@0.7.0: {} + + deep-eql@3.0.1: + dependencies: + type-detect: 4.1.0 + + deep-eql@4.1.4: + dependencies: + type-detect: 4.1.0 + + deep-equal@1.1.2: + dependencies: + is-arguments: 1.2.0 + is-date-object: 1.1.0 + is-regex: 1.1.4 + object-is: 1.1.6 + object-keys: 1.1.1 + regexp.prototype.flags: 1.5.4 + + deep-extend@0.6.0: {} + + deep-is@0.1.4: {} + + defer-to-connect@1.1.3: {} + + defer-to-connect@2.0.1: {} + + deferred-leveldown@1.2.2: + dependencies: + abstract-leveldown: 2.6.3 + + deferred-leveldown@4.0.2: + dependencies: + abstract-leveldown: 5.0.0 + inherits: 2.0.4 + + define-data-property@1.1.4: + dependencies: + es-define-property: 1.0.1 + es-errors: 1.3.0 + gopd: 1.2.0 + + define-lazy-prop@2.0.0: {} + + define-properties@1.2.1: + dependencies: + define-data-property: 1.1.4 + has-property-descriptors: 1.0.2 + object-keys: 1.1.1 + + define-property@0.2.5: + dependencies: + is-descriptor: 0.1.7 + + define-property@1.0.0: + dependencies: + is-descriptor: 1.0.3 + + define-property@2.0.2: + dependencies: + is-descriptor: 1.0.3 + isobject: 3.0.1 + + defined@1.0.1: {} + + delayed-stream@1.0.0: {} + + delegates@1.0.0: + optional: true + + delete-empty@3.0.0: + dependencies: + ansi-colors: 4.1.3 + minimist: 1.2.8 + path-starts-with: 2.0.1 + rimraf: 2.7.1 + + delimit-stream@0.1.0: {} + + depd@1.1.2: {} + + depd@2.0.0: {} + + dependency-graph@0.11.0: {} + + des.js@1.1.0: + dependencies: + inherits: 2.0.4 + minimalistic-assert: 1.0.1 + + destroy@1.0.4: {} + + destroy@1.2.0: {} + + detect-file@1.0.0: {} + + detect-indent@4.0.0: + dependencies: + repeating: 2.0.1 + + detect-indent@6.1.0: {} + + detect-libc@1.0.3: + optional: true + + detect-port@1.6.1: + dependencies: + address: 1.2.2 + debug: 4.4.0(supports-color@9.4.0) + transitivePeerDependencies: + - supports-color + + diff@3.3.1: {} + + diff@3.5.0: {} + + diff@4.0.2: {} + + diff@5.2.0: {} + + diffie-hellman@5.0.3: + dependencies: + bn.js: 4.12.2 + miller-rabin: 4.0.1 + randombytes: 2.1.0 + + difflib@0.2.4: + dependencies: + heap: 0.2.7 + + dir-glob@3.0.1: + dependencies: + path-type: 4.0.0 + + dns-over-http-resolver@1.2.3(node-fetch@2.7.0(encoding@0.1.13)): + dependencies: + debug: 4.4.0(supports-color@9.4.0) + native-fetch: 3.0.0(node-fetch@2.7.0(encoding@0.1.13)) + receptacle: 1.3.2 + transitivePeerDependencies: + - node-fetch + - supports-color + + dnscache@1.0.2: + dependencies: + asap: 2.0.6 + lodash.clone: 4.5.0 + + doctrine@3.0.0: + dependencies: + esutils: 2.0.3 + + dom-walk@0.1.2: {} + + dot-case@3.0.4: + dependencies: + no-case: 3.0.4 + tslib: 2.8.1 + + dot-prop@5.3.0: + dependencies: + is-obj: 2.0.0 + + dotenv@16.5.0: {} + + dotenv@9.0.2: {} + + dotignore@0.1.2: + dependencies: + minimatch: 3.1.2 + + dottie@2.0.6: {} + + dset@3.1.4: {} + + dunder-proto@1.0.1: + dependencies: + call-bind-apply-helpers: 1.0.2 + es-errors: 1.3.0 + gopd: 1.2.0 + + duplexer3@0.1.5: {} + + duplexify@4.1.3: + dependencies: + end-of-stream: 1.4.4 + inherits: 2.0.4 + readable-stream: 3.6.2 + stream-shift: 1.0.3 + + eastasianwidth@0.2.0: {} + + ecc-jsbn@0.1.2: + dependencies: + jsbn: 0.1.1 + safer-buffer: 2.1.2 + + ee-first@1.1.1: {} + + electron-to-chromium@1.5.150: {} + + elliptic@6.5.4: + dependencies: + bn.js: 4.12.2 + brorand: 1.1.0 + hash.js: 1.1.7 + hmac-drbg: 1.0.1 + inherits: 2.0.4 + minimalistic-assert: 1.0.1 + minimalistic-crypto-utils: 1.0.1 + + elliptic@6.6.1: + dependencies: + bn.js: 4.12.2 + brorand: 1.1.0 + hash.js: 1.1.7 + hmac-drbg: 1.0.1 + inherits: 2.0.4 + minimalistic-assert: 1.0.1 + minimalistic-crypto-utils: 1.0.1 + + emoji-regex@10.4.0: {} + + emoji-regex@8.0.0: {} + + emoji-regex@9.2.2: {} + + enabled@2.0.0: {} + + encode-utf8@1.0.3: {} + + encodeurl@1.0.2: {} + + encodeurl@2.0.0: {} + + encoding-down@5.0.4: + dependencies: + abstract-leveldown: 5.0.0 + inherits: 2.0.4 + level-codec: 9.0.2 + level-errors: 2.0.1 + xtend: 4.0.2 + + encoding@0.1.13: + dependencies: + iconv-lite: 0.6.3 + + end-of-stream@1.4.4: + dependencies: + once: 1.4.0 + + enquirer@2.4.1: + dependencies: + ansi-colors: 4.1.3 + strip-ansi: 6.0.1 + + env-paths@2.2.1: {} + + environment@1.1.0: {} + + eol@0.9.1: {} + + err-code@2.0.3: {} + + err-code@3.0.1: {} + + errno@0.1.8: + dependencies: + prr: 1.0.1 + + error-ex@1.3.2: + dependencies: + is-arrayish: 0.2.1 + + error-stack-parser@2.1.4: + dependencies: + stackframe: 1.3.4 + + es-abstract@1.23.9: + dependencies: + array-buffer-byte-length: 1.0.2 + arraybuffer.prototype.slice: 1.0.4 + available-typed-arrays: 1.0.7 + call-bind: 1.0.8 + call-bound: 1.0.4 + data-view-buffer: 1.0.2 + data-view-byte-length: 1.0.2 + data-view-byte-offset: 1.0.1 + es-define-property: 1.0.1 + es-errors: 1.3.0 + es-object-atoms: 1.1.1 + es-set-tostringtag: 2.1.0 + es-to-primitive: 1.3.0 + function.prototype.name: 1.1.8 + get-intrinsic: 1.3.0 + get-proto: 1.0.1 + get-symbol-description: 1.1.0 + globalthis: 1.0.4 + gopd: 1.2.0 + has-property-descriptors: 1.0.2 + has-proto: 1.2.0 + has-symbols: 1.1.0 + hasown: 2.0.2 + internal-slot: 1.1.0 + is-array-buffer: 3.0.5 + is-callable: 1.2.7 + is-data-view: 1.0.2 + is-regex: 1.2.1 + is-shared-array-buffer: 1.0.4 + is-string: 1.1.1 + is-typed-array: 1.1.15 + is-weakref: 1.1.1 + math-intrinsics: 1.1.0 + object-inspect: 1.13.4 + object-keys: 1.1.1 + object.assign: 4.1.7 + own-keys: 1.0.1 + regexp.prototype.flags: 1.5.4 + safe-array-concat: 1.1.3 + safe-push-apply: 1.0.0 + safe-regex-test: 1.1.0 + set-proto: 1.0.0 + string.prototype.trim: 1.2.10 + string.prototype.trimend: 1.0.9 + string.prototype.trimstart: 1.0.8 + typed-array-buffer: 1.0.3 + typed-array-byte-length: 1.0.3 + typed-array-byte-offset: 1.0.4 + typed-array-length: 1.0.7 + unbox-primitive: 1.1.0 + which-typed-array: 1.1.19 + + es-array-method-boxes-properly@1.0.0: {} + + es-define-property@1.0.1: {} + + es-errors@1.3.0: {} + + es-object-atoms@1.1.1: + dependencies: + es-errors: 1.3.0 + + es-set-tostringtag@2.1.0: + dependencies: + es-errors: 1.3.0 + get-intrinsic: 1.3.0 + has-tostringtag: 1.0.2 + hasown: 2.0.2 + + es-to-primitive@1.3.0: + dependencies: + is-callable: 1.2.7 + is-date-object: 1.1.0 + is-symbol: 1.1.1 + + es5-ext@0.10.64: + dependencies: + es6-iterator: 2.0.3 + es6-symbol: 3.1.4 + esniff: 2.0.1 + next-tick: 1.1.0 + + es6-iterator@2.0.3: + dependencies: + d: 1.0.2 + es5-ext: 0.10.64 + es6-symbol: 3.1.4 + + es6-promise@4.2.8: {} + + es6-symbol@3.1.4: + dependencies: + d: 1.0.2 + ext: 1.7.0 + + escalade@3.2.0: {} + + escape-html@1.0.3: {} + + escape-string-regexp@1.0.5: {} + + escape-string-regexp@2.0.0: {} + + escape-string-regexp@4.0.0: {} + + escodegen@1.8.1: + dependencies: + esprima: 2.7.3 + estraverse: 1.9.3 + esutils: 2.0.3 + optionator: 0.8.3 + optionalDependencies: + source-map: 0.2.0 + + eslint-plugin-no-only-tests@3.3.0: {} + + eslint-plugin-no-secrets@0.8.9(eslint@8.57.1): + dependencies: + eslint: 8.57.1 + + eslint-scope@7.2.2: + dependencies: + esrecurse: 4.3.0 + estraverse: 5.3.0 + + eslint-visitor-keys@3.4.3: {} + + eslint@8.57.1: + dependencies: + '@eslint-community/eslint-utils': 4.7.0(eslint@8.57.1) + '@eslint-community/regexpp': 4.12.1 + '@eslint/eslintrc': 2.1.4 + '@eslint/js': 8.57.1 + '@humanwhocodes/config-array': 0.13.0 + '@humanwhocodes/module-importer': 1.0.1 + '@nodelib/fs.walk': 1.2.8 + '@ungap/structured-clone': 1.3.0 + ajv: 6.12.6 + chalk: 4.1.2 + cross-spawn: 7.0.6 + debug: 4.4.0(supports-color@9.4.0) + doctrine: 3.0.0 + escape-string-regexp: 4.0.0 + eslint-scope: 7.2.2 + eslint-visitor-keys: 3.4.3 + espree: 9.6.1 + esquery: 1.6.0 + esutils: 2.0.3 + fast-deep-equal: 3.1.3 + file-entry-cache: 6.0.1 + find-up: 5.0.0 + glob-parent: 6.0.2 + globals: 13.24.0 + graphemer: 1.4.0 + ignore: 5.3.2 + imurmurhash: 0.1.4 + is-glob: 4.0.3 + is-path-inside: 3.0.3 + js-yaml: 4.1.0 + json-stable-stringify-without-jsonify: 1.0.1 + levn: 0.4.1 + lodash.merge: 4.6.2 + minimatch: 3.1.2 + natural-compare: 1.4.0 + optionator: 0.9.4 + strip-ansi: 6.0.1 + text-table: 0.2.0 + transitivePeerDependencies: + - supports-color + + esniff@2.0.1: + dependencies: + d: 1.0.2 + es5-ext: 0.10.64 + event-emitter: 0.3.5 + type: 2.7.3 + + espree@9.6.1: + dependencies: + acorn: 8.14.1 + acorn-jsx: 5.3.2(acorn@8.14.1) + eslint-visitor-keys: 3.4.3 + + esprima@2.7.3: {} + + esprima@4.0.1: {} + + esquery@1.6.0: + dependencies: + estraverse: 5.3.0 + + esrecurse@4.3.0: + dependencies: + estraverse: 5.3.0 + + estraverse@1.9.3: {} + + estraverse@5.3.0: {} + + esutils@2.0.3: {} + + etag@1.8.1: {} + + eth-block-tracker@3.0.1: + dependencies: + eth-query: 2.1.2 + ethereumjs-tx: 1.3.7 + ethereumjs-util: 5.2.1 + ethjs-util: 0.1.6 + json-rpc-engine: 3.8.0 + pify: 2.3.0 + tape: 4.17.0 + transitivePeerDependencies: + - supports-color + + eth-ens-namehash@2.0.8: + dependencies: + idna-uts46-hx: 2.3.1 + js-sha3: 0.5.7 + + eth-gas-reporter@0.2.27(bufferutil@4.0.9)(utf-8-validate@5.0.10): + dependencies: + '@solidity-parser/parser': 0.14.5 + axios: 1.9.0(debug@4.4.0) + cli-table3: 0.5.1 + colors: 1.4.0 + ethereum-cryptography: 1.2.0 + ethers: 5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + fs-readdir-recursive: 1.1.0 + lodash: 4.17.21 + markdown-table: 1.1.3 + mocha: 10.8.2 + req-cwd: 2.0.0 + sha1: 1.1.1 + sync-request: 6.1.0 + transitivePeerDependencies: + - bufferutil + - debug + - utf-8-validate + + eth-json-rpc-infura@3.2.1(encoding@0.1.13): + dependencies: + cross-fetch: 2.2.6(encoding@0.1.13) + eth-json-rpc-middleware: 1.6.0 + json-rpc-engine: 3.8.0 + json-rpc-error: 2.0.0 + transitivePeerDependencies: + - encoding + - supports-color + + eth-json-rpc-middleware@1.6.0: + dependencies: + async: 2.6.2 + eth-query: 2.1.2 + eth-tx-summary: 3.2.4 + ethereumjs-block: 1.7.1 + ethereumjs-tx: 1.3.7 + ethereumjs-util: 5.2.1 + ethereumjs-vm: 2.6.0 + fetch-ponyfill: 4.1.0 + json-rpc-engine: 3.8.0 + json-rpc-error: 2.0.0 + json-stable-stringify: 1.3.0 + promise-to-callback: 1.0.0 + tape: 4.17.0 + transitivePeerDependencies: + - supports-color + + eth-lib@0.1.29(bufferutil@4.0.9)(utf-8-validate@5.0.10): + dependencies: + bn.js: 4.12.2 + elliptic: 6.6.1 + nano-json-stream-parser: 0.1.2 + servify: 0.1.12 + ws: 3.3.3(bufferutil@4.0.9)(utf-8-validate@5.0.10) + xhr-request-promise: 0.1.3 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + + eth-lib@0.2.8: + dependencies: + bn.js: 4.12.2 + elliptic: 6.6.1 + xhr-request-promise: 0.1.3 + + eth-query@2.1.2: + dependencies: + json-rpc-random-id: 1.0.1 + xtend: 4.0.2 + + eth-sig-util@1.4.2: + dependencies: + ethereumjs-abi: https://codeload.github.com/ethereumjs/ethereumjs-abi/tar.gz/ee3994657fa7a427238e6ba92a84d0b529bbcde0 + ethereumjs-util: 5.2.1 + + eth-sig-util@3.0.0: + dependencies: + buffer: 5.7.1 + elliptic: 6.6.1 + ethereumjs-abi: 0.6.5 + ethereumjs-util: 5.2.1 + tweetnacl: 1.0.3 + tweetnacl-util: 0.15.1 + + eth-tx-summary@3.2.4: + dependencies: + async: 2.6.2 + clone: 2.1.2 + concat-stream: 1.6.2 + end-of-stream: 1.4.4 + eth-query: 2.1.2 + ethereumjs-block: 1.7.1 + ethereumjs-tx: 1.3.7 + ethereumjs-util: 5.2.1 + ethereumjs-vm: 2.6.0 + through2: 2.0.5 + + ethashjs@0.0.8: + dependencies: + async: 2.6.2 + buffer-xor: 2.0.2 + ethereumjs-util: 7.1.5 + miller-rabin: 4.0.1 + + ethereum-bloom-filters@1.2.0: + dependencies: + '@noble/hashes': 1.8.0 + + ethereum-common@0.0.18: {} + + ethereum-common@0.2.0: {} + + ethereum-cryptography@0.1.3: + dependencies: + '@types/pbkdf2': 3.1.2 + '@types/secp256k1': 4.0.6 + blakejs: 1.2.1 + browserify-aes: 1.2.0 + bs58check: 2.1.2 + create-hash: 1.2.0 + create-hmac: 1.1.7 + hash.js: 1.1.7 + keccak: 3.0.4 + pbkdf2: 3.1.2 + randombytes: 2.1.0 + safe-buffer: 5.2.1 + scrypt-js: 3.0.1 + secp256k1: 4.0.4 + setimmediate: 1.0.5 + + ethereum-cryptography@1.2.0: + dependencies: + '@noble/hashes': 1.2.0 + '@noble/secp256k1': 1.7.1 + '@scure/bip32': 1.1.5 + '@scure/bip39': 1.1.1 + + ethereum-cryptography@2.2.1: + dependencies: + '@noble/curves': 1.4.2 + '@noble/hashes': 1.4.0 + '@scure/bip32': 1.4.0 + '@scure/bip39': 1.3.0 + + ethereum-waffle@3.4.4(bufferutil@4.0.9)(encoding@0.1.13)(typescript@4.9.5)(utf-8-validate@5.0.10): + dependencies: + '@ethereum-waffle/chai': 3.4.4(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10) + '@ethereum-waffle/compiler': 3.4.4(bufferutil@4.0.9)(encoding@0.1.13)(typescript@4.9.5)(utf-8-validate@5.0.10) + '@ethereum-waffle/mock-contract': 3.4.4(bufferutil@4.0.9)(utf-8-validate@5.0.10) + '@ethereum-waffle/provider': 3.4.4(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10) + ethers: 5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + transitivePeerDependencies: + - bufferutil + - encoding + - supports-color + - typescript + - utf-8-validate + + ethereum-waffle@3.4.4(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.8.3)(utf-8-validate@5.0.10): + dependencies: + '@ethereum-waffle/chai': 3.4.4(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10) + '@ethereum-waffle/compiler': 3.4.4(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.8.3)(utf-8-validate@5.0.10) + '@ethereum-waffle/mock-contract': 3.4.4(bufferutil@4.0.9)(utf-8-validate@5.0.10) + '@ethereum-waffle/provider': 3.4.4(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10) + ethers: 5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + transitivePeerDependencies: + - bufferutil + - encoding + - supports-color + - typescript + - utf-8-validate + + ethereumjs-abi@0.6.5: + dependencies: + bn.js: 4.12.2 + ethereumjs-util: 4.5.1 + + ethereumjs-abi@0.6.8: + dependencies: + bn.js: 4.12.2 + ethereumjs-util: 6.2.1 + + ethereumjs-abi@https://codeload.github.com/ethereumjs/ethereumjs-abi/tar.gz/ee3994657fa7a427238e6ba92a84d0b529bbcde0: + dependencies: + bn.js: 4.12.2 + ethereumjs-util: 6.2.1 + + ethereumjs-account@2.0.5: + dependencies: + ethereumjs-util: 5.2.1 + rlp: 2.2.7 + safe-buffer: 5.2.1 + + ethereumjs-account@3.0.0: + dependencies: + ethereumjs-util: 6.2.1 + rlp: 2.2.7 + safe-buffer: 5.2.1 + + ethereumjs-block@1.7.1: + dependencies: + async: 2.6.2 + ethereum-common: 0.2.0 + ethereumjs-tx: 1.3.7 + ethereumjs-util: 5.2.1 + merkle-patricia-tree: 2.3.2 + + ethereumjs-block@2.2.2: + dependencies: + async: 2.6.2 + ethereumjs-common: 1.5.0 + ethereumjs-tx: 2.1.2 + ethereumjs-util: 5.2.1 + merkle-patricia-tree: 2.3.2 + + ethereumjs-blockchain@4.0.4: + dependencies: + async: 2.6.2 + ethashjs: 0.0.8 + ethereumjs-block: 2.2.2 + ethereumjs-common: 1.5.0 + ethereumjs-util: 6.2.1 + flow-stoplight: 1.0.0 + level-mem: 3.0.1 + lru-cache: 5.1.1 + rlp: 2.2.7 + semaphore: 1.1.0 + + ethereumjs-common@1.5.0: {} + + ethereumjs-tx@1.3.7: + dependencies: + ethereum-common: 0.0.18 + ethereumjs-util: 5.2.1 + + ethereumjs-tx@2.1.2: + dependencies: + ethereumjs-common: 1.5.0 + ethereumjs-util: 6.2.1 + + ethereumjs-util@4.5.1: + dependencies: + bn.js: 4.12.2 + create-hash: 1.2.0 + elliptic: 6.6.1 + ethereum-cryptography: 0.1.3 + rlp: 2.2.7 + + ethereumjs-util@5.2.1: + dependencies: + bn.js: 4.12.2 + create-hash: 1.2.0 + elliptic: 6.6.1 + ethereum-cryptography: 0.1.3 + ethjs-util: 0.1.6 + rlp: 2.2.7 + safe-buffer: 5.2.1 + + ethereumjs-util@6.2.1: + dependencies: + '@types/bn.js': 4.11.6 + bn.js: 4.12.2 + create-hash: 1.2.0 + elliptic: 6.6.1 + ethereum-cryptography: 0.1.3 + ethjs-util: 0.1.6 + rlp: 2.2.7 + + ethereumjs-util@7.1.5: + dependencies: + '@types/bn.js': 5.1.6 + bn.js: 5.2.2 + create-hash: 1.2.0 + ethereum-cryptography: 0.1.3 + rlp: 2.2.7 + + ethereumjs-vm@2.6.0: + dependencies: + async: 2.6.2 + async-eventemitter: 0.2.4 + ethereumjs-account: 2.0.5 + ethereumjs-block: 2.2.2 + ethereumjs-common: 1.5.0 + ethereumjs-util: 6.2.1 + fake-merkle-patricia-tree: 1.0.1 + functional-red-black-tree: 1.0.1 + merkle-patricia-tree: 2.3.2 + rustbn.js: 0.2.0 + safe-buffer: 5.2.1 + + ethereumjs-vm@4.2.0: + dependencies: + async: 2.6.2 + async-eventemitter: 0.2.4 + core-js-pure: 3.42.0 + ethereumjs-account: 3.0.0 + ethereumjs-block: 2.2.2 + ethereumjs-blockchain: 4.0.4 + ethereumjs-common: 1.5.0 + ethereumjs-tx: 2.1.2 + ethereumjs-util: 6.2.1 + fake-merkle-patricia-tree: 1.0.1 + functional-red-black-tree: 1.0.1 + merkle-patricia-tree: 2.3.2 + rustbn.js: 0.2.0 + safe-buffer: 5.2.1 + util.promisify: 1.1.3 + + ethereumjs-wallet@0.6.5: + dependencies: + aes-js: 3.1.2 + bs58check: 2.1.2 + ethereum-cryptography: 0.1.3 + ethereumjs-util: 6.2.1 + randombytes: 2.1.0 + safe-buffer: 5.2.1 + scryptsy: 1.2.1 + utf8: 3.0.0 + uuid: 3.4.0 + optional: true + + ethers@4.0.49: + dependencies: + aes-js: 3.0.0 + bn.js: 4.12.2 + elliptic: 6.5.4 + hash.js: 1.1.3 + js-sha3: 0.5.7 + scrypt-js: 2.0.4 + setimmediate: 1.0.4 + uuid: 2.0.1 + xmlhttprequest: 1.8.0 + + ethers@5.6.2(bufferutil@4.0.9)(utf-8-validate@5.0.10): + dependencies: + '@ethersproject/abi': 5.6.0 + '@ethersproject/abstract-provider': 5.6.0 + '@ethersproject/abstract-signer': 5.6.0 + '@ethersproject/address': 5.6.0 + '@ethersproject/base64': 5.6.0 + '@ethersproject/basex': 5.6.0 + '@ethersproject/bignumber': 5.6.0 + '@ethersproject/bytes': 5.6.1 + '@ethersproject/constants': 5.6.0 + '@ethersproject/contracts': 5.6.0 + '@ethersproject/hash': 5.6.0 + '@ethersproject/hdnode': 5.6.0 + '@ethersproject/json-wallets': 5.6.0 + '@ethersproject/keccak256': 5.6.0 + '@ethersproject/logger': 5.6.0 + '@ethersproject/networks': 5.6.1 + '@ethersproject/pbkdf2': 5.6.0 + '@ethersproject/properties': 5.6.0 + '@ethersproject/providers': 5.6.2(bufferutil@4.0.9)(utf-8-validate@5.0.10) + '@ethersproject/random': 5.6.0 + '@ethersproject/rlp': 5.6.0 + '@ethersproject/sha2': 5.6.0 + '@ethersproject/signing-key': 5.6.0 + '@ethersproject/solidity': 5.6.0 + '@ethersproject/strings': 5.6.0 + '@ethersproject/transactions': 5.6.0 + '@ethersproject/units': 5.6.0 + '@ethersproject/wallet': 5.6.0 + '@ethersproject/web': 5.6.0 + '@ethersproject/wordlists': 5.6.0 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + + ethers@5.7.0(bufferutil@4.0.9)(utf-8-validate@5.0.10): + dependencies: + '@ethersproject/abi': 5.7.0 + '@ethersproject/abstract-provider': 5.7.0 + '@ethersproject/abstract-signer': 5.7.0 + '@ethersproject/address': 5.7.0 + '@ethersproject/base64': 5.7.0 + '@ethersproject/basex': 5.7.0 + '@ethersproject/bignumber': 5.7.0 + '@ethersproject/bytes': 5.7.0 + '@ethersproject/constants': 5.7.0 + '@ethersproject/contracts': 5.7.0 + '@ethersproject/hash': 5.7.0 + '@ethersproject/hdnode': 5.7.0 + '@ethersproject/json-wallets': 5.7.0 + '@ethersproject/keccak256': 5.7.0 + '@ethersproject/logger': 5.7.0 + '@ethersproject/networks': 5.7.0 + '@ethersproject/pbkdf2': 5.7.0 + '@ethersproject/properties': 5.7.0 + '@ethersproject/providers': 5.7.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + '@ethersproject/random': 5.7.0 + '@ethersproject/rlp': 5.7.0 + '@ethersproject/sha2': 5.7.0 + '@ethersproject/signing-key': 5.7.0 + '@ethersproject/solidity': 5.7.0 + '@ethersproject/strings': 5.7.0 + '@ethersproject/transactions': 5.7.0 + '@ethersproject/units': 5.7.0 + '@ethersproject/wallet': 5.7.0 + '@ethersproject/web': 5.7.0 + '@ethersproject/wordlists': 5.7.0 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + + ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10): + dependencies: + '@ethersproject/abi': 5.8.0 + '@ethersproject/abstract-provider': 5.8.0 + '@ethersproject/abstract-signer': 5.8.0 + '@ethersproject/address': 5.8.0 + '@ethersproject/base64': 5.8.0 + '@ethersproject/basex': 5.8.0 + '@ethersproject/bignumber': 5.8.0 + '@ethersproject/bytes': 5.8.0 + '@ethersproject/constants': 5.8.0 + '@ethersproject/contracts': 5.8.0 + '@ethersproject/hash': 5.8.0 + '@ethersproject/hdnode': 5.8.0 + '@ethersproject/json-wallets': 5.8.0 + '@ethersproject/keccak256': 5.8.0 + '@ethersproject/logger': 5.8.0 + '@ethersproject/networks': 5.8.0 + '@ethersproject/pbkdf2': 5.8.0 + '@ethersproject/properties': 5.8.0 + '@ethersproject/providers': 5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + '@ethersproject/random': 5.8.0 + '@ethersproject/rlp': 5.8.0 + '@ethersproject/sha2': 5.8.0 + '@ethersproject/signing-key': 5.8.0 + '@ethersproject/solidity': 5.8.0 + '@ethersproject/strings': 5.8.0 + '@ethersproject/transactions': 5.8.0 + '@ethersproject/units': 5.8.0 + '@ethersproject/wallet': 5.8.0 + '@ethersproject/web': 5.8.0 + '@ethersproject/wordlists': 5.8.0 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + + ethers@6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10): + dependencies: + '@adraffy/ens-normalize': 1.10.1 + '@noble/curves': 1.2.0 + '@noble/hashes': 1.3.2 + '@types/node': 22.7.5 + aes-js: 4.0.0-beta.5 + tslib: 2.7.0 + ws: 8.17.1(bufferutil@4.0.9)(utf-8-validate@5.0.10) + transitivePeerDependencies: + - bufferutil + - utf-8-validate + + ethjs-unit@0.1.6: + dependencies: + bn.js: 4.11.6 + number-to-bn: 1.7.0 + + ethjs-util@0.1.6: + dependencies: + is-hex-prefixed: 1.0.0 + strip-hex-prefix: 1.0.0 + + ethlint@1.2.5(solium@1.2.5): + dependencies: + ajv: 5.5.2 + chokidar: 1.7.0 + colors: 1.4.0 + commander: 2.20.3 + diff: 3.5.0 + eol: 0.9.1 + js-string-escape: 1.0.1 + lodash: 4.17.21 + sol-digger: 0.0.2 + sol-explore: 1.6.1 + solium-plugin-security: 0.1.1(solium@1.2.5) + solparse: 2.2.8 + text-table: 0.2.0 + transitivePeerDependencies: + - solium + - supports-color + + event-emitter@0.3.5: + dependencies: + d: 1.0.2 + es5-ext: 0.10.64 + + event-target-shim@5.0.1: {} + + eventemitter3@4.0.4: {} + + eventemitter3@4.0.7: {} + + eventemitter3@5.0.1: {} + + events@3.3.0: {} + + evp_bytestokey@1.0.3: + dependencies: + md5.js: 1.3.5 + safe-buffer: 5.2.1 + + execa@0.7.0: + dependencies: + cross-spawn: 5.1.0 + get-stream: 3.0.0 + is-stream: 1.1.0 + npm-run-path: 2.0.2 + p-finally: 1.0.0 + signal-exit: 3.0.7 + strip-eof: 1.0.0 + + execa@4.1.0: + dependencies: + cross-spawn: 7.0.6 + get-stream: 5.2.0 + human-signals: 1.1.1 + is-stream: 2.0.1 + merge-stream: 2.0.0 + npm-run-path: 4.0.1 + onetime: 5.1.2 + signal-exit: 3.0.7 + strip-final-newline: 2.0.0 + + execa@5.1.1: + dependencies: + cross-spawn: 7.0.6 + get-stream: 6.0.1 + human-signals: 2.1.0 + is-stream: 2.0.1 + merge-stream: 2.0.0 + npm-run-path: 4.0.1 + onetime: 5.1.2 + signal-exit: 3.0.7 + strip-final-newline: 2.0.0 + + execa@8.0.1: + dependencies: + cross-spawn: 7.0.6 + get-stream: 8.0.1 + human-signals: 5.0.0 + is-stream: 3.0.0 + merge-stream: 2.0.0 + npm-run-path: 5.3.0 + onetime: 6.0.0 + signal-exit: 4.1.0 + strip-final-newline: 3.0.0 + + expand-brackets@0.1.5: + dependencies: + is-posix-bracket: 0.1.1 + + expand-brackets@2.1.4: + dependencies: + debug: 2.6.9 + define-property: 0.2.5 + extend-shallow: 2.0.1 + posix-character-classes: 0.1.1 + regex-not: 1.0.2 + snapdragon: 0.8.2 + to-regex: 3.0.2 + transitivePeerDependencies: + - supports-color + + expand-range@1.8.2: + dependencies: + fill-range: 2.2.4 + + expand-template@2.0.3: + optional: true + + expand-tilde@2.0.2: + dependencies: + homedir-polyfill: 1.0.3 + + exponential-backoff@3.1.2: {} + + express@4.17.3: + dependencies: + accepts: 1.3.8 + array-flatten: 1.1.1 + body-parser: 1.19.2 + content-disposition: 0.5.4 + content-type: 1.0.5 + cookie: 0.4.2 + cookie-signature: 1.0.6 + debug: 2.6.9 + depd: 1.1.2 + encodeurl: 1.0.2 + escape-html: 1.0.3 + etag: 1.8.1 + finalhandler: 1.1.2 + fresh: 0.5.2 + merge-descriptors: 1.0.1 + methods: 1.1.2 + on-finished: 2.3.0 + parseurl: 1.3.3 + path-to-regexp: 0.1.7 + proxy-addr: 2.0.7 + qs: 6.9.7 + range-parser: 1.2.1 + safe-buffer: 5.2.1 + send: 0.17.2 + serve-static: 1.14.2 + setprototypeof: 1.2.0 + statuses: 1.5.0 + type-is: 1.6.18 + utils-merge: 1.0.1 + vary: 1.1.2 + transitivePeerDependencies: + - supports-color + + express@4.18.2: + dependencies: + accepts: 1.3.8 + array-flatten: 1.1.1 + body-parser: 1.20.1 + content-disposition: 0.5.4 + content-type: 1.0.5 + cookie: 0.5.0 + cookie-signature: 1.0.6 + debug: 2.6.9 + depd: 2.0.0 + encodeurl: 1.0.2 + escape-html: 1.0.3 + etag: 1.8.1 + finalhandler: 1.2.0 + fresh: 0.5.2 + http-errors: 2.0.0 + merge-descriptors: 1.0.1 + methods: 1.1.2 + on-finished: 2.4.1 + parseurl: 1.3.3 + path-to-regexp: 0.1.7 + proxy-addr: 2.0.7 + qs: 6.11.0 + range-parser: 1.2.1 + safe-buffer: 5.2.1 + send: 0.18.0 + serve-static: 1.15.0 + setprototypeof: 1.2.0 + statuses: 2.0.1 + type-is: 1.6.18 + utils-merge: 1.0.1 + vary: 1.1.2 + transitivePeerDependencies: + - supports-color + + express@4.21.2: + dependencies: + accepts: 1.3.8 + array-flatten: 1.1.1 + body-parser: 1.20.3 + content-disposition: 0.5.4 + content-type: 1.0.5 + cookie: 0.7.1 + cookie-signature: 1.0.6 + debug: 2.6.9 + depd: 2.0.0 + encodeurl: 2.0.0 + escape-html: 1.0.3 + etag: 1.8.1 + finalhandler: 1.3.1 + fresh: 0.5.2 + http-errors: 2.0.0 + merge-descriptors: 1.0.3 + methods: 1.1.2 + on-finished: 2.4.1 + parseurl: 1.3.3 + path-to-regexp: 0.1.12 + proxy-addr: 2.0.7 + qs: 6.13.0 + range-parser: 1.2.1 + safe-buffer: 5.2.1 + send: 0.19.0 + serve-static: 1.16.2 + setprototypeof: 1.2.0 + statuses: 2.0.1 + type-is: 1.6.18 + utils-merge: 1.0.1 + vary: 1.1.2 + transitivePeerDependencies: + - supports-color + + ext@1.7.0: + dependencies: + type: 2.7.3 + + extend-shallow@2.0.1: + dependencies: + is-extendable: 0.1.1 + + extend-shallow@3.0.2: + dependencies: + assign-symbols: 1.0.0 + is-extendable: 1.0.1 + + extend@3.0.2: {} + + extendable-error@0.1.7: {} + + external-editor@3.1.0: + dependencies: + chardet: 0.7.0 + iconv-lite: 0.4.24 + tmp: 0.0.33 + + extglob@0.3.2: + dependencies: + is-extglob: 1.0.0 + + extglob@2.0.4: + dependencies: + array-unique: 0.3.2 + define-property: 1.0.0 + expand-brackets: 2.1.4 + extend-shallow: 2.0.1 + fragment-cache: 0.2.1 + regex-not: 1.0.2 + snapdragon: 0.8.2 + to-regex: 3.0.2 + transitivePeerDependencies: + - supports-color + + extract-files@11.0.0: {} + + extsprintf@1.3.0: {} + + fake-merkle-patricia-tree@1.0.1: + dependencies: + checkpoint-store: 1.1.0 + + fast-base64-decode@1.0.0: {} + + fast-decode-uri-component@1.0.1: {} + + fast-deep-equal@1.1.0: {} + + fast-deep-equal@3.1.3: {} + + fast-diff@1.3.0: {} + + fast-fifo@1.3.2: {} + + fast-glob@3.3.2: + dependencies: + '@nodelib/fs.stat': 2.0.5 + '@nodelib/fs.walk': 1.2.8 + glob-parent: 5.1.2 + merge2: 1.4.1 + micromatch: 4.0.8 + + fast-glob@3.3.3: + dependencies: + '@nodelib/fs.stat': 2.0.5 + '@nodelib/fs.walk': 1.2.8 + glob-parent: 5.1.2 + merge2: 1.4.1 + micromatch: 4.0.8 + + fast-json-stable-stringify@2.1.0: {} + + fast-levenshtein@2.0.6: {} + + fast-querystring@1.1.2: + dependencies: + fast-decode-uri-component: 1.0.1 + + fast-redact@3.5.0: {} + + fast-uri@3.0.6: {} + + fast-url-parser@1.1.3: + dependencies: + punycode: 1.4.1 + + fastify-warning@0.2.0: {} + + fastq@1.19.1: + dependencies: + reusify: 1.1.0 + + fb-watchman@2.0.2: + dependencies: + bser: 2.1.1 + + fbjs-css-vars@1.0.2: {} + + fbjs@3.0.5(encoding@0.1.13): + dependencies: + cross-fetch: 3.2.0(encoding@0.1.13) + fbjs-css-vars: 1.0.2 + loose-envify: 1.4.0 + object-assign: 4.1.1 + promise: 7.3.1 + setimmediate: 1.0.5 + ua-parser-js: 1.0.40 + transitivePeerDependencies: + - encoding + + fdir@6.4.4(picomatch@4.0.2): + optionalDependencies: + picomatch: 4.0.2 + + fecha@4.2.3: {} + + fetch-ponyfill@4.1.0: + dependencies: + node-fetch: 1.7.3 + + fets@0.1.5: + dependencies: + '@ardatan/fast-json-stringify': 0.0.6(ajv-formats@2.1.1(ajv@8.17.1))(ajv@8.17.1) + '@whatwg-node/cookie-store': 0.0.1 + '@whatwg-node/fetch': 0.8.8 + '@whatwg-node/server': 0.7.7 + ajv: 8.17.1 + ajv-formats: 2.1.1(ajv@8.17.1) + hotscript: 1.0.13 + json-schema-to-ts: 2.12.0 + openapi-types: 12.1.3 + tslib: 2.8.1 + zod: 3.24.4 + zod-to-json-schema: 3.24.5(zod@3.24.4) + + figures@3.2.0: + dependencies: + escape-string-regexp: 1.0.5 + + file-entry-cache@6.0.1: + dependencies: + flat-cache: 3.2.0 + + file-uri-to-path@1.0.0: + optional: true + + filename-regex@2.0.1: {} + + fill-range@2.2.4: + dependencies: + is-number: 2.1.0 + isobject: 2.1.0 + randomatic: 3.1.1 + repeat-element: 1.1.4 + repeat-string: 1.6.1 + + fill-range@4.0.0: + dependencies: + extend-shallow: 2.0.1 + is-number: 3.0.0 + repeat-string: 1.6.1 + to-regex-range: 2.1.1 + + fill-range@7.1.1: + dependencies: + to-regex-range: 5.0.1 + + finalhandler@1.1.2: + dependencies: + debug: 2.6.9 + encodeurl: 1.0.2 + escape-html: 1.0.3 + on-finished: 2.3.0 + parseurl: 1.3.3 + statuses: 1.5.0 + unpipe: 1.0.0 + transitivePeerDependencies: + - supports-color + + finalhandler@1.2.0: + dependencies: + debug: 2.6.9 + encodeurl: 1.0.2 + escape-html: 1.0.3 + on-finished: 2.4.1 + parseurl: 1.3.3 + statuses: 2.0.1 + unpipe: 1.0.0 + transitivePeerDependencies: + - supports-color + + finalhandler@1.3.1: + dependencies: + debug: 2.6.9 + encodeurl: 2.0.0 + escape-html: 1.0.3 + on-finished: 2.4.1 + parseurl: 1.3.3 + statuses: 2.0.1 + unpipe: 1.0.0 + transitivePeerDependencies: + - supports-color + + find-replace@1.0.3: + dependencies: + array-back: 1.0.4 + test-value: 2.1.0 + + find-replace@3.0.0: + dependencies: + array-back: 3.1.0 + + find-up@1.1.2: + dependencies: + path-exists: 2.1.0 + pinkie-promise: 2.0.1 + + find-up@2.1.0: + dependencies: + locate-path: 2.0.0 + + find-up@4.1.0: + dependencies: + locate-path: 5.0.0 + path-exists: 4.0.0 + + find-up@5.0.0: + dependencies: + locate-path: 6.0.0 + path-exists: 4.0.0 + + find-yarn-workspace-root@1.2.1: + dependencies: + fs-extra: 4.0.3 + micromatch: 3.1.10 + transitivePeerDependencies: + - supports-color + + find-yarn-workspace-root@2.0.0: + dependencies: + micromatch: 4.0.8 + + findup-sync@5.0.0: + dependencies: + detect-file: 1.0.0 + is-glob: 4.0.3 + micromatch: 4.0.8 + resolve-dir: 1.0.1 + + flat-cache@3.2.0: + dependencies: + flatted: 3.3.3 + keyv: 4.5.4 + rimraf: 3.0.2 + + flat@5.0.2: {} + + flatted@3.3.3: {} + + flow-enums-runtime@0.0.6: {} + + flow-stoplight@1.0.0: {} + + fmix@0.1.0: + dependencies: + imul: 1.0.1 + + fn.name@1.1.0: {} + + follow-redirects@1.15.9(debug@4.4.0): + optionalDependencies: + debug: 4.4.0(supports-color@9.4.0) + + for-each@0.3.5: + dependencies: + is-callable: 1.2.7 + + for-in@1.0.2: {} + + for-own@0.1.5: + dependencies: + for-in: 1.0.2 + + foreach@2.0.6: {} + + foreground-child@3.3.1: + dependencies: + cross-spawn: 7.0.6 + signal-exit: 4.1.0 + + forever-agent@0.6.1: {} + + form-data-encoder@1.7.1: {} + + form-data-encoder@2.1.4: {} + + form-data@2.3.3: + dependencies: + asynckit: 0.4.0 + combined-stream: 1.0.8 + mime-types: 2.1.35 + + form-data@2.5.3: + dependencies: + asynckit: 0.4.0 + combined-stream: 1.0.8 + es-set-tostringtag: 2.1.0 + mime-types: 2.1.35 + safe-buffer: 5.2.1 + + form-data@3.0.3: + dependencies: + asynckit: 0.4.0 + combined-stream: 1.0.8 + es-set-tostringtag: 2.1.0 + mime-types: 2.1.35 + + form-data@4.0.2: + dependencies: + asynckit: 0.4.0 + combined-stream: 1.0.8 + es-set-tostringtag: 2.1.0 + mime-types: 2.1.35 + + forwarded@0.2.0: {} + + fp-ts@1.19.3: {} + + fragment-cache@0.2.1: + dependencies: + map-cache: 0.2.2 + + fresh@0.5.2: {} + + fs-constants@1.0.0: + optional: true + + fs-extra@0.30.0: + dependencies: + graceful-fs: 4.2.11 + jsonfile: 2.4.0 + klaw: 1.3.1 + path-is-absolute: 1.0.1 + rimraf: 2.7.1 + + fs-extra@10.1.0: + dependencies: + graceful-fs: 4.2.11 + jsonfile: 6.1.0 + universalify: 2.0.1 + + fs-extra@11.3.0: + dependencies: + graceful-fs: 4.2.11 + jsonfile: 6.1.0 + universalify: 2.0.1 + + fs-extra@4.0.3: + dependencies: + graceful-fs: 4.2.11 + jsonfile: 4.0.0 + universalify: 0.1.2 + + fs-extra@7.0.1: + dependencies: + graceful-fs: 4.2.11 + jsonfile: 4.0.0 + universalify: 0.1.2 + + fs-extra@8.1.0: + dependencies: + graceful-fs: 4.2.11 + jsonfile: 4.0.0 + universalify: 0.1.2 + + fs-extra@9.1.0: + dependencies: + at-least-node: 1.0.0 + graceful-fs: 4.2.11 + jsonfile: 6.1.0 + universalify: 2.0.1 + + fs-minipass@1.2.7: + dependencies: + minipass: 2.9.0 + + fs-readdir-recursive@1.1.0: {} + + fs.realpath@1.0.0: {} + + fsevents@1.2.13: + dependencies: + bindings: 1.5.0 + nan: 2.22.2 + optional: true + + fsevents@2.3.3: + optional: true + + function-bind@1.1.2: {} + + function.prototype.name@1.1.8: + dependencies: + call-bind: 1.0.8 + call-bound: 1.0.4 + define-properties: 1.2.1 + functions-have-names: 1.2.3 + hasown: 2.0.2 + is-callable: 1.2.7 + + functional-red-black-tree@1.0.1: {} + + functions-have-names@1.2.3: {} + + ganache-core@2.13.2(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10): + dependencies: + abstract-leveldown: 3.0.0 + async: 2.6.2 + bip39: 2.5.0 + cachedown: 1.0.0 + clone: 2.1.2 + debug: 3.2.6 + encoding-down: 5.0.4 + eth-sig-util: 3.0.0 + ethereumjs-abi: 0.6.8 + ethereumjs-account: 3.0.0 + ethereumjs-block: 2.2.2 + ethereumjs-common: 1.5.0 + ethereumjs-tx: 2.1.2 + ethereumjs-util: 6.2.1 + ethereumjs-vm: 4.2.0 + heap: 0.2.6 + level-sublevel: 6.6.4 + levelup: 3.1.1 + lodash: 4.17.20 + lru-cache: 5.1.1 + merkle-patricia-tree: 3.0.0 + patch-package: 6.2.2 + seedrandom: 3.0.1 + source-map-support: 0.5.12 + tmp: 0.1.0 + web3-provider-engine: 14.2.1(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10) + websocket: 1.0.32 + optionalDependencies: + ethereumjs-wallet: 0.6.5 + web3: 1.2.11(bufferutil@4.0.9)(utf-8-validate@5.0.10) + transitivePeerDependencies: + - bufferutil + - encoding + - supports-color + - utf-8-validate + + gauge@2.7.4: + dependencies: + aproba: 1.2.0 + console-control-strings: 1.1.0 + has-unicode: 2.0.1 + object-assign: 4.1.1 + signal-exit: 3.0.7 + string-width: 1.0.2 + strip-ansi: 3.0.1 + wide-align: 1.1.5 + optional: true + + gensync@1.0.0-beta.2: {} + + get-caller-file@1.0.3: {} + + get-caller-file@2.0.5: {} + + get-east-asian-width@1.3.0: {} + + get-func-name@2.0.2: {} + + get-intrinsic@1.3.0: + dependencies: + call-bind-apply-helpers: 1.0.2 + es-define-property: 1.0.1 + es-errors: 1.3.0 + es-object-atoms: 1.1.1 + function-bind: 1.1.2 + get-proto: 1.0.1 + gopd: 1.2.0 + has-symbols: 1.1.0 + hasown: 2.0.2 + math-intrinsics: 1.1.0 + + get-iterator@1.0.2: {} + + get-own-enumerable-property-symbols@3.0.2: {} + + get-package-type@0.1.0: {} + + get-port@3.2.0: {} + + get-proto@1.0.1: + dependencies: + dunder-proto: 1.0.1 + es-object-atoms: 1.1.1 + + get-stream@3.0.0: {} + + get-stream@4.1.0: + dependencies: + pump: 3.0.2 + + get-stream@5.2.0: + dependencies: + pump: 3.0.2 + + get-stream@6.0.1: {} + + get-stream@8.0.1: {} + + get-symbol-description@1.1.0: + dependencies: + call-bound: 1.0.4 + es-errors: 1.3.0 + get-intrinsic: 1.3.0 + + get-value@2.0.6: {} + + getpass@0.1.7: + dependencies: + assert-plus: 1.0.0 + + ghost-testrpc@0.0.2: + dependencies: + chalk: 2.4.2 + node-emoji: 1.11.0 + + git-raw-commits@2.0.11: + dependencies: + dargs: 7.0.0 + lodash: 4.17.21 + meow: 8.1.2 + split2: 3.2.2 + through2: 4.0.2 + + github-from-package@0.0.0: + optional: true + + glob-base@0.3.0: + dependencies: + glob-parent: 2.0.0 + is-glob: 2.0.1 + + glob-parent@2.0.0: + dependencies: + is-glob: 2.0.1 + + glob-parent@5.1.2: + dependencies: + is-glob: 4.0.3 + + glob-parent@6.0.2: + dependencies: + is-glob: 4.0.3 + + glob@10.4.5: + dependencies: + foreground-child: 3.3.1 + jackspeak: 3.4.3 + minimatch: 9.0.5 + minipass: 7.1.2 + package-json-from-dist: 1.0.1 + path-scurry: 1.11.1 + + glob@11.0.2: + dependencies: + foreground-child: 3.3.1 + jackspeak: 4.1.0 + minimatch: 10.0.1 + minipass: 7.1.2 + package-json-from-dist: 1.0.1 + path-scurry: 2.0.0 + + glob@5.0.15: + dependencies: + inflight: 1.0.6 + inherits: 2.0.4 + minimatch: 3.1.2 + once: 1.4.0 + path-is-absolute: 1.0.1 + + glob@7.1.2: + dependencies: + fs.realpath: 1.0.0 + inflight: 1.0.6 + inherits: 2.0.4 + minimatch: 3.1.2 + once: 1.4.0 + path-is-absolute: 1.0.1 + + glob@7.1.7: + dependencies: + fs.realpath: 1.0.0 + inflight: 1.0.6 + inherits: 2.0.4 + minimatch: 3.1.2 + once: 1.4.0 + path-is-absolute: 1.0.1 + + glob@7.2.0: + dependencies: + fs.realpath: 1.0.0 + inflight: 1.0.6 + inherits: 2.0.4 + minimatch: 3.1.2 + once: 1.4.0 + path-is-absolute: 1.0.1 + + glob@7.2.3: + dependencies: + fs.realpath: 1.0.0 + inflight: 1.0.6 + inherits: 2.0.4 + minimatch: 3.1.2 + once: 1.4.0 + path-is-absolute: 1.0.1 + + glob@8.1.0: + dependencies: + fs.realpath: 1.0.0 + inflight: 1.0.6 + inherits: 2.0.4 + minimatch: 5.1.6 + once: 1.4.0 + + global-dirs@0.1.1: + dependencies: + ini: 1.3.8 + + global-modules@1.0.0: + dependencies: + global-prefix: 1.0.2 + is-windows: 1.0.2 + resolve-dir: 1.0.1 + + global-modules@2.0.0: + dependencies: + global-prefix: 3.0.0 + + global-prefix@1.0.2: + dependencies: + expand-tilde: 2.0.2 + homedir-polyfill: 1.0.3 + ini: 1.3.8 + is-windows: 1.0.2 + which: 1.3.1 + + global-prefix@3.0.0: + dependencies: + ini: 1.3.8 + kind-of: 6.0.3 + which: 1.3.1 + + global@4.4.0: + dependencies: + min-document: 2.19.0 + process: 0.11.10 + + globals@11.12.0: {} + + globals@13.24.0: + dependencies: + type-fest: 0.20.2 + + globals@16.0.0: {} + + globals@9.18.0: {} + + globalthis@1.0.4: + dependencies: + define-properties: 1.2.1 + gopd: 1.2.0 + + globby@10.0.2: + dependencies: + '@types/glob': 7.2.0 + array-union: 2.1.0 + dir-glob: 3.0.1 + fast-glob: 3.3.3 + glob: 7.2.3 + ignore: 5.3.2 + merge2: 1.4.1 + slash: 3.0.0 + + globby@11.1.0: + dependencies: + array-union: 2.1.0 + dir-glob: 3.0.1 + fast-glob: 3.3.3 + ignore: 5.3.2 + merge2: 1.4.1 + slash: 3.0.0 + + gopd@1.2.0: {} + + got@11.8.6: + dependencies: + '@sindresorhus/is': 4.6.0 + '@szmarczak/http-timer': 4.0.6 + '@types/cacheable-request': 6.0.3 + '@types/responselike': 1.0.3 + cacheable-lookup: 5.0.4 + cacheable-request: 7.0.4 + decompress-response: 6.0.0 + http2-wrapper: 1.0.3 + lowercase-keys: 2.0.0 + p-cancelable: 2.1.1 + responselike: 2.0.1 + + got@12.1.0: + dependencies: + '@sindresorhus/is': 4.6.0 + '@szmarczak/http-timer': 5.0.1 + '@types/cacheable-request': 6.0.3 + '@types/responselike': 1.0.3 + cacheable-lookup: 6.1.0 + cacheable-request: 7.0.4 + decompress-response: 6.0.0 + form-data-encoder: 1.7.1 + get-stream: 6.0.1 + http2-wrapper: 2.2.1 + lowercase-keys: 3.0.0 + p-cancelable: 3.0.0 + responselike: 2.0.1 + + got@12.6.1: + dependencies: + '@sindresorhus/is': 5.6.0 + '@szmarczak/http-timer': 5.0.1 + cacheable-lookup: 7.0.0 + cacheable-request: 10.2.14 + decompress-response: 6.0.0 + form-data-encoder: 2.1.4 + get-stream: 6.0.1 + http2-wrapper: 2.2.1 + lowercase-keys: 3.0.0 + p-cancelable: 3.0.0 + responselike: 3.0.0 + + got@9.6.0: + dependencies: + '@sindresorhus/is': 0.14.0 + '@szmarczak/http-timer': 1.1.2 + '@types/keyv': 3.1.4 + '@types/responselike': 1.0.3 + cacheable-request: 6.1.0 + decompress-response: 3.3.0 + duplexer3: 0.1.5 + get-stream: 4.1.0 + lowercase-keys: 1.0.1 + mimic-response: 1.0.1 + p-cancelable: 1.1.0 + to-readable-stream: 1.0.0 + url-parse-lax: 3.0.0 + + graceful-fs@4.2.10: {} + + graceful-fs@4.2.11: {} + + graphemer@1.4.0: {} + + graphql-import-node@0.0.5(graphql@16.11.0): + dependencies: + graphql: 16.11.0 + + graphql-tag@2.12.6(graphql@16.11.0): + dependencies: + graphql: 16.11.0 + tslib: 2.8.1 + + graphql-tag@2.12.6(graphql@16.3.0): + dependencies: + graphql: 16.3.0 + tslib: 2.8.1 + + graphql-tag@2.12.6(graphql@16.8.0): + dependencies: + graphql: 16.8.0 + tslib: 2.8.1 + + graphql-ws@5.12.1(graphql@16.11.0): + dependencies: + graphql: 16.11.0 + + graphql-ws@5.16.2(graphql@16.11.0): + dependencies: + graphql: 16.11.0 + + graphql-yoga@3.9.1(graphql@16.11.0): + dependencies: + '@envelop/core': 3.0.6 + '@envelop/validation-cache': 5.1.3(@envelop/core@3.0.6)(graphql@16.11.0) + '@graphql-tools/executor': 0.0.18(graphql@16.11.0) + '@graphql-tools/schema': 9.0.19(graphql@16.11.0) + '@graphql-tools/utils': 9.2.1(graphql@16.11.0) + '@graphql-yoga/logger': 0.0.1 + '@graphql-yoga/subscription': 3.1.0 + '@whatwg-node/fetch': 0.8.8 + '@whatwg-node/server': 0.7.7 + dset: 3.1.4 + graphql: 16.11.0 + lru-cache: 7.18.3 + tslib: 2.8.1 + + graphql@16.11.0: {} + + graphql@16.3.0: {} + + graphql@16.8.0: {} + + growl@1.10.3: {} + + handlebars@4.7.8: + dependencies: + minimist: 1.2.8 + neo-async: 2.6.2 + source-map: 0.6.1 + wordwrap: 1.0.0 + optionalDependencies: + uglify-js: 3.19.3 + + har-schema@2.0.0: {} + + har-validator@5.1.5: + dependencies: + ajv: 6.12.6 + har-schema: 2.0.0 + + hard-rejection@2.1.0: {} + + hardhat-abi-exporter@2.11.0(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@17.0.45)(typescript@4.9.5))(typescript@4.9.5)(utf-8-validate@5.0.10)): + dependencies: + '@ethersproject/abi': 5.8.0 + delete-empty: 3.0.0 + hardhat: 2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@17.0.45)(typescript@4.9.5))(typescript@4.9.5)(utf-8-validate@5.0.10) + + hardhat-abi-exporter@2.11.0(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)): + dependencies: + '@ethersproject/abi': 5.8.0 + delete-empty: 3.0.0 + hardhat: 2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10) + + hardhat-abi-exporter@2.11.0(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)): + dependencies: + '@ethersproject/abi': 5.8.0 + delete-empty: 3.0.0 + hardhat: 2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10) + + hardhat-contract-sizer@2.10.0(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@17.0.45)(typescript@4.9.5))(typescript@4.9.5)(utf-8-validate@5.0.10)): + dependencies: + chalk: 4.1.2 + cli-table3: 0.6.5 + hardhat: 2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@17.0.45)(typescript@4.9.5))(typescript@4.9.5)(utf-8-validate@5.0.10) + strip-ansi: 6.0.1 + + hardhat-contract-sizer@2.10.0(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)): + dependencies: + chalk: 4.1.2 + cli-table3: 0.6.5 + hardhat: 2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10) + strip-ansi: 6.0.1 + + hardhat-contract-sizer@2.10.0(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)): + dependencies: + chalk: 4.1.2 + cli-table3: 0.6.5 + hardhat: 2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10) + strip-ansi: 6.0.1 + + hardhat-deploy@0.7.11(@ethersproject/hardware-wallets@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(bufferutil@4.0.9)(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10))(utf-8-validate@5.0.10): + dependencies: + '@ethersproject/abi': 5.8.0 + '@ethersproject/abstract-signer': 5.8.0 + '@ethersproject/address': 5.8.0 + '@ethersproject/bignumber': 5.8.0 + '@ethersproject/bytes': 5.8.0 + '@ethersproject/contracts': 5.8.0 + '@ethersproject/hardware-wallets': 5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + '@ethersproject/providers': 5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + '@ethersproject/solidity': 5.8.0 + '@ethersproject/transactions': 5.8.0 + '@ethersproject/wallet': 5.8.0 + '@types/qs': 6.9.18 + axios: 0.21.4(debug@4.4.0) + chalk: 4.1.2 + chokidar: 3.6.0 + debug: 4.4.0(supports-color@9.4.0) + form-data: 3.0.3 + fs-extra: 9.1.0 + hardhat: 2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10) + match-all: 1.2.7 + murmur-128: 0.2.1 + qs: 6.14.0 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + + hardhat-gas-reporter@1.0.10(bufferutil@4.0.9)(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@17.0.45)(typescript@4.9.5))(typescript@4.9.5)(utf-8-validate@5.0.10))(utf-8-validate@5.0.10): + dependencies: + array-uniq: 1.0.3 + eth-gas-reporter: 0.2.27(bufferutil@4.0.9)(utf-8-validate@5.0.10) + hardhat: 2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@17.0.45)(typescript@4.9.5))(typescript@4.9.5)(utf-8-validate@5.0.10) + sha1: 1.1.1 + transitivePeerDependencies: + - '@codechecks/client' + - bufferutil + - debug + - utf-8-validate + + hardhat-gas-reporter@1.0.10(bufferutil@4.0.9)(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10))(utf-8-validate@5.0.10): + dependencies: + array-uniq: 1.0.3 + eth-gas-reporter: 0.2.27(bufferutil@4.0.9)(utf-8-validate@5.0.10) + hardhat: 2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10) + sha1: 1.1.1 + transitivePeerDependencies: + - '@codechecks/client' + - bufferutil + - debug + - utf-8-validate + + hardhat-gas-reporter@1.0.10(bufferutil@4.0.9)(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10))(utf-8-validate@5.0.10): + dependencies: + array-uniq: 1.0.3 + eth-gas-reporter: 0.2.27(bufferutil@4.0.9)(utf-8-validate@5.0.10) + hardhat: 2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10) + sha1: 1.1.1 + transitivePeerDependencies: + - '@codechecks/client' + - bufferutil + - debug + - utf-8-validate + + hardhat-secure-accounts@0.0.5(@nomiclabs/hardhat-ethers@2.2.3(ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)))(ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)): + dependencies: + '@nomiclabs/hardhat-ethers': 2.2.3(ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)) + debug: 4.4.0(supports-color@9.4.0) + enquirer: 2.4.1 + ethers: 5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + hardhat: 2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10) + lodash.clonedeep: 4.5.0 + prompt-sync: 4.2.0 + transitivePeerDependencies: + - supports-color + + hardhat-secure-accounts@0.0.6(@nomiclabs/hardhat-ethers@2.2.3(ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)))(ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)): + dependencies: + '@nomiclabs/hardhat-ethers': 2.2.3(ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)) + debug: 4.4.0(supports-color@9.4.0) + enquirer: 2.4.1 + ethers: 5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + hardhat: 2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10) + lodash.clonedeep: 4.5.0 + prompt-sync: 4.2.0 + transitivePeerDependencies: + - supports-color + + hardhat-secure-accounts@1.0.5(@nomicfoundation/hardhat-ethers@3.0.8(ethers@6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)))(ethers@6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)): + dependencies: + '@nomicfoundation/hardhat-ethers': 3.0.8(ethers@6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)) + debug: 4.4.0(supports-color@9.4.0) + enquirer: 2.4.1 + ethers: 6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10) + hardhat: 2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10) + lodash.clonedeep: 4.5.0 + prompt-sync: 4.2.0 + transitivePeerDependencies: + - supports-color + + hardhat-secure-accounts@1.0.5(@nomicfoundation/hardhat-ethers@3.0.8(ethers@6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@8.10.2(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)))(ethers@6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@8.10.2(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)): + dependencies: + '@nomicfoundation/hardhat-ethers': 3.0.8(ethers@6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@8.10.2(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)) + debug: 4.4.0(supports-color@9.4.0) + enquirer: 2.4.1 + ethers: 6.13.7(bufferutil@4.0.9)(utf-8-validate@5.0.10) + hardhat: 2.23.0(bufferutil@4.0.9)(ts-node@8.10.2(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10) + lodash.clonedeep: 4.5.0 + prompt-sync: 4.2.0 + transitivePeerDependencies: + - supports-color + + hardhat-storage-layout@0.1.6(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)): + dependencies: + console-table-printer: 2.12.1 + hardhat: 2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10) + + hardhat-tracer@1.3.0(chalk@5.4.1)(ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)): + dependencies: + chalk: 5.4.1 + ethers: 5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + hardhat: 2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10) + + hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@17.0.45)(typescript@4.9.5))(typescript@4.9.5)(utf-8-validate@5.0.10): + dependencies: + '@ethersproject/abi': 5.8.0 + '@metamask/eth-sig-util': 4.0.1 + '@nomicfoundation/ethereumjs-block': 5.0.1(bufferutil@4.0.9)(utf-8-validate@5.0.10) + '@nomicfoundation/ethereumjs-blockchain': 7.0.1(bufferutil@4.0.9)(utf-8-validate@5.0.10) + '@nomicfoundation/ethereumjs-common': 4.0.1 + '@nomicfoundation/ethereumjs-evm': 2.0.1(bufferutil@4.0.9)(utf-8-validate@5.0.10) + '@nomicfoundation/ethereumjs-rlp': 5.0.1 + '@nomicfoundation/ethereumjs-statemanager': 2.0.1(bufferutil@4.0.9)(utf-8-validate@5.0.10) + '@nomicfoundation/ethereumjs-trie': 6.0.1 + '@nomicfoundation/ethereumjs-tx': 5.0.1(bufferutil@4.0.9)(utf-8-validate@5.0.10) + '@nomicfoundation/ethereumjs-util': 9.0.1 + '@nomicfoundation/ethereumjs-vm': 7.0.1(bufferutil@4.0.9)(utf-8-validate@5.0.10) + '@nomicfoundation/solidity-analyzer': 0.1.2 + '@sentry/node': 5.30.0 + '@types/bn.js': 5.1.6 + '@types/lru-cache': 5.1.1 + abort-controller: 3.0.0 + adm-zip: 0.4.16 + aggregate-error: 3.1.0 + ansi-escapes: 4.3.2 + chalk: 2.4.2 + chokidar: 3.6.0 + ci-info: 2.0.0 + debug: 4.4.0(supports-color@9.4.0) + enquirer: 2.4.1 + env-paths: 2.2.1 + ethereum-cryptography: 1.2.0 + ethereumjs-abi: 0.6.8 + find-up: 2.1.0 + fp-ts: 1.19.3 + fs-extra: 7.0.1 + glob: 7.2.0 + immutable: 4.3.7 + io-ts: 1.10.4 + keccak: 3.0.4 + lodash: 4.17.21 + mnemonist: 0.38.5 + mocha: 10.8.2 + p-map: 4.0.0 + qs: 6.14.0 + raw-body: 2.5.2 + resolve: 1.17.0 + semver: 6.3.1 + solc: 0.7.3(debug@4.4.0) + source-map-support: 0.5.21 + stacktrace-parser: 0.1.11 + tsort: 0.0.1 + undici: 5.29.0 + uuid: 8.3.2 + ws: 7.5.10(bufferutil@4.0.9)(utf-8-validate@5.0.10) + optionalDependencies: + ts-node: 10.9.2(@types/node@17.0.45)(typescript@4.9.5) + typescript: 4.9.5 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + + hardhat@2.14.1(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10): + dependencies: + '@ethersproject/abi': 5.8.0 + '@metamask/eth-sig-util': 4.0.1 + '@nomicfoundation/ethereumjs-block': 5.0.1(bufferutil@4.0.9)(utf-8-validate@5.0.10) + '@nomicfoundation/ethereumjs-blockchain': 7.0.1(bufferutil@4.0.9)(utf-8-validate@5.0.10) + '@nomicfoundation/ethereumjs-common': 4.0.1 + '@nomicfoundation/ethereumjs-evm': 2.0.1(bufferutil@4.0.9)(utf-8-validate@5.0.10) + '@nomicfoundation/ethereumjs-rlp': 5.0.1 + '@nomicfoundation/ethereumjs-statemanager': 2.0.1(bufferutil@4.0.9)(utf-8-validate@5.0.10) + '@nomicfoundation/ethereumjs-trie': 6.0.1 + '@nomicfoundation/ethereumjs-tx': 5.0.1(bufferutil@4.0.9)(utf-8-validate@5.0.10) + '@nomicfoundation/ethereumjs-util': 9.0.1 + '@nomicfoundation/ethereumjs-vm': 7.0.1(bufferutil@4.0.9)(utf-8-validate@5.0.10) + '@nomicfoundation/solidity-analyzer': 0.1.2 + '@sentry/node': 5.30.0 + '@types/bn.js': 5.1.6 + '@types/lru-cache': 5.1.1 + abort-controller: 3.0.0 + adm-zip: 0.4.16 + aggregate-error: 3.1.0 + ansi-escapes: 4.3.2 + chalk: 2.4.2 + chokidar: 3.6.0 + ci-info: 2.0.0 + debug: 4.4.0(supports-color@9.4.0) + enquirer: 2.4.1 + env-paths: 2.2.1 + ethereum-cryptography: 1.2.0 + ethereumjs-abi: 0.6.8 + find-up: 2.1.0 + fp-ts: 1.19.3 + fs-extra: 7.0.1 + glob: 7.2.0 + immutable: 4.3.7 + io-ts: 1.10.4 + keccak: 3.0.4 + lodash: 4.17.21 + mnemonist: 0.38.5 + mocha: 10.8.2 + p-map: 4.0.0 + qs: 6.14.0 + raw-body: 2.5.2 + resolve: 1.17.0 + semver: 6.3.1 + solc: 0.7.3(debug@4.4.0) + source-map-support: 0.5.21 + stacktrace-parser: 0.1.11 + tsort: 0.0.1 + undici: 5.29.0 + uuid: 8.3.2 + ws: 7.5.10(bufferutil@4.0.9)(utf-8-validate@5.0.10) + optionalDependencies: + ts-node: 10.9.2(@types/node@20.17.32)(typescript@5.8.3) + typescript: 5.8.3 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + + hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10): + dependencies: + '@ethereumjs/util': 9.1.0 + '@ethersproject/abi': 5.8.0 + '@nomicfoundation/edr': 0.10.0 + '@nomicfoundation/solidity-analyzer': 0.1.2 + '@sentry/node': 5.30.0 + '@types/bn.js': 5.1.6 + '@types/lru-cache': 5.1.1 + adm-zip: 0.4.16 + aggregate-error: 3.1.0 + ansi-escapes: 4.3.2 + boxen: 5.1.2 + chokidar: 4.0.3 + ci-info: 2.0.0 + debug: 4.4.0(supports-color@9.4.0) + enquirer: 2.4.1 + env-paths: 2.2.1 + ethereum-cryptography: 1.2.0 + find-up: 5.0.0 + fp-ts: 1.19.3 + fs-extra: 7.0.1 + immutable: 4.3.7 + io-ts: 1.10.4 + json-stream-stringify: 3.1.6 + keccak: 3.0.4 + lodash: 4.17.21 + micro-eth-signer: 0.14.0 + mnemonist: 0.38.5 + mocha: 10.8.2 + p-map: 4.0.0 + picocolors: 1.1.1 + raw-body: 2.5.2 + resolve: 1.17.0 + semver: 6.3.1 + solc: 0.8.26(debug@4.4.0) + source-map-support: 0.5.21 + stacktrace-parser: 0.1.11 + tinyglobby: 0.2.13 + tsort: 0.0.1 + undici: 5.29.0 + uuid: 8.3.2 + ws: 7.5.10(bufferutil@4.0.9)(utf-8-validate@5.0.10) + optionalDependencies: + ts-node: 10.9.2(@types/node@20.17.32)(typescript@5.8.3) + typescript: 5.8.3 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + + hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10): + dependencies: + '@ethereumjs/util': 9.1.0 + '@ethersproject/abi': 5.8.0 + '@nomicfoundation/edr': 0.10.0 + '@nomicfoundation/solidity-analyzer': 0.1.2 + '@sentry/node': 5.30.0 + '@types/bn.js': 5.1.6 + '@types/lru-cache': 5.1.1 + adm-zip: 0.4.16 + aggregate-error: 3.1.0 + ansi-escapes: 4.3.2 + boxen: 5.1.2 + chokidar: 4.0.3 + ci-info: 2.0.0 + debug: 4.4.0(supports-color@9.4.0) + enquirer: 2.4.1 + env-paths: 2.2.1 + ethereum-cryptography: 1.2.0 + find-up: 5.0.0 + fp-ts: 1.19.3 + fs-extra: 7.0.1 + immutable: 4.3.7 + io-ts: 1.10.4 + json-stream-stringify: 3.1.6 + keccak: 3.0.4 + lodash: 4.17.21 + micro-eth-signer: 0.14.0 + mnemonist: 0.38.5 + mocha: 10.8.2 + p-map: 4.0.0 + picocolors: 1.1.1 + raw-body: 2.5.2 + resolve: 1.17.0 + semver: 6.3.1 + solc: 0.8.26(debug@4.4.0) + source-map-support: 0.5.21 + stacktrace-parser: 0.1.11 + tinyglobby: 0.2.13 + tsort: 0.0.1 + undici: 5.29.0 + uuid: 8.3.2 + ws: 7.5.10(bufferutil@4.0.9)(utf-8-validate@5.0.10) + optionalDependencies: + ts-node: 10.9.2(@types/node@22.7.5)(typescript@5.8.3) + typescript: 5.8.3 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + + hardhat@2.23.0(bufferutil@4.0.9)(ts-node@8.10.2(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10): + dependencies: + '@ethereumjs/util': 9.1.0 + '@ethersproject/abi': 5.8.0 + '@nomicfoundation/edr': 0.10.0 + '@nomicfoundation/solidity-analyzer': 0.1.2 + '@sentry/node': 5.30.0 + '@types/bn.js': 5.1.6 + '@types/lru-cache': 5.1.1 + adm-zip: 0.4.16 + aggregate-error: 3.1.0 + ansi-escapes: 4.3.2 + boxen: 5.1.2 + chokidar: 4.0.3 + ci-info: 2.0.0 + debug: 4.4.0(supports-color@9.4.0) + enquirer: 2.4.1 + env-paths: 2.2.1 + ethereum-cryptography: 1.2.0 + find-up: 5.0.0 + fp-ts: 1.19.3 + fs-extra: 7.0.1 + immutable: 4.3.7 + io-ts: 1.10.4 + json-stream-stringify: 3.1.6 + keccak: 3.0.4 + lodash: 4.17.21 + micro-eth-signer: 0.14.0 + mnemonist: 0.38.5 + mocha: 10.8.2 + p-map: 4.0.0 + picocolors: 1.1.1 + raw-body: 2.5.2 + resolve: 1.17.0 + semver: 6.3.1 + solc: 0.8.26(debug@4.4.0) + source-map-support: 0.5.21 + stacktrace-parser: 0.1.11 + tinyglobby: 0.2.13 + tsort: 0.0.1 + undici: 5.29.0 + uuid: 8.3.2 + ws: 7.5.10(bufferutil@4.0.9)(utf-8-validate@5.0.10) + optionalDependencies: + ts-node: 8.10.2(typescript@5.8.3) + typescript: 5.8.3 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + + has-ansi@2.0.0: + dependencies: + ansi-regex: 2.1.1 + + has-bigints@1.1.0: {} + + has-flag@1.0.0: {} + + has-flag@2.0.0: {} + + has-flag@3.0.0: {} + + has-flag@4.0.0: {} + + has-property-descriptors@1.0.2: + dependencies: + es-define-property: 1.0.1 + + has-proto@1.2.0: + dependencies: + dunder-proto: 1.0.1 + + has-symbols@1.1.0: {} + + has-tostringtag@1.0.2: + dependencies: + has-symbols: 1.1.0 + + has-unicode@2.0.1: + optional: true + + has-value@0.3.1: + dependencies: + get-value: 2.0.6 + has-values: 0.1.4 + isobject: 2.1.0 + + has-value@1.0.0: + dependencies: + get-value: 2.0.6 + has-values: 1.0.0 + isobject: 3.0.1 + + has-values@0.1.4: {} + + has-values@1.0.0: + dependencies: + is-number: 3.0.0 + kind-of: 4.0.0 + + has@1.0.4: {} + + hash-base@3.0.5: + dependencies: + inherits: 2.0.4 + safe-buffer: 5.2.1 + + hash-base@3.1.0: + dependencies: + inherits: 2.0.4 + readable-stream: 3.6.2 + safe-buffer: 5.2.1 + + hash-it@6.0.0: {} + + hash.js@1.1.3: + dependencies: + inherits: 2.0.4 + minimalistic-assert: 1.0.1 + + hash.js@1.1.7: + dependencies: + inherits: 2.0.4 + minimalistic-assert: 1.0.1 + + hasown@2.0.2: + dependencies: + function-bind: 1.1.2 + + he@1.1.1: {} + + he@1.2.0: {} + + header-case@2.0.4: + dependencies: + capital-case: 1.0.4 + tslib: 2.8.1 + + heap@0.2.6: {} + + heap@0.2.7: {} + + helmet@5.0.2: {} + + helmet@7.0.0: {} + + hermes-estree@0.25.1: {} + + hermes-estree@0.28.1: {} + + hermes-parser@0.25.1: + dependencies: + hermes-estree: 0.25.1 + + hermes-parser@0.28.1: + dependencies: + hermes-estree: 0.28.1 + + hmac-drbg@1.0.1: + dependencies: + hash.js: 1.1.7 + minimalistic-assert: 1.0.1 + minimalistic-crypto-utils: 1.0.1 + + home-or-tmp@2.0.0: + dependencies: + os-homedir: 1.0.2 + os-tmpdir: 1.0.2 + + homedir-polyfill@1.0.3: + dependencies: + parse-passwd: 1.0.0 + + hosted-git-info@2.8.9: {} + + hosted-git-info@4.1.0: + dependencies: + lru-cache: 6.0.0 + + hotscript@1.0.13: {} + + http-basic@8.1.3: + dependencies: + caseless: 0.12.0 + concat-stream: 1.6.2 + http-response-object: 3.0.2 + parse-cache-control: 1.0.1 + + http-cache-semantics@4.1.1: {} + + http-errors@1.8.1: + dependencies: + depd: 1.1.2 + inherits: 2.0.4 + setprototypeof: 1.2.0 + statuses: 1.5.0 + toidentifier: 1.0.1 + + http-errors@2.0.0: + dependencies: + depd: 2.0.0 + inherits: 2.0.4 + setprototypeof: 1.2.0 + statuses: 2.0.1 + toidentifier: 1.0.1 + + http-https@1.0.0: {} + + http-response-object@3.0.2: + dependencies: + '@types/node': 10.17.60 + + http-signature@1.2.0: + dependencies: + assert-plus: 1.0.0 + jsprim: 1.4.2 + sshpk: 1.18.0 + + http2-wrapper@1.0.3: + dependencies: + quick-lru: 5.1.1 + resolve-alpn: 1.2.1 + + http2-wrapper@2.2.1: + dependencies: + quick-lru: 5.1.1 + resolve-alpn: 1.2.1 + + https-proxy-agent@5.0.1: + dependencies: + agent-base: 6.0.2 + debug: 4.4.0(supports-color@9.4.0) + transitivePeerDependencies: + - supports-color + + https-proxy-agent@7.0.6: + dependencies: + agent-base: 7.1.3 + debug: 4.4.0(supports-color@9.4.0) + transitivePeerDependencies: + - supports-color + + human-id@4.1.1: {} + + human-signals@1.1.1: {} + + human-signals@2.1.0: {} + + human-signals@5.0.0: {} + + husky@7.0.4: {} + + husky@8.0.3: {} + + iconv-lite@0.4.24: + dependencies: + safer-buffer: 2.1.2 + + iconv-lite@0.6.3: + dependencies: + safer-buffer: 2.1.2 + + idna-uts46-hx@2.3.1: + dependencies: + punycode: 2.1.0 + + ieee754@1.2.1: {} + + ignore@5.3.2: {} + + image-size@1.2.1: + dependencies: + queue: 6.0.2 + + immediate@3.0.6: {} + + immediate@3.2.3: {} + + immediate@3.3.0: {} + + immer@10.0.2: {} + + immutable@3.7.6: {} + + immutable@4.3.7: {} + + import-fresh@2.0.0: + dependencies: + caller-path: 2.0.0 + resolve-from: 3.0.0 + + import-fresh@3.3.1: + dependencies: + parent-module: 1.0.1 + resolve-from: 4.0.0 + + import-from@4.0.0: {} + + imul@1.0.1: {} + + imurmurhash@0.1.4: {} + + indent-string@4.0.0: {} + + inflection@1.13.4: {} + + inflight@1.0.6: + dependencies: + once: 1.4.0 + wrappy: 1.0.2 + + inherits@2.0.4: {} + + ini@1.3.8: {} + + inquirer@8.0.0: + dependencies: + ansi-escapes: 4.3.2 + chalk: 4.1.2 + cli-cursor: 3.1.0 + cli-width: 3.0.0 + external-editor: 3.1.0 + figures: 3.2.0 + lodash: 4.17.21 + mute-stream: 0.0.8 + run-async: 2.4.1 + rxjs: 6.6.7 + string-width: 4.2.3 + strip-ansi: 6.0.1 + through: 2.3.8 + + internal-slot@1.1.0: + dependencies: + es-errors: 1.3.0 + hasown: 2.0.2 + side-channel: 1.1.0 + + interpret@1.4.0: {} + + invariant@2.2.4: + dependencies: + loose-envify: 1.4.0 + + invert-kv@1.0.0: {} + + io-ts@1.10.4: + dependencies: + fp-ts: 1.19.3 + + ip-regex@4.3.0: {} + + ipaddr.js@1.9.1: {} + + ipfs-core-utils@0.4.0(encoding@0.1.13): + dependencies: + blob-to-it: 0.0.2 + browser-readablestream-to-it: 0.0.2 + cids: 1.1.9 + err-code: 2.0.3 + ipfs-utils: 3.0.0(encoding@0.1.13) + it-all: 1.0.6 + it-map: 1.0.6 + it-peekable: 0.0.1 + uint8arrays: 1.1.0 + transitivePeerDependencies: + - encoding + + ipfs-http-client@47.0.1(encoding@0.1.13): + dependencies: + abort-controller: 3.0.0 + any-signal: 1.2.0 + bignumber.js: 9.1.2 + cids: 1.1.9 + debug: 4.4.0(supports-color@9.4.0) + form-data: 3.0.3 + ipfs-core-utils: 0.4.0(encoding@0.1.13) + ipfs-utils: 3.0.0(encoding@0.1.13) + ipld-block: 0.10.1 + ipld-dag-cbor: 0.17.1 + ipld-dag-pb: 0.20.0 + ipld-raw: 6.0.0 + iso-url: 0.4.7 + it-last: 1.0.6 + it-map: 1.0.6 + it-tar: 1.2.2 + it-to-buffer: 1.0.5 + it-to-stream: 0.1.2 + merge-options: 2.0.0 + multiaddr: 8.1.2(node-fetch@2.7.0(encoding@0.1.13)) + multiaddr-to-uri: 6.0.0(node-fetch@2.7.0(encoding@0.1.13)) + multibase: 3.1.2 + multicodec: 2.1.3 + multihashes: 3.1.2 + nanoid: 3.3.11 + node-fetch: 2.7.0(encoding@0.1.13) + parse-duration: 0.4.4 + stream-to-it: 0.2.4 + uint8arrays: 1.1.0 + transitivePeerDependencies: + - encoding + - supports-color + + ipfs-utils@3.0.0(encoding@0.1.13): + dependencies: + abort-controller: 3.0.0 + any-signal: 1.2.0 + buffer: 5.7.1 + err-code: 2.0.3 + fs-extra: 9.1.0 + is-electron: 2.2.2 + iso-url: 0.4.7 + it-glob: 0.0.8 + merge-options: 2.0.0 + nanoid: 3.3.11 + node-fetch: 2.7.0(encoding@0.1.13) + stream-to-it: 0.2.4 + transitivePeerDependencies: + - encoding + + ipld-block@0.10.1: + dependencies: + cids: 1.1.9 + class-is: 1.1.0 + + ipld-dag-cbor@0.17.1: + dependencies: + borc: 2.1.2 + cids: 1.1.9 + is-circular: 1.0.2 + multicodec: 3.2.1 + multihashing-async: 2.1.4 + uint8arrays: 2.1.10 + + ipld-dag-pb@0.20.0: + dependencies: + cids: 1.1.9 + class-is: 1.1.0 + multicodec: 2.1.3 + multihashing-async: 2.1.4 + protons: 2.0.3 + reset: 0.1.0 + run: 1.5.0 + stable: 0.1.8 + uint8arrays: 1.1.0 + + ipld-raw@6.0.0: + dependencies: + cids: 1.1.9 + multicodec: 2.1.3 + multihashing-async: 2.1.4 + + is-absolute@1.0.0: + dependencies: + is-relative: 1.0.0 + is-windows: 1.0.2 + + is-accessor-descriptor@1.0.1: + dependencies: + hasown: 2.0.2 + + is-arguments@1.2.0: + dependencies: + call-bound: 1.0.4 + has-tostringtag: 1.0.2 + + is-array-buffer@3.0.5: + dependencies: + call-bind: 1.0.8 + call-bound: 1.0.4 + get-intrinsic: 1.3.0 + + is-arrayish@0.2.1: {} + + is-arrayish@0.3.2: {} + + is-async-function@2.1.1: + dependencies: + async-function: 1.0.0 + call-bound: 1.0.4 + get-proto: 1.0.1 + has-tostringtag: 1.0.2 + safe-regex-test: 1.1.0 + + is-bigint@1.1.0: + dependencies: + has-bigints: 1.1.0 + + is-binary-path@1.0.1: + dependencies: + binary-extensions: 1.13.1 + + is-binary-path@2.1.0: + dependencies: + binary-extensions: 2.3.0 + + is-boolean-object@1.2.2: + dependencies: + call-bound: 1.0.4 + has-tostringtag: 1.0.2 + + is-buffer@1.1.6: {} + + is-buffer@2.0.5: {} + + is-callable@1.2.7: {} + + is-ci@2.0.0: + dependencies: + ci-info: 2.0.0 + + is-circular@1.0.2: {} + + is-core-module@2.16.1: + dependencies: + hasown: 2.0.2 + + is-data-descriptor@1.0.1: + dependencies: + hasown: 2.0.2 + + is-data-view@1.0.2: + dependencies: + call-bound: 1.0.4 + get-intrinsic: 1.3.0 + is-typed-array: 1.1.15 + + is-date-object@1.1.0: + dependencies: + call-bound: 1.0.4 + has-tostringtag: 1.0.2 + + is-descriptor@0.1.7: + dependencies: + is-accessor-descriptor: 1.0.1 + is-data-descriptor: 1.0.1 + + is-descriptor@1.0.3: + dependencies: + is-accessor-descriptor: 1.0.1 + is-data-descriptor: 1.0.1 + + is-directory@0.3.1: {} + + is-docker@2.2.1: {} + + is-dotfile@1.0.3: {} + + is-electron@2.2.2: {} + + is-equal-shallow@0.1.3: + dependencies: + is-primitive: 2.0.0 + + is-extendable@0.1.1: {} + + is-extendable@1.0.1: + dependencies: + is-plain-object: 2.0.4 + + is-extglob@1.0.0: {} + + is-extglob@2.1.1: {} + + is-finalizationregistry@1.1.1: + dependencies: + call-bound: 1.0.4 + + is-finite@1.1.0: {} + + is-fn@1.0.0: {} + + is-fullwidth-code-point@1.0.0: + dependencies: + number-is-nan: 1.0.1 + + is-fullwidth-code-point@2.0.0: {} + + is-fullwidth-code-point@3.0.0: {} + + is-fullwidth-code-point@4.0.0: {} + + is-fullwidth-code-point@5.0.0: + dependencies: + get-east-asian-width: 1.3.0 + + is-function@1.0.2: {} + + is-generator-function@1.1.0: + dependencies: + call-bound: 1.0.4 + get-proto: 1.0.1 + has-tostringtag: 1.0.2 + safe-regex-test: 1.1.0 + + is-glob@2.0.1: + dependencies: + is-extglob: 1.0.0 + + is-glob@4.0.3: + dependencies: + is-extglob: 2.1.1 + + is-hex-prefixed@1.0.0: {} + + is-ip@3.1.0: + dependencies: + ip-regex: 4.3.0 + + is-lower-case@2.0.2: + dependencies: + tslib: 2.8.1 + + is-map@2.0.3: {} + + is-number-object@1.1.1: + dependencies: + call-bound: 1.0.4 + has-tostringtag: 1.0.2 + + is-number@2.1.0: + dependencies: + kind-of: 3.2.2 + + is-number@3.0.0: + dependencies: + kind-of: 3.2.2 + + is-number@4.0.0: {} + + is-number@7.0.0: {} + + is-obj@1.0.1: {} + + is-obj@2.0.0: {} + + is-path-inside@3.0.3: {} + + is-plain-obj@1.1.0: {} + + is-plain-obj@2.1.0: {} + + is-plain-object@2.0.4: + dependencies: + isobject: 3.0.1 + + is-posix-bracket@0.1.1: {} + + is-primitive@2.0.0: {} + + is-regex@1.1.4: + dependencies: + call-bind: 1.0.8 + has-tostringtag: 1.0.2 + + is-regex@1.2.1: + dependencies: + call-bound: 1.0.4 + gopd: 1.2.0 + has-tostringtag: 1.0.2 + hasown: 2.0.2 + + is-regexp@1.0.0: {} + + is-relative@1.0.0: + dependencies: + is-unc-path: 1.0.0 + + is-set@2.0.3: {} + + is-shared-array-buffer@1.0.4: + dependencies: + call-bound: 1.0.4 + + is-stream@1.1.0: {} + + is-stream@2.0.1: {} + + is-stream@3.0.0: {} + + is-string@1.1.1: + dependencies: + call-bound: 1.0.4 + has-tostringtag: 1.0.2 + + is-subdir@1.2.0: + dependencies: + better-path-resolve: 1.0.0 + + is-symbol@1.1.1: + dependencies: + call-bound: 1.0.4 + has-symbols: 1.1.0 + safe-regex-test: 1.1.0 + + is-text-path@1.0.1: + dependencies: + text-extensions: 1.9.0 + + is-text-path@2.0.0: + dependencies: + text-extensions: 2.4.0 + + is-typed-array@1.1.15: + dependencies: + which-typed-array: 1.1.19 + + is-typedarray@1.0.0: {} + + is-unc-path@1.0.0: + dependencies: + unc-path-regex: 0.1.2 + + is-unicode-supported@0.1.0: {} + + is-upper-case@2.0.2: + dependencies: + tslib: 2.8.1 + + is-url@1.2.4: {} + + is-utf8@0.2.1: {} + + is-weakmap@2.0.2: {} + + is-weakref@1.1.1: + dependencies: + call-bound: 1.0.4 + + is-weakset@2.0.4: + dependencies: + call-bound: 1.0.4 + get-intrinsic: 1.3.0 + + is-windows@1.0.2: {} + + is-wsl@2.2.0: + dependencies: + is-docker: 2.2.1 + + isarray@0.0.1: {} + + isarray@1.0.0: {} + + isarray@2.0.5: {} + + isexe@2.0.0: {} + + iso-constants@0.1.2: {} + + iso-url@0.4.7: {} + + isobject@2.1.0: + dependencies: + isarray: 1.0.0 + + isobject@3.0.1: {} + + isomorphic-fetch@3.0.0(encoding@0.1.13): + dependencies: + node-fetch: 2.7.0(encoding@0.1.13) + whatwg-fetch: 3.6.20 + transitivePeerDependencies: + - encoding + + isomorphic-unfetch@3.1.0(encoding@0.1.13): + dependencies: + node-fetch: 2.7.0(encoding@0.1.13) + unfetch: 4.2.0 + transitivePeerDependencies: + - encoding + + isomorphic-ws@5.0.0(ws@8.13.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)): + dependencies: + ws: 8.13.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + + isomorphic-ws@5.0.0(ws@8.18.2(bufferutil@4.0.9)(utf-8-validate@5.0.10)): + dependencies: + ws: 8.18.2(bufferutil@4.0.9)(utf-8-validate@5.0.10) + + isstream@0.1.2: {} + + istanbul-lib-coverage@3.2.2: {} + + istanbul-lib-instrument@5.2.1: + dependencies: + '@babel/core': 7.27.1 + '@babel/parser': 7.27.1 + '@istanbuljs/schema': 0.1.3 + istanbul-lib-coverage: 3.2.2 + semver: 6.3.1 + transitivePeerDependencies: + - supports-color + + it-all@1.0.6: {} + + it-concat@1.0.3: + dependencies: + bl: 4.1.0 + + it-glob@0.0.8: + dependencies: + fs-extra: 8.1.0 + minimatch: 3.1.2 + + it-last@1.0.6: {} + + it-map@1.0.6: {} + + it-peekable@0.0.1: {} + + it-reader@2.1.0: + dependencies: + bl: 4.1.0 + + it-tar@1.2.2: + dependencies: + bl: 4.1.0 + buffer: 5.7.1 + iso-constants: 0.1.2 + it-concat: 1.0.3 + it-reader: 2.1.0 + p-defer: 3.0.0 + + it-to-buffer@1.0.5: + dependencies: + buffer: 5.7.1 + + it-to-stream@0.1.2: + dependencies: + buffer: 5.7.1 + fast-fifo: 1.3.2 + get-iterator: 1.0.2 + p-defer: 3.0.0 + p-fifo: 1.0.0 + readable-stream: 3.6.2 + + jackspeak@3.4.3: + dependencies: + '@isaacs/cliui': 8.0.2 + optionalDependencies: + '@pkgjs/parseargs': 0.11.0 + + jackspeak@4.1.0: + dependencies: + '@isaacs/cliui': 8.0.2 + + jest-environment-node@29.7.0: + dependencies: + '@jest/environment': 29.7.0 + '@jest/fake-timers': 29.7.0 + '@jest/types': 29.6.3 + '@types/node': 20.17.32 + jest-mock: 29.7.0 + jest-util: 29.7.0 + + jest-get-type@29.6.3: {} + + jest-haste-map@29.7.0: + dependencies: + '@jest/types': 29.6.3 + '@types/graceful-fs': 4.1.9 + '@types/node': 20.17.32 + anymatch: 3.1.3 + fb-watchman: 2.0.2 + graceful-fs: 4.2.11 + jest-regex-util: 29.6.3 + jest-util: 29.7.0 + jest-worker: 29.7.0 + micromatch: 4.0.8 + walker: 1.0.8 + optionalDependencies: + fsevents: 2.3.3 + + jest-message-util@29.7.0: + dependencies: + '@babel/code-frame': 7.27.1 + '@jest/types': 29.6.3 + '@types/stack-utils': 2.0.3 + chalk: 4.1.2 + graceful-fs: 4.2.11 + micromatch: 4.0.8 + pretty-format: 29.7.0 + slash: 3.0.0 + stack-utils: 2.0.6 + + jest-mock@29.7.0: + dependencies: + '@jest/types': 29.6.3 + '@types/node': 20.17.32 + jest-util: 29.7.0 + + jest-regex-util@29.6.3: {} + + jest-util@29.7.0: + dependencies: + '@jest/types': 29.6.3 + '@types/node': 20.17.32 + chalk: 4.1.2 + ci-info: 3.9.0 + graceful-fs: 4.2.11 + picomatch: 2.3.1 + + jest-validate@29.7.0: + dependencies: + '@jest/types': 29.6.3 + camelcase: 6.3.0 + chalk: 4.1.2 + jest-get-type: 29.6.3 + leven: 3.1.0 + pretty-format: 29.7.0 + + jest-worker@29.7.0: + dependencies: + '@types/node': 20.17.32 + jest-util: 29.7.0 + merge-stream: 2.0.0 + supports-color: 8.1.1 + + jiti@1.21.7: {} + + js-cookie@2.2.1: {} + + js-sdsl@4.4.2: {} + + js-sha3@0.5.7: {} + + js-sha3@0.8.0: {} + + js-string-escape@1.0.1: {} + + js-tokens@3.0.2: {} + + js-tokens@4.0.0: {} + + js-yaml@3.14.1: + dependencies: + argparse: 1.0.10 + esprima: 4.0.1 + + js-yaml@4.1.0: + dependencies: + argparse: 2.0.1 + + jsbn@0.1.1: {} + + jsc-safe-url@0.2.4: {} + + jsel@1.1.6: {} + + jsesc@0.5.0: {} + + jsesc@1.3.0: {} + + jsesc@3.1.0: {} + + json-bigint-patch@0.0.8: {} + + json-buffer@3.0.0: {} + + json-buffer@3.0.1: {} + + json-parse-better-errors@1.0.2: {} + + json-parse-even-better-errors@2.3.1: {} + + json-pointer@0.6.2: + dependencies: + foreach: 2.0.6 + + json-rpc-engine@3.8.0: + dependencies: + async: 2.6.2 + babel-preset-env: 1.7.0 + babelify: 7.3.0 + json-rpc-error: 2.0.0 + promise-to-callback: 1.0.0 + safe-event-emitter: 1.0.1 + transitivePeerDependencies: + - supports-color + + json-rpc-error@2.0.0: + dependencies: + inherits: 2.0.4 + + json-rpc-random-id@1.0.1: {} + + json-schema-to-ts@2.12.0: + dependencies: + '@babel/runtime': 7.27.1 + '@types/json-schema': 7.0.15 + ts-algebra: 1.2.2 + + json-schema-traverse@0.3.1: {} + + json-schema-traverse@0.4.1: {} + + json-schema-traverse@1.0.0: {} + + json-schema@0.4.0: {} + + json-stable-stringify-without-jsonify@1.0.1: {} + + json-stable-stringify@1.3.0: + dependencies: + call-bind: 1.0.8 + call-bound: 1.0.4 + isarray: 2.0.5 + jsonify: 0.0.1 + object-keys: 1.1.1 + + json-stream-stringify@3.1.6: {} + + json-stringify-safe@5.0.1: {} + + json-text-sequence@0.1.1: + dependencies: + delimit-stream: 0.1.0 + + json5@0.5.1: {} + + json5@2.2.3: {} + + jsonfile@2.4.0: + optionalDependencies: + graceful-fs: 4.2.11 + + jsonfile@4.0.0: + optionalDependencies: + graceful-fs: 4.2.11 + + jsonfile@6.1.0: + dependencies: + universalify: 2.0.1 + optionalDependencies: + graceful-fs: 4.2.11 + + jsonify@0.0.1: {} + + jsonparse@1.3.1: {} + + jsonschema@1.5.0: {} + + jsprim@1.4.2: + dependencies: + assert-plus: 1.0.0 + extsprintf: 1.3.0 + json-schema: 0.4.0 + verror: 1.10.0 + + keccak@3.0.4: + dependencies: + node-addon-api: 2.0.2 + node-gyp-build: 4.8.4 + readable-stream: 3.6.2 + + keyv@3.1.0: + dependencies: + json-buffer: 3.0.0 + + keyv@4.5.4: + dependencies: + json-buffer: 3.0.1 + + kind-of@3.2.2: + dependencies: + is-buffer: 1.1.6 + + kind-of@4.0.0: + dependencies: + is-buffer: 1.1.6 + + kind-of@6.0.3: {} + + klaw-sync@6.0.0: + dependencies: + graceful-fs: 4.2.11 + + klaw@1.3.1: + optionalDependencies: + graceful-fs: 4.2.11 + + kleur@3.0.3: {} + + kuler@2.0.0: {} + + latest-version@7.0.0: + dependencies: + package-json: 8.1.1 + + lcid@1.0.0: + dependencies: + invert-kv: 1.0.0 + + level-codec@7.0.1: {} + + level-codec@9.0.2: + dependencies: + buffer: 5.7.1 + + level-errors@1.0.5: + dependencies: + errno: 0.1.8 + + level-errors@2.0.1: + dependencies: + errno: 0.1.8 + + level-iterator-stream@1.3.1: + dependencies: + inherits: 2.0.4 + level-errors: 1.0.5 + readable-stream: 1.1.14 + xtend: 4.0.2 + + level-iterator-stream@2.0.3: + dependencies: + inherits: 2.0.4 + readable-stream: 2.3.8 + xtend: 4.0.2 + + level-iterator-stream@3.0.1: + dependencies: + inherits: 2.0.4 + readable-stream: 2.3.8 + xtend: 4.0.2 + + level-mem@3.0.1: + dependencies: + level-packager: 4.0.1 + memdown: 3.0.0 + + level-packager@4.0.1: + dependencies: + encoding-down: 5.0.4 + levelup: 3.1.1 + + level-post@1.0.7: + dependencies: + ltgt: 2.1.3 + + level-sublevel@6.6.4: + dependencies: + bytewise: 1.1.0 + level-codec: 9.0.2 + level-errors: 2.0.1 + level-iterator-stream: 2.0.3 + ltgt: 2.1.3 + pull-defer: 0.2.3 + pull-level: 2.0.4 + pull-stream: 3.7.0 + typewiselite: 1.0.0 + xtend: 4.0.2 + + level-supports@4.0.1: {} + + level-transcoder@1.0.1: + dependencies: + buffer: 6.0.3 + module-error: 1.0.2 + + level-ws@0.0.0: + dependencies: + readable-stream: 1.0.34 + xtend: 2.1.2 + + level-ws@1.0.0: + dependencies: + inherits: 2.0.4 + readable-stream: 2.3.8 + xtend: 4.0.2 + + level@8.0.1: + dependencies: + abstract-level: 1.0.4 + browser-level: 1.0.1 + classic-level: 1.4.1 + + levelup@1.3.9: + dependencies: + deferred-leveldown: 1.2.2 + level-codec: 7.0.1 + level-errors: 1.0.5 + level-iterator-stream: 1.3.1 + prr: 1.0.1 + semver: 5.4.1 + xtend: 4.0.2 + + levelup@3.1.1: + dependencies: + deferred-leveldown: 4.0.2 + level-errors: 2.0.1 + level-iterator-stream: 3.0.1 + xtend: 4.0.2 + + leven@3.1.0: {} + + levn@0.3.0: + dependencies: + prelude-ls: 1.1.2 + type-check: 0.3.2 + + levn@0.4.1: + dependencies: + prelude-ls: 1.2.1 + type-check: 0.4.0 + + lie@3.1.1: + dependencies: + immediate: 3.0.6 + + lighthouse-logger@1.4.2: + dependencies: + debug: 2.6.9 + marky: 1.3.0 + transitivePeerDependencies: + - supports-color + + lilconfig@2.0.5: {} + + lilconfig@3.1.3: {} + + lines-and-columns@1.2.4: {} + + lint-staged@10.5.4: + dependencies: + chalk: 4.1.2 + cli-truncate: 2.1.0 + commander: 6.2.1 + cosmiconfig: 7.1.0 + debug: 4.4.0(supports-color@9.4.0) + dedent: 0.7.0 + enquirer: 2.4.1 + execa: 4.1.0 + listr2: 3.14.0(enquirer@2.4.1) + log-symbols: 4.1.0 + micromatch: 4.0.8 + normalize-path: 3.0.0 + please-upgrade-node: 3.2.0 + string-argv: 0.3.1 + stringify-object: 3.3.0 + transitivePeerDependencies: + - supports-color + + lint-staged@12.5.0(enquirer@2.4.1): + dependencies: + cli-truncate: 3.1.0 + colorette: 2.0.20 + commander: 9.5.0 + debug: 4.4.0(supports-color@9.4.0) + execa: 5.1.1 + lilconfig: 2.0.5 + listr2: 4.0.5(enquirer@2.4.1) + micromatch: 4.0.8 + normalize-path: 3.0.0 + object-inspect: 1.13.4 + pidtree: 0.5.0 + string-argv: 0.3.2 + supports-color: 9.4.0 + yaml: 1.10.2 + transitivePeerDependencies: + - enquirer + + lint-staged@15.5.1: + dependencies: + chalk: 5.4.1 + commander: 13.1.0 + debug: 4.4.0(supports-color@9.4.0) + execa: 8.0.1 + lilconfig: 3.1.3 + listr2: 8.3.2 + micromatch: 4.0.8 + pidtree: 0.6.0 + string-argv: 0.3.2 + yaml: 2.7.1 + transitivePeerDependencies: + - supports-color + + listr2@3.14.0(enquirer@2.4.1): + dependencies: + cli-truncate: 2.1.0 + colorette: 2.0.20 + log-update: 4.0.0 + p-map: 4.0.0 + rfdc: 1.4.1 + rxjs: 7.8.2 + through: 2.3.8 + wrap-ansi: 7.0.0 + optionalDependencies: + enquirer: 2.4.1 + + listr2@4.0.5(enquirer@2.4.1): + dependencies: + cli-truncate: 2.1.0 + colorette: 2.0.20 + log-update: 4.0.0 + p-map: 4.0.0 + rfdc: 1.4.1 + rxjs: 7.8.2 + through: 2.3.8 + wrap-ansi: 7.0.0 + optionalDependencies: + enquirer: 2.4.1 + + listr2@8.3.2: + dependencies: + cli-truncate: 4.0.0 + colorette: 2.0.20 + eventemitter3: 5.0.1 + log-update: 6.1.0 + rfdc: 1.4.1 + wrap-ansi: 9.0.0 + + load-json-file@1.1.0: + dependencies: + graceful-fs: 4.2.11 + parse-json: 2.2.0 + pify: 2.3.0 + pinkie-promise: 2.0.1 + strip-bom: 2.0.0 + + localforage@1.10.0: + dependencies: + lie: 3.1.1 + + locate-path@2.0.0: + dependencies: + p-locate: 2.0.0 + path-exists: 3.0.0 + + locate-path@5.0.0: + dependencies: + p-locate: 4.1.0 + + locate-path@6.0.0: + dependencies: + p-locate: 5.0.0 + + lodash.assign@4.2.0: {} + + lodash.camelcase@4.3.0: {} + + lodash.clone@4.5.0: {} + + lodash.clonedeep@4.5.0: {} + + lodash.get@4.4.2: {} + + lodash.isequal@4.5.0: {} + + lodash.isequalwith@4.4.0: {} + + lodash.isfunction@3.0.9: {} + + lodash.isplainobject@4.0.6: {} + + lodash.kebabcase@4.1.1: {} + + lodash.merge@4.6.2: {} + + lodash.mergewith@4.6.2: {} + + lodash.snakecase@4.1.1: {} + + lodash.startcase@4.4.0: {} + + lodash.throttle@4.1.1: {} + + lodash.topath@4.5.2: {} + + lodash.truncate@4.4.2: {} + + lodash.uniq@4.5.0: {} + + lodash.upperfirst@4.3.1: {} + + lodash@4.17.20: {} + + lodash@4.17.21: {} + + log-symbols@4.1.0: + dependencies: + chalk: 4.1.2 + is-unicode-supported: 0.1.0 + + log-update@4.0.0: + dependencies: + ansi-escapes: 4.3.2 + cli-cursor: 3.1.0 + slice-ansi: 4.0.0 + wrap-ansi: 6.2.0 + + log-update@6.1.0: + dependencies: + ansi-escapes: 7.0.0 + cli-cursor: 5.0.0 + slice-ansi: 7.1.0 + strip-ansi: 7.1.0 + wrap-ansi: 9.0.0 + + logform@2.7.0: + dependencies: + '@colors/colors': 1.6.0 + '@types/triple-beam': 1.3.5 + fecha: 4.2.3 + ms: 2.1.3 + safe-stable-stringify: 2.5.0 + triple-beam: 1.4.1 + + looper@2.0.0: {} + + looper@3.0.0: {} + + loose-envify@1.4.0: + dependencies: + js-tokens: 4.0.0 + + loupe@2.3.7: + dependencies: + get-func-name: 2.0.2 + + lower-case-first@2.0.2: + dependencies: + tslib: 2.8.1 + + lower-case@2.0.2: + dependencies: + tslib: 2.8.1 + + lowercase-keys@1.0.1: {} + + lowercase-keys@2.0.0: {} + + lowercase-keys@3.0.0: {} + + lru-cache@10.4.3: {} + + lru-cache@11.1.0: {} + + lru-cache@3.2.0: + dependencies: + pseudomap: 1.0.2 + + lru-cache@4.1.5: + dependencies: + pseudomap: 1.0.2 + yallist: 2.1.2 + + lru-cache@5.1.1: + dependencies: + yallist: 3.1.1 + + lru-cache@6.0.0: + dependencies: + yallist: 4.0.0 + + lru-cache@7.18.3: {} + + lru_map@0.3.3: {} + + ltgt@2.1.3: {} + + ltgt@2.2.1: {} + + make-error@1.3.6: {} + + makeerror@1.0.12: + dependencies: + tmpl: 1.0.5 + + map-cache@0.2.2: {} + + map-obj@1.0.1: {} + + map-obj@4.3.0: {} + + map-visit@1.0.0: + dependencies: + object-visit: 1.0.1 + + markdown-table@1.1.3: {} + + marky@1.3.0: {} + + match-all@1.2.7: {} + + math-intrinsics@1.1.0: {} + + math-random@1.0.4: {} + + mcl-wasm@0.7.9: {} + + md5.js@1.3.5: + dependencies: + hash-base: 3.1.0 + inherits: 2.0.4 + safe-buffer: 5.2.1 + + media-typer@0.3.0: {} + + mem@1.1.0: + dependencies: + mimic-fn: 1.2.0 + + memdown@1.4.1: + dependencies: + abstract-leveldown: 2.7.2 + functional-red-black-tree: 1.0.1 + immediate: 3.3.0 + inherits: 2.0.4 + ltgt: 2.2.1 + safe-buffer: 5.1.2 + + memdown@3.0.0: + dependencies: + abstract-leveldown: 5.0.0 + functional-red-black-tree: 1.0.1 + immediate: 3.2.3 + inherits: 2.0.4 + ltgt: 2.2.1 + safe-buffer: 5.1.2 + + memoize-one@5.2.1: {} + + memory-level@1.0.0: + dependencies: + abstract-level: 1.0.4 + functional-red-black-tree: 1.0.1 + module-error: 1.0.2 + + memorystream@0.3.1: {} + + meow@12.1.1: {} + + meow@8.1.2: + dependencies: + '@types/minimist': 1.2.5 + camelcase-keys: 6.2.2 + decamelize-keys: 1.1.1 + hard-rejection: 2.1.0 + minimist-options: 4.1.0 + normalize-package-data: 3.0.3 + read-pkg-up: 7.0.1 + redent: 3.0.0 + trim-newlines: 3.0.1 + type-fest: 0.18.1 + yargs-parser: 20.2.9 + + merge-descriptors@1.0.1: {} + + merge-descriptors@1.0.3: {} + + merge-options@2.0.0: + dependencies: + is-plain-obj: 2.1.0 + + merge-stream@2.0.0: {} + + merge2@1.4.1: {} + + merkle-patricia-tree@2.3.2: + dependencies: + async: 1.5.2 + ethereumjs-util: 5.2.1 + level-ws: 0.0.0 + levelup: 1.3.9 + memdown: 1.4.1 + readable-stream: 2.3.8 + rlp: 2.2.7 + semaphore: 1.1.0 + + merkle-patricia-tree@3.0.0: + dependencies: + async: 2.6.2 + ethereumjs-util: 5.2.1 + level-mem: 3.0.1 + level-ws: 1.0.0 + readable-stream: 3.6.2 + rlp: 2.2.7 + semaphore: 1.1.0 + + meros@1.3.0(@types/node@20.17.32): + optionalDependencies: + '@types/node': 20.17.32 + + methods@1.1.2: {} + + metro-babel-transformer@0.82.2: + dependencies: + '@babel/core': 7.27.1 + flow-enums-runtime: 0.0.6 + hermes-parser: 0.28.1 + nullthrows: 1.1.1 + transitivePeerDependencies: + - supports-color + + metro-cache-key@0.82.2: + dependencies: + flow-enums-runtime: 0.0.6 + + metro-cache@0.82.2: + dependencies: + exponential-backoff: 3.1.2 + flow-enums-runtime: 0.0.6 + https-proxy-agent: 7.0.6 + metro-core: 0.82.2 + transitivePeerDependencies: + - supports-color + + metro-config@0.82.2(bufferutil@4.0.9)(utf-8-validate@5.0.10): + dependencies: + connect: 3.7.0 + cosmiconfig: 5.2.1 + flow-enums-runtime: 0.0.6 + jest-validate: 29.7.0 + metro: 0.82.2(bufferutil@4.0.9)(utf-8-validate@5.0.10) + metro-cache: 0.82.2 + metro-core: 0.82.2 + metro-runtime: 0.82.2 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + + metro-core@0.82.2: + dependencies: + flow-enums-runtime: 0.0.6 + lodash.throttle: 4.1.1 + metro-resolver: 0.82.2 + + metro-file-map@0.82.2: + dependencies: + debug: 4.4.0(supports-color@9.4.0) + fb-watchman: 2.0.2 + flow-enums-runtime: 0.0.6 + graceful-fs: 4.2.11 + invariant: 2.2.4 + jest-worker: 29.7.0 + micromatch: 4.0.8 + nullthrows: 1.1.1 + walker: 1.0.8 + transitivePeerDependencies: + - supports-color + + metro-minify-terser@0.82.2: + dependencies: + flow-enums-runtime: 0.0.6 + terser: 5.39.0 + + metro-resolver@0.82.2: + dependencies: + flow-enums-runtime: 0.0.6 + + metro-runtime@0.82.2: + dependencies: + '@babel/runtime': 7.27.1 + flow-enums-runtime: 0.0.6 + + metro-source-map@0.82.2: + dependencies: + '@babel/traverse': 7.27.1 + '@babel/traverse--for-generate-function-map': '@babel/traverse@7.27.1' + '@babel/types': 7.27.1 + flow-enums-runtime: 0.0.6 + invariant: 2.2.4 + metro-symbolicate: 0.82.2 + nullthrows: 1.1.1 + ob1: 0.82.2 + source-map: 0.5.7 + vlq: 1.0.1 + transitivePeerDependencies: + - supports-color + + metro-symbolicate@0.82.2: + dependencies: + flow-enums-runtime: 0.0.6 + invariant: 2.2.4 + metro-source-map: 0.82.2 + nullthrows: 1.1.1 + source-map: 0.5.7 + vlq: 1.0.1 + transitivePeerDependencies: + - supports-color + + metro-transform-plugins@0.82.2: + dependencies: + '@babel/core': 7.27.1 + '@babel/generator': 7.27.1 + '@babel/template': 7.27.1 + '@babel/traverse': 7.27.1 + flow-enums-runtime: 0.0.6 + nullthrows: 1.1.1 + transitivePeerDependencies: + - supports-color + + metro-transform-worker@0.82.2(bufferutil@4.0.9)(utf-8-validate@5.0.10): + dependencies: + '@babel/core': 7.27.1 + '@babel/generator': 7.27.1 + '@babel/parser': 7.27.1 + '@babel/types': 7.27.1 + flow-enums-runtime: 0.0.6 + metro: 0.82.2(bufferutil@4.0.9)(utf-8-validate@5.0.10) + metro-babel-transformer: 0.82.2 + metro-cache: 0.82.2 + metro-cache-key: 0.82.2 + metro-minify-terser: 0.82.2 + metro-source-map: 0.82.2 + metro-transform-plugins: 0.82.2 + nullthrows: 1.1.1 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + + metro@0.82.2(bufferutil@4.0.9)(utf-8-validate@5.0.10): + dependencies: + '@babel/code-frame': 7.27.1 + '@babel/core': 7.27.1 + '@babel/generator': 7.27.1 + '@babel/parser': 7.27.1 + '@babel/template': 7.27.1 + '@babel/traverse': 7.27.1 + '@babel/types': 7.27.1 + accepts: 1.3.8 + chalk: 4.1.2 + ci-info: 2.0.0 + connect: 3.7.0 + debug: 4.4.0(supports-color@9.4.0) + error-stack-parser: 2.1.4 + flow-enums-runtime: 0.0.6 + graceful-fs: 4.2.11 + hermes-parser: 0.28.1 + image-size: 1.2.1 + invariant: 2.2.4 + jest-worker: 29.7.0 + jsc-safe-url: 0.2.4 + lodash.throttle: 4.1.1 + metro-babel-transformer: 0.82.2 + metro-cache: 0.82.2 + metro-cache-key: 0.82.2 + metro-config: 0.82.2(bufferutil@4.0.9)(utf-8-validate@5.0.10) + metro-core: 0.82.2 + metro-file-map: 0.82.2 + metro-resolver: 0.82.2 + metro-runtime: 0.82.2 + metro-source-map: 0.82.2 + metro-symbolicate: 0.82.2 + metro-transform-plugins: 0.82.2 + metro-transform-worker: 0.82.2(bufferutil@4.0.9)(utf-8-validate@5.0.10) + mime-types: 2.1.35 + nullthrows: 1.1.1 + serialize-error: 2.1.0 + source-map: 0.5.7 + throat: 5.0.0 + ws: 7.5.10(bufferutil@4.0.9)(utf-8-validate@5.0.10) + yargs: 17.7.2 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + + micro-eth-signer@0.14.0: + dependencies: + '@noble/curves': 1.8.2 + '@noble/hashes': 1.7.2 + micro-packed: 0.7.3 + + micro-ftch@0.3.1: {} + + micro-packed@0.7.3: + dependencies: + '@scure/base': 1.2.5 + + micromatch@2.3.11: + dependencies: + arr-diff: 2.0.0 + array-unique: 0.2.1 + braces: 1.8.5 + expand-brackets: 0.1.5 + extglob: 0.3.2 + filename-regex: 2.0.1 + is-extglob: 1.0.0 + is-glob: 2.0.1 + kind-of: 3.2.2 + normalize-path: 2.1.1 + object.omit: 2.0.1 + parse-glob: 3.0.4 + regex-cache: 0.4.4 + + micromatch@3.1.10: + dependencies: + arr-diff: 4.0.0 + array-unique: 0.3.2 + braces: 2.3.2 + define-property: 2.0.2 + extend-shallow: 3.0.2 + extglob: 2.0.4 + fragment-cache: 0.2.1 + kind-of: 6.0.3 + nanomatch: 1.2.13 + object.pick: 1.3.0 + regex-not: 1.0.2 + snapdragon: 0.8.2 + to-regex: 3.0.2 + transitivePeerDependencies: + - supports-color + + micromatch@4.0.8: + dependencies: + braces: 3.0.3 + picomatch: 2.3.1 + + miller-rabin@4.0.1: + dependencies: + bn.js: 4.12.2 + brorand: 1.1.0 + + mime-db@1.52.0: {} + + mime-types@2.1.35: + dependencies: + mime-db: 1.52.0 + + mime@1.6.0: {} + + mimic-fn@1.2.0: {} + + mimic-fn@2.1.0: {} + + mimic-fn@4.0.0: {} + + mimic-function@5.0.1: {} + + mimic-response@1.0.1: {} + + mimic-response@2.1.0: + optional: true + + mimic-response@3.1.0: {} + + mimic-response@4.0.0: {} + + min-document@2.19.0: + dependencies: + dom-walk: 0.1.2 + + min-indent@1.0.1: {} + + minimalistic-assert@1.0.1: {} + + minimalistic-crypto-utils@1.0.1: {} + + minimatch@10.0.1: + dependencies: + brace-expansion: 2.0.1 + + minimatch@3.1.2: + dependencies: + brace-expansion: 1.1.11 + + minimatch@5.1.6: + dependencies: + brace-expansion: 2.0.1 + + minimatch@9.0.3: + dependencies: + brace-expansion: 2.0.1 + + minimatch@9.0.5: + dependencies: + brace-expansion: 2.0.1 + + minimist-options@4.1.0: + dependencies: + arrify: 1.0.1 + is-plain-obj: 1.1.0 + kind-of: 6.0.3 + + minimist@0.0.8: {} + + minimist@1.2.8: {} + + minipass@2.9.0: + dependencies: + safe-buffer: 5.2.1 + yallist: 3.1.1 + + minipass@7.1.2: {} + + minizlib@1.3.3: + dependencies: + minipass: 2.9.0 + + mixin-deep@1.3.2: + dependencies: + for-in: 1.0.2 + is-extendable: 1.0.1 + + mkdirp-classic@0.5.3: + optional: true + + mkdirp-promise@5.0.1: + dependencies: + mkdirp: 3.0.1 + + mkdirp@0.5.1: + dependencies: + minimist: 0.0.8 + + mkdirp@0.5.6: + dependencies: + minimist: 1.2.8 + + mkdirp@1.0.4: {} + + mkdirp@3.0.1: {} + + mnemonist@0.38.5: + dependencies: + obliterator: 2.0.5 + + mocha@10.8.2: + dependencies: + ansi-colors: 4.1.3 + browser-stdout: 1.3.1 + chokidar: 3.6.0 + debug: 4.4.0(supports-color@8.1.1) + diff: 5.2.0 + escape-string-regexp: 4.0.0 + find-up: 5.0.0 + glob: 8.1.0 + he: 1.2.0 + js-yaml: 4.1.0 + log-symbols: 4.1.0 + minimatch: 5.1.6 + ms: 2.1.3 + serialize-javascript: 6.0.2 + strip-json-comments: 3.1.1 + supports-color: 8.1.1 + workerpool: 6.5.1 + yargs: 16.2.0 + yargs-parser: 20.2.9 + yargs-unparser: 2.0.0 + + mocha@4.1.0: + dependencies: + browser-stdout: 1.3.0 + commander: 2.11.0 + debug: 3.1.0(supports-color@4.4.0) + diff: 3.3.1 + escape-string-regexp: 1.0.5 + glob: 7.1.2 + growl: 1.10.3 + he: 1.1.1 + mkdirp: 0.5.1 + supports-color: 4.4.0 + + mock-fs@4.14.0: {} + + mock-property@1.0.3: + dependencies: + define-data-property: 1.1.4 + functions-have-names: 1.2.3 + gopd: 1.2.0 + has-property-descriptors: 1.0.2 + hasown: 2.0.2 + isarray: 2.0.5 + + module-error@1.0.2: {} + + moment-timezone@0.5.48: + dependencies: + moment: 2.30.1 + + moment@2.30.1: {} + + morgan@1.10.0: + dependencies: + basic-auth: 2.0.1 + debug: 2.6.9 + depd: 2.0.0 + on-finished: 2.3.0 + on-headers: 1.0.2 + transitivePeerDependencies: + - supports-color + + mri@1.2.0: {} + + ms@2.0.0: {} + + ms@2.1.3: {} + + multiaddr-to-uri@6.0.0(node-fetch@2.7.0(encoding@0.1.13)): + dependencies: + multiaddr: 8.1.2(node-fetch@2.7.0(encoding@0.1.13)) + transitivePeerDependencies: + - node-fetch + - supports-color + + multiaddr@8.1.2(node-fetch@2.7.0(encoding@0.1.13)): + dependencies: + cids: 1.1.9 + class-is: 1.1.0 + dns-over-http-resolver: 1.2.3(node-fetch@2.7.0(encoding@0.1.13)) + err-code: 2.0.3 + is-ip: 3.1.0 + multibase: 3.1.2 + uint8arrays: 1.1.0 + varint: 5.0.2 + transitivePeerDependencies: + - node-fetch + - supports-color + + multibase@0.6.1: + dependencies: + base-x: 3.0.11 + buffer: 5.7.1 + + multibase@0.7.0: + dependencies: + base-x: 3.0.11 + buffer: 5.7.1 + + multibase@3.1.2: + dependencies: + '@multiformats/base-x': 4.0.1 + web-encoding: 1.1.5 + + multibase@4.0.6: + dependencies: + '@multiformats/base-x': 4.0.1 + + multicodec@0.5.7: + dependencies: + varint: 5.0.2 + + multicodec@1.0.4: + dependencies: + buffer: 5.7.1 + varint: 5.0.2 + + multicodec@2.1.3: + dependencies: + uint8arrays: 1.1.0 + varint: 6.0.0 + + multicodec@3.2.1: + dependencies: + uint8arrays: 3.1.1 + varint: 6.0.0 + + multiformats@9.9.0: {} + + multihashes@0.4.21: + dependencies: + buffer: 5.7.1 + multibase: 0.7.0 + varint: 5.0.2 + + multihashes@3.1.2: + dependencies: + multibase: 3.1.2 + uint8arrays: 2.1.10 + varint: 6.0.0 + + multihashes@4.0.3: + dependencies: + multibase: 4.0.6 + uint8arrays: 3.1.1 + varint: 5.0.2 + + multihashing-async@2.1.4: + dependencies: + blakejs: 1.2.1 + err-code: 3.0.1 + js-sha3: 0.8.0 + multihashes: 4.0.3 + murmurhash3js-revisited: 3.0.0 + uint8arrays: 3.1.1 + + murmur-128@0.2.1: + dependencies: + encode-utf8: 1.0.3 + fmix: 0.1.0 + imul: 1.0.1 + + murmurhash3js-revisited@3.0.0: {} + + mute-stream@0.0.8: {} + + nan@2.22.2: + optional: true + + nano-json-stream-parser@0.1.2: {} + + nanoid@3.3.11: {} + + nanomatch@1.2.13: + dependencies: + arr-diff: 4.0.0 + array-unique: 0.3.2 + define-property: 2.0.2 + extend-shallow: 3.0.2 + fragment-cache: 0.2.1 + is-windows: 1.0.2 + kind-of: 6.0.3 + object.pick: 1.3.0 + regex-not: 1.0.2 + snapdragon: 0.8.2 + to-regex: 3.0.2 + transitivePeerDependencies: + - supports-color + + napi-build-utils@1.0.2: + optional: true + + napi-macros@2.2.2: {} + + native-fetch@3.0.0(node-fetch@2.7.0(encoding@0.1.13)): + dependencies: + node-fetch: 2.7.0(encoding@0.1.13) + + natural-compare@1.4.0: {} + + ndjson@2.0.0: + dependencies: + json-stringify-safe: 5.0.1 + minimist: 1.2.8 + readable-stream: 3.6.2 + split2: 3.2.2 + through2: 4.0.2 + + negotiator@0.6.3: {} + + neo-async@2.6.2: {} + + next-tick@1.1.0: {} + + ngeohash@0.6.3: {} + + nice-try@1.0.5: {} + + no-case@3.0.4: + dependencies: + lower-case: 2.0.2 + tslib: 2.8.1 + + node-abi@2.30.1: + dependencies: + semver: 5.7.2 + optional: true + + node-addon-api@2.0.2: {} + + node-addon-api@3.2.1: + optional: true + + node-addon-api@4.3.0: + optional: true + + node-addon-api@5.1.0: {} + + node-emoji@1.11.0: + dependencies: + lodash: 4.17.21 + + node-fetch@1.7.3: + dependencies: + encoding: 0.1.13 + is-stream: 1.1.0 + + node-fetch@2.6.7(encoding@0.1.13): + dependencies: + whatwg-url: 5.0.0 + optionalDependencies: + encoding: 0.1.13 + + node-fetch@2.7.0(encoding@0.1.13): + dependencies: + whatwg-url: 5.0.0 + optionalDependencies: + encoding: 0.1.13 + + node-gyp-build@4.8.4: {} + + node-hid@1.3.0: + dependencies: + bindings: 1.5.0 + nan: 2.22.2 + node-abi: 2.30.1 + prebuild-install: 5.3.6 + optional: true + + node-hid@2.1.1: + dependencies: + bindings: 1.5.0 + node-addon-api: 3.2.1 + prebuild-install: 6.1.4 + optional: true + + node-int64@0.4.0: {} + + node-releases@2.0.19: {} + + nofilter@3.1.0: {} + + noop-logger@0.1.1: + optional: true + + nopt@3.0.6: + dependencies: + abbrev: 1.0.9 + + normalize-package-data@2.5.0: + dependencies: + hosted-git-info: 2.8.9 + resolve: 1.22.10 + semver: 5.7.2 + validate-npm-package-license: 3.0.4 + + normalize-package-data@3.0.3: + dependencies: + hosted-git-info: 4.1.0 + is-core-module: 2.16.1 + semver: 7.7.1 + validate-npm-package-license: 3.0.4 + + normalize-path@2.1.1: + dependencies: + remove-trailing-separator: 1.1.0 + + normalize-path@3.0.0: {} + + normalize-url@4.5.1: {} + + normalize-url@6.1.0: {} + + normalize-url@8.0.1: {} + + npm-run-path@2.0.2: + dependencies: + path-key: 2.0.1 + + npm-run-path@4.0.1: + dependencies: + path-key: 3.1.1 + + npm-run-path@5.3.0: + dependencies: + path-key: 4.0.0 + + npmlog@4.1.2: + dependencies: + are-we-there-yet: 1.1.7 + console-control-strings: 1.1.0 + gauge: 2.7.4 + set-blocking: 2.0.0 + optional: true + + nullthrows@1.1.1: {} + + number-is-nan@1.0.1: {} + + number-to-bn@1.7.0: + dependencies: + bn.js: 4.11.6 + strip-hex-prefix: 1.0.0 + + oauth-sign@0.9.0: {} + + ob1@0.82.2: + dependencies: + flow-enums-runtime: 0.0.6 + + object-assign@4.1.1: {} + + object-copy@0.1.0: + dependencies: + copy-descriptor: 0.1.1 + define-property: 0.2.5 + kind-of: 3.2.2 + + object-inspect@1.10.3: {} + + object-inspect@1.12.3: {} + + object-inspect@1.13.4: {} + + object-is@1.1.6: + dependencies: + call-bind: 1.0.8 + define-properties: 1.2.1 + + object-keys@0.4.0: {} + + object-keys@1.1.1: {} + + object-visit@1.0.1: + dependencies: + isobject: 3.0.1 + + object.assign@4.1.7: + dependencies: + call-bind: 1.0.8 + call-bound: 1.0.4 + define-properties: 1.2.1 + es-object-atoms: 1.1.1 + has-symbols: 1.1.0 + object-keys: 1.1.1 + + object.getownpropertydescriptors@2.1.8: + dependencies: + array.prototype.reduce: 1.0.8 + call-bind: 1.0.8 + define-properties: 1.2.1 + es-abstract: 1.23.9 + es-object-atoms: 1.1.1 + gopd: 1.2.0 + safe-array-concat: 1.1.3 + + object.omit@2.0.1: + dependencies: + for-own: 0.1.5 + is-extendable: 0.1.1 + + object.pick@1.3.0: + dependencies: + isobject: 3.0.1 + + obliterator@2.0.5: {} + + oboe@2.1.4: + dependencies: + http-https: 1.0.0 + optional: true + + oboe@2.1.5: + dependencies: + http-https: 1.0.0 + + on-exit-leak-free@0.2.0: {} + + on-finished@2.3.0: + dependencies: + ee-first: 1.1.1 + + on-finished@2.4.1: + dependencies: + ee-first: 1.1.1 + + on-headers@1.0.2: {} + + once@1.4.0: + dependencies: + wrappy: 1.0.2 + + one-time@1.0.0: + dependencies: + fn.name: 1.1.0 + + onetime@5.1.2: + dependencies: + mimic-fn: 2.1.0 + + onetime@6.0.0: + dependencies: + mimic-fn: 4.0.0 + + onetime@7.0.0: + dependencies: + mimic-function: 5.0.1 + + open@7.4.2: + dependencies: + is-docker: 2.2.1 + is-wsl: 2.2.0 + + open@8.4.2: + dependencies: + define-lazy-prop: 2.0.0 + is-docker: 2.2.1 + is-wsl: 2.2.0 + + openapi-types@12.1.3: {} + + optionator@0.8.3: + dependencies: + deep-is: 0.1.4 + fast-levenshtein: 2.0.6 + levn: 0.3.0 + prelude-ls: 1.1.2 + type-check: 0.3.2 + word-wrap: 1.2.5 + + optionator@0.9.4: + dependencies: + deep-is: 0.1.4 + fast-levenshtein: 2.0.6 + levn: 0.4.1 + prelude-ls: 1.2.1 + type-check: 0.4.0 + word-wrap: 1.2.5 + + ordinal@1.0.3: {} + + os-homedir@1.0.2: {} + + os-locale@1.4.0: + dependencies: + lcid: 1.0.0 + + os-locale@2.1.0: + dependencies: + execa: 0.7.0 + lcid: 1.0.0 + mem: 1.1.0 + + os-tmpdir@1.0.2: {} + + outdent@0.5.0: {} + + own-keys@1.0.1: + dependencies: + get-intrinsic: 1.3.0 + object-keys: 1.1.1 + safe-push-apply: 1.0.0 + + p-cancelable@1.1.0: {} + + p-cancelable@2.1.1: {} + + p-cancelable@3.0.0: {} + + p-defer@3.0.0: {} + + p-fifo@1.0.0: + dependencies: + fast-fifo: 1.3.2 + p-defer: 3.0.0 + + p-filter@2.1.0: + dependencies: + p-map: 2.1.0 + + p-finally@1.0.0: {} + + p-limit@1.3.0: + dependencies: + p-try: 1.0.0 + + p-limit@2.3.0: + dependencies: + p-try: 2.2.0 + + p-limit@3.1.0: + dependencies: + yocto-queue: 0.1.0 + + p-locate@2.0.0: + dependencies: + p-limit: 1.3.0 + + p-locate@4.1.0: + dependencies: + p-limit: 2.3.0 + + p-locate@5.0.0: + dependencies: + p-limit: 3.1.0 + + p-map@2.1.0: {} + + p-map@4.0.0: + dependencies: + aggregate-error: 3.1.0 + + p-queue@6.6.2: + dependencies: + eventemitter3: 4.0.7 + p-timeout: 3.2.0 + + p-timeout@3.2.0: + dependencies: + p-finally: 1.0.0 + + p-try@1.0.0: {} + + p-try@2.2.0: {} + + package-json-from-dist@1.0.1: {} + + package-json@8.1.1: + dependencies: + got: 12.6.1 + registry-auth-token: 5.1.0 + registry-url: 6.0.1 + semver: 7.7.1 + + package-manager-detector@0.2.11: + dependencies: + quansync: 0.2.10 + + packet-reader@1.0.0: {} + + param-case@3.0.4: + dependencies: + dot-case: 3.0.4 + tslib: 2.8.1 + + parent-module@1.0.1: + dependencies: + callsites: 3.1.0 + + parse-asn1@5.1.7: + dependencies: + asn1.js: 4.10.1 + browserify-aes: 1.2.0 + evp_bytestokey: 1.0.3 + hash-base: 3.0.5 + pbkdf2: 3.1.2 + safe-buffer: 5.2.1 + + parse-cache-control@1.0.1: {} + + parse-duration@0.4.4: {} + + parse-filepath@1.0.2: + dependencies: + is-absolute: 1.0.0 + map-cache: 0.2.2 + path-root: 0.1.1 + + parse-glob@3.0.4: + dependencies: + glob-base: 0.3.0 + is-dotfile: 1.0.3 + is-extglob: 1.0.0 + is-glob: 2.0.1 + + parse-headers@2.0.6: {} + + parse-json@2.2.0: + dependencies: + error-ex: 1.3.2 + + parse-json@4.0.0: + dependencies: + error-ex: 1.3.2 + json-parse-better-errors: 1.0.2 + + parse-json@5.2.0: + dependencies: + '@babel/code-frame': 7.27.1 + error-ex: 1.3.2 + json-parse-even-better-errors: 2.3.1 + lines-and-columns: 1.2.4 + + parse-passwd@1.0.0: {} + + parseurl@1.3.3: {} + + pascal-case@3.1.2: + dependencies: + no-case: 3.0.4 + tslib: 2.8.1 + + pascalcase@0.1.1: {} + + patch-package@6.2.2: + dependencies: + '@yarnpkg/lockfile': 1.1.0 + chalk: 2.4.2 + cross-spawn: 6.0.6 + find-yarn-workspace-root: 1.2.1 + fs-extra: 7.0.1 + is-ci: 2.0.0 + klaw-sync: 6.0.0 + minimist: 1.2.8 + rimraf: 2.7.1 + semver: 5.7.2 + slash: 2.0.0 + tmp: 0.0.33 + transitivePeerDependencies: + - supports-color + + patch-package@6.5.1: + dependencies: + '@yarnpkg/lockfile': 1.1.0 + chalk: 4.1.2 + cross-spawn: 6.0.6 + find-yarn-workspace-root: 2.0.0 + fs-extra: 9.1.0 + is-ci: 2.0.0 + klaw-sync: 6.0.0 + minimist: 1.2.8 + open: 7.4.2 + rimraf: 2.7.1 + semver: 5.7.2 + slash: 2.0.0 + tmp: 0.0.33 + yaml: 1.10.2 + + path-browserify@1.0.1: {} + + path-case@3.0.4: + dependencies: + dot-case: 3.0.4 + tslib: 2.8.1 + + path-exists@2.1.0: + dependencies: + pinkie-promise: 2.0.1 + + path-exists@3.0.0: {} + + path-exists@4.0.0: {} + + path-is-absolute@1.0.1: {} + + path-key@2.0.1: {} + + path-key@3.1.1: {} + + path-key@4.0.0: {} + + path-parse@1.0.7: {} + + path-root-regex@0.1.2: {} + + path-root@0.1.1: + dependencies: + path-root-regex: 0.1.2 + + path-scurry@1.11.1: + dependencies: + lru-cache: 10.4.3 + minipass: 7.1.2 + + path-scurry@2.0.0: + dependencies: + lru-cache: 11.1.0 + minipass: 7.1.2 + + path-starts-with@2.0.1: {} + + path-to-regexp@0.1.12: {} + + path-to-regexp@0.1.7: {} + + path-type@1.1.0: + dependencies: + graceful-fs: 4.2.11 + pify: 2.3.0 + pinkie-promise: 2.0.1 + + path-type@4.0.0: {} + + pathval@1.1.1: {} + + pbkdf2@3.1.2: + dependencies: + create-hash: 1.2.0 + create-hmac: 1.1.7 + ripemd160: 2.0.2 + safe-buffer: 5.2.1 + sha.js: 2.4.11 + + pegjs@0.10.0: {} + + performance-now@2.1.0: {} + + pg-cloudflare@1.2.5: + optional: true + + pg-connection-string@2.8.5: {} + + pg-hstore@2.3.4: + dependencies: + underscore: 1.13.7 + + pg-int8@1.0.1: {} + + pg-pool@3.9.6(pg@8.11.3): + dependencies: + pg: 8.11.3 + + pg-pool@3.9.6(pg@8.7.3): + dependencies: + pg: 8.7.3 + + pg-protocol@1.9.5: {} + + pg-types@2.2.0: + dependencies: + pg-int8: 1.0.1 + postgres-array: 2.0.0 + postgres-bytea: 1.0.0 + postgres-date: 1.0.7 + postgres-interval: 1.2.0 + + pg@8.11.3: + dependencies: + buffer-writer: 2.0.0 + packet-reader: 1.0.0 + pg-connection-string: 2.8.5 + pg-pool: 3.9.6(pg@8.11.3) + pg-protocol: 1.9.5 + pg-types: 2.2.0 + pgpass: 1.0.5 + optionalDependencies: + pg-cloudflare: 1.2.5 + + pg@8.7.3: + dependencies: + buffer-writer: 2.0.0 + packet-reader: 1.0.0 + pg-connection-string: 2.8.5 + pg-pool: 3.9.6(pg@8.7.3) + pg-protocol: 1.9.5 + pg-types: 2.2.0 + pgpass: 1.0.5 + + pgpass@1.0.5: + dependencies: + split2: 4.2.0 + + picocolors@1.1.1: {} + + picomatch@2.3.1: {} + + picomatch@4.0.2: {} + + pidtree@0.5.0: {} + + pidtree@0.6.0: {} + + pify@2.3.0: {} + + pify@4.0.1: {} + + pinkie-promise@2.0.1: + dependencies: + pinkie: 2.0.4 + + pinkie@2.0.4: {} + + pino-abstract-transport@0.5.0: + dependencies: + duplexify: 4.1.3 + split2: 4.2.0 + + pino-multi-stream@6.0.0: + dependencies: + pino: 7.6.0 + + pino-std-serializers@4.0.0: {} + + pino@7.6.0: + dependencies: + fast-redact: 3.5.0 + fastify-warning: 0.2.0 + on-exit-leak-free: 0.2.0 + pino-abstract-transport: 0.5.0 + pino-std-serializers: 4.0.0 + quick-format-unescaped: 4.0.4 + real-require: 0.1.0 + safe-stable-stringify: 2.5.0 + sonic-boom: 2.8.0 + thread-stream: 0.13.2 + + pirates@4.0.7: {} + + please-upgrade-node@3.2.0: + dependencies: + semver-compare: 1.0.0 + + pluralize@8.0.0: {} + + posix-character-classes@0.1.1: {} + + possible-typed-array-names@1.1.0: {} + + postgres-array@2.0.0: {} + + postgres-bytea@1.0.0: {} + + postgres-date@1.0.7: {} + + postgres-interval@1.2.0: + dependencies: + xtend: 4.0.2 + + postinstall-postinstall@2.1.0: {} + + prebuild-install@5.3.6: + dependencies: + detect-libc: 1.0.3 + expand-template: 2.0.3 + github-from-package: 0.0.0 + minimist: 1.2.8 + mkdirp-classic: 0.5.3 + napi-build-utils: 1.0.2 + node-abi: 2.30.1 + noop-logger: 0.1.1 + npmlog: 4.1.2 + pump: 3.0.2 + rc: 1.2.8 + simple-get: 3.1.1 + tar-fs: 2.1.2 + tunnel-agent: 0.6.0 + which-pm-runs: 1.1.0 + optional: true + + prebuild-install@6.1.4: + dependencies: + detect-libc: 1.0.3 + expand-template: 2.0.3 + github-from-package: 0.0.0 + minimist: 1.2.8 + mkdirp-classic: 0.5.3 + napi-build-utils: 1.0.2 + node-abi: 2.30.1 + npmlog: 4.1.2 + pump: 3.0.2 + rc: 1.2.8 + simple-get: 3.1.1 + tar-fs: 2.1.2 + tunnel-agent: 0.6.0 + optional: true + + precond@0.2.3: {} + + prelude-ls@1.1.2: {} + + prelude-ls@1.2.1: {} + + prepend-http@2.0.0: {} + + preserve@0.2.0: {} + + prettier-linter-helpers@1.0.0: + dependencies: + fast-diff: 1.3.0 + + prettier-plugin-solidity@1.4.3(prettier@2.8.8): + dependencies: + '@solidity-parser/parser': 0.20.1 + prettier: 2.8.8 + semver: 7.7.1 + + prettier-plugin-solidity@1.4.3(prettier@3.5.3): + dependencies: + '@solidity-parser/parser': 0.20.1 + prettier: 3.5.3 + semver: 7.7.1 + + prettier@2.8.8: {} + + prettier@3.5.3: {} + + pretty-format@29.7.0: + dependencies: + '@jest/schemas': 29.6.3 + ansi-styles: 5.2.0 + react-is: 18.3.1 + + private@0.1.8: {} + + process-nextick-args@2.0.1: {} + + process@0.11.10: {} + + prom-client@14.0.1: + dependencies: + tdigest: 0.1.2 + + prom-client@14.2.0: + dependencies: + tdigest: 0.1.2 + + promise-to-callback@1.0.0: + dependencies: + is-fn: 1.0.0 + set-immediate-shim: 1.0.1 + + promise@7.3.1: + dependencies: + asap: 2.0.6 + + promise@8.3.0: + dependencies: + asap: 2.0.6 + + prompt-sync@4.2.0: + dependencies: + strip-ansi: 5.2.0 + + prompts@2.4.2: + dependencies: + kleur: 3.0.3 + sisteransi: 1.0.5 + + proper-lockfile@4.1.2: + dependencies: + graceful-fs: 4.2.11 + retry: 0.12.0 + signal-exit: 3.0.7 + + proto-list@1.2.4: {} + + protocol-buffers-schema@3.6.0: {} + + protons@2.0.3: + dependencies: + protocol-buffers-schema: 3.6.0 + signed-varint: 2.0.1 + uint8arrays: 3.1.1 + varint: 5.0.2 + + proxy-addr@2.0.7: + dependencies: + forwarded: 0.2.0 + ipaddr.js: 1.9.1 + + proxy-from-env@1.1.0: {} + + prr@1.0.1: {} + + pseudomap@1.0.2: {} + + psl@1.15.0: + dependencies: + punycode: 2.3.1 + + public-encrypt@4.0.3: + dependencies: + bn.js: 4.12.2 + browserify-rsa: 4.1.1 + create-hash: 1.2.0 + parse-asn1: 5.1.7 + randombytes: 2.1.0 + safe-buffer: 5.2.1 + + pull-cat@1.1.11: {} + + pull-defer@0.2.3: {} + + pull-level@2.0.4: + dependencies: + level-post: 1.0.7 + pull-cat: 1.1.11 + pull-live: 1.0.1 + pull-pushable: 2.2.0 + pull-stream: 3.7.0 + pull-window: 2.1.4 + stream-to-pull-stream: 1.7.3 + + pull-live@1.0.1: + dependencies: + pull-cat: 1.1.11 + pull-stream: 3.7.0 + + pull-pushable@2.2.0: {} + + pull-stream@3.7.0: {} + + pull-window@2.1.4: + dependencies: + looper: 2.0.0 + + pump@3.0.2: + dependencies: + end-of-stream: 1.4.4 + once: 1.4.0 + + pumpify@2.0.1: + dependencies: + duplexify: 4.1.3 + inherits: 2.0.4 + pump: 3.0.2 + + punycode@1.4.1: {} + + punycode@2.1.0: {} + + punycode@2.3.1: {} + + pvtsutils@1.3.6: + dependencies: + tslib: 2.8.1 + + pvutils@1.1.3: {} + + q@1.5.1: {} + + qs@6.11.0: + dependencies: + side-channel: 1.1.0 + + qs@6.13.0: + dependencies: + side-channel: 1.1.0 + + qs@6.14.0: + dependencies: + side-channel: 1.1.0 + + qs@6.5.3: {} + + qs@6.9.6: {} + + qs@6.9.7: {} + + quansync@0.2.10: {} + + query-string@5.1.1: + dependencies: + decode-uri-component: 0.2.2 + object-assign: 4.1.1 + strict-uri-encode: 1.1.0 + + queue-microtask@1.2.3: {} + + queue@6.0.2: + dependencies: + inherits: 2.0.4 + + quick-format-unescaped@4.0.4: {} + + quick-lru@4.0.1: {} + + quick-lru@5.1.1: {} + + randomatic@3.1.1: + dependencies: + is-number: 4.0.0 + kind-of: 6.0.3 + math-random: 1.0.4 + + randombytes@2.1.0: + dependencies: + safe-buffer: 5.2.1 + + randomfill@1.0.4: + dependencies: + randombytes: 2.1.0 + safe-buffer: 5.2.1 + + range-parser@1.2.1: {} + + raw-body@2.4.2: + dependencies: + bytes: 3.1.1 + http-errors: 1.8.1 + iconv-lite: 0.4.24 + unpipe: 1.0.0 + + raw-body@2.4.3: + dependencies: + bytes: 3.1.2 + http-errors: 1.8.1 + iconv-lite: 0.4.24 + unpipe: 1.0.0 + + raw-body@2.5.1: + dependencies: + bytes: 3.1.2 + http-errors: 2.0.0 + iconv-lite: 0.4.24 + unpipe: 1.0.0 + + raw-body@2.5.2: + dependencies: + bytes: 3.1.2 + http-errors: 2.0.0 + iconv-lite: 0.4.24 + unpipe: 1.0.0 + + rc@1.2.8: + dependencies: + deep-extend: 0.6.0 + ini: 1.3.8 + minimist: 1.2.8 + strip-json-comments: 2.0.1 + + react-devtools-core@6.1.1(bufferutil@4.0.9)(utf-8-validate@5.0.10): + dependencies: + shell-quote: 1.8.2 + ws: 7.5.10(bufferutil@4.0.9)(utf-8-validate@5.0.10) + transitivePeerDependencies: + - bufferutil + - utf-8-validate + + react-is@18.3.1: {} + + react-native-fs@2.20.0(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)): + dependencies: + base-64: 0.1.0 + react-native: 0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10) + utf8: 3.0.0 + + react-native-path@0.0.5: {} + + react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10): + dependencies: + '@jest/create-cache-key-function': 29.7.0 + '@react-native/assets-registry': 0.79.2 + '@react-native/codegen': 0.79.2(@babel/core@7.27.1) + '@react-native/community-cli-plugin': 0.79.2(bufferutil@4.0.9)(utf-8-validate@5.0.10) + '@react-native/gradle-plugin': 0.79.2 + '@react-native/js-polyfills': 0.79.2 + '@react-native/normalize-colors': 0.79.2 + '@react-native/virtualized-lists': 0.79.2(react-native@0.79.2(@babel/core@7.27.1)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10))(react@19.1.0) + abort-controller: 3.0.0 + anser: 1.4.10 + ansi-regex: 5.0.1 + babel-jest: 29.7.0(@babel/core@7.27.1) + babel-plugin-syntax-hermes-parser: 0.25.1 + base64-js: 1.5.1 + chalk: 4.1.2 + commander: 12.1.0 + event-target-shim: 5.0.1 + flow-enums-runtime: 0.0.6 + glob: 7.2.3 + invariant: 2.2.4 + jest-environment-node: 29.7.0 + memoize-one: 5.2.1 + metro-runtime: 0.82.2 + metro-source-map: 0.82.2 + nullthrows: 1.1.1 + pretty-format: 29.7.0 + promise: 8.3.0 + react: 19.1.0 + react-devtools-core: 6.1.1(bufferutil@4.0.9)(utf-8-validate@5.0.10) + react-refresh: 0.14.2 + regenerator-runtime: 0.13.11 + scheduler: 0.25.0 + semver: 7.7.1 + stacktrace-parser: 0.1.11 + whatwg-fetch: 3.6.20 + ws: 6.2.3(bufferutil@4.0.9)(utf-8-validate@5.0.10) + yargs: 17.7.2 + transitivePeerDependencies: + - '@babel/core' + - '@react-native-community/cli' + - bufferutil + - supports-color + - utf-8-validate + + react-refresh@0.14.2: {} + + react@19.1.0: {} + + read-pkg-up@1.0.1: + dependencies: + find-up: 1.1.2 + read-pkg: 1.1.0 + + read-pkg-up@7.0.1: + dependencies: + find-up: 4.1.0 + read-pkg: 5.2.0 + type-fest: 0.8.1 + + read-pkg@1.1.0: + dependencies: + load-json-file: 1.1.0 + normalize-package-data: 2.5.0 + path-type: 1.1.0 + + read-pkg@5.2.0: + dependencies: + '@types/normalize-package-data': 2.4.4 + normalize-package-data: 2.5.0 + parse-json: 5.2.0 + type-fest: 0.6.0 + + read-yaml-file@1.1.0: + dependencies: + graceful-fs: 4.2.11 + js-yaml: 3.14.1 + pify: 4.0.1 + strip-bom: 3.0.0 + + readable-stream@1.0.34: + dependencies: + core-util-is: 1.0.3 + inherits: 2.0.4 + isarray: 0.0.1 + string_decoder: 0.10.31 + + readable-stream@1.1.14: + dependencies: + core-util-is: 1.0.3 + inherits: 2.0.4 + isarray: 0.0.1 + string_decoder: 0.10.31 + + readable-stream@2.3.8: + dependencies: + core-util-is: 1.0.3 + inherits: 2.0.4 + isarray: 1.0.0 + process-nextick-args: 2.0.1 + safe-buffer: 5.1.2 + string_decoder: 1.1.1 + util-deprecate: 1.0.2 + + readable-stream@3.6.2: + dependencies: + inherits: 2.0.4 + string_decoder: 1.3.0 + util-deprecate: 1.0.2 + + readdirp@2.2.1: + dependencies: + graceful-fs: 4.2.11 + micromatch: 3.1.10 + readable-stream: 2.3.8 + transitivePeerDependencies: + - supports-color + + readdirp@3.6.0: + dependencies: + picomatch: 2.3.1 + + readdirp@4.1.2: {} + + real-require@0.1.0: {} + + receptacle@1.3.2: + dependencies: + ms: 2.1.3 + + rechoir@0.6.2: + dependencies: + resolve: 1.22.10 + + recursive-readdir@2.2.3: + dependencies: + minimatch: 3.1.2 + + redent@3.0.0: + dependencies: + indent-string: 4.0.0 + strip-indent: 3.0.0 + + reduce-flatten@2.0.0: {} + + reflect.getprototypeof@1.0.10: + dependencies: + call-bind: 1.0.8 + define-properties: 1.2.1 + es-abstract: 1.23.9 + es-errors: 1.3.0 + es-object-atoms: 1.1.1 + get-intrinsic: 1.3.0 + get-proto: 1.0.1 + which-builtin-type: 1.2.1 + + regenerate@1.4.2: {} + + regenerator-runtime@0.11.1: {} + + regenerator-runtime@0.13.11: {} + + regenerator-transform@0.10.1: + dependencies: + babel-runtime: 6.26.0 + babel-types: 6.26.0 + private: 0.1.8 + + regex-cache@0.4.4: + dependencies: + is-equal-shallow: 0.1.3 + + regex-not@1.0.2: + dependencies: + extend-shallow: 3.0.2 + safe-regex: 1.1.0 + + regexp.prototype.flags@1.5.4: + dependencies: + call-bind: 1.0.8 + define-properties: 1.2.1 + es-errors: 1.3.0 + get-proto: 1.0.1 + gopd: 1.2.0 + set-function-name: 2.0.2 + + regexpu-core@2.0.0: + dependencies: + regenerate: 1.4.2 + regjsgen: 0.2.0 + regjsparser: 0.1.5 + + registry-auth-token@5.1.0: + dependencies: + '@pnpm/npm-conf': 2.3.1 + + registry-url@6.0.1: + dependencies: + rc: 1.2.8 + + regjsgen@0.2.0: {} + + regjsparser@0.1.5: + dependencies: + jsesc: 0.5.0 + + relay-runtime@12.0.0(encoding@0.1.13): + dependencies: + '@babel/runtime': 7.27.1 + fbjs: 3.0.5(encoding@0.1.13) + invariant: 2.2.4 + transitivePeerDependencies: + - encoding + + remove-trailing-separator@1.1.0: {} + + repeat-element@1.1.4: {} + + repeat-string@1.6.1: {} + + repeating@2.0.1: + dependencies: + is-finite: 1.1.0 + + req-cwd@2.0.0: + dependencies: + req-from: 2.0.0 + + req-from@2.0.0: + dependencies: + resolve-from: 3.0.0 + + request@2.88.2: + dependencies: + aws-sign2: 0.7.0 + aws4: 1.13.2 + caseless: 0.12.0 + combined-stream: 1.0.8 + extend: 3.0.2 + forever-agent: 0.6.1 + form-data: 2.3.3 + har-validator: 5.1.5 + http-signature: 1.2.0 + is-typedarray: 1.0.0 + isstream: 0.1.2 + json-stringify-safe: 5.0.1 + mime-types: 2.1.35 + oauth-sign: 0.9.0 + performance-now: 2.1.0 + qs: 6.5.3 + safe-buffer: 5.2.1 + tough-cookie: 2.5.0 + tunnel-agent: 0.6.0 + uuid: 3.4.0 + + require-directory@2.1.1: {} + + require-from-string@1.2.1: {} + + require-from-string@2.0.2: {} + + require-main-filename@1.0.1: {} + + require-main-filename@2.0.0: {} + + reset@0.1.0: {} + + resolve-alpn@1.2.1: {} + + resolve-dir@1.0.1: + dependencies: + expand-tilde: 2.0.2 + global-modules: 1.0.0 + + resolve-from@3.0.0: {} + + resolve-from@4.0.0: {} + + resolve-from@5.0.0: {} + + resolve-global@1.0.0: + dependencies: + global-dirs: 0.1.1 + + resolve-url@0.2.1: {} + + resolve@1.1.7: {} + + resolve@1.17.0: + dependencies: + path-parse: 1.0.7 + + resolve@1.22.10: + dependencies: + is-core-module: 2.16.1 + path-parse: 1.0.7 + supports-preserve-symlinks-flag: 1.0.0 + + responselike@1.0.2: + dependencies: + lowercase-keys: 1.0.1 + + responselike@2.0.1: + dependencies: + lowercase-keys: 2.0.0 + + responselike@3.0.0: + dependencies: + lowercase-keys: 3.0.0 + + restore-cursor@3.1.0: + dependencies: + onetime: 5.1.2 + signal-exit: 3.0.7 + + restore-cursor@5.1.0: + dependencies: + onetime: 7.0.0 + signal-exit: 4.1.0 + + ret@0.1.15: {} + + retry-as-promised@5.0.0: {} + + retry-as-promised@7.1.1: {} + + retry@0.12.0: {} + + retry@0.13.1: {} + + reusify@1.1.0: {} + + rfdc@1.4.1: {} + + rimraf@2.7.1: + dependencies: + glob: 7.2.3 + + rimraf@3.0.2: + dependencies: + glob: 7.2.3 + + rimraf@5.0.10: + dependencies: + glob: 10.4.5 + + ripemd160@2.0.2: + dependencies: + hash-base: 3.1.0 + inherits: 2.0.4 + + rlp@2.2.7: + dependencies: + bn.js: 5.2.2 + + run-async@2.4.1: {} + + run-parallel-limit@1.1.0: + dependencies: + queue-microtask: 1.2.3 + + run-parallel@1.2.0: + dependencies: + queue-microtask: 1.2.3 + + run@1.5.0: + dependencies: + minimatch: 10.0.1 + + rustbn.js@0.2.0: {} + + rxjs@6.6.7: + dependencies: + tslib: 1.14.1 + + rxjs@7.8.2: + dependencies: + tslib: 2.8.1 + + safe-array-concat@1.1.3: + dependencies: + call-bind: 1.0.8 + call-bound: 1.0.4 + get-intrinsic: 1.3.0 + has-symbols: 1.1.0 + isarray: 2.0.5 + + safe-buffer@5.1.2: {} + + safe-buffer@5.2.1: {} + + safe-event-emitter@1.0.1: + dependencies: + events: 3.3.0 + + safe-push-apply@1.0.0: + dependencies: + es-errors: 1.3.0 + isarray: 2.0.5 + + safe-regex-test@1.1.0: + dependencies: + call-bound: 1.0.4 + es-errors: 1.3.0 + is-regex: 1.2.1 + + safe-regex@1.1.0: + dependencies: + ret: 0.1.15 + + safe-stable-stringify@2.5.0: {} + + safer-buffer@2.1.2: {} + + sc-istanbul@0.4.6: + dependencies: + abbrev: 1.0.9 + async: 1.5.2 + escodegen: 1.8.1 + esprima: 2.7.3 + glob: 5.0.15 + handlebars: 4.7.8 + js-yaml: 3.14.1 + mkdirp: 0.5.6 + nopt: 3.0.6 + once: 1.4.0 + resolve: 1.1.7 + supports-color: 3.2.3 + which: 1.3.1 + wordwrap: 1.0.0 + + scheduler@0.25.0: {} + + scrypt-js@2.0.4: {} + + scrypt-js@3.0.1: {} + + scryptsy@1.2.1: + dependencies: + pbkdf2: 3.1.2 + optional: true + + secp256k1@4.0.4: + dependencies: + elliptic: 6.6.1 + node-addon-api: 5.1.0 + node-gyp-build: 4.8.4 + + seedrandom@3.0.1: {} + + semaphore@1.1.0: {} + + semver-compare@1.0.0: {} + + semver@5.4.1: {} + + semver@5.7.2: {} + + semver@6.3.1: {} + + semver@7.3.7: + dependencies: + lru-cache: 6.0.0 + + semver@7.6.0: + dependencies: + lru-cache: 6.0.0 + + semver@7.7.1: {} + + send@0.17.2: + dependencies: + debug: 2.6.9 + depd: 1.1.2 + destroy: 1.0.4 + encodeurl: 1.0.2 + escape-html: 1.0.3 + etag: 1.8.1 + fresh: 0.5.2 + http-errors: 1.8.1 + mime: 1.6.0 + ms: 2.1.3 + on-finished: 2.3.0 + range-parser: 1.2.1 + statuses: 1.5.0 + transitivePeerDependencies: + - supports-color + + send@0.18.0: + dependencies: + debug: 2.6.9 + depd: 2.0.0 + destroy: 1.2.0 + encodeurl: 1.0.2 + escape-html: 1.0.3 + etag: 1.8.1 + fresh: 0.5.2 + http-errors: 2.0.0 + mime: 1.6.0 + ms: 2.1.3 + on-finished: 2.4.1 + range-parser: 1.2.1 + statuses: 2.0.1 + transitivePeerDependencies: + - supports-color + + send@0.19.0: + dependencies: + debug: 2.6.9 + depd: 2.0.0 + destroy: 1.2.0 + encodeurl: 1.0.2 + escape-html: 1.0.3 + etag: 1.8.1 + fresh: 0.5.2 + http-errors: 2.0.0 + mime: 1.6.0 + ms: 2.1.3 + on-finished: 2.4.1 + range-parser: 1.2.1 + statuses: 2.0.1 + transitivePeerDependencies: + - supports-color + + sentence-case@3.0.4: + dependencies: + no-case: 3.0.4 + tslib: 2.8.1 + upper-case-first: 2.0.2 + + sequelize-pool@7.1.0: {} + + sequelize@6.19.0(pg-hstore@2.3.4)(pg@8.7.3): + dependencies: + '@types/debug': 4.1.12 + '@types/validator': 13.15.0 + debug: 4.4.0(supports-color@9.4.0) + dottie: 2.0.6 + inflection: 1.13.4 + lodash: 4.17.21 + moment: 2.30.1 + moment-timezone: 0.5.48 + pg-connection-string: 2.8.5 + retry-as-promised: 5.0.0 + semver: 7.7.1 + sequelize-pool: 7.1.0 + toposort-class: 1.0.1 + uuid: 8.3.2 + validator: 13.15.0 + wkx: 0.5.0 + optionalDependencies: + pg: 8.7.3 + pg-hstore: 2.3.4 + transitivePeerDependencies: + - supports-color + + sequelize@6.33.0(pg-hstore@2.3.4)(pg@8.11.3): + dependencies: + '@types/debug': 4.1.12 + '@types/validator': 13.15.0 + debug: 4.4.0(supports-color@9.4.0) + dottie: 2.0.6 + inflection: 1.13.4 + lodash: 4.17.21 + moment: 2.30.1 + moment-timezone: 0.5.48 + pg-connection-string: 2.8.5 + retry-as-promised: 7.1.1 + semver: 7.7.1 + sequelize-pool: 7.1.0 + toposort-class: 1.0.1 + uuid: 8.3.2 + validator: 13.15.0 + wkx: 0.5.0 + optionalDependencies: + pg: 8.11.3 + pg-hstore: 2.3.4 + transitivePeerDependencies: + - supports-color + + serialize-error@2.1.0: {} + + serialize-javascript@6.0.2: + dependencies: + randombytes: 2.1.0 + + serve-static@1.14.2: + dependencies: + encodeurl: 1.0.2 + escape-html: 1.0.3 + parseurl: 1.3.3 + send: 0.17.2 + transitivePeerDependencies: + - supports-color + + serve-static@1.15.0: + dependencies: + encodeurl: 1.0.2 + escape-html: 1.0.3 + parseurl: 1.3.3 + send: 0.18.0 + transitivePeerDependencies: + - supports-color + + serve-static@1.16.2: + dependencies: + encodeurl: 2.0.0 + escape-html: 1.0.3 + parseurl: 1.3.3 + send: 0.19.0 + transitivePeerDependencies: + - supports-color + + servify@0.1.12: + dependencies: + body-parser: 1.20.3 + cors: 2.8.5 + express: 4.21.2 + request: 2.88.2 + xhr: 2.6.0 + transitivePeerDependencies: + - supports-color + + set-blocking@2.0.0: {} + + set-function-length@1.2.2: + dependencies: + define-data-property: 1.1.4 + es-errors: 1.3.0 + function-bind: 1.1.2 + get-intrinsic: 1.3.0 + gopd: 1.2.0 + has-property-descriptors: 1.0.2 + + set-function-name@2.0.2: + dependencies: + define-data-property: 1.1.4 + es-errors: 1.3.0 + functions-have-names: 1.2.3 + has-property-descriptors: 1.0.2 + + set-immediate-shim@1.0.1: {} + + set-proto@1.0.0: + dependencies: + dunder-proto: 1.0.1 + es-errors: 1.3.0 + es-object-atoms: 1.1.1 + + set-value@2.0.1: + dependencies: + extend-shallow: 2.0.1 + is-extendable: 0.1.1 + is-plain-object: 2.0.4 + split-string: 3.1.0 + + setimmediate@1.0.4: {} + + setimmediate@1.0.5: {} + + setprototypeof@1.2.0: {} + + sha.js@2.4.11: + dependencies: + inherits: 2.0.4 + safe-buffer: 5.2.1 + + sha1@1.1.1: + dependencies: + charenc: 0.0.2 + crypt: 0.0.2 + + shebang-command@1.2.0: + dependencies: + shebang-regex: 1.0.0 + + shebang-command@2.0.0: + dependencies: + shebang-regex: 3.0.0 + + shebang-regex@1.0.0: {} + + shebang-regex@3.0.0: {} + + shell-quote@1.8.2: {} + + shelljs@0.8.5: + dependencies: + glob: 7.2.3 + interpret: 1.4.0 + rechoir: 0.6.2 + + side-channel-list@1.0.0: + dependencies: + es-errors: 1.3.0 + object-inspect: 1.13.4 + + side-channel-map@1.0.1: + dependencies: + call-bound: 1.0.4 + es-errors: 1.3.0 + get-intrinsic: 1.3.0 + object-inspect: 1.13.4 + + side-channel-weakmap@1.0.2: + dependencies: + call-bound: 1.0.4 + es-errors: 1.3.0 + get-intrinsic: 1.3.0 + object-inspect: 1.13.4 + side-channel-map: 1.0.1 + + side-channel@1.1.0: + dependencies: + es-errors: 1.3.0 + object-inspect: 1.13.4 + side-channel-list: 1.0.0 + side-channel-map: 1.0.1 + side-channel-weakmap: 1.0.2 + + signal-exit@3.0.7: {} + + signal-exit@4.1.0: {} + + signed-varint@2.0.1: + dependencies: + varint: 5.0.2 + + signedsource@1.0.0: {} + + simple-concat@1.0.1: {} + + simple-get@2.8.2: + dependencies: + decompress-response: 3.3.0 + once: 1.4.0 + simple-concat: 1.0.1 + + simple-get@3.1.1: + dependencies: + decompress-response: 4.2.1 + once: 1.4.0 + simple-concat: 1.0.1 + optional: true + + simple-swizzle@0.2.2: + dependencies: + is-arrayish: 0.3.2 + + simple-wcswidth@1.0.1: {} + + sisteransi@1.0.5: {} + + slash@1.0.0: {} + + slash@2.0.0: {} + + slash@3.0.0: {} + + slice-ansi@3.0.0: + dependencies: + ansi-styles: 4.3.0 + astral-regex: 2.0.0 + is-fullwidth-code-point: 3.0.0 + + slice-ansi@4.0.0: + dependencies: + ansi-styles: 4.3.0 + astral-regex: 2.0.0 + is-fullwidth-code-point: 3.0.0 + + slice-ansi@5.0.0: + dependencies: + ansi-styles: 6.2.1 + is-fullwidth-code-point: 4.0.0 + + slice-ansi@7.1.0: + dependencies: + ansi-styles: 6.2.1 + is-fullwidth-code-point: 5.0.0 + + snake-case@3.0.4: + dependencies: + dot-case: 3.0.4 + tslib: 2.8.1 + + snapdragon-node@2.1.1: + dependencies: + define-property: 1.0.0 + isobject: 3.0.1 + snapdragon-util: 3.0.1 + + snapdragon-util@3.0.1: + dependencies: + kind-of: 3.2.2 + + snapdragon@0.8.2: + dependencies: + base: 0.11.2 + debug: 2.6.9 + define-property: 0.2.5 + extend-shallow: 2.0.1 + map-cache: 0.2.2 + source-map: 0.5.7 + source-map-resolve: 0.5.3 + use: 3.1.1 + transitivePeerDependencies: + - supports-color + + sol-digger@0.0.2: {} + + sol-explore@1.6.1: {} + + solc-typed-ast@18.2.4(typescript@5.8.3)(zod@3.24.4): + dependencies: + axios: 1.9.0(debug@4.4.0) + commander: 12.1.0 + decimal.js: 10.5.0 + findup-sync: 5.0.0 + fs-extra: 11.3.0 + jsel: 1.1.6 + semver: 7.7.1 + solc: 0.8.25 + src-location: 1.1.0 + web3-eth-abi: 4.4.1(typescript@5.8.3)(zod@3.24.4) + transitivePeerDependencies: + - debug + - typescript + - zod + + solc@0.4.26: + dependencies: + fs-extra: 0.30.0 + memorystream: 0.3.1 + require-from-string: 1.2.1 + semver: 5.7.2 + yargs: 4.8.1 + + solc@0.6.12: + dependencies: + command-exists: 1.2.9 + commander: 3.0.2 + fs-extra: 0.30.0 + js-sha3: 0.8.0 + memorystream: 0.3.1 + require-from-string: 2.0.2 + semver: 5.7.2 + tmp: 0.0.33 + + solc@0.7.3(debug@4.4.0): + dependencies: + command-exists: 1.2.9 + commander: 3.0.2 + follow-redirects: 1.15.9(debug@4.4.0) + fs-extra: 0.30.0 + js-sha3: 0.8.0 + memorystream: 0.3.1 + require-from-string: 2.0.2 + semver: 5.7.2 + tmp: 0.0.33 + transitivePeerDependencies: + - debug + + solc@0.8.25: + dependencies: + command-exists: 1.2.9 + commander: 8.3.0 + follow-redirects: 1.15.9(debug@4.4.0) + js-sha3: 0.8.0 + memorystream: 0.3.1 + semver: 5.7.2 + tmp: 0.0.33 + transitivePeerDependencies: + - debug + + solc@0.8.26(debug@4.4.0): + dependencies: + command-exists: 1.2.9 + commander: 8.3.0 + follow-redirects: 1.15.9(debug@4.4.0) + js-sha3: 0.8.0 + memorystream: 0.3.1 + semver: 5.7.2 + tmp: 0.0.33 + transitivePeerDependencies: + - debug + + solhint-community@3.7.0(typescript@5.8.3): + dependencies: + '@solidity-parser/parser': 0.16.2 + ajv: 6.12.6 + antlr4: 4.13.2 + ast-parents: 0.0.1 + chalk: 4.1.2 + commander: 11.1.0 + cosmiconfig: 8.3.6(typescript@5.8.3) + fast-diff: 1.3.0 + glob: 8.1.0 + ignore: 5.3.2 + js-yaml: 4.1.0 + lodash: 4.17.21 + pluralize: 8.0.0 + semver: 6.3.1 + strip-ansi: 6.0.1 + table: 6.9.0 + text-table: 0.2.0 + optionalDependencies: + prettier: 2.8.8 + transitivePeerDependencies: + - typescript + + solhint-plugin-prettier@0.1.0(prettier-plugin-solidity@1.4.3(prettier@3.5.3))(prettier@3.5.3): + dependencies: + '@prettier/sync': 0.3.0(prettier@3.5.3) + prettier: 3.5.3 + prettier-linter-helpers: 1.0.0 + prettier-plugin-solidity: 1.4.3(prettier@3.5.3) + + solhint@4.5.4(typescript@4.9.5): + dependencies: + '@solidity-parser/parser': 0.18.0 + ajv: 6.12.6 + antlr4: 4.13.2 + ast-parents: 0.0.1 + chalk: 4.1.2 + commander: 10.0.1 + cosmiconfig: 8.3.6(typescript@4.9.5) + fast-diff: 1.3.0 + glob: 8.1.0 + ignore: 5.3.2 + js-yaml: 4.1.0 + latest-version: 7.0.0 + lodash: 4.17.21 + pluralize: 8.0.0 + semver: 7.7.1 + strip-ansi: 6.0.1 + table: 6.9.0 + text-table: 0.2.0 + optionalDependencies: + prettier: 2.8.8 + transitivePeerDependencies: + - typescript + + solhint@4.5.4(typescript@5.8.3): + dependencies: + '@solidity-parser/parser': 0.18.0 + ajv: 6.12.6 + antlr4: 4.13.2 + ast-parents: 0.0.1 + chalk: 4.1.2 + commander: 10.0.1 + cosmiconfig: 8.3.6(typescript@5.8.3) + fast-diff: 1.3.0 + glob: 8.1.0 + ignore: 5.3.2 + js-yaml: 4.1.0 + latest-version: 7.0.0 + lodash: 4.17.21 + pluralize: 8.0.0 + semver: 7.7.1 + strip-ansi: 6.0.1 + table: 6.9.0 + text-table: 0.2.0 + optionalDependencies: + prettier: 2.8.8 + transitivePeerDependencies: + - typescript + + solidity-ast@0.4.60: {} + + solidity-coverage@0.7.22(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10): + dependencies: + '@solidity-parser/parser': 0.14.5 + '@truffle/provider': 0.2.64(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10) + chalk: 2.4.2 + death: 1.1.0 + detect-port: 1.6.1 + fs-extra: 8.1.0 + ghost-testrpc: 0.0.2 + global-modules: 2.0.0 + globby: 10.0.2 + jsonschema: 1.5.0 + lodash: 4.17.21 + node-emoji: 1.11.0 + pify: 4.0.1 + recursive-readdir: 2.2.3 + sc-istanbul: 0.4.6 + semver: 7.7.1 + shelljs: 0.8.5 + web3-utils: 1.10.4 + transitivePeerDependencies: + - bufferutil + - encoding + - supports-color + - utf-8-validate + + solidity-coverage@0.8.15(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)): + dependencies: + '@ethersproject/abi': 5.8.0 + '@solidity-parser/parser': 0.19.0 + chalk: 2.4.2 + death: 1.1.0 + difflib: 0.2.4 + fs-extra: 8.1.0 + ghost-testrpc: 0.0.2 + global-modules: 2.0.0 + globby: 10.0.2 + hardhat: 2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10) + jsonschema: 1.5.0 + lodash: 4.17.21 + mocha: 10.8.2 + node-emoji: 1.11.0 + pify: 4.0.1 + recursive-readdir: 2.2.3 + sc-istanbul: 0.4.6 + semver: 7.7.1 + shelljs: 0.8.5 + web3-utils: 1.10.4 + + solidity-docgen@0.6.0-beta.36(hardhat@2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10)): + dependencies: + handlebars: 4.7.8 + hardhat: 2.23.0(bufferutil@4.0.9)(ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3))(typescript@5.8.3)(utf-8-validate@5.0.10) + solidity-ast: 0.4.60 + + solium-plugin-security@0.1.1(solium@1.2.5): + dependencies: + solium: 1.2.5 + + solium@1.2.5: + dependencies: + ajv: 5.5.2 + chokidar: 1.7.0 + colors: 1.4.0 + commander: 2.20.3 + diff: 3.5.0 + eol: 0.9.1 + js-string-escape: 1.0.1 + lodash: 4.17.21 + sol-digger: 0.0.2 + sol-explore: 1.6.1 + solium-plugin-security: 0.1.1(solium@1.2.5) + solparse: 2.2.8 + text-table: 0.2.0 + transitivePeerDependencies: + - supports-color + + solparse@2.2.8: + dependencies: + mocha: 4.1.0 + pegjs: 0.10.0 + yargs: 10.1.2 + + sonic-boom@2.8.0: + dependencies: + atomic-sleep: 1.0.0 + + source-map-resolve@0.5.3: + dependencies: + atob: 2.1.2 + decode-uri-component: 0.2.2 + resolve-url: 0.2.1 + source-map-url: 0.4.1 + urix: 0.1.0 + + source-map-support@0.4.18: + dependencies: + source-map: 0.5.7 + + source-map-support@0.5.12: + dependencies: + buffer-from: 1.1.2 + source-map: 0.6.1 + + source-map-support@0.5.21: + dependencies: + buffer-from: 1.1.2 + source-map: 0.6.1 + + source-map-url@0.4.1: {} + + source-map@0.2.0: + dependencies: + amdefine: 1.0.1 + optional: true + + source-map@0.5.7: {} + + source-map@0.6.1: {} + + spawndamnit@3.0.1: + dependencies: + cross-spawn: 7.0.6 + signal-exit: 4.1.0 + + spdx-correct@3.2.0: + dependencies: + spdx-expression-parse: 3.0.1 + spdx-license-ids: 3.0.21 + + spdx-exceptions@2.5.0: {} + + spdx-expression-parse@3.0.1: + dependencies: + spdx-exceptions: 2.5.0 + spdx-license-ids: 3.0.21 + + spdx-license-ids@3.0.21: {} + + split-string@3.1.0: + dependencies: + extend-shallow: 3.0.2 + + split2@3.2.2: + dependencies: + readable-stream: 3.6.2 + + split2@4.2.0: {} + + sponge-case@1.0.1: + dependencies: + tslib: 2.8.1 + + sprintf-js@1.0.3: {} + + src-location@1.1.0: {} + + sshpk@1.18.0: + dependencies: + asn1: 0.2.6 + assert-plus: 1.0.0 + bcrypt-pbkdf: 1.0.2 + dashdash: 1.14.1 + ecc-jsbn: 0.1.2 + getpass: 0.1.7 + jsbn: 0.1.1 + safer-buffer: 2.1.2 + tweetnacl: 0.14.5 + + stable@0.1.8: {} + + stack-trace@0.0.10: {} + + stack-utils@2.0.6: + dependencies: + escape-string-regexp: 2.0.0 + + stackframe@1.3.4: {} + + stacktrace-parser@0.1.11: + dependencies: + type-fest: 0.7.1 + + static-extend@0.1.2: + dependencies: + define-property: 0.2.5 + object-copy: 0.1.0 + + statuses@1.5.0: {} + + statuses@2.0.1: {} + + stream-shift@1.0.3: {} + + stream-to-it@0.2.4: + dependencies: + get-iterator: 1.0.2 + + stream-to-pull-stream@1.7.3: + dependencies: + looper: 3.0.0 + pull-stream: 3.7.0 + + streamsearch@1.1.0: {} + + strict-uri-encode@1.1.0: {} + + string-argv@0.3.1: {} + + string-argv@0.3.2: {} + + string-format@2.0.0: {} + + string-width@1.0.2: + dependencies: + code-point-at: 1.1.0 + is-fullwidth-code-point: 1.0.0 + strip-ansi: 3.0.1 + + string-width@2.1.1: + dependencies: + is-fullwidth-code-point: 2.0.0 + strip-ansi: 4.0.0 + + string-width@4.2.3: + dependencies: + emoji-regex: 8.0.0 + is-fullwidth-code-point: 3.0.0 + strip-ansi: 6.0.1 + + string-width@5.1.2: + dependencies: + eastasianwidth: 0.2.0 + emoji-regex: 9.2.2 + strip-ansi: 7.1.0 + + string-width@7.2.0: + dependencies: + emoji-regex: 10.4.0 + get-east-asian-width: 1.3.0 + strip-ansi: 7.1.0 + + string.prototype.trim@1.2.10: + dependencies: + call-bind: 1.0.8 + call-bound: 1.0.4 + define-data-property: 1.1.4 + define-properties: 1.2.1 + es-abstract: 1.23.9 + es-object-atoms: 1.1.1 + has-property-descriptors: 1.0.2 + + string.prototype.trimend@1.0.9: + dependencies: + call-bind: 1.0.8 + call-bound: 1.0.4 + define-properties: 1.2.1 + es-object-atoms: 1.1.1 + + string.prototype.trimstart@1.0.8: + dependencies: + call-bind: 1.0.8 + define-properties: 1.2.1 + es-object-atoms: 1.1.1 + + string_decoder@0.10.31: {} + + string_decoder@1.1.1: + dependencies: + safe-buffer: 5.1.2 + + string_decoder@1.3.0: + dependencies: + safe-buffer: 5.2.1 + + stringify-object@3.3.0: + dependencies: + get-own-enumerable-property-symbols: 3.0.2 + is-obj: 1.0.1 + is-regexp: 1.0.0 + + strip-ansi@3.0.1: + dependencies: + ansi-regex: 2.1.1 + + strip-ansi@4.0.0: + dependencies: + ansi-regex: 3.0.1 + + strip-ansi@5.2.0: + dependencies: + ansi-regex: 4.1.1 + + strip-ansi@6.0.1: + dependencies: + ansi-regex: 5.0.1 + + strip-ansi@7.1.0: + dependencies: + ansi-regex: 6.1.0 + + strip-bom@2.0.0: + dependencies: + is-utf8: 0.2.1 + + strip-bom@3.0.0: {} + + strip-eof@1.0.0: {} + + strip-final-newline@2.0.0: {} + + strip-final-newline@3.0.0: {} + + strip-hex-prefix@1.0.0: + dependencies: + is-hex-prefixed: 1.0.0 + + strip-indent@3.0.0: + dependencies: + min-indent: 1.0.1 + + strip-json-comments@2.0.1: {} + + strip-json-comments@3.1.1: {} + + supports-color@2.0.0: {} + + supports-color@3.2.3: + dependencies: + has-flag: 1.0.0 + + supports-color@4.4.0: + dependencies: + has-flag: 2.0.0 + + supports-color@5.5.0: + dependencies: + has-flag: 3.0.0 + + supports-color@7.2.0: + dependencies: + has-flag: 4.0.0 + + supports-color@8.1.1: + dependencies: + has-flag: 4.0.0 + + supports-color@9.4.0: {} + + supports-preserve-symlinks-flag@1.0.0: {} + + swap-case@2.0.2: + dependencies: + tslib: 2.8.1 + + swarm-js@0.1.42(bufferutil@4.0.9)(utf-8-validate@5.0.10): + dependencies: + bluebird: 3.7.2 + buffer: 5.7.1 + eth-lib: 0.1.29(bufferutil@4.0.9)(utf-8-validate@5.0.10) + fs-extra: 4.0.3 + got: 11.8.6 + mime-types: 2.1.35 + mkdirp-promise: 5.0.1 + mock-fs: 4.14.0 + setimmediate: 1.0.5 + tar: 4.4.19 + xhr-request: 1.1.0 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + + sync-request@6.1.0: + dependencies: + http-response-object: 3.0.2 + sync-rpc: 1.3.6 + then-request: 6.0.2 + + sync-rpc@1.3.6: + dependencies: + get-port: 3.2.0 + + table-layout@1.0.2: + dependencies: + array-back: 4.0.2 + deep-extend: 0.6.0 + typical: 5.2.0 + wordwrapjs: 4.0.1 + + table@6.9.0: + dependencies: + ajv: 8.17.1 + lodash.truncate: 4.4.2 + slice-ansi: 4.0.0 + string-width: 4.2.3 + strip-ansi: 6.0.1 + + tape@4.17.0: + dependencies: + '@ljharb/resumer': 0.0.1 + '@ljharb/through': 2.3.14 + call-bind: 1.0.8 + deep-equal: 1.1.2 + defined: 1.0.1 + dotignore: 0.1.2 + for-each: 0.3.5 + glob: 7.2.3 + has: 1.0.4 + inherits: 2.0.4 + is-regex: 1.1.4 + minimist: 1.2.8 + mock-property: 1.0.3 + object-inspect: 1.12.3 + resolve: 1.22.10 + string.prototype.trim: 1.2.10 + + tar-fs@2.1.2: + dependencies: + chownr: 1.1.4 + mkdirp-classic: 0.5.3 + pump: 3.0.2 + tar-stream: 2.2.0 + optional: true + + tar-stream@2.2.0: + dependencies: + bl: 4.1.0 + end-of-stream: 1.4.4 + fs-constants: 1.0.0 + inherits: 2.0.4 + readable-stream: 3.6.2 + optional: true + + tar@4.4.19: + dependencies: + chownr: 1.1.4 + fs-minipass: 1.2.7 + minipass: 2.9.0 + minizlib: 1.3.3 + mkdirp: 0.5.6 + safe-buffer: 5.2.1 + yallist: 3.1.1 + + tdigest@0.1.2: + dependencies: + bintrees: 1.0.2 + + term-size@2.2.1: {} + + terser@5.39.0: + dependencies: + '@jridgewell/source-map': 0.3.6 + acorn: 8.14.1 + commander: 2.20.3 + source-map-support: 0.5.21 + + test-exclude@6.0.0: + dependencies: + '@istanbuljs/schema': 0.1.3 + glob: 7.2.3 + minimatch: 3.1.2 + + test-value@2.1.0: + dependencies: + array-back: 1.0.4 + typical: 2.6.1 + + testrpc@0.0.1: {} + + text-extensions@1.9.0: {} + + text-extensions@2.4.0: {} + + text-hex@1.0.0: {} + + text-table@0.2.0: {} + + then-request@6.0.2: + dependencies: + '@types/concat-stream': 1.6.1 + '@types/form-data': 0.0.33 + '@types/node': 8.10.66 + '@types/qs': 6.9.18 + caseless: 0.12.0 + concat-stream: 1.6.2 + form-data: 2.5.3 + http-basic: 8.1.3 + http-response-object: 3.0.2 + promise: 8.3.0 + qs: 6.14.0 + + thread-stream@0.13.2: + dependencies: + real-require: 0.1.0 + + throat@5.0.0: {} + + through2@2.0.5: + dependencies: + readable-stream: 2.3.8 + xtend: 4.0.2 + + through2@3.0.2: + dependencies: + inherits: 2.0.4 + readable-stream: 3.6.2 + + through2@4.0.2: + dependencies: + readable-stream: 3.6.2 + + through@2.3.8: {} + + timed-out@4.0.1: {} + + tiny-lru@8.0.2: {} + + tinyglobby@0.2.13: + dependencies: + fdir: 6.4.4(picomatch@4.0.2) + picomatch: 4.0.2 + + title-case@3.0.3: + dependencies: + tslib: 2.8.1 + + tmp@0.0.33: + dependencies: + os-tmpdir: 1.0.2 + + tmp@0.1.0: + dependencies: + rimraf: 2.7.1 + + tmpl@1.0.5: {} + + to-fast-properties@1.0.3: {} + + to-object-path@0.3.0: + dependencies: + kind-of: 3.2.2 + + to-readable-stream@1.0.0: {} + + to-regex-range@2.1.1: + dependencies: + is-number: 3.0.0 + repeat-string: 1.6.1 + + to-regex-range@5.0.1: + dependencies: + is-number: 7.0.0 + + to-regex@3.0.2: + dependencies: + define-property: 2.0.2 + extend-shallow: 3.0.2 + regex-not: 1.0.2 + safe-regex: 1.1.0 + + toidentifier@1.0.1: {} + + toposort-class@1.0.1: {} + + tough-cookie@2.5.0: + dependencies: + psl: 1.15.0 + punycode: 2.3.1 + + tr46@0.0.3: {} + + trim-newlines@3.0.1: {} + + trim-right@1.0.1: {} + + triple-beam@1.4.1: {} + + truffle-flattener@1.6.0: + dependencies: + '@resolver-engine/imports-fs': 0.2.2 + '@solidity-parser/parser': 0.14.5 + find-up: 2.1.0 + mkdirp: 1.0.4 + tsort: 0.0.1 + transitivePeerDependencies: + - supports-color + + ts-algebra@1.2.2: {} + + ts-api-utils@1.4.3(typescript@5.8.3): + dependencies: + typescript: 5.8.3 + + ts-command-line-args@2.5.1: + dependencies: + chalk: 4.1.2 + command-line-args: 5.2.1 + command-line-usage: 6.1.3 + string-format: 2.0.0 + + ts-essentials@1.0.4: {} + + ts-essentials@6.0.7(typescript@4.9.5): + dependencies: + typescript: 4.9.5 + + ts-essentials@6.0.7(typescript@5.8.3): + dependencies: + typescript: 5.8.3 + + ts-essentials@7.0.3(typescript@4.9.5): + dependencies: + typescript: 4.9.5 + + ts-essentials@7.0.3(typescript@5.8.3): + dependencies: + typescript: 5.8.3 + + ts-generator@0.1.1: + dependencies: + '@types/mkdirp': 0.5.2 + '@types/prettier': 2.7.3 + '@types/resolve': 0.0.8 + chalk: 2.4.2 + glob: 7.2.3 + mkdirp: 0.5.6 + prettier: 2.8.8 + resolve: 1.22.10 + ts-essentials: 1.0.4 + + ts-node@10.9.2(@types/node@17.0.45)(typescript@4.9.5): + dependencies: + '@cspotcode/source-map-support': 0.8.1 + '@tsconfig/node10': 1.0.11 + '@tsconfig/node12': 1.0.11 + '@tsconfig/node14': 1.0.3 + '@tsconfig/node16': 1.0.4 + '@types/node': 17.0.45 + acorn: 8.14.1 + acorn-walk: 8.3.4 + arg: 4.1.3 + create-require: 1.1.1 + diff: 4.0.2 + make-error: 1.3.6 + typescript: 4.9.5 + v8-compile-cache-lib: 3.0.1 + yn: 3.1.1 + + ts-node@10.9.2(@types/node@20.17.32)(typescript@4.9.5): + dependencies: + '@cspotcode/source-map-support': 0.8.1 + '@tsconfig/node10': 1.0.11 + '@tsconfig/node12': 1.0.11 + '@tsconfig/node14': 1.0.3 + '@tsconfig/node16': 1.0.4 + '@types/node': 20.17.32 + acorn: 8.14.1 + acorn-walk: 8.3.4 + arg: 4.1.3 + create-require: 1.1.1 + diff: 4.0.2 + make-error: 1.3.6 + typescript: 4.9.5 + v8-compile-cache-lib: 3.0.1 + yn: 3.1.1 + + ts-node@10.9.2(@types/node@20.17.32)(typescript@5.8.3): + dependencies: + '@cspotcode/source-map-support': 0.8.1 + '@tsconfig/node10': 1.0.11 + '@tsconfig/node12': 1.0.11 + '@tsconfig/node14': 1.0.3 + '@tsconfig/node16': 1.0.4 + '@types/node': 20.17.32 + acorn: 8.14.1 + acorn-walk: 8.3.4 + arg: 4.1.3 + create-require: 1.1.1 + diff: 4.0.2 + make-error: 1.3.6 + typescript: 5.8.3 + v8-compile-cache-lib: 3.0.1 + yn: 3.1.1 + + ts-node@10.9.2(@types/node@22.7.5)(typescript@5.8.3): + dependencies: + '@cspotcode/source-map-support': 0.8.1 + '@tsconfig/node10': 1.0.11 + '@tsconfig/node12': 1.0.11 + '@tsconfig/node14': 1.0.3 + '@tsconfig/node16': 1.0.4 + '@types/node': 22.7.5 + acorn: 8.14.1 + acorn-walk: 8.3.4 + arg: 4.1.3 + create-require: 1.1.1 + diff: 4.0.2 + make-error: 1.3.6 + typescript: 5.8.3 + v8-compile-cache-lib: 3.0.1 + yn: 3.1.1 + optional: true + + ts-node@8.10.2(typescript@5.8.3): + dependencies: + arg: 4.1.3 + diff: 4.0.2 + make-error: 1.3.6 + source-map-support: 0.5.21 + typescript: 5.8.3 + yn: 3.1.1 + + tsconfig-paths@4.2.0: + dependencies: + json5: 2.2.3 + minimist: 1.2.8 + strip-bom: 3.0.0 + + tslib@1.14.1: {} + + tslib@2.4.1: {} + + tslib@2.5.3: {} + + tslib@2.7.0: {} + + tslib@2.8.1: {} + + tslog@4.9.3: {} + + tsort@0.0.1: {} + + tunnel-agent@0.6.0: + dependencies: + safe-buffer: 5.2.1 + + tweetnacl-util@0.15.1: {} + + tweetnacl@0.14.5: {} + + tweetnacl@1.0.3: {} + + type-check@0.3.2: + dependencies: + prelude-ls: 1.1.2 + + type-check@0.4.0: + dependencies: + prelude-ls: 1.2.1 + + type-detect@4.0.8: {} + + type-detect@4.1.0: {} + + type-fest@0.18.1: {} + + type-fest@0.20.2: {} + + type-fest@0.21.3: {} + + type-fest@0.6.0: {} + + type-fest@0.7.1: {} + + type-fest@0.8.1: {} + + type-is@1.6.18: + dependencies: + media-typer: 0.3.0 + mime-types: 2.1.35 + + type@2.7.3: {} + + typechain@3.0.0(typescript@4.9.5): + dependencies: + command-line-args: 4.0.7 + debug: 4.4.0(supports-color@9.4.0) + fs-extra: 7.0.1 + js-sha3: 0.8.0 + lodash: 4.17.21 + ts-essentials: 6.0.7(typescript@4.9.5) + ts-generator: 0.1.1 + transitivePeerDependencies: + - supports-color + - typescript + + typechain@3.0.0(typescript@5.8.3): + dependencies: + command-line-args: 4.0.7 + debug: 4.4.0(supports-color@9.4.0) + fs-extra: 7.0.1 + js-sha3: 0.8.0 + lodash: 4.17.21 + ts-essentials: 6.0.7(typescript@5.8.3) + ts-generator: 0.1.1 + transitivePeerDependencies: + - supports-color + - typescript + + typechain@5.2.0(typescript@5.8.3): + dependencies: + '@types/prettier': 2.7.3 + command-line-args: 4.0.7 + debug: 4.4.0(supports-color@9.4.0) + fs-extra: 7.0.1 + glob: 7.2.3 + js-sha3: 0.8.0 + lodash: 4.17.21 + mkdirp: 1.0.4 + prettier: 2.8.8 + ts-essentials: 7.0.3(typescript@5.8.3) + typescript: 5.8.3 + transitivePeerDependencies: + - supports-color + + typechain@7.0.1(typescript@4.9.5): + dependencies: + '@types/prettier': 2.7.3 + debug: 4.4.0(supports-color@9.4.0) + fs-extra: 7.0.1 + glob: 7.2.3 + js-sha3: 0.8.0 + lodash: 4.17.21 + mkdirp: 1.0.4 + prettier: 2.8.8 + ts-command-line-args: 2.5.1 + ts-essentials: 7.0.3(typescript@4.9.5) + typescript: 4.9.5 + transitivePeerDependencies: + - supports-color + + typechain@8.3.2(typescript@5.8.3): + dependencies: + '@types/prettier': 2.7.3 + debug: 4.4.0(supports-color@9.4.0) + fs-extra: 7.0.1 + glob: 7.1.7 + js-sha3: 0.8.0 + lodash: 4.17.21 + mkdirp: 1.0.4 + prettier: 2.8.8 + ts-command-line-args: 2.5.1 + ts-essentials: 7.0.3(typescript@5.8.3) + typescript: 5.8.3 + transitivePeerDependencies: + - supports-color + + typed-array-buffer@1.0.3: + dependencies: + call-bound: 1.0.4 + es-errors: 1.3.0 + is-typed-array: 1.1.15 + + typed-array-byte-length@1.0.3: + dependencies: + call-bind: 1.0.8 + for-each: 0.3.5 + gopd: 1.2.0 + has-proto: 1.2.0 + is-typed-array: 1.1.15 + + typed-array-byte-offset@1.0.4: + dependencies: + available-typed-arrays: 1.0.7 + call-bind: 1.0.8 + for-each: 0.3.5 + gopd: 1.2.0 + has-proto: 1.2.0 + is-typed-array: 1.1.15 + reflect.getprototypeof: 1.0.10 + + typed-array-length@1.0.7: + dependencies: + call-bind: 1.0.8 + for-each: 0.3.5 + gopd: 1.2.0 + is-typed-array: 1.1.15 + possible-typed-array-names: 1.1.0 + reflect.getprototypeof: 1.0.10 + + typedarray-to-buffer@3.1.5: + dependencies: + is-typedarray: 1.0.0 + + typedarray@0.0.6: {} + + typescript-eslint@7.18.0(eslint@8.57.1)(typescript@5.8.3): + dependencies: + '@typescript-eslint/eslint-plugin': 7.18.0(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.8.3))(eslint@8.57.1)(typescript@5.8.3) + '@typescript-eslint/parser': 7.18.0(eslint@8.57.1)(typescript@5.8.3) + '@typescript-eslint/utils': 7.18.0(eslint@8.57.1)(typescript@5.8.3) + eslint: 8.57.1 + optionalDependencies: + typescript: 5.8.3 + transitivePeerDependencies: + - supports-color + + typescript@4.9.5: {} + + typescript@5.8.3: {} + + typewise-core@1.2.0: {} + + typewise@1.0.3: + dependencies: + typewise-core: 1.2.0 + + typewiselite@1.0.0: {} + + typical@2.6.1: {} + + typical@4.0.0: {} + + typical@5.2.0: {} + + u2f-api@0.2.7: {} + + ua-parser-js@1.0.40: {} + + uglify-js@3.19.3: + optional: true + + uint8arrays@1.1.0: + dependencies: + multibase: 3.1.2 + web-encoding: 1.1.5 + + uint8arrays@2.1.10: + dependencies: + multiformats: 9.9.0 + + uint8arrays@3.1.1: + dependencies: + multiformats: 9.9.0 + + ultron@1.1.1: {} + + unbox-primitive@1.1.0: + dependencies: + call-bound: 1.0.4 + has-bigints: 1.1.0 + has-symbols: 1.1.0 + which-boxed-primitive: 1.1.1 + + unc-path-regex@0.1.2: {} + + underscore@1.13.7: {} + + underscore@1.9.1: + optional: true + + undici-types@6.19.8: {} + + undici@5.29.0: + dependencies: + '@fastify/busboy': 2.1.1 + + unfetch@4.2.0: {} + + union-value@1.0.1: + dependencies: + arr-union: 3.1.0 + get-value: 2.0.6 + is-extendable: 0.1.1 + set-value: 2.0.1 + + universalify@0.1.2: {} + + universalify@2.0.1: {} + + unixify@1.0.0: + dependencies: + normalize-path: 2.1.1 + + unorm@1.6.0: {} + + unpipe@1.0.0: {} + + unset-value@1.0.0: + dependencies: + has-value: 0.3.1 + isobject: 3.0.1 + + update-browserslist-db@1.1.3(browserslist@4.24.5): + dependencies: + browserslist: 4.24.5 + escalade: 3.2.0 + picocolors: 1.1.1 + + upper-case-first@2.0.2: + dependencies: + tslib: 2.8.1 + + upper-case@2.0.2: + dependencies: + tslib: 2.8.1 + + uri-js@4.4.1: + dependencies: + punycode: 2.3.1 + + urix@0.1.0: {} + + url-parse-lax@3.0.0: + dependencies: + prepend-http: 2.0.0 + + url-set-query@1.0.0: {} + + url@0.11.4: + dependencies: + punycode: 1.4.1 + qs: 6.14.0 + + urlpattern-polyfill@8.0.2: {} + + usb@1.9.2: + dependencies: + node-addon-api: 4.3.0 + node-gyp-build: 4.8.4 + optional: true + + use@3.1.1: {} + + utf-8-validate@5.0.10: + dependencies: + node-gyp-build: 4.8.4 + + utf8@3.0.0: {} + + util-deprecate@1.0.2: {} + + util.promisify@1.1.3: + dependencies: + call-bind: 1.0.8 + call-bound: 1.0.4 + define-data-property: 1.1.4 + define-properties: 1.2.1 + es-errors: 1.3.0 + es-object-atoms: 1.1.1 + for-each: 0.3.5 + get-intrinsic: 1.3.0 + has-proto: 1.2.0 + has-symbols: 1.1.0 + object.getownpropertydescriptors: 2.1.8 + safe-array-concat: 1.1.3 + + util@0.12.5: + dependencies: + inherits: 2.0.4 + is-arguments: 1.2.0 + is-generator-function: 1.1.0 + is-typed-array: 1.1.15 + which-typed-array: 1.1.19 + + utils-merge@1.0.1: {} + + uuid@2.0.1: {} + + uuid@3.3.2: {} + + uuid@3.4.0: {} + + uuid@8.3.2: {} + + uuid@9.0.1: {} + + v8-compile-cache-lib@3.0.1: {} + + validate-npm-package-license@3.0.4: + dependencies: + spdx-correct: 3.2.0 + spdx-expression-parse: 3.0.1 + + validator@13.15.0: {} + + value-or-promise@1.0.12: {} + + varint@5.0.2: {} + + varint@6.0.0: {} + + vary@1.1.2: {} + + verror@1.10.0: + dependencies: + assert-plus: 1.0.0 + core-util-is: 1.0.2 + extsprintf: 1.3.0 + + vlq@1.0.1: {} + + walker@1.0.8: + dependencies: + makeerror: 1.0.12 + + web-encoding@1.1.5: + dependencies: + util: 0.12.5 + optionalDependencies: + '@zxing/text-encoding': 0.9.0 + + web-streams-polyfill@3.3.3: {} + + web3-bzz@1.10.0(bufferutil@4.0.9)(utf-8-validate@5.0.10): + dependencies: + '@types/node': 12.20.55 + got: 12.1.0 + swarm-js: 0.1.42(bufferutil@4.0.9)(utf-8-validate@5.0.10) + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + + web3-bzz@1.2.11(bufferutil@4.0.9)(utf-8-validate@5.0.10): + dependencies: + '@types/node': 12.20.55 + got: 9.6.0 + swarm-js: 0.1.42(bufferutil@4.0.9)(utf-8-validate@5.0.10) + underscore: 1.9.1 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + optional: true + + web3-bzz@1.7.4(bufferutil@4.0.9)(utf-8-validate@5.0.10): + dependencies: + '@types/node': 12.20.55 + got: 9.6.0 + swarm-js: 0.1.42(bufferutil@4.0.9)(utf-8-validate@5.0.10) + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + + web3-core-helpers@1.10.0: + dependencies: + web3-eth-iban: 1.10.0 + web3-utils: 1.10.0 + + web3-core-helpers@1.2.11: + dependencies: + underscore: 1.9.1 + web3-eth-iban: 1.2.11 + web3-utils: 1.2.11 + optional: true + + web3-core-helpers@1.7.4: + dependencies: + web3-eth-iban: 1.7.4 + web3-utils: 1.7.4 + + web3-core-method@1.10.0: + dependencies: + '@ethersproject/transactions': 5.8.0 + web3-core-helpers: 1.10.0 + web3-core-promievent: 1.10.0 + web3-core-subscriptions: 1.10.0 + web3-utils: 1.10.0 + + web3-core-method@1.2.11: + dependencies: + '@ethersproject/transactions': 5.8.0 + underscore: 1.9.1 + web3-core-helpers: 1.2.11 + web3-core-promievent: 1.2.11 + web3-core-subscriptions: 1.2.11 + web3-utils: 1.2.11 + optional: true + + web3-core-method@1.7.4: + dependencies: + '@ethersproject/transactions': 5.8.0 + web3-core-helpers: 1.7.4 + web3-core-promievent: 1.7.4 + web3-core-subscriptions: 1.7.4 + web3-utils: 1.7.4 + + web3-core-promievent@1.10.0: + dependencies: + eventemitter3: 4.0.4 + + web3-core-promievent@1.2.11: + dependencies: + eventemitter3: 4.0.4 + optional: true + + web3-core-promievent@1.7.4: + dependencies: + eventemitter3: 4.0.4 + + web3-core-requestmanager@1.10.0(encoding@0.1.13): + dependencies: + util: 0.12.5 + web3-core-helpers: 1.10.0 + web3-providers-http: 1.10.0(encoding@0.1.13) + web3-providers-ipc: 1.10.0 + web3-providers-ws: 1.10.0 + transitivePeerDependencies: + - encoding + - supports-color + + web3-core-requestmanager@1.2.11: + dependencies: + underscore: 1.9.1 + web3-core-helpers: 1.2.11 + web3-providers-http: 1.2.11 + web3-providers-ipc: 1.2.11 + web3-providers-ws: 1.2.11 + transitivePeerDependencies: + - supports-color + optional: true + + web3-core-requestmanager@1.7.4: + dependencies: + util: 0.12.5 + web3-core-helpers: 1.7.4 + web3-providers-http: 1.7.4 + web3-providers-ipc: 1.7.4 + web3-providers-ws: 1.7.4 + transitivePeerDependencies: + - supports-color + + web3-core-subscriptions@1.10.0: + dependencies: + eventemitter3: 4.0.4 + web3-core-helpers: 1.10.0 + + web3-core-subscriptions@1.2.11: + dependencies: + eventemitter3: 4.0.4 + underscore: 1.9.1 + web3-core-helpers: 1.2.11 + optional: true + + web3-core-subscriptions@1.7.4: + dependencies: + eventemitter3: 4.0.4 + web3-core-helpers: 1.7.4 + + web3-core@1.10.0(encoding@0.1.13): + dependencies: + '@types/bn.js': 5.1.6 + '@types/node': 12.20.55 + bignumber.js: 9.1.2 + web3-core-helpers: 1.10.0 + web3-core-method: 1.10.0 + web3-core-requestmanager: 1.10.0(encoding@0.1.13) + web3-utils: 1.10.0 + transitivePeerDependencies: + - encoding + - supports-color + + web3-core@1.2.11: + dependencies: + '@types/bn.js': 4.11.6 + '@types/node': 12.20.55 + bignumber.js: 9.1.2 + web3-core-helpers: 1.2.11 + web3-core-method: 1.2.11 + web3-core-requestmanager: 1.2.11 + web3-utils: 1.2.11 + transitivePeerDependencies: + - supports-color + optional: true + + web3-core@1.7.4: + dependencies: + '@types/bn.js': 5.1.6 + '@types/node': 12.20.55 + bignumber.js: 9.1.2 + web3-core-helpers: 1.7.4 + web3-core-method: 1.7.4 + web3-core-requestmanager: 1.7.4 + web3-utils: 1.7.4 + transitivePeerDependencies: + - supports-color + + web3-errors@1.3.1: + dependencies: + web3-types: 1.10.0 + + web3-eth-abi@1.10.0: + dependencies: + '@ethersproject/abi': 5.8.0 + web3-utils: 1.10.0 + + web3-eth-abi@1.2.11: + dependencies: + '@ethersproject/abi': 5.0.0-beta.153 + underscore: 1.9.1 + web3-utils: 1.2.11 + optional: true + + web3-eth-abi@1.7.4: + dependencies: + '@ethersproject/abi': 5.8.0 + web3-utils: 1.7.4 + + web3-eth-abi@4.4.1(typescript@5.8.3)(zod@3.24.4): + dependencies: + abitype: 0.7.1(typescript@5.8.3)(zod@3.24.4) + web3-errors: 1.3.1 + web3-types: 1.10.0 + web3-utils: 4.3.3 + web3-validator: 2.0.6 + transitivePeerDependencies: + - typescript + - zod + + web3-eth-accounts@1.10.0(encoding@0.1.13): + dependencies: + '@ethereumjs/common': 2.5.0 + '@ethereumjs/tx': 3.3.2 + eth-lib: 0.2.8 + ethereumjs-util: 7.1.5 + scrypt-js: 3.0.1 + uuid: 9.0.1 + web3-core: 1.10.0(encoding@0.1.13) + web3-core-helpers: 1.10.0 + web3-core-method: 1.10.0 + web3-utils: 1.10.0 + transitivePeerDependencies: + - encoding + - supports-color + + web3-eth-accounts@1.2.11: + dependencies: + crypto-browserify: 3.12.0 + eth-lib: 0.2.8 + ethereumjs-common: 1.5.0 + ethereumjs-tx: 2.1.2 + scrypt-js: 3.0.1 + underscore: 1.9.1 + uuid: 3.3.2 + web3-core: 1.2.11 + web3-core-helpers: 1.2.11 + web3-core-method: 1.2.11 + web3-utils: 1.2.11 + transitivePeerDependencies: + - supports-color + optional: true + + web3-eth-accounts@1.7.4: + dependencies: + '@ethereumjs/common': 2.6.5 + '@ethereumjs/tx': 3.5.2 + crypto-browserify: 3.12.0 + eth-lib: 0.2.8 + ethereumjs-util: 7.1.5 + scrypt-js: 3.0.1 + uuid: 3.3.2 + web3-core: 1.7.4 + web3-core-helpers: 1.7.4 + web3-core-method: 1.7.4 + web3-utils: 1.7.4 + transitivePeerDependencies: + - supports-color + + web3-eth-contract@1.10.0(encoding@0.1.13): + dependencies: + '@types/bn.js': 5.1.6 + web3-core: 1.10.0(encoding@0.1.13) + web3-core-helpers: 1.10.0 + web3-core-method: 1.10.0 + web3-core-promievent: 1.10.0 + web3-core-subscriptions: 1.10.0 + web3-eth-abi: 1.10.0 + web3-utils: 1.10.0 + transitivePeerDependencies: + - encoding + - supports-color + + web3-eth-contract@1.2.11: + dependencies: + '@types/bn.js': 4.11.6 + underscore: 1.9.1 + web3-core: 1.2.11 + web3-core-helpers: 1.2.11 + web3-core-method: 1.2.11 + web3-core-promievent: 1.2.11 + web3-core-subscriptions: 1.2.11 + web3-eth-abi: 1.2.11 + web3-utils: 1.2.11 + transitivePeerDependencies: + - supports-color + optional: true + + web3-eth-contract@1.7.4: + dependencies: + '@types/bn.js': 5.1.6 + web3-core: 1.7.4 + web3-core-helpers: 1.7.4 + web3-core-method: 1.7.4 + web3-core-promievent: 1.7.4 + web3-core-subscriptions: 1.7.4 + web3-eth-abi: 1.7.4 + web3-utils: 1.7.4 + transitivePeerDependencies: + - supports-color + + web3-eth-ens@1.10.0(encoding@0.1.13): + dependencies: + content-hash: 2.5.2 + eth-ens-namehash: 2.0.8 + web3-core: 1.10.0(encoding@0.1.13) + web3-core-helpers: 1.10.0 + web3-core-promievent: 1.10.0 + web3-eth-abi: 1.10.0 + web3-eth-contract: 1.10.0(encoding@0.1.13) + web3-utils: 1.10.0 + transitivePeerDependencies: + - encoding + - supports-color + + web3-eth-ens@1.2.11: + dependencies: + content-hash: 2.5.2 + eth-ens-namehash: 2.0.8 + underscore: 1.9.1 + web3-core: 1.2.11 + web3-core-helpers: 1.2.11 + web3-core-promievent: 1.2.11 + web3-eth-abi: 1.2.11 + web3-eth-contract: 1.2.11 + web3-utils: 1.2.11 + transitivePeerDependencies: + - supports-color + optional: true + + web3-eth-ens@1.7.4: + dependencies: + content-hash: 2.5.2 + eth-ens-namehash: 2.0.8 + web3-core: 1.7.4 + web3-core-helpers: 1.7.4 + web3-core-promievent: 1.7.4 + web3-eth-abi: 1.7.4 + web3-eth-contract: 1.7.4 + web3-utils: 1.7.4 + transitivePeerDependencies: + - supports-color + + web3-eth-iban@1.10.0: + dependencies: + bn.js: 5.2.2 + web3-utils: 1.10.0 + + web3-eth-iban@1.2.11: + dependencies: + bn.js: 4.12.2 + web3-utils: 1.2.11 + optional: true + + web3-eth-iban@1.7.4: + dependencies: + bn.js: 5.2.2 + web3-utils: 1.7.4 + + web3-eth-personal@1.10.0(encoding@0.1.13): + dependencies: + '@types/node': 12.20.55 + web3-core: 1.10.0(encoding@0.1.13) + web3-core-helpers: 1.10.0 + web3-core-method: 1.10.0 + web3-net: 1.10.0(encoding@0.1.13) + web3-utils: 1.10.0 + transitivePeerDependencies: + - encoding + - supports-color + + web3-eth-personal@1.2.11: + dependencies: + '@types/node': 12.20.55 + web3-core: 1.2.11 + web3-core-helpers: 1.2.11 + web3-core-method: 1.2.11 + web3-net: 1.2.11 + web3-utils: 1.2.11 + transitivePeerDependencies: + - supports-color + optional: true + + web3-eth-personal@1.7.4: + dependencies: + '@types/node': 12.20.55 + web3-core: 1.7.4 + web3-core-helpers: 1.7.4 + web3-core-method: 1.7.4 + web3-net: 1.7.4 + web3-utils: 1.7.4 + transitivePeerDependencies: + - supports-color + + web3-eth@1.10.0(encoding@0.1.13): + dependencies: + web3-core: 1.10.0(encoding@0.1.13) + web3-core-helpers: 1.10.0 + web3-core-method: 1.10.0 + web3-core-subscriptions: 1.10.0 + web3-eth-abi: 1.10.0 + web3-eth-accounts: 1.10.0(encoding@0.1.13) + web3-eth-contract: 1.10.0(encoding@0.1.13) + web3-eth-ens: 1.10.0(encoding@0.1.13) + web3-eth-iban: 1.10.0 + web3-eth-personal: 1.10.0(encoding@0.1.13) + web3-net: 1.10.0(encoding@0.1.13) + web3-utils: 1.10.0 + transitivePeerDependencies: + - encoding + - supports-color + + web3-eth@1.2.11: + dependencies: + underscore: 1.9.1 + web3-core: 1.2.11 + web3-core-helpers: 1.2.11 + web3-core-method: 1.2.11 + web3-core-subscriptions: 1.2.11 + web3-eth-abi: 1.2.11 + web3-eth-accounts: 1.2.11 + web3-eth-contract: 1.2.11 + web3-eth-ens: 1.2.11 + web3-eth-iban: 1.2.11 + web3-eth-personal: 1.2.11 + web3-net: 1.2.11 + web3-utils: 1.2.11 + transitivePeerDependencies: + - supports-color + optional: true + + web3-eth@1.7.4: + dependencies: + web3-core: 1.7.4 + web3-core-helpers: 1.7.4 + web3-core-method: 1.7.4 + web3-core-subscriptions: 1.7.4 + web3-eth-abi: 1.7.4 + web3-eth-accounts: 1.7.4 + web3-eth-contract: 1.7.4 + web3-eth-ens: 1.7.4 + web3-eth-iban: 1.7.4 + web3-eth-personal: 1.7.4 + web3-net: 1.7.4 + web3-utils: 1.7.4 + transitivePeerDependencies: + - supports-color + + web3-net@1.10.0(encoding@0.1.13): + dependencies: + web3-core: 1.10.0(encoding@0.1.13) + web3-core-method: 1.10.0 + web3-utils: 1.10.0 + transitivePeerDependencies: + - encoding + - supports-color + + web3-net@1.2.11: + dependencies: + web3-core: 1.2.11 + web3-core-method: 1.2.11 + web3-utils: 1.2.11 + transitivePeerDependencies: + - supports-color + optional: true + + web3-net@1.7.4: + dependencies: + web3-core: 1.7.4 + web3-core-method: 1.7.4 + web3-utils: 1.7.4 + transitivePeerDependencies: + - supports-color + + web3-provider-engine@14.2.1(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10): + dependencies: + async: 2.6.2 + backoff: 2.5.0 + clone: 2.1.2 + cross-fetch: 2.2.6(encoding@0.1.13) + eth-block-tracker: 3.0.1 + eth-json-rpc-infura: 3.2.1(encoding@0.1.13) + eth-sig-util: 1.4.2 + ethereumjs-block: 1.7.1 + ethereumjs-tx: 1.3.7 + ethereumjs-util: 5.2.1 + ethereumjs-vm: 2.6.0 + json-rpc-error: 2.0.0 + json-stable-stringify: 1.3.0 + promise-to-callback: 1.0.0 + readable-stream: 2.3.8 + request: 2.88.2 + semaphore: 1.1.0 + ws: 5.2.4(bufferutil@4.0.9)(utf-8-validate@5.0.10) + xhr: 2.6.0 + xtend: 4.0.2 + transitivePeerDependencies: + - bufferutil + - encoding + - supports-color + - utf-8-validate + + web3-providers-http@1.10.0(encoding@0.1.13): + dependencies: + abortcontroller-polyfill: 1.7.8 + cross-fetch: 3.2.0(encoding@0.1.13) + es6-promise: 4.2.8 + web3-core-helpers: 1.10.0 + transitivePeerDependencies: + - encoding + + web3-providers-http@1.2.11: + dependencies: + web3-core-helpers: 1.2.11 + xhr2-cookies: 1.1.0 + optional: true + + web3-providers-http@1.7.4: + dependencies: + web3-core-helpers: 1.7.4 + xhr2-cookies: 1.1.0 + + web3-providers-ipc@1.10.0: + dependencies: + oboe: 2.1.5 + web3-core-helpers: 1.10.0 + + web3-providers-ipc@1.2.11: + dependencies: + oboe: 2.1.4 + underscore: 1.9.1 + web3-core-helpers: 1.2.11 + optional: true + + web3-providers-ipc@1.7.4: + dependencies: + oboe: 2.1.5 + web3-core-helpers: 1.7.4 + + web3-providers-ws@1.10.0: + dependencies: + eventemitter3: 4.0.4 + web3-core-helpers: 1.10.0 + websocket: 1.0.35 + transitivePeerDependencies: + - supports-color + + web3-providers-ws@1.2.11: + dependencies: + eventemitter3: 4.0.4 + underscore: 1.9.1 + web3-core-helpers: 1.2.11 + websocket: 1.0.32 + transitivePeerDependencies: + - supports-color + optional: true + + web3-providers-ws@1.7.4: + dependencies: + eventemitter3: 4.0.4 + web3-core-helpers: 1.7.4 + websocket: 1.0.35 + transitivePeerDependencies: + - supports-color + + web3-shh@1.10.0(encoding@0.1.13): + dependencies: + web3-core: 1.10.0(encoding@0.1.13) + web3-core-method: 1.10.0 + web3-core-subscriptions: 1.10.0 + web3-net: 1.10.0(encoding@0.1.13) + transitivePeerDependencies: + - encoding + - supports-color + + web3-shh@1.2.11: + dependencies: + web3-core: 1.2.11 + web3-core-method: 1.2.11 + web3-core-subscriptions: 1.2.11 + web3-net: 1.2.11 + transitivePeerDependencies: + - supports-color + optional: true + + web3-shh@1.7.4: + dependencies: + web3-core: 1.7.4 + web3-core-method: 1.7.4 + web3-core-subscriptions: 1.7.4 + web3-net: 1.7.4 + transitivePeerDependencies: + - supports-color + + web3-types@1.10.0: {} + + web3-utils@1.10.0: + dependencies: + bn.js: 5.2.2 + ethereum-bloom-filters: 1.2.0 + ethereumjs-util: 7.1.5 + ethjs-unit: 0.1.6 + number-to-bn: 1.7.0 + randombytes: 2.1.0 + utf8: 3.0.0 + + web3-utils@1.10.4: + dependencies: + '@ethereumjs/util': 8.1.0 + bn.js: 5.2.2 + ethereum-bloom-filters: 1.2.0 + ethereum-cryptography: 2.2.1 + ethjs-unit: 0.1.6 + number-to-bn: 1.7.0 + randombytes: 2.1.0 + utf8: 3.0.0 + + web3-utils@1.2.11: + dependencies: + bn.js: 4.12.2 + eth-lib: 0.2.8 + ethereum-bloom-filters: 1.2.0 + ethjs-unit: 0.1.6 + number-to-bn: 1.7.0 + randombytes: 2.1.0 + underscore: 1.9.1 + utf8: 3.0.0 + optional: true + + web3-utils@1.7.4: + dependencies: + bn.js: 5.2.2 + ethereum-bloom-filters: 1.2.0 + ethereumjs-util: 7.1.5 + ethjs-unit: 0.1.6 + number-to-bn: 1.7.0 + randombytes: 2.1.0 + utf8: 3.0.0 + + web3-utils@4.3.3: + dependencies: + ethereum-cryptography: 2.2.1 + eventemitter3: 5.0.1 + web3-errors: 1.3.1 + web3-types: 1.10.0 + web3-validator: 2.0.6 + + web3-validator@2.0.6: + dependencies: + ethereum-cryptography: 2.2.1 + util: 0.12.5 + web3-errors: 1.3.1 + web3-types: 1.10.0 + zod: 3.24.4 + + web3@1.10.0(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10): + dependencies: + web3-bzz: 1.10.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + web3-core: 1.10.0(encoding@0.1.13) + web3-eth: 1.10.0(encoding@0.1.13) + web3-eth-personal: 1.10.0(encoding@0.1.13) + web3-net: 1.10.0(encoding@0.1.13) + web3-shh: 1.10.0(encoding@0.1.13) + web3-utils: 1.10.0 + transitivePeerDependencies: + - bufferutil + - encoding + - supports-color + - utf-8-validate + + web3@1.2.11(bufferutil@4.0.9)(utf-8-validate@5.0.10): + dependencies: + web3-bzz: 1.2.11(bufferutil@4.0.9)(utf-8-validate@5.0.10) + web3-core: 1.2.11 + web3-eth: 1.2.11 + web3-eth-personal: 1.2.11 + web3-net: 1.2.11 + web3-shh: 1.2.11 + web3-utils: 1.2.11 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + optional: true + + web3@1.7.4(bufferutil@4.0.9)(utf-8-validate@5.0.10): + dependencies: + web3-bzz: 1.7.4(bufferutil@4.0.9)(utf-8-validate@5.0.10) + web3-core: 1.7.4 + web3-eth: 1.7.4 + web3-eth-personal: 1.7.4 + web3-net: 1.7.4 + web3-shh: 1.7.4 + web3-utils: 1.7.4 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + + webcrypto-core@1.8.1: + dependencies: + '@peculiar/asn1-schema': 2.3.15 + '@peculiar/json-schema': 1.1.12 + asn1js: 3.0.6 + pvtsutils: 1.3.6 + tslib: 2.8.1 + + webidl-conversions@3.0.1: {} + + websocket@1.0.32: + dependencies: + bufferutil: 4.0.9 + debug: 2.6.9 + es5-ext: 0.10.64 + typedarray-to-buffer: 3.1.5 + utf-8-validate: 5.0.10 + yaeti: 0.0.6 + transitivePeerDependencies: + - supports-color + + websocket@1.0.35: + dependencies: + bufferutil: 4.0.9 + debug: 2.6.9 + es5-ext: 0.10.64 + typedarray-to-buffer: 3.1.5 + utf-8-validate: 5.0.10 + yaeti: 0.0.6 + transitivePeerDependencies: + - supports-color + + whatwg-fetch@2.0.4: {} + + whatwg-fetch@3.6.20: {} + + whatwg-url@5.0.0: + dependencies: + tr46: 0.0.3 + webidl-conversions: 3.0.1 + + which-boxed-primitive@1.1.1: + dependencies: + is-bigint: 1.1.0 + is-boolean-object: 1.2.2 + is-number-object: 1.1.1 + is-string: 1.1.1 + is-symbol: 1.1.1 + + which-builtin-type@1.2.1: + dependencies: + call-bound: 1.0.4 + function.prototype.name: 1.1.8 + has-tostringtag: 1.0.2 + is-async-function: 2.1.1 + is-date-object: 1.1.0 + is-finalizationregistry: 1.1.1 + is-generator-function: 1.1.0 + is-regex: 1.2.1 + is-weakref: 1.1.1 + isarray: 2.0.5 + which-boxed-primitive: 1.1.1 + which-collection: 1.0.2 + which-typed-array: 1.1.19 + + which-collection@1.0.2: + dependencies: + is-map: 2.0.3 + is-set: 2.0.3 + is-weakmap: 2.0.2 + is-weakset: 2.0.4 + + which-module@1.0.0: {} + + which-module@2.0.1: {} + + which-pm-runs@1.1.0: + optional: true + + which-typed-array@1.1.19: + dependencies: + available-typed-arrays: 1.0.7 + call-bind: 1.0.8 + call-bound: 1.0.4 + for-each: 0.3.5 + get-proto: 1.0.1 + gopd: 1.2.0 + has-tostringtag: 1.0.2 + + which@1.3.1: + dependencies: + isexe: 2.0.0 + + which@2.0.2: + dependencies: + isexe: 2.0.0 + + wide-align@1.1.5: + dependencies: + string-width: 4.2.3 + optional: true + + widest-line@3.1.0: + dependencies: + string-width: 4.2.3 + + window-size@0.2.0: {} + + winston-transport@4.9.0: + dependencies: + logform: 2.7.0 + readable-stream: 3.6.2 + triple-beam: 1.4.1 + + winston@3.17.0: + dependencies: + '@colors/colors': 1.6.0 + '@dabh/diagnostics': 2.0.3 + async: 3.2.6 + is-stream: 2.0.1 + logform: 2.7.0 + one-time: 1.0.0 + readable-stream: 3.6.2 + safe-stable-stringify: 2.5.0 + stack-trace: 0.0.10 + triple-beam: 1.4.1 + winston-transport: 4.9.0 + + wkx@0.5.0: + dependencies: + '@types/node': 20.17.32 + + wonka@4.0.15: {} + + wonka@6.3.5: {} + + word-wrap@1.2.5: {} + + wordwrap@1.0.0: {} + + wordwrapjs@4.0.1: + dependencies: + reduce-flatten: 2.0.0 + typical: 5.2.0 + + workerpool@6.5.1: {} + + wrap-ansi@2.1.0: + dependencies: + string-width: 1.0.2 + strip-ansi: 3.0.1 + + wrap-ansi@6.2.0: + dependencies: + ansi-styles: 4.3.0 + string-width: 4.2.3 + strip-ansi: 6.0.1 + + wrap-ansi@7.0.0: + dependencies: + ansi-styles: 4.3.0 + string-width: 4.2.3 + strip-ansi: 6.0.1 + + wrap-ansi@8.1.0: + dependencies: + ansi-styles: 6.2.1 + string-width: 5.1.2 + strip-ansi: 7.1.0 + + wrap-ansi@9.0.0: + dependencies: + ansi-styles: 6.2.1 + string-width: 7.2.0 + strip-ansi: 7.1.0 + + wrappy@1.0.2: {} + + write-file-atomic@4.0.2: + dependencies: + imurmurhash: 0.1.4 + signal-exit: 3.0.7 + + ws@3.3.3(bufferutil@4.0.9)(utf-8-validate@5.0.10): + dependencies: + async-limiter: 1.0.1 + safe-buffer: 5.1.2 + ultron: 1.1.1 + optionalDependencies: + bufferutil: 4.0.9 + utf-8-validate: 5.0.10 + + ws@5.2.4(bufferutil@4.0.9)(utf-8-validate@5.0.10): + dependencies: + async-limiter: 1.0.1 + optionalDependencies: + bufferutil: 4.0.9 + utf-8-validate: 5.0.10 + + ws@6.2.3(bufferutil@4.0.9)(utf-8-validate@5.0.10): + dependencies: + async-limiter: 1.0.1 + optionalDependencies: + bufferutil: 4.0.9 + utf-8-validate: 5.0.10 + + ws@7.4.6(bufferutil@4.0.9)(utf-8-validate@5.0.10): + optionalDependencies: + bufferutil: 4.0.9 + utf-8-validate: 5.0.10 + + ws@7.5.10(bufferutil@4.0.9)(utf-8-validate@5.0.10): + optionalDependencies: + bufferutil: 4.0.9 + utf-8-validate: 5.0.10 + + ws@8.13.0(bufferutil@4.0.9)(utf-8-validate@5.0.10): + optionalDependencies: + bufferutil: 4.0.9 + utf-8-validate: 5.0.10 + + ws@8.17.1(bufferutil@4.0.9)(utf-8-validate@5.0.10): + optionalDependencies: + bufferutil: 4.0.9 + utf-8-validate: 5.0.10 + + ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10): + optionalDependencies: + bufferutil: 4.0.9 + utf-8-validate: 5.0.10 + + ws@8.18.2(bufferutil@4.0.9)(utf-8-validate@5.0.10): + optionalDependencies: + bufferutil: 4.0.9 + utf-8-validate: 5.0.10 + + xhr-request-promise@0.1.3: + dependencies: + xhr-request: 1.1.0 + + xhr-request@1.1.0: + dependencies: + buffer-to-arraybuffer: 0.0.5 + object-assign: 4.1.1 + query-string: 5.1.1 + simple-get: 2.8.2 + timed-out: 4.0.1 + url-set-query: 1.0.0 + xhr: 2.6.0 + + xhr2-cookies@1.1.0: + dependencies: + cookiejar: 2.1.4 + + xhr@2.6.0: + dependencies: + global: 4.4.0 + is-function: 1.0.2 + parse-headers: 2.0.6 + xtend: 4.0.2 + + xmlhttprequest@1.8.0: {} + + xtend@2.1.2: + dependencies: + object-keys: 0.4.0 + + xtend@4.0.2: {} + + y18n@3.2.2: {} + + y18n@4.0.3: {} + + y18n@5.0.8: {} + + yaeti@0.0.6: {} + + yallist@2.1.2: {} + + yallist@3.1.1: {} + + yallist@4.0.0: {} + + yaml@1.10.2: {} + + yaml@2.7.1: {} + + yargs-parser@18.1.3: + dependencies: + camelcase: 5.3.1 + decamelize: 1.2.0 + + yargs-parser@2.4.1: + dependencies: + camelcase: 3.0.0 + lodash.assign: 4.2.0 + + yargs-parser@20.2.9: {} + + yargs-parser@21.1.1: {} + + yargs-parser@8.1.0: + dependencies: + camelcase: 4.1.0 + + yargs-unparser@2.0.0: + dependencies: + camelcase: 6.3.0 + decamelize: 4.0.0 + flat: 5.0.2 + is-plain-obj: 2.1.0 + + yargs@10.1.2: + dependencies: + cliui: 4.1.0 + decamelize: 1.2.0 + find-up: 2.1.0 + get-caller-file: 1.0.3 + os-locale: 2.1.0 + require-directory: 2.1.1 + require-main-filename: 1.0.1 + set-blocking: 2.0.0 + string-width: 2.1.1 + which-module: 2.0.1 + y18n: 3.2.2 + yargs-parser: 8.1.0 + + yargs@15.4.1: + dependencies: + cliui: 6.0.0 + decamelize: 1.2.0 + find-up: 4.1.0 + get-caller-file: 2.0.5 + require-directory: 2.1.1 + require-main-filename: 2.0.0 + set-blocking: 2.0.0 + string-width: 4.2.3 + which-module: 2.0.1 + y18n: 4.0.3 + yargs-parser: 18.1.3 + + yargs@16.2.0: + dependencies: + cliui: 7.0.4 + escalade: 3.2.0 + get-caller-file: 2.0.5 + require-directory: 2.1.1 + string-width: 4.2.3 + y18n: 5.0.8 + yargs-parser: 20.2.9 + + yargs@17.7.2: + dependencies: + cliui: 8.0.1 + escalade: 3.2.0 + get-caller-file: 2.0.5 + require-directory: 2.1.1 + string-width: 4.2.3 + y18n: 5.0.8 + yargs-parser: 21.1.1 + + yargs@4.8.1: + dependencies: + cliui: 3.2.0 + decamelize: 1.2.0 + get-caller-file: 1.0.3 + lodash.assign: 4.2.0 + os-locale: 1.4.0 + read-pkg-up: 1.0.1 + require-directory: 2.1.1 + require-main-filename: 1.0.1 + set-blocking: 2.0.0 + string-width: 1.0.2 + which-module: 1.0.0 + window-size: 0.2.0 + y18n: 3.2.2 + yargs-parser: 2.4.1 + + yn@3.1.1: {} + + yocto-queue@0.1.0: {} + + zod-to-json-schema@3.24.5(zod@3.24.4): + dependencies: + zod: 3.24.4 + + zod@3.24.4: {} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml new file mode 100644 index 000000000..4340350e1 --- /dev/null +++ b/pnpm-workspace.yaml @@ -0,0 +1,2 @@ +packages: + - 'packages/*' \ No newline at end of file diff --git a/scripts/analyze b/scripts/analyze deleted file mode 100755 index 2daaa8ac2..000000000 --- a/scripts/analyze +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash - -## Before running: -# This tool requires to have solc installed. -# Ensure that you have the binaries installed by pip3 in your path. -# Install: https://github.com/crytic/slither#how-to-install -# Usage: https://github.com/crytic/slither/wiki/Usage - -mkdir -p reports - -pip3 install --user slither-analyzer && \ -yarn build && \ - -echo "Analyzing contracts..." -slither . \ - --filter-paths "bancor/*" \ - &> reports/analyzer-report.log && \ -slither-check-erc build/flatten/GraphToken.sol GraphToken &> reports/analyzer-report-erc.log - -echo "Done!" diff --git a/scripts/build b/scripts/build index df72b9f62..c16aa450e 100755 --- a/scripts/build +++ b/scripts/build @@ -1,6 +1,46 @@ #!/bin/bash -set -eo pipefail +BUILD_HORIZON_ONLY=${BUILD_HORIZON_ONLY:-false} -# Build -yarn compile +# List packages to build - order matters! +horizon_packages=( + "packages/contracts" + "packages/horizon" + "packages/subgraph-service" +) + +all_packages=( + "packages/eslint-graph-config" + # "packages/solhint-graph-config" -- disabled since it doesn't have a build script + # "packages/solhint-plugin-graph" -- disabled since it doesn't have a build script + "packages/contracts" + "packages/horizon" + "packages/subgraph-service" + "packages/toolshed" + "packages/hardhat-graph-protocol" + "packages/data-edge" + "packages/token-distribution" +) + +if [ "$BUILD_HORIZON_ONLY" = "true" ]; then + packages=("${horizon_packages[@]}") +else + packages=("${all_packages[@]}") +fi + +for package in "${packages[@]}"; do + echo -e "\n\n==== Building $package..." + + cd "$package" || { echo "Failed to navigate to $package"; exit 1; } + + if BUILD_RUN=true pnpm build; then + echo "Successfully built $package" + else + echo "Build failed for $package" >&2 + exit 1 + fi + + cd - > /dev/null +done + +echo "All packages built successfully!" diff --git a/scripts/coverage b/scripts/coverage deleted file mode 100755 index ddf388331..000000000 --- a/scripts/coverage +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -set -eo pipefail - -yarn compile -npx hardhat coverage $@ diff --git a/scripts/flatten b/scripts/flatten deleted file mode 100755 index 409e67edd..000000000 --- a/scripts/flatten +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash - -OUT_DIR="build/flatten" - -mkdir -p ${OUT_DIR} - -echo "Flattening contracts..." - -FILES=( - "contracts/governance/Controller.sol" - "contracts/governance/GraphGovernance.sol" - "contracts/discovery/GNS.sol" - "contracts/discovery/ServiceRegistry.sol" - "contracts/curation/Curation.sol" - "contracts/curation/GraphCurationToken.sol" - "contracts/staking/Staking.sol" - "contracts/rewards/RewardsManager.sol" - "contracts/token/GraphToken.sol" - "contracts/epochs/EpochManager.sol" - "contracts/upgrades/GraphProxy.sol" - "contracts/tests/testnet/GDAI.sol" - "contracts/tests/testnet/GSRManager.sol" -) - -for path in ${FILES[@]}; do - IFS='/' - parts=( $path ) - name=${parts[${#parts[@]}-1]} - echo "Flatten > ${name}" - hardhat flatten "${path}" > "${OUT_DIR}/${name}" -done - -echo "Done!" diff --git a/scripts/predeploy b/scripts/predeploy deleted file mode 100755 index e959e4ee6..000000000 --- a/scripts/predeploy +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -cat addresses.json | - jq '."1"."IENS".address = "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"' | - jq '."4"."IENS".address = "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"' | - jq '."1"."IEthereumDIDRegistry".address = "0xdCa7EF03e98e0DC2B855bE647C39ABe984fcF21B"' | - jq '."4"."IEthereumDIDRegistry".address = "0xdCa7EF03e98e0DC2B855bE647C39ABe984fcF21B"' > addresses.json.tmp -mv addresses.json.tmp addresses.json diff --git a/scripts/prepublish b/scripts/prepublish deleted file mode 100755 index a24463117..000000000 --- a/scripts/prepublish +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash - -TYPECHAIN_DIR=dist/types - -set -eo pipefail - -# Build contracts -yarn clean -yarn build - -# Refresh distribution folder -rm -rf dist && mkdir -p dist/types/_src -cp -R build/abis/ dist/abis -cp -R build/types/ dist/types/_src - -### Build Typechain bindings - -# Build and create TS declarations -tsc -d ${TYPECHAIN_DIR}/_src/*.ts --outdir ${TYPECHAIN_DIR} -# Copy back sources -cp ${TYPECHAIN_DIR}/_src/*.ts ${TYPECHAIN_DIR} -# Delete temporary src dir -rm -rf ${TYPECHAIN_DIR}/_src diff --git a/scripts/test b/scripts/test deleted file mode 100755 index ff65bef1c..000000000 --- a/scripts/test +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/bash - -set -eo pipefail - -MNEMONIC="myth like bonus scare over problem client lizard pioneer submit female collect" -TESTRPC_PORT=8545 - -### Functions - -evm_running() { - nc -z localhost "$TESTRPC_PORT" -} - -evm_start() { - echo "Starting our own evm instance at port $TESTRPC_PORT" - npx ganache-cli -m "$MNEMONIC" -i 1337 --gasLimit 8000000 --port "$TESTRPC_PORT" > /dev/null & - evm_pid=$! -} - -evm_kill() { - if evm_running; then - echo "Killing evm instance at port $TESTRPC_PORT" - kill -9 $(lsof -i:$TESTRPC_PORT -t) - fi -} - -### Setup EVM - -# Ensure we compiled sources - -yarn build - -# Gas reporter needs to run in its own evm instance -if [ "$RUN_EVM" = true ]; then - evm_kill - evm_start - sleep 5 -fi - -### Main - -mkdir -p reports - -if [ "$RUN_EVM" = true ]; then - # Run using the standalone evm instance - npx hardhat test --network ganache - result=$? -else - # Run using the default evm - npx hardhat test "$@" - result=$? -fi - -### Cleanup - -# Exit error mode so the evm instance always gets killed -set +e -result=0 - -if [ "$RUN_EVM" = true ]; then - evm_kill -fi - -exit $result diff --git a/tasks/contracts/functions.ts b/tasks/contracts/functions.ts deleted file mode 100644 index 0cfbbd525..000000000 --- a/tasks/contracts/functions.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { Wallet } from 'ethers' -import { task } from 'hardhat/config' -import { HardhatRuntimeEnvironment } from 'hardhat/types' -import '@nomiclabs/hardhat-ethers' - -import { loadEnv } from '../../cli/env' - -task('contracts:functions', 'Print function hashes for contracts').setAction( - async (taskArgs, hre: HardhatRuntimeEnvironment) => { - const accounts = await hre.ethers.getSigners() - const env = await loadEnv(taskArgs, accounts[0] as unknown as Wallet) - - console.log('## Staking ##') - for (const fn of Object.entries(env.contracts.Staking.functions)) { - const [fnSig] = fn - if (fnSig.indexOf('(') != -1) { - console.log(fnSig, '->', hre.ethers.utils.id(fnSig).slice(0, 10)) - } - } - }, -) diff --git a/tasks/deployment/deploy.ts b/tasks/deployment/deploy.ts deleted file mode 100644 index 87dd1ffcb..000000000 --- a/tasks/deployment/deploy.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { Wallet } from 'ethers' -import { task } from 'hardhat/config' -import '@nomiclabs/hardhat-ethers' - -import { loadEnv } from '../../cli/env' -import { cliOpts } from '../../cli/defaults' -import { migrate } from '../../cli/commands/migrate' - -task('migrate', 'Migrate contracts') - .addParam('addressBook', cliOpts.addressBook.description, cliOpts.addressBook.default) - .addParam('graphConfig', cliOpts.graphConfig.description, cliOpts.graphConfig.default) - .addFlag('force', cliOpts.force.description) - .setAction(async (taskArgs, hre) => { - const accounts = await hre.ethers.getSigners() - await migrate(await loadEnv(taskArgs, accounts[0] as unknown as Wallet), taskArgs) - }) diff --git a/tasks/gre.ts b/tasks/gre.ts deleted file mode 100644 index 4080c5485..000000000 --- a/tasks/gre.ts +++ /dev/null @@ -1,44 +0,0 @@ -import { Contract, providers, Signer } from 'ethers' -import { HardhatRuntimeEnvironment } from 'hardhat/types' -import { extendEnvironment } from 'hardhat/config' -import { lazyObject } from 'hardhat/plugins' -import '@nomiclabs/hardhat-ethers' - -import { cliOpts } from '../cli/defaults' -import { getAddressBook } from '../cli/address-book' -import { loadContracts, NetworkContracts } from '../cli/contracts' - -// Graph Runtime Environment (GRE) extensions for the HRE - -declare module 'hardhat/types/runtime' { - export interface HardhatRuntimeEnvironment { - contracts: NetworkContracts - } -} - -interface ConsoleNetworkContracts extends NetworkContracts { - connect: () => void -} - -extendEnvironment((hre: HardhatRuntimeEnvironment) => { - hre['contracts'] = lazyObject(() => { - const chainId = hre.network.config.chainId.toString() - const provider = hre.ethers.provider - const addressBook = getAddressBook(cliOpts.addressBook.default, chainId) - const contracts = loadContracts(addressBook, provider) as ConsoleNetworkContracts - - // Connect contracts to a signing account - contracts.connect = async function (n = 0) { - const accounts = await hre.ethers.getSigners() - const senderAccount = accounts[n] - console.log(`> Sender set to ${senderAccount.address}`) - for (const [k, contract] of Object.entries(contracts)) { - if (contract instanceof Contract) { - contracts[k] = contract.connect(senderAccount) - } - } - } - - return contracts - }) -}) diff --git a/tasks/misc/accounts.ts b/tasks/misc/accounts.ts deleted file mode 100644 index 5bb6512df..000000000 --- a/tasks/misc/accounts.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { task } from 'hardhat/config' -import { HardhatRuntimeEnvironment } from 'hardhat/types' -import '@nomiclabs/hardhat-ethers' - -task('accounts', 'Prints the list of accounts', async (_, hre: HardhatRuntimeEnvironment) => { - const accounts = await hre.ethers.getSigners() - for (const account of accounts) { - console.log(await account.getAddress()) - } -}) diff --git a/tasks/query/allocations.ts b/tasks/query/allocations.ts deleted file mode 100644 index 16c849d70..000000000 --- a/tasks/query/allocations.ts +++ /dev/null @@ -1,73 +0,0 @@ -import axios from 'axios' -import Table from 'cli-table' -import PQueue from 'p-queue' -import { utils, BigNumber } from 'ethers' -import { task } from 'hardhat/config' -import { HardhatRuntimeEnvironment } from 'hardhat/types' -import '@nomiclabs/hardhat-ethers' - -import '../gre' - -const { formatEther } = utils - -task('query:allos', 'List allocations').setAction(async (_, hre: HardhatRuntimeEnvironment) => { - const { contracts } = hre - - // Get allocations from the subgraph - const query = `{ - allocations(where: { status: "Active" }, first: 1000) { - id - allocatedTokens - subgraphDeployment { id } - createdAt - createdAtEpoch - indexer { id stakedTokens } - } - } - ` - const url = 'https://api.thegraph.com/subgraphs/name/graphprotocol/graph-network-mainnet' - const res = await axios.post(url, { query }) - const allos = res.data.data.allocations - - const table = new Table({ - head: ['ID', 'Indexer', 'SID', 'Allocated', 'IdxRewards', 'IdxCut', 'Cooldown', 'Epoch'], - colWidths: [20, 20, 10, 20, 20, 10, 10, 10], - }) - - const currentBlock = await hre.ethers.provider.send('eth_blockNumber', []) - - let totalIndexingRewards = BigNumber.from(0) - let totalAllocated = BigNumber.from(0) - - // Get allocations - const queue = new PQueue({ concurrency: 4 }) - for (const allo of allos) { - queue.add(async () => { - console.log('coso') - const [pool, r] = await Promise.all([ - contracts.Staking.delegationPools(allo.indexer.id), - contracts.RewardsManager.getRewards(allo.id), - ]) - table.push([ - allo.id, - allo.indexer.id, - allo.subgraphDeployment.id, - formatEther(allo.allocatedTokens), - formatEther(r), - pool.indexingRewardCut / 10000, - pool.updatedAtBlock.add(pool.cooldownBlocks).toNumber() - currentBlock, - allo.createdAtEpoch, - ]) - - totalIndexingRewards = totalIndexingRewards.add(r) - totalAllocated = totalAllocated.add(allo.allocatedTokens) - }) - } - await queue.onIdle() - - // Display - console.log(table.toString()) - console.log('total entries: ', allos.length) - console.log('total pending idx-rewards: ', hre.ethers.utils.formatEther(totalIndexingRewards)) - console.log('total allocated: ', hre.ethers.utils.formatEther(totalAllocated)) -}) diff --git a/tasks/query/indexers.ts b/tasks/query/indexers.ts deleted file mode 100644 index c717e1483..000000000 --- a/tasks/query/indexers.ts +++ /dev/null @@ -1,62 +0,0 @@ -import axios from 'axios' -import Table from 'cli-table' -import { utils } from 'ethers' -import { task } from 'hardhat/config' -import { HardhatRuntimeEnvironment } from 'hardhat/types' - -import '../gre' - -const { formatEther } = utils - -task('query:indexers', 'List indexers').setAction(async (_, hre: HardhatRuntimeEnvironment) => { - // Get indexers from subgraph - const query = `{ - indexers(where: {stakedTokens_gt: "0"}, first: 1000) { - id - stakedTokens - delegatedTokens - allocatedTokens - allocationCount - } - }` - const url = 'https://api.thegraph.com/subgraphs/name/graphprotocol/graph-network-mainnet' - const res = await axios.post(url, { query }) - const indexers = res.data.data.indexers - - const table = new Table({ - head: ['ID', 'Stake', 'Delegated', 'Capacity Ratio', 'Allocated', 'Used', 'N'], - colWidths: [20, 20, 20, 20, 20, 10, 5], - }) - - // Calculate indexer data - let totalStaked = hre.ethers.BigNumber.from(0) - let totalDelegated = hre.ethers.BigNumber.from(0) - let totalAllocated = hre.ethers.BigNumber.from(0) - for (const indexer of indexers) { - const t = indexer.stakedTokens / 1e18 + indexer.delegatedTokens / 1e18 - const b = indexer.allocatedTokens / 1e18 / t - const maxCapacity = indexer.stakedTokens / 1e18 + (indexer.stakedTokens / 1e18) * 16 - const capacityRatio = - (indexer.stakedTokens / 1e18 + indexer.delegatedTokens / 1e18) / maxCapacity - - table.push([ - indexer.id, - formatEther(indexer.stakedTokens), - formatEther(indexer.delegatedTokens), - capacityRatio.toFixed(2), - formatEther(indexer.allocatedTokens), - b.toFixed(2), - indexer.allocationCount, - ]) - totalStaked = totalStaked.add(indexer.stakedTokens) - totalDelegated = totalDelegated.add(indexer.delegatedTokens) - totalAllocated = totalAllocated.add(indexer.allocatedTokens) - } - - // Display - console.log(table.toString()) - console.log('# indexers: ', indexers.length) - console.log('total staked: ', formatEther(totalStaked)) - console.log('total delegated: ', formatEther(totalDelegated)) - console.log('total allocated: ', formatEther(totalAllocated)) -}) diff --git a/tasks/query/rebates.ts b/tasks/query/rebates.ts deleted file mode 100644 index ba678448f..000000000 --- a/tasks/query/rebates.ts +++ /dev/null @@ -1,37 +0,0 @@ -import Table from 'cli-table' -import PQueue from 'p-queue' -import { task } from 'hardhat/config' -import { HardhatRuntimeEnvironment } from 'hardhat/types' -import '@nomiclabs/hardhat-ethers' - -import '../gre' - -task('query:rebates', 'List rebate pools').setAction(async (_, hre: HardhatRuntimeEnvironment) => { - const { contracts } = hre - const { formatEther } = hre.ethers.utils - - const table = new Table({ - head: ['Epoch', 'Total Fees', 'Claimed Amount', 'Unclaimed Allocs'], - colWidths: [10, 40, 40, 20], - }) - - // Get epoch data - const currentEpoch = await contracts.EpochManager.currentEpoch() - - // Get rebates - const queue = new PQueue({ concurrency: 4 }) - for (let i = 0; i < 5; i++) { - const epoch = currentEpoch.sub(i) - const rebatePool = await contracts.Staking.rebates(epoch) - table.push([ - epoch, - formatEther(rebatePool.fees), - formatEther(rebatePool.claimedRewards), - rebatePool.unclaimedAllocationsCount, - ]) - } - await queue.onIdle() - - // Display - console.log(table.toString()) -}) diff --git a/test/curation/configuration.test.ts b/test/curation/configuration.test.ts deleted file mode 100644 index bbebd23a7..000000000 --- a/test/curation/configuration.test.ts +++ /dev/null @@ -1,102 +0,0 @@ -import { expect } from 'chai' - -import { Curation } from '../../build/types/Curation' - -import { defaults } from '../lib/deployment' -import { NetworkFixture } from '../lib/fixtures' -import { getAccounts, toBN, Account } from '../lib/testHelpers' - -const MAX_PPM = 1000000 - -describe('Curation:Config', () => { - let me: Account - let governor: Account - - let fixture: NetworkFixture - - let curation: Curation - - before(async function () { - ;[me, governor] = await getAccounts() - - fixture = new NetworkFixture() - ;({ curation } = await fixture.load(governor.signer)) - }) - - beforeEach(async function () { - await fixture.setUp() - }) - - afterEach(async function () { - await fixture.tearDown() - }) - - describe('defaultReserveRatio', function () { - it('should set `defaultReserveRatio`', async function () { - // Set right in the constructor - expect(await curation.defaultReserveRatio()).eq(defaults.curation.reserveRatio) - - // Can set if allowed - const newValue = toBN('100') - await curation.connect(governor.signer).setDefaultReserveRatio(newValue) - expect(await curation.defaultReserveRatio()).eq(newValue) - }) - - it('reject set `defaultReserveRatio` if out of bounds', async function () { - const tx1 = curation.connect(governor.signer).setDefaultReserveRatio(0) - await expect(tx1).revertedWith('Default reserve ratio must be > 0') - - const tx2 = curation.connect(governor.signer).setDefaultReserveRatio(MAX_PPM + 1) - await expect(tx2).revertedWith('Default reserve ratio cannot be higher than MAX_PPM') - }) - - it('reject set `defaultReserveRatio` if not allowed', async function () { - const tx = curation.connect(me.signer).setDefaultReserveRatio(defaults.curation.reserveRatio) - await expect(tx).revertedWith('Caller must be Controller governor') - }) - }) - - describe('minimumCurationDeposit', function () { - it('should set `minimumCurationDeposit`', async function () { - // Set right in the constructor - expect(await curation.minimumCurationDeposit()).eq(defaults.curation.minimumCurationDeposit) - - // Can set if allowed - const newValue = toBN('100') - await curation.connect(governor.signer).setMinimumCurationDeposit(newValue) - expect(await curation.minimumCurationDeposit()).eq(newValue) - }) - - it('reject set `minimumCurationDeposit` if out of bounds', async function () { - const tx = curation.connect(governor.signer).setMinimumCurationDeposit(0) - await expect(tx).revertedWith('Minimum curation deposit cannot be 0') - }) - - it('reject set `minimumCurationDeposit` if not allowed', async function () { - const tx = curation - .connect(me.signer) - .setMinimumCurationDeposit(defaults.curation.minimumCurationDeposit) - await expect(tx).revertedWith('Caller must be Controller governor') - }) - }) - - describe('curationTaxPercentage', function () { - it('should set `curationTaxPercentage`', async function () { - const curationTaxPercentage = defaults.curation.curationTaxPercentage - - // Set new value - await curation.connect(governor.signer).setCurationTaxPercentage(0) - await curation.connect(governor.signer).setCurationTaxPercentage(curationTaxPercentage) - }) - - it('reject set `curationTaxPercentage` if out of bounds', async function () { - const tx = curation.connect(governor.signer).setCurationTaxPercentage(MAX_PPM + 1) - await expect(tx).revertedWith('Curation tax percentage must be below or equal to MAX_PPM') - }) - - it('reject set `curationTaxPercentage` if not allowed', async function () { - const tx = curation.connect(me.signer).setCurationTaxPercentage(0) - await expect(tx).revertedWith('Caller must be Controller governor') - }) - }) -}) diff --git a/test/curation/curation.test.ts b/test/curation/curation.test.ts deleted file mode 100644 index 080e4e40c..000000000 --- a/test/curation/curation.test.ts +++ /dev/null @@ -1,522 +0,0 @@ -import { expect } from 'chai' -import { utils, BigNumber, Event } from 'ethers' - -import { Curation } from '../../build/types/Curation' -import { GraphToken } from '../../build/types/GraphToken' -import { Controller } from '../../build/types/Controller' - -import { NetworkFixture } from '../lib/fixtures' -import { getAccounts, randomHexBytes, toBN, toGRT, formatGRT, Account } from '../lib/testHelpers' - -const MAX_PPM = 1000000 - -const chunkify = (total: BigNumber, maxChunks = 10): Array => { - const chunks = [] - while (total.gt(0) && maxChunks > 0) { - const m = 1000000 - const p = Math.floor(Math.random() * m) - const n = total.mul(p).div(m) - chunks.push(n) - total = total.sub(n) - maxChunks-- - } - if (total.gt(0)) { - chunks.push(total) - } - return chunks -} - -const toFloat = (n: BigNumber) => parseFloat(formatGRT(n)) -const toRound = (n: number) => n.toFixed(12) - -describe('Curation', () => { - let me: Account - let governor: Account - let curator: Account - let stakingMock: Account - - let fixture: NetworkFixture - - let curation: Curation - let grt: GraphToken - let controller: Controller - - // Test values - const signalAmountFor1000Tokens = toGRT('3.162277660168379331') - const subgraphDeploymentID = randomHexBytes() - const curatorTokens = toGRT('1000000000') - const tokensToDeposit = toGRT('1000') - const tokensToCollect = toGRT('2000') - - async function calcBondingCurve( - supply: BigNumber, - reserveBalance: BigNumber, - reserveRatio: number, - depositAmount: BigNumber, - ) { - // Handle the initialization of the bonding curve - if (supply.eq(0)) { - const minDeposit = await curation.minimumCurationDeposit() - if (depositAmount.lt(minDeposit)) { - throw new Error('deposit must be above minimum') - } - const defaultReserveRatio = await curation.defaultReserveRatio() - const minSupply = toGRT('1') - return ( - (await calcBondingCurve( - minSupply, - minDeposit, - defaultReserveRatio, - depositAmount.sub(minDeposit), - )) + toFloat(minSupply) - ) - } - // Calculate bonding curve in the test - return ( - toFloat(supply) * - ((1 + toFloat(depositAmount) / toFloat(reserveBalance)) ** (reserveRatio / 1000000) - 1) - ) - } - - const shouldMint = async (tokensToDeposit: BigNumber, expectedSignal: BigNumber) => { - // Before state - const beforeTokenTotalSupply = await grt.totalSupply() - const beforeCuratorTokens = await grt.balanceOf(curator.address) - const beforeCuratorSignal = await curation.getCuratorSignal( - curator.address, - subgraphDeploymentID, - ) - const beforePool = await curation.pools(subgraphDeploymentID) - const beforePoolSignal = await curation.getCurationPoolSignal(subgraphDeploymentID) - const beforeTotalTokens = await grt.balanceOf(curation.address) - - // Calculations - const curationTaxPercentage = await curation.curationTaxPercentage() - const curationTax = tokensToDeposit.mul(toBN(curationTaxPercentage)).div(toBN(MAX_PPM)) - - // Curate - const tx = curation.connect(curator.signer).mint(subgraphDeploymentID, tokensToDeposit, 0) - await expect(tx) - .emit(curation, 'Signalled') - .withArgs(curator.address, subgraphDeploymentID, tokensToDeposit, expectedSignal, curationTax) - - // After state - const afterTokenTotalSupply = await grt.totalSupply() - const afterCuratorTokens = await grt.balanceOf(curator.address) - const afterCuratorSignal = await curation.getCuratorSignal( - curator.address, - subgraphDeploymentID, - ) - const afterPool = await curation.pools(subgraphDeploymentID) - const afterPoolSignal = await curation.getCurationPoolSignal(subgraphDeploymentID) - const afterTotalTokens = await grt.balanceOf(curation.address) - - // Curator balance updated - expect(afterCuratorTokens).eq(beforeCuratorTokens.sub(tokensToDeposit)) - expect(afterCuratorSignal).eq(beforeCuratorSignal.add(expectedSignal)) - // Allocated and balance updated - expect(afterPool.tokens).eq(beforePool.tokens.add(tokensToDeposit.sub(curationTax))) - expect(afterPoolSignal).eq(beforePoolSignal.add(expectedSignal)) - expect(afterPool.reserveRatio).eq(await curation.defaultReserveRatio()) - // Contract balance updated - expect(afterTotalTokens).eq(beforeTotalTokens.add(tokensToDeposit.sub(curationTax))) - // Total supply is reduced to curation tax burning - expect(afterTokenTotalSupply).eq(beforeTokenTotalSupply.sub(curationTax)) - } - - const shouldBurn = async (signalToRedeem: BigNumber, expectedTokens: BigNumber) => { - // Before balances - const beforeTokenTotalSupply = await grt.totalSupply() - const beforeCuratorTokens = await grt.balanceOf(curator.address) - const beforeCuratorSignal = await curation.getCuratorSignal( - curator.address, - subgraphDeploymentID, - ) - const beforePool = await curation.pools(subgraphDeploymentID) - const beforePoolSignal = await curation.getCurationPoolSignal(subgraphDeploymentID) - const beforeTotalTokens = await grt.balanceOf(curation.address) - - // Redeem - const tx = curation.connect(curator.signer).burn(subgraphDeploymentID, signalToRedeem, 0) - await expect(tx) - .emit(curation, 'Burned') - .withArgs(curator.address, subgraphDeploymentID, expectedTokens, signalToRedeem) - - // After balances - const afterTokenTotalSupply = await grt.totalSupply() - const afterCuratorTokens = await grt.balanceOf(curator.address) - const afterCuratorSignal = await curation.getCuratorSignal( - curator.address, - subgraphDeploymentID, - ) - const afterPool = await curation.pools(subgraphDeploymentID) - const afterPoolSignal = await curation.getCurationPoolSignal(subgraphDeploymentID) - const afterTotalTokens = await grt.balanceOf(curation.address) - - // Curator balance updated - expect(afterCuratorTokens).eq(beforeCuratorTokens.add(expectedTokens)) - expect(afterCuratorSignal).eq(beforeCuratorSignal.sub(signalToRedeem)) - // Curation balance updated - expect(afterPool.tokens).eq(beforePool.tokens.sub(expectedTokens)) - expect(afterPoolSignal).eq(beforePoolSignal.sub(signalToRedeem)) - // Contract balance updated - expect(afterTotalTokens).eq(beforeTotalTokens.sub(expectedTokens)) - // Total supply is conserved - expect(afterTokenTotalSupply).eq(beforeTokenTotalSupply) - } - - const shouldCollect = async (tokensToCollect: BigNumber) => { - // Before state - const beforePool = await curation.pools(subgraphDeploymentID) - const beforeTotalBalance = await grt.balanceOf(curation.address) - - // Source of tokens must be the staking for this to work - await grt.connect(stakingMock.signer).transfer(curation.address, tokensToCollect) - const tx = curation.connect(stakingMock.signer).collect(subgraphDeploymentID, tokensToCollect) - await expect(tx).emit(curation, 'Collected').withArgs(subgraphDeploymentID, tokensToCollect) - - // After state - const afterPool = await curation.pools(subgraphDeploymentID) - const afterTotalBalance = await grt.balanceOf(curation.address) - - // State updated - expect(afterPool.tokens).eq(beforePool.tokens.add(tokensToCollect)) - expect(afterTotalBalance).eq(beforeTotalBalance.add(tokensToCollect)) - } - - before(async function () { - // Use stakingMock so we can call collect - ;[me, governor, curator, stakingMock] = await getAccounts() - - fixture = new NetworkFixture() - ;({ controller, curation, grt } = await fixture.load(governor.signer)) - - // Give some funds to the curator and approve the curation contract - await grt.connect(governor.signer).mint(curator.address, curatorTokens) - await grt.connect(curator.signer).approve(curation.address, curatorTokens) - - // Give some funds to the staking contract and approve the curation contract - await grt.connect(governor.signer).mint(stakingMock.address, tokensToCollect) - await grt.connect(stakingMock.signer).approve(curation.address, tokensToCollect) - }) - - beforeEach(async function () { - await fixture.setUp() - }) - - afterEach(async function () { - await fixture.tearDown() - }) - - describe('bonding curve', function () { - const tokensToDeposit = curatorTokens - - it('reject convert signal to tokens if subgraph deployment not initted', async function () { - const tx = curation.signalToTokens(subgraphDeploymentID, toGRT('100')) - await expect(tx).revertedWith('Subgraph deployment must be curated to perform calculations') - }) - - it('convert signal to tokens', async function () { - // Curate - await curation.connect(curator.signer).mint(subgraphDeploymentID, tokensToDeposit, 0) - - // Conversion - const signal = await curation.getCurationPoolSignal(subgraphDeploymentID) - const expectedTokens = await curation.signalToTokens(subgraphDeploymentID, signal) - expect(expectedTokens).eq(tokensToDeposit) - }) - - it('convert signal to tokens (with curation tax)', async function () { - // Set curation tax - const curationTaxPercentage = 50000 // 5% - await curation.connect(governor.signer).setCurationTaxPercentage(curationTaxPercentage) - - // Curate - const expectedCurationTax = tokensToDeposit.mul(curationTaxPercentage).div(MAX_PPM) - const { 1: curationTax } = await curation.tokensToSignal( - subgraphDeploymentID, - tokensToDeposit, - ) - await curation.connect(curator.signer).mint(subgraphDeploymentID, tokensToDeposit, 0) - - // Conversion - const signal = await curation.getCurationPoolSignal(subgraphDeploymentID) - const tokens = await curation.signalToTokens(subgraphDeploymentID, signal) - expect(tokens).eq(tokensToDeposit.sub(expectedCurationTax)) - expect(expectedCurationTax).eq(curationTax) - }) - - it('convert tokens to signal', async function () { - // Conversion - const tokens = toGRT('1000') - const { 0: signal } = await curation.tokensToSignal(subgraphDeploymentID, tokens) - expect(signal).eq(signalAmountFor1000Tokens) - }) - - it('convert tokens to signal if non-curated subgraph', async function () { - // Conversion - const nonCuratedSubgraphDeploymentID = randomHexBytes() - const tokens = toGRT('1') - const tx = curation.tokensToSignal(nonCuratedSubgraphDeploymentID, tokens) - await expect(tx).revertedWith('Curation deposit is below minimum required') - }) - }) - - describe('curate', async function () { - it('reject deposit below minimum tokens required', async function () { - const tokensToDeposit = (await curation.minimumCurationDeposit()).sub(toBN(1)) - const tx = curation.connect(curator.signer).mint(subgraphDeploymentID, tokensToDeposit, 0) - await expect(tx).revertedWith('Curation deposit is below minimum required') - }) - - it('should deposit on a subgraph deployment', async function () { - const tokensToDeposit = await curation.minimumCurationDeposit() - const expectedSignal = toGRT('1') - await shouldMint(tokensToDeposit, expectedSignal) - }) - - it('should get signal according to bonding curve', async function () { - const tokensToDeposit = toGRT('1000') - const expectedSignal = signalAmountFor1000Tokens - await shouldMint(tokensToDeposit, expectedSignal) - }) - - it('should get signal according to bonding curve (and account for curation tax)', async function () { - // Set curation tax - await curation.connect(governor.signer).setCurationTaxPercentage(50000) // 5% - - // Mint - const tokensToDeposit = toGRT('1000') - const { 0: expectedSignal } = await curation.tokensToSignal( - subgraphDeploymentID, - tokensToDeposit, - ) - await shouldMint(tokensToDeposit, expectedSignal) - }) - - it('should revert curate if over slippage', async function () { - const tokensToDeposit = toGRT('1000') - const expectedSignal = signalAmountFor1000Tokens - const tx = curation - .connect(curator.signer) - .mint(subgraphDeploymentID, tokensToDeposit, expectedSignal.add(1)) - await expect(tx).revertedWith('Slippage protection') - }) - }) - - describe('collect', async function () { - context('> not curated', async function () { - it('reject collect tokens distributed to the curation pool', async function () { - // Source of tokens must be the staking for this to work - await controller - .connect(governor.signer) - .setContractProxy(utils.id('Staking'), stakingMock.address) - await curation.syncAllContracts() - - const tx = curation - .connect(stakingMock.signer) - .collect(subgraphDeploymentID, tokensToCollect) - await expect(tx).revertedWith('Subgraph deployment must be curated to collect fees') - }) - }) - - context('> curated', async function () { - beforeEach(async function () { - await curation.connect(curator.signer).mint(subgraphDeploymentID, toGRT('1000'), 0) - }) - - it('reject collect tokens distributed from invalid address', async function () { - const tx = curation.connect(me.signer).collect(subgraphDeploymentID, tokensToCollect) - await expect(tx).revertedWith('Caller must be the staking contract') - }) - - it('should collect tokens distributed to the curation pool', async function () { - await controller - .connect(governor.signer) - .setContractProxy(utils.id('Staking'), stakingMock.address) - await curation.syncAllContracts() - - await shouldCollect(toGRT('1')) - await shouldCollect(toGRT('10')) - await shouldCollect(toGRT('100')) - await shouldCollect(toGRT('200')) - await shouldCollect(toGRT('500.25')) - }) - - it('should collect tokens and then unsignal all', async function () { - await controller - .connect(governor.signer) - .setContractProxy(utils.id('Staking'), stakingMock.address) - await curation.syncAllContracts() - - // Collect increase the pool reserves - await shouldCollect(toGRT('100')) - - // When we burn signal we should get more tokens than initially curated - const signalToRedeem = await curation.getCuratorSignal( - curator.address, - subgraphDeploymentID, - ) - await shouldBurn(signalToRedeem, toGRT('1100')) - }) - }) - }) - - describe('burn', async function () { - beforeEach(async function () { - await curation.connect(curator.signer).mint(subgraphDeploymentID, tokensToDeposit, 0) - }) - - it('reject redeem more than a curator owns', async function () { - const tx = curation.connect(me.signer).burn(subgraphDeploymentID, toGRT('1'), 0) - await expect(tx).revertedWith('Cannot burn more signal than you own') - }) - - it('reject redeem zero signal', async function () { - const tx = curation.connect(me.signer).burn(subgraphDeploymentID, toGRT('0'), 0) - await expect(tx).revertedWith('Cannot burn zero signal') - }) - - it('should allow to redeem *partially*', async function () { - // Redeem just one signal - const signalToRedeem = toGRT('1') - const expectedTokens = toGRT('532.455532033675866536') - await shouldBurn(signalToRedeem, expectedTokens) - }) - - it('should allow to redeem *fully*', async function () { - // Get all signal of the curator - const signalToRedeem = await curation.getCuratorSignal(curator.address, subgraphDeploymentID) - const expectedTokens = tokensToDeposit - await shouldBurn(signalToRedeem, expectedTokens) - }) - - it('should allow to redeem back below minimum deposit', async function () { - // Redeem "almost" all signal - const signal = await curation.getCuratorSignal(curator.address, subgraphDeploymentID) - const signalToRedeem = signal.sub(toGRT('0.000001')) - const expectedTokens = await curation.signalToTokens(subgraphDeploymentID, signalToRedeem) - await shouldBurn(signalToRedeem, expectedTokens) - - // The pool should have less tokens that required by minimumCurationDeposit - const afterPool = await curation.pools(subgraphDeploymentID) - expect(afterPool.tokens).lt(await curation.minimumCurationDeposit()) - - // Should be able to deposit more after being under minimumCurationDeposit - const tokensToDeposit = toGRT('1') - const { 0: expectedSignal } = await curation.tokensToSignal( - subgraphDeploymentID, - tokensToDeposit, - ) - await shouldMint(tokensToDeposit, expectedSignal) - }) - - it('should revert redeem if over slippage', async function () { - const signalToRedeem = await curation.getCuratorSignal(curator.address, subgraphDeploymentID) - const expectedTokens = tokensToDeposit - - const tx = curation - .connect(curator.signer) - .burn(subgraphDeploymentID, signalToRedeem, expectedTokens.add(1)) - await expect(tx).revertedWith('Slippage protection') - }) - }) - - describe('conservation', async function () { - it('should match multiple deposits and redeems back to initial state', async function () { - const totalDeposits = toGRT('1000000000') - - // Signal multiple times - let totalSignal = toGRT('0') - for (const tokensToDeposit of chunkify(totalDeposits, 10)) { - const tx = await curation - .connect(curator.signer) - .mint(subgraphDeploymentID, tokensToDeposit, 0) - const receipt = await tx.wait() - const event: Event = receipt.events.pop() - const signal = event.args['signal'] - totalSignal = totalSignal.add(signal) - } - - // Redeem signal multiple times - let totalTokens = toGRT('0') - for (const signalToRedeem of chunkify(totalSignal, 10)) { - const tx = await curation - .connect(curator.signer) - .burn(subgraphDeploymentID, signalToRedeem, 0) - const receipt = await tx.wait() - const event: Event = receipt.events.pop() - const tokens = event.args['tokens'] - totalTokens = totalTokens.add(tokens) - // console.log('<', formatEther(signalToRedeem), '=', formatEther(tokens)) - } - - // Conservation of work - const afterPool = await curation.pools(subgraphDeploymentID) - const afterPoolSignal = await curation.getCurationPoolSignal(subgraphDeploymentID) - expect(afterPool.tokens).eq(toGRT('0')) - expect(afterPoolSignal).eq(toGRT('0')) - expect(await curation.isCurated(subgraphDeploymentID)).eq(false) - expect(totalDeposits).eq(totalTokens) - }) - }) - - describe('multiple minting', async function () { - it('should mint less signal every time due to the bonding curve', async function () { - const tokensToDepositMany = [ - toGRT('1000'), // should mint if we start with number above minimum deposit - toGRT('1000'), // every time it should mint less GCS due to bonding curve... - toGRT('1000'), - toGRT('1000'), - toGRT('2000'), - toGRT('2000'), - toGRT('123'), - toGRT('1'), // should mint below minimum deposit - ] - for (const tokensToDeposit of tokensToDepositMany) { - const expectedSignal = await calcBondingCurve( - await curation.getCurationPoolSignal(subgraphDeploymentID), - await curation.getCurationPoolTokens(subgraphDeploymentID), - await curation.defaultReserveRatio(), - tokensToDeposit, - ) - - const tx = await curation - .connect(curator.signer) - .mint(subgraphDeploymentID, tokensToDeposit, 0) - const receipt = await tx.wait() - const event: Event = receipt.events.pop() - const signal = event.args['signal'] - expect(toRound(expectedSignal)).eq(toRound(toFloat(signal))) - } - }) - - it('should mint when using the edge case of linear function', async function () { - // Setup edge case like linear function: 1 GRT = 1 GCS - await curation.setMinimumCurationDeposit(toGRT('1')) - await curation.setDefaultReserveRatio(1000000) - - const tokensToDepositMany = [ - toGRT('1000'), // should mint if we start with number above minimum deposit - toGRT('1000'), // every time it should mint less GCS due to bonding curve... - toGRT('1000'), - toGRT('1000'), - toGRT('2000'), - toGRT('2000'), - toGRT('123'), - toGRT('1'), // should mint below minimum deposit - ] - - // Mint multiple times - for (const tokensToDeposit of tokensToDepositMany) { - const tx = await curation - .connect(curator.signer) - .mint(subgraphDeploymentID, tokensToDeposit, 0) - const receipt = await tx.wait() - const event: Event = receipt.events.pop() - const signal = event.args['signal'] - expect(tokensToDeposit).eq(signal) // we compare 1:1 ratio - } - }) - }) -}) diff --git a/test/disputes/configuration.test.ts b/test/disputes/configuration.test.ts deleted file mode 100644 index 28bc92ed5..000000000 --- a/test/disputes/configuration.test.ts +++ /dev/null @@ -1,134 +0,0 @@ -import { constants } from 'ethers' -import { expect } from 'chai' - -import { DisputeManager } from '../../build/types/DisputeManager' - -import { defaults } from '../lib/deployment' -import { NetworkFixture } from '../lib/fixtures' -import { getAccounts, toBN, Account } from '../lib/testHelpers' - -const { AddressZero } = constants - -const MAX_PPM = 1000000 - -describe('DisputeManager:Config', () => { - let me: Account - let governor: Account - let slasher: Account - let arbitrator: Account - - let fixture: NetworkFixture - - let disputeManager: DisputeManager - - before(async function () { - ;[me, governor, slasher, arbitrator] = await getAccounts() - - fixture = new NetworkFixture() - ;({ disputeManager } = await fixture.load(governor.signer, slasher.signer, arbitrator.signer)) - }) - - beforeEach(async function () { - await fixture.setUp() - }) - - afterEach(async function () { - await fixture.tearDown() - }) - - describe('configuration', () => { - describe('arbitrator', function () { - it('should set `arbitrator`', async function () { - // Set right in the constructor - expect(await disputeManager.arbitrator()).eq(arbitrator.address) - - // Can set if allowed - await disputeManager.connect(governor.signer).setArbitrator(me.address) - expect(await disputeManager.arbitrator()).eq(me.address) - }) - - it('reject set `arbitrator` if not allowed', async function () { - const tx = disputeManager.connect(me.signer).setArbitrator(arbitrator.address) - await expect(tx).revertedWith('Caller must be Controller governor') - }) - - it('reject set `arbitrator` to address zero', async function () { - const tx = disputeManager.connect(governor.signer).setArbitrator(AddressZero) - await expect(tx).revertedWith('Arbitrator must be set') - }) - }) - - describe('minimumDeposit', function () { - it('should set `minimumDeposit`', async function () { - const oldValue = defaults.dispute.minimumDeposit - const newValue = toBN('1') - - // Set right in the constructor - expect(await disputeManager.minimumDeposit()).eq(oldValue) - - // Set new value - await disputeManager.connect(governor.signer).setMinimumDeposit(newValue) - expect(await disputeManager.minimumDeposit()).eq(newValue) - }) - - it('reject set `minimumDeposit` if not allowed', async function () { - const newValue = toBN('1') - const tx = disputeManager.connect(me.signer).setMinimumDeposit(newValue) - await expect(tx).revertedWith('Caller must be Controller governor') - }) - }) - - describe('fishermanRewardPercentage', function () { - it('should set `fishermanRewardPercentage`', async function () { - const newValue = defaults.dispute.fishermanRewardPercentage - - // Set right in the constructor - expect(await disputeManager.fishermanRewardPercentage()).eq(newValue) - - // Set new value - await disputeManager.connect(governor.signer).setFishermanRewardPercentage(0) - await disputeManager.connect(governor.signer).setFishermanRewardPercentage(newValue) - }) - - it('reject set `fishermanRewardPercentage` if out of bounds', async function () { - const tx = disputeManager.connect(governor.signer).setFishermanRewardPercentage(MAX_PPM + 1) - await expect(tx).revertedWith('Reward percentage must be below or equal to MAX_PPM') - }) - - it('reject set `fishermanRewardPercentage` if not allowed', async function () { - const tx = disputeManager.connect(me.signer).setFishermanRewardPercentage(50) - await expect(tx).revertedWith('Caller must be Controller governor') - }) - }) - - describe('slashingPercentage', function () { - it('should set `slashingPercentage`', async function () { - const qryNewValue = defaults.dispute.qrySlashingPercentage - const idxNewValue = defaults.dispute.idxSlashingPercentage - - // Set right in the constructor - expect(await disputeManager.qrySlashingPercentage()).eq(qryNewValue) - expect(await disputeManager.idxSlashingPercentage()).eq(idxNewValue) - - // Set new value - await disputeManager.connect(governor.signer).setSlashingPercentage(0, 0) - await disputeManager - .connect(governor.signer) - .setSlashingPercentage(qryNewValue, idxNewValue) - }) - - it('reject set `slashingPercentage` if out of bounds', async function () { - const tx1 = disputeManager.connect(governor.signer).setSlashingPercentage(0, MAX_PPM + 1) - await expect(tx1).revertedWith('Slashing percentage must be below or equal to MAX_PPM') - - const tx2 = disputeManager.connect(governor.signer).setSlashingPercentage(MAX_PPM + 1, 0) - await expect(tx2).revertedWith('Slashing percentage must be below or equal to MAX_PPM') - }) - - it('reject set `slashingPercentage` if not allowed', async function () { - const tx = disputeManager.connect(me.signer).setSlashingPercentage(50, 50) - await expect(tx).revertedWith('Caller must be Controller governor') - }) - }) - }) -}) diff --git a/test/disputes/poi.test.ts b/test/disputes/poi.test.ts deleted file mode 100644 index 9d583f48a..000000000 --- a/test/disputes/poi.test.ts +++ /dev/null @@ -1,253 +0,0 @@ -import { expect } from 'chai' -import { utils } from 'ethers' - -import { DisputeManager } from '../../build/types/DisputeManager' -import { EpochManager } from '../../build/types/EpochManager' -import { GraphToken } from '../../build/types/GraphToken' -import { Staking } from '../../build/types/Staking' - -import { NetworkFixture } from '../lib/fixtures' -import { - advanceBlock, - advanceToNextEpoch, - deriveChannelKey, - getAccounts, - randomHexBytes, - toBN, - toGRT, - Account, -} from '../lib/testHelpers' - -import { MAX_PPM } from './common' - -const { keccak256 } = utils - -describe('DisputeManager:POI', async () => { - let other: Account - let governor: Account - let arbitrator: Account - let indexer: Account - let fisherman: Account - let assetHolder: Account - - let fixture: NetworkFixture - - let disputeManager: DisputeManager - let epochManager: EpochManager - let grt: GraphToken - let staking: Staking - - // Derive some channel keys for each indexer used to sign attestations - const indexerChannelKey = deriveChannelKey() - - // Test values - const fishermanTokens = toGRT('100000') - const fishermanDeposit = toGRT('1000') - const indexerTokens = toGRT('100000') - const indexerAllocatedTokens = toGRT('10000') - const allocationID = indexerChannelKey.address - const subgraphDeploymentID = randomHexBytes(32) - const metadata = randomHexBytes(32) - const poi = randomHexBytes(32) // proof of indexing - - async function calculateSlashConditions(indexerAddress: string) { - const idxSlashingPercentage = await disputeManager.idxSlashingPercentage() - const fishermanRewardPercentage = await disputeManager.fishermanRewardPercentage() - const stakeAmount = await staking.getIndexerStakedTokens(indexerAddress) - const slashAmount = stakeAmount.mul(idxSlashingPercentage).div(toBN(MAX_PPM)) - const rewardsAmount = slashAmount.mul(fishermanRewardPercentage).div(toBN(MAX_PPM)) - - return { slashAmount, rewardsAmount } - } - - async function setupIndexers() { - // Dispute manager is allowed to slash - await staking.connect(governor.signer).setSlasher(disputeManager.address, true) - - // Stake & allocate - const indexerList = [ - { account: indexer, allocationID: indexerChannelKey.address, channelKey: indexerChannelKey }, - ] - for (const activeIndexer of indexerList) { - const { channelKey, allocationID, account: indexerAccount } = activeIndexer - - // Give some funds to the indexer - await grt.connect(governor.signer).mint(indexerAccount.address, indexerTokens) - await grt.connect(indexerAccount.signer).approve(staking.address, indexerTokens) - - // Indexer stake funds - await staking.connect(indexerAccount.signer).stake(indexerTokens) - await staking - .connect(indexerAccount.signer) - .allocate( - subgraphDeploymentID, - indexerAllocatedTokens, - allocationID, - metadata, - await channelKey.generateProof(indexerAccount.address), - ) - } - } - - before(async function () { - ;[other, governor, arbitrator, indexer, fisherman, assetHolder] = await getAccounts() - - fixture = new NetworkFixture() - ;({ disputeManager, epochManager, grt, staking } = await fixture.load( - governor.signer, - other.signer, - arbitrator.signer, - )) - - // Give some funds to the fisherman - await grt.connect(governor.signer).mint(fisherman.address, fishermanTokens) - await grt.connect(fisherman.signer).approve(disputeManager.address, fishermanTokens) - - // Allow the asset holder - await staking.connect(governor.signer).setAssetHolder(assetHolder.address, true) - }) - - beforeEach(async function () { - await fixture.setUp() - }) - - afterEach(async function () { - await fixture.tearDown() - }) - - describe('disputes', function () { - it('reject create a dispute if allocation does not exist', async function () { - const invalidAllocationID = randomHexBytes(20) - - // Create dispute - const tx = disputeManager - .connect(fisherman.signer) - .createIndexingDispute(invalidAllocationID, fishermanDeposit) - await expect(tx).revertedWith('Dispute allocation must exist') - }) - - it('reject create a dispute if indexer below stake', async function () { - // This tests reproduce the case when someones present a dispute for - // an indexer that is under the minimum required staked amount - - const indexerCollectedTokens = toGRT('10') - - // Give some funds to the indexer - await grt.connect(governor.signer).mint(indexer.address, indexerTokens) - await grt.connect(indexer.signer).approve(staking.address, indexerTokens) - - // Give some funds to the channel - await grt.connect(governor.signer).mint(assetHolder.address, indexerCollectedTokens) - await grt.connect(assetHolder.signer).approve(staking.address, indexerCollectedTokens) - - // Set the thawing period to one to make the test easier - await staking.connect(governor.signer).setThawingPeriod(toBN('1')) - - // Indexer stake funds, allocate, close, unstake and withdraw the stake fully - await staking.connect(indexer.signer).stake(indexerTokens) - const tx1 = await staking - .connect(indexer.signer) - .allocate( - subgraphDeploymentID, - indexerAllocatedTokens, - allocationID, - metadata, - await indexerChannelKey.generateProof(indexer.address), - ) - const receipt1 = await tx1.wait() - const event1 = staking.interface.parseLog(receipt1.logs[0]).args - await advanceToNextEpoch(epochManager) // wait the required one epoch to close allocation - await staking.connect(assetHolder.signer).collect(indexerCollectedTokens, event1.allocationID) - await staking.connect(indexer.signer).closeAllocation(event1.allocationID, poi) - await staking.connect(indexer.signer).unstake(indexerTokens) - await advanceBlock() // pass thawing period - await staking.connect(indexer.signer).withdraw() - - // Create dispute - const tx = disputeManager - .connect(fisherman.signer) - .createIndexingDispute(event1.allocationID, fishermanDeposit) - await expect(tx).revertedWith('Dispute indexer has no stake') - }) - - context('> when indexer is staked', function () { - beforeEach(async function () { - await setupIndexers() - }) - - it('should create a dispute', async function () { - // Create dispute - const tx = disputeManager - .connect(fisherman.signer) - .createIndexingDispute(allocationID, fishermanDeposit) - await expect(tx) - .emit(disputeManager, 'IndexingDisputeCreated') - .withArgs( - keccak256(allocationID), - indexer.address, - fisherman.address, - fishermanDeposit, - allocationID, - ) - }) - - context('> when dispute is created', function () { - // NOTE: other dispute resolution paths are tested in query.test.ts - - beforeEach(async function () { - // Create dispute - await disputeManager - .connect(fisherman.signer) - .createIndexingDispute(allocationID, fishermanDeposit) - }) - - it('reject create duplicated dispute', async function () { - const tx = disputeManager - .connect(fisherman.signer) - .createIndexingDispute(allocationID, fishermanDeposit) - await expect(tx).revertedWith('Dispute already created') - }) - - describe('accept a dispute', function () { - it('should resolve dispute, slash indexer and reward the fisherman', async function () { - const disputeID = keccak256(allocationID) - - // Before state - const beforeIndexerStake = await staking.getIndexerStakedTokens(indexer.address) - const beforeFishermanBalance = await grt.balanceOf(fisherman.address) - const beforeTotalSupply = await grt.totalSupply() - - // Calculations - const { slashAmount, rewardsAmount } = await calculateSlashConditions(indexer.address) - - // Perform transaction (accept) - const tx = disputeManager.connect(arbitrator.signer).acceptDispute(disputeID) - await expect(tx) - .emit(disputeManager, 'DisputeAccepted') - .withArgs( - disputeID, - indexer.address, - fisherman.address, - fishermanDeposit.add(rewardsAmount), - ) - - // After state - const afterFishermanBalance = await grt.balanceOf(fisherman.address) - const afterIndexerStake = await staking.getIndexerStakedTokens(indexer.address) - const afterTotalSupply = await grt.totalSupply() - - // Fisherman reward properly assigned + deposit returned - expect(afterFishermanBalance).eq( - beforeFishermanBalance.add(fishermanDeposit).add(rewardsAmount), - ) - // Indexer slashed - expect(afterIndexerStake).eq(beforeIndexerStake.sub(slashAmount)) - // Slashed funds burned - const tokensToBurn = slashAmount.sub(rewardsAmount) - expect(afterTotalSupply).eq(beforeTotalSupply.sub(tokensToBurn)) - }) - }) - }) - }) - }) -}) diff --git a/test/epochs.test.ts b/test/epochs.test.ts deleted file mode 100644 index 7ac178c33..000000000 --- a/test/epochs.test.ts +++ /dev/null @@ -1,152 +0,0 @@ -import { expect } from 'chai' -import { BigNumber } from 'ethers' - -import { EpochManager } from '../build/types/EpochManager' - -import * as deployment from './lib/deployment' -import { defaults } from './lib/deployment' -import { - advanceBlock, - advanceBlockTo, - latestBlock, - getAccounts, - toBN, - Account, -} from './lib/testHelpers' - -describe('EpochManager', () => { - let me: Account - let governor: Account - - let epochManager: EpochManager - - const epochLength: BigNumber = toBN('3') - - before(async function () { - ;[me, governor] = await getAccounts() - }) - - beforeEach(async function () { - const controller = await deployment.deployController(governor.signer) - const proxyAdmin = await deployment.deployProxyAdmin(governor.signer) - epochManager = await deployment.deployEpochManager( - governor.signer, - controller.address, - proxyAdmin, - ) - }) - - describe('configuration', () => { - it('should set `epochLength', async function () { - // Set right in the constructor - expect(await epochManager.epochLength()).eq(defaults.epochs.lengthInBlocks) - - // Update and check new value - const newEpochLength = toBN('4') - const currentEpoch = await epochManager.currentEpoch() - const tx = epochManager.connect(governor.signer).setEpochLength(newEpochLength) - await expect(tx) - .emit(epochManager, 'EpochLengthUpdate') - .withArgs(currentEpoch, newEpochLength) - expect(await epochManager.epochLength()).eq(newEpochLength) - }) - - it('reject set `epochLength` if zero', async function () { - // Update and check new value - const newEpochLength = toBN('0') - const tx = epochManager.connect(governor.signer).setEpochLength(newEpochLength) - await expect(tx).revertedWith('Epoch length cannot be 0') - }) - }) - - describe('epoch lifecycle', function () { - // Use epochs every three blocks - // Blocks -> (1,2,3)(4,5,6)(7,8,9) - // Epochs -> 1 2 3 - beforeEach(async function () { - await epochManager.connect(governor.signer).setEpochLength(epochLength) - }) - - describe('calculations', () => { - it('should return correct block number', async function () { - const currentBlock = await latestBlock() - expect(await epochManager.blockNum()).eq(currentBlock) - }) - - it('should return same starting block if we stay on the same epoch', async function () { - // Move right to the start of a new epoch - const blocksSinceEpochStart = await epochManager.currentEpochBlockSinceStart() - const blocksToNextEpoch = epochLength.sub(blocksSinceEpochStart) - await advanceBlockTo((await epochManager.blockNum()).add(blocksToNextEpoch)) - - const beforeCurrentEpochBlock = await epochManager.currentEpochBlock() - - // Advance block - will not jump to next epoch - await advanceBlock() - - const afterCurrentEpochBlock = await epochManager.currentEpochBlock() - expect(afterCurrentEpochBlock).equal(beforeCurrentEpochBlock) - }) - - it('should return next starting block if we move to the next epoch', async function () { - const beforeCurrentEpochBlock = await epochManager.currentEpochBlock() - - // Advance blocks to move to the next epoch - await advanceBlockTo(beforeCurrentEpochBlock.add(epochLength)) - - const afterCurrentEpochBlock = await epochManager.currentEpochBlock() - expect(afterCurrentEpochBlock).not.eq(beforeCurrentEpochBlock) - }) - - it('should return next epoch if advance > epochLength', async function () { - const nextEpoch = (await epochManager.currentEpoch()).add(toBN('1')) - - // Advance blocks and move to the next epoch - const currentEpochBlock = await epochManager.currentEpochBlock() - await advanceBlockTo(currentEpochBlock.add(epochLength)) - - const afterCurrentEpoch = await epochManager.currentEpoch() - expect(afterCurrentEpoch).eq(nextEpoch) - }) - }) - - describe('progression', () => { - beforeEach(async function () { - const currentEpochBlock = await epochManager.currentEpochBlock() - await advanceBlockTo(currentEpochBlock.add(epochLength)) - }) - - context('> epoch not run', function () { - it('should return that current epoch is not run', async function () { - expect(await epochManager.isCurrentEpochRun()).eq(false) - }) - - it('should run new epoch', async function () { - // Run epoch - const currentEpoch = await epochManager.currentEpoch() - const tx = epochManager.connect(me.signer).runEpoch() - await expect(tx).emit(epochManager, 'EpochRun').withArgs(currentEpoch, me.address) - - // State - const lastRunEpoch = await epochManager.lastRunEpoch() - expect(lastRunEpoch).eq(currentEpoch) - }) - }) - - context('> epoch run', function () { - beforeEach(async function () { - await epochManager.runEpoch() - }) - - it('should return current epoch is already run', async function () { - expect(await epochManager.isCurrentEpochRun()).eq(true) - }) - - it('reject run new epoch', async function () { - const tx = epochManager.runEpoch() - await expect(tx).revertedWith('Current epoch already run') - }) - }) - }) - }) -}) diff --git a/test/gns.test.ts b/test/gns.test.ts deleted file mode 100644 index 12986b21d..000000000 --- a/test/gns.test.ts +++ /dev/null @@ -1,986 +0,0 @@ -import { expect } from 'chai' -import { ethers, ContractTransaction, BigNumber, Event } from 'ethers' - -import { GNS } from '../build/types/GNS' -import { getAccounts, randomHexBytes, Account, toGRT } from './lib/testHelpers' -import { NetworkFixture } from './lib/fixtures' -import { GraphToken } from '../build/types/GraphToken' -import { Curation } from '../build/types/Curation' - -import { toBN, formatGRT } from './lib/testHelpers' - -interface Subgraph { - graphAccount: Account - subgraphDeploymentID: string - subgraphNumber: BigNumber - versionMetadata: string - subgraphMetadata: string -} - -interface AccountDefaultName { - name: string - nameIdentifier: string -} - -const toFloat = (n: BigNumber) => parseFloat(formatGRT(n)) -const toRound = (n: number) => n.toFixed(12) - -describe('GNS', () => { - let me: Account - let other: Account - let governor: Account - - let fixture: NetworkFixture - - let gns: GNS - let grt: GraphToken - let curation: Curation - - const tokens1000 = toGRT('1000') - const tokens10000 = toGRT('10000') - const tokens100000 = toGRT('100000') - const curationTaxPercentage = 50000 - let subgraph0: Subgraph - let subgraph1: Subgraph - let defaultName: AccountDefaultName - - const createSubgraph = (account: Account, subgraphNumber: string): Subgraph => { - return { - graphAccount: account, - subgraphDeploymentID: randomHexBytes(), - subgraphNumber: BigNumber.from(subgraphNumber), - - versionMetadata: randomHexBytes(), - subgraphMetadata: randomHexBytes(), - } - } - - const createDefaultName = (name: string): AccountDefaultName => { - return { - name: name, - nameIdentifier: ethers.utils.namehash(name), - } - } - - const getTokensAndVSignal = async (subgraphID: string): Promise> => { - const curationPool = await curation.pools(subgraphID) - const vSignal = await curation.getCurationPoolSignal(subgraphID) - return [curationPool.tokens, vSignal] - } - - async function calcGNSBondingCurve( - gnsSupply: BigNumber, // nSignal - gnsReserveBalance: BigNumber, // vSignal - gnsReserveRatio: number, // default reserve ratio of GNS - depositAmount: BigNumber, // GRT deposited - subgraphID: string, - ): Promise { - const signal = await curation.getCurationPoolSignal(subgraphID) - const curationTokens = await curation.getCurationPoolTokens(subgraphID) - const curationReserveRatio = await curation.defaultReserveRatio() - const expectedSignal = await calcCurationBondingCurve( - signal, - curationTokens, - curationReserveRatio, - depositAmount, - ) - const expectedSignalBN = toGRT(String(expectedSignal.toFixed(18))) - - // Handle the initialization of the bonding curve - if (gnsSupply.eq(0)) { - return expectedSignal - } - // Since we known CW = 1, we can do the simplified formula of: - return (toFloat(gnsSupply) * toFloat(expectedSignalBN)) / toFloat(gnsReserveBalance) - } - - async function calcCurationBondingCurve( - supply: BigNumber, - reserveBalance: BigNumber, - reserveRatio: number, - depositAmount: BigNumber, - ): Promise { - // Handle the initialization of the bonding curve - const minSupply = toGRT('1') - if (supply.eq(0)) { - const minDeposit = await curation.minimumCurationDeposit() - if (depositAmount.lt(minDeposit)) { - throw new Error('deposit must be above minimum') - } - return ( - (await calcCurationBondingCurve( - minSupply, - minDeposit, - reserveRatio, - depositAmount.sub(minDeposit), - )) + toFloat(minSupply) - ) - } - // Calculate bonding curve in the test - return ( - toFloat(supply) * - ((1 + toFloat(depositAmount) / toFloat(reserveBalance)) ** (reserveRatio / 1000000) - 1) - ) - } - - const publishNewSubgraph = async ( - account: Account, - graphAccount: string, - subgraphNumber: number, - subgraphToPublish = subgraph0, // Defaults to subgraph created in before() - ): Promise => { - const tx = gns - .connect(account.signer) - .publishNewSubgraph( - graphAccount, - subgraphToPublish.subgraphDeploymentID, - subgraphToPublish.versionMetadata, - subgraphToPublish.subgraphMetadata, - ) - await expect(tx) - .emit(gns, 'SubgraphPublished') - .withArgs( - subgraphToPublish.graphAccount.address, - subgraphNumber, - subgraphToPublish.subgraphDeploymentID, - subgraphToPublish.versionMetadata, - ) - .emit(gns, 'NameSignalEnabled') - .withArgs(graphAccount, subgraphNumber, subgraphToPublish.subgraphDeploymentID, 1000000) - .emit(gns, 'SubgraphMetadataUpdated') - .withArgs( - subgraphToPublish.graphAccount.address, - subgraphNumber, - subgraphToPublish.subgraphMetadata, - ) - - const pool = await gns.nameSignals(graphAccount, subgraphNumber) - const reserveRatio = pool[3] - expect(reserveRatio).eq(1000000) - return tx - } - - const publishNewVersion = async ( - account: Account, - graphAccount: string, - subgraphNumber: number, - subgraphToPublish = subgraph0, // Defaults to subgraph created in before() - ) => { - // Before stats for the old vSignal curve - const ownerTaxPercentage = await gns.ownerTaxPercentage() - const curationTaxPercentage = await curation.curationTaxPercentage() - // Before stats for the name curve - const namePoolBefore = await gns.nameSignals(graphAccount, subgraphNumber) - - // Check what selling all nSignal, which == selling all vSignal, should return for tokens - // NOTE - no tax on burning on nSignal - const { 1: tokensReceivedEstimate } = await gns.nSignalToTokens( - graphAccount, - subgraphNumber, - namePoolBefore.nSignal, - ) - // Example: - // Deposit 100, 5 is taxed, 95 GRT in curve - // Upgrade - calculate 5% tax on 95 --> 4.75 GRT - // Multiple by ownerPercentage --> 50% * 4.75 = 2.375 GRT - // Owner adds 2.375 to 90.25, we deposit 92.625 GRT into the curve - // Divide this by 0.95 to get exactly 97.5 total tokens to be deposited - - // nSignalToTokens returns the amount of tokens with tax removed - // already. So we must add in the tokens removed - const MAX_PPM = 1000000 - const taxOnOriginal = tokensReceivedEstimate.mul(curationTaxPercentage).div(MAX_PPM) - const totalWithoutOwnerTax = tokensReceivedEstimate.sub(taxOnOriginal) - const ownerTax = taxOnOriginal.mul(ownerTaxPercentage).div(MAX_PPM) - - const totalWithOwnerTax = totalWithoutOwnerTax.add(ownerTax) - - const totalAdjustedUp = totalWithOwnerTax.mul(MAX_PPM).div(MAX_PPM - curationTaxPercentage) - - // Re-estimate amount of signal to get considering the owner tax paid by the owner - const { 0: newVSignalEstimate, 1: newCurationTaxEstimate } = await curation.tokensToSignal( - subgraphToPublish.subgraphDeploymentID, - totalAdjustedUp, - ) - - // Send transaction - const tx = gns - .connect(account.signer) - .publishNewVersion( - graphAccount, - subgraphNumber, - subgraphToPublish.subgraphDeploymentID, - subgraphToPublish.versionMetadata, - ) - await expect(tx) - .emit(gns, 'SubgraphPublished') - .withArgs( - subgraphToPublish.graphAccount.address, - subgraphNumber, - subgraphToPublish.subgraphDeploymentID, - subgraphToPublish.versionMetadata, - ) - .emit(gns, 'NameSignalUpgrade') - .withArgs( - graphAccount, - subgraphNumber, - newVSignalEstimate, - totalAdjustedUp, - subgraphToPublish.subgraphDeploymentID, - ) - - // Check curation vSignal old are set to zero - const [tokensAfterOldCuration, vSignalAfterOldCuration] = await getTokensAndVSignal( - subgraph0.subgraphDeploymentID, - ) - expect(tokensAfterOldCuration).eq(0) - expect(vSignalAfterOldCuration).eq(0) - - // Check the vSignal of the new curation curve, amd tokens - const [tokensAfterNewCurve, vSignalAfterNewCurve] = await getTokensAndVSignal( - subgraphToPublish.subgraphDeploymentID, - ) - expect(tokensAfterNewCurve).eq(totalAdjustedUp.sub(newCurationTaxEstimate)) - expect(vSignalAfterNewCurve).eq(newVSignalEstimate) - - // Check the nSignal pool - const namePoolAfter = await gns.nameSignals(graphAccount, subgraphNumber) - expect(namePoolAfter.vSignal).eq(vSignalAfterNewCurve).eq(newVSignalEstimate) - expect(namePoolAfter.nSignal).eq(namePoolBefore.nSignal) // should not change - expect(namePoolAfter.subgraphDeploymentID).eq(subgraphToPublish.subgraphDeploymentID) - - return tx - } - - const deprecateSubgraph = async ( - account: Account, - graphAccount: string, - subgraphNumber0: number, - ) => { - const [tokensBefore] = await getTokensAndVSignal(subgraph0.subgraphDeploymentID) - // We can use the whole amount, since in this test suite all vSignal is used to be staked on nSignal - const ownerBalanceBefore = await grt.balanceOf(account.address) - - const tx = gns.connect(account.signer).deprecateSubgraph(graphAccount, subgraphNumber0) - await expect(tx).emit(gns, 'SubgraphDeprecated').withArgs(subgraph0.graphAccount.address, 0) - await expect(tx) - .emit(gns, 'NameSignalDisabled') - .withArgs(graphAccount, subgraphNumber0, tokensBefore) - - const deploymentID = await gns.subgraphs(subgraph0.graphAccount.address, 0) - expect(ethers.constants.HashZero).eq(deploymentID) - - // Check that vSignal is set to 0 - const poolAfter = await gns.nameSignals(graphAccount, subgraphNumber0) - const poolVSignalAfter = poolAfter.vSignal - expect(poolVSignalAfter.eq(toBN('0'))) - // Check that the owner balance decreased by the curation tax - const ownerBalanceAfter = await grt.balanceOf(account.address) - expect(ownerBalanceBefore.eq(ownerBalanceAfter)) - // Should be equal since owner pays curation tax - expect(poolAfter.withdrawableGRT).eq(tokensBefore) - // Check that deprecated is true - expect(poolAfter.disabled).eq(true) - // Check balance of gns increase by curation tax from owner being added - const gnsBalanceAfter = await grt.balanceOf(gns.address) - expect(gnsBalanceAfter).eq(poolAfter.withdrawableGRT) - return tx - } - - /* - const upgradeNameSignal = async ( - account: Account, - graphAccount: string, - subgraphNumber0: number, - newSubgraphDeplyomentID: string, - ): Promise => { - // Before stats for the old vSignal curve - const tokensBeforeVSigOldCuration = await getTokensAndVSignal(subgraph0.subgraphDeploymentID) - const tokensBeforeOldCuration = tokensBeforeVSigOldCuration[0] - const vSigBeforeOldCuration = tokensBeforeVSigOldCuration[1] - - // Before stats for the name curve - const poolBefore = await gns.nameSignals(graphAccount, subgraphNumber0) - const nSigBefore = poolBefore[1] - - // Check what selling all nSignal, which == selling all vSignal, should return for tokens - const nSignalToTokensResult = await gns.nSignalToTokens( - graphAccount, - subgraphNumber0, - nSigBefore, - ) - const vSignalBurnEstimate = nSignalToTokensResult[0] - const tokensReceivedEstimate = nSignalToTokensResult[1] - - // since in upgrade, owner must refund fees, we need to actually add this back in - const feesToAddBackEstimate = nSignalToTokensResult[2] - const upgradeTokenReturn = tokensReceivedEstimate.add(feesToAddBackEstimate) - - // Get the value for new vSignal that should be created on the new curve - const newVSignalEstimate = await curation.tokensToSignal( - newSubgraphDeplyomentID, - upgradeTokenReturn, - ) - - // Do the upgrade - const tx = gns - .connect(account.signer) - .upgradeNameSignal(graphAccount, subgraphNumber0, newSubgraphDeplyomentID) - await expect(tx) - .emit(gns, 'NameSignalUpgrade') - .withArgs( - graphAccount, - subgraphNumber0, - newVSignalEstimate, - upgradeTokenReturn, - newSubgraphDeplyomentID, - ) - - // Check curation vSignal old was lowered and tokens too - const [tokensAfterOldCuration, vSigAfterOldCuration] = await getTokensAndVSignal( - subgraph0.subgraphDeploymentID, - ) - expect(tokensAfterOldCuration).eq(tokensBeforeOldCuration.sub(upgradeTokenReturn)) - expect(vSigAfterOldCuration).eq(vSigBeforeOldCuration.sub(vSignalBurnEstimate)) - - // Check the vSignal of the new curation curve, amd tokens - const [tokensAfterNewCurve, vSigAfterNewCurve] = await getTokensAndVSignal( - newSubgraphDeplyomentID, - ) - expect(tokensAfterNewCurve).eq(upgradeTokenReturn) - expect(vSigAfterNewCurve).eq(newVSignalEstimate) - - // Check the nSignal pool - const pool = await gns.nameSignals(graphAccount, subgraphNumber0) - const vSigPool = pool[0] - const nSigAfter = pool[1] - const deploymentID = pool[2] - expect(vSigAfterNewCurve).eq(vSigPool).eq(newVSignalEstimate) - expect(nSigBefore).eq(nSigAfter) // should not change - expect(deploymentID).eq(newSubgraphDeplyomentID) - - return tx - } - */ - - const mintNSignal = async ( - account: Account, - graphAccount: string, - subgraphNumber0: number, - graphTokens: BigNumber, - ): Promise => { - // Before state - const [tokensBefore, vSignalBefore] = await getTokensAndVSignal(subgraph0.subgraphDeploymentID) - const namePoolBefore = await gns.nameSignals(graphAccount, subgraphNumber0) - - // Deposit - const { - 0: vSignalExpected, - 1: nSignalExpected, - 2: curationTax, - } = await gns.tokensToNSignal(graphAccount, subgraphNumber0, graphTokens) - const tx = gns - .connect(account.signer) - .mintNSignal(graphAccount, subgraphNumber0, graphTokens, 0) - await expect(tx) - .emit(gns, 'NSignalMinted') - .withArgs( - graphAccount, - subgraphNumber0, - account.address, - nSignalExpected, - vSignalExpected, - graphTokens, - ) - - // After state - const [tokensAfter, vSignalAfter] = await getTokensAndVSignal(subgraph0.subgraphDeploymentID) - const namePoolAfter = await gns.nameSignals(graphAccount, subgraphNumber0) - - expect(tokensAfter).eq(tokensBefore.add(graphTokens.sub(curationTax))) - expect(vSignalAfter).eq(vSignalBefore.add(vSignalExpected)) - expect(namePoolAfter.nSignal).eq(namePoolBefore.nSignal.add(nSignalExpected)) - expect(namePoolAfter.vSignal).eq(vSignalBefore.add(vSignalExpected)) - - return tx - } - - const burnNSignal = async ( - account: Account, - graphAccount: string, - subgraphNumber0: number, - ): Promise => { - // Before checks - const [tokensBefore, vSigBefore] = await getTokensAndVSignal(subgraph0.subgraphDeploymentID) - const namePoolBefore = await gns.nameSignals(graphAccount, subgraphNumber0) - const usersNSignalBefore = await gns.getCuratorNSignal( - graphAccount, - subgraphNumber0, - account.address, - ) - - // Withdraw - const { 0: vSignalExpected, 1: tokensExpected } = await gns.nSignalToTokens( - graphAccount, - subgraphNumber0, - usersNSignalBefore, - ) - - // Do withdraw tx - const tx = gns - .connect(account.signer) - .burnNSignal(graphAccount, subgraphNumber0, usersNSignalBefore, 0) - await expect(tx) - .emit(gns, 'NSignalBurned') - .withArgs( - graphAccount, - subgraphNumber0, - account.address, - usersNSignalBefore, - vSignalExpected, - tokensExpected, - ) - - // After checks - const [tokensAfter, vSignalCurationAfter] = await getTokensAndVSignal( - subgraph0.subgraphDeploymentID, - ) - const namePoolAfter = await gns.nameSignals(graphAccount, subgraphNumber0) - - expect(tokensAfter).eq(tokensBefore.sub(tokensExpected)) - expect(vSignalCurationAfter).eq(vSigBefore.sub(vSignalExpected)) - expect(namePoolAfter.nSignal).eq(namePoolBefore.nSignal.sub(usersNSignalBefore)) - - return tx - } - - const withdraw = async ( - account: Account, - graphAccount: string, - subgraphNumber0: number, - ): Promise => { - const curatorNSignalBefore = await gns.getCuratorNSignal( - graphAccount, - subgraphNumber0, - account.address, - ) - const poolBefore = await gns.nameSignals(graphAccount, subgraphNumber0) - const gnsBalanceBefore = await grt.balanceOf(gns.address) - const tokensEstimate = poolBefore.withdrawableGRT - .mul(curatorNSignalBefore) - .div(poolBefore.nSignal) - - // Run tx - const tx = gns.connect(account.signer).withdraw(graphAccount, subgraphNumber0) - await expect(tx) - .emit(gns, 'GRTWithdrawn') - .withArgs( - graphAccount, - subgraphNumber0, - account.address, - curatorNSignalBefore, - tokensEstimate, - ) - - // curator nSignal should be updated - const curatorNSignalAfter = await gns.getCuratorNSignal( - graphAccount, - subgraphNumber0, - account.address, - ) - - expect(curatorNSignalAfter).eq(toBN(0)) - - // overall n signal should be updated - const poolAfter = await gns.nameSignals(graphAccount, subgraphNumber0) - expect(poolAfter.nSignal).eq(poolBefore.nSignal.sub(curatorNSignalBefore)) - // withdrawableGRT should be updated - - // Token balance should be updated - const gnsBalanceAfter = await grt.balanceOf(gns.address) - expect(gnsBalanceAfter).eq(gnsBalanceBefore.sub(tokensEstimate)) - - return tx - } - - before(async function () { - ;[me, other, governor] = await getAccounts() - fixture = new NetworkFixture() - ;({ grt, curation, gns } = await fixture.load(governor.signer)) - subgraph0 = createSubgraph(me, '0') - subgraph1 = createSubgraph(me, '1') - defaultName = createDefaultName('graph') - // Give some funds to the signers and approve gns contract to use funds on signers behalf - await grt.connect(governor.signer).mint(me.address, tokens100000) - await grt.connect(governor.signer).mint(other.address, tokens100000) - await grt.connect(me.signer).approve(gns.address, tokens100000) - await grt.connect(me.signer).approve(curation.address, tokens100000) - await grt.connect(other.signer).approve(gns.address, tokens100000) - await grt.connect(other.signer).approve(curation.address, tokens100000) - // Update curation tax to test the functionality of it in disableNameSignal() - await curation.connect(governor.signer).setCurationTaxPercentage(curationTaxPercentage) - }) - - beforeEach(async function () { - await fixture.setUp() - }) - - afterEach(async function () { - await fixture.tearDown() - }) - - describe('Publishing names and versions', function () { - describe('setDefaultName', function () { - it('setDefaultName emits the event', async function () { - const tx = gns - .connect(me.signer) - .setDefaultName(me.address, 0, defaultName.nameIdentifier, defaultName.name) - await expect(tx) - .emit(gns, 'SetDefaultName') - .withArgs(subgraph0.graphAccount.address, 0, defaultName.nameIdentifier, defaultName.name) - }) - - it('setDefaultName fails if not owner', async function () { - const tx = gns - .connect(other.signer) - .setDefaultName(me.address, 0, defaultName.nameIdentifier, defaultName.name) - await expect(tx).revertedWith('GNS: Only graph account owner can call') - }) - }) - - describe('updateSubgraphMetadata', function () { - it('updateSubgraphMetadata emits the event', async function () { - const tx = gns - .connect(me.signer) - .updateSubgraphMetadata(me.address, 0, subgraph0.subgraphMetadata) - await expect(tx) - .emit(gns, 'SubgraphMetadataUpdated') - .withArgs(subgraph0.graphAccount.address, 0, subgraph0.subgraphMetadata) - }) - - it('updateSubgraphMetadata fails if not owner', async function () { - const tx = gns - .connect(other.signer) - .updateSubgraphMetadata(me.address, 0, subgraph0.subgraphMetadata) - await expect(tx).revertedWith('GNS: Only graph account owner can call') - }) - }) - describe('isPublished', function () { - it('should return if the subgraph is published', async function () { - expect(await gns.isPublished(subgraph0.graphAccount.address, 0)).eq(false) - await publishNewSubgraph(me, me.address, 0) - expect(await gns.isPublished(subgraph0.graphAccount.address, 0)).eq(true) - }) - }) - - describe('publishNewSubgraph', async function () { - it('should publish a new subgraph and first version with it', async function () { - await publishNewSubgraph(me, me.address, 0) - // State updated - const deploymentID = await gns.subgraphs(subgraph0.graphAccount.address, 0) - expect(subgraph0.subgraphDeploymentID).eq(deploymentID) - }) - - it('should publish a new subgraph with an incremented value', async function () { - await publishNewSubgraph(me, me.address, 0) - await publishNewSubgraph(me, me.address, 1, subgraph1) - const deploymentID = await gns.subgraphs(subgraph1.graphAccount.address, 1) - expect(subgraph1.subgraphDeploymentID).eq(deploymentID) - }) - - it('should reject publish if not sent from owner', async function () { - const tx = gns - .connect(other.signer) - .publishNewSubgraph( - subgraph0.graphAccount.address, - ethers.constants.HashZero, - subgraph0.versionMetadata, - subgraph0.subgraphMetadata, - ) - await expect(tx).revertedWith('GNS: Only graph account owner can call') - }) - - it('should prevent subgraphDeploymentID of 0 to be used', async function () { - const tx = gns - .connect(me.signer) - .publishNewSubgraph( - subgraph0.graphAccount.address, - ethers.constants.HashZero, - subgraph0.versionMetadata, - subgraph0.subgraphMetadata, - ) - await expect(tx).revertedWith('GNS: Cannot set deploymentID to 0 in publish') - }) - }) - - describe('publishNewVersion', async function () { - beforeEach(async () => { - await publishNewSubgraph(me, me.address, 0) - await mintNSignal(me, me.address, 0, tokens10000) - }) - - it('should publish a new version on an existing subgraph', async function () { - await publishNewVersion(me, me.address, 0, subgraph1) - }) - - it('should reject a new version with the same subgraph deployment ID', async function () { - const tx = gns - .connect(me.signer) - .publishNewVersion( - subgraph0.graphAccount.address, - 0, - subgraph0.subgraphDeploymentID, - subgraph0.versionMetadata, - ) - await expect(tx).revertedWith( - 'GNS: Cannot publish a new version with the same subgraph deployment ID', - ) - }) - - it('should reject publishing a version to a numbered subgraph that does not exist', async function () { - const wrongNumberedSubgraph = 9999 - const tx = gns - .connect(me.signer) - .publishNewVersion( - subgraph1.graphAccount.address, - wrongNumberedSubgraph, - subgraph1.subgraphDeploymentID, - subgraph1.versionMetadata, - ) - await expect(tx).revertedWith( - 'GNS: Cannot update version if not published, or has been deprecated', - ) - }) - - it('reject if not the owner', async function () { - const tx = gns - .connect(other.signer) - .publishNewVersion( - subgraph1.graphAccount.address, - 0, - subgraph1.subgraphDeploymentID, - subgraph1.versionMetadata, - ) - await expect(tx).revertedWith('GNS: Only graph account owner can call') - }) - - it('should fail when upgrade tries to point to a pre-curated', async function () { - await curation.connect(me.signer).mint(subgraph1.subgraphDeploymentID, tokens1000, 0) - const tx = gns - .connect(me.signer) - .publishNewVersion( - me.address, - 0, - subgraph1.subgraphDeploymentID, - subgraph1.versionMetadata, - ) - await expect(tx).revertedWith( - 'GNS: Owner cannot point to a subgraphID that has been pre-curated', - ) - }) - - it('should fail when trying to upgrade when there is no nSignal', async function () { - await burnNSignal(me, me.address, 0) - const tx = gns - .connect(me.signer) - .publishNewVersion( - me.address, - 0, - subgraph1.subgraphDeploymentID, - subgraph1.versionMetadata, - ) - await expect(tx).revertedWith( - 'GNS: There must be nSignal on this subgraph for curve math to work', - ) - }) - - it('should fail when subgraph is deprecated', async function () { - await deprecateSubgraph(me, me.address, 0) - const tx = gns - .connect(me.signer) - .publishNewVersion( - me.address, - 0, - subgraph1.subgraphDeploymentID, - subgraph1.versionMetadata, - ) - await expect(tx).revertedWith( - 'GNS: Cannot update version if not published, or has been deprecated', - ) - }) - }) - - describe('deprecateSubgraph', async function () { - beforeEach(async () => { - await publishNewSubgraph(me, me.address, 0) - await mintNSignal(me, me.address, 0, tokens10000) - }) - - it('should deprecate a subgraph', async function () { - await deprecateSubgraph(me, me.address, 0) - }) - - it('should prevent a deprecated subgraph from being republished', async function () { - await deprecateSubgraph(me, me.address, 0) - const tx = gns - .connect(me.signer) - .publishNewVersion( - subgraph1.graphAccount.address, - 1, - subgraph1.subgraphDeploymentID, - subgraph1.versionMetadata, - ) - await expect(tx).revertedWith( - 'Cannot update version if not published, or has been deprecated', - ) - }) - - it('reject if the subgraph does not exist', async function () { - const wrongNumberedSubgraph = 2340 - const tx = gns - .connect(me.signer) - .deprecateSubgraph(subgraph1.graphAccount.address, wrongNumberedSubgraph) - await expect(tx).revertedWith('GNS: Cannot deprecate a subgraph which does not exist') - }) - - it('reject deprecate if not the owner', async function () { - const tx = gns - .connect(other.signer) - .deprecateSubgraph(subgraph0.graphAccount.address, subgraph0.subgraphNumber) - await expect(tx).revertedWith('GNS: Only graph account owner can call') - }) - }) - }) - describe('Curating on names', async function () { - const subgraphNumber0 = 0 - - describe('mintNSignal()', async function () { - it('should deposit into the name signal curve', async function () { - await publishNewSubgraph(me, me.address, subgraphNumber0) - await mintNSignal(other, me.address, subgraphNumber0, tokens10000) - }) - - it('should fail when name signal is disabled', async function () { - await publishNewSubgraph(me, me.address, subgraphNumber0) - await deprecateSubgraph(me, me.address, 0) - const tx = gns.connect(me.signer).mintNSignal(me.address, subgraphNumber0, tokens1000, 0) - await expect(tx).revertedWith('GNS: Cannot be disabled') - }) - - it('should fail if you try to deposit on a non existing name', async function () { - const tx = gns.connect(me.signer).mintNSignal(me.address, subgraphNumber0, tokens1000, 0) - await expect(tx).revertedWith('GNS: Must deposit on a name signal that exists') - }) - - it('reject minting if under slippage', async function () { - // First publish the subgraph - await publishNewSubgraph(me, me.address, subgraphNumber0) - - // Set slippage to be 1 less than expected result to force reverting - const { 1: expectedNSignal } = await gns.tokensToNSignal( - me.address, - subgraphNumber0, - tokens1000, - ) - const tx = gns - .connect(me.signer) - .mintNSignal(me.address, subgraphNumber0, tokens1000, expectedNSignal.add(1)) - await expect(tx).revertedWith('Slippage protection') - }) - }) - - describe('burnNSignal()', async function () { - beforeEach(async () => { - await publishNewSubgraph(me, me.address, subgraphNumber0) - await mintNSignal(other, me.address, subgraphNumber0, tokens10000) - }) - - it('should withdraw from the name signal curve', async function () { - await burnNSignal(other, me.address, subgraphNumber0) - }) - - it('should fail when name signal is disabled', async function () { - await deprecateSubgraph(me, me.address, 0) - // just test 1 since it will fail - const tx = gns.connect(me.signer).burnNSignal(me.address, subgraphNumber0, 1, 0) - await expect(tx).revertedWith('GNS: Cannot be disabled') - }) - - it('should fail when the curator tries to withdraw more nSignal than they have', async function () { - const tx = gns.connect(me.signer).burnNSignal( - me.address, - subgraphNumber0, - // 1000000 * 10^18 nSignal is a lot, and will cause fail - toBN('1000000000000000000000000'), - 0, - ) - await expect(tx).revertedWith('GNS: Curator cannot withdraw more nSignal than they have') - }) - - it('reject burning if under slippage', async function () { - // Get current curator name signal - const curatorNSignal = await gns.getCuratorNSignal( - me.address, - subgraphNumber0, - other.address, - ) - - // Withdraw - const { 1: expectedTokens } = await gns.nSignalToTokens( - me.address, - subgraphNumber0, - curatorNSignal, - ) - - // Force a revert by asking 1 more token than the function will return - const tx = gns - .connect(other.signer) - .burnNSignal(me.address, subgraphNumber0, curatorNSignal, expectedTokens.add(1)) - await expect(tx).revertedWith('Slippage protection') - }) - }) - - describe('withdraw()', async function () { - beforeEach(async () => { - await publishNewSubgraph(me, me.address, subgraphNumber0) - await mintNSignal(other, me.address, subgraphNumber0, tokens10000) - }) - - it('should withdraw GRT from a disabled name signal', async function () { - await deprecateSubgraph(me, me.address, 0) - await withdraw(other, me.address, subgraphNumber0) - }) - - it('should fail if not disabled', async function () { - const tx = gns.connect(other.signer).withdraw(me.address, subgraphNumber0) - await expect(tx).revertedWith('GNS: Name bonding curve must be disabled first') - }) - - it('should fail when there is no more GRT to withdraw', async function () { - await deprecateSubgraph(me, me.address, 0) - await withdraw(other, me.address, subgraphNumber0) - const tx = gns.connect(other.signer).withdraw(me.address, subgraphNumber0) - await expect(tx).revertedWith('GNS: No more GRT to withdraw') - }) - - it('should fail if the curator has no nSignal', async function () { - await deprecateSubgraph(me, me.address, 0) - const tx = gns.connect(me.signer).withdraw(me.address, subgraphNumber0) - await expect(tx).revertedWith('GNS: Curator must have some nSignal to withdraw GRT') - }) - }) - - describe('multiple minting', async function () { - it('should mint less signal every time due to the bonding curve', async function () { - const tokensToDepositMany = [ - toGRT('1000'), // should mint if we start with number above minimum deposit - toGRT('1000'), // every time it should mint less GCS due to bonding curve... - toGRT('1.06'), // should mint minimum deposit including tax - toGRT('1000'), - toGRT('1000'), - toGRT('2000'), - toGRT('2000'), - toGRT('123'), - ] - await publishNewSubgraph(me, me.address, 0) - - // State updated - const curationTaxPercentage = await curation.curationTaxPercentage() - - for (const tokensToDeposit of tokensToDepositMany) { - const poolOld = await gns.nameSignals(me.address, 0) - expect(subgraph0.subgraphDeploymentID).eq(poolOld.subgraphDeploymentID) - - const curationTax = toBN(curationTaxPercentage).mul(tokensToDeposit).div(toBN(1000000)) - const expectedNSignal = await calcGNSBondingCurve( - poolOld.nSignal, - poolOld.vSignal, - poolOld.reserveRatio, - tokensToDeposit.sub(curationTax), - poolOld.subgraphDeploymentID, - ) - const tx = await mintNSignal(me, me.address, 0, tokensToDeposit) - const receipt = await tx.wait() - const event: Event = receipt.events.pop() - const nSignalCreated = event.args['nSignalCreated'] - expect(toRound(expectedNSignal)).eq(toRound(toFloat(nSignalCreated))) - } - }) - - it('should mint when using the edge case of linear function', async function () { - // Setup edge case like linear function: 1 vSignal = 1 nSignal = 1 token - await curation.setMinimumCurationDeposit(toGRT('1')) - await curation.setDefaultReserveRatio(1000000) - // note - reserve ratio is already set to 1000000 in GNS - - const tokensToDepositMany = [ - toGRT('1000'), // should mint if we start with number above minimum deposit - toGRT('1000'), // every time it should mint less GCS due to bonding curve... - toGRT('1000'), - toGRT('1000'), - toGRT('2000'), - toGRT('2000'), - toGRT('123'), - toGRT('1'), // should mint below minimum deposit - ] - - await publishNewSubgraph(me, me.address, 0) - - // State updated - for (const tokensToDeposit of tokensToDepositMany) { - await mintNSignal(me, me.address, 0, tokensToDeposit) - } - }) - - describe('setOwnerTaxPercentage', function () { - const newValue = 10 - - it('should set `ownerTaxPercentage`', async function () { - // Can set if allowed - await gns.connect(governor.signer).setOwnerTaxPercentage(newValue) - expect(await gns.ownerTaxPercentage()).eq(newValue) - }) - - it('reject set `ownerTaxPercentage` if out of bounds', async function () { - const tx = gns.connect(governor.signer).setOwnerTaxPercentage(1000001) - await expect(tx).revertedWith('Owner tax must be MAX_PPM or less') - }) - - it('reject set `ownerTaxPercentage` if not allowed', async function () { - const tx = gns.connect(me.signer).setOwnerTaxPercentage(newValue) - await expect(tx).revertedWith('Caller must be Controller governor') - }) - }) - }) - }) - - describe('Two named subgraphs point to the same subgraph deployment ID', function () { - it('handle initialization under minimum signal values', async function () { - await curation.setMinimumCurationDeposit(toGRT('1')) - - // Publish a named subgraph-0 -> subgraphDeployment0 - await gns - .connect(me.signer) - .publishNewSubgraph( - me.address, - subgraph0.subgraphDeploymentID, - subgraph0.versionMetadata, - subgraph0.subgraphMetadata, - ) - // Curate on the first subgraph - await gns.connect(me.signer).mintNSignal(me.address, 0, toGRT('90000'), 0) - - // Publish a named subgraph-1 -> subgraphDeployment0 - await gns - .connect(me.signer) - .publishNewSubgraph( - me.address, - subgraph0.subgraphDeploymentID, - subgraph0.versionMetadata, - subgraph0.subgraphMetadata, - ) - // Curate on the second subgraph should work - await gns.connect(me.signer).mintNSignal(me.address, 1, toGRT('10'), 0) - }) - }) -}) diff --git a/test/governance/controller.test.ts b/test/governance/controller.test.ts deleted file mode 100644 index 02b612811..000000000 --- a/test/governance/controller.test.ts +++ /dev/null @@ -1,138 +0,0 @@ -import { expect } from 'chai' -import { constants, utils } from 'ethers' - -import { Controller } from '../../build/types/Controller' -import { EpochManager } from '../../build/types/EpochManager' - -import { getAccounts, Account } from '../lib/testHelpers' -import { NetworkFixture } from '../lib/fixtures' - -const { AddressZero } = constants - -describe('Managed', () => { - let me: Account - let governor: Account - let mockController: Account - let newMockEpochManager: Account - - let fixture: NetworkFixture - - let epochManager: EpochManager - let controller: Controller - - before(async function () { - ;[me, governor, mockController, newMockEpochManager] = await getAccounts() - - // We just run the fixures to set up a contract with Managed, as this - // is cleaner and easier for us to test - fixture = new NetworkFixture() - ;({ epochManager, controller } = await fixture.load(governor.signer)) - }) - - beforeEach(async function () { - await fixture.setUp() - }) - - afterEach(async function () { - await fixture.tearDown() - }) - - describe('setContractProxy()', function () { - it('should set contract proxy and test get contract proxy', async function () { - // Set right in the constructor - expect(await epochManager.controller()).eq(controller.address) - - // Test the controller - const id = utils.id('EpochManager') - const tx = controller - .connect(governor.signer) - .setContractProxy(id, newMockEpochManager.address) - await expect(tx) - .emit(controller, 'SetContractProxy') - .withArgs(id, newMockEpochManager.address) - expect(await controller.getContractProxy(id)).eq(newMockEpochManager.address) - }) - - it('reject set contract proxy to address zero', async function () { - const id = utils.id('EpochManager') - const tx = controller.connect(governor.signer).setContractProxy(id, AddressZero) - await expect(tx).revertedWith('Contract address must be set') - }) - - it('reject set contract proxy if not governor', async function () { - const id = utils.id('EpochManager') - const tx = controller.connect(me.signer).setContractProxy(id, newMockEpochManager.address) - await expect(tx).revertedWith('Only Governor can call') - }) - }) - - describe('unsetContractProxy()', function () { - it('should unset contract proxy', async function () { - // Set contract - const id = utils.id('EpochManager') - await controller.connect(governor.signer).setContractProxy(id, newMockEpochManager.address) - expect(await controller.getContractProxy(id)).eq(newMockEpochManager.address) - - // Unset contract - const tx = controller.connect(governor.signer).unsetContractProxy(id) - await expect(tx).emit(controller, 'SetContractProxy').withArgs(id, AddressZero) - expect(await controller.getContractProxy(id)).eq(AddressZero) - }) - - it('reject to call if not authorized caller', async function () { - // Unset contract - const id = utils.id('EpochManager') - const tx = controller.connect(me.signer).unsetContractProxy(id) - await expect(tx).revertedWith('Only Governor can call') - }) - }) - - describe('updateController()', function () { - it('should update controller on a manager', async function () { - const tx = controller - .connect(governor.signer) - .updateController(utils.id('EpochManager'), mockController.address) - await expect(tx).emit(epochManager, 'SetController').withArgs(mockController.address) - expect(await epochManager.controller()).eq(mockController.address) - }) - - it('should fail updating controller when not called by governor', async function () { - const tx = controller - .connect(me.signer) - .updateController(utils.id('EpochManager'), mockController.address) - await expect(tx).revertedWith('Only Governor can call') - }) - - it('reject update controller to address zero', async function () { - const tx = controller - .connect(governor.signer) - .updateController(utils.id('EpochManager'), AddressZero) - await expect(tx).revertedWith('Controller must be set') - }) - }) - - describe('setController()', function () { - it('should fail setting controller when not called from Controller', async function () { - const tx = epochManager.connect(me.signer).setController(mockController.address) - await expect(tx).revertedWith('Caller must be Controller') - }) - }) - - describe('setPauseGuardian()', function () { - it('should set the pause guardian', async function () { - const tx = controller.connect(governor.signer).setPauseGuardian(me.address) - await expect(tx).emit(controller, 'NewPauseGuardian').withArgs(AddressZero, me.address) - expect(await controller.pauseGuardian()).eq(me.address) - }) - - it('reject to call if not authorized caller', async function () { - const tx = controller.connect(me.signer).setPauseGuardian(me.address) - await expect(tx).revertedWith('Only Governor can call') - }) - - it('reject set pause guardian to address zero', async function () { - const tx = controller.connect(governor.signer).setPauseGuardian(AddressZero) - await expect(tx).revertedWith('PauseGuardian must be set') - }) - }) -}) diff --git a/test/governance/gov.test.ts b/test/governance/gov.test.ts deleted file mode 100644 index e870fa11b..000000000 --- a/test/governance/gov.test.ts +++ /dev/null @@ -1,141 +0,0 @@ -import { expect } from 'chai' -import hre from 'hardhat' -import '@nomiclabs/hardhat-ethers' - -import { GraphGovernance } from '../../build/types/GraphGovernance' - -import { deployProxyAdmin, deployGraphGovernance } from '../lib/deployment' -import { getAccounts, Account, randomHexBytes } from '../lib/testHelpers' - -const { ethers } = hre -const { HashZero } = ethers.constants - -enum ProposalResolution { - Null, - Accepted, - Rejected, -} - -describe('GraphGovernance', () => { - let deployer: Account - let governor: Account - let someone: Account - - let gov: GraphGovernance - - beforeEach(async function () { - ;[deployer, governor, someone] = await getAccounts() - - const proxyAdmin = await deployProxyAdmin(deployer.signer) - gov = await deployGraphGovernance(deployer.signer, governor.address, proxyAdmin) - }) - - describe('proposals', function () { - const proposalId = randomHexBytes(32) - const votes = randomHexBytes(32) - const metadata = randomHexBytes(32) - - it('should create a proposal', async function () { - const tx = gov - .connect(governor.signer) - .createProposal(proposalId, votes, metadata, ProposalResolution.Accepted) - await expect(tx) - .emit(gov, 'ProposalCreated') - .withArgs(proposalId, votes, metadata, ProposalResolution.Accepted) - expect(await gov.isProposalCreated(proposalId)).eq(true) - - const storedProposal = await gov.proposals(proposalId) - expect(storedProposal.metadata).eq(metadata) - expect(storedProposal.votes).eq(votes) - expect(storedProposal.resolution).eq(ProposalResolution.Accepted) - }) - - it('reject create a proposal if not allowed', async function () { - const tx = gov - .connect(someone.signer) - .createProposal(proposalId, votes, metadata, ProposalResolution.Accepted) - await expect(tx).revertedWith('Only Governor can call') - }) - - it('reject create a proposal with empty proposalId', async function () { - const tx = gov - .connect(governor.signer) - .createProposal(HashZero, HashZero, metadata, ProposalResolution.Null) - await expect(tx).revertedWith('!proposalId') - }) - - it('reject create a proposal with empty votes proof', async function () { - const tx = gov - .connect(governor.signer) - .createProposal(proposalId, HashZero, metadata, ProposalResolution.Null) - await expect(tx).revertedWith('!votes') - }) - - it('reject create a proposal with empty resolution', async function () { - const tx = gov - .connect(governor.signer) - .createProposal(proposalId, votes, metadata, ProposalResolution.Null) - await expect(tx).revertedWith('!resolved') - }) - - context('> proposal created', function () { - beforeEach(async function () { - await gov - .connect(governor.signer) - .createProposal(proposalId, votes, metadata, ProposalResolution.Accepted) - }) - - it('should update a proposal', async function () { - const newvotes = randomHexBytes(32) - const newResolution = ProposalResolution.Rejected - const tx = gov - .connect(governor.signer) - .updateProposal(proposalId, newvotes, metadata, newResolution) - await expect(tx) - .emit(gov, 'ProposalUpdated') - .withArgs(proposalId, newvotes, metadata, newResolution) - - const storedProposal = await gov.proposals(proposalId) - expect(storedProposal.metadata).eq(metadata) - expect(storedProposal.votes).eq(newvotes) - expect(storedProposal.resolution).eq(newResolution) - }) - - it('reject create a duplicated proposal', async function () { - const tx = gov - .connect(governor.signer) - .createProposal(proposalId, votes, metadata, ProposalResolution.Accepted) - await expect(tx).revertedWith('proposed') - }) - - it('reject update a non-existing proposal', async function () { - const nonProposalId = randomHexBytes(32) - const tx = gov - .connect(governor.signer) - .updateProposal(nonProposalId, votes, metadata, ProposalResolution.Accepted) - await expect(tx).revertedWith('!proposed') - }) - - it('reject update with empty proposalId', async function () { - const tx = gov - .connect(governor.signer) - .updateProposal(HashZero, HashZero, metadata, ProposalResolution.Null) - await expect(tx).revertedWith('!proposalId') - }) - - it('reject update a proposal with empty votes proof', async function () { - const tx = gov - .connect(governor.signer) - .updateProposal(proposalId, HashZero, metadata, ProposalResolution.Null) - await expect(tx).revertedWith('!votes') - }) - - it('reject update a proposal with empty resolution', async function () { - const tx = gov - .connect(governor.signer) - .updateProposal(proposalId, votes, metadata, ProposalResolution.Null) - await expect(tx).revertedWith('!resolved') - }) - }) - }) -}) diff --git a/test/governance/governed.test.ts b/test/governance/governed.test.ts deleted file mode 100644 index a8e4e7f62..000000000 --- a/test/governance/governed.test.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { expect } from 'chai' -import hre from 'hardhat' -import '@nomiclabs/hardhat-ethers' - -import { Governed } from '../../build/types/Governed' - -import { getAccounts, Account } from '../lib/testHelpers' - -const { ethers } = hre -const { AddressZero } = ethers.constants - -describe('Governed', () => { - let me: Account - let governor: Account - - let governed: Governed - - beforeEach(async function () { - ;[me, governor] = await getAccounts() - - const factory = await ethers.getContractFactory('GovernedMock') - governed = (await factory.connect(governor.signer).deploy()) as unknown as Governed - }) - - it('should reject transfer if not allowed', async function () { - const tx = governed.connect(me.signer).transferOwnership(me.address) - await expect(tx).revertedWith('Only Governor can call') - }) - - it('should transfer and accept', async function () { - // Transfer ownership - const tx1 = governed.connect(governor.signer).transferOwnership(me.address) - await expect(tx1).emit(governed, 'NewPendingOwnership').withArgs(AddressZero, me.address) - - // Reject accept if not the pending governor - await expect(governed.connect(governor.signer).acceptOwnership()).revertedWith( - 'Caller must be pending governor', - ) - - // Accept ownership - const tx2 = governed.connect(me.signer).acceptOwnership() - await expect(tx2).emit(governed, 'NewOwnership').withArgs(governor.address, me.address) - - // Clean pending governor - expect(await governed.pendingGovernor()).eq(AddressZero) - }) -}) diff --git a/test/governance/pausing.test.ts b/test/governance/pausing.test.ts deleted file mode 100644 index 71aa3dc3d..000000000 --- a/test/governance/pausing.test.ts +++ /dev/null @@ -1,105 +0,0 @@ -import { expect } from 'chai' -import { constants } from 'ethers' - -import { Controller } from '../../build/types/Controller' -import { Staking } from '../../build/types/Staking' - -import { getAccounts, Account, toGRT } from '../lib/testHelpers' -import { NetworkFixture } from '../lib/fixtures' - -describe('Pausing', () => { - let me: Account - let governor: Account - let guardian: Account - - let fixture: NetworkFixture - - let staking: Staking - let controller: Controller - - const setPartialPause = async (account: Account, setValue: boolean) => { - const tx = controller.connect(account.signer).setPartialPaused(setValue) - await expect(tx).emit(controller, 'PartialPauseChanged').withArgs(setValue) - expect(await controller.partialPaused()).eq(setValue) - } - const setPause = async (account: Account, setValue: boolean) => { - const tx = controller.connect(account.signer).setPaused(setValue) - await expect(tx).emit(controller, 'PauseChanged').withArgs(setValue) - expect(await controller.paused()).eq(setValue) - } - const AddressZero = constants.AddressZero - before(async function () { - ;[me, governor, guardian] = await getAccounts() - fixture = new NetworkFixture() - ;({ staking, controller } = await fixture.load(governor.signer)) - }) - - beforeEach(async function () { - await fixture.setUp() - }) - - afterEach(async function () { - await fixture.tearDown() - }) - it('should set pause guardian', async function () { - expect(await controller.pauseGuardian()).eq(AddressZero) - const tx = controller.connect(governor.signer).setPauseGuardian(guardian.address) - await expect(tx).emit(controller, 'NewPauseGuardian').withArgs(AddressZero, guardian.address) - expect(await controller.pauseGuardian()).eq(guardian.address) - }) - it('should fail pause guardian when not governor', async function () { - const tx = controller.connect(me.signer).setPauseGuardian(guardian.address) - await expect(tx).revertedWith('Only Governor can call') - }) - it('should set partialPaused and unset from governor and guardian', async function () { - expect(await controller.partialPaused()).eq(false) - // Governor set - await setPartialPause(governor, true) - // Governor unset - await setPartialPause(governor, false) - - await controller.connect(governor.signer).setPauseGuardian(guardian.address) - // Guardian set - await setPartialPause(guardian, true) - // Guardian unset - await setPartialPause(guardian, false) - }) - it('should fail partial pause if not guardian or governor', async function () { - const tx = controller.connect(me.signer).setPauseGuardian(guardian.address) - await expect(tx).revertedWith('Only Governor can call') - }) - it('should check that a function fails when partialPause is set', async function () { - await setPartialPause(governor, true) - - const tokensToStake = toGRT('100') - const tx = staking.connect(me.signer).stake(tokensToStake) - await expect(tx).revertedWith('Partial-paused') - }) - it('should set pause and unset from governor and guardian', async function () { - expect(await controller.paused()).eq(false) - // Governor set - await setPause(governor, true) - // Governor unset - await setPause(governor, false) - - await controller.connect(governor.signer).setPauseGuardian(guardian.address) - // Guardian set - await setPause(guardian, true) - // Guardian unset - await setPause(guardian, false) - }) - it('should fail pause if not guardian or governor', async function () { - const tx = controller.connect(me.signer).setPaused(true) - await expect(tx).revertedWith('Only Governor or Guardian can call') - }) - it('should check that a function fails when pause is set', async function () { - await setPause(governor, true) - - const tokensToStake = toGRT('100') - const tx1 = staking.connect(me.signer).stake(tokensToStake) - await expect(tx1).revertedWith('Paused') - - const tx2 = staking.connect(me.signer).withdraw() - await expect(tx2).revertedWith('Paused') - }) -}) diff --git a/test/graphToken.test.ts b/test/graphToken.test.ts deleted file mode 100644 index 5f53e6866..000000000 --- a/test/graphToken.test.ts +++ /dev/null @@ -1,275 +0,0 @@ -import { expect } from 'chai' -import { constants, utils, BytesLike, BigNumber, Signature } from 'ethers' -import { eip712 } from '@graphprotocol/common-ts/dist/attestations' - -import { GraphToken } from '../build/types/GraphToken' - -import * as deployment from './lib/deployment' -import { getAccounts, getChainID, toBN, toGRT, Account } from './lib/testHelpers' - -const { AddressZero, MaxUint256 } = constants -const { keccak256, SigningKey } = utils - -const PERMIT_TYPE_HASH = eip712.typeHash( - 'Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)', -) -const SALT = '0x51f3d585afe6dfeb2af01bba0889a36c1db03beec88c6a4d0c53817069026afa' - -interface Permit { - owner: string - spender: string - value: BigNumber - nonce: BigNumber - deadline: BigNumber -} - -function hashEncodePermit(permit: Permit) { - return eip712.hashStruct( - PERMIT_TYPE_HASH, - ['address', 'address', 'uint256', 'uint256', 'uint256'], - [permit.owner, permit.spender, permit.value, permit.nonce, permit.deadline], - ) -} - -function signPermit( - signer: BytesLike, - chainId: number, - contractAddress: string, - permit: Permit, -): Signature { - const domainSeparator = eip712.domainSeparator({ - name: 'Graph Token', - version: '0', - chainId, - verifyingContract: contractAddress, - salt: SALT, - }) - const hashEncodedPermit = hashEncodePermit(permit) - const message = eip712.encode(domainSeparator, hashEncodedPermit) - const messageHash = keccak256(message) - const signingKey = new SigningKey(signer) - return signingKey.signDigest(messageHash) -} - -describe('GraphToken', () => { - let me: Account - let other: Account - let governor: Account - - const mePrivateKey = '0x4f3edf983ac636a65a842ce7c78d9aa706d3b113bce9c46f30d7d21715b23b1d' - const otherPrivateKey = '0x6cbed15c793ce57650b9877cf6fa156fbef513c4e6134f022a85b1ffdd59b2a1' - - let grt: GraphToken - - async function permitMaxOK(): Promise { - return permitOK(MaxUint256) - } - - async function permitOK(value: BigNumber): Promise { - const nonce = await grt.nonces(me.address) - return { - owner: me.address, - spender: other.address, - value: value, - nonce: nonce, - deadline: toBN('0'), - } - } - - async function permitExpired(): Promise { - const permit = await permitMaxOK() - permit.deadline = toBN('1') - return permit - } - - async function permitDeny(): Promise { - const permit = await permitMaxOK() - permit.value = toBN('0') - return permit - } - - async function createPermitTransaction(permit: Permit, signer: string) { - const chainID = await getChainID() - const signature: Signature = signPermit(signer, chainID, grt.address, permit) - return grt.permit( - permit.owner, - permit.spender, - permit.value, - permit.deadline, - signature.v, - signature.r, - signature.s, - ) - } - - before(async function () { - ;[me, other, governor] = await getAccounts() - }) - - beforeEach(async function () { - // Deploy graph token - grt = await deployment.deployGRT(governor.signer) - - // Mint some tokens - const tokens = toGRT('10000') - await grt.connect(governor.signer).mint(me.address, tokens) - }) - - describe('permit', function () { - it('should permit max token allowance', async function () { - // Allow to transfer tokens - const tokensToApprove = toGRT('1000') - const permit = await permitOK(tokensToApprove) - const tx = createPermitTransaction(permit, mePrivateKey) - await expect(tx).emit(grt, 'Approval').withArgs(permit.owner, permit.spender, tokensToApprove) - - // Allowance updated - const allowance = await grt.allowance(me.address, other.address) - expect(allowance).eq(tokensToApprove) - - // Transfer tokens should work - const tokens = toGRT('100') - await grt.connect(other.signer).transferFrom(me.address, other.address, tokens) - }) - - it('should permit max token allowance', async function () { - // Allow to transfer tokens - const permit = await permitMaxOK() - const tx = createPermitTransaction(permit, mePrivateKey) - await expect(tx).emit(grt, 'Approval').withArgs(permit.owner, permit.spender, MaxUint256) - - // Allowance updated - const allowance = await grt.allowance(me.address, other.address) - expect(allowance).eq(MaxUint256) - - // Transfer tokens should work - const tokens = toGRT('100') - await grt.connect(other.signer).transferFrom(me.address, other.address, tokens) - }) - - it('reject to transfer more tokens than approved by permit', async function () { - // Allow to transfer tokens - const tokensToApprove = toGRT('1000') - const permit = await permitOK(tokensToApprove) - await createPermitTransaction(permit, mePrivateKey) - - // Should not transfer more than approved - const tooManyTokens = toGRT('1001') - const tx = grt.connect(other.signer).transferFrom(me.address, other.address, tooManyTokens) - await expect(tx).revertedWith('ERC20: transfer amount exceeds allowance') - - // Should transfer up to the approved amount - await grt.connect(other.signer).transferFrom(me.address, other.address, tokensToApprove) - }) - - it('reject use two permits with same nonce', async function () { - // Allow to transfer tokens - const permit = await permitMaxOK() - await createPermitTransaction(permit, mePrivateKey) - - // Try to re-use the permit - const tx = createPermitTransaction(permit, mePrivateKey) - await expect(tx).revertedWith('GRT: invalid permit') - }) - - it('reject use expired permit', async function () { - const permit = await permitExpired() - const tx = createPermitTransaction(permit, mePrivateKey) - await expect(tx).revertedWith('GRT: expired permit') - }) - - it('reject permit if holder address does not match', async function () { - const permit = await permitMaxOK() - const tx = createPermitTransaction(permit, otherPrivateKey) - await expect(tx).revertedWith('GRT: invalid permit') - }) - - it('should deny transfer from if permit was denied', async function () { - // Allow to transfer tokens - const permit1 = await permitMaxOK() - await createPermitTransaction(permit1, mePrivateKey) - - // Deny transfer tokens - const permit2 = await permitDeny() - await createPermitTransaction(permit2, mePrivateKey) - - // Allowance updated - const allowance = await grt.allowance(me.address, other.address) - expect(allowance).eq(toBN('0')) - - // Try to transfer without permit should fail - const tokens = toGRT('100') - const tx = grt.connect(other.signer).transferFrom(me.address, other.address, tokens) - await expect(tx).revertedWith('ERC20: transfer amount exceeds allowance') - }) - }) - - describe('mint', function () { - describe('addMinter', function () { - it('reject add a new minter if not allowed', async function () { - const tx = grt.connect(me.signer).addMinter(me.address) - await expect(tx).revertedWith('Only Governor can call') - }) - - it('should add a new minter', async function () { - expect(await grt.isMinter(me.address)).eq(false) - const tx = grt.connect(governor.signer).addMinter(me.address) - await expect(tx).emit(grt, 'MinterAdded').withArgs(me.address) - expect(await grt.isMinter(me.address)).eq(true) - }) - }) - - describe('mint', async function () { - it('reject mint if not minter', async function () { - const tx = grt.connect(me.signer).mint(me.address, toGRT('100')) - await expect(tx).revertedWith('Only minter can call') - }) - }) - - context('> when is minter', function () { - beforeEach(async function () { - await grt.connect(governor.signer).addMinter(me.address) - expect(await grt.isMinter(me.address)).eq(true) - }) - - describe('mint', async function () { - it('should mint', async function () { - const beforeTokens = await grt.balanceOf(me.address) - - const tokensToMint = toGRT('100') - const tx = grt.connect(me.signer).mint(me.address, tokensToMint) - await expect(tx).emit(grt, 'Transfer').withArgs(AddressZero, me.address, tokensToMint) - - const afterTokens = await grt.balanceOf(me.address) - expect(afterTokens).eq(beforeTokens.add(tokensToMint)) - }) - - it('should mint if governor', async function () { - const tokensToMint = toGRT('100') - await grt.connect(governor.signer).mint(me.address, tokensToMint) - }) - }) - - describe('removeMinter', function () { - it('reject remove a minter if not allowed', async function () { - const tx = grt.connect(me.signer).removeMinter(me.address) - await expect(tx).revertedWith('Only Governor can call') - }) - - it('should remove a minter', async function () { - const tx = grt.connect(governor.signer).removeMinter(me.address) - await expect(tx).emit(grt, 'MinterRemoved').withArgs(me.address) - expect(await grt.isMinter(me.address)).eq(false) - }) - }) - - describe('renounceMinter', function () { - it('should renounce to be a minter', async function () { - const tx = grt.connect(me.signer).renounceMinter() - await expect(tx).emit(grt, 'MinterRemoved').withArgs(me.address) - expect(await grt.isMinter(me.address)).eq(false) - }) - }) - }) - }) -}) diff --git a/test/lib/deployment.ts b/test/lib/deployment.ts deleted file mode 100644 index f04ba5b81..000000000 --- a/test/lib/deployment.ts +++ /dev/null @@ -1,256 +0,0 @@ -import { Contract, Signer } from 'ethers' - -import { toBN, toGRT } from './testHelpers' -import { logger } from '../../cli/logging' -import { network } from '../../cli' - -// Contracts definitions -import { BancorFormula } from '../../build/types/BancorFormula' -import { Controller } from '../../build/types/Controller' -import { GraphProxyAdmin } from '../../build/types/GraphProxyAdmin' -import { Curation } from '../../build/types/Curation' -import { DisputeManager } from '../../build/types/DisputeManager' -import { EpochManager } from '../../build/types/EpochManager' -import { GNS } from '../../build/types/GNS' -import { GraphToken } from '../../build/types/GraphToken' -import { ServiceRegistry } from '../../build/types/ServiceRegistry' -import { Staking } from '../../build/types/Staking' -import { RewardsManager } from '../../build/types/RewardsManager' -import { EthereumDIDRegistry } from '../../build/types/EthereumDIDRegistry' -import { GDAI } from '../../build/types/GDAI' -import { GSRManager } from '../../build/types/GSRManager' -import { GraphGovernance } from '../../build/types/GraphGovernance' - -// Disable logging for tests -logger.pause() - -// Default configuration used in tests - -export const defaults = { - curation: { - reserveRatio: toBN('500000'), - minimumCurationDeposit: toGRT('100'), - curationTaxPercentage: 0, - }, - dispute: { - minimumDeposit: toGRT('100'), - fishermanRewardPercentage: toBN('1000'), // in basis points - qrySlashingPercentage: toBN('1000'), // in basis points - idxSlashingPercentage: toBN('100000'), // in basis points - }, - epochs: { - lengthInBlocks: toBN((15 * 60) / 15), // 15 minutes in blocks - }, - staking: { - minimumIndexerStake: toGRT('10'), - channelDisputeEpochs: 1, - maxAllocationEpochs: 5, - thawingPeriod: 20, // in blocks - delegationUnbondingPeriod: 1, // in epochs - alphaNumerator: 85, - alphaDenominator: 100, - }, - token: { - initialSupply: toGRT('10000000000'), // 10 billion - }, - gdai: { - // 5% annual inflation. r^n = 1.05, where n = 365*24*60*60. 18 decimal points. - savingsRate: toGRT('1.000000001547125958'), - initialSupply: toGRT('100000000'), // 100 M - }, - rewards: { - issuanceRate: toGRT('1.000000023206889619'), // 5% annual rate - }, -} - -export async function deployProxy( - implementation: string, - proxyAdmin: string, - deployer: Signer, -): Promise { - const deployResult = await network.deployProxy(implementation, proxyAdmin, deployer) - return deployResult.contract -} - -export async function deployContract( - contractName: string, - deployer?: Signer, - ...params: Array -): Promise { - const deployResult = await network.deployContract(contractName, params, deployer, true) - return deployResult.contract -} - -export async function deployProxyAdmin(deployer: Signer): Promise { - return deployContract('GraphProxyAdmin', deployer) as Promise -} - -export async function deployController(deployer: Signer): Promise { - return deployContract('Controller', deployer) as unknown as Promise -} - -export async function deployGRT(deployer: Signer): Promise { - return deployContract( - 'GraphToken', - deployer, - defaults.token.initialSupply.toString(), - ) as unknown as Promise -} - -export async function deployGDAI(deployer: Signer): Promise { - return deployContract('GDAI', deployer) as unknown as Promise -} - -export async function deployGSR(deployer: Signer, gdaiAddress: string): Promise { - return deployContract( - 'GSRManager', - deployer, - defaults.gdai.savingsRate.toString(), - gdaiAddress, - ) as unknown as Promise -} - -export async function deployCuration( - deployer: Signer, - controller: string, - proxyAdmin: GraphProxyAdmin, -): Promise { - // Dependency - const bondingCurve = (await deployContract('BancorFormula', deployer)) as unknown as BancorFormula - - // Deploy - return network.deployContractWithProxy( - proxyAdmin, - 'Curation', - [ - controller, - bondingCurve.address, - defaults.curation.reserveRatio, - defaults.curation.curationTaxPercentage, - defaults.curation.minimumCurationDeposit, - ], - deployer, - ) as unknown as Curation -} - -export async function deployDisputeManager( - deployer: Signer, - controller: string, - arbitrator: string, - proxyAdmin: GraphProxyAdmin, -): Promise { - // Deploy - return network.deployContractWithProxy( - proxyAdmin, - 'DisputeManager', - [ - controller, - arbitrator, - defaults.dispute.minimumDeposit.toString(), - defaults.dispute.fishermanRewardPercentage.toString(), - defaults.dispute.qrySlashingPercentage.toString(), - defaults.dispute.idxSlashingPercentage.toString(), - ], - deployer, - ) as Promise -} - -export async function deployEpochManager( - deployer: Signer, - controller: string, - proxyAdmin: GraphProxyAdmin, -): Promise { - return network.deployContractWithProxy( - proxyAdmin, - 'EpochManager', - [controller, defaults.epochs.lengthInBlocks], - deployer, - ) as unknown as EpochManager -} - -export async function deployGNS( - deployer: Signer, - controller: string, - proxyAdmin: GraphProxyAdmin, -): Promise { - // Dependency - const didRegistry = await deployEthereumDIDRegistry(deployer) - const bondingCurve = (await deployContract('BancorFormula', deployer)) as unknown as BancorFormula - - // Deploy - return network.deployContractWithProxy( - proxyAdmin, - 'GNS', - [controller, bondingCurve.address, didRegistry.address], - deployer, - ) as unknown as GNS -} - -export async function deployEthereumDIDRegistry(deployer: Signer): Promise { - return deployContract('EthereumDIDRegistry', deployer) as unknown as Promise -} - -export async function deployServiceRegistry( - deployer: Signer, - controller: string, - proxyAdmin: GraphProxyAdmin, -): Promise { - // Deploy - return network.deployContractWithProxy( - proxyAdmin, - 'ServiceRegistry', - [controller], - deployer, - ) as unknown as Promise -} - -export async function deployStaking( - deployer: Signer, - controller: string, - proxyAdmin: GraphProxyAdmin, -): Promise { - return network.deployContractWithProxy( - proxyAdmin, - 'Staking', - [ - controller, - defaults.staking.minimumIndexerStake, - defaults.staking.thawingPeriod, - 0, - 0, - defaults.staking.channelDisputeEpochs, - defaults.staking.maxAllocationEpochs, - defaults.staking.delegationUnbondingPeriod, - 0, - defaults.staking.alphaNumerator, - defaults.staking.alphaDenominator, - ], - deployer, - ) as unknown as Staking -} - -export async function deployRewardsManager( - deployer: Signer, - controller: string, - proxyAdmin: GraphProxyAdmin, -): Promise { - return network.deployContractWithProxy( - proxyAdmin, - 'RewardsManager', - [controller, defaults.rewards.issuanceRate], - deployer, - ) as unknown as RewardsManager -} - -export async function deployGraphGovernance( - deployer: Signer, - governor: string, - proxyAdmin: GraphProxyAdmin, -): Promise { - return network.deployContractWithProxy( - proxyAdmin, - 'GraphGovernance', - [governor], - deployer, - ) as unknown as GraphGovernance -} diff --git a/test/lib/fixtures.ts b/test/lib/fixtures.ts deleted file mode 100644 index 00b151107..000000000 --- a/test/lib/fixtures.ts +++ /dev/null @@ -1,97 +0,0 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ -import { utils, Wallet, Signer } from 'ethers' - -import * as deployment from './deployment' -import { evmSnapshot, evmRevert } from './testHelpers' - -export class NetworkFixture { - lastSnapshotId: number - - constructor() { - this.lastSnapshotId = 0 - } - - async load( - deployer: Signer, - slasher: Signer = Wallet.createRandom() as Signer, - arbitrator: Signer = Wallet.createRandom() as Signer, - ): Promise { - // Roles - const arbitratorAddress = await arbitrator.getAddress() - const slasherAddress = await slasher.getAddress() - - // Deploy contracts - const proxyAdmin = await deployment.deployProxyAdmin(deployer) - const controller = await deployment.deployController(deployer) - const epochManager = await deployment.deployEpochManager( - deployer, - controller.address, - proxyAdmin, - ) - const grt = await deployment.deployGRT(deployer) - const curation = await deployment.deployCuration(deployer, controller.address, proxyAdmin) - const gns = await deployment.deployGNS(deployer, controller.address, proxyAdmin) - const staking = await deployment.deployStaking(deployer, controller.address, proxyAdmin) - const disputeManager = await deployment.deployDisputeManager( - deployer, - controller.address, - arbitratorAddress, - proxyAdmin, - ) - const rewardsManager = await deployment.deployRewardsManager( - deployer, - controller.address, - proxyAdmin, - ) - const serviceRegistry = await deployment.deployServiceRegistry( - deployer, - controller.address, - proxyAdmin, - ) - - // Setup controller - await controller.setContractProxy(utils.id('EpochManager'), epochManager.address) - await controller.setContractProxy(utils.id('GraphToken'), grt.address) - await controller.setContractProxy(utils.id('Curation'), curation.address) - await controller.setContractProxy(utils.id('Staking'), staking.address) - await controller.setContractProxy(utils.id('DisputeManager'), staking.address) - await controller.setContractProxy(utils.id('RewardsManager'), rewardsManager.address) - await controller.setContractProxy(utils.id('ServiceRegistry'), serviceRegistry.address) - - // Setup contracts - await curation.connect(deployer).syncAllContracts() - await gns.connect(deployer).syncAllContracts() - await serviceRegistry.connect(deployer).syncAllContracts() - await disputeManager.connect(deployer).syncAllContracts() - await rewardsManager.connect(deployer).syncAllContracts() - await staking.connect(deployer).syncAllContracts() - - await staking.connect(deployer).setSlasher(slasherAddress, true) - await grt.connect(deployer).addMinter(rewardsManager.address) - await gns.connect(deployer).approveAll() - - // Unpause the protocol - await controller.connect(deployer).setPaused(false) - - return { - controller, - disputeManager, - epochManager, - grt, - curation, - gns, - staking, - rewardsManager, - serviceRegistry, - proxyAdmin, - } - } - - async setUp(): Promise { - this.lastSnapshotId = await evmSnapshot() - } - - async tearDown(): Promise { - await evmRevert(this.lastSnapshotId) - } -} diff --git a/test/lib/testHelpers.ts b/test/lib/testHelpers.ts deleted file mode 100644 index 7fd322719..000000000 --- a/test/lib/testHelpers.ts +++ /dev/null @@ -1,116 +0,0 @@ -import hre from 'hardhat' -import '@nomiclabs/hardhat-ethers' -import '@nomiclabs/hardhat-waffle' -import { providers, utils, BigNumber, Signer, Wallet } from 'ethers' -import { formatUnits, getAddress } from 'ethers/lib/utils' - -import { EpochManager } from '../../build/types/EpochManager' - -const { hexlify, parseUnits, randomBytes } = utils - -export const toBN = (value: string | number): BigNumber => BigNumber.from(value) -export const toGRT = (value: string | number): BigNumber => { - return parseUnits(typeof value === 'number' ? value.toString() : value, '18') -} -export const formatGRT = (value: BigNumber): string => formatUnits(value, '18') -export const randomHexBytes = (n = 32): string => hexlify(randomBytes(n)) -export const randomAddress = (): string => getAddress(randomHexBytes(20)) - -// Network - -export interface Account { - readonly signer: Signer - readonly address: string -} - -export const provider = (): providers.JsonRpcProvider => hre.waffle.provider - -export const getAccounts = async (): Promise => { - const accounts = [] - const signers: Signer[] = await hre.ethers.getSigners() - for (const signer of signers) { - accounts.push({ signer, address: await signer.getAddress() }) - } - return accounts -} - -export const getChainID = (): Promise => { - // HACK: this fixes ganache returning always 1 when a contract calls the chainid() opcode - if (hre.network.name == 'ganache') { - return Promise.resolve(1) - } - return provider() - .getNetwork() - .then((r) => r.chainId) -} - -export const latestBlock = (): Promise => - provider().send('eth_blockNumber', []).then(toBN) - -export const advanceBlock = (): Promise => { - return provider().send('evm_mine', []) -} - -export const advanceBlockTo = async (blockNumber: string | number | BigNumber): Promise => { - const target = - typeof blockNumber === 'number' || typeof blockNumber === 'string' - ? toBN(blockNumber) - : blockNumber - const currentBlock = await latestBlock() - const start = Date.now() - let notified - if (target.lt(currentBlock)) - throw Error(`Target block #(${target}) is lower than current block #(${currentBlock})`) - while ((await latestBlock()).lt(target)) { - if (!notified && Date.now() - start >= 5000) { - notified = true - console.log(`advanceBlockTo: Advancing too ` + 'many blocks is causing this test to be slow.') - } - await advanceBlock() - } -} - -export const advanceBlocks = async (blocks: string | number | BigNumber): Promise => { - const steps = typeof blocks === 'number' || typeof blocks === 'string' ? toBN(blocks) : blocks - const currentBlock = await latestBlock() - const toBlock = currentBlock.add(steps) - await advanceBlockTo(toBlock) -} - -export const advanceToNextEpoch = async (epochManager: EpochManager): Promise => { - const currentBlock = await latestBlock() - const epochLength = await epochManager.epochLength() - const nextEpochBlock = currentBlock.add(epochLength) - await advanceBlockTo(nextEpochBlock) -} - -export const evmSnapshot = async (): Promise => provider().send('evm_snapshot', []) -export const evmRevert = async (id: number): Promise => provider().send('evm_revert', [id]) - -// Allocation keys - -interface ChannelKey { - privKey: string - pubKey: string - address: string - wallet: Signer - generateProof: (address) => Promise -} - -export const deriveChannelKey = (): ChannelKey => { - const w = Wallet.createRandom() - return { - privKey: w.privateKey, - pubKey: w.publicKey, - address: w.address, - wallet: w, - generateProof: (indexerAddress: string): Promise => { - const messageHash = utils.solidityKeccak256( - ['address', 'address'], - [indexerAddress, w.address], - ) - const messageHashBytes = utils.arrayify(messageHash) - return w.signMessage(messageHashBytes) - }, - } -} diff --git a/test/payments/allocationExchange.test.ts b/test/payments/allocationExchange.test.ts deleted file mode 100644 index 6f9c85802..000000000 --- a/test/payments/allocationExchange.test.ts +++ /dev/null @@ -1,266 +0,0 @@ -import { expect } from 'chai' -import { BigNumber, constants, Wallet } from 'ethers' - -import { AllocationExchange } from '../../build/types/AllocationExchange' -import { GraphToken } from '../../build/types/GraphToken' -import { Staking } from '../../build/types/Staking' - -import { NetworkFixture } from '../lib/fixtures' -import * as deployment from '../lib/deployment' -import { - deriveChannelKey, - getAccounts, - randomAddress, - randomHexBytes, - toGRT, - Account, -} from '../lib/testHelpers' -import { arrayify, joinSignature, SigningKey, solidityKeccak256 } from 'ethers/lib/utils' - -const { AddressZero, MaxUint256 } = constants - -interface Voucher { - allocationID: string - amount: BigNumber - signature: string -} - -describe('AllocationExchange', () => { - let governor: Account - let indexer: Account - let authority: Wallet - - let fixture: NetworkFixture - - let grt: GraphToken - let staking: Staking - let allocationExchange: AllocationExchange - - async function createVoucher( - allocationID: string, - amount: BigNumber, - signerKey: string, - ): Promise { - const messageHash = solidityKeccak256(['address', 'uint256'], [allocationID, amount]) - const messageHashBytes = arrayify(messageHash) - const key = new SigningKey(signerKey) - const signature = key.signDigest(messageHashBytes) - return { - allocationID, - amount, - signature: joinSignature(signature), - } - } - - before(async function () { - ;[governor, indexer] = await getAccounts() - authority = Wallet.createRandom() - - fixture = new NetworkFixture() - ;({ grt, staking } = await fixture.load(governor.signer)) - allocationExchange = (await deployment.deployContract( - 'AllocationExchange', - governor.signer, - grt.address, - staking.address, - governor.address, - authority.address, - )) as unknown as AllocationExchange - - // Give some funds to the indexer and approve staking contract to use funds on indexer behalf - const indexerTokens = toGRT('100000') - await grt.connect(governor.signer).mint(indexer.address, indexerTokens) - await grt.connect(indexer.signer).approve(staking.address, indexerTokens) - - // Give some funds to the AllocationExchange - const exchangeTokens = toGRT('2000') - await grt.connect(governor.signer).mint(allocationExchange.address, exchangeTokens) - - // Ensure the exchange is correctly setup - await staking.connect(governor.signer).setAssetHolder(allocationExchange.address, true) - await allocationExchange.connect(governor.signer).setAuthority(authority.address) - await allocationExchange.approveAll() - }) - - beforeEach(async function () { - await fixture.setUp() - }) - - afterEach(async function () { - await fixture.tearDown() - }) - - async function setupAllocation(): Promise { - // Generate test data - const channelKey = deriveChannelKey() - const allocationID = channelKey.address - const subgraphDeploymentID = randomHexBytes(32) - const metadata = randomHexBytes(32) - - // Setup staking - const stakeTokens = toGRT('100000') - await staking.connect(indexer.signer).stake(stakeTokens) - await staking - .connect(indexer.signer) - .allocate( - subgraphDeploymentID, - stakeTokens, - allocationID, - metadata, - await channelKey.generateProof(indexer.address), - ) - return allocationID - } - - describe('config', function () { - it('should set an authority', async function () { - const newAuthority = randomAddress() - const tx = allocationExchange.connect(governor.signer).setAuthority(newAuthority) - await expect(tx).emit(allocationExchange, 'AuthoritySet').withArgs(newAuthority) - expect(await allocationExchange.authority()).eq(newAuthority) - }) - - it('reject set an authority if not allowed', async function () { - const newAuthority = randomAddress() - const tx = allocationExchange.connect(indexer.signer).setAuthority(newAuthority) - await expect(tx).revertedWith(' Only Governor can call') - }) - - it('reject set an empty authority', async function () { - const newAuthority = AddressZero - const tx = allocationExchange.connect(governor.signer).setAuthority(newAuthority) - await expect(tx).revertedWith('Exchange: empty authority') - }) - - it('should allow to approve all tokens to staking contract', async function () { - await allocationExchange.approveAll() - const allowance = await grt.allowance(allocationExchange.address, staking.address) - expect(allowance).eq(MaxUint256) - }) - }) - - describe('withdraw funds', function () { - it('should withdraw to destination', async function () { - const beforeExchangeBalance = await grt.balanceOf(allocationExchange.address) - - const destinationAddress = randomAddress() - const amount = toGRT('1000') - const tx = allocationExchange.connect(governor.signer).withdraw(destinationAddress, amount) - await expect(tx) - .emit(allocationExchange, 'TokensWithdrawn') - .withArgs(destinationAddress, amount) - - const afterExchangeBalance = await grt.balanceOf(allocationExchange.address) - const afterDestinationBalance = await grt.balanceOf(destinationAddress) - - expect(afterExchangeBalance).eq(beforeExchangeBalance.sub(amount)) - expect(afterDestinationBalance).eq(amount) - }) - - it('reject withdraw zero amount', async function () { - const destinationAddress = randomAddress() - const amount = toGRT('0') - const tx = allocationExchange.connect(governor.signer).withdraw(destinationAddress, amount) - await expect(tx).revertedWith('Exchange: empty amount') - }) - - it('reject withdraw to zero destination', async function () { - const destinationAddress = AddressZero - const amount = toGRT('1000') - const tx = allocationExchange.connect(governor.signer).withdraw(destinationAddress, amount) - await expect(tx).revertedWith('Exchange: empty destination') - }) - - it('reject withdraw if not allowed', async function () { - const destinationAddress = randomAddress() - const amount = toGRT('1000') - const tx = allocationExchange.connect(indexer.address).withdraw(destinationAddress, amount) - await expect(tx).revertedWith('Only Governor can call') - }) - }) - - describe('redeem vouchers', function () { - it('redeem a voucher', async function () { - const beforeExchangeBalance = await grt.balanceOf(allocationExchange.address) - - // Setup an active allocation - const allocationID = await setupAllocation() - - // Initiate a withdrawal - const actualAmount = toGRT('2000') // <- withdraw amount - const voucher = await createVoucher(allocationID, actualAmount, authority.privateKey) - const tx = allocationExchange.redeem(voucher) - await expect(tx) - .emit(allocationExchange, 'AllocationRedeemed') - .withArgs(allocationID, actualAmount) - - // Allocation must have collected the withdrawn tokens - const allocation = await staking.allocations(allocationID) - expect(allocation.collectedFees).eq(actualAmount) - - // AllocationExchange should have less funds - const afterExchangeBalance = await grt.balanceOf(allocationExchange.address) - expect(afterExchangeBalance).eq(beforeExchangeBalance.sub(actualAmount)) - }) - - it('reject double spending of a voucher', async function () { - // Setup an active allocation - const allocationID = await setupAllocation() - - // Initiate a withdrawal - const actualAmount = toGRT('2000') // <- withdraw amount - const voucher = await createVoucher(allocationID, actualAmount, authority.privateKey) - - // First redeem - await allocationExchange.redeem(voucher) - - // Double spend the same voucher! - await expect(allocationExchange.redeem(voucher)).revertedWith( - 'Exchange: allocation already redeemed', - ) - }) - - it('reject redeem voucher for invalid allocation', async function () { - // Use an invalid allocation - const allocationID = '0xfefefefefefefefefefefefefefefefefefefefe' - - // Ensure the exchange is correctly setup - await allocationExchange.connect(governor.signer).setAuthority(authority.address) - await allocationExchange.approveAll() - - // Initiate a withdrawal - const actualAmount = toGRT('2000') // <- withdraw amount - const voucher = await createVoucher(allocationID, actualAmount, authority.privateKey) - const tx = allocationExchange.redeem(voucher) - await expect(tx).revertedWith('!collect') - }) - - it('reject redeem voucher not signed by the authority', async function () { - // Initiate a withdrawal - const actualAmount = toGRT('2000') // <- withdraw amount - const voucher = await createVoucher( - randomAddress(), - actualAmount, - Wallet.createRandom().privateKey, // <-- signed by anon - ) - const tx = allocationExchange.redeem(voucher) - await expect(tx).revertedWith('Exchange: invalid signer') - }) - - it('reject redeem voucher with empty amount', async function () { - // Initiate a withdrawal - const actualAmount = toGRT('0') // <- withdraw amount - const voucher = await createVoucher(randomAddress(), actualAmount, authority.privateKey) - const tx = allocationExchange.redeem(voucher) - await expect(tx).revertedWith('Exchange: zero tokens voucher') - }) - - it('reject redeem voucher with invalid signature', async function () { - const actualAmount = toGRT('2000') // <- withdraw amount - const voucher = await createVoucher(randomAddress(), actualAmount, authority.privateKey) - voucher.signature = '0x1234' - const tx = allocationExchange.redeem(voucher) - await expect(tx).revertedWith('Exchange: invalid signature') - }) - }) -}) diff --git a/test/payments/withdrawHelper.test.ts b/test/payments/withdrawHelper.test.ts deleted file mode 100644 index ede9000a6..000000000 --- a/test/payments/withdrawHelper.test.ts +++ /dev/null @@ -1,188 +0,0 @@ -import { expect } from 'chai' -import { constants } from 'ethers' - -import { GRTWithdrawHelper } from '../../build/types/GRTWithdrawHelper' -import { GraphToken } from '../../build/types/GraphToken' -import { Staking } from '../../build/types/Staking' - -import { NetworkFixture } from '../lib/fixtures' -import * as deployment from '../lib/deployment' -import { - deriveChannelKey, - getAccounts, - randomAddress, - randomHexBytes, - toGRT, - Account, -} from '../lib/testHelpers' - -const { AddressZero } = constants - -describe('WithdrawHelper', () => { - let cmc: Account - let governor: Account - let indexer: Account - - let fixture: NetworkFixture - - let grt: GraphToken - let staking: Staking - let withdrawHelper: GRTWithdrawHelper - - function createWithdrawData(callData: string) { - return { - amount: 0, - assetId: grt.address, - callData, - callTo: withdrawHelper.address, - channelAddress: randomAddress(), - nonce: 1, - recipient: withdrawHelper.address, - } - } - - before(async function () { - ;[cmc, governor, indexer] = await getAccounts() - - fixture = new NetworkFixture() - ;({ grt, staking } = await fixture.load(governor.signer)) - withdrawHelper = (await deployment.deployContract( - 'GRTWithdrawHelper', - governor.signer, - grt.address, - )) as unknown as GRTWithdrawHelper - - // Give some funds to the indexer and approve staking contract to use funds on indexer behalf - const indexerTokens = toGRT('100000') - await grt.connect(governor.signer).mint(indexer.address, indexerTokens) - await grt.connect(indexer.signer).approve(staking.address, indexerTokens) - - // Give some funds to the CMC multisig fake account - const cmcTokens = toGRT('2000') - await grt.connect(governor.signer).mint(cmc.address, cmcTokens) - - // Allow WithdrawHelper to call the Staking contract - await staking.connect(governor.signer).setAssetHolder(withdrawHelper.address, true) - }) - - beforeEach(async function () { - await fixture.setUp() - }) - - afterEach(async function () { - await fixture.tearDown() - }) - - describe('execute withdrawal', function () { - it('withdraw tokens from the CMC to staking contract through WithdrawHelper', async function () { - // Generate test data - const channelKey = deriveChannelKey() - const allocationID = channelKey.address - const subgraphDeploymentID = randomHexBytes(32) - const metadata = randomHexBytes(32) - - // Setup staking - const stakeTokens = toGRT('100000') - await staking.connect(indexer.signer).stake(stakeTokens) - await staking - .connect(indexer.signer) - .allocate( - subgraphDeploymentID, - stakeTokens, - allocationID, - metadata, - await channelKey.generateProof(indexer.address), - ) - - // Initiate a withdrawal - // For the purpose of the test we skip the CMC and call WithdrawHelper - // directly. Transfer tokens from the CMC -> WithdrawHelper being the recipient - const actualAmount = toGRT('2000') // <- withdraw amount - await grt.connect(cmc.signer).transfer(withdrawHelper.address, actualAmount) - - // Simulate callTo from the CMC to the WithdrawHelper - const callData = await withdrawHelper.getCallData({ - staking: staking.address, - allocationID, - returnAddress: randomAddress(), - }) - const withdrawData = { - amount: 0, - assetId: grt.address, - callData, - callTo: withdrawHelper.address, - channelAddress: cmc.address, - nonce: 1, - recipient: withdrawHelper.address, - } - await withdrawHelper.connect(cmc.signer).execute(withdrawData, actualAmount) - - // Allocation must have collected the withdrawn tokens - const allocation = await staking.allocations(allocationID) - expect(allocation.collectedFees).eq(actualAmount) - - // CMC should not have more funds - expect(await grt.balanceOf(cmc.address)).eq(0) - }) - - it('withdraw tokens from the CMC to staking contract through WithdrawHelper (invalid allocation)', async function () { - // Use an invalid allocation - const allocationID = '0xfefefefefefefefefefefefefefefefefefefefe' - const returnAddress = randomAddress() - - // Initiate a withdrawal - // For the purpose of the test we skip the CMC and call WithdrawHelper - // directly. Transfer tokens from the CMC -> WithdrawHelper being the recipient - const actualAmount = toGRT('2000') // <- withdraw amount - await grt.connect(cmc.signer).transfer(withdrawHelper.address, actualAmount) - - // Simulate callTo from the CMC to the WithdrawHelper - const callData = await withdrawHelper.getCallData({ - staking: staking.address, - allocationID, - returnAddress, - }) - const withdrawData = { - amount: 0, - assetId: grt.address, - callData, - callTo: withdrawHelper.address, - channelAddress: cmc.address, - nonce: 1, - recipient: withdrawHelper.address, - } - - // This reverts! - await withdrawHelper.connect(cmc.signer).execute(withdrawData, actualAmount) - - // There should not be collected fees - const allocation = await staking.allocations(allocationID) - expect(allocation.collectedFees).eq(0) - - // CMC should have the funds returned - expect(await grt.balanceOf(returnAddress)).eq(actualAmount) - }) - - it('reject collect data with no staking address', async function () { - // Simulate callTo from the CMC to the WithdrawHelper - const callData = await withdrawHelper.getCallData({ - staking: AddressZero, - allocationID: randomAddress(), - returnAddress: randomAddress(), - }) - const tx = withdrawHelper.execute(createWithdrawData(callData), toGRT('100')) - await expect(tx).revertedWith('GRTWithdrawHelper: !staking') - }) - - it('reject collect data with no allocation', async function () { - // Simulate callTo from the CMC to the WithdrawHelper - const callData = await withdrawHelper.getCallData({ - staking: randomAddress(), - allocationID: AddressZero, - returnAddress: randomAddress(), - }) - const tx = withdrawHelper.execute(createWithdrawData(callData), toGRT('100')) - await expect(tx).revertedWith('GRTWithdrawHelper: !allocationID') - }) - }) -}) diff --git a/test/rewards/rewards.test.ts b/test/rewards/rewards.test.ts deleted file mode 100644 index ff3b9a240..000000000 --- a/test/rewards/rewards.test.ts +++ /dev/null @@ -1,776 +0,0 @@ -import { expect } from 'chai' -import { constants, BigNumber } from 'ethers' -import { BigNumber as BN } from 'bignumber.js' - -import { deployContract } from '../lib/deployment' -import { NetworkFixture } from '../lib/fixtures' - -import { Curation } from '../../build/types/Curation' -import { EpochManager } from '../../build/types/EpochManager' -import { GraphToken } from '../../build/types/GraphToken' -import { RewardsManager } from '../../build/types/RewardsManager' -import { RewardsManagerMock } from '../../build/types/RewardsManagerMock' -import { Staking } from '../../build/types/Staking' - -import { - advanceBlocks, - deriveChannelKey, - getAccounts, - randomHexBytes, - latestBlock, - toBN, - toGRT, - formatGRT, - Account, - advanceToNextEpoch, -} from '../lib/testHelpers' - -const MAX_PPM = 1000000 - -const { HashZero, WeiPerEther } = constants - -const toRound = (n: BigNumber) => formatGRT(n).split('.')[0] - -describe('Rewards', () => { - let delegator: Account - let governor: Account - let curator1: Account - let curator2: Account - let indexer1: Account - let indexer2: Account - let oracle: Account - - let fixture: NetworkFixture - - let grt: GraphToken - let curation: Curation - let epochManager: EpochManager - let staking: Staking - let rewardsManager: RewardsManager - let rewardsManagerMock: RewardsManagerMock - - // Derive some channel keys for each indexer used to sign attestations - const channelKey = deriveChannelKey() - - const subgraphDeploymentID1 = randomHexBytes() - const subgraphDeploymentID2 = randomHexBytes() - - const allocationID = channelKey.address - const metadata = HashZero - - const ISSUANCE_RATE_PERIODS = 4 // blocks required to issue 5% rewards - const ISSUANCE_RATE_PER_BLOCK = toBN('1012272234429039270') // % increase every block - - // Core formula that gets accumulated rewards per signal for a period of time - const getRewardsPerSignal = (p: BN, r: BN, t: BN, s: BN): string => { - if (s.eq(0)) { - return '0' - } - return p.times(r.pow(t)).minus(p).div(s).toPrecision(18).toString() - } - - // Tracks the accumulated rewards as totalSignalled or supply changes across snapshots - class RewardsTracker { - totalSupply = BigNumber.from(0) - totalSignalled = BigNumber.from(0) - lastUpdatedBlock = BigNumber.from(0) - accumulated = BigNumber.from(0) - - static async create() { - const tracker = new RewardsTracker() - await tracker.snapshot() - return tracker - } - - async snapshot() { - this.accumulated = this.accumulated.add(await this.accrued()) - this.totalSupply = await grt.totalSupply() - this.totalSignalled = await grt.balanceOf(curation.address) - this.lastUpdatedBlock = await latestBlock() - return this - } - - async elapsedBlocks() { - const currentBlock = await latestBlock() - return currentBlock.sub(this.lastUpdatedBlock) - } - - async accrued() { - const nBlocks = await this.elapsedBlocks() - const n = getRewardsPerSignal( - new BN(this.totalSupply.toString()), - new BN(ISSUANCE_RATE_PER_BLOCK.toString()).div(1e18), - new BN(nBlocks.toString()), - new BN(this.totalSignalled.toString()), - ) - return toGRT(n) - } - } - - // Test accumulated rewards per signal - const shouldGetNewRewardsPerSignal = async (nBlocks = ISSUANCE_RATE_PERIODS) => { - // -- t0 -- - const tracker = await RewardsTracker.create() - - // Jump - await advanceBlocks(nBlocks) - - // -- t1 -- - - // Contract calculation - const contractAccrued = await rewardsManager.getNewRewardsPerSignal() - // Local calculation - const expectedAccrued = await tracker.accrued() - - // Check - expect(toRound(expectedAccrued)).eq(toRound(contractAccrued)) - return expectedAccrued - } - - before(async function () { - ;[delegator, governor, curator1, curator2, indexer1, indexer2, oracle] = await getAccounts() - - fixture = new NetworkFixture() - ;({ grt, curation, epochManager, staking, rewardsManager } = await fixture.load( - governor.signer, - )) - - rewardsManagerMock = (await deployContract( - 'RewardsManagerMock', - governor.signer, - )) as unknown as RewardsManagerMock - - // 5% minute rate (4 blocks) - await rewardsManager.connect(governor.signer).setIssuanceRate(ISSUANCE_RATE_PER_BLOCK) - - // Distribute test funds - for (const wallet of [indexer1, indexer2, curator1, curator2]) { - await grt.connect(governor.signer).mint(wallet.address, toGRT('1000000')) - await grt.connect(wallet.signer).approve(staking.address, toGRT('1000000')) - await grt.connect(wallet.signer).approve(curation.address, toGRT('1000000')) - } - }) - - beforeEach(async function () { - await fixture.setUp() - }) - - afterEach(async function () { - await fixture.tearDown() - }) - - describe('configuration', function () { - describe('issuance rate update', function () { - it('reject set issuance rate if unauthorized', async function () { - const tx = rewardsManager.connect(indexer1.signer).setIssuanceRate(toGRT('1.025')) - await expect(tx).revertedWith('Caller must be Controller governor') - }) - - it('reject set issuance rate to less than minimum allowed', async function () { - const newIssuanceRate = toGRT('0.1') // this get a bignumber with 1e17 - const tx = rewardsManager.connect(governor.signer).setIssuanceRate(newIssuanceRate) - await expect(tx).revertedWith('Issuance rate under minimum allowed') - }) - - it('should set issuance rate to minimum allowed', async function () { - const newIssuanceRate = toGRT('1') // this get a bignumber with 1e18 - await rewardsManager.connect(governor.signer).setIssuanceRate(newIssuanceRate) - expect(await rewardsManager.issuanceRate()).eq(newIssuanceRate) - }) - - it('should set issuance rate', async function () { - const newIssuanceRate = toGRT('1.025') - await rewardsManager.connect(governor.signer).setIssuanceRate(newIssuanceRate) - expect(await rewardsManager.issuanceRate()).eq(newIssuanceRate) - expect(await rewardsManager.accRewardsPerSignalLastBlockUpdated()).eq(await latestBlock()) - }) - }) - - describe('subgraph availability service', function () { - it('reject set subgraph oracle if unauthorized', async function () { - const tx = rewardsManager - .connect(indexer1.signer) - .setSubgraphAvailabilityOracle(oracle.address) - await expect(tx).revertedWith('Caller must be Controller governor') - }) - - it('should set subgraph oracle if governor', async function () { - await rewardsManager.connect(governor.signer).setSubgraphAvailabilityOracle(oracle.address) - expect(await rewardsManager.subgraphAvailabilityOracle()).eq(oracle.address) - }) - - it('reject to deny subgraph if not the oracle', async function () { - const tx = rewardsManager.setDenied(subgraphDeploymentID1, true) - await expect(tx).revertedWith('Caller must be the subgraph availability oracle') - }) - - it('should deny subgraph', async function () { - await rewardsManager.connect(governor.signer).setSubgraphAvailabilityOracle(oracle.address) - - const tx = rewardsManager.connect(oracle.signer).setDenied(subgraphDeploymentID1, true) - const blockNum = await latestBlock() - await expect(tx) - .emit(rewardsManager, 'RewardsDenylistUpdated') - .withArgs(subgraphDeploymentID1, blockNum.add(1)) - expect(await rewardsManager.isDenied(subgraphDeploymentID1)).eq(true) - }) - - it('reject deny subgraph w/ many if not the oracle', async function () { - const deniedSubgraphs = [subgraphDeploymentID1, subgraphDeploymentID2] - const tx = rewardsManager - .connect(oracle.signer) - .setDeniedMany(deniedSubgraphs, [true, true]) - await expect(tx).revertedWith('Caller must be the subgraph availability oracle') - }) - - it('should deny subgraph w/ many', async function () { - await rewardsManager.connect(governor.signer).setSubgraphAvailabilityOracle(oracle.address) - - const deniedSubgraphs = [subgraphDeploymentID1, subgraphDeploymentID2] - await rewardsManager.connect(oracle.signer).setDeniedMany(deniedSubgraphs, [true, true]) - expect(await rewardsManager.isDenied(subgraphDeploymentID1)).eq(true) - expect(await rewardsManager.isDenied(subgraphDeploymentID2)).eq(true) - }) - }) - }) - - context('issuing rewards', async function () { - beforeEach(async function () { - // 5% minute rate (4 blocks) - await rewardsManager.connect(governor.signer).setIssuanceRate(ISSUANCE_RATE_PER_BLOCK) - }) - - describe('getNewRewardsPerSignal', function () { - it('accrued per signal when no tokens signalled', async function () { - // When there is no tokens signalled no rewards are accrued - await advanceToNextEpoch(epochManager) - const accrued = await rewardsManager.getNewRewardsPerSignal() - expect(accrued).eq(0) - }) - - it('accrued per signal when tokens signalled', async function () { - // Update total signalled - const tokensToSignal = toGRT('1000') - await curation.connect(curator1.signer).mint(subgraphDeploymentID1, tokensToSignal, 0) - - // Check - await shouldGetNewRewardsPerSignal() - }) - - it('accrued per signal when signalled tokens w/ many subgraphs', async function () { - // Update total signalled - await curation.connect(curator1.signer).mint(subgraphDeploymentID1, toGRT('1000'), 0) - - // Check - await shouldGetNewRewardsPerSignal() - - // Update total signalled - await curation.connect(curator2.signer).mint(subgraphDeploymentID2, toGRT('250'), 0) - - // Check - await shouldGetNewRewardsPerSignal() - }) - }) - - describe('updateAccRewardsPerSignal', function () { - it('update the accumulated rewards per signal state', async function () { - // Update total signalled - await curation.connect(curator1.signer).mint(subgraphDeploymentID1, toGRT('1000'), 0) - // Snapshot - const tracker = await RewardsTracker.create() - - // Update - await rewardsManager.updateAccRewardsPerSignal() - const contractAccrued = await rewardsManager.accRewardsPerSignal() - - // Check - const expectedAccrued = await tracker.accrued() - expect(toRound(expectedAccrued)).eq(toRound(contractAccrued)) - }) - - it('update the accumulated rewards per signal state after many blocks', async function () { - // Update total signalled - await curation.connect(curator1.signer).mint(subgraphDeploymentID1, toGRT('1000'), 0) - // Snapshot - const tracker = await RewardsTracker.create() - - // Jump - await advanceBlocks(ISSUANCE_RATE_PERIODS) - - // Update - await rewardsManager.updateAccRewardsPerSignal() - const contractAccrued = await rewardsManager.accRewardsPerSignal() - - // Check - const expectedAccrued = await tracker.accrued() - expect(toRound(expectedAccrued)).eq(toRound(contractAccrued)) - }) - }) - - describe('getAccRewardsForSubgraph', function () { - it('accrued for each subgraph', async function () { - // Curator1 - Update total signalled - const signalled1 = toGRT('1500') - await curation.connect(curator1.signer).mint(subgraphDeploymentID1, signalled1, 0) - const tracker1 = await RewardsTracker.create() - - // Curator2 - Update total signalled - const signalled2 = toGRT('500') - await curation.connect(curator2.signer).mint(subgraphDeploymentID2, signalled2, 0) - - // Snapshot - const tracker2 = await RewardsTracker.create() - await tracker1.snapshot() - - // Jump - await advanceBlocks(ISSUANCE_RATE_PERIODS) - - // Snapshot - await tracker1.snapshot() - await tracker2.snapshot() - - // Calculate rewards - const rewardsPerSignal1 = await tracker1.accumulated - const rewardsPerSignal2 = await tracker2.accumulated - const expectedRewardsSG1 = rewardsPerSignal1.mul(signalled1).div(WeiPerEther) - const expectedRewardsSG2 = rewardsPerSignal2.mul(signalled2).div(WeiPerEther) - - // Get rewards from contract - const contractRewardsSG1 = await rewardsManager.getAccRewardsForSubgraph( - subgraphDeploymentID1, - ) - const contractRewardsSG2 = await rewardsManager.getAccRewardsForSubgraph( - subgraphDeploymentID2, - ) - - // Check - expect(toRound(expectedRewardsSG1)).eq(toRound(contractRewardsSG1)) - expect(toRound(expectedRewardsSG2)).eq(toRound(contractRewardsSG2)) - }) - }) - - describe('onSubgraphSignalUpdate', function () { - it('update the accumulated rewards for subgraph state', async function () { - // Update total signalled - const signalled1 = toGRT('1500') - await curation.connect(curator1.signer).mint(subgraphDeploymentID1, signalled1, 0) - // Snapshot - const tracker1 = await RewardsTracker.create() - - // Jump - await advanceBlocks(ISSUANCE_RATE_PERIODS) - - // Update - await rewardsManager.onSubgraphSignalUpdate(subgraphDeploymentID1) - - // Check - const contractRewardsSG1 = (await rewardsManager.subgraphs(subgraphDeploymentID1)) - .accRewardsForSubgraph - const rewardsPerSignal1 = await tracker1.accrued() - const expectedRewardsSG1 = rewardsPerSignal1.mul(signalled1).div(WeiPerEther) - expect(toRound(expectedRewardsSG1)).eq(toRound(contractRewardsSG1)) - - const contractAccrued = await rewardsManager.accRewardsPerSignal() - const expectedAccrued = await tracker1.accrued() - expect(toRound(expectedAccrued)).eq(toRound(contractAccrued)) - - const contractBlockUpdated = await rewardsManager.accRewardsPerSignalLastBlockUpdated() - const expectedBlockUpdated = await latestBlock() - expect(expectedBlockUpdated).eq(contractBlockUpdated) - }) - }) - - describe('getAccRewardsPerAllocatedToken', function () { - it('accrued per allocated token', async function () { - // Update total signalled - const signalled1 = toGRT('1500') - await curation.connect(curator1.signer).mint(subgraphDeploymentID1, signalled1, 0) - - // Allocate - const tokensToAllocate = toGRT('12500') - await staking.connect(indexer1.signer).stake(tokensToAllocate) - await staking - .connect(indexer1.signer) - .allocate( - subgraphDeploymentID1, - tokensToAllocate, - allocationID, - metadata, - await channelKey.generateProof(indexer1.address), - ) - - // Jump - await advanceBlocks(ISSUANCE_RATE_PERIODS) - - // Check - const sg1 = await rewardsManager.subgraphs(subgraphDeploymentID1) - // We trust this function because it was individually tested in previous test - const accRewardsForSubgraphSG1 = await rewardsManager.getAccRewardsForSubgraph( - subgraphDeploymentID1, - ) - const accruedRewardsSG1 = accRewardsForSubgraphSG1.sub(sg1.accRewardsForSubgraphSnapshot) - const expectedRewardsAT1 = accruedRewardsSG1.mul(WeiPerEther).div(tokensToAllocate) - const contractRewardsAT1 = ( - await rewardsManager.getAccRewardsPerAllocatedToken(subgraphDeploymentID1) - )[0] - expect(expectedRewardsAT1).eq(contractRewardsAT1) - }) - }) - - describe('onSubgraphAllocationUpdate', function () { - it('update the accumulated rewards for allocated tokens state', async function () { - // Update total signalled - const signalled1 = toGRT('1500') - await curation.connect(curator1.signer).mint(subgraphDeploymentID1, signalled1, 0) - - // Allocate - const tokensToAllocate = toGRT('12500') - await staking.connect(indexer1.signer).stake(tokensToAllocate) - await staking - .connect(indexer1.signer) - .allocate( - subgraphDeploymentID1, - tokensToAllocate, - allocationID, - metadata, - await channelKey.generateProof(indexer1.address), - ) - - // Jump - await advanceBlocks(ISSUANCE_RATE_PERIODS) - - // Prepare expected results - // NOTE: calculated the expected result manually as the above code has 1 off block difference - // replace with a RewardsManagerMock - const expectedSubgraphRewards = toGRT('891695470') - const expectedRewardsAT = toGRT('51571') - - // Update - await rewardsManager.onSubgraphAllocationUpdate(subgraphDeploymentID1) - - // Check on demand results saved - const subgraph = await rewardsManager.subgraphs(subgraphDeploymentID1) - const contractSubgraphRewards = await rewardsManager.getAccRewardsForSubgraph( - subgraphDeploymentID1, - ) - const contractRewardsAT = subgraph.accRewardsPerAllocatedToken - - expect(toRound(expectedSubgraphRewards)).eq(toRound(contractSubgraphRewards)) - expect(toRound(expectedRewardsAT)).eq(toRound(contractRewardsAT)) - }) - }) - - describe('getRewards', function () { - it('calculate rewards using the subgraph signalled + allocated tokens', async function () { - // Update total signalled - const signalled1 = toGRT('1500') - await curation.connect(curator1.signer).mint(subgraphDeploymentID1, signalled1, 0) - - // Allocate - const tokensToAllocate = toGRT('12500') - await staking.connect(indexer1.signer).stake(tokensToAllocate) - await staking - .connect(indexer1.signer) - .allocate( - subgraphDeploymentID1, - tokensToAllocate, - allocationID, - metadata, - await channelKey.generateProof(indexer1.address), - ) - - // Jump - await advanceBlocks(ISSUANCE_RATE_PERIODS) - - // Rewards - const contractRewards = await rewardsManager.getRewards(allocationID) - - // We trust using this function in the test because we tested it - // standalone in a previous test - const contractRewardsAT1 = ( - await rewardsManager.getAccRewardsPerAllocatedToken(subgraphDeploymentID1) - )[0] - - const expectedRewards = contractRewardsAT1.mul(tokensToAllocate).div(WeiPerEther) - expect(expectedRewards).eq(contractRewards) - }) - }) - - describe('takeRewards', function () { - interface DelegationParameters { - indexingRewardCut: BigNumber - queryFeeCut: BigNumber - cooldownBlocks: number - } - - async function setupIndexerAllocation() { - // Setup - await epochManager.setEpochLength(10) - - // Update total signalled - const signalled1 = toGRT('1500') - await curation.connect(curator1.signer).mint(subgraphDeploymentID1, signalled1, 0) - - // Allocate - const tokensToAllocate = toGRT('12500') - await staking.connect(indexer1.signer).stake(tokensToAllocate) - await staking - .connect(indexer1.signer) - .allocate( - subgraphDeploymentID1, - tokensToAllocate, - allocationID, - metadata, - await channelKey.generateProof(indexer1.address), - ) - } - - async function setupIndexerAllocationWithDelegation( - tokensToDelegate: BigNumber, - delegationParams: DelegationParameters, - ) { - const tokensToAllocate = toGRT('12500') - - // Setup - await epochManager.setEpochLength(10) - - // Transfer some funds from the curator, I don't want to mint new tokens - await grt.connect(curator1.signer).transfer(delegator.address, tokensToDelegate) - await grt.connect(delegator.signer).approve(staking.address, tokensToDelegate) - - // Stake and set delegation parameters - await staking.connect(indexer1.signer).stake(tokensToAllocate) - await staking - .connect(indexer1.signer) - .setDelegationParameters( - delegationParams.indexingRewardCut, - delegationParams.queryFeeCut, - delegationParams.cooldownBlocks, - ) - - // Delegate - await staking.connect(delegator.signer).delegate(indexer1.address, tokensToDelegate) - - // Update total signalled - const signalled1 = toGRT('1500') - await curation.connect(curator1.signer).mint(subgraphDeploymentID1, signalled1, 0) - - // Allocate - await staking - .connect(indexer1.signer) - .allocate( - subgraphDeploymentID1, - tokensToAllocate, - allocationID, - metadata, - await channelKey.generateProof(indexer1.address), - ) - } - - it('should distribute rewards on closed allocation and stake', async function () { - // Setup - await setupIndexerAllocation() - - // Jump - await advanceBlocks(await epochManager.epochLength()) - - // Before state - const beforeTokenSupply = await grt.totalSupply() - const beforeIndexer1Stake = await staking.getIndexerStakedTokens(indexer1.address) - const beforeIndexer1Balance = await grt.balanceOf(indexer1.address) - const beforeStakingBalance = await grt.balanceOf(staking.address) - - const expectedIndexingRewards = toGRT('1471954234') - - // Close allocation. At this point rewards should be collected for that indexer - const tx = await staking - .connect(indexer1.signer) - .closeAllocation(allocationID, randomHexBytes()) - const receipt = await tx.wait() - const event = rewardsManager.interface.parseLog(receipt.logs[1]).args - expect(event.indexer).eq(indexer1.address) - expect(event.allocationID).eq(allocationID) - expect(event.epoch).eq(await epochManager.currentEpoch()) - expect(toRound(event.amount)).eq(toRound(expectedIndexingRewards)) - - // After state - const afterTokenSupply = await grt.totalSupply() - const afterIndexer1Stake = await staking.getIndexerStakedTokens(indexer1.address) - const afterIndexer1Balance = await grt.balanceOf(indexer1.address) - const afterStakingBalance = await grt.balanceOf(staking.address) - - // Check that rewards are put into indexer stake - const expectedIndexerStake = beforeIndexer1Stake.add(expectedIndexingRewards) - const expectedTokenSupply = beforeTokenSupply.add(expectedIndexingRewards) - // Check stake should have increased with the rewards staked - expect(toRound(afterIndexer1Stake)).eq(toRound(expectedIndexerStake)) - // Check indexer balance remains the same - expect(afterIndexer1Balance).eq(beforeIndexer1Balance) - // Check indexing rewards are kept in the staking contract - expect(toRound(afterStakingBalance)).eq( - toRound(beforeStakingBalance.add(expectedIndexingRewards)), - ) - // Check that tokens have been minted - expect(toRound(afterTokenSupply)).eq(toRound(expectedTokenSupply)) - }) - - it('should distribute rewards on closed allocation and send to destination', async function () { - const destinationAddress = randomHexBytes(20) - await staking.connect(indexer1.signer).setRewardsDestination(destinationAddress) - - // Setup - await setupIndexerAllocation() - - // Jump - await advanceBlocks(await epochManager.epochLength()) - - // Before state - const beforeTokenSupply = await grt.totalSupply() - const beforeIndexer1Stake = await staking.getIndexerStakedTokens(indexer1.address) - const beforeDestinationBalance = await grt.balanceOf(destinationAddress) - const beforeStakingBalance = await grt.balanceOf(staking.address) - - const expectedIndexingRewards = toGRT('1471954234') - - // Close allocation. At this point rewards should be collected for that indexer - const tx = await staking - .connect(indexer1.signer) - .closeAllocation(allocationID, randomHexBytes()) - const receipt = await tx.wait() - const event = rewardsManager.interface.parseLog(receipt.logs[1]).args - expect(event.indexer).eq(indexer1.address) - expect(event.allocationID).eq(allocationID) - expect(event.epoch).eq(await epochManager.currentEpoch()) - expect(toRound(event.amount)).eq(toRound(expectedIndexingRewards)) - - // After state - const afterTokenSupply = await grt.totalSupply() - const afterIndexer1Stake = await staking.getIndexerStakedTokens(indexer1.address) - const afterDestinationBalance = await grt.balanceOf(destinationAddress) - const afterStakingBalance = await grt.balanceOf(staking.address) - - // Check that rewards are properly assigned - const expectedIndexerStake = beforeIndexer1Stake - const expectedTokenSupply = beforeTokenSupply.add(expectedIndexingRewards) - // Check stake should not have changed - expect(toRound(afterIndexer1Stake)).eq(toRound(expectedIndexerStake)) - // Check indexing rewards are received by the rewards destination - expect(toRound(afterDestinationBalance)).eq( - toRound(beforeDestinationBalance.add(expectedIndexingRewards)), - ) - // Check indexing rewards were not sent to the staking contract - expect(afterStakingBalance).eq(beforeStakingBalance) - // Check that tokens have been minted - expect(toRound(afterTokenSupply)).eq(toRound(expectedTokenSupply)) - }) - - it('should distribute rewards on closed allocation w/delegators', async function () { - // Setup - const delegationParams = { - indexingRewardCut: toBN('823000'), // 82.30% - queryFeeCut: toBN('80000'), // 8% - cooldownBlocks: 5, - } - const tokensToDelegate = toGRT('2000') - - await setupIndexerAllocationWithDelegation(tokensToDelegate, delegationParams) - - // Jump - await advanceBlocks(await epochManager.epochLength()) - - // Before state - const beforeTokenSupply = await grt.totalSupply() - const beforeDelegationPool = await staking.delegationPools(indexer1.address) - const beforeIndexer1Stake = await staking.getIndexerStakedTokens(indexer1.address) - - // Close allocation. At this point rewards should be collected for that indexer - await staking.connect(indexer1.signer).closeAllocation(allocationID, randomHexBytes()) - - // After state - const afterTokenSupply = await grt.totalSupply() - const afterDelegationPool = await staking.delegationPools(indexer1.address) - const afterIndexer1Stake = await staking.getIndexerStakedTokens(indexer1.address) - - // Check that rewards are put into indexer stake (only indexer cut) - // Check that rewards are put into delegators pool accordingly - // NOTE: calculated manually on a spreadsheet - const expectedIndexingRewards = toGRT('1454109066') - // Calculate delegators cut - const indexerRewards = delegationParams.indexingRewardCut - .mul(expectedIndexingRewards) - .div(toBN(MAX_PPM)) - // Calculate indexer cut - const delegatorsRewards = expectedIndexingRewards.sub(indexerRewards) - // Check - const expectedIndexerStake = beforeIndexer1Stake.add(indexerRewards) - const expectedDelegatorsPoolTokens = beforeDelegationPool.tokens.add(delegatorsRewards) - const expectedTokenSupply = beforeTokenSupply.add(expectedIndexingRewards) - expect(toRound(afterIndexer1Stake)).eq(toRound(expectedIndexerStake)) - expect(toRound(afterDelegationPool.tokens)).eq(toRound(expectedDelegatorsPoolTokens)) - // Check that tokens have been minted - expect(toRound(afterTokenSupply)).eq(toRound(expectedTokenSupply)) - }) - - it('should deny rewards if subgraph on denylist', async function () { - // Setup - await rewardsManager - .connect(governor.signer) - .setSubgraphAvailabilityOracle(governor.address) - await rewardsManager.connect(governor.signer).setDenied(subgraphDeploymentID1, true) - await setupIndexerAllocation() - - // Jump - await advanceBlocks(await epochManager.epochLength()) - - // Close allocation. At this point rewards should be collected for that indexer - const tx = staking.connect(indexer1.signer).closeAllocation(allocationID, randomHexBytes()) - await expect(tx) - .emit(rewardsManager, 'RewardsDenied') - .withArgs(indexer1.address, allocationID, await epochManager.currentEpoch()) - }) - }) - }) - - describe('pow', function () { - it('exponentiation works under normal boundaries (annual rate from 1% to 700%, 90 days period)', async function () { - const baseRatio = toGRT('0.000000004641377923') // 1% annual rate - const timePeriods = (60 * 60 * 24 * 10) / 15 // 90 days in blocks - for (let i = 0; i < 50; i = i + 4) { - const r = baseRatio.mul(i * 4).add(toGRT('1')) - const h = await rewardsManagerMock.pow(r, timePeriods, toGRT('1')) - console.log('\tr:', formatGRT(r), '=> c:', formatGRT(h)) - } - }) - }) - - describe('edge scenarios', function () { - it('close allocation on a subgraph that no longer have signal', async function () { - // Update total signalled - const signalled1 = toGRT('1500') - await curation.connect(curator1.signer).mint(subgraphDeploymentID1, signalled1, 0) - - // Allocate - const tokensToAllocate = toGRT('12500') - await staking.connect(indexer1.signer).stake(tokensToAllocate) - await staking - .connect(indexer1.signer) - .allocate( - subgraphDeploymentID1, - tokensToAllocate, - allocationID, - metadata, - await channelKey.generateProof(indexer1.address), - ) - - // Jump - await advanceBlocks(await epochManager.epochLength()) - - // Remove all signal from the subgraph - const curatorShares = await curation.getCuratorSignal(curator1.address, subgraphDeploymentID1) - await curation.connect(curator1.signer).burn(subgraphDeploymentID1, curatorShares, 0) - - // Close allocation. At this point rewards should be collected for that indexer - await staking.connect(indexer1.signer).closeAllocation(allocationID, randomHexBytes()) - }) - }) -}) diff --git a/test/serviceRegisty.test.ts b/test/serviceRegisty.test.ts deleted file mode 100644 index 726afa2f2..000000000 --- a/test/serviceRegisty.test.ts +++ /dev/null @@ -1,136 +0,0 @@ -import { expect } from 'chai' - -import { ServiceRegistry } from '../build/types/ServiceRegistry' -import { Staking } from '../build/types/Staking' - -import { getAccounts, Account } from './lib/testHelpers' -import { NetworkFixture } from './lib/fixtures' - -describe('ServiceRegistry', () => { - let governor: Account - let indexer: Account - let operator: Account - - let fixture: NetworkFixture - - let serviceRegistry: ServiceRegistry - let staking: Staking - - const shouldRegister = async (url: string, geohash: string) => { - // Register the indexer service - const tx = serviceRegistry.connect(indexer.signer).register(url, geohash) - await expect(tx) - .emit(serviceRegistry, 'ServiceRegistered') - .withArgs(indexer.address, url, geohash) - - // Updated state - const indexerService = await serviceRegistry.services(indexer.address) - expect(indexerService.url).eq(url) - expect(indexerService.geohash).eq(geohash) - } - - before(async function () { - ;[governor, indexer, operator] = await getAccounts() - - fixture = new NetworkFixture() - ;({ serviceRegistry, staking } = await fixture.load(governor.signer, governor.signer)) - }) - - beforeEach(async function () { - await fixture.setUp() - }) - - afterEach(async function () { - await fixture.tearDown() - }) - - describe('register', function () { - const url = 'https://192.168.2.1/' - const geo = '69y7hdrhm6mp' - - it('should allow registering', async function () { - await shouldRegister(url, geo) - }) - - it('should allow registering with a very long string', async function () { - const url = 'https://' + 'a'.repeat(125) + '.com' - await shouldRegister(url, geo) - }) - - it('should allow updating a registration', async function () { - const [url1, geohash1] = ['https://thegraph.com', '69y7hdrhm6mp'] - const [url2, geohash2] = ['https://192.168.0.1', 'dr5regw2z6y'] - await shouldRegister(url1, geohash1) - await shouldRegister(url2, geohash2) - }) - - it('reject registering empty URL', async function () { - const tx = serviceRegistry.connect(indexer.signer).register('', '') - await expect(tx).revertedWith('Service must specify a URL') - }) - - describe('operator', function () { - it('reject register from unauthorized operator', async function () { - const tx = serviceRegistry - .connect(operator.signer) - .registerFor(indexer.address, 'http://thegraph.com', '') - await expect(tx).revertedWith('!auth') - }) - - it('should register from operator', async function () { - // Auth and register - await staking.connect(indexer.signer).setOperator(operator.address, true) - await serviceRegistry.connect(operator.signer).registerFor(indexer.address, url, geo) - - // Updated state - const indexerService = await serviceRegistry.services(indexer.address) - expect(indexerService.url).eq(url) - expect(indexerService.geohash).eq(geo) - }) - }) - }) - - describe('unregister', function () { - const url = 'https://192.168.2.1/' - const geo = '69y7hdrhm6mp' - - it('should unregister existing registration', async function () { - // Register the indexer service - await serviceRegistry.connect(indexer.signer).register(url, geo) - - // Unregister the indexer service - const tx = serviceRegistry.connect(indexer.signer).unregister() - await expect(tx).emit(serviceRegistry, 'ServiceUnregistered').withArgs(indexer.address) - }) - - it('reject unregister non-existing registration', async function () { - const tx = serviceRegistry.connect(indexer.signer).unregister() - await expect(tx).revertedWith('Service already unregistered') - }) - - describe('operator', function () { - it('reject unregister from unauthorized operator', async function () { - // Register the indexer service - await serviceRegistry.connect(indexer.signer).register(url, geo) - - // Unregister - const tx = serviceRegistry.connect(operator.signer).unregisterFor(indexer.address) - await expect(tx).revertedWith('!auth') - }) - - it('should unregister from operator', async function () { - // Register the indexer service - await serviceRegistry.connect(indexer.signer).register(url, geo) - - // Auth and unregister - await staking.connect(indexer.signer).setOperator(operator.address, true) - await serviceRegistry.connect(operator.signer).unregisterFor(indexer.address) - - // Updated state - const indexerService = await serviceRegistry.services(indexer.address) - expect(indexerService.url).eq('') - expect(indexerService.geohash).eq('') - }) - }) - }) -}) diff --git a/test/staking/allocation.test.ts b/test/staking/allocation.test.ts deleted file mode 100644 index 962efa969..000000000 --- a/test/staking/allocation.test.ts +++ /dev/null @@ -1,894 +0,0 @@ -import { expect } from 'chai' -import { constants, BigNumber } from 'ethers' - -import { Curation } from '../../build/types/Curation' -import { EpochManager } from '../../build/types/EpochManager' -import { GraphToken } from '../../build/types/GraphToken' -import { Staking } from '../../build/types/Staking' - -import { NetworkFixture } from '../lib/fixtures' -import { - advanceToNextEpoch, - deriveChannelKey, - getAccounts, - randomHexBytes, - toBN, - toGRT, - Account, -} from '../lib/testHelpers' - -const { AddressZero, HashZero } = constants - -const MAX_PPM = toBN('1000000') - -enum AllocationState { - Null, - Active, - Closed, - Finalized, - Claimed, -} - -const calculateEffectiveAllocation = ( - tokens: BigNumber, - numEpochs: BigNumber, - maxAllocationEpochs: BigNumber, -) => { - const shouldCap = maxAllocationEpochs.gt(toBN('0')) && numEpochs.gt(maxAllocationEpochs) - return tokens.mul(shouldCap ? maxAllocationEpochs : numEpochs) -} - -describe('Staking:Allocation', () => { - let me: Account - let governor: Account - let indexer: Account - let slasher: Account - let assetHolder: Account - - let fixture: NetworkFixture - - let curation: Curation - let epochManager: EpochManager - let grt: GraphToken - let staking: Staking - - // Test values - const indexerTokens = toGRT('1000') - const tokensToStake = toGRT('100') - const tokensToAllocate = toGRT('100') - const tokensToCollect = toGRT('100') - const subgraphDeploymentID = randomHexBytes() - const channelKey = deriveChannelKey() - const allocationID = channelKey.address - const metadata = randomHexBytes(32) - const poi = randomHexBytes() - - // Helpers - const allocate = async (tokens: BigNumber) => { - return staking - .connect(indexer.signer) - .allocate( - subgraphDeploymentID, - tokens, - allocationID, - metadata, - await channelKey.generateProof(indexer.address), - ) - } - - before(async function () { - ;[me, governor, indexer, slasher, assetHolder] = await getAccounts() - - fixture = new NetworkFixture() - ;({ curation, epochManager, grt, staking } = await fixture.load( - governor.signer, - slasher.signer, - )) - - // Give some funds to the indexer and approve staking contract to use funds on indexer behalf - await grt.connect(governor.signer).mint(indexer.address, indexerTokens) - await grt.connect(indexer.signer).approve(staking.address, indexerTokens) - - // Allow the asset holder - await staking.connect(governor.signer).setAssetHolder(assetHolder.address, true) - }) - - beforeEach(async function () { - await fixture.setUp() - }) - - afterEach(async function () { - await fixture.tearDown() - }) - - describe('operators', function () { - it('should set operator', async function () { - // Before state - const beforeOperator = await staking.operatorAuth(indexer.address, me.address) - - // Set operator - const tx = staking.connect(indexer.signer).setOperator(me.address, true) - await expect(tx).emit(staking, 'SetOperator').withArgs(indexer.address, me.address, true) - - // After state - const afterOperator = await staking.operatorAuth(indexer.address, me.address) - - // State updated - expect(beforeOperator).eq(false) - expect(afterOperator).eq(true) - }) - - it('should unset operator', async function () { - await staking.connect(indexer.signer).setOperator(me.address, true) - - // Before state - const beforeOperator = await staking.operatorAuth(indexer.address, me.address) - - // Set operator - const tx = staking.connect(indexer.signer).setOperator(me.address, false) - await expect(tx).emit(staking, 'SetOperator').withArgs(indexer.address, me.address, false) - - // After state - const afterOperator = await staking.operatorAuth(indexer.address, me.address) - - // State updated - expect(beforeOperator).eq(true) - expect(afterOperator).eq(false) - }) - }) - - describe('rewardsDestination', function () { - it('should set rewards destination', async function () { - // Before state - const beforeDestination = await staking.rewardsDestination(indexer.address) - - // Set - const tx = staking.connect(indexer.signer).setRewardsDestination(me.address) - await expect(tx).emit(staking, 'SetRewardsDestination').withArgs(indexer.address, me.address) - - // After state - const afterDestination = await staking.rewardsDestination(indexer.address) - - // State updated - expect(beforeDestination).eq(AddressZero) - expect(afterDestination).eq(me.address) - - // Must be able to set back to zero - await staking.connect(indexer.signer).setRewardsDestination(AddressZero) - expect(await staking.rewardsDestination(indexer.address)).eq(AddressZero) - }) - }) - - /** - * Allocate - */ - describe('allocate', function () { - const shouldAllocate = async (tokensToAllocate: BigNumber) => { - // Before state - const beforeStake = await staking.stakes(indexer.address) - - // Allocate - const currentEpoch = await epochManager.currentEpoch() - const tx = allocate(tokensToAllocate) - await expect(tx) - .emit(staking, 'AllocationCreated') - .withArgs( - indexer.address, - subgraphDeploymentID, - currentEpoch, - tokensToAllocate, - allocationID, - metadata, - ) - - // After state - const afterStake = await staking.stakes(indexer.address) - const afterAlloc = await staking.getAllocation(allocationID) - - // Stake updated - expect(afterStake.tokensAllocated).eq(beforeStake.tokensAllocated.add(tokensToAllocate)) - // Allocation updated - expect(afterAlloc.indexer).eq(indexer.address) - expect(afterAlloc.subgraphDeploymentID).eq(subgraphDeploymentID) - expect(afterAlloc.tokens).eq(tokensToAllocate) - expect(afterAlloc.createdAtEpoch).eq(currentEpoch) - expect(afterAlloc.collectedFees).eq(toGRT('0')) - expect(afterAlloc.closedAtEpoch).eq(toBN('0')) - expect(afterAlloc.effectiveAllocation).eq(toGRT('0')) - } - - it('reject allocate zero tokens', async function () { - const zeroTokens = toGRT('0') - const tx = allocate(zeroTokens) - await expect(tx).revertedWith('!tokens') - }) - - it('reject allocate with invalid allocationID', async function () { - const tx = staking - .connect(indexer.signer) - .allocate(subgraphDeploymentID, tokensToAllocate, AddressZero, metadata, randomHexBytes(20)) - await expect(tx).revertedWith('!alloc') - }) - - it('reject allocate if no tokens staked', async function () { - const tokensOverCapacity = tokensToStake.add(toBN('1')) - const tx = allocate(tokensOverCapacity) - await expect(tx).revertedWith('!capacity') - }) - - context('> when staked', function () { - beforeEach(async function () { - await staking.connect(indexer.signer).stake(tokensToStake) - }) - - it('reject allocate more than available tokens', async function () { - const tokensOverCapacity = tokensToStake.add(toBN('1')) - const tx = allocate(tokensOverCapacity) - await expect(tx).revertedWith('!capacity') - }) - - it('should allocate', async function () { - await shouldAllocate(tokensToAllocate) - }) - - it('should allocate on behalf of indexer', async function () { - const proof = await channelKey.generateProof(indexer.address) - - // Reject to allocate if the address is not operator - const tx1 = staking - .connect(me.signer) - .allocateFrom( - indexer.address, - subgraphDeploymentID, - tokensToAllocate, - allocationID, - metadata, - proof, - ) - await expect(tx1).revertedWith('!auth') - - // Should allocate if given operator auth - await staking.connect(indexer.signer).setOperator(me.address, true) - await staking - .connect(me.signer) - .allocateFrom( - indexer.address, - subgraphDeploymentID, - tokensToAllocate, - allocationID, - metadata, - proof, - ) - }) - - it('reject allocate reusing an allocation ID', async function () { - const someTokensToAllocate = toGRT('10') - await shouldAllocate(someTokensToAllocate) - const tx = allocate(someTokensToAllocate) - await expect(tx).revertedWith('!null') - }) - - describe('reject allocate on invalid proof', function () { - it('invalid message', async function () { - const invalidProof = await channelKey.generateProof(randomHexBytes(20)) - const tx = staking - .connect(indexer.signer) - .allocate( - subgraphDeploymentID, - tokensToAllocate, - indexer.address, - metadata, - invalidProof, - ) - await expect(tx).revertedWith('!proof') - }) - - it('invalid proof signature format', async function () { - const tx = staking - .connect(indexer.signer) - .allocate( - subgraphDeploymentID, - tokensToAllocate, - indexer.address, - metadata, - randomHexBytes(32), - ) - await expect(tx).revertedWith('ECDSA: invalid signature length') - }) - }) - }) - }) - - /** - * Collect - */ - describe('collect', function () { - // This function tests collect with state updates - const shouldCollect = async (tokensToCollect: BigNumber) => { - // Before state - const beforeTokenSupply = await grt.totalSupply() - const beforePool = await curation.pools(subgraphDeploymentID) - const beforeAlloc = await staking.getAllocation(allocationID) - - // Advance blocks to get the allocation in epoch where it can be closed - await advanceToNextEpoch(epochManager) - - // Collect fees and calculate expected results - let rebateFees = tokensToCollect - const protocolPercentage = await staking.protocolPercentage() - const protocolFees = rebateFees.mul(protocolPercentage).div(MAX_PPM) - rebateFees = rebateFees.sub(protocolFees) - - const curationPercentage = await staking.curationPercentage() - const curationFees = rebateFees.mul(curationPercentage).div(MAX_PPM) - rebateFees = rebateFees.sub(curationFees) - - // Collect tokens from allocation - const tx = staking.connect(assetHolder.signer).collect(tokensToCollect, allocationID) - await expect(tx) - .emit(staking, 'AllocationCollected') - .withArgs( - indexer.address, - subgraphDeploymentID, - await epochManager.currentEpoch(), - tokensToCollect, - allocationID, - assetHolder.address, - curationFees, - rebateFees, - ) - - // After state - const afterTokenSupply = await grt.totalSupply() - const afterPool = await curation.pools(subgraphDeploymentID) - const afterAlloc = await staking.getAllocation(allocationID) - - // Check that protocol fees are burnt - expect(afterTokenSupply).eq(beforeTokenSupply.sub(protocolFees)) - // Check that curation reserves increased for the SubgraphDeployment - expect(afterPool.tokens).eq(beforePool.tokens.add(curationFees)) - // Verify allocation is updated and allocation cleaned - expect(afterAlloc.tokens).eq(beforeAlloc.tokens) - expect(afterAlloc.createdAtEpoch).eq(beforeAlloc.createdAtEpoch) - expect(afterAlloc.closedAtEpoch).eq(toBN('0')) - expect(afterAlloc.collectedFees).eq(beforeAlloc.collectedFees.add(rebateFees)) - } - - beforeEach(async function () { - // Create the allocation - await staking.connect(indexer.signer).stake(tokensToStake) - await allocate(tokensToAllocate) - - // Fund asset holder wallet - const tokensToFund = toGRT('100000') - await grt.connect(governor.signer).mint(assetHolder.address, tokensToFund) - await grt.connect(assetHolder.signer).approve(staking.address, tokensToFund) - }) - - it('reject collect if invalid collection', async function () { - const tx = staking.connect(indexer.signer).collect(tokensToCollect, AddressZero) - await expect(tx).revertedWith('!alloc') - }) - - it('reject collect if allocation does not exist', async function () { - const invalidAllocationID = randomHexBytes(20) - const tx = staking.connect(assetHolder.signer).collect(tokensToCollect, invalidAllocationID) - await expect(tx).revertedWith('!collect') - }) - - // NOTE: Disabled as part of deactivating the authorized sender requirement - // it('reject collect if caller not related to allocation', async function () { - // const tx = staking.connect(other.signer).collect(tokensToCollect, allocationID) - // await expect(tx).revertedWith('caller is not authorized') - // }) - - it('should collect funds from asset holder', async function () { - // Allow to collect from asset holder multiple times - await shouldCollect(tokensToCollect) - await shouldCollect(tokensToCollect) - await shouldCollect(tokensToCollect) - }) - - it('should collect funds from asset holder and distribute curation fees', async function () { - // Curate the subgraph from where we collect fees to get curation fees distributed - const tokensToSignal = toGRT('100') - await grt.connect(governor.signer).mint(me.address, tokensToSignal) - await grt.connect(me.signer).approve(curation.address, tokensToSignal) - await curation.connect(me.signer).mint(subgraphDeploymentID, tokensToSignal, 0) - - // Curation parameters - const curationPercentage = toBN('200000') // 20% - await staking.connect(governor.signer).setCurationPercentage(curationPercentage) - - // Collect - await shouldCollect(tokensToCollect) - }) - - it('should collect funds from asset holder + protocol fee + curation fees', async function () { - // Curate the subgraph from where we collect fees to get curation fees distributed - const tokensToSignal = toGRT('100') - await grt.connect(governor.signer).mint(me.address, tokensToSignal) - await grt.connect(me.signer).approve(curation.address, tokensToSignal) - await curation.connect(me.signer).mint(subgraphDeploymentID, tokensToSignal, 0) - - // Set a protocol fee percentage - const protocolPercentage = toBN('100000') // 10% - await staking.connect(governor.signer).setProtocolPercentage(protocolPercentage) - - // Set a curation fee percentage - const curationPercentage = toBN('200000') // 20% - await staking.connect(governor.signer).setCurationPercentage(curationPercentage) - - // Collect - await shouldCollect(tokensToCollect) - }) - - it('should collect zero tokens', async function () { - await shouldCollect(toGRT('0')) - }) - - it('should collect from a settling allocation but reject after dispute period', async function () { - // Set channel dispute period to one epoch - await staking.connect(governor.signer).setChannelDisputeEpochs(toBN('1')) - // Advance blocks to get the allocation in epoch where it can be closed - await advanceToNextEpoch(epochManager) - // Close the allocation - await staking.connect(indexer.signer).closeAllocation(allocationID, poi) - - // Collect fees into the allocation - const tx1 = staking.connect(assetHolder.signer).collect(tokensToCollect, allocationID) - await tx1 - - // Advance blocks to get allocation in epoch where it can no longer collect funds (finalized) - await advanceToNextEpoch(epochManager) - - // Before state - const beforeTotalSupply = await grt.totalSupply() - - // Revert if allocation is finalized - expect(await staking.getAllocationState(allocationID)).eq(AllocationState.Finalized) - const tx2 = staking.connect(assetHolder.signer).collect(tokensToCollect, allocationID) - await expect(tx2) - .emit(staking, 'AllocationCollected') - .withArgs( - indexer.address, - subgraphDeploymentID, - await epochManager.currentEpoch(), - tokensToCollect, - allocationID, - assetHolder.address, - 0, - 0, - ) - - // Check funds are effectively burned - const afterTotalSupply = await grt.totalSupply() - expect(afterTotalSupply).eq(beforeTotalSupply.sub(tokensToCollect)) - }) - }) - - /** - * Close allocation - */ - describe('closeAllocation', function () { - beforeEach(async function () { - // Stake and allocate - await staking.connect(indexer.signer).stake(tokensToStake) - await allocate(tokensToAllocate) - }) - - it('reject close a non-existing allocation', async function () { - const invalidAllocationID = randomHexBytes(20) - const tx = staking.connect(indexer.signer).closeAllocation(invalidAllocationID, poi) - await expect(tx).revertedWith('!active') - }) - - it('reject close before at least one epoch has passed', async function () { - const tx = staking.connect(indexer.signer).closeAllocation(allocationID, poi) - await expect(tx).revertedWith(' when allocation closed', function () { - beforeEach(async function () { - // Collect some funds - await staking.connect(assetHolder.signer).collect(tokensToCollect, allocationID) - - // Advance blocks to get the allocation in epoch where it can be closed - await advanceToNextEpoch(epochManager) - - // Close the allocation - await staking.connect(indexer.signer).closeAllocation(allocationID, poi) - }) - - it('reject claim if closed but channel dispute epochs has not passed', async function () { - expect(await staking.getAllocationState(allocationID)).eq(AllocationState.Closed) - const tx = staking.connect(indexer.signer).claim(allocationID, false) - await expect(tx).revertedWith('!finalized') - }) - - it('should claim rebate', async function () { - // Advance blocks to get the allocation finalized - await advanceToNextEpoch(epochManager) - - // Before state - const beforeIndexerTokens = await grt.balanceOf(indexer.address) - - // Claim with no restake - expect(await staking.getAllocationState(allocationID)).eq(AllocationState.Finalized) - await shouldClaim(allocationID, false) - - // Verify that the claimed tokens are transferred to the indexer - const afterIndexerTokens = await grt.balanceOf(indexer.address) - expect(afterIndexerTokens).eq(beforeIndexerTokens.add(tokensToCollect)) - }) - - it('should claim rebate with restake', async function () { - // Advance blocks to get the allocation finalized - await advanceToNextEpoch(epochManager) - - // Before state - const beforeIndexerStake = await staking.getIndexerStakedTokens(indexer.address) - - // Claim with restake - expect(await staking.getAllocationState(allocationID)).eq(AllocationState.Finalized) - await shouldClaim(allocationID, true) - - // Verify that the claimed tokens are restaked - const afterIndexerStake = await staking.getIndexerStakedTokens(indexer.address) - expect(afterIndexerStake).eq(beforeIndexerStake.add(tokensToCollect)) - }) - - it('should claim rebate (by public)', async function () { - // Advance blocks to get the allocation in epoch where it can be claimed - await advanceToNextEpoch(epochManager) - - // Should claim by public, but cannot restake - const beforeIndexerStake = await staking.stakes(indexer.address) - await staking.connect(me.signer).claim(allocationID, true) - const afterIndexerStake = await staking.stakes(indexer.address) - expect(afterIndexerStake.tokensStaked).eq(beforeIndexerStake.tokensStaked) - }) - - it('should claim rebate (by operator)', async function () { - // Advance blocks to get the allocation in epoch where it can be claimed - await advanceToNextEpoch(epochManager) - - // Add as operator - await staking.connect(indexer.signer).setOperator(me.address, true) - - // Should claim if given operator auth and can do restake - const beforeIndexerStake = await staking.stakes(indexer.address) - await staking.connect(me.signer).claim(allocationID, true) - const afterIndexerStake = await staking.stakes(indexer.address) - expect(afterIndexerStake.tokensStaked).not.eq(beforeIndexerStake.tokensStaked) - }) - - it('should claim many rebates with restake', async function () { - // Advance blocks to get the allocation in epoch where it can be claimed - await advanceToNextEpoch(epochManager) - - // Before state - const beforeIndexerStake = await staking.getIndexerStakedTokens(indexer.address) - - // Claim with restake - expect(await staking.getAllocationState(allocationID)).eq(AllocationState.Finalized) - await staking.connect(indexer.signer).claimMany([allocationID], true) - - // Verify that the claimed tokens are restaked - const afterIndexerStake = await staking.getIndexerStakedTokens(indexer.address) - expect(afterIndexerStake).eq(beforeIndexerStake.add(tokensToCollect)) - }) - - it('reject claim if already claimed', async function () { - // Advance blocks to get the allocation finalized - await advanceToNextEpoch(epochManager) - - // First claim - await shouldClaim(allocationID, false) - - // Try to claim again - expect(await staking.getAllocationState(allocationID)).eq(AllocationState.Claimed) - const tx = staking.connect(indexer.signer).claim(allocationID, false) - await expect(tx).revertedWith('!finalized') - }) - }) - }) -}) diff --git a/test/staking/configuration.test.ts b/test/staking/configuration.test.ts deleted file mode 100644 index 39ed30502..000000000 --- a/test/staking/configuration.test.ts +++ /dev/null @@ -1,231 +0,0 @@ -import { expect } from 'chai' -import { constants } from 'ethers' - -import { Staking } from '../../build/types/Staking' - -import { defaults } from '../lib/deployment' -import { NetworkFixture } from '../lib/fixtures' -import { getAccounts, toBN, toGRT, Account } from '../lib/testHelpers' - -const { AddressZero } = constants - -const MAX_PPM = toBN('1000000') - -describe('Staking:Config', () => { - let me: Account - let other: Account - let governor: Account - let slasher: Account - - let fixture: NetworkFixture - - let staking: Staking - - before(async function () { - ;[me, other, governor, slasher] = await getAccounts() - - fixture = new NetworkFixture() - ;({ staking } = await fixture.load(governor.signer, slasher.signer)) - }) - - beforeEach(async function () { - await fixture.setUp() - }) - - afterEach(async function () { - await fixture.tearDown() - }) - - describe('minimumIndexerStake', function () { - it('should set `minimumIndexerStake`', async function () { - const oldValue = defaults.staking.minimumIndexerStake - const newValue = toGRT('100') - - // Set right in the constructor - expect(await staking.minimumIndexerStake()).eq(oldValue) - - // Set new value - await staking.connect(governor.signer).setMinimumIndexerStake(newValue) - expect(await staking.minimumIndexerStake()).eq(newValue) - }) - - it('reject set `minimumIndexerStake` if not allowed', async function () { - const newValue = toGRT('100') - const tx = staking.connect(me.signer).setMinimumIndexerStake(newValue) - await expect(tx).revertedWith('Caller must be Controller governor') - }) - - it('reject set `minimumIndexerStake` to zero', async function () { - const tx = staking.connect(governor.signer).setMinimumIndexerStake(0) - await expect(tx).revertedWith('!minimumIndexerStake') - }) - }) - - describe('setSlasher', function () { - it('should set `slasher`', async function () { - expect(await staking.slashers(me.address)).eq(false) - - await staking.connect(governor.signer).setSlasher(me.address, true) - expect(await staking.slashers(me.address)).eq(true) - - await staking.connect(governor.signer).setSlasher(me.address, false) - expect(await staking.slashers(me.address)).eq(false) - }) - - it('reject set `slasher` if not allowed', async function () { - const tx = staking.connect(other.signer).setSlasher(me.address, true) - await expect(tx).revertedWith('Caller must be Controller governor') - }) - - it('reject set `slasher` for zero', async function () { - const tx = staking.connect(governor.signer).setSlasher(AddressZero, true) - await expect(tx).revertedWith('!slasher') - }) - }) - - describe('setAssetHolder', function () { - it('should set `assetHolder`', async function () { - expect(await staking.assetHolders(me.address)).eq(false) - - const tx1 = staking.connect(governor.signer).setAssetHolder(me.address, true) - await expect(tx1) - .emit(staking, 'AssetHolderUpdate') - .withArgs(governor.address, me.address, true) - expect(await staking.assetHolders(me.address)).eq(true) - - const tx2 = staking.connect(governor.signer).setAssetHolder(me.address, false) - await expect(tx2) - .emit(staking, 'AssetHolderUpdate') - .withArgs(governor.address, me.address, false) - await staking.connect(governor.signer).setAssetHolder(me.address, false) - expect(await staking.assetHolders(me.address)).eq(false) - }) - - it('reject set `assetHolder` if not allowed', async function () { - const tx = staking.connect(other.signer).setAssetHolder(me.address, true) - await expect(tx).revertedWith('Caller must be Controller governor') - }) - - it('reject set `assetHolder` to address zero', async function () { - const tx = staking.connect(governor.signer).setAssetHolder(AddressZero, true) - await expect(tx).revertedWith('!assetHolder') - }) - }) - - describe('channelDisputeEpochs', function () { - it('should set `channelDisputeEpochs`', async function () { - const newValue = toBN('5') - await staking.connect(governor.signer).setChannelDisputeEpochs(newValue) - expect(await staking.channelDisputeEpochs()).eq(newValue) - }) - - it('reject set `channelDisputeEpochs` if not allowed', async function () { - const newValue = toBN('5') - const tx = staking.connect(other.signer).setChannelDisputeEpochs(newValue) - await expect(tx).revertedWith('Caller must be Controller governor') - }) - - it('reject set `channelDisputeEpochs` to zero', async function () { - const tx = staking.connect(governor.signer).setChannelDisputeEpochs(0) - await expect(tx).revertedWith('!channelDisputeEpochs') - }) - }) - - describe('curationPercentage', function () { - it('should set `curationPercentage`', async function () { - const newValue = toBN('5') - await staking.connect(governor.signer).setCurationPercentage(newValue) - expect(await staking.curationPercentage()).eq(newValue) - }) - - it('reject set `curationPercentage` if out of bounds', async function () { - const newValue = MAX_PPM.add(toBN('1')) - const tx = staking.connect(governor.signer).setCurationPercentage(newValue) - await expect(tx).revertedWith('>percentage') - }) - - it('reject set `curationPercentage` if not allowed', async function () { - const tx = staking.connect(other.signer).setCurationPercentage(50) - await expect(tx).revertedWith('Caller must be Controller governor') - }) - }) - - describe('protocolPercentage', function () { - it('should set `protocolPercentage`', async function () { - for (const newValue of [toBN('0'), toBN('5'), MAX_PPM]) { - await staking.connect(governor.signer).setProtocolPercentage(newValue) - expect(await staking.protocolPercentage()).eq(newValue) - } - }) - - it('reject set `protocolPercentage` if out of bounds', async function () { - const newValue = MAX_PPM.add(toBN('1')) - const tx = staking.connect(governor.signer).setProtocolPercentage(newValue) - await expect(tx).revertedWith('>percentage') - }) - - it('reject set `protocolPercentage` if not allowed', async function () { - const tx = staking.connect(other.signer).setProtocolPercentage(50) - await expect(tx).revertedWith('Caller must be Controller governor') - }) - }) - - describe('maxAllocationEpochs', function () { - it('should set `maxAllocationEpochs`', async function () { - const newValue = toBN('5') - await staking.connect(governor.signer).setMaxAllocationEpochs(newValue) - expect(await staking.maxAllocationEpochs()).eq(newValue) - }) - - it('reject set `maxAllocationEpochs` if not allowed', async function () { - const newValue = toBN('5') - const tx = staking.connect(other.signer).setMaxAllocationEpochs(newValue) - await expect(tx).revertedWith('Caller must be Controller governor') - }) - }) - - describe('thawingPeriod', function () { - it('should set `thawingPeriod`', async function () { - const newValue = toBN('5') - await staking.connect(governor.signer).setThawingPeriod(newValue) - expect(await staking.thawingPeriod()).eq(newValue) - }) - - it('reject set `thawingPeriod` if not allowed', async function () { - const newValue = toBN('5') - const tx = staking.connect(other.signer).setThawingPeriod(newValue) - await expect(tx).revertedWith('Caller must be Controller governor') - }) - - it('reject set `thawingPeriod` to zero', async function () { - const tx = staking.connect(governor.signer).setThawingPeriod(0) - await expect(tx).revertedWith('!thawingPeriod') - }) - }) - - describe('rebateRatio', function () { - it('should be setup on init', async function () { - expect(await staking.alphaNumerator()).eq(toBN(85)) - expect(await staking.alphaDenominator()).eq(toBN(100)) - }) - - it('should set `rebateRatio`', async function () { - await staking.connect(governor.signer).setRebateRatio(5, 6) - expect(await staking.alphaNumerator()).eq(toBN(5)) - expect(await staking.alphaDenominator()).eq(toBN(6)) - }) - - it('reject set `rebateRatio` if out of bounds', async function () { - const tx1 = staking.connect(governor.signer).setRebateRatio(0, 1) - await expect(tx1).revertedWith('!alpha') - - const tx2 = staking.connect(governor.signer).setRebateRatio(1, 0) - await expect(tx2).revertedWith('!alpha') - }) - - it('reject set `rebateRatio` if not allowed', async function () { - const tx = staking.connect(other.signer).setRebateRatio(1, 1) - await expect(tx).revertedWith('Caller must be Controller governor') - }) - }) -}) diff --git a/test/staking/delegation.test.ts b/test/staking/delegation.test.ts deleted file mode 100644 index 15dd64181..000000000 --- a/test/staking/delegation.test.ts +++ /dev/null @@ -1,653 +0,0 @@ -import { expect } from 'chai' -import { constants, BigNumber } from 'ethers' - -import { EpochManager } from '../../build/types/EpochManager' -import { GraphToken } from '../../build/types/GraphToken' -import { Staking } from '../../build/types/Staking' - -import { NetworkFixture } from '../lib/fixtures' -import { - advanceToNextEpoch, - deriveChannelKey, - getAccounts, - latestBlock, - randomHexBytes, - toGRT, - toBN, - Account, - advanceBlock, -} from '../lib/testHelpers' - -const { AddressZero, HashZero } = constants -const MAX_PPM = toBN('1000000') -const percentageOf = (ppm: BigNumber, value): BigNumber => value.sub(ppm.mul(value).div(MAX_PPM)) - -describe('Staking::Delegation', () => { - let me: Account - let delegator: Account - let delegator2: Account - let governor: Account - let indexer: Account - let indexer2: Account - let assetHolder: Account - - let fixture: NetworkFixture - - let epochManager: EpochManager - let grt: GraphToken - let staking: Staking - - // Test values - const poi = randomHexBytes() - const metadata = HashZero - - async function shouldDelegate(sender: Account, tokens: BigNumber) { - // Before state - const beforeTotalSupply = await grt.totalSupply() - const beforePool = await staking.delegationPools(indexer.address) - const beforeDelegation = await staking.getDelegation(indexer.address, sender.address) - const beforeShares = beforeDelegation.shares - const beforeTokens = beforePool.shares.gt(0) - ? beforeShares.mul(beforePool.tokens).div(beforePool.shares) - : toBN(0) - - // Get current delegation tax percentage for deposits - const delegationTaxPercentage = BigNumber.from(await staking.delegationTaxPercentage()) - const delegationTax = delegationTaxPercentage.mul(tokens).div(MAX_PPM) - const delegatedTokens = tokens.sub(delegationTax) - - // Calculate shares to receive - const shares = beforePool.tokens.eq(toBN('0')) - ? delegatedTokens - : delegatedTokens.mul(beforePool.tokens).div(beforePool.shares) - - // Delegate - const tx = staking.connect(sender.signer).delegate(indexer.address, tokens) - await expect(tx) - .emit(staking, 'StakeDelegated') - .withArgs(indexer.address, sender.address, delegatedTokens, shares) - - // After state - const afterTotalSupply = await grt.totalSupply() - const afterPool = await staking.delegationPools(indexer.address) - const afterDelegation = await staking.getDelegation(indexer.address, sender.address) - const afterShares = afterDelegation.shares - const afterTokens = afterPool.shares.gt(0) - ? afterShares.mul(afterPool.tokens).div(afterPool.shares) - : toBN(0) - - // State updated - expect(afterPool.tokens).eq(beforePool.tokens.add(delegatedTokens)) - expect(afterPool.shares).eq(beforePool.shares.add(shares)) - expect(afterShares).eq(beforeShares.add(shares)) - expect(afterTokens).eq(beforeTokens.add(delegatedTokens)) - expect(afterTotalSupply).eq(beforeTotalSupply.sub(delegationTax)) - } - - async function shouldUndelegate(sender: Account, shares: BigNumber) { - // Before state - const beforePool = await staking.delegationPools(indexer.address) - const beforeDelegation = await staking.getDelegation(indexer.address, sender.address) - const beforeShares = beforeDelegation.shares - const beforeTokens = beforePool.shares.gt(0) - ? beforeShares.mul(beforePool.tokens).div(beforePool.shares) - : toBN(0) - const beforeDelegatorBalance = await grt.balanceOf(sender.address) - const tokensToWithdraw = await staking.getWithdraweableDelegatedTokens(beforeDelegation) - - // Calculate tokens to receive - const tokens = shares.mul(beforePool.shares).div(beforePool.tokens) - - // Undelegate - const currentEpoch = await epochManager.currentEpoch() - const delegationUnbondingPeriod = await staking.delegationUnbondingPeriod() - const tokensLockedUntil = currentEpoch.add(delegationUnbondingPeriod) - - const tx = staking.connect(sender.signer).undelegate(indexer.address, shares) - await expect(tx) - .emit(staking, 'StakeDelegatedLocked') - .withArgs(indexer.address, sender.address, tokens, shares, tokensLockedUntil) - - // After state - const afterPool = await staking.delegationPools(indexer.address) - const afterDelegation = await staking.getDelegation(indexer.address, sender.address) - const afterShares = afterDelegation.shares - const afterTokens = afterPool.shares.gt(0) - ? afterShares.mul(afterPool.tokens).div(afterPool.shares) - : toBN(0) - const afterDelegatorBalance = await grt.balanceOf(sender.address) - - // State updated - expect(afterPool.tokens).eq(beforePool.tokens.sub(tokens)) - expect(afterPool.shares).eq(beforePool.shares.sub(shares)) - expect(afterShares).eq(beforeShares.sub(shares)) - expect(afterTokens).eq(beforeTokens.sub(tokens)) - - // Undelegated funds must be put on lock - expect(afterDelegation.tokensLocked).eq( - beforeDelegation.tokensLocked.add(tokens).sub(tokensToWithdraw), - ) - expect(afterDelegation.tokensLockedUntil).eq(tokensLockedUntil) - // Delegator see balance increased only if there were tokens to withdraw - expect(afterDelegatorBalance).eq(beforeDelegatorBalance.add(tokensToWithdraw)) - } - - async function shouldWithdrawDelegated(sender: Account, redelegateTo: string, tokens: BigNumber) { - // Before state - const beforePool = await staking.delegationPools(indexer2.address) - const beforeDelegation = await staking.getDelegation(indexer2.address, sender.address) - const beforeShares = beforeDelegation.shares - const beforeTokens = beforePool.shares.gt(0) - ? beforeShares.mul(beforePool.tokens).div(beforePool.shares) - : toBN(0) - const beforeBalance = await grt.balanceOf(delegator.address) - - // Calculate shares to receive - const shares = beforePool.tokens.eq(toBN('0')) - ? tokens - : tokens.mul(beforePool.tokens).div(beforePool.shares) - - // Withdraw - const tx = staking.connect(delegator.signer).withdrawDelegated(indexer.address, redelegateTo) - await expect(tx) - .emit(staking, 'StakeDelegatedWithdrawn') - .withArgs(indexer.address, delegator.address, tokens) - - // After state - const afterPool = await staking.delegationPools(indexer2.address) - const afterDelegation = await staking.getDelegation(indexer2.address, sender.address) - const afterShares = afterDelegation.shares - const afterTokens = afterPool.shares.gt(0) - ? afterShares.mul(afterPool.tokens).div(afterPool.shares) - : toBN(0) - const afterBalance = await grt.balanceOf(delegator.address) - - // State updated - expect(afterDelegation.tokensLocked).eq(toGRT('0')) - expect(afterDelegation.tokensLockedUntil).eq(toBN('0')) - // Redelegation vs transfer - if (redelegateTo === AddressZero) { - expect(afterBalance).eq(beforeBalance.add(tokens)) - } else { - expect(afterBalance).eq(beforeBalance) - expect(afterPool.tokens).eq(beforePool.tokens.add(tokens)) - expect(afterPool.shares).eq(beforePool.shares.add(shares)) - expect(afterShares).eq(beforeShares.add(shares)) - expect(afterTokens).eq(beforeTokens.add(tokens)) - } - } - - before(async function () { - ;[me, delegator, delegator2, governor, indexer, indexer2, assetHolder] = await getAccounts() - - fixture = new NetworkFixture() - ;({ epochManager, grt, staking } = await fixture.load(governor.signer)) - - // Distribute test funds - for (const wallet of [delegator, delegator2]) { - await grt.connect(governor.signer).mint(wallet.address, toGRT('10000000000000000000')) - await grt.connect(wallet.signer).approve(staking.address, toGRT('10000000000000000000')) - } - - // Distribute test funds - for (const wallet of [me, indexer, indexer2, assetHolder]) { - await grt.connect(governor.signer).mint(wallet.address, toGRT('1000000')) - await grt.connect(wallet.signer).approve(staking.address, toGRT('1000000')) - } - - // Allow the asset holder - await staking.connect(governor.signer).setAssetHolder(assetHolder.address, true) - }) - - beforeEach(async function () { - await fixture.setUp() - }) - - afterEach(async function () { - await fixture.tearDown() - }) - - describe('configuration', function () { - describe('delegationRatio', function () { - const delegationRatio = 5 - - it('should set `delegationRatio`', async function () { - await staking.connect(governor.signer).setDelegationRatio(delegationRatio) - expect(await staking.delegationRatio()).eq(delegationRatio) - }) - - it('reject set `delegationRatio` if not allowed', async function () { - const tx = staking.connect(me.signer).setDelegationRatio(delegationRatio) - await expect(tx).revertedWith('Caller must be Controller governor') - }) - }) - - describe('delegationParametersCooldown', function () { - const cooldown = 5 - - it('should set `delegationParametersCooldown`', async function () { - await staking.connect(governor.signer).setDelegationParametersCooldown(cooldown) - expect(await staking.delegationParametersCooldown()).eq(cooldown) - }) - - it('reject set `delegationParametersCooldown` if not allowed', async function () { - const tx = staking.connect(me.signer).setDelegationParametersCooldown(cooldown) - await expect(tx).revertedWith('Caller must be Controller governor') - }) - }) - - describe('delegationTaxPercentage', function () { - it('should set `delegationTaxPercentage`', async function () { - for (const newValue of [toBN('0'), toBN('5'), MAX_PPM]) { - await staking.connect(governor.signer).setDelegationTaxPercentage(newValue) - expect(await staking.delegationTaxPercentage()).eq(newValue) - } - }) - - it('reject set `delegationTaxPercentage` if out of bounds', async function () { - const newValue = MAX_PPM.add(toBN('1')) - const tx = staking.connect(governor.signer).setDelegationTaxPercentage(newValue) - await expect(tx).revertedWith('>percentage') - }) - - it('reject set `delegationTaxPercentage` if not allowed', async function () { - const tx = staking.connect(me.signer).setDelegationTaxPercentage(50) - await expect(tx).revertedWith('Caller must be Controller governor') - }) - }) - - describe('delegationParameters', function () { - const indexingRewardCut = toBN('50000') - const queryFeeCut = toBN('80000') - const cooldownBlocks = 5 - - it('reject to set if under cooldown period', async function () { - // Set parameters - await staking - .connect(indexer.signer) - .setDelegationParameters(indexingRewardCut, queryFeeCut, cooldownBlocks) - - // Try to set before cooldown period passed - const tx = staking - .connect(indexer.signer) - .setDelegationParameters(indexingRewardCut, queryFeeCut, cooldownBlocks) - await expect(tx).revertedWith('!cooldown') - }) - - it('reject to set if cooldown below the global configuration', async function () { - // Set global cooldown parameter - await staking.connect(governor.signer).setDelegationParametersCooldown(cooldownBlocks) - - // Try to set delegation cooldown below global cooldown parameter - const tx = staking - .connect(indexer.signer) - .setDelegationParameters(indexingRewardCut, queryFeeCut, cooldownBlocks - 1) - await expect(tx).revertedWith('indexingRewardCut') - - // Query fee out of bounds - const tx2 = staking - .connect(indexer.signer) - .setDelegationParameters(indexingRewardCut, MAX_PPM.add('1'), cooldownBlocks) - await expect(tx2).revertedWith('>queryFeeCut') - }) - - it('should set parameters', async function () { - // Set parameters - const tx = staking - .connect(indexer.signer) - .setDelegationParameters(indexingRewardCut, queryFeeCut, cooldownBlocks) - await expect(tx) - .emit(staking, 'DelegationParametersUpdated') - .withArgs(indexer.address, indexingRewardCut, queryFeeCut, cooldownBlocks) - - // State updated - const params = await staking.delegationPools(indexer.address) - expect(params.indexingRewardCut).eq(indexingRewardCut) - expect(params.queryFeeCut).eq(queryFeeCut) - expect(params.cooldownBlocks).eq(cooldownBlocks) - expect(params.updatedAtBlock).eq(await latestBlock()) - }) - - it('should init delegation parameters on first stake', async function () { - // Before - const beforeParams = await staking.delegationPools(indexer.address) - expect(beforeParams.indexingRewardCut).eq(0) - expect(beforeParams.queryFeeCut).eq(0) - expect(beforeParams.cooldownBlocks).eq(0) - expect(beforeParams.updatedAtBlock).eq(0) - - // Indexer stake tokens - const tx = staking.connect(indexer.signer).stake(toGRT('200')) - await expect(tx) - .emit(staking, 'DelegationParametersUpdated') - .withArgs(indexer.address, MAX_PPM, MAX_PPM, 0) - - // State updated - const afterParams = await staking.delegationPools(indexer.address) - expect(afterParams.indexingRewardCut).eq(MAX_PPM) - expect(afterParams.queryFeeCut).eq(MAX_PPM) - expect(afterParams.cooldownBlocks).eq(0) - expect(afterParams.updatedAtBlock).eq(await latestBlock()) - }) - - it('should init delegation parameters on first stake using stakeTo()', async function () { - // Before - const beforeParams = await staking.delegationPools(indexer.address) - expect(beforeParams.indexingRewardCut).eq(0) - expect(beforeParams.queryFeeCut).eq(0) - expect(beforeParams.cooldownBlocks).eq(0) - expect(beforeParams.updatedAtBlock).eq(0) - - // Indexer stake tokens - const tx = staking.connect(me.signer).stakeTo(indexer.address, toGRT('200')) - await expect(tx) - .emit(staking, 'DelegationParametersUpdated') - .withArgs(indexer.address, MAX_PPM, MAX_PPM, 0) - - // State updated - const afterParams = await staking.delegationPools(indexer.address) - expect(afterParams.indexingRewardCut).eq(MAX_PPM) - expect(afterParams.queryFeeCut).eq(MAX_PPM) - expect(afterParams.cooldownBlocks).eq(0) - expect(afterParams.updatedAtBlock).eq(await latestBlock()) - }) - }) - }) - - describe('lifecycle', function () { - beforeEach(async function () { - // Stake some funds as indexer - await staking.connect(indexer.signer).stake(toGRT('1000')) - }) - - describe('delegate', function () { - it('reject delegate with zero tokens', async function () { - const tokensToDelegate = toGRT('0') - const tx = staking.connect(delegator.signer).delegate(indexer.address, tokensToDelegate) - await expect(tx).revertedWith('!tokens') - }) - - it('reject delegate to empty address', async function () { - const tokensToDelegate = toGRT('100') - const tx = staking.connect(delegator.signer).delegate(AddressZero, tokensToDelegate) - await expect(tx).revertedWith('!indexer') - }) - - it('reject delegate to non-staked indexer', async function () { - const tokensToDelegate = toGRT('100') - const tx = staking.connect(delegator.signer).delegate(me.address, tokensToDelegate) - await expect(tx).revertedWith('!stake') - }) - - it('should delegate tokens and account shares proportionally', async function () { - // Multiple delegations should work - await shouldDelegate(delegator, toGRT('1234')) - await shouldDelegate(delegator, toGRT('100')) - await shouldDelegate(delegator, toGRT('50')) - await shouldDelegate(delegator, toGRT('25')) - await shouldDelegate(delegator, toGRT('10')) - await shouldDelegate(delegator, toGRT('1')) - - // Delegation by other delegator - await shouldDelegate(delegator2, toGRT('5000')) - }) - - it('should delegate a high number of tokens', async function () { - await shouldDelegate(delegator, toGRT('100')) - await shouldDelegate(delegator, toGRT('1000000000000000000')) - }) - - describe('delegation tax', function () { - it('should delegate and burn delegation deposit tax (0.0001%)', async function () { - await staking.setDelegationTaxPercentage(1) - await shouldDelegate(delegator, toGRT('10000000')) - }) - - it('should delegate and burn delegation deposit tax (1%)', async function () { - await staking.setDelegationTaxPercentage(10000) - await shouldDelegate(delegator, toGRT('10000000')) - }) - - it('should delegate and burn delegation deposit tax (100%)', async function () { - await staking.setDelegationTaxPercentage(1000000) - await shouldDelegate(delegator, toGRT('10000000')) - }) - }) - }) - - describe('undelegate', function () { - it('reject to undelegate zero shares', async function () { - const tx = staking.connect(delegator.signer).undelegate(indexer.address, toGRT('0')) - await expect(tx).revertedWith('!shares') - }) - - it('reject to undelegate more shares than owned', async function () { - const tx = staking.connect(delegator.signer).undelegate(indexer.address, toGRT('100')) - await expect(tx).revertedWith('!shares-avail') - }) - - it('should exchange delegation pool shares for tokens', async function () { - const tokens = toGRT('100') - - // Have two parties that delegated tokens to the same indexer - await shouldDelegate(delegator, tokens) - await shouldDelegate(delegator2, tokens) - - // Delegate half of the delegated funds - await shouldUndelegate(delegator, tokens.div(toBN('2'))) - }) - - it('should undelegate properly when multiple delegations', async function () { - // Use long enough epochs to avoid jumping to the next epoch involuntarily on our test - await epochManager.setEpochLength(toBN((60 * 60) / 15)) - - await shouldDelegate(delegator, toGRT('1234')) - await shouldDelegate(delegator, toGRT('100')) - await shouldDelegate(delegator, toGRT('50')) - await shouldDelegate(delegator2, toGRT('50')) - - await shouldUndelegate(delegator, toGRT('1')) - await shouldUndelegate(delegator2, toGRT('50')) - await advanceToNextEpoch(epochManager) - await shouldUndelegate(delegator, toGRT('25')) - }) - - it('should undelegate and withdraw freed tokens from unbonding period', async function () { - await staking.setDelegationUnbondingPeriod('2') - await shouldDelegate(delegator, toGRT('100')) - await shouldUndelegate(delegator, toGRT('50')) - await advanceBlock() - await advanceToNextEpoch(epochManager) // epoch 1 - await advanceToNextEpoch(epochManager) // epoch 2 - await shouldUndelegate(delegator, toGRT('10')) - }) - }) - - describe('withdraw', function () { - it('reject withdraw if no funds available', async function () { - const tx = staking.connect(delegator.signer).withdrawDelegated(indexer.address, AddressZero) - await expect(tx).revertedWith('!tokens') - }) - - it('reject withdraw before unbonding period', async function () { - await staking.setDelegationUnbondingPeriod('2') - await shouldDelegate(delegator, toGRT('1000')) - await shouldUndelegate(delegator, toGRT('100')) - - // Withdraw - const tx = staking.connect(delegator.signer).withdrawDelegated(indexer.address, AddressZero) - await expect(tx).revertedWith('!tokens') - }) - - it('should withdraw after waiting an unbonding period', async function () { - const tokensToWithdraw = toGRT('100') - - // Setup - await staking.setDelegationUnbondingPeriod('2') - await shouldDelegate(delegator, toGRT('1000')) - await shouldUndelegate(delegator, tokensToWithdraw) - await advanceToNextEpoch(epochManager) // epoch 1 - await advanceToNextEpoch(epochManager) // epoch 2 - - // Withdraw - await shouldWithdrawDelegated(delegator, AddressZero, tokensToWithdraw) - }) - - it('should withdraw after waiting an unbonding period (with redelegation)', async function () { - const tokensToWithdraw = toGRT('100') - - // Setup - await staking.setDelegationUnbondingPeriod('2') - await shouldDelegate(delegator, toGRT('1000')) - await shouldUndelegate(delegator, tokensToWithdraw) - await advanceToNextEpoch(epochManager) // epoch 1 - await advanceToNextEpoch(epochManager) // epoch 2 - - // We stake on indexer2 so the delegator is able to re-delegate to it - // if we didn't do it, it will revert because of indexer2 not havings stake - await staking.connect(indexer2.signer).stake(toGRT('1000')) - // Withdraw - await shouldWithdrawDelegated(delegator, indexer2.address, tokensToWithdraw) - }) - }) - }) - - describe('use of delegated funds', function () { - // Test values - const tokensToStake = toGRT('200') - const tokensToAllocate = toGRT('2000') - const tokensToCollect = toGRT('500') - const tokensToDelegate = toGRT('1800') - const subgraphDeploymentID = randomHexBytes() - const channelKey = deriveChannelKey() - const allocationID = channelKey.address - - const setupAllocation = async (tokens: BigNumber) => { - return staking - .connect(indexer.signer) - .allocate( - subgraphDeploymentID, - tokens, - allocationID, - metadata, - await channelKey.generateProof(indexer.address), - ) - } - - beforeEach(async function () { - // Indexer stake tokens - await staking.connect(indexer.signer).stake(tokensToStake) - }) - - it('revert allocate when capacity is not enough', async function () { - // 1:2 delegation capacity - await staking.connect(governor.signer).setDelegationRatio(2) - - // Delegate - await staking.connect(delegator.signer).delegate(indexer.address, tokensToDelegate) - - // Staked: 200 - // Delegated: 1800 - // Capacity: 200 + min(200*2, 1800) = 600 - const tx = setupAllocation(tokensToAllocate) - await expect(tx).revertedWith('!capacity') - }) - - it('should allocate using full delegation capacity', async function () { - // 1:10 delegation capacity - await staking.connect(governor.signer).setDelegationRatio(10) - - // Delegate - await staking.connect(delegator.signer).delegate(indexer.address, tokensToDelegate) - - // Staked: 200 - // Delegated: 1800 - // Capacity: 200 + min(200*10, 1800) = 2000 - await setupAllocation(tokensToAllocate) - - // State updated - const alloc = await staking.getAllocation(allocationID) - expect(alloc.tokens).eq(tokensToAllocate) - }) - - it('should account delegation for indexer capacity properly', async function () { - // 1:10 delegation capacity - await staking.connect(governor.signer).setDelegationRatio(10) - - // Delegate - await staking.connect(delegator.signer).delegate(indexer.address, tokensToDelegate) - - // If we unstake all, the indexer capacity should go to zero - // Should not be able to use delegated tokens - await staking.connect(indexer.signer).unstake(tokensToStake) - expect(await staking.getIndexerCapacity(indexer.address)).eq(0) - }) - - it('should send delegation cut of query fees to delegation pool', async function () { - // 1:10 delegation capacity - await staking.connect(governor.signer).setDelegationRatio(10) - - // Set delegation rules for the indexer - const indexingRewardCut = toBN('800000') // indexer keep 80% - const queryFeeCut = toBN('950000') // indexer keeps 95% - const cooldownBlocks = 5 - await staking - .connect(indexer.signer) - .setDelegationParameters(indexingRewardCut, queryFeeCut, cooldownBlocks) - - // Delegate - await staking.connect(delegator.signer).delegate(indexer.address, tokensToDelegate) - - // Prepare allocation - await setupAllocation(tokensToAllocate) - - // Collect some funds - await staking.connect(assetHolder.signer).collect(tokensToCollect, allocationID) - - // Advance blocks to get the channel in epoch where it can be closed - await advanceToNextEpoch(epochManager) - - // Close allocation - await staking.connect(indexer.signer).closeAllocation(allocationID, poi) - - // Advance blocks to get the channel in epoch where it can be claimed - await advanceToNextEpoch(epochManager) - - // Delegation pool before allocation closed - const beforeDelegationPool = await staking.delegationPools(indexer.address) - - // Calculate tokens to claim and expected delegation fees - const beforeAlloc = await staking.getAllocation(allocationID) - const delegationFees = percentageOf(queryFeeCut, beforeAlloc.collectedFees) - const tokensToClaim = beforeAlloc.collectedFees.sub(delegationFees) - - // Claim from rebate pool - const currentEpoch = await epochManager.currentEpoch() - const tx = staking.connect(indexer.signer).claim(allocationID, true) - await expect(tx) - .emit(staking, 'RebateClaimed') - .withArgs( - indexer.address, - subgraphDeploymentID, - allocationID, - currentEpoch, - beforeAlloc.closedAtEpoch, - tokensToClaim, - toBN('0'), - delegationFees, - ) - - // State updated - const afterDelegationPool = await staking.delegationPools(indexer.address) - expect(afterDelegationPool.tokens).eq(beforeDelegationPool.tokens.add(delegationFees)) - }) - }) -}) diff --git a/test/staking/rebate.test.ts b/test/staking/rebate.test.ts deleted file mode 100644 index 416992716..000000000 --- a/test/staking/rebate.test.ts +++ /dev/null @@ -1,225 +0,0 @@ -import { expect } from 'chai' -import { BigNumber } from 'ethers' - -import { deployContract } from '../lib/deployment' -import { RebatePoolMock } from '../../build/types/RebatePoolMock' - -import { getAccounts, toBN, toGRT, formatGRT, Account } from '../lib/testHelpers' - -const toFloat = (n: BigNumber) => parseFloat(formatGRT(n)) -const toFixed = (n: number | BigNumber, precision = 12) => { - if (typeof n === 'number') { - return n.toFixed(precision) - } - return toFloat(n).toFixed(precision) -} - -type RebateRatio = number[] - -interface RebateTestCase { - totalRewards: number - fees: number - totalFees: number - stake: number - totalStake: number -} - -describe('Staking:Rebate', () => { - let deployer: Account - - let rebatePoolMock: RebatePoolMock - - const testCases: RebateTestCase[] = [ - { totalRewards: 1400, fees: 100, totalFees: 1400, stake: 5000, totalStake: 7300 }, - { totalRewards: 1400, fees: 300, totalFees: 1400, stake: 600, totalStake: 7300 }, - { totalRewards: 1400, fees: 1000, totalFees: 1400, stake: 500, totalStake: 7300 }, - { totalRewards: 1400, fees: 0, totalFees: 1400, stake: 1200, totalStake: 7300 }, - ] - - // Edge case #1 - No closed allocations any query fees - const edgeCases1: RebateTestCase[] = [ - { totalRewards: 0, fees: 0, totalFees: 0, stake: 5000, totalStake: 7300 }, - { totalRewards: 0, fees: 0, totalFees: 0, stake: 600, totalStake: 7300 }, - { totalRewards: 0, fees: 0, totalFees: 0, stake: 500, totalStake: 7300 }, - { totalRewards: 0, fees: 0, totalFees: 0, stake: 1200, totalStake: 7300 }, - ] - - // This function calculates the Cobb-Douglas formula in Typescript so we can compare against - // the Solidity implementation - // TODO: consider using bignumber.js to get extra precision - function cobbDouglas( - totalRewards: number, - fees: number, - totalFees: number, - stake: number, - totalStake: number, - alphaNumerator: number, - alphaDenominator: number, - ) { - if (totalFees === 0) { - return 0 - } - const feeRatio = fees / totalFees - const stakeRatio = stake / totalStake - const alpha = alphaNumerator / alphaDenominator - return totalRewards * feeRatio ** alpha * stakeRatio ** (1 - alpha) - } - - // Test if the Solidity implementation of the rebate formula match the local implementation - async function shouldMatchFormulas(testCases: RebateTestCase[], alpha: RebateRatio) { - const [alphaNumerator, alphaDenominator] = alpha - - for (const testCase of testCases) { - // Test Typescript cobb-doubglas formula implementation - const r1 = cobbDouglas( - testCase.totalRewards, - testCase.fees, - testCase.totalFees, - testCase.stake, - testCase.totalStake, - alphaNumerator, - alphaDenominator, - ) - // Convert non-alpha values to wei before sending for precision - const r2 = await rebatePoolMock.cobbDouglas( - toGRT(testCase.totalRewards), - toGRT(testCase.fees), - toGRT(testCase.totalFees), - toGRT(testCase.stake), - toGRT(testCase.totalStake), - alphaNumerator, - alphaDenominator, - ) - - // Must match : contracts to local implementation - expect(toFixed(r1)).eq(toFixed(r2)) - } - } - - // Test if the fees deposited into the rebate pool are conserved, this means that we are - // not able to extract more rewards than we initially deposited - async function shouldConserveBalances(testCases: RebateTestCase[], alpha: RebateRatio) { - const [alphaNumerator, alphaDenominator] = alpha - await rebatePoolMock.setRebateRatio(alphaNumerator, alphaDenominator) - - let totalFees = toBN(0) - for (const testCase of testCases) { - totalFees = totalFees.add(toGRT(testCase.fees)) - await rebatePoolMock.add(toGRT(testCase.fees), toGRT(testCase.stake)) - } - - let totalRewards = toBN(0) - for (const testCase of testCases) { - const rewards = await redeem(toGRT(testCase.fees), toGRT(testCase.stake)) - totalRewards = totalRewards.add(rewards) - } - - expect(totalRewards).lte(totalFees) - } - - async function shouldMatchOut(testCases: RebateTestCase[], alpha: RebateRatio) { - const [alphaNumerator, alphaDenominator] = alpha - await rebatePoolMock.setRebateRatio(alphaNumerator, alphaDenominator) - - let totalFees = toBN(0) - for (const testCase of testCases) { - totalFees = totalFees.add(toGRT(testCase.fees)) - await rebatePoolMock.add(toGRT(testCase.fees), toGRT(testCase.stake)) - } - - for (const testCase of testCases) { - const rebatePool = await rebatePoolMock.rebatePool() - const unclaimedFees = rebatePool.fees.sub(rebatePool.claimedRewards) - const rewards = await redeem(toGRT(testCase.fees), toGRT(testCase.stake)) - let expectedOut = await rebatePoolMock.cobbDouglas( - toGRT(testCase.totalRewards), - toGRT(testCase.fees), - toGRT(testCase.totalFees), - toGRT(testCase.stake), - toGRT(testCase.totalStake), - alphaNumerator, - alphaDenominator, - ) - if (expectedOut.gt(unclaimedFees)) { - expectedOut = unclaimedFees - } - expect(rewards).eq(expectedOut) - } - } - - async function redeem(fees: BigNumber, stake: BigNumber): Promise { - const tx = await rebatePoolMock.pop(fees, stake) - const rx = await tx.wait() - return rx.events[0].args[0] - } - - async function testAlphas(fn, testCases) { - // Typical alpha - it('alpha 0.90', async function () { - const alpha: RebateRatio = [90, 100] - await fn(testCases, alpha) - }) - - // Typical alpha - it('alpha 0.25', async function () { - const alpha: RebateRatio = [1, 4] - await fn(testCases, alpha) - }) - - // Periodic alpha - it('alpha 0.33~', async function () { - const alpha: RebateRatio = [1, 3] - await fn(testCases, alpha) - }) - - // Small alpha - it('alpha 0.005', async function () { - const alpha: RebateRatio = [1, 200] - await fn(testCases, alpha) - }) - - // Edge alpha - it('alpha 1', async function () { - const alpha: RebateRatio = [1, 1] - await fn(testCases, alpha) - }) - } - - beforeEach(async function () { - ;[deployer] = await getAccounts() - rebatePoolMock = (await deployContract( - 'RebatePoolMock', - deployer.signer, - )) as unknown as RebatePoolMock - }) - - describe('should match cobb-douglas Solidity implementation', function () { - describe('normal test case', function () { - testAlphas(shouldMatchFormulas, testCases) - }) - - describe('edge #1 test case', function () { - testAlphas(shouldMatchFormulas, edgeCases1) - }) - }) - - describe('should match rewards out from rebates', function () { - describe('normal test case', function () { - testAlphas(shouldMatchOut, testCases) - }) - - describe('edge #1 test case', function () { - testAlphas(shouldMatchOut, edgeCases1) - }) - }) - - describe('should always be that sum of rebate rewards obtained <= to total rewards', function () { - describe('normal test case', function () { - testAlphas(shouldConserveBalances, testCases) - }) - - describe('edge #1 test case', function () { - testAlphas(shouldConserveBalances, edgeCases1) - }) - }) -}) diff --git a/test/staking/staking.test.ts b/test/staking/staking.test.ts deleted file mode 100644 index 5fc359f0d..000000000 --- a/test/staking/staking.test.ts +++ /dev/null @@ -1,479 +0,0 @@ -import { expect } from 'chai' -import { constants, BigNumber, Event } from 'ethers' - -import { GraphToken } from '../../build/types/GraphToken' -import { Staking } from '../../build/types/Staking' - -import { NetworkFixture } from '../lib/fixtures' - -import { - advanceBlockTo, - deriveChannelKey, - getAccounts, - randomHexBytes, - latestBlock, - toBN, - toGRT, - Account, -} from '../lib/testHelpers' - -const { AddressZero } = constants - -function weightedAverage( - valueA: BigNumber, - valueB: BigNumber, - periodA: BigNumber, - periodB: BigNumber, -) { - return periodA.mul(valueA).add(periodB.mul(valueB)).div(valueA.add(valueB)) -} - -describe('Staking:Stakes', () => { - let me: Account - let governor: Account - let indexer: Account - let slasher: Account - let fisherman: Account - - let fixture: NetworkFixture - - let grt: GraphToken - let staking: Staking - - // Test values - const indexerTokens = toGRT('1000') - const tokensToStake = toGRT('100') - const subgraphDeploymentID = randomHexBytes() - const channelKey = deriveChannelKey() - const allocationID = channelKey.address - const metadata = randomHexBytes(32) - - // Allocate with test values - const allocate = async (tokens: BigNumber) => { - return staking - .connect(indexer.signer) - .allocate( - subgraphDeploymentID, - tokens, - allocationID, - metadata, - await channelKey.generateProof(indexer.address), - ) - } - - // Stake and verify state change - const shouldStake = async function (tokensToStake: BigNumber) { - // Before state - const beforeIndexerStake = await staking.getIndexerStakedTokens(indexer.address) - const beforeStakingBalance = await grt.balanceOf(staking.address) - - // Stake - const tx = staking.connect(indexer.signer).stake(tokensToStake) - await expect(tx).emit(staking, 'StakeDeposited').withArgs(indexer.address, tokensToStake) - - // After state - const afterIndexerStake = await staking.getIndexerStakedTokens(indexer.address) - const afterStakingBalance = await grt.balanceOf(staking.address) - - // State updated - expect(afterIndexerStake).eq(beforeIndexerStake.add(tokensToStake)) - expect(afterStakingBalance).eq(beforeStakingBalance.add(tokensToStake)) - } - - before(async function () { - ;[me, governor, indexer, slasher, fisherman] = await getAccounts() - - fixture = new NetworkFixture() - ;({ grt, staking } = await fixture.load(governor.signer, slasher.signer)) - - // Give some funds to the indexer and approve staking contract to use funds on indexer behalf - await grt.connect(governor.signer).mint(indexer.address, indexerTokens) - await grt.connect(indexer.signer).approve(staking.address, indexerTokens) - }) - - beforeEach(async function () { - await fixture.setUp() - }) - - afterEach(async function () { - await fixture.tearDown() - }) - - context('> when not staked', function () { - describe('hasStake', function () { - it('should not have stakes', async function () { - expect(await staking.hasStake(indexer.address)).eq(false) - }) - }) - - describe('stake', function () { - it('reject stake zero tokens', async function () { - const tx = staking.connect(indexer.signer).stake(toGRT('0')) - await expect(tx).revertedWith('!tokens') - }) - - it('reject stake less than minimum indexer stake', async function () { - expect(toGRT('1')).lte(await staking.minimumIndexerStake()) - const tx = staking.connect(indexer.signer).stake(toGRT('1')) - await expect(tx).revertedWith('!minimumIndexerStake') - }) - - it('should stake tokens', async function () { - await shouldStake(tokensToStake) - }) - - it('should stake tokens = minimumIndexerStake', async function () { - await shouldStake(await staking.minimumIndexerStake()) - }) - }) - - describe('unstake', function () { - it('reject unstake tokens', async function () { - const tokensToUnstake = toGRT('2') - const tx = staking.connect(indexer.signer).unstake(tokensToUnstake) - await expect(tx).revertedWith('!stake') - }) - }) - - describe('slash', function () { - it('reject slash indexer', async function () { - const tokensToSlash = toGRT('10') - const tokensToReward = toGRT('10') - const tx = staking - .connect(slasher.signer) - .slash(indexer.address, tokensToSlash, tokensToReward, fisherman.address) - await expect(tx).revertedWith('!stake') - }) - }) - }) - - context('> when staked', function () { - beforeEach(async function () { - await staking.connect(indexer.signer).stake(tokensToStake) - }) - - describe('hasStake', function () { - it('should have stakes', async function () { - expect(await staking.hasStake(indexer.address)).eq(true) - }) - }) - - describe('stake', function () { - it('should allow re-staking', async function () { - await shouldStake(tokensToStake) - }) - - it('reject to stake under the minimum indexer stake after unstake + slash', async function () { - // Unstake (we get right on the minimum stake) - const minimumIndexerStake = await staking.minimumIndexerStake() - const tokensStaked = (await staking.stakes(indexer.address)).tokensStaked - const tokensToGetOnMinimumStake = tokensStaked.sub(minimumIndexerStake) - await staking.connect(indexer.signer).unstake(tokensToGetOnMinimumStake) - - // Slash some indexer tokens to get under the water of the minimum indexer stake - await staking - .connect(slasher.signer) - .slash(indexer.address, toGRT('10'), toGRT(0), fisherman.address) - - // Stake should require to go over the minimum stake - const tx = staking.connect(indexer.signer).stake(toGRT('1')) - await expect(tx).revertedWith('!minimumIndexerStake') - }) - }) - - describe('unstake', function () { - it('should unstake and lock tokens for thawing period', async function () { - const tokensToUnstake = toGRT('2') - const thawingPeriod = toBN(await staking.thawingPeriod()) - const currentBlock = await latestBlock() - const until = currentBlock.add(thawingPeriod).add(toBN('1')) - - // Unstake - const tx = staking.connect(indexer.signer).unstake(tokensToUnstake) - await expect(tx) - .emit(staking, 'StakeLocked') - .withArgs(indexer.address, tokensToUnstake, until) - }) - - it('should unstake and lock tokens for (weighted avg) thawing period if repeated', async function () { - const tokensToUnstake = toGRT('10') - const thawingPeriod = toBN(await staking.thawingPeriod()) - - // Unstake (1) - const tx1 = await staking.connect(indexer.signer).unstake(tokensToUnstake) - const receipt1 = await tx1.wait() - const event1: Event = receipt1.events.pop() - const tokensLockedUntil1 = event1.args['until'] - - // Move forward before the tokens are unlocked for withdrawal - await advanceBlockTo(tokensLockedUntil1.sub(5)) - - // Calculate locking time for tokens taking into account the previous unstake request - const currentBlock = await latestBlock() - const lockingPeriod = weightedAverage( - tokensToUnstake, - tokensToUnstake, - tokensLockedUntil1.sub(currentBlock), - thawingPeriod, - ) - const expectedLockedUntil = currentBlock.add(lockingPeriod).add(toBN('1')) - - // Unstake (2) - const tx2 = await staking.connect(indexer.signer).unstake(tokensToUnstake) - const receipt2 = await tx2.wait() - - // Verify events - const event2: Event = receipt2.events.pop() - expect(event2.args['until']).eq(expectedLockedUntil) - - // Verify state - const afterIndexerStake = await staking.stakes(indexer.address) - expect(afterIndexerStake.tokensLocked).eq(tokensToUnstake.mul(2)) // we unstaked two times - expect(afterIndexerStake.tokensLockedUntil).eq(expectedLockedUntil) - }) - - it('should unstake and withdraw if some tokens are unthawed', async function () { - const tokensToUnstake = toGRT('10') - const thawingPeriod = toBN(await staking.thawingPeriod()) - - const beforeIndexerBalance = await grt.balanceOf(indexer.address) - - // Unstake (1) - const tx1 = await staking.connect(indexer.signer).unstake(tokensToUnstake) - const receipt1 = await tx1.wait() - const event1: Event = receipt1.events.pop() - const tokensLockedUntil1 = event1.args['until'] - - // Move forward after the tokens are unlocked for withdrawal - await advanceBlockTo(tokensLockedUntil1) - - // Calculate locking time for tokens taking into account some tokens are withdraweable - const currentBlock = await latestBlock() - const expectedLockedUntil = currentBlock.add(thawingPeriod).add(toBN('1')) - - // Unstake (2) - const tx2 = await staking.connect(indexer.signer).unstake(tokensToUnstake) - const receipt2 = await tx2.wait() - - // Verify events - const unstakeEvent: Event = receipt2.events.pop() - const withdrawEvent: Event = receipt2.events.pop() - expect(unstakeEvent.args['until']).eq(expectedLockedUntil) - expect(withdrawEvent.args['tokens']).eq(tokensToUnstake) - - // Verify state - const afterIndexerStake = await staking.stakes(indexer.address) - const afterIndexerBalance = await grt.balanceOf(indexer.address) - expect(afterIndexerStake.tokensLocked).eq(tokensToUnstake) - expect(afterIndexerStake.tokensLockedUntil).eq(expectedLockedUntil) - expect(afterIndexerBalance).eq(beforeIndexerBalance.add(tokensToUnstake)) - }) - - it('reject unstake zero tokens', async function () { - const tx = staking.connect(indexer.signer).unstake(toGRT('0')) - await expect(tx).revertedWith('!tokens') - }) - - it('reject unstake more than available tokens', async function () { - const tokensOverCapacity = tokensToStake.add(toGRT('1')) - const tx = staking.connect(indexer.signer).unstake(tokensOverCapacity) - await expect(tx).revertedWith('!stake-avail') - }) - - it('reject unstake under the minimum indexer stake', async function () { - const minimumIndexerStake = await staking.minimumIndexerStake() - const tokensStaked = (await staking.stakes(indexer.address)).tokensStaked - const tokensToGetUnderMinimumStake = tokensStaked.sub(minimumIndexerStake).add(1) - const tx = staking.connect(indexer.signer).unstake(tokensToGetUnderMinimumStake) - await expect(tx).revertedWith('!minimumIndexerStake') - }) - - it('reject unstake under the minimum indexer stake w/multiple unstake', async function () { - const minimumIndexerStake = await staking.minimumIndexerStake() - const tokensStaked = (await staking.stakes(indexer.address)).tokensStaked - - // First unstake (we get right on the minimum stake) - const tokensToGetOnMinimumStake = tokensStaked.sub(minimumIndexerStake) - await staking.connect(indexer.signer).unstake(tokensToGetOnMinimumStake) - - // Second unstake, taking just one token out will make us under the minimum stake - const tx = staking.connect(indexer.signer).unstake(toGRT('1')) - await expect(tx).revertedWith('!minimumIndexerStake') - }) - - it('should allow unstake of full amount', async function () { - await staking.connect(indexer.signer).unstake(tokensToStake) - expect(await staking.getIndexerCapacity(indexer.address)).eq(0) - }) - }) - - describe('withdraw', function () { - it('reject withdraw if no tokens available', async function () { - const tx = staking.connect(indexer.signer).withdraw() - await expect(tx).revertedWith('!tokens') - }) - - it('should withdraw if tokens available', async function () { - // Unstake - const tokensToUnstake = toGRT('10') - const tx1 = await staking.connect(indexer.signer).unstake(tokensToUnstake) - const receipt1 = await tx1.wait() - const event1: Event = receipt1.events.pop() - const tokensLockedUntil = event1.args['until'] - - // Withdraw on locking period (should fail) - const tx2 = staking.connect(indexer.signer).withdraw() - await expect(tx2).revertedWith('!tokens') - - // Move forward - await advanceBlockTo(tokensLockedUntil) - - // Withdraw after locking period (all good) - const beforeBalance = await grt.balanceOf(indexer.address) - const tx3 = staking.connect(indexer.signer).withdraw() - await expect(tx3).emit(staking, 'StakeWithdrawn').withArgs(indexer.address, tokensToUnstake) - const afterBalance = await grt.balanceOf(indexer.address) - expect(afterBalance).eq(beforeBalance.add(tokensToUnstake)) - }) - }) - - describe('slash', function () { - // This function tests slashing behaviour under different conditions - const shouldSlash = async function ( - indexer: Account, - tokensToSlash: BigNumber, - tokensToReward: BigNumber, - fisherman: Account, - ) { - // Before - const beforeTotalSupply = await grt.totalSupply() - const beforeFishermanTokens = await grt.balanceOf(fisherman.address) - const beforeIndexerStake = await staking.getIndexerStakedTokens(indexer.address) - - // Slash indexer - const tokensToBurn = tokensToSlash.sub(tokensToReward) - const tx = staking - .connect(slasher.signer) - .slash(indexer.address, tokensToSlash, tokensToReward, fisherman.address) - await expect(tx) - .emit(staking, 'StakeSlashed') - .withArgs(indexer.address, tokensToSlash, tokensToReward, fisherman.address) - - // After - const afterTotalSupply = await grt.totalSupply() - const afterFishermanTokens = await grt.balanceOf(fisherman.address) - const afterIndexerStake = await staking.getIndexerStakedTokens(indexer.address) - - // Check slashed tokens has been burned - expect(afterTotalSupply).eq(beforeTotalSupply.sub(tokensToBurn)) - // Check reward was given to the fisherman - expect(afterFishermanTokens).eq(beforeFishermanTokens.add(tokensToReward)) - // Check indexer stake was updated - expect(afterIndexerStake).eq(beforeIndexerStake.sub(tokensToSlash)) - } - - it('should slash indexer and give reward to beneficiary slash>reward', async function () { - // Slash indexer - const tokensToSlash = toGRT('100') - const tokensToReward = toGRT('10') - await shouldSlash(indexer, tokensToSlash, tokensToReward, fisherman) - }) - - it('should slash indexer and give reward to beneficiary slash=reward', async function () { - // Slash indexer - const tokensToSlash = toGRT('10') - const tokensToReward = toGRT('10') - await shouldSlash(indexer, tokensToSlash, tokensToReward, fisherman) - }) - - it('should slash indexer even when overallocated', async function () { - // Initial stake - const beforeTokensStaked = await staking.getIndexerStakedTokens(indexer.address) - - // Unstake partially, these tokens will be locked - const tokensToUnstake = toGRT('10') - await staking.connect(indexer.signer).unstake(tokensToUnstake) - - // Allocate indexer stake - const tokensToAllocate = toGRT('70') - await allocate(tokensToAllocate) - - // State pre-slashing - // helpers.logStake(await staking.stakes(indexer.signer)) - // > Current state: - // = Staked: 100 - // = Locked: 10 - // = Allocated: 70 - // = Available: 20 (staked - allocated - locked) - - // Even if all stake is allocated it should slash the indexer - const tokensToSlash = toGRT('80') - const tokensToReward = toGRT('0') - await shouldSlash(indexer, tokensToSlash, tokensToReward, fisherman) - - // State post-slashing - // helpers.logStake(await staking.stakes(indexer.signer)) - // > Current state: - // = Staked: 20 - // = Locked: 0 - // = Allocated: 70 - // = Available: -50 (staked - allocated - locked) => when tokens available becomes negative - // we are overallocated, the staking contract will prevent unstaking or allocating until - // the balance is restored by staking or unallocating - - const stakes = await staking.stakes(indexer.address) - // Stake should be reduced by the amount slashed - expect(stakes.tokensStaked).eq(beforeTokensStaked.sub(tokensToSlash)) - // All allocated tokens should be untouched - expect(stakes.tokensAllocated).eq(tokensToAllocate) - // All locked tokens need to be consumed from the stake - expect(stakes.tokensLocked).eq(toBN('0')) - expect(stakes.tokensLockedUntil).eq(toBN('0')) - // Tokens available when negative means over allocation - const tokensAvailable = stakes.tokensStaked - .sub(stakes.tokensAllocated) - .sub(stakes.tokensLocked) - expect(tokensAvailable).eq(toGRT('-50')) - - const tx = staking.connect(indexer.signer).unstake(tokensToUnstake) - await expect(tx).revertedWith('!stake-avail') - }) - - it('reject to slash zero tokens', async function () { - const tokensToSlash = toGRT('0') - const tokensToReward = toGRT('0') - const tx = staking - .connect(slasher.signer) - .slash(indexer.address, tokensToSlash, tokensToReward, me.address) - await expect(tx).revertedWith('!tokens') - }) - - it('reject to slash indexer if caller is not slasher', async function () { - const tokensToSlash = toGRT('100') - const tokensToReward = toGRT('10') - const tx = staking - .connect(me.signer) - .slash(indexer.address, tokensToSlash, tokensToReward, me.address) - await expect(tx).revertedWith('!slasher') - }) - - it('reject to slash indexer if beneficiary is zero address', async function () { - const tokensToSlash = toGRT('100') - const tokensToReward = toGRT('10') - const tx = staking - .connect(slasher.signer) - .slash(indexer.address, tokensToSlash, tokensToReward, AddressZero) - await expect(tx).revertedWith('!beneficiary') - }) - - it('reject to slash indexer if reward is greater than slash amount', async function () { - const tokensToSlash = toGRT('100') - const tokensToReward = toGRT('200') - const tx = staking - .connect(slasher.signer) - .slash(indexer.address, tokensToSlash, tokensToReward, fisherman.address) - await expect(tx).revertedWith('rewards>slash') - }) - }) - }) -}) diff --git a/test/tests/gsr.test.ts b/test/tests/gsr.test.ts deleted file mode 100644 index 14d3302e7..000000000 --- a/test/tests/gsr.test.ts +++ /dev/null @@ -1,192 +0,0 @@ -import { expect } from 'chai' -import { constants, BigNumber } from 'ethers' - -import { GSRManager } from '../../build/types/GSRManager' -import { GDAI } from '../../build/types/GDAI' - -import * as deployment from '../lib/deployment' -import { defaults } from '../lib/deployment' -import { getAccounts, toGRT, Account } from '../lib/testHelpers' - -const { AddressZero, MaxUint256 } = constants - -describe('Gdai and Gsr', () => { - let governor: Account - - let gsrManager: GSRManager - let gdai: GDAI - - const ISSUANCE_RATE_DECIMALS = constants.WeiPerEther - - const getExpectedRateStringCompare = (p: BigNumber, r: BigNumber, t: BigNumber): string => { - return p.mul(r).pow(t).toString().slice(0, 19) - } - - const runJoin = async (): Promise => { - const savingsRate = await gsrManager.savingsRate() - const nSeconds = 3 // seems 3 seconds between blocks for join() - - // Before values - const beforeCumulativeInterestRate = await gsrManager.cumulativeInterestRate() - expect(beforeCumulativeInterestRate).eq(ISSUANCE_RATE_DECIMALS) - const beforeDripTime = await gsrManager.lastDripTime() - const beforeTokenSupply = await gdai.totalSupply() - const beforeReserves = await gsrManager.reserves() - const beforeBalance = await gsrManager.balances(governor.address) - - // Expected Values - const expectedRateCompare = getExpectedRateStringCompare( - beforeCumulativeInterestRate, - savingsRate, - BigNumber.from(nSeconds), - ) - - const expectedDripTime = beforeDripTime.add(BigNumber.from(nSeconds)) - const joinAmount = toGRT('10000000') - const expectedSavingsBalance = joinAmount - .mul(ISSUANCE_RATE_DECIMALS) - .div(BigNumber.from(expectedRateCompare)) - - // Run join() tx and check events - const joinTx = gsrManager.connect(governor.signer).join(joinAmount) - await joinTx - await expect(joinTx) - .emit(gsrManager, 'Drip') - .withArgs(expectedRateCompare, expectedDripTime) - .emit(gsrManager, 'Join') - .withArgs(governor.address, joinAmount, expectedSavingsBalance) - - // Check cumulative rate was updated correctly - const afterCumulativeInterestRate = await gsrManager.cumulativeInterestRate() - expect(afterCumulativeInterestRate).eq(expectedRateCompare) - - // Check drip time was updated - const afterDripTime = await gsrManager.lastDripTime() - expect(afterDripTime).eq(expectedDripTime) - - // Check tokens were NOT minted (since reserves started off at zero) - const afterTokenSupply = await gdai.totalSupply() - expect(beforeTokenSupply).eq(afterTokenSupply) - - // Check reserve balance was updated - const afterJoinReserves = await gsrManager.reserves() - expect(beforeReserves.add(expectedSavingsBalance)).eq(afterJoinReserves) - - // Check user balance was updated - const afterJoinBalance = await gsrManager.balances(governor.address) - expect(beforeBalance).eq(afterJoinBalance.sub(expectedSavingsBalance)) - } - - before(async function () { - ;[governor] = await getAccounts() - }) - - beforeEach(async function () { - gdai = await deployment.deployGDAI(governor.signer) - gsrManager = await deployment.deployGSR(governor.signer, gdai.address) - await gdai.setGSR(gsrManager.address) - await gdai.approve(gsrManager.address, MaxUint256) - const initialSupply = await gdai.balanceOf(governor.address) - expect(initialSupply).eq(defaults.gdai.initialSupply) - }) - - describe('gdai', () => { - it('should set `governor`', async function () { - expect(await gdai.governor()).eq(governor.address) - expect(await gsrManager.governor()).eq(governor.address) - }) - - it('should allow governor to mint', async function () { - // Constructor set to default correctly - expect(await gdai.totalSupply()).eq(defaults.gdai.initialSupply) - - // Update and check event was emitted - const tokensToMint = toGRT('1000000') - const tx = gdai.connect(governor.signer).mint(governor.address, tokensToMint) - await expect(tx).emit(gdai, 'Transfer').withArgs(AddressZero, governor.address, tokensToMint) - }) - }) - - describe('gsr', () => { - it('should set `governor`', async function () { - expect(await gsrManager.governor()).eq(governor.address) - }) - - it('should set savings rate', async function () { - // Constructor set to default correctly - expect(await gsrManager.savingsRate()).eq(defaults.gdai.savingsRate) - - // Update and check new value - const tx = gsrManager.connect(governor.signer).setRate(1) - await expect(tx).emit(gsrManager, 'SetRate').withArgs(1) - expect(await gsrManager.savingsRate()).eq(1) - }) - - it('should test drip() and join()', async function () { - await runJoin() - }) - it('should test drip() and join() and exit', async function () { - // Run join first - await runJoin() - - const savingsRate = await gsrManager.savingsRate() - const nSeconds = 1 // seems 1 second between blocks when running exit() - - // Before values - const beforeCumulativeInterestRate = await gsrManager.cumulativeInterestRate() - const beforeDripTime = await gsrManager.lastDripTime() - const beforeTokenSupply = await gdai.totalSupply() - const beforeBalance = await gsrManager.balances(governor.address) - const beforeGDAIBalance = await gdai.balanceOf(governor.address) - - // Expected Values - const expectedRateCompare = getExpectedRateStringCompare( - beforeCumulativeInterestRate, - savingsRate, - BigNumber.from(nSeconds), - ) - - const expectedGDAIWithdrawn = beforeBalance - .mul(BigNumber.from(expectedRateCompare)) - .div(ISSUANCE_RATE_DECIMALS) - const expectedDripTime = beforeDripTime.add(BigNumber.from(nSeconds)) - - // Run exit() tx and check events - const exitTx = gsrManager.connect(governor.signer).exit(beforeBalance) - await expect(exitTx) - .emit(gsrManager, 'Drip') - .withArgs(expectedRateCompare, expectedDripTime) - .emit(gsrManager, 'Exit') - .withArgs(governor.address, beforeBalance, expectedGDAIWithdrawn) - - // Checking drip() - // Check cumulative rate was updated correctly - const afterCumulativeInterestRate = await gsrManager.cumulativeInterestRate() - expect(afterCumulativeInterestRate).eq(expectedRateCompare) - - // Check drip time was updated - const afterDripTime = await gsrManager.lastDripTime() - expect(afterDripTime).eq(expectedDripTime) - - // Check tokens were minted - const rateChange = afterCumulativeInterestRate.sub(beforeCumulativeInterestRate) - const expectedAdditionalSupply = beforeBalance - .mul(BigNumber.from(rateChange)) - .div(ISSUANCE_RATE_DECIMALS) - const afterTokenSupply = await gdai.totalSupply() - expect(expectedAdditionalSupply.add(beforeTokenSupply)).eq(afterTokenSupply) - - // Check users GDAI balance has gone up - const afterGDAIBalance = await gdai.balanceOf(governor.address) - expect(afterGDAIBalance).eq(expectedGDAIWithdrawn.add(beforeGDAIBalance)) - - // Check reserve balance was updated - const afterExitReserves = await gsrManager.reserves() - expect(afterExitReserves).eq(0) - - // Check user savings balance was updated - const afterExitBalance = await gsrManager.balances(governor.address) - expect(afterExitBalance).eq(0) - }) - }) -}) diff --git a/test/upgrade/admin.test.ts b/test/upgrade/admin.test.ts deleted file mode 100644 index a20640943..000000000 --- a/test/upgrade/admin.test.ts +++ /dev/null @@ -1,201 +0,0 @@ -import { expect } from 'chai' -import hre from 'hardhat' -import '@nomiclabs/hardhat-ethers' - -import { GraphProxy } from '../../build/types/GraphProxy' -import { Curation } from '../../build/types/Curation' -import { GraphProxyAdmin } from '../../build/types/GraphProxyAdmin' -import { Staking } from '../../build/types/Staking' - -import * as deployment from '../lib/deployment' -import { NetworkFixture } from '../lib/fixtures' -import { getAccounts, Account } from '../lib/testHelpers' - -import { getContractAt } from '../../cli/network' - -const { ethers } = hre -const { AddressZero } = ethers.constants - -describe('Upgrades', () => { - let me: Account - let governor: Account - - let fixture: NetworkFixture - - let proxyAdmin: GraphProxyAdmin - let curation: Curation - let staking: Staking - let stakingProxy: GraphProxy - - before(async function () { - ;[me, governor] = await getAccounts() - - fixture = new NetworkFixture() - ;({ proxyAdmin, staking, curation } = await fixture.load(governor.signer)) - stakingProxy = getContractAt('GraphProxy', staking.address, governor.signer) as GraphProxy - - // Give some funds to the indexer and approve staking contract to use funds on indexer behalf - }) - - beforeEach(async function () { - await fixture.setUp() - }) - - afterEach(async function () { - await fixture.tearDown() - }) - - describe('GraphProxyAdmin & GraphProxy', function () { - describe('getters', function () { - describe('admin()', function () { - it('should get the proxy admin of a proxy contract', async function () { - const proxyAdminAddress = await proxyAdmin.getProxyAdmin(staking.address) - expect(proxyAdmin.address).eq(proxyAdminAddress) - }) - - it('reject get admin from other than the ProxyAdmin', async function () { - await expect(stakingProxy.admin()).revertedWith( - "function selector was not recognized and there's no fallback function", - ) - }) - }) - - describe('implementation()', function () { - it('should get implementation only from ProxyAdmin', async function () { - const implementationAddress = await proxyAdmin.getProxyImplementation(staking.address) - expect(implementationAddress).not.eq(AddressZero) - }) - - it('reject get implementation from other than the ProxyAdmin', async function () { - await expect(stakingProxy.implementation()).revertedWith( - "function selector was not recognized and there's no fallback function", - ) - }) - }) - - describe('pendingImplementation()', function () { - it('should get pending implementation only from ProxyAdmin', async function () { - const pendingImplementationAddress = await proxyAdmin.getProxyPendingImplementation( - staking.address, - ) - expect(pendingImplementationAddress).eq(AddressZero) - }) - - it('reject get pending implementation from other than the ProxyAdmin', async function () { - await expect(stakingProxy.pendingImplementation()).revertedWith( - "function selector was not recognized and there's no fallback function", - ) - }) - }) - }) - - describe('upgrade', function () { - it('should be able to upgrade contract', async function () { - // Get some other implementation to use just for the purpose of the test - const oldImplementationAddress = await proxyAdmin.getProxyImplementation(staking.address) - const newImplementationAddress = await proxyAdmin.getProxyImplementation(curation.address) - - const stakingProxy = getContractAt('GraphProxy', staking.address, governor.signer) - - // Upgrade the Staking:Proxy to a new implementation - const tx1 = proxyAdmin - .connect(governor.signer) - .upgrade(staking.address, newImplementationAddress) - await expect(tx1) - .emit(stakingProxy, 'PendingImplementationUpdated') - .withArgs(AddressZero, newImplementationAddress) - - const tx2 = proxyAdmin - .connect(governor.signer) - .acceptProxy(newImplementationAddress, staking.address) - await expect(tx2) - .emit(stakingProxy, 'ImplementationUpdated') - .withArgs(oldImplementationAddress, newImplementationAddress) - - // Implementation should be the new one - expect(await proxyAdmin.getProxyImplementation(curation.address)).eq( - newImplementationAddress, - ) - }) - - it('reject upgrade if not the governor of the ProxyAdmin', async function () { - const newImplementationAddress = await proxyAdmin.getProxyImplementation(curation.address) - - // Upgrade the Staking:Proxy to a new implementation - const tx = proxyAdmin.connect(me.signer).upgrade(staking.address, newImplementationAddress) - await expect(tx).revertedWith('Only Governor can call') - }) - - it('reject upgrade if not using the ProxyAdmin', async function () { - const newImplementationAddress = await proxyAdmin.getProxyImplementation(curation.address) - - // Due to the transparent proxy we should not be able to upgrade from other than the proxy admin - const tx = stakingProxy.connect(governor.signer).upgradeTo(newImplementationAddress) - await expect(tx).revertedWith( - "function selector was not recognized and there's no fallback function", - ) - }) - }) - - describe('acceptUpgrade', function () { - it('reject accept upgrade if not using the ProxyAdmin', async function () { - // Due to the transparent proxy we should not be able to accept upgrades from other than the proxy admin - const tx = stakingProxy.connect(governor.signer).acceptUpgrade() - await expect(tx).revertedWith( - "function selector was not recognized and there's no fallback function", - ) - }) - }) - - describe('acceptProxy', function () { - it('reject accept proxy if not using the ProxyAdmin', async function () { - const newImplementationAddress = await proxyAdmin.getProxyImplementation(curation.address) - const implementation = getContractAt('Curation', newImplementationAddress, governor.signer) - - // Start an upgrade to a new implementation - await proxyAdmin.connect(governor.signer).upgrade(staking.address, newImplementationAddress) - - // Try to accept the proxy directly from the implementation, this should not work, only from the ProxyAdmin - const tx = implementation.connect(governor.signer).acceptProxy(staking.address) - await expect(tx).revertedWith('Caller must be the proxy admin') - }) - }) - - describe('changeProxyAdmin', function () { - it('should set the proxy admin of a proxy', async function () { - const otherProxyAdmin = await deployment.deployProxyAdmin(governor.signer) - - await proxyAdmin - .connect(governor.signer) - .changeProxyAdmin(staking.address, otherProxyAdmin.address) - expect(await otherProxyAdmin.getProxyAdmin(staking.address)).eq(otherProxyAdmin.address) - - // Should not find the change admin function in the proxy due to transparent proxy - // as this ProxyAdmin is not longer the owner - const tx = proxyAdmin - .connect(governor.signer) - .changeProxyAdmin(staking.address, otherProxyAdmin.address) - await expect(tx).revertedWith( - "function selector was not recognized and there's no fallback function", - ) - }) - - it('reject change admin if not the governor of the ProxyAdmin', async function () { - const otherProxyAdmin = await deployment.deployProxyAdmin(governor.signer) - - const tx = proxyAdmin - .connect(me.signer) - .changeProxyAdmin(staking.address, otherProxyAdmin.address) - await expect(tx).revertedWith('Only Governor can call') - }) - - it('reject change admin if not using the ProxyAdmin', async function () { - // Due to the transparent proxy we should not be able to set admin from other than the proxy admin - const tx = stakingProxy.connect(governor.signer).setAdmin(me.address) - await expect(tx).revertedWith( - "function selector was not recognized and there's no fallback function", - ) - }) - }) - }) -}) diff --git a/test/upgrade/security.test.ts b/test/upgrade/security.test.ts deleted file mode 100644 index dfabe5ed3..000000000 --- a/test/upgrade/security.test.ts +++ /dev/null @@ -1,51 +0,0 @@ -// import { expect } from 'chai' -// import hre, { upgrades } from 'hardhat' -// import '@nomiclabs/hardhat-ethers' - -// const { ethers } = hre - -// // Deploy the first version of Staking along with a Proxy -// const deployStaking = async (contractName: string): Promise => { -// // Library -// const LibCobbDouglasFactory = await ethers.getContractFactory('LibCobbDouglas') -// const libCobbDouglas = await LibCobbDouglasFactory.deploy() - -// // Deploy contract with Proxy -// const Staking = await ethers.getContractFactory(contractName, { -// libraries: { -// LibCobbDouglas: libCobbDouglas.address, -// }, -// }) -// const instance = await upgrades.deployProxy(Staking, { -// initializer: false, -// unsafeAllowLinkedLibraries: true, -// }) -// return instance.address -// } - -// // Deploy an upgrade -// const upgradeStaking = async (proxyAddress: string, contractName: string): Promise => { -// // Library -// const LibCobbDouglasFactory = await ethers.getContractFactory('LibCobbDouglas') -// const libCobbDouglas = await LibCobbDouglasFactory.deploy() - -// // Upgrade contract -// const StakingImpl = await ethers.getContractFactory(contractName, { -// libraries: { -// LibCobbDouglas: libCobbDouglas.address, -// }, -// }) -// const upgraded = await upgrades.prepareUpgrade(proxyAddress, StakingImpl, { -// unsafeAllowLinkedLibraries: true, -// }) -// return upgraded -// } - -// describe('Upgrade', () => { -// describe('Test compatible layout', function () { -// it('Staking', async function () { -// // const proxyAddress = await deployStaking('StakingV1') -// // await upgradeStaking(proxyAddress, 'Staking') -// }) -// }) -// }) diff --git a/tsconfig.json b/tsconfig.json deleted file mode 100644 index 1857a87d3..000000000 --- a/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "lib": ["ES2018", "dom"], - "module": "commonjs", - "moduleResolution": "node", - "target": "ES2018", - "outDir": "dist", - "resolveJsonModule": true, - "esModuleInterop": true - }, - "exclude": ["dist", "node_modules"], - "files": [ - "./hardhat.config.ts", - "./scripts/**/*.ts", - "./test/**/*.ts", - "node_modules/@nomiclabs/hardhat-ethers/internal/type-extensions.d.ts", - "node_modules/@nomiclabs/hardhat-etherscan/dist/src/type-extensions.d.ts", - "node_modules/@nomiclabs/hardhat-waffle/dist/src/type-extensions.d.ts", - "node_modules/@typechain/hardhat/dist/type-extensions.d.ts", - "./index.d.ts" - ] -} diff --git a/yarn.lock b/yarn.lock deleted file mode 100644 index a8d3b0ec5..000000000 --- a/yarn.lock +++ /dev/null @@ -1,12205 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@babel/code-frame@7.12.11": - version "7.12.11" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.11.tgz#f4ad435aa263db935b8f10f2c552d23fb716a63f" - integrity sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw== - dependencies: - "@babel/highlight" "^7.10.4" - -"@babel/code-frame@^7.0.0": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.13.tgz#dcfc826beef65e75c50e21d3837d7d95798dd658" - integrity sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g== - dependencies: - "@babel/highlight" "^7.12.13" - -"@babel/helper-validator-identifier@^7.14.0": - version "7.14.0" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz#d26cad8a47c65286b15df1547319a5d0bcf27288" - integrity sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A== - -"@babel/highlight@^7.10.4", "@babel/highlight@^7.12.13": - version "7.14.0" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.14.0.tgz#3197e375711ef6bf834e67d0daec88e4f46113cf" - integrity sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg== - dependencies: - "@babel/helper-validator-identifier" "^7.14.0" - chalk "^2.0.0" - js-tokens "^4.0.0" - -"@cto.af/textdecoder@^0.0.0": - version "0.0.0" - resolved "https://registry.yarnpkg.com/@cto.af/textdecoder/-/textdecoder-0.0.0.tgz#e1e8d84c936c30a0f4619971f19ca41941af9fdc" - integrity sha512-sJpx3F5xcVV/9jNYJQtvimo4Vfld/nD3ph+ZWtQzZ03Zo8rJC7QKQTRcIGS13Rcz80DwFNthCWMrd58vpY4ZAQ== - -"@dabh/diagnostics@^2.0.2": - version "2.0.2" - resolved "https://registry.yarnpkg.com/@dabh/diagnostics/-/diagnostics-2.0.2.tgz#290d08f7b381b8f94607dc8f471a12c675f9db31" - integrity sha512-+A1YivoVDNNVCdfozHSR8v/jyuuLTMXwjWuxPFlFlUapXoGc+Gj9mDlTDDfrwl7rXCl2tNZ0kE8sIBO6YOn96Q== - dependencies: - colorspace "1.1.x" - enabled "2.0.x" - kuler "^2.0.0" - -"@ensdomains/ens@^0.4.4": - version "0.4.5" - resolved "https://registry.yarnpkg.com/@ensdomains/ens/-/ens-0.4.5.tgz#e0aebc005afdc066447c6e22feb4eda89a5edbfc" - integrity sha512-JSvpj1iNMFjK6K+uVl4unqMoa9rf5jopb8cya5UGBWz23Nw8hSNT7efgUx4BTlAPAgpNlEioUfeTyQ6J9ZvTVw== - dependencies: - bluebird "^3.5.2" - eth-ens-namehash "^2.0.8" - solc "^0.4.20" - testrpc "0.0.1" - web3-utils "^1.0.0-beta.31" - -"@ensdomains/resolver@^0.2.4": - version "0.2.4" - resolved "https://registry.yarnpkg.com/@ensdomains/resolver/-/resolver-0.2.4.tgz#c10fe28bf5efbf49bff4666d909aed0265efbc89" - integrity sha512-bvaTH34PMCbv6anRa9I/0zjLJgY4EuznbEMgbV77JBCQ9KNC46rzi0avuxpOfu+xDjPEtSFGqVEOr5GlUSGudA== - -"@eslint/eslintrc@^0.4.1": - version "0.4.1" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-0.4.1.tgz#442763b88cecbe3ee0ec7ca6d6dd6168550cbf14" - integrity sha512-5v7TDE9plVhvxQeWLXDTvFvJBdH6pEsdnl2g/dAptmuFEPedQ4Erq5rsDsX+mvAM610IhNaO2W5V1dOOnDKxkQ== - dependencies: - ajv "^6.12.4" - debug "^4.1.1" - espree "^7.3.0" - globals "^12.1.0" - ignore "^4.0.6" - import-fresh "^3.2.1" - js-yaml "^3.13.1" - minimatch "^3.0.4" - strip-json-comments "^3.1.1" - -"@ethereum-waffle/chai@^3.3.0": - version "3.3.1" - resolved "https://registry.yarnpkg.com/@ethereum-waffle/chai/-/chai-3.3.1.tgz#3f20b810d0fa516f19af93c50c3be1091333fa8e" - integrity sha512-+vepCjttfOzCSnmiVEmd1bR8ctA2wYVrtWa8bDLhnTpj91BIIHotNDTwpeq7fyjrOCIBTN3Ai8ACfjNoatc4OA== - dependencies: - "@ethereum-waffle/provider" "^3.3.1" - ethers "^5.0.0" - -"@ethereum-waffle/compiler@^3.3.0": - version "3.3.1" - resolved "https://registry.yarnpkg.com/@ethereum-waffle/compiler/-/compiler-3.3.1.tgz#946128fd565aa4347075fd716dbd0f3f38189280" - integrity sha512-X/TeQugt94AQwXEdCjIQxcXYGawNulVBYEBE7nloj4wE/RBxNolXwjoVNjcS4kuiMMbKkdO0JkL5sn6ixx8bDg== - dependencies: - "@resolver-engine/imports" "^0.3.3" - "@resolver-engine/imports-fs" "^0.3.3" - "@typechain/ethers-v5" "^2.0.0" - "@types/mkdirp" "^0.5.2" - "@types/node-fetch" "^2.5.5" - ethers "^5.0.1" - mkdirp "^0.5.1" - node-fetch "^2.6.0" - solc "^0.6.3" - ts-generator "^0.1.1" - typechain "^3.0.0" - -"@ethereum-waffle/ens@^3.2.4": - version "3.2.4" - resolved "https://registry.yarnpkg.com/@ethereum-waffle/ens/-/ens-3.2.4.tgz#c486be4879ea7107e1ff01b24851a5e44f5946ce" - integrity sha512-lkRVPCEkk7KOwH9MqFMB+gL0X8cZNsm+MnKpP9CNbAyhFos2sCDGcY8t6BA12KBK6pdMuuRXPxYL9WfPl9bqSQ== - dependencies: - "@ensdomains/ens" "^0.4.4" - "@ensdomains/resolver" "^0.2.4" - ethers "^5.0.1" - -"@ethereum-waffle/mock-contract@^3.2.2": - version "3.2.2" - resolved "https://registry.yarnpkg.com/@ethereum-waffle/mock-contract/-/mock-contract-3.2.2.tgz#5749b03cbb4850150f81cf66151c4523eb7436f0" - integrity sha512-H60Cc5C7sYNU4LuPMSKDh8YIaN9/fkwEjznY78CEbOosO+lMlFYdA+5VZjeDGDuYKfsBqsocQdkj1CRyoi1KNw== - dependencies: - "@ethersproject/abi" "^5.0.1" - ethers "^5.0.1" - -"@ethereum-waffle/provider@^3.3.0", "@ethereum-waffle/provider@^3.3.1": - version "3.3.2" - resolved "https://registry.yarnpkg.com/@ethereum-waffle/provider/-/provider-3.3.2.tgz#33677baf6af5cbb087c3072d84f38c152968ebb1" - integrity sha512-ilz6cXK0ylSKCmZktTMpY4gjo0CN6rb86JfN7+RZYk6tKtZA6sXoOe95skWEQkGf1fZk7G817fTzLb0CmFDp1g== - dependencies: - "@ethereum-waffle/ens" "^3.2.4" - ethers "^5.0.1" - ganache-core "^2.13.2" - patch-package "^6.2.2" - postinstall-postinstall "^2.1.0" - -"@ethereumjs/block@^3.2.1", "@ethereumjs/block@^3.3.0": - version "3.3.0" - resolved "https://registry.yarnpkg.com/@ethereumjs/block/-/block-3.3.0.tgz#a1b3baec831c71c0d9e7f6145f25e919cff4939c" - integrity sha512-WoefY9Rs4W8vZTxG9qwntAlV61xsSv0NPoXmHO7x3SH16dwJQtU15YvahPCz4HEEXbu7GgGgNgu0pv8JY7VauA== - dependencies: - "@ethereumjs/common" "^2.3.0" - "@ethereumjs/tx" "^3.2.0" - ethereumjs-util "^7.0.10" - merkle-patricia-tree "^4.2.0" - -"@ethereumjs/blockchain@^5.2.1", "@ethereumjs/blockchain@^5.3.0": - version "5.3.0" - resolved "https://registry.yarnpkg.com/@ethereumjs/blockchain/-/blockchain-5.3.0.tgz#206936e30a4320d87a26e58d157eadef21ef6ff1" - integrity sha512-B0Y5QDZcRDQISPilv3m8nzk97QmC98DnSE9WxzGpCxfef22Mw7xhwGipci5Iy0dVC2Np2Cr5d3F6bHAR7+yVmQ== - dependencies: - "@ethereumjs/block" "^3.3.0" - "@ethereumjs/common" "^2.3.0" - "@ethereumjs/ethash" "^1.0.0" - debug "^2.2.0" - ethereumjs-util "^7.0.10" - level-mem "^5.0.1" - lru-cache "^5.1.1" - rlp "^2.2.4" - semaphore-async-await "^1.5.1" - -"@ethereumjs/common@^2.2.0", "@ethereumjs/common@^2.3.0": - version "2.3.0" - resolved "https://registry.yarnpkg.com/@ethereumjs/common/-/common-2.3.0.tgz#b1174fab8653565b4835a455d972dc2e89411896" - integrity sha512-Fmi15MdVptsC85n6NcUXIFiiXCXWEfZNgPWP+OGAQOC6ZtdzoNawtxH/cYpIgEgSuIzfOeX3VKQP/qVI1wISHg== - dependencies: - crc-32 "^1.2.0" - ethereumjs-util "^7.0.10" - -"@ethereumjs/ethash@^1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@ethereumjs/ethash/-/ethash-1.0.0.tgz#4e77f85b37be1ade5393e8719bdabac3e796ddaa" - integrity sha512-iIqnGG6NMKesyOxv2YctB2guOVX18qMAWlj3QlZyrc+GqfzLqoihti+cVNQnyNxr7eYuPdqwLQOFuPe6g/uKjw== - dependencies: - "@types/levelup" "^4.3.0" - buffer-xor "^2.0.1" - ethereumjs-util "^7.0.7" - miller-rabin "^4.0.0" - -"@ethereumjs/tx@^3.1.3", "@ethereumjs/tx@^3.2.0": - version "3.2.0" - resolved "https://registry.yarnpkg.com/@ethereumjs/tx/-/tx-3.2.0.tgz#2a816d5db67eb36059c8dc13f022f64e9b8d7ab9" - integrity sha512-D3X/XtZ3ldUg34hr99Jvj7NxW3NxVKdUKrwQnEWlAp4CmCQpvYoyn7NF4lk34rHEt7ScS+Agu01pcDHoOcd19A== - dependencies: - "@ethereumjs/common" "^2.3.0" - ethereumjs-util "^7.0.10" - -"@ethereumjs/vm@^5.3.2": - version "5.4.0" - resolved "https://registry.yarnpkg.com/@ethereumjs/vm/-/vm-5.4.0.tgz#092d530388e855310406160f144d6f492800c0ea" - integrity sha512-0Mv51inp5S/mh+fKP0H90byT/5DdFirChUFUMhEjDlIBnHK55o/liKZ+0iNSLm6ZxX8iPs7urp11/UCoxPJfLA== - dependencies: - "@ethereumjs/block" "^3.3.0" - "@ethereumjs/blockchain" "^5.3.0" - "@ethereumjs/common" "^2.3.0" - "@ethereumjs/tx" "^3.2.0" - async-eventemitter "^0.2.4" - core-js-pure "^3.0.1" - debug "^2.2.0" - ethereumjs-util "^7.0.10" - functional-red-black-tree "^1.0.1" - mcl-wasm "^0.7.1" - merkle-patricia-tree "^4.2.0" - rustbn.js "~0.2.0" - util.promisify "^1.0.1" - -"@ethersproject/abi@5.0.0-beta.153": - version "5.0.0-beta.153" - resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.0.0-beta.153.tgz#43a37172b33794e4562999f6e2d555b7599a8eee" - integrity sha512-aXweZ1Z7vMNzJdLpR1CZUAIgnwjrZeUSvN9syCwlBaEBUFJmFY+HHnfuTI5vIhVs/mRkfJVrbEyl51JZQqyjAg== - dependencies: - "@ethersproject/address" ">=5.0.0-beta.128" - "@ethersproject/bignumber" ">=5.0.0-beta.130" - "@ethersproject/bytes" ">=5.0.0-beta.129" - "@ethersproject/constants" ">=5.0.0-beta.128" - "@ethersproject/hash" ">=5.0.0-beta.128" - "@ethersproject/keccak256" ">=5.0.0-beta.127" - "@ethersproject/logger" ">=5.0.0-beta.129" - "@ethersproject/properties" ">=5.0.0-beta.131" - "@ethersproject/strings" ">=5.0.0-beta.130" - -"@ethersproject/abi@5.0.7": - version "5.0.7" - resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.0.7.tgz#79e52452bd3ca2956d0e1c964207a58ad1a0ee7b" - integrity sha512-Cqktk+hSIckwP/W8O47Eef60VwmoSC/L3lY0+dIBhQPCNn9E4V7rwmm2aFrNRRDJfFlGuZ1khkQUOc3oBX+niw== - dependencies: - "@ethersproject/address" "^5.0.4" - "@ethersproject/bignumber" "^5.0.7" - "@ethersproject/bytes" "^5.0.4" - "@ethersproject/constants" "^5.0.4" - "@ethersproject/hash" "^5.0.4" - "@ethersproject/keccak256" "^5.0.3" - "@ethersproject/logger" "^5.0.5" - "@ethersproject/properties" "^5.0.3" - "@ethersproject/strings" "^5.0.4" - -"@ethersproject/abi@5.2.0", "@ethersproject/abi@^5.0.0-beta.146", "@ethersproject/abi@^5.0.1", "@ethersproject/abi@^5.0.2", "@ethersproject/abi@^5.2.0": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.2.0.tgz#e2ca0b7f7e3b83e4d427ed8b38fdc1c48e2bb00f" - integrity sha512-24ExfHa0VbIOUHbB36b6lCVmWkaIVmrd9/m8MICtmSsRKzlugWqUD0B8g0zrRylXNxAOc3V6T4xKJ8jEDSvp3w== - dependencies: - "@ethersproject/address" "^5.2.0" - "@ethersproject/bignumber" "^5.2.0" - "@ethersproject/bytes" "^5.2.0" - "@ethersproject/constants" "^5.2.0" - "@ethersproject/hash" "^5.2.0" - "@ethersproject/keccak256" "^5.2.0" - "@ethersproject/logger" "^5.2.0" - "@ethersproject/properties" "^5.2.0" - "@ethersproject/strings" "^5.2.0" - -"@ethersproject/abstract-provider@5.2.0", "@ethersproject/abstract-provider@^5.2.0": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@ethersproject/abstract-provider/-/abstract-provider-5.2.0.tgz#b5c24b162f119b5d241738ded9555186013aa77d" - integrity sha512-Xi7Pt+CulRijc/vskBGIaYMEhafKjoNx8y4RNj/dnSpXHXScOJUSTtypqGBUngZddRbcwZGbHwEr6DZoKZwIZA== - dependencies: - "@ethersproject/bignumber" "^5.2.0" - "@ethersproject/bytes" "^5.2.0" - "@ethersproject/logger" "^5.2.0" - "@ethersproject/networks" "^5.2.0" - "@ethersproject/properties" "^5.2.0" - "@ethersproject/transactions" "^5.2.0" - "@ethersproject/web" "^5.2.0" - -"@ethersproject/abstract-signer@5.2.0", "@ethersproject/abstract-signer@^5.2.0": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@ethersproject/abstract-signer/-/abstract-signer-5.2.0.tgz#8e291fb6558b4190fb3e2fe440a9ffd092a2f459" - integrity sha512-JTXzLUrtoxpOEq1ecH86U7tstkEa9POKAGbGBb+gicbjGgzYYkLR4/LD83SX2/JNWvtYyY8t5errt5ehiy1gxQ== - dependencies: - "@ethersproject/abstract-provider" "^5.2.0" - "@ethersproject/bignumber" "^5.2.0" - "@ethersproject/bytes" "^5.2.0" - "@ethersproject/logger" "^5.2.0" - "@ethersproject/properties" "^5.2.0" - -"@ethersproject/address@5.2.0", "@ethersproject/address@>=5.0.0-beta.128", "@ethersproject/address@^5.0.2", "@ethersproject/address@^5.0.4", "@ethersproject/address@^5.2.0": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.2.0.tgz#afcfa92db84582f54a60a9da361cea4aae450a69" - integrity sha512-2YfZlalWefOEfnr/CdqKRrgMgbKidYc+zG4/ilxSdcryZSux3eBU5/5btAT/hSiaHipUjd8UrWK8esCBHU6QNQ== - dependencies: - "@ethersproject/bignumber" "^5.2.0" - "@ethersproject/bytes" "^5.2.0" - "@ethersproject/keccak256" "^5.2.0" - "@ethersproject/logger" "^5.2.0" - "@ethersproject/rlp" "^5.2.0" - -"@ethersproject/base64@5.2.0", "@ethersproject/base64@^5.2.0": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@ethersproject/base64/-/base64-5.2.0.tgz#e01066d25e5b4e8a051545163bee5def47bd9534" - integrity sha512-D9wOvRE90QBI+yFsKMv0hnANiMzf40Xicq9JZbV9XYzh7srImmwmMcReU2wHjOs9FtEgSJo51Tt+sI1dKPYKDg== - dependencies: - "@ethersproject/bytes" "^5.2.0" - -"@ethersproject/basex@5.2.0", "@ethersproject/basex@^5.2.0": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@ethersproject/basex/-/basex-5.2.0.tgz#f921039e3bdfdab8c5a7ba8b21e81c83fc1ab98b" - integrity sha512-Oo7oX7BmaHLY/8ZsOLI5W0mrSwPBb1iboosN17jfK/4vGAtKjAInDai9I72CzN4NRJaMN5FkFLoPYywGqgGHlg== - dependencies: - "@ethersproject/bytes" "^5.2.0" - "@ethersproject/properties" "^5.2.0" - -"@ethersproject/bignumber@5.2.0", "@ethersproject/bignumber@>=5.0.0-beta.130", "@ethersproject/bignumber@^5.0.7", "@ethersproject/bignumber@^5.1.1", "@ethersproject/bignumber@^5.2.0": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.2.0.tgz#03f91ea740c5adb6f8c6a2e91bb4ee5ffaff5503" - integrity sha512-+MNQTxwV7GEiA4NH/i51UqQ+lY36O0rxPdV+0qzjFSySiyBlJpLk6aaa4UTvKmYWlI7YKZm6vuyCENeYn7qAOw== - dependencies: - "@ethersproject/bytes" "^5.2.0" - "@ethersproject/logger" "^5.2.0" - bn.js "^4.4.0" - -"@ethersproject/bytes@5.2.0", "@ethersproject/bytes@>=5.0.0-beta.129", "@ethersproject/bytes@^5.0.4", "@ethersproject/bytes@^5.2.0": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.2.0.tgz#327917d5a1600f92fd2a9da4052fa6d974583132" - integrity sha512-O1CRpvJDnRTB47vvW8vyqojUZxVookb4LJv/s06TotriU3Xje5WFvlvXJu1yTchtxTz9BbvJw0lFXKpyO6Dn7w== - dependencies: - "@ethersproject/logger" "^5.2.0" - -"@ethersproject/constants@5.2.0", "@ethersproject/constants@>=5.0.0-beta.128", "@ethersproject/constants@^5.0.4", "@ethersproject/constants@^5.2.0": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@ethersproject/constants/-/constants-5.2.0.tgz#ccea78ce325f78abfe7358397c03eec570518d92" - integrity sha512-p+34YG0KbHS20NGdE+Ic0M6egzd7cDvcfoO9RpaAgyAYm3V5gJVqL7UynS87yCt6O6Nlx6wRFboPiM5ctAr+jA== - dependencies: - "@ethersproject/bignumber" "^5.2.0" - -"@ethersproject/contracts@5.2.0", "@ethersproject/contracts@^5.1.1": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@ethersproject/contracts/-/contracts-5.2.0.tgz#f54e12ec4a323f2bf93c338034839cc6dfc1e347" - integrity sha512-/2fg5tWPG6Z4pciEWpwGji3ggGA5j0ChVNF7NTmkOhvFrrJuWnRpzbvYA00nz8tBDNCOV3cwub5zfWRpgwYEJQ== - dependencies: - "@ethersproject/abi" "^5.2.0" - "@ethersproject/abstract-provider" "^5.2.0" - "@ethersproject/abstract-signer" "^5.2.0" - "@ethersproject/address" "^5.2.0" - "@ethersproject/bignumber" "^5.2.0" - "@ethersproject/bytes" "^5.2.0" - "@ethersproject/constants" "^5.2.0" - "@ethersproject/logger" "^5.2.0" - "@ethersproject/properties" "^5.2.0" - "@ethersproject/transactions" "^5.2.0" - -"@ethersproject/experimental@^5.1.2": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@ethersproject/experimental/-/experimental-5.2.0.tgz#2d82877f570a3cb5456005a1fb536247680a6df3" - integrity sha512-R9xc36y3IXd8JuS2qy6OStIoTuUd4ygrFOmNTtBKRpIuQixZ5PpwgCm2RjBewZjmp0BPBLR9CR8ovVi890vnVQ== - dependencies: - "@ethersproject/web" "^5.2.0" - ethers "^5.2.0" - scrypt-js "3.0.1" - -"@ethersproject/hash@5.2.0", "@ethersproject/hash@>=5.0.0-beta.128", "@ethersproject/hash@^5.0.4", "@ethersproject/hash@^5.2.0": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@ethersproject/hash/-/hash-5.2.0.tgz#2d21901eafc5bdb738b4ad96bee364d371ec724b" - integrity sha512-wEGry2HFFSssFiNEkFWMzj1vpdFv4rQlkBp41UfL6J58zKGNycoAWimokITDMk8p7548MKr27h48QfERnNKkRw== - dependencies: - "@ethersproject/abstract-signer" "^5.2.0" - "@ethersproject/address" "^5.2.0" - "@ethersproject/bignumber" "^5.2.0" - "@ethersproject/bytes" "^5.2.0" - "@ethersproject/keccak256" "^5.2.0" - "@ethersproject/logger" "^5.2.0" - "@ethersproject/properties" "^5.2.0" - "@ethersproject/strings" "^5.2.0" - -"@ethersproject/hdnode@5.2.0", "@ethersproject/hdnode@^5.2.0": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@ethersproject/hdnode/-/hdnode-5.2.0.tgz#efea9b2f713e55aa5ba23cc62b4aac6d08dcfa53" - integrity sha512-ffq2JrW5AftCmfWZ8DxpdWdw/x06Yn+e9wrWHLpj8If1+w87W4LbTMRUaUmO1DUSN8H8g/6kMUKCTJPVuxsuOw== - dependencies: - "@ethersproject/abstract-signer" "^5.2.0" - "@ethersproject/basex" "^5.2.0" - "@ethersproject/bignumber" "^5.2.0" - "@ethersproject/bytes" "^5.2.0" - "@ethersproject/logger" "^5.2.0" - "@ethersproject/pbkdf2" "^5.2.0" - "@ethersproject/properties" "^5.2.0" - "@ethersproject/sha2" "^5.2.0" - "@ethersproject/signing-key" "^5.2.0" - "@ethersproject/strings" "^5.2.0" - "@ethersproject/transactions" "^5.2.0" - "@ethersproject/wordlists" "^5.2.0" - -"@ethersproject/json-wallets@5.2.0", "@ethersproject/json-wallets@^5.2.0": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@ethersproject/json-wallets/-/json-wallets-5.2.0.tgz#d41c7c39e4d236b586e26e2145b09ac49dc56608" - integrity sha512-iWxSm9XiugEtaehYD6w1ImmXeatjcGcrQvffZVJHH1UqV4FckDzrOYnZBRHPQRYlnhNVrGTld1+S0Cu4MB8gdw== - dependencies: - "@ethersproject/abstract-signer" "^5.2.0" - "@ethersproject/address" "^5.2.0" - "@ethersproject/bytes" "^5.2.0" - "@ethersproject/hdnode" "^5.2.0" - "@ethersproject/keccak256" "^5.2.0" - "@ethersproject/logger" "^5.2.0" - "@ethersproject/pbkdf2" "^5.2.0" - "@ethersproject/properties" "^5.2.0" - "@ethersproject/random" "^5.2.0" - "@ethersproject/strings" "^5.2.0" - "@ethersproject/transactions" "^5.2.0" - aes-js "3.0.0" - scrypt-js "3.0.1" - -"@ethersproject/keccak256@5.2.0", "@ethersproject/keccak256@>=5.0.0-beta.127", "@ethersproject/keccak256@^5.0.3", "@ethersproject/keccak256@^5.2.0": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.2.0.tgz#15257862807c23f24a3209d1016d322dca85a464" - integrity sha512-LqyxTwVANga5Y3L1yo184czW6b3PibabN8xyE/eOulQLLfXNrHHhwrOTpOhoVRWCICVCD/5SjQfwqTrczjS7jQ== - dependencies: - "@ethersproject/bytes" "^5.2.0" - js-sha3 "0.5.7" - -"@ethersproject/logger@5.2.0", "@ethersproject/logger@>=5.0.0-beta.129", "@ethersproject/logger@^5.0.5", "@ethersproject/logger@^5.2.0": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.2.0.tgz#accf5348251f78b6c8891af67f42490a4ea4e5ae" - integrity sha512-dPZ6/E3YiArgG8dI/spGkaRDry7YZpCntf4gm/c6SI8Mbqiihd7q3nuLN5VvDap/0K3xm3RE1AIUOcUwwh2ezQ== - -"@ethersproject/networks@5.2.0", "@ethersproject/networks@^5.2.0": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.2.0.tgz#66c23c6ac477dd703645b2c971ac842d8b8aa524" - integrity sha512-q+htMgq7wQoEnjlkdHM6t1sktKxNbEB/F6DQBPNwru7KpQ1R0n0UTIXJB8Rb7lSnvjqcAQ40X3iVqm94NJfYDw== - dependencies: - "@ethersproject/logger" "^5.2.0" - -"@ethersproject/pbkdf2@5.2.0", "@ethersproject/pbkdf2@^5.2.0": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@ethersproject/pbkdf2/-/pbkdf2-5.2.0.tgz#8166a7a7238a5fd1d9bb6eb2000fea0f19fdde06" - integrity sha512-qKOoO6yir/qnAgg6OP3U4gRuZ6jl9P7xwggRu/spVfnuaR+wa490AatWLqB1WOXKf6JFjm5yOaT/T5fCICQVdQ== - dependencies: - "@ethersproject/bytes" "^5.2.0" - "@ethersproject/sha2" "^5.2.0" - -"@ethersproject/properties@5.2.0", "@ethersproject/properties@>=5.0.0-beta.131", "@ethersproject/properties@^5.0.3", "@ethersproject/properties@^5.2.0": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@ethersproject/properties/-/properties-5.2.0.tgz#8fadf367f7ac7357019d0224aa579b234c545ac1" - integrity sha512-oNFkzcoGwXXV+/Yp/MLcDLrL/2i360XIy2YN9yRZJPnIbLwjroFNLiRzLs6PyPw1D09Xs8OcPR1/nHv6xDKE2A== - dependencies: - "@ethersproject/logger" "^5.2.0" - -"@ethersproject/providers@5.2.0": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@ethersproject/providers/-/providers-5.2.0.tgz#b2f3e3b2ca4567c8372543ceb6f3c6e3a2370783" - integrity sha512-Yf/ZUqCrVr+jR0SHA9GuNZs4R1xnV9Ibnh1TlOa0ZzI6o+Qf8bEyE550k9bYI4zk2f9x9baX2RRs6BJY7Jz/WA== - dependencies: - "@ethersproject/abstract-provider" "^5.2.0" - "@ethersproject/abstract-signer" "^5.2.0" - "@ethersproject/address" "^5.2.0" - "@ethersproject/basex" "^5.2.0" - "@ethersproject/bignumber" "^5.2.0" - "@ethersproject/bytes" "^5.2.0" - "@ethersproject/constants" "^5.2.0" - "@ethersproject/hash" "^5.2.0" - "@ethersproject/logger" "^5.2.0" - "@ethersproject/networks" "^5.2.0" - "@ethersproject/properties" "^5.2.0" - "@ethersproject/random" "^5.2.0" - "@ethersproject/rlp" "^5.2.0" - "@ethersproject/sha2" "^5.2.0" - "@ethersproject/strings" "^5.2.0" - "@ethersproject/transactions" "^5.2.0" - "@ethersproject/web" "^5.2.0" - bech32 "1.1.4" - ws "7.2.3" - -"@ethersproject/random@5.2.0", "@ethersproject/random@^5.2.0": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@ethersproject/random/-/random-5.2.0.tgz#1d7e19f17d88eda56228a263063826829e49eebe" - integrity sha512-7Nd3qjivBGlDCGDuGYjPi8CXdtVhRZ7NeyBXoJgtnJBwn1S01ahrbMeOUVmRVWrFM0YiSEPEGo7i4xEu2gRPcg== - dependencies: - "@ethersproject/bytes" "^5.2.0" - "@ethersproject/logger" "^5.2.0" - -"@ethersproject/rlp@5.2.0", "@ethersproject/rlp@^5.2.0": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@ethersproject/rlp/-/rlp-5.2.0.tgz#bbf605183818a9d96bdc40323d734c79e26cfaca" - integrity sha512-RqGsELtPWxcFhOOhSr0lQ2hBNT9tBE08WK0tb6VQbCk97EpqkbgP8yXED9PZlWMiRGchJTw6S+ExzK62XMX/fw== - dependencies: - "@ethersproject/bytes" "^5.2.0" - "@ethersproject/logger" "^5.2.0" - -"@ethersproject/sha2@5.2.0", "@ethersproject/sha2@^5.2.0": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@ethersproject/sha2/-/sha2-5.2.0.tgz#ae18fa6c09c6d99fa2b564dac7276bcd513c1579" - integrity sha512-Wqqptfn0PRO2mvmpktPW1HOLrrCyGtxhVQxO1ZyePoGrcEOurhICOlIvkTogoX4Q928D3Z9XtSSCUbdOJUF2kg== - dependencies: - "@ethersproject/bytes" "^5.2.0" - "@ethersproject/logger" "^5.2.0" - hash.js "1.1.3" - -"@ethersproject/signing-key@5.2.0", "@ethersproject/signing-key@^5.2.0": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@ethersproject/signing-key/-/signing-key-5.2.0.tgz#e8eb10d3c0f4a575479db8d70c62aaf93cd384d1" - integrity sha512-9A+dVSkrVAPuhJnWqLWV/NkKi/KB4iagTKEuojfuApUfeIHEhpwQ0Jx3cBimk7qWISSSKdgiAmIqpvVtZ5FEkg== - dependencies: - "@ethersproject/bytes" "^5.2.0" - "@ethersproject/logger" "^5.2.0" - "@ethersproject/properties" "^5.2.0" - bn.js "^4.4.0" - elliptic "6.5.4" - -"@ethersproject/solidity@5.2.0": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@ethersproject/solidity/-/solidity-5.2.0.tgz#ac902d8f8b11bf58fd37ccf77392178cbbd0b08f" - integrity sha512-EEFlNyEnONW3CWF8UGWPcqxJUHiaIoofO7itGwO/2gvGpnwlL+WUV+GmQoHNxmn+QJeOHspnZuh6NOVrJL6H1g== - dependencies: - "@ethersproject/bignumber" "^5.2.0" - "@ethersproject/bytes" "^5.2.0" - "@ethersproject/keccak256" "^5.2.0" - "@ethersproject/sha2" "^5.2.0" - "@ethersproject/strings" "^5.2.0" - -"@ethersproject/strings@5.2.0", "@ethersproject/strings@>=5.0.0-beta.130", "@ethersproject/strings@^5.0.4", "@ethersproject/strings@^5.2.0": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@ethersproject/strings/-/strings-5.2.0.tgz#e93d989859587191c3f64bda124d9dedbc3f5a97" - integrity sha512-RmjX800wRYKgrzo2ZCSlA8OCQYyq4+M46VgjSVDVyYkLZctBXC3epqlppDA24R7eo856KNbXqezZsMnHT+sSuA== - dependencies: - "@ethersproject/bytes" "^5.2.0" - "@ethersproject/constants" "^5.2.0" - "@ethersproject/logger" "^5.2.0" - -"@ethersproject/transactions@5.2.0", "@ethersproject/transactions@^5.0.0-beta.135", "@ethersproject/transactions@^5.1.1", "@ethersproject/transactions@^5.2.0": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@ethersproject/transactions/-/transactions-5.2.0.tgz#052e2ef8f8adf7037ebe4cc47aad2a61950e6491" - integrity sha512-QrGbhGYsouNNclUp3tWMbckMsuXJTOsA56kT3BuRrLlXJcUH7myIihajXdSfKcyJsvHJPrGZP+U3TKh+sLzZtg== - dependencies: - "@ethersproject/address" "^5.2.0" - "@ethersproject/bignumber" "^5.2.0" - "@ethersproject/bytes" "^5.2.0" - "@ethersproject/constants" "^5.2.0" - "@ethersproject/keccak256" "^5.2.0" - "@ethersproject/logger" "^5.2.0" - "@ethersproject/properties" "^5.2.0" - "@ethersproject/rlp" "^5.2.0" - "@ethersproject/signing-key" "^5.2.0" - -"@ethersproject/units@5.2.0": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@ethersproject/units/-/units-5.2.0.tgz#08643e5d4583ecc1a32b103c1157f7ae80803392" - integrity sha512-yrwlyomXcBBHp5oSrLxlLkyHN7dVu3PO7hMbQXc00h388zU4TF3o/PAIUhh+x695wgJ19Fa8YgUWCab3a1RDwA== - dependencies: - "@ethersproject/bignumber" "^5.2.0" - "@ethersproject/constants" "^5.2.0" - "@ethersproject/logger" "^5.2.0" - -"@ethersproject/wallet@5.2.0": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@ethersproject/wallet/-/wallet-5.2.0.tgz#b5a8406676067e34f633536a4cb53c2ff98c0b5c" - integrity sha512-uPdjZwUmAJLo1+ybR/G/rL9pv/NEcCqOsjn6RJFvG7RmwP2kS1v5C+F+ysgx2W/PxBIVT+2IEsfXLbBz8s/6Rg== - dependencies: - "@ethersproject/abstract-provider" "^5.2.0" - "@ethersproject/abstract-signer" "^5.2.0" - "@ethersproject/address" "^5.2.0" - "@ethersproject/bignumber" "^5.2.0" - "@ethersproject/bytes" "^5.2.0" - "@ethersproject/hash" "^5.2.0" - "@ethersproject/hdnode" "^5.2.0" - "@ethersproject/json-wallets" "^5.2.0" - "@ethersproject/keccak256" "^5.2.0" - "@ethersproject/logger" "^5.2.0" - "@ethersproject/properties" "^5.2.0" - "@ethersproject/random" "^5.2.0" - "@ethersproject/signing-key" "^5.2.0" - "@ethersproject/transactions" "^5.2.0" - "@ethersproject/wordlists" "^5.2.0" - -"@ethersproject/web@5.2.0", "@ethersproject/web@^5.2.0": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@ethersproject/web/-/web-5.2.0.tgz#47d8e152e7fcc07ba0aff4f99fde268fde79dd7a" - integrity sha512-mYb9qxGlOBFR2pR6t1CZczuqqX6r8RQGn7MtwrBciMex3cvA/qs+wbmcDgl+/OZY0Pco/ih6WHQRnVi+4sBeCQ== - dependencies: - "@ethersproject/base64" "^5.2.0" - "@ethersproject/bytes" "^5.2.0" - "@ethersproject/logger" "^5.2.0" - "@ethersproject/properties" "^5.2.0" - "@ethersproject/strings" "^5.2.0" - -"@ethersproject/wordlists@5.2.0", "@ethersproject/wordlists@^5.2.0": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@ethersproject/wordlists/-/wordlists-5.2.0.tgz#afcce0229e9ef64af1bf8a1e96571fa441e9f444" - integrity sha512-/7TG5r/Zm8Wd9WhoqQ4QnntgMkIfIZ8QVrpU81muiChLD26XLOgmyiqKPL7K058uYt7UZ0wzbXjxyCYadU3xFQ== - dependencies: - "@ethersproject/bytes" "^5.2.0" - "@ethersproject/hash" "^5.2.0" - "@ethersproject/logger" "^5.2.0" - "@ethersproject/properties" "^5.2.0" - "@ethersproject/strings" "^5.2.0" - -"@graphprotocol/common-ts@^1.6.0": - version "1.6.0" - resolved "https://registry.yarnpkg.com/@graphprotocol/common-ts/-/common-ts-1.6.0.tgz#b8ee56ae8abad2c836423d5d43bc250f0f2d69e7" - integrity sha512-3O8yR+XpmZRbb6TFGLoKCwEWftRrUpSKSMZ7d3p+AdqN7xaFBSZvBk8XbzeoMLvLCnYO7mid0VWGWE7FC3yDjA== - dependencies: - "@ethersproject/bignumber" "^5.1.1" - "@ethersproject/contracts" "^5.1.1" - "@ethersproject/transactions" "^5.1.1" - "@graphprotocol/contracts" "1.4.0" - "@graphprotocol/pino-sentry-simple" "0.7.1" - "@urql/core" "1.13.1" - "@urql/exchange-execute" "1.0.1" - body-parser "1.19.0" - bs58 "4.0.1" - cors "2.8.5" - cross-fetch "3.0.6" - ethers "^5.1.3" - express "4.17.1" - graphql "15.4.0" - graphql-tag "2.11.0" - helmet "4.1.1" - morgan "1.10.0" - ngeohash "0.6.3" - pg "8.4.2" - pg-hstore "2.3.3" - pino "6.7.0" - pino-multi-stream "5.1.1" - prom-client "12.0.0" - sequelize "6.3.5" - -"@graphprotocol/contracts@1.4.0": - version "1.4.0" - resolved "https://registry.yarnpkg.com/@graphprotocol/contracts/-/contracts-1.4.0.tgz#7271e83e3444c08663216e91899ffc0d98fc1ff5" - integrity sha512-DvUtcOXlAREzcBW4tROpFdQNGTDqcCeNvhGuX2s+6C1znr6kDVDgIrXmKJ+ofGRzJxCNe3QAtlPdFg00IQL25w== - dependencies: - ethers "^5.1.3" - -"@graphprotocol/pino-sentry-simple@0.7.1": - version "0.7.1" - resolved "https://registry.yarnpkg.com/@graphprotocol/pino-sentry-simple/-/pino-sentry-simple-0.7.1.tgz#ac08b978bfa33178b9e809f53ae0983ff5f724d8" - integrity sha512-iccKFdFBjarSp8/liXuK1EtGq8Vwn118tqymbOJBxblecRsi4rOebk63qnL+dK/a0IvxH6h2+RjjWDbRt7UsUA== - dependencies: - "@sentry/node" "^5.21.1" - pumpify "^2.0.1" - split2 "^3.1.1" - through2 "^3.0.1" - -"@graphql-typed-document-node/core@^3.1.0": - version "3.1.0" - resolved "https://registry.yarnpkg.com/@graphql-typed-document-node/core/-/core-3.1.0.tgz#0eee6373e11418bfe0b5638f654df7a4ca6a3950" - integrity sha512-wYn6r8zVZyQJ6rQaALBEln5B1pzxb9shV5Ef97kTvn6yVGrqyXVnDqnU24MXnFubR+rZjBY9NWuxX3FB2sTsjg== - -"@multiformats/base-x@^4.0.1": - version "4.0.1" - resolved "https://registry.yarnpkg.com/@multiformats/base-x/-/base-x-4.0.1.tgz#95ff0fa58711789d53aefb2590a8b7a4e715d121" - integrity sha512-eMk0b9ReBbV23xXU693TAIrLyeO5iTgBZGSJfpqriG8UkYvr/hC9u9pyMlAakDNHWmbhMZCDs6KQO0jzKD8OTw== - -"@nodelib/fs.scandir@2.1.4": - version "2.1.4" - resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.4.tgz#d4b3549a5db5de2683e0c1071ab4f140904bbf69" - integrity sha512-33g3pMJk3bg5nXbL/+CY6I2eJDzZAni49PfJnL5fghPTggPvBd/pFNSgJsdAgWptuFu7qq/ERvOYFlhvsLTCKA== - dependencies: - "@nodelib/fs.stat" "2.0.4" - run-parallel "^1.1.9" - -"@nodelib/fs.stat@2.0.4", "@nodelib/fs.stat@^2.0.2": - version "2.0.4" - resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.4.tgz#a3f2dd61bab43b8db8fa108a121cfffe4c676655" - integrity sha512-IYlHJA0clt2+Vg7bccq+TzRdJvv19c2INqBSsoOLp1je7xjtr7J26+WXR72MCdvU9q1qTzIWDfhMf+DRvQJK4Q== - -"@nodelib/fs.walk@^1.2.3": - version "1.2.6" - resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.6.tgz#cce9396b30aa5afe9e3756608f5831adcb53d063" - integrity sha512-8Broas6vTtW4GIXTAHDoE32hnN2M5ykgCpWGbuXHQ15vEMqr23pB76e/GZcYsZCHALv50ktd24qhEyKr6wBtow== - dependencies: - "@nodelib/fs.scandir" "2.1.4" - fastq "^1.6.0" - -"@nomiclabs/hardhat-ethers@^2.0.2": - version "2.0.2" - resolved "https://registry.yarnpkg.com/@nomiclabs/hardhat-ethers/-/hardhat-ethers-2.0.2.tgz#c472abcba0c5185aaa4ad4070146e95213c68511" - integrity sha512-6quxWe8wwS4X5v3Au8q1jOvXYEPkS1Fh+cME5u6AwNdnI4uERvPlVjlgRWzpnb+Rrt1l/cEqiNRH9GlsBMSDQg== - -"@nomiclabs/hardhat-etherscan@^2.1.1": - version "2.1.2" - resolved "https://registry.yarnpkg.com/@nomiclabs/hardhat-etherscan/-/hardhat-etherscan-2.1.2.tgz#333b70a6116e922d16de2ef833dcb7191319afdd" - integrity sha512-SExzaBuHlnmHw0HKkElHITzdvhUQmlIRc2tlaywzgvPbh7WoI24nYqZ4N0CO+JXSDgRpFycvQNA8zRaCqjuqUg== - dependencies: - "@ethersproject/abi" "^5.0.2" - "@ethersproject/address" "^5.0.2" - cbor "^5.0.2" - debug "^4.1.1" - fs-extra "^7.0.1" - node-fetch "^2.6.0" - semver "^6.3.0" - -"@nomiclabs/hardhat-waffle@^2.0.1": - version "2.0.1" - resolved "https://registry.yarnpkg.com/@nomiclabs/hardhat-waffle/-/hardhat-waffle-2.0.1.tgz#5d43654fba780720c5033dea240fe14f70ef4bd2" - integrity sha512-2YR2V5zTiztSH9n8BYWgtv3Q+EL0N5Ltm1PAr5z20uAY4SkkfylJ98CIqt18XFvxTD5x4K2wKBzddjV9ViDAZQ== - dependencies: - "@types/sinon-chai" "^3.2.3" - "@types/web3" "1.0.19" - -"@openzeppelin/contracts@^3.4.1": - version "3.4.1" - resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-3.4.1.tgz#03c891fec7f93be0ae44ed74e57a122a38732ce7" - integrity sha512-cUriqMauq1ylzP2TxePNdPqkwI7Le3Annh4K9rrpvKfSBB/bdW+Iu1ihBaTIABTAAJ85LmKL5SSPPL9ry8d1gQ== - -"@openzeppelin/hardhat-upgrades@^1.6.0": - version "1.8.2" - resolved "https://registry.yarnpkg.com/@openzeppelin/hardhat-upgrades/-/hardhat-upgrades-1.8.2.tgz#553c116f291bf1492dfb73ed3feda079b5b400a7" - integrity sha512-G+z1WdsjBYQX4j0yPU+pM3rcmVgQNI6g3N05prxpXgAj8QhSDDisfWH2hC1XW8FLm7+dijz7FpUaEEdidpOA9Q== - dependencies: - "@openzeppelin/upgrades-core" "^1.7.3" - -"@openzeppelin/upgrades-core@^1.7.3": - version "1.7.6" - resolved "https://registry.yarnpkg.com/@openzeppelin/upgrades-core/-/upgrades-core-1.7.6.tgz#2c5e89b272aaf2164f51ca99167ffeecdab13749" - integrity sha512-xXoUJGWI2MHLtMwS2GN3PiymZ9WIj+uRAMrm8HIz0genGSIO6PwPMlmaUyq3O8/JzTMgpVV92aMcPjOkvI5SmQ== - dependencies: - bn.js "^5.1.2" - cbor "^7.0.0" - chalk "^4.1.0" - compare-versions "^3.6.0" - debug "^4.1.1" - ethereumjs-util "^7.0.3" - proper-lockfile "^4.1.1" - solidity-ast "^0.4.15" - -"@resolver-engine/core@^0.3.3": - version "0.3.3" - resolved "https://registry.yarnpkg.com/@resolver-engine/core/-/core-0.3.3.tgz#590f77d85d45bc7ecc4e06c654f41345db6ca967" - integrity sha512-eB8nEbKDJJBi5p5SrvrvILn4a0h42bKtbCTri3ZxCGt6UvoQyp7HnGOfki944bUjBSHKK3RvgfViHn+kqdXtnQ== - dependencies: - debug "^3.1.0" - is-url "^1.2.4" - request "^2.85.0" - -"@resolver-engine/fs@^0.3.3": - version "0.3.3" - resolved "https://registry.yarnpkg.com/@resolver-engine/fs/-/fs-0.3.3.tgz#fbf83fa0c4f60154a82c817d2fe3f3b0c049a973" - integrity sha512-wQ9RhPUcny02Wm0IuJwYMyAG8fXVeKdmhm8xizNByD4ryZlx6PP6kRen+t/haF43cMfmaV7T3Cx6ChOdHEhFUQ== - dependencies: - "@resolver-engine/core" "^0.3.3" - debug "^3.1.0" - -"@resolver-engine/imports-fs@^0.3.3": - version "0.3.3" - resolved "https://registry.yarnpkg.com/@resolver-engine/imports-fs/-/imports-fs-0.3.3.tgz#4085db4b8d3c03feb7a425fbfcf5325c0d1e6c1b" - integrity sha512-7Pjg/ZAZtxpeyCFlZR5zqYkz+Wdo84ugB5LApwriT8XFeQoLwGUj4tZFFvvCuxaNCcqZzCYbonJgmGObYBzyCA== - dependencies: - "@resolver-engine/fs" "^0.3.3" - "@resolver-engine/imports" "^0.3.3" - debug "^3.1.0" - -"@resolver-engine/imports@^0.3.3": - version "0.3.3" - resolved "https://registry.yarnpkg.com/@resolver-engine/imports/-/imports-0.3.3.tgz#badfb513bb3ff3c1ee9fd56073e3144245588bcc" - integrity sha512-anHpS4wN4sRMwsAbMXhMfOD/y4a4Oo0Cw/5+rue7hSwGWsDOQaAU1ClK1OxjUC35/peazxEl8JaSRRS+Xb8t3Q== - dependencies: - "@resolver-engine/core" "^0.3.3" - debug "^3.1.0" - hosted-git-info "^2.6.0" - path-browserify "^1.0.0" - url "^0.11.0" - -"@sentry/core@5.30.0": - version "5.30.0" - resolved "https://registry.yarnpkg.com/@sentry/core/-/core-5.30.0.tgz#6b203664f69e75106ee8b5a2fe1d717379b331f3" - integrity sha512-TmfrII8w1PQZSZgPpUESqjB+jC6MvZJZdLtE/0hZ+SrnKhW3x5WlYLvTXZpcWePYBku7rl2wn1RZu6uT0qCTeg== - dependencies: - "@sentry/hub" "5.30.0" - "@sentry/minimal" "5.30.0" - "@sentry/types" "5.30.0" - "@sentry/utils" "5.30.0" - tslib "^1.9.3" - -"@sentry/hub@5.30.0": - version "5.30.0" - resolved "https://registry.yarnpkg.com/@sentry/hub/-/hub-5.30.0.tgz#2453be9b9cb903404366e198bd30c7ca74cdc100" - integrity sha512-2tYrGnzb1gKz2EkMDQcfLrDTvmGcQPuWxLnJKXJvYTQDGLlEvi2tWz1VIHjunmOvJrB5aIQLhm+dcMRwFZDCqQ== - dependencies: - "@sentry/types" "5.30.0" - "@sentry/utils" "5.30.0" - tslib "^1.9.3" - -"@sentry/minimal@5.30.0": - version "5.30.0" - resolved "https://registry.yarnpkg.com/@sentry/minimal/-/minimal-5.30.0.tgz#ce3d3a6a273428e0084adcb800bc12e72d34637b" - integrity sha512-BwWb/owZKtkDX+Sc4zCSTNcvZUq7YcH3uAVlmh/gtR9rmUvbzAA3ewLuB3myi4wWRAMEtny6+J/FN/x+2wn9Xw== - dependencies: - "@sentry/hub" "5.30.0" - "@sentry/types" "5.30.0" - tslib "^1.9.3" - -"@sentry/node@^5.18.1", "@sentry/node@^5.21.1": - version "5.30.0" - resolved "https://registry.yarnpkg.com/@sentry/node/-/node-5.30.0.tgz#4ca479e799b1021285d7fe12ac0858951c11cd48" - integrity sha512-Br5oyVBF0fZo6ZS9bxbJZG4ApAjRqAnqFFurMVJJdunNb80brh7a5Qva2kjhm+U6r9NJAB5OmDyPkA1Qnt+QVg== - dependencies: - "@sentry/core" "5.30.0" - "@sentry/hub" "5.30.0" - "@sentry/tracing" "5.30.0" - "@sentry/types" "5.30.0" - "@sentry/utils" "5.30.0" - cookie "^0.4.1" - https-proxy-agent "^5.0.0" - lru_map "^0.3.3" - tslib "^1.9.3" - -"@sentry/tracing@5.30.0": - version "5.30.0" - resolved "https://registry.yarnpkg.com/@sentry/tracing/-/tracing-5.30.0.tgz#501d21f00c3f3be7f7635d8710da70d9419d4e1f" - integrity sha512-dUFowCr0AIMwiLD7Fs314Mdzcug+gBVo/+NCMyDw8tFxJkwWAKl7Qa2OZxLQ0ZHjakcj1hNKfCQJ9rhyfOl4Aw== - dependencies: - "@sentry/hub" "5.30.0" - "@sentry/minimal" "5.30.0" - "@sentry/types" "5.30.0" - "@sentry/utils" "5.30.0" - tslib "^1.9.3" - -"@sentry/types@5.30.0": - version "5.30.0" - resolved "https://registry.yarnpkg.com/@sentry/types/-/types-5.30.0.tgz#19709bbe12a1a0115bc790b8942917da5636f402" - integrity sha512-R8xOqlSTZ+htqrfteCWU5Nk0CDN5ApUTvrlvBuiH1DyP6czDZ4ktbZB0hAgBlVcK0U+qpD3ag3Tqqpa5Q67rPw== - -"@sentry/utils@5.30.0": - version "5.30.0" - resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-5.30.0.tgz#9a5bd7ccff85ccfe7856d493bffa64cabc41e980" - integrity sha512-zaYmoH0NWWtvnJjC9/CBseXMtKHm/tm40sz3YfJRxeQjyzRqNQPgivpd9R/oDJCYj999mzdW382p/qi2ypjLww== - dependencies: - "@sentry/types" "5.30.0" - tslib "^1.9.3" - -"@sindresorhus/is@^0.14.0": - version "0.14.0" - resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.14.0.tgz#9fb3a3cf3132328151f353de4632e01e52102bea" - integrity sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ== - -"@sinonjs/commons@^1.7.0": - version "1.8.3" - resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.8.3.tgz#3802ddd21a50a949b6721ddd72da36e67e7f1b2d" - integrity sha512-xkNcLAn/wZaX14RPlwizcKicDk9G3F8m2nU3L7Ukm5zBgTwiT0wsoFAHx9Jq56fJA1z/7uKGtCRu16sOUCLIHQ== - dependencies: - type-detect "4.0.8" - -"@sinonjs/fake-timers@^7.1.0": - version "7.1.1" - resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-7.1.1.tgz#7a6ac09ed4c3fe1854a2002e08db15be6c8570b8" - integrity sha512-am34LJf0N2nON/PT9G7pauA+xjcwX9P6x31m4hBgfUeSXYRZBRv/R6EcdWs8iV4XJjPO++NTsrj7ua/cN2s6ZA== - dependencies: - "@sinonjs/commons" "^1.7.0" - -"@solidity-parser/parser@^0.11.0": - version "0.11.1" - resolved "https://registry.yarnpkg.com/@solidity-parser/parser/-/parser-0.11.1.tgz#fa840af64840c930f24a9c82c08d4a092a068add" - integrity sha512-H8BSBoKE8EubJa0ONqecA2TviT3TnHeC4NpgnAHSUiuhZoQBfPB4L2P9bs8R6AoTW10Endvh3vc+fomVMIDIYQ== - -"@solidity-parser/parser@^0.12.0": - version "0.12.2" - resolved "https://registry.yarnpkg.com/@solidity-parser/parser/-/parser-0.12.2.tgz#1afad367cb29a2ed8cdd4a3a62701c2821fb578f" - integrity sha512-d7VS7PxgMosm5NyaiyDJRNID5pK4AWj1l64Dbz0147hJgy5k2C0/ZiKK/9u5c5K+HRUVHmp+RMvGEjGh84oA5Q== - -"@solidity-parser/parser@^0.13.0": - version "0.13.1" - resolved "https://registry.yarnpkg.com/@solidity-parser/parser/-/parser-0.13.1.tgz#233da4588e4e593ebca0e4c920d3bac1c3bf472c" - integrity sha512-V2iBpgVOgWGDQa221hiPjdhKnLcFYltQH1uwT42nu6qn4VX+jq7KLr6Fs31pmIpxaGbOmiKneKHXJ+BL8rO+xQ== - dependencies: - antlr4ts "^0.5.0-alpha.4" - -"@szmarczak/http-timer@^1.1.2": - version "1.1.2" - resolved "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-1.1.2.tgz#b1665e2c461a2cd92f4c1bbf50d5454de0d4b421" - integrity sha512-XIB2XbzHTN6ieIjfIMV9hlVcfPU26s2vafYWQcZHWXHOxiaRZYEDKEwdl129Zyg50+foYV2jCgtrqSA6qNuNSA== - dependencies: - defer-to-connect "^1.0.1" - -"@tenderly/hardhat-tenderly@^1.0.11": - version "1.0.12" - resolved "https://registry.yarnpkg.com/@tenderly/hardhat-tenderly/-/hardhat-tenderly-1.0.12.tgz#fa64da2bf2f6d35a1c131ac9ccaf2f7e8b189a50" - integrity sha512-zx2zVpbBxGWVp+aLgf59sZR5lxdqfq/PjqUhga6+iazukQNu/Y6pLfVnCcF1ggvLsf7gnMjwLe3YEx/GxCAykQ== - dependencies: - axios "^0.21.1" - fs-extra "^9.0.1" - js-yaml "^3.14.0" - -"@truffle/error@^0.0.14": - version "0.0.14" - resolved "https://registry.yarnpkg.com/@truffle/error/-/error-0.0.14.tgz#59683b5407bede7bddf16d80dc5592f9c5e5fa05" - integrity sha512-utJx+SZYoMqk8wldQG4gCVKhV8GwMJbWY7sLXFT/D8wWZTnE2peX7URFJh/cxkjTRCO328z1s2qewkhyVsu2HA== - -"@truffle/interface-adapter@^0.4.24": - version "0.4.24" - resolved "https://registry.yarnpkg.com/@truffle/interface-adapter/-/interface-adapter-0.4.24.tgz#5d6d4f10c756e967f19ac2ad1620d11d25c034bb" - integrity sha512-2Zho4dJbm/XGwNleY7FdxcjXiAR3SzdGklgrAW4N/YVmltaJv6bT56ACIbPNN6AdzkTSTO65OlsB/63sfSa/VA== - dependencies: - bn.js "^5.1.3" - ethers "^4.0.32" - web3 "1.3.6" - -"@truffle/provider@^0.2.24": - version "0.2.31" - resolved "https://registry.yarnpkg.com/@truffle/provider/-/provider-0.2.31.tgz#4a52fedb663366a36214dc9f33772c832c941b61" - integrity sha512-IA1EYgwXX3sJgxmOEq6PDbSKaiOs4cSm1AImsZawomDW1MnmQY+6IotRrUsfUZsYPto/2ovNPfawNoxvAM0KzQ== - dependencies: - "@truffle/error" "^0.0.14" - "@truffle/interface-adapter" "^0.4.24" - web3 "1.3.6" - -"@typechain/ethers-v5@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@typechain/ethers-v5/-/ethers-v5-2.0.0.tgz#cd3ca1590240d587ca301f4c029b67bfccd08810" - integrity sha512-0xdCkyGOzdqh4h5JSf+zoWx85IusEjDcPIwNEHP8mrWSnCae4rvrqB+/gtpdNfX7zjlFlZiMeePn2r63EI3Lrw== - dependencies: - ethers "^5.0.2" - -"@typechain/ethers-v5@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@typechain/ethers-v5/-/ethers-v5-7.0.0.tgz#cadb5262b3827d1616c21f4ba86a36a71269bd7e" - integrity sha512-ykNaqYcQ1yC928x8bogL9LECUg0osfqqHCKBhP7qbGlNfvC/bvTiIfnjQUgXUYWEJRx5r0Y78vcKMo8F3sJTBA== - -"@typechain/hardhat@^2.0.0": - version "2.0.1" - resolved "https://registry.yarnpkg.com/@typechain/hardhat/-/hardhat-2.0.1.tgz#93ddf1ff3a03ca2112c5f20aac598d3faae4d54b" - integrity sha512-R5q9M9IDYIs9fgqz9zEJrAVKE5N9HOMhhvrr81oSEZvoHkI8NZrr6pLWsqdifYqHnT00ww6ZxllPIrBjW1qnxA== - -"@types/abstract-leveldown@*": - version "5.0.1" - resolved "https://registry.yarnpkg.com/@types/abstract-leveldown/-/abstract-leveldown-5.0.1.tgz#3c7750d0186b954c7f2d2f6acc8c3c7ba0c3412e" - integrity sha512-wYxU3kp5zItbxKmeRYCEplS2MW7DzyBnxPGj+GJVHZEUZiK/nn5Ei1sUFgURDh+X051+zsGe28iud3oHjrYWQQ== - -"@types/bn.js@*", "@types/bn.js@^5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-5.1.0.tgz#32c5d271503a12653c62cf4d2b45e6eab8cebc68" - integrity sha512-QSSVYj7pYFN49kW77o2s9xTCwZ8F2xLbjLLSEVh8D2F4JUhZtPAGOFLTD+ffqksBx/u4cE/KImFjyhqCjn/LIA== - dependencies: - "@types/node" "*" - -"@types/bn.js@^4.11.3", "@types/bn.js@^4.11.5": - version "4.11.6" - resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-4.11.6.tgz#c306c70d9358aaea33cd4eda092a742b9505967c" - integrity sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg== - dependencies: - "@types/node" "*" - -"@types/bs58@^4.0.1": - version "4.0.1" - resolved "https://registry.yarnpkg.com/@types/bs58/-/bs58-4.0.1.tgz#3d51222aab067786d3bc3740a84a7f5a0effaa37" - integrity sha512-yfAgiWgVLjFCmRv8zAcOIHywYATEwiTVccTLnRp6UxTNavT55M9d/uhK3T03St/+8/z/wW+CRjGKUNmEqoHHCA== - dependencies: - base-x "^3.0.6" - -"@types/chai@*": - version "4.2.18" - resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.2.18.tgz#0c8e298dbff8205e2266606c1ea5fbdba29b46e4" - integrity sha512-rS27+EkB/RE1Iz3u0XtVL5q36MGDWbgYe7zWiodyKNUnthxY0rukK5V36eiUCtCisB7NN8zKYH6DO2M37qxFEQ== - -"@types/concat-stream@^1.6.0": - version "1.6.0" - resolved "https://registry.yarnpkg.com/@types/concat-stream/-/concat-stream-1.6.0.tgz#394dbe0bb5fee46b38d896735e8b68ef2390d00d" - integrity sha1-OU2+C7X+5Gs42JZzXoto7yOQ0A0= - dependencies: - "@types/node" "*" - -"@types/dotenv@^8.2.0": - version "8.2.0" - resolved "https://registry.yarnpkg.com/@types/dotenv/-/dotenv-8.2.0.tgz#5cd64710c3c98e82d9d15844375a33bf1b45d053" - integrity sha512-ylSC9GhfRH7m1EUXBXofhgx4lUWmFeQDINW5oLuS+gxWdfUeW4zJdeVTYVkexEW+e2VUvlZR2kGnGGipAWR7kw== - dependencies: - dotenv "*" - -"@types/form-data@0.0.33": - version "0.0.33" - resolved "https://registry.yarnpkg.com/@types/form-data/-/form-data-0.0.33.tgz#c9ac85b2a5fd18435b8c85d9ecb50e6d6c893ff8" - integrity sha1-yayFsqX9GENbjIXZ7LUObWyJP/g= - dependencies: - "@types/node" "*" - -"@types/glob@^7.1.1": - version "7.1.3" - resolved "https://registry.yarnpkg.com/@types/glob/-/glob-7.1.3.tgz#e6ba80f36b7daad2c685acd9266382e68985c183" - integrity sha512-SEYeGAIQIQX8NN6LDKprLjbrd5dARM5EXsd8GI/A5l0apYI1fGMWgPHSe4ZKL4eozlAyI+doUE9XbYS4xCkQ1w== - dependencies: - "@types/minimatch" "*" - "@types/node" "*" - -"@types/inquirer@^7.3.1": - version "7.3.1" - resolved "https://registry.yarnpkg.com/@types/inquirer/-/inquirer-7.3.1.tgz#1f231224e7df11ccfaf4cf9acbcc3b935fea292d" - integrity sha512-osD38QVIfcdgsPCT0V3lD7eH0OFurX71Jft18bZrsVQWVRt6TuxRzlr0GJLrxoHZR2V5ph7/qP8se/dcnI7o0g== - dependencies: - "@types/through" "*" - rxjs "^6.4.0" - -"@types/json-schema@^7.0.3": - version "7.0.7" - resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.7.tgz#98a993516c859eb0d5c4c8f098317a9ea68db9ad" - integrity sha512-cxWFQVseBm6O9Gbw1IWb8r6OS4OhSt3hPZLkFApLjM8TEXROBuQGLAH2i2gZpcXdLBIrpXuTDhH7Vbm1iXmNGA== - -"@types/json5@^0.0.29": - version "0.0.29" - resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" - integrity sha1-7ihweulOEdK4J7y+UnC86n8+ce4= - -"@types/levelup@^4.3.0": - version "4.3.1" - resolved "https://registry.yarnpkg.com/@types/levelup/-/levelup-4.3.1.tgz#7a53b9fd510716e11b2065332790fdf5f9b950b9" - integrity sha512-n//PeTpbHLjMLTIgW5B/g06W/6iuTBHuvUka2nFL9APMSVMNe2r4enADfu3CIE9IyV9E+uquf9OEQQqrDeg24A== - dependencies: - "@types/abstract-leveldown" "*" - "@types/node" "*" - -"@types/lru-cache@^5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@types/lru-cache/-/lru-cache-5.1.0.tgz#57f228f2b80c046b4a1bd5cac031f81f207f4f03" - integrity sha512-RaE0B+14ToE4l6UqdarKPnXwVDuigfFv+5j9Dze/Nqr23yyuqdNvzcZi3xB+3Agvi5R4EOgAksfv3lXX4vBt9w== - -"@types/minimatch@*": - version "3.0.4" - resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.4.tgz#f0ec25dbf2f0e4b18647313ac031134ca5b24b21" - integrity sha512-1z8k4wzFnNjVK/tlxvrWuK5WMt6mydWWP7+zvH5eFep4oj+UkrfiJTRtjCeBXNpwaA/FYqqtb4/QS4ianFpIRA== - -"@types/minimist@^1.2.1": - version "1.2.1" - resolved "https://registry.yarnpkg.com/@types/minimist/-/minimist-1.2.1.tgz#283f669ff76d7b8260df8ab7a4262cc83d988256" - integrity sha512-fZQQafSREFyuZcdWFAExYjBiCL7AUCdgsk80iO0q4yihYYdcIiH28CcuPTGFgLOCC8RlW49GSQxdHwZP+I7CNg== - -"@types/mkdirp@^0.5.2": - version "0.5.2" - resolved "https://registry.yarnpkg.com/@types/mkdirp/-/mkdirp-0.5.2.tgz#503aacfe5cc2703d5484326b1b27efa67a339c1f" - integrity sha512-U5icWpv7YnZYGsN4/cmh3WD2onMY0aJIiTE6+51TwJCttdHvtCYmkBNOobHlXwrJRL0nkH9jH4kD+1FAdMN4Tg== - dependencies: - "@types/node" "*" - -"@types/mocha@^8.2.2": - version "8.2.2" - resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-8.2.2.tgz#91daa226eb8c2ff261e6a8cbf8c7304641e095e0" - integrity sha512-Lwh0lzzqT5Pqh6z61P3c3P5nm6fzQK/MMHl9UKeneAeInVflBSz1O2EkX6gM6xfJd7FBXBY5purtLx7fUiZ7Hw== - -"@types/node-fetch@^2.5.5": - version "2.5.10" - resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.5.10.tgz#9b4d4a0425562f9fcea70b12cb3fcdd946ca8132" - integrity sha512-IpkX0AasN44hgEad0gEF/V6EgR5n69VEqPEgnmoM8GsIGro3PowbWs4tR6IhxUTyPLpOn+fiGG6nrQhcmoCuIQ== - dependencies: - "@types/node" "*" - form-data "^3.0.0" - -"@types/node@*", "@types/node@^15.0.1": - version "15.6.1" - resolved "https://registry.yarnpkg.com/@types/node/-/node-15.6.1.tgz#32d43390d5c62c5b6ec486a9bc9c59544de39a08" - integrity sha512-7EIraBEyRHEe7CH+Fm1XvgqU6uwZN8Q7jppJGcqjROMT29qhAuuOxYB1uEY5UMYQKEmA5D+5tBnhdaPXSsLONA== - -"@types/node@^10.0.3": - version "10.17.60" - resolved "https://registry.yarnpkg.com/@types/node/-/node-10.17.60.tgz#35f3d6213daed95da7f0f73e75bcc6980e90597b" - integrity sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw== - -"@types/node@^12.12.6": - version "12.20.13" - resolved "https://registry.yarnpkg.com/@types/node/-/node-12.20.13.tgz#e743bae112bd779ac9650f907197dd2caa7f0364" - integrity sha512-1x8W5OpxPq+T85OUsHRP6BqXeosKmeXRtjoF39STcdf/UWLqUsoehstZKOi0CunhVqHG17AyZgpj20eRVooK6A== - -"@types/node@^8.0.0": - version "8.10.66" - resolved "https://registry.yarnpkg.com/@types/node/-/node-8.10.66.tgz#dd035d409df322acc83dff62a602f12a5783bbb3" - integrity sha512-tktOkFUA4kXx2hhhrB8bIFb5TbwzS4uOhKEmwiD+NoiL0qtP2OQ9mFldbgD4dV1djrlBYP6eBuQZiWjuHUpqFw== - -"@types/parse-json@^4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@types/parse-json/-/parse-json-4.0.0.tgz#2f8bb441434d163b35fb8ffdccd7138927ffb8c0" - integrity sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA== - -"@types/pbkdf2@^3.0.0": - version "3.1.0" - resolved "https://registry.yarnpkg.com/@types/pbkdf2/-/pbkdf2-3.1.0.tgz#039a0e9b67da0cdc4ee5dab865caa6b267bb66b1" - integrity sha512-Cf63Rv7jCQ0LaL8tNXmEyqTHuIJxRdlS5vMh1mj5voN4+QFhVZnlZruezqpWYDiJ8UTzhP0VmeLXCmBk66YrMQ== - dependencies: - "@types/node" "*" - -"@types/prettier@^2.1.1": - version "2.2.3" - resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.2.3.tgz#ef65165aea2924c9359205bf748865b8881753c0" - integrity sha512-PijRCG/K3s3w1We6ynUKdxEc5AcuuH3NBmMDP8uvKVp6X43UY7NQlTzczakXP3DJR0F4dfNQIGjU2cUeRYs2AA== - -"@types/qs@^6.2.31": - version "6.9.6" - resolved "https://registry.yarnpkg.com/@types/qs/-/qs-6.9.6.tgz#df9c3c8b31a247ec315e6996566be3171df4b3b1" - integrity sha512-0/HnwIfW4ki2D8L8c9GVcG5I72s9jP5GSLVF0VIXDW00kmIpA6O33G7a8n59Tmh7Nz0WUC3rSb7PTY/sdW2JzA== - -"@types/resolve@^0.0.8": - version "0.0.8" - resolved "https://registry.yarnpkg.com/@types/resolve/-/resolve-0.0.8.tgz#f26074d238e02659e323ce1a13d041eee280e194" - integrity sha512-auApPaJf3NPfe18hSoJkp8EbZzer2ISk7o8mCC3M9he/a04+gbMF97NkpD2S8riMGvm4BMRI59/SZQSaLTKpsQ== - dependencies: - "@types/node" "*" - -"@types/secp256k1@^4.0.1": - version "4.0.2" - resolved "https://registry.yarnpkg.com/@types/secp256k1/-/secp256k1-4.0.2.tgz#20c29a87149d980f64464e56539bf4810fdb5d1d" - integrity sha512-QMg+9v0bbNJ2peLuHRWxzmy0HRJIG6gFZNhaRSp7S3ggSbCCxiqQB2/ybvhXyhHOCequpNkrx7OavNhrWOsW0A== - dependencies: - "@types/node" "*" - -"@types/sinon-chai@^3.2.3": - version "3.2.5" - resolved "https://registry.yarnpkg.com/@types/sinon-chai/-/sinon-chai-3.2.5.tgz#df21ae57b10757da0b26f512145c065f2ad45c48" - integrity sha512-bKQqIpew7mmIGNRlxW6Zli/QVyc3zikpGzCa797B/tRnD9OtHvZ/ts8sYXV+Ilj9u3QRaUEM8xrjgd1gwm1BpQ== - dependencies: - "@types/chai" "*" - "@types/sinon" "*" - -"@types/sinon@*": - version "10.0.1" - resolved "https://registry.yarnpkg.com/@types/sinon/-/sinon-10.0.1.tgz#97ccb0482b750f5140ffdc661240ebbbe6e28d75" - integrity sha512-tZulsvuJwif5ddTBtscflI7gJcd+RpENcNZ7QCp0jKEl0bZY3Pu6PbJs4GR3SfQkGgsUa+FrlKsKQ0XyGNvDuA== - dependencies: - "@sinonjs/fake-timers" "^7.1.0" - -"@types/through@*": - version "0.0.30" - resolved "https://registry.yarnpkg.com/@types/through/-/through-0.0.30.tgz#e0e42ce77e897bd6aead6f6ea62aeb135b8a3895" - integrity sha512-FvnCJljyxhPM3gkRgWmxmDZyAQSiBQQWLI0A0VFL0K7W1oRUrPJSqNO0NvTnLkBcotdlp3lKvaT0JrnyRDkzOg== - dependencies: - "@types/node" "*" - -"@types/underscore@*": - version "1.11.2" - resolved "https://registry.yarnpkg.com/@types/underscore/-/underscore-1.11.2.tgz#9441e0f6402bbcb72dbee771582fa57c5a1dedd3" - integrity sha512-Ls2ylbo7++ITrWk2Yc3G/jijwSq5V3GT0tlgVXEl2kKYXY3ImrtmTCoE2uyTWFRI5owMBriloZFWbE1SXOsE7w== - -"@types/web3@1.0.19": - version "1.0.19" - resolved "https://registry.yarnpkg.com/@types/web3/-/web3-1.0.19.tgz#46b85d91d398ded9ab7c85a5dd57cb33ac558924" - integrity sha512-fhZ9DyvDYDwHZUp5/STa9XW2re0E8GxoioYJ4pEUZ13YHpApSagixj7IAdoYH5uAK+UalGq6Ml8LYzmgRA/q+A== - dependencies: - "@types/bn.js" "*" - "@types/underscore" "*" - -"@types/winston@^2.4.4": - version "2.4.4" - resolved "https://registry.yarnpkg.com/@types/winston/-/winston-2.4.4.tgz#48cc744b7b42fad74b9a2e8490e0112bd9a3d08d" - integrity sha512-BVGCztsypW8EYwJ+Hq+QNYiT/MUyCif0ouBH+flrY66O5W+KIXAMML6E/0fJpm7VjIzgangahl5S03bJJQGrZw== - dependencies: - winston "*" - -"@types/yargs-parser@*": - version "20.2.0" - resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-20.2.0.tgz#dd3e6699ba3237f0348cd085e4698780204842f9" - integrity sha512-37RSHht+gzzgYeobbG+KWryeAW8J33Nhr69cjTqSYymXVZEN9NbRYWoYlRtDhHKPVT1FyNKwaTPC1NynKZpzRA== - -"@types/yargs@^16.0.0": - version "16.0.3" - resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-16.0.3.tgz#4b6d35bb8e680510a7dc2308518a80ee1ef27e01" - integrity sha512-YlFfTGS+zqCgXuXNV26rOIeETOkXnGQXP/pjjL9P0gO/EP9jTmc7pUBhx+jVEIxpq41RX33GQ7N3DzOSfZoglQ== - dependencies: - "@types/yargs-parser" "*" - -"@typescript-eslint/eslint-plugin@^4.0.0": - version "4.25.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.25.0.tgz#d82657b6ab4caa4c3f888ff923175fadc2f31f2a" - integrity sha512-Qfs3dWkTMKkKwt78xp2O/KZQB8MPS1UQ5D3YW2s6LQWBE1074BE+Rym+b1pXZIX3M3fSvPUDaCvZLKV2ylVYYQ== - dependencies: - "@typescript-eslint/experimental-utils" "4.25.0" - "@typescript-eslint/scope-manager" "4.25.0" - debug "^4.1.1" - functional-red-black-tree "^1.0.1" - lodash "^4.17.15" - regexpp "^3.0.0" - semver "^7.3.2" - tsutils "^3.17.1" - -"@typescript-eslint/experimental-utils@4.25.0": - version "4.25.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.25.0.tgz#b2febcfa715d2c1806fd5f0335193a6cd270df54" - integrity sha512-f0doRE76vq7NEEU0tw+ajv6CrmPelw5wLoaghEHkA2dNLFb3T/zJQqGPQ0OYt5XlZaS13MtnN+GTPCuUVg338w== - dependencies: - "@types/json-schema" "^7.0.3" - "@typescript-eslint/scope-manager" "4.25.0" - "@typescript-eslint/types" "4.25.0" - "@typescript-eslint/typescript-estree" "4.25.0" - eslint-scope "^5.0.0" - eslint-utils "^2.0.0" - -"@typescript-eslint/parser@^4.0.0": - version "4.25.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.25.0.tgz#6b2cb6285aa3d55bfb263c650739091b0f19aceb" - integrity sha512-OZFa1SKyEJpAhDx8FcbWyX+vLwh7OEtzoo2iQaeWwxucyfbi0mT4DijbOSsTgPKzGHr6GrF2V5p/CEpUH/VBxg== - dependencies: - "@typescript-eslint/scope-manager" "4.25.0" - "@typescript-eslint/types" "4.25.0" - "@typescript-eslint/typescript-estree" "4.25.0" - debug "^4.1.1" - -"@typescript-eslint/scope-manager@4.25.0": - version "4.25.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.25.0.tgz#9d86a5bcc46ef40acd03d85ad4e908e5aab8d4ca" - integrity sha512-2NElKxMb/0rya+NJG1U71BuNnp1TBd1JgzYsldsdA83h/20Tvnf/HrwhiSlNmuq6Vqa0EzidsvkTArwoq+tH6w== - dependencies: - "@typescript-eslint/types" "4.25.0" - "@typescript-eslint/visitor-keys" "4.25.0" - -"@typescript-eslint/types@4.25.0": - version "4.25.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.25.0.tgz#0e444a5c5e3c22d7ffa5e16e0e60510b3de5af87" - integrity sha512-+CNINNvl00OkW6wEsi32wU5MhHti2J25TJsJJqgQmJu3B3dYDBcmOxcE5w9cgoM13TrdE/5ND2HoEnBohasxRQ== - -"@typescript-eslint/typescript-estree@4.25.0", "@typescript-eslint/typescript-estree@^4.0.0": - version "4.25.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.25.0.tgz#942e4e25888736bff5b360d9b0b61e013d0cfa25" - integrity sha512-1B8U07TGNAFMxZbSpF6jqiDs1cVGO0izVkf18Q/SPcUAc9LhHxzvSowXDTvkHMWUVuPpagupaW63gB6ahTXVlg== - dependencies: - "@typescript-eslint/types" "4.25.0" - "@typescript-eslint/visitor-keys" "4.25.0" - debug "^4.1.1" - globby "^11.0.1" - is-glob "^4.0.1" - semver "^7.3.2" - tsutils "^3.17.1" - -"@typescript-eslint/visitor-keys@4.25.0": - version "4.25.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.25.0.tgz#863e7ed23da4287c5b469b13223255d0fde6aaa7" - integrity sha512-AmkqV9dDJVKP/TcZrbf6s6i1zYXt5Hl8qOLrRDTFfRNae4+LB8A4N3i+FLZPW85zIxRy39BgeWOfMS3HoH5ngg== - dependencies: - "@typescript-eslint/types" "4.25.0" - eslint-visitor-keys "^2.0.0" - -"@urql/core@1.13.1": - version "1.13.1" - resolved "https://registry.yarnpkg.com/@urql/core/-/core-1.13.1.tgz#7247c27dccd7570010de91730d1f16fd15892829" - integrity sha512-Zl4UwvcE9JbWKzrtxnlmfF+rkX50GzK5dpMlB6FnUYF0sLmuGMxp67lnhTQsfTNJ+41bkj4lk0PMWEnG7KUsTw== - dependencies: - wonka "^4.0.14" - -"@urql/core@>=1.12.0": - version "2.1.2" - resolved "https://registry.yarnpkg.com/@urql/core/-/core-2.1.2.tgz#aa27ff52bac0c0c263345f17d0df0f54480716d3" - integrity sha512-gZ+FBGe63P/dC10XRKAV7dlwRNbcfD8U622uvk54VXNrbY8tBkK9LHdWrjw1oByoQNON9t4NXikQlLOyp4HEBw== - dependencies: - "@graphql-typed-document-node/core" "^3.1.0" - wonka "^4.0.14" - -"@urql/exchange-execute@1.0.1": - version "1.0.1" - resolved "https://registry.yarnpkg.com/@urql/exchange-execute/-/exchange-execute-1.0.1.tgz#4cda7cbb8130c6c99f035927ca5d4756685f1ab4" - integrity sha512-7WgchTfgfPr+9KAiRlsf/MocMcjbP+1Tvlfjd5jWCiJDtIfaGA6ALx/ibAUhTRKF97zXuHfyeD3dWrodmPLuag== - dependencies: - "@urql/core" ">=1.12.0" - wonka "^4.0.14" - -"@yarnpkg/lockfile@^1.1.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz#e77a97fbd345b76d83245edcd17d393b1b41fb31" - integrity sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ== - -"@zxing/text-encoding@0.9.0": - version "0.9.0" - resolved "https://registry.yarnpkg.com/@zxing/text-encoding/-/text-encoding-0.9.0.tgz#fb50ffabc6c7c66a0c96b4c03e3d9be74864b70b" - integrity sha512-U/4aVJ2mxI0aDNI8Uq0wEhMgY+u4CNtEb0om3+y3+niDAsoTCOB33UF0sxpzqzdqXLqmvc+vZyAt4O8pPdfkwA== - -abbrev@1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" - integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== - -abbrev@1.0.x: - version "1.0.9" - resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.0.9.tgz#91b4792588a7738c25f35dd6f63752a2f8776135" - integrity sha1-kbR5JYinc4wl813W9jdSovh3YTU= - -abort-controller@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/abort-controller/-/abort-controller-3.0.0.tgz#eaf54d53b62bae4138e809ca225c8439a6efb392" - integrity sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg== - dependencies: - event-target-shim "^5.0.0" - -abstract-leveldown@3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/abstract-leveldown/-/abstract-leveldown-3.0.0.tgz#5cb89f958a44f526779d740d1440e743e0c30a57" - integrity sha512-KUWx9UWGQD12zsmLNj64/pndaz4iJh/Pj7nopgkfDG6RlCcbMZvT6+9l7dchK4idog2Is8VdC/PvNbFuFmalIQ== - dependencies: - xtend "~4.0.0" - -abstract-leveldown@^2.4.1, abstract-leveldown@~2.7.1: - version "2.7.2" - resolved "https://registry.yarnpkg.com/abstract-leveldown/-/abstract-leveldown-2.7.2.tgz#87a44d7ebebc341d59665204834c8b7e0932cc93" - integrity sha512-+OVvxH2rHVEhWLdbudP6p0+dNMXu8JA1CbhP19T8paTYAcX7oJ4OVjT+ZUVpv7mITxXHqDMej+GdqXBmXkw09w== - dependencies: - xtend "~4.0.0" - -abstract-leveldown@^5.0.0, abstract-leveldown@~5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/abstract-leveldown/-/abstract-leveldown-5.0.0.tgz#f7128e1f86ccabf7d2893077ce5d06d798e386c6" - integrity sha512-5mU5P1gXtsMIXg65/rsYGsi93+MlogXZ9FA8JnwKurHQg64bfXwGYVdVdijNTVNOlAsuIiOwHdvFFD5JqCJQ7A== - dependencies: - xtend "~4.0.0" - -abstract-leveldown@^6.2.1: - version "6.3.0" - resolved "https://registry.yarnpkg.com/abstract-leveldown/-/abstract-leveldown-6.3.0.tgz#d25221d1e6612f820c35963ba4bd739928f6026a" - integrity sha512-TU5nlYgta8YrBMNpc9FwQzRbiXsj49gsALsXadbGHt9CROPzX5fB0rWDR5mtdpOOKa5XqRFpbj1QroPAoPzVjQ== - dependencies: - buffer "^5.5.0" - immediate "^3.2.3" - level-concat-iterator "~2.0.0" - level-supports "~1.0.0" - xtend "~4.0.0" - -abstract-leveldown@~2.6.0: - version "2.6.3" - resolved "https://registry.yarnpkg.com/abstract-leveldown/-/abstract-leveldown-2.6.3.tgz#1c5e8c6a5ef965ae8c35dfb3a8770c476b82c4b8" - integrity sha512-2++wDf/DYqkPR3o5tbfdhF96EfMApo1GpPfzOsR/ZYXdkSmELlvOOEAl9iKkRsktMPHdGjO4rtkBpf2I7TiTeA== - dependencies: - xtend "~4.0.0" - -abstract-leveldown@~6.2.1: - version "6.2.3" - resolved "https://registry.yarnpkg.com/abstract-leveldown/-/abstract-leveldown-6.2.3.tgz#036543d87e3710f2528e47040bc3261b77a9a8eb" - integrity sha512-BsLm5vFMRUrrLeCcRc+G0t2qOaTzpoJQLOubq2XM72eNpjF5UdU5o/5NvlNhx95XHcAvcl8OMXr4mlg/fRgUXQ== - dependencies: - buffer "^5.5.0" - immediate "^3.2.3" - level-concat-iterator "~2.0.0" - level-supports "~1.0.0" - xtend "~4.0.0" - -accepts@~1.3.7: - version "1.3.7" - resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.7.tgz#531bc726517a3b2b41f850021c6cc15eaab507cd" - integrity sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA== - dependencies: - mime-types "~2.1.24" - negotiator "0.6.2" - -acorn-jsx@^5.3.1: - version "5.3.1" - resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.1.tgz#fc8661e11b7ac1539c47dbfea2e72b3af34d267b" - integrity sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng== - -acorn@^7.4.0: - version "7.4.1" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" - integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== - -address@^1.0.1: - version "1.1.2" - resolved "https://registry.yarnpkg.com/address/-/address-1.1.2.tgz#bf1116c9c758c51b7a933d296b72c221ed9428b6" - integrity sha512-aT6camzM4xEA54YVJYSqxz1kv4IHnQZRtThJJHhUMRExaU5spC7jX5ugSwTaTgJliIgs4VhZOk7htClvQ/LmRA== - -adm-zip@^0.4.16: - version "0.4.16" - resolved "https://registry.yarnpkg.com/adm-zip/-/adm-zip-0.4.16.tgz#cf4c508fdffab02c269cbc7f471a875f05570365" - integrity sha512-TFi4HBKSGfIKsK5YCkKaaFG2m4PEDyViZmEwof3MTIgzimHLto6muaHVpbrljdIvIrFZzEq/p4nafOeLcYegrg== - -aes-js@3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/aes-js/-/aes-js-3.0.0.tgz#e21df10ad6c2053295bcbb8dab40b09dbea87e4d" - integrity sha1-4h3xCtbCBTKVvLuNq0Cwnb6ofk0= - -aes-js@^3.1.1: - version "3.1.2" - resolved "https://registry.yarnpkg.com/aes-js/-/aes-js-3.1.2.tgz#db9aabde85d5caabbfc0d4f2a4446960f627146a" - integrity sha512-e5pEa2kBnBOgR4Y/p20pskXI74UEz7de8ZGVo58asOtvSVG5YAbJeELPZxOmt+Bnz3rX753YKhfIn4X4l1PPRQ== - -agent-base@6: - version "6.0.2" - resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77" - integrity sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ== - dependencies: - debug "4" - -aggregate-error@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/aggregate-error/-/aggregate-error-3.1.0.tgz#92670ff50f5359bdb7a3e0d40d0ec30c5737687a" - integrity sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA== - dependencies: - clean-stack "^2.0.0" - indent-string "^4.0.0" - -ajv@^5.2.2: - version "5.5.2" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.5.2.tgz#73b5eeca3fab653e3d3f9422b341ad42205dc965" - integrity sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU= - dependencies: - co "^4.6.0" - fast-deep-equal "^1.0.0" - fast-json-stable-stringify "^2.0.0" - json-schema-traverse "^0.3.0" - -ajv@^6.10.0, ajv@^6.12.3, ajv@^6.12.4: - version "6.12.6" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" - integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== - dependencies: - fast-deep-equal "^3.1.1" - fast-json-stable-stringify "^2.0.0" - json-schema-traverse "^0.4.1" - uri-js "^4.2.2" - -ajv@^8.0.1: - version "8.5.0" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.5.0.tgz#695528274bcb5afc865446aa275484049a18ae4b" - integrity sha512-Y2l399Tt1AguU3BPRP9Fn4eN+Or+StUGWCUpbnFyXSo8NZ9S4uj+AG2pjs5apK+ZMOwYOz1+a+VKvKH7CudXgQ== - dependencies: - fast-deep-equal "^3.1.1" - json-schema-traverse "^1.0.0" - require-from-string "^2.0.2" - uri-js "^4.2.2" - -amdefine@>=0.0.4: - version "1.0.1" - resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" - integrity sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU= - -ansi-colors@3.2.3: - version "3.2.3" - resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-3.2.3.tgz#57d35b8686e851e2cc04c403f1c00203976a1813" - integrity sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw== - -ansi-colors@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" - integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== - -ansi-escapes@^4.2.1, ansi-escapes@^4.3.0: - version "4.3.2" - resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e" - integrity sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ== - dependencies: - type-fest "^0.21.3" - -ansi-regex@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" - integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= - -ansi-regex@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" - integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= - -ansi-regex@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997" - integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg== - -ansi-regex@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75" - integrity sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg== - -ansi-styles@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" - integrity sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4= - -ansi-styles@^3.2.0, ansi-styles@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" - integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== - dependencies: - color-convert "^1.9.0" - -ansi-styles@^4.0.0, ansi-styles@^4.1.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" - integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== - dependencies: - color-convert "^2.0.1" - -antlr4ts@^0.5.0-alpha.4: - version "0.5.0-alpha.4" - resolved "https://registry.yarnpkg.com/antlr4ts/-/antlr4ts-0.5.0-alpha.4.tgz#71702865a87478ed0b40c0709f422cf14d51652a" - integrity sha512-WPQDt1B74OfPv/IMS2ekXAKkTZIHl88uMetg6q3OTqgFxZ/dxDXI0EWLyZid/1Pe6hTftyg5N7gel5wNAGxXyQ== - -any-promise@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/any-promise/-/any-promise-1.3.0.tgz#abc6afeedcea52e809cdc0376aed3ce39635d17f" - integrity sha1-q8av7tzqUugJzcA3au0845Y10X8= - -any-signal@^1.1.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/any-signal/-/any-signal-1.2.0.tgz#d755f690896f3e75c4a07480f429a1ee7f8db3b4" - integrity sha512-Cl08k4xItix3jvu4cxO/dt2rQ6iUAjO66pTyRMub+WL1VXeAyZydCpD8GqWTPKfdL28U0R0UucmQVsUsBnvCmQ== - dependencies: - abort-controller "^3.0.0" - -anymatch@^1.3.0: - version "1.3.2" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-1.3.2.tgz#553dcb8f91e3c889845dfdba34c77721b90b9d7a" - integrity sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA== - dependencies: - micromatch "^2.1.5" - normalize-path "^2.0.0" - -anymatch@~3.1.1: - version "3.1.2" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716" - integrity sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg== - dependencies: - normalize-path "^3.0.0" - picomatch "^2.0.4" - -arg@^4.1.0: - version "4.1.3" - resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089" - integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA== - -argparse@^1.0.7: - version "1.0.10" - resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" - integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== - dependencies: - sprintf-js "~1.0.2" - -arr-diff@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf" - integrity sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8= - dependencies: - arr-flatten "^1.0.1" - -arr-diff@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" - integrity sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA= - -arr-flatten@^1.0.1, arr-flatten@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" - integrity sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg== - -arr-union@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" - integrity sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ= - -array-back@^1.0.3, array-back@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/array-back/-/array-back-1.0.4.tgz#644ba7f095f7ffcf7c43b5f0dc39d3c1f03c063b" - integrity sha1-ZEun8JX3/898Q7Xw3DnTwfA8Bjs= - dependencies: - typical "^2.6.0" - -array-back@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/array-back/-/array-back-2.0.0.tgz#6877471d51ecc9c9bfa6136fb6c7d5fe69748022" - integrity sha512-eJv4pLLufP3g5kcZry0j6WXpIbzYw9GUB4mVJZno9wfwiBxbizTnHCw3VJb07cBihbFX48Y7oSrW9y+gt4glyw== - dependencies: - typical "^2.6.1" - -array-flatten@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" - integrity sha1-ml9pkFGx5wczKPKgCJaLZOopVdI= - -array-includes@^3.1.3: - version "3.1.3" - resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.1.3.tgz#c7f619b382ad2afaf5326cddfdc0afc61af7690a" - integrity sha512-gcem1KlBU7c9rB+Rq8/3PPKsK2kjqeEBa3bD5kkQo4nYlOHQCJqIJFqBXDEfwaRuYTT4E+FxA9xez7Gf/e3Q7A== - dependencies: - call-bind "^1.0.2" - define-properties "^1.1.3" - es-abstract "^1.18.0-next.2" - get-intrinsic "^1.1.1" - is-string "^1.0.5" - -array-union@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d" - integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== - -array-unique@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" - integrity sha1-odl8yvy8JiXMcPrc6zalDFiwGlM= - -array-unique@^0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" - integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg= - -array.prototype.flat@^1.2.4: - version "1.2.4" - resolved "https://registry.yarnpkg.com/array.prototype.flat/-/array.prototype.flat-1.2.4.tgz#6ef638b43312bd401b4c6199fdec7e2dc9e9a123" - integrity sha512-4470Xi3GAPAjZqFcljX2xzckv1qeKPizoNkiS0+O4IoPR2ZNpcjE0pkhdihlDouK+x6QOast26B4Q/O9DJnwSg== - dependencies: - call-bind "^1.0.0" - define-properties "^1.1.3" - es-abstract "^1.18.0-next.1" - -asap@~2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46" - integrity sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY= - -asn1.js@^5.2.0: - version "5.4.1" - resolved "https://registry.yarnpkg.com/asn1.js/-/asn1.js-5.4.1.tgz#11a980b84ebb91781ce35b0fdc2ee294e3783f07" - integrity sha512-+I//4cYPccV8LdmBLiX8CYvf9Sp3vQsrqu2QNXRcrbiWvcx/UdlFiqUJJzxRQxgsZmvhXhn4cSKeSmoFjVdupA== - dependencies: - bn.js "^4.0.0" - inherits "^2.0.1" - minimalistic-assert "^1.0.0" - safer-buffer "^2.1.0" - -asn1@~0.2.3: - version "0.2.4" - resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136" - integrity sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg== - dependencies: - safer-buffer "~2.1.0" - -assert-plus@1.0.0, assert-plus@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" - integrity sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU= - -assertion-error@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.1.0.tgz#e60b6b0e8f301bd97e5375215bda406c85118c0b" - integrity sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw== - -assign-symbols@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" - integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c= - -astral-regex@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-2.0.0.tgz#483143c567aeed4785759c0865786dc77d7d2e31" - integrity sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ== - -async-each@^1.0.0: - version "1.0.3" - resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.3.tgz#b727dbf87d7651602f06f4d4ac387f47d91b0cbf" - integrity sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ== - -async-eventemitter@^0.2.2, async-eventemitter@^0.2.4: - version "0.2.4" - resolved "https://registry.yarnpkg.com/async-eventemitter/-/async-eventemitter-0.2.4.tgz#f5e7c8ca7d3e46aab9ec40a292baf686a0bafaca" - integrity sha512-pd20BwL7Yt1zwDFy+8MX8F1+WCT8aQeKj0kQnTrH9WaeRETlRamVhD0JtRPmrV4GfOJ2F9CvdQkZeZhnh2TuHw== - dependencies: - async "^2.4.0" - -async-limiter@~1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.1.tgz#dd379e94f0db8310b08291f9d64c3209766617fd" - integrity sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ== - -async@1.x, async@^1.4.2: - version "1.5.2" - resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" - integrity sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo= - -async@2.6.2: - version "2.6.2" - resolved "https://registry.yarnpkg.com/async/-/async-2.6.2.tgz#18330ea7e6e313887f5d2f2a904bac6fe4dd5381" - integrity sha512-H1qVYh1MYhEEFLsP97cVKqCGo7KfCyTt6uEWqsTBr9SO84oK9Uwbyd/yCW+6rKJLHksBNUVWZDAjfS+Ccx0Bbg== - dependencies: - lodash "^4.17.11" - -async@^2.0.1, async@^2.1.2, async@^2.4.0, async@^2.5.0, async@^2.6.1: - version "2.6.3" - resolved "https://registry.yarnpkg.com/async/-/async-2.6.3.tgz#d72625e2344a3656e3a3ad4fa749fa83299d82ff" - integrity sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg== - dependencies: - lodash "^4.17.14" - -async@^3.1.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/async/-/async-3.2.0.tgz#b3a2685c5ebb641d3de02d161002c60fc9f85720" - integrity sha512-TR2mEZFVOj2pLStYxLht7TyfuRzaydfpxr3k9RpHIzMgw7A64dzsdqCxH1WJyQdoe8T10nDXd9wnEigmiuHIZw== - -asynckit@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" - integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= - -at-least-node@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/at-least-node/-/at-least-node-1.0.0.tgz#602cd4b46e844ad4effc92a8011a3c46e0238dc2" - integrity sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg== - -atob@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" - integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== - -atomic-sleep@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/atomic-sleep/-/atomic-sleep-1.0.0.tgz#eb85b77a601fc932cfe432c5acd364a9e2c9075b" - integrity sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ== - -available-typed-arrays@^1.0.2: - version "1.0.4" - resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.4.tgz#9e0ae84ecff20caae6a94a1c3bc39b955649b7a9" - integrity sha512-SA5mXJWrId1TaQjfxUYghbqQ/hYioKmLJvPJyDuYRtXXenFNMjj4hSSt1Cf1xsuXSXrtxrVC5Ot4eU6cOtBDdA== - -aws-sign2@~0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" - integrity sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg= - -aws4@^1.8.0: - version "1.11.0" - resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.11.0.tgz#d61f46d83b2519250e2784daf5b09479a8b41c59" - integrity sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA== - -axios@^0.21.1: - version "0.21.1" - resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.1.tgz#22563481962f4d6bde9a76d516ef0e5d3c09b2b8" - integrity sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA== - dependencies: - follow-redirects "^1.10.0" - -babel-code-frame@^6.26.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" - integrity sha1-Y/1D99weO7fONZR9uP42mj9Yx0s= - dependencies: - chalk "^1.1.3" - esutils "^2.0.2" - js-tokens "^3.0.2" - -babel-core@^6.0.14, babel-core@^6.26.0: - version "6.26.3" - resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.26.3.tgz#b2e2f09e342d0f0c88e2f02e067794125e75c207" - integrity sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA== - dependencies: - babel-code-frame "^6.26.0" - babel-generator "^6.26.0" - babel-helpers "^6.24.1" - babel-messages "^6.23.0" - babel-register "^6.26.0" - babel-runtime "^6.26.0" - babel-template "^6.26.0" - babel-traverse "^6.26.0" - babel-types "^6.26.0" - babylon "^6.18.0" - convert-source-map "^1.5.1" - debug "^2.6.9" - json5 "^0.5.1" - lodash "^4.17.4" - minimatch "^3.0.4" - path-is-absolute "^1.0.1" - private "^0.1.8" - slash "^1.0.0" - source-map "^0.5.7" - -babel-generator@^6.26.0: - version "6.26.1" - resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.26.1.tgz#1844408d3b8f0d35a404ea7ac180f087a601bd90" - integrity sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA== - dependencies: - babel-messages "^6.23.0" - babel-runtime "^6.26.0" - babel-types "^6.26.0" - detect-indent "^4.0.0" - jsesc "^1.3.0" - lodash "^4.17.4" - source-map "^0.5.7" - trim-right "^1.0.1" - -babel-helper-builder-binary-assignment-operator-visitor@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.24.1.tgz#cce4517ada356f4220bcae8a02c2b346f9a56664" - integrity sha1-zORReto1b0IgvK6KAsKzRvmlZmQ= - dependencies: - babel-helper-explode-assignable-expression "^6.24.1" - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-helper-call-delegate@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz#ece6aacddc76e41c3461f88bfc575bd0daa2df8d" - integrity sha1-7Oaqzdx25Bw0YfiL/Fdb0Nqi340= - dependencies: - babel-helper-hoist-variables "^6.24.1" - babel-runtime "^6.22.0" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - -babel-helper-define-map@^6.24.1: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-helper-define-map/-/babel-helper-define-map-6.26.0.tgz#a5f56dab41a25f97ecb498c7ebaca9819f95be5f" - integrity sha1-pfVtq0GiX5fstJjH66ypgZ+Vvl8= - dependencies: - babel-helper-function-name "^6.24.1" - babel-runtime "^6.26.0" - babel-types "^6.26.0" - lodash "^4.17.4" - -babel-helper-explode-assignable-expression@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.24.1.tgz#f25b82cf7dc10433c55f70592d5746400ac22caa" - integrity sha1-8luCz33BBDPFX3BZLVdGQArCLKo= - dependencies: - babel-runtime "^6.22.0" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - -babel-helper-function-name@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz#d3475b8c03ed98242a25b48351ab18399d3580a9" - integrity sha1-00dbjAPtmCQqJbSDUasYOZ01gKk= - dependencies: - babel-helper-get-function-arity "^6.24.1" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - -babel-helper-get-function-arity@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz#8f7782aa93407c41d3aa50908f89b031b1b6853d" - integrity sha1-j3eCqpNAfEHTqlCQj4mwMbG2hT0= - dependencies: - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-helper-hoist-variables@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz#1ecb27689c9d25513eadbc9914a73f5408be7a76" - integrity sha1-HssnaJydJVE+rbyZFKc/VAi+enY= - dependencies: - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-helper-optimise-call-expression@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz#f7a13427ba9f73f8f4fa993c54a97882d1244257" - integrity sha1-96E0J7qfc/j0+pk8VKl4gtEkQlc= - dependencies: - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-helper-regex@^6.24.1: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-helper-regex/-/babel-helper-regex-6.26.0.tgz#325c59f902f82f24b74faceed0363954f6495e72" - integrity sha1-MlxZ+QL4LyS3T6zu0DY5VPZJXnI= - dependencies: - babel-runtime "^6.26.0" - babel-types "^6.26.0" - lodash "^4.17.4" - -babel-helper-remap-async-to-generator@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.24.1.tgz#5ec581827ad723fecdd381f1c928390676e4551b" - integrity sha1-XsWBgnrXI/7N04HxySg5BnbkVRs= - dependencies: - babel-helper-function-name "^6.24.1" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - -babel-helper-replace-supers@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz#bf6dbfe43938d17369a213ca8a8bf74b6a90ab1a" - integrity sha1-v22/5Dk40XNpohPKiov3S2qQqxo= - dependencies: - babel-helper-optimise-call-expression "^6.24.1" - babel-messages "^6.23.0" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - -babel-helpers@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.24.1.tgz#3471de9caec388e5c850e597e58a26ddf37602b2" - integrity sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI= - dependencies: - babel-runtime "^6.22.0" - babel-template "^6.24.1" - -babel-messages@^6.23.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e" - integrity sha1-8830cDhYA1sqKVHG7F7fbGLyYw4= - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-check-es2015-constants@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz#35157b101426fd2ffd3da3f75c7d1e91835bbf8a" - integrity sha1-NRV7EBQm/S/9PaP3XH0ekYNbv4o= - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-syntax-async-functions@^6.8.0: - version "6.13.0" - resolved "https://registry.yarnpkg.com/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz#cad9cad1191b5ad634bf30ae0872391e0647be95" - integrity sha1-ytnK0RkbWtY0vzCuCHI5HgZHvpU= - -babel-plugin-syntax-exponentiation-operator@^6.8.0: - version "6.13.0" - resolved "https://registry.yarnpkg.com/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz#9ee7e8337290da95288201a6a57f4170317830de" - integrity sha1-nufoM3KQ2pUoggGmpX9BcDF4MN4= - -babel-plugin-syntax-trailing-function-commas@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz#ba0360937f8d06e40180a43fe0d5616fff532cf3" - integrity sha1-ugNgk3+NBuQBgKQ/4NVhb/9TLPM= - -babel-plugin-transform-async-to-generator@^6.22.0: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz#6536e378aff6cb1d5517ac0e40eb3e9fc8d08761" - integrity sha1-ZTbjeK/2yx1VF6wOQOs+n8jQh2E= - dependencies: - babel-helper-remap-async-to-generator "^6.24.1" - babel-plugin-syntax-async-functions "^6.8.0" - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-arrow-functions@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz#452692cb711d5f79dc7f85e440ce41b9f244d221" - integrity sha1-RSaSy3EdX3ncf4XkQM5BufJE0iE= - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-block-scoped-functions@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz#bbc51b49f964d70cb8d8e0b94e820246ce3a6141" - integrity sha1-u8UbSflk1wy42OC5ToICRs46YUE= - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-block-scoping@^6.23.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.26.0.tgz#d70f5299c1308d05c12f463813b0a09e73b1895f" - integrity sha1-1w9SmcEwjQXBL0Y4E7CgnnOxiV8= - dependencies: - babel-runtime "^6.26.0" - babel-template "^6.26.0" - babel-traverse "^6.26.0" - babel-types "^6.26.0" - lodash "^4.17.4" - -babel-plugin-transform-es2015-classes@^6.23.0: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz#5a4c58a50c9c9461e564b4b2a3bfabc97a2584db" - integrity sha1-WkxYpQyclGHlZLSyo7+ryXolhNs= - dependencies: - babel-helper-define-map "^6.24.1" - babel-helper-function-name "^6.24.1" - babel-helper-optimise-call-expression "^6.24.1" - babel-helper-replace-supers "^6.24.1" - babel-messages "^6.23.0" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - -babel-plugin-transform-es2015-computed-properties@^6.22.0: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz#6fe2a8d16895d5634f4cd999b6d3480a308159b3" - integrity sha1-b+Ko0WiV1WNPTNmZttNICjCBWbM= - dependencies: - babel-runtime "^6.22.0" - babel-template "^6.24.1" - -babel-plugin-transform-es2015-destructuring@^6.23.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz#997bb1f1ab967f682d2b0876fe358d60e765c56d" - integrity sha1-mXux8auWf2gtKwh2/jWNYOdlxW0= - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-duplicate-keys@^6.22.0: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz#73eb3d310ca969e3ef9ec91c53741a6f1576423e" - integrity sha1-c+s9MQypaePvnskcU3QabxV2Qj4= - dependencies: - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-plugin-transform-es2015-for-of@^6.23.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz#f47c95b2b613df1d3ecc2fdb7573623c75248691" - integrity sha1-9HyVsrYT3x0+zC/bdXNiPHUkhpE= - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-function-name@^6.22.0: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz#834c89853bc36b1af0f3a4c5dbaa94fd8eacaa8b" - integrity sha1-g0yJhTvDaxrw86TF26qU/Y6sqos= - dependencies: - babel-helper-function-name "^6.24.1" - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-plugin-transform-es2015-literals@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz#4f54a02d6cd66cf915280019a31d31925377ca2e" - integrity sha1-T1SgLWzWbPkVKAAZox0xklN3yi4= - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-modules-amd@^6.22.0, babel-plugin-transform-es2015-modules-amd@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz#3b3e54017239842d6d19c3011c4bd2f00a00d154" - integrity sha1-Oz5UAXI5hC1tGcMBHEvS8AoA0VQ= - dependencies: - babel-plugin-transform-es2015-modules-commonjs "^6.24.1" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - -babel-plugin-transform-es2015-modules-commonjs@^6.23.0, babel-plugin-transform-es2015-modules-commonjs@^6.24.1: - version "6.26.2" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.2.tgz#58a793863a9e7ca870bdc5a881117ffac27db6f3" - integrity sha512-CV9ROOHEdrjcwhIaJNBGMBCodN+1cfkwtM1SbUHmvyy35KGT7fohbpOxkE2uLz1o6odKK2Ck/tz47z+VqQfi9Q== - dependencies: - babel-plugin-transform-strict-mode "^6.24.1" - babel-runtime "^6.26.0" - babel-template "^6.26.0" - babel-types "^6.26.0" - -babel-plugin-transform-es2015-modules-systemjs@^6.23.0: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz#ff89a142b9119a906195f5f106ecf305d9407d23" - integrity sha1-/4mhQrkRmpBhlfXxBuzzBdlAfSM= - dependencies: - babel-helper-hoist-variables "^6.24.1" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - -babel-plugin-transform-es2015-modules-umd@^6.23.0: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz#ac997e6285cd18ed6176adb607d602344ad38468" - integrity sha1-rJl+YoXNGO1hdq22B9YCNErThGg= - dependencies: - babel-plugin-transform-es2015-modules-amd "^6.24.1" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - -babel-plugin-transform-es2015-object-super@^6.22.0: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz#24cef69ae21cb83a7f8603dad021f572eb278f8d" - integrity sha1-JM72muIcuDp/hgPa0CH1cusnj40= - dependencies: - babel-helper-replace-supers "^6.24.1" - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-parameters@^6.23.0: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz#57ac351ab49caf14a97cd13b09f66fdf0a625f2b" - integrity sha1-V6w1GrScrxSpfNE7CfZv3wpiXys= - dependencies: - babel-helper-call-delegate "^6.24.1" - babel-helper-get-function-arity "^6.24.1" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - -babel-plugin-transform-es2015-shorthand-properties@^6.22.0: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz#24f875d6721c87661bbd99a4622e51f14de38aa0" - integrity sha1-JPh11nIch2YbvZmkYi5R8U3jiqA= - dependencies: - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-plugin-transform-es2015-spread@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz#d6d68a99f89aedc4536c81a542e8dd9f1746f8d1" - integrity sha1-1taKmfia7cRTbIGlQujdnxdG+NE= - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-sticky-regex@^6.22.0: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz#00c1cdb1aca71112cdf0cf6126c2ed6b457ccdbc" - integrity sha1-AMHNsaynERLN8M9hJsLta0V8zbw= - dependencies: - babel-helper-regex "^6.24.1" - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-plugin-transform-es2015-template-literals@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz#a84b3450f7e9f8f1f6839d6d687da84bb1236d8d" - integrity sha1-qEs0UPfp+PH2g51taH2oS7EjbY0= - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-typeof-symbol@^6.23.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz#dec09f1cddff94b52ac73d505c84df59dcceb372" - integrity sha1-3sCfHN3/lLUqxz1QXITfWdzOs3I= - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-unicode-regex@^6.22.0: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz#d38b12f42ea7323f729387f18a7c5ae1faeb35e9" - integrity sha1-04sS9C6nMj9yk4fxinxa4frrNek= - dependencies: - babel-helper-regex "^6.24.1" - babel-runtime "^6.22.0" - regexpu-core "^2.0.0" - -babel-plugin-transform-exponentiation-operator@^6.22.0: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.24.1.tgz#2ab0c9c7f3098fa48907772bb813fe41e8de3a0e" - integrity sha1-KrDJx/MJj6SJB3cruBP+QejeOg4= - dependencies: - babel-helper-builder-binary-assignment-operator-visitor "^6.24.1" - babel-plugin-syntax-exponentiation-operator "^6.8.0" - babel-runtime "^6.22.0" - -babel-plugin-transform-regenerator@^6.22.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz#e0703696fbde27f0a3efcacf8b4dca2f7b3a8f2f" - integrity sha1-4HA2lvveJ/Cj78rPi03KL3s6jy8= - dependencies: - regenerator-transform "^0.10.0" - -babel-plugin-transform-strict-mode@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz#d5faf7aa578a65bbe591cf5edae04a0c67020758" - integrity sha1-1fr3qleKZbvlkc9e2uBKDGcCB1g= - dependencies: - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-preset-env@^1.7.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/babel-preset-env/-/babel-preset-env-1.7.0.tgz#dea79fa4ebeb883cd35dab07e260c1c9c04df77a" - integrity sha512-9OR2afuKDneX2/q2EurSftUYM0xGu4O2D9adAhVfADDhrYDaxXV0rBbevVYoY9n6nyX1PmQW/0jtpJvUNr9CHg== - dependencies: - babel-plugin-check-es2015-constants "^6.22.0" - babel-plugin-syntax-trailing-function-commas "^6.22.0" - babel-plugin-transform-async-to-generator "^6.22.0" - babel-plugin-transform-es2015-arrow-functions "^6.22.0" - babel-plugin-transform-es2015-block-scoped-functions "^6.22.0" - babel-plugin-transform-es2015-block-scoping "^6.23.0" - babel-plugin-transform-es2015-classes "^6.23.0" - babel-plugin-transform-es2015-computed-properties "^6.22.0" - babel-plugin-transform-es2015-destructuring "^6.23.0" - babel-plugin-transform-es2015-duplicate-keys "^6.22.0" - babel-plugin-transform-es2015-for-of "^6.23.0" - babel-plugin-transform-es2015-function-name "^6.22.0" - babel-plugin-transform-es2015-literals "^6.22.0" - babel-plugin-transform-es2015-modules-amd "^6.22.0" - babel-plugin-transform-es2015-modules-commonjs "^6.23.0" - babel-plugin-transform-es2015-modules-systemjs "^6.23.0" - babel-plugin-transform-es2015-modules-umd "^6.23.0" - babel-plugin-transform-es2015-object-super "^6.22.0" - babel-plugin-transform-es2015-parameters "^6.23.0" - babel-plugin-transform-es2015-shorthand-properties "^6.22.0" - babel-plugin-transform-es2015-spread "^6.22.0" - babel-plugin-transform-es2015-sticky-regex "^6.22.0" - babel-plugin-transform-es2015-template-literals "^6.22.0" - babel-plugin-transform-es2015-typeof-symbol "^6.23.0" - babel-plugin-transform-es2015-unicode-regex "^6.22.0" - babel-plugin-transform-exponentiation-operator "^6.22.0" - babel-plugin-transform-regenerator "^6.22.0" - browserslist "^3.2.6" - invariant "^2.2.2" - semver "^5.3.0" - -babel-register@^6.26.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.26.0.tgz#6ed021173e2fcb486d7acb45c6009a856f647071" - integrity sha1-btAhFz4vy0htestFxgCahW9kcHE= - dependencies: - babel-core "^6.26.0" - babel-runtime "^6.26.0" - core-js "^2.5.0" - home-or-tmp "^2.0.0" - lodash "^4.17.4" - mkdirp "^0.5.1" - source-map-support "^0.4.15" - -babel-runtime@^6.18.0, babel-runtime@^6.22.0, babel-runtime@^6.26.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" - integrity sha1-llxwWGaOgrVde/4E/yM3vItWR/4= - dependencies: - core-js "^2.4.0" - regenerator-runtime "^0.11.0" - -babel-template@^6.24.1, babel-template@^6.26.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.26.0.tgz#de03e2d16396b069f46dd9fff8521fb1a0e35e02" - integrity sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI= - dependencies: - babel-runtime "^6.26.0" - babel-traverse "^6.26.0" - babel-types "^6.26.0" - babylon "^6.18.0" - lodash "^4.17.4" - -babel-traverse@^6.24.1, babel-traverse@^6.26.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.26.0.tgz#46a9cbd7edcc62c8e5c064e2d2d8d0f4035766ee" - integrity sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4= - dependencies: - babel-code-frame "^6.26.0" - babel-messages "^6.23.0" - babel-runtime "^6.26.0" - babel-types "^6.26.0" - babylon "^6.18.0" - debug "^2.6.8" - globals "^9.18.0" - invariant "^2.2.2" - lodash "^4.17.4" - -babel-types@^6.19.0, babel-types@^6.24.1, babel-types@^6.26.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.26.0.tgz#a3b073f94ab49eb6fa55cd65227a334380632497" - integrity sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc= - dependencies: - babel-runtime "^6.26.0" - esutils "^2.0.2" - lodash "^4.17.4" - to-fast-properties "^1.0.3" - -babelify@^7.3.0: - version "7.3.0" - resolved "https://registry.yarnpkg.com/babelify/-/babelify-7.3.0.tgz#aa56aede7067fd7bd549666ee16dc285087e88e5" - integrity sha1-qlau3nBn/XvVSWZu4W3ChQh+iOU= - dependencies: - babel-core "^6.0.14" - object-assign "^4.0.0" - -babylon@^6.18.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3" - integrity sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ== - -backoff@^2.5.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/backoff/-/backoff-2.5.0.tgz#f616eda9d3e4b66b8ca7fca79f695722c5f8e26f" - integrity sha1-9hbtqdPktmuMp/ynn2lXIsX44m8= - dependencies: - precond "0.2" - -balanced-match@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" - integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== - -base-x@^3.0.2, base-x@^3.0.6, base-x@^3.0.8: - version "3.0.8" - resolved "https://registry.yarnpkg.com/base-x/-/base-x-3.0.8.tgz#1e1106c2537f0162e8b52474a557ebb09000018d" - integrity sha512-Rl/1AWP4J/zRrk54hhlxH4drNxPJXYUaKffODVI53/dAsV4t9fBxyxYKAVPU1XBHxYwOWP9h9H0hM2MVw4YfJA== - dependencies: - safe-buffer "^5.0.1" - -base64-js@^1.3.1: - version "1.5.1" - resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" - integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== - -base@^0.11.1: - version "0.11.2" - resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" - integrity sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg== - dependencies: - cache-base "^1.0.1" - class-utils "^0.3.5" - component-emitter "^1.2.1" - define-property "^1.0.0" - isobject "^3.0.1" - mixin-deep "^1.2.0" - pascalcase "^0.1.1" - -basic-auth@~2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/basic-auth/-/basic-auth-2.0.1.tgz#b998279bf47ce38344b4f3cf916d4679bbf51e3a" - integrity sha512-NF+epuEdnUYVlGuhaxbbq+dvJttwLnGY+YixlXlME5KpQ5W3CnXA5cVTneY3SPbPDRkcjMbifrwmFYcClgOZeg== - dependencies: - safe-buffer "5.1.2" - -bcrypt-pbkdf@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" - integrity sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4= - dependencies: - tweetnacl "^0.14.3" - -bech32@1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/bech32/-/bech32-1.1.4.tgz#e38c9f37bf179b8eb16ae3a772b40c356d4832e9" - integrity sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ== - -bignumber.js@^9.0.0, bignumber.js@^9.0.1: - version "9.0.1" - resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-9.0.1.tgz#8d7ba124c882bfd8e43260c67475518d0689e4e5" - integrity sha512-IdZR9mh6ahOBv/hYGiXyVuyCetmGJhtYkqLBpTStdhEGjegpPlUawydyaF3pbIOFynJTpllEs+NP+CS9jKFLjA== - -binary-extensions@^1.0.0: - version "1.13.1" - resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.13.1.tgz#598afe54755b2868a5330d2aff9d4ebb53209b65" - integrity sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw== - -binary-extensions@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" - integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== - -bindings@^1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.5.0.tgz#10353c9e945334bc0511a6d90b38fbc7c9c504df" - integrity sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ== - dependencies: - file-uri-to-path "1.0.0" - -bintrees@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/bintrees/-/bintrees-1.0.1.tgz#0e655c9b9c2435eaab68bf4027226d2b55a34524" - integrity sha1-DmVcm5wkNeqraL9AJyJtK1WjRSQ= - -bip39@2.5.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/bip39/-/bip39-2.5.0.tgz#51cbd5179460504a63ea3c000db3f787ca051235" - integrity sha512-xwIx/8JKoT2+IPJpFEfXoWdYwP7UVAoUxxLNfGCfVowaJE7yg1Y5B1BVPqlUNsBq5/nGwmFkwRJ8xDW4sX8OdA== - dependencies: - create-hash "^1.1.0" - pbkdf2 "^3.0.9" - randombytes "^2.0.1" - safe-buffer "^5.0.1" - unorm "^1.3.3" - -bip66@^1.1.5: - version "1.1.5" - resolved "https://registry.yarnpkg.com/bip66/-/bip66-1.1.5.tgz#01fa8748785ca70955d5011217d1b3139969ca22" - integrity sha1-AfqHSHhcpwlV1QESF9GzE5lpyiI= - dependencies: - safe-buffer "^5.0.1" - -bl@^4.0.0, bl@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/bl/-/bl-4.1.0.tgz#451535264182bec2fbbc83a62ab98cf11d9f7b3a" - integrity sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w== - dependencies: - buffer "^5.5.0" - inherits "^2.0.4" - readable-stream "^3.4.0" - -blakejs@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/blakejs/-/blakejs-1.1.0.tgz#69df92ef953aa88ca51a32df6ab1c54a155fc7a5" - integrity sha1-ad+S75U6qIylGjLfarHFShVfx6U= - -blob-to-it@0.0.2: - version "0.0.2" - resolved "https://registry.yarnpkg.com/blob-to-it/-/blob-to-it-0.0.2.tgz#851b4db0be4acebc86dd1c14c14b77fdc473e9b0" - integrity sha512-3/NRr0mUWQTkS71MYEC1teLbT5BTs7RZ6VMPXDV6qApjw3B4TAZspQuvDkYfHuD/XzL5p/RO91x5XRPeJvcCqg== - dependencies: - browser-readablestream-to-it "^0.0.2" - -bluebird@^3.5.0, bluebird@^3.5.2: - version "3.7.2" - resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f" - integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg== - -bn.js@4.11.6: - version "4.11.6" - resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.6.tgz#53344adb14617a13f6e8dd2ce28905d1c0ba3215" - integrity sha1-UzRK2xRhehP26N0s4okF0cC6MhU= - -bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.10.0, bn.js@^4.11.0, bn.js@^4.11.1, bn.js@^4.11.6, bn.js@^4.11.8, bn.js@^4.11.9, bn.js@^4.4.0, bn.js@^4.8.0: - version "4.12.0" - resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88" - integrity sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA== - -bn.js@^5.0.0, bn.js@^5.1.1, bn.js@^5.1.2, bn.js@^5.1.3: - version "5.2.0" - resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.0.tgz#358860674396c6997771a9d051fcc1b57d4ae002" - integrity sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw== - -body-parser@1.19.0, body-parser@^1.16.0: - version "1.19.0" - resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.19.0.tgz#96b2709e57c9c4e09a6fd66a8fd979844f69f08a" - integrity sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw== - dependencies: - bytes "3.1.0" - content-type "~1.0.4" - debug "2.6.9" - depd "~1.1.2" - http-errors "1.7.2" - iconv-lite "0.4.24" - on-finished "~2.3.0" - qs "6.7.0" - raw-body "2.4.0" - type-is "~1.6.17" - -borc@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/borc/-/borc-2.1.2.tgz#6ce75e7da5ce711b963755117dd1b187f6f8cf19" - integrity sha512-Sy9eoUi4OiKzq7VovMn246iTo17kzuyHJKomCfpWMlI6RpfN1gk95w7d7gH264nApVLg0HZfcpz62/g4VH1Y4w== - dependencies: - bignumber.js "^9.0.0" - buffer "^5.5.0" - commander "^2.15.0" - ieee754 "^1.1.13" - iso-url "~0.4.7" - json-text-sequence "~0.1.0" - readable-stream "^3.6.0" - -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -braces@^1.8.2: - version "1.8.5" - resolved "https://registry.yarnpkg.com/braces/-/braces-1.8.5.tgz#ba77962e12dff969d6b76711e914b737857bf6a7" - integrity sha1-uneWLhLf+WnWt2cR6RS3N4V79qc= - dependencies: - expand-range "^1.8.1" - preserve "^0.2.0" - repeat-element "^1.1.2" - -braces@^2.3.1: - version "2.3.2" - resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" - integrity sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w== - dependencies: - arr-flatten "^1.1.0" - array-unique "^0.3.2" - extend-shallow "^2.0.1" - fill-range "^4.0.0" - isobject "^3.0.1" - repeat-element "^1.1.2" - snapdragon "^0.8.1" - snapdragon-node "^2.0.1" - split-string "^3.0.2" - to-regex "^3.0.1" - -braces@^3.0.1, braces@~3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" - integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== - dependencies: - fill-range "^7.0.1" - -brorand@^1.0.1, brorand@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" - integrity sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8= - -browser-readablestream-to-it@0.0.2, browser-readablestream-to-it@^0.0.2: - version "0.0.2" - resolved "https://registry.yarnpkg.com/browser-readablestream-to-it/-/browser-readablestream-to-it-0.0.2.tgz#4a5c2a20567623c106125ca6b640f68b081cea25" - integrity sha512-bbiTccngeAbPmpTUJcUyr6JhivADKV9xkNJVLdA91vjdzXyFBZ6fgrzElQsV3k1UNGQACRTl3p4y+cEGG9U48A== - -browser-stdout@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.0.tgz#f351d32969d32fa5d7a5567154263d928ae3bd1f" - integrity sha1-81HTKWnTL6XXpVZxVCY9korjvR8= - -browser-stdout@1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" - integrity sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw== - -browserify-aes@^1.0.0, browserify-aes@^1.0.4, browserify-aes@^1.0.6, browserify-aes@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.2.0.tgz#326734642f403dabc3003209853bb70ad428ef48" - integrity sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA== - dependencies: - buffer-xor "^1.0.3" - cipher-base "^1.0.0" - create-hash "^1.1.0" - evp_bytestokey "^1.0.3" - inherits "^2.0.1" - safe-buffer "^5.0.1" - -browserify-cipher@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/browserify-cipher/-/browserify-cipher-1.0.1.tgz#8d6474c1b870bfdabcd3bcfcc1934a10e94f15f0" - integrity sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w== - dependencies: - browserify-aes "^1.0.4" - browserify-des "^1.0.0" - evp_bytestokey "^1.0.0" - -browserify-des@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/browserify-des/-/browserify-des-1.0.2.tgz#3af4f1f59839403572f1c66204375f7a7f703e9c" - integrity sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A== - dependencies: - cipher-base "^1.0.1" - des.js "^1.0.0" - inherits "^2.0.1" - safe-buffer "^5.1.2" - -browserify-rsa@^4.0.0, browserify-rsa@^4.0.1: - version "4.1.0" - resolved "https://registry.yarnpkg.com/browserify-rsa/-/browserify-rsa-4.1.0.tgz#b2fd06b5b75ae297f7ce2dc651f918f5be158c8d" - integrity sha512-AdEER0Hkspgno2aR97SAf6vi0y0k8NuOpGnVH3O99rcA5Q6sh8QxcngtHuJ6uXwnfAXNM4Gn1Gb7/MV1+Ymbog== - dependencies: - bn.js "^5.0.0" - randombytes "^2.0.1" - -browserify-sign@^4.0.0: - version "4.2.1" - resolved "https://registry.yarnpkg.com/browserify-sign/-/browserify-sign-4.2.1.tgz#eaf4add46dd54be3bb3b36c0cf15abbeba7956c3" - integrity sha512-/vrA5fguVAKKAVTNJjgSm1tRQDHUU6DbwO9IROu/0WAzC8PKhucDSh18J0RMvVeHAn5puMd+QHC2erPRNf8lmg== - dependencies: - bn.js "^5.1.1" - browserify-rsa "^4.0.1" - create-hash "^1.2.0" - create-hmac "^1.1.7" - elliptic "^6.5.3" - inherits "^2.0.4" - parse-asn1 "^5.1.5" - readable-stream "^3.6.0" - safe-buffer "^5.2.0" - -browserslist@^3.2.6: - version "3.2.8" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-3.2.8.tgz#b0005361d6471f0f5952797a76fc985f1f978fc6" - integrity sha512-WHVocJYavUwVgVViC0ORikPHQquXwVh939TaelZ4WDqpWgTX/FsGhl/+P4qBUAGcRvtOgDgC+xftNWWp2RUTAQ== - dependencies: - caniuse-lite "^1.0.30000844" - electron-to-chromium "^1.3.47" - -bs58@4.0.1, bs58@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/bs58/-/bs58-4.0.1.tgz#be161e76c354f6f788ae4071f63f34e8c4f0a42a" - integrity sha1-vhYedsNU9veIrkBx9j806MTwpCo= - dependencies: - base-x "^3.0.2" - -bs58check@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/bs58check/-/bs58check-2.1.2.tgz#53b018291228d82a5aa08e7d796fdafda54aebfc" - integrity sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA== - dependencies: - bs58 "^4.0.0" - create-hash "^1.1.0" - safe-buffer "^5.1.2" - -buffer-from@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" - integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== - -buffer-to-arraybuffer@^0.0.5: - version "0.0.5" - resolved "https://registry.yarnpkg.com/buffer-to-arraybuffer/-/buffer-to-arraybuffer-0.0.5.tgz#6064a40fa76eb43c723aba9ef8f6e1216d10511a" - integrity sha1-YGSkD6dutDxyOrqe+PbhIW0QURo= - -buffer-writer@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/buffer-writer/-/buffer-writer-2.0.0.tgz#ce7eb81a38f7829db09c873f2fbb792c0c98ec04" - integrity sha512-a7ZpuTZU1TRtnwyCNW3I5dc0wWNC3VR9S++Ewyk2HHZdrO3CQJqSpd+95Us590V6AL7JqUAH2IwZ/398PmNFgw== - -buffer-xor@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" - integrity sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk= - -buffer-xor@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-2.0.2.tgz#34f7c64f04c777a1f8aac5e661273bb9dd320289" - integrity sha512-eHslX0bin3GB+Lx2p7lEYRShRewuNZL3fUl4qlVJGGiwoPGftmt8JQgk2Y9Ji5/01TnVDo33E5b5O3vUB1HdqQ== - dependencies: - safe-buffer "^5.1.1" - -buffer@^5.0.5, buffer@^5.2.1, buffer@^5.4.3, buffer@^5.5.0, buffer@^5.6.0: - version "5.7.1" - resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.7.1.tgz#ba62e7c13133053582197160851a8f648e99eed0" - integrity sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ== - dependencies: - base64-js "^1.3.1" - ieee754 "^1.1.13" - -bufferutil@^4.0.1: - version "4.0.3" - resolved "https://registry.yarnpkg.com/bufferutil/-/bufferutil-4.0.3.tgz#66724b756bed23cd7c28c4d306d7994f9943cc6b" - integrity sha512-yEYTwGndELGvfXsImMBLop58eaGW+YdONi1fNjTINSY98tmMmFijBG6WXgdkfuLNt4imzQNtIE+eBp1PVpMCSw== - dependencies: - node-gyp-build "^4.2.0" - -bytes@3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.0.tgz#f6cf7933a360e0588fa9fde85651cdc7f805d1f6" - integrity sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg== - -bytewise-core@^1.2.2: - version "1.2.3" - resolved "https://registry.yarnpkg.com/bytewise-core/-/bytewise-core-1.2.3.tgz#3fb410c7e91558eb1ab22a82834577aa6bd61d42" - integrity sha1-P7QQx+kVWOsasiqCg0V3qmvWHUI= - dependencies: - typewise-core "^1.2" - -bytewise@~1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/bytewise/-/bytewise-1.1.0.tgz#1d13cbff717ae7158094aa881b35d081b387253e" - integrity sha1-HRPL/3F65xWAlKqIGzXQgbOHJT4= - dependencies: - bytewise-core "^1.2.2" - typewise "^1.0.3" - -cache-base@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2" - integrity sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ== - dependencies: - collection-visit "^1.0.0" - component-emitter "^1.2.1" - get-value "^2.0.6" - has-value "^1.0.0" - isobject "^3.0.1" - set-value "^2.0.0" - to-object-path "^0.3.0" - union-value "^1.0.0" - unset-value "^1.0.0" - -cacheable-request@^6.0.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/cacheable-request/-/cacheable-request-6.1.0.tgz#20ffb8bd162ba4be11e9567d823db651052ca912" - integrity sha512-Oj3cAGPCqOZX7Rz64Uny2GYAZNliQSqfbePrgAQ1wKAihYmCUnraBtJtKcGR4xz7wF+LoJC+ssFZvv5BgF9Igg== - dependencies: - clone-response "^1.0.2" - get-stream "^5.1.0" - http-cache-semantics "^4.0.0" - keyv "^3.0.0" - lowercase-keys "^2.0.0" - normalize-url "^4.1.0" - responselike "^1.0.2" - -cachedown@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/cachedown/-/cachedown-1.0.0.tgz#d43f036e4510696b31246d7db31ebf0f7ac32d15" - integrity sha1-1D8DbkUQaWsxJG19sx6/D3rDLRU= - dependencies: - abstract-leveldown "^2.4.1" - lru-cache "^3.2.0" - -call-bind@^1.0.0, call-bind@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c" - integrity sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA== - dependencies: - function-bind "^1.1.1" - get-intrinsic "^1.0.2" - -callsites@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" - integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== - -camelcase@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-3.0.0.tgz#32fc4b9fcdaf845fcdf7e73bb97cac2261f0ab0a" - integrity sha1-MvxLn82vhF/N9+c7uXysImHwqwo= - -camelcase@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" - integrity sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0= - -camelcase@^5.0.0: - version "5.3.1" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" - integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== - -caniuse-lite@^1.0.30000844: - version "1.0.30001230" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001230.tgz#8135c57459854b2240b57a4a6786044bdc5a9f71" - integrity sha512-5yBd5nWCBS+jWKTcHOzXwo5xzcj4ePE/yjtkZyUV1BTUmrBaA9MRGC+e7mxnqXSA90CmCA8L3eKLaSUkt099IQ== - -caseless@^0.12.0, caseless@~0.12.0: - version "0.12.0" - resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" - integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= - -cbor@^5.0.2: - version "5.2.0" - resolved "https://registry.yarnpkg.com/cbor/-/cbor-5.2.0.tgz#4cca67783ccd6de7b50ab4ed62636712f287a67c" - integrity sha512-5IMhi9e1QU76ppa5/ajP1BmMWZ2FHkhAhjeVKQ/EFCgYSEaeVaoGtL7cxJskf9oCCk+XjzaIdc3IuU/dbA/o2A== - dependencies: - bignumber.js "^9.0.1" - nofilter "^1.0.4" - -cbor@^7.0.0: - version "7.0.5" - resolved "https://registry.yarnpkg.com/cbor/-/cbor-7.0.5.tgz#ed54cdbc19fa7352bb328d00a5393aa7ce45a10f" - integrity sha512-0aaAPgW92lLmypb9iCd22k7tSD1FbF6dps8VQzmIBKY6ych2gO09b2vo/SbaLTmezJuB8Kh88Rvpl/Uq52mNZg== - dependencies: - "@cto.af/textdecoder" "^0.0.0" - nofilter "^2.0.3" - -chai@^4.3.4: - version "4.3.4" - resolved "https://registry.yarnpkg.com/chai/-/chai-4.3.4.tgz#b55e655b31e1eac7099be4c08c21964fce2e6c49" - integrity sha512-yS5H68VYOCtN1cjfwumDSuzn/9c+yza4f3reKXlE5rUg7SFcCEy90gJvydNgOYtblyf4Zi6jIWRnXOgErta0KA== - dependencies: - assertion-error "^1.1.0" - check-error "^1.0.2" - deep-eql "^3.0.1" - get-func-name "^2.0.0" - pathval "^1.1.1" - type-detect "^4.0.5" - -chalk@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" - integrity sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg= - dependencies: - ansi-styles "^2.2.1" - escape-string-regexp "^1.0.2" - has-ansi "^2.0.0" - strip-ansi "^3.0.0" - supports-color "^2.0.0" - -chalk@^2.0.0, chalk@^2.4.1, chalk@^2.4.2: - version "2.4.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" - integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== - dependencies: - ansi-styles "^3.2.1" - escape-string-regexp "^1.0.5" - supports-color "^5.3.0" - -chalk@^4.0.0, chalk@^4.1.0, chalk@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.1.tgz#c80b3fab28bf6371e6863325eee67e618b77e6ad" - integrity sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg== - dependencies: - ansi-styles "^4.1.0" - supports-color "^7.1.0" - -chardet@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" - integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== - -"charenc@>= 0.0.1": - version "0.0.2" - resolved "https://registry.yarnpkg.com/charenc/-/charenc-0.0.2.tgz#c0a1d2f3a7092e03774bfa83f14c0fc5790a8667" - integrity sha1-wKHS86cJLgN3S/qD8UwPxXkKhmc= - -check-error@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.2.tgz#574d312edd88bb5dd8912e9286dd6c0aed4aac82" - integrity sha1-V00xLt2Iu13YkS6Sht1sCu1KrII= - -checkpoint-store@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/checkpoint-store/-/checkpoint-store-1.1.0.tgz#04e4cb516b91433893581e6d4601a78e9552ea06" - integrity sha1-BOTLUWuRQziTWB5tRgGnjpVS6gY= - dependencies: - functional-red-black-tree "^1.0.1" - -chokidar@3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.3.0.tgz#12c0714668c55800f659e262d4962a97faf554a6" - integrity sha512-dGmKLDdT3Gdl7fBUe8XK+gAtGmzy5Fn0XkkWQuYxGIgWVPPse2CxFA5mtrlD0TOHaHjEUqkWNyP1XdHoJES/4A== - dependencies: - anymatch "~3.1.1" - braces "~3.0.2" - glob-parent "~5.1.0" - is-binary-path "~2.1.0" - is-glob "~4.0.1" - normalize-path "~3.0.0" - readdirp "~3.2.0" - optionalDependencies: - fsevents "~2.1.1" - -chokidar@^1.6.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.7.0.tgz#798e689778151c8076b4b360e5edd28cda2bb468" - integrity sha1-eY5ol3gVHIB2tLNg5e3SjNortGg= - dependencies: - anymatch "^1.3.0" - async-each "^1.0.0" - glob-parent "^2.0.0" - inherits "^2.0.1" - is-binary-path "^1.0.0" - is-glob "^2.0.0" - path-is-absolute "^1.0.0" - readdirp "^2.0.0" - optionalDependencies: - fsevents "^1.0.0" - -chokidar@^3.4.0: - version "3.5.1" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.1.tgz#ee9ce7bbebd2b79f49f304799d5468e31e14e68a" - integrity sha512-9+s+Od+W0VJJzawDma/gvBNQqkTiqYTWLuZoyAsivsI4AaWTCzHG06/TMjsf1cYe9Cb97UCEhjz7HvnPk2p/tw== - dependencies: - anymatch "~3.1.1" - braces "~3.0.2" - glob-parent "~5.1.0" - is-binary-path "~2.1.0" - is-glob "~4.0.1" - normalize-path "~3.0.0" - readdirp "~3.5.0" - optionalDependencies: - fsevents "~2.3.1" - -chownr@^1.1.1: - version "1.1.4" - resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.4.tgz#6fc9d7b42d32a583596337666e7d08084da2cc6b" - integrity sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg== - -ci-info@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" - integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ== - -cids@^0.7.1: - version "0.7.5" - resolved "https://registry.yarnpkg.com/cids/-/cids-0.7.5.tgz#60a08138a99bfb69b6be4ceb63bfef7a396b28b2" - integrity sha512-zT7mPeghoWAu+ppn8+BS1tQ5qGmbMfB4AregnQjA/qHY3GC1m1ptI9GkWNlgeu38r7CuRdXB47uY2XgAYt6QVA== - dependencies: - buffer "^5.5.0" - class-is "^1.1.0" - multibase "~0.6.0" - multicodec "^1.0.0" - multihashes "~0.4.15" - -cids@^1.0.0: - version "1.1.6" - resolved "https://registry.yarnpkg.com/cids/-/cids-1.1.6.tgz#ac7aea7dbcabaa64ca242b5d970d596a5c34d006" - integrity sha512-5P+Jas2bVpjiHibp/SOwKY+v7JhAjTChaAZN+vCIrsWXn/JZV0frX22Vp5zZgEyJRPco79pX+yNQ2S3LkRukHQ== - dependencies: - multibase "^4.0.1" - multicodec "^3.0.1" - multihashes "^4.0.1" - uint8arrays "^2.1.3" - -cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: - version "1.0.4" - resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.4.tgz#8760e4ecc272f4c363532f926d874aae2c1397de" - integrity sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q== - dependencies: - inherits "^2.0.1" - safe-buffer "^5.0.1" - -class-is@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/class-is/-/class-is-1.1.0.tgz#9d3c0fba0440d211d843cec3dedfa48055005825" - integrity sha512-rhjH9AG1fvabIDoGRVH587413LPjTZgmDF9fOFCbFJQV4yuocX1mHxxvXI4g3cGwbVY9wAYIoKlg1N79frJKQw== - -class-utils@^0.3.5: - version "0.3.6" - resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" - integrity sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg== - dependencies: - arr-union "^3.1.0" - define-property "^0.2.5" - isobject "^3.0.0" - static-extend "^0.1.1" - -clean-stack@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-2.2.0.tgz#ee8472dbb129e727b31e8a10a427dee9dfe4008b" - integrity sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A== - -cli-cursor@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-3.1.0.tgz#264305a7ae490d1d03bf0c9ba7c925d1753af307" - integrity sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw== - dependencies: - restore-cursor "^3.1.0" - -cli-spinners@^2.5.0: - version "2.6.0" - resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-2.6.0.tgz#36c7dc98fb6a9a76bd6238ec3f77e2425627e939" - integrity sha512-t+4/y50K/+4xcCRosKkA7W4gTr1MySvLV0q+PxmG7FJ5g+66ChKurYjxBCjHggHH3HA5Hh9cy+lcUGWDqVH+4Q== - -cli-table3@^0.5.0: - version "0.5.1" - resolved "https://registry.yarnpkg.com/cli-table3/-/cli-table3-0.5.1.tgz#0252372d94dfc40dbd8df06005f48f31f656f202" - integrity sha512-7Qg2Jrep1S/+Q3EceiZtQcDPWxhAvBw+ERf1162v4sikJrvojMHFqXt8QIVha8UlH9rgU0BeWPytZ9/TzYqlUw== - dependencies: - object-assign "^4.1.0" - string-width "^2.1.1" - optionalDependencies: - colors "^1.1.2" - -cli-table3@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/cli-table3/-/cli-table3-0.6.0.tgz#b7b1bc65ca8e7b5cef9124e13dc2b21e2ce4faee" - integrity sha512-gnB85c3MGC7Nm9I/FkiasNBOKjOiO1RNuXXarQms37q4QMpWdlbBgD/VnOStA2faG1dpXMv31RFApjX1/QdgWQ== - dependencies: - object-assign "^4.1.0" - string-width "^4.2.0" - optionalDependencies: - colors "^1.1.2" - -cli-table@^0.3.6: - version "0.3.6" - resolved "https://registry.yarnpkg.com/cli-table/-/cli-table-0.3.6.tgz#e9d6aa859c7fe636981fd3787378c2a20bce92fc" - integrity sha512-ZkNZbnZjKERTY5NwC2SeMeLeifSPq/pubeRoTpdr3WchLlnZg6hEgvHkK5zL7KNFdd9PmHN8lxrENUwI3cE8vQ== - dependencies: - colors "1.0.3" - -cli-truncate@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/cli-truncate/-/cli-truncate-2.1.0.tgz#c39e28bf05edcde5be3b98992a22deed5a2b93c7" - integrity sha512-n8fOixwDD6b/ObinzTrp1ZKFzbgvKZvuz/TvejnLn1aQfC6r52XEx85FmuC+3HI+JM7coBRXUvNqEU2PHVrHpg== - dependencies: - slice-ansi "^3.0.0" - string-width "^4.2.0" - -cli-width@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-3.0.0.tgz#a2f48437a2caa9a22436e794bf071ec9e61cedf6" - integrity sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw== - -cliui@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" - integrity sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0= - dependencies: - string-width "^1.0.1" - strip-ansi "^3.0.1" - wrap-ansi "^2.0.0" - -cliui@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-4.1.0.tgz#348422dbe82d800b3022eef4f6ac10bf2e4d1b49" - integrity sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ== - dependencies: - string-width "^2.1.1" - strip-ansi "^4.0.0" - wrap-ansi "^2.0.0" - -cliui@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-5.0.0.tgz#deefcfdb2e800784aa34f46fa08e06851c7bbbc5" - integrity sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA== - dependencies: - string-width "^3.1.0" - strip-ansi "^5.2.0" - wrap-ansi "^5.1.0" - -cliui@^7.0.2: - version "7.0.4" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" - integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ== - dependencies: - string-width "^4.2.0" - strip-ansi "^6.0.0" - wrap-ansi "^7.0.0" - -clone-response@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/clone-response/-/clone-response-1.0.2.tgz#d1dc973920314df67fbeb94223b4ee350239e96b" - integrity sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws= - dependencies: - mimic-response "^1.0.0" - -clone@2.1.2, clone@^2.0.0: - version "2.1.2" - resolved "https://registry.yarnpkg.com/clone/-/clone-2.1.2.tgz#1b7f4b9f591f1e8f83670401600345a02887435f" - integrity sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18= - -clone@^1.0.2: - version "1.0.4" - resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e" - integrity sha1-2jCcwmPfFZlMaIypAheco8fNfH4= - -co@^4.6.0: - version "4.6.0" - resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" - integrity sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ= - -code-point-at@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" - integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= - -collection-visit@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" - integrity sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA= - dependencies: - map-visit "^1.0.0" - object-visit "^1.0.0" - -color-convert@^1.9.0, color-convert@^1.9.1: - version "1.9.3" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" - integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== - dependencies: - color-name "1.1.3" - -color-convert@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" - integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== - dependencies: - color-name "~1.1.4" - -color-name@1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" - integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= - -color-name@^1.0.0, color-name@~1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" - integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== - -color-string@^1.5.2: - version "1.5.5" - resolved "https://registry.yarnpkg.com/color-string/-/color-string-1.5.5.tgz#65474a8f0e7439625f3d27a6a19d89fc45223014" - integrity sha512-jgIoum0OfQfq9Whcfc2z/VhCNcmQjWbey6qBX0vqt7YICflUmBCh9E9CiQD5GSJ+Uehixm3NUwHVhqUAWRivZg== - dependencies: - color-name "^1.0.0" - simple-swizzle "^0.2.2" - -color@3.0.x: - version "3.0.0" - resolved "https://registry.yarnpkg.com/color/-/color-3.0.0.tgz#d920b4328d534a3ac8295d68f7bd4ba6c427be9a" - integrity sha512-jCpd5+s0s0t7p3pHQKpnJ0TpQKKdleP71LWcA0aqiljpiuAkOSUFN/dyH8ZwF0hRmFlrIuRhufds1QyEP9EB+w== - dependencies: - color-convert "^1.9.1" - color-string "^1.5.2" - -colorette@^1.2.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.2.2.tgz#cbcc79d5e99caea2dbf10eb3a26fd8b3e6acfa94" - integrity sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w== - -colors@1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/colors/-/colors-1.0.3.tgz#0433f44d809680fdeb60ed260f1b0c262e82a40b" - integrity sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs= - -colors@^1.1.2, colors@^1.2.1, colors@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/colors/-/colors-1.4.0.tgz#c50491479d4c1bdaed2c9ced32cf7c7dc2360f78" - integrity sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA== - -colorspace@1.1.x: - version "1.1.2" - resolved "https://registry.yarnpkg.com/colorspace/-/colorspace-1.1.2.tgz#e0128950d082b86a2168580796a0aa5d6c68d8c5" - integrity sha512-vt+OoIP2d76xLhjwbBaucYlNSpPsrJWPlBTtwCpQKIu6/CSMutyzX93O/Do0qzpH3YoHEes8YEFXyZ797rEhzQ== - dependencies: - color "3.0.x" - text-hex "1.0.x" - -combined-stream@^1.0.6, combined-stream@^1.0.8, combined-stream@~1.0.6: - version "1.0.8" - resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" - integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== - dependencies: - delayed-stream "~1.0.0" - -command-exists@^1.2.8: - version "1.2.9" - resolved "https://registry.yarnpkg.com/command-exists/-/command-exists-1.2.9.tgz#c50725af3808c8ab0260fd60b01fbfa25b954f69" - integrity sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w== - -command-line-args@^4.0.7: - version "4.0.7" - resolved "https://registry.yarnpkg.com/command-line-args/-/command-line-args-4.0.7.tgz#f8d1916ecb90e9e121eda6428e41300bfb64cc46" - integrity sha512-aUdPvQRAyBvQd2n7jXcsMDz68ckBJELXNzBybCHOibUWEg0mWTnaYCSRU8h9R+aNRSvDihJtssSRCiDRpLaezA== - dependencies: - array-back "^2.0.0" - find-replace "^1.0.3" - typical "^2.6.1" - -commander@2.11.0: - version "2.11.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.11.0.tgz#157152fd1e7a6c8d98a5b715cf376df928004563" - integrity sha512-b0553uYA5YAEGgyYIGYROzKQ7X5RAqedkfjiZxwi0kL1g3bOaBNNZfYkzt/CL0umgD5wc9Jec2FbB98CjkMRvQ== - -commander@3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/commander/-/commander-3.0.2.tgz#6837c3fb677ad9933d1cfba42dd14d5117d6b39e" - integrity sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow== - -commander@^2.15.0, commander@^2.9.0: - version "2.20.3" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" - integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== - -commander@^6.2.0: - version "6.2.1" - resolved "https://registry.yarnpkg.com/commander/-/commander-6.2.1.tgz#0792eb682dfbc325999bb2b84fddddba110ac73c" - integrity sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA== - -compare-versions@^3.6.0: - version "3.6.0" - resolved "https://registry.yarnpkg.com/compare-versions/-/compare-versions-3.6.0.tgz#1a5689913685e5a87637b8d3ffca75514ec41d62" - integrity sha512-W6Af2Iw1z4CB7q4uU4hv646dW9GQuBM+YpC0UvUCWSD8w90SJjp+ujJuXaEMtAXBtSqGfMPuFOVn4/+FlaqfBA== - -component-emitter@^1.2.1: - version "1.3.0" - resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0" - integrity sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg== - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= - -concat-stream@^1.5.1, concat-stream@^1.6.0, concat-stream@^1.6.2: - version "1.6.2" - resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34" - integrity sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw== - dependencies: - buffer-from "^1.0.0" - inherits "^2.0.3" - readable-stream "^2.2.2" - typedarray "^0.0.6" - -content-disposition@0.5.3: - version "0.5.3" - resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.3.tgz#e130caf7e7279087c5616c2007d0485698984fbd" - integrity sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g== - dependencies: - safe-buffer "5.1.2" - -content-hash@^2.5.2: - version "2.5.2" - resolved "https://registry.yarnpkg.com/content-hash/-/content-hash-2.5.2.tgz#bbc2655e7c21f14fd3bfc7b7d4bfe6e454c9e211" - integrity sha512-FvIQKy0S1JaWV10sMsA7TRx8bpU+pqPkhbsfvOJAdjRXvYxEckAwQWGwtRjiaJfh+E0DvcWUGqcdjwMGFjsSdw== - dependencies: - cids "^0.7.1" - multicodec "^0.5.5" - multihashes "^0.4.15" - -content-type@~1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" - integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== - -convert-source-map@^1.5.1: - version "1.7.0" - resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.7.0.tgz#17a2cb882d7f77d3490585e2ce6c524424a3a442" - integrity sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA== - dependencies: - safe-buffer "~5.1.1" - -cookie-signature@1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" - integrity sha1-4wOogrNCzD7oylE6eZmXNNqzriw= - -cookie@0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.0.tgz#beb437e7022b3b6d49019d088665303ebe9c14ba" - integrity sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg== - -cookie@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.1.tgz#afd713fe26ebd21ba95ceb61f9a8116e50a537d1" - integrity sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA== - -cookiejar@^2.1.1: - version "2.1.2" - resolved "https://registry.yarnpkg.com/cookiejar/-/cookiejar-2.1.2.tgz#dd8a235530752f988f9a0844f3fc589e3111125c" - integrity sha512-Mw+adcfzPxcPeI+0WlvRrr/3lGVO0bD75SxX6811cxSh1Wbxx7xZBGK1eVtDf6si8rg2lhnUjsVLMFMfbRIuwA== - -copy-descriptor@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" - integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= - -core-js-pure@^3.0.1: - version "3.13.0" - resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.13.0.tgz#9d267fb47d1d7046cfbc05e7b67bb235b6735355" - integrity sha512-7VTvXbsMxROvzPAVczLgfizR8CyYnvWPrb1eGrtlZAJfjQWEHLofVfCKljLHdpazTfpaziRORwUH/kfGDKvpdA== - -core-js@^2.4.0, core-js@^2.5.0: - version "2.6.12" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.12.tgz#d9333dfa7b065e347cc5682219d6f690859cc2ec" - integrity sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ== - -core-util-is@1.0.2, core-util-is@~1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" - integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= - -cors@2.8.5, cors@^2.8.1: - version "2.8.5" - resolved "https://registry.yarnpkg.com/cors/-/cors-2.8.5.tgz#eac11da51592dd86b9f06f6e7ac293b3df875d29" - integrity sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g== - dependencies: - object-assign "^4" - vary "^1" - -cosmiconfig@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-7.0.0.tgz#ef9b44d773959cae63ddecd122de23853b60f8d3" - integrity sha512-pondGvTuVYDk++upghXJabWzL6Kxu6f26ljFw64Swq9v6sQPUL3EUlVDV56diOjpCayKihL6hVe8exIACU4XcA== - dependencies: - "@types/parse-json" "^4.0.0" - import-fresh "^3.2.1" - parse-json "^5.0.0" - path-type "^4.0.0" - yaml "^1.10.0" - -crc-32@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/crc-32/-/crc-32-1.2.0.tgz#cb2db6e29b88508e32d9dd0ec1693e7b41a18208" - integrity sha512-1uBwHxF+Y/4yF5G48fwnKq6QsIXheor3ZLPT80yGBV1oEUwpPojlEhQbWKVw1VwcTQyMGHK1/XMmTjmlsmTTGA== - dependencies: - exit-on-epipe "~1.0.1" - printj "~1.1.0" - -create-ecdh@^4.0.0: - version "4.0.4" - resolved "https://registry.yarnpkg.com/create-ecdh/-/create-ecdh-4.0.4.tgz#d6e7f4bffa66736085a0762fd3a632684dabcc4e" - integrity sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A== - dependencies: - bn.js "^4.1.0" - elliptic "^6.5.3" - -create-hash@^1.1.0, create-hash@^1.1.2, create-hash@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.2.0.tgz#889078af11a63756bcfb59bd221996be3a9ef196" - integrity sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg== - dependencies: - cipher-base "^1.0.1" - inherits "^2.0.1" - md5.js "^1.3.4" - ripemd160 "^2.0.1" - sha.js "^2.4.0" - -create-hmac@^1.1.0, create-hmac@^1.1.4, create-hmac@^1.1.7: - version "1.1.7" - resolved "https://registry.yarnpkg.com/create-hmac/-/create-hmac-1.1.7.tgz#69170c78b3ab957147b2b8b04572e47ead2243ff" - integrity sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg== - dependencies: - cipher-base "^1.0.3" - create-hash "^1.1.0" - inherits "^2.0.1" - ripemd160 "^2.0.0" - safe-buffer "^5.0.1" - sha.js "^2.4.8" - -create-require@^1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" - integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== - -cross-fetch@3.0.6: - version "3.0.6" - resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.0.6.tgz#3a4040bc8941e653e0e9cf17f29ebcd177d3365c" - integrity sha512-KBPUbqgFjzWlVcURG+Svp9TlhA5uliYtiNx/0r8nv0pdypeQCRJ9IaSIc3q/x3q8t3F75cHuwxVql1HFGHCNJQ== - dependencies: - node-fetch "2.6.1" - -cross-fetch@^2.1.0, cross-fetch@^2.1.1: - version "2.2.3" - resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-2.2.3.tgz#e8a0b3c54598136e037f8650f8e823ccdfac198e" - integrity sha512-PrWWNH3yL2NYIb/7WF/5vFG3DCQiXDOVf8k3ijatbrtnwNuhMWLC7YF7uqf53tbTFDzHIUD8oITw4Bxt8ST3Nw== - dependencies: - node-fetch "2.1.2" - whatwg-fetch "2.0.4" - -cross-spawn@^5.0.1: - version "5.1.0" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" - integrity sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk= - dependencies: - lru-cache "^4.0.1" - shebang-command "^1.2.0" - which "^1.2.9" - -cross-spawn@^6.0.0, cross-spawn@^6.0.5: - version "6.0.5" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" - integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ== - dependencies: - nice-try "^1.0.4" - path-key "^2.0.1" - semver "^5.5.0" - shebang-command "^1.2.0" - which "^1.2.9" - -cross-spawn@^7.0.0, cross-spawn@^7.0.2: - version "7.0.3" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" - integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== - dependencies: - path-key "^3.1.0" - shebang-command "^2.0.0" - which "^2.0.1" - -"crypt@>= 0.0.1": - version "0.0.2" - resolved "https://registry.yarnpkg.com/crypt/-/crypt-0.0.2.tgz#88d7ff7ec0dfb86f713dc87bbb42d044d3e6c41b" - integrity sha1-iNf/fsDfuG9xPch7u0LQRNPmxBs= - -crypto-browserify@3.12.0: - version "3.12.0" - resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.12.0.tgz#396cf9f3137f03e4b8e532c58f698254e00f80ec" - integrity sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg== - dependencies: - browserify-cipher "^1.0.0" - browserify-sign "^4.0.0" - create-ecdh "^4.0.0" - create-hash "^1.1.0" - create-hmac "^1.1.0" - diffie-hellman "^5.0.0" - inherits "^2.0.1" - pbkdf2 "^3.0.3" - public-encrypt "^4.0.0" - randombytes "^2.0.0" - randomfill "^1.0.3" - -d@1, d@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/d/-/d-1.0.1.tgz#8698095372d58dbee346ffd0c7093f99f8f9eb5a" - integrity sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA== - dependencies: - es5-ext "^0.10.50" - type "^1.0.1" - -dashdash@^1.12.0: - version "1.14.1" - resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" - integrity sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA= - dependencies: - assert-plus "^1.0.0" - -death@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/death/-/death-1.1.0.tgz#01aa9c401edd92750514470b8266390c66c67318" - integrity sha1-AaqcQB7dknUFFEcLgmY5DGbGcxg= - -debug@2.6.9, debug@^2.2.0, debug@^2.3.3, debug@^2.6.0, debug@^2.6.8, debug@^2.6.9: - version "2.6.9" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" - integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== - dependencies: - ms "2.0.0" - -debug@3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" - integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g== - dependencies: - ms "2.0.0" - -debug@3.2.6: - version "3.2.6" - resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" - integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ== - dependencies: - ms "^2.1.1" - -debug@4, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.2.0, debug@^4.3.1: - version "4.3.1" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.1.tgz#f0d229c505e0c6d8c49ac553d1b13dc183f6b2ee" - integrity sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ== - dependencies: - ms "2.1.2" - -debug@^3.1.0, debug@^3.2.7: - version "3.2.7" - resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a" - integrity sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ== - dependencies: - ms "^2.1.1" - -decamelize@^1.1.1, decamelize@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" - integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= - -decode-uri-component@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" - integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU= - -decompress-response@^3.2.0, decompress-response@^3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-3.3.0.tgz#80a4dd323748384bfa248083622aedec982adff3" - integrity sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M= - dependencies: - mimic-response "^1.0.0" - -dedent@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c" - integrity sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw= - -deep-eql@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-3.0.1.tgz#dfc9404400ad1c8fe023e7da1df1c147c4b444df" - integrity sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw== - dependencies: - type-detect "^4.0.0" - -deep-equal@~1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.1.1.tgz#b5c98c942ceffaf7cb051e24e1434a25a2e6076a" - integrity sha512-yd9c5AdiqVcR+JjcwUQb9DkhJc8ngNr0MahEBGvDiJw8puWab2yZlh+nkasOnZP+EGTAP6rRp2JzJhJZzvNF8g== - dependencies: - is-arguments "^1.0.4" - is-date-object "^1.0.1" - is-regex "^1.0.4" - object-is "^1.0.1" - object-keys "^1.1.1" - regexp.prototype.flags "^1.2.0" - -deep-is@^0.1.3, deep-is@~0.1.3: - version "0.1.3" - resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" - integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= - -defaults@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/defaults/-/defaults-1.0.3.tgz#c656051e9817d9ff08ed881477f3fe4019f3ef7d" - integrity sha1-xlYFHpgX2f8I7YgUd/P+QBnz730= - dependencies: - clone "^1.0.2" - -defer-to-connect@^1.0.1: - version "1.1.3" - resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-1.1.3.tgz#331ae050c08dcf789f8c83a7b81f0ed94f4ac591" - integrity sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ== - -deferred-leveldown@~1.2.1: - version "1.2.2" - resolved "https://registry.yarnpkg.com/deferred-leveldown/-/deferred-leveldown-1.2.2.tgz#3acd2e0b75d1669924bc0a4b642851131173e1eb" - integrity sha512-uukrWD2bguRtXilKt6cAWKyoXrTSMo5m7crUdLfWQmu8kIm88w3QZoUL+6nhpfKVmhHANER6Re3sKoNoZ3IKMA== - dependencies: - abstract-leveldown "~2.6.0" - -deferred-leveldown@~4.0.0: - version "4.0.2" - resolved "https://registry.yarnpkg.com/deferred-leveldown/-/deferred-leveldown-4.0.2.tgz#0b0570087827bf480a23494b398f04c128c19a20" - integrity sha512-5fMC8ek8alH16QiV0lTCis610D1Zt1+LA4MS4d63JgS32lrCjTFDUFz2ao09/j2I4Bqb5jL4FZYwu7Jz0XO1ww== - dependencies: - abstract-leveldown "~5.0.0" - inherits "^2.0.3" - -deferred-leveldown@~5.3.0: - version "5.3.0" - resolved "https://registry.yarnpkg.com/deferred-leveldown/-/deferred-leveldown-5.3.0.tgz#27a997ad95408b61161aa69bd489b86c71b78058" - integrity sha512-a59VOT+oDy7vtAbLRCZwWgxu2BaCfd5Hk7wxJd48ei7I+nsg8Orlb9CLG0PMZienk9BSUKgeAqkO2+Lw+1+Ukw== - dependencies: - abstract-leveldown "~6.2.1" - inherits "^2.0.3" - -define-properties@^1.1.2, define-properties@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1" - integrity sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ== - dependencies: - object-keys "^1.0.12" - -define-property@^0.2.5: - version "0.2.5" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" - integrity sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY= - dependencies: - is-descriptor "^0.1.0" - -define-property@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6" - integrity sha1-dp66rz9KY6rTr56NMEybvnm/sOY= - dependencies: - is-descriptor "^1.0.0" - -define-property@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d" - integrity sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ== - dependencies: - is-descriptor "^1.0.2" - isobject "^3.0.1" - -defined@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/defined/-/defined-1.0.0.tgz#c98d9bcef75674188e110969151199e39b1fa693" - integrity sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM= - -delayed-stream@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" - integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk= - -delimit-stream@0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/delimit-stream/-/delimit-stream-0.1.0.tgz#9b8319477c0e5f8aeb3ce357ae305fc25ea1cd2b" - integrity sha1-m4MZR3wOX4rrPONXrjBfwl6hzSs= - -depd@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" - integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak= - -depd@~2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df" - integrity sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw== - -des.js@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/des.js/-/des.js-1.0.1.tgz#5382142e1bdc53f85d86d53e5f4aa7deb91e0843" - integrity sha512-Q0I4pfFrv2VPd34/vfLrFOoRmlYj3OV50i7fskps1jZWK1kApMWWT9G6RRUeYedLcBDIhnSDaUvJMb3AhUlaEA== - dependencies: - inherits "^2.0.1" - minimalistic-assert "^1.0.0" - -destroy@~1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" - integrity sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA= - -detect-indent@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-4.0.0.tgz#f76d064352cdf43a1cb6ce619c4ee3a9475de208" - integrity sha1-920GQ1LN9Docts5hnE7jqUdd4gg= - dependencies: - repeating "^2.0.0" - -detect-port@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/detect-port/-/detect-port-1.3.0.tgz#d9c40e9accadd4df5cac6a782aefd014d573d1f1" - integrity sha512-E+B1gzkl2gqxt1IhUzwjrxBKRqx1UzC3WLONHinn8S3T6lwV/agVCyitiFOsGJ/eYuEUBvD71MZHy3Pv1G9doQ== - dependencies: - address "^1.0.1" - debug "^2.6.0" - -diff@3.3.1: - version "3.3.1" - resolved "https://registry.yarnpkg.com/diff/-/diff-3.3.1.tgz#aa8567a6eed03c531fc89d3f711cd0e5259dec75" - integrity sha512-MKPHZDMB0o6yHyDryUOScqZibp914ksXwAMYMTHj6KO8UeKsRYNJD3oNCKjTqZon+V488P7N/HzXF8t7ZR95ww== - -diff@3.5.0, diff@^3.5.0: - version "3.5.0" - resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" - integrity sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA== - -diff@^4.0.1: - version "4.0.2" - resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" - integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== - -diffie-hellman@^5.0.0: - version "5.0.3" - resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.3.tgz#40e8ee98f55a2149607146921c63e1ae5f3d2875" - integrity sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg== - dependencies: - bn.js "^4.1.0" - miller-rabin "^4.0.0" - randombytes "^2.0.0" - -dir-glob@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" - integrity sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA== - dependencies: - path-type "^4.0.0" - -dir-to-object@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/dir-to-object/-/dir-to-object-2.0.0.tgz#29723e9bd1c3e58e4f307bd04ff634c0370c8f8a" - integrity sha512-sXs0JKIhymON7T1UZuO2Ud6VTNAx/VTBXIl4+3mjb2RgfOpt+hectX0x04YqPOPdkeOAKoJuKqwqnXXURNPNEA== - -dns-over-http-resolver@^1.0.0: - version "1.2.3" - resolved "https://registry.yarnpkg.com/dns-over-http-resolver/-/dns-over-http-resolver-1.2.3.tgz#194d5e140a42153f55bb79ac5a64dd2768c36af9" - integrity sha512-miDiVSI6KSNbi4SVifzO/reD8rMnxgrlnkrlkugOLQpWQTe2qMdHsZp5DmfKjxNE+/T3VAAYLQUZMv9SMr6+AA== - dependencies: - debug "^4.3.1" - native-fetch "^3.0.0" - receptacle "^1.3.2" - -doctrine@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d" - integrity sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw== - dependencies: - esutils "^2.0.2" - -doctrine@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" - integrity sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w== - dependencies: - esutils "^2.0.2" - -dom-walk@^0.1.0: - version "0.1.2" - resolved "https://registry.yarnpkg.com/dom-walk/-/dom-walk-0.1.2.tgz#0c548bef048f4d1f2a97249002236060daa3fd84" - integrity sha512-6QvTW9mrGeIegrFXdtQi9pk7O/nSK6lSdXW2eqUspN5LWD7UTji2Fqw5V2YLjBpHEoU9Xl/eUWNpDeZvoyOv2w== - -dotenv@*: - version "10.0.0" - resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-10.0.0.tgz#3d4227b8fb95f81096cdd2b66653fb2c7085ba81" - integrity sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q== - -dotenv@^9.0.0: - version "9.0.2" - resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-9.0.2.tgz#dacc20160935a37dea6364aa1bef819fb9b6ab05" - integrity sha512-I9OvvrHp4pIARv4+x9iuewrWycX6CcZtoAu1XrzPxc5UygMJXJZYmBsynku8IkrJwgypE5DGNjDPmPRhDCptUg== - -dotignore@~0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/dotignore/-/dotignore-0.1.2.tgz#f942f2200d28c3a76fbdd6f0ee9f3257c8a2e905" - integrity sha512-UGGGWfSauusaVJC+8fgV+NVvBXkCTmVv7sk6nojDZZvuOUNGUy0Zk4UpHQD6EDjS0jpBwcACvH4eofvyzBcRDw== - dependencies: - minimatch "^3.0.4" - -dottie@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/dottie/-/dottie-2.0.2.tgz#cc91c0726ce3a054ebf11c55fbc92a7f266dd154" - integrity sha512-fmrwR04lsniq/uSr8yikThDTrM7epXHBAAjH9TbeH3rEA8tdCO7mRzB9hdmdGyJCxF8KERo9CITcm3kGuoyMhg== - -drbg.js@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/drbg.js/-/drbg.js-1.0.1.tgz#3e36b6c42b37043823cdbc332d58f31e2445480b" - integrity sha1-Pja2xCs3BDgjzbwzLVjzHiRFSAs= - dependencies: - browserify-aes "^1.0.6" - create-hash "^1.1.2" - create-hmac "^1.1.4" - -duplexer3@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2" - integrity sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI= - -duplexify@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/duplexify/-/duplexify-4.1.1.tgz#7027dc374f157b122a8ae08c2d3ea4d2d953aa61" - integrity sha512-DY3xVEmVHTv1wSzKNbwoU6nVjzI369Y6sPoqfYr0/xlx3IdX2n94xIszTcjPO8W8ZIv0Wb0PXNcjuZyT4wiICA== - dependencies: - end-of-stream "^1.4.1" - inherits "^2.0.3" - readable-stream "^3.1.1" - stream-shift "^1.0.0" - -ecc-jsbn@~0.1.1: - version "0.1.2" - resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" - integrity sha1-OoOpBOVDUyh4dMVkt1SThoSamMk= - dependencies: - jsbn "~0.1.0" - safer-buffer "^2.1.0" - -ee-first@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" - integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= - -electron-to-chromium@^1.3.47: - version "1.3.740" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.740.tgz#e38b7d2b848f632191b643e6dabca51be2162922" - integrity sha512-Mi2m55JrX2BFbNZGKYR+2ItcGnR4O5HhrvgoRRyZQlaMGQULqDhoGkLWHzJoshSzi7k1PUofxcDbNhlFrDZNhg== - -elliptic@6.5.3: - version "6.5.3" - resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.3.tgz#cb59eb2efdaf73a0bd78ccd7015a62ad6e0f93d6" - integrity sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw== - dependencies: - bn.js "^4.4.0" - brorand "^1.0.1" - hash.js "^1.0.0" - hmac-drbg "^1.0.0" - inherits "^2.0.1" - minimalistic-assert "^1.0.0" - minimalistic-crypto-utils "^1.0.0" - -elliptic@6.5.4, elliptic@^6.4.0, elliptic@^6.5.2, elliptic@^6.5.3: - version "6.5.4" - resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.4.tgz#da37cebd31e79a1367e941b592ed1fbebd58abbb" - integrity sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ== - dependencies: - bn.js "^4.11.9" - brorand "^1.1.0" - hash.js "^1.0.0" - hmac-drbg "^1.0.1" - inherits "^2.0.4" - minimalistic-assert "^1.0.1" - minimalistic-crypto-utils "^1.0.1" - -emoji-regex@^7.0.1: - version "7.0.3" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" - integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA== - -emoji-regex@^8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" - integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== - -emoji-regex@^9.2.2: - version "9.2.2" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-9.2.2.tgz#840c8803b0d8047f4ff0cf963176b32d4ef3ed72" - integrity sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg== - -enabled@2.0.x: - version "2.0.0" - resolved "https://registry.yarnpkg.com/enabled/-/enabled-2.0.0.tgz#f9dd92ec2d6f4bbc0d5d1e64e21d61cd4665e7c2" - integrity sha512-AKrN98kuwOzMIdAizXGI86UFBoo26CL21UM763y1h/GMSJ4/OHU9k2YlsmBpyScFo/wbLzWQJBMCW4+IO3/+OQ== - -encodeurl@~1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" - integrity sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k= - -encoding-down@5.0.4, encoding-down@~5.0.0: - version "5.0.4" - resolved "https://registry.yarnpkg.com/encoding-down/-/encoding-down-5.0.4.tgz#1e477da8e9e9d0f7c8293d320044f8b2cd8e9614" - integrity sha512-8CIZLDcSKxgzT+zX8ZVfgNbu8Md2wq/iqa1Y7zyVR18QBEAc0Nmzuvj/N5ykSKpfGzjM8qxbaFntLPwnVoUhZw== - dependencies: - abstract-leveldown "^5.0.0" - inherits "^2.0.3" - level-codec "^9.0.0" - level-errors "^2.0.0" - xtend "^4.0.1" - -encoding-down@^6.3.0: - version "6.3.0" - resolved "https://registry.yarnpkg.com/encoding-down/-/encoding-down-6.3.0.tgz#b1c4eb0e1728c146ecaef8e32963c549e76d082b" - integrity sha512-QKrV0iKR6MZVJV08QY0wp1e7vF6QbhnbQhb07bwpEyuz4uZiZgPlEGdkCROuFkUwdxlFaiPIhjyarH1ee/3vhw== - dependencies: - abstract-leveldown "^6.2.1" - inherits "^2.0.3" - level-codec "^9.0.0" - level-errors "^2.0.0" - -encoding@^0.1.11: - version "0.1.13" - resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.13.tgz#56574afdd791f54a8e9b2785c0582a2d26210fa9" - integrity sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A== - dependencies: - iconv-lite "^0.6.2" - -end-of-stream@^1.1.0, end-of-stream@^1.4.1: - version "1.4.4" - resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" - integrity sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q== - dependencies: - once "^1.4.0" - -enquirer@^2.3.0, enquirer@^2.3.5, enquirer@^2.3.6: - version "2.3.6" - resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.3.6.tgz#2a7fe5dd634a1e4125a975ec994ff5456dc3734d" - integrity sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg== - dependencies: - ansi-colors "^4.1.1" - -env-paths@^2.2.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/env-paths/-/env-paths-2.2.1.tgz#420399d416ce1fbe9bc0a07c62fa68d67fd0f8f2" - integrity sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A== - -eol@^0.9.1: - version "0.9.1" - resolved "https://registry.yarnpkg.com/eol/-/eol-0.9.1.tgz#f701912f504074be35c6117a5c4ade49cd547acd" - integrity sha512-Ds/TEoZjwggRoz/Q2O7SE3i4Jm66mqTDfmdHdq/7DKVk3bro9Q8h6WdXKdPqFLMoqxrDK5SVRzHVPOS6uuGtrg== - -err-code@^2.0.0, err-code@^2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/err-code/-/err-code-2.0.3.tgz#23c2f3b756ffdfc608d30e27c9a941024807e7f9" - integrity sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA== - -err-code@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/err-code/-/err-code-3.0.1.tgz#a444c7b992705f2b120ee320b09972eef331c920" - integrity sha512-GiaH0KJUewYok+eeY05IIgjtAe4Yltygk9Wqp1V5yVWLdhf0hYZchRjNIT9bb0mSwRcIusT3cx7PJUf3zEIfUA== - -errno@~0.1.1: - version "0.1.8" - resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.8.tgz#8bb3e9c7d463be4976ff888f76b4809ebc2e811f" - integrity sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A== - dependencies: - prr "~1.0.1" - -error-ex@^1.2.0, error-ex@^1.3.1: - version "1.3.2" - resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" - integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== - dependencies: - is-arrayish "^0.2.1" - -es-abstract@^1.18.0-next.1, es-abstract@^1.18.0-next.2, es-abstract@^1.18.2: - version "1.18.2" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.18.2.tgz#6eb518b640262e8ddcbd48e0bc8549f82efd48a7" - integrity sha512-byRiNIQXE6HWNySaU6JohoNXzYgbBjztwFnBLUTiJmWXjaU9bSq3urQLUlNLQ292tc+gc07zYZXNZjaOoAX3sw== - dependencies: - call-bind "^1.0.2" - es-to-primitive "^1.2.1" - function-bind "^1.1.1" - get-intrinsic "^1.1.1" - has "^1.0.3" - has-symbols "^1.0.2" - is-callable "^1.2.3" - is-negative-zero "^2.0.1" - is-regex "^1.1.3" - is-string "^1.0.6" - object-inspect "^1.10.3" - object-keys "^1.1.1" - object.assign "^4.1.2" - string.prototype.trimend "^1.0.4" - string.prototype.trimstart "^1.0.4" - unbox-primitive "^1.0.1" - -es-to-primitive@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.1.tgz#e55cd4c9cdc188bcefb03b366c736323fc5c898a" - integrity sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA== - dependencies: - is-callable "^1.1.4" - is-date-object "^1.0.1" - is-symbol "^1.0.2" - -es5-ext@^0.10.35, es5-ext@^0.10.50: - version "0.10.53" - resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.53.tgz#93c5a3acfdbef275220ad72644ad02ee18368de1" - integrity sha512-Xs2Stw6NiNHWypzRTY1MtaG/uJlwCk8kH81920ma8mvN8Xq1gsfhZvpkImLQArw8AHnv8MT2I45J3c0R8slE+Q== - dependencies: - es6-iterator "~2.0.3" - es6-symbol "~3.1.3" - next-tick "~1.0.0" - -es6-iterator@~2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.3.tgz#a7de889141a05a94b0854403b2d0a0fbfa98f3b7" - integrity sha1-p96IkUGgWpSwhUQDstCg+/qY87c= - dependencies: - d "1" - es5-ext "^0.10.35" - es6-symbol "^3.1.1" - -es6-symbol@^3.1.1, es6-symbol@~3.1.3: - version "3.1.3" - resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.3.tgz#bad5d3c1bcdac28269f4cb331e431c78ac705d18" - integrity sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA== - dependencies: - d "^1.0.1" - ext "^1.1.2" - -escalade@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" - integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== - -escape-html@~1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" - integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg= - -escape-string-regexp@1.0.5, escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" - integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= - -escape-string-regexp@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" - integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== - -escodegen@1.8.x: - version "1.8.1" - resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.8.1.tgz#5a5b53af4693110bebb0867aa3430dd3b70a1018" - integrity sha1-WltTr0aTEQvrsIZ6o0MN07cKEBg= - dependencies: - esprima "^2.7.1" - estraverse "^1.9.1" - esutils "^2.0.2" - optionator "^0.8.1" - optionalDependencies: - source-map "~0.2.0" - -eslint-config-prettier@^8.3.0: - version "8.3.0" - resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.3.0.tgz#f7471b20b6fe8a9a9254cc684454202886a2dd7a" - integrity sha512-BgZuLUSeKzvlL/VUjx/Yb787VQ26RU3gGjA3iiFvdsp/2bMfVIWUVP7tjxtjS0e+HP409cPlPvNkQloz8C91ew== - -eslint-config-standard@^16.0.0: - version "16.0.3" - resolved "https://registry.yarnpkg.com/eslint-config-standard/-/eslint-config-standard-16.0.3.tgz#6c8761e544e96c531ff92642eeb87842b8488516" - integrity sha512-x4fmJL5hGqNJKGHSjnLdgA6U6h1YW/G2dW9fA+cyVur4SK6lyue8+UgNKWlZtUDTXvgKDD/Oa3GQjmB5kjtVvg== - -eslint-import-resolver-node@^0.3.4: - version "0.3.4" - resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.4.tgz#85ffa81942c25012d8231096ddf679c03042c717" - integrity sha512-ogtf+5AB/O+nM6DIeBUNr2fuT7ot9Qg/1harBfBtaP13ekEWFQEEMP94BCB7zaNW3gyY+8SHYF00rnqYwXKWOA== - dependencies: - debug "^2.6.9" - resolve "^1.13.1" - -eslint-module-utils@^2.6.1: - version "2.6.1" - resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.6.1.tgz#b51be1e473dd0de1c5ea638e22429c2490ea8233" - integrity sha512-ZXI9B8cxAJIH4nfkhTwcRTEAnrVfobYqwjWy/QMCZ8rHkZHFjf9yO4BzpiF9kCSfNlMG54eKigISHpX0+AaT4A== - dependencies: - debug "^3.2.7" - pkg-dir "^2.0.0" - -eslint-plugin-es@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-es/-/eslint-plugin-es-3.0.1.tgz#75a7cdfdccddc0589934aeeb384175f221c57893" - integrity sha512-GUmAsJaN4Fc7Gbtl8uOBlayo2DqhwWvEzykMHSCZHU3XdJ+NSzzZcVhXh3VxX5icqQ+oQdIEawXX8xkR3mIFmQ== - dependencies: - eslint-utils "^2.0.0" - regexpp "^3.0.0" - -eslint-plugin-import@^2.22.0: - version "2.23.3" - resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.23.3.tgz#8a1b073289fff03c4af0f04b6df956b7d463e191" - integrity sha512-wDxdYbSB55F7T5CC7ucDjY641VvKmlRwT0Vxh7PkY1mI4rclVRFWYfsrjDgZvwYYDZ5ee0ZtfFKXowWjqvEoRQ== - dependencies: - array-includes "^3.1.3" - array.prototype.flat "^1.2.4" - debug "^2.6.9" - doctrine "^2.1.0" - eslint-import-resolver-node "^0.3.4" - eslint-module-utils "^2.6.1" - find-up "^2.0.0" - has "^1.0.3" - is-core-module "^2.4.0" - minimatch "^3.0.4" - object.values "^1.1.3" - pkg-up "^2.0.0" - read-pkg-up "^3.0.0" - resolve "^1.20.0" - tsconfig-paths "^3.9.0" - -eslint-plugin-mocha-no-only@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-mocha-no-only/-/eslint-plugin-mocha-no-only-1.1.1.tgz#2da56949776e8c5455cfeb67f2747d2d8cf522fc" - integrity sha512-b+vgjJQ3SjRQCygBhomtjzvRQRpIP8Yd9cqwNSbcoVJREuNajao7M1Kl1aObAUc4wx98qsZyQyUSUxiAbMS9yA== - dependencies: - requireindex "~1.1.0" - -eslint-plugin-no-only-tests@^2.4.0: - version "2.6.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-no-only-tests/-/eslint-plugin-no-only-tests-2.6.0.tgz#19f6c9620bda02b9b9221b436c5f070e42628d76" - integrity sha512-T9SmE/g6UV1uZo1oHAqOvL86XWl7Pl2EpRpnLI8g/bkJu+h7XBCB+1LnubRZ2CUQXj805vh4/CYZdnqtVaEo2Q== - -eslint-plugin-node@^11.1.0: - version "11.1.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-node/-/eslint-plugin-node-11.1.0.tgz#c95544416ee4ada26740a30474eefc5402dc671d" - integrity sha512-oUwtPJ1W0SKD0Tr+wqu92c5xuCeQqB3hSCHasn/ZgjFdA9iDGNkNf2Zi9ztY7X+hNuMib23LNGRm6+uN+KLE3g== - dependencies: - eslint-plugin-es "^3.0.0" - eslint-utils "^2.0.0" - ignore "^5.1.1" - minimatch "^3.0.4" - resolve "^1.10.1" - semver "^6.1.0" - -eslint-plugin-prettier@^3.4.0: - version "3.4.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.4.0.tgz#cdbad3bf1dbd2b177e9825737fe63b476a08f0c7" - integrity sha512-UDK6rJT6INSfcOo545jiaOwB701uAIt2/dR7WnFQoGCVl1/EMqdANBmwUaqqQ45aXprsTGzSa39LI1PyuRBxxw== - dependencies: - prettier-linter-helpers "^1.0.0" - -eslint-plugin-promise@^5.0.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-promise/-/eslint-plugin-promise-5.1.0.tgz#fb2188fb734e4557993733b41aa1a688f46c6f24" - integrity sha512-NGmI6BH5L12pl7ScQHbg7tvtk4wPxxj8yPHH47NvSmMtFneC077PSeY3huFj06ZWZvtbfxSPt3RuOQD5XcR4ng== - -eslint-plugin-standard@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-standard/-/eslint-plugin-standard-4.1.0.tgz#0c3bf3a67e853f8bbbc580fb4945fbf16f41b7c5" - integrity sha512-ZL7+QRixjTR6/528YNGyDotyffm5OQst/sGxKDwGb9Uqs4In5Egi4+jbobhqJoyoCM6/7v/1A5fhQ7ScMtDjaQ== - -eslint-scope@^5.0.0, eslint-scope@^5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c" - integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw== - dependencies: - esrecurse "^4.3.0" - estraverse "^4.1.1" - -eslint-utils@^2.0.0, eslint-utils@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-2.1.0.tgz#d2de5e03424e707dc10c74068ddedae708741b27" - integrity sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg== - dependencies: - eslint-visitor-keys "^1.1.0" - -eslint-visitor-keys@^1.1.0, eslint-visitor-keys@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz#30ebd1ef7c2fdff01c3a4f151044af25fab0523e" - integrity sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ== - -eslint-visitor-keys@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303" - integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== - -eslint@^7.24.0: - version "7.27.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.27.0.tgz#665a1506d8f95655c9274d84bd78f7166b07e9c7" - integrity sha512-JZuR6La2ZF0UD384lcbnd0Cgg6QJjiCwhMD6eU4h/VGPcVGwawNNzKU41tgokGXnfjOOyI6QIffthhJTPzzuRA== - dependencies: - "@babel/code-frame" "7.12.11" - "@eslint/eslintrc" "^0.4.1" - ajv "^6.10.0" - chalk "^4.0.0" - cross-spawn "^7.0.2" - debug "^4.0.1" - doctrine "^3.0.0" - enquirer "^2.3.5" - escape-string-regexp "^4.0.0" - eslint-scope "^5.1.1" - eslint-utils "^2.1.0" - eslint-visitor-keys "^2.0.0" - espree "^7.3.1" - esquery "^1.4.0" - esutils "^2.0.2" - fast-deep-equal "^3.1.3" - file-entry-cache "^6.0.1" - functional-red-black-tree "^1.0.1" - glob-parent "^5.0.0" - globals "^13.6.0" - ignore "^4.0.6" - import-fresh "^3.0.0" - imurmurhash "^0.1.4" - is-glob "^4.0.0" - js-yaml "^3.13.1" - json-stable-stringify-without-jsonify "^1.0.1" - levn "^0.4.1" - lodash.merge "^4.6.2" - minimatch "^3.0.4" - natural-compare "^1.4.0" - optionator "^0.9.1" - progress "^2.0.0" - regexpp "^3.1.0" - semver "^7.2.1" - strip-ansi "^6.0.0" - strip-json-comments "^3.1.0" - table "^6.0.9" - text-table "^0.2.0" - v8-compile-cache "^2.0.3" - -espree@^7.3.0, espree@^7.3.1: - version "7.3.1" - resolved "https://registry.yarnpkg.com/espree/-/espree-7.3.1.tgz#f2df330b752c6f55019f8bd89b7660039c1bbbb6" - integrity sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g== - dependencies: - acorn "^7.4.0" - acorn-jsx "^5.3.1" - eslint-visitor-keys "^1.3.0" - -esprima@2.7.x, esprima@^2.7.1: - version "2.7.3" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-2.7.3.tgz#96e3b70d5779f6ad49cd032673d1c312767ba581" - integrity sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE= - -esprima@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" - integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== - -esquery@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.4.0.tgz#2148ffc38b82e8c7057dfed48425b3e61f0f24a5" - integrity sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w== - dependencies: - estraverse "^5.1.0" - -esrecurse@^4.3.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.3.0.tgz#7ad7964d679abb28bee72cec63758b1c5d2c9921" - integrity sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag== - dependencies: - estraverse "^5.2.0" - -estraverse@^1.9.1: - version "1.9.3" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-1.9.3.tgz#af67f2dc922582415950926091a4005d29c9bb44" - integrity sha1-r2fy3JIlgkFZUJJgkaQAXSnJu0Q= - -estraverse@^4.1.1: - version "4.3.0" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" - integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== - -estraverse@^5.1.0, estraverse@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.2.0.tgz#307df42547e6cc7324d3cf03c155d5cdb8c53880" - integrity sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ== - -esutils@^2.0.2: - version "2.0.3" - resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" - integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== - -etag@~1.8.1: - version "1.8.1" - resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" - integrity sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc= - -eth-block-tracker@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/eth-block-tracker/-/eth-block-tracker-3.0.1.tgz#95cd5e763c7293e0b1b2790a2a39ac2ac188a5e1" - integrity sha512-WUVxWLuhMmsfenfZvFO5sbl1qFY2IqUlw/FPVmjjdElpqLsZtSG+wPe9Dz7W/sB6e80HgFKknOmKk2eNlznHug== - dependencies: - eth-query "^2.1.0" - ethereumjs-tx "^1.3.3" - ethereumjs-util "^5.1.3" - ethjs-util "^0.1.3" - json-rpc-engine "^3.6.0" - pify "^2.3.0" - tape "^4.6.3" - -eth-ens-namehash@2.0.8, eth-ens-namehash@^2.0.8: - version "2.0.8" - resolved "https://registry.yarnpkg.com/eth-ens-namehash/-/eth-ens-namehash-2.0.8.tgz#229ac46eca86d52e0c991e7cb2aef83ff0f68bcf" - integrity sha1-IprEbsqG1S4MmR58sq74P/D2i88= - dependencies: - idna-uts46-hx "^2.3.1" - js-sha3 "^0.5.7" - -eth-gas-reporter@^0.2.20: - version "0.2.22" - resolved "https://registry.yarnpkg.com/eth-gas-reporter/-/eth-gas-reporter-0.2.22.tgz#bbe91f5d7b22433d26f099eeb5b20118ced0e575" - integrity sha512-L1FlC792aTf3j/j+gGzSNlGrXKSxNPXQNk6TnV5NNZ2w3jnQCRyJjDl0zUo25Cq2t90IS5vGdbkwqFQK7Ce+kw== - dependencies: - "@ethersproject/abi" "^5.0.0-beta.146" - "@solidity-parser/parser" "^0.12.0" - cli-table3 "^0.5.0" - colors "^1.1.2" - ethereumjs-util "6.2.0" - ethers "^4.0.40" - fs-readdir-recursive "^1.1.0" - lodash "^4.17.14" - markdown-table "^1.1.3" - mocha "^7.1.1" - req-cwd "^2.0.0" - request "^2.88.0" - request-promise-native "^1.0.5" - sha1 "^1.1.1" - sync-request "^6.0.0" - -eth-json-rpc-infura@^3.1.0: - version "3.2.1" - resolved "https://registry.yarnpkg.com/eth-json-rpc-infura/-/eth-json-rpc-infura-3.2.1.tgz#26702a821067862b72d979c016fd611502c6057f" - integrity sha512-W7zR4DZvyTn23Bxc0EWsq4XGDdD63+XPUCEhV2zQvQGavDVC4ZpFDK4k99qN7bd7/fjj37+rxmuBOBeIqCA5Mw== - dependencies: - cross-fetch "^2.1.1" - eth-json-rpc-middleware "^1.5.0" - json-rpc-engine "^3.4.0" - json-rpc-error "^2.0.0" - -eth-json-rpc-middleware@^1.5.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/eth-json-rpc-middleware/-/eth-json-rpc-middleware-1.6.0.tgz#5c9d4c28f745ccb01630f0300ba945f4bef9593f" - integrity sha512-tDVCTlrUvdqHKqivYMjtFZsdD7TtpNLBCfKAcOpaVs7orBMS/A8HWro6dIzNtTZIR05FAbJ3bioFOnZpuCew9Q== - dependencies: - async "^2.5.0" - eth-query "^2.1.2" - eth-tx-summary "^3.1.2" - ethereumjs-block "^1.6.0" - ethereumjs-tx "^1.3.3" - ethereumjs-util "^5.1.2" - ethereumjs-vm "^2.1.0" - fetch-ponyfill "^4.0.0" - json-rpc-engine "^3.6.0" - json-rpc-error "^2.0.0" - json-stable-stringify "^1.0.1" - promise-to-callback "^1.0.0" - tape "^4.6.3" - -eth-lib@0.2.8: - version "0.2.8" - resolved "https://registry.yarnpkg.com/eth-lib/-/eth-lib-0.2.8.tgz#b194058bef4b220ad12ea497431d6cb6aa0623c8" - integrity sha512-ArJ7x1WcWOlSpzdoTBX8vkwlkSQ85CjjifSZtV4co64vWxSV8geWfPI9x4SVYu3DSxnX4yWFVTtGL+j9DUFLNw== - dependencies: - bn.js "^4.11.6" - elliptic "^6.4.0" - xhr-request-promise "^0.1.2" - -eth-lib@^0.1.26: - version "0.1.29" - resolved "https://registry.yarnpkg.com/eth-lib/-/eth-lib-0.1.29.tgz#0c11f5060d42da9f931eab6199084734f4dbd1d9" - integrity sha512-bfttrr3/7gG4E02HoWTDUcDDslN003OlOoBxk9virpAZQ1ja/jDgwkWB8QfJF7ojuEowrqy+lzp9VcJG7/k5bQ== - dependencies: - bn.js "^4.11.6" - elliptic "^6.4.0" - nano-json-stream-parser "^0.1.2" - servify "^0.1.12" - ws "^3.0.0" - xhr-request-promise "^0.1.2" - -eth-query@^2.0.2, eth-query@^2.1.0, eth-query@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/eth-query/-/eth-query-2.1.2.tgz#d6741d9000106b51510c72db92d6365456a6da5e" - integrity sha1-1nQdkAAQa1FRDHLbktY2VFam2l4= - dependencies: - json-rpc-random-id "^1.0.0" - xtend "^4.0.1" - -eth-sig-util@3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/eth-sig-util/-/eth-sig-util-3.0.0.tgz#75133b3d7c20a5731af0690c385e184ab942b97e" - integrity sha512-4eFkMOhpGbTxBQ3AMzVf0haUX2uTur7DpWiHzWyTURa28BVJJtOkcb9Ok5TV0YvEPG61DODPW7ZUATbJTslioQ== - dependencies: - buffer "^5.2.1" - elliptic "^6.4.0" - ethereumjs-abi "0.6.5" - ethereumjs-util "^5.1.1" - tweetnacl "^1.0.0" - tweetnacl-util "^0.15.0" - -eth-sig-util@^1.4.2: - version "1.4.2" - resolved "https://registry.yarnpkg.com/eth-sig-util/-/eth-sig-util-1.4.2.tgz#8d958202c7edbaae839707fba6f09ff327606210" - integrity sha1-jZWCAsftuq6Dlwf7pvCf8ydgYhA= - dependencies: - ethereumjs-abi "git+https://github.com/ethereumjs/ethereumjs-abi.git" - ethereumjs-util "^5.1.1" - -eth-sig-util@^2.5.2: - version "2.5.4" - resolved "https://registry.yarnpkg.com/eth-sig-util/-/eth-sig-util-2.5.4.tgz#577b01fe491b6bf59b0464be09633e20c1677bc5" - integrity sha512-aCMBwp8q/4wrW4QLsF/HYBOSA7TpLKmkVwP3pYQNkEEseW2Rr8Z5Uxc9/h6HX+OG3tuHo+2bINVSihIeBfym6A== - dependencies: - ethereumjs-abi "0.6.8" - ethereumjs-util "^5.1.1" - tweetnacl "^1.0.3" - tweetnacl-util "^0.15.0" - -eth-tx-summary@^3.1.2: - version "3.2.4" - resolved "https://registry.yarnpkg.com/eth-tx-summary/-/eth-tx-summary-3.2.4.tgz#e10eb95eb57cdfe549bf29f97f1e4f1db679035c" - integrity sha512-NtlDnaVZah146Rm8HMRUNMgIwG/ED4jiqk0TME9zFheMl1jOp6jL1m0NKGjJwehXQ6ZKCPr16MTr+qspKpEXNg== - dependencies: - async "^2.1.2" - clone "^2.0.0" - concat-stream "^1.5.1" - end-of-stream "^1.1.0" - eth-query "^2.0.2" - ethereumjs-block "^1.4.1" - ethereumjs-tx "^1.1.1" - ethereumjs-util "^5.0.1" - ethereumjs-vm "^2.6.0" - through2 "^2.0.3" - -ethashjs@~0.0.7: - version "0.0.8" - resolved "https://registry.yarnpkg.com/ethashjs/-/ethashjs-0.0.8.tgz#227442f1bdee409a548fb04136e24c874f3aa6f9" - integrity sha512-/MSbf/r2/Ld8o0l15AymjOTlPqpN8Cr4ByUEA9GtR4x0yAh3TdtDzEg29zMjXCNPI7u6E5fOQdj/Cf9Tc7oVNw== - dependencies: - async "^2.1.2" - buffer-xor "^2.0.1" - ethereumjs-util "^7.0.2" - miller-rabin "^4.0.0" - -ethereum-bloom-filters@^1.0.6: - version "1.0.9" - resolved "https://registry.yarnpkg.com/ethereum-bloom-filters/-/ethereum-bloom-filters-1.0.9.tgz#4a59dead803af0c9e33834170bd7695df67061ec" - integrity sha512-GiK/RQkAkcVaEdxKVkPcG07PQ5vD7v2MFSHgZmBJSfMzNRHimntdBithsHAT89tAXnIpzVDWt8iaCD1DvkaxGg== - dependencies: - js-sha3 "^0.8.0" - -ethereum-common@0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/ethereum-common/-/ethereum-common-0.2.0.tgz#13bf966131cce1eeade62a1b434249bb4cb120ca" - integrity sha512-XOnAR/3rntJgbCdGhqdaLIxDLWKLmsZOGhHdBKadEr6gEnJLH52k93Ou+TUdFaPN3hJc3isBZBal3U/XZ15abA== - -ethereum-common@^0.0.18: - version "0.0.18" - resolved "https://registry.yarnpkg.com/ethereum-common/-/ethereum-common-0.0.18.tgz#2fdc3576f232903358976eb39da783213ff9523f" - integrity sha1-L9w1dvIykDNYl26znaeDIT/5Uj8= - -ethereum-cryptography@^0.1.2, ethereum-cryptography@^0.1.3: - version "0.1.3" - resolved "https://registry.yarnpkg.com/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz#8d6143cfc3d74bf79bbd8edecdf29e4ae20dd191" - integrity sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ== - dependencies: - "@types/pbkdf2" "^3.0.0" - "@types/secp256k1" "^4.0.1" - blakejs "^1.1.0" - browserify-aes "^1.2.0" - bs58check "^2.1.2" - create-hash "^1.2.0" - create-hmac "^1.1.7" - hash.js "^1.1.7" - keccak "^3.0.0" - pbkdf2 "^3.0.17" - randombytes "^2.1.0" - safe-buffer "^5.1.2" - scrypt-js "^3.0.0" - secp256k1 "^4.0.1" - setimmediate "^1.0.5" - -ethereum-waffle@^3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/ethereum-waffle/-/ethereum-waffle-3.3.0.tgz#166a0cc1d3b2925f117b20ef0951b3fe72e38e79" - integrity sha512-4xm3RWAPCu5LlaVxYEg0tG3L7g5ovBw1GY/UebrzZ+OTx22vcPjI+bvelFlGBpkdnO5yOIFXjH2eK59tNAe9IA== - dependencies: - "@ethereum-waffle/chai" "^3.3.0" - "@ethereum-waffle/compiler" "^3.3.0" - "@ethereum-waffle/mock-contract" "^3.2.2" - "@ethereum-waffle/provider" "^3.3.0" - ethers "^5.0.1" - -ethereumjs-abi@0.6.5: - version "0.6.5" - resolved "https://registry.yarnpkg.com/ethereumjs-abi/-/ethereumjs-abi-0.6.5.tgz#5a637ef16ab43473fa72a29ad90871405b3f5241" - integrity sha1-WmN+8Wq0NHP6cqKa2QhxQFs/UkE= - dependencies: - bn.js "^4.10.0" - ethereumjs-util "^4.3.0" - -ethereumjs-abi@0.6.8, ethereumjs-abi@^0.6.8: - version "0.6.8" - resolved "https://registry.yarnpkg.com/ethereumjs-abi/-/ethereumjs-abi-0.6.8.tgz#71bc152db099f70e62f108b7cdfca1b362c6fcae" - integrity sha512-Tx0r/iXI6r+lRsdvkFDlut0N08jWMnKRZ6Gkq+Nmw75lZe4e6o3EkSnkaBP5NF6+m5PTGAr9JP43N3LyeoglsA== - dependencies: - bn.js "^4.11.8" - ethereumjs-util "^6.0.0" - -"ethereumjs-abi@git+https://github.com/ethereumjs/ethereumjs-abi.git": - version "0.6.8" - resolved "git+https://github.com/ethereumjs/ethereumjs-abi.git#ee3994657fa7a427238e6ba92a84d0b529bbcde0" - dependencies: - bn.js "^4.11.8" - ethereumjs-util "^6.0.0" - -ethereumjs-account@3.0.0, ethereumjs-account@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/ethereumjs-account/-/ethereumjs-account-3.0.0.tgz#728f060c8e0c6e87f1e987f751d3da25422570a9" - integrity sha512-WP6BdscjiiPkQfF9PVfMcwx/rDvfZTjFKY0Uwc09zSQr9JfIVH87dYIJu0gNhBhpmovV4yq295fdllS925fnBA== - dependencies: - ethereumjs-util "^6.0.0" - rlp "^2.2.1" - safe-buffer "^5.1.1" - -ethereumjs-account@^2.0.3: - version "2.0.5" - resolved "https://registry.yarnpkg.com/ethereumjs-account/-/ethereumjs-account-2.0.5.tgz#eeafc62de544cb07b0ee44b10f572c9c49e00a84" - integrity sha512-bgDojnXGjhMwo6eXQC0bY6UK2liSFUSMwwylOmQvZbSl/D7NXQ3+vrGO46ZeOgjGfxXmgIeVNDIiHw7fNZM4VA== - dependencies: - ethereumjs-util "^5.0.0" - rlp "^2.0.0" - safe-buffer "^5.1.1" - -ethereumjs-block@2.2.2, ethereumjs-block@^2.2.2, ethereumjs-block@~2.2.0, ethereumjs-block@~2.2.2: - version "2.2.2" - resolved "https://registry.yarnpkg.com/ethereumjs-block/-/ethereumjs-block-2.2.2.tgz#c7654be7e22df489fda206139ecd63e2e9c04965" - integrity sha512-2p49ifhek3h2zeg/+da6XpdFR3GlqY3BIEiqxGF8j9aSRIgkb7M1Ky+yULBKJOu8PAZxfhsYA+HxUk2aCQp3vg== - dependencies: - async "^2.0.1" - ethereumjs-common "^1.5.0" - ethereumjs-tx "^2.1.1" - ethereumjs-util "^5.0.0" - merkle-patricia-tree "^2.1.2" - -ethereumjs-block@^1.2.2, ethereumjs-block@^1.4.1, ethereumjs-block@^1.6.0: - version "1.7.1" - resolved "https://registry.yarnpkg.com/ethereumjs-block/-/ethereumjs-block-1.7.1.tgz#78b88e6cc56de29a6b4884ee75379b6860333c3f" - integrity sha512-B+sSdtqm78fmKkBq78/QLKJbu/4Ts4P2KFISdgcuZUPDm9x+N7qgBPIIFUGbaakQh8bzuquiRVbdmvPKqbILRg== - dependencies: - async "^2.0.1" - ethereum-common "0.2.0" - ethereumjs-tx "^1.2.2" - ethereumjs-util "^5.0.0" - merkle-patricia-tree "^2.1.2" - -ethereumjs-blockchain@^4.0.3: - version "4.0.4" - resolved "https://registry.yarnpkg.com/ethereumjs-blockchain/-/ethereumjs-blockchain-4.0.4.tgz#30f2228dc35f6dcf94423692a6902604ae34960f" - integrity sha512-zCxaRMUOzzjvX78DTGiKjA+4h2/sF0OYL1QuPux0DHpyq8XiNoF5GYHtb++GUxVlMsMfZV7AVyzbtgcRdIcEPQ== - dependencies: - async "^2.6.1" - ethashjs "~0.0.7" - ethereumjs-block "~2.2.2" - ethereumjs-common "^1.5.0" - ethereumjs-util "^6.1.0" - flow-stoplight "^1.0.0" - level-mem "^3.0.1" - lru-cache "^5.1.1" - rlp "^2.2.2" - semaphore "^1.1.0" - -ethereumjs-common@1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/ethereumjs-common/-/ethereumjs-common-1.5.0.tgz#d3e82fc7c47c0cef95047f431a99485abc9bb1cd" - integrity sha512-SZOjgK1356hIY7MRj3/ma5qtfr/4B5BL+G4rP/XSMYr2z1H5el4RX5GReYCKmQmYI/nSBmRnwrZ17IfHuG0viQ== - -ethereumjs-common@^1.1.0, ethereumjs-common@^1.3.2, ethereumjs-common@^1.5.0: - version "1.5.2" - resolved "https://registry.yarnpkg.com/ethereumjs-common/-/ethereumjs-common-1.5.2.tgz#2065dbe9214e850f2e955a80e650cb6999066979" - integrity sha512-hTfZjwGX52GS2jcVO6E2sx4YuFnf0Fhp5ylo4pEPhEffNln7vS59Hr5sLnp3/QCazFLluuBZ+FZ6J5HTp0EqCA== - -ethereumjs-tx@2.1.2, ethereumjs-tx@^2.1.1, ethereumjs-tx@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/ethereumjs-tx/-/ethereumjs-tx-2.1.2.tgz#5dfe7688bf177b45c9a23f86cf9104d47ea35fed" - integrity sha512-zZEK1onCeiORb0wyCXUvg94Ve5It/K6GD1K+26KfFKodiBiS6d9lfCXlUKGBBdQ+bv7Day+JK0tj1K+BeNFRAw== - dependencies: - ethereumjs-common "^1.5.0" - ethereumjs-util "^6.0.0" - -ethereumjs-tx@^1.1.1, ethereumjs-tx@^1.2.0, ethereumjs-tx@^1.2.2, ethereumjs-tx@^1.3.3: - version "1.3.7" - resolved "https://registry.yarnpkg.com/ethereumjs-tx/-/ethereumjs-tx-1.3.7.tgz#88323a2d875b10549b8347e09f4862b546f3d89a" - integrity sha512-wvLMxzt1RPhAQ9Yi3/HKZTn0FZYpnsmQdbKYfUUpi4j1SEIcbkd9tndVjcPrufY3V7j2IebOpC00Zp2P/Ay2kA== - dependencies: - ethereum-common "^0.0.18" - ethereumjs-util "^5.0.0" - -ethereumjs-util@6.2.0: - version "6.2.0" - resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-6.2.0.tgz#23ec79b2488a7d041242f01e25f24e5ad0357960" - integrity sha512-vb0XN9J2QGdZGIEKG2vXM+kUdEivUfU6Wmi5y0cg+LRhDYKnXIZ/Lz7XjFbHRR9VIKq2lVGLzGBkA++y2nOdOQ== - dependencies: - "@types/bn.js" "^4.11.3" - bn.js "^4.11.0" - create-hash "^1.1.2" - ethjs-util "0.1.6" - keccak "^2.0.0" - rlp "^2.2.3" - secp256k1 "^3.0.1" - -ethereumjs-util@6.2.1, ethereumjs-util@^6.0.0, ethereumjs-util@^6.1.0, ethereumjs-util@^6.2.0: - version "6.2.1" - resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz#fcb4e4dd5ceacb9d2305426ab1a5cd93e3163b69" - integrity sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw== - dependencies: - "@types/bn.js" "^4.11.3" - bn.js "^4.11.0" - create-hash "^1.1.2" - elliptic "^6.5.2" - ethereum-cryptography "^0.1.3" - ethjs-util "0.1.6" - rlp "^2.2.3" - -ethereumjs-util@^4.3.0: - version "4.5.1" - resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-4.5.1.tgz#f4bf9b3b515a484e3cc8781d61d9d980f7c83bd0" - integrity sha512-WrckOZ7uBnei4+AKimpuF1B3Fv25OmoRgmYCpGsP7u8PFxXAmAgiJSYT2kRWnt6fVIlKaQlZvuwXp7PIrmn3/w== - dependencies: - bn.js "^4.8.0" - create-hash "^1.1.2" - elliptic "^6.5.2" - ethereum-cryptography "^0.1.3" - rlp "^2.0.0" - -ethereumjs-util@^5.0.0, ethereumjs-util@^5.0.1, ethereumjs-util@^5.1.1, ethereumjs-util@^5.1.2, ethereumjs-util@^5.1.3, ethereumjs-util@^5.1.5, ethereumjs-util@^5.2.0: - version "5.2.1" - resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-5.2.1.tgz#a833f0e5fca7e5b361384dc76301a721f537bf65" - integrity sha512-v3kT+7zdyCm1HIqWlLNrHGqHGLpGYIhjeHxQjnDXjLT2FyGJDsd3LWMYUo7pAFRrk86CR3nUJfhC81CCoJNNGQ== - dependencies: - bn.js "^4.11.0" - create-hash "^1.1.2" - elliptic "^6.5.2" - ethereum-cryptography "^0.1.3" - ethjs-util "^0.1.3" - rlp "^2.0.0" - safe-buffer "^5.1.1" - -ethereumjs-util@^7.0.10, ethereumjs-util@^7.0.2, ethereumjs-util@^7.0.3, ethereumjs-util@^7.0.7: - version "7.0.10" - resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-7.0.10.tgz#5fb7b69fa1fda0acc59634cf39d6b0291180fc1f" - integrity sha512-c/xThw6A+EAnej5Xk5kOzFzyoSnw0WX0tSlZ6pAsfGVvQj3TItaDg9b1+Fz1RJXA+y2YksKwQnuzgt1eY6LKzw== - dependencies: - "@types/bn.js" "^5.1.0" - bn.js "^5.1.2" - create-hash "^1.1.2" - ethereum-cryptography "^0.1.3" - ethjs-util "0.1.6" - rlp "^2.2.4" - -ethereumjs-vm@4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/ethereumjs-vm/-/ethereumjs-vm-4.2.0.tgz#e885e861424e373dbc556278f7259ff3fca5edab" - integrity sha512-X6qqZbsY33p5FTuZqCnQ4+lo957iUJMM6Mpa6bL4UW0dxM6WmDSHuI4j/zOp1E2TDKImBGCJA9QPfc08PaNubA== - dependencies: - async "^2.1.2" - async-eventemitter "^0.2.2" - core-js-pure "^3.0.1" - ethereumjs-account "^3.0.0" - ethereumjs-block "^2.2.2" - ethereumjs-blockchain "^4.0.3" - ethereumjs-common "^1.5.0" - ethereumjs-tx "^2.1.2" - ethereumjs-util "^6.2.0" - fake-merkle-patricia-tree "^1.0.1" - functional-red-black-tree "^1.0.1" - merkle-patricia-tree "^2.3.2" - rustbn.js "~0.2.0" - safe-buffer "^5.1.1" - util.promisify "^1.0.0" - -ethereumjs-vm@^2.1.0, ethereumjs-vm@^2.3.4, ethereumjs-vm@^2.6.0: - version "2.6.0" - resolved "https://registry.yarnpkg.com/ethereumjs-vm/-/ethereumjs-vm-2.6.0.tgz#76243ed8de031b408793ac33907fb3407fe400c6" - integrity sha512-r/XIUik/ynGbxS3y+mvGnbOKnuLo40V5Mj1J25+HEO63aWYREIqvWeRO/hnROlMBE5WoniQmPmhiaN0ctiHaXw== - dependencies: - async "^2.1.2" - async-eventemitter "^0.2.2" - ethereumjs-account "^2.0.3" - ethereumjs-block "~2.2.0" - ethereumjs-common "^1.1.0" - ethereumjs-util "^6.0.0" - fake-merkle-patricia-tree "^1.0.1" - functional-red-black-tree "^1.0.1" - merkle-patricia-tree "^2.3.2" - rustbn.js "~0.2.0" - safe-buffer "^5.1.1" - -ethereumjs-wallet@0.6.5: - version "0.6.5" - resolved "https://registry.yarnpkg.com/ethereumjs-wallet/-/ethereumjs-wallet-0.6.5.tgz#685e9091645cee230ad125c007658833991ed474" - integrity sha512-MDwjwB9VQVnpp/Dc1XzA6J1a3wgHQ4hSvA1uWNatdpOrtCbPVuQSKSyRnjLvS0a+KKMw2pvQ9Ybqpb3+eW8oNA== - dependencies: - aes-js "^3.1.1" - bs58check "^2.1.2" - ethereum-cryptography "^0.1.3" - ethereumjs-util "^6.0.0" - randombytes "^2.0.6" - safe-buffer "^5.1.2" - scryptsy "^1.2.1" - utf8 "^3.0.0" - uuid "^3.3.2" - -ethers@^4.0.32, ethers@^4.0.40: - version "4.0.48" - resolved "https://registry.yarnpkg.com/ethers/-/ethers-4.0.48.tgz#330c65b8133e112b0613156e57e92d9009d8fbbe" - integrity sha512-sZD5K8H28dOrcidzx9f8KYh8083n5BexIO3+SbE4jK83L85FxtpXZBCQdXb8gkg+7sBqomcLhhkU7UHL+F7I2g== - dependencies: - aes-js "3.0.0" - bn.js "^4.4.0" - elliptic "6.5.3" - hash.js "1.1.3" - js-sha3 "0.5.7" - scrypt-js "2.0.4" - setimmediate "1.0.4" - uuid "2.0.1" - xmlhttprequest "1.8.0" - -ethers@^5.0.0, ethers@^5.0.1, ethers@^5.0.2, ethers@^5.1.3, ethers@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.2.0.tgz#13452e35947ab5d77053286d1f7161ee666c85ba" - integrity sha512-HqFGU2Qab0mAg3y1eHKVMXS4i1gTObMY0/4+x4LiO72NHhJL3Z795gnqyivmwG1J8e5NLSlRSfyIR7TL0Hw3ig== - dependencies: - "@ethersproject/abi" "5.2.0" - "@ethersproject/abstract-provider" "5.2.0" - "@ethersproject/abstract-signer" "5.2.0" - "@ethersproject/address" "5.2.0" - "@ethersproject/base64" "5.2.0" - "@ethersproject/basex" "5.2.0" - "@ethersproject/bignumber" "5.2.0" - "@ethersproject/bytes" "5.2.0" - "@ethersproject/constants" "5.2.0" - "@ethersproject/contracts" "5.2.0" - "@ethersproject/hash" "5.2.0" - "@ethersproject/hdnode" "5.2.0" - "@ethersproject/json-wallets" "5.2.0" - "@ethersproject/keccak256" "5.2.0" - "@ethersproject/logger" "5.2.0" - "@ethersproject/networks" "5.2.0" - "@ethersproject/pbkdf2" "5.2.0" - "@ethersproject/properties" "5.2.0" - "@ethersproject/providers" "5.2.0" - "@ethersproject/random" "5.2.0" - "@ethersproject/rlp" "5.2.0" - "@ethersproject/sha2" "5.2.0" - "@ethersproject/signing-key" "5.2.0" - "@ethersproject/solidity" "5.2.0" - "@ethersproject/strings" "5.2.0" - "@ethersproject/transactions" "5.2.0" - "@ethersproject/units" "5.2.0" - "@ethersproject/wallet" "5.2.0" - "@ethersproject/web" "5.2.0" - "@ethersproject/wordlists" "5.2.0" - -ethjs-unit@0.1.6: - version "0.1.6" - resolved "https://registry.yarnpkg.com/ethjs-unit/-/ethjs-unit-0.1.6.tgz#c665921e476e87bce2a9d588a6fe0405b2c41699" - integrity sha1-xmWSHkduh7ziqdWIpv4EBbLEFpk= - dependencies: - bn.js "4.11.6" - number-to-bn "1.7.0" - -ethjs-util@0.1.6, ethjs-util@^0.1.3: - version "0.1.6" - resolved "https://registry.yarnpkg.com/ethjs-util/-/ethjs-util-0.1.6.tgz#f308b62f185f9fe6237132fb2a9818866a5cd536" - integrity sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w== - dependencies: - is-hex-prefixed "1.0.0" - strip-hex-prefix "1.0.0" - -ethlint@^1.2.5: - version "1.2.5" - resolved "https://registry.yarnpkg.com/ethlint/-/ethlint-1.2.5.tgz#375b77d1e5971e7c574037e07ff7ddad8e17858f" - integrity sha512-x2nKK98zmd72SFWL3Ul1S6scWYf5QqG221N6/mFNMO661g7ASvTRINGIWVvHzsvflW6y4tvgMSjnTN5RCTuZug== - dependencies: - ajv "^5.2.2" - chokidar "^1.6.0" - colors "^1.1.2" - commander "^2.9.0" - diff "^3.5.0" - eol "^0.9.1" - js-string-escape "^1.0.1" - lodash "^4.14.2" - sol-digger "0.0.2" - sol-explore "1.6.1" - solium-plugin-security "0.1.1" - solparse "2.2.8" - text-table "^0.2.0" - -event-target-shim@^5.0.0: - version "5.0.1" - resolved "https://registry.yarnpkg.com/event-target-shim/-/event-target-shim-5.0.1.tgz#5d4d3ebdf9583d63a5333ce2deb7480ab2b05789" - integrity sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ== - -eventemitter3@4.0.4: - version "4.0.4" - resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.4.tgz#b5463ace635a083d018bdc7c917b4c5f10a85384" - integrity sha512-rlaVLnVxtxvoyLsQQFBx53YmXHDxRIzzTLbdfxqi4yocpSjAxXwkU0cScM5JgSKMqEhrZpnvQ2D9gjylR0AimQ== - -eventemitter3@^4.0.4: - version "4.0.7" - resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f" - integrity sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw== - -events@^3.0.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/events/-/events-3.3.0.tgz#31a95ad0a924e2d2c419a813aeb2c4e878ea7400" - integrity sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q== - -evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz#7fcbdb198dc71959432efe13842684e0525acb02" - integrity sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA== - dependencies: - md5.js "^1.3.4" - safe-buffer "^5.1.1" - -execa@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/execa/-/execa-0.7.0.tgz#944becd34cc41ee32a63a9faf27ad5a65fc59777" - integrity sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c= - dependencies: - cross-spawn "^5.0.1" - get-stream "^3.0.0" - is-stream "^1.1.0" - npm-run-path "^2.0.0" - p-finally "^1.0.0" - signal-exit "^3.0.0" - strip-eof "^1.0.0" - -execa@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/execa/-/execa-1.0.0.tgz#c6236a5bb4df6d6f15e88e7f017798216749ddd8" - integrity sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA== - dependencies: - cross-spawn "^6.0.0" - get-stream "^4.0.0" - is-stream "^1.1.0" - npm-run-path "^2.0.0" - p-finally "^1.0.0" - signal-exit "^3.0.0" - strip-eof "^1.0.0" - -execa@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/execa/-/execa-4.1.0.tgz#4e5491ad1572f2f17a77d388c6c857135b22847a" - integrity sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA== - dependencies: - cross-spawn "^7.0.0" - get-stream "^5.0.0" - human-signals "^1.1.1" - is-stream "^2.0.0" - merge-stream "^2.0.0" - npm-run-path "^4.0.0" - onetime "^5.1.0" - signal-exit "^3.0.2" - strip-final-newline "^2.0.0" - -exit-on-epipe@~1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/exit-on-epipe/-/exit-on-epipe-1.0.1.tgz#0bdd92e87d5285d267daa8171d0eb06159689692" - integrity sha512-h2z5mrROTxce56S+pnvAV890uu7ls7f1kEvVGJbw1OlFH3/mlJ5bkXu0KRyW94v37zzHPiUd55iLn3DA7TjWpw== - -expand-brackets@^0.1.4: - version "0.1.5" - resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b" - integrity sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s= - dependencies: - is-posix-bracket "^0.1.0" - -expand-brackets@^2.1.4: - version "2.1.4" - resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" - integrity sha1-t3c14xXOMPa27/D4OwQVGiJEliI= - dependencies: - debug "^2.3.3" - define-property "^0.2.5" - extend-shallow "^2.0.1" - posix-character-classes "^0.1.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - -expand-range@^1.8.1: - version "1.8.2" - resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-1.8.2.tgz#a299effd335fe2721ebae8e257ec79644fc85337" - integrity sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc= - dependencies: - fill-range "^2.1.0" - -express@4.17.1, express@^4.14.0: - version "4.17.1" - resolved "https://registry.yarnpkg.com/express/-/express-4.17.1.tgz#4491fc38605cf51f8629d39c2b5d026f98a4c134" - integrity sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g== - dependencies: - accepts "~1.3.7" - array-flatten "1.1.1" - body-parser "1.19.0" - content-disposition "0.5.3" - content-type "~1.0.4" - cookie "0.4.0" - cookie-signature "1.0.6" - debug "2.6.9" - depd "~1.1.2" - encodeurl "~1.0.2" - escape-html "~1.0.3" - etag "~1.8.1" - finalhandler "~1.1.2" - fresh "0.5.2" - merge-descriptors "1.0.1" - methods "~1.1.2" - on-finished "~2.3.0" - parseurl "~1.3.3" - path-to-regexp "0.1.7" - proxy-addr "~2.0.5" - qs "6.7.0" - range-parser "~1.2.1" - safe-buffer "5.1.2" - send "0.17.1" - serve-static "1.14.1" - setprototypeof "1.1.1" - statuses "~1.5.0" - type-is "~1.6.18" - utils-merge "1.0.1" - vary "~1.1.2" - -ext@^1.1.2: - version "1.4.0" - resolved "https://registry.yarnpkg.com/ext/-/ext-1.4.0.tgz#89ae7a07158f79d35517882904324077e4379244" - integrity sha512-Key5NIsUxdqKg3vIsdw9dSuXpPCQ297y6wBjL30edxwPgt2E44WcWBZey/ZvUc6sERLTxKdyCu4gZFmUbk1Q7A== - dependencies: - type "^2.0.0" - -extend-shallow@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" - integrity sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8= - dependencies: - is-extendable "^0.1.0" - -extend-shallow@^3.0.0, extend-shallow@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8" - integrity sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg= - dependencies: - assign-symbols "^1.0.0" - is-extendable "^1.0.1" - -extend@~3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" - integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== - -external-editor@^3.0.3: - version "3.1.0" - resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-3.1.0.tgz#cb03f740befae03ea4d283caed2741a83f335495" - integrity sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew== - dependencies: - chardet "^0.7.0" - iconv-lite "^0.4.24" - tmp "^0.0.33" - -extglob@^0.3.1: - version "0.3.2" - resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" - integrity sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE= - dependencies: - is-extglob "^1.0.0" - -extglob@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" - integrity sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw== - dependencies: - array-unique "^0.3.2" - define-property "^1.0.0" - expand-brackets "^2.1.4" - extend-shallow "^2.0.1" - fragment-cache "^0.2.1" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - -extsprintf@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" - integrity sha1-lpGEQOMEGnpBT4xS48V06zw+HgU= - -extsprintf@^1.2.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" - integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8= - -fake-merkle-patricia-tree@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/fake-merkle-patricia-tree/-/fake-merkle-patricia-tree-1.0.1.tgz#4b8c3acfb520afadf9860b1f14cd8ce3402cddd3" - integrity sha1-S4w6z7Ugr635hgsfFM2M40As3dM= - dependencies: - checkpoint-store "^1.1.0" - -fast-deep-equal@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz#c053477817c86b51daa853c81e059b733d023614" - integrity sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ= - -fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: - version "3.1.3" - resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" - integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== - -fast-diff@^1.1.2: - version "1.2.0" - resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03" - integrity sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w== - -fast-fifo@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fast-fifo/-/fast-fifo-1.0.0.tgz#9bc72e6860347bb045a876d1c5c0af11e9b984e7" - integrity sha512-4VEXmjxLj7sbs8J//cn2qhRap50dGzF5n8fjay8mau+Jn4hxSeR3xPFwxMaQq/pDaq7+KQk0PAbC2+nWDkJrmQ== - -fast-glob@^3.0.3, fast-glob@^3.1.1: - version "3.2.5" - resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.5.tgz#7939af2a656de79a4f1901903ee8adcaa7cb9661" - integrity sha512-2DtFcgT68wiTTiwZ2hNdJfcHNke9XOfnwmBRWXhmeKM8rF0TGwmC/Qto3S7RoZKp5cilZbxzO5iTNTQsJ+EeDg== - dependencies: - "@nodelib/fs.stat" "^2.0.2" - "@nodelib/fs.walk" "^1.2.3" - glob-parent "^5.1.0" - merge2 "^1.3.0" - micromatch "^4.0.2" - picomatch "^2.2.1" - -fast-json-stable-stringify@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" - integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== - -fast-levenshtein@^2.0.6, fast-levenshtein@~2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" - integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= - -fast-redact@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/fast-redact/-/fast-redact-3.0.1.tgz#d6015b971e933d03529b01333ba7f22c29961e92" - integrity sha512-kYpn4Y/valC9MdrISg47tZOpYBNoTXKgT9GYXFpHN/jYFs+lFkPoisY+LcBODdKVMY96ATzvzsWv+ES/4Kmufw== - -fast-safe-stringify@^2.0.4, fast-safe-stringify@^2.0.7: - version "2.0.7" - resolved "https://registry.yarnpkg.com/fast-safe-stringify/-/fast-safe-stringify-2.0.7.tgz#124aa885899261f68aedb42a7c080de9da608743" - integrity sha512-Utm6CdzT+6xsDk2m8S6uL8VHxNwI6Jub+e9NYTcAms28T84pTa25GJQV9j0CY0N1rM8hK4x6grpF2BQf+2qwVA== - -fastq@^1.6.0: - version "1.11.0" - resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.11.0.tgz#bb9fb955a07130a918eb63c1f5161cc32a5d0858" - integrity sha512-7Eczs8gIPDrVzT+EksYBcupqMyxSHXXrHOLRRxU2/DicV8789MRBRR8+Hc2uWzUupOs4YS4JzBmBxjjCVBxD/g== - dependencies: - reusify "^1.0.4" - -fecha@^4.2.0: - version "4.2.1" - resolved "https://registry.yarnpkg.com/fecha/-/fecha-4.2.1.tgz#0a83ad8f86ef62a091e22bb5a039cd03d23eecce" - integrity sha512-MMMQ0ludy/nBs1/o0zVOiKTpG7qMbonKUzjJgQFEuvq6INZ1OraKPRAWkBq5vlKLOUMpmNYG1JoN3oDPUQ9m3Q== - -fetch-ponyfill@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/fetch-ponyfill/-/fetch-ponyfill-4.1.0.tgz#ae3ce5f732c645eab87e4ae8793414709b239893" - integrity sha1-rjzl9zLGReq4fkroeTQUcJsjmJM= - dependencies: - node-fetch "~1.7.1" - -figures@^3.0.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/figures/-/figures-3.2.0.tgz#625c18bd293c604dc4a8ddb2febf0c88341746af" - integrity sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg== - dependencies: - escape-string-regexp "^1.0.5" - -file-entry-cache@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.1.tgz#211b2dd9659cb0394b073e7323ac3c933d522027" - integrity sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg== - dependencies: - flat-cache "^3.0.4" - -file-uri-to-path@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd" - integrity sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw== - -filename-regex@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26" - integrity sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY= - -fill-range@^2.1.0: - version "2.2.4" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-2.2.4.tgz#eb1e773abb056dcd8df2bfdf6af59b8b3a936565" - integrity sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q== - dependencies: - is-number "^2.1.0" - isobject "^2.0.0" - randomatic "^3.0.0" - repeat-element "^1.1.2" - repeat-string "^1.5.2" - -fill-range@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" - integrity sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc= - dependencies: - extend-shallow "^2.0.1" - is-number "^3.0.0" - repeat-string "^1.6.1" - to-regex-range "^2.1.0" - -fill-range@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" - integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== - dependencies: - to-regex-range "^5.0.1" - -finalhandler@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.2.tgz#b7e7d000ffd11938d0fdb053506f6ebabe9f587d" - integrity sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA== - dependencies: - debug "2.6.9" - encodeurl "~1.0.2" - escape-html "~1.0.3" - on-finished "~2.3.0" - parseurl "~1.3.3" - statuses "~1.5.0" - unpipe "~1.0.0" - -find-replace@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/find-replace/-/find-replace-1.0.3.tgz#b88e7364d2d9c959559f388c66670d6130441fa0" - integrity sha1-uI5zZNLZyVlVnziMZmcNYTBEH6A= - dependencies: - array-back "^1.0.4" - test-value "^2.1.0" - -find-up@3.0.0, find-up@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73" - integrity sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg== - dependencies: - locate-path "^3.0.0" - -find-up@^1.0.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" - integrity sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8= - dependencies: - path-exists "^2.0.0" - pinkie-promise "^2.0.0" - -find-up@^2.0.0, find-up@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" - integrity sha1-RdG35QbHF93UgndaK3eSCjwMV6c= - dependencies: - locate-path "^2.0.0" - -find-up@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" - integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== - dependencies: - locate-path "^6.0.0" - path-exists "^4.0.0" - -find-versions@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/find-versions/-/find-versions-4.0.0.tgz#3c57e573bf97769b8cb8df16934b627915da4965" - integrity sha512-wgpWy002tA+wgmO27buH/9KzyEOQnKsG/R0yrcjPT9BOFm0zRBVQbZ95nRGXWMywS8YR5knRbpohio0bcJABxQ== - dependencies: - semver-regex "^3.1.2" - -find-yarn-workspace-root@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/find-yarn-workspace-root/-/find-yarn-workspace-root-1.2.1.tgz#40eb8e6e7c2502ddfaa2577c176f221422f860db" - integrity sha512-dVtfb0WuQG+8Ag2uWkbG79hOUzEsRrhBzgfn86g2sJPkzmcpGdghbNTfUKGTxymFrY/tLIodDzLoW9nOJ4FY8Q== - dependencies: - fs-extra "^4.0.3" - micromatch "^3.1.4" - -find-yarn-workspace-root@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/find-yarn-workspace-root/-/find-yarn-workspace-root-2.0.0.tgz#f47fb8d239c900eb78179aa81b66673eac88f7bd" - integrity sha512-1IMnbjt4KzsQfnhnzNd8wUEgXZ44IzZaZmnLYx7D5FZlaHt2gW20Cri8Q+E/t5tIj4+epTBub+2Zxu/vNILzqQ== - dependencies: - micromatch "^4.0.2" - -flat-cache@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.0.4.tgz#61b0338302b2fe9f957dcc32fc2a87f1c3048b11" - integrity sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg== - dependencies: - flatted "^3.1.0" - rimraf "^3.0.2" - -flat@^4.1.0: - version "4.1.1" - resolved "https://registry.yarnpkg.com/flat/-/flat-4.1.1.tgz#a392059cc382881ff98642f5da4dde0a959f309b" - integrity sha512-FmTtBsHskrU6FJ2VxCnsDb84wu9zhmO3cUX2kGFb5tuwhfXxGciiT0oRY+cck35QmG+NmGh5eLz6lLCpWTqwpA== - dependencies: - is-buffer "~2.0.3" - -flatstr@^1.0.12: - version "1.0.12" - resolved "https://registry.yarnpkg.com/flatstr/-/flatstr-1.0.12.tgz#c2ba6a08173edbb6c9640e3055b95e287ceb5931" - integrity sha512-4zPxDyhCyiN2wIAtSLI6gc82/EjqZc1onI4Mz/l0pWrAlsSfYH/2ZIcU+e3oA2wDwbzIWNKwa23F8rh6+DRWkw== - -flatted@^3.1.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.1.1.tgz#c4b489e80096d9df1dfc97c79871aea7c617c469" - integrity sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA== - -flow-stoplight@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/flow-stoplight/-/flow-stoplight-1.0.0.tgz#4a292c5bcff8b39fa6cc0cb1a853d86f27eeff7b" - integrity sha1-SiksW8/4s5+mzAyxqFPYbyfu/3s= - -fn.name@1.x.x: - version "1.1.0" - resolved "https://registry.yarnpkg.com/fn.name/-/fn.name-1.1.0.tgz#26cad8017967aea8731bc42961d04a3d5988accc" - integrity sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw== - -follow-redirects@^1.10.0, follow-redirects@^1.12.1: - version "1.14.1" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.1.tgz#d9114ded0a1cfdd334e164e6662ad02bfd91ff43" - integrity sha512-HWqDgT7ZEkqRzBvc2s64vSZ/hfOceEol3ac/7tKwzuvEyWx3/4UegXh5oBOIotkGsObyk3xznnSRVADBgWSQVg== - -for-each@^0.3.3, for-each@~0.3.3: - version "0.3.3" - resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.3.tgz#69b447e88a0a5d32c3e7084f3f1710034b21376e" - integrity sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw== - dependencies: - is-callable "^1.1.3" - -for-in@^1.0.1, for-in@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" - integrity sha1-gQaNKVqBQuwKxybG4iAMMPttXoA= - -for-own@^0.1.4: - version "0.1.5" - resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.5.tgz#5265c681a4f294dabbf17c9509b6763aa84510ce" - integrity sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4= - dependencies: - for-in "^1.0.1" - -foreach@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99" - integrity sha1-C+4AUBiusmDQo6865ljdATbsG5k= - -forever-agent@~0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" - integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE= - -form-data@^2.2.0: - version "2.5.1" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.5.1.tgz#f2cbec57b5e59e23716e128fe44d4e5dd23895f4" - integrity sha512-m21N3WOmEEURgk6B9GLOE4RuWOFf28Lhh9qGYeNlGq4VDXUlJy2th2slBNU8Gp8EzloYZOibZJ7t5ecIrFSjVA== - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.6" - mime-types "^2.1.12" - -form-data@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-3.0.1.tgz#ebd53791b78356a99af9a300d4282c4d5eb9755f" - integrity sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg== - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.8" - mime-types "^2.1.12" - -form-data@~2.3.2: - version "2.3.3" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" - integrity sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ== - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.6" - mime-types "^2.1.12" - -forwarded@~0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.1.2.tgz#98c23dab1175657b8c0573e8ceccd91b0ff18c84" - integrity sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ= - -fp-ts@1.19.3: - version "1.19.3" - resolved "https://registry.yarnpkg.com/fp-ts/-/fp-ts-1.19.3.tgz#261a60d1088fbff01f91256f91d21d0caaaaa96f" - integrity sha512-H5KQDspykdHuztLTg+ajGN0Z2qUjcEf3Ybxc6hLt0k7/zPkn29XnKnxlBPyW2XIddWrGaJBzBl4VLYOtk39yZg== - -fp-ts@^1.0.0: - version "1.19.5" - resolved "https://registry.yarnpkg.com/fp-ts/-/fp-ts-1.19.5.tgz#3da865e585dfa1fdfd51785417357ac50afc520a" - integrity sha512-wDNqTimnzs8QqpldiId9OavWK2NptormjXnRJTQecNjzwfyp6P/8s/zG8e4h3ja3oqkKaY72UlTjQYt/1yXf9A== - -fragment-cache@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" - integrity sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk= - dependencies: - map-cache "^0.2.2" - -fresh@0.5.2: - version "0.5.2" - resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" - integrity sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac= - -fs-extra@^0.30.0: - version "0.30.0" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-0.30.0.tgz#f233ffcc08d4da7d432daa449776989db1df93f0" - integrity sha1-8jP/zAjU2n1DLapEl3aYnbHfk/A= - dependencies: - graceful-fs "^4.1.2" - jsonfile "^2.1.0" - klaw "^1.0.0" - path-is-absolute "^1.0.0" - rimraf "^2.2.8" - -fs-extra@^4.0.2, fs-extra@^4.0.3: - version "4.0.3" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-4.0.3.tgz#0d852122e5bc5beb453fb028e9c0c9bf36340c94" - integrity sha512-q6rbdDd1o2mAnQreO7YADIxf/Whx4AHBiRf6d+/cVT8h44ss+lHgxf1FemcqDnQt9X3ct4McHr+JMGlYSsK7Cg== - dependencies: - graceful-fs "^4.1.2" - jsonfile "^4.0.0" - universalify "^0.1.0" - -fs-extra@^7.0.0, fs-extra@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9" - integrity sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw== - dependencies: - graceful-fs "^4.1.2" - jsonfile "^4.0.0" - universalify "^0.1.0" - -fs-extra@^8.1.0: - version "8.1.0" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-8.1.0.tgz#49d43c45a88cd9677668cb7be1b46efdb8d2e1c0" - integrity sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g== - dependencies: - graceful-fs "^4.2.0" - jsonfile "^4.0.0" - universalify "^0.1.0" - -fs-extra@^9.0.1: - version "9.1.0" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.1.0.tgz#5954460c764a8da2094ba3554bf839e6b9a7c86d" - integrity sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ== - dependencies: - at-least-node "^1.0.0" - graceful-fs "^4.2.0" - jsonfile "^6.0.1" - universalify "^2.0.0" - -fs-minipass@^1.2.5: - version "1.2.7" - resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.7.tgz#ccff8570841e7fe4265693da88936c55aed7f7c7" - integrity sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA== - dependencies: - minipass "^2.6.0" - -fs-readdir-recursive@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz#e32fc030a2ccee44a6b5371308da54be0b397d27" - integrity sha512-GNanXlVr2pf02+sPN40XN8HG+ePaNcvM0q5mZBd668Obwb0yD5GiUbZOFgwn8kGMY6I3mdyDJzieUy3PTYyTRA== - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= - -fsevents@^1.0.0: - version "1.2.13" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.13.tgz#f325cb0455592428bcf11b383370ef70e3bfcc38" - integrity sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw== - dependencies: - bindings "^1.5.0" - nan "^2.12.1" - -fsevents@~2.1.1: - version "2.1.3" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.1.3.tgz#fb738703ae8d2f9fe900c33836ddebee8b97f23e" - integrity sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ== - -fsevents@~2.3.1: - version "2.3.2" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" - integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== - -function-bind@^1.1.1, function-bind@~1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" - integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== - -functional-red-black-tree@^1.0.1, functional-red-black-tree@~1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" - integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= - -ganache-cli@^6.11.0: - version "6.12.2" - resolved "https://registry.yarnpkg.com/ganache-cli/-/ganache-cli-6.12.2.tgz#c0920f7db0d4ac062ffe2375cb004089806f627a" - integrity sha512-bnmwnJDBDsOWBUP8E/BExWf85TsdDEFelQSzihSJm9VChVO1SHp94YXLP5BlA4j/OTxp0wR4R1Tje9OHOuAJVw== - dependencies: - ethereumjs-util "6.2.1" - source-map-support "0.5.12" - yargs "13.2.4" - -ganache-core@^2.13.2: - version "2.13.2" - resolved "https://registry.yarnpkg.com/ganache-core/-/ganache-core-2.13.2.tgz#27e6fc5417c10e6e76e2e646671869d7665814a3" - integrity sha512-tIF5cR+ANQz0+3pHWxHjIwHqFXcVo0Mb+kcsNhglNFALcYo49aQpnS9dqHartqPfMFjiHh/qFoD3mYK0d/qGgw== - dependencies: - abstract-leveldown "3.0.0" - async "2.6.2" - bip39 "2.5.0" - cachedown "1.0.0" - clone "2.1.2" - debug "3.2.6" - encoding-down "5.0.4" - eth-sig-util "3.0.0" - ethereumjs-abi "0.6.8" - ethereumjs-account "3.0.0" - ethereumjs-block "2.2.2" - ethereumjs-common "1.5.0" - ethereumjs-tx "2.1.2" - ethereumjs-util "6.2.1" - ethereumjs-vm "4.2.0" - heap "0.2.6" - keccak "3.0.1" - level-sublevel "6.6.4" - levelup "3.1.1" - lodash "4.17.20" - lru-cache "5.1.1" - merkle-patricia-tree "3.0.0" - patch-package "6.2.2" - seedrandom "3.0.1" - source-map-support "0.5.12" - tmp "0.1.0" - web3-provider-engine "14.2.1" - websocket "1.0.32" - optionalDependencies: - ethereumjs-wallet "0.6.5" - web3 "1.2.11" - -get-caller-file@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a" - integrity sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w== - -get-caller-file@^2.0.1, get-caller-file@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" - integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== - -get-func-name@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.0.tgz#ead774abee72e20409433a066366023dd6887a41" - integrity sha1-6td0q+5y4gQJQzoGY2YCPdaIekE= - -get-intrinsic@^1.0.2, get-intrinsic@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.1.tgz#15f59f376f855c446963948f0d24cd3637b4abc6" - integrity sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q== - dependencies: - function-bind "^1.1.1" - has "^1.0.3" - has-symbols "^1.0.1" - -get-iterator@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/get-iterator/-/get-iterator-1.0.2.tgz#cd747c02b4c084461fac14f48f6b45a80ed25c82" - integrity sha512-v+dm9bNVfOYsY1OrhaCrmyOcYoSeVvbt+hHZ0Au+T+p1y+0Uyj9aMaGIeUTT6xdpRbWzDeYKvfOslPhggQMcsg== - -get-own-enumerable-property-symbols@^3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-3.0.2.tgz#b5fde77f22cbe35f390b4e089922c50bce6ef664" - integrity sha512-I0UBV/XOz1XkIJHEUDMZAbzCThU/H8DxmSfmdGcKPnVhu2VfFqr34jr9777IyaTYvxjedWhqVIilEDsCdP5G6g== - -get-port@^3.1.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/get-port/-/get-port-3.2.0.tgz#dd7ce7de187c06c8bf353796ac71e099f0980ebc" - integrity sha1-3Xzn3hh8Bsi/NTeWrHHgmfCYDrw= - -get-stream@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" - integrity sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ= - -get-stream@^4.0.0, get-stream@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5" - integrity sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w== - dependencies: - pump "^3.0.0" - -get-stream@^5.0.0, get-stream@^5.1.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-5.2.0.tgz#4966a1795ee5ace65e706c4b7beb71257d6e22d3" - integrity sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA== - dependencies: - pump "^3.0.0" - -get-value@^2.0.3, get-value@^2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" - integrity sha1-3BXKHGcjh8p2vTesCjlbogQqLCg= - -getpass@^0.1.1: - version "0.1.7" - resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" - integrity sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo= - dependencies: - assert-plus "^1.0.0" - -ghost-testrpc@^0.0.2: - version "0.0.2" - resolved "https://registry.yarnpkg.com/ghost-testrpc/-/ghost-testrpc-0.0.2.tgz#c4de9557b1d1ae7b2d20bbe474a91378ca90ce92" - integrity sha512-i08dAEgJ2g8z5buJIrCTduwPIhih3DP+hOCTyyryikfV8T0bNvHnGXO67i0DD1H4GBDETTclPy9njZbfluQYrQ== - dependencies: - chalk "^2.4.2" - node-emoji "^1.10.0" - -glob-base@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" - integrity sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q= - dependencies: - glob-parent "^2.0.0" - is-glob "^2.0.0" - -glob-parent@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-2.0.0.tgz#81383d72db054fcccf5336daa902f182f6edbb28" - integrity sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg= - dependencies: - is-glob "^2.0.0" - -glob-parent@^5.0.0, glob-parent@^5.1.0, glob-parent@~5.1.0: - version "5.1.2" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" - integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== - dependencies: - is-glob "^4.0.1" - -glob@7.1.2: - version "7.1.2" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" - integrity sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -glob@7.1.3: - version "7.1.3" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" - integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -glob@^5.0.15: - version "5.0.15" - resolved "https://registry.yarnpkg.com/glob/-/glob-5.0.15.tgz#1bc936b9e02f4a603fcc222ecf7633d30b8b93b1" - integrity sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E= - dependencies: - inflight "^1.0.4" - inherits "2" - minimatch "2 || 3" - once "^1.3.0" - path-is-absolute "^1.0.0" - -glob@^7.0.0, glob@^7.1.2, glob@^7.1.3, glob@^7.1.6, glob@~7.1.6: - version "7.1.7" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.7.tgz#3b193e9233f01d42d0b3f78294bbeeb418f94a90" - integrity sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -global-modules@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/global-modules/-/global-modules-2.0.0.tgz#997605ad2345f27f51539bea26574421215c7780" - integrity sha512-NGbfmJBp9x8IxyJSd1P+otYK8vonoJactOogrVfFRIAEY1ukil8RSKDz2Yo7wh1oihl51l/r6W4epkeKJHqL8A== - dependencies: - global-prefix "^3.0.0" - -global-prefix@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/global-prefix/-/global-prefix-3.0.0.tgz#fc85f73064df69f50421f47f883fe5b913ba9b97" - integrity sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg== - dependencies: - ini "^1.3.5" - kind-of "^6.0.2" - which "^1.3.1" - -global@~4.4.0: - version "4.4.0" - resolved "https://registry.yarnpkg.com/global/-/global-4.4.0.tgz#3e7b105179006a323ed71aafca3e9c57a5cc6406" - integrity sha512-wv/LAoHdRE3BeTGz53FAamhGlPLhlssK45usmGFThIi4XqnBmjKQ16u+RNbP7WvigRZDxUsM0J3gcQ5yicaL0w== - dependencies: - min-document "^2.19.0" - process "^0.11.10" - -globals@^12.1.0: - version "12.4.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-12.4.0.tgz#a18813576a41b00a24a97e7f815918c2e19925f8" - integrity sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg== - dependencies: - type-fest "^0.8.1" - -globals@^13.6.0: - version "13.9.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-13.9.0.tgz#4bf2bf635b334a173fb1daf7c5e6b218ecdc06cb" - integrity sha512-74/FduwI/JaIrr1H8e71UbDE+5x7pIPs1C2rrwC52SszOo043CsWOZEMW7o2Y58xwm9b+0RBKDxY5n2sUpEFxA== - dependencies: - type-fest "^0.20.2" - -globals@^9.18.0: - version "9.18.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" - integrity sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ== - -globby@^10.0.1: - version "10.0.2" - resolved "https://registry.yarnpkg.com/globby/-/globby-10.0.2.tgz#277593e745acaa4646c3ab411289ec47a0392543" - integrity sha512-7dUi7RvCoT/xast/o/dLN53oqND4yk0nsHkhRgn9w65C4PofCLOoJ39iSOg+qVDdWQPIEj+eszMHQ+aLVwwQSg== - dependencies: - "@types/glob" "^7.1.1" - array-union "^2.1.0" - dir-glob "^3.0.1" - fast-glob "^3.0.3" - glob "^7.1.3" - ignore "^5.1.1" - merge2 "^1.2.3" - slash "^3.0.0" - -globby@^11.0.1: - version "11.0.3" - resolved "https://registry.yarnpkg.com/globby/-/globby-11.0.3.tgz#9b1f0cb523e171dd1ad8c7b2a9fb4b644b9593cb" - integrity sha512-ffdmosjA807y7+lA1NM0jELARVmYul/715xiILEjo3hBLPTcirgQNnXECn5g3mtR8TOLCVbkfua1Hpen25/Xcg== - dependencies: - array-union "^2.1.0" - dir-glob "^3.0.1" - fast-glob "^3.1.1" - ignore "^5.1.4" - merge2 "^1.3.0" - slash "^3.0.0" - -got@9.6.0: - version "9.6.0" - resolved "https://registry.yarnpkg.com/got/-/got-9.6.0.tgz#edf45e7d67f99545705de1f7bbeeeb121765ed85" - integrity sha512-R7eWptXuGYxwijs0eV+v3o6+XH1IqVK8dJOEecQfTmkncw9AV4dcw/Dhxi8MdlqPthxxpZyizMzyg8RTmEsG+Q== - dependencies: - "@sindresorhus/is" "^0.14.0" - "@szmarczak/http-timer" "^1.1.2" - cacheable-request "^6.0.0" - decompress-response "^3.3.0" - duplexer3 "^0.1.4" - get-stream "^4.1.0" - lowercase-keys "^1.0.1" - mimic-response "^1.0.1" - p-cancelable "^1.0.0" - to-readable-stream "^1.0.0" - url-parse-lax "^3.0.0" - -got@^7.1.0: - version "7.1.0" - resolved "https://registry.yarnpkg.com/got/-/got-7.1.0.tgz#05450fd84094e6bbea56f451a43a9c289166385a" - integrity sha512-Y5WMo7xKKq1muPsxD+KmrR8DH5auG7fBdDVueZwETwV6VytKyU9OX/ddpq2/1hp1vIPvVb4T81dKQz3BivkNLw== - dependencies: - decompress-response "^3.2.0" - duplexer3 "^0.1.4" - get-stream "^3.0.0" - is-plain-obj "^1.1.0" - is-retry-allowed "^1.0.0" - is-stream "^1.0.0" - isurl "^1.0.0-alpha5" - lowercase-keys "^1.0.0" - p-cancelable "^0.3.0" - p-timeout "^1.1.1" - safe-buffer "^5.0.1" - timed-out "^4.0.0" - url-parse-lax "^1.0.0" - url-to-options "^1.0.1" - -graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9, graceful-fs@^4.2.0, graceful-fs@^4.2.4: - version "4.2.6" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.6.tgz#ff040b2b0853b23c3d31027523706f1885d76bee" - integrity sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ== - -graphql-tag@2.11.0: - version "2.11.0" - resolved "https://registry.yarnpkg.com/graphql-tag/-/graphql-tag-2.11.0.tgz#1deb53a01c46a7eb401d6cb59dec86fa1cccbffd" - integrity sha512-VmsD5pJqWJnQZMUeRwrDhfgoyqcfwEkvtpANqcoUG8/tOLkwNgU9mzub/Mc78OJMhHjx7gfAMTxzdG43VGg3bA== - -graphql@15.4.0: - version "15.4.0" - resolved "https://registry.yarnpkg.com/graphql/-/graphql-15.4.0.tgz#e459dea1150da5a106486ba7276518b5295a4347" - integrity sha512-EB3zgGchcabbsU9cFe1j+yxdzKQKAbGUWRb13DsrsMN1yyfmmIq+2+L5MqVWcDCE4V89R5AyUOi7sMOGxdsYtA== - -growl@1.10.3: - version "1.10.3" - resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.3.tgz#1926ba90cf3edfe2adb4927f5880bc22c66c790f" - integrity sha512-hKlsbA5Vu3xsh1Cg3J7jSmX/WaW6A5oBeqzM88oNbCRQFz+zUaXm6yxS4RVytp1scBoJzSYl4YAEOQIt6O8V1Q== - -growl@1.10.5: - version "1.10.5" - resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e" - integrity sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA== - -handlebars@^4.0.1: - version "4.7.7" - resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.7.7.tgz#9ce33416aad02dbd6c8fafa8240d5d98004945a1" - integrity sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA== - dependencies: - minimist "^1.2.5" - neo-async "^2.6.0" - source-map "^0.6.1" - wordwrap "^1.0.0" - optionalDependencies: - uglify-js "^3.1.4" - -har-schema@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" - integrity sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI= - -har-validator@~5.1.3: - version "5.1.5" - resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.5.tgz#1f0803b9f8cb20c0fa13822df1ecddb36bde1efd" - integrity sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w== - dependencies: - ajv "^6.12.3" - har-schema "^2.0.0" - -hardhat-abi-exporter@^2.2.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/hardhat-abi-exporter/-/hardhat-abi-exporter-2.2.1.tgz#98ad242d08987d34416c6315729f36f9d544e4fa" - integrity sha512-Um7+RPvJEj+OqWjPoPKlTTkO1Akr10pqpgMk8Pw2jz2wrGv5XQBGNW5aQgGVDUosYktUIWDaEhcwwFKbFsir9A== - -hardhat-contract-sizer@^2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/hardhat-contract-sizer/-/hardhat-contract-sizer-2.0.3.tgz#604455fd803865f81c29f60364e863eaa19395a7" - integrity sha512-iaixOzWxwOSIIE76cl2uk4m9VXI1hKU3bFt+gl7jDhyb2/JB2xOp5wECkfWqAoc4V5lD4JtjldZlpSTbzX+nPQ== - dependencies: - cli-table3 "^0.6.0" - colors "^1.4.0" - -hardhat-gas-reporter@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/hardhat-gas-reporter/-/hardhat-gas-reporter-1.0.4.tgz#59e3137e38e0dfeac2e4f90d5c74160b50ad4829" - integrity sha512-G376zKh81G3K9WtDA+SoTLWsoygikH++tD1E7llx+X7J+GbIqfwhDKKgvJjcnEesMrtR9UqQHK02lJuXY1RTxw== - dependencies: - eth-gas-reporter "^0.2.20" - sha1 "^1.1.1" - -hardhat@^2.2.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/hardhat/-/hardhat-2.3.0.tgz#5c29f8b4d08155c3dc8c908af9713fd5079522d5" - integrity sha512-nc4ro2bM4wPaA6/0Y22o5F5QrifQk2KCyPUUKLPUeFFZoGNGYB8vmeW/k9gV9DdMukdWTzfYlKc2Jn4bfb6tDQ== - dependencies: - "@ethereumjs/block" "^3.2.1" - "@ethereumjs/blockchain" "^5.2.1" - "@ethereumjs/common" "^2.2.0" - "@ethereumjs/tx" "^3.1.3" - "@ethereumjs/vm" "^5.3.2" - "@sentry/node" "^5.18.1" - "@solidity-parser/parser" "^0.11.0" - "@types/bn.js" "^5.1.0" - "@types/lru-cache" "^5.1.0" - abort-controller "^3.0.0" - adm-zip "^0.4.16" - ansi-escapes "^4.3.0" - chalk "^2.4.2" - chokidar "^3.4.0" - ci-info "^2.0.0" - debug "^4.1.1" - enquirer "^2.3.0" - env-paths "^2.2.0" - eth-sig-util "^2.5.2" - ethereum-cryptography "^0.1.2" - ethereumjs-abi "^0.6.8" - ethereumjs-util "^7.0.10" - find-up "^2.1.0" - fp-ts "1.19.3" - fs-extra "^7.0.1" - glob "^7.1.3" - immutable "^4.0.0-rc.12" - io-ts "1.10.4" - lodash "^4.17.11" - merkle-patricia-tree "^4.1.0" - mnemonist "^0.38.0" - mocha "^7.1.2" - node-fetch "^2.6.0" - qs "^6.7.0" - raw-body "^2.4.1" - resolve "1.17.0" - semver "^6.3.0" - slash "^3.0.0" - solc "0.7.3" - source-map-support "^0.5.13" - stacktrace-parser "^0.1.10" - "true-case-path" "^2.2.1" - tsort "0.0.1" - uuid "^3.3.2" - ws "^7.2.1" - -has-ansi@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" - integrity sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE= - dependencies: - ansi-regex "^2.0.0" - -has-bigints@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/has-bigints/-/has-bigints-1.0.1.tgz#64fe6acb020673e3b78db035a5af69aa9d07b113" - integrity sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA== - -has-flag@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa" - integrity sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo= - -has-flag@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-2.0.0.tgz#e8207af1cc7b30d446cc70b734b5e8be18f88d51" - integrity sha1-6CB68cx7MNRGzHC3NLXovhj4jVE= - -has-flag@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" - integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= - -has-flag@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" - integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== - -has-symbol-support-x@^1.4.1: - version "1.4.2" - resolved "https://registry.yarnpkg.com/has-symbol-support-x/-/has-symbol-support-x-1.4.2.tgz#1409f98bc00247da45da67cee0a36f282ff26455" - integrity sha512-3ToOva++HaW+eCpgqZrCfN51IPB+7bJNVT6CUATzueB5Heb8o6Nam0V3HG5dlDvZU1Gn5QLcbahiKw/XVk5JJw== - -has-symbols@^1.0.0, has-symbols@^1.0.1, has-symbols@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.2.tgz#165d3070c00309752a1236a479331e3ac56f1423" - integrity sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw== - -has-to-string-tag-x@^1.2.0: - version "1.4.1" - resolved "https://registry.yarnpkg.com/has-to-string-tag-x/-/has-to-string-tag-x-1.4.1.tgz#a045ab383d7b4b2012a00148ab0aa5f290044d4d" - integrity sha512-vdbKfmw+3LoOYVr+mtxHaX5a96+0f3DljYd8JOqvOLsf5mw2Otda2qCDT9qRqLAhrjyQ0h7ual5nOiASpsGNFw== - dependencies: - has-symbol-support-x "^1.4.1" - -has-value@^0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" - integrity sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8= - dependencies: - get-value "^2.0.3" - has-values "^0.1.4" - isobject "^2.0.0" - -has-value@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177" - integrity sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc= - dependencies: - get-value "^2.0.6" - has-values "^1.0.0" - isobject "^3.0.0" - -has-values@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771" - integrity sha1-bWHeldkd/Km5oCCJrThL/49it3E= - -has-values@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f" - integrity sha1-lbC2P+whRmGab+V/51Yo1aOe/k8= - dependencies: - is-number "^3.0.0" - kind-of "^4.0.0" - -has@^1.0.3, has@~1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" - integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== - dependencies: - function-bind "^1.1.1" - -hash-base@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/hash-base/-/hash-base-3.1.0.tgz#55c381d9e06e1d2997a883b4a3fddfe7f0d3af33" - integrity sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA== - dependencies: - inherits "^2.0.4" - readable-stream "^3.6.0" - safe-buffer "^5.2.0" - -hash.js@1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.3.tgz#340dedbe6290187151c1ea1d777a3448935df846" - integrity sha512-/UETyP0W22QILqS+6HowevwhEFJ3MBJnwTf75Qob9Wz9t0DPuisL8kW8YZMK62dHAKE1c1p+gY1TtOLY+USEHA== - dependencies: - inherits "^2.0.3" - minimalistic-assert "^1.0.0" - -hash.js@^1.0.0, hash.js@^1.0.3, hash.js@^1.1.7: - version "1.1.7" - resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.7.tgz#0babca538e8d4ee4a0f8988d68866537a003cf42" - integrity sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA== - dependencies: - inherits "^2.0.3" - minimalistic-assert "^1.0.1" - -he@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd" - integrity sha1-k0EP0hsAlzUVH4howvJx80J+I/0= - -he@1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" - integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== - -heap@0.2.6: - version "0.2.6" - resolved "https://registry.yarnpkg.com/heap/-/heap-0.2.6.tgz#087e1f10b046932fc8594dd9e6d378afc9d1e5ac" - integrity sha1-CH4fELBGky/IWU3Z5tN4r8nR5aw= - -helmet@4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/helmet/-/helmet-4.1.1.tgz#751f0e273d809ace9c172073e0003bed27d27a4a" - integrity sha512-Avg4XxSBrehD94mkRwEljnO+6RZx7AGfk8Wa6K1nxaU+hbXlFOhlOIMgPfFqOYQB/dBCsTpootTGuiOG+CHiQA== - -hmac-drbg@^1.0.0, hmac-drbg@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" - integrity sha1-0nRXAQJabHdabFRXk+1QL8DGSaE= - dependencies: - hash.js "^1.0.3" - minimalistic-assert "^1.0.0" - minimalistic-crypto-utils "^1.0.1" - -home-or-tmp@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-2.0.0.tgz#e36c3f2d2cae7d746a857e38d18d5f32a7882db8" - integrity sha1-42w/LSyufXRqhX440Y1fMqeILbg= - dependencies: - os-homedir "^1.0.0" - os-tmpdir "^1.0.1" - -hosted-git-info@^2.1.4, hosted-git-info@^2.6.0: - version "2.8.9" - resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.9.tgz#dffc0bf9a21c02209090f2aa69429e1414daf3f9" - integrity sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw== - -http-basic@^8.1.1: - version "8.1.3" - resolved "https://registry.yarnpkg.com/http-basic/-/http-basic-8.1.3.tgz#a7cabee7526869b9b710136970805b1004261bbf" - integrity sha512-/EcDMwJZh3mABI2NhGfHOGOeOZITqfkEO4p/xK+l3NpyncIHUQBoMvCSF/b5GqvKtySC2srL/GGG3+EtlqlmCw== - dependencies: - caseless "^0.12.0" - concat-stream "^1.6.2" - http-response-object "^3.0.1" - parse-cache-control "^1.0.1" - -http-cache-semantics@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz#49e91c5cbf36c9b94bcfcd71c23d5249ec74e390" - integrity sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ== - -http-errors@1.7.2: - version "1.7.2" - resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.2.tgz#4f5029cf13239f31036e5b2e55292bcfbcc85c8f" - integrity sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg== - dependencies: - depd "~1.1.2" - inherits "2.0.3" - setprototypeof "1.1.1" - statuses ">= 1.5.0 < 2" - toidentifier "1.0.0" - -http-errors@1.7.3, http-errors@~1.7.2: - version "1.7.3" - resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.3.tgz#6c619e4f9c60308c38519498c14fbb10aacebb06" - integrity sha512-ZTTX0MWrsQ2ZAhA1cejAwDLycFsd7I7nVtnkT3Ol0aqodaKW+0CTZDQ1uBv5whptCnc8e8HeRRJxRs0kmm/Qfw== - dependencies: - depd "~1.1.2" - inherits "2.0.4" - setprototypeof "1.1.1" - statuses ">= 1.5.0 < 2" - toidentifier "1.0.0" - -http-https@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/http-https/-/http-https-1.0.0.tgz#2f908dd5f1db4068c058cd6e6d4ce392c913389b" - integrity sha1-L5CN1fHbQGjAWM1ubUzjkskTOJs= - -http-response-object@^3.0.1: - version "3.0.2" - resolved "https://registry.yarnpkg.com/http-response-object/-/http-response-object-3.0.2.tgz#7f435bb210454e4360d074ef1f989d5ea8aa9810" - integrity sha512-bqX0XTF6fnXSQcEJ2Iuyr75yVakyjIDCqroJQ/aHfSdlM743Cwqoi2nDYMzLGWUcuTWGWy8AAvOKXTfiv6q9RA== - dependencies: - "@types/node" "^10.0.3" - -http-signature@~1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" - integrity sha1-muzZJRFHcvPZW2WmCruPfBj7rOE= - dependencies: - assert-plus "^1.0.0" - jsprim "^1.2.2" - sshpk "^1.7.0" - -https-proxy-agent@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz#e2a90542abb68a762e0a0850f6c9edadfd8506b2" - integrity sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA== - dependencies: - agent-base "6" - debug "4" - -human-signals@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-1.1.1.tgz#c5b1cd14f50aeae09ab6c59fe63ba3395fe4dfa3" - integrity sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw== - -husky@^4.3.8: - version "4.3.8" - resolved "https://registry.yarnpkg.com/husky/-/husky-4.3.8.tgz#31144060be963fd6850e5cc8f019a1dfe194296d" - integrity sha512-LCqqsB0PzJQ/AlCgfrfzRe3e3+NvmefAdKQhRYpxS4u6clblBoDdzzvHi8fmxKRzvMxPY/1WZWzomPZww0Anow== - dependencies: - chalk "^4.0.0" - ci-info "^2.0.0" - compare-versions "^3.6.0" - cosmiconfig "^7.0.0" - find-versions "^4.0.0" - opencollective-postinstall "^2.0.2" - pkg-dir "^5.0.0" - please-upgrade-node "^3.2.0" - slash "^3.0.0" - which-pm-runs "^1.0.0" - -iconv-lite@0.4.24, iconv-lite@^0.4.24: - version "0.4.24" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" - integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== - dependencies: - safer-buffer ">= 2.1.2 < 3" - -iconv-lite@^0.6.2: - version "0.6.3" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.6.3.tgz#a52f80bf38da1952eb5c681790719871a1a72501" - integrity sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw== - dependencies: - safer-buffer ">= 2.1.2 < 3.0.0" - -idna-uts46-hx@^2.3.1: - version "2.3.1" - resolved "https://registry.yarnpkg.com/idna-uts46-hx/-/idna-uts46-hx-2.3.1.tgz#a1dc5c4df37eee522bf66d969cc980e00e8711f9" - integrity sha512-PWoF9Keq6laYdIRwwCdhTPl60xRqAloYNMQLiyUnG42VjT53oW07BXIRM+NK7eQjzXjAk2gUvX9caRxlnF9TAA== - dependencies: - punycode "2.1.0" - -ieee754@^1.1.13: - version "1.2.1" - resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" - integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== - -ignore@^4.0.6: - version "4.0.6" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" - integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== - -ignore@^5.1.1, ignore@^5.1.4: - version "5.1.8" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.1.8.tgz#f150a8b50a34289b33e22f5889abd4d8016f0e57" - integrity sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw== - -immediate@^3.2.3: - version "3.3.0" - resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.3.0.tgz#1aef225517836bcdf7f2a2de2600c79ff0269266" - integrity sha512-HR7EVodfFUdQCTIeySw+WDRFJlPcLOJbXfwwZ7Oom6tjsvZ3bOkCDJHehQC3nxJrv7+f9XecwazynjU8e4Vw3Q== - -immediate@~3.2.3: - version "3.2.3" - resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.2.3.tgz#d140fa8f614659bd6541233097ddaac25cdd991c" - integrity sha1-0UD6j2FGWb1lQSMwl92qwlzdmRw= - -immutable@^4.0.0-rc.12: - version "4.0.0-rc.12" - resolved "https://registry.yarnpkg.com/immutable/-/immutable-4.0.0-rc.12.tgz#ca59a7e4c19ae8d9bf74a97bdf0f6e2f2a5d0217" - integrity sha512-0M2XxkZLx/mi3t8NVwIm1g8nHoEmM9p9UBl/G9k4+hm0kBgOVdMV/B3CY5dQ8qG8qc80NN4gDV4HQv6FTJ5q7A== - -import-fresh@^3.0.0, import-fresh@^3.2.1: - version "3.3.0" - resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b" - integrity sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw== - dependencies: - parent-module "^1.0.0" - resolve-from "^4.0.0" - -imurmurhash@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" - integrity sha1-khi5srkoojixPcT7a21XbyMUU+o= - -indent-string@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-4.0.0.tgz#624f8f4497d619b2d9768531d58f4122854d7251" - integrity sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg== - -inflection@1.12.0: - version "1.12.0" - resolved "https://registry.yarnpkg.com/inflection/-/inflection-1.12.0.tgz#a200935656d6f5f6bc4dc7502e1aecb703228416" - integrity sha1-ogCTVlbW9fa8TcdQLhrstwMihBY= - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2, inherits@2.0.4, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.1, inherits@~2.0.3, inherits@~2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" - integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== - -inherits@2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= - -ini@^1.3.5: - version "1.3.8" - resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.8.tgz#a29da425b48806f34767a4efce397269af28432c" - integrity sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew== - -inquirer@^8.0.0: - version "8.1.0" - resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-8.1.0.tgz#68ce5ce5376cf0e89765c993d8b7c1e62e184d69" - integrity sha512-1nKYPoalt1vMBfCMtpomsUc32wmOoWXAoq3kM/5iTfxyQ2f/BxjixQpC+mbZ7BI0JUXHED4/XPXekDVtJNpXYw== - dependencies: - ansi-escapes "^4.2.1" - chalk "^4.1.1" - cli-cursor "^3.1.0" - cli-width "^3.0.0" - external-editor "^3.0.3" - figures "^3.0.0" - lodash "^4.17.21" - mute-stream "0.0.8" - ora "^5.3.0" - run-async "^2.4.0" - rxjs "^6.6.6" - string-width "^4.1.0" - strip-ansi "^6.0.0" - through "^2.3.6" - -interpret@^1.0.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.4.0.tgz#665ab8bc4da27a774a40584e812e3e0fa45b1a1e" - integrity sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA== - -invariant@^2.2.2: - version "2.2.4" - resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" - integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA== - dependencies: - loose-envify "^1.0.0" - -invert-kv@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" - integrity sha1-EEqOSqym09jNFXqO+L+rLXo//bY= - -invert-kv@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-2.0.0.tgz#7393f5afa59ec9ff5f67a27620d11c226e3eec02" - integrity sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA== - -io-ts@1.10.4: - version "1.10.4" - resolved "https://registry.yarnpkg.com/io-ts/-/io-ts-1.10.4.tgz#cd5401b138de88e4f920adbcb7026e2d1967e6e2" - integrity sha512-b23PteSnYXSONJ6JQXRAlvJhuw8KOtkqa87W4wDtvMrud/DTJd5X+NpOOI+O/zZwVq6v0VLAaJ+1EDViKEuN9g== - dependencies: - fp-ts "^1.0.0" - -ip-regex@^4.0.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/ip-regex/-/ip-regex-4.3.0.tgz#687275ab0f57fa76978ff8f4dddc8a23d5990db5" - integrity sha512-B9ZWJxHHOHUhUjCPrMpLD4xEq35bUTClHM1S6CBU5ixQnkZmwipwgc96vAd7AAGM9TGHvJR+Uss+/Ak6UphK+Q== - -ipaddr.js@1.9.1: - version "1.9.1" - resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz#bff38543eeb8984825079ff3a2a8e6cbd46781b3" - integrity sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g== - -ipfs-core-utils@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/ipfs-core-utils/-/ipfs-core-utils-0.4.0.tgz#f633b0e51be6374f8caa1b15d5107e056123137a" - integrity sha512-IBPFvYjWPfVFpCeYUL/0gCUOabdBhh7aO5i4tU//UlF2gVCXPH4PRYlbBH9WM83zE2+o4vDi+dBXsdAI6nLPAg== - dependencies: - blob-to-it "0.0.2" - browser-readablestream-to-it "0.0.2" - cids "^1.0.0" - err-code "^2.0.0" - ipfs-utils "^3.0.0" - it-all "^1.0.1" - it-map "^1.0.2" - it-peekable "0.0.1" - uint8arrays "^1.1.0" - -ipfs-http-client@47.0.1: - version "47.0.1" - resolved "https://registry.yarnpkg.com/ipfs-http-client/-/ipfs-http-client-47.0.1.tgz#509c6c742ab405bc2a7e6e0fe373e19e9b85633b" - integrity sha512-IAQf+uTLvXw5QFOzbyhu/5lH3rn7jEwwwdCGaNKVhoPI7yfyOV0wRse3hVWejjP1Id0P9mKuMKG8rhcY7pVAdQ== - dependencies: - abort-controller "^3.0.0" - any-signal "^1.1.0" - bignumber.js "^9.0.0" - cids "^1.0.0" - debug "^4.1.0" - form-data "^3.0.0" - ipfs-core-utils "^0.4.0" - ipfs-utils "^3.0.0" - ipld-block "^0.10.0" - ipld-dag-cbor "^0.17.0" - ipld-dag-pb "^0.20.0" - ipld-raw "^6.0.0" - iso-url "^0.4.7" - it-last "^1.0.2" - it-map "^1.0.2" - it-tar "^1.2.2" - it-to-buffer "^1.0.0" - it-to-stream "^0.1.1" - merge-options "^2.0.0" - multiaddr "^8.0.0" - multiaddr-to-uri "^6.0.0" - multibase "^3.0.0" - multicodec "^2.0.0" - multihashes "^3.0.1" - nanoid "^3.0.2" - node-fetch "^2.6.0" - parse-duration "^0.4.4" - stream-to-it "^0.2.1" - uint8arrays "^1.1.0" - -ipfs-utils@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/ipfs-utils/-/ipfs-utils-3.0.0.tgz#58f8345ff26c4ae6b4a8e3a2366bd25de3e1460e" - integrity sha512-qahDc+fghrM57sbySr2TeWjaVR/RH/YEB/hvdAjiTbjESeD87qZawrXwj+19Q2LtGmFGusKNLo5wExeuI5ZfDQ== - dependencies: - abort-controller "^3.0.0" - any-signal "^1.1.0" - buffer "^5.6.0" - err-code "^2.0.0" - fs-extra "^9.0.1" - is-electron "^2.2.0" - iso-url "^0.4.7" - it-glob "0.0.8" - merge-options "^2.0.0" - nanoid "^3.1.3" - node-fetch "^2.6.0" - stream-to-it "^0.2.0" - -ipld-block@^0.10.0: - version "0.10.1" - resolved "https://registry.yarnpkg.com/ipld-block/-/ipld-block-0.10.1.tgz#a9de6185257cf56903cc7f71de450672f4871b65" - integrity sha512-lPMfW9tA2hVZw9hdO/YSppTxFmA0+5zxcefBOlCTOn+12RLyy+pdepKMbQw8u0KESFu3pYVmabNRWuFGcgHLLw== - dependencies: - cids "^1.0.0" - class-is "^1.1.0" - -ipld-dag-cbor@^0.17.0: - version "0.17.1" - resolved "https://registry.yarnpkg.com/ipld-dag-cbor/-/ipld-dag-cbor-0.17.1.tgz#842e6c250603e5791049168831a425ec03471fb1" - integrity sha512-Bakj/cnxQBdscORyf4LRHxQJQfoaY8KWc7PWROQgX+aw5FCzBt8ga0VM/59K+ABOznsqNvyLR/wz/oYImOpXJw== - dependencies: - borc "^2.1.2" - cids "^1.0.0" - is-circular "^1.0.2" - multicodec "^3.0.1" - multihashing-async "^2.0.0" - uint8arrays "^2.1.3" - -ipld-dag-pb@^0.20.0: - version "0.20.0" - resolved "https://registry.yarnpkg.com/ipld-dag-pb/-/ipld-dag-pb-0.20.0.tgz#025c0343aafe6cb9db395dd1dc93c8c60a669360" - integrity sha512-zfM0EdaolqNjAxIrtpuGKvXxWk5YtH9jKinBuQGTcngOsWFQhyybGCTJHGNGGtRjHNJi2hz5Udy/8pzv4kcKyg== - dependencies: - cids "^1.0.0" - class-is "^1.1.0" - multicodec "^2.0.0" - multihashing-async "^2.0.0" - protons "^2.0.0" - reset "^0.1.0" - run "^1.4.0" - stable "^0.1.8" - uint8arrays "^1.0.0" - -ipld-raw@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/ipld-raw/-/ipld-raw-6.0.0.tgz#74d947fcd2ce4e0e1d5bb650c1b5754ed8ea6da0" - integrity sha512-UK7fjncAzs59iu/o2kwYtb8jgTtW6B+cNWIiNpAJkfRwqoMk1xD/6i25ktzwe4qO8gQgoR9RxA5ibC23nq8BLg== - dependencies: - cids "^1.0.0" - multicodec "^2.0.0" - multihashing-async "^2.0.0" - -is-accessor-descriptor@^0.1.6: - version "0.1.6" - resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" - integrity sha1-qeEss66Nh2cn7u84Q/igiXtcmNY= - dependencies: - kind-of "^3.0.2" - -is-accessor-descriptor@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656" - integrity sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ== - dependencies: - kind-of "^6.0.0" - -is-arguments@^1.0.4: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-arguments/-/is-arguments-1.1.0.tgz#62353031dfbee07ceb34656a6bde59efecae8dd9" - integrity sha512-1Ij4lOMPl/xB5kBDn7I+b2ttPMKa8szhEIrXDuXQD/oe3HJLTLhqhgGspwgyGd6MOywBUqVvYicF72lkgDnIHg== - dependencies: - call-bind "^1.0.0" - -is-arrayish@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" - integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= - -is-arrayish@^0.3.1: - version "0.3.2" - resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.3.2.tgz#4574a2ae56f7ab206896fb431eaeed066fdf8f03" - integrity sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ== - -is-bigint@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-bigint/-/is-bigint-1.0.2.tgz#ffb381442503235ad245ea89e45b3dbff040ee5a" - integrity sha512-0JV5+SOCQkIdzjBK9buARcV804Ddu7A0Qet6sHi3FimE9ne6m4BGQZfRn+NZiXbBk4F4XmHfDZIipLj9pX8dSA== - -is-binary-path@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898" - integrity sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg= - dependencies: - binary-extensions "^1.0.0" - -is-binary-path@~2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" - integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== - dependencies: - binary-extensions "^2.0.0" - -is-boolean-object@^1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.1.1.tgz#3c0878f035cb821228d350d2e1e36719716a3de8" - integrity sha512-bXdQWkECBUIAcCkeH1unwJLIpZYaa5VvuygSyS/c2lf719mTKZDU5UdDRlpd01UjADgmW8RfqaP+mRaVPdr/Ng== - dependencies: - call-bind "^1.0.2" - -is-buffer@^1.1.5: - version "1.1.6" - resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" - integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== - -is-buffer@~2.0.3: - version "2.0.5" - resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-2.0.5.tgz#ebc252e400d22ff8d77fa09888821a24a658c191" - integrity sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ== - -is-callable@^1.1.3, is-callable@^1.1.4, is-callable@^1.2.3: - version "1.2.3" - resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.3.tgz#8b1e0500b73a1d76c70487636f368e519de8db8e" - integrity sha512-J1DcMe8UYTBSrKezuIUTUwjXsho29693unXM2YhJUTR2txK/eG47bvNa/wipPFmZFgr/N6f1GA66dv0mEyTIyQ== - -is-ci@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-2.0.0.tgz#6bc6334181810e04b5c22b3d589fdca55026404c" - integrity sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w== - dependencies: - ci-info "^2.0.0" - -is-circular@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-circular/-/is-circular-1.0.2.tgz#2e0ab4e9835f4c6b0ea2b9855a84acd501b8366c" - integrity sha512-YttjnrswnUYRVJvxCvu8z+PGMUSzC2JttP0OEXezlAEdp3EXzhf7IZ3j0gRAybJBQupedIZFhY61Tga6E0qASA== - -is-core-module@^2.2.0, is-core-module@^2.4.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.4.0.tgz#8e9fc8e15027b011418026e98f0e6f4d86305cc1" - integrity sha512-6A2fkfq1rfeQZjxrZJGerpLCTHRNEBiSgnu0+obeJpEPZRUooHgsizvzv0ZjJwOz3iWIHdJtVWJ/tmPr3D21/A== - dependencies: - has "^1.0.3" - -is-data-descriptor@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" - integrity sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y= - dependencies: - kind-of "^3.0.2" - -is-data-descriptor@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7" - integrity sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ== - dependencies: - kind-of "^6.0.0" - -is-date-object@^1.0.1: - version "1.0.4" - resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.4.tgz#550cfcc03afada05eea3dd30981c7b09551f73e5" - integrity sha512-/b4ZVsG7Z5XVtIxs/h9W8nvfLgSAyKYdtGWQLbqy6jA1icmgjf8WCoTKgeS4wy5tYaPePouzFMANbnj94c2Z+A== - -is-descriptor@^0.1.0: - version "0.1.6" - resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" - integrity sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg== - dependencies: - is-accessor-descriptor "^0.1.6" - is-data-descriptor "^0.1.4" - kind-of "^5.0.0" - -is-descriptor@^1.0.0, is-descriptor@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec" - integrity sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg== - dependencies: - is-accessor-descriptor "^1.0.0" - is-data-descriptor "^1.0.0" - kind-of "^6.0.2" - -is-docker@^2.0.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/is-docker/-/is-docker-2.2.1.tgz#33eeabe23cfe86f14bde4408a02c0cfb853acdaa" - integrity sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ== - -is-dotfile@^1.0.0: - version "1.0.3" - resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.3.tgz#a6a2f32ffd2dfb04f5ca25ecd0f6b83cf798a1e1" - integrity sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE= - -is-electron@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/is-electron/-/is-electron-2.2.0.tgz#8943084f09e8b731b3a7a0298a7b5d56f6b7eef0" - integrity sha512-SpMppC2XR3YdxSzczXReBjqs2zGscWQpBIKqwXYBFic0ERaxNVgwLCHwOLZeESfdJQjX0RDvrJ1lBXX2ij+G1Q== - -is-equal-shallow@^0.1.3: - version "0.1.3" - resolved "https://registry.yarnpkg.com/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz#2238098fc221de0bcfa5d9eac4c45d638aa1c534" - integrity sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ= - dependencies: - is-primitive "^2.0.0" - -is-extendable@^0.1.0, is-extendable@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" - integrity sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik= - -is-extendable@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4" - integrity sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA== - dependencies: - is-plain-object "^2.0.4" - -is-extglob@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0" - integrity sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA= - -is-extglob@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" - integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= - -is-finite@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.1.0.tgz#904135c77fb42c0641d6aa1bcdbc4daa8da082f3" - integrity sha512-cdyMtqX/BOqqNBBiKlIVkytNHm49MtMlYyn1zxzvJKWmFMlGzm+ry5BBfYyeY9YmNKbRSo/o7OX9w9ale0wg3w== - -is-fn@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-fn/-/is-fn-1.0.0.tgz#9543d5de7bcf5b08a22ec8a20bae6e286d510d8c" - integrity sha1-lUPV3nvPWwiiLsiiC65uKG1RDYw= - -is-fullwidth-code-point@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" - integrity sha1-754xOG8DGn8NZDr4L95QxFfvAMs= - dependencies: - number-is-nan "^1.0.0" - -is-fullwidth-code-point@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" - integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= - -is-fullwidth-code-point@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" - integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== - -is-function@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-function/-/is-function-1.0.2.tgz#4f097f30abf6efadac9833b17ca5dc03f8144e08" - integrity sha512-lw7DUp0aWXYg+CBCN+JKkcE0Q2RayZnSvnZBlwgxHBQhqt5pZNVy4Ri7H9GmmXkdu7LUthszM+Tor1u/2iBcpQ== - -is-generator-function@^1.0.7: - version "1.0.9" - resolved "https://registry.yarnpkg.com/is-generator-function/-/is-generator-function-1.0.9.tgz#e5f82c2323673e7fcad3d12858c83c4039f6399c" - integrity sha512-ZJ34p1uvIfptHCN7sFTjGibB9/oBg17sHqzDLfuwhvmN/qLVvIQXRQ8licZQ35WJ8KuEQt/etnnzQFI9C9Ue/A== - -is-glob@^2.0.0, is-glob@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863" - integrity sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM= - dependencies: - is-extglob "^1.0.0" - -is-glob@^4.0.0, is-glob@^4.0.1, is-glob@~4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" - integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg== - dependencies: - is-extglob "^2.1.1" - -is-hex-prefixed@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz#7d8d37e6ad77e5d127148913c573e082d777f554" - integrity sha1-fY035q135dEnFIkTxXPggtd39VQ= - -is-interactive@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-interactive/-/is-interactive-1.0.0.tgz#cea6e6ae5c870a7b0a0004070b7b587e0252912e" - integrity sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w== - -is-ip@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/is-ip/-/is-ip-3.1.0.tgz#2ae5ddfafaf05cb8008a62093cf29734f657c5d8" - integrity sha512-35vd5necO7IitFPjd/YBeqwWnyDWbuLH9ZXQdMfDA8TEo7pv5X8yfrvVO3xbJbLUlERCMvf6X0hTUamQxCYJ9Q== - dependencies: - ip-regex "^4.0.0" - -is-negative-zero@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.1.tgz#3de746c18dda2319241a53675908d8f766f11c24" - integrity sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w== - -is-number-object@^1.0.4: - version "1.0.5" - resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.5.tgz#6edfaeed7950cff19afedce9fbfca9ee6dd289eb" - integrity sha512-RU0lI/n95pMoUKu9v1BZP5MBcZuNSVJkMkAG2dJqC4z2GlkGUNeH68SuHuBKBD/XFe+LHZ+f9BKkLET60Niedw== - -is-number@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" - integrity sha1-Afy7s5NGOlSPL0ZszhbezknbkI8= - dependencies: - kind-of "^3.0.2" - -is-number@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" - integrity sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU= - dependencies: - kind-of "^3.0.2" - -is-number@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-4.0.0.tgz#0026e37f5454d73e356dfe6564699867c6a7f0ff" - integrity sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ== - -is-number@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" - integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== - -is-obj@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-1.0.1.tgz#3e4729ac1f5fde025cd7d83a896dab9f4f67db0f" - integrity sha1-PkcprB9f3gJc19g6iW2rn09n2w8= - -is-object@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-object/-/is-object-1.0.2.tgz#a56552e1c665c9e950b4a025461da87e72f86fcf" - integrity sha512-2rRIahhZr2UWb45fIOuvZGpFtz0TyOZLf32KxBbSoUCeZR495zCKlWUKKUByk3geS2eAs7ZAABt0Y/Rx0GiQGA== - -is-plain-obj@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" - integrity sha1-caUMhCnfync8kqOQpKA7OfzVHT4= - -is-plain-obj@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-2.1.0.tgz#45e42e37fccf1f40da8e5f76ee21515840c09287" - integrity sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA== - -is-plain-object@^2.0.3, is-plain-object@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" - integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== - dependencies: - isobject "^3.0.1" - -is-posix-bracket@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz#3334dc79774368e92f016e6fbc0a88f5cd6e6bc4" - integrity sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q= - -is-primitive@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575" - integrity sha1-IHurkWOEmcB7Kt8kCkGochADRXU= - -is-regex@^1.0.4, is-regex@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.3.tgz#d029f9aff6448b93ebbe3f33dac71511fdcbef9f" - integrity sha512-qSVXFz28HM7y+IWX6vLCsexdlvzT1PJNFSBuaQLQ5o0IEw8UDYW6/2+eCMVyIsbM8CNLX2a/QWmSpyxYEHY7CQ== - dependencies: - call-bind "^1.0.2" - has-symbols "^1.0.2" - -is-regex@~1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.5.tgz#39d589a358bf18967f726967120b8fc1aed74eae" - integrity sha512-vlKW17SNq44owv5AQR3Cq0bQPEb8+kF3UKZ2fiZNOWtztYE5i0CzCZxFDwO58qAOWtxdBRVO/V5Qin1wjCqFYQ== - dependencies: - has "^1.0.3" - -is-regexp@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-regexp/-/is-regexp-1.0.0.tgz#fd2d883545c46bac5a633e7b9a09e87fa2cb5069" - integrity sha1-/S2INUXEa6xaYz57mgnof6LLUGk= - -is-retry-allowed@^1.0.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/is-retry-allowed/-/is-retry-allowed-1.2.0.tgz#d778488bd0a4666a3be8a1482b9f2baafedea8b4" - integrity sha512-RUbUeKwvm3XG2VYamhJL1xFktgjvPzL0Hq8C+6yrWIswDy3BIXGqCxhxkc30N9jqK311gVU137K8Ei55/zVJRg== - -is-stream@^1.0.0, is-stream@^1.0.1, is-stream@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" - integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= - -is-stream@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.0.tgz#bde9c32680d6fae04129d6ac9d921ce7815f78e3" - integrity sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw== - -is-string@^1.0.5, is-string@^1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.6.tgz#3fe5d5992fb0d93404f32584d4b0179a71b54a5f" - integrity sha512-2gdzbKUuqtQ3lYNrUTQYoClPhm7oQu4UdpSZMp1/DGgkHBT8E2Z1l0yMdb6D4zNAxwDiMv8MdulKROJGNl0Q0w== - -is-symbol@^1.0.2, is-symbol@^1.0.3: - version "1.0.4" - resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.4.tgz#a6dac93b635b063ca6872236de88910a57af139c" - integrity sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg== - dependencies: - has-symbols "^1.0.2" - -is-typed-array@^1.1.3: - version "1.1.5" - resolved "https://registry.yarnpkg.com/is-typed-array/-/is-typed-array-1.1.5.tgz#f32e6e096455e329eb7b423862456aa213f0eb4e" - integrity sha512-S+GRDgJlR3PyEbsX/Fobd9cqpZBuvUS+8asRqYDMLCb2qMzt1oz5m5oxQCxOgUDxiWsOVNi4yaF+/uvdlHlYug== - dependencies: - available-typed-arrays "^1.0.2" - call-bind "^1.0.2" - es-abstract "^1.18.0-next.2" - foreach "^2.0.5" - has-symbols "^1.0.1" - -is-typedarray@^1.0.0, is-typedarray@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" - integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo= - -is-unicode-supported@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz#3f26c76a809593b52bfa2ecb5710ed2779b522a7" - integrity sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw== - -is-url@^1.2.4: - version "1.2.4" - resolved "https://registry.yarnpkg.com/is-url/-/is-url-1.2.4.tgz#04a4df46d28c4cff3d73d01ff06abeb318a1aa52" - integrity sha512-ITvGim8FhRiYe4IQ5uHSkj7pVaPDrCTkNd3yq3cV7iZAcJdHTUMPMEHcqSOy9xZ9qFenQCvi+2wjH9a1nXqHww== - -is-utf8@^0.2.0: - version "0.2.1" - resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" - integrity sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI= - -is-windows@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" - integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== - -is-wsl@^2.1.1: - version "2.2.0" - resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-2.2.0.tgz#74a4c76e77ca9fd3f932f290c17ea326cd157271" - integrity sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww== - dependencies: - is-docker "^2.0.0" - -isarray@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" - integrity sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8= - -isarray@1.0.0, isarray@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" - integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= - -isexe@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" - integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= - -iso-constants@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/iso-constants/-/iso-constants-0.1.2.tgz#3d2456ed5aeaa55d18564f285ba02a47a0d885b4" - integrity sha512-OTCM5ZCQsHBCI4Wdu4tSxvDIkmDHd5EwJDps5mKqnQnWJSKlnwMs3EDZ4n3Fh1tmkWkDlyd2vCDbEYuPbyrUNQ== - -iso-url@^0.4.7, iso-url@~0.4.7: - version "0.4.7" - resolved "https://registry.yarnpkg.com/iso-url/-/iso-url-0.4.7.tgz#de7e48120dae46921079fe78f325ac9e9217a385" - integrity sha512-27fFRDnPAMnHGLq36bWTpKET+eiXct3ENlCcdcMdk+mjXrb2kw3mhBUg1B7ewAC0kVzlOPhADzQgz1SE6Tglog== - -isobject@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" - integrity sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk= - dependencies: - isarray "1.0.0" - -isobject@^3.0.0, isobject@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" - integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= - -isstream@~0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" - integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo= - -isurl@^1.0.0-alpha5: - version "1.0.0" - resolved "https://registry.yarnpkg.com/isurl/-/isurl-1.0.0.tgz#b27f4f49f3cdaa3ea44a0a5b7f3462e6edc39d67" - integrity sha512-1P/yWsxPlDtn7QeRD+ULKQPaIaN6yF368GZ2vDfv0AL0NwpStafjWCDDdn0k8wgFMWpVAqG7oJhxHnlud42i9w== - dependencies: - has-to-string-tag-x "^1.2.0" - is-object "^1.0.1" - -it-all@^1.0.1: - version "1.0.5" - resolved "https://registry.yarnpkg.com/it-all/-/it-all-1.0.5.tgz#e880510d7e73ebb79063a76296a2eb3cb77bbbdb" - integrity sha512-ygD4kA4vp8fi+Y+NBgEKt6W06xSbv6Ub/0V8d1r3uCyJ9Izwa1UspkIOlqY9fOee0Z1w3WRo1+VWyAU4DgtufA== - -it-concat@^1.0.0: - version "1.0.3" - resolved "https://registry.yarnpkg.com/it-concat/-/it-concat-1.0.3.tgz#84db9376e4c77bf7bc1fd933bb90f184e7cef32b" - integrity sha512-sjeZQ1BWQ9U/W2oI09kZgUyvSWzQahTkOkLIsnEPgyqZFaF9ME5gV6An4nMjlyhXKWQMKEakQU8oRHs2SdmeyA== - dependencies: - bl "^4.0.0" - -it-glob@0.0.8: - version "0.0.8" - resolved "https://registry.yarnpkg.com/it-glob/-/it-glob-0.0.8.tgz#b63d24945c18b35de8bb593a8c872fd0257c0cac" - integrity sha512-PmIAgb64aJPM6wwT1UTlNDAJnNgdGrvr0vRr3AYCngcUuq1KaAovuz0dQAmUkaXudDG3EQzc7OttuLW9DaL3YQ== - dependencies: - fs-extra "^8.1.0" - minimatch "^3.0.4" - -it-last@^1.0.2: - version "1.0.5" - resolved "https://registry.yarnpkg.com/it-last/-/it-last-1.0.5.tgz#5c711c7d58948bcbc8e0cb129af3a039ba2a585b" - integrity sha512-PV/2S4zg5g6dkVuKfgrQfN2rUN4wdTI1FzyAvU+i8RV96syut40pa2s9Dut5X7SkjwA3P0tOhLABLdnOJ0Y/4Q== - -it-map@^1.0.2: - version "1.0.5" - resolved "https://registry.yarnpkg.com/it-map/-/it-map-1.0.5.tgz#2f6a9b8f0ba1ed1aeadabf86e00b38c73a1dc299" - integrity sha512-EElupuWhHVStUgUY+OfTJIS2MZed96lDrAXzJUuqiiqLnIKoBRqtX1ZG2oR0bGDsSppmz83MtzCeKLZ9TVAUxQ== - -it-peekable@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/it-peekable/-/it-peekable-0.0.1.tgz#e3f91583d172444b9cd894ed2df6e26f0c176617" - integrity sha512-fd0JzbNldseeq+FFWthbqYB991UpKNyjPG6LqFhIOmJviCxSompMyoopKIXvLPLY+fBhhv2CT5PT31O/lEnTHw== - -it-reader@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/it-reader/-/it-reader-2.1.0.tgz#b1164be343f8538d8775e10fb0339f61ccf71b0f" - integrity sha512-hSysqWTO9Tlwc5EGjVf8JYZzw0D2FsxD/g+eNNWrez9zODxWt6QlN6JAMmycK72Mv4jHEKEXoyzUN4FYGmJaZw== - dependencies: - bl "^4.0.0" - -it-tar@^1.2.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/it-tar/-/it-tar-1.2.2.tgz#8d79863dad27726c781a4bcc491f53c20f2866cf" - integrity sha512-M8V4a9I+x/vwXTjqvixcEZbQZHjwDIb8iUQ+D4M2QbhAdNs3WKVSl+45u5/F2XFx6jYMFOGzMVlKNK/uONgNIA== - dependencies: - bl "^4.0.0" - buffer "^5.4.3" - iso-constants "^0.1.2" - it-concat "^1.0.0" - it-reader "^2.0.0" - p-defer "^3.0.0" - -it-to-buffer@^1.0.0: - version "1.0.5" - resolved "https://registry.yarnpkg.com/it-to-buffer/-/it-to-buffer-1.0.5.tgz#70c5aa1dd055621e862b58973534148af302f3e3" - integrity sha512-dczvg0VeXkfr2i2IQ3GGWEATBbk4Uggr+YnvBz76/Yp0zFJZTIOeDCz2KyFDxSDHNI62OlldbJXWmDPb5nFQeg== - dependencies: - buffer "^5.5.0" - -it-to-stream@^0.1.1: - version "0.1.2" - resolved "https://registry.yarnpkg.com/it-to-stream/-/it-to-stream-0.1.2.tgz#7163151f75b60445e86b8ab1a968666acaacfe7b" - integrity sha512-DTB5TJRZG3untmZehcaFN0kGWl2bNv7tnJRgQHAO9QEt8jfvVRrebZtnD5NZd4SCj4WVPjl0LSrugNWE/UaZRQ== - dependencies: - buffer "^5.6.0" - fast-fifo "^1.0.0" - get-iterator "^1.0.2" - p-defer "^3.0.0" - p-fifo "^1.0.0" - readable-stream "^3.6.0" - -js-sha3@0.5.7, js-sha3@^0.5.7: - version "0.5.7" - resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.5.7.tgz#0d4ffd8002d5333aabaf4a23eed2f6374c9f28e7" - integrity sha1-DU/9gALVMzqrr0oj7tL2N0yfKOc= - -js-sha3@0.8.0, js-sha3@^0.8.0: - version "0.8.0" - resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.8.0.tgz#b9b7a5da73afad7dedd0f8c463954cbde6818840" - integrity sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q== - -js-string-escape@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/js-string-escape/-/js-string-escape-1.0.1.tgz#e2625badbc0d67c7533e9edc1068c587ae4137ef" - integrity sha1-4mJbrbwNZ8dTPp7cEGjFh65BN+8= - -"js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" - integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== - -js-tokens@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" - integrity sha1-mGbfOVECEw449/mWvOtlRDIJwls= - -js-yaml@3.13.1: - version "3.13.1" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847" - integrity sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw== - dependencies: - argparse "^1.0.7" - esprima "^4.0.0" - -js-yaml@3.x, js-yaml@^3.13.1, js-yaml@^3.14.0: - version "3.14.1" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537" - integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== - dependencies: - argparse "^1.0.7" - esprima "^4.0.0" - -jsbn@~0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" - integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM= - -jsesc@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b" - integrity sha1-RsP+yMGJKxKwgz25vHYiF226s0s= - -jsesc@~0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" - integrity sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0= - -json-buffer@3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.0.tgz#5b1f397afc75d677bde8bcfc0e47e1f9a3d9a898" - integrity sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg= - -json-parse-better-errors@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" - integrity sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw== - -json-parse-even-better-errors@^2.3.0: - version "2.3.1" - resolved "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d" - integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== - -json-rpc-engine@^3.4.0, json-rpc-engine@^3.6.0: - version "3.8.0" - resolved "https://registry.yarnpkg.com/json-rpc-engine/-/json-rpc-engine-3.8.0.tgz#9d4ff447241792e1d0a232f6ef927302bb0c62a9" - integrity sha512-6QNcvm2gFuuK4TKU1uwfH0Qd/cOSb9c1lls0gbnIhciktIUQJwz6NQNAW4B1KiGPenv7IKu97V222Yo1bNhGuA== - dependencies: - async "^2.0.1" - babel-preset-env "^1.7.0" - babelify "^7.3.0" - json-rpc-error "^2.0.0" - promise-to-callback "^1.0.0" - safe-event-emitter "^1.0.1" - -json-rpc-error@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/json-rpc-error/-/json-rpc-error-2.0.0.tgz#a7af9c202838b5e905c7250e547f1aff77258a02" - integrity sha1-p6+cICg4tekFxyUOVH8a/3cligI= - dependencies: - inherits "^2.0.1" - -json-rpc-random-id@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/json-rpc-random-id/-/json-rpc-random-id-1.0.1.tgz#ba49d96aded1444dbb8da3d203748acbbcdec8c8" - integrity sha1-uknZat7RRE27jaPSA3SKy7zeyMg= - -json-schema-traverse@^0.3.0: - version "0.3.1" - resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz#349a6d44c53a51de89b40805c5d5e59b417d3340" - integrity sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A= - -json-schema-traverse@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" - integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== - -json-schema-traverse@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz#ae7bcb3656ab77a73ba5c49bf654f38e6b6860e2" - integrity sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug== - -json-schema@0.2.3: - version "0.2.3" - resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" - integrity sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM= - -json-stable-stringify-without-jsonify@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" - integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= - -json-stable-stringify@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz#9a759d39c5f2ff503fd5300646ed445f88c4f9af" - integrity sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8= - dependencies: - jsonify "~0.0.0" - -json-stringify-safe@~5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" - integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= - -json-text-sequence@~0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/json-text-sequence/-/json-text-sequence-0.1.1.tgz#a72f217dc4afc4629fff5feb304dc1bd51a2f3d2" - integrity sha1-py8hfcSvxGKf/1/rME3BvVGi89I= - dependencies: - delimit-stream "0.1.0" - -json5@^0.5.1: - version "0.5.1" - resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" - integrity sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE= - -json5@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.1.tgz#779fb0018604fa854eacbf6252180d83543e3dbe" - integrity sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow== - dependencies: - minimist "^1.2.0" - -jsonfile@^2.1.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-2.4.0.tgz#3736a2b428b87bbda0cc83b53fa3d633a35c2ae8" - integrity sha1-NzaitCi4e72gzIO1P6PWM6NcKug= - optionalDependencies: - graceful-fs "^4.1.6" - -jsonfile@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" - integrity sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss= - optionalDependencies: - graceful-fs "^4.1.6" - -jsonfile@^6.0.1: - version "6.1.0" - resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-6.1.0.tgz#bc55b2634793c679ec6403094eb13698a6ec0aae" - integrity sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ== - dependencies: - universalify "^2.0.0" - optionalDependencies: - graceful-fs "^4.1.6" - -jsonify@~0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" - integrity sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM= - -jsonschema@^1.2.4: - version "1.4.0" - resolved "https://registry.yarnpkg.com/jsonschema/-/jsonschema-1.4.0.tgz#1afa34c4bc22190d8e42271ec17ac8b3404f87b2" - integrity sha512-/YgW6pRMr6M7C+4o8kS+B/2myEpHCrxO4PEWnqJNBFMjn7EWXqlQ4tGwL6xTHeRplwuZmcAncdvfOad1nT2yMw== - -jsprim@^1.2.2: - version "1.4.1" - resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" - integrity sha1-MT5mvB5cwG5Di8G3SZwuXFastqI= - dependencies: - assert-plus "1.0.0" - extsprintf "1.3.0" - json-schema "0.2.3" - verror "1.10.0" - -keccak@3.0.1, keccak@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/keccak/-/keccak-3.0.1.tgz#ae30a0e94dbe43414f741375cff6d64c8bea0bff" - integrity sha512-epq90L9jlFWCW7+pQa6JOnKn2Xgl2mtI664seYR6MHskvI9agt7AnDqmAlp9TqU4/caMYbA08Hi5DMZAl5zdkA== - dependencies: - node-addon-api "^2.0.0" - node-gyp-build "^4.2.0" - -keccak@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/keccak/-/keccak-2.1.0.tgz#734ea53f2edcfd0f42cdb8d5f4c358fef052752b" - integrity sha512-m1wbJRTo+gWbctZWay9i26v5fFnYkOn7D5PCxJ3fZUGUEb49dE1Pm4BREUYCt/aoO6di7jeoGmhvqN9Nzylm3Q== - dependencies: - bindings "^1.5.0" - inherits "^2.0.4" - nan "^2.14.0" - safe-buffer "^5.2.0" - -keyv@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/keyv/-/keyv-3.1.0.tgz#ecc228486f69991e49e9476485a5be1e8fc5c4d9" - integrity sha512-9ykJ/46SN/9KPM/sichzQ7OvXyGDYKGTaDlKMGCAlg2UK8KRy4jb0d8sFc+0Tt0YYnThq8X2RZgCg74RPxgcVA== - dependencies: - json-buffer "3.0.0" - -kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: - version "3.2.2" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" - integrity sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ= - dependencies: - is-buffer "^1.1.5" - -kind-of@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" - integrity sha1-IIE989cSkosgc3hpGkUGb65y3Vc= - dependencies: - is-buffer "^1.1.5" - -kind-of@^5.0.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" - integrity sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw== - -kind-of@^6.0.0, kind-of@^6.0.2: - version "6.0.3" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" - integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== - -klaw-sync@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/klaw-sync/-/klaw-sync-6.0.0.tgz#1fd2cfd56ebb6250181114f0a581167099c2b28c" - integrity sha512-nIeuVSzdCCs6TDPTqI8w1Yre34sSq7AkZ4B3sfOBbI2CgVSB4Du4aLQijFU2+lhAFCwt9+42Hel6lQNIv6AntQ== - dependencies: - graceful-fs "^4.1.11" - -klaw@^1.0.0: - version "1.3.1" - resolved "https://registry.yarnpkg.com/klaw/-/klaw-1.3.1.tgz#4088433b46b3b1ba259d78785d8e96f73ba02439" - integrity sha1-QIhDO0azsbolnXh4XY6W9zugJDk= - optionalDependencies: - graceful-fs "^4.1.9" - -kuler@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/kuler/-/kuler-2.0.0.tgz#e2c570a3800388fb44407e851531c1d670b061b3" - integrity sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A== - -lcid@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" - integrity sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU= - dependencies: - invert-kv "^1.0.0" - -lcid@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/lcid/-/lcid-2.0.0.tgz#6ef5d2df60e52f82eb228a4c373e8d1f397253cf" - integrity sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA== - dependencies: - invert-kv "^2.0.0" - -level-codec@^9.0.0: - version "9.0.2" - resolved "https://registry.yarnpkg.com/level-codec/-/level-codec-9.0.2.tgz#fd60df8c64786a80d44e63423096ffead63d8cbc" - integrity sha512-UyIwNb1lJBChJnGfjmO0OR+ezh2iVu1Kas3nvBS/BzGnx79dv6g7unpKIDNPMhfdTEGoc7mC8uAu51XEtX+FHQ== - dependencies: - buffer "^5.6.0" - -level-codec@~7.0.0: - version "7.0.1" - resolved "https://registry.yarnpkg.com/level-codec/-/level-codec-7.0.1.tgz#341f22f907ce0f16763f24bddd681e395a0fb8a7" - integrity sha512-Ua/R9B9r3RasXdRmOtd+t9TCOEIIlts+TN/7XTT2unhDaL6sJn83S3rUyljbr6lVtw49N3/yA0HHjpV6Kzb2aQ== - -level-concat-iterator@~2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/level-concat-iterator/-/level-concat-iterator-2.0.1.tgz#1d1009cf108340252cb38c51f9727311193e6263" - integrity sha512-OTKKOqeav2QWcERMJR7IS9CUo1sHnke2C0gkSmcR7QuEtFNLLzHQAvnMw8ykvEcv0Qtkg0p7FOwP1v9e5Smdcw== - -level-errors@^1.0.3: - version "1.1.2" - resolved "https://registry.yarnpkg.com/level-errors/-/level-errors-1.1.2.tgz#4399c2f3d3ab87d0625f7e3676e2d807deff404d" - integrity sha512-Sw/IJwWbPKF5Ai4Wz60B52yj0zYeqzObLh8k1Tk88jVmD51cJSKWSYpRyhVIvFzZdvsPqlH5wfhp/yxdsaQH4w== - dependencies: - errno "~0.1.1" - -level-errors@^2.0.0, level-errors@~2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/level-errors/-/level-errors-2.0.1.tgz#2132a677bf4e679ce029f517c2f17432800c05c8" - integrity sha512-UVprBJXite4gPS+3VznfgDSU8PTRuVX0NXwoWW50KLxd2yw4Y1t2JUR5In1itQnudZqRMT9DlAM3Q//9NCjCFw== - dependencies: - errno "~0.1.1" - -level-errors@~1.0.3: - version "1.0.5" - resolved "https://registry.yarnpkg.com/level-errors/-/level-errors-1.0.5.tgz#83dbfb12f0b8a2516bdc9a31c4876038e227b859" - integrity sha512-/cLUpQduF6bNrWuAC4pwtUKA5t669pCsCi2XbmojG2tFeOr9j6ShtdDCtFFQO1DRt+EVZhx9gPzP9G2bUaG4ig== - dependencies: - errno "~0.1.1" - -level-iterator-stream@^2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/level-iterator-stream/-/level-iterator-stream-2.0.3.tgz#ccfff7c046dcf47955ae9a86f46dfa06a31688b4" - integrity sha512-I6Heg70nfF+e5Y3/qfthJFexhRw/Gi3bIymCoXAlijZdAcLaPuWSJs3KXyTYf23ID6g0o2QF62Yh+grOXY3Rig== - dependencies: - inherits "^2.0.1" - readable-stream "^2.0.5" - xtend "^4.0.0" - -level-iterator-stream@~1.3.0: - version "1.3.1" - resolved "https://registry.yarnpkg.com/level-iterator-stream/-/level-iterator-stream-1.3.1.tgz#e43b78b1a8143e6fa97a4f485eb8ea530352f2ed" - integrity sha1-5Dt4sagUPm+pek9IXrjqUwNS8u0= - dependencies: - inherits "^2.0.1" - level-errors "^1.0.3" - readable-stream "^1.0.33" - xtend "^4.0.0" - -level-iterator-stream@~3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/level-iterator-stream/-/level-iterator-stream-3.0.1.tgz#2c98a4f8820d87cdacab3132506815419077c730" - integrity sha512-nEIQvxEED9yRThxvOrq8Aqziy4EGzrxSZK+QzEFAVuJvQ8glfyZ96GB6BoI4sBbLfjMXm2w4vu3Tkcm9obcY0g== - dependencies: - inherits "^2.0.1" - readable-stream "^2.3.6" - xtend "^4.0.0" - -level-iterator-stream@~4.0.0: - version "4.0.2" - resolved "https://registry.yarnpkg.com/level-iterator-stream/-/level-iterator-stream-4.0.2.tgz#7ceba69b713b0d7e22fcc0d1f128ccdc8a24f79c" - integrity sha512-ZSthfEqzGSOMWoUGhTXdX9jv26d32XJuHz/5YnuHZzH6wldfWMOVwI9TBtKcya4BKTyTt3XVA0A3cF3q5CY30Q== - dependencies: - inherits "^2.0.4" - readable-stream "^3.4.0" - xtend "^4.0.2" - -level-mem@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/level-mem/-/level-mem-3.0.1.tgz#7ce8cf256eac40f716eb6489654726247f5a89e5" - integrity sha512-LbtfK9+3Ug1UmvvhR2DqLqXiPW1OJ5jEh0a3m9ZgAipiwpSxGj/qaVVy54RG5vAQN1nCuXqjvprCuKSCxcJHBg== - dependencies: - level-packager "~4.0.0" - memdown "~3.0.0" - -level-mem@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/level-mem/-/level-mem-5.0.1.tgz#c345126b74f5b8aa376dc77d36813a177ef8251d" - integrity sha512-qd+qUJHXsGSFoHTziptAKXoLX87QjR7v2KMbqncDXPxQuCdsQlzmyX+gwrEHhlzn08vkf8TyipYyMmiC6Gobzg== - dependencies: - level-packager "^5.0.3" - memdown "^5.0.0" - -level-packager@^5.0.3: - version "5.1.1" - resolved "https://registry.yarnpkg.com/level-packager/-/level-packager-5.1.1.tgz#323ec842d6babe7336f70299c14df2e329c18939" - integrity sha512-HMwMaQPlTC1IlcwT3+swhqf/NUO+ZhXVz6TY1zZIIZlIR0YSn8GtAAWmIvKjNY16ZkEg/JcpAuQskxsXqC0yOQ== - dependencies: - encoding-down "^6.3.0" - levelup "^4.3.2" - -level-packager@~4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/level-packager/-/level-packager-4.0.1.tgz#7e7d3016af005be0869bc5fa8de93d2a7f56ffe6" - integrity sha512-svCRKfYLn9/4CoFfi+d8krOtrp6RoX8+xm0Na5cgXMqSyRru0AnDYdLl+YI8u1FyS6gGZ94ILLZDE5dh2but3Q== - dependencies: - encoding-down "~5.0.0" - levelup "^3.0.0" - -level-post@^1.0.7: - version "1.0.7" - resolved "https://registry.yarnpkg.com/level-post/-/level-post-1.0.7.tgz#19ccca9441a7cc527879a0635000f06d5e8f27d0" - integrity sha512-PWYqG4Q00asOrLhX7BejSajByB4EmG2GaKHfj3h5UmmZ2duciXLPGYWIjBzLECFWUGOZWlm5B20h/n3Gs3HKew== - dependencies: - ltgt "^2.1.2" - -level-sublevel@6.6.4: - version "6.6.4" - resolved "https://registry.yarnpkg.com/level-sublevel/-/level-sublevel-6.6.4.tgz#f7844ae893919cd9d69ae19d7159499afd5352ba" - integrity sha512-pcCrTUOiO48+Kp6F1+UAzF/OtWqLcQVTVF39HLdZ3RO8XBoXt+XVPKZO1vVr1aUoxHZA9OtD2e1v7G+3S5KFDA== - dependencies: - bytewise "~1.1.0" - level-codec "^9.0.0" - level-errors "^2.0.0" - level-iterator-stream "^2.0.3" - ltgt "~2.1.1" - pull-defer "^0.2.2" - pull-level "^2.0.3" - pull-stream "^3.6.8" - typewiselite "~1.0.0" - xtend "~4.0.0" - -level-supports@~1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/level-supports/-/level-supports-1.0.1.tgz#2f530a596834c7301622521988e2c36bb77d122d" - integrity sha512-rXM7GYnW8gsl1vedTJIbzOrRv85c/2uCMpiiCzO2fndd06U/kUXEEU9evYn4zFggBOg36IsBW8LzqIpETwwQzg== - dependencies: - xtend "^4.0.2" - -level-ws@0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/level-ws/-/level-ws-0.0.0.tgz#372e512177924a00424b0b43aef2bb42496d228b" - integrity sha1-Ny5RIXeSSgBCSwtDrvK7QkltIos= - dependencies: - readable-stream "~1.0.15" - xtend "~2.1.1" - -level-ws@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/level-ws/-/level-ws-1.0.0.tgz#19a22d2d4ac57b18cc7c6ecc4bd23d899d8f603b" - integrity sha512-RXEfCmkd6WWFlArh3X8ONvQPm8jNpfA0s/36M4QzLqrLEIt1iJE9WBHLZ5vZJK6haMjJPJGJCQWfjMNnRcq/9Q== - dependencies: - inherits "^2.0.3" - readable-stream "^2.2.8" - xtend "^4.0.1" - -level-ws@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/level-ws/-/level-ws-2.0.0.tgz#207a07bcd0164a0ec5d62c304b4615c54436d339" - integrity sha512-1iv7VXx0G9ec1isqQZ7y5LmoZo/ewAsyDHNA8EFDW5hqH2Kqovm33nSFkSdnLLAK+I5FlT+lo5Cw9itGe+CpQA== - dependencies: - inherits "^2.0.3" - readable-stream "^3.1.0" - xtend "^4.0.1" - -levelup@3.1.1, levelup@^3.0.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/levelup/-/levelup-3.1.1.tgz#c2c0b3be2b4dc316647c53b42e2f559e232d2189" - integrity sha512-9N10xRkUU4dShSRRFTBdNaBxofz+PGaIZO962ckboJZiNmLuhVT6FZ6ZKAsICKfUBO76ySaYU6fJWX/jnj3Lcg== - dependencies: - deferred-leveldown "~4.0.0" - level-errors "~2.0.0" - level-iterator-stream "~3.0.0" - xtend "~4.0.0" - -levelup@^1.2.1: - version "1.3.9" - resolved "https://registry.yarnpkg.com/levelup/-/levelup-1.3.9.tgz#2dbcae845b2bb2b6bea84df334c475533bbd82ab" - integrity sha512-VVGHfKIlmw8w1XqpGOAGwq6sZm2WwWLmlDcULkKWQXEA5EopA8OBNJ2Ck2v6bdk8HeEZSbCSEgzXadyQFm76sQ== - dependencies: - deferred-leveldown "~1.2.1" - level-codec "~7.0.0" - level-errors "~1.0.3" - level-iterator-stream "~1.3.0" - prr "~1.0.1" - semver "~5.4.1" - xtend "~4.0.0" - -levelup@^4.3.2: - version "4.4.0" - resolved "https://registry.yarnpkg.com/levelup/-/levelup-4.4.0.tgz#f89da3a228c38deb49c48f88a70fb71f01cafed6" - integrity sha512-94++VFO3qN95cM/d6eBXvd894oJE0w3cInq9USsyQzzoJxmiYzPAocNcuGCPGGjoXqDVJcr3C1jzt1TSjyaiLQ== - dependencies: - deferred-leveldown "~5.3.0" - level-errors "~2.0.0" - level-iterator-stream "~4.0.0" - level-supports "~1.0.0" - xtend "~4.0.0" - -levn@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/levn/-/levn-0.4.1.tgz#ae4562c007473b932a6200d403268dd2fffc6ade" - integrity sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ== - dependencies: - prelude-ls "^1.2.1" - type-check "~0.4.0" - -levn@~0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" - integrity sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4= - dependencies: - prelude-ls "~1.1.2" - type-check "~0.3.2" - -lines-and-columns@^1.1.6: - version "1.1.6" - resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.1.6.tgz#1c00c743b433cd0a4e80758f7b64a57440d9ff00" - integrity sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA= - -lint-staged@^10.5.4: - version "10.5.4" - resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-10.5.4.tgz#cd153b5f0987d2371fc1d2847a409a2fe705b665" - integrity sha512-EechC3DdFic/TdOPgj/RB3FicqE6932LTHCUm0Y2fsD9KGlLB+RwJl2q1IYBIvEsKzDOgn0D4gll+YxG5RsrKg== - dependencies: - chalk "^4.1.0" - cli-truncate "^2.1.0" - commander "^6.2.0" - cosmiconfig "^7.0.0" - debug "^4.2.0" - dedent "^0.7.0" - enquirer "^2.3.6" - execa "^4.1.0" - listr2 "^3.2.2" - log-symbols "^4.0.0" - micromatch "^4.0.2" - normalize-path "^3.0.0" - please-upgrade-node "^3.2.0" - string-argv "0.3.1" - stringify-object "^3.3.0" - -listr2@^3.2.2: - version "3.9.0" - resolved "https://registry.yarnpkg.com/listr2/-/listr2-3.9.0.tgz#27f23c91ba4fdf513b0682bf604bc6b0ab36b6c1" - integrity sha512-+JxQt7Vi4WEWgJsxmOEX9lDbCumrb3mrEYIeE1VI7I4lf2rXE4v9pq3RMVNp+a9s6mCgc/IsF0ppHsLrx2BEAw== - dependencies: - cli-truncate "^2.1.0" - colorette "^1.2.2" - log-update "^4.0.0" - p-map "^4.0.0" - rxjs "^6.6.7" - through "^2.3.8" - wrap-ansi "^7.0.0" - -load-json-file@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0" - integrity sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA= - dependencies: - graceful-fs "^4.1.2" - parse-json "^2.2.0" - pify "^2.0.0" - pinkie-promise "^2.0.0" - strip-bom "^2.0.0" - -load-json-file@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-4.0.0.tgz#2f5f45ab91e33216234fd53adab668eb4ec0993b" - integrity sha1-L19Fq5HjMhYjT9U62rZo607AmTs= - dependencies: - graceful-fs "^4.1.2" - parse-json "^4.0.0" - pify "^3.0.0" - strip-bom "^3.0.0" - -locate-path@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" - integrity sha1-K1aLJl7slExtnA3pw9u7ygNUzY4= - dependencies: - p-locate "^2.0.0" - path-exists "^3.0.0" - -locate-path@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-3.0.0.tgz#dbec3b3ab759758071b58fe59fc41871af21400e" - integrity sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A== - dependencies: - p-locate "^3.0.0" - path-exists "^3.0.0" - -locate-path@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" - integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== - dependencies: - p-locate "^5.0.0" - -lodash.assign@^4.0.3, lodash.assign@^4.0.6: - version "4.2.0" - resolved "https://registry.yarnpkg.com/lodash.assign/-/lodash.assign-4.2.0.tgz#0d99f3ccd7a6d261d19bdaeb9245005d285808e7" - integrity sha1-DZnzzNem0mHRm9rrkkUAXShYCOc= - -lodash.clonedeep@^4.5.0: - version "4.5.0" - resolved "https://registry.yarnpkg.com/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef" - integrity sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8= - -lodash.merge@^4.6.2: - version "4.6.2" - resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" - integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== - -lodash.toarray@^4.4.0: - version "4.4.0" - resolved "https://registry.yarnpkg.com/lodash.toarray/-/lodash.toarray-4.4.0.tgz#24c4bfcd6b2fba38bfd0594db1179d8e9b656561" - integrity sha1-JMS/zWsvuji/0FlNsRedjptlZWE= - -lodash.truncate@^4.4.2: - version "4.4.2" - resolved "https://registry.yarnpkg.com/lodash.truncate/-/lodash.truncate-4.4.2.tgz#5a350da0b1113b837ecfffd5812cbe58d6eae193" - integrity sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM= - -lodash@4.17.20: - version "4.17.20" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52" - integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA== - -lodash@^4.14.2, lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.21, lodash@^4.17.4: - version "4.17.21" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" - integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== - -log-symbols@3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-3.0.0.tgz#f3a08516a5dea893336a7dee14d18a1cfdab77c4" - integrity sha512-dSkNGuI7iG3mfvDzUuYZyvk5dD9ocYCYzNU6CYDE6+Xqd+gwme6Z00NS3dUh8mq/73HaEtT7m6W+yUPtU6BZnQ== - dependencies: - chalk "^2.4.2" - -log-symbols@^4.0.0, log-symbols@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-4.1.0.tgz#3fbdbb95b4683ac9fc785111e792e558d4abd503" - integrity sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg== - dependencies: - chalk "^4.1.0" - is-unicode-supported "^0.1.0" - -log-update@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/log-update/-/log-update-4.0.0.tgz#589ecd352471f2a1c0c570287543a64dfd20e0a1" - integrity sha512-9fkkDevMefjg0mmzWFBW8YkFP91OrizzkW3diF7CpG+S2EYdy4+TVfGwz1zeF8x7hCx1ovSPTOE9Ngib74qqUg== - dependencies: - ansi-escapes "^4.3.0" - cli-cursor "^3.1.0" - slice-ansi "^4.0.0" - wrap-ansi "^6.2.0" - -logform@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/logform/-/logform-2.2.0.tgz#40f036d19161fc76b68ab50fdc7fe495544492f2" - integrity sha512-N0qPlqfypFx7UHNn4B3lzS/b0uLqt2hmuoa+PpuXNYgozdJYAyauF5Ky0BWVjrxDlMWiT3qN4zPq3vVAfZy7Yg== - dependencies: - colors "^1.2.1" - fast-safe-stringify "^2.0.4" - fecha "^4.2.0" - ms "^2.1.1" - triple-beam "^1.3.0" - -looper@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/looper/-/looper-2.0.0.tgz#66cd0c774af3d4fedac53794f742db56da8f09ec" - integrity sha1-Zs0Md0rz1P7axTeU90LbVtqPCew= - -looper@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/looper/-/looper-3.0.0.tgz#2efa54c3b1cbaba9b94aee2e5914b0be57fbb749" - integrity sha1-LvpUw7HLq6m5Su4uWRSwvlf7t0k= - -loose-envify@^1.0.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" - integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== - dependencies: - js-tokens "^3.0.0 || ^4.0.0" - -lowercase-keys@^1.0.0, lowercase-keys@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.1.tgz#6f9e30b47084d971a7c820ff15a6c5167b74c26f" - integrity sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA== - -lowercase-keys@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-2.0.0.tgz#2603e78b7b4b0006cbca2fbcc8a3202558ac9479" - integrity sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA== - -lru-cache@5.1.1, lru-cache@^5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920" - integrity sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w== - dependencies: - yallist "^3.0.2" - -lru-cache@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-3.2.0.tgz#71789b3b7f5399bec8565dda38aa30d2a097efee" - integrity sha1-cXibO39Tmb7IVl3aOKow0qCX7+4= - dependencies: - pseudomap "^1.0.1" - -lru-cache@^4.0.1: - version "4.1.5" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.5.tgz#8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd" - integrity sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g== - dependencies: - pseudomap "^1.0.2" - yallist "^2.1.2" - -lru-cache@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" - integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== - dependencies: - yallist "^4.0.0" - -lru_map@^0.3.3: - version "0.3.3" - resolved "https://registry.yarnpkg.com/lru_map/-/lru_map-0.3.3.tgz#b5c8351b9464cbd750335a79650a0ec0e56118dd" - integrity sha1-tcg1G5Rky9dQM1p5ZQoOwOVhGN0= - -ltgt@^2.1.2, ltgt@~2.2.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/ltgt/-/ltgt-2.2.1.tgz#f35ca91c493f7b73da0e07495304f17b31f87ee5" - integrity sha1-81ypHEk/e3PaDgdJUwTxezH4fuU= - -ltgt@~2.1.1: - version "2.1.3" - resolved "https://registry.yarnpkg.com/ltgt/-/ltgt-2.1.3.tgz#10851a06d9964b971178441c23c9e52698eece34" - integrity sha1-EIUaBtmWS5cReEQcI8nlJpjuzjQ= - -make-error@^1.1.1: - version "1.3.6" - resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" - integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== - -map-age-cleaner@^0.1.1: - version "0.1.3" - resolved "https://registry.yarnpkg.com/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz#7d583a7306434c055fe474b0f45078e6e1b4b92a" - integrity sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w== - dependencies: - p-defer "^1.0.0" - -map-cache@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" - integrity sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8= - -map-visit@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f" - integrity sha1-7Nyo8TFE5mDxtb1B8S80edmN+48= - dependencies: - object-visit "^1.0.0" - -markdown-table@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/markdown-table/-/markdown-table-1.1.3.tgz#9fcb69bcfdb8717bfd0398c6ec2d93036ef8de60" - integrity sha512-1RUZVgQlpJSPWYbFSpmudq5nHY1doEIv89gBtF0s4gW1GF2XorxcA/70M5vq7rLv0a6mhOUccRsqkwhwLCIQ2Q== - -math-random@^1.0.1: - version "1.0.4" - resolved "https://registry.yarnpkg.com/math-random/-/math-random-1.0.4.tgz#5dd6943c938548267016d4e34f057583080c514c" - integrity sha512-rUxjysqif/BZQH2yhd5Aaq7vXMSx9NdEsQcyA07uEzIvxgI7zIr33gGsh+RU0/XjmQpCW7RsVof1vlkvQVCK5A== - -mcl-wasm@^0.7.1: - version "0.7.7" - resolved "https://registry.yarnpkg.com/mcl-wasm/-/mcl-wasm-0.7.7.tgz#fd463dd1641a37f9f55b6ca8e5a38e95be2bc58f" - integrity sha512-jDGiCQA++5hX37gdH6RDZ3ZsA0raet7xyY/R5itj5cbcdf4Gvw+YyxWX/ZZ0Z2UPxJiw1ktRsCJZzpnqlQILdw== - -md5.js@^1.3.4: - version "1.3.5" - resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f" - integrity sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg== - dependencies: - hash-base "^3.0.0" - inherits "^2.0.1" - safe-buffer "^5.1.2" - -media-typer@0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" - integrity sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g= - -mem@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/mem/-/mem-1.1.0.tgz#5edd52b485ca1d900fe64895505399a0dfa45f76" - integrity sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y= - dependencies: - mimic-fn "^1.0.0" - -mem@^4.0.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/mem/-/mem-4.3.0.tgz#461af497bc4ae09608cdb2e60eefb69bff744178" - integrity sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w== - dependencies: - map-age-cleaner "^0.1.1" - mimic-fn "^2.0.0" - p-is-promise "^2.0.0" - -memdown@^1.0.0: - version "1.4.1" - resolved "https://registry.yarnpkg.com/memdown/-/memdown-1.4.1.tgz#b4e4e192174664ffbae41361aa500f3119efe215" - integrity sha1-tOThkhdGZP+65BNhqlAPMRnv4hU= - dependencies: - abstract-leveldown "~2.7.1" - functional-red-black-tree "^1.0.1" - immediate "^3.2.3" - inherits "~2.0.1" - ltgt "~2.2.0" - safe-buffer "~5.1.1" - -memdown@^5.0.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/memdown/-/memdown-5.1.0.tgz#608e91a9f10f37f5b5fe767667a8674129a833cb" - integrity sha512-B3J+UizMRAlEArDjWHTMmadet+UKwHd3UjMgGBkZcKAxAYVPS9o0Yeiha4qvz7iGiL2Sb3igUft6p7nbFWctpw== - dependencies: - abstract-leveldown "~6.2.1" - functional-red-black-tree "~1.0.1" - immediate "~3.2.3" - inherits "~2.0.1" - ltgt "~2.2.0" - safe-buffer "~5.2.0" - -memdown@~3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/memdown/-/memdown-3.0.0.tgz#93aca055d743b20efc37492e9e399784f2958309" - integrity sha512-tbV02LfZMWLcHcq4tw++NuqMO+FZX8tNJEiD2aNRm48ZZusVg5N8NART+dmBkepJVye986oixErf7jfXboMGMA== - dependencies: - abstract-leveldown "~5.0.0" - functional-red-black-tree "~1.0.1" - immediate "~3.2.3" - inherits "~2.0.1" - ltgt "~2.2.0" - safe-buffer "~5.1.1" - -memorystream@^0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/memorystream/-/memorystream-0.3.1.tgz#86d7090b30ce455d63fbae12dda51a47ddcaf9b2" - integrity sha1-htcJCzDORV1j+64S3aUaR93K+bI= - -merge-descriptors@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" - integrity sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E= - -merge-options@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/merge-options/-/merge-options-2.0.0.tgz#36ca5038badfc3974dbde5e58ba89d3df80882c3" - integrity sha512-S7xYIeWHl2ZUKF7SDeBhGg6rfv5bKxVBdk95s/I7wVF8d+hjLSztJ/B271cnUiF6CAFduEQ5Zn3HYwAjT16DlQ== - dependencies: - is-plain-obj "^2.0.0" - -merge-stream@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" - integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== - -merge2@^1.2.3, merge2@^1.3.0: - version "1.4.1" - resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" - integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== - -merkle-patricia-tree@3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/merkle-patricia-tree/-/merkle-patricia-tree-3.0.0.tgz#448d85415565df72febc33ca362b8b614f5a58f8" - integrity sha512-soRaMuNf/ILmw3KWbybaCjhx86EYeBbD8ph0edQCTed0JN/rxDt1EBN52Ajre3VyGo+91f8+/rfPIRQnnGMqmQ== - dependencies: - async "^2.6.1" - ethereumjs-util "^5.2.0" - level-mem "^3.0.1" - level-ws "^1.0.0" - readable-stream "^3.0.6" - rlp "^2.0.0" - semaphore ">=1.0.1" - -merkle-patricia-tree@^2.1.2, merkle-patricia-tree@^2.3.2: - version "2.3.2" - resolved "https://registry.yarnpkg.com/merkle-patricia-tree/-/merkle-patricia-tree-2.3.2.tgz#982ca1b5a0fde00eed2f6aeed1f9152860b8208a" - integrity sha512-81PW5m8oz/pz3GvsAwbauj7Y00rqm81Tzad77tHBwU7pIAtN+TJnMSOJhxBKflSVYhptMMb9RskhqHqrSm1V+g== - dependencies: - async "^1.4.2" - ethereumjs-util "^5.0.0" - level-ws "0.0.0" - levelup "^1.2.1" - memdown "^1.0.0" - readable-stream "^2.0.0" - rlp "^2.0.0" - semaphore ">=1.0.1" - -merkle-patricia-tree@^4.1.0, merkle-patricia-tree@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/merkle-patricia-tree/-/merkle-patricia-tree-4.2.0.tgz#a204b9041be5c25e8d14f0ff47021de090e811a1" - integrity sha512-0sBVXs7z1Q1/kxzWZ3nPnxSPiaHKF/f497UQzt9O7isRcS10tel9jM/4TivF6Jv7V1yFq4bWyoATxbDUOen5vQ== - dependencies: - "@types/levelup" "^4.3.0" - ethereumjs-util "^7.0.10" - level-mem "^5.0.1" - level-ws "^2.0.0" - readable-stream "^3.6.0" - rlp "^2.2.4" - semaphore-async-await "^1.5.1" - -methods@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" - integrity sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4= - -micromatch@^2.1.5: - version "2.3.11" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" - integrity sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU= - dependencies: - arr-diff "^2.0.0" - array-unique "^0.2.1" - braces "^1.8.2" - expand-brackets "^0.1.4" - extglob "^0.3.1" - filename-regex "^2.0.0" - is-extglob "^1.0.0" - is-glob "^2.0.1" - kind-of "^3.0.2" - normalize-path "^2.0.1" - object.omit "^2.0.0" - parse-glob "^3.0.4" - regex-cache "^0.4.2" - -micromatch@^3.1.10, micromatch@^3.1.4: - version "3.1.10" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" - integrity sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg== - dependencies: - arr-diff "^4.0.0" - array-unique "^0.3.2" - braces "^2.3.1" - define-property "^2.0.2" - extend-shallow "^3.0.2" - extglob "^2.0.4" - fragment-cache "^0.2.1" - kind-of "^6.0.2" - nanomatch "^1.2.9" - object.pick "^1.3.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.2" - -micromatch@^4.0.2: - version "4.0.4" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.4.tgz#896d519dfe9db25fce94ceb7a500919bf881ebf9" - integrity sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg== - dependencies: - braces "^3.0.1" - picomatch "^2.2.3" - -miller-rabin@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/miller-rabin/-/miller-rabin-4.0.1.tgz#f080351c865b0dc562a8462966daa53543c78a4d" - integrity sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA== - dependencies: - bn.js "^4.0.0" - brorand "^1.0.1" - -mime-db@1.47.0: - version "1.47.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.47.0.tgz#8cb313e59965d3c05cfbf898915a267af46a335c" - integrity sha512-QBmA/G2y+IfeS4oktet3qRZ+P5kPhCKRXxXnQEudYqUaEioAU1/Lq2us3D/t1Jfo4hE9REQPrbB7K5sOczJVIw== - -mime-types@^2.1.12, mime-types@^2.1.16, mime-types@~2.1.19, mime-types@~2.1.24: - version "2.1.30" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.30.tgz#6e7be8b4c479825f85ed6326695db73f9305d62d" - integrity sha512-crmjA4bLtR8m9qLpHvgxSChT+XoSlZi8J4n/aIdn3z92e/U47Z0V/yl+Wh9W046GgFVAmoNR/fmdbZYcSSIUeg== - dependencies: - mime-db "1.47.0" - -mime@1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" - integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg== - -mimic-fn@^1.0.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" - integrity sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ== - -mimic-fn@^2.0.0, mimic-fn@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" - integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== - -mimic-response@^1.0.0, mimic-response@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b" - integrity sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ== - -min-document@^2.19.0: - version "2.19.0" - resolved "https://registry.yarnpkg.com/min-document/-/min-document-2.19.0.tgz#7bd282e3f5842ed295bb748cdd9f1ffa2c824685" - integrity sha1-e9KC4/WELtKVu3SM3Z8f+iyCRoU= - dependencies: - dom-walk "^0.1.0" - -minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" - integrity sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A== - -minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" - integrity sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo= - -minimatch@*, "minimatch@2 || 3", minimatch@3.0.4, minimatch@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" - integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== - dependencies: - brace-expansion "^1.1.7" - -minimist@0.0.8: - version "0.0.8" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" - integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= - -minimist@^1.2.0, minimist@^1.2.5, minimist@~1.2.5: - version "1.2.5" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" - integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== - -minipass@^2.6.0, minipass@^2.8.6, minipass@^2.9.0: - version "2.9.0" - resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.9.0.tgz#e713762e7d3e32fed803115cf93e04bca9fcc9a6" - integrity sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg== - dependencies: - safe-buffer "^5.1.2" - yallist "^3.0.0" - -minizlib@^1.2.1: - version "1.3.3" - resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.3.3.tgz#2290de96818a34c29551c8a8d301216bd65a861d" - integrity sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q== - dependencies: - minipass "^2.9.0" - -mixin-deep@^1.2.0: - version "1.3.2" - resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.2.tgz#1120b43dc359a785dce65b55b82e257ccf479566" - integrity sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA== - dependencies: - for-in "^1.0.2" - is-extendable "^1.0.1" - -mkdirp-promise@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/mkdirp-promise/-/mkdirp-promise-5.0.1.tgz#e9b8f68e552c68a9c1713b84883f7a1dd039b8a1" - integrity sha1-6bj2jlUsaKnBcTuEiD96HdA5uKE= - dependencies: - mkdirp "*" - -mkdirp@*: - version "1.0.4" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" - integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== - -mkdirp@0.5.1: - version "0.5.1" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" - integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM= - dependencies: - minimist "0.0.8" - -mkdirp@0.5.5, mkdirp@0.5.x, mkdirp@^0.5.0, mkdirp@^0.5.1: - version "0.5.5" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def" - integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ== - dependencies: - minimist "^1.2.5" - -mnemonist@^0.38.0: - version "0.38.3" - resolved "https://registry.yarnpkg.com/mnemonist/-/mnemonist-0.38.3.tgz#35ec79c1c1f4357cfda2fe264659c2775ccd7d9d" - integrity sha512-2K9QYubXx/NAjv4VLq1d1Ly8pWNC5L3BrixtdkyTegXWJIqY+zLNDhhX/A+ZwWt70tB1S8H4BE8FLYEFyNoOBw== - dependencies: - obliterator "^1.6.1" - -mocha@^4.0.1: - version "4.1.0" - resolved "https://registry.yarnpkg.com/mocha/-/mocha-4.1.0.tgz#7d86cfbcf35cb829e2754c32e17355ec05338794" - integrity sha512-0RVnjg1HJsXY2YFDoTNzcc1NKhYuXKRrBAG2gDygmJJA136Cs2QlRliZG1mA0ap7cuaT30mw16luAeln+4RiNA== - dependencies: - browser-stdout "1.3.0" - commander "2.11.0" - debug "3.1.0" - diff "3.3.1" - escape-string-regexp "1.0.5" - glob "7.1.2" - growl "1.10.3" - he "1.1.1" - mkdirp "0.5.1" - supports-color "4.4.0" - -mocha@^7.1.1, mocha@^7.1.2: - version "7.2.0" - resolved "https://registry.yarnpkg.com/mocha/-/mocha-7.2.0.tgz#01cc227b00d875ab1eed03a75106689cfed5a604" - integrity sha512-O9CIypScywTVpNaRrCAgoUnJgozpIofjKUYmJhiCIJMiuYnLI6otcb1/kpW9/n/tJODHGZ7i8aLQoDVsMtOKQQ== - dependencies: - ansi-colors "3.2.3" - browser-stdout "1.3.1" - chokidar "3.3.0" - debug "3.2.6" - diff "3.5.0" - escape-string-regexp "1.0.5" - find-up "3.0.0" - glob "7.1.3" - growl "1.10.5" - he "1.2.0" - js-yaml "3.13.1" - log-symbols "3.0.0" - minimatch "3.0.4" - mkdirp "0.5.5" - ms "2.1.1" - node-environment-flags "1.0.6" - object.assign "4.1.0" - strip-json-comments "2.0.1" - supports-color "6.0.0" - which "1.3.1" - wide-align "1.1.3" - yargs "13.3.2" - yargs-parser "13.1.2" - yargs-unparser "1.6.0" - -mock-fs@^4.1.0: - version "4.14.0" - resolved "https://registry.yarnpkg.com/mock-fs/-/mock-fs-4.14.0.tgz#ce5124d2c601421255985e6e94da80a7357b1b18" - integrity sha512-qYvlv/exQ4+svI3UOvPUpLDF0OMX5euvUH0Ny4N5QyRyhNdgAgUrVH3iUINSzEPLvx0kbo/Bp28GJKIqvE7URw== - -moment-timezone@^0.5.31: - version "0.5.33" - resolved "https://registry.yarnpkg.com/moment-timezone/-/moment-timezone-0.5.33.tgz#b252fd6bb57f341c9b59a5ab61a8e51a73bbd22c" - integrity sha512-PTc2vcT8K9J5/9rDEPe5czSIKgLoGsH8UNpA4qZTVw0Vd/Uz19geE9abbIOQKaAQFcnQ3v5YEXrbSc5BpshH+w== - dependencies: - moment ">= 2.9.0" - -"moment@>= 2.9.0", moment@^2.26.0: - version "2.29.1" - resolved "https://registry.yarnpkg.com/moment/-/moment-2.29.1.tgz#b2be769fa31940be9eeea6469c075e35006fa3d3" - integrity sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ== - -morgan@1.10.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/morgan/-/morgan-1.10.0.tgz#091778abc1fc47cd3509824653dae1faab6b17d7" - integrity sha512-AbegBVI4sh6El+1gNwvD5YIck7nSA36weD7xvIxG4in80j/UoK8AEGaWnnz8v1GxonMCltmlNs5ZKbGvl9b1XQ== - dependencies: - basic-auth "~2.0.1" - debug "2.6.9" - depd "~2.0.0" - on-finished "~2.3.0" - on-headers "~1.0.2" - -ms@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" - integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= - -ms@2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" - integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg== - -ms@2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" - integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== - -ms@^2.1.1: - version "2.1.3" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" - integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== - -multiaddr-to-uri@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/multiaddr-to-uri/-/multiaddr-to-uri-6.0.0.tgz#8f08a75c6eeb2370d5d24b77b8413e3f0fa9bcc0" - integrity sha512-OjpkVHOXEmIKMO8WChzzQ7aZQcSQX8squxmvtDbRpy7/QNmJ3Z7jv6qyD74C28QtaeNie8O8ngW2AkeiMmKP7A== - dependencies: - multiaddr "^8.0.0" - -multiaddr@^8.0.0: - version "8.1.2" - resolved "https://registry.yarnpkg.com/multiaddr/-/multiaddr-8.1.2.tgz#74060ff8636ba1c01b2cf0ffd53950b852fa9b1f" - integrity sha512-r13IzW8+Sv9zab9Gt8RPMIN2WkptIPq99EpAzg4IbJ/zTELhiEwXWr9bAmEatSCI4j/LSA6ESJzvz95JZ+ZYXQ== - dependencies: - cids "^1.0.0" - class-is "^1.1.0" - dns-over-http-resolver "^1.0.0" - err-code "^2.0.3" - is-ip "^3.1.0" - multibase "^3.0.0" - uint8arrays "^1.1.0" - varint "^5.0.0" - -multibase@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/multibase/-/multibase-0.7.0.tgz#1adfc1c50abe05eefeb5091ac0c2728d6b84581b" - integrity sha512-TW8q03O0f6PNFTQDvh3xxH03c8CjGaaYrjkl9UQPG6rz53TQzzxJVCIWVjzcbN/Q5Y53Zd0IBQBMVktVgNx4Fg== - dependencies: - base-x "^3.0.8" - buffer "^5.5.0" - -multibase@^3.0.0, multibase@^3.1.0: - version "3.1.2" - resolved "https://registry.yarnpkg.com/multibase/-/multibase-3.1.2.tgz#59314e1e2c35d018db38e4c20bb79026827f0f2f" - integrity sha512-bpklWHs70LO3smJUHOjcnzGceJJvn9ui0Vau6Za0B/GBepaXswmW8Ufea0uD9pROf/qCQ4N4lZ3sf3U+SNf0tw== - dependencies: - "@multiformats/base-x" "^4.0.1" - web-encoding "^1.0.6" - -multibase@^4.0.1: - version "4.0.4" - resolved "https://registry.yarnpkg.com/multibase/-/multibase-4.0.4.tgz#55ef53e6acce223c5a09341a8a3a3d973871a577" - integrity sha512-8/JmrdSGzlw6KTgAJCOqUBSGd1V6186i/X8dDCGy/lbCKrQ+1QB6f3HE+wPr7Tpdj4U3gutaj9jG2rNX6UpiJg== - dependencies: - "@multiformats/base-x" "^4.0.1" - -multibase@~0.6.0: - version "0.6.1" - resolved "https://registry.yarnpkg.com/multibase/-/multibase-0.6.1.tgz#b76df6298536cc17b9f6a6db53ec88f85f8cc12b" - integrity sha512-pFfAwyTjbbQgNc3G7D48JkJxWtoJoBMaR4xQUOuB8RnCgRqaYmWNFeJTTvrJ2w51bjLq2zTby6Rqj9TQ9elSUw== - dependencies: - base-x "^3.0.8" - buffer "^5.5.0" - -multicodec@^0.5.5: - version "0.5.7" - resolved "https://registry.yarnpkg.com/multicodec/-/multicodec-0.5.7.tgz#1fb3f9dd866a10a55d226e194abba2dcc1ee9ffd" - integrity sha512-PscoRxm3f+88fAtELwUnZxGDkduE2HD9Q6GHUOywQLjOGT/HAdhjLDYNZ1e7VR0s0TP0EwZ16LNUTFpoBGivOA== - dependencies: - varint "^5.0.0" - -multicodec@^1.0.0: - version "1.0.4" - resolved "https://registry.yarnpkg.com/multicodec/-/multicodec-1.0.4.tgz#46ac064657c40380c28367c90304d8ed175a714f" - integrity sha512-NDd7FeS3QamVtbgfvu5h7fd1IlbaC4EQ0/pgU4zqE2vdHCmBGsUa0TiM8/TdSeG6BMPC92OOCf8F1ocE/Wkrrg== - dependencies: - buffer "^5.6.0" - varint "^5.0.0" - -multicodec@^2.0.0: - version "2.1.3" - resolved "https://registry.yarnpkg.com/multicodec/-/multicodec-2.1.3.tgz#b9850635ad4e2a285a933151b55b4a2294152a5d" - integrity sha512-0tOH2Gtio39uO41o+2xl9UhRkCWxU5ZmZSbFCh/OjGzkWJI8e6lkN/s4Mj1YfyWoBod+2+S3W+6wO6nhkwN8pA== - dependencies: - uint8arrays "1.1.0" - varint "^6.0.0" - -multicodec@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/multicodec/-/multicodec-3.0.1.tgz#94e043847ee11fcce92487609ac9010429a95e31" - integrity sha512-Y6j3wiPojvkF/z6KFIGt84KdJdP2oILEdzc/3YbD3qQ3EerhqtYlfsZTPPNVoCCxNZZdzIpCKrdYFSav17sIrQ== - dependencies: - uint8arrays "^2.1.3" - varint "^5.0.2" - -multihashes@^0.4.15, multihashes@~0.4.15: - version "0.4.21" - resolved "https://registry.yarnpkg.com/multihashes/-/multihashes-0.4.21.tgz#dc02d525579f334a7909ade8a122dabb58ccfcb5" - integrity sha512-uVSvmeCWf36pU2nB4/1kzYZjsXD9vofZKpgudqkceYY5g2aZZXJ5r9lxuzoRLl1OAp28XljXsEJ/X/85ZsKmKw== - dependencies: - buffer "^5.5.0" - multibase "^0.7.0" - varint "^5.0.0" - -multihashes@^3.0.1: - version "3.1.2" - resolved "https://registry.yarnpkg.com/multihashes/-/multihashes-3.1.2.tgz#ffa5e50497aceb7911f7b4a3b6cada9b9730edfc" - integrity sha512-AP4IoV/YzkNrfbQKZE3OMPibrmy350OmCd6cJkwyM8oExaXIlOY4UnOOVSQtAEuq/LR01XfXKCESidzZvSwHCQ== - dependencies: - multibase "^3.1.0" - uint8arrays "^2.0.5" - varint "^6.0.0" - -multihashes@^4.0.1: - version "4.0.2" - resolved "https://registry.yarnpkg.com/multihashes/-/multihashes-4.0.2.tgz#d76aeac3a302a1bed9fe1ec964fb7a22fa662283" - integrity sha512-xpx++1iZr4ZQHjN1mcrXS6904R36LWLxX/CBifczjtmrtCXEX623DMWOF1eiNSg+pFpiZDFVBgou/4v6ayCHSQ== - dependencies: - multibase "^4.0.1" - uint8arrays "^2.1.3" - varint "^5.0.2" - -multihashing-async@^2.0.0: - version "2.1.2" - resolved "https://registry.yarnpkg.com/multihashing-async/-/multihashing-async-2.1.2.tgz#9ed68f183bde70e0416b166bbc59a0c0623a0ede" - integrity sha512-FTPNnWWxwIK5dXXmTFhySSF8Fkdqf7vzqpV09+RWsmfUhrsL/b3Arg3+bRrBnXTtjxm3JRGI3wSAtQHL0QCxhQ== - dependencies: - blakejs "^1.1.0" - err-code "^3.0.0" - js-sha3 "^0.8.0" - multihashes "^4.0.1" - murmurhash3js-revisited "^3.0.0" - uint8arrays "^2.1.3" - -murmurhash3js-revisited@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/murmurhash3js-revisited/-/murmurhash3js-revisited-3.0.0.tgz#6bd36e25de8f73394222adc6e41fa3fac08a5869" - integrity sha512-/sF3ee6zvScXMb1XFJ8gDsSnY+X8PbOyjIuBhtgis10W2Jx4ZjIhikUCIF9c4gpJxVnQIsPAFrSwTCuAjicP6g== - -mute-stream@0.0.8: - version "0.0.8" - resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d" - integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA== - -nan@^2.12.1, nan@^2.14.0: - version "2.14.2" - resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.2.tgz#f5376400695168f4cc694ac9393d0c9585eeea19" - integrity sha512-M2ufzIiINKCuDfBSAUr1vWQ+vuVcA9kqx8JJUsbQi6yf1uGRyb7HfpdfUr5qLXf3B/t8dPvcjhKMmlfnP47EzQ== - -nano-json-stream-parser@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/nano-json-stream-parser/-/nano-json-stream-parser-0.1.2.tgz#0cc8f6d0e2b622b479c40d499c46d64b755c6f5f" - integrity sha1-DMj20OK2IrR5xA1JnEbWS3Vcb18= - -nanoid@^3.0.2, nanoid@^3.1.3: - version "3.1.23" - resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.23.tgz#f744086ce7c2bc47ee0a8472574d5c78e4183a81" - integrity sha512-FiB0kzdP0FFVGDKlRLEQ1BgDzU87dy5NnzjeW9YZNt+/c3+q82EQDUwniSAUxp/F0gFNI1ZhKU1FqYsMuqZVnw== - -nanomatch@^1.2.9: - version "1.2.13" - resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" - integrity sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA== - dependencies: - arr-diff "^4.0.0" - array-unique "^0.3.2" - define-property "^2.0.2" - extend-shallow "^3.0.2" - fragment-cache "^0.2.1" - is-windows "^1.0.2" - kind-of "^6.0.2" - object.pick "^1.3.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - -native-fetch@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/native-fetch/-/native-fetch-3.0.0.tgz#06ccdd70e79e171c365c75117959cf4fe14a09bb" - integrity sha512-G3Z7vx0IFb/FQ4JxvtqGABsOTIqRWvgQz6e+erkB+JJD6LrszQtMozEHI4EkmgZQvnGHrpLVzUWk7t4sJCIkVw== - -natural-compare@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" - integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= - -negotiator@0.6.2: - version "0.6.2" - resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb" - integrity sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw== - -neo-async@^2.6.0: - version "2.6.2" - resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.2.tgz#b4aafb93e3aeb2d8174ca53cf163ab7d7308305f" - integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw== - -next-tick@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-1.0.0.tgz#ca86d1fe8828169b0120208e3dc8424b9db8342c" - integrity sha1-yobR/ogoFpsBICCOPchCS524NCw= - -ngeohash@0.6.3: - version "0.6.3" - resolved "https://registry.yarnpkg.com/ngeohash/-/ngeohash-0.6.3.tgz#10b1e80be5488262ec95c56cf2dbb6c45fbdf245" - integrity sha512-kltF0cOxgx1AbmVzKxYZaoB0aj7mOxZeHaerEtQV0YaqnkXNq26WWqMmJ6lTqShYxVRWZ/mwvvTrNeOwdslWiw== - -nice-try@^1.0.4: - version "1.0.5" - resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" - integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== - -node-addon-api@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-2.0.2.tgz#432cfa82962ce494b132e9d72a15b29f71ff5d32" - integrity sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA== - -node-emoji@^1.10.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/node-emoji/-/node-emoji-1.10.0.tgz#8886abd25d9c7bb61802a658523d1f8d2a89b2da" - integrity sha512-Yt3384If5H6BYGVHiHwTL+99OzJKHhgp82S8/dktEK73T26BazdgZ4JZh92xSVtGNJvz9UbXdNAc5hcrXV42vw== - dependencies: - lodash.toarray "^4.4.0" - -node-environment-flags@1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/node-environment-flags/-/node-environment-flags-1.0.6.tgz#a30ac13621f6f7d674260a54dede048c3982c088" - integrity sha512-5Evy2epuL+6TM0lCQGpFIj6KwiEsGh1SrHUhTbNX+sLbBtjidPZFAnVK9y5yU1+h//RitLbRHTIMyxQPtxMdHw== - dependencies: - object.getownpropertydescriptors "^2.0.3" - semver "^5.7.0" - -node-fetch@2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.1.2.tgz#ab884e8e7e57e38a944753cec706f788d1768bb5" - integrity sha1-q4hOjn5X44qUR1POxwb3iNF2i7U= - -node-fetch@2.6.1, node-fetch@^2.6.0: - version "2.6.1" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" - integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw== - -node-fetch@~1.7.1: - version "1.7.3" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.3.tgz#980f6f72d85211a5347c6b2bc18c5b84c3eb47ef" - integrity sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ== - dependencies: - encoding "^0.1.11" - is-stream "^1.0.1" - -node-gyp-build@^4.2.0: - version "4.2.3" - resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.2.3.tgz#ce6277f853835f718829efb47db20f3e4d9c4739" - integrity sha512-MN6ZpzmfNCRM+3t57PTJHgHyw/h4OWnZ6mR8P5j/uZtqQr46RRuDE/P+g3n0YR/AiYXeWixZZzaip77gdICfRg== - -nofilter@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/nofilter/-/nofilter-1.0.4.tgz#78d6f4b6a613e7ced8b015cec534625f7667006e" - integrity sha512-N8lidFp+fCz+TD51+haYdbDGrcBWwuHX40F5+z0qkUjMJ5Tp+rdSuAkMJ9N9eoolDlEVTf6u5icM+cNKkKW2mA== - -nofilter@^2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/nofilter/-/nofilter-2.0.3.tgz#f5460f3cb33147005883e3f5d4476239501fa187" - integrity sha512-FbuXC+lK+GU2+63D1kC1ETiZo+Z7SIi7B+mxKTCH1byrh6WFvfBCN/wpherFz0a0bjGd7EKTst/cz0yLeNngug== - dependencies: - "@cto.af/textdecoder" "^0.0.0" - -nopt@3.x: - version "3.0.6" - resolved "https://registry.yarnpkg.com/nopt/-/nopt-3.0.6.tgz#c6465dbf08abcd4db359317f79ac68a646b28ff9" - integrity sha1-xkZdvwirzU2zWTF/eaxopkayj/k= - dependencies: - abbrev "1" - -normalize-package-data@^2.3.2: - version "2.5.0" - resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" - integrity sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA== - dependencies: - hosted-git-info "^2.1.4" - resolve "^1.10.0" - semver "2 || 3 || 4 || 5" - validate-npm-package-license "^3.0.1" - -normalize-path@^2.0.0, normalize-path@^2.0.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" - integrity sha1-GrKLVW4Zg2Oowab35vogE3/mrtk= - dependencies: - remove-trailing-separator "^1.0.1" - -normalize-path@^3.0.0, normalize-path@~3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" - integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== - -normalize-url@^4.1.0: - version "4.5.1" - resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-4.5.1.tgz#0dd90cf1288ee1d1313b87081c9a5932ee48518a" - integrity sha512-9UZCFRHQdNrfTpGg8+1INIg93B6zE0aXMVFkw1WFwvO4SlZywU6aLg5Of0Ap/PgcbSw4LNxvMWXMeugwMCX0AA== - -npm-run-path@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" - integrity sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8= - dependencies: - path-key "^2.0.0" - -npm-run-path@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-4.0.1.tgz#b7ecd1e5ed53da8e37a55e1c2269e0b97ed748ea" - integrity sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw== - dependencies: - path-key "^3.0.0" - -number-is-nan@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" - integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= - -number-to-bn@1.7.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/number-to-bn/-/number-to-bn-1.7.0.tgz#bb3623592f7e5f9e0030b1977bd41a0c53fe1ea0" - integrity sha1-uzYjWS9+X54AMLGXe9QaDFP+HqA= - dependencies: - bn.js "4.11.6" - strip-hex-prefix "1.0.0" - -oauth-sign@~0.9.0: - version "0.9.0" - resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" - integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ== - -object-assign@^4, object-assign@^4.0.0, object-assign@^4.1.0, object-assign@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" - integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= - -object-copy@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" - integrity sha1-fn2Fi3gb18mRpBupde04EnVOmYw= - dependencies: - copy-descriptor "^0.1.0" - define-property "^0.2.5" - kind-of "^3.0.3" - -object-inspect@^1.10.3, object-inspect@^1.9.0: - version "1.10.3" - resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.10.3.tgz#c2aa7d2d09f50c99375704f7a0adf24c5782d369" - integrity sha512-e5mCJlSH7poANfC8z8S9s9S2IN5/4Zb3aZ33f5s8YqoazCFzNLloLU8r5VCG+G7WoqLvAAZoVMcy3tp/3X0Plw== - -object-inspect@~1.7.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.7.0.tgz#f4f6bd181ad77f006b5ece60bd0b6f398ff74a67" - integrity sha512-a7pEHdh1xKIAgTySUGgLMx/xwDZskN1Ud6egYYN3EdRW4ZMPNEDUTF+hwy2LUC+Bl+SyLXANnwz/jyh/qutKUw== - -object-is@^1.0.1: - version "1.1.5" - resolved "https://registry.yarnpkg.com/object-is/-/object-is-1.1.5.tgz#b9deeaa5fc7f1846a0faecdceec138e5778f53ac" - integrity sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw== - dependencies: - call-bind "^1.0.2" - define-properties "^1.1.3" - -object-keys@^1.0.11, object-keys@^1.0.12, object-keys@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" - integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== - -object-keys@~0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-0.4.0.tgz#28a6aae7428dd2c3a92f3d95f21335dd204e0336" - integrity sha1-KKaq50KN0sOpLz2V8hM13SBOAzY= - -object-visit@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb" - integrity sha1-95xEk68MU3e1n+OdOV5BBC3QRbs= - dependencies: - isobject "^3.0.0" - -object.assign@4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.0.tgz#968bf1100d7956bb3ca086f006f846b3bc4008da" - integrity sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w== - dependencies: - define-properties "^1.1.2" - function-bind "^1.1.1" - has-symbols "^1.0.0" - object-keys "^1.0.11" - -object.assign@^4.1.2: - version "4.1.2" - resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.2.tgz#0ed54a342eceb37b38ff76eb831a0e788cb63940" - integrity sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ== - dependencies: - call-bind "^1.0.0" - define-properties "^1.1.3" - has-symbols "^1.0.1" - object-keys "^1.1.1" - -object.getownpropertydescriptors@^2.0.3, object.getownpropertydescriptors@^2.1.1: - version "2.1.2" - resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.2.tgz#1bd63aeacf0d5d2d2f31b5e393b03a7c601a23f7" - integrity sha512-WtxeKSzfBjlzL+F9b7M7hewDzMwy+C8NRssHd1YrNlzHzIDrXcXiNOMrezdAEM4UXixgV+vvnyBeN7Rygl2ttQ== - dependencies: - call-bind "^1.0.2" - define-properties "^1.1.3" - es-abstract "^1.18.0-next.2" - -object.omit@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa" - integrity sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo= - dependencies: - for-own "^0.1.4" - is-extendable "^0.1.1" - -object.pick@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" - integrity sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c= - dependencies: - isobject "^3.0.1" - -object.values@^1.1.3: - version "1.1.4" - resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.1.4.tgz#0d273762833e816b693a637d30073e7051535b30" - integrity sha512-TnGo7j4XSnKQoK3MfvkzqKCi0nVe/D9I9IjwTNYdb/fxYHpjrluHVOgw0AF6jrRFGMPHdfuidR09tIDiIvnaSg== - dependencies: - call-bind "^1.0.2" - define-properties "^1.1.3" - es-abstract "^1.18.2" - -obliterator@^1.6.1: - version "1.6.1" - resolved "https://registry.yarnpkg.com/obliterator/-/obliterator-1.6.1.tgz#dea03e8ab821f6c4d96a299e17aef6a3af994ef3" - integrity sha512-9WXswnqINnnhOG/5SLimUlzuU1hFJUc8zkwyD59Sd+dPOMf05PmnYG/d6Q7HZ+KmgkZJa1PxRso6QdM3sTNHig== - -oboe@2.1.4: - version "2.1.4" - resolved "https://registry.yarnpkg.com/oboe/-/oboe-2.1.4.tgz#20c88cdb0c15371bb04119257d4fdd34b0aa49f6" - integrity sha1-IMiM2wwVNxuwQRklfU/dNLCqSfY= - dependencies: - http-https "^1.0.0" - -oboe@2.1.5: - version "2.1.5" - resolved "https://registry.yarnpkg.com/oboe/-/oboe-2.1.5.tgz#5554284c543a2266d7a38f17e073821fbde393cd" - integrity sha1-VVQoTFQ6ImbXo48X4HOCH73jk80= - dependencies: - http-https "^1.0.0" - -on-finished@~2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" - integrity sha1-IPEzZIGwg811M3mSoWlxqi2QaUc= - dependencies: - ee-first "1.1.1" - -on-headers@~1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/on-headers/-/on-headers-1.0.2.tgz#772b0ae6aaa525c399e489adfad90c403eb3c28f" - integrity sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA== - -once@1.x, once@^1.3.0, once@^1.3.1, once@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= - dependencies: - wrappy "1" - -one-time@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/one-time/-/one-time-1.0.0.tgz#e06bc174aed214ed58edede573b433bbf827cb45" - integrity sha512-5DXOiRKwuSEcQ/l0kGCF6Q3jcADFv5tSmRaJck/OqkVFcOzutB134KRSfF0xDrL39MNnqxbHBbUUcjZIhTgb2g== - dependencies: - fn.name "1.x.x" - -onetime@^5.1.0: - version "5.1.2" - resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e" - integrity sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg== - dependencies: - mimic-fn "^2.1.0" - -open@^7.4.2: - version "7.4.2" - resolved "https://registry.yarnpkg.com/open/-/open-7.4.2.tgz#b8147e26dcf3e426316c730089fd71edd29c2321" - integrity sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q== - dependencies: - is-docker "^2.0.0" - is-wsl "^2.1.1" - -opencollective-postinstall@^2.0.2: - version "2.0.3" - resolved "https://registry.yarnpkg.com/opencollective-postinstall/-/opencollective-postinstall-2.0.3.tgz#7a0fff978f6dbfa4d006238fbac98ed4198c3259" - integrity sha512-8AV/sCtuzUeTo8gQK5qDZzARrulB3egtLzFgteqB2tcT4Mw7B8Kt7JcDHmltjz6FOAHsvTevk70gZEbhM4ZS9Q== - -optionator@^0.8.1: - version "0.8.3" - resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.3.tgz#84fa1d036fe9d3c7e21d99884b601167ec8fb495" - integrity sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA== - dependencies: - deep-is "~0.1.3" - fast-levenshtein "~2.0.6" - levn "~0.3.0" - prelude-ls "~1.1.2" - type-check "~0.3.2" - word-wrap "~1.2.3" - -optionator@^0.9.1: - version "0.9.1" - resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.1.tgz#4f236a6373dae0566a6d43e1326674f50c291499" - integrity sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw== - dependencies: - deep-is "^0.1.3" - fast-levenshtein "^2.0.6" - levn "^0.4.1" - prelude-ls "^1.2.1" - type-check "^0.4.0" - word-wrap "^1.2.3" - -ora@^5.3.0: - version "5.4.0" - resolved "https://registry.yarnpkg.com/ora/-/ora-5.4.0.tgz#42eda4855835b9cd14d33864c97a3c95a3f56bf4" - integrity sha512-1StwyXQGoU6gdjYkyVcqOLnVlbKj+6yPNNOxJVgpt9t4eksKjiriiHuxktLYkgllwk+D6MbC4ihH84L1udRXPg== - dependencies: - bl "^4.1.0" - chalk "^4.1.0" - cli-cursor "^3.1.0" - cli-spinners "^2.5.0" - is-interactive "^1.0.0" - is-unicode-supported "^0.1.0" - log-symbols "^4.1.0" - strip-ansi "^6.0.0" - wcwidth "^1.0.1" - -os-homedir@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" - integrity sha1-/7xJiDNuDoM94MFox+8VISGqf7M= - -os-locale@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-1.4.0.tgz#20f9f17ae29ed345e8bde583b13d2009803c14d9" - integrity sha1-IPnxeuKe00XoveWDsT0gCYA8FNk= - dependencies: - lcid "^1.0.0" - -os-locale@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-2.1.0.tgz#42bc2900a6b5b8bd17376c8e882b65afccf24bf2" - integrity sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA== - dependencies: - execa "^0.7.0" - lcid "^1.0.0" - mem "^1.1.0" - -os-locale@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-3.1.0.tgz#a802a6ee17f24c10483ab9935719cef4ed16bf1a" - integrity sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q== - dependencies: - execa "^1.0.0" - lcid "^2.0.0" - mem "^4.0.0" - -os-tmpdir@^1.0.1, os-tmpdir@~1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" - integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= - -p-cancelable@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-0.3.0.tgz#b9e123800bcebb7ac13a479be195b507b98d30fa" - integrity sha512-RVbZPLso8+jFeq1MfNvgXtCRED2raz/dKpacfTNxsx6pLEpEomM7gah6VeHSYV3+vo0OAi4MkArtQcWWXuQoyw== - -p-cancelable@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-1.1.0.tgz#d078d15a3af409220c886f1d9a0ca2e441ab26cc" - integrity sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw== - -p-defer@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/p-defer/-/p-defer-1.0.0.tgz#9f6eb182f6c9aa8cd743004a7d4f96b196b0fb0c" - integrity sha1-n26xgvbJqozXQwBKfU+WsZaw+ww= - -p-defer@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/p-defer/-/p-defer-3.0.0.tgz#d1dceb4ee9b2b604b1d94ffec83760175d4e6f83" - integrity sha512-ugZxsxmtTln604yeYd29EGrNhazN2lywetzpKhfmQjW/VJmhpDmWbiX+h0zL8V91R0UXkhb3KtPmyq9PZw3aYw== - -p-fifo@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/p-fifo/-/p-fifo-1.0.0.tgz#e29d5cf17c239ba87f51dde98c1d26a9cfe20a63" - integrity sha512-IjoCxXW48tqdtDFz6fqo5q1UfFVjjVZe8TC1QRflvNUJtNfCUhxOUw6MOVZhDPjqhSzc26xKdugsO17gmzd5+A== - dependencies: - fast-fifo "^1.0.0" - p-defer "^3.0.0" - -p-finally@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" - integrity sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4= - -p-is-promise@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/p-is-promise/-/p-is-promise-2.1.0.tgz#918cebaea248a62cf7ffab8e3bca8c5f882fc42e" - integrity sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg== - -p-limit@^1.1.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8" - integrity sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q== - dependencies: - p-try "^1.0.0" - -p-limit@^2.0.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" - integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w== - dependencies: - p-try "^2.0.0" - -p-limit@^3.0.2: - version "3.1.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" - integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== - dependencies: - yocto-queue "^0.1.0" - -p-locate@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" - integrity sha1-IKAQOyIqcMj9OcwuWAaA893l7EM= - dependencies: - p-limit "^1.1.0" - -p-locate@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-3.0.0.tgz#322d69a05c0264b25997d9f40cd8a891ab0064a4" - integrity sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ== - dependencies: - p-limit "^2.0.0" - -p-locate@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834" - integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== - dependencies: - p-limit "^3.0.2" - -p-map@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/p-map/-/p-map-4.0.0.tgz#bb2f95a5eda2ec168ec9274e06a747c3e2904d2b" - integrity sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ== - dependencies: - aggregate-error "^3.0.0" - -p-queue@^6.6.1: - version "6.6.2" - resolved "https://registry.yarnpkg.com/p-queue/-/p-queue-6.6.2.tgz#2068a9dcf8e67dd0ec3e7a2bcb76810faa85e426" - integrity sha512-RwFpb72c/BhQLEXIZ5K2e+AhgNVmIejGlTgiB9MzZ0e93GRvqZ7uSi0dvRF7/XIXDeNkra2fNHBxTyPDGySpjQ== - dependencies: - eventemitter3 "^4.0.4" - p-timeout "^3.2.0" - -p-timeout@^1.1.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/p-timeout/-/p-timeout-1.2.1.tgz#5eb3b353b7fce99f101a1038880bb054ebbea386" - integrity sha1-XrOzU7f86Z8QGhA4iAuwVOu+o4Y= - dependencies: - p-finally "^1.0.0" - -p-timeout@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/p-timeout/-/p-timeout-3.2.0.tgz#c7e17abc971d2a7962ef83626b35d635acf23dfe" - integrity sha512-rhIwUycgwwKcP9yTOOFK/AKsAopjjCakVqLHePO3CC6Mir1Z99xT+R63jZxAT5lFZLa2inS5h+ZS2GvR99/FBg== - dependencies: - p-finally "^1.0.0" - -p-try@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" - integrity sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M= - -p-try@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" - integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== - -packet-reader@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/packet-reader/-/packet-reader-1.0.0.tgz#9238e5480dedabacfe1fe3f2771063f164157d74" - integrity sha512-HAKu/fG3HpHFO0AA8WE8q2g+gBJaZ9MG7fcKk+IJPLTGAD6Psw4443l+9DGRbOIh3/aXr7Phy0TjilYivJo5XQ== - -parent-module@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" - integrity sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g== - dependencies: - callsites "^3.0.0" - -parse-asn1@^5.0.0, parse-asn1@^5.1.5: - version "5.1.6" - resolved "https://registry.yarnpkg.com/parse-asn1/-/parse-asn1-5.1.6.tgz#385080a3ec13cb62a62d39409cb3e88844cdaed4" - integrity sha512-RnZRo1EPU6JBnra2vGHj0yhp6ebyjBZpmUCLHWiFhxlzvBCCpAuZ7elsBp1PVAbQN0/04VD/19rfzlBSwLstMw== - dependencies: - asn1.js "^5.2.0" - browserify-aes "^1.0.0" - evp_bytestokey "^1.0.0" - pbkdf2 "^3.0.3" - safe-buffer "^5.1.1" - -parse-cache-control@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/parse-cache-control/-/parse-cache-control-1.0.1.tgz#8eeab3e54fa56920fe16ba38f77fa21aacc2d74e" - integrity sha1-juqz5U+laSD+Fro493+iGqzC104= - -parse-duration@^0.4.4: - version "0.4.4" - resolved "https://registry.yarnpkg.com/parse-duration/-/parse-duration-0.4.4.tgz#11c0f51a689e97d06c57bd772f7fda7dc013243c" - integrity sha512-KbAJuYGUhZkB9gotDiKLnZ7Z3VTacK3fgwmDdB6ZVDtJbMBT6MfLga0WJaYpPDu0mzqT0NgHtHDt5PY4l0nidg== - -parse-glob@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c" - integrity sha1-ssN2z7EfNVE7rdFz7wu246OIORw= - dependencies: - glob-base "^0.3.0" - is-dotfile "^1.0.0" - is-extglob "^1.0.0" - is-glob "^2.0.0" - -parse-headers@^2.0.0: - version "2.0.3" - resolved "https://registry.yarnpkg.com/parse-headers/-/parse-headers-2.0.3.tgz#5e8e7512383d140ba02f0c7aa9f49b4399c92515" - integrity sha512-QhhZ+DCCit2Coi2vmAKbq5RGTRcQUOE2+REgv8vdyu7MnYx2eZztegqtTx99TZ86GTIwqiy3+4nQTWZ2tgmdCA== - -parse-json@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" - integrity sha1-9ID0BDTvgHQfhGkJn43qGPVaTck= - dependencies: - error-ex "^1.2.0" - -parse-json@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-4.0.0.tgz#be35f5425be1f7f6c747184f98a788cb99477ee0" - integrity sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA= - dependencies: - error-ex "^1.3.1" - json-parse-better-errors "^1.0.1" - -parse-json@^5.0.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-5.2.0.tgz#c76fc66dee54231c962b22bcc8a72cf2f99753cd" - integrity sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg== - dependencies: - "@babel/code-frame" "^7.0.0" - error-ex "^1.3.1" - json-parse-even-better-errors "^2.3.0" - lines-and-columns "^1.1.6" - -parseurl@~1.3.3: - version "1.3.3" - resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" - integrity sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ== - -pascalcase@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" - integrity sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ= - -patch-package@6.2.2: - version "6.2.2" - resolved "https://registry.yarnpkg.com/patch-package/-/patch-package-6.2.2.tgz#71d170d650c65c26556f0d0fbbb48d92b6cc5f39" - integrity sha512-YqScVYkVcClUY0v8fF0kWOjDYopzIM8e3bj/RU1DPeEF14+dCGm6UeOYm4jvCyxqIEQ5/eJzmbWfDWnUleFNMg== - dependencies: - "@yarnpkg/lockfile" "^1.1.0" - chalk "^2.4.2" - cross-spawn "^6.0.5" - find-yarn-workspace-root "^1.2.1" - fs-extra "^7.0.1" - is-ci "^2.0.0" - klaw-sync "^6.0.0" - minimist "^1.2.0" - rimraf "^2.6.3" - semver "^5.6.0" - slash "^2.0.0" - tmp "^0.0.33" - -patch-package@^6.2.2: - version "6.4.7" - resolved "https://registry.yarnpkg.com/patch-package/-/patch-package-6.4.7.tgz#2282d53c397909a0d9ef92dae3fdeb558382b148" - integrity sha512-S0vh/ZEafZ17hbhgqdnpunKDfzHQibQizx9g8yEf5dcVk3KOflOfdufRXQX8CSEkyOQwuM/bNz1GwKvFj54kaQ== - dependencies: - "@yarnpkg/lockfile" "^1.1.0" - chalk "^2.4.2" - cross-spawn "^6.0.5" - find-yarn-workspace-root "^2.0.0" - fs-extra "^7.0.1" - is-ci "^2.0.0" - klaw-sync "^6.0.0" - minimist "^1.2.0" - open "^7.4.2" - rimraf "^2.6.3" - semver "^5.6.0" - slash "^2.0.0" - tmp "^0.0.33" - -path-browserify@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-1.0.1.tgz#d98454a9c3753d5790860f16f68867b9e46be1fd" - integrity sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g== - -path-exists@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b" - integrity sha1-D+tsZPD8UY2adU3V77YscCJ2H0s= - dependencies: - pinkie-promise "^2.0.0" - -path-exists@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" - integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU= - -path-exists@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" - integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== - -path-is-absolute@^1.0.0, path-is-absolute@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" - integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= - -path-key@^2.0.0, path-key@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" - integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= - -path-key@^3.0.0, path-key@^3.1.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" - integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== - -path-parse@^1.0.6: - version "1.0.7" - resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" - integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== - -path-to-regexp@0.1.7: - version "0.1.7" - resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" - integrity sha1-32BBeABfUi8V60SQ5yR6G/qmf4w= - -path-type@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/path-type/-/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441" - integrity sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE= - dependencies: - graceful-fs "^4.1.2" - pify "^2.0.0" - pinkie-promise "^2.0.0" - -path-type@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/path-type/-/path-type-3.0.0.tgz#cef31dc8e0a1a3bb0d105c0cd97cf3bf47f4e36f" - integrity sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg== - dependencies: - pify "^3.0.0" - -path-type@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" - integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== - -pathval@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/pathval/-/pathval-1.1.1.tgz#8534e77a77ce7ac5a2512ea21e0fdb8fcf6c3d8d" - integrity sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ== - -pbkdf2@^3.0.17, pbkdf2@^3.0.3, pbkdf2@^3.0.9: - version "3.1.2" - resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.1.2.tgz#dd822aa0887580e52f1a039dc3eda108efae3075" - integrity sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA== - dependencies: - create-hash "^1.1.2" - create-hmac "^1.1.4" - ripemd160 "^2.0.1" - safe-buffer "^5.0.1" - sha.js "^2.4.8" - -pegjs@^0.10.0: - version "0.10.0" - resolved "https://registry.yarnpkg.com/pegjs/-/pegjs-0.10.0.tgz#cf8bafae6eddff4b5a7efb185269eaaf4610ddbd" - integrity sha1-z4uvrm7d/0tafvsYUmnqr0YQ3b0= - -performance-now@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" - integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= - -pg-connection-string@^2.4.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/pg-connection-string/-/pg-connection-string-2.5.0.tgz#538cadd0f7e603fc09a12590f3b8a452c2c0cf34" - integrity sha512-r5o/V/ORTA6TmUnyWZR9nCj1klXCO2CEKNRlVuJptZe85QuhFayC7WeMic7ndayT5IRIR0S0xFxFi2ousartlQ== - -pg-hstore@2.3.3: - version "2.3.3" - resolved "https://registry.yarnpkg.com/pg-hstore/-/pg-hstore-2.3.3.tgz#d1978c12a85359830b1388d3b0ff233b88928e96" - integrity sha512-qpeTpdkguFgfdoidtfeTho1Q1zPVPbtMHgs8eQ+Aan05iLmIs3Z3oo5DOZRclPGoQ4i68I1kCtQSJSa7i0ZVYg== - dependencies: - underscore "^1.7.0" - -pg-int8@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/pg-int8/-/pg-int8-1.0.1.tgz#943bd463bf5b71b4170115f80f8efc9a0c0eb78c" - integrity sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw== - -pg-pool@^3.2.2: - version "3.3.0" - resolved "https://registry.yarnpkg.com/pg-pool/-/pg-pool-3.3.0.tgz#12d5c7f65ea18a6e99ca9811bd18129071e562fc" - integrity sha512-0O5huCql8/D6PIRFAlmccjphLYWC+JIzvUhSzXSpGaf+tjTZc4nn+Lr7mLXBbFJfvwbP0ywDv73EiaBsxn7zdg== - -pg-protocol@^1.3.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/pg-protocol/-/pg-protocol-1.5.0.tgz#b5dd452257314565e2d54ab3c132adc46565a6a0" - integrity sha512-muRttij7H8TqRNu/DxrAJQITO4Ac7RmX3Klyr/9mJEOBeIpgnF8f9jAfRz5d3XwQZl5qBjF9gLsUtMPJE0vezQ== - -pg-types@^2.1.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/pg-types/-/pg-types-2.2.0.tgz#2d0250d636454f7cfa3b6ae0382fdfa8063254a3" - integrity sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA== - dependencies: - pg-int8 "1.0.1" - postgres-array "~2.0.0" - postgres-bytea "~1.0.0" - postgres-date "~1.0.4" - postgres-interval "^1.1.0" - -pg@8.4.2: - version "8.4.2" - resolved "https://registry.yarnpkg.com/pg/-/pg-8.4.2.tgz#2aa58166a23391e91d56a7ea57c6d99931c0642a" - integrity sha512-E9FlUrrc7w3+sbRmL1CSw99vifACzB2TjhMM9J5w9D1LIg+6un0jKkpHS1EQf2CWhKhec2bhrBLVMmUBDbjPRQ== - dependencies: - buffer-writer "2.0.0" - packet-reader "1.0.0" - pg-connection-string "^2.4.0" - pg-pool "^3.2.2" - pg-protocol "^1.3.0" - pg-types "^2.1.0" - pgpass "1.x" - -pgpass@1.x: - version "1.0.4" - resolved "https://registry.yarnpkg.com/pgpass/-/pgpass-1.0.4.tgz#85eb93a83800b20f8057a2b029bf05abaf94ea9c" - integrity sha512-YmuA56alyBq7M59vxVBfPJrGSozru8QAdoNlWuW3cz8l+UX3cWge0vTvjKhsSHSJpo3Bom8/Mm6hf0TR5GY0+w== - dependencies: - split2 "^3.1.1" - -picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.3: - version "2.3.0" - resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.0.tgz#f1f061de8f6a4bf022892e2d128234fb98302972" - integrity sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw== - -pify@^2.0.0, pify@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" - integrity sha1-7RQaasBDqEnqWISY59yosVMw6Qw= - -pify@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" - integrity sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY= - -pify@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/pify/-/pify-4.0.1.tgz#4b2cd25c50d598735c50292224fd8c6df41e3231" - integrity sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g== - -pinkie-promise@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" - integrity sha1-ITXW36ejWMBprJsXh3YogihFD/o= - dependencies: - pinkie "^2.0.0" - -pinkie@^2.0.0: - version "2.0.4" - resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" - integrity sha1-clVrgM+g1IqXToDnckjoDtT3+HA= - -pino-multi-stream@5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/pino-multi-stream/-/pino-multi-stream-5.1.1.tgz#abd634705b48bcb0e6b8d5c0145b82c2e45475f7" - integrity sha512-P9z/5OXRaaZJulNcxvvvV4p+m1tmiuKC4RT3I5NixOQwCWj9uHbDQaXP/NLtKgFqjrGHl5bkIb73nIvWe7KnbQ== - dependencies: - pino "^6.0.0" - -pino-std-serializers@^2.4.2: - version "2.5.0" - resolved "https://registry.yarnpkg.com/pino-std-serializers/-/pino-std-serializers-2.5.0.tgz#40ead781c65a0ce7ecd9c1c33f409d31fe712315" - integrity sha512-wXqbqSrIhE58TdrxxlfLwU9eDhrzppQDvGhBEr1gYbzzM4KKo3Y63gSjiDXRKLVS2UOXdPNR2v+KnQgNrs+xUg== - -pino-std-serializers@^3.1.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/pino-std-serializers/-/pino-std-serializers-3.2.0.tgz#b56487c402d882eb96cd67c257868016b61ad671" - integrity sha512-EqX4pwDPrt3MuOAAUBMU0Tk5kR/YcCM5fNPEzgCO2zJ5HfX0vbiH9HbJglnyeQsN96Kznae6MWD47pZB5avTrg== - -pino@6.7.0: - version "6.7.0" - resolved "https://registry.yarnpkg.com/pino/-/pino-6.7.0.tgz#d5d96b7004fed78816b5694fda3eab02b5ca6d23" - integrity sha512-vPXJ4P9rWCwzlTJt+f0Ni4THc3DWyt8iDDCO4edQ8narTu6hnpzdXu8FqeSJCGndl1W6lfbYQUQihUO54y66Lw== - dependencies: - fast-redact "^3.0.0" - fast-safe-stringify "^2.0.7" - flatstr "^1.0.12" - pino-std-serializers "^2.4.2" - quick-format-unescaped "^4.0.1" - sonic-boom "^1.0.2" - -pino@^6.0.0: - version "6.11.3" - resolved "https://registry.yarnpkg.com/pino/-/pino-6.11.3.tgz#0c02eec6029d25e6794fdb6bbea367247d74bc29" - integrity sha512-drPtqkkSf0ufx2gaea3TryFiBHdNIdXKf5LN0hTM82SXI4xVIve2wLwNg92e1MT6m3jASLu6VO7eGY6+mmGeyw== - dependencies: - fast-redact "^3.0.0" - fast-safe-stringify "^2.0.7" - flatstr "^1.0.12" - pino-std-serializers "^3.1.0" - quick-format-unescaped "^4.0.3" - sonic-boom "^1.0.2" - -pkg-dir@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-2.0.0.tgz#f6d5d1109e19d63edf428e0bd57e12777615334b" - integrity sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s= - dependencies: - find-up "^2.1.0" - -pkg-dir@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-5.0.0.tgz#a02d6aebe6ba133a928f74aec20bafdfe6b8e760" - integrity sha512-NPE8TDbzl/3YQYY7CSS228s3g2ollTFnc+Qi3tqmqJp9Vg2ovUpixcJEo2HJScN2Ez+kEaal6y70c0ehqJBJeA== - dependencies: - find-up "^5.0.0" - -pkg-up@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/pkg-up/-/pkg-up-2.0.0.tgz#c819ac728059a461cab1c3889a2be3c49a004d7f" - integrity sha1-yBmscoBZpGHKscOImivjxJoATX8= - dependencies: - find-up "^2.1.0" - -please-upgrade-node@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz#aeddd3f994c933e4ad98b99d9a556efa0e2fe942" - integrity sha512-gQR3WpIgNIKwBMVLkpMUeR3e1/E1y42bqDQZfql+kDeXd8COYfM8PQA4X6y7a8u9Ua9FHmsrrmirW2vHs45hWg== - dependencies: - semver-compare "^1.0.0" - -posix-character-classes@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" - integrity sha1-AerA/jta9xoqbAL+q7jB/vfgDqs= - -postgres-array@~2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/postgres-array/-/postgres-array-2.0.0.tgz#48f8fce054fbc69671999329b8834b772652d82e" - integrity sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA== - -postgres-bytea@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/postgres-bytea/-/postgres-bytea-1.0.0.tgz#027b533c0aa890e26d172d47cf9ccecc521acd35" - integrity sha1-AntTPAqokOJtFy1Hz5zOzFIazTU= - -postgres-date@~1.0.4: - version "1.0.7" - resolved "https://registry.yarnpkg.com/postgres-date/-/postgres-date-1.0.7.tgz#51bc086006005e5061c591cee727f2531bf641a8" - integrity sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q== - -postgres-interval@^1.1.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/postgres-interval/-/postgres-interval-1.2.0.tgz#b460c82cb1587507788819a06aa0fffdb3544695" - integrity sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ== - dependencies: - xtend "^4.0.0" - -postinstall-postinstall@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/postinstall-postinstall/-/postinstall-postinstall-2.1.0.tgz#4f7f77441ef539d1512c40bd04c71b06a4704ca3" - integrity sha512-7hQX6ZlZXIoRiWNrbMQaLzUUfH+sSx39u8EJ9HYuDc1kLo9IXKWjM5RSquZN1ad5GnH8CGFM78fsAAQi3OKEEQ== - -precond@0.2: - version "0.2.3" - resolved "https://registry.yarnpkg.com/precond/-/precond-0.2.3.tgz#aa9591bcaa24923f1e0f4849d240f47efc1075ac" - integrity sha1-qpWRvKokkj8eD0hJ0kD0fvwQdaw= - -prelude-ls@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" - integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== - -prelude-ls@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" - integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= - -prepend-http@^1.0.1: - version "1.0.4" - resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc" - integrity sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw= - -prepend-http@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897" - integrity sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc= - -preserve@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" - integrity sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks= - -prettier-linter-helpers@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz#d23d41fe1375646de2d0104d3454a3008802cf7b" - integrity sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w== - dependencies: - fast-diff "^1.1.2" - -prettier-plugin-solidity@^1.0.0-beta.9: - version "1.0.0-beta.11" - resolved "https://registry.yarnpkg.com/prettier-plugin-solidity/-/prettier-plugin-solidity-1.0.0-beta.11.tgz#580a16cab6517ab20cd08e65afd0300caa32125d" - integrity sha512-b3lh/9tn9BC3I723Aa91zebw2NDlbbBroKg7izP+jU0QfrLO6ldi0jY0XrqX3+zGqAI2aLcP8Jr1eGdymK5CgQ== - dependencies: - "@solidity-parser/parser" "^0.13.0" - dir-to-object "^2.0.0" - emoji-regex "^9.2.2" - escape-string-regexp "^4.0.0" - prettier "^2.2.1" - semver "^7.3.5" - solidity-comments-extractor "^0.0.7" - string-width "^4.2.2" - -prettier@^2.1.2, prettier@^2.2.1: - version "2.3.0" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.3.0.tgz#b6a5bf1284026ae640f17f7ff5658a7567fc0d18" - integrity sha512-kXtO4s0Lz/DW/IJ9QdWhAf7/NmPWQXkFr/r/WkR3vyI+0v8amTDxiaQSLzs8NBlytfLWX/7uQUMIW677yLKl4w== - -printj@~1.1.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/printj/-/printj-1.1.2.tgz#d90deb2975a8b9f600fb3a1c94e3f4c53c78a222" - integrity sha512-zA2SmoLaxZyArQTOPj5LXecR+RagfPSU5Kw1qP+jkWeNlrq+eJZyY2oS68SU1Z/7/myXM4lo9716laOFAVStCQ== - -private@^0.1.6, private@^0.1.8: - version "0.1.8" - resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" - integrity sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg== - -process-nextick-args@~2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" - integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== - -process@^0.11.10: - version "0.11.10" - resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" - integrity sha1-czIwDoQBYb2j5podHZGn1LwW8YI= - -progress@^2.0.0: - version "2.0.3" - resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" - integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== - -prom-client@12.0.0: - version "12.0.0" - resolved "https://registry.yarnpkg.com/prom-client/-/prom-client-12.0.0.tgz#9689379b19bd3f6ab88a9866124db9da3d76c6ed" - integrity sha512-JbzzHnw0VDwCvoqf8y1WDtq4wSBAbthMB1pcVI/0lzdqHGJI3KBJDXle70XK+c7Iv93Gihqo0a5LlOn+g8+DrQ== - dependencies: - tdigest "^0.1.1" - -promise-to-callback@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/promise-to-callback/-/promise-to-callback-1.0.0.tgz#5d2a749010bfb67d963598fcd3960746a68feef7" - integrity sha1-XSp0kBC/tn2WNZj805YHRqaP7vc= - dependencies: - is-fn "^1.0.0" - set-immediate-shim "^1.0.1" - -promise@^8.0.0: - version "8.1.0" - resolved "https://registry.yarnpkg.com/promise/-/promise-8.1.0.tgz#697c25c3dfe7435dd79fcd58c38a135888eaf05e" - integrity sha512-W04AqnILOL/sPRXziNicCjSNRruLAuIHEOVBazepu0545DDNGYHz7ar9ZgZ1fMU8/MA4mVxp5rkBWRi6OXIy3Q== - dependencies: - asap "~2.0.6" - -proper-lockfile@^4.1.1: - version "4.1.2" - resolved "https://registry.yarnpkg.com/proper-lockfile/-/proper-lockfile-4.1.2.tgz#c8b9de2af6b2f1601067f98e01ac66baa223141f" - integrity sha512-TjNPblN4BwAWMXU8s9AEz4JmQxnD1NNL7bNOY/AKUzyamc379FWASUhc/K1pL2noVb+XmZKLL68cjzLsiOAMaA== - dependencies: - graceful-fs "^4.2.4" - retry "^0.12.0" - signal-exit "^3.0.2" - -protocol-buffers-schema@^3.3.1: - version "3.5.1" - resolved "https://registry.yarnpkg.com/protocol-buffers-schema/-/protocol-buffers-schema-3.5.1.tgz#8388e768d383ac8cbea23e1280dfadb79f4122ad" - integrity sha512-YVCvdhxWNDP8/nJDyXLuM+UFsuPk4+1PB7WGPVDzm3HTHbzFLxQYeW2iZpS4mmnXrQJGBzt230t/BbEb7PrQaw== - -protons@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/protons/-/protons-2.0.1.tgz#bfee5123c100001dcf56ab8f71b1b36f2e8289f1" - integrity sha512-FlmPorLEeCEDPu+uIn0Qardgiy5XqVA4IyNTz9wb9c0e2U7BEXdRcIbx64r09o4Abtf+4B7mkTtMbsIXMxZzKw== - dependencies: - protocol-buffers-schema "^3.3.1" - signed-varint "^2.0.1" - uint8arrays "^2.1.3" - varint "^5.0.0" - -proxy-addr@~2.0.5: - version "2.0.6" - resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.6.tgz#fdc2336505447d3f2f2c638ed272caf614bbb2bf" - integrity sha512-dh/frvCBVmSsDYzw6n926jv974gddhkFPfiN8hPOi30Wax25QZyZEGveluCgliBnqmuM+UJmBErbAUFIoDbjOw== - dependencies: - forwarded "~0.1.2" - ipaddr.js "1.9.1" - -prr@~1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/prr/-/prr-1.0.1.tgz#d3fc114ba06995a45ec6893f484ceb1d78f5f476" - integrity sha1-0/wRS6BplaRexok/SEzrHXj19HY= - -pseudomap@^1.0.1, pseudomap@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" - integrity sha1-8FKijacOYYkX7wqKw0wa5aaChrM= - -psl@^1.1.28: - version "1.8.0" - resolved "https://registry.yarnpkg.com/psl/-/psl-1.8.0.tgz#9326f8bcfb013adcc005fdff056acce020e51c24" - integrity sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ== - -public-encrypt@^4.0.0: - version "4.0.3" - resolved "https://registry.yarnpkg.com/public-encrypt/-/public-encrypt-4.0.3.tgz#4fcc9d77a07e48ba7527e7cbe0de33d0701331e0" - integrity sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q== - dependencies: - bn.js "^4.1.0" - browserify-rsa "^4.0.0" - create-hash "^1.1.0" - parse-asn1 "^5.0.0" - randombytes "^2.0.1" - safe-buffer "^5.1.2" - -pull-cat@^1.1.9: - version "1.1.11" - resolved "https://registry.yarnpkg.com/pull-cat/-/pull-cat-1.1.11.tgz#b642dd1255da376a706b6db4fa962f5fdb74c31b" - integrity sha1-tkLdElXaN2pwa220+pYvX9t0wxs= - -pull-defer@^0.2.2: - version "0.2.3" - resolved "https://registry.yarnpkg.com/pull-defer/-/pull-defer-0.2.3.tgz#4ee09c6d9e227bede9938db80391c3dac489d113" - integrity sha512-/An3KE7mVjZCqNhZsr22k1Tx8MACnUnHZZNPSJ0S62td8JtYr/AiRG42Vz7Syu31SoTLUzVIe61jtT/pNdjVYA== - -pull-level@^2.0.3: - version "2.0.4" - resolved "https://registry.yarnpkg.com/pull-level/-/pull-level-2.0.4.tgz#4822e61757c10bdcc7cf4a03af04c92734c9afac" - integrity sha512-fW6pljDeUThpq5KXwKbRG3X7Ogk3vc75d5OQU/TvXXui65ykm+Bn+fiktg+MOx2jJ85cd+sheufPL+rw9QSVZg== - dependencies: - level-post "^1.0.7" - pull-cat "^1.1.9" - pull-live "^1.0.1" - pull-pushable "^2.0.0" - pull-stream "^3.4.0" - pull-window "^2.1.4" - stream-to-pull-stream "^1.7.1" - -pull-live@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/pull-live/-/pull-live-1.0.1.tgz#a4ecee01e330155e9124bbbcf4761f21b38f51f5" - integrity sha1-pOzuAeMwFV6RJLu89HYfIbOPUfU= - dependencies: - pull-cat "^1.1.9" - pull-stream "^3.4.0" - -pull-pushable@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/pull-pushable/-/pull-pushable-2.2.0.tgz#5f2f3aed47ad86919f01b12a2e99d6f1bd776581" - integrity sha1-Xy867UethpGfAbEqLpnW8b13ZYE= - -pull-stream@^3.2.3, pull-stream@^3.4.0, pull-stream@^3.6.8: - version "3.6.14" - resolved "https://registry.yarnpkg.com/pull-stream/-/pull-stream-3.6.14.tgz#529dbd5b86131f4a5ed636fdf7f6af00781357ee" - integrity sha512-KIqdvpqHHaTUA2mCYcLG1ibEbu/LCKoJZsBWyv9lSYtPkJPBq8m3Hxa103xHi6D2thj5YXa0TqK3L3GUkwgnew== - -pull-window@^2.1.4: - version "2.1.4" - resolved "https://registry.yarnpkg.com/pull-window/-/pull-window-2.1.4.tgz#fc3b86feebd1920c7ae297691e23f705f88552f0" - integrity sha1-/DuG/uvRkgx64pdpHiP3BfiFUvA= - dependencies: - looper "^2.0.0" - -pump@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64" - integrity sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww== - dependencies: - end-of-stream "^1.1.0" - once "^1.3.1" - -pumpify@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/pumpify/-/pumpify-2.0.1.tgz#abfc7b5a621307c728b551decbbefb51f0e4aa1e" - integrity sha512-m7KOje7jZxrmutanlkS1daj1dS6z6BgslzOXmcSEpIlCxM3VJH7lG5QLeck/6hgF6F4crFf01UtQmNsJfweTAw== - dependencies: - duplexify "^4.1.1" - inherits "^2.0.3" - pump "^3.0.0" - -punycode@1.3.2: - version "1.3.2" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d" - integrity sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0= - -punycode@2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.0.tgz#5f863edc89b96db09074bad7947bf09056ca4e7d" - integrity sha1-X4Y+3Im5bbCQdLrXlHvwkFbKTn0= - -punycode@^2.1.0, punycode@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" - integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== - -qs@6.7.0: - version "6.7.0" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.7.0.tgz#41dc1a015e3d581f1621776be31afb2876a9b1bc" - integrity sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ== - -qs@^6.4.0, qs@^6.7.0: - version "6.10.1" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.10.1.tgz#4931482fa8d647a5aab799c5271d2133b981fb6a" - integrity sha512-M528Hph6wsSVOBiYUnGf+K/7w0hNshs/duGsNXPUCLH5XAqjEtiPGwNONLV0tBH8NoGb0mvD5JubnUTrujKDTg== - dependencies: - side-channel "^1.0.4" - -qs@~6.5.2: - version "6.5.2" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" - integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== - -query-string@^5.0.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/query-string/-/query-string-5.1.1.tgz#a78c012b71c17e05f2e3fa2319dd330682efb3cb" - integrity sha512-gjWOsm2SoGlgLEdAGt7a6slVOk9mGiXmPFMqrEhLQ68rhQuBnpfs3+EmlvqKyxnCo9/PPlF+9MtY02S1aFg+Jw== - dependencies: - decode-uri-component "^0.2.0" - object-assign "^4.1.0" - strict-uri-encode "^1.0.0" - -querystring@0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620" - integrity sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA= - -queue-microtask@^1.2.2: - version "1.2.3" - resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" - integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== - -quick-format-unescaped@^4.0.1, quick-format-unescaped@^4.0.3: - version "4.0.3" - resolved "https://registry.yarnpkg.com/quick-format-unescaped/-/quick-format-unescaped-4.0.3.tgz#6d6b66b8207aa2b35eef12be1421bb24c428f652" - integrity sha512-MaL/oqh02mhEo5m5J2rwsVL23Iw2PEaGVHgT2vFt8AAsr0lfvQA5dpXo9TPu0rz7tSBdUPgkbam0j/fj5ZM8yg== - -randomatic@^3.0.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-3.1.1.tgz#b776efc59375984e36c537b2f51a1f0aff0da1ed" - integrity sha512-TuDE5KxZ0J461RVjrJZCJc+J+zCkTb1MbH9AQUq68sMhOMcy9jLcb3BrZKgp9q9Ncltdg4QVqWrH02W2EFFVYw== - dependencies: - is-number "^4.0.0" - kind-of "^6.0.0" - math-random "^1.0.1" - -randombytes@^2.0.0, randombytes@^2.0.1, randombytes@^2.0.5, randombytes@^2.0.6, randombytes@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" - integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== - dependencies: - safe-buffer "^5.1.0" - -randomfill@^1.0.3: - version "1.0.4" - resolved "https://registry.yarnpkg.com/randomfill/-/randomfill-1.0.4.tgz#c92196fc86ab42be983f1bf31778224931d61458" - integrity sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw== - dependencies: - randombytes "^2.0.5" - safe-buffer "^5.1.0" - -range-parser@~1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031" - integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg== - -raw-body@2.4.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.4.0.tgz#a1ce6fb9c9bc356ca52e89256ab59059e13d0332" - integrity sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q== - dependencies: - bytes "3.1.0" - http-errors "1.7.2" - iconv-lite "0.4.24" - unpipe "1.0.0" - -raw-body@^2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.4.1.tgz#30ac82f98bb5ae8c152e67149dac8d55153b168c" - integrity sha512-9WmIKF6mkvA0SLmA2Knm9+qj89e+j1zqgyn8aXGd7+nAduPoqgI9lO57SAZNn/Byzo5P7JhXTyg9PzaJbH73bA== - dependencies: - bytes "3.1.0" - http-errors "1.7.3" - iconv-lite "0.4.24" - unpipe "1.0.0" - -read-pkg-up@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02" - integrity sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI= - dependencies: - find-up "^1.0.0" - read-pkg "^1.0.0" - -read-pkg-up@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-3.0.0.tgz#3ed496685dba0f8fe118d0691dc51f4a1ff96f07" - integrity sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc= - dependencies: - find-up "^2.0.0" - read-pkg "^3.0.0" - -read-pkg@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-1.1.0.tgz#f5ffaa5ecd29cb31c0474bca7d756b6bb29e3f28" - integrity sha1-9f+qXs0pyzHAR0vKfXVra7KePyg= - dependencies: - load-json-file "^1.0.0" - normalize-package-data "^2.3.2" - path-type "^1.0.0" - -read-pkg@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-3.0.0.tgz#9cbc686978fee65d16c00e2b19c237fcf6e38389" - integrity sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k= - dependencies: - load-json-file "^4.0.0" - normalize-package-data "^2.3.2" - path-type "^3.0.0" - -"readable-stream@2 || 3", readable-stream@^3.0.0, readable-stream@^3.0.6, readable-stream@^3.1.0, readable-stream@^3.1.1, readable-stream@^3.4.0, readable-stream@^3.6.0: - version "3.6.0" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198" - integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== - dependencies: - inherits "^2.0.3" - string_decoder "^1.1.1" - util-deprecate "^1.0.1" - -readable-stream@^1.0.33: - version "1.1.14" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.1.14.tgz#7cf4c54ef648e3813084c636dd2079e166c081d9" - integrity sha1-fPTFTvZI44EwhMY23SB54WbAgdk= - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.1" - isarray "0.0.1" - string_decoder "~0.10.x" - -readable-stream@^2.0.0, readable-stream@^2.0.2, readable-stream@^2.0.5, readable-stream@^2.2.2, readable-stream@^2.2.8, readable-stream@^2.2.9, readable-stream@^2.3.6, readable-stream@^2.3.7, readable-stream@~2.3.6: - version "2.3.7" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57" - integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw== - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.3" - isarray "~1.0.0" - process-nextick-args "~2.0.0" - safe-buffer "~5.1.1" - string_decoder "~1.1.1" - util-deprecate "~1.0.1" - -readable-stream@~1.0.15: - version "1.0.34" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.0.34.tgz#125820e34bc842d2f2aaafafe4c2916ee32c157c" - integrity sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw= - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.1" - isarray "0.0.1" - string_decoder "~0.10.x" - -readdirp@^2.0.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.2.1.tgz#0e87622a3325aa33e892285caf8b4e846529a525" - integrity sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ== - dependencies: - graceful-fs "^4.1.11" - micromatch "^3.1.10" - readable-stream "^2.0.2" - -readdirp@~3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.2.0.tgz#c30c33352b12c96dfb4b895421a49fd5a9593839" - integrity sha512-crk4Qu3pmXwgxdSgGhgA/eXiJAPQiX4GMOZZMXnqKxHX7TaoL+3gQVo/WeuAiogr07DpnfjIMpXXa+PAIvwPGQ== - dependencies: - picomatch "^2.0.4" - -readdirp@~3.5.0: - version "3.5.0" - resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.5.0.tgz#9ba74c019b15d365278d2e91bb8c48d7b4d42c9e" - integrity sha512-cMhu7c/8rdhkHXWsY+osBhfSy0JikwpHK/5+imo+LpeasTF8ouErHrlYkwT0++njiyuDvc7OFY5T3ukvZ8qmFQ== - dependencies: - picomatch "^2.2.1" - -receptacle@^1.3.2: - version "1.3.2" - resolved "https://registry.yarnpkg.com/receptacle/-/receptacle-1.3.2.tgz#a7994c7efafc7a01d0e2041839dab6c4951360d2" - integrity sha512-HrsFvqZZheusncQRiEE7GatOAETrARKV/lnfYicIm8lbvp/JQOdADOfhjBd2DajvoszEyxSM6RlAAIZgEoeu/A== - dependencies: - ms "^2.1.1" - -rechoir@^0.6.2: - version "0.6.2" - resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384" - integrity sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q= - dependencies: - resolve "^1.1.6" - -recursive-readdir@^2.2.2: - version "2.2.2" - resolved "https://registry.yarnpkg.com/recursive-readdir/-/recursive-readdir-2.2.2.tgz#9946fb3274e1628de6e36b2f6714953b4845094f" - integrity sha512-nRCcW9Sj7NuZwa2XvH9co8NPeXUBhZP7CRKJtU+cS6PW9FpCIFoI5ib0NT1ZrbNuPoRy0ylyCaUL8Gih4LSyFg== - dependencies: - minimatch "3.0.4" - -regenerate@^1.2.1: - version "1.4.2" - resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.2.tgz#b9346d8827e8f5a32f7ba29637d398b69014848a" - integrity sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A== - -regenerator-runtime@^0.11.0: - version "0.11.1" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" - integrity sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg== - -regenerator-transform@^0.10.0: - version "0.10.1" - resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.10.1.tgz#1e4996837231da8b7f3cf4114d71b5691a0680dd" - integrity sha512-PJepbvDbuK1xgIgnau7Y90cwaAmO/LCLMI2mPvaXq2heGMR3aWW5/BQvYrhJ8jgmQjXewXvBjzfqKcVOmhjZ6Q== - dependencies: - babel-runtime "^6.18.0" - babel-types "^6.19.0" - private "^0.1.6" - -regex-cache@^0.4.2: - version "0.4.4" - resolved "https://registry.yarnpkg.com/regex-cache/-/regex-cache-0.4.4.tgz#75bdc58a2a1496cec48a12835bc54c8d562336dd" - integrity sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ== - dependencies: - is-equal-shallow "^0.1.3" - -regex-not@^1.0.0, regex-not@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" - integrity sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A== - dependencies: - extend-shallow "^3.0.2" - safe-regex "^1.1.0" - -regexp.prototype.flags@^1.2.0: - version "1.3.1" - resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.3.1.tgz#7ef352ae8d159e758c0eadca6f8fcb4eef07be26" - integrity sha512-JiBdRBq91WlY7uRJ0ds7R+dU02i6LKi8r3BuQhNXn+kmeLN+EfHhfjqMRis1zJxnlu88hq/4dx0P2OP3APRTOA== - dependencies: - call-bind "^1.0.2" - define-properties "^1.1.3" - -regexpp@^3.0.0, regexpp@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.1.0.tgz#206d0ad0a5648cffbdb8ae46438f3dc51c9f78e2" - integrity sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q== - -regexpu-core@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-2.0.0.tgz#49d038837b8dcf8bfa5b9a42139938e6ea2ae240" - integrity sha1-SdA4g3uNz4v6W5pCE5k45uoq4kA= - dependencies: - regenerate "^1.2.1" - regjsgen "^0.2.0" - regjsparser "^0.1.4" - -regjsgen@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.2.0.tgz#6c016adeac554f75823fe37ac05b92d5a4edb1f7" - integrity sha1-bAFq3qxVT3WCP+N6wFuS1aTtsfc= - -regjsparser@^0.1.4: - version "0.1.5" - resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.1.5.tgz#7ee8f84dc6fa792d3fd0ae228d24bd949ead205c" - integrity sha1-fuj4Tcb6eS0/0K4ijSS9lJ6tIFw= - dependencies: - jsesc "~0.5.0" - -remove-trailing-separator@^1.0.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" - integrity sha1-wkvOKig62tW8P1jg1IJJuSN52O8= - -repeat-element@^1.1.2: - version "1.1.4" - resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.4.tgz#be681520847ab58c7568ac75fbfad28ed42d39e9" - integrity sha512-LFiNfRcSu7KK3evMyYOuCzv3L10TW7yC1G2/+StMjK8Y6Vqd2MG7r/Qjw4ghtuCOjFvlnms/iMmLqpvW/ES/WQ== - -repeat-string@^1.5.2, repeat-string@^1.6.1: - version "1.6.1" - resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" - integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc= - -repeating@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda" - integrity sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo= - dependencies: - is-finite "^1.0.0" - -req-cwd@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/req-cwd/-/req-cwd-2.0.0.tgz#d4082b4d44598036640fb73ddea01ed53db49ebc" - integrity sha1-1AgrTURZgDZkD7c93qAe1T20nrw= - dependencies: - req-from "^2.0.0" - -req-from@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/req-from/-/req-from-2.0.0.tgz#d74188e47f93796f4aa71df6ee35ae689f3e0e70" - integrity sha1-10GI5H+TeW9Kpx327jWuaJ8+DnA= - dependencies: - resolve-from "^3.0.0" - -request-promise-core@1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/request-promise-core/-/request-promise-core-1.1.4.tgz#3eedd4223208d419867b78ce815167d10593a22f" - integrity sha512-TTbAfBBRdWD7aNNOoVOBH4pN/KigV6LyapYNNlAPA8JwbovRti1E88m3sYAwsLi5ryhPKsE9APwnjFTgdUjTpw== - dependencies: - lodash "^4.17.19" - -request-promise-native@^1.0.5: - version "1.0.9" - resolved "https://registry.yarnpkg.com/request-promise-native/-/request-promise-native-1.0.9.tgz#e407120526a5efdc9a39b28a5679bf47b9d9dc28" - integrity sha512-wcW+sIUiWnKgNY0dqCpOZkUbF/I+YPi+f09JZIDa39Ec+q82CpSYniDp+ISgTTbKmnpJWASeJBPZmoxH84wt3g== - dependencies: - request-promise-core "1.1.4" - stealthy-require "^1.1.1" - tough-cookie "^2.3.3" - -request@^2.79.0, request@^2.85.0, request@^2.88.0: - version "2.88.2" - resolved "https://registry.yarnpkg.com/request/-/request-2.88.2.tgz#d73c918731cb5a87da047e207234146f664d12b3" - integrity sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw== - dependencies: - aws-sign2 "~0.7.0" - aws4 "^1.8.0" - caseless "~0.12.0" - combined-stream "~1.0.6" - extend "~3.0.2" - forever-agent "~0.6.1" - form-data "~2.3.2" - har-validator "~5.1.3" - http-signature "~1.2.0" - is-typedarray "~1.0.0" - isstream "~0.1.2" - json-stringify-safe "~5.0.1" - mime-types "~2.1.19" - oauth-sign "~0.9.0" - performance-now "^2.1.0" - qs "~6.5.2" - safe-buffer "^5.1.2" - tough-cookie "~2.5.0" - tunnel-agent "^0.6.0" - uuid "^3.3.2" - -require-directory@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" - integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= - -require-from-string@^1.1.0: - version "1.2.1" - resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-1.2.1.tgz#529c9ccef27380adfec9a2f965b649bbee636418" - integrity sha1-UpyczvJzgK3+yaL5ZbZJu+5jZBg= - -require-from-string@^2.0.0, require-from-string@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" - integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== - -require-main-filename@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" - integrity sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE= - -require-main-filename@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" - integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== - -requireindex@~1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/requireindex/-/requireindex-1.1.0.tgz#e5404b81557ef75db6e49c5a72004893fe03e162" - integrity sha1-5UBLgVV+91225JxacgBIk/4D4WI= - -reset@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/reset/-/reset-0.1.0.tgz#9fc7314171995ae6cb0b7e58b06ce7522af4bafb" - integrity sha1-n8cxQXGZWubLC35YsGznUir0uvs= - -resolve-from@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-3.0.0.tgz#b22c7af7d9d6881bc8b6e653335eebcb0a188748" - integrity sha1-six699nWiBvItuZTM17rywoYh0g= - -resolve-from@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" - integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== - -resolve-url@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" - integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= - -resolve@1.1.x: - version "1.1.7" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" - integrity sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs= - -resolve@1.17.0, resolve@~1.17.0: - version "1.17.0" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.17.0.tgz#b25941b54968231cc2d1bb76a79cb7f2c0bf8444" - integrity sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w== - dependencies: - path-parse "^1.0.6" - -resolve@^1.1.6, resolve@^1.10.0, resolve@^1.10.1, resolve@^1.13.1, resolve@^1.20.0, resolve@^1.8.1: - version "1.20.0" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975" - integrity sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A== - dependencies: - is-core-module "^2.2.0" - path-parse "^1.0.6" - -responselike@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/responselike/-/responselike-1.0.2.tgz#918720ef3b631c5642be068f15ade5a46f4ba1e7" - integrity sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec= - dependencies: - lowercase-keys "^1.0.0" - -restore-cursor@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-3.1.0.tgz#39f67c54b3a7a58cea5236d95cf0034239631f7e" - integrity sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA== - dependencies: - onetime "^5.1.0" - signal-exit "^3.0.2" - -resumer@~0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/resumer/-/resumer-0.0.0.tgz#f1e8f461e4064ba39e82af3cdc2a8c893d076759" - integrity sha1-8ej0YeQGS6Oegq883CqMiT0HZ1k= - dependencies: - through "~2.3.4" - -ret@~0.1.10: - version "0.1.15" - resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" - integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== - -retry-as-promised@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/retry-as-promised/-/retry-as-promised-3.2.0.tgz#769f63d536bec4783549db0777cb56dadd9d8543" - integrity sha512-CybGs60B7oYU/qSQ6kuaFmRd9sTZ6oXSc0toqePvV74Ac6/IFZSI1ReFQmtCN+uvW1Mtqdwpvt/LGOiCBAY2Mg== - dependencies: - any-promise "^1.3.0" - -retry@^0.12.0: - version "0.12.0" - resolved "https://registry.yarnpkg.com/retry/-/retry-0.12.0.tgz#1b42a6266a21f07421d1b0b54b7dc167b01c013b" - integrity sha1-G0KmJmoh8HQh0bC1S33BZ7AcATs= - -reusify@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" - integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== - -rimraf@^2.2.8, rimraf@^2.6.3: - version "2.7.1" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" - integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w== - dependencies: - glob "^7.1.3" - -rimraf@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" - integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== - dependencies: - glob "^7.1.3" - -ripemd160@^2.0.0, ripemd160@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.2.tgz#a1c1a6f624751577ba5d07914cbc92850585890c" - integrity sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA== - dependencies: - hash-base "^3.0.0" - inherits "^2.0.1" - -rlp@^2.0.0, rlp@^2.2.1, rlp@^2.2.2, rlp@^2.2.3, rlp@^2.2.4: - version "2.2.6" - resolved "https://registry.yarnpkg.com/rlp/-/rlp-2.2.6.tgz#c80ba6266ac7a483ef1e69e8e2f056656de2fb2c" - integrity sha512-HAfAmL6SDYNWPUOJNrM500x4Thn4PZsEy5pijPh40U9WfNk0z15hUYzO9xVIMAdIHdFtD8CBDHd75Td1g36Mjg== - dependencies: - bn.js "^4.11.1" - -run-async@^2.4.0: - version "2.4.1" - resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.4.1.tgz#8440eccf99ea3e70bd409d49aab88e10c189a455" - integrity sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ== - -run-parallel@^1.1.9: - version "1.2.0" - resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee" - integrity sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA== - dependencies: - queue-microtask "^1.2.2" - -run@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/run/-/run-1.4.0.tgz#e17d9e9043ab2fe17776cb299e1237f38f0b4ffa" - integrity sha1-4X2ekEOrL+F3dsspnhI3848LT/o= - dependencies: - minimatch "*" - -rustbn.js@~0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/rustbn.js/-/rustbn.js-0.2.0.tgz#8082cb886e707155fd1cb6f23bd591ab8d55d0ca" - integrity sha512-4VlvkRUuCJvr2J6Y0ImW7NvTCriMi7ErOAqWk1y69vAdoNIzCF3yPmgeNzx+RQTLEDFq5sHfscn1MwHxP9hNfA== - -rxjs@^6.4.0, rxjs@^6.6.6, rxjs@^6.6.7: - version "6.6.7" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.7.tgz#90ac018acabf491bf65044235d5863c4dab804c9" - integrity sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ== - dependencies: - tslib "^1.9.0" - -safe-buffer@5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: - version "5.1.2" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" - integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== - -safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@~5.2.0: - version "5.2.1" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" - integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== - -safe-event-emitter@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/safe-event-emitter/-/safe-event-emitter-1.0.1.tgz#5b692ef22329ed8f69fdce607e50ca734f6f20af" - integrity sha512-e1wFe99A91XYYxoQbcq2ZJUWurxEyP8vfz7A7vuUe1s95q8r5ebraVaA1BukYJcpM6V16ugWoD9vngi8Ccu5fg== - dependencies: - events "^3.0.0" - -safe-regex@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" - integrity sha1-QKNmnzsHfR6UPURinhV91IAjvy4= - dependencies: - ret "~0.1.10" - -"safer-buffer@>= 2.1.2 < 3", "safer-buffer@>= 2.1.2 < 3.0.0", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: - version "2.1.2" - resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" - integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== - -sc-istanbul@^0.4.5: - version "0.4.6" - resolved "https://registry.yarnpkg.com/sc-istanbul/-/sc-istanbul-0.4.6.tgz#cf6784355ff2076f92d70d59047d71c13703e839" - integrity sha512-qJFF/8tW/zJsbyfh/iT/ZM5QNHE3CXxtLJbZsL+CzdJLBsPD7SedJZoUA4d8iAcN2IoMp/Dx80shOOd2x96X/g== - dependencies: - abbrev "1.0.x" - async "1.x" - escodegen "1.8.x" - esprima "2.7.x" - glob "^5.0.15" - handlebars "^4.0.1" - js-yaml "3.x" - mkdirp "0.5.x" - nopt "3.x" - once "1.x" - resolve "1.1.x" - supports-color "^3.1.0" - which "^1.1.1" - wordwrap "^1.0.0" - -scrypt-js@2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/scrypt-js/-/scrypt-js-2.0.4.tgz#32f8c5149f0797672e551c07e230f834b6af5f16" - integrity sha512-4KsaGcPnuhtCZQCxFxN3GVYIhKFPTdLd8PLC552XwbMndtD0cjRFAhDuuydXQ0h08ZfPgzqe6EKHozpuH74iDw== - -scrypt-js@3.0.1, scrypt-js@^3.0.0, scrypt-js@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/scrypt-js/-/scrypt-js-3.0.1.tgz#d314a57c2aef69d1ad98a138a21fe9eafa9ee312" - integrity sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA== - -scryptsy@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/scryptsy/-/scryptsy-1.2.1.tgz#a3225fa4b2524f802700761e2855bdf3b2d92163" - integrity sha1-oyJfpLJST4AnAHYeKFW987LZIWM= - dependencies: - pbkdf2 "^3.0.3" - -secp256k1@^3.0.1: - version "3.8.0" - resolved "https://registry.yarnpkg.com/secp256k1/-/secp256k1-3.8.0.tgz#28f59f4b01dbee9575f56a47034b7d2e3b3b352d" - integrity sha512-k5ke5avRZbtl9Tqx/SA7CbY3NF6Ro+Sj9cZxezFzuBlLDmyqPiL8hJJ+EmzD8Ig4LUDByHJ3/iPOVoRixs/hmw== - dependencies: - bindings "^1.5.0" - bip66 "^1.1.5" - bn.js "^4.11.8" - create-hash "^1.2.0" - drbg.js "^1.0.1" - elliptic "^6.5.2" - nan "^2.14.0" - safe-buffer "^5.1.2" - -secp256k1@^4.0.1: - version "4.0.2" - resolved "https://registry.yarnpkg.com/secp256k1/-/secp256k1-4.0.2.tgz#15dd57d0f0b9fdb54ac1fa1694f40e5e9a54f4a1" - integrity sha512-UDar4sKvWAksIlfX3xIaQReADn+WFnHvbVujpcbr+9Sf/69odMwy2MUsz5CKLQgX9nsIyrjuxL2imVyoNHa3fg== - dependencies: - elliptic "^6.5.2" - node-addon-api "^2.0.0" - node-gyp-build "^4.2.0" - -seedrandom@3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/seedrandom/-/seedrandom-3.0.1.tgz#eb3dde015bcf55df05a233514e5df44ef9dce083" - integrity sha512-1/02Y/rUeU1CJBAGLebiC5Lbo5FnB22gQbIFFYTLkwvp1xdABZJH1sn4ZT1MzXmPpzv+Rf/Lu2NcsLJiK4rcDg== - -semaphore-async-await@^1.5.1: - version "1.5.1" - resolved "https://registry.yarnpkg.com/semaphore-async-await/-/semaphore-async-await-1.5.1.tgz#857bef5e3644601ca4b9570b87e9df5ca12974fa" - integrity sha1-hXvvXjZEYBykuVcLh+nfXKEpdPo= - -semaphore@>=1.0.1, semaphore@^1.0.3, semaphore@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/semaphore/-/semaphore-1.1.0.tgz#aaad8b86b20fe8e9b32b16dc2ee682a8cd26a8aa" - integrity sha512-O4OZEaNtkMd/K0i6js9SL+gqy0ZCBMgUvlSqHKi4IBdjhe7wB8pwztUk1BbZ1fmrvpwFrPbHzqd2w5pTcJH6LA== - -semver-compare@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/semver-compare/-/semver-compare-1.0.0.tgz#0dee216a1c941ab37e9efb1788f6afc5ff5537fc" - integrity sha1-De4hahyUGrN+nvsXiPavxf9VN/w= - -semver-regex@^3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/semver-regex/-/semver-regex-3.1.2.tgz#34b4c0d361eef262e07199dbef316d0f2ab11807" - integrity sha512-bXWyL6EAKOJa81XG1OZ/Yyuq+oT0b2YLlxx7c+mrdYPaPbnj6WgVULXhinMIeZGufuUBu/eVRqXEhiv4imfwxA== - -"semver@2 || 3 || 4 || 5", semver@^5.3.0, semver@^5.5.0, semver@^5.6.0, semver@^5.7.0: - version "5.7.1" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" - integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== - -semver@^6.1.0, semver@^6.3.0: - version "6.3.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" - integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== - -semver@^7.2.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5: - version "7.3.5" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7" - integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ== - dependencies: - lru-cache "^6.0.0" - -semver@~5.4.1: - version "5.4.1" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.4.1.tgz#e059c09d8571f0540823733433505d3a2f00b18e" - integrity sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg== - -send@0.17.1: - version "0.17.1" - resolved "https://registry.yarnpkg.com/send/-/send-0.17.1.tgz#c1d8b059f7900f7466dd4938bdc44e11ddb376c8" - integrity sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg== - dependencies: - debug "2.6.9" - depd "~1.1.2" - destroy "~1.0.4" - encodeurl "~1.0.2" - escape-html "~1.0.3" - etag "~1.8.1" - fresh "0.5.2" - http-errors "~1.7.2" - mime "1.6.0" - ms "2.1.1" - on-finished "~2.3.0" - range-parser "~1.2.1" - statuses "~1.5.0" - -sequelize-pool@^6.0.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/sequelize-pool/-/sequelize-pool-6.1.0.tgz#caaa0c1e324d3c2c3a399fed2c7998970925d668" - integrity sha512-4YwEw3ZgK/tY/so+GfnSgXkdwIJJ1I32uZJztIEgZeAO6HMgj64OzySbWLgxj+tXhZCJnzRfkY9gINw8Ft8ZMg== - -sequelize@6.3.5: - version "6.3.5" - resolved "https://registry.yarnpkg.com/sequelize/-/sequelize-6.3.5.tgz#80e3db7ac8b76d98c45ca93334197eb6e2335158" - integrity sha512-MiwiPkYSA8NWttRKAXdU9h0TxP6HAc1fl7qZmMO/VQqQOND83G4nZLXd0kWILtAoT9cxtZgFqeb/MPYgEeXwsw== - dependencies: - debug "^4.1.1" - dottie "^2.0.0" - inflection "1.12.0" - lodash "^4.17.15" - moment "^2.26.0" - moment-timezone "^0.5.31" - retry-as-promised "^3.2.0" - semver "^7.3.2" - sequelize-pool "^6.0.0" - toposort-class "^1.0.1" - uuid "^8.1.0" - validator "^10.11.0" - wkx "^0.5.0" - -serve-static@1.14.1: - version "1.14.1" - resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.14.1.tgz#666e636dc4f010f7ef29970a88a674320898b2f9" - integrity sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg== - dependencies: - encodeurl "~1.0.2" - escape-html "~1.0.3" - parseurl "~1.3.3" - send "0.17.1" - -servify@^0.1.12: - version "0.1.12" - resolved "https://registry.yarnpkg.com/servify/-/servify-0.1.12.tgz#142ab7bee1f1d033b66d0707086085b17c06db95" - integrity sha512-/xE6GvsKKqyo1BAY+KxOWXcLpPsUUyji7Qg3bVD7hh1eRze5bR1uYiuDA/k3Gof1s9BTzQZEJK8sNcNGFIzeWw== - dependencies: - body-parser "^1.16.0" - cors "^2.8.1" - express "^4.14.0" - request "^2.79.0" - xhr "^2.3.3" - -set-blocking@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" - integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= - -set-immediate-shim@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz#4b2b1b27eb808a9f8dcc481a58e5e56f599f3f61" - integrity sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E= - -set-value@^2.0.0, set-value@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.1.tgz#a18d40530e6f07de4228c7defe4227af8cad005b" - integrity sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw== - dependencies: - extend-shallow "^2.0.1" - is-extendable "^0.1.1" - is-plain-object "^2.0.3" - split-string "^3.0.1" - -setimmediate@1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.4.tgz#20e81de622d4a02588ce0c8da8973cbcf1d3138f" - integrity sha1-IOgd5iLUoCWIzgyNqJc8vPHTE48= - -setimmediate@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" - integrity sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU= - -setprototypeof@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.1.tgz#7e95acb24aa92f5885e0abef5ba131330d4ae683" - integrity sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw== - -sha.js@^2.4.0, sha.js@^2.4.8: - version "2.4.11" - resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.11.tgz#37a5cf0b81ecbc6943de109ba2960d1b26584ae7" - integrity sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ== - dependencies: - inherits "^2.0.1" - safe-buffer "^5.0.1" - -sha1@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/sha1/-/sha1-1.1.1.tgz#addaa7a93168f393f19eb2b15091618e2700f848" - integrity sha1-rdqnqTFo85PxnrKxUJFhjicA+Eg= - dependencies: - charenc ">= 0.0.1" - crypt ">= 0.0.1" - -shebang-command@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" - integrity sha1-RKrGW2lbAzmJaMOfNj/uXer98eo= - dependencies: - shebang-regex "^1.0.0" - -shebang-command@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" - integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== - dependencies: - shebang-regex "^3.0.0" - -shebang-regex@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" - integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= - -shebang-regex@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" - integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== - -shelljs@^0.8.3: - version "0.8.4" - resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.4.tgz#de7684feeb767f8716b326078a8a00875890e3c2" - integrity sha512-7gk3UZ9kOfPLIAbslLzyWeGiEqx9e3rxwZM0KE6EL8GlGwjym9Mrlx5/p33bWTu9YG6vcS4MBxYZDHYr5lr8BQ== - dependencies: - glob "^7.0.0" - interpret "^1.0.0" - rechoir "^0.6.2" - -side-channel@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf" - integrity sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw== - dependencies: - call-bind "^1.0.0" - get-intrinsic "^1.0.2" - object-inspect "^1.9.0" - -signal-exit@^3.0.0, signal-exit@^3.0.2: - version "3.0.3" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c" - integrity sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA== - -signed-varint@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/signed-varint/-/signed-varint-2.0.1.tgz#50a9989da7c98c2c61dad119bc97470ef8528129" - integrity sha1-UKmYnafJjCxh2tEZvJdHDvhSgSk= - dependencies: - varint "~5.0.0" - -simple-concat@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/simple-concat/-/simple-concat-1.0.1.tgz#f46976082ba35c2263f1c8ab5edfe26c41c9552f" - integrity sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q== - -simple-get@^2.7.0: - version "2.8.1" - resolved "https://registry.yarnpkg.com/simple-get/-/simple-get-2.8.1.tgz#0e22e91d4575d87620620bc91308d57a77f44b5d" - integrity sha512-lSSHRSw3mQNUGPAYRqo7xy9dhKmxFXIjLjp4KHpf99GEH2VH7C3AM+Qfx6du6jhfUi6Vm7XnbEVEf7Wb6N8jRw== - dependencies: - decompress-response "^3.3.0" - once "^1.3.1" - simple-concat "^1.0.0" - -simple-swizzle@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/simple-swizzle/-/simple-swizzle-0.2.2.tgz#a4da6b635ffcccca33f70d17cb92592de95e557a" - integrity sha1-pNprY1/8zMoz9w0Xy5JZLeleVXo= - dependencies: - is-arrayish "^0.3.1" - -slash@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55" - integrity sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU= - -slash@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/slash/-/slash-2.0.0.tgz#de552851a1759df3a8f206535442f5ec4ddeab44" - integrity sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A== - -slash@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" - integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== - -slice-ansi@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-3.0.0.tgz#31ddc10930a1b7e0b67b08c96c2f49b77a789787" - integrity sha512-pSyv7bSTC7ig9Dcgbw9AuRNUb5k5V6oDudjZoMBSr13qpLBG7tB+zgCkARjq7xIUgdz5P1Qe8u+rSGdouOOIyQ== - dependencies: - ansi-styles "^4.0.0" - astral-regex "^2.0.0" - is-fullwidth-code-point "^3.0.0" - -slice-ansi@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-4.0.0.tgz#500e8dd0fd55b05815086255b3195adf2a45fe6b" - integrity sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ== - dependencies: - ansi-styles "^4.0.0" - astral-regex "^2.0.0" - is-fullwidth-code-point "^3.0.0" - -snapdragon-node@^2.0.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" - integrity sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw== - dependencies: - define-property "^1.0.0" - isobject "^3.0.0" - snapdragon-util "^3.0.1" - -snapdragon-util@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2" - integrity sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ== - dependencies: - kind-of "^3.2.0" - -snapdragon@^0.8.1: - version "0.8.2" - resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d" - integrity sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg== - dependencies: - base "^0.11.1" - debug "^2.2.0" - define-property "^0.2.5" - extend-shallow "^2.0.1" - map-cache "^0.2.2" - source-map "^0.5.6" - source-map-resolve "^0.5.0" - use "^3.1.0" - -sol-digger@0.0.2: - version "0.0.2" - resolved "https://registry.yarnpkg.com/sol-digger/-/sol-digger-0.0.2.tgz#406c4a9d31e269e7f88eb1c2ea101318e5e09025" - integrity sha1-QGxKnTHiaef4jrHC6hATGOXgkCU= - -sol-explore@1.6.1: - version "1.6.1" - resolved "https://registry.yarnpkg.com/sol-explore/-/sol-explore-1.6.1.tgz#b59f073c69fe332560d5a10c32ba8ca7f2986cfb" - integrity sha1-tZ8HPGn+MyVg1aEMMrqMp/KYbPs= - -solc@0.7.3: - version "0.7.3" - resolved "https://registry.yarnpkg.com/solc/-/solc-0.7.3.tgz#04646961bd867a744f63d2b4e3c0701ffdc7d78a" - integrity sha512-GAsWNAjGzIDg7VxzP6mPjdurby3IkGCjQcM8GFYZT6RyaoUZKmMU6Y7YwG+tFGhv7dwZ8rmR4iwFDrrD99JwqA== - dependencies: - command-exists "^1.2.8" - commander "3.0.2" - follow-redirects "^1.12.1" - fs-extra "^0.30.0" - js-sha3 "0.8.0" - memorystream "^0.3.1" - require-from-string "^2.0.0" - semver "^5.5.0" - tmp "0.0.33" - -solc@^0.4.20: - version "0.4.26" - resolved "https://registry.yarnpkg.com/solc/-/solc-0.4.26.tgz#5390a62a99f40806b86258c737c1cf653cc35cb5" - integrity sha512-o+c6FpkiHd+HPjmjEVpQgH7fqZ14tJpXhho+/bQXlXbliLIS/xjXb42Vxh+qQY1WCSTMQ0+a5vR9vi0MfhU6mA== - dependencies: - fs-extra "^0.30.0" - memorystream "^0.3.1" - require-from-string "^1.1.0" - semver "^5.3.0" - yargs "^4.7.1" - -solc@^0.6.3: - version "0.6.12" - resolved "https://registry.yarnpkg.com/solc/-/solc-0.6.12.tgz#48ac854e0c729361b22a7483645077f58cba080e" - integrity sha512-Lm0Ql2G9Qc7yPP2Ba+WNmzw2jwsrd3u4PobHYlSOxaut3TtUbj9+5ZrT6f4DUpNPEoBaFUOEg9Op9C0mk7ge9g== - dependencies: - command-exists "^1.2.8" - commander "3.0.2" - fs-extra "^0.30.0" - js-sha3 "0.8.0" - memorystream "^0.3.1" - require-from-string "^2.0.0" - semver "^5.5.0" - tmp "0.0.33" - -solidity-ast@^0.4.15: - version "0.4.21" - resolved "https://registry.yarnpkg.com/solidity-ast/-/solidity-ast-0.4.21.tgz#3f11520dd7217b19498d7d99c7079dad09de0349" - integrity sha512-WJq+QCrwfclgaI9I/RYBVIzrvpFy8cOuhHojUB9lXuNjGsyY5lcN5zjdnoi09CG/bewH7QCg+Mo1/r4z7Pds8A== - -solidity-comments-extractor@^0.0.7: - version "0.0.7" - resolved "https://registry.yarnpkg.com/solidity-comments-extractor/-/solidity-comments-extractor-0.0.7.tgz#99d8f1361438f84019795d928b931f4e5c39ca19" - integrity sha512-wciNMLg/Irp8OKGrh3S2tfvZiZ0NEyILfcRCXCD4mp7SgK/i9gzLfhY2hY7VMCQJ3kH9UB9BzNdibIVMchzyYw== - -solidity-coverage@^0.7.16: - version "0.7.16" - resolved "https://registry.yarnpkg.com/solidity-coverage/-/solidity-coverage-0.7.16.tgz#c8c8c46baa361e2817bbf275116ddd2ec90a55fb" - integrity sha512-ttBOStywE6ZOTJmmABSg4b8pwwZfYKG8zxu40Nz+sRF5bQX7JULXWj/XbX0KXps3Fsp8CJXg8P29rH3W54ipxw== - dependencies: - "@solidity-parser/parser" "^0.12.0" - "@truffle/provider" "^0.2.24" - chalk "^2.4.2" - death "^1.1.0" - detect-port "^1.3.0" - fs-extra "^8.1.0" - ganache-cli "^6.11.0" - ghost-testrpc "^0.0.2" - global-modules "^2.0.0" - globby "^10.0.1" - jsonschema "^1.2.4" - lodash "^4.17.15" - node-emoji "^1.10.0" - pify "^4.0.1" - recursive-readdir "^2.2.2" - sc-istanbul "^0.4.5" - semver "^7.3.4" - shelljs "^0.8.3" - web3-utils "^1.3.0" - -solium-plugin-security@0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/solium-plugin-security/-/solium-plugin-security-0.1.1.tgz#2a87bcf8f8c3abf7d198e292e4ac080284e3f3f6" - integrity sha512-kpLirBwIq4mhxk0Y/nn5cQ6qdJTI+U1LO3gpoNIcqNaW+sI058moXBe2UiHs+9wvF9IzYD49jcKhFTxcR9u9SQ== - -solparse@2.2.8: - version "2.2.8" - resolved "https://registry.yarnpkg.com/solparse/-/solparse-2.2.8.tgz#d13e42dbed95ce32f43894f5ec53f00d14cf9f11" - integrity sha512-Tm6hdfG72DOxD40SD+T5ddbekWglNWjzDRSNq7ZDIOHVsyaJSeeunUuWNj4DE7uDrJK3tGQuX0ZTDZWNYsGPMA== - dependencies: - mocha "^4.0.1" - pegjs "^0.10.0" - yargs "^10.0.3" - -sonic-boom@^1.0.2: - version "1.4.1" - resolved "https://registry.yarnpkg.com/sonic-boom/-/sonic-boom-1.4.1.tgz#d35d6a74076624f12e6f917ade7b9d75e918f53e" - integrity sha512-LRHh/A8tpW7ru89lrlkU4AszXt1dbwSjVWguGrmlxE7tawVmDBlI1PILMkXAxJTwqhgsEeTHzj36D5CmHgQmNg== - dependencies: - atomic-sleep "^1.0.0" - flatstr "^1.0.12" - -source-map-resolve@^0.5.0: - version "0.5.3" - resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.3.tgz#190866bece7553e1f8f267a2ee82c606b5509a1a" - integrity sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw== - dependencies: - atob "^2.1.2" - decode-uri-component "^0.2.0" - resolve-url "^0.2.1" - source-map-url "^0.4.0" - urix "^0.1.0" - -source-map-support@0.5.12: - version "0.5.12" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.12.tgz#b4f3b10d51857a5af0138d3ce8003b201613d599" - integrity sha512-4h2Pbvyy15EE02G+JOZpUCmqWJuqrs+sEkzewTm++BPi7Hvn/HwcqLAcNxYAyI0x13CpPPn+kMjl+hplXMHITQ== - dependencies: - buffer-from "^1.0.0" - source-map "^0.6.0" - -source-map-support@^0.4.15: - version "0.4.18" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.18.tgz#0286a6de8be42641338594e97ccea75f0a2c585f" - integrity sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA== - dependencies: - source-map "^0.5.6" - -source-map-support@^0.5.13, source-map-support@^0.5.17: - version "0.5.19" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61" - integrity sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw== - dependencies: - buffer-from "^1.0.0" - source-map "^0.6.0" - -source-map-url@^0.4.0: - version "0.4.1" - resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.1.tgz#0af66605a745a5a2f91cf1bbf8a7afbc283dec56" - integrity sha512-cPiFOTLUKvJFIg4SKVScy4ilPPW6rFgMgfuZJPNoDuMs3nC1HbMUycBoJw77xFIp6z1UJQJOfx6C9GMH80DiTw== - -source-map@^0.5.6, source-map@^0.5.7: - version "0.5.7" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" - integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= - -source-map@^0.6.0, source-map@^0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" - integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== - -source-map@~0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.2.0.tgz#dab73fbcfc2ba819b4de03bd6f6eaa48164b3f9d" - integrity sha1-2rc/vPwrqBm03gO9b26qSBZLP50= - dependencies: - amdefine ">=0.0.4" - -spdx-correct@^3.0.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.1.tgz#dece81ac9c1e6713e5f7d1b6f17d468fa53d89a9" - integrity sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w== - dependencies: - spdx-expression-parse "^3.0.0" - spdx-license-ids "^3.0.0" - -spdx-exceptions@^2.1.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz#3f28ce1a77a00372683eade4a433183527a2163d" - integrity sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A== - -spdx-expression-parse@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz#cf70f50482eefdc98e3ce0a6833e4a53ceeba679" - integrity sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q== - dependencies: - spdx-exceptions "^2.1.0" - spdx-license-ids "^3.0.0" - -spdx-license-ids@^3.0.0: - version "3.0.9" - resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.9.tgz#8a595135def9592bda69709474f1cbeea7c2467f" - integrity sha512-Ki212dKK4ogX+xDo4CtOZBVIwhsKBEfsEEcwmJfLQzirgc2jIWdzg40Unxz/HzEUqM1WFzVlQSMF9kZZ2HboLQ== - -split-string@^3.0.1, split-string@^3.0.2: - version "3.1.0" - resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" - integrity sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw== - dependencies: - extend-shallow "^3.0.0" - -split2@^3.1.1: - version "3.2.2" - resolved "https://registry.yarnpkg.com/split2/-/split2-3.2.2.tgz#bf2cf2a37d838312c249c89206fd7a17dd12365f" - integrity sha512-9NThjpgZnifTkJpzTZ7Eue85S49QwpNhZTq6GRJwObb6jnLFNGB7Qm73V5HewTROPyxD0C29xqmaI68bQtV+hg== - dependencies: - readable-stream "^3.0.0" - -sprintf-js@~1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" - integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= - -sshpk@^1.7.0: - version "1.16.1" - resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.16.1.tgz#fb661c0bef29b39db40769ee39fa70093d6f6877" - integrity sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg== - dependencies: - asn1 "~0.2.3" - assert-plus "^1.0.0" - bcrypt-pbkdf "^1.0.0" - dashdash "^1.12.0" - ecc-jsbn "~0.1.1" - getpass "^0.1.1" - jsbn "~0.1.0" - safer-buffer "^2.0.2" - tweetnacl "~0.14.0" - -stable@^0.1.8: - version "0.1.8" - resolved "https://registry.yarnpkg.com/stable/-/stable-0.1.8.tgz#836eb3c8382fe2936feaf544631017ce7d47a3cf" - integrity sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w== - -stack-trace@0.0.x: - version "0.0.10" - resolved "https://registry.yarnpkg.com/stack-trace/-/stack-trace-0.0.10.tgz#547c70b347e8d32b4e108ea1a2a159e5fdde19c0" - integrity sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA= - -stacktrace-parser@^0.1.10: - version "0.1.10" - resolved "https://registry.yarnpkg.com/stacktrace-parser/-/stacktrace-parser-0.1.10.tgz#29fb0cae4e0d0b85155879402857a1639eb6051a" - integrity sha512-KJP1OCML99+8fhOHxwwzyWrlUuVX5GQ0ZpJTd1DFXhdkrvg1szxfHhawXUZ3g9TkXORQd4/WG68jMlQZ2p8wlg== - dependencies: - type-fest "^0.7.1" - -static-extend@^0.1.1: - version "0.1.2" - resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" - integrity sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY= - dependencies: - define-property "^0.2.5" - object-copy "^0.1.0" - -"statuses@>= 1.5.0 < 2", statuses@~1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" - integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow= - -stealthy-require@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/stealthy-require/-/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b" - integrity sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks= - -stream-shift@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/stream-shift/-/stream-shift-1.0.1.tgz#d7088281559ab2778424279b0877da3c392d5a3d" - integrity sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ== - -stream-to-it@^0.2.0, stream-to-it@^0.2.1: - version "0.2.3" - resolved "https://registry.yarnpkg.com/stream-to-it/-/stream-to-it-0.2.3.tgz#b9320ceb26a51b313de81036d4354d9b657f4d2d" - integrity sha512-xaK9EjPtLox5rrC7YLSBXSanTtUJN/lzJlMFvy9VaROmnyvy0U/X6m2uMhXPJRn3g3M9uOSIzTszW7BPiWSg9w== - dependencies: - get-iterator "^1.0.2" - -stream-to-pull-stream@^1.7.1: - version "1.7.3" - resolved "https://registry.yarnpkg.com/stream-to-pull-stream/-/stream-to-pull-stream-1.7.3.tgz#4161aa2d2eb9964de60bfa1af7feaf917e874ece" - integrity sha512-6sNyqJpr5dIOQdgNy/xcDWwDuzAsAwVzhzrWlAPAQ7Lkjx/rv0wgvxEyKwTq6FmNd5rjTrELt/CLmaSw7crMGg== - dependencies: - looper "^3.0.0" - pull-stream "^3.2.3" - -strict-uri-encode@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz#279b225df1d582b1f54e65addd4352e18faa0713" - integrity sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM= - -string-argv@0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/string-argv/-/string-argv-0.3.1.tgz#95e2fbec0427ae19184935f816d74aaa4c5c19da" - integrity sha512-a1uQGz7IyVy9YwhqjZIZu1c8JO8dNIe20xBmSS6qu9kv++k3JGzCVmprbNN5Kn+BgzD5E7YYwg1CcjuJMRNsvg== - -string-width@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" - integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M= - dependencies: - code-point-at "^1.0.0" - is-fullwidth-code-point "^1.0.0" - strip-ansi "^3.0.0" - -"string-width@^1.0.2 || 2", string-width@^2.0.0, string-width@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" - integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== - dependencies: - is-fullwidth-code-point "^2.0.0" - strip-ansi "^4.0.0" - -string-width@^3.0.0, string-width@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961" - integrity sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w== - dependencies: - emoji-regex "^7.0.1" - is-fullwidth-code-point "^2.0.0" - strip-ansi "^5.1.0" - -string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2: - version "4.2.2" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.2.tgz#dafd4f9559a7585cfba529c6a0a4f73488ebd4c5" - integrity sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.0" - -string.prototype.trim@~1.2.1: - version "1.2.4" - resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.2.4.tgz#6014689baf5efaf106ad031a5fa45157666ed1bd" - integrity sha512-hWCk/iqf7lp0/AgTF7/ddO1IWtSNPASjlzCicV5irAVdE1grjsneK26YG6xACMBEdCvO8fUST0UzDMh/2Qy+9Q== - dependencies: - call-bind "^1.0.2" - define-properties "^1.1.3" - es-abstract "^1.18.0-next.2" - -string.prototype.trimend@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz#e75ae90c2942c63504686c18b287b4a0b1a45f80" - integrity sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A== - dependencies: - call-bind "^1.0.2" - define-properties "^1.1.3" - -string.prototype.trimstart@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.4.tgz#b36399af4ab2999b4c9c648bd7a3fb2bb26feeed" - integrity sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw== - dependencies: - call-bind "^1.0.2" - define-properties "^1.1.3" - -string_decoder@^1.1.1: - version "1.3.0" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" - integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== - dependencies: - safe-buffer "~5.2.0" - -string_decoder@~0.10.x: - version "0.10.31" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" - integrity sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ= - -string_decoder@~1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" - integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== - dependencies: - safe-buffer "~5.1.0" - -stringify-object@^3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/stringify-object/-/stringify-object-3.3.0.tgz#703065aefca19300d3ce88af4f5b3956d7556629" - integrity sha512-rHqiFh1elqCQ9WPLIC8I0Q/g/wj5J1eMkyoiD6eoQApWHP0FtlK7rqnhmabL5VUY9JQCcqwwvlOaSuutekgyrw== - dependencies: - get-own-enumerable-property-symbols "^3.0.0" - is-obj "^1.0.1" - is-regexp "^1.0.0" - -strip-ansi@^3.0.0, strip-ansi@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" - integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= - dependencies: - ansi-regex "^2.0.0" - -strip-ansi@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" - integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8= - dependencies: - ansi-regex "^3.0.0" - -strip-ansi@^5.0.0, strip-ansi@^5.1.0, strip-ansi@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" - integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== - dependencies: - ansi-regex "^4.1.0" - -strip-ansi@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.0.tgz#0b1571dd7669ccd4f3e06e14ef1eed26225ae532" - integrity sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w== - dependencies: - ansi-regex "^5.0.0" - -strip-bom@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" - integrity sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4= - dependencies: - is-utf8 "^0.2.0" - -strip-bom@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" - integrity sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM= - -strip-eof@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" - integrity sha1-u0P/VZim6wXYm1n80SnJgzE2Br8= - -strip-final-newline@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/strip-final-newline/-/strip-final-newline-2.0.0.tgz#89b852fb2fcbe936f6f4b3187afb0a12c1ab58ad" - integrity sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA== - -strip-hex-prefix@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz#0c5f155fef1151373377de9dbb588da05500e36f" - integrity sha1-DF8VX+8RUTczd96du1iNoFUA428= - dependencies: - is-hex-prefixed "1.0.0" - -strip-json-comments@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" - integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= - -strip-json-comments@^3.1.0, strip-json-comments@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" - integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== - -supports-color@4.4.0: - version "4.4.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-4.4.0.tgz#883f7ddabc165142b2a61427f3352ded195d1a3e" - integrity sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ== - dependencies: - has-flag "^2.0.0" - -supports-color@6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-6.0.0.tgz#76cfe742cf1f41bb9b1c29ad03068c05b4c0e40a" - integrity sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg== - dependencies: - has-flag "^3.0.0" - -supports-color@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" - integrity sha1-U10EXOa2Nj+kARcIRimZXp3zJMc= - -supports-color@^3.1.0: - version "3.2.3" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.2.3.tgz#65ac0504b3954171d8a64946b2ae3cbb8a5f54f6" - integrity sha1-ZawFBLOVQXHYpklGsq48u4pfVPY= - dependencies: - has-flag "^1.0.0" - -supports-color@^5.3.0: - version "5.5.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" - integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== - dependencies: - has-flag "^3.0.0" - -supports-color@^7.1.0: - version "7.2.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" - integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== - dependencies: - has-flag "^4.0.0" - -swarm-js@^0.1.40: - version "0.1.40" - resolved "https://registry.yarnpkg.com/swarm-js/-/swarm-js-0.1.40.tgz#b1bc7b6dcc76061f6c772203e004c11997e06b99" - integrity sha512-yqiOCEoA4/IShXkY3WKwP5PvZhmoOOD8clsKA7EEcRILMkTEYHCQ21HDCAcVpmIxZq4LyZvWeRJ6quIyHk1caA== - dependencies: - bluebird "^3.5.0" - buffer "^5.0.5" - eth-lib "^0.1.26" - fs-extra "^4.0.2" - got "^7.1.0" - mime-types "^2.1.16" - mkdirp-promise "^5.0.1" - mock-fs "^4.1.0" - setimmediate "^1.0.5" - tar "^4.0.2" - xhr-request "^1.0.1" - -sync-request@^6.0.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/sync-request/-/sync-request-6.1.0.tgz#e96217565b5e50bbffe179868ba75532fb597e68" - integrity sha512-8fjNkrNlNCrVc/av+Jn+xxqfCjYaBoHqCsDz6mt030UMxJGr+GSfCV1dQt2gRtlL63+VPidwDVLr7V2OcTSdRw== - dependencies: - http-response-object "^3.0.1" - sync-rpc "^1.2.1" - then-request "^6.0.0" - -sync-rpc@^1.2.1: - version "1.3.6" - resolved "https://registry.yarnpkg.com/sync-rpc/-/sync-rpc-1.3.6.tgz#b2e8b2550a12ccbc71df8644810529deb68665a7" - integrity sha512-J8jTXuZzRlvU7HemDgHi3pGnh/rkoqR/OZSjhTyyZrEkkYQbk7Z33AXp37mkPfPpfdOuj7Ex3H/TJM1z48uPQw== - dependencies: - get-port "^3.1.0" - -table@^6.0.9: - version "6.7.1" - resolved "https://registry.yarnpkg.com/table/-/table-6.7.1.tgz#ee05592b7143831a8c94f3cee6aae4c1ccef33e2" - integrity sha512-ZGum47Yi6KOOFDE8m223td53ath2enHcYLgOCjGr5ngu8bdIARQk6mN/wRMv4yMRcHnCSnHbCEha4sobQx5yWg== - dependencies: - ajv "^8.0.1" - lodash.clonedeep "^4.5.0" - lodash.truncate "^4.4.2" - slice-ansi "^4.0.0" - string-width "^4.2.0" - strip-ansi "^6.0.0" - -tape@^4.6.3: - version "4.13.3" - resolved "https://registry.yarnpkg.com/tape/-/tape-4.13.3.tgz#51b3d91c83668c7a45b1a594b607dee0a0b46278" - integrity sha512-0/Y20PwRIUkQcTCSi4AASs+OANZZwqPKaipGCEwp10dQMipVvSZwUUCi01Y/OklIGyHKFhIcjock+DKnBfLAFw== - dependencies: - deep-equal "~1.1.1" - defined "~1.0.0" - dotignore "~0.1.2" - for-each "~0.3.3" - function-bind "~1.1.1" - glob "~7.1.6" - has "~1.0.3" - inherits "~2.0.4" - is-regex "~1.0.5" - minimist "~1.2.5" - object-inspect "~1.7.0" - resolve "~1.17.0" - resumer "~0.0.0" - string.prototype.trim "~1.2.1" - through "~2.3.8" - -tar@^4.0.2: - version "4.4.13" - resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.13.tgz#43b364bc52888d555298637b10d60790254ab525" - integrity sha512-w2VwSrBoHa5BsSyH+KxEqeQBAllHhccyMFVHtGtdMpF4W7IRWfZjFiQceJPChOeTsSDVUpER2T8FA93pr0L+QA== - dependencies: - chownr "^1.1.1" - fs-minipass "^1.2.5" - minipass "^2.8.6" - minizlib "^1.2.1" - mkdirp "^0.5.0" - safe-buffer "^5.1.2" - yallist "^3.0.3" - -tdigest@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/tdigest/-/tdigest-0.1.1.tgz#2e3cb2c39ea449e55d1e6cd91117accca4588021" - integrity sha1-Ljyyw56kSeVdHmzZEReszKRYgCE= - dependencies: - bintrees "1.0.1" - -test-value@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/test-value/-/test-value-2.1.0.tgz#11da6ff670f3471a73b625ca4f3fdcf7bb748291" - integrity sha1-Edpv9nDzRxpztiXKTz/c97t0gpE= - dependencies: - array-back "^1.0.3" - typical "^2.6.0" - -testrpc@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/testrpc/-/testrpc-0.0.1.tgz#83e2195b1f5873aec7be1af8cbe6dcf39edb7aed" - integrity sha512-afH1hO+SQ/VPlmaLUFj2636QMeDvPCeQMc/9RBMW0IfjNe9gFD9Ra3ShqYkB7py0do1ZcCna/9acHyzTJ+GcNA== - -text-hex@1.0.x: - version "1.0.0" - resolved "https://registry.yarnpkg.com/text-hex/-/text-hex-1.0.0.tgz#69dc9c1b17446ee79a92bf5b884bb4b9127506f5" - integrity sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg== - -text-table@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" - integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= - -then-request@^6.0.0: - version "6.0.2" - resolved "https://registry.yarnpkg.com/then-request/-/then-request-6.0.2.tgz#ec18dd8b5ca43aaee5cb92f7e4c1630e950d4f0c" - integrity sha512-3ZBiG7JvP3wbDzA9iNY5zJQcHL4jn/0BWtXIkagfz7QgOL/LqjCEOBQuJNZfu0XYnv5JhKh+cDxCPM4ILrqruA== - dependencies: - "@types/concat-stream" "^1.6.0" - "@types/form-data" "0.0.33" - "@types/node" "^8.0.0" - "@types/qs" "^6.2.31" - caseless "~0.12.0" - concat-stream "^1.6.0" - form-data "^2.2.0" - http-basic "^8.1.1" - http-response-object "^3.0.1" - promise "^8.0.0" - qs "^6.4.0" - -through2@^2.0.3: - version "2.0.5" - resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.5.tgz#01c1e39eb31d07cb7d03a96a70823260b23132cd" - integrity sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ== - dependencies: - readable-stream "~2.3.6" - xtend "~4.0.1" - -through2@^3.0.1: - version "3.0.2" - resolved "https://registry.yarnpkg.com/through2/-/through2-3.0.2.tgz#99f88931cfc761ec7678b41d5d7336b5b6a07bf4" - integrity sha512-enaDQ4MUyP2W6ZyT6EsMzqBPZaM/avg8iuo+l2d3QCs0J+6RaqkHV/2/lOwDTueBHeJ/2LG9lrLW3d5rWPucuQ== - dependencies: - inherits "^2.0.4" - readable-stream "2 || 3" - -through@^2.3.6, through@^2.3.8, through@~2.3.4, through@~2.3.8: - version "2.3.8" - resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" - integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= - -timed-out@^4.0.0, timed-out@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/timed-out/-/timed-out-4.0.1.tgz#f32eacac5a175bea25d7fab565ab3ed8741ef56f" - integrity sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8= - -tmp@0.0.33, tmp@^0.0.33: - version "0.0.33" - resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" - integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw== - dependencies: - os-tmpdir "~1.0.2" - -tmp@0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.1.0.tgz#ee434a4e22543082e294ba6201dcc6eafefa2877" - integrity sha512-J7Z2K08jbGcdA1kkQpJSqLF6T0tdQqpR2pnSUXsIchbPdTI9v3e85cLW0d6WDhwuAleOV71j2xWs8qMPfK7nKw== - dependencies: - rimraf "^2.6.3" - -to-fast-properties@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" - integrity sha1-uDVx+k2MJbguIxsG46MFXeTKGkc= - -to-object-path@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" - integrity sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68= - dependencies: - kind-of "^3.0.2" - -to-readable-stream@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/to-readable-stream/-/to-readable-stream-1.0.0.tgz#ce0aa0c2f3df6adf852efb404a783e77c0475771" - integrity sha512-Iq25XBt6zD5npPhlLVXGFN3/gyR2/qODcKNNyTMd4vbm39HUaOiAM4PMq0eMVC/Tkxz+Zjdsc55g9yyz+Yq00Q== - -to-regex-range@^2.1.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38" - integrity sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg= - dependencies: - is-number "^3.0.0" - repeat-string "^1.6.1" - -to-regex-range@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" - integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== - dependencies: - is-number "^7.0.0" - -to-regex@^3.0.1, to-regex@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" - integrity sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw== - dependencies: - define-property "^2.0.2" - extend-shallow "^3.0.2" - regex-not "^1.0.2" - safe-regex "^1.1.0" - -toidentifier@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.0.tgz#7e1be3470f1e77948bc43d94a3c8f4d7752ba553" - integrity sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw== - -toposort-class@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/toposort-class/-/toposort-class-1.0.1.tgz#7ffd1f78c8be28c3ba45cd4e1a3f5ee193bd9988" - integrity sha1-f/0feMi+KMO6Rc1OGj9e4ZO9mYg= - -tough-cookie@^2.3.3, tough-cookie@~2.5.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2" - integrity sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g== - dependencies: - psl "^1.1.28" - punycode "^2.1.1" - -trim-right@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" - integrity sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM= - -triple-beam@^1.2.0, triple-beam@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/triple-beam/-/triple-beam-1.3.0.tgz#a595214c7298db8339eeeee083e4d10bd8cb8dd9" - integrity sha512-XrHUvV5HpdLmIj4uVMxHggLbFSZYIn7HEWsqePZcI50pco+MPqJ50wMGY794X7AOOhxOBAjbkqfAbEe/QMp2Lw== - -"true-case-path@^2.2.1": - version "2.2.1" - resolved "https://registry.yarnpkg.com/true-case-path/-/true-case-path-2.2.1.tgz#c5bf04a5bbec3fd118be4084461b3a27c4d796bf" - integrity sha512-0z3j8R7MCjy10kc/g+qg7Ln3alJTodw9aDuVWZa3uiWqfuBMKeAeP2ocWcxoyM3D73yz3Jt/Pu4qPr4wHSdB/Q== - -ts-essentials@^1.0.0: - version "1.0.4" - resolved "https://registry.yarnpkg.com/ts-essentials/-/ts-essentials-1.0.4.tgz#ce3b5dade5f5d97cf69889c11bf7d2da8555b15a" - integrity sha512-q3N1xS4vZpRouhYHDPwO0bDW3EZ6SK9CrrDHxi/D6BPReSjpVgWIOpLS2o0gSBZm+7q/wyKp6RVM1AeeW7uyfQ== - -ts-essentials@^6.0.3: - version "6.0.7" - resolved "https://registry.yarnpkg.com/ts-essentials/-/ts-essentials-6.0.7.tgz#5f4880911b7581a873783740ce8b94da163d18a6" - integrity sha512-2E4HIIj4tQJlIHuATRHayv0EfMGK3ris/GRk1E3CFnsZzeNV+hUmelbaTZHLtXaZppM5oLhHRtO04gINC4Jusw== - -ts-essentials@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/ts-essentials/-/ts-essentials-7.0.1.tgz#d205508cae0cdadfb73c89503140cf2228389e2d" - integrity sha512-8lwh3QJtIc1UWhkQtr9XuksXu3O0YQdEE5g79guDfhCaU1FWTDIEDZ1ZSx4HTHUmlJZ8L812j3BZQ4a0aOUkSA== - -ts-generator@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/ts-generator/-/ts-generator-0.1.1.tgz#af46f2fb88a6db1f9785977e9590e7bcd79220ab" - integrity sha512-N+ahhZxTLYu1HNTQetwWcx3so8hcYbkKBHTr4b4/YgObFTIKkOSSsaa+nal12w8mfrJAyzJfETXawbNjSfP2gQ== - dependencies: - "@types/mkdirp" "^0.5.2" - "@types/prettier" "^2.1.1" - "@types/resolve" "^0.0.8" - chalk "^2.4.1" - glob "^7.1.2" - mkdirp "^0.5.1" - prettier "^2.1.2" - resolve "^1.8.1" - ts-essentials "^1.0.0" - -ts-node@^9.1.1: - version "9.1.1" - resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-9.1.1.tgz#51a9a450a3e959401bda5f004a72d54b936d376d" - integrity sha512-hPlt7ZACERQGf03M253ytLY3dHbGNGrAq9qIHWUY9XHYl1z7wYngSr3OQ5xmui8o2AaxsONxIzjafLUiWBo1Fg== - dependencies: - arg "^4.1.0" - create-require "^1.1.0" - diff "^4.0.1" - make-error "^1.1.1" - source-map-support "^0.5.17" - yn "3.1.1" - -tsconfig-paths@^3.9.0: - version "3.9.0" - resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.9.0.tgz#098547a6c4448807e8fcb8eae081064ee9a3c90b" - integrity sha512-dRcuzokWhajtZWkQsDVKbWyY+jgcLC5sqJhg2PSgf4ZkH2aHPvaOY8YWGhmjb68b5qqTfasSsDO9k7RUiEmZAw== - dependencies: - "@types/json5" "^0.0.29" - json5 "^1.0.1" - minimist "^1.2.0" - strip-bom "^3.0.0" - -tslib@^1.8.1, tslib@^1.9.0, tslib@^1.9.3: - version "1.14.1" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" - integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== - -tsort@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/tsort/-/tsort-0.0.1.tgz#e2280f5e817f8bf4275657fd0f9aebd44f5a2786" - integrity sha1-4igPXoF/i/QnVlf9D5rr1E9aJ4Y= - -tsutils@^3.17.1: - version "3.21.0" - resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.21.0.tgz#b48717d394cea6c1e096983eed58e9d61715b623" - integrity sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA== - dependencies: - tslib "^1.8.1" - -tunnel-agent@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" - integrity sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0= - dependencies: - safe-buffer "^5.0.1" - -tweetnacl-util@^0.15.0: - version "0.15.1" - resolved "https://registry.yarnpkg.com/tweetnacl-util/-/tweetnacl-util-0.15.1.tgz#b80fcdb5c97bcc508be18c44a4be50f022eea00b" - integrity sha512-RKJBIj8lySrShN4w6i/BonWp2Z/uxwC3h4y7xsRrpP59ZboCd0GpEVsOnMDYLMmKBpYhb5TgHzZXy7wTfYFBRw== - -tweetnacl@^0.14.3, tweetnacl@~0.14.0: - version "0.14.5" - resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" - integrity sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q= - -tweetnacl@^1.0.0, tweetnacl@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-1.0.3.tgz#ac0af71680458d8a6378d0d0d050ab1407d35596" - integrity sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw== - -type-check@^0.4.0, type-check@~0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1" - integrity sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew== - dependencies: - prelude-ls "^1.2.1" - -type-check@~0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" - integrity sha1-WITKtRLPHTVeP7eE8wgEsrUg23I= - dependencies: - prelude-ls "~1.1.2" - -type-detect@4.0.8, type-detect@^4.0.0, type-detect@^4.0.5: - version "4.0.8" - resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" - integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== - -type-fest@^0.20.2: - version "0.20.2" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4" - integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== - -type-fest@^0.21.3: - version "0.21.3" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" - integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== - -type-fest@^0.7.1: - version "0.7.1" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.7.1.tgz#8dda65feaf03ed78f0a3f9678f1869147f7c5c48" - integrity sha512-Ne2YiiGN8bmrmJJEuTWTLJR32nh/JdL1+PSicowtNb0WFpn59GK8/lfD61bVtzguz7b3PBt74nxpv/Pw5po5Rg== - -type-fest@^0.8.1: - version "0.8.1" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d" - integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== - -type-is@~1.6.17, type-is@~1.6.18: - version "1.6.18" - resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131" - integrity sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g== - dependencies: - media-typer "0.3.0" - mime-types "~2.1.24" - -type@^1.0.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/type/-/type-1.2.0.tgz#848dd7698dafa3e54a6c479e759c4bc3f18847a0" - integrity sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg== - -type@^2.0.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/type/-/type-2.5.0.tgz#0a2e78c2e77907b252abe5f298c1b01c63f0db3d" - integrity sha512-180WMDQaIMm3+7hGXWf12GtdniDEy7nYcyFMKJn/eZz/6tSLXrUN9V0wKSbMjej0I1WHWbpREDEKHtqPQa9NNw== - -typechain@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/typechain/-/typechain-3.0.0.tgz#d5a47700831f238e43f7429b987b4bb54849b92e" - integrity sha512-ft4KVmiN3zH4JUFu2WJBrwfHeDf772Tt2d8bssDTo/YcckKW2D+OwFrHXRC6hJvO3mHjFQTihoMV6fJOi0Hngg== - dependencies: - command-line-args "^4.0.7" - debug "^4.1.1" - fs-extra "^7.0.0" - js-sha3 "^0.8.0" - lodash "^4.17.15" - ts-essentials "^6.0.3" - ts-generator "^0.1.1" - -typechain@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/typechain/-/typechain-5.0.0.tgz#730e5fb4709964eed3db03be332b38ba6eaa1d9f" - integrity sha512-Ko2/8co0FUmPUkaXPcb8PC3ncWa5P72nvkiNMgcomd4OAInltJlITF0kcW2cZmI2sFkvmaHV5TZmCnOHgo+i5Q== - dependencies: - "@types/prettier" "^2.1.1" - command-line-args "^4.0.7" - debug "^4.1.1" - fs-extra "^7.0.0" - glob "^7.1.6" - js-sha3 "^0.8.0" - lodash "^4.17.15" - prettier "^2.1.2" - ts-essentials "^7.0.1" - -typedarray-to-buffer@^3.1.5: - version "3.1.5" - resolved "https://registry.yarnpkg.com/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz#a97ee7a9ff42691b9f783ff1bc5112fe3fca9080" - integrity sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q== - dependencies: - is-typedarray "^1.0.0" - -typedarray@^0.0.6: - version "0.0.6" - resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" - integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= - -typescript@^4.2.4: - version "4.3.2" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.3.2.tgz#399ab18aac45802d6f2498de5054fcbbe716a805" - integrity sha512-zZ4hShnmnoVnAHpVHWpTcxdv7dWP60S2FsydQLV8V5PbS3FifjWFFRiHSWpDJahly88PRyV5teTSLoq4eG7mKw== - -typewise-core@^1.2, typewise-core@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/typewise-core/-/typewise-core-1.2.0.tgz#97eb91805c7f55d2f941748fa50d315d991ef195" - integrity sha1-l+uRgFx/VdL5QXSPpQ0xXZke8ZU= - -typewise@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/typewise/-/typewise-1.0.3.tgz#1067936540af97937cc5dcf9922486e9fa284651" - integrity sha1-EGeTZUCvl5N8xdz5kiSG6fooRlE= - dependencies: - typewise-core "^1.2.0" - -typewiselite@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/typewiselite/-/typewiselite-1.0.0.tgz#c8882fa1bb1092c06005a97f34ef5c8508e3664e" - integrity sha1-yIgvobsQksBgBal/NO9chQjjZk4= - -typical@^2.6.0, typical@^2.6.1: - version "2.6.1" - resolved "https://registry.yarnpkg.com/typical/-/typical-2.6.1.tgz#5c080e5d661cbbe38259d2e70a3c7253e873881d" - integrity sha1-XAgOXWYcu+OCWdLnCjxyU+hziB0= - -uglify-js@^3.1.4: - version "3.13.8" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.13.8.tgz#7c2f9f2553f611f3ff592bdc19c6fb208dc60afb" - integrity sha512-PvFLMFIQHfIjFFlvAch69U2IvIxK9TNzNWt1SxZGp9JZ/v70yvqIQuiJeVPPtUMOzoNt+aNRDk4wgxb34wvEqA== - -uint8arrays@1.1.0, uint8arrays@^1.0.0, uint8arrays@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/uint8arrays/-/uint8arrays-1.1.0.tgz#d034aa65399a9fd213a1579e323f0b29f67d0ed2" - integrity sha512-cLdlZ6jnFczsKf5IH1gPHTtcHtPGho5r4CvctohmQjw8K7Q3gFdfIGHxSTdTaCKrL4w09SsPRJTqRS0drYeszA== - dependencies: - multibase "^3.0.0" - web-encoding "^1.0.2" - -uint8arrays@^2.0.5, uint8arrays@^2.1.3: - version "2.1.5" - resolved "https://registry.yarnpkg.com/uint8arrays/-/uint8arrays-2.1.5.tgz#9e6e6377a9463d5eba4620a3f0450f7eb389a351" - integrity sha512-CSR7AO+4AHUeSOnZ/NBNCElDeWfRh9bXtOck27083kc7SznmmHIhNEkEOCQOn0wvrIMjS3IH0TNLR16vuc46mA== - dependencies: - multibase "^4.0.1" - -ultron@~1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/ultron/-/ultron-1.1.1.tgz#9fe1536a10a664a65266a1e3ccf85fd36302bc9c" - integrity sha512-UIEXBNeYmKptWH6z8ZnqTeS8fV74zG0/eRU9VGkpzz+LIJNs8W/zM/L+7ctCkRrgbNnnR0xxw4bKOr0cW0N0Og== - -unbox-primitive@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/unbox-primitive/-/unbox-primitive-1.0.1.tgz#085e215625ec3162574dc8859abee78a59b14471" - integrity sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw== - dependencies: - function-bind "^1.1.1" - has-bigints "^1.0.1" - has-symbols "^1.0.2" - which-boxed-primitive "^1.0.2" - -underscore@1.12.1: - version "1.12.1" - resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.12.1.tgz#7bb8cc9b3d397e201cf8553336d262544ead829e" - integrity sha512-hEQt0+ZLDVUMhebKxL4x1BTtDY7bavVofhZ9KZ4aI26X9SRaE+Y3m83XUL1UP2jn8ynjndwCCpEHdUG+9pP1Tw== - -underscore@1.9.1: - version "1.9.1" - resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.9.1.tgz#06dce34a0e68a7babc29b365b8e74b8925203961" - integrity sha512-5/4etnCkd9c8gwgowi5/om/mYO5ajCaOgdzj/oW+0eQV9WxKBDZw5+ycmKmeaTXjInS/W0BzpGLo2xR2aBwZdg== - -underscore@^1.7.0: - version "1.13.1" - resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.13.1.tgz#0c1c6bd2df54b6b69f2314066d65b6cde6fcf9d1" - integrity sha512-hzSoAVtJF+3ZtiFX0VgfFPHEDRm7Y/QPjGyNo4TVdnDTdft3tr8hEkD25a1jC+TjTuE7tkHGKkhwCgs9dgBB2g== - -union-value@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.1.tgz#0b6fe7b835aecda61c6ea4d4f02c14221e109847" - integrity sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg== - dependencies: - arr-union "^3.1.0" - get-value "^2.0.6" - is-extendable "^0.1.1" - set-value "^2.0.1" - -universalify@^0.1.0: - version "0.1.2" - resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" - integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== - -universalify@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.0.tgz#75a4984efedc4b08975c5aeb73f530d02df25717" - integrity sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ== - -unorm@^1.3.3: - version "1.6.0" - resolved "https://registry.yarnpkg.com/unorm/-/unorm-1.6.0.tgz#029b289661fba714f1a9af439eb51d9b16c205af" - integrity sha512-b2/KCUlYZUeA7JFUuRJZPUtr4gZvBh7tavtv4fvk4+KV9pfGiR6CQAQAWl49ZpR3ts2dk4FYkP7EIgDJoiOLDA== - -unpipe@1.0.0, unpipe@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" - integrity sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw= - -unset-value@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" - integrity sha1-g3aHP30jNRef+x5vw6jtDfyKtVk= - dependencies: - has-value "^0.3.1" - isobject "^3.0.0" - -uri-js@^4.2.2: - version "4.4.1" - resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e" - integrity sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg== - dependencies: - punycode "^2.1.0" - -urix@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" - integrity sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI= - -url-parse-lax@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-1.0.0.tgz#7af8f303645e9bd79a272e7a14ac68bc0609da73" - integrity sha1-evjzA2Rem9eaJy56FKxovAYJ2nM= - dependencies: - prepend-http "^1.0.1" - -url-parse-lax@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-3.0.0.tgz#16b5cafc07dbe3676c1b1999177823d6503acb0c" - integrity sha1-FrXK/Afb42dsGxmZF3gj1lA6yww= - dependencies: - prepend-http "^2.0.0" - -url-set-query@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/url-set-query/-/url-set-query-1.0.0.tgz#016e8cfd7c20ee05cafe7795e892bd0702faa339" - integrity sha1-AW6M/Xwg7gXK/neV6JK9BwL6ozk= - -url-to-options@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/url-to-options/-/url-to-options-1.0.1.tgz#1505a03a289a48cbd7a434efbaeec5055f5633a9" - integrity sha1-FQWgOiiaSMvXpDTvuu7FBV9WM6k= - -url@^0.11.0: - version "0.11.0" - resolved "https://registry.yarnpkg.com/url/-/url-0.11.0.tgz#3838e97cfc60521eb73c525a8e55bfdd9e2e28f1" - integrity sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE= - dependencies: - punycode "1.3.2" - querystring "0.2.0" - -use@^3.1.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" - integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ== - -utf-8-validate@^5.0.2: - version "5.0.5" - resolved "https://registry.yarnpkg.com/utf-8-validate/-/utf-8-validate-5.0.5.tgz#dd32c2e82c72002dc9f02eb67ba6761f43456ca1" - integrity sha512-+pnxRYsS/axEpkrrEpzYfNZGXp0IjC/9RIxwM5gntY4Koi8SHmUGSfxfWqxZdRxrtaoVstuOzUp/rbs3JSPELQ== - dependencies: - node-gyp-build "^4.2.0" - -utf8@3.0.0, utf8@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/utf8/-/utf8-3.0.0.tgz#f052eed1364d696e769ef058b183df88c87f69d1" - integrity sha512-E8VjFIQ/TyQgp+TZfS6l8yp/xWppSAHzidGiRrqe4bK4XP9pTRyKFgGJpO3SN7zdX4DeomTrwaseCHovfpFcqQ== - -util-deprecate@^1.0.1, util-deprecate@~1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" - integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= - -util.promisify@^1.0.0, util.promisify@^1.0.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/util.promisify/-/util.promisify-1.1.1.tgz#77832f57ced2c9478174149cae9b96e9918cd54b" - integrity sha512-/s3UsZUrIfa6xDhr7zZhnE9SLQ5RIXyYfiVnMMyMDzOc8WhWN4Nbh36H842OyurKbCDAesZOJaVyvmSl6fhGQw== - dependencies: - call-bind "^1.0.0" - define-properties "^1.1.3" - for-each "^0.3.3" - has-symbols "^1.0.1" - object.getownpropertydescriptors "^2.1.1" - -util@^0.12.0, util@^0.12.3: - version "0.12.3" - resolved "https://registry.yarnpkg.com/util/-/util-0.12.3.tgz#971bb0292d2cc0c892dab7c6a5d37c2bec707888" - integrity sha512-I8XkoQwE+fPQEhy9v012V+TSdH2kp9ts29i20TaaDUXsg7x/onePbhFJUExBfv/2ay1ZOp/Vsm3nDlmnFGSAog== - dependencies: - inherits "^2.0.3" - is-arguments "^1.0.4" - is-generator-function "^1.0.7" - is-typed-array "^1.1.3" - safe-buffer "^5.1.2" - which-typed-array "^1.1.2" - -utils-merge@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" - integrity sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM= - -uuid@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-2.0.1.tgz#c2a30dedb3e535d72ccf82e343941a50ba8533ac" - integrity sha1-wqMN7bPlNdcsz4LjQ5QaULqFM6w= - -uuid@3.3.2: - version "3.3.2" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" - integrity sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA== - -uuid@^3.3.2: - version "3.4.0" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" - integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== - -uuid@^8.1.0: - version "8.3.2" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" - integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== - -v8-compile-cache@^2.0.3: - version "2.3.0" - resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz#2de19618c66dc247dcfb6f99338035d8245a2cee" - integrity sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA== - -validate-npm-package-license@^3.0.1: - version "3.0.4" - resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" - integrity sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew== - dependencies: - spdx-correct "^3.0.0" - spdx-expression-parse "^3.0.0" - -validator@^10.11.0: - version "10.11.0" - resolved "https://registry.yarnpkg.com/validator/-/validator-10.11.0.tgz#003108ea6e9a9874d31ccc9e5006856ccd76b228" - integrity sha512-X/p3UZerAIsbBfN/IwahhYaBbY68EN/UQBWHtsbXGT5bfrH/p4NQzUCG1kF/rtKaNpnJ7jAu6NGTdSNtyNIXMw== - -varint@^5.0.0, varint@^5.0.2, varint@~5.0.0: - version "5.0.2" - resolved "https://registry.yarnpkg.com/varint/-/varint-5.0.2.tgz#5b47f8a947eb668b848e034dcfa87d0ff8a7f7a4" - integrity sha512-lKxKYG6H03yCZUpAGOPOsMcGxd1RHCu1iKvEHYDPmTyq2HueGhD73ssNBqqQWfvYs04G9iUFRvmAVLW20Jw6ow== - -varint@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/varint/-/varint-6.0.0.tgz#9881eb0ce8feaea6512439d19ddf84bf551661d0" - integrity sha512-cXEIW6cfr15lFv563k4GuVuW/fiwjknytD37jIOLSdSWuOI6WnO/oKwmP2FQTU2l01LP8/M5TSAJpzUaGe3uWg== - -vary@^1, vary@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" - integrity sha1-IpnwLG3tMNSllhsLn3RSShj2NPw= - -verror@1.10.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" - integrity sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA= - dependencies: - assert-plus "^1.0.0" - core-util-is "1.0.2" - extsprintf "^1.2.0" - -wcwidth@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/wcwidth/-/wcwidth-1.0.1.tgz#f0b0dcf915bc5ff1528afadb2c0e17b532da2fe8" - integrity sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g= - dependencies: - defaults "^1.0.3" - -web-encoding@^1.0.2, web-encoding@^1.0.6: - version "1.1.5" - resolved "https://registry.yarnpkg.com/web-encoding/-/web-encoding-1.1.5.tgz#fc810cf7667364a6335c939913f5051d3e0c4864" - integrity sha512-HYLeVCdJ0+lBYV2FvNZmv3HJ2Nt0QYXqZojk3d9FJOLkwnuhzM9tmamh8d7HPM8QqjKH8DeHkFTx+CFlWpZZDA== - dependencies: - util "^0.12.3" - optionalDependencies: - "@zxing/text-encoding" "0.9.0" - -web3-bzz@1.2.11: - version "1.2.11" - resolved "https://registry.yarnpkg.com/web3-bzz/-/web3-bzz-1.2.11.tgz#41bc19a77444bd5365744596d778b811880f707f" - integrity sha512-XGpWUEElGypBjeFyUhTkiPXFbDVD6Nr/S5jznE3t8cWUA0FxRf1n3n/NuIZeb0H9RkN2Ctd/jNma/k8XGa3YKg== - dependencies: - "@types/node" "^12.12.6" - got "9.6.0" - swarm-js "^0.1.40" - underscore "1.9.1" - -web3-bzz@1.3.6: - version "1.3.6" - resolved "https://registry.yarnpkg.com/web3-bzz/-/web3-bzz-1.3.6.tgz#95f370aecc3ff6ad07f057e6c0c916ef09b04dde" - integrity sha512-ibHdx1wkseujFejrtY7ZyC0QxQ4ATXjzcNUpaLrvM6AEae8prUiyT/OloG9FWDgFD2CPLwzKwfSQezYQlANNlw== - dependencies: - "@types/node" "^12.12.6" - got "9.6.0" - swarm-js "^0.1.40" - underscore "1.12.1" - -web3-core-helpers@1.2.11: - version "1.2.11" - resolved "https://registry.yarnpkg.com/web3-core-helpers/-/web3-core-helpers-1.2.11.tgz#84c681ed0b942c0203f3b324a245a127e8c67a99" - integrity sha512-PEPoAoZd5ME7UfbnCZBdzIerpe74GEvlwT4AjOmHeCVZoIFk7EqvOZDejJHt+feJA6kMVTdd0xzRNN295UhC1A== - dependencies: - underscore "1.9.1" - web3-eth-iban "1.2.11" - web3-utils "1.2.11" - -web3-core-helpers@1.3.6: - version "1.3.6" - resolved "https://registry.yarnpkg.com/web3-core-helpers/-/web3-core-helpers-1.3.6.tgz#c478246a9abe4e5456acf42657dac2f7c330be74" - integrity sha512-nhtjA2ZbkppjlxTSwG0Ttu6FcPkVu1rCN5IFAOVpF/L0SEt+jy+O5l90+cjDq0jAYvlBwUwnbh2mR9hwDEJCNA== - dependencies: - underscore "1.12.1" - web3-eth-iban "1.3.6" - web3-utils "1.3.6" - -web3-core-method@1.2.11: - version "1.2.11" - resolved "https://registry.yarnpkg.com/web3-core-method/-/web3-core-method-1.2.11.tgz#f880137d1507a0124912bf052534f168b8d8fbb6" - integrity sha512-ff0q76Cde94HAxLDZ6DbdmKniYCQVtvuaYh+rtOUMB6kssa5FX0q3vPmixi7NPooFnbKmmZCM6NvXg4IreTPIw== - dependencies: - "@ethersproject/transactions" "^5.0.0-beta.135" - underscore "1.9.1" - web3-core-helpers "1.2.11" - web3-core-promievent "1.2.11" - web3-core-subscriptions "1.2.11" - web3-utils "1.2.11" - -web3-core-method@1.3.6: - version "1.3.6" - resolved "https://registry.yarnpkg.com/web3-core-method/-/web3-core-method-1.3.6.tgz#4b0334edd94b03dfec729d113c69a4eb6ebc68ae" - integrity sha512-RyegqVGxn0cyYW5yzAwkPlsSEynkdPiegd7RxgB4ak1eKk2Cv1q2x4C7D2sZjeeCEF+q6fOkVmo2OZNqS2iQxg== - dependencies: - "@ethersproject/transactions" "^5.0.0-beta.135" - underscore "1.12.1" - web3-core-helpers "1.3.6" - web3-core-promievent "1.3.6" - web3-core-subscriptions "1.3.6" - web3-utils "1.3.6" - -web3-core-promievent@1.2.11: - version "1.2.11" - resolved "https://registry.yarnpkg.com/web3-core-promievent/-/web3-core-promievent-1.2.11.tgz#51fe97ca0ddec2f99bf8c3306a7a8e4b094ea3cf" - integrity sha512-il4McoDa/Ox9Agh4kyfQ8Ak/9ABYpnF8poBLL33R/EnxLsJOGQG2nZhkJa3I067hocrPSjEdlPt/0bHXsln4qA== - dependencies: - eventemitter3 "4.0.4" - -web3-core-promievent@1.3.6: - version "1.3.6" - resolved "https://registry.yarnpkg.com/web3-core-promievent/-/web3-core-promievent-1.3.6.tgz#6c27dc79de8f71b74f5d17acaf9aaf593d3cb0c9" - integrity sha512-Z+QzfyYDTXD5wJmZO5wwnRO8bAAHEItT1XNSPVb4J1CToV/I/SbF7CuF8Uzh2jns0Cm1109o666H7StFFvzVKw== - dependencies: - eventemitter3 "4.0.4" - -web3-core-requestmanager@1.2.11: - version "1.2.11" - resolved "https://registry.yarnpkg.com/web3-core-requestmanager/-/web3-core-requestmanager-1.2.11.tgz#fe6eb603fbaee18530293a91f8cf26d8ae28c45a" - integrity sha512-oFhBtLfOiIbmfl6T6gYjjj9igOvtyxJ+fjS+byRxiwFJyJ5BQOz4/9/17gWR1Cq74paTlI7vDGxYfuvfE/mKvA== - dependencies: - underscore "1.9.1" - web3-core-helpers "1.2.11" - web3-providers-http "1.2.11" - web3-providers-ipc "1.2.11" - web3-providers-ws "1.2.11" - -web3-core-requestmanager@1.3.6: - version "1.3.6" - resolved "https://registry.yarnpkg.com/web3-core-requestmanager/-/web3-core-requestmanager-1.3.6.tgz#4fea269fe913fd4fca464b4f7c65cb94857b5b2a" - integrity sha512-2rIaeuqeo7QN1Eex7aXP0ZqeteJEPWXYFS/M3r3LXMiV8R4STQBKE+//dnHJXoo2ctzEB5cgd+7NaJM8S3gPyA== - dependencies: - underscore "1.12.1" - util "^0.12.0" - web3-core-helpers "1.3.6" - web3-providers-http "1.3.6" - web3-providers-ipc "1.3.6" - web3-providers-ws "1.3.6" - -web3-core-subscriptions@1.2.11: - version "1.2.11" - resolved "https://registry.yarnpkg.com/web3-core-subscriptions/-/web3-core-subscriptions-1.2.11.tgz#beca908fbfcb050c16f45f3f0f4c205e8505accd" - integrity sha512-qEF/OVqkCvQ7MPs1JylIZCZkin0aKK9lDxpAtQ1F8niEDGFqn7DT8E/vzbIa0GsOjL2fZjDhWJsaW+BSoAW1gg== - dependencies: - eventemitter3 "4.0.4" - underscore "1.9.1" - web3-core-helpers "1.2.11" - -web3-core-subscriptions@1.3.6: - version "1.3.6" - resolved "https://registry.yarnpkg.com/web3-core-subscriptions/-/web3-core-subscriptions-1.3.6.tgz#ee24e7974d1d72ff6c992c599deba4ef9b308415" - integrity sha512-wi9Z9X5X75OKvxAg42GGIf81ttbNR2TxzkAsp1g+nnp5K8mBwgZvXrIsDuj7Z7gx72Y45mWJADCWjk/2vqNu8g== - dependencies: - eventemitter3 "4.0.4" - underscore "1.12.1" - web3-core-helpers "1.3.6" - -web3-core@1.2.11: - version "1.2.11" - resolved "https://registry.yarnpkg.com/web3-core/-/web3-core-1.2.11.tgz#1043cacc1becb80638453cc5b2a14be9050288a7" - integrity sha512-CN7MEYOY5ryo5iVleIWRE3a3cZqVaLlIbIzDPsvQRUfzYnvzZQRZBm9Mq+ttDi2STOOzc1MKylspz/o3yq/LjQ== - dependencies: - "@types/bn.js" "^4.11.5" - "@types/node" "^12.12.6" - bignumber.js "^9.0.0" - web3-core-helpers "1.2.11" - web3-core-method "1.2.11" - web3-core-requestmanager "1.2.11" - web3-utils "1.2.11" - -web3-core@1.3.6: - version "1.3.6" - resolved "https://registry.yarnpkg.com/web3-core/-/web3-core-1.3.6.tgz#a6a761d1ff2f3ee462b8dab679229d2f8e267504" - integrity sha512-gkLDM4T1Sc0T+HZIwxrNrwPg0IfWI0oABSglP2X5ZbBAYVUeEATA0o92LWV8BeF+okvKXLK1Fek/p6axwM/h3Q== - dependencies: - "@types/bn.js" "^4.11.5" - "@types/node" "^12.12.6" - bignumber.js "^9.0.0" - web3-core-helpers "1.3.6" - web3-core-method "1.3.6" - web3-core-requestmanager "1.3.6" - web3-utils "1.3.6" - -web3-eth-abi@1.2.11: - version "1.2.11" - resolved "https://registry.yarnpkg.com/web3-eth-abi/-/web3-eth-abi-1.2.11.tgz#a887494e5d447c2926d557a3834edd66e17af9b0" - integrity sha512-PkRYc0+MjuLSgg03QVWqWlQivJqRwKItKtEpRUaxUAeLE7i/uU39gmzm2keHGcQXo3POXAbOnMqkDvOep89Crg== - dependencies: - "@ethersproject/abi" "5.0.0-beta.153" - underscore "1.9.1" - web3-utils "1.2.11" - -web3-eth-abi@1.3.6: - version "1.3.6" - resolved "https://registry.yarnpkg.com/web3-eth-abi/-/web3-eth-abi-1.3.6.tgz#4272ca48d817aa651bbf97b269f5ff10abc2b8a9" - integrity sha512-Or5cRnZu6WzgScpmbkvC6bfNxR26hqiKK4i8sMPFeTUABQcb/FU3pBj7huBLYbp9dH+P5W79D2MqwbWwjj9DoQ== - dependencies: - "@ethersproject/abi" "5.0.7" - underscore "1.12.1" - web3-utils "1.3.6" - -web3-eth-accounts@1.2.11: - version "1.2.11" - resolved "https://registry.yarnpkg.com/web3-eth-accounts/-/web3-eth-accounts-1.2.11.tgz#a9e3044da442d31903a7ce035a86d8fa33f90520" - integrity sha512-6FwPqEpCfKIh3nSSGeo3uBm2iFSnFJDfwL3oS9pyegRBXNsGRVpgiW63yhNzL0796StsvjHWwQnQHsZNxWAkGw== - dependencies: - crypto-browserify "3.12.0" - eth-lib "0.2.8" - ethereumjs-common "^1.3.2" - ethereumjs-tx "^2.1.1" - scrypt-js "^3.0.1" - underscore "1.9.1" - uuid "3.3.2" - web3-core "1.2.11" - web3-core-helpers "1.2.11" - web3-core-method "1.2.11" - web3-utils "1.2.11" - -web3-eth-accounts@1.3.6: - version "1.3.6" - resolved "https://registry.yarnpkg.com/web3-eth-accounts/-/web3-eth-accounts-1.3.6.tgz#f9fcb50b28ee58090ab292a10d996155caa2b474" - integrity sha512-Ilr0hG6ONbCdSlVKffasCmNwftD5HsNpwyQASevocIQwHdTlvlwO0tb3oGYuajbKOaDzNTwXfz25bttAEoFCGA== - dependencies: - crypto-browserify "3.12.0" - eth-lib "0.2.8" - ethereumjs-common "^1.3.2" - ethereumjs-tx "^2.1.1" - scrypt-js "^3.0.1" - underscore "1.12.1" - uuid "3.3.2" - web3-core "1.3.6" - web3-core-helpers "1.3.6" - web3-core-method "1.3.6" - web3-utils "1.3.6" - -web3-eth-contract@1.2.11: - version "1.2.11" - resolved "https://registry.yarnpkg.com/web3-eth-contract/-/web3-eth-contract-1.2.11.tgz#917065902bc27ce89da9a1da26e62ef663663b90" - integrity sha512-MzYuI/Rq2o6gn7vCGcnQgco63isPNK5lMAan2E51AJLknjSLnOxwNY3gM8BcKoy4Z+v5Dv00a03Xuk78JowFow== - dependencies: - "@types/bn.js" "^4.11.5" - underscore "1.9.1" - web3-core "1.2.11" - web3-core-helpers "1.2.11" - web3-core-method "1.2.11" - web3-core-promievent "1.2.11" - web3-core-subscriptions "1.2.11" - web3-eth-abi "1.2.11" - web3-utils "1.2.11" - -web3-eth-contract@1.3.6: - version "1.3.6" - resolved "https://registry.yarnpkg.com/web3-eth-contract/-/web3-eth-contract-1.3.6.tgz#cccf4d32dc56917fb6923e778498a9ba2a5ba866" - integrity sha512-8gDaRrLF2HCg+YEZN1ov0zN35vmtPnGf3h1DxmJQK5Wm2lRMLomz9rsWsuvig3UJMHqZAQKD7tOl3ocJocQsmA== - dependencies: - "@types/bn.js" "^4.11.5" - underscore "1.12.1" - web3-core "1.3.6" - web3-core-helpers "1.3.6" - web3-core-method "1.3.6" - web3-core-promievent "1.3.6" - web3-core-subscriptions "1.3.6" - web3-eth-abi "1.3.6" - web3-utils "1.3.6" - -web3-eth-ens@1.2.11: - version "1.2.11" - resolved "https://registry.yarnpkg.com/web3-eth-ens/-/web3-eth-ens-1.2.11.tgz#26d4d7f16d6cbcfff918e39832b939edc3162532" - integrity sha512-dbW7dXP6HqT1EAPvnniZVnmw6TmQEKF6/1KgAxbo8iBBYrVTMDGFQUUnZ+C4VETGrwwaqtX4L9d/FrQhZ6SUiA== - dependencies: - content-hash "^2.5.2" - eth-ens-namehash "2.0.8" - underscore "1.9.1" - web3-core "1.2.11" - web3-core-helpers "1.2.11" - web3-core-promievent "1.2.11" - web3-eth-abi "1.2.11" - web3-eth-contract "1.2.11" - web3-utils "1.2.11" - -web3-eth-ens@1.3.6: - version "1.3.6" - resolved "https://registry.yarnpkg.com/web3-eth-ens/-/web3-eth-ens-1.3.6.tgz#0d28c5d4ea7b4462ef6c077545a77956a6cdf175" - integrity sha512-n27HNj7lpSkRxTgSx+Zo7cmKAgyg2ElFilaFlUu/X2CNH23lXfcPm2bWssivH9z0ndhg0OyR4AYFZqPaqDHkJA== - dependencies: - content-hash "^2.5.2" - eth-ens-namehash "2.0.8" - underscore "1.12.1" - web3-core "1.3.6" - web3-core-helpers "1.3.6" - web3-core-promievent "1.3.6" - web3-eth-abi "1.3.6" - web3-eth-contract "1.3.6" - web3-utils "1.3.6" - -web3-eth-iban@1.2.11: - version "1.2.11" - resolved "https://registry.yarnpkg.com/web3-eth-iban/-/web3-eth-iban-1.2.11.tgz#f5f73298305bc7392e2f188bf38a7362b42144ef" - integrity sha512-ozuVlZ5jwFC2hJY4+fH9pIcuH1xP0HEFhtWsR69u9uDIANHLPQQtWYmdj7xQ3p2YT4bQLq/axKhZi7EZVetmxQ== - dependencies: - bn.js "^4.11.9" - web3-utils "1.2.11" - -web3-eth-iban@1.3.6: - version "1.3.6" - resolved "https://registry.yarnpkg.com/web3-eth-iban/-/web3-eth-iban-1.3.6.tgz#0d6ba21fe78f190af8919e9cd5453882457209e0" - integrity sha512-nfMQaaLA/zsg5W4Oy/EJQbs8rSs1vBAX6b/35xzjYoutXlpHMQadujDx2RerTKhSHqFXSJeQAfE+2f6mdhYkRQ== - dependencies: - bn.js "^4.11.9" - web3-utils "1.3.6" - -web3-eth-personal@1.2.11: - version "1.2.11" - resolved "https://registry.yarnpkg.com/web3-eth-personal/-/web3-eth-personal-1.2.11.tgz#a38b3942a1d87a62070ce0622a941553c3d5aa70" - integrity sha512-42IzUtKq9iHZ8K9VN0vAI50iSU9tOA1V7XU2BhF/tb7We2iKBVdkley2fg26TxlOcKNEHm7o6HRtiiFsVK4Ifw== - dependencies: - "@types/node" "^12.12.6" - web3-core "1.2.11" - web3-core-helpers "1.2.11" - web3-core-method "1.2.11" - web3-net "1.2.11" - web3-utils "1.2.11" - -web3-eth-personal@1.3.6: - version "1.3.6" - resolved "https://registry.yarnpkg.com/web3-eth-personal/-/web3-eth-personal-1.3.6.tgz#226137916754c498f0284f22c55924c87a2efcf0" - integrity sha512-pOHU0+/h1RFRYoh1ehYBehRbcKWP4OSzd4F7mDljhHngv6W8ewMHrAN8O1ol9uysN2MuCdRE19qkRg5eNgvzFQ== - dependencies: - "@types/node" "^12.12.6" - web3-core "1.3.6" - web3-core-helpers "1.3.6" - web3-core-method "1.3.6" - web3-net "1.3.6" - web3-utils "1.3.6" - -web3-eth@1.2.11: - version "1.2.11" - resolved "https://registry.yarnpkg.com/web3-eth/-/web3-eth-1.2.11.tgz#4c81fcb6285b8caf544058fba3ae802968fdc793" - integrity sha512-REvxW1wJ58AgHPcXPJOL49d1K/dPmuw4LjPLBPStOVkQjzDTVmJEIsiLwn2YeuNDd4pfakBwT8L3bz1G1/wVsQ== - dependencies: - underscore "1.9.1" - web3-core "1.2.11" - web3-core-helpers "1.2.11" - web3-core-method "1.2.11" - web3-core-subscriptions "1.2.11" - web3-eth-abi "1.2.11" - web3-eth-accounts "1.2.11" - web3-eth-contract "1.2.11" - web3-eth-ens "1.2.11" - web3-eth-iban "1.2.11" - web3-eth-personal "1.2.11" - web3-net "1.2.11" - web3-utils "1.2.11" - -web3-eth@1.3.6: - version "1.3.6" - resolved "https://registry.yarnpkg.com/web3-eth/-/web3-eth-1.3.6.tgz#2c650893d540a7a0eb1365dd5b2dca24ac919b7c" - integrity sha512-9+rnywRRpyX3C4hfsAQXPQh6vHh9XzQkgLxo3gyeXfbhbShUoq2gFVuy42vsRs//6JlsKdyZS7Z3hHPHz2wreA== - dependencies: - underscore "1.12.1" - web3-core "1.3.6" - web3-core-helpers "1.3.6" - web3-core-method "1.3.6" - web3-core-subscriptions "1.3.6" - web3-eth-abi "1.3.6" - web3-eth-accounts "1.3.6" - web3-eth-contract "1.3.6" - web3-eth-ens "1.3.6" - web3-eth-iban "1.3.6" - web3-eth-personal "1.3.6" - web3-net "1.3.6" - web3-utils "1.3.6" - -web3-net@1.2.11: - version "1.2.11" - resolved "https://registry.yarnpkg.com/web3-net/-/web3-net-1.2.11.tgz#eda68ef25e5cdb64c96c39085cdb74669aabbe1b" - integrity sha512-sjrSDj0pTfZouR5BSTItCuZ5K/oZPVdVciPQ6981PPPIwJJkCMeVjD7I4zO3qDPCnBjBSbWvVnLdwqUBPtHxyg== - dependencies: - web3-core "1.2.11" - web3-core-method "1.2.11" - web3-utils "1.2.11" - -web3-net@1.3.6: - version "1.3.6" - resolved "https://registry.yarnpkg.com/web3-net/-/web3-net-1.3.6.tgz#a56492e2227475e38db29394f8bac305a2446e41" - integrity sha512-KhzU3wMQY/YYjyMiQzbaLPt2kut88Ncx2iqjy3nw28vRux3gVX0WOCk9EL/KVJBiAA/fK7VklTXvgy9dZnnipw== - dependencies: - web3-core "1.3.6" - web3-core-method "1.3.6" - web3-utils "1.3.6" - -web3-provider-engine@14.2.1: - version "14.2.1" - resolved "https://registry.yarnpkg.com/web3-provider-engine/-/web3-provider-engine-14.2.1.tgz#ef351578797bf170e08d529cb5b02f8751329b95" - integrity sha512-iSv31h2qXkr9vrL6UZDm4leZMc32SjWJFGOp/D92JXfcEboCqraZyuExDkpxKw8ziTufXieNM7LSXNHzszYdJw== - dependencies: - async "^2.5.0" - backoff "^2.5.0" - clone "^2.0.0" - cross-fetch "^2.1.0" - eth-block-tracker "^3.0.0" - eth-json-rpc-infura "^3.1.0" - eth-sig-util "^1.4.2" - ethereumjs-block "^1.2.2" - ethereumjs-tx "^1.2.0" - ethereumjs-util "^5.1.5" - ethereumjs-vm "^2.3.4" - json-rpc-error "^2.0.0" - json-stable-stringify "^1.0.1" - promise-to-callback "^1.0.0" - readable-stream "^2.2.9" - request "^2.85.0" - semaphore "^1.0.3" - ws "^5.1.1" - xhr "^2.2.0" - xtend "^4.0.1" - -web3-providers-http@1.2.11: - version "1.2.11" - resolved "https://registry.yarnpkg.com/web3-providers-http/-/web3-providers-http-1.2.11.tgz#1cd03442c61670572d40e4dcdf1faff8bd91e7c6" - integrity sha512-psh4hYGb1+ijWywfwpB2cvvOIMISlR44F/rJtYkRmQ5jMvG4FOCPlQJPiHQZo+2cc3HbktvvSJzIhkWQJdmvrA== - dependencies: - web3-core-helpers "1.2.11" - xhr2-cookies "1.1.0" - -web3-providers-http@1.3.6: - version "1.3.6" - resolved "https://registry.yarnpkg.com/web3-providers-http/-/web3-providers-http-1.3.6.tgz#36e8724a7424d52827819d53fd75dbf31f5422c2" - integrity sha512-OQkT32O1A06dISIdazpGLveZcOXhEo5cEX6QyiSQkiPk/cjzDrXMw4SKZOGQbbS1+0Vjizm1Hrp7O8Vp2D1M5Q== - dependencies: - web3-core-helpers "1.3.6" - xhr2-cookies "1.1.0" - -web3-providers-ipc@1.2.11: - version "1.2.11" - resolved "https://registry.yarnpkg.com/web3-providers-ipc/-/web3-providers-ipc-1.2.11.tgz#d16d6c9be1be6e0b4f4536c4acc16b0f4f27ef21" - integrity sha512-yhc7Y/k8hBV/KlELxynWjJDzmgDEDjIjBzXK+e0rHBsYEhdCNdIH5Psa456c+l0qTEU2YzycF8VAjYpWfPnBpQ== - dependencies: - oboe "2.1.4" - underscore "1.9.1" - web3-core-helpers "1.2.11" - -web3-providers-ipc@1.3.6: - version "1.3.6" - resolved "https://registry.yarnpkg.com/web3-providers-ipc/-/web3-providers-ipc-1.3.6.tgz#cef8d12c1ebb47adce5ebf597f553c623362cb4a" - integrity sha512-+TVsSd2sSVvVgHG4s6FXwwYPPT91boKKcRuEFXqEfAbUC5t52XOgmyc2LNiD9LzPhed65FbV4LqICpeYGUvSwA== - dependencies: - oboe "2.1.5" - underscore "1.12.1" - web3-core-helpers "1.3.6" - -web3-providers-ws@1.2.11: - version "1.2.11" - resolved "https://registry.yarnpkg.com/web3-providers-ws/-/web3-providers-ws-1.2.11.tgz#a1dfd6d9778d840561d9ec13dd453046451a96bb" - integrity sha512-ZxnjIY1Er8Ty+cE4migzr43zA/+72AF1myzsLaU5eVgdsfV7Jqx7Dix1hbevNZDKFlSoEyq/3j/jYalh3So1Zg== - dependencies: - eventemitter3 "4.0.4" - underscore "1.9.1" - web3-core-helpers "1.2.11" - websocket "^1.0.31" - -web3-providers-ws@1.3.6: - version "1.3.6" - resolved "https://registry.yarnpkg.com/web3-providers-ws/-/web3-providers-ws-1.3.6.tgz#e1df617bc89d66165abdf2191da0014c505bfaac" - integrity sha512-bk7MnJf5or0Re2zKyhR3L3CjGululLCHXx4vlbc/drnaTARUVvi559OI5uLytc/1k5HKUUyENAxLvetz2G1dnQ== - dependencies: - eventemitter3 "4.0.4" - underscore "1.12.1" - web3-core-helpers "1.3.6" - websocket "^1.0.32" - -web3-shh@1.2.11: - version "1.2.11" - resolved "https://registry.yarnpkg.com/web3-shh/-/web3-shh-1.2.11.tgz#f5d086f9621c9a47e98d438010385b5f059fd88f" - integrity sha512-B3OrO3oG1L+bv3E1sTwCx66injW1A8hhwpknDUbV+sw3fehFazA06z9SGXUefuFI1kVs4q2vRi0n4oCcI4dZDg== - dependencies: - web3-core "1.2.11" - web3-core-method "1.2.11" - web3-core-subscriptions "1.2.11" - web3-net "1.2.11" - -web3-shh@1.3.6: - version "1.3.6" - resolved "https://registry.yarnpkg.com/web3-shh/-/web3-shh-1.3.6.tgz#4e3486c7eca5cbdb87f88910948223a5b7ea6c20" - integrity sha512-9zRo415O0iBslxBnmu9OzYjNErzLnzOsy+IOvSpIreLYbbAw0XkDWxv3SfcpKnTIWIACBR4AYMIxmmyi5iB3jw== - dependencies: - web3-core "1.3.6" - web3-core-method "1.3.6" - web3-core-subscriptions "1.3.6" - web3-net "1.3.6" - -web3-utils@1.2.11: - version "1.2.11" - resolved "https://registry.yarnpkg.com/web3-utils/-/web3-utils-1.2.11.tgz#af1942aead3fb166ae851a985bed8ef2c2d95a82" - integrity sha512-3Tq09izhD+ThqHEaWYX4VOT7dNPdZiO+c/1QMA0s5X2lDFKK/xHJb7cyTRRVzN2LvlHbR7baS1tmQhSua51TcQ== - dependencies: - bn.js "^4.11.9" - eth-lib "0.2.8" - ethereum-bloom-filters "^1.0.6" - ethjs-unit "0.1.6" - number-to-bn "1.7.0" - randombytes "^2.1.0" - underscore "1.9.1" - utf8 "3.0.0" - -web3-utils@1.3.6, web3-utils@^1.0.0-beta.31, web3-utils@^1.3.0: - version "1.3.6" - resolved "https://registry.yarnpkg.com/web3-utils/-/web3-utils-1.3.6.tgz#390bc9fa3a7179746963cfaca55bb80ac4d8dc10" - integrity sha512-hHatFaQpkQgjGVER17gNx8u1qMyaXFZtM0y0XLGH1bzsjMPlkMPLRcYOrZ00rOPfTEuYFOdrpGOqZXVmGrMZRg== - dependencies: - bn.js "^4.11.9" - eth-lib "0.2.8" - ethereum-bloom-filters "^1.0.6" - ethjs-unit "0.1.6" - number-to-bn "1.7.0" - randombytes "^2.1.0" - underscore "1.12.1" - utf8 "3.0.0" - -web3@1.2.11: - version "1.2.11" - resolved "https://registry.yarnpkg.com/web3/-/web3-1.2.11.tgz#50f458b2e8b11aa37302071c170ed61cff332975" - integrity sha512-mjQ8HeU41G6hgOYm1pmeH0mRAeNKJGnJEUzDMoerkpw7QUQT4exVREgF1MYPvL/z6vAshOXei25LE/t/Bxl8yQ== - dependencies: - web3-bzz "1.2.11" - web3-core "1.2.11" - web3-eth "1.2.11" - web3-eth-personal "1.2.11" - web3-net "1.2.11" - web3-shh "1.2.11" - web3-utils "1.2.11" - -web3@1.3.6: - version "1.3.6" - resolved "https://registry.yarnpkg.com/web3/-/web3-1.3.6.tgz#599425461c3f9a8cbbefa70616438995f4a064cc" - integrity sha512-jEpPhnL6GDteifdVh7ulzlPrtVQeA30V9vnki9liYlUvLV82ZM7BNOQJiuzlDePuE+jZETZSP/0G/JlUVt6pOA== - dependencies: - web3-bzz "1.3.6" - web3-core "1.3.6" - web3-eth "1.3.6" - web3-eth-personal "1.3.6" - web3-net "1.3.6" - web3-shh "1.3.6" - web3-utils "1.3.6" - -websocket@1.0.32: - version "1.0.32" - resolved "https://registry.yarnpkg.com/websocket/-/websocket-1.0.32.tgz#1f16ddab3a21a2d929dec1687ab21cfdc6d3dbb1" - integrity sha512-i4yhcllSP4wrpoPMU2N0TQ/q0O94LRG/eUQjEAamRltjQ1oT1PFFKOG4i877OlJgCG8rw6LrrowJp+TYCEWF7Q== - dependencies: - bufferutil "^4.0.1" - debug "^2.2.0" - es5-ext "^0.10.50" - typedarray-to-buffer "^3.1.5" - utf-8-validate "^5.0.2" - yaeti "^0.0.6" - -websocket@^1.0.31, websocket@^1.0.32: - version "1.0.34" - resolved "https://registry.yarnpkg.com/websocket/-/websocket-1.0.34.tgz#2bdc2602c08bf2c82253b730655c0ef7dcab3111" - integrity sha512-PRDso2sGwF6kM75QykIesBijKSVceR6jL2G8NGYyq2XrItNC2P5/qL5XeR056GhA+Ly7JMFvJb9I312mJfmqnQ== - dependencies: - bufferutil "^4.0.1" - debug "^2.2.0" - es5-ext "^0.10.50" - typedarray-to-buffer "^3.1.5" - utf-8-validate "^5.0.2" - yaeti "^0.0.6" - -whatwg-fetch@2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.4.tgz#dde6a5df315f9d39991aa17621853d720b85566f" - integrity sha512-dcQ1GWpOD/eEQ97k66aiEVpNnapVj90/+R+SXTPYGHpYBBypfKJEQjLrvMZ7YXbKm21gXd4NcuxUTjiv1YtLng== - -which-boxed-primitive@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz#13757bc89b209b049fe5d86430e21cf40a89a8e6" - integrity sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg== - dependencies: - is-bigint "^1.0.1" - is-boolean-object "^1.1.0" - is-number-object "^1.0.4" - is-string "^1.0.5" - is-symbol "^1.0.3" - -which-module@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/which-module/-/which-module-1.0.0.tgz#bba63ca861948994ff307736089e3b96026c2a4f" - integrity sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8= - -which-module@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" - integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= - -which-pm-runs@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/which-pm-runs/-/which-pm-runs-1.0.0.tgz#670b3afbc552e0b55df6b7780ca74615f23ad1cb" - integrity sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs= - -which-typed-array@^1.1.2: - version "1.1.4" - resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.4.tgz#8fcb7d3ee5adf2d771066fba7cf37e32fe8711ff" - integrity sha512-49E0SpUe90cjpoc7BOJwyPHRqSAd12c10Qm2amdEZrJPCY2NDxaW01zHITrem+rnETY3dwrbH3UUrUwagfCYDA== - dependencies: - available-typed-arrays "^1.0.2" - call-bind "^1.0.0" - es-abstract "^1.18.0-next.1" - foreach "^2.0.5" - function-bind "^1.1.1" - has-symbols "^1.0.1" - is-typed-array "^1.1.3" - -which@1.3.1, which@^1.1.1, which@^1.2.9, which@^1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" - integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== - dependencies: - isexe "^2.0.0" - -which@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" - integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== - dependencies: - isexe "^2.0.0" - -wide-align@1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" - integrity sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA== - dependencies: - string-width "^1.0.2 || 2" - -window-size@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.2.0.tgz#b4315bb4214a3d7058ebeee892e13fa24d98b075" - integrity sha1-tDFbtCFKPXBY6+7okuE/ok2YsHU= - -winston-transport@^4.4.0: - version "4.4.0" - resolved "https://registry.yarnpkg.com/winston-transport/-/winston-transport-4.4.0.tgz#17af518daa690d5b2ecccaa7acf7b20ca7925e59" - integrity sha512-Lc7/p3GtqtqPBYYtS6KCN3c77/2QCev51DvcJKbkFPQNoj1sinkGwLGFDxkXY9J6p9+EPnYs+D90uwbnaiURTw== - dependencies: - readable-stream "^2.3.7" - triple-beam "^1.2.0" - -winston@*, winston@^3.3.3: - version "3.3.3" - resolved "https://registry.yarnpkg.com/winston/-/winston-3.3.3.tgz#ae6172042cafb29786afa3d09c8ff833ab7c9170" - integrity sha512-oEXTISQnC8VlSAKf1KYSSd7J6IWuRPQqDdo8eoRNaYKLvwSb5+79Z3Yi1lrl6KDpU6/VWaxpakDAtb1oQ4n9aw== - dependencies: - "@dabh/diagnostics" "^2.0.2" - async "^3.1.0" - is-stream "^2.0.0" - logform "^2.2.0" - one-time "^1.0.0" - readable-stream "^3.4.0" - stack-trace "0.0.x" - triple-beam "^1.3.0" - winston-transport "^4.4.0" - -wkx@^0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/wkx/-/wkx-0.5.0.tgz#c6c37019acf40e517cc6b94657a25a3d4aa33e8c" - integrity sha512-Xng/d4Ichh8uN4l0FToV/258EjMGU9MGcA0HV2d9B/ZpZB3lqQm7nkOdZdm5GhKtLLhAE7PiVQwN4eN+2YJJUg== - dependencies: - "@types/node" "*" - -wonka@^4.0.14: - version "4.0.15" - resolved "https://registry.yarnpkg.com/wonka/-/wonka-4.0.15.tgz#9aa42046efa424565ab8f8f451fcca955bf80b89" - integrity sha512-U0IUQHKXXn6PFo9nqsHphVCE5m3IntqZNB9Jjn7EB1lrR7YTDY3YWgFvEvwniTzXSvOH/XMzAZaIfJF/LvHYXg== - -word-wrap@^1.2.3, word-wrap@~1.2.3: - version "1.2.3" - resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" - integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== - -wordwrap@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" - integrity sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus= - -wrap-ansi@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" - integrity sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU= - dependencies: - string-width "^1.0.1" - strip-ansi "^3.0.1" - -wrap-ansi@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-5.1.0.tgz#1fd1f67235d5b6d0fee781056001bfb694c03b09" - integrity sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q== - dependencies: - ansi-styles "^3.2.0" - string-width "^3.0.0" - strip-ansi "^5.0.0" - -wrap-ansi@^6.2.0: - version "6.2.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz#e9393ba07102e6c91a3b221478f0257cd2856e53" - integrity sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - -wrap-ansi@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= - -ws@7.2.3: - version "7.2.3" - resolved "https://registry.yarnpkg.com/ws/-/ws-7.2.3.tgz#a5411e1fb04d5ed0efee76d26d5c46d830c39b46" - integrity sha512-HTDl9G9hbkNDk98naoR/cHDws7+EyYMOdL1BmjsZXRUjf7d+MficC4B7HLUPlSiho0vg+CWKrGIt/VJBd1xunQ== - -ws@^3.0.0: - version "3.3.3" - resolved "https://registry.yarnpkg.com/ws/-/ws-3.3.3.tgz#f1cf84fe2d5e901ebce94efaece785f187a228f2" - integrity sha512-nnWLa/NwZSt4KQJu51MYlCcSQ5g7INpOrOMt4XV8j4dqTXdmlUmSHQ8/oLC069ckre0fRsgfvsKwbTdtKLCDkA== - dependencies: - async-limiter "~1.0.0" - safe-buffer "~5.1.0" - ultron "~1.1.0" - -ws@^5.1.1: - version "5.2.2" - resolved "https://registry.yarnpkg.com/ws/-/ws-5.2.2.tgz#dffef14866b8e8dc9133582514d1befaf96e980f" - integrity sha512-jaHFD6PFv6UgoIVda6qZllptQsMlDEJkTQcybzzXDYM1XO9Y8em691FGMPmM46WGyLU4z9KMgQN+qrux/nhlHA== - dependencies: - async-limiter "~1.0.0" - -ws@^7.2.1: - version "7.4.6" - resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.6.tgz#5654ca8ecdeee47c33a9a4bf6d28e2be2980377c" - integrity sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A== - -xhr-request-promise@^0.1.2: - version "0.1.3" - resolved "https://registry.yarnpkg.com/xhr-request-promise/-/xhr-request-promise-0.1.3.tgz#2d5f4b16d8c6c893be97f1a62b0ed4cf3ca5f96c" - integrity sha512-YUBytBsuwgitWtdRzXDDkWAXzhdGB8bYm0sSzMPZT7Z2MBjMSTHFsyCT1yCRATY+XC69DUrQraRAEgcoCRaIPg== - dependencies: - xhr-request "^1.1.0" - -xhr-request@^1.0.1, xhr-request@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/xhr-request/-/xhr-request-1.1.0.tgz#f4a7c1868b9f198723444d82dcae317643f2e2ed" - integrity sha512-Y7qzEaR3FDtL3fP30k9wO/e+FBnBByZeybKOhASsGP30NIkRAAkKD/sCnLvgEfAIEC1rcmK7YG8f4oEnIrrWzA== - dependencies: - buffer-to-arraybuffer "^0.0.5" - object-assign "^4.1.1" - query-string "^5.0.1" - simple-get "^2.7.0" - timed-out "^4.0.1" - url-set-query "^1.0.0" - xhr "^2.0.4" - -xhr2-cookies@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/xhr2-cookies/-/xhr2-cookies-1.1.0.tgz#7d77449d0999197f155cb73b23df72505ed89d48" - integrity sha1-fXdEnQmZGX8VXLc7I99yUF7YnUg= - dependencies: - cookiejar "^2.1.1" - -xhr@^2.0.4, xhr@^2.2.0, xhr@^2.3.3: - version "2.6.0" - resolved "https://registry.yarnpkg.com/xhr/-/xhr-2.6.0.tgz#b69d4395e792b4173d6b7df077f0fc5e4e2b249d" - integrity sha512-/eCGLb5rxjx5e3mF1A7s+pLlR6CGyqWN91fv1JgER5mVWg1MZmlhBvy9kjcsOdRk8RrIujotWyJamfyrp+WIcA== - dependencies: - global "~4.4.0" - is-function "^1.0.1" - parse-headers "^2.0.0" - xtend "^4.0.0" - -xmlhttprequest@1.8.0: - version "1.8.0" - resolved "https://registry.yarnpkg.com/xmlhttprequest/-/xmlhttprequest-1.8.0.tgz#67fe075c5c24fef39f9d65f5f7b7fe75171968fc" - integrity sha1-Z/4HXFwk/vOfnWX197f+dRcZaPw= - -xtend@^4.0.0, xtend@^4.0.1, xtend@^4.0.2, xtend@~4.0.0, xtend@~4.0.1: - version "4.0.2" - resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" - integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== - -xtend@~2.1.1: - version "2.1.2" - resolved "https://registry.yarnpkg.com/xtend/-/xtend-2.1.2.tgz#6efecc2a4dad8e6962c4901b337ce7ba87b5d28b" - integrity sha1-bv7MKk2tjmlixJAbM3znuoe10os= - dependencies: - object-keys "~0.4.0" - -y18n@^3.2.1: - version "3.2.2" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.2.tgz#85c901bd6470ce71fc4bb723ad209b70f7f28696" - integrity sha512-uGZHXkHnhF0XeeAPgnKfPv1bgKAYyVvmNL1xlKsPYZPaIHxGti2hHqvOCQv71XMsLxu1QjergkqogUnms5D3YQ== - -y18n@^4.0.0: - version "4.0.3" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.3.tgz#b5f259c82cd6e336921efd7bfd8bf560de9eeedf" - integrity sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ== - -y18n@^5.0.5: - version "5.0.8" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" - integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== - -yaeti@^0.0.6: - version "0.0.6" - resolved "https://registry.yarnpkg.com/yaeti/-/yaeti-0.0.6.tgz#f26f484d72684cf42bedfb76970aa1608fbf9577" - integrity sha1-8m9ITXJoTPQr7ft2lwqhYI+/lXc= - -yallist@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" - integrity sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI= - -yallist@^3.0.0, yallist@^3.0.2, yallist@^3.0.3: - version "3.1.1" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" - integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== - -yallist@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" - integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== - -yaml@^1.10.0, yaml@^1.10.2: - version "1.10.2" - resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b" - integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg== - -yargs-parser@13.1.2, yargs-parser@^13.1.0, yargs-parser@^13.1.2: - version "13.1.2" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.1.2.tgz#130f09702ebaeef2650d54ce6e3e5706f7a4fb38" - integrity sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg== - dependencies: - camelcase "^5.0.0" - decamelize "^1.2.0" - -yargs-parser@^2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-2.4.1.tgz#85568de3cf150ff49fa51825f03a8c880ddcc5c4" - integrity sha1-hVaN488VD/SfpRgl8DqMiA3cxcQ= - dependencies: - camelcase "^3.0.0" - lodash.assign "^4.0.6" - -yargs-parser@^20.2.2: - version "20.2.7" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.7.tgz#61df85c113edfb5a7a4e36eb8aa60ef423cbc90a" - integrity sha512-FiNkvbeHzB/syOjIUxFDCnhSfzAL8R5vs40MgLFBorXACCOAEaWu0gRZl14vG8MR9AOJIZbmkjhusqBYZ3HTHw== - -yargs-parser@^8.1.0: - version "8.1.0" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-8.1.0.tgz#f1376a33b6629a5d063782944da732631e966950" - integrity sha512-yP+6QqN8BmrgW2ggLtTbdrOyBNSI7zBa4IykmiV5R1wl1JWNxQvWhMfMdmzIYtKU7oP3OOInY/tl2ov3BDjnJQ== - dependencies: - camelcase "^4.1.0" - -yargs-unparser@1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/yargs-unparser/-/yargs-unparser-1.6.0.tgz#ef25c2c769ff6bd09e4b0f9d7c605fb27846ea9f" - integrity sha512-W9tKgmSn0DpSatfri0nx52Joq5hVXgeLiqR/5G0sZNDoLZFOr/xjBUDcShCOGNsBnEMNo1KAMBkTej1Hm62HTw== - dependencies: - flat "^4.1.0" - lodash "^4.17.15" - yargs "^13.3.0" - -yargs@13.2.4: - version "13.2.4" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-13.2.4.tgz#0b562b794016eb9651b98bd37acf364aa5d6dc83" - integrity sha512-HG/DWAJa1PAnHT9JAhNa8AbAv3FPaiLzioSjCcmuXXhP8MlpHO5vwls4g4j6n30Z74GVQj8Xa62dWVx1QCGklg== - dependencies: - cliui "^5.0.0" - find-up "^3.0.0" - get-caller-file "^2.0.1" - os-locale "^3.1.0" - require-directory "^2.1.1" - require-main-filename "^2.0.0" - set-blocking "^2.0.0" - string-width "^3.0.0" - which-module "^2.0.0" - y18n "^4.0.0" - yargs-parser "^13.1.0" - -yargs@13.3.2, yargs@^13.3.0: - version "13.3.2" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-13.3.2.tgz#ad7ffefec1aa59565ac915f82dccb38a9c31a2dd" - integrity sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw== - dependencies: - cliui "^5.0.0" - find-up "^3.0.0" - get-caller-file "^2.0.1" - require-directory "^2.1.1" - require-main-filename "^2.0.0" - set-blocking "^2.0.0" - string-width "^3.0.0" - which-module "^2.0.0" - y18n "^4.0.0" - yargs-parser "^13.1.2" - -yargs@^10.0.3: - version "10.1.2" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-10.1.2.tgz#454d074c2b16a51a43e2fb7807e4f9de69ccb5c5" - integrity sha512-ivSoxqBGYOqQVruxD35+EyCFDYNEFL/Uo6FcOnz+9xZdZzK0Zzw4r4KhbrME1Oo2gOggwJod2MnsdamSG7H9ig== - dependencies: - cliui "^4.0.0" - decamelize "^1.1.1" - find-up "^2.1.0" - get-caller-file "^1.0.1" - os-locale "^2.0.0" - require-directory "^2.1.1" - require-main-filename "^1.0.1" - set-blocking "^2.0.0" - string-width "^2.0.0" - which-module "^2.0.0" - y18n "^3.2.1" - yargs-parser "^8.1.0" - -yargs@^17.0.0: - version "17.0.1" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.0.1.tgz#6a1ced4ed5ee0b388010ba9fd67af83b9362e0bb" - integrity sha512-xBBulfCc8Y6gLFcrPvtqKz9hz8SO0l1Ni8GgDekvBX2ro0HRQImDGnikfc33cgzcYUSncapnNcZDjVFIH3f6KQ== - dependencies: - cliui "^7.0.2" - escalade "^3.1.1" - get-caller-file "^2.0.5" - require-directory "^2.1.1" - string-width "^4.2.0" - y18n "^5.0.5" - yargs-parser "^20.2.2" - -yargs@^4.7.1: - version "4.8.1" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-4.8.1.tgz#c0c42924ca4aaa6b0e6da1739dfb216439f9ddc0" - integrity sha1-wMQpJMpKqmsObaFznfshZDn53cA= - dependencies: - cliui "^3.2.0" - decamelize "^1.1.1" - get-caller-file "^1.0.1" - lodash.assign "^4.0.3" - os-locale "^1.4.0" - read-pkg-up "^1.0.1" - require-directory "^2.1.1" - require-main-filename "^1.0.1" - set-blocking "^2.0.0" - string-width "^1.0.1" - which-module "^1.0.0" - window-size "^0.2.0" - y18n "^3.2.1" - yargs-parser "^2.4.1" - -yn@3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" - integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q== - -yocto-queue@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" - integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==